From 972cc88cef3881a028caa673cce70e4d52e03542 Mon Sep 17 00:00:00 2001 From: "Nikola R. Hristov" Date: Wed, 1 May 2024 02:46:43 +0300 Subject: [PATCH 01/82] squash! --- .github/CODE_OF_CONDUCT.md | 127 - .github/SECURITY.md | 7 - .github/actions/pnpm/action.yml | 23 - .github/actions/rustup/action.yml | 88 - .github/codecov.yml | 14 - .github/renovate.json | 26 - .github/workflows/benchmark.yml | 45 - .github/workflows/ci.yml | 218 -- .github/workflows/codecov.yml | 76 - .github/workflows/release-napi.yml | 220 -- .github/workflows/release-plz.yml | 33 - Cargo.lock | 881 ------ {src => Source}/builtins.rs | 0 {src => Source}/cache.rs | 0 {src => Source}/context.rs | 0 {src => Source}/error.rs | 0 {src => Source}/file_system.rs | 0 {src => Source}/lib.rs | 0 {src => Source}/options.rs | 0 {src => Source}/package_json.rs | 0 {src => Source}/path.rs | 0 {src => Source}/resolution.rs | 0 {src => Source}/specifier.rs | 0 {src => Source}/tsconfig.rs | 0 fixtures/enhanced_resolve/lib/index.js | 1 - fixtures/enhanced_resolve/package.json | 4 - fixtures/enhanced_resolve/test/.gitignore | 2 - fixtures/enhanced_resolve/test/fixtures/a.js | 3 - .../enhanced_resolve/test/fixtures/abc.txt | 1 - .../test/fixtures/alias/files/a.js | 0 fixtures/enhanced_resolve/test/fixtures/b.js | 3 - .../browser-module/browser/module-a.js | 0 .../fixtures/browser-module/lib/browser.js | 0 .../fixtures/browser-module/lib/ignore.js | 0 .../test/fixtures/browser-module/lib/main.js | 0 .../fixtures/browser-module/lib/replaced.js | 0 .../test/fixtures/browser-module/lib/self.js | 0 .../fixtures/browser-module/lib/toString.js | 0 .../browser-module/node_modules/module-a.js | 0 .../browser-module/node_modules/module-b.js | 0 .../browser-module/node_modules/module-c.js | 0 .../node_modules/recursive-file/a.js | 0 .../node_modules/recursive-file/b.js | 0 .../node_modules/recursive-file/c.js | 0 .../node_modules/recursive-file/d.js | 0 .../node_modules/recursive-file/package.json | 8 - .../test/fixtures/browser-module/package.json | 31 - fixtures/enhanced_resolve/test/fixtures/c.js | 4 - .../enhanced_resolve/test/fixtures/complex.js | 13 - .../test/fixtures/crypto-js/index.js | 0 .../test/fixtures/crypto-js/package.json | 7 - .../test/fixtures/decorated-fs/exists.js | 0 .../test/fixtures/dirOrFile.js | 1 - .../test/fixtures/dirOrFile/index.js | 1 - .../directory-default/directory-default.js | 0 .../node_modules/@org/pkg/dist/string.js | 1 - .../@org/pkg/dist/string.test.d.ts | 1 - .../node_modules/@org/pkg/package.json | 9 - .../node_modules/pkg/dist/string.js | 1 - .../node_modules/pkg/dist/string.test.d.ts | 1 - .../node_modules/pkg/package.json | 9 - .../node_modules/exports-field/package.json | 7 - .../node_modules/pack1/index.js | 0 .../test/fixtures/exports-field/a.js | 1 - .../node_modules/exports-field/lib/browser.js | 1 - .../node_modules/exports-field/lib/index.js | 0 .../exports-field/lib/lib2/main.js | 1 - .../node_modules/exports-field/lib/main.js | 1 - .../node_modules/exports-field/main.js | 1 - .../node_modules/exports-field/package.json | 18 - .../node_modules/exports-field/x.js | 1 - .../invalid-exports-field/index.js | 0 .../invalid-exports-field/package.json | 13 - .../node_modules/invalid-exports-field/umd.js | 0 .../test/fixtures/exports-field/package.json | 5 - .../node_modules/exports-field/index.js | 1 - .../node_modules/exports-field/lib/browser.js | 1 - .../exports-field/lib/lib2/main.js | 1 - .../node_modules/exports-field/lib/main.js | 1 - .../node_modules/exports-field/main.js | 1 - .../node_modules/exports-field/package.json | 17 - .../node_modules/exports-field/index | 0 .../node_modules/exports-field/main.js | 1 - .../node_modules/exports-field/package.json | 10 - .../node_modules/exports-field/src/index.js | 0 .../fixtures/extension-alias/dir/index.js | 0 .../fixtures/extension-alias/dir/index.ts | 0 .../fixtures/extension-alias/dir2/index.js | 0 .../fixtures/extension-alias/dir2/index.mts | 0 .../test/fixtures/extension-alias/index.js | 0 .../test/fixtures/extension-alias/index.mjs | 0 .../fixtures/extension-alias/index.mts.js | 0 .../test/fixtures/extension-alias/index.ts | 0 .../test/fixtures/extensions/app.module.js | 0 .../test/fixtures/extensions/dir/index.js | 0 .../test/fixtures/extensions/dir/index.ts | 0 .../test/fixtures/extensions/foo.js | 0 .../test/fixtures/extensions/foo.ts | 0 .../test/fixtures/extensions/index.js | 0 .../test/fixtures/extensions/index.ts | 0 .../extensions/node_modules/module.js | 0 .../extensions/node_modules/module/index.ts | 0 .../test/fixtures/extensions/package.json | 3 - .../enhanced_resolve/test/fixtures/file.load1 | 0 .../enhanced_resolve/test/fixtures/file.load2 | 0 .../test/fixtures/foo/index.js | 0 .../test/fixtures/foo/package.json | 4 - .../node_modules/m/package.json | 17 - .../node_modules/m/src/features/f.js | 0 .../m/src/features/internal/file.js | 0 .../node_modules/m/src/features/y/y.js | 0 .../node_modules/m/src/internal/i.js | 0 .../node_modules/m/src/middle-1/f.js | 0 .../node_modules/m/src/middle-1/nested/f.js | 0 .../node_modules/m/src/middle-2/nested/f.js | 1 - .../m/src/middle-3/nested/f/nested/f.js | 0 .../node_modules/m/src/middle-4/f/f.js | 0 .../node_modules/m/src/middle-5/f$/$.js | 0 .../node_modules/m/src/middle-5/f/$.js | 0 .../node_modules/m/src/middle/f.js | 0 .../node_modules/m/src/middle/nested/f.js | 0 .../test/fixtures/imports-field/a.js | 1 - .../test/fixtures/imports-field/b.js | 0 .../test/fixtures/imports-field/dir/b.js | 0 .../node_modules/a/lib/browser.js | 1 - .../imports-field/node_modules/a/lib/index.js | 0 .../node_modules/a/lib/lib2/main.js | 1 - .../imports-field/node_modules/a/lib/main.js | 1 - .../imports-field/node_modules/a/main.js | 1 - .../imports-field/node_modules/a/package.json | 18 - .../imports-field/node_modules/a/x.js | 1 - .../imports-field/node_modules/c/index.js | 0 .../test/fixtures/imports-field/package.json | 17 - .../fixtures/incorrect-package/pack1/a.js | 0 .../incorrect-package/pack1/package.json | 2 - .../fixtures/incorrect-package/pack2/a.js | 0 .../incorrect-package/pack2/package.json | 0 .../test/fixtures/issue-238/package.json | 3 - .../test/fixtures/issue-238/src/a/config.js | 0 .../src/common/config/myObjectFile.js | 0 .../enhanced_resolve/test/fixtures/lib.js | 0 .../test/fixtures/lib/complex1.js | 1 - .../test/fixtures/main-field-self/index.js | 0 .../fixtures/main-field-self/package.json | 3 - .../test/fixtures/main-field-self2/index.js | 0 .../fixtures/main-field-self2/package.json | 3 - .../enhanced_resolve/test/fixtures/main1.js | 9 - .../enhanced_resolve/test/fixtures/main2.js | 12 - .../enhanced_resolve/test/fixtures/main3.js | 4 - .../multiple_modules/node_modules/m1/a.js | 3 - .../test/fixtures/no#fragment/#/#.js | 0 fixtures/enhanced_resolve/test/fixtures/no.js | 0 .../browser-module-broken/browser.js | 0 .../browser-module-broken/main.js | 0 .../browser-module-broken/package.json | 4 - .../complexm/node_modules/m1/a.js | 1 - .../complexm/node_modules/m1/index.js | 1 - .../fixtures/node_modules/complexm/step1.js | 1 - .../fixtures/node_modules/complexm/step2.js | 1 - .../fixtures/node_modules/dash-name/index.js | 0 .../node_modules/dash-name/package.json | 4 - .../test/fixtures/node_modules/dash/index.js | 0 .../fixtures/node_modules/dash/package.json | 4 - .../invalidPackageJson/package.json | 0 .../test/fixtures/node_modules/m1/a.js | 3 - .../test/fixtures/node_modules/m1/b.js | 3 - .../test/fixtures/node_modules/m2/b.js | 1 - .../node_modules/recursive-module/file.js | 0 .../node_modules/recursive-module/index.js | 0 .../test/fixtures/pnp-a/m2/a.js | 3 - .../test/fixtures/pnp/pkg/dir/index.js | 0 .../test/fixtures/pnp/pkg/index.js | 0 .../test/fixtures/pnp/pkg/main.js | 0 .../fixtures/pnp/pkg/package-alias/browser.js | 0 .../fixtures/pnp/pkg/package-alias/index.js | 0 .../test/fixtures/pnp/pkg/package.json | 7 - .../test/fixtures/pnp/pkg/typescript/index.ts | 0 .../test/fixtures/pnp/pkg3/a.js | 1 - .../test/fixtures/pnp/pkg3/package.json | 8 - .../prefer-pnp/alternative-modules/m1/b.js | 0 .../restrictions/node_modules/pck1/index.css | 0 .../restrictions/node_modules/pck1/index.js | 0 .../node_modules/pck1/package.json | 3 - .../restrictions/node_modules/pck2/index.css | 0 .../restrictions/node_modules/pck2/module.js | 0 .../node_modules/pck2/package.json | 5 - .../test/fixtures/roots_fall_through/index.js | 0 .../scoped/node_modules/@scope/pack1/main.js | 0 .../node_modules/@scope/pack1/package.json | 5 - .../node_modules/@scope/pack2/lib/index.js | 0 .../scoped/node_modules/@scope/pack2/main.js | 0 .../node_modules/@scope/pack2/package.json | 3 - .../test/fixtures/shortcutdir.js/a.js | 0 .../test/fixtures/yield/a/foo-2/b | 0 .../test/fixtures/yield/a/foo-2/c | 0 .../test/fixtures/yield/a/foo/a | 0 .../test/fixtures/yield/a/foo/b | 0 .../test/fixtures/yield/b/foo/a | 0 .../test/fixtures/yield/c/foo/a | 0 .../test/fixtures/yield/c/foo/package.json | 7 - .../fixtures/\346\265\213\350\257\225.js" | 0 .../\344\270\255\346\226\207.js" | 0 fixtures/pnpm8/.gitignore | 1 - fixtures/pnpm8/package.json | 14 - fixtures/pnpm8/pnpm-lock.yaml | 212 -- fixtures/tsconfig/cases/builtins/thing.js | 0 .../tsconfig/cases/builtins/tsconfig.json | 5 - fixtures/tsconfig/cases/exports/index.js | 0 fixtures/tsconfig/cases/exports/tsconfig.json | 3 - .../extends-extension/base-tsconfig.json | 7 - .../tsconfig/cases/extends-extension/foo.js | 0 .../cases/extends-extension/tsconfig.json | 3 - .../cases/extends-extensionless/foo.js | 0 .../cases/extends-extensionless/tsconfig.json | 3 - .../tsconfig/cases/extends-multiple/foo.js | 0 .../cases/extends-multiple/tsconfig.json | 6 - .../tsconfig/cases/extends-not-found/index.js | 0 .../cases/extends-not-found/tsconfig.json | 3 - .../tsconfig/cases/extends-paths/src/index.js | 0 .../cases/extends-paths/tsconfig.base.json | 7 - .../cases/extends-paths/tsconfig.json | 6 - fixtures/tsconfig/cases/field/index.js | 0 fixtures/tsconfig/cases/field/tsconfig.json | 3 - fixtures/tsconfig/cases/index/index.js | 0 fixtures/tsconfig/cases/index/tsconfig.json | 3 - .../cases/paths_template_variable/foo.js | 0 .../paths_template_variable/tsconfig1.json | 3 - .../paths_template_variable/tsconfig2.json | 8 - .../project_references/app/aliased/index.ts | 0 .../cases/project_references/app/index.ts | 0 .../project_references/app/tsconfig.json | 23 - .../project_a/aliased/index.ts | 0 .../project_references/project_a/conf.json | 8 - .../project_references/project_a/index.ts | 0 .../project_b/src/aliased/index.ts | 0 .../project_b/tsconfig.json | 9 - .../project_references/project_c/index.ts | 0 .../project_c/tsconfig.json | 5 - .../project_references/tsconfig.base.json | 4 - fixtures/tsconfig/cases/suffixes/a.ios.ts | 0 fixtures/tsconfig/cases/suffixes/a.ts | 0 fixtures/tsconfig/cases/suffixes/b.ts | 0 fixtures/tsconfig/cases/suffixes/c-test.ts | 0 fixtures/tsconfig/cases/suffixes/index.ts | 1 - .../tsconfig/cases/suffixes/tsconfig.json | 5 - fixtures/tsconfig/cases/trailing-comma/bar.js | 0 .../tsconfig/cases/trailing-comma/index.js | 0 .../cases/trailing-comma/tsconfig.json | 9 - fixtures/tsconfig/foo.js | 0 fixtures/tsconfig/nested/index.js | 0 fixtures/tsconfig/nested/test.js | 0 fixtures/tsconfig/nested/tsconfig.json | 8 - .../node_modules/tsconfig-exports/conf.json | 7 - .../node_modules/tsconfig-exports/foo.js | 0 .../tsconfig-exports/package.json | 7 - .../node_modules/tsconfig-field/conf.json | 7 - .../node_modules/tsconfig-field/foo.js | 0 .../node_modules/tsconfig-field/package.json | 5 - .../node_modules/tsconfig-index/foo.js | 0 .../node_modules/tsconfig-index/package.json | 4 - .../node_modules/tsconfig-index/tsconfig.json | 7 - .../node_modules/tsconfig-not-used/foo.js | 0 .../tsconfig-not-used/tsconfig.json | 7 - fixtures/tsconfig/package.json | 24 - fixtures/tsconfig/tsconfig.json | 7 - .../tsconfig/tsconfig_template_variable.json | 7 - napi/{src => Source}/lib.rs | 0 napi/{src => Source}/options.rs | 0 napi/__test__/resolver.spec.mjs | 259 -- napi/tests/options.test.mjs | 59 - npm/package.json | 98 +- package.json | 82 +- pnpm-lock.yaml | 2450 ---------------- src/tests/alias.rs | 220 -- src/tests/browser_field.rs | 175 -- src/tests/builtins.rs | 98 - src/tests/dependencies.rs | 110 - src/tests/exports_field.rs | 2546 ----------------- src/tests/extension_alias.rs | 66 - src/tests/extensions.rs | 125 - src/tests/fallback.rs | 100 - src/tests/full_specified.rs | 113 - src/tests/imports_field.rs | 1320 --------- src/tests/incorrect_description_file.rs | 62 - src/tests/main_field.rs | 24 - src/tests/memory_fs.rs | 74 - src/tests/missing.rs | 106 - src/tests/mod.rs | 49 - src/tests/resolve.rs | 119 - src/tests/restrictions.rs | 25 - src/tests/roots.rs | 89 - src/tests/scoped_packages.rs | 25 - src/tests/simple.rs | 68 - src/tests/symlink.rs | 121 - src/tests/tsconfig_paths.rs | 507 ---- src/tests/tsconfig_project_references.rs | 101 - tests/integration_test.rs | 101 - tests/package.json | 3 - tests/resolve_test.rs | 95 - 299 files changed, 107 insertions(+), 11836 deletions(-) delete mode 100644 .github/CODE_OF_CONDUCT.md delete mode 100644 .github/SECURITY.md delete mode 100644 .github/actions/pnpm/action.yml delete mode 100644 .github/actions/rustup/action.yml delete mode 100644 .github/codecov.yml delete mode 100644 .github/renovate.json delete mode 100644 .github/workflows/benchmark.yml delete mode 100644 .github/workflows/ci.yml delete mode 100644 .github/workflows/codecov.yml delete mode 100644 .github/workflows/release-napi.yml delete mode 100644 .github/workflows/release-plz.yml delete mode 100644 Cargo.lock rename {src => Source}/builtins.rs (100%) rename {src => Source}/cache.rs (100%) rename {src => Source}/context.rs (100%) rename {src => Source}/error.rs (100%) rename {src => Source}/file_system.rs (100%) rename {src => Source}/lib.rs (100%) rename {src => Source}/options.rs (100%) rename {src => Source}/package_json.rs (100%) rename {src => Source}/path.rs (100%) rename {src => Source}/resolution.rs (100%) rename {src => Source}/specifier.rs (100%) rename {src => Source}/tsconfig.rs (100%) delete mode 100644 fixtures/enhanced_resolve/lib/index.js delete mode 100644 fixtures/enhanced_resolve/package.json delete mode 100644 fixtures/enhanced_resolve/test/.gitignore delete mode 100644 fixtures/enhanced_resolve/test/fixtures/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/abc.txt delete mode 100644 fixtures/enhanced_resolve/test/fixtures/alias/files/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/browser/module-a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/ignore.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/replaced.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/self.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/toString.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-c.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/c.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/d.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/c.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/complex.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/crypto-js/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/decorated-fs/exists.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/dirOrFile.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/directory-default/directory-default.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/pack1/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/umd.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/index delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/src/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.mts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mjs delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mts.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/app.module.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/foo.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/foo.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/file.load1 delete mode 100644 fixtures/enhanced_resolve/test/fixtures/file.load2 delete mode 100644 fixtures/enhanced_resolve/test/fixtures/foo/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/foo/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/internal/file.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/y/y.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/internal/i.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-3/nested/f/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-4/f/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f$/$.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f/$.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/dir/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/c/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/issue-238/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/issue-238/src/a/config.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/issue-238/src/common/config/myObjectFile.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/lib.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/lib/complex1.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self2/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main1.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main2.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main3.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/no#fragment/#/#.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/no.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/invalidPackageJson/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/file.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/dir/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/typescript/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/prefer-pnp/alternative-modules/m1/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.css delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/index.css delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/module.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/roots_fall_through/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/lib/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/shortcutdir.js/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/b delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/c delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo/a delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo/b delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/b/foo/a delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/c/foo/a delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json delete mode 100644 "fixtures/enhanced_resolve/test/fixtures/\346\265\213\350\257\225.js" delete mode 100644 "fixtures/misc/\344\270\255\346\226\207/\344\270\255\346\226\207.js" delete mode 100644 fixtures/pnpm8/.gitignore delete mode 100644 fixtures/pnpm8/package.json delete mode 100644 fixtures/pnpm8/pnpm-lock.yaml delete mode 100644 fixtures/tsconfig/cases/builtins/thing.js delete mode 100644 fixtures/tsconfig/cases/builtins/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/exports/index.js delete mode 100644 fixtures/tsconfig/cases/exports/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-extension/base-tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-extension/foo.js delete mode 100644 fixtures/tsconfig/cases/extends-extension/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-extensionless/foo.js delete mode 100644 fixtures/tsconfig/cases/extends-extensionless/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-multiple/foo.js delete mode 100644 fixtures/tsconfig/cases/extends-multiple/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-not-found/index.js delete mode 100644 fixtures/tsconfig/cases/extends-not-found/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-paths/src/index.js delete mode 100644 fixtures/tsconfig/cases/extends-paths/tsconfig.base.json delete mode 100644 fixtures/tsconfig/cases/extends-paths/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/field/index.js delete mode 100644 fixtures/tsconfig/cases/field/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/index/index.js delete mode 100644 fixtures/tsconfig/cases/index/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/paths_template_variable/foo.js delete mode 100644 fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json delete mode 100644 fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json delete mode 100644 fixtures/tsconfig/cases/project_references/app/aliased/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/app/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/app/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/project_references/project_a/aliased/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_a/conf.json delete mode 100644 fixtures/tsconfig/cases/project_references/project_a/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_b/src/aliased/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_b/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/project_references/project_c/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_c/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/project_references/tsconfig.base.json delete mode 100644 fixtures/tsconfig/cases/suffixes/a.ios.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/a.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/b.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/c-test.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/index.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/trailing-comma/bar.js delete mode 100644 fixtures/tsconfig/cases/trailing-comma/index.js delete mode 100644 fixtures/tsconfig/cases/trailing-comma/tsconfig.json delete mode 100644 fixtures/tsconfig/foo.js delete mode 100644 fixtures/tsconfig/nested/index.js delete mode 100644 fixtures/tsconfig/nested/test.js delete mode 100644 fixtures/tsconfig/nested/tsconfig.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-exports/conf.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-exports/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-exports/package.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-field/conf.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-field/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-field/package.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-index/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-index/package.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-not-used/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json delete mode 100755 fixtures/tsconfig/package.json delete mode 100644 fixtures/tsconfig/tsconfig.json delete mode 100644 fixtures/tsconfig/tsconfig_template_variable.json rename napi/{src => Source}/lib.rs (100%) rename napi/{src => Source}/options.rs (100%) delete mode 100644 napi/__test__/resolver.spec.mjs delete mode 100644 napi/tests/options.test.mjs delete mode 100644 pnpm-lock.yaml delete mode 100644 src/tests/alias.rs delete mode 100644 src/tests/browser_field.rs delete mode 100644 src/tests/builtins.rs delete mode 100644 src/tests/dependencies.rs delete mode 100644 src/tests/exports_field.rs delete mode 100644 src/tests/extension_alias.rs delete mode 100644 src/tests/extensions.rs delete mode 100644 src/tests/fallback.rs delete mode 100644 src/tests/full_specified.rs delete mode 100644 src/tests/imports_field.rs delete mode 100644 src/tests/incorrect_description_file.rs delete mode 100644 src/tests/main_field.rs delete mode 100644 src/tests/memory_fs.rs delete mode 100644 src/tests/missing.rs delete mode 100644 src/tests/mod.rs delete mode 100644 src/tests/resolve.rs delete mode 100644 src/tests/restrictions.rs delete mode 100644 src/tests/roots.rs delete mode 100644 src/tests/scoped_packages.rs delete mode 100644 src/tests/simple.rs delete mode 100644 src/tests/symlink.rs delete mode 100644 src/tests/tsconfig_paths.rs delete mode 100644 src/tests/tsconfig_project_references.rs delete mode 100644 tests/integration_test.rs delete mode 100644 tests/package.json delete mode 100644 tests/resolve_test.rs diff --git a/.github/CODE_OF_CONDUCT.md b/.github/CODE_OF_CONDUCT.md deleted file mode 100644 index 41dd9ebe..00000000 --- a/.github/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,127 +0,0 @@ -# Contributor Covenant Code of Conduct - -## Our Pledge - -We as members, contributors, and leaders pledge to make participation in our -community a harassment-free experience for everyone, regardless of age, body -size, visible or invisible disability, ethnicity, sex characteristics, gender -identity and expression, level of experience, education, socio-economic status, -nationality, personal appearance, race, religion, or sexual identity -and orientation. - -We pledge to act and interact in ways that contribute to an open, welcoming, -diverse, inclusive, and healthy community. - -## Our Standards - -Examples of behavior that contributes to a positive environment for our -community include: - -* Demonstrating empathy and kindness toward other people -* Being respectful of differing opinions, viewpoints, and experiences -* Giving and gracefully accepting constructive feedback -* Accepting responsibility and apologizing to those affected by our mistakes, - and learning from the experience -* Focusing on what is best not just for us as individuals, but for the - overall community - -Examples of unacceptable behavior include: - -* The use of sexualized language or imagery, and sexual attention or - advances of any kind -* Trolling, insulting or derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or email - address, without their explicit permission -* Other conduct which could reasonably be considered inappropriate in a - professional setting - -## Enforcement Responsibilities - -Community leaders are responsible for clarifying and enforcing our standards of -acceptable behavior and will take appropriate and fair corrective action in -response to any behavior that they deem inappropriate, threatening, offensive, -or harmful. - -Community leaders have the right and responsibility to remove, edit, or reject -comments, commits, code, wiki edits, issues, and other contributions that are -not aligned to this Code of Conduct, and will communicate reasons for moderation -decisions when appropriate. - -## Scope - -This Code of Conduct applies within all community spaces, and also applies when -an individual is officially representing the community in public spaces. -Examples of representing our community include using an official e-mail address, -posting via an official social media account, or acting as an appointed -representative at an online or offline event. - -## Enforcement - -Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported to the community leaders responsible for enforcement. -All complaints will be reviewed and investigated promptly and fairly. - -All community leaders are obligated to respect the privacy and security of the -reporter of any incident. - -## Enforcement Guidelines - -Community leaders will follow these Community Impact Guidelines in determining -the consequences for any action they deem in violation of this Code of Conduct: - -### 1. Correction - -**Community Impact**: Use of inappropriate language or other behavior deemed -unprofessional or unwelcome in the community. - -**Consequence**: A private, written warning from community leaders, providing -clarity around the nature of the violation and an explanation of why the -behavior was inappropriate. A public apology may be requested. - -### 2. Warning - -**Community Impact**: A violation through a single incident or series -of actions. - -**Consequence**: A warning with consequences for continued behavior. No -interaction with the people involved, including unsolicited interaction with -those enforcing the Code of Conduct, for a specified period of time. This -includes avoiding interactions in community spaces as well as external channels -like social media. Violating these terms may lead to a temporary or -permanent ban. - -### 3. Temporary Ban - -**Community Impact**: A serious violation of community standards, including -sustained inappropriate behavior. - -**Consequence**: A temporary ban from any sort of interaction or public -communication with the community for a specified period of time. No public or -private interaction with the people involved, including unsolicited interaction -with those enforcing the Code of Conduct, is allowed during this period. -Violating these terms may lead to a permanent ban. - -### 4. Permanent Ban - -**Community Impact**: Demonstrating a pattern of violation of community -standards, including sustained inappropriate behavior, harassment of an -individual, or aggression toward or disparagement of classes of individuals. - -**Consequence**: A permanent ban from any sort of public interaction within -the community. - -## Attribution - -This Code of Conduct is adapted from the [Contributor Covenant][homepage], -version 2.0, available at -https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. - -Community Impact Guidelines were inspired by [Mozilla's code of conduct -enforcement ladder](https://github.com/mozilla/diversity). - -[homepage]: https://www.contributor-covenant.org - -For answers to common questions about this code of conduct, see the FAQ at -https://www.contributor-covenant.org/faq. Translations are available at -https://www.contributor-covenant.org/translations. diff --git a/.github/SECURITY.md b/.github/SECURITY.md deleted file mode 100644 index 63f5b072..00000000 --- a/.github/SECURITY.md +++ /dev/null @@ -1,7 +0,0 @@ -# Security Policy - -## Supported Versions - -## Reporting a Vulnerability - -If you find any potential vulnerability, join our [discord channel](https://discord.gg/9uXCAwqQZW) and contact Boshen. diff --git a/.github/actions/pnpm/action.yml b/.github/actions/pnpm/action.yml deleted file mode 100644 index 2ff4f975..00000000 --- a/.github/actions/pnpm/action.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: Pnpm - -description: Install pnpm - -runs: - using: composite - steps: - - name: Install pnpm - working-directory: fixtures/pnpm8 - shell: bash - run: corepack enable - - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: 18 - cache-dependency-path: ./fixtures/pnpm8/package.json - cache: pnpm - - - name: pnpm install - working-directory: fixtures/pnpm8 - shell: bash - run: pnpm install diff --git a/.github/actions/rustup/action.yml b/.github/actions/rustup/action.yml deleted file mode 100644 index f0a60b41..00000000 --- a/.github/actions/rustup/action.yml +++ /dev/null @@ -1,88 +0,0 @@ -name: Rustup - -description: Install Rust with minimal profile and additional components - -inputs: - # See https://rust-lang.github.io/rustup/concepts/components.html - clippy: - default: false - required: false - type: boolean - fmt: - default: false - required: false - type: boolean - docs: - default: false - required: false - type: boolean - restore-cache: - default: true - required: false - type: boolean - save-cache: - default: false - required: false - type: boolean - shared-key: - default: 'warm' - required: false - type: string - -runs: - using: composite - steps: - - name: Print Inputs - shell: bash - run: | - echo 'clippy: ${{ inputs.clippy }}' - echo 'fmt: ${{ inputs.fmt }}' - echo 'docs: ${{ inputs.docs }}' - echo 'restore-cache: ${{ inputs.restore-cache }}' - echo 'save-cache: ${{ inputs.save-cache }}' - - - name: Change to minimal profile on MacOS - shell: bash - if: runner.os == 'macOS' - run: | - sed -i '' -e 's/profile = "default"/profile = "minimal"/g' rust-toolchain.toml - cat rust-toolchain.toml - - - name: Change to minimal profile on non-MacOS - shell: bash - if: runner.os != 'macOS' - run: | - sed -i -e 's/profile = "default"/profile = "minimal"/g' rust-toolchain.toml - cat rust-toolchain.toml - - - name: Set minimal - shell: bash - run: rustup set profile minimal - - - name: Add Clippy - shell: bash - if: ${{ inputs.clippy == 'true' }} - run: rustup component add clippy - - - name: Add Rustfmt - shell: bash - if: ${{ inputs.fmt == 'true' }} - run: rustup component add rustfmt - - - name: Add docs - shell: bash - if: ${{ inputs.docs == 'true' }} - run: rustup component add rust-docs - - - name: Install - shell: bash - run: | - rustup show - git restore . - - - name: Cache on ${{ github.ref_name }} - uses: Swatinem/rust-cache@v2 - if: ${{ inputs.restore-cache == 'true' }} - with: - shared-key: ${{ inputs.shared-key }} - save-if: ${{ inputs.save-cache == 'true' }} diff --git a/.github/codecov.yml b/.github/codecov.yml deleted file mode 100644 index 0610268a..00000000 --- a/.github/codecov.yml +++ /dev/null @@ -1,14 +0,0 @@ -coverage: - status: - project: - default: - informational: true - patch: - default: - informational: true - changes: - default: - informational: true - -ignore: - - "examples" diff --git a/.github/renovate.json b/.github/renovate.json deleted file mode 100644 index aa195fd0..00000000 --- a/.github/renovate.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "$schema": "https://docs.renovatebot.com/renovate-schema.json", - "timezone": "Asia/Shanghai", - "schedule": ["before 8am on monday"], - "ignorePaths": [ - "fixtures/**" - ], - "assignees": ["@Boshen"], - "packageRules": [ - { - "groupName": "github-actions", - "matchManagers": ["github-actions"] - }, - { - "groupName": "rust crates", - "matchManagers": ["cargo"] - }, - { - "groupName": "npm packages", - "matchManagers": ["npm"] - } - ], - "lockFileMaintenance": { - "enabled": true - } -} diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml deleted file mode 100644 index 1757b376..00000000 --- a/.github/workflows/benchmark.yml +++ /dev/null @@ -1,45 +0,0 @@ -name: Benchmark - -on: - workflow_dispatch: - pull_request: - types: [opened, synchronize] - paths-ignore: - - '**/*.md' - push: - branches: - - main - paths-ignore: - - '**/*.md' - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} - cancel-in-progress: true - -jobs: - benchmark: - name: Benchmark - runs-on: ubuntu-latest - steps: - - name: Checkout Branch - uses: taiki-e/checkout-action@v1 - - - name: Install Rust - uses: moonrepo/setup-rust@v1 - with: - cache-base: main - - - name: Install codspeed - uses: taiki-e/install-action@v2 - with: - tool: cargo-codspeed - - - name: Build Benchmark - run: cargo codspeed build --features codspeed - - - name: Run benchmark - uses: CodSpeedHQ/action@v2 - timeout-minutes: 30 - with: - run: cargo codspeed run - token: ${{ secrets.CODSPEED_TOKEN }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index 81cd39c9..00000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,218 +0,0 @@ -name: CI - -on: - workflow_dispatch: - pull_request: - types: [opened, synchronize] - paths-ignore: - - '**/*.md' - push: - branches: - - main - paths-ignore: - - '**/*.md' - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} - cancel-in-progress: ${{ github.ref_name != 'main' }} - -jobs: - cache: # Warm cache factory for all other CI jobs - name: Check and Build - strategy: - fail-fast: false - matrix: - include: - - os: windows-latest - - os: ubuntu-latest - - os: macos-14 - runs-on: ${{ matrix.os }} - steps: - - uses: taiki-e/checkout-action@v1 - - - name: Install Rust Toolchain - uses: ./.github/actions/rustup - with: - save-cache: ${{ github.ref_name == 'main' }} - - - name: Cargo check - run: cargo check --all-features --locked - - # Only need to build the test to create a warm cache on the main branch - - name: Build cache by Cargo Check and Cargo Test - if: ${{ github.ref_name == 'main' }} - run: cargo test --all-features --no-run - - wasm: - name: Check Wasm - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - - name: Install Rust Toolchain - uses: ./.github/actions/rustup - with: - shared-key: 'wasm' - save-cache: ${{ github.ref_name == 'main' }} - - - name: Check - run: | - rustup target add wasm32-unknown-unknown - cargo check --target wasm32-unknown-unknown - - wasi: - name: Test wasi target - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - - name: Install Rust Toolchain - uses: ./.github/actions/rustup - with: - shared-key: 'wasi' - save-cache: ${{ github.ref_name == 'main' }} - - - name: corepack - run: corepack enable - - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: 20 - cache: pnpm - - - name: Install dependencies - run: pnpm install --frozen-lockfile - - - name: Install fixtures dependencies - working-directory: fixtures/pnpm8 - run: pnpm install --frozen-lockfile - - - name: Build - run: | - rustup target add wasm32-wasi-preview1-threads - pnpm build --target wasm32-wasi-preview1-threads - - - name: Test - run: pnpm test - env: - WASI_TEST: 1 - - typos: - name: Spell Check - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - - uses: crate-ci/typos@master - with: - files: . - - deny: - name: Cargo Deny - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - - uses: dorny/paths-filter@v3 - id: filter - with: - filters: | - src: - - 'Cargo.lock' - - - name: Install cargo-deny - if: steps.filter.outputs.src == 'true' - uses: taiki-e/install-action@cargo-deny - - - uses: ./.github/actions/rustup - with: - restore-cache: false - - - if: steps.filter.outputs.src == 'true' - run: cargo deny check - - unused-deps: - name: Check Unused Dependencies - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - uses: dorny/paths-filter@v3 - id: filter - with: - filters: | - src: - - '**/*.rs' - - '**/Cargo.toml' - - 'Cargo.lock' - - uses: ./.github/actions/rustup - with: - restore-cache: false - if: steps.filter.outputs.src == 'true' - - uses: cargo-bins/cargo-binstall@main - if: steps.filter.outputs.src == 'true' - - run: cargo binstall --no-confirm cargo-shear - if: steps.filter.outputs.src == 'true' - - run: cargo shear - if: steps.filter.outputs.src == 'true' - - format: - name: Format - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - - name: Install Rust - uses: ./.github/actions/rustup - with: - fmt: true - restore-cache: false - - - run: cargo fmt --all -- --check - - lint: - name: Clippy - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - - name: Install Rust - uses: ./.github/actions/rustup - with: - clippy: true - - - name: Run Clippy - run: cargo clippy -- -D warnings - - doc: - name: Doc - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - - name: Install Rust - uses: ./.github/actions/rustup - with: - docs: true - - - name: Run doc - run: RUSTDOCFLAGS='-D warnings' cargo doc --no-deps --all-features - - test: - name: Test - strategy: - fail-fast: false - matrix: - include: - - os: windows-latest - - os: ubuntu-latest - - os: macos-14 - runs-on: ${{ matrix.os }} - env: - RUST_BACKTRACE: 1 - steps: - - uses: taiki-e/checkout-action@v1 - - uses: ./.github/actions/pnpm - - uses: ./.github/actions/rustup - - run: cargo test --doc - - run: cargo test --all-features diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml deleted file mode 100644 index e1692512..00000000 --- a/.github/workflows/codecov.yml +++ /dev/null @@ -1,76 +0,0 @@ -name: Code Coverage # Run cargo-llvm-cov and upload to codecov.io - -on: - workflow_dispatch: - pull_request: - types: [opened, synchronize] - paths-ignore: - - '**/*.md' - push: - branches: - - main - paths-ignore: - - '**/*.md' - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: ${{ github.ref_name != 'main' }} - -jobs: - coverage: - name: Code Coverage - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: taiki-e/checkout-action@v1 - - - name: Pnpm - uses: ./.github/actions/pnpm - - - name: Install Rust Toolchain - uses: ./.github/actions/rustup - with: - shared-key: 'codecov' - save-cache: ${{ github.ref_name == 'main' }} - - - name: Install cargo-llvm-cov - uses: taiki-e/install-action@cargo-llvm-cov - - - name: Install llvm-tools-preview for llvm-cov - run: rustup component add llvm-tools-preview - - - name: Run - run: cargo llvm-cov --lcov --output-path lcov.info - - - name: Upload Artifact - uses: actions/upload-artifact@v4 - with: - name: codecov - path: lcov.info - - # codecov often fails, use another workflow for retry - upload-codecov: - name: Upload coverage file - runs-on: ubuntu-latest - needs: coverage - # Check if the event is not triggered by a fork by checking whether CODECOV_TOKEN is set - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - steps: - - name: Checkout - if: env.CODECOV_TOKEN - uses: taiki-e/checkout-action@v1 - - - name: Download coverage file - if: env.CODECOV_TOKEN - uses: actions/download-artifact@v4 - with: - name: codecov - - - name: Upload to codecov.io - if: env.CODECOV_TOKEN - uses: codecov/codecov-action@v4 - with: - token: ${{ secrets.CODECOV_TOKEN }} - fail_ci_if_error: true - files: lcov.info diff --git a/.github/workflows/release-napi.yml b/.github/workflows/release-napi.yml deleted file mode 100644 index 83215718..00000000 --- a/.github/workflows/release-napi.yml +++ /dev/null @@ -1,220 +0,0 @@ -name: Release NAPI - -on: - workflow_dispatch: - push: - branches: - - main - paths: - - npm/package.json # Please only commit this file, so we don't need to wait for test CI to pass. - -env: - DEBUG: 'napi:*' - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - check: - name: Check version - runs-on: ubuntu-latest - outputs: - version: ${{ env.version }} - version_changed: ${{ steps.version.outputs.changed }} - steps: - - uses: taiki-e/checkout-action@v1 - - - name: Check version changes - uses: EndBug/version-check@v2 - id: version - with: - static-checking: localIsNew - file-url: https://unpkg.com/oxc-resolver@latest/package.json - file-name: npm/package.json - - - name: Set version name - if: steps.version.outputs.changed == 'true' - run: | - echo "Version change found! New version: ${{ steps.version.outputs.version }} (${{ steps.version.outputs.version_type }})" - echo "version=${{ steps.version.outputs.version }}" >> $GITHUB_ENV - - build: - needs: check - if: needs.check.outputs.version_changed == 'true' - env: - version: ${{ needs.check.outputs.version }} - outputs: - version: ${{ env.version }} - strategy: - fail-fast: false - matrix: - include: - - os: windows-latest - target: x86_64-pc-windows-msvc - - - os: windows-latest - target: aarch64-pc-windows-msvc - - - os: ubuntu-latest - target: x86_64-unknown-linux-gnu - - - os: ubuntu-latest - target: x86_64-unknown-linux-musl - - - os: ubuntu-latest - target: aarch64-unknown-linux-gnu - - - os: ubuntu-latest - target: aarch64-unknown-linux-musl - - - os: ubuntu-latest - target: armv7-unknown-linux-gnueabihf - - - os: macos-latest - target: x86_64-apple-darwin - - - os: macos-latest - target: aarch64-apple-darwin - - - os: ubuntu-latest - target: wasm32-wasi-preview1-threads - - name: Package ${{ matrix.target }} - runs-on: ${{ matrix.os }} - steps: - - uses: taiki-e/checkout-action@v1 - - - name: corepack - run: corepack enable - - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: 20 - cache: pnpm - - - name: Install dependencies - run: pnpm install --frozen-lockfile - - - name: Install fixtures dependencies - working-directory: fixtures/pnpm8 - run: pnpm install --frozen-lockfile - - - name: Add Rust Target - run: rustup target add ${{ matrix.target }} - - - uses: goto-bus-stop/setup-zig@v2 - if: ${{ contains(matrix.target, 'musl') }} - with: - version: 0.11.0 - - - name: Build with zig cross - if: ${{ contains(matrix.target, 'musl') }} - run: pnpm build -x --target ${{ matrix.target }} - - - name: Build with napi cross - if: ${{ contains(matrix.target, 'gnu') }} - run: pnpm build --use-napi-cross --target ${{ matrix.target }} - - - name: Build - if: ${{ !contains(matrix.target, 'gnu') && !contains(matrix.target, 'musl') }} - run: pnpm build --target ${{ matrix.target }} - - - name: Test - if: matrix.target == 'x86_64-pc-windows-msvc' || matrix.target == 'x86_64-apple-darwin' || matrix.target == 'wasm32-wasi-preview1-threads' - run: pnpm test - - - name: Output docker params - if: ${{ contains(matrix.target, 'linux') }} - id: docker - run: | - node -e " - if ('${{ matrix.target }}'.startsWith('aarch64')) { - console.log('PLATFORM=linux/arm64') - } else if ('${{ matrix.target }}'.startsWith('armv7')) { - console.log('PLATFORM=linux/arm/v7') - } else { - console.log('PLATFORM=linux/amd64') - } - " >> $GITHUB_OUTPUT - node -e " - if ('${{ matrix.target }}'.endsWith('-musl')) { - console.log('IMAGE=node:lts-alpine') - } else { - console.log('IMAGE=node:lts-slim') - } - " >> $GITHUB_OUTPUT - echo "PNPM_STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_OUTPUT - - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - if: ${{ contains(matrix.target, 'linux') }} - with: - platforms: all - - - run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes - if: ${{ contains(matrix.target, 'linux') }} - - - name: Run linux test - uses: addnab/docker-run-action@v3 - if: ${{ contains(matrix.target, 'linux') }} - with: - image: ${{ steps.docker.outputs.IMAGE }} - options: -v ${{ steps.docker.outputs.PNPM_STORE_PATH }}:${{ steps.docker.outputs.PNPM_STORE_PATH }} -v ${{ github.workspace }}:/oxc_resolver -w /oxc_resolver --platform ${{ steps.docker.outputs.PLATFORM }} - run: | - corepack enable - pnpm test - - - name: Upload artifacts - uses: actions/upload-artifact@v4 - with: - name: bindings-${{ matrix.target }} - path: | - napi/*.node - napi/*.wasm - - publish: - name: Publish NAPI - runs-on: ubuntu-latest - permissions: - id-token: write # for `npm publish --provenance` - needs: - - build - steps: - - uses: taiki-e/checkout-action@v1 - - - name: corepack - run: corepack enable - - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: 20 - cache: pnpm - - - name: Install dependencies - run: pnpm install --frozen-lockfile - - - name: Download Artifacts - uses: actions/download-artifact@v4 - with: - path: artifacts - - - name: Prepare dirs and artifacts - run: | - pnpm napi create-npm-dirs --package-json-path npm/package.json - pnpm napi artifacts --package-json-path npm/package.json --build-output-dir napi - - - name: Publish npm packages as latest - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - shell: bash - run: | - cp napi/index.js npm/index.js - cp napi/index.d.ts npm/index.d.ts - cp napi/browser.js npm/browser.js - echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc - pnpm napi pre-publish --no-gh-release -t npm --package-json-path npm/package.json - npm publish npm/ --tag latest --provenance --access public diff --git a/.github/workflows/release-plz.yml b/.github/workflows/release-plz.yml deleted file mode 100644 index c19a5c7b..00000000 --- a/.github/workflows/release-plz.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: Release Plz - -on: - workflow_dispatch: - push: - branches: - - main - paths: - - Cargo.toml - -permissions: - pull-requests: write - contents: write - -jobs: - release-plz: - name: Release-plz - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - name: Install Rust Toolchain - uses: ./.github/actions/rustup - with: - save-cache: ${{ github.ref_name == 'main' }} - - - name: Run release-plz - uses: MarcoIeni/release-plz-action@v0.5 - with: - command: release - env: - GITHUB_TOKEN: ${{ secrets.RELEASE_PLZ_TOKEN }} - CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} diff --git a/Cargo.lock b/Cargo.lock deleted file mode 100644 index 5cc393fc..00000000 --- a/Cargo.lock +++ /dev/null @@ -1,881 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "aho-corasick" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" -dependencies = [ - "memchr", -] - -[[package]] -name = "anes" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "735d4f398ca57cfa2880225c2bf81c3b9af3be5bb22e44ae70118dad38713e84" - -[[package]] -name = "autocfg" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1fdabc7756949593fe60f30ec81974b613357de856987752631dea1e3394c80" - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "bitflags" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" - -[[package]] -name = "bpaf" -version = "0.9.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "567fc5f0a754100df11b167b2a247b2366fc1ac18e9b776a07659be00878f681" - -[[package]] -name = "cast" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "ciborium" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42e69ffd6f0917f5c029256a24d0161db17cea3997d185db0d35926308770f0e" -dependencies = [ - "ciborium-io", - "ciborium-ll", - "serde", -] - -[[package]] -name = "ciborium-io" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05afea1e0a06c9be33d539b876f1ce3692f4afea2cb41f740e7743225ed1c757" - -[[package]] -name = "ciborium-ll" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57663b653d948a338bfb3eeba9bb2fd5fcfaecb9e199e87e1eda4d9e8b240fd9" -dependencies = [ - "ciborium-io", - "half", -] - -[[package]] -name = "clean-path" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aaa6b4b263a5d737e9bf6b7c09b72c41a5480aec4d7219af827f6564e950b6a5" - -[[package]] -name = "codspeed" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a104ac948e0188b921eb3fcbdd55dcf62e542df4c7ab7e660623f6288302089" -dependencies = [ - "colored", - "libc", - "serde_json", -] - -[[package]] -name = "colored" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbf2150cce219b664a8a70df7a1f933836724b503f8a413af9365b4dcc4d90b8" -dependencies = [ - "lazy_static", - "windows-sys 0.48.0", -] - -[[package]] -name = "convert_case" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec182b0ca2f35d8fc196cf3404988fd8b8c739a4d270ff118a398feb0cbec1ca" -dependencies = [ - "unicode-segmentation", -] - -[[package]] -name = "criterion2" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f29e2b09b5cf655d28af8865ffdf0da71b6c0c313915f27b2e28664d43e450a" -dependencies = [ - "anes", - "bpaf", - "cast", - "ciborium", - "codspeed", - "colored", - "itertools", - "num-traits", - "oorandom", - "regex", - "serde", - "serde_derive", - "serde_json", - "tinytemplate", - "walkdir", -] - -[[package]] -name = "crossbeam-deque" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" -dependencies = [ - "crossbeam-epoch", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.9.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" -dependencies = [ - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" - -[[package]] -name = "crunchy" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" - -[[package]] -name = "ctor" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edb49164822f3ee45b17acd4a208cfc1251410cf0cad9a833234c9890774dd9f" -dependencies = [ - "quote", - "syn", -] - -[[package]] -name = "dashmap" -version = "5.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" -dependencies = [ - "cfg-if", - "hashbrown", - "lock_api", - "once_cell", - "parking_lot_core", -] - -[[package]] -name = "document-features" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef5282ad69563b5fc40319526ba27e0e7363d552a896f0297d54f767717f9b95" -dependencies = [ - "litrs", -] - -[[package]] -name = "dunce" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b" - -[[package]] -name = "either" -version = "1.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a47c1c47d2f5964e29c61246e81db715514cd532db6b5116a25ea3c03d6780a2" - -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "filetime" -version = "0.2.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ee447700ac8aa0b2f2bd7bc4462ad686ba06baa6727ac149a2d6277f0d240fd" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall 0.4.1", - "windows-sys 0.52.0", -] - -[[package]] -name = "half" -version = "2.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dd08c532ae367adf81c312a4580bc67f1d0fe8bc9c460520283f4c0ff277888" -dependencies = [ - "cfg-if", - "crunchy", -] - -[[package]] -name = "hashbrown" -version = "0.14.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" - -[[package]] -name = "indexmap" -version = "2.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" -dependencies = [ - "equivalent", - "hashbrown", - "serde", -] - -[[package]] -name = "itertools" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" -dependencies = [ - "either", -] - -[[package]] -name = "itoa" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" - -[[package]] -name = "json-strip-comments" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3d129799327c8f80861e467c59b825ba24c277dba6ad0d71a141dc98f9e04ee" - -[[package]] -name = "lazy_static" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" - -[[package]] -name = "libc" -version = "0.2.153" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" - -[[package]] -name = "libloading" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c2a198fb6b0eada2a8df47933734e6d35d350665a33a3593d7164fa52c75c19" -dependencies = [ - "cfg-if", - "windows-targets 0.52.5", -] - -[[package]] -name = "litrs" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4ce301924b7887e9d637144fdade93f9dfff9b60981d4ac161db09720d39aa5" - -[[package]] -name = "lock_api" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" -dependencies = [ - "autocfg", - "scopeguard", -] - -[[package]] -name = "memchr" -version = "2.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" - -[[package]] -name = "napi" -version = "2.16.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da1edd9510299935e4f52a24d1e69ebd224157e3e962c6c847edec5c2e4f786f" -dependencies = [ - "bitflags 2.5.0", - "ctor", - "napi-derive", - "napi-sys", - "once_cell", - "serde", - "serde_json", -] - -[[package]] -name = "napi-build" -version = "2.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1c0f5d67ee408a4685b61f5ab7e58605c8ae3f2b4189f0127d804ff13d5560a" - -[[package]] -name = "napi-derive" -version = "2.16.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5a6de411b6217dbb47cd7a8c48684b162309ff48a77df9228c082400dd5b030" -dependencies = [ - "cfg-if", - "convert_case", - "napi-derive-backend", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "napi-derive-backend" -version = "1.0.65" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3e35868d43b178b0eb9c17bd018960b1b5dd1732a7d47c23debe8f5c4caf498" -dependencies = [ - "convert_case", - "once_cell", - "proc-macro2", - "quote", - "regex", - "semver", - "syn", -] - -[[package]] -name = "napi-sys" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "427802e8ec3a734331fec1035594a210ce1ff4dc5bc1950530920ab717964ea3" -dependencies = [ - "libloading", -] - -[[package]] -name = "normalize-path" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5438dd2b2ff4c6df6e1ce22d825ed2fa93ee2922235cc45186991717f0a892d" - -[[package]] -name = "num-traits" -version = "0.2.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" -dependencies = [ - "autocfg", -] - -[[package]] -name = "once_cell" -version = "1.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" - -[[package]] -name = "oorandom" -version = "11.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575" - -[[package]] -name = "oxc_napi_resolver" -version = "0.0.0" -dependencies = [ - "napi", - "napi-build", - "napi-derive", - "oxc_resolver", -] - -[[package]] -name = "oxc_resolver" -version = "1.7.0" -dependencies = [ - "criterion2", - "dashmap", - "document-features", - "dunce", - "json-strip-comments", - "normalize-path", - "once_cell", - "rayon", - "rustc-hash", - "serde", - "serde_json", - "thiserror", - "tracing", - "typescript_tsconfig_json", - "vfs", -] - -[[package]] -name = "parking_lot_core" -version = "0.9.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall 0.5.1", - "smallvec", - "windows-targets 0.52.5", -] - -[[package]] -name = "pin-project-lite" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" - -[[package]] -name = "proc-macro2" -version = "1.0.81" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d1597b0c024618f09a9c3b8655b7e430397a36d23fdafec26d6965e9eec3eba" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.36" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "rayon" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" -dependencies = [ - "either", - "rayon-core", -] - -[[package]] -name = "rayon-core" -version = "1.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" -dependencies = [ - "crossbeam-deque", - "crossbeam-utils", -] - -[[package]] -name = "redox_syscall" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" -dependencies = [ - "bitflags 1.3.2", -] - -[[package]] -name = "redox_syscall" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "469052894dcb553421e483e4209ee581a45100d31b4018de03e5a7ad86374a7e" -dependencies = [ - "bitflags 2.5.0", -] - -[[package]] -name = "regex" -version = "1.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" -dependencies = [ - "aho-corasick", - "memchr", - "regex-automata", - "regex-syntax", -] - -[[package]] -name = "regex-automata" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", -] - -[[package]] -name = "regex-syntax" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" - -[[package]] -name = "rustc-hash" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" - -[[package]] -name = "ryu" -version = "1.0.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" - -[[package]] -name = "same-file" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "scopeguard" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" - -[[package]] -name = "semver" -version = "1.0.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92d43fe69e652f3df9bdc2b85b2854a0825b86e4fb76bc44d945137d053639ca" - -[[package]] -name = "serde" -version = "1.0.199" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c9f6e76df036c77cd94996771fb40db98187f096dd0b9af39c6c6e452ba966a" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.199" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11bd257a6541e141e42ca6d24ae26f7714887b47e89aa739099104c7e4d3b7fc" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "serde_json" -version = "1.0.116" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e17db7126d17feb94eb3fad46bf1a96b034e8aacbc2e775fe81505f8b0b2813" -dependencies = [ - "indexmap", - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "smallvec" -version = "1.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" - -[[package]] -name = "syn" -version = "2.0.60" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "909518bc7b1c9b779f1bbf07f2929d35af9f0f37e47c6e9ef7f9dddc1e1821f3" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "thiserror" -version = "1.0.59" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0126ad08bff79f29fc3ae6a55cc72352056dfff61e3ff8bb7129476d44b23aa" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.59" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1cd413b5d558b4c5bf3680e324a6fa5014e7b7c067a51e69dbdf47eb7148b66" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "tinytemplate" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be4d6b5f19ff7664e8c98d03e2139cb510db9b0a60b55f8e8709b689d939b6bc" -dependencies = [ - "serde", - "serde_json", -] - -[[package]] -name = "tracing" -version = "0.1.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" -dependencies = [ - "pin-project-lite", - "tracing-attributes", - "tracing-core", -] - -[[package]] -name = "tracing-attributes" -version = "0.1.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "tracing-core" -version = "0.1.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" -dependencies = [ - "once_cell", -] - -[[package]] -name = "typescript_tsconfig_json" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7cc416eaf05297012ead9d192226fe9a92e9a20f64f8780efb9085aaae9b590" -dependencies = [ - "clean-path", - "indexmap", - "rustc-hash", - "serde", - "serde_json", -] - -[[package]] -name = "unicode-ident" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" - -[[package]] -name = "unicode-segmentation" -version = "1.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" - -[[package]] -name = "vfs" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "654cd097e182a71dbf899178e6b5662c2157dd0b8afd5975de18008f6fc173d1" -dependencies = [ - "filetime", -] - -[[package]] -name = "walkdir" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" -dependencies = [ - "same-file", - "winapi-util", -] - -[[package]] -name = "winapi-util" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b" -dependencies = [ - "windows-sys 0.52.0", -] - -[[package]] -name = "windows-sys" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" -dependencies = [ - "windows-targets 0.48.5", -] - -[[package]] -name = "windows-sys" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" -dependencies = [ - "windows-targets 0.52.5", -] - -[[package]] -name = "windows-targets" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" -dependencies = [ - "windows_aarch64_gnullvm 0.48.5", - "windows_aarch64_msvc 0.48.5", - "windows_i686_gnu 0.48.5", - "windows_i686_msvc 0.48.5", - "windows_x86_64_gnu 0.48.5", - "windows_x86_64_gnullvm 0.48.5", - "windows_x86_64_msvc 0.48.5", -] - -[[package]] -name = "windows-targets" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" -dependencies = [ - "windows_aarch64_gnullvm 0.52.5", - "windows_aarch64_msvc 0.52.5", - "windows_i686_gnu 0.52.5", - "windows_i686_gnullvm", - "windows_i686_msvc 0.52.5", - "windows_x86_64_gnu 0.52.5", - "windows_x86_64_gnullvm 0.52.5", - "windows_x86_64_msvc 0.52.5", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" - -[[package]] -name = "windows_i686_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" - -[[package]] -name = "windows_i686_gnu" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" - -[[package]] -name = "windows_i686_gnullvm" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" - -[[package]] -name = "windows_i686_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" - -[[package]] -name = "windows_i686_msvc" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" diff --git a/src/builtins.rs b/Source/builtins.rs similarity index 100% rename from src/builtins.rs rename to Source/builtins.rs diff --git a/src/cache.rs b/Source/cache.rs similarity index 100% rename from src/cache.rs rename to Source/cache.rs diff --git a/src/context.rs b/Source/context.rs similarity index 100% rename from src/context.rs rename to Source/context.rs diff --git a/src/error.rs b/Source/error.rs similarity index 100% rename from src/error.rs rename to Source/error.rs diff --git a/src/file_system.rs b/Source/file_system.rs similarity index 100% rename from src/file_system.rs rename to Source/file_system.rs diff --git a/src/lib.rs b/Source/lib.rs similarity index 100% rename from src/lib.rs rename to Source/lib.rs diff --git a/src/options.rs b/Source/options.rs similarity index 100% rename from src/options.rs rename to Source/options.rs diff --git a/src/package_json.rs b/Source/package_json.rs similarity index 100% rename from src/package_json.rs rename to Source/package_json.rs diff --git a/src/path.rs b/Source/path.rs similarity index 100% rename from src/path.rs rename to Source/path.rs diff --git a/src/resolution.rs b/Source/resolution.rs similarity index 100% rename from src/resolution.rs rename to Source/resolution.rs diff --git a/src/specifier.rs b/Source/specifier.rs similarity index 100% rename from src/specifier.rs rename to Source/specifier.rs diff --git a/src/tsconfig.rs b/Source/tsconfig.rs similarity index 100% rename from src/tsconfig.rs rename to Source/tsconfig.rs diff --git a/fixtures/enhanced_resolve/lib/index.js b/fixtures/enhanced_resolve/lib/index.js deleted file mode 100644 index 1e872e8f..00000000 --- a/fixtures/enhanced_resolve/lib/index.js +++ /dev/null @@ -1 +0,0 @@ -// mimic enhanced-resolved root directory structure diff --git a/fixtures/enhanced_resolve/package.json b/fixtures/enhanced_resolve/package.json deleted file mode 100644 index d1b845b5..00000000 --- a/fixtures/enhanced_resolve/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "enhanced-resolve", - "main": "lib/index.js" -} diff --git a/fixtures/enhanced_resolve/test/.gitignore b/fixtures/enhanced_resolve/test/.gitignore deleted file mode 100644 index bbbec5f4..00000000 --- a/fixtures/enhanced_resolve/test/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# created by symlink.rs -/temp diff --git a/fixtures/enhanced_resolve/test/fixtures/a.js b/fixtures/enhanced_resolve/test/fixtures/a.js deleted file mode 100644 index 896ffc6d..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/abc.txt b/fixtures/enhanced_resolve/test/fixtures/abc.txt deleted file mode 100644 index f2ba8f84..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/abc.txt +++ /dev/null @@ -1 +0,0 @@ -abc \ No newline at end of file diff --git a/fixtures/enhanced_resolve/test/fixtures/alias/files/a.js b/fixtures/enhanced_resolve/test/fixtures/alias/files/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/b.js b/fixtures/enhanced_resolve/test/fixtures/b.js deleted file mode 100644 index 11476340..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/b.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function b() { - return "This is b"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/browser/module-a.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/browser/module-a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/browser.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/ignore.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/ignore.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/replaced.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/replaced.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/self.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/self.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/toString.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/toString.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-a.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-b.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-c.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-c.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/a.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/b.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/c.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/c.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/d.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/d.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json deleted file mode 100644 index c13fe23b..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "browser": { - "a.js": "./a", - "./b.js": "./b", - "c.js": "./d.js", - "./d.js": "./c.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/package.json b/fixtures/enhanced_resolve/test/fixtures/browser-module/package.json deleted file mode 100644 index e75ce6ed..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/browser-module/package.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "exports": { - "./lib/index.js": "./lib/index.js" - }, - "browser": { - "./lib/ignore.js": false, - "./lib/replaced.js": "./lib/browser", - "module-a": "./browser/module-a.js", - "module-b": "module-c", - "module-c": "module-c", - "./toString": "./lib/toString.js", - "./lib/main.js": "./lib/main.js", - "./main.js": "./lib/main.js", - "./lib/xyz.js": "./xyz.js", - "./xyz.js": "./lib/xyz.js", - "./lib/non-existent.js": "./lib/non-existent.js", - ".": false - }, - "innerBrowser1": { - "field": { - "browser": { - "./lib/main1.js": "./lib/main.js" - } - } - }, - "innerBrowser2": { - "browser": { - "./lib/main2.js": "./lib/replaced.js" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/c.js b/fixtures/enhanced_resolve/test/fixtures/c.js deleted file mode 100644 index e3aca8aa..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/c.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = function b() { - require("./a"); - return "This is c"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/complex.js b/fixtures/enhanced_resolve/test/fixtures/complex.js deleted file mode 100644 index 1f62db84..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/complex.js +++ /dev/null @@ -1,13 +0,0 @@ -var 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); diff --git a/fixtures/enhanced_resolve/test/fixtures/crypto-js/index.js b/fixtures/enhanced_resolve/test/fixtures/crypto-js/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json b/fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json deleted file mode 100644 index 1d31aa8b..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "crypto-js", - "main": "index.js", - "browser": { - "crypto": false - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/decorated-fs/exists.js b/fixtures/enhanced_resolve/test/fixtures/decorated-fs/exists.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/dirOrFile.js b/fixtures/enhanced_resolve/test/fixtures/dirOrFile.js deleted file mode 100644 index c3cb885f..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/dirOrFile.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "file"; diff --git a/fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js b/fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js deleted file mode 100644 index 85e01cd4..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "dir"; diff --git a/fixtures/enhanced_resolve/test/fixtures/directory-default/directory-default.js b/fixtures/enhanced_resolve/test/fixtures/directory-default/directory-default.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js deleted file mode 100644 index d1007aae..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js +++ /dev/null @@ -1 +0,0 @@ -export default "string"; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts deleted file mode 100644 index cb0ff5c3..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json deleted file mode 100644 index b523a1e9..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "@org/pkg", - "exports": { - "./*.js": { - "types": "./dist/*.d.ts", - "default": "./dist/*.js" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js deleted file mode 100644 index d1007aae..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js +++ /dev/null @@ -1 +0,0 @@ -export default "string"; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts deleted file mode 100644 index cb0ff5c3..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json deleted file mode 100644 index 8e55fb46..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "@raviqqe/hidash", - "exports": { - "./*.js": { - "types": "./dist/*.d.ts", - "default": "./dist/*.js" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json deleted file mode 100644 index f0edf449..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "exports-field", - "version": "1.0.0", - "exports": { - ".": "./a/../b/../../pack1/index.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/pack1/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/pack1/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/a.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/a.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json deleted file mode 100644 index 6b105c08..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "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/": { - "webpack": ["./lib/lib2/", "./lib/"], - "node": "./lib/", - "default": "./lib/" - }, - "./dist/a.js": "./../../a.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json deleted file mode 100644 index 0012a3de..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "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" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/umd.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/umd.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field/package.json deleted file mode 100644 index 5fa72bb5..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "@exports-field/core", - "version": "1.0.0", - "exports": "./a.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json deleted file mode 100644 index e6f12074..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "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/lib2/", "./lib/"], - "node": "./lib/", - "default": "./lib/" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/index b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/index deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json deleted file mode 100644 index 1a838f49..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "name": "exports-field", - "exportsField": { - "exports": "./main.js" - }, - "ex": "./index", - "broken": { - ".": "./src" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/src/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/src/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.ts b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.mts b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.mts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mjs b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mjs deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mts.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mts.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.ts b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/app.module.js b/fixtures/enhanced_resolve/test/fixtures/extensions/app.module.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.js b/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/foo.js b/fixtures/enhanced_resolve/test/fixtures/extensions/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/foo.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/foo.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/index.js b/fixtures/enhanced_resolve/test/fixtures/extensions/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/index.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module.js b/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module/index.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/package.json b/fixtures/enhanced_resolve/test/fixtures/extensions/package.json deleted file mode 100644 index 5e55a1e8..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/extensions/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "./index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/file.load1 b/fixtures/enhanced_resolve/test/fixtures/file.load1 deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/file.load2 b/fixtures/enhanced_resolve/test/fixtures/file.load2 deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/foo/index.js b/fixtures/enhanced_resolve/test/fixtures/foo/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/foo/package.json b/fixtures/enhanced_resolve/test/fixtures/foo/package.json deleted file mode 100644 index da86787a..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/foo/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "foo", - "version": "1.0.0" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json deleted file mode 100644 index aa2be496..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "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" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/internal/file.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/internal/file.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/y/y.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/y/y.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/internal/i.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/internal/i.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/nested/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js deleted file mode 100644 index e5b70a86..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = { nested: "nested" } diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-3/nested/f/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-3/nested/f/nested/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-4/f/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-4/f/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f$/$.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f$/$.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f/$.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f/$.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/nested/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/a.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/a.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/b.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/dir/b.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/dir/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/index.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json deleted file mode 100644 index 8d8d3a46..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "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/lib2/", "./lib/"], - "node": "./lib/", - "default": "./lib/" - }, - "./dist/a.js": "./../../a.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/c/index.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/c/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/imports-field/package.json deleted file mode 100644 index 248351a9..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "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" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/a.js b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json deleted file mode 100644 index ded7faa2..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json +++ /dev/null @@ -1,2 +0,0 @@ -{ - "main": "./a.js", diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/a.js b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/package.json b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/package.json deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/issue-238/package.json b/fixtures/enhanced_resolve/test/fixtures/issue-238/package.json deleted file mode 100644 index 352055cd..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/issue-238/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "private": true -} diff --git a/fixtures/enhanced_resolve/test/fixtures/issue-238/src/a/config.js b/fixtures/enhanced_resolve/test/fixtures/issue-238/src/a/config.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/issue-238/src/common/config/myObjectFile.js b/fixtures/enhanced_resolve/test/fixtures/issue-238/src/common/config/myObjectFile.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/lib.js b/fixtures/enhanced_resolve/test/fixtures/lib.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/lib/complex1.js b/fixtures/enhanced_resolve/test/fixtures/lib/complex1.js deleted file mode 100644 index b3de3d70..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/lib/complex1.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "lib complex1"; diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self/index.js b/fixtures/enhanced_resolve/test/fixtures/main-field-self/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json b/fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json deleted file mode 100644 index a2b6f341..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "./" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self2/index.js b/fixtures/enhanced_resolve/test/fixtures/main-field-self2/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json b/fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json deleted file mode 100644 index 4fa6f730..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "." -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main1.js b/fixtures/enhanced_resolve/test/fixtures/main1.js deleted file mode 100644 index 168f2a1e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main1.js +++ /dev/null @@ -1,9 +0,0 @@ -var a = require("./a"); -if (x) { - for (var i = 0; i < 100; i++) { - while (true) require("./b"); - do { - i++; - } while (require("m1/a")()); - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main2.js b/fixtures/enhanced_resolve/test/fixtures/main2.js deleted file mode 100644 index 39f062b1..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main2.js +++ /dev/null @@ -1,12 +0,0 @@ -var 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"); - }); - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main3.js b/fixtures/enhanced_resolve/test/fixtures/main3.js deleted file mode 100644 index 1c180166..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main3.js +++ /dev/null @@ -1,4 +0,0 @@ -var a = require("./a"); -require.ensure([], function(require) { - require("./c.js"); -}); diff --git a/fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js b/fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js deleted file mode 100644 index 997c1051..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is nested m1/a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/no#fragment/#/#.js b/fixtures/enhanced_resolve/test/fixtures/no#fragment/#/#.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/no.js b/fixtures/enhanced_resolve/test/fixtures/no.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/browser.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/browser.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/main.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json deleted file mode 100644 index c469e1fd..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "main": "./main.js", - "browser": "./browser.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js deleted file mode 100644 index 549620a5..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "the correct a.js"; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js deleted file mode 100644 index 5db6632e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = " :) " + require("m2/b.js"); diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js deleted file mode 100644 index d308569d..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require("m1/a") + require("m1"); diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js deleted file mode 100644 index cb8127e8..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "Step2"; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json deleted file mode 100644 index 8d6dfa56..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "dash-name", - "exports": "./index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json deleted file mode 100644 index 4fd8706e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "dash", - "exports": "./index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/invalidPackageJson/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/invalidPackageJson/package.json deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js deleted file mode 100644 index 46fc8e6c..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is m1/a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js deleted file mode 100644 index 8565c244..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is m1/b"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js deleted file mode 100644 index 34faaaf5..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "This is m2/b"; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/file.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/file.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js b/fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js deleted file mode 100644 index 997c1051..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is nested m1/a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/dir/index.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/dir/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/index.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/main.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/browser.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/browser.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/index.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json deleted file mode 100644 index e20ceaeb..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "main": "main.js", - "browser": { - "./package-alias/index.js": "./package-alias/browser.js", - "module": "pkg/dir/index" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/typescript/index.ts b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/typescript/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json deleted file mode 100644 index 4a1f838e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "@exports-field/core", - "version": "1.0.0", - "exports": { - ".": "./a.js", - "./x": "./a.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/prefer-pnp/alternative-modules/m1/b.js b/fixtures/enhanced_resolve/test/fixtures/prefer-pnp/alternative-modules/m1/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.css b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.css deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.js b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json deleted file mode 100644 index 14ab704d..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/index.css b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/index.css deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/module.js b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/module.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json deleted file mode 100644 index ee0eb71b..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "main": "../../../c.js", - "module": "module.js", - "style": "index.css" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/roots_fall_through/index.js b/fixtures/enhanced_resolve/test/fixtures/roots_fall_through/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/main.js b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json deleted file mode 100644 index 70a0f20f..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "browser": { - "./index.js": "./main.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/lib/index.js b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/lib/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/main.js b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json deleted file mode 100644 index 2af9e0d1..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "./main.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/shortcutdir.js/a.js b/fixtures/enhanced_resolve/test/fixtures/shortcutdir.js/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/b b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/b deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/c b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/c deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/a b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/a deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/b b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/b deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/b/foo/a b/fixtures/enhanced_resolve/test/fixtures/yield/b/foo/a deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/a b/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/a deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json b/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json deleted file mode 100644 index 0acc4b4c..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "foo", - "version": "1.0.0", - "browser": { - "./a": false - } -} diff --git "a/fixtures/enhanced_resolve/test/fixtures/\346\265\213\350\257\225.js" "b/fixtures/enhanced_resolve/test/fixtures/\346\265\213\350\257\225.js" deleted file mode 100644 index e69de29b..00000000 diff --git "a/fixtures/misc/\344\270\255\346\226\207/\344\270\255\346\226\207.js" "b/fixtures/misc/\344\270\255\346\226\207/\344\270\255\346\226\207.js" deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/pnpm8/.gitignore b/fixtures/pnpm8/.gitignore deleted file mode 100644 index 3c3629e6..00000000 --- a/fixtures/pnpm8/.gitignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/fixtures/pnpm8/package.json b/fixtures/pnpm8/package.json deleted file mode 100644 index cbced892..00000000 --- a/fixtures/pnpm8/package.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "name": "pnpm8", - "version": "1.0.0", - "private": true, - "engines": { - "node": ">=16.0.0" - }, - "packageManager": "pnpm@8.10.5", - "devDependencies": { - "axios": "1.6.2", - "styled-components": "6.1.1", - "postcss": "8.4.33" - } -} diff --git a/fixtures/pnpm8/pnpm-lock.yaml b/fixtures/pnpm8/pnpm-lock.yaml deleted file mode 100644 index e51dfd6a..00000000 --- a/fixtures/pnpm8/pnpm-lock.yaml +++ /dev/null @@ -1,212 +0,0 @@ -lockfileVersion: '6.0' - -settings: - autoInstallPeers: true - excludeLinksFromLockfile: false - -devDependencies: - axios: - specifier: 1.6.2 - version: 1.6.2 - postcss: - specifier: 8.4.33 - version: 8.4.33 - styled-components: - specifier: 6.1.1 - version: 6.1.1(react-dom@18.2.0)(react@18.2.0) - -packages: - - /@emotion/is-prop-valid@1.2.1: - resolution: {integrity: sha512-61Mf7Ufx4aDxx1xlDeOm8aFFigGHE4z+0sKCa+IHCeZKiyP9RLD0Mmx7m8b9/Cf37f7NAvQOOJAbQQGVr5uERw==} - dependencies: - '@emotion/memoize': 0.8.1 - dev: true - - /@emotion/memoize@0.8.1: - resolution: {integrity: sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA==} - dev: true - - /@emotion/unitless@0.8.1: - resolution: {integrity: sha512-KOEGMu6dmJZtpadb476IsZBclKvILjopjUii3V+7MnXIQCYh8W3NgNcgwo21n9LXZX6EDIKvqfjYxXebDwxKmQ==} - dev: true - - /@types/stylis@4.2.4: - resolution: {integrity: sha512-36ZrGJ8fgtBr6nwNnuJ9jXIj+bn/pF6UoqmrQT7+Y99+tFFeHHsoR54+194dHdyhPjgbeoNz3Qru0oRt0l6ASQ==} - dev: true - - /asynckit@0.4.0: - resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} - dev: true - - /axios@1.6.2: - resolution: {integrity: sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A==} - dependencies: - follow-redirects: 1.15.3 - form-data: 4.0.0 - proxy-from-env: 1.1.0 - transitivePeerDependencies: - - debug - dev: true - - /camelize@1.0.1: - resolution: {integrity: sha512-dU+Tx2fsypxTgtLoE36npi3UqcjSSMNYfkqgmoEhtZrraP5VWq0K7FkWVTYa8eMPtnU/G2txVsfdCJTn9uzpuQ==} - dev: true - - /combined-stream@1.0.8: - resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} - engines: {node: '>= 0.8'} - dependencies: - delayed-stream: 1.0.0 - dev: true - - /css-color-keywords@1.0.0: - resolution: {integrity: sha512-FyyrDHZKEjXDpNJYvVsV960FiqQyXc/LlYmsxl2BcdMb2WPx0OGRVgTg55rPSyLSNMqP52R9r8geSp7apN3Ofg==} - engines: {node: '>=4'} - dev: true - - /css-to-react-native@3.2.0: - resolution: {integrity: sha512-e8RKaLXMOFii+02mOlqwjbD00KSEKqblnpO9e++1aXS1fPQOpS1YoqdVHBqPjHNoxeF2mimzVqawm2KCbEdtHQ==} - dependencies: - camelize: 1.0.1 - css-color-keywords: 1.0.0 - postcss-value-parser: 4.2.0 - dev: true - - /csstype@3.1.2: - resolution: {integrity: sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==} - dev: true - - /delayed-stream@1.0.0: - resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} - engines: {node: '>=0.4.0'} - dev: true - - /follow-redirects@1.15.3: - resolution: {integrity: sha512-1VzOtuEM8pC9SFU1E+8KfTjZyMztRsgEfwQl44z8A25uy13jSzTj6dyK2Df52iV0vgHCfBwLhDWevLn95w5v6Q==} - engines: {node: '>=4.0'} - peerDependencies: - debug: '*' - peerDependenciesMeta: - debug: - optional: true - dev: true - - /form-data@4.0.0: - resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==} - engines: {node: '>= 6'} - dependencies: - asynckit: 0.4.0 - combined-stream: 1.0.8 - mime-types: 2.1.35 - dev: true - - /js-tokens@4.0.0: - resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} - dev: true - - /loose-envify@1.4.0: - resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==} - hasBin: true - dependencies: - js-tokens: 4.0.0 - dev: true - - /mime-db@1.52.0: - resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} - engines: {node: '>= 0.6'} - dev: true - - /mime-types@2.1.35: - resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} - engines: {node: '>= 0.6'} - dependencies: - mime-db: 1.52.0 - dev: true - - /nanoid@3.3.7: - resolution: {integrity: sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==} - engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} - hasBin: true - dev: true - - /picocolors@1.0.0: - resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==} - dev: true - - /postcss-value-parser@4.2.0: - resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==} - dev: true - - /postcss@8.4.33: - resolution: {integrity: sha512-Kkpbhhdjw2qQs2O2DGX+8m5OVqEcbB9HRBvuYM9pgrjEFUg30A9LmXNlTAUj4S9kgtGyrMbTzVjH7E+s5Re2yg==} - engines: {node: ^10 || ^12 || >=14} - dependencies: - nanoid: 3.3.7 - picocolors: 1.0.0 - source-map-js: 1.0.2 - dev: true - - /proxy-from-env@1.1.0: - resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==} - dev: true - - /react-dom@18.2.0(react@18.2.0): - resolution: {integrity: sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==} - peerDependencies: - react: ^18.2.0 - dependencies: - loose-envify: 1.4.0 - react: 18.2.0 - scheduler: 0.23.0 - dev: true - - /react@18.2.0: - resolution: {integrity: sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==} - engines: {node: '>=0.10.0'} - dependencies: - loose-envify: 1.4.0 - dev: true - - /scheduler@0.23.0: - resolution: {integrity: sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw==} - dependencies: - loose-envify: 1.4.0 - dev: true - - /shallowequal@1.1.0: - resolution: {integrity: sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ==} - dev: true - - /source-map-js@1.0.2: - resolution: {integrity: sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==} - engines: {node: '>=0.10.0'} - dev: true - - /styled-components@6.1.1(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-cpZZP5RrKRIClBW5Eby4JM1wElLVP4NQrJbJ0h10TidTyJf4SIIwa3zLXOoPb4gJi8MsJ8mjq5mu2IrEhZIAcQ==} - engines: {node: '>= 16'} - peerDependencies: - react: '>= 16.8.0' - react-dom: '>= 16.8.0' - dependencies: - '@emotion/is-prop-valid': 1.2.1 - '@emotion/unitless': 0.8.1 - '@types/stylis': 4.2.4 - css-to-react-native: 3.2.0 - csstype: 3.1.2 - postcss: 8.4.33 - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - shallowequal: 1.1.0 - stylis: 4.3.0 - tslib: 2.6.2 - dev: true - - /stylis@4.3.0: - resolution: {integrity: sha512-E87pIogpwUsUwXw7dNyU4QDjdgVMy52m+XEOPEKUn161cCzWjjhPSQhByfd1CcNvrOLnXQ6OnnZDwnJrz/Z4YQ==} - dev: true - - /tslib@2.6.2: - resolution: {integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==} - dev: true diff --git a/fixtures/tsconfig/cases/builtins/thing.js b/fixtures/tsconfig/cases/builtins/thing.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/builtins/tsconfig.json b/fixtures/tsconfig/cases/builtins/tsconfig.json deleted file mode 100644 index 36aa1a4d..00000000 --- a/fixtures/tsconfig/cases/builtins/tsconfig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compilerOptions": { - "baseUrl": "." - } -} diff --git a/fixtures/tsconfig/cases/exports/index.js b/fixtures/tsconfig/cases/exports/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/exports/tsconfig.json b/fixtures/tsconfig/cases/exports/tsconfig.json deleted file mode 100644 index f0e3159b..00000000 --- a/fixtures/tsconfig/cases/exports/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-exports" -} diff --git a/fixtures/tsconfig/cases/extends-extension/base-tsconfig.json b/fixtures/tsconfig/cases/extends-extension/base-tsconfig.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/cases/extends-extension/base-tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/cases/extends-extension/foo.js b/fixtures/tsconfig/cases/extends-extension/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-extension/tsconfig.json b/fixtures/tsconfig/cases/extends-extension/tsconfig.json deleted file mode 100644 index 0ae4c6a3..00000000 --- a/fixtures/tsconfig/cases/extends-extension/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./base-tsconfig" -} diff --git a/fixtures/tsconfig/cases/extends-extensionless/foo.js b/fixtures/tsconfig/cases/extends-extensionless/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-extensionless/tsconfig.json b/fixtures/tsconfig/cases/extends-extensionless/tsconfig.json deleted file mode 100644 index c36cb7d4..00000000 --- a/fixtures/tsconfig/cases/extends-extensionless/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-field/conf" -} diff --git a/fixtures/tsconfig/cases/extends-multiple/foo.js b/fixtures/tsconfig/cases/extends-multiple/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-multiple/tsconfig.json b/fixtures/tsconfig/cases/extends-multiple/tsconfig.json deleted file mode 100644 index aa2ae783..00000000 --- a/fixtures/tsconfig/cases/extends-multiple/tsconfig.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": ["../extends-extension", "../extends-paths"], - "compilerOptions": { - "baseUrl": ".", - }, -} diff --git a/fixtures/tsconfig/cases/extends-not-found/index.js b/fixtures/tsconfig/cases/extends-not-found/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-not-found/tsconfig.json b/fixtures/tsconfig/cases/extends-not-found/tsconfig.json deleted file mode 100644 index 99df91da..00000000 --- a/fixtures/tsconfig/cases/extends-not-found/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./not-found" -} diff --git a/fixtures/tsconfig/cases/extends-paths/src/index.js b/fixtures/tsconfig/cases/extends-paths/src/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-paths/tsconfig.base.json b/fixtures/tsconfig/cases/extends-paths/tsconfig.base.json deleted file mode 100644 index 5c64b067..00000000 --- a/fixtures/tsconfig/cases/extends-paths/tsconfig.base.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "@/*": ["./*"] - } - } -} diff --git a/fixtures/tsconfig/cases/extends-paths/tsconfig.json b/fixtures/tsconfig/cases/extends-paths/tsconfig.json deleted file mode 100644 index 51086018..00000000 --- a/fixtures/tsconfig/cases/extends-paths/tsconfig.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": "./tsconfig.base.json", - "compilerOptions": { - "baseUrl": "src", - }, -} diff --git a/fixtures/tsconfig/cases/field/index.js b/fixtures/tsconfig/cases/field/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/field/tsconfig.json b/fixtures/tsconfig/cases/field/tsconfig.json deleted file mode 100644 index 9f86c3f4..00000000 --- a/fixtures/tsconfig/cases/field/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-field" -} diff --git a/fixtures/tsconfig/cases/index/index.js b/fixtures/tsconfig/cases/index/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/index/tsconfig.json b/fixtures/tsconfig/cases/index/tsconfig.json deleted file mode 100644 index d20b1774..00000000 --- a/fixtures/tsconfig/cases/index/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-index" -} diff --git a/fixtures/tsconfig/cases/paths_template_variable/foo.js b/fixtures/tsconfig/cases/paths_template_variable/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json b/fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json deleted file mode 100644 index a1a37bb6..00000000 --- a/fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "../../tsconfig_template_variable.json" -} diff --git a/fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json b/fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json deleted file mode 100644 index e7d8e5e5..00000000 --- a/fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "compilerOptions": { - "composite": true, - "paths": { - "foo": ["${configDir}/foo.js"] - } - } -} diff --git a/fixtures/tsconfig/cases/project_references/app/aliased/index.ts b/fixtures/tsconfig/cases/project_references/app/aliased/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/app/index.ts b/fixtures/tsconfig/cases/project_references/app/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/app/tsconfig.json b/fixtures/tsconfig/cases/project_references/app/tsconfig.json deleted file mode 100644 index 7036d2bb..00000000 --- a/fixtures/tsconfig/cases/project_references/app/tsconfig.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "extends": "../tsconfig.base.json", - "compilerOptions": { - "baseUrl": "./", - "paths": { - "@/*": ["./aliased/*"] - } - }, - "references": [ - { - "path": "../project_a/conf.json" - }, - { - "path": "../project_b" - }, - { - "path": "../project_c/tsconfig.json" - }, - { - "path": "../../paths_template_variable/tsconfig2.json" - } - ] -} diff --git a/fixtures/tsconfig/cases/project_references/project_a/aliased/index.ts b/fixtures/tsconfig/cases/project_references/project_a/aliased/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_a/conf.json b/fixtures/tsconfig/cases/project_references/project_a/conf.json deleted file mode 100644 index 4d389d7a..00000000 --- a/fixtures/tsconfig/cases/project_references/project_a/conf.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "compilerOptions": { - "composite": true, - "paths": { - "@/*": ["./aliased/*"] - } - } -} diff --git a/fixtures/tsconfig/cases/project_references/project_a/index.ts b/fixtures/tsconfig/cases/project_references/project_a/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_b/src/aliased/index.ts b/fixtures/tsconfig/cases/project_references/project_b/src/aliased/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_b/tsconfig.json b/fixtures/tsconfig/cases/project_references/project_b/tsconfig.json deleted file mode 100644 index 4ab05cd8..00000000 --- a/fixtures/tsconfig/cases/project_references/project_b/tsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "compilerOptions": { - "composite": true, - "baseUrl": "./src", - "paths": { - "@/*": ["./aliased/*"] - } - } -} diff --git a/fixtures/tsconfig/cases/project_references/project_c/index.ts b/fixtures/tsconfig/cases/project_references/project_c/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_c/tsconfig.json b/fixtures/tsconfig/cases/project_references/project_c/tsconfig.json deleted file mode 100644 index fe520939..00000000 --- a/fixtures/tsconfig/cases/project_references/project_c/tsconfig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compilerOptions": { - "composite": true - } -} diff --git a/fixtures/tsconfig/cases/project_references/tsconfig.base.json b/fixtures/tsconfig/cases/project_references/tsconfig.base.json deleted file mode 100644 index 88ccffe7..00000000 --- a/fixtures/tsconfig/cases/project_references/tsconfig.base.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "compilerOptions": { - } -} diff --git a/fixtures/tsconfig/cases/suffixes/a.ios.ts b/fixtures/tsconfig/cases/suffixes/a.ios.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/a.ts b/fixtures/tsconfig/cases/suffixes/a.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/b.ts b/fixtures/tsconfig/cases/suffixes/b.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/c-test.ts b/fixtures/tsconfig/cases/suffixes/c-test.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/index.ts b/fixtures/tsconfig/cases/suffixes/index.ts deleted file mode 100644 index b09939b9..00000000 --- a/fixtures/tsconfig/cases/suffixes/index.ts +++ /dev/null @@ -1 +0,0 @@ -import './a'; diff --git a/fixtures/tsconfig/cases/suffixes/tsconfig.json b/fixtures/tsconfig/cases/suffixes/tsconfig.json deleted file mode 100644 index 4c2ccc8f..00000000 --- a/fixtures/tsconfig/cases/suffixes/tsconfig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compilerOptions": { - "moduleSuffixes": [".ios", "-test", ""] - } -} diff --git a/fixtures/tsconfig/cases/trailing-comma/bar.js b/fixtures/tsconfig/cases/trailing-comma/bar.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/trailing-comma/index.js b/fixtures/tsconfig/cases/trailing-comma/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/trailing-comma/tsconfig.json b/fixtures/tsconfig/cases/trailing-comma/tsconfig.json deleted file mode 100644 index 6dc20ca5..00000000 --- a/fixtures/tsconfig/cases/trailing-comma/tsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "compilerOptions": { - "paths": { - /* some comment */ - "foo": ["bar.js"], - }, - }, - // another comment -} diff --git a/fixtures/tsconfig/foo.js b/fixtures/tsconfig/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/nested/index.js b/fixtures/tsconfig/nested/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/nested/test.js b/fixtures/tsconfig/nested/test.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/nested/tsconfig.json b/fixtures/tsconfig/nested/tsconfig.json deleted file mode 100644 index 6deb3011..00000000 --- a/fixtures/tsconfig/nested/tsconfig.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "extends": "..", - "compilerOptions": { - "paths": { - "ts-path": ["test.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-exports/conf.json b/fixtures/tsconfig/node_modules/tsconfig-exports/conf.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-exports/conf.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-exports/foo.js b/fixtures/tsconfig/node_modules/tsconfig-exports/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-exports/package.json b/fixtures/tsconfig/node_modules/tsconfig-exports/package.json deleted file mode 100644 index be0ddee6..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-exports/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "tsconfig-exports", - "private": true, - "exports": { - ".": "./conf.json" - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-field/conf.json b/fixtures/tsconfig/node_modules/tsconfig-field/conf.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-field/conf.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-field/foo.js b/fixtures/tsconfig/node_modules/tsconfig-field/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-field/package.json b/fixtures/tsconfig/node_modules/tsconfig-field/package.json deleted file mode 100644 index 7138fdde..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-field/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "tsconfig-field", - "private": true, - "tsconfig": "conf.json" -} \ No newline at end of file diff --git a/fixtures/tsconfig/node_modules/tsconfig-index/foo.js b/fixtures/tsconfig/node_modules/tsconfig-index/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-index/package.json b/fixtures/tsconfig/node_modules/tsconfig-index/package.json deleted file mode 100644 index eb2431e7..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-index/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "tsconfig-index", - "private": true -} \ No newline at end of file diff --git a/fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json b/fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-not-used/foo.js b/fixtures/tsconfig/node_modules/tsconfig-not-used/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json b/fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json deleted file mode 100644 index eb16d127..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "ts-path": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/package.json b/fixtures/tsconfig/package.json deleted file mode 100755 index f48acd1c..00000000 --- a/fixtures/tsconfig/package.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "name": "resolver", - "private": true, - "alias": { - "aliased": "foo", - "aliased-file": "./bar.js", - "something": "./nested/test.js", - "aliasedfolder": "./nested", - "aliasedabsolute": "/nested", - "foo/bar": "./bar.js", - "glob/*/*": "./nested/$2", - "./baz": "./bar.js", - "url": false - }, - "imports": { - "#test": "./bar.js" - }, - "dependencies": { - "foo": "^0.3.4" - }, - "peerDependencies": { - "bar": "*" - } -} diff --git a/fixtures/tsconfig/tsconfig.json b/fixtures/tsconfig/tsconfig.json deleted file mode 100644 index eb16d127..00000000 --- a/fixtures/tsconfig/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "ts-path": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/tsconfig_template_variable.json b/fixtures/tsconfig/tsconfig_template_variable.json deleted file mode 100644 index 6f272344..00000000 --- a/fixtures/tsconfig/tsconfig_template_variable.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["${configDir}/foo.js"] - } - } -} diff --git a/napi/src/lib.rs b/napi/Source/lib.rs similarity index 100% rename from napi/src/lib.rs rename to napi/Source/lib.rs diff --git a/napi/src/options.rs b/napi/Source/options.rs similarity index 100% rename from napi/src/options.rs rename to napi/Source/options.rs diff --git a/napi/__test__/resolver.spec.mjs b/napi/__test__/resolver.spec.mjs deleted file mode 100644 index 42bafba9..00000000 --- a/napi/__test__/resolver.spec.mjs +++ /dev/null @@ -1,259 +0,0 @@ -import { join } from 'node:path' -import { fileURLToPath } from 'node:url' - -import test from 'ava' - -let ResolverFactory - -if (process.env.WASI_TEST) { - const wasi = await import('../resolver.wasi.cjs') - ResolverFactory = wasi.ResolverFactory -} else { - const napi = await import('../index.js') - ResolverFactory = napi.ResolverFactory -} - -const currentDir = join(fileURLToPath(import.meta.url), '..') - -const enhancedResolveRoot = join( - currentDir, - '..', - '..', - 'fixtures', - 'enhanced_resolve', - 'test', - 'fixtures' -) - -// https://github.com/webpack/enhanced-resolve/blob/main/test/resolve.test.js - -for (const [title, context, request, expected] of [ - [ - 'absolute path', - enhancedResolveRoot, - join(enhancedResolveRoot, 'main1.js'), - join(enhancedResolveRoot, 'main1.js'), - ], - [ - 'file with .js', - enhancedResolveRoot, - './main1.js', - join(enhancedResolveRoot, 'main1.js'), - ], - [ - 'file without extension', - enhancedResolveRoot, - './main1', - join(enhancedResolveRoot, 'main1.js'), - ], - [ - 'another file with .js', - enhancedResolveRoot, - './a.js', - join(enhancedResolveRoot, 'a.js'), - ], - [ - 'another file without extension', - enhancedResolveRoot, - './a', - join(enhancedResolveRoot, 'a.js'), - ], - [ - 'file in module with .js', - enhancedResolveRoot, - 'm1/a.js', - join(enhancedResolveRoot, 'node_modules/m1/a.js'), - ], - [ - 'file in module without extension', - enhancedResolveRoot, - 'm1/a', - join(enhancedResolveRoot, 'node_modules/m1/a.js'), - ], - [ - 'another file in module without extension', - enhancedResolveRoot, - 'complexm/step1', - join(enhancedResolveRoot, 'node_modules/complexm/step1.js'), - ], - [ - 'from submodule to file in sibling module', - join(enhancedResolveRoot, 'node_modules/complexm'), - 'm2/b.js', - join(enhancedResolveRoot, 'node_modules/m2/b.js'), - ], - [ - 'from nested directory to overwritten file in module', - join(enhancedResolveRoot, 'multiple_modules'), - 'm1/a.js', - join(enhancedResolveRoot, 'multiple_modules/node_modules/m1/a.js'), - ], - [ - 'from nested directory to not overwritten file in module', - join(enhancedResolveRoot, 'multiple_modules'), - 'm1/b.js', - join(enhancedResolveRoot, 'node_modules/m1/b.js'), - ], - [ - 'file with query', - enhancedResolveRoot, - './main1.js?query', - join(enhancedResolveRoot, 'main1.js?query'), - ], - [ - 'file with fragment', - enhancedResolveRoot, - './main1.js#fragment', - join(enhancedResolveRoot, 'main1.js#fragment'), - ], - [ - 'file with fragment and query', - enhancedResolveRoot, - './main1.js#fragment?query', - join(enhancedResolveRoot, 'main1.js#fragment?query'), - ], - [ - 'file with query and fragment', - enhancedResolveRoot, - './main1.js?#fragment', - join(enhancedResolveRoot, 'main1.js?#fragment'), - ], - - [ - 'file with query (unicode)', - enhancedResolveRoot, - './测试.js?query', - join(enhancedResolveRoot, '测试.js?query'), - ], - [ - 'file with fragment (unicode)', - enhancedResolveRoot, - './测试.js#fragment', - join(enhancedResolveRoot, '测试.js#fragment'), - ], - [ - 'file with fragment and query (unicode)', - enhancedResolveRoot, - './测试.js#fragment?query', - join(enhancedResolveRoot, '测试.js#fragment?query'), - ], - [ - 'file with query and fragment (unicode)', - enhancedResolveRoot, - './测试.js?#fragment', - join(enhancedResolveRoot, '测试.js?#fragment'), - ], - - [ - 'file in module with query', - enhancedResolveRoot, - 'm1/a?query', - join(enhancedResolveRoot, 'node_modules/m1/a.js?query'), - ], - [ - 'file in module with fragment', - enhancedResolveRoot, - 'm1/a#fragment', - join(enhancedResolveRoot, 'node_modules/m1/a.js#fragment'), - ], - [ - 'file in module with fragment and query', - enhancedResolveRoot, - 'm1/a#fragment?query', - join(enhancedResolveRoot, 'node_modules/m1/a.js#fragment?query'), - ], - [ - 'file in module with query and fragment', - enhancedResolveRoot, - 'm1/a?#fragment', - join(enhancedResolveRoot, 'node_modules/m1/a.js?#fragment'), - ], - [ - 'differ between directory and file, resolve file', - enhancedResolveRoot, - './dirOrFile', - join(enhancedResolveRoot, 'dirOrFile.js'), - ], - [ - 'differ between directory and file, resolve directory', - enhancedResolveRoot, - './dirOrFile/', - join(enhancedResolveRoot, 'dirOrFile/index.js'), - ], - [ - 'find node_modules outside of node_modules', - join(enhancedResolveRoot, 'browser-module/node_modules'), - 'm1/a', - join(enhancedResolveRoot, 'node_modules/m1/a.js'), - ], - [ - "don't crash on main field pointing to self", - enhancedResolveRoot, - './main-field-self', - join(enhancedResolveRoot, './main-field-self/index.js'), - ], - [ - "don't crash on main field pointing to self (2)", - enhancedResolveRoot, - './main-field-self2', - join(enhancedResolveRoot, './main-field-self2/index.js'), - ], - // enhanced-resolve has `#` prepended with a `\0`, they are removed from the - // following 3 expected test results. - // See https://github.com/webpack/enhanced-resolve#escaping - [ - 'handle fragment edge case (no fragment)', - enhancedResolveRoot, - './no#fragment/#/#', - join(enhancedResolveRoot, 'no#fragment', '#', '#.js'), - ], - [ - 'handle fragment edge case (fragment)', - enhancedResolveRoot, - './no#fragment/#/', - join(enhancedResolveRoot, 'no.js#fragment') + '/#/', - ], - [ - 'handle fragment escaping', - enhancedResolveRoot, - './no\0#fragment/\0#/\0##fragment', - join(enhancedResolveRoot, 'no#fragment', '#', '#.js#fragment'), - ], -]) { - test(title, (t) => { - const resolver = new ResolverFactory({ - modules: ['src/a', 'src/b', 'src/common', 'node_modules'], - extensions: ['.js', '.jsx', '.ts', '.tsx'], - }) - - t.is(resolver.sync(context, request).path, expected) - }) -} - -test('resolve pnpm package', (t) => { - const pnpmProjectPath = join(currentDir, '..', '..', 'fixtures', 'pnpm8') - const resolver = new ResolverFactory({ - aliasFields: ['browser'], - }) - t.deepEqual(resolver.sync(pnpmProjectPath, 'styled-components'), { - path: join( - pnpmProjectPath, - 'node_modules/.pnpm/styled-components@6.1.1_react-dom@18.2.0_react@18.2.0/node_modules/styled-components/dist/styled-components.browser.cjs.js' - ), - }) - t.deepEqual( - resolver.sync( - join( - pnpmProjectPath, - 'node_modules/.pnpm/styled-components@6.1.1_react-dom@18.2.0_react@18.2.0/node_modules/styled-components' - ), - 'react' - ), - { - path: join( - pnpmProjectPath, - 'node_modules/.pnpm/react@18.2.0/node_modules/react/index.js' - ), - } - ) -}) diff --git a/napi/tests/options.test.mjs b/napi/tests/options.test.mjs deleted file mode 100644 index 4a93efff..00000000 --- a/napi/tests/options.test.mjs +++ /dev/null @@ -1,59 +0,0 @@ -import { describe, it } from "node:test"; -import { ResolverFactory } from "../index.js"; -import * as assert from "node:assert"; -import * as path from "node:path"; - -const fixtureDir = new URL( - "../../fixtures/enhanced_resolve/test/fixtures", - import.meta.url -).pathname; - -describe("option", () => { - describe("aliasFields", () => { - it("should allow field string ", () => { - const resolver = new ResolverFactory({ aliasFields: ["browser"] }); - assert.match( - resolver.sync(fixtureDir, "./browser-module/lib/replaced.js").path, - /browser-module\/lib\/browser\.js$/ - ); - }); - it("should allow json path array", () => { - const resolver = new ResolverFactory({ - aliasFields: [["innerBrowser1", "field", "browser"]], - }); - - assert.match( - resolver.sync(fixtureDir, "./browser-module/lib/main1.js").path, - /browser-module\/lib\/main\.js$/ - ); - }); - }); - - describe("exportsFields", () => { - const createTest = (exportsFields) => { - const resolver = new ResolverFactory({ exportsFields }); - assert.match( - resolver.sync( - path.resolve(fixtureDir, "./exports-field3"), - "exports-field" - ).path, - /\/exports-field\/src\/index\.js$/ - ); - }; - it("should allow string as field item", createTest(["broken"])); - it("should allow json path array as field item", createTest([["broken"]])); - }); - - describe("mainFields", () => { - const createTest = (mainFields) => { - const resolver = new ResolverFactory({ mainFields }); - assert.match( - resolver.sync(fixtureDir, "../..").path, - /\/lib\/index\.js$/ - ); - }; - it("should use `'main'` as default", createTest(undefined)); - it("should allow field string", createTest("main")); - it("should allow field array", createTest(["main"])); - }); -}); diff --git a/npm/package.json b/npm/package.json index da474123..33dc2308 100644 --- a/npm/package.json +++ b/npm/package.json @@ -1,41 +1,61 @@ { - "name": "oxc-resolver", - "version": "1.7.0", - "description": "Oxc Resolver Node API", - "main": "index.js", - "browser": "browser.js", - "files": [ - "index.d.ts", - "index.js", - "browser.js" - ], - "license": "MIT", - "homepage": "https://oxc-project.github.io", - "repository": { - "type": "git", - "url": "git+https://github.com/oxc-project/oxc-resolver.git" - }, - "publishConfig": { - "registry": "https://registry.npmjs.org/", - "access": "public" - }, - "napi": { - "binaryName": "resolver", - "packageName": "@oxc-resolver/binding", - "targets": [ - "x86_64-pc-windows-msvc", - "aarch64-pc-windows-msvc", - "x86_64-unknown-linux-gnu", - "x86_64-unknown-linux-musl", - "aarch64-unknown-linux-gnu", - "aarch64-unknown-linux-musl", - "armv7-unknown-linux-gnueabihf", - "x86_64-apple-darwin", - "aarch64-apple-darwin", - "wasm32-wasi-preview1-threads" - ] - }, - "funding": { - "url": "https://github.com/sponsors/Boshen" - } + "name": "oxc-resolver", + "version": "0.0.1", + "private": false, + "description": "Oxc Resolver Node API", + "keywords": [ + "land" + ], + "homepage": "HTTPS://GitHub.Com/CodeEditorLand/OXCResolver#readme", + "bugs": { + "url": "HTTPS://GitHub.Com/CodeEditorLand/OXCResolver/issues" + }, + "repository": { + "type": "git", + "url": "git+HTTPS://github.com/CodeEditorLand/OXCResolver.git" + }, + "funding": { + "url": "https://github.com/sponsors/Boshen" + }, + "license": "SEE LICENSE IN LICENSE", + "author": { + "name": "🌆 — Land —", + "email": "Land@PlayForm.Cloud", + "url": "HTTPS://Land.PlayForm.Cloud" + }, + "type": "module", + "main": "index.js", + "browser": "browser.js", + "files": [ + "index.d.ts", + "index.js", + "browser.js" + ], + "scripts": { + "Document": "Document 'Source/**/*.ts'", + "prepublishOnly": "Build 'Source/**/*.ts'" + }, + "devDependencies": { + "@playform/build": "0.0.7", + "@playform/document": "0.0.6" + }, + "publishConfig": { + "access": "public" + }, + "napi": { + "binaryName": "resolver", + "packageName": "@oxc-resolver/binding", + "targets": [ + "x86_64-pc-windows-msvc", + "aarch64-pc-windows-msvc", + "x86_64-unknown-linux-gnu", + "x86_64-unknown-linux-musl", + "aarch64-unknown-linux-gnu", + "aarch64-unknown-linux-musl", + "armv7-unknown-linux-gnueabihf", + "x86_64-apple-darwin", + "aarch64-apple-darwin", + "wasm32-wasi-preview1-threads" + ] + } } diff --git a/package.json b/package.json index 49c13e54..8ef44cdb 100644 --- a/package.json +++ b/package.json @@ -1,36 +1,50 @@ { - "name": "@oxc-resolver/binding", - "private": true, - "version": "0.0.0", - "scripts": { - "build": "napi build --platform --release --package-json-path npm/package.json --manifest-path napi/Cargo.toml", - "build:debug": "napi build --platform --package-json-path npm/package.json --manifest-path napi/Cargo.toml", - "prepublishOnly": "napi pre-publish -t npm", - "test": "ava" - }, - "devDependencies": { - "@napi-rs/cli": "^3.0.0-alpha.43", - "@napi-rs/wasm-runtime": "^0.2.0", - "@types/node": "^20.10.4", - "ava": "^6.0.1", - "emnapi": "^1.0.0", - "typescript": "^5.3.3" - }, - "engines": { - "node": ">=10" - }, - "ava": { - "files": [ - "napi/__test__/*.spec.mjs" - ], - "cache": false - }, - "packageManager": "pnpm@9.0.6", - "repository": { - "type": "git", - "url": "git+https://github.com/oxc-project/oxc-resolver.git" - }, - "funding": { - "url": "https://github.com/sponsors/Boshen" - } + "name": "@oxc-resolver/binding", + "version": "0.0.1", + "private": false, + "keywords": [ + "land" + ], + "homepage": "HTTPS://GitHub.Com/CodeEditorLand/OXCResolver#readme", + "bugs": { + "url": "HTTPS://GitHub.Com/CodeEditorLand/OXCResolver/issues" + }, + "repository": { + "type": "git", + "url": "git+HTTPS://github.com/CodeEditorLand/OXCResolver.git" + }, + "funding": { + "url": "https://github.com/sponsors/Boshen" + }, + "license": "SEE LICENSE IN LICENSE", + "author": { + "name": "🌆 — Land —", + "email": "Land@PlayForm.Cloud", + "url": "HTTPS://Land.PlayForm.Cloud" + }, + "type": "module", + "scripts": { + "Document": "Document 'Source/**/*.ts'", + "build": "napi build --platform --release --package-json-path npm/package.json --manifest-path napi/Cargo.toml", + "build:debug": "napi build --platform --package-json-path npm/package.json --manifest-path napi/Cargo.toml", + "prepublishOnly": "Build 'Source/**/*.ts'" + }, + "ava": { + "cache": false, + "files": [ + "napi/__test__/*.spec.mjs" + ] + }, + "devDependencies": { + "@napi-rs/cli": "^3.0.0-alpha.43", + "@napi-rs/wasm-runtime": "^0.2.0", + "@playform/build": "0.0.7", + "@playform/document": "0.0.6", + "@types/node": "^20.10.4", + "ava": "^6.0.1", + "emnapi": "^1.0.0" + }, + "publishConfig": { + "access": "public" + } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml deleted file mode 100644 index 878ba525..00000000 --- a/pnpm-lock.yaml +++ /dev/null @@ -1,2450 +0,0 @@ -lockfileVersion: '9.0' - -settings: - autoInstallPeers: true - excludeLinksFromLockfile: false - -importers: - - .: - devDependencies: - '@napi-rs/cli': - specifier: ^3.0.0-alpha.43 - version: 3.0.0-alpha.51(@emnapi/runtime@1.1.1)(emnapi@1.1.1) - '@napi-rs/wasm-runtime': - specifier: ^0.2.0 - version: 0.2.0 - '@types/node': - specifier: ^20.10.4 - version: 20.12.7 - ava: - specifier: ^6.0.1 - version: 6.1.2 - emnapi: - specifier: ^1.0.0 - version: 1.1.1 - typescript: - specifier: ^5.3.3 - version: 5.4.5 - -packages: - - '@emnapi/core@1.1.1': - resolution: {integrity: sha512-eu4KjHfXg3I+UUR7vSuwZXpRo4c8h4Rtb5Lu2F7Z4JqJFl/eidquONEBiRs6viXKpWBC3BaJBy68xGJ2j56idw==} - - '@emnapi/runtime@1.1.1': - resolution: {integrity: sha512-3bfqkzuR1KLx57nZfjr2NLnFOobvyS0aTszaEGCGqmYMVDRaGvgIZbjGSV/MHSSmLgQ/b9JFHQ5xm5WRZYd+XQ==} - - '@inquirer/figures@1.0.1': - resolution: {integrity: sha512-mtup3wVKia3ZwULPHcbs4Mor8Voi+iIXEWD7wCNbIO6lYR62oPCTQyrddi5OMYVXHzeCSoneZwJuS8sBvlEwDw==} - engines: {node: '>=18'} - - '@ljharb/through@2.3.13': - resolution: {integrity: sha512-/gKJun8NNiWGZJkGzI/Ragc53cOdcLNdzjLaIa+GEjguQs0ulsurx8WN0jijdK9yPqDvziX995sMRLyLt1uZMQ==} - engines: {node: '>= 0.4'} - - '@mapbox/node-pre-gyp@1.0.11': - resolution: {integrity: sha512-Yhlar6v9WQgUp/He7BdgzOz8lqMQ8sU+jkCq7Wx8Myc5YFJLbEe7lgui/V7G1qB1DJykHSGwreceSaD60Y0PUQ==} - hasBin: true - - '@napi-rs/cli@3.0.0-alpha.51': - resolution: {integrity: sha512-fzTQ4RfhaghFNryWTfb0e93N/J7hNfAOpUNL98u9qMymsXa3w2cUTN8W/HjiNVTUvHHus8X5PuHt9q65cDXcSg==} - engines: {node: '>= 16'} - hasBin: true - peerDependencies: - '@emnapi/runtime': ^1.1.0 - emnapi: ^1.1.0 - peerDependenciesMeta: - '@emnapi/runtime': - optional: true - emnapi: - optional: true - - '@napi-rs/cross-toolchain@0.0.14': - resolution: {integrity: sha512-Xgoe1gCEo5s5VUxmSnK4tYFJXW2JAVM02jptSbqA2+gp8pt4Vuk9oK2LvswwO9iRfHapKacYYhegD8Dq/+PBOQ==} - peerDependencies: - '@napi-rs/cross-toolchain-arm64-target-aarch64': ^0.0.14 - '@napi-rs/cross-toolchain-arm64-target-armv7': ^0.0.14 - '@napi-rs/cross-toolchain-arm64-target-x86_64': ^0.0.14 - '@napi-rs/cross-toolchain-x64-target-aarch64': ^0.0.14 - '@napi-rs/cross-toolchain-x64-target-armv7': ^0.0.14 - '@napi-rs/cross-toolchain-x64-target-x86_64': ^0.0.14 - peerDependenciesMeta: - '@napi-rs/cross-toolchain-arm64-target-aarch64': - optional: true - '@napi-rs/cross-toolchain-arm64-target-armv7': - optional: true - '@napi-rs/cross-toolchain-arm64-target-x86_64': - optional: true - '@napi-rs/cross-toolchain-x64-target-aarch64': - optional: true - '@napi-rs/cross-toolchain-x64-target-armv7': - optional: true - '@napi-rs/cross-toolchain-x64-target-x86_64': - optional: true - - '@napi-rs/lzma-android-arm-eabi@1.2.1': - resolution: {integrity: sha512-GKXud2hTddxehff1mAGkbTfseBj+GcM+M/sZuxf9H9CJeOWpfI/HC9Oy3uv8mBqPTkOQdCcZ/xXPU34EOEwiRg==} - engines: {node: '>= 10'} - cpu: [arm] - os: [android] - - '@napi-rs/lzma-android-arm64@1.2.1': - resolution: {integrity: sha512-UKFvc56TdgljbdgLvSwM62pSItV/4SuXXCrJtruPDmbIDe8HKag8hsCKsb66hrc9aX7urJ+KGw1yz5hWiONLyw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [android] - - '@napi-rs/lzma-darwin-arm64@1.2.1': - resolution: {integrity: sha512-eLbHzK5xGVzEABb1ESFELQJzXKoQeP9QH9hMPd4Qq29xD6MkWD2VKlAy40AxrMeWc7fCUIImTTlGuGRvg6tI1g==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [darwin] - - '@napi-rs/lzma-darwin-x64@1.2.1': - resolution: {integrity: sha512-/a5sHZkkO81w/PCpxlwXjADz++jDiTJquMzCLAhupd23wTRmJoCBAwp4Tur+qV5esI7ahAA0lS5P0M4TZv+OUg==} - engines: {node: '>= 10'} - cpu: [x64] - os: [darwin] - - '@napi-rs/lzma-freebsd-x64@1.2.1': - resolution: {integrity: sha512-Ehc0ld148YcqQrDWwUbVta1l45R4PthCIU6ZDbOYzzeYXQnhgr1fWiex7wu4KMFppteHlYntypUIhmMUklqchA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [freebsd] - - '@napi-rs/lzma-linux-arm-gnueabihf@1.2.1': - resolution: {integrity: sha512-EkIsx3kC67viElNetZgaGAtAceA+4pVGj31HKKPn0RZYn3rCNdEEg2i1IRg07Y6m4bHwcaKutLoZ2LDcQ+yiBg==} - engines: {node: '>= 10'} - cpu: [arm] - os: [linux] - - '@napi-rs/lzma-linux-arm64-gnu@1.2.1': - resolution: {integrity: sha512-GxSbp1/X7Ppmf+aNiZ95vl1HgQzRS9C8zCv7unEhYRPAjRkAnlrsLluUBOTPIY2yquuUvfIog9XIml6Hpw2wrA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/lzma-linux-arm64-musl@1.2.1': - resolution: {integrity: sha512-2L3KHFGGdt0xgU0WcKwKmnjVCYs88t4+ixBgPfEydtYsOceg6B8eOzdM7xsziKxJyUJKWBetGLgARQOy35bfvA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/lzma-linux-x64-gnu@1.2.1': - resolution: {integrity: sha512-h29XttA2Og1+6vYHsVcp+i1PkeILKzYnoDun0ul/k/5hvfxJ2Jap+EM07sW4HSz/DiscLAeIZmLKbXEqJgF5bg==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/lzma-linux-x64-musl@1.2.1': - resolution: {integrity: sha512-8EIkpLid4pepkBsljQ7rgma8jdwAuwVyJ2tY6Wuj1I/AqAkVVfxTwIuYc4zgRR3nfcrmWgOfZE0VneVmQCE5hw==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/lzma-win32-arm64-msvc@1.2.1': - resolution: {integrity: sha512-RNPItarWUUbtwz6dyn8FGH9AXEaAsBcMBlTvcRjv8eoqRqyZ9R49Ruk/8WMS57MM1BKdiPDxHBtRi+nZn27Slw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [win32] - - '@napi-rs/lzma-win32-ia32-msvc@1.2.1': - resolution: {integrity: sha512-rNdsCZnzKVgeDd9NzXWk9WuADVUWUWdnws8qBRCfHRUQqJ56Ic1W7Y1XmP+bNa985MXlU6vbznHTHmU5zk2P+A==} - engines: {node: '>= 10'} - cpu: [ia32] - os: [win32] - - '@napi-rs/lzma-win32-x64-msvc@1.2.1': - resolution: {integrity: sha512-1AFrAh1n73Yw+IhDu5HnaiRD4vWEkafY0EarfziPfDsh/GeyNcjbE+Let+XFe8L3j0/CZfsRG3nXarOW1oadUQ==} - engines: {node: '>= 10'} - cpu: [x64] - os: [win32] - - '@napi-rs/lzma@1.2.1': - resolution: {integrity: sha512-vwl34tzF2mXWthnFVN2MP6nRzQ40C5+256EEUjxAwj9dbAhDqb7Yz376Up5SlB4YgNC0YvEqK4jsYP/NP0bgpg==} - engines: {node: '>= 10'} - - '@napi-rs/tar-android-arm-eabi@0.1.0': - resolution: {integrity: sha512-gY9f7HfyU8MQs/ERi2/Fc4dGRf61ZM2pme31t0FkrzTtmeIaf56LiTeTt4aP8xh/0HOVnXrB6I3taY9IsQVB8Q==} - engines: {node: '>= 10'} - cpu: [arm] - os: [android] - - '@napi-rs/tar-android-arm64@0.1.0': - resolution: {integrity: sha512-NxszsTRdAYf25kKuzUYz514/5MFI3w3aHToZBcFjaxUmsayrimFrHIiPLwNQVe55lHPRi13njqQUPjMetHMCZw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [android] - - '@napi-rs/tar-darwin-arm64@0.1.0': - resolution: {integrity: sha512-G+fSNcwhbekTMOElS66mf3ccg8M4NcEHIgo7s6Hxo8U2obUSqEJ0WjTDV8oJy7lqRW/MeeDJj8Vz0ceXC8ueeA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [darwin] - - '@napi-rs/tar-darwin-x64@0.1.0': - resolution: {integrity: sha512-p9aOLk6O2+Cu62fNOdj1Zx0P3J1VkxtihXOVDaK49o5jszhms0roNA7kZfklwjVdwo8R7OQC6mJcFWmiamMNug==} - engines: {node: '>= 10'} - cpu: [x64] - os: [darwin] - - '@napi-rs/tar-freebsd-x64@0.1.0': - resolution: {integrity: sha512-mZQPtyCc2r+P84WV76Ddbe1+CxBscxlDHtgMIxZPveMgq4esZFKp26M735vjxtk/j2ahT0pZoC6fjsJ//Uxzlg==} - engines: {node: '>= 10'} - cpu: [x64] - os: [freebsd] - - '@napi-rs/tar-linux-arm-gnueabihf@0.1.0': - resolution: {integrity: sha512-FHxnmrOS345T3n3XDmY9QEoVv1PXkkuevQbu+gzq5np4fzN/NX2Az5oJTxKOTGtlJSaxxz90raeaWRZrnV5hZQ==} - engines: {node: '>= 10'} - cpu: [arm] - os: [linux] - - '@napi-rs/tar-linux-arm64-gnu@0.1.0': - resolution: {integrity: sha512-+8WHnL/8PPpePYc+5oqNLoE5o98vWF7lJvY/seji7tdcS5TPJ3tgXaF4/y1rFAaSxKsZ9l+ClHsZZ0MpCqMOOQ==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/tar-linux-arm64-musl@0.1.0': - resolution: {integrity: sha512-SXqU4H30/TD9BZa6pH/U5l2V6E4EKOutjHp9Sqr98iH52Zb+1N84ur1Ti7/+PapKunCIJeZzU+792CQagKIzuQ==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/tar-linux-x64-gnu@0.1.0': - resolution: {integrity: sha512-2uZHxl2nH1HbeJuifB1qdK8vU9wKDrxQkFm+u4psUaa/uHLZDUCGS7GMxTnCbR9OehqZcfQabaKsHbxR/8ElDQ==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/tar-linux-x64-musl@0.1.0': - resolution: {integrity: sha512-S1vEqLK4UCHS4AjVZ3g6o7r0Yu6RbhmDj6JrqxBoEIjrMsuIPKQrODHhtlsykOPeu5IHQuyRT+DevorWAVYdoA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/tar-win32-arm64-msvc@0.1.0': - resolution: {integrity: sha512-x23Ganq0hcDbgnhzAFqOu5EWtKvngIsapJL7ZLGgQlqahRb15aQkagYvpju6CLZers6N6znmqxw9Pdov9VFzOQ==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [win32] - - '@napi-rs/tar-win32-ia32-msvc@0.1.0': - resolution: {integrity: sha512-QJgJQEKDbVOrzSJ3EaUuCk+g7t9tKv085eALmRtkiHDBmzd0iAoudcU2N9YgdacSQMe1V/GMuQLky6BFrZb4nw==} - engines: {node: '>= 10'} - cpu: [ia32] - os: [win32] - - '@napi-rs/tar-win32-x64-msvc@0.1.0': - resolution: {integrity: sha512-aEhLcPZXmbcz46utpgYrkhY/TIGVCs4T5c+xpBf6H8feIEz7rF44Bm6kECC42OWcqnws2LGRW9TZsv0bWoAn0A==} - engines: {node: '>= 10'} - cpu: [x64] - os: [win32] - - '@napi-rs/tar@0.1.0': - resolution: {integrity: sha512-HodV5VS/ryhNvSmSHPb6CT5lJKzkoKaiyO8JPkVw3XCXbp51+vZs7LJ66kgFqyr4AagaKqmXsgpGVCIwNdFw/w==} - engines: {node: '>= 10'} - - '@napi-rs/wasm-runtime@0.1.2': - resolution: {integrity: sha512-8JuczewTFIZ/XIjHQ+YlQUydHvlKx2hkcxtuGwh+t/t5zWyZct6YG4+xjHcq8xyc/e7FmFwf42Zj2YgICwmlvA==} - - '@napi-rs/wasm-runtime@0.2.0': - resolution: {integrity: sha512-ETCooPEZJN7cGp6GwE5mUTrStrhIeuEPo0lOhLe48Iz35z6CkbgDauR8nE/K4GaMEu2BwTOm2Epy7ru8w1ua7w==} - - '@napi-rs/wasm-tools-android-arm-eabi@0.0.1': - resolution: {integrity: sha512-Q/SyyO60dbpoLcN/hvGzNWDaCjuaMGFeg92GnsDBWm3OCwhvltr51+VDZbCIHQwfIvH4d63X29nEls7FHK75dA==} - engines: {node: '>= 10'} - cpu: [arm] - os: [android] - - '@napi-rs/wasm-tools-android-arm64@0.0.1': - resolution: {integrity: sha512-mn7QpSWJlQS7Z14DkWqW14HqEiI2R8FV3KT4SNdqm+O+K5uIUvAexxMn9Qu6gqLq1fHXj+7l2luAWmtN7RKLjA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [android] - - '@napi-rs/wasm-tools-darwin-arm64@0.0.1': - resolution: {integrity: sha512-WuxMRtd5rCgqfuk7dehcft5eyGDOuNSMaJybprbX4IXvnjlLQf1zsCfp6wBI2Ptp2D+qEgE2SAMWBfzF9XDDkw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [darwin] - - '@napi-rs/wasm-tools-darwin-x64@0.0.1': - resolution: {integrity: sha512-YGPjgIo1/Y774aAFb/UT+d8VQtTaIkdF0/ynlChe/UilBZX48vLaEM0HaoSqxA1WHvRm8Il8R3rBDDle0965rw==} - engines: {node: '>= 10'} - cpu: [x64] - os: [darwin] - - '@napi-rs/wasm-tools-freebsd-x64@0.0.1': - resolution: {integrity: sha512-e5y+Z89XwI7HpLyCNEvDKdtO5Sga2+o8bDcNQNHjhMunnnHKPtlTvtIhieVmdqnNGPbuNkIx8xbTjkoWCZ49Tw==} - engines: {node: '>= 10'} - cpu: [x64] - os: [freebsd] - - '@napi-rs/wasm-tools-linux-arm64-gnu@0.0.1': - resolution: {integrity: sha512-Hcy+XiCJd8XshxVOYvmyU5FgeY8d6txZf7ZefI38Y3eRm7rzGt/EvABGjvJfujnPaBeWi9fQVm3Zav5pwyxViw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/wasm-tools-linux-arm64-musl@0.0.1': - resolution: {integrity: sha512-1mSquGy4N7jlRu/0OY/rqZa/XdCFGKrsl8SH4jRB318DVweOHLqn15QG4iwIrRVjCJROpaU9HRU/sgOKVbdqrA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/wasm-tools-linux-x64-gnu@0.0.1': - resolution: {integrity: sha512-/+XuGQ9667EqrxRbpt2izLDNzWUWLTXl6KaRSh9TjcT7qL5+yllTqchc0JwIHJW5QnQlC1NW7HnSnwQZ+/v+8g==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/wasm-tools-linux-x64-musl@0.0.1': - resolution: {integrity: sha512-L+5QcEsUS+QNcMI1AF6aBRKLzhxQ5VHRHVslaQwOxHoxyhMB/2hRH4ON6Zea1PyQS/zzZugwBuDEOcFtc3UjPQ==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/wasm-tools-wasm32-wasi@0.0.1': - resolution: {integrity: sha512-I1vAhMQcBblPJPg6pr+xydZ1NjPwKU2ympmI54BZfCOAMHs0ZfVb4yEqYAVIcSWOx3CF/0T2YrcOmiULTU3iGw==} - engines: {node: '>=14.0.0'} - cpu: [wasm32] - - '@napi-rs/wasm-tools-win32-arm64-msvc@0.0.1': - resolution: {integrity: sha512-A9peDWijE9X6qt5SNzqlmSMlOZiqeB9zhUVP5dtJKtpqVO098YVnZFsz/4Hv7LkSoxQE7brAd9yln/wz5qb1yQ==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [win32] - - '@napi-rs/wasm-tools-win32-ia32-msvc@0.0.1': - resolution: {integrity: sha512-6Y7GqnBCIdl8YsSQ+5AjnZ4iWDJnJrqzRlMDegCmPPf3WmRZ0sgnRU9iAHWcId9AEIf7SAs3x7Bnv2992zCwJA==} - engines: {node: '>= 10'} - cpu: [ia32] - os: [win32] - - '@napi-rs/wasm-tools-win32-x64-msvc@0.0.1': - resolution: {integrity: sha512-Ab6ljJCQmXqJvE4/8DLvHEVTI7vVUrVfh6gCwnVwwrA/B2LgR98SanpT8/951ZaIH/lSuqkeVm+wqzgYM1FHRg==} - engines: {node: '>= 10'} - cpu: [x64] - os: [win32] - - '@napi-rs/wasm-tools@0.0.1': - resolution: {integrity: sha512-itoKmaVqRKIV37sKIEri1qjaYlWNtXyfymUaqXkLu5F16s+FwqwOmvxmdTHsvNKkMy4qCsSSetiLZO1IwvBMLQ==} - engines: {node: '>= 10'} - - '@nodelib/fs.scandir@2.1.5': - resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} - engines: {node: '>= 8'} - - '@nodelib/fs.stat@2.0.5': - resolution: {integrity: sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==} - engines: {node: '>= 8'} - - '@nodelib/fs.walk@1.2.8': - resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} - engines: {node: '>= 8'} - - '@octokit/auth-token@4.0.0': - resolution: {integrity: sha512-tY/msAuJo6ARbK6SPIxZrPBms3xPbfwBrulZe0Wtr/DIY9lje2HeV1uoebShn6mx7SjCHif6EjMvoREj+gZ+SA==} - engines: {node: '>= 18'} - - '@octokit/core@5.2.0': - resolution: {integrity: sha512-1LFfa/qnMQvEOAdzlQymH0ulepxbxnCYAKJZfMci/5XJyIHWgEYnDmgnKakbTh7CH2tFQ5O60oYDvns4i9RAIg==} - engines: {node: '>= 18'} - - '@octokit/endpoint@9.0.5': - resolution: {integrity: sha512-ekqR4/+PCLkEBF6qgj8WqJfvDq65RH85OAgrtnVp1mSxaXF03u2xW/hUdweGS5654IlC0wkNYC18Z50tSYTAFw==} - engines: {node: '>= 18'} - - '@octokit/graphql@7.1.0': - resolution: {integrity: sha512-r+oZUH7aMFui1ypZnAvZmn0KSqAUgE1/tUXIWaqUCa1758ts/Jio84GZuzsvUkme98kv0WFY8//n0J1Z+vsIsQ==} - engines: {node: '>= 18'} - - '@octokit/openapi-types@20.0.0': - resolution: {integrity: sha512-EtqRBEjp1dL/15V7WiX5LJMIxxkdiGJnabzYx5Apx4FkQIFgAfKumXeYAqqJCj1s+BMX4cPFIFC4OLCR6stlnA==} - - '@octokit/openapi-types@22.1.0': - resolution: {integrity: sha512-pGUdSP+eEPfZiQHNkZI0U01HLipxncisdJQB4G//OAmfeO8sqTQ9KRa0KF03TUPCziNsoXUrTg4B2Q1EX++T0Q==} - - '@octokit/plugin-paginate-rest@9.2.1': - resolution: {integrity: sha512-wfGhE/TAkXZRLjksFXuDZdmGnJQHvtU/joFQdweXUgzo1XwvBCD4o4+75NtFfjfLK5IwLf9vHTfSiU3sLRYpRw==} - engines: {node: '>= 18'} - peerDependencies: - '@octokit/core': '5' - - '@octokit/plugin-request-log@4.0.1': - resolution: {integrity: sha512-GihNqNpGHorUrO7Qa9JbAl0dbLnqJVrV8OXe2Zm5/Y4wFkZQDfTreBzVmiRfJVfE4mClXdihHnbpyyO9FSX4HA==} - engines: {node: '>= 18'} - peerDependencies: - '@octokit/core': '5' - - '@octokit/plugin-rest-endpoint-methods@10.4.1': - resolution: {integrity: sha512-xV1b+ceKV9KytQe3zCVqjg+8GTGfDYwaT1ATU5isiUyVtlVAO3HNdzpS4sr4GBx4hxQ46s7ITtZrAsxG22+rVg==} - engines: {node: '>= 18'} - peerDependencies: - '@octokit/core': '5' - - '@octokit/request-error@5.1.0': - resolution: {integrity: sha512-GETXfE05J0+7H2STzekpKObFe765O5dlAKUTLNGeH+x47z7JjXHfsHKo5z21D/o/IOZTUEI6nyWyR+bZVP/n5Q==} - engines: {node: '>= 18'} - - '@octokit/request@8.4.0': - resolution: {integrity: sha512-9Bb014e+m2TgBeEJGEbdplMVWwPmL1FPtggHQRkV+WVsMggPtEkLKPlcVYm/o8xKLkpJ7B+6N8WfQMtDLX2Dpw==} - engines: {node: '>= 18'} - - '@octokit/rest@20.1.0': - resolution: {integrity: sha512-STVO3itHQLrp80lvcYB2UIKoeil5Ctsgd2s1AM+du3HqZIR35ZH7WE9HLwUOLXH0myA0y3AGNPo8gZtcgIbw0g==} - engines: {node: '>= 18'} - - '@octokit/types@12.6.0': - resolution: {integrity: sha512-1rhSOfRa6H9w4YwK0yrf5faDaDTb+yLyBUKOCV4xtCDB5VmIPqd/v9yr9o6SAzOAlRxMiRiCic6JVM1/kunVkw==} - - '@octokit/types@13.4.1': - resolution: {integrity: sha512-Y73oOAzRBAUzR/iRAbGULzpNkX8vaxKCqEtg6K74Ff3w9f5apFnWtE/2nade7dMWWW3bS5Kkd6DJS4HF04xreg==} - - '@rollup/pluginutils@4.2.1': - resolution: {integrity: sha512-iKnFXr7NkdZAIHiIWE+BX5ULi/ucVFYWD6TbAV+rZctiRTY2PL6tsIKhoIOaoskiWAkgu+VsbXgUVDNLHf+InQ==} - engines: {node: '>= 8.0.0'} - - '@sindresorhus/merge-streams@2.3.0': - resolution: {integrity: sha512-LtoMMhxAlorcGhmFYI+LhPgbPZCkgP6ra1YL604EeF6U98pLlQ3iWIGMdWSC+vWmPBWBNgmDBAhnAobLROJmwg==} - engines: {node: '>=18'} - - '@tybys/wasm-util@0.8.3': - resolution: {integrity: sha512-Z96T/L6dUFFxgFJ+pQtkPpne9q7i6kIPYCFnQBHSgSPV9idTsKfIhCss0h5iM9irweZCatkrdeP8yi5uM1eX6Q==} - - '@types/node@20.12.7': - resolution: {integrity: sha512-wq0cICSkRLVaf3UGLMGItu/PtdY7oaXaI/RVU+xliKVOtRna3PRY57ZDfztpDL0n11vfymMUnXv8QwYCO7L1wg==} - - '@vercel/nft@0.26.4': - resolution: {integrity: sha512-j4jCOOXke2t8cHZCIxu1dzKLHLcFmYzC3yqAK6MfZznOL1QIJKd0xcFsXK3zcqzU7ScsE2zWkiMMNHGMHgp+FA==} - engines: {node: '>=16'} - hasBin: true - - abbrev@1.1.1: - resolution: {integrity: sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==} - - acorn-import-attributes@1.9.5: - resolution: {integrity: sha512-n02Vykv5uA3eHGM/Z2dQrcD56kL8TyDb2p1+0P83PClMnC/nc+anbQRhIOWnSq4Ke/KvDPrY3C9hDtC/A3eHnQ==} - peerDependencies: - acorn: ^8 - - acorn-walk@8.3.2: - resolution: {integrity: sha512-cjkyv4OtNCIeqhHrfS81QWXoCBPExR/J62oyEqepVw8WaQeSqpW2uhuLPh1m9eWhDuOo/jUXVTlifvesOWp/4A==} - engines: {node: '>=0.4.0'} - - acorn@8.11.3: - resolution: {integrity: sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==} - engines: {node: '>=0.4.0'} - hasBin: true - - agent-base@6.0.2: - resolution: {integrity: sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==} - engines: {node: '>= 6.0.0'} - - ansi-escapes@4.3.2: - resolution: {integrity: sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==} - engines: {node: '>=8'} - - ansi-regex@5.0.1: - resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} - engines: {node: '>=8'} - - ansi-regex@6.0.1: - resolution: {integrity: sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==} - engines: {node: '>=12'} - - ansi-styles@4.3.0: - resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} - engines: {node: '>=8'} - - ansi-styles@6.2.1: - resolution: {integrity: sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==} - engines: {node: '>=12'} - - aproba@2.0.0: - resolution: {integrity: sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==} - - are-we-there-yet@2.0.0: - resolution: {integrity: sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw==} - engines: {node: '>=10'} - - argparse@1.0.10: - resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==} - - argparse@2.0.1: - resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} - - array-find-index@1.0.2: - resolution: {integrity: sha512-M1HQyIXcBGtVywBt8WVdim+lrNaK7VHp99Qt5pSNziXznKHViIBbXWtfRTpEFpF/c4FdfxNAsCCwPp5phBYJtw==} - engines: {node: '>=0.10.0'} - - arrgv@1.0.2: - resolution: {integrity: sha512-a4eg4yhp7mmruZDQFqVMlxNRFGi/i1r87pt8SDHy0/I8PqSXoUTlWZRdAZo0VXgvEARcujbtTk8kiZRi1uDGRw==} - engines: {node: '>=8.0.0'} - - arrify@3.0.0: - resolution: {integrity: sha512-tLkvA81vQG/XqE2mjDkGQHoOINtMHtysSnemrmoGe6PydDPMRbVugqyk4A6V/WDWEfm3l+0d8anA9r8cv/5Jaw==} - engines: {node: '>=12'} - - async-sema@3.1.1: - resolution: {integrity: sha512-tLRNUXati5MFePdAk8dw7Qt7DpxPB60ofAgn8WRhW6a2rcimZnYBP9oxHiv0OHy+Wz7kPMG+t4LGdt31+4EmGg==} - - ava@6.1.2: - resolution: {integrity: sha512-WcpxJ8yZ7mk9ABTinD0IAjcemovSeVGjuuwZx0JS9johREWFeLTl8UP6wd7l6nmnrWqkKZdwaD71a/ocH4qPKw==} - engines: {node: ^18.18 || ^20.8 || ^21} - hasBin: true - peerDependencies: - '@ava/typescript': '*' - peerDependenciesMeta: - '@ava/typescript': - optional: true - - balanced-match@1.0.2: - resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} - - base64-js@1.5.1: - resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==} - - before-after-hook@2.2.3: - resolution: {integrity: sha512-NzUnlZexiaH/46WDhANlyR2bXRopNg4F/zuSA3OpZnllCUgRaOF2znDioDWrmbNVsuZk6l9pMquQB38cfBZwkQ==} - - bindings@1.5.0: - resolution: {integrity: sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==} - - bl@4.1.0: - resolution: {integrity: sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==} - - blueimp-md5@2.19.0: - resolution: {integrity: sha512-DRQrD6gJyy8FbiE4s+bDoXS9hiW3Vbx5uCdwvcCf3zLHL+Iv7LtGHLpr+GZV8rHG8tK766FGYBwRbu8pELTt+w==} - - brace-expansion@1.1.11: - resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} - - braces@3.0.2: - resolution: {integrity: sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==} - engines: {node: '>=8'} - - buffer@5.7.1: - resolution: {integrity: sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==} - - call-bind@1.0.7: - resolution: {integrity: sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==} - engines: {node: '>= 0.4'} - - callsites@4.1.0: - resolution: {integrity: sha512-aBMbD1Xxay75ViYezwT40aQONfr+pSXTHwNKvIXhXD6+LY3F1dLIcceoC5OZKBVHbXcysz1hL9D2w0JJIMXpUw==} - engines: {node: '>=12.20'} - - cbor@9.0.2: - resolution: {integrity: sha512-JPypkxsB10s9QOWwa6zwPzqE1Md3vqpPc+cai4sAecuCsRyAtAl/pMyhPlMbT/xtPnm2dznJZYRLui57qiRhaQ==} - engines: {node: '>=16'} - - chalk@4.1.2: - resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} - engines: {node: '>=10'} - - chalk@5.3.0: - resolution: {integrity: sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==} - engines: {node: ^12.17.0 || ^14.13 || >=16.0.0} - - chardet@0.7.0: - resolution: {integrity: sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==} - - chownr@2.0.0: - resolution: {integrity: sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==} - engines: {node: '>=10'} - - chunkd@2.0.1: - resolution: {integrity: sha512-7d58XsFmOq0j6el67Ug9mHf9ELUXsQXYJBkyxhH/k+6Ke0qXRnv0kbemx+Twc6fRJ07C49lcbdgm9FL1Ei/6SQ==} - - ci-info@4.0.0: - resolution: {integrity: sha512-TdHqgGf9odd8SXNuxtUBVx8Nv+qZOejE6qyqiy5NtbYYQOeFa6zmHkxlPzmaLxWWHsU6nJmB7AETdVPi+2NBUg==} - engines: {node: '>=8'} - - ci-parallel-vars@1.0.1: - resolution: {integrity: sha512-uvzpYrpmidaoxvIQHM+rKSrigjOe9feHYbw4uOI2gdfe1C3xIlxO+kVXq83WQWNniTf8bAxVpy+cQeFQsMERKg==} - - cli-cursor@3.1.0: - resolution: {integrity: sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==} - engines: {node: '>=8'} - - cli-spinners@2.9.2: - resolution: {integrity: sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==} - engines: {node: '>=6'} - - cli-truncate@4.0.0: - resolution: {integrity: sha512-nPdaFdQ0h/GEigbPClz11D0v/ZJEwxmeVZGeMo3Z5StPtUTkA9o1lD6QwoirYiSDzbcwn2XcjwmCp68W1IS4TA==} - engines: {node: '>=18'} - - cli-width@4.1.0: - resolution: {integrity: sha512-ouuZd4/dm2Sw5Gmqy6bGyNNNe1qt9RpmxveLSO7KcgsTnU7RXfsw+/bukWGo1abgBiMAic068rclZsO4IWmmxQ==} - engines: {node: '>= 12'} - - clipanion@3.2.1: - resolution: {integrity: sha512-dYFdjLb7y1ajfxQopN05mylEpK9ZX0sO1/RfMXdfmwjlIsPkbh4p7A682x++zFPLDCo1x3p82dtljHf5cW2LKA==} - peerDependencies: - typanion: '*' - - cliui@8.0.1: - resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==} - engines: {node: '>=12'} - - clone@1.0.4: - resolution: {integrity: sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==} - engines: {node: '>=0.8'} - - code-excerpt@4.0.0: - resolution: {integrity: sha512-xxodCmBen3iy2i0WtAK8FlFNrRzjUqjRsMfho58xT/wvZU1YTM3fCnRjcy1gJPMepaRlgm/0e6w8SpWHpn3/cA==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - color-convert@2.0.1: - resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} - engines: {node: '>=7.0.0'} - - color-name@1.1.4: - resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} - - color-support@1.1.3: - resolution: {integrity: sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==} - hasBin: true - - colorette@2.0.20: - resolution: {integrity: sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==} - - common-path-prefix@3.0.0: - resolution: {integrity: sha512-QE33hToZseCH3jS0qN96O/bSh3kaw/h+Tq7ngyY9eWDUnTlTNUyqfqvCXioLe5Na5jFsL78ra/wuBU4iuEgd4w==} - - concat-map@0.0.1: - resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} - - concordance@5.0.4: - resolution: {integrity: sha512-OAcsnTEYu1ARJqWVGwf4zh4JDfHZEaSNlNccFmt8YjB2l/n19/PF2viLINHc57vO4FKIAFl2FWASIGZZWZ2Kxw==} - engines: {node: '>=10.18.0 <11 || >=12.14.0 <13 || >=14'} - - console-control-strings@1.1.0: - resolution: {integrity: sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==} - - convert-to-spaces@2.0.1: - resolution: {integrity: sha512-rcQ1bsQO9799wq24uE5AM2tAILy4gXGIK/njFWcVQkGNZ96edlpY+A7bjwvzjYvLDyzmG1MmMLZhpcsb+klNMQ==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - currently-unhandled@0.4.1: - resolution: {integrity: sha512-/fITjgjGU50vjQ4FH6eUoYu+iUoUKIXws2hL15JJpIR+BbTxaXQsMuuyjtNh2WqsSBS5nsaZHFsFecyw5CCAng==} - engines: {node: '>=0.10.0'} - - date-time@3.1.0: - resolution: {integrity: sha512-uqCUKXE5q1PNBXjPqvwhwJf9SwMoAHBgWJ6DcrnS5o+W2JOiIILl0JEdVD8SGujrNS02GGxgwAg2PN2zONgtjg==} - engines: {node: '>=6'} - - debug@4.3.4: - resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==} - engines: {node: '>=6.0'} - peerDependencies: - supports-color: '*' - peerDependenciesMeta: - supports-color: - optional: true - - defaults@1.0.4: - resolution: {integrity: sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A==} - - define-data-property@1.1.4: - resolution: {integrity: sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==} - engines: {node: '>= 0.4'} - - delegates@1.0.0: - resolution: {integrity: sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==} - - deprecation@2.3.1: - resolution: {integrity: sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==} - - detect-libc@2.0.3: - resolution: {integrity: sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw==} - engines: {node: '>=8'} - - emittery@1.0.3: - resolution: {integrity: sha512-tJdCJitoy2lrC2ldJcqN4vkqJ00lT+tOWNT1hBJjO/3FDMJa5TTIiYGCKGkn/WfCyOzUMObeohbVTj00fhiLiA==} - engines: {node: '>=14.16'} - - emnapi@1.1.1: - resolution: {integrity: sha512-md0YDBLCX+378+zzibHvOLsj28YKFy8vl7BiSzVocCY7HujOkYt+N5LCOYqLeYi5C5/5NlnkNweVdUjrvKpGNg==} - peerDependencies: - node-addon-api: '>= 6.1.0' - peerDependenciesMeta: - node-addon-api: - optional: true - - emoji-regex@10.3.0: - resolution: {integrity: sha512-QpLs9D9v9kArv4lfDEgg1X/gN5XLnf/A6l9cs8SPZLRZR3ZkY9+kwIQTxm+fsSej5UMYGE8fdoaZVIBlqG0XTw==} - - emoji-regex@8.0.0: - resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} - - es-define-property@1.0.0: - resolution: {integrity: sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==} - engines: {node: '>= 0.4'} - - es-errors@1.3.0: - resolution: {integrity: sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==} - engines: {node: '>= 0.4'} - - escalade@3.1.2: - resolution: {integrity: sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==} - engines: {node: '>=6'} - - escape-string-regexp@2.0.0: - resolution: {integrity: sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==} - engines: {node: '>=8'} - - escape-string-regexp@5.0.0: - resolution: {integrity: sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==} - engines: {node: '>=12'} - - esprima@4.0.1: - resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==} - engines: {node: '>=4'} - hasBin: true - - estree-walker@2.0.2: - resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==} - - esutils@2.0.3: - resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} - engines: {node: '>=0.10.0'} - - external-editor@3.1.0: - resolution: {integrity: sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==} - engines: {node: '>=4'} - - fast-diff@1.3.0: - resolution: {integrity: sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==} - - fast-glob@3.3.2: - resolution: {integrity: sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==} - engines: {node: '>=8.6.0'} - - fastq@1.17.1: - resolution: {integrity: sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==} - - figures@6.1.0: - resolution: {integrity: sha512-d+l3qxjSesT4V7v2fh+QnmFnUWv9lSpjarhShNTgBOfA0ttejbQUAlHLitbjkoRiDulW0OPoQPYIGhIC8ohejg==} - engines: {node: '>=18'} - - file-uri-to-path@1.0.0: - resolution: {integrity: sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==} - - fill-range@7.0.1: - resolution: {integrity: sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==} - engines: {node: '>=8'} - - find-up-simple@1.0.0: - resolution: {integrity: sha512-q7Us7kcjj2VMePAa02hDAF6d+MzsdsAWEwYyOpwUtlerRBkOEPBCRZrAV4XfcSN8fHAgaD0hP7miwoay6DCprw==} - engines: {node: '>=18'} - - fs-minipass@2.1.0: - resolution: {integrity: sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==} - engines: {node: '>= 8'} - - fs.realpath@1.0.0: - resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} - - function-bind@1.1.2: - resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==} - - gauge@3.0.2: - resolution: {integrity: sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q==} - engines: {node: '>=10'} - - get-caller-file@2.0.5: - resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} - engines: {node: 6.* || 8.* || >= 10.*} - - get-east-asian-width@1.2.0: - resolution: {integrity: sha512-2nk+7SIVb14QrgXFHcm84tD4bKQz0RxPuMT8Ag5KPOq7J5fEmAg0UbXdTOSHqNuHSU28k55qnceesxXRZGzKWA==} - engines: {node: '>=18'} - - get-intrinsic@1.2.4: - resolution: {integrity: sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==} - engines: {node: '>= 0.4'} - - glob-parent@5.1.2: - resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} - engines: {node: '>= 6'} - - glob@7.2.3: - resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} - - globby@14.0.1: - resolution: {integrity: sha512-jOMLD2Z7MAhyG8aJpNOpmziMOP4rPLcc95oQPKXBazW82z+CEgPFBQvEpRUa1KeIMUJo4Wsm+q6uzO/Q/4BksQ==} - engines: {node: '>=18'} - - gopd@1.0.1: - resolution: {integrity: sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==} - - graceful-fs@4.2.11: - resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} - - has-flag@4.0.0: - resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} - engines: {node: '>=8'} - - has-property-descriptors@1.0.2: - resolution: {integrity: sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==} - - has-proto@1.0.3: - resolution: {integrity: sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==} - engines: {node: '>= 0.4'} - - has-symbols@1.0.3: - resolution: {integrity: sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==} - engines: {node: '>= 0.4'} - - has-unicode@2.0.1: - resolution: {integrity: sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==} - - hasown@2.0.2: - resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==} - engines: {node: '>= 0.4'} - - https-proxy-agent@5.0.1: - resolution: {integrity: sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==} - engines: {node: '>= 6'} - - iconv-lite@0.4.24: - resolution: {integrity: sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==} - engines: {node: '>=0.10.0'} - - ieee754@1.2.1: - resolution: {integrity: sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==} - - ignore-by-default@2.1.0: - resolution: {integrity: sha512-yiWd4GVmJp0Q6ghmM2B/V3oZGRmjrKLXvHR3TE1nfoXsmoggllfZUQe74EN0fJdPFZu2NIvNdrMMLm3OsV7Ohw==} - engines: {node: '>=10 <11 || >=12 <13 || >=14'} - - ignore@5.3.1: - resolution: {integrity: sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==} - engines: {node: '>= 4'} - - imurmurhash@0.1.4: - resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} - engines: {node: '>=0.8.19'} - - indent-string@5.0.0: - resolution: {integrity: sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==} - engines: {node: '>=12'} - - inflight@1.0.6: - resolution: {integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==} - - inherits@2.0.4: - resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} - - inquirer@9.2.19: - resolution: {integrity: sha512-WpxOT71HGsFya6/mj5PUue0sWwbpbiPfAR+332zLj/siB0QA1PZM8v3GepegFV1Op189UxHUCF6y8AySdtOMVA==} - engines: {node: '>=18'} - - irregular-plurals@3.5.0: - resolution: {integrity: sha512-1ANGLZ+Nkv1ptFb2pa8oG8Lem4krflKuX/gINiHJHjJUKaJHk/SXk5x6K3J+39/p0h1RQ2saROclJJ+QLvETCQ==} - engines: {node: '>=8'} - - is-extglob@2.1.1: - resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} - engines: {node: '>=0.10.0'} - - is-fullwidth-code-point@3.0.0: - resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} - engines: {node: '>=8'} - - is-fullwidth-code-point@4.0.0: - resolution: {integrity: sha512-O4L094N2/dZ7xqVdrXhh9r1KODPJpFms8B5sGdJLPy664AgvXsreZUyCQQNItZRDlYug4xStLjNp/sz3HvBowQ==} - engines: {node: '>=12'} - - is-glob@4.0.3: - resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} - engines: {node: '>=0.10.0'} - - is-interactive@1.0.0: - resolution: {integrity: sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w==} - engines: {node: '>=8'} - - is-number@7.0.0: - resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} - engines: {node: '>=0.12.0'} - - is-plain-object@5.0.0: - resolution: {integrity: sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==} - engines: {node: '>=0.10.0'} - - is-promise@4.0.0: - resolution: {integrity: sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==} - - is-unicode-supported@0.1.0: - resolution: {integrity: sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==} - engines: {node: '>=10'} - - is-unicode-supported@2.0.0: - resolution: {integrity: sha512-FRdAyx5lusK1iHG0TWpVtk9+1i+GjrzRffhDg4ovQ7mcidMQ6mj+MhKPmvh7Xwyv5gIS06ns49CA7Sqg7lC22Q==} - engines: {node: '>=18'} - - js-string-escape@1.0.1: - resolution: {integrity: sha512-Smw4xcfIQ5LVjAOuJCvN/zIodzA/BBSsluuoSykP+lUvScIi4U6RJLfwHet5cxFnCswUjISV8oAXaqaJDY3chg==} - engines: {node: '>= 0.8'} - - js-yaml@3.14.1: - resolution: {integrity: sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==} - hasBin: true - - js-yaml@4.1.0: - resolution: {integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==} - hasBin: true - - load-json-file@7.0.1: - resolution: {integrity: sha512-Gnxj3ev3mB5TkVBGad0JM6dmLiQL+o0t23JPBZ9sd+yvSLk05mFoqKBw5N8gbbkU4TNXyqCgIrl/VM17OgUIgQ==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - lodash-es@4.17.21: - resolution: {integrity: sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==} - - lodash@4.17.21: - resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} - - log-symbols@4.1.0: - resolution: {integrity: sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==} - engines: {node: '>=10'} - - lru-cache@6.0.0: - resolution: {integrity: sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==} - engines: {node: '>=10'} - - make-dir@3.1.0: - resolution: {integrity: sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==} - engines: {node: '>=8'} - - matcher@5.0.0: - resolution: {integrity: sha512-s2EMBOWtXFc8dgqvoAzKJXxNHibcdJMV0gwqKUaw9E2JBJuGUK7DrNKrA6g/i+v72TT16+6sVm5mS3thaMLQUw==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - md5-hex@3.0.1: - resolution: {integrity: sha512-BUiRtTtV39LIJwinWBjqVsU9xhdnz7/i889V859IBFpuqGAj6LuOvHv5XLbgZ2R7ptJoJaEcxkv88/h25T7Ciw==} - engines: {node: '>=8'} - - memoize@10.0.0: - resolution: {integrity: sha512-H6cBLgsi6vMWOcCpvVCdFFnl3kerEXbrYh9q+lY6VXvQSmM6CkmV08VOwT+WE2tzIEqRPFfAq3fm4v/UIW6mSA==} - engines: {node: '>=18'} - - merge2@1.4.1: - resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} - engines: {node: '>= 8'} - - micromatch@4.0.5: - resolution: {integrity: sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==} - engines: {node: '>=8.6'} - - mimic-fn@2.1.0: - resolution: {integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==} - engines: {node: '>=6'} - - mimic-function@5.0.1: - resolution: {integrity: sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==} - engines: {node: '>=18'} - - minimatch@3.1.2: - resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} - - minipass@3.3.6: - resolution: {integrity: sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==} - engines: {node: '>=8'} - - minipass@5.0.0: - resolution: {integrity: sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==} - engines: {node: '>=8'} - - minizlib@2.1.2: - resolution: {integrity: sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==} - engines: {node: '>= 8'} - - mkdirp@1.0.4: - resolution: {integrity: sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==} - engines: {node: '>=10'} - hasBin: true - - ms@2.1.2: - resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} - - ms@2.1.3: - resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} - - mute-stream@1.0.0: - resolution: {integrity: sha512-avsJQhyd+680gKXyG/sQc0nXaC6rBkPOfyHYcFb9+hdkqQkR9bdnkJ0AMZhke0oesPqIO+mFFJ+IdBc7mst4IA==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - - node-fetch@2.7.0: - resolution: {integrity: sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==} - engines: {node: 4.x || >=6.0.0} - peerDependencies: - encoding: ^0.1.0 - peerDependenciesMeta: - encoding: - optional: true - - node-gyp-build@4.8.0: - resolution: {integrity: sha512-u6fs2AEUljNho3EYTJNBfImO5QTo/J/1Etd+NVdCj7qWKUSN/bSLkZwhDv7I+w/MSC6qJ4cknepkAYykDdK8og==} - hasBin: true - - nofilter@3.1.0: - resolution: {integrity: sha512-l2NNj07e9afPnhAhvgVrCD/oy2Ai1yfLpuo3EpiO1jFTsB4sFz6oIfAfSZyQzVpkZQ9xS8ZS5g1jCBgq4Hwo0g==} - engines: {node: '>=12.19'} - - nopt@5.0.0: - resolution: {integrity: sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==} - engines: {node: '>=6'} - hasBin: true - - npmlog@5.0.1: - resolution: {integrity: sha512-AqZtDUWOMKs1G/8lwylVjrdYgqA4d9nu8hc+0gzRxlDb1I10+FHBGMXs6aiQHFdCUUlqH99MUMuLfzWDNDtfxw==} - - object-assign@4.1.1: - resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} - engines: {node: '>=0.10.0'} - - once@1.4.0: - resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} - - onetime@5.1.2: - resolution: {integrity: sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==} - engines: {node: '>=6'} - - ora@5.4.1: - resolution: {integrity: sha512-5b6Y85tPxZZ7QytO+BQzysW31HJku27cRIlkbAXaNx+BdcVi+LlRFmVXzeF6a7JCwJpyw5c4b+YSVImQIrBpuQ==} - engines: {node: '>=10'} - - os-tmpdir@1.0.2: - resolution: {integrity: sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==} - engines: {node: '>=0.10.0'} - - p-map@7.0.2: - resolution: {integrity: sha512-z4cYYMMdKHzw4O5UkWJImbZynVIo0lSGTXc7bzB1e/rrDqkgGUNysK/o4bTr+0+xKvvLoTyGqYC4Fgljy9qe1Q==} - engines: {node: '>=18'} - - package-config@5.0.0: - resolution: {integrity: sha512-GYTTew2slBcYdvRHqjhwaaydVMvn/qrGC323+nKclYioNSLTDUM/lGgtGTgyHVtYcozb+XkE8CNhwcraOmZ9Mg==} - engines: {node: '>=18'} - - parse-ms@4.0.0: - resolution: {integrity: sha512-TXfryirbmq34y8QBwgqCVLi+8oA3oWx2eAnSn62ITyEhEYaWRlVZ2DvMM9eZbMs/RfxPu/PK/aBLyGj4IrqMHw==} - engines: {node: '>=18'} - - path-is-absolute@1.0.1: - resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==} - engines: {node: '>=0.10.0'} - - path-type@5.0.0: - resolution: {integrity: sha512-5HviZNaZcfqP95rwpv+1HDgUamezbqdSYTyzjTvwtJSnIH+3vnbmWsItli8OFEndS984VT55M3jduxZbX351gg==} - engines: {node: '>=12'} - - picomatch@2.3.1: - resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} - engines: {node: '>=8.6'} - - picomatch@3.0.1: - resolution: {integrity: sha512-I3EurrIQMlRc9IaAZnqRR044Phh2DXY+55o7uJ0V+hYZAcQYSuFWsc9q5PvyDHUSCe1Qxn/iBz+78s86zWnGag==} - engines: {node: '>=10'} - - plur@5.1.0: - resolution: {integrity: sha512-VP/72JeXqak2KiOzjgKtQen5y3IZHn+9GOuLDafPv0eXa47xq0At93XahYBs26MsifCQ4enGKwbjBTKgb9QJXg==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - pretty-ms@9.0.0: - resolution: {integrity: sha512-E9e9HJ9R9NasGOgPaPE8VMeiPKAyWR5jcFpNnwIejslIhWqdqOrb2wShBsncMPUb+BcCd2OPYfh7p2W6oemTng==} - engines: {node: '>=18'} - - queue-microtask@1.2.3: - resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} - - readable-stream@3.6.2: - resolution: {integrity: sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==} - engines: {node: '>= 6'} - - require-directory@2.1.1: - resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} - engines: {node: '>=0.10.0'} - - resolve-cwd@3.0.0: - resolution: {integrity: sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==} - engines: {node: '>=8'} - - resolve-from@5.0.0: - resolution: {integrity: sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==} - engines: {node: '>=8'} - - restore-cursor@3.1.0: - resolution: {integrity: sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==} - engines: {node: '>=8'} - - reusify@1.0.4: - resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==} - engines: {iojs: '>=1.0.0', node: '>=0.10.0'} - - rimraf@3.0.2: - resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==} - hasBin: true - - run-async@3.0.0: - resolution: {integrity: sha512-540WwVDOMxA6dN6We19EcT9sc3hkXPw5mzRNGM3FkdN/vtE9NFvj5lFAPNwUDmJjXidm3v7TC1cTE7t17Ulm1Q==} - engines: {node: '>=0.12.0'} - - run-parallel@1.2.0: - resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} - - rxjs@7.8.1: - resolution: {integrity: sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==} - - safe-buffer@5.2.1: - resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} - - safer-buffer@2.1.2: - resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} - - semver@6.3.1: - resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} - hasBin: true - - semver@7.6.0: - resolution: {integrity: sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==} - engines: {node: '>=10'} - hasBin: true - - serialize-error@7.0.1: - resolution: {integrity: sha512-8I8TjW5KMOKsZQTvoxjuSIa7foAwPWGOts+6o7sgjz41/qMD9VQHEDxi6PBvK2l0MXUmqZyNpUK+T2tQaaElvw==} - engines: {node: '>=10'} - - set-blocking@2.0.0: - resolution: {integrity: sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==} - - set-function-length@1.2.2: - resolution: {integrity: sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==} - engines: {node: '>= 0.4'} - - signal-exit@3.0.7: - resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} - - signal-exit@4.1.0: - resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} - engines: {node: '>=14'} - - slash@5.1.0: - resolution: {integrity: sha512-ZA6oR3T/pEyuqwMgAKT0/hAv8oAXckzbkmR0UkUosQ+Mc4RxGoJkRmwHgHufaenlyAgE1Mxgpdcrf75y6XcnDg==} - engines: {node: '>=14.16'} - - slice-ansi@5.0.0: - resolution: {integrity: sha512-FC+lgizVPfie0kkhqUScwRu1O/lF6NOgJmlCgK+/LYxDCTk8sGelYaHDhFcDN+Sn3Cv+3VSa4Byeo+IMCzpMgQ==} - engines: {node: '>=12'} - - sprintf-js@1.0.3: - resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==} - - stack-utils@2.0.6: - resolution: {integrity: sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==} - engines: {node: '>=10'} - - string-width@4.2.3: - resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} - engines: {node: '>=8'} - - string-width@7.1.0: - resolution: {integrity: sha512-SEIJCWiX7Kg4c129n48aDRwLbFb2LJmXXFrWBG4NGaRtMQ3myKPKbwrD1BKqQn74oCoNMBVrfDEr5M9YxCsrkw==} - engines: {node: '>=18'} - - string_decoder@1.3.0: - resolution: {integrity: sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==} - - strip-ansi@6.0.1: - resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} - engines: {node: '>=8'} - - strip-ansi@7.1.0: - resolution: {integrity: sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==} - engines: {node: '>=12'} - - supertap@3.0.1: - resolution: {integrity: sha512-u1ZpIBCawJnO+0QePsEiOknOfCRq0yERxiAchT0i4li0WHNUJbf0evXXSXOcCAR4M8iMDoajXYmstm/qO81Isw==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - supports-color@7.2.0: - resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} - engines: {node: '>=8'} - - tar@6.2.1: - resolution: {integrity: sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==} - engines: {node: '>=10'} - - temp-dir@3.0.0: - resolution: {integrity: sha512-nHc6S/bwIilKHNRgK/3jlhDoIHcp45YgyiwcAk46Tr0LfEqGBVpmiAyuiuxeVE44m3mXnEeVhaipLOEWmH+Njw==} - engines: {node: '>=14.16'} - - time-zone@1.0.0: - resolution: {integrity: sha512-TIsDdtKo6+XrPtiTm1ssmMngN1sAhyKnTO2kunQWqNPWIVvCm15Wmw4SWInwTVgJ5u/Tr04+8Ei9TNcw4x4ONA==} - engines: {node: '>=4'} - - tmp@0.0.33: - resolution: {integrity: sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==} - engines: {node: '>=0.6.0'} - - to-regex-range@5.0.1: - resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} - engines: {node: '>=8.0'} - - toml@3.0.0: - resolution: {integrity: sha512-y/mWCZinnvxjTKYhJ+pYxwD0mRLVvOtdS2Awbgxln6iEnt4rk0yBxeSBHkGJcPucRiG0e55mwWp+g/05rsrd6w==} - - tr46@0.0.3: - resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==} - - tslib@2.6.2: - resolution: {integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==} - - typanion@3.14.0: - resolution: {integrity: sha512-ZW/lVMRabETuYCd9O9ZvMhAh8GslSqaUjxmK/JLPCh6l73CvLBiuXswj/+7LdnWOgYsQ130FqLzFz5aGT4I3Ug==} - - type-fest@0.13.1: - resolution: {integrity: sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==} - engines: {node: '>=10'} - - type-fest@0.21.3: - resolution: {integrity: sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==} - engines: {node: '>=10'} - - typescript@5.4.5: - resolution: {integrity: sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==} - engines: {node: '>=14.17'} - hasBin: true - - undici-types@5.26.5: - resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==} - - unicorn-magic@0.1.0: - resolution: {integrity: sha512-lRfVq8fE8gz6QMBuDM6a+LO3IAzTi05H6gCVaUpir2E1Rwpo4ZUog45KpNXKC/Mn3Yb9UDuHumeFTo9iV/D9FQ==} - engines: {node: '>=18'} - - universal-user-agent@6.0.1: - resolution: {integrity: sha512-yCzhz6FN2wU1NiiQRogkTQszlQSlpWaw8SvVegAc+bDxbzHgh1vX8uIe8OYyMH6DwH+sdTJsgMl36+mSMdRJIQ==} - - util-deprecate@1.0.2: - resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} - - wasm-sjlj@1.0.5: - resolution: {integrity: sha512-Z/MHJeOkAvJJVWnGX3/YZGYldGaawZbYHX4ldYG9kLhcdB8H31F5x66M7Zc4BP/7pg0aLsusQj1629m2B3Rilg==} - - wcwidth@1.0.1: - resolution: {integrity: sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==} - - webidl-conversions@3.0.1: - resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==} - - well-known-symbols@2.0.0: - resolution: {integrity: sha512-ZMjC3ho+KXo0BfJb7JgtQ5IBuvnShdlACNkKkdsqBmYw3bPAaJfPeYUo6tLUaT5tG/Gkh7xkpBhKRQ9e7pyg9Q==} - engines: {node: '>=6'} - - whatwg-url@5.0.0: - resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==} - - wide-align@1.1.5: - resolution: {integrity: sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==} - - wrap-ansi@6.2.0: - resolution: {integrity: sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==} - engines: {node: '>=8'} - - wrap-ansi@7.0.0: - resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==} - engines: {node: '>=10'} - - wrappy@1.0.2: - resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} - - write-file-atomic@5.0.1: - resolution: {integrity: sha512-+QU2zd6OTD8XWIJCbffaiQeH9U73qIqafo1x6V1snCWYGJf6cVE0cDR4D8xRzcEnfI21IFrUPzPGtcPf8AC+Rw==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - - y18n@5.0.8: - resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==} - engines: {node: '>=10'} - - yallist@4.0.0: - resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==} - - yargs-parser@21.1.1: - resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} - engines: {node: '>=12'} - - yargs@17.7.2: - resolution: {integrity: sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==} - engines: {node: '>=12'} - -snapshots: - - '@emnapi/core@1.1.1': - dependencies: - tslib: 2.6.2 - - '@emnapi/runtime@1.1.1': - dependencies: - tslib: 2.6.2 - - '@inquirer/figures@1.0.1': {} - - '@ljharb/through@2.3.13': - dependencies: - call-bind: 1.0.7 - - '@mapbox/node-pre-gyp@1.0.11': - dependencies: - detect-libc: 2.0.3 - https-proxy-agent: 5.0.1 - make-dir: 3.1.0 - node-fetch: 2.7.0 - nopt: 5.0.0 - npmlog: 5.0.1 - rimraf: 3.0.2 - semver: 7.6.0 - tar: 6.2.1 - transitivePeerDependencies: - - encoding - - supports-color - - '@napi-rs/cli@3.0.0-alpha.51(@emnapi/runtime@1.1.1)(emnapi@1.1.1)': - dependencies: - '@napi-rs/cross-toolchain': 0.0.14 - '@napi-rs/wasm-tools': 0.0.1 - '@octokit/rest': 20.1.0 - clipanion: 3.2.1(typanion@3.14.0) - colorette: 2.0.20 - debug: 4.3.4 - inquirer: 9.2.19 - js-yaml: 4.1.0 - lodash-es: 4.17.21 - semver: 7.6.0 - toml: 3.0.0 - typanion: 3.14.0 - wasm-sjlj: 1.0.5 - optionalDependencies: - '@emnapi/runtime': 1.1.1 - emnapi: 1.1.1 - transitivePeerDependencies: - - '@napi-rs/cross-toolchain-arm64-target-aarch64' - - '@napi-rs/cross-toolchain-arm64-target-armv7' - - '@napi-rs/cross-toolchain-arm64-target-x86_64' - - '@napi-rs/cross-toolchain-x64-target-aarch64' - - '@napi-rs/cross-toolchain-x64-target-armv7' - - '@napi-rs/cross-toolchain-x64-target-x86_64' - - supports-color - - '@napi-rs/cross-toolchain@0.0.14': - dependencies: - '@napi-rs/lzma': 1.2.1 - '@napi-rs/tar': 0.1.0 - debug: 4.3.4 - transitivePeerDependencies: - - supports-color - - '@napi-rs/lzma-android-arm-eabi@1.2.1': - optional: true - - '@napi-rs/lzma-android-arm64@1.2.1': - optional: true - - '@napi-rs/lzma-darwin-arm64@1.2.1': - optional: true - - '@napi-rs/lzma-darwin-x64@1.2.1': - optional: true - - '@napi-rs/lzma-freebsd-x64@1.2.1': - optional: true - - '@napi-rs/lzma-linux-arm-gnueabihf@1.2.1': - optional: true - - '@napi-rs/lzma-linux-arm64-gnu@1.2.1': - optional: true - - '@napi-rs/lzma-linux-arm64-musl@1.2.1': - optional: true - - '@napi-rs/lzma-linux-x64-gnu@1.2.1': - optional: true - - '@napi-rs/lzma-linux-x64-musl@1.2.1': - optional: true - - '@napi-rs/lzma-win32-arm64-msvc@1.2.1': - optional: true - - '@napi-rs/lzma-win32-ia32-msvc@1.2.1': - optional: true - - '@napi-rs/lzma-win32-x64-msvc@1.2.1': - optional: true - - '@napi-rs/lzma@1.2.1': - optionalDependencies: - '@napi-rs/lzma-android-arm-eabi': 1.2.1 - '@napi-rs/lzma-android-arm64': 1.2.1 - '@napi-rs/lzma-darwin-arm64': 1.2.1 - '@napi-rs/lzma-darwin-x64': 1.2.1 - '@napi-rs/lzma-freebsd-x64': 1.2.1 - '@napi-rs/lzma-linux-arm-gnueabihf': 1.2.1 - '@napi-rs/lzma-linux-arm64-gnu': 1.2.1 - '@napi-rs/lzma-linux-arm64-musl': 1.2.1 - '@napi-rs/lzma-linux-x64-gnu': 1.2.1 - '@napi-rs/lzma-linux-x64-musl': 1.2.1 - '@napi-rs/lzma-win32-arm64-msvc': 1.2.1 - '@napi-rs/lzma-win32-ia32-msvc': 1.2.1 - '@napi-rs/lzma-win32-x64-msvc': 1.2.1 - - '@napi-rs/tar-android-arm-eabi@0.1.0': - optional: true - - '@napi-rs/tar-android-arm64@0.1.0': - optional: true - - '@napi-rs/tar-darwin-arm64@0.1.0': - optional: true - - '@napi-rs/tar-darwin-x64@0.1.0': - optional: true - - '@napi-rs/tar-freebsd-x64@0.1.0': - optional: true - - '@napi-rs/tar-linux-arm-gnueabihf@0.1.0': - optional: true - - '@napi-rs/tar-linux-arm64-gnu@0.1.0': - optional: true - - '@napi-rs/tar-linux-arm64-musl@0.1.0': - optional: true - - '@napi-rs/tar-linux-x64-gnu@0.1.0': - optional: true - - '@napi-rs/tar-linux-x64-musl@0.1.0': - optional: true - - '@napi-rs/tar-win32-arm64-msvc@0.1.0': - optional: true - - '@napi-rs/tar-win32-ia32-msvc@0.1.0': - optional: true - - '@napi-rs/tar-win32-x64-msvc@0.1.0': - optional: true - - '@napi-rs/tar@0.1.0': - optionalDependencies: - '@napi-rs/tar-android-arm-eabi': 0.1.0 - '@napi-rs/tar-android-arm64': 0.1.0 - '@napi-rs/tar-darwin-arm64': 0.1.0 - '@napi-rs/tar-darwin-x64': 0.1.0 - '@napi-rs/tar-freebsd-x64': 0.1.0 - '@napi-rs/tar-linux-arm-gnueabihf': 0.1.0 - '@napi-rs/tar-linux-arm64-gnu': 0.1.0 - '@napi-rs/tar-linux-arm64-musl': 0.1.0 - '@napi-rs/tar-linux-x64-gnu': 0.1.0 - '@napi-rs/tar-linux-x64-musl': 0.1.0 - '@napi-rs/tar-win32-arm64-msvc': 0.1.0 - '@napi-rs/tar-win32-ia32-msvc': 0.1.0 - '@napi-rs/tar-win32-x64-msvc': 0.1.0 - - '@napi-rs/wasm-runtime@0.1.2': - dependencies: - '@emnapi/core': 1.1.1 - '@emnapi/runtime': 1.1.1 - '@tybys/wasm-util': 0.8.3 - optional: true - - '@napi-rs/wasm-runtime@0.2.0': - dependencies: - '@emnapi/core': 1.1.1 - '@emnapi/runtime': 1.1.1 - '@tybys/wasm-util': 0.8.3 - - '@napi-rs/wasm-tools-android-arm-eabi@0.0.1': - optional: true - - '@napi-rs/wasm-tools-android-arm64@0.0.1': - optional: true - - '@napi-rs/wasm-tools-darwin-arm64@0.0.1': - optional: true - - '@napi-rs/wasm-tools-darwin-x64@0.0.1': - optional: true - - '@napi-rs/wasm-tools-freebsd-x64@0.0.1': - optional: true - - '@napi-rs/wasm-tools-linux-arm64-gnu@0.0.1': - optional: true - - '@napi-rs/wasm-tools-linux-arm64-musl@0.0.1': - optional: true - - '@napi-rs/wasm-tools-linux-x64-gnu@0.0.1': - optional: true - - '@napi-rs/wasm-tools-linux-x64-musl@0.0.1': - optional: true - - '@napi-rs/wasm-tools-wasm32-wasi@0.0.1': - dependencies: - '@napi-rs/wasm-runtime': 0.1.2 - optional: true - - '@napi-rs/wasm-tools-win32-arm64-msvc@0.0.1': - optional: true - - '@napi-rs/wasm-tools-win32-ia32-msvc@0.0.1': - optional: true - - '@napi-rs/wasm-tools-win32-x64-msvc@0.0.1': - optional: true - - '@napi-rs/wasm-tools@0.0.1': - optionalDependencies: - '@napi-rs/wasm-tools-android-arm-eabi': 0.0.1 - '@napi-rs/wasm-tools-android-arm64': 0.0.1 - '@napi-rs/wasm-tools-darwin-arm64': 0.0.1 - '@napi-rs/wasm-tools-darwin-x64': 0.0.1 - '@napi-rs/wasm-tools-freebsd-x64': 0.0.1 - '@napi-rs/wasm-tools-linux-arm64-gnu': 0.0.1 - '@napi-rs/wasm-tools-linux-arm64-musl': 0.0.1 - '@napi-rs/wasm-tools-linux-x64-gnu': 0.0.1 - '@napi-rs/wasm-tools-linux-x64-musl': 0.0.1 - '@napi-rs/wasm-tools-wasm32-wasi': 0.0.1 - '@napi-rs/wasm-tools-win32-arm64-msvc': 0.0.1 - '@napi-rs/wasm-tools-win32-ia32-msvc': 0.0.1 - '@napi-rs/wasm-tools-win32-x64-msvc': 0.0.1 - - '@nodelib/fs.scandir@2.1.5': - dependencies: - '@nodelib/fs.stat': 2.0.5 - run-parallel: 1.2.0 - - '@nodelib/fs.stat@2.0.5': {} - - '@nodelib/fs.walk@1.2.8': - dependencies: - '@nodelib/fs.scandir': 2.1.5 - fastq: 1.17.1 - - '@octokit/auth-token@4.0.0': {} - - '@octokit/core@5.2.0': - dependencies: - '@octokit/auth-token': 4.0.0 - '@octokit/graphql': 7.1.0 - '@octokit/request': 8.4.0 - '@octokit/request-error': 5.1.0 - '@octokit/types': 13.4.1 - before-after-hook: 2.2.3 - universal-user-agent: 6.0.1 - - '@octokit/endpoint@9.0.5': - dependencies: - '@octokit/types': 13.4.1 - universal-user-agent: 6.0.1 - - '@octokit/graphql@7.1.0': - dependencies: - '@octokit/request': 8.4.0 - '@octokit/types': 13.4.1 - universal-user-agent: 6.0.1 - - '@octokit/openapi-types@20.0.0': {} - - '@octokit/openapi-types@22.1.0': {} - - '@octokit/plugin-paginate-rest@9.2.1(@octokit/core@5.2.0)': - dependencies: - '@octokit/core': 5.2.0 - '@octokit/types': 12.6.0 - - '@octokit/plugin-request-log@4.0.1(@octokit/core@5.2.0)': - dependencies: - '@octokit/core': 5.2.0 - - '@octokit/plugin-rest-endpoint-methods@10.4.1(@octokit/core@5.2.0)': - dependencies: - '@octokit/core': 5.2.0 - '@octokit/types': 12.6.0 - - '@octokit/request-error@5.1.0': - dependencies: - '@octokit/types': 13.4.1 - deprecation: 2.3.1 - once: 1.4.0 - - '@octokit/request@8.4.0': - dependencies: - '@octokit/endpoint': 9.0.5 - '@octokit/request-error': 5.1.0 - '@octokit/types': 13.4.1 - universal-user-agent: 6.0.1 - - '@octokit/rest@20.1.0': - dependencies: - '@octokit/core': 5.2.0 - '@octokit/plugin-paginate-rest': 9.2.1(@octokit/core@5.2.0) - '@octokit/plugin-request-log': 4.0.1(@octokit/core@5.2.0) - '@octokit/plugin-rest-endpoint-methods': 10.4.1(@octokit/core@5.2.0) - - '@octokit/types@12.6.0': - dependencies: - '@octokit/openapi-types': 20.0.0 - - '@octokit/types@13.4.1': - dependencies: - '@octokit/openapi-types': 22.1.0 - - '@rollup/pluginutils@4.2.1': - dependencies: - estree-walker: 2.0.2 - picomatch: 2.3.1 - - '@sindresorhus/merge-streams@2.3.0': {} - - '@tybys/wasm-util@0.8.3': - dependencies: - tslib: 2.6.2 - - '@types/node@20.12.7': - dependencies: - undici-types: 5.26.5 - - '@vercel/nft@0.26.4': - dependencies: - '@mapbox/node-pre-gyp': 1.0.11 - '@rollup/pluginutils': 4.2.1 - acorn: 8.11.3 - acorn-import-attributes: 1.9.5(acorn@8.11.3) - async-sema: 3.1.1 - bindings: 1.5.0 - estree-walker: 2.0.2 - glob: 7.2.3 - graceful-fs: 4.2.11 - micromatch: 4.0.5 - node-gyp-build: 4.8.0 - resolve-from: 5.0.0 - transitivePeerDependencies: - - encoding - - supports-color - - abbrev@1.1.1: {} - - acorn-import-attributes@1.9.5(acorn@8.11.3): - dependencies: - acorn: 8.11.3 - - acorn-walk@8.3.2: {} - - acorn@8.11.3: {} - - agent-base@6.0.2: - dependencies: - debug: 4.3.4 - transitivePeerDependencies: - - supports-color - - ansi-escapes@4.3.2: - dependencies: - type-fest: 0.21.3 - - ansi-regex@5.0.1: {} - - ansi-regex@6.0.1: {} - - ansi-styles@4.3.0: - dependencies: - color-convert: 2.0.1 - - ansi-styles@6.2.1: {} - - aproba@2.0.0: {} - - are-we-there-yet@2.0.0: - dependencies: - delegates: 1.0.0 - readable-stream: 3.6.2 - - argparse@1.0.10: - dependencies: - sprintf-js: 1.0.3 - - argparse@2.0.1: {} - - array-find-index@1.0.2: {} - - arrgv@1.0.2: {} - - arrify@3.0.0: {} - - async-sema@3.1.1: {} - - ava@6.1.2: - dependencies: - '@vercel/nft': 0.26.4 - acorn: 8.11.3 - acorn-walk: 8.3.2 - ansi-styles: 6.2.1 - arrgv: 1.0.2 - arrify: 3.0.0 - callsites: 4.1.0 - cbor: 9.0.2 - chalk: 5.3.0 - chunkd: 2.0.1 - ci-info: 4.0.0 - ci-parallel-vars: 1.0.1 - cli-truncate: 4.0.0 - code-excerpt: 4.0.0 - common-path-prefix: 3.0.0 - concordance: 5.0.4 - currently-unhandled: 0.4.1 - debug: 4.3.4 - emittery: 1.0.3 - figures: 6.1.0 - globby: 14.0.1 - ignore-by-default: 2.1.0 - indent-string: 5.0.0 - is-plain-object: 5.0.0 - is-promise: 4.0.0 - matcher: 5.0.0 - memoize: 10.0.0 - ms: 2.1.3 - p-map: 7.0.2 - package-config: 5.0.0 - picomatch: 3.0.1 - plur: 5.1.0 - pretty-ms: 9.0.0 - resolve-cwd: 3.0.0 - stack-utils: 2.0.6 - strip-ansi: 7.1.0 - supertap: 3.0.1 - temp-dir: 3.0.0 - write-file-atomic: 5.0.1 - yargs: 17.7.2 - transitivePeerDependencies: - - encoding - - supports-color - - balanced-match@1.0.2: {} - - base64-js@1.5.1: {} - - before-after-hook@2.2.3: {} - - bindings@1.5.0: - dependencies: - file-uri-to-path: 1.0.0 - - bl@4.1.0: - dependencies: - buffer: 5.7.1 - inherits: 2.0.4 - readable-stream: 3.6.2 - - blueimp-md5@2.19.0: {} - - brace-expansion@1.1.11: - dependencies: - balanced-match: 1.0.2 - concat-map: 0.0.1 - - braces@3.0.2: - dependencies: - fill-range: 7.0.1 - - buffer@5.7.1: - dependencies: - base64-js: 1.5.1 - ieee754: 1.2.1 - - call-bind@1.0.7: - dependencies: - es-define-property: 1.0.0 - es-errors: 1.3.0 - function-bind: 1.1.2 - get-intrinsic: 1.2.4 - set-function-length: 1.2.2 - - callsites@4.1.0: {} - - cbor@9.0.2: - dependencies: - nofilter: 3.1.0 - - chalk@4.1.2: - dependencies: - ansi-styles: 4.3.0 - supports-color: 7.2.0 - - chalk@5.3.0: {} - - chardet@0.7.0: {} - - chownr@2.0.0: {} - - chunkd@2.0.1: {} - - ci-info@4.0.0: {} - - ci-parallel-vars@1.0.1: {} - - cli-cursor@3.1.0: - dependencies: - restore-cursor: 3.1.0 - - cli-spinners@2.9.2: {} - - cli-truncate@4.0.0: - dependencies: - slice-ansi: 5.0.0 - string-width: 7.1.0 - - cli-width@4.1.0: {} - - clipanion@3.2.1(typanion@3.14.0): - dependencies: - typanion: 3.14.0 - - cliui@8.0.1: - dependencies: - string-width: 4.2.3 - strip-ansi: 6.0.1 - wrap-ansi: 7.0.0 - - clone@1.0.4: {} - - code-excerpt@4.0.0: - dependencies: - convert-to-spaces: 2.0.1 - - color-convert@2.0.1: - dependencies: - color-name: 1.1.4 - - color-name@1.1.4: {} - - color-support@1.1.3: {} - - colorette@2.0.20: {} - - common-path-prefix@3.0.0: {} - - concat-map@0.0.1: {} - - concordance@5.0.4: - dependencies: - date-time: 3.1.0 - esutils: 2.0.3 - fast-diff: 1.3.0 - js-string-escape: 1.0.1 - lodash: 4.17.21 - md5-hex: 3.0.1 - semver: 7.6.0 - well-known-symbols: 2.0.0 - - console-control-strings@1.1.0: {} - - convert-to-spaces@2.0.1: {} - - currently-unhandled@0.4.1: - dependencies: - array-find-index: 1.0.2 - - date-time@3.1.0: - dependencies: - time-zone: 1.0.0 - - debug@4.3.4: - dependencies: - ms: 2.1.2 - - defaults@1.0.4: - dependencies: - clone: 1.0.4 - - define-data-property@1.1.4: - dependencies: - es-define-property: 1.0.0 - es-errors: 1.3.0 - gopd: 1.0.1 - - delegates@1.0.0: {} - - deprecation@2.3.1: {} - - detect-libc@2.0.3: {} - - emittery@1.0.3: {} - - emnapi@1.1.1: {} - - emoji-regex@10.3.0: {} - - emoji-regex@8.0.0: {} - - es-define-property@1.0.0: - dependencies: - get-intrinsic: 1.2.4 - - es-errors@1.3.0: {} - - escalade@3.1.2: {} - - escape-string-regexp@2.0.0: {} - - escape-string-regexp@5.0.0: {} - - esprima@4.0.1: {} - - estree-walker@2.0.2: {} - - esutils@2.0.3: {} - - external-editor@3.1.0: - dependencies: - chardet: 0.7.0 - iconv-lite: 0.4.24 - tmp: 0.0.33 - - fast-diff@1.3.0: {} - - fast-glob@3.3.2: - dependencies: - '@nodelib/fs.stat': 2.0.5 - '@nodelib/fs.walk': 1.2.8 - glob-parent: 5.1.2 - merge2: 1.4.1 - micromatch: 4.0.5 - - fastq@1.17.1: - dependencies: - reusify: 1.0.4 - - figures@6.1.0: - dependencies: - is-unicode-supported: 2.0.0 - - file-uri-to-path@1.0.0: {} - - fill-range@7.0.1: - dependencies: - to-regex-range: 5.0.1 - - find-up-simple@1.0.0: {} - - fs-minipass@2.1.0: - dependencies: - minipass: 3.3.6 - - fs.realpath@1.0.0: {} - - function-bind@1.1.2: {} - - gauge@3.0.2: - dependencies: - aproba: 2.0.0 - color-support: 1.1.3 - console-control-strings: 1.1.0 - has-unicode: 2.0.1 - object-assign: 4.1.1 - signal-exit: 3.0.7 - string-width: 4.2.3 - strip-ansi: 6.0.1 - wide-align: 1.1.5 - - get-caller-file@2.0.5: {} - - get-east-asian-width@1.2.0: {} - - get-intrinsic@1.2.4: - dependencies: - es-errors: 1.3.0 - function-bind: 1.1.2 - has-proto: 1.0.3 - has-symbols: 1.0.3 - hasown: 2.0.2 - - glob-parent@5.1.2: - dependencies: - is-glob: 4.0.3 - - glob@7.2.3: - dependencies: - fs.realpath: 1.0.0 - inflight: 1.0.6 - inherits: 2.0.4 - minimatch: 3.1.2 - once: 1.4.0 - path-is-absolute: 1.0.1 - - globby@14.0.1: - dependencies: - '@sindresorhus/merge-streams': 2.3.0 - fast-glob: 3.3.2 - ignore: 5.3.1 - path-type: 5.0.0 - slash: 5.1.0 - unicorn-magic: 0.1.0 - - gopd@1.0.1: - dependencies: - get-intrinsic: 1.2.4 - - graceful-fs@4.2.11: {} - - has-flag@4.0.0: {} - - has-property-descriptors@1.0.2: - dependencies: - es-define-property: 1.0.0 - - has-proto@1.0.3: {} - - has-symbols@1.0.3: {} - - has-unicode@2.0.1: {} - - hasown@2.0.2: - dependencies: - function-bind: 1.1.2 - - https-proxy-agent@5.0.1: - dependencies: - agent-base: 6.0.2 - debug: 4.3.4 - transitivePeerDependencies: - - supports-color - - iconv-lite@0.4.24: - dependencies: - safer-buffer: 2.1.2 - - ieee754@1.2.1: {} - - ignore-by-default@2.1.0: {} - - ignore@5.3.1: {} - - imurmurhash@0.1.4: {} - - indent-string@5.0.0: {} - - inflight@1.0.6: - dependencies: - once: 1.4.0 - wrappy: 1.0.2 - - inherits@2.0.4: {} - - inquirer@9.2.19: - dependencies: - '@inquirer/figures': 1.0.1 - '@ljharb/through': 2.3.13 - ansi-escapes: 4.3.2 - chalk: 5.3.0 - cli-cursor: 3.1.0 - cli-width: 4.1.0 - external-editor: 3.1.0 - lodash: 4.17.21 - mute-stream: 1.0.0 - ora: 5.4.1 - run-async: 3.0.0 - rxjs: 7.8.1 - string-width: 4.2.3 - strip-ansi: 6.0.1 - wrap-ansi: 6.2.0 - - irregular-plurals@3.5.0: {} - - is-extglob@2.1.1: {} - - is-fullwidth-code-point@3.0.0: {} - - is-fullwidth-code-point@4.0.0: {} - - is-glob@4.0.3: - dependencies: - is-extglob: 2.1.1 - - is-interactive@1.0.0: {} - - is-number@7.0.0: {} - - is-plain-object@5.0.0: {} - - is-promise@4.0.0: {} - - is-unicode-supported@0.1.0: {} - - is-unicode-supported@2.0.0: {} - - js-string-escape@1.0.1: {} - - js-yaml@3.14.1: - dependencies: - argparse: 1.0.10 - esprima: 4.0.1 - - js-yaml@4.1.0: - dependencies: - argparse: 2.0.1 - - load-json-file@7.0.1: {} - - lodash-es@4.17.21: {} - - lodash@4.17.21: {} - - log-symbols@4.1.0: - dependencies: - chalk: 4.1.2 - is-unicode-supported: 0.1.0 - - lru-cache@6.0.0: - dependencies: - yallist: 4.0.0 - - make-dir@3.1.0: - dependencies: - semver: 6.3.1 - - matcher@5.0.0: - dependencies: - escape-string-regexp: 5.0.0 - - md5-hex@3.0.1: - dependencies: - blueimp-md5: 2.19.0 - - memoize@10.0.0: - dependencies: - mimic-function: 5.0.1 - - merge2@1.4.1: {} - - micromatch@4.0.5: - dependencies: - braces: 3.0.2 - picomatch: 2.3.1 - - mimic-fn@2.1.0: {} - - mimic-function@5.0.1: {} - - minimatch@3.1.2: - dependencies: - brace-expansion: 1.1.11 - - minipass@3.3.6: - dependencies: - yallist: 4.0.0 - - minipass@5.0.0: {} - - minizlib@2.1.2: - dependencies: - minipass: 3.3.6 - yallist: 4.0.0 - - mkdirp@1.0.4: {} - - ms@2.1.2: {} - - ms@2.1.3: {} - - mute-stream@1.0.0: {} - - node-fetch@2.7.0: - dependencies: - whatwg-url: 5.0.0 - - node-gyp-build@4.8.0: {} - - nofilter@3.1.0: {} - - nopt@5.0.0: - dependencies: - abbrev: 1.1.1 - - npmlog@5.0.1: - dependencies: - are-we-there-yet: 2.0.0 - console-control-strings: 1.1.0 - gauge: 3.0.2 - set-blocking: 2.0.0 - - object-assign@4.1.1: {} - - once@1.4.0: - dependencies: - wrappy: 1.0.2 - - onetime@5.1.2: - dependencies: - mimic-fn: 2.1.0 - - ora@5.4.1: - dependencies: - bl: 4.1.0 - chalk: 4.1.2 - cli-cursor: 3.1.0 - cli-spinners: 2.9.2 - is-interactive: 1.0.0 - is-unicode-supported: 0.1.0 - log-symbols: 4.1.0 - strip-ansi: 6.0.1 - wcwidth: 1.0.1 - - os-tmpdir@1.0.2: {} - - p-map@7.0.2: {} - - package-config@5.0.0: - dependencies: - find-up-simple: 1.0.0 - load-json-file: 7.0.1 - - parse-ms@4.0.0: {} - - path-is-absolute@1.0.1: {} - - path-type@5.0.0: {} - - picomatch@2.3.1: {} - - picomatch@3.0.1: {} - - plur@5.1.0: - dependencies: - irregular-plurals: 3.5.0 - - pretty-ms@9.0.0: - dependencies: - parse-ms: 4.0.0 - - queue-microtask@1.2.3: {} - - readable-stream@3.6.2: - dependencies: - inherits: 2.0.4 - string_decoder: 1.3.0 - util-deprecate: 1.0.2 - - require-directory@2.1.1: {} - - resolve-cwd@3.0.0: - dependencies: - resolve-from: 5.0.0 - - resolve-from@5.0.0: {} - - restore-cursor@3.1.0: - dependencies: - onetime: 5.1.2 - signal-exit: 3.0.7 - - reusify@1.0.4: {} - - rimraf@3.0.2: - dependencies: - glob: 7.2.3 - - run-async@3.0.0: {} - - run-parallel@1.2.0: - dependencies: - queue-microtask: 1.2.3 - - rxjs@7.8.1: - dependencies: - tslib: 2.6.2 - - safe-buffer@5.2.1: {} - - safer-buffer@2.1.2: {} - - semver@6.3.1: {} - - semver@7.6.0: - dependencies: - lru-cache: 6.0.0 - - serialize-error@7.0.1: - dependencies: - type-fest: 0.13.1 - - set-blocking@2.0.0: {} - - set-function-length@1.2.2: - 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 - - signal-exit@3.0.7: {} - - signal-exit@4.1.0: {} - - slash@5.1.0: {} - - slice-ansi@5.0.0: - dependencies: - ansi-styles: 6.2.1 - is-fullwidth-code-point: 4.0.0 - - sprintf-js@1.0.3: {} - - stack-utils@2.0.6: - dependencies: - escape-string-regexp: 2.0.0 - - string-width@4.2.3: - dependencies: - emoji-regex: 8.0.0 - is-fullwidth-code-point: 3.0.0 - strip-ansi: 6.0.1 - - string-width@7.1.0: - dependencies: - emoji-regex: 10.3.0 - get-east-asian-width: 1.2.0 - strip-ansi: 7.1.0 - - string_decoder@1.3.0: - dependencies: - safe-buffer: 5.2.1 - - strip-ansi@6.0.1: - dependencies: - ansi-regex: 5.0.1 - - strip-ansi@7.1.0: - dependencies: - ansi-regex: 6.0.1 - - supertap@3.0.1: - dependencies: - indent-string: 5.0.0 - js-yaml: 3.14.1 - serialize-error: 7.0.1 - strip-ansi: 7.1.0 - - supports-color@7.2.0: - dependencies: - has-flag: 4.0.0 - - tar@6.2.1: - dependencies: - chownr: 2.0.0 - fs-minipass: 2.1.0 - minipass: 5.0.0 - minizlib: 2.1.2 - mkdirp: 1.0.4 - yallist: 4.0.0 - - temp-dir@3.0.0: {} - - time-zone@1.0.0: {} - - tmp@0.0.33: - dependencies: - os-tmpdir: 1.0.2 - - to-regex-range@5.0.1: - dependencies: - is-number: 7.0.0 - - toml@3.0.0: {} - - tr46@0.0.3: {} - - tslib@2.6.2: {} - - typanion@3.14.0: {} - - type-fest@0.13.1: {} - - type-fest@0.21.3: {} - - typescript@5.4.5: {} - - undici-types@5.26.5: {} - - unicorn-magic@0.1.0: {} - - universal-user-agent@6.0.1: {} - - util-deprecate@1.0.2: {} - - wasm-sjlj@1.0.5: {} - - wcwidth@1.0.1: - dependencies: - defaults: 1.0.4 - - webidl-conversions@3.0.1: {} - - well-known-symbols@2.0.0: {} - - whatwg-url@5.0.0: - dependencies: - tr46: 0.0.3 - webidl-conversions: 3.0.1 - - wide-align@1.1.5: - dependencies: - string-width: 4.2.3 - - wrap-ansi@6.2.0: - dependencies: - ansi-styles: 4.3.0 - string-width: 4.2.3 - strip-ansi: 6.0.1 - - wrap-ansi@7.0.0: - dependencies: - ansi-styles: 4.3.0 - string-width: 4.2.3 - strip-ansi: 6.0.1 - - wrappy@1.0.2: {} - - write-file-atomic@5.0.1: - dependencies: - imurmurhash: 0.1.4 - signal-exit: 4.1.0 - - y18n@5.0.8: {} - - yallist@4.0.0: {} - - yargs-parser@21.1.1: {} - - yargs@17.7.2: - dependencies: - cliui: 8.0.1 - escalade: 3.1.2 - get-caller-file: 2.0.5 - require-directory: 2.1.1 - string-width: 4.2.3 - y18n: 5.0.8 - yargs-parser: 21.1.1 diff --git a/src/tests/alias.rs b/src/tests/alias.rs deleted file mode 100644 index c7f7129a..00000000 --- a/src/tests/alias.rs +++ /dev/null @@ -1,220 +0,0 @@ -//! - -use normalize_path::NormalizePath; -use std::path::Path; - -use crate::{AliasValue, Resolution, ResolveContext, ResolveError, ResolveOptions, Resolver}; - -#[test] -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -fn alias() { - use super::memory_fs::MemoryFS; - use crate::ResolverGeneric; - use std::path::{Path, PathBuf}; - - let f = Path::new("/"); - - let file_system = MemoryFS::new(&[ - ("/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", ""), - ("/dashed-name", ""), - ]); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - alias: vec![ - ("aliasA".into(), vec![AliasValue::from("a")]), - ("b$".into(), vec![AliasValue::from("a/index")]), - ("c$".into(), vec![AliasValue::from("/a/index")]), - ( - "multiAlias".into(), - vec![ - AliasValue::from("b"), - AliasValue::from("c"), - AliasValue::from("d"), - AliasValue::from("e"), - AliasValue::from("a"), - ], - ), - ("recursive".into(), vec![AliasValue::from("recursive/dir")]), - ("/d/dir".into(), vec![AliasValue::from("/c/dir")]), - ("/d/index.js".into(), vec![AliasValue::from("/c/index")]), - ("#".into(), vec![AliasValue::from("/c/dir")]), - ("@".into(), vec![AliasValue::from("/c/dir")]), - ("ignored".into(), vec![AliasValue::Ignore]), - // not part of enhanced-resolve, added to make sure query in alias value works - ("alias_query".into(), vec![AliasValue::from("a?query_after")]), - ("alias_fragment".into(), vec![AliasValue::from("a#fragment_after")]), - ("dash".into(), vec![AliasValue::Ignore]), - ("@scope/package-name/file$".into(), vec![AliasValue::from("/c/dir")]), - ], - modules: vec!["/".into()], - ..ResolveOptions::default() - }, - ); - - #[rustfmt::skip] - let pass = [ - ("should resolve a not aliased module 1", "a", "/a/index"), - ("should resolve a not aliased module 2", "a/index", "/a/index"), - ("should resolve a not aliased module 3", "a/dir", "/a/dir/index"), - ("should resolve a not aliased module 4", "a/dir/index", "/a/dir/index"), - ("should resolve an aliased module 1", "aliasA", "/a/index"), - ("should resolve an aliased module 2", "aliasA/index", "/a/index"), - ("should resolve an aliased module 3", "aliasA/dir", "/a/dir/index"), - ("should resolve an aliased module 4", "aliasA/dir/index", "/a/dir/index"), - ("should resolve '#' alias 1", "#", "/c/dir/index"), - ("should resolve '#' alias 2", "#/index", "/c/dir/index"), - ("should resolve '@' alias 1", "@", "/c/dir/index"), - ("should resolve '@' alias 2", "@/index", "/c/dir/index"), - ("should resolve a recursive aliased module 1", "recursive", "/recursive/dir/index"), - ("should resolve a recursive aliased module 2", "recursive/index", "/recursive/dir/index"), - ("should resolve a recursive aliased module 3", "recursive/dir", "/recursive/dir/index"), - ("should resolve a recursive aliased module 4", "recursive/dir/index", "/recursive/dir/index"), - ("should resolve a file aliased module 1", "b", "/a/index"), - ("should resolve a file aliased module 2", "c", "/a/index"), - ("should resolve a file aliased module with a query 1", "b?query", "/a/index?query"), - ("should resolve a file aliased module with a query 2", "c?query", "/a/index?query"), - ("should resolve a path in a file aliased module 1", "b/index", "/b/index"), - ("should resolve a path in a file aliased module 2", "b/dir", "/b/dir/index"), - ("should resolve a path in a file aliased module 3", "b/dir/index", "/b/dir/index"), - ("should resolve a path in a file aliased module 4", "c/index", "/c/index"), - ("should resolve a path in a file aliased module 5", "c/dir", "/c/dir/index"), - ("should resolve a path in a file aliased module 6", "c/dir/index", "/c/dir/index"), - ("should resolve a file aliased file 1", "d", "/c/index"), - ("should resolve a file aliased file 2", "d/dir/index", "/c/dir/index"), - ("should resolve a file in multiple aliased dirs 1", "multiAlias/dir/file", "/e/dir/file"), - ("should resolve a file in multiple aliased dirs 2", "multiAlias/anotherDir", "/e/anotherDir/index"), - // not part of enhanced-resolve, added to make sure query in alias value works - ("should resolve query in alias value", "alias_query?query_before", "/a/index?query_after"), - ("should resolve query in alias value", "alias_fragment#fragment_before", "/a/index#fragment_after"), - ("should resolve dashed name", "dashed-name", "/dashed-name"), - ("should resolve scoped package name with sub dir", "@scope/package-name/file", "/c/dir/index"), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - - #[rustfmt::skip] - let ignore = [ - ("should resolve an ignore module", "ignored", ResolveError::Ignored(f.join("ignored"))) - ]; - - for (comment, request, expected) in ignore { - let resolution = resolver.resolve(f, request); - assert_eq!(resolution, Err(expected), "{comment} {request}"); - } -} - -// Not part of enhanced-resolve -#[test] -fn infinite_recursion() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![ - ("./a".into(), vec![AliasValue::from("./b")]), - ("./b".into(), vec![AliasValue::from("./a")]), - ], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(f, "./a"); - assert_eq!(resolution, Err(ResolveError::Recursion)); -} - -fn check_slash(path: &Path) { - let s = path.to_string_lossy().to_string(); - #[cfg(target_os = "windows")] - { - assert!(!s.contains('/'), "{s}"); - assert!(s.contains('\\'), "{s}"); - } - #[cfg(not(target_os = "windows"))] - { - assert!(s.contains('/'), "{s}"); - assert!(!s.contains('\\'), "{s}"); - } -} - -#[test] -fn absolute_path() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![(f.join("foo").to_str().unwrap().to_string(), vec![AliasValue::Ignore])], - modules: vec![f.clone().to_str().unwrap().to_string()], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(&f, "foo/index"); - assert_eq!(resolution, Err(ResolveError::Ignored(f.join("foo")))); -} - -#[test] -fn system_path() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![("@app".into(), vec![AliasValue::from(f.join("alias").to_string_lossy())])], - ..ResolveOptions::default() - }); - - let specifiers = ["@app/files/a", "@app/files/a.js"]; - - for specifier in specifiers { - let path = resolver.resolve(&f, specifier).map(Resolution::into_path_buf).unwrap(); - assert_eq!(path, f.join("alias/files/a.js")); - check_slash(&path); - } -} - -#[test] -fn alias_is_full_path() { - let f = super::fixture(); - let dir = f.join("foo"); - let dir_str = dir.to_string_lossy().to_string(); - - let resolver = Resolver::new(ResolveOptions { - alias: vec![("@".into(), vec![AliasValue::Path(dir_str.clone())])], - ..ResolveOptions::default() - }); - - let mut ctx = ResolveContext::default(); - - let specifiers = [ - "@/index".to_string(), - "@/index.js".to_string(), - // specifier has multiple `/` for reasons we'll never know - "@////index".to_string(), - // specifier is a full path - dir_str, - ]; - - for specifier in specifiers { - let resolution = resolver.resolve_with_context(&f, &specifier, &mut ctx); - assert_eq!(resolution.map(|r| r.full_path()), Ok(dir.join("index.js"))); - } - - for path in ctx.file_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - check_slash(&path); - } - - for path in ctx.missing_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - check_slash(&path); - if let Some(path) = path.parent() { - assert!(!path.is_file(), "{path:?} must not be a file"); - } - } -} diff --git a/src/tests/browser_field.rs b/src/tests/browser_field.rs deleted file mode 100644 index 397ec06e..00000000 --- a/src/tests/browser_field.rs +++ /dev/null @@ -1,175 +0,0 @@ -//! - -use crate::{AliasValue, ResolveError, ResolveOptions, Resolver}; - -#[test] -fn ignore() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![ - vec!["browser".into()], - vec!["innerBrowser1".into()], - vec!["innerBrowser2".into()], - vec![], - ], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - (f.clone(), "./lib/ignore", f.join("lib/ignore.js")), - (f.clone(), "./lib/ignore.js", f.join("lib/ignore.js")), - (f.join("lib"), "./ignore", f.join("lib/ignore.js")), - (f.join("lib"), "./ignore.js", f.join("lib/ignore.js")), - ]; - - for (path, request, expected) in data { - let resolution = resolver.resolve(&path, request); - let expected = ResolveError::Ignored(expected); - assert_eq!(resolution, Err(expected), "{path:?} {request}"); - } -} - -#[test] -fn shared_resolvers() { - let f = super::fixture().join("browser-module"); - - let resolver1 = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["innerBrowser1".into(), "field".into(), "browser".into()]], - ..ResolveOptions::default() - }); - let resolved_path = resolver1.resolve(&f, "./lib/main1.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("lib/main.js"))); - - let resolver2 = resolver1.clone_with_options(ResolveOptions { - alias_fields: vec![vec!["innerBrowser2".into(), "browser".into()]], - ..ResolveOptions::default() - }); - let resolved_path = resolver2.resolve(&f, "./lib/main2.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("./lib/replaced.js"))); -} - -#[test] -fn replace_file() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![ - vec!["browser".into()], - vec!["innerBrowser1".into(), "field2".into(), "browser".into()], // not presented - vec!["innerBrowser1".into(), "field".into(), "browser".into()], - vec!["innerBrowser2".into(), "browser".into()], - ], - // Not part of enhanced-resolve. Added to make sure no interaction between these two fields. - main_fields: vec!["browser".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - ("should replace a file 1", f.clone(), "./lib/replaced", f.join("lib/browser.js")), - ("should replace a file 2", f.clone(), "./lib/replaced.js", f.join("lib/browser.js")), - ("should replace a file 3", f.join("lib"), "./replaced", f.join("lib/browser.js")), - ("should replace a file 4", f.join("lib"), "./replaced.js", f.join("lib/browser.js")), - ("should replace a module with a file 1", f.clone(), "module-a", f.join("browser/module-a.js")), - ("should replace a module with a file 2", f.join("lib"), "module-a", f.join("browser/module-a.js")), - ("should replace a module with a module 1", f.clone(), "module-b", f.join("node_modules/module-c.js")), - ("should replace a module with a module 2", f.join("lib"), "module-b", f.join("node_modules/module-c.js")), - ("should resolve in nested property 1", f.clone(), "./lib/main1.js", f.join("lib/main.js")), - ("should resolve in nested property 2", f.clone(), "./lib/main2.js", f.join("lib/browser.js")), - ("should check only alias field properties", f.clone(), "./toString", f.join("lib/toString.js")), - // not part of enhanced-resolve - ("recursion", f.clone(), "module-c", f.join("node_modules/module-c.js")), - ("resolve self 1", f.clone(), "./lib/main.js", f.join("lib/main.js")), - ("resolve self 2", f.clone(), "./main.js", f.join("lib/main.js")), - ]; - - for (comment, path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn recurse_fail() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - ("recurse non existent", f.clone(), "./lib/non-existent.js", ResolveError::NotFound("./lib/non-existent.js".into())), - ("path partial match 1", f.clone(), "./xyz.js", ResolveError::NotFound("./xyz.js".into())), - ("path partial match 2", f.clone(), "./lib/xyz.js", ResolveError::NotFound("./lib/xyz.js".into())), - ]; - - for (comment, path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Err(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn broken() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - // The browser field string value should be ignored - (f.clone(), "browser-module-broken", f.join("node_modules/browser-module-broken/main.js")), - ]; - - for (path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{path:?} {request}"); - } -} - -#[test] -fn crypto_js() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - fallback: vec![( - "crypto".into(), - vec![AliasValue::from(f.join("lib.js").to_string_lossy())], - )], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(f.join("crypto-js"), "crypto").map(|r| r.full_path()); - assert_eq!(resolved_path, Err(ResolveError::Ignored(f.join("crypto-js")))); -} - -// https://github.com/webpack/webpack/blob/87660921808566ef3b8796f8df61bd79fc026108/test/cases/resolving/browser-field/index.js#L40-L43 -#[test] -fn recursive() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - let data = [ - ("should handle recursive file 1", f.clone(), "recursive-file/a"), - ("should handle recursive file 2", f.clone(), "recursive-file/b"), - ("should handle recursive file 3", f.clone(), "recursive-file/c"), - ("should handle recursive file 4", f.clone(), "recursive-file/d"), - ]; - - for (comment, path, request) in data { - let resolved_path = resolver.resolve(&path, request); - assert_eq!(resolved_path, Err(ResolveError::Recursion), "{comment} {path:?} {request}"); - } -} diff --git a/src/tests/builtins.rs b/src/tests/builtins.rs deleted file mode 100644 index 6163dd13..00000000 --- a/src/tests/builtins.rs +++ /dev/null @@ -1,98 +0,0 @@ -use std::path::Path; - -use crate::{ResolveError, ResolveOptions, Resolver}; - -#[test] -fn builtins_off() { - let f = Path::new("/"); - let resolver = Resolver::default(); - let resolved_path = resolver.resolve(f, "zlib").map(|r| r.full_path()); - assert_eq!(resolved_path, Err(ResolveError::NotFound("zlib".into()))); -} - -#[test] -fn builtins() { - let f = Path::new("/"); - - let resolver = - Resolver::new(ResolveOptions { builtin_modules: true, ..ResolveOptions::default() }); - - let pass = [ - "_http_agent", - "_http_client", - "_http_common", - "_http_incoming", - "_http_outgoing", - "_http_server", - "_stream_duplex", - "_stream_passthrough", - "_stream_readable", - "_stream_transform", - "_stream_wrap", - "_stream_writable", - "_tls_common", - "_tls_wrap", - "assert", - "assert/strict", - "async_hooks", - "buffer", - "child_process", - "cluster", - "console", - "constants", - "crypto", - "dgram", - "diagnostics_channel", - "dns", - "dns/promises", - "domain", - "events", - "fs", - "fs/promises", - "http", - "http2", - "https", - "inspector", - "module", - "net", - "os", - "path", - "path/posix", - "path/win32", - "perf_hooks", - "process", - "punycode", - "querystring", - "readline", - "repl", - "stream", - "stream/consumers", - "stream/promises", - "stream/web", - "string_decoder", - "sys", - "timers", - "timers/promises", - "tls", - "trace_events", - "tty", - "url", - "util", - "util/types", - "v8", - "vm", - "worker_threads", - "zlib", - ]; - - for request in pass { - let resolved_path = resolver.resolve(f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Err(ResolveError::Builtin(request.to_string())), "{request}"); - } - - for request in pass { - let request = format!("node:{request}"); - let resolved_path = resolver.resolve(f, &request).map(|r| r.full_path()); - assert_eq!(resolved_path, Err(ResolveError::Builtin(request.to_string())), "{request}"); - } -} diff --git a/src/tests/dependencies.rs b/src/tests/dependencies.rs deleted file mode 100644 index bcc2355b..00000000 --- a/src/tests/dependencies.rs +++ /dev/null @@ -1,110 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/dependencies.test.js - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows { - use rustc_hash::FxHashSet; - use std::path::PathBuf; - - use crate::{ResolveContext, ResolveOptions, ResolverGeneric}; - - use super::super::memory_fs::MemoryFS; - - fn file_system() -> MemoryFS { - MemoryFS::new(&[ - ("/a/b/node_modules/some-module/index.js", ""), - ("/a/node_modules/module/package.json", r#"{"main":"entry.js"}"#), - ("/a/node_modules/module/file.js", r#"{"main":"entry.js"}"#), - ("/modules/other-module/file.js", ""), - ]) - } - - #[test] - fn test() { - let file_system = file_system(); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - extensions: vec![".json".into(), ".js".into()], - modules: vec!["/modules".into(), "node_modules".into()], - ..ResolveOptions::default() - }, - ); - - let data = [ - ( - "middle module request", - "/a/b/c", - "module/file", - "/a/node_modules/module/file.js", - // These dependencies are different from enhanced-resolve due to different code path to - // querying the file system - vec![ - // 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", - // "/", - ], - vec![ - // missing package.jsons - // "/a/b/c/package.json", - "/a/b/package.json", - "/a/package.json", - "/package.json", - // missing modules directories - "/a/b/c", - // "/a/b/c/node_modules", - // missing single file modules - "/modules/module", - "/a/b/node_modules/module", - // missing files with alternative extensions - "/a/node_modules/module/file", - "/a/node_modules/module/file.json", - ], - ), - ( - "fast found module", - "/a/b/c", - "other-module/file.js", - "/modules/other-module/file.js", - // These dependencies are different from enhanced-resolve due to different code path to - // querying the file system - vec![ - // symlink checks - "/modules/other-module/file.js", - // "/modules/other-module", - // "/modules", - // "/", - ], - vec![ - // missing package.jsons - // "/a/b/c/package.json", - "/a/b/c", - "/a/b/package.json", - "/a/package.json", - "/package.json", - "/modules/other-module/package.json", - "/modules/package.json", - ], - ), - ]; - - for (name, context, request, result, file_dependencies, missing_dependencies) in data { - let mut ctx = ResolveContext::default(); - let path = PathBuf::from(context); - let resolved = - resolver.resolve_with_context(path, request, &mut ctx).map(|r| r.full_path()); - assert_eq!(resolved, Ok(PathBuf::from(result))); - let file_dependencies = - FxHashSet::from_iter(file_dependencies.iter().map(PathBuf::from)); - let missing_dependencies = - FxHashSet::from_iter(missing_dependencies.iter().map(PathBuf::from)); - assert_eq!(ctx.file_dependencies, file_dependencies, "{name}"); - assert_eq!(ctx.missing_dependencies, missing_dependencies, "{name}"); - } - } -} diff --git a/src/tests/exports_field.rs b/src/tests/exports_field.rs deleted file mode 100644 index 2fcfb1f4..00000000 --- a/src/tests/exports_field.rs +++ /dev/null @@ -1,2546 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/exportsField.test.js -//! -//! The huge exports field test cases are at the bottom of this file. - -use crate::{Ctx, PathUtil, ResolveError, ResolveOptions, Resolver}; -use serde_json::json; -use std::path::Path; - -#[test] -fn test_simple() { - let f = super::fixture().join("exports-field"); - let f2 = super::fixture().join("exports-field2"); - let f4 = super::fixture().join("exports-field-error"); - let f5 = super::fixture().join("imports-exports-wildcard"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - fully_specified: true, - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("resolve root using exports field, not a main field", f.clone(), "exports-field", f.join("node_modules/exports-field/x.js")), - ("resolver should respect condition names", f.clone(), "exports-field/dist/main.js", f.join("node_modules/exports-field/lib/lib2/main.js")), - // enhanced_resolve behaves differently to node.js. enhanced_resolve fallbacks when an - // array item is unresolved, where as node.js fallbacks when an array has an - // InvalidPackageTarget error. - // ("resolver should respect fallback", f2.clone(), "exports-field/dist/browser.js", f2.join("node_modules/exports-field/lib/browser.js")), - // The following two tests require fallback from array values, the path is changed here to - // only test query and fragment. - ("resolver should respect query parameters #1", f2.clone(), "exports-field/dist/main.js?foo", f2.join("node_modules/exports-field/lib/lib2/main.js?foo")), - ("resolver should respect fragment parameters #1", f2.clone(), "exports-field/dist/main.js#foo", f2.join("node_modules/exports-field/lib/lib2/main.js#foo")), - ("relative path should work, if relative path as request is used", f.clone(), "./node_modules/exports-field/lib/main.js", f.join("node_modules/exports-field/lib/main.js")), - ("self-resolving root", f.clone(), "@exports-field/core", f.join("a.js")), - ("should resolve with wildcard pattern #1", f5.clone(), "m/features/f.js", f5.join("node_modules/m/src/features/f.js")), - ("should resolve with wildcard pattern #2", f5.clone(), "m/features/y/y.js", f5.join("node_modules/m/src/features/y/y.js")), - ("should resolve with wildcard pattern #3", f5.clone(), "m/features-no-ext/y/y.js", f5.join("node_modules/m/src/features/y/y.js")), - ("should resolve with wildcard pattern #4", f5.clone(), "m/middle/nested/f.js", f5.join("node_modules/m/src/middle/nested/f.js")), - ("should resolve with wildcard pattern #5", f5.clone(), "m/middle-1/nested/f.js", f5.join("node_modules/m/src/middle-1/nested/f.js")), - ("should resolve with wildcard pattern #6", f5.clone(), "m/middle-2/nested/f.js", f5.join("node_modules/m/src/middle-2/nested/f.js")), - ("should resolve with wildcard pattern #7", f5.clone(), "m/middle-3/nested/f", f5.join("node_modules/m/src/middle-3/nested/f/nested/f.js")), - ("should resolve with wildcard pattern #8", f5.clone(), "m/middle-4/f/nested", f5.join("node_modules/m/src/middle-4/f/f.js")), - ("should resolve with wildcard pattern #9", f5.clone(), "m/middle-5/f$/$", f5.join("node_modules/m/src/middle-5/f$/$.js")), - ]; - - // Not needed or snapshot: - // * should log the correct info - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } - - let p = f.join("node_modules/exports-field/package.json"); - let p2 = f2.join("node_modules/exports-field/package.json"); - let p4 = f4.join("node_modules/exports-field/package.json"); - let p5 = f5.join("node_modules/m/package.json"); - - #[rustfmt::skip] - let fail = [ - // ("throw error if extension not provided", f2.clone(), "exports-field/dist/main", ResolveError::NotFound(f2.join("node_modules/exports-field/lib/lib2/main"))), - ("resolver should respect query parameters #2. Direct matching", f2.clone(), "exports-field?foo", ResolveError::PackagePathNotExported("./?foo".into(), p2.clone())), - ("resolver should respect fragment parameters #2. Direct matching", f2, "exports-field#foo", ResolveError::PackagePathNotExported("./#foo".into(), p2.clone())), - ("relative path should not work with exports field", f.clone(), "./node_modules/exports-field/dist/main.js", ResolveError::NotFound("./node_modules/exports-field/dist/main.js".into())), - ("backtracking should not work for request", f.clone(), "exports-field/dist/../../../a.js", ResolveError::InvalidPackageTarget("./lib/../../../a.js".to_string(), "./dist/".to_string(), p.clone())), - ("backtracking should not work for exports field target", f.clone(), "exports-field/dist/a.js", ResolveError::InvalidPackageTarget("./../../a.js".to_string(), "./dist/a.js".to_string(), p.clone())), - ("not exported error", f.clone(), "exports-field/anything/else", ResolveError::PackagePathNotExported("./anything/else".to_string(), p.clone())), - ("request ending with slash #1", f.clone(), "exports-field/", ResolveError::PackagePathNotExported("./".to_string(), p.clone())), - ("request ending with slash #2", f.clone(), "exports-field/dist/", ResolveError::PackagePathNotExported("./dist/".to_string(), p.clone())), - ("request ending with slash #3", f.clone(), "exports-field/lib/", ResolveError::PackagePathNotExported("./lib/".to_string(), p.clone())), - ("should throw error if target is invalid", f4, "exports-field", ResolveError::InvalidPackageTarget("./a/../b/../../pack1/index.js".to_string(), ".".to_string(), p4.clone())), - ("throw error if exports field is invalid", f.clone(), "invalid-exports-field", ResolveError::InvalidPackageConfig(f.join("node_modules/invalid-exports-field/package.json"))), - ("should throw error if target is 'null'", f5, "m/features/internal/file.js", ResolveError::PackagePathNotExported("./features/internal/file.js".to_string(), p5.clone())), - ]; - - for (comment, path, request, error) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!(resolution, Err(error), "{comment} {path:?} {request}"); - } -} - -// resolve using exports field, not a browser field #1 -#[test] -fn exports_not_browser_field1() { - let f = super::fixture().join("exports-field"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - condition_names: vec!["webpack".into()], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "exports-field/dist/main.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("node_modules/exports-field/lib/lib2/main.js"))); -} - -// resolve using exports field and a browser alias field #2 -#[test] -fn exports_not_browser_field2() { - let f2 = super::fixture().join("exports-field2"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - extensions: vec![".js".into()], - condition_names: vec!["node".into()], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f2, "exports-field/dist/main.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f2.join("node_modules/exports-field/lib/browser.js"))); -} - -// should resolve extension without fullySpecified -#[test] -fn extension_without_fully_specified() { - let f2 = super::fixture().join("exports-field2"); - - let commonjs_resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - let resolved_path = - commonjs_resolver.resolve(&f2, "exports-field/dist/main").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f2.join("node_modules/exports-field/lib/lib2/main.js"))); -} - -#[test] -fn field_name_path() { - let f2 = super::fixture().join("exports-field2"); - let f3 = super::fixture().join("exports-field3"); - - // field name path #1 #2 #3 - let exports_fields = [ - vec![vec!["exportsField".into(), "exports".into()]], - vec![vec!["exportsField".into(), "exports".into()], vec!["exports".into()]], - vec![vec!["exports".into()], vec!["exportsField".into(), "exports".into()]], - ]; - - for exports_fields in exports_fields { - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - exports_fields, - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/main.js"))); - } - - // field name path #4 - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - exports_fields: vec![vec!["exports".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f2, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f2.join("node_modules/exports-field/index.js"))); - - // field name path #5 - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - exports_fields: vec![vec!["ex".into()], vec!["exports_field".into(), "exports".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/index"))); - - // non-compliant export targeting a directory - let resolver = Resolver::new(ResolveOptions { - exports_fields: vec![vec!["broken".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/src/index.js"))); -} - -#[test] -fn shared_resolvers() { - let f3 = super::fixture().join("exports-field3"); - - let resolver1 = Resolver::new(ResolveOptions { - exports_fields: vec![vec!["exportsField".into(), "exports".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver1.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/main.js"))); - - let resolver2 = resolver1.clone_with_options(ResolveOptions { - exports_fields: vec![vec!["ex".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver2.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/index"))); -} - -#[test] -fn extension_alias_1_2() { - let f = super::fixture().join("exports-field-and-extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - extension_alias: vec![(".js".into(), vec![".ts".into(), ".js".into()])], - fully_specified: true, - condition_names: vec!["webpack".into(), "default".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve with the `extensionAlias` option", f.clone(), "@org/pkg/string.js", f.join("node_modules/@org/pkg/dist/string.js")), - ("should resolve with the `extensionAlias` option #2", f.clone(), "pkg/string.js", f.join("node_modules/pkg/dist/string.js")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn extension_alias_3() { - let f = super::fixture().join("exports-field-and-extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - extension_alias: vec![( - ".js".into(), - vec![".foo".into(), ".baz".into(), ".baz".into(), ".ts".into(), ".js".into()], - )], - fully_specified: true, - condition_names: vec!["webpack".into(), "default".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve with the `extensionAlias` option #3", f.clone(), "pkg/string.js", f.join("node_modules/pkg/dist/string.js")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn extension_alias_throw_error() { - let f = super::fixture().join("exports-field-and-extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - extension_alias: vec![(".js".into(), vec![".ts".into()])], - fully_specified: true, - condition_names: vec!["webpack".into(), "default".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let fail = [ - // enhanced-resolve has two test cases that are exactly the same here - // https://github.com/webpack/enhanced-resolve/blob/a998c7d218b7a9ec2461fc4fddd1ad5dd7687485/test/exportsField.test.js#L2976-L3024 - ("should throw error with the `extensionAlias` option", f, "pkg/string.js", ResolveError::ExtensionAlias), - // TODO: The error is PackagePathNotExported in enhanced-resolve - // ("should throw error with the `extensionAlias` option", f.clone(), "pkg/string.js", ResolveError::PackagePathNotExported("node_modules/pkg/dist/string.ts".to_string())), - ]; - - for (comment, path, request, error) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!(resolution, Err(error), "{comment} {path:?} {request}"); - } -} - -// Small script for generating the test cases from enhanced-resolve -// for (c of testCases) { -// console.log("TestCase {") -// console.log(`name: ${JSON.stringify(c.name)},`) -// if (c.expect instanceof Error) { -// console.log(`expect: None,`) -// } else { -// console.log(`expect: Some(vec!${JSON.stringify(c.expect)}),`) -// } -// console.log(`exports_field: exports_field(json!(${JSON.stringify(c.suite[0], null, 2)})),`) -// console.log(`request: "${c.suite[1]}",`) -// console.log(`condition_names: vec!${JSON.stringify(c.suite[2])},`) -// console.log("},") -//} -struct TestCase { - name: &'static str, - expect: Option>, - exports_field: serde_json::Value, - request: &'static str, - condition_names: Vec<&'static str>, -} - -#[allow(clippy::needless_pass_by_value)] -fn exports_field(value: serde_json::Value) -> serde_json::Value { - value -} - -#[test] -fn test_cases() { - let test_cases = [ - TestCase { - name: "sample #1", - expect: Some(vec!["./dist/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/": { - "import": [ - "./dist/", - "./src/" - ], - "webpack": "./wp/" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "sample #1", - expect: Some(vec!["./src/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/": { - "import": [ - "./src/" - ], - "webpack": "./wp/" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - TestCase { - name: "sample #1 (wildcard)", - expect: Some(vec!["./dist/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/*": { - "import": [ - "./dist/*", - "./src/*" - ], - "webpack": "./wp/*" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "sample #1 (wildcard)", - expect: Some(vec!["./src/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/*": { - "import": [ - "./src/*" - ], - "webpack": "./wp/*" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - TestCase { - name: "sample #2", - expect: Some(vec!["./data/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./timezones/": "./data/timezones/" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #2 (wildcard)", - expect: Some(vec!["./data/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./timezones/*": "./data/timezones/*" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #3", - expect: Some(vec!["./data/timezones/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./": "./data/timezones/" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #3 (wildcard)", - expect: Some(vec!["./data/timezones/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./*": "./data/timezones/*.mjs" - })), - request: "./timezones/pdt", - condition_names: vec![], - }, - TestCase { - name: "sample #4", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./lib/": { - "browser": [ - "./browser/" - ] - }, - "./dist/index.js": { - "node": "./index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #4 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "node": "./index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #5", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/": { - "browser": [ - "./browser/" - ] - }, - "./dist/index.js": { - "node": "./index.js", - "default": "./browser/index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #5 (wildcard)", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "node": "./index.js", - "default": "./browser/index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./dist/a": "./dist/index.js" - })), - request: "./dist/aaa", - condition_names: vec![], - }, - TestCase { - name: "sample #7", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./dist/a/a/": "./dist/index.js" - })), - request: "./dist/a/a", - condition_names: vec![], - }, - TestCase { - name: "sample #7 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./dist/a/a/*": "./dist/index.js" - })), - request: "./dist/a/a", - condition_names: vec![], - }, - TestCase { - name: "sample #8", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": "./index.js" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #9", - expect: Some(vec!["./main.js"]), - exports_field: exports_field(json!({ - "./index.js": "./main.js" - })), - request: "./index.js", - condition_names: vec![], - }, - TestCase { - name: "sample #10", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #11", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./bar#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #12", - expect: Some(vec!["./ok.js#abc"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/ok.js#abc", - condition_names: vec![], - }, - TestCase { - name: "sample #12", - expect: Some(vec!["./ok.js#abc"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/ok.js#abc", - condition_names: vec![], - }, - TestCase { - name: "sample #13", - expect: Some(vec!["./ok.js?abc"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/ok.js?abc", - condition_names: vec![], - }, - TestCase { - name: "sample #14", - expect: Some(vec!["./🎉.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/🎉.js", - condition_names: vec![], - }, - TestCase { - name: "sample #15", - expect: Some(vec!["./%F0%9F%8E%89.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/%F0%9F%8E%89.js", - condition_names: vec![], - }, - TestCase { - name: "sample #16", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./🎉", - condition_names: vec![], - }, - TestCase { - name: "sample #17", - expect: Some(vec!["./other.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./%F0%9F%8E%89", - condition_names: vec![], - }, - TestCase { - name: "sample #18", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./module", - condition_names: vec![], - }, - TestCase { - name: "sample #19", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./module#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #20", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./module?foo", - condition_names: vec![], - }, - TestCase { - name: "sample #21", - expect: Some(vec!["./zizizi"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./z*z*z*" - })), - request: "./#zippi", - condition_names: vec![], - }, - TestCase { - name: "sample #22", - expect: Some(vec!["./d?e?f"]), - exports_field: exports_field(json!({ - "./a?b?c/": "./" - })), - request: "./a?b?c/d?e?f", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #1", - expect: Some(vec!["./dist/index.js"]), - exports_field: exports_field(json!({ - ".": "./dist/index.js" - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #2", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./": "./", - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #3", - expect: Some(vec!["./dist/a.js"]), - exports_field: exports_field(json!({ - "./dist/": "./dist/", - "./dist/*": "./dist/*", - "./dist*": "./dist*", - "./dist/index.js": "./dist/a.js" - })), - request: "./dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #4", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./": { - "browser": [ - "./browser/" - ] - }, - "./*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "browser": "./index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #5", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./": { - "browser": [ - "./browser/" - ] - }, - "./*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "node": "./node.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #6", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - ".": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #7", - expect: None, - exports_field: exports_field(json!({ - ".": { - "default": "./src/index.js", - "browser": "./index.js", - "node": "./src/node/index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #8", - expect: Some(vec!["./src/index.js"]), - exports_field: exports_field(json!({ - ".": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #9", - expect: Some(vec!["./index"]), - exports_field: exports_field(json!({ - ".": "./index" - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #10", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./index": "./index.js" - })), - request: "./index", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #11", - expect: Some(vec!["./foo.js"]), - exports_field: exports_field(json!({ - "./": "./", - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #12", - expect: Some(vec!["./foo/bar/baz.js"]), - exports_field: exports_field(json!({ - "./": "./", - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo/bar/baz.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #13", - expect: Some(vec!["./foo/bar/baz.js"]), - exports_field: exports_field(json!({ - "./": "./", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo/bar/baz.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #14", - expect: Some(vec!["./foo/bar/baz.js"]), - exports_field: exports_field(json!({ - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo/bar/baz.js", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #1", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "require": "./require.js" - }, { - "import": "./import.mjs" - }] - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #2", - expect: Some(vec!["./import.mjs"]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "require": "./require.js" - }, { - "import": "./import.mjs" - }] - })), - request: ".", - condition_names: vec!["import"], - }, - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./require.js"]), - exports_field: exports_field(json!({ - ".": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./import.mjs"]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "import": "./import.mjs" - }] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./require.js"]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "require": [ - "./require.js" - ] - }, { - "import": [ - "./import.mjs", - "./import.js" - ] - }] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./import.mjs"]), - exports_field: exports_field(json!({ - ".": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "./import.mjs", - "./import.js" - ] - } - ] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./import.js"]), - exports_field: exports_field(json!({ - ".": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "./import.js" - ] - } - ] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "mapping to a folder root #1", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./timezones": "./data/timezones/" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #2", - expect: None, - exports_field: exports_field(json!({ - "./timezones/": "./data/timezones" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #3", - expect: Some(vec!["./data/timezones/pdt/index.mjs"]), - exports_field: exports_field(json!({ - "./timezones/pdt/": "./data/timezones/pdt/" - })), - request: "./timezones/pdt/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #3 (wildcard)", - expect: Some(vec!["./data/timezones/pdt/index.mjs"]), - exports_field: exports_field(json!({ - "./timezones/pdt/*": "./data/timezones/pdt/*" - })), - request: "./timezones/pdt/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #4", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./": "./timezones/" - })), - request: "./pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #4 (wildcard)", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./*": "./timezones/*" - })), - request: "./pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #5", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./": "./" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #5 (wildcard)", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./*": "./*" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #6", - expect: None, - exports_field: exports_field(json!({ - "./": "." - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #6 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "./*": "." - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #7", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": "./" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #7 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": "./*" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #1", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./": "./", - "./dist/": "./lib/" - })), - request: "./dist/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #1 (wildcard)", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./*": "./*", - "./dist/*": "./lib/*" - })), - request: "./dist/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #2", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/": "./dist/utils/", - "./dist/": "./lib/" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #2 (wildcard)", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/*": "./dist/utils/*", - "./dist/*": "./lib/*" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #3", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/index.js": "./dist/utils/index.js", - "./dist/utils/": "./dist/utils/index.mjs", - "./dist/": "./lib/" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #3 (wildcard)", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/index.js": "./dist/utils/index.js", - "./dist/utils/*": "./dist/utils/index.mjs", - "./dist/*": "./lib/*" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #4", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./": { - "browser": "./browser/" - }, - "./dist/": "./lib/" - })), - request: "./dist/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "the longest matching path prefix is prioritized #4 (wildcard)", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./*": { - "browser": "./browser/*" - }, - "./dist/*": "./lib/*" - })), - request: "./dist/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #1", - // `lodash/` does not start with './' so fallbacks to util - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "conditional mapping folder #1", - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": [ - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #1 (wildcard)", - // `lodash/` does not start with './' so fallbacks to util - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": [ - "lodash/*", - "./utils/*" - ], - "node": [ - "./utils-node/*" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "conditional mapping folder #1 (wildcard)", - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": [ - "./utils/*" - ], - "node": [ - "./utils-node/*" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #2", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./node/" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "conditional mapping folder #2 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "webpack": "./wpk/*", - "browser": [ - "lodash/*", - "./utils/*" - ], - "node": [ - "./node/*" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "conditional mapping folder #3", - expect: Some(vec!["./wpk/index.mjs"]), - exports_field: exports_field(json!({ - "./utils/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils/" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "conditional mapping folder #3 (wildcard)", - expect: Some(vec!["./wpk/index.mjs"]), - exports_field: exports_field(json!({ - "./utils/*": { - "webpack": "./wpk/*", - "browser": [ - "lodash/*", - "./utils/*" - ], - "node": [ - "./utils/*" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "incorrect exports field #1", - expect: None, - exports_field: exports_field(json!({ - "/utils/": "./a/" - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #2", - expect: None, - exports_field: exports_field(json!({ - "./utils/": "/a/" - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #3", - expect: None, - exports_field: exports_field(json!({ - "/utils/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #4", - expect: None, - exports_field: exports_field(json!({ - "./utils/": { - "browser": "/a/", - "default": "/b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #4 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "/a/", - "default": "/b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #5", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index": "./a/index.js" - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index.mjs": "./a/index.js" - })), - request: "./utils/index", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #7", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #8", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index.mjs": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - // Requests that are not `./` does not apply to `package_exports_resolve` - // TestCase { - // name: "incorrect request #1", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": "./a/" - // })), - // request: "/utils/index.mjs", - // condition_names: vec![], - // }, - // TestCase { - // name: "incorrect request #2", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": { - // "browser": "./a/", - // "default": "./b/" - // } - // })), - // request: "/utils/index.mjs", - // condition_names: vec!["browser"], - // }, - // TestCase { - // name: "incorrect request #3", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": { - // "browser": "./a/", - // "default": "./b/" - // } - // })), - // request: "../utils/index.mjs", - // condition_names: vec!["browser"], - // }, - // TestCase { - // name: "incorrect request #4", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": { - // "browser": "./a/", - // "default": "./b/" - // } - // })), - // request: "/utils/index.mjs/", - // condition_names: vec!["browser"], - // }, - TestCase { - name: "backtracking package base #1", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./../../utils/": "./dist/" - })), - request: "./../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #1 (wildcard)", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./../../utils/*": "./dist/*" - })), - request: "./../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #2", - expect: None, - exports_field: exports_field(json!({ - "../../utils/": "./dist/" - })), - request: "../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #2 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "../../utils/*": "./dist/*" - })), - request: "../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #3", - expect: None, - exports_field: exports_field(json!({ - "./utils/": "../src/" - })), - request: "./utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #3 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "./utils/*": "../src/*" - })), - request: "./utils/index", - condition_names: vec![], - }, - // enhanced-resolve does not handle backtracking here - // TestCase { - // name: "backtracking package base #4", - // expect: Some(vec!["./../src/index"]), - // exports_field: exports_field(json!({ - // "./utils/": "./../src/" - // })), - // request: "./utils/index", - // condition_names: vec![], - // }, - // TestCase { - // name: "backtracking package base #4 (wildcard)", - // expect: Some(vec!["./../src/index"]), - // exports_field: exports_field(json!({ - // "./utils/*": "./../src/*" - // })), - // request: "./utils/index", - // condition_names: vec![], - // }, - // TestCase { - // name: "backtracking package base #5", - // expect: Some(vec!["./src/../index.js"]), - // exports_field: exports_field(json!({ - // "./utils/index": "./src/../index.js" - // })), - // request: "./utils/index", - // condition_names: vec![], - // }, - TestCase { - name: "backtracking package base #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/../utils/index": "./src/../index.js" - })), - request: "./utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #7", - expect: None, - exports_field: exports_field(json!({ - "./utils/": { - "browser": "../this/" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #7", - expect: None, - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "../this/*" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #8", - // We throw "InvalidPackageTarget" - // expect: Some(vec!["./utils/../index"]), - expect: None, - exports_field: exports_field(json!({ - "./utils/": { - "browser": "./utils/../" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #8 (wildcard)", - // We throw "InvalidPackageTarget" - // expect: Some(vec!["./utils/../index"]), - expect: None, - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "./utils/../*" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #9", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./": "./src/../../", - "./dist/": "./dist/" - })), - request: "./dist/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #9 (wildcard)", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./*": "./src/../../*", - "./dist/*": "./dist/*" - })), - request: "./dist/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking target folder #1", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../../index"]), - exports_field: exports_field(json!({ - "./utils/": "./dist/" - })), - request: "./utils/timezone/../../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #1 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../../index"]), - exports_field: exports_field(json!({ - "./utils/*": "./dist/*" - })), - request: "./utils/timezone/../../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #2", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../index"]), - exports_field: exports_field(json!({ - "./utils/": "./dist/" - })), - request: "./utils/timezone/../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #2 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../index"]), - exports_field: exports_field(json!({ - "./utils/*": "./dist/*" - })), - request: "./utils/timezone/../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #3", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/target/../../index"]), - exports_field: exports_field(json!({ - "./utils/": "./dist/target/" - })), - request: "./utils/../../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #3 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/target/../../index"]), - exports_field: exports_field(json!({ - "./utils/*": "./dist/target/*" - })), - request: "./utils/../../index", - condition_names: vec![], - }, - // enhanced-resolve does not handle `node_modules` in target - TestCase { - name: "nested node_modules path #1", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": "./node_modules/" - } - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #1 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "./node_modules/*" - } - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #2", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./utils/../node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/": "./utils/../node_modules/" - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "nested node_modules path #2 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./utils/../node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": "./utils/../node_modules/*" - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "nested mapping #1", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": "./", - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested mapping #1 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": "./*", - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "nested mapping #2 (wildcard)", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #2 (wildcard)", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "nested mapping #3", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["webpack"], - }, - TestCase { - name: "nested mapping #3 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["webpack"], - }, - TestCase { - name: "nested mapping #4", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["node", "browser"], - }, - TestCase { - name: "nested mapping #4 (wildcard)", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["node", "browser"], - }, - TestCase { - name: "nested mapping #5", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node"], - }, - TestCase { - name: "nested mapping #5 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": { - "webpack": [ - "./wpck/*" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node"], - }, - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - TestCase { - name: "nested mapping #6 (wildcard)", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": { - "webpack": [ - "./wpck/*" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #6 (wildcard)", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./node/*" - ], - "default": { - "node": { - "webpack": [ - "./wpck/*" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - TestCase { - name: "nested mapping #7", - expect: Some(vec!["./y.js"]), - exports_field: exports_field(json!({ - "./a.js": { - "abc": { - "def": "./x.js" - }, - "ghi": "./y.js" - } - })), - request: "./a.js", - condition_names: vec!["abc", "ghi"], - }, - TestCase { - name: "nested mapping #8", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./a.js": { - "abc": { - "def": "./x.js", - "default": [] - }, - "ghi": "./y.js" - } - })), - request: "./a.js", - condition_names: vec!["abc", "ghi"], - }, - TestCase { - name: "syntax sugar #1", - expect: Some(vec!["./main.js"]), - exports_field: exports_field(json!("./main.js")), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #2", - expect: Some(vec![]), - exports_field: exports_field(json!("./main.js")), - request: "./lib.js", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #3", - expect: Some(vec!["./a.js"]), - exports_field: exports_field(json!(["./a.js", "./b.js"])), - request: ".", - condition_names: vec![], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "syntax sugar #3", - expect: Some(vec!["./b.js"]), - exports_field: exports_field(json!(["./b.js"])), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #4", - expect: Some(vec![]), - exports_field: exports_field(json!(["./a.js", "./b.js"])), - request: "./lib.js", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #5", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "browser": { - "default": "./index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "syntax sugar #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "browser": { - "default": "./index.js" - } - })), - request: "./lib.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "syntax sugar #7", - expect: None, - exports_field: exports_field(json!({ - "./node": "./node.js", - "browser": { - "default": "./index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "syntax sugar #8", - expect: None, - exports_field: exports_field(json!({ - "browser": { - "default": "./index.js" - }, - "./node": "./node.js" - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #1", - expect: Some(vec!["./abc/d"]), - exports_field: exports_field(json!({ - "./ab*": "./ab/*", - "./abc*": "./abc/*", - "./a*": "./a/*" - })), - request: "./abcd", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #2", - expect: Some(vec!["./abc/d/e"]), - exports_field: exports_field(json!({ - "./ab*": "./ab/*", - "./abc*": "./abc/*", - "./a*": "./a/*" - })), - request: "./abcd/e", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #3", - expect: Some(vec!["./abc/d"]), - exports_field: exports_field(json!({ - "./x/ab*": "./ab/*", - "./x/abc*": "./abc/*", - "./x/a*": "./a/*" - })), - request: "./x/abcd", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #4", - expect: Some(vec!["./abc/d/e"]), - exports_field: exports_field(json!({ - "./x/ab*": "./ab/*", - "./x/abc*": "./abc/*", - "./x/a*": "./a/*" - })), - request: "./x/abcd/e", - condition_names: vec!["browser"], - }, - TestCase { - name: "path tree edge case #1", - expect: Some(vec!["./A/b/d.js"]), - exports_field: exports_field(json!({ - "./a/": "./A/", - "./a/b/c": "./c.js" - })), - request: "./a/b/d.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #1 (wildcard)", - expect: Some(vec!["./A/b/d.js"]), - exports_field: exports_field(json!({ - "./a/*": "./A/*", - "./a/b/c": "./c.js" - })), - request: "./a/b/d.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #2", - expect: Some(vec!["./A/c.js"]), - exports_field: exports_field(json!({ - "./a/": "./A/", - "./a/b": "./b.js" - })), - request: "./a/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #2 (wildcard)", - expect: Some(vec!["./A/c.js"]), - exports_field: exports_field(json!({ - "./a/*": "./A/*", - "./a/b": "./b.js" - })), - request: "./a/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #3", - expect: Some(vec!["./A/b/d/c.js"]), - exports_field: exports_field(json!({ - "./a/": "./A/", - "./a/b/c/d": "./c.js" - })), - request: "./a/b/d/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #3 (wildcard)", - expect: Some(vec!["./A/b/d/c.js"]), - exports_field: exports_field(json!({ - "./a/*": "./A/*", - "./a/b/c/d": "./c.js" - })), - request: "./a/b/d/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #1", - expect: Some(vec!["./A/b.js"]), - exports_field: exports_field(json!({ - "./a/*.js": "./A/*.js" - })), - request: "./a/b.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #2", - expect: Some(vec!["./A/b/c.js"]), - exports_field: exports_field(json!({ - "./a/*.js": "./A/*.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #3", - expect: Some(vec!["./A/b/c.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": "./A/*/c.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #4", - expect: Some(vec!["./A/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": "./A/*/*.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #5", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/*.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #5", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/*.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./lib/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #6", - expect: Some(vec!["./browser/foo/bar.js"]), - exports_field: exports_field(json!({ - "./lib/*/bar.js": { - "browser": [ - "./browser/*/bar.js" - ] - }, - "./dist/*/bar.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./lib/foo/bar.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #6", - expect: Some(vec!["./browser/foo.js"]), - exports_field: exports_field(json!({ - "./lib/*/bar.js": { - "browser": [ - "./browser/*/bar.js" - ] - }, - "./dist/*/bar.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./dist/foo/bar.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #7", - expect: Some(vec!["./browser/foo/default.js"]), - exports_field: exports_field(json!({ - "./lib/*/bar.js": { - "browser": [ - "./browser/*/bar.js" - ] - }, - "./dist/*/bar.js": { - "node": "./*.js", - "default": "./browser/*/default.js" - } - })), - request: "./dist/foo/bar.js", - condition_names: vec!["default"], - }, - TestCase { - name: "wildcard pattern #8", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": "./A/*/*/*.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #9", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": [ - "./A/*/*/*.js", - "./B/*/*/*.js" - ] - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "wildcard pattern #9", - expect: Some(vec!["./B/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": [ - "./B/*/*/*.js" - ] - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #10", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/foo-*/c.js": "./A/*/*/*.js" - })), - request: "./a/foo-b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #11", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*-foo/c.js": "./A/*/*/*.js" - })), - request: "./a/b-foo/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #12", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/foo-*-foo/c.js": "./A/*/*/*.js" - })), - request: "./a/foo-b-foo/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #13", - expect: Some(vec!["./A/b/c/d.js"]), - exports_field: exports_field(json!({ - "./a/foo-*-foo/c.js": "./A/b/c/d.js" - })), - request: "./a/foo-b-foo/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #14", - expect: Some(vec!["./A/b/c/*.js"]), - exports_field: exports_field(json!({ - "./a/foo-foo/c.js": "./A/b/c/*.js" - })), - request: "./a/foo-foo/c.js", - condition_names: vec![], - }, - ]; - - for case in test_cases { - let resolved = Resolver::new(ResolveOptions { - condition_names: case - .condition_names - .iter() - .map(ToString::to_string) - .collect::>(), - ..ResolveOptions::default() - }) - .package_exports_resolve( - Path::new(""), - case.request, - &case.exports_field, - &mut Ctx::default(), - ) - .map(|p| p.map(|p| p.to_path_buf())); - if let Some(expect) = case.expect { - if expect.is_empty() { - assert!( - matches!(resolved, Err(ResolveError::PackagePathNotExported(_, _))), - "{} {:?}", - &case.name, - &resolved - ); - } else { - for expect in expect { - assert_eq!(resolved, Ok(Some(Path::new(expect).normalize())), "{}", &case.name); - } - } - } else { - assert!(resolved.is_err(), "{} {resolved:?}", &case.name); - } - } -} diff --git a/src/tests/extension_alias.rs b/src/tests/extension_alias.rs deleted file mode 100644 index 86afab73..00000000 --- a/src/tests/extension_alias.rs +++ /dev/null @@ -1,66 +0,0 @@ -//! - -use crate::{ResolveError, ResolveOptions, Resolver}; - -#[test] -fn extension_alias() { - let f = super::fixture().join("extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - extension_alias: vec![ - (".js".into(), vec![".ts".into(), ".js".into()]), - (".mjs".into(), vec![".mts".into()]), - ], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should alias fully specified file", f.clone(), "./index.js", f.join("index.ts")), - ("should alias fully specified file when there are two alternatives", f.clone(), "./dir/index.js", f.join("dir/index.ts")), - ("should also allow the second alternative", f.clone(), "./dir2/index.js", f.join("dir2/index.js")), - ("should support alias option without an array", f.clone(), "./dir2/index.mjs", f.join("dir2/index.mts")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } - - #[rustfmt::skip] - let fail = [ - ("should not allow to fallback to the original extension or add extensions", f, "./index.mjs"), - ]; - - for (comment, path, request) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!(resolution, Err(ResolveError::ExtensionAlias), "{comment} {path:?} {request}"); - } -} - -// should not apply extension alias to extensions or mainFiles field -#[test] -fn not_apply_to_extension_nor_main_files() { - let f = super::fixture().join("extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - extension_alias: vec![(".js".into(), vec![])], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("directory", f.clone(), "./dir2", "dir2/index.js"), - ("file", f.clone(), "./dir2/index", "dir2/index.js"), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - let expected = f.join(expected); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} diff --git a/src/tests/extensions.rs b/src/tests/extensions.rs deleted file mode 100644 index 1ebd86f4..00000000 --- a/src/tests/extensions.rs +++ /dev/null @@ -1,125 +0,0 @@ -//! - -use crate::{EnforceExtension, Resolution, ResolveContext, ResolveError, ResolveOptions, Resolver}; -use rustc_hash::FxHashSet; - -#[test] -fn extensions() { - let f = super::fixture().join("extensions"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".ts".into(), ".js".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve according to order of provided extensions", "./foo", "foo.ts"), - ("should resolve according to order of provided extensions (dir index)", "./dir", "dir/index.ts"), - ("should resolve according to main field in module root", ".", "index.js"), - // This is a core module - // ("should resolve single file module before directory", "module", "node_modules/module.js"), - ("should resolve trailing slash directory before single file", "module/", "node_modules/module/index.ts"), - ]; - - for (comment, request, expected_path) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - let expected = f.join(expected_path); - assert_eq!(resolved_path, Ok(expected), "{comment} {request} {expected_path}"); - } - - #[rustfmt::skip] - let fail = [ - ("not resolve to file when request has a trailing slash (relative)", "./foo.js/", "./foo.js/".into()) - ]; - - for (comment, request, expected_error) in fail { - let resolution = resolver.resolve(&f, request); - let error = ResolveError::NotFound(expected_error); - assert_eq!(resolution, Err(error), "{comment} {request} {resolution:?}"); - } -} - -// should default enforceExtension to true when extensions includes an empty string -#[test] -fn default_enforce_extension() { - let f = super::fixture().join("extensions"); - - let mut ctx = ResolveContext::default(); - let resolved = Resolver::new(ResolveOptions { - extensions: vec![".ts".into(), String::new(), ".js".into()], - ..ResolveOptions::default() - }) - .resolve_with_context(&f, "./foo", &mut ctx); - - assert_eq!(resolved.map(Resolution::into_path_buf), Ok(f.join("foo.ts"))); - assert_eq!( - ctx.file_dependencies, - FxHashSet::from_iter([f.join("foo.ts"), f.join("package.json")]) - ); - assert!(ctx.missing_dependencies.is_empty()); -} - -// should respect enforceExtension when extensions includes an empty string -#[test] -fn respect_enforce_extension() { - let f = super::fixture().join("extensions"); - - let mut ctx = ResolveContext::default(); - let resolved = Resolver::new(ResolveOptions { - enforce_extension: EnforceExtension::Disabled, - extensions: vec![".ts".into(), String::new(), ".js".into()], - ..ResolveOptions::default() - }) - .resolve_with_context(&f, "./foo", &mut ctx); - - assert_eq!(resolved.map(Resolution::into_path_buf), Ok(f.join("foo.ts"))); - assert_eq!( - ctx.file_dependencies, - FxHashSet::from_iter([f.join("foo.ts"), f.join("package.json")]) - ); - assert_eq!(ctx.missing_dependencies, FxHashSet::from_iter([f.join("foo")])); -} - -#[test] -fn multi_dot_extension() { - let f = super::fixture().join("extensions"); - - let resolver = Resolver::new(ResolveOptions { - // Test for `.d.ts`, not part of enhanced-resolve. - extensions: vec![".a.b.c".into(), ".d.ts".into(), ".ts".into(), ".js".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve according to order of provided extensions", "./foo", "foo.ts"), - ("should resolve file with extension", "./app.module", "app.module.js") - ]; - - for (comment, request, expected_path) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - let expected = f.join(expected_path); - assert_eq!(resolved_path, Ok(expected), "{comment} {request} {expected_path}"); - } - - #[rustfmt::skip] - let fail = [ - ("not resolve to file", "./index.", "./index.".into()) - ]; - - for (comment, request, expected_error) in fail { - let resolution = resolver.resolve(&f, request); - let error = ResolveError::NotFound(expected_error); - assert_eq!(resolution, Err(error), "{comment} {request} {resolution:?}"); - } -} - -#[test] -#[should_panic = "All extensions must start with a leading dot"] -fn without_leading_dot() { - Resolver::new(ResolveOptions { - extensions: vec!["ts".into(), "js".into()], - ..ResolveOptions::default() - }); -} diff --git a/src/tests/fallback.rs b/src/tests/fallback.rs deleted file mode 100644 index 3da2d767..00000000 --- a/src/tests/fallback.rs +++ /dev/null @@ -1,100 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/fallback.test.js - -#[test] -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -fn fallback() { - use super::memory_fs::MemoryFS; - use crate::{AliasValue, ResolveError, ResolveOptions, ResolverGeneric}; - use std::path::{Path, PathBuf}; - - let f = Path::new("/"); - - let file_system = MemoryFS::new(&[ - ("/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", ""), - ]); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - fallback: vec![ - ("aliasA".into(), vec![AliasValue::Path("a".into())]), - ("b$".into(), vec![AliasValue::Path("a/index".into())]), - ("c$".into(), vec![AliasValue::Path("/a/index".into())]), - ( - "multiAlias".into(), - vec![ - AliasValue::Path("b".into()), - AliasValue::Path("c".into()), - AliasValue::Path("d".into()), - AliasValue::Path("e".into()), - AliasValue::Path("a".into()), - ], - ), - ("recursive".into(), vec![AliasValue::Path("recursive/dir".into())]), - ("/d/dir".into(), vec![AliasValue::Path("/c/dir".into())]), - ("/d/index.js".into(), vec![AliasValue::Path("/c/index".into())]), - ("ignored".into(), vec![AliasValue::Ignore]), - ("node:path".into(), vec![AliasValue::Ignore]), - ], - modules: vec!["/".into()], - ..ResolveOptions::default() - }, - ); - - #[rustfmt::skip] - let pass = [ - ("should resolve a not aliased module 1", "a", "/a/index"), - ("should resolve a not aliased module 2", "a/index", "/a/index"), - ("should resolve a not aliased module 3", "a/dir", "/a/dir/index"), - ("should resolve a not aliased module 4", "a/dir/index", "/a/dir/index"), - ("should resolve an fallback module 1", "aliasA", "/a/index"), - ("should resolve an fallback module 2", "aliasA/index", "/a/index"), - ("should resolve an fallback module 3", "aliasA/dir", "/a/dir/index"), - ("should resolve an fallback module 4", "aliasA/dir/index", "/a/dir/index"), - ("should resolve a recursive aliased module 1", "recursive", "/recursive/index"), - ("should resolve a recursive aliased module 2", "recursive/index", "/recursive/index"), - ("should resolve a recursive aliased module 3", "recursive/dir", "/recursive/dir/index"), - ("should resolve a recursive aliased module 4", "recursive/dir/index", "/recursive/dir/index"), - ("should resolve a recursive aliased module 5", "recursive/file", "/recursive/dir/file"), - ("should resolve a file aliased module with a query 1", "b?query", "/b/index?query"), - ("should resolve a file aliased module with a query 2", "c?query", "/c/index?query"), - ("should resolve a path in a file aliased module 1", "b/index", "/b/index"), - ("should resolve a path in a file aliased module 2", "b/dir", "/b/dir/index"), - ("should resolve a path in a file aliased module 3", "b/dir/index", "/b/dir/index"), - ("should resolve a path in a file aliased module 4", "c/index", "/c/index"), - ("should resolve a path in a file aliased module 5", "c/dir", "/c/dir/index"), - ("should resolve a path in a file aliased module 6", "c/dir/index", "/c/dir/index"), - ("should resolve a file in multiple aliased dirs 1", "multiAlias/dir/file", "/e/dir/file"), - ("should resolve a file in multiple aliased dirs 2", "multiAlias/anotherDir", "/e/anotherDir/index"), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - - #[rustfmt::skip] - let ignore = [ - ("should resolve an ignore module", "ignored", ResolveError::Ignored(f.join("ignored"))), - ("should resolve node: builtin module", "node:path", ResolveError::Ignored(PathBuf::from("/node:path"))), - ]; - - for (comment, request, expected) in ignore { - let resolution = resolver.resolve(f, request); - assert_eq!(resolution, Err(expected), "{comment} {request}"); - } -} diff --git a/src/tests/full_specified.rs b/src/tests/full_specified.rs deleted file mode 100644 index a70c0191..00000000 --- a/src/tests/full_specified.rs +++ /dev/null @@ -1,113 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/fullSpecified.test.js - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows { - use std::path::PathBuf; - - use crate::{AliasValue, ResolveOptions, ResolverGeneric}; - - use super::super::memory_fs::MemoryFS; - - fn file_system() -> MemoryFS { - MemoryFS::new(&[ - ("/a/node_modules/package1/index.js", ""), - ("/a/node_modules/package1/file.js", ""), - ("/a/node_modules/package2/package.json", r#"{"main":"a"}"#), - ("/a/node_modules/package2/a.js", ""), - ("/a/node_modules/package3/package.json", r#"{"main":"dir"}"#), - ("/a/node_modules/package3/dir/index.js", ""), - ("/a/node_modules/package4/package.json", r#"{"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", ""), - ]) - } - - #[test] - fn test() { - let file_system = file_system(); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - alias: vec![ - ("alias1".into(), vec![AliasValue::from("/a/abc")]), - ("alias2".into(), vec![AliasValue::from("/a")]), - ], - alias_fields: vec![vec!["browser".into()]], - fully_specified: true, - ..ResolveOptions::default() - }, - ); - - let failing_resolves = [ - ("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"), - ]; - - for (comment, request) in failing_resolves { - let resolution = resolver.resolve("/a", request); - assert!(resolution.is_err(), "{comment} {request}"); - } - - let successful_resolves = [ - ("fully relative", "./abc.js", "/a/abc.js"), - ("fully absolute", "/a/abc.js", "/a/abc.js"), - ("fully relative in package", "package1/file.js", "/a/node_modules/package1/file.js"), - ("extensions in mainFiles", "package1", "/a/node_modules/package1/index.js"), - ("extensions in mainFields", "package2", "/a/node_modules/package2/a.js"), - ("extensions in alias", "alias1", "/a/abc.js"), - ("directories in alias", "alias2", "/a/index.js"), - ("directories in packages", "package3", "/a/node_modules/package3/dir/index.js"), - ("extensions in aliasFields", "package4/a.js", "/a/node_modules/package4/b.js"), - ]; - - for (comment, request, expected) in successful_resolves { - let resolution = resolver.resolve("/a", request).map(|r| r.full_path()); - assert_eq!(resolution, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - } - - #[test] - #[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. - fn resolve_to_context() { - let file_system = file_system(); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - alias: vec![ - ("alias1".into(), vec![AliasValue::from("/a/abc")]), - ("alias2".into(), vec![AliasValue::from("/a")]), - ], - alias_fields: vec![vec!["browser".into()]], - fully_specified: true, - resolve_to_context: true, - ..ResolveOptions::default() - }, - ); - - let successful_resolves = [ - ("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", "/a/node_modules/package3/dir"), - ]; - - for (comment, request, expected) in successful_resolves { - let resolution = resolver.resolve("/a", request).map(|r| r.full_path()); - assert_eq!(resolution, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - } -} diff --git a/src/tests/imports_field.rs b/src/tests/imports_field.rs deleted file mode 100644 index 9f9a9726..00000000 --- a/src/tests/imports_field.rs +++ /dev/null @@ -1,1320 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/importsField.test.js -//! -//! The huge imports field test cases are at the bottom of this file. - -use serde_json::json; - -use crate::{Ctx, JSONMap, PathUtil, ResolveError, ResolveOptions, Resolver}; -use std::path::Path; - -#[test] -fn test_simple() { - let f = super::fixture().join("imports-field"); - let f2 = super::fixture().join("imports-exports-wildcard/node_modules/m/"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve using imports field instead of self-referencing", f.clone(), "#imports-field", f.join("b.js")), - ("should resolve using imports field instead of self-referencing for a subpath", f.join("dir"), "#imports-field", f.join("b.js")), - ("should resolve package #1", f.clone(), "#a/dist/main.js", f.join("node_modules/a/lib/lib2/main.js")), - ("should resolve package #3", f.clone(), "#ccc/index.js", f.join("node_modules/c/index.js")), - ("should resolve package #4", f.clone(), "#c", f.join("node_modules/c/index.js")), - ("should resolve with wildcard pattern", f2.clone(), "#internal/i.js", f2.join("src/internal/i.js")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } - - // Note added: - // * should resolve absolute path as an imports field target - // * should log the correct info - - #[rustfmt::skip] - let fail = [ - ("should disallow resolve out of package scope", f.clone(), "#b", ResolveError::InvalidPackageTarget("../b.js".to_string(), "#b".to_string(), f.join("package.json"))), - ("should resolve package #2", f.clone(), "#a", ResolveError::PackageImportNotDefined("#a".to_string(), f.join("package.json"))), - ]; - - for (comment, path, request, error) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!(resolution, Err(error), "{comment} {path:?} {request}"); - } -} - -#[test] -fn shared_resolvers() { - let f = super::fixture().join("imports-field"); - - // field name #1 - let resolver1 = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - imports_fields: vec![vec!["imports".into()]], - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - let resolved_path = resolver1.resolve(&f, "#imports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("b.js"))); - - // field name #2 - let resolver2 = resolver1.clone_with_options(ResolveOptions { - imports_fields: vec![vec!["other".into(), "imports".into()]], - ..ResolveOptions::default() - }); - - let resolved_path = resolver2.resolve(&f, "#b").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("a.js"))); -} - -// Small script for generating the test cases from enhanced_resolve -// for (c of testCases) { -// console.log("TestCase {") -// console.log(`name: ${JSON.stringify(c.name)},`) -// if (c.expect instanceof Error) { -// console.log(`expect: None,`) -// } else { -// console.log(`expect: Some(vec!${JSON.stringify(c.expect)}),`) -// } -// console.log(`imports_field: imports_field(json!(${JSON.stringify(c.suite[0], null, 2)})),`) -// console.log(`request: "${c.suite[1]}",`) -// console.log(`condition_names: vec!${JSON.stringify(c.suite[2])},`) -// console.log("},") -// } - -struct TestCase { - name: &'static str, - expect: Option>, - imports_field: JSONMap, - request: &'static str, - condition_names: Vec<&'static str>, -} - -#[allow(clippy::needless_pass_by_value)] -fn imports_field(value: serde_json::Value) -> JSONMap { - let s = serde_json::to_string(&value).unwrap(); - serde_json::from_str(&s).unwrap() -} - -#[test] -fn test_cases() { - let test_cases = [ - TestCase { - name: "sample #1", - expect: Some(vec!["./dist/test/file.js"]), - imports_field: imports_field(json!({ - "#abc/": { - "import": [ - "./dist/", - "./src/" - ], - "webpack": "./wp/" - }, - "#abc": "./main.js" - })), - request: "#abc/test/file.js", - condition_names: vec!["import", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "sample #1", - expect: Some(vec!["./src/test/file.js"]), - imports_field: imports_field(json!({ - "#abc/": { - "import": [ - "./src/" - ], - "webpack": "./wp/" - }, - "#abc": "./main.js" - })), - request: "#abc/test/file.js", - condition_names: vec!["import", "webpack"], - }, - TestCase { - name: "sample #2", - expect: Some(vec!["./data/timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#1/timezones/": "./data/timezones/" - })), - request: "#1/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #3", - expect: Some(vec!["./data/timezones/timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#aaa/": "./data/timezones/", - "#a/": "./data/timezones/" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #4", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/lib/": { - "browser": [ - "./browser/" - ] - }, - "#a/dist/index.js": { - "node": "./index.js" - } - })), - request: "#a/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #5", - expect: Some(vec!["./browser/index.js"]), - imports_field: imports_field(json!({ - "#a/lib/": { - "browser": [ - "./browser/" - ] - }, - "#a/dist/index.js": { - "node": "./index.js", - "default": "./browser/index.js" - } - })), - request: "#a/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #6", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/dist/a": "./dist/index.js" - })), - request: "#a/dist/aaa", - condition_names: vec![], - }, - TestCase { - name: "sample #7", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/a/a/": "./dist/index.js" - })), - request: "#a/a/a", - condition_names: vec![], - }, - TestCase { - name: "sample #8", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": "./index.js" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #9", - expect: Some(vec!["./main.js"]), - imports_field: imports_field(json!({ - "#a/index.js": "./main.js" - })), - request: "#a/index.js", - condition_names: vec![], - }, - TestCase { - name: "sample #10", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #11", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/bar#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #12", - expect: Some(vec!["./ok.js#abc"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/ok.js#abc", - condition_names: vec![], - }, - TestCase { - name: "sample #13", - expect: Some(vec!["./ok.js?abc"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/ok.js?abc", - condition_names: vec![], - }, - TestCase { - name: "sample #14", - expect: Some(vec!["./🎉.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/🎉.js", - condition_names: vec![], - }, - TestCase { - name: "sample #15", - expect: Some(vec!["./%F0%9F%8E%89.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/%F0%9F%8E%89.js", - condition_names: vec![], - }, - TestCase { - name: "sample #16", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/🎉", - condition_names: vec![], - }, - TestCase { - name: "sample #17", - expect: Some(vec!["./other.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/%F0%9F%8E%89", - condition_names: vec![], - }, - TestCase { - name: "sample #18", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/module", - condition_names: vec![], - }, - TestCase { - name: "sample #19", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/module#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #20", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/module?foo", - condition_names: vec![], - }, - TestCase { - name: "sample #21", - expect: Some(vec!["./d?e?f"]), - imports_field: imports_field(json!({ - "#a/a?b?c/": "./" - })), - request: "#a/a?b?c/d?e?f", - condition_names: vec![], - }, - TestCase { - name: "sample #22", - // We throw InvalidPackageTarget - expect: None, - // expect: Some(vec!["/user/a/index"]), - imports_field: imports_field(json!({ - "#a/": "/user/a/" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #1", - expect: Some(vec!["./A/b/d.js"]), - imports_field: imports_field(json!({ - "#a/": "./A/", - "#a/b/c": "./c.js" - })), - request: "#a/b/d.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #2", - expect: Some(vec!["./A/c.js"]), - imports_field: imports_field(json!({ - "#a/": "./A/", - "#a/b": "./b.js" - })), - request: "#a/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #3", - expect: Some(vec!["./A/b/c/d.js"]), - imports_field: imports_field(json!({ - "#a/": "./A/", - "#a/b/c/d": "./c.js" - })), - request: "#a/b/c/d.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #1", - expect: Some(vec!["./dist/index.js"]), - imports_field: imports_field(json!({ - "#a": "./dist/index.js" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #2", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": "./" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #3", - expect: Some(vec!["./dist/a.js"]), - imports_field: imports_field(json!({ - "#a/": "./dist/", - "#a/index.js": "./dist/a.js" - })), - request: "#a/index.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #4", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "./browser/" - ] - }, - "#a/index.js": { - "browser": "./index.js" - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #5", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "./browser/" - ] - }, - "#a/index.js": { - "node": "./node.js" - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #6", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: "#a", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #7", - expect: None, - imports_field: imports_field(json!({ - "#a": { - "default": "./src/index.js", - "browser": "./index.js", - "node": "./src/node/index.js" - } - })), - request: "#a", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #8", - expect: Some(vec!["./src/index.js"]), - imports_field: imports_field(json!({ - "#a": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #9", - expect: Some(vec!["./index"]), - imports_field: imports_field(json!({ - "#a": "./index" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #10", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/index": "./index.js" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #11", - // We throw InvalidPackageTarget - // expect: Some(vec!["b"]), - expect: None, - imports_field: imports_field(json!({ - "#a": "b" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #12", - // We throw InvalidPackageTarget - // expect: Some(vec!["b/index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "b/" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #13", - // We throw InvalidPackageTarget - // expect: Some(vec!["b#anotherhashishere"]), - expect: None, - imports_field: imports_field(json!({ - "#a?q=a#hashishere": "b#anotherhashishere" - })), - request: "#a?q=a#hashishere", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #1", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #2", - expect: Some(vec!["./import.mjs"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec!["import"], - }, - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./require.js"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./import.mjs"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./require.js"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": [ - "./require.js" - ] - }, - { - "import": [ - "./import.mjs", - "#b/import.js" - ] - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./import.mjs"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "./import.mjs", - "#b/import.js" - ] - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "#b/import.js" - ] - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "mapping to a folder root #1", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#timezones": "./data/timezones/" - })), - request: "#timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #2", - expect: None, - imports_field: imports_field(json!({ - "#timezones/": "./data/timezones" - })), - request: "#timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #3", - expect: Some(vec!["./data/timezones/pdt/index.mjs"]), - imports_field: imports_field(json!({ - "#timezones/pdt/": "./data/timezones/pdt/" - })), - request: "#timezones/pdt/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #4", - expect: Some(vec!["./timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#a/": "./timezones/" - })), - request: "#a/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #5", - expect: Some(vec!["./timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#a/": "./" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #6", - expect: None, - imports_field: imports_field(json!({ - "#a/": "." - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #7", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": "./" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #1", - expect: Some(vec!["./lib/index.mjs"]), - imports_field: imports_field(json!({ - "#a/": "./", - "#a/dist/": "./lib/" - })), - request: "#a/dist/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #2", - expect: Some(vec!["./dist/utils/index.js"]), - imports_field: imports_field(json!({ - "#a/dist/utils/": "./dist/utils/", - "#a/dist/": "./lib/" - })), - request: "#a/dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #3", - expect: Some(vec!["./dist/utils/index.js"]), - imports_field: imports_field(json!({ - "#a/dist/utils/index.js": "./dist/utils/index.js", - "#a/dist/utils/": "./dist/utils/index.mjs", - "#a/dist/": "./lib/" - })), - request: "#a/dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #4", - expect: Some(vec!["./lib/index.mjs"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./browser/" - }, - "#a/dist/": "./lib/" - })), - request: "#a/dist/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #1", - // This behaves differently from enhanced_resolve, because `lodash/` is an an InvalidPackageConfig - // expect: Some(vec!["lodash/index.js"]), - expect: Some(vec!["./utils/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "conditional mapping folder #1", - expect: Some(vec!["./utils/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #2", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./node/" - ] - } - })), - request: "#a/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "conditional mapping folder #3", - expect: Some(vec!["./wpk/index.mjs"]), - imports_field: imports_field(json!({ - "#a/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils/" - ] - } - })), - request: "#a/index.mjs", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "incorrect exports field #1", - // We throw `PackageImportNotDefined` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "/utils/": "./a/" - })), - request: "#a/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #2", - // We throw `PackageImportNotDefined` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "/utils/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#a/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #3", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index": "./a/index.js" - })), - request: "#a/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #4", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index.mjs": "./a/index.js" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #5", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "#a/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #6", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index.mjs": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "#a/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #1", - // We don't throw in `package_imports_exports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": "./a/" - })), - request: "/utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect request #2", - // We don't throw in `package_imports_exports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #3", - // We don't throw in `package_imports_exports_resolve`, it's thrown in `package_imports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #4", - // We don't throw in `package_imports_exports_resolve`, it's thrown in `package_imports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#/", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #5", - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#a/", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #1", - // expect: Some(vec!["./dist/index"]), - expect: Some(vec!["dist/index"]), - imports_field: imports_field(json!({ - "#a/../../utils/": "./dist/" - })), - request: "#a/../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #2", - // We throw InvalidPackageTarget - // expect: Some(vec!["./dist/../../utils/index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "./dist/" - })), - request: "#a/../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #3", - // We throw InvalidPackageTarget - // expect: Some(vec!["../src/index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "../src/" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #4", - // We throw InvalidPackageTarget - // expect: Some(vec!["./utils/../../../index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": { - "browser": "./utils/../../../" - } - })), - request: "#a/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #1", - // expect: Some(vec!["moment/node_modules/lodash/dist/index.js"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": { - "browser": "moment/node_modules/" - } - })), - request: "#a/lodash/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #2", - // We throw InvalidPackageTarget - // expect: Some(vec!["../node_modules/lodash/dist/index.js"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "../node_modules/" - })), - request: "#a/lodash/dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "nested mapping #1", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": "./", - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./node/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "nested mapping #3", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["webpack"], - }, - TestCase { - name: "nested mapping #4", - // We throw NotFound - // expect: Some(vec!["moment/node/index.js"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "moment/node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["node", "browser"], - }, - TestCase { - name: "nested mapping #5", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "node"], - }, - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./node/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - TestCase { - name: "nested mapping #7", - expect: Some(vec!["./y.js"]), - imports_field: imports_field(json!({ - "#a": { - "abc": { - "def": "./x.js" - }, - "ghi": "./y.js" - } - })), - request: "#a", - condition_names: vec!["abc", "ghi"], - }, - TestCase { - name: "nested mapping #8", - // We throw PackageImportNotDefined - // expect: Some(vec![]), - expect: None, - imports_field: imports_field(json!({ - "#a": { - "abc": { - "def": "./x.js", - "default": [] - }, - "ghi": "./y.js" - } - })), - request: "#a", - condition_names: vec!["abc", "ghi"], - }, - ]; - - for case in test_cases { - let resolved = Resolver::default() - .package_imports_exports_resolve( - case.request, - &case.imports_field, - Path::new(""), - true, - &case.condition_names.iter().map(ToString::to_string).collect::>(), - &mut Ctx::default(), - ) - .map(|p| p.map(|p| p.to_path_buf())); - if let Some(expect) = case.expect { - if expect.is_empty() { - assert!(matches!(resolved, Ok(None)), "{} {:?}", &case.name, &resolved); - } else { - for expect in expect { - assert_eq!(resolved, Ok(Some(Path::new(expect).normalize())), "{}", &case.name); - } - } - } else { - assert!(resolved.is_err(), "{} {resolved:?}", &case.name); - } - } -} diff --git a/src/tests/incorrect_description_file.rs b/src/tests/incorrect_description_file.rs deleted file mode 100644 index a5c81796..00000000 --- a/src/tests/incorrect_description_file.rs +++ /dev/null @@ -1,62 +0,0 @@ -//! - -use rustc_hash::FxHashSet; - -use crate::{JSONError, Resolution, ResolveContext, ResolveError, ResolveOptions, Resolver}; - -// should not resolve main in incorrect description file #1 -#[test] -fn incorrect_description_file_1() { - let f = super::fixture().join("incorrect-package"); - let mut ctx = ResolveContext::default(); - let resolution = Resolver::default().resolve_with_context(f.join("pack1"), ".", &mut ctx); - let error = ResolveError::JSON(JSONError { - path: f.join("pack1/package.json"), - message: String::from("EOF while parsing a value at line 3 column 0"), - line: 3, - column: 0, - }); - assert_eq!(resolution, Err(error)); - assert_eq!(ctx.file_dependencies, FxHashSet::from_iter([f.join("pack1/package.json")])); - assert!(ctx.missing_dependencies.is_empty()); -} - -// should not resolve main in incorrect description file #2 -#[test] -fn incorrect_description_file_2() { - let f = super::fixture().join("incorrect-package"); - let resolution = Resolver::default().resolve(f.join("pack2"), "."); - let error = ResolveError::JSON(JSONError { - path: f.join("pack2/package.json"), - message: String::from("EOF while parsing a value at line 1 column 0"), - line: 1, - column: 0, - }); - assert_eq!(resolution, Err(error)); -} - -// should not resolve main in incorrect description file #3 -#[test] -fn incorrect_description_file_3() { - let f = super::fixture().join("incorrect-package"); - let resolution = Resolver::default().resolve(f.join("pack2"), "."); - assert!(resolution.is_err()); -} - -// `enhanced_resolve` does not have this test case -#[test] -fn no_description_file() { - let f = super::fixture_root().join("enhanced_resolve"); - - // has description file - let resolver = Resolver::default(); - assert_eq!( - resolver.resolve(&f, ".").map(Resolution::into_path_buf), - Ok(f.join("lib/index.js")) - ); - - // without description file - let resolver = - Resolver::new(ResolveOptions { description_files: vec![], ..ResolveOptions::default() }); - assert_eq!(resolver.resolve(&f, "."), Err(ResolveError::NotFound(".".into()))); -} diff --git a/src/tests/main_field.rs b/src/tests/main_field.rs deleted file mode 100644 index 3cadc8ce..00000000 --- a/src/tests/main_field.rs +++ /dev/null @@ -1,24 +0,0 @@ -//! Not part of enhanced_resolve's test suite - -use crate::{ResolveOptions, Resolver}; - -#[test] -fn test() { - let f = super::fixture().join("restrictions"); - - let resolver1 = Resolver::new(ResolveOptions { - main_fields: vec!["style".into()], - ..ResolveOptions::default() - }); - - let resolution = resolver1.resolve(&f, "pck2").map(|r| r.full_path()); - assert_eq!(resolution, Ok(f.join("node_modules/pck2/index.css"))); - - let resolver2 = resolver1.clone_with_options(ResolveOptions { - main_fields: vec!["module".into(), "main".into()], - ..ResolveOptions::default() - }); - - let resolution = resolver2.resolve(&f, "pck2").map(|r| r.full_path()); - assert_eq!(resolution, Ok(f.join("node_modules/pck2/module.js"))); -} diff --git a/src/tests/memory_fs.rs b/src/tests/memory_fs.rs deleted file mode 100644 index e4116609..00000000 --- a/src/tests/memory_fs.rs +++ /dev/null @@ -1,74 +0,0 @@ -use std::{ - io, - path::{Path, PathBuf}, -}; - -use crate::{FileMetadata, FileSystem}; - -#[derive(Default)] -pub struct MemoryFS { - fs: vfs::MemoryFS, -} - -impl MemoryFS { - /// # Panics - /// - /// * Fails to create directory - /// * Fails to write file - #[allow(dead_code)] - pub fn new(data: &[(&'static str, &'static str)]) -> Self { - let mut fs = Self { fs: vfs::MemoryFS::default() }; - for (path, content) in data { - fs.add_file(Path::new(path), content); - } - fs - } - - #[allow(dead_code)] - pub fn add_file(&mut self, path: &Path, content: &str) { - use vfs::FileSystem; - let fs = &mut self.fs; - // Create all parent directories - for path in path.ancestors().collect::>().iter().rev() { - let path = path.to_string_lossy(); - if !fs.exists(path.as_ref()).unwrap() { - fs.create_dir(path.as_ref()).unwrap(); - } - } - // Create file - let mut file = fs.create_file(path.to_string_lossy().as_ref()).unwrap(); - file.write_all(content.as_bytes()).unwrap(); - } -} - -impl FileSystem for MemoryFS { - fn read_to_string(&self, path: &Path) -> io::Result { - use vfs::FileSystem; - let mut file = self - .fs - .open_file(path.to_string_lossy().as_ref()) - .map_err(|err| io::Error::new(io::ErrorKind::NotFound, err))?; - let mut buffer = String::new(); - file.read_to_string(&mut buffer).unwrap(); - Ok(buffer) - } - - fn metadata(&self, path: &Path) -> io::Result { - use vfs::FileSystem; - let metadata = self - .fs - .metadata(path.to_string_lossy().as_ref()) - .map_err(|err| io::Error::new(io::ErrorKind::NotFound, err))?; - let is_file = metadata.file_type == vfs::VfsFileType::File; - let is_dir = metadata.file_type == vfs::VfsFileType::Directory; - Ok(FileMetadata::new(is_file, is_dir, false)) - } - - fn symlink_metadata(&self, path: &Path) -> io::Result { - self.metadata(path) - } - - fn canonicalize(&self, _path: &Path) -> io::Result { - Err(io::Error::new(io::ErrorKind::NotFound, "not a symlink")) - } -} diff --git a/src/tests/missing.rs b/src/tests/missing.rs deleted file mode 100644 index 4bf611ef..00000000 --- a/src/tests/missing.rs +++ /dev/null @@ -1,106 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/missing.test.js - -use normalize_path::NormalizePath; - -use crate::{AliasValue, ResolveContext, ResolveOptions, Resolver}; - -#[test] -fn test() { - let f = super::fixture(); - - let data = [ - ( - "./missing-file", - vec![f.join("missing-file"), f.join("missing-file.js"), f.join("missing-file.node")], - ), - ( - "missing-module", - vec![ - f.join("node_modules/missing-module"), - f.parent().unwrap().join("node_modules"), // enhanced-resolve is "node_modules/missing-module" - ], - ), - ( - "missing-module/missing-file", - vec![ - f.join("node_modules/missing-module"), - // f.parent().unwrap().join("node_modules/missing-module"), // we don't report this - ], - ), - ( - "m1/missing-file", - vec![ - f.join("node_modules/m1/missing-file"), - f.join("node_modules/m1/missing-file.js"), - f.join("node_modules/m1/missing-file.node"), - // f.parent().unwrap().join("node_modules/m1"), // we don't report this - ], - ), - ( - "m1/", - vec![ - f.join("node_modules/m1/index"), - f.join("node_modules/m1/index.js"), - f.join("node_modules/m1/index.json"), - f.join("node_modules/m1/index.node"), - ], - ), - ("m1/a", vec![f.join("node_modules/m1/a")]), - ]; - - let resolver = Resolver::default(); - - for (specifier, missing_dependencies) in data { - let mut ctx = ResolveContext::default(); - let _ = resolver.resolve_with_context(&f, specifier, &mut ctx); - - for path in ctx.file_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - } - - for path in missing_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - assert!( - ctx.missing_dependencies.contains(&path), - "{specifier}: {path:?} not in {:?}", - &ctx.missing_dependencies - ); - } - } -} - -#[test] -fn alias_and_extensions() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias: vec![ - ( - "@scope-js/package-name/dir$".into(), - vec![AliasValue::Path(f.join("foo/index.js").to_string_lossy().to_string())], - ), - ( - "react-dom".into(), - vec![AliasValue::Path(f.join("foo/index.js").to_string_lossy().to_string())], - ), - ], - extensions: vec![".server.ts".into()], - - ..ResolveOptions::default() - }); - - let mut ctx = ResolveContext::default(); - let _ = resolver.resolve_with_context(&f, "@scope-js/package-name/dir/router", &mut ctx); - let _ = resolver.resolve_with_context(&f, "react-dom/client", &mut ctx); - - for path in ctx.file_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - } - - for path in ctx.missing_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - if let Some(path) = path.parent() { - assert!(!path.is_file(), "{path:?} must not be a file"); - } - } -} diff --git a/src/tests/mod.rs b/src/tests/mod.rs deleted file mode 100644 index 94e6bd86..00000000 --- a/src/tests/mod.rs +++ /dev/null @@ -1,49 +0,0 @@ -mod alias; -mod browser_field; -mod builtins; -mod dependencies; -mod exports_field; -mod extension_alias; -mod extensions; -mod fallback; -mod full_specified; -mod imports_field; -mod incorrect_description_file; -mod main_field; -mod memory_fs; -mod missing; -mod resolve; -mod restrictions; -mod roots; -mod scoped_packages; -mod simple; -mod symlink; -mod tsconfig_paths; -mod tsconfig_project_references; - -use crate::Resolver; -use std::{env, path::PathBuf, sync::Arc, thread}; - -pub fn fixture_root() -> PathBuf { - env::current_dir().unwrap().join("fixtures") -} - -pub fn fixture() -> PathBuf { - fixture_root().join("enhanced_resolve").join("test").join("fixtures") -} - -#[test] -fn threaded_environment() { - let cwd = env::current_dir().unwrap(); - let resolver = Arc::new(Resolver::default()); - for _ in 0..2 { - _ = thread::spawn({ - let cwd = cwd.clone(); - let resolver = Arc::clone(&resolver); - move || { - _ = resolver.resolve(cwd, "."); - } - }) - .join(); - } -} diff --git a/src/tests/resolve.rs b/src/tests/resolve.rs deleted file mode 100644 index 72f1b784..00000000 --- a/src/tests/resolve.rs +++ /dev/null @@ -1,119 +0,0 @@ -//! - -use crate::{ResolveError, ResolveOptions, Resolver}; - -#[test] -fn resolve() { - let f = super::fixture(); - - let resolver = Resolver::default(); - - let main1_js_path = f.join("main1.js").to_string_lossy().to_string(); - - #[rustfmt::skip] - let pass = [ - ("absolute path", f.clone(), main1_js_path.as_str(), f.join("main1.js")), - ("file with .js", f.clone(), "./main1.js", f.join("main1.js")), - ("file without extension", f.clone(), "./main1", f.join("main1.js")), - ("another file with .js", f.clone(), "./a.js", f.join("a.js")), - ("another file without extension", f.clone(), "./a", f.join("a.js")), - ("file in module with .js", f.clone(), "m1/a.js", f.join("node_modules/m1/a.js")), - ("file in module without extension", f.clone(), "m1/a", f.join("node_modules/m1/a.js")), - ("another file in module without extension", f.clone(), "complexm/step1", f.join("node_modules/complexm/step1.js")), - ("from submodule to file in sibling module", f.join("node_modules/complexm"), "m2/b.js", f.join("node_modules/m2/b.js")), - ("from nested directory to overwritten file in module", f.join("multiple_modules"), "m1/a.js", f.join("multiple_modules/node_modules/m1/a.js")), - ("from nested directory to not overwritten file in module", f.join("multiple_modules"), "m1/b.js", f.join("node_modules/m1/b.js")), - ("file with query", f.clone(), "./main1.js?query", f.join("main1.js?query")), - ("file with fragment", f.clone(), "./main1.js#fragment", f.join("main1.js#fragment")), - ("file with fragment and query", f.clone(), "./main1.js#fragment?query", f.join("main1.js#fragment?query")), - ("file with query and fragment", f.clone(), "./main1.js?#fragment", f.join("main1.js?#fragment")), - - ("file with query (unicode)", f.clone(), "./测试.js?query", f.join("测试.js?query")), - ("file with fragment (unicode)", f.clone(), "./测试.js#fragment", f.join("测试.js#fragment")), - ("file with fragment and query (unicode)", f.clone(), "./测试.js#fragment?query", f.join("测试.js#fragment?query")), - ("file with query and fragment (unicode)", f.clone(), "./测试.js?#fragment", f.join("测试.js?#fragment")), - - ("file in module with query", f.clone(), "m1/a?query", f.join("node_modules/m1/a.js?query")), - ("file in module with fragment", f.clone(), "m1/a#fragment", f.join("node_modules/m1/a.js#fragment")), - ("file in module with fragment and query", f.clone(), "m1/a#fragment?query", f.join("node_modules/m1/a.js#fragment?query")), - ("file in module with query and fragment", f.clone(), "m1/a?#fragment", f.join("node_modules/m1/a.js?#fragment")), - ("file in module with query and fragment", f.clone(), "m1/a?#fragment", f.join("node_modules/m1/a.js?#fragment")), - ("differ between directory and file, resolve file", f.clone(), "./dirOrFile", f.join("dirOrFile.js")), - ("differ between directory and file, resolve directory", f.clone(), "./dirOrFile/", f.join("dirOrFile/index.js")), - ("find node_modules outside of node_modules", f.join("browser-module/node_modules"), "m1/a", f.join("node_modules/m1/a.js")), - ("don't crash on main field pointing to self", f.clone(), "./main-field-self", f.join("./main-field-self/index.js")), - ("don't crash on main field pointing to self (2)", f.clone(), "./main-field-self2", f.join("./main-field-self2/index.js")), - // enhanced-resolve has `#` prepended with a `\0`, they are removed from the - // following 3 expected test results. - // See https://github.com/webpack/enhanced-resolve#escaping - ("handle fragment edge case (no fragment)", f.clone(), "./no#fragment/#/#", f.join("no#fragment/#/#.js")), - ("handle fragment edge case (fragment)", f.clone(), "./no#fragment/#/", f.join("no.js#fragment/#/")), - ("handle fragment escaping", f.clone(), "./no\0#fragment/\0#/\0##fragment", f.join("no#fragment/#/#.js#fragment")), - - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn issue238_resolve() { - let f = super::fixture().join("issue-238"); - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into(), ".jsx".into(), ".ts".into(), ".tsx".into()], - modules: vec!["src/a".into(), "src/b".into(), "src/common".into(), "node_modules".into()], - ..ResolveOptions::default() - }); - let resolved_path = - resolver.resolve(f.join("src/common"), "config/myObjectFile").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("src/common/config/myObjectFile.js")),); -} - -#[test] -fn prefer_relative() { - let f = super::fixture(); - - let resolver = - Resolver::new(ResolveOptions { prefer_relative: true, ..ResolveOptions::default() }); - - #[rustfmt::skip] - let pass = [ - ("should correctly resolve with preferRelative 1", "main1.js", f.join("main1.js")), - ("should correctly resolve with preferRelative 2", "m1/a.js", f.join("node_modules/m1/a.js")), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } -} - -#[test] -fn resolve_to_context() { - let f = super::fixture(); - let resolver = - Resolver::new(ResolveOptions { resolve_to_context: true, ..ResolveOptions::default() }); - - #[rustfmt::skip] - let data = [ - ("context for fixtures", f.clone(), "./", f.clone()), - ("context for fixtures/lib", f.clone(), "./lib", f.join("lib")), - ("context for fixtures with ..", f.clone(), "./lib/../../fixtures/./lib/..", f.clone()), - ("context for fixtures with query", f.clone(), "./?query", f.clone().with_file_name("fixtures?query")), - ]; - - for (comment, path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn resolve_hash_as_module() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions::default()); - let resolution = resolver.resolve(&f, "#a"); - assert_eq!(resolution, Err(ResolveError::NotFound("#a".into()))); -} diff --git a/src/tests/restrictions.rs b/src/tests/restrictions.rs deleted file mode 100644 index b75811bf..00000000 --- a/src/tests/restrictions.rs +++ /dev/null @@ -1,25 +0,0 @@ -//! - -use crate::{ResolveError, ResolveOptions, Resolver, Restriction}; - -// TODO: regex -// * should respect RegExp restriction -// * should try to find alternative #1 -// * should try to find alternative #2 -// * should try to find alternative #3 - -// should respect string restriction -#[test] -fn restriction1() { - let fixture = super::fixture(); - let f = fixture.join("restrictions"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - restrictions: vec![Restriction::Path(f.clone())], - ..ResolveOptions::default() - }); - - let resolution = resolver.resolve(&f, "pck2"); - assert_eq!(resolution, Err(ResolveError::Restriction(fixture.join("c.js"), f.clone()))); -} diff --git a/src/tests/roots.rs b/src/tests/roots.rs deleted file mode 100644 index cc3b4895..00000000 --- a/src/tests/roots.rs +++ /dev/null @@ -1,89 +0,0 @@ -//! - -use std::path::PathBuf; - -use crate::{AliasValue, ResolveError, ResolveOptions, Resolver}; - -fn dirname() -> PathBuf { - super::fixture_root().join("enhanced_resolve").join("test") -} - -#[test] -fn roots() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - alias: vec![("foo".into(), vec![AliasValue::from("/fixtures")])], - roots: vec![dirname(), f.clone()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should respect roots option", "/fixtures/b.js", f.join("b.js")), - ("should try another root option, if it exists", "/b.js", f.join("b.js")), - ("should respect extension", "/fixtures/b", f.join("b.js")), - ("should resolve in directory", "/fixtures/extensions/dir", f.join("extensions/dir/index.js")), - ("should respect aliases", "foo/b", f.join("b.js")), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } - - #[rustfmt::skip] - let fail = [ - ("should not work with relative path", "fixtures/b.js", ResolveError::NotFound("fixtures/b.js".into())) - ]; - - for (comment, request, expected) in fail { - let resolution = resolver.resolve(&f, request); - assert_eq!(resolution, Err(expected), "{comment} {request}"); - } -} - -#[test] -fn resolve_to_context() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - roots: vec![dirname(), f.clone()], - resolve_to_context: true, - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f, "/fixtures/lib").map(|r| r.full_path()); - let expected = f.join("lib"); - assert_eq!(resolved_path, Ok(expected)); -} - -#[test] -fn prefer_absolute() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - alias: vec![("foo".into(), vec![AliasValue::from("/fixtures")])], - roots: vec![dirname(), f.clone()], - prefer_absolute: true, - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve an absolute path (prefer absolute)", f.join("b.js").to_string_lossy().to_string(), f.join("b.js")), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(&f, &request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } -} - -#[test] -fn roots_fall_through() { - let f = super::fixture(); - let absolute_path = f.join("roots_fall_through/index.js"); - let specifier = absolute_path.to_string_lossy(); - let resolution = Resolver::new(ResolveOptions::default().with_root(&f)).resolve(&f, &specifier); - assert_eq!(resolution.map(|r| r.into_path_buf()), Ok(absolute_path)); -} diff --git a/src/tests/scoped_packages.rs b/src/tests/scoped_packages.rs deleted file mode 100644 index 8258f00f..00000000 --- a/src/tests/scoped_packages.rs +++ /dev/null @@ -1,25 +0,0 @@ -//! - -use crate::{ResolveOptions, Resolver}; - -#[test] -fn scoped_packages() { - let f = super::fixture().join("scoped"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("main field should work", f.clone(), "@scope/pack1", f.join("./node_modules/@scope/pack1/main.js")), - ("browser field should work", f.clone(), "@scope/pack2", f.join("./node_modules/@scope/pack2/main.js")), - ("folder request should work", f.clone(), "@scope/pack2/lib", f.join("./node_modules/@scope/pack2/lib/index.js")) - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} diff --git a/src/tests/simple.rs b/src/tests/simple.rs deleted file mode 100644 index 08e1238a..00000000 --- a/src/tests/simple.rs +++ /dev/null @@ -1,68 +0,0 @@ -//! - -use std::env; - -use crate::Resolver; - -#[test] -fn simple() { - // mimic `enhanced-resolve/test/simple.test.js` - let dirname = env::current_dir().unwrap().join("fixtures"); - let f = dirname.join("enhanced_resolve/test"); - - let resolver = Resolver::default(); - - let data = [ - ("direct", f.clone(), "../lib/index"), - ("as directory", f, ".."), - ("as module", dirname.clone(), "./enhanced_resolve"), - ]; - - for (comment, path, request) in data { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - let expected = dirname.join("enhanced_resolve/lib/index.js"); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn dashed_name() { - let f = super::fixture(); - - let resolver = Resolver::default(); - - let data = [ - (f.clone(), "dash", f.join("node_modules/dash/index.js")), - (f.clone(), "dash-name", f.join("node_modules/dash-name/index.js")), - (f.join("node_modules/dash"), "dash", f.join("node_modules/dash/index.js")), - (f.join("node_modules/dash"), "dash-name", f.join("node_modules/dash-name/index.js")), - (f.join("node_modules/dash-name"), "dash", f.join("node_modules/dash/index.js")), - (f.join("node_modules/dash-name"), "dash-name", f.join("node_modules/dash-name/index.js")), - ]; - - for (path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{path:?} {request}"); - } -} - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows { - use super::super::memory_fs::MemoryFS; - - use crate::ResolveOptions; - - #[test] - fn no_package() { - use crate::ResolverGeneric; - use std::path::Path; - let f = Path::new("/"); - let file_system = MemoryFS::new(&[]); - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions::default(), - ); - let resolved_path = resolver.resolve(f, "package"); - assert!(resolved_path.is_err()); - } -} diff --git a/src/tests/symlink.rs b/src/tests/symlink.rs deleted file mode 100644 index 7589b560..00000000 --- a/src/tests/symlink.rs +++ /dev/null @@ -1,121 +0,0 @@ -use std::{fs, io, path::Path}; - -use crate::{ResolveOptions, Resolver}; - -#[derive(Debug, Clone, Copy)] -enum FileType { - File, - Dir, -} - -#[allow(unused_variables)] -fn symlink, Q: AsRef>( - original: P, - link: Q, - file_type: FileType, -) -> io::Result<()> { - #[cfg(target_family = "unix")] - { - std::os::unix::fs::symlink(original, link) - } - - #[cfg(target_family = "windows")] - match file_type { - FileType::File => std::os::windows::fs::symlink_file(original, link), - FileType::Dir => std::os::windows::fs::symlink_dir(original, link), - } -} - -fn init(dirname: &Path, temp_path: &Path) -> io::Result<()> { - if temp_path.exists() { - _ = fs::remove_dir_all(temp_path); - } - fs::create_dir(temp_path)?; - symlink(dirname.join("../lib/index.js"), temp_path.join("test"), FileType::File)?; - symlink(dirname.join("../lib"), temp_path.join("test2"), FileType::Dir)?; - fs::remove_file(temp_path.join("test"))?; - fs::remove_file(temp_path.join("test2"))?; - fs::remove_dir(temp_path) -} - -fn create_symlinks(dirname: &Path, temp_path: &Path) -> io::Result<()> { - fs::create_dir(temp_path).unwrap(); - symlink( - dirname.join("../lib/index.js").canonicalize().unwrap(), - temp_path.join("index.js"), - FileType::File, - )?; - symlink(dirname.join("../lib").canonicalize().unwrap(), temp_path.join("lib"), FileType::Dir)?; - symlink(dirname.join("..").canonicalize().unwrap(), temp_path.join("this"), FileType::Dir)?; - symlink(temp_path.join("this"), temp_path.join("that"), FileType::Dir)?; - symlink(Path::new("../../lib/index.js"), temp_path.join("node.relative.js"), FileType::File)?; - symlink( - Path::new("./node.relative.js"), - temp_path.join("node.relative.sym.js"), - FileType::File, - )?; - Ok(()) -} - -fn cleanup_symlinks(temp_path: &Path) { - _ = fs::remove_dir_all(temp_path); -} - -#[test] -fn test() -> io::Result<()> { - let root = super::fixture_root().join("enhanced_resolve"); - let dirname = root.join("test"); - let temp_path = dirname.join("temp"); - if !temp_path.exists() { - let is_admin = init(&dirname, &temp_path).is_ok(); - if !is_admin { - return Ok(()); - } - if let Err(err) = create_symlinks(&dirname, &temp_path) { - cleanup_symlinks(&temp_path); - return Err(err); - } - } - - let resolver_without_symlinks = - Resolver::new(ResolveOptions { symlinks: false, ..ResolveOptions::default() }); - let resolver_with_symlinks = Resolver::default(); - - #[rustfmt::skip] - let pass = [ - ("with a symlink to a file", temp_path.clone(), "./index.js"), - ("with a relative symlink to a file", temp_path.clone(), "./node.relative.js"), - ("with a relative symlink to a symlink to a file", temp_path.clone(), "./node.relative.sym.js"), - ("with a symlink to a directory 1", temp_path.clone(), "./lib/index.js"), - ("with a symlink to a directory 2", temp_path.clone(), "./this/lib/index.js"), - ("with multiple symlinks in the path 1", temp_path.clone(), "./this/test/temp/index.js"), - ("with multiple symlinks in the path 2", temp_path.clone(), "./this/test/temp/lib/index.js"), - ("with multiple symlinks in the path 3", temp_path.clone(), "./this/test/temp/this/lib/index.js"), - ("with a symlink to a directory 2 (chained)", temp_path.clone(), "./that/lib/index.js"), - ("with multiple symlinks in the path 1 (chained)", temp_path.clone(), "./that/test/temp/index.js"), - ("with multiple symlinks in the path 2 (chained)", temp_path.clone(), "./that/test/temp/lib/index.js"), - ("with multiple symlinks in the path 3 (chained)", temp_path.clone(), "./that/test/temp/that/lib/index.js"), - ("with symlinked directory as context 1", temp_path.join( "lib"), "./index.js"), - ("with symlinked directory as context 2", temp_path.join( "this"), "./lib/index.js"), - ("with symlinked directory as context and in path", temp_path.join( "this"), "./test/temp/lib/index.js"), - ("with symlinked directory in context path", temp_path.join( "this/lib"), "./index.js"), - ("with symlinked directory in context path and symlinked file", temp_path.join( "this/test"), "./temp/index.js"), - ("with symlinked directory in context path and symlinked directory", temp_path.join( "this/test"), "./temp/lib/index.js"), - ("with symlinked directory as context 2 (chained)", temp_path.join( "that"), "./lib/index.js"), - ("with symlinked directory as context and in path (chained)", temp_path.join( "that"), "./test/temp/lib/index.js"), - ("with symlinked directory in context path (chained)", temp_path.join( "that/lib"), "./index.js"), - ("with symlinked directory in context path and symlinked file (chained)", temp_path.join( "that/test"), "./temp/index.js"), - ("with symlinked directory in context path and symlinked directory (chained)", temp_path.join( "that/test"), "./temp/lib/index.js") - ]; - - for (comment, path, request) in pass { - let filename = resolver_with_symlinks.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(filename, Ok(root.join("lib/index.js")), "{comment:?}"); - - let resolved_path = - resolver_without_symlinks.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(path.join(request))); - } - - Ok(()) -} diff --git a/src/tests/tsconfig_paths.rs b/src/tests/tsconfig_paths.rs deleted file mode 100644 index 78beb5cb..00000000 --- a/src/tests/tsconfig_paths.rs +++ /dev/null @@ -1,507 +0,0 @@ -//! tests for tsconfig-paths -//! -//! Fixtures copied from . - -use std::path::{Path, PathBuf}; - -use crate::{ - ResolveError, ResolveOptions, Resolver, TsConfig, TsconfigOptions, TsconfigReferences, -}; - -// -#[test] -fn tsconfig() { - let f = super::fixture_root().join("tsconfig"); - - #[rustfmt::skip] - let pass = [ - (f.clone(), None, "ts-path", f.join("foo.js")), - (f.join("nested"), None, "ts-path", f.join("nested/test.js")), - (f.join("cases/index"), None, "foo", f.join("node_modules/tsconfig-index/foo.js")), - // This requires reading package.json.tsconfig field - // (f.join("cases/field"), "foo", f.join("node_modules/tsconfig-field/foo.js")) - (f.join("cases/exports"), None, "foo", f.join("node_modules/tsconfig-exports/foo.js")), - (f.join("cases/extends-extension"), None, "foo", f.join("cases/extends-extension/foo.js")), - (f.join("cases/extends-extensionless"), None, "foo", f.join("node_modules/tsconfig-field/foo.js")), - (f.join("cases/extends-paths"), Some("src"), "@/index", f.join("cases/extends-paths/src/index.js")), - (f.join("cases/extends-multiple"), None, "foo", f.join("cases/extends-multiple/foo.js")), - ]; - - for (dir, subdir, request, expected) in pass { - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: dir.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - let path = subdir.map_or(dir.clone(), |subdir| dir.join(subdir)); - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{request} {path:?}"); - } - - #[rustfmt::skip] - let data = [ - (f.join("node_modules/tsconfig-not-used"), "ts-path", Ok(f.join("foo.js"))), - ]; - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - for (path, request, expected) in data { - let resolution = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolution, expected, "{path:?} {request}"); - } -} - -#[test] -fn tsconfig_fallthrough() { - let f = super::fixture_root().join("tsconfig"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "/"); - assert_eq!(resolved_path, Err(ResolveError::NotFound("/".into()))); -} - -#[test] -fn json_with_comments() { - let f = super::fixture_root().join("tsconfig/cases/trailing-comma"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "foo").map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(f.join("bar.js"))); -} - -// -#[test] -fn test_paths() { - let path = Path::new("/foo/tsconfig.json"); - let mut tsconfig_json = serde_json::json!({ - "compilerOptions": { - "paths": { - "jquery": ["node_modules/jquery/dist/jquery"], - "*": ["generated/*"], - "bar/*": ["test/*"], - "bar/baz/*": ["baz/*", "yo/*"], - "@/components/*": ["components/*"], - "url": ["node_modules/my-url"], - } - } - }) - .to_string(); - let tsconfig = TsConfig::parse(true, path, &mut tsconfig_json).unwrap(); - - let data = [ - ("jquery", vec!["/foo/node_modules/jquery/dist/jquery"]), - ("test", vec!["/foo/generated/test"]), - ("test/hello", vec!["/foo/generated/test/hello"]), - ("bar/hi", vec!["/foo/test/hi"]), - ("bar/baz/hi", vec!["/foo/baz/hi", "/foo/yo/hi"]), - ("@/components/button", vec!["/foo/components/button"]), - ("./jquery", vec![]), - ("url", vec!["/foo/node_modules/my-url"]), - ]; - - for (specifier, expected) in data { - let paths = tsconfig.resolve_path_alias(specifier); - let expected = expected.into_iter().map(PathBuf::from).collect::>(); - assert_eq!(paths, expected, "{specifier}"); - } -} - -// -#[test] -fn test_base_url() { - let path = Path::new("/foo/tsconfig.json"); - let mut tsconfig_json = serde_json::json!({ - "compilerOptions": { - "baseUrl": "./src" - } - }) - .to_string(); - let tsconfig = TsConfig::parse(true, path, &mut tsconfig_json).unwrap(); - - let data = [ - ("foo", vec!["/foo/src/foo"]), - ("components/button", vec!["/foo/src/components/button"]), - ("./jquery", vec![]), - ]; - - for (specifier, expected) in data { - let paths = tsconfig.resolve_path_alias(specifier); - let expected = expected.into_iter().map(PathBuf::from).collect::>(); - assert_eq!(paths, expected, "{specifier}"); - } -} - -// -#[test] -fn test_paths_and_base_url() { - let path = Path::new("/foo/tsconfig.json"); - let mut tsconfig_json = serde_json::json!({ - "compilerOptions": { - "baseUrl": "./src", - "paths": { - "*": ["generated/*"], - "bar/*": ["test/*"], - "bar/baz/*": ["baz/*", "yo/*"], - "@/components/*": ["components/*"] - } - } - }) - .to_string(); - let tsconfig = TsConfig::parse(true, path, &mut tsconfig_json).unwrap(); - - let data = [ - ("test", vec!["/foo/src/generated/test", "/foo/src/test"]), - ("test/hello", vec!["/foo/src/generated/test/hello", "/foo/src/test/hello"]), - ("bar/hi", vec!["/foo/src/test/hi", "/foo/src/bar/hi"]), - ("bar/baz/hi", vec!["/foo/src/baz/hi", "/foo/src/yo/hi", "/foo/src/bar/baz/hi"]), - ("@/components/button", vec!["/foo/src/components/button", "/foo/src/@/components/button"]), - ("./jquery", vec![]), - ]; - - for (specifier, expected) in data { - let paths = tsconfig.resolve_path_alias(specifier); - let expected = expected.into_iter().map(PathBuf::from).collect::>(); - assert_eq!(paths, expected, "{specifier}"); - } -} - -// Template variable ${configDir} for substitution of config files directory path -// https://github.com/microsoft/TypeScript/pull/58042 -#[test] -fn test_template_variable() { - let f = super::fixture_root().join("tsconfig"); - let f2 = f.join("cases").join("paths_template_variable"); - - #[rustfmt::skip] - let pass = [ - (f2.clone(), "tsconfig1.json", "foo", f2.join("foo.js")), - (f2.clone(), "tsconfig2.json", "foo", f2.join("foo.js")), - (f.clone(), "tsconfig_template_variable.json", "foo", f.join("foo.js")), - ]; - - for (dir, tsconfig, request, expected) in pass { - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: dir.join(tsconfig), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&dir, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{request} {tsconfig} {dir:?}"); - } -} - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows_test { - use std::path::{Path, PathBuf}; - - use crate::{ - ResolveError, ResolveOptions, ResolverGeneric, TsconfigOptions, TsconfigReferences, - }; - - use super::super::memory_fs::MemoryFS; - - struct OneTest { - name: &'static str, - tsconfig: String, - package_json: Option<(PathBuf, String)>, - main_fields: Option>, - existing_files: Vec<&'static str>, - requested_module: &'static str, - expected_path: &'static str, - extensions: Vec, - } - - impl Default for OneTest { - fn default() -> Self { - Self { - name: "", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/*": ["location/*"] - } - } - }) - .to_string(), - package_json: None, - main_fields: None, - existing_files: vec![], - requested_module: "", - expected_path: "", - extensions: vec![ - ".js".into(), - ".json".into(), - ".node".into(), - ".ts".into(), - ".tsx".into(), - ], - } - } - } - - impl OneTest { - fn resolver(&self, root: &Path) -> ResolverGeneric { - let mut file_system = MemoryFS::default(); - - file_system.add_file(&root.join("tsconfig.json"), &self.tsconfig); - if let Some((path, package_json)) = &self.package_json { - file_system.add_file(&root.join(path).join("package.json"), package_json); - } - for path in &self.existing_files { - file_system.add_file(Path::new(path), ""); - } - - let mut options = ResolveOptions { - extensions: self.extensions.clone(), - tsconfig: Some(TsconfigOptions { - config_file: root.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }; - if let Some(main_fields) = &self.main_fields { - options.main_fields = main_fields.clone(); - } - - ResolverGeneric::::new_with_file_system(file_system, options) - } - } - - // Path matching tests from tsconfig-paths - // * - // * - #[test] - fn match_path() { - let pass = [ - OneTest { - name: "should locate path that matches with star and exists", - existing_files: vec!["/root/location/mylib/index.ts"], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve to correct path when many are specified", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/*": ["foo1/*", "foo2/*", "location/*", "foo3/*"], - } - } - }) - .to_string(), - existing_files: vec!["/root/location/mylib/index.ts"], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should locate path that matches with star and prioritize pattern with longest prefix", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "*": ["location/*"], - "lib/*": ["location/*"], - } - } - }) - .to_string(), - existing_files: vec![ - "/root/location/lib/mylib/index.ts", - "/root/location/mylib/index.ts", - ], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should locate path that matches with star and exists with extension", - existing_files: vec![ - "/root/location/mylib.myext", - ], - requested_module: "lib/mylib", - extensions: vec![".js".into(), ".myext".into()], - expected_path: "/root/location/mylib.myext", - ..OneTest::default() - }, - OneTest { - name: "should resolve request with extension specified", - existing_files: vec![ - "/root/location/test.jpg", - ], - requested_module: "lib/test.jpg", - expected_path: "/root/location/test.jpg", - ..OneTest::default() - }, - OneTest { - name: "should locate path that matches without star and exists", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/foo": ["location/foo"] - } - } - }) - .to_string(), - existing_files: vec![ - "/root/location/foo.ts", - ], - requested_module: "lib/foo", - expected_path: "/root/location/foo.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve to parent folder when filename is in subfolder", - existing_files: vec![ - "/root/location/mylib/index.ts", - ], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve from main field in package.json", - package_json: Some((PathBuf::from("/root/location/mylib"), serde_json::json!({ - "main": "./kalle.ts" - }).to_string())), - existing_files: vec![ - "/root/location/mylib/kalle.ts", - ], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/kalle.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve from main field in package.json (js)", - package_json: Some((PathBuf::from("/root/location/mylib.js"), serde_json::json!({ - "main": "./kalle.js" - }).to_string())), - existing_files: vec![ - "/root/location/mylib.js/kalle.js", - ], - extensions: vec![".ts".into(), ".js".into()], - requested_module: "lib/mylib.js", - expected_path: "/root/location/mylib.js/kalle.js", - ..OneTest::default() - }, - OneTest { - name: "should resolve from list of fields by priority in package.json", - main_fields: Some(vec!["missing".into(), "browser".into(), "main".into()]), - package_json: Some((PathBuf::from("/root/location/mylibjs"), serde_json::json!({ - "main": "./main.js", - "browser": "./browser.js" - }).to_string())), - existing_files: vec![ - "/root/location/mylibjs/main.js", - "/root/location/mylibjs/browser.js", - ], - extensions: vec![".ts".into(), ".js".into()], - requested_module: "lib/mylibjs", - expected_path: "/root/location/mylibjs/browser.js", - ..OneTest::default() - }, -OneTest { - name: "should ignore field mappings to missing files in package.json", - main_fields: Some(vec!["browser".into(), "main".into()]), - package_json: Some((PathBuf::from("/root/location/mylibjs"), serde_json::json!({ - "main": "./kalle.js", - "browser": "./nope.js" - }).to_string())), - existing_files: vec![ - "/root/location/mylibjs/kalle.js", - ], - extensions: vec![".ts".into(), ".js".into()], - requested_module: "lib/mylibjs", - expected_path: "/root/location/mylibjs/kalle.js", - ..OneTest::default() - }, - // Tests that are not applicable: - // name: "should resolve nested main fields" - // name: "should ignore advanced field mappings in package.json" - // name: "should resolve to with the help of baseUrl when not explicitly set" - // name: "should not resolve with the help of baseUrl when asked not to" - // name: "should resolve main file with cjs file extension" - OneTest { - name: "should resolve .ts from .js alias", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "@/*": ["src/*"] - } - } - }).to_string(), - existing_files: vec![ - "/root/src/foo.ts", - ], - requested_module: "@/foo", // original data was "@/foo.ts" but I don't get why it is the case? - expected_path: "/root/src/foo.ts", // original data was "/root/src/foo" - ..OneTest::default() - }, - ]; - - let root = PathBuf::from("/root"); - - for test in pass { - let resolved_path = - test.resolver(&root).resolve(&root, test.requested_module).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(PathBuf::from(test.expected_path)), "{}", test.name); - } - - let fail = [ - OneTest { - name: "should not locate path that does not match", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/*": ["location/*"] - } - } - }) - .to_string(), - existing_files: vec!["/root/location/mylib"], - requested_module: "lib/mylibjs", - ..OneTest::default() - }, - OneTest { - name: "should not resolve typings file (index.d.ts)", - existing_files: vec!["/root/location/mylib/index.d.ts"], - requested_module: "lib/mylib", - ..OneTest::default() - }, - ]; - - for test in fail { - let resolved_path = - test.resolver(&root).resolve(&root, test.requested_module).map(|f| f.full_path()); - assert_eq!( - resolved_path, - Err(ResolveError::NotFound(test.requested_module.into())), - "{}", - test.name - ); - } - } -} diff --git a/src/tests/tsconfig_project_references.rs b/src/tests/tsconfig_project_references.rs deleted file mode 100644 index b552fefe..00000000 --- a/src/tests/tsconfig_project_references.rs +++ /dev/null @@ -1,101 +0,0 @@ -//! Tests for tsconfig project references - -use crate::{ResolveError, ResolveOptions, Resolver, TsconfigOptions, TsconfigReferences}; - -#[test] -fn auto() { - let f = super::fixture_root().join("tsconfig/cases/project_references"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("app"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - // Test normal paths alias - (f.join("app"), "@/index.ts", f.join("app/aliased/index.ts")), - (f.join("app"), "@/../index.ts", f.join("app/index.ts")), - // Test project reference - (f.join("project_a"), "@/index.ts", f.join("project_a/aliased/index.ts")), - (f.join("project_b/src"), "@/index.ts", f.join("project_b/src/aliased/index.ts")), - // Does not have paths alias - (f.join("project_a"), "./index.ts", f.join("project_a/index.ts")), - (f.join("project_c"), "./index.ts", f.join("project_c/index.ts")), - // Template variable - { - let dir = f.parent().unwrap().join("paths_template_variable"); - (dir.clone(), "foo", dir.join("foo.js")) - } - ]; - - for (path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{request} {path:?}"); - } -} - -#[test] -fn disabled() { - let f = super::fixture_root().join("tsconfig/cases/project_references"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("app"), - references: TsconfigReferences::Disabled, - }), - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - // Test normal paths alias - (f.join("app"), "@/index.ts", Ok(f.join("app/aliased/index.ts"))), - (f.join("app"), "@/../index.ts", Ok(f.join("app/index.ts"))), - // Test project reference - (f.join("project_a"), "@/index.ts", Err(ResolveError::NotFound("@/index.ts".into()))), - (f.join("project_b/src"), "@/index.ts", Err(ResolveError::NotFound("@/index.ts".into()))), - // Does not have paths alias - (f.join("project_a"), "./index.ts", Ok(f.join("project_a/index.ts"))), - (f.join("project_c"), "./index.ts", Ok(f.join("project_c/index.ts"))), - ]; - - for (path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, expected, "{request} {path:?}"); - } -} - -#[test] -fn manual() { - let f = super::fixture_root().join("tsconfig/cases/project_references"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("app"), - references: TsconfigReferences::Paths(vec!["../project_a/conf.json".into()]), - }), - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - // Test normal paths alias - (f.join("app"), "@/index.ts", Ok(f.join("app/aliased/index.ts"))), - (f.join("app"), "@/../index.ts", Ok(f.join("app/index.ts"))), - // Test project reference - (f.join("project_a"), "@/index.ts", Ok(f.join("project_a/aliased/index.ts"))), - (f.join("project_b/src"), "@/index.ts", Err(ResolveError::NotFound("@/index.ts".into()))), - // Does not have paths alias - (f.join("project_a"), "./index.ts", Ok(f.join("project_a/index.ts"))), - (f.join("project_c"), "./index.ts", Ok(f.join("project_c/index.ts"))), - ]; - - for (path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, expected, "{request} {path:?}"); - } -} diff --git a/tests/integration_test.rs b/tests/integration_test.rs deleted file mode 100644 index 34294ecc..00000000 --- a/tests/integration_test.rs +++ /dev/null @@ -1,101 +0,0 @@ -//! Test public APIs - -use std::{env, path::PathBuf}; - -use oxc_resolver::{EnforceExtension, Resolution, ResolveContext, ResolveOptions, Resolver}; - -fn dir() -> PathBuf { - env::current_dir().unwrap() -} - -fn resolve(specifier: &str) -> Resolution { - let path = dir(); - Resolver::new(ResolveOptions::default()).resolve(path, specifier).unwrap() -} - -#[test] -fn clone() { - let resolution = resolve("./tests/package.json"); - assert_eq!(resolution.clone(), resolution); -} - -#[test] -fn debug() { - let resolution = resolve("./tests/package.json"); - let s = format!("{:?}", resolution); - assert!(!s.is_empty()); -} - -#[test] -fn eq() { - let resolution = resolve("./tests/package.json"); - assert_eq!(resolution, resolution); -} - -#[test] -fn package_json() { - let resolution = resolve("./tests/package.json"); - assert!(resolution - .package_json() - .is_some_and(|json| json.name.as_ref().is_some_and(|name| name == "name"))); -} - -#[cfg(feature = "package_json_raw_json_api")] -#[test] -fn package_json_raw_json_api() { - let resolution = resolve("./tests/package.json"); - assert!(resolution - .package_json() - .unwrap() - .raw_json() - .get("name") - .is_some_and(|name| name == "name")); -} - -#[test] -fn clear_cache() { - let resolver = Resolver::new(ResolveOptions::default()); - resolver.clear_cache(); // exists -} - -#[test] -fn options() { - let resolver = Resolver::new(ResolveOptions::default()); - let options = resolver.options(); - assert!(!format!("{options:?}").is_empty()); -} - -#[test] -fn debug_resolver() { - let resolver = Resolver::new(ResolveOptions::default()); - assert!(!format!("{resolver:?}").is_empty()); -} - -#[test] -fn dependencies() { - let path = dir(); - let mut ctx = ResolveContext::default(); - let _ = Resolver::new(ResolveOptions::default()).resolve_with_context( - path, - "./tests/package.json", - &mut ctx, - ); - assert!(!ctx.file_dependencies.is_empty()); - assert!(ctx.missing_dependencies.is_empty()); -} - -#[test] -fn options_api() { - _ = ResolveOptions::default() - .with_condition_names(&[]) - .with_builtin_modules(true) - .with_root(PathBuf::new()) - .with_extension(".js") - .with_force_extension(EnforceExtension::Auto) - .with_main_field("asdf") - .with_fully_specified(true) - .with_prefer_relative(true) - .with_prefer_absolute(true) - .with_module("module") - .with_main_file("main"); -} diff --git a/tests/package.json b/tests/package.json deleted file mode 100644 index f099adcf..00000000 --- a/tests/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "name": "name" -} diff --git a/tests/resolve_test.rs b/tests/resolve_test.rs deleted file mode 100644 index 82788def..00000000 --- a/tests/resolve_test.rs +++ /dev/null @@ -1,95 +0,0 @@ -use std::{env, path::PathBuf}; - -use oxc_resolver::{ResolveError, ResolveOptions, Resolver}; - -fn dir() -> PathBuf { - env::current_dir().unwrap() -} - -#[test] -fn chinese() { - let dir = dir(); - let specifier = "./fixtures/misc/中文/中文.js"; - let resolution = Resolver::new(ResolveOptions::default()).resolve(&dir, specifier); - assert_eq!(resolution.map(|r| r.into_path_buf()), Ok(dir.join("fixtures/misc/中文/中文.js"))); -} - -#[test] -fn styled_components() { - let dir = dir(); - let path = dir.join("fixtures/pnpm8"); - let module_path = path.join("node_modules/.pnpm/styled-components@6.1.1_react-dom@18.2.0_react@18.2.0/node_modules/styled-components"); - let specifier = "styled-components"; - - // cjs - let options = - ResolveOptions { alias_fields: vec![vec!["browser".into()]], ..ResolveOptions::default() }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(|r| r.into_path_buf()), - Ok(module_path.join("dist/styled-components.browser.cjs.js")) - ); - - // esm - let options = ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - main_fields: vec!["module".into()], - ..ResolveOptions::default() - }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(|r| r.into_path_buf()), - Ok(module_path.join("dist/styled-components.browser.esm.js")) - ); -} - -#[test] -fn axios() { - let dir = dir(); - let path = dir.join("fixtures/pnpm8"); - let module_path = path.join("node_modules/.pnpm/axios@1.6.2/node_modules/axios"); - let specifier = "axios"; - - // default - let options = ResolveOptions::default(); - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!(resolution.map(|r| r.into_path_buf()), Ok(module_path.join("index.js"))); - - // browser - let options = ResolveOptions { - condition_names: vec!["browser".into(), "require".into()], - ..ResolveOptions::default() - }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(|r| r.into_path_buf()), - Ok(module_path.join("dist/browser/axios.cjs")) - ); - - // cjs - let options = ResolveOptions { - condition_names: vec!["node".into(), "require".into()], - ..ResolveOptions::default() - }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!(resolution.map(|r| r.into_path_buf()), Ok(module_path.join("dist/node/axios.cjs"))); -} - -#[test] -fn postcss() { - let dir = dir(); - let path = dir.join("fixtures/pnpm8"); - let module_path = path.join("node_modules/postcss"); - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - // should ignore "path" - let resolution = resolver.resolve(&module_path, "path"); - assert_eq!(resolution, Err(ResolveError::Ignored(module_path.clone()))); - - // should ignore "./lib/terminal-highlight" - let resolution = resolver.resolve(&module_path, "./lib/terminal-highlight"); - assert_eq!(resolution, Err(ResolveError::Ignored(module_path.join("lib/terminal-highlight")))); -} From acb52b18d16c66a45f6cd2e0a955d5be58323353 Mon Sep 17 00:00:00 2001 From: "Nikola R. Hristov" Date: Wed, 1 May 2024 05:14:02 +0300 Subject: [PATCH 02/82] squash! --- .github/dependabot.yml | 38 ++++++++++ .github/workflows/Dependabot.yml | 45 ++++++++++++ .github/workflows/GitHub.yml | 57 +++++++++++++++ .github/workflows/NPM.yml | 52 ++++++++++++++ .github/workflows/Node.yml | 117 +++++++++++++++++++++++++++++++ .github/workflows/Rust.yml | 108 ++++++++++++++++++++++++++++ 6 files changed, 417 insertions(+) create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/Dependabot.yml create mode 100644 .github/workflows/GitHub.yml create mode 100644 .github/workflows/NPM.yml create mode 100644 .github/workflows/Node.yml create mode 100644 .github/workflows/Rust.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..f02ca757 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,38 @@ +version: 2 +enable-beta-ecosystems: true + +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "daily" + + - package-ecosystem: "cargo" + directory: "/" + schedule: + interval: "daily" + versioning-strategy: lockfile-only + + - package-ecosystem: "cargo" + directory: "/fuzz" + schedule: + interval: "daily" + versioning-strategy: lockfile-only + + - package-ecosystem: "cargo" + directory: "/napi" + schedule: + interval: "daily" + versioning-strategy: lockfile-only + + - package-ecosystem: "npm" + directory: "/npm" + schedule: + interval: "daily" + versioning-strategy: increase + + - package-ecosystem: "npm" + directory: "/" + schedule: + interval: "daily" + versioning-strategy: increase diff --git a/.github/workflows/Dependabot.yml b/.github/workflows/Dependabot.yml new file mode 100644 index 00000000..e6091e54 --- /dev/null +++ b/.github/workflows/Dependabot.yml @@ -0,0 +1,45 @@ +name: Dependabot + +concurrency: + group: Dependabot-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +permissions: + security-events: write + contents: write + pull-requests: write + +on: + workflow_dispatch: + pull_request: + +jobs: + Approve: + runs-on: ubuntu-latest + + if: ${{ github.actor == 'dependabot[bot]' }} + + steps: + - uses: dependabot/fetch-metadata@v2.1.0 + with: + github-token: "${{ secrets.GITHUB_TOKEN }}" + + - run: gh pr review --approve "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} + + Merge: + runs-on: ubuntu-latest + + if: ${{ github.actor == 'dependabot[bot]' }} + + steps: + - uses: dependabot/fetch-metadata@v2.1.0 + with: + github-token: "${{ secrets.GITHUB_TOKEN }}" + + - run: gh pr merge --auto --merge "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} diff --git a/.github/workflows/GitHub.yml b/.github/workflows/GitHub.yml new file mode 100644 index 00000000..0be30bac --- /dev/null +++ b/.github/workflows/GitHub.yml @@ -0,0 +1,57 @@ +name: GitHub + +concurrency: + group: GitHub-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +permissions: + issues: write + pull-requests: write + +on: + issues: + types: [opened] + pull_request: + types: [opened] + +jobs: + Assign: + runs-on: ubuntu-latest + + env: + ADBLOCK: true + ASTRO_TELEMETRY_DISABLED: 1 + AUTOMATEDLAB_TELEMETRY_OPTOUT: 1 + AZURE_CORE_COLLECT_TELEMETRY: 0 + CHOOSENIM_NO_ANALYTICS: 1 + DIEZ_DO_NOT_TRACK: 1 + DOTNET_CLI_TELEMETRY_OPTOUT: 1 + DOTNET_INTERACTIVE_CLI_TELEMETRY_OPTOUT: 1 + DO_NOT_TRACK: 1 + ET_NO_TELEMETRY: 1 + GATSBY_TELEMETRY_DISABLED: 1 + GATSBY_TELEMETRY_OPTOUT: 1 + GATSBY_TELEMETRY_OPT_OUT: 1 + GRIT_TELEMETRY_DISABLED: 1 + HASURA_GRAPHQL_ENABLE_TELEMETRY: false + HINT_TELEMETRY: off + HOMEBREW_NO_ANALYTICS: 1 + INFLUXD_REPORTING_DISABLED: true + ITERATIVE_DO_NOT_TRACK: 1 + NEXT_TELEMETRY_DEBUG: 1 + NEXT_TELEMETRY_DISABLED: 1 + NG_CLI_ANALYTICS: false + NUXT_TELEMETRY_DISABLED: 1 + PIN_DO_NOT_TRACK: 1 + POWERSHELL_TELEMETRY_OPTOUT: 1 + SAM_CLI_TELEMETRY: 0 + STNOUPGRADE: 1 + STRIPE_CLI_TELEMETRY_OPTOUT: 1 + TELEMETRY_DISABLED: 1 + + steps: + - uses: pozil/auto-assign-issue@v1.14.0 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + assignees: NikolaRHristov + numOfAssignee: 1 diff --git a/.github/workflows/NPM.yml b/.github/workflows/NPM.yml new file mode 100644 index 00000000..3a180cde --- /dev/null +++ b/.github/workflows/NPM.yml @@ -0,0 +1,52 @@ +name: NPM + +concurrency: + group: NPM-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +permissions: + security-events: write + contents: write + pull-requests: write + +on: + workflow_dispatch: + release: + types: [created] + workflow_call: + +jobs: + Publish: + runs-on: ubuntu-latest + + permissions: + contents: read + id-token: write + + steps: + - uses: actions/checkout@v4.1.4 + + - uses: actions/setup-node@v4.0.2 + with: + node-version: "18" + registry-url: "https://registry.npmjs.org" + + - run: npm install -g npm + + - name: Publish ./npm + continue-on-error: true + working-directory: ./npm + run: | + npm install --include prod dev optional peer --legacy-peer-deps + npm publish --legacy-peer-deps --provenance + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + + - name: Publish . + continue-on-error: true + working-directory: . + run: | + npm install --include prod dev optional peer --legacy-peer-deps + npm publish --legacy-peer-deps --provenance + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/Node.yml b/.github/workflows/Node.yml new file mode 100644 index 00000000..b02531fc --- /dev/null +++ b/.github/workflows/Node.yml @@ -0,0 +1,117 @@ +name: Node + +concurrency: + group: Node-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +permissions: + security-events: write + contents: write + pull-requests: write + +on: + workflow_dispatch: + push: + branches: [Current] + pull_request: + branches: [Current] + workflow_call: + +jobs: + Pre-Publish: + runs-on: ubuntu-latest + + env: + ADBLOCK: true + ASTRO_TELEMETRY_DISABLED: 1 + AUTOMATEDLAB_TELEMETRY_OPTOUT: 1 + AZURE_CORE_COLLECT_TELEMETRY: 0 + CHOOSENIM_NO_ANALYTICS: 1 + DIEZ_DO_NOT_TRACK: 1 + DOTNET_CLI_TELEMETRY_OPTOUT: 1 + DOTNET_INTERACTIVE_CLI_TELEMETRY_OPTOUT: 1 + DO_NOT_TRACK: 1 + ET_NO_TELEMETRY: 1 + GATSBY_TELEMETRY_DISABLED: 1 + GATSBY_TELEMETRY_OPTOUT: 1 + GATSBY_TELEMETRY_OPT_OUT: 1 + GRIT_TELEMETRY_DISABLED: 1 + HASURA_GRAPHQL_ENABLE_TELEMETRY: false + HINT_TELEMETRY: off + HOMEBREW_NO_ANALYTICS: 1 + INFLUXD_REPORTING_DISABLED: true + ITERATIVE_DO_NOT_TRACK: 1 + NEXT_TELEMETRY_DEBUG: 1 + NEXT_TELEMETRY_DISABLED: 1 + NG_CLI_ANALYTICS: false + NUXT_TELEMETRY_DISABLED: 1 + PIN_DO_NOT_TRACK: 1 + POWERSHELL_TELEMETRY_OPTOUT: 1 + SAM_CLI_TELEMETRY: 0 + STNOUPGRADE: 1 + STRIPE_CLI_TELEMETRY_OPTOUT: 1 + TELEMETRY_DISABLED: 1 + + strategy: + matrix: + node-version: [18, 19, 20] + + steps: + - uses: actions/checkout@v4.1.4 + + - uses: pnpm/action-setup@v3.0.0 + with: + version: 8.15.5 + run_install: | + - recursive: true + args: [ + --link-workspace-packages=true, + --lockfile-only, + --prefer-frozen-lockfile=false, + --shamefully-hoist=false, + --shared-workspace-lockfile=true, + --strict-peer-dependencies=false, + --unsafe-perm=true + ] + + - uses: actions/setup-node@v4.0.2 + with: + node-version: ${{ matrix.node-version }} + cache: "pnpm" + cache-dependency-path: ./npm/pnpm-lock.yaml + + - run: pnpm install + working-directory: ./npm + + - run: pnpm run prepublishOnly + working-directory: . + + - uses: actions/upload-artifact@v4.3.3 + with: + name: .-npm-Node-${{ matrix.node-version }}-Target + path: ./npm/Target + + - uses: actions/setup-node@v4.0.2 + with: + node-version: ${{ matrix.node-version }} + cache: "pnpm" + cache-dependency-path: ./pnpm-lock.yaml + + - run: pnpm install + working-directory: . + + - run: pnpm run build + working-directory: . + + - uses: actions/upload-artifact@v4.3.3 + with: + name: .-Node-${{ matrix.node-version }}-Target + path: ./Target + + - run: pnpm run prepublishOnly + working-directory: . + + - uses: actions/upload-artifact@v4.3.3 + with: + name: .-Node-${{ matrix.node-version }}-Target + path: ./Target diff --git a/.github/workflows/Rust.yml b/.github/workflows/Rust.yml new file mode 100644 index 00000000..c967c468 --- /dev/null +++ b/.github/workflows/Rust.yml @@ -0,0 +1,108 @@ +name: Rust + +concurrency: + group: Rust-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +permissions: + security-events: write + +on: + workflow_dispatch: + push: + branches: [Current] + pull_request: + branches: [Current] + workflow_call: + +jobs: + Build: + runs-on: ubuntu-latest + + env: + ADBLOCK: true + ASTRO_TELEMETRY_DISABLED: 1 + AUTOMATEDLAB_TELEMETRY_OPTOUT: 1 + AZURE_CORE_COLLECT_TELEMETRY: 0 + CHOOSENIM_NO_ANALYTICS: 1 + DIEZ_DO_NOT_TRACK: 1 + DOTNET_CLI_TELEMETRY_OPTOUT: 1 + DOTNET_INTERACTIVE_CLI_TELEMETRY_OPTOUT: 1 + DO_NOT_TRACK: 1 + ET_NO_TELEMETRY: 1 + GATSBY_TELEMETRY_DISABLED: 1 + GATSBY_TELEMETRY_OPTOUT: 1 + GATSBY_TELEMETRY_OPT_OUT: 1 + GRIT_TELEMETRY_DISABLED: 1 + HASURA_GRAPHQL_ENABLE_TELEMETRY: false + HINT_TELEMETRY: off + HOMEBREW_NO_ANALYTICS: 1 + INFLUXD_REPORTING_DISABLED: true + ITERATIVE_DO_NOT_TRACK: 1 + NEXT_TELEMETRY_DEBUG: 1 + NEXT_TELEMETRY_DISABLED: 1 + NG_CLI_ANALYTICS: false + NUXT_TELEMETRY_DISABLED: 1 + PIN_DO_NOT_TRACK: 1 + POWERSHELL_TELEMETRY_OPTOUT: 1 + SAM_CLI_TELEMETRY: 0 + STNOUPGRADE: 1 + STRIPE_CLI_TELEMETRY_OPTOUT: 1 + TELEMETRY_DISABLED: 1 + + strategy: + matrix: + toolchain: ["stable", "nightly"] + + steps: + - uses: actions/checkout@v4.1.4 + + - uses: actions-rs/toolchain@v1.0.7 + with: + profile: minimal + toolchain: ${{ matrix.toolchain }} + + - uses: actions/cache@v4.0.2 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + Target/ + key: ${{ runner.os }}-cargo-${{ hashFiles('./Cargo.toml') }} + - uses: actions-rs/cargo@v1.0.3 + with: + command: build + args: --release --all-features --manifest-path ./Cargo.toml + + - uses: actions/cache@v4.0.2 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + Target/ + key: ${{ runner.os }}-cargo-${{ hashFiles('./fuzz/Cargo.toml') }} + - uses: actions-rs/cargo@v1.0.3 + with: + command: build + args: --release --all-features --manifest-path ./fuzz/Cargo.toml + + - uses: actions/cache@v4.0.2 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + Target/ + key: ${{ runner.os }}-cargo-${{ hashFiles('./napi/Cargo.toml') }} + - uses: actions-rs/cargo@v1.0.3 + with: + command: build + args: --release --all-features --manifest-path ./napi/Cargo.toml From 85343910e03f006f6d51b015ddc270483f4dea3a Mon Sep 17 00:00:00 2001 From: "Nikola R. Hristov" Date: Wed, 1 May 2024 19:22:47 +0300 Subject: [PATCH 03/82] squash! --- package.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 8ef44cdb..7cf1ea4f 100644 --- a/package.json +++ b/package.json @@ -36,13 +36,13 @@ ] }, "devDependencies": { - "@napi-rs/cli": "^3.0.0-alpha.43", - "@napi-rs/wasm-runtime": "^0.2.0", + "@napi-rs/cli": "3.0.0-alpha.43", + "@napi-rs/wasm-runtime": "0.2.3", "@playform/build": "0.0.7", "@playform/document": "0.0.6", - "@types/node": "^20.10.4", - "ava": "^6.0.1", - "emnapi": "^1.0.0" + "@types/node": "20.12.7", + "ava": "6.1.2", + "emnapi": "1.1.1" }, "publishConfig": { "access": "public" From a947cf583bd08ea59e8f240b435160807c502406 Mon Sep 17 00:00:00 2001 From: "Nikola R. Hristov" Date: Thu, 2 May 2024 00:21:45 +0300 Subject: [PATCH 04/82] squash! --- .github/dependabot.yml | 38 ---------- .github/workflows/Dependabot.yml | 45 ------------ .github/workflows/GitHub.yml | 57 --------------- .github/workflows/NPM.yml | 52 -------------- .github/workflows/Node.yml | 117 ------------------------------- .github/workflows/Rust.yml | 108 ---------------------------- 6 files changed, 417 deletions(-) delete mode 100644 .github/dependabot.yml delete mode 100644 .github/workflows/Dependabot.yml delete mode 100644 .github/workflows/GitHub.yml delete mode 100644 .github/workflows/NPM.yml delete mode 100644 .github/workflows/Node.yml delete mode 100644 .github/workflows/Rust.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index f02ca757..00000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,38 +0,0 @@ -version: 2 -enable-beta-ecosystems: true - -updates: - - package-ecosystem: "github-actions" - directory: "/" - schedule: - interval: "daily" - - - package-ecosystem: "cargo" - directory: "/" - schedule: - interval: "daily" - versioning-strategy: lockfile-only - - - package-ecosystem: "cargo" - directory: "/fuzz" - schedule: - interval: "daily" - versioning-strategy: lockfile-only - - - package-ecosystem: "cargo" - directory: "/napi" - schedule: - interval: "daily" - versioning-strategy: lockfile-only - - - package-ecosystem: "npm" - directory: "/npm" - schedule: - interval: "daily" - versioning-strategy: increase - - - package-ecosystem: "npm" - directory: "/" - schedule: - interval: "daily" - versioning-strategy: increase diff --git a/.github/workflows/Dependabot.yml b/.github/workflows/Dependabot.yml deleted file mode 100644 index e6091e54..00000000 --- a/.github/workflows/Dependabot.yml +++ /dev/null @@ -1,45 +0,0 @@ -name: Dependabot - -concurrency: - group: Dependabot-${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -permissions: - security-events: write - contents: write - pull-requests: write - -on: - workflow_dispatch: - pull_request: - -jobs: - Approve: - runs-on: ubuntu-latest - - if: ${{ github.actor == 'dependabot[bot]' }} - - steps: - - uses: dependabot/fetch-metadata@v2.1.0 - with: - github-token: "${{ secrets.GITHUB_TOKEN }}" - - - run: gh pr review --approve "$PR_URL" - env: - PR_URL: ${{github.event.pull_request.html_url}} - GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} - - Merge: - runs-on: ubuntu-latest - - if: ${{ github.actor == 'dependabot[bot]' }} - - steps: - - uses: dependabot/fetch-metadata@v2.1.0 - with: - github-token: "${{ secrets.GITHUB_TOKEN }}" - - - run: gh pr merge --auto --merge "$PR_URL" - env: - PR_URL: ${{github.event.pull_request.html_url}} - GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} diff --git a/.github/workflows/GitHub.yml b/.github/workflows/GitHub.yml deleted file mode 100644 index 0be30bac..00000000 --- a/.github/workflows/GitHub.yml +++ /dev/null @@ -1,57 +0,0 @@ -name: GitHub - -concurrency: - group: GitHub-${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -permissions: - issues: write - pull-requests: write - -on: - issues: - types: [opened] - pull_request: - types: [opened] - -jobs: - Assign: - runs-on: ubuntu-latest - - env: - ADBLOCK: true - ASTRO_TELEMETRY_DISABLED: 1 - AUTOMATEDLAB_TELEMETRY_OPTOUT: 1 - AZURE_CORE_COLLECT_TELEMETRY: 0 - CHOOSENIM_NO_ANALYTICS: 1 - DIEZ_DO_NOT_TRACK: 1 - DOTNET_CLI_TELEMETRY_OPTOUT: 1 - DOTNET_INTERACTIVE_CLI_TELEMETRY_OPTOUT: 1 - DO_NOT_TRACK: 1 - ET_NO_TELEMETRY: 1 - GATSBY_TELEMETRY_DISABLED: 1 - GATSBY_TELEMETRY_OPTOUT: 1 - GATSBY_TELEMETRY_OPT_OUT: 1 - GRIT_TELEMETRY_DISABLED: 1 - HASURA_GRAPHQL_ENABLE_TELEMETRY: false - HINT_TELEMETRY: off - HOMEBREW_NO_ANALYTICS: 1 - INFLUXD_REPORTING_DISABLED: true - ITERATIVE_DO_NOT_TRACK: 1 - NEXT_TELEMETRY_DEBUG: 1 - NEXT_TELEMETRY_DISABLED: 1 - NG_CLI_ANALYTICS: false - NUXT_TELEMETRY_DISABLED: 1 - PIN_DO_NOT_TRACK: 1 - POWERSHELL_TELEMETRY_OPTOUT: 1 - SAM_CLI_TELEMETRY: 0 - STNOUPGRADE: 1 - STRIPE_CLI_TELEMETRY_OPTOUT: 1 - TELEMETRY_DISABLED: 1 - - steps: - - uses: pozil/auto-assign-issue@v1.14.0 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - assignees: NikolaRHristov - numOfAssignee: 1 diff --git a/.github/workflows/NPM.yml b/.github/workflows/NPM.yml deleted file mode 100644 index 3a180cde..00000000 --- a/.github/workflows/NPM.yml +++ /dev/null @@ -1,52 +0,0 @@ -name: NPM - -concurrency: - group: NPM-${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -permissions: - security-events: write - contents: write - pull-requests: write - -on: - workflow_dispatch: - release: - types: [created] - workflow_call: - -jobs: - Publish: - runs-on: ubuntu-latest - - permissions: - contents: read - id-token: write - - steps: - - uses: actions/checkout@v4.1.4 - - - uses: actions/setup-node@v4.0.2 - with: - node-version: "18" - registry-url: "https://registry.npmjs.org" - - - run: npm install -g npm - - - name: Publish ./npm - continue-on-error: true - working-directory: ./npm - run: | - npm install --include prod dev optional peer --legacy-peer-deps - npm publish --legacy-peer-deps --provenance - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - - - name: Publish . - continue-on-error: true - working-directory: . - run: | - npm install --include prod dev optional peer --legacy-peer-deps - npm publish --legacy-peer-deps --provenance - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/Node.yml b/.github/workflows/Node.yml deleted file mode 100644 index b02531fc..00000000 --- a/.github/workflows/Node.yml +++ /dev/null @@ -1,117 +0,0 @@ -name: Node - -concurrency: - group: Node-${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -permissions: - security-events: write - contents: write - pull-requests: write - -on: - workflow_dispatch: - push: - branches: [Current] - pull_request: - branches: [Current] - workflow_call: - -jobs: - Pre-Publish: - runs-on: ubuntu-latest - - env: - ADBLOCK: true - ASTRO_TELEMETRY_DISABLED: 1 - AUTOMATEDLAB_TELEMETRY_OPTOUT: 1 - AZURE_CORE_COLLECT_TELEMETRY: 0 - CHOOSENIM_NO_ANALYTICS: 1 - DIEZ_DO_NOT_TRACK: 1 - DOTNET_CLI_TELEMETRY_OPTOUT: 1 - DOTNET_INTERACTIVE_CLI_TELEMETRY_OPTOUT: 1 - DO_NOT_TRACK: 1 - ET_NO_TELEMETRY: 1 - GATSBY_TELEMETRY_DISABLED: 1 - GATSBY_TELEMETRY_OPTOUT: 1 - GATSBY_TELEMETRY_OPT_OUT: 1 - GRIT_TELEMETRY_DISABLED: 1 - HASURA_GRAPHQL_ENABLE_TELEMETRY: false - HINT_TELEMETRY: off - HOMEBREW_NO_ANALYTICS: 1 - INFLUXD_REPORTING_DISABLED: true - ITERATIVE_DO_NOT_TRACK: 1 - NEXT_TELEMETRY_DEBUG: 1 - NEXT_TELEMETRY_DISABLED: 1 - NG_CLI_ANALYTICS: false - NUXT_TELEMETRY_DISABLED: 1 - PIN_DO_NOT_TRACK: 1 - POWERSHELL_TELEMETRY_OPTOUT: 1 - SAM_CLI_TELEMETRY: 0 - STNOUPGRADE: 1 - STRIPE_CLI_TELEMETRY_OPTOUT: 1 - TELEMETRY_DISABLED: 1 - - strategy: - matrix: - node-version: [18, 19, 20] - - steps: - - uses: actions/checkout@v4.1.4 - - - uses: pnpm/action-setup@v3.0.0 - with: - version: 8.15.5 - run_install: | - - recursive: true - args: [ - --link-workspace-packages=true, - --lockfile-only, - --prefer-frozen-lockfile=false, - --shamefully-hoist=false, - --shared-workspace-lockfile=true, - --strict-peer-dependencies=false, - --unsafe-perm=true - ] - - - uses: actions/setup-node@v4.0.2 - with: - node-version: ${{ matrix.node-version }} - cache: "pnpm" - cache-dependency-path: ./npm/pnpm-lock.yaml - - - run: pnpm install - working-directory: ./npm - - - run: pnpm run prepublishOnly - working-directory: . - - - uses: actions/upload-artifact@v4.3.3 - with: - name: .-npm-Node-${{ matrix.node-version }}-Target - path: ./npm/Target - - - uses: actions/setup-node@v4.0.2 - with: - node-version: ${{ matrix.node-version }} - cache: "pnpm" - cache-dependency-path: ./pnpm-lock.yaml - - - run: pnpm install - working-directory: . - - - run: pnpm run build - working-directory: . - - - uses: actions/upload-artifact@v4.3.3 - with: - name: .-Node-${{ matrix.node-version }}-Target - path: ./Target - - - run: pnpm run prepublishOnly - working-directory: . - - - uses: actions/upload-artifact@v4.3.3 - with: - name: .-Node-${{ matrix.node-version }}-Target - path: ./Target diff --git a/.github/workflows/Rust.yml b/.github/workflows/Rust.yml deleted file mode 100644 index c967c468..00000000 --- a/.github/workflows/Rust.yml +++ /dev/null @@ -1,108 +0,0 @@ -name: Rust - -concurrency: - group: Rust-${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -permissions: - security-events: write - -on: - workflow_dispatch: - push: - branches: [Current] - pull_request: - branches: [Current] - workflow_call: - -jobs: - Build: - runs-on: ubuntu-latest - - env: - ADBLOCK: true - ASTRO_TELEMETRY_DISABLED: 1 - AUTOMATEDLAB_TELEMETRY_OPTOUT: 1 - AZURE_CORE_COLLECT_TELEMETRY: 0 - CHOOSENIM_NO_ANALYTICS: 1 - DIEZ_DO_NOT_TRACK: 1 - DOTNET_CLI_TELEMETRY_OPTOUT: 1 - DOTNET_INTERACTIVE_CLI_TELEMETRY_OPTOUT: 1 - DO_NOT_TRACK: 1 - ET_NO_TELEMETRY: 1 - GATSBY_TELEMETRY_DISABLED: 1 - GATSBY_TELEMETRY_OPTOUT: 1 - GATSBY_TELEMETRY_OPT_OUT: 1 - GRIT_TELEMETRY_DISABLED: 1 - HASURA_GRAPHQL_ENABLE_TELEMETRY: false - HINT_TELEMETRY: off - HOMEBREW_NO_ANALYTICS: 1 - INFLUXD_REPORTING_DISABLED: true - ITERATIVE_DO_NOT_TRACK: 1 - NEXT_TELEMETRY_DEBUG: 1 - NEXT_TELEMETRY_DISABLED: 1 - NG_CLI_ANALYTICS: false - NUXT_TELEMETRY_DISABLED: 1 - PIN_DO_NOT_TRACK: 1 - POWERSHELL_TELEMETRY_OPTOUT: 1 - SAM_CLI_TELEMETRY: 0 - STNOUPGRADE: 1 - STRIPE_CLI_TELEMETRY_OPTOUT: 1 - TELEMETRY_DISABLED: 1 - - strategy: - matrix: - toolchain: ["stable", "nightly"] - - steps: - - uses: actions/checkout@v4.1.4 - - - uses: actions-rs/toolchain@v1.0.7 - with: - profile: minimal - toolchain: ${{ matrix.toolchain }} - - - uses: actions/cache@v4.0.2 - with: - path: | - ~/.cargo/bin/ - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - target/ - Target/ - key: ${{ runner.os }}-cargo-${{ hashFiles('./Cargo.toml') }} - - uses: actions-rs/cargo@v1.0.3 - with: - command: build - args: --release --all-features --manifest-path ./Cargo.toml - - - uses: actions/cache@v4.0.2 - with: - path: | - ~/.cargo/bin/ - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - target/ - Target/ - key: ${{ runner.os }}-cargo-${{ hashFiles('./fuzz/Cargo.toml') }} - - uses: actions-rs/cargo@v1.0.3 - with: - command: build - args: --release --all-features --manifest-path ./fuzz/Cargo.toml - - - uses: actions/cache@v4.0.2 - with: - path: | - ~/.cargo/bin/ - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - target/ - Target/ - key: ${{ runner.os }}-cargo-${{ hashFiles('./napi/Cargo.toml') }} - - uses: actions-rs/cargo@v1.0.3 - with: - command: build - args: --release --all-features --manifest-path ./napi/Cargo.toml From edc156d2ca95098ff0f25f1c999d57cfbb1fcd7a Mon Sep 17 00:00:00 2001 From: "Nikola R. Hristov" Date: Thu, 2 May 2024 04:23:18 +0300 Subject: [PATCH 05/82] squash! --- .github/dependabot.yml | 38 ++++++++++ .github/workflows/Dependabot.yml | 45 ++++++++++++ .github/workflows/GitHub.yml | 57 +++++++++++++++ .github/workflows/NPM.yml | 52 ++++++++++++++ .github/workflows/Node.yml | 117 +++++++++++++++++++++++++++++++ .github/workflows/Rust.yml | 108 ++++++++++++++++++++++++++++ 6 files changed, 417 insertions(+) create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/Dependabot.yml create mode 100644 .github/workflows/GitHub.yml create mode 100644 .github/workflows/NPM.yml create mode 100644 .github/workflows/Node.yml create mode 100644 .github/workflows/Rust.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..f02ca757 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,38 @@ +version: 2 +enable-beta-ecosystems: true + +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "daily" + + - package-ecosystem: "cargo" + directory: "/" + schedule: + interval: "daily" + versioning-strategy: lockfile-only + + - package-ecosystem: "cargo" + directory: "/fuzz" + schedule: + interval: "daily" + versioning-strategy: lockfile-only + + - package-ecosystem: "cargo" + directory: "/napi" + schedule: + interval: "daily" + versioning-strategy: lockfile-only + + - package-ecosystem: "npm" + directory: "/npm" + schedule: + interval: "daily" + versioning-strategy: increase + + - package-ecosystem: "npm" + directory: "/" + schedule: + interval: "daily" + versioning-strategy: increase diff --git a/.github/workflows/Dependabot.yml b/.github/workflows/Dependabot.yml new file mode 100644 index 00000000..e6091e54 --- /dev/null +++ b/.github/workflows/Dependabot.yml @@ -0,0 +1,45 @@ +name: Dependabot + +concurrency: + group: Dependabot-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +permissions: + security-events: write + contents: write + pull-requests: write + +on: + workflow_dispatch: + pull_request: + +jobs: + Approve: + runs-on: ubuntu-latest + + if: ${{ github.actor == 'dependabot[bot]' }} + + steps: + - uses: dependabot/fetch-metadata@v2.1.0 + with: + github-token: "${{ secrets.GITHUB_TOKEN }}" + + - run: gh pr review --approve "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} + + Merge: + runs-on: ubuntu-latest + + if: ${{ github.actor == 'dependabot[bot]' }} + + steps: + - uses: dependabot/fetch-metadata@v2.1.0 + with: + github-token: "${{ secrets.GITHUB_TOKEN }}" + + - run: gh pr merge --auto --merge "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} diff --git a/.github/workflows/GitHub.yml b/.github/workflows/GitHub.yml new file mode 100644 index 00000000..0be30bac --- /dev/null +++ b/.github/workflows/GitHub.yml @@ -0,0 +1,57 @@ +name: GitHub + +concurrency: + group: GitHub-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +permissions: + issues: write + pull-requests: write + +on: + issues: + types: [opened] + pull_request: + types: [opened] + +jobs: + Assign: + runs-on: ubuntu-latest + + env: + ADBLOCK: true + ASTRO_TELEMETRY_DISABLED: 1 + AUTOMATEDLAB_TELEMETRY_OPTOUT: 1 + AZURE_CORE_COLLECT_TELEMETRY: 0 + CHOOSENIM_NO_ANALYTICS: 1 + DIEZ_DO_NOT_TRACK: 1 + DOTNET_CLI_TELEMETRY_OPTOUT: 1 + DOTNET_INTERACTIVE_CLI_TELEMETRY_OPTOUT: 1 + DO_NOT_TRACK: 1 + ET_NO_TELEMETRY: 1 + GATSBY_TELEMETRY_DISABLED: 1 + GATSBY_TELEMETRY_OPTOUT: 1 + GATSBY_TELEMETRY_OPT_OUT: 1 + GRIT_TELEMETRY_DISABLED: 1 + HASURA_GRAPHQL_ENABLE_TELEMETRY: false + HINT_TELEMETRY: off + HOMEBREW_NO_ANALYTICS: 1 + INFLUXD_REPORTING_DISABLED: true + ITERATIVE_DO_NOT_TRACK: 1 + NEXT_TELEMETRY_DEBUG: 1 + NEXT_TELEMETRY_DISABLED: 1 + NG_CLI_ANALYTICS: false + NUXT_TELEMETRY_DISABLED: 1 + PIN_DO_NOT_TRACK: 1 + POWERSHELL_TELEMETRY_OPTOUT: 1 + SAM_CLI_TELEMETRY: 0 + STNOUPGRADE: 1 + STRIPE_CLI_TELEMETRY_OPTOUT: 1 + TELEMETRY_DISABLED: 1 + + steps: + - uses: pozil/auto-assign-issue@v1.14.0 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + assignees: NikolaRHristov + numOfAssignee: 1 diff --git a/.github/workflows/NPM.yml b/.github/workflows/NPM.yml new file mode 100644 index 00000000..3a180cde --- /dev/null +++ b/.github/workflows/NPM.yml @@ -0,0 +1,52 @@ +name: NPM + +concurrency: + group: NPM-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +permissions: + security-events: write + contents: write + pull-requests: write + +on: + workflow_dispatch: + release: + types: [created] + workflow_call: + +jobs: + Publish: + runs-on: ubuntu-latest + + permissions: + contents: read + id-token: write + + steps: + - uses: actions/checkout@v4.1.4 + + - uses: actions/setup-node@v4.0.2 + with: + node-version: "18" + registry-url: "https://registry.npmjs.org" + + - run: npm install -g npm + + - name: Publish ./npm + continue-on-error: true + working-directory: ./npm + run: | + npm install --include prod dev optional peer --legacy-peer-deps + npm publish --legacy-peer-deps --provenance + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + + - name: Publish . + continue-on-error: true + working-directory: . + run: | + npm install --include prod dev optional peer --legacy-peer-deps + npm publish --legacy-peer-deps --provenance + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/Node.yml b/.github/workflows/Node.yml new file mode 100644 index 00000000..b02531fc --- /dev/null +++ b/.github/workflows/Node.yml @@ -0,0 +1,117 @@ +name: Node + +concurrency: + group: Node-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +permissions: + security-events: write + contents: write + pull-requests: write + +on: + workflow_dispatch: + push: + branches: [Current] + pull_request: + branches: [Current] + workflow_call: + +jobs: + Pre-Publish: + runs-on: ubuntu-latest + + env: + ADBLOCK: true + ASTRO_TELEMETRY_DISABLED: 1 + AUTOMATEDLAB_TELEMETRY_OPTOUT: 1 + AZURE_CORE_COLLECT_TELEMETRY: 0 + CHOOSENIM_NO_ANALYTICS: 1 + DIEZ_DO_NOT_TRACK: 1 + DOTNET_CLI_TELEMETRY_OPTOUT: 1 + DOTNET_INTERACTIVE_CLI_TELEMETRY_OPTOUT: 1 + DO_NOT_TRACK: 1 + ET_NO_TELEMETRY: 1 + GATSBY_TELEMETRY_DISABLED: 1 + GATSBY_TELEMETRY_OPTOUT: 1 + GATSBY_TELEMETRY_OPT_OUT: 1 + GRIT_TELEMETRY_DISABLED: 1 + HASURA_GRAPHQL_ENABLE_TELEMETRY: false + HINT_TELEMETRY: off + HOMEBREW_NO_ANALYTICS: 1 + INFLUXD_REPORTING_DISABLED: true + ITERATIVE_DO_NOT_TRACK: 1 + NEXT_TELEMETRY_DEBUG: 1 + NEXT_TELEMETRY_DISABLED: 1 + NG_CLI_ANALYTICS: false + NUXT_TELEMETRY_DISABLED: 1 + PIN_DO_NOT_TRACK: 1 + POWERSHELL_TELEMETRY_OPTOUT: 1 + SAM_CLI_TELEMETRY: 0 + STNOUPGRADE: 1 + STRIPE_CLI_TELEMETRY_OPTOUT: 1 + TELEMETRY_DISABLED: 1 + + strategy: + matrix: + node-version: [18, 19, 20] + + steps: + - uses: actions/checkout@v4.1.4 + + - uses: pnpm/action-setup@v3.0.0 + with: + version: 8.15.5 + run_install: | + - recursive: true + args: [ + --link-workspace-packages=true, + --lockfile-only, + --prefer-frozen-lockfile=false, + --shamefully-hoist=false, + --shared-workspace-lockfile=true, + --strict-peer-dependencies=false, + --unsafe-perm=true + ] + + - uses: actions/setup-node@v4.0.2 + with: + node-version: ${{ matrix.node-version }} + cache: "pnpm" + cache-dependency-path: ./npm/pnpm-lock.yaml + + - run: pnpm install + working-directory: ./npm + + - run: pnpm run prepublishOnly + working-directory: . + + - uses: actions/upload-artifact@v4.3.3 + with: + name: .-npm-Node-${{ matrix.node-version }}-Target + path: ./npm/Target + + - uses: actions/setup-node@v4.0.2 + with: + node-version: ${{ matrix.node-version }} + cache: "pnpm" + cache-dependency-path: ./pnpm-lock.yaml + + - run: pnpm install + working-directory: . + + - run: pnpm run build + working-directory: . + + - uses: actions/upload-artifact@v4.3.3 + with: + name: .-Node-${{ matrix.node-version }}-Target + path: ./Target + + - run: pnpm run prepublishOnly + working-directory: . + + - uses: actions/upload-artifact@v4.3.3 + with: + name: .-Node-${{ matrix.node-version }}-Target + path: ./Target diff --git a/.github/workflows/Rust.yml b/.github/workflows/Rust.yml new file mode 100644 index 00000000..c967c468 --- /dev/null +++ b/.github/workflows/Rust.yml @@ -0,0 +1,108 @@ +name: Rust + +concurrency: + group: Rust-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +permissions: + security-events: write + +on: + workflow_dispatch: + push: + branches: [Current] + pull_request: + branches: [Current] + workflow_call: + +jobs: + Build: + runs-on: ubuntu-latest + + env: + ADBLOCK: true + ASTRO_TELEMETRY_DISABLED: 1 + AUTOMATEDLAB_TELEMETRY_OPTOUT: 1 + AZURE_CORE_COLLECT_TELEMETRY: 0 + CHOOSENIM_NO_ANALYTICS: 1 + DIEZ_DO_NOT_TRACK: 1 + DOTNET_CLI_TELEMETRY_OPTOUT: 1 + DOTNET_INTERACTIVE_CLI_TELEMETRY_OPTOUT: 1 + DO_NOT_TRACK: 1 + ET_NO_TELEMETRY: 1 + GATSBY_TELEMETRY_DISABLED: 1 + GATSBY_TELEMETRY_OPTOUT: 1 + GATSBY_TELEMETRY_OPT_OUT: 1 + GRIT_TELEMETRY_DISABLED: 1 + HASURA_GRAPHQL_ENABLE_TELEMETRY: false + HINT_TELEMETRY: off + HOMEBREW_NO_ANALYTICS: 1 + INFLUXD_REPORTING_DISABLED: true + ITERATIVE_DO_NOT_TRACK: 1 + NEXT_TELEMETRY_DEBUG: 1 + NEXT_TELEMETRY_DISABLED: 1 + NG_CLI_ANALYTICS: false + NUXT_TELEMETRY_DISABLED: 1 + PIN_DO_NOT_TRACK: 1 + POWERSHELL_TELEMETRY_OPTOUT: 1 + SAM_CLI_TELEMETRY: 0 + STNOUPGRADE: 1 + STRIPE_CLI_TELEMETRY_OPTOUT: 1 + TELEMETRY_DISABLED: 1 + + strategy: + matrix: + toolchain: ["stable", "nightly"] + + steps: + - uses: actions/checkout@v4.1.4 + + - uses: actions-rs/toolchain@v1.0.7 + with: + profile: minimal + toolchain: ${{ matrix.toolchain }} + + - uses: actions/cache@v4.0.2 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + Target/ + key: ${{ runner.os }}-cargo-${{ hashFiles('./Cargo.toml') }} + - uses: actions-rs/cargo@v1.0.3 + with: + command: build + args: --release --all-features --manifest-path ./Cargo.toml + + - uses: actions/cache@v4.0.2 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + Target/ + key: ${{ runner.os }}-cargo-${{ hashFiles('./fuzz/Cargo.toml') }} + - uses: actions-rs/cargo@v1.0.3 + with: + command: build + args: --release --all-features --manifest-path ./fuzz/Cargo.toml + + - uses: actions/cache@v4.0.2 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + Target/ + key: ${{ runner.os }}-cargo-${{ hashFiles('./napi/Cargo.toml') }} + - uses: actions-rs/cargo@v1.0.3 + with: + command: build + args: --release --all-features --manifest-path ./napi/Cargo.toml From 61c0b6585e928ea114dad8942e18f0ff1e92cbba Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Mon, 6 May 2024 20:43:21 +0300 Subject: [PATCH 06/82] squash! --- npm/package.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm/package.json b/npm/package.json index 33dc2308..3f371b52 100644 --- a/npm/package.json +++ b/npm/package.json @@ -19,7 +19,7 @@ }, "license": "SEE LICENSE IN LICENSE", "author": { - "name": "🌆 — Land —", + "name": "🌆 Land —", "email": "Land@PlayForm.Cloud", "url": "HTTPS://Land.PlayForm.Cloud" }, diff --git a/package.json b/package.json index 7cf1ea4f..dc2f231d 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ }, "license": "SEE LICENSE IN LICENSE", "author": { - "name": "🌆 — Land —", + "name": "🌆 Land —", "email": "Land@PlayForm.Cloud", "url": "HTTPS://Land.PlayForm.Cloud" }, From a5b2616a785a4fef5ceb515d1a1e57b2e2415c65 Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Mon, 6 May 2024 22:36:06 +0300 Subject: [PATCH 07/82] squash! --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index dc2f231d..30db6ff9 100644 --- a/package.json +++ b/package.json @@ -40,8 +40,8 @@ "@napi-rs/wasm-runtime": "0.2.3", "@playform/build": "0.0.7", "@playform/document": "0.0.6", - "@types/node": "20.12.7", - "ava": "6.1.2", + "@types/node": "20.12.10", + "ava": "6.1.3", "emnapi": "1.1.1" }, "publishConfig": { From f9e6f52b65badeeb93aa02c496fdec19d1b00593 Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Tue, 7 May 2024 18:15:09 +0300 Subject: [PATCH 08/82] squash! --- npm/package.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm/package.json b/npm/package.json index 3f371b52..88aa3db8 100644 --- a/npm/package.json +++ b/npm/package.json @@ -19,7 +19,7 @@ }, "license": "SEE LICENSE IN LICENSE", "author": { - "name": "🌆 Land —", + "name": "🛬 Land —", "email": "Land@PlayForm.Cloud", "url": "HTTPS://Land.PlayForm.Cloud" }, diff --git a/package.json b/package.json index 30db6ff9..dee2ae65 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ }, "license": "SEE LICENSE IN LICENSE", "author": { - "name": "🌆 Land —", + "name": "🛬 Land —", "email": "Land@PlayForm.Cloud", "url": "HTTPS://Land.PlayForm.Cloud" }, From 4ed807547bda0e9ae5ca04cd3f197545973bb926 Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Wed, 15 May 2024 04:43:02 +0300 Subject: [PATCH 09/82] squash! --- .github/dependabot.yml | 38 - .github/workflows/Dependabot.yml | 45 - .github/workflows/GitHub.yml | 57 - .github/workflows/NPM.yml | 52 - .github/workflows/Node.yml | 117 --- .github/workflows/Rust.yml | 108 -- .gitignore | 3 - .rustfmt.toml | 6 - .taplo.toml | 5 - CHANGELOG.md | 53 - Cargo.toml | 107 -- LICENSE | 21 - README.md | 236 ----- Source/builtins.rs | 71 -- Source/cache.rs | 369 ------- Source/context.rs | 89 -- Source/error.rs | 155 --- Source/file_system.rs | 133 --- Source/lib.rs | 1667 ------------------------------ Source/options.rs | 623 ----------- Source/package_json.rs | 209 ---- Source/path.rs | 126 --- Source/resolution.rs | 92 -- Source/specifier.rs | 230 ----- Source/tsconfig.rs | 212 ---- benches/resolver.rs | 128 --- deny.toml | 273 ----- examples/resolver.rs | 27 - fuzz/.gitignore | 4 - fuzz/Cargo.toml | 23 - fuzz/fuzz_targets/resolver.rs | 14 - justfile | 71 -- napi/Cargo.toml | 20 - napi/README.md | 18 - napi/Source/lib.rs | 166 --- napi/Source/options.rs | 261 ----- napi/browser.js | 1 - napi/build.rs | 3 - napi/index.d.ts | 214 ---- napi/index.js | 340 ------ napi/resolver.wasi-browser.js | 70 -- napi/resolver.wasi.cjs | 86 -- napi/test.mjs | 30 - napi/wasi-worker-browser.mjs | 40 - napi/wasi-worker.mjs | 50 - npm/.gitignore | 4 - npm/README.md | 18 - npm/package.json | 61 -- package.json | 50 - release-plz.toml | 2 - rust-toolchain.toml | 3 - 51 files changed, 6801 deletions(-) delete mode 100644 .github/dependabot.yml delete mode 100644 .github/workflows/Dependabot.yml delete mode 100644 .github/workflows/GitHub.yml delete mode 100644 .github/workflows/NPM.yml delete mode 100644 .github/workflows/Node.yml delete mode 100644 .github/workflows/Rust.yml delete mode 100644 .gitignore delete mode 100644 .rustfmt.toml delete mode 100644 .taplo.toml delete mode 100644 CHANGELOG.md delete mode 100644 Cargo.toml delete mode 100644 LICENSE delete mode 100644 README.md delete mode 100644 Source/builtins.rs delete mode 100644 Source/cache.rs delete mode 100644 Source/context.rs delete mode 100644 Source/error.rs delete mode 100644 Source/file_system.rs delete mode 100644 Source/lib.rs delete mode 100644 Source/options.rs delete mode 100644 Source/package_json.rs delete mode 100644 Source/path.rs delete mode 100644 Source/resolution.rs delete mode 100644 Source/specifier.rs delete mode 100644 Source/tsconfig.rs delete mode 100644 benches/resolver.rs delete mode 100644 deny.toml delete mode 100644 examples/resolver.rs delete mode 100644 fuzz/.gitignore delete mode 100644 fuzz/Cargo.toml delete mode 100644 fuzz/fuzz_targets/resolver.rs delete mode 100644 justfile delete mode 100644 napi/Cargo.toml delete mode 100644 napi/README.md delete mode 100644 napi/Source/lib.rs delete mode 100644 napi/Source/options.rs delete mode 100644 napi/browser.js delete mode 100644 napi/build.rs delete mode 100644 napi/index.d.ts delete mode 100644 napi/index.js delete mode 100644 napi/resolver.wasi-browser.js delete mode 100644 napi/resolver.wasi.cjs delete mode 100644 napi/test.mjs delete mode 100644 napi/wasi-worker-browser.mjs delete mode 100644 napi/wasi-worker.mjs delete mode 100644 npm/.gitignore delete mode 100644 npm/README.md delete mode 100644 npm/package.json delete mode 100644 package.json delete mode 100644 release-plz.toml delete mode 100644 rust-toolchain.toml diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index f02ca757..00000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,38 +0,0 @@ -version: 2 -enable-beta-ecosystems: true - -updates: - - package-ecosystem: "github-actions" - directory: "/" - schedule: - interval: "daily" - - - package-ecosystem: "cargo" - directory: "/" - schedule: - interval: "daily" - versioning-strategy: lockfile-only - - - package-ecosystem: "cargo" - directory: "/fuzz" - schedule: - interval: "daily" - versioning-strategy: lockfile-only - - - package-ecosystem: "cargo" - directory: "/napi" - schedule: - interval: "daily" - versioning-strategy: lockfile-only - - - package-ecosystem: "npm" - directory: "/npm" - schedule: - interval: "daily" - versioning-strategy: increase - - - package-ecosystem: "npm" - directory: "/" - schedule: - interval: "daily" - versioning-strategy: increase diff --git a/.github/workflows/Dependabot.yml b/.github/workflows/Dependabot.yml deleted file mode 100644 index e6091e54..00000000 --- a/.github/workflows/Dependabot.yml +++ /dev/null @@ -1,45 +0,0 @@ -name: Dependabot - -concurrency: - group: Dependabot-${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -permissions: - security-events: write - contents: write - pull-requests: write - -on: - workflow_dispatch: - pull_request: - -jobs: - Approve: - runs-on: ubuntu-latest - - if: ${{ github.actor == 'dependabot[bot]' }} - - steps: - - uses: dependabot/fetch-metadata@v2.1.0 - with: - github-token: "${{ secrets.GITHUB_TOKEN }}" - - - run: gh pr review --approve "$PR_URL" - env: - PR_URL: ${{github.event.pull_request.html_url}} - GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} - - Merge: - runs-on: ubuntu-latest - - if: ${{ github.actor == 'dependabot[bot]' }} - - steps: - - uses: dependabot/fetch-metadata@v2.1.0 - with: - github-token: "${{ secrets.GITHUB_TOKEN }}" - - - run: gh pr merge --auto --merge "$PR_URL" - env: - PR_URL: ${{github.event.pull_request.html_url}} - GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} diff --git a/.github/workflows/GitHub.yml b/.github/workflows/GitHub.yml deleted file mode 100644 index 0be30bac..00000000 --- a/.github/workflows/GitHub.yml +++ /dev/null @@ -1,57 +0,0 @@ -name: GitHub - -concurrency: - group: GitHub-${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -permissions: - issues: write - pull-requests: write - -on: - issues: - types: [opened] - pull_request: - types: [opened] - -jobs: - Assign: - runs-on: ubuntu-latest - - env: - ADBLOCK: true - ASTRO_TELEMETRY_DISABLED: 1 - AUTOMATEDLAB_TELEMETRY_OPTOUT: 1 - AZURE_CORE_COLLECT_TELEMETRY: 0 - CHOOSENIM_NO_ANALYTICS: 1 - DIEZ_DO_NOT_TRACK: 1 - DOTNET_CLI_TELEMETRY_OPTOUT: 1 - DOTNET_INTERACTIVE_CLI_TELEMETRY_OPTOUT: 1 - DO_NOT_TRACK: 1 - ET_NO_TELEMETRY: 1 - GATSBY_TELEMETRY_DISABLED: 1 - GATSBY_TELEMETRY_OPTOUT: 1 - GATSBY_TELEMETRY_OPT_OUT: 1 - GRIT_TELEMETRY_DISABLED: 1 - HASURA_GRAPHQL_ENABLE_TELEMETRY: false - HINT_TELEMETRY: off - HOMEBREW_NO_ANALYTICS: 1 - INFLUXD_REPORTING_DISABLED: true - ITERATIVE_DO_NOT_TRACK: 1 - NEXT_TELEMETRY_DEBUG: 1 - NEXT_TELEMETRY_DISABLED: 1 - NG_CLI_ANALYTICS: false - NUXT_TELEMETRY_DISABLED: 1 - PIN_DO_NOT_TRACK: 1 - POWERSHELL_TELEMETRY_OPTOUT: 1 - SAM_CLI_TELEMETRY: 0 - STNOUPGRADE: 1 - STRIPE_CLI_TELEMETRY_OPTOUT: 1 - TELEMETRY_DISABLED: 1 - - steps: - - uses: pozil/auto-assign-issue@v1.14.0 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - assignees: NikolaRHristov - numOfAssignee: 1 diff --git a/.github/workflows/NPM.yml b/.github/workflows/NPM.yml deleted file mode 100644 index 3a180cde..00000000 --- a/.github/workflows/NPM.yml +++ /dev/null @@ -1,52 +0,0 @@ -name: NPM - -concurrency: - group: NPM-${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -permissions: - security-events: write - contents: write - pull-requests: write - -on: - workflow_dispatch: - release: - types: [created] - workflow_call: - -jobs: - Publish: - runs-on: ubuntu-latest - - permissions: - contents: read - id-token: write - - steps: - - uses: actions/checkout@v4.1.4 - - - uses: actions/setup-node@v4.0.2 - with: - node-version: "18" - registry-url: "https://registry.npmjs.org" - - - run: npm install -g npm - - - name: Publish ./npm - continue-on-error: true - working-directory: ./npm - run: | - npm install --include prod dev optional peer --legacy-peer-deps - npm publish --legacy-peer-deps --provenance - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - - - name: Publish . - continue-on-error: true - working-directory: . - run: | - npm install --include prod dev optional peer --legacy-peer-deps - npm publish --legacy-peer-deps --provenance - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/Node.yml b/.github/workflows/Node.yml deleted file mode 100644 index b02531fc..00000000 --- a/.github/workflows/Node.yml +++ /dev/null @@ -1,117 +0,0 @@ -name: Node - -concurrency: - group: Node-${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -permissions: - security-events: write - contents: write - pull-requests: write - -on: - workflow_dispatch: - push: - branches: [Current] - pull_request: - branches: [Current] - workflow_call: - -jobs: - Pre-Publish: - runs-on: ubuntu-latest - - env: - ADBLOCK: true - ASTRO_TELEMETRY_DISABLED: 1 - AUTOMATEDLAB_TELEMETRY_OPTOUT: 1 - AZURE_CORE_COLLECT_TELEMETRY: 0 - CHOOSENIM_NO_ANALYTICS: 1 - DIEZ_DO_NOT_TRACK: 1 - DOTNET_CLI_TELEMETRY_OPTOUT: 1 - DOTNET_INTERACTIVE_CLI_TELEMETRY_OPTOUT: 1 - DO_NOT_TRACK: 1 - ET_NO_TELEMETRY: 1 - GATSBY_TELEMETRY_DISABLED: 1 - GATSBY_TELEMETRY_OPTOUT: 1 - GATSBY_TELEMETRY_OPT_OUT: 1 - GRIT_TELEMETRY_DISABLED: 1 - HASURA_GRAPHQL_ENABLE_TELEMETRY: false - HINT_TELEMETRY: off - HOMEBREW_NO_ANALYTICS: 1 - INFLUXD_REPORTING_DISABLED: true - ITERATIVE_DO_NOT_TRACK: 1 - NEXT_TELEMETRY_DEBUG: 1 - NEXT_TELEMETRY_DISABLED: 1 - NG_CLI_ANALYTICS: false - NUXT_TELEMETRY_DISABLED: 1 - PIN_DO_NOT_TRACK: 1 - POWERSHELL_TELEMETRY_OPTOUT: 1 - SAM_CLI_TELEMETRY: 0 - STNOUPGRADE: 1 - STRIPE_CLI_TELEMETRY_OPTOUT: 1 - TELEMETRY_DISABLED: 1 - - strategy: - matrix: - node-version: [18, 19, 20] - - steps: - - uses: actions/checkout@v4.1.4 - - - uses: pnpm/action-setup@v3.0.0 - with: - version: 8.15.5 - run_install: | - - recursive: true - args: [ - --link-workspace-packages=true, - --lockfile-only, - --prefer-frozen-lockfile=false, - --shamefully-hoist=false, - --shared-workspace-lockfile=true, - --strict-peer-dependencies=false, - --unsafe-perm=true - ] - - - uses: actions/setup-node@v4.0.2 - with: - node-version: ${{ matrix.node-version }} - cache: "pnpm" - cache-dependency-path: ./npm/pnpm-lock.yaml - - - run: pnpm install - working-directory: ./npm - - - run: pnpm run prepublishOnly - working-directory: . - - - uses: actions/upload-artifact@v4.3.3 - with: - name: .-npm-Node-${{ matrix.node-version }}-Target - path: ./npm/Target - - - uses: actions/setup-node@v4.0.2 - with: - node-version: ${{ matrix.node-version }} - cache: "pnpm" - cache-dependency-path: ./pnpm-lock.yaml - - - run: pnpm install - working-directory: . - - - run: pnpm run build - working-directory: . - - - uses: actions/upload-artifact@v4.3.3 - with: - name: .-Node-${{ matrix.node-version }}-Target - path: ./Target - - - run: pnpm run prepublishOnly - working-directory: . - - - uses: actions/upload-artifact@v4.3.3 - with: - name: .-Node-${{ matrix.node-version }}-Target - path: ./Target diff --git a/.github/workflows/Rust.yml b/.github/workflows/Rust.yml deleted file mode 100644 index c967c468..00000000 --- a/.github/workflows/Rust.yml +++ /dev/null @@ -1,108 +0,0 @@ -name: Rust - -concurrency: - group: Rust-${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -permissions: - security-events: write - -on: - workflow_dispatch: - push: - branches: [Current] - pull_request: - branches: [Current] - workflow_call: - -jobs: - Build: - runs-on: ubuntu-latest - - env: - ADBLOCK: true - ASTRO_TELEMETRY_DISABLED: 1 - AUTOMATEDLAB_TELEMETRY_OPTOUT: 1 - AZURE_CORE_COLLECT_TELEMETRY: 0 - CHOOSENIM_NO_ANALYTICS: 1 - DIEZ_DO_NOT_TRACK: 1 - DOTNET_CLI_TELEMETRY_OPTOUT: 1 - DOTNET_INTERACTIVE_CLI_TELEMETRY_OPTOUT: 1 - DO_NOT_TRACK: 1 - ET_NO_TELEMETRY: 1 - GATSBY_TELEMETRY_DISABLED: 1 - GATSBY_TELEMETRY_OPTOUT: 1 - GATSBY_TELEMETRY_OPT_OUT: 1 - GRIT_TELEMETRY_DISABLED: 1 - HASURA_GRAPHQL_ENABLE_TELEMETRY: false - HINT_TELEMETRY: off - HOMEBREW_NO_ANALYTICS: 1 - INFLUXD_REPORTING_DISABLED: true - ITERATIVE_DO_NOT_TRACK: 1 - NEXT_TELEMETRY_DEBUG: 1 - NEXT_TELEMETRY_DISABLED: 1 - NG_CLI_ANALYTICS: false - NUXT_TELEMETRY_DISABLED: 1 - PIN_DO_NOT_TRACK: 1 - POWERSHELL_TELEMETRY_OPTOUT: 1 - SAM_CLI_TELEMETRY: 0 - STNOUPGRADE: 1 - STRIPE_CLI_TELEMETRY_OPTOUT: 1 - TELEMETRY_DISABLED: 1 - - strategy: - matrix: - toolchain: ["stable", "nightly"] - - steps: - - uses: actions/checkout@v4.1.4 - - - uses: actions-rs/toolchain@v1.0.7 - with: - profile: minimal - toolchain: ${{ matrix.toolchain }} - - - uses: actions/cache@v4.0.2 - with: - path: | - ~/.cargo/bin/ - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - target/ - Target/ - key: ${{ runner.os }}-cargo-${{ hashFiles('./Cargo.toml') }} - - uses: actions-rs/cargo@v1.0.3 - with: - command: build - args: --release --all-features --manifest-path ./Cargo.toml - - - uses: actions/cache@v4.0.2 - with: - path: | - ~/.cargo/bin/ - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - target/ - Target/ - key: ${{ runner.os }}-cargo-${{ hashFiles('./fuzz/Cargo.toml') }} - - uses: actions-rs/cargo@v1.0.3 - with: - command: build - args: --release --all-features --manifest-path ./fuzz/Cargo.toml - - - uses: actions/cache@v4.0.2 - with: - path: | - ~/.cargo/bin/ - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - target/ - Target/ - key: ${{ runner.os }}-cargo-${{ hashFiles('./napi/Cargo.toml') }} - - uses: actions-rs/cargo@v1.0.3 - with: - command: build - args: --release --all-features --manifest-path ./napi/Cargo.toml diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 922809bb..00000000 --- a/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -target/ -/node_modules -fuzz/Cargo.lock diff --git a/.rustfmt.toml b/.rustfmt.toml deleted file mode 100644 index c15be506..00000000 --- a/.rustfmt.toml +++ /dev/null @@ -1,6 +0,0 @@ -# Make Rust more readable given most people have wide screens nowadays. -# This is also the setting used by [rustc](https://github.com/rust-lang/rust/blob/master/rustfmt.toml) -use_small_heuristics = "Max" - -# Use field initialize shorthand if possible -use_field_init_shorthand = true diff --git a/.taplo.toml b/.taplo.toml deleted file mode 100644 index a7da0c1b..00000000 --- a/.taplo.toml +++ /dev/null @@ -1,5 +0,0 @@ -include = ["*.toml"] - -[formatting] -align_entries = true -column_width = 120 diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index 706d4dd5..00000000 --- a/CHANGELOG.md +++ /dev/null @@ -1,53 +0,0 @@ -# Changelog -All notable changes to this project will be documented in this file. - -The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), -and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - -## [Unreleased] - -## [1.7.0](https://github.com/oxc-project/oxc_resolver/compare/oxc_resolver-v1.6.7...oxc_resolver-v1.7.0) - 2024-04-24 - -### Added -- add `imports_fields` option ([#138](https://github.com/oxc-project/oxc_resolver/pull/138)) -- substitute path that starts with `${configDir}/` in tsconfig.compilerOptions.paths ([#136](https://github.com/oxc-project/oxc_resolver/pull/136)) - -### Fixed -- RootsPlugin debug_assert on windows ([#145](https://github.com/oxc-project/oxc_resolver/pull/145)) -- RootsPlugin should fall through if it fails to resolve the roots ([#144](https://github.com/oxc-project/oxc_resolver/pull/144)) -- lazily read package.json.exports for shared resolvers ([#137](https://github.com/oxc-project/oxc_resolver/pull/137)) - -### Other -- remove `PartialEq` and `Eq` from `Specifier` ([#148](https://github.com/oxc-project/oxc_resolver/pull/148)) -- add test case for tsconfig paths alias fall through ([#147](https://github.com/oxc-project/oxc_resolver/pull/147)) -- use `cargo shear` -- fix test not failing the jobs property ([#146](https://github.com/oxc-project/oxc_resolver/pull/146)) -- lazily read package.json.browser_fields for shared resolvers ([#142](https://github.com/oxc-project/oxc_resolver/pull/142)) -- avoid an extra allocation in `load_extensions` -- ignore code coverage for `Display` on `ResolveOptions` ([#140](https://github.com/oxc-project/oxc_resolver/pull/140)) -- remove the browser field lookup in `resolve_esm_match` ([#141](https://github.com/oxc-project/oxc_resolver/pull/141)) -- remove the extra `condition_names` from `package_exports_resolve` - -## [1.6.7](https://github.com/oxc-project/oxc_resolver/compare/oxc_resolver-v1.6.6...oxc_resolver-v1.6.7) - 2024-04-22 - -### Fixed -- incorrect resolution when using shared resolvers with different `main_fields` ([#134](https://github.com/oxc-project/oxc_resolver/pull/134)) - -## [1.6.6](https://github.com/oxc-project/oxc_resolver/compare/oxc_resolver-v1.6.5...oxc_resolver-v1.6.6) - 2024-04-22 - -### Other -- print resolve options while debug tracing ([#133](https://github.com/oxc-project/oxc_resolver/pull/133)) - -## [1.6.5](https://github.com/oxc-project/oxc_resolver/compare/oxc_resolver-v1.6.4...oxc_resolver-v1.6.5) - 2024-04-10 - -### Fixed -- canonicalize is not supported on wasi target ([#124](https://github.com/oxc-project/oxc_resolver/pull/124)) - -### Other -- document feature flags - -## [1.6.4](https://github.com/oxc-project/oxc_resolver/compare/oxc_resolver-v1.6.3...oxc_resolver-v1.6.4) - 2024-03-29 - -### Docs - -* improve terminology and clarify contexts diff --git a/Cargo.toml b/Cargo.toml deleted file mode 100644 index 48c0df61..00000000 --- a/Cargo.toml +++ /dev/null @@ -1,107 +0,0 @@ -[workspace] -members = ["napi"] -resolver = "2" - -[package] -version = "1.7.0" -name = "oxc_resolver" -authors = ["Boshen "] -categories = ["development-tools"] -description = "ESM / CJS module resolution" -edition = "2021" -homepage = "https://github.com/oxc-project/oxc-resolver" -keywords = ["node", "resolve", "cjs", "esm", "enhanced-resolve"] -license = "MIT" -readme = "README.md" -repository = "https://github.com/oxc-project/oxc-resolver" -rust-version = "1.60" -include = ["/src", "/examples", "/benches"] - -[lib] -doctest = false - -[[bench]] -name = "resolver" -harness = false - -[lints.clippy] -all = { level = "warn" } -cargo = { level = "warn" } -# restriction -dbg_macro = "warn" -todo = "warn" -unimplemented = "warn" -# I like the explicitness of this rule as it removes confusion around `clone`. -# This increases readability, avoids `clone` mindlessly and heap allocating on accident. -clone_on_ref_ptr = "warn" -# These two are mutually exclusive, I like `mod.rs` files for better fuzzy searches on module entries. -self_named_module_files = "warn" # "-Wclippy::mod_module_files" -empty_drop = "warn" -empty_structs_with_brackets = "warn" -exit = "warn" -filetype_is_file = "warn" -get_unwrap = "warn" -impl_trait_in_params = "warn" -rc_buffer = "warn" -rc_mutex = "warn" -rest_pat_in_fully_bound_structs = "warn" -unnecessary_safety_comment = "warn" -undocumented_unsafe_blocks = "warn" -# I want to write the best Rust code so both pedantic and nursery is enabled. -# We should only disable rules globally if they are either false positives, chaotic, or does not make sense. -nursery = { level = "warn", priority = -1 } -pedantic = { level = "warn", priority = -1 } -# Allowed rules -# pedantic -# This rule is too pedantic, I don't want to force this because naming things are hard. -module_name_repetitions = "allow" -# All triggers are mostly ignored in our codebase, so this is ignored globally. -struct_excessive_bools = "allow" -too_many_lines = "allow" -# #[must_use] is creating too much noise for this codebase, it does not add much value except nagging -# the programmer to add a #[must_use] after clippy has been run. -# Having #[must_use] every where also hinders readability. -must_use_candidate = "allow" -# used_underscore_binding= "allow" -doc_markdown = "allow" -# nursery -# `const` functions do not make sense for our project because this is not a `const` library. -# This rule also confuses new comers and forces them to add `const` blindlessly without any reason. -missing_const_for_fn = "allow" - -[[example]] -name = "resolver" - -[dependencies] -tracing = { version = "0.1" } -dashmap = { version = "5.5.3" } -serde = { version = "1.0.199", features = ["derive"] } # derive for Deserialize from package.json -serde_json = { version = "1.0.116", features = [ - "preserve_order", -] } # preserve_order: package_json.exports requires order such as `["require", "import", "default"]` -rustc-hash = { version = "1.1.0", default-features = false, features = ["std"] } -dunce = "1.0.4" # Normalize Windows paths to the most compatible format, avoiding UNC where possible -once_cell = "1.19.0" # Use `std::sync::OnceLock::get_or_try_init` when it is stable. -thiserror = { version = "1.0.59" } -json-strip-comments = { version = "1.0.2" } -typescript_tsconfig_json = { version = "0.1.4" } - -document-features = { version = "0.2", optional = true } - -[dev-dependencies] -vfs = "0.12.0" # for testing with in memory file system -rayon = { version = "1.10.0" } -criterion = { package = "criterion2", version = "0.7.2", default-features = false } -normalize-path = { version = "0.2.1" } - -[features] -default = [] -# For codspeed benchmark -codspeed = ["criterion/codspeed"] -## Enables the [PackageJson::raw_json] API, -## which returns the `package.json` with `serde_json::Value`. -package_json_raw_json_api = [] - -[package.metadata.docs.rs] -all-features = true -rustdoc-args = ["--cfg", "docsrs"] diff --git a/LICENSE b/LICENSE deleted file mode 100644 index e8308cad..00000000 --- a/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2023-present Boshen - -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. diff --git a/README.md b/README.md deleted file mode 100644 index da249e21..00000000 --- a/README.md +++ /dev/null @@ -1,236 +0,0 @@ -

- - - OXC Logo - -

- -
- -[![Crates.io][crates-badge]][crates-url] -[![Docs.rs][docs-badge]][docs-url] - -[![MIT licensed][license-badge]][license-url] -[![Build Status][ci-badge]][ci-url] -[![Code Coverage][code-coverage-badge]][code-coverage-url] -[![CodSpeed Badge][codspeed-badge]][codspeed-url] -[![Sponsors][sponsors-badge]][sponsors-url] -[![Discord chat][discord-badge]][discord-url] - -
- -# Oxc Resolver - -Rust port of [enhanced-resolve]. - -* built-in [tsconfig-paths-webpack-plugin] - * support extending tsconfig defined in `tsconfig.extends` - * support paths alias defined in `tsconfig.compilerOptions.paths` - * support project references defined `tsconfig.references` - * support [template variable ${configDir} for substitution of config files directory path](https://github.com/microsoft/TypeScript/pull/58042) -* supports in-memory file system via the `FileSystem` trait -* contains `tracing` instrumentation - -## Usage - -The following usages apply to both Rust and Node.js; the code snippets are written in JavaScript. - -To handle the `exports` field in `package.json`, ESM and CJS need to be differentiated. - -### ESM - -Per [ESM Resolution algorithm](https://nodejs.org/api/esm.html#resolution-and-loading-algorithm) - -> defaultConditions is the conditional environment name array, ["node", "import"]. - -This means when the caller is an ESM import (`import "module"`), resolve options should be - -```javascript -{ - "conditionNames": ["node", "import"] -} -``` - -### CJS - -Per [CJS Resolution algorithm](https://nodejs.org/api/modules.html#all-together) - -> LOAD_PACKAGE_EXPORTS(X, DIR) -> -> 5. let MATCH = PACKAGE_EXPORTS_RESOLVE(pathToFileURL(DIR/NAME), "." + SUBPATH, -> `package.json` "exports", ["node", "require"]) defined in the ESM resolver. - -This means when the caller is a CJS require (`require("module")`), resolve options should be - -```javascript -{ - "conditionNames": ["node", "require"] -} -``` - -### Cache - -To support both CJS and ESM with the same cache: - -```javascript -const esmResolver = ResolverFactory({ - conditionNames: ["node", "import"] -}); - -const cjsResolver = esmResolver.cloneWithOptions({ - conditionNames: ["node", "require"] -}); -``` - -### Browser Field - -From this [non-standard spec](https://github.com/defunctzombie/package-browser-field-spec): - -> The `browser` field is provided to JavaScript bundlers or component tools when packaging modules for client side use. - -The option is - -```javascript -{ - "aliasFields": ["browser"] -} -``` - -### Main Field - -```javascript -{ - "mainFields": ["module", "main"] -} -``` - -Quoting esbuild's documentation: - -* `main` - This is [the standard field](https://docs.npmjs.com/files/package.json#main) for all packages that are meant to be used with node. The name main is hard-coded in to node's module resolution logic itself. Because it's intended for use with node, it's reasonable to expect that the file path in this field is a CommonJS-style module. -* `module` - This field came from a [proposal](https://github.com/dherman/defense-of-dot-js/blob/f31319be735b21739756b87d551f6711bd7aa283/proposal.md) for how to integrate ECMAScript modules into node. Because of this, it's reasonable to expect that the file path in this field is an ECMAScript-style module. This proposal wasn't adopted by node (node uses "type": "module" instead) but it was adopted by major bundlers because ECMAScript-style modules lead to better tree shaking, or dead code removal. -* `browser` - This field came from a [proposal](https://gist.github.com/defunctzombie/4339901/49493836fb873ddaa4b8a7aa0ef2352119f69211) that allows bundlers to replace node-specific files or modules with their browser-friendly versions. It lets you specify an alternate browser-specific entry point. Note that it is possible for a package to use both the browser and module field together (see the note below). - -### Errors - -* `Error: Package subpath '.' is not defined by "exports" in` - occurs when resolving without `conditionNames`. - -## Options - -The options are aligned with [enhanced-resolve]. - -| 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 | -| 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 | -| 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 | - -### Unimplemented Options - -| Field | Default | Description | -|------------------|-----------------------------| --------------------------------------------------------------------------------------------------------------------------------------------------------- | -| 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 | -| plugins | [] | A list of additional resolve plugins which should be applied | -| resolver | undefined | A prepared Resolver to which the plugins are attached | -| unsafeCache | false | Use this cache object to unsafely cache the successful requests - -## Debugging - -### Rspack - -The following environment variable will emit tracing information. - -```bash -RSPACK_PROFILE='TRACE=filter=oxc_resolver=trace&layer=logger' rspack build -``` - - -## Test - -Tests are ported from -* [enhanced-resolve](https://github.com/webpack/enhanced-resolve/tree/main/test) -* [tsconfig-path](https://github.com/dividab/tsconfig-paths/blob/master/src/__tests__/data/match-path-data.ts) and [parcel-resolver](https://github.com/parcel-bundler/parcel/tree/v2/packages/utils/node-resolver-core/test/fixture/tsconfig) for tsconfig-paths - -Test cases are located in `./src/tests`, fixtures are located in `./tests` - -- [x] alias.test.js -- [x] browserField.test.js -- [x] dependencies.test.js -- [x] exportsField.test.js -- [x] extension-alias.test.js -- [x] extensions.test.js -- [x] fallback.test.js -- [x] fullSpecified.test.js -- [x] identifier.test.js (see unit test in `crates/oxc_resolver/src/request.rs`) -- [x] importsField.test.js -- [x] incorrect-description-file.test.js (need to add ctx.fileDependencies) -- [x] missing.test.js -- [x] path.test.js (see unit test in `crates/oxc_resolver/src/path.rs`) -- [ ] plugins.test.js -- [ ] pnp.test.js -- [x] resolve.test.js -- [x] restrictions.test.js (partially done, regex is not supported yet) -- [x] roots.test.js -- [x] scoped-packages.test.js -- [x] simple.test.js -- [x] symlink.test.js - -Irrelevant tests - -- CachedInputFileSystem.test.js -- SyncAsyncFileSystemDecorator.test.js -- forEachBail.test.js -- getPaths.test.js -- pr-53.test.js -- unsafe-cache.test.js -- yield.test.js - -## 📖 License - -`oxc_resolver` is free and open-source software licensed under the [MIT License](./LICENSE). - -Oxc partially copies code from the following projects. - -| Project | License | -| --------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [webpack/enhanced-resolve](https://github.com/webpack/enhanced-resolve) | [MIT](https://github.com/webpack/enhanced-resolve/blob/main/LICENSE) | -| [dividab/tsconfig-paths](https://github.com/dividab/tsconfig-paths) | [MIT](https://github.com/dividab/tsconfig-paths/blob/master/LICENSE) | -| [parcel-bundler/parcel](https://github.com/parcel-bundler/parcel) | [MIT](https://github.com/parcel-bundler/parcel/blob/v2/LICENSE) | -| [tmccombs/json-comments-rs](https://github.com/tmccombs/json-comments-rs) | [Apache 2.0](https://github.com/tmccombs/json-comments-rs/blob/main/LICENSE) | - -[enhanced-resolve]: https://github.com/webpack/enhanced-resolve -[tsconfig-paths-webpack-plugin]: https://github.com/dividab/tsconfig-paths-webpack-plugin - -[discord-badge]: https://img.shields.io/discord/1079625926024900739?logo=discord&label=Discord -[discord-url]: https://discord.gg/9uXCAwqQZW -[license-badge]: https://img.shields.io/badge/license-MIT-blue.svg -[license-url]: https://github.com/oxc-project/oxc-resolver/blob/main/LICENSE -[ci-badge]: https://github.com/oxc-project/oxc-resolver/actions/workflows/ci.yml/badge.svg?event=push&branch=main -[ci-url]: https://github.com/oxc-project/oxc-resolver/actions/workflows/ci.yml?query=event%3Apush+branch%3Amain -[code-coverage-badge]: https://codecov.io/github/oxc-project/oxc-resolver/branch/main/graph/badge.svg -[code-coverage-url]: https://codecov.io/gh/oxc-project/oxc-resolver -[sponsors-badge]: https://img.shields.io/github/sponsors/Boshen -[sponsors-url]: https://github.com/sponsors/Boshen -[codspeed-badge]: https://img.shields.io/endpoint?url=https://codspeed.io/badge.json -[codspeed-url]: https://codspeed.io/oxc-project/oxc-resolver -[crates-badge]: https://img.shields.io/crates/d/oxc_resolver?label=crates.io -[crates-url]: https://crates.io/crates/oxc_resolver -[docs-badge]: https://img.shields.io/docsrs/oxc_resolver -[docs-url]: https://docs.rs/oxc_resolver/latest/oxc_resolver/ diff --git a/Source/builtins.rs b/Source/builtins.rs deleted file mode 100644 index 45a25117..00000000 --- a/Source/builtins.rs +++ /dev/null @@ -1,71 +0,0 @@ -/// Node.js built-in modules -/// -/// `node -p "[...require('module').builtinModules].map(b => JSON.stringify(b)).join(',\n')"` -/// -pub const NODEJS_BUILTINS: &[&str] = &[ - "_http_agent", - "_http_client", - "_http_common", - "_http_incoming", - "_http_outgoing", - "_http_server", - "_stream_duplex", - "_stream_passthrough", - "_stream_readable", - "_stream_transform", - "_stream_wrap", - "_stream_writable", - "_tls_common", - "_tls_wrap", - "assert", - "assert/strict", - "async_hooks", - "buffer", - "child_process", - "cluster", - "console", - "constants", - "crypto", - "dgram", - "diagnostics_channel", - "dns", - "dns/promises", - "domain", - "events", - "fs", - "fs/promises", - "http", - "http2", - "https", - "inspector", - "module", - "net", - "os", - "path", - "path/posix", - "path/win32", - "perf_hooks", - "process", - "punycode", - "querystring", - "readline", - "repl", - "stream", - "stream/consumers", - "stream/promises", - "stream/web", - "string_decoder", - "sys", - "timers", - "timers/promises", - "tls", - "trace_events", - "tty", - "url", - "util", - "util/types", - "v8", - "vm", - "worker_threads", - "zlib", -]; diff --git a/Source/cache.rs b/Source/cache.rs deleted file mode 100644 index 564e7d68..00000000 --- a/Source/cache.rs +++ /dev/null @@ -1,369 +0,0 @@ -use once_cell::sync::OnceCell as OnceLock; -use std::{ - borrow::{Borrow, Cow}, - convert::AsRef, - hash::{BuildHasherDefault, Hash, Hasher}, - io, - ops::Deref, - path::{Path, PathBuf}, - sync::Arc, -}; - -use dashmap::{DashMap, DashSet}; -use rustc_hash::FxHasher; - -use crate::{ - context::ResolveContext as Ctx, package_json::PackageJson, path::PathUtil, FileMetadata, - FileSystem, ResolveError, ResolveOptions, TsConfig, -}; - -#[derive(Default)] -pub struct Cache { - pub(crate) fs: Fs, - paths: DashSet>, - tsconfigs: DashMap, BuildHasherDefault>, -} - -impl Cache { - pub fn new(fs: Fs) -> Self { - Self { fs, paths: DashSet::default(), tsconfigs: DashMap::default() } - } - - pub fn clear(&self) { - self.paths.clear(); - self.tsconfigs.clear(); - } - - pub fn value(&self, path: &Path) -> CachedPath { - let hash = { - let mut hasher = FxHasher::default(); - path.hash(&mut hasher); - hasher.finish() - }; - if let Some(cache_entry) = self.paths.get((hash, path).borrow() as &dyn CacheKey) { - return cache_entry.clone(); - } - let parent = path.parent().map(|p| self.value(p)); - let data = CachedPath(Arc::new(CachedPathImpl::new( - hash, - path.to_path_buf().into_boxed_path(), - parent, - ))); - self.paths.insert(data.clone()); - data - } - - pub fn tsconfig Result<(), ResolveError>>( - &self, - root: bool, - path: &Path, - callback: F, // callback for modifying tsconfig with `extends` - ) -> Result, ResolveError> { - if let Some(tsconfig_ref) = self.tsconfigs.get(path) { - return Ok(Arc::clone(tsconfig_ref.value())); - } - let meta = self.fs.metadata(path).ok(); - let tsconfig_path = if meta.is_some_and(|m| m.is_file) { - Cow::Borrowed(path) - } else if meta.is_some_and(|m| m.is_dir) { - Cow::Owned(path.join("tsconfig.json")) - } else { - let mut os_string = path.to_path_buf().into_os_string(); - os_string.push(".json"); - Cow::Owned(PathBuf::from(os_string)) - }; - let mut tsconfig_string = self - .fs - .read_to_string(&tsconfig_path) - .map_err(|_| ResolveError::TsconfigNotFound(path.to_path_buf()))?; - let mut tsconfig = - TsConfig::parse(root, &tsconfig_path, &mut tsconfig_string).map_err(|error| { - ResolveError::from_serde_json_error(tsconfig_path.to_path_buf(), &error) - })?; - callback(&mut tsconfig)?; - let tsconfig = Arc::new(tsconfig.build()); - self.tsconfigs.insert(path.to_path_buf(), Arc::clone(&tsconfig)); - Ok(tsconfig) - } -} - -#[derive(Clone)] -pub struct CachedPath(Arc); - -impl Hash for CachedPath { - fn hash(&self, state: &mut H) { - self.0.hash.hash(state); - } -} - -impl PartialEq for CachedPath { - fn eq(&self, other: &Self) -> bool { - self.0.path == other.0.path - } -} -impl Eq for CachedPath {} - -impl Deref for CachedPath { - type Target = CachedPathImpl; - - fn deref(&self) -> &Self::Target { - self.0.as_ref() - } -} - -impl<'a> Borrow for CachedPath { - fn borrow(&self) -> &(dyn CacheKey + 'a) { - self - } -} - -impl AsRef for CachedPath { - fn as_ref(&self) -> &CachedPathImpl { - self.0.as_ref() - } -} - -impl CacheKey for CachedPath { - fn tuple(&self) -> (u64, &Path) { - (self.hash, &self.path) - } -} - -pub struct CachedPathImpl { - hash: u64, - path: Box, - parent: Option, - meta: OnceLock>, - symlink: OnceLock>, - canonicalized: OnceLock>, - node_modules: OnceLock>, - package_json: OnceLock>>, -} - -impl CachedPathImpl { - fn new(hash: u64, path: Box, parent: Option) -> Self { - Self { - hash, - path, - parent, - meta: OnceLock::new(), - symlink: OnceLock::new(), - canonicalized: OnceLock::new(), - node_modules: OnceLock::new(), - package_json: OnceLock::new(), - } - } - - pub fn path(&self) -> &Path { - &self.path - } - - pub fn to_path_buf(&self) -> PathBuf { - self.path.to_path_buf() - } - - pub fn parent(&self) -> Option<&CachedPath> { - self.parent.as_ref() - } - - fn meta(&self, fs: &Fs) -> Option { - *self.meta.get_or_init(|| fs.metadata(&self.path).ok()) - } - - pub fn is_file(&self, fs: &Fs, ctx: &mut Ctx) -> bool { - if let Some(meta) = self.meta(fs) { - ctx.add_file_dependency(self.path()); - meta.is_file - } else { - ctx.add_missing_dependency(self.path()); - false - } - } - - pub fn is_dir(&self, fs: &Fs, ctx: &mut Ctx) -> bool { - self.meta(fs).map_or_else( - || { - ctx.add_missing_dependency(self.path()); - false - }, - |meta| meta.is_dir, - ) - } - - fn symlink(&self, fs: &Fs) -> io::Result> { - self.symlink - .get_or_try_init(|| { - if let Ok(symlink_metadata) = fs.symlink_metadata(&self.path) { - if symlink_metadata.is_symlink { - return fs.canonicalize(self.path()).map(Some); - } - } - Ok(None) - }) - .cloned() - } - - pub fn realpath(&self, fs: &Fs) -> io::Result { - self.canonicalized - .get_or_try_init(|| { - if let Some(link) = self.symlink(fs)? { - return Ok(Some(link)); - } - if let Some(parent) = self.parent() { - let parent_path = parent.realpath(fs)?; - return Ok(Some( - parent_path.normalize_with(self.path.strip_prefix(&parent.path).unwrap()), - )); - }; - Ok(None) - }) - .cloned() - .map(|r| r.unwrap_or_else(|| self.path.clone().to_path_buf())) - } - - pub fn module_directory( - &self, - module_name: &str, - cache: &Cache, - ctx: &mut Ctx, - ) -> Option { - let cached_path = cache.value(&self.path.join(module_name)); - cached_path.is_dir(&cache.fs, ctx).then(|| cached_path) - } - - pub fn cached_node_modules( - &self, - cache: &Cache, - ctx: &mut Ctx, - ) -> Option { - self.node_modules.get_or_init(|| self.module_directory("node_modules", cache, ctx)).clone() - } - - /// Find package.json of a path by traversing parent directories. - /// - /// # Errors - /// - /// * [ResolveError::JSON] - pub fn find_package_json( - &self, - fs: &Fs, - options: &ResolveOptions, - ctx: &mut Ctx, - ) -> Result>, ResolveError> { - let mut cache_value = self; - // Go up directories when the querying path is not a directory - while !cache_value.is_dir(fs, ctx) { - if let Some(cv) = &cache_value.parent { - cache_value = cv.as_ref(); - } else { - break; - } - } - let mut cache_value = Some(cache_value); - while let Some(cv) = cache_value { - if let Some(package_json) = cv.package_json(fs, options, ctx)? { - return Ok(Some(Arc::clone(&package_json))); - } - cache_value = cv.parent.as_deref(); - } - Ok(None) - } - - /// Get package.json of the given path. - /// - /// # Errors - /// - /// * [ResolveError::JSON] - pub fn package_json( - &self, - fs: &Fs, - options: &ResolveOptions, - ctx: &mut Ctx, - ) -> Result>, ResolveError> { - // Change to `std::sync::OnceLock::get_or_try_init` when it is stable. - let result = self - .package_json - .get_or_try_init(|| { - let package_json_path = self.path.join("package.json"); - let Ok(package_json_string) = fs.read_to_string(&package_json_path) else { - return Ok(None); - }; - let real_path = if options.symlinks { - self.realpath(fs)?.join("package.json") - } else { - package_json_path.clone() - }; - PackageJson::parse(package_json_path.clone(), real_path, &package_json_string) - .map(Arc::new) - .map(Some) - .map_err(|error| ResolveError::from_serde_json_error(package_json_path, &error)) - }) - .cloned(); - // https://github.com/webpack/enhanced-resolve/blob/58464fc7cb56673c9aa849e68e6300239601e615/lib/DescriptionFileUtils.js#L68-L82 - match &result { - Ok(Some(package_json)) => { - ctx.add_file_dependency(&package_json.path); - } - Ok(None) => { - // Avoid an allocation by making this lazy - if let Some(deps) = &mut ctx.missing_dependencies { - deps.push(self.path.join("package.json")); - } - } - Err(_) => { - if let Some(deps) = &mut ctx.file_dependencies { - deps.push(self.path.join("package.json")); - } - } - } - result - } -} - -/// Memoized cache key, code adapted from . -trait CacheKey { - fn tuple(&self) -> (u64, &Path); -} - -impl Hash for dyn CacheKey + '_ { - fn hash(&self, state: &mut H) { - self.tuple().0.hash(state); - } -} - -impl PartialEq for dyn CacheKey + '_ { - fn eq(&self, other: &Self) -> bool { - self.tuple().1 == other.tuple().1 - } -} - -impl Eq for dyn CacheKey + '_ {} - -impl<'a> CacheKey for (u64, &'a Path) { - fn tuple(&self) -> (u64, &Path) { - (self.0, self.1) - } -} - -impl<'a> Borrow for (u64, &'a Path) { - fn borrow(&self) -> &(dyn CacheKey + 'a) { - self - } -} - -/// Since the cache key is memoized, use an identity hasher -/// to avoid double cache. -#[derive(Default)] -struct IdentityHasher(u64); - -impl Hasher for IdentityHasher { - fn write(&mut self, _: &[u8]) { - unreachable!("Invalid use of IdentityHasher") - } - fn write_u64(&mut self, n: u64) { - self.0 = n; - } - fn finish(&self) -> u64 { - self.0 - } -} diff --git a/Source/context.rs b/Source/context.rs deleted file mode 100644 index 9349de30..00000000 --- a/Source/context.rs +++ /dev/null @@ -1,89 +0,0 @@ -use std::{ - ops::{Deref, DerefMut}, - path::{Path, PathBuf}, -}; - -use crate::error::ResolveError; - -#[derive(Debug, Default, Clone)] -pub struct ResolveContext(ResolveContextImpl); - -#[derive(Debug, Default, Clone)] -pub struct ResolveContextImpl { - pub fully_specified: bool, - - pub query: Option, - - pub fragment: Option, - - /// Files that was found on file system - pub file_dependencies: Option>, - - /// Files that was found on file system - pub missing_dependencies: Option>, - - /// The current resolving alias for bailing recursion alias. - pub resolving_alias: Option, - - /// For avoiding infinite recursion, which will cause stack overflow. - depth: u8, -} - -impl Deref for ResolveContext { - type Target = ResolveContextImpl; - - fn deref(&self) -> &Self::Target { - &self.0 - } -} - -impl DerefMut for ResolveContext { - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} - -impl ResolveContext { - pub fn with_fully_specified(&mut self, yes: bool) { - self.fully_specified = yes; - } - - pub fn with_query_fragment(&mut self, query: Option<&str>, fragment: Option<&str>) { - if let Some(query) = query { - self.query.replace(query.to_string()); - } - if let Some(fragment) = fragment { - self.fragment.replace(fragment.to_string()); - } - } - - pub fn init_file_dependencies(&mut self) { - self.file_dependencies.replace(vec![]); - self.missing_dependencies.replace(vec![]); - } - - pub fn add_file_dependency(&mut self, dep: &Path) { - if let Some(deps) = &mut self.file_dependencies { - deps.push(dep.to_path_buf()); - } - } - - pub fn add_missing_dependency(&mut self, dep: &Path) { - if let Some(deps) = &mut self.missing_dependencies { - deps.push(dep.to_path_buf()); - } - } - - pub fn with_resolving_alias(&mut self, alias: String) { - self.resolving_alias = Some(alias); - } - - pub fn test_for_infinite_recursion(&mut self) -> Result<(), ResolveError> { - self.depth += 1; - // 64 should be more than enough for detecting infinite recursion. - if self.depth > 64 { - return Err(ResolveError::Recursion); - } - Ok(()) - } -} diff --git a/Source/error.rs b/Source/error.rs deleted file mode 100644 index bb39b8be..00000000 --- a/Source/error.rs +++ /dev/null @@ -1,155 +0,0 @@ -use std::{io, path::PathBuf, sync::Arc}; -use thiserror::Error; - -/// All resolution errors -/// -/// `thiserror` is used to display meaningful error messages. -#[derive(Debug, Clone, PartialEq, Error)] -pub enum ResolveError { - /// Ignored path - /// - /// Derived from ignored path (false value) from browser field in package.json - /// ```json - /// { - /// "browser": { - /// "./module": false - /// } - /// } - /// ``` - /// See - #[error("Path is ignored {0}")] - Ignored(PathBuf), - - /// Module not found - #[error("Cannot find module '{0}'")] - NotFound(/* specifier */ String), - - /// Tsconfig not found - #[error("Tsconfig not found {0}")] - TsconfigNotFound(PathBuf), - - #[error("{0}")] - IOError(IOError), - - /// Node.js builtin modules - /// - /// This is an error due to not being a Node.js runtime. - /// The `alias` option can be used to resolve a builtin module to a polyfill. - #[error("Builtin module {0}")] - Builtin(String), - - /// All of the aliased extension are not found - #[error("All of the aliased extension are not found")] - ExtensionAlias, - - /// The provided path specifier cannot be parsed - #[error("{0}")] - Specifier(SpecifierError), - - /// JSON parse error - #[error("{0:?}")] - JSON(JSONError), - - /// Restricted by `ResolveOptions::restrictions` - #[error(r#"Path "{0}" restricted by {0}"#)] - Restriction(PathBuf, PathBuf), - - #[error(r#"Invalid module "{0}" specifier is not a valid subpath for the "exports" resolution of {1}"#)] - InvalidModuleSpecifier(String, PathBuf), - - #[error(r#"Invalid "exports" target "{0}" defined for '{1}' in the package config {2}"#)] - InvalidPackageTarget(String, String, PathBuf), - - #[error(r#"Package subpath '{0}' is not defined by "exports" in {1}"#)] - PackagePathNotExported(String, PathBuf), - - #[error(r#"Invalid package config "{0}", "exports" cannot contain some keys starting with '.' and some not. The exports object must either be an object of package subpath keys or an object of main entry condition name keys only."#)] - InvalidPackageConfig(PathBuf), - - #[error(r#"Default condition should be last one in "{0}""#)] - InvalidPackageConfigDefault(PathBuf), - - #[error(r#"Expecting folder to folder mapping. "{0}" should end with "/"#)] - InvalidPackageConfigDirectory(PathBuf), - - #[error(r#"Package import specifier "{0}" is not defined in package {1}"#)] - PackageImportNotDefined(String, PathBuf), - - #[error("{0} is unimplemented")] - Unimplemented(&'static str), - - /// Occurs when alias paths reference each other. - #[error("Recursion in resolving")] - Recursion, -} - -impl ResolveError { - pub fn is_ignore(&self) -> bool { - matches!(self, Self::Ignored(_)) - } - - pub(crate) fn from_serde_json_error(path: PathBuf, error: &serde_json::Error) -> Self { - Self::JSON(JSONError { - path, - message: error.to_string(), - line: error.line(), - column: error.column(), - }) - } -} - -/// Error for [ResolveError::Specifier] -#[derive(Debug, Clone, Eq, PartialEq, Error)] -pub enum SpecifierError { - #[error("The specifiers must be a non-empty string. Received \"{0}\"")] - Empty(String), -} - -/// JSON error from [serde_json::Error] -#[derive(Debug, Clone, Eq, PartialEq)] -pub struct JSONError { - pub path: PathBuf, - pub message: String, - pub line: usize, - pub column: usize, -} - -#[derive(Debug, Clone, Error)] -#[error("{0}")] -pub struct IOError(Arc); - -impl PartialEq for IOError { - fn eq(&self, other: &Self) -> bool { - self.0.kind() == other.0.kind() - } -} - -impl From for io::Error { - fn from(error: IOError) -> Self { - let io_error = error.0.as_ref(); - Self::new(io_error.kind(), io_error.to_string()) - } -} - -impl From for ResolveError { - fn from(err: io::Error) -> Self { - Self::IOError(IOError(Arc::new(err))) - } -} - -#[test] -fn test_into_io_error() { - use std::io::{self, ErrorKind}; - let error_string = "IOError occurred"; - let string_error = io::Error::new(ErrorKind::Interrupted, error_string.to_string()); - let string_error2 = io::Error::new(ErrorKind::Interrupted, error_string.to_string()); - let resolve_io_error: ResolveError = ResolveError::from(string_error2); - - assert_eq!(resolve_io_error, ResolveError::from(string_error)); - if let ResolveError::IOError(io_error) = resolve_io_error { - // fix for https://github.com/web-infra-dev/rspack/issues/4564 - let std_io_error: io::Error = io_error.into(); - assert_eq!(std_io_error.kind(), ErrorKind::Interrupted); - assert_eq!(std_io_error.to_string(), error_string); - } -} diff --git a/Source/file_system.rs b/Source/file_system.rs deleted file mode 100644 index 0ac11899..00000000 --- a/Source/file_system.rs +++ /dev/null @@ -1,133 +0,0 @@ -use std::{ - fs, io, - path::{Path, PathBuf}, -}; - -/// File System abstraction used for `ResolverGeneric` -pub trait FileSystem: Send + Sync { - /// See [std::fs::read_to_string] - /// - /// # Errors - /// - /// * See [std::fs::read_to_string] - /// ## Warning - /// Use `&Path` instead of a generic `P: AsRef` here, - /// because object safety requirements, it is especially useful, when - /// you want to store multiple `dyn FileSystem` in a `Vec` or use a `ResolverGeneric` in - /// napi env. - fn read_to_string(&self, path: &Path) -> io::Result; - - /// See [std::fs::metadata] - /// - /// # Errors - /// See [std::fs::metadata] - /// ## Warning - /// Use `&Path` instead of a generic `P: AsRef` here, - /// because object safety requirements, it is especially useful, when - /// you want to store multiple `dyn FileSystem` in a `Vec` or use a `ResolverGeneric` in - /// napi env. - fn metadata(&self, path: &Path) -> io::Result; - - /// See [std::fs::symlink_metadata] - /// - /// # Errors - /// - /// See [std::fs::symlink_metadata] - /// ## Warning - /// Use `&Path` instead of a generic `P: AsRef` here, - /// because object safety requirements, it is especially useful, when - /// you want to store multiple `dyn FileSystem` in a `Vec` or use a `ResolverGeneric` in - /// napi env. - fn symlink_metadata(&self, path: &Path) -> io::Result; - - /// See [std::fs::canonicalize] - /// - /// # Errors - /// - /// See [std::fs::read_link] - /// ## Warning - /// Use `&Path` instead of a generic `P: AsRef` here, - /// because object safety requirements, it is especially useful, when - /// you want to store multiple `dyn FileSystem` in a `Vec` or use a `ResolverGeneric` in - /// napi env. - fn canonicalize(&self, path: &Path) -> io::Result; -} - -/// Metadata information about a file -#[derive(Debug, Clone, Copy)] -pub struct FileMetadata { - pub(crate) is_file: bool, - pub(crate) is_dir: bool, - pub(crate) is_symlink: bool, -} - -impl FileMetadata { - pub fn new(is_file: bool, is_dir: bool, is_symlink: bool) -> Self { - Self { is_file, is_dir, is_symlink } - } -} - -impl From for FileMetadata { - fn from(metadata: fs::Metadata) -> Self { - Self::new(metadata.is_file(), metadata.is_dir(), metadata.is_symlink()) - } -} - -/// Operating System -#[derive(Default)] -pub struct FileSystemOs; - -impl FileSystem for FileSystemOs { - fn read_to_string(&self, path: &Path) -> io::Result { - fs::read_to_string(path) - } - - fn metadata(&self, path: &Path) -> io::Result { - fs::metadata(path).map(FileMetadata::from) - } - - fn symlink_metadata(&self, path: &Path) -> io::Result { - fs::symlink_metadata(path).map(FileMetadata::from) - } - - fn canonicalize(&self, path: &Path) -> io::Result { - #[cfg(not(target_os = "wasi"))] - { - dunce::canonicalize(path) - } - #[cfg(target_os = "wasi")] - { - let meta = fs::symlink_metadata(path)?; - if meta.file_type().is_symlink() { - let link = fs::read_link(path)?; - let mut path_buf = path.to_path_buf(); - path_buf.pop(); - for segment in link.iter() { - match segment.to_str() { - Some("..") => { - path_buf.pop(); - } - Some(".") | None => {} - Some(seg) => { - // Need to trim the extra \0 introduces by rust std rust-lang/rust#123727 - path_buf.push(seg.trim_end_matches('\0')); - } - } - } - Ok(path_buf) - } else { - Ok(path.to_path_buf()) - } - } - } -} - -#[test] -fn metadata() { - let meta = FileMetadata { is_file: true, is_dir: true, is_symlink: true }; - assert_eq!( - format!("{meta:?}"), - "FileMetadata { is_file: true, is_dir: true, is_symlink: true }" - ); - let _ = meta.clone(); -} diff --git a/Source/lib.rs b/Source/lib.rs deleted file mode 100644 index 8cc28313..00000000 --- a/Source/lib.rs +++ /dev/null @@ -1,1667 +0,0 @@ -//! # Oxc Resolver -//! -//! Node.js [CommonJS][cjs] and [ECMAScript][esm] Module Resolution. -//! -//! A module resolution is the process of finding the file referenced by a module specifier in -//! `import "specifier"` or `require("specifier")`. -//! -//! All [configuration options](ResolveOptions) are aligned with webpack's [enhanced-resolve]. -//! -//! ## Terminology -//! -//! ### Specifier -//! -//! For [CommonJS modules][cjs], -//! the specifier is the string passed to the `require` function. e.g. `"id"` in `require("id")`. -//! -//! For [ECMAScript modules][esm], -//! the specifier of an `import` statement is the string after the `from` keyword, -//! e.g. `'specifier'` in `import 'specifier'` or `import { sep } from 'specifier'`. -//! Specifiers are also used in export from statements, and as the argument to an `import()` expression. -//! -//! This is also named "request" in some places. -//! -//! ## References: -//! -//! * Algorithm adapted from Node.js [CommonJS Module Resolution Algorithm] and [ECMAScript Module Resolution Algorithm]. -//! * Tests are ported from [enhanced-resolve]. -//! * Some code is adapted from [parcel-resolver]. -//! * The documentation is copied from [webpack's resolve configuration](https://webpack.js.org/configuration/resolve). -//! -//! [enhanced-resolve]: https://github.com/webpack/enhanced-resolve -//! [CommonJS Module Resolution Algorithm]: https://nodejs.org/api/modules.html#all-together -//! [ECMAScript Module Resolution Algorithm]: https://nodejs.org/api/esm.html#resolution-algorithm-specification -//! [parcel-resolver]: https://github.com/parcel-bundler/parcel/blob/v2/packages/utils/node-resolver-rs -//! [cjs]: https://nodejs.org/api/modules.html -//! [esm]: https://nodejs.org/api/esm.html -//! -//! ## Feature flags -#![cfg_attr(feature = "document-features", doc = document_features::document_features!())] -#![cfg_attr(docsrs, feature(doc_auto_cfg))] -//! -//! ## Example -//! -//! ```rust,ignore -#![doc = include_str!("../examples/resolver.rs")] -//! ``` - -mod builtins; -mod cache; -mod context; -mod error; -mod file_system; -mod options; -mod package_json; -mod path; -mod resolution; -mod specifier; -mod tsconfig; - -#[cfg(test)] -mod tests; - -use std::{ - borrow::Cow, - cmp::Ordering, - ffi::OsStr, - fmt, - path::{Component, Path, PathBuf}, - sync::Arc, -}; - -use rustc_hash::FxHashSet; -use serde_json::Value as JSONValue; -use typescript_tsconfig_json::ExtendsField; - -pub use crate::{ - builtins::NODEJS_BUILTINS, - error::{JSONError, ResolveError, SpecifierError}, - file_system::{FileMetadata, FileSystem}, - options::{ - Alias, AliasValue, EnforceExtension, ResolveOptions, Restriction, TsconfigOptions, - TsconfigReferences, - }, - package_json::PackageJson, - resolution::Resolution, -}; -use crate::{ - cache::{Cache, CachedPath}, - context::ResolveContext as Ctx, - file_system::FileSystemOs, - package_json::JSONMap, - path::{PathUtil, SLASH_START}, - specifier::Specifier, - tsconfig::{ProjectReference, TsConfig}, -}; - -type ResolveResult = Result, ResolveError>; - -/// Context returned from the [Resolver::resolve_with_context] API -#[derive(Debug, Default, Clone)] -pub struct ResolveContext { - /// Files that was found on file system - pub file_dependencies: FxHashSet, - - /// Dependencies that was not found on file system - pub missing_dependencies: FxHashSet, -} - -/// Resolver with the current operating system as the file system -pub type Resolver = ResolverGeneric; - -/// Generic implementation of the resolver, can be configured by the [FileSystem] trait -pub struct ResolverGeneric { - options: ResolveOptions, - cache: Arc>, -} - -impl fmt::Debug for ResolverGeneric { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - self.options.fmt(f) - } -} - -impl Default for ResolverGeneric { - fn default() -> Self { - Self::new(ResolveOptions::default()) - } -} - -impl ResolverGeneric { - pub fn new(options: ResolveOptions) -> Self { - Self { options: options.sanitize(), cache: Arc::new(Cache::new(Fs::default())) } - } -} - -impl ResolverGeneric { - pub fn new_with_file_system(file_system: Fs, options: ResolveOptions) -> Self { - Self { cache: Arc::new(Cache::new(file_system)), options: options.sanitize() } - } - - /// Clone the resolver using the same underlying cache. - #[must_use] - pub fn clone_with_options(&self, options: ResolveOptions) -> Self { - Self { options: options.sanitize(), cache: Arc::clone(&self.cache) } - } - - /// Returns the options. - pub fn options(&self) -> &ResolveOptions { - &self.options - } - - /// Clear the underlying cache. - pub fn clear_cache(&self) { - self.cache.clear(); - } - - /// Resolve `specifier` at an absolute `path`. - /// - /// A specifier is the string passed to require or import, i.e. `require("specifier")` or `import "specifier"`. - /// - /// `path` must be an **absolute** path to a directory where the specifier is resolved against. - /// For CommonJS modules, it is the `__dirname` variable that contains the absolute path to the folder containing current module. - /// For ECMAScript modules, it is the value of `import.meta.url`. - /// - /// # Errors - /// - /// * See [ResolveError] - pub fn resolve>( - &self, - path: P, - specifier: &str, - ) -> Result { - let mut ctx = Ctx::default(); - self.resolve_tracing(path.as_ref(), specifier, &mut ctx) - } - - /// Resolve `specifier` at absolute `path` with [ResolveContext] - /// - /// # Errors - /// - /// * See [ResolveError] - pub fn resolve_with_context>( - &self, - path: P, - specifier: &str, - resolve_context: &mut ResolveContext, - ) -> Result { - let mut ctx = Ctx::default(); - ctx.init_file_dependencies(); - let result = self.resolve_tracing(path.as_ref(), specifier, &mut ctx); - if let Some(deps) = &mut ctx.file_dependencies { - resolve_context.file_dependencies.extend(deps.drain(..)); - } - if let Some(deps) = &mut ctx.missing_dependencies { - resolve_context.missing_dependencies.extend(deps.drain(..)); - } - result - } - - /// Wrap `resolve_impl` with `tracing` information - fn resolve_tracing( - &self, - path: &Path, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - let span = tracing::debug_span!("resolve", path = ?path, specifier = specifier); - let _enter = span.enter(); - let r = self.resolve_impl(path, specifier, ctx); - match &r { - Ok(r) => { - tracing::debug!(options = ?self.options, path = ?path, specifier = specifier, ret = ?r.path); - } - Err(err) => { - tracing::debug!(options = ?self.options, path = ?path, specifier = specifier, err = ?err); - } - }; - r - } - - fn resolve_impl( - &self, - path: &Path, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - ctx.with_fully_specified(self.options.fully_specified); - let specifier = Specifier::parse(specifier).map_err(ResolveError::Specifier)?; - ctx.with_query_fragment(specifier.query, specifier.fragment); - let cached_path = self.cache.value(path); - let cached_path = self.require(&cached_path, specifier.path(), ctx).or_else(|err| { - if err.is_ignore() { - return Err(err); - } - // enhanced-resolve: try fallback - self.load_alias(&cached_path, specifier.path(), &self.options.fallback, ctx) - .and_then(|value| value.ok_or(err)) - })?; - let path = self.load_realpath(&cached_path)?; - // enhanced-resolve: restrictions - self.check_restrictions(&path)?; - let package_json = cached_path.find_package_json(&self.cache.fs, &self.options, ctx)?; - if let Some(package_json) = &package_json { - // path must be inside the package. - debug_assert!(path.starts_with(package_json.directory())); - } - Ok(Resolution { - path, - query: ctx.query.take(), - fragment: ctx.fragment.take(), - package_json, - }) - } - - /// require(X) from module at path Y - /// - /// X: specifier - /// Y: path - /// - /// - fn require( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - ctx.test_for_infinite_recursion()?; - - // enhanced-resolve: try fragment as path - if let Some(path) = self.try_fragment_as_path(cached_path, specifier, ctx) { - return Ok(path); - } - - // tsconfig-paths - if let Some(path) = self.load_tsconfig_paths(cached_path, specifier, &mut Ctx::default())? { - return Ok(path); - } - - // enhanced-resolve: try alias - if let Some(path) = self.load_alias(cached_path, specifier, &self.options.alias, ctx)? { - return Ok(path); - } - - match Path::new(specifier).components().next() { - // 3. If X begins with './' or '/' or '../' - Some(Component::RootDir | Component::Prefix(_)) => { - self.require_absolute(cached_path, specifier, ctx) - } - // 3. If X begins with './' or '/' or '../' - Some(Component::CurDir | Component::ParentDir) => { - self.require_relative(cached_path, specifier, ctx) - } - // 4. If X begins with '#' - Some(Component::Normal(_)) if specifier.as_bytes()[0] == b'#' => { - self.require_hash(cached_path, specifier, ctx) - } - _ => { - // 1. If X is a core module, - // a. return the core module - // b. STOP - self.require_core(specifier)?; - - // (ESM) 5. Otherwise, - // Note: specifier is now a bare specifier. - // Set resolved the result of PACKAGE_RESOLVE(specifier, parentURL). - self.require_bare(cached_path, specifier, ctx) - } - } - } - - fn require_core(&self, specifier: &str) -> Result<(), ResolveError> { - if self.options.builtin_modules - && (specifier.starts_with("node:") || NODEJS_BUILTINS.binary_search(&specifier).is_ok()) - { - return Err(ResolveError::Builtin(specifier.to_string())); - } - Ok(()) - } - - fn require_absolute( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - // Make sure only path prefixes gets called - debug_assert!(Path::new(specifier) - .components() - .next() - .is_some_and(|c| matches!(c, Component::RootDir | Component::Prefix(_)))); - if !self.options.prefer_relative && self.options.prefer_absolute { - if let Ok(path) = self.load_package_self_or_node_modules(cached_path, specifier, ctx) { - return Ok(path); - } - } - if let Some(path) = self.load_roots(specifier, ctx) { - return Ok(path); - } - // 2. If X begins with '/' - // a. set Y to be the file system root - let path = self.cache.value(Path::new(specifier)); - if let Some(path) = self.load_as_file_or_directory(&path, specifier, ctx)? { - return Ok(path); - } - Err(ResolveError::NotFound(specifier.to_string())) - } - - // 3. If X begins with './' or '/' or '../' - fn require_relative( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - // Make sure only relative or normal paths gets called - debug_assert!(Path::new(specifier).components().next().is_some_and(|c| matches!( - c, - Component::CurDir | Component::ParentDir | Component::Normal(_) - ))); - let path = cached_path.path().normalize_with(specifier); - let cached_path = self.cache.value(&path); - // a. LOAD_AS_FILE(Y + X) - // b. LOAD_AS_DIRECTORY(Y + X) - if let Some(path) = self.load_as_file_or_directory(&cached_path, specifier, ctx)? { - return Ok(path); - } - // c. THROW "not found" - Err(ResolveError::NotFound(specifier.to_string())) - } - - fn require_hash( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - debug_assert_eq!(specifier.chars().next(), Some('#')); - // a. LOAD_PACKAGE_IMPORTS(X, dirname(Y)) - if let Some(path) = self.load_package_imports(cached_path, specifier, ctx)? { - return Ok(path); - } - self.load_package_self_or_node_modules(cached_path, specifier, ctx) - } - - fn require_bare( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - // Make sure no other path prefixes gets called - debug_assert!(Path::new(specifier) - .components() - .next() - .is_some_and(|c| matches!(c, Component::Normal(_)))); - if self.options.prefer_relative { - if let Ok(path) = self.require_relative(cached_path, specifier, ctx) { - return Ok(path); - } - } - self.load_package_self_or_node_modules(cached_path, specifier, ctx) - } - - /// Try fragment as part of the path - /// - /// 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`. - /// - /// - fn try_fragment_as_path( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Option { - if ctx.fragment.is_some() && ctx.query.is_none() { - let fragment = ctx.fragment.take().unwrap(); - let path = format!("{specifier}{fragment}"); - if let Ok(path) = self.require(cached_path, &path, ctx) { - return Some(path); - } - ctx.fragment.replace(fragment); - } - None - } - - fn load_package_self_or_node_modules( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - let (_, subpath) = Self::parse_package_specifier(specifier); - if subpath.is_empty() { - ctx.with_fully_specified(false); - } - // 5. LOAD_PACKAGE_SELF(X, dirname(Y)) - if let Some(path) = self.load_package_self(cached_path, specifier, ctx)? { - return Ok(path); - } - // 6. LOAD_NODE_MODULES(X, dirname(Y)) - if let Some(path) = self.load_node_modules(cached_path, specifier, ctx)? { - return Ok(path); - } - // 7. THROW "not found" - Err(ResolveError::NotFound(specifier.to_string())) - } - - /// LOAD_PACKAGE_IMPORTS(X, DIR) - fn load_package_imports( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - // 1. Find the closest package scope SCOPE to DIR. - // 2. If no scope was found, return. - let Some(package_json) = - cached_path.find_package_json(&self.cache.fs, &self.options, ctx)? - else { - return Ok(None); - }; - // 3. If the SCOPE/package.json "imports" is null or undefined, return. - // 4. let MATCH = PACKAGE_IMPORTS_RESOLVE(X, pathToFileURL(SCOPE), ["node", "require"]) defined in the ESM resolver. - if let Some(path) = self.package_imports_resolve(specifier, &package_json, ctx)? { - // 5. RESOLVE_ESM_MATCH(MATCH). - return self.resolve_esm_match(specifier, &path, ctx); - } - Ok(None) - } - - fn load_as_file(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - // enhanced-resolve feature: extension_alias - if let Some(path) = self.load_extension_alias(cached_path, ctx)? { - return Ok(Some(path)); - } - if self.options.enforce_extension.is_disabled() { - // 1. If X is a file, load X as its file extension format. STOP - if let Some(path) = self.load_alias_or_file(cached_path, ctx)? { - return Ok(Some(path)); - } - } - // 2. If X.js is a file, load X.js as JavaScript text. STOP - // 3. If X.json is a file, parse X.json to a JavaScript Object. STOP - // 4. If X.node is a file, load X.node as binary addon. STOP - if let Some(path) = - self.load_extensions(cached_path.path(), &self.options.extensions, ctx)? - { - return Ok(Some(path)); - } - Ok(None) - } - - fn load_as_directory(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - // TODO: Only package.json is supported, so warn about having other values - // Checking for empty files is needed for omitting checks on package.json - // 1. If X/package.json is a file, - if !self.options.description_files.is_empty() { - // a. Parse X/package.json, and look for "main" field. - if let Some(package_json) = - cached_path.package_json(&self.cache.fs, &self.options, ctx)? - { - // b. If "main" is a falsy value, GOTO 2. - for main_field in package_json.main_fields(&self.options.main_fields) { - // c. let M = X + (json main field) - let main_field_path = cached_path.path().normalize_with(main_field); - // d. LOAD_AS_FILE(M) - let cached_path = self.cache.value(&main_field_path); - if let Some(path) = self.load_as_file(&cached_path, ctx)? { - return Ok(Some(path)); - } - // e. LOAD_INDEX(M) - if let Some(path) = self.load_index(&cached_path, ctx)? { - return Ok(Some(path)); - } - } - // f. LOAD_INDEX(X) DEPRECATED - // g. THROW "not found" - } - } - // 2. LOAD_INDEX(X) - self.load_index(cached_path, ctx) - } - - fn load_as_file_or_directory( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - if self.options.resolve_to_context { - return Ok(cached_path.is_dir(&self.cache.fs, ctx).then(|| cached_path.clone())); - } - if !specifier.ends_with('/') { - if let Some(path) = self.load_as_file(cached_path, ctx)? { - return Ok(Some(path)); - } - } - if cached_path.is_dir(&self.cache.fs, ctx) { - if let Some(path) = self.load_as_directory(cached_path, ctx)? { - return Ok(Some(path)); - } - } - Ok(None) - } - - fn load_extensions(&self, path: &Path, extensions: &[String], ctx: &mut Ctx) -> ResolveResult { - if ctx.fully_specified { - return Ok(None); - } - let path = path.as_os_str(); - for extension in extensions { - let mut path_with_extension = path.to_os_string(); - path_with_extension.reserve_exact(extension.len()); - path_with_extension.push(extension); - let cached_path = self.cache.value(Path::new(&path_with_extension)); - if let Some(path) = self.load_alias_or_file(&cached_path, ctx)? { - return Ok(Some(path)); - } - } - Ok(None) - } - - fn load_realpath(&self, cached_path: &CachedPath) -> Result { - if self.options.symlinks { - cached_path.realpath(&self.cache.fs).map_err(ResolveError::from) - } else { - Ok(cached_path.to_path_buf()) - } - } - - fn check_restrictions(&self, path: &Path) -> Result<(), ResolveError> { - // https://github.com/webpack/enhanced-resolve/blob/a998c7d218b7a9ec2461fc4fddd1ad5dd7687485/lib/RestrictionsPlugin.js#L19-L24 - fn is_inside(path: &Path, parent: &Path) -> bool { - if !path.starts_with(parent) { - return false; - } - if path.as_os_str().len() == parent.as_os_str().len() { - return true; - } - path.strip_prefix(parent).is_ok_and(|p| p == Path::new("./")) - } - for restriction in &self.options.restrictions { - match restriction { - Restriction::Path(restricted_path) => { - if !is_inside(path, restricted_path) { - return Err(ResolveError::Restriction( - path.to_path_buf(), - restricted_path.clone(), - )); - } - } - Restriction::RegExp(_) => { - return Err(ResolveError::Unimplemented("Restriction with regex")) - } - } - } - Ok(()) - } - - fn load_index(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - for main_file in &self.options.main_files { - let main_path = cached_path.path().normalize_with(main_file); - let cached_path = self.cache.value(&main_path); - if self.options.enforce_extension.is_disabled() { - if let Some(path) = self.load_alias_or_file(&cached_path, ctx)? { - return Ok(Some(path)); - } - } - // 1. If X/index.js is a file, load X/index.js as JavaScript text. STOP - // 2. If X/index.json is a file, parse X/index.json to a JavaScript object. STOP - // 3. If X/index.node is a file, load X/index.node as binary addon. STOP - if let Some(path) = - self.load_extensions(cached_path.path(), &self.options.extensions, ctx)? - { - return Ok(Some(path)); - } - } - Ok(None) - } - - fn load_alias_or_file(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - if let Some(package_json) = - cached_path.find_package_json(&self.cache.fs, &self.options, ctx)? - { - if let Some(path) = self.load_browser_field(cached_path, None, &package_json, ctx)? { - return Ok(Some(path)); - } - } - // enhanced-resolve: try file as alias - let alias_specifier = cached_path.path().to_string_lossy(); - if let Some(path) = - self.load_alias(cached_path, &alias_specifier, &self.options.alias, ctx)? - { - return Ok(Some(path)); - } - if cached_path.is_file(&self.cache.fs, ctx) { - return Ok(Some(cached_path.clone())); - } - Ok(None) - } - - fn load_node_modules( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - let (package_name, subpath) = Self::parse_package_specifier(specifier); - // 1. let DIRS = NODE_MODULES_PATHS(START) - // 2. for each DIR in DIRS: - for module_name in &self.options.modules { - for cached_path in std::iter::successors(Some(cached_path), |p| p.parent()) { - // Skip if /path/to/node_modules does not exist - if !cached_path.is_dir(&self.cache.fs, ctx) { - continue; - } - - let Some(cached_path) = self.get_module_directory(cached_path, module_name, ctx) - else { - continue; - }; - // Optimize node_modules lookup by inspecting whether the package exists - // From LOAD_PACKAGE_EXPORTS(X, DIR) - // 1. Try to interpret X as a combination of NAME and SUBPATH where the name - // may have a @scope/ prefix and the subpath begins with a slash (`/`). - if !package_name.is_empty() { - let package_path = cached_path.path().normalize_with(package_name); - let cached_path = self.cache.value(&package_path); - // Try foo/node_modules/package_name - if cached_path.is_dir(&self.cache.fs, ctx) { - // a. LOAD_PACKAGE_EXPORTS(X, DIR) - if let Some(path) = - self.load_package_exports(specifier, subpath, &cached_path, ctx)? - { - return Ok(Some(path)); - } - } else { - // foo/node_modules/package_name is not a directory, so useless to check inside it - if !subpath.is_empty() { - continue; - } - // Skip if the directory lead to the scope package does not exist - // i.e. `foo/node_modules/@scope` is not a directory for `foo/node_modules/@scope/package` - if package_name.starts_with('@') { - if let Some(path) = cached_path.parent() { - if !path.is_dir(&self.cache.fs, ctx) { - continue; - } - } - } - } - } - - // Try as file or directory for all other cases - // b. LOAD_AS_FILE(DIR/X) - // c. LOAD_AS_DIRECTORY(DIR/X) - let node_module_file = cached_path.path().normalize_with(specifier); - let cached_path = self.cache.value(&node_module_file); - if let Some(path) = self.load_as_file_or_directory(&cached_path, specifier, ctx)? { - return Ok(Some(path)); - } - } - } - Ok(None) - } - - fn get_module_directory( - &self, - cached_path: &CachedPath, - module_name: &str, - ctx: &mut Ctx, - ) -> Option { - if cached_path.path().ends_with(module_name) { - Some(cached_path.clone()) - } else if module_name == "node_modules" { - cached_path.cached_node_modules(&self.cache, ctx) - } else { - cached_path.module_directory(module_name, &self.cache, ctx) - } - } - - fn load_package_exports( - &self, - specifier: &str, - subpath: &str, - cached_path: &CachedPath, - ctx: &mut Ctx, - ) -> ResolveResult { - // 2. If X does not match this pattern or DIR/NAME/package.json is not a file, - // return. - let Some(package_json) = cached_path.package_json(&self.cache.fs, &self.options, ctx)? - else { - return Ok(None); - }; - // 3. Parse DIR/NAME/package.json, and look for "exports" field. - // 4. If "exports" is null or undefined, return. - // 5. let MATCH = PACKAGE_EXPORTS_RESOLVE(pathToFileURL(DIR/NAME), "." + SUBPATH, - // `package.json` "exports", ["node", "require"]) defined in the ESM resolver. - // Note: The subpath is not prepended with a dot on purpose - for exports in package_json.exports_fields(&self.options.exports_fields) { - if let Some(path) = self.package_exports_resolve( - cached_path.path(), - &format!(".{subpath}"), - exports, - ctx, - )? { - // 6. RESOLVE_ESM_MATCH(MATCH) - return self.resolve_esm_match(specifier, &path, ctx); - }; - } - Ok(None) - } - - fn load_package_self( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - // 1. Find the closest package scope SCOPE to DIR. - // 2. If no scope was found, return. - let Some(package_json) = - cached_path.find_package_json(&self.cache.fs, &self.options, ctx)? - else { - return Ok(None); - }; - // 3. If the SCOPE/package.json "exports" is null or undefined, return. - // 4. If the SCOPE/package.json "name" is not the first segment of X, return. - if let Some(subpath) = package_json - .name - .as_ref() - .and_then(|package_name| Self::strip_package_name(specifier, package_name)) - { - // 5. let MATCH = PACKAGE_EXPORTS_RESOLVE(pathToFileURL(SCOPE), - // "." + X.slice("name".length), `package.json` "exports", ["node", "require"]) - // defined in the ESM resolver. - let package_url = package_json.directory(); - // Note: The subpath is not prepended with a dot on purpose - // because `package_exports_resolve` matches subpath without the leading dot. - for exports in package_json.exports_fields(&self.options.exports_fields) { - if let Some(cached_path) = - self.package_exports_resolve(package_url, &format!(".{subpath}"), exports, ctx)? - { - // 6. RESOLVE_ESM_MATCH(MATCH) - return self.resolve_esm_match(specifier, &cached_path, ctx); - } - } - } - self.load_browser_field(cached_path, Some(specifier), &package_json, ctx) - } - - /// RESOLVE_ESM_MATCH(MATCH) - fn resolve_esm_match( - &self, - specifier: &str, - cached_path: &CachedPath, - ctx: &mut Ctx, - ) -> ResolveResult { - // 1. let RESOLVED_PATH = fileURLToPath(MATCH) - // 2. If the file at RESOLVED_PATH exists, load RESOLVED_PATH as its extension format. STOP - // - // Non-compliant ESM can result in a directory, so directory is tried as well. - if let Some(path) = self.load_as_file_or_directory(cached_path, "", ctx)? { - return Ok(Some(path)); - } - // 3. THROW "not found" - Err(ResolveError::NotFound(specifier.to_string())) - } - - /// enhanced-resolve: AliasFieldPlugin for [ResolveOptions::alias_fields] - fn load_browser_field( - &self, - cached_path: &CachedPath, - module_specifier: Option<&str>, - package_json: &PackageJson, - ctx: &mut Ctx, - ) -> ResolveResult { - let path = cached_path.path(); - let Some(new_specifier) = package_json.resolve_browser_field( - path, - module_specifier, - &self.options.alias_fields, - )? - else { - return Ok(None); - }; - // Abort when resolving recursive module - if module_specifier.is_some_and(|s| s == new_specifier) { - return Ok(None); - } - if ctx.resolving_alias.as_ref().is_some_and(|s| s == new_specifier) { - // Complete when resolving to self `{"./a.js": "./a.js"}` - if new_specifier.strip_prefix("./").filter(|s| path.ends_with(Path::new(s))).is_some() { - return if cached_path.is_file(&self.cache.fs, ctx) { - Ok(Some(cached_path.clone())) - } else { - Err(ResolveError::NotFound(new_specifier.to_string())) - }; - } - return Err(ResolveError::Recursion); - } - let specifier = Specifier::parse(new_specifier).map_err(ResolveError::Specifier)?; - ctx.with_query_fragment(specifier.query, specifier.fragment); - ctx.with_resolving_alias(specifier.path().to_string()); - ctx.with_fully_specified(false); - let cached_path = self.cache.value(package_json.directory()); - self.require(&cached_path, specifier.path(), ctx).map(Some) - } - - /// enhanced-resolve: AliasPlugin for [ResolveOptions::alias] and [ResolveOptions::fallback]. - fn load_alias( - &self, - cached_path: &CachedPath, - specifier: &str, - aliases: &Alias, - ctx: &mut Ctx, - ) -> ResolveResult { - for (alias_key_raw, specifiers) in aliases { - let alias_key = if let Some(alias_key) = alias_key_raw.strip_suffix('$') { - if alias_key != specifier { - continue; - } - alias_key - } else { - let strip_package_name = Self::strip_package_name(specifier, alias_key_raw); - if strip_package_name.is_none() { - continue; - } - alias_key_raw - }; - for r in specifiers { - match r { - AliasValue::Path(alias_value) => { - let new_specifier = - Specifier::parse(alias_value).map_err(ResolveError::Specifier)?; - - // `#` can be a fragment or a path, try fragment as path first - if new_specifier.query.is_none() && new_specifier.fragment.is_some() { - if let Some(path) = self.load_alias_value( - cached_path, - alias_key, - alias_value, // pass in original alias value, not parsed - specifier, - ctx, - )? { - return Ok(Some(path)); - } - } - - // Then try path without query and fragment - let old_query = ctx.query.clone(); - let old_fragment = ctx.fragment.clone(); - ctx.with_query_fragment(new_specifier.query, new_specifier.fragment); - if let Some(path) = self.load_alias_value( - cached_path, - alias_key, - new_specifier.path(), // pass in parsed alias value - specifier, - ctx, - )? { - return Ok(Some(path)); - } - ctx.with_query_fragment(old_query.as_deref(), old_fragment.as_deref()); - } - AliasValue::Ignore => { - let path = cached_path.path().normalize_with(alias_key); - return Err(ResolveError::Ignored(path)); - } - } - } - } - Ok(None) - } - - fn load_alias_value( - &self, - cached_path: &CachedPath, - alias_key: &str, - alias_value: &str, - request: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - if request != alias_value - && !request.strip_prefix(alias_value).is_some_and(|prefix| prefix.starts_with('/')) - { - let tail = &request[alias_key.len()..]; - - let new_specifier = if tail.is_empty() { - Cow::Borrowed(alias_value) - } else { - let alias_value = Path::new(alias_value).normalize(); - // Must not append anything to alias_value if it is a file. - let alias_value_cached_path = self.cache.value(&alias_value); - if alias_value_cached_path.is_file(&self.cache.fs, ctx) { - return Ok(None); - } - - // Remove the leading slash so the final path is concatenated. - let tail = tail.trim_start_matches(SLASH_START); - let normalized = alias_value.normalize_with(tail); - Cow::Owned(normalized.to_string_lossy().to_string()) - }; - - ctx.with_fully_specified(false); - return match self.require(cached_path, new_specifier.as_ref(), ctx) { - Err(ResolveError::NotFound(_)) => Ok(None), - Ok(path) => return Ok(Some(path)), - Err(err) => return Err(err), - }; - } - Ok(None) - } - - /// Given an extension alias map `{".js": [".ts", "js"]}`, - /// load the mapping instead of the provided extension - /// - /// This is an enhanced-resolve feature - /// - /// # Errors - /// - /// * [ResolveError::ExtensionAlias]: When all of the aliased extensions are not found - fn load_extension_alias(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - let Some(path_extension) = cached_path.path().extension() else { - return Ok(None); - }; - let Some((_, extensions)) = self - .options - .extension_alias - .iter() - .find(|(ext, _)| OsStr::new(ext.trim_start_matches('.')) == path_extension) - else { - return Ok(None); - }; - let path = cached_path.path().with_extension(""); - ctx.with_fully_specified(false); - if let Some(path) = self.load_extensions(&path, extensions, ctx)? { - return Ok(Some(path)); - } - Err(ResolveError::ExtensionAlias) - } - - /// enhanced-resolve: RootsPlugin - /// - /// A list of directories where requests of server-relative URLs (starting with '/') are resolved, - /// defaults to context configuration option. - /// - /// On non-Windows systems these requests are resolved as an absolute path first. - fn load_roots(&self, specifier: &str, ctx: &mut Ctx) -> Option { - if !self.options.roots.is_empty() { - if let Some(specifier) = specifier.strip_prefix(SLASH_START) { - for root in &self.options.roots { - let cached_path = self.cache.value(root); - if let Ok(path) = self.require_relative(&cached_path, specifier, ctx) { - return Some(path); - } - } - } - } - None - } - - fn load_tsconfig_paths( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - let Some(tsconfig_options) = &self.options.tsconfig else { - return Ok(None); - }; - let tsconfig = self.load_tsconfig( - /* root */ true, - &tsconfig_options.config_file, - &tsconfig_options.references, - )?; - let paths = tsconfig.resolve(cached_path.path(), specifier); - for path in paths { - let cached_path = self.cache.value(&path); - if let Ok(path) = self.require_relative(&cached_path, ".", ctx) { - return Ok(Some(path)); - } - } - Ok(None) - } - - fn load_tsconfig( - &self, - root: bool, - path: &Path, - references: &TsconfigReferences, - ) -> Result, ResolveError> { - self.cache.tsconfig(root, path, |tsconfig| { - let directory = self.cache.value(tsconfig.directory()); - tracing::trace!(tsconfig = ?tsconfig, "load_tsconfig"); - - // Extend tsconfig - if let Some(extends) = &tsconfig.extends { - let extended_tsconfig_paths = match extends { - ExtendsField::Single(s) => { - vec![self.get_extended_tsconfig_path(&directory, tsconfig, s)?] - } - ExtendsField::Multiple(specifiers) => specifiers - .iter() - .map(|s| self.get_extended_tsconfig_path(&directory, tsconfig, s)) - .collect::, ResolveError>>()?, - }; - for extended_tsconfig_path in extended_tsconfig_paths { - let extended_tsconfig = self.load_tsconfig( - /* root */ false, - &extended_tsconfig_path, - &TsconfigReferences::Disabled, - )?; - tsconfig.extend_tsconfig(&extended_tsconfig); - } - } - - // Load project references - match references { - TsconfigReferences::Disabled => { - tsconfig.references.drain(..); - } - TsconfigReferences::Auto => {} - TsconfigReferences::Paths(paths) => { - tsconfig.references = paths - .iter() - .map(|path| ProjectReference { path: path.clone(), tsconfig: None }) - .collect(); - } - } - if !tsconfig.references.is_empty() { - let directory = tsconfig.directory().to_path_buf(); - for reference in &mut tsconfig.references { - let reference_tsconfig_path = directory.normalize_with(&reference.path); - let tsconfig = self.cache.tsconfig( - /* root */ true, - &reference_tsconfig_path, - |_| Ok(()), - )?; - reference.tsconfig.replace(tsconfig); - } - } - Ok(()) - }) - } - - fn get_extended_tsconfig_path( - &self, - directory: &CachedPath, - tsconfig: &TsConfig, - specifier: &str, - ) -> Result { - match specifier.as_bytes().first() { - None => Err(ResolveError::Specifier(SpecifierError::Empty(specifier.to_string()))), - Some(b'/') => Ok(PathBuf::from(specifier)), - Some(b'.') => Ok(tsconfig.directory().normalize_with(specifier)), - _ => self - .clone_with_options(ResolveOptions { - description_files: vec![], - extensions: vec![".json".into()], - main_files: vec!["tsconfig.json".into()], - ..ResolveOptions::default() - }) - .load_package_self_or_node_modules(directory, specifier, &mut Ctx::default()) - .map(|p| p.to_path_buf()) - .map_err(|err| match err { - ResolveError::NotFound(_) => { - ResolveError::TsconfigNotFound(PathBuf::from(specifier)) - } - _ => err, - }), - } - } - - /// PACKAGE_RESOLVE(packageSpecifier, parentURL) - fn package_resolve( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - let (package_name, subpath) = Self::parse_package_specifier(specifier); - // 11. While parentURL is not the file system root, - for module_name in &self.options.modules { - for cached_path in std::iter::successors(Some(cached_path), |p| p.parent()) { - // 1. Let packageURL be the URL resolution of "node_modules/" concatenated with packageSpecifier, relative to parentURL. - let Some(cached_path) = self.get_module_directory(cached_path, module_name, ctx) - else { - continue; - }; - // 2. Set parentURL to the parent folder URL of parentURL. - let package_path = cached_path.path().normalize_with(package_name); - let cached_path = self.cache.value(&package_path); - // 3. If the folder at packageURL does not exist, then - // 1. Continue the next loop iteration. - if cached_path.is_dir(&self.cache.fs, ctx) { - // 4. Let pjson be the result of READ_PACKAGE_JSON(packageURL). - if let Some(package_json) = - cached_path.package_json(&self.cache.fs, &self.options, ctx)? - { - // 5. If pjson is not null and pjson.exports is not null or undefined, then - // 1. Return the result of PACKAGE_EXPORTS_RESOLVE(packageURL, packageSubpath, pjson.exports, defaultConditions). - for exports in package_json.exports_fields(&self.options.exports_fields) { - if let Some(path) = self.package_exports_resolve( - cached_path.path(), - &format!(".{subpath}"), - exports, - ctx, - )? { - return Ok(Some(path)); - } - } - // 6. Otherwise, if packageSubpath is equal to ".", then - if subpath == "." { - // 1. If pjson.main is a string, then - for main_field in package_json.main_fields(&self.options.main_fields) { - // 1. Return the URL resolution of main in packageURL. - let path = cached_path.path().normalize_with(main_field); - let cached_path = self.cache.value(&path); - if cached_path.is_file(&self.cache.fs, ctx) { - return Ok(Some(cached_path)); - } - } - } - } - let subpath = format!(".{subpath}"); - let specifier = Specifier::parse(&subpath).map_err(ResolveError::Specifier)?; - ctx.with_fully_specified(false); - ctx.with_query_fragment(specifier.query, specifier.fragment); - return self.require(&cached_path, specifier.path(), ctx).map(Some); - } - } - } - - Err(ResolveError::NotFound(specifier.to_string())) - } - - /// PACKAGE_EXPORTS_RESOLVE(packageURL, subpath, exports, conditions) - fn package_exports_resolve( - &self, - package_url: &Path, - subpath: &str, - exports: &JSONValue, - ctx: &mut Ctx, - ) -> ResolveResult { - let conditions = &self.options.condition_names; - // 1. If exports is an Object with both a key starting with "." and a key not starting with ".", throw an Invalid Package Configuration error. - if let JSONValue::Object(map) = exports { - let mut has_dot = false; - let mut without_dot = false; - for key in map.keys() { - has_dot = has_dot || key.starts_with(|s| s == '.' || s == '#'); - without_dot = without_dot || !key.starts_with(|s| s == '.' || s == '#'); - if has_dot && without_dot { - return Err(ResolveError::InvalidPackageConfig( - package_url.join("package.json"), - )); - } - } - } - // 2. If subpath is equal to ".", then - // Note: subpath is not prepended with a dot when passed in. - if subpath == "." { - // enhanced-resolve appends query and fragment when resolving exports field - // https://github.com/webpack/enhanced-resolve/blob/a998c7d218b7a9ec2461fc4fddd1ad5dd7687485/lib/ExportsFieldPlugin.js#L57-L62 - // This is only need when querying the main export, otherwise ctx is passed through. - if ctx.query.is_some() || ctx.fragment.is_some() { - let query = ctx.query.clone().unwrap_or_default(); - let fragment = ctx.fragment.clone().unwrap_or_default(); - return Err(ResolveError::PackagePathNotExported( - format!("./{}{query}{fragment}", subpath.trim_start_matches('.')), - package_url.join("package.json"), - )); - } - // 1. Let mainExport be undefined. - let main_export = match exports { - // 2. If exports is a String or Array, or an Object containing no keys starting with ".", then - JSONValue::String(_) | JSONValue::Array(_) => { - // 1. Set mainExport to exports. - Some(exports) - } - // 3. Otherwise if exports is an Object containing a "." property, then - JSONValue::Object(map) => { - // 1. Set mainExport to exports["."]. - map.get(".").map_or_else( - || { - if map.keys().any(|key| key.starts_with("./") || key.starts_with('#')) { - None - } else { - Some(exports) - } - }, - Some, - ) - } - _ => None, - }; - // 4. If mainExport is not undefined, then - if let Some(main_export) = main_export { - // 1. Let resolved be the result of PACKAGE_TARGET_RESOLVE( packageURL, mainExport, null, false, conditions). - let resolved = self.package_target_resolve( - package_url, - ".", - main_export, - None, - /* is_imports */ false, - conditions, - ctx, - )?; - // 2. If resolved is not null or undefined, return resolved. - if let Some(path) = resolved { - return Ok(Some(path)); - } - } - } - // 3. Otherwise, if exports is an Object and all keys of exports start with ".", then - if let JSONValue::Object(exports) = exports { - // 1. Let matchKey be the string "./" concatenated with subpath. - // Note: `package_imports_exports_resolve` does not require the leading dot. - let match_key = &subpath; - // 2. Let resolved be the result of PACKAGE_IMPORTS_EXPORTS_RESOLVE( matchKey, exports, packageURL, false, conditions). - if let Some(path) = self.package_imports_exports_resolve( - match_key, - exports, - package_url, - /* is_imports */ false, - conditions, - ctx, - )? { - // 3. If resolved is not null or undefined, return resolved. - return Ok(Some(path)); - } - } - // 4. Throw a Package Path Not Exported error. - Err(ResolveError::PackagePathNotExported( - subpath.to_string(), - package_url.join("package.json"), - )) - } - - /// PACKAGE_IMPORTS_RESOLVE(specifier, parentURL, conditions) - fn package_imports_resolve( - &self, - specifier: &str, - package_json: &PackageJson, - ctx: &mut Ctx, - ) -> Result, ResolveError> { - // 1. Assert: specifier begins with "#". - debug_assert!(specifier.starts_with('#'), "{specifier}"); - // 2. If specifier is exactly equal to "#" or starts with "#/", then - // 1. Throw an Invalid Module Specifier error. - // 3. Let packageURL be the result of LOOKUP_PACKAGE_SCOPE(parentURL). - // 4. If packageURL is not null, then - - // 1. Let pjson be the result of READ_PACKAGE_JSON(packageURL). - // 2. If pjson.imports is a non-null Object, then - - // 1. Let resolved be the result of PACKAGE_IMPORTS_EXPORTS_RESOLVE( specifier, pjson.imports, packageURL, true, conditions). - let mut has_imports = false; - for imports in package_json.imports_fields(&self.options.imports_fields) { - if !has_imports { - has_imports = true; - // TODO: fill in test case for this case - if specifier == "#" || specifier.starts_with("#/") { - return Err(ResolveError::InvalidModuleSpecifier( - specifier.to_string(), - package_json.path.clone(), - )); - } - } - if let Some(path) = self.package_imports_exports_resolve( - specifier, - imports, - package_json.directory(), - /* is_imports */ true, - &self.options.condition_names, - ctx, - )? { - // 2. If resolved is not null or undefined, return resolved. - return Ok(Some(path)); - } - } - - // 5. Throw a Package Import Not Defined error. - if has_imports { - Err(ResolveError::PackageImportNotDefined( - specifier.to_string(), - package_json.path.clone(), - )) - } else { - Ok(None) - } - } - - /// PACKAGE_IMPORTS_EXPORTS_RESOLVE(matchKey, matchObj, packageURL, isImports, conditions) - fn package_imports_exports_resolve( - &self, - match_key: &str, - match_obj: &JSONMap, - package_url: &Path, - is_imports: bool, - conditions: &[String], - ctx: &mut Ctx, - ) -> ResolveResult { - // enhanced-resolve behaves differently, it throws - // Error: CachedPath to directories is not possible with the exports field (specifier was ./dist/) - if match_key.ends_with('/') { - return Ok(None); - } - // 1. If matchKey is a key of matchObj and does not contain "*", then - if !match_key.contains('*') { - // 1. Let target be the value of matchObj[matchKey]. - if let Some(target) = match_obj.get(match_key) { - // 2. Return the result of PACKAGE_TARGET_RESOLVE(packageURL, target, null, isImports, conditions). - return self.package_target_resolve( - package_url, - match_key, - target, - None, - is_imports, - conditions, - ctx, - ); - } - } - - let mut best_target = None; - let mut best_match = ""; - let mut best_key = ""; - // 2. Let expansionKeys be the list of keys of matchObj containing only a single "*", sorted by the sorting function PATTERN_KEY_COMPARE which orders in descending order of specificity. - // 3. For each key expansionKey in expansionKeys, do - for (expansion_key, target) in match_obj { - if expansion_key.starts_with("./") || expansion_key.starts_with('#') { - // 1. Let patternBase be the substring of expansionKey up to but excluding the first "*" character. - if let Some((pattern_base, pattern_trailer)) = expansion_key.split_once('*') { - // 2. If matchKey starts with but is not equal to patternBase, then - if match_key.starts_with(pattern_base) - // 1. Let patternTrailer be the substring of expansionKey from the index after the first "*" character. - && !pattern_trailer.contains('*') - // 2. If patternTrailer has zero length, or if matchKey ends with patternTrailer and the length of matchKey is greater than or equal to the length of expansionKey, then - && (pattern_trailer.is_empty() - || (match_key.len() >= expansion_key.len() - && match_key.ends_with(pattern_trailer))) - && Self::pattern_key_compare(best_key, expansion_key).is_gt() - { - // 1. Let target be the value of matchObj[expansionKey]. - best_target = Some(target); - // 2. Let patternMatch be the substring of matchKey starting at the index of the length of patternBase up to the length of matchKey minus the length of patternTrailer. - best_match = - &match_key[pattern_base.len()..match_key.len() - pattern_trailer.len()]; - best_key = expansion_key; - } - } else if expansion_key.ends_with('/') - && match_key.starts_with(expansion_key) - && Self::pattern_key_compare(best_key, expansion_key).is_gt() - { - // TODO: [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./dist/" in the "exports" field module resolution of the package at xxx/package.json. - best_target = Some(target); - best_match = &match_key[expansion_key.len()..]; - best_key = expansion_key; - } - } - } - if let Some(best_target) = best_target { - // 3. Return the result of PACKAGE_TARGET_RESOLVE(packageURL, target, patternMatch, isImports, conditions). - return self.package_target_resolve( - package_url, - best_key, - best_target, - Some(best_match), - is_imports, - conditions, - ctx, - ); - } - // 4. Return null. - Ok(None) - } - - /// PACKAGE_TARGET_RESOLVE(packageURL, target, patternMatch, isImports, conditions) - #[allow(clippy::too_many_arguments)] - fn package_target_resolve( - &self, - package_url: &Path, - target_key: &str, - target: &JSONValue, - pattern_match: Option<&str>, - is_imports: bool, - conditions: &[String], - ctx: &mut Ctx, - ) -> ResolveResult { - fn normalize_string_target<'a>( - target_key: &'a str, - target: &'a str, - pattern_match: Option<&'a str>, - package_url: &Path, - ) -> Result, ResolveError> { - let target = if let Some(pattern_match) = pattern_match { - if !target_key.contains('*') && !target.contains('*') { - // enhanced-resolve behaviour - // TODO: [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./dist/" in the "exports" field module resolution of the package at xxx/package.json. - if target_key.ends_with('/') && target.ends_with('/') { - Cow::Owned(format!("{target}{pattern_match}")) - } else { - return Err(ResolveError::InvalidPackageConfigDirectory( - package_url.join("package.json"), - )); - } - } else { - Cow::Owned(target.replace('*', pattern_match)) - } - } else { - Cow::Borrowed(target) - }; - Ok(target) - } - - match target { - // 1. If target is a String, then - JSONValue::String(target) => { - // 1. If target does not start with "./", then - if !target.starts_with("./") { - // 1. If isImports is false, or if target starts with "../" or "/", or if target is a valid URL, then - if !is_imports || target.starts_with("../") || target.starts_with('/') { - // 1. Throw an Invalid Package Target error. - return Err(ResolveError::InvalidPackageTarget( - target.to_string(), - target_key.to_string(), - package_url.join("package.json"), - )); - } - // 2. If patternMatch is a String, then - // 1. Return PACKAGE_RESOLVE(target with every instance of "*" replaced by patternMatch, packageURL + "/"). - let target = - normalize_string_target(target_key, target, pattern_match, package_url)?; - let package_url = self.cache.value(package_url); - // // 3. Return PACKAGE_RESOLVE(target, packageURL + "/"). - return self.package_resolve(&package_url, &target, ctx); - } - - // 2. If target split on "/" or "\" contains any "", ".", "..", or "node_modules" segments after the first "." segment, case insensitive and including percent encoded variants, throw an Invalid Package Target error. - // 3. Let resolvedTarget be the URL resolution of the concatenation of packageURL and target. - // 4. Assert: resolvedTarget is contained in packageURL. - // 5. If patternMatch is null, then - let target = - normalize_string_target(target_key, target, pattern_match, package_url)?; - if Path::new(target.as_ref()).is_invalid_exports_target() { - return Err(ResolveError::InvalidPackageTarget( - target.to_string(), - target_key.to_string(), - package_url.join("package.json"), - )); - } - let resolved_target = package_url.normalize_with(target.as_ref()); - // 6. If patternMatch split on "/" or "\" contains any "", ".", "..", or "node_modules" segments, case insensitive and including percent encoded variants, throw an Invalid Module Specifier error. - // 7. Return the URL resolution of resolvedTarget with every instance of "*" replaced with patternMatch. - let value = self.cache.value(&resolved_target); - return Ok(Some(value)); - } - // 2. Otherwise, if target is a non-null Object, then - JSONValue::Object(target) => { - // 1. If exports contains any index property keys, as defined in ECMA-262 6.1.7 Array Index, throw an Invalid Package Configuration error. - // 2. For each property p of target, in object insertion order as, - for (i, (key, target_value)) in target.iter().enumerate() { - // https://nodejs.org/api/packages.html#conditional-exports - // "default" - the generic fallback that always matches. Can be a CommonJS or ES module file. This condition should always come last. - // Note: node.js does not throw this but enhanced-resolve does. - let is_default = key == "default"; - if i < target.len() - 1 && is_default { - return Err(ResolveError::InvalidPackageConfigDefault( - package_url.join("package.json"), - )); - } - - // 1. If p equals "default" or conditions contains an entry for p, then - if is_default || conditions.contains(key) { - // 1. Let targetValue be the value of the p property in target. - // 2. Let resolved be the result of PACKAGE_TARGET_RESOLVE( packageURL, targetValue, patternMatch, isImports, conditions). - let resolved = self.package_target_resolve( - package_url, - target_key, - target_value, - pattern_match, - is_imports, - conditions, - ctx, - ); - // 3. If resolved is equal to undefined, continue the loop. - if let Some(path) = resolved? { - // 4. Return resolved. - return Ok(Some(path)); - } - } - } - // 3. Return undefined. - return Ok(None); - } - // 3. Otherwise, if target is an Array, then - JSONValue::Array(targets) => { - // 1. If _target.length is zero, return null. - if targets.is_empty() { - // Note: return PackagePathNotExported has the same effect as return because there are no matches. - return Err(ResolveError::PackagePathNotExported( - pattern_match.unwrap_or(".").to_string(), - package_url.join("package.json"), - )); - } - // 2. For each item targetValue in target, do - for (i, target_value) in targets.iter().enumerate() { - // 1. Let resolved be the result of PACKAGE_TARGET_RESOLVE( packageURL, targetValue, patternMatch, isImports, conditions), continuing the loop on any Invalid Package Target error. - let resolved = self.package_target_resolve( - package_url, - target_key, - target_value, - pattern_match, - is_imports, - conditions, - ctx, - ); - - if resolved.is_err() && i == targets.len() { - return resolved; - } - - // 2. If resolved is undefined, continue the loop. - if let Ok(Some(path)) = resolved { - // 3. Return resolved. - return Ok(Some(path)); - } - } - // 3. Return or throw the last fallback resolution null return or error. - // Note: see `resolved.is_err() && i == targets.len()` - } - _ => {} - } - // 4. Otherwise, if target is null, return null. - Ok(None) - // 5. Otherwise throw an Invalid Package Target error. - } - - // Returns (module, subpath) - // https://github.com/nodejs/node/blob/8f0f17e1e3b6c4e58ce748e06343c5304062c491/lib/internal/modules/esm/resolve.js#L688 - fn parse_package_specifier(specifier: &str) -> (&str, &str) { - let mut separator_index = specifier.as_bytes().iter().position(|b| *b == b'/'); - // let mut valid_package_name = true; - // let mut is_scoped = false; - if specifier.starts_with('@') { - // is_scoped = true; - if separator_index.is_none() || specifier.is_empty() { - // valid_package_name = false; - } else if let Some(index) = &separator_index { - separator_index = specifier[*index + 1..] - .as_bytes() - .iter() - .position(|b| *b == b'/') - .map(|i| i + *index + 1); - } - } - let package_name = - separator_index.map_or(specifier, |separator_index| &specifier[..separator_index]); - - // TODO: https://github.com/nodejs/node/blob/8f0f17e1e3b6c4e58ce748e06343c5304062c491/lib/internal/modules/esm/resolve.js#L705C1-L714C1 - // Package name cannot have leading . and cannot have percent-encoding or - // \\ separators. - // if (RegExpPrototypeExec(invalidPackageNameRegEx, packageName) !== null) - // validPackageName = false; - - // if (!validPackageName) { - // throw new ERR_INVALID_MODULE_SPECIFIER( - // specifier, 'is not a valid package name', fileURLToPath(base)); - // } - let package_subpath = - separator_index.map_or("", |separator_index| &specifier[separator_index..]); - (package_name, package_subpath) - } - - /// PATTERN_KEY_COMPARE(keyA, keyB) - fn pattern_key_compare(key_a: &str, key_b: &str) -> Ordering { - if key_a.is_empty() { - return Ordering::Greater; - } - // 1. Assert: keyA ends with "/" or contains only a single "*". - debug_assert!(key_a.ends_with('/') || key_a.match_indices('*').count() == 1, "{key_a}"); - // 2. Assert: keyB ends with "/" or contains only a single "*". - debug_assert!(key_b.ends_with('/') || key_b.match_indices('*').count() == 1, "{key_b}"); - // 3. Let baseLengthA be the index of "*" in keyA plus one, if keyA contains "*", or the length of keyA otherwise. - let a_pos = key_a.chars().position(|c| c == '*'); - let base_length_a = a_pos.map_or(key_a.len(), |p| p + 1); - // 4. Let baseLengthB be the index of "*" in keyB plus one, if keyB contains "*", or the length of keyB otherwise. - let b_pos = key_b.chars().position(|c| c == '*'); - let base_length_b = b_pos.map_or(key_b.len(), |p| p + 1); - // 5. If baseLengthA is greater than baseLengthB, return -1. - if base_length_a > base_length_b { - return Ordering::Less; - } - // 6. If baseLengthB is greater than baseLengthA, return 1. - if base_length_b > base_length_a { - return Ordering::Greater; - } - // 7. If keyA does not contain "*", return 1. - if !key_a.contains('*') { - return Ordering::Greater; - } - // 8. If keyB does not contain "*", return -1. - if !key_b.contains('*') { - return Ordering::Less; - } - // 9. If the length of keyA is greater than the length of keyB, return -1. - if key_a.len() > key_b.len() { - return Ordering::Less; - } - // 10. If the length of keyB is greater than the length of keyA, return 1. - if key_b.len() > key_a.len() { - return Ordering::Greater; - } - // 11. Return 0. - Ordering::Equal - } - - fn strip_package_name<'a>(specifier: &'a str, package_name: &'a str) -> Option<&'a str> { - specifier - .strip_prefix(package_name) - .filter(|tail| tail.is_empty() || tail.starts_with(SLASH_START)) - } -} diff --git a/Source/options.rs b/Source/options.rs deleted file mode 100644 index f473a133..00000000 --- a/Source/options.rs +++ /dev/null @@ -1,623 +0,0 @@ -use std::path::Path; -use std::{fmt, path::PathBuf}; - -/// Module Resolution Options -/// -/// Options are directly ported from [enhanced-resolve](https://github.com/webpack/enhanced-resolve#resolver-options). -/// -/// See [webpack resolve](https://webpack.js.org/configuration/resolve/) for information and examples -#[derive(Debug, Clone)] -pub struct ResolveOptions { - /// Path to TypeScript configuration file. - /// - /// Default `None` - pub tsconfig: Option, - - /// Create aliases to import or require certain modules more easily. - /// - /// An alias is used to replace a whole path or part of a path. - /// For example, to alias a commonly used `src/` folders: `vec![("@/src"), vec![AliasValue::Path("/path/to/src")]]` - /// - /// A trailing $ can also be added to the given object's keys to signify an exact match. - /// - /// See [webpack's `resolve.alias` documentation](https://webpack.js.org/configuration/resolve/#resolvealias) for a list of use cases. - pub alias: Alias, - - /// A list of alias fields in description files. - /// - /// Specify a field, such as `browser`, to be parsed according to [this specification](https://github.com/defunctzombie/package-browser-field-spec). - /// Can be a path to json object such as `["path", "to", "exports"]`. - /// - /// Default `[]` - pub alias_fields: Vec>, - - /// Condition names for exports field which defines entry points of a package. - /// - /// The key order in the exports field is significant. During condition matching, earlier entries have higher priority and take precedence over later entries. - /// - /// Default `[]` - pub condition_names: Vec, - - /// The JSON files to use for descriptions. (There was once a `bower.json`.) - /// - /// Default `["package.json"]` - pub description_files: Vec, - - /// Set to [EnforceExtension::Enabled] for [ESM Mandatory file extensions](https://nodejs.org/api/esm.html#mandatory-file-extensions). - /// - /// If `enforce_extension` is set to [EnforceExtension::Enabled], resolution will not allow extension-less files. - /// This means `require('./foo.js')` will resolve, while `require('./foo')` will not. - /// - /// The default value for `enforce_extension` is [EnforceExtension::Auto], which is changed upon initialization. - /// - /// It changes to [EnforceExtension::Enabled] if [ResolveOptions::extensions] contains an empty string; - /// otherwise, this value changes to [EnforceExtension::Disabled]. - /// - /// Explicitly set the value to [EnforceExtension::Disabled] to disable this automatic behavior. - /// - /// For reference, this behavior is aligned with `enhanced-resolve`. See . - pub enforce_extension: EnforceExtension, - - /// A list of exports fields in description files. - /// - /// Can be a path to a JSON object such as `["path", "to", "exports"]`. - /// - /// Default `[["exports"]]`. - pub exports_fields: Vec>, - - /// Fields from `package.json` which are used to provide the internal requests of a package - /// (requests starting with # are considered internal). - /// - /// Can be a path to a JSON object such as `["path", "to", "imports"]`. - /// - /// Default `[["imports"]]`. - pub imports_fields: Vec>, - - /// An object which maps extension to extension aliases. - /// - /// Default `{}` - pub extension_alias: Vec<(String, Vec)>, - - /// Attempt to resolve these extensions in order. - /// - /// If multiple files share the same name but have different extensions, - /// will resolve the one with the extension listed first in the array and skip the rest. - /// - /// All extensions must have a leading dot. - /// - /// Default `[".js", ".json", ".node"]` - pub extensions: Vec, - - /// Redirect module requests when normal resolving fails. - /// - /// Default `[]` - pub fallback: Alias, - - /// 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). - /// - /// See also webpack configuration [resolve.fullySpecified](https://webpack.js.org/configuration/module/#resolvefullyspecified) - /// - /// Default `false` - pub fully_specified: bool, - - /// A list of main fields in description files - /// - /// Default `["main"]`. - pub main_fields: Vec, - - /// The filename to be used while resolving directories. - /// - /// Default `["index"]` - pub main_files: Vec, - - /// A list of directories to resolve modules from, can be absolute path or folder name. - /// - /// Default `["node_modules"]` - pub modules: Vec, - - /// Resolve to a context instead of a file. - /// - /// Default `false` - pub resolve_to_context: bool, - - /// Prefer to resolve module requests as relative requests instead of using modules from node_modules directories. - /// - /// Default `false` - pub prefer_relative: bool, - - /// Prefer to resolve server-relative urls as absolute paths before falling back to resolve in ResolveOptions::roots. - /// - /// Default `false` - pub prefer_absolute: bool, - - /// A list of resolve restrictions to restrict the paths that a request can be resolved on. - /// - /// Default `[]` - pub restrictions: Vec, - - /// A list of directories where requests of server-relative URLs (starting with '/') are resolved. - /// On non-Windows systems these requests are resolved as an absolute path first. - /// - /// Default `[]` - pub roots: Vec, - - /// Whether to resolve symlinks to their symlinked location. - /// When enabled, symlinked resources are resolved to their real path, not their symlinked location. - /// Note that this may cause module resolution to fail when using tools that symlink packages (like npm link). - /// - /// Default `true` - pub symlinks: bool, - - /// Whether to parse [module.builtinModules](https://nodejs.org/api/module.html#modulebuiltinmodules) or not. - /// For example, "zlib" will throw [crate::ResolveError::Builtin] when set to true. - /// - /// Default `false` - pub builtin_modules: bool, -} - -impl ResolveOptions { - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// - /// let options = ResolveOptions::default().with_condition_names(&["bar"]); - /// assert_eq!(options.condition_names, vec!["bar".to_string()]) - /// ``` - #[must_use] - pub fn with_condition_names(mut self, names: &[&str]) -> Self { - self.condition_names = names.iter().map(ToString::to_string).collect::>(); - self - } - - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// - /// let options = ResolveOptions::default().with_builtin_modules(false); - /// assert_eq!(options.builtin_modules, false) - /// ``` - #[must_use] - pub fn with_builtin_modules(mut self, flag: bool) -> Self { - self.builtin_modules = flag; - self - } - - /// Adds a single root to the options - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_root("foo"); - /// assert_eq!(options.roots, vec![PathBuf::from("foo")]) - /// ``` - #[must_use] - pub fn with_root>(mut self, root: P) -> Self { - self.roots.push(root.as_ref().to_path_buf()); - self - } - - /// Adds a single extension to the list of extensions - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_extension("jsonc"); - /// assert!(options.extensions.contains(&"jsonc".to_string())); - /// ``` - #[must_use] - pub fn with_extension>(mut self, extension: S) -> Self { - self.extensions.push(extension.into()); - self - } - - /// Adds a single main field to the list of fields - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_main_field("something"); - /// assert!(options.main_fields.contains(&"something".to_string())); - /// ``` - #[must_use] - pub fn with_main_field>(mut self, field: S) -> Self { - self.main_fields.push(field.into()); - self - } - - /// Changes how the extension should be treated - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions, EnforceExtension}; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_force_extension(EnforceExtension::Enabled); - /// assert_eq!(options.enforce_extension, EnforceExtension::Enabled); - /// ``` - #[must_use] - pub fn with_force_extension(mut self, enforce_extension: EnforceExtension) -> Self { - self.enforce_extension = enforce_extension; - self - } - - /// Sets the value for [ResolveOptions::fully_specified] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_fully_specified(true); - /// assert_eq!(options.fully_specified, true); - /// ``` - #[must_use] - pub fn with_fully_specified(mut self, fully_specified: bool) -> Self { - self.fully_specified = fully_specified; - self - } - /// Sets the value for [ResolveOptions::prefer_relative] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_prefer_relative(true); - /// assert_eq!(options.prefer_relative, true); - /// ``` - #[must_use] - pub fn with_prefer_relative(mut self, flag: bool) -> Self { - self.prefer_relative = flag; - self - } - /// Sets the value for [ResolveOptions::prefer_absolute] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_prefer_absolute(true); - /// assert_eq!(options.prefer_absolute, true); - /// ``` - #[must_use] - pub fn with_prefer_absolute(mut self, flag: bool) -> Self { - self.prefer_absolute = flag; - self - } - - /// Changes the value of [ResolveOptions::symlinks] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// - /// let options = ResolveOptions::default().with_symbolic_link(false); - /// assert_eq!(options.symlinks, false); - /// ``` - #[must_use] - pub fn with_symbolic_link(mut self, flag: bool) -> Self { - self.symlinks = flag; - self - } - - /// Adds a module to [ResolveOptions::modules] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// - /// let options = ResolveOptions::default().with_module("module"); - /// assert!(options.modules.contains(&"module".to_string())); - /// ``` - #[must_use] - pub fn with_module>(mut self, module: M) -> Self { - self.modules.push(module.into()); - self - } - - /// Adds a main file to [ResolveOptions::main_files] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// - /// let options = ResolveOptions::default().with_main_file("foo"); - /// assert!(options.main_files.contains(&"foo".to_string())); - /// ``` - #[must_use] - pub fn with_main_file>(mut self, module: M) -> Self { - self.main_files.push(module.into()); - self - } - - pub(crate) fn sanitize(mut self) -> Self { - debug_assert!( - self.extensions.iter().filter(|e| !e.is_empty()).all(|e| e.starts_with('.')), - "All extensions must start with a leading dot" - ); - // Set `enforceExtension` to `true` when [ResolveOptions::extensions] contains an empty string. - // See - if self.enforce_extension == EnforceExtension::Auto { - if !self.extensions.is_empty() && self.extensions.iter().any(String::is_empty) { - self.enforce_extension = EnforceExtension::Enabled; - } else { - self.enforce_extension = EnforceExtension::Disabled; - } - } - self - } -} - -/// Value for [ResolveOptions::enforce_extension] -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -pub enum EnforceExtension { - Auto, - Enabled, - Disabled, -} - -impl EnforceExtension { - pub const fn is_auto(&self) -> bool { - matches!(self, Self::Auto) - } - - pub const fn is_enabled(&self) -> bool { - matches!(self, Self::Enabled) - } - - pub const fn is_disabled(&self) -> bool { - matches!(self, Self::Disabled) - } -} - -/// Alias for [ResolveOptions::alias] and [ResolveOptions::fallback] -pub type Alias = Vec<(String, Vec)>; - -/// Alias Value for [ResolveOptions::alias] and [ResolveOptions::fallback] -#[derive(Debug, Clone, Hash, PartialEq, Eq)] -pub enum AliasValue { - /// The path value - Path(String), - - /// The `false` value - Ignore, -} - -impl From for AliasValue -where - S: Into, -{ - fn from(value: S) -> Self { - Self::Path(value.into()) - } -} - -/// Value for [ResolveOptions::restrictions] -#[derive(Debug, Clone)] -pub enum Restriction { - Path(PathBuf), - RegExp(String), -} - -/// Tsconfig Options for [ResolveOptions::tsconfig] -/// -/// Derived from [tsconfig-paths-webpack-plugin](https://github.com/dividab/tsconfig-paths-webpack-plugin#options) -#[derive(Debug, Clone)] -pub struct TsconfigOptions { - /// Allows you to specify where to find the TypeScript configuration file. - /// You may provide - /// * a relative path to the configuration file. It will be resolved relative to cwd. - /// * an absolute path to the configuration file. - pub config_file: PathBuf, - - /// Support for Typescript Project References. - pub references: TsconfigReferences, -} - -/// Configuration for [TsconfigOptions::references] -#[derive(Debug, Clone)] -pub enum TsconfigReferences { - Disabled, - /// Use the `references` field from tsconfig of `config_file`. - Auto, - /// Manually provided relative or absolute path. - Paths(Vec), -} - -impl Default for ResolveOptions { - fn default() -> Self { - Self { - tsconfig: None, - alias: vec![], - alias_fields: vec![], - condition_names: vec![], - description_files: vec!["package.json".into()], - enforce_extension: EnforceExtension::Auto, - extension_alias: vec![], - exports_fields: vec![vec!["exports".into()]], - imports_fields: vec![vec!["imports".into()]], - extensions: vec![".js".into(), ".json".into(), ".node".into()], - fallback: vec![], - fully_specified: false, - main_fields: vec!["main".into()], - main_files: vec!["index".into()], - modules: vec!["node_modules".into()], - resolve_to_context: false, - prefer_relative: false, - prefer_absolute: false, - restrictions: vec![], - roots: vec![], - symlinks: true, - builtin_modules: false, - } - } -} - -// For tracing -impl fmt::Display for ResolveOptions { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - if let Some(tsconfig) = &self.tsconfig { - write!(f, "tsconfig:{tsconfig:?},")?; - } - if !self.alias.is_empty() { - write!(f, "alias:{:?},", self.alias)?; - } - if !self.alias_fields.is_empty() { - write!(f, "alias_fields:{:?},", self.alias_fields)?; - } - if !self.condition_names.is_empty() { - write!(f, "condition_names:{:?},", self.condition_names)?; - } - if self.enforce_extension.is_enabled() { - write!(f, "enforce_extension:{:?},", self.enforce_extension)?; - } - if !self.exports_fields.is_empty() { - write!(f, "exports_fields:{:?},", self.exports_fields)?; - } - if !self.imports_fields.is_empty() { - write!(f, "imports_fields:{:?},", self.imports_fields)?; - } - if !self.extension_alias.is_empty() { - write!(f, "extension_alias:{:?},", self.extension_alias)?; - } - if !self.extensions.is_empty() { - write!(f, "extensions:{:?},", self.extensions)?; - } - if !self.fallback.is_empty() { - write!(f, "fallback:{:?},", self.fallback)?; - } - if self.fully_specified { - write!(f, "fully_specified:{:?},", self.fully_specified)?; - } - if !self.main_fields.is_empty() { - write!(f, "main_fields:{:?},", self.main_fields)?; - } - if !self.main_files.is_empty() { - write!(f, "main_files:{:?},", self.main_files)?; - } - if !self.modules.is_empty() { - write!(f, "modules:{:?},", self.modules)?; - } - if self.resolve_to_context { - write!(f, "resolve_to_context:{:?},", self.resolve_to_context)?; - } - if self.prefer_relative { - write!(f, "prefer_relative:{:?},", self.prefer_relative)?; - } - if self.prefer_absolute { - write!(f, "prefer_absolute:{:?},", self.prefer_absolute)?; - } - if !self.restrictions.is_empty() { - write!(f, "restrictions:{:?},", self.restrictions)?; - } - if !self.roots.is_empty() { - write!(f, "roots:{:?},", self.roots)?; - } - if self.symlinks { - write!(f, "symlinks:{:?},", self.symlinks)?; - } - if self.builtin_modules { - write!(f, "builtin_modules:{:?},", self.builtin_modules)?; - } - Ok(()) - } -} - -#[cfg(test)] -mod test { - use super::{ - AliasValue, EnforceExtension, ResolveOptions, Restriction, TsconfigOptions, - TsconfigReferences, - }; - use std::path::PathBuf; - - #[test] - fn enforce_extension() { - assert!(EnforceExtension::Auto.is_auto()); - assert!(!EnforceExtension::Enabled.is_auto()); - assert!(!EnforceExtension::Disabled.is_auto()); - - assert!(!EnforceExtension::Auto.is_enabled()); - assert!(EnforceExtension::Enabled.is_enabled()); - assert!(!EnforceExtension::Disabled.is_enabled()); - - assert!(!EnforceExtension::Auto.is_disabled()); - assert!(!EnforceExtension::Enabled.is_disabled()); - assert!(EnforceExtension::Disabled.is_disabled()); - } - - #[test] - fn display() { - let options = ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: PathBuf::from("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - alias: vec![("a".into(), vec![AliasValue::Ignore])], - alias_fields: vec![vec!["browser".into()]], - condition_names: vec!["require".into()], - enforce_extension: EnforceExtension::Enabled, - extension_alias: vec![(".js".into(), vec![".ts".into()])], - exports_fields: vec![vec!["exports".into()]], - imports_fields: vec![vec!["imports".into()]], - fallback: vec![("fallback".into(), vec![AliasValue::Ignore])], - fully_specified: true, - resolve_to_context: true, - prefer_relative: true, - prefer_absolute: true, - restrictions: vec![Restriction::Path(PathBuf::from("restrictions"))], - roots: vec![PathBuf::from("roots")], - builtin_modules: true, - ..ResolveOptions::default() - }; - - let expected = r#"tsconfig:TsconfigOptions { config_file: "tsconfig.json", references: Auto },alias:[("a", [Ignore])],alias_fields:[["browser"]],condition_names:["require"],enforce_extension:Enabled,exports_fields:[["exports"]],imports_fields:[["imports"]],extension_alias:[(".js", [".ts"])],extensions:[".js", ".json", ".node"],fallback:[("fallback", [Ignore])],fully_specified:true,main_fields:["main"],main_files:["index"],modules:["node_modules"],resolve_to_context:true,prefer_relative:true,prefer_absolute:true,restrictions:[Path("restrictions")],roots:["roots"],symlinks:true,builtin_modules:true,"#; - assert_eq!(format!("{options}"), expected); - - let options = ResolveOptions { - alias: vec![], - alias_fields: vec![], - builtin_modules: false, - condition_names: vec![], - description_files: vec![], - enforce_extension: EnforceExtension::Disabled, - exports_fields: vec![], - extension_alias: vec![], - extensions: vec![], - fallback: vec![], - fully_specified: false, - imports_fields: vec![], - main_fields: vec![], - main_files: vec![], - modules: vec![], - prefer_absolute: false, - prefer_relative: false, - resolve_to_context: false, - restrictions: vec![], - roots: vec![], - symlinks: false, - tsconfig: None, - }; - - assert_eq!(format!("{options}"), ""); - } -} diff --git a/Source/package_json.rs b/Source/package_json.rs deleted file mode 100644 index ab45f264..00000000 --- a/Source/package_json.rs +++ /dev/null @@ -1,209 +0,0 @@ -//! package.json definitions -//! -//! Code related to export field are copied from [Parcel's resolver](https://github.com/parcel-bundler/parcel/blob/v2/packages/utils/node-resolver-rs/src/package_json.rs) -use std::path::{Path, PathBuf}; - -use serde_json::Value as JSONValue; - -use crate::{path::PathUtil, ResolveError}; - -pub type JSONMap = serde_json::Map; - -/// Deserialized package.json -#[derive(Debug, Default)] -pub struct PackageJson { - /// Path to `package.json`. Contains the `package.json` filename. - pub path: PathBuf, - - /// Realpath to `package.json`. Contains the `package.json` filename. - pub realpath: PathBuf, - - /// The "name" field defines your package's name. - /// The "name" field can be used in addition to the "exports" field to self-reference a package using its name. - /// - /// - pub name: Option, - - raw_json: std::sync::Arc, -} - -impl PackageJson { - /// # Panics - /// # Errors - pub(crate) fn parse( - path: PathBuf, - realpath: PathBuf, - json: &str, - ) -> Result { - let mut raw_json: JSONValue = serde_json::from_str(json)?; - let mut package_json = Self::default(); - - if let Some(json_object) = raw_json.as_object_mut() { - // Remove large fields that are useless for pragmatic use. - #[cfg(feature = "package_json_raw_json_api")] - { - json_object.remove("description"); - json_object.remove("keywords"); - json_object.remove("scripts"); - json_object.remove("dependencies"); - json_object.remove("devDependencies"); - json_object.remove("peerDependencies"); - json_object.remove("optionalDependencies"); - } - - // Add name. - package_json.name = - json_object.get("name").and_then(|field| field.as_str()).map(ToString::to_string); - } - - package_json.path = path; - package_json.realpath = realpath; - package_json.raw_json = std::sync::Arc::new(raw_json); - Ok(package_json) - } - - fn get_value_by_path<'a>( - fields: &'a serde_json::Map, - path: &[String], - ) -> Option<&'a JSONValue> { - if path.is_empty() { - return None; - } - let Some(mut value) = fields.get(&path[0]) else { - return None; - }; - for key in path.iter().skip(1) { - if let Some(inner_value) = value.as_object().and_then(|o| o.get(key)) { - value = inner_value; - } else { - return None; - } - } - Some(value) - } - - /// Raw serde json value of `package.json`. - /// - /// This is currently used in Rspack for: - /// * getting the `sideEffects` field - /// * query in - search on GitHub indicates query on the `type` field. - /// - /// To reduce overall memory consumption, large fields that useless for pragmatic use are removed. - /// They are: `description`, `keywords`, `scripts`, - /// `dependencies` and `devDependencies`, `peerDependencies`, `optionalDependencies`. - #[cfg(feature = "package_json_raw_json_api")] - pub fn raw_json(&self) -> &std::sync::Arc { - &self.raw_json - } - - /// Directory to `package.json` - /// - /// # Panics - /// - /// * When the package.json path is misconfigured. - pub fn directory(&self) -> &Path { - debug_assert!(self.realpath.file_name().is_some_and(|x| x == "package.json")); - self.realpath.parent().unwrap() - } - - /// The "main" field defines the entry point of a package when imported by name via a node_modules lookup. Its value is a path. - /// - /// When a package has an "exports" field, this will take precedence over the "main" field when importing the package by name. - /// - /// Values are dynamically retrieved from [ResolveOptions::main_fields]. - /// - /// - pub(crate) fn main_fields<'a>( - &'a self, - main_fields: &'a [String], - ) -> impl Iterator + '_ { - main_fields - .iter() - .filter_map(|main_field| self.raw_json.get(main_field)) - .filter_map(|value| value.as_str()) - } - - /// The "exports" field allows defining the entry points of a package when imported by name loaded either via a node_modules lookup or a self-reference to its own name. - /// - /// - pub(crate) fn exports_fields<'a>( - &'a self, - exports_fields: &'a [Vec], - ) -> impl Iterator + '_ { - exports_fields.iter().filter_map(|object_path| { - self.raw_json - .as_object() - .and_then(|json_object| Self::get_value_by_path(json_object, object_path)) - }) - } - - /// In addition to the "exports" field, there is a package "imports" field to create private mappings that only apply to import specifiers from within the package itself. - /// - /// - pub(crate) fn imports_fields<'a>( - &'a self, - imports_fields: &'a [Vec], - ) -> impl Iterator + '_ { - imports_fields.iter().filter_map(|object_path| { - self.raw_json - .as_object() - .and_then(|json_object| Self::get_value_by_path(json_object, object_path)) - .and_then(|value| value.as_object()) - }) - } - - /// The "browser" field is provided by a module author as a hint to javascript bundlers or component tools when packaging modules for client side use. - /// Multiple values are configured by [ResolveOptions::alias_fields]. - /// - /// - fn browser_fields<'a>( - &'a self, - alias_fields: &'a [Vec], - ) -> impl Iterator + '_ { - alias_fields.iter().filter_map(|object_path| { - self.raw_json - .as_object() - .and_then(|json_object| Self::get_value_by_path(json_object, object_path)) - // Only object is valid, all other types are invalid - // https://github.com/webpack/enhanced-resolve/blob/3a28f47788de794d9da4d1702a3a583d8422cd48/lib/AliasFieldPlugin.js#L44-L52 - .and_then(|value| value.as_object()) - }) - } - - /// Resolve the request string for this package.json by looking at the `browser` field. - /// - /// # Errors - /// - /// * Returns [ResolveError::Ignored] for `"path": false` in `browser` field. - pub(crate) fn resolve_browser_field<'a>( - &'a self, - path: &Path, - request: Option<&str>, - alias_fields: &'a [Vec], - ) -> Result, ResolveError> { - for object in self.browser_fields(alias_fields) { - if let Some(request) = request { - if let Some(value) = object.get(request) { - return Self::alias_value(path, value); - } - } else { - let dir = self.path.parent().unwrap(); - for (key, value) in object { - let joined = dir.normalize_with(key); - if joined == path { - return Self::alias_value(path, value); - } - } - } - } - Ok(None) - } - - fn alias_value<'a>(key: &Path, value: &'a JSONValue) -> Result, ResolveError> { - match value { - JSONValue::String(value) => Ok(Some(value.as_str())), - JSONValue::Bool(b) if !b => Err(ResolveError::Ignored(key.to_path_buf())), - _ => Ok(None), - } - } -} diff --git a/Source/path.rs b/Source/path.rs deleted file mode 100644 index 5ec1b600..00000000 --- a/Source/path.rs +++ /dev/null @@ -1,126 +0,0 @@ -//! Path Utilities -//! -//! Code adapted from the following libraries -//! * [path-absolutize](https://docs.rs/path-absolutize) -//! * [normalize_path](https://docs.rs/normalize-path) -use std::path::{Component, Path, PathBuf}; - -pub const SLASH_START: &[char; 2] = &['/', '\\']; - -/// Extension trait to add path normalization to std's [`Path`]. -pub trait PathUtil { - /// Normalize this path without performing I/O. - /// - /// All redundant separator and up-level references are collapsed. - /// - /// However, this does not resolve links. - fn normalize(&self) -> PathBuf; - - /// Normalize with subpath assuming this path is normalized without performing I/O. - /// - /// All redundant separator and up-level references are collapsed. - /// - /// However, this does not resolve links. - fn normalize_with>(&self, subpath: P) -> PathBuf; - - /// Defined in ESM PACKAGE_TARGET_RESOLVE - /// If target split on "/" or "\" contains any "", ".", "..", or "node_modules" segments after the first "." segment, case insensitive and including percent encoded variants - fn is_invalid_exports_target(&self) -> bool; -} - -impl PathUtil for Path { - // https://github.com/parcel-bundler/parcel/blob/e0b99c2a42e9109a9ecbd6f537844a1b33e7faf5/packages/utils/node-resolver-rs/src/path.rs#L7 - fn normalize(&self) -> PathBuf { - let mut components = self.components().peekable(); - let mut ret = if let Some(c @ Component::Prefix(..)) = components.peek() { - let buf = PathBuf::from(c.as_os_str()); - components.next(); - buf - } else { - PathBuf::new() - }; - - for component in components { - match component { - Component::Prefix(..) => unreachable!("Path {:?}", self), - Component::RootDir => { - ret.push(component.as_os_str()); - } - Component::CurDir => {} - Component::ParentDir => { - ret.pop(); - } - Component::Normal(c) => { - ret.push(c); - } - } - } - - ret - } - - // https://github.com/parcel-bundler/parcel/blob/e0b99c2a42e9109a9ecbd6f537844a1b33e7faf5/packages/utils/node-resolver-rs/src/path.rs#L37 - fn normalize_with>(&self, subpath: B) -> PathBuf { - let subpath = subpath.as_ref(); - let mut components = subpath.components().peekable(); - if subpath.is_absolute() || matches!(components.peek(), Some(Component::Prefix(..))) { - return subpath.to_path_buf(); - } - - let mut ret = self.to_path_buf(); - for component in subpath.components() { - match component { - Component::Prefix(..) | Component::RootDir => { - unreachable!("Path {:?} Subpath {:?}", self, subpath) - } - Component::CurDir => {} - Component::ParentDir => { - ret.pop(); - } - Component::Normal(c) => { - ret.push(c); - } - } - } - - ret - } - - fn is_invalid_exports_target(&self) -> bool { - self.components().enumerate().any(|(index, c)| match c { - Component::ParentDir => true, - Component::CurDir => index > 0, - Component::Normal(c) => c.eq_ignore_ascii_case("node_modules"), - _ => false, - }) - } -} - -// https://github.com/webpack/enhanced-resolve/blob/main/test/path.test.js -#[test] -fn is_invalid_exports_target() { - let test_cases = [ - "../a.js", - "../", - "./a/b/../../../c.js", - "./a/b/../../../", - "./../../c.js", - "./../../", - "./a/../b/../../c.js", - "./a/../b/../../", - "./././../", - ]; - - for case in test_cases { - assert!(Path::new(case).is_invalid_exports_target(), "{case}"); - } - - assert!(!Path::new("C:").is_invalid_exports_target()); - assert!(!Path::new("/").is_invalid_exports_target()); -} - -#[test] -fn normalize() { - assert_eq!(Path::new("/foo/.././foo/").normalize(), Path::new("/foo")); - assert_eq!(Path::new("C://").normalize(), Path::new("C://")); -} diff --git a/Source/resolution.rs b/Source/resolution.rs deleted file mode 100644 index a3aaa2e7..00000000 --- a/Source/resolution.rs +++ /dev/null @@ -1,92 +0,0 @@ -use crate::package_json::PackageJson; -use std::{ - fmt, - path::{Path, PathBuf}, - sync::Arc, -}; - -/// The final path resolution with optional `?query` and `#fragment` -#[derive(Clone)] -pub struct Resolution { - pub(crate) path: PathBuf, - - /// path query `?query`, contains `?`. - pub(crate) query: Option, - - /// path fragment `#query`, contains `#`. - pub(crate) fragment: Option, - - pub(crate) package_json: Option>, -} - -impl fmt::Debug for Resolution { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - f.debug_struct("Resolution") - .field("path", &self.path) - .field("query", &self.query) - .field("fragment", &self.fragment) - .field("package_json", &self.package_json.as_ref().map(|p| &p.path)) - .finish() - } -} - -impl PartialEq for Resolution { - fn eq(&self, other: &Self) -> bool { - self.path == other.path && self.query == other.query && self.fragment == other.fragment - } -} -impl Eq for Resolution {} - -impl Resolution { - /// Returns the path without query and fragment - pub fn path(&self) -> &Path { - &self.path - } - - /// Returns the path without query and fragment - pub fn into_path_buf(self) -> PathBuf { - self.path - } - - /// Returns the path query `?query`, contains the leading `?` - pub fn query(&self) -> Option<&str> { - self.query.as_deref() - } - - /// Returns the path fragment `#fragment`, contains the leading `#` - pub fn fragment(&self) -> Option<&str> { - self.fragment.as_deref() - } - - /// Returns serialized package_json - pub fn package_json(&self) -> Option<&Arc> { - self.package_json.as_ref() - } - - /// Returns the full path with query and fragment - pub fn full_path(&self) -> PathBuf { - let mut path = self.path.clone().into_os_string(); - if let Some(query) = &self.query { - path.push(query); - } - if let Some(fragment) = &self.fragment { - path.push(fragment); - } - PathBuf::from(path) - } -} - -#[test] -fn test() { - let resolution = Resolution { - path: PathBuf::from("foo"), - query: Some("?query".to_string()), - fragment: Some("#fragment".to_string()), - package_json: None, - }; - assert_eq!(resolution.path(), Path::new("foo")); - assert_eq!(resolution.query(), Some("?query")); - assert_eq!(resolution.fragment(), Some("#fragment")); - assert_eq!(resolution.full_path(), PathBuf::from("foo?query#fragment")); - assert_eq!(resolution.into_path_buf(), PathBuf::from("foo")); -} diff --git a/Source/specifier.rs b/Source/specifier.rs deleted file mode 100644 index 3d35eafc..00000000 --- a/Source/specifier.rs +++ /dev/null @@ -1,230 +0,0 @@ -use crate::error::SpecifierError; -use std::borrow::Cow; - -#[derive(Debug)] -pub struct Specifier<'a> { - path: Cow<'a, str>, - pub query: Option<&'a str>, - pub fragment: Option<&'a str>, -} - -impl<'a> Specifier<'a> { - pub fn path(&'a self) -> &'a str { - self.path.as_ref() - } - - pub fn parse(specifier: &'a str) -> Result, SpecifierError> { - if specifier.is_empty() { - return Err(SpecifierError::Empty(specifier.to_string())); - } - let offset = match specifier.as_bytes()[0] { - b'/' | b'.' | b'#' => 1, - _ => 0, - }; - let (path, query, fragment) = Self::parse_query_framgment(specifier, offset); - if path.is_empty() { - return Err(SpecifierError::Empty(specifier.to_string())); - } - Ok(Self { path, query, fragment }) - } - - fn parse_query_framgment( - specifier: &'a str, - skip: usize, - ) -> (Cow<'a, str>, Option<&str>, Option<&str>) { - let mut query_start: Option = None; - let mut fragment_start: Option = None; - - let mut prev = specifier.chars().next().unwrap(); - let mut escaped_indexes = vec![]; - for (i, c) in specifier.char_indices().skip(skip) { - if c == '?' && query_start.is_none() { - query_start = Some(i); - } - if c == '#' { - if prev == '\0' { - escaped_indexes.push(i - 1); - } else { - fragment_start = Some(i); - break; - } - } - prev = c; - } - - let (path, query, fragment) = match (query_start, fragment_start) { - (Some(i), Some(j)) => { - debug_assert!(i < j); - (&specifier[..i], Some(&specifier[i..j]), Some(&specifier[j..])) - } - (Some(i), None) => (&specifier[..i], Some(&specifier[i..]), None), - (None, Some(j)) => (&specifier[..j], None, Some(&specifier[j..])), - _ => (specifier, None, None), - }; - - let path = if escaped_indexes.is_empty() { - Cow::Borrowed(path) - } else { - // Remove the `\0` characters for a legal path. - Cow::Owned( - path.chars() - .enumerate() - .filter_map(|(i, c)| (!escaped_indexes.contains(&i)).then_some(c)) - .collect::(), - ) - }; - - (path, query, fragment) - } -} - -#[cfg(test)] -mod tests { - use super::{Specifier, SpecifierError}; - - #[test] - fn debug() { - let specifier = Specifier::parse("/").unwrap(); - assert_eq!( - format!("{specifier:?}"), - r#"Specifier { path: "/", query: None, fragment: None }"# - ); - } - - #[test] - fn empty() { - let specifiers = ["", "?"]; - for specifier in specifiers { - let error = Specifier::parse(specifier).unwrap_err(); - assert_eq!(error, SpecifierError::Empty(specifier.to_string())); - } - } - - #[test] - fn absolute() -> Result<(), SpecifierError> { - let specifier = "/test?#"; - let parsed = Specifier::parse(specifier)?; - assert_eq!(parsed.path, "/test"); - assert_eq!(parsed.query, Some("?")); - assert_eq!(parsed.fragment, Some("#")); - Ok(()) - } - - #[test] - fn relative() -> Result<(), SpecifierError> { - let specifiers = ["./test", "../test", "../../test"]; - for specifier in specifiers { - let mut r = specifier.to_string(); - r.push_str("?#"); - let parsed = Specifier::parse(&r)?; - assert_eq!(parsed.path, specifier); - assert_eq!(parsed.query, Some("?")); - assert_eq!(parsed.fragment, Some("#")); - } - Ok(()) - } - - #[test] - fn hash() -> Result<(), SpecifierError> { - let specifiers = ["#", "#path"]; - for specifier in specifiers { - let mut r = specifier.to_string(); - r.push_str("?#"); - let parsed = Specifier::parse(&r)?; - assert_eq!(parsed.path, specifier); - assert_eq!(parsed.query, Some("?")); - assert_eq!(parsed.fragment, Some("#")); - } - Ok(()) - } - - #[test] - fn module() -> Result<(), SpecifierError> { - let specifiers = ["module"]; - for specifier in specifiers { - let mut r = specifier.to_string(); - r.push_str("?#"); - let parsed = Specifier::parse(&r)?; - assert_eq!(parsed.path, specifier); - assert_eq!(parsed.query, Some("?")); - assert_eq!(parsed.fragment, Some("#")); - } - Ok(()) - } - - #[test] - fn query_fragment() -> Result<(), SpecifierError> { - let data = [ - ("a?", Some("?"), None), - ("a?query", Some("?query"), None), - ("a?query1?query2", Some("?query1?query2"), None), - ("a?query1?query2?query3", Some("?query1?query2?query3"), None), - ("a#", None, Some("#")), - ("a#b#c", None, Some("#b#c")), - ("a#fragment", None, Some("#fragment")), - ("a?#", Some("?"), Some("#")), - ("a?#fragment", Some("?"), Some("#fragment")), - ("a?query#", Some("?query"), Some("#")), - ("a?query#fragment", Some("?query"), Some("#fragment")), - ("a#fragment?", None, Some("#fragment?")), - ("a#fragment?query", None, Some("#fragment?query")), - ]; - - for (specifier_str, query, fragment) in data { - let specifier = Specifier::parse(specifier_str)?; - assert_eq!(specifier.path, "a", "{specifier_str}"); - assert_eq!(specifier.query, query, "{specifier_str}"); - assert_eq!(specifier.fragment, fragment, "{specifier_str}"); - } - - Ok(()) - } - - #[test] - // https://github.com/webpack/enhanced-resolve/blob/main/test/identifier.test.js - fn enhanced_resolve_edge_cases() -> Result<(), SpecifierError> { - let data = [ - ("path/#", "path/", "", "#"), - ("path/as/?", "path/as/", "?", ""), - ("path/#/?", "path/", "", "#/?"), - ("path/#repo#hash", "path/", "", "#repo#hash"), - ("path/#r#hash", "path/", "", "#r#hash"), - ("path/#repo/#repo2#hash", "path/", "", "#repo/#repo2#hash"), - ("path/#r/#r#hash", "path/", "", "#r/#r#hash"), - ("path/#/not/a/hash?not-a-query", "path/", "", "#/not/a/hash?not-a-query"), - ]; - - for (specifier_str, path, query, fragment) in data { - let specifier = Specifier::parse(specifier_str)?; - assert_eq!(specifier.path, path, "{specifier_str}"); - assert_eq!(specifier.query.unwrap_or(""), query, "{specifier_str}"); - assert_eq!(specifier.fragment.unwrap_or(""), fragment, "{specifier_str}"); - } - - Ok(()) - } - - // https://github.com/webpack/enhanced-resolve/blob/main/test/identifier.test.js - #[test] - fn enhanced_resolve_windows_like() -> Result<(), SpecifierError> { - let data = [ - ("path\\#", "path\\", "", "#"), - ("path\\as\\?", "path\\as\\", "?", ""), - ("path\\#\\?", "path\\", "", "#\\?"), - ("path\\#repo#hash", "path\\", "", "#repo#hash"), - ("path\\#r#hash", "path\\", "", "#r#hash"), - ("path\\#repo\\#repo2#hash", "path\\", "", "#repo\\#repo2#hash"), - ("path\\#r\\#r#hash", "path\\", "", "#r\\#r#hash"), - ("path\\#/not/a/hash?not-a-query", "path\\", "", "#/not/a/hash?not-a-query"), - ]; - - for (specifier_str, path, query, fragment) in data { - let specifier = Specifier::parse(specifier_str)?; - assert_eq!(specifier.path, path, "{specifier_str}"); - assert_eq!(specifier.query.unwrap_or(""), query, "{specifier_str}"); - assert_eq!(specifier.fragment.unwrap_or(""), fragment, "{specifier_str}"); - } - - Ok(()) - } -} diff --git a/Source/tsconfig.rs b/Source/tsconfig.rs deleted file mode 100644 index 1b408e0f..00000000 --- a/Source/tsconfig.rs +++ /dev/null @@ -1,212 +0,0 @@ -use std::{ - path::{Path, PathBuf}, - sync::Arc, -}; - -use serde::Deserialize; -use typescript_tsconfig_json::{CompilerOptionsPathsMap, ExtendsField}; - -use crate::PathUtil; - -#[derive(Debug, Deserialize)] -#[serde(rename_all = "camelCase")] -pub struct TsConfig { - /// Whether this is the caller tsconfig. - /// Used for final template variable substitution when all configs are extended and merged. - #[serde(skip)] - root: bool, - - /// Path to `tsconfig.json`. Contains the `tsconfig.json` filename. - #[serde(skip)] - path: PathBuf, - - #[serde(default)] - pub extends: Option, - - #[serde(default)] - pub compiler_options: CompilerOptions, - - /// Bubbled up project references with a reference to their tsconfig. - #[serde(default)] - pub references: Vec, -} - -/// Compiler Options -/// -/// -#[derive(Debug, Default, Deserialize)] -#[serde(rename_all = "camelCase")] -pub struct CompilerOptions { - base_url: Option, - - /// Path aliases - paths: Option, - - /// The actual base for where path aliases are resolved from. - #[serde(skip)] - paths_base: PathBuf, -} - -/// Project Reference -/// -/// -#[derive(Debug, Deserialize)] -pub struct ProjectReference { - /// The path property of each reference can point to a directory containing a tsconfig.json file, - /// or to the config file itself (which may have any name). - pub path: PathBuf, - - /// Reference to the resolved tsconfig - #[serde(skip)] - pub tsconfig: Option>, -} - -impl TsConfig { - pub fn parse(root: bool, path: &Path, json: &mut str) -> Result { - _ = json_strip_comments::strip(json); - let mut tsconfig: Self = serde_json::from_str(json)?; - tsconfig.root = root; - tsconfig.path = path.to_path_buf(); - let directory = tsconfig.directory().to_path_buf(); - if let Some(base_url) = tsconfig.compiler_options.base_url { - tsconfig.compiler_options.base_url = Some(directory.normalize_with(base_url)); - } - if tsconfig.compiler_options.paths.is_some() { - tsconfig.compiler_options.paths_base = - tsconfig.compiler_options.base_url.as_ref().map_or(directory, Clone::clone); - } - Ok(tsconfig) - } - - pub fn build(mut self) -> Self { - if self.root { - let dir = self.directory().to_path_buf(); - // Substitute template variable in `tsconfig.compilerOptions.paths` - if let Some(paths) = &mut self.compiler_options.paths { - for paths in paths.values_mut() { - for path in paths { - Self::substitute_template_variable(&dir, path); - } - } - } - } - self - } - - /// Directory to `tsconfig.json` - /// - /// # Panics - /// - /// * When the `tsconfig.json` path is misconfigured. - pub fn directory(&self) -> &Path { - debug_assert!(self.path.file_name().is_some()); - self.path.parent().unwrap() - } - - pub fn extend_tsconfig(&mut self, tsconfig: &Self) { - let compiler_options = &mut self.compiler_options; - if compiler_options.paths.is_none() { - compiler_options.paths_base = compiler_options - .base_url - .as_ref() - .map_or_else(|| tsconfig.compiler_options.paths_base.clone(), Clone::clone); - compiler_options.paths = tsconfig.compiler_options.paths.clone(); - } - if compiler_options.base_url.is_none() { - compiler_options.base_url = tsconfig.compiler_options.base_url.clone(); - } - } - - pub fn resolve(&self, path: &Path, specifier: &str) -> Vec { - if path.starts_with(self.base_path()) { - let paths = self.resolve_path_alias(specifier); - if !paths.is_empty() { - return paths; - } - } - for tsconfig in self.references.iter().filter_map(|reference| reference.tsconfig.as_ref()) { - if path.starts_with(tsconfig.base_path()) { - return tsconfig.resolve_path_alias(specifier); - } - } - vec![] - } - - // Copied from parcel - // - pub fn resolve_path_alias(&self, specifier: &str) -> Vec { - if specifier.starts_with(|s| s == '/' || s == '.') { - return vec![]; - } - - let base_url_iter = self - .compiler_options - .base_url - .as_ref() - .map_or_else(Vec::new, |base_url| vec![base_url.normalize_with(specifier)]); - - let Some(paths_map) = &self.compiler_options.paths else { - return base_url_iter; - }; - - let paths = paths_map.get(specifier).map_or_else( - || { - let mut longest_prefix_length = 0; - let mut longest_suffix_length = 0; - let mut best_key: Option<&String> = None; - - for key in paths_map.keys() { - if let Some((prefix, suffix)) = key.split_once('*') { - if (best_key.is_none() || prefix.len() > longest_prefix_length) - && specifier.starts_with(prefix) - && specifier.ends_with(suffix) - { - longest_prefix_length = prefix.len(); - longest_suffix_length = suffix.len(); - best_key.replace(key); - } - } - } - - best_key.and_then(|key| paths_map.get(key)).map_or_else(Vec::new, |paths| { - paths - .iter() - .map(|path| { - path.replace( - '*', - &specifier[longest_prefix_length - ..specifier.len() - longest_suffix_length], - ) - }) - .collect::>() - }) - }, - Clone::clone, - ); - - paths - .into_iter() - .map(|p| self.compiler_options.paths_base.normalize_with(p)) - .chain(base_url_iter) - .collect() - } - - fn base_path(&self) -> &Path { - self.compiler_options - .base_url - .as_ref() - .map_or_else(|| self.directory(), |path| path.as_ref()) - } - - /// Template variable `${configDir}` for substitution of config files directory path - /// - /// NOTE: All tests cases are just a head replacement of `${configDir}`, so we are constrained as such. - /// - /// See - fn substitute_template_variable(directory: &Path, path: &mut String) { - const TEMPLATE_VARIABLE: &str = "${configDir}/"; - if let Some(stripped_path) = path.strip_prefix(TEMPLATE_VARIABLE) { - *path = directory.join(stripped_path).to_string_lossy().to_string(); - } - } -} diff --git a/benches/resolver.rs b/benches/resolver.rs deleted file mode 100644 index 0f7b09c7..00000000 --- a/benches/resolver.rs +++ /dev/null @@ -1,128 +0,0 @@ -use std::{env, path::PathBuf}; - -use criterion::*; -use rayon::prelude::*; - -fn data() -> Vec<(PathBuf, &'static str)> { - let cwd = env::current_dir().unwrap().join("fixtures/enhanced_resolve"); - let f = cwd.join("test/fixtures"); - vec![ - (cwd.clone(), "./"), - (cwd.clone(), "./lib/index"), - (cwd.clone(), "/absolute/path"), - // query fragment - (f.clone(), "./main1.js#fragment?query"), - (f.clone(), "m1/a.js?query#fragment"), - // browserField - (f.join("browser-module"), "./lib/replaced"), - (f.join("browser-module/lib"), "./replaced"), - // exportsField - (f.join("exports-field"), "exports-field"), - (f.join("exports-field"), "exports-field/dist/main.js"), - (f.join("exports-field"), "exports-field/dist/main.js?foo"), - (f.join("exports-field"), "exports-field/dist/main.js#foo"), - (f.join("exports-field"), "@exports-field/core"), - (f.join("imports-exports-wildcard"), "m/features/f.js"), - // extensionAlias - (f.join("extension-alias"), "./index.js"), - (f.join("extension-alias"), "./dir2/index.mjs"), - // extensions - (f.join("extensions"), "./foo"), - (f.join("extensions"), "."), - (f.join("extensions"), "./dir"), - (f.join("extensions"), "module/"), - // importsField - (f.join("imports-field"), "#imports-field"), - (f.join("imports-exports-wildcard/node_modules/m/"), "#internal/i.js"), - // scoped - (f.join("scoped"), "@scope/pack1"), - (f.join("scoped"), "@scope/pack2/lib"), - // dashed name - (f.clone(), "dash"), - (f.clone(), "dash-name"), - (f.join("node_modules/dash"), "dash"), - (f.join("node_modules/dash"), "dash-name"), - (f.join("node_modules/dash-name"), "dash"), - (f.join("node_modules/dash-name"), "dash-name"), - // alias - (cwd.clone(), "aaa"), - (cwd.clone(), "ggg"), - (cwd.clone(), "rrr"), - (cwd.clone(), "@"), - (cwd, "@@@"), - ] -} - -fn oxc_resolver() -> oxc_resolver::Resolver { - use oxc_resolver::{AliasValue, ResolveOptions, Resolver}; - let alias_value = AliasValue::from("./"); - Resolver::new(ResolveOptions { - extensions: vec![".ts".into(), ".js".into()], - condition_names: vec!["webpack".into()], - alias_fields: vec![vec!["browser".into()]], - extension_alias: vec![ - (".js".into(), vec![".ts".into(), ".js".into()]), - (".mjs".into(), vec![".mts".into()]), - ], - // Real projects LOVE setting these many aliases. - // I saw them with my own eyes. - alias: vec![ - ("/absolute/path".into(), vec![alias_value.clone()]), - ("aaa".into(), vec![alias_value.clone()]), - ("bbb".into(), vec![alias_value.clone()]), - ("ccc".into(), vec![alias_value.clone()]), - ("ddd".into(), vec![alias_value.clone()]), - ("eee".into(), vec![alias_value.clone()]), - ("fff".into(), vec![alias_value.clone()]), - ("ggg".into(), vec![alias_value.clone()]), - ("hhh".into(), vec![alias_value.clone()]), - ("iii".into(), vec![alias_value.clone()]), - ("jjj".into(), vec![alias_value.clone()]), - ("kkk".into(), vec![alias_value.clone()]), - ("lll".into(), vec![alias_value.clone()]), - ("mmm".into(), vec![alias_value.clone()]), - ("nnn".into(), vec![alias_value.clone()]), - ("ooo".into(), vec![alias_value.clone()]), - ("ppp".into(), vec![alias_value.clone()]), - ("qqq".into(), vec![alias_value.clone()]), - ("rrr".into(), vec![alias_value.clone()]), - ("sss".into(), vec![alias_value.clone()]), - ("@".into(), vec![alias_value.clone()]), - ("@@".into(), vec![alias_value.clone()]), - ("@@@".into(), vec![alias_value]), - ], - ..ResolveOptions::default() - }) -} - -fn bench_resolver(c: &mut Criterion) { - let data = data(); - - // check validity - for (path, request) in &data { - assert!(oxc_resolver().resolve(path, request).is_ok(), "{path:?} {request}"); - } - - let mut group = c.benchmark_group("resolver"); - - group.bench_with_input(BenchmarkId::from_parameter("single-thread"), &data, |b, data| { - let oxc_resolver = oxc_resolver(); - b.iter(|| { - for (path, request) in data { - _ = oxc_resolver.resolve(path, request); - } - }); - }); - - group.bench_with_input(BenchmarkId::from_parameter("multi-thread"), &data, |b, data| { - let oxc_resolver = oxc_resolver(); - b.iter(|| { - data.par_iter().for_each(|(path, request)| { - _ = oxc_resolver.resolve(path, request); - }); - }); - }); -} - -criterion_group!(resolver, bench_resolver); -criterion_main!(resolver); diff --git a/deny.toml b/deny.toml deleted file mode 100644 index eb262f64..00000000 --- a/deny.toml +++ /dev/null @@ -1,273 +0,0 @@ -# This template contains all of the possible sections and their default values - -# Note that all fields that take a lint level have these possible values: -# * deny - An error will be produced and the check will fail -# * warn - A warning will be produced, but the check will not fail -# * allow - No warning or error will be produced, though in some cases a note -# will be - -# The values provided in this template are the default values that will be used -# when any section or field is not specified in your own configuration - -# Root options - -# If 1 or more target triples (and optionally, target_features) are specified, -# only the specified targets will be checked when running `cargo deny check`. -# This means, if a particular package is only ever used as a target specific -# dependency, such as, for example, the `nix` crate only being used via the -# `target_family = "unix"` configuration, that only having windows targets in -# this list would mean the nix crate, as well as any of its exclusive -# dependencies not shared by any other crates, would be ignored, as the target -# list here is effectively saying which targets you are building for. -targets = [ - # The triple can be any string, but only the target triples built in to - # rustc (as of 1.40) can be checked against actual config expressions - #{ triple = "x86_64-unknown-linux-musl" }, - # You can also specify which target_features you promise are enabled for a - # particular target. target_features are currently not validated against - # the actual valid features supported by the target architecture. - #{ triple = "wasm32-unknown-unknown", features = ["atomics"] }, -] -# When creating the dependency graph used as the source of truth when checks are -# executed, this field can be used to prune crates from the graph, removing them -# from the view of cargo-deny. This is an extremely heavy hammer, as if a crate -# is pruned from the graph, all of its dependencies will also be pruned unless -# they are connected to another crate in the graph that hasn't been pruned, -# so it should be used with care. The identifiers are [Package ID Specifications] -# (https://doc.rust-lang.org/cargo/reference/pkgid-spec.html) -#exclude = [] -# If true, metadata will be collected with `--all-features`. Note that this can't -# be toggled off if true, if you want to conditionally enable `--all-features` it -# is recommended to pass `--all-features` on the cmd line instead -all-features = false -# If true, metadata will be collected with `--no-default-features`. The same -# caveat with `all-features` applies -no-default-features = false -# If set, these feature will be enabled when collecting metadata. If `--features` -# is specified on the cmd line they will take precedence over this option. -#features = [] -# When outputting inclusion graphs in diagnostics that include features, this -# option can be used to specify the depth at which feature edges will be added. -# This option is included since the graphs can be quite large and the addition -# of features from the crate(s) to all of the graph roots can be far too verbose. -# This option can be overridden via `--feature-depth` on the cmd line -feature-depth = 1 - -# This section is considered when running `cargo deny check advisories` -# More documentation for the advisories section can be found here: -# https://embarkstudios.github.io/cargo-deny/checks/advisories/cfg.html -[advisories] -# The path where the advisory database is cloned/fetched into -db-path = "~/.cargo/advisory-db" -# The url(s) of the advisory databases to use -db-urls = ["https://github.com/rustsec/advisory-db"] -# The lint level for security vulnerabilities -vulnerability = "deny" -# The lint level for unmaintained crates -unmaintained = "warn" -# The lint level for crates that have been yanked from their source registry -yanked = "warn" -# The lint level for crates with security notices. Note that as of -# 2019-12-17 there are no security notice advisories in -# https://github.com/rustsec/advisory-db -notice = "warn" -# A list of advisory IDs to ignore. Note that ignored advisories will still -# output a note when they are encountered. -ignore = [ - #"RUSTSEC-0000-0000", -] -# Threshold for security vulnerabilities, any vulnerability with a CVSS score -# lower than the range specified will be ignored. Note that ignored advisories -# will still output a note when they are encountered. -# * None - CVSS Score 0.0 -# * Low - CVSS Score 0.1 - 3.9 -# * Medium - CVSS Score 4.0 - 6.9 -# * High - CVSS Score 7.0 - 8.9 -# * Critical - CVSS Score 9.0 - 10.0 -#severity-threshold = - -# If this is true, then cargo deny will use the git executable to fetch advisory database. -# If this is false, then it uses a built-in git library. -# Setting this to true can be helpful if you have special authentication requirements that cargo-deny does not support. -# See Git Authentication for more information about setting up git authentication. -#git-fetch-with-cli = true - -# This section is considered when running `cargo deny check licenses` -# More documentation for the licenses section can be found here: -# https://embarkstudios.github.io/cargo-deny/checks/licenses/cfg.html -[licenses] -# The lint level for crates which do not have a detectable license -unlicensed = "deny" -# List of explicitly allowed licenses -# See https://spdx.org/licenses/ for list of possible licenses -# [possible values: any SPDX 3.11 short identifier (+ optional exception)]. -allow = [ - "MIT", - "Apache-2.0", - "ISC", - "Unicode-DFS-2016", - "BSD-3-Clause", - "OpenSSL", - #"Apache-2.0 WITH LLVM-exception", -] -# List of explicitly disallowed licenses -# See https://spdx.org/licenses/ for list of possible licenses -# [possible values: any SPDX 3.11 short identifier (+ optional exception)]. -deny = [ - #"Nokia", -] -# Lint level for licenses considered copyleft -copyleft = "warn" -# Blanket approval or denial for OSI-approved or FSF Free/Libre licenses -# * both - The license will be approved if it is both OSI-approved *AND* FSF -# * either - The license will be approved if it is either OSI-approved *OR* FSF -# * osi-only - The license will be approved if is OSI-approved *AND NOT* FSF -# * fsf-only - The license will be approved if is FSF *AND NOT* OSI-approved -# * neither - This predicate is ignored and the default lint level is used -allow-osi-fsf-free = "neither" -# Lint level used when no other predicates are matched -# 1. License isn't in the allow or deny lists -# 2. License isn't copyleft -# 3. License isn't OSI/FSF, or allow-osi-fsf-free = "neither" -default = "deny" -# The confidence threshold for detecting a license from license text. -# The higher the value, the more closely the license text must be to the -# canonical license text of a valid SPDX license file. -# [possible values: any between 0.0 and 1.0]. -confidence-threshold = 0.8 -# Allow 1 or more licenses on a per-crate basis, so that particular licenses -# aren't accepted for every possible crate as with the normal allow list -exceptions = [ - # Each entry is the crate and version constraint, and its specific allow - # list - #{ allow = ["Zlib"], name = "adler32", version = "*" }, -] - -# Some crates don't have (easily) machine readable licensing information, -# adding a clarification entry for it allows you to manually specify the -# licensing information -[[licenses.clarify]] -# The name of the crate the clarification applies to -name = "ring" -# The optional version constraint for the crate -version = "*" -# The SPDX expression for the license requirements of the crate -expression = "MIT AND ISC AND OpenSSL" -# One or more files in the crate's source used as the "source of truth" for -# the license expression. If the contents match, the clarification will be used -# when running the license check, otherwise the clarification will be ignored -# and the crate will be checked normally, which may produce warnings or errors -# depending on the rest of your configuration -license-files = [ - # Each entry is a crate relative path, and the (opaque) hash of its contents - { path = "LICENSE", hash = 0xbd0eed23 }, -] - -[licenses.private] -# If true, ignores workspace crates that aren't published, or are only -# published to private registries. -# To see how to mark a crate as unpublished (to the official registry), -# visit https://doc.rust-lang.org/cargo/reference/manifest.html#the-publish-field. -ignore = false -# One or more private registries that you might publish crates to, if a crate -# is only published to private registries, and ignore is true, the crate will -# not have its license(s) checked -registries = [ - #"https://sekretz.com/registry -] - -# This section is considered when running `cargo deny check bans`. -# More documentation about the 'bans' section can be found here: -# https://embarkstudios.github.io/cargo-deny/checks/bans/cfg.html -[bans] -# Lint level for when multiple versions of the same crate are detected -multiple-versions = "warn" -# Lint level for when a crate version requirement is `*` -wildcards = "allow" -# The graph highlighting used when creating dotgraphs for crates -# with multiple versions -# * lowest-version - The path to the lowest versioned duplicate is highlighted -# * simplest-path - The path to the version with the fewest edges is highlighted -# * all - Both lowest-version and simplest-path are used -highlight = "all" -# The default lint level for `default` features for crates that are members of -# the workspace that is being checked. This can be overridden by allowing/denying -# `default` on a crate-by-crate basis if desired. -workspace-default-features = "allow" -# The default lint level for `default` features for external crates that are not -# members of the workspace. This can be overridden by allowing/denying `default` -# on a crate-by-crate basis if desired. -external-default-features = "allow" -# List of crates that are allowed. Use with care! -allow = [ - #{ name = "ansi_term", version = "=0.11.0" }, -] -# List of crates to deny -deny = [ - # Each entry the name of a crate and a version range. If version is - # not specified, all versions will be matched. - #{ name = "ansi_term", version = "=0.11.0" }, - # - # Wrapper crates can optionally be specified to allow the crate when it - # is a direct dependency of the otherwise banned crate - #{ name = "ansi_term", version = "=0.11.0", wrappers = [] }, -] - -# List of features to allow/deny -# Each entry the name of a crate and a version range. If version is -# not specified, all versions will be matched. -#[[bans.features]] -#name = "reqwest" -# Features to not allow -#deny = ["json"] -# Features to allow -#allow = [ -# "rustls", -# "__rustls", -# "__tls", -# "hyper-rustls", -# "rustls", -# "rustls-pemfile", -# "rustls-tls-webpki-roots", -# "tokio-rustls", -# "webpki-roots", -#] -# If true, the allowed features must exactly match the enabled feature set. If -# this is set there is no point setting `deny` -#exact = true - -# Certain crates/versions that will be skipped when doing duplicate detection. -skip = [ - #{ name = "ansi_term", version = "=0.11.0" }, -] -# Similarly to `skip` allows you to skip certain crates during duplicate -# detection. Unlike skip, it also includes the entire tree of transitive -# dependencies starting at the specified crate, up to a certain depth, which is -# by default infinite. -skip-tree = [ - #{ name = "ansi_term", version = "=0.11.0", depth = 20 }, -] - -# This section is considered when running `cargo deny check sources`. -# More documentation about the 'sources' section can be found here: -# https://embarkstudios.github.io/cargo-deny/checks/sources/cfg.html -[sources] -# Lint level for what to happen when a crate from a crate registry that is not -# in the allow list is encountered -unknown-registry = "warn" -# Lint level for what to happen when a crate from a git repository that is not -# in the allow list is encountered -unknown-git = "warn" -# List of URLs for allowed crate registries. Defaults to the crates.io index -# if not specified. If it is specified but empty, no registries are allowed. -allow-registry = ["https://github.com/rust-lang/crates.io-index"] -# List of URLs for allowed Git repositories -allow-git = [] - -[sources.allow-org] -# 1 or more github.com organizations to allow git sources for -github = [""] -# 1 or more gitlab.com organizations to allow git sources for -gitlab = [""] -# 1 or more bitbucket.org organizations to allow git sources for -bitbucket = [""] diff --git a/examples/resolver.rs b/examples/resolver.rs deleted file mode 100644 index e77aa053..00000000 --- a/examples/resolver.rs +++ /dev/null @@ -1,27 +0,0 @@ -///! See documentation at -use std::{env, path::PathBuf}; - -use oxc_resolver::{AliasValue, ResolveOptions, Resolver}; - -fn main() { - let path = PathBuf::from(env::args().nth(1).expect("path")); - - assert!(path.is_dir(), "{path:?} must be a directory that will be resolved against."); - assert!(path.is_absolute(), "{path:?} must be an absolute path.",); - - let specifier = env::args().nth(2).expect("specifier"); - - println!("path: {path:?}"); - println!("specifier: {specifier}"); - - let options = ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - alias: vec![("asdf".into(), vec![AliasValue::from("./test.js")])], - ..ResolveOptions::default() - }; - - match Resolver::new(options).resolve(path, &specifier) { - Err(error) => println!("Error: {error}"), - Ok(resolution) => println!("Resolved: {:?}", resolution.full_path()), - } -} diff --git a/fuzz/.gitignore b/fuzz/.gitignore deleted file mode 100644 index 1a45eee7..00000000 --- a/fuzz/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -target -corpus -artifacts -coverage diff --git a/fuzz/Cargo.toml b/fuzz/Cargo.toml deleted file mode 100644 index 8d082864..00000000 --- a/fuzz/Cargo.toml +++ /dev/null @@ -1,23 +0,0 @@ -[package] -name = "resolver_fuzz" -version = "0.0.0" -publish = false -edition = "2021" - -# Use independent workspace for fuzzers -[workspace] -members = ["."] - -[package.metadata] -cargo-fuzz = true - -[[bin]] -name = "resolver" -path = "fuzz_targets/resolver.rs" -test = false -doc = false -bench = false - -[dependencies] -libfuzzer-sys = "0.4" -oxc_resolver = { path = ".." } diff --git a/fuzz/fuzz_targets/resolver.rs b/fuzz/fuzz_targets/resolver.rs deleted file mode 100644 index 9b5cb7d5..00000000 --- a/fuzz/fuzz_targets/resolver.rs +++ /dev/null @@ -1,14 +0,0 @@ -#![no_main] - -use libfuzzer_sys::fuzz_target; -use oxc_resolver::Resolver; - -fuzz_target!(|data: &[u8]| { - if let Ok(s) = std::str::from_utf8(data) { - if s.chars().all(|s| !s.is_control()) { - let resolver = Resolver::default(); - let cwd = std::env::current_dir().unwrap(); - let _ = resolver.resolve(cwd, &s); - } - } -}); diff --git a/justfile b/justfile deleted file mode 100644 index a32d2352..00000000 --- a/justfile +++ /dev/null @@ -1,71 +0,0 @@ -#!/usr/bin/env -S just --justfile - -_default: - @just --list -u - -alias r := ready - -# Make sure you have cargo-binstall installed. -# You can download the pre-compiled binary from -# or install via `cargo install cargo-binstall` -# Initialize the project by installing all the necessary tools. -init: - cd fixtures/pnpm8 && pnpm install - cargo binstall cargo-watch typos-cli taplo-cli cargo-llvm-cov -y - -# When ready, run the same CI commands -ready: - git diff --exit-code --quiet - typos - cargo fmt - just check - just test - just lint - git status - -# --no-vcs-ignores: cargo-watch has a bug loading all .gitignores, including the ones listed in .gitignore -# use .ignore file getting the ignore list -# Run `cargo watch` -watch command: - cargo watch -x '{{command}}' - -# Run the example in `parser`, `formatter`, `linter` -example *args='': - just watch 'run --example resolver -- {{args}}' - -# Format all files -fmt: - cargo fmt - taplo format - -# Run cargo check -check: - cargo check --all-features --all-targets - -# Run all the tests -test: - cargo test - -# Lint the whole project -lint: - cargo clippy -- --deny warnings - -# Generate doc -doc: - RUSTDOCFLAGS='-D warnings' cargo doc --no-deps --all-features - -# Get code coverage -codecov: - cargo codecov --html - -# Run the benchmarks. See `tasks/benchmark` -benchmark: - cargo benchmark - -# Run cargo-fuzz -fuzz: - cd fuzz && cargo +nightly fuzz run --sanitizer none resolver -- -only_ascii=1 -max_total_time=900 - -release: - release-plz update - just check diff --git a/napi/Cargo.toml b/napi/Cargo.toml deleted file mode 100644 index 1ac1880e..00000000 --- a/napi/Cargo.toml +++ /dev/null @@ -1,20 +0,0 @@ -[package] -name = "oxc_napi_resolver" -version = "0.0.0" -publish = false - -[lib] -crate-type = ["cdylib"] -test = false -doctest = false - -[dependencies] -oxc_resolver = { path = ".." } -napi = { version = "2", default-features = false, features = ["napi3", "serde-json"] } -napi-derive = { version = "2" } - -[build-dependencies] -napi-build = "2" - -[package.metadata.cargo-machete] -ignored = ["napi"] diff --git a/napi/README.md b/napi/README.md deleted file mode 100644 index 07c9e263..00000000 --- a/napi/README.md +++ /dev/null @@ -1,18 +0,0 @@ -# Installation - -```bash -corepack enable -``` - -# Build - -```bash -pnpm install -pnpm run build -``` - -# Test - -```bash -pnpm test -``` diff --git a/napi/Source/lib.rs b/napi/Source/lib.rs deleted file mode 100644 index 238f99c4..00000000 --- a/napi/Source/lib.rs +++ /dev/null @@ -1,166 +0,0 @@ -extern crate napi; -extern crate napi_derive; -extern crate oxc_resolver; - -use std::path::{Path, PathBuf}; - -use napi_derive::napi; -use oxc_resolver::{ResolveOptions, Resolver}; - -use self::options::{NapiResolveOptions, StrOrStrList}; - -mod options; - -#[napi(object)] -pub struct ResolveResult { - pub path: Option, - pub error: Option, -} - -fn resolve(resolver: &Resolver, path: &Path, request: &str) -> ResolveResult { - match resolver.resolve(path, request) { - Ok(resolution) => ResolveResult { - path: Some(resolution.full_path().to_string_lossy().to_string()), - error: None, - }, - Err(err) => ResolveResult { path: None, error: Some(err.to_string()) }, - } -} - -#[allow(clippy::needless_pass_by_value)] -#[napi] -pub fn sync(path: String, request: String) -> ResolveResult { - let path = PathBuf::from(path); - let resolver = Resolver::new(ResolveOptions::default()); - resolve(&resolver, &path, &request) -} - -#[napi] -pub struct ResolverFactory { - resolver: Resolver, -} - -#[napi] -impl ResolverFactory { - #[napi(constructor)] - pub fn new(options: NapiResolveOptions) -> Self { - Self { resolver: Resolver::new(Self::normalize_options(options)) } - } - - #[napi] - pub fn default() -> Self { - let default_options = ResolveOptions::default(); - Self { resolver: Resolver::new(default_options) } - } - - /// Clone the resolver using the same underlying cache. - #[napi] - pub fn clone_with_options(&self, options: NapiResolveOptions) -> Self { - Self { resolver: self.resolver.clone_with_options(Self::normalize_options(options)) } - } - - /// Clear the underlying cache. - #[napi] - pub fn clear_cache(&self) { - self.resolver.clear_cache(); - } - - #[allow(clippy::needless_pass_by_value)] - #[napi] - pub fn sync(&self, path: String, request: String) -> ResolveResult { - let path = PathBuf::from(path); - resolve(&self.resolver, &path, &request) - } - - fn normalize_options(op: NapiResolveOptions) -> ResolveOptions { - let default = ResolveOptions::default(); - // merging options - ResolveOptions { - tsconfig: op.tsconfig.map(|tsconfig| tsconfig.into()), - alias: op - .alias - .map(|alias| { - alias - .into_iter() - .map(|(k, v)| { - let v = v - .into_iter() - .map(|item| match item { - Some(path) => oxc_resolver::AliasValue::from(path), - None => oxc_resolver::AliasValue::Ignore, - }) - .collect(); - (k, v) - }) - .collect::>() - }) - .unwrap_or(default.alias), - alias_fields: op - .alias_fields - .map(|o| o.into_iter().map(|x| StrOrStrList(x).into()).collect::>()) - .unwrap_or(default.alias_fields), - condition_names: op.condition_names.unwrap_or(default.condition_names), - description_files: op.description_files.unwrap_or(default.description_files), - enforce_extension: op - .enforce_extension - .map(|enforce_extension| enforce_extension.into()) - .unwrap_or(default.enforce_extension), - exports_fields: op - .exports_fields - .map(|o| o.into_iter().map(|x| StrOrStrList(x).into()).collect::>()) - .unwrap_or(default.exports_fields), - imports_fields: op - .imports_fields - .map(|o| o.into_iter().map(|x| StrOrStrList(x).into()).collect::>()) - .unwrap_or(default.imports_fields), - extension_alias: op - .extension_alias - .map(|extension_alias| extension_alias.into_iter().collect::>()) - .unwrap_or(default.extension_alias), - extensions: op.extensions.unwrap_or(default.extensions), - fallback: op - .fallback - .map(|fallback| { - fallback - .into_iter() - .map(|(k, v)| { - let v = v - .into_iter() - .map(|item| match item { - Some(path) => oxc_resolver::AliasValue::from(path), - None => oxc_resolver::AliasValue::Ignore, - }) - .collect(); - (k, v) - }) - .collect::>() - }) - .unwrap_or(default.fallback), - fully_specified: op.fully_specified.unwrap_or(default.fully_specified), - main_fields: op - .main_fields - .map(|o| StrOrStrList(o).into()) - .unwrap_or(default.main_fields), - main_files: op.main_files.unwrap_or(default.main_files), - modules: op.modules.map(|o| StrOrStrList(o).into()).unwrap_or(default.modules), - resolve_to_context: op.resolve_to_context.unwrap_or(default.resolve_to_context), - prefer_relative: op.prefer_relative.unwrap_or(default.prefer_relative), - prefer_absolute: op.prefer_absolute.unwrap_or(default.prefer_absolute), - restrictions: op - .restrictions - .map(|restrictions| { - restrictions - .into_iter() - .map(|restriction| restriction.into()) - .collect::>() - }) - .unwrap_or(default.restrictions), - roots: op - .roots - .map(|roots| roots.into_iter().map(PathBuf::from).collect::>()) - .unwrap_or(default.roots), - symlinks: op.symlinks.unwrap_or(default.symlinks), - builtin_modules: op.builtin_modules.unwrap_or(default.builtin_modules), - } - } -} diff --git a/napi/Source/options.rs b/napi/Source/options.rs deleted file mode 100644 index ea35672f..00000000 --- a/napi/Source/options.rs +++ /dev/null @@ -1,261 +0,0 @@ -use std::path::PathBuf; - -use napi::Either; -use napi_derive::napi; -use std::collections::HashMap; - -/// Module Resolution Options -/// -/// Options are directly ported from [enhanced-resolve](https://github.com/webpack/enhanced-resolve#resolver-options). -/// -/// See [webpack resolve](https://webpack.js.org/configuration/resolve/) for information and examples -#[derive(Debug, Clone)] -#[napi(object)] -pub struct NapiResolveOptions { - /// Path to TypeScript configuration file. - /// - /// Default `None` - pub tsconfig: Option, - - /// Alias for [ResolveOptions::alias] and [ResolveOptions::fallback]. - /// - /// For the second value of the tuple, `None -> AliasValue::Ignore`, Some(String) -> - /// AliasValue::Path(String)` - /// Create aliases to import or require certain modules more easily. - /// A trailing $ can also be added to the given object's keys to signify an exact match. - pub alias: Option>>>, - - /// A list of alias fields in description files. - /// Specify a field, such as `browser`, to be parsed according to [this specification](https://github.com/defunctzombie/package-browser-field-spec). - /// Can be a path to json object such as `["path", "to", "exports"]`. - /// - /// Default `[]` - #[napi(ts_type = "(string | string[])[]")] - pub alias_fields: Option>, - - /// Condition names for exports field which defines entry points of a package. - /// The key order in the exports field is significant. During condition matching, earlier entries have higher priority and take precedence over later entries. - /// - /// Default `[]` - pub condition_names: Option>, - - /// The JSON files to use for descriptions. (There was once a `bower.json`.) - /// - /// Default `["package.json"]` - pub description_files: Option>, - - /// If true, it will not allow extension-less files. - /// So by default `require('./foo')` works if `./foo` has a `.js` extension, - /// but with this enabled only `require('./foo.js')` will work. - /// - /// Default to `true` when [ResolveOptions::extensions] contains an empty string. - /// Use `Some(false)` to disable the behavior. - /// See - /// - /// Default None, which is the same as `Some(false)` when the above empty rule is not applied. - pub enforce_extension: Option, - - /// A list of exports fields in description files. - /// Can be a path to json object such as `["path", "to", "exports"]`. - /// - /// Default `[["exports"]]`. - #[napi(ts_type = "(string | string[])[]")] - pub exports_fields: Option>, - - /// Fields from `package.json` which are used to provide the internal requests of a package - /// (requests starting with # are considered internal). - /// - /// Can be a path to a JSON object such as `["path", "to", "imports"]`. - /// - /// Default `[["imports"]]`. - #[napi(ts_type = "(string | string[])[]")] - pub imports_fields: Option>, - - /// An object which maps extension to extension aliases. - /// - /// Default `{}` - pub extension_alias: Option>>, - - /// Attempt to resolve these extensions in order. - /// If multiple files share the same name but have different extensions, - /// will resolve the one with the extension listed first in the array and skip the rest. - /// - /// Default `[".js", ".json", ".node"]` - pub extensions: Option>, - - /// Redirect module requests when normal resolving fails. - /// - /// Default `[]` - pub fallback: Option>>>, - - /// 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). - /// - /// See also webpack configuration [resolve.fullySpecified](https://webpack.js.org/configuration/module/#resolvefullyspecified) - /// - /// Default `false` - pub fully_specified: Option, - - /// A list of main fields in description files - /// - /// Default `["main"]`. - #[napi(ts_type = "string | string[]")] - pub main_fields: Option, - - /// The filename to be used while resolving directories. - /// - /// Default `["index"]` - pub main_files: Option>, - - /// A list of directories to resolve modules from, can be absolute path or folder name. - /// - /// Default `["node_modules"]` - #[napi(ts_type = "string | string[]")] - pub modules: Option, - - /// Resolve to a context instead of a file. - /// - /// Default `false` - pub resolve_to_context: Option, - - /// Prefer to resolve module requests as relative requests instead of using modules from node_modules directories. - /// - /// Default `false` - pub prefer_relative: Option, - - /// Prefer to resolve server-relative urls as absolute paths before falling back to resolve in ResolveOptions::roots. - /// - /// Default `false` - pub prefer_absolute: Option, - - /// A list of resolve restrictions to restrict the paths that a request can be resolved on. - /// - /// Default `[]` - pub restrictions: Option>, - - /// A list of directories where requests of server-relative URLs (starting with '/') are resolved. - /// On non-Windows systems these requests are resolved as an absolute path first. - /// - /// Default `[]` - pub roots: Option>, - - /// Whether to resolve symlinks to their symlinked location. - /// When enabled, symlinked resources are resolved to their real path, not their symlinked location. - /// Note that this may cause module resolution to fail when using tools that symlink packages (like npm link). - /// - /// Default `true` - pub symlinks: Option, - - /// Whether to parse [module.builtinModules](https://nodejs.org/api/module.html#modulebuiltinmodules) or not. - /// For example, "zlib" will throw [crate::ResolveError::Builtin] when set to true. - /// - /// Default `false` - pub builtin_modules: Option, -} - -#[napi] -#[derive(Debug, PartialEq, Eq)] -pub enum EnforceExtension { - Auto, - Enabled, - Disabled, -} - -impl EnforceExtension { - pub fn is_auto(&self) -> bool { - *self == Self::Auto - } - - pub fn is_enabled(&self) -> bool { - *self == Self::Enabled - } - - pub fn is_disabled(&self) -> bool { - *self == Self::Disabled - } -} - -/// Alias Value for [ResolveOptions::alias] and [ResolveOptions::fallback]. -/// Use struct because napi don't support structured union now -#[napi(object)] -#[derive(Debug, Clone)] -pub struct Restriction { - pub path: Option, - pub regex: Option, -} - -/// Tsconfig Options -/// -/// Derived from [tsconfig-paths-webpack-plugin](https://github.com/dividab/tsconfig-paths-webpack-plugin#options) -#[napi(object)] -#[derive(Debug, Clone)] -pub struct TsconfigOptions { - /// Allows you to specify where to find the TypeScript configuration file. - /// You may provide - /// * a relative path to the configuration file. It will be resolved relative to cwd. - /// * an absolute path to the configuration file. - pub config_file: String, - - /// Support for Typescript Project References. - /// - /// * `'auto'`: use the `references` field from tsconfig of `config_file`. - /// * `string[]`: manually provided relative or absolute path. - #[napi(ts_type = "'auto' | string[]")] - pub references: Option>>, -} - -impl Into for Restriction { - fn into(self) -> oxc_resolver::Restriction { - match (self.path, self.regex) { - (None, None) => { - panic!("Should specify path or regex") - } - (None, Some(regex)) => oxc_resolver::Restriction::RegExp(regex), - (Some(path), None) => oxc_resolver::Restriction::Path(PathBuf::from(path)), - (Some(_), Some(_)) => { - panic!("Restriction can't be path and regex at the same time") - } - } - } -} - -impl Into for EnforceExtension { - fn into(self) -> oxc_resolver::EnforceExtension { - match self { - EnforceExtension::Auto => oxc_resolver::EnforceExtension::Auto, - EnforceExtension::Enabled => oxc_resolver::EnforceExtension::Enabled, - EnforceExtension::Disabled => oxc_resolver::EnforceExtension::Disabled, - } - } -} - -impl Into for TsconfigOptions { - fn into(self) -> oxc_resolver::TsconfigOptions { - oxc_resolver::TsconfigOptions { - config_file: PathBuf::from(self.config_file), - references: match self.references { - Some(Either::A(string)) if string.as_str() == "auto" => { - oxc_resolver::TsconfigReferences::Auto - } - Some(Either::A(opt)) => { - panic!("`{}` is not a valid option for tsconfig references", opt) - } - Some(Either::B(paths)) => oxc_resolver::TsconfigReferences::Paths( - paths.into_iter().map(PathBuf::from).collect::>(), - ), - None => oxc_resolver::TsconfigReferences::Disabled, - }, - } - } -} - -type StrOrStrListType = Either>; -pub struct StrOrStrList(pub StrOrStrListType); - -impl Into> for StrOrStrList { - fn into(self) -> Vec { - match self { - StrOrStrList(Either::A(s)) => Vec::from([s]), - StrOrStrList(Either::B(a)) => a, - } - } -} diff --git a/napi/browser.js b/napi/browser.js deleted file mode 100644 index e0a24e7e..00000000 --- a/napi/browser.js +++ /dev/null @@ -1 +0,0 @@ -export * from '@oxc-resolver/binding-wasm32-wasi' diff --git a/napi/build.rs b/napi/build.rs deleted file mode 100644 index 0f1b0100..00000000 --- a/napi/build.rs +++ /dev/null @@ -1,3 +0,0 @@ -fn main() { - napi_build::setup(); -} diff --git a/napi/index.d.ts b/napi/index.d.ts deleted file mode 100644 index 77d0c028..00000000 --- a/napi/index.d.ts +++ /dev/null @@ -1,214 +0,0 @@ -/* auto-generated by NAPI-RS */ -/* eslint-disable */ - -export class ResolverFactory { - constructor(options: NapiResolveOptions) - static default(): ResolverFactory - /** Clone the resolver using the same underlying cache. */ - cloneWithOptions(options: NapiResolveOptions): ResolverFactory - /** Clear the underlying cache. */ - clearCache(): void - sync(path: string, request: string): ResolveResult -} - -export const enum EnforceExtension { - Auto = 0, - Enabled = 1, - Disabled = 2 -} - -/** - * Module Resolution Options - * - * Options are directly ported from [enhanced-resolve](https://github.com/webpack/enhanced-resolve#resolver-options). - * - * See [webpack resolve](https://webpack.js.org/configuration/resolve/) for information and examples - */ -export interface NapiResolveOptions { - /** - * Path to TypeScript configuration file. - * - * Default `None` - */ - tsconfig?: TsconfigOptions - /** - * Alias for [ResolveOptions::alias] and [ResolveOptions::fallback]. - * - * For the second value of the tuple, `None -> AliasValue::Ignore`, Some(String) -> - * AliasValue::Path(String)` - * Create aliases to import or require certain modules more easily. - * A trailing $ can also be added to the given object's keys to signify an exact match. - */ - alias?: Record> - /** - * A list of alias fields in description files. - * Specify a field, such as `browser`, to be parsed according to [this specification](https://github.com/defunctzombie/package-browser-field-spec). - * Can be a path to json object such as `["path", "to", "exports"]`. - * - * Default `[]` - */ - aliasFields?: (string | string[])[] - /** - * Condition names for exports field which defines entry points of a package. - * The key order in the exports field is significant. During condition matching, earlier entries have higher priority and take precedence over later entries. - * - * Default `[]` - */ - conditionNames?: Array - /** - * The JSON files to use for descriptions. (There was once a `bower.json`.) - * - * Default `["package.json"]` - */ - descriptionFiles?: Array - /** - * If true, it will not allow extension-less files. - * So by default `require('./foo')` works if `./foo` has a `.js` extension, - * but with this enabled only `require('./foo.js')` will work. - * - * Default to `true` when [ResolveOptions::extensions] contains an empty string. - * Use `Some(false)` to disable the behavior. - * See - * - * Default None, which is the same as `Some(false)` when the above empty rule is not applied. - */ - enforceExtension?: EnforceExtension - /** - * A list of exports fields in description files. - * Can be a path to json object such as `["path", "to", "exports"]`. - * - * Default `[["exports"]]`. - */ - exportsFields?: (string | string[])[] - /** - * An object which maps extension to extension aliases. - * - * Default `{}` - */ - extensionAlias?: Record> - /** - * Attempt to resolve these extensions in order. - * If multiple files share the same name but have different extensions, - * will resolve the one with the extension listed first in the array and skip the rest. - * - * Default `[".js", ".json", ".node"]` - */ - extensions?: Array - /** - * Redirect module requests when normal resolving fails. - * - * Default `[]` - */ - fallback?: Record> - /** - * 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). - * - * See also webpack configuration [resolve.fullySpecified](https://webpack.js.org/configuration/module/#resolvefullyspecified) - * - * Default `false` - */ - fullySpecified?: boolean - /** - * A list of main fields in description files - * - * Default `["main"]`. - */ - mainFields?: string | string[] - /** - * The filename to be used while resolving directories. - * - * Default `["index"]` - */ - mainFiles?: Array - /** - * A list of directories to resolve modules from, can be absolute path or folder name. - * - * Default `["node_modules"]` - */ - modules?: string | string[] - /** - * Resolve to a context instead of a file. - * - * Default `false` - */ - resolveToContext?: boolean - /** - * Prefer to resolve module requests as relative requests instead of using modules from node_modules directories. - * - * Default `false` - */ - preferRelative?: boolean - /** - * Prefer to resolve server-relative urls as absolute paths before falling back to resolve in ResolveOptions::roots. - * - * Default `false` - */ - preferAbsolute?: boolean - /** - * A list of resolve restrictions to restrict the paths that a request can be resolved on. - * - * Default `[]` - */ - restrictions?: Array - /** - * A list of directories where requests of server-relative URLs (starting with '/') are resolved. - * On non-Windows systems these requests are resolved as an absolute path first. - * - * Default `[]` - */ - roots?: Array - /** - * Whether to resolve symlinks to their symlinked location. - * When enabled, symlinked resources are resolved to their real path, not their symlinked location. - * Note that this may cause module resolution to fail when using tools that symlink packages (like npm link). - * - * Default `true` - */ - symlinks?: boolean - /** - * Whether to parse [module.builtinModules](https://nodejs.org/api/module.html#modulebuiltinmodules) or not. - * For example, "zlib" will throw [crate::ResolveError::Builtin] when set to true. - * - * Default `false` - */ - builtinModules?: boolean -} - -export interface ResolveResult { - path?: string - error?: string -} - -/** - * Alias Value for [ResolveOptions::alias] and [ResolveOptions::fallback]. - * Use struct because napi don't support structured union now - */ -export interface Restriction { - path?: string - regex?: string -} - -export function sync(path: string, request: string): ResolveResult - -/** - * Tsconfig Options - * - * Derived from [tsconfig-paths-webpack-plugin](https://github.com/dividab/tsconfig-paths-webpack-plugin#options) - */ -export interface TsconfigOptions { - /** - * Allows you to specify where to find the TypeScript configuration file. - * You may provide - * * a relative path to the configuration file. It will be resolved relative to cwd. - * * an absolute path to the configuration file. - */ - configFile: string - /** - * Support for Typescript Project References. - * - * * `'auto'`: use the `references` field from tsconfig of `config_file`. - * * `string[]`: manually provided relative or absolute path. - */ - references?: 'auto' | string[] -} - diff --git a/napi/index.js b/napi/index.js deleted file mode 100644 index a36b6b02..00000000 --- a/napi/index.js +++ /dev/null @@ -1,340 +0,0 @@ -// prettier-ignore -/* eslint-disable */ -/* auto-generated by NAPI-RS */ - -const { readFileSync } = require('fs') - -let nativeBinding = null -const loadErrors = [] - -const isMusl = () => { - let musl = false - if (process.platform === 'linux') { - musl = isMuslFromFilesystem() - if (musl === null) { - musl = isMuslFromReport() - } - if (musl === null) { - musl = isMuslFromChildProcess() - } - } - return musl -} - -const isFileMusl = (f) => f.includes('libc.musl-') || f.includes('ld-musl-') - -const isMuslFromFilesystem = () => { - try { - return readFileSync('/usr/bin/ldd', 'utf-8').includes('musl') - } catch { - return null - } -} - -const isMuslFromReport = () => { - const report = typeof process.report.getReport === 'function' ? process.report.getReport() : null - if (!report) { - return null - } - if (report.header && report.header.glibcVersionRuntime) { - return false - } - if (Array.isArray(report.sharedObjects)) { - if (report.sharedObjects.some(isFileMusl)) { - return true - } - } - return false -} - -const isMuslFromChildProcess = () => { - try { - return require('child_process').execSync('ldd --version', { encoding: 'utf8' }).includes('musl') - } catch (e) { - // If we reach this case, we don't know if the system is musl or not, so is better to just fallback to false - return false - } -} - -function requireNative() { - if (process.platform === 'android') { - if (process.arch === 'arm64') { - try { - return require('./resolver.android-arm64.node') - } catch (e) { - loadErrors.push(e) - } - try { - return require('@oxc-resolver/binding-android-arm64') - } catch (e) { - loadErrors.push(e) - } - - } else if (process.arch === 'arm') { - try { - return require('./resolver.android-arm-eabi.node') - } catch (e) { - loadErrors.push(e) - } - try { - return require('@oxc-resolver/binding-android-arm-eabi') - } catch (e) { - loadErrors.push(e) - } - - } else { - loadErrors.push(new Error(`Unsupported architecture on Android ${process.arch}`)) - } - } else if (process.platform === 'win32') { - if (process.arch === 'x64') { - try { - return require('./resolver.win32-x64-msvc.node') - } catch (e) { - loadErrors.push(e) - } - try { - return require('@oxc-resolver/binding-win32-x64-msvc') - } catch (e) { - loadErrors.push(e) - } - - } else if (process.arch === 'ia32') { - try { - return require('./resolver.win32-ia32-msvc.node') - } catch (e) { - loadErrors.push(e) - } - try { - return require('@oxc-resolver/binding-win32-ia32-msvc') - } catch (e) { - loadErrors.push(e) - } - - } else if (process.arch === 'arm64') { - try { - return require('./resolver.win32-arm64-msvc.node') - } catch (e) { - loadErrors.push(e) - } - try { - return require('@oxc-resolver/binding-win32-arm64-msvc') - } catch (e) { - loadErrors.push(e) - } - - } else { - loadErrors.push(new Error(`Unsupported architecture on Windows: ${process.arch}`)) - } - } else if (process.platform === 'darwin') { - try { - return require('./resolver.darwin-universal.node') - } catch (e) { - loadErrors.push(e) - } - try { - return require('@oxc-resolver/binding-darwin-universal') - } catch (e) { - loadErrors.push(e) - } - - if (process.arch === 'x64') { - try { - return require('./resolver.darwin-x64.node') - } catch (e) { - loadErrors.push(e) - } - try { - return require('@oxc-resolver/binding-darwin-x64') - } catch (e) { - loadErrors.push(e) - } - - } else if (process.arch === 'arm64') { - try { - return require('./resolver.darwin-arm64.node') - } catch (e) { - loadErrors.push(e) - } - try { - return require('@oxc-resolver/binding-darwin-arm64') - } catch (e) { - loadErrors.push(e) - } - - } else { - loadErrors.push(new Error(`Unsupported architecture on macOS: ${process.arch}`)) - } - } else if (process.platform === 'freebsd') { - if (process.arch === 'x64') { - try { - return require('./resolver.freebsd-x64.node') - } catch (e) { - loadErrors.push(e) - } - try { - return require('@oxc-resolver/binding-freebsd-x64') - } catch (e) { - loadErrors.push(e) - } - - } else if (process.arch === 'arm64') { - try { - return require('./resolver.freebsd-arm64.node') - } catch (e) { - loadErrors.push(e) - } - try { - return require('@oxc-resolver/binding-freebsd-arm64') - } catch (e) { - loadErrors.push(e) - } - - } else { - loadErrors.push(new Error(`Unsupported architecture on FreeBSD: ${process.arch}`)) - } - } else if (process.platform === 'linux') { - if (process.arch === 'x64') { - if (isMusl()) { - try { - return require('./resolver.linux-x64-musl.node') - } catch (e) { - loadErrors.push(e) - } - try { - return require('@oxc-resolver/binding-linux-x64-musl') - } catch (e) { - loadErrors.push(e) - } - - } else { - try { - return require('./resolver.linux-x64-gnu.node') - } catch (e) { - loadErrors.push(e) - } - try { - return require('@oxc-resolver/binding-linux-x64-gnu') - } catch (e) { - loadErrors.push(e) - } - - } - } else if (process.arch === 'arm64') { - if (isMusl()) { - try { - return require('./resolver.linux-arm64-musl.node') - } catch (e) { - loadErrors.push(e) - } - try { - return require('@oxc-resolver/binding-linux-arm64-musl') - } catch (e) { - loadErrors.push(e) - } - - } else { - try { - return require('./resolver.linux-arm64-gnu.node') - } catch (e) { - loadErrors.push(e) - } - try { - return require('@oxc-resolver/binding-linux-arm64-gnu') - } catch (e) { - loadErrors.push(e) - } - - } - } else if (process.arch === 'arm') { - try { - return require('./resolver.linux-arm-gnueabihf.node') - } catch (e) { - loadErrors.push(e) - } - try { - return require('@oxc-resolver/binding-linux-arm-gnueabihf') - } catch (e) { - loadErrors.push(e) - } - - } else if (process.arch === 'riscv64') { - if (isMusl()) { - try { - return require('./resolver.linux-riscv64-musl.node') - } catch (e) { - loadErrors.push(e) - } - try { - return require('@oxc-resolver/binding-linux-riscv64-musl') - } catch (e) { - loadErrors.push(e) - } - - } else { - try { - return require('./resolver.linux-riscv64-gnu.node') - } catch (e) { - loadErrors.push(e) - } - try { - return require('@oxc-resolver/binding-linux-riscv64-gnu') - } catch (e) { - loadErrors.push(e) - } - - } - } else if (process.arch === 's390x') { - try { - return require('./resolver.linux-s390x-gnu.node') - } catch (e) { - loadErrors.push(e) - } - try { - return require('@oxc-resolver/binding-linux-s390x-gnu') - } catch (e) { - loadErrors.push(e) - } - - } else { - loadErrors.push(new Error(`Unsupported architecture on Linux: ${process.arch}`)) - } - } else { - loadErrors.push(new Error(`Unsupported OS: ${process.platform}, architecture: ${process.arch}`)) - } -} - -nativeBinding = requireNative() - -if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) { - try { - nativeBinding = require('./resolver.wasi.cjs') - } catch (err) { - if (process.env.NAPI_RS_FORCE_WASI) { - console.error(err) - } - } - if (!nativeBinding) { - try { - nativeBinding = require('@oxc-resolver/binding-wasm32-wasi') - } catch (err) { - if (process.env.NAPI_RS_FORCE_WASI) { - console.error(err) - } - } - } -} - -if (!nativeBinding) { - if (loadErrors.length > 0) { - // TODO Link to documentation with potential fixes - // - The package owner could build/publish bindings for this arch - // - The user may need to bundle the correct files - // - The user may need to re-install node_modules to get new packages - throw new Error('Failed to load native binding', { cause: loadErrors }) - } - throw new Error(`Failed to load native binding`) -} - -module.exports.ResolverFactory = nativeBinding.ResolverFactory -module.exports.EnforceExtension = nativeBinding.EnforceExtension -module.exports.sync = nativeBinding.sync diff --git a/napi/resolver.wasi-browser.js b/napi/resolver.wasi-browser.js deleted file mode 100644 index f587db33..00000000 --- a/napi/resolver.wasi-browser.js +++ /dev/null @@ -1,70 +0,0 @@ -import { - instantiateNapiModuleSync as __emnapiInstantiateNapiModuleSync, - getDefaultContext as __emnapiGetDefaultContext, - WASI as __WASI, -} from '@napi-rs/wasm-runtime' -import { Volume as __Volume, createFsFromVolume as __createFsFromVolume } from '@napi-rs/wasm-runtime/fs' - -import __wasmUrl from './resolver.wasm32-wasi.wasm?url' - -const __fs = __createFsFromVolume( - __Volume.fromJSON({ - '/': null, - }), -) - -const __wasi = new __WASI({ - version: 'preview1', - fs: __fs, -}) - -const __emnapiContext = __emnapiGetDefaultContext() - -const __sharedMemory = new WebAssembly.Memory({ - initial: 1024, - maximum: 10240, - shared: true, -}) - -const __wasmFile = await fetch(__wasmUrl).then((res) => res.arrayBuffer()) - -const { - instance: __napiInstance, - module: __wasiModule, - napiModule: __napiModule, -} = __emnapiInstantiateNapiModuleSync(__wasmFile, { - context: __emnapiContext, - asyncWorkPoolSize: 4, - wasi: __wasi, - onCreateWorker() { - return new Worker(new URL('./wasi-worker-browser.mjs', import.meta.url), { - type: 'module', - }) - }, - overwriteImports(importObject) { - importObject.env = { - ...importObject.env, - ...importObject.napi, - ...importObject.emnapi, - memory: __sharedMemory, - } - return importObject - }, - beforeInit({ instance }) { - __napi_rs_initialize_modules(instance) - }, -}) - -function __napi_rs_initialize_modules(__napiInstance) { - __napiInstance.exports['__napi_register__NapiResolveOptions_struct_0']?.() - __napiInstance.exports['__napi_register__EnforceExtension_1']?.() - __napiInstance.exports['__napi_register__Restriction_struct_2']?.() - __napiInstance.exports['__napi_register__TsconfigOptions_struct_3']?.() - __napiInstance.exports['__napi_register__ResolveResult_struct_4']?.() - __napiInstance.exports['__napi_register__sync_5']?.() - __napiInstance.exports['__napi_register__ResolverFactory_struct_6']?.() - __napiInstance.exports['__napi_register__ResolverFactory_impl_12']?.() -} -export const ResolverFactory = __napiModule.exports.ResolverFactory -export const EnforceExtension = __napiModule.exports.EnforceExtension -export const sync = __napiModule.exports.sync diff --git a/napi/resolver.wasi.cjs b/napi/resolver.wasi.cjs deleted file mode 100644 index 5065a38f..00000000 --- a/napi/resolver.wasi.cjs +++ /dev/null @@ -1,86 +0,0 @@ -/* eslint-disable */ -/* prettier-ignore */ - -/* auto-generated by NAPI-RS */ - -const __nodeFs= require('node:fs') -const __nodePath = require('node:path') -const { WASI: __nodeWASI } = require('node:wasi') -const { Worker } = require('node:worker_threads') - -const { - instantiateNapiModuleSync: __emnapiInstantiateNapiModuleSync, - getDefaultContext: __emnapiGetDefaultContext, -} = require('@napi-rs/wasm-runtime') - -const __wasi = new __nodeWASI({ - version: 'preview1', - env: process.env, - preopens: { - '/': '/' - } -}) - -const __emnapiContext = __emnapiGetDefaultContext() - -const __sharedMemory = new WebAssembly.Memory({ - initial: 1024, - maximum: 10240, - shared: true, -}) - -let __wasmFilePath = __nodePath.join(__dirname, 'resolver.wasm32-wasi.wasm') - -if (!__nodeFs.existsSync(__wasmFilePath)) { - try { - __wasmFilePath = __nodePath.resolve('@oxc-resolver/binding-wasm32-wasi') - } catch { - throw new Error('Cannot find resolver.wasm32-wasi.wasm file, and @oxc-resolver/binding-wasm32-wasi package is not installed.') - } -} - -const { instance: __napiInstance, module: __wasiModule, napiModule: __napiModule } = __emnapiInstantiateNapiModuleSync(__nodeFs.readFileSync(__wasmFilePath), { - context: __emnapiContext, - asyncWorkPoolSize: (function() { - const threadsSizeFromEnv = Number(process.env.NAPI_RS_ASYNC_WORK_POOL_SIZE ?? process.env.UV_THREADPOOL_SIZE) - // NaN > 0 is false - if (threadsSizeFromEnv > 0) { - return threadsSizeFromEnv - } else { - return 4 - } - })(), - wasi: __wasi, - onCreateWorker() { - return new Worker(__nodePath.join(__dirname, 'wasi-worker.mjs'), { - env: process.env, - execArgv: ['--experimental-wasi-unstable-preview1'], - }) - }, - overwriteImports(importObject) { - importObject.env = { - ...importObject.env, - ...importObject.napi, - ...importObject.emnapi, - memory: __sharedMemory, - } - return importObject - }, - beforeInit({ instance }) { - __napi_rs_initialize_modules(instance) - } -}) - -function __napi_rs_initialize_modules(__napiInstance) { - __napiInstance.exports['__napi_register__NapiResolveOptions_struct_0']?.() - __napiInstance.exports['__napi_register__EnforceExtension_1']?.() - __napiInstance.exports['__napi_register__Restriction_struct_2']?.() - __napiInstance.exports['__napi_register__TsconfigOptions_struct_3']?.() - __napiInstance.exports['__napi_register__ResolveResult_struct_4']?.() - __napiInstance.exports['__napi_register__sync_5']?.() - __napiInstance.exports['__napi_register__ResolverFactory_struct_6']?.() - __napiInstance.exports['__napi_register__ResolverFactory_impl_12']?.() -} -module.exports.ResolverFactory = __napiModule.exports.ResolverFactory -module.exports.EnforceExtension = __napiModule.exports.EnforceExtension -module.exports.sync = __napiModule.exports.sync diff --git a/napi/test.mjs b/napi/test.mjs deleted file mode 100644 index 2fb069a6..00000000 --- a/napi/test.mjs +++ /dev/null @@ -1,30 +0,0 @@ -import path from 'path'; -import resolve, { ResolverFactory } from './index.js'; -import assert from 'assert'; - -console.log(`Testing on ${process.platform}-${process.arch}`) - -const cwd = process.cwd(); - -// `resolve` -assert.deepStrictEqual(resolve.sync(cwd, "./index.js").path, path.join(cwd, 'index.js')); - -// `ResolverFactory` -const resolver = ResolverFactory.default(); -assert.deepStrictEqual(resolver.sync(cwd, "./index.js").path, path.join(cwd, 'index.js')); - -assert.strict(resolver.sync(cwd, "./ts").error.length > 0); - -const newResolver = resolver.cloneWithOptions({}); -newResolver.clearCache(); - - -// custom constructor -const resolver2 = new ResolverFactory( - { - extensions: ['.mjs'] - } -); - -// After add `.ts` extension, resolver can resolve `ts` as `ts.ts` now -assert.deepStrictEqual(resolver2.sync(cwd, "./test.mjs").path, path.join(cwd, 'test.mjs')); diff --git a/napi/wasi-worker-browser.mjs b/napi/wasi-worker-browser.mjs deleted file mode 100644 index 9f5e224a..00000000 --- a/napi/wasi-worker-browser.mjs +++ /dev/null @@ -1,40 +0,0 @@ -import { instantiateNapiModuleSync, MessageHandler, WASI } from '@napi-rs/wasm-runtime' -import { Volume, createFsFromVolume } from '@napi-rs/wasm-runtime/fs' - -const fs = createFsFromVolume( - Volume.fromJSON({ - '/': null, - }), -) - -const handler = new MessageHandler({ - onLoad({ wasmModule, wasmMemory }) { - const wasi = new WASI({ - fs, - print: function () { - // eslint-disable-next-line no-console - console.log.apply(console, arguments) - }, - printErr: function() { - // eslint-disable-next-line no-console - console.error.apply(console, arguments) - }, - }) - return instantiateNapiModuleSync(wasmModule, { - childThread: true, - wasi, - overwriteImports(importObject) { - importObject.env = { - ...importObject.env, - ...importObject.napi, - ...importObject.emnapi, - memory: wasmMemory, - } - }, - }) - }, -}) - -globalThis.onmessage = function (e) { - handler.handle(e) -} diff --git a/napi/wasi-worker.mjs b/napi/wasi-worker.mjs deleted file mode 100644 index 11e930b1..00000000 --- a/napi/wasi-worker.mjs +++ /dev/null @@ -1,50 +0,0 @@ -import fs from "node:fs"; -import { createRequire } from "node:module"; -import { parentPort, Worker } from "node:worker_threads"; - -import { instantiateNapiModuleSync, MessageHandler, WASI } from "@napi-rs/wasm-runtime"; - -const require = createRequire(import.meta.url); - -if (parentPort) { - parentPort.on("message", (data) => { - globalThis.onmessage({ data }); - }); -} - -Object.assign(globalThis, { - self: globalThis, - require, - Worker, - importScripts: function (f) { - ;(0, eval)(fs.readFileSync(f, "utf8") + "//# sourceURL=" + f); - }, - postMessage: function (msg) { - if (parentPort) { - parentPort.postMessage(msg); - } - }, -}); - -const handler = new MessageHandler({ - onLoad({ wasmModule, wasmMemory }) { - const wasi = new WASI({ fs }); - - return instantiateNapiModuleSync(wasmModule, { - childThread: true, - wasi, - overwriteImports(importObject) { - importObject.env = { - ...importObject.env, - ...importObject.napi, - ...importObject.emnapi, - memory: wasmMemory - }; - }, - }); - }, -}); - -globalThis.onmessage = function (e) { - handler.handle(e); -}; diff --git a/npm/.gitignore b/npm/.gitignore deleted file mode 100644 index cfb7121f..00000000 --- a/npm/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -* -!package.json -!README.md -!.gitignore \ No newline at end of file diff --git a/npm/README.md b/npm/README.md deleted file mode 100644 index a0297efa..00000000 --- a/npm/README.md +++ /dev/null @@ -1,18 +0,0 @@ -# The JavaScript Oxidation Compiler - -See index.d.ts for `resolveSync` and `ResolverFactory` API. - -## ESM - -```javascript -import path from 'path'; -import resolve, { ResolverFactory } from './index.js'; -import assert from 'assert'; - -// `resolve` -assert(resolve.sync(process.cwd(), "./index.js").path, path.join(cwd, 'index.js')); - -// `ResolverFactory` -const resolver = new ResolverFactory(); -assert(resolver.sync(process.cwd(), "./index.js").path, path.join(cwd, 'index.js')); -``` diff --git a/npm/package.json b/npm/package.json deleted file mode 100644 index 88aa3db8..00000000 --- a/npm/package.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "name": "oxc-resolver", - "version": "0.0.1", - "private": false, - "description": "Oxc Resolver Node API", - "keywords": [ - "land" - ], - "homepage": "HTTPS://GitHub.Com/CodeEditorLand/OXCResolver#readme", - "bugs": { - "url": "HTTPS://GitHub.Com/CodeEditorLand/OXCResolver/issues" - }, - "repository": { - "type": "git", - "url": "git+HTTPS://github.com/CodeEditorLand/OXCResolver.git" - }, - "funding": { - "url": "https://github.com/sponsors/Boshen" - }, - "license": "SEE LICENSE IN LICENSE", - "author": { - "name": "🛬 Land —", - "email": "Land@PlayForm.Cloud", - "url": "HTTPS://Land.PlayForm.Cloud" - }, - "type": "module", - "main": "index.js", - "browser": "browser.js", - "files": [ - "index.d.ts", - "index.js", - "browser.js" - ], - "scripts": { - "Document": "Document 'Source/**/*.ts'", - "prepublishOnly": "Build 'Source/**/*.ts'" - }, - "devDependencies": { - "@playform/build": "0.0.7", - "@playform/document": "0.0.6" - }, - "publishConfig": { - "access": "public" - }, - "napi": { - "binaryName": "resolver", - "packageName": "@oxc-resolver/binding", - "targets": [ - "x86_64-pc-windows-msvc", - "aarch64-pc-windows-msvc", - "x86_64-unknown-linux-gnu", - "x86_64-unknown-linux-musl", - "aarch64-unknown-linux-gnu", - "aarch64-unknown-linux-musl", - "armv7-unknown-linux-gnueabihf", - "x86_64-apple-darwin", - "aarch64-apple-darwin", - "wasm32-wasi-preview1-threads" - ] - } -} diff --git a/package.json b/package.json deleted file mode 100644 index dee2ae65..00000000 --- a/package.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "name": "@oxc-resolver/binding", - "version": "0.0.1", - "private": false, - "keywords": [ - "land" - ], - "homepage": "HTTPS://GitHub.Com/CodeEditorLand/OXCResolver#readme", - "bugs": { - "url": "HTTPS://GitHub.Com/CodeEditorLand/OXCResolver/issues" - }, - "repository": { - "type": "git", - "url": "git+HTTPS://github.com/CodeEditorLand/OXCResolver.git" - }, - "funding": { - "url": "https://github.com/sponsors/Boshen" - }, - "license": "SEE LICENSE IN LICENSE", - "author": { - "name": "🛬 Land —", - "email": "Land@PlayForm.Cloud", - "url": "HTTPS://Land.PlayForm.Cloud" - }, - "type": "module", - "scripts": { - "Document": "Document 'Source/**/*.ts'", - "build": "napi build --platform --release --package-json-path npm/package.json --manifest-path napi/Cargo.toml", - "build:debug": "napi build --platform --package-json-path npm/package.json --manifest-path napi/Cargo.toml", - "prepublishOnly": "Build 'Source/**/*.ts'" - }, - "ava": { - "cache": false, - "files": [ - "napi/__test__/*.spec.mjs" - ] - }, - "devDependencies": { - "@napi-rs/cli": "3.0.0-alpha.43", - "@napi-rs/wasm-runtime": "0.2.3", - "@playform/build": "0.0.7", - "@playform/document": "0.0.6", - "@types/node": "20.12.10", - "ava": "6.1.3", - "emnapi": "1.1.1" - }, - "publishConfig": { - "access": "public" - } -} diff --git a/release-plz.toml b/release-plz.toml deleted file mode 100644 index d90dab28..00000000 --- a/release-plz.toml +++ /dev/null @@ -1,2 +0,0 @@ -[workspace] -allow_dirty = true # The "fixtures" is being marked as dirty. diff --git a/rust-toolchain.toml b/rust-toolchain.toml deleted file mode 100644 index 1c8cfba9..00000000 --- a/rust-toolchain.toml +++ /dev/null @@ -1,3 +0,0 @@ -[toolchain] -channel = "1.75.0" -profile = "default" From f4e571a0d651dae2197b5246c912055e641a10a6 Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Mon, 20 May 2024 15:28:17 +0300 Subject: [PATCH 10/82] squash! --- .github/CODE_OF_CONDUCT.md | 127 - .github/SECURITY.md | 7 - .github/actions/pnpm/action.yml | 23 - .github/actions/rustup/action.yml | 88 - .github/codecov.yml | 14 - .github/renovate.json | 5 - .github/workflows/benchmark.yml | 45 - .github/workflows/ci.yml | 219 -- .github/workflows/codecov.yml | 76 - .github/workflows/release-napi.yml | 220 -- .github/workflows/release-plz.yml | 35 - Cargo.lock | 880 ------ {src => Source}/builtins.rs | 0 {src => Source}/cache.rs | 0 {src => Source}/context.rs | 0 {src => Source}/error.rs | 0 {src => Source}/file_system.rs | 0 {src => Source}/lib.rs | 0 {src => Source}/options.rs | 0 {src => Source}/package_json.rs | 0 {src => Source}/path.rs | 0 {src => Source}/resolution.rs | 0 {src => Source}/specifier.rs | 0 {src => Source}/tsconfig.rs | 0 fixtures/enhanced_resolve/lib/index.js | 1 - fixtures/enhanced_resolve/package.json | 4 - fixtures/enhanced_resolve/test/.gitignore | 2 - fixtures/enhanced_resolve/test/fixtures/a.js | 3 - .../enhanced_resolve/test/fixtures/abc.txt | 1 - .../test/fixtures/alias/files/a.js | 0 fixtures/enhanced_resolve/test/fixtures/b.js | 3 - .../browser-module/browser/module-a.js | 0 .../fixtures/browser-module/lib/browser.js | 0 .../fixtures/browser-module/lib/ignore.js | 0 .../test/fixtures/browser-module/lib/main.js | 0 .../fixtures/browser-module/lib/replaced.js | 0 .../test/fixtures/browser-module/lib/self.js | 0 .../fixtures/browser-module/lib/toString.js | 0 .../browser-module/node_modules/module-a.js | 0 .../browser-module/node_modules/module-b.js | 0 .../browser-module/node_modules/module-c.js | 0 .../node_modules/recursive-file/a.js | 0 .../node_modules/recursive-file/b.js | 0 .../node_modules/recursive-file/c.js | 0 .../node_modules/recursive-file/d.js | 0 .../node_modules/recursive-file/package.json | 8 - .../test/fixtures/browser-module/package.json | 32 - fixtures/enhanced_resolve/test/fixtures/c.js | 4 - .../enhanced_resolve/test/fixtures/complex.js | 13 - .../test/fixtures/crypto-js/index.js | 0 .../test/fixtures/crypto-js/package.json | 7 - .../test/fixtures/decorated-fs/exists.js | 0 .../test/fixtures/dirOrFile.js | 1 - .../test/fixtures/dirOrFile/index.js | 1 - .../directory-default/directory-default.js | 0 .../node_modules/@org/pkg/dist/string.js | 1 - .../@org/pkg/dist/string.test.d.ts | 1 - .../node_modules/@org/pkg/package.json | 9 - .../node_modules/pkg/dist/string.js | 1 - .../node_modules/pkg/dist/string.test.d.ts | 1 - .../node_modules/pkg/package.json | 9 - .../node_modules/exports-field/package.json | 7 - .../node_modules/pack1/index.js | 0 .../test/fixtures/exports-field/a.js | 1 - .../node_modules/exports-field/lib/browser.js | 1 - .../node_modules/exports-field/lib/index.js | 0 .../exports-field/lib/lib2/main.js | 1 - .../node_modules/exports-field/lib/main.js | 1 - .../node_modules/exports-field/main.js | 1 - .../node_modules/exports-field/package.json | 18 - .../node_modules/exports-field/x.js | 1 - .../invalid-exports-field/index.js | 0 .../invalid-exports-field/package.json | 13 - .../node_modules/invalid-exports-field/umd.js | 0 .../test/fixtures/exports-field/package.json | 5 - .../node_modules/exports-field/index.js | 1 - .../node_modules/exports-field/lib/browser.js | 1 - .../exports-field/lib/lib2/main.js | 1 - .../node_modules/exports-field/lib/main.js | 1 - .../node_modules/exports-field/main.js | 1 - .../node_modules/exports-field/package.json | 17 - .../node_modules/exports-field/index | 0 .../node_modules/exports-field/main.js | 1 - .../node_modules/exports-field/package.json | 10 - .../node_modules/exports-field/src/index.js | 0 .../fixtures/extension-alias/dir/index.js | 0 .../fixtures/extension-alias/dir/index.ts | 0 .../fixtures/extension-alias/dir2/index.js | 0 .../fixtures/extension-alias/dir2/index.mts | 0 .../test/fixtures/extension-alias/index.js | 0 .../test/fixtures/extension-alias/index.mjs | 0 .../fixtures/extension-alias/index.mts.js | 0 .../test/fixtures/extension-alias/index.ts | 0 .../test/fixtures/extensions/app.module.js | 0 .../test/fixtures/extensions/dir/index.js | 0 .../test/fixtures/extensions/dir/index.ts | 0 .../test/fixtures/extensions/foo.js | 0 .../test/fixtures/extensions/foo.ts | 0 .../test/fixtures/extensions/index.js | 0 .../test/fixtures/extensions/index.ts | 0 .../extensions/node_modules/module.js | 0 .../extensions/node_modules/module/index.ts | 0 .../test/fixtures/extensions/package.json | 3 - .../enhanced_resolve/test/fixtures/file.load1 | 0 .../enhanced_resolve/test/fixtures/file.load2 | 0 .../test/fixtures/foo/index.js | 0 .../test/fixtures/foo/package.json | 4 - .../node_modules/m/package.json | 17 - .../node_modules/m/src/features/f.js | 0 .../m/src/features/internal/file.js | 0 .../node_modules/m/src/features/y/y.js | 0 .../node_modules/m/src/internal/i.js | 0 .../node_modules/m/src/middle-1/f.js | 0 .../node_modules/m/src/middle-1/nested/f.js | 0 .../node_modules/m/src/middle-2/nested/f.js | 1 - .../m/src/middle-3/nested/f/nested/f.js | 0 .../node_modules/m/src/middle-4/f/f.js | 0 .../node_modules/m/src/middle-5/f$/$.js | 0 .../node_modules/m/src/middle-5/f/$.js | 0 .../node_modules/m/src/middle/f.js | 0 .../node_modules/m/src/middle/nested/f.js | 0 .../test/fixtures/imports-field/a.js | 1 - .../test/fixtures/imports-field/b.js | 0 .../test/fixtures/imports-field/dir/b.js | 0 .../node_modules/a/lib/browser.js | 1 - .../imports-field/node_modules/a/lib/index.js | 0 .../node_modules/a/lib/lib2/main.js | 1 - .../imports-field/node_modules/a/lib/main.js | 1 - .../imports-field/node_modules/a/main.js | 1 - .../imports-field/node_modules/a/package.json | 18 - .../imports-field/node_modules/a/x.js | 1 - .../imports-field/node_modules/c/index.js | 0 .../test/fixtures/imports-field/package.json | 17 - .../fixtures/incorrect-package/pack1/a.js | 0 .../incorrect-package/pack1/package.json | 2 - .../fixtures/incorrect-package/pack2/a.js | 0 .../incorrect-package/pack2/package.json | 0 .../test/fixtures/issue-238/package.json | 3 - .../test/fixtures/issue-238/src/a/config.js | 0 .../src/common/config/myObjectFile.js | 0 .../enhanced_resolve/test/fixtures/lib.js | 0 .../test/fixtures/lib/complex1.js | 1 - .../test/fixtures/main-field-self/index.js | 0 .../fixtures/main-field-self/package.json | 3 - .../test/fixtures/main-field-self2/index.js | 0 .../fixtures/main-field-self2/package.json | 3 - .../enhanced_resolve/test/fixtures/main1.js | 9 - .../enhanced_resolve/test/fixtures/main2.js | 12 - .../enhanced_resolve/test/fixtures/main3.js | 4 - .../multiple_modules/node_modules/m1/a.js | 3 - .../test/fixtures/no#fragment/#/#.js | 0 fixtures/enhanced_resolve/test/fixtures/no.js | 0 .../browser-module-broken/browser.js | 0 .../browser-module-broken/main.js | 0 .../browser-module-broken/package.json | 4 - .../complexm/node_modules/m1/a.js | 1 - .../complexm/node_modules/m1/index.js | 1 - .../fixtures/node_modules/complexm/step1.js | 1 - .../fixtures/node_modules/complexm/step2.js | 1 - .../fixtures/node_modules/dash-name/index.js | 0 .../node_modules/dash-name/package.json | 4 - .../test/fixtures/node_modules/dash/index.js | 0 .../fixtures/node_modules/dash/package.json | 4 - .../invalidPackageJson/package.json | 0 .../test/fixtures/node_modules/m1/a.js | 3 - .../test/fixtures/node_modules/m1/b.js | 3 - .../test/fixtures/node_modules/m2/b.js | 1 - .../node_modules/recursive-module/file.js | 0 .../node_modules/recursive-module/index.js | 0 .../test/fixtures/pnp-a/m2/a.js | 3 - .../test/fixtures/pnp/pkg/dir/index.js | 0 .../test/fixtures/pnp/pkg/index.js | 0 .../test/fixtures/pnp/pkg/main.js | 0 .../fixtures/pnp/pkg/package-alias/browser.js | 0 .../fixtures/pnp/pkg/package-alias/index.js | 0 .../test/fixtures/pnp/pkg/package.json | 7 - .../test/fixtures/pnp/pkg/typescript/index.ts | 0 .../test/fixtures/pnp/pkg3/a.js | 1 - .../test/fixtures/pnp/pkg3/package.json | 8 - .../prefer-pnp/alternative-modules/m1/b.js | 0 .../restrictions/node_modules/pck1/index.css | 0 .../restrictions/node_modules/pck1/index.js | 0 .../node_modules/pck1/package.json | 3 - .../restrictions/node_modules/pck2/index.css | 0 .../restrictions/node_modules/pck2/module.js | 0 .../node_modules/pck2/package.json | 5 - .../test/fixtures/roots_fall_through/index.js | 0 .../scoped/node_modules/@scope/pack1/main.js | 0 .../node_modules/@scope/pack1/package.json | 5 - .../node_modules/@scope/pack2/lib/index.js | 0 .../scoped/node_modules/@scope/pack2/main.js | 0 .../node_modules/@scope/pack2/package.json | 3 - .../test/fixtures/shortcutdir.js/a.js | 0 .../test/fixtures/yield/a/foo-2/b | 0 .../test/fixtures/yield/a/foo-2/c | 0 .../test/fixtures/yield/a/foo/a | 0 .../test/fixtures/yield/a/foo/b | 0 .../test/fixtures/yield/b/foo/a | 0 .../test/fixtures/yield/c/foo/a | 0 .../test/fixtures/yield/c/foo/package.json | 7 - .../fixtures/\346\265\213\350\257\225.js" | 0 .../\344\270\255\346\226\207.js" | 0 fixtures/pnpm8/.gitignore | 1 - fixtures/pnpm8/package.json | 14 - fixtures/pnpm8/pnpm-lock.yaml | 212 -- fixtures/tsconfig/cases/builtins/thing.js | 0 .../tsconfig/cases/builtins/tsconfig.json | 5 - fixtures/tsconfig/cases/exports/index.js | 0 fixtures/tsconfig/cases/exports/tsconfig.json | 3 - .../extends-extension/base-tsconfig.json | 7 - .../tsconfig/cases/extends-extension/foo.js | 0 .../cases/extends-extension/tsconfig.json | 3 - .../cases/extends-extensionless/foo.js | 0 .../cases/extends-extensionless/tsconfig.json | 3 - .../tsconfig/cases/extends-multiple/foo.js | 0 .../cases/extends-multiple/tsconfig.json | 6 - .../tsconfig/cases/extends-not-found/index.js | 0 .../cases/extends-not-found/tsconfig.json | 3 - .../tsconfig/cases/extends-paths/src/index.js | 0 .../cases/extends-paths/tsconfig.base.json | 7 - .../cases/extends-paths/tsconfig.json | 6 - fixtures/tsconfig/cases/field/index.js | 0 fixtures/tsconfig/cases/field/tsconfig.json | 3 - fixtures/tsconfig/cases/index/index.js | 0 fixtures/tsconfig/cases/index/tsconfig.json | 3 - .../cases/paths_template_variable/foo.js | 0 .../paths_template_variable/tsconfig1.json | 3 - .../paths_template_variable/tsconfig2.json | 8 - .../project_references/app/aliased/index.ts | 0 .../cases/project_references/app/index.ts | 0 .../project_references/app/tsconfig.json | 23 - .../project_a/aliased/index.ts | 0 .../project_references/project_a/conf.json | 8 - .../project_references/project_a/index.ts | 0 .../project_b/src/aliased/index.ts | 0 .../project_b/tsconfig.json | 9 - .../project_references/project_c/index.ts | 0 .../project_c/tsconfig.json | 5 - .../project_references/tsconfig.base.json | 4 - fixtures/tsconfig/cases/suffixes/a.ios.ts | 0 fixtures/tsconfig/cases/suffixes/a.ts | 0 fixtures/tsconfig/cases/suffixes/b.ts | 0 fixtures/tsconfig/cases/suffixes/c-test.ts | 0 fixtures/tsconfig/cases/suffixes/index.ts | 1 - .../tsconfig/cases/suffixes/tsconfig.json | 5 - fixtures/tsconfig/cases/trailing-comma/bar.js | 0 .../tsconfig/cases/trailing-comma/index.js | 0 .../cases/trailing-comma/tsconfig.json | 9 - fixtures/tsconfig/foo.js | 0 fixtures/tsconfig/nested/index.js | 0 fixtures/tsconfig/nested/test.js | 0 fixtures/tsconfig/nested/tsconfig.json | 8 - .../node_modules/tsconfig-exports/conf.json | 7 - .../node_modules/tsconfig-exports/foo.js | 0 .../tsconfig-exports/package.json | 7 - .../node_modules/tsconfig-field/conf.json | 7 - .../node_modules/tsconfig-field/foo.js | 0 .../node_modules/tsconfig-field/package.json | 5 - .../node_modules/tsconfig-index/foo.js | 0 .../node_modules/tsconfig-index/package.json | 4 - .../node_modules/tsconfig-index/tsconfig.json | 7 - .../node_modules/tsconfig-not-used/foo.js | 0 .../tsconfig-not-used/tsconfig.json | 7 - fixtures/tsconfig/package.json | 24 - fixtures/tsconfig/tsconfig.json | 7 - .../tsconfig/tsconfig_template_variable.json | 7 - napi/{src => Source}/lib.rs | 0 napi/{src => Source}/options.rs | 0 napi/__test__/resolver.spec.mjs | 259 -- napi/tests/options.test.mjs | 59 - npm/package.json | 67 +- package.json | 56 +- pnpm-lock.yaml | 2450 ---------------- src/tests/alias.rs | 220 -- src/tests/browser_field.rs | 176 -- src/tests/builtins.rs | 98 - src/tests/dependencies.rs | 110 - src/tests/exports_field.rs | 2546 ----------------- src/tests/extension_alias.rs | 66 - src/tests/extensions.rs | 125 - src/tests/fallback.rs | 100 - src/tests/full_specified.rs | 113 - src/tests/imports_field.rs | 1320 --------- src/tests/incorrect_description_file.rs | 62 - src/tests/main_field.rs | 24 - src/tests/memory_fs.rs | 74 - src/tests/missing.rs | 106 - src/tests/mod.rs | 49 - src/tests/resolve.rs | 119 - src/tests/restrictions.rs | 25 - src/tests/roots.rs | 92 - src/tests/scoped_packages.rs | 25 - src/tests/simple.rs | 68 - src/tests/symlink.rs | 121 - src/tests/tsconfig_paths.rs | 507 ---- src/tests/tsconfig_project_references.rs | 101 - tests/integration_test.rs | 102 - tests/package.json | 3 - tests/resolve_test.rs | 104 - 299 files changed, 50 insertions(+), 11832 deletions(-) delete mode 100644 .github/CODE_OF_CONDUCT.md delete mode 100644 .github/SECURITY.md delete mode 100644 .github/actions/pnpm/action.yml delete mode 100644 .github/actions/rustup/action.yml delete mode 100644 .github/codecov.yml delete mode 100644 .github/renovate.json delete mode 100644 .github/workflows/benchmark.yml delete mode 100644 .github/workflows/ci.yml delete mode 100644 .github/workflows/codecov.yml delete mode 100644 .github/workflows/release-napi.yml delete mode 100644 .github/workflows/release-plz.yml delete mode 100644 Cargo.lock rename {src => Source}/builtins.rs (100%) rename {src => Source}/cache.rs (100%) rename {src => Source}/context.rs (100%) rename {src => Source}/error.rs (100%) rename {src => Source}/file_system.rs (100%) rename {src => Source}/lib.rs (100%) rename {src => Source}/options.rs (100%) rename {src => Source}/package_json.rs (100%) rename {src => Source}/path.rs (100%) rename {src => Source}/resolution.rs (100%) rename {src => Source}/specifier.rs (100%) rename {src => Source}/tsconfig.rs (100%) delete mode 100644 fixtures/enhanced_resolve/lib/index.js delete mode 100644 fixtures/enhanced_resolve/package.json delete mode 100644 fixtures/enhanced_resolve/test/.gitignore delete mode 100644 fixtures/enhanced_resolve/test/fixtures/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/abc.txt delete mode 100644 fixtures/enhanced_resolve/test/fixtures/alias/files/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/browser/module-a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/ignore.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/replaced.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/self.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/toString.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-c.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/c.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/d.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/c.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/complex.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/crypto-js/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/decorated-fs/exists.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/dirOrFile.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/directory-default/directory-default.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/pack1/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/umd.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/index delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/src/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.mts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mjs delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mts.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/app.module.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/foo.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/foo.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/file.load1 delete mode 100644 fixtures/enhanced_resolve/test/fixtures/file.load2 delete mode 100644 fixtures/enhanced_resolve/test/fixtures/foo/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/foo/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/internal/file.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/y/y.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/internal/i.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-3/nested/f/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-4/f/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f$/$.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f/$.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/dir/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/c/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/issue-238/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/issue-238/src/a/config.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/issue-238/src/common/config/myObjectFile.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/lib.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/lib/complex1.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self2/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main1.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main2.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main3.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/no#fragment/#/#.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/no.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/invalidPackageJson/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/file.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/dir/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/typescript/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/prefer-pnp/alternative-modules/m1/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.css delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/index.css delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/module.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/roots_fall_through/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/lib/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/shortcutdir.js/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/b delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/c delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo/a delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo/b delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/b/foo/a delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/c/foo/a delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json delete mode 100644 "fixtures/enhanced_resolve/test/fixtures/\346\265\213\350\257\225.js" delete mode 100644 "fixtures/misc/\344\270\255\346\226\207/\344\270\255\346\226\207.js" delete mode 100644 fixtures/pnpm8/.gitignore delete mode 100644 fixtures/pnpm8/package.json delete mode 100644 fixtures/pnpm8/pnpm-lock.yaml delete mode 100644 fixtures/tsconfig/cases/builtins/thing.js delete mode 100644 fixtures/tsconfig/cases/builtins/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/exports/index.js delete mode 100644 fixtures/tsconfig/cases/exports/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-extension/base-tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-extension/foo.js delete mode 100644 fixtures/tsconfig/cases/extends-extension/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-extensionless/foo.js delete mode 100644 fixtures/tsconfig/cases/extends-extensionless/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-multiple/foo.js delete mode 100644 fixtures/tsconfig/cases/extends-multiple/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-not-found/index.js delete mode 100644 fixtures/tsconfig/cases/extends-not-found/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-paths/src/index.js delete mode 100644 fixtures/tsconfig/cases/extends-paths/tsconfig.base.json delete mode 100644 fixtures/tsconfig/cases/extends-paths/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/field/index.js delete mode 100644 fixtures/tsconfig/cases/field/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/index/index.js delete mode 100644 fixtures/tsconfig/cases/index/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/paths_template_variable/foo.js delete mode 100644 fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json delete mode 100644 fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json delete mode 100644 fixtures/tsconfig/cases/project_references/app/aliased/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/app/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/app/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/project_references/project_a/aliased/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_a/conf.json delete mode 100644 fixtures/tsconfig/cases/project_references/project_a/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_b/src/aliased/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_b/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/project_references/project_c/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_c/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/project_references/tsconfig.base.json delete mode 100644 fixtures/tsconfig/cases/suffixes/a.ios.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/a.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/b.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/c-test.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/index.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/trailing-comma/bar.js delete mode 100644 fixtures/tsconfig/cases/trailing-comma/index.js delete mode 100644 fixtures/tsconfig/cases/trailing-comma/tsconfig.json delete mode 100644 fixtures/tsconfig/foo.js delete mode 100644 fixtures/tsconfig/nested/index.js delete mode 100644 fixtures/tsconfig/nested/test.js delete mode 100644 fixtures/tsconfig/nested/tsconfig.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-exports/conf.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-exports/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-exports/package.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-field/conf.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-field/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-field/package.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-index/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-index/package.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-not-used/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json delete mode 100755 fixtures/tsconfig/package.json delete mode 100644 fixtures/tsconfig/tsconfig.json delete mode 100644 fixtures/tsconfig/tsconfig_template_variable.json rename napi/{src => Source}/lib.rs (100%) rename napi/{src => Source}/options.rs (100%) delete mode 100644 napi/__test__/resolver.spec.mjs delete mode 100644 napi/tests/options.test.mjs delete mode 100644 pnpm-lock.yaml delete mode 100644 src/tests/alias.rs delete mode 100644 src/tests/browser_field.rs delete mode 100644 src/tests/builtins.rs delete mode 100644 src/tests/dependencies.rs delete mode 100644 src/tests/exports_field.rs delete mode 100644 src/tests/extension_alias.rs delete mode 100644 src/tests/extensions.rs delete mode 100644 src/tests/fallback.rs delete mode 100644 src/tests/full_specified.rs delete mode 100644 src/tests/imports_field.rs delete mode 100644 src/tests/incorrect_description_file.rs delete mode 100644 src/tests/main_field.rs delete mode 100644 src/tests/memory_fs.rs delete mode 100644 src/tests/missing.rs delete mode 100644 src/tests/mod.rs delete mode 100644 src/tests/resolve.rs delete mode 100644 src/tests/restrictions.rs delete mode 100644 src/tests/roots.rs delete mode 100644 src/tests/scoped_packages.rs delete mode 100644 src/tests/simple.rs delete mode 100644 src/tests/symlink.rs delete mode 100644 src/tests/tsconfig_paths.rs delete mode 100644 src/tests/tsconfig_project_references.rs delete mode 100644 tests/integration_test.rs delete mode 100644 tests/package.json delete mode 100644 tests/resolve_test.rs diff --git a/.github/CODE_OF_CONDUCT.md b/.github/CODE_OF_CONDUCT.md deleted file mode 100644 index 41dd9ebe..00000000 --- a/.github/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,127 +0,0 @@ -# Contributor Covenant Code of Conduct - -## Our Pledge - -We as members, contributors, and leaders pledge to make participation in our -community a harassment-free experience for everyone, regardless of age, body -size, visible or invisible disability, ethnicity, sex characteristics, gender -identity and expression, level of experience, education, socio-economic status, -nationality, personal appearance, race, religion, or sexual identity -and orientation. - -We pledge to act and interact in ways that contribute to an open, welcoming, -diverse, inclusive, and healthy community. - -## Our Standards - -Examples of behavior that contributes to a positive environment for our -community include: - -* Demonstrating empathy and kindness toward other people -* Being respectful of differing opinions, viewpoints, and experiences -* Giving and gracefully accepting constructive feedback -* Accepting responsibility and apologizing to those affected by our mistakes, - and learning from the experience -* Focusing on what is best not just for us as individuals, but for the - overall community - -Examples of unacceptable behavior include: - -* The use of sexualized language or imagery, and sexual attention or - advances of any kind -* Trolling, insulting or derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or email - address, without their explicit permission -* Other conduct which could reasonably be considered inappropriate in a - professional setting - -## Enforcement Responsibilities - -Community leaders are responsible for clarifying and enforcing our standards of -acceptable behavior and will take appropriate and fair corrective action in -response to any behavior that they deem inappropriate, threatening, offensive, -or harmful. - -Community leaders have the right and responsibility to remove, edit, or reject -comments, commits, code, wiki edits, issues, and other contributions that are -not aligned to this Code of Conduct, and will communicate reasons for moderation -decisions when appropriate. - -## Scope - -This Code of Conduct applies within all community spaces, and also applies when -an individual is officially representing the community in public spaces. -Examples of representing our community include using an official e-mail address, -posting via an official social media account, or acting as an appointed -representative at an online or offline event. - -## Enforcement - -Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported to the community leaders responsible for enforcement. -All complaints will be reviewed and investigated promptly and fairly. - -All community leaders are obligated to respect the privacy and security of the -reporter of any incident. - -## Enforcement Guidelines - -Community leaders will follow these Community Impact Guidelines in determining -the consequences for any action they deem in violation of this Code of Conduct: - -### 1. Correction - -**Community Impact**: Use of inappropriate language or other behavior deemed -unprofessional or unwelcome in the community. - -**Consequence**: A private, written warning from community leaders, providing -clarity around the nature of the violation and an explanation of why the -behavior was inappropriate. A public apology may be requested. - -### 2. Warning - -**Community Impact**: A violation through a single incident or series -of actions. - -**Consequence**: A warning with consequences for continued behavior. No -interaction with the people involved, including unsolicited interaction with -those enforcing the Code of Conduct, for a specified period of time. This -includes avoiding interactions in community spaces as well as external channels -like social media. Violating these terms may lead to a temporary or -permanent ban. - -### 3. Temporary Ban - -**Community Impact**: A serious violation of community standards, including -sustained inappropriate behavior. - -**Consequence**: A temporary ban from any sort of interaction or public -communication with the community for a specified period of time. No public or -private interaction with the people involved, including unsolicited interaction -with those enforcing the Code of Conduct, is allowed during this period. -Violating these terms may lead to a permanent ban. - -### 4. Permanent Ban - -**Community Impact**: Demonstrating a pattern of violation of community -standards, including sustained inappropriate behavior, harassment of an -individual, or aggression toward or disparagement of classes of individuals. - -**Consequence**: A permanent ban from any sort of public interaction within -the community. - -## Attribution - -This Code of Conduct is adapted from the [Contributor Covenant][homepage], -version 2.0, available at -https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. - -Community Impact Guidelines were inspired by [Mozilla's code of conduct -enforcement ladder](https://github.com/mozilla/diversity). - -[homepage]: https://www.contributor-covenant.org - -For answers to common questions about this code of conduct, see the FAQ at -https://www.contributor-covenant.org/faq. Translations are available at -https://www.contributor-covenant.org/translations. diff --git a/.github/SECURITY.md b/.github/SECURITY.md deleted file mode 100644 index 63f5b072..00000000 --- a/.github/SECURITY.md +++ /dev/null @@ -1,7 +0,0 @@ -# Security Policy - -## Supported Versions - -## Reporting a Vulnerability - -If you find any potential vulnerability, join our [discord channel](https://discord.gg/9uXCAwqQZW) and contact Boshen. diff --git a/.github/actions/pnpm/action.yml b/.github/actions/pnpm/action.yml deleted file mode 100644 index 2ff4f975..00000000 --- a/.github/actions/pnpm/action.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: Pnpm - -description: Install pnpm - -runs: - using: composite - steps: - - name: Install pnpm - working-directory: fixtures/pnpm8 - shell: bash - run: corepack enable - - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: 18 - cache-dependency-path: ./fixtures/pnpm8/package.json - cache: pnpm - - - name: pnpm install - working-directory: fixtures/pnpm8 - shell: bash - run: pnpm install diff --git a/.github/actions/rustup/action.yml b/.github/actions/rustup/action.yml deleted file mode 100644 index f0a60b41..00000000 --- a/.github/actions/rustup/action.yml +++ /dev/null @@ -1,88 +0,0 @@ -name: Rustup - -description: Install Rust with minimal profile and additional components - -inputs: - # See https://rust-lang.github.io/rustup/concepts/components.html - clippy: - default: false - required: false - type: boolean - fmt: - default: false - required: false - type: boolean - docs: - default: false - required: false - type: boolean - restore-cache: - default: true - required: false - type: boolean - save-cache: - default: false - required: false - type: boolean - shared-key: - default: 'warm' - required: false - type: string - -runs: - using: composite - steps: - - name: Print Inputs - shell: bash - run: | - echo 'clippy: ${{ inputs.clippy }}' - echo 'fmt: ${{ inputs.fmt }}' - echo 'docs: ${{ inputs.docs }}' - echo 'restore-cache: ${{ inputs.restore-cache }}' - echo 'save-cache: ${{ inputs.save-cache }}' - - - name: Change to minimal profile on MacOS - shell: bash - if: runner.os == 'macOS' - run: | - sed -i '' -e 's/profile = "default"/profile = "minimal"/g' rust-toolchain.toml - cat rust-toolchain.toml - - - name: Change to minimal profile on non-MacOS - shell: bash - if: runner.os != 'macOS' - run: | - sed -i -e 's/profile = "default"/profile = "minimal"/g' rust-toolchain.toml - cat rust-toolchain.toml - - - name: Set minimal - shell: bash - run: rustup set profile minimal - - - name: Add Clippy - shell: bash - if: ${{ inputs.clippy == 'true' }} - run: rustup component add clippy - - - name: Add Rustfmt - shell: bash - if: ${{ inputs.fmt == 'true' }} - run: rustup component add rustfmt - - - name: Add docs - shell: bash - if: ${{ inputs.docs == 'true' }} - run: rustup component add rust-docs - - - name: Install - shell: bash - run: | - rustup show - git restore . - - - name: Cache on ${{ github.ref_name }} - uses: Swatinem/rust-cache@v2 - if: ${{ inputs.restore-cache == 'true' }} - with: - shared-key: ${{ inputs.shared-key }} - save-if: ${{ inputs.save-cache == 'true' }} diff --git a/.github/codecov.yml b/.github/codecov.yml deleted file mode 100644 index 0610268a..00000000 --- a/.github/codecov.yml +++ /dev/null @@ -1,14 +0,0 @@ -coverage: - status: - project: - default: - informational: true - patch: - default: - informational: true - changes: - default: - informational: true - -ignore: - - "examples" diff --git a/.github/renovate.json b/.github/renovate.json deleted file mode 100644 index 2339df09..00000000 --- a/.github/renovate.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "$schema": "https://docs.renovatebot.com/renovate-schema.json", - "extends": ["github>Boshen/renovate"], - "ignorePaths": ["**/node_modules/**", "**/fixtures/**"] -} diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml deleted file mode 100644 index 1757b376..00000000 --- a/.github/workflows/benchmark.yml +++ /dev/null @@ -1,45 +0,0 @@ -name: Benchmark - -on: - workflow_dispatch: - pull_request: - types: [opened, synchronize] - paths-ignore: - - '**/*.md' - push: - branches: - - main - paths-ignore: - - '**/*.md' - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} - cancel-in-progress: true - -jobs: - benchmark: - name: Benchmark - runs-on: ubuntu-latest - steps: - - name: Checkout Branch - uses: taiki-e/checkout-action@v1 - - - name: Install Rust - uses: moonrepo/setup-rust@v1 - with: - cache-base: main - - - name: Install codspeed - uses: taiki-e/install-action@v2 - with: - tool: cargo-codspeed - - - name: Build Benchmark - run: cargo codspeed build --features codspeed - - - name: Run benchmark - uses: CodSpeedHQ/action@v2 - timeout-minutes: 30 - with: - run: cargo codspeed run - token: ${{ secrets.CODSPEED_TOKEN }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index e05c630b..00000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,219 +0,0 @@ -name: CI - -on: - workflow_dispatch: - pull_request: - types: [opened, synchronize] - paths-ignore: - - '**/*.md' - push: - branches: - - main - - "renovate/**" - paths-ignore: - - '**/*.md' - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} - cancel-in-progress: ${{ github.ref_name != 'main' }} - -jobs: - cache: # Warm cache factory for all other CI jobs - name: Check and Build - strategy: - fail-fast: false - matrix: - include: - - os: windows-latest - - os: ubuntu-latest - - os: macos-14 - runs-on: ${{ matrix.os }} - steps: - - uses: taiki-e/checkout-action@v1 - - - name: Install Rust Toolchain - uses: ./.github/actions/rustup - with: - save-cache: ${{ github.ref_name == 'main' }} - - - name: Cargo check - run: cargo check --all-features --locked - - # Only need to build the test to create a warm cache on the main branch - - name: Build cache by Cargo Check and Cargo Test - if: ${{ github.ref_name == 'main' }} - run: cargo test --all-features --no-run - - wasm: - name: Check Wasm - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - - name: Install Rust Toolchain - uses: ./.github/actions/rustup - with: - shared-key: 'wasm' - save-cache: ${{ github.ref_name == 'main' }} - - - name: Check - run: | - rustup target add wasm32-unknown-unknown - cargo check --target wasm32-unknown-unknown - - wasi: - name: Test wasi target - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - - name: Install Rust Toolchain - uses: ./.github/actions/rustup - with: - shared-key: 'wasi' - save-cache: ${{ github.ref_name == 'main' }} - - - name: corepack - run: corepack enable - - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: 20 - cache: pnpm - - - name: Install dependencies - run: pnpm install --frozen-lockfile - - - name: Install fixtures dependencies - working-directory: fixtures/pnpm8 - run: pnpm install --frozen-lockfile - - - name: Build - run: | - rustup target add wasm32-wasip1-threads - pnpm build --target wasm32-wasip1-threads - - - name: Test - run: pnpm test - env: - WASI_TEST: 1 - - typos: - name: Spell Check - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - - uses: crate-ci/typos@master - with: - files: . - - deny: - name: Cargo Deny - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - - uses: dorny/paths-filter@v3 - id: filter - with: - filters: | - src: - - 'Cargo.lock' - - - name: Install cargo-deny - if: steps.filter.outputs.src == 'true' - uses: taiki-e/install-action@cargo-deny - - - uses: ./.github/actions/rustup - with: - restore-cache: false - - - if: steps.filter.outputs.src == 'true' - run: cargo deny check - - unused-deps: - name: Check Unused Dependencies - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - uses: dorny/paths-filter@v3 - id: filter - with: - filters: | - src: - - '**/*.rs' - - '**/Cargo.toml' - - 'Cargo.lock' - - uses: ./.github/actions/rustup - with: - restore-cache: false - if: steps.filter.outputs.src == 'true' - - uses: cargo-bins/cargo-binstall@main - if: steps.filter.outputs.src == 'true' - - run: cargo binstall --no-confirm cargo-shear - if: steps.filter.outputs.src == 'true' - - run: cargo shear - if: steps.filter.outputs.src == 'true' - - format: - name: Format - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - - name: Install Rust - uses: ./.github/actions/rustup - with: - fmt: true - restore-cache: false - - - run: cargo fmt --all -- --check - - lint: - name: Clippy - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - - name: Install Rust - uses: ./.github/actions/rustup - with: - clippy: true - - - name: Run Clippy - run: cargo clippy -- -D warnings - - doc: - name: Doc - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - - name: Install Rust - uses: ./.github/actions/rustup - with: - docs: true - - - name: Run doc - run: RUSTDOCFLAGS='-D warnings' cargo doc --no-deps --all-features - - test: - name: Test - strategy: - fail-fast: false - matrix: - include: - - os: windows-latest - - os: ubuntu-latest - - os: macos-14 - runs-on: ${{ matrix.os }} - env: - RUST_BACKTRACE: 1 - steps: - - uses: taiki-e/checkout-action@v1 - - uses: ./.github/actions/pnpm - - uses: ./.github/actions/rustup - - run: cargo test --doc - - run: cargo test --all-features diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml deleted file mode 100644 index e1692512..00000000 --- a/.github/workflows/codecov.yml +++ /dev/null @@ -1,76 +0,0 @@ -name: Code Coverage # Run cargo-llvm-cov and upload to codecov.io - -on: - workflow_dispatch: - pull_request: - types: [opened, synchronize] - paths-ignore: - - '**/*.md' - push: - branches: - - main - paths-ignore: - - '**/*.md' - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: ${{ github.ref_name != 'main' }} - -jobs: - coverage: - name: Code Coverage - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: taiki-e/checkout-action@v1 - - - name: Pnpm - uses: ./.github/actions/pnpm - - - name: Install Rust Toolchain - uses: ./.github/actions/rustup - with: - shared-key: 'codecov' - save-cache: ${{ github.ref_name == 'main' }} - - - name: Install cargo-llvm-cov - uses: taiki-e/install-action@cargo-llvm-cov - - - name: Install llvm-tools-preview for llvm-cov - run: rustup component add llvm-tools-preview - - - name: Run - run: cargo llvm-cov --lcov --output-path lcov.info - - - name: Upload Artifact - uses: actions/upload-artifact@v4 - with: - name: codecov - path: lcov.info - - # codecov often fails, use another workflow for retry - upload-codecov: - name: Upload coverage file - runs-on: ubuntu-latest - needs: coverage - # Check if the event is not triggered by a fork by checking whether CODECOV_TOKEN is set - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - steps: - - name: Checkout - if: env.CODECOV_TOKEN - uses: taiki-e/checkout-action@v1 - - - name: Download coverage file - if: env.CODECOV_TOKEN - uses: actions/download-artifact@v4 - with: - name: codecov - - - name: Upload to codecov.io - if: env.CODECOV_TOKEN - uses: codecov/codecov-action@v4 - with: - token: ${{ secrets.CODECOV_TOKEN }} - fail_ci_if_error: true - files: lcov.info diff --git a/.github/workflows/release-napi.yml b/.github/workflows/release-napi.yml deleted file mode 100644 index 73e64834..00000000 --- a/.github/workflows/release-napi.yml +++ /dev/null @@ -1,220 +0,0 @@ -name: Release NAPI - -on: - workflow_dispatch: - push: - branches: - - main - paths: - - npm/package.json # Please only commit this file, so we don't need to wait for test CI to pass. - -env: - DEBUG: 'napi:*' - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - check: - name: Check version - runs-on: ubuntu-latest - outputs: - version: ${{ env.version }} - version_changed: ${{ steps.version.outputs.changed }} - steps: - - uses: taiki-e/checkout-action@v1 - - - name: Check version changes - uses: EndBug/version-check@v2 - id: version - with: - static-checking: localIsNew - file-url: https://unpkg.com/oxc-resolver@latest/package.json - file-name: npm/package.json - - - name: Set version name - if: steps.version.outputs.changed == 'true' - run: | - echo "Version change found! New version: ${{ steps.version.outputs.version }} (${{ steps.version.outputs.version_type }})" - echo "version=${{ steps.version.outputs.version }}" >> $GITHUB_ENV - - build: - needs: check - if: needs.check.outputs.version_changed == 'true' - env: - version: ${{ needs.check.outputs.version }} - outputs: - version: ${{ env.version }} - strategy: - fail-fast: false - matrix: - include: - - os: windows-latest - target: x86_64-pc-windows-msvc - - - os: windows-latest - target: aarch64-pc-windows-msvc - - - os: ubuntu-latest - target: x86_64-unknown-linux-gnu - - - os: ubuntu-latest - target: x86_64-unknown-linux-musl - - - os: ubuntu-latest - target: aarch64-unknown-linux-gnu - - - os: ubuntu-latest - target: aarch64-unknown-linux-musl - - - os: ubuntu-latest - target: armv7-unknown-linux-gnueabihf - - - os: macos-latest - target: x86_64-apple-darwin - - - os: macos-latest - target: aarch64-apple-darwin - - - os: ubuntu-latest - target: wasm32-wasip1-threads - - name: Package ${{ matrix.target }} - runs-on: ${{ matrix.os }} - steps: - - uses: taiki-e/checkout-action@v1 - - - name: corepack - run: corepack enable - - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: 20 - cache: pnpm - - - name: Install dependencies - run: pnpm install --frozen-lockfile - - - name: Install fixtures dependencies - working-directory: fixtures/pnpm8 - run: pnpm install --frozen-lockfile - - - name: Add Rust Target - run: rustup target add ${{ matrix.target }} - - - uses: goto-bus-stop/setup-zig@v2 - if: ${{ contains(matrix.target, 'musl') }} - with: - version: 0.11.0 - - - name: Build with zig cross - if: ${{ contains(matrix.target, 'musl') }} - run: pnpm build -x --target ${{ matrix.target }} - - - name: Build with napi cross - if: ${{ contains(matrix.target, 'gnu') }} - run: pnpm build --use-napi-cross --target ${{ matrix.target }} - - - name: Build - if: ${{ !contains(matrix.target, 'gnu') && !contains(matrix.target, 'musl') }} - run: pnpm build --target ${{ matrix.target }} - - - name: Test - if: matrix.target == 'x86_64-pc-windows-msvc' || matrix.target == 'x86_64-apple-darwin' || matrix.target == 'wasm32-wasip1-threads' - run: pnpm test - - - name: Output docker params - if: ${{ contains(matrix.target, 'linux') }} - id: docker - run: | - node -e " - if ('${{ matrix.target }}'.startsWith('aarch64')) { - console.log('PLATFORM=linux/arm64') - } else if ('${{ matrix.target }}'.startsWith('armv7')) { - console.log('PLATFORM=linux/arm/v7') - } else { - console.log('PLATFORM=linux/amd64') - } - " >> $GITHUB_OUTPUT - node -e " - if ('${{ matrix.target }}'.endsWith('-musl')) { - console.log('IMAGE=node:lts-alpine') - } else { - console.log('IMAGE=node:lts-slim') - } - " >> $GITHUB_OUTPUT - echo "PNPM_STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_OUTPUT - - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - if: ${{ contains(matrix.target, 'linux') }} - with: - platforms: all - - - run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes - if: ${{ contains(matrix.target, 'linux') }} - - - name: Run linux test - uses: addnab/docker-run-action@v3 - if: ${{ contains(matrix.target, 'linux') }} - with: - image: ${{ steps.docker.outputs.IMAGE }} - options: -v ${{ steps.docker.outputs.PNPM_STORE_PATH }}:${{ steps.docker.outputs.PNPM_STORE_PATH }} -v ${{ github.workspace }}:/oxc_resolver -w /oxc_resolver --platform ${{ steps.docker.outputs.PLATFORM }} - run: | - corepack enable - pnpm test - - - name: Upload artifacts - uses: actions/upload-artifact@v4 - with: - name: bindings-${{ matrix.target }} - path: | - napi/*.node - napi/*.wasm - - publish: - name: Publish NAPI - runs-on: ubuntu-latest - permissions: - id-token: write # for `npm publish --provenance` - needs: - - build - steps: - - uses: taiki-e/checkout-action@v1 - - - name: corepack - run: corepack enable - - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: 20 - cache: pnpm - - - name: Install dependencies - run: pnpm install --frozen-lockfile - - - name: Download Artifacts - uses: actions/download-artifact@v4 - with: - path: artifacts - - - name: Prepare dirs and artifacts - run: | - pnpm napi create-npm-dirs --package-json-path npm/package.json - pnpm napi artifacts --package-json-path npm/package.json --build-output-dir napi - - - name: Publish npm packages as latest - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - shell: bash - run: | - cp napi/index.js npm/index.js - cp napi/index.d.ts npm/index.d.ts - cp napi/browser.js npm/browser.js - echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc - pnpm napi pre-publish --no-gh-release -t npm --package-json-path npm/package.json - npm publish npm/ --tag latest --provenance --access public diff --git a/.github/workflows/release-plz.yml b/.github/workflows/release-plz.yml deleted file mode 100644 index cd0d0736..00000000 --- a/.github/workflows/release-plz.yml +++ /dev/null @@ -1,35 +0,0 @@ -name: Release Plz - -on: - workflow_dispatch: - push: - branches: - - main - paths: - - Cargo.toml - -permissions: - pull-requests: write - contents: write - -jobs: - release-plz: - name: Release-plz - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Install Rust Toolchain - uses: ./.github/actions/rustup - with: - save-cache: ${{ github.ref_name == 'main' }} - - - name: Run release-plz - uses: MarcoIeni/release-plz-action@v0.5 - with: - command: release - env: - GITHUB_TOKEN: ${{ secrets.RELEASE_PLZ_TOKEN }} - CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} diff --git a/Cargo.lock b/Cargo.lock deleted file mode 100644 index c39ebab8..00000000 --- a/Cargo.lock +++ /dev/null @@ -1,880 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "aho-corasick" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" -dependencies = [ - "memchr", -] - -[[package]] -name = "anes" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "735d4f398ca57cfa2880225c2bf81c3b9af3be5bb22e44ae70118dad38713e84" - -[[package]] -name = "autocfg" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "bitflags" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" - -[[package]] -name = "bpaf" -version = "0.9.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3280efcf6d66bc77c2cf9b67dc8acee47a217d9be67dd590b3230dffe663724d" - -[[package]] -name = "cast" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "ciborium" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42e69ffd6f0917f5c029256a24d0161db17cea3997d185db0d35926308770f0e" -dependencies = [ - "ciborium-io", - "ciborium-ll", - "serde", -] - -[[package]] -name = "ciborium-io" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05afea1e0a06c9be33d539b876f1ce3692f4afea2cb41f740e7743225ed1c757" - -[[package]] -name = "ciborium-ll" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57663b653d948a338bfb3eeba9bb2fd5fcfaecb9e199e87e1eda4d9e8b240fd9" -dependencies = [ - "ciborium-io", - "half", -] - -[[package]] -name = "clean-path" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aaa6b4b263a5d737e9bf6b7c09b72c41a5480aec4d7219af827f6564e950b6a5" - -[[package]] -name = "codspeed" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a104ac948e0188b921eb3fcbdd55dcf62e542df4c7ab7e660623f6288302089" -dependencies = [ - "colored", - "libc", - "serde_json", -] - -[[package]] -name = "colored" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbf2150cce219b664a8a70df7a1f933836724b503f8a413af9365b4dcc4d90b8" -dependencies = [ - "lazy_static", - "windows-sys 0.48.0", -] - -[[package]] -name = "convert_case" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec182b0ca2f35d8fc196cf3404988fd8b8c739a4d270ff118a398feb0cbec1ca" -dependencies = [ - "unicode-segmentation", -] - -[[package]] -name = "criterion2" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43b57a5b1bf6ed08b671717cf7ce07d3dea4efa30f54d0b64abce48d8299818f" -dependencies = [ - "anes", - "bpaf", - "cast", - "ciborium", - "codspeed", - "colored", - "itertools", - "num-traits", - "oorandom", - "serde", - "serde_derive", - "serde_json", - "tinytemplate", - "walkdir", -] - -[[package]] -name = "crossbeam-deque" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" -dependencies = [ - "crossbeam-epoch", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.9.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" -dependencies = [ - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" - -[[package]] -name = "crunchy" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" - -[[package]] -name = "ctor" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edb49164822f3ee45b17acd4a208cfc1251410cf0cad9a833234c9890774dd9f" -dependencies = [ - "quote", - "syn", -] - -[[package]] -name = "dashmap" -version = "5.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" -dependencies = [ - "cfg-if", - "hashbrown", - "lock_api", - "once_cell", - "parking_lot_core", -] - -[[package]] -name = "document-features" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef5282ad69563b5fc40319526ba27e0e7363d552a896f0297d54f767717f9b95" -dependencies = [ - "litrs", -] - -[[package]] -name = "dunce" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b" - -[[package]] -name = "either" -version = "1.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a47c1c47d2f5964e29c61246e81db715514cd532db6b5116a25ea3c03d6780a2" - -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "filetime" -version = "0.2.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ee447700ac8aa0b2f2bd7bc4462ad686ba06baa6727ac149a2d6277f0d240fd" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall 0.4.1", - "windows-sys 0.52.0", -] - -[[package]] -name = "half" -version = "2.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dd08c532ae367adf81c312a4580bc67f1d0fe8bc9c460520283f4c0ff277888" -dependencies = [ - "cfg-if", - "crunchy", -] - -[[package]] -name = "hashbrown" -version = "0.14.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" - -[[package]] -name = "indexmap" -version = "2.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" -dependencies = [ - "equivalent", - "hashbrown", - "serde", -] - -[[package]] -name = "itertools" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" -dependencies = [ - "either", -] - -[[package]] -name = "itoa" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" - -[[package]] -name = "json-strip-comments" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3d129799327c8f80861e467c59b825ba24c277dba6ad0d71a141dc98f9e04ee" - -[[package]] -name = "lazy_static" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" - -[[package]] -name = "libc" -version = "0.2.154" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae743338b92ff9146ce83992f766a31066a91a8c84a45e0e9f21e7cf6de6d346" - -[[package]] -name = "libloading" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c2a198fb6b0eada2a8df47933734e6d35d350665a33a3593d7164fa52c75c19" -dependencies = [ - "cfg-if", - "windows-targets 0.52.5", -] - -[[package]] -name = "litrs" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4ce301924b7887e9d637144fdade93f9dfff9b60981d4ac161db09720d39aa5" - -[[package]] -name = "lock_api" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" -dependencies = [ - "autocfg", - "scopeguard", -] - -[[package]] -name = "memchr" -version = "2.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" - -[[package]] -name = "napi" -version = "2.16.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfc300228808a0e6aea5a58115c82889240bcf8dab16fc25ad675b33e454b368" -dependencies = [ - "bitflags 2.5.0", - "ctor", - "napi-derive", - "napi-sys", - "once_cell", - "serde", - "serde_json", -] - -[[package]] -name = "napi-build" -version = "2.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1c0f5d67ee408a4685b61f5ab7e58605c8ae3f2b4189f0127d804ff13d5560a" - -[[package]] -name = "napi-derive" -version = "2.16.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bb613535cde46cff231e53cd819c1694a32d48946bc2dda6b41174ace52ac08" -dependencies = [ - "cfg-if", - "convert_case", - "napi-derive-backend", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "napi-derive-backend" -version = "1.0.66" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da041b19246ab4240998774e987fd9a7d92cc7406b91b5eddb6691e81feac044" -dependencies = [ - "convert_case", - "once_cell", - "proc-macro2", - "quote", - "regex", - "semver", - "syn", -] - -[[package]] -name = "napi-sys" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "427802e8ec3a734331fec1035594a210ce1ff4dc5bc1950530920ab717964ea3" -dependencies = [ - "libloading", -] - -[[package]] -name = "normalize-path" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5438dd2b2ff4c6df6e1ce22d825ed2fa93ee2922235cc45186991717f0a892d" - -[[package]] -name = "num-traits" -version = "0.2.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" -dependencies = [ - "autocfg", -] - -[[package]] -name = "once_cell" -version = "1.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" - -[[package]] -name = "oorandom" -version = "11.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575" - -[[package]] -name = "oxc_napi_resolver" -version = "0.0.0" -dependencies = [ - "napi", - "napi-build", - "napi-derive", - "oxc_resolver", -] - -[[package]] -name = "oxc_resolver" -version = "1.7.0" -dependencies = [ - "criterion2", - "dashmap", - "document-features", - "dunce", - "json-strip-comments", - "normalize-path", - "once_cell", - "rayon", - "rustc-hash", - "serde", - "serde_json", - "thiserror", - "tracing", - "typescript_tsconfig_json", - "vfs", -] - -[[package]] -name = "parking_lot_core" -version = "0.9.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall 0.5.1", - "smallvec", - "windows-targets 0.52.5", -] - -[[package]] -name = "pin-project-lite" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" - -[[package]] -name = "proc-macro2" -version = "1.0.82" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ad3d49ab951a01fbaafe34f2ec74122942fe18a3f9814c3268f1bb72042131b" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.36" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "rayon" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" -dependencies = [ - "either", - "rayon-core", -] - -[[package]] -name = "rayon-core" -version = "1.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" -dependencies = [ - "crossbeam-deque", - "crossbeam-utils", -] - -[[package]] -name = "redox_syscall" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" -dependencies = [ - "bitflags 1.3.2", -] - -[[package]] -name = "redox_syscall" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "469052894dcb553421e483e4209ee581a45100d31b4018de03e5a7ad86374a7e" -dependencies = [ - "bitflags 2.5.0", -] - -[[package]] -name = "regex" -version = "1.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" -dependencies = [ - "aho-corasick", - "memchr", - "regex-automata", - "regex-syntax", -] - -[[package]] -name = "regex-automata" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", -] - -[[package]] -name = "regex-syntax" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" - -[[package]] -name = "rustc-hash" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" - -[[package]] -name = "ryu" -version = "1.0.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" - -[[package]] -name = "same-file" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "scopeguard" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" - -[[package]] -name = "semver" -version = "1.0.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" - -[[package]] -name = "serde" -version = "1.0.201" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "780f1cebed1629e4753a1a38a3c72d30b97ec044f0aef68cb26650a3c5cf363c" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.201" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5e405930b9796f1c00bee880d03fc7e0bb4b9a11afc776885ffe84320da2865" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "serde_json" -version = "1.0.117" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3" -dependencies = [ - "indexmap", - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "smallvec" -version = "1.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" - -[[package]] -name = "syn" -version = "2.0.63" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf5be731623ca1a1fb7d8be6f261a3be6d3e2337b8a1f97be944d020c8fcb704" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "thiserror" -version = "1.0.60" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "579e9083ca58dd9dcf91a9923bb9054071b9ebbd800b342194c9feb0ee89fc18" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.60" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2470041c06ec3ac1ab38d0356a6119054dedaea53e12fbefc0de730a1c08524" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "tinytemplate" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be4d6b5f19ff7664e8c98d03e2139cb510db9b0a60b55f8e8709b689d939b6bc" -dependencies = [ - "serde", - "serde_json", -] - -[[package]] -name = "tracing" -version = "0.1.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" -dependencies = [ - "pin-project-lite", - "tracing-attributes", - "tracing-core", -] - -[[package]] -name = "tracing-attributes" -version = "0.1.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "tracing-core" -version = "0.1.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" -dependencies = [ - "once_cell", -] - -[[package]] -name = "typescript_tsconfig_json" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7cc416eaf05297012ead9d192226fe9a92e9a20f64f8780efb9085aaae9b590" -dependencies = [ - "clean-path", - "indexmap", - "rustc-hash", - "serde", - "serde_json", -] - -[[package]] -name = "unicode-ident" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" - -[[package]] -name = "unicode-segmentation" -version = "1.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" - -[[package]] -name = "vfs" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "654cd097e182a71dbf899178e6b5662c2157dd0b8afd5975de18008f6fc173d1" -dependencies = [ - "filetime", -] - -[[package]] -name = "walkdir" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" -dependencies = [ - "same-file", - "winapi-util", -] - -[[package]] -name = "winapi-util" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b" -dependencies = [ - "windows-sys 0.52.0", -] - -[[package]] -name = "windows-sys" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" -dependencies = [ - "windows-targets 0.48.5", -] - -[[package]] -name = "windows-sys" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" -dependencies = [ - "windows-targets 0.52.5", -] - -[[package]] -name = "windows-targets" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" -dependencies = [ - "windows_aarch64_gnullvm 0.48.5", - "windows_aarch64_msvc 0.48.5", - "windows_i686_gnu 0.48.5", - "windows_i686_msvc 0.48.5", - "windows_x86_64_gnu 0.48.5", - "windows_x86_64_gnullvm 0.48.5", - "windows_x86_64_msvc 0.48.5", -] - -[[package]] -name = "windows-targets" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" -dependencies = [ - "windows_aarch64_gnullvm 0.52.5", - "windows_aarch64_msvc 0.52.5", - "windows_i686_gnu 0.52.5", - "windows_i686_gnullvm", - "windows_i686_msvc 0.52.5", - "windows_x86_64_gnu 0.52.5", - "windows_x86_64_gnullvm 0.52.5", - "windows_x86_64_msvc 0.52.5", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" - -[[package]] -name = "windows_i686_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" - -[[package]] -name = "windows_i686_gnu" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" - -[[package]] -name = "windows_i686_gnullvm" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" - -[[package]] -name = "windows_i686_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" - -[[package]] -name = "windows_i686_msvc" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" diff --git a/src/builtins.rs b/Source/builtins.rs similarity index 100% rename from src/builtins.rs rename to Source/builtins.rs diff --git a/src/cache.rs b/Source/cache.rs similarity index 100% rename from src/cache.rs rename to Source/cache.rs diff --git a/src/context.rs b/Source/context.rs similarity index 100% rename from src/context.rs rename to Source/context.rs diff --git a/src/error.rs b/Source/error.rs similarity index 100% rename from src/error.rs rename to Source/error.rs diff --git a/src/file_system.rs b/Source/file_system.rs similarity index 100% rename from src/file_system.rs rename to Source/file_system.rs diff --git a/src/lib.rs b/Source/lib.rs similarity index 100% rename from src/lib.rs rename to Source/lib.rs diff --git a/src/options.rs b/Source/options.rs similarity index 100% rename from src/options.rs rename to Source/options.rs diff --git a/src/package_json.rs b/Source/package_json.rs similarity index 100% rename from src/package_json.rs rename to Source/package_json.rs diff --git a/src/path.rs b/Source/path.rs similarity index 100% rename from src/path.rs rename to Source/path.rs diff --git a/src/resolution.rs b/Source/resolution.rs similarity index 100% rename from src/resolution.rs rename to Source/resolution.rs diff --git a/src/specifier.rs b/Source/specifier.rs similarity index 100% rename from src/specifier.rs rename to Source/specifier.rs diff --git a/src/tsconfig.rs b/Source/tsconfig.rs similarity index 100% rename from src/tsconfig.rs rename to Source/tsconfig.rs diff --git a/fixtures/enhanced_resolve/lib/index.js b/fixtures/enhanced_resolve/lib/index.js deleted file mode 100644 index 1e872e8f..00000000 --- a/fixtures/enhanced_resolve/lib/index.js +++ /dev/null @@ -1 +0,0 @@ -// mimic enhanced-resolved root directory structure diff --git a/fixtures/enhanced_resolve/package.json b/fixtures/enhanced_resolve/package.json deleted file mode 100644 index d1b845b5..00000000 --- a/fixtures/enhanced_resolve/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "enhanced-resolve", - "main": "lib/index.js" -} diff --git a/fixtures/enhanced_resolve/test/.gitignore b/fixtures/enhanced_resolve/test/.gitignore deleted file mode 100644 index bbbec5f4..00000000 --- a/fixtures/enhanced_resolve/test/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# created by symlink.rs -/temp diff --git a/fixtures/enhanced_resolve/test/fixtures/a.js b/fixtures/enhanced_resolve/test/fixtures/a.js deleted file mode 100644 index 896ffc6d..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/abc.txt b/fixtures/enhanced_resolve/test/fixtures/abc.txt deleted file mode 100644 index f2ba8f84..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/abc.txt +++ /dev/null @@ -1 +0,0 @@ -abc \ No newline at end of file diff --git a/fixtures/enhanced_resolve/test/fixtures/alias/files/a.js b/fixtures/enhanced_resolve/test/fixtures/alias/files/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/b.js b/fixtures/enhanced_resolve/test/fixtures/b.js deleted file mode 100644 index 11476340..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/b.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function b() { - return "This is b"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/browser/module-a.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/browser/module-a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/browser.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/ignore.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/ignore.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/replaced.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/replaced.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/self.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/self.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/toString.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/toString.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-a.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-b.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-c.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-c.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/a.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/b.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/c.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/c.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/d.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/d.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json deleted file mode 100644 index c13fe23b..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "browser": { - "a.js": "./a", - "./b.js": "./b", - "c.js": "./d.js", - "./d.js": "./c.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/package.json b/fixtures/enhanced_resolve/test/fixtures/browser-module/package.json deleted file mode 100644 index 1068633a..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/browser-module/package.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "exports": { - "./lib/index.js": "./lib/index.js" - }, - "browser": { - "./lib/ignore.js": false, - "./lib/replaced.js": "./lib/browser", - "module-a": "./browser/module-a.js", - "module-b": "module-c", - "module-c": "module-c", - "./toString": "./lib/toString.js", - "./lib/main.js": "./lib/main.js", - "./main.js": "./lib/main.js", - "./lib/xyz.js": "./xyz.js", - "./xyz.js": "./lib/xyz.js", - "./lib/non-existent.js": "./lib/non-existent.js", - ".": false, - "./number": 1 - }, - "innerBrowser1": { - "field": { - "browser": { - "./lib/main1.js": "./lib/main.js" - } - } - }, - "innerBrowser2": { - "browser": { - "./lib/main2.js": "./lib/replaced.js" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/c.js b/fixtures/enhanced_resolve/test/fixtures/c.js deleted file mode 100644 index e3aca8aa..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/c.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = function b() { - require("./a"); - return "This is c"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/complex.js b/fixtures/enhanced_resolve/test/fixtures/complex.js deleted file mode 100644 index 1f62db84..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/complex.js +++ /dev/null @@ -1,13 +0,0 @@ -var 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); diff --git a/fixtures/enhanced_resolve/test/fixtures/crypto-js/index.js b/fixtures/enhanced_resolve/test/fixtures/crypto-js/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json b/fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json deleted file mode 100644 index 1d31aa8b..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "crypto-js", - "main": "index.js", - "browser": { - "crypto": false - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/decorated-fs/exists.js b/fixtures/enhanced_resolve/test/fixtures/decorated-fs/exists.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/dirOrFile.js b/fixtures/enhanced_resolve/test/fixtures/dirOrFile.js deleted file mode 100644 index c3cb885f..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/dirOrFile.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "file"; diff --git a/fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js b/fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js deleted file mode 100644 index 85e01cd4..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "dir"; diff --git a/fixtures/enhanced_resolve/test/fixtures/directory-default/directory-default.js b/fixtures/enhanced_resolve/test/fixtures/directory-default/directory-default.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js deleted file mode 100644 index d1007aae..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js +++ /dev/null @@ -1 +0,0 @@ -export default "string"; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts deleted file mode 100644 index cb0ff5c3..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json deleted file mode 100644 index b523a1e9..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "@org/pkg", - "exports": { - "./*.js": { - "types": "./dist/*.d.ts", - "default": "./dist/*.js" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js deleted file mode 100644 index d1007aae..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js +++ /dev/null @@ -1 +0,0 @@ -export default "string"; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts deleted file mode 100644 index cb0ff5c3..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json deleted file mode 100644 index 8e55fb46..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "@raviqqe/hidash", - "exports": { - "./*.js": { - "types": "./dist/*.d.ts", - "default": "./dist/*.js" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json deleted file mode 100644 index f0edf449..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "exports-field", - "version": "1.0.0", - "exports": { - ".": "./a/../b/../../pack1/index.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/pack1/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/pack1/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/a.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/a.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json deleted file mode 100644 index 6b105c08..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "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/": { - "webpack": ["./lib/lib2/", "./lib/"], - "node": "./lib/", - "default": "./lib/" - }, - "./dist/a.js": "./../../a.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json deleted file mode 100644 index 0012a3de..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "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" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/umd.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/umd.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field/package.json deleted file mode 100644 index 5fa72bb5..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "@exports-field/core", - "version": "1.0.0", - "exports": "./a.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json deleted file mode 100644 index e6f12074..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "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/lib2/", "./lib/"], - "node": "./lib/", - "default": "./lib/" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/index b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/index deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json deleted file mode 100644 index 1a838f49..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "name": "exports-field", - "exportsField": { - "exports": "./main.js" - }, - "ex": "./index", - "broken": { - ".": "./src" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/src/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/src/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.ts b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.mts b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.mts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mjs b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mjs deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mts.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mts.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.ts b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/app.module.js b/fixtures/enhanced_resolve/test/fixtures/extensions/app.module.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.js b/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/foo.js b/fixtures/enhanced_resolve/test/fixtures/extensions/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/foo.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/foo.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/index.js b/fixtures/enhanced_resolve/test/fixtures/extensions/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/index.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module.js b/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module/index.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/package.json b/fixtures/enhanced_resolve/test/fixtures/extensions/package.json deleted file mode 100644 index 5e55a1e8..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/extensions/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "./index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/file.load1 b/fixtures/enhanced_resolve/test/fixtures/file.load1 deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/file.load2 b/fixtures/enhanced_resolve/test/fixtures/file.load2 deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/foo/index.js b/fixtures/enhanced_resolve/test/fixtures/foo/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/foo/package.json b/fixtures/enhanced_resolve/test/fixtures/foo/package.json deleted file mode 100644 index da86787a..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/foo/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "foo", - "version": "1.0.0" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json deleted file mode 100644 index aa2be496..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "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" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/internal/file.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/internal/file.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/y/y.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/y/y.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/internal/i.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/internal/i.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/nested/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js deleted file mode 100644 index e5b70a86..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = { nested: "nested" } diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-3/nested/f/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-3/nested/f/nested/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-4/f/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-4/f/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f$/$.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f$/$.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f/$.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f/$.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/nested/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/a.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/a.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/b.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/dir/b.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/dir/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/index.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json deleted file mode 100644 index 8d8d3a46..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "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/lib2/", "./lib/"], - "node": "./lib/", - "default": "./lib/" - }, - "./dist/a.js": "./../../a.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/c/index.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/c/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/imports-field/package.json deleted file mode 100644 index 248351a9..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "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" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/a.js b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json deleted file mode 100644 index ded7faa2..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json +++ /dev/null @@ -1,2 +0,0 @@ -{ - "main": "./a.js", diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/a.js b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/package.json b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/package.json deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/issue-238/package.json b/fixtures/enhanced_resolve/test/fixtures/issue-238/package.json deleted file mode 100644 index 352055cd..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/issue-238/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "private": true -} diff --git a/fixtures/enhanced_resolve/test/fixtures/issue-238/src/a/config.js b/fixtures/enhanced_resolve/test/fixtures/issue-238/src/a/config.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/issue-238/src/common/config/myObjectFile.js b/fixtures/enhanced_resolve/test/fixtures/issue-238/src/common/config/myObjectFile.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/lib.js b/fixtures/enhanced_resolve/test/fixtures/lib.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/lib/complex1.js b/fixtures/enhanced_resolve/test/fixtures/lib/complex1.js deleted file mode 100644 index b3de3d70..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/lib/complex1.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "lib complex1"; diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self/index.js b/fixtures/enhanced_resolve/test/fixtures/main-field-self/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json b/fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json deleted file mode 100644 index a2b6f341..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "./" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self2/index.js b/fixtures/enhanced_resolve/test/fixtures/main-field-self2/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json b/fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json deleted file mode 100644 index 4fa6f730..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "." -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main1.js b/fixtures/enhanced_resolve/test/fixtures/main1.js deleted file mode 100644 index 168f2a1e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main1.js +++ /dev/null @@ -1,9 +0,0 @@ -var a = require("./a"); -if (x) { - for (var i = 0; i < 100; i++) { - while (true) require("./b"); - do { - i++; - } while (require("m1/a")()); - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main2.js b/fixtures/enhanced_resolve/test/fixtures/main2.js deleted file mode 100644 index 39f062b1..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main2.js +++ /dev/null @@ -1,12 +0,0 @@ -var 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"); - }); - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main3.js b/fixtures/enhanced_resolve/test/fixtures/main3.js deleted file mode 100644 index 1c180166..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main3.js +++ /dev/null @@ -1,4 +0,0 @@ -var a = require("./a"); -require.ensure([], function(require) { - require("./c.js"); -}); diff --git a/fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js b/fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js deleted file mode 100644 index 997c1051..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is nested m1/a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/no#fragment/#/#.js b/fixtures/enhanced_resolve/test/fixtures/no#fragment/#/#.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/no.js b/fixtures/enhanced_resolve/test/fixtures/no.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/browser.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/browser.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/main.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json deleted file mode 100644 index c469e1fd..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "main": "./main.js", - "browser": "./browser.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js deleted file mode 100644 index 549620a5..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "the correct a.js"; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js deleted file mode 100644 index 5db6632e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = " :) " + require("m2/b.js"); diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js deleted file mode 100644 index d308569d..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require("m1/a") + require("m1"); diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js deleted file mode 100644 index cb8127e8..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "Step2"; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json deleted file mode 100644 index 8d6dfa56..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "dash-name", - "exports": "./index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json deleted file mode 100644 index 4fd8706e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "dash", - "exports": "./index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/invalidPackageJson/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/invalidPackageJson/package.json deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js deleted file mode 100644 index 46fc8e6c..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is m1/a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js deleted file mode 100644 index 8565c244..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is m1/b"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js deleted file mode 100644 index 34faaaf5..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "This is m2/b"; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/file.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/file.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js b/fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js deleted file mode 100644 index 997c1051..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is nested m1/a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/dir/index.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/dir/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/index.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/main.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/browser.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/browser.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/index.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json deleted file mode 100644 index e20ceaeb..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "main": "main.js", - "browser": { - "./package-alias/index.js": "./package-alias/browser.js", - "module": "pkg/dir/index" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/typescript/index.ts b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/typescript/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json deleted file mode 100644 index 4a1f838e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "@exports-field/core", - "version": "1.0.0", - "exports": { - ".": "./a.js", - "./x": "./a.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/prefer-pnp/alternative-modules/m1/b.js b/fixtures/enhanced_resolve/test/fixtures/prefer-pnp/alternative-modules/m1/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.css b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.css deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.js b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json deleted file mode 100644 index 14ab704d..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/index.css b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/index.css deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/module.js b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/module.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json deleted file mode 100644 index ee0eb71b..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "main": "../../../c.js", - "module": "module.js", - "style": "index.css" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/roots_fall_through/index.js b/fixtures/enhanced_resolve/test/fixtures/roots_fall_through/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/main.js b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json deleted file mode 100644 index 70a0f20f..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "browser": { - "./index.js": "./main.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/lib/index.js b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/lib/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/main.js b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json deleted file mode 100644 index 2af9e0d1..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "./main.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/shortcutdir.js/a.js b/fixtures/enhanced_resolve/test/fixtures/shortcutdir.js/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/b b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/b deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/c b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/c deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/a b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/a deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/b b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/b deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/b/foo/a b/fixtures/enhanced_resolve/test/fixtures/yield/b/foo/a deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/a b/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/a deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json b/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json deleted file mode 100644 index 0acc4b4c..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "foo", - "version": "1.0.0", - "browser": { - "./a": false - } -} diff --git "a/fixtures/enhanced_resolve/test/fixtures/\346\265\213\350\257\225.js" "b/fixtures/enhanced_resolve/test/fixtures/\346\265\213\350\257\225.js" deleted file mode 100644 index e69de29b..00000000 diff --git "a/fixtures/misc/\344\270\255\346\226\207/\344\270\255\346\226\207.js" "b/fixtures/misc/\344\270\255\346\226\207/\344\270\255\346\226\207.js" deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/pnpm8/.gitignore b/fixtures/pnpm8/.gitignore deleted file mode 100644 index 3c3629e6..00000000 --- a/fixtures/pnpm8/.gitignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/fixtures/pnpm8/package.json b/fixtures/pnpm8/package.json deleted file mode 100644 index cbced892..00000000 --- a/fixtures/pnpm8/package.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "name": "pnpm8", - "version": "1.0.0", - "private": true, - "engines": { - "node": ">=16.0.0" - }, - "packageManager": "pnpm@8.10.5", - "devDependencies": { - "axios": "1.6.2", - "styled-components": "6.1.1", - "postcss": "8.4.33" - } -} diff --git a/fixtures/pnpm8/pnpm-lock.yaml b/fixtures/pnpm8/pnpm-lock.yaml deleted file mode 100644 index e51dfd6a..00000000 --- a/fixtures/pnpm8/pnpm-lock.yaml +++ /dev/null @@ -1,212 +0,0 @@ -lockfileVersion: '6.0' - -settings: - autoInstallPeers: true - excludeLinksFromLockfile: false - -devDependencies: - axios: - specifier: 1.6.2 - version: 1.6.2 - postcss: - specifier: 8.4.33 - version: 8.4.33 - styled-components: - specifier: 6.1.1 - version: 6.1.1(react-dom@18.2.0)(react@18.2.0) - -packages: - - /@emotion/is-prop-valid@1.2.1: - resolution: {integrity: sha512-61Mf7Ufx4aDxx1xlDeOm8aFFigGHE4z+0sKCa+IHCeZKiyP9RLD0Mmx7m8b9/Cf37f7NAvQOOJAbQQGVr5uERw==} - dependencies: - '@emotion/memoize': 0.8.1 - dev: true - - /@emotion/memoize@0.8.1: - resolution: {integrity: sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA==} - dev: true - - /@emotion/unitless@0.8.1: - resolution: {integrity: sha512-KOEGMu6dmJZtpadb476IsZBclKvILjopjUii3V+7MnXIQCYh8W3NgNcgwo21n9LXZX6EDIKvqfjYxXebDwxKmQ==} - dev: true - - /@types/stylis@4.2.4: - resolution: {integrity: sha512-36ZrGJ8fgtBr6nwNnuJ9jXIj+bn/pF6UoqmrQT7+Y99+tFFeHHsoR54+194dHdyhPjgbeoNz3Qru0oRt0l6ASQ==} - dev: true - - /asynckit@0.4.0: - resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} - dev: true - - /axios@1.6.2: - resolution: {integrity: sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A==} - dependencies: - follow-redirects: 1.15.3 - form-data: 4.0.0 - proxy-from-env: 1.1.0 - transitivePeerDependencies: - - debug - dev: true - - /camelize@1.0.1: - resolution: {integrity: sha512-dU+Tx2fsypxTgtLoE36npi3UqcjSSMNYfkqgmoEhtZrraP5VWq0K7FkWVTYa8eMPtnU/G2txVsfdCJTn9uzpuQ==} - dev: true - - /combined-stream@1.0.8: - resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} - engines: {node: '>= 0.8'} - dependencies: - delayed-stream: 1.0.0 - dev: true - - /css-color-keywords@1.0.0: - resolution: {integrity: sha512-FyyrDHZKEjXDpNJYvVsV960FiqQyXc/LlYmsxl2BcdMb2WPx0OGRVgTg55rPSyLSNMqP52R9r8geSp7apN3Ofg==} - engines: {node: '>=4'} - dev: true - - /css-to-react-native@3.2.0: - resolution: {integrity: sha512-e8RKaLXMOFii+02mOlqwjbD00KSEKqblnpO9e++1aXS1fPQOpS1YoqdVHBqPjHNoxeF2mimzVqawm2KCbEdtHQ==} - dependencies: - camelize: 1.0.1 - css-color-keywords: 1.0.0 - postcss-value-parser: 4.2.0 - dev: true - - /csstype@3.1.2: - resolution: {integrity: sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==} - dev: true - - /delayed-stream@1.0.0: - resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} - engines: {node: '>=0.4.0'} - dev: true - - /follow-redirects@1.15.3: - resolution: {integrity: sha512-1VzOtuEM8pC9SFU1E+8KfTjZyMztRsgEfwQl44z8A25uy13jSzTj6dyK2Df52iV0vgHCfBwLhDWevLn95w5v6Q==} - engines: {node: '>=4.0'} - peerDependencies: - debug: '*' - peerDependenciesMeta: - debug: - optional: true - dev: true - - /form-data@4.0.0: - resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==} - engines: {node: '>= 6'} - dependencies: - asynckit: 0.4.0 - combined-stream: 1.0.8 - mime-types: 2.1.35 - dev: true - - /js-tokens@4.0.0: - resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} - dev: true - - /loose-envify@1.4.0: - resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==} - hasBin: true - dependencies: - js-tokens: 4.0.0 - dev: true - - /mime-db@1.52.0: - resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} - engines: {node: '>= 0.6'} - dev: true - - /mime-types@2.1.35: - resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} - engines: {node: '>= 0.6'} - dependencies: - mime-db: 1.52.0 - dev: true - - /nanoid@3.3.7: - resolution: {integrity: sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==} - engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} - hasBin: true - dev: true - - /picocolors@1.0.0: - resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==} - dev: true - - /postcss-value-parser@4.2.0: - resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==} - dev: true - - /postcss@8.4.33: - resolution: {integrity: sha512-Kkpbhhdjw2qQs2O2DGX+8m5OVqEcbB9HRBvuYM9pgrjEFUg30A9LmXNlTAUj4S9kgtGyrMbTzVjH7E+s5Re2yg==} - engines: {node: ^10 || ^12 || >=14} - dependencies: - nanoid: 3.3.7 - picocolors: 1.0.0 - source-map-js: 1.0.2 - dev: true - - /proxy-from-env@1.1.0: - resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==} - dev: true - - /react-dom@18.2.0(react@18.2.0): - resolution: {integrity: sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==} - peerDependencies: - react: ^18.2.0 - dependencies: - loose-envify: 1.4.0 - react: 18.2.0 - scheduler: 0.23.0 - dev: true - - /react@18.2.0: - resolution: {integrity: sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==} - engines: {node: '>=0.10.0'} - dependencies: - loose-envify: 1.4.0 - dev: true - - /scheduler@0.23.0: - resolution: {integrity: sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw==} - dependencies: - loose-envify: 1.4.0 - dev: true - - /shallowequal@1.1.0: - resolution: {integrity: sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ==} - dev: true - - /source-map-js@1.0.2: - resolution: {integrity: sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==} - engines: {node: '>=0.10.0'} - dev: true - - /styled-components@6.1.1(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-cpZZP5RrKRIClBW5Eby4JM1wElLVP4NQrJbJ0h10TidTyJf4SIIwa3zLXOoPb4gJi8MsJ8mjq5mu2IrEhZIAcQ==} - engines: {node: '>= 16'} - peerDependencies: - react: '>= 16.8.0' - react-dom: '>= 16.8.0' - dependencies: - '@emotion/is-prop-valid': 1.2.1 - '@emotion/unitless': 0.8.1 - '@types/stylis': 4.2.4 - css-to-react-native: 3.2.0 - csstype: 3.1.2 - postcss: 8.4.33 - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - shallowequal: 1.1.0 - stylis: 4.3.0 - tslib: 2.6.2 - dev: true - - /stylis@4.3.0: - resolution: {integrity: sha512-E87pIogpwUsUwXw7dNyU4QDjdgVMy52m+XEOPEKUn161cCzWjjhPSQhByfd1CcNvrOLnXQ6OnnZDwnJrz/Z4YQ==} - dev: true - - /tslib@2.6.2: - resolution: {integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==} - dev: true diff --git a/fixtures/tsconfig/cases/builtins/thing.js b/fixtures/tsconfig/cases/builtins/thing.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/builtins/tsconfig.json b/fixtures/tsconfig/cases/builtins/tsconfig.json deleted file mode 100644 index 36aa1a4d..00000000 --- a/fixtures/tsconfig/cases/builtins/tsconfig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compilerOptions": { - "baseUrl": "." - } -} diff --git a/fixtures/tsconfig/cases/exports/index.js b/fixtures/tsconfig/cases/exports/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/exports/tsconfig.json b/fixtures/tsconfig/cases/exports/tsconfig.json deleted file mode 100644 index f0e3159b..00000000 --- a/fixtures/tsconfig/cases/exports/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-exports" -} diff --git a/fixtures/tsconfig/cases/extends-extension/base-tsconfig.json b/fixtures/tsconfig/cases/extends-extension/base-tsconfig.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/cases/extends-extension/base-tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/cases/extends-extension/foo.js b/fixtures/tsconfig/cases/extends-extension/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-extension/tsconfig.json b/fixtures/tsconfig/cases/extends-extension/tsconfig.json deleted file mode 100644 index 0ae4c6a3..00000000 --- a/fixtures/tsconfig/cases/extends-extension/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./base-tsconfig" -} diff --git a/fixtures/tsconfig/cases/extends-extensionless/foo.js b/fixtures/tsconfig/cases/extends-extensionless/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-extensionless/tsconfig.json b/fixtures/tsconfig/cases/extends-extensionless/tsconfig.json deleted file mode 100644 index c36cb7d4..00000000 --- a/fixtures/tsconfig/cases/extends-extensionless/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-field/conf" -} diff --git a/fixtures/tsconfig/cases/extends-multiple/foo.js b/fixtures/tsconfig/cases/extends-multiple/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-multiple/tsconfig.json b/fixtures/tsconfig/cases/extends-multiple/tsconfig.json deleted file mode 100644 index aa2ae783..00000000 --- a/fixtures/tsconfig/cases/extends-multiple/tsconfig.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": ["../extends-extension", "../extends-paths"], - "compilerOptions": { - "baseUrl": ".", - }, -} diff --git a/fixtures/tsconfig/cases/extends-not-found/index.js b/fixtures/tsconfig/cases/extends-not-found/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-not-found/tsconfig.json b/fixtures/tsconfig/cases/extends-not-found/tsconfig.json deleted file mode 100644 index 99df91da..00000000 --- a/fixtures/tsconfig/cases/extends-not-found/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./not-found" -} diff --git a/fixtures/tsconfig/cases/extends-paths/src/index.js b/fixtures/tsconfig/cases/extends-paths/src/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-paths/tsconfig.base.json b/fixtures/tsconfig/cases/extends-paths/tsconfig.base.json deleted file mode 100644 index 5c64b067..00000000 --- a/fixtures/tsconfig/cases/extends-paths/tsconfig.base.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "@/*": ["./*"] - } - } -} diff --git a/fixtures/tsconfig/cases/extends-paths/tsconfig.json b/fixtures/tsconfig/cases/extends-paths/tsconfig.json deleted file mode 100644 index 51086018..00000000 --- a/fixtures/tsconfig/cases/extends-paths/tsconfig.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": "./tsconfig.base.json", - "compilerOptions": { - "baseUrl": "src", - }, -} diff --git a/fixtures/tsconfig/cases/field/index.js b/fixtures/tsconfig/cases/field/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/field/tsconfig.json b/fixtures/tsconfig/cases/field/tsconfig.json deleted file mode 100644 index 9f86c3f4..00000000 --- a/fixtures/tsconfig/cases/field/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-field" -} diff --git a/fixtures/tsconfig/cases/index/index.js b/fixtures/tsconfig/cases/index/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/index/tsconfig.json b/fixtures/tsconfig/cases/index/tsconfig.json deleted file mode 100644 index d20b1774..00000000 --- a/fixtures/tsconfig/cases/index/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-index" -} diff --git a/fixtures/tsconfig/cases/paths_template_variable/foo.js b/fixtures/tsconfig/cases/paths_template_variable/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json b/fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json deleted file mode 100644 index a1a37bb6..00000000 --- a/fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "../../tsconfig_template_variable.json" -} diff --git a/fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json b/fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json deleted file mode 100644 index e7d8e5e5..00000000 --- a/fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "compilerOptions": { - "composite": true, - "paths": { - "foo": ["${configDir}/foo.js"] - } - } -} diff --git a/fixtures/tsconfig/cases/project_references/app/aliased/index.ts b/fixtures/tsconfig/cases/project_references/app/aliased/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/app/index.ts b/fixtures/tsconfig/cases/project_references/app/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/app/tsconfig.json b/fixtures/tsconfig/cases/project_references/app/tsconfig.json deleted file mode 100644 index 7036d2bb..00000000 --- a/fixtures/tsconfig/cases/project_references/app/tsconfig.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "extends": "../tsconfig.base.json", - "compilerOptions": { - "baseUrl": "./", - "paths": { - "@/*": ["./aliased/*"] - } - }, - "references": [ - { - "path": "../project_a/conf.json" - }, - { - "path": "../project_b" - }, - { - "path": "../project_c/tsconfig.json" - }, - { - "path": "../../paths_template_variable/tsconfig2.json" - } - ] -} diff --git a/fixtures/tsconfig/cases/project_references/project_a/aliased/index.ts b/fixtures/tsconfig/cases/project_references/project_a/aliased/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_a/conf.json b/fixtures/tsconfig/cases/project_references/project_a/conf.json deleted file mode 100644 index 4d389d7a..00000000 --- a/fixtures/tsconfig/cases/project_references/project_a/conf.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "compilerOptions": { - "composite": true, - "paths": { - "@/*": ["./aliased/*"] - } - } -} diff --git a/fixtures/tsconfig/cases/project_references/project_a/index.ts b/fixtures/tsconfig/cases/project_references/project_a/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_b/src/aliased/index.ts b/fixtures/tsconfig/cases/project_references/project_b/src/aliased/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_b/tsconfig.json b/fixtures/tsconfig/cases/project_references/project_b/tsconfig.json deleted file mode 100644 index 4ab05cd8..00000000 --- a/fixtures/tsconfig/cases/project_references/project_b/tsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "compilerOptions": { - "composite": true, - "baseUrl": "./src", - "paths": { - "@/*": ["./aliased/*"] - } - } -} diff --git a/fixtures/tsconfig/cases/project_references/project_c/index.ts b/fixtures/tsconfig/cases/project_references/project_c/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_c/tsconfig.json b/fixtures/tsconfig/cases/project_references/project_c/tsconfig.json deleted file mode 100644 index fe520939..00000000 --- a/fixtures/tsconfig/cases/project_references/project_c/tsconfig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compilerOptions": { - "composite": true - } -} diff --git a/fixtures/tsconfig/cases/project_references/tsconfig.base.json b/fixtures/tsconfig/cases/project_references/tsconfig.base.json deleted file mode 100644 index 88ccffe7..00000000 --- a/fixtures/tsconfig/cases/project_references/tsconfig.base.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "compilerOptions": { - } -} diff --git a/fixtures/tsconfig/cases/suffixes/a.ios.ts b/fixtures/tsconfig/cases/suffixes/a.ios.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/a.ts b/fixtures/tsconfig/cases/suffixes/a.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/b.ts b/fixtures/tsconfig/cases/suffixes/b.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/c-test.ts b/fixtures/tsconfig/cases/suffixes/c-test.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/index.ts b/fixtures/tsconfig/cases/suffixes/index.ts deleted file mode 100644 index b09939b9..00000000 --- a/fixtures/tsconfig/cases/suffixes/index.ts +++ /dev/null @@ -1 +0,0 @@ -import './a'; diff --git a/fixtures/tsconfig/cases/suffixes/tsconfig.json b/fixtures/tsconfig/cases/suffixes/tsconfig.json deleted file mode 100644 index 4c2ccc8f..00000000 --- a/fixtures/tsconfig/cases/suffixes/tsconfig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compilerOptions": { - "moduleSuffixes": [".ios", "-test", ""] - } -} diff --git a/fixtures/tsconfig/cases/trailing-comma/bar.js b/fixtures/tsconfig/cases/trailing-comma/bar.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/trailing-comma/index.js b/fixtures/tsconfig/cases/trailing-comma/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/trailing-comma/tsconfig.json b/fixtures/tsconfig/cases/trailing-comma/tsconfig.json deleted file mode 100644 index 6dc20ca5..00000000 --- a/fixtures/tsconfig/cases/trailing-comma/tsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "compilerOptions": { - "paths": { - /* some comment */ - "foo": ["bar.js"], - }, - }, - // another comment -} diff --git a/fixtures/tsconfig/foo.js b/fixtures/tsconfig/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/nested/index.js b/fixtures/tsconfig/nested/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/nested/test.js b/fixtures/tsconfig/nested/test.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/nested/tsconfig.json b/fixtures/tsconfig/nested/tsconfig.json deleted file mode 100644 index 6deb3011..00000000 --- a/fixtures/tsconfig/nested/tsconfig.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "extends": "..", - "compilerOptions": { - "paths": { - "ts-path": ["test.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-exports/conf.json b/fixtures/tsconfig/node_modules/tsconfig-exports/conf.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-exports/conf.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-exports/foo.js b/fixtures/tsconfig/node_modules/tsconfig-exports/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-exports/package.json b/fixtures/tsconfig/node_modules/tsconfig-exports/package.json deleted file mode 100644 index be0ddee6..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-exports/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "tsconfig-exports", - "private": true, - "exports": { - ".": "./conf.json" - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-field/conf.json b/fixtures/tsconfig/node_modules/tsconfig-field/conf.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-field/conf.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-field/foo.js b/fixtures/tsconfig/node_modules/tsconfig-field/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-field/package.json b/fixtures/tsconfig/node_modules/tsconfig-field/package.json deleted file mode 100644 index 7138fdde..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-field/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "tsconfig-field", - "private": true, - "tsconfig": "conf.json" -} \ No newline at end of file diff --git a/fixtures/tsconfig/node_modules/tsconfig-index/foo.js b/fixtures/tsconfig/node_modules/tsconfig-index/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-index/package.json b/fixtures/tsconfig/node_modules/tsconfig-index/package.json deleted file mode 100644 index eb2431e7..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-index/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "tsconfig-index", - "private": true -} \ No newline at end of file diff --git a/fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json b/fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-not-used/foo.js b/fixtures/tsconfig/node_modules/tsconfig-not-used/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json b/fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json deleted file mode 100644 index eb16d127..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "ts-path": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/package.json b/fixtures/tsconfig/package.json deleted file mode 100755 index f48acd1c..00000000 --- a/fixtures/tsconfig/package.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "name": "resolver", - "private": true, - "alias": { - "aliased": "foo", - "aliased-file": "./bar.js", - "something": "./nested/test.js", - "aliasedfolder": "./nested", - "aliasedabsolute": "/nested", - "foo/bar": "./bar.js", - "glob/*/*": "./nested/$2", - "./baz": "./bar.js", - "url": false - }, - "imports": { - "#test": "./bar.js" - }, - "dependencies": { - "foo": "^0.3.4" - }, - "peerDependencies": { - "bar": "*" - } -} diff --git a/fixtures/tsconfig/tsconfig.json b/fixtures/tsconfig/tsconfig.json deleted file mode 100644 index eb16d127..00000000 --- a/fixtures/tsconfig/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "ts-path": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/tsconfig_template_variable.json b/fixtures/tsconfig/tsconfig_template_variable.json deleted file mode 100644 index 6f272344..00000000 --- a/fixtures/tsconfig/tsconfig_template_variable.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["${configDir}/foo.js"] - } - } -} diff --git a/napi/src/lib.rs b/napi/Source/lib.rs similarity index 100% rename from napi/src/lib.rs rename to napi/Source/lib.rs diff --git a/napi/src/options.rs b/napi/Source/options.rs similarity index 100% rename from napi/src/options.rs rename to napi/Source/options.rs diff --git a/napi/__test__/resolver.spec.mjs b/napi/__test__/resolver.spec.mjs deleted file mode 100644 index 42bafba9..00000000 --- a/napi/__test__/resolver.spec.mjs +++ /dev/null @@ -1,259 +0,0 @@ -import { join } from 'node:path' -import { fileURLToPath } from 'node:url' - -import test from 'ava' - -let ResolverFactory - -if (process.env.WASI_TEST) { - const wasi = await import('../resolver.wasi.cjs') - ResolverFactory = wasi.ResolverFactory -} else { - const napi = await import('../index.js') - ResolverFactory = napi.ResolverFactory -} - -const currentDir = join(fileURLToPath(import.meta.url), '..') - -const enhancedResolveRoot = join( - currentDir, - '..', - '..', - 'fixtures', - 'enhanced_resolve', - 'test', - 'fixtures' -) - -// https://github.com/webpack/enhanced-resolve/blob/main/test/resolve.test.js - -for (const [title, context, request, expected] of [ - [ - 'absolute path', - enhancedResolveRoot, - join(enhancedResolveRoot, 'main1.js'), - join(enhancedResolveRoot, 'main1.js'), - ], - [ - 'file with .js', - enhancedResolveRoot, - './main1.js', - join(enhancedResolveRoot, 'main1.js'), - ], - [ - 'file without extension', - enhancedResolveRoot, - './main1', - join(enhancedResolveRoot, 'main1.js'), - ], - [ - 'another file with .js', - enhancedResolveRoot, - './a.js', - join(enhancedResolveRoot, 'a.js'), - ], - [ - 'another file without extension', - enhancedResolveRoot, - './a', - join(enhancedResolveRoot, 'a.js'), - ], - [ - 'file in module with .js', - enhancedResolveRoot, - 'm1/a.js', - join(enhancedResolveRoot, 'node_modules/m1/a.js'), - ], - [ - 'file in module without extension', - enhancedResolveRoot, - 'm1/a', - join(enhancedResolveRoot, 'node_modules/m1/a.js'), - ], - [ - 'another file in module without extension', - enhancedResolveRoot, - 'complexm/step1', - join(enhancedResolveRoot, 'node_modules/complexm/step1.js'), - ], - [ - 'from submodule to file in sibling module', - join(enhancedResolveRoot, 'node_modules/complexm'), - 'm2/b.js', - join(enhancedResolveRoot, 'node_modules/m2/b.js'), - ], - [ - 'from nested directory to overwritten file in module', - join(enhancedResolveRoot, 'multiple_modules'), - 'm1/a.js', - join(enhancedResolveRoot, 'multiple_modules/node_modules/m1/a.js'), - ], - [ - 'from nested directory to not overwritten file in module', - join(enhancedResolveRoot, 'multiple_modules'), - 'm1/b.js', - join(enhancedResolveRoot, 'node_modules/m1/b.js'), - ], - [ - 'file with query', - enhancedResolveRoot, - './main1.js?query', - join(enhancedResolveRoot, 'main1.js?query'), - ], - [ - 'file with fragment', - enhancedResolveRoot, - './main1.js#fragment', - join(enhancedResolveRoot, 'main1.js#fragment'), - ], - [ - 'file with fragment and query', - enhancedResolveRoot, - './main1.js#fragment?query', - join(enhancedResolveRoot, 'main1.js#fragment?query'), - ], - [ - 'file with query and fragment', - enhancedResolveRoot, - './main1.js?#fragment', - join(enhancedResolveRoot, 'main1.js?#fragment'), - ], - - [ - 'file with query (unicode)', - enhancedResolveRoot, - './测试.js?query', - join(enhancedResolveRoot, '测试.js?query'), - ], - [ - 'file with fragment (unicode)', - enhancedResolveRoot, - './测试.js#fragment', - join(enhancedResolveRoot, '测试.js#fragment'), - ], - [ - 'file with fragment and query (unicode)', - enhancedResolveRoot, - './测试.js#fragment?query', - join(enhancedResolveRoot, '测试.js#fragment?query'), - ], - [ - 'file with query and fragment (unicode)', - enhancedResolveRoot, - './测试.js?#fragment', - join(enhancedResolveRoot, '测试.js?#fragment'), - ], - - [ - 'file in module with query', - enhancedResolveRoot, - 'm1/a?query', - join(enhancedResolveRoot, 'node_modules/m1/a.js?query'), - ], - [ - 'file in module with fragment', - enhancedResolveRoot, - 'm1/a#fragment', - join(enhancedResolveRoot, 'node_modules/m1/a.js#fragment'), - ], - [ - 'file in module with fragment and query', - enhancedResolveRoot, - 'm1/a#fragment?query', - join(enhancedResolveRoot, 'node_modules/m1/a.js#fragment?query'), - ], - [ - 'file in module with query and fragment', - enhancedResolveRoot, - 'm1/a?#fragment', - join(enhancedResolveRoot, 'node_modules/m1/a.js?#fragment'), - ], - [ - 'differ between directory and file, resolve file', - enhancedResolveRoot, - './dirOrFile', - join(enhancedResolveRoot, 'dirOrFile.js'), - ], - [ - 'differ between directory and file, resolve directory', - enhancedResolveRoot, - './dirOrFile/', - join(enhancedResolveRoot, 'dirOrFile/index.js'), - ], - [ - 'find node_modules outside of node_modules', - join(enhancedResolveRoot, 'browser-module/node_modules'), - 'm1/a', - join(enhancedResolveRoot, 'node_modules/m1/a.js'), - ], - [ - "don't crash on main field pointing to self", - enhancedResolveRoot, - './main-field-self', - join(enhancedResolveRoot, './main-field-self/index.js'), - ], - [ - "don't crash on main field pointing to self (2)", - enhancedResolveRoot, - './main-field-self2', - join(enhancedResolveRoot, './main-field-self2/index.js'), - ], - // enhanced-resolve has `#` prepended with a `\0`, they are removed from the - // following 3 expected test results. - // See https://github.com/webpack/enhanced-resolve#escaping - [ - 'handle fragment edge case (no fragment)', - enhancedResolveRoot, - './no#fragment/#/#', - join(enhancedResolveRoot, 'no#fragment', '#', '#.js'), - ], - [ - 'handle fragment edge case (fragment)', - enhancedResolveRoot, - './no#fragment/#/', - join(enhancedResolveRoot, 'no.js#fragment') + '/#/', - ], - [ - 'handle fragment escaping', - enhancedResolveRoot, - './no\0#fragment/\0#/\0##fragment', - join(enhancedResolveRoot, 'no#fragment', '#', '#.js#fragment'), - ], -]) { - test(title, (t) => { - const resolver = new ResolverFactory({ - modules: ['src/a', 'src/b', 'src/common', 'node_modules'], - extensions: ['.js', '.jsx', '.ts', '.tsx'], - }) - - t.is(resolver.sync(context, request).path, expected) - }) -} - -test('resolve pnpm package', (t) => { - const pnpmProjectPath = join(currentDir, '..', '..', 'fixtures', 'pnpm8') - const resolver = new ResolverFactory({ - aliasFields: ['browser'], - }) - t.deepEqual(resolver.sync(pnpmProjectPath, 'styled-components'), { - path: join( - pnpmProjectPath, - 'node_modules/.pnpm/styled-components@6.1.1_react-dom@18.2.0_react@18.2.0/node_modules/styled-components/dist/styled-components.browser.cjs.js' - ), - }) - t.deepEqual( - resolver.sync( - join( - pnpmProjectPath, - 'node_modules/.pnpm/styled-components@6.1.1_react-dom@18.2.0_react@18.2.0/node_modules/styled-components' - ), - 'react' - ), - { - path: join( - pnpmProjectPath, - 'node_modules/.pnpm/react@18.2.0/node_modules/react/index.js' - ), - } - ) -}) diff --git a/napi/tests/options.test.mjs b/napi/tests/options.test.mjs deleted file mode 100644 index 4a93efff..00000000 --- a/napi/tests/options.test.mjs +++ /dev/null @@ -1,59 +0,0 @@ -import { describe, it } from "node:test"; -import { ResolverFactory } from "../index.js"; -import * as assert from "node:assert"; -import * as path from "node:path"; - -const fixtureDir = new URL( - "../../fixtures/enhanced_resolve/test/fixtures", - import.meta.url -).pathname; - -describe("option", () => { - describe("aliasFields", () => { - it("should allow field string ", () => { - const resolver = new ResolverFactory({ aliasFields: ["browser"] }); - assert.match( - resolver.sync(fixtureDir, "./browser-module/lib/replaced.js").path, - /browser-module\/lib\/browser\.js$/ - ); - }); - it("should allow json path array", () => { - const resolver = new ResolverFactory({ - aliasFields: [["innerBrowser1", "field", "browser"]], - }); - - assert.match( - resolver.sync(fixtureDir, "./browser-module/lib/main1.js").path, - /browser-module\/lib\/main\.js$/ - ); - }); - }); - - describe("exportsFields", () => { - const createTest = (exportsFields) => { - const resolver = new ResolverFactory({ exportsFields }); - assert.match( - resolver.sync( - path.resolve(fixtureDir, "./exports-field3"), - "exports-field" - ).path, - /\/exports-field\/src\/index\.js$/ - ); - }; - it("should allow string as field item", createTest(["broken"])); - it("should allow json path array as field item", createTest([["broken"]])); - }); - - describe("mainFields", () => { - const createTest = (mainFields) => { - const resolver = new ResolverFactory({ mainFields }); - assert.match( - resolver.sync(fixtureDir, "../..").path, - /\/lib\/index\.js$/ - ); - }; - it("should use `'main'` as default", createTest(undefined)); - it("should allow field string", createTest("main")); - it("should allow field array", createTest(["main"])); - }); -}); diff --git a/npm/package.json b/npm/package.json index afbfd4a1..b47e6b07 100644 --- a/npm/package.json +++ b/npm/package.json @@ -1,41 +1,30 @@ { - "name": "oxc-resolver", - "version": "1.7.0", - "description": "Oxc Resolver Node API", - "main": "index.js", - "browser": "browser.js", - "files": [ - "index.d.ts", - "index.js", - "browser.js" - ], - "license": "MIT", - "homepage": "https://oxc-project.github.io", - "repository": { - "type": "git", - "url": "git+https://github.com/oxc-project/oxc-resolver.git" - }, - "publishConfig": { - "registry": "https://registry.npmjs.org/", - "access": "public" - }, - "napi": { - "binaryName": "resolver", - "packageName": "@oxc-resolver/binding", - "targets": [ - "x86_64-pc-windows-msvc", - "aarch64-pc-windows-msvc", - "x86_64-unknown-linux-gnu", - "x86_64-unknown-linux-musl", - "aarch64-unknown-linux-gnu", - "aarch64-unknown-linux-musl", - "armv7-unknown-linux-gnueabihf", - "x86_64-apple-darwin", - "aarch64-apple-darwin", - "wasm32-wasip1-threads" - ] - }, - "funding": { - "url": "https://github.com/sponsors/Boshen" - } + "name": "oxc-resolver", + "description": "Oxc Resolver Node API", + "funding": { + "url": "https://github.com/sponsors/Boshen" + }, + "main": "index.js", + "browser": "browser.js", + "files": [ + "index.d.ts", + "index.js", + "browser.js" + ], + "napi": { + "binaryName": "resolver", + "packageName": "@oxc-resolver/binding", + "targets": [ + "x86_64-pc-windows-msvc", + "aarch64-pc-windows-msvc", + "x86_64-unknown-linux-gnu", + "x86_64-unknown-linux-musl", + "aarch64-unknown-linux-gnu", + "aarch64-unknown-linux-musl", + "armv7-unknown-linux-gnueabihf", + "x86_64-apple-darwin", + "aarch64-apple-darwin", + "wasm32-wasip1-threads" + ] + } } diff --git a/package.json b/package.json index 0115cb6c..a431e48f 100644 --- a/package.json +++ b/package.json @@ -1,36 +1,24 @@ { - "name": "@oxc-resolver/binding", - "private": true, - "version": "0.0.0", - "scripts": { - "build": "napi build --platform --release --package-json-path npm/package.json --manifest-path napi/Cargo.toml", - "build:debug": "napi build --platform --package-json-path npm/package.json --manifest-path napi/Cargo.toml", - "prepublishOnly": "napi pre-publish -t npm", - "test": "ava" - }, - "devDependencies": { - "@napi-rs/cli": "^3.0.0-alpha.43", - "@napi-rs/wasm-runtime": "^0.2.0", - "@types/node": "^20.10.4", - "ava": "^6.0.1", - "emnapi": "^1.0.0", - "typescript": "^5.3.3" - }, - "engines": { - "node": ">=10" - }, - "ava": { - "files": [ - "napi/__test__/*.spec.mjs" - ], - "cache": false - }, - "packageManager": "pnpm@9.1.1", - "repository": { - "type": "git", - "url": "git+https://github.com/oxc-project/oxc-resolver.git" - }, - "funding": { - "url": "https://github.com/sponsors/Boshen" - } + "name": "@oxc-resolver/binding", + "funding": { + "url": "https://github.com/sponsors/Boshen" + }, + "scripts": { + "build": "napi build --platform --release --package-json-path npm/package.json --manifest-path napi/Cargo.toml", + "build:debug": "napi build --platform --package-json-path npm/package.json --manifest-path napi/Cargo.toml", + "prepublishOnly": "napi pre-publish -t npm" + }, + "ava": { + "cache": false, + "files": [ + "napi/__test__/*.spec.mjs" + ] + }, + "devDependencies": { + "@napi-rs/cli": "^3.0.0-alpha.43", + "@napi-rs/wasm-runtime": "^0.2.0", + "@types/node": "^20.10.4", + "ava": "^6.0.1", + "emnapi": "^1.0.0" + } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml deleted file mode 100644 index 878ba525..00000000 --- a/pnpm-lock.yaml +++ /dev/null @@ -1,2450 +0,0 @@ -lockfileVersion: '9.0' - -settings: - autoInstallPeers: true - excludeLinksFromLockfile: false - -importers: - - .: - devDependencies: - '@napi-rs/cli': - specifier: ^3.0.0-alpha.43 - version: 3.0.0-alpha.51(@emnapi/runtime@1.1.1)(emnapi@1.1.1) - '@napi-rs/wasm-runtime': - specifier: ^0.2.0 - version: 0.2.0 - '@types/node': - specifier: ^20.10.4 - version: 20.12.7 - ava: - specifier: ^6.0.1 - version: 6.1.2 - emnapi: - specifier: ^1.0.0 - version: 1.1.1 - typescript: - specifier: ^5.3.3 - version: 5.4.5 - -packages: - - '@emnapi/core@1.1.1': - resolution: {integrity: sha512-eu4KjHfXg3I+UUR7vSuwZXpRo4c8h4Rtb5Lu2F7Z4JqJFl/eidquONEBiRs6viXKpWBC3BaJBy68xGJ2j56idw==} - - '@emnapi/runtime@1.1.1': - resolution: {integrity: sha512-3bfqkzuR1KLx57nZfjr2NLnFOobvyS0aTszaEGCGqmYMVDRaGvgIZbjGSV/MHSSmLgQ/b9JFHQ5xm5WRZYd+XQ==} - - '@inquirer/figures@1.0.1': - resolution: {integrity: sha512-mtup3wVKia3ZwULPHcbs4Mor8Voi+iIXEWD7wCNbIO6lYR62oPCTQyrddi5OMYVXHzeCSoneZwJuS8sBvlEwDw==} - engines: {node: '>=18'} - - '@ljharb/through@2.3.13': - resolution: {integrity: sha512-/gKJun8NNiWGZJkGzI/Ragc53cOdcLNdzjLaIa+GEjguQs0ulsurx8WN0jijdK9yPqDvziX995sMRLyLt1uZMQ==} - engines: {node: '>= 0.4'} - - '@mapbox/node-pre-gyp@1.0.11': - resolution: {integrity: sha512-Yhlar6v9WQgUp/He7BdgzOz8lqMQ8sU+jkCq7Wx8Myc5YFJLbEe7lgui/V7G1qB1DJykHSGwreceSaD60Y0PUQ==} - hasBin: true - - '@napi-rs/cli@3.0.0-alpha.51': - resolution: {integrity: sha512-fzTQ4RfhaghFNryWTfb0e93N/J7hNfAOpUNL98u9qMymsXa3w2cUTN8W/HjiNVTUvHHus8X5PuHt9q65cDXcSg==} - engines: {node: '>= 16'} - hasBin: true - peerDependencies: - '@emnapi/runtime': ^1.1.0 - emnapi: ^1.1.0 - peerDependenciesMeta: - '@emnapi/runtime': - optional: true - emnapi: - optional: true - - '@napi-rs/cross-toolchain@0.0.14': - resolution: {integrity: sha512-Xgoe1gCEo5s5VUxmSnK4tYFJXW2JAVM02jptSbqA2+gp8pt4Vuk9oK2LvswwO9iRfHapKacYYhegD8Dq/+PBOQ==} - peerDependencies: - '@napi-rs/cross-toolchain-arm64-target-aarch64': ^0.0.14 - '@napi-rs/cross-toolchain-arm64-target-armv7': ^0.0.14 - '@napi-rs/cross-toolchain-arm64-target-x86_64': ^0.0.14 - '@napi-rs/cross-toolchain-x64-target-aarch64': ^0.0.14 - '@napi-rs/cross-toolchain-x64-target-armv7': ^0.0.14 - '@napi-rs/cross-toolchain-x64-target-x86_64': ^0.0.14 - peerDependenciesMeta: - '@napi-rs/cross-toolchain-arm64-target-aarch64': - optional: true - '@napi-rs/cross-toolchain-arm64-target-armv7': - optional: true - '@napi-rs/cross-toolchain-arm64-target-x86_64': - optional: true - '@napi-rs/cross-toolchain-x64-target-aarch64': - optional: true - '@napi-rs/cross-toolchain-x64-target-armv7': - optional: true - '@napi-rs/cross-toolchain-x64-target-x86_64': - optional: true - - '@napi-rs/lzma-android-arm-eabi@1.2.1': - resolution: {integrity: sha512-GKXud2hTddxehff1mAGkbTfseBj+GcM+M/sZuxf9H9CJeOWpfI/HC9Oy3uv8mBqPTkOQdCcZ/xXPU34EOEwiRg==} - engines: {node: '>= 10'} - cpu: [arm] - os: [android] - - '@napi-rs/lzma-android-arm64@1.2.1': - resolution: {integrity: sha512-UKFvc56TdgljbdgLvSwM62pSItV/4SuXXCrJtruPDmbIDe8HKag8hsCKsb66hrc9aX7urJ+KGw1yz5hWiONLyw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [android] - - '@napi-rs/lzma-darwin-arm64@1.2.1': - resolution: {integrity: sha512-eLbHzK5xGVzEABb1ESFELQJzXKoQeP9QH9hMPd4Qq29xD6MkWD2VKlAy40AxrMeWc7fCUIImTTlGuGRvg6tI1g==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [darwin] - - '@napi-rs/lzma-darwin-x64@1.2.1': - resolution: {integrity: sha512-/a5sHZkkO81w/PCpxlwXjADz++jDiTJquMzCLAhupd23wTRmJoCBAwp4Tur+qV5esI7ahAA0lS5P0M4TZv+OUg==} - engines: {node: '>= 10'} - cpu: [x64] - os: [darwin] - - '@napi-rs/lzma-freebsd-x64@1.2.1': - resolution: {integrity: sha512-Ehc0ld148YcqQrDWwUbVta1l45R4PthCIU6ZDbOYzzeYXQnhgr1fWiex7wu4KMFppteHlYntypUIhmMUklqchA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [freebsd] - - '@napi-rs/lzma-linux-arm-gnueabihf@1.2.1': - resolution: {integrity: sha512-EkIsx3kC67viElNetZgaGAtAceA+4pVGj31HKKPn0RZYn3rCNdEEg2i1IRg07Y6m4bHwcaKutLoZ2LDcQ+yiBg==} - engines: {node: '>= 10'} - cpu: [arm] - os: [linux] - - '@napi-rs/lzma-linux-arm64-gnu@1.2.1': - resolution: {integrity: sha512-GxSbp1/X7Ppmf+aNiZ95vl1HgQzRS9C8zCv7unEhYRPAjRkAnlrsLluUBOTPIY2yquuUvfIog9XIml6Hpw2wrA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/lzma-linux-arm64-musl@1.2.1': - resolution: {integrity: sha512-2L3KHFGGdt0xgU0WcKwKmnjVCYs88t4+ixBgPfEydtYsOceg6B8eOzdM7xsziKxJyUJKWBetGLgARQOy35bfvA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/lzma-linux-x64-gnu@1.2.1': - resolution: {integrity: sha512-h29XttA2Og1+6vYHsVcp+i1PkeILKzYnoDun0ul/k/5hvfxJ2Jap+EM07sW4HSz/DiscLAeIZmLKbXEqJgF5bg==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/lzma-linux-x64-musl@1.2.1': - resolution: {integrity: sha512-8EIkpLid4pepkBsljQ7rgma8jdwAuwVyJ2tY6Wuj1I/AqAkVVfxTwIuYc4zgRR3nfcrmWgOfZE0VneVmQCE5hw==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/lzma-win32-arm64-msvc@1.2.1': - resolution: {integrity: sha512-RNPItarWUUbtwz6dyn8FGH9AXEaAsBcMBlTvcRjv8eoqRqyZ9R49Ruk/8WMS57MM1BKdiPDxHBtRi+nZn27Slw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [win32] - - '@napi-rs/lzma-win32-ia32-msvc@1.2.1': - resolution: {integrity: sha512-rNdsCZnzKVgeDd9NzXWk9WuADVUWUWdnws8qBRCfHRUQqJ56Ic1W7Y1XmP+bNa985MXlU6vbznHTHmU5zk2P+A==} - engines: {node: '>= 10'} - cpu: [ia32] - os: [win32] - - '@napi-rs/lzma-win32-x64-msvc@1.2.1': - resolution: {integrity: sha512-1AFrAh1n73Yw+IhDu5HnaiRD4vWEkafY0EarfziPfDsh/GeyNcjbE+Let+XFe8L3j0/CZfsRG3nXarOW1oadUQ==} - engines: {node: '>= 10'} - cpu: [x64] - os: [win32] - - '@napi-rs/lzma@1.2.1': - resolution: {integrity: sha512-vwl34tzF2mXWthnFVN2MP6nRzQ40C5+256EEUjxAwj9dbAhDqb7Yz376Up5SlB4YgNC0YvEqK4jsYP/NP0bgpg==} - engines: {node: '>= 10'} - - '@napi-rs/tar-android-arm-eabi@0.1.0': - resolution: {integrity: sha512-gY9f7HfyU8MQs/ERi2/Fc4dGRf61ZM2pme31t0FkrzTtmeIaf56LiTeTt4aP8xh/0HOVnXrB6I3taY9IsQVB8Q==} - engines: {node: '>= 10'} - cpu: [arm] - os: [android] - - '@napi-rs/tar-android-arm64@0.1.0': - resolution: {integrity: sha512-NxszsTRdAYf25kKuzUYz514/5MFI3w3aHToZBcFjaxUmsayrimFrHIiPLwNQVe55lHPRi13njqQUPjMetHMCZw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [android] - - '@napi-rs/tar-darwin-arm64@0.1.0': - resolution: {integrity: sha512-G+fSNcwhbekTMOElS66mf3ccg8M4NcEHIgo7s6Hxo8U2obUSqEJ0WjTDV8oJy7lqRW/MeeDJj8Vz0ceXC8ueeA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [darwin] - - '@napi-rs/tar-darwin-x64@0.1.0': - resolution: {integrity: sha512-p9aOLk6O2+Cu62fNOdj1Zx0P3J1VkxtihXOVDaK49o5jszhms0roNA7kZfklwjVdwo8R7OQC6mJcFWmiamMNug==} - engines: {node: '>= 10'} - cpu: [x64] - os: [darwin] - - '@napi-rs/tar-freebsd-x64@0.1.0': - resolution: {integrity: sha512-mZQPtyCc2r+P84WV76Ddbe1+CxBscxlDHtgMIxZPveMgq4esZFKp26M735vjxtk/j2ahT0pZoC6fjsJ//Uxzlg==} - engines: {node: '>= 10'} - cpu: [x64] - os: [freebsd] - - '@napi-rs/tar-linux-arm-gnueabihf@0.1.0': - resolution: {integrity: sha512-FHxnmrOS345T3n3XDmY9QEoVv1PXkkuevQbu+gzq5np4fzN/NX2Az5oJTxKOTGtlJSaxxz90raeaWRZrnV5hZQ==} - engines: {node: '>= 10'} - cpu: [arm] - os: [linux] - - '@napi-rs/tar-linux-arm64-gnu@0.1.0': - resolution: {integrity: sha512-+8WHnL/8PPpePYc+5oqNLoE5o98vWF7lJvY/seji7tdcS5TPJ3tgXaF4/y1rFAaSxKsZ9l+ClHsZZ0MpCqMOOQ==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/tar-linux-arm64-musl@0.1.0': - resolution: {integrity: sha512-SXqU4H30/TD9BZa6pH/U5l2V6E4EKOutjHp9Sqr98iH52Zb+1N84ur1Ti7/+PapKunCIJeZzU+792CQagKIzuQ==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/tar-linux-x64-gnu@0.1.0': - resolution: {integrity: sha512-2uZHxl2nH1HbeJuifB1qdK8vU9wKDrxQkFm+u4psUaa/uHLZDUCGS7GMxTnCbR9OehqZcfQabaKsHbxR/8ElDQ==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/tar-linux-x64-musl@0.1.0': - resolution: {integrity: sha512-S1vEqLK4UCHS4AjVZ3g6o7r0Yu6RbhmDj6JrqxBoEIjrMsuIPKQrODHhtlsykOPeu5IHQuyRT+DevorWAVYdoA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/tar-win32-arm64-msvc@0.1.0': - resolution: {integrity: sha512-x23Ganq0hcDbgnhzAFqOu5EWtKvngIsapJL7ZLGgQlqahRb15aQkagYvpju6CLZers6N6znmqxw9Pdov9VFzOQ==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [win32] - - '@napi-rs/tar-win32-ia32-msvc@0.1.0': - resolution: {integrity: sha512-QJgJQEKDbVOrzSJ3EaUuCk+g7t9tKv085eALmRtkiHDBmzd0iAoudcU2N9YgdacSQMe1V/GMuQLky6BFrZb4nw==} - engines: {node: '>= 10'} - cpu: [ia32] - os: [win32] - - '@napi-rs/tar-win32-x64-msvc@0.1.0': - resolution: {integrity: sha512-aEhLcPZXmbcz46utpgYrkhY/TIGVCs4T5c+xpBf6H8feIEz7rF44Bm6kECC42OWcqnws2LGRW9TZsv0bWoAn0A==} - engines: {node: '>= 10'} - cpu: [x64] - os: [win32] - - '@napi-rs/tar@0.1.0': - resolution: {integrity: sha512-HodV5VS/ryhNvSmSHPb6CT5lJKzkoKaiyO8JPkVw3XCXbp51+vZs7LJ66kgFqyr4AagaKqmXsgpGVCIwNdFw/w==} - engines: {node: '>= 10'} - - '@napi-rs/wasm-runtime@0.1.2': - resolution: {integrity: sha512-8JuczewTFIZ/XIjHQ+YlQUydHvlKx2hkcxtuGwh+t/t5zWyZct6YG4+xjHcq8xyc/e7FmFwf42Zj2YgICwmlvA==} - - '@napi-rs/wasm-runtime@0.2.0': - resolution: {integrity: sha512-ETCooPEZJN7cGp6GwE5mUTrStrhIeuEPo0lOhLe48Iz35z6CkbgDauR8nE/K4GaMEu2BwTOm2Epy7ru8w1ua7w==} - - '@napi-rs/wasm-tools-android-arm-eabi@0.0.1': - resolution: {integrity: sha512-Q/SyyO60dbpoLcN/hvGzNWDaCjuaMGFeg92GnsDBWm3OCwhvltr51+VDZbCIHQwfIvH4d63X29nEls7FHK75dA==} - engines: {node: '>= 10'} - cpu: [arm] - os: [android] - - '@napi-rs/wasm-tools-android-arm64@0.0.1': - resolution: {integrity: sha512-mn7QpSWJlQS7Z14DkWqW14HqEiI2R8FV3KT4SNdqm+O+K5uIUvAexxMn9Qu6gqLq1fHXj+7l2luAWmtN7RKLjA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [android] - - '@napi-rs/wasm-tools-darwin-arm64@0.0.1': - resolution: {integrity: sha512-WuxMRtd5rCgqfuk7dehcft5eyGDOuNSMaJybprbX4IXvnjlLQf1zsCfp6wBI2Ptp2D+qEgE2SAMWBfzF9XDDkw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [darwin] - - '@napi-rs/wasm-tools-darwin-x64@0.0.1': - resolution: {integrity: sha512-YGPjgIo1/Y774aAFb/UT+d8VQtTaIkdF0/ynlChe/UilBZX48vLaEM0HaoSqxA1WHvRm8Il8R3rBDDle0965rw==} - engines: {node: '>= 10'} - cpu: [x64] - os: [darwin] - - '@napi-rs/wasm-tools-freebsd-x64@0.0.1': - resolution: {integrity: sha512-e5y+Z89XwI7HpLyCNEvDKdtO5Sga2+o8bDcNQNHjhMunnnHKPtlTvtIhieVmdqnNGPbuNkIx8xbTjkoWCZ49Tw==} - engines: {node: '>= 10'} - cpu: [x64] - os: [freebsd] - - '@napi-rs/wasm-tools-linux-arm64-gnu@0.0.1': - resolution: {integrity: sha512-Hcy+XiCJd8XshxVOYvmyU5FgeY8d6txZf7ZefI38Y3eRm7rzGt/EvABGjvJfujnPaBeWi9fQVm3Zav5pwyxViw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/wasm-tools-linux-arm64-musl@0.0.1': - resolution: {integrity: sha512-1mSquGy4N7jlRu/0OY/rqZa/XdCFGKrsl8SH4jRB318DVweOHLqn15QG4iwIrRVjCJROpaU9HRU/sgOKVbdqrA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/wasm-tools-linux-x64-gnu@0.0.1': - resolution: {integrity: sha512-/+XuGQ9667EqrxRbpt2izLDNzWUWLTXl6KaRSh9TjcT7qL5+yllTqchc0JwIHJW5QnQlC1NW7HnSnwQZ+/v+8g==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/wasm-tools-linux-x64-musl@0.0.1': - resolution: {integrity: sha512-L+5QcEsUS+QNcMI1AF6aBRKLzhxQ5VHRHVslaQwOxHoxyhMB/2hRH4ON6Zea1PyQS/zzZugwBuDEOcFtc3UjPQ==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/wasm-tools-wasm32-wasi@0.0.1': - resolution: {integrity: sha512-I1vAhMQcBblPJPg6pr+xydZ1NjPwKU2ympmI54BZfCOAMHs0ZfVb4yEqYAVIcSWOx3CF/0T2YrcOmiULTU3iGw==} - engines: {node: '>=14.0.0'} - cpu: [wasm32] - - '@napi-rs/wasm-tools-win32-arm64-msvc@0.0.1': - resolution: {integrity: sha512-A9peDWijE9X6qt5SNzqlmSMlOZiqeB9zhUVP5dtJKtpqVO098YVnZFsz/4Hv7LkSoxQE7brAd9yln/wz5qb1yQ==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [win32] - - '@napi-rs/wasm-tools-win32-ia32-msvc@0.0.1': - resolution: {integrity: sha512-6Y7GqnBCIdl8YsSQ+5AjnZ4iWDJnJrqzRlMDegCmPPf3WmRZ0sgnRU9iAHWcId9AEIf7SAs3x7Bnv2992zCwJA==} - engines: {node: '>= 10'} - cpu: [ia32] - os: [win32] - - '@napi-rs/wasm-tools-win32-x64-msvc@0.0.1': - resolution: {integrity: sha512-Ab6ljJCQmXqJvE4/8DLvHEVTI7vVUrVfh6gCwnVwwrA/B2LgR98SanpT8/951ZaIH/lSuqkeVm+wqzgYM1FHRg==} - engines: {node: '>= 10'} - cpu: [x64] - os: [win32] - - '@napi-rs/wasm-tools@0.0.1': - resolution: {integrity: sha512-itoKmaVqRKIV37sKIEri1qjaYlWNtXyfymUaqXkLu5F16s+FwqwOmvxmdTHsvNKkMy4qCsSSetiLZO1IwvBMLQ==} - engines: {node: '>= 10'} - - '@nodelib/fs.scandir@2.1.5': - resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} - engines: {node: '>= 8'} - - '@nodelib/fs.stat@2.0.5': - resolution: {integrity: sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==} - engines: {node: '>= 8'} - - '@nodelib/fs.walk@1.2.8': - resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} - engines: {node: '>= 8'} - - '@octokit/auth-token@4.0.0': - resolution: {integrity: sha512-tY/msAuJo6ARbK6SPIxZrPBms3xPbfwBrulZe0Wtr/DIY9lje2HeV1uoebShn6mx7SjCHif6EjMvoREj+gZ+SA==} - engines: {node: '>= 18'} - - '@octokit/core@5.2.0': - resolution: {integrity: sha512-1LFfa/qnMQvEOAdzlQymH0ulepxbxnCYAKJZfMci/5XJyIHWgEYnDmgnKakbTh7CH2tFQ5O60oYDvns4i9RAIg==} - engines: {node: '>= 18'} - - '@octokit/endpoint@9.0.5': - resolution: {integrity: sha512-ekqR4/+PCLkEBF6qgj8WqJfvDq65RH85OAgrtnVp1mSxaXF03u2xW/hUdweGS5654IlC0wkNYC18Z50tSYTAFw==} - engines: {node: '>= 18'} - - '@octokit/graphql@7.1.0': - resolution: {integrity: sha512-r+oZUH7aMFui1ypZnAvZmn0KSqAUgE1/tUXIWaqUCa1758ts/Jio84GZuzsvUkme98kv0WFY8//n0J1Z+vsIsQ==} - engines: {node: '>= 18'} - - '@octokit/openapi-types@20.0.0': - resolution: {integrity: sha512-EtqRBEjp1dL/15V7WiX5LJMIxxkdiGJnabzYx5Apx4FkQIFgAfKumXeYAqqJCj1s+BMX4cPFIFC4OLCR6stlnA==} - - '@octokit/openapi-types@22.1.0': - resolution: {integrity: sha512-pGUdSP+eEPfZiQHNkZI0U01HLipxncisdJQB4G//OAmfeO8sqTQ9KRa0KF03TUPCziNsoXUrTg4B2Q1EX++T0Q==} - - '@octokit/plugin-paginate-rest@9.2.1': - resolution: {integrity: sha512-wfGhE/TAkXZRLjksFXuDZdmGnJQHvtU/joFQdweXUgzo1XwvBCD4o4+75NtFfjfLK5IwLf9vHTfSiU3sLRYpRw==} - engines: {node: '>= 18'} - peerDependencies: - '@octokit/core': '5' - - '@octokit/plugin-request-log@4.0.1': - resolution: {integrity: sha512-GihNqNpGHorUrO7Qa9JbAl0dbLnqJVrV8OXe2Zm5/Y4wFkZQDfTreBzVmiRfJVfE4mClXdihHnbpyyO9FSX4HA==} - engines: {node: '>= 18'} - peerDependencies: - '@octokit/core': '5' - - '@octokit/plugin-rest-endpoint-methods@10.4.1': - resolution: {integrity: sha512-xV1b+ceKV9KytQe3zCVqjg+8GTGfDYwaT1ATU5isiUyVtlVAO3HNdzpS4sr4GBx4hxQ46s7ITtZrAsxG22+rVg==} - engines: {node: '>= 18'} - peerDependencies: - '@octokit/core': '5' - - '@octokit/request-error@5.1.0': - resolution: {integrity: sha512-GETXfE05J0+7H2STzekpKObFe765O5dlAKUTLNGeH+x47z7JjXHfsHKo5z21D/o/IOZTUEI6nyWyR+bZVP/n5Q==} - engines: {node: '>= 18'} - - '@octokit/request@8.4.0': - resolution: {integrity: sha512-9Bb014e+m2TgBeEJGEbdplMVWwPmL1FPtggHQRkV+WVsMggPtEkLKPlcVYm/o8xKLkpJ7B+6N8WfQMtDLX2Dpw==} - engines: {node: '>= 18'} - - '@octokit/rest@20.1.0': - resolution: {integrity: sha512-STVO3itHQLrp80lvcYB2UIKoeil5Ctsgd2s1AM+du3HqZIR35ZH7WE9HLwUOLXH0myA0y3AGNPo8gZtcgIbw0g==} - engines: {node: '>= 18'} - - '@octokit/types@12.6.0': - resolution: {integrity: sha512-1rhSOfRa6H9w4YwK0yrf5faDaDTb+yLyBUKOCV4xtCDB5VmIPqd/v9yr9o6SAzOAlRxMiRiCic6JVM1/kunVkw==} - - '@octokit/types@13.4.1': - resolution: {integrity: sha512-Y73oOAzRBAUzR/iRAbGULzpNkX8vaxKCqEtg6K74Ff3w9f5apFnWtE/2nade7dMWWW3bS5Kkd6DJS4HF04xreg==} - - '@rollup/pluginutils@4.2.1': - resolution: {integrity: sha512-iKnFXr7NkdZAIHiIWE+BX5ULi/ucVFYWD6TbAV+rZctiRTY2PL6tsIKhoIOaoskiWAkgu+VsbXgUVDNLHf+InQ==} - engines: {node: '>= 8.0.0'} - - '@sindresorhus/merge-streams@2.3.0': - resolution: {integrity: sha512-LtoMMhxAlorcGhmFYI+LhPgbPZCkgP6ra1YL604EeF6U98pLlQ3iWIGMdWSC+vWmPBWBNgmDBAhnAobLROJmwg==} - engines: {node: '>=18'} - - '@tybys/wasm-util@0.8.3': - resolution: {integrity: sha512-Z96T/L6dUFFxgFJ+pQtkPpne9q7i6kIPYCFnQBHSgSPV9idTsKfIhCss0h5iM9irweZCatkrdeP8yi5uM1eX6Q==} - - '@types/node@20.12.7': - resolution: {integrity: sha512-wq0cICSkRLVaf3UGLMGItu/PtdY7oaXaI/RVU+xliKVOtRna3PRY57ZDfztpDL0n11vfymMUnXv8QwYCO7L1wg==} - - '@vercel/nft@0.26.4': - resolution: {integrity: sha512-j4jCOOXke2t8cHZCIxu1dzKLHLcFmYzC3yqAK6MfZznOL1QIJKd0xcFsXK3zcqzU7ScsE2zWkiMMNHGMHgp+FA==} - engines: {node: '>=16'} - hasBin: true - - abbrev@1.1.1: - resolution: {integrity: sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==} - - acorn-import-attributes@1.9.5: - resolution: {integrity: sha512-n02Vykv5uA3eHGM/Z2dQrcD56kL8TyDb2p1+0P83PClMnC/nc+anbQRhIOWnSq4Ke/KvDPrY3C9hDtC/A3eHnQ==} - peerDependencies: - acorn: ^8 - - acorn-walk@8.3.2: - resolution: {integrity: sha512-cjkyv4OtNCIeqhHrfS81QWXoCBPExR/J62oyEqepVw8WaQeSqpW2uhuLPh1m9eWhDuOo/jUXVTlifvesOWp/4A==} - engines: {node: '>=0.4.0'} - - acorn@8.11.3: - resolution: {integrity: sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==} - engines: {node: '>=0.4.0'} - hasBin: true - - agent-base@6.0.2: - resolution: {integrity: sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==} - engines: {node: '>= 6.0.0'} - - ansi-escapes@4.3.2: - resolution: {integrity: sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==} - engines: {node: '>=8'} - - ansi-regex@5.0.1: - resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} - engines: {node: '>=8'} - - ansi-regex@6.0.1: - resolution: {integrity: sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==} - engines: {node: '>=12'} - - ansi-styles@4.3.0: - resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} - engines: {node: '>=8'} - - ansi-styles@6.2.1: - resolution: {integrity: sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==} - engines: {node: '>=12'} - - aproba@2.0.0: - resolution: {integrity: sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==} - - are-we-there-yet@2.0.0: - resolution: {integrity: sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw==} - engines: {node: '>=10'} - - argparse@1.0.10: - resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==} - - argparse@2.0.1: - resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} - - array-find-index@1.0.2: - resolution: {integrity: sha512-M1HQyIXcBGtVywBt8WVdim+lrNaK7VHp99Qt5pSNziXznKHViIBbXWtfRTpEFpF/c4FdfxNAsCCwPp5phBYJtw==} - engines: {node: '>=0.10.0'} - - arrgv@1.0.2: - resolution: {integrity: sha512-a4eg4yhp7mmruZDQFqVMlxNRFGi/i1r87pt8SDHy0/I8PqSXoUTlWZRdAZo0VXgvEARcujbtTk8kiZRi1uDGRw==} - engines: {node: '>=8.0.0'} - - arrify@3.0.0: - resolution: {integrity: sha512-tLkvA81vQG/XqE2mjDkGQHoOINtMHtysSnemrmoGe6PydDPMRbVugqyk4A6V/WDWEfm3l+0d8anA9r8cv/5Jaw==} - engines: {node: '>=12'} - - async-sema@3.1.1: - resolution: {integrity: sha512-tLRNUXati5MFePdAk8dw7Qt7DpxPB60ofAgn8WRhW6a2rcimZnYBP9oxHiv0OHy+Wz7kPMG+t4LGdt31+4EmGg==} - - ava@6.1.2: - resolution: {integrity: sha512-WcpxJ8yZ7mk9ABTinD0IAjcemovSeVGjuuwZx0JS9johREWFeLTl8UP6wd7l6nmnrWqkKZdwaD71a/ocH4qPKw==} - engines: {node: ^18.18 || ^20.8 || ^21} - hasBin: true - peerDependencies: - '@ava/typescript': '*' - peerDependenciesMeta: - '@ava/typescript': - optional: true - - balanced-match@1.0.2: - resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} - - base64-js@1.5.1: - resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==} - - before-after-hook@2.2.3: - resolution: {integrity: sha512-NzUnlZexiaH/46WDhANlyR2bXRopNg4F/zuSA3OpZnllCUgRaOF2znDioDWrmbNVsuZk6l9pMquQB38cfBZwkQ==} - - bindings@1.5.0: - resolution: {integrity: sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==} - - bl@4.1.0: - resolution: {integrity: sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==} - - blueimp-md5@2.19.0: - resolution: {integrity: sha512-DRQrD6gJyy8FbiE4s+bDoXS9hiW3Vbx5uCdwvcCf3zLHL+Iv7LtGHLpr+GZV8rHG8tK766FGYBwRbu8pELTt+w==} - - brace-expansion@1.1.11: - resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} - - braces@3.0.2: - resolution: {integrity: sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==} - engines: {node: '>=8'} - - buffer@5.7.1: - resolution: {integrity: sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==} - - call-bind@1.0.7: - resolution: {integrity: sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==} - engines: {node: '>= 0.4'} - - callsites@4.1.0: - resolution: {integrity: sha512-aBMbD1Xxay75ViYezwT40aQONfr+pSXTHwNKvIXhXD6+LY3F1dLIcceoC5OZKBVHbXcysz1hL9D2w0JJIMXpUw==} - engines: {node: '>=12.20'} - - cbor@9.0.2: - resolution: {integrity: sha512-JPypkxsB10s9QOWwa6zwPzqE1Md3vqpPc+cai4sAecuCsRyAtAl/pMyhPlMbT/xtPnm2dznJZYRLui57qiRhaQ==} - engines: {node: '>=16'} - - chalk@4.1.2: - resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} - engines: {node: '>=10'} - - chalk@5.3.0: - resolution: {integrity: sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==} - engines: {node: ^12.17.0 || ^14.13 || >=16.0.0} - - chardet@0.7.0: - resolution: {integrity: sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==} - - chownr@2.0.0: - resolution: {integrity: sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==} - engines: {node: '>=10'} - - chunkd@2.0.1: - resolution: {integrity: sha512-7d58XsFmOq0j6el67Ug9mHf9ELUXsQXYJBkyxhH/k+6Ke0qXRnv0kbemx+Twc6fRJ07C49lcbdgm9FL1Ei/6SQ==} - - ci-info@4.0.0: - resolution: {integrity: sha512-TdHqgGf9odd8SXNuxtUBVx8Nv+qZOejE6qyqiy5NtbYYQOeFa6zmHkxlPzmaLxWWHsU6nJmB7AETdVPi+2NBUg==} - engines: {node: '>=8'} - - ci-parallel-vars@1.0.1: - resolution: {integrity: sha512-uvzpYrpmidaoxvIQHM+rKSrigjOe9feHYbw4uOI2gdfe1C3xIlxO+kVXq83WQWNniTf8bAxVpy+cQeFQsMERKg==} - - cli-cursor@3.1.0: - resolution: {integrity: sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==} - engines: {node: '>=8'} - - cli-spinners@2.9.2: - resolution: {integrity: sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==} - engines: {node: '>=6'} - - cli-truncate@4.0.0: - resolution: {integrity: sha512-nPdaFdQ0h/GEigbPClz11D0v/ZJEwxmeVZGeMo3Z5StPtUTkA9o1lD6QwoirYiSDzbcwn2XcjwmCp68W1IS4TA==} - engines: {node: '>=18'} - - cli-width@4.1.0: - resolution: {integrity: sha512-ouuZd4/dm2Sw5Gmqy6bGyNNNe1qt9RpmxveLSO7KcgsTnU7RXfsw+/bukWGo1abgBiMAic068rclZsO4IWmmxQ==} - engines: {node: '>= 12'} - - clipanion@3.2.1: - resolution: {integrity: sha512-dYFdjLb7y1ajfxQopN05mylEpK9ZX0sO1/RfMXdfmwjlIsPkbh4p7A682x++zFPLDCo1x3p82dtljHf5cW2LKA==} - peerDependencies: - typanion: '*' - - cliui@8.0.1: - resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==} - engines: {node: '>=12'} - - clone@1.0.4: - resolution: {integrity: sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==} - engines: {node: '>=0.8'} - - code-excerpt@4.0.0: - resolution: {integrity: sha512-xxodCmBen3iy2i0WtAK8FlFNrRzjUqjRsMfho58xT/wvZU1YTM3fCnRjcy1gJPMepaRlgm/0e6w8SpWHpn3/cA==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - color-convert@2.0.1: - resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} - engines: {node: '>=7.0.0'} - - color-name@1.1.4: - resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} - - color-support@1.1.3: - resolution: {integrity: sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==} - hasBin: true - - colorette@2.0.20: - resolution: {integrity: sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==} - - common-path-prefix@3.0.0: - resolution: {integrity: sha512-QE33hToZseCH3jS0qN96O/bSh3kaw/h+Tq7ngyY9eWDUnTlTNUyqfqvCXioLe5Na5jFsL78ra/wuBU4iuEgd4w==} - - concat-map@0.0.1: - resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} - - concordance@5.0.4: - resolution: {integrity: sha512-OAcsnTEYu1ARJqWVGwf4zh4JDfHZEaSNlNccFmt8YjB2l/n19/PF2viLINHc57vO4FKIAFl2FWASIGZZWZ2Kxw==} - engines: {node: '>=10.18.0 <11 || >=12.14.0 <13 || >=14'} - - console-control-strings@1.1.0: - resolution: {integrity: sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==} - - convert-to-spaces@2.0.1: - resolution: {integrity: sha512-rcQ1bsQO9799wq24uE5AM2tAILy4gXGIK/njFWcVQkGNZ96edlpY+A7bjwvzjYvLDyzmG1MmMLZhpcsb+klNMQ==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - currently-unhandled@0.4.1: - resolution: {integrity: sha512-/fITjgjGU50vjQ4FH6eUoYu+iUoUKIXws2hL15JJpIR+BbTxaXQsMuuyjtNh2WqsSBS5nsaZHFsFecyw5CCAng==} - engines: {node: '>=0.10.0'} - - date-time@3.1.0: - resolution: {integrity: sha512-uqCUKXE5q1PNBXjPqvwhwJf9SwMoAHBgWJ6DcrnS5o+W2JOiIILl0JEdVD8SGujrNS02GGxgwAg2PN2zONgtjg==} - engines: {node: '>=6'} - - debug@4.3.4: - resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==} - engines: {node: '>=6.0'} - peerDependencies: - supports-color: '*' - peerDependenciesMeta: - supports-color: - optional: true - - defaults@1.0.4: - resolution: {integrity: sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A==} - - define-data-property@1.1.4: - resolution: {integrity: sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==} - engines: {node: '>= 0.4'} - - delegates@1.0.0: - resolution: {integrity: sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==} - - deprecation@2.3.1: - resolution: {integrity: sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==} - - detect-libc@2.0.3: - resolution: {integrity: sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw==} - engines: {node: '>=8'} - - emittery@1.0.3: - resolution: {integrity: sha512-tJdCJitoy2lrC2ldJcqN4vkqJ00lT+tOWNT1hBJjO/3FDMJa5TTIiYGCKGkn/WfCyOzUMObeohbVTj00fhiLiA==} - engines: {node: '>=14.16'} - - emnapi@1.1.1: - resolution: {integrity: sha512-md0YDBLCX+378+zzibHvOLsj28YKFy8vl7BiSzVocCY7HujOkYt+N5LCOYqLeYi5C5/5NlnkNweVdUjrvKpGNg==} - peerDependencies: - node-addon-api: '>= 6.1.0' - peerDependenciesMeta: - node-addon-api: - optional: true - - emoji-regex@10.3.0: - resolution: {integrity: sha512-QpLs9D9v9kArv4lfDEgg1X/gN5XLnf/A6l9cs8SPZLRZR3ZkY9+kwIQTxm+fsSej5UMYGE8fdoaZVIBlqG0XTw==} - - emoji-regex@8.0.0: - resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} - - es-define-property@1.0.0: - resolution: {integrity: sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==} - engines: {node: '>= 0.4'} - - es-errors@1.3.0: - resolution: {integrity: sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==} - engines: {node: '>= 0.4'} - - escalade@3.1.2: - resolution: {integrity: sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==} - engines: {node: '>=6'} - - escape-string-regexp@2.0.0: - resolution: {integrity: sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==} - engines: {node: '>=8'} - - escape-string-regexp@5.0.0: - resolution: {integrity: sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==} - engines: {node: '>=12'} - - esprima@4.0.1: - resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==} - engines: {node: '>=4'} - hasBin: true - - estree-walker@2.0.2: - resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==} - - esutils@2.0.3: - resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} - engines: {node: '>=0.10.0'} - - external-editor@3.1.0: - resolution: {integrity: sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==} - engines: {node: '>=4'} - - fast-diff@1.3.0: - resolution: {integrity: sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==} - - fast-glob@3.3.2: - resolution: {integrity: sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==} - engines: {node: '>=8.6.0'} - - fastq@1.17.1: - resolution: {integrity: sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==} - - figures@6.1.0: - resolution: {integrity: sha512-d+l3qxjSesT4V7v2fh+QnmFnUWv9lSpjarhShNTgBOfA0ttejbQUAlHLitbjkoRiDulW0OPoQPYIGhIC8ohejg==} - engines: {node: '>=18'} - - file-uri-to-path@1.0.0: - resolution: {integrity: sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==} - - fill-range@7.0.1: - resolution: {integrity: sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==} - engines: {node: '>=8'} - - find-up-simple@1.0.0: - resolution: {integrity: sha512-q7Us7kcjj2VMePAa02hDAF6d+MzsdsAWEwYyOpwUtlerRBkOEPBCRZrAV4XfcSN8fHAgaD0hP7miwoay6DCprw==} - engines: {node: '>=18'} - - fs-minipass@2.1.0: - resolution: {integrity: sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==} - engines: {node: '>= 8'} - - fs.realpath@1.0.0: - resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} - - function-bind@1.1.2: - resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==} - - gauge@3.0.2: - resolution: {integrity: sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q==} - engines: {node: '>=10'} - - get-caller-file@2.0.5: - resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} - engines: {node: 6.* || 8.* || >= 10.*} - - get-east-asian-width@1.2.0: - resolution: {integrity: sha512-2nk+7SIVb14QrgXFHcm84tD4bKQz0RxPuMT8Ag5KPOq7J5fEmAg0UbXdTOSHqNuHSU28k55qnceesxXRZGzKWA==} - engines: {node: '>=18'} - - get-intrinsic@1.2.4: - resolution: {integrity: sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==} - engines: {node: '>= 0.4'} - - glob-parent@5.1.2: - resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} - engines: {node: '>= 6'} - - glob@7.2.3: - resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} - - globby@14.0.1: - resolution: {integrity: sha512-jOMLD2Z7MAhyG8aJpNOpmziMOP4rPLcc95oQPKXBazW82z+CEgPFBQvEpRUa1KeIMUJo4Wsm+q6uzO/Q/4BksQ==} - engines: {node: '>=18'} - - gopd@1.0.1: - resolution: {integrity: sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==} - - graceful-fs@4.2.11: - resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} - - has-flag@4.0.0: - resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} - engines: {node: '>=8'} - - has-property-descriptors@1.0.2: - resolution: {integrity: sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==} - - has-proto@1.0.3: - resolution: {integrity: sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==} - engines: {node: '>= 0.4'} - - has-symbols@1.0.3: - resolution: {integrity: sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==} - engines: {node: '>= 0.4'} - - has-unicode@2.0.1: - resolution: {integrity: sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==} - - hasown@2.0.2: - resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==} - engines: {node: '>= 0.4'} - - https-proxy-agent@5.0.1: - resolution: {integrity: sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==} - engines: {node: '>= 6'} - - iconv-lite@0.4.24: - resolution: {integrity: sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==} - engines: {node: '>=0.10.0'} - - ieee754@1.2.1: - resolution: {integrity: sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==} - - ignore-by-default@2.1.0: - resolution: {integrity: sha512-yiWd4GVmJp0Q6ghmM2B/V3oZGRmjrKLXvHR3TE1nfoXsmoggllfZUQe74EN0fJdPFZu2NIvNdrMMLm3OsV7Ohw==} - engines: {node: '>=10 <11 || >=12 <13 || >=14'} - - ignore@5.3.1: - resolution: {integrity: sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==} - engines: {node: '>= 4'} - - imurmurhash@0.1.4: - resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} - engines: {node: '>=0.8.19'} - - indent-string@5.0.0: - resolution: {integrity: sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==} - engines: {node: '>=12'} - - inflight@1.0.6: - resolution: {integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==} - - inherits@2.0.4: - resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} - - inquirer@9.2.19: - resolution: {integrity: sha512-WpxOT71HGsFya6/mj5PUue0sWwbpbiPfAR+332zLj/siB0QA1PZM8v3GepegFV1Op189UxHUCF6y8AySdtOMVA==} - engines: {node: '>=18'} - - irregular-plurals@3.5.0: - resolution: {integrity: sha512-1ANGLZ+Nkv1ptFb2pa8oG8Lem4krflKuX/gINiHJHjJUKaJHk/SXk5x6K3J+39/p0h1RQ2saROclJJ+QLvETCQ==} - engines: {node: '>=8'} - - is-extglob@2.1.1: - resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} - engines: {node: '>=0.10.0'} - - is-fullwidth-code-point@3.0.0: - resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} - engines: {node: '>=8'} - - is-fullwidth-code-point@4.0.0: - resolution: {integrity: sha512-O4L094N2/dZ7xqVdrXhh9r1KODPJpFms8B5sGdJLPy664AgvXsreZUyCQQNItZRDlYug4xStLjNp/sz3HvBowQ==} - engines: {node: '>=12'} - - is-glob@4.0.3: - resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} - engines: {node: '>=0.10.0'} - - is-interactive@1.0.0: - resolution: {integrity: sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w==} - engines: {node: '>=8'} - - is-number@7.0.0: - resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} - engines: {node: '>=0.12.0'} - - is-plain-object@5.0.0: - resolution: {integrity: sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==} - engines: {node: '>=0.10.0'} - - is-promise@4.0.0: - resolution: {integrity: sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==} - - is-unicode-supported@0.1.0: - resolution: {integrity: sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==} - engines: {node: '>=10'} - - is-unicode-supported@2.0.0: - resolution: {integrity: sha512-FRdAyx5lusK1iHG0TWpVtk9+1i+GjrzRffhDg4ovQ7mcidMQ6mj+MhKPmvh7Xwyv5gIS06ns49CA7Sqg7lC22Q==} - engines: {node: '>=18'} - - js-string-escape@1.0.1: - resolution: {integrity: sha512-Smw4xcfIQ5LVjAOuJCvN/zIodzA/BBSsluuoSykP+lUvScIi4U6RJLfwHet5cxFnCswUjISV8oAXaqaJDY3chg==} - engines: {node: '>= 0.8'} - - js-yaml@3.14.1: - resolution: {integrity: sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==} - hasBin: true - - js-yaml@4.1.0: - resolution: {integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==} - hasBin: true - - load-json-file@7.0.1: - resolution: {integrity: sha512-Gnxj3ev3mB5TkVBGad0JM6dmLiQL+o0t23JPBZ9sd+yvSLk05mFoqKBw5N8gbbkU4TNXyqCgIrl/VM17OgUIgQ==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - lodash-es@4.17.21: - resolution: {integrity: sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==} - - lodash@4.17.21: - resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} - - log-symbols@4.1.0: - resolution: {integrity: sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==} - engines: {node: '>=10'} - - lru-cache@6.0.0: - resolution: {integrity: sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==} - engines: {node: '>=10'} - - make-dir@3.1.0: - resolution: {integrity: sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==} - engines: {node: '>=8'} - - matcher@5.0.0: - resolution: {integrity: sha512-s2EMBOWtXFc8dgqvoAzKJXxNHibcdJMV0gwqKUaw9E2JBJuGUK7DrNKrA6g/i+v72TT16+6sVm5mS3thaMLQUw==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - md5-hex@3.0.1: - resolution: {integrity: sha512-BUiRtTtV39LIJwinWBjqVsU9xhdnz7/i889V859IBFpuqGAj6LuOvHv5XLbgZ2R7ptJoJaEcxkv88/h25T7Ciw==} - engines: {node: '>=8'} - - memoize@10.0.0: - resolution: {integrity: sha512-H6cBLgsi6vMWOcCpvVCdFFnl3kerEXbrYh9q+lY6VXvQSmM6CkmV08VOwT+WE2tzIEqRPFfAq3fm4v/UIW6mSA==} - engines: {node: '>=18'} - - merge2@1.4.1: - resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} - engines: {node: '>= 8'} - - micromatch@4.0.5: - resolution: {integrity: sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==} - engines: {node: '>=8.6'} - - mimic-fn@2.1.0: - resolution: {integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==} - engines: {node: '>=6'} - - mimic-function@5.0.1: - resolution: {integrity: sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==} - engines: {node: '>=18'} - - minimatch@3.1.2: - resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} - - minipass@3.3.6: - resolution: {integrity: sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==} - engines: {node: '>=8'} - - minipass@5.0.0: - resolution: {integrity: sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==} - engines: {node: '>=8'} - - minizlib@2.1.2: - resolution: {integrity: sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==} - engines: {node: '>= 8'} - - mkdirp@1.0.4: - resolution: {integrity: sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==} - engines: {node: '>=10'} - hasBin: true - - ms@2.1.2: - resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} - - ms@2.1.3: - resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} - - mute-stream@1.0.0: - resolution: {integrity: sha512-avsJQhyd+680gKXyG/sQc0nXaC6rBkPOfyHYcFb9+hdkqQkR9bdnkJ0AMZhke0oesPqIO+mFFJ+IdBc7mst4IA==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - - node-fetch@2.7.0: - resolution: {integrity: sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==} - engines: {node: 4.x || >=6.0.0} - peerDependencies: - encoding: ^0.1.0 - peerDependenciesMeta: - encoding: - optional: true - - node-gyp-build@4.8.0: - resolution: {integrity: sha512-u6fs2AEUljNho3EYTJNBfImO5QTo/J/1Etd+NVdCj7qWKUSN/bSLkZwhDv7I+w/MSC6qJ4cknepkAYykDdK8og==} - hasBin: true - - nofilter@3.1.0: - resolution: {integrity: sha512-l2NNj07e9afPnhAhvgVrCD/oy2Ai1yfLpuo3EpiO1jFTsB4sFz6oIfAfSZyQzVpkZQ9xS8ZS5g1jCBgq4Hwo0g==} - engines: {node: '>=12.19'} - - nopt@5.0.0: - resolution: {integrity: sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==} - engines: {node: '>=6'} - hasBin: true - - npmlog@5.0.1: - resolution: {integrity: sha512-AqZtDUWOMKs1G/8lwylVjrdYgqA4d9nu8hc+0gzRxlDb1I10+FHBGMXs6aiQHFdCUUlqH99MUMuLfzWDNDtfxw==} - - object-assign@4.1.1: - resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} - engines: {node: '>=0.10.0'} - - once@1.4.0: - resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} - - onetime@5.1.2: - resolution: {integrity: sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==} - engines: {node: '>=6'} - - ora@5.4.1: - resolution: {integrity: sha512-5b6Y85tPxZZ7QytO+BQzysW31HJku27cRIlkbAXaNx+BdcVi+LlRFmVXzeF6a7JCwJpyw5c4b+YSVImQIrBpuQ==} - engines: {node: '>=10'} - - os-tmpdir@1.0.2: - resolution: {integrity: sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==} - engines: {node: '>=0.10.0'} - - p-map@7.0.2: - resolution: {integrity: sha512-z4cYYMMdKHzw4O5UkWJImbZynVIo0lSGTXc7bzB1e/rrDqkgGUNysK/o4bTr+0+xKvvLoTyGqYC4Fgljy9qe1Q==} - engines: {node: '>=18'} - - package-config@5.0.0: - resolution: {integrity: sha512-GYTTew2slBcYdvRHqjhwaaydVMvn/qrGC323+nKclYioNSLTDUM/lGgtGTgyHVtYcozb+XkE8CNhwcraOmZ9Mg==} - engines: {node: '>=18'} - - parse-ms@4.0.0: - resolution: {integrity: sha512-TXfryirbmq34y8QBwgqCVLi+8oA3oWx2eAnSn62ITyEhEYaWRlVZ2DvMM9eZbMs/RfxPu/PK/aBLyGj4IrqMHw==} - engines: {node: '>=18'} - - path-is-absolute@1.0.1: - resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==} - engines: {node: '>=0.10.0'} - - path-type@5.0.0: - resolution: {integrity: sha512-5HviZNaZcfqP95rwpv+1HDgUamezbqdSYTyzjTvwtJSnIH+3vnbmWsItli8OFEndS984VT55M3jduxZbX351gg==} - engines: {node: '>=12'} - - picomatch@2.3.1: - resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} - engines: {node: '>=8.6'} - - picomatch@3.0.1: - resolution: {integrity: sha512-I3EurrIQMlRc9IaAZnqRR044Phh2DXY+55o7uJ0V+hYZAcQYSuFWsc9q5PvyDHUSCe1Qxn/iBz+78s86zWnGag==} - engines: {node: '>=10'} - - plur@5.1.0: - resolution: {integrity: sha512-VP/72JeXqak2KiOzjgKtQen5y3IZHn+9GOuLDafPv0eXa47xq0At93XahYBs26MsifCQ4enGKwbjBTKgb9QJXg==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - pretty-ms@9.0.0: - resolution: {integrity: sha512-E9e9HJ9R9NasGOgPaPE8VMeiPKAyWR5jcFpNnwIejslIhWqdqOrb2wShBsncMPUb+BcCd2OPYfh7p2W6oemTng==} - engines: {node: '>=18'} - - queue-microtask@1.2.3: - resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} - - readable-stream@3.6.2: - resolution: {integrity: sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==} - engines: {node: '>= 6'} - - require-directory@2.1.1: - resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} - engines: {node: '>=0.10.0'} - - resolve-cwd@3.0.0: - resolution: {integrity: sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==} - engines: {node: '>=8'} - - resolve-from@5.0.0: - resolution: {integrity: sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==} - engines: {node: '>=8'} - - restore-cursor@3.1.0: - resolution: {integrity: sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==} - engines: {node: '>=8'} - - reusify@1.0.4: - resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==} - engines: {iojs: '>=1.0.0', node: '>=0.10.0'} - - rimraf@3.0.2: - resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==} - hasBin: true - - run-async@3.0.0: - resolution: {integrity: sha512-540WwVDOMxA6dN6We19EcT9sc3hkXPw5mzRNGM3FkdN/vtE9NFvj5lFAPNwUDmJjXidm3v7TC1cTE7t17Ulm1Q==} - engines: {node: '>=0.12.0'} - - run-parallel@1.2.0: - resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} - - rxjs@7.8.1: - resolution: {integrity: sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==} - - safe-buffer@5.2.1: - resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} - - safer-buffer@2.1.2: - resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} - - semver@6.3.1: - resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} - hasBin: true - - semver@7.6.0: - resolution: {integrity: sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==} - engines: {node: '>=10'} - hasBin: true - - serialize-error@7.0.1: - resolution: {integrity: sha512-8I8TjW5KMOKsZQTvoxjuSIa7foAwPWGOts+6o7sgjz41/qMD9VQHEDxi6PBvK2l0MXUmqZyNpUK+T2tQaaElvw==} - engines: {node: '>=10'} - - set-blocking@2.0.0: - resolution: {integrity: sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==} - - set-function-length@1.2.2: - resolution: {integrity: sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==} - engines: {node: '>= 0.4'} - - signal-exit@3.0.7: - resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} - - signal-exit@4.1.0: - resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} - engines: {node: '>=14'} - - slash@5.1.0: - resolution: {integrity: sha512-ZA6oR3T/pEyuqwMgAKT0/hAv8oAXckzbkmR0UkUosQ+Mc4RxGoJkRmwHgHufaenlyAgE1Mxgpdcrf75y6XcnDg==} - engines: {node: '>=14.16'} - - slice-ansi@5.0.0: - resolution: {integrity: sha512-FC+lgizVPfie0kkhqUScwRu1O/lF6NOgJmlCgK+/LYxDCTk8sGelYaHDhFcDN+Sn3Cv+3VSa4Byeo+IMCzpMgQ==} - engines: {node: '>=12'} - - sprintf-js@1.0.3: - resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==} - - stack-utils@2.0.6: - resolution: {integrity: sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==} - engines: {node: '>=10'} - - string-width@4.2.3: - resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} - engines: {node: '>=8'} - - string-width@7.1.0: - resolution: {integrity: sha512-SEIJCWiX7Kg4c129n48aDRwLbFb2LJmXXFrWBG4NGaRtMQ3myKPKbwrD1BKqQn74oCoNMBVrfDEr5M9YxCsrkw==} - engines: {node: '>=18'} - - string_decoder@1.3.0: - resolution: {integrity: sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==} - - strip-ansi@6.0.1: - resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} - engines: {node: '>=8'} - - strip-ansi@7.1.0: - resolution: {integrity: sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==} - engines: {node: '>=12'} - - supertap@3.0.1: - resolution: {integrity: sha512-u1ZpIBCawJnO+0QePsEiOknOfCRq0yERxiAchT0i4li0WHNUJbf0evXXSXOcCAR4M8iMDoajXYmstm/qO81Isw==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - supports-color@7.2.0: - resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} - engines: {node: '>=8'} - - tar@6.2.1: - resolution: {integrity: sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==} - engines: {node: '>=10'} - - temp-dir@3.0.0: - resolution: {integrity: sha512-nHc6S/bwIilKHNRgK/3jlhDoIHcp45YgyiwcAk46Tr0LfEqGBVpmiAyuiuxeVE44m3mXnEeVhaipLOEWmH+Njw==} - engines: {node: '>=14.16'} - - time-zone@1.0.0: - resolution: {integrity: sha512-TIsDdtKo6+XrPtiTm1ssmMngN1sAhyKnTO2kunQWqNPWIVvCm15Wmw4SWInwTVgJ5u/Tr04+8Ei9TNcw4x4ONA==} - engines: {node: '>=4'} - - tmp@0.0.33: - resolution: {integrity: sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==} - engines: {node: '>=0.6.0'} - - to-regex-range@5.0.1: - resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} - engines: {node: '>=8.0'} - - toml@3.0.0: - resolution: {integrity: sha512-y/mWCZinnvxjTKYhJ+pYxwD0mRLVvOtdS2Awbgxln6iEnt4rk0yBxeSBHkGJcPucRiG0e55mwWp+g/05rsrd6w==} - - tr46@0.0.3: - resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==} - - tslib@2.6.2: - resolution: {integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==} - - typanion@3.14.0: - resolution: {integrity: sha512-ZW/lVMRabETuYCd9O9ZvMhAh8GslSqaUjxmK/JLPCh6l73CvLBiuXswj/+7LdnWOgYsQ130FqLzFz5aGT4I3Ug==} - - type-fest@0.13.1: - resolution: {integrity: sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==} - engines: {node: '>=10'} - - type-fest@0.21.3: - resolution: {integrity: sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==} - engines: {node: '>=10'} - - typescript@5.4.5: - resolution: {integrity: sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==} - engines: {node: '>=14.17'} - hasBin: true - - undici-types@5.26.5: - resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==} - - unicorn-magic@0.1.0: - resolution: {integrity: sha512-lRfVq8fE8gz6QMBuDM6a+LO3IAzTi05H6gCVaUpir2E1Rwpo4ZUog45KpNXKC/Mn3Yb9UDuHumeFTo9iV/D9FQ==} - engines: {node: '>=18'} - - universal-user-agent@6.0.1: - resolution: {integrity: sha512-yCzhz6FN2wU1NiiQRogkTQszlQSlpWaw8SvVegAc+bDxbzHgh1vX8uIe8OYyMH6DwH+sdTJsgMl36+mSMdRJIQ==} - - util-deprecate@1.0.2: - resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} - - wasm-sjlj@1.0.5: - resolution: {integrity: sha512-Z/MHJeOkAvJJVWnGX3/YZGYldGaawZbYHX4ldYG9kLhcdB8H31F5x66M7Zc4BP/7pg0aLsusQj1629m2B3Rilg==} - - wcwidth@1.0.1: - resolution: {integrity: sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==} - - webidl-conversions@3.0.1: - resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==} - - well-known-symbols@2.0.0: - resolution: {integrity: sha512-ZMjC3ho+KXo0BfJb7JgtQ5IBuvnShdlACNkKkdsqBmYw3bPAaJfPeYUo6tLUaT5tG/Gkh7xkpBhKRQ9e7pyg9Q==} - engines: {node: '>=6'} - - whatwg-url@5.0.0: - resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==} - - wide-align@1.1.5: - resolution: {integrity: sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==} - - wrap-ansi@6.2.0: - resolution: {integrity: sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==} - engines: {node: '>=8'} - - wrap-ansi@7.0.0: - resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==} - engines: {node: '>=10'} - - wrappy@1.0.2: - resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} - - write-file-atomic@5.0.1: - resolution: {integrity: sha512-+QU2zd6OTD8XWIJCbffaiQeH9U73qIqafo1x6V1snCWYGJf6cVE0cDR4D8xRzcEnfI21IFrUPzPGtcPf8AC+Rw==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - - y18n@5.0.8: - resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==} - engines: {node: '>=10'} - - yallist@4.0.0: - resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==} - - yargs-parser@21.1.1: - resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} - engines: {node: '>=12'} - - yargs@17.7.2: - resolution: {integrity: sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==} - engines: {node: '>=12'} - -snapshots: - - '@emnapi/core@1.1.1': - dependencies: - tslib: 2.6.2 - - '@emnapi/runtime@1.1.1': - dependencies: - tslib: 2.6.2 - - '@inquirer/figures@1.0.1': {} - - '@ljharb/through@2.3.13': - dependencies: - call-bind: 1.0.7 - - '@mapbox/node-pre-gyp@1.0.11': - dependencies: - detect-libc: 2.0.3 - https-proxy-agent: 5.0.1 - make-dir: 3.1.0 - node-fetch: 2.7.0 - nopt: 5.0.0 - npmlog: 5.0.1 - rimraf: 3.0.2 - semver: 7.6.0 - tar: 6.2.1 - transitivePeerDependencies: - - encoding - - supports-color - - '@napi-rs/cli@3.0.0-alpha.51(@emnapi/runtime@1.1.1)(emnapi@1.1.1)': - dependencies: - '@napi-rs/cross-toolchain': 0.0.14 - '@napi-rs/wasm-tools': 0.0.1 - '@octokit/rest': 20.1.0 - clipanion: 3.2.1(typanion@3.14.0) - colorette: 2.0.20 - debug: 4.3.4 - inquirer: 9.2.19 - js-yaml: 4.1.0 - lodash-es: 4.17.21 - semver: 7.6.0 - toml: 3.0.0 - typanion: 3.14.0 - wasm-sjlj: 1.0.5 - optionalDependencies: - '@emnapi/runtime': 1.1.1 - emnapi: 1.1.1 - transitivePeerDependencies: - - '@napi-rs/cross-toolchain-arm64-target-aarch64' - - '@napi-rs/cross-toolchain-arm64-target-armv7' - - '@napi-rs/cross-toolchain-arm64-target-x86_64' - - '@napi-rs/cross-toolchain-x64-target-aarch64' - - '@napi-rs/cross-toolchain-x64-target-armv7' - - '@napi-rs/cross-toolchain-x64-target-x86_64' - - supports-color - - '@napi-rs/cross-toolchain@0.0.14': - dependencies: - '@napi-rs/lzma': 1.2.1 - '@napi-rs/tar': 0.1.0 - debug: 4.3.4 - transitivePeerDependencies: - - supports-color - - '@napi-rs/lzma-android-arm-eabi@1.2.1': - optional: true - - '@napi-rs/lzma-android-arm64@1.2.1': - optional: true - - '@napi-rs/lzma-darwin-arm64@1.2.1': - optional: true - - '@napi-rs/lzma-darwin-x64@1.2.1': - optional: true - - '@napi-rs/lzma-freebsd-x64@1.2.1': - optional: true - - '@napi-rs/lzma-linux-arm-gnueabihf@1.2.1': - optional: true - - '@napi-rs/lzma-linux-arm64-gnu@1.2.1': - optional: true - - '@napi-rs/lzma-linux-arm64-musl@1.2.1': - optional: true - - '@napi-rs/lzma-linux-x64-gnu@1.2.1': - optional: true - - '@napi-rs/lzma-linux-x64-musl@1.2.1': - optional: true - - '@napi-rs/lzma-win32-arm64-msvc@1.2.1': - optional: true - - '@napi-rs/lzma-win32-ia32-msvc@1.2.1': - optional: true - - '@napi-rs/lzma-win32-x64-msvc@1.2.1': - optional: true - - '@napi-rs/lzma@1.2.1': - optionalDependencies: - '@napi-rs/lzma-android-arm-eabi': 1.2.1 - '@napi-rs/lzma-android-arm64': 1.2.1 - '@napi-rs/lzma-darwin-arm64': 1.2.1 - '@napi-rs/lzma-darwin-x64': 1.2.1 - '@napi-rs/lzma-freebsd-x64': 1.2.1 - '@napi-rs/lzma-linux-arm-gnueabihf': 1.2.1 - '@napi-rs/lzma-linux-arm64-gnu': 1.2.1 - '@napi-rs/lzma-linux-arm64-musl': 1.2.1 - '@napi-rs/lzma-linux-x64-gnu': 1.2.1 - '@napi-rs/lzma-linux-x64-musl': 1.2.1 - '@napi-rs/lzma-win32-arm64-msvc': 1.2.1 - '@napi-rs/lzma-win32-ia32-msvc': 1.2.1 - '@napi-rs/lzma-win32-x64-msvc': 1.2.1 - - '@napi-rs/tar-android-arm-eabi@0.1.0': - optional: true - - '@napi-rs/tar-android-arm64@0.1.0': - optional: true - - '@napi-rs/tar-darwin-arm64@0.1.0': - optional: true - - '@napi-rs/tar-darwin-x64@0.1.0': - optional: true - - '@napi-rs/tar-freebsd-x64@0.1.0': - optional: true - - '@napi-rs/tar-linux-arm-gnueabihf@0.1.0': - optional: true - - '@napi-rs/tar-linux-arm64-gnu@0.1.0': - optional: true - - '@napi-rs/tar-linux-arm64-musl@0.1.0': - optional: true - - '@napi-rs/tar-linux-x64-gnu@0.1.0': - optional: true - - '@napi-rs/tar-linux-x64-musl@0.1.0': - optional: true - - '@napi-rs/tar-win32-arm64-msvc@0.1.0': - optional: true - - '@napi-rs/tar-win32-ia32-msvc@0.1.0': - optional: true - - '@napi-rs/tar-win32-x64-msvc@0.1.0': - optional: true - - '@napi-rs/tar@0.1.0': - optionalDependencies: - '@napi-rs/tar-android-arm-eabi': 0.1.0 - '@napi-rs/tar-android-arm64': 0.1.0 - '@napi-rs/tar-darwin-arm64': 0.1.0 - '@napi-rs/tar-darwin-x64': 0.1.0 - '@napi-rs/tar-freebsd-x64': 0.1.0 - '@napi-rs/tar-linux-arm-gnueabihf': 0.1.0 - '@napi-rs/tar-linux-arm64-gnu': 0.1.0 - '@napi-rs/tar-linux-arm64-musl': 0.1.0 - '@napi-rs/tar-linux-x64-gnu': 0.1.0 - '@napi-rs/tar-linux-x64-musl': 0.1.0 - '@napi-rs/tar-win32-arm64-msvc': 0.1.0 - '@napi-rs/tar-win32-ia32-msvc': 0.1.0 - '@napi-rs/tar-win32-x64-msvc': 0.1.0 - - '@napi-rs/wasm-runtime@0.1.2': - dependencies: - '@emnapi/core': 1.1.1 - '@emnapi/runtime': 1.1.1 - '@tybys/wasm-util': 0.8.3 - optional: true - - '@napi-rs/wasm-runtime@0.2.0': - dependencies: - '@emnapi/core': 1.1.1 - '@emnapi/runtime': 1.1.1 - '@tybys/wasm-util': 0.8.3 - - '@napi-rs/wasm-tools-android-arm-eabi@0.0.1': - optional: true - - '@napi-rs/wasm-tools-android-arm64@0.0.1': - optional: true - - '@napi-rs/wasm-tools-darwin-arm64@0.0.1': - optional: true - - '@napi-rs/wasm-tools-darwin-x64@0.0.1': - optional: true - - '@napi-rs/wasm-tools-freebsd-x64@0.0.1': - optional: true - - '@napi-rs/wasm-tools-linux-arm64-gnu@0.0.1': - optional: true - - '@napi-rs/wasm-tools-linux-arm64-musl@0.0.1': - optional: true - - '@napi-rs/wasm-tools-linux-x64-gnu@0.0.1': - optional: true - - '@napi-rs/wasm-tools-linux-x64-musl@0.0.1': - optional: true - - '@napi-rs/wasm-tools-wasm32-wasi@0.0.1': - dependencies: - '@napi-rs/wasm-runtime': 0.1.2 - optional: true - - '@napi-rs/wasm-tools-win32-arm64-msvc@0.0.1': - optional: true - - '@napi-rs/wasm-tools-win32-ia32-msvc@0.0.1': - optional: true - - '@napi-rs/wasm-tools-win32-x64-msvc@0.0.1': - optional: true - - '@napi-rs/wasm-tools@0.0.1': - optionalDependencies: - '@napi-rs/wasm-tools-android-arm-eabi': 0.0.1 - '@napi-rs/wasm-tools-android-arm64': 0.0.1 - '@napi-rs/wasm-tools-darwin-arm64': 0.0.1 - '@napi-rs/wasm-tools-darwin-x64': 0.0.1 - '@napi-rs/wasm-tools-freebsd-x64': 0.0.1 - '@napi-rs/wasm-tools-linux-arm64-gnu': 0.0.1 - '@napi-rs/wasm-tools-linux-arm64-musl': 0.0.1 - '@napi-rs/wasm-tools-linux-x64-gnu': 0.0.1 - '@napi-rs/wasm-tools-linux-x64-musl': 0.0.1 - '@napi-rs/wasm-tools-wasm32-wasi': 0.0.1 - '@napi-rs/wasm-tools-win32-arm64-msvc': 0.0.1 - '@napi-rs/wasm-tools-win32-ia32-msvc': 0.0.1 - '@napi-rs/wasm-tools-win32-x64-msvc': 0.0.1 - - '@nodelib/fs.scandir@2.1.5': - dependencies: - '@nodelib/fs.stat': 2.0.5 - run-parallel: 1.2.0 - - '@nodelib/fs.stat@2.0.5': {} - - '@nodelib/fs.walk@1.2.8': - dependencies: - '@nodelib/fs.scandir': 2.1.5 - fastq: 1.17.1 - - '@octokit/auth-token@4.0.0': {} - - '@octokit/core@5.2.0': - dependencies: - '@octokit/auth-token': 4.0.0 - '@octokit/graphql': 7.1.0 - '@octokit/request': 8.4.0 - '@octokit/request-error': 5.1.0 - '@octokit/types': 13.4.1 - before-after-hook: 2.2.3 - universal-user-agent: 6.0.1 - - '@octokit/endpoint@9.0.5': - dependencies: - '@octokit/types': 13.4.1 - universal-user-agent: 6.0.1 - - '@octokit/graphql@7.1.0': - dependencies: - '@octokit/request': 8.4.0 - '@octokit/types': 13.4.1 - universal-user-agent: 6.0.1 - - '@octokit/openapi-types@20.0.0': {} - - '@octokit/openapi-types@22.1.0': {} - - '@octokit/plugin-paginate-rest@9.2.1(@octokit/core@5.2.0)': - dependencies: - '@octokit/core': 5.2.0 - '@octokit/types': 12.6.0 - - '@octokit/plugin-request-log@4.0.1(@octokit/core@5.2.0)': - dependencies: - '@octokit/core': 5.2.0 - - '@octokit/plugin-rest-endpoint-methods@10.4.1(@octokit/core@5.2.0)': - dependencies: - '@octokit/core': 5.2.0 - '@octokit/types': 12.6.0 - - '@octokit/request-error@5.1.0': - dependencies: - '@octokit/types': 13.4.1 - deprecation: 2.3.1 - once: 1.4.0 - - '@octokit/request@8.4.0': - dependencies: - '@octokit/endpoint': 9.0.5 - '@octokit/request-error': 5.1.0 - '@octokit/types': 13.4.1 - universal-user-agent: 6.0.1 - - '@octokit/rest@20.1.0': - dependencies: - '@octokit/core': 5.2.0 - '@octokit/plugin-paginate-rest': 9.2.1(@octokit/core@5.2.0) - '@octokit/plugin-request-log': 4.0.1(@octokit/core@5.2.0) - '@octokit/plugin-rest-endpoint-methods': 10.4.1(@octokit/core@5.2.0) - - '@octokit/types@12.6.0': - dependencies: - '@octokit/openapi-types': 20.0.0 - - '@octokit/types@13.4.1': - dependencies: - '@octokit/openapi-types': 22.1.0 - - '@rollup/pluginutils@4.2.1': - dependencies: - estree-walker: 2.0.2 - picomatch: 2.3.1 - - '@sindresorhus/merge-streams@2.3.0': {} - - '@tybys/wasm-util@0.8.3': - dependencies: - tslib: 2.6.2 - - '@types/node@20.12.7': - dependencies: - undici-types: 5.26.5 - - '@vercel/nft@0.26.4': - dependencies: - '@mapbox/node-pre-gyp': 1.0.11 - '@rollup/pluginutils': 4.2.1 - acorn: 8.11.3 - acorn-import-attributes: 1.9.5(acorn@8.11.3) - async-sema: 3.1.1 - bindings: 1.5.0 - estree-walker: 2.0.2 - glob: 7.2.3 - graceful-fs: 4.2.11 - micromatch: 4.0.5 - node-gyp-build: 4.8.0 - resolve-from: 5.0.0 - transitivePeerDependencies: - - encoding - - supports-color - - abbrev@1.1.1: {} - - acorn-import-attributes@1.9.5(acorn@8.11.3): - dependencies: - acorn: 8.11.3 - - acorn-walk@8.3.2: {} - - acorn@8.11.3: {} - - agent-base@6.0.2: - dependencies: - debug: 4.3.4 - transitivePeerDependencies: - - supports-color - - ansi-escapes@4.3.2: - dependencies: - type-fest: 0.21.3 - - ansi-regex@5.0.1: {} - - ansi-regex@6.0.1: {} - - ansi-styles@4.3.0: - dependencies: - color-convert: 2.0.1 - - ansi-styles@6.2.1: {} - - aproba@2.0.0: {} - - are-we-there-yet@2.0.0: - dependencies: - delegates: 1.0.0 - readable-stream: 3.6.2 - - argparse@1.0.10: - dependencies: - sprintf-js: 1.0.3 - - argparse@2.0.1: {} - - array-find-index@1.0.2: {} - - arrgv@1.0.2: {} - - arrify@3.0.0: {} - - async-sema@3.1.1: {} - - ava@6.1.2: - dependencies: - '@vercel/nft': 0.26.4 - acorn: 8.11.3 - acorn-walk: 8.3.2 - ansi-styles: 6.2.1 - arrgv: 1.0.2 - arrify: 3.0.0 - callsites: 4.1.0 - cbor: 9.0.2 - chalk: 5.3.0 - chunkd: 2.0.1 - ci-info: 4.0.0 - ci-parallel-vars: 1.0.1 - cli-truncate: 4.0.0 - code-excerpt: 4.0.0 - common-path-prefix: 3.0.0 - concordance: 5.0.4 - currently-unhandled: 0.4.1 - debug: 4.3.4 - emittery: 1.0.3 - figures: 6.1.0 - globby: 14.0.1 - ignore-by-default: 2.1.0 - indent-string: 5.0.0 - is-plain-object: 5.0.0 - is-promise: 4.0.0 - matcher: 5.0.0 - memoize: 10.0.0 - ms: 2.1.3 - p-map: 7.0.2 - package-config: 5.0.0 - picomatch: 3.0.1 - plur: 5.1.0 - pretty-ms: 9.0.0 - resolve-cwd: 3.0.0 - stack-utils: 2.0.6 - strip-ansi: 7.1.0 - supertap: 3.0.1 - temp-dir: 3.0.0 - write-file-atomic: 5.0.1 - yargs: 17.7.2 - transitivePeerDependencies: - - encoding - - supports-color - - balanced-match@1.0.2: {} - - base64-js@1.5.1: {} - - before-after-hook@2.2.3: {} - - bindings@1.5.0: - dependencies: - file-uri-to-path: 1.0.0 - - bl@4.1.0: - dependencies: - buffer: 5.7.1 - inherits: 2.0.4 - readable-stream: 3.6.2 - - blueimp-md5@2.19.0: {} - - brace-expansion@1.1.11: - dependencies: - balanced-match: 1.0.2 - concat-map: 0.0.1 - - braces@3.0.2: - dependencies: - fill-range: 7.0.1 - - buffer@5.7.1: - dependencies: - base64-js: 1.5.1 - ieee754: 1.2.1 - - call-bind@1.0.7: - dependencies: - es-define-property: 1.0.0 - es-errors: 1.3.0 - function-bind: 1.1.2 - get-intrinsic: 1.2.4 - set-function-length: 1.2.2 - - callsites@4.1.0: {} - - cbor@9.0.2: - dependencies: - nofilter: 3.1.0 - - chalk@4.1.2: - dependencies: - ansi-styles: 4.3.0 - supports-color: 7.2.0 - - chalk@5.3.0: {} - - chardet@0.7.0: {} - - chownr@2.0.0: {} - - chunkd@2.0.1: {} - - ci-info@4.0.0: {} - - ci-parallel-vars@1.0.1: {} - - cli-cursor@3.1.0: - dependencies: - restore-cursor: 3.1.0 - - cli-spinners@2.9.2: {} - - cli-truncate@4.0.0: - dependencies: - slice-ansi: 5.0.0 - string-width: 7.1.0 - - cli-width@4.1.0: {} - - clipanion@3.2.1(typanion@3.14.0): - dependencies: - typanion: 3.14.0 - - cliui@8.0.1: - dependencies: - string-width: 4.2.3 - strip-ansi: 6.0.1 - wrap-ansi: 7.0.0 - - clone@1.0.4: {} - - code-excerpt@4.0.0: - dependencies: - convert-to-spaces: 2.0.1 - - color-convert@2.0.1: - dependencies: - color-name: 1.1.4 - - color-name@1.1.4: {} - - color-support@1.1.3: {} - - colorette@2.0.20: {} - - common-path-prefix@3.0.0: {} - - concat-map@0.0.1: {} - - concordance@5.0.4: - dependencies: - date-time: 3.1.0 - esutils: 2.0.3 - fast-diff: 1.3.0 - js-string-escape: 1.0.1 - lodash: 4.17.21 - md5-hex: 3.0.1 - semver: 7.6.0 - well-known-symbols: 2.0.0 - - console-control-strings@1.1.0: {} - - convert-to-spaces@2.0.1: {} - - currently-unhandled@0.4.1: - dependencies: - array-find-index: 1.0.2 - - date-time@3.1.0: - dependencies: - time-zone: 1.0.0 - - debug@4.3.4: - dependencies: - ms: 2.1.2 - - defaults@1.0.4: - dependencies: - clone: 1.0.4 - - define-data-property@1.1.4: - dependencies: - es-define-property: 1.0.0 - es-errors: 1.3.0 - gopd: 1.0.1 - - delegates@1.0.0: {} - - deprecation@2.3.1: {} - - detect-libc@2.0.3: {} - - emittery@1.0.3: {} - - emnapi@1.1.1: {} - - emoji-regex@10.3.0: {} - - emoji-regex@8.0.0: {} - - es-define-property@1.0.0: - dependencies: - get-intrinsic: 1.2.4 - - es-errors@1.3.0: {} - - escalade@3.1.2: {} - - escape-string-regexp@2.0.0: {} - - escape-string-regexp@5.0.0: {} - - esprima@4.0.1: {} - - estree-walker@2.0.2: {} - - esutils@2.0.3: {} - - external-editor@3.1.0: - dependencies: - chardet: 0.7.0 - iconv-lite: 0.4.24 - tmp: 0.0.33 - - fast-diff@1.3.0: {} - - fast-glob@3.3.2: - dependencies: - '@nodelib/fs.stat': 2.0.5 - '@nodelib/fs.walk': 1.2.8 - glob-parent: 5.1.2 - merge2: 1.4.1 - micromatch: 4.0.5 - - fastq@1.17.1: - dependencies: - reusify: 1.0.4 - - figures@6.1.0: - dependencies: - is-unicode-supported: 2.0.0 - - file-uri-to-path@1.0.0: {} - - fill-range@7.0.1: - dependencies: - to-regex-range: 5.0.1 - - find-up-simple@1.0.0: {} - - fs-minipass@2.1.0: - dependencies: - minipass: 3.3.6 - - fs.realpath@1.0.0: {} - - function-bind@1.1.2: {} - - gauge@3.0.2: - dependencies: - aproba: 2.0.0 - color-support: 1.1.3 - console-control-strings: 1.1.0 - has-unicode: 2.0.1 - object-assign: 4.1.1 - signal-exit: 3.0.7 - string-width: 4.2.3 - strip-ansi: 6.0.1 - wide-align: 1.1.5 - - get-caller-file@2.0.5: {} - - get-east-asian-width@1.2.0: {} - - get-intrinsic@1.2.4: - dependencies: - es-errors: 1.3.0 - function-bind: 1.1.2 - has-proto: 1.0.3 - has-symbols: 1.0.3 - hasown: 2.0.2 - - glob-parent@5.1.2: - dependencies: - is-glob: 4.0.3 - - glob@7.2.3: - dependencies: - fs.realpath: 1.0.0 - inflight: 1.0.6 - inherits: 2.0.4 - minimatch: 3.1.2 - once: 1.4.0 - path-is-absolute: 1.0.1 - - globby@14.0.1: - dependencies: - '@sindresorhus/merge-streams': 2.3.0 - fast-glob: 3.3.2 - ignore: 5.3.1 - path-type: 5.0.0 - slash: 5.1.0 - unicorn-magic: 0.1.0 - - gopd@1.0.1: - dependencies: - get-intrinsic: 1.2.4 - - graceful-fs@4.2.11: {} - - has-flag@4.0.0: {} - - has-property-descriptors@1.0.2: - dependencies: - es-define-property: 1.0.0 - - has-proto@1.0.3: {} - - has-symbols@1.0.3: {} - - has-unicode@2.0.1: {} - - hasown@2.0.2: - dependencies: - function-bind: 1.1.2 - - https-proxy-agent@5.0.1: - dependencies: - agent-base: 6.0.2 - debug: 4.3.4 - transitivePeerDependencies: - - supports-color - - iconv-lite@0.4.24: - dependencies: - safer-buffer: 2.1.2 - - ieee754@1.2.1: {} - - ignore-by-default@2.1.0: {} - - ignore@5.3.1: {} - - imurmurhash@0.1.4: {} - - indent-string@5.0.0: {} - - inflight@1.0.6: - dependencies: - once: 1.4.0 - wrappy: 1.0.2 - - inherits@2.0.4: {} - - inquirer@9.2.19: - dependencies: - '@inquirer/figures': 1.0.1 - '@ljharb/through': 2.3.13 - ansi-escapes: 4.3.2 - chalk: 5.3.0 - cli-cursor: 3.1.0 - cli-width: 4.1.0 - external-editor: 3.1.0 - lodash: 4.17.21 - mute-stream: 1.0.0 - ora: 5.4.1 - run-async: 3.0.0 - rxjs: 7.8.1 - string-width: 4.2.3 - strip-ansi: 6.0.1 - wrap-ansi: 6.2.0 - - irregular-plurals@3.5.0: {} - - is-extglob@2.1.1: {} - - is-fullwidth-code-point@3.0.0: {} - - is-fullwidth-code-point@4.0.0: {} - - is-glob@4.0.3: - dependencies: - is-extglob: 2.1.1 - - is-interactive@1.0.0: {} - - is-number@7.0.0: {} - - is-plain-object@5.0.0: {} - - is-promise@4.0.0: {} - - is-unicode-supported@0.1.0: {} - - is-unicode-supported@2.0.0: {} - - js-string-escape@1.0.1: {} - - js-yaml@3.14.1: - dependencies: - argparse: 1.0.10 - esprima: 4.0.1 - - js-yaml@4.1.0: - dependencies: - argparse: 2.0.1 - - load-json-file@7.0.1: {} - - lodash-es@4.17.21: {} - - lodash@4.17.21: {} - - log-symbols@4.1.0: - dependencies: - chalk: 4.1.2 - is-unicode-supported: 0.1.0 - - lru-cache@6.0.0: - dependencies: - yallist: 4.0.0 - - make-dir@3.1.0: - dependencies: - semver: 6.3.1 - - matcher@5.0.0: - dependencies: - escape-string-regexp: 5.0.0 - - md5-hex@3.0.1: - dependencies: - blueimp-md5: 2.19.0 - - memoize@10.0.0: - dependencies: - mimic-function: 5.0.1 - - merge2@1.4.1: {} - - micromatch@4.0.5: - dependencies: - braces: 3.0.2 - picomatch: 2.3.1 - - mimic-fn@2.1.0: {} - - mimic-function@5.0.1: {} - - minimatch@3.1.2: - dependencies: - brace-expansion: 1.1.11 - - minipass@3.3.6: - dependencies: - yallist: 4.0.0 - - minipass@5.0.0: {} - - minizlib@2.1.2: - dependencies: - minipass: 3.3.6 - yallist: 4.0.0 - - mkdirp@1.0.4: {} - - ms@2.1.2: {} - - ms@2.1.3: {} - - mute-stream@1.0.0: {} - - node-fetch@2.7.0: - dependencies: - whatwg-url: 5.0.0 - - node-gyp-build@4.8.0: {} - - nofilter@3.1.0: {} - - nopt@5.0.0: - dependencies: - abbrev: 1.1.1 - - npmlog@5.0.1: - dependencies: - are-we-there-yet: 2.0.0 - console-control-strings: 1.1.0 - gauge: 3.0.2 - set-blocking: 2.0.0 - - object-assign@4.1.1: {} - - once@1.4.0: - dependencies: - wrappy: 1.0.2 - - onetime@5.1.2: - dependencies: - mimic-fn: 2.1.0 - - ora@5.4.1: - dependencies: - bl: 4.1.0 - chalk: 4.1.2 - cli-cursor: 3.1.0 - cli-spinners: 2.9.2 - is-interactive: 1.0.0 - is-unicode-supported: 0.1.0 - log-symbols: 4.1.0 - strip-ansi: 6.0.1 - wcwidth: 1.0.1 - - os-tmpdir@1.0.2: {} - - p-map@7.0.2: {} - - package-config@5.0.0: - dependencies: - find-up-simple: 1.0.0 - load-json-file: 7.0.1 - - parse-ms@4.0.0: {} - - path-is-absolute@1.0.1: {} - - path-type@5.0.0: {} - - picomatch@2.3.1: {} - - picomatch@3.0.1: {} - - plur@5.1.0: - dependencies: - irregular-plurals: 3.5.0 - - pretty-ms@9.0.0: - dependencies: - parse-ms: 4.0.0 - - queue-microtask@1.2.3: {} - - readable-stream@3.6.2: - dependencies: - inherits: 2.0.4 - string_decoder: 1.3.0 - util-deprecate: 1.0.2 - - require-directory@2.1.1: {} - - resolve-cwd@3.0.0: - dependencies: - resolve-from: 5.0.0 - - resolve-from@5.0.0: {} - - restore-cursor@3.1.0: - dependencies: - onetime: 5.1.2 - signal-exit: 3.0.7 - - reusify@1.0.4: {} - - rimraf@3.0.2: - dependencies: - glob: 7.2.3 - - run-async@3.0.0: {} - - run-parallel@1.2.0: - dependencies: - queue-microtask: 1.2.3 - - rxjs@7.8.1: - dependencies: - tslib: 2.6.2 - - safe-buffer@5.2.1: {} - - safer-buffer@2.1.2: {} - - semver@6.3.1: {} - - semver@7.6.0: - dependencies: - lru-cache: 6.0.0 - - serialize-error@7.0.1: - dependencies: - type-fest: 0.13.1 - - set-blocking@2.0.0: {} - - set-function-length@1.2.2: - 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 - - signal-exit@3.0.7: {} - - signal-exit@4.1.0: {} - - slash@5.1.0: {} - - slice-ansi@5.0.0: - dependencies: - ansi-styles: 6.2.1 - is-fullwidth-code-point: 4.0.0 - - sprintf-js@1.0.3: {} - - stack-utils@2.0.6: - dependencies: - escape-string-regexp: 2.0.0 - - string-width@4.2.3: - dependencies: - emoji-regex: 8.0.0 - is-fullwidth-code-point: 3.0.0 - strip-ansi: 6.0.1 - - string-width@7.1.0: - dependencies: - emoji-regex: 10.3.0 - get-east-asian-width: 1.2.0 - strip-ansi: 7.1.0 - - string_decoder@1.3.0: - dependencies: - safe-buffer: 5.2.1 - - strip-ansi@6.0.1: - dependencies: - ansi-regex: 5.0.1 - - strip-ansi@7.1.0: - dependencies: - ansi-regex: 6.0.1 - - supertap@3.0.1: - dependencies: - indent-string: 5.0.0 - js-yaml: 3.14.1 - serialize-error: 7.0.1 - strip-ansi: 7.1.0 - - supports-color@7.2.0: - dependencies: - has-flag: 4.0.0 - - tar@6.2.1: - dependencies: - chownr: 2.0.0 - fs-minipass: 2.1.0 - minipass: 5.0.0 - minizlib: 2.1.2 - mkdirp: 1.0.4 - yallist: 4.0.0 - - temp-dir@3.0.0: {} - - time-zone@1.0.0: {} - - tmp@0.0.33: - dependencies: - os-tmpdir: 1.0.2 - - to-regex-range@5.0.1: - dependencies: - is-number: 7.0.0 - - toml@3.0.0: {} - - tr46@0.0.3: {} - - tslib@2.6.2: {} - - typanion@3.14.0: {} - - type-fest@0.13.1: {} - - type-fest@0.21.3: {} - - typescript@5.4.5: {} - - undici-types@5.26.5: {} - - unicorn-magic@0.1.0: {} - - universal-user-agent@6.0.1: {} - - util-deprecate@1.0.2: {} - - wasm-sjlj@1.0.5: {} - - wcwidth@1.0.1: - dependencies: - defaults: 1.0.4 - - webidl-conversions@3.0.1: {} - - well-known-symbols@2.0.0: {} - - whatwg-url@5.0.0: - dependencies: - tr46: 0.0.3 - webidl-conversions: 3.0.1 - - wide-align@1.1.5: - dependencies: - string-width: 4.2.3 - - wrap-ansi@6.2.0: - dependencies: - ansi-styles: 4.3.0 - string-width: 4.2.3 - strip-ansi: 6.0.1 - - wrap-ansi@7.0.0: - dependencies: - ansi-styles: 4.3.0 - string-width: 4.2.3 - strip-ansi: 6.0.1 - - wrappy@1.0.2: {} - - write-file-atomic@5.0.1: - dependencies: - imurmurhash: 0.1.4 - signal-exit: 4.1.0 - - y18n@5.0.8: {} - - yallist@4.0.0: {} - - yargs-parser@21.1.1: {} - - yargs@17.7.2: - dependencies: - cliui: 8.0.1 - escalade: 3.1.2 - get-caller-file: 2.0.5 - require-directory: 2.1.1 - string-width: 4.2.3 - y18n: 5.0.8 - yargs-parser: 21.1.1 diff --git a/src/tests/alias.rs b/src/tests/alias.rs deleted file mode 100644 index c7f7129a..00000000 --- a/src/tests/alias.rs +++ /dev/null @@ -1,220 +0,0 @@ -//! - -use normalize_path::NormalizePath; -use std::path::Path; - -use crate::{AliasValue, Resolution, ResolveContext, ResolveError, ResolveOptions, Resolver}; - -#[test] -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -fn alias() { - use super::memory_fs::MemoryFS; - use crate::ResolverGeneric; - use std::path::{Path, PathBuf}; - - let f = Path::new("/"); - - let file_system = MemoryFS::new(&[ - ("/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", ""), - ("/dashed-name", ""), - ]); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - alias: vec![ - ("aliasA".into(), vec![AliasValue::from("a")]), - ("b$".into(), vec![AliasValue::from("a/index")]), - ("c$".into(), vec![AliasValue::from("/a/index")]), - ( - "multiAlias".into(), - vec![ - AliasValue::from("b"), - AliasValue::from("c"), - AliasValue::from("d"), - AliasValue::from("e"), - AliasValue::from("a"), - ], - ), - ("recursive".into(), vec![AliasValue::from("recursive/dir")]), - ("/d/dir".into(), vec![AliasValue::from("/c/dir")]), - ("/d/index.js".into(), vec![AliasValue::from("/c/index")]), - ("#".into(), vec![AliasValue::from("/c/dir")]), - ("@".into(), vec![AliasValue::from("/c/dir")]), - ("ignored".into(), vec![AliasValue::Ignore]), - // not part of enhanced-resolve, added to make sure query in alias value works - ("alias_query".into(), vec![AliasValue::from("a?query_after")]), - ("alias_fragment".into(), vec![AliasValue::from("a#fragment_after")]), - ("dash".into(), vec![AliasValue::Ignore]), - ("@scope/package-name/file$".into(), vec![AliasValue::from("/c/dir")]), - ], - modules: vec!["/".into()], - ..ResolveOptions::default() - }, - ); - - #[rustfmt::skip] - let pass = [ - ("should resolve a not aliased module 1", "a", "/a/index"), - ("should resolve a not aliased module 2", "a/index", "/a/index"), - ("should resolve a not aliased module 3", "a/dir", "/a/dir/index"), - ("should resolve a not aliased module 4", "a/dir/index", "/a/dir/index"), - ("should resolve an aliased module 1", "aliasA", "/a/index"), - ("should resolve an aliased module 2", "aliasA/index", "/a/index"), - ("should resolve an aliased module 3", "aliasA/dir", "/a/dir/index"), - ("should resolve an aliased module 4", "aliasA/dir/index", "/a/dir/index"), - ("should resolve '#' alias 1", "#", "/c/dir/index"), - ("should resolve '#' alias 2", "#/index", "/c/dir/index"), - ("should resolve '@' alias 1", "@", "/c/dir/index"), - ("should resolve '@' alias 2", "@/index", "/c/dir/index"), - ("should resolve a recursive aliased module 1", "recursive", "/recursive/dir/index"), - ("should resolve a recursive aliased module 2", "recursive/index", "/recursive/dir/index"), - ("should resolve a recursive aliased module 3", "recursive/dir", "/recursive/dir/index"), - ("should resolve a recursive aliased module 4", "recursive/dir/index", "/recursive/dir/index"), - ("should resolve a file aliased module 1", "b", "/a/index"), - ("should resolve a file aliased module 2", "c", "/a/index"), - ("should resolve a file aliased module with a query 1", "b?query", "/a/index?query"), - ("should resolve a file aliased module with a query 2", "c?query", "/a/index?query"), - ("should resolve a path in a file aliased module 1", "b/index", "/b/index"), - ("should resolve a path in a file aliased module 2", "b/dir", "/b/dir/index"), - ("should resolve a path in a file aliased module 3", "b/dir/index", "/b/dir/index"), - ("should resolve a path in a file aliased module 4", "c/index", "/c/index"), - ("should resolve a path in a file aliased module 5", "c/dir", "/c/dir/index"), - ("should resolve a path in a file aliased module 6", "c/dir/index", "/c/dir/index"), - ("should resolve a file aliased file 1", "d", "/c/index"), - ("should resolve a file aliased file 2", "d/dir/index", "/c/dir/index"), - ("should resolve a file in multiple aliased dirs 1", "multiAlias/dir/file", "/e/dir/file"), - ("should resolve a file in multiple aliased dirs 2", "multiAlias/anotherDir", "/e/anotherDir/index"), - // not part of enhanced-resolve, added to make sure query in alias value works - ("should resolve query in alias value", "alias_query?query_before", "/a/index?query_after"), - ("should resolve query in alias value", "alias_fragment#fragment_before", "/a/index#fragment_after"), - ("should resolve dashed name", "dashed-name", "/dashed-name"), - ("should resolve scoped package name with sub dir", "@scope/package-name/file", "/c/dir/index"), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - - #[rustfmt::skip] - let ignore = [ - ("should resolve an ignore module", "ignored", ResolveError::Ignored(f.join("ignored"))) - ]; - - for (comment, request, expected) in ignore { - let resolution = resolver.resolve(f, request); - assert_eq!(resolution, Err(expected), "{comment} {request}"); - } -} - -// Not part of enhanced-resolve -#[test] -fn infinite_recursion() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![ - ("./a".into(), vec![AliasValue::from("./b")]), - ("./b".into(), vec![AliasValue::from("./a")]), - ], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(f, "./a"); - assert_eq!(resolution, Err(ResolveError::Recursion)); -} - -fn check_slash(path: &Path) { - let s = path.to_string_lossy().to_string(); - #[cfg(target_os = "windows")] - { - assert!(!s.contains('/'), "{s}"); - assert!(s.contains('\\'), "{s}"); - } - #[cfg(not(target_os = "windows"))] - { - assert!(s.contains('/'), "{s}"); - assert!(!s.contains('\\'), "{s}"); - } -} - -#[test] -fn absolute_path() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![(f.join("foo").to_str().unwrap().to_string(), vec![AliasValue::Ignore])], - modules: vec![f.clone().to_str().unwrap().to_string()], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(&f, "foo/index"); - assert_eq!(resolution, Err(ResolveError::Ignored(f.join("foo")))); -} - -#[test] -fn system_path() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![("@app".into(), vec![AliasValue::from(f.join("alias").to_string_lossy())])], - ..ResolveOptions::default() - }); - - let specifiers = ["@app/files/a", "@app/files/a.js"]; - - for specifier in specifiers { - let path = resolver.resolve(&f, specifier).map(Resolution::into_path_buf).unwrap(); - assert_eq!(path, f.join("alias/files/a.js")); - check_slash(&path); - } -} - -#[test] -fn alias_is_full_path() { - let f = super::fixture(); - let dir = f.join("foo"); - let dir_str = dir.to_string_lossy().to_string(); - - let resolver = Resolver::new(ResolveOptions { - alias: vec![("@".into(), vec![AliasValue::Path(dir_str.clone())])], - ..ResolveOptions::default() - }); - - let mut ctx = ResolveContext::default(); - - let specifiers = [ - "@/index".to_string(), - "@/index.js".to_string(), - // specifier has multiple `/` for reasons we'll never know - "@////index".to_string(), - // specifier is a full path - dir_str, - ]; - - for specifier in specifiers { - let resolution = resolver.resolve_with_context(&f, &specifier, &mut ctx); - assert_eq!(resolution.map(|r| r.full_path()), Ok(dir.join("index.js"))); - } - - for path in ctx.file_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - check_slash(&path); - } - - for path in ctx.missing_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - check_slash(&path); - if let Some(path) = path.parent() { - assert!(!path.is_file(), "{path:?} must not be a file"); - } - } -} diff --git a/src/tests/browser_field.rs b/src/tests/browser_field.rs deleted file mode 100644 index 39a1ed90..00000000 --- a/src/tests/browser_field.rs +++ /dev/null @@ -1,176 +0,0 @@ -//! - -use crate::{AliasValue, ResolveError, ResolveOptions, Resolver}; - -#[test] -fn ignore() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![ - vec!["browser".into()], - vec!["innerBrowser1".into()], - vec!["innerBrowser2".into()], - vec![], - ], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - (f.clone(), "./lib/ignore", f.join("lib/ignore.js")), - (f.clone(), "./lib/ignore.js", f.join("lib/ignore.js")), - (f.join("lib"), "./ignore", f.join("lib/ignore.js")), - (f.join("lib"), "./ignore.js", f.join("lib/ignore.js")), - ]; - - for (path, request, expected) in data { - let resolution = resolver.resolve(&path, request); - let expected = ResolveError::Ignored(expected); - assert_eq!(resolution, Err(expected), "{path:?} {request}"); - } -} - -#[test] -fn shared_resolvers() { - let f = super::fixture().join("browser-module"); - - let resolver1 = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["innerBrowser1".into(), "field".into(), "browser".into()]], - ..ResolveOptions::default() - }); - let resolved_path = resolver1.resolve(&f, "./lib/main1.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("lib/main.js"))); - - let resolver2 = resolver1.clone_with_options(ResolveOptions { - alias_fields: vec![vec!["innerBrowser2".into(), "browser".into()]], - ..ResolveOptions::default() - }); - let resolved_path = resolver2.resolve(&f, "./lib/main2.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("./lib/replaced.js"))); -} - -#[test] -fn replace_file() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![ - vec!["browser".into()], - vec!["innerBrowser1".into(), "field2".into(), "browser".into()], // not presented - vec!["innerBrowser1".into(), "field".into(), "browser".into()], - vec!["innerBrowser2".into(), "browser".into()], - ], - // Not part of enhanced-resolve. Added to make sure no interaction between these two fields. - main_fields: vec!["browser".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - ("should replace a file 1", f.clone(), "./lib/replaced", f.join("lib/browser.js")), - ("should replace a file 2", f.clone(), "./lib/replaced.js", f.join("lib/browser.js")), - ("should replace a file 3", f.join("lib"), "./replaced", f.join("lib/browser.js")), - ("should replace a file 4", f.join("lib"), "./replaced.js", f.join("lib/browser.js")), - ("should replace a module with a file 1", f.clone(), "module-a", f.join("browser/module-a.js")), - ("should replace a module with a file 2", f.join("lib"), "module-a", f.join("browser/module-a.js")), - ("should replace a module with a module 1", f.clone(), "module-b", f.join("node_modules/module-c.js")), - ("should replace a module with a module 2", f.join("lib"), "module-b", f.join("node_modules/module-c.js")), - ("should resolve in nested property 1", f.clone(), "./lib/main1.js", f.join("lib/main.js")), - ("should resolve in nested property 2", f.clone(), "./lib/main2.js", f.join("lib/browser.js")), - ("should check only alias field properties", f.clone(), "./toString", f.join("lib/toString.js")), - // not part of enhanced-resolve - ("recursion", f.clone(), "module-c", f.join("node_modules/module-c.js")), - ("resolve self 1", f.clone(), "./lib/main.js", f.join("lib/main.js")), - ("resolve self 2", f.clone(), "./main.js", f.join("lib/main.js")), - ]; - - for (comment, path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn recurse_fail() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - ("recurse non existent", f.clone(), "./lib/non-existent.js", ResolveError::NotFound("./lib/non-existent.js".into())), - ("path partial match 1", f.clone(), "./xyz.js", ResolveError::NotFound("./xyz.js".into())), - ("path partial match 2", f, "./lib/xyz.js", ResolveError::NotFound("./lib/xyz.js".into())), - ]; - - for (comment, path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Err(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn broken() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - // The browser field string value should be ignored - (f.clone(), "browser-module-broken", Ok(f.join("node_modules/browser-module-broken/main.js"))), - (f.join("browser-module"), "./number", Err(ResolveError::NotFound("./number".into()))), - ]; - - for (path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, expected, "{path:?} {request}"); - } -} - -#[test] -fn crypto_js() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - fallback: vec![( - "crypto".into(), - vec![AliasValue::from(f.join("lib.js").to_string_lossy())], - )], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(f.join("crypto-js"), "crypto").map(|r| r.full_path()); - assert_eq!(resolved_path, Err(ResolveError::Ignored(f.join("crypto-js")))); -} - -// https://github.com/webpack/webpack/blob/87660921808566ef3b8796f8df61bd79fc026108/test/cases/resolving/browser-field/index.js#L40-L43 -#[test] -fn recursive() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - let data = [ - ("should handle recursive file 1", f.clone(), "recursive-file/a"), - ("should handle recursive file 2", f.clone(), "recursive-file/b"), - ("should handle recursive file 3", f.clone(), "recursive-file/c"), - ("should handle recursive file 4", f, "recursive-file/d"), - ]; - - for (comment, path, request) in data { - let resolved_path = resolver.resolve(&path, request); - assert_eq!(resolved_path, Err(ResolveError::Recursion), "{comment} {path:?} {request}"); - } -} diff --git a/src/tests/builtins.rs b/src/tests/builtins.rs deleted file mode 100644 index 6163dd13..00000000 --- a/src/tests/builtins.rs +++ /dev/null @@ -1,98 +0,0 @@ -use std::path::Path; - -use crate::{ResolveError, ResolveOptions, Resolver}; - -#[test] -fn builtins_off() { - let f = Path::new("/"); - let resolver = Resolver::default(); - let resolved_path = resolver.resolve(f, "zlib").map(|r| r.full_path()); - assert_eq!(resolved_path, Err(ResolveError::NotFound("zlib".into()))); -} - -#[test] -fn builtins() { - let f = Path::new("/"); - - let resolver = - Resolver::new(ResolveOptions { builtin_modules: true, ..ResolveOptions::default() }); - - let pass = [ - "_http_agent", - "_http_client", - "_http_common", - "_http_incoming", - "_http_outgoing", - "_http_server", - "_stream_duplex", - "_stream_passthrough", - "_stream_readable", - "_stream_transform", - "_stream_wrap", - "_stream_writable", - "_tls_common", - "_tls_wrap", - "assert", - "assert/strict", - "async_hooks", - "buffer", - "child_process", - "cluster", - "console", - "constants", - "crypto", - "dgram", - "diagnostics_channel", - "dns", - "dns/promises", - "domain", - "events", - "fs", - "fs/promises", - "http", - "http2", - "https", - "inspector", - "module", - "net", - "os", - "path", - "path/posix", - "path/win32", - "perf_hooks", - "process", - "punycode", - "querystring", - "readline", - "repl", - "stream", - "stream/consumers", - "stream/promises", - "stream/web", - "string_decoder", - "sys", - "timers", - "timers/promises", - "tls", - "trace_events", - "tty", - "url", - "util", - "util/types", - "v8", - "vm", - "worker_threads", - "zlib", - ]; - - for request in pass { - let resolved_path = resolver.resolve(f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Err(ResolveError::Builtin(request.to_string())), "{request}"); - } - - for request in pass { - let request = format!("node:{request}"); - let resolved_path = resolver.resolve(f, &request).map(|r| r.full_path()); - assert_eq!(resolved_path, Err(ResolveError::Builtin(request.to_string())), "{request}"); - } -} diff --git a/src/tests/dependencies.rs b/src/tests/dependencies.rs deleted file mode 100644 index bcc2355b..00000000 --- a/src/tests/dependencies.rs +++ /dev/null @@ -1,110 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/dependencies.test.js - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows { - use rustc_hash::FxHashSet; - use std::path::PathBuf; - - use crate::{ResolveContext, ResolveOptions, ResolverGeneric}; - - use super::super::memory_fs::MemoryFS; - - fn file_system() -> MemoryFS { - MemoryFS::new(&[ - ("/a/b/node_modules/some-module/index.js", ""), - ("/a/node_modules/module/package.json", r#"{"main":"entry.js"}"#), - ("/a/node_modules/module/file.js", r#"{"main":"entry.js"}"#), - ("/modules/other-module/file.js", ""), - ]) - } - - #[test] - fn test() { - let file_system = file_system(); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - extensions: vec![".json".into(), ".js".into()], - modules: vec!["/modules".into(), "node_modules".into()], - ..ResolveOptions::default() - }, - ); - - let data = [ - ( - "middle module request", - "/a/b/c", - "module/file", - "/a/node_modules/module/file.js", - // These dependencies are different from enhanced-resolve due to different code path to - // querying the file system - vec![ - // 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", - // "/", - ], - vec![ - // missing package.jsons - // "/a/b/c/package.json", - "/a/b/package.json", - "/a/package.json", - "/package.json", - // missing modules directories - "/a/b/c", - // "/a/b/c/node_modules", - // missing single file modules - "/modules/module", - "/a/b/node_modules/module", - // missing files with alternative extensions - "/a/node_modules/module/file", - "/a/node_modules/module/file.json", - ], - ), - ( - "fast found module", - "/a/b/c", - "other-module/file.js", - "/modules/other-module/file.js", - // These dependencies are different from enhanced-resolve due to different code path to - // querying the file system - vec![ - // symlink checks - "/modules/other-module/file.js", - // "/modules/other-module", - // "/modules", - // "/", - ], - vec![ - // missing package.jsons - // "/a/b/c/package.json", - "/a/b/c", - "/a/b/package.json", - "/a/package.json", - "/package.json", - "/modules/other-module/package.json", - "/modules/package.json", - ], - ), - ]; - - for (name, context, request, result, file_dependencies, missing_dependencies) in data { - let mut ctx = ResolveContext::default(); - let path = PathBuf::from(context); - let resolved = - resolver.resolve_with_context(path, request, &mut ctx).map(|r| r.full_path()); - assert_eq!(resolved, Ok(PathBuf::from(result))); - let file_dependencies = - FxHashSet::from_iter(file_dependencies.iter().map(PathBuf::from)); - let missing_dependencies = - FxHashSet::from_iter(missing_dependencies.iter().map(PathBuf::from)); - assert_eq!(ctx.file_dependencies, file_dependencies, "{name}"); - assert_eq!(ctx.missing_dependencies, missing_dependencies, "{name}"); - } - } -} diff --git a/src/tests/exports_field.rs b/src/tests/exports_field.rs deleted file mode 100644 index 669c1adf..00000000 --- a/src/tests/exports_field.rs +++ /dev/null @@ -1,2546 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/exportsField.test.js -//! -//! The huge exports field test cases are at the bottom of this file. - -use crate::{Ctx, PathUtil, ResolveError, ResolveOptions, Resolver}; -use serde_json::json; -use std::path::Path; - -#[test] -fn test_simple() { - let f = super::fixture().join("exports-field"); - let f2 = super::fixture().join("exports-field2"); - let f4 = super::fixture().join("exports-field-error"); - let f5 = super::fixture().join("imports-exports-wildcard"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - fully_specified: true, - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("resolve root using exports field, not a main field", f.clone(), "exports-field", f.join("node_modules/exports-field/x.js")), - ("resolver should respect condition names", f.clone(), "exports-field/dist/main.js", f.join("node_modules/exports-field/lib/lib2/main.js")), - // enhanced_resolve behaves differently to node.js. enhanced_resolve fallbacks when an - // array item is unresolved, where as node.js fallbacks when an array has an - // InvalidPackageTarget error. - // ("resolver should respect fallback", f2.clone(), "exports-field/dist/browser.js", f2.join("node_modules/exports-field/lib/browser.js")), - // The following two tests require fallback from array values, the path is changed here to - // only test query and fragment. - ("resolver should respect query parameters #1", f2.clone(), "exports-field/dist/main.js?foo", f2.join("node_modules/exports-field/lib/lib2/main.js?foo")), - ("resolver should respect fragment parameters #1", f2.clone(), "exports-field/dist/main.js#foo", f2.join("node_modules/exports-field/lib/lib2/main.js#foo")), - ("relative path should work, if relative path as request is used", f.clone(), "./node_modules/exports-field/lib/main.js", f.join("node_modules/exports-field/lib/main.js")), - ("self-resolving root", f.clone(), "@exports-field/core", f.join("a.js")), - ("should resolve with wildcard pattern #1", f5.clone(), "m/features/f.js", f5.join("node_modules/m/src/features/f.js")), - ("should resolve with wildcard pattern #2", f5.clone(), "m/features/y/y.js", f5.join("node_modules/m/src/features/y/y.js")), - ("should resolve with wildcard pattern #3", f5.clone(), "m/features-no-ext/y/y.js", f5.join("node_modules/m/src/features/y/y.js")), - ("should resolve with wildcard pattern #4", f5.clone(), "m/middle/nested/f.js", f5.join("node_modules/m/src/middle/nested/f.js")), - ("should resolve with wildcard pattern #5", f5.clone(), "m/middle-1/nested/f.js", f5.join("node_modules/m/src/middle-1/nested/f.js")), - ("should resolve with wildcard pattern #6", f5.clone(), "m/middle-2/nested/f.js", f5.join("node_modules/m/src/middle-2/nested/f.js")), - ("should resolve with wildcard pattern #7", f5.clone(), "m/middle-3/nested/f", f5.join("node_modules/m/src/middle-3/nested/f/nested/f.js")), - ("should resolve with wildcard pattern #8", f5.clone(), "m/middle-4/f/nested", f5.join("node_modules/m/src/middle-4/f/f.js")), - ("should resolve with wildcard pattern #9", f5.clone(), "m/middle-5/f$/$", f5.join("node_modules/m/src/middle-5/f$/$.js")), - ]; - - // Not needed or snapshot: - // * should log the correct info - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } - - let p = f.join("node_modules/exports-field/package.json"); - let p2 = f2.join("node_modules/exports-field/package.json"); - let p4 = f4.join("node_modules/exports-field/package.json"); - let p5 = f5.join("node_modules/m/package.json"); - - #[rustfmt::skip] - let fail = [ - // ("throw error if extension not provided", f2.clone(), "exports-field/dist/main", ResolveError::NotFound(f2.join("node_modules/exports-field/lib/lib2/main"))), - ("resolver should respect query parameters #2. Direct matching", f2.clone(), "exports-field?foo", ResolveError::PackagePathNotExported("./?foo".into(), p2.clone())), - ("resolver should respect fragment parameters #2. Direct matching", f2, "exports-field#foo", ResolveError::PackagePathNotExported("./#foo".into(), p2)), - ("relative path should not work with exports field", f.clone(), "./node_modules/exports-field/dist/main.js", ResolveError::NotFound("./node_modules/exports-field/dist/main.js".into())), - ("backtracking should not work for request", f.clone(), "exports-field/dist/../../../a.js", ResolveError::InvalidPackageTarget("./lib/../../../a.js".to_string(), "./dist/".to_string(), p.clone())), - ("backtracking should not work for exports field target", f.clone(), "exports-field/dist/a.js", ResolveError::InvalidPackageTarget("./../../a.js".to_string(), "./dist/a.js".to_string(), p.clone())), - ("not exported error", f.clone(), "exports-field/anything/else", ResolveError::PackagePathNotExported("./anything/else".to_string(), p.clone())), - ("request ending with slash #1", f.clone(), "exports-field/", ResolveError::PackagePathNotExported("./".to_string(), p.clone())), - ("request ending with slash #2", f.clone(), "exports-field/dist/", ResolveError::PackagePathNotExported("./dist/".to_string(), p.clone())), - ("request ending with slash #3", f.clone(), "exports-field/lib/", ResolveError::PackagePathNotExported("./lib/".to_string(), p)), - ("should throw error if target is invalid", f4, "exports-field", ResolveError::InvalidPackageTarget("./a/../b/../../pack1/index.js".to_string(), ".".to_string(), p4)), - ("throw error if exports field is invalid", f.clone(), "invalid-exports-field", ResolveError::InvalidPackageConfig(f.join("node_modules/invalid-exports-field/package.json"))), - ("should throw error if target is 'null'", f5, "m/features/internal/file.js", ResolveError::PackagePathNotExported("./features/internal/file.js".to_string(), p5)), - ]; - - for (comment, path, request, error) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!(resolution, Err(error), "{comment} {path:?} {request}"); - } -} - -// resolve using exports field, not a browser field #1 -#[test] -fn exports_not_browser_field1() { - let f = super::fixture().join("exports-field"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - condition_names: vec!["webpack".into()], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "exports-field/dist/main.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("node_modules/exports-field/lib/lib2/main.js"))); -} - -// resolve using exports field and a browser alias field #2 -#[test] -fn exports_not_browser_field2() { - let f2 = super::fixture().join("exports-field2"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - extensions: vec![".js".into()], - condition_names: vec!["node".into()], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f2, "exports-field/dist/main.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f2.join("node_modules/exports-field/lib/browser.js"))); -} - -// should resolve extension without fullySpecified -#[test] -fn extension_without_fully_specified() { - let f2 = super::fixture().join("exports-field2"); - - let commonjs_resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - let resolved_path = - commonjs_resolver.resolve(&f2, "exports-field/dist/main").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f2.join("node_modules/exports-field/lib/lib2/main.js"))); -} - -#[test] -fn field_name_path() { - let f2 = super::fixture().join("exports-field2"); - let f3 = super::fixture().join("exports-field3"); - - // field name path #1 #2 #3 - let exports_fields = [ - vec![vec!["exportsField".into(), "exports".into()]], - vec![vec!["exportsField".into(), "exports".into()], vec!["exports".into()]], - vec![vec!["exports".into()], vec!["exportsField".into(), "exports".into()]], - ]; - - for exports_fields in exports_fields { - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - exports_fields, - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/main.js"))); - } - - // field name path #4 - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - exports_fields: vec![vec!["exports".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f2, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f2.join("node_modules/exports-field/index.js"))); - - // field name path #5 - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - exports_fields: vec![vec!["ex".into()], vec!["exports_field".into(), "exports".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/index"))); - - // non-compliant export targeting a directory - let resolver = Resolver::new(ResolveOptions { - exports_fields: vec![vec!["broken".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/src/index.js"))); -} - -#[test] -fn shared_resolvers() { - let f3 = super::fixture().join("exports-field3"); - - let resolver1 = Resolver::new(ResolveOptions { - exports_fields: vec![vec!["exportsField".into(), "exports".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver1.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/main.js"))); - - let resolver2 = resolver1.clone_with_options(ResolveOptions { - exports_fields: vec![vec!["ex".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver2.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/index"))); -} - -#[test] -fn extension_alias_1_2() { - let f = super::fixture().join("exports-field-and-extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - extension_alias: vec![(".js".into(), vec![".ts".into(), ".js".into()])], - fully_specified: true, - condition_names: vec!["webpack".into(), "default".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve with the `extensionAlias` option", f.clone(), "@org/pkg/string.js", f.join("node_modules/@org/pkg/dist/string.js")), - ("should resolve with the `extensionAlias` option #2", f.clone(), "pkg/string.js", f.join("node_modules/pkg/dist/string.js")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn extension_alias_3() { - let f = super::fixture().join("exports-field-and-extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - extension_alias: vec![( - ".js".into(), - vec![".foo".into(), ".baz".into(), ".baz".into(), ".ts".into(), ".js".into()], - )], - fully_specified: true, - condition_names: vec!["webpack".into(), "default".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve with the `extensionAlias` option #3", f.clone(), "pkg/string.js", f.join("node_modules/pkg/dist/string.js")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn extension_alias_throw_error() { - let f = super::fixture().join("exports-field-and-extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - extension_alias: vec![(".js".into(), vec![".ts".into()])], - fully_specified: true, - condition_names: vec!["webpack".into(), "default".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let fail = [ - // enhanced-resolve has two test cases that are exactly the same here - // https://github.com/webpack/enhanced-resolve/blob/a998c7d218b7a9ec2461fc4fddd1ad5dd7687485/test/exportsField.test.js#L2976-L3024 - ("should throw error with the `extensionAlias` option", f, "pkg/string.js", ResolveError::ExtensionAlias), - // TODO: The error is PackagePathNotExported in enhanced-resolve - // ("should throw error with the `extensionAlias` option", f.clone(), "pkg/string.js", ResolveError::PackagePathNotExported("node_modules/pkg/dist/string.ts".to_string())), - ]; - - for (comment, path, request, error) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!(resolution, Err(error), "{comment} {path:?} {request}"); - } -} - -// Small script for generating the test cases from enhanced-resolve -// for (c of testCases) { -// console.log("TestCase {") -// console.log(`name: ${JSON.stringify(c.name)},`) -// if (c.expect instanceof Error) { -// console.log(`expect: None,`) -// } else { -// console.log(`expect: Some(vec!${JSON.stringify(c.expect)}),`) -// } -// console.log(`exports_field: exports_field(json!(${JSON.stringify(c.suite[0], null, 2)})),`) -// console.log(`request: "${c.suite[1]}",`) -// console.log(`condition_names: vec!${JSON.stringify(c.suite[2])},`) -// console.log("},") -//} -struct TestCase { - name: &'static str, - expect: Option>, - exports_field: serde_json::Value, - request: &'static str, - condition_names: Vec<&'static str>, -} - -#[allow(clippy::needless_pass_by_value)] -fn exports_field(value: serde_json::Value) -> serde_json::Value { - value -} - -#[test] -fn test_cases() { - let test_cases = [ - TestCase { - name: "sample #1", - expect: Some(vec!["./dist/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/": { - "import": [ - "./dist/", - "./src/" - ], - "webpack": "./wp/" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "sample #1", - expect: Some(vec!["./src/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/": { - "import": [ - "./src/" - ], - "webpack": "./wp/" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - TestCase { - name: "sample #1 (wildcard)", - expect: Some(vec!["./dist/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/*": { - "import": [ - "./dist/*", - "./src/*" - ], - "webpack": "./wp/*" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "sample #1 (wildcard)", - expect: Some(vec!["./src/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/*": { - "import": [ - "./src/*" - ], - "webpack": "./wp/*" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - TestCase { - name: "sample #2", - expect: Some(vec!["./data/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./timezones/": "./data/timezones/" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #2 (wildcard)", - expect: Some(vec!["./data/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./timezones/*": "./data/timezones/*" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #3", - expect: Some(vec!["./data/timezones/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./": "./data/timezones/" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #3 (wildcard)", - expect: Some(vec!["./data/timezones/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./*": "./data/timezones/*.mjs" - })), - request: "./timezones/pdt", - condition_names: vec![], - }, - TestCase { - name: "sample #4", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./lib/": { - "browser": [ - "./browser/" - ] - }, - "./dist/index.js": { - "node": "./index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #4 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "node": "./index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #5", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/": { - "browser": [ - "./browser/" - ] - }, - "./dist/index.js": { - "node": "./index.js", - "default": "./browser/index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #5 (wildcard)", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "node": "./index.js", - "default": "./browser/index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./dist/a": "./dist/index.js" - })), - request: "./dist/aaa", - condition_names: vec![], - }, - TestCase { - name: "sample #7", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./dist/a/a/": "./dist/index.js" - })), - request: "./dist/a/a", - condition_names: vec![], - }, - TestCase { - name: "sample #7 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./dist/a/a/*": "./dist/index.js" - })), - request: "./dist/a/a", - condition_names: vec![], - }, - TestCase { - name: "sample #8", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": "./index.js" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #9", - expect: Some(vec!["./main.js"]), - exports_field: exports_field(json!({ - "./index.js": "./main.js" - })), - request: "./index.js", - condition_names: vec![], - }, - TestCase { - name: "sample #10", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #11", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./bar#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #12", - expect: Some(vec!["./ok.js#abc"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/ok.js#abc", - condition_names: vec![], - }, - TestCase { - name: "sample #12", - expect: Some(vec!["./ok.js#abc"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/ok.js#abc", - condition_names: vec![], - }, - TestCase { - name: "sample #13", - expect: Some(vec!["./ok.js?abc"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/ok.js?abc", - condition_names: vec![], - }, - TestCase { - name: "sample #14", - expect: Some(vec!["./🎉.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/🎉.js", - condition_names: vec![], - }, - TestCase { - name: "sample #15", - expect: Some(vec!["./%F0%9F%8E%89.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/%F0%9F%8E%89.js", - condition_names: vec![], - }, - TestCase { - name: "sample #16", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./🎉", - condition_names: vec![], - }, - TestCase { - name: "sample #17", - expect: Some(vec!["./other.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./%F0%9F%8E%89", - condition_names: vec![], - }, - TestCase { - name: "sample #18", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./module", - condition_names: vec![], - }, - TestCase { - name: "sample #19", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./module#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #20", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./module?foo", - condition_names: vec![], - }, - TestCase { - name: "sample #21", - expect: Some(vec!["./zizizi"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./z*z*z*" - })), - request: "./#zippi", - condition_names: vec![], - }, - TestCase { - name: "sample #22", - expect: Some(vec!["./d?e?f"]), - exports_field: exports_field(json!({ - "./a?b?c/": "./" - })), - request: "./a?b?c/d?e?f", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #1", - expect: Some(vec!["./dist/index.js"]), - exports_field: exports_field(json!({ - ".": "./dist/index.js" - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #2", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./": "./", - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #3", - expect: Some(vec!["./dist/a.js"]), - exports_field: exports_field(json!({ - "./dist/": "./dist/", - "./dist/*": "./dist/*", - "./dist*": "./dist*", - "./dist/index.js": "./dist/a.js" - })), - request: "./dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #4", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./": { - "browser": [ - "./browser/" - ] - }, - "./*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "browser": "./index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #5", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./": { - "browser": [ - "./browser/" - ] - }, - "./*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "node": "./node.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #6", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - ".": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #7", - expect: None, - exports_field: exports_field(json!({ - ".": { - "default": "./src/index.js", - "browser": "./index.js", - "node": "./src/node/index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #8", - expect: Some(vec!["./src/index.js"]), - exports_field: exports_field(json!({ - ".": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #9", - expect: Some(vec!["./index"]), - exports_field: exports_field(json!({ - ".": "./index" - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #10", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./index": "./index.js" - })), - request: "./index", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #11", - expect: Some(vec!["./foo.js"]), - exports_field: exports_field(json!({ - "./": "./", - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #12", - expect: Some(vec!["./foo/bar/baz.js"]), - exports_field: exports_field(json!({ - "./": "./", - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo/bar/baz.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #13", - expect: Some(vec!["./foo/bar/baz.js"]), - exports_field: exports_field(json!({ - "./": "./", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo/bar/baz.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #14", - expect: Some(vec!["./foo/bar/baz.js"]), - exports_field: exports_field(json!({ - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo/bar/baz.js", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #1", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "require": "./require.js" - }, { - "import": "./import.mjs" - }] - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #2", - expect: Some(vec!["./import.mjs"]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "require": "./require.js" - }, { - "import": "./import.mjs" - }] - })), - request: ".", - condition_names: vec!["import"], - }, - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./require.js"]), - exports_field: exports_field(json!({ - ".": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./import.mjs"]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "import": "./import.mjs" - }] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./require.js"]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "require": [ - "./require.js" - ] - }, { - "import": [ - "./import.mjs", - "./import.js" - ] - }] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./import.mjs"]), - exports_field: exports_field(json!({ - ".": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "./import.mjs", - "./import.js" - ] - } - ] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./import.js"]), - exports_field: exports_field(json!({ - ".": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "./import.js" - ] - } - ] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "mapping to a folder root #1", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./timezones": "./data/timezones/" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #2", - expect: None, - exports_field: exports_field(json!({ - "./timezones/": "./data/timezones" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #3", - expect: Some(vec!["./data/timezones/pdt/index.mjs"]), - exports_field: exports_field(json!({ - "./timezones/pdt/": "./data/timezones/pdt/" - })), - request: "./timezones/pdt/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #3 (wildcard)", - expect: Some(vec!["./data/timezones/pdt/index.mjs"]), - exports_field: exports_field(json!({ - "./timezones/pdt/*": "./data/timezones/pdt/*" - })), - request: "./timezones/pdt/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #4", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./": "./timezones/" - })), - request: "./pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #4 (wildcard)", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./*": "./timezones/*" - })), - request: "./pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #5", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./": "./" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #5 (wildcard)", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./*": "./*" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #6", - expect: None, - exports_field: exports_field(json!({ - "./": "." - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #6 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "./*": "." - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #7", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": "./" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #7 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": "./*" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #1", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./": "./", - "./dist/": "./lib/" - })), - request: "./dist/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #1 (wildcard)", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./*": "./*", - "./dist/*": "./lib/*" - })), - request: "./dist/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #2", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/": "./dist/utils/", - "./dist/": "./lib/" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #2 (wildcard)", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/*": "./dist/utils/*", - "./dist/*": "./lib/*" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #3", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/index.js": "./dist/utils/index.js", - "./dist/utils/": "./dist/utils/index.mjs", - "./dist/": "./lib/" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #3 (wildcard)", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/index.js": "./dist/utils/index.js", - "./dist/utils/*": "./dist/utils/index.mjs", - "./dist/*": "./lib/*" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #4", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./": { - "browser": "./browser/" - }, - "./dist/": "./lib/" - })), - request: "./dist/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "the longest matching path prefix is prioritized #4 (wildcard)", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./*": { - "browser": "./browser/*" - }, - "./dist/*": "./lib/*" - })), - request: "./dist/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #1", - // `lodash/` does not start with './' so fallbacks to util - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "conditional mapping folder #1", - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": [ - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #1 (wildcard)", - // `lodash/` does not start with './' so fallbacks to util - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": [ - "lodash/*", - "./utils/*" - ], - "node": [ - "./utils-node/*" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "conditional mapping folder #1 (wildcard)", - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": [ - "./utils/*" - ], - "node": [ - "./utils-node/*" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #2", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./node/" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "conditional mapping folder #2 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "webpack": "./wpk/*", - "browser": [ - "lodash/*", - "./utils/*" - ], - "node": [ - "./node/*" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "conditional mapping folder #3", - expect: Some(vec!["./wpk/index.mjs"]), - exports_field: exports_field(json!({ - "./utils/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils/" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "conditional mapping folder #3 (wildcard)", - expect: Some(vec!["./wpk/index.mjs"]), - exports_field: exports_field(json!({ - "./utils/*": { - "webpack": "./wpk/*", - "browser": [ - "lodash/*", - "./utils/*" - ], - "node": [ - "./utils/*" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "incorrect exports field #1", - expect: None, - exports_field: exports_field(json!({ - "/utils/": "./a/" - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #2", - expect: None, - exports_field: exports_field(json!({ - "./utils/": "/a/" - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #3", - expect: None, - exports_field: exports_field(json!({ - "/utils/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #4", - expect: None, - exports_field: exports_field(json!({ - "./utils/": { - "browser": "/a/", - "default": "/b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #4 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "/a/", - "default": "/b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #5", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index": "./a/index.js" - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index.mjs": "./a/index.js" - })), - request: "./utils/index", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #7", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #8", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index.mjs": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - // Requests that are not `./` does not apply to `package_exports_resolve` - // TestCase { - // name: "incorrect request #1", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": "./a/" - // })), - // request: "/utils/index.mjs", - // condition_names: vec![], - // }, - // TestCase { - // name: "incorrect request #2", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": { - // "browser": "./a/", - // "default": "./b/" - // } - // })), - // request: "/utils/index.mjs", - // condition_names: vec!["browser"], - // }, - // TestCase { - // name: "incorrect request #3", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": { - // "browser": "./a/", - // "default": "./b/" - // } - // })), - // request: "../utils/index.mjs", - // condition_names: vec!["browser"], - // }, - // TestCase { - // name: "incorrect request #4", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": { - // "browser": "./a/", - // "default": "./b/" - // } - // })), - // request: "/utils/index.mjs/", - // condition_names: vec!["browser"], - // }, - TestCase { - name: "backtracking package base #1", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./../../utils/": "./dist/" - })), - request: "./../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #1 (wildcard)", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./../../utils/*": "./dist/*" - })), - request: "./../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #2", - expect: None, - exports_field: exports_field(json!({ - "../../utils/": "./dist/" - })), - request: "../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #2 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "../../utils/*": "./dist/*" - })), - request: "../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #3", - expect: None, - exports_field: exports_field(json!({ - "./utils/": "../src/" - })), - request: "./utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #3 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "./utils/*": "../src/*" - })), - request: "./utils/index", - condition_names: vec![], - }, - // enhanced-resolve does not handle backtracking here - // TestCase { - // name: "backtracking package base #4", - // expect: Some(vec!["./../src/index"]), - // exports_field: exports_field(json!({ - // "./utils/": "./../src/" - // })), - // request: "./utils/index", - // condition_names: vec![], - // }, - // TestCase { - // name: "backtracking package base #4 (wildcard)", - // expect: Some(vec!["./../src/index"]), - // exports_field: exports_field(json!({ - // "./utils/*": "./../src/*" - // })), - // request: "./utils/index", - // condition_names: vec![], - // }, - // TestCase { - // name: "backtracking package base #5", - // expect: Some(vec!["./src/../index.js"]), - // exports_field: exports_field(json!({ - // "./utils/index": "./src/../index.js" - // })), - // request: "./utils/index", - // condition_names: vec![], - // }, - TestCase { - name: "backtracking package base #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/../utils/index": "./src/../index.js" - })), - request: "./utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #7", - expect: None, - exports_field: exports_field(json!({ - "./utils/": { - "browser": "../this/" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #7", - expect: None, - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "../this/*" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #8", - // We throw "InvalidPackageTarget" - // expect: Some(vec!["./utils/../index"]), - expect: None, - exports_field: exports_field(json!({ - "./utils/": { - "browser": "./utils/../" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #8 (wildcard)", - // We throw "InvalidPackageTarget" - // expect: Some(vec!["./utils/../index"]), - expect: None, - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "./utils/../*" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #9", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./": "./src/../../", - "./dist/": "./dist/" - })), - request: "./dist/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #9 (wildcard)", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./*": "./src/../../*", - "./dist/*": "./dist/*" - })), - request: "./dist/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking target folder #1", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../../index"]), - exports_field: exports_field(json!({ - "./utils/": "./dist/" - })), - request: "./utils/timezone/../../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #1 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../../index"]), - exports_field: exports_field(json!({ - "./utils/*": "./dist/*" - })), - request: "./utils/timezone/../../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #2", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../index"]), - exports_field: exports_field(json!({ - "./utils/": "./dist/" - })), - request: "./utils/timezone/../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #2 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../index"]), - exports_field: exports_field(json!({ - "./utils/*": "./dist/*" - })), - request: "./utils/timezone/../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #3", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/target/../../index"]), - exports_field: exports_field(json!({ - "./utils/": "./dist/target/" - })), - request: "./utils/../../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #3 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/target/../../index"]), - exports_field: exports_field(json!({ - "./utils/*": "./dist/target/*" - })), - request: "./utils/../../index", - condition_names: vec![], - }, - // enhanced-resolve does not handle `node_modules` in target - TestCase { - name: "nested node_modules path #1", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": "./node_modules/" - } - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #1 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "./node_modules/*" - } - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #2", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./utils/../node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/": "./utils/../node_modules/" - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "nested node_modules path #2 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./utils/../node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": "./utils/../node_modules/*" - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "nested mapping #1", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": "./", - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested mapping #1 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": "./*", - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "nested mapping #2 (wildcard)", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #2 (wildcard)", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "nested mapping #3", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["webpack"], - }, - TestCase { - name: "nested mapping #3 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["webpack"], - }, - TestCase { - name: "nested mapping #4", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["node", "browser"], - }, - TestCase { - name: "nested mapping #4 (wildcard)", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["node", "browser"], - }, - TestCase { - name: "nested mapping #5", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node"], - }, - TestCase { - name: "nested mapping #5 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": { - "webpack": [ - "./wpck/*" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node"], - }, - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - TestCase { - name: "nested mapping #6 (wildcard)", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": { - "webpack": [ - "./wpck/*" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #6 (wildcard)", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./node/*" - ], - "default": { - "node": { - "webpack": [ - "./wpck/*" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - TestCase { - name: "nested mapping #7", - expect: Some(vec!["./y.js"]), - exports_field: exports_field(json!({ - "./a.js": { - "abc": { - "def": "./x.js" - }, - "ghi": "./y.js" - } - })), - request: "./a.js", - condition_names: vec!["abc", "ghi"], - }, - TestCase { - name: "nested mapping #8", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./a.js": { - "abc": { - "def": "./x.js", - "default": [] - }, - "ghi": "./y.js" - } - })), - request: "./a.js", - condition_names: vec!["abc", "ghi"], - }, - TestCase { - name: "syntax sugar #1", - expect: Some(vec!["./main.js"]), - exports_field: exports_field(json!("./main.js")), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #2", - expect: Some(vec![]), - exports_field: exports_field(json!("./main.js")), - request: "./lib.js", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #3", - expect: Some(vec!["./a.js"]), - exports_field: exports_field(json!(["./a.js", "./b.js"])), - request: ".", - condition_names: vec![], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "syntax sugar #3", - expect: Some(vec!["./b.js"]), - exports_field: exports_field(json!(["./b.js"])), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #4", - expect: Some(vec![]), - exports_field: exports_field(json!(["./a.js", "./b.js"])), - request: "./lib.js", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #5", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "browser": { - "default": "./index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "syntax sugar #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "browser": { - "default": "./index.js" - } - })), - request: "./lib.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "syntax sugar #7", - expect: None, - exports_field: exports_field(json!({ - "./node": "./node.js", - "browser": { - "default": "./index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "syntax sugar #8", - expect: None, - exports_field: exports_field(json!({ - "browser": { - "default": "./index.js" - }, - "./node": "./node.js" - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #1", - expect: Some(vec!["./abc/d"]), - exports_field: exports_field(json!({ - "./ab*": "./ab/*", - "./abc*": "./abc/*", - "./a*": "./a/*" - })), - request: "./abcd", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #2", - expect: Some(vec!["./abc/d/e"]), - exports_field: exports_field(json!({ - "./ab*": "./ab/*", - "./abc*": "./abc/*", - "./a*": "./a/*" - })), - request: "./abcd/e", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #3", - expect: Some(vec!["./abc/d"]), - exports_field: exports_field(json!({ - "./x/ab*": "./ab/*", - "./x/abc*": "./abc/*", - "./x/a*": "./a/*" - })), - request: "./x/abcd", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #4", - expect: Some(vec!["./abc/d/e"]), - exports_field: exports_field(json!({ - "./x/ab*": "./ab/*", - "./x/abc*": "./abc/*", - "./x/a*": "./a/*" - })), - request: "./x/abcd/e", - condition_names: vec!["browser"], - }, - TestCase { - name: "path tree edge case #1", - expect: Some(vec!["./A/b/d.js"]), - exports_field: exports_field(json!({ - "./a/": "./A/", - "./a/b/c": "./c.js" - })), - request: "./a/b/d.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #1 (wildcard)", - expect: Some(vec!["./A/b/d.js"]), - exports_field: exports_field(json!({ - "./a/*": "./A/*", - "./a/b/c": "./c.js" - })), - request: "./a/b/d.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #2", - expect: Some(vec!["./A/c.js"]), - exports_field: exports_field(json!({ - "./a/": "./A/", - "./a/b": "./b.js" - })), - request: "./a/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #2 (wildcard)", - expect: Some(vec!["./A/c.js"]), - exports_field: exports_field(json!({ - "./a/*": "./A/*", - "./a/b": "./b.js" - })), - request: "./a/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #3", - expect: Some(vec!["./A/b/d/c.js"]), - exports_field: exports_field(json!({ - "./a/": "./A/", - "./a/b/c/d": "./c.js" - })), - request: "./a/b/d/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #3 (wildcard)", - expect: Some(vec!["./A/b/d/c.js"]), - exports_field: exports_field(json!({ - "./a/*": "./A/*", - "./a/b/c/d": "./c.js" - })), - request: "./a/b/d/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #1", - expect: Some(vec!["./A/b.js"]), - exports_field: exports_field(json!({ - "./a/*.js": "./A/*.js" - })), - request: "./a/b.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #2", - expect: Some(vec!["./A/b/c.js"]), - exports_field: exports_field(json!({ - "./a/*.js": "./A/*.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #3", - expect: Some(vec!["./A/b/c.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": "./A/*/c.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #4", - expect: Some(vec!["./A/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": "./A/*/*.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #5", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/*.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #5", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/*.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./lib/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #6", - expect: Some(vec!["./browser/foo/bar.js"]), - exports_field: exports_field(json!({ - "./lib/*/bar.js": { - "browser": [ - "./browser/*/bar.js" - ] - }, - "./dist/*/bar.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./lib/foo/bar.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #6", - expect: Some(vec!["./browser/foo.js"]), - exports_field: exports_field(json!({ - "./lib/*/bar.js": { - "browser": [ - "./browser/*/bar.js" - ] - }, - "./dist/*/bar.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./dist/foo/bar.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #7", - expect: Some(vec!["./browser/foo/default.js"]), - exports_field: exports_field(json!({ - "./lib/*/bar.js": { - "browser": [ - "./browser/*/bar.js" - ] - }, - "./dist/*/bar.js": { - "node": "./*.js", - "default": "./browser/*/default.js" - } - })), - request: "./dist/foo/bar.js", - condition_names: vec!["default"], - }, - TestCase { - name: "wildcard pattern #8", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": "./A/*/*/*.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #9", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": [ - "./A/*/*/*.js", - "./B/*/*/*.js" - ] - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "wildcard pattern #9", - expect: Some(vec!["./B/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": [ - "./B/*/*/*.js" - ] - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #10", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/foo-*/c.js": "./A/*/*/*.js" - })), - request: "./a/foo-b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #11", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*-foo/c.js": "./A/*/*/*.js" - })), - request: "./a/b-foo/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #12", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/foo-*-foo/c.js": "./A/*/*/*.js" - })), - request: "./a/foo-b-foo/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #13", - expect: Some(vec!["./A/b/c/d.js"]), - exports_field: exports_field(json!({ - "./a/foo-*-foo/c.js": "./A/b/c/d.js" - })), - request: "./a/foo-b-foo/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #14", - expect: Some(vec!["./A/b/c/*.js"]), - exports_field: exports_field(json!({ - "./a/foo-foo/c.js": "./A/b/c/*.js" - })), - request: "./a/foo-foo/c.js", - condition_names: vec![], - }, - ]; - - for case in test_cases { - let resolved = Resolver::new(ResolveOptions { - condition_names: case - .condition_names - .iter() - .map(ToString::to_string) - .collect::>(), - ..ResolveOptions::default() - }) - .package_exports_resolve( - Path::new(""), - case.request, - &case.exports_field, - &mut Ctx::default(), - ) - .map(|p| p.map(|p| p.to_path_buf())); - if let Some(expect) = case.expect { - if expect.is_empty() { - assert!( - matches!(resolved, Err(ResolveError::PackagePathNotExported(_, _))), - "{} {:?}", - &case.name, - &resolved - ); - } else { - for expect in expect { - assert_eq!(resolved, Ok(Some(Path::new(expect).normalize())), "{}", &case.name); - } - } - } else { - assert!(resolved.is_err(), "{} {resolved:?}", &case.name); - } - } -} diff --git a/src/tests/extension_alias.rs b/src/tests/extension_alias.rs deleted file mode 100644 index 86afab73..00000000 --- a/src/tests/extension_alias.rs +++ /dev/null @@ -1,66 +0,0 @@ -//! - -use crate::{ResolveError, ResolveOptions, Resolver}; - -#[test] -fn extension_alias() { - let f = super::fixture().join("extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - extension_alias: vec![ - (".js".into(), vec![".ts".into(), ".js".into()]), - (".mjs".into(), vec![".mts".into()]), - ], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should alias fully specified file", f.clone(), "./index.js", f.join("index.ts")), - ("should alias fully specified file when there are two alternatives", f.clone(), "./dir/index.js", f.join("dir/index.ts")), - ("should also allow the second alternative", f.clone(), "./dir2/index.js", f.join("dir2/index.js")), - ("should support alias option without an array", f.clone(), "./dir2/index.mjs", f.join("dir2/index.mts")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } - - #[rustfmt::skip] - let fail = [ - ("should not allow to fallback to the original extension or add extensions", f, "./index.mjs"), - ]; - - for (comment, path, request) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!(resolution, Err(ResolveError::ExtensionAlias), "{comment} {path:?} {request}"); - } -} - -// should not apply extension alias to extensions or mainFiles field -#[test] -fn not_apply_to_extension_nor_main_files() { - let f = super::fixture().join("extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - extension_alias: vec![(".js".into(), vec![])], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("directory", f.clone(), "./dir2", "dir2/index.js"), - ("file", f.clone(), "./dir2/index", "dir2/index.js"), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - let expected = f.join(expected); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} diff --git a/src/tests/extensions.rs b/src/tests/extensions.rs deleted file mode 100644 index 1ebd86f4..00000000 --- a/src/tests/extensions.rs +++ /dev/null @@ -1,125 +0,0 @@ -//! - -use crate::{EnforceExtension, Resolution, ResolveContext, ResolveError, ResolveOptions, Resolver}; -use rustc_hash::FxHashSet; - -#[test] -fn extensions() { - let f = super::fixture().join("extensions"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".ts".into(), ".js".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve according to order of provided extensions", "./foo", "foo.ts"), - ("should resolve according to order of provided extensions (dir index)", "./dir", "dir/index.ts"), - ("should resolve according to main field in module root", ".", "index.js"), - // This is a core module - // ("should resolve single file module before directory", "module", "node_modules/module.js"), - ("should resolve trailing slash directory before single file", "module/", "node_modules/module/index.ts"), - ]; - - for (comment, request, expected_path) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - let expected = f.join(expected_path); - assert_eq!(resolved_path, Ok(expected), "{comment} {request} {expected_path}"); - } - - #[rustfmt::skip] - let fail = [ - ("not resolve to file when request has a trailing slash (relative)", "./foo.js/", "./foo.js/".into()) - ]; - - for (comment, request, expected_error) in fail { - let resolution = resolver.resolve(&f, request); - let error = ResolveError::NotFound(expected_error); - assert_eq!(resolution, Err(error), "{comment} {request} {resolution:?}"); - } -} - -// should default enforceExtension to true when extensions includes an empty string -#[test] -fn default_enforce_extension() { - let f = super::fixture().join("extensions"); - - let mut ctx = ResolveContext::default(); - let resolved = Resolver::new(ResolveOptions { - extensions: vec![".ts".into(), String::new(), ".js".into()], - ..ResolveOptions::default() - }) - .resolve_with_context(&f, "./foo", &mut ctx); - - assert_eq!(resolved.map(Resolution::into_path_buf), Ok(f.join("foo.ts"))); - assert_eq!( - ctx.file_dependencies, - FxHashSet::from_iter([f.join("foo.ts"), f.join("package.json")]) - ); - assert!(ctx.missing_dependencies.is_empty()); -} - -// should respect enforceExtension when extensions includes an empty string -#[test] -fn respect_enforce_extension() { - let f = super::fixture().join("extensions"); - - let mut ctx = ResolveContext::default(); - let resolved = Resolver::new(ResolveOptions { - enforce_extension: EnforceExtension::Disabled, - extensions: vec![".ts".into(), String::new(), ".js".into()], - ..ResolveOptions::default() - }) - .resolve_with_context(&f, "./foo", &mut ctx); - - assert_eq!(resolved.map(Resolution::into_path_buf), Ok(f.join("foo.ts"))); - assert_eq!( - ctx.file_dependencies, - FxHashSet::from_iter([f.join("foo.ts"), f.join("package.json")]) - ); - assert_eq!(ctx.missing_dependencies, FxHashSet::from_iter([f.join("foo")])); -} - -#[test] -fn multi_dot_extension() { - let f = super::fixture().join("extensions"); - - let resolver = Resolver::new(ResolveOptions { - // Test for `.d.ts`, not part of enhanced-resolve. - extensions: vec![".a.b.c".into(), ".d.ts".into(), ".ts".into(), ".js".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve according to order of provided extensions", "./foo", "foo.ts"), - ("should resolve file with extension", "./app.module", "app.module.js") - ]; - - for (comment, request, expected_path) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - let expected = f.join(expected_path); - assert_eq!(resolved_path, Ok(expected), "{comment} {request} {expected_path}"); - } - - #[rustfmt::skip] - let fail = [ - ("not resolve to file", "./index.", "./index.".into()) - ]; - - for (comment, request, expected_error) in fail { - let resolution = resolver.resolve(&f, request); - let error = ResolveError::NotFound(expected_error); - assert_eq!(resolution, Err(error), "{comment} {request} {resolution:?}"); - } -} - -#[test] -#[should_panic = "All extensions must start with a leading dot"] -fn without_leading_dot() { - Resolver::new(ResolveOptions { - extensions: vec!["ts".into(), "js".into()], - ..ResolveOptions::default() - }); -} diff --git a/src/tests/fallback.rs b/src/tests/fallback.rs deleted file mode 100644 index 3da2d767..00000000 --- a/src/tests/fallback.rs +++ /dev/null @@ -1,100 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/fallback.test.js - -#[test] -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -fn fallback() { - use super::memory_fs::MemoryFS; - use crate::{AliasValue, ResolveError, ResolveOptions, ResolverGeneric}; - use std::path::{Path, PathBuf}; - - let f = Path::new("/"); - - let file_system = MemoryFS::new(&[ - ("/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", ""), - ]); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - fallback: vec![ - ("aliasA".into(), vec![AliasValue::Path("a".into())]), - ("b$".into(), vec![AliasValue::Path("a/index".into())]), - ("c$".into(), vec![AliasValue::Path("/a/index".into())]), - ( - "multiAlias".into(), - vec![ - AliasValue::Path("b".into()), - AliasValue::Path("c".into()), - AliasValue::Path("d".into()), - AliasValue::Path("e".into()), - AliasValue::Path("a".into()), - ], - ), - ("recursive".into(), vec![AliasValue::Path("recursive/dir".into())]), - ("/d/dir".into(), vec![AliasValue::Path("/c/dir".into())]), - ("/d/index.js".into(), vec![AliasValue::Path("/c/index".into())]), - ("ignored".into(), vec![AliasValue::Ignore]), - ("node:path".into(), vec![AliasValue::Ignore]), - ], - modules: vec!["/".into()], - ..ResolveOptions::default() - }, - ); - - #[rustfmt::skip] - let pass = [ - ("should resolve a not aliased module 1", "a", "/a/index"), - ("should resolve a not aliased module 2", "a/index", "/a/index"), - ("should resolve a not aliased module 3", "a/dir", "/a/dir/index"), - ("should resolve a not aliased module 4", "a/dir/index", "/a/dir/index"), - ("should resolve an fallback module 1", "aliasA", "/a/index"), - ("should resolve an fallback module 2", "aliasA/index", "/a/index"), - ("should resolve an fallback module 3", "aliasA/dir", "/a/dir/index"), - ("should resolve an fallback module 4", "aliasA/dir/index", "/a/dir/index"), - ("should resolve a recursive aliased module 1", "recursive", "/recursive/index"), - ("should resolve a recursive aliased module 2", "recursive/index", "/recursive/index"), - ("should resolve a recursive aliased module 3", "recursive/dir", "/recursive/dir/index"), - ("should resolve a recursive aliased module 4", "recursive/dir/index", "/recursive/dir/index"), - ("should resolve a recursive aliased module 5", "recursive/file", "/recursive/dir/file"), - ("should resolve a file aliased module with a query 1", "b?query", "/b/index?query"), - ("should resolve a file aliased module with a query 2", "c?query", "/c/index?query"), - ("should resolve a path in a file aliased module 1", "b/index", "/b/index"), - ("should resolve a path in a file aliased module 2", "b/dir", "/b/dir/index"), - ("should resolve a path in a file aliased module 3", "b/dir/index", "/b/dir/index"), - ("should resolve a path in a file aliased module 4", "c/index", "/c/index"), - ("should resolve a path in a file aliased module 5", "c/dir", "/c/dir/index"), - ("should resolve a path in a file aliased module 6", "c/dir/index", "/c/dir/index"), - ("should resolve a file in multiple aliased dirs 1", "multiAlias/dir/file", "/e/dir/file"), - ("should resolve a file in multiple aliased dirs 2", "multiAlias/anotherDir", "/e/anotherDir/index"), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - - #[rustfmt::skip] - let ignore = [ - ("should resolve an ignore module", "ignored", ResolveError::Ignored(f.join("ignored"))), - ("should resolve node: builtin module", "node:path", ResolveError::Ignored(PathBuf::from("/node:path"))), - ]; - - for (comment, request, expected) in ignore { - let resolution = resolver.resolve(f, request); - assert_eq!(resolution, Err(expected), "{comment} {request}"); - } -} diff --git a/src/tests/full_specified.rs b/src/tests/full_specified.rs deleted file mode 100644 index a70c0191..00000000 --- a/src/tests/full_specified.rs +++ /dev/null @@ -1,113 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/fullSpecified.test.js - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows { - use std::path::PathBuf; - - use crate::{AliasValue, ResolveOptions, ResolverGeneric}; - - use super::super::memory_fs::MemoryFS; - - fn file_system() -> MemoryFS { - MemoryFS::new(&[ - ("/a/node_modules/package1/index.js", ""), - ("/a/node_modules/package1/file.js", ""), - ("/a/node_modules/package2/package.json", r#"{"main":"a"}"#), - ("/a/node_modules/package2/a.js", ""), - ("/a/node_modules/package3/package.json", r#"{"main":"dir"}"#), - ("/a/node_modules/package3/dir/index.js", ""), - ("/a/node_modules/package4/package.json", r#"{"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", ""), - ]) - } - - #[test] - fn test() { - let file_system = file_system(); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - alias: vec![ - ("alias1".into(), vec![AliasValue::from("/a/abc")]), - ("alias2".into(), vec![AliasValue::from("/a")]), - ], - alias_fields: vec![vec!["browser".into()]], - fully_specified: true, - ..ResolveOptions::default() - }, - ); - - let failing_resolves = [ - ("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"), - ]; - - for (comment, request) in failing_resolves { - let resolution = resolver.resolve("/a", request); - assert!(resolution.is_err(), "{comment} {request}"); - } - - let successful_resolves = [ - ("fully relative", "./abc.js", "/a/abc.js"), - ("fully absolute", "/a/abc.js", "/a/abc.js"), - ("fully relative in package", "package1/file.js", "/a/node_modules/package1/file.js"), - ("extensions in mainFiles", "package1", "/a/node_modules/package1/index.js"), - ("extensions in mainFields", "package2", "/a/node_modules/package2/a.js"), - ("extensions in alias", "alias1", "/a/abc.js"), - ("directories in alias", "alias2", "/a/index.js"), - ("directories in packages", "package3", "/a/node_modules/package3/dir/index.js"), - ("extensions in aliasFields", "package4/a.js", "/a/node_modules/package4/b.js"), - ]; - - for (comment, request, expected) in successful_resolves { - let resolution = resolver.resolve("/a", request).map(|r| r.full_path()); - assert_eq!(resolution, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - } - - #[test] - #[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. - fn resolve_to_context() { - let file_system = file_system(); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - alias: vec![ - ("alias1".into(), vec![AliasValue::from("/a/abc")]), - ("alias2".into(), vec![AliasValue::from("/a")]), - ], - alias_fields: vec![vec!["browser".into()]], - fully_specified: true, - resolve_to_context: true, - ..ResolveOptions::default() - }, - ); - - let successful_resolves = [ - ("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", "/a/node_modules/package3/dir"), - ]; - - for (comment, request, expected) in successful_resolves { - let resolution = resolver.resolve("/a", request).map(|r| r.full_path()); - assert_eq!(resolution, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - } -} diff --git a/src/tests/imports_field.rs b/src/tests/imports_field.rs deleted file mode 100644 index 9f9a9726..00000000 --- a/src/tests/imports_field.rs +++ /dev/null @@ -1,1320 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/importsField.test.js -//! -//! The huge imports field test cases are at the bottom of this file. - -use serde_json::json; - -use crate::{Ctx, JSONMap, PathUtil, ResolveError, ResolveOptions, Resolver}; -use std::path::Path; - -#[test] -fn test_simple() { - let f = super::fixture().join("imports-field"); - let f2 = super::fixture().join("imports-exports-wildcard/node_modules/m/"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve using imports field instead of self-referencing", f.clone(), "#imports-field", f.join("b.js")), - ("should resolve using imports field instead of self-referencing for a subpath", f.join("dir"), "#imports-field", f.join("b.js")), - ("should resolve package #1", f.clone(), "#a/dist/main.js", f.join("node_modules/a/lib/lib2/main.js")), - ("should resolve package #3", f.clone(), "#ccc/index.js", f.join("node_modules/c/index.js")), - ("should resolve package #4", f.clone(), "#c", f.join("node_modules/c/index.js")), - ("should resolve with wildcard pattern", f2.clone(), "#internal/i.js", f2.join("src/internal/i.js")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } - - // Note added: - // * should resolve absolute path as an imports field target - // * should log the correct info - - #[rustfmt::skip] - let fail = [ - ("should disallow resolve out of package scope", f.clone(), "#b", ResolveError::InvalidPackageTarget("../b.js".to_string(), "#b".to_string(), f.join("package.json"))), - ("should resolve package #2", f.clone(), "#a", ResolveError::PackageImportNotDefined("#a".to_string(), f.join("package.json"))), - ]; - - for (comment, path, request, error) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!(resolution, Err(error), "{comment} {path:?} {request}"); - } -} - -#[test] -fn shared_resolvers() { - let f = super::fixture().join("imports-field"); - - // field name #1 - let resolver1 = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - imports_fields: vec![vec!["imports".into()]], - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - let resolved_path = resolver1.resolve(&f, "#imports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("b.js"))); - - // field name #2 - let resolver2 = resolver1.clone_with_options(ResolveOptions { - imports_fields: vec![vec!["other".into(), "imports".into()]], - ..ResolveOptions::default() - }); - - let resolved_path = resolver2.resolve(&f, "#b").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("a.js"))); -} - -// Small script for generating the test cases from enhanced_resolve -// for (c of testCases) { -// console.log("TestCase {") -// console.log(`name: ${JSON.stringify(c.name)},`) -// if (c.expect instanceof Error) { -// console.log(`expect: None,`) -// } else { -// console.log(`expect: Some(vec!${JSON.stringify(c.expect)}),`) -// } -// console.log(`imports_field: imports_field(json!(${JSON.stringify(c.suite[0], null, 2)})),`) -// console.log(`request: "${c.suite[1]}",`) -// console.log(`condition_names: vec!${JSON.stringify(c.suite[2])},`) -// console.log("},") -// } - -struct TestCase { - name: &'static str, - expect: Option>, - imports_field: JSONMap, - request: &'static str, - condition_names: Vec<&'static str>, -} - -#[allow(clippy::needless_pass_by_value)] -fn imports_field(value: serde_json::Value) -> JSONMap { - let s = serde_json::to_string(&value).unwrap(); - serde_json::from_str(&s).unwrap() -} - -#[test] -fn test_cases() { - let test_cases = [ - TestCase { - name: "sample #1", - expect: Some(vec!["./dist/test/file.js"]), - imports_field: imports_field(json!({ - "#abc/": { - "import": [ - "./dist/", - "./src/" - ], - "webpack": "./wp/" - }, - "#abc": "./main.js" - })), - request: "#abc/test/file.js", - condition_names: vec!["import", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "sample #1", - expect: Some(vec!["./src/test/file.js"]), - imports_field: imports_field(json!({ - "#abc/": { - "import": [ - "./src/" - ], - "webpack": "./wp/" - }, - "#abc": "./main.js" - })), - request: "#abc/test/file.js", - condition_names: vec!["import", "webpack"], - }, - TestCase { - name: "sample #2", - expect: Some(vec!["./data/timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#1/timezones/": "./data/timezones/" - })), - request: "#1/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #3", - expect: Some(vec!["./data/timezones/timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#aaa/": "./data/timezones/", - "#a/": "./data/timezones/" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #4", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/lib/": { - "browser": [ - "./browser/" - ] - }, - "#a/dist/index.js": { - "node": "./index.js" - } - })), - request: "#a/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #5", - expect: Some(vec!["./browser/index.js"]), - imports_field: imports_field(json!({ - "#a/lib/": { - "browser": [ - "./browser/" - ] - }, - "#a/dist/index.js": { - "node": "./index.js", - "default": "./browser/index.js" - } - })), - request: "#a/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #6", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/dist/a": "./dist/index.js" - })), - request: "#a/dist/aaa", - condition_names: vec![], - }, - TestCase { - name: "sample #7", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/a/a/": "./dist/index.js" - })), - request: "#a/a/a", - condition_names: vec![], - }, - TestCase { - name: "sample #8", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": "./index.js" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #9", - expect: Some(vec!["./main.js"]), - imports_field: imports_field(json!({ - "#a/index.js": "./main.js" - })), - request: "#a/index.js", - condition_names: vec![], - }, - TestCase { - name: "sample #10", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #11", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/bar#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #12", - expect: Some(vec!["./ok.js#abc"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/ok.js#abc", - condition_names: vec![], - }, - TestCase { - name: "sample #13", - expect: Some(vec!["./ok.js?abc"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/ok.js?abc", - condition_names: vec![], - }, - TestCase { - name: "sample #14", - expect: Some(vec!["./🎉.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/🎉.js", - condition_names: vec![], - }, - TestCase { - name: "sample #15", - expect: Some(vec!["./%F0%9F%8E%89.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/%F0%9F%8E%89.js", - condition_names: vec![], - }, - TestCase { - name: "sample #16", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/🎉", - condition_names: vec![], - }, - TestCase { - name: "sample #17", - expect: Some(vec!["./other.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/%F0%9F%8E%89", - condition_names: vec![], - }, - TestCase { - name: "sample #18", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/module", - condition_names: vec![], - }, - TestCase { - name: "sample #19", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/module#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #20", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/module?foo", - condition_names: vec![], - }, - TestCase { - name: "sample #21", - expect: Some(vec!["./d?e?f"]), - imports_field: imports_field(json!({ - "#a/a?b?c/": "./" - })), - request: "#a/a?b?c/d?e?f", - condition_names: vec![], - }, - TestCase { - name: "sample #22", - // We throw InvalidPackageTarget - expect: None, - // expect: Some(vec!["/user/a/index"]), - imports_field: imports_field(json!({ - "#a/": "/user/a/" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #1", - expect: Some(vec!["./A/b/d.js"]), - imports_field: imports_field(json!({ - "#a/": "./A/", - "#a/b/c": "./c.js" - })), - request: "#a/b/d.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #2", - expect: Some(vec!["./A/c.js"]), - imports_field: imports_field(json!({ - "#a/": "./A/", - "#a/b": "./b.js" - })), - request: "#a/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #3", - expect: Some(vec!["./A/b/c/d.js"]), - imports_field: imports_field(json!({ - "#a/": "./A/", - "#a/b/c/d": "./c.js" - })), - request: "#a/b/c/d.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #1", - expect: Some(vec!["./dist/index.js"]), - imports_field: imports_field(json!({ - "#a": "./dist/index.js" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #2", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": "./" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #3", - expect: Some(vec!["./dist/a.js"]), - imports_field: imports_field(json!({ - "#a/": "./dist/", - "#a/index.js": "./dist/a.js" - })), - request: "#a/index.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #4", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "./browser/" - ] - }, - "#a/index.js": { - "browser": "./index.js" - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #5", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "./browser/" - ] - }, - "#a/index.js": { - "node": "./node.js" - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #6", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: "#a", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #7", - expect: None, - imports_field: imports_field(json!({ - "#a": { - "default": "./src/index.js", - "browser": "./index.js", - "node": "./src/node/index.js" - } - })), - request: "#a", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #8", - expect: Some(vec!["./src/index.js"]), - imports_field: imports_field(json!({ - "#a": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #9", - expect: Some(vec!["./index"]), - imports_field: imports_field(json!({ - "#a": "./index" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #10", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/index": "./index.js" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #11", - // We throw InvalidPackageTarget - // expect: Some(vec!["b"]), - expect: None, - imports_field: imports_field(json!({ - "#a": "b" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #12", - // We throw InvalidPackageTarget - // expect: Some(vec!["b/index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "b/" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #13", - // We throw InvalidPackageTarget - // expect: Some(vec!["b#anotherhashishere"]), - expect: None, - imports_field: imports_field(json!({ - "#a?q=a#hashishere": "b#anotherhashishere" - })), - request: "#a?q=a#hashishere", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #1", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #2", - expect: Some(vec!["./import.mjs"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec!["import"], - }, - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./require.js"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./import.mjs"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./require.js"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": [ - "./require.js" - ] - }, - { - "import": [ - "./import.mjs", - "#b/import.js" - ] - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./import.mjs"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "./import.mjs", - "#b/import.js" - ] - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "#b/import.js" - ] - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "mapping to a folder root #1", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#timezones": "./data/timezones/" - })), - request: "#timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #2", - expect: None, - imports_field: imports_field(json!({ - "#timezones/": "./data/timezones" - })), - request: "#timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #3", - expect: Some(vec!["./data/timezones/pdt/index.mjs"]), - imports_field: imports_field(json!({ - "#timezones/pdt/": "./data/timezones/pdt/" - })), - request: "#timezones/pdt/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #4", - expect: Some(vec!["./timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#a/": "./timezones/" - })), - request: "#a/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #5", - expect: Some(vec!["./timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#a/": "./" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #6", - expect: None, - imports_field: imports_field(json!({ - "#a/": "." - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #7", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": "./" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #1", - expect: Some(vec!["./lib/index.mjs"]), - imports_field: imports_field(json!({ - "#a/": "./", - "#a/dist/": "./lib/" - })), - request: "#a/dist/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #2", - expect: Some(vec!["./dist/utils/index.js"]), - imports_field: imports_field(json!({ - "#a/dist/utils/": "./dist/utils/", - "#a/dist/": "./lib/" - })), - request: "#a/dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #3", - expect: Some(vec!["./dist/utils/index.js"]), - imports_field: imports_field(json!({ - "#a/dist/utils/index.js": "./dist/utils/index.js", - "#a/dist/utils/": "./dist/utils/index.mjs", - "#a/dist/": "./lib/" - })), - request: "#a/dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #4", - expect: Some(vec!["./lib/index.mjs"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./browser/" - }, - "#a/dist/": "./lib/" - })), - request: "#a/dist/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #1", - // This behaves differently from enhanced_resolve, because `lodash/` is an an InvalidPackageConfig - // expect: Some(vec!["lodash/index.js"]), - expect: Some(vec!["./utils/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "conditional mapping folder #1", - expect: Some(vec!["./utils/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #2", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./node/" - ] - } - })), - request: "#a/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "conditional mapping folder #3", - expect: Some(vec!["./wpk/index.mjs"]), - imports_field: imports_field(json!({ - "#a/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils/" - ] - } - })), - request: "#a/index.mjs", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "incorrect exports field #1", - // We throw `PackageImportNotDefined` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "/utils/": "./a/" - })), - request: "#a/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #2", - // We throw `PackageImportNotDefined` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "/utils/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#a/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #3", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index": "./a/index.js" - })), - request: "#a/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #4", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index.mjs": "./a/index.js" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #5", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "#a/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #6", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index.mjs": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "#a/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #1", - // We don't throw in `package_imports_exports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": "./a/" - })), - request: "/utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect request #2", - // We don't throw in `package_imports_exports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #3", - // We don't throw in `package_imports_exports_resolve`, it's thrown in `package_imports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #4", - // We don't throw in `package_imports_exports_resolve`, it's thrown in `package_imports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#/", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #5", - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#a/", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #1", - // expect: Some(vec!["./dist/index"]), - expect: Some(vec!["dist/index"]), - imports_field: imports_field(json!({ - "#a/../../utils/": "./dist/" - })), - request: "#a/../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #2", - // We throw InvalidPackageTarget - // expect: Some(vec!["./dist/../../utils/index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "./dist/" - })), - request: "#a/../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #3", - // We throw InvalidPackageTarget - // expect: Some(vec!["../src/index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "../src/" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #4", - // We throw InvalidPackageTarget - // expect: Some(vec!["./utils/../../../index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": { - "browser": "./utils/../../../" - } - })), - request: "#a/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #1", - // expect: Some(vec!["moment/node_modules/lodash/dist/index.js"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": { - "browser": "moment/node_modules/" - } - })), - request: "#a/lodash/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #2", - // We throw InvalidPackageTarget - // expect: Some(vec!["../node_modules/lodash/dist/index.js"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "../node_modules/" - })), - request: "#a/lodash/dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "nested mapping #1", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": "./", - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./node/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "nested mapping #3", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["webpack"], - }, - TestCase { - name: "nested mapping #4", - // We throw NotFound - // expect: Some(vec!["moment/node/index.js"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "moment/node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["node", "browser"], - }, - TestCase { - name: "nested mapping #5", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "node"], - }, - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./node/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - TestCase { - name: "nested mapping #7", - expect: Some(vec!["./y.js"]), - imports_field: imports_field(json!({ - "#a": { - "abc": { - "def": "./x.js" - }, - "ghi": "./y.js" - } - })), - request: "#a", - condition_names: vec!["abc", "ghi"], - }, - TestCase { - name: "nested mapping #8", - // We throw PackageImportNotDefined - // expect: Some(vec![]), - expect: None, - imports_field: imports_field(json!({ - "#a": { - "abc": { - "def": "./x.js", - "default": [] - }, - "ghi": "./y.js" - } - })), - request: "#a", - condition_names: vec!["abc", "ghi"], - }, - ]; - - for case in test_cases { - let resolved = Resolver::default() - .package_imports_exports_resolve( - case.request, - &case.imports_field, - Path::new(""), - true, - &case.condition_names.iter().map(ToString::to_string).collect::>(), - &mut Ctx::default(), - ) - .map(|p| p.map(|p| p.to_path_buf())); - if let Some(expect) = case.expect { - if expect.is_empty() { - assert!(matches!(resolved, Ok(None)), "{} {:?}", &case.name, &resolved); - } else { - for expect in expect { - assert_eq!(resolved, Ok(Some(Path::new(expect).normalize())), "{}", &case.name); - } - } - } else { - assert!(resolved.is_err(), "{} {resolved:?}", &case.name); - } - } -} diff --git a/src/tests/incorrect_description_file.rs b/src/tests/incorrect_description_file.rs deleted file mode 100644 index a5c81796..00000000 --- a/src/tests/incorrect_description_file.rs +++ /dev/null @@ -1,62 +0,0 @@ -//! - -use rustc_hash::FxHashSet; - -use crate::{JSONError, Resolution, ResolveContext, ResolveError, ResolveOptions, Resolver}; - -// should not resolve main in incorrect description file #1 -#[test] -fn incorrect_description_file_1() { - let f = super::fixture().join("incorrect-package"); - let mut ctx = ResolveContext::default(); - let resolution = Resolver::default().resolve_with_context(f.join("pack1"), ".", &mut ctx); - let error = ResolveError::JSON(JSONError { - path: f.join("pack1/package.json"), - message: String::from("EOF while parsing a value at line 3 column 0"), - line: 3, - column: 0, - }); - assert_eq!(resolution, Err(error)); - assert_eq!(ctx.file_dependencies, FxHashSet::from_iter([f.join("pack1/package.json")])); - assert!(ctx.missing_dependencies.is_empty()); -} - -// should not resolve main in incorrect description file #2 -#[test] -fn incorrect_description_file_2() { - let f = super::fixture().join("incorrect-package"); - let resolution = Resolver::default().resolve(f.join("pack2"), "."); - let error = ResolveError::JSON(JSONError { - path: f.join("pack2/package.json"), - message: String::from("EOF while parsing a value at line 1 column 0"), - line: 1, - column: 0, - }); - assert_eq!(resolution, Err(error)); -} - -// should not resolve main in incorrect description file #3 -#[test] -fn incorrect_description_file_3() { - let f = super::fixture().join("incorrect-package"); - let resolution = Resolver::default().resolve(f.join("pack2"), "."); - assert!(resolution.is_err()); -} - -// `enhanced_resolve` does not have this test case -#[test] -fn no_description_file() { - let f = super::fixture_root().join("enhanced_resolve"); - - // has description file - let resolver = Resolver::default(); - assert_eq!( - resolver.resolve(&f, ".").map(Resolution::into_path_buf), - Ok(f.join("lib/index.js")) - ); - - // without description file - let resolver = - Resolver::new(ResolveOptions { description_files: vec![], ..ResolveOptions::default() }); - assert_eq!(resolver.resolve(&f, "."), Err(ResolveError::NotFound(".".into()))); -} diff --git a/src/tests/main_field.rs b/src/tests/main_field.rs deleted file mode 100644 index 3cadc8ce..00000000 --- a/src/tests/main_field.rs +++ /dev/null @@ -1,24 +0,0 @@ -//! Not part of enhanced_resolve's test suite - -use crate::{ResolveOptions, Resolver}; - -#[test] -fn test() { - let f = super::fixture().join("restrictions"); - - let resolver1 = Resolver::new(ResolveOptions { - main_fields: vec!["style".into()], - ..ResolveOptions::default() - }); - - let resolution = resolver1.resolve(&f, "pck2").map(|r| r.full_path()); - assert_eq!(resolution, Ok(f.join("node_modules/pck2/index.css"))); - - let resolver2 = resolver1.clone_with_options(ResolveOptions { - main_fields: vec!["module".into(), "main".into()], - ..ResolveOptions::default() - }); - - let resolution = resolver2.resolve(&f, "pck2").map(|r| r.full_path()); - assert_eq!(resolution, Ok(f.join("node_modules/pck2/module.js"))); -} diff --git a/src/tests/memory_fs.rs b/src/tests/memory_fs.rs deleted file mode 100644 index e4116609..00000000 --- a/src/tests/memory_fs.rs +++ /dev/null @@ -1,74 +0,0 @@ -use std::{ - io, - path::{Path, PathBuf}, -}; - -use crate::{FileMetadata, FileSystem}; - -#[derive(Default)] -pub struct MemoryFS { - fs: vfs::MemoryFS, -} - -impl MemoryFS { - /// # Panics - /// - /// * Fails to create directory - /// * Fails to write file - #[allow(dead_code)] - pub fn new(data: &[(&'static str, &'static str)]) -> Self { - let mut fs = Self { fs: vfs::MemoryFS::default() }; - for (path, content) in data { - fs.add_file(Path::new(path), content); - } - fs - } - - #[allow(dead_code)] - pub fn add_file(&mut self, path: &Path, content: &str) { - use vfs::FileSystem; - let fs = &mut self.fs; - // Create all parent directories - for path in path.ancestors().collect::>().iter().rev() { - let path = path.to_string_lossy(); - if !fs.exists(path.as_ref()).unwrap() { - fs.create_dir(path.as_ref()).unwrap(); - } - } - // Create file - let mut file = fs.create_file(path.to_string_lossy().as_ref()).unwrap(); - file.write_all(content.as_bytes()).unwrap(); - } -} - -impl FileSystem for MemoryFS { - fn read_to_string(&self, path: &Path) -> io::Result { - use vfs::FileSystem; - let mut file = self - .fs - .open_file(path.to_string_lossy().as_ref()) - .map_err(|err| io::Error::new(io::ErrorKind::NotFound, err))?; - let mut buffer = String::new(); - file.read_to_string(&mut buffer).unwrap(); - Ok(buffer) - } - - fn metadata(&self, path: &Path) -> io::Result { - use vfs::FileSystem; - let metadata = self - .fs - .metadata(path.to_string_lossy().as_ref()) - .map_err(|err| io::Error::new(io::ErrorKind::NotFound, err))?; - let is_file = metadata.file_type == vfs::VfsFileType::File; - let is_dir = metadata.file_type == vfs::VfsFileType::Directory; - Ok(FileMetadata::new(is_file, is_dir, false)) - } - - fn symlink_metadata(&self, path: &Path) -> io::Result { - self.metadata(path) - } - - fn canonicalize(&self, _path: &Path) -> io::Result { - Err(io::Error::new(io::ErrorKind::NotFound, "not a symlink")) - } -} diff --git a/src/tests/missing.rs b/src/tests/missing.rs deleted file mode 100644 index 4bf611ef..00000000 --- a/src/tests/missing.rs +++ /dev/null @@ -1,106 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/missing.test.js - -use normalize_path::NormalizePath; - -use crate::{AliasValue, ResolveContext, ResolveOptions, Resolver}; - -#[test] -fn test() { - let f = super::fixture(); - - let data = [ - ( - "./missing-file", - vec![f.join("missing-file"), f.join("missing-file.js"), f.join("missing-file.node")], - ), - ( - "missing-module", - vec![ - f.join("node_modules/missing-module"), - f.parent().unwrap().join("node_modules"), // enhanced-resolve is "node_modules/missing-module" - ], - ), - ( - "missing-module/missing-file", - vec![ - f.join("node_modules/missing-module"), - // f.parent().unwrap().join("node_modules/missing-module"), // we don't report this - ], - ), - ( - "m1/missing-file", - vec![ - f.join("node_modules/m1/missing-file"), - f.join("node_modules/m1/missing-file.js"), - f.join("node_modules/m1/missing-file.node"), - // f.parent().unwrap().join("node_modules/m1"), // we don't report this - ], - ), - ( - "m1/", - vec![ - f.join("node_modules/m1/index"), - f.join("node_modules/m1/index.js"), - f.join("node_modules/m1/index.json"), - f.join("node_modules/m1/index.node"), - ], - ), - ("m1/a", vec![f.join("node_modules/m1/a")]), - ]; - - let resolver = Resolver::default(); - - for (specifier, missing_dependencies) in data { - let mut ctx = ResolveContext::default(); - let _ = resolver.resolve_with_context(&f, specifier, &mut ctx); - - for path in ctx.file_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - } - - for path in missing_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - assert!( - ctx.missing_dependencies.contains(&path), - "{specifier}: {path:?} not in {:?}", - &ctx.missing_dependencies - ); - } - } -} - -#[test] -fn alias_and_extensions() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias: vec![ - ( - "@scope-js/package-name/dir$".into(), - vec![AliasValue::Path(f.join("foo/index.js").to_string_lossy().to_string())], - ), - ( - "react-dom".into(), - vec![AliasValue::Path(f.join("foo/index.js").to_string_lossy().to_string())], - ), - ], - extensions: vec![".server.ts".into()], - - ..ResolveOptions::default() - }); - - let mut ctx = ResolveContext::default(); - let _ = resolver.resolve_with_context(&f, "@scope-js/package-name/dir/router", &mut ctx); - let _ = resolver.resolve_with_context(&f, "react-dom/client", &mut ctx); - - for path in ctx.file_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - } - - for path in ctx.missing_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - if let Some(path) = path.parent() { - assert!(!path.is_file(), "{path:?} must not be a file"); - } - } -} diff --git a/src/tests/mod.rs b/src/tests/mod.rs deleted file mode 100644 index 94e6bd86..00000000 --- a/src/tests/mod.rs +++ /dev/null @@ -1,49 +0,0 @@ -mod alias; -mod browser_field; -mod builtins; -mod dependencies; -mod exports_field; -mod extension_alias; -mod extensions; -mod fallback; -mod full_specified; -mod imports_field; -mod incorrect_description_file; -mod main_field; -mod memory_fs; -mod missing; -mod resolve; -mod restrictions; -mod roots; -mod scoped_packages; -mod simple; -mod symlink; -mod tsconfig_paths; -mod tsconfig_project_references; - -use crate::Resolver; -use std::{env, path::PathBuf, sync::Arc, thread}; - -pub fn fixture_root() -> PathBuf { - env::current_dir().unwrap().join("fixtures") -} - -pub fn fixture() -> PathBuf { - fixture_root().join("enhanced_resolve").join("test").join("fixtures") -} - -#[test] -fn threaded_environment() { - let cwd = env::current_dir().unwrap(); - let resolver = Arc::new(Resolver::default()); - for _ in 0..2 { - _ = thread::spawn({ - let cwd = cwd.clone(); - let resolver = Arc::clone(&resolver); - move || { - _ = resolver.resolve(cwd, "."); - } - }) - .join(); - } -} diff --git a/src/tests/resolve.rs b/src/tests/resolve.rs deleted file mode 100644 index f2dbb88e..00000000 --- a/src/tests/resolve.rs +++ /dev/null @@ -1,119 +0,0 @@ -//! - -use crate::{ResolveError, ResolveOptions, Resolver}; - -#[test] -fn resolve() { - let f = super::fixture(); - - let resolver = Resolver::default(); - - let main1_js_path = f.join("main1.js").to_string_lossy().to_string(); - - #[rustfmt::skip] - let pass = [ - ("absolute path", f.clone(), main1_js_path.as_str(), f.join("main1.js")), - ("file with .js", f.clone(), "./main1.js", f.join("main1.js")), - ("file without extension", f.clone(), "./main1", f.join("main1.js")), - ("another file with .js", f.clone(), "./a.js", f.join("a.js")), - ("another file without extension", f.clone(), "./a", f.join("a.js")), - ("file in module with .js", f.clone(), "m1/a.js", f.join("node_modules/m1/a.js")), - ("file in module without extension", f.clone(), "m1/a", f.join("node_modules/m1/a.js")), - ("another file in module without extension", f.clone(), "complexm/step1", f.join("node_modules/complexm/step1.js")), - ("from submodule to file in sibling module", f.join("node_modules/complexm"), "m2/b.js", f.join("node_modules/m2/b.js")), - ("from nested directory to overwritten file in module", f.join("multiple_modules"), "m1/a.js", f.join("multiple_modules/node_modules/m1/a.js")), - ("from nested directory to not overwritten file in module", f.join("multiple_modules"), "m1/b.js", f.join("node_modules/m1/b.js")), - ("file with query", f.clone(), "./main1.js?query", f.join("main1.js?query")), - ("file with fragment", f.clone(), "./main1.js#fragment", f.join("main1.js#fragment")), - ("file with fragment and query", f.clone(), "./main1.js#fragment?query", f.join("main1.js#fragment?query")), - ("file with query and fragment", f.clone(), "./main1.js?#fragment", f.join("main1.js?#fragment")), - - ("file with query (unicode)", f.clone(), "./测试.js?query", f.join("测试.js?query")), - ("file with fragment (unicode)", f.clone(), "./测试.js#fragment", f.join("测试.js#fragment")), - ("file with fragment and query (unicode)", f.clone(), "./测试.js#fragment?query", f.join("测试.js#fragment?query")), - ("file with query and fragment (unicode)", f.clone(), "./测试.js?#fragment", f.join("测试.js?#fragment")), - - ("file in module with query", f.clone(), "m1/a?query", f.join("node_modules/m1/a.js?query")), - ("file in module with fragment", f.clone(), "m1/a#fragment", f.join("node_modules/m1/a.js#fragment")), - ("file in module with fragment and query", f.clone(), "m1/a#fragment?query", f.join("node_modules/m1/a.js#fragment?query")), - ("file in module with query and fragment", f.clone(), "m1/a?#fragment", f.join("node_modules/m1/a.js?#fragment")), - ("file in module with query and fragment", f.clone(), "m1/a?#fragment", f.join("node_modules/m1/a.js?#fragment")), - ("differ between directory and file, resolve file", f.clone(), "./dirOrFile", f.join("dirOrFile.js")), - ("differ between directory and file, resolve directory", f.clone(), "./dirOrFile/", f.join("dirOrFile/index.js")), - ("find node_modules outside of node_modules", f.join("browser-module/node_modules"), "m1/a", f.join("node_modules/m1/a.js")), - ("don't crash on main field pointing to self", f.clone(), "./main-field-self", f.join("./main-field-self/index.js")), - ("don't crash on main field pointing to self (2)", f.clone(), "./main-field-self2", f.join("./main-field-self2/index.js")), - // enhanced-resolve has `#` prepended with a `\0`, they are removed from the - // following 3 expected test results. - // See https://github.com/webpack/enhanced-resolve#escaping - ("handle fragment edge case (no fragment)", f.clone(), "./no#fragment/#/#", f.join("no#fragment/#/#.js")), - ("handle fragment edge case (fragment)", f.clone(), "./no#fragment/#/", f.join("no.js#fragment/#/")), - ("handle fragment escaping", f.clone(), "./no\0#fragment/\0#/\0##fragment", f.join("no#fragment/#/#.js#fragment")), - - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn issue238_resolve() { - let f = super::fixture().join("issue-238"); - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into(), ".jsx".into(), ".ts".into(), ".tsx".into()], - modules: vec!["src/a".into(), "src/b".into(), "src/common".into(), "node_modules".into()], - ..ResolveOptions::default() - }); - let resolved_path = - resolver.resolve(f.join("src/common"), "config/myObjectFile").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("src/common/config/myObjectFile.js")),); -} - -#[test] -fn prefer_relative() { - let f = super::fixture(); - - let resolver = - Resolver::new(ResolveOptions { prefer_relative: true, ..ResolveOptions::default() }); - - #[rustfmt::skip] - let pass = [ - ("should correctly resolve with preferRelative 1", "main1.js", f.join("main1.js")), - ("should correctly resolve with preferRelative 2", "m1/a.js", f.join("node_modules/m1/a.js")), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } -} - -#[test] -fn resolve_to_context() { - let f = super::fixture(); - let resolver = - Resolver::new(ResolveOptions { resolve_to_context: true, ..ResolveOptions::default() }); - - #[rustfmt::skip] - let data = [ - ("context for fixtures", f.clone(), "./", f.clone()), - ("context for fixtures/lib", f.clone(), "./lib", f.join("lib")), - ("context for fixtures with ..", f.clone(), "./lib/../../fixtures/./lib/..", f.clone()), - ("context for fixtures with query", f.clone(), "./?query", f.clone().with_file_name("fixtures?query")), - ]; - - for (comment, path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn resolve_hash_as_module() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions::default()); - let resolution = resolver.resolve(f, "#a"); - assert_eq!(resolution, Err(ResolveError::NotFound("#a".into()))); -} diff --git a/src/tests/restrictions.rs b/src/tests/restrictions.rs deleted file mode 100644 index 5ba56596..00000000 --- a/src/tests/restrictions.rs +++ /dev/null @@ -1,25 +0,0 @@ -//! - -use crate::{ResolveError, ResolveOptions, Resolver, Restriction}; - -// TODO: regex -// * should respect RegExp restriction -// * should try to find alternative #1 -// * should try to find alternative #2 -// * should try to find alternative #3 - -// should respect string restriction -#[test] -fn restriction1() { - let fixture = super::fixture(); - let f = fixture.join("restrictions"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - restrictions: vec![Restriction::Path(f.clone())], - ..ResolveOptions::default() - }); - - let resolution = resolver.resolve(&f, "pck2"); - assert_eq!(resolution, Err(ResolveError::Restriction(fixture.join("c.js"), f))); -} diff --git a/src/tests/roots.rs b/src/tests/roots.rs deleted file mode 100644 index b50e2a07..00000000 --- a/src/tests/roots.rs +++ /dev/null @@ -1,92 +0,0 @@ -//! - -use std::path::PathBuf; - -use crate::{AliasValue, ResolveError, ResolveOptions, Resolver}; - -fn dirname() -> PathBuf { - super::fixture_root().join("enhanced_resolve").join("test") -} - -#[test] -fn roots() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - alias: vec![("foo".into(), vec![AliasValue::from("/fixtures")])], - roots: vec![dirname(), f.clone()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should respect roots option", "/fixtures/b.js", f.join("b.js")), - ("should try another root option, if it exists", "/b.js", f.join("b.js")), - ("should respect extension", "/fixtures/b", f.join("b.js")), - ("should resolve in directory", "/fixtures/extensions/dir", f.join("extensions/dir/index.js")), - ("should respect aliases", "foo/b", f.join("b.js")), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } - - #[rustfmt::skip] - let fail = [ - ("should not work with relative path", "fixtures/b.js", ResolveError::NotFound("fixtures/b.js".into())) - ]; - - for (comment, request, expected) in fail { - let resolution = resolver.resolve(&f, request); - assert_eq!(resolution, Err(expected), "{comment} {request}"); - } -} - -#[test] -fn resolve_to_context() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - roots: vec![dirname(), f.clone()], - resolve_to_context: true, - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f, "/fixtures/lib").map(|r| r.full_path()); - let expected = f.join("lib"); - assert_eq!(resolved_path, Ok(expected)); -} - -#[test] -fn prefer_absolute() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - alias: vec![("foo".into(), vec![AliasValue::from("/fixtures")])], - roots: vec![dirname(), f.clone()], - prefer_absolute: true, - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve an absolute path (prefer absolute)", f.join("b.js").to_string_lossy().to_string(), f.join("b.js")), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(&f, &request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } -} - -#[test] -fn roots_fall_through() { - let f = super::fixture(); - let absolute_path = f.join("roots_fall_through/index.js"); - let specifier = absolute_path.to_string_lossy(); - let resolution = Resolver::new(ResolveOptions::default().with_root(&f)).resolve(&f, &specifier); - assert_eq!( - resolution.map(super::super::resolution::Resolution::into_path_buf), - Ok(absolute_path) - ); -} diff --git a/src/tests/scoped_packages.rs b/src/tests/scoped_packages.rs deleted file mode 100644 index 8258f00f..00000000 --- a/src/tests/scoped_packages.rs +++ /dev/null @@ -1,25 +0,0 @@ -//! - -use crate::{ResolveOptions, Resolver}; - -#[test] -fn scoped_packages() { - let f = super::fixture().join("scoped"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("main field should work", f.clone(), "@scope/pack1", f.join("./node_modules/@scope/pack1/main.js")), - ("browser field should work", f.clone(), "@scope/pack2", f.join("./node_modules/@scope/pack2/main.js")), - ("folder request should work", f.clone(), "@scope/pack2/lib", f.join("./node_modules/@scope/pack2/lib/index.js")) - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} diff --git a/src/tests/simple.rs b/src/tests/simple.rs deleted file mode 100644 index 08e1238a..00000000 --- a/src/tests/simple.rs +++ /dev/null @@ -1,68 +0,0 @@ -//! - -use std::env; - -use crate::Resolver; - -#[test] -fn simple() { - // mimic `enhanced-resolve/test/simple.test.js` - let dirname = env::current_dir().unwrap().join("fixtures"); - let f = dirname.join("enhanced_resolve/test"); - - let resolver = Resolver::default(); - - let data = [ - ("direct", f.clone(), "../lib/index"), - ("as directory", f, ".."), - ("as module", dirname.clone(), "./enhanced_resolve"), - ]; - - for (comment, path, request) in data { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - let expected = dirname.join("enhanced_resolve/lib/index.js"); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn dashed_name() { - let f = super::fixture(); - - let resolver = Resolver::default(); - - let data = [ - (f.clone(), "dash", f.join("node_modules/dash/index.js")), - (f.clone(), "dash-name", f.join("node_modules/dash-name/index.js")), - (f.join("node_modules/dash"), "dash", f.join("node_modules/dash/index.js")), - (f.join("node_modules/dash"), "dash-name", f.join("node_modules/dash-name/index.js")), - (f.join("node_modules/dash-name"), "dash", f.join("node_modules/dash/index.js")), - (f.join("node_modules/dash-name"), "dash-name", f.join("node_modules/dash-name/index.js")), - ]; - - for (path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{path:?} {request}"); - } -} - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows { - use super::super::memory_fs::MemoryFS; - - use crate::ResolveOptions; - - #[test] - fn no_package() { - use crate::ResolverGeneric; - use std::path::Path; - let f = Path::new("/"); - let file_system = MemoryFS::new(&[]); - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions::default(), - ); - let resolved_path = resolver.resolve(f, "package"); - assert!(resolved_path.is_err()); - } -} diff --git a/src/tests/symlink.rs b/src/tests/symlink.rs deleted file mode 100644 index 7589b560..00000000 --- a/src/tests/symlink.rs +++ /dev/null @@ -1,121 +0,0 @@ -use std::{fs, io, path::Path}; - -use crate::{ResolveOptions, Resolver}; - -#[derive(Debug, Clone, Copy)] -enum FileType { - File, - Dir, -} - -#[allow(unused_variables)] -fn symlink, Q: AsRef>( - original: P, - link: Q, - file_type: FileType, -) -> io::Result<()> { - #[cfg(target_family = "unix")] - { - std::os::unix::fs::symlink(original, link) - } - - #[cfg(target_family = "windows")] - match file_type { - FileType::File => std::os::windows::fs::symlink_file(original, link), - FileType::Dir => std::os::windows::fs::symlink_dir(original, link), - } -} - -fn init(dirname: &Path, temp_path: &Path) -> io::Result<()> { - if temp_path.exists() { - _ = fs::remove_dir_all(temp_path); - } - fs::create_dir(temp_path)?; - symlink(dirname.join("../lib/index.js"), temp_path.join("test"), FileType::File)?; - symlink(dirname.join("../lib"), temp_path.join("test2"), FileType::Dir)?; - fs::remove_file(temp_path.join("test"))?; - fs::remove_file(temp_path.join("test2"))?; - fs::remove_dir(temp_path) -} - -fn create_symlinks(dirname: &Path, temp_path: &Path) -> io::Result<()> { - fs::create_dir(temp_path).unwrap(); - symlink( - dirname.join("../lib/index.js").canonicalize().unwrap(), - temp_path.join("index.js"), - FileType::File, - )?; - symlink(dirname.join("../lib").canonicalize().unwrap(), temp_path.join("lib"), FileType::Dir)?; - symlink(dirname.join("..").canonicalize().unwrap(), temp_path.join("this"), FileType::Dir)?; - symlink(temp_path.join("this"), temp_path.join("that"), FileType::Dir)?; - symlink(Path::new("../../lib/index.js"), temp_path.join("node.relative.js"), FileType::File)?; - symlink( - Path::new("./node.relative.js"), - temp_path.join("node.relative.sym.js"), - FileType::File, - )?; - Ok(()) -} - -fn cleanup_symlinks(temp_path: &Path) { - _ = fs::remove_dir_all(temp_path); -} - -#[test] -fn test() -> io::Result<()> { - let root = super::fixture_root().join("enhanced_resolve"); - let dirname = root.join("test"); - let temp_path = dirname.join("temp"); - if !temp_path.exists() { - let is_admin = init(&dirname, &temp_path).is_ok(); - if !is_admin { - return Ok(()); - } - if let Err(err) = create_symlinks(&dirname, &temp_path) { - cleanup_symlinks(&temp_path); - return Err(err); - } - } - - let resolver_without_symlinks = - Resolver::new(ResolveOptions { symlinks: false, ..ResolveOptions::default() }); - let resolver_with_symlinks = Resolver::default(); - - #[rustfmt::skip] - let pass = [ - ("with a symlink to a file", temp_path.clone(), "./index.js"), - ("with a relative symlink to a file", temp_path.clone(), "./node.relative.js"), - ("with a relative symlink to a symlink to a file", temp_path.clone(), "./node.relative.sym.js"), - ("with a symlink to a directory 1", temp_path.clone(), "./lib/index.js"), - ("with a symlink to a directory 2", temp_path.clone(), "./this/lib/index.js"), - ("with multiple symlinks in the path 1", temp_path.clone(), "./this/test/temp/index.js"), - ("with multiple symlinks in the path 2", temp_path.clone(), "./this/test/temp/lib/index.js"), - ("with multiple symlinks in the path 3", temp_path.clone(), "./this/test/temp/this/lib/index.js"), - ("with a symlink to a directory 2 (chained)", temp_path.clone(), "./that/lib/index.js"), - ("with multiple symlinks in the path 1 (chained)", temp_path.clone(), "./that/test/temp/index.js"), - ("with multiple symlinks in the path 2 (chained)", temp_path.clone(), "./that/test/temp/lib/index.js"), - ("with multiple symlinks in the path 3 (chained)", temp_path.clone(), "./that/test/temp/that/lib/index.js"), - ("with symlinked directory as context 1", temp_path.join( "lib"), "./index.js"), - ("with symlinked directory as context 2", temp_path.join( "this"), "./lib/index.js"), - ("with symlinked directory as context and in path", temp_path.join( "this"), "./test/temp/lib/index.js"), - ("with symlinked directory in context path", temp_path.join( "this/lib"), "./index.js"), - ("with symlinked directory in context path and symlinked file", temp_path.join( "this/test"), "./temp/index.js"), - ("with symlinked directory in context path and symlinked directory", temp_path.join( "this/test"), "./temp/lib/index.js"), - ("with symlinked directory as context 2 (chained)", temp_path.join( "that"), "./lib/index.js"), - ("with symlinked directory as context and in path (chained)", temp_path.join( "that"), "./test/temp/lib/index.js"), - ("with symlinked directory in context path (chained)", temp_path.join( "that/lib"), "./index.js"), - ("with symlinked directory in context path and symlinked file (chained)", temp_path.join( "that/test"), "./temp/index.js"), - ("with symlinked directory in context path and symlinked directory (chained)", temp_path.join( "that/test"), "./temp/lib/index.js") - ]; - - for (comment, path, request) in pass { - let filename = resolver_with_symlinks.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(filename, Ok(root.join("lib/index.js")), "{comment:?}"); - - let resolved_path = - resolver_without_symlinks.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(path.join(request))); - } - - Ok(()) -} diff --git a/src/tests/tsconfig_paths.rs b/src/tests/tsconfig_paths.rs deleted file mode 100644 index 26935b5c..00000000 --- a/src/tests/tsconfig_paths.rs +++ /dev/null @@ -1,507 +0,0 @@ -//! tests for tsconfig-paths -//! -//! Fixtures copied from . - -use std::path::{Path, PathBuf}; - -use crate::{ - ResolveError, ResolveOptions, Resolver, TsConfig, TsconfigOptions, TsconfigReferences, -}; - -// -#[test] -fn tsconfig() { - let f = super::fixture_root().join("tsconfig"); - - #[rustfmt::skip] - let pass = [ - (f.clone(), None, "ts-path", f.join("foo.js")), - (f.join("nested"), None, "ts-path", f.join("nested/test.js")), - (f.join("cases/index"), None, "foo", f.join("node_modules/tsconfig-index/foo.js")), - // This requires reading package.json.tsconfig field - // (f.join("cases/field"), "foo", f.join("node_modules/tsconfig-field/foo.js")) - (f.join("cases/exports"), None, "foo", f.join("node_modules/tsconfig-exports/foo.js")), - (f.join("cases/extends-extension"), None, "foo", f.join("cases/extends-extension/foo.js")), - (f.join("cases/extends-extensionless"), None, "foo", f.join("node_modules/tsconfig-field/foo.js")), - (f.join("cases/extends-paths"), Some("src"), "@/index", f.join("cases/extends-paths/src/index.js")), - (f.join("cases/extends-multiple"), None, "foo", f.join("cases/extends-multiple/foo.js")), - ]; - - for (dir, subdir, request, expected) in pass { - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: dir.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - let path = subdir.map_or(dir.clone(), |subdir| dir.join(subdir)); - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{request} {path:?}"); - } - - #[rustfmt::skip] - let data = [ - (f.join("node_modules/tsconfig-not-used"), "ts-path", Ok(f.join("foo.js"))), - ]; - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - for (path, request, expected) in data { - let resolution = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolution, expected, "{path:?} {request}"); - } -} - -#[test] -fn tsconfig_fallthrough() { - let f = super::fixture_root().join("tsconfig"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "/"); - assert_eq!(resolved_path, Err(ResolveError::NotFound("/".into()))); -} - -#[test] -fn json_with_comments() { - let f = super::fixture_root().join("tsconfig/cases/trailing-comma"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "foo").map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(f.join("bar.js"))); -} - -// -#[test] -fn test_paths() { - let path = Path::new("/foo/tsconfig.json"); - let mut tsconfig_json = serde_json::json!({ - "compilerOptions": { - "paths": { - "jquery": ["node_modules/jquery/dist/jquery"], - "*": ["generated/*"], - "bar/*": ["test/*"], - "bar/baz/*": ["baz/*", "yo/*"], - "@/components/*": ["components/*"], - "url": ["node_modules/my-url"], - } - } - }) - .to_string(); - let tsconfig = TsConfig::parse(true, path, &mut tsconfig_json).unwrap(); - - let data = [ - ("jquery", vec!["/foo/node_modules/jquery/dist/jquery"]), - ("test", vec!["/foo/generated/test"]), - ("test/hello", vec!["/foo/generated/test/hello"]), - ("bar/hi", vec!["/foo/test/hi"]), - ("bar/baz/hi", vec!["/foo/baz/hi", "/foo/yo/hi"]), - ("@/components/button", vec!["/foo/components/button"]), - ("./jquery", vec![]), - ("url", vec!["/foo/node_modules/my-url"]), - ]; - - for (specifier, expected) in data { - let paths = tsconfig.resolve_path_alias(specifier); - let expected = expected.into_iter().map(PathBuf::from).collect::>(); - assert_eq!(paths, expected, "{specifier}"); - } -} - -// -#[test] -fn test_base_url() { - let path = Path::new("/foo/tsconfig.json"); - let mut tsconfig_json = serde_json::json!({ - "compilerOptions": { - "baseUrl": "./src" - } - }) - .to_string(); - let tsconfig = TsConfig::parse(true, path, &mut tsconfig_json).unwrap(); - - let data = [ - ("foo", vec!["/foo/src/foo"]), - ("components/button", vec!["/foo/src/components/button"]), - ("./jquery", vec![]), - ]; - - for (specifier, expected) in data { - let paths = tsconfig.resolve_path_alias(specifier); - let expected = expected.into_iter().map(PathBuf::from).collect::>(); - assert_eq!(paths, expected, "{specifier}"); - } -} - -// -#[test] -fn test_paths_and_base_url() { - let path = Path::new("/foo/tsconfig.json"); - let mut tsconfig_json = serde_json::json!({ - "compilerOptions": { - "baseUrl": "./src", - "paths": { - "*": ["generated/*"], - "bar/*": ["test/*"], - "bar/baz/*": ["baz/*", "yo/*"], - "@/components/*": ["components/*"] - } - } - }) - .to_string(); - let tsconfig = TsConfig::parse(true, path, &mut tsconfig_json).unwrap(); - - let data = [ - ("test", vec!["/foo/src/generated/test", "/foo/src/test"]), - ("test/hello", vec!["/foo/src/generated/test/hello", "/foo/src/test/hello"]), - ("bar/hi", vec!["/foo/src/test/hi", "/foo/src/bar/hi"]), - ("bar/baz/hi", vec!["/foo/src/baz/hi", "/foo/src/yo/hi", "/foo/src/bar/baz/hi"]), - ("@/components/button", vec!["/foo/src/components/button", "/foo/src/@/components/button"]), - ("./jquery", vec![]), - ]; - - for (specifier, expected) in data { - let paths = tsconfig.resolve_path_alias(specifier); - let expected = expected.into_iter().map(PathBuf::from).collect::>(); - assert_eq!(paths, expected, "{specifier}"); - } -} - -// Template variable ${configDir} for substitution of config files directory path -// https://github.com/microsoft/TypeScript/pull/58042 -#[test] -fn test_template_variable() { - let f = super::fixture_root().join("tsconfig"); - let f2 = f.join("cases").join("paths_template_variable"); - - #[rustfmt::skip] - let pass = [ - (f2.clone(), "tsconfig1.json", "foo", f2.join("foo.js")), - (f2.clone(), "tsconfig2.json", "foo", f2.join("foo.js")), - (f.clone(), "tsconfig_template_variable.json", "foo", f.join("foo.js")), - ]; - - for (dir, tsconfig, request, expected) in pass { - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: dir.join(tsconfig), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&dir, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{request} {tsconfig} {dir:?}"); - } -} - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows_test { - use std::path::{Path, PathBuf}; - - use crate::{ - ResolveError, ResolveOptions, ResolverGeneric, TsconfigOptions, TsconfigReferences, - }; - - use super::super::memory_fs::MemoryFS; - - struct OneTest { - name: &'static str, - tsconfig: String, - package_json: Option<(PathBuf, String)>, - main_fields: Option>, - existing_files: Vec<&'static str>, - requested_module: &'static str, - expected_path: &'static str, - extensions: Vec, - } - - impl Default for OneTest { - fn default() -> Self { - Self { - name: "", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/*": ["location/*"] - } - } - }) - .to_string(), - package_json: None, - main_fields: None, - existing_files: vec![], - requested_module: "", - expected_path: "", - extensions: vec![ - ".js".into(), - ".json".into(), - ".node".into(), - ".ts".into(), - ".tsx".into(), - ], - } - } - } - - impl OneTest { - fn resolver(&self, root: &Path) -> ResolverGeneric { - let mut file_system = MemoryFS::default(); - - file_system.add_file(&root.join("tsconfig.json"), &self.tsconfig); - if let Some((path, package_json)) = &self.package_json { - file_system.add_file(&root.join(path).join("package.json"), package_json); - } - for path in &self.existing_files { - file_system.add_file(Path::new(path), ""); - } - - let mut options = ResolveOptions { - extensions: self.extensions.clone(), - tsconfig: Some(TsconfigOptions { - config_file: root.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }; - if let Some(main_fields) = &self.main_fields { - options.main_fields.clone_from(main_fields); - } - - ResolverGeneric::::new_with_file_system(file_system, options) - } - } - - // Path matching tests from tsconfig-paths - // * - // * - #[test] - fn match_path() { - let pass = [ - OneTest { - name: "should locate path that matches with star and exists", - existing_files: vec!["/root/location/mylib/index.ts"], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve to correct path when many are specified", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/*": ["foo1/*", "foo2/*", "location/*", "foo3/*"], - } - } - }) - .to_string(), - existing_files: vec!["/root/location/mylib/index.ts"], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should locate path that matches with star and prioritize pattern with longest prefix", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "*": ["location/*"], - "lib/*": ["location/*"], - } - } - }) - .to_string(), - existing_files: vec![ - "/root/location/lib/mylib/index.ts", - "/root/location/mylib/index.ts", - ], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should locate path that matches with star and exists with extension", - existing_files: vec![ - "/root/location/mylib.myext", - ], - requested_module: "lib/mylib", - extensions: vec![".js".into(), ".myext".into()], - expected_path: "/root/location/mylib.myext", - ..OneTest::default() - }, - OneTest { - name: "should resolve request with extension specified", - existing_files: vec![ - "/root/location/test.jpg", - ], - requested_module: "lib/test.jpg", - expected_path: "/root/location/test.jpg", - ..OneTest::default() - }, - OneTest { - name: "should locate path that matches without star and exists", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/foo": ["location/foo"] - } - } - }) - .to_string(), - existing_files: vec![ - "/root/location/foo.ts", - ], - requested_module: "lib/foo", - expected_path: "/root/location/foo.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve to parent folder when filename is in subfolder", - existing_files: vec![ - "/root/location/mylib/index.ts", - ], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve from main field in package.json", - package_json: Some((PathBuf::from("/root/location/mylib"), serde_json::json!({ - "main": "./kalle.ts" - }).to_string())), - existing_files: vec![ - "/root/location/mylib/kalle.ts", - ], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/kalle.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve from main field in package.json (js)", - package_json: Some((PathBuf::from("/root/location/mylib.js"), serde_json::json!({ - "main": "./kalle.js" - }).to_string())), - existing_files: vec![ - "/root/location/mylib.js/kalle.js", - ], - extensions: vec![".ts".into(), ".js".into()], - requested_module: "lib/mylib.js", - expected_path: "/root/location/mylib.js/kalle.js", - ..OneTest::default() - }, - OneTest { - name: "should resolve from list of fields by priority in package.json", - main_fields: Some(vec!["missing".into(), "browser".into(), "main".into()]), - package_json: Some((PathBuf::from("/root/location/mylibjs"), serde_json::json!({ - "main": "./main.js", - "browser": "./browser.js" - }).to_string())), - existing_files: vec![ - "/root/location/mylibjs/main.js", - "/root/location/mylibjs/browser.js", - ], - extensions: vec![".ts".into(), ".js".into()], - requested_module: "lib/mylibjs", - expected_path: "/root/location/mylibjs/browser.js", - ..OneTest::default() - }, -OneTest { - name: "should ignore field mappings to missing files in package.json", - main_fields: Some(vec!["browser".into(), "main".into()]), - package_json: Some((PathBuf::from("/root/location/mylibjs"), serde_json::json!({ - "main": "./kalle.js", - "browser": "./nope.js" - }).to_string())), - existing_files: vec![ - "/root/location/mylibjs/kalle.js", - ], - extensions: vec![".ts".into(), ".js".into()], - requested_module: "lib/mylibjs", - expected_path: "/root/location/mylibjs/kalle.js", - ..OneTest::default() - }, - // Tests that are not applicable: - // name: "should resolve nested main fields" - // name: "should ignore advanced field mappings in package.json" - // name: "should resolve to with the help of baseUrl when not explicitly set" - // name: "should not resolve with the help of baseUrl when asked not to" - // name: "should resolve main file with cjs file extension" - OneTest { - name: "should resolve .ts from .js alias", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "@/*": ["src/*"] - } - } - }).to_string(), - existing_files: vec![ - "/root/src/foo.ts", - ], - requested_module: "@/foo", // original data was "@/foo.ts" but I don't get why it is the case? - expected_path: "/root/src/foo.ts", // original data was "/root/src/foo" - ..OneTest::default() - }, - ]; - - let root = PathBuf::from("/root"); - - for test in pass { - let resolved_path = - test.resolver(&root).resolve(&root, test.requested_module).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(PathBuf::from(test.expected_path)), "{}", test.name); - } - - let fail = [ - OneTest { - name: "should not locate path that does not match", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/*": ["location/*"] - } - } - }) - .to_string(), - existing_files: vec!["/root/location/mylib"], - requested_module: "lib/mylibjs", - ..OneTest::default() - }, - OneTest { - name: "should not resolve typings file (index.d.ts)", - existing_files: vec!["/root/location/mylib/index.d.ts"], - requested_module: "lib/mylib", - ..OneTest::default() - }, - ]; - - for test in fail { - let resolved_path = - test.resolver(&root).resolve(&root, test.requested_module).map(|f| f.full_path()); - assert_eq!( - resolved_path, - Err(ResolveError::NotFound(test.requested_module.into())), - "{}", - test.name - ); - } - } -} diff --git a/src/tests/tsconfig_project_references.rs b/src/tests/tsconfig_project_references.rs deleted file mode 100644 index b552fefe..00000000 --- a/src/tests/tsconfig_project_references.rs +++ /dev/null @@ -1,101 +0,0 @@ -//! Tests for tsconfig project references - -use crate::{ResolveError, ResolveOptions, Resolver, TsconfigOptions, TsconfigReferences}; - -#[test] -fn auto() { - let f = super::fixture_root().join("tsconfig/cases/project_references"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("app"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - // Test normal paths alias - (f.join("app"), "@/index.ts", f.join("app/aliased/index.ts")), - (f.join("app"), "@/../index.ts", f.join("app/index.ts")), - // Test project reference - (f.join("project_a"), "@/index.ts", f.join("project_a/aliased/index.ts")), - (f.join("project_b/src"), "@/index.ts", f.join("project_b/src/aliased/index.ts")), - // Does not have paths alias - (f.join("project_a"), "./index.ts", f.join("project_a/index.ts")), - (f.join("project_c"), "./index.ts", f.join("project_c/index.ts")), - // Template variable - { - let dir = f.parent().unwrap().join("paths_template_variable"); - (dir.clone(), "foo", dir.join("foo.js")) - } - ]; - - for (path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{request} {path:?}"); - } -} - -#[test] -fn disabled() { - let f = super::fixture_root().join("tsconfig/cases/project_references"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("app"), - references: TsconfigReferences::Disabled, - }), - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - // Test normal paths alias - (f.join("app"), "@/index.ts", Ok(f.join("app/aliased/index.ts"))), - (f.join("app"), "@/../index.ts", Ok(f.join("app/index.ts"))), - // Test project reference - (f.join("project_a"), "@/index.ts", Err(ResolveError::NotFound("@/index.ts".into()))), - (f.join("project_b/src"), "@/index.ts", Err(ResolveError::NotFound("@/index.ts".into()))), - // Does not have paths alias - (f.join("project_a"), "./index.ts", Ok(f.join("project_a/index.ts"))), - (f.join("project_c"), "./index.ts", Ok(f.join("project_c/index.ts"))), - ]; - - for (path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, expected, "{request} {path:?}"); - } -} - -#[test] -fn manual() { - let f = super::fixture_root().join("tsconfig/cases/project_references"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("app"), - references: TsconfigReferences::Paths(vec!["../project_a/conf.json".into()]), - }), - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - // Test normal paths alias - (f.join("app"), "@/index.ts", Ok(f.join("app/aliased/index.ts"))), - (f.join("app"), "@/../index.ts", Ok(f.join("app/index.ts"))), - // Test project reference - (f.join("project_a"), "@/index.ts", Ok(f.join("project_a/aliased/index.ts"))), - (f.join("project_b/src"), "@/index.ts", Err(ResolveError::NotFound("@/index.ts".into()))), - // Does not have paths alias - (f.join("project_a"), "./index.ts", Ok(f.join("project_a/index.ts"))), - (f.join("project_c"), "./index.ts", Ok(f.join("project_c/index.ts"))), - ]; - - for (path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, expected, "{request} {path:?}"); - } -} diff --git a/tests/integration_test.rs b/tests/integration_test.rs deleted file mode 100644 index d369413f..00000000 --- a/tests/integration_test.rs +++ /dev/null @@ -1,102 +0,0 @@ -//! Test public APIs - -use std::{env, path::PathBuf}; - -use oxc_resolver::{EnforceExtension, Resolution, ResolveContext, ResolveOptions, Resolver}; - -fn dir() -> PathBuf { - env::current_dir().unwrap() -} - -fn resolve(specifier: &str) -> Resolution { - let path = dir(); - Resolver::new(ResolveOptions::default()).resolve(path, specifier).unwrap() -} - -#[test] -fn clone() { - let resolution = resolve("./tests/package.json"); - assert_eq!(resolution.clone(), resolution); -} - -#[test] -fn debug() { - let resolution = resolve("./tests/package.json"); - let s = format!("{resolution:?}"); - assert!(!s.is_empty()); -} - -#[test] -fn eq() { - let resolution = resolve("./tests/package.json"); - assert_eq!(resolution, resolution); -} - -#[test] -fn package_json() { - let resolution = resolve("./tests/package.json"); - assert!(resolution - .package_json() - .is_some_and(|json| json.name.as_ref().is_some_and(|name| name == "name"))); -} - -#[cfg(feature = "package_json_raw_json_api")] -#[test] -fn package_json_raw_json_api() { - let resolution = resolve("./tests/package.json"); - assert!(resolution - .package_json() - .unwrap() - .raw_json() - .get("name") - .is_some_and(|name| name == "name")); -} - -#[test] -fn clear_cache() { - let resolver = Resolver::new(ResolveOptions::default()); - resolver.clear_cache(); // exists -} - -#[test] -fn options() { - let resolver = Resolver::new(ResolveOptions::default()); - let options = resolver.options(); - assert!(!format!("{options:?}").is_empty()); -} - -#[test] -fn debug_resolver() { - let resolver = Resolver::new(ResolveOptions::default()); - assert!(!format!("{resolver:?}").is_empty()); -} - -#[test] -fn dependencies() { - let path = dir(); - let mut ctx = ResolveContext::default(); - let _ = Resolver::new(ResolveOptions::default()).resolve_with_context( - path, - "./tests/package.json", - &mut ctx, - ); - assert!(!ctx.file_dependencies.is_empty()); - assert!(ctx.missing_dependencies.is_empty()); -} - -#[test] -fn options_api() { - _ = ResolveOptions::default() - .with_builtin_modules(true) - .with_condition_names(&[]) - .with_extension(".js") - .with_force_extension(EnforceExtension::Auto) - .with_fully_specified(true) - .with_main_field("asdf") - .with_main_file("main") - .with_module("module") - .with_prefer_absolute(true) - .with_prefer_relative(true) - .with_root(PathBuf::new()) - .with_symbolic_link(true); -} diff --git a/tests/package.json b/tests/package.json deleted file mode 100644 index f099adcf..00000000 --- a/tests/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "name": "name" -} diff --git a/tests/resolve_test.rs b/tests/resolve_test.rs deleted file mode 100644 index 554d707c..00000000 --- a/tests/resolve_test.rs +++ /dev/null @@ -1,104 +0,0 @@ -use std::{env, path::PathBuf}; - -use oxc_resolver::{ResolveError, ResolveOptions, Resolver}; - -fn dir() -> PathBuf { - env::current_dir().unwrap() -} - -#[test] -fn chinese() { - let dir = dir(); - let specifier = "./fixtures/misc/中文/中文.js"; - let resolution = Resolver::new(ResolveOptions::default()).resolve(&dir, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(dir.join("fixtures/misc/中文/中文.js")) - ); -} - -#[test] -fn styled_components() { - let dir = dir(); - let path = dir.join("fixtures/pnpm8"); - let module_path = path.join("node_modules/.pnpm/styled-components@6.1.1_react-dom@18.2.0_react@18.2.0/node_modules/styled-components"); - let specifier = "styled-components"; - - // cjs - let options = - ResolveOptions { alias_fields: vec![vec!["browser".into()]], ..ResolveOptions::default() }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/styled-components.browser.cjs.js")) - ); - - // esm - let options = ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - main_fields: vec!["module".into()], - ..ResolveOptions::default() - }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/styled-components.browser.esm.js")) - ); -} - -#[test] -fn axios() { - let dir = dir(); - let path = dir.join("fixtures/pnpm8"); - let module_path = path.join("node_modules/.pnpm/axios@1.6.2/node_modules/axios"); - let specifier = "axios"; - - // default - let options = ResolveOptions::default(); - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("index.js")) - ); - - // browser - let options = ResolveOptions { - condition_names: vec!["browser".into(), "require".into()], - ..ResolveOptions::default() - }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/browser/axios.cjs")) - ); - - // cjs - let options = ResolveOptions { - condition_names: vec!["node".into(), "require".into()], - ..ResolveOptions::default() - }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/node/axios.cjs")) - ); -} - -#[test] -fn postcss() { - let dir = dir(); - let path = dir.join("fixtures/pnpm8"); - let module_path = path.join("node_modules/postcss"); - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - // should ignore "path" - let resolution = resolver.resolve(&module_path, "path"); - assert_eq!(resolution, Err(ResolveError::Ignored(module_path.clone()))); - - // should ignore "./lib/terminal-highlight" - let resolution = resolver.resolve(&module_path, "./lib/terminal-highlight"); - assert_eq!(resolution, Err(ResolveError::Ignored(module_path.join("lib/terminal-highlight")))); -} From 7d90a20fd24682a21faf94ca1cd78163780e3ecc Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Tue, 21 May 2024 12:31:10 +0300 Subject: [PATCH 11/82] squash! --- package.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index a431e48f..85024638 100644 --- a/package.json +++ b/package.json @@ -15,10 +15,10 @@ ] }, "devDependencies": { - "@napi-rs/cli": "^3.0.0-alpha.43", - "@napi-rs/wasm-runtime": "^0.2.0", - "@types/node": "^20.10.4", - "ava": "^6.0.1", - "emnapi": "^1.0.0" + "@napi-rs/cli": "3.0.0-alpha.43", + "@napi-rs/wasm-runtime": "0.2.0", + "@types/node": "20.10.4", + "ava": "6.0.1", + "emnapi": "1.0.0" } } From ae35513a48108d5ce29295025752dd09629e4e7d Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Tue, 21 May 2024 14:07:46 +0300 Subject: [PATCH 12/82] squash! --- package.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 85024638..a3e52400 100644 --- a/package.json +++ b/package.json @@ -16,9 +16,9 @@ }, "devDependencies": { "@napi-rs/cli": "3.0.0-alpha.43", - "@napi-rs/wasm-runtime": "0.2.0", - "@types/node": "20.10.4", - "ava": "6.0.1", - "emnapi": "1.0.0" + "@napi-rs/wasm-runtime": "0.2.4", + "@types/node": "20.12.12", + "ava": "6.1.3", + "emnapi": "1.2.0" } } From 2ec80e69df90d1e8ad723840ece28143f04bef92 Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Sat, 25 May 2024 01:17:09 +0300 Subject: [PATCH 13/82] squash! --- .github/dependabot.yml | 38 +++++++++++ .github/workflows/Dependabot.yml | 45 +++++++++++++ .github/workflows/GitHub.yml | 57 ++++++++++++++++ .github/workflows/NPM.yml | 42 ++++++++++++ .github/workflows/Node.yml | 100 ++++++++++++++++++++++++++++ .github/workflows/Rust.yml | 108 +++++++++++++++++++++++++++++++ 6 files changed, 390 insertions(+) create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/Dependabot.yml create mode 100644 .github/workflows/GitHub.yml create mode 100644 .github/workflows/NPM.yml create mode 100644 .github/workflows/Node.yml create mode 100644 .github/workflows/Rust.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..f02ca757 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,38 @@ +version: 2 +enable-beta-ecosystems: true + +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "daily" + + - package-ecosystem: "cargo" + directory: "/" + schedule: + interval: "daily" + versioning-strategy: lockfile-only + + - package-ecosystem: "cargo" + directory: "/fuzz" + schedule: + interval: "daily" + versioning-strategy: lockfile-only + + - package-ecosystem: "cargo" + directory: "/napi" + schedule: + interval: "daily" + versioning-strategy: lockfile-only + + - package-ecosystem: "npm" + directory: "/npm" + schedule: + interval: "daily" + versioning-strategy: increase + + - package-ecosystem: "npm" + directory: "/" + schedule: + interval: "daily" + versioning-strategy: increase diff --git a/.github/workflows/Dependabot.yml b/.github/workflows/Dependabot.yml new file mode 100644 index 00000000..e6091e54 --- /dev/null +++ b/.github/workflows/Dependabot.yml @@ -0,0 +1,45 @@ +name: Dependabot + +concurrency: + group: Dependabot-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +permissions: + security-events: write + contents: write + pull-requests: write + +on: + workflow_dispatch: + pull_request: + +jobs: + Approve: + runs-on: ubuntu-latest + + if: ${{ github.actor == 'dependabot[bot]' }} + + steps: + - uses: dependabot/fetch-metadata@v2.1.0 + with: + github-token: "${{ secrets.GITHUB_TOKEN }}" + + - run: gh pr review --approve "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} + + Merge: + runs-on: ubuntu-latest + + if: ${{ github.actor == 'dependabot[bot]' }} + + steps: + - uses: dependabot/fetch-metadata@v2.1.0 + with: + github-token: "${{ secrets.GITHUB_TOKEN }}" + + - run: gh pr merge --auto --merge "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} diff --git a/.github/workflows/GitHub.yml b/.github/workflows/GitHub.yml new file mode 100644 index 00000000..5e814e3e --- /dev/null +++ b/.github/workflows/GitHub.yml @@ -0,0 +1,57 @@ +name: GitHub + +concurrency: + group: GitHub-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +permissions: + issues: write + pull-requests: write + +on: + issues: + types: [opened] + pull_request: + types: [opened] + +jobs: + Assign: + runs-on: ubuntu-latest + + env: + ADBLOCK: true + ASTRO_TELEMETRY_DISABLED: 1 + AUTOMATEDLAB_TELEMETRY_OPTOUT: 1 + AZURE_CORE_COLLECT_TELEMETRY: 0 + CHOOSENIM_NO_ANALYTICS: 1 + DIEZ_DO_NOT_TRACK: 1 + DOTNET_CLI_TELEMETRY_OPTOUT: 1 + DOTNET_INTERACTIVE_CLI_TELEMETRY_OPTOUT: 1 + DO_NOT_TRACK: 1 + ET_NO_TELEMETRY: 1 + GATSBY_TELEMETRY_DISABLED: 1 + GATSBY_TELEMETRY_OPTOUT: 1 + GATSBY_TELEMETRY_OPT_OUT: 1 + GRIT_TELEMETRY_DISABLED: 1 + HASURA_GRAPHQL_ENABLE_TELEMETRY: false + HINT_TELEMETRY: off + HOMEBREW_NO_ANALYTICS: 1 + INFLUXD_REPORTING_DISABLED: true + ITERATIVE_DO_NOT_TRACK: 1 + NEXT_TELEMETRY_DEBUG: 1 + NEXT_TELEMETRY_DISABLED: 1 + NG_CLI_ANALYTICS: false + NUXT_TELEMETRY_DISABLED: 1 + PIN_DO_NOT_TRACK: 1 + POWERSHELL_TELEMETRY_OPTOUT: 1 + SAM_CLI_TELEMETRY: 0 + STNOUPGRADE: 1 + STRIPE_CLI_TELEMETRY_OPTOUT: 1 + TELEMETRY_DISABLED: 1 + + steps: + - uses: pozil/auto-assign-issue@v2.0.0 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + assignees: NikolaRHristov + numOfAssignee: 1 diff --git a/.github/workflows/NPM.yml b/.github/workflows/NPM.yml new file mode 100644 index 00000000..788002bc --- /dev/null +++ b/.github/workflows/NPM.yml @@ -0,0 +1,42 @@ +name: NPM + +concurrency: + group: NPM-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +permissions: + security-events: write + contents: write + pull-requests: write + +on: + workflow_dispatch: + release: + types: [created] + workflow_call: + +jobs: + Publish: + runs-on: ubuntu-latest + + permissions: + contents: read + id-token: write + + steps: + - uses: actions/checkout@v4.1.6 + + - uses: actions/setup-node@v4.0.2 + with: + node-version: "18" + registry-url: "https://registry.npmjs.org" + + - run: npm install -g npm + + - name: Publish . + continue-on-error: true + working-directory: . + run: | + npm publish --legacy-peer-deps --provenance --ignore-scripts + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/Node.yml b/.github/workflows/Node.yml new file mode 100644 index 00000000..cfd38750 --- /dev/null +++ b/.github/workflows/Node.yml @@ -0,0 +1,100 @@ +name: Node + +concurrency: + group: Node-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +permissions: + security-events: write + contents: write + pull-requests: write + +on: + workflow_dispatch: + push: + branches: [Current] + pull_request: + branches: [Current] + workflow_call: + +jobs: + Pre-Publish: + runs-on: ubuntu-latest + + env: + ADBLOCK: true + ASTRO_TELEMETRY_DISABLED: 1 + AUTOMATEDLAB_TELEMETRY_OPTOUT: 1 + AZURE_CORE_COLLECT_TELEMETRY: 0 + CHOOSENIM_NO_ANALYTICS: 1 + DIEZ_DO_NOT_TRACK: 1 + DOTNET_CLI_TELEMETRY_OPTOUT: 1 + DOTNET_INTERACTIVE_CLI_TELEMETRY_OPTOUT: 1 + DO_NOT_TRACK: 1 + ET_NO_TELEMETRY: 1 + GATSBY_TELEMETRY_DISABLED: 1 + GATSBY_TELEMETRY_OPTOUT: 1 + GATSBY_TELEMETRY_OPT_OUT: 1 + GRIT_TELEMETRY_DISABLED: 1 + HASURA_GRAPHQL_ENABLE_TELEMETRY: false + HINT_TELEMETRY: off + HOMEBREW_NO_ANALYTICS: 1 + INFLUXD_REPORTING_DISABLED: true + ITERATIVE_DO_NOT_TRACK: 1 + NEXT_TELEMETRY_DEBUG: 1 + NEXT_TELEMETRY_DISABLED: 1 + NG_CLI_ANALYTICS: false + NUXT_TELEMETRY_DISABLED: 1 + PIN_DO_NOT_TRACK: 1 + POWERSHELL_TELEMETRY_OPTOUT: 1 + SAM_CLI_TELEMETRY: 0 + STNOUPGRADE: 1 + STRIPE_CLI_TELEMETRY_OPTOUT: 1 + TELEMETRY_DISABLED: 1 + + strategy: + matrix: + node-version: [18, 19, 20] + + steps: + - uses: actions/checkout@v4.1.6 + + - uses: pnpm/action-setup@v4.0.0 + with: + version: 8.15.5 + run_install: | + - recursive: true + args: [ + --link-workspace-packages=true, + --lockfile-only, + --prefer-frozen-lockfile=false, + --shamefully-hoist=false, + --shared-workspace-lockfile=true, + --strict-peer-dependencies=false, + --unsafe-perm=true + ] + + - uses: actions/setup-node@v4.0.2 + with: + node-version: ${{ matrix.node-version }} + cache: "pnpm" + cache-dependency-path: ./pnpm-lock.yaml + + - run: pnpm install + working-directory: . + + - run: pnpm run build + working-directory: . + + - uses: actions/upload-artifact@v4.3.3 + with: + name: .-Node-${{ matrix.node-version }}-Target + path: ./Target + + - run: pnpm run prepublishOnly + working-directory: . + + - uses: actions/upload-artifact@v4.3.3 + with: + name: .-Node-${{ matrix.node-version }}-Target + path: ./Target diff --git a/.github/workflows/Rust.yml b/.github/workflows/Rust.yml new file mode 100644 index 00000000..1514667c --- /dev/null +++ b/.github/workflows/Rust.yml @@ -0,0 +1,108 @@ +name: Rust + +concurrency: + group: Rust-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +permissions: + security-events: write + +on: + workflow_dispatch: + push: + branches: [Current] + pull_request: + branches: [Current] + workflow_call: + +jobs: + Build: + runs-on: ubuntu-latest + + env: + ADBLOCK: true + ASTRO_TELEMETRY_DISABLED: 1 + AUTOMATEDLAB_TELEMETRY_OPTOUT: 1 + AZURE_CORE_COLLECT_TELEMETRY: 0 + CHOOSENIM_NO_ANALYTICS: 1 + DIEZ_DO_NOT_TRACK: 1 + DOTNET_CLI_TELEMETRY_OPTOUT: 1 + DOTNET_INTERACTIVE_CLI_TELEMETRY_OPTOUT: 1 + DO_NOT_TRACK: 1 + ET_NO_TELEMETRY: 1 + GATSBY_TELEMETRY_DISABLED: 1 + GATSBY_TELEMETRY_OPTOUT: 1 + GATSBY_TELEMETRY_OPT_OUT: 1 + GRIT_TELEMETRY_DISABLED: 1 + HASURA_GRAPHQL_ENABLE_TELEMETRY: false + HINT_TELEMETRY: off + HOMEBREW_NO_ANALYTICS: 1 + INFLUXD_REPORTING_DISABLED: true + ITERATIVE_DO_NOT_TRACK: 1 + NEXT_TELEMETRY_DEBUG: 1 + NEXT_TELEMETRY_DISABLED: 1 + NG_CLI_ANALYTICS: false + NUXT_TELEMETRY_DISABLED: 1 + PIN_DO_NOT_TRACK: 1 + POWERSHELL_TELEMETRY_OPTOUT: 1 + SAM_CLI_TELEMETRY: 0 + STNOUPGRADE: 1 + STRIPE_CLI_TELEMETRY_OPTOUT: 1 + TELEMETRY_DISABLED: 1 + + strategy: + matrix: + toolchain: ["stable", "nightly"] + + steps: + - uses: actions/checkout@v4.1.6 + + - uses: actions-rs/toolchain@v1.0.7 + with: + profile: minimal + toolchain: ${{ matrix.toolchain }} + + - uses: actions/cache@v4.0.2 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + Target/ + key: ${{ runner.os }}-cargo-${{ hashFiles('./Cargo.toml') }} + - uses: actions-rs/cargo@v1.0.3 + with: + command: build + args: --release --all-features --manifest-path ./Cargo.toml + + - uses: actions/cache@v4.0.2 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + Target/ + key: ${{ runner.os }}-cargo-${{ hashFiles('./fuzz/Cargo.toml') }} + - uses: actions-rs/cargo@v1.0.3 + with: + command: build + args: --release --all-features --manifest-path ./fuzz/Cargo.toml + + - uses: actions/cache@v4.0.2 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + Target/ + key: ${{ runner.os }}-cargo-${{ hashFiles('./napi/Cargo.toml') }} + - uses: actions-rs/cargo@v1.0.3 + with: + command: build + args: --release --all-features --manifest-path ./napi/Cargo.toml From a009eb778d3f629f2c83d9a98b88620c57942e71 Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Sun, 26 May 2024 14:19:46 +0300 Subject: [PATCH 14/82] squash! --- FUNDING.yml | 1 + napi/browser.js | 2 +- napi/index.d.ts | 355 ++++++++++--------- napi/index.js | 636 +++++++++++++++++----------------- napi/resolver.wasi-browser.js | 114 +++--- napi/resolver.wasi.cjs | 143 ++++---- napi/test.mjs | 32 +- napi/wasi-worker-browser.mjs | 74 ++-- napi/wasi-worker.mjs | 70 ++-- npm/package.json | 6 +- package.json | 4 +- 11 files changed, 735 insertions(+), 702 deletions(-) create mode 100644 FUNDING.yml diff --git a/FUNDING.yml b/FUNDING.yml new file mode 100644 index 00000000..12f5195d --- /dev/null +++ b/FUNDING.yml @@ -0,0 +1 @@ +open_collective: code-editor-land diff --git a/napi/browser.js b/napi/browser.js index e0a24e7e..12b9ec25 100644 --- a/napi/browser.js +++ b/napi/browser.js @@ -1 +1 @@ -export * from '@oxc-resolver/binding-wasm32-wasi' +export * from "@oxc-resolver/binding-wasm32-wasi"; diff --git a/napi/index.d.ts b/napi/index.d.ts index 77d0c028..dd5dffc1 100644 --- a/napi/index.d.ts +++ b/napi/index.d.ts @@ -2,19 +2,19 @@ /* eslint-disable */ export class ResolverFactory { - constructor(options: NapiResolveOptions) - static default(): ResolverFactory - /** Clone the resolver using the same underlying cache. */ - cloneWithOptions(options: NapiResolveOptions): ResolverFactory - /** Clear the underlying cache. */ - clearCache(): void - sync(path: string, request: string): ResolveResult + constructor(options: NapiResolveOptions); + static default(): ResolverFactory; + /** Clone the resolver using the same underlying cache. */ + cloneWithOptions(options: NapiResolveOptions): ResolverFactory; + /** Clear the underlying cache. */ + clearCache(): void; + sync(path: string, request: string): ResolveResult; } -export const enum EnforceExtension { - Auto = 0, - Enabled = 1, - Disabled = 2 +export enum EnforceExtension { + Auto = 0, + Enabled = 1, + Disabled = 2, } /** @@ -25,158 +25,158 @@ export const enum EnforceExtension { * See [webpack resolve](https://webpack.js.org/configuration/resolve/) for information and examples */ export interface NapiResolveOptions { - /** - * Path to TypeScript configuration file. - * - * Default `None` - */ - tsconfig?: TsconfigOptions - /** - * Alias for [ResolveOptions::alias] and [ResolveOptions::fallback]. - * - * For the second value of the tuple, `None -> AliasValue::Ignore`, Some(String) -> - * AliasValue::Path(String)` - * Create aliases to import or require certain modules more easily. - * A trailing $ can also be added to the given object's keys to signify an exact match. - */ - alias?: Record> - /** - * A list of alias fields in description files. - * Specify a field, such as `browser`, to be parsed according to [this specification](https://github.com/defunctzombie/package-browser-field-spec). - * Can be a path to json object such as `["path", "to", "exports"]`. - * - * Default `[]` - */ - aliasFields?: (string | string[])[] - /** - * Condition names for exports field which defines entry points of a package. - * The key order in the exports field is significant. During condition matching, earlier entries have higher priority and take precedence over later entries. - * - * Default `[]` - */ - conditionNames?: Array - /** - * The JSON files to use for descriptions. (There was once a `bower.json`.) - * - * Default `["package.json"]` - */ - descriptionFiles?: Array - /** - * If true, it will not allow extension-less files. - * So by default `require('./foo')` works if `./foo` has a `.js` extension, - * but with this enabled only `require('./foo.js')` will work. - * - * Default to `true` when [ResolveOptions::extensions] contains an empty string. - * Use `Some(false)` to disable the behavior. - * See - * - * Default None, which is the same as `Some(false)` when the above empty rule is not applied. - */ - enforceExtension?: EnforceExtension - /** - * A list of exports fields in description files. - * Can be a path to json object such as `["path", "to", "exports"]`. - * - * Default `[["exports"]]`. - */ - exportsFields?: (string | string[])[] - /** - * An object which maps extension to extension aliases. - * - * Default `{}` - */ - extensionAlias?: Record> - /** - * Attempt to resolve these extensions in order. - * If multiple files share the same name but have different extensions, - * will resolve the one with the extension listed first in the array and skip the rest. - * - * Default `[".js", ".json", ".node"]` - */ - extensions?: Array - /** - * Redirect module requests when normal resolving fails. - * - * Default `[]` - */ - fallback?: Record> - /** - * 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). - * - * See also webpack configuration [resolve.fullySpecified](https://webpack.js.org/configuration/module/#resolvefullyspecified) - * - * Default `false` - */ - fullySpecified?: boolean - /** - * A list of main fields in description files - * - * Default `["main"]`. - */ - mainFields?: string | string[] - /** - * The filename to be used while resolving directories. - * - * Default `["index"]` - */ - mainFiles?: Array - /** - * A list of directories to resolve modules from, can be absolute path or folder name. - * - * Default `["node_modules"]` - */ - modules?: string | string[] - /** - * Resolve to a context instead of a file. - * - * Default `false` - */ - resolveToContext?: boolean - /** - * Prefer to resolve module requests as relative requests instead of using modules from node_modules directories. - * - * Default `false` - */ - preferRelative?: boolean - /** - * Prefer to resolve server-relative urls as absolute paths before falling back to resolve in ResolveOptions::roots. - * - * Default `false` - */ - preferAbsolute?: boolean - /** - * A list of resolve restrictions to restrict the paths that a request can be resolved on. - * - * Default `[]` - */ - restrictions?: Array - /** - * A list of directories where requests of server-relative URLs (starting with '/') are resolved. - * On non-Windows systems these requests are resolved as an absolute path first. - * - * Default `[]` - */ - roots?: Array - /** - * Whether to resolve symlinks to their symlinked location. - * When enabled, symlinked resources are resolved to their real path, not their symlinked location. - * Note that this may cause module resolution to fail when using tools that symlink packages (like npm link). - * - * Default `true` - */ - symlinks?: boolean - /** - * Whether to parse [module.builtinModules](https://nodejs.org/api/module.html#modulebuiltinmodules) or not. - * For example, "zlib" will throw [crate::ResolveError::Builtin] when set to true. - * - * Default `false` - */ - builtinModules?: boolean + /** + * Path to TypeScript configuration file. + * + * Default `None` + */ + tsconfig?: TsconfigOptions; + /** + * Alias for [ResolveOptions::alias] and [ResolveOptions::fallback]. + * + * For the second value of the tuple, `None -> AliasValue::Ignore`, Some(String) -> + * AliasValue::Path(String)` + * Create aliases to import or require certain modules more easily. + * A trailing $ can also be added to the given object's keys to signify an exact match. + */ + alias?: Record>; + /** + * A list of alias fields in description files. + * Specify a field, such as `browser`, to be parsed according to [this specification](https://github.com/defunctzombie/package-browser-field-spec). + * Can be a path to json object such as `["path", "to", "exports"]`. + * + * Default `[]` + */ + aliasFields?: (string | string[])[]; + /** + * Condition names for exports field which defines entry points of a package. + * The key order in the exports field is significant. During condition matching, earlier entries have higher priority and take precedence over later entries. + * + * Default `[]` + */ + conditionNames?: Array; + /** + * The JSON files to use for descriptions. (There was once a `bower.json`.) + * + * Default `["package.json"]` + */ + descriptionFiles?: Array; + /** + * If true, it will not allow extension-less files. + * So by default `require('./foo')` works if `./foo` has a `.js` extension, + * but with this enabled only `require('./foo.js')` will work. + * + * Default to `true` when [ResolveOptions::extensions] contains an empty string. + * Use `Some(false)` to disable the behavior. + * See + * + * Default None, which is the same as `Some(false)` when the above empty rule is not applied. + */ + enforceExtension?: EnforceExtension; + /** + * A list of exports fields in description files. + * Can be a path to json object such as `["path", "to", "exports"]`. + * + * Default `[["exports"]]`. + */ + exportsFields?: (string | string[])[]; + /** + * An object which maps extension to extension aliases. + * + * Default `{}` + */ + extensionAlias?: Record>; + /** + * Attempt to resolve these extensions in order. + * If multiple files share the same name but have different extensions, + * will resolve the one with the extension listed first in the array and skip the rest. + * + * Default `[".js", ".json", ".node"]` + */ + extensions?: Array; + /** + * Redirect module requests when normal resolving fails. + * + * Default `[]` + */ + fallback?: Record>; + /** + * 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). + * + * See also webpack configuration [resolve.fullySpecified](https://webpack.js.org/configuration/module/#resolvefullyspecified) + * + * Default `false` + */ + fullySpecified?: boolean; + /** + * A list of main fields in description files + * + * Default `["main"]`. + */ + mainFields?: string | string[]; + /** + * The filename to be used while resolving directories. + * + * Default `["index"]` + */ + mainFiles?: Array; + /** + * A list of directories to resolve modules from, can be absolute path or folder name. + * + * Default `["node_modules"]` + */ + modules?: string | string[]; + /** + * Resolve to a context instead of a file. + * + * Default `false` + */ + resolveToContext?: boolean; + /** + * Prefer to resolve module requests as relative requests instead of using modules from node_modules directories. + * + * Default `false` + */ + preferRelative?: boolean; + /** + * Prefer to resolve server-relative urls as absolute paths before falling back to resolve in ResolveOptions::roots. + * + * Default `false` + */ + preferAbsolute?: boolean; + /** + * A list of resolve restrictions to restrict the paths that a request can be resolved on. + * + * Default `[]` + */ + restrictions?: Array; + /** + * A list of directories where requests of server-relative URLs (starting with '/') are resolved. + * On non-Windows systems these requests are resolved as an absolute path first. + * + * Default `[]` + */ + roots?: Array; + /** + * Whether to resolve symlinks to their symlinked location. + * When enabled, symlinked resources are resolved to their real path, not their symlinked location. + * Note that this may cause module resolution to fail when using tools that symlink packages (like npm link). + * + * Default `true` + */ + symlinks?: boolean; + /** + * Whether to parse [module.builtinModules](https://nodejs.org/api/module.html#modulebuiltinmodules) or not. + * For example, "zlib" will throw [crate::ResolveError::Builtin] when set to true. + * + * Default `false` + */ + builtinModules?: boolean; } export interface ResolveResult { - path?: string - error?: string + path?: string; + error?: string; } /** @@ -184,11 +184,11 @@ export interface ResolveResult { * Use struct because napi don't support structured union now */ export interface Restriction { - path?: string - regex?: string + path?: string; + regex?: string; } -export function sync(path: string, request: string): ResolveResult +export function sync(path: string, request: string): ResolveResult; /** * Tsconfig Options @@ -196,19 +196,18 @@ export function sync(path: string, request: string): ResolveResult * Derived from [tsconfig-paths-webpack-plugin](https://github.com/dividab/tsconfig-paths-webpack-plugin#options) */ export interface TsconfigOptions { - /** - * Allows you to specify where to find the TypeScript configuration file. - * You may provide - * * a relative path to the configuration file. It will be resolved relative to cwd. - * * an absolute path to the configuration file. - */ - configFile: string - /** - * Support for Typescript Project References. - * - * * `'auto'`: use the `references` field from tsconfig of `config_file`. - * * `string[]`: manually provided relative or absolute path. - */ - references?: 'auto' | string[] + /** + * Allows you to specify where to find the TypeScript configuration file. + * You may provide + * * a relative path to the configuration file. It will be resolved relative to cwd. + * * an absolute path to the configuration file. + */ + configFile: string; + /** + * Support for Typescript Project References. + * + * * `'auto'`: use the `references` field from tsconfig of `config_file`. + * * `string[]`: manually provided relative or absolute path. + */ + references?: "auto" | string[]; } - diff --git a/napi/index.js b/napi/index.js index a36b6b02..266d783c 100644 --- a/napi/index.js +++ b/napi/index.js @@ -2,339 +2,347 @@ /* eslint-disable */ /* auto-generated by NAPI-RS */ -const { readFileSync } = require('fs') +const { readFileSync } = require("fs"); -let nativeBinding = null -const loadErrors = [] +let nativeBinding = null; +const loadErrors = []; const isMusl = () => { - let musl = false - if (process.platform === 'linux') { - musl = isMuslFromFilesystem() - if (musl === null) { - musl = isMuslFromReport() - } - if (musl === null) { - musl = isMuslFromChildProcess() - } - } - return musl -} + let musl = false; + if (process.platform === "linux") { + musl = isMuslFromFilesystem(); + if (musl === null) { + musl = isMuslFromReport(); + } + if (musl === null) { + musl = isMuslFromChildProcess(); + } + } + return musl; +}; -const isFileMusl = (f) => f.includes('libc.musl-') || f.includes('ld-musl-') +const isFileMusl = (f) => f.includes("libc.musl-") || f.includes("ld-musl-"); const isMuslFromFilesystem = () => { - try { - return readFileSync('/usr/bin/ldd', 'utf-8').includes('musl') - } catch { - return null - } -} + try { + return readFileSync("/usr/bin/ldd", "utf-8").includes("musl"); + } catch { + return null; + } +}; const isMuslFromReport = () => { - const report = typeof process.report.getReport === 'function' ? process.report.getReport() : null - if (!report) { - return null - } - if (report.header && report.header.glibcVersionRuntime) { - return false - } - if (Array.isArray(report.sharedObjects)) { - if (report.sharedObjects.some(isFileMusl)) { - return true - } - } - return false -} + const report = + typeof process.report.getReport === "function" + ? process.report.getReport() + : null; + if (!report) { + return null; + } + if (report.header && report.header.glibcVersionRuntime) { + return false; + } + if (Array.isArray(report.sharedObjects)) { + if (report.sharedObjects.some(isFileMusl)) { + return true; + } + } + return false; +}; const isMuslFromChildProcess = () => { - try { - return require('child_process').execSync('ldd --version', { encoding: 'utf8' }).includes('musl') - } catch (e) { - // If we reach this case, we don't know if the system is musl or not, so is better to just fallback to false - return false - } -} + try { + return require("child_process") + .execSync("ldd --version", { encoding: "utf8" }) + .includes("musl"); + } catch (e) { + // If we reach this case, we don't know if the system is musl or not, so is better to just fallback to false + return false; + } +}; function requireNative() { - if (process.platform === 'android') { - if (process.arch === 'arm64') { - try { - return require('./resolver.android-arm64.node') - } catch (e) { - loadErrors.push(e) - } - try { - return require('@oxc-resolver/binding-android-arm64') - } catch (e) { - loadErrors.push(e) - } - - } else if (process.arch === 'arm') { - try { - return require('./resolver.android-arm-eabi.node') - } catch (e) { - loadErrors.push(e) - } - try { - return require('@oxc-resolver/binding-android-arm-eabi') - } catch (e) { - loadErrors.push(e) - } - - } else { - loadErrors.push(new Error(`Unsupported architecture on Android ${process.arch}`)) - } - } else if (process.platform === 'win32') { - if (process.arch === 'x64') { - try { - return require('./resolver.win32-x64-msvc.node') - } catch (e) { - loadErrors.push(e) - } - try { - return require('@oxc-resolver/binding-win32-x64-msvc') - } catch (e) { - loadErrors.push(e) - } - - } else if (process.arch === 'ia32') { - try { - return require('./resolver.win32-ia32-msvc.node') - } catch (e) { - loadErrors.push(e) - } - try { - return require('@oxc-resolver/binding-win32-ia32-msvc') - } catch (e) { - loadErrors.push(e) - } - - } else if (process.arch === 'arm64') { - try { - return require('./resolver.win32-arm64-msvc.node') - } catch (e) { - loadErrors.push(e) - } - try { - return require('@oxc-resolver/binding-win32-arm64-msvc') - } catch (e) { - loadErrors.push(e) - } - - } else { - loadErrors.push(new Error(`Unsupported architecture on Windows: ${process.arch}`)) - } - } else if (process.platform === 'darwin') { - try { - return require('./resolver.darwin-universal.node') - } catch (e) { - loadErrors.push(e) - } - try { - return require('@oxc-resolver/binding-darwin-universal') - } catch (e) { - loadErrors.push(e) - } - - if (process.arch === 'x64') { - try { - return require('./resolver.darwin-x64.node') - } catch (e) { - loadErrors.push(e) - } - try { - return require('@oxc-resolver/binding-darwin-x64') - } catch (e) { - loadErrors.push(e) - } - - } else if (process.arch === 'arm64') { - try { - return require('./resolver.darwin-arm64.node') - } catch (e) { - loadErrors.push(e) - } - try { - return require('@oxc-resolver/binding-darwin-arm64') - } catch (e) { - loadErrors.push(e) - } - - } else { - loadErrors.push(new Error(`Unsupported architecture on macOS: ${process.arch}`)) - } - } else if (process.platform === 'freebsd') { - if (process.arch === 'x64') { - try { - return require('./resolver.freebsd-x64.node') - } catch (e) { - loadErrors.push(e) - } - try { - return require('@oxc-resolver/binding-freebsd-x64') - } catch (e) { - loadErrors.push(e) - } - - } else if (process.arch === 'arm64') { - try { - return require('./resolver.freebsd-arm64.node') - } catch (e) { - loadErrors.push(e) - } - try { - return require('@oxc-resolver/binding-freebsd-arm64') - } catch (e) { - loadErrors.push(e) - } - - } else { - loadErrors.push(new Error(`Unsupported architecture on FreeBSD: ${process.arch}`)) - } - } else if (process.platform === 'linux') { - if (process.arch === 'x64') { - if (isMusl()) { - try { - return require('./resolver.linux-x64-musl.node') - } catch (e) { - loadErrors.push(e) - } - try { - return require('@oxc-resolver/binding-linux-x64-musl') - } catch (e) { - loadErrors.push(e) - } - - } else { - try { - return require('./resolver.linux-x64-gnu.node') - } catch (e) { - loadErrors.push(e) - } - try { - return require('@oxc-resolver/binding-linux-x64-gnu') - } catch (e) { - loadErrors.push(e) - } - - } - } else if (process.arch === 'arm64') { - if (isMusl()) { - try { - return require('./resolver.linux-arm64-musl.node') - } catch (e) { - loadErrors.push(e) - } - try { - return require('@oxc-resolver/binding-linux-arm64-musl') - } catch (e) { - loadErrors.push(e) - } - - } else { - try { - return require('./resolver.linux-arm64-gnu.node') - } catch (e) { - loadErrors.push(e) - } - try { - return require('@oxc-resolver/binding-linux-arm64-gnu') - } catch (e) { - loadErrors.push(e) - } - - } - } else if (process.arch === 'arm') { - try { - return require('./resolver.linux-arm-gnueabihf.node') - } catch (e) { - loadErrors.push(e) - } - try { - return require('@oxc-resolver/binding-linux-arm-gnueabihf') - } catch (e) { - loadErrors.push(e) - } - - } else if (process.arch === 'riscv64') { - if (isMusl()) { - try { - return require('./resolver.linux-riscv64-musl.node') - } catch (e) { - loadErrors.push(e) - } - try { - return require('@oxc-resolver/binding-linux-riscv64-musl') - } catch (e) { - loadErrors.push(e) - } - - } else { - try { - return require('./resolver.linux-riscv64-gnu.node') - } catch (e) { - loadErrors.push(e) - } - try { - return require('@oxc-resolver/binding-linux-riscv64-gnu') - } catch (e) { - loadErrors.push(e) - } - - } - } else if (process.arch === 's390x') { - try { - return require('./resolver.linux-s390x-gnu.node') - } catch (e) { - loadErrors.push(e) - } - try { - return require('@oxc-resolver/binding-linux-s390x-gnu') - } catch (e) { - loadErrors.push(e) - } + if (process.platform === "android") { + if (process.arch === "arm64") { + try { + return require("./resolver.android-arm64.node"); + } catch (e) { + loadErrors.push(e); + } + try { + return require("@oxc-resolver/binding-android-arm64"); + } catch (e) { + loadErrors.push(e); + } + } else if (process.arch === "arm") { + try { + return require("./resolver.android-arm-eabi.node"); + } catch (e) { + loadErrors.push(e); + } + try { + return require("@oxc-resolver/binding-android-arm-eabi"); + } catch (e) { + loadErrors.push(e); + } + } else { + loadErrors.push( + new Error( + `Unsupported architecture on Android ${process.arch}`, + ), + ); + } + } else if (process.platform === "win32") { + if (process.arch === "x64") { + try { + return require("./resolver.win32-x64-msvc.node"); + } catch (e) { + loadErrors.push(e); + } + try { + return require("@oxc-resolver/binding-win32-x64-msvc"); + } catch (e) { + loadErrors.push(e); + } + } else if (process.arch === "ia32") { + try { + return require("./resolver.win32-ia32-msvc.node"); + } catch (e) { + loadErrors.push(e); + } + try { + return require("@oxc-resolver/binding-win32-ia32-msvc"); + } catch (e) { + loadErrors.push(e); + } + } else if (process.arch === "arm64") { + try { + return require("./resolver.win32-arm64-msvc.node"); + } catch (e) { + loadErrors.push(e); + } + try { + return require("@oxc-resolver/binding-win32-arm64-msvc"); + } catch (e) { + loadErrors.push(e); + } + } else { + loadErrors.push( + new Error( + `Unsupported architecture on Windows: ${process.arch}`, + ), + ); + } + } else if (process.platform === "darwin") { + try { + return require("./resolver.darwin-universal.node"); + } catch (e) { + loadErrors.push(e); + } + try { + return require("@oxc-resolver/binding-darwin-universal"); + } catch (e) { + loadErrors.push(e); + } - } else { - loadErrors.push(new Error(`Unsupported architecture on Linux: ${process.arch}`)) - } - } else { - loadErrors.push(new Error(`Unsupported OS: ${process.platform}, architecture: ${process.arch}`)) - } + if (process.arch === "x64") { + try { + return require("./resolver.darwin-x64.node"); + } catch (e) { + loadErrors.push(e); + } + try { + return require("@oxc-resolver/binding-darwin-x64"); + } catch (e) { + loadErrors.push(e); + } + } else if (process.arch === "arm64") { + try { + return require("./resolver.darwin-arm64.node"); + } catch (e) { + loadErrors.push(e); + } + try { + return require("@oxc-resolver/binding-darwin-arm64"); + } catch (e) { + loadErrors.push(e); + } + } else { + loadErrors.push( + new Error(`Unsupported architecture on macOS: ${process.arch}`), + ); + } + } else if (process.platform === "freebsd") { + if (process.arch === "x64") { + try { + return require("./resolver.freebsd-x64.node"); + } catch (e) { + loadErrors.push(e); + } + try { + return require("@oxc-resolver/binding-freebsd-x64"); + } catch (e) { + loadErrors.push(e); + } + } else if (process.arch === "arm64") { + try { + return require("./resolver.freebsd-arm64.node"); + } catch (e) { + loadErrors.push(e); + } + try { + return require("@oxc-resolver/binding-freebsd-arm64"); + } catch (e) { + loadErrors.push(e); + } + } else { + loadErrors.push( + new Error( + `Unsupported architecture on FreeBSD: ${process.arch}`, + ), + ); + } + } else if (process.platform === "linux") { + if (process.arch === "x64") { + if (isMusl()) { + try { + return require("./resolver.linux-x64-musl.node"); + } catch (e) { + loadErrors.push(e); + } + try { + return require("@oxc-resolver/binding-linux-x64-musl"); + } catch (e) { + loadErrors.push(e); + } + } else { + try { + return require("./resolver.linux-x64-gnu.node"); + } catch (e) { + loadErrors.push(e); + } + try { + return require("@oxc-resolver/binding-linux-x64-gnu"); + } catch (e) { + loadErrors.push(e); + } + } + } else if (process.arch === "arm64") { + if (isMusl()) { + try { + return require("./resolver.linux-arm64-musl.node"); + } catch (e) { + loadErrors.push(e); + } + try { + return require("@oxc-resolver/binding-linux-arm64-musl"); + } catch (e) { + loadErrors.push(e); + } + } else { + try { + return require("./resolver.linux-arm64-gnu.node"); + } catch (e) { + loadErrors.push(e); + } + try { + return require("@oxc-resolver/binding-linux-arm64-gnu"); + } catch (e) { + loadErrors.push(e); + } + } + } else if (process.arch === "arm") { + try { + return require("./resolver.linux-arm-gnueabihf.node"); + } catch (e) { + loadErrors.push(e); + } + try { + return require("@oxc-resolver/binding-linux-arm-gnueabihf"); + } catch (e) { + loadErrors.push(e); + } + } else if (process.arch === "riscv64") { + if (isMusl()) { + try { + return require("./resolver.linux-riscv64-musl.node"); + } catch (e) { + loadErrors.push(e); + } + try { + return require("@oxc-resolver/binding-linux-riscv64-musl"); + } catch (e) { + loadErrors.push(e); + } + } else { + try { + return require("./resolver.linux-riscv64-gnu.node"); + } catch (e) { + loadErrors.push(e); + } + try { + return require("@oxc-resolver/binding-linux-riscv64-gnu"); + } catch (e) { + loadErrors.push(e); + } + } + } else if (process.arch === "s390x") { + try { + return require("./resolver.linux-s390x-gnu.node"); + } catch (e) { + loadErrors.push(e); + } + try { + return require("@oxc-resolver/binding-linux-s390x-gnu"); + } catch (e) { + loadErrors.push(e); + } + } else { + loadErrors.push( + new Error(`Unsupported architecture on Linux: ${process.arch}`), + ); + } + } else { + loadErrors.push( + new Error( + `Unsupported OS: ${process.platform}, architecture: ${process.arch}`, + ), + ); + } } -nativeBinding = requireNative() +nativeBinding = requireNative(); if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) { - try { - nativeBinding = require('./resolver.wasi.cjs') - } catch (err) { - if (process.env.NAPI_RS_FORCE_WASI) { - console.error(err) - } - } - if (!nativeBinding) { - try { - nativeBinding = require('@oxc-resolver/binding-wasm32-wasi') - } catch (err) { - if (process.env.NAPI_RS_FORCE_WASI) { - console.error(err) - } - } - } + try { + nativeBinding = require("./resolver.wasi.cjs"); + } catch (err) { + if (process.env.NAPI_RS_FORCE_WASI) { + console.error(err); + } + } + if (!nativeBinding) { + try { + nativeBinding = require("@oxc-resolver/binding-wasm32-wasi"); + } catch (err) { + if (process.env.NAPI_RS_FORCE_WASI) { + console.error(err); + } + } + } } if (!nativeBinding) { - if (loadErrors.length > 0) { - // TODO Link to documentation with potential fixes - // - The package owner could build/publish bindings for this arch - // - The user may need to bundle the correct files - // - The user may need to re-install node_modules to get new packages - throw new Error('Failed to load native binding', { cause: loadErrors }) - } - throw new Error(`Failed to load native binding`) + if (loadErrors.length > 0) { + // TODO Link to documentation with potential fixes + // - The package owner could build/publish bindings for this arch + // - The user may need to bundle the correct files + // - The user may need to re-install node_modules to get new packages + throw new Error("Failed to load native binding", { cause: loadErrors }); + } + throw new Error(`Failed to load native binding`); } -module.exports.ResolverFactory = nativeBinding.ResolverFactory -module.exports.EnforceExtension = nativeBinding.EnforceExtension -module.exports.sync = nativeBinding.sync +module.exports.ResolverFactory = nativeBinding.ResolverFactory; +module.exports.EnforceExtension = nativeBinding.EnforceExtension; +module.exports.sync = nativeBinding.sync; diff --git a/napi/resolver.wasi-browser.js b/napi/resolver.wasi-browser.js index f587db33..a805795a 100644 --- a/napi/resolver.wasi-browser.js +++ b/napi/resolver.wasi-browser.js @@ -1,70 +1,76 @@ import { - instantiateNapiModuleSync as __emnapiInstantiateNapiModuleSync, - getDefaultContext as __emnapiGetDefaultContext, - WASI as __WASI, -} from '@napi-rs/wasm-runtime' -import { Volume as __Volume, createFsFromVolume as __createFsFromVolume } from '@napi-rs/wasm-runtime/fs' + WASI as __WASI, + getDefaultContext as __emnapiGetDefaultContext, + instantiateNapiModuleSync as __emnapiInstantiateNapiModuleSync, +} from "@napi-rs/wasm-runtime"; +import { + Volume as __Volume, + createFsFromVolume as __createFsFromVolume, +} from "@napi-rs/wasm-runtime/fs"; -import __wasmUrl from './resolver.wasm32-wasi.wasm?url' +import __wasmUrl from "./resolver.wasm32-wasi.wasm?url"; const __fs = __createFsFromVolume( - __Volume.fromJSON({ - '/': null, - }), -) + __Volume.fromJSON({ + "/": null, + }), +); const __wasi = new __WASI({ - version: 'preview1', - fs: __fs, -}) + version: "preview1", + fs: __fs, +}); -const __emnapiContext = __emnapiGetDefaultContext() +const __emnapiContext = __emnapiGetDefaultContext(); const __sharedMemory = new WebAssembly.Memory({ - initial: 1024, - maximum: 10240, - shared: true, -}) + initial: 1024, + maximum: 10240, + shared: true, +}); -const __wasmFile = await fetch(__wasmUrl).then((res) => res.arrayBuffer()) +const __wasmFile = await fetch(__wasmUrl).then((res) => res.arrayBuffer()); const { - instance: __napiInstance, - module: __wasiModule, - napiModule: __napiModule, + instance: __napiInstance, + module: __wasiModule, + napiModule: __napiModule, } = __emnapiInstantiateNapiModuleSync(__wasmFile, { - context: __emnapiContext, - asyncWorkPoolSize: 4, - wasi: __wasi, - onCreateWorker() { - return new Worker(new URL('./wasi-worker-browser.mjs', import.meta.url), { - type: 'module', - }) - }, - overwriteImports(importObject) { - importObject.env = { - ...importObject.env, - ...importObject.napi, - ...importObject.emnapi, - memory: __sharedMemory, - } - return importObject - }, - beforeInit({ instance }) { - __napi_rs_initialize_modules(instance) - }, -}) + context: __emnapiContext, + asyncWorkPoolSize: 4, + wasi: __wasi, + onCreateWorker() { + return new Worker( + new URL("./wasi-worker-browser.mjs", import.meta.url), + { + type: "module", + }, + ); + }, + overwriteImports(importObject) { + importObject.env = { + ...importObject.env, + ...importObject.napi, + ...importObject.emnapi, + memory: __sharedMemory, + }; + return importObject; + }, + beforeInit({ instance }) { + __napi_rs_initialize_modules(instance); + }, +}); function __napi_rs_initialize_modules(__napiInstance) { - __napiInstance.exports['__napi_register__NapiResolveOptions_struct_0']?.() - __napiInstance.exports['__napi_register__EnforceExtension_1']?.() - __napiInstance.exports['__napi_register__Restriction_struct_2']?.() - __napiInstance.exports['__napi_register__TsconfigOptions_struct_3']?.() - __napiInstance.exports['__napi_register__ResolveResult_struct_4']?.() - __napiInstance.exports['__napi_register__sync_5']?.() - __napiInstance.exports['__napi_register__ResolverFactory_struct_6']?.() - __napiInstance.exports['__napi_register__ResolverFactory_impl_12']?.() + __napiInstance.exports["__napi_register__NapiResolveOptions_struct_0"]?.(); + __napiInstance.exports["__napi_register__EnforceExtension_1"]?.(); + __napiInstance.exports["__napi_register__Restriction_struct_2"]?.(); + __napiInstance.exports["__napi_register__TsconfigOptions_struct_3"]?.(); + __napiInstance.exports["__napi_register__ResolveResult_struct_4"]?.(); + __napiInstance.exports["__napi_register__sync_5"]?.(); + __napiInstance.exports["__napi_register__ResolverFactory_struct_6"]?.(); + __napiInstance.exports["__napi_register__ResolverFactory_impl_12"]?.(); } -export const ResolverFactory = __napiModule.exports.ResolverFactory -export const EnforceExtension = __napiModule.exports.EnforceExtension -export const sync = __napiModule.exports.sync +export const ResolverFactory = __napiModule.exports.ResolverFactory; +export const EnforceExtension = __napiModule.exports.EnforceExtension; +export const sync = __napiModule.exports.sync; diff --git a/napi/resolver.wasi.cjs b/napi/resolver.wasi.cjs index 5065a38f..c8e240c3 100644 --- a/napi/resolver.wasi.cjs +++ b/napi/resolver.wasi.cjs @@ -3,84 +3,95 @@ /* auto-generated by NAPI-RS */ -const __nodeFs= require('node:fs') -const __nodePath = require('node:path') -const { WASI: __nodeWASI } = require('node:wasi') -const { Worker } = require('node:worker_threads') +const __nodeFs = require("node:fs"); +const __nodePath = require("node:path"); +const { WASI: __nodeWASI } = require("node:wasi"); +const { Worker } = require("node:worker_threads"); const { - instantiateNapiModuleSync: __emnapiInstantiateNapiModuleSync, - getDefaultContext: __emnapiGetDefaultContext, -} = require('@napi-rs/wasm-runtime') + instantiateNapiModuleSync: __emnapiInstantiateNapiModuleSync, + getDefaultContext: __emnapiGetDefaultContext, +} = require("@napi-rs/wasm-runtime"); const __wasi = new __nodeWASI({ - version: 'preview1', - env: process.env, - preopens: { - '/': '/' - } -}) + version: "preview1", + env: process.env, + preopens: { + "/": "/", + }, +}); -const __emnapiContext = __emnapiGetDefaultContext() +const __emnapiContext = __emnapiGetDefaultContext(); const __sharedMemory = new WebAssembly.Memory({ - initial: 1024, - maximum: 10240, - shared: true, -}) + initial: 1024, + maximum: 10240, + shared: true, +}); -let __wasmFilePath = __nodePath.join(__dirname, 'resolver.wasm32-wasi.wasm') +let __wasmFilePath = __nodePath.join(__dirname, "resolver.wasm32-wasi.wasm"); if (!__nodeFs.existsSync(__wasmFilePath)) { - try { - __wasmFilePath = __nodePath.resolve('@oxc-resolver/binding-wasm32-wasi') - } catch { - throw new Error('Cannot find resolver.wasm32-wasi.wasm file, and @oxc-resolver/binding-wasm32-wasi package is not installed.') - } + try { + __wasmFilePath = __nodePath.resolve( + "@oxc-resolver/binding-wasm32-wasi", + ); + } catch { + throw new Error( + "Cannot find resolver.wasm32-wasi.wasm file, and @oxc-resolver/binding-wasm32-wasi package is not installed.", + ); + } } -const { instance: __napiInstance, module: __wasiModule, napiModule: __napiModule } = __emnapiInstantiateNapiModuleSync(__nodeFs.readFileSync(__wasmFilePath), { - context: __emnapiContext, - asyncWorkPoolSize: (function() { - const threadsSizeFromEnv = Number(process.env.NAPI_RS_ASYNC_WORK_POOL_SIZE ?? process.env.UV_THREADPOOL_SIZE) - // NaN > 0 is false - if (threadsSizeFromEnv > 0) { - return threadsSizeFromEnv - } else { - return 4 - } - })(), - wasi: __wasi, - onCreateWorker() { - return new Worker(__nodePath.join(__dirname, 'wasi-worker.mjs'), { - env: process.env, - execArgv: ['--experimental-wasi-unstable-preview1'], - }) - }, - overwriteImports(importObject) { - importObject.env = { - ...importObject.env, - ...importObject.napi, - ...importObject.emnapi, - memory: __sharedMemory, - } - return importObject - }, - beforeInit({ instance }) { - __napi_rs_initialize_modules(instance) - } -}) +const { + instance: __napiInstance, + module: __wasiModule, + napiModule: __napiModule, +} = __emnapiInstantiateNapiModuleSync(__nodeFs.readFileSync(__wasmFilePath), { + context: __emnapiContext, + asyncWorkPoolSize: (() => { + const threadsSizeFromEnv = Number( + process.env.NAPI_RS_ASYNC_WORK_POOL_SIZE ?? + process.env.UV_THREADPOOL_SIZE, + ); + // NaN > 0 is false + if (threadsSizeFromEnv > 0) { + return threadsSizeFromEnv; + } else { + return 4; + } + })(), + wasi: __wasi, + onCreateWorker() { + return new Worker(__nodePath.join(__dirname, "wasi-worker.mjs"), { + env: process.env, + execArgv: ["--experimental-wasi-unstable-preview1"], + }); + }, + overwriteImports(importObject) { + importObject.env = { + ...importObject.env, + ...importObject.napi, + ...importObject.emnapi, + memory: __sharedMemory, + }; + return importObject; + }, + beforeInit({ instance }) { + __napi_rs_initialize_modules(instance); + }, +}); function __napi_rs_initialize_modules(__napiInstance) { - __napiInstance.exports['__napi_register__NapiResolveOptions_struct_0']?.() - __napiInstance.exports['__napi_register__EnforceExtension_1']?.() - __napiInstance.exports['__napi_register__Restriction_struct_2']?.() - __napiInstance.exports['__napi_register__TsconfigOptions_struct_3']?.() - __napiInstance.exports['__napi_register__ResolveResult_struct_4']?.() - __napiInstance.exports['__napi_register__sync_5']?.() - __napiInstance.exports['__napi_register__ResolverFactory_struct_6']?.() - __napiInstance.exports['__napi_register__ResolverFactory_impl_12']?.() + __napiInstance.exports["__napi_register__NapiResolveOptions_struct_0"]?.(); + __napiInstance.exports["__napi_register__EnforceExtension_1"]?.(); + __napiInstance.exports["__napi_register__Restriction_struct_2"]?.(); + __napiInstance.exports["__napi_register__TsconfigOptions_struct_3"]?.(); + __napiInstance.exports["__napi_register__ResolveResult_struct_4"]?.(); + __napiInstance.exports["__napi_register__sync_5"]?.(); + __napiInstance.exports["__napi_register__ResolverFactory_struct_6"]?.(); + __napiInstance.exports["__napi_register__ResolverFactory_impl_12"]?.(); } -module.exports.ResolverFactory = __napiModule.exports.ResolverFactory -module.exports.EnforceExtension = __napiModule.exports.EnforceExtension -module.exports.sync = __napiModule.exports.sync +module.exports.ResolverFactory = __napiModule.exports.ResolverFactory; +module.exports.EnforceExtension = __napiModule.exports.EnforceExtension; +module.exports.sync = __napiModule.exports.sync; diff --git a/napi/test.mjs b/napi/test.mjs index 2fb069a6..f2af58d6 100644 --- a/napi/test.mjs +++ b/napi/test.mjs @@ -1,30 +1,36 @@ -import path from 'path'; -import resolve, { ResolverFactory } from './index.js'; -import assert from 'assert'; +import assert from "assert"; +import path from "path"; +import resolve, { ResolverFactory } from "./index.js"; -console.log(`Testing on ${process.platform}-${process.arch}`) +console.log(`Testing on ${process.platform}-${process.arch}`); const cwd = process.cwd(); // `resolve` -assert.deepStrictEqual(resolve.sync(cwd, "./index.js").path, path.join(cwd, 'index.js')); +assert.deepStrictEqual( + resolve.sync(cwd, "./index.js").path, + path.join(cwd, "index.js"), +); // `ResolverFactory` const resolver = ResolverFactory.default(); -assert.deepStrictEqual(resolver.sync(cwd, "./index.js").path, path.join(cwd, 'index.js')); +assert.deepStrictEqual( + resolver.sync(cwd, "./index.js").path, + path.join(cwd, "index.js"), +); assert.strict(resolver.sync(cwd, "./ts").error.length > 0); const newResolver = resolver.cloneWithOptions({}); newResolver.clearCache(); - // custom constructor -const resolver2 = new ResolverFactory( - { - extensions: ['.mjs'] - } -); +const resolver2 = new ResolverFactory({ + extensions: [".mjs"], +}); // After add `.ts` extension, resolver can resolve `ts` as `ts.ts` now -assert.deepStrictEqual(resolver2.sync(cwd, "./test.mjs").path, path.join(cwd, 'test.mjs')); +assert.deepStrictEqual( + resolver2.sync(cwd, "./test.mjs").path, + path.join(cwd, "test.mjs"), +); diff --git a/napi/wasi-worker-browser.mjs b/napi/wasi-worker-browser.mjs index 9f5e224a..ae6fb10c 100644 --- a/napi/wasi-worker-browser.mjs +++ b/napi/wasi-worker-browser.mjs @@ -1,40 +1,44 @@ -import { instantiateNapiModuleSync, MessageHandler, WASI } from '@napi-rs/wasm-runtime' -import { Volume, createFsFromVolume } from '@napi-rs/wasm-runtime/fs' +import { + MessageHandler, + WASI, + instantiateNapiModuleSync, +} from "@napi-rs/wasm-runtime"; +import { Volume, createFsFromVolume } from "@napi-rs/wasm-runtime/fs"; const fs = createFsFromVolume( - Volume.fromJSON({ - '/': null, - }), -) + Volume.fromJSON({ + "/": null, + }), +); const handler = new MessageHandler({ - onLoad({ wasmModule, wasmMemory }) { - const wasi = new WASI({ - fs, - print: function () { - // eslint-disable-next-line no-console - console.log.apply(console, arguments) - }, - printErr: function() { - // eslint-disable-next-line no-console - console.error.apply(console, arguments) - }, - }) - return instantiateNapiModuleSync(wasmModule, { - childThread: true, - wasi, - overwriteImports(importObject) { - importObject.env = { - ...importObject.env, - ...importObject.napi, - ...importObject.emnapi, - memory: wasmMemory, - } - }, - }) - }, -}) + onLoad({ wasmModule, wasmMemory }) { + const wasi = new WASI({ + fs, + print: () => { + // eslint-disable-next-line no-console + console.log.apply(console, arguments); + }, + printErr: () => { + // eslint-disable-next-line no-console + console.error.apply(console, arguments); + }, + }); + return instantiateNapiModuleSync(wasmModule, { + childThread: true, + wasi, + overwriteImports(importObject) { + importObject.env = { + ...importObject.env, + ...importObject.napi, + ...importObject.emnapi, + memory: wasmMemory, + }; + }, + }); + }, +}); -globalThis.onmessage = function (e) { - handler.handle(e) -} +globalThis.onmessage = (e) => { + handler.handle(e); +}; diff --git a/napi/wasi-worker.mjs b/napi/wasi-worker.mjs index 11e930b1..f61b4797 100644 --- a/napi/wasi-worker.mjs +++ b/napi/wasi-worker.mjs @@ -1,50 +1,54 @@ import fs from "node:fs"; import { createRequire } from "node:module"; -import { parentPort, Worker } from "node:worker_threads"; +import { Worker, parentPort } from "node:worker_threads"; -import { instantiateNapiModuleSync, MessageHandler, WASI } from "@napi-rs/wasm-runtime"; +import { + MessageHandler, + WASI, + instantiateNapiModuleSync, +} from "@napi-rs/wasm-runtime"; const require = createRequire(import.meta.url); if (parentPort) { - parentPort.on("message", (data) => { - globalThis.onmessage({ data }); - }); + parentPort.on("message", (data) => { + globalThis.onmessage({ data }); + }); } Object.assign(globalThis, { - self: globalThis, - require, - Worker, - importScripts: function (f) { - ;(0, eval)(fs.readFileSync(f, "utf8") + "//# sourceURL=" + f); - }, - postMessage: function (msg) { - if (parentPort) { - parentPort.postMessage(msg); - } - }, + self: globalThis, + require, + Worker, + importScripts: (f) => { + (0, eval)(fs.readFileSync(f, "utf8") + "//# sourceURL=" + f); + }, + postMessage: (msg) => { + if (parentPort) { + parentPort.postMessage(msg); + } + }, }); const handler = new MessageHandler({ - onLoad({ wasmModule, wasmMemory }) { - const wasi = new WASI({ fs }); + onLoad({ wasmModule, wasmMemory }) { + const wasi = new WASI({ fs }); - return instantiateNapiModuleSync(wasmModule, { - childThread: true, - wasi, - overwriteImports(importObject) { - importObject.env = { - ...importObject.env, - ...importObject.napi, - ...importObject.emnapi, - memory: wasmMemory - }; - }, - }); - }, + return instantiateNapiModuleSync(wasmModule, { + childThread: true, + wasi, + overwriteImports(importObject) { + importObject.env = { + ...importObject.env, + ...importObject.napi, + ...importObject.emnapi, + memory: wasmMemory, + }; + }, + }); + }, }); -globalThis.onmessage = function (e) { - handler.handle(e); +globalThis.onmessage = (e) => { + handler.handle(e); }; diff --git a/npm/package.json b/npm/package.json index b47e6b07..180e01b5 100644 --- a/npm/package.json +++ b/npm/package.json @@ -6,11 +6,7 @@ }, "main": "index.js", "browser": "browser.js", - "files": [ - "index.d.ts", - "index.js", - "browser.js" - ], + "files": ["index.d.ts", "index.js", "browser.js"], "napi": { "binaryName": "resolver", "packageName": "@oxc-resolver/binding", diff --git a/package.json b/package.json index a3e52400..afaf67ac 100644 --- a/package.json +++ b/package.json @@ -10,9 +10,7 @@ }, "ava": { "cache": false, - "files": [ - "napi/__test__/*.spec.mjs" - ] + "files": ["napi/__test__/*.spec.mjs"] }, "devDependencies": { "@napi-rs/cli": "3.0.0-alpha.43", From 1320b84b143951f2c0c5af3a272f2db7e1b1a022 Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Sun, 26 May 2024 22:18:02 +0300 Subject: [PATCH 15/82] squash! --- FUNDING.yml => .github/FUNDING.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename FUNDING.yml => .github/FUNDING.yml (100%) diff --git a/FUNDING.yml b/.github/FUNDING.yml similarity index 100% rename from FUNDING.yml rename to .github/FUNDING.yml From 5d498fda582616e0e2d7765bc6a3ca6e4246699f Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Mon, 27 May 2024 17:01:37 +0300 Subject: [PATCH 16/82] squash! --- Cargo.lock | 880 ------ Source/lib.rs | 26 +- fixtures/enhanced_resolve/lib/index.js | 1 - fixtures/enhanced_resolve/package.json | 4 - fixtures/enhanced_resolve/test/.gitignore | 2 - fixtures/enhanced_resolve/test/fixtures/a.js | 3 - .../enhanced_resolve/test/fixtures/abc.txt | 1 - .../test/fixtures/alias/files/a.js | 0 fixtures/enhanced_resolve/test/fixtures/b.js | 3 - .../browser-module/browser/module-a.js | 0 .../fixtures/browser-module/lib/browser.js | 0 .../fixtures/browser-module/lib/ignore.js | 0 .../test/fixtures/browser-module/lib/main.js | 0 .../fixtures/browser-module/lib/replaced.js | 0 .../test/fixtures/browser-module/lib/self.js | 0 .../fixtures/browser-module/lib/toString.js | 0 .../browser-module/node_modules/module-a.js | 0 .../browser-module/node_modules/module-b.js | 0 .../browser-module/node_modules/module-c.js | 0 .../node_modules/recursive-file/a.js | 0 .../node_modules/recursive-file/b.js | 0 .../node_modules/recursive-file/c.js | 0 .../node_modules/recursive-file/d.js | 0 .../node_modules/recursive-file/package.json | 8 - .../test/fixtures/browser-module/package.json | 32 - fixtures/enhanced_resolve/test/fixtures/c.js | 4 - .../enhanced_resolve/test/fixtures/complex.js | 13 - .../test/fixtures/crypto-js/index.js | 0 .../test/fixtures/crypto-js/package.json | 7 - .../test/fixtures/decorated-fs/exists.js | 0 .../test/fixtures/dirOrFile.js | 1 - .../test/fixtures/dirOrFile/index.js | 1 - .../directory-default/directory-default.js | 0 .../node_modules/@org/pkg/dist/string.js | 1 - .../@org/pkg/dist/string.test.d.ts | 1 - .../node_modules/@org/pkg/package.json | 9 - .../node_modules/pkg/dist/string.js | 1 - .../node_modules/pkg/dist/string.test.d.ts | 1 - .../node_modules/pkg/package.json | 9 - .../node_modules/exports-field/package.json | 7 - .../node_modules/pack1/index.js | 0 .../test/fixtures/exports-field/a.js | 1 - .../node_modules/exports-field/lib/browser.js | 1 - .../node_modules/exports-field/lib/index.js | 0 .../exports-field/lib/lib2/main.js | 1 - .../node_modules/exports-field/lib/main.js | 1 - .../node_modules/exports-field/main.js | 1 - .../node_modules/exports-field/package.json | 18 - .../node_modules/exports-field/x.js | 1 - .../invalid-exports-field/index.js | 0 .../invalid-exports-field/package.json | 13 - .../node_modules/invalid-exports-field/umd.js | 0 .../test/fixtures/exports-field/package.json | 5 - .../node_modules/exports-field/index.js | 1 - .../node_modules/exports-field/lib/browser.js | 1 - .../exports-field/lib/lib2/main.js | 1 - .../node_modules/exports-field/lib/main.js | 1 - .../node_modules/exports-field/main.js | 1 - .../node_modules/exports-field/package.json | 17 - .../node_modules/exports-field/index | 0 .../node_modules/exports-field/main.js | 1 - .../node_modules/exports-field/package.json | 10 - .../node_modules/exports-field/src/index.js | 0 .../fixtures/extension-alias/dir/index.js | 0 .../fixtures/extension-alias/dir/index.ts | 0 .../fixtures/extension-alias/dir2/index.js | 0 .../fixtures/extension-alias/dir2/index.mts | 0 .../test/fixtures/extension-alias/index.js | 0 .../test/fixtures/extension-alias/index.mjs | 0 .../fixtures/extension-alias/index.mts.js | 0 .../test/fixtures/extension-alias/index.ts | 0 .../test/fixtures/extensions/app.module.js | 0 .../test/fixtures/extensions/dir/index.js | 0 .../test/fixtures/extensions/dir/index.ts | 0 .../test/fixtures/extensions/foo.js | 0 .../test/fixtures/extensions/foo.ts | 0 .../test/fixtures/extensions/index.js | 0 .../test/fixtures/extensions/index.ts | 0 .../extensions/node_modules/module.js | 0 .../extensions/node_modules/module/index.ts | 0 .../test/fixtures/extensions/package.json | 3 - .../enhanced_resolve/test/fixtures/file.load1 | 0 .../enhanced_resolve/test/fixtures/file.load2 | 0 .../test/fixtures/foo/index.js | 0 .../test/fixtures/foo/package.json | 4 - .../node_modules/m/package.json | 17 - .../node_modules/m/src/features/f.js | 0 .../m/src/features/internal/file.js | 0 .../node_modules/m/src/features/y/y.js | 0 .../node_modules/m/src/internal/i.js | 0 .../node_modules/m/src/middle-1/f.js | 0 .../node_modules/m/src/middle-1/nested/f.js | 0 .../node_modules/m/src/middle-2/nested/f.js | 1 - .../m/src/middle-3/nested/f/nested/f.js | 0 .../node_modules/m/src/middle-4/f/f.js | 0 .../node_modules/m/src/middle-5/f$/$.js | 0 .../node_modules/m/src/middle-5/f/$.js | 0 .../node_modules/m/src/middle/f.js | 0 .../node_modules/m/src/middle/nested/f.js | 0 .../test/fixtures/imports-field/a.js | 1 - .../test/fixtures/imports-field/b.js | 0 .../test/fixtures/imports-field/dir/b.js | 0 .../node_modules/a/lib/browser.js | 1 - .../imports-field/node_modules/a/lib/index.js | 0 .../node_modules/a/lib/lib2/main.js | 1 - .../imports-field/node_modules/a/lib/main.js | 1 - .../imports-field/node_modules/a/main.js | 1 - .../imports-field/node_modules/a/package.json | 18 - .../imports-field/node_modules/a/x.js | 1 - .../imports-field/node_modules/c/index.js | 0 .../test/fixtures/imports-field/package.json | 17 - .../fixtures/incorrect-package/pack1/a.js | 0 .../incorrect-package/pack1/package.json | 2 - .../fixtures/incorrect-package/pack2/a.js | 0 .../incorrect-package/pack2/package.json | 0 .../test/fixtures/issue-238/package.json | 3 - .../test/fixtures/issue-238/src/a/config.js | 0 .../src/common/config/myObjectFile.js | 0 .../enhanced_resolve/test/fixtures/lib.js | 0 .../test/fixtures/lib/complex1.js | 1 - .../test/fixtures/main-field-self/index.js | 0 .../fixtures/main-field-self/package.json | 3 - .../test/fixtures/main-field-self2/index.js | 0 .../fixtures/main-field-self2/package.json | 3 - .../enhanced_resolve/test/fixtures/main1.js | 9 - .../enhanced_resolve/test/fixtures/main2.js | 12 - .../enhanced_resolve/test/fixtures/main3.js | 4 - .../multiple_modules/node_modules/m1/a.js | 3 - .../test/fixtures/no#fragment/#/#.js | 0 fixtures/enhanced_resolve/test/fixtures/no.js | 0 .../browser-module-broken/browser.js | 0 .../browser-module-broken/main.js | 0 .../browser-module-broken/package.json | 4 - .../complexm/node_modules/m1/a.js | 1 - .../complexm/node_modules/m1/index.js | 1 - .../fixtures/node_modules/complexm/step1.js | 1 - .../fixtures/node_modules/complexm/step2.js | 1 - .../fixtures/node_modules/dash-name/index.js | 0 .../node_modules/dash-name/package.json | 4 - .../test/fixtures/node_modules/dash/index.js | 0 .../fixtures/node_modules/dash/package.json | 4 - .../invalidPackageJson/package.json | 0 .../test/fixtures/node_modules/m1/a.js | 3 - .../test/fixtures/node_modules/m1/b.js | 3 - .../test/fixtures/node_modules/m2/b.js | 1 - .../node_modules/recursive-module/file.js | 0 .../node_modules/recursive-module/index.js | 0 .../test/fixtures/pnp-a/m2/a.js | 3 - .../test/fixtures/pnp/pkg/dir/index.js | 0 .../test/fixtures/pnp/pkg/index.js | 0 .../test/fixtures/pnp/pkg/main.js | 0 .../fixtures/pnp/pkg/package-alias/browser.js | 0 .../fixtures/pnp/pkg/package-alias/index.js | 0 .../test/fixtures/pnp/pkg/package.json | 7 - .../test/fixtures/pnp/pkg/typescript/index.ts | 0 .../test/fixtures/pnp/pkg3/a.js | 1 - .../test/fixtures/pnp/pkg3/package.json | 8 - .../prefer-pnp/alternative-modules/m1/b.js | 0 .../restrictions/node_modules/pck1/index.css | 0 .../restrictions/node_modules/pck1/index.js | 0 .../node_modules/pck1/package.json | 3 - .../restrictions/node_modules/pck2/index.css | 0 .../restrictions/node_modules/pck2/module.js | 0 .../node_modules/pck2/package.json | 5 - .../test/fixtures/roots_fall_through/index.js | 0 .../scoped/node_modules/@scope/pack1/main.js | 0 .../node_modules/@scope/pack1/package.json | 5 - .../node_modules/@scope/pack2/lib/index.js | 0 .../scoped/node_modules/@scope/pack2/main.js | 0 .../node_modules/@scope/pack2/package.json | 3 - .../test/fixtures/shortcutdir.js/a.js | 0 .../test/fixtures/yield/a/foo-2/b | 0 .../test/fixtures/yield/a/foo-2/c | 0 .../test/fixtures/yield/a/foo/a | 0 .../test/fixtures/yield/a/foo/b | 0 .../test/fixtures/yield/b/foo/a | 0 .../test/fixtures/yield/c/foo/a | 0 .../test/fixtures/yield/c/foo/package.json | 7 - .../fixtures/\346\265\213\350\257\225.js" | 0 .../\344\270\255\346\226\207.js" | 0 fixtures/pnpm8/.gitignore | 1 - fixtures/pnpm8/package.json | 14 - fixtures/pnpm8/pnpm-lock.yaml | 212 -- fixtures/tsconfig/cases/builtins/thing.js | 0 .../tsconfig/cases/builtins/tsconfig.json | 5 - fixtures/tsconfig/cases/exports/index.js | 0 fixtures/tsconfig/cases/exports/tsconfig.json | 3 - .../extends-extension/base-tsconfig.json | 7 - .../tsconfig/cases/extends-extension/foo.js | 0 .../cases/extends-extension/tsconfig.json | 3 - .../cases/extends-extensionless/foo.js | 0 .../cases/extends-extensionless/tsconfig.json | 3 - .../tsconfig/cases/extends-multiple/foo.js | 0 .../cases/extends-multiple/tsconfig.json | 6 - .../tsconfig/cases/extends-not-found/index.js | 0 .../cases/extends-not-found/tsconfig.json | 3 - .../tsconfig/cases/extends-paths/src/index.js | 0 .../cases/extends-paths/tsconfig.base.json | 7 - .../cases/extends-paths/tsconfig.json | 6 - fixtures/tsconfig/cases/field/index.js | 0 fixtures/tsconfig/cases/field/tsconfig.json | 3 - fixtures/tsconfig/cases/index/index.js | 0 fixtures/tsconfig/cases/index/tsconfig.json | 3 - .../cases/paths_template_variable/foo.js | 0 .../paths_template_variable/tsconfig1.json | 3 - .../paths_template_variable/tsconfig2.json | 8 - .../project_references/app/aliased/index.ts | 0 .../cases/project_references/app/index.ts | 0 .../project_references/app/tsconfig.json | 23 - .../project_a/aliased/index.ts | 0 .../project_references/project_a/conf.json | 8 - .../project_references/project_a/index.ts | 0 .../project_b/src/aliased/index.ts | 0 .../project_b/tsconfig.json | 9 - .../project_references/project_c/index.ts | 0 .../project_c/tsconfig.json | 5 - .../project_references/tsconfig.base.json | 4 - fixtures/tsconfig/cases/suffixes/a.ios.ts | 0 fixtures/tsconfig/cases/suffixes/a.ts | 0 fixtures/tsconfig/cases/suffixes/b.ts | 0 fixtures/tsconfig/cases/suffixes/c-test.ts | 0 fixtures/tsconfig/cases/suffixes/index.ts | 1 - .../tsconfig/cases/suffixes/tsconfig.json | 5 - fixtures/tsconfig/cases/trailing-comma/bar.js | 0 .../tsconfig/cases/trailing-comma/index.js | 0 .../cases/trailing-comma/tsconfig.json | 9 - fixtures/tsconfig/foo.js | 0 fixtures/tsconfig/nested/index.js | 0 fixtures/tsconfig/nested/test.js | 0 fixtures/tsconfig/nested/tsconfig.json | 8 - .../node_modules/tsconfig-exports/conf.json | 7 - .../node_modules/tsconfig-exports/foo.js | 0 .../tsconfig-exports/package.json | 7 - .../node_modules/tsconfig-field/conf.json | 7 - .../node_modules/tsconfig-field/foo.js | 0 .../node_modules/tsconfig-field/package.json | 5 - .../node_modules/tsconfig-index/foo.js | 0 .../node_modules/tsconfig-index/package.json | 4 - .../node_modules/tsconfig-index/tsconfig.json | 7 - .../node_modules/tsconfig-not-used/foo.js | 0 .../tsconfig-not-used/tsconfig.json | 7 - fixtures/tsconfig/package.json | 24 - fixtures/tsconfig/tsconfig.json | 7 - .../tsconfig/tsconfig_template_variable.json | 7 - napi/__test__/resolver.spec.mjs | 259 -- napi/src/lib.rs | 166 -- napi/src/options.rs | 261 -- napi/tests/options.test.mjs | 59 - npm/package.json | 67 +- package.json | 56 +- pnpm-lock.yaml | 2450 ---------------- src/builtins.rs | 71 - src/cache.rs | 369 --- src/context.rs | 89 - src/error.rs | 160 -- src/file_system.rs | 133 - src/lib.rs | 1663 ----------- src/options.rs | 623 ---- src/package_json.rs | 207 -- src/path.rs | 132 - src/resolution.rs | 92 - src/specifier.rs | 230 -- src/tests/alias.rs | 266 -- src/tests/browser_field.rs | 176 -- src/tests/builtins.rs | 98 - src/tests/dependencies.rs | 110 - src/tests/exports_field.rs | 2546 ----------------- src/tests/extension_alias.rs | 66 - src/tests/extensions.rs | 125 - src/tests/fallback.rs | 100 - src/tests/full_specified.rs | 113 - src/tests/imports_field.rs | 1320 --------- src/tests/incorrect_description_file.rs | 62 - src/tests/main_field.rs | 24 - src/tests/memory_fs.rs | 74 - src/tests/missing.rs | 106 - src/tests/mod.rs | 49 - src/tests/resolve.rs | 119 - src/tests/restrictions.rs | 25 - src/tests/roots.rs | 92 - src/tests/scoped_packages.rs | 25 - src/tests/simple.rs | 68 - src/tests/symlink.rs | 121 - src/tests/tsconfig_paths.rs | 507 ---- src/tests/tsconfig_project_references.rs | 101 - src/tsconfig.rs | 212 -- tests/integration_test.rs | 102 - tests/package.json | 3 - tests/resolve_test.rs | 104 - 289 files changed, 61 insertions(+), 15442 deletions(-) delete mode 100644 Cargo.lock delete mode 100644 fixtures/enhanced_resolve/lib/index.js delete mode 100644 fixtures/enhanced_resolve/package.json delete mode 100644 fixtures/enhanced_resolve/test/.gitignore delete mode 100644 fixtures/enhanced_resolve/test/fixtures/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/abc.txt delete mode 100644 fixtures/enhanced_resolve/test/fixtures/alias/files/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/browser/module-a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/ignore.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/replaced.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/self.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/toString.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-c.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/c.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/d.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/c.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/complex.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/crypto-js/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/decorated-fs/exists.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/dirOrFile.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/directory-default/directory-default.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/pack1/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/umd.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/index delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/src/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.mts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mjs delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mts.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/app.module.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/foo.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/foo.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/file.load1 delete mode 100644 fixtures/enhanced_resolve/test/fixtures/file.load2 delete mode 100644 fixtures/enhanced_resolve/test/fixtures/foo/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/foo/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/internal/file.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/y/y.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/internal/i.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-3/nested/f/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-4/f/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f$/$.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f/$.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/dir/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/c/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/issue-238/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/issue-238/src/a/config.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/issue-238/src/common/config/myObjectFile.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/lib.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/lib/complex1.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self2/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main1.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main2.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main3.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/no#fragment/#/#.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/no.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/invalidPackageJson/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/file.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/dir/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/typescript/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/prefer-pnp/alternative-modules/m1/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.css delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/index.css delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/module.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/roots_fall_through/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/lib/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/shortcutdir.js/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/b delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/c delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo/a delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo/b delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/b/foo/a delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/c/foo/a delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json delete mode 100644 "fixtures/enhanced_resolve/test/fixtures/\346\265\213\350\257\225.js" delete mode 100644 "fixtures/misc/\344\270\255\346\226\207/\344\270\255\346\226\207.js" delete mode 100644 fixtures/pnpm8/.gitignore delete mode 100644 fixtures/pnpm8/package.json delete mode 100644 fixtures/pnpm8/pnpm-lock.yaml delete mode 100644 fixtures/tsconfig/cases/builtins/thing.js delete mode 100644 fixtures/tsconfig/cases/builtins/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/exports/index.js delete mode 100644 fixtures/tsconfig/cases/exports/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-extension/base-tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-extension/foo.js delete mode 100644 fixtures/tsconfig/cases/extends-extension/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-extensionless/foo.js delete mode 100644 fixtures/tsconfig/cases/extends-extensionless/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-multiple/foo.js delete mode 100644 fixtures/tsconfig/cases/extends-multiple/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-not-found/index.js delete mode 100644 fixtures/tsconfig/cases/extends-not-found/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-paths/src/index.js delete mode 100644 fixtures/tsconfig/cases/extends-paths/tsconfig.base.json delete mode 100644 fixtures/tsconfig/cases/extends-paths/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/field/index.js delete mode 100644 fixtures/tsconfig/cases/field/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/index/index.js delete mode 100644 fixtures/tsconfig/cases/index/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/paths_template_variable/foo.js delete mode 100644 fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json delete mode 100644 fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json delete mode 100644 fixtures/tsconfig/cases/project_references/app/aliased/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/app/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/app/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/project_references/project_a/aliased/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_a/conf.json delete mode 100644 fixtures/tsconfig/cases/project_references/project_a/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_b/src/aliased/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_b/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/project_references/project_c/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_c/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/project_references/tsconfig.base.json delete mode 100644 fixtures/tsconfig/cases/suffixes/a.ios.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/a.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/b.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/c-test.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/index.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/trailing-comma/bar.js delete mode 100644 fixtures/tsconfig/cases/trailing-comma/index.js delete mode 100644 fixtures/tsconfig/cases/trailing-comma/tsconfig.json delete mode 100644 fixtures/tsconfig/foo.js delete mode 100644 fixtures/tsconfig/nested/index.js delete mode 100644 fixtures/tsconfig/nested/test.js delete mode 100644 fixtures/tsconfig/nested/tsconfig.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-exports/conf.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-exports/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-exports/package.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-field/conf.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-field/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-field/package.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-index/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-index/package.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-not-used/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json delete mode 100755 fixtures/tsconfig/package.json delete mode 100644 fixtures/tsconfig/tsconfig.json delete mode 100644 fixtures/tsconfig/tsconfig_template_variable.json delete mode 100644 napi/__test__/resolver.spec.mjs delete mode 100644 napi/src/lib.rs delete mode 100644 napi/src/options.rs delete mode 100644 napi/tests/options.test.mjs delete mode 100644 pnpm-lock.yaml delete mode 100644 src/builtins.rs delete mode 100644 src/cache.rs delete mode 100644 src/context.rs delete mode 100644 src/error.rs delete mode 100644 src/file_system.rs delete mode 100644 src/lib.rs delete mode 100644 src/options.rs delete mode 100644 src/package_json.rs delete mode 100644 src/path.rs delete mode 100644 src/resolution.rs delete mode 100644 src/specifier.rs delete mode 100644 src/tests/alias.rs delete mode 100644 src/tests/browser_field.rs delete mode 100644 src/tests/builtins.rs delete mode 100644 src/tests/dependencies.rs delete mode 100644 src/tests/exports_field.rs delete mode 100644 src/tests/extension_alias.rs delete mode 100644 src/tests/extensions.rs delete mode 100644 src/tests/fallback.rs delete mode 100644 src/tests/full_specified.rs delete mode 100644 src/tests/imports_field.rs delete mode 100644 src/tests/incorrect_description_file.rs delete mode 100644 src/tests/main_field.rs delete mode 100644 src/tests/memory_fs.rs delete mode 100644 src/tests/missing.rs delete mode 100644 src/tests/mod.rs delete mode 100644 src/tests/resolve.rs delete mode 100644 src/tests/restrictions.rs delete mode 100644 src/tests/roots.rs delete mode 100644 src/tests/scoped_packages.rs delete mode 100644 src/tests/simple.rs delete mode 100644 src/tests/symlink.rs delete mode 100644 src/tests/tsconfig_paths.rs delete mode 100644 src/tests/tsconfig_project_references.rs delete mode 100644 src/tsconfig.rs delete mode 100644 tests/integration_test.rs delete mode 100644 tests/package.json delete mode 100644 tests/resolve_test.rs diff --git a/Cargo.lock b/Cargo.lock deleted file mode 100644 index aefcc738..00000000 --- a/Cargo.lock +++ /dev/null @@ -1,880 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "aho-corasick" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" -dependencies = [ - "memchr", -] - -[[package]] -name = "anes" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "735d4f398ca57cfa2880225c2bf81c3b9af3be5bb22e44ae70118dad38713e84" - -[[package]] -name = "autocfg" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "bitflags" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" - -[[package]] -name = "bpaf" -version = "0.9.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3280efcf6d66bc77c2cf9b67dc8acee47a217d9be67dd590b3230dffe663724d" - -[[package]] -name = "cast" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "ciborium" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42e69ffd6f0917f5c029256a24d0161db17cea3997d185db0d35926308770f0e" -dependencies = [ - "ciborium-io", - "ciborium-ll", - "serde", -] - -[[package]] -name = "ciborium-io" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05afea1e0a06c9be33d539b876f1ce3692f4afea2cb41f740e7743225ed1c757" - -[[package]] -name = "ciborium-ll" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57663b653d948a338bfb3eeba9bb2fd5fcfaecb9e199e87e1eda4d9e8b240fd9" -dependencies = [ - "ciborium-io", - "half", -] - -[[package]] -name = "clean-path" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aaa6b4b263a5d737e9bf6b7c09b72c41a5480aec4d7219af827f6564e950b6a5" - -[[package]] -name = "codspeed" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a104ac948e0188b921eb3fcbdd55dcf62e542df4c7ab7e660623f6288302089" -dependencies = [ - "colored", - "libc", - "serde_json", -] - -[[package]] -name = "colored" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbf2150cce219b664a8a70df7a1f933836724b503f8a413af9365b4dcc4d90b8" -dependencies = [ - "lazy_static", - "windows-sys 0.48.0", -] - -[[package]] -name = "convert_case" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec182b0ca2f35d8fc196cf3404988fd8b8c739a4d270ff118a398feb0cbec1ca" -dependencies = [ - "unicode-segmentation", -] - -[[package]] -name = "criterion2" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43b57a5b1bf6ed08b671717cf7ce07d3dea4efa30f54d0b64abce48d8299818f" -dependencies = [ - "anes", - "bpaf", - "cast", - "ciborium", - "codspeed", - "colored", - "itertools", - "num-traits", - "oorandom", - "serde", - "serde_derive", - "serde_json", - "tinytemplate", - "walkdir", -] - -[[package]] -name = "crossbeam-deque" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" -dependencies = [ - "crossbeam-epoch", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.9.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" -dependencies = [ - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" - -[[package]] -name = "crunchy" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" - -[[package]] -name = "ctor" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edb49164822f3ee45b17acd4a208cfc1251410cf0cad9a833234c9890774dd9f" -dependencies = [ - "quote", - "syn", -] - -[[package]] -name = "dashmap" -version = "5.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" -dependencies = [ - "cfg-if", - "hashbrown", - "lock_api", - "once_cell", - "parking_lot_core", -] - -[[package]] -name = "document-features" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef5282ad69563b5fc40319526ba27e0e7363d552a896f0297d54f767717f9b95" -dependencies = [ - "litrs", -] - -[[package]] -name = "dunce" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b" - -[[package]] -name = "either" -version = "1.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dca9240753cf90908d7e4aac30f630662b02aebaa1b58a3cadabdb23385b58b" - -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "filetime" -version = "0.2.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ee447700ac8aa0b2f2bd7bc4462ad686ba06baa6727ac149a2d6277f0d240fd" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall 0.4.1", - "windows-sys 0.52.0", -] - -[[package]] -name = "half" -version = "2.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dd08c532ae367adf81c312a4580bc67f1d0fe8bc9c460520283f4c0ff277888" -dependencies = [ - "cfg-if", - "crunchy", -] - -[[package]] -name = "hashbrown" -version = "0.14.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" - -[[package]] -name = "indexmap" -version = "2.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" -dependencies = [ - "equivalent", - "hashbrown", - "serde", -] - -[[package]] -name = "itertools" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" -dependencies = [ - "either", -] - -[[package]] -name = "itoa" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" - -[[package]] -name = "json-strip-comments" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3d129799327c8f80861e467c59b825ba24c277dba6ad0d71a141dc98f9e04ee" - -[[package]] -name = "lazy_static" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" - -[[package]] -name = "libc" -version = "0.2.155" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" - -[[package]] -name = "libloading" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c2a198fb6b0eada2a8df47933734e6d35d350665a33a3593d7164fa52c75c19" -dependencies = [ - "cfg-if", - "windows-targets 0.52.5", -] - -[[package]] -name = "litrs" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4ce301924b7887e9d637144fdade93f9dfff9b60981d4ac161db09720d39aa5" - -[[package]] -name = "lock_api" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" -dependencies = [ - "autocfg", - "scopeguard", -] - -[[package]] -name = "memchr" -version = "2.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" - -[[package]] -name = "napi" -version = "2.16.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfc300228808a0e6aea5a58115c82889240bcf8dab16fc25ad675b33e454b368" -dependencies = [ - "bitflags 2.5.0", - "ctor", - "napi-derive", - "napi-sys", - "once_cell", - "serde", - "serde_json", -] - -[[package]] -name = "napi-build" -version = "2.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1c0f5d67ee408a4685b61f5ab7e58605c8ae3f2b4189f0127d804ff13d5560a" - -[[package]] -name = "napi-derive" -version = "2.16.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0e034ddf6155192cf83f267ede763fe6c164dfa9971585436b16173718d94c4" -dependencies = [ - "cfg-if", - "convert_case", - "napi-derive-backend", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "napi-derive-backend" -version = "1.0.67" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bff2c00437f3b3266391eb5e6aa25d0029187daf5caf05b8e3271468fb5ae73e" -dependencies = [ - "convert_case", - "once_cell", - "proc-macro2", - "quote", - "regex", - "semver", - "syn", -] - -[[package]] -name = "napi-sys" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "427802e8ec3a734331fec1035594a210ce1ff4dc5bc1950530920ab717964ea3" -dependencies = [ - "libloading", -] - -[[package]] -name = "normalize-path" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5438dd2b2ff4c6df6e1ce22d825ed2fa93ee2922235cc45186991717f0a892d" - -[[package]] -name = "num-traits" -version = "0.2.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" -dependencies = [ - "autocfg", -] - -[[package]] -name = "once_cell" -version = "1.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" - -[[package]] -name = "oorandom" -version = "11.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575" - -[[package]] -name = "oxc_napi_resolver" -version = "0.0.0" -dependencies = [ - "napi", - "napi-build", - "napi-derive", - "oxc_resolver", -] - -[[package]] -name = "oxc_resolver" -version = "1.7.0" -dependencies = [ - "criterion2", - "dashmap", - "document-features", - "dunce", - "json-strip-comments", - "normalize-path", - "once_cell", - "rayon", - "rustc-hash", - "serde", - "serde_json", - "thiserror", - "tracing", - "typescript_tsconfig_json", - "vfs", -] - -[[package]] -name = "parking_lot_core" -version = "0.9.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall 0.5.1", - "smallvec", - "windows-targets 0.52.5", -] - -[[package]] -name = "pin-project-lite" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" - -[[package]] -name = "proc-macro2" -version = "1.0.84" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec96c6a92621310b51366f1e28d05ef11489516e93be030060e5fc12024a49d6" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.36" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "rayon" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" -dependencies = [ - "either", - "rayon-core", -] - -[[package]] -name = "rayon-core" -version = "1.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" -dependencies = [ - "crossbeam-deque", - "crossbeam-utils", -] - -[[package]] -name = "redox_syscall" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" -dependencies = [ - "bitflags 1.3.2", -] - -[[package]] -name = "redox_syscall" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "469052894dcb553421e483e4209ee581a45100d31b4018de03e5a7ad86374a7e" -dependencies = [ - "bitflags 2.5.0", -] - -[[package]] -name = "regex" -version = "1.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" -dependencies = [ - "aho-corasick", - "memchr", - "regex-automata", - "regex-syntax", -] - -[[package]] -name = "regex-automata" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", -] - -[[package]] -name = "regex-syntax" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" - -[[package]] -name = "rustc-hash" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" - -[[package]] -name = "ryu" -version = "1.0.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" - -[[package]] -name = "same-file" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "scopeguard" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" - -[[package]] -name = "semver" -version = "1.0.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" - -[[package]] -name = "serde" -version = "1.0.203" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7253ab4de971e72fb7be983802300c30b5a7f0c2e56fab8abfc6a214307c0094" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.203" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "serde_json" -version = "1.0.117" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3" -dependencies = [ - "indexmap", - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "smallvec" -version = "1.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" - -[[package]] -name = "syn" -version = "2.0.66" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c42f3f41a2de00b01c0aaad383c5a45241efc8b2d1eda5661812fda5f3cdcff5" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "thiserror" -version = "1.0.61" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.61" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "tinytemplate" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be4d6b5f19ff7664e8c98d03e2139cb510db9b0a60b55f8e8709b689d939b6bc" -dependencies = [ - "serde", - "serde_json", -] - -[[package]] -name = "tracing" -version = "0.1.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" -dependencies = [ - "pin-project-lite", - "tracing-attributes", - "tracing-core", -] - -[[package]] -name = "tracing-attributes" -version = "0.1.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "tracing-core" -version = "0.1.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" -dependencies = [ - "once_cell", -] - -[[package]] -name = "typescript_tsconfig_json" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7cc416eaf05297012ead9d192226fe9a92e9a20f64f8780efb9085aaae9b590" -dependencies = [ - "clean-path", - "indexmap", - "rustc-hash", - "serde", - "serde_json", -] - -[[package]] -name = "unicode-ident" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" - -[[package]] -name = "unicode-segmentation" -version = "1.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" - -[[package]] -name = "vfs" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "654cd097e182a71dbf899178e6b5662c2157dd0b8afd5975de18008f6fc173d1" -dependencies = [ - "filetime", -] - -[[package]] -name = "walkdir" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" -dependencies = [ - "same-file", - "winapi-util", -] - -[[package]] -name = "winapi-util" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b" -dependencies = [ - "windows-sys 0.52.0", -] - -[[package]] -name = "windows-sys" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" -dependencies = [ - "windows-targets 0.48.5", -] - -[[package]] -name = "windows-sys" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" -dependencies = [ - "windows-targets 0.52.5", -] - -[[package]] -name = "windows-targets" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" -dependencies = [ - "windows_aarch64_gnullvm 0.48.5", - "windows_aarch64_msvc 0.48.5", - "windows_i686_gnu 0.48.5", - "windows_i686_msvc 0.48.5", - "windows_x86_64_gnu 0.48.5", - "windows_x86_64_gnullvm 0.48.5", - "windows_x86_64_msvc 0.48.5", -] - -[[package]] -name = "windows-targets" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" -dependencies = [ - "windows_aarch64_gnullvm 0.52.5", - "windows_aarch64_msvc 0.52.5", - "windows_i686_gnu 0.52.5", - "windows_i686_gnullvm", - "windows_i686_msvc 0.52.5", - "windows_x86_64_gnu 0.52.5", - "windows_x86_64_gnullvm 0.52.5", - "windows_x86_64_msvc 0.52.5", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" - -[[package]] -name = "windows_i686_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" - -[[package]] -name = "windows_i686_gnu" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" - -[[package]] -name = "windows_i686_gnullvm" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" - -[[package]] -name = "windows_i686_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" - -[[package]] -name = "windows_i686_msvc" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" diff --git a/Source/lib.rs b/Source/lib.rs index 8cc28313..2d603cf3 100644 --- a/Source/lib.rs +++ b/Source/lib.rs @@ -871,26 +871,16 @@ impl ResolverGeneric { } alias_key_raw }; + // It should stop resolving when all of the tried alias values + // failed to resolve. + // + let mut should_stop = false; for r in specifiers { match r { AliasValue::Path(alias_value) => { let new_specifier = Specifier::parse(alias_value).map_err(ResolveError::Specifier)?; - - // `#` can be a fragment or a path, try fragment as path first - if new_specifier.query.is_none() && new_specifier.fragment.is_some() { - if let Some(path) = self.load_alias_value( - cached_path, - alias_key, - alias_value, // pass in original alias value, not parsed - specifier, - ctx, - )? { - return Ok(Some(path)); - } - } - - // Then try path without query and fragment + // Resolve path without query and fragment let old_query = ctx.query.clone(); let old_fragment = ctx.fragment.clone(); ctx.with_query_fragment(new_specifier.query, new_specifier.fragment); @@ -900,6 +890,7 @@ impl ResolverGeneric { new_specifier.path(), // pass in parsed alias value specifier, ctx, + &mut should_stop, )? { return Ok(Some(path)); } @@ -911,6 +902,9 @@ impl ResolverGeneric { } } } + if should_stop { + return Err(ResolveError::NotFound(specifier.to_string())); + } } Ok(None) } @@ -922,6 +916,7 @@ impl ResolverGeneric { alias_value: &str, request: &str, ctx: &mut Ctx, + should_stop: &mut bool, ) -> ResolveResult { if request != alias_value && !request.strip_prefix(alias_value).is_some_and(|prefix| prefix.starts_with('/')) @@ -944,6 +939,7 @@ impl ResolverGeneric { Cow::Owned(normalized.to_string_lossy().to_string()) }; + *should_stop = true; ctx.with_fully_specified(false); return match self.require(cached_path, new_specifier.as_ref(), ctx) { Err(ResolveError::NotFound(_)) => Ok(None), diff --git a/fixtures/enhanced_resolve/lib/index.js b/fixtures/enhanced_resolve/lib/index.js deleted file mode 100644 index 1e872e8f..00000000 --- a/fixtures/enhanced_resolve/lib/index.js +++ /dev/null @@ -1 +0,0 @@ -// mimic enhanced-resolved root directory structure diff --git a/fixtures/enhanced_resolve/package.json b/fixtures/enhanced_resolve/package.json deleted file mode 100644 index d1b845b5..00000000 --- a/fixtures/enhanced_resolve/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "enhanced-resolve", - "main": "lib/index.js" -} diff --git a/fixtures/enhanced_resolve/test/.gitignore b/fixtures/enhanced_resolve/test/.gitignore deleted file mode 100644 index bbbec5f4..00000000 --- a/fixtures/enhanced_resolve/test/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# created by symlink.rs -/temp diff --git a/fixtures/enhanced_resolve/test/fixtures/a.js b/fixtures/enhanced_resolve/test/fixtures/a.js deleted file mode 100644 index 896ffc6d..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/abc.txt b/fixtures/enhanced_resolve/test/fixtures/abc.txt deleted file mode 100644 index f2ba8f84..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/abc.txt +++ /dev/null @@ -1 +0,0 @@ -abc \ No newline at end of file diff --git a/fixtures/enhanced_resolve/test/fixtures/alias/files/a.js b/fixtures/enhanced_resolve/test/fixtures/alias/files/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/b.js b/fixtures/enhanced_resolve/test/fixtures/b.js deleted file mode 100644 index 11476340..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/b.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function b() { - return "This is b"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/browser/module-a.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/browser/module-a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/browser.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/ignore.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/ignore.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/replaced.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/replaced.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/self.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/self.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/toString.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/toString.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-a.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-b.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-c.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-c.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/a.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/b.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/c.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/c.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/d.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/d.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json deleted file mode 100644 index c13fe23b..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "browser": { - "a.js": "./a", - "./b.js": "./b", - "c.js": "./d.js", - "./d.js": "./c.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/package.json b/fixtures/enhanced_resolve/test/fixtures/browser-module/package.json deleted file mode 100644 index 1068633a..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/browser-module/package.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "exports": { - "./lib/index.js": "./lib/index.js" - }, - "browser": { - "./lib/ignore.js": false, - "./lib/replaced.js": "./lib/browser", - "module-a": "./browser/module-a.js", - "module-b": "module-c", - "module-c": "module-c", - "./toString": "./lib/toString.js", - "./lib/main.js": "./lib/main.js", - "./main.js": "./lib/main.js", - "./lib/xyz.js": "./xyz.js", - "./xyz.js": "./lib/xyz.js", - "./lib/non-existent.js": "./lib/non-existent.js", - ".": false, - "./number": 1 - }, - "innerBrowser1": { - "field": { - "browser": { - "./lib/main1.js": "./lib/main.js" - } - } - }, - "innerBrowser2": { - "browser": { - "./lib/main2.js": "./lib/replaced.js" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/c.js b/fixtures/enhanced_resolve/test/fixtures/c.js deleted file mode 100644 index e3aca8aa..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/c.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = function b() { - require("./a"); - return "This is c"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/complex.js b/fixtures/enhanced_resolve/test/fixtures/complex.js deleted file mode 100644 index 1f62db84..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/complex.js +++ /dev/null @@ -1,13 +0,0 @@ -var 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); diff --git a/fixtures/enhanced_resolve/test/fixtures/crypto-js/index.js b/fixtures/enhanced_resolve/test/fixtures/crypto-js/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json b/fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json deleted file mode 100644 index 1d31aa8b..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "crypto-js", - "main": "index.js", - "browser": { - "crypto": false - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/decorated-fs/exists.js b/fixtures/enhanced_resolve/test/fixtures/decorated-fs/exists.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/dirOrFile.js b/fixtures/enhanced_resolve/test/fixtures/dirOrFile.js deleted file mode 100644 index c3cb885f..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/dirOrFile.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "file"; diff --git a/fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js b/fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js deleted file mode 100644 index 85e01cd4..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "dir"; diff --git a/fixtures/enhanced_resolve/test/fixtures/directory-default/directory-default.js b/fixtures/enhanced_resolve/test/fixtures/directory-default/directory-default.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js deleted file mode 100644 index d1007aae..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js +++ /dev/null @@ -1 +0,0 @@ -export default "string"; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts deleted file mode 100644 index cb0ff5c3..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json deleted file mode 100644 index b523a1e9..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "@org/pkg", - "exports": { - "./*.js": { - "types": "./dist/*.d.ts", - "default": "./dist/*.js" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js deleted file mode 100644 index d1007aae..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js +++ /dev/null @@ -1 +0,0 @@ -export default "string"; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts deleted file mode 100644 index cb0ff5c3..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json deleted file mode 100644 index 8e55fb46..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "@raviqqe/hidash", - "exports": { - "./*.js": { - "types": "./dist/*.d.ts", - "default": "./dist/*.js" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json deleted file mode 100644 index f0edf449..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "exports-field", - "version": "1.0.0", - "exports": { - ".": "./a/../b/../../pack1/index.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/pack1/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/pack1/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/a.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/a.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json deleted file mode 100644 index 6b105c08..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "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/": { - "webpack": ["./lib/lib2/", "./lib/"], - "node": "./lib/", - "default": "./lib/" - }, - "./dist/a.js": "./../../a.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json deleted file mode 100644 index 0012a3de..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "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" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/umd.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/umd.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field/package.json deleted file mode 100644 index 5fa72bb5..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "@exports-field/core", - "version": "1.0.0", - "exports": "./a.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json deleted file mode 100644 index e6f12074..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "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/lib2/", "./lib/"], - "node": "./lib/", - "default": "./lib/" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/index b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/index deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json deleted file mode 100644 index 1a838f49..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "name": "exports-field", - "exportsField": { - "exports": "./main.js" - }, - "ex": "./index", - "broken": { - ".": "./src" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/src/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/src/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.ts b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.mts b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.mts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mjs b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mjs deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mts.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mts.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.ts b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/app.module.js b/fixtures/enhanced_resolve/test/fixtures/extensions/app.module.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.js b/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/foo.js b/fixtures/enhanced_resolve/test/fixtures/extensions/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/foo.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/foo.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/index.js b/fixtures/enhanced_resolve/test/fixtures/extensions/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/index.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module.js b/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module/index.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/package.json b/fixtures/enhanced_resolve/test/fixtures/extensions/package.json deleted file mode 100644 index 5e55a1e8..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/extensions/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "./index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/file.load1 b/fixtures/enhanced_resolve/test/fixtures/file.load1 deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/file.load2 b/fixtures/enhanced_resolve/test/fixtures/file.load2 deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/foo/index.js b/fixtures/enhanced_resolve/test/fixtures/foo/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/foo/package.json b/fixtures/enhanced_resolve/test/fixtures/foo/package.json deleted file mode 100644 index da86787a..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/foo/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "foo", - "version": "1.0.0" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json deleted file mode 100644 index aa2be496..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "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" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/internal/file.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/internal/file.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/y/y.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/y/y.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/internal/i.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/internal/i.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/nested/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js deleted file mode 100644 index e5b70a86..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = { nested: "nested" } diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-3/nested/f/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-3/nested/f/nested/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-4/f/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-4/f/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f$/$.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f$/$.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f/$.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f/$.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/nested/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/a.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/a.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/b.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/dir/b.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/dir/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/index.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json deleted file mode 100644 index 8d8d3a46..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "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/lib2/", "./lib/"], - "node": "./lib/", - "default": "./lib/" - }, - "./dist/a.js": "./../../a.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/c/index.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/c/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/imports-field/package.json deleted file mode 100644 index 248351a9..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "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" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/a.js b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json deleted file mode 100644 index ded7faa2..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json +++ /dev/null @@ -1,2 +0,0 @@ -{ - "main": "./a.js", diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/a.js b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/package.json b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/package.json deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/issue-238/package.json b/fixtures/enhanced_resolve/test/fixtures/issue-238/package.json deleted file mode 100644 index 352055cd..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/issue-238/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "private": true -} diff --git a/fixtures/enhanced_resolve/test/fixtures/issue-238/src/a/config.js b/fixtures/enhanced_resolve/test/fixtures/issue-238/src/a/config.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/issue-238/src/common/config/myObjectFile.js b/fixtures/enhanced_resolve/test/fixtures/issue-238/src/common/config/myObjectFile.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/lib.js b/fixtures/enhanced_resolve/test/fixtures/lib.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/lib/complex1.js b/fixtures/enhanced_resolve/test/fixtures/lib/complex1.js deleted file mode 100644 index b3de3d70..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/lib/complex1.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "lib complex1"; diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self/index.js b/fixtures/enhanced_resolve/test/fixtures/main-field-self/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json b/fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json deleted file mode 100644 index a2b6f341..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "./" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self2/index.js b/fixtures/enhanced_resolve/test/fixtures/main-field-self2/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json b/fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json deleted file mode 100644 index 4fa6f730..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "." -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main1.js b/fixtures/enhanced_resolve/test/fixtures/main1.js deleted file mode 100644 index 168f2a1e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main1.js +++ /dev/null @@ -1,9 +0,0 @@ -var a = require("./a"); -if (x) { - for (var i = 0; i < 100; i++) { - while (true) require("./b"); - do { - i++; - } while (require("m1/a")()); - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main2.js b/fixtures/enhanced_resolve/test/fixtures/main2.js deleted file mode 100644 index 39f062b1..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main2.js +++ /dev/null @@ -1,12 +0,0 @@ -var 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"); - }); - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main3.js b/fixtures/enhanced_resolve/test/fixtures/main3.js deleted file mode 100644 index 1c180166..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main3.js +++ /dev/null @@ -1,4 +0,0 @@ -var a = require("./a"); -require.ensure([], function(require) { - require("./c.js"); -}); diff --git a/fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js b/fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js deleted file mode 100644 index 997c1051..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is nested m1/a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/no#fragment/#/#.js b/fixtures/enhanced_resolve/test/fixtures/no#fragment/#/#.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/no.js b/fixtures/enhanced_resolve/test/fixtures/no.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/browser.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/browser.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/main.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json deleted file mode 100644 index c469e1fd..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "main": "./main.js", - "browser": "./browser.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js deleted file mode 100644 index 549620a5..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "the correct a.js"; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js deleted file mode 100644 index 5db6632e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = " :) " + require("m2/b.js"); diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js deleted file mode 100644 index d308569d..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require("m1/a") + require("m1"); diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js deleted file mode 100644 index cb8127e8..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "Step2"; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json deleted file mode 100644 index 8d6dfa56..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "dash-name", - "exports": "./index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json deleted file mode 100644 index 4fd8706e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "dash", - "exports": "./index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/invalidPackageJson/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/invalidPackageJson/package.json deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js deleted file mode 100644 index 46fc8e6c..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is m1/a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js deleted file mode 100644 index 8565c244..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is m1/b"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js deleted file mode 100644 index 34faaaf5..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "This is m2/b"; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/file.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/file.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js b/fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js deleted file mode 100644 index 997c1051..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is nested m1/a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/dir/index.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/dir/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/index.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/main.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/browser.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/browser.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/index.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json deleted file mode 100644 index e20ceaeb..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "main": "main.js", - "browser": { - "./package-alias/index.js": "./package-alias/browser.js", - "module": "pkg/dir/index" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/typescript/index.ts b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/typescript/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json deleted file mode 100644 index 4a1f838e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "@exports-field/core", - "version": "1.0.0", - "exports": { - ".": "./a.js", - "./x": "./a.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/prefer-pnp/alternative-modules/m1/b.js b/fixtures/enhanced_resolve/test/fixtures/prefer-pnp/alternative-modules/m1/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.css b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.css deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.js b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json deleted file mode 100644 index 14ab704d..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/index.css b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/index.css deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/module.js b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/module.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json deleted file mode 100644 index ee0eb71b..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "main": "../../../c.js", - "module": "module.js", - "style": "index.css" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/roots_fall_through/index.js b/fixtures/enhanced_resolve/test/fixtures/roots_fall_through/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/main.js b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json deleted file mode 100644 index 70a0f20f..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "browser": { - "./index.js": "./main.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/lib/index.js b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/lib/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/main.js b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json deleted file mode 100644 index 2af9e0d1..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "./main.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/shortcutdir.js/a.js b/fixtures/enhanced_resolve/test/fixtures/shortcutdir.js/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/b b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/b deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/c b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/c deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/a b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/a deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/b b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/b deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/b/foo/a b/fixtures/enhanced_resolve/test/fixtures/yield/b/foo/a deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/a b/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/a deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json b/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json deleted file mode 100644 index 0acc4b4c..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "foo", - "version": "1.0.0", - "browser": { - "./a": false - } -} diff --git "a/fixtures/enhanced_resolve/test/fixtures/\346\265\213\350\257\225.js" "b/fixtures/enhanced_resolve/test/fixtures/\346\265\213\350\257\225.js" deleted file mode 100644 index e69de29b..00000000 diff --git "a/fixtures/misc/\344\270\255\346\226\207/\344\270\255\346\226\207.js" "b/fixtures/misc/\344\270\255\346\226\207/\344\270\255\346\226\207.js" deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/pnpm8/.gitignore b/fixtures/pnpm8/.gitignore deleted file mode 100644 index 3c3629e6..00000000 --- a/fixtures/pnpm8/.gitignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/fixtures/pnpm8/package.json b/fixtures/pnpm8/package.json deleted file mode 100644 index cbced892..00000000 --- a/fixtures/pnpm8/package.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "name": "pnpm8", - "version": "1.0.0", - "private": true, - "engines": { - "node": ">=16.0.0" - }, - "packageManager": "pnpm@8.10.5", - "devDependencies": { - "axios": "1.6.2", - "styled-components": "6.1.1", - "postcss": "8.4.33" - } -} diff --git a/fixtures/pnpm8/pnpm-lock.yaml b/fixtures/pnpm8/pnpm-lock.yaml deleted file mode 100644 index e51dfd6a..00000000 --- a/fixtures/pnpm8/pnpm-lock.yaml +++ /dev/null @@ -1,212 +0,0 @@ -lockfileVersion: '6.0' - -settings: - autoInstallPeers: true - excludeLinksFromLockfile: false - -devDependencies: - axios: - specifier: 1.6.2 - version: 1.6.2 - postcss: - specifier: 8.4.33 - version: 8.4.33 - styled-components: - specifier: 6.1.1 - version: 6.1.1(react-dom@18.2.0)(react@18.2.0) - -packages: - - /@emotion/is-prop-valid@1.2.1: - resolution: {integrity: sha512-61Mf7Ufx4aDxx1xlDeOm8aFFigGHE4z+0sKCa+IHCeZKiyP9RLD0Mmx7m8b9/Cf37f7NAvQOOJAbQQGVr5uERw==} - dependencies: - '@emotion/memoize': 0.8.1 - dev: true - - /@emotion/memoize@0.8.1: - resolution: {integrity: sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA==} - dev: true - - /@emotion/unitless@0.8.1: - resolution: {integrity: sha512-KOEGMu6dmJZtpadb476IsZBclKvILjopjUii3V+7MnXIQCYh8W3NgNcgwo21n9LXZX6EDIKvqfjYxXebDwxKmQ==} - dev: true - - /@types/stylis@4.2.4: - resolution: {integrity: sha512-36ZrGJ8fgtBr6nwNnuJ9jXIj+bn/pF6UoqmrQT7+Y99+tFFeHHsoR54+194dHdyhPjgbeoNz3Qru0oRt0l6ASQ==} - dev: true - - /asynckit@0.4.0: - resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} - dev: true - - /axios@1.6.2: - resolution: {integrity: sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A==} - dependencies: - follow-redirects: 1.15.3 - form-data: 4.0.0 - proxy-from-env: 1.1.0 - transitivePeerDependencies: - - debug - dev: true - - /camelize@1.0.1: - resolution: {integrity: sha512-dU+Tx2fsypxTgtLoE36npi3UqcjSSMNYfkqgmoEhtZrraP5VWq0K7FkWVTYa8eMPtnU/G2txVsfdCJTn9uzpuQ==} - dev: true - - /combined-stream@1.0.8: - resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} - engines: {node: '>= 0.8'} - dependencies: - delayed-stream: 1.0.0 - dev: true - - /css-color-keywords@1.0.0: - resolution: {integrity: sha512-FyyrDHZKEjXDpNJYvVsV960FiqQyXc/LlYmsxl2BcdMb2WPx0OGRVgTg55rPSyLSNMqP52R9r8geSp7apN3Ofg==} - engines: {node: '>=4'} - dev: true - - /css-to-react-native@3.2.0: - resolution: {integrity: sha512-e8RKaLXMOFii+02mOlqwjbD00KSEKqblnpO9e++1aXS1fPQOpS1YoqdVHBqPjHNoxeF2mimzVqawm2KCbEdtHQ==} - dependencies: - camelize: 1.0.1 - css-color-keywords: 1.0.0 - postcss-value-parser: 4.2.0 - dev: true - - /csstype@3.1.2: - resolution: {integrity: sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==} - dev: true - - /delayed-stream@1.0.0: - resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} - engines: {node: '>=0.4.0'} - dev: true - - /follow-redirects@1.15.3: - resolution: {integrity: sha512-1VzOtuEM8pC9SFU1E+8KfTjZyMztRsgEfwQl44z8A25uy13jSzTj6dyK2Df52iV0vgHCfBwLhDWevLn95w5v6Q==} - engines: {node: '>=4.0'} - peerDependencies: - debug: '*' - peerDependenciesMeta: - debug: - optional: true - dev: true - - /form-data@4.0.0: - resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==} - engines: {node: '>= 6'} - dependencies: - asynckit: 0.4.0 - combined-stream: 1.0.8 - mime-types: 2.1.35 - dev: true - - /js-tokens@4.0.0: - resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} - dev: true - - /loose-envify@1.4.0: - resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==} - hasBin: true - dependencies: - js-tokens: 4.0.0 - dev: true - - /mime-db@1.52.0: - resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} - engines: {node: '>= 0.6'} - dev: true - - /mime-types@2.1.35: - resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} - engines: {node: '>= 0.6'} - dependencies: - mime-db: 1.52.0 - dev: true - - /nanoid@3.3.7: - resolution: {integrity: sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==} - engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} - hasBin: true - dev: true - - /picocolors@1.0.0: - resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==} - dev: true - - /postcss-value-parser@4.2.0: - resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==} - dev: true - - /postcss@8.4.33: - resolution: {integrity: sha512-Kkpbhhdjw2qQs2O2DGX+8m5OVqEcbB9HRBvuYM9pgrjEFUg30A9LmXNlTAUj4S9kgtGyrMbTzVjH7E+s5Re2yg==} - engines: {node: ^10 || ^12 || >=14} - dependencies: - nanoid: 3.3.7 - picocolors: 1.0.0 - source-map-js: 1.0.2 - dev: true - - /proxy-from-env@1.1.0: - resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==} - dev: true - - /react-dom@18.2.0(react@18.2.0): - resolution: {integrity: sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==} - peerDependencies: - react: ^18.2.0 - dependencies: - loose-envify: 1.4.0 - react: 18.2.0 - scheduler: 0.23.0 - dev: true - - /react@18.2.0: - resolution: {integrity: sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==} - engines: {node: '>=0.10.0'} - dependencies: - loose-envify: 1.4.0 - dev: true - - /scheduler@0.23.0: - resolution: {integrity: sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw==} - dependencies: - loose-envify: 1.4.0 - dev: true - - /shallowequal@1.1.0: - resolution: {integrity: sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ==} - dev: true - - /source-map-js@1.0.2: - resolution: {integrity: sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==} - engines: {node: '>=0.10.0'} - dev: true - - /styled-components@6.1.1(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-cpZZP5RrKRIClBW5Eby4JM1wElLVP4NQrJbJ0h10TidTyJf4SIIwa3zLXOoPb4gJi8MsJ8mjq5mu2IrEhZIAcQ==} - engines: {node: '>= 16'} - peerDependencies: - react: '>= 16.8.0' - react-dom: '>= 16.8.0' - dependencies: - '@emotion/is-prop-valid': 1.2.1 - '@emotion/unitless': 0.8.1 - '@types/stylis': 4.2.4 - css-to-react-native: 3.2.0 - csstype: 3.1.2 - postcss: 8.4.33 - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - shallowequal: 1.1.0 - stylis: 4.3.0 - tslib: 2.6.2 - dev: true - - /stylis@4.3.0: - resolution: {integrity: sha512-E87pIogpwUsUwXw7dNyU4QDjdgVMy52m+XEOPEKUn161cCzWjjhPSQhByfd1CcNvrOLnXQ6OnnZDwnJrz/Z4YQ==} - dev: true - - /tslib@2.6.2: - resolution: {integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==} - dev: true diff --git a/fixtures/tsconfig/cases/builtins/thing.js b/fixtures/tsconfig/cases/builtins/thing.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/builtins/tsconfig.json b/fixtures/tsconfig/cases/builtins/tsconfig.json deleted file mode 100644 index 36aa1a4d..00000000 --- a/fixtures/tsconfig/cases/builtins/tsconfig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compilerOptions": { - "baseUrl": "." - } -} diff --git a/fixtures/tsconfig/cases/exports/index.js b/fixtures/tsconfig/cases/exports/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/exports/tsconfig.json b/fixtures/tsconfig/cases/exports/tsconfig.json deleted file mode 100644 index f0e3159b..00000000 --- a/fixtures/tsconfig/cases/exports/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-exports" -} diff --git a/fixtures/tsconfig/cases/extends-extension/base-tsconfig.json b/fixtures/tsconfig/cases/extends-extension/base-tsconfig.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/cases/extends-extension/base-tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/cases/extends-extension/foo.js b/fixtures/tsconfig/cases/extends-extension/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-extension/tsconfig.json b/fixtures/tsconfig/cases/extends-extension/tsconfig.json deleted file mode 100644 index 0ae4c6a3..00000000 --- a/fixtures/tsconfig/cases/extends-extension/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./base-tsconfig" -} diff --git a/fixtures/tsconfig/cases/extends-extensionless/foo.js b/fixtures/tsconfig/cases/extends-extensionless/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-extensionless/tsconfig.json b/fixtures/tsconfig/cases/extends-extensionless/tsconfig.json deleted file mode 100644 index c36cb7d4..00000000 --- a/fixtures/tsconfig/cases/extends-extensionless/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-field/conf" -} diff --git a/fixtures/tsconfig/cases/extends-multiple/foo.js b/fixtures/tsconfig/cases/extends-multiple/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-multiple/tsconfig.json b/fixtures/tsconfig/cases/extends-multiple/tsconfig.json deleted file mode 100644 index aa2ae783..00000000 --- a/fixtures/tsconfig/cases/extends-multiple/tsconfig.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": ["../extends-extension", "../extends-paths"], - "compilerOptions": { - "baseUrl": ".", - }, -} diff --git a/fixtures/tsconfig/cases/extends-not-found/index.js b/fixtures/tsconfig/cases/extends-not-found/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-not-found/tsconfig.json b/fixtures/tsconfig/cases/extends-not-found/tsconfig.json deleted file mode 100644 index 99df91da..00000000 --- a/fixtures/tsconfig/cases/extends-not-found/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./not-found" -} diff --git a/fixtures/tsconfig/cases/extends-paths/src/index.js b/fixtures/tsconfig/cases/extends-paths/src/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-paths/tsconfig.base.json b/fixtures/tsconfig/cases/extends-paths/tsconfig.base.json deleted file mode 100644 index 5c64b067..00000000 --- a/fixtures/tsconfig/cases/extends-paths/tsconfig.base.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "@/*": ["./*"] - } - } -} diff --git a/fixtures/tsconfig/cases/extends-paths/tsconfig.json b/fixtures/tsconfig/cases/extends-paths/tsconfig.json deleted file mode 100644 index 51086018..00000000 --- a/fixtures/tsconfig/cases/extends-paths/tsconfig.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": "./tsconfig.base.json", - "compilerOptions": { - "baseUrl": "src", - }, -} diff --git a/fixtures/tsconfig/cases/field/index.js b/fixtures/tsconfig/cases/field/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/field/tsconfig.json b/fixtures/tsconfig/cases/field/tsconfig.json deleted file mode 100644 index 9f86c3f4..00000000 --- a/fixtures/tsconfig/cases/field/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-field" -} diff --git a/fixtures/tsconfig/cases/index/index.js b/fixtures/tsconfig/cases/index/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/index/tsconfig.json b/fixtures/tsconfig/cases/index/tsconfig.json deleted file mode 100644 index d20b1774..00000000 --- a/fixtures/tsconfig/cases/index/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-index" -} diff --git a/fixtures/tsconfig/cases/paths_template_variable/foo.js b/fixtures/tsconfig/cases/paths_template_variable/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json b/fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json deleted file mode 100644 index a1a37bb6..00000000 --- a/fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "../../tsconfig_template_variable.json" -} diff --git a/fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json b/fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json deleted file mode 100644 index e7d8e5e5..00000000 --- a/fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "compilerOptions": { - "composite": true, - "paths": { - "foo": ["${configDir}/foo.js"] - } - } -} diff --git a/fixtures/tsconfig/cases/project_references/app/aliased/index.ts b/fixtures/tsconfig/cases/project_references/app/aliased/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/app/index.ts b/fixtures/tsconfig/cases/project_references/app/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/app/tsconfig.json b/fixtures/tsconfig/cases/project_references/app/tsconfig.json deleted file mode 100644 index 7036d2bb..00000000 --- a/fixtures/tsconfig/cases/project_references/app/tsconfig.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "extends": "../tsconfig.base.json", - "compilerOptions": { - "baseUrl": "./", - "paths": { - "@/*": ["./aliased/*"] - } - }, - "references": [ - { - "path": "../project_a/conf.json" - }, - { - "path": "../project_b" - }, - { - "path": "../project_c/tsconfig.json" - }, - { - "path": "../../paths_template_variable/tsconfig2.json" - } - ] -} diff --git a/fixtures/tsconfig/cases/project_references/project_a/aliased/index.ts b/fixtures/tsconfig/cases/project_references/project_a/aliased/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_a/conf.json b/fixtures/tsconfig/cases/project_references/project_a/conf.json deleted file mode 100644 index 4d389d7a..00000000 --- a/fixtures/tsconfig/cases/project_references/project_a/conf.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "compilerOptions": { - "composite": true, - "paths": { - "@/*": ["./aliased/*"] - } - } -} diff --git a/fixtures/tsconfig/cases/project_references/project_a/index.ts b/fixtures/tsconfig/cases/project_references/project_a/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_b/src/aliased/index.ts b/fixtures/tsconfig/cases/project_references/project_b/src/aliased/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_b/tsconfig.json b/fixtures/tsconfig/cases/project_references/project_b/tsconfig.json deleted file mode 100644 index 4ab05cd8..00000000 --- a/fixtures/tsconfig/cases/project_references/project_b/tsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "compilerOptions": { - "composite": true, - "baseUrl": "./src", - "paths": { - "@/*": ["./aliased/*"] - } - } -} diff --git a/fixtures/tsconfig/cases/project_references/project_c/index.ts b/fixtures/tsconfig/cases/project_references/project_c/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_c/tsconfig.json b/fixtures/tsconfig/cases/project_references/project_c/tsconfig.json deleted file mode 100644 index fe520939..00000000 --- a/fixtures/tsconfig/cases/project_references/project_c/tsconfig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compilerOptions": { - "composite": true - } -} diff --git a/fixtures/tsconfig/cases/project_references/tsconfig.base.json b/fixtures/tsconfig/cases/project_references/tsconfig.base.json deleted file mode 100644 index 88ccffe7..00000000 --- a/fixtures/tsconfig/cases/project_references/tsconfig.base.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "compilerOptions": { - } -} diff --git a/fixtures/tsconfig/cases/suffixes/a.ios.ts b/fixtures/tsconfig/cases/suffixes/a.ios.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/a.ts b/fixtures/tsconfig/cases/suffixes/a.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/b.ts b/fixtures/tsconfig/cases/suffixes/b.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/c-test.ts b/fixtures/tsconfig/cases/suffixes/c-test.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/index.ts b/fixtures/tsconfig/cases/suffixes/index.ts deleted file mode 100644 index b09939b9..00000000 --- a/fixtures/tsconfig/cases/suffixes/index.ts +++ /dev/null @@ -1 +0,0 @@ -import './a'; diff --git a/fixtures/tsconfig/cases/suffixes/tsconfig.json b/fixtures/tsconfig/cases/suffixes/tsconfig.json deleted file mode 100644 index 4c2ccc8f..00000000 --- a/fixtures/tsconfig/cases/suffixes/tsconfig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compilerOptions": { - "moduleSuffixes": [".ios", "-test", ""] - } -} diff --git a/fixtures/tsconfig/cases/trailing-comma/bar.js b/fixtures/tsconfig/cases/trailing-comma/bar.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/trailing-comma/index.js b/fixtures/tsconfig/cases/trailing-comma/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/trailing-comma/tsconfig.json b/fixtures/tsconfig/cases/trailing-comma/tsconfig.json deleted file mode 100644 index 6dc20ca5..00000000 --- a/fixtures/tsconfig/cases/trailing-comma/tsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "compilerOptions": { - "paths": { - /* some comment */ - "foo": ["bar.js"], - }, - }, - // another comment -} diff --git a/fixtures/tsconfig/foo.js b/fixtures/tsconfig/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/nested/index.js b/fixtures/tsconfig/nested/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/nested/test.js b/fixtures/tsconfig/nested/test.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/nested/tsconfig.json b/fixtures/tsconfig/nested/tsconfig.json deleted file mode 100644 index 6deb3011..00000000 --- a/fixtures/tsconfig/nested/tsconfig.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "extends": "..", - "compilerOptions": { - "paths": { - "ts-path": ["test.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-exports/conf.json b/fixtures/tsconfig/node_modules/tsconfig-exports/conf.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-exports/conf.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-exports/foo.js b/fixtures/tsconfig/node_modules/tsconfig-exports/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-exports/package.json b/fixtures/tsconfig/node_modules/tsconfig-exports/package.json deleted file mode 100644 index be0ddee6..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-exports/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "tsconfig-exports", - "private": true, - "exports": { - ".": "./conf.json" - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-field/conf.json b/fixtures/tsconfig/node_modules/tsconfig-field/conf.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-field/conf.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-field/foo.js b/fixtures/tsconfig/node_modules/tsconfig-field/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-field/package.json b/fixtures/tsconfig/node_modules/tsconfig-field/package.json deleted file mode 100644 index 7138fdde..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-field/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "tsconfig-field", - "private": true, - "tsconfig": "conf.json" -} \ No newline at end of file diff --git a/fixtures/tsconfig/node_modules/tsconfig-index/foo.js b/fixtures/tsconfig/node_modules/tsconfig-index/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-index/package.json b/fixtures/tsconfig/node_modules/tsconfig-index/package.json deleted file mode 100644 index eb2431e7..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-index/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "tsconfig-index", - "private": true -} \ No newline at end of file diff --git a/fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json b/fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-not-used/foo.js b/fixtures/tsconfig/node_modules/tsconfig-not-used/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json b/fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json deleted file mode 100644 index eb16d127..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "ts-path": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/package.json b/fixtures/tsconfig/package.json deleted file mode 100755 index f48acd1c..00000000 --- a/fixtures/tsconfig/package.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "name": "resolver", - "private": true, - "alias": { - "aliased": "foo", - "aliased-file": "./bar.js", - "something": "./nested/test.js", - "aliasedfolder": "./nested", - "aliasedabsolute": "/nested", - "foo/bar": "./bar.js", - "glob/*/*": "./nested/$2", - "./baz": "./bar.js", - "url": false - }, - "imports": { - "#test": "./bar.js" - }, - "dependencies": { - "foo": "^0.3.4" - }, - "peerDependencies": { - "bar": "*" - } -} diff --git a/fixtures/tsconfig/tsconfig.json b/fixtures/tsconfig/tsconfig.json deleted file mode 100644 index eb16d127..00000000 --- a/fixtures/tsconfig/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "ts-path": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/tsconfig_template_variable.json b/fixtures/tsconfig/tsconfig_template_variable.json deleted file mode 100644 index 6f272344..00000000 --- a/fixtures/tsconfig/tsconfig_template_variable.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["${configDir}/foo.js"] - } - } -} diff --git a/napi/__test__/resolver.spec.mjs b/napi/__test__/resolver.spec.mjs deleted file mode 100644 index 42bafba9..00000000 --- a/napi/__test__/resolver.spec.mjs +++ /dev/null @@ -1,259 +0,0 @@ -import { join } from 'node:path' -import { fileURLToPath } from 'node:url' - -import test from 'ava' - -let ResolverFactory - -if (process.env.WASI_TEST) { - const wasi = await import('../resolver.wasi.cjs') - ResolverFactory = wasi.ResolverFactory -} else { - const napi = await import('../index.js') - ResolverFactory = napi.ResolverFactory -} - -const currentDir = join(fileURLToPath(import.meta.url), '..') - -const enhancedResolveRoot = join( - currentDir, - '..', - '..', - 'fixtures', - 'enhanced_resolve', - 'test', - 'fixtures' -) - -// https://github.com/webpack/enhanced-resolve/blob/main/test/resolve.test.js - -for (const [title, context, request, expected] of [ - [ - 'absolute path', - enhancedResolveRoot, - join(enhancedResolveRoot, 'main1.js'), - join(enhancedResolveRoot, 'main1.js'), - ], - [ - 'file with .js', - enhancedResolveRoot, - './main1.js', - join(enhancedResolveRoot, 'main1.js'), - ], - [ - 'file without extension', - enhancedResolveRoot, - './main1', - join(enhancedResolveRoot, 'main1.js'), - ], - [ - 'another file with .js', - enhancedResolveRoot, - './a.js', - join(enhancedResolveRoot, 'a.js'), - ], - [ - 'another file without extension', - enhancedResolveRoot, - './a', - join(enhancedResolveRoot, 'a.js'), - ], - [ - 'file in module with .js', - enhancedResolveRoot, - 'm1/a.js', - join(enhancedResolveRoot, 'node_modules/m1/a.js'), - ], - [ - 'file in module without extension', - enhancedResolveRoot, - 'm1/a', - join(enhancedResolveRoot, 'node_modules/m1/a.js'), - ], - [ - 'another file in module without extension', - enhancedResolveRoot, - 'complexm/step1', - join(enhancedResolveRoot, 'node_modules/complexm/step1.js'), - ], - [ - 'from submodule to file in sibling module', - join(enhancedResolveRoot, 'node_modules/complexm'), - 'm2/b.js', - join(enhancedResolveRoot, 'node_modules/m2/b.js'), - ], - [ - 'from nested directory to overwritten file in module', - join(enhancedResolveRoot, 'multiple_modules'), - 'm1/a.js', - join(enhancedResolveRoot, 'multiple_modules/node_modules/m1/a.js'), - ], - [ - 'from nested directory to not overwritten file in module', - join(enhancedResolveRoot, 'multiple_modules'), - 'm1/b.js', - join(enhancedResolveRoot, 'node_modules/m1/b.js'), - ], - [ - 'file with query', - enhancedResolveRoot, - './main1.js?query', - join(enhancedResolveRoot, 'main1.js?query'), - ], - [ - 'file with fragment', - enhancedResolveRoot, - './main1.js#fragment', - join(enhancedResolveRoot, 'main1.js#fragment'), - ], - [ - 'file with fragment and query', - enhancedResolveRoot, - './main1.js#fragment?query', - join(enhancedResolveRoot, 'main1.js#fragment?query'), - ], - [ - 'file with query and fragment', - enhancedResolveRoot, - './main1.js?#fragment', - join(enhancedResolveRoot, 'main1.js?#fragment'), - ], - - [ - 'file with query (unicode)', - enhancedResolveRoot, - './测试.js?query', - join(enhancedResolveRoot, '测试.js?query'), - ], - [ - 'file with fragment (unicode)', - enhancedResolveRoot, - './测试.js#fragment', - join(enhancedResolveRoot, '测试.js#fragment'), - ], - [ - 'file with fragment and query (unicode)', - enhancedResolveRoot, - './测试.js#fragment?query', - join(enhancedResolveRoot, '测试.js#fragment?query'), - ], - [ - 'file with query and fragment (unicode)', - enhancedResolveRoot, - './测试.js?#fragment', - join(enhancedResolveRoot, '测试.js?#fragment'), - ], - - [ - 'file in module with query', - enhancedResolveRoot, - 'm1/a?query', - join(enhancedResolveRoot, 'node_modules/m1/a.js?query'), - ], - [ - 'file in module with fragment', - enhancedResolveRoot, - 'm1/a#fragment', - join(enhancedResolveRoot, 'node_modules/m1/a.js#fragment'), - ], - [ - 'file in module with fragment and query', - enhancedResolveRoot, - 'm1/a#fragment?query', - join(enhancedResolveRoot, 'node_modules/m1/a.js#fragment?query'), - ], - [ - 'file in module with query and fragment', - enhancedResolveRoot, - 'm1/a?#fragment', - join(enhancedResolveRoot, 'node_modules/m1/a.js?#fragment'), - ], - [ - 'differ between directory and file, resolve file', - enhancedResolveRoot, - './dirOrFile', - join(enhancedResolveRoot, 'dirOrFile.js'), - ], - [ - 'differ between directory and file, resolve directory', - enhancedResolveRoot, - './dirOrFile/', - join(enhancedResolveRoot, 'dirOrFile/index.js'), - ], - [ - 'find node_modules outside of node_modules', - join(enhancedResolveRoot, 'browser-module/node_modules'), - 'm1/a', - join(enhancedResolveRoot, 'node_modules/m1/a.js'), - ], - [ - "don't crash on main field pointing to self", - enhancedResolveRoot, - './main-field-self', - join(enhancedResolveRoot, './main-field-self/index.js'), - ], - [ - "don't crash on main field pointing to self (2)", - enhancedResolveRoot, - './main-field-self2', - join(enhancedResolveRoot, './main-field-self2/index.js'), - ], - // enhanced-resolve has `#` prepended with a `\0`, they are removed from the - // following 3 expected test results. - // See https://github.com/webpack/enhanced-resolve#escaping - [ - 'handle fragment edge case (no fragment)', - enhancedResolveRoot, - './no#fragment/#/#', - join(enhancedResolveRoot, 'no#fragment', '#', '#.js'), - ], - [ - 'handle fragment edge case (fragment)', - enhancedResolveRoot, - './no#fragment/#/', - join(enhancedResolveRoot, 'no.js#fragment') + '/#/', - ], - [ - 'handle fragment escaping', - enhancedResolveRoot, - './no\0#fragment/\0#/\0##fragment', - join(enhancedResolveRoot, 'no#fragment', '#', '#.js#fragment'), - ], -]) { - test(title, (t) => { - const resolver = new ResolverFactory({ - modules: ['src/a', 'src/b', 'src/common', 'node_modules'], - extensions: ['.js', '.jsx', '.ts', '.tsx'], - }) - - t.is(resolver.sync(context, request).path, expected) - }) -} - -test('resolve pnpm package', (t) => { - const pnpmProjectPath = join(currentDir, '..', '..', 'fixtures', 'pnpm8') - const resolver = new ResolverFactory({ - aliasFields: ['browser'], - }) - t.deepEqual(resolver.sync(pnpmProjectPath, 'styled-components'), { - path: join( - pnpmProjectPath, - 'node_modules/.pnpm/styled-components@6.1.1_react-dom@18.2.0_react@18.2.0/node_modules/styled-components/dist/styled-components.browser.cjs.js' - ), - }) - t.deepEqual( - resolver.sync( - join( - pnpmProjectPath, - 'node_modules/.pnpm/styled-components@6.1.1_react-dom@18.2.0_react@18.2.0/node_modules/styled-components' - ), - 'react' - ), - { - path: join( - pnpmProjectPath, - 'node_modules/.pnpm/react@18.2.0/node_modules/react/index.js' - ), - } - ) -}) diff --git a/napi/src/lib.rs b/napi/src/lib.rs deleted file mode 100644 index 238f99c4..00000000 --- a/napi/src/lib.rs +++ /dev/null @@ -1,166 +0,0 @@ -extern crate napi; -extern crate napi_derive; -extern crate oxc_resolver; - -use std::path::{Path, PathBuf}; - -use napi_derive::napi; -use oxc_resolver::{ResolveOptions, Resolver}; - -use self::options::{NapiResolveOptions, StrOrStrList}; - -mod options; - -#[napi(object)] -pub struct ResolveResult { - pub path: Option, - pub error: Option, -} - -fn resolve(resolver: &Resolver, path: &Path, request: &str) -> ResolveResult { - match resolver.resolve(path, request) { - Ok(resolution) => ResolveResult { - path: Some(resolution.full_path().to_string_lossy().to_string()), - error: None, - }, - Err(err) => ResolveResult { path: None, error: Some(err.to_string()) }, - } -} - -#[allow(clippy::needless_pass_by_value)] -#[napi] -pub fn sync(path: String, request: String) -> ResolveResult { - let path = PathBuf::from(path); - let resolver = Resolver::new(ResolveOptions::default()); - resolve(&resolver, &path, &request) -} - -#[napi] -pub struct ResolverFactory { - resolver: Resolver, -} - -#[napi] -impl ResolverFactory { - #[napi(constructor)] - pub fn new(options: NapiResolveOptions) -> Self { - Self { resolver: Resolver::new(Self::normalize_options(options)) } - } - - #[napi] - pub fn default() -> Self { - let default_options = ResolveOptions::default(); - Self { resolver: Resolver::new(default_options) } - } - - /// Clone the resolver using the same underlying cache. - #[napi] - pub fn clone_with_options(&self, options: NapiResolveOptions) -> Self { - Self { resolver: self.resolver.clone_with_options(Self::normalize_options(options)) } - } - - /// Clear the underlying cache. - #[napi] - pub fn clear_cache(&self) { - self.resolver.clear_cache(); - } - - #[allow(clippy::needless_pass_by_value)] - #[napi] - pub fn sync(&self, path: String, request: String) -> ResolveResult { - let path = PathBuf::from(path); - resolve(&self.resolver, &path, &request) - } - - fn normalize_options(op: NapiResolveOptions) -> ResolveOptions { - let default = ResolveOptions::default(); - // merging options - ResolveOptions { - tsconfig: op.tsconfig.map(|tsconfig| tsconfig.into()), - alias: op - .alias - .map(|alias| { - alias - .into_iter() - .map(|(k, v)| { - let v = v - .into_iter() - .map(|item| match item { - Some(path) => oxc_resolver::AliasValue::from(path), - None => oxc_resolver::AliasValue::Ignore, - }) - .collect(); - (k, v) - }) - .collect::>() - }) - .unwrap_or(default.alias), - alias_fields: op - .alias_fields - .map(|o| o.into_iter().map(|x| StrOrStrList(x).into()).collect::>()) - .unwrap_or(default.alias_fields), - condition_names: op.condition_names.unwrap_or(default.condition_names), - description_files: op.description_files.unwrap_or(default.description_files), - enforce_extension: op - .enforce_extension - .map(|enforce_extension| enforce_extension.into()) - .unwrap_or(default.enforce_extension), - exports_fields: op - .exports_fields - .map(|o| o.into_iter().map(|x| StrOrStrList(x).into()).collect::>()) - .unwrap_or(default.exports_fields), - imports_fields: op - .imports_fields - .map(|o| o.into_iter().map(|x| StrOrStrList(x).into()).collect::>()) - .unwrap_or(default.imports_fields), - extension_alias: op - .extension_alias - .map(|extension_alias| extension_alias.into_iter().collect::>()) - .unwrap_or(default.extension_alias), - extensions: op.extensions.unwrap_or(default.extensions), - fallback: op - .fallback - .map(|fallback| { - fallback - .into_iter() - .map(|(k, v)| { - let v = v - .into_iter() - .map(|item| match item { - Some(path) => oxc_resolver::AliasValue::from(path), - None => oxc_resolver::AliasValue::Ignore, - }) - .collect(); - (k, v) - }) - .collect::>() - }) - .unwrap_or(default.fallback), - fully_specified: op.fully_specified.unwrap_or(default.fully_specified), - main_fields: op - .main_fields - .map(|o| StrOrStrList(o).into()) - .unwrap_or(default.main_fields), - main_files: op.main_files.unwrap_or(default.main_files), - modules: op.modules.map(|o| StrOrStrList(o).into()).unwrap_or(default.modules), - resolve_to_context: op.resolve_to_context.unwrap_or(default.resolve_to_context), - prefer_relative: op.prefer_relative.unwrap_or(default.prefer_relative), - prefer_absolute: op.prefer_absolute.unwrap_or(default.prefer_absolute), - restrictions: op - .restrictions - .map(|restrictions| { - restrictions - .into_iter() - .map(|restriction| restriction.into()) - .collect::>() - }) - .unwrap_or(default.restrictions), - roots: op - .roots - .map(|roots| roots.into_iter().map(PathBuf::from).collect::>()) - .unwrap_or(default.roots), - symlinks: op.symlinks.unwrap_or(default.symlinks), - builtin_modules: op.builtin_modules.unwrap_or(default.builtin_modules), - } - } -} diff --git a/napi/src/options.rs b/napi/src/options.rs deleted file mode 100644 index ea35672f..00000000 --- a/napi/src/options.rs +++ /dev/null @@ -1,261 +0,0 @@ -use std::path::PathBuf; - -use napi::Either; -use napi_derive::napi; -use std::collections::HashMap; - -/// Module Resolution Options -/// -/// Options are directly ported from [enhanced-resolve](https://github.com/webpack/enhanced-resolve#resolver-options). -/// -/// See [webpack resolve](https://webpack.js.org/configuration/resolve/) for information and examples -#[derive(Debug, Clone)] -#[napi(object)] -pub struct NapiResolveOptions { - /// Path to TypeScript configuration file. - /// - /// Default `None` - pub tsconfig: Option, - - /// Alias for [ResolveOptions::alias] and [ResolveOptions::fallback]. - /// - /// For the second value of the tuple, `None -> AliasValue::Ignore`, Some(String) -> - /// AliasValue::Path(String)` - /// Create aliases to import or require certain modules more easily. - /// A trailing $ can also be added to the given object's keys to signify an exact match. - pub alias: Option>>>, - - /// A list of alias fields in description files. - /// Specify a field, such as `browser`, to be parsed according to [this specification](https://github.com/defunctzombie/package-browser-field-spec). - /// Can be a path to json object such as `["path", "to", "exports"]`. - /// - /// Default `[]` - #[napi(ts_type = "(string | string[])[]")] - pub alias_fields: Option>, - - /// Condition names for exports field which defines entry points of a package. - /// The key order in the exports field is significant. During condition matching, earlier entries have higher priority and take precedence over later entries. - /// - /// Default `[]` - pub condition_names: Option>, - - /// The JSON files to use for descriptions. (There was once a `bower.json`.) - /// - /// Default `["package.json"]` - pub description_files: Option>, - - /// If true, it will not allow extension-less files. - /// So by default `require('./foo')` works if `./foo` has a `.js` extension, - /// but with this enabled only `require('./foo.js')` will work. - /// - /// Default to `true` when [ResolveOptions::extensions] contains an empty string. - /// Use `Some(false)` to disable the behavior. - /// See - /// - /// Default None, which is the same as `Some(false)` when the above empty rule is not applied. - pub enforce_extension: Option, - - /// A list of exports fields in description files. - /// Can be a path to json object such as `["path", "to", "exports"]`. - /// - /// Default `[["exports"]]`. - #[napi(ts_type = "(string | string[])[]")] - pub exports_fields: Option>, - - /// Fields from `package.json` which are used to provide the internal requests of a package - /// (requests starting with # are considered internal). - /// - /// Can be a path to a JSON object such as `["path", "to", "imports"]`. - /// - /// Default `[["imports"]]`. - #[napi(ts_type = "(string | string[])[]")] - pub imports_fields: Option>, - - /// An object which maps extension to extension aliases. - /// - /// Default `{}` - pub extension_alias: Option>>, - - /// Attempt to resolve these extensions in order. - /// If multiple files share the same name but have different extensions, - /// will resolve the one with the extension listed first in the array and skip the rest. - /// - /// Default `[".js", ".json", ".node"]` - pub extensions: Option>, - - /// Redirect module requests when normal resolving fails. - /// - /// Default `[]` - pub fallback: Option>>>, - - /// 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). - /// - /// See also webpack configuration [resolve.fullySpecified](https://webpack.js.org/configuration/module/#resolvefullyspecified) - /// - /// Default `false` - pub fully_specified: Option, - - /// A list of main fields in description files - /// - /// Default `["main"]`. - #[napi(ts_type = "string | string[]")] - pub main_fields: Option, - - /// The filename to be used while resolving directories. - /// - /// Default `["index"]` - pub main_files: Option>, - - /// A list of directories to resolve modules from, can be absolute path or folder name. - /// - /// Default `["node_modules"]` - #[napi(ts_type = "string | string[]")] - pub modules: Option, - - /// Resolve to a context instead of a file. - /// - /// Default `false` - pub resolve_to_context: Option, - - /// Prefer to resolve module requests as relative requests instead of using modules from node_modules directories. - /// - /// Default `false` - pub prefer_relative: Option, - - /// Prefer to resolve server-relative urls as absolute paths before falling back to resolve in ResolveOptions::roots. - /// - /// Default `false` - pub prefer_absolute: Option, - - /// A list of resolve restrictions to restrict the paths that a request can be resolved on. - /// - /// Default `[]` - pub restrictions: Option>, - - /// A list of directories where requests of server-relative URLs (starting with '/') are resolved. - /// On non-Windows systems these requests are resolved as an absolute path first. - /// - /// Default `[]` - pub roots: Option>, - - /// Whether to resolve symlinks to their symlinked location. - /// When enabled, symlinked resources are resolved to their real path, not their symlinked location. - /// Note that this may cause module resolution to fail when using tools that symlink packages (like npm link). - /// - /// Default `true` - pub symlinks: Option, - - /// Whether to parse [module.builtinModules](https://nodejs.org/api/module.html#modulebuiltinmodules) or not. - /// For example, "zlib" will throw [crate::ResolveError::Builtin] when set to true. - /// - /// Default `false` - pub builtin_modules: Option, -} - -#[napi] -#[derive(Debug, PartialEq, Eq)] -pub enum EnforceExtension { - Auto, - Enabled, - Disabled, -} - -impl EnforceExtension { - pub fn is_auto(&self) -> bool { - *self == Self::Auto - } - - pub fn is_enabled(&self) -> bool { - *self == Self::Enabled - } - - pub fn is_disabled(&self) -> bool { - *self == Self::Disabled - } -} - -/// Alias Value for [ResolveOptions::alias] and [ResolveOptions::fallback]. -/// Use struct because napi don't support structured union now -#[napi(object)] -#[derive(Debug, Clone)] -pub struct Restriction { - pub path: Option, - pub regex: Option, -} - -/// Tsconfig Options -/// -/// Derived from [tsconfig-paths-webpack-plugin](https://github.com/dividab/tsconfig-paths-webpack-plugin#options) -#[napi(object)] -#[derive(Debug, Clone)] -pub struct TsconfigOptions { - /// Allows you to specify where to find the TypeScript configuration file. - /// You may provide - /// * a relative path to the configuration file. It will be resolved relative to cwd. - /// * an absolute path to the configuration file. - pub config_file: String, - - /// Support for Typescript Project References. - /// - /// * `'auto'`: use the `references` field from tsconfig of `config_file`. - /// * `string[]`: manually provided relative or absolute path. - #[napi(ts_type = "'auto' | string[]")] - pub references: Option>>, -} - -impl Into for Restriction { - fn into(self) -> oxc_resolver::Restriction { - match (self.path, self.regex) { - (None, None) => { - panic!("Should specify path or regex") - } - (None, Some(regex)) => oxc_resolver::Restriction::RegExp(regex), - (Some(path), None) => oxc_resolver::Restriction::Path(PathBuf::from(path)), - (Some(_), Some(_)) => { - panic!("Restriction can't be path and regex at the same time") - } - } - } -} - -impl Into for EnforceExtension { - fn into(self) -> oxc_resolver::EnforceExtension { - match self { - EnforceExtension::Auto => oxc_resolver::EnforceExtension::Auto, - EnforceExtension::Enabled => oxc_resolver::EnforceExtension::Enabled, - EnforceExtension::Disabled => oxc_resolver::EnforceExtension::Disabled, - } - } -} - -impl Into for TsconfigOptions { - fn into(self) -> oxc_resolver::TsconfigOptions { - oxc_resolver::TsconfigOptions { - config_file: PathBuf::from(self.config_file), - references: match self.references { - Some(Either::A(string)) if string.as_str() == "auto" => { - oxc_resolver::TsconfigReferences::Auto - } - Some(Either::A(opt)) => { - panic!("`{}` is not a valid option for tsconfig references", opt) - } - Some(Either::B(paths)) => oxc_resolver::TsconfigReferences::Paths( - paths.into_iter().map(PathBuf::from).collect::>(), - ), - None => oxc_resolver::TsconfigReferences::Disabled, - }, - } - } -} - -type StrOrStrListType = Either>; -pub struct StrOrStrList(pub StrOrStrListType); - -impl Into> for StrOrStrList { - fn into(self) -> Vec { - match self { - StrOrStrList(Either::A(s)) => Vec::from([s]), - StrOrStrList(Either::B(a)) => a, - } - } -} diff --git a/napi/tests/options.test.mjs b/napi/tests/options.test.mjs deleted file mode 100644 index 4a93efff..00000000 --- a/napi/tests/options.test.mjs +++ /dev/null @@ -1,59 +0,0 @@ -import { describe, it } from "node:test"; -import { ResolverFactory } from "../index.js"; -import * as assert from "node:assert"; -import * as path from "node:path"; - -const fixtureDir = new URL( - "../../fixtures/enhanced_resolve/test/fixtures", - import.meta.url -).pathname; - -describe("option", () => { - describe("aliasFields", () => { - it("should allow field string ", () => { - const resolver = new ResolverFactory({ aliasFields: ["browser"] }); - assert.match( - resolver.sync(fixtureDir, "./browser-module/lib/replaced.js").path, - /browser-module\/lib\/browser\.js$/ - ); - }); - it("should allow json path array", () => { - const resolver = new ResolverFactory({ - aliasFields: [["innerBrowser1", "field", "browser"]], - }); - - assert.match( - resolver.sync(fixtureDir, "./browser-module/lib/main1.js").path, - /browser-module\/lib\/main\.js$/ - ); - }); - }); - - describe("exportsFields", () => { - const createTest = (exportsFields) => { - const resolver = new ResolverFactory({ exportsFields }); - assert.match( - resolver.sync( - path.resolve(fixtureDir, "./exports-field3"), - "exports-field" - ).path, - /\/exports-field\/src\/index\.js$/ - ); - }; - it("should allow string as field item", createTest(["broken"])); - it("should allow json path array as field item", createTest([["broken"]])); - }); - - describe("mainFields", () => { - const createTest = (mainFields) => { - const resolver = new ResolverFactory({ mainFields }); - assert.match( - resolver.sync(fixtureDir, "../..").path, - /\/lib\/index\.js$/ - ); - }; - it("should use `'main'` as default", createTest(undefined)); - it("should allow field string", createTest("main")); - it("should allow field array", createTest(["main"])); - }); -}); diff --git a/npm/package.json b/npm/package.json index afbfd4a1..75649783 100644 --- a/npm/package.json +++ b/npm/package.json @@ -1,41 +1,30 @@ { - "name": "oxc-resolver", - "version": "1.7.0", - "description": "Oxc Resolver Node API", - "main": "index.js", - "browser": "browser.js", - "files": [ - "index.d.ts", - "index.js", - "browser.js" - ], - "license": "MIT", - "homepage": "https://oxc-project.github.io", - "repository": { - "type": "git", - "url": "git+https://github.com/oxc-project/oxc-resolver.git" - }, - "publishConfig": { - "registry": "https://registry.npmjs.org/", - "access": "public" - }, - "napi": { - "binaryName": "resolver", - "packageName": "@oxc-resolver/binding", - "targets": [ - "x86_64-pc-windows-msvc", - "aarch64-pc-windows-msvc", - "x86_64-unknown-linux-gnu", - "x86_64-unknown-linux-musl", - "aarch64-unknown-linux-gnu", - "aarch64-unknown-linux-musl", - "armv7-unknown-linux-gnueabihf", - "x86_64-apple-darwin", - "aarch64-apple-darwin", - "wasm32-wasip1-threads" - ] - }, - "funding": { - "url": "https://github.com/sponsors/Boshen" - } + "browser": "browser.js", + "description": "Oxc Resolver Node API", + "files": [ + "index.d.ts", + "index.js", + "browser.js" + ], + "funding": { + "url": "https://github.com/sponsors/Boshen" + }, + "main": "index.js", + "name": "oxc-resolver", + "napi": { + "binaryName": "resolver", + "packageName": "@oxc-resolver/binding", + "targets": [ + "x86_64-pc-windows-msvc", + "aarch64-pc-windows-msvc", + "x86_64-unknown-linux-gnu", + "x86_64-unknown-linux-musl", + "aarch64-unknown-linux-gnu", + "aarch64-unknown-linux-musl", + "armv7-unknown-linux-gnueabihf", + "x86_64-apple-darwin", + "aarch64-apple-darwin", + "wasm32-wasip1-threads" + ] + } } diff --git a/package.json b/package.json index 978cc6e9..d22d7be9 100644 --- a/package.json +++ b/package.json @@ -1,36 +1,24 @@ { - "name": "@oxc-resolver/binding", - "private": true, - "version": "0.0.0", - "scripts": { - "build": "napi build --platform --release --package-json-path npm/package.json --manifest-path napi/Cargo.toml", - "build:debug": "napi build --platform --package-json-path npm/package.json --manifest-path napi/Cargo.toml", - "prepublishOnly": "napi pre-publish -t npm", - "test": "ava" - }, - "devDependencies": { - "@napi-rs/cli": "^3.0.0-alpha.43", - "@napi-rs/wasm-runtime": "^0.2.0", - "@types/node": "^20.10.4", - "ava": "^6.0.1", - "emnapi": "^1.0.0", - "typescript": "^5.3.3" - }, - "engines": { - "node": ">=10" - }, - "ava": { - "files": [ - "napi/__test__/*.spec.mjs" - ], - "cache": false - }, - "packageManager": "pnpm@9.1.2", - "repository": { - "type": "git", - "url": "git+https://github.com/oxc-project/oxc-resolver.git" - }, - "funding": { - "url": "https://github.com/sponsors/Boshen" - } + "ava": { + "cache": false, + "files": [ + "napi/__test__/*.spec.mjs" + ] + }, + "devDependencies": { + "@napi-rs/cli": "^3.0.0-alpha.43", + "@napi-rs/wasm-runtime": "^0.2.0", + "@types/node": "^20.10.4", + "ava": "^6.0.1", + "emnapi": "^1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/Boshen" + }, + "name": "@oxc-resolver/binding", + "scripts": { + "build": "napi build --platform --release --package-json-path npm/package.json --manifest-path napi/Cargo.toml", + "build:debug": "napi build --platform --package-json-path npm/package.json --manifest-path napi/Cargo.toml", + "prepublishOnly": "napi pre-publish -t npm" + } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml deleted file mode 100644 index 878ba525..00000000 --- a/pnpm-lock.yaml +++ /dev/null @@ -1,2450 +0,0 @@ -lockfileVersion: '9.0' - -settings: - autoInstallPeers: true - excludeLinksFromLockfile: false - -importers: - - .: - devDependencies: - '@napi-rs/cli': - specifier: ^3.0.0-alpha.43 - version: 3.0.0-alpha.51(@emnapi/runtime@1.1.1)(emnapi@1.1.1) - '@napi-rs/wasm-runtime': - specifier: ^0.2.0 - version: 0.2.0 - '@types/node': - specifier: ^20.10.4 - version: 20.12.7 - ava: - specifier: ^6.0.1 - version: 6.1.2 - emnapi: - specifier: ^1.0.0 - version: 1.1.1 - typescript: - specifier: ^5.3.3 - version: 5.4.5 - -packages: - - '@emnapi/core@1.1.1': - resolution: {integrity: sha512-eu4KjHfXg3I+UUR7vSuwZXpRo4c8h4Rtb5Lu2F7Z4JqJFl/eidquONEBiRs6viXKpWBC3BaJBy68xGJ2j56idw==} - - '@emnapi/runtime@1.1.1': - resolution: {integrity: sha512-3bfqkzuR1KLx57nZfjr2NLnFOobvyS0aTszaEGCGqmYMVDRaGvgIZbjGSV/MHSSmLgQ/b9JFHQ5xm5WRZYd+XQ==} - - '@inquirer/figures@1.0.1': - resolution: {integrity: sha512-mtup3wVKia3ZwULPHcbs4Mor8Voi+iIXEWD7wCNbIO6lYR62oPCTQyrddi5OMYVXHzeCSoneZwJuS8sBvlEwDw==} - engines: {node: '>=18'} - - '@ljharb/through@2.3.13': - resolution: {integrity: sha512-/gKJun8NNiWGZJkGzI/Ragc53cOdcLNdzjLaIa+GEjguQs0ulsurx8WN0jijdK9yPqDvziX995sMRLyLt1uZMQ==} - engines: {node: '>= 0.4'} - - '@mapbox/node-pre-gyp@1.0.11': - resolution: {integrity: sha512-Yhlar6v9WQgUp/He7BdgzOz8lqMQ8sU+jkCq7Wx8Myc5YFJLbEe7lgui/V7G1qB1DJykHSGwreceSaD60Y0PUQ==} - hasBin: true - - '@napi-rs/cli@3.0.0-alpha.51': - resolution: {integrity: sha512-fzTQ4RfhaghFNryWTfb0e93N/J7hNfAOpUNL98u9qMymsXa3w2cUTN8W/HjiNVTUvHHus8X5PuHt9q65cDXcSg==} - engines: {node: '>= 16'} - hasBin: true - peerDependencies: - '@emnapi/runtime': ^1.1.0 - emnapi: ^1.1.0 - peerDependenciesMeta: - '@emnapi/runtime': - optional: true - emnapi: - optional: true - - '@napi-rs/cross-toolchain@0.0.14': - resolution: {integrity: sha512-Xgoe1gCEo5s5VUxmSnK4tYFJXW2JAVM02jptSbqA2+gp8pt4Vuk9oK2LvswwO9iRfHapKacYYhegD8Dq/+PBOQ==} - peerDependencies: - '@napi-rs/cross-toolchain-arm64-target-aarch64': ^0.0.14 - '@napi-rs/cross-toolchain-arm64-target-armv7': ^0.0.14 - '@napi-rs/cross-toolchain-arm64-target-x86_64': ^0.0.14 - '@napi-rs/cross-toolchain-x64-target-aarch64': ^0.0.14 - '@napi-rs/cross-toolchain-x64-target-armv7': ^0.0.14 - '@napi-rs/cross-toolchain-x64-target-x86_64': ^0.0.14 - peerDependenciesMeta: - '@napi-rs/cross-toolchain-arm64-target-aarch64': - optional: true - '@napi-rs/cross-toolchain-arm64-target-armv7': - optional: true - '@napi-rs/cross-toolchain-arm64-target-x86_64': - optional: true - '@napi-rs/cross-toolchain-x64-target-aarch64': - optional: true - '@napi-rs/cross-toolchain-x64-target-armv7': - optional: true - '@napi-rs/cross-toolchain-x64-target-x86_64': - optional: true - - '@napi-rs/lzma-android-arm-eabi@1.2.1': - resolution: {integrity: sha512-GKXud2hTddxehff1mAGkbTfseBj+GcM+M/sZuxf9H9CJeOWpfI/HC9Oy3uv8mBqPTkOQdCcZ/xXPU34EOEwiRg==} - engines: {node: '>= 10'} - cpu: [arm] - os: [android] - - '@napi-rs/lzma-android-arm64@1.2.1': - resolution: {integrity: sha512-UKFvc56TdgljbdgLvSwM62pSItV/4SuXXCrJtruPDmbIDe8HKag8hsCKsb66hrc9aX7urJ+KGw1yz5hWiONLyw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [android] - - '@napi-rs/lzma-darwin-arm64@1.2.1': - resolution: {integrity: sha512-eLbHzK5xGVzEABb1ESFELQJzXKoQeP9QH9hMPd4Qq29xD6MkWD2VKlAy40AxrMeWc7fCUIImTTlGuGRvg6tI1g==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [darwin] - - '@napi-rs/lzma-darwin-x64@1.2.1': - resolution: {integrity: sha512-/a5sHZkkO81w/PCpxlwXjADz++jDiTJquMzCLAhupd23wTRmJoCBAwp4Tur+qV5esI7ahAA0lS5P0M4TZv+OUg==} - engines: {node: '>= 10'} - cpu: [x64] - os: [darwin] - - '@napi-rs/lzma-freebsd-x64@1.2.1': - resolution: {integrity: sha512-Ehc0ld148YcqQrDWwUbVta1l45R4PthCIU6ZDbOYzzeYXQnhgr1fWiex7wu4KMFppteHlYntypUIhmMUklqchA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [freebsd] - - '@napi-rs/lzma-linux-arm-gnueabihf@1.2.1': - resolution: {integrity: sha512-EkIsx3kC67viElNetZgaGAtAceA+4pVGj31HKKPn0RZYn3rCNdEEg2i1IRg07Y6m4bHwcaKutLoZ2LDcQ+yiBg==} - engines: {node: '>= 10'} - cpu: [arm] - os: [linux] - - '@napi-rs/lzma-linux-arm64-gnu@1.2.1': - resolution: {integrity: sha512-GxSbp1/X7Ppmf+aNiZ95vl1HgQzRS9C8zCv7unEhYRPAjRkAnlrsLluUBOTPIY2yquuUvfIog9XIml6Hpw2wrA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/lzma-linux-arm64-musl@1.2.1': - resolution: {integrity: sha512-2L3KHFGGdt0xgU0WcKwKmnjVCYs88t4+ixBgPfEydtYsOceg6B8eOzdM7xsziKxJyUJKWBetGLgARQOy35bfvA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/lzma-linux-x64-gnu@1.2.1': - resolution: {integrity: sha512-h29XttA2Og1+6vYHsVcp+i1PkeILKzYnoDun0ul/k/5hvfxJ2Jap+EM07sW4HSz/DiscLAeIZmLKbXEqJgF5bg==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/lzma-linux-x64-musl@1.2.1': - resolution: {integrity: sha512-8EIkpLid4pepkBsljQ7rgma8jdwAuwVyJ2tY6Wuj1I/AqAkVVfxTwIuYc4zgRR3nfcrmWgOfZE0VneVmQCE5hw==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/lzma-win32-arm64-msvc@1.2.1': - resolution: {integrity: sha512-RNPItarWUUbtwz6dyn8FGH9AXEaAsBcMBlTvcRjv8eoqRqyZ9R49Ruk/8WMS57MM1BKdiPDxHBtRi+nZn27Slw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [win32] - - '@napi-rs/lzma-win32-ia32-msvc@1.2.1': - resolution: {integrity: sha512-rNdsCZnzKVgeDd9NzXWk9WuADVUWUWdnws8qBRCfHRUQqJ56Ic1W7Y1XmP+bNa985MXlU6vbznHTHmU5zk2P+A==} - engines: {node: '>= 10'} - cpu: [ia32] - os: [win32] - - '@napi-rs/lzma-win32-x64-msvc@1.2.1': - resolution: {integrity: sha512-1AFrAh1n73Yw+IhDu5HnaiRD4vWEkafY0EarfziPfDsh/GeyNcjbE+Let+XFe8L3j0/CZfsRG3nXarOW1oadUQ==} - engines: {node: '>= 10'} - cpu: [x64] - os: [win32] - - '@napi-rs/lzma@1.2.1': - resolution: {integrity: sha512-vwl34tzF2mXWthnFVN2MP6nRzQ40C5+256EEUjxAwj9dbAhDqb7Yz376Up5SlB4YgNC0YvEqK4jsYP/NP0bgpg==} - engines: {node: '>= 10'} - - '@napi-rs/tar-android-arm-eabi@0.1.0': - resolution: {integrity: sha512-gY9f7HfyU8MQs/ERi2/Fc4dGRf61ZM2pme31t0FkrzTtmeIaf56LiTeTt4aP8xh/0HOVnXrB6I3taY9IsQVB8Q==} - engines: {node: '>= 10'} - cpu: [arm] - os: [android] - - '@napi-rs/tar-android-arm64@0.1.0': - resolution: {integrity: sha512-NxszsTRdAYf25kKuzUYz514/5MFI3w3aHToZBcFjaxUmsayrimFrHIiPLwNQVe55lHPRi13njqQUPjMetHMCZw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [android] - - '@napi-rs/tar-darwin-arm64@0.1.0': - resolution: {integrity: sha512-G+fSNcwhbekTMOElS66mf3ccg8M4NcEHIgo7s6Hxo8U2obUSqEJ0WjTDV8oJy7lqRW/MeeDJj8Vz0ceXC8ueeA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [darwin] - - '@napi-rs/tar-darwin-x64@0.1.0': - resolution: {integrity: sha512-p9aOLk6O2+Cu62fNOdj1Zx0P3J1VkxtihXOVDaK49o5jszhms0roNA7kZfklwjVdwo8R7OQC6mJcFWmiamMNug==} - engines: {node: '>= 10'} - cpu: [x64] - os: [darwin] - - '@napi-rs/tar-freebsd-x64@0.1.0': - resolution: {integrity: sha512-mZQPtyCc2r+P84WV76Ddbe1+CxBscxlDHtgMIxZPveMgq4esZFKp26M735vjxtk/j2ahT0pZoC6fjsJ//Uxzlg==} - engines: {node: '>= 10'} - cpu: [x64] - os: [freebsd] - - '@napi-rs/tar-linux-arm-gnueabihf@0.1.0': - resolution: {integrity: sha512-FHxnmrOS345T3n3XDmY9QEoVv1PXkkuevQbu+gzq5np4fzN/NX2Az5oJTxKOTGtlJSaxxz90raeaWRZrnV5hZQ==} - engines: {node: '>= 10'} - cpu: [arm] - os: [linux] - - '@napi-rs/tar-linux-arm64-gnu@0.1.0': - resolution: {integrity: sha512-+8WHnL/8PPpePYc+5oqNLoE5o98vWF7lJvY/seji7tdcS5TPJ3tgXaF4/y1rFAaSxKsZ9l+ClHsZZ0MpCqMOOQ==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/tar-linux-arm64-musl@0.1.0': - resolution: {integrity: sha512-SXqU4H30/TD9BZa6pH/U5l2V6E4EKOutjHp9Sqr98iH52Zb+1N84ur1Ti7/+PapKunCIJeZzU+792CQagKIzuQ==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/tar-linux-x64-gnu@0.1.0': - resolution: {integrity: sha512-2uZHxl2nH1HbeJuifB1qdK8vU9wKDrxQkFm+u4psUaa/uHLZDUCGS7GMxTnCbR9OehqZcfQabaKsHbxR/8ElDQ==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/tar-linux-x64-musl@0.1.0': - resolution: {integrity: sha512-S1vEqLK4UCHS4AjVZ3g6o7r0Yu6RbhmDj6JrqxBoEIjrMsuIPKQrODHhtlsykOPeu5IHQuyRT+DevorWAVYdoA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/tar-win32-arm64-msvc@0.1.0': - resolution: {integrity: sha512-x23Ganq0hcDbgnhzAFqOu5EWtKvngIsapJL7ZLGgQlqahRb15aQkagYvpju6CLZers6N6znmqxw9Pdov9VFzOQ==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [win32] - - '@napi-rs/tar-win32-ia32-msvc@0.1.0': - resolution: {integrity: sha512-QJgJQEKDbVOrzSJ3EaUuCk+g7t9tKv085eALmRtkiHDBmzd0iAoudcU2N9YgdacSQMe1V/GMuQLky6BFrZb4nw==} - engines: {node: '>= 10'} - cpu: [ia32] - os: [win32] - - '@napi-rs/tar-win32-x64-msvc@0.1.0': - resolution: {integrity: sha512-aEhLcPZXmbcz46utpgYrkhY/TIGVCs4T5c+xpBf6H8feIEz7rF44Bm6kECC42OWcqnws2LGRW9TZsv0bWoAn0A==} - engines: {node: '>= 10'} - cpu: [x64] - os: [win32] - - '@napi-rs/tar@0.1.0': - resolution: {integrity: sha512-HodV5VS/ryhNvSmSHPb6CT5lJKzkoKaiyO8JPkVw3XCXbp51+vZs7LJ66kgFqyr4AagaKqmXsgpGVCIwNdFw/w==} - engines: {node: '>= 10'} - - '@napi-rs/wasm-runtime@0.1.2': - resolution: {integrity: sha512-8JuczewTFIZ/XIjHQ+YlQUydHvlKx2hkcxtuGwh+t/t5zWyZct6YG4+xjHcq8xyc/e7FmFwf42Zj2YgICwmlvA==} - - '@napi-rs/wasm-runtime@0.2.0': - resolution: {integrity: sha512-ETCooPEZJN7cGp6GwE5mUTrStrhIeuEPo0lOhLe48Iz35z6CkbgDauR8nE/K4GaMEu2BwTOm2Epy7ru8w1ua7w==} - - '@napi-rs/wasm-tools-android-arm-eabi@0.0.1': - resolution: {integrity: sha512-Q/SyyO60dbpoLcN/hvGzNWDaCjuaMGFeg92GnsDBWm3OCwhvltr51+VDZbCIHQwfIvH4d63X29nEls7FHK75dA==} - engines: {node: '>= 10'} - cpu: [arm] - os: [android] - - '@napi-rs/wasm-tools-android-arm64@0.0.1': - resolution: {integrity: sha512-mn7QpSWJlQS7Z14DkWqW14HqEiI2R8FV3KT4SNdqm+O+K5uIUvAexxMn9Qu6gqLq1fHXj+7l2luAWmtN7RKLjA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [android] - - '@napi-rs/wasm-tools-darwin-arm64@0.0.1': - resolution: {integrity: sha512-WuxMRtd5rCgqfuk7dehcft5eyGDOuNSMaJybprbX4IXvnjlLQf1zsCfp6wBI2Ptp2D+qEgE2SAMWBfzF9XDDkw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [darwin] - - '@napi-rs/wasm-tools-darwin-x64@0.0.1': - resolution: {integrity: sha512-YGPjgIo1/Y774aAFb/UT+d8VQtTaIkdF0/ynlChe/UilBZX48vLaEM0HaoSqxA1WHvRm8Il8R3rBDDle0965rw==} - engines: {node: '>= 10'} - cpu: [x64] - os: [darwin] - - '@napi-rs/wasm-tools-freebsd-x64@0.0.1': - resolution: {integrity: sha512-e5y+Z89XwI7HpLyCNEvDKdtO5Sga2+o8bDcNQNHjhMunnnHKPtlTvtIhieVmdqnNGPbuNkIx8xbTjkoWCZ49Tw==} - engines: {node: '>= 10'} - cpu: [x64] - os: [freebsd] - - '@napi-rs/wasm-tools-linux-arm64-gnu@0.0.1': - resolution: {integrity: sha512-Hcy+XiCJd8XshxVOYvmyU5FgeY8d6txZf7ZefI38Y3eRm7rzGt/EvABGjvJfujnPaBeWi9fQVm3Zav5pwyxViw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/wasm-tools-linux-arm64-musl@0.0.1': - resolution: {integrity: sha512-1mSquGy4N7jlRu/0OY/rqZa/XdCFGKrsl8SH4jRB318DVweOHLqn15QG4iwIrRVjCJROpaU9HRU/sgOKVbdqrA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/wasm-tools-linux-x64-gnu@0.0.1': - resolution: {integrity: sha512-/+XuGQ9667EqrxRbpt2izLDNzWUWLTXl6KaRSh9TjcT7qL5+yllTqchc0JwIHJW5QnQlC1NW7HnSnwQZ+/v+8g==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/wasm-tools-linux-x64-musl@0.0.1': - resolution: {integrity: sha512-L+5QcEsUS+QNcMI1AF6aBRKLzhxQ5VHRHVslaQwOxHoxyhMB/2hRH4ON6Zea1PyQS/zzZugwBuDEOcFtc3UjPQ==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/wasm-tools-wasm32-wasi@0.0.1': - resolution: {integrity: sha512-I1vAhMQcBblPJPg6pr+xydZ1NjPwKU2ympmI54BZfCOAMHs0ZfVb4yEqYAVIcSWOx3CF/0T2YrcOmiULTU3iGw==} - engines: {node: '>=14.0.0'} - cpu: [wasm32] - - '@napi-rs/wasm-tools-win32-arm64-msvc@0.0.1': - resolution: {integrity: sha512-A9peDWijE9X6qt5SNzqlmSMlOZiqeB9zhUVP5dtJKtpqVO098YVnZFsz/4Hv7LkSoxQE7brAd9yln/wz5qb1yQ==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [win32] - - '@napi-rs/wasm-tools-win32-ia32-msvc@0.0.1': - resolution: {integrity: sha512-6Y7GqnBCIdl8YsSQ+5AjnZ4iWDJnJrqzRlMDegCmPPf3WmRZ0sgnRU9iAHWcId9AEIf7SAs3x7Bnv2992zCwJA==} - engines: {node: '>= 10'} - cpu: [ia32] - os: [win32] - - '@napi-rs/wasm-tools-win32-x64-msvc@0.0.1': - resolution: {integrity: sha512-Ab6ljJCQmXqJvE4/8DLvHEVTI7vVUrVfh6gCwnVwwrA/B2LgR98SanpT8/951ZaIH/lSuqkeVm+wqzgYM1FHRg==} - engines: {node: '>= 10'} - cpu: [x64] - os: [win32] - - '@napi-rs/wasm-tools@0.0.1': - resolution: {integrity: sha512-itoKmaVqRKIV37sKIEri1qjaYlWNtXyfymUaqXkLu5F16s+FwqwOmvxmdTHsvNKkMy4qCsSSetiLZO1IwvBMLQ==} - engines: {node: '>= 10'} - - '@nodelib/fs.scandir@2.1.5': - resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} - engines: {node: '>= 8'} - - '@nodelib/fs.stat@2.0.5': - resolution: {integrity: sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==} - engines: {node: '>= 8'} - - '@nodelib/fs.walk@1.2.8': - resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} - engines: {node: '>= 8'} - - '@octokit/auth-token@4.0.0': - resolution: {integrity: sha512-tY/msAuJo6ARbK6SPIxZrPBms3xPbfwBrulZe0Wtr/DIY9lje2HeV1uoebShn6mx7SjCHif6EjMvoREj+gZ+SA==} - engines: {node: '>= 18'} - - '@octokit/core@5.2.0': - resolution: {integrity: sha512-1LFfa/qnMQvEOAdzlQymH0ulepxbxnCYAKJZfMci/5XJyIHWgEYnDmgnKakbTh7CH2tFQ5O60oYDvns4i9RAIg==} - engines: {node: '>= 18'} - - '@octokit/endpoint@9.0.5': - resolution: {integrity: sha512-ekqR4/+PCLkEBF6qgj8WqJfvDq65RH85OAgrtnVp1mSxaXF03u2xW/hUdweGS5654IlC0wkNYC18Z50tSYTAFw==} - engines: {node: '>= 18'} - - '@octokit/graphql@7.1.0': - resolution: {integrity: sha512-r+oZUH7aMFui1ypZnAvZmn0KSqAUgE1/tUXIWaqUCa1758ts/Jio84GZuzsvUkme98kv0WFY8//n0J1Z+vsIsQ==} - engines: {node: '>= 18'} - - '@octokit/openapi-types@20.0.0': - resolution: {integrity: sha512-EtqRBEjp1dL/15V7WiX5LJMIxxkdiGJnabzYx5Apx4FkQIFgAfKumXeYAqqJCj1s+BMX4cPFIFC4OLCR6stlnA==} - - '@octokit/openapi-types@22.1.0': - resolution: {integrity: sha512-pGUdSP+eEPfZiQHNkZI0U01HLipxncisdJQB4G//OAmfeO8sqTQ9KRa0KF03TUPCziNsoXUrTg4B2Q1EX++T0Q==} - - '@octokit/plugin-paginate-rest@9.2.1': - resolution: {integrity: sha512-wfGhE/TAkXZRLjksFXuDZdmGnJQHvtU/joFQdweXUgzo1XwvBCD4o4+75NtFfjfLK5IwLf9vHTfSiU3sLRYpRw==} - engines: {node: '>= 18'} - peerDependencies: - '@octokit/core': '5' - - '@octokit/plugin-request-log@4.0.1': - resolution: {integrity: sha512-GihNqNpGHorUrO7Qa9JbAl0dbLnqJVrV8OXe2Zm5/Y4wFkZQDfTreBzVmiRfJVfE4mClXdihHnbpyyO9FSX4HA==} - engines: {node: '>= 18'} - peerDependencies: - '@octokit/core': '5' - - '@octokit/plugin-rest-endpoint-methods@10.4.1': - resolution: {integrity: sha512-xV1b+ceKV9KytQe3zCVqjg+8GTGfDYwaT1ATU5isiUyVtlVAO3HNdzpS4sr4GBx4hxQ46s7ITtZrAsxG22+rVg==} - engines: {node: '>= 18'} - peerDependencies: - '@octokit/core': '5' - - '@octokit/request-error@5.1.0': - resolution: {integrity: sha512-GETXfE05J0+7H2STzekpKObFe765O5dlAKUTLNGeH+x47z7JjXHfsHKo5z21D/o/IOZTUEI6nyWyR+bZVP/n5Q==} - engines: {node: '>= 18'} - - '@octokit/request@8.4.0': - resolution: {integrity: sha512-9Bb014e+m2TgBeEJGEbdplMVWwPmL1FPtggHQRkV+WVsMggPtEkLKPlcVYm/o8xKLkpJ7B+6N8WfQMtDLX2Dpw==} - engines: {node: '>= 18'} - - '@octokit/rest@20.1.0': - resolution: {integrity: sha512-STVO3itHQLrp80lvcYB2UIKoeil5Ctsgd2s1AM+du3HqZIR35ZH7WE9HLwUOLXH0myA0y3AGNPo8gZtcgIbw0g==} - engines: {node: '>= 18'} - - '@octokit/types@12.6.0': - resolution: {integrity: sha512-1rhSOfRa6H9w4YwK0yrf5faDaDTb+yLyBUKOCV4xtCDB5VmIPqd/v9yr9o6SAzOAlRxMiRiCic6JVM1/kunVkw==} - - '@octokit/types@13.4.1': - resolution: {integrity: sha512-Y73oOAzRBAUzR/iRAbGULzpNkX8vaxKCqEtg6K74Ff3w9f5apFnWtE/2nade7dMWWW3bS5Kkd6DJS4HF04xreg==} - - '@rollup/pluginutils@4.2.1': - resolution: {integrity: sha512-iKnFXr7NkdZAIHiIWE+BX5ULi/ucVFYWD6TbAV+rZctiRTY2PL6tsIKhoIOaoskiWAkgu+VsbXgUVDNLHf+InQ==} - engines: {node: '>= 8.0.0'} - - '@sindresorhus/merge-streams@2.3.0': - resolution: {integrity: sha512-LtoMMhxAlorcGhmFYI+LhPgbPZCkgP6ra1YL604EeF6U98pLlQ3iWIGMdWSC+vWmPBWBNgmDBAhnAobLROJmwg==} - engines: {node: '>=18'} - - '@tybys/wasm-util@0.8.3': - resolution: {integrity: sha512-Z96T/L6dUFFxgFJ+pQtkPpne9q7i6kIPYCFnQBHSgSPV9idTsKfIhCss0h5iM9irweZCatkrdeP8yi5uM1eX6Q==} - - '@types/node@20.12.7': - resolution: {integrity: sha512-wq0cICSkRLVaf3UGLMGItu/PtdY7oaXaI/RVU+xliKVOtRna3PRY57ZDfztpDL0n11vfymMUnXv8QwYCO7L1wg==} - - '@vercel/nft@0.26.4': - resolution: {integrity: sha512-j4jCOOXke2t8cHZCIxu1dzKLHLcFmYzC3yqAK6MfZznOL1QIJKd0xcFsXK3zcqzU7ScsE2zWkiMMNHGMHgp+FA==} - engines: {node: '>=16'} - hasBin: true - - abbrev@1.1.1: - resolution: {integrity: sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==} - - acorn-import-attributes@1.9.5: - resolution: {integrity: sha512-n02Vykv5uA3eHGM/Z2dQrcD56kL8TyDb2p1+0P83PClMnC/nc+anbQRhIOWnSq4Ke/KvDPrY3C9hDtC/A3eHnQ==} - peerDependencies: - acorn: ^8 - - acorn-walk@8.3.2: - resolution: {integrity: sha512-cjkyv4OtNCIeqhHrfS81QWXoCBPExR/J62oyEqepVw8WaQeSqpW2uhuLPh1m9eWhDuOo/jUXVTlifvesOWp/4A==} - engines: {node: '>=0.4.0'} - - acorn@8.11.3: - resolution: {integrity: sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==} - engines: {node: '>=0.4.0'} - hasBin: true - - agent-base@6.0.2: - resolution: {integrity: sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==} - engines: {node: '>= 6.0.0'} - - ansi-escapes@4.3.2: - resolution: {integrity: sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==} - engines: {node: '>=8'} - - ansi-regex@5.0.1: - resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} - engines: {node: '>=8'} - - ansi-regex@6.0.1: - resolution: {integrity: sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==} - engines: {node: '>=12'} - - ansi-styles@4.3.0: - resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} - engines: {node: '>=8'} - - ansi-styles@6.2.1: - resolution: {integrity: sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==} - engines: {node: '>=12'} - - aproba@2.0.0: - resolution: {integrity: sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==} - - are-we-there-yet@2.0.0: - resolution: {integrity: sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw==} - engines: {node: '>=10'} - - argparse@1.0.10: - resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==} - - argparse@2.0.1: - resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} - - array-find-index@1.0.2: - resolution: {integrity: sha512-M1HQyIXcBGtVywBt8WVdim+lrNaK7VHp99Qt5pSNziXznKHViIBbXWtfRTpEFpF/c4FdfxNAsCCwPp5phBYJtw==} - engines: {node: '>=0.10.0'} - - arrgv@1.0.2: - resolution: {integrity: sha512-a4eg4yhp7mmruZDQFqVMlxNRFGi/i1r87pt8SDHy0/I8PqSXoUTlWZRdAZo0VXgvEARcujbtTk8kiZRi1uDGRw==} - engines: {node: '>=8.0.0'} - - arrify@3.0.0: - resolution: {integrity: sha512-tLkvA81vQG/XqE2mjDkGQHoOINtMHtysSnemrmoGe6PydDPMRbVugqyk4A6V/WDWEfm3l+0d8anA9r8cv/5Jaw==} - engines: {node: '>=12'} - - async-sema@3.1.1: - resolution: {integrity: sha512-tLRNUXati5MFePdAk8dw7Qt7DpxPB60ofAgn8WRhW6a2rcimZnYBP9oxHiv0OHy+Wz7kPMG+t4LGdt31+4EmGg==} - - ava@6.1.2: - resolution: {integrity: sha512-WcpxJ8yZ7mk9ABTinD0IAjcemovSeVGjuuwZx0JS9johREWFeLTl8UP6wd7l6nmnrWqkKZdwaD71a/ocH4qPKw==} - engines: {node: ^18.18 || ^20.8 || ^21} - hasBin: true - peerDependencies: - '@ava/typescript': '*' - peerDependenciesMeta: - '@ava/typescript': - optional: true - - balanced-match@1.0.2: - resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} - - base64-js@1.5.1: - resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==} - - before-after-hook@2.2.3: - resolution: {integrity: sha512-NzUnlZexiaH/46WDhANlyR2bXRopNg4F/zuSA3OpZnllCUgRaOF2znDioDWrmbNVsuZk6l9pMquQB38cfBZwkQ==} - - bindings@1.5.0: - resolution: {integrity: sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==} - - bl@4.1.0: - resolution: {integrity: sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==} - - blueimp-md5@2.19.0: - resolution: {integrity: sha512-DRQrD6gJyy8FbiE4s+bDoXS9hiW3Vbx5uCdwvcCf3zLHL+Iv7LtGHLpr+GZV8rHG8tK766FGYBwRbu8pELTt+w==} - - brace-expansion@1.1.11: - resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} - - braces@3.0.2: - resolution: {integrity: sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==} - engines: {node: '>=8'} - - buffer@5.7.1: - resolution: {integrity: sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==} - - call-bind@1.0.7: - resolution: {integrity: sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==} - engines: {node: '>= 0.4'} - - callsites@4.1.0: - resolution: {integrity: sha512-aBMbD1Xxay75ViYezwT40aQONfr+pSXTHwNKvIXhXD6+LY3F1dLIcceoC5OZKBVHbXcysz1hL9D2w0JJIMXpUw==} - engines: {node: '>=12.20'} - - cbor@9.0.2: - resolution: {integrity: sha512-JPypkxsB10s9QOWwa6zwPzqE1Md3vqpPc+cai4sAecuCsRyAtAl/pMyhPlMbT/xtPnm2dznJZYRLui57qiRhaQ==} - engines: {node: '>=16'} - - chalk@4.1.2: - resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} - engines: {node: '>=10'} - - chalk@5.3.0: - resolution: {integrity: sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==} - engines: {node: ^12.17.0 || ^14.13 || >=16.0.0} - - chardet@0.7.0: - resolution: {integrity: sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==} - - chownr@2.0.0: - resolution: {integrity: sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==} - engines: {node: '>=10'} - - chunkd@2.0.1: - resolution: {integrity: sha512-7d58XsFmOq0j6el67Ug9mHf9ELUXsQXYJBkyxhH/k+6Ke0qXRnv0kbemx+Twc6fRJ07C49lcbdgm9FL1Ei/6SQ==} - - ci-info@4.0.0: - resolution: {integrity: sha512-TdHqgGf9odd8SXNuxtUBVx8Nv+qZOejE6qyqiy5NtbYYQOeFa6zmHkxlPzmaLxWWHsU6nJmB7AETdVPi+2NBUg==} - engines: {node: '>=8'} - - ci-parallel-vars@1.0.1: - resolution: {integrity: sha512-uvzpYrpmidaoxvIQHM+rKSrigjOe9feHYbw4uOI2gdfe1C3xIlxO+kVXq83WQWNniTf8bAxVpy+cQeFQsMERKg==} - - cli-cursor@3.1.0: - resolution: {integrity: sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==} - engines: {node: '>=8'} - - cli-spinners@2.9.2: - resolution: {integrity: sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==} - engines: {node: '>=6'} - - cli-truncate@4.0.0: - resolution: {integrity: sha512-nPdaFdQ0h/GEigbPClz11D0v/ZJEwxmeVZGeMo3Z5StPtUTkA9o1lD6QwoirYiSDzbcwn2XcjwmCp68W1IS4TA==} - engines: {node: '>=18'} - - cli-width@4.1.0: - resolution: {integrity: sha512-ouuZd4/dm2Sw5Gmqy6bGyNNNe1qt9RpmxveLSO7KcgsTnU7RXfsw+/bukWGo1abgBiMAic068rclZsO4IWmmxQ==} - engines: {node: '>= 12'} - - clipanion@3.2.1: - resolution: {integrity: sha512-dYFdjLb7y1ajfxQopN05mylEpK9ZX0sO1/RfMXdfmwjlIsPkbh4p7A682x++zFPLDCo1x3p82dtljHf5cW2LKA==} - peerDependencies: - typanion: '*' - - cliui@8.0.1: - resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==} - engines: {node: '>=12'} - - clone@1.0.4: - resolution: {integrity: sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==} - engines: {node: '>=0.8'} - - code-excerpt@4.0.0: - resolution: {integrity: sha512-xxodCmBen3iy2i0WtAK8FlFNrRzjUqjRsMfho58xT/wvZU1YTM3fCnRjcy1gJPMepaRlgm/0e6w8SpWHpn3/cA==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - color-convert@2.0.1: - resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} - engines: {node: '>=7.0.0'} - - color-name@1.1.4: - resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} - - color-support@1.1.3: - resolution: {integrity: sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==} - hasBin: true - - colorette@2.0.20: - resolution: {integrity: sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==} - - common-path-prefix@3.0.0: - resolution: {integrity: sha512-QE33hToZseCH3jS0qN96O/bSh3kaw/h+Tq7ngyY9eWDUnTlTNUyqfqvCXioLe5Na5jFsL78ra/wuBU4iuEgd4w==} - - concat-map@0.0.1: - resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} - - concordance@5.0.4: - resolution: {integrity: sha512-OAcsnTEYu1ARJqWVGwf4zh4JDfHZEaSNlNccFmt8YjB2l/n19/PF2viLINHc57vO4FKIAFl2FWASIGZZWZ2Kxw==} - engines: {node: '>=10.18.0 <11 || >=12.14.0 <13 || >=14'} - - console-control-strings@1.1.0: - resolution: {integrity: sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==} - - convert-to-spaces@2.0.1: - resolution: {integrity: sha512-rcQ1bsQO9799wq24uE5AM2tAILy4gXGIK/njFWcVQkGNZ96edlpY+A7bjwvzjYvLDyzmG1MmMLZhpcsb+klNMQ==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - currently-unhandled@0.4.1: - resolution: {integrity: sha512-/fITjgjGU50vjQ4FH6eUoYu+iUoUKIXws2hL15JJpIR+BbTxaXQsMuuyjtNh2WqsSBS5nsaZHFsFecyw5CCAng==} - engines: {node: '>=0.10.0'} - - date-time@3.1.0: - resolution: {integrity: sha512-uqCUKXE5q1PNBXjPqvwhwJf9SwMoAHBgWJ6DcrnS5o+W2JOiIILl0JEdVD8SGujrNS02GGxgwAg2PN2zONgtjg==} - engines: {node: '>=6'} - - debug@4.3.4: - resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==} - engines: {node: '>=6.0'} - peerDependencies: - supports-color: '*' - peerDependenciesMeta: - supports-color: - optional: true - - defaults@1.0.4: - resolution: {integrity: sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A==} - - define-data-property@1.1.4: - resolution: {integrity: sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==} - engines: {node: '>= 0.4'} - - delegates@1.0.0: - resolution: {integrity: sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==} - - deprecation@2.3.1: - resolution: {integrity: sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==} - - detect-libc@2.0.3: - resolution: {integrity: sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw==} - engines: {node: '>=8'} - - emittery@1.0.3: - resolution: {integrity: sha512-tJdCJitoy2lrC2ldJcqN4vkqJ00lT+tOWNT1hBJjO/3FDMJa5TTIiYGCKGkn/WfCyOzUMObeohbVTj00fhiLiA==} - engines: {node: '>=14.16'} - - emnapi@1.1.1: - resolution: {integrity: sha512-md0YDBLCX+378+zzibHvOLsj28YKFy8vl7BiSzVocCY7HujOkYt+N5LCOYqLeYi5C5/5NlnkNweVdUjrvKpGNg==} - peerDependencies: - node-addon-api: '>= 6.1.0' - peerDependenciesMeta: - node-addon-api: - optional: true - - emoji-regex@10.3.0: - resolution: {integrity: sha512-QpLs9D9v9kArv4lfDEgg1X/gN5XLnf/A6l9cs8SPZLRZR3ZkY9+kwIQTxm+fsSej5UMYGE8fdoaZVIBlqG0XTw==} - - emoji-regex@8.0.0: - resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} - - es-define-property@1.0.0: - resolution: {integrity: sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==} - engines: {node: '>= 0.4'} - - es-errors@1.3.0: - resolution: {integrity: sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==} - engines: {node: '>= 0.4'} - - escalade@3.1.2: - resolution: {integrity: sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==} - engines: {node: '>=6'} - - escape-string-regexp@2.0.0: - resolution: {integrity: sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==} - engines: {node: '>=8'} - - escape-string-regexp@5.0.0: - resolution: {integrity: sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==} - engines: {node: '>=12'} - - esprima@4.0.1: - resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==} - engines: {node: '>=4'} - hasBin: true - - estree-walker@2.0.2: - resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==} - - esutils@2.0.3: - resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} - engines: {node: '>=0.10.0'} - - external-editor@3.1.0: - resolution: {integrity: sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==} - engines: {node: '>=4'} - - fast-diff@1.3.0: - resolution: {integrity: sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==} - - fast-glob@3.3.2: - resolution: {integrity: sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==} - engines: {node: '>=8.6.0'} - - fastq@1.17.1: - resolution: {integrity: sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==} - - figures@6.1.0: - resolution: {integrity: sha512-d+l3qxjSesT4V7v2fh+QnmFnUWv9lSpjarhShNTgBOfA0ttejbQUAlHLitbjkoRiDulW0OPoQPYIGhIC8ohejg==} - engines: {node: '>=18'} - - file-uri-to-path@1.0.0: - resolution: {integrity: sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==} - - fill-range@7.0.1: - resolution: {integrity: sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==} - engines: {node: '>=8'} - - find-up-simple@1.0.0: - resolution: {integrity: sha512-q7Us7kcjj2VMePAa02hDAF6d+MzsdsAWEwYyOpwUtlerRBkOEPBCRZrAV4XfcSN8fHAgaD0hP7miwoay6DCprw==} - engines: {node: '>=18'} - - fs-minipass@2.1.0: - resolution: {integrity: sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==} - engines: {node: '>= 8'} - - fs.realpath@1.0.0: - resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} - - function-bind@1.1.2: - resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==} - - gauge@3.0.2: - resolution: {integrity: sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q==} - engines: {node: '>=10'} - - get-caller-file@2.0.5: - resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} - engines: {node: 6.* || 8.* || >= 10.*} - - get-east-asian-width@1.2.0: - resolution: {integrity: sha512-2nk+7SIVb14QrgXFHcm84tD4bKQz0RxPuMT8Ag5KPOq7J5fEmAg0UbXdTOSHqNuHSU28k55qnceesxXRZGzKWA==} - engines: {node: '>=18'} - - get-intrinsic@1.2.4: - resolution: {integrity: sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==} - engines: {node: '>= 0.4'} - - glob-parent@5.1.2: - resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} - engines: {node: '>= 6'} - - glob@7.2.3: - resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} - - globby@14.0.1: - resolution: {integrity: sha512-jOMLD2Z7MAhyG8aJpNOpmziMOP4rPLcc95oQPKXBazW82z+CEgPFBQvEpRUa1KeIMUJo4Wsm+q6uzO/Q/4BksQ==} - engines: {node: '>=18'} - - gopd@1.0.1: - resolution: {integrity: sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==} - - graceful-fs@4.2.11: - resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} - - has-flag@4.0.0: - resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} - engines: {node: '>=8'} - - has-property-descriptors@1.0.2: - resolution: {integrity: sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==} - - has-proto@1.0.3: - resolution: {integrity: sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==} - engines: {node: '>= 0.4'} - - has-symbols@1.0.3: - resolution: {integrity: sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==} - engines: {node: '>= 0.4'} - - has-unicode@2.0.1: - resolution: {integrity: sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==} - - hasown@2.0.2: - resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==} - engines: {node: '>= 0.4'} - - https-proxy-agent@5.0.1: - resolution: {integrity: sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==} - engines: {node: '>= 6'} - - iconv-lite@0.4.24: - resolution: {integrity: sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==} - engines: {node: '>=0.10.0'} - - ieee754@1.2.1: - resolution: {integrity: sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==} - - ignore-by-default@2.1.0: - resolution: {integrity: sha512-yiWd4GVmJp0Q6ghmM2B/V3oZGRmjrKLXvHR3TE1nfoXsmoggllfZUQe74EN0fJdPFZu2NIvNdrMMLm3OsV7Ohw==} - engines: {node: '>=10 <11 || >=12 <13 || >=14'} - - ignore@5.3.1: - resolution: {integrity: sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==} - engines: {node: '>= 4'} - - imurmurhash@0.1.4: - resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} - engines: {node: '>=0.8.19'} - - indent-string@5.0.0: - resolution: {integrity: sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==} - engines: {node: '>=12'} - - inflight@1.0.6: - resolution: {integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==} - - inherits@2.0.4: - resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} - - inquirer@9.2.19: - resolution: {integrity: sha512-WpxOT71HGsFya6/mj5PUue0sWwbpbiPfAR+332zLj/siB0QA1PZM8v3GepegFV1Op189UxHUCF6y8AySdtOMVA==} - engines: {node: '>=18'} - - irregular-plurals@3.5.0: - resolution: {integrity: sha512-1ANGLZ+Nkv1ptFb2pa8oG8Lem4krflKuX/gINiHJHjJUKaJHk/SXk5x6K3J+39/p0h1RQ2saROclJJ+QLvETCQ==} - engines: {node: '>=8'} - - is-extglob@2.1.1: - resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} - engines: {node: '>=0.10.0'} - - is-fullwidth-code-point@3.0.0: - resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} - engines: {node: '>=8'} - - is-fullwidth-code-point@4.0.0: - resolution: {integrity: sha512-O4L094N2/dZ7xqVdrXhh9r1KODPJpFms8B5sGdJLPy664AgvXsreZUyCQQNItZRDlYug4xStLjNp/sz3HvBowQ==} - engines: {node: '>=12'} - - is-glob@4.0.3: - resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} - engines: {node: '>=0.10.0'} - - is-interactive@1.0.0: - resolution: {integrity: sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w==} - engines: {node: '>=8'} - - is-number@7.0.0: - resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} - engines: {node: '>=0.12.0'} - - is-plain-object@5.0.0: - resolution: {integrity: sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==} - engines: {node: '>=0.10.0'} - - is-promise@4.0.0: - resolution: {integrity: sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==} - - is-unicode-supported@0.1.0: - resolution: {integrity: sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==} - engines: {node: '>=10'} - - is-unicode-supported@2.0.0: - resolution: {integrity: sha512-FRdAyx5lusK1iHG0TWpVtk9+1i+GjrzRffhDg4ovQ7mcidMQ6mj+MhKPmvh7Xwyv5gIS06ns49CA7Sqg7lC22Q==} - engines: {node: '>=18'} - - js-string-escape@1.0.1: - resolution: {integrity: sha512-Smw4xcfIQ5LVjAOuJCvN/zIodzA/BBSsluuoSykP+lUvScIi4U6RJLfwHet5cxFnCswUjISV8oAXaqaJDY3chg==} - engines: {node: '>= 0.8'} - - js-yaml@3.14.1: - resolution: {integrity: sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==} - hasBin: true - - js-yaml@4.1.0: - resolution: {integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==} - hasBin: true - - load-json-file@7.0.1: - resolution: {integrity: sha512-Gnxj3ev3mB5TkVBGad0JM6dmLiQL+o0t23JPBZ9sd+yvSLk05mFoqKBw5N8gbbkU4TNXyqCgIrl/VM17OgUIgQ==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - lodash-es@4.17.21: - resolution: {integrity: sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==} - - lodash@4.17.21: - resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} - - log-symbols@4.1.0: - resolution: {integrity: sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==} - engines: {node: '>=10'} - - lru-cache@6.0.0: - resolution: {integrity: sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==} - engines: {node: '>=10'} - - make-dir@3.1.0: - resolution: {integrity: sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==} - engines: {node: '>=8'} - - matcher@5.0.0: - resolution: {integrity: sha512-s2EMBOWtXFc8dgqvoAzKJXxNHibcdJMV0gwqKUaw9E2JBJuGUK7DrNKrA6g/i+v72TT16+6sVm5mS3thaMLQUw==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - md5-hex@3.0.1: - resolution: {integrity: sha512-BUiRtTtV39LIJwinWBjqVsU9xhdnz7/i889V859IBFpuqGAj6LuOvHv5XLbgZ2R7ptJoJaEcxkv88/h25T7Ciw==} - engines: {node: '>=8'} - - memoize@10.0.0: - resolution: {integrity: sha512-H6cBLgsi6vMWOcCpvVCdFFnl3kerEXbrYh9q+lY6VXvQSmM6CkmV08VOwT+WE2tzIEqRPFfAq3fm4v/UIW6mSA==} - engines: {node: '>=18'} - - merge2@1.4.1: - resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} - engines: {node: '>= 8'} - - micromatch@4.0.5: - resolution: {integrity: sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==} - engines: {node: '>=8.6'} - - mimic-fn@2.1.0: - resolution: {integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==} - engines: {node: '>=6'} - - mimic-function@5.0.1: - resolution: {integrity: sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==} - engines: {node: '>=18'} - - minimatch@3.1.2: - resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} - - minipass@3.3.6: - resolution: {integrity: sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==} - engines: {node: '>=8'} - - minipass@5.0.0: - resolution: {integrity: sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==} - engines: {node: '>=8'} - - minizlib@2.1.2: - resolution: {integrity: sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==} - engines: {node: '>= 8'} - - mkdirp@1.0.4: - resolution: {integrity: sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==} - engines: {node: '>=10'} - hasBin: true - - ms@2.1.2: - resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} - - ms@2.1.3: - resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} - - mute-stream@1.0.0: - resolution: {integrity: sha512-avsJQhyd+680gKXyG/sQc0nXaC6rBkPOfyHYcFb9+hdkqQkR9bdnkJ0AMZhke0oesPqIO+mFFJ+IdBc7mst4IA==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - - node-fetch@2.7.0: - resolution: {integrity: sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==} - engines: {node: 4.x || >=6.0.0} - peerDependencies: - encoding: ^0.1.0 - peerDependenciesMeta: - encoding: - optional: true - - node-gyp-build@4.8.0: - resolution: {integrity: sha512-u6fs2AEUljNho3EYTJNBfImO5QTo/J/1Etd+NVdCj7qWKUSN/bSLkZwhDv7I+w/MSC6qJ4cknepkAYykDdK8og==} - hasBin: true - - nofilter@3.1.0: - resolution: {integrity: sha512-l2NNj07e9afPnhAhvgVrCD/oy2Ai1yfLpuo3EpiO1jFTsB4sFz6oIfAfSZyQzVpkZQ9xS8ZS5g1jCBgq4Hwo0g==} - engines: {node: '>=12.19'} - - nopt@5.0.0: - resolution: {integrity: sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==} - engines: {node: '>=6'} - hasBin: true - - npmlog@5.0.1: - resolution: {integrity: sha512-AqZtDUWOMKs1G/8lwylVjrdYgqA4d9nu8hc+0gzRxlDb1I10+FHBGMXs6aiQHFdCUUlqH99MUMuLfzWDNDtfxw==} - - object-assign@4.1.1: - resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} - engines: {node: '>=0.10.0'} - - once@1.4.0: - resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} - - onetime@5.1.2: - resolution: {integrity: sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==} - engines: {node: '>=6'} - - ora@5.4.1: - resolution: {integrity: sha512-5b6Y85tPxZZ7QytO+BQzysW31HJku27cRIlkbAXaNx+BdcVi+LlRFmVXzeF6a7JCwJpyw5c4b+YSVImQIrBpuQ==} - engines: {node: '>=10'} - - os-tmpdir@1.0.2: - resolution: {integrity: sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==} - engines: {node: '>=0.10.0'} - - p-map@7.0.2: - resolution: {integrity: sha512-z4cYYMMdKHzw4O5UkWJImbZynVIo0lSGTXc7bzB1e/rrDqkgGUNysK/o4bTr+0+xKvvLoTyGqYC4Fgljy9qe1Q==} - engines: {node: '>=18'} - - package-config@5.0.0: - resolution: {integrity: sha512-GYTTew2slBcYdvRHqjhwaaydVMvn/qrGC323+nKclYioNSLTDUM/lGgtGTgyHVtYcozb+XkE8CNhwcraOmZ9Mg==} - engines: {node: '>=18'} - - parse-ms@4.0.0: - resolution: {integrity: sha512-TXfryirbmq34y8QBwgqCVLi+8oA3oWx2eAnSn62ITyEhEYaWRlVZ2DvMM9eZbMs/RfxPu/PK/aBLyGj4IrqMHw==} - engines: {node: '>=18'} - - path-is-absolute@1.0.1: - resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==} - engines: {node: '>=0.10.0'} - - path-type@5.0.0: - resolution: {integrity: sha512-5HviZNaZcfqP95rwpv+1HDgUamezbqdSYTyzjTvwtJSnIH+3vnbmWsItli8OFEndS984VT55M3jduxZbX351gg==} - engines: {node: '>=12'} - - picomatch@2.3.1: - resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} - engines: {node: '>=8.6'} - - picomatch@3.0.1: - resolution: {integrity: sha512-I3EurrIQMlRc9IaAZnqRR044Phh2DXY+55o7uJ0V+hYZAcQYSuFWsc9q5PvyDHUSCe1Qxn/iBz+78s86zWnGag==} - engines: {node: '>=10'} - - plur@5.1.0: - resolution: {integrity: sha512-VP/72JeXqak2KiOzjgKtQen5y3IZHn+9GOuLDafPv0eXa47xq0At93XahYBs26MsifCQ4enGKwbjBTKgb9QJXg==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - pretty-ms@9.0.0: - resolution: {integrity: sha512-E9e9HJ9R9NasGOgPaPE8VMeiPKAyWR5jcFpNnwIejslIhWqdqOrb2wShBsncMPUb+BcCd2OPYfh7p2W6oemTng==} - engines: {node: '>=18'} - - queue-microtask@1.2.3: - resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} - - readable-stream@3.6.2: - resolution: {integrity: sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==} - engines: {node: '>= 6'} - - require-directory@2.1.1: - resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} - engines: {node: '>=0.10.0'} - - resolve-cwd@3.0.0: - resolution: {integrity: sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==} - engines: {node: '>=8'} - - resolve-from@5.0.0: - resolution: {integrity: sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==} - engines: {node: '>=8'} - - restore-cursor@3.1.0: - resolution: {integrity: sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==} - engines: {node: '>=8'} - - reusify@1.0.4: - resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==} - engines: {iojs: '>=1.0.0', node: '>=0.10.0'} - - rimraf@3.0.2: - resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==} - hasBin: true - - run-async@3.0.0: - resolution: {integrity: sha512-540WwVDOMxA6dN6We19EcT9sc3hkXPw5mzRNGM3FkdN/vtE9NFvj5lFAPNwUDmJjXidm3v7TC1cTE7t17Ulm1Q==} - engines: {node: '>=0.12.0'} - - run-parallel@1.2.0: - resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} - - rxjs@7.8.1: - resolution: {integrity: sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==} - - safe-buffer@5.2.1: - resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} - - safer-buffer@2.1.2: - resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} - - semver@6.3.1: - resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} - hasBin: true - - semver@7.6.0: - resolution: {integrity: sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==} - engines: {node: '>=10'} - hasBin: true - - serialize-error@7.0.1: - resolution: {integrity: sha512-8I8TjW5KMOKsZQTvoxjuSIa7foAwPWGOts+6o7sgjz41/qMD9VQHEDxi6PBvK2l0MXUmqZyNpUK+T2tQaaElvw==} - engines: {node: '>=10'} - - set-blocking@2.0.0: - resolution: {integrity: sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==} - - set-function-length@1.2.2: - resolution: {integrity: sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==} - engines: {node: '>= 0.4'} - - signal-exit@3.0.7: - resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} - - signal-exit@4.1.0: - resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} - engines: {node: '>=14'} - - slash@5.1.0: - resolution: {integrity: sha512-ZA6oR3T/pEyuqwMgAKT0/hAv8oAXckzbkmR0UkUosQ+Mc4RxGoJkRmwHgHufaenlyAgE1Mxgpdcrf75y6XcnDg==} - engines: {node: '>=14.16'} - - slice-ansi@5.0.0: - resolution: {integrity: sha512-FC+lgizVPfie0kkhqUScwRu1O/lF6NOgJmlCgK+/LYxDCTk8sGelYaHDhFcDN+Sn3Cv+3VSa4Byeo+IMCzpMgQ==} - engines: {node: '>=12'} - - sprintf-js@1.0.3: - resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==} - - stack-utils@2.0.6: - resolution: {integrity: sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==} - engines: {node: '>=10'} - - string-width@4.2.3: - resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} - engines: {node: '>=8'} - - string-width@7.1.0: - resolution: {integrity: sha512-SEIJCWiX7Kg4c129n48aDRwLbFb2LJmXXFrWBG4NGaRtMQ3myKPKbwrD1BKqQn74oCoNMBVrfDEr5M9YxCsrkw==} - engines: {node: '>=18'} - - string_decoder@1.3.0: - resolution: {integrity: sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==} - - strip-ansi@6.0.1: - resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} - engines: {node: '>=8'} - - strip-ansi@7.1.0: - resolution: {integrity: sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==} - engines: {node: '>=12'} - - supertap@3.0.1: - resolution: {integrity: sha512-u1ZpIBCawJnO+0QePsEiOknOfCRq0yERxiAchT0i4li0WHNUJbf0evXXSXOcCAR4M8iMDoajXYmstm/qO81Isw==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - supports-color@7.2.0: - resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} - engines: {node: '>=8'} - - tar@6.2.1: - resolution: {integrity: sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==} - engines: {node: '>=10'} - - temp-dir@3.0.0: - resolution: {integrity: sha512-nHc6S/bwIilKHNRgK/3jlhDoIHcp45YgyiwcAk46Tr0LfEqGBVpmiAyuiuxeVE44m3mXnEeVhaipLOEWmH+Njw==} - engines: {node: '>=14.16'} - - time-zone@1.0.0: - resolution: {integrity: sha512-TIsDdtKo6+XrPtiTm1ssmMngN1sAhyKnTO2kunQWqNPWIVvCm15Wmw4SWInwTVgJ5u/Tr04+8Ei9TNcw4x4ONA==} - engines: {node: '>=4'} - - tmp@0.0.33: - resolution: {integrity: sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==} - engines: {node: '>=0.6.0'} - - to-regex-range@5.0.1: - resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} - engines: {node: '>=8.0'} - - toml@3.0.0: - resolution: {integrity: sha512-y/mWCZinnvxjTKYhJ+pYxwD0mRLVvOtdS2Awbgxln6iEnt4rk0yBxeSBHkGJcPucRiG0e55mwWp+g/05rsrd6w==} - - tr46@0.0.3: - resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==} - - tslib@2.6.2: - resolution: {integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==} - - typanion@3.14.0: - resolution: {integrity: sha512-ZW/lVMRabETuYCd9O9ZvMhAh8GslSqaUjxmK/JLPCh6l73CvLBiuXswj/+7LdnWOgYsQ130FqLzFz5aGT4I3Ug==} - - type-fest@0.13.1: - resolution: {integrity: sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==} - engines: {node: '>=10'} - - type-fest@0.21.3: - resolution: {integrity: sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==} - engines: {node: '>=10'} - - typescript@5.4.5: - resolution: {integrity: sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==} - engines: {node: '>=14.17'} - hasBin: true - - undici-types@5.26.5: - resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==} - - unicorn-magic@0.1.0: - resolution: {integrity: sha512-lRfVq8fE8gz6QMBuDM6a+LO3IAzTi05H6gCVaUpir2E1Rwpo4ZUog45KpNXKC/Mn3Yb9UDuHumeFTo9iV/D9FQ==} - engines: {node: '>=18'} - - universal-user-agent@6.0.1: - resolution: {integrity: sha512-yCzhz6FN2wU1NiiQRogkTQszlQSlpWaw8SvVegAc+bDxbzHgh1vX8uIe8OYyMH6DwH+sdTJsgMl36+mSMdRJIQ==} - - util-deprecate@1.0.2: - resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} - - wasm-sjlj@1.0.5: - resolution: {integrity: sha512-Z/MHJeOkAvJJVWnGX3/YZGYldGaawZbYHX4ldYG9kLhcdB8H31F5x66M7Zc4BP/7pg0aLsusQj1629m2B3Rilg==} - - wcwidth@1.0.1: - resolution: {integrity: sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==} - - webidl-conversions@3.0.1: - resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==} - - well-known-symbols@2.0.0: - resolution: {integrity: sha512-ZMjC3ho+KXo0BfJb7JgtQ5IBuvnShdlACNkKkdsqBmYw3bPAaJfPeYUo6tLUaT5tG/Gkh7xkpBhKRQ9e7pyg9Q==} - engines: {node: '>=6'} - - whatwg-url@5.0.0: - resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==} - - wide-align@1.1.5: - resolution: {integrity: sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==} - - wrap-ansi@6.2.0: - resolution: {integrity: sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==} - engines: {node: '>=8'} - - wrap-ansi@7.0.0: - resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==} - engines: {node: '>=10'} - - wrappy@1.0.2: - resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} - - write-file-atomic@5.0.1: - resolution: {integrity: sha512-+QU2zd6OTD8XWIJCbffaiQeH9U73qIqafo1x6V1snCWYGJf6cVE0cDR4D8xRzcEnfI21IFrUPzPGtcPf8AC+Rw==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - - y18n@5.0.8: - resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==} - engines: {node: '>=10'} - - yallist@4.0.0: - resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==} - - yargs-parser@21.1.1: - resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} - engines: {node: '>=12'} - - yargs@17.7.2: - resolution: {integrity: sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==} - engines: {node: '>=12'} - -snapshots: - - '@emnapi/core@1.1.1': - dependencies: - tslib: 2.6.2 - - '@emnapi/runtime@1.1.1': - dependencies: - tslib: 2.6.2 - - '@inquirer/figures@1.0.1': {} - - '@ljharb/through@2.3.13': - dependencies: - call-bind: 1.0.7 - - '@mapbox/node-pre-gyp@1.0.11': - dependencies: - detect-libc: 2.0.3 - https-proxy-agent: 5.0.1 - make-dir: 3.1.0 - node-fetch: 2.7.0 - nopt: 5.0.0 - npmlog: 5.0.1 - rimraf: 3.0.2 - semver: 7.6.0 - tar: 6.2.1 - transitivePeerDependencies: - - encoding - - supports-color - - '@napi-rs/cli@3.0.0-alpha.51(@emnapi/runtime@1.1.1)(emnapi@1.1.1)': - dependencies: - '@napi-rs/cross-toolchain': 0.0.14 - '@napi-rs/wasm-tools': 0.0.1 - '@octokit/rest': 20.1.0 - clipanion: 3.2.1(typanion@3.14.0) - colorette: 2.0.20 - debug: 4.3.4 - inquirer: 9.2.19 - js-yaml: 4.1.0 - lodash-es: 4.17.21 - semver: 7.6.0 - toml: 3.0.0 - typanion: 3.14.0 - wasm-sjlj: 1.0.5 - optionalDependencies: - '@emnapi/runtime': 1.1.1 - emnapi: 1.1.1 - transitivePeerDependencies: - - '@napi-rs/cross-toolchain-arm64-target-aarch64' - - '@napi-rs/cross-toolchain-arm64-target-armv7' - - '@napi-rs/cross-toolchain-arm64-target-x86_64' - - '@napi-rs/cross-toolchain-x64-target-aarch64' - - '@napi-rs/cross-toolchain-x64-target-armv7' - - '@napi-rs/cross-toolchain-x64-target-x86_64' - - supports-color - - '@napi-rs/cross-toolchain@0.0.14': - dependencies: - '@napi-rs/lzma': 1.2.1 - '@napi-rs/tar': 0.1.0 - debug: 4.3.4 - transitivePeerDependencies: - - supports-color - - '@napi-rs/lzma-android-arm-eabi@1.2.1': - optional: true - - '@napi-rs/lzma-android-arm64@1.2.1': - optional: true - - '@napi-rs/lzma-darwin-arm64@1.2.1': - optional: true - - '@napi-rs/lzma-darwin-x64@1.2.1': - optional: true - - '@napi-rs/lzma-freebsd-x64@1.2.1': - optional: true - - '@napi-rs/lzma-linux-arm-gnueabihf@1.2.1': - optional: true - - '@napi-rs/lzma-linux-arm64-gnu@1.2.1': - optional: true - - '@napi-rs/lzma-linux-arm64-musl@1.2.1': - optional: true - - '@napi-rs/lzma-linux-x64-gnu@1.2.1': - optional: true - - '@napi-rs/lzma-linux-x64-musl@1.2.1': - optional: true - - '@napi-rs/lzma-win32-arm64-msvc@1.2.1': - optional: true - - '@napi-rs/lzma-win32-ia32-msvc@1.2.1': - optional: true - - '@napi-rs/lzma-win32-x64-msvc@1.2.1': - optional: true - - '@napi-rs/lzma@1.2.1': - optionalDependencies: - '@napi-rs/lzma-android-arm-eabi': 1.2.1 - '@napi-rs/lzma-android-arm64': 1.2.1 - '@napi-rs/lzma-darwin-arm64': 1.2.1 - '@napi-rs/lzma-darwin-x64': 1.2.1 - '@napi-rs/lzma-freebsd-x64': 1.2.1 - '@napi-rs/lzma-linux-arm-gnueabihf': 1.2.1 - '@napi-rs/lzma-linux-arm64-gnu': 1.2.1 - '@napi-rs/lzma-linux-arm64-musl': 1.2.1 - '@napi-rs/lzma-linux-x64-gnu': 1.2.1 - '@napi-rs/lzma-linux-x64-musl': 1.2.1 - '@napi-rs/lzma-win32-arm64-msvc': 1.2.1 - '@napi-rs/lzma-win32-ia32-msvc': 1.2.1 - '@napi-rs/lzma-win32-x64-msvc': 1.2.1 - - '@napi-rs/tar-android-arm-eabi@0.1.0': - optional: true - - '@napi-rs/tar-android-arm64@0.1.0': - optional: true - - '@napi-rs/tar-darwin-arm64@0.1.0': - optional: true - - '@napi-rs/tar-darwin-x64@0.1.0': - optional: true - - '@napi-rs/tar-freebsd-x64@0.1.0': - optional: true - - '@napi-rs/tar-linux-arm-gnueabihf@0.1.0': - optional: true - - '@napi-rs/tar-linux-arm64-gnu@0.1.0': - optional: true - - '@napi-rs/tar-linux-arm64-musl@0.1.0': - optional: true - - '@napi-rs/tar-linux-x64-gnu@0.1.0': - optional: true - - '@napi-rs/tar-linux-x64-musl@0.1.0': - optional: true - - '@napi-rs/tar-win32-arm64-msvc@0.1.0': - optional: true - - '@napi-rs/tar-win32-ia32-msvc@0.1.0': - optional: true - - '@napi-rs/tar-win32-x64-msvc@0.1.0': - optional: true - - '@napi-rs/tar@0.1.0': - optionalDependencies: - '@napi-rs/tar-android-arm-eabi': 0.1.0 - '@napi-rs/tar-android-arm64': 0.1.0 - '@napi-rs/tar-darwin-arm64': 0.1.0 - '@napi-rs/tar-darwin-x64': 0.1.0 - '@napi-rs/tar-freebsd-x64': 0.1.0 - '@napi-rs/tar-linux-arm-gnueabihf': 0.1.0 - '@napi-rs/tar-linux-arm64-gnu': 0.1.0 - '@napi-rs/tar-linux-arm64-musl': 0.1.0 - '@napi-rs/tar-linux-x64-gnu': 0.1.0 - '@napi-rs/tar-linux-x64-musl': 0.1.0 - '@napi-rs/tar-win32-arm64-msvc': 0.1.0 - '@napi-rs/tar-win32-ia32-msvc': 0.1.0 - '@napi-rs/tar-win32-x64-msvc': 0.1.0 - - '@napi-rs/wasm-runtime@0.1.2': - dependencies: - '@emnapi/core': 1.1.1 - '@emnapi/runtime': 1.1.1 - '@tybys/wasm-util': 0.8.3 - optional: true - - '@napi-rs/wasm-runtime@0.2.0': - dependencies: - '@emnapi/core': 1.1.1 - '@emnapi/runtime': 1.1.1 - '@tybys/wasm-util': 0.8.3 - - '@napi-rs/wasm-tools-android-arm-eabi@0.0.1': - optional: true - - '@napi-rs/wasm-tools-android-arm64@0.0.1': - optional: true - - '@napi-rs/wasm-tools-darwin-arm64@0.0.1': - optional: true - - '@napi-rs/wasm-tools-darwin-x64@0.0.1': - optional: true - - '@napi-rs/wasm-tools-freebsd-x64@0.0.1': - optional: true - - '@napi-rs/wasm-tools-linux-arm64-gnu@0.0.1': - optional: true - - '@napi-rs/wasm-tools-linux-arm64-musl@0.0.1': - optional: true - - '@napi-rs/wasm-tools-linux-x64-gnu@0.0.1': - optional: true - - '@napi-rs/wasm-tools-linux-x64-musl@0.0.1': - optional: true - - '@napi-rs/wasm-tools-wasm32-wasi@0.0.1': - dependencies: - '@napi-rs/wasm-runtime': 0.1.2 - optional: true - - '@napi-rs/wasm-tools-win32-arm64-msvc@0.0.1': - optional: true - - '@napi-rs/wasm-tools-win32-ia32-msvc@0.0.1': - optional: true - - '@napi-rs/wasm-tools-win32-x64-msvc@0.0.1': - optional: true - - '@napi-rs/wasm-tools@0.0.1': - optionalDependencies: - '@napi-rs/wasm-tools-android-arm-eabi': 0.0.1 - '@napi-rs/wasm-tools-android-arm64': 0.0.1 - '@napi-rs/wasm-tools-darwin-arm64': 0.0.1 - '@napi-rs/wasm-tools-darwin-x64': 0.0.1 - '@napi-rs/wasm-tools-freebsd-x64': 0.0.1 - '@napi-rs/wasm-tools-linux-arm64-gnu': 0.0.1 - '@napi-rs/wasm-tools-linux-arm64-musl': 0.0.1 - '@napi-rs/wasm-tools-linux-x64-gnu': 0.0.1 - '@napi-rs/wasm-tools-linux-x64-musl': 0.0.1 - '@napi-rs/wasm-tools-wasm32-wasi': 0.0.1 - '@napi-rs/wasm-tools-win32-arm64-msvc': 0.0.1 - '@napi-rs/wasm-tools-win32-ia32-msvc': 0.0.1 - '@napi-rs/wasm-tools-win32-x64-msvc': 0.0.1 - - '@nodelib/fs.scandir@2.1.5': - dependencies: - '@nodelib/fs.stat': 2.0.5 - run-parallel: 1.2.0 - - '@nodelib/fs.stat@2.0.5': {} - - '@nodelib/fs.walk@1.2.8': - dependencies: - '@nodelib/fs.scandir': 2.1.5 - fastq: 1.17.1 - - '@octokit/auth-token@4.0.0': {} - - '@octokit/core@5.2.0': - dependencies: - '@octokit/auth-token': 4.0.0 - '@octokit/graphql': 7.1.0 - '@octokit/request': 8.4.0 - '@octokit/request-error': 5.1.0 - '@octokit/types': 13.4.1 - before-after-hook: 2.2.3 - universal-user-agent: 6.0.1 - - '@octokit/endpoint@9.0.5': - dependencies: - '@octokit/types': 13.4.1 - universal-user-agent: 6.0.1 - - '@octokit/graphql@7.1.0': - dependencies: - '@octokit/request': 8.4.0 - '@octokit/types': 13.4.1 - universal-user-agent: 6.0.1 - - '@octokit/openapi-types@20.0.0': {} - - '@octokit/openapi-types@22.1.0': {} - - '@octokit/plugin-paginate-rest@9.2.1(@octokit/core@5.2.0)': - dependencies: - '@octokit/core': 5.2.0 - '@octokit/types': 12.6.0 - - '@octokit/plugin-request-log@4.0.1(@octokit/core@5.2.0)': - dependencies: - '@octokit/core': 5.2.0 - - '@octokit/plugin-rest-endpoint-methods@10.4.1(@octokit/core@5.2.0)': - dependencies: - '@octokit/core': 5.2.0 - '@octokit/types': 12.6.0 - - '@octokit/request-error@5.1.0': - dependencies: - '@octokit/types': 13.4.1 - deprecation: 2.3.1 - once: 1.4.0 - - '@octokit/request@8.4.0': - dependencies: - '@octokit/endpoint': 9.0.5 - '@octokit/request-error': 5.1.0 - '@octokit/types': 13.4.1 - universal-user-agent: 6.0.1 - - '@octokit/rest@20.1.0': - dependencies: - '@octokit/core': 5.2.0 - '@octokit/plugin-paginate-rest': 9.2.1(@octokit/core@5.2.0) - '@octokit/plugin-request-log': 4.0.1(@octokit/core@5.2.0) - '@octokit/plugin-rest-endpoint-methods': 10.4.1(@octokit/core@5.2.0) - - '@octokit/types@12.6.0': - dependencies: - '@octokit/openapi-types': 20.0.0 - - '@octokit/types@13.4.1': - dependencies: - '@octokit/openapi-types': 22.1.0 - - '@rollup/pluginutils@4.2.1': - dependencies: - estree-walker: 2.0.2 - picomatch: 2.3.1 - - '@sindresorhus/merge-streams@2.3.0': {} - - '@tybys/wasm-util@0.8.3': - dependencies: - tslib: 2.6.2 - - '@types/node@20.12.7': - dependencies: - undici-types: 5.26.5 - - '@vercel/nft@0.26.4': - dependencies: - '@mapbox/node-pre-gyp': 1.0.11 - '@rollup/pluginutils': 4.2.1 - acorn: 8.11.3 - acorn-import-attributes: 1.9.5(acorn@8.11.3) - async-sema: 3.1.1 - bindings: 1.5.0 - estree-walker: 2.0.2 - glob: 7.2.3 - graceful-fs: 4.2.11 - micromatch: 4.0.5 - node-gyp-build: 4.8.0 - resolve-from: 5.0.0 - transitivePeerDependencies: - - encoding - - supports-color - - abbrev@1.1.1: {} - - acorn-import-attributes@1.9.5(acorn@8.11.3): - dependencies: - acorn: 8.11.3 - - acorn-walk@8.3.2: {} - - acorn@8.11.3: {} - - agent-base@6.0.2: - dependencies: - debug: 4.3.4 - transitivePeerDependencies: - - supports-color - - ansi-escapes@4.3.2: - dependencies: - type-fest: 0.21.3 - - ansi-regex@5.0.1: {} - - ansi-regex@6.0.1: {} - - ansi-styles@4.3.0: - dependencies: - color-convert: 2.0.1 - - ansi-styles@6.2.1: {} - - aproba@2.0.0: {} - - are-we-there-yet@2.0.0: - dependencies: - delegates: 1.0.0 - readable-stream: 3.6.2 - - argparse@1.0.10: - dependencies: - sprintf-js: 1.0.3 - - argparse@2.0.1: {} - - array-find-index@1.0.2: {} - - arrgv@1.0.2: {} - - arrify@3.0.0: {} - - async-sema@3.1.1: {} - - ava@6.1.2: - dependencies: - '@vercel/nft': 0.26.4 - acorn: 8.11.3 - acorn-walk: 8.3.2 - ansi-styles: 6.2.1 - arrgv: 1.0.2 - arrify: 3.0.0 - callsites: 4.1.0 - cbor: 9.0.2 - chalk: 5.3.0 - chunkd: 2.0.1 - ci-info: 4.0.0 - ci-parallel-vars: 1.0.1 - cli-truncate: 4.0.0 - code-excerpt: 4.0.0 - common-path-prefix: 3.0.0 - concordance: 5.0.4 - currently-unhandled: 0.4.1 - debug: 4.3.4 - emittery: 1.0.3 - figures: 6.1.0 - globby: 14.0.1 - ignore-by-default: 2.1.0 - indent-string: 5.0.0 - is-plain-object: 5.0.0 - is-promise: 4.0.0 - matcher: 5.0.0 - memoize: 10.0.0 - ms: 2.1.3 - p-map: 7.0.2 - package-config: 5.0.0 - picomatch: 3.0.1 - plur: 5.1.0 - pretty-ms: 9.0.0 - resolve-cwd: 3.0.0 - stack-utils: 2.0.6 - strip-ansi: 7.1.0 - supertap: 3.0.1 - temp-dir: 3.0.0 - write-file-atomic: 5.0.1 - yargs: 17.7.2 - transitivePeerDependencies: - - encoding - - supports-color - - balanced-match@1.0.2: {} - - base64-js@1.5.1: {} - - before-after-hook@2.2.3: {} - - bindings@1.5.0: - dependencies: - file-uri-to-path: 1.0.0 - - bl@4.1.0: - dependencies: - buffer: 5.7.1 - inherits: 2.0.4 - readable-stream: 3.6.2 - - blueimp-md5@2.19.0: {} - - brace-expansion@1.1.11: - dependencies: - balanced-match: 1.0.2 - concat-map: 0.0.1 - - braces@3.0.2: - dependencies: - fill-range: 7.0.1 - - buffer@5.7.1: - dependencies: - base64-js: 1.5.1 - ieee754: 1.2.1 - - call-bind@1.0.7: - dependencies: - es-define-property: 1.0.0 - es-errors: 1.3.0 - function-bind: 1.1.2 - get-intrinsic: 1.2.4 - set-function-length: 1.2.2 - - callsites@4.1.0: {} - - cbor@9.0.2: - dependencies: - nofilter: 3.1.0 - - chalk@4.1.2: - dependencies: - ansi-styles: 4.3.0 - supports-color: 7.2.0 - - chalk@5.3.0: {} - - chardet@0.7.0: {} - - chownr@2.0.0: {} - - chunkd@2.0.1: {} - - ci-info@4.0.0: {} - - ci-parallel-vars@1.0.1: {} - - cli-cursor@3.1.0: - dependencies: - restore-cursor: 3.1.0 - - cli-spinners@2.9.2: {} - - cli-truncate@4.0.0: - dependencies: - slice-ansi: 5.0.0 - string-width: 7.1.0 - - cli-width@4.1.0: {} - - clipanion@3.2.1(typanion@3.14.0): - dependencies: - typanion: 3.14.0 - - cliui@8.0.1: - dependencies: - string-width: 4.2.3 - strip-ansi: 6.0.1 - wrap-ansi: 7.0.0 - - clone@1.0.4: {} - - code-excerpt@4.0.0: - dependencies: - convert-to-spaces: 2.0.1 - - color-convert@2.0.1: - dependencies: - color-name: 1.1.4 - - color-name@1.1.4: {} - - color-support@1.1.3: {} - - colorette@2.0.20: {} - - common-path-prefix@3.0.0: {} - - concat-map@0.0.1: {} - - concordance@5.0.4: - dependencies: - date-time: 3.1.0 - esutils: 2.0.3 - fast-diff: 1.3.0 - js-string-escape: 1.0.1 - lodash: 4.17.21 - md5-hex: 3.0.1 - semver: 7.6.0 - well-known-symbols: 2.0.0 - - console-control-strings@1.1.0: {} - - convert-to-spaces@2.0.1: {} - - currently-unhandled@0.4.1: - dependencies: - array-find-index: 1.0.2 - - date-time@3.1.0: - dependencies: - time-zone: 1.0.0 - - debug@4.3.4: - dependencies: - ms: 2.1.2 - - defaults@1.0.4: - dependencies: - clone: 1.0.4 - - define-data-property@1.1.4: - dependencies: - es-define-property: 1.0.0 - es-errors: 1.3.0 - gopd: 1.0.1 - - delegates@1.0.0: {} - - deprecation@2.3.1: {} - - detect-libc@2.0.3: {} - - emittery@1.0.3: {} - - emnapi@1.1.1: {} - - emoji-regex@10.3.0: {} - - emoji-regex@8.0.0: {} - - es-define-property@1.0.0: - dependencies: - get-intrinsic: 1.2.4 - - es-errors@1.3.0: {} - - escalade@3.1.2: {} - - escape-string-regexp@2.0.0: {} - - escape-string-regexp@5.0.0: {} - - esprima@4.0.1: {} - - estree-walker@2.0.2: {} - - esutils@2.0.3: {} - - external-editor@3.1.0: - dependencies: - chardet: 0.7.0 - iconv-lite: 0.4.24 - tmp: 0.0.33 - - fast-diff@1.3.0: {} - - fast-glob@3.3.2: - dependencies: - '@nodelib/fs.stat': 2.0.5 - '@nodelib/fs.walk': 1.2.8 - glob-parent: 5.1.2 - merge2: 1.4.1 - micromatch: 4.0.5 - - fastq@1.17.1: - dependencies: - reusify: 1.0.4 - - figures@6.1.0: - dependencies: - is-unicode-supported: 2.0.0 - - file-uri-to-path@1.0.0: {} - - fill-range@7.0.1: - dependencies: - to-regex-range: 5.0.1 - - find-up-simple@1.0.0: {} - - fs-minipass@2.1.0: - dependencies: - minipass: 3.3.6 - - fs.realpath@1.0.0: {} - - function-bind@1.1.2: {} - - gauge@3.0.2: - dependencies: - aproba: 2.0.0 - color-support: 1.1.3 - console-control-strings: 1.1.0 - has-unicode: 2.0.1 - object-assign: 4.1.1 - signal-exit: 3.0.7 - string-width: 4.2.3 - strip-ansi: 6.0.1 - wide-align: 1.1.5 - - get-caller-file@2.0.5: {} - - get-east-asian-width@1.2.0: {} - - get-intrinsic@1.2.4: - dependencies: - es-errors: 1.3.0 - function-bind: 1.1.2 - has-proto: 1.0.3 - has-symbols: 1.0.3 - hasown: 2.0.2 - - glob-parent@5.1.2: - dependencies: - is-glob: 4.0.3 - - glob@7.2.3: - dependencies: - fs.realpath: 1.0.0 - inflight: 1.0.6 - inherits: 2.0.4 - minimatch: 3.1.2 - once: 1.4.0 - path-is-absolute: 1.0.1 - - globby@14.0.1: - dependencies: - '@sindresorhus/merge-streams': 2.3.0 - fast-glob: 3.3.2 - ignore: 5.3.1 - path-type: 5.0.0 - slash: 5.1.0 - unicorn-magic: 0.1.0 - - gopd@1.0.1: - dependencies: - get-intrinsic: 1.2.4 - - graceful-fs@4.2.11: {} - - has-flag@4.0.0: {} - - has-property-descriptors@1.0.2: - dependencies: - es-define-property: 1.0.0 - - has-proto@1.0.3: {} - - has-symbols@1.0.3: {} - - has-unicode@2.0.1: {} - - hasown@2.0.2: - dependencies: - function-bind: 1.1.2 - - https-proxy-agent@5.0.1: - dependencies: - agent-base: 6.0.2 - debug: 4.3.4 - transitivePeerDependencies: - - supports-color - - iconv-lite@0.4.24: - dependencies: - safer-buffer: 2.1.2 - - ieee754@1.2.1: {} - - ignore-by-default@2.1.0: {} - - ignore@5.3.1: {} - - imurmurhash@0.1.4: {} - - indent-string@5.0.0: {} - - inflight@1.0.6: - dependencies: - once: 1.4.0 - wrappy: 1.0.2 - - inherits@2.0.4: {} - - inquirer@9.2.19: - dependencies: - '@inquirer/figures': 1.0.1 - '@ljharb/through': 2.3.13 - ansi-escapes: 4.3.2 - chalk: 5.3.0 - cli-cursor: 3.1.0 - cli-width: 4.1.0 - external-editor: 3.1.0 - lodash: 4.17.21 - mute-stream: 1.0.0 - ora: 5.4.1 - run-async: 3.0.0 - rxjs: 7.8.1 - string-width: 4.2.3 - strip-ansi: 6.0.1 - wrap-ansi: 6.2.0 - - irregular-plurals@3.5.0: {} - - is-extglob@2.1.1: {} - - is-fullwidth-code-point@3.0.0: {} - - is-fullwidth-code-point@4.0.0: {} - - is-glob@4.0.3: - dependencies: - is-extglob: 2.1.1 - - is-interactive@1.0.0: {} - - is-number@7.0.0: {} - - is-plain-object@5.0.0: {} - - is-promise@4.0.0: {} - - is-unicode-supported@0.1.0: {} - - is-unicode-supported@2.0.0: {} - - js-string-escape@1.0.1: {} - - js-yaml@3.14.1: - dependencies: - argparse: 1.0.10 - esprima: 4.0.1 - - js-yaml@4.1.0: - dependencies: - argparse: 2.0.1 - - load-json-file@7.0.1: {} - - lodash-es@4.17.21: {} - - lodash@4.17.21: {} - - log-symbols@4.1.0: - dependencies: - chalk: 4.1.2 - is-unicode-supported: 0.1.0 - - lru-cache@6.0.0: - dependencies: - yallist: 4.0.0 - - make-dir@3.1.0: - dependencies: - semver: 6.3.1 - - matcher@5.0.0: - dependencies: - escape-string-regexp: 5.0.0 - - md5-hex@3.0.1: - dependencies: - blueimp-md5: 2.19.0 - - memoize@10.0.0: - dependencies: - mimic-function: 5.0.1 - - merge2@1.4.1: {} - - micromatch@4.0.5: - dependencies: - braces: 3.0.2 - picomatch: 2.3.1 - - mimic-fn@2.1.0: {} - - mimic-function@5.0.1: {} - - minimatch@3.1.2: - dependencies: - brace-expansion: 1.1.11 - - minipass@3.3.6: - dependencies: - yallist: 4.0.0 - - minipass@5.0.0: {} - - minizlib@2.1.2: - dependencies: - minipass: 3.3.6 - yallist: 4.0.0 - - mkdirp@1.0.4: {} - - ms@2.1.2: {} - - ms@2.1.3: {} - - mute-stream@1.0.0: {} - - node-fetch@2.7.0: - dependencies: - whatwg-url: 5.0.0 - - node-gyp-build@4.8.0: {} - - nofilter@3.1.0: {} - - nopt@5.0.0: - dependencies: - abbrev: 1.1.1 - - npmlog@5.0.1: - dependencies: - are-we-there-yet: 2.0.0 - console-control-strings: 1.1.0 - gauge: 3.0.2 - set-blocking: 2.0.0 - - object-assign@4.1.1: {} - - once@1.4.0: - dependencies: - wrappy: 1.0.2 - - onetime@5.1.2: - dependencies: - mimic-fn: 2.1.0 - - ora@5.4.1: - dependencies: - bl: 4.1.0 - chalk: 4.1.2 - cli-cursor: 3.1.0 - cli-spinners: 2.9.2 - is-interactive: 1.0.0 - is-unicode-supported: 0.1.0 - log-symbols: 4.1.0 - strip-ansi: 6.0.1 - wcwidth: 1.0.1 - - os-tmpdir@1.0.2: {} - - p-map@7.0.2: {} - - package-config@5.0.0: - dependencies: - find-up-simple: 1.0.0 - load-json-file: 7.0.1 - - parse-ms@4.0.0: {} - - path-is-absolute@1.0.1: {} - - path-type@5.0.0: {} - - picomatch@2.3.1: {} - - picomatch@3.0.1: {} - - plur@5.1.0: - dependencies: - irregular-plurals: 3.5.0 - - pretty-ms@9.0.0: - dependencies: - parse-ms: 4.0.0 - - queue-microtask@1.2.3: {} - - readable-stream@3.6.2: - dependencies: - inherits: 2.0.4 - string_decoder: 1.3.0 - util-deprecate: 1.0.2 - - require-directory@2.1.1: {} - - resolve-cwd@3.0.0: - dependencies: - resolve-from: 5.0.0 - - resolve-from@5.0.0: {} - - restore-cursor@3.1.0: - dependencies: - onetime: 5.1.2 - signal-exit: 3.0.7 - - reusify@1.0.4: {} - - rimraf@3.0.2: - dependencies: - glob: 7.2.3 - - run-async@3.0.0: {} - - run-parallel@1.2.0: - dependencies: - queue-microtask: 1.2.3 - - rxjs@7.8.1: - dependencies: - tslib: 2.6.2 - - safe-buffer@5.2.1: {} - - safer-buffer@2.1.2: {} - - semver@6.3.1: {} - - semver@7.6.0: - dependencies: - lru-cache: 6.0.0 - - serialize-error@7.0.1: - dependencies: - type-fest: 0.13.1 - - set-blocking@2.0.0: {} - - set-function-length@1.2.2: - 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 - - signal-exit@3.0.7: {} - - signal-exit@4.1.0: {} - - slash@5.1.0: {} - - slice-ansi@5.0.0: - dependencies: - ansi-styles: 6.2.1 - is-fullwidth-code-point: 4.0.0 - - sprintf-js@1.0.3: {} - - stack-utils@2.0.6: - dependencies: - escape-string-regexp: 2.0.0 - - string-width@4.2.3: - dependencies: - emoji-regex: 8.0.0 - is-fullwidth-code-point: 3.0.0 - strip-ansi: 6.0.1 - - string-width@7.1.0: - dependencies: - emoji-regex: 10.3.0 - get-east-asian-width: 1.2.0 - strip-ansi: 7.1.0 - - string_decoder@1.3.0: - dependencies: - safe-buffer: 5.2.1 - - strip-ansi@6.0.1: - dependencies: - ansi-regex: 5.0.1 - - strip-ansi@7.1.0: - dependencies: - ansi-regex: 6.0.1 - - supertap@3.0.1: - dependencies: - indent-string: 5.0.0 - js-yaml: 3.14.1 - serialize-error: 7.0.1 - strip-ansi: 7.1.0 - - supports-color@7.2.0: - dependencies: - has-flag: 4.0.0 - - tar@6.2.1: - dependencies: - chownr: 2.0.0 - fs-minipass: 2.1.0 - minipass: 5.0.0 - minizlib: 2.1.2 - mkdirp: 1.0.4 - yallist: 4.0.0 - - temp-dir@3.0.0: {} - - time-zone@1.0.0: {} - - tmp@0.0.33: - dependencies: - os-tmpdir: 1.0.2 - - to-regex-range@5.0.1: - dependencies: - is-number: 7.0.0 - - toml@3.0.0: {} - - tr46@0.0.3: {} - - tslib@2.6.2: {} - - typanion@3.14.0: {} - - type-fest@0.13.1: {} - - type-fest@0.21.3: {} - - typescript@5.4.5: {} - - undici-types@5.26.5: {} - - unicorn-magic@0.1.0: {} - - universal-user-agent@6.0.1: {} - - util-deprecate@1.0.2: {} - - wasm-sjlj@1.0.5: {} - - wcwidth@1.0.1: - dependencies: - defaults: 1.0.4 - - webidl-conversions@3.0.1: {} - - well-known-symbols@2.0.0: {} - - whatwg-url@5.0.0: - dependencies: - tr46: 0.0.3 - webidl-conversions: 3.0.1 - - wide-align@1.1.5: - dependencies: - string-width: 4.2.3 - - wrap-ansi@6.2.0: - dependencies: - ansi-styles: 4.3.0 - string-width: 4.2.3 - strip-ansi: 6.0.1 - - wrap-ansi@7.0.0: - dependencies: - ansi-styles: 4.3.0 - string-width: 4.2.3 - strip-ansi: 6.0.1 - - wrappy@1.0.2: {} - - write-file-atomic@5.0.1: - dependencies: - imurmurhash: 0.1.4 - signal-exit: 4.1.0 - - y18n@5.0.8: {} - - yallist@4.0.0: {} - - yargs-parser@21.1.1: {} - - yargs@17.7.2: - dependencies: - cliui: 8.0.1 - escalade: 3.1.2 - get-caller-file: 2.0.5 - require-directory: 2.1.1 - string-width: 4.2.3 - y18n: 5.0.8 - yargs-parser: 21.1.1 diff --git a/src/builtins.rs b/src/builtins.rs deleted file mode 100644 index 45a25117..00000000 --- a/src/builtins.rs +++ /dev/null @@ -1,71 +0,0 @@ -/// Node.js built-in modules -/// -/// `node -p "[...require('module').builtinModules].map(b => JSON.stringify(b)).join(',\n')"` -/// -pub const NODEJS_BUILTINS: &[&str] = &[ - "_http_agent", - "_http_client", - "_http_common", - "_http_incoming", - "_http_outgoing", - "_http_server", - "_stream_duplex", - "_stream_passthrough", - "_stream_readable", - "_stream_transform", - "_stream_wrap", - "_stream_writable", - "_tls_common", - "_tls_wrap", - "assert", - "assert/strict", - "async_hooks", - "buffer", - "child_process", - "cluster", - "console", - "constants", - "crypto", - "dgram", - "diagnostics_channel", - "dns", - "dns/promises", - "domain", - "events", - "fs", - "fs/promises", - "http", - "http2", - "https", - "inspector", - "module", - "net", - "os", - "path", - "path/posix", - "path/win32", - "perf_hooks", - "process", - "punycode", - "querystring", - "readline", - "repl", - "stream", - "stream/consumers", - "stream/promises", - "stream/web", - "string_decoder", - "sys", - "timers", - "timers/promises", - "tls", - "trace_events", - "tty", - "url", - "util", - "util/types", - "v8", - "vm", - "worker_threads", - "zlib", -]; diff --git a/src/cache.rs b/src/cache.rs deleted file mode 100644 index a1bde36c..00000000 --- a/src/cache.rs +++ /dev/null @@ -1,369 +0,0 @@ -use once_cell::sync::OnceCell as OnceLock; -use std::{ - borrow::{Borrow, Cow}, - convert::AsRef, - hash::{BuildHasherDefault, Hash, Hasher}, - io, - ops::Deref, - path::{Path, PathBuf}, - sync::Arc, -}; - -use dashmap::{DashMap, DashSet}; -use rustc_hash::FxHasher; - -use crate::{ - context::ResolveContext as Ctx, package_json::PackageJson, path::PathUtil, FileMetadata, - FileSystem, ResolveError, ResolveOptions, TsConfig, -}; - -#[derive(Default)] -pub struct Cache { - pub(crate) fs: Fs, - paths: DashSet>, - tsconfigs: DashMap, BuildHasherDefault>, -} - -impl Cache { - pub fn new(fs: Fs) -> Self { - Self { fs, paths: DashSet::default(), tsconfigs: DashMap::default() } - } - - pub fn clear(&self) { - self.paths.clear(); - self.tsconfigs.clear(); - } - - pub fn value(&self, path: &Path) -> CachedPath { - let hash = { - let mut hasher = FxHasher::default(); - path.hash(&mut hasher); - hasher.finish() - }; - if let Some(cache_entry) = self.paths.get((hash, path).borrow() as &dyn CacheKey) { - return cache_entry.clone(); - } - let parent = path.parent().map(|p| self.value(p)); - let data = CachedPath(Arc::new(CachedPathImpl::new( - hash, - path.to_path_buf().into_boxed_path(), - parent, - ))); - self.paths.insert(data.clone()); - data - } - - pub fn tsconfig Result<(), ResolveError>>( - &self, - root: bool, - path: &Path, - callback: F, // callback for modifying tsconfig with `extends` - ) -> Result, ResolveError> { - if let Some(tsconfig_ref) = self.tsconfigs.get(path) { - return Ok(Arc::clone(tsconfig_ref.value())); - } - let meta = self.fs.metadata(path).ok(); - let tsconfig_path = if meta.is_some_and(|m| m.is_file) { - Cow::Borrowed(path) - } else if meta.is_some_and(|m| m.is_dir) { - Cow::Owned(path.join("tsconfig.json")) - } else { - let mut os_string = path.to_path_buf().into_os_string(); - os_string.push(".json"); - Cow::Owned(PathBuf::from(os_string)) - }; - let mut tsconfig_string = self - .fs - .read_to_string(&tsconfig_path) - .map_err(|_| ResolveError::TsconfigNotFound(path.to_path_buf()))?; - let mut tsconfig = - TsConfig::parse(root, &tsconfig_path, &mut tsconfig_string).map_err(|error| { - ResolveError::from_serde_json_error(tsconfig_path.to_path_buf(), &error) - })?; - callback(&mut tsconfig)?; - let tsconfig = Arc::new(tsconfig.build()); - self.tsconfigs.insert(path.to_path_buf(), Arc::clone(&tsconfig)); - Ok(tsconfig) - } -} - -#[derive(Clone)] -pub struct CachedPath(Arc); - -impl Hash for CachedPath { - fn hash(&self, state: &mut H) { - self.0.hash.hash(state); - } -} - -impl PartialEq for CachedPath { - fn eq(&self, other: &Self) -> bool { - self.0.path == other.0.path - } -} -impl Eq for CachedPath {} - -impl Deref for CachedPath { - type Target = CachedPathImpl; - - fn deref(&self) -> &Self::Target { - self.0.as_ref() - } -} - -impl<'a> Borrow for CachedPath { - fn borrow(&self) -> &(dyn CacheKey + 'a) { - self - } -} - -impl AsRef for CachedPath { - fn as_ref(&self) -> &CachedPathImpl { - self.0.as_ref() - } -} - -impl CacheKey for CachedPath { - fn tuple(&self) -> (u64, &Path) { - (self.hash, &self.path) - } -} - -pub struct CachedPathImpl { - hash: u64, - path: Box, - parent: Option, - meta: OnceLock>, - symlink: OnceLock>, - canonicalized: OnceLock>, - node_modules: OnceLock>, - package_json: OnceLock>>, -} - -impl CachedPathImpl { - fn new(hash: u64, path: Box, parent: Option) -> Self { - Self { - hash, - path, - parent, - meta: OnceLock::new(), - symlink: OnceLock::new(), - canonicalized: OnceLock::new(), - node_modules: OnceLock::new(), - package_json: OnceLock::new(), - } - } - - pub fn path(&self) -> &Path { - &self.path - } - - pub fn to_path_buf(&self) -> PathBuf { - self.path.to_path_buf() - } - - pub fn parent(&self) -> Option<&CachedPath> { - self.parent.as_ref() - } - - fn meta(&self, fs: &Fs) -> Option { - *self.meta.get_or_init(|| fs.metadata(&self.path).ok()) - } - - pub fn is_file(&self, fs: &Fs, ctx: &mut Ctx) -> bool { - if let Some(meta) = self.meta(fs) { - ctx.add_file_dependency(self.path()); - meta.is_file - } else { - ctx.add_missing_dependency(self.path()); - false - } - } - - pub fn is_dir(&self, fs: &Fs, ctx: &mut Ctx) -> bool { - self.meta(fs).map_or_else( - || { - ctx.add_missing_dependency(self.path()); - false - }, - |meta| meta.is_dir, - ) - } - - fn symlink(&self, fs: &Fs) -> io::Result> { - self.symlink - .get_or_try_init(|| { - if let Ok(symlink_metadata) = fs.symlink_metadata(&self.path) { - if symlink_metadata.is_symlink { - return fs.canonicalize(self.path()).map(Some); - } - } - Ok(None) - }) - .cloned() - } - - pub fn realpath(&self, fs: &Fs) -> io::Result { - self.canonicalized - .get_or_try_init(|| { - if let Some(link) = self.symlink(fs)? { - return Ok(Some(link)); - } - if let Some(parent) = self.parent() { - let parent_path = parent.realpath(fs)?; - return Ok(Some( - parent_path.normalize_with(self.path.strip_prefix(&parent.path).unwrap()), - )); - }; - Ok(None) - }) - .cloned() - .map(|r| r.unwrap_or_else(|| self.path.clone().to_path_buf())) - } - - pub fn module_directory( - &self, - module_name: &str, - cache: &Cache, - ctx: &mut Ctx, - ) -> Option { - let cached_path = cache.value(&self.path.join(module_name)); - cached_path.is_dir(&cache.fs, ctx).then_some(cached_path) - } - - pub fn cached_node_modules( - &self, - cache: &Cache, - ctx: &mut Ctx, - ) -> Option { - self.node_modules.get_or_init(|| self.module_directory("node_modules", cache, ctx)).clone() - } - - /// Find package.json of a path by traversing parent directories. - /// - /// # Errors - /// - /// * [ResolveError::JSON] - pub fn find_package_json( - &self, - fs: &Fs, - options: &ResolveOptions, - ctx: &mut Ctx, - ) -> Result>, ResolveError> { - let mut cache_value = self; - // Go up directories when the querying path is not a directory - while !cache_value.is_dir(fs, ctx) { - if let Some(cv) = &cache_value.parent { - cache_value = cv.as_ref(); - } else { - break; - } - } - let mut cache_value = Some(cache_value); - while let Some(cv) = cache_value { - if let Some(package_json) = cv.package_json(fs, options, ctx)? { - return Ok(Some(Arc::clone(&package_json))); - } - cache_value = cv.parent.as_deref(); - } - Ok(None) - } - - /// Get package.json of the given path. - /// - /// # Errors - /// - /// * [ResolveError::JSON] - pub fn package_json( - &self, - fs: &Fs, - options: &ResolveOptions, - ctx: &mut Ctx, - ) -> Result>, ResolveError> { - // Change to `std::sync::OnceLock::get_or_try_init` when it is stable. - let result = self - .package_json - .get_or_try_init(|| { - let package_json_path = self.path.join("package.json"); - let Ok(package_json_string) = fs.read_to_string(&package_json_path) else { - return Ok(None); - }; - let real_path = if options.symlinks { - self.realpath(fs)?.join("package.json") - } else { - package_json_path.clone() - }; - PackageJson::parse(package_json_path.clone(), real_path, &package_json_string) - .map(Arc::new) - .map(Some) - .map_err(|error| ResolveError::from_serde_json_error(package_json_path, &error)) - }) - .cloned(); - // https://github.com/webpack/enhanced-resolve/blob/58464fc7cb56673c9aa849e68e6300239601e615/lib/DescriptionFileUtils.js#L68-L82 - match &result { - Ok(Some(package_json)) => { - ctx.add_file_dependency(&package_json.path); - } - Ok(None) => { - // Avoid an allocation by making this lazy - if let Some(deps) = &mut ctx.missing_dependencies { - deps.push(self.path.join("package.json")); - } - } - Err(_) => { - if let Some(deps) = &mut ctx.file_dependencies { - deps.push(self.path.join("package.json")); - } - } - } - result - } -} - -/// Memoized cache key, code adapted from . -trait CacheKey { - fn tuple(&self) -> (u64, &Path); -} - -impl Hash for dyn CacheKey + '_ { - fn hash(&self, state: &mut H) { - self.tuple().0.hash(state); - } -} - -impl PartialEq for dyn CacheKey + '_ { - fn eq(&self, other: &Self) -> bool { - self.tuple().1 == other.tuple().1 - } -} - -impl Eq for dyn CacheKey + '_ {} - -impl<'a> CacheKey for (u64, &'a Path) { - fn tuple(&self) -> (u64, &Path) { - (self.0, self.1) - } -} - -impl<'a> Borrow for (u64, &'a Path) { - fn borrow(&self) -> &(dyn CacheKey + 'a) { - self - } -} - -/// Since the cache key is memoized, use an identity hasher -/// to avoid double cache. -#[derive(Default)] -struct IdentityHasher(u64); - -impl Hasher for IdentityHasher { - fn write(&mut self, _: &[u8]) { - unreachable!("Invalid use of IdentityHasher") - } - fn write_u64(&mut self, n: u64) { - self.0 = n; - } - fn finish(&self) -> u64 { - self.0 - } -} diff --git a/src/context.rs b/src/context.rs deleted file mode 100644 index 9349de30..00000000 --- a/src/context.rs +++ /dev/null @@ -1,89 +0,0 @@ -use std::{ - ops::{Deref, DerefMut}, - path::{Path, PathBuf}, -}; - -use crate::error::ResolveError; - -#[derive(Debug, Default, Clone)] -pub struct ResolveContext(ResolveContextImpl); - -#[derive(Debug, Default, Clone)] -pub struct ResolveContextImpl { - pub fully_specified: bool, - - pub query: Option, - - pub fragment: Option, - - /// Files that was found on file system - pub file_dependencies: Option>, - - /// Files that was found on file system - pub missing_dependencies: Option>, - - /// The current resolving alias for bailing recursion alias. - pub resolving_alias: Option, - - /// For avoiding infinite recursion, which will cause stack overflow. - depth: u8, -} - -impl Deref for ResolveContext { - type Target = ResolveContextImpl; - - fn deref(&self) -> &Self::Target { - &self.0 - } -} - -impl DerefMut for ResolveContext { - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} - -impl ResolveContext { - pub fn with_fully_specified(&mut self, yes: bool) { - self.fully_specified = yes; - } - - pub fn with_query_fragment(&mut self, query: Option<&str>, fragment: Option<&str>) { - if let Some(query) = query { - self.query.replace(query.to_string()); - } - if let Some(fragment) = fragment { - self.fragment.replace(fragment.to_string()); - } - } - - pub fn init_file_dependencies(&mut self) { - self.file_dependencies.replace(vec![]); - self.missing_dependencies.replace(vec![]); - } - - pub fn add_file_dependency(&mut self, dep: &Path) { - if let Some(deps) = &mut self.file_dependencies { - deps.push(dep.to_path_buf()); - } - } - - pub fn add_missing_dependency(&mut self, dep: &Path) { - if let Some(deps) = &mut self.missing_dependencies { - deps.push(dep.to_path_buf()); - } - } - - pub fn with_resolving_alias(&mut self, alias: String) { - self.resolving_alias = Some(alias); - } - - pub fn test_for_infinite_recursion(&mut self) -> Result<(), ResolveError> { - self.depth += 1; - // 64 should be more than enough for detecting infinite recursion. - if self.depth > 64 { - return Err(ResolveError::Recursion); - } - Ok(()) - } -} diff --git a/src/error.rs b/src/error.rs deleted file mode 100644 index ff2aaa4f..00000000 --- a/src/error.rs +++ /dev/null @@ -1,160 +0,0 @@ -use std::{io, path::PathBuf, sync::Arc}; -use thiserror::Error; - -/// All resolution errors -/// -/// `thiserror` is used to display meaningful error messages. -#[derive(Debug, Clone, PartialEq, Error)] -pub enum ResolveError { - /// Ignored path - /// - /// Derived from ignored path (false value) from browser field in package.json - /// ```json - /// { - /// "browser": { - /// "./module": false - /// } - /// } - /// ``` - /// See - #[error("Path is ignored {0}")] - Ignored(PathBuf), - - /// Module not found - #[error("Cannot find module '{0}'")] - NotFound(/* specifier */ String), - - /// Tsconfig not found - #[error("Tsconfig not found {0}")] - TsconfigNotFound(PathBuf), - - #[error("{0}")] - IOError(IOError), - - /// Node.js builtin modules - /// - /// This is an error due to not being a Node.js runtime. - /// The `alias` option can be used to resolve a builtin module to a polyfill. - #[error("Builtin module {0}")] - Builtin(String), - - /// All of the aliased extension are not found - #[error("All of the aliased extension are not found")] - ExtensionAlias, - - /// The provided path specifier cannot be parsed - #[error("{0}")] - Specifier(SpecifierError), - - /// JSON parse error - #[error("{0:?}")] - JSON(JSONError), - - /// Restricted by `ResolveOptions::restrictions` - #[error(r#"Path "{0}" restricted by {0}"#)] - Restriction(PathBuf, PathBuf), - - #[error(r#"Invalid module "{0}" specifier is not a valid subpath for the "exports" resolution of {1}"#)] - InvalidModuleSpecifier(String, PathBuf), - - #[error(r#"Invalid "exports" target "{0}" defined for '{1}' in the package config {2}"#)] - InvalidPackageTarget(String, String, PathBuf), - - #[error(r#"Package subpath '{0}' is not defined by "exports" in {1}"#)] - PackagePathNotExported(String, PathBuf), - - #[error(r#"Invalid package config "{0}", "exports" cannot contain some keys starting with '.' and some not. The exports object must either be an object of package subpath keys or an object of main entry condition name keys only."#)] - InvalidPackageConfig(PathBuf), - - #[error(r#"Default condition should be last one in "{0}""#)] - InvalidPackageConfigDefault(PathBuf), - - #[error(r#"Expecting folder to folder mapping. "{0}" should end with "/"#)] - InvalidPackageConfigDirectory(PathBuf), - - #[error(r#"Package import specifier "{0}" is not defined in package {1}"#)] - PackageImportNotDefined(String, PathBuf), - - #[error("{0} is unimplemented")] - Unimplemented(&'static str), - - /// Occurs when alias paths reference each other. - #[error("Recursion in resolving")] - Recursion, -} - -impl ResolveError { - pub fn is_ignore(&self) -> bool { - matches!(self, Self::Ignored(_)) - } - - pub(crate) fn from_serde_json_error(path: PathBuf, error: &serde_json::Error) -> Self { - Self::JSON(JSONError { - path, - message: error.to_string(), - line: error.line(), - column: error.column(), - }) - } -} - -/// Error for [ResolveError::Specifier] -#[derive(Debug, Clone, Eq, PartialEq, Error)] -pub enum SpecifierError { - #[error("The specifiers must be a non-empty string. Received \"{0}\"")] - Empty(String), -} - -/// JSON error from [serde_json::Error] -#[derive(Debug, Clone, Eq, PartialEq)] -pub struct JSONError { - pub path: PathBuf, - pub message: String, - pub line: usize, - pub column: usize, -} - -#[derive(Debug, Clone, Error)] -#[error("{0}")] -pub struct IOError(Arc); - -impl PartialEq for IOError { - fn eq(&self, other: &Self) -> bool { - self.0.kind() == other.0.kind() - } -} - -impl From for io::Error { - fn from(error: IOError) -> Self { - let io_error = error.0.as_ref(); - Self::new(io_error.kind(), io_error.to_string()) - } -} - -impl From for ResolveError { - fn from(err: io::Error) -> Self { - Self::IOError(IOError(Arc::new(err))) - } -} - -#[test] -fn test_into_io_error() { - use std::io::{self, ErrorKind}; - let error_string = "IOError occurred"; - let string_error = io::Error::new(ErrorKind::Interrupted, error_string.to_string()); - let string_error2 = io::Error::new(ErrorKind::Interrupted, error_string.to_string()); - let resolve_io_error: ResolveError = ResolveError::from(string_error2); - - assert_eq!(resolve_io_error, ResolveError::from(string_error)); - assert_eq!(resolve_io_error.clone(), resolve_io_error); - if let ResolveError::IOError(io_error) = resolve_io_error { - // fix for https://github.com/web-infra-dev/rspack/issues/4564 - let std_io_error: io::Error = io_error.into(); - assert_eq!(std_io_error.kind(), ErrorKind::Interrupted); - assert_eq!(std_io_error.to_string(), error_string); - assert_eq!( - format!("{std_io_error:?}"), - r#"Custom { kind: Interrupted, error: "IOError occurred" }"# - ); - } -} diff --git a/src/file_system.rs b/src/file_system.rs deleted file mode 100644 index 04d177de..00000000 --- a/src/file_system.rs +++ /dev/null @@ -1,133 +0,0 @@ -use std::{ - fs, io, - path::{Path, PathBuf}, -}; - -/// File System abstraction used for `ResolverGeneric` -pub trait FileSystem: Send + Sync { - /// See [std::fs::read_to_string] - /// - /// # Errors - /// - /// * See [std::fs::read_to_string] - /// ## Warning - /// Use `&Path` instead of a generic `P: AsRef` here, - /// because object safety requirements, it is especially useful, when - /// you want to store multiple `dyn FileSystem` in a `Vec` or use a `ResolverGeneric` in - /// napi env. - fn read_to_string(&self, path: &Path) -> io::Result; - - /// See [std::fs::metadata] - /// - /// # Errors - /// See [std::fs::metadata] - /// ## Warning - /// Use `&Path` instead of a generic `P: AsRef` here, - /// because object safety requirements, it is especially useful, when - /// you want to store multiple `dyn FileSystem` in a `Vec` or use a `ResolverGeneric` in - /// napi env. - fn metadata(&self, path: &Path) -> io::Result; - - /// See [std::fs::symlink_metadata] - /// - /// # Errors - /// - /// See [std::fs::symlink_metadata] - /// ## Warning - /// Use `&Path` instead of a generic `P: AsRef` here, - /// because object safety requirements, it is especially useful, when - /// you want to store multiple `dyn FileSystem` in a `Vec` or use a `ResolverGeneric` in - /// napi env. - fn symlink_metadata(&self, path: &Path) -> io::Result; - - /// See [std::fs::canonicalize] - /// - /// # Errors - /// - /// See [std::fs::read_link] - /// ## Warning - /// Use `&Path` instead of a generic `P: AsRef` here, - /// because object safety requirements, it is especially useful, when - /// you want to store multiple `dyn FileSystem` in a `Vec` or use a `ResolverGeneric` in - /// napi env. - fn canonicalize(&self, path: &Path) -> io::Result; -} - -/// Metadata information about a file -#[derive(Debug, Clone, Copy)] -pub struct FileMetadata { - pub(crate) is_file: bool, - pub(crate) is_dir: bool, - pub(crate) is_symlink: bool, -} - -impl FileMetadata { - pub fn new(is_file: bool, is_dir: bool, is_symlink: bool) -> Self { - Self { is_file, is_dir, is_symlink } - } -} - -impl From for FileMetadata { - fn from(metadata: fs::Metadata) -> Self { - Self::new(metadata.is_file(), metadata.is_dir(), metadata.is_symlink()) - } -} - -/// Operating System -#[derive(Default)] -pub struct FileSystemOs; - -impl FileSystem for FileSystemOs { - fn read_to_string(&self, path: &Path) -> io::Result { - fs::read_to_string(path) - } - - fn metadata(&self, path: &Path) -> io::Result { - fs::metadata(path).map(FileMetadata::from) - } - - fn symlink_metadata(&self, path: &Path) -> io::Result { - fs::symlink_metadata(path).map(FileMetadata::from) - } - - fn canonicalize(&self, path: &Path) -> io::Result { - #[cfg(not(target_os = "wasi"))] - { - dunce::canonicalize(path) - } - #[cfg(target_os = "wasi")] - { - let meta = fs::symlink_metadata(path)?; - if meta.file_type().is_symlink() { - let link = fs::read_link(path)?; - let mut path_buf = path.to_path_buf(); - path_buf.pop(); - for segment in link.iter() { - match segment.to_str() { - Some("..") => { - path_buf.pop(); - } - Some(".") | None => {} - Some(seg) => { - // Need to trim the extra \0 introduces by rust std rust-lang/rust#123727 - path_buf.push(seg.trim_end_matches('\0')); - } - } - } - Ok(path_buf) - } else { - Ok(path.to_path_buf()) - } - } - } -} - -#[test] -fn metadata() { - let meta = FileMetadata { is_file: true, is_dir: true, is_symlink: true }; - assert_eq!( - format!("{meta:?}"), - "FileMetadata { is_file: true, is_dir: true, is_symlink: true }" - ); - let _ = meta; -} diff --git a/src/lib.rs b/src/lib.rs deleted file mode 100644 index 2d603cf3..00000000 --- a/src/lib.rs +++ /dev/null @@ -1,1663 +0,0 @@ -//! # Oxc Resolver -//! -//! Node.js [CommonJS][cjs] and [ECMAScript][esm] Module Resolution. -//! -//! A module resolution is the process of finding the file referenced by a module specifier in -//! `import "specifier"` or `require("specifier")`. -//! -//! All [configuration options](ResolveOptions) are aligned with webpack's [enhanced-resolve]. -//! -//! ## Terminology -//! -//! ### Specifier -//! -//! For [CommonJS modules][cjs], -//! the specifier is the string passed to the `require` function. e.g. `"id"` in `require("id")`. -//! -//! For [ECMAScript modules][esm], -//! the specifier of an `import` statement is the string after the `from` keyword, -//! e.g. `'specifier'` in `import 'specifier'` or `import { sep } from 'specifier'`. -//! Specifiers are also used in export from statements, and as the argument to an `import()` expression. -//! -//! This is also named "request" in some places. -//! -//! ## References: -//! -//! * Algorithm adapted from Node.js [CommonJS Module Resolution Algorithm] and [ECMAScript Module Resolution Algorithm]. -//! * Tests are ported from [enhanced-resolve]. -//! * Some code is adapted from [parcel-resolver]. -//! * The documentation is copied from [webpack's resolve configuration](https://webpack.js.org/configuration/resolve). -//! -//! [enhanced-resolve]: https://github.com/webpack/enhanced-resolve -//! [CommonJS Module Resolution Algorithm]: https://nodejs.org/api/modules.html#all-together -//! [ECMAScript Module Resolution Algorithm]: https://nodejs.org/api/esm.html#resolution-algorithm-specification -//! [parcel-resolver]: https://github.com/parcel-bundler/parcel/blob/v2/packages/utils/node-resolver-rs -//! [cjs]: https://nodejs.org/api/modules.html -//! [esm]: https://nodejs.org/api/esm.html -//! -//! ## Feature flags -#![cfg_attr(feature = "document-features", doc = document_features::document_features!())] -#![cfg_attr(docsrs, feature(doc_auto_cfg))] -//! -//! ## Example -//! -//! ```rust,ignore -#![doc = include_str!("../examples/resolver.rs")] -//! ``` - -mod builtins; -mod cache; -mod context; -mod error; -mod file_system; -mod options; -mod package_json; -mod path; -mod resolution; -mod specifier; -mod tsconfig; - -#[cfg(test)] -mod tests; - -use std::{ - borrow::Cow, - cmp::Ordering, - ffi::OsStr, - fmt, - path::{Component, Path, PathBuf}, - sync::Arc, -}; - -use rustc_hash::FxHashSet; -use serde_json::Value as JSONValue; -use typescript_tsconfig_json::ExtendsField; - -pub use crate::{ - builtins::NODEJS_BUILTINS, - error::{JSONError, ResolveError, SpecifierError}, - file_system::{FileMetadata, FileSystem}, - options::{ - Alias, AliasValue, EnforceExtension, ResolveOptions, Restriction, TsconfigOptions, - TsconfigReferences, - }, - package_json::PackageJson, - resolution::Resolution, -}; -use crate::{ - cache::{Cache, CachedPath}, - context::ResolveContext as Ctx, - file_system::FileSystemOs, - package_json::JSONMap, - path::{PathUtil, SLASH_START}, - specifier::Specifier, - tsconfig::{ProjectReference, TsConfig}, -}; - -type ResolveResult = Result, ResolveError>; - -/// Context returned from the [Resolver::resolve_with_context] API -#[derive(Debug, Default, Clone)] -pub struct ResolveContext { - /// Files that was found on file system - pub file_dependencies: FxHashSet, - - /// Dependencies that was not found on file system - pub missing_dependencies: FxHashSet, -} - -/// Resolver with the current operating system as the file system -pub type Resolver = ResolverGeneric; - -/// Generic implementation of the resolver, can be configured by the [FileSystem] trait -pub struct ResolverGeneric { - options: ResolveOptions, - cache: Arc>, -} - -impl fmt::Debug for ResolverGeneric { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - self.options.fmt(f) - } -} - -impl Default for ResolverGeneric { - fn default() -> Self { - Self::new(ResolveOptions::default()) - } -} - -impl ResolverGeneric { - pub fn new(options: ResolveOptions) -> Self { - Self { options: options.sanitize(), cache: Arc::new(Cache::new(Fs::default())) } - } -} - -impl ResolverGeneric { - pub fn new_with_file_system(file_system: Fs, options: ResolveOptions) -> Self { - Self { cache: Arc::new(Cache::new(file_system)), options: options.sanitize() } - } - - /// Clone the resolver using the same underlying cache. - #[must_use] - pub fn clone_with_options(&self, options: ResolveOptions) -> Self { - Self { options: options.sanitize(), cache: Arc::clone(&self.cache) } - } - - /// Returns the options. - pub fn options(&self) -> &ResolveOptions { - &self.options - } - - /// Clear the underlying cache. - pub fn clear_cache(&self) { - self.cache.clear(); - } - - /// Resolve `specifier` at an absolute `path`. - /// - /// A specifier is the string passed to require or import, i.e. `require("specifier")` or `import "specifier"`. - /// - /// `path` must be an **absolute** path to a directory where the specifier is resolved against. - /// For CommonJS modules, it is the `__dirname` variable that contains the absolute path to the folder containing current module. - /// For ECMAScript modules, it is the value of `import.meta.url`. - /// - /// # Errors - /// - /// * See [ResolveError] - pub fn resolve>( - &self, - path: P, - specifier: &str, - ) -> Result { - let mut ctx = Ctx::default(); - self.resolve_tracing(path.as_ref(), specifier, &mut ctx) - } - - /// Resolve `specifier` at absolute `path` with [ResolveContext] - /// - /// # Errors - /// - /// * See [ResolveError] - pub fn resolve_with_context>( - &self, - path: P, - specifier: &str, - resolve_context: &mut ResolveContext, - ) -> Result { - let mut ctx = Ctx::default(); - ctx.init_file_dependencies(); - let result = self.resolve_tracing(path.as_ref(), specifier, &mut ctx); - if let Some(deps) = &mut ctx.file_dependencies { - resolve_context.file_dependencies.extend(deps.drain(..)); - } - if let Some(deps) = &mut ctx.missing_dependencies { - resolve_context.missing_dependencies.extend(deps.drain(..)); - } - result - } - - /// Wrap `resolve_impl` with `tracing` information - fn resolve_tracing( - &self, - path: &Path, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - let span = tracing::debug_span!("resolve", path = ?path, specifier = specifier); - let _enter = span.enter(); - let r = self.resolve_impl(path, specifier, ctx); - match &r { - Ok(r) => { - tracing::debug!(options = ?self.options, path = ?path, specifier = specifier, ret = ?r.path); - } - Err(err) => { - tracing::debug!(options = ?self.options, path = ?path, specifier = specifier, err = ?err); - } - }; - r - } - - fn resolve_impl( - &self, - path: &Path, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - ctx.with_fully_specified(self.options.fully_specified); - let specifier = Specifier::parse(specifier).map_err(ResolveError::Specifier)?; - ctx.with_query_fragment(specifier.query, specifier.fragment); - let cached_path = self.cache.value(path); - let cached_path = self.require(&cached_path, specifier.path(), ctx).or_else(|err| { - if err.is_ignore() { - return Err(err); - } - // enhanced-resolve: try fallback - self.load_alias(&cached_path, specifier.path(), &self.options.fallback, ctx) - .and_then(|value| value.ok_or(err)) - })?; - let path = self.load_realpath(&cached_path)?; - // enhanced-resolve: restrictions - self.check_restrictions(&path)?; - let package_json = cached_path.find_package_json(&self.cache.fs, &self.options, ctx)?; - if let Some(package_json) = &package_json { - // path must be inside the package. - debug_assert!(path.starts_with(package_json.directory())); - } - Ok(Resolution { - path, - query: ctx.query.take(), - fragment: ctx.fragment.take(), - package_json, - }) - } - - /// require(X) from module at path Y - /// - /// X: specifier - /// Y: path - /// - /// - fn require( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - ctx.test_for_infinite_recursion()?; - - // enhanced-resolve: try fragment as path - if let Some(path) = self.try_fragment_as_path(cached_path, specifier, ctx) { - return Ok(path); - } - - // tsconfig-paths - if let Some(path) = self.load_tsconfig_paths(cached_path, specifier, &mut Ctx::default())? { - return Ok(path); - } - - // enhanced-resolve: try alias - if let Some(path) = self.load_alias(cached_path, specifier, &self.options.alias, ctx)? { - return Ok(path); - } - - match Path::new(specifier).components().next() { - // 3. If X begins with './' or '/' or '../' - Some(Component::RootDir | Component::Prefix(_)) => { - self.require_absolute(cached_path, specifier, ctx) - } - // 3. If X begins with './' or '/' or '../' - Some(Component::CurDir | Component::ParentDir) => { - self.require_relative(cached_path, specifier, ctx) - } - // 4. If X begins with '#' - Some(Component::Normal(_)) if specifier.as_bytes()[0] == b'#' => { - self.require_hash(cached_path, specifier, ctx) - } - _ => { - // 1. If X is a core module, - // a. return the core module - // b. STOP - self.require_core(specifier)?; - - // (ESM) 5. Otherwise, - // Note: specifier is now a bare specifier. - // Set resolved the result of PACKAGE_RESOLVE(specifier, parentURL). - self.require_bare(cached_path, specifier, ctx) - } - } - } - - fn require_core(&self, specifier: &str) -> Result<(), ResolveError> { - if self.options.builtin_modules - && (specifier.starts_with("node:") || NODEJS_BUILTINS.binary_search(&specifier).is_ok()) - { - return Err(ResolveError::Builtin(specifier.to_string())); - } - Ok(()) - } - - fn require_absolute( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - // Make sure only path prefixes gets called - debug_assert!(Path::new(specifier) - .components() - .next() - .is_some_and(|c| matches!(c, Component::RootDir | Component::Prefix(_)))); - if !self.options.prefer_relative && self.options.prefer_absolute { - if let Ok(path) = self.load_package_self_or_node_modules(cached_path, specifier, ctx) { - return Ok(path); - } - } - if let Some(path) = self.load_roots(specifier, ctx) { - return Ok(path); - } - // 2. If X begins with '/' - // a. set Y to be the file system root - let path = self.cache.value(Path::new(specifier)); - if let Some(path) = self.load_as_file_or_directory(&path, specifier, ctx)? { - return Ok(path); - } - Err(ResolveError::NotFound(specifier.to_string())) - } - - // 3. If X begins with './' or '/' or '../' - fn require_relative( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - // Make sure only relative or normal paths gets called - debug_assert!(Path::new(specifier).components().next().is_some_and(|c| matches!( - c, - Component::CurDir | Component::ParentDir | Component::Normal(_) - ))); - let path = cached_path.path().normalize_with(specifier); - let cached_path = self.cache.value(&path); - // a. LOAD_AS_FILE(Y + X) - // b. LOAD_AS_DIRECTORY(Y + X) - if let Some(path) = self.load_as_file_or_directory(&cached_path, specifier, ctx)? { - return Ok(path); - } - // c. THROW "not found" - Err(ResolveError::NotFound(specifier.to_string())) - } - - fn require_hash( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - debug_assert_eq!(specifier.chars().next(), Some('#')); - // a. LOAD_PACKAGE_IMPORTS(X, dirname(Y)) - if let Some(path) = self.load_package_imports(cached_path, specifier, ctx)? { - return Ok(path); - } - self.load_package_self_or_node_modules(cached_path, specifier, ctx) - } - - fn require_bare( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - // Make sure no other path prefixes gets called - debug_assert!(Path::new(specifier) - .components() - .next() - .is_some_and(|c| matches!(c, Component::Normal(_)))); - if self.options.prefer_relative { - if let Ok(path) = self.require_relative(cached_path, specifier, ctx) { - return Ok(path); - } - } - self.load_package_self_or_node_modules(cached_path, specifier, ctx) - } - - /// Try fragment as part of the path - /// - /// 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`. - /// - /// - fn try_fragment_as_path( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Option { - if ctx.fragment.is_some() && ctx.query.is_none() { - let fragment = ctx.fragment.take().unwrap(); - let path = format!("{specifier}{fragment}"); - if let Ok(path) = self.require(cached_path, &path, ctx) { - return Some(path); - } - ctx.fragment.replace(fragment); - } - None - } - - fn load_package_self_or_node_modules( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - let (_, subpath) = Self::parse_package_specifier(specifier); - if subpath.is_empty() { - ctx.with_fully_specified(false); - } - // 5. LOAD_PACKAGE_SELF(X, dirname(Y)) - if let Some(path) = self.load_package_self(cached_path, specifier, ctx)? { - return Ok(path); - } - // 6. LOAD_NODE_MODULES(X, dirname(Y)) - if let Some(path) = self.load_node_modules(cached_path, specifier, ctx)? { - return Ok(path); - } - // 7. THROW "not found" - Err(ResolveError::NotFound(specifier.to_string())) - } - - /// LOAD_PACKAGE_IMPORTS(X, DIR) - fn load_package_imports( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - // 1. Find the closest package scope SCOPE to DIR. - // 2. If no scope was found, return. - let Some(package_json) = - cached_path.find_package_json(&self.cache.fs, &self.options, ctx)? - else { - return Ok(None); - }; - // 3. If the SCOPE/package.json "imports" is null or undefined, return. - // 4. let MATCH = PACKAGE_IMPORTS_RESOLVE(X, pathToFileURL(SCOPE), ["node", "require"]) defined in the ESM resolver. - if let Some(path) = self.package_imports_resolve(specifier, &package_json, ctx)? { - // 5. RESOLVE_ESM_MATCH(MATCH). - return self.resolve_esm_match(specifier, &path, ctx); - } - Ok(None) - } - - fn load_as_file(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - // enhanced-resolve feature: extension_alias - if let Some(path) = self.load_extension_alias(cached_path, ctx)? { - return Ok(Some(path)); - } - if self.options.enforce_extension.is_disabled() { - // 1. If X is a file, load X as its file extension format. STOP - if let Some(path) = self.load_alias_or_file(cached_path, ctx)? { - return Ok(Some(path)); - } - } - // 2. If X.js is a file, load X.js as JavaScript text. STOP - // 3. If X.json is a file, parse X.json to a JavaScript Object. STOP - // 4. If X.node is a file, load X.node as binary addon. STOP - if let Some(path) = - self.load_extensions(cached_path.path(), &self.options.extensions, ctx)? - { - return Ok(Some(path)); - } - Ok(None) - } - - fn load_as_directory(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - // TODO: Only package.json is supported, so warn about having other values - // Checking for empty files is needed for omitting checks on package.json - // 1. If X/package.json is a file, - if !self.options.description_files.is_empty() { - // a. Parse X/package.json, and look for "main" field. - if let Some(package_json) = - cached_path.package_json(&self.cache.fs, &self.options, ctx)? - { - // b. If "main" is a falsy value, GOTO 2. - for main_field in package_json.main_fields(&self.options.main_fields) { - // c. let M = X + (json main field) - let main_field_path = cached_path.path().normalize_with(main_field); - // d. LOAD_AS_FILE(M) - let cached_path = self.cache.value(&main_field_path); - if let Some(path) = self.load_as_file(&cached_path, ctx)? { - return Ok(Some(path)); - } - // e. LOAD_INDEX(M) - if let Some(path) = self.load_index(&cached_path, ctx)? { - return Ok(Some(path)); - } - } - // f. LOAD_INDEX(X) DEPRECATED - // g. THROW "not found" - } - } - // 2. LOAD_INDEX(X) - self.load_index(cached_path, ctx) - } - - fn load_as_file_or_directory( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - if self.options.resolve_to_context { - return Ok(cached_path.is_dir(&self.cache.fs, ctx).then(|| cached_path.clone())); - } - if !specifier.ends_with('/') { - if let Some(path) = self.load_as_file(cached_path, ctx)? { - return Ok(Some(path)); - } - } - if cached_path.is_dir(&self.cache.fs, ctx) { - if let Some(path) = self.load_as_directory(cached_path, ctx)? { - return Ok(Some(path)); - } - } - Ok(None) - } - - fn load_extensions(&self, path: &Path, extensions: &[String], ctx: &mut Ctx) -> ResolveResult { - if ctx.fully_specified { - return Ok(None); - } - let path = path.as_os_str(); - for extension in extensions { - let mut path_with_extension = path.to_os_string(); - path_with_extension.reserve_exact(extension.len()); - path_with_extension.push(extension); - let cached_path = self.cache.value(Path::new(&path_with_extension)); - if let Some(path) = self.load_alias_or_file(&cached_path, ctx)? { - return Ok(Some(path)); - } - } - Ok(None) - } - - fn load_realpath(&self, cached_path: &CachedPath) -> Result { - if self.options.symlinks { - cached_path.realpath(&self.cache.fs).map_err(ResolveError::from) - } else { - Ok(cached_path.to_path_buf()) - } - } - - fn check_restrictions(&self, path: &Path) -> Result<(), ResolveError> { - // https://github.com/webpack/enhanced-resolve/blob/a998c7d218b7a9ec2461fc4fddd1ad5dd7687485/lib/RestrictionsPlugin.js#L19-L24 - fn is_inside(path: &Path, parent: &Path) -> bool { - if !path.starts_with(parent) { - return false; - } - if path.as_os_str().len() == parent.as_os_str().len() { - return true; - } - path.strip_prefix(parent).is_ok_and(|p| p == Path::new("./")) - } - for restriction in &self.options.restrictions { - match restriction { - Restriction::Path(restricted_path) => { - if !is_inside(path, restricted_path) { - return Err(ResolveError::Restriction( - path.to_path_buf(), - restricted_path.clone(), - )); - } - } - Restriction::RegExp(_) => { - return Err(ResolveError::Unimplemented("Restriction with regex")) - } - } - } - Ok(()) - } - - fn load_index(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - for main_file in &self.options.main_files { - let main_path = cached_path.path().normalize_with(main_file); - let cached_path = self.cache.value(&main_path); - if self.options.enforce_extension.is_disabled() { - if let Some(path) = self.load_alias_or_file(&cached_path, ctx)? { - return Ok(Some(path)); - } - } - // 1. If X/index.js is a file, load X/index.js as JavaScript text. STOP - // 2. If X/index.json is a file, parse X/index.json to a JavaScript object. STOP - // 3. If X/index.node is a file, load X/index.node as binary addon. STOP - if let Some(path) = - self.load_extensions(cached_path.path(), &self.options.extensions, ctx)? - { - return Ok(Some(path)); - } - } - Ok(None) - } - - fn load_alias_or_file(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - if let Some(package_json) = - cached_path.find_package_json(&self.cache.fs, &self.options, ctx)? - { - if let Some(path) = self.load_browser_field(cached_path, None, &package_json, ctx)? { - return Ok(Some(path)); - } - } - // enhanced-resolve: try file as alias - let alias_specifier = cached_path.path().to_string_lossy(); - if let Some(path) = - self.load_alias(cached_path, &alias_specifier, &self.options.alias, ctx)? - { - return Ok(Some(path)); - } - if cached_path.is_file(&self.cache.fs, ctx) { - return Ok(Some(cached_path.clone())); - } - Ok(None) - } - - fn load_node_modules( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - let (package_name, subpath) = Self::parse_package_specifier(specifier); - // 1. let DIRS = NODE_MODULES_PATHS(START) - // 2. for each DIR in DIRS: - for module_name in &self.options.modules { - for cached_path in std::iter::successors(Some(cached_path), |p| p.parent()) { - // Skip if /path/to/node_modules does not exist - if !cached_path.is_dir(&self.cache.fs, ctx) { - continue; - } - - let Some(cached_path) = self.get_module_directory(cached_path, module_name, ctx) - else { - continue; - }; - // Optimize node_modules lookup by inspecting whether the package exists - // From LOAD_PACKAGE_EXPORTS(X, DIR) - // 1. Try to interpret X as a combination of NAME and SUBPATH where the name - // may have a @scope/ prefix and the subpath begins with a slash (`/`). - if !package_name.is_empty() { - let package_path = cached_path.path().normalize_with(package_name); - let cached_path = self.cache.value(&package_path); - // Try foo/node_modules/package_name - if cached_path.is_dir(&self.cache.fs, ctx) { - // a. LOAD_PACKAGE_EXPORTS(X, DIR) - if let Some(path) = - self.load_package_exports(specifier, subpath, &cached_path, ctx)? - { - return Ok(Some(path)); - } - } else { - // foo/node_modules/package_name is not a directory, so useless to check inside it - if !subpath.is_empty() { - continue; - } - // Skip if the directory lead to the scope package does not exist - // i.e. `foo/node_modules/@scope` is not a directory for `foo/node_modules/@scope/package` - if package_name.starts_with('@') { - if let Some(path) = cached_path.parent() { - if !path.is_dir(&self.cache.fs, ctx) { - continue; - } - } - } - } - } - - // Try as file or directory for all other cases - // b. LOAD_AS_FILE(DIR/X) - // c. LOAD_AS_DIRECTORY(DIR/X) - let node_module_file = cached_path.path().normalize_with(specifier); - let cached_path = self.cache.value(&node_module_file); - if let Some(path) = self.load_as_file_or_directory(&cached_path, specifier, ctx)? { - return Ok(Some(path)); - } - } - } - Ok(None) - } - - fn get_module_directory( - &self, - cached_path: &CachedPath, - module_name: &str, - ctx: &mut Ctx, - ) -> Option { - if cached_path.path().ends_with(module_name) { - Some(cached_path.clone()) - } else if module_name == "node_modules" { - cached_path.cached_node_modules(&self.cache, ctx) - } else { - cached_path.module_directory(module_name, &self.cache, ctx) - } - } - - fn load_package_exports( - &self, - specifier: &str, - subpath: &str, - cached_path: &CachedPath, - ctx: &mut Ctx, - ) -> ResolveResult { - // 2. If X does not match this pattern or DIR/NAME/package.json is not a file, - // return. - let Some(package_json) = cached_path.package_json(&self.cache.fs, &self.options, ctx)? - else { - return Ok(None); - }; - // 3. Parse DIR/NAME/package.json, and look for "exports" field. - // 4. If "exports" is null or undefined, return. - // 5. let MATCH = PACKAGE_EXPORTS_RESOLVE(pathToFileURL(DIR/NAME), "." + SUBPATH, - // `package.json` "exports", ["node", "require"]) defined in the ESM resolver. - // Note: The subpath is not prepended with a dot on purpose - for exports in package_json.exports_fields(&self.options.exports_fields) { - if let Some(path) = self.package_exports_resolve( - cached_path.path(), - &format!(".{subpath}"), - exports, - ctx, - )? { - // 6. RESOLVE_ESM_MATCH(MATCH) - return self.resolve_esm_match(specifier, &path, ctx); - }; - } - Ok(None) - } - - fn load_package_self( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - // 1. Find the closest package scope SCOPE to DIR. - // 2. If no scope was found, return. - let Some(package_json) = - cached_path.find_package_json(&self.cache.fs, &self.options, ctx)? - else { - return Ok(None); - }; - // 3. If the SCOPE/package.json "exports" is null or undefined, return. - // 4. If the SCOPE/package.json "name" is not the first segment of X, return. - if let Some(subpath) = package_json - .name - .as_ref() - .and_then(|package_name| Self::strip_package_name(specifier, package_name)) - { - // 5. let MATCH = PACKAGE_EXPORTS_RESOLVE(pathToFileURL(SCOPE), - // "." + X.slice("name".length), `package.json` "exports", ["node", "require"]) - // defined in the ESM resolver. - let package_url = package_json.directory(); - // Note: The subpath is not prepended with a dot on purpose - // because `package_exports_resolve` matches subpath without the leading dot. - for exports in package_json.exports_fields(&self.options.exports_fields) { - if let Some(cached_path) = - self.package_exports_resolve(package_url, &format!(".{subpath}"), exports, ctx)? - { - // 6. RESOLVE_ESM_MATCH(MATCH) - return self.resolve_esm_match(specifier, &cached_path, ctx); - } - } - } - self.load_browser_field(cached_path, Some(specifier), &package_json, ctx) - } - - /// RESOLVE_ESM_MATCH(MATCH) - fn resolve_esm_match( - &self, - specifier: &str, - cached_path: &CachedPath, - ctx: &mut Ctx, - ) -> ResolveResult { - // 1. let RESOLVED_PATH = fileURLToPath(MATCH) - // 2. If the file at RESOLVED_PATH exists, load RESOLVED_PATH as its extension format. STOP - // - // Non-compliant ESM can result in a directory, so directory is tried as well. - if let Some(path) = self.load_as_file_or_directory(cached_path, "", ctx)? { - return Ok(Some(path)); - } - // 3. THROW "not found" - Err(ResolveError::NotFound(specifier.to_string())) - } - - /// enhanced-resolve: AliasFieldPlugin for [ResolveOptions::alias_fields] - fn load_browser_field( - &self, - cached_path: &CachedPath, - module_specifier: Option<&str>, - package_json: &PackageJson, - ctx: &mut Ctx, - ) -> ResolveResult { - let path = cached_path.path(); - let Some(new_specifier) = package_json.resolve_browser_field( - path, - module_specifier, - &self.options.alias_fields, - )? - else { - return Ok(None); - }; - // Abort when resolving recursive module - if module_specifier.is_some_and(|s| s == new_specifier) { - return Ok(None); - } - if ctx.resolving_alias.as_ref().is_some_and(|s| s == new_specifier) { - // Complete when resolving to self `{"./a.js": "./a.js"}` - if new_specifier.strip_prefix("./").filter(|s| path.ends_with(Path::new(s))).is_some() { - return if cached_path.is_file(&self.cache.fs, ctx) { - Ok(Some(cached_path.clone())) - } else { - Err(ResolveError::NotFound(new_specifier.to_string())) - }; - } - return Err(ResolveError::Recursion); - } - let specifier = Specifier::parse(new_specifier).map_err(ResolveError::Specifier)?; - ctx.with_query_fragment(specifier.query, specifier.fragment); - ctx.with_resolving_alias(specifier.path().to_string()); - ctx.with_fully_specified(false); - let cached_path = self.cache.value(package_json.directory()); - self.require(&cached_path, specifier.path(), ctx).map(Some) - } - - /// enhanced-resolve: AliasPlugin for [ResolveOptions::alias] and [ResolveOptions::fallback]. - fn load_alias( - &self, - cached_path: &CachedPath, - specifier: &str, - aliases: &Alias, - ctx: &mut Ctx, - ) -> ResolveResult { - for (alias_key_raw, specifiers) in aliases { - let alias_key = if let Some(alias_key) = alias_key_raw.strip_suffix('$') { - if alias_key != specifier { - continue; - } - alias_key - } else { - let strip_package_name = Self::strip_package_name(specifier, alias_key_raw); - if strip_package_name.is_none() { - continue; - } - alias_key_raw - }; - // It should stop resolving when all of the tried alias values - // failed to resolve. - // - let mut should_stop = false; - for r in specifiers { - match r { - AliasValue::Path(alias_value) => { - let new_specifier = - Specifier::parse(alias_value).map_err(ResolveError::Specifier)?; - // Resolve path without query and fragment - let old_query = ctx.query.clone(); - let old_fragment = ctx.fragment.clone(); - ctx.with_query_fragment(new_specifier.query, new_specifier.fragment); - if let Some(path) = self.load_alias_value( - cached_path, - alias_key, - new_specifier.path(), // pass in parsed alias value - specifier, - ctx, - &mut should_stop, - )? { - return Ok(Some(path)); - } - ctx.with_query_fragment(old_query.as_deref(), old_fragment.as_deref()); - } - AliasValue::Ignore => { - let path = cached_path.path().normalize_with(alias_key); - return Err(ResolveError::Ignored(path)); - } - } - } - if should_stop { - return Err(ResolveError::NotFound(specifier.to_string())); - } - } - Ok(None) - } - - fn load_alias_value( - &self, - cached_path: &CachedPath, - alias_key: &str, - alias_value: &str, - request: &str, - ctx: &mut Ctx, - should_stop: &mut bool, - ) -> ResolveResult { - if request != alias_value - && !request.strip_prefix(alias_value).is_some_and(|prefix| prefix.starts_with('/')) - { - let tail = &request[alias_key.len()..]; - - let new_specifier = if tail.is_empty() { - Cow::Borrowed(alias_value) - } else { - let alias_value = Path::new(alias_value).normalize(); - // Must not append anything to alias_value if it is a file. - let alias_value_cached_path = self.cache.value(&alias_value); - if alias_value_cached_path.is_file(&self.cache.fs, ctx) { - return Ok(None); - } - - // Remove the leading slash so the final path is concatenated. - let tail = tail.trim_start_matches(SLASH_START); - let normalized = alias_value.normalize_with(tail); - Cow::Owned(normalized.to_string_lossy().to_string()) - }; - - *should_stop = true; - ctx.with_fully_specified(false); - return match self.require(cached_path, new_specifier.as_ref(), ctx) { - Err(ResolveError::NotFound(_)) => Ok(None), - Ok(path) => return Ok(Some(path)), - Err(err) => return Err(err), - }; - } - Ok(None) - } - - /// Given an extension alias map `{".js": [".ts", "js"]}`, - /// load the mapping instead of the provided extension - /// - /// This is an enhanced-resolve feature - /// - /// # Errors - /// - /// * [ResolveError::ExtensionAlias]: When all of the aliased extensions are not found - fn load_extension_alias(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - let Some(path_extension) = cached_path.path().extension() else { - return Ok(None); - }; - let Some((_, extensions)) = self - .options - .extension_alias - .iter() - .find(|(ext, _)| OsStr::new(ext.trim_start_matches('.')) == path_extension) - else { - return Ok(None); - }; - let path = cached_path.path().with_extension(""); - ctx.with_fully_specified(false); - if let Some(path) = self.load_extensions(&path, extensions, ctx)? { - return Ok(Some(path)); - } - Err(ResolveError::ExtensionAlias) - } - - /// enhanced-resolve: RootsPlugin - /// - /// A list of directories where requests of server-relative URLs (starting with '/') are resolved, - /// defaults to context configuration option. - /// - /// On non-Windows systems these requests are resolved as an absolute path first. - fn load_roots(&self, specifier: &str, ctx: &mut Ctx) -> Option { - if !self.options.roots.is_empty() { - if let Some(specifier) = specifier.strip_prefix(SLASH_START) { - for root in &self.options.roots { - let cached_path = self.cache.value(root); - if let Ok(path) = self.require_relative(&cached_path, specifier, ctx) { - return Some(path); - } - } - } - } - None - } - - fn load_tsconfig_paths( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - let Some(tsconfig_options) = &self.options.tsconfig else { - return Ok(None); - }; - let tsconfig = self.load_tsconfig( - /* root */ true, - &tsconfig_options.config_file, - &tsconfig_options.references, - )?; - let paths = tsconfig.resolve(cached_path.path(), specifier); - for path in paths { - let cached_path = self.cache.value(&path); - if let Ok(path) = self.require_relative(&cached_path, ".", ctx) { - return Ok(Some(path)); - } - } - Ok(None) - } - - fn load_tsconfig( - &self, - root: bool, - path: &Path, - references: &TsconfigReferences, - ) -> Result, ResolveError> { - self.cache.tsconfig(root, path, |tsconfig| { - let directory = self.cache.value(tsconfig.directory()); - tracing::trace!(tsconfig = ?tsconfig, "load_tsconfig"); - - // Extend tsconfig - if let Some(extends) = &tsconfig.extends { - let extended_tsconfig_paths = match extends { - ExtendsField::Single(s) => { - vec![self.get_extended_tsconfig_path(&directory, tsconfig, s)?] - } - ExtendsField::Multiple(specifiers) => specifiers - .iter() - .map(|s| self.get_extended_tsconfig_path(&directory, tsconfig, s)) - .collect::, ResolveError>>()?, - }; - for extended_tsconfig_path in extended_tsconfig_paths { - let extended_tsconfig = self.load_tsconfig( - /* root */ false, - &extended_tsconfig_path, - &TsconfigReferences::Disabled, - )?; - tsconfig.extend_tsconfig(&extended_tsconfig); - } - } - - // Load project references - match references { - TsconfigReferences::Disabled => { - tsconfig.references.drain(..); - } - TsconfigReferences::Auto => {} - TsconfigReferences::Paths(paths) => { - tsconfig.references = paths - .iter() - .map(|path| ProjectReference { path: path.clone(), tsconfig: None }) - .collect(); - } - } - if !tsconfig.references.is_empty() { - let directory = tsconfig.directory().to_path_buf(); - for reference in &mut tsconfig.references { - let reference_tsconfig_path = directory.normalize_with(&reference.path); - let tsconfig = self.cache.tsconfig( - /* root */ true, - &reference_tsconfig_path, - |_| Ok(()), - )?; - reference.tsconfig.replace(tsconfig); - } - } - Ok(()) - }) - } - - fn get_extended_tsconfig_path( - &self, - directory: &CachedPath, - tsconfig: &TsConfig, - specifier: &str, - ) -> Result { - match specifier.as_bytes().first() { - None => Err(ResolveError::Specifier(SpecifierError::Empty(specifier.to_string()))), - Some(b'/') => Ok(PathBuf::from(specifier)), - Some(b'.') => Ok(tsconfig.directory().normalize_with(specifier)), - _ => self - .clone_with_options(ResolveOptions { - description_files: vec![], - extensions: vec![".json".into()], - main_files: vec!["tsconfig.json".into()], - ..ResolveOptions::default() - }) - .load_package_self_or_node_modules(directory, specifier, &mut Ctx::default()) - .map(|p| p.to_path_buf()) - .map_err(|err| match err { - ResolveError::NotFound(_) => { - ResolveError::TsconfigNotFound(PathBuf::from(specifier)) - } - _ => err, - }), - } - } - - /// PACKAGE_RESOLVE(packageSpecifier, parentURL) - fn package_resolve( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - let (package_name, subpath) = Self::parse_package_specifier(specifier); - // 11. While parentURL is not the file system root, - for module_name in &self.options.modules { - for cached_path in std::iter::successors(Some(cached_path), |p| p.parent()) { - // 1. Let packageURL be the URL resolution of "node_modules/" concatenated with packageSpecifier, relative to parentURL. - let Some(cached_path) = self.get_module_directory(cached_path, module_name, ctx) - else { - continue; - }; - // 2. Set parentURL to the parent folder URL of parentURL. - let package_path = cached_path.path().normalize_with(package_name); - let cached_path = self.cache.value(&package_path); - // 3. If the folder at packageURL does not exist, then - // 1. Continue the next loop iteration. - if cached_path.is_dir(&self.cache.fs, ctx) { - // 4. Let pjson be the result of READ_PACKAGE_JSON(packageURL). - if let Some(package_json) = - cached_path.package_json(&self.cache.fs, &self.options, ctx)? - { - // 5. If pjson is not null and pjson.exports is not null or undefined, then - // 1. Return the result of PACKAGE_EXPORTS_RESOLVE(packageURL, packageSubpath, pjson.exports, defaultConditions). - for exports in package_json.exports_fields(&self.options.exports_fields) { - if let Some(path) = self.package_exports_resolve( - cached_path.path(), - &format!(".{subpath}"), - exports, - ctx, - )? { - return Ok(Some(path)); - } - } - // 6. Otherwise, if packageSubpath is equal to ".", then - if subpath == "." { - // 1. If pjson.main is a string, then - for main_field in package_json.main_fields(&self.options.main_fields) { - // 1. Return the URL resolution of main in packageURL. - let path = cached_path.path().normalize_with(main_field); - let cached_path = self.cache.value(&path); - if cached_path.is_file(&self.cache.fs, ctx) { - return Ok(Some(cached_path)); - } - } - } - } - let subpath = format!(".{subpath}"); - let specifier = Specifier::parse(&subpath).map_err(ResolveError::Specifier)?; - ctx.with_fully_specified(false); - ctx.with_query_fragment(specifier.query, specifier.fragment); - return self.require(&cached_path, specifier.path(), ctx).map(Some); - } - } - } - - Err(ResolveError::NotFound(specifier.to_string())) - } - - /// PACKAGE_EXPORTS_RESOLVE(packageURL, subpath, exports, conditions) - fn package_exports_resolve( - &self, - package_url: &Path, - subpath: &str, - exports: &JSONValue, - ctx: &mut Ctx, - ) -> ResolveResult { - let conditions = &self.options.condition_names; - // 1. If exports is an Object with both a key starting with "." and a key not starting with ".", throw an Invalid Package Configuration error. - if let JSONValue::Object(map) = exports { - let mut has_dot = false; - let mut without_dot = false; - for key in map.keys() { - has_dot = has_dot || key.starts_with(|s| s == '.' || s == '#'); - without_dot = without_dot || !key.starts_with(|s| s == '.' || s == '#'); - if has_dot && without_dot { - return Err(ResolveError::InvalidPackageConfig( - package_url.join("package.json"), - )); - } - } - } - // 2. If subpath is equal to ".", then - // Note: subpath is not prepended with a dot when passed in. - if subpath == "." { - // enhanced-resolve appends query and fragment when resolving exports field - // https://github.com/webpack/enhanced-resolve/blob/a998c7d218b7a9ec2461fc4fddd1ad5dd7687485/lib/ExportsFieldPlugin.js#L57-L62 - // This is only need when querying the main export, otherwise ctx is passed through. - if ctx.query.is_some() || ctx.fragment.is_some() { - let query = ctx.query.clone().unwrap_or_default(); - let fragment = ctx.fragment.clone().unwrap_or_default(); - return Err(ResolveError::PackagePathNotExported( - format!("./{}{query}{fragment}", subpath.trim_start_matches('.')), - package_url.join("package.json"), - )); - } - // 1. Let mainExport be undefined. - let main_export = match exports { - // 2. If exports is a String or Array, or an Object containing no keys starting with ".", then - JSONValue::String(_) | JSONValue::Array(_) => { - // 1. Set mainExport to exports. - Some(exports) - } - // 3. Otherwise if exports is an Object containing a "." property, then - JSONValue::Object(map) => { - // 1. Set mainExport to exports["."]. - map.get(".").map_or_else( - || { - if map.keys().any(|key| key.starts_with("./") || key.starts_with('#')) { - None - } else { - Some(exports) - } - }, - Some, - ) - } - _ => None, - }; - // 4. If mainExport is not undefined, then - if let Some(main_export) = main_export { - // 1. Let resolved be the result of PACKAGE_TARGET_RESOLVE( packageURL, mainExport, null, false, conditions). - let resolved = self.package_target_resolve( - package_url, - ".", - main_export, - None, - /* is_imports */ false, - conditions, - ctx, - )?; - // 2. If resolved is not null or undefined, return resolved. - if let Some(path) = resolved { - return Ok(Some(path)); - } - } - } - // 3. Otherwise, if exports is an Object and all keys of exports start with ".", then - if let JSONValue::Object(exports) = exports { - // 1. Let matchKey be the string "./" concatenated with subpath. - // Note: `package_imports_exports_resolve` does not require the leading dot. - let match_key = &subpath; - // 2. Let resolved be the result of PACKAGE_IMPORTS_EXPORTS_RESOLVE( matchKey, exports, packageURL, false, conditions). - if let Some(path) = self.package_imports_exports_resolve( - match_key, - exports, - package_url, - /* is_imports */ false, - conditions, - ctx, - )? { - // 3. If resolved is not null or undefined, return resolved. - return Ok(Some(path)); - } - } - // 4. Throw a Package Path Not Exported error. - Err(ResolveError::PackagePathNotExported( - subpath.to_string(), - package_url.join("package.json"), - )) - } - - /// PACKAGE_IMPORTS_RESOLVE(specifier, parentURL, conditions) - fn package_imports_resolve( - &self, - specifier: &str, - package_json: &PackageJson, - ctx: &mut Ctx, - ) -> Result, ResolveError> { - // 1. Assert: specifier begins with "#". - debug_assert!(specifier.starts_with('#'), "{specifier}"); - // 2. If specifier is exactly equal to "#" or starts with "#/", then - // 1. Throw an Invalid Module Specifier error. - // 3. Let packageURL be the result of LOOKUP_PACKAGE_SCOPE(parentURL). - // 4. If packageURL is not null, then - - // 1. Let pjson be the result of READ_PACKAGE_JSON(packageURL). - // 2. If pjson.imports is a non-null Object, then - - // 1. Let resolved be the result of PACKAGE_IMPORTS_EXPORTS_RESOLVE( specifier, pjson.imports, packageURL, true, conditions). - let mut has_imports = false; - for imports in package_json.imports_fields(&self.options.imports_fields) { - if !has_imports { - has_imports = true; - // TODO: fill in test case for this case - if specifier == "#" || specifier.starts_with("#/") { - return Err(ResolveError::InvalidModuleSpecifier( - specifier.to_string(), - package_json.path.clone(), - )); - } - } - if let Some(path) = self.package_imports_exports_resolve( - specifier, - imports, - package_json.directory(), - /* is_imports */ true, - &self.options.condition_names, - ctx, - )? { - // 2. If resolved is not null or undefined, return resolved. - return Ok(Some(path)); - } - } - - // 5. Throw a Package Import Not Defined error. - if has_imports { - Err(ResolveError::PackageImportNotDefined( - specifier.to_string(), - package_json.path.clone(), - )) - } else { - Ok(None) - } - } - - /// PACKAGE_IMPORTS_EXPORTS_RESOLVE(matchKey, matchObj, packageURL, isImports, conditions) - fn package_imports_exports_resolve( - &self, - match_key: &str, - match_obj: &JSONMap, - package_url: &Path, - is_imports: bool, - conditions: &[String], - ctx: &mut Ctx, - ) -> ResolveResult { - // enhanced-resolve behaves differently, it throws - // Error: CachedPath to directories is not possible with the exports field (specifier was ./dist/) - if match_key.ends_with('/') { - return Ok(None); - } - // 1. If matchKey is a key of matchObj and does not contain "*", then - if !match_key.contains('*') { - // 1. Let target be the value of matchObj[matchKey]. - if let Some(target) = match_obj.get(match_key) { - // 2. Return the result of PACKAGE_TARGET_RESOLVE(packageURL, target, null, isImports, conditions). - return self.package_target_resolve( - package_url, - match_key, - target, - None, - is_imports, - conditions, - ctx, - ); - } - } - - let mut best_target = None; - let mut best_match = ""; - let mut best_key = ""; - // 2. Let expansionKeys be the list of keys of matchObj containing only a single "*", sorted by the sorting function PATTERN_KEY_COMPARE which orders in descending order of specificity. - // 3. For each key expansionKey in expansionKeys, do - for (expansion_key, target) in match_obj { - if expansion_key.starts_with("./") || expansion_key.starts_with('#') { - // 1. Let patternBase be the substring of expansionKey up to but excluding the first "*" character. - if let Some((pattern_base, pattern_trailer)) = expansion_key.split_once('*') { - // 2. If matchKey starts with but is not equal to patternBase, then - if match_key.starts_with(pattern_base) - // 1. Let patternTrailer be the substring of expansionKey from the index after the first "*" character. - && !pattern_trailer.contains('*') - // 2. If patternTrailer has zero length, or if matchKey ends with patternTrailer and the length of matchKey is greater than or equal to the length of expansionKey, then - && (pattern_trailer.is_empty() - || (match_key.len() >= expansion_key.len() - && match_key.ends_with(pattern_trailer))) - && Self::pattern_key_compare(best_key, expansion_key).is_gt() - { - // 1. Let target be the value of matchObj[expansionKey]. - best_target = Some(target); - // 2. Let patternMatch be the substring of matchKey starting at the index of the length of patternBase up to the length of matchKey minus the length of patternTrailer. - best_match = - &match_key[pattern_base.len()..match_key.len() - pattern_trailer.len()]; - best_key = expansion_key; - } - } else if expansion_key.ends_with('/') - && match_key.starts_with(expansion_key) - && Self::pattern_key_compare(best_key, expansion_key).is_gt() - { - // TODO: [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./dist/" in the "exports" field module resolution of the package at xxx/package.json. - best_target = Some(target); - best_match = &match_key[expansion_key.len()..]; - best_key = expansion_key; - } - } - } - if let Some(best_target) = best_target { - // 3. Return the result of PACKAGE_TARGET_RESOLVE(packageURL, target, patternMatch, isImports, conditions). - return self.package_target_resolve( - package_url, - best_key, - best_target, - Some(best_match), - is_imports, - conditions, - ctx, - ); - } - // 4. Return null. - Ok(None) - } - - /// PACKAGE_TARGET_RESOLVE(packageURL, target, patternMatch, isImports, conditions) - #[allow(clippy::too_many_arguments)] - fn package_target_resolve( - &self, - package_url: &Path, - target_key: &str, - target: &JSONValue, - pattern_match: Option<&str>, - is_imports: bool, - conditions: &[String], - ctx: &mut Ctx, - ) -> ResolveResult { - fn normalize_string_target<'a>( - target_key: &'a str, - target: &'a str, - pattern_match: Option<&'a str>, - package_url: &Path, - ) -> Result, ResolveError> { - let target = if let Some(pattern_match) = pattern_match { - if !target_key.contains('*') && !target.contains('*') { - // enhanced-resolve behaviour - // TODO: [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./dist/" in the "exports" field module resolution of the package at xxx/package.json. - if target_key.ends_with('/') && target.ends_with('/') { - Cow::Owned(format!("{target}{pattern_match}")) - } else { - return Err(ResolveError::InvalidPackageConfigDirectory( - package_url.join("package.json"), - )); - } - } else { - Cow::Owned(target.replace('*', pattern_match)) - } - } else { - Cow::Borrowed(target) - }; - Ok(target) - } - - match target { - // 1. If target is a String, then - JSONValue::String(target) => { - // 1. If target does not start with "./", then - if !target.starts_with("./") { - // 1. If isImports is false, or if target starts with "../" or "/", or if target is a valid URL, then - if !is_imports || target.starts_with("../") || target.starts_with('/') { - // 1. Throw an Invalid Package Target error. - return Err(ResolveError::InvalidPackageTarget( - target.to_string(), - target_key.to_string(), - package_url.join("package.json"), - )); - } - // 2. If patternMatch is a String, then - // 1. Return PACKAGE_RESOLVE(target with every instance of "*" replaced by patternMatch, packageURL + "/"). - let target = - normalize_string_target(target_key, target, pattern_match, package_url)?; - let package_url = self.cache.value(package_url); - // // 3. Return PACKAGE_RESOLVE(target, packageURL + "/"). - return self.package_resolve(&package_url, &target, ctx); - } - - // 2. If target split on "/" or "\" contains any "", ".", "..", or "node_modules" segments after the first "." segment, case insensitive and including percent encoded variants, throw an Invalid Package Target error. - // 3. Let resolvedTarget be the URL resolution of the concatenation of packageURL and target. - // 4. Assert: resolvedTarget is contained in packageURL. - // 5. If patternMatch is null, then - let target = - normalize_string_target(target_key, target, pattern_match, package_url)?; - if Path::new(target.as_ref()).is_invalid_exports_target() { - return Err(ResolveError::InvalidPackageTarget( - target.to_string(), - target_key.to_string(), - package_url.join("package.json"), - )); - } - let resolved_target = package_url.normalize_with(target.as_ref()); - // 6. If patternMatch split on "/" or "\" contains any "", ".", "..", or "node_modules" segments, case insensitive and including percent encoded variants, throw an Invalid Module Specifier error. - // 7. Return the URL resolution of resolvedTarget with every instance of "*" replaced with patternMatch. - let value = self.cache.value(&resolved_target); - return Ok(Some(value)); - } - // 2. Otherwise, if target is a non-null Object, then - JSONValue::Object(target) => { - // 1. If exports contains any index property keys, as defined in ECMA-262 6.1.7 Array Index, throw an Invalid Package Configuration error. - // 2. For each property p of target, in object insertion order as, - for (i, (key, target_value)) in target.iter().enumerate() { - // https://nodejs.org/api/packages.html#conditional-exports - // "default" - the generic fallback that always matches. Can be a CommonJS or ES module file. This condition should always come last. - // Note: node.js does not throw this but enhanced-resolve does. - let is_default = key == "default"; - if i < target.len() - 1 && is_default { - return Err(ResolveError::InvalidPackageConfigDefault( - package_url.join("package.json"), - )); - } - - // 1. If p equals "default" or conditions contains an entry for p, then - if is_default || conditions.contains(key) { - // 1. Let targetValue be the value of the p property in target. - // 2. Let resolved be the result of PACKAGE_TARGET_RESOLVE( packageURL, targetValue, patternMatch, isImports, conditions). - let resolved = self.package_target_resolve( - package_url, - target_key, - target_value, - pattern_match, - is_imports, - conditions, - ctx, - ); - // 3. If resolved is equal to undefined, continue the loop. - if let Some(path) = resolved? { - // 4. Return resolved. - return Ok(Some(path)); - } - } - } - // 3. Return undefined. - return Ok(None); - } - // 3. Otherwise, if target is an Array, then - JSONValue::Array(targets) => { - // 1. If _target.length is zero, return null. - if targets.is_empty() { - // Note: return PackagePathNotExported has the same effect as return because there are no matches. - return Err(ResolveError::PackagePathNotExported( - pattern_match.unwrap_or(".").to_string(), - package_url.join("package.json"), - )); - } - // 2. For each item targetValue in target, do - for (i, target_value) in targets.iter().enumerate() { - // 1. Let resolved be the result of PACKAGE_TARGET_RESOLVE( packageURL, targetValue, patternMatch, isImports, conditions), continuing the loop on any Invalid Package Target error. - let resolved = self.package_target_resolve( - package_url, - target_key, - target_value, - pattern_match, - is_imports, - conditions, - ctx, - ); - - if resolved.is_err() && i == targets.len() { - return resolved; - } - - // 2. If resolved is undefined, continue the loop. - if let Ok(Some(path)) = resolved { - // 3. Return resolved. - return Ok(Some(path)); - } - } - // 3. Return or throw the last fallback resolution null return or error. - // Note: see `resolved.is_err() && i == targets.len()` - } - _ => {} - } - // 4. Otherwise, if target is null, return null. - Ok(None) - // 5. Otherwise throw an Invalid Package Target error. - } - - // Returns (module, subpath) - // https://github.com/nodejs/node/blob/8f0f17e1e3b6c4e58ce748e06343c5304062c491/lib/internal/modules/esm/resolve.js#L688 - fn parse_package_specifier(specifier: &str) -> (&str, &str) { - let mut separator_index = specifier.as_bytes().iter().position(|b| *b == b'/'); - // let mut valid_package_name = true; - // let mut is_scoped = false; - if specifier.starts_with('@') { - // is_scoped = true; - if separator_index.is_none() || specifier.is_empty() { - // valid_package_name = false; - } else if let Some(index) = &separator_index { - separator_index = specifier[*index + 1..] - .as_bytes() - .iter() - .position(|b| *b == b'/') - .map(|i| i + *index + 1); - } - } - let package_name = - separator_index.map_or(specifier, |separator_index| &specifier[..separator_index]); - - // TODO: https://github.com/nodejs/node/blob/8f0f17e1e3b6c4e58ce748e06343c5304062c491/lib/internal/modules/esm/resolve.js#L705C1-L714C1 - // Package name cannot have leading . and cannot have percent-encoding or - // \\ separators. - // if (RegExpPrototypeExec(invalidPackageNameRegEx, packageName) !== null) - // validPackageName = false; - - // if (!validPackageName) { - // throw new ERR_INVALID_MODULE_SPECIFIER( - // specifier, 'is not a valid package name', fileURLToPath(base)); - // } - let package_subpath = - separator_index.map_or("", |separator_index| &specifier[separator_index..]); - (package_name, package_subpath) - } - - /// PATTERN_KEY_COMPARE(keyA, keyB) - fn pattern_key_compare(key_a: &str, key_b: &str) -> Ordering { - if key_a.is_empty() { - return Ordering::Greater; - } - // 1. Assert: keyA ends with "/" or contains only a single "*". - debug_assert!(key_a.ends_with('/') || key_a.match_indices('*').count() == 1, "{key_a}"); - // 2. Assert: keyB ends with "/" or contains only a single "*". - debug_assert!(key_b.ends_with('/') || key_b.match_indices('*').count() == 1, "{key_b}"); - // 3. Let baseLengthA be the index of "*" in keyA plus one, if keyA contains "*", or the length of keyA otherwise. - let a_pos = key_a.chars().position(|c| c == '*'); - let base_length_a = a_pos.map_or(key_a.len(), |p| p + 1); - // 4. Let baseLengthB be the index of "*" in keyB plus one, if keyB contains "*", or the length of keyB otherwise. - let b_pos = key_b.chars().position(|c| c == '*'); - let base_length_b = b_pos.map_or(key_b.len(), |p| p + 1); - // 5. If baseLengthA is greater than baseLengthB, return -1. - if base_length_a > base_length_b { - return Ordering::Less; - } - // 6. If baseLengthB is greater than baseLengthA, return 1. - if base_length_b > base_length_a { - return Ordering::Greater; - } - // 7. If keyA does not contain "*", return 1. - if !key_a.contains('*') { - return Ordering::Greater; - } - // 8. If keyB does not contain "*", return -1. - if !key_b.contains('*') { - return Ordering::Less; - } - // 9. If the length of keyA is greater than the length of keyB, return -1. - if key_a.len() > key_b.len() { - return Ordering::Less; - } - // 10. If the length of keyB is greater than the length of keyA, return 1. - if key_b.len() > key_a.len() { - return Ordering::Greater; - } - // 11. Return 0. - Ordering::Equal - } - - fn strip_package_name<'a>(specifier: &'a str, package_name: &'a str) -> Option<&'a str> { - specifier - .strip_prefix(package_name) - .filter(|tail| tail.is_empty() || tail.starts_with(SLASH_START)) - } -} diff --git a/src/options.rs b/src/options.rs deleted file mode 100644 index f473a133..00000000 --- a/src/options.rs +++ /dev/null @@ -1,623 +0,0 @@ -use std::path::Path; -use std::{fmt, path::PathBuf}; - -/// Module Resolution Options -/// -/// Options are directly ported from [enhanced-resolve](https://github.com/webpack/enhanced-resolve#resolver-options). -/// -/// See [webpack resolve](https://webpack.js.org/configuration/resolve/) for information and examples -#[derive(Debug, Clone)] -pub struct ResolveOptions { - /// Path to TypeScript configuration file. - /// - /// Default `None` - pub tsconfig: Option, - - /// Create aliases to import or require certain modules more easily. - /// - /// An alias is used to replace a whole path or part of a path. - /// For example, to alias a commonly used `src/` folders: `vec![("@/src"), vec![AliasValue::Path("/path/to/src")]]` - /// - /// A trailing $ can also be added to the given object's keys to signify an exact match. - /// - /// See [webpack's `resolve.alias` documentation](https://webpack.js.org/configuration/resolve/#resolvealias) for a list of use cases. - pub alias: Alias, - - /// A list of alias fields in description files. - /// - /// Specify a field, such as `browser`, to be parsed according to [this specification](https://github.com/defunctzombie/package-browser-field-spec). - /// Can be a path to json object such as `["path", "to", "exports"]`. - /// - /// Default `[]` - pub alias_fields: Vec>, - - /// Condition names for exports field which defines entry points of a package. - /// - /// The key order in the exports field is significant. During condition matching, earlier entries have higher priority and take precedence over later entries. - /// - /// Default `[]` - pub condition_names: Vec, - - /// The JSON files to use for descriptions. (There was once a `bower.json`.) - /// - /// Default `["package.json"]` - pub description_files: Vec, - - /// Set to [EnforceExtension::Enabled] for [ESM Mandatory file extensions](https://nodejs.org/api/esm.html#mandatory-file-extensions). - /// - /// If `enforce_extension` is set to [EnforceExtension::Enabled], resolution will not allow extension-less files. - /// This means `require('./foo.js')` will resolve, while `require('./foo')` will not. - /// - /// The default value for `enforce_extension` is [EnforceExtension::Auto], which is changed upon initialization. - /// - /// It changes to [EnforceExtension::Enabled] if [ResolveOptions::extensions] contains an empty string; - /// otherwise, this value changes to [EnforceExtension::Disabled]. - /// - /// Explicitly set the value to [EnforceExtension::Disabled] to disable this automatic behavior. - /// - /// For reference, this behavior is aligned with `enhanced-resolve`. See . - pub enforce_extension: EnforceExtension, - - /// A list of exports fields in description files. - /// - /// Can be a path to a JSON object such as `["path", "to", "exports"]`. - /// - /// Default `[["exports"]]`. - pub exports_fields: Vec>, - - /// Fields from `package.json` which are used to provide the internal requests of a package - /// (requests starting with # are considered internal). - /// - /// Can be a path to a JSON object such as `["path", "to", "imports"]`. - /// - /// Default `[["imports"]]`. - pub imports_fields: Vec>, - - /// An object which maps extension to extension aliases. - /// - /// Default `{}` - pub extension_alias: Vec<(String, Vec)>, - - /// Attempt to resolve these extensions in order. - /// - /// If multiple files share the same name but have different extensions, - /// will resolve the one with the extension listed first in the array and skip the rest. - /// - /// All extensions must have a leading dot. - /// - /// Default `[".js", ".json", ".node"]` - pub extensions: Vec, - - /// Redirect module requests when normal resolving fails. - /// - /// Default `[]` - pub fallback: Alias, - - /// 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). - /// - /// See also webpack configuration [resolve.fullySpecified](https://webpack.js.org/configuration/module/#resolvefullyspecified) - /// - /// Default `false` - pub fully_specified: bool, - - /// A list of main fields in description files - /// - /// Default `["main"]`. - pub main_fields: Vec, - - /// The filename to be used while resolving directories. - /// - /// Default `["index"]` - pub main_files: Vec, - - /// A list of directories to resolve modules from, can be absolute path or folder name. - /// - /// Default `["node_modules"]` - pub modules: Vec, - - /// Resolve to a context instead of a file. - /// - /// Default `false` - pub resolve_to_context: bool, - - /// Prefer to resolve module requests as relative requests instead of using modules from node_modules directories. - /// - /// Default `false` - pub prefer_relative: bool, - - /// Prefer to resolve server-relative urls as absolute paths before falling back to resolve in ResolveOptions::roots. - /// - /// Default `false` - pub prefer_absolute: bool, - - /// A list of resolve restrictions to restrict the paths that a request can be resolved on. - /// - /// Default `[]` - pub restrictions: Vec, - - /// A list of directories where requests of server-relative URLs (starting with '/') are resolved. - /// On non-Windows systems these requests are resolved as an absolute path first. - /// - /// Default `[]` - pub roots: Vec, - - /// Whether to resolve symlinks to their symlinked location. - /// When enabled, symlinked resources are resolved to their real path, not their symlinked location. - /// Note that this may cause module resolution to fail when using tools that symlink packages (like npm link). - /// - /// Default `true` - pub symlinks: bool, - - /// Whether to parse [module.builtinModules](https://nodejs.org/api/module.html#modulebuiltinmodules) or not. - /// For example, "zlib" will throw [crate::ResolveError::Builtin] when set to true. - /// - /// Default `false` - pub builtin_modules: bool, -} - -impl ResolveOptions { - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// - /// let options = ResolveOptions::default().with_condition_names(&["bar"]); - /// assert_eq!(options.condition_names, vec!["bar".to_string()]) - /// ``` - #[must_use] - pub fn with_condition_names(mut self, names: &[&str]) -> Self { - self.condition_names = names.iter().map(ToString::to_string).collect::>(); - self - } - - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// - /// let options = ResolveOptions::default().with_builtin_modules(false); - /// assert_eq!(options.builtin_modules, false) - /// ``` - #[must_use] - pub fn with_builtin_modules(mut self, flag: bool) -> Self { - self.builtin_modules = flag; - self - } - - /// Adds a single root to the options - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_root("foo"); - /// assert_eq!(options.roots, vec![PathBuf::from("foo")]) - /// ``` - #[must_use] - pub fn with_root>(mut self, root: P) -> Self { - self.roots.push(root.as_ref().to_path_buf()); - self - } - - /// Adds a single extension to the list of extensions - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_extension("jsonc"); - /// assert!(options.extensions.contains(&"jsonc".to_string())); - /// ``` - #[must_use] - pub fn with_extension>(mut self, extension: S) -> Self { - self.extensions.push(extension.into()); - self - } - - /// Adds a single main field to the list of fields - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_main_field("something"); - /// assert!(options.main_fields.contains(&"something".to_string())); - /// ``` - #[must_use] - pub fn with_main_field>(mut self, field: S) -> Self { - self.main_fields.push(field.into()); - self - } - - /// Changes how the extension should be treated - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions, EnforceExtension}; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_force_extension(EnforceExtension::Enabled); - /// assert_eq!(options.enforce_extension, EnforceExtension::Enabled); - /// ``` - #[must_use] - pub fn with_force_extension(mut self, enforce_extension: EnforceExtension) -> Self { - self.enforce_extension = enforce_extension; - self - } - - /// Sets the value for [ResolveOptions::fully_specified] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_fully_specified(true); - /// assert_eq!(options.fully_specified, true); - /// ``` - #[must_use] - pub fn with_fully_specified(mut self, fully_specified: bool) -> Self { - self.fully_specified = fully_specified; - self - } - /// Sets the value for [ResolveOptions::prefer_relative] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_prefer_relative(true); - /// assert_eq!(options.prefer_relative, true); - /// ``` - #[must_use] - pub fn with_prefer_relative(mut self, flag: bool) -> Self { - self.prefer_relative = flag; - self - } - /// Sets the value for [ResolveOptions::prefer_absolute] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_prefer_absolute(true); - /// assert_eq!(options.prefer_absolute, true); - /// ``` - #[must_use] - pub fn with_prefer_absolute(mut self, flag: bool) -> Self { - self.prefer_absolute = flag; - self - } - - /// Changes the value of [ResolveOptions::symlinks] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// - /// let options = ResolveOptions::default().with_symbolic_link(false); - /// assert_eq!(options.symlinks, false); - /// ``` - #[must_use] - pub fn with_symbolic_link(mut self, flag: bool) -> Self { - self.symlinks = flag; - self - } - - /// Adds a module to [ResolveOptions::modules] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// - /// let options = ResolveOptions::default().with_module("module"); - /// assert!(options.modules.contains(&"module".to_string())); - /// ``` - #[must_use] - pub fn with_module>(mut self, module: M) -> Self { - self.modules.push(module.into()); - self - } - - /// Adds a main file to [ResolveOptions::main_files] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// - /// let options = ResolveOptions::default().with_main_file("foo"); - /// assert!(options.main_files.contains(&"foo".to_string())); - /// ``` - #[must_use] - pub fn with_main_file>(mut self, module: M) -> Self { - self.main_files.push(module.into()); - self - } - - pub(crate) fn sanitize(mut self) -> Self { - debug_assert!( - self.extensions.iter().filter(|e| !e.is_empty()).all(|e| e.starts_with('.')), - "All extensions must start with a leading dot" - ); - // Set `enforceExtension` to `true` when [ResolveOptions::extensions] contains an empty string. - // See - if self.enforce_extension == EnforceExtension::Auto { - if !self.extensions.is_empty() && self.extensions.iter().any(String::is_empty) { - self.enforce_extension = EnforceExtension::Enabled; - } else { - self.enforce_extension = EnforceExtension::Disabled; - } - } - self - } -} - -/// Value for [ResolveOptions::enforce_extension] -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -pub enum EnforceExtension { - Auto, - Enabled, - Disabled, -} - -impl EnforceExtension { - pub const fn is_auto(&self) -> bool { - matches!(self, Self::Auto) - } - - pub const fn is_enabled(&self) -> bool { - matches!(self, Self::Enabled) - } - - pub const fn is_disabled(&self) -> bool { - matches!(self, Self::Disabled) - } -} - -/// Alias for [ResolveOptions::alias] and [ResolveOptions::fallback] -pub type Alias = Vec<(String, Vec)>; - -/// Alias Value for [ResolveOptions::alias] and [ResolveOptions::fallback] -#[derive(Debug, Clone, Hash, PartialEq, Eq)] -pub enum AliasValue { - /// The path value - Path(String), - - /// The `false` value - Ignore, -} - -impl From for AliasValue -where - S: Into, -{ - fn from(value: S) -> Self { - Self::Path(value.into()) - } -} - -/// Value for [ResolveOptions::restrictions] -#[derive(Debug, Clone)] -pub enum Restriction { - Path(PathBuf), - RegExp(String), -} - -/// Tsconfig Options for [ResolveOptions::tsconfig] -/// -/// Derived from [tsconfig-paths-webpack-plugin](https://github.com/dividab/tsconfig-paths-webpack-plugin#options) -#[derive(Debug, Clone)] -pub struct TsconfigOptions { - /// Allows you to specify where to find the TypeScript configuration file. - /// You may provide - /// * a relative path to the configuration file. It will be resolved relative to cwd. - /// * an absolute path to the configuration file. - pub config_file: PathBuf, - - /// Support for Typescript Project References. - pub references: TsconfigReferences, -} - -/// Configuration for [TsconfigOptions::references] -#[derive(Debug, Clone)] -pub enum TsconfigReferences { - Disabled, - /// Use the `references` field from tsconfig of `config_file`. - Auto, - /// Manually provided relative or absolute path. - Paths(Vec), -} - -impl Default for ResolveOptions { - fn default() -> Self { - Self { - tsconfig: None, - alias: vec![], - alias_fields: vec![], - condition_names: vec![], - description_files: vec!["package.json".into()], - enforce_extension: EnforceExtension::Auto, - extension_alias: vec![], - exports_fields: vec![vec!["exports".into()]], - imports_fields: vec![vec!["imports".into()]], - extensions: vec![".js".into(), ".json".into(), ".node".into()], - fallback: vec![], - fully_specified: false, - main_fields: vec!["main".into()], - main_files: vec!["index".into()], - modules: vec!["node_modules".into()], - resolve_to_context: false, - prefer_relative: false, - prefer_absolute: false, - restrictions: vec![], - roots: vec![], - symlinks: true, - builtin_modules: false, - } - } -} - -// For tracing -impl fmt::Display for ResolveOptions { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - if let Some(tsconfig) = &self.tsconfig { - write!(f, "tsconfig:{tsconfig:?},")?; - } - if !self.alias.is_empty() { - write!(f, "alias:{:?},", self.alias)?; - } - if !self.alias_fields.is_empty() { - write!(f, "alias_fields:{:?},", self.alias_fields)?; - } - if !self.condition_names.is_empty() { - write!(f, "condition_names:{:?},", self.condition_names)?; - } - if self.enforce_extension.is_enabled() { - write!(f, "enforce_extension:{:?},", self.enforce_extension)?; - } - if !self.exports_fields.is_empty() { - write!(f, "exports_fields:{:?},", self.exports_fields)?; - } - if !self.imports_fields.is_empty() { - write!(f, "imports_fields:{:?},", self.imports_fields)?; - } - if !self.extension_alias.is_empty() { - write!(f, "extension_alias:{:?},", self.extension_alias)?; - } - if !self.extensions.is_empty() { - write!(f, "extensions:{:?},", self.extensions)?; - } - if !self.fallback.is_empty() { - write!(f, "fallback:{:?},", self.fallback)?; - } - if self.fully_specified { - write!(f, "fully_specified:{:?},", self.fully_specified)?; - } - if !self.main_fields.is_empty() { - write!(f, "main_fields:{:?},", self.main_fields)?; - } - if !self.main_files.is_empty() { - write!(f, "main_files:{:?},", self.main_files)?; - } - if !self.modules.is_empty() { - write!(f, "modules:{:?},", self.modules)?; - } - if self.resolve_to_context { - write!(f, "resolve_to_context:{:?},", self.resolve_to_context)?; - } - if self.prefer_relative { - write!(f, "prefer_relative:{:?},", self.prefer_relative)?; - } - if self.prefer_absolute { - write!(f, "prefer_absolute:{:?},", self.prefer_absolute)?; - } - if !self.restrictions.is_empty() { - write!(f, "restrictions:{:?},", self.restrictions)?; - } - if !self.roots.is_empty() { - write!(f, "roots:{:?},", self.roots)?; - } - if self.symlinks { - write!(f, "symlinks:{:?},", self.symlinks)?; - } - if self.builtin_modules { - write!(f, "builtin_modules:{:?},", self.builtin_modules)?; - } - Ok(()) - } -} - -#[cfg(test)] -mod test { - use super::{ - AliasValue, EnforceExtension, ResolveOptions, Restriction, TsconfigOptions, - TsconfigReferences, - }; - use std::path::PathBuf; - - #[test] - fn enforce_extension() { - assert!(EnforceExtension::Auto.is_auto()); - assert!(!EnforceExtension::Enabled.is_auto()); - assert!(!EnforceExtension::Disabled.is_auto()); - - assert!(!EnforceExtension::Auto.is_enabled()); - assert!(EnforceExtension::Enabled.is_enabled()); - assert!(!EnforceExtension::Disabled.is_enabled()); - - assert!(!EnforceExtension::Auto.is_disabled()); - assert!(!EnforceExtension::Enabled.is_disabled()); - assert!(EnforceExtension::Disabled.is_disabled()); - } - - #[test] - fn display() { - let options = ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: PathBuf::from("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - alias: vec![("a".into(), vec![AliasValue::Ignore])], - alias_fields: vec![vec!["browser".into()]], - condition_names: vec!["require".into()], - enforce_extension: EnforceExtension::Enabled, - extension_alias: vec![(".js".into(), vec![".ts".into()])], - exports_fields: vec![vec!["exports".into()]], - imports_fields: vec![vec!["imports".into()]], - fallback: vec![("fallback".into(), vec![AliasValue::Ignore])], - fully_specified: true, - resolve_to_context: true, - prefer_relative: true, - prefer_absolute: true, - restrictions: vec![Restriction::Path(PathBuf::from("restrictions"))], - roots: vec![PathBuf::from("roots")], - builtin_modules: true, - ..ResolveOptions::default() - }; - - let expected = r#"tsconfig:TsconfigOptions { config_file: "tsconfig.json", references: Auto },alias:[("a", [Ignore])],alias_fields:[["browser"]],condition_names:["require"],enforce_extension:Enabled,exports_fields:[["exports"]],imports_fields:[["imports"]],extension_alias:[(".js", [".ts"])],extensions:[".js", ".json", ".node"],fallback:[("fallback", [Ignore])],fully_specified:true,main_fields:["main"],main_files:["index"],modules:["node_modules"],resolve_to_context:true,prefer_relative:true,prefer_absolute:true,restrictions:[Path("restrictions")],roots:["roots"],symlinks:true,builtin_modules:true,"#; - assert_eq!(format!("{options}"), expected); - - let options = ResolveOptions { - alias: vec![], - alias_fields: vec![], - builtin_modules: false, - condition_names: vec![], - description_files: vec![], - enforce_extension: EnforceExtension::Disabled, - exports_fields: vec![], - extension_alias: vec![], - extensions: vec![], - fallback: vec![], - fully_specified: false, - imports_fields: vec![], - main_fields: vec![], - main_files: vec![], - modules: vec![], - prefer_absolute: false, - prefer_relative: false, - resolve_to_context: false, - restrictions: vec![], - roots: vec![], - symlinks: false, - tsconfig: None, - }; - - assert_eq!(format!("{options}"), ""); - } -} diff --git a/src/package_json.rs b/src/package_json.rs deleted file mode 100644 index 73901faa..00000000 --- a/src/package_json.rs +++ /dev/null @@ -1,207 +0,0 @@ -//! package.json definitions -//! -//! Code related to export field are copied from [Parcel's resolver](https://github.com/parcel-bundler/parcel/blob/v2/packages/utils/node-resolver-rs/src/package_json.rs) -use std::path::{Path, PathBuf}; - -use serde_json::Value as JSONValue; - -use crate::{path::PathUtil, ResolveError}; - -pub type JSONMap = serde_json::Map; - -/// Deserialized package.json -#[derive(Debug, Default)] -pub struct PackageJson { - /// Path to `package.json`. Contains the `package.json` filename. - pub path: PathBuf, - - /// Realpath to `package.json`. Contains the `package.json` filename. - pub realpath: PathBuf, - - /// The "name" field defines your package's name. - /// The "name" field can be used in addition to the "exports" field to self-reference a package using its name. - /// - /// - pub name: Option, - - raw_json: std::sync::Arc, -} - -impl PackageJson { - /// # Panics - /// # Errors - pub(crate) fn parse( - path: PathBuf, - realpath: PathBuf, - json: &str, - ) -> Result { - let mut raw_json: JSONValue = serde_json::from_str(json)?; - let mut package_json = Self::default(); - - if let Some(json_object) = raw_json.as_object_mut() { - // Remove large fields that are useless for pragmatic use. - #[cfg(feature = "package_json_raw_json_api")] - { - json_object.remove("description"); - json_object.remove("keywords"); - json_object.remove("scripts"); - json_object.remove("dependencies"); - json_object.remove("devDependencies"); - json_object.remove("peerDependencies"); - json_object.remove("optionalDependencies"); - } - - // Add name. - package_json.name = - json_object.get("name").and_then(|field| field.as_str()).map(ToString::to_string); - } - - package_json.path = path; - package_json.realpath = realpath; - package_json.raw_json = std::sync::Arc::new(raw_json); - Ok(package_json) - } - - fn get_value_by_path<'a>( - fields: &'a serde_json::Map, - path: &[String], - ) -> Option<&'a JSONValue> { - if path.is_empty() { - return None; - } - let mut value = fields.get(&path[0])?; - for key in path.iter().skip(1) { - if let Some(inner_value) = value.as_object().and_then(|o| o.get(key)) { - value = inner_value; - } else { - return None; - } - } - Some(value) - } - - /// Raw serde json value of `package.json`. - /// - /// This is currently used in Rspack for: - /// * getting the `sideEffects` field - /// * query in - search on GitHub indicates query on the `type` field. - /// - /// To reduce overall memory consumption, large fields that useless for pragmatic use are removed. - /// They are: `description`, `keywords`, `scripts`, - /// `dependencies` and `devDependencies`, `peerDependencies`, `optionalDependencies`. - #[cfg(feature = "package_json_raw_json_api")] - pub fn raw_json(&self) -> &std::sync::Arc { - &self.raw_json - } - - /// Directory to `package.json` - /// - /// # Panics - /// - /// * When the package.json path is misconfigured. - pub fn directory(&self) -> &Path { - debug_assert!(self.realpath.file_name().is_some_and(|x| x == "package.json")); - self.realpath.parent().unwrap() - } - - /// The "main" field defines the entry point of a package when imported by name via a node_modules lookup. Its value is a path. - /// - /// When a package has an "exports" field, this will take precedence over the "main" field when importing the package by name. - /// - /// Values are dynamically retrieved from [ResolveOptions::main_fields]. - /// - /// - pub(crate) fn main_fields<'a>( - &'a self, - main_fields: &'a [String], - ) -> impl Iterator + '_ { - main_fields - .iter() - .filter_map(|main_field| self.raw_json.get(main_field)) - .filter_map(|value| value.as_str()) - } - - /// The "exports" field allows defining the entry points of a package when imported by name loaded either via a node_modules lookup or a self-reference to its own name. - /// - /// - pub(crate) fn exports_fields<'a>( - &'a self, - exports_fields: &'a [Vec], - ) -> impl Iterator + '_ { - exports_fields.iter().filter_map(|object_path| { - self.raw_json - .as_object() - .and_then(|json_object| Self::get_value_by_path(json_object, object_path)) - }) - } - - /// In addition to the "exports" field, there is a package "imports" field to create private mappings that only apply to import specifiers from within the package itself. - /// - /// - pub(crate) fn imports_fields<'a>( - &'a self, - imports_fields: &'a [Vec], - ) -> impl Iterator + '_ { - imports_fields.iter().filter_map(|object_path| { - self.raw_json - .as_object() - .and_then(|json_object| Self::get_value_by_path(json_object, object_path)) - .and_then(|value| value.as_object()) - }) - } - - /// The "browser" field is provided by a module author as a hint to javascript bundlers or component tools when packaging modules for client side use. - /// Multiple values are configured by [ResolveOptions::alias_fields]. - /// - /// - fn browser_fields<'a>( - &'a self, - alias_fields: &'a [Vec], - ) -> impl Iterator + '_ { - alias_fields.iter().filter_map(|object_path| { - self.raw_json - .as_object() - .and_then(|json_object| Self::get_value_by_path(json_object, object_path)) - // Only object is valid, all other types are invalid - // https://github.com/webpack/enhanced-resolve/blob/3a28f47788de794d9da4d1702a3a583d8422cd48/lib/AliasFieldPlugin.js#L44-L52 - .and_then(|value| value.as_object()) - }) - } - - /// Resolve the request string for this package.json by looking at the `browser` field. - /// - /// # Errors - /// - /// * Returns [ResolveError::Ignored] for `"path": false` in `browser` field. - pub(crate) fn resolve_browser_field<'a>( - &'a self, - path: &Path, - request: Option<&str>, - alias_fields: &'a [Vec], - ) -> Result, ResolveError> { - for object in self.browser_fields(alias_fields) { - if let Some(request) = request { - if let Some(value) = object.get(request) { - return Self::alias_value(path, value); - } - } else { - let dir = self.path.parent().unwrap(); - for (key, value) in object { - let joined = dir.normalize_with(key); - if joined == path { - return Self::alias_value(path, value); - } - } - } - } - Ok(None) - } - - fn alias_value<'a>(key: &Path, value: &'a JSONValue) -> Result, ResolveError> { - match value { - JSONValue::String(value) => Ok(Some(value.as_str())), - JSONValue::Bool(b) if !b => Err(ResolveError::Ignored(key.to_path_buf())), - _ => Ok(None), - } - } -} diff --git a/src/path.rs b/src/path.rs deleted file mode 100644 index f66fdd76..00000000 --- a/src/path.rs +++ /dev/null @@ -1,132 +0,0 @@ -//! Path Utilities -//! -//! Code adapted from the following libraries -//! * [path-absolutize](https://docs.rs/path-absolutize) -//! * [normalize_path](https://docs.rs/normalize-path) -use std::path::{Component, Path, PathBuf}; - -pub const SLASH_START: &[char; 2] = &['/', '\\']; - -/// Extension trait to add path normalization to std's [`Path`]. -pub trait PathUtil { - /// Normalize this path without performing I/O. - /// - /// All redundant separator and up-level references are collapsed. - /// - /// However, this does not resolve links. - fn normalize(&self) -> PathBuf; - - /// Normalize with subpath assuming this path is normalized without performing I/O. - /// - /// All redundant separator and up-level references are collapsed. - /// - /// However, this does not resolve links. - fn normalize_with>(&self, subpath: P) -> PathBuf; - - /// Defined in ESM PACKAGE_TARGET_RESOLVE - /// If target split on "/" or "\" contains any "", ".", "..", or "node_modules" segments after the first "." segment, case insensitive and including percent encoded variants - fn is_invalid_exports_target(&self) -> bool; -} - -impl PathUtil for Path { - // https://github.com/parcel-bundler/parcel/blob/e0b99c2a42e9109a9ecbd6f537844a1b33e7faf5/packages/utils/node-resolver-rs/src/path.rs#L7 - fn normalize(&self) -> PathBuf { - let mut components = self.components().peekable(); - let mut ret = if let Some(c @ Component::Prefix(..)) = components.peek() { - let buf = PathBuf::from(c.as_os_str()); - components.next(); - buf - } else { - PathBuf::new() - }; - - for component in components { - match component { - Component::Prefix(..) => unreachable!("Path {:?}", self), - Component::RootDir => { - ret.push(component.as_os_str()); - } - Component::CurDir => {} - Component::ParentDir => { - ret.pop(); - } - Component::Normal(c) => { - ret.push(c); - } - } - } - - ret - } - - // https://github.com/parcel-bundler/parcel/blob/e0b99c2a42e9109a9ecbd6f537844a1b33e7faf5/packages/utils/node-resolver-rs/src/path.rs#L37 - fn normalize_with>(&self, subpath: B) -> PathBuf { - let subpath = subpath.as_ref(); - - let mut components = subpath.components(); - - let Some(head) = components.next() else { return subpath.to_path_buf() }; - - if matches!(head, Component::Prefix(..) | Component::RootDir) { - return subpath.to_path_buf(); - } - - let mut ret = self.to_path_buf(); - for component in std::iter::once(head).chain(components) { - match component { - Component::CurDir => {} - Component::ParentDir => { - ret.pop(); - } - Component::Normal(c) => { - ret.push(c); - } - Component::Prefix(..) | Component::RootDir => { - unreachable!("Path {:?} Subpath {:?}", self, subpath) - } - } - } - - ret - } - - fn is_invalid_exports_target(&self) -> bool { - self.components().enumerate().any(|(index, c)| match c { - Component::ParentDir => true, - Component::CurDir => index > 0, - Component::Normal(c) => c.eq_ignore_ascii_case("node_modules"), - _ => false, - }) - } -} - -// https://github.com/webpack/enhanced-resolve/blob/main/test/path.test.js -#[test] -fn is_invalid_exports_target() { - let test_cases = [ - "../a.js", - "../", - "./a/b/../../../c.js", - "./a/b/../../../", - "./../../c.js", - "./../../", - "./a/../b/../../c.js", - "./a/../b/../../", - "./././../", - ]; - - for case in test_cases { - assert!(Path::new(case).is_invalid_exports_target(), "{case}"); - } - - assert!(!Path::new("C:").is_invalid_exports_target()); - assert!(!Path::new("/").is_invalid_exports_target()); -} - -#[test] -fn normalize() { - assert_eq!(Path::new("/foo/.././foo/").normalize(), Path::new("/foo")); - assert_eq!(Path::new("C://").normalize(), Path::new("C://")); - assert_eq!(Path::new("C:").normalize(), Path::new("C:")); - assert_eq!(Path::new(r"\\server\share").normalize(), Path::new(r"\\server\share")); -} diff --git a/src/resolution.rs b/src/resolution.rs deleted file mode 100644 index a3aaa2e7..00000000 --- a/src/resolution.rs +++ /dev/null @@ -1,92 +0,0 @@ -use crate::package_json::PackageJson; -use std::{ - fmt, - path::{Path, PathBuf}, - sync::Arc, -}; - -/// The final path resolution with optional `?query` and `#fragment` -#[derive(Clone)] -pub struct Resolution { - pub(crate) path: PathBuf, - - /// path query `?query`, contains `?`. - pub(crate) query: Option, - - /// path fragment `#query`, contains `#`. - pub(crate) fragment: Option, - - pub(crate) package_json: Option>, -} - -impl fmt::Debug for Resolution { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - f.debug_struct("Resolution") - .field("path", &self.path) - .field("query", &self.query) - .field("fragment", &self.fragment) - .field("package_json", &self.package_json.as_ref().map(|p| &p.path)) - .finish() - } -} - -impl PartialEq for Resolution { - fn eq(&self, other: &Self) -> bool { - self.path == other.path && self.query == other.query && self.fragment == other.fragment - } -} -impl Eq for Resolution {} - -impl Resolution { - /// Returns the path without query and fragment - pub fn path(&self) -> &Path { - &self.path - } - - /// Returns the path without query and fragment - pub fn into_path_buf(self) -> PathBuf { - self.path - } - - /// Returns the path query `?query`, contains the leading `?` - pub fn query(&self) -> Option<&str> { - self.query.as_deref() - } - - /// Returns the path fragment `#fragment`, contains the leading `#` - pub fn fragment(&self) -> Option<&str> { - self.fragment.as_deref() - } - - /// Returns serialized package_json - pub fn package_json(&self) -> Option<&Arc> { - self.package_json.as_ref() - } - - /// Returns the full path with query and fragment - pub fn full_path(&self) -> PathBuf { - let mut path = self.path.clone().into_os_string(); - if let Some(query) = &self.query { - path.push(query); - } - if let Some(fragment) = &self.fragment { - path.push(fragment); - } - PathBuf::from(path) - } -} - -#[test] -fn test() { - let resolution = Resolution { - path: PathBuf::from("foo"), - query: Some("?query".to_string()), - fragment: Some("#fragment".to_string()), - package_json: None, - }; - assert_eq!(resolution.path(), Path::new("foo")); - assert_eq!(resolution.query(), Some("?query")); - assert_eq!(resolution.fragment(), Some("#fragment")); - assert_eq!(resolution.full_path(), PathBuf::from("foo?query#fragment")); - assert_eq!(resolution.into_path_buf(), PathBuf::from("foo")); -} diff --git a/src/specifier.rs b/src/specifier.rs deleted file mode 100644 index 3d35eafc..00000000 --- a/src/specifier.rs +++ /dev/null @@ -1,230 +0,0 @@ -use crate::error::SpecifierError; -use std::borrow::Cow; - -#[derive(Debug)] -pub struct Specifier<'a> { - path: Cow<'a, str>, - pub query: Option<&'a str>, - pub fragment: Option<&'a str>, -} - -impl<'a> Specifier<'a> { - pub fn path(&'a self) -> &'a str { - self.path.as_ref() - } - - pub fn parse(specifier: &'a str) -> Result, SpecifierError> { - if specifier.is_empty() { - return Err(SpecifierError::Empty(specifier.to_string())); - } - let offset = match specifier.as_bytes()[0] { - b'/' | b'.' | b'#' => 1, - _ => 0, - }; - let (path, query, fragment) = Self::parse_query_framgment(specifier, offset); - if path.is_empty() { - return Err(SpecifierError::Empty(specifier.to_string())); - } - Ok(Self { path, query, fragment }) - } - - fn parse_query_framgment( - specifier: &'a str, - skip: usize, - ) -> (Cow<'a, str>, Option<&str>, Option<&str>) { - let mut query_start: Option = None; - let mut fragment_start: Option = None; - - let mut prev = specifier.chars().next().unwrap(); - let mut escaped_indexes = vec![]; - for (i, c) in specifier.char_indices().skip(skip) { - if c == '?' && query_start.is_none() { - query_start = Some(i); - } - if c == '#' { - if prev == '\0' { - escaped_indexes.push(i - 1); - } else { - fragment_start = Some(i); - break; - } - } - prev = c; - } - - let (path, query, fragment) = match (query_start, fragment_start) { - (Some(i), Some(j)) => { - debug_assert!(i < j); - (&specifier[..i], Some(&specifier[i..j]), Some(&specifier[j..])) - } - (Some(i), None) => (&specifier[..i], Some(&specifier[i..]), None), - (None, Some(j)) => (&specifier[..j], None, Some(&specifier[j..])), - _ => (specifier, None, None), - }; - - let path = if escaped_indexes.is_empty() { - Cow::Borrowed(path) - } else { - // Remove the `\0` characters for a legal path. - Cow::Owned( - path.chars() - .enumerate() - .filter_map(|(i, c)| (!escaped_indexes.contains(&i)).then_some(c)) - .collect::(), - ) - }; - - (path, query, fragment) - } -} - -#[cfg(test)] -mod tests { - use super::{Specifier, SpecifierError}; - - #[test] - fn debug() { - let specifier = Specifier::parse("/").unwrap(); - assert_eq!( - format!("{specifier:?}"), - r#"Specifier { path: "/", query: None, fragment: None }"# - ); - } - - #[test] - fn empty() { - let specifiers = ["", "?"]; - for specifier in specifiers { - let error = Specifier::parse(specifier).unwrap_err(); - assert_eq!(error, SpecifierError::Empty(specifier.to_string())); - } - } - - #[test] - fn absolute() -> Result<(), SpecifierError> { - let specifier = "/test?#"; - let parsed = Specifier::parse(specifier)?; - assert_eq!(parsed.path, "/test"); - assert_eq!(parsed.query, Some("?")); - assert_eq!(parsed.fragment, Some("#")); - Ok(()) - } - - #[test] - fn relative() -> Result<(), SpecifierError> { - let specifiers = ["./test", "../test", "../../test"]; - for specifier in specifiers { - let mut r = specifier.to_string(); - r.push_str("?#"); - let parsed = Specifier::parse(&r)?; - assert_eq!(parsed.path, specifier); - assert_eq!(parsed.query, Some("?")); - assert_eq!(parsed.fragment, Some("#")); - } - Ok(()) - } - - #[test] - fn hash() -> Result<(), SpecifierError> { - let specifiers = ["#", "#path"]; - for specifier in specifiers { - let mut r = specifier.to_string(); - r.push_str("?#"); - let parsed = Specifier::parse(&r)?; - assert_eq!(parsed.path, specifier); - assert_eq!(parsed.query, Some("?")); - assert_eq!(parsed.fragment, Some("#")); - } - Ok(()) - } - - #[test] - fn module() -> Result<(), SpecifierError> { - let specifiers = ["module"]; - for specifier in specifiers { - let mut r = specifier.to_string(); - r.push_str("?#"); - let parsed = Specifier::parse(&r)?; - assert_eq!(parsed.path, specifier); - assert_eq!(parsed.query, Some("?")); - assert_eq!(parsed.fragment, Some("#")); - } - Ok(()) - } - - #[test] - fn query_fragment() -> Result<(), SpecifierError> { - let data = [ - ("a?", Some("?"), None), - ("a?query", Some("?query"), None), - ("a?query1?query2", Some("?query1?query2"), None), - ("a?query1?query2?query3", Some("?query1?query2?query3"), None), - ("a#", None, Some("#")), - ("a#b#c", None, Some("#b#c")), - ("a#fragment", None, Some("#fragment")), - ("a?#", Some("?"), Some("#")), - ("a?#fragment", Some("?"), Some("#fragment")), - ("a?query#", Some("?query"), Some("#")), - ("a?query#fragment", Some("?query"), Some("#fragment")), - ("a#fragment?", None, Some("#fragment?")), - ("a#fragment?query", None, Some("#fragment?query")), - ]; - - for (specifier_str, query, fragment) in data { - let specifier = Specifier::parse(specifier_str)?; - assert_eq!(specifier.path, "a", "{specifier_str}"); - assert_eq!(specifier.query, query, "{specifier_str}"); - assert_eq!(specifier.fragment, fragment, "{specifier_str}"); - } - - Ok(()) - } - - #[test] - // https://github.com/webpack/enhanced-resolve/blob/main/test/identifier.test.js - fn enhanced_resolve_edge_cases() -> Result<(), SpecifierError> { - let data = [ - ("path/#", "path/", "", "#"), - ("path/as/?", "path/as/", "?", ""), - ("path/#/?", "path/", "", "#/?"), - ("path/#repo#hash", "path/", "", "#repo#hash"), - ("path/#r#hash", "path/", "", "#r#hash"), - ("path/#repo/#repo2#hash", "path/", "", "#repo/#repo2#hash"), - ("path/#r/#r#hash", "path/", "", "#r/#r#hash"), - ("path/#/not/a/hash?not-a-query", "path/", "", "#/not/a/hash?not-a-query"), - ]; - - for (specifier_str, path, query, fragment) in data { - let specifier = Specifier::parse(specifier_str)?; - assert_eq!(specifier.path, path, "{specifier_str}"); - assert_eq!(specifier.query.unwrap_or(""), query, "{specifier_str}"); - assert_eq!(specifier.fragment.unwrap_or(""), fragment, "{specifier_str}"); - } - - Ok(()) - } - - // https://github.com/webpack/enhanced-resolve/blob/main/test/identifier.test.js - #[test] - fn enhanced_resolve_windows_like() -> Result<(), SpecifierError> { - let data = [ - ("path\\#", "path\\", "", "#"), - ("path\\as\\?", "path\\as\\", "?", ""), - ("path\\#\\?", "path\\", "", "#\\?"), - ("path\\#repo#hash", "path\\", "", "#repo#hash"), - ("path\\#r#hash", "path\\", "", "#r#hash"), - ("path\\#repo\\#repo2#hash", "path\\", "", "#repo\\#repo2#hash"), - ("path\\#r\\#r#hash", "path\\", "", "#r\\#r#hash"), - ("path\\#/not/a/hash?not-a-query", "path\\", "", "#/not/a/hash?not-a-query"), - ]; - - for (specifier_str, path, query, fragment) in data { - let specifier = Specifier::parse(specifier_str)?; - assert_eq!(specifier.path, path, "{specifier_str}"); - assert_eq!(specifier.query.unwrap_or(""), query, "{specifier_str}"); - assert_eq!(specifier.fragment.unwrap_or(""), fragment, "{specifier_str}"); - } - - Ok(()) - } -} diff --git a/src/tests/alias.rs b/src/tests/alias.rs deleted file mode 100644 index d4d7fe2b..00000000 --- a/src/tests/alias.rs +++ /dev/null @@ -1,266 +0,0 @@ -//! - -use normalize_path::NormalizePath; -use std::path::Path; - -use crate::{AliasValue, Resolution, ResolveContext, ResolveError, ResolveOptions, Resolver}; - -#[test] -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -fn alias() { - use super::memory_fs::MemoryFS; - use crate::ResolverGeneric; - use std::path::{Path, PathBuf}; - - let f = Path::new("/"); - - let file_system = MemoryFS::new(&[ - ("/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", ""), - ("/dashed-name", ""), - ]); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - alias: vec![ - ("aliasA".into(), vec![AliasValue::from("a")]), - ("b$".into(), vec![AliasValue::from("a/index")]), - ("c$".into(), vec![AliasValue::from("/a/index")]), - ( - "multiAlias".into(), - vec![ - AliasValue::from("b"), - AliasValue::from("c"), - AliasValue::from("d"), - AliasValue::from("e"), - AliasValue::from("a"), - ], - ), - ("recursive".into(), vec![AliasValue::from("recursive/dir")]), - ("/d/dir".into(), vec![AliasValue::from("/c/dir")]), - ("/d/index.js".into(), vec![AliasValue::from("/c/index")]), - ("#".into(), vec![AliasValue::from("/c/dir")]), - ("@".into(), vec![AliasValue::from("/c/dir")]), - ("ignored".into(), vec![AliasValue::Ignore]), - // not part of enhanced-resolve, added to make sure query in alias value works - ("alias_query".into(), vec![AliasValue::from("a?query_after")]), - ("alias_fragment".into(), vec![AliasValue::from("a#fragment_after")]), - ("dash".into(), vec![AliasValue::Ignore]), - ("@scope/package-name/file$".into(), vec![AliasValue::from("/c/dir")]), - ], - modules: vec!["/".into()], - ..ResolveOptions::default() - }, - ); - - #[rustfmt::skip] - let pass = [ - ("should resolve a not aliased module 1", "a", "/a/index"), - ("should resolve a not aliased module 2", "a/index", "/a/index"), - ("should resolve a not aliased module 3", "a/dir", "/a/dir/index"), - ("should resolve a not aliased module 4", "a/dir/index", "/a/dir/index"), - ("should resolve an aliased module 1", "aliasA", "/a/index"), - ("should resolve an aliased module 2", "aliasA/index", "/a/index"), - ("should resolve an aliased module 3", "aliasA/dir", "/a/dir/index"), - ("should resolve an aliased module 4", "aliasA/dir/index", "/a/dir/index"), - ("should resolve '#' alias 1", "#", "/c/dir/index"), - ("should resolve '#' alias 2", "#/index", "/c/dir/index"), - ("should resolve '@' alias 1", "@", "/c/dir/index"), - ("should resolve '@' alias 2", "@/index", "/c/dir/index"), - ("should resolve a recursive aliased module 1", "recursive", "/recursive/dir/index"), - ("should resolve a recursive aliased module 2", "recursive/index", "/recursive/dir/index"), - ("should resolve a recursive aliased module 3", "recursive/dir", "/recursive/dir/index"), - ("should resolve a recursive aliased module 4", "recursive/dir/index", "/recursive/dir/index"), - ("should resolve a file aliased module 1", "b", "/a/index"), - ("should resolve a file aliased module 2", "c", "/a/index"), - ("should resolve a file aliased module with a query 1", "b?query", "/a/index?query"), - ("should resolve a file aliased module with a query 2", "c?query", "/a/index?query"), - ("should resolve a path in a file aliased module 1", "b/index", "/b/index"), - ("should resolve a path in a file aliased module 2", "b/dir", "/b/dir/index"), - ("should resolve a path in a file aliased module 3", "b/dir/index", "/b/dir/index"), - ("should resolve a path in a file aliased module 4", "c/index", "/c/index"), - ("should resolve a path in a file aliased module 5", "c/dir", "/c/dir/index"), - ("should resolve a path in a file aliased module 6", "c/dir/index", "/c/dir/index"), - ("should resolve a file aliased file 1", "d", "/c/index"), - ("should resolve a file aliased file 2", "d/dir/index", "/c/dir/index"), - ("should resolve a file in multiple aliased dirs 1", "multiAlias/dir/file", "/e/dir/file"), - ("should resolve a file in multiple aliased dirs 2", "multiAlias/anotherDir", "/e/anotherDir/index"), - // not part of enhanced-resolve, added to make sure query in alias value works - ("should resolve query in alias value", "alias_query?query_before", "/a/index?query_after"), - ("should resolve query in alias value", "alias_fragment#fragment_before", "/a/index#fragment_after"), - ("should resolve dashed name", "dashed-name", "/dashed-name"), - ("should resolve scoped package name with sub dir", "@scope/package-name/file", "/c/dir/index"), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - - #[rustfmt::skip] - let ignore = [ - ("should resolve an ignore module", "ignored", ResolveError::Ignored(f.join("ignored"))) - ]; - - for (comment, request, expected) in ignore { - let resolution = resolver.resolve(f, request); - assert_eq!(resolution, Err(expected), "{comment} {request}"); - } -} - -// Not part of enhanced-resolve -#[test] -fn infinite_recursion() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![ - ("./a".into(), vec![AliasValue::from("./b")]), - ("./b".into(), vec![AliasValue::from("./a")]), - ], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(f, "./a"); - assert_eq!(resolution, Err(ResolveError::Recursion)); -} - -fn check_slash(path: &Path) { - let s = path.to_string_lossy().to_string(); - #[cfg(target_os = "windows")] - { - assert!(!s.contains('/'), "{s}"); - assert!(s.contains('\\'), "{s}"); - } - #[cfg(not(target_os = "windows"))] - { - assert!(s.contains('/'), "{s}"); - assert!(!s.contains('\\'), "{s}"); - } -} - -#[test] -fn absolute_path() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![(f.join("foo").to_str().unwrap().to_string(), vec![AliasValue::Ignore])], - modules: vec![f.clone().to_str().unwrap().to_string()], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(&f, "foo/index"); - assert_eq!(resolution, Err(ResolveError::Ignored(f.join("foo")))); -} - -#[test] -fn system_path() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![("@app".into(), vec![AliasValue::from(f.join("alias").to_string_lossy())])], - ..ResolveOptions::default() - }); - - let specifiers = ["@app/files/a", "@app/files/a.js"]; - - for specifier in specifiers { - let path = resolver.resolve(&f, specifier).map(Resolution::into_path_buf).unwrap(); - assert_eq!(path, f.join("alias/files/a.js")); - check_slash(&path); - } -} - -#[test] -fn alias_is_full_path() { - let f = super::fixture(); - let dir = f.join("foo"); - let dir_str = dir.to_string_lossy().to_string(); - - let resolver = Resolver::new(ResolveOptions { - alias: vec![("@".into(), vec![AliasValue::Path(dir_str.clone())])], - ..ResolveOptions::default() - }); - - let mut ctx = ResolveContext::default(); - - let specifiers = [ - "@/index".to_string(), - "@/index.js".to_string(), - // specifier has multiple `/` for reasons we'll never know - "@////index".to_string(), - // specifier is a full path - dir_str, - ]; - - for specifier in specifiers { - let resolution = resolver.resolve_with_context(&f, &specifier, &mut ctx); - assert_eq!(resolution.map(|r| r.full_path()), Ok(dir.join("index.js"))); - } - - for path in ctx.file_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - check_slash(&path); - } - - for path in ctx.missing_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - check_slash(&path); - if let Some(path) = path.parent() { - assert!(!path.is_file(), "{path:?} must not be a file"); - } - } -} - -// For the `should_stop` variable in `load_alias` -#[test] -fn all_alias_values_are_not_found() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![( - "m1".to_string(), - vec![AliasValue::Path(f.join("node_modules").join("m2").to_string_lossy().to_string())], - )], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(&f, "m1/a.js"); - assert_eq!(resolution, Err(ResolveError::NotFound("m1/a.js".to_string()))); -} - -#[test] -fn alias_fragment() { - let f = super::fixture(); - - let data = [ - // enhanced-resolve has `#` prepended with a `\0`, they are removed from the - // following 3 expected test results. - // See https://github.com/webpack/enhanced-resolve#escaping - ( - "handle fragment edge case (no fragment)", - "./no#fragment/#/#", - f.join("no#fragment/#/#.js"), - ), - ("handle fragment edge case (fragment)", "./no#fragment/#/", f.join("no.js#fragment/#/")), - ( - "handle fragment escaping", - "./no\0#fragment/\0#/\0##fragment", - f.join("no#fragment/#/#.js#fragment"), - ), - ]; - - for (comment, request, expected) in data { - let resolver = Resolver::new(ResolveOptions { - alias: vec![("foo".to_string(), vec![AliasValue::Path(request.to_string())])], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f, "foo").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } -} diff --git a/src/tests/browser_field.rs b/src/tests/browser_field.rs deleted file mode 100644 index 39a1ed90..00000000 --- a/src/tests/browser_field.rs +++ /dev/null @@ -1,176 +0,0 @@ -//! - -use crate::{AliasValue, ResolveError, ResolveOptions, Resolver}; - -#[test] -fn ignore() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![ - vec!["browser".into()], - vec!["innerBrowser1".into()], - vec!["innerBrowser2".into()], - vec![], - ], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - (f.clone(), "./lib/ignore", f.join("lib/ignore.js")), - (f.clone(), "./lib/ignore.js", f.join("lib/ignore.js")), - (f.join("lib"), "./ignore", f.join("lib/ignore.js")), - (f.join("lib"), "./ignore.js", f.join("lib/ignore.js")), - ]; - - for (path, request, expected) in data { - let resolution = resolver.resolve(&path, request); - let expected = ResolveError::Ignored(expected); - assert_eq!(resolution, Err(expected), "{path:?} {request}"); - } -} - -#[test] -fn shared_resolvers() { - let f = super::fixture().join("browser-module"); - - let resolver1 = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["innerBrowser1".into(), "field".into(), "browser".into()]], - ..ResolveOptions::default() - }); - let resolved_path = resolver1.resolve(&f, "./lib/main1.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("lib/main.js"))); - - let resolver2 = resolver1.clone_with_options(ResolveOptions { - alias_fields: vec![vec!["innerBrowser2".into(), "browser".into()]], - ..ResolveOptions::default() - }); - let resolved_path = resolver2.resolve(&f, "./lib/main2.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("./lib/replaced.js"))); -} - -#[test] -fn replace_file() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![ - vec!["browser".into()], - vec!["innerBrowser1".into(), "field2".into(), "browser".into()], // not presented - vec!["innerBrowser1".into(), "field".into(), "browser".into()], - vec!["innerBrowser2".into(), "browser".into()], - ], - // Not part of enhanced-resolve. Added to make sure no interaction between these two fields. - main_fields: vec!["browser".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - ("should replace a file 1", f.clone(), "./lib/replaced", f.join("lib/browser.js")), - ("should replace a file 2", f.clone(), "./lib/replaced.js", f.join("lib/browser.js")), - ("should replace a file 3", f.join("lib"), "./replaced", f.join("lib/browser.js")), - ("should replace a file 4", f.join("lib"), "./replaced.js", f.join("lib/browser.js")), - ("should replace a module with a file 1", f.clone(), "module-a", f.join("browser/module-a.js")), - ("should replace a module with a file 2", f.join("lib"), "module-a", f.join("browser/module-a.js")), - ("should replace a module with a module 1", f.clone(), "module-b", f.join("node_modules/module-c.js")), - ("should replace a module with a module 2", f.join("lib"), "module-b", f.join("node_modules/module-c.js")), - ("should resolve in nested property 1", f.clone(), "./lib/main1.js", f.join("lib/main.js")), - ("should resolve in nested property 2", f.clone(), "./lib/main2.js", f.join("lib/browser.js")), - ("should check only alias field properties", f.clone(), "./toString", f.join("lib/toString.js")), - // not part of enhanced-resolve - ("recursion", f.clone(), "module-c", f.join("node_modules/module-c.js")), - ("resolve self 1", f.clone(), "./lib/main.js", f.join("lib/main.js")), - ("resolve self 2", f.clone(), "./main.js", f.join("lib/main.js")), - ]; - - for (comment, path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn recurse_fail() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - ("recurse non existent", f.clone(), "./lib/non-existent.js", ResolveError::NotFound("./lib/non-existent.js".into())), - ("path partial match 1", f.clone(), "./xyz.js", ResolveError::NotFound("./xyz.js".into())), - ("path partial match 2", f, "./lib/xyz.js", ResolveError::NotFound("./lib/xyz.js".into())), - ]; - - for (comment, path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Err(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn broken() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - // The browser field string value should be ignored - (f.clone(), "browser-module-broken", Ok(f.join("node_modules/browser-module-broken/main.js"))), - (f.join("browser-module"), "./number", Err(ResolveError::NotFound("./number".into()))), - ]; - - for (path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, expected, "{path:?} {request}"); - } -} - -#[test] -fn crypto_js() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - fallback: vec![( - "crypto".into(), - vec![AliasValue::from(f.join("lib.js").to_string_lossy())], - )], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(f.join("crypto-js"), "crypto").map(|r| r.full_path()); - assert_eq!(resolved_path, Err(ResolveError::Ignored(f.join("crypto-js")))); -} - -// https://github.com/webpack/webpack/blob/87660921808566ef3b8796f8df61bd79fc026108/test/cases/resolving/browser-field/index.js#L40-L43 -#[test] -fn recursive() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - let data = [ - ("should handle recursive file 1", f.clone(), "recursive-file/a"), - ("should handle recursive file 2", f.clone(), "recursive-file/b"), - ("should handle recursive file 3", f.clone(), "recursive-file/c"), - ("should handle recursive file 4", f, "recursive-file/d"), - ]; - - for (comment, path, request) in data { - let resolved_path = resolver.resolve(&path, request); - assert_eq!(resolved_path, Err(ResolveError::Recursion), "{comment} {path:?} {request}"); - } -} diff --git a/src/tests/builtins.rs b/src/tests/builtins.rs deleted file mode 100644 index 6163dd13..00000000 --- a/src/tests/builtins.rs +++ /dev/null @@ -1,98 +0,0 @@ -use std::path::Path; - -use crate::{ResolveError, ResolveOptions, Resolver}; - -#[test] -fn builtins_off() { - let f = Path::new("/"); - let resolver = Resolver::default(); - let resolved_path = resolver.resolve(f, "zlib").map(|r| r.full_path()); - assert_eq!(resolved_path, Err(ResolveError::NotFound("zlib".into()))); -} - -#[test] -fn builtins() { - let f = Path::new("/"); - - let resolver = - Resolver::new(ResolveOptions { builtin_modules: true, ..ResolveOptions::default() }); - - let pass = [ - "_http_agent", - "_http_client", - "_http_common", - "_http_incoming", - "_http_outgoing", - "_http_server", - "_stream_duplex", - "_stream_passthrough", - "_stream_readable", - "_stream_transform", - "_stream_wrap", - "_stream_writable", - "_tls_common", - "_tls_wrap", - "assert", - "assert/strict", - "async_hooks", - "buffer", - "child_process", - "cluster", - "console", - "constants", - "crypto", - "dgram", - "diagnostics_channel", - "dns", - "dns/promises", - "domain", - "events", - "fs", - "fs/promises", - "http", - "http2", - "https", - "inspector", - "module", - "net", - "os", - "path", - "path/posix", - "path/win32", - "perf_hooks", - "process", - "punycode", - "querystring", - "readline", - "repl", - "stream", - "stream/consumers", - "stream/promises", - "stream/web", - "string_decoder", - "sys", - "timers", - "timers/promises", - "tls", - "trace_events", - "tty", - "url", - "util", - "util/types", - "v8", - "vm", - "worker_threads", - "zlib", - ]; - - for request in pass { - let resolved_path = resolver.resolve(f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Err(ResolveError::Builtin(request.to_string())), "{request}"); - } - - for request in pass { - let request = format!("node:{request}"); - let resolved_path = resolver.resolve(f, &request).map(|r| r.full_path()); - assert_eq!(resolved_path, Err(ResolveError::Builtin(request.to_string())), "{request}"); - } -} diff --git a/src/tests/dependencies.rs b/src/tests/dependencies.rs deleted file mode 100644 index bcc2355b..00000000 --- a/src/tests/dependencies.rs +++ /dev/null @@ -1,110 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/dependencies.test.js - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows { - use rustc_hash::FxHashSet; - use std::path::PathBuf; - - use crate::{ResolveContext, ResolveOptions, ResolverGeneric}; - - use super::super::memory_fs::MemoryFS; - - fn file_system() -> MemoryFS { - MemoryFS::new(&[ - ("/a/b/node_modules/some-module/index.js", ""), - ("/a/node_modules/module/package.json", r#"{"main":"entry.js"}"#), - ("/a/node_modules/module/file.js", r#"{"main":"entry.js"}"#), - ("/modules/other-module/file.js", ""), - ]) - } - - #[test] - fn test() { - let file_system = file_system(); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - extensions: vec![".json".into(), ".js".into()], - modules: vec!["/modules".into(), "node_modules".into()], - ..ResolveOptions::default() - }, - ); - - let data = [ - ( - "middle module request", - "/a/b/c", - "module/file", - "/a/node_modules/module/file.js", - // These dependencies are different from enhanced-resolve due to different code path to - // querying the file system - vec![ - // 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", - // "/", - ], - vec![ - // missing package.jsons - // "/a/b/c/package.json", - "/a/b/package.json", - "/a/package.json", - "/package.json", - // missing modules directories - "/a/b/c", - // "/a/b/c/node_modules", - // missing single file modules - "/modules/module", - "/a/b/node_modules/module", - // missing files with alternative extensions - "/a/node_modules/module/file", - "/a/node_modules/module/file.json", - ], - ), - ( - "fast found module", - "/a/b/c", - "other-module/file.js", - "/modules/other-module/file.js", - // These dependencies are different from enhanced-resolve due to different code path to - // querying the file system - vec![ - // symlink checks - "/modules/other-module/file.js", - // "/modules/other-module", - // "/modules", - // "/", - ], - vec![ - // missing package.jsons - // "/a/b/c/package.json", - "/a/b/c", - "/a/b/package.json", - "/a/package.json", - "/package.json", - "/modules/other-module/package.json", - "/modules/package.json", - ], - ), - ]; - - for (name, context, request, result, file_dependencies, missing_dependencies) in data { - let mut ctx = ResolveContext::default(); - let path = PathBuf::from(context); - let resolved = - resolver.resolve_with_context(path, request, &mut ctx).map(|r| r.full_path()); - assert_eq!(resolved, Ok(PathBuf::from(result))); - let file_dependencies = - FxHashSet::from_iter(file_dependencies.iter().map(PathBuf::from)); - let missing_dependencies = - FxHashSet::from_iter(missing_dependencies.iter().map(PathBuf::from)); - assert_eq!(ctx.file_dependencies, file_dependencies, "{name}"); - assert_eq!(ctx.missing_dependencies, missing_dependencies, "{name}"); - } - } -} diff --git a/src/tests/exports_field.rs b/src/tests/exports_field.rs deleted file mode 100644 index 669c1adf..00000000 --- a/src/tests/exports_field.rs +++ /dev/null @@ -1,2546 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/exportsField.test.js -//! -//! The huge exports field test cases are at the bottom of this file. - -use crate::{Ctx, PathUtil, ResolveError, ResolveOptions, Resolver}; -use serde_json::json; -use std::path::Path; - -#[test] -fn test_simple() { - let f = super::fixture().join("exports-field"); - let f2 = super::fixture().join("exports-field2"); - let f4 = super::fixture().join("exports-field-error"); - let f5 = super::fixture().join("imports-exports-wildcard"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - fully_specified: true, - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("resolve root using exports field, not a main field", f.clone(), "exports-field", f.join("node_modules/exports-field/x.js")), - ("resolver should respect condition names", f.clone(), "exports-field/dist/main.js", f.join("node_modules/exports-field/lib/lib2/main.js")), - // enhanced_resolve behaves differently to node.js. enhanced_resolve fallbacks when an - // array item is unresolved, where as node.js fallbacks when an array has an - // InvalidPackageTarget error. - // ("resolver should respect fallback", f2.clone(), "exports-field/dist/browser.js", f2.join("node_modules/exports-field/lib/browser.js")), - // The following two tests require fallback from array values, the path is changed here to - // only test query and fragment. - ("resolver should respect query parameters #1", f2.clone(), "exports-field/dist/main.js?foo", f2.join("node_modules/exports-field/lib/lib2/main.js?foo")), - ("resolver should respect fragment parameters #1", f2.clone(), "exports-field/dist/main.js#foo", f2.join("node_modules/exports-field/lib/lib2/main.js#foo")), - ("relative path should work, if relative path as request is used", f.clone(), "./node_modules/exports-field/lib/main.js", f.join("node_modules/exports-field/lib/main.js")), - ("self-resolving root", f.clone(), "@exports-field/core", f.join("a.js")), - ("should resolve with wildcard pattern #1", f5.clone(), "m/features/f.js", f5.join("node_modules/m/src/features/f.js")), - ("should resolve with wildcard pattern #2", f5.clone(), "m/features/y/y.js", f5.join("node_modules/m/src/features/y/y.js")), - ("should resolve with wildcard pattern #3", f5.clone(), "m/features-no-ext/y/y.js", f5.join("node_modules/m/src/features/y/y.js")), - ("should resolve with wildcard pattern #4", f5.clone(), "m/middle/nested/f.js", f5.join("node_modules/m/src/middle/nested/f.js")), - ("should resolve with wildcard pattern #5", f5.clone(), "m/middle-1/nested/f.js", f5.join("node_modules/m/src/middle-1/nested/f.js")), - ("should resolve with wildcard pattern #6", f5.clone(), "m/middle-2/nested/f.js", f5.join("node_modules/m/src/middle-2/nested/f.js")), - ("should resolve with wildcard pattern #7", f5.clone(), "m/middle-3/nested/f", f5.join("node_modules/m/src/middle-3/nested/f/nested/f.js")), - ("should resolve with wildcard pattern #8", f5.clone(), "m/middle-4/f/nested", f5.join("node_modules/m/src/middle-4/f/f.js")), - ("should resolve with wildcard pattern #9", f5.clone(), "m/middle-5/f$/$", f5.join("node_modules/m/src/middle-5/f$/$.js")), - ]; - - // Not needed or snapshot: - // * should log the correct info - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } - - let p = f.join("node_modules/exports-field/package.json"); - let p2 = f2.join("node_modules/exports-field/package.json"); - let p4 = f4.join("node_modules/exports-field/package.json"); - let p5 = f5.join("node_modules/m/package.json"); - - #[rustfmt::skip] - let fail = [ - // ("throw error if extension not provided", f2.clone(), "exports-field/dist/main", ResolveError::NotFound(f2.join("node_modules/exports-field/lib/lib2/main"))), - ("resolver should respect query parameters #2. Direct matching", f2.clone(), "exports-field?foo", ResolveError::PackagePathNotExported("./?foo".into(), p2.clone())), - ("resolver should respect fragment parameters #2. Direct matching", f2, "exports-field#foo", ResolveError::PackagePathNotExported("./#foo".into(), p2)), - ("relative path should not work with exports field", f.clone(), "./node_modules/exports-field/dist/main.js", ResolveError::NotFound("./node_modules/exports-field/dist/main.js".into())), - ("backtracking should not work for request", f.clone(), "exports-field/dist/../../../a.js", ResolveError::InvalidPackageTarget("./lib/../../../a.js".to_string(), "./dist/".to_string(), p.clone())), - ("backtracking should not work for exports field target", f.clone(), "exports-field/dist/a.js", ResolveError::InvalidPackageTarget("./../../a.js".to_string(), "./dist/a.js".to_string(), p.clone())), - ("not exported error", f.clone(), "exports-field/anything/else", ResolveError::PackagePathNotExported("./anything/else".to_string(), p.clone())), - ("request ending with slash #1", f.clone(), "exports-field/", ResolveError::PackagePathNotExported("./".to_string(), p.clone())), - ("request ending with slash #2", f.clone(), "exports-field/dist/", ResolveError::PackagePathNotExported("./dist/".to_string(), p.clone())), - ("request ending with slash #3", f.clone(), "exports-field/lib/", ResolveError::PackagePathNotExported("./lib/".to_string(), p)), - ("should throw error if target is invalid", f4, "exports-field", ResolveError::InvalidPackageTarget("./a/../b/../../pack1/index.js".to_string(), ".".to_string(), p4)), - ("throw error if exports field is invalid", f.clone(), "invalid-exports-field", ResolveError::InvalidPackageConfig(f.join("node_modules/invalid-exports-field/package.json"))), - ("should throw error if target is 'null'", f5, "m/features/internal/file.js", ResolveError::PackagePathNotExported("./features/internal/file.js".to_string(), p5)), - ]; - - for (comment, path, request, error) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!(resolution, Err(error), "{comment} {path:?} {request}"); - } -} - -// resolve using exports field, not a browser field #1 -#[test] -fn exports_not_browser_field1() { - let f = super::fixture().join("exports-field"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - condition_names: vec!["webpack".into()], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "exports-field/dist/main.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("node_modules/exports-field/lib/lib2/main.js"))); -} - -// resolve using exports field and a browser alias field #2 -#[test] -fn exports_not_browser_field2() { - let f2 = super::fixture().join("exports-field2"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - extensions: vec![".js".into()], - condition_names: vec!["node".into()], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f2, "exports-field/dist/main.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f2.join("node_modules/exports-field/lib/browser.js"))); -} - -// should resolve extension without fullySpecified -#[test] -fn extension_without_fully_specified() { - let f2 = super::fixture().join("exports-field2"); - - let commonjs_resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - let resolved_path = - commonjs_resolver.resolve(&f2, "exports-field/dist/main").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f2.join("node_modules/exports-field/lib/lib2/main.js"))); -} - -#[test] -fn field_name_path() { - let f2 = super::fixture().join("exports-field2"); - let f3 = super::fixture().join("exports-field3"); - - // field name path #1 #2 #3 - let exports_fields = [ - vec![vec!["exportsField".into(), "exports".into()]], - vec![vec!["exportsField".into(), "exports".into()], vec!["exports".into()]], - vec![vec!["exports".into()], vec!["exportsField".into(), "exports".into()]], - ]; - - for exports_fields in exports_fields { - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - exports_fields, - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/main.js"))); - } - - // field name path #4 - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - exports_fields: vec![vec!["exports".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f2, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f2.join("node_modules/exports-field/index.js"))); - - // field name path #5 - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - exports_fields: vec![vec!["ex".into()], vec!["exports_field".into(), "exports".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/index"))); - - // non-compliant export targeting a directory - let resolver = Resolver::new(ResolveOptions { - exports_fields: vec![vec!["broken".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/src/index.js"))); -} - -#[test] -fn shared_resolvers() { - let f3 = super::fixture().join("exports-field3"); - - let resolver1 = Resolver::new(ResolveOptions { - exports_fields: vec![vec!["exportsField".into(), "exports".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver1.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/main.js"))); - - let resolver2 = resolver1.clone_with_options(ResolveOptions { - exports_fields: vec![vec!["ex".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver2.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/index"))); -} - -#[test] -fn extension_alias_1_2() { - let f = super::fixture().join("exports-field-and-extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - extension_alias: vec![(".js".into(), vec![".ts".into(), ".js".into()])], - fully_specified: true, - condition_names: vec!["webpack".into(), "default".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve with the `extensionAlias` option", f.clone(), "@org/pkg/string.js", f.join("node_modules/@org/pkg/dist/string.js")), - ("should resolve with the `extensionAlias` option #2", f.clone(), "pkg/string.js", f.join("node_modules/pkg/dist/string.js")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn extension_alias_3() { - let f = super::fixture().join("exports-field-and-extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - extension_alias: vec![( - ".js".into(), - vec![".foo".into(), ".baz".into(), ".baz".into(), ".ts".into(), ".js".into()], - )], - fully_specified: true, - condition_names: vec!["webpack".into(), "default".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve with the `extensionAlias` option #3", f.clone(), "pkg/string.js", f.join("node_modules/pkg/dist/string.js")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn extension_alias_throw_error() { - let f = super::fixture().join("exports-field-and-extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - extension_alias: vec![(".js".into(), vec![".ts".into()])], - fully_specified: true, - condition_names: vec!["webpack".into(), "default".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let fail = [ - // enhanced-resolve has two test cases that are exactly the same here - // https://github.com/webpack/enhanced-resolve/blob/a998c7d218b7a9ec2461fc4fddd1ad5dd7687485/test/exportsField.test.js#L2976-L3024 - ("should throw error with the `extensionAlias` option", f, "pkg/string.js", ResolveError::ExtensionAlias), - // TODO: The error is PackagePathNotExported in enhanced-resolve - // ("should throw error with the `extensionAlias` option", f.clone(), "pkg/string.js", ResolveError::PackagePathNotExported("node_modules/pkg/dist/string.ts".to_string())), - ]; - - for (comment, path, request, error) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!(resolution, Err(error), "{comment} {path:?} {request}"); - } -} - -// Small script for generating the test cases from enhanced-resolve -// for (c of testCases) { -// console.log("TestCase {") -// console.log(`name: ${JSON.stringify(c.name)},`) -// if (c.expect instanceof Error) { -// console.log(`expect: None,`) -// } else { -// console.log(`expect: Some(vec!${JSON.stringify(c.expect)}),`) -// } -// console.log(`exports_field: exports_field(json!(${JSON.stringify(c.suite[0], null, 2)})),`) -// console.log(`request: "${c.suite[1]}",`) -// console.log(`condition_names: vec!${JSON.stringify(c.suite[2])},`) -// console.log("},") -//} -struct TestCase { - name: &'static str, - expect: Option>, - exports_field: serde_json::Value, - request: &'static str, - condition_names: Vec<&'static str>, -} - -#[allow(clippy::needless_pass_by_value)] -fn exports_field(value: serde_json::Value) -> serde_json::Value { - value -} - -#[test] -fn test_cases() { - let test_cases = [ - TestCase { - name: "sample #1", - expect: Some(vec!["./dist/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/": { - "import": [ - "./dist/", - "./src/" - ], - "webpack": "./wp/" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "sample #1", - expect: Some(vec!["./src/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/": { - "import": [ - "./src/" - ], - "webpack": "./wp/" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - TestCase { - name: "sample #1 (wildcard)", - expect: Some(vec!["./dist/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/*": { - "import": [ - "./dist/*", - "./src/*" - ], - "webpack": "./wp/*" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "sample #1 (wildcard)", - expect: Some(vec!["./src/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/*": { - "import": [ - "./src/*" - ], - "webpack": "./wp/*" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - TestCase { - name: "sample #2", - expect: Some(vec!["./data/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./timezones/": "./data/timezones/" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #2 (wildcard)", - expect: Some(vec!["./data/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./timezones/*": "./data/timezones/*" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #3", - expect: Some(vec!["./data/timezones/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./": "./data/timezones/" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #3 (wildcard)", - expect: Some(vec!["./data/timezones/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./*": "./data/timezones/*.mjs" - })), - request: "./timezones/pdt", - condition_names: vec![], - }, - TestCase { - name: "sample #4", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./lib/": { - "browser": [ - "./browser/" - ] - }, - "./dist/index.js": { - "node": "./index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #4 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "node": "./index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #5", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/": { - "browser": [ - "./browser/" - ] - }, - "./dist/index.js": { - "node": "./index.js", - "default": "./browser/index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #5 (wildcard)", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "node": "./index.js", - "default": "./browser/index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./dist/a": "./dist/index.js" - })), - request: "./dist/aaa", - condition_names: vec![], - }, - TestCase { - name: "sample #7", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./dist/a/a/": "./dist/index.js" - })), - request: "./dist/a/a", - condition_names: vec![], - }, - TestCase { - name: "sample #7 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./dist/a/a/*": "./dist/index.js" - })), - request: "./dist/a/a", - condition_names: vec![], - }, - TestCase { - name: "sample #8", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": "./index.js" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #9", - expect: Some(vec!["./main.js"]), - exports_field: exports_field(json!({ - "./index.js": "./main.js" - })), - request: "./index.js", - condition_names: vec![], - }, - TestCase { - name: "sample #10", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #11", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./bar#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #12", - expect: Some(vec!["./ok.js#abc"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/ok.js#abc", - condition_names: vec![], - }, - TestCase { - name: "sample #12", - expect: Some(vec!["./ok.js#abc"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/ok.js#abc", - condition_names: vec![], - }, - TestCase { - name: "sample #13", - expect: Some(vec!["./ok.js?abc"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/ok.js?abc", - condition_names: vec![], - }, - TestCase { - name: "sample #14", - expect: Some(vec!["./🎉.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/🎉.js", - condition_names: vec![], - }, - TestCase { - name: "sample #15", - expect: Some(vec!["./%F0%9F%8E%89.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/%F0%9F%8E%89.js", - condition_names: vec![], - }, - TestCase { - name: "sample #16", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./🎉", - condition_names: vec![], - }, - TestCase { - name: "sample #17", - expect: Some(vec!["./other.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./%F0%9F%8E%89", - condition_names: vec![], - }, - TestCase { - name: "sample #18", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./module", - condition_names: vec![], - }, - TestCase { - name: "sample #19", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./module#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #20", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./module?foo", - condition_names: vec![], - }, - TestCase { - name: "sample #21", - expect: Some(vec!["./zizizi"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./z*z*z*" - })), - request: "./#zippi", - condition_names: vec![], - }, - TestCase { - name: "sample #22", - expect: Some(vec!["./d?e?f"]), - exports_field: exports_field(json!({ - "./a?b?c/": "./" - })), - request: "./a?b?c/d?e?f", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #1", - expect: Some(vec!["./dist/index.js"]), - exports_field: exports_field(json!({ - ".": "./dist/index.js" - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #2", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./": "./", - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #3", - expect: Some(vec!["./dist/a.js"]), - exports_field: exports_field(json!({ - "./dist/": "./dist/", - "./dist/*": "./dist/*", - "./dist*": "./dist*", - "./dist/index.js": "./dist/a.js" - })), - request: "./dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #4", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./": { - "browser": [ - "./browser/" - ] - }, - "./*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "browser": "./index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #5", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./": { - "browser": [ - "./browser/" - ] - }, - "./*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "node": "./node.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #6", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - ".": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #7", - expect: None, - exports_field: exports_field(json!({ - ".": { - "default": "./src/index.js", - "browser": "./index.js", - "node": "./src/node/index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #8", - expect: Some(vec!["./src/index.js"]), - exports_field: exports_field(json!({ - ".": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #9", - expect: Some(vec!["./index"]), - exports_field: exports_field(json!({ - ".": "./index" - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #10", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./index": "./index.js" - })), - request: "./index", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #11", - expect: Some(vec!["./foo.js"]), - exports_field: exports_field(json!({ - "./": "./", - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #12", - expect: Some(vec!["./foo/bar/baz.js"]), - exports_field: exports_field(json!({ - "./": "./", - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo/bar/baz.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #13", - expect: Some(vec!["./foo/bar/baz.js"]), - exports_field: exports_field(json!({ - "./": "./", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo/bar/baz.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #14", - expect: Some(vec!["./foo/bar/baz.js"]), - exports_field: exports_field(json!({ - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo/bar/baz.js", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #1", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "require": "./require.js" - }, { - "import": "./import.mjs" - }] - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #2", - expect: Some(vec!["./import.mjs"]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "require": "./require.js" - }, { - "import": "./import.mjs" - }] - })), - request: ".", - condition_names: vec!["import"], - }, - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./require.js"]), - exports_field: exports_field(json!({ - ".": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./import.mjs"]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "import": "./import.mjs" - }] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./require.js"]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "require": [ - "./require.js" - ] - }, { - "import": [ - "./import.mjs", - "./import.js" - ] - }] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./import.mjs"]), - exports_field: exports_field(json!({ - ".": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "./import.mjs", - "./import.js" - ] - } - ] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./import.js"]), - exports_field: exports_field(json!({ - ".": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "./import.js" - ] - } - ] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "mapping to a folder root #1", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./timezones": "./data/timezones/" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #2", - expect: None, - exports_field: exports_field(json!({ - "./timezones/": "./data/timezones" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #3", - expect: Some(vec!["./data/timezones/pdt/index.mjs"]), - exports_field: exports_field(json!({ - "./timezones/pdt/": "./data/timezones/pdt/" - })), - request: "./timezones/pdt/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #3 (wildcard)", - expect: Some(vec!["./data/timezones/pdt/index.mjs"]), - exports_field: exports_field(json!({ - "./timezones/pdt/*": "./data/timezones/pdt/*" - })), - request: "./timezones/pdt/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #4", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./": "./timezones/" - })), - request: "./pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #4 (wildcard)", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./*": "./timezones/*" - })), - request: "./pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #5", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./": "./" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #5 (wildcard)", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./*": "./*" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #6", - expect: None, - exports_field: exports_field(json!({ - "./": "." - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #6 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "./*": "." - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #7", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": "./" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #7 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": "./*" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #1", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./": "./", - "./dist/": "./lib/" - })), - request: "./dist/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #1 (wildcard)", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./*": "./*", - "./dist/*": "./lib/*" - })), - request: "./dist/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #2", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/": "./dist/utils/", - "./dist/": "./lib/" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #2 (wildcard)", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/*": "./dist/utils/*", - "./dist/*": "./lib/*" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #3", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/index.js": "./dist/utils/index.js", - "./dist/utils/": "./dist/utils/index.mjs", - "./dist/": "./lib/" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #3 (wildcard)", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/index.js": "./dist/utils/index.js", - "./dist/utils/*": "./dist/utils/index.mjs", - "./dist/*": "./lib/*" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #4", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./": { - "browser": "./browser/" - }, - "./dist/": "./lib/" - })), - request: "./dist/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "the longest matching path prefix is prioritized #4 (wildcard)", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./*": { - "browser": "./browser/*" - }, - "./dist/*": "./lib/*" - })), - request: "./dist/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #1", - // `lodash/` does not start with './' so fallbacks to util - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "conditional mapping folder #1", - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": [ - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #1 (wildcard)", - // `lodash/` does not start with './' so fallbacks to util - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": [ - "lodash/*", - "./utils/*" - ], - "node": [ - "./utils-node/*" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "conditional mapping folder #1 (wildcard)", - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": [ - "./utils/*" - ], - "node": [ - "./utils-node/*" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #2", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./node/" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "conditional mapping folder #2 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "webpack": "./wpk/*", - "browser": [ - "lodash/*", - "./utils/*" - ], - "node": [ - "./node/*" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "conditional mapping folder #3", - expect: Some(vec!["./wpk/index.mjs"]), - exports_field: exports_field(json!({ - "./utils/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils/" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "conditional mapping folder #3 (wildcard)", - expect: Some(vec!["./wpk/index.mjs"]), - exports_field: exports_field(json!({ - "./utils/*": { - "webpack": "./wpk/*", - "browser": [ - "lodash/*", - "./utils/*" - ], - "node": [ - "./utils/*" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "incorrect exports field #1", - expect: None, - exports_field: exports_field(json!({ - "/utils/": "./a/" - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #2", - expect: None, - exports_field: exports_field(json!({ - "./utils/": "/a/" - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #3", - expect: None, - exports_field: exports_field(json!({ - "/utils/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #4", - expect: None, - exports_field: exports_field(json!({ - "./utils/": { - "browser": "/a/", - "default": "/b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #4 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "/a/", - "default": "/b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #5", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index": "./a/index.js" - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index.mjs": "./a/index.js" - })), - request: "./utils/index", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #7", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #8", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index.mjs": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - // Requests that are not `./` does not apply to `package_exports_resolve` - // TestCase { - // name: "incorrect request #1", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": "./a/" - // })), - // request: "/utils/index.mjs", - // condition_names: vec![], - // }, - // TestCase { - // name: "incorrect request #2", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": { - // "browser": "./a/", - // "default": "./b/" - // } - // })), - // request: "/utils/index.mjs", - // condition_names: vec!["browser"], - // }, - // TestCase { - // name: "incorrect request #3", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": { - // "browser": "./a/", - // "default": "./b/" - // } - // })), - // request: "../utils/index.mjs", - // condition_names: vec!["browser"], - // }, - // TestCase { - // name: "incorrect request #4", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": { - // "browser": "./a/", - // "default": "./b/" - // } - // })), - // request: "/utils/index.mjs/", - // condition_names: vec!["browser"], - // }, - TestCase { - name: "backtracking package base #1", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./../../utils/": "./dist/" - })), - request: "./../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #1 (wildcard)", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./../../utils/*": "./dist/*" - })), - request: "./../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #2", - expect: None, - exports_field: exports_field(json!({ - "../../utils/": "./dist/" - })), - request: "../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #2 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "../../utils/*": "./dist/*" - })), - request: "../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #3", - expect: None, - exports_field: exports_field(json!({ - "./utils/": "../src/" - })), - request: "./utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #3 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "./utils/*": "../src/*" - })), - request: "./utils/index", - condition_names: vec![], - }, - // enhanced-resolve does not handle backtracking here - // TestCase { - // name: "backtracking package base #4", - // expect: Some(vec!["./../src/index"]), - // exports_field: exports_field(json!({ - // "./utils/": "./../src/" - // })), - // request: "./utils/index", - // condition_names: vec![], - // }, - // TestCase { - // name: "backtracking package base #4 (wildcard)", - // expect: Some(vec!["./../src/index"]), - // exports_field: exports_field(json!({ - // "./utils/*": "./../src/*" - // })), - // request: "./utils/index", - // condition_names: vec![], - // }, - // TestCase { - // name: "backtracking package base #5", - // expect: Some(vec!["./src/../index.js"]), - // exports_field: exports_field(json!({ - // "./utils/index": "./src/../index.js" - // })), - // request: "./utils/index", - // condition_names: vec![], - // }, - TestCase { - name: "backtracking package base #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/../utils/index": "./src/../index.js" - })), - request: "./utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #7", - expect: None, - exports_field: exports_field(json!({ - "./utils/": { - "browser": "../this/" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #7", - expect: None, - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "../this/*" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #8", - // We throw "InvalidPackageTarget" - // expect: Some(vec!["./utils/../index"]), - expect: None, - exports_field: exports_field(json!({ - "./utils/": { - "browser": "./utils/../" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #8 (wildcard)", - // We throw "InvalidPackageTarget" - // expect: Some(vec!["./utils/../index"]), - expect: None, - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "./utils/../*" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #9", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./": "./src/../../", - "./dist/": "./dist/" - })), - request: "./dist/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #9 (wildcard)", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./*": "./src/../../*", - "./dist/*": "./dist/*" - })), - request: "./dist/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking target folder #1", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../../index"]), - exports_field: exports_field(json!({ - "./utils/": "./dist/" - })), - request: "./utils/timezone/../../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #1 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../../index"]), - exports_field: exports_field(json!({ - "./utils/*": "./dist/*" - })), - request: "./utils/timezone/../../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #2", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../index"]), - exports_field: exports_field(json!({ - "./utils/": "./dist/" - })), - request: "./utils/timezone/../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #2 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../index"]), - exports_field: exports_field(json!({ - "./utils/*": "./dist/*" - })), - request: "./utils/timezone/../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #3", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/target/../../index"]), - exports_field: exports_field(json!({ - "./utils/": "./dist/target/" - })), - request: "./utils/../../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #3 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/target/../../index"]), - exports_field: exports_field(json!({ - "./utils/*": "./dist/target/*" - })), - request: "./utils/../../index", - condition_names: vec![], - }, - // enhanced-resolve does not handle `node_modules` in target - TestCase { - name: "nested node_modules path #1", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": "./node_modules/" - } - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #1 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "./node_modules/*" - } - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #2", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./utils/../node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/": "./utils/../node_modules/" - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "nested node_modules path #2 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./utils/../node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": "./utils/../node_modules/*" - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "nested mapping #1", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": "./", - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested mapping #1 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": "./*", - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "nested mapping #2 (wildcard)", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #2 (wildcard)", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "nested mapping #3", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["webpack"], - }, - TestCase { - name: "nested mapping #3 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["webpack"], - }, - TestCase { - name: "nested mapping #4", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["node", "browser"], - }, - TestCase { - name: "nested mapping #4 (wildcard)", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["node", "browser"], - }, - TestCase { - name: "nested mapping #5", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node"], - }, - TestCase { - name: "nested mapping #5 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": { - "webpack": [ - "./wpck/*" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node"], - }, - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - TestCase { - name: "nested mapping #6 (wildcard)", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": { - "webpack": [ - "./wpck/*" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #6 (wildcard)", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./node/*" - ], - "default": { - "node": { - "webpack": [ - "./wpck/*" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - TestCase { - name: "nested mapping #7", - expect: Some(vec!["./y.js"]), - exports_field: exports_field(json!({ - "./a.js": { - "abc": { - "def": "./x.js" - }, - "ghi": "./y.js" - } - })), - request: "./a.js", - condition_names: vec!["abc", "ghi"], - }, - TestCase { - name: "nested mapping #8", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./a.js": { - "abc": { - "def": "./x.js", - "default": [] - }, - "ghi": "./y.js" - } - })), - request: "./a.js", - condition_names: vec!["abc", "ghi"], - }, - TestCase { - name: "syntax sugar #1", - expect: Some(vec!["./main.js"]), - exports_field: exports_field(json!("./main.js")), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #2", - expect: Some(vec![]), - exports_field: exports_field(json!("./main.js")), - request: "./lib.js", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #3", - expect: Some(vec!["./a.js"]), - exports_field: exports_field(json!(["./a.js", "./b.js"])), - request: ".", - condition_names: vec![], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "syntax sugar #3", - expect: Some(vec!["./b.js"]), - exports_field: exports_field(json!(["./b.js"])), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #4", - expect: Some(vec![]), - exports_field: exports_field(json!(["./a.js", "./b.js"])), - request: "./lib.js", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #5", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "browser": { - "default": "./index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "syntax sugar #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "browser": { - "default": "./index.js" - } - })), - request: "./lib.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "syntax sugar #7", - expect: None, - exports_field: exports_field(json!({ - "./node": "./node.js", - "browser": { - "default": "./index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "syntax sugar #8", - expect: None, - exports_field: exports_field(json!({ - "browser": { - "default": "./index.js" - }, - "./node": "./node.js" - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #1", - expect: Some(vec!["./abc/d"]), - exports_field: exports_field(json!({ - "./ab*": "./ab/*", - "./abc*": "./abc/*", - "./a*": "./a/*" - })), - request: "./abcd", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #2", - expect: Some(vec!["./abc/d/e"]), - exports_field: exports_field(json!({ - "./ab*": "./ab/*", - "./abc*": "./abc/*", - "./a*": "./a/*" - })), - request: "./abcd/e", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #3", - expect: Some(vec!["./abc/d"]), - exports_field: exports_field(json!({ - "./x/ab*": "./ab/*", - "./x/abc*": "./abc/*", - "./x/a*": "./a/*" - })), - request: "./x/abcd", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #4", - expect: Some(vec!["./abc/d/e"]), - exports_field: exports_field(json!({ - "./x/ab*": "./ab/*", - "./x/abc*": "./abc/*", - "./x/a*": "./a/*" - })), - request: "./x/abcd/e", - condition_names: vec!["browser"], - }, - TestCase { - name: "path tree edge case #1", - expect: Some(vec!["./A/b/d.js"]), - exports_field: exports_field(json!({ - "./a/": "./A/", - "./a/b/c": "./c.js" - })), - request: "./a/b/d.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #1 (wildcard)", - expect: Some(vec!["./A/b/d.js"]), - exports_field: exports_field(json!({ - "./a/*": "./A/*", - "./a/b/c": "./c.js" - })), - request: "./a/b/d.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #2", - expect: Some(vec!["./A/c.js"]), - exports_field: exports_field(json!({ - "./a/": "./A/", - "./a/b": "./b.js" - })), - request: "./a/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #2 (wildcard)", - expect: Some(vec!["./A/c.js"]), - exports_field: exports_field(json!({ - "./a/*": "./A/*", - "./a/b": "./b.js" - })), - request: "./a/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #3", - expect: Some(vec!["./A/b/d/c.js"]), - exports_field: exports_field(json!({ - "./a/": "./A/", - "./a/b/c/d": "./c.js" - })), - request: "./a/b/d/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #3 (wildcard)", - expect: Some(vec!["./A/b/d/c.js"]), - exports_field: exports_field(json!({ - "./a/*": "./A/*", - "./a/b/c/d": "./c.js" - })), - request: "./a/b/d/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #1", - expect: Some(vec!["./A/b.js"]), - exports_field: exports_field(json!({ - "./a/*.js": "./A/*.js" - })), - request: "./a/b.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #2", - expect: Some(vec!["./A/b/c.js"]), - exports_field: exports_field(json!({ - "./a/*.js": "./A/*.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #3", - expect: Some(vec!["./A/b/c.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": "./A/*/c.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #4", - expect: Some(vec!["./A/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": "./A/*/*.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #5", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/*.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #5", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/*.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./lib/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #6", - expect: Some(vec!["./browser/foo/bar.js"]), - exports_field: exports_field(json!({ - "./lib/*/bar.js": { - "browser": [ - "./browser/*/bar.js" - ] - }, - "./dist/*/bar.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./lib/foo/bar.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #6", - expect: Some(vec!["./browser/foo.js"]), - exports_field: exports_field(json!({ - "./lib/*/bar.js": { - "browser": [ - "./browser/*/bar.js" - ] - }, - "./dist/*/bar.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./dist/foo/bar.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #7", - expect: Some(vec!["./browser/foo/default.js"]), - exports_field: exports_field(json!({ - "./lib/*/bar.js": { - "browser": [ - "./browser/*/bar.js" - ] - }, - "./dist/*/bar.js": { - "node": "./*.js", - "default": "./browser/*/default.js" - } - })), - request: "./dist/foo/bar.js", - condition_names: vec!["default"], - }, - TestCase { - name: "wildcard pattern #8", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": "./A/*/*/*.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #9", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": [ - "./A/*/*/*.js", - "./B/*/*/*.js" - ] - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "wildcard pattern #9", - expect: Some(vec!["./B/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": [ - "./B/*/*/*.js" - ] - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #10", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/foo-*/c.js": "./A/*/*/*.js" - })), - request: "./a/foo-b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #11", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*-foo/c.js": "./A/*/*/*.js" - })), - request: "./a/b-foo/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #12", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/foo-*-foo/c.js": "./A/*/*/*.js" - })), - request: "./a/foo-b-foo/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #13", - expect: Some(vec!["./A/b/c/d.js"]), - exports_field: exports_field(json!({ - "./a/foo-*-foo/c.js": "./A/b/c/d.js" - })), - request: "./a/foo-b-foo/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #14", - expect: Some(vec!["./A/b/c/*.js"]), - exports_field: exports_field(json!({ - "./a/foo-foo/c.js": "./A/b/c/*.js" - })), - request: "./a/foo-foo/c.js", - condition_names: vec![], - }, - ]; - - for case in test_cases { - let resolved = Resolver::new(ResolveOptions { - condition_names: case - .condition_names - .iter() - .map(ToString::to_string) - .collect::>(), - ..ResolveOptions::default() - }) - .package_exports_resolve( - Path::new(""), - case.request, - &case.exports_field, - &mut Ctx::default(), - ) - .map(|p| p.map(|p| p.to_path_buf())); - if let Some(expect) = case.expect { - if expect.is_empty() { - assert!( - matches!(resolved, Err(ResolveError::PackagePathNotExported(_, _))), - "{} {:?}", - &case.name, - &resolved - ); - } else { - for expect in expect { - assert_eq!(resolved, Ok(Some(Path::new(expect).normalize())), "{}", &case.name); - } - } - } else { - assert!(resolved.is_err(), "{} {resolved:?}", &case.name); - } - } -} diff --git a/src/tests/extension_alias.rs b/src/tests/extension_alias.rs deleted file mode 100644 index 86afab73..00000000 --- a/src/tests/extension_alias.rs +++ /dev/null @@ -1,66 +0,0 @@ -//! - -use crate::{ResolveError, ResolveOptions, Resolver}; - -#[test] -fn extension_alias() { - let f = super::fixture().join("extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - extension_alias: vec![ - (".js".into(), vec![".ts".into(), ".js".into()]), - (".mjs".into(), vec![".mts".into()]), - ], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should alias fully specified file", f.clone(), "./index.js", f.join("index.ts")), - ("should alias fully specified file when there are two alternatives", f.clone(), "./dir/index.js", f.join("dir/index.ts")), - ("should also allow the second alternative", f.clone(), "./dir2/index.js", f.join("dir2/index.js")), - ("should support alias option without an array", f.clone(), "./dir2/index.mjs", f.join("dir2/index.mts")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } - - #[rustfmt::skip] - let fail = [ - ("should not allow to fallback to the original extension or add extensions", f, "./index.mjs"), - ]; - - for (comment, path, request) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!(resolution, Err(ResolveError::ExtensionAlias), "{comment} {path:?} {request}"); - } -} - -// should not apply extension alias to extensions or mainFiles field -#[test] -fn not_apply_to_extension_nor_main_files() { - let f = super::fixture().join("extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - extension_alias: vec![(".js".into(), vec![])], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("directory", f.clone(), "./dir2", "dir2/index.js"), - ("file", f.clone(), "./dir2/index", "dir2/index.js"), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - let expected = f.join(expected); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} diff --git a/src/tests/extensions.rs b/src/tests/extensions.rs deleted file mode 100644 index 1ebd86f4..00000000 --- a/src/tests/extensions.rs +++ /dev/null @@ -1,125 +0,0 @@ -//! - -use crate::{EnforceExtension, Resolution, ResolveContext, ResolveError, ResolveOptions, Resolver}; -use rustc_hash::FxHashSet; - -#[test] -fn extensions() { - let f = super::fixture().join("extensions"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".ts".into(), ".js".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve according to order of provided extensions", "./foo", "foo.ts"), - ("should resolve according to order of provided extensions (dir index)", "./dir", "dir/index.ts"), - ("should resolve according to main field in module root", ".", "index.js"), - // This is a core module - // ("should resolve single file module before directory", "module", "node_modules/module.js"), - ("should resolve trailing slash directory before single file", "module/", "node_modules/module/index.ts"), - ]; - - for (comment, request, expected_path) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - let expected = f.join(expected_path); - assert_eq!(resolved_path, Ok(expected), "{comment} {request} {expected_path}"); - } - - #[rustfmt::skip] - let fail = [ - ("not resolve to file when request has a trailing slash (relative)", "./foo.js/", "./foo.js/".into()) - ]; - - for (comment, request, expected_error) in fail { - let resolution = resolver.resolve(&f, request); - let error = ResolveError::NotFound(expected_error); - assert_eq!(resolution, Err(error), "{comment} {request} {resolution:?}"); - } -} - -// should default enforceExtension to true when extensions includes an empty string -#[test] -fn default_enforce_extension() { - let f = super::fixture().join("extensions"); - - let mut ctx = ResolveContext::default(); - let resolved = Resolver::new(ResolveOptions { - extensions: vec![".ts".into(), String::new(), ".js".into()], - ..ResolveOptions::default() - }) - .resolve_with_context(&f, "./foo", &mut ctx); - - assert_eq!(resolved.map(Resolution::into_path_buf), Ok(f.join("foo.ts"))); - assert_eq!( - ctx.file_dependencies, - FxHashSet::from_iter([f.join("foo.ts"), f.join("package.json")]) - ); - assert!(ctx.missing_dependencies.is_empty()); -} - -// should respect enforceExtension when extensions includes an empty string -#[test] -fn respect_enforce_extension() { - let f = super::fixture().join("extensions"); - - let mut ctx = ResolveContext::default(); - let resolved = Resolver::new(ResolveOptions { - enforce_extension: EnforceExtension::Disabled, - extensions: vec![".ts".into(), String::new(), ".js".into()], - ..ResolveOptions::default() - }) - .resolve_with_context(&f, "./foo", &mut ctx); - - assert_eq!(resolved.map(Resolution::into_path_buf), Ok(f.join("foo.ts"))); - assert_eq!( - ctx.file_dependencies, - FxHashSet::from_iter([f.join("foo.ts"), f.join("package.json")]) - ); - assert_eq!(ctx.missing_dependencies, FxHashSet::from_iter([f.join("foo")])); -} - -#[test] -fn multi_dot_extension() { - let f = super::fixture().join("extensions"); - - let resolver = Resolver::new(ResolveOptions { - // Test for `.d.ts`, not part of enhanced-resolve. - extensions: vec![".a.b.c".into(), ".d.ts".into(), ".ts".into(), ".js".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve according to order of provided extensions", "./foo", "foo.ts"), - ("should resolve file with extension", "./app.module", "app.module.js") - ]; - - for (comment, request, expected_path) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - let expected = f.join(expected_path); - assert_eq!(resolved_path, Ok(expected), "{comment} {request} {expected_path}"); - } - - #[rustfmt::skip] - let fail = [ - ("not resolve to file", "./index.", "./index.".into()) - ]; - - for (comment, request, expected_error) in fail { - let resolution = resolver.resolve(&f, request); - let error = ResolveError::NotFound(expected_error); - assert_eq!(resolution, Err(error), "{comment} {request} {resolution:?}"); - } -} - -#[test] -#[should_panic = "All extensions must start with a leading dot"] -fn without_leading_dot() { - Resolver::new(ResolveOptions { - extensions: vec!["ts".into(), "js".into()], - ..ResolveOptions::default() - }); -} diff --git a/src/tests/fallback.rs b/src/tests/fallback.rs deleted file mode 100644 index 3da2d767..00000000 --- a/src/tests/fallback.rs +++ /dev/null @@ -1,100 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/fallback.test.js - -#[test] -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -fn fallback() { - use super::memory_fs::MemoryFS; - use crate::{AliasValue, ResolveError, ResolveOptions, ResolverGeneric}; - use std::path::{Path, PathBuf}; - - let f = Path::new("/"); - - let file_system = MemoryFS::new(&[ - ("/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", ""), - ]); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - fallback: vec![ - ("aliasA".into(), vec![AliasValue::Path("a".into())]), - ("b$".into(), vec![AliasValue::Path("a/index".into())]), - ("c$".into(), vec![AliasValue::Path("/a/index".into())]), - ( - "multiAlias".into(), - vec![ - AliasValue::Path("b".into()), - AliasValue::Path("c".into()), - AliasValue::Path("d".into()), - AliasValue::Path("e".into()), - AliasValue::Path("a".into()), - ], - ), - ("recursive".into(), vec![AliasValue::Path("recursive/dir".into())]), - ("/d/dir".into(), vec![AliasValue::Path("/c/dir".into())]), - ("/d/index.js".into(), vec![AliasValue::Path("/c/index".into())]), - ("ignored".into(), vec![AliasValue::Ignore]), - ("node:path".into(), vec![AliasValue::Ignore]), - ], - modules: vec!["/".into()], - ..ResolveOptions::default() - }, - ); - - #[rustfmt::skip] - let pass = [ - ("should resolve a not aliased module 1", "a", "/a/index"), - ("should resolve a not aliased module 2", "a/index", "/a/index"), - ("should resolve a not aliased module 3", "a/dir", "/a/dir/index"), - ("should resolve a not aliased module 4", "a/dir/index", "/a/dir/index"), - ("should resolve an fallback module 1", "aliasA", "/a/index"), - ("should resolve an fallback module 2", "aliasA/index", "/a/index"), - ("should resolve an fallback module 3", "aliasA/dir", "/a/dir/index"), - ("should resolve an fallback module 4", "aliasA/dir/index", "/a/dir/index"), - ("should resolve a recursive aliased module 1", "recursive", "/recursive/index"), - ("should resolve a recursive aliased module 2", "recursive/index", "/recursive/index"), - ("should resolve a recursive aliased module 3", "recursive/dir", "/recursive/dir/index"), - ("should resolve a recursive aliased module 4", "recursive/dir/index", "/recursive/dir/index"), - ("should resolve a recursive aliased module 5", "recursive/file", "/recursive/dir/file"), - ("should resolve a file aliased module with a query 1", "b?query", "/b/index?query"), - ("should resolve a file aliased module with a query 2", "c?query", "/c/index?query"), - ("should resolve a path in a file aliased module 1", "b/index", "/b/index"), - ("should resolve a path in a file aliased module 2", "b/dir", "/b/dir/index"), - ("should resolve a path in a file aliased module 3", "b/dir/index", "/b/dir/index"), - ("should resolve a path in a file aliased module 4", "c/index", "/c/index"), - ("should resolve a path in a file aliased module 5", "c/dir", "/c/dir/index"), - ("should resolve a path in a file aliased module 6", "c/dir/index", "/c/dir/index"), - ("should resolve a file in multiple aliased dirs 1", "multiAlias/dir/file", "/e/dir/file"), - ("should resolve a file in multiple aliased dirs 2", "multiAlias/anotherDir", "/e/anotherDir/index"), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - - #[rustfmt::skip] - let ignore = [ - ("should resolve an ignore module", "ignored", ResolveError::Ignored(f.join("ignored"))), - ("should resolve node: builtin module", "node:path", ResolveError::Ignored(PathBuf::from("/node:path"))), - ]; - - for (comment, request, expected) in ignore { - let resolution = resolver.resolve(f, request); - assert_eq!(resolution, Err(expected), "{comment} {request}"); - } -} diff --git a/src/tests/full_specified.rs b/src/tests/full_specified.rs deleted file mode 100644 index a70c0191..00000000 --- a/src/tests/full_specified.rs +++ /dev/null @@ -1,113 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/fullSpecified.test.js - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows { - use std::path::PathBuf; - - use crate::{AliasValue, ResolveOptions, ResolverGeneric}; - - use super::super::memory_fs::MemoryFS; - - fn file_system() -> MemoryFS { - MemoryFS::new(&[ - ("/a/node_modules/package1/index.js", ""), - ("/a/node_modules/package1/file.js", ""), - ("/a/node_modules/package2/package.json", r#"{"main":"a"}"#), - ("/a/node_modules/package2/a.js", ""), - ("/a/node_modules/package3/package.json", r#"{"main":"dir"}"#), - ("/a/node_modules/package3/dir/index.js", ""), - ("/a/node_modules/package4/package.json", r#"{"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", ""), - ]) - } - - #[test] - fn test() { - let file_system = file_system(); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - alias: vec![ - ("alias1".into(), vec![AliasValue::from("/a/abc")]), - ("alias2".into(), vec![AliasValue::from("/a")]), - ], - alias_fields: vec![vec!["browser".into()]], - fully_specified: true, - ..ResolveOptions::default() - }, - ); - - let failing_resolves = [ - ("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"), - ]; - - for (comment, request) in failing_resolves { - let resolution = resolver.resolve("/a", request); - assert!(resolution.is_err(), "{comment} {request}"); - } - - let successful_resolves = [ - ("fully relative", "./abc.js", "/a/abc.js"), - ("fully absolute", "/a/abc.js", "/a/abc.js"), - ("fully relative in package", "package1/file.js", "/a/node_modules/package1/file.js"), - ("extensions in mainFiles", "package1", "/a/node_modules/package1/index.js"), - ("extensions in mainFields", "package2", "/a/node_modules/package2/a.js"), - ("extensions in alias", "alias1", "/a/abc.js"), - ("directories in alias", "alias2", "/a/index.js"), - ("directories in packages", "package3", "/a/node_modules/package3/dir/index.js"), - ("extensions in aliasFields", "package4/a.js", "/a/node_modules/package4/b.js"), - ]; - - for (comment, request, expected) in successful_resolves { - let resolution = resolver.resolve("/a", request).map(|r| r.full_path()); - assert_eq!(resolution, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - } - - #[test] - #[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. - fn resolve_to_context() { - let file_system = file_system(); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - alias: vec![ - ("alias1".into(), vec![AliasValue::from("/a/abc")]), - ("alias2".into(), vec![AliasValue::from("/a")]), - ], - alias_fields: vec![vec!["browser".into()]], - fully_specified: true, - resolve_to_context: true, - ..ResolveOptions::default() - }, - ); - - let successful_resolves = [ - ("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", "/a/node_modules/package3/dir"), - ]; - - for (comment, request, expected) in successful_resolves { - let resolution = resolver.resolve("/a", request).map(|r| r.full_path()); - assert_eq!(resolution, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - } -} diff --git a/src/tests/imports_field.rs b/src/tests/imports_field.rs deleted file mode 100644 index 9f9a9726..00000000 --- a/src/tests/imports_field.rs +++ /dev/null @@ -1,1320 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/importsField.test.js -//! -//! The huge imports field test cases are at the bottom of this file. - -use serde_json::json; - -use crate::{Ctx, JSONMap, PathUtil, ResolveError, ResolveOptions, Resolver}; -use std::path::Path; - -#[test] -fn test_simple() { - let f = super::fixture().join("imports-field"); - let f2 = super::fixture().join("imports-exports-wildcard/node_modules/m/"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve using imports field instead of self-referencing", f.clone(), "#imports-field", f.join("b.js")), - ("should resolve using imports field instead of self-referencing for a subpath", f.join("dir"), "#imports-field", f.join("b.js")), - ("should resolve package #1", f.clone(), "#a/dist/main.js", f.join("node_modules/a/lib/lib2/main.js")), - ("should resolve package #3", f.clone(), "#ccc/index.js", f.join("node_modules/c/index.js")), - ("should resolve package #4", f.clone(), "#c", f.join("node_modules/c/index.js")), - ("should resolve with wildcard pattern", f2.clone(), "#internal/i.js", f2.join("src/internal/i.js")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } - - // Note added: - // * should resolve absolute path as an imports field target - // * should log the correct info - - #[rustfmt::skip] - let fail = [ - ("should disallow resolve out of package scope", f.clone(), "#b", ResolveError::InvalidPackageTarget("../b.js".to_string(), "#b".to_string(), f.join("package.json"))), - ("should resolve package #2", f.clone(), "#a", ResolveError::PackageImportNotDefined("#a".to_string(), f.join("package.json"))), - ]; - - for (comment, path, request, error) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!(resolution, Err(error), "{comment} {path:?} {request}"); - } -} - -#[test] -fn shared_resolvers() { - let f = super::fixture().join("imports-field"); - - // field name #1 - let resolver1 = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - imports_fields: vec![vec!["imports".into()]], - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - let resolved_path = resolver1.resolve(&f, "#imports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("b.js"))); - - // field name #2 - let resolver2 = resolver1.clone_with_options(ResolveOptions { - imports_fields: vec![vec!["other".into(), "imports".into()]], - ..ResolveOptions::default() - }); - - let resolved_path = resolver2.resolve(&f, "#b").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("a.js"))); -} - -// Small script for generating the test cases from enhanced_resolve -// for (c of testCases) { -// console.log("TestCase {") -// console.log(`name: ${JSON.stringify(c.name)},`) -// if (c.expect instanceof Error) { -// console.log(`expect: None,`) -// } else { -// console.log(`expect: Some(vec!${JSON.stringify(c.expect)}),`) -// } -// console.log(`imports_field: imports_field(json!(${JSON.stringify(c.suite[0], null, 2)})),`) -// console.log(`request: "${c.suite[1]}",`) -// console.log(`condition_names: vec!${JSON.stringify(c.suite[2])},`) -// console.log("},") -// } - -struct TestCase { - name: &'static str, - expect: Option>, - imports_field: JSONMap, - request: &'static str, - condition_names: Vec<&'static str>, -} - -#[allow(clippy::needless_pass_by_value)] -fn imports_field(value: serde_json::Value) -> JSONMap { - let s = serde_json::to_string(&value).unwrap(); - serde_json::from_str(&s).unwrap() -} - -#[test] -fn test_cases() { - let test_cases = [ - TestCase { - name: "sample #1", - expect: Some(vec!["./dist/test/file.js"]), - imports_field: imports_field(json!({ - "#abc/": { - "import": [ - "./dist/", - "./src/" - ], - "webpack": "./wp/" - }, - "#abc": "./main.js" - })), - request: "#abc/test/file.js", - condition_names: vec!["import", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "sample #1", - expect: Some(vec!["./src/test/file.js"]), - imports_field: imports_field(json!({ - "#abc/": { - "import": [ - "./src/" - ], - "webpack": "./wp/" - }, - "#abc": "./main.js" - })), - request: "#abc/test/file.js", - condition_names: vec!["import", "webpack"], - }, - TestCase { - name: "sample #2", - expect: Some(vec!["./data/timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#1/timezones/": "./data/timezones/" - })), - request: "#1/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #3", - expect: Some(vec!["./data/timezones/timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#aaa/": "./data/timezones/", - "#a/": "./data/timezones/" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #4", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/lib/": { - "browser": [ - "./browser/" - ] - }, - "#a/dist/index.js": { - "node": "./index.js" - } - })), - request: "#a/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #5", - expect: Some(vec!["./browser/index.js"]), - imports_field: imports_field(json!({ - "#a/lib/": { - "browser": [ - "./browser/" - ] - }, - "#a/dist/index.js": { - "node": "./index.js", - "default": "./browser/index.js" - } - })), - request: "#a/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #6", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/dist/a": "./dist/index.js" - })), - request: "#a/dist/aaa", - condition_names: vec![], - }, - TestCase { - name: "sample #7", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/a/a/": "./dist/index.js" - })), - request: "#a/a/a", - condition_names: vec![], - }, - TestCase { - name: "sample #8", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": "./index.js" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #9", - expect: Some(vec!["./main.js"]), - imports_field: imports_field(json!({ - "#a/index.js": "./main.js" - })), - request: "#a/index.js", - condition_names: vec![], - }, - TestCase { - name: "sample #10", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #11", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/bar#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #12", - expect: Some(vec!["./ok.js#abc"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/ok.js#abc", - condition_names: vec![], - }, - TestCase { - name: "sample #13", - expect: Some(vec!["./ok.js?abc"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/ok.js?abc", - condition_names: vec![], - }, - TestCase { - name: "sample #14", - expect: Some(vec!["./🎉.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/🎉.js", - condition_names: vec![], - }, - TestCase { - name: "sample #15", - expect: Some(vec!["./%F0%9F%8E%89.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/%F0%9F%8E%89.js", - condition_names: vec![], - }, - TestCase { - name: "sample #16", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/🎉", - condition_names: vec![], - }, - TestCase { - name: "sample #17", - expect: Some(vec!["./other.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/%F0%9F%8E%89", - condition_names: vec![], - }, - TestCase { - name: "sample #18", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/module", - condition_names: vec![], - }, - TestCase { - name: "sample #19", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/module#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #20", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/module?foo", - condition_names: vec![], - }, - TestCase { - name: "sample #21", - expect: Some(vec!["./d?e?f"]), - imports_field: imports_field(json!({ - "#a/a?b?c/": "./" - })), - request: "#a/a?b?c/d?e?f", - condition_names: vec![], - }, - TestCase { - name: "sample #22", - // We throw InvalidPackageTarget - expect: None, - // expect: Some(vec!["/user/a/index"]), - imports_field: imports_field(json!({ - "#a/": "/user/a/" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #1", - expect: Some(vec!["./A/b/d.js"]), - imports_field: imports_field(json!({ - "#a/": "./A/", - "#a/b/c": "./c.js" - })), - request: "#a/b/d.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #2", - expect: Some(vec!["./A/c.js"]), - imports_field: imports_field(json!({ - "#a/": "./A/", - "#a/b": "./b.js" - })), - request: "#a/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #3", - expect: Some(vec!["./A/b/c/d.js"]), - imports_field: imports_field(json!({ - "#a/": "./A/", - "#a/b/c/d": "./c.js" - })), - request: "#a/b/c/d.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #1", - expect: Some(vec!["./dist/index.js"]), - imports_field: imports_field(json!({ - "#a": "./dist/index.js" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #2", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": "./" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #3", - expect: Some(vec!["./dist/a.js"]), - imports_field: imports_field(json!({ - "#a/": "./dist/", - "#a/index.js": "./dist/a.js" - })), - request: "#a/index.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #4", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "./browser/" - ] - }, - "#a/index.js": { - "browser": "./index.js" - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #5", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "./browser/" - ] - }, - "#a/index.js": { - "node": "./node.js" - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #6", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: "#a", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #7", - expect: None, - imports_field: imports_field(json!({ - "#a": { - "default": "./src/index.js", - "browser": "./index.js", - "node": "./src/node/index.js" - } - })), - request: "#a", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #8", - expect: Some(vec!["./src/index.js"]), - imports_field: imports_field(json!({ - "#a": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #9", - expect: Some(vec!["./index"]), - imports_field: imports_field(json!({ - "#a": "./index" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #10", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/index": "./index.js" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #11", - // We throw InvalidPackageTarget - // expect: Some(vec!["b"]), - expect: None, - imports_field: imports_field(json!({ - "#a": "b" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #12", - // We throw InvalidPackageTarget - // expect: Some(vec!["b/index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "b/" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #13", - // We throw InvalidPackageTarget - // expect: Some(vec!["b#anotherhashishere"]), - expect: None, - imports_field: imports_field(json!({ - "#a?q=a#hashishere": "b#anotherhashishere" - })), - request: "#a?q=a#hashishere", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #1", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #2", - expect: Some(vec!["./import.mjs"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec!["import"], - }, - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./require.js"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./import.mjs"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./require.js"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": [ - "./require.js" - ] - }, - { - "import": [ - "./import.mjs", - "#b/import.js" - ] - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./import.mjs"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "./import.mjs", - "#b/import.js" - ] - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "#b/import.js" - ] - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "mapping to a folder root #1", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#timezones": "./data/timezones/" - })), - request: "#timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #2", - expect: None, - imports_field: imports_field(json!({ - "#timezones/": "./data/timezones" - })), - request: "#timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #3", - expect: Some(vec!["./data/timezones/pdt/index.mjs"]), - imports_field: imports_field(json!({ - "#timezones/pdt/": "./data/timezones/pdt/" - })), - request: "#timezones/pdt/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #4", - expect: Some(vec!["./timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#a/": "./timezones/" - })), - request: "#a/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #5", - expect: Some(vec!["./timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#a/": "./" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #6", - expect: None, - imports_field: imports_field(json!({ - "#a/": "." - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #7", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": "./" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #1", - expect: Some(vec!["./lib/index.mjs"]), - imports_field: imports_field(json!({ - "#a/": "./", - "#a/dist/": "./lib/" - })), - request: "#a/dist/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #2", - expect: Some(vec!["./dist/utils/index.js"]), - imports_field: imports_field(json!({ - "#a/dist/utils/": "./dist/utils/", - "#a/dist/": "./lib/" - })), - request: "#a/dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #3", - expect: Some(vec!["./dist/utils/index.js"]), - imports_field: imports_field(json!({ - "#a/dist/utils/index.js": "./dist/utils/index.js", - "#a/dist/utils/": "./dist/utils/index.mjs", - "#a/dist/": "./lib/" - })), - request: "#a/dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #4", - expect: Some(vec!["./lib/index.mjs"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./browser/" - }, - "#a/dist/": "./lib/" - })), - request: "#a/dist/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #1", - // This behaves differently from enhanced_resolve, because `lodash/` is an an InvalidPackageConfig - // expect: Some(vec!["lodash/index.js"]), - expect: Some(vec!["./utils/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "conditional mapping folder #1", - expect: Some(vec!["./utils/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #2", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./node/" - ] - } - })), - request: "#a/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "conditional mapping folder #3", - expect: Some(vec!["./wpk/index.mjs"]), - imports_field: imports_field(json!({ - "#a/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils/" - ] - } - })), - request: "#a/index.mjs", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "incorrect exports field #1", - // We throw `PackageImportNotDefined` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "/utils/": "./a/" - })), - request: "#a/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #2", - // We throw `PackageImportNotDefined` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "/utils/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#a/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #3", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index": "./a/index.js" - })), - request: "#a/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #4", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index.mjs": "./a/index.js" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #5", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "#a/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #6", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index.mjs": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "#a/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #1", - // We don't throw in `package_imports_exports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": "./a/" - })), - request: "/utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect request #2", - // We don't throw in `package_imports_exports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #3", - // We don't throw in `package_imports_exports_resolve`, it's thrown in `package_imports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #4", - // We don't throw in `package_imports_exports_resolve`, it's thrown in `package_imports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#/", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #5", - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#a/", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #1", - // expect: Some(vec!["./dist/index"]), - expect: Some(vec!["dist/index"]), - imports_field: imports_field(json!({ - "#a/../../utils/": "./dist/" - })), - request: "#a/../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #2", - // We throw InvalidPackageTarget - // expect: Some(vec!["./dist/../../utils/index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "./dist/" - })), - request: "#a/../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #3", - // We throw InvalidPackageTarget - // expect: Some(vec!["../src/index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "../src/" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #4", - // We throw InvalidPackageTarget - // expect: Some(vec!["./utils/../../../index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": { - "browser": "./utils/../../../" - } - })), - request: "#a/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #1", - // expect: Some(vec!["moment/node_modules/lodash/dist/index.js"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": { - "browser": "moment/node_modules/" - } - })), - request: "#a/lodash/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #2", - // We throw InvalidPackageTarget - // expect: Some(vec!["../node_modules/lodash/dist/index.js"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "../node_modules/" - })), - request: "#a/lodash/dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "nested mapping #1", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": "./", - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./node/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "nested mapping #3", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["webpack"], - }, - TestCase { - name: "nested mapping #4", - // We throw NotFound - // expect: Some(vec!["moment/node/index.js"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "moment/node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["node", "browser"], - }, - TestCase { - name: "nested mapping #5", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "node"], - }, - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./node/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - TestCase { - name: "nested mapping #7", - expect: Some(vec!["./y.js"]), - imports_field: imports_field(json!({ - "#a": { - "abc": { - "def": "./x.js" - }, - "ghi": "./y.js" - } - })), - request: "#a", - condition_names: vec!["abc", "ghi"], - }, - TestCase { - name: "nested mapping #8", - // We throw PackageImportNotDefined - // expect: Some(vec![]), - expect: None, - imports_field: imports_field(json!({ - "#a": { - "abc": { - "def": "./x.js", - "default": [] - }, - "ghi": "./y.js" - } - })), - request: "#a", - condition_names: vec!["abc", "ghi"], - }, - ]; - - for case in test_cases { - let resolved = Resolver::default() - .package_imports_exports_resolve( - case.request, - &case.imports_field, - Path::new(""), - true, - &case.condition_names.iter().map(ToString::to_string).collect::>(), - &mut Ctx::default(), - ) - .map(|p| p.map(|p| p.to_path_buf())); - if let Some(expect) = case.expect { - if expect.is_empty() { - assert!(matches!(resolved, Ok(None)), "{} {:?}", &case.name, &resolved); - } else { - for expect in expect { - assert_eq!(resolved, Ok(Some(Path::new(expect).normalize())), "{}", &case.name); - } - } - } else { - assert!(resolved.is_err(), "{} {resolved:?}", &case.name); - } - } -} diff --git a/src/tests/incorrect_description_file.rs b/src/tests/incorrect_description_file.rs deleted file mode 100644 index a5c81796..00000000 --- a/src/tests/incorrect_description_file.rs +++ /dev/null @@ -1,62 +0,0 @@ -//! - -use rustc_hash::FxHashSet; - -use crate::{JSONError, Resolution, ResolveContext, ResolveError, ResolveOptions, Resolver}; - -// should not resolve main in incorrect description file #1 -#[test] -fn incorrect_description_file_1() { - let f = super::fixture().join("incorrect-package"); - let mut ctx = ResolveContext::default(); - let resolution = Resolver::default().resolve_with_context(f.join("pack1"), ".", &mut ctx); - let error = ResolveError::JSON(JSONError { - path: f.join("pack1/package.json"), - message: String::from("EOF while parsing a value at line 3 column 0"), - line: 3, - column: 0, - }); - assert_eq!(resolution, Err(error)); - assert_eq!(ctx.file_dependencies, FxHashSet::from_iter([f.join("pack1/package.json")])); - assert!(ctx.missing_dependencies.is_empty()); -} - -// should not resolve main in incorrect description file #2 -#[test] -fn incorrect_description_file_2() { - let f = super::fixture().join("incorrect-package"); - let resolution = Resolver::default().resolve(f.join("pack2"), "."); - let error = ResolveError::JSON(JSONError { - path: f.join("pack2/package.json"), - message: String::from("EOF while parsing a value at line 1 column 0"), - line: 1, - column: 0, - }); - assert_eq!(resolution, Err(error)); -} - -// should not resolve main in incorrect description file #3 -#[test] -fn incorrect_description_file_3() { - let f = super::fixture().join("incorrect-package"); - let resolution = Resolver::default().resolve(f.join("pack2"), "."); - assert!(resolution.is_err()); -} - -// `enhanced_resolve` does not have this test case -#[test] -fn no_description_file() { - let f = super::fixture_root().join("enhanced_resolve"); - - // has description file - let resolver = Resolver::default(); - assert_eq!( - resolver.resolve(&f, ".").map(Resolution::into_path_buf), - Ok(f.join("lib/index.js")) - ); - - // without description file - let resolver = - Resolver::new(ResolveOptions { description_files: vec![], ..ResolveOptions::default() }); - assert_eq!(resolver.resolve(&f, "."), Err(ResolveError::NotFound(".".into()))); -} diff --git a/src/tests/main_field.rs b/src/tests/main_field.rs deleted file mode 100644 index 3cadc8ce..00000000 --- a/src/tests/main_field.rs +++ /dev/null @@ -1,24 +0,0 @@ -//! Not part of enhanced_resolve's test suite - -use crate::{ResolveOptions, Resolver}; - -#[test] -fn test() { - let f = super::fixture().join("restrictions"); - - let resolver1 = Resolver::new(ResolveOptions { - main_fields: vec!["style".into()], - ..ResolveOptions::default() - }); - - let resolution = resolver1.resolve(&f, "pck2").map(|r| r.full_path()); - assert_eq!(resolution, Ok(f.join("node_modules/pck2/index.css"))); - - let resolver2 = resolver1.clone_with_options(ResolveOptions { - main_fields: vec!["module".into(), "main".into()], - ..ResolveOptions::default() - }); - - let resolution = resolver2.resolve(&f, "pck2").map(|r| r.full_path()); - assert_eq!(resolution, Ok(f.join("node_modules/pck2/module.js"))); -} diff --git a/src/tests/memory_fs.rs b/src/tests/memory_fs.rs deleted file mode 100644 index e4116609..00000000 --- a/src/tests/memory_fs.rs +++ /dev/null @@ -1,74 +0,0 @@ -use std::{ - io, - path::{Path, PathBuf}, -}; - -use crate::{FileMetadata, FileSystem}; - -#[derive(Default)] -pub struct MemoryFS { - fs: vfs::MemoryFS, -} - -impl MemoryFS { - /// # Panics - /// - /// * Fails to create directory - /// * Fails to write file - #[allow(dead_code)] - pub fn new(data: &[(&'static str, &'static str)]) -> Self { - let mut fs = Self { fs: vfs::MemoryFS::default() }; - for (path, content) in data { - fs.add_file(Path::new(path), content); - } - fs - } - - #[allow(dead_code)] - pub fn add_file(&mut self, path: &Path, content: &str) { - use vfs::FileSystem; - let fs = &mut self.fs; - // Create all parent directories - for path in path.ancestors().collect::>().iter().rev() { - let path = path.to_string_lossy(); - if !fs.exists(path.as_ref()).unwrap() { - fs.create_dir(path.as_ref()).unwrap(); - } - } - // Create file - let mut file = fs.create_file(path.to_string_lossy().as_ref()).unwrap(); - file.write_all(content.as_bytes()).unwrap(); - } -} - -impl FileSystem for MemoryFS { - fn read_to_string(&self, path: &Path) -> io::Result { - use vfs::FileSystem; - let mut file = self - .fs - .open_file(path.to_string_lossy().as_ref()) - .map_err(|err| io::Error::new(io::ErrorKind::NotFound, err))?; - let mut buffer = String::new(); - file.read_to_string(&mut buffer).unwrap(); - Ok(buffer) - } - - fn metadata(&self, path: &Path) -> io::Result { - use vfs::FileSystem; - let metadata = self - .fs - .metadata(path.to_string_lossy().as_ref()) - .map_err(|err| io::Error::new(io::ErrorKind::NotFound, err))?; - let is_file = metadata.file_type == vfs::VfsFileType::File; - let is_dir = metadata.file_type == vfs::VfsFileType::Directory; - Ok(FileMetadata::new(is_file, is_dir, false)) - } - - fn symlink_metadata(&self, path: &Path) -> io::Result { - self.metadata(path) - } - - fn canonicalize(&self, _path: &Path) -> io::Result { - Err(io::Error::new(io::ErrorKind::NotFound, "not a symlink")) - } -} diff --git a/src/tests/missing.rs b/src/tests/missing.rs deleted file mode 100644 index 4bf611ef..00000000 --- a/src/tests/missing.rs +++ /dev/null @@ -1,106 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/missing.test.js - -use normalize_path::NormalizePath; - -use crate::{AliasValue, ResolveContext, ResolveOptions, Resolver}; - -#[test] -fn test() { - let f = super::fixture(); - - let data = [ - ( - "./missing-file", - vec![f.join("missing-file"), f.join("missing-file.js"), f.join("missing-file.node")], - ), - ( - "missing-module", - vec![ - f.join("node_modules/missing-module"), - f.parent().unwrap().join("node_modules"), // enhanced-resolve is "node_modules/missing-module" - ], - ), - ( - "missing-module/missing-file", - vec![ - f.join("node_modules/missing-module"), - // f.parent().unwrap().join("node_modules/missing-module"), // we don't report this - ], - ), - ( - "m1/missing-file", - vec![ - f.join("node_modules/m1/missing-file"), - f.join("node_modules/m1/missing-file.js"), - f.join("node_modules/m1/missing-file.node"), - // f.parent().unwrap().join("node_modules/m1"), // we don't report this - ], - ), - ( - "m1/", - vec![ - f.join("node_modules/m1/index"), - f.join("node_modules/m1/index.js"), - f.join("node_modules/m1/index.json"), - f.join("node_modules/m1/index.node"), - ], - ), - ("m1/a", vec![f.join("node_modules/m1/a")]), - ]; - - let resolver = Resolver::default(); - - for (specifier, missing_dependencies) in data { - let mut ctx = ResolveContext::default(); - let _ = resolver.resolve_with_context(&f, specifier, &mut ctx); - - for path in ctx.file_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - } - - for path in missing_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - assert!( - ctx.missing_dependencies.contains(&path), - "{specifier}: {path:?} not in {:?}", - &ctx.missing_dependencies - ); - } - } -} - -#[test] -fn alias_and_extensions() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias: vec![ - ( - "@scope-js/package-name/dir$".into(), - vec![AliasValue::Path(f.join("foo/index.js").to_string_lossy().to_string())], - ), - ( - "react-dom".into(), - vec![AliasValue::Path(f.join("foo/index.js").to_string_lossy().to_string())], - ), - ], - extensions: vec![".server.ts".into()], - - ..ResolveOptions::default() - }); - - let mut ctx = ResolveContext::default(); - let _ = resolver.resolve_with_context(&f, "@scope-js/package-name/dir/router", &mut ctx); - let _ = resolver.resolve_with_context(&f, "react-dom/client", &mut ctx); - - for path in ctx.file_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - } - - for path in ctx.missing_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - if let Some(path) = path.parent() { - assert!(!path.is_file(), "{path:?} must not be a file"); - } - } -} diff --git a/src/tests/mod.rs b/src/tests/mod.rs deleted file mode 100644 index 94e6bd86..00000000 --- a/src/tests/mod.rs +++ /dev/null @@ -1,49 +0,0 @@ -mod alias; -mod browser_field; -mod builtins; -mod dependencies; -mod exports_field; -mod extension_alias; -mod extensions; -mod fallback; -mod full_specified; -mod imports_field; -mod incorrect_description_file; -mod main_field; -mod memory_fs; -mod missing; -mod resolve; -mod restrictions; -mod roots; -mod scoped_packages; -mod simple; -mod symlink; -mod tsconfig_paths; -mod tsconfig_project_references; - -use crate::Resolver; -use std::{env, path::PathBuf, sync::Arc, thread}; - -pub fn fixture_root() -> PathBuf { - env::current_dir().unwrap().join("fixtures") -} - -pub fn fixture() -> PathBuf { - fixture_root().join("enhanced_resolve").join("test").join("fixtures") -} - -#[test] -fn threaded_environment() { - let cwd = env::current_dir().unwrap(); - let resolver = Arc::new(Resolver::default()); - for _ in 0..2 { - _ = thread::spawn({ - let cwd = cwd.clone(); - let resolver = Arc::clone(&resolver); - move || { - _ = resolver.resolve(cwd, "."); - } - }) - .join(); - } -} diff --git a/src/tests/resolve.rs b/src/tests/resolve.rs deleted file mode 100644 index f2dbb88e..00000000 --- a/src/tests/resolve.rs +++ /dev/null @@ -1,119 +0,0 @@ -//! - -use crate::{ResolveError, ResolveOptions, Resolver}; - -#[test] -fn resolve() { - let f = super::fixture(); - - let resolver = Resolver::default(); - - let main1_js_path = f.join("main1.js").to_string_lossy().to_string(); - - #[rustfmt::skip] - let pass = [ - ("absolute path", f.clone(), main1_js_path.as_str(), f.join("main1.js")), - ("file with .js", f.clone(), "./main1.js", f.join("main1.js")), - ("file without extension", f.clone(), "./main1", f.join("main1.js")), - ("another file with .js", f.clone(), "./a.js", f.join("a.js")), - ("another file without extension", f.clone(), "./a", f.join("a.js")), - ("file in module with .js", f.clone(), "m1/a.js", f.join("node_modules/m1/a.js")), - ("file in module without extension", f.clone(), "m1/a", f.join("node_modules/m1/a.js")), - ("another file in module without extension", f.clone(), "complexm/step1", f.join("node_modules/complexm/step1.js")), - ("from submodule to file in sibling module", f.join("node_modules/complexm"), "m2/b.js", f.join("node_modules/m2/b.js")), - ("from nested directory to overwritten file in module", f.join("multiple_modules"), "m1/a.js", f.join("multiple_modules/node_modules/m1/a.js")), - ("from nested directory to not overwritten file in module", f.join("multiple_modules"), "m1/b.js", f.join("node_modules/m1/b.js")), - ("file with query", f.clone(), "./main1.js?query", f.join("main1.js?query")), - ("file with fragment", f.clone(), "./main1.js#fragment", f.join("main1.js#fragment")), - ("file with fragment and query", f.clone(), "./main1.js#fragment?query", f.join("main1.js#fragment?query")), - ("file with query and fragment", f.clone(), "./main1.js?#fragment", f.join("main1.js?#fragment")), - - ("file with query (unicode)", f.clone(), "./测试.js?query", f.join("测试.js?query")), - ("file with fragment (unicode)", f.clone(), "./测试.js#fragment", f.join("测试.js#fragment")), - ("file with fragment and query (unicode)", f.clone(), "./测试.js#fragment?query", f.join("测试.js#fragment?query")), - ("file with query and fragment (unicode)", f.clone(), "./测试.js?#fragment", f.join("测试.js?#fragment")), - - ("file in module with query", f.clone(), "m1/a?query", f.join("node_modules/m1/a.js?query")), - ("file in module with fragment", f.clone(), "m1/a#fragment", f.join("node_modules/m1/a.js#fragment")), - ("file in module with fragment and query", f.clone(), "m1/a#fragment?query", f.join("node_modules/m1/a.js#fragment?query")), - ("file in module with query and fragment", f.clone(), "m1/a?#fragment", f.join("node_modules/m1/a.js?#fragment")), - ("file in module with query and fragment", f.clone(), "m1/a?#fragment", f.join("node_modules/m1/a.js?#fragment")), - ("differ between directory and file, resolve file", f.clone(), "./dirOrFile", f.join("dirOrFile.js")), - ("differ between directory and file, resolve directory", f.clone(), "./dirOrFile/", f.join("dirOrFile/index.js")), - ("find node_modules outside of node_modules", f.join("browser-module/node_modules"), "m1/a", f.join("node_modules/m1/a.js")), - ("don't crash on main field pointing to self", f.clone(), "./main-field-self", f.join("./main-field-self/index.js")), - ("don't crash on main field pointing to self (2)", f.clone(), "./main-field-self2", f.join("./main-field-self2/index.js")), - // enhanced-resolve has `#` prepended with a `\0`, they are removed from the - // following 3 expected test results. - // See https://github.com/webpack/enhanced-resolve#escaping - ("handle fragment edge case (no fragment)", f.clone(), "./no#fragment/#/#", f.join("no#fragment/#/#.js")), - ("handle fragment edge case (fragment)", f.clone(), "./no#fragment/#/", f.join("no.js#fragment/#/")), - ("handle fragment escaping", f.clone(), "./no\0#fragment/\0#/\0##fragment", f.join("no#fragment/#/#.js#fragment")), - - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn issue238_resolve() { - let f = super::fixture().join("issue-238"); - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into(), ".jsx".into(), ".ts".into(), ".tsx".into()], - modules: vec!["src/a".into(), "src/b".into(), "src/common".into(), "node_modules".into()], - ..ResolveOptions::default() - }); - let resolved_path = - resolver.resolve(f.join("src/common"), "config/myObjectFile").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("src/common/config/myObjectFile.js")),); -} - -#[test] -fn prefer_relative() { - let f = super::fixture(); - - let resolver = - Resolver::new(ResolveOptions { prefer_relative: true, ..ResolveOptions::default() }); - - #[rustfmt::skip] - let pass = [ - ("should correctly resolve with preferRelative 1", "main1.js", f.join("main1.js")), - ("should correctly resolve with preferRelative 2", "m1/a.js", f.join("node_modules/m1/a.js")), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } -} - -#[test] -fn resolve_to_context() { - let f = super::fixture(); - let resolver = - Resolver::new(ResolveOptions { resolve_to_context: true, ..ResolveOptions::default() }); - - #[rustfmt::skip] - let data = [ - ("context for fixtures", f.clone(), "./", f.clone()), - ("context for fixtures/lib", f.clone(), "./lib", f.join("lib")), - ("context for fixtures with ..", f.clone(), "./lib/../../fixtures/./lib/..", f.clone()), - ("context for fixtures with query", f.clone(), "./?query", f.clone().with_file_name("fixtures?query")), - ]; - - for (comment, path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn resolve_hash_as_module() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions::default()); - let resolution = resolver.resolve(f, "#a"); - assert_eq!(resolution, Err(ResolveError::NotFound("#a".into()))); -} diff --git a/src/tests/restrictions.rs b/src/tests/restrictions.rs deleted file mode 100644 index 5ba56596..00000000 --- a/src/tests/restrictions.rs +++ /dev/null @@ -1,25 +0,0 @@ -//! - -use crate::{ResolveError, ResolveOptions, Resolver, Restriction}; - -// TODO: regex -// * should respect RegExp restriction -// * should try to find alternative #1 -// * should try to find alternative #2 -// * should try to find alternative #3 - -// should respect string restriction -#[test] -fn restriction1() { - let fixture = super::fixture(); - let f = fixture.join("restrictions"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - restrictions: vec![Restriction::Path(f.clone())], - ..ResolveOptions::default() - }); - - let resolution = resolver.resolve(&f, "pck2"); - assert_eq!(resolution, Err(ResolveError::Restriction(fixture.join("c.js"), f))); -} diff --git a/src/tests/roots.rs b/src/tests/roots.rs deleted file mode 100644 index b50e2a07..00000000 --- a/src/tests/roots.rs +++ /dev/null @@ -1,92 +0,0 @@ -//! - -use std::path::PathBuf; - -use crate::{AliasValue, ResolveError, ResolveOptions, Resolver}; - -fn dirname() -> PathBuf { - super::fixture_root().join("enhanced_resolve").join("test") -} - -#[test] -fn roots() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - alias: vec![("foo".into(), vec![AliasValue::from("/fixtures")])], - roots: vec![dirname(), f.clone()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should respect roots option", "/fixtures/b.js", f.join("b.js")), - ("should try another root option, if it exists", "/b.js", f.join("b.js")), - ("should respect extension", "/fixtures/b", f.join("b.js")), - ("should resolve in directory", "/fixtures/extensions/dir", f.join("extensions/dir/index.js")), - ("should respect aliases", "foo/b", f.join("b.js")), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } - - #[rustfmt::skip] - let fail = [ - ("should not work with relative path", "fixtures/b.js", ResolveError::NotFound("fixtures/b.js".into())) - ]; - - for (comment, request, expected) in fail { - let resolution = resolver.resolve(&f, request); - assert_eq!(resolution, Err(expected), "{comment} {request}"); - } -} - -#[test] -fn resolve_to_context() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - roots: vec![dirname(), f.clone()], - resolve_to_context: true, - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f, "/fixtures/lib").map(|r| r.full_path()); - let expected = f.join("lib"); - assert_eq!(resolved_path, Ok(expected)); -} - -#[test] -fn prefer_absolute() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - alias: vec![("foo".into(), vec![AliasValue::from("/fixtures")])], - roots: vec![dirname(), f.clone()], - prefer_absolute: true, - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve an absolute path (prefer absolute)", f.join("b.js").to_string_lossy().to_string(), f.join("b.js")), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(&f, &request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } -} - -#[test] -fn roots_fall_through() { - let f = super::fixture(); - let absolute_path = f.join("roots_fall_through/index.js"); - let specifier = absolute_path.to_string_lossy(); - let resolution = Resolver::new(ResolveOptions::default().with_root(&f)).resolve(&f, &specifier); - assert_eq!( - resolution.map(super::super::resolution::Resolution::into_path_buf), - Ok(absolute_path) - ); -} diff --git a/src/tests/scoped_packages.rs b/src/tests/scoped_packages.rs deleted file mode 100644 index 8258f00f..00000000 --- a/src/tests/scoped_packages.rs +++ /dev/null @@ -1,25 +0,0 @@ -//! - -use crate::{ResolveOptions, Resolver}; - -#[test] -fn scoped_packages() { - let f = super::fixture().join("scoped"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("main field should work", f.clone(), "@scope/pack1", f.join("./node_modules/@scope/pack1/main.js")), - ("browser field should work", f.clone(), "@scope/pack2", f.join("./node_modules/@scope/pack2/main.js")), - ("folder request should work", f.clone(), "@scope/pack2/lib", f.join("./node_modules/@scope/pack2/lib/index.js")) - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} diff --git a/src/tests/simple.rs b/src/tests/simple.rs deleted file mode 100644 index 08e1238a..00000000 --- a/src/tests/simple.rs +++ /dev/null @@ -1,68 +0,0 @@ -//! - -use std::env; - -use crate::Resolver; - -#[test] -fn simple() { - // mimic `enhanced-resolve/test/simple.test.js` - let dirname = env::current_dir().unwrap().join("fixtures"); - let f = dirname.join("enhanced_resolve/test"); - - let resolver = Resolver::default(); - - let data = [ - ("direct", f.clone(), "../lib/index"), - ("as directory", f, ".."), - ("as module", dirname.clone(), "./enhanced_resolve"), - ]; - - for (comment, path, request) in data { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - let expected = dirname.join("enhanced_resolve/lib/index.js"); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn dashed_name() { - let f = super::fixture(); - - let resolver = Resolver::default(); - - let data = [ - (f.clone(), "dash", f.join("node_modules/dash/index.js")), - (f.clone(), "dash-name", f.join("node_modules/dash-name/index.js")), - (f.join("node_modules/dash"), "dash", f.join("node_modules/dash/index.js")), - (f.join("node_modules/dash"), "dash-name", f.join("node_modules/dash-name/index.js")), - (f.join("node_modules/dash-name"), "dash", f.join("node_modules/dash/index.js")), - (f.join("node_modules/dash-name"), "dash-name", f.join("node_modules/dash-name/index.js")), - ]; - - for (path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{path:?} {request}"); - } -} - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows { - use super::super::memory_fs::MemoryFS; - - use crate::ResolveOptions; - - #[test] - fn no_package() { - use crate::ResolverGeneric; - use std::path::Path; - let f = Path::new("/"); - let file_system = MemoryFS::new(&[]); - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions::default(), - ); - let resolved_path = resolver.resolve(f, "package"); - assert!(resolved_path.is_err()); - } -} diff --git a/src/tests/symlink.rs b/src/tests/symlink.rs deleted file mode 100644 index 7589b560..00000000 --- a/src/tests/symlink.rs +++ /dev/null @@ -1,121 +0,0 @@ -use std::{fs, io, path::Path}; - -use crate::{ResolveOptions, Resolver}; - -#[derive(Debug, Clone, Copy)] -enum FileType { - File, - Dir, -} - -#[allow(unused_variables)] -fn symlink, Q: AsRef>( - original: P, - link: Q, - file_type: FileType, -) -> io::Result<()> { - #[cfg(target_family = "unix")] - { - std::os::unix::fs::symlink(original, link) - } - - #[cfg(target_family = "windows")] - match file_type { - FileType::File => std::os::windows::fs::symlink_file(original, link), - FileType::Dir => std::os::windows::fs::symlink_dir(original, link), - } -} - -fn init(dirname: &Path, temp_path: &Path) -> io::Result<()> { - if temp_path.exists() { - _ = fs::remove_dir_all(temp_path); - } - fs::create_dir(temp_path)?; - symlink(dirname.join("../lib/index.js"), temp_path.join("test"), FileType::File)?; - symlink(dirname.join("../lib"), temp_path.join("test2"), FileType::Dir)?; - fs::remove_file(temp_path.join("test"))?; - fs::remove_file(temp_path.join("test2"))?; - fs::remove_dir(temp_path) -} - -fn create_symlinks(dirname: &Path, temp_path: &Path) -> io::Result<()> { - fs::create_dir(temp_path).unwrap(); - symlink( - dirname.join("../lib/index.js").canonicalize().unwrap(), - temp_path.join("index.js"), - FileType::File, - )?; - symlink(dirname.join("../lib").canonicalize().unwrap(), temp_path.join("lib"), FileType::Dir)?; - symlink(dirname.join("..").canonicalize().unwrap(), temp_path.join("this"), FileType::Dir)?; - symlink(temp_path.join("this"), temp_path.join("that"), FileType::Dir)?; - symlink(Path::new("../../lib/index.js"), temp_path.join("node.relative.js"), FileType::File)?; - symlink( - Path::new("./node.relative.js"), - temp_path.join("node.relative.sym.js"), - FileType::File, - )?; - Ok(()) -} - -fn cleanup_symlinks(temp_path: &Path) { - _ = fs::remove_dir_all(temp_path); -} - -#[test] -fn test() -> io::Result<()> { - let root = super::fixture_root().join("enhanced_resolve"); - let dirname = root.join("test"); - let temp_path = dirname.join("temp"); - if !temp_path.exists() { - let is_admin = init(&dirname, &temp_path).is_ok(); - if !is_admin { - return Ok(()); - } - if let Err(err) = create_symlinks(&dirname, &temp_path) { - cleanup_symlinks(&temp_path); - return Err(err); - } - } - - let resolver_without_symlinks = - Resolver::new(ResolveOptions { symlinks: false, ..ResolveOptions::default() }); - let resolver_with_symlinks = Resolver::default(); - - #[rustfmt::skip] - let pass = [ - ("with a symlink to a file", temp_path.clone(), "./index.js"), - ("with a relative symlink to a file", temp_path.clone(), "./node.relative.js"), - ("with a relative symlink to a symlink to a file", temp_path.clone(), "./node.relative.sym.js"), - ("with a symlink to a directory 1", temp_path.clone(), "./lib/index.js"), - ("with a symlink to a directory 2", temp_path.clone(), "./this/lib/index.js"), - ("with multiple symlinks in the path 1", temp_path.clone(), "./this/test/temp/index.js"), - ("with multiple symlinks in the path 2", temp_path.clone(), "./this/test/temp/lib/index.js"), - ("with multiple symlinks in the path 3", temp_path.clone(), "./this/test/temp/this/lib/index.js"), - ("with a symlink to a directory 2 (chained)", temp_path.clone(), "./that/lib/index.js"), - ("with multiple symlinks in the path 1 (chained)", temp_path.clone(), "./that/test/temp/index.js"), - ("with multiple symlinks in the path 2 (chained)", temp_path.clone(), "./that/test/temp/lib/index.js"), - ("with multiple symlinks in the path 3 (chained)", temp_path.clone(), "./that/test/temp/that/lib/index.js"), - ("with symlinked directory as context 1", temp_path.join( "lib"), "./index.js"), - ("with symlinked directory as context 2", temp_path.join( "this"), "./lib/index.js"), - ("with symlinked directory as context and in path", temp_path.join( "this"), "./test/temp/lib/index.js"), - ("with symlinked directory in context path", temp_path.join( "this/lib"), "./index.js"), - ("with symlinked directory in context path and symlinked file", temp_path.join( "this/test"), "./temp/index.js"), - ("with symlinked directory in context path and symlinked directory", temp_path.join( "this/test"), "./temp/lib/index.js"), - ("with symlinked directory as context 2 (chained)", temp_path.join( "that"), "./lib/index.js"), - ("with symlinked directory as context and in path (chained)", temp_path.join( "that"), "./test/temp/lib/index.js"), - ("with symlinked directory in context path (chained)", temp_path.join( "that/lib"), "./index.js"), - ("with symlinked directory in context path and symlinked file (chained)", temp_path.join( "that/test"), "./temp/index.js"), - ("with symlinked directory in context path and symlinked directory (chained)", temp_path.join( "that/test"), "./temp/lib/index.js") - ]; - - for (comment, path, request) in pass { - let filename = resolver_with_symlinks.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(filename, Ok(root.join("lib/index.js")), "{comment:?}"); - - let resolved_path = - resolver_without_symlinks.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(path.join(request))); - } - - Ok(()) -} diff --git a/src/tests/tsconfig_paths.rs b/src/tests/tsconfig_paths.rs deleted file mode 100644 index 26935b5c..00000000 --- a/src/tests/tsconfig_paths.rs +++ /dev/null @@ -1,507 +0,0 @@ -//! tests for tsconfig-paths -//! -//! Fixtures copied from . - -use std::path::{Path, PathBuf}; - -use crate::{ - ResolveError, ResolveOptions, Resolver, TsConfig, TsconfigOptions, TsconfigReferences, -}; - -// -#[test] -fn tsconfig() { - let f = super::fixture_root().join("tsconfig"); - - #[rustfmt::skip] - let pass = [ - (f.clone(), None, "ts-path", f.join("foo.js")), - (f.join("nested"), None, "ts-path", f.join("nested/test.js")), - (f.join("cases/index"), None, "foo", f.join("node_modules/tsconfig-index/foo.js")), - // This requires reading package.json.tsconfig field - // (f.join("cases/field"), "foo", f.join("node_modules/tsconfig-field/foo.js")) - (f.join("cases/exports"), None, "foo", f.join("node_modules/tsconfig-exports/foo.js")), - (f.join("cases/extends-extension"), None, "foo", f.join("cases/extends-extension/foo.js")), - (f.join("cases/extends-extensionless"), None, "foo", f.join("node_modules/tsconfig-field/foo.js")), - (f.join("cases/extends-paths"), Some("src"), "@/index", f.join("cases/extends-paths/src/index.js")), - (f.join("cases/extends-multiple"), None, "foo", f.join("cases/extends-multiple/foo.js")), - ]; - - for (dir, subdir, request, expected) in pass { - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: dir.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - let path = subdir.map_or(dir.clone(), |subdir| dir.join(subdir)); - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{request} {path:?}"); - } - - #[rustfmt::skip] - let data = [ - (f.join("node_modules/tsconfig-not-used"), "ts-path", Ok(f.join("foo.js"))), - ]; - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - for (path, request, expected) in data { - let resolution = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolution, expected, "{path:?} {request}"); - } -} - -#[test] -fn tsconfig_fallthrough() { - let f = super::fixture_root().join("tsconfig"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "/"); - assert_eq!(resolved_path, Err(ResolveError::NotFound("/".into()))); -} - -#[test] -fn json_with_comments() { - let f = super::fixture_root().join("tsconfig/cases/trailing-comma"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "foo").map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(f.join("bar.js"))); -} - -// -#[test] -fn test_paths() { - let path = Path::new("/foo/tsconfig.json"); - let mut tsconfig_json = serde_json::json!({ - "compilerOptions": { - "paths": { - "jquery": ["node_modules/jquery/dist/jquery"], - "*": ["generated/*"], - "bar/*": ["test/*"], - "bar/baz/*": ["baz/*", "yo/*"], - "@/components/*": ["components/*"], - "url": ["node_modules/my-url"], - } - } - }) - .to_string(); - let tsconfig = TsConfig::parse(true, path, &mut tsconfig_json).unwrap(); - - let data = [ - ("jquery", vec!["/foo/node_modules/jquery/dist/jquery"]), - ("test", vec!["/foo/generated/test"]), - ("test/hello", vec!["/foo/generated/test/hello"]), - ("bar/hi", vec!["/foo/test/hi"]), - ("bar/baz/hi", vec!["/foo/baz/hi", "/foo/yo/hi"]), - ("@/components/button", vec!["/foo/components/button"]), - ("./jquery", vec![]), - ("url", vec!["/foo/node_modules/my-url"]), - ]; - - for (specifier, expected) in data { - let paths = tsconfig.resolve_path_alias(specifier); - let expected = expected.into_iter().map(PathBuf::from).collect::>(); - assert_eq!(paths, expected, "{specifier}"); - } -} - -// -#[test] -fn test_base_url() { - let path = Path::new("/foo/tsconfig.json"); - let mut tsconfig_json = serde_json::json!({ - "compilerOptions": { - "baseUrl": "./src" - } - }) - .to_string(); - let tsconfig = TsConfig::parse(true, path, &mut tsconfig_json).unwrap(); - - let data = [ - ("foo", vec!["/foo/src/foo"]), - ("components/button", vec!["/foo/src/components/button"]), - ("./jquery", vec![]), - ]; - - for (specifier, expected) in data { - let paths = tsconfig.resolve_path_alias(specifier); - let expected = expected.into_iter().map(PathBuf::from).collect::>(); - assert_eq!(paths, expected, "{specifier}"); - } -} - -// -#[test] -fn test_paths_and_base_url() { - let path = Path::new("/foo/tsconfig.json"); - let mut tsconfig_json = serde_json::json!({ - "compilerOptions": { - "baseUrl": "./src", - "paths": { - "*": ["generated/*"], - "bar/*": ["test/*"], - "bar/baz/*": ["baz/*", "yo/*"], - "@/components/*": ["components/*"] - } - } - }) - .to_string(); - let tsconfig = TsConfig::parse(true, path, &mut tsconfig_json).unwrap(); - - let data = [ - ("test", vec!["/foo/src/generated/test", "/foo/src/test"]), - ("test/hello", vec!["/foo/src/generated/test/hello", "/foo/src/test/hello"]), - ("bar/hi", vec!["/foo/src/test/hi", "/foo/src/bar/hi"]), - ("bar/baz/hi", vec!["/foo/src/baz/hi", "/foo/src/yo/hi", "/foo/src/bar/baz/hi"]), - ("@/components/button", vec!["/foo/src/components/button", "/foo/src/@/components/button"]), - ("./jquery", vec![]), - ]; - - for (specifier, expected) in data { - let paths = tsconfig.resolve_path_alias(specifier); - let expected = expected.into_iter().map(PathBuf::from).collect::>(); - assert_eq!(paths, expected, "{specifier}"); - } -} - -// Template variable ${configDir} for substitution of config files directory path -// https://github.com/microsoft/TypeScript/pull/58042 -#[test] -fn test_template_variable() { - let f = super::fixture_root().join("tsconfig"); - let f2 = f.join("cases").join("paths_template_variable"); - - #[rustfmt::skip] - let pass = [ - (f2.clone(), "tsconfig1.json", "foo", f2.join("foo.js")), - (f2.clone(), "tsconfig2.json", "foo", f2.join("foo.js")), - (f.clone(), "tsconfig_template_variable.json", "foo", f.join("foo.js")), - ]; - - for (dir, tsconfig, request, expected) in pass { - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: dir.join(tsconfig), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&dir, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{request} {tsconfig} {dir:?}"); - } -} - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows_test { - use std::path::{Path, PathBuf}; - - use crate::{ - ResolveError, ResolveOptions, ResolverGeneric, TsconfigOptions, TsconfigReferences, - }; - - use super::super::memory_fs::MemoryFS; - - struct OneTest { - name: &'static str, - tsconfig: String, - package_json: Option<(PathBuf, String)>, - main_fields: Option>, - existing_files: Vec<&'static str>, - requested_module: &'static str, - expected_path: &'static str, - extensions: Vec, - } - - impl Default for OneTest { - fn default() -> Self { - Self { - name: "", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/*": ["location/*"] - } - } - }) - .to_string(), - package_json: None, - main_fields: None, - existing_files: vec![], - requested_module: "", - expected_path: "", - extensions: vec![ - ".js".into(), - ".json".into(), - ".node".into(), - ".ts".into(), - ".tsx".into(), - ], - } - } - } - - impl OneTest { - fn resolver(&self, root: &Path) -> ResolverGeneric { - let mut file_system = MemoryFS::default(); - - file_system.add_file(&root.join("tsconfig.json"), &self.tsconfig); - if let Some((path, package_json)) = &self.package_json { - file_system.add_file(&root.join(path).join("package.json"), package_json); - } - for path in &self.existing_files { - file_system.add_file(Path::new(path), ""); - } - - let mut options = ResolveOptions { - extensions: self.extensions.clone(), - tsconfig: Some(TsconfigOptions { - config_file: root.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }; - if let Some(main_fields) = &self.main_fields { - options.main_fields.clone_from(main_fields); - } - - ResolverGeneric::::new_with_file_system(file_system, options) - } - } - - // Path matching tests from tsconfig-paths - // * - // * - #[test] - fn match_path() { - let pass = [ - OneTest { - name: "should locate path that matches with star and exists", - existing_files: vec!["/root/location/mylib/index.ts"], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve to correct path when many are specified", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/*": ["foo1/*", "foo2/*", "location/*", "foo3/*"], - } - } - }) - .to_string(), - existing_files: vec!["/root/location/mylib/index.ts"], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should locate path that matches with star and prioritize pattern with longest prefix", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "*": ["location/*"], - "lib/*": ["location/*"], - } - } - }) - .to_string(), - existing_files: vec![ - "/root/location/lib/mylib/index.ts", - "/root/location/mylib/index.ts", - ], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should locate path that matches with star and exists with extension", - existing_files: vec![ - "/root/location/mylib.myext", - ], - requested_module: "lib/mylib", - extensions: vec![".js".into(), ".myext".into()], - expected_path: "/root/location/mylib.myext", - ..OneTest::default() - }, - OneTest { - name: "should resolve request with extension specified", - existing_files: vec![ - "/root/location/test.jpg", - ], - requested_module: "lib/test.jpg", - expected_path: "/root/location/test.jpg", - ..OneTest::default() - }, - OneTest { - name: "should locate path that matches without star and exists", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/foo": ["location/foo"] - } - } - }) - .to_string(), - existing_files: vec![ - "/root/location/foo.ts", - ], - requested_module: "lib/foo", - expected_path: "/root/location/foo.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve to parent folder when filename is in subfolder", - existing_files: vec![ - "/root/location/mylib/index.ts", - ], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve from main field in package.json", - package_json: Some((PathBuf::from("/root/location/mylib"), serde_json::json!({ - "main": "./kalle.ts" - }).to_string())), - existing_files: vec![ - "/root/location/mylib/kalle.ts", - ], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/kalle.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve from main field in package.json (js)", - package_json: Some((PathBuf::from("/root/location/mylib.js"), serde_json::json!({ - "main": "./kalle.js" - }).to_string())), - existing_files: vec![ - "/root/location/mylib.js/kalle.js", - ], - extensions: vec![".ts".into(), ".js".into()], - requested_module: "lib/mylib.js", - expected_path: "/root/location/mylib.js/kalle.js", - ..OneTest::default() - }, - OneTest { - name: "should resolve from list of fields by priority in package.json", - main_fields: Some(vec!["missing".into(), "browser".into(), "main".into()]), - package_json: Some((PathBuf::from("/root/location/mylibjs"), serde_json::json!({ - "main": "./main.js", - "browser": "./browser.js" - }).to_string())), - existing_files: vec![ - "/root/location/mylibjs/main.js", - "/root/location/mylibjs/browser.js", - ], - extensions: vec![".ts".into(), ".js".into()], - requested_module: "lib/mylibjs", - expected_path: "/root/location/mylibjs/browser.js", - ..OneTest::default() - }, -OneTest { - name: "should ignore field mappings to missing files in package.json", - main_fields: Some(vec!["browser".into(), "main".into()]), - package_json: Some((PathBuf::from("/root/location/mylibjs"), serde_json::json!({ - "main": "./kalle.js", - "browser": "./nope.js" - }).to_string())), - existing_files: vec![ - "/root/location/mylibjs/kalle.js", - ], - extensions: vec![".ts".into(), ".js".into()], - requested_module: "lib/mylibjs", - expected_path: "/root/location/mylibjs/kalle.js", - ..OneTest::default() - }, - // Tests that are not applicable: - // name: "should resolve nested main fields" - // name: "should ignore advanced field mappings in package.json" - // name: "should resolve to with the help of baseUrl when not explicitly set" - // name: "should not resolve with the help of baseUrl when asked not to" - // name: "should resolve main file with cjs file extension" - OneTest { - name: "should resolve .ts from .js alias", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "@/*": ["src/*"] - } - } - }).to_string(), - existing_files: vec![ - "/root/src/foo.ts", - ], - requested_module: "@/foo", // original data was "@/foo.ts" but I don't get why it is the case? - expected_path: "/root/src/foo.ts", // original data was "/root/src/foo" - ..OneTest::default() - }, - ]; - - let root = PathBuf::from("/root"); - - for test in pass { - let resolved_path = - test.resolver(&root).resolve(&root, test.requested_module).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(PathBuf::from(test.expected_path)), "{}", test.name); - } - - let fail = [ - OneTest { - name: "should not locate path that does not match", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/*": ["location/*"] - } - } - }) - .to_string(), - existing_files: vec!["/root/location/mylib"], - requested_module: "lib/mylibjs", - ..OneTest::default() - }, - OneTest { - name: "should not resolve typings file (index.d.ts)", - existing_files: vec!["/root/location/mylib/index.d.ts"], - requested_module: "lib/mylib", - ..OneTest::default() - }, - ]; - - for test in fail { - let resolved_path = - test.resolver(&root).resolve(&root, test.requested_module).map(|f| f.full_path()); - assert_eq!( - resolved_path, - Err(ResolveError::NotFound(test.requested_module.into())), - "{}", - test.name - ); - } - } -} diff --git a/src/tests/tsconfig_project_references.rs b/src/tests/tsconfig_project_references.rs deleted file mode 100644 index b552fefe..00000000 --- a/src/tests/tsconfig_project_references.rs +++ /dev/null @@ -1,101 +0,0 @@ -//! Tests for tsconfig project references - -use crate::{ResolveError, ResolveOptions, Resolver, TsconfigOptions, TsconfigReferences}; - -#[test] -fn auto() { - let f = super::fixture_root().join("tsconfig/cases/project_references"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("app"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - // Test normal paths alias - (f.join("app"), "@/index.ts", f.join("app/aliased/index.ts")), - (f.join("app"), "@/../index.ts", f.join("app/index.ts")), - // Test project reference - (f.join("project_a"), "@/index.ts", f.join("project_a/aliased/index.ts")), - (f.join("project_b/src"), "@/index.ts", f.join("project_b/src/aliased/index.ts")), - // Does not have paths alias - (f.join("project_a"), "./index.ts", f.join("project_a/index.ts")), - (f.join("project_c"), "./index.ts", f.join("project_c/index.ts")), - // Template variable - { - let dir = f.parent().unwrap().join("paths_template_variable"); - (dir.clone(), "foo", dir.join("foo.js")) - } - ]; - - for (path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{request} {path:?}"); - } -} - -#[test] -fn disabled() { - let f = super::fixture_root().join("tsconfig/cases/project_references"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("app"), - references: TsconfigReferences::Disabled, - }), - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - // Test normal paths alias - (f.join("app"), "@/index.ts", Ok(f.join("app/aliased/index.ts"))), - (f.join("app"), "@/../index.ts", Ok(f.join("app/index.ts"))), - // Test project reference - (f.join("project_a"), "@/index.ts", Err(ResolveError::NotFound("@/index.ts".into()))), - (f.join("project_b/src"), "@/index.ts", Err(ResolveError::NotFound("@/index.ts".into()))), - // Does not have paths alias - (f.join("project_a"), "./index.ts", Ok(f.join("project_a/index.ts"))), - (f.join("project_c"), "./index.ts", Ok(f.join("project_c/index.ts"))), - ]; - - for (path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, expected, "{request} {path:?}"); - } -} - -#[test] -fn manual() { - let f = super::fixture_root().join("tsconfig/cases/project_references"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("app"), - references: TsconfigReferences::Paths(vec!["../project_a/conf.json".into()]), - }), - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - // Test normal paths alias - (f.join("app"), "@/index.ts", Ok(f.join("app/aliased/index.ts"))), - (f.join("app"), "@/../index.ts", Ok(f.join("app/index.ts"))), - // Test project reference - (f.join("project_a"), "@/index.ts", Ok(f.join("project_a/aliased/index.ts"))), - (f.join("project_b/src"), "@/index.ts", Err(ResolveError::NotFound("@/index.ts".into()))), - // Does not have paths alias - (f.join("project_a"), "./index.ts", Ok(f.join("project_a/index.ts"))), - (f.join("project_c"), "./index.ts", Ok(f.join("project_c/index.ts"))), - ]; - - for (path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, expected, "{request} {path:?}"); - } -} diff --git a/src/tsconfig.rs b/src/tsconfig.rs deleted file mode 100644 index aa00f6e4..00000000 --- a/src/tsconfig.rs +++ /dev/null @@ -1,212 +0,0 @@ -use std::{ - path::{Path, PathBuf}, - sync::Arc, -}; - -use serde::Deserialize; -use typescript_tsconfig_json::{CompilerOptionsPathsMap, ExtendsField}; - -use crate::PathUtil; - -#[derive(Debug, Deserialize)] -#[serde(rename_all = "camelCase")] -pub struct TsConfig { - /// Whether this is the caller tsconfig. - /// Used for final template variable substitution when all configs are extended and merged. - #[serde(skip)] - root: bool, - - /// Path to `tsconfig.json`. Contains the `tsconfig.json` filename. - #[serde(skip)] - path: PathBuf, - - #[serde(default)] - pub extends: Option, - - #[serde(default)] - pub compiler_options: CompilerOptions, - - /// Bubbled up project references with a reference to their tsconfig. - #[serde(default)] - pub references: Vec, -} - -/// Compiler Options -/// -/// -#[derive(Debug, Default, Deserialize)] -#[serde(rename_all = "camelCase")] -pub struct CompilerOptions { - base_url: Option, - - /// Path aliases - paths: Option, - - /// The actual base for where path aliases are resolved from. - #[serde(skip)] - paths_base: PathBuf, -} - -/// Project Reference -/// -/// -#[derive(Debug, Deserialize)] -pub struct ProjectReference { - /// The path property of each reference can point to a directory containing a tsconfig.json file, - /// or to the config file itself (which may have any name). - pub path: PathBuf, - - /// Reference to the resolved tsconfig - #[serde(skip)] - pub tsconfig: Option>, -} - -impl TsConfig { - pub fn parse(root: bool, path: &Path, json: &mut str) -> Result { - _ = json_strip_comments::strip(json); - let mut tsconfig: Self = serde_json::from_str(json)?; - tsconfig.root = root; - tsconfig.path = path.to_path_buf(); - let directory = tsconfig.directory().to_path_buf(); - if let Some(base_url) = tsconfig.compiler_options.base_url { - tsconfig.compiler_options.base_url = Some(directory.normalize_with(base_url)); - } - if tsconfig.compiler_options.paths.is_some() { - tsconfig.compiler_options.paths_base = - tsconfig.compiler_options.base_url.as_ref().map_or(directory, Clone::clone); - } - Ok(tsconfig) - } - - pub fn build(mut self) -> Self { - if self.root { - let dir = self.directory().to_path_buf(); - // Substitute template variable in `tsconfig.compilerOptions.paths` - if let Some(paths) = &mut self.compiler_options.paths { - for paths in paths.values_mut() { - for path in paths { - Self::substitute_template_variable(&dir, path); - } - } - } - } - self - } - - /// Directory to `tsconfig.json` - /// - /// # Panics - /// - /// * When the `tsconfig.json` path is misconfigured. - pub fn directory(&self) -> &Path { - debug_assert!(self.path.file_name().is_some()); - self.path.parent().unwrap() - } - - pub fn extend_tsconfig(&mut self, tsconfig: &Self) { - let compiler_options = &mut self.compiler_options; - if compiler_options.paths.is_none() { - compiler_options.paths_base = compiler_options - .base_url - .as_ref() - .map_or_else(|| tsconfig.compiler_options.paths_base.clone(), Clone::clone); - compiler_options.paths.clone_from(&tsconfig.compiler_options.paths); - } - if compiler_options.base_url.is_none() { - compiler_options.base_url.clone_from(&tsconfig.compiler_options.base_url); - } - } - - pub fn resolve(&self, path: &Path, specifier: &str) -> Vec { - if path.starts_with(self.base_path()) { - let paths = self.resolve_path_alias(specifier); - if !paths.is_empty() { - return paths; - } - } - for tsconfig in self.references.iter().filter_map(|reference| reference.tsconfig.as_ref()) { - if path.starts_with(tsconfig.base_path()) { - return tsconfig.resolve_path_alias(specifier); - } - } - vec![] - } - - // Copied from parcel - // - pub fn resolve_path_alias(&self, specifier: &str) -> Vec { - if specifier.starts_with(|s| s == '/' || s == '.') { - return vec![]; - } - - let base_url_iter = self - .compiler_options - .base_url - .as_ref() - .map_or_else(Vec::new, |base_url| vec![base_url.normalize_with(specifier)]); - - let Some(paths_map) = &self.compiler_options.paths else { - return base_url_iter; - }; - - let paths = paths_map.get(specifier).map_or_else( - || { - let mut longest_prefix_length = 0; - let mut longest_suffix_length = 0; - let mut best_key: Option<&String> = None; - - for key in paths_map.keys() { - if let Some((prefix, suffix)) = key.split_once('*') { - if (best_key.is_none() || prefix.len() > longest_prefix_length) - && specifier.starts_with(prefix) - && specifier.ends_with(suffix) - { - longest_prefix_length = prefix.len(); - longest_suffix_length = suffix.len(); - best_key.replace(key); - } - } - } - - best_key.and_then(|key| paths_map.get(key)).map_or_else(Vec::new, |paths| { - paths - .iter() - .map(|path| { - path.replace( - '*', - &specifier[longest_prefix_length - ..specifier.len() - longest_suffix_length], - ) - }) - .collect::>() - }) - }, - Clone::clone, - ); - - paths - .into_iter() - .map(|p| self.compiler_options.paths_base.normalize_with(p)) - .chain(base_url_iter) - .collect() - } - - fn base_path(&self) -> &Path { - self.compiler_options - .base_url - .as_ref() - .map_or_else(|| self.directory(), |path| path.as_ref()) - } - - /// Template variable `${configDir}` for substitution of config files directory path - /// - /// NOTE: All tests cases are just a head replacement of `${configDir}`, so we are constrained as such. - /// - /// See - fn substitute_template_variable(directory: &Path, path: &mut String) { - const TEMPLATE_VARIABLE: &str = "${configDir}/"; - if let Some(stripped_path) = path.strip_prefix(TEMPLATE_VARIABLE) { - *path = directory.join(stripped_path).to_string_lossy().to_string(); - } - } -} diff --git a/tests/integration_test.rs b/tests/integration_test.rs deleted file mode 100644 index d369413f..00000000 --- a/tests/integration_test.rs +++ /dev/null @@ -1,102 +0,0 @@ -//! Test public APIs - -use std::{env, path::PathBuf}; - -use oxc_resolver::{EnforceExtension, Resolution, ResolveContext, ResolveOptions, Resolver}; - -fn dir() -> PathBuf { - env::current_dir().unwrap() -} - -fn resolve(specifier: &str) -> Resolution { - let path = dir(); - Resolver::new(ResolveOptions::default()).resolve(path, specifier).unwrap() -} - -#[test] -fn clone() { - let resolution = resolve("./tests/package.json"); - assert_eq!(resolution.clone(), resolution); -} - -#[test] -fn debug() { - let resolution = resolve("./tests/package.json"); - let s = format!("{resolution:?}"); - assert!(!s.is_empty()); -} - -#[test] -fn eq() { - let resolution = resolve("./tests/package.json"); - assert_eq!(resolution, resolution); -} - -#[test] -fn package_json() { - let resolution = resolve("./tests/package.json"); - assert!(resolution - .package_json() - .is_some_and(|json| json.name.as_ref().is_some_and(|name| name == "name"))); -} - -#[cfg(feature = "package_json_raw_json_api")] -#[test] -fn package_json_raw_json_api() { - let resolution = resolve("./tests/package.json"); - assert!(resolution - .package_json() - .unwrap() - .raw_json() - .get("name") - .is_some_and(|name| name == "name")); -} - -#[test] -fn clear_cache() { - let resolver = Resolver::new(ResolveOptions::default()); - resolver.clear_cache(); // exists -} - -#[test] -fn options() { - let resolver = Resolver::new(ResolveOptions::default()); - let options = resolver.options(); - assert!(!format!("{options:?}").is_empty()); -} - -#[test] -fn debug_resolver() { - let resolver = Resolver::new(ResolveOptions::default()); - assert!(!format!("{resolver:?}").is_empty()); -} - -#[test] -fn dependencies() { - let path = dir(); - let mut ctx = ResolveContext::default(); - let _ = Resolver::new(ResolveOptions::default()).resolve_with_context( - path, - "./tests/package.json", - &mut ctx, - ); - assert!(!ctx.file_dependencies.is_empty()); - assert!(ctx.missing_dependencies.is_empty()); -} - -#[test] -fn options_api() { - _ = ResolveOptions::default() - .with_builtin_modules(true) - .with_condition_names(&[]) - .with_extension(".js") - .with_force_extension(EnforceExtension::Auto) - .with_fully_specified(true) - .with_main_field("asdf") - .with_main_file("main") - .with_module("module") - .with_prefer_absolute(true) - .with_prefer_relative(true) - .with_root(PathBuf::new()) - .with_symbolic_link(true); -} diff --git a/tests/package.json b/tests/package.json deleted file mode 100644 index f099adcf..00000000 --- a/tests/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "name": "name" -} diff --git a/tests/resolve_test.rs b/tests/resolve_test.rs deleted file mode 100644 index 554d707c..00000000 --- a/tests/resolve_test.rs +++ /dev/null @@ -1,104 +0,0 @@ -use std::{env, path::PathBuf}; - -use oxc_resolver::{ResolveError, ResolveOptions, Resolver}; - -fn dir() -> PathBuf { - env::current_dir().unwrap() -} - -#[test] -fn chinese() { - let dir = dir(); - let specifier = "./fixtures/misc/中文/中文.js"; - let resolution = Resolver::new(ResolveOptions::default()).resolve(&dir, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(dir.join("fixtures/misc/中文/中文.js")) - ); -} - -#[test] -fn styled_components() { - let dir = dir(); - let path = dir.join("fixtures/pnpm8"); - let module_path = path.join("node_modules/.pnpm/styled-components@6.1.1_react-dom@18.2.0_react@18.2.0/node_modules/styled-components"); - let specifier = "styled-components"; - - // cjs - let options = - ResolveOptions { alias_fields: vec![vec!["browser".into()]], ..ResolveOptions::default() }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/styled-components.browser.cjs.js")) - ); - - // esm - let options = ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - main_fields: vec!["module".into()], - ..ResolveOptions::default() - }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/styled-components.browser.esm.js")) - ); -} - -#[test] -fn axios() { - let dir = dir(); - let path = dir.join("fixtures/pnpm8"); - let module_path = path.join("node_modules/.pnpm/axios@1.6.2/node_modules/axios"); - let specifier = "axios"; - - // default - let options = ResolveOptions::default(); - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("index.js")) - ); - - // browser - let options = ResolveOptions { - condition_names: vec!["browser".into(), "require".into()], - ..ResolveOptions::default() - }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/browser/axios.cjs")) - ); - - // cjs - let options = ResolveOptions { - condition_names: vec!["node".into(), "require".into()], - ..ResolveOptions::default() - }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/node/axios.cjs")) - ); -} - -#[test] -fn postcss() { - let dir = dir(); - let path = dir.join("fixtures/pnpm8"); - let module_path = path.join("node_modules/postcss"); - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - // should ignore "path" - let resolution = resolver.resolve(&module_path, "path"); - assert_eq!(resolution, Err(ResolveError::Ignored(module_path.clone()))); - - // should ignore "./lib/terminal-highlight" - let resolution = resolver.resolve(&module_path, "./lib/terminal-highlight"); - assert_eq!(resolution, Err(ResolveError::Ignored(module_path.join("lib/terminal-highlight")))); -} From af61bf4240790d556f89a1704db2034f76e900f9 Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Mon, 27 May 2024 17:05:43 +0300 Subject: [PATCH 17/82] squash! --- npm/package.json | 12 ++++++------ package.json | 18 +++++++++--------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/npm/package.json b/npm/package.json index 75649783..b47e6b07 100644 --- a/npm/package.json +++ b/npm/package.json @@ -1,16 +1,16 @@ { - "browser": "browser.js", + "name": "oxc-resolver", "description": "Oxc Resolver Node API", + "funding": { + "url": "https://github.com/sponsors/Boshen" + }, + "main": "index.js", + "browser": "browser.js", "files": [ "index.d.ts", "index.js", "browser.js" ], - "funding": { - "url": "https://github.com/sponsors/Boshen" - }, - "main": "index.js", - "name": "oxc-resolver", "napi": { "binaryName": "resolver", "packageName": "@oxc-resolver/binding", diff --git a/package.json b/package.json index d22d7be9..a431e48f 100644 --- a/package.json +++ b/package.json @@ -1,4 +1,13 @@ { + "name": "@oxc-resolver/binding", + "funding": { + "url": "https://github.com/sponsors/Boshen" + }, + "scripts": { + "build": "napi build --platform --release --package-json-path npm/package.json --manifest-path napi/Cargo.toml", + "build:debug": "napi build --platform --package-json-path npm/package.json --manifest-path napi/Cargo.toml", + "prepublishOnly": "napi pre-publish -t npm" + }, "ava": { "cache": false, "files": [ @@ -11,14 +20,5 @@ "@types/node": "^20.10.4", "ava": "^6.0.1", "emnapi": "^1.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/Boshen" - }, - "name": "@oxc-resolver/binding", - "scripts": { - "build": "napi build --platform --release --package-json-path npm/package.json --manifest-path napi/Cargo.toml", - "build:debug": "napi build --platform --package-json-path npm/package.json --manifest-path napi/Cargo.toml", - "prepublishOnly": "napi pre-publish -t npm" } } From 2dbc2f2b3af9f0bda137757a5252b5d4f79a2cd6 Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Sat, 1 Jun 2024 00:14:11 +0300 Subject: [PATCH 18/82] squash! --- package.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index a431e48f..d0d4d1b5 100644 --- a/package.json +++ b/package.json @@ -16,9 +16,9 @@ }, "devDependencies": { "@napi-rs/cli": "^3.0.0-alpha.43", - "@napi-rs/wasm-runtime": "^0.2.0", - "@types/node": "^20.10.4", - "ava": "^6.0.1", - "emnapi": "^1.0.0" + "@napi-rs/wasm-runtime": "^0.2.4", + "@types/node": "^20.12.13", + "ava": "^6.1.3", + "emnapi": "^1.2.0" } } From 821601b2dca47c0412e409b0590ada9c783193fe Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Thu, 6 Jun 2024 01:33:25 +0300 Subject: [PATCH 19/82] squash! --- Cargo.lock | 858 ------ Source/lib.rs | 111 +- fixtures/enhanced_resolve/lib/index.js | 1 - fixtures/enhanced_resolve/package.json | 4 - fixtures/enhanced_resolve/test/.gitignore | 2 - .../enhanced_resolve/test/fixtures/#/a.js | 0 fixtures/enhanced_resolve/test/fixtures/a.js | 3 - .../enhanced_resolve/test/fixtures/abc.txt | 1 - .../test/fixtures/alias/files/a.js | 0 fixtures/enhanced_resolve/test/fixtures/b.js | 3 - .../browser-module/browser/module-a.js | 0 .../fixtures/browser-module/lib/browser.js | 0 .../fixtures/browser-module/lib/ignore.js | 0 .../test/fixtures/browser-module/lib/main.js | 0 .../fixtures/browser-module/lib/replaced.js | 0 .../test/fixtures/browser-module/lib/self.js | 0 .../fixtures/browser-module/lib/toString.js | 0 .../browser-module/node_modules/module-a.js | 0 .../browser-module/node_modules/module-b.js | 0 .../browser-module/node_modules/module-c.js | 0 .../node_modules/recursive-file/a.js | 0 .../node_modules/recursive-file/b.js | 0 .../node_modules/recursive-file/c.js | 0 .../node_modules/recursive-file/d.js | 0 .../node_modules/recursive-file/package.json | 8 - .../test/fixtures/browser-module/package.json | 33 - .../test/fixtures/builtins/package.json | 12 - fixtures/enhanced_resolve/test/fixtures/c.js | 4 - .../enhanced_resolve/test/fixtures/complex.js | 13 - .../test/fixtures/crypto-js/index.js | 0 .../test/fixtures/crypto-js/package.json | 7 - .../test/fixtures/decorated-fs/exists.js | 0 .../test/fixtures/dirOrFile.js | 1 - .../test/fixtures/dirOrFile/index.js | 1 - .../directory-default/directory-default.js | 0 .../node_modules/@org/pkg/dist/string.js | 1 - .../@org/pkg/dist/string.test.d.ts | 1 - .../node_modules/@org/pkg/package.json | 9 - .../node_modules/pkg/dist/string.js | 1 - .../node_modules/pkg/dist/string.test.d.ts | 1 - .../node_modules/pkg/package.json | 9 - .../node_modules/exports-field/package.json | 7 - .../node_modules/pack1/index.js | 0 .../test/fixtures/exports-field/a.js | 1 - .../node_modules/exports-field/lib/browser.js | 1 - .../node_modules/exports-field/lib/index.js | 0 .../exports-field/lib/lib2/main.js | 1 - .../node_modules/exports-field/lib/main.js | 1 - .../node_modules/exports-field/main.js | 1 - .../node_modules/exports-field/package.json | 18 - .../node_modules/exports-field/x.js | 1 - .../invalid-exports-field/index.js | 0 .../invalid-exports-field/package.json | 13 - .../node_modules/invalid-exports-field/umd.js | 0 .../test/fixtures/exports-field/package.json | 5 - .../node_modules/exports-field/index.js | 1 - .../node_modules/exports-field/lib/browser.js | 1 - .../exports-field/lib/lib2/main.js | 1 - .../node_modules/exports-field/lib/main.js | 1 - .../node_modules/exports-field/main.js | 1 - .../node_modules/exports-field/package.json | 17 - .../node_modules/exports-field/index | 0 .../node_modules/exports-field/main.js | 1 - .../node_modules/exports-field/package.json | 10 - .../node_modules/exports-field/src/index.js | 0 .../fixtures/extension-alias/dir/index.js | 0 .../fixtures/extension-alias/dir/index.ts | 0 .../fixtures/extension-alias/dir2/index.js | 0 .../fixtures/extension-alias/dir2/index.mts | 0 .../test/fixtures/extension-alias/index.js | 0 .../test/fixtures/extension-alias/index.mjs | 0 .../fixtures/extension-alias/index.mts.js | 0 .../test/fixtures/extension-alias/index.ts | 0 .../test/fixtures/extensions/app.module.js | 0 .../test/fixtures/extensions/dir/index.js | 0 .../test/fixtures/extensions/dir/index.ts | 0 .../test/fixtures/extensions/foo.js | 0 .../test/fixtures/extensions/foo.ts | 0 .../test/fixtures/extensions/index.js | 0 .../test/fixtures/extensions/index.ts | 0 .../extensions/node_modules/module.js | 0 .../extensions/node_modules/module/index.ts | 0 .../test/fixtures/extensions/package.json | 3 - .../enhanced_resolve/test/fixtures/file.load1 | 0 .../enhanced_resolve/test/fixtures/file.load2 | 0 .../test/fixtures/foo/index.js | 0 .../test/fixtures/foo/package.json | 4 - .../node_modules/m/package.json | 17 - .../node_modules/m/src/features/f.js | 0 .../m/src/features/internal/file.js | 0 .../node_modules/m/src/features/y/y.js | 0 .../node_modules/m/src/internal/i.js | 0 .../node_modules/m/src/middle-1/f.js | 0 .../node_modules/m/src/middle-1/nested/f.js | 0 .../node_modules/m/src/middle-2/nested/f.js | 1 - .../m/src/middle-3/nested/f/nested/f.js | 0 .../node_modules/m/src/middle-4/f/f.js | 0 .../node_modules/m/src/middle-5/f$/$.js | 0 .../node_modules/m/src/middle-5/f/$.js | 0 .../node_modules/m/src/middle/f.js | 0 .../node_modules/m/src/middle/nested/f.js | 0 .../test/fixtures/imports-field/a.js | 1 - .../test/fixtures/imports-field/b.js | 0 .../test/fixtures/imports-field/dir/b.js | 0 .../node_modules/a/lib/browser.js | 1 - .../imports-field/node_modules/a/lib/index.js | 0 .../node_modules/a/lib/lib2/main.js | 1 - .../imports-field/node_modules/a/lib/main.js | 1 - .../imports-field/node_modules/a/main.js | 1 - .../imports-field/node_modules/a/package.json | 18 - .../imports-field/node_modules/a/x.js | 1 - .../imports-field/node_modules/c/index.js | 0 .../test/fixtures/imports-field/package.json | 17 - .../fixtures/incorrect-package/pack1/a.js | 0 .../incorrect-package/pack1/package.json | 2 - .../fixtures/incorrect-package/pack2/a.js | 0 .../incorrect-package/pack2/package.json | 0 .../test/fixtures/issue-238/package.json | 3 - .../test/fixtures/issue-238/src/a/config.js | 0 .../src/common/config/myObjectFile.js | 0 .../enhanced_resolve/test/fixtures/lib.js | 0 .../test/fixtures/lib/complex1.js | 1 - .../test/fixtures/main-field-self/index.js | 0 .../fixtures/main-field-self/package.json | 3 - .../test/fixtures/main-field-self2/index.js | 0 .../fixtures/main-field-self2/package.json | 3 - .../enhanced_resolve/test/fixtures/main1.js | 9 - .../enhanced_resolve/test/fixtures/main2.js | 12 - .../enhanced_resolve/test/fixtures/main3.js | 4 - .../multiple_modules/node_modules/m1/a.js | 3 - .../test/fixtures/no#fragment/#/#.js | 0 fixtures/enhanced_resolve/test/fixtures/no.js | 0 .../browser-module-broken/browser.js | 0 .../browser-module-broken/main.js | 0 .../browser-module-broken/package.json | 4 - .../complexm/node_modules/m1/a.js | 1 - .../complexm/node_modules/m1/index.js | 1 - .../fixtures/node_modules/complexm/step1.js | 1 - .../fixtures/node_modules/complexm/step2.js | 1 - .../fixtures/node_modules/dash-name/index.js | 0 .../node_modules/dash-name/package.json | 4 - .../test/fixtures/node_modules/dash/index.js | 0 .../fixtures/node_modules/dash/package.json | 4 - .../invalidPackageJson/package.json | 0 .../test/fixtures/node_modules/m1/a.js | 3 - .../test/fixtures/node_modules/m1/b.js | 3 - .../test/fixtures/node_modules/m2/b.js | 1 - .../node_modules/recursive-module/file.js | 0 .../node_modules/recursive-module/index.js | 0 .../test/fixtures/pnp-a/m2/a.js | 3 - .../test/fixtures/pnp/pkg/dir/index.js | 0 .../test/fixtures/pnp/pkg/index.js | 0 .../test/fixtures/pnp/pkg/main.js | 0 .../fixtures/pnp/pkg/package-alias/browser.js | 0 .../fixtures/pnp/pkg/package-alias/index.js | 0 .../test/fixtures/pnp/pkg/package.json | 7 - .../test/fixtures/pnp/pkg/typescript/index.ts | 0 .../test/fixtures/pnp/pkg3/a.js | 1 - .../test/fixtures/pnp/pkg3/package.json | 8 - .../prefer-pnp/alternative-modules/m1/b.js | 0 .../restrictions/node_modules/pck1/index.css | 0 .../restrictions/node_modules/pck1/index.js | 0 .../node_modules/pck1/package.json | 3 - .../restrictions/node_modules/pck2/index.css | 0 .../restrictions/node_modules/pck2/module.js | 0 .../node_modules/pck2/package.json | 5 - .../test/fixtures/roots_fall_through/index.js | 0 .../scoped/node_modules/@scope/pack1/main.js | 0 .../node_modules/@scope/pack1/package.json | 5 - .../node_modules/@scope/pack2/lib/index.js | 0 .../scoped/node_modules/@scope/pack2/main.js | 0 .../node_modules/@scope/pack2/package.json | 3 - .../test/fixtures/shortcutdir.js/a.js | 0 .../test/fixtures/yield/a/foo-2/b | 0 .../test/fixtures/yield/a/foo-2/c | 0 .../test/fixtures/yield/a/foo/a | 0 .../test/fixtures/yield/a/foo/b | 0 .../test/fixtures/yield/b/foo/a | 0 .../test/fixtures/yield/c/foo/a | 0 .../test/fixtures/yield/c/foo/package.json | 7 - .../fixtures/\346\265\213\350\257\225.js" | 0 .../\344\270\255\346\226\207.js" | 0 fixtures/pnpm8/.gitignore | 1 - fixtures/pnpm8/package.json | 14 - fixtures/pnpm8/pnpm-lock.yaml | 212 -- fixtures/tsconfig/cases/builtins/thing.js | 0 .../tsconfig/cases/builtins/tsconfig.json | 5 - fixtures/tsconfig/cases/exports/index.js | 0 fixtures/tsconfig/cases/exports/tsconfig.json | 3 - .../extends-extension/base-tsconfig.json | 7 - .../tsconfig/cases/extends-extension/foo.js | 0 .../cases/extends-extension/tsconfig.json | 3 - .../cases/extends-extensionless/foo.js | 0 .../cases/extends-extensionless/tsconfig.json | 3 - .../tsconfig/cases/extends-multiple/foo.js | 0 .../cases/extends-multiple/tsconfig.json | 6 - .../tsconfig/cases/extends-not-found/index.js | 0 .../cases/extends-not-found/tsconfig.json | 3 - .../tsconfig/cases/extends-paths/src/index.js | 0 .../cases/extends-paths/tsconfig.base.json | 7 - .../cases/extends-paths/tsconfig.json | 6 - fixtures/tsconfig/cases/field/index.js | 0 fixtures/tsconfig/cases/field/tsconfig.json | 3 - fixtures/tsconfig/cases/index/index.js | 0 fixtures/tsconfig/cases/index/tsconfig.json | 3 - .../cases/paths_template_variable/foo.js | 0 .../paths_template_variable/tsconfig1.json | 3 - .../paths_template_variable/tsconfig2.json | 8 - .../project_references/app/aliased/index.ts | 0 .../cases/project_references/app/index.ts | 0 .../project_references/app/tsconfig.json | 23 - .../project_a/aliased/index.ts | 0 .../project_references/project_a/conf.json | 8 - .../project_references/project_a/index.ts | 0 .../project_b/src/aliased/index.ts | 0 .../project_b/tsconfig.json | 9 - .../project_references/project_c/index.ts | 0 .../project_c/tsconfig.json | 5 - .../project_references/tsconfig.base.json | 4 - fixtures/tsconfig/cases/suffixes/a.ios.ts | 0 fixtures/tsconfig/cases/suffixes/a.ts | 0 fixtures/tsconfig/cases/suffixes/b.ts | 0 fixtures/tsconfig/cases/suffixes/c-test.ts | 0 fixtures/tsconfig/cases/suffixes/index.ts | 1 - .../tsconfig/cases/suffixes/tsconfig.json | 5 - fixtures/tsconfig/cases/trailing-comma/bar.js | 0 .../tsconfig/cases/trailing-comma/index.js | 0 .../cases/trailing-comma/tsconfig.json | 9 - fixtures/tsconfig/foo.js | 0 fixtures/tsconfig/nested/index.js | 0 fixtures/tsconfig/nested/test.js | 0 fixtures/tsconfig/nested/tsconfig.json | 8 - .../node_modules/tsconfig-exports/conf.json | 7 - .../node_modules/tsconfig-exports/foo.js | 0 .../tsconfig-exports/package.json | 7 - .../node_modules/tsconfig-field/conf.json | 7 - .../node_modules/tsconfig-field/foo.js | 0 .../node_modules/tsconfig-field/package.json | 5 - .../node_modules/tsconfig-index/foo.js | 0 .../node_modules/tsconfig-index/package.json | 4 - .../node_modules/tsconfig-index/tsconfig.json | 7 - .../node_modules/tsconfig-not-used/foo.js | 0 .../tsconfig-not-used/tsconfig.json | 7 - fixtures/tsconfig/package.json | 24 - fixtures/tsconfig/tsconfig.json | 7 - .../tsconfig/tsconfig_template_variable.json | 7 - napi/__test__/resolver.spec.mjs | 259 -- napi/src/lib.rs | 166 -- napi/src/options.rs | 261 -- napi/tests/options.test.mjs | 59 - npm/package.json | 67 +- package.json | 56 +- pnpm-lock.yaml | 2450 ---------------- src/builtins.rs | 71 - src/cache.rs | 369 --- src/context.rs | 89 - src/error.rs | 160 -- src/file_system.rs | 133 - src/lib.rs | 1670 ----------- src/options.rs | 623 ---- src/package_json.rs | 207 -- src/path.rs | 132 - src/resolution.rs | 92 - src/specifier.rs | 230 -- src/tests/alias.rs | 280 -- src/tests/browser_field.rs | 189 -- src/tests/builtins.rs | 121 - src/tests/dependencies.rs | 110 - src/tests/exports_field.rs | 2546 ----------------- src/tests/extension_alias.rs | 66 - src/tests/extensions.rs | 125 - src/tests/fallback.rs | 100 - src/tests/full_specified.rs | 113 - src/tests/imports_field.rs | 1320 --------- src/tests/incorrect_description_file.rs | 62 - src/tests/main_field.rs | 24 - src/tests/memory_fs.rs | 74 - src/tests/missing.rs | 106 - src/tests/mod.rs | 49 - src/tests/resolve.rs | 119 - src/tests/restrictions.rs | 25 - src/tests/roots.rs | 92 - src/tests/scoped_packages.rs | 25 - src/tests/simple.rs | 68 - src/tests/symlink.rs | 121 - src/tests/tsconfig_paths.rs | 507 ---- src/tests/tsconfig_project_references.rs | 101 - src/tsconfig.rs | 212 -- tests/integration_test.rs | 102 - tests/package.json | 3 - tests/resolve_test.rs | 104 - 291 files changed, 109 insertions(+), 15527 deletions(-) delete mode 100644 Cargo.lock delete mode 100644 fixtures/enhanced_resolve/lib/index.js delete mode 100644 fixtures/enhanced_resolve/package.json delete mode 100644 fixtures/enhanced_resolve/test/.gitignore delete mode 100644 fixtures/enhanced_resolve/test/fixtures/#/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/abc.txt delete mode 100644 fixtures/enhanced_resolve/test/fixtures/alias/files/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/browser/module-a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/ignore.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/replaced.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/self.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/toString.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-c.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/c.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/d.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/builtins/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/c.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/complex.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/crypto-js/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/decorated-fs/exists.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/dirOrFile.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/directory-default/directory-default.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/pack1/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/umd.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/index delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/src/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.mts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mjs delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mts.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/app.module.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/foo.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/foo.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/file.load1 delete mode 100644 fixtures/enhanced_resolve/test/fixtures/file.load2 delete mode 100644 fixtures/enhanced_resolve/test/fixtures/foo/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/foo/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/internal/file.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/y/y.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/internal/i.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-3/nested/f/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-4/f/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f$/$.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f/$.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/dir/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/c/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/issue-238/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/issue-238/src/a/config.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/issue-238/src/common/config/myObjectFile.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/lib.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/lib/complex1.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self2/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main1.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main2.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main3.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/no#fragment/#/#.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/no.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/invalidPackageJson/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/file.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/dir/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/typescript/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/prefer-pnp/alternative-modules/m1/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.css delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/index.css delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/module.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/roots_fall_through/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/lib/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/shortcutdir.js/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/b delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/c delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo/a delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo/b delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/b/foo/a delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/c/foo/a delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json delete mode 100644 "fixtures/enhanced_resolve/test/fixtures/\346\265\213\350\257\225.js" delete mode 100644 "fixtures/misc/\344\270\255\346\226\207/\344\270\255\346\226\207.js" delete mode 100644 fixtures/pnpm8/.gitignore delete mode 100644 fixtures/pnpm8/package.json delete mode 100644 fixtures/pnpm8/pnpm-lock.yaml delete mode 100644 fixtures/tsconfig/cases/builtins/thing.js delete mode 100644 fixtures/tsconfig/cases/builtins/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/exports/index.js delete mode 100644 fixtures/tsconfig/cases/exports/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-extension/base-tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-extension/foo.js delete mode 100644 fixtures/tsconfig/cases/extends-extension/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-extensionless/foo.js delete mode 100644 fixtures/tsconfig/cases/extends-extensionless/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-multiple/foo.js delete mode 100644 fixtures/tsconfig/cases/extends-multiple/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-not-found/index.js delete mode 100644 fixtures/tsconfig/cases/extends-not-found/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-paths/src/index.js delete mode 100644 fixtures/tsconfig/cases/extends-paths/tsconfig.base.json delete mode 100644 fixtures/tsconfig/cases/extends-paths/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/field/index.js delete mode 100644 fixtures/tsconfig/cases/field/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/index/index.js delete mode 100644 fixtures/tsconfig/cases/index/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/paths_template_variable/foo.js delete mode 100644 fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json delete mode 100644 fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json delete mode 100644 fixtures/tsconfig/cases/project_references/app/aliased/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/app/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/app/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/project_references/project_a/aliased/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_a/conf.json delete mode 100644 fixtures/tsconfig/cases/project_references/project_a/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_b/src/aliased/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_b/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/project_references/project_c/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_c/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/project_references/tsconfig.base.json delete mode 100644 fixtures/tsconfig/cases/suffixes/a.ios.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/a.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/b.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/c-test.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/index.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/trailing-comma/bar.js delete mode 100644 fixtures/tsconfig/cases/trailing-comma/index.js delete mode 100644 fixtures/tsconfig/cases/trailing-comma/tsconfig.json delete mode 100644 fixtures/tsconfig/foo.js delete mode 100644 fixtures/tsconfig/nested/index.js delete mode 100644 fixtures/tsconfig/nested/test.js delete mode 100644 fixtures/tsconfig/nested/tsconfig.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-exports/conf.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-exports/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-exports/package.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-field/conf.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-field/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-field/package.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-index/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-index/package.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-not-used/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json delete mode 100755 fixtures/tsconfig/package.json delete mode 100644 fixtures/tsconfig/tsconfig.json delete mode 100644 fixtures/tsconfig/tsconfig_template_variable.json delete mode 100644 napi/__test__/resolver.spec.mjs delete mode 100644 napi/src/lib.rs delete mode 100644 napi/src/options.rs delete mode 100644 napi/tests/options.test.mjs delete mode 100644 pnpm-lock.yaml delete mode 100644 src/builtins.rs delete mode 100644 src/cache.rs delete mode 100644 src/context.rs delete mode 100644 src/error.rs delete mode 100644 src/file_system.rs delete mode 100644 src/lib.rs delete mode 100644 src/options.rs delete mode 100644 src/package_json.rs delete mode 100644 src/path.rs delete mode 100644 src/resolution.rs delete mode 100644 src/specifier.rs delete mode 100644 src/tests/alias.rs delete mode 100644 src/tests/browser_field.rs delete mode 100644 src/tests/builtins.rs delete mode 100644 src/tests/dependencies.rs delete mode 100644 src/tests/exports_field.rs delete mode 100644 src/tests/extension_alias.rs delete mode 100644 src/tests/extensions.rs delete mode 100644 src/tests/fallback.rs delete mode 100644 src/tests/full_specified.rs delete mode 100644 src/tests/imports_field.rs delete mode 100644 src/tests/incorrect_description_file.rs delete mode 100644 src/tests/main_field.rs delete mode 100644 src/tests/memory_fs.rs delete mode 100644 src/tests/missing.rs delete mode 100644 src/tests/mod.rs delete mode 100644 src/tests/resolve.rs delete mode 100644 src/tests/restrictions.rs delete mode 100644 src/tests/roots.rs delete mode 100644 src/tests/scoped_packages.rs delete mode 100644 src/tests/simple.rs delete mode 100644 src/tests/symlink.rs delete mode 100644 src/tests/tsconfig_paths.rs delete mode 100644 src/tests/tsconfig_project_references.rs delete mode 100644 src/tsconfig.rs delete mode 100644 tests/integration_test.rs delete mode 100644 tests/package.json delete mode 100644 tests/resolve_test.rs diff --git a/Cargo.lock b/Cargo.lock deleted file mode 100644 index 8aa802af..00000000 --- a/Cargo.lock +++ /dev/null @@ -1,858 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "aho-corasick" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" -dependencies = [ - "memchr", -] - -[[package]] -name = "anes" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "735d4f398ca57cfa2880225c2bf81c3b9af3be5bb22e44ae70118dad38713e84" - -[[package]] -name = "autocfg" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "bitflags" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" - -[[package]] -name = "bpaf" -version = "0.9.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3280efcf6d66bc77c2cf9b67dc8acee47a217d9be67dd590b3230dffe663724d" - -[[package]] -name = "cast" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "ciborium" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42e69ffd6f0917f5c029256a24d0161db17cea3997d185db0d35926308770f0e" -dependencies = [ - "ciborium-io", - "ciborium-ll", - "serde", -] - -[[package]] -name = "ciborium-io" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05afea1e0a06c9be33d539b876f1ce3692f4afea2cb41f740e7743225ed1c757" - -[[package]] -name = "ciborium-ll" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57663b653d948a338bfb3eeba9bb2fd5fcfaecb9e199e87e1eda4d9e8b240fd9" -dependencies = [ - "ciborium-io", - "half", -] - -[[package]] -name = "clean-path" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aaa6b4b263a5d737e9bf6b7c09b72c41a5480aec4d7219af827f6564e950b6a5" - -[[package]] -name = "codspeed" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a104ac948e0188b921eb3fcbdd55dcf62e542df4c7ab7e660623f6288302089" -dependencies = [ - "colored", - "libc", - "serde_json", -] - -[[package]] -name = "colored" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbf2150cce219b664a8a70df7a1f933836724b503f8a413af9365b4dcc4d90b8" -dependencies = [ - "lazy_static", - "windows-sys 0.48.0", -] - -[[package]] -name = "convert_case" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec182b0ca2f35d8fc196cf3404988fd8b8c739a4d270ff118a398feb0cbec1ca" -dependencies = [ - "unicode-segmentation", -] - -[[package]] -name = "criterion2" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f22174bed309c964c1720148dfe793f285cc02fd8b13c91205d485f73468d94d" -dependencies = [ - "anes", - "bpaf", - "cast", - "ciborium", - "codspeed", - "colored", - "num-traits", - "oorandom", - "serde", - "serde_json", - "walkdir", -] - -[[package]] -name = "crossbeam-deque" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" -dependencies = [ - "crossbeam-epoch", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.9.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" -dependencies = [ - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" - -[[package]] -name = "crunchy" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" - -[[package]] -name = "ctor" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edb49164822f3ee45b17acd4a208cfc1251410cf0cad9a833234c9890774dd9f" -dependencies = [ - "quote", - "syn", -] - -[[package]] -name = "dashmap" -version = "5.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" -dependencies = [ - "cfg-if", - "hashbrown", - "lock_api", - "once_cell", - "parking_lot_core", -] - -[[package]] -name = "document-features" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef5282ad69563b5fc40319526ba27e0e7363d552a896f0297d54f767717f9b95" -dependencies = [ - "litrs", -] - -[[package]] -name = "dunce" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b" - -[[package]] -name = "either" -version = "1.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dca9240753cf90908d7e4aac30f630662b02aebaa1b58a3cadabdb23385b58b" - -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "filetime" -version = "0.2.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ee447700ac8aa0b2f2bd7bc4462ad686ba06baa6727ac149a2d6277f0d240fd" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall 0.4.1", - "windows-sys 0.52.0", -] - -[[package]] -name = "half" -version = "2.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dd08c532ae367adf81c312a4580bc67f1d0fe8bc9c460520283f4c0ff277888" -dependencies = [ - "cfg-if", - "crunchy", -] - -[[package]] -name = "hashbrown" -version = "0.14.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" - -[[package]] -name = "indexmap" -version = "2.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" -dependencies = [ - "equivalent", - "hashbrown", - "serde", -] - -[[package]] -name = "itoa" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" - -[[package]] -name = "json-strip-comments" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3d129799327c8f80861e467c59b825ba24c277dba6ad0d71a141dc98f9e04ee" - -[[package]] -name = "lazy_static" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" - -[[package]] -name = "libc" -version = "0.2.155" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" - -[[package]] -name = "libloading" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c2a198fb6b0eada2a8df47933734e6d35d350665a33a3593d7164fa52c75c19" -dependencies = [ - "cfg-if", - "windows-targets 0.52.5", -] - -[[package]] -name = "litrs" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4ce301924b7887e9d637144fdade93f9dfff9b60981d4ac161db09720d39aa5" - -[[package]] -name = "lock_api" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" -dependencies = [ - "autocfg", - "scopeguard", -] - -[[package]] -name = "memchr" -version = "2.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" - -[[package]] -name = "napi" -version = "2.16.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfc300228808a0e6aea5a58115c82889240bcf8dab16fc25ad675b33e454b368" -dependencies = [ - "bitflags 2.5.0", - "ctor", - "napi-derive", - "napi-sys", - "once_cell", - "serde", - "serde_json", -] - -[[package]] -name = "napi-build" -version = "2.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1c0f5d67ee408a4685b61f5ab7e58605c8ae3f2b4189f0127d804ff13d5560a" - -[[package]] -name = "napi-derive" -version = "2.16.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0e034ddf6155192cf83f267ede763fe6c164dfa9971585436b16173718d94c4" -dependencies = [ - "cfg-if", - "convert_case", - "napi-derive-backend", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "napi-derive-backend" -version = "1.0.67" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bff2c00437f3b3266391eb5e6aa25d0029187daf5caf05b8e3271468fb5ae73e" -dependencies = [ - "convert_case", - "once_cell", - "proc-macro2", - "quote", - "regex", - "semver", - "syn", -] - -[[package]] -name = "napi-sys" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "427802e8ec3a734331fec1035594a210ce1ff4dc5bc1950530920ab717964ea3" -dependencies = [ - "libloading", -] - -[[package]] -name = "normalize-path" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5438dd2b2ff4c6df6e1ce22d825ed2fa93ee2922235cc45186991717f0a892d" - -[[package]] -name = "num-traits" -version = "0.2.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" -dependencies = [ - "autocfg", -] - -[[package]] -name = "once_cell" -version = "1.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" - -[[package]] -name = "oorandom" -version = "11.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575" - -[[package]] -name = "oxc_napi_resolver" -version = "0.0.0" -dependencies = [ - "napi", - "napi-build", - "napi-derive", - "oxc_resolver", -] - -[[package]] -name = "oxc_resolver" -version = "1.8.1" -dependencies = [ - "criterion2", - "dashmap", - "document-features", - "dunce", - "json-strip-comments", - "normalize-path", - "once_cell", - "rayon", - "rustc-hash", - "serde", - "serde_json", - "thiserror", - "tracing", - "typescript_tsconfig_json", - "vfs", -] - -[[package]] -name = "parking_lot_core" -version = "0.9.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall 0.5.1", - "smallvec", - "windows-targets 0.52.5", -] - -[[package]] -name = "pin-project-lite" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" - -[[package]] -name = "proc-macro2" -version = "1.0.85" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22244ce15aa966053a896d1accb3a6e68469b97c7f33f284b99f0d576879fc23" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.36" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "rayon" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" -dependencies = [ - "either", - "rayon-core", -] - -[[package]] -name = "rayon-core" -version = "1.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" -dependencies = [ - "crossbeam-deque", - "crossbeam-utils", -] - -[[package]] -name = "redox_syscall" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" -dependencies = [ - "bitflags 1.3.2", -] - -[[package]] -name = "redox_syscall" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "469052894dcb553421e483e4209ee581a45100d31b4018de03e5a7ad86374a7e" -dependencies = [ - "bitflags 2.5.0", -] - -[[package]] -name = "regex" -version = "1.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" -dependencies = [ - "aho-corasick", - "memchr", - "regex-automata", - "regex-syntax", -] - -[[package]] -name = "regex-automata" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", -] - -[[package]] -name = "regex-syntax" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" - -[[package]] -name = "rustc-hash" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" - -[[package]] -name = "ryu" -version = "1.0.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" - -[[package]] -name = "same-file" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "scopeguard" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" - -[[package]] -name = "semver" -version = "1.0.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" - -[[package]] -name = "serde" -version = "1.0.203" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7253ab4de971e72fb7be983802300c30b5a7f0c2e56fab8abfc6a214307c0094" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.203" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "serde_json" -version = "1.0.117" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3" -dependencies = [ - "indexmap", - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "smallvec" -version = "1.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" - -[[package]] -name = "syn" -version = "2.0.66" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c42f3f41a2de00b01c0aaad383c5a45241efc8b2d1eda5661812fda5f3cdcff5" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "thiserror" -version = "1.0.61" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.61" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "tracing" -version = "0.1.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" -dependencies = [ - "pin-project-lite", - "tracing-attributes", - "tracing-core", -] - -[[package]] -name = "tracing-attributes" -version = "0.1.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "tracing-core" -version = "0.1.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" -dependencies = [ - "once_cell", -] - -[[package]] -name = "typescript_tsconfig_json" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7cc416eaf05297012ead9d192226fe9a92e9a20f64f8780efb9085aaae9b590" -dependencies = [ - "clean-path", - "indexmap", - "rustc-hash", - "serde", - "serde_json", -] - -[[package]] -name = "unicode-ident" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" - -[[package]] -name = "unicode-segmentation" -version = "1.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" - -[[package]] -name = "vfs" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "654cd097e182a71dbf899178e6b5662c2157dd0b8afd5975de18008f6fc173d1" -dependencies = [ - "filetime", -] - -[[package]] -name = "walkdir" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" -dependencies = [ - "same-file", - "winapi-util", -] - -[[package]] -name = "winapi-util" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b" -dependencies = [ - "windows-sys 0.52.0", -] - -[[package]] -name = "windows-sys" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" -dependencies = [ - "windows-targets 0.48.5", -] - -[[package]] -name = "windows-sys" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" -dependencies = [ - "windows-targets 0.52.5", -] - -[[package]] -name = "windows-targets" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" -dependencies = [ - "windows_aarch64_gnullvm 0.48.5", - "windows_aarch64_msvc 0.48.5", - "windows_i686_gnu 0.48.5", - "windows_i686_msvc 0.48.5", - "windows_x86_64_gnu 0.48.5", - "windows_x86_64_gnullvm 0.48.5", - "windows_x86_64_msvc 0.48.5", -] - -[[package]] -name = "windows-targets" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" -dependencies = [ - "windows_aarch64_gnullvm 0.52.5", - "windows_aarch64_msvc 0.52.5", - "windows_i686_gnu 0.52.5", - "windows_i686_gnullvm", - "windows_i686_msvc 0.52.5", - "windows_x86_64_gnu 0.52.5", - "windows_x86_64_gnullvm 0.52.5", - "windows_x86_64_msvc 0.52.5", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" - -[[package]] -name = "windows_i686_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" - -[[package]] -name = "windows_i686_gnu" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" - -[[package]] -name = "windows_i686_gnullvm" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" - -[[package]] -name = "windows_i686_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" - -[[package]] -name = "windows_i686_msvc" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" diff --git a/Source/lib.rs b/Source/lib.rs index 2d603cf3..fe116552 100644 --- a/Source/lib.rs +++ b/Source/lib.rs @@ -225,17 +225,8 @@ impl ResolverGeneric { ctx: &mut Ctx, ) -> Result { ctx.with_fully_specified(self.options.fully_specified); - let specifier = Specifier::parse(specifier).map_err(ResolveError::Specifier)?; - ctx.with_query_fragment(specifier.query, specifier.fragment); let cached_path = self.cache.value(path); - let cached_path = self.require(&cached_path, specifier.path(), ctx).or_else(|err| { - if err.is_ignore() { - return Err(err); - } - // enhanced-resolve: try fallback - self.load_alias(&cached_path, specifier.path(), &self.options.fallback, ctx) - .and_then(|value| value.ok_or(err)) - })?; + let cached_path = self.require(&cached_path, specifier, ctx)?; let path = self.load_realpath(&cached_path)?; // enhanced-resolve: restrictions self.check_restrictions(&path)?; @@ -266,11 +257,21 @@ impl ResolverGeneric { ) -> Result { ctx.test_for_infinite_recursion()?; - // enhanced-resolve: try fragment as path - if let Some(path) = self.try_fragment_as_path(cached_path, specifier, ctx) { + // enhanced-resolve: parse + let (parsed, try_fragment_as_path) = self.load_parse(cached_path, specifier, ctx)?; + if let Some(path) = try_fragment_as_path { return Ok(path); } + self.require_without_parse(cached_path, parsed.path(), ctx) + } + + fn require_without_parse( + &self, + cached_path: &CachedPath, + specifier: &str, + ctx: &mut Ctx, + ) -> Result { // tsconfig-paths if let Some(path) = self.load_tsconfig_paths(cached_path, specifier, &mut Ctx::default())? { return Ok(path); @@ -281,7 +282,7 @@ impl ResolverGeneric { return Ok(path); } - match Path::new(specifier).components().next() { + let result = match Path::new(specifier).components().next() { // 3. If X begins with './' or '/' or '../' Some(Component::RootDir | Component::Prefix(_)) => { self.require_absolute(cached_path, specifier, ctx) @@ -305,14 +306,31 @@ impl ResolverGeneric { // Set resolved the result of PACKAGE_RESOLVE(specifier, parentURL). self.require_bare(cached_path, specifier, ctx) } - } + }; + + result.or_else(|err| { + if err.is_ignore() { + return Err(err); + } + // enhanced-resolve: try fallback + self.load_alias(cached_path, specifier, &self.options.fallback, ctx) + .and_then(|value| value.ok_or(err)) + }) } + // PACKAGE_RESOLVE(packageSpecifier, parentURL) + // 3. If packageSpecifier is a Node.js builtin module name, then + // 1. Return the string "node:" concatenated with packageSpecifier. fn require_core(&self, specifier: &str) -> Result<(), ResolveError> { - if self.options.builtin_modules - && (specifier.starts_with("node:") || NODEJS_BUILTINS.binary_search(&specifier).is_ok()) - { - return Err(ResolveError::Builtin(specifier.to_string())); + if self.options.builtin_modules { + let starts_with_node = specifier.starts_with("node:"); + if starts_with_node || NODEJS_BUILTINS.binary_search(&specifier).is_ok() { + let mut specifier = specifier.to_string(); + if !starts_with_node { + specifier = format!("node:{specifier}"); + } + return Err(ResolveError::Builtin(specifier)); + } } Ok(()) } @@ -401,7 +419,7 @@ impl ResolverGeneric { self.load_package_self_or_node_modules(cached_path, specifier, ctx) } - /// Try fragment as part of the path + /// enhanced-resolve: ParsePlugin. /// /// 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, @@ -409,21 +427,26 @@ impl ResolverGeneric { /// When a # is resolved as path it will be escaped in the result. Here: `.../some\0#thing.js`. /// /// - fn try_fragment_as_path( + fn load_parse<'s>( &self, cached_path: &CachedPath, - specifier: &str, + specifier: &'s str, ctx: &mut Ctx, - ) -> Option { + ) -> Result<(Specifier<'s>, Option), ResolveError> { + let parsed = Specifier::parse(specifier).map_err(ResolveError::Specifier)?; + ctx.with_query_fragment(parsed.query, parsed.fragment); + + // There is an edge-case where a request with # can be a path or a fragment -> try both if ctx.fragment.is_some() && ctx.query.is_none() { + let specifier = parsed.path(); let fragment = ctx.fragment.take().unwrap(); let path = format!("{specifier}{fragment}"); - if let Ok(path) = self.require(cached_path, &path, ctx) { - return Some(path); + if let Ok(path) = self.require_without_parse(cached_path, &path, ctx) { + return Ok((parsed, Some(path))); } ctx.fragment.replace(fragment); } - None + Ok((parsed, None)) } fn load_package_self_or_node_modules( @@ -842,12 +865,10 @@ impl ResolverGeneric { } return Err(ResolveError::Recursion); } - let specifier = Specifier::parse(new_specifier).map_err(ResolveError::Specifier)?; - ctx.with_query_fragment(specifier.query, specifier.fragment); - ctx.with_resolving_alias(specifier.path().to_string()); + ctx.with_resolving_alias(new_specifier.to_string()); ctx.with_fully_specified(false); let cached_path = self.cache.value(package_json.directory()); - self.require(&cached_path, specifier.path(), ctx).map(Some) + self.require(&cached_path, new_specifier, ctx).map(Some) } /// enhanced-resolve: AliasPlugin for [ResolveOptions::alias] and [ResolveOptions::fallback]. @@ -878,23 +899,16 @@ impl ResolverGeneric { for r in specifiers { match r { AliasValue::Path(alias_value) => { - let new_specifier = - Specifier::parse(alias_value).map_err(ResolveError::Specifier)?; - // Resolve path without query and fragment - let old_query = ctx.query.clone(); - let old_fragment = ctx.fragment.clone(); - ctx.with_query_fragment(new_specifier.query, new_specifier.fragment); if let Some(path) = self.load_alias_value( cached_path, alias_key, - new_specifier.path(), // pass in parsed alias value + alias_value, specifier, ctx, &mut should_stop, )? { return Ok(Some(path)); } - ctx.with_query_fragment(old_query.as_deref(), old_fragment.as_deref()); } AliasValue::Ignore => { let path = cached_path.path().normalize_with(alias_key); @@ -1118,6 +1132,11 @@ impl ResolverGeneric { ctx: &mut Ctx, ) -> ResolveResult { let (package_name, subpath) = Self::parse_package_specifier(specifier); + + // 3. If packageSpecifier is a Node.js builtin module name, then + // 1. Return the string "node:" concatenated with packageSpecifier. + self.require_core(package_name)?; + // 11. While parentURL is not the file system root, for module_name in &self.options.modules { for cached_path in std::iter::successors(Some(cached_path), |p| p.parent()) { @@ -1162,10 +1181,8 @@ impl ResolverGeneric { } } let subpath = format!(".{subpath}"); - let specifier = Specifier::parse(&subpath).map_err(ResolveError::Specifier)?; ctx.with_fully_specified(false); - ctx.with_query_fragment(specifier.query, specifier.fragment); - return self.require(&cached_path, specifier.path(), ctx).map(Some); + return self.require(&cached_path, &subpath, ctx).map(Some); } } } @@ -1499,19 +1516,9 @@ impl ResolverGeneric { JSONValue::Object(target) => { // 1. If exports contains any index property keys, as defined in ECMA-262 6.1.7 Array Index, throw an Invalid Package Configuration error. // 2. For each property p of target, in object insertion order as, - for (i, (key, target_value)) in target.iter().enumerate() { - // https://nodejs.org/api/packages.html#conditional-exports - // "default" - the generic fallback that always matches. Can be a CommonJS or ES module file. This condition should always come last. - // Note: node.js does not throw this but enhanced-resolve does. - let is_default = key == "default"; - if i < target.len() - 1 && is_default { - return Err(ResolveError::InvalidPackageConfigDefault( - package_url.join("package.json"), - )); - } - + for (key, target_value) in target { // 1. If p equals "default" or conditions contains an entry for p, then - if is_default || conditions.contains(key) { + if key == "default" || conditions.contains(key) { // 1. Let targetValue be the value of the p property in target. // 2. Let resolved be the result of PACKAGE_TARGET_RESOLVE( packageURL, targetValue, patternMatch, isImports, conditions). let resolved = self.package_target_resolve( diff --git a/fixtures/enhanced_resolve/lib/index.js b/fixtures/enhanced_resolve/lib/index.js deleted file mode 100644 index 1e872e8f..00000000 --- a/fixtures/enhanced_resolve/lib/index.js +++ /dev/null @@ -1 +0,0 @@ -// mimic enhanced-resolved root directory structure diff --git a/fixtures/enhanced_resolve/package.json b/fixtures/enhanced_resolve/package.json deleted file mode 100644 index d1b845b5..00000000 --- a/fixtures/enhanced_resolve/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "enhanced-resolve", - "main": "lib/index.js" -} diff --git a/fixtures/enhanced_resolve/test/.gitignore b/fixtures/enhanced_resolve/test/.gitignore deleted file mode 100644 index bbbec5f4..00000000 --- a/fixtures/enhanced_resolve/test/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# created by symlink.rs -/temp diff --git a/fixtures/enhanced_resolve/test/fixtures/#/a.js b/fixtures/enhanced_resolve/test/fixtures/#/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/a.js b/fixtures/enhanced_resolve/test/fixtures/a.js deleted file mode 100644 index 896ffc6d..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/abc.txt b/fixtures/enhanced_resolve/test/fixtures/abc.txt deleted file mode 100644 index f2ba8f84..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/abc.txt +++ /dev/null @@ -1 +0,0 @@ -abc \ No newline at end of file diff --git a/fixtures/enhanced_resolve/test/fixtures/alias/files/a.js b/fixtures/enhanced_resolve/test/fixtures/alias/files/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/b.js b/fixtures/enhanced_resolve/test/fixtures/b.js deleted file mode 100644 index 11476340..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/b.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function b() { - return "This is b"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/browser/module-a.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/browser/module-a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/browser.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/ignore.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/ignore.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/replaced.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/replaced.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/self.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/self.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/toString.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/toString.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-a.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-b.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-c.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-c.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/a.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/b.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/c.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/c.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/d.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/d.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json deleted file mode 100644 index c13fe23b..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "browser": { - "a.js": "./a", - "./b.js": "./b", - "c.js": "./d.js", - "./d.js": "./c.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/package.json b/fixtures/enhanced_resolve/test/fixtures/browser-module/package.json deleted file mode 100644 index 19ff7739..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/browser-module/package.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "exports": { - "./lib/index.js": "./lib/index.js" - }, - "browser": { - "./lib/ignore.js": false, - "./lib/replaced.js": "./lib/browser", - "module-a": "./browser/module-a.js", - "module-b": "module-c", - "module-c": "module-c", - "./toString": "./lib/toString.js", - "./lib/main.js": "./lib/main.js", - "./main.js": "./lib/main.js", - "./lib/xyz.js": "./xyz.js", - "./xyz.js": "./lib/xyz.js", - "./lib/non-existent.js": "./lib/non-existent.js", - ".": false, - "./number": 1, - "./foo": "./lib/replaced.js?query" - }, - "innerBrowser1": { - "field": { - "browser": { - "./lib/main1.js": "./lib/main.js" - } - } - }, - "innerBrowser2": { - "browser": { - "./lib/main2.js": "./lib/replaced.js" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/builtins/package.json b/fixtures/enhanced_resolve/test/fixtures/builtins/package.json deleted file mode 100644 index 4a54ea96..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/builtins/package.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "name": "builtins", - "private": true, - "imports": { - "#fs": { - "default": "fs" - }, - "#http": { - "node": "node:http" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/c.js b/fixtures/enhanced_resolve/test/fixtures/c.js deleted file mode 100644 index e3aca8aa..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/c.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = function b() { - require("./a"); - return "This is c"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/complex.js b/fixtures/enhanced_resolve/test/fixtures/complex.js deleted file mode 100644 index 1f62db84..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/complex.js +++ /dev/null @@ -1,13 +0,0 @@ -var 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); diff --git a/fixtures/enhanced_resolve/test/fixtures/crypto-js/index.js b/fixtures/enhanced_resolve/test/fixtures/crypto-js/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json b/fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json deleted file mode 100644 index 1d31aa8b..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "crypto-js", - "main": "index.js", - "browser": { - "crypto": false - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/decorated-fs/exists.js b/fixtures/enhanced_resolve/test/fixtures/decorated-fs/exists.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/dirOrFile.js b/fixtures/enhanced_resolve/test/fixtures/dirOrFile.js deleted file mode 100644 index c3cb885f..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/dirOrFile.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "file"; diff --git a/fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js b/fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js deleted file mode 100644 index 85e01cd4..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "dir"; diff --git a/fixtures/enhanced_resolve/test/fixtures/directory-default/directory-default.js b/fixtures/enhanced_resolve/test/fixtures/directory-default/directory-default.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js deleted file mode 100644 index d1007aae..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js +++ /dev/null @@ -1 +0,0 @@ -export default "string"; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts deleted file mode 100644 index cb0ff5c3..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json deleted file mode 100644 index b523a1e9..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "@org/pkg", - "exports": { - "./*.js": { - "types": "./dist/*.d.ts", - "default": "./dist/*.js" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js deleted file mode 100644 index d1007aae..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js +++ /dev/null @@ -1 +0,0 @@ -export default "string"; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts deleted file mode 100644 index cb0ff5c3..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json deleted file mode 100644 index 8e55fb46..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "@raviqqe/hidash", - "exports": { - "./*.js": { - "types": "./dist/*.d.ts", - "default": "./dist/*.js" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json deleted file mode 100644 index f0edf449..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "exports-field", - "version": "1.0.0", - "exports": { - ".": "./a/../b/../../pack1/index.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/pack1/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/pack1/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/a.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/a.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json deleted file mode 100644 index 6b105c08..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "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/": { - "webpack": ["./lib/lib2/", "./lib/"], - "node": "./lib/", - "default": "./lib/" - }, - "./dist/a.js": "./../../a.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json deleted file mode 100644 index 0012a3de..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "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" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/umd.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/umd.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field/package.json deleted file mode 100644 index 5fa72bb5..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "@exports-field/core", - "version": "1.0.0", - "exports": "./a.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json deleted file mode 100644 index e6f12074..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "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/lib2/", "./lib/"], - "node": "./lib/", - "default": "./lib/" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/index b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/index deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json deleted file mode 100644 index 1a838f49..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "name": "exports-field", - "exportsField": { - "exports": "./main.js" - }, - "ex": "./index", - "broken": { - ".": "./src" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/src/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/src/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.ts b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.mts b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.mts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mjs b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mjs deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mts.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mts.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.ts b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/app.module.js b/fixtures/enhanced_resolve/test/fixtures/extensions/app.module.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.js b/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/foo.js b/fixtures/enhanced_resolve/test/fixtures/extensions/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/foo.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/foo.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/index.js b/fixtures/enhanced_resolve/test/fixtures/extensions/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/index.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module.js b/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module/index.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/package.json b/fixtures/enhanced_resolve/test/fixtures/extensions/package.json deleted file mode 100644 index 5e55a1e8..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/extensions/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "./index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/file.load1 b/fixtures/enhanced_resolve/test/fixtures/file.load1 deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/file.load2 b/fixtures/enhanced_resolve/test/fixtures/file.load2 deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/foo/index.js b/fixtures/enhanced_resolve/test/fixtures/foo/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/foo/package.json b/fixtures/enhanced_resolve/test/fixtures/foo/package.json deleted file mode 100644 index da86787a..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/foo/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "foo", - "version": "1.0.0" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json deleted file mode 100644 index aa2be496..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "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" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/internal/file.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/internal/file.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/y/y.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/y/y.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/internal/i.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/internal/i.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/nested/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js deleted file mode 100644 index e5b70a86..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = { nested: "nested" } diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-3/nested/f/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-3/nested/f/nested/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-4/f/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-4/f/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f$/$.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f$/$.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f/$.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f/$.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/nested/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/a.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/a.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/b.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/dir/b.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/dir/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/index.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json deleted file mode 100644 index 8d8d3a46..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "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/lib2/", "./lib/"], - "node": "./lib/", - "default": "./lib/" - }, - "./dist/a.js": "./../../a.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/c/index.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/c/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/imports-field/package.json deleted file mode 100644 index 248351a9..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "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" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/a.js b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json deleted file mode 100644 index ded7faa2..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json +++ /dev/null @@ -1,2 +0,0 @@ -{ - "main": "./a.js", diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/a.js b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/package.json b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/package.json deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/issue-238/package.json b/fixtures/enhanced_resolve/test/fixtures/issue-238/package.json deleted file mode 100644 index 352055cd..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/issue-238/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "private": true -} diff --git a/fixtures/enhanced_resolve/test/fixtures/issue-238/src/a/config.js b/fixtures/enhanced_resolve/test/fixtures/issue-238/src/a/config.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/issue-238/src/common/config/myObjectFile.js b/fixtures/enhanced_resolve/test/fixtures/issue-238/src/common/config/myObjectFile.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/lib.js b/fixtures/enhanced_resolve/test/fixtures/lib.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/lib/complex1.js b/fixtures/enhanced_resolve/test/fixtures/lib/complex1.js deleted file mode 100644 index b3de3d70..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/lib/complex1.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "lib complex1"; diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self/index.js b/fixtures/enhanced_resolve/test/fixtures/main-field-self/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json b/fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json deleted file mode 100644 index a2b6f341..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "./" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self2/index.js b/fixtures/enhanced_resolve/test/fixtures/main-field-self2/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json b/fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json deleted file mode 100644 index 4fa6f730..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "." -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main1.js b/fixtures/enhanced_resolve/test/fixtures/main1.js deleted file mode 100644 index 168f2a1e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main1.js +++ /dev/null @@ -1,9 +0,0 @@ -var a = require("./a"); -if (x) { - for (var i = 0; i < 100; i++) { - while (true) require("./b"); - do { - i++; - } while (require("m1/a")()); - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main2.js b/fixtures/enhanced_resolve/test/fixtures/main2.js deleted file mode 100644 index 39f062b1..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main2.js +++ /dev/null @@ -1,12 +0,0 @@ -var 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"); - }); - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main3.js b/fixtures/enhanced_resolve/test/fixtures/main3.js deleted file mode 100644 index 1c180166..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main3.js +++ /dev/null @@ -1,4 +0,0 @@ -var a = require("./a"); -require.ensure([], function(require) { - require("./c.js"); -}); diff --git a/fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js b/fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js deleted file mode 100644 index 997c1051..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is nested m1/a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/no#fragment/#/#.js b/fixtures/enhanced_resolve/test/fixtures/no#fragment/#/#.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/no.js b/fixtures/enhanced_resolve/test/fixtures/no.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/browser.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/browser.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/main.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json deleted file mode 100644 index c469e1fd..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "main": "./main.js", - "browser": "./browser.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js deleted file mode 100644 index 549620a5..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "the correct a.js"; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js deleted file mode 100644 index 5db6632e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = " :) " + require("m2/b.js"); diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js deleted file mode 100644 index d308569d..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require("m1/a") + require("m1"); diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js deleted file mode 100644 index cb8127e8..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "Step2"; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json deleted file mode 100644 index 8d6dfa56..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "dash-name", - "exports": "./index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json deleted file mode 100644 index 4fd8706e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "dash", - "exports": "./index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/invalidPackageJson/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/invalidPackageJson/package.json deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js deleted file mode 100644 index 46fc8e6c..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is m1/a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js deleted file mode 100644 index 8565c244..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is m1/b"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js deleted file mode 100644 index 34faaaf5..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "This is m2/b"; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/file.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/file.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js b/fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js deleted file mode 100644 index 997c1051..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is nested m1/a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/dir/index.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/dir/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/index.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/main.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/browser.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/browser.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/index.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json deleted file mode 100644 index e20ceaeb..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "main": "main.js", - "browser": { - "./package-alias/index.js": "./package-alias/browser.js", - "module": "pkg/dir/index" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/typescript/index.ts b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/typescript/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json deleted file mode 100644 index 4a1f838e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "@exports-field/core", - "version": "1.0.0", - "exports": { - ".": "./a.js", - "./x": "./a.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/prefer-pnp/alternative-modules/m1/b.js b/fixtures/enhanced_resolve/test/fixtures/prefer-pnp/alternative-modules/m1/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.css b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.css deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.js b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json deleted file mode 100644 index 14ab704d..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/index.css b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/index.css deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/module.js b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/module.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json deleted file mode 100644 index ee0eb71b..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "main": "../../../c.js", - "module": "module.js", - "style": "index.css" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/roots_fall_through/index.js b/fixtures/enhanced_resolve/test/fixtures/roots_fall_through/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/main.js b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json deleted file mode 100644 index 70a0f20f..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "browser": { - "./index.js": "./main.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/lib/index.js b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/lib/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/main.js b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json deleted file mode 100644 index 2af9e0d1..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "./main.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/shortcutdir.js/a.js b/fixtures/enhanced_resolve/test/fixtures/shortcutdir.js/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/b b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/b deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/c b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/c deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/a b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/a deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/b b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/b deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/b/foo/a b/fixtures/enhanced_resolve/test/fixtures/yield/b/foo/a deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/a b/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/a deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json b/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json deleted file mode 100644 index 0acc4b4c..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "foo", - "version": "1.0.0", - "browser": { - "./a": false - } -} diff --git "a/fixtures/enhanced_resolve/test/fixtures/\346\265\213\350\257\225.js" "b/fixtures/enhanced_resolve/test/fixtures/\346\265\213\350\257\225.js" deleted file mode 100644 index e69de29b..00000000 diff --git "a/fixtures/misc/\344\270\255\346\226\207/\344\270\255\346\226\207.js" "b/fixtures/misc/\344\270\255\346\226\207/\344\270\255\346\226\207.js" deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/pnpm8/.gitignore b/fixtures/pnpm8/.gitignore deleted file mode 100644 index 3c3629e6..00000000 --- a/fixtures/pnpm8/.gitignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/fixtures/pnpm8/package.json b/fixtures/pnpm8/package.json deleted file mode 100644 index cbced892..00000000 --- a/fixtures/pnpm8/package.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "name": "pnpm8", - "version": "1.0.0", - "private": true, - "engines": { - "node": ">=16.0.0" - }, - "packageManager": "pnpm@8.10.5", - "devDependencies": { - "axios": "1.6.2", - "styled-components": "6.1.1", - "postcss": "8.4.33" - } -} diff --git a/fixtures/pnpm8/pnpm-lock.yaml b/fixtures/pnpm8/pnpm-lock.yaml deleted file mode 100644 index e51dfd6a..00000000 --- a/fixtures/pnpm8/pnpm-lock.yaml +++ /dev/null @@ -1,212 +0,0 @@ -lockfileVersion: '6.0' - -settings: - autoInstallPeers: true - excludeLinksFromLockfile: false - -devDependencies: - axios: - specifier: 1.6.2 - version: 1.6.2 - postcss: - specifier: 8.4.33 - version: 8.4.33 - styled-components: - specifier: 6.1.1 - version: 6.1.1(react-dom@18.2.0)(react@18.2.0) - -packages: - - /@emotion/is-prop-valid@1.2.1: - resolution: {integrity: sha512-61Mf7Ufx4aDxx1xlDeOm8aFFigGHE4z+0sKCa+IHCeZKiyP9RLD0Mmx7m8b9/Cf37f7NAvQOOJAbQQGVr5uERw==} - dependencies: - '@emotion/memoize': 0.8.1 - dev: true - - /@emotion/memoize@0.8.1: - resolution: {integrity: sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA==} - dev: true - - /@emotion/unitless@0.8.1: - resolution: {integrity: sha512-KOEGMu6dmJZtpadb476IsZBclKvILjopjUii3V+7MnXIQCYh8W3NgNcgwo21n9LXZX6EDIKvqfjYxXebDwxKmQ==} - dev: true - - /@types/stylis@4.2.4: - resolution: {integrity: sha512-36ZrGJ8fgtBr6nwNnuJ9jXIj+bn/pF6UoqmrQT7+Y99+tFFeHHsoR54+194dHdyhPjgbeoNz3Qru0oRt0l6ASQ==} - dev: true - - /asynckit@0.4.0: - resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} - dev: true - - /axios@1.6.2: - resolution: {integrity: sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A==} - dependencies: - follow-redirects: 1.15.3 - form-data: 4.0.0 - proxy-from-env: 1.1.0 - transitivePeerDependencies: - - debug - dev: true - - /camelize@1.0.1: - resolution: {integrity: sha512-dU+Tx2fsypxTgtLoE36npi3UqcjSSMNYfkqgmoEhtZrraP5VWq0K7FkWVTYa8eMPtnU/G2txVsfdCJTn9uzpuQ==} - dev: true - - /combined-stream@1.0.8: - resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} - engines: {node: '>= 0.8'} - dependencies: - delayed-stream: 1.0.0 - dev: true - - /css-color-keywords@1.0.0: - resolution: {integrity: sha512-FyyrDHZKEjXDpNJYvVsV960FiqQyXc/LlYmsxl2BcdMb2WPx0OGRVgTg55rPSyLSNMqP52R9r8geSp7apN3Ofg==} - engines: {node: '>=4'} - dev: true - - /css-to-react-native@3.2.0: - resolution: {integrity: sha512-e8RKaLXMOFii+02mOlqwjbD00KSEKqblnpO9e++1aXS1fPQOpS1YoqdVHBqPjHNoxeF2mimzVqawm2KCbEdtHQ==} - dependencies: - camelize: 1.0.1 - css-color-keywords: 1.0.0 - postcss-value-parser: 4.2.0 - dev: true - - /csstype@3.1.2: - resolution: {integrity: sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==} - dev: true - - /delayed-stream@1.0.0: - resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} - engines: {node: '>=0.4.0'} - dev: true - - /follow-redirects@1.15.3: - resolution: {integrity: sha512-1VzOtuEM8pC9SFU1E+8KfTjZyMztRsgEfwQl44z8A25uy13jSzTj6dyK2Df52iV0vgHCfBwLhDWevLn95w5v6Q==} - engines: {node: '>=4.0'} - peerDependencies: - debug: '*' - peerDependenciesMeta: - debug: - optional: true - dev: true - - /form-data@4.0.0: - resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==} - engines: {node: '>= 6'} - dependencies: - asynckit: 0.4.0 - combined-stream: 1.0.8 - mime-types: 2.1.35 - dev: true - - /js-tokens@4.0.0: - resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} - dev: true - - /loose-envify@1.4.0: - resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==} - hasBin: true - dependencies: - js-tokens: 4.0.0 - dev: true - - /mime-db@1.52.0: - resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} - engines: {node: '>= 0.6'} - dev: true - - /mime-types@2.1.35: - resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} - engines: {node: '>= 0.6'} - dependencies: - mime-db: 1.52.0 - dev: true - - /nanoid@3.3.7: - resolution: {integrity: sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==} - engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} - hasBin: true - dev: true - - /picocolors@1.0.0: - resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==} - dev: true - - /postcss-value-parser@4.2.0: - resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==} - dev: true - - /postcss@8.4.33: - resolution: {integrity: sha512-Kkpbhhdjw2qQs2O2DGX+8m5OVqEcbB9HRBvuYM9pgrjEFUg30A9LmXNlTAUj4S9kgtGyrMbTzVjH7E+s5Re2yg==} - engines: {node: ^10 || ^12 || >=14} - dependencies: - nanoid: 3.3.7 - picocolors: 1.0.0 - source-map-js: 1.0.2 - dev: true - - /proxy-from-env@1.1.0: - resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==} - dev: true - - /react-dom@18.2.0(react@18.2.0): - resolution: {integrity: sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==} - peerDependencies: - react: ^18.2.0 - dependencies: - loose-envify: 1.4.0 - react: 18.2.0 - scheduler: 0.23.0 - dev: true - - /react@18.2.0: - resolution: {integrity: sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==} - engines: {node: '>=0.10.0'} - dependencies: - loose-envify: 1.4.0 - dev: true - - /scheduler@0.23.0: - resolution: {integrity: sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw==} - dependencies: - loose-envify: 1.4.0 - dev: true - - /shallowequal@1.1.0: - resolution: {integrity: sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ==} - dev: true - - /source-map-js@1.0.2: - resolution: {integrity: sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==} - engines: {node: '>=0.10.0'} - dev: true - - /styled-components@6.1.1(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-cpZZP5RrKRIClBW5Eby4JM1wElLVP4NQrJbJ0h10TidTyJf4SIIwa3zLXOoPb4gJi8MsJ8mjq5mu2IrEhZIAcQ==} - engines: {node: '>= 16'} - peerDependencies: - react: '>= 16.8.0' - react-dom: '>= 16.8.0' - dependencies: - '@emotion/is-prop-valid': 1.2.1 - '@emotion/unitless': 0.8.1 - '@types/stylis': 4.2.4 - css-to-react-native: 3.2.0 - csstype: 3.1.2 - postcss: 8.4.33 - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - shallowequal: 1.1.0 - stylis: 4.3.0 - tslib: 2.6.2 - dev: true - - /stylis@4.3.0: - resolution: {integrity: sha512-E87pIogpwUsUwXw7dNyU4QDjdgVMy52m+XEOPEKUn161cCzWjjhPSQhByfd1CcNvrOLnXQ6OnnZDwnJrz/Z4YQ==} - dev: true - - /tslib@2.6.2: - resolution: {integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==} - dev: true diff --git a/fixtures/tsconfig/cases/builtins/thing.js b/fixtures/tsconfig/cases/builtins/thing.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/builtins/tsconfig.json b/fixtures/tsconfig/cases/builtins/tsconfig.json deleted file mode 100644 index 36aa1a4d..00000000 --- a/fixtures/tsconfig/cases/builtins/tsconfig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compilerOptions": { - "baseUrl": "." - } -} diff --git a/fixtures/tsconfig/cases/exports/index.js b/fixtures/tsconfig/cases/exports/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/exports/tsconfig.json b/fixtures/tsconfig/cases/exports/tsconfig.json deleted file mode 100644 index f0e3159b..00000000 --- a/fixtures/tsconfig/cases/exports/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-exports" -} diff --git a/fixtures/tsconfig/cases/extends-extension/base-tsconfig.json b/fixtures/tsconfig/cases/extends-extension/base-tsconfig.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/cases/extends-extension/base-tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/cases/extends-extension/foo.js b/fixtures/tsconfig/cases/extends-extension/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-extension/tsconfig.json b/fixtures/tsconfig/cases/extends-extension/tsconfig.json deleted file mode 100644 index 0ae4c6a3..00000000 --- a/fixtures/tsconfig/cases/extends-extension/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./base-tsconfig" -} diff --git a/fixtures/tsconfig/cases/extends-extensionless/foo.js b/fixtures/tsconfig/cases/extends-extensionless/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-extensionless/tsconfig.json b/fixtures/tsconfig/cases/extends-extensionless/tsconfig.json deleted file mode 100644 index c36cb7d4..00000000 --- a/fixtures/tsconfig/cases/extends-extensionless/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-field/conf" -} diff --git a/fixtures/tsconfig/cases/extends-multiple/foo.js b/fixtures/tsconfig/cases/extends-multiple/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-multiple/tsconfig.json b/fixtures/tsconfig/cases/extends-multiple/tsconfig.json deleted file mode 100644 index aa2ae783..00000000 --- a/fixtures/tsconfig/cases/extends-multiple/tsconfig.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": ["../extends-extension", "../extends-paths"], - "compilerOptions": { - "baseUrl": ".", - }, -} diff --git a/fixtures/tsconfig/cases/extends-not-found/index.js b/fixtures/tsconfig/cases/extends-not-found/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-not-found/tsconfig.json b/fixtures/tsconfig/cases/extends-not-found/tsconfig.json deleted file mode 100644 index 99df91da..00000000 --- a/fixtures/tsconfig/cases/extends-not-found/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./not-found" -} diff --git a/fixtures/tsconfig/cases/extends-paths/src/index.js b/fixtures/tsconfig/cases/extends-paths/src/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-paths/tsconfig.base.json b/fixtures/tsconfig/cases/extends-paths/tsconfig.base.json deleted file mode 100644 index 5c64b067..00000000 --- a/fixtures/tsconfig/cases/extends-paths/tsconfig.base.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "@/*": ["./*"] - } - } -} diff --git a/fixtures/tsconfig/cases/extends-paths/tsconfig.json b/fixtures/tsconfig/cases/extends-paths/tsconfig.json deleted file mode 100644 index 51086018..00000000 --- a/fixtures/tsconfig/cases/extends-paths/tsconfig.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": "./tsconfig.base.json", - "compilerOptions": { - "baseUrl": "src", - }, -} diff --git a/fixtures/tsconfig/cases/field/index.js b/fixtures/tsconfig/cases/field/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/field/tsconfig.json b/fixtures/tsconfig/cases/field/tsconfig.json deleted file mode 100644 index 9f86c3f4..00000000 --- a/fixtures/tsconfig/cases/field/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-field" -} diff --git a/fixtures/tsconfig/cases/index/index.js b/fixtures/tsconfig/cases/index/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/index/tsconfig.json b/fixtures/tsconfig/cases/index/tsconfig.json deleted file mode 100644 index d20b1774..00000000 --- a/fixtures/tsconfig/cases/index/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-index" -} diff --git a/fixtures/tsconfig/cases/paths_template_variable/foo.js b/fixtures/tsconfig/cases/paths_template_variable/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json b/fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json deleted file mode 100644 index a1a37bb6..00000000 --- a/fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "../../tsconfig_template_variable.json" -} diff --git a/fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json b/fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json deleted file mode 100644 index e7d8e5e5..00000000 --- a/fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "compilerOptions": { - "composite": true, - "paths": { - "foo": ["${configDir}/foo.js"] - } - } -} diff --git a/fixtures/tsconfig/cases/project_references/app/aliased/index.ts b/fixtures/tsconfig/cases/project_references/app/aliased/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/app/index.ts b/fixtures/tsconfig/cases/project_references/app/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/app/tsconfig.json b/fixtures/tsconfig/cases/project_references/app/tsconfig.json deleted file mode 100644 index 7036d2bb..00000000 --- a/fixtures/tsconfig/cases/project_references/app/tsconfig.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "extends": "../tsconfig.base.json", - "compilerOptions": { - "baseUrl": "./", - "paths": { - "@/*": ["./aliased/*"] - } - }, - "references": [ - { - "path": "../project_a/conf.json" - }, - { - "path": "../project_b" - }, - { - "path": "../project_c/tsconfig.json" - }, - { - "path": "../../paths_template_variable/tsconfig2.json" - } - ] -} diff --git a/fixtures/tsconfig/cases/project_references/project_a/aliased/index.ts b/fixtures/tsconfig/cases/project_references/project_a/aliased/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_a/conf.json b/fixtures/tsconfig/cases/project_references/project_a/conf.json deleted file mode 100644 index 4d389d7a..00000000 --- a/fixtures/tsconfig/cases/project_references/project_a/conf.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "compilerOptions": { - "composite": true, - "paths": { - "@/*": ["./aliased/*"] - } - } -} diff --git a/fixtures/tsconfig/cases/project_references/project_a/index.ts b/fixtures/tsconfig/cases/project_references/project_a/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_b/src/aliased/index.ts b/fixtures/tsconfig/cases/project_references/project_b/src/aliased/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_b/tsconfig.json b/fixtures/tsconfig/cases/project_references/project_b/tsconfig.json deleted file mode 100644 index 4ab05cd8..00000000 --- a/fixtures/tsconfig/cases/project_references/project_b/tsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "compilerOptions": { - "composite": true, - "baseUrl": "./src", - "paths": { - "@/*": ["./aliased/*"] - } - } -} diff --git a/fixtures/tsconfig/cases/project_references/project_c/index.ts b/fixtures/tsconfig/cases/project_references/project_c/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_c/tsconfig.json b/fixtures/tsconfig/cases/project_references/project_c/tsconfig.json deleted file mode 100644 index fe520939..00000000 --- a/fixtures/tsconfig/cases/project_references/project_c/tsconfig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compilerOptions": { - "composite": true - } -} diff --git a/fixtures/tsconfig/cases/project_references/tsconfig.base.json b/fixtures/tsconfig/cases/project_references/tsconfig.base.json deleted file mode 100644 index 88ccffe7..00000000 --- a/fixtures/tsconfig/cases/project_references/tsconfig.base.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "compilerOptions": { - } -} diff --git a/fixtures/tsconfig/cases/suffixes/a.ios.ts b/fixtures/tsconfig/cases/suffixes/a.ios.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/a.ts b/fixtures/tsconfig/cases/suffixes/a.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/b.ts b/fixtures/tsconfig/cases/suffixes/b.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/c-test.ts b/fixtures/tsconfig/cases/suffixes/c-test.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/index.ts b/fixtures/tsconfig/cases/suffixes/index.ts deleted file mode 100644 index b09939b9..00000000 --- a/fixtures/tsconfig/cases/suffixes/index.ts +++ /dev/null @@ -1 +0,0 @@ -import './a'; diff --git a/fixtures/tsconfig/cases/suffixes/tsconfig.json b/fixtures/tsconfig/cases/suffixes/tsconfig.json deleted file mode 100644 index 4c2ccc8f..00000000 --- a/fixtures/tsconfig/cases/suffixes/tsconfig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compilerOptions": { - "moduleSuffixes": [".ios", "-test", ""] - } -} diff --git a/fixtures/tsconfig/cases/trailing-comma/bar.js b/fixtures/tsconfig/cases/trailing-comma/bar.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/trailing-comma/index.js b/fixtures/tsconfig/cases/trailing-comma/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/trailing-comma/tsconfig.json b/fixtures/tsconfig/cases/trailing-comma/tsconfig.json deleted file mode 100644 index 6dc20ca5..00000000 --- a/fixtures/tsconfig/cases/trailing-comma/tsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "compilerOptions": { - "paths": { - /* some comment */ - "foo": ["bar.js"], - }, - }, - // another comment -} diff --git a/fixtures/tsconfig/foo.js b/fixtures/tsconfig/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/nested/index.js b/fixtures/tsconfig/nested/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/nested/test.js b/fixtures/tsconfig/nested/test.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/nested/tsconfig.json b/fixtures/tsconfig/nested/tsconfig.json deleted file mode 100644 index 6deb3011..00000000 --- a/fixtures/tsconfig/nested/tsconfig.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "extends": "..", - "compilerOptions": { - "paths": { - "ts-path": ["test.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-exports/conf.json b/fixtures/tsconfig/node_modules/tsconfig-exports/conf.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-exports/conf.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-exports/foo.js b/fixtures/tsconfig/node_modules/tsconfig-exports/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-exports/package.json b/fixtures/tsconfig/node_modules/tsconfig-exports/package.json deleted file mode 100644 index be0ddee6..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-exports/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "tsconfig-exports", - "private": true, - "exports": { - ".": "./conf.json" - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-field/conf.json b/fixtures/tsconfig/node_modules/tsconfig-field/conf.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-field/conf.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-field/foo.js b/fixtures/tsconfig/node_modules/tsconfig-field/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-field/package.json b/fixtures/tsconfig/node_modules/tsconfig-field/package.json deleted file mode 100644 index 7138fdde..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-field/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "tsconfig-field", - "private": true, - "tsconfig": "conf.json" -} \ No newline at end of file diff --git a/fixtures/tsconfig/node_modules/tsconfig-index/foo.js b/fixtures/tsconfig/node_modules/tsconfig-index/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-index/package.json b/fixtures/tsconfig/node_modules/tsconfig-index/package.json deleted file mode 100644 index eb2431e7..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-index/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "tsconfig-index", - "private": true -} \ No newline at end of file diff --git a/fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json b/fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-not-used/foo.js b/fixtures/tsconfig/node_modules/tsconfig-not-used/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json b/fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json deleted file mode 100644 index eb16d127..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "ts-path": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/package.json b/fixtures/tsconfig/package.json deleted file mode 100755 index f48acd1c..00000000 --- a/fixtures/tsconfig/package.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "name": "resolver", - "private": true, - "alias": { - "aliased": "foo", - "aliased-file": "./bar.js", - "something": "./nested/test.js", - "aliasedfolder": "./nested", - "aliasedabsolute": "/nested", - "foo/bar": "./bar.js", - "glob/*/*": "./nested/$2", - "./baz": "./bar.js", - "url": false - }, - "imports": { - "#test": "./bar.js" - }, - "dependencies": { - "foo": "^0.3.4" - }, - "peerDependencies": { - "bar": "*" - } -} diff --git a/fixtures/tsconfig/tsconfig.json b/fixtures/tsconfig/tsconfig.json deleted file mode 100644 index eb16d127..00000000 --- a/fixtures/tsconfig/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "ts-path": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/tsconfig_template_variable.json b/fixtures/tsconfig/tsconfig_template_variable.json deleted file mode 100644 index 6f272344..00000000 --- a/fixtures/tsconfig/tsconfig_template_variable.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["${configDir}/foo.js"] - } - } -} diff --git a/napi/__test__/resolver.spec.mjs b/napi/__test__/resolver.spec.mjs deleted file mode 100644 index 42bafba9..00000000 --- a/napi/__test__/resolver.spec.mjs +++ /dev/null @@ -1,259 +0,0 @@ -import { join } from 'node:path' -import { fileURLToPath } from 'node:url' - -import test from 'ava' - -let ResolverFactory - -if (process.env.WASI_TEST) { - const wasi = await import('../resolver.wasi.cjs') - ResolverFactory = wasi.ResolverFactory -} else { - const napi = await import('../index.js') - ResolverFactory = napi.ResolverFactory -} - -const currentDir = join(fileURLToPath(import.meta.url), '..') - -const enhancedResolveRoot = join( - currentDir, - '..', - '..', - 'fixtures', - 'enhanced_resolve', - 'test', - 'fixtures' -) - -// https://github.com/webpack/enhanced-resolve/blob/main/test/resolve.test.js - -for (const [title, context, request, expected] of [ - [ - 'absolute path', - enhancedResolveRoot, - join(enhancedResolveRoot, 'main1.js'), - join(enhancedResolveRoot, 'main1.js'), - ], - [ - 'file with .js', - enhancedResolveRoot, - './main1.js', - join(enhancedResolveRoot, 'main1.js'), - ], - [ - 'file without extension', - enhancedResolveRoot, - './main1', - join(enhancedResolveRoot, 'main1.js'), - ], - [ - 'another file with .js', - enhancedResolveRoot, - './a.js', - join(enhancedResolveRoot, 'a.js'), - ], - [ - 'another file without extension', - enhancedResolveRoot, - './a', - join(enhancedResolveRoot, 'a.js'), - ], - [ - 'file in module with .js', - enhancedResolveRoot, - 'm1/a.js', - join(enhancedResolveRoot, 'node_modules/m1/a.js'), - ], - [ - 'file in module without extension', - enhancedResolveRoot, - 'm1/a', - join(enhancedResolveRoot, 'node_modules/m1/a.js'), - ], - [ - 'another file in module without extension', - enhancedResolveRoot, - 'complexm/step1', - join(enhancedResolveRoot, 'node_modules/complexm/step1.js'), - ], - [ - 'from submodule to file in sibling module', - join(enhancedResolveRoot, 'node_modules/complexm'), - 'm2/b.js', - join(enhancedResolveRoot, 'node_modules/m2/b.js'), - ], - [ - 'from nested directory to overwritten file in module', - join(enhancedResolveRoot, 'multiple_modules'), - 'm1/a.js', - join(enhancedResolveRoot, 'multiple_modules/node_modules/m1/a.js'), - ], - [ - 'from nested directory to not overwritten file in module', - join(enhancedResolveRoot, 'multiple_modules'), - 'm1/b.js', - join(enhancedResolveRoot, 'node_modules/m1/b.js'), - ], - [ - 'file with query', - enhancedResolveRoot, - './main1.js?query', - join(enhancedResolveRoot, 'main1.js?query'), - ], - [ - 'file with fragment', - enhancedResolveRoot, - './main1.js#fragment', - join(enhancedResolveRoot, 'main1.js#fragment'), - ], - [ - 'file with fragment and query', - enhancedResolveRoot, - './main1.js#fragment?query', - join(enhancedResolveRoot, 'main1.js#fragment?query'), - ], - [ - 'file with query and fragment', - enhancedResolveRoot, - './main1.js?#fragment', - join(enhancedResolveRoot, 'main1.js?#fragment'), - ], - - [ - 'file with query (unicode)', - enhancedResolveRoot, - './测试.js?query', - join(enhancedResolveRoot, '测试.js?query'), - ], - [ - 'file with fragment (unicode)', - enhancedResolveRoot, - './测试.js#fragment', - join(enhancedResolveRoot, '测试.js#fragment'), - ], - [ - 'file with fragment and query (unicode)', - enhancedResolveRoot, - './测试.js#fragment?query', - join(enhancedResolveRoot, '测试.js#fragment?query'), - ], - [ - 'file with query and fragment (unicode)', - enhancedResolveRoot, - './测试.js?#fragment', - join(enhancedResolveRoot, '测试.js?#fragment'), - ], - - [ - 'file in module with query', - enhancedResolveRoot, - 'm1/a?query', - join(enhancedResolveRoot, 'node_modules/m1/a.js?query'), - ], - [ - 'file in module with fragment', - enhancedResolveRoot, - 'm1/a#fragment', - join(enhancedResolveRoot, 'node_modules/m1/a.js#fragment'), - ], - [ - 'file in module with fragment and query', - enhancedResolveRoot, - 'm1/a#fragment?query', - join(enhancedResolveRoot, 'node_modules/m1/a.js#fragment?query'), - ], - [ - 'file in module with query and fragment', - enhancedResolveRoot, - 'm1/a?#fragment', - join(enhancedResolveRoot, 'node_modules/m1/a.js?#fragment'), - ], - [ - 'differ between directory and file, resolve file', - enhancedResolveRoot, - './dirOrFile', - join(enhancedResolveRoot, 'dirOrFile.js'), - ], - [ - 'differ between directory and file, resolve directory', - enhancedResolveRoot, - './dirOrFile/', - join(enhancedResolveRoot, 'dirOrFile/index.js'), - ], - [ - 'find node_modules outside of node_modules', - join(enhancedResolveRoot, 'browser-module/node_modules'), - 'm1/a', - join(enhancedResolveRoot, 'node_modules/m1/a.js'), - ], - [ - "don't crash on main field pointing to self", - enhancedResolveRoot, - './main-field-self', - join(enhancedResolveRoot, './main-field-self/index.js'), - ], - [ - "don't crash on main field pointing to self (2)", - enhancedResolveRoot, - './main-field-self2', - join(enhancedResolveRoot, './main-field-self2/index.js'), - ], - // enhanced-resolve has `#` prepended with a `\0`, they are removed from the - // following 3 expected test results. - // See https://github.com/webpack/enhanced-resolve#escaping - [ - 'handle fragment edge case (no fragment)', - enhancedResolveRoot, - './no#fragment/#/#', - join(enhancedResolveRoot, 'no#fragment', '#', '#.js'), - ], - [ - 'handle fragment edge case (fragment)', - enhancedResolveRoot, - './no#fragment/#/', - join(enhancedResolveRoot, 'no.js#fragment') + '/#/', - ], - [ - 'handle fragment escaping', - enhancedResolveRoot, - './no\0#fragment/\0#/\0##fragment', - join(enhancedResolveRoot, 'no#fragment', '#', '#.js#fragment'), - ], -]) { - test(title, (t) => { - const resolver = new ResolverFactory({ - modules: ['src/a', 'src/b', 'src/common', 'node_modules'], - extensions: ['.js', '.jsx', '.ts', '.tsx'], - }) - - t.is(resolver.sync(context, request).path, expected) - }) -} - -test('resolve pnpm package', (t) => { - const pnpmProjectPath = join(currentDir, '..', '..', 'fixtures', 'pnpm8') - const resolver = new ResolverFactory({ - aliasFields: ['browser'], - }) - t.deepEqual(resolver.sync(pnpmProjectPath, 'styled-components'), { - path: join( - pnpmProjectPath, - 'node_modules/.pnpm/styled-components@6.1.1_react-dom@18.2.0_react@18.2.0/node_modules/styled-components/dist/styled-components.browser.cjs.js' - ), - }) - t.deepEqual( - resolver.sync( - join( - pnpmProjectPath, - 'node_modules/.pnpm/styled-components@6.1.1_react-dom@18.2.0_react@18.2.0/node_modules/styled-components' - ), - 'react' - ), - { - path: join( - pnpmProjectPath, - 'node_modules/.pnpm/react@18.2.0/node_modules/react/index.js' - ), - } - ) -}) diff --git a/napi/src/lib.rs b/napi/src/lib.rs deleted file mode 100644 index 238f99c4..00000000 --- a/napi/src/lib.rs +++ /dev/null @@ -1,166 +0,0 @@ -extern crate napi; -extern crate napi_derive; -extern crate oxc_resolver; - -use std::path::{Path, PathBuf}; - -use napi_derive::napi; -use oxc_resolver::{ResolveOptions, Resolver}; - -use self::options::{NapiResolveOptions, StrOrStrList}; - -mod options; - -#[napi(object)] -pub struct ResolveResult { - pub path: Option, - pub error: Option, -} - -fn resolve(resolver: &Resolver, path: &Path, request: &str) -> ResolveResult { - match resolver.resolve(path, request) { - Ok(resolution) => ResolveResult { - path: Some(resolution.full_path().to_string_lossy().to_string()), - error: None, - }, - Err(err) => ResolveResult { path: None, error: Some(err.to_string()) }, - } -} - -#[allow(clippy::needless_pass_by_value)] -#[napi] -pub fn sync(path: String, request: String) -> ResolveResult { - let path = PathBuf::from(path); - let resolver = Resolver::new(ResolveOptions::default()); - resolve(&resolver, &path, &request) -} - -#[napi] -pub struct ResolverFactory { - resolver: Resolver, -} - -#[napi] -impl ResolverFactory { - #[napi(constructor)] - pub fn new(options: NapiResolveOptions) -> Self { - Self { resolver: Resolver::new(Self::normalize_options(options)) } - } - - #[napi] - pub fn default() -> Self { - let default_options = ResolveOptions::default(); - Self { resolver: Resolver::new(default_options) } - } - - /// Clone the resolver using the same underlying cache. - #[napi] - pub fn clone_with_options(&self, options: NapiResolveOptions) -> Self { - Self { resolver: self.resolver.clone_with_options(Self::normalize_options(options)) } - } - - /// Clear the underlying cache. - #[napi] - pub fn clear_cache(&self) { - self.resolver.clear_cache(); - } - - #[allow(clippy::needless_pass_by_value)] - #[napi] - pub fn sync(&self, path: String, request: String) -> ResolveResult { - let path = PathBuf::from(path); - resolve(&self.resolver, &path, &request) - } - - fn normalize_options(op: NapiResolveOptions) -> ResolveOptions { - let default = ResolveOptions::default(); - // merging options - ResolveOptions { - tsconfig: op.tsconfig.map(|tsconfig| tsconfig.into()), - alias: op - .alias - .map(|alias| { - alias - .into_iter() - .map(|(k, v)| { - let v = v - .into_iter() - .map(|item| match item { - Some(path) => oxc_resolver::AliasValue::from(path), - None => oxc_resolver::AliasValue::Ignore, - }) - .collect(); - (k, v) - }) - .collect::>() - }) - .unwrap_or(default.alias), - alias_fields: op - .alias_fields - .map(|o| o.into_iter().map(|x| StrOrStrList(x).into()).collect::>()) - .unwrap_or(default.alias_fields), - condition_names: op.condition_names.unwrap_or(default.condition_names), - description_files: op.description_files.unwrap_or(default.description_files), - enforce_extension: op - .enforce_extension - .map(|enforce_extension| enforce_extension.into()) - .unwrap_or(default.enforce_extension), - exports_fields: op - .exports_fields - .map(|o| o.into_iter().map(|x| StrOrStrList(x).into()).collect::>()) - .unwrap_or(default.exports_fields), - imports_fields: op - .imports_fields - .map(|o| o.into_iter().map(|x| StrOrStrList(x).into()).collect::>()) - .unwrap_or(default.imports_fields), - extension_alias: op - .extension_alias - .map(|extension_alias| extension_alias.into_iter().collect::>()) - .unwrap_or(default.extension_alias), - extensions: op.extensions.unwrap_or(default.extensions), - fallback: op - .fallback - .map(|fallback| { - fallback - .into_iter() - .map(|(k, v)| { - let v = v - .into_iter() - .map(|item| match item { - Some(path) => oxc_resolver::AliasValue::from(path), - None => oxc_resolver::AliasValue::Ignore, - }) - .collect(); - (k, v) - }) - .collect::>() - }) - .unwrap_or(default.fallback), - fully_specified: op.fully_specified.unwrap_or(default.fully_specified), - main_fields: op - .main_fields - .map(|o| StrOrStrList(o).into()) - .unwrap_or(default.main_fields), - main_files: op.main_files.unwrap_or(default.main_files), - modules: op.modules.map(|o| StrOrStrList(o).into()).unwrap_or(default.modules), - resolve_to_context: op.resolve_to_context.unwrap_or(default.resolve_to_context), - prefer_relative: op.prefer_relative.unwrap_or(default.prefer_relative), - prefer_absolute: op.prefer_absolute.unwrap_or(default.prefer_absolute), - restrictions: op - .restrictions - .map(|restrictions| { - restrictions - .into_iter() - .map(|restriction| restriction.into()) - .collect::>() - }) - .unwrap_or(default.restrictions), - roots: op - .roots - .map(|roots| roots.into_iter().map(PathBuf::from).collect::>()) - .unwrap_or(default.roots), - symlinks: op.symlinks.unwrap_or(default.symlinks), - builtin_modules: op.builtin_modules.unwrap_or(default.builtin_modules), - } - } -} diff --git a/napi/src/options.rs b/napi/src/options.rs deleted file mode 100644 index ea35672f..00000000 --- a/napi/src/options.rs +++ /dev/null @@ -1,261 +0,0 @@ -use std::path::PathBuf; - -use napi::Either; -use napi_derive::napi; -use std::collections::HashMap; - -/// Module Resolution Options -/// -/// Options are directly ported from [enhanced-resolve](https://github.com/webpack/enhanced-resolve#resolver-options). -/// -/// See [webpack resolve](https://webpack.js.org/configuration/resolve/) for information and examples -#[derive(Debug, Clone)] -#[napi(object)] -pub struct NapiResolveOptions { - /// Path to TypeScript configuration file. - /// - /// Default `None` - pub tsconfig: Option, - - /// Alias for [ResolveOptions::alias] and [ResolveOptions::fallback]. - /// - /// For the second value of the tuple, `None -> AliasValue::Ignore`, Some(String) -> - /// AliasValue::Path(String)` - /// Create aliases to import or require certain modules more easily. - /// A trailing $ can also be added to the given object's keys to signify an exact match. - pub alias: Option>>>, - - /// A list of alias fields in description files. - /// Specify a field, such as `browser`, to be parsed according to [this specification](https://github.com/defunctzombie/package-browser-field-spec). - /// Can be a path to json object such as `["path", "to", "exports"]`. - /// - /// Default `[]` - #[napi(ts_type = "(string | string[])[]")] - pub alias_fields: Option>, - - /// Condition names for exports field which defines entry points of a package. - /// The key order in the exports field is significant. During condition matching, earlier entries have higher priority and take precedence over later entries. - /// - /// Default `[]` - pub condition_names: Option>, - - /// The JSON files to use for descriptions. (There was once a `bower.json`.) - /// - /// Default `["package.json"]` - pub description_files: Option>, - - /// If true, it will not allow extension-less files. - /// So by default `require('./foo')` works if `./foo` has a `.js` extension, - /// but with this enabled only `require('./foo.js')` will work. - /// - /// Default to `true` when [ResolveOptions::extensions] contains an empty string. - /// Use `Some(false)` to disable the behavior. - /// See - /// - /// Default None, which is the same as `Some(false)` when the above empty rule is not applied. - pub enforce_extension: Option, - - /// A list of exports fields in description files. - /// Can be a path to json object such as `["path", "to", "exports"]`. - /// - /// Default `[["exports"]]`. - #[napi(ts_type = "(string | string[])[]")] - pub exports_fields: Option>, - - /// Fields from `package.json` which are used to provide the internal requests of a package - /// (requests starting with # are considered internal). - /// - /// Can be a path to a JSON object such as `["path", "to", "imports"]`. - /// - /// Default `[["imports"]]`. - #[napi(ts_type = "(string | string[])[]")] - pub imports_fields: Option>, - - /// An object which maps extension to extension aliases. - /// - /// Default `{}` - pub extension_alias: Option>>, - - /// Attempt to resolve these extensions in order. - /// If multiple files share the same name but have different extensions, - /// will resolve the one with the extension listed first in the array and skip the rest. - /// - /// Default `[".js", ".json", ".node"]` - pub extensions: Option>, - - /// Redirect module requests when normal resolving fails. - /// - /// Default `[]` - pub fallback: Option>>>, - - /// 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). - /// - /// See also webpack configuration [resolve.fullySpecified](https://webpack.js.org/configuration/module/#resolvefullyspecified) - /// - /// Default `false` - pub fully_specified: Option, - - /// A list of main fields in description files - /// - /// Default `["main"]`. - #[napi(ts_type = "string | string[]")] - pub main_fields: Option, - - /// The filename to be used while resolving directories. - /// - /// Default `["index"]` - pub main_files: Option>, - - /// A list of directories to resolve modules from, can be absolute path or folder name. - /// - /// Default `["node_modules"]` - #[napi(ts_type = "string | string[]")] - pub modules: Option, - - /// Resolve to a context instead of a file. - /// - /// Default `false` - pub resolve_to_context: Option, - - /// Prefer to resolve module requests as relative requests instead of using modules from node_modules directories. - /// - /// Default `false` - pub prefer_relative: Option, - - /// Prefer to resolve server-relative urls as absolute paths before falling back to resolve in ResolveOptions::roots. - /// - /// Default `false` - pub prefer_absolute: Option, - - /// A list of resolve restrictions to restrict the paths that a request can be resolved on. - /// - /// Default `[]` - pub restrictions: Option>, - - /// A list of directories where requests of server-relative URLs (starting with '/') are resolved. - /// On non-Windows systems these requests are resolved as an absolute path first. - /// - /// Default `[]` - pub roots: Option>, - - /// Whether to resolve symlinks to their symlinked location. - /// When enabled, symlinked resources are resolved to their real path, not their symlinked location. - /// Note that this may cause module resolution to fail when using tools that symlink packages (like npm link). - /// - /// Default `true` - pub symlinks: Option, - - /// Whether to parse [module.builtinModules](https://nodejs.org/api/module.html#modulebuiltinmodules) or not. - /// For example, "zlib" will throw [crate::ResolveError::Builtin] when set to true. - /// - /// Default `false` - pub builtin_modules: Option, -} - -#[napi] -#[derive(Debug, PartialEq, Eq)] -pub enum EnforceExtension { - Auto, - Enabled, - Disabled, -} - -impl EnforceExtension { - pub fn is_auto(&self) -> bool { - *self == Self::Auto - } - - pub fn is_enabled(&self) -> bool { - *self == Self::Enabled - } - - pub fn is_disabled(&self) -> bool { - *self == Self::Disabled - } -} - -/// Alias Value for [ResolveOptions::alias] and [ResolveOptions::fallback]. -/// Use struct because napi don't support structured union now -#[napi(object)] -#[derive(Debug, Clone)] -pub struct Restriction { - pub path: Option, - pub regex: Option, -} - -/// Tsconfig Options -/// -/// Derived from [tsconfig-paths-webpack-plugin](https://github.com/dividab/tsconfig-paths-webpack-plugin#options) -#[napi(object)] -#[derive(Debug, Clone)] -pub struct TsconfigOptions { - /// Allows you to specify where to find the TypeScript configuration file. - /// You may provide - /// * a relative path to the configuration file. It will be resolved relative to cwd. - /// * an absolute path to the configuration file. - pub config_file: String, - - /// Support for Typescript Project References. - /// - /// * `'auto'`: use the `references` field from tsconfig of `config_file`. - /// * `string[]`: manually provided relative or absolute path. - #[napi(ts_type = "'auto' | string[]")] - pub references: Option>>, -} - -impl Into for Restriction { - fn into(self) -> oxc_resolver::Restriction { - match (self.path, self.regex) { - (None, None) => { - panic!("Should specify path or regex") - } - (None, Some(regex)) => oxc_resolver::Restriction::RegExp(regex), - (Some(path), None) => oxc_resolver::Restriction::Path(PathBuf::from(path)), - (Some(_), Some(_)) => { - panic!("Restriction can't be path and regex at the same time") - } - } - } -} - -impl Into for EnforceExtension { - fn into(self) -> oxc_resolver::EnforceExtension { - match self { - EnforceExtension::Auto => oxc_resolver::EnforceExtension::Auto, - EnforceExtension::Enabled => oxc_resolver::EnforceExtension::Enabled, - EnforceExtension::Disabled => oxc_resolver::EnforceExtension::Disabled, - } - } -} - -impl Into for TsconfigOptions { - fn into(self) -> oxc_resolver::TsconfigOptions { - oxc_resolver::TsconfigOptions { - config_file: PathBuf::from(self.config_file), - references: match self.references { - Some(Either::A(string)) if string.as_str() == "auto" => { - oxc_resolver::TsconfigReferences::Auto - } - Some(Either::A(opt)) => { - panic!("`{}` is not a valid option for tsconfig references", opt) - } - Some(Either::B(paths)) => oxc_resolver::TsconfigReferences::Paths( - paths.into_iter().map(PathBuf::from).collect::>(), - ), - None => oxc_resolver::TsconfigReferences::Disabled, - }, - } - } -} - -type StrOrStrListType = Either>; -pub struct StrOrStrList(pub StrOrStrListType); - -impl Into> for StrOrStrList { - fn into(self) -> Vec { - match self { - StrOrStrList(Either::A(s)) => Vec::from([s]), - StrOrStrList(Either::B(a)) => a, - } - } -} diff --git a/napi/tests/options.test.mjs b/napi/tests/options.test.mjs deleted file mode 100644 index 4a93efff..00000000 --- a/napi/tests/options.test.mjs +++ /dev/null @@ -1,59 +0,0 @@ -import { describe, it } from "node:test"; -import { ResolverFactory } from "../index.js"; -import * as assert from "node:assert"; -import * as path from "node:path"; - -const fixtureDir = new URL( - "../../fixtures/enhanced_resolve/test/fixtures", - import.meta.url -).pathname; - -describe("option", () => { - describe("aliasFields", () => { - it("should allow field string ", () => { - const resolver = new ResolverFactory({ aliasFields: ["browser"] }); - assert.match( - resolver.sync(fixtureDir, "./browser-module/lib/replaced.js").path, - /browser-module\/lib\/browser\.js$/ - ); - }); - it("should allow json path array", () => { - const resolver = new ResolverFactory({ - aliasFields: [["innerBrowser1", "field", "browser"]], - }); - - assert.match( - resolver.sync(fixtureDir, "./browser-module/lib/main1.js").path, - /browser-module\/lib\/main\.js$/ - ); - }); - }); - - describe("exportsFields", () => { - const createTest = (exportsFields) => { - const resolver = new ResolverFactory({ exportsFields }); - assert.match( - resolver.sync( - path.resolve(fixtureDir, "./exports-field3"), - "exports-field" - ).path, - /\/exports-field\/src\/index\.js$/ - ); - }; - it("should allow string as field item", createTest(["broken"])); - it("should allow json path array as field item", createTest([["broken"]])); - }); - - describe("mainFields", () => { - const createTest = (mainFields) => { - const resolver = new ResolverFactory({ mainFields }); - assert.match( - resolver.sync(fixtureDir, "../..").path, - /\/lib\/index\.js$/ - ); - }; - it("should use `'main'` as default", createTest(undefined)); - it("should allow field string", createTest("main")); - it("should allow field array", createTest(["main"])); - }); -}); diff --git a/npm/package.json b/npm/package.json index 6fa93185..b47e6b07 100644 --- a/npm/package.json +++ b/npm/package.json @@ -1,41 +1,30 @@ { - "name": "oxc-resolver", - "version": "1.8.1", - "description": "Oxc Resolver Node API", - "main": "index.js", - "browser": "browser.js", - "files": [ - "index.d.ts", - "index.js", - "browser.js" - ], - "license": "MIT", - "homepage": "https://oxc-project.github.io", - "repository": { - "type": "git", - "url": "git+https://github.com/oxc-project/oxc-resolver.git" - }, - "publishConfig": { - "registry": "https://registry.npmjs.org/", - "access": "public" - }, - "napi": { - "binaryName": "resolver", - "packageName": "@oxc-resolver/binding", - "targets": [ - "x86_64-pc-windows-msvc", - "aarch64-pc-windows-msvc", - "x86_64-unknown-linux-gnu", - "x86_64-unknown-linux-musl", - "aarch64-unknown-linux-gnu", - "aarch64-unknown-linux-musl", - "armv7-unknown-linux-gnueabihf", - "x86_64-apple-darwin", - "aarch64-apple-darwin", - "wasm32-wasip1-threads" - ] - }, - "funding": { - "url": "https://github.com/sponsors/Boshen" - } + "name": "oxc-resolver", + "description": "Oxc Resolver Node API", + "funding": { + "url": "https://github.com/sponsors/Boshen" + }, + "main": "index.js", + "browser": "browser.js", + "files": [ + "index.d.ts", + "index.js", + "browser.js" + ], + "napi": { + "binaryName": "resolver", + "packageName": "@oxc-resolver/binding", + "targets": [ + "x86_64-pc-windows-msvc", + "aarch64-pc-windows-msvc", + "x86_64-unknown-linux-gnu", + "x86_64-unknown-linux-musl", + "aarch64-unknown-linux-gnu", + "aarch64-unknown-linux-musl", + "armv7-unknown-linux-gnueabihf", + "x86_64-apple-darwin", + "aarch64-apple-darwin", + "wasm32-wasip1-threads" + ] + } } diff --git a/package.json b/package.json index f9e933c6..699cb6c9 100644 --- a/package.json +++ b/package.json @@ -1,36 +1,24 @@ { - "name": "@oxc-resolver/binding", - "private": true, - "version": "0.0.0", - "scripts": { - "build": "napi build --platform --release --package-json-path npm/package.json --manifest-path napi/Cargo.toml", - "build:debug": "napi build --platform --package-json-path npm/package.json --manifest-path napi/Cargo.toml", - "prepublishOnly": "napi pre-publish -t npm", - "test": "ava" - }, - "devDependencies": { - "@napi-rs/cli": "^3.0.0-alpha.43", - "@napi-rs/wasm-runtime": "^0.2.0", - "@types/node": "^20.10.4", - "ava": "^6.0.1", - "emnapi": "^1.0.0", - "typescript": "^5.3.3" - }, - "engines": { - "node": ">=10" - }, - "ava": { - "files": [ - "napi/__test__/*.spec.mjs" - ], - "cache": false - }, - "packageManager": "pnpm@9.1.4", - "repository": { - "type": "git", - "url": "git+https://github.com/oxc-project/oxc-resolver.git" - }, - "funding": { - "url": "https://github.com/sponsors/Boshen" - } + "name": "@oxc-resolver/binding", + "funding": { + "url": "https://github.com/sponsors/Boshen" + }, + "scripts": { + "build": "napi build --platform --release --package-json-path npm/package.json --manifest-path napi/Cargo.toml", + "build:debug": "napi build --platform --package-json-path npm/package.json --manifest-path napi/Cargo.toml", + "prepublishOnly": "napi pre-publish -t npm" + }, + "ava": { + "cache": false, + "files": [ + "napi/__test__/*.spec.mjs" + ] + }, + "devDependencies": { + "@napi-rs/cli": "^3.0.0-alpha.43", + "@napi-rs/wasm-runtime": "^0.2.4", + "@types/node": "^20.14.0", + "ava": "^6.1.3", + "emnapi": "^1.2.0" + } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml deleted file mode 100644 index 878ba525..00000000 --- a/pnpm-lock.yaml +++ /dev/null @@ -1,2450 +0,0 @@ -lockfileVersion: '9.0' - -settings: - autoInstallPeers: true - excludeLinksFromLockfile: false - -importers: - - .: - devDependencies: - '@napi-rs/cli': - specifier: ^3.0.0-alpha.43 - version: 3.0.0-alpha.51(@emnapi/runtime@1.1.1)(emnapi@1.1.1) - '@napi-rs/wasm-runtime': - specifier: ^0.2.0 - version: 0.2.0 - '@types/node': - specifier: ^20.10.4 - version: 20.12.7 - ava: - specifier: ^6.0.1 - version: 6.1.2 - emnapi: - specifier: ^1.0.0 - version: 1.1.1 - typescript: - specifier: ^5.3.3 - version: 5.4.5 - -packages: - - '@emnapi/core@1.1.1': - resolution: {integrity: sha512-eu4KjHfXg3I+UUR7vSuwZXpRo4c8h4Rtb5Lu2F7Z4JqJFl/eidquONEBiRs6viXKpWBC3BaJBy68xGJ2j56idw==} - - '@emnapi/runtime@1.1.1': - resolution: {integrity: sha512-3bfqkzuR1KLx57nZfjr2NLnFOobvyS0aTszaEGCGqmYMVDRaGvgIZbjGSV/MHSSmLgQ/b9JFHQ5xm5WRZYd+XQ==} - - '@inquirer/figures@1.0.1': - resolution: {integrity: sha512-mtup3wVKia3ZwULPHcbs4Mor8Voi+iIXEWD7wCNbIO6lYR62oPCTQyrddi5OMYVXHzeCSoneZwJuS8sBvlEwDw==} - engines: {node: '>=18'} - - '@ljharb/through@2.3.13': - resolution: {integrity: sha512-/gKJun8NNiWGZJkGzI/Ragc53cOdcLNdzjLaIa+GEjguQs0ulsurx8WN0jijdK9yPqDvziX995sMRLyLt1uZMQ==} - engines: {node: '>= 0.4'} - - '@mapbox/node-pre-gyp@1.0.11': - resolution: {integrity: sha512-Yhlar6v9WQgUp/He7BdgzOz8lqMQ8sU+jkCq7Wx8Myc5YFJLbEe7lgui/V7G1qB1DJykHSGwreceSaD60Y0PUQ==} - hasBin: true - - '@napi-rs/cli@3.0.0-alpha.51': - resolution: {integrity: sha512-fzTQ4RfhaghFNryWTfb0e93N/J7hNfAOpUNL98u9qMymsXa3w2cUTN8W/HjiNVTUvHHus8X5PuHt9q65cDXcSg==} - engines: {node: '>= 16'} - hasBin: true - peerDependencies: - '@emnapi/runtime': ^1.1.0 - emnapi: ^1.1.0 - peerDependenciesMeta: - '@emnapi/runtime': - optional: true - emnapi: - optional: true - - '@napi-rs/cross-toolchain@0.0.14': - resolution: {integrity: sha512-Xgoe1gCEo5s5VUxmSnK4tYFJXW2JAVM02jptSbqA2+gp8pt4Vuk9oK2LvswwO9iRfHapKacYYhegD8Dq/+PBOQ==} - peerDependencies: - '@napi-rs/cross-toolchain-arm64-target-aarch64': ^0.0.14 - '@napi-rs/cross-toolchain-arm64-target-armv7': ^0.0.14 - '@napi-rs/cross-toolchain-arm64-target-x86_64': ^0.0.14 - '@napi-rs/cross-toolchain-x64-target-aarch64': ^0.0.14 - '@napi-rs/cross-toolchain-x64-target-armv7': ^0.0.14 - '@napi-rs/cross-toolchain-x64-target-x86_64': ^0.0.14 - peerDependenciesMeta: - '@napi-rs/cross-toolchain-arm64-target-aarch64': - optional: true - '@napi-rs/cross-toolchain-arm64-target-armv7': - optional: true - '@napi-rs/cross-toolchain-arm64-target-x86_64': - optional: true - '@napi-rs/cross-toolchain-x64-target-aarch64': - optional: true - '@napi-rs/cross-toolchain-x64-target-armv7': - optional: true - '@napi-rs/cross-toolchain-x64-target-x86_64': - optional: true - - '@napi-rs/lzma-android-arm-eabi@1.2.1': - resolution: {integrity: sha512-GKXud2hTddxehff1mAGkbTfseBj+GcM+M/sZuxf9H9CJeOWpfI/HC9Oy3uv8mBqPTkOQdCcZ/xXPU34EOEwiRg==} - engines: {node: '>= 10'} - cpu: [arm] - os: [android] - - '@napi-rs/lzma-android-arm64@1.2.1': - resolution: {integrity: sha512-UKFvc56TdgljbdgLvSwM62pSItV/4SuXXCrJtruPDmbIDe8HKag8hsCKsb66hrc9aX7urJ+KGw1yz5hWiONLyw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [android] - - '@napi-rs/lzma-darwin-arm64@1.2.1': - resolution: {integrity: sha512-eLbHzK5xGVzEABb1ESFELQJzXKoQeP9QH9hMPd4Qq29xD6MkWD2VKlAy40AxrMeWc7fCUIImTTlGuGRvg6tI1g==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [darwin] - - '@napi-rs/lzma-darwin-x64@1.2.1': - resolution: {integrity: sha512-/a5sHZkkO81w/PCpxlwXjADz++jDiTJquMzCLAhupd23wTRmJoCBAwp4Tur+qV5esI7ahAA0lS5P0M4TZv+OUg==} - engines: {node: '>= 10'} - cpu: [x64] - os: [darwin] - - '@napi-rs/lzma-freebsd-x64@1.2.1': - resolution: {integrity: sha512-Ehc0ld148YcqQrDWwUbVta1l45R4PthCIU6ZDbOYzzeYXQnhgr1fWiex7wu4KMFppteHlYntypUIhmMUklqchA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [freebsd] - - '@napi-rs/lzma-linux-arm-gnueabihf@1.2.1': - resolution: {integrity: sha512-EkIsx3kC67viElNetZgaGAtAceA+4pVGj31HKKPn0RZYn3rCNdEEg2i1IRg07Y6m4bHwcaKutLoZ2LDcQ+yiBg==} - engines: {node: '>= 10'} - cpu: [arm] - os: [linux] - - '@napi-rs/lzma-linux-arm64-gnu@1.2.1': - resolution: {integrity: sha512-GxSbp1/X7Ppmf+aNiZ95vl1HgQzRS9C8zCv7unEhYRPAjRkAnlrsLluUBOTPIY2yquuUvfIog9XIml6Hpw2wrA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/lzma-linux-arm64-musl@1.2.1': - resolution: {integrity: sha512-2L3KHFGGdt0xgU0WcKwKmnjVCYs88t4+ixBgPfEydtYsOceg6B8eOzdM7xsziKxJyUJKWBetGLgARQOy35bfvA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/lzma-linux-x64-gnu@1.2.1': - resolution: {integrity: sha512-h29XttA2Og1+6vYHsVcp+i1PkeILKzYnoDun0ul/k/5hvfxJ2Jap+EM07sW4HSz/DiscLAeIZmLKbXEqJgF5bg==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/lzma-linux-x64-musl@1.2.1': - resolution: {integrity: sha512-8EIkpLid4pepkBsljQ7rgma8jdwAuwVyJ2tY6Wuj1I/AqAkVVfxTwIuYc4zgRR3nfcrmWgOfZE0VneVmQCE5hw==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/lzma-win32-arm64-msvc@1.2.1': - resolution: {integrity: sha512-RNPItarWUUbtwz6dyn8FGH9AXEaAsBcMBlTvcRjv8eoqRqyZ9R49Ruk/8WMS57MM1BKdiPDxHBtRi+nZn27Slw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [win32] - - '@napi-rs/lzma-win32-ia32-msvc@1.2.1': - resolution: {integrity: sha512-rNdsCZnzKVgeDd9NzXWk9WuADVUWUWdnws8qBRCfHRUQqJ56Ic1W7Y1XmP+bNa985MXlU6vbznHTHmU5zk2P+A==} - engines: {node: '>= 10'} - cpu: [ia32] - os: [win32] - - '@napi-rs/lzma-win32-x64-msvc@1.2.1': - resolution: {integrity: sha512-1AFrAh1n73Yw+IhDu5HnaiRD4vWEkafY0EarfziPfDsh/GeyNcjbE+Let+XFe8L3j0/CZfsRG3nXarOW1oadUQ==} - engines: {node: '>= 10'} - cpu: [x64] - os: [win32] - - '@napi-rs/lzma@1.2.1': - resolution: {integrity: sha512-vwl34tzF2mXWthnFVN2MP6nRzQ40C5+256EEUjxAwj9dbAhDqb7Yz376Up5SlB4YgNC0YvEqK4jsYP/NP0bgpg==} - engines: {node: '>= 10'} - - '@napi-rs/tar-android-arm-eabi@0.1.0': - resolution: {integrity: sha512-gY9f7HfyU8MQs/ERi2/Fc4dGRf61ZM2pme31t0FkrzTtmeIaf56LiTeTt4aP8xh/0HOVnXrB6I3taY9IsQVB8Q==} - engines: {node: '>= 10'} - cpu: [arm] - os: [android] - - '@napi-rs/tar-android-arm64@0.1.0': - resolution: {integrity: sha512-NxszsTRdAYf25kKuzUYz514/5MFI3w3aHToZBcFjaxUmsayrimFrHIiPLwNQVe55lHPRi13njqQUPjMetHMCZw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [android] - - '@napi-rs/tar-darwin-arm64@0.1.0': - resolution: {integrity: sha512-G+fSNcwhbekTMOElS66mf3ccg8M4NcEHIgo7s6Hxo8U2obUSqEJ0WjTDV8oJy7lqRW/MeeDJj8Vz0ceXC8ueeA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [darwin] - - '@napi-rs/tar-darwin-x64@0.1.0': - resolution: {integrity: sha512-p9aOLk6O2+Cu62fNOdj1Zx0P3J1VkxtihXOVDaK49o5jszhms0roNA7kZfklwjVdwo8R7OQC6mJcFWmiamMNug==} - engines: {node: '>= 10'} - cpu: [x64] - os: [darwin] - - '@napi-rs/tar-freebsd-x64@0.1.0': - resolution: {integrity: sha512-mZQPtyCc2r+P84WV76Ddbe1+CxBscxlDHtgMIxZPveMgq4esZFKp26M735vjxtk/j2ahT0pZoC6fjsJ//Uxzlg==} - engines: {node: '>= 10'} - cpu: [x64] - os: [freebsd] - - '@napi-rs/tar-linux-arm-gnueabihf@0.1.0': - resolution: {integrity: sha512-FHxnmrOS345T3n3XDmY9QEoVv1PXkkuevQbu+gzq5np4fzN/NX2Az5oJTxKOTGtlJSaxxz90raeaWRZrnV5hZQ==} - engines: {node: '>= 10'} - cpu: [arm] - os: [linux] - - '@napi-rs/tar-linux-arm64-gnu@0.1.0': - resolution: {integrity: sha512-+8WHnL/8PPpePYc+5oqNLoE5o98vWF7lJvY/seji7tdcS5TPJ3tgXaF4/y1rFAaSxKsZ9l+ClHsZZ0MpCqMOOQ==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/tar-linux-arm64-musl@0.1.0': - resolution: {integrity: sha512-SXqU4H30/TD9BZa6pH/U5l2V6E4EKOutjHp9Sqr98iH52Zb+1N84ur1Ti7/+PapKunCIJeZzU+792CQagKIzuQ==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/tar-linux-x64-gnu@0.1.0': - resolution: {integrity: sha512-2uZHxl2nH1HbeJuifB1qdK8vU9wKDrxQkFm+u4psUaa/uHLZDUCGS7GMxTnCbR9OehqZcfQabaKsHbxR/8ElDQ==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/tar-linux-x64-musl@0.1.0': - resolution: {integrity: sha512-S1vEqLK4UCHS4AjVZ3g6o7r0Yu6RbhmDj6JrqxBoEIjrMsuIPKQrODHhtlsykOPeu5IHQuyRT+DevorWAVYdoA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/tar-win32-arm64-msvc@0.1.0': - resolution: {integrity: sha512-x23Ganq0hcDbgnhzAFqOu5EWtKvngIsapJL7ZLGgQlqahRb15aQkagYvpju6CLZers6N6znmqxw9Pdov9VFzOQ==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [win32] - - '@napi-rs/tar-win32-ia32-msvc@0.1.0': - resolution: {integrity: sha512-QJgJQEKDbVOrzSJ3EaUuCk+g7t9tKv085eALmRtkiHDBmzd0iAoudcU2N9YgdacSQMe1V/GMuQLky6BFrZb4nw==} - engines: {node: '>= 10'} - cpu: [ia32] - os: [win32] - - '@napi-rs/tar-win32-x64-msvc@0.1.0': - resolution: {integrity: sha512-aEhLcPZXmbcz46utpgYrkhY/TIGVCs4T5c+xpBf6H8feIEz7rF44Bm6kECC42OWcqnws2LGRW9TZsv0bWoAn0A==} - engines: {node: '>= 10'} - cpu: [x64] - os: [win32] - - '@napi-rs/tar@0.1.0': - resolution: {integrity: sha512-HodV5VS/ryhNvSmSHPb6CT5lJKzkoKaiyO8JPkVw3XCXbp51+vZs7LJ66kgFqyr4AagaKqmXsgpGVCIwNdFw/w==} - engines: {node: '>= 10'} - - '@napi-rs/wasm-runtime@0.1.2': - resolution: {integrity: sha512-8JuczewTFIZ/XIjHQ+YlQUydHvlKx2hkcxtuGwh+t/t5zWyZct6YG4+xjHcq8xyc/e7FmFwf42Zj2YgICwmlvA==} - - '@napi-rs/wasm-runtime@0.2.0': - resolution: {integrity: sha512-ETCooPEZJN7cGp6GwE5mUTrStrhIeuEPo0lOhLe48Iz35z6CkbgDauR8nE/K4GaMEu2BwTOm2Epy7ru8w1ua7w==} - - '@napi-rs/wasm-tools-android-arm-eabi@0.0.1': - resolution: {integrity: sha512-Q/SyyO60dbpoLcN/hvGzNWDaCjuaMGFeg92GnsDBWm3OCwhvltr51+VDZbCIHQwfIvH4d63X29nEls7FHK75dA==} - engines: {node: '>= 10'} - cpu: [arm] - os: [android] - - '@napi-rs/wasm-tools-android-arm64@0.0.1': - resolution: {integrity: sha512-mn7QpSWJlQS7Z14DkWqW14HqEiI2R8FV3KT4SNdqm+O+K5uIUvAexxMn9Qu6gqLq1fHXj+7l2luAWmtN7RKLjA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [android] - - '@napi-rs/wasm-tools-darwin-arm64@0.0.1': - resolution: {integrity: sha512-WuxMRtd5rCgqfuk7dehcft5eyGDOuNSMaJybprbX4IXvnjlLQf1zsCfp6wBI2Ptp2D+qEgE2SAMWBfzF9XDDkw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [darwin] - - '@napi-rs/wasm-tools-darwin-x64@0.0.1': - resolution: {integrity: sha512-YGPjgIo1/Y774aAFb/UT+d8VQtTaIkdF0/ynlChe/UilBZX48vLaEM0HaoSqxA1WHvRm8Il8R3rBDDle0965rw==} - engines: {node: '>= 10'} - cpu: [x64] - os: [darwin] - - '@napi-rs/wasm-tools-freebsd-x64@0.0.1': - resolution: {integrity: sha512-e5y+Z89XwI7HpLyCNEvDKdtO5Sga2+o8bDcNQNHjhMunnnHKPtlTvtIhieVmdqnNGPbuNkIx8xbTjkoWCZ49Tw==} - engines: {node: '>= 10'} - cpu: [x64] - os: [freebsd] - - '@napi-rs/wasm-tools-linux-arm64-gnu@0.0.1': - resolution: {integrity: sha512-Hcy+XiCJd8XshxVOYvmyU5FgeY8d6txZf7ZefI38Y3eRm7rzGt/EvABGjvJfujnPaBeWi9fQVm3Zav5pwyxViw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/wasm-tools-linux-arm64-musl@0.0.1': - resolution: {integrity: sha512-1mSquGy4N7jlRu/0OY/rqZa/XdCFGKrsl8SH4jRB318DVweOHLqn15QG4iwIrRVjCJROpaU9HRU/sgOKVbdqrA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/wasm-tools-linux-x64-gnu@0.0.1': - resolution: {integrity: sha512-/+XuGQ9667EqrxRbpt2izLDNzWUWLTXl6KaRSh9TjcT7qL5+yllTqchc0JwIHJW5QnQlC1NW7HnSnwQZ+/v+8g==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/wasm-tools-linux-x64-musl@0.0.1': - resolution: {integrity: sha512-L+5QcEsUS+QNcMI1AF6aBRKLzhxQ5VHRHVslaQwOxHoxyhMB/2hRH4ON6Zea1PyQS/zzZugwBuDEOcFtc3UjPQ==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/wasm-tools-wasm32-wasi@0.0.1': - resolution: {integrity: sha512-I1vAhMQcBblPJPg6pr+xydZ1NjPwKU2ympmI54BZfCOAMHs0ZfVb4yEqYAVIcSWOx3CF/0T2YrcOmiULTU3iGw==} - engines: {node: '>=14.0.0'} - cpu: [wasm32] - - '@napi-rs/wasm-tools-win32-arm64-msvc@0.0.1': - resolution: {integrity: sha512-A9peDWijE9X6qt5SNzqlmSMlOZiqeB9zhUVP5dtJKtpqVO098YVnZFsz/4Hv7LkSoxQE7brAd9yln/wz5qb1yQ==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [win32] - - '@napi-rs/wasm-tools-win32-ia32-msvc@0.0.1': - resolution: {integrity: sha512-6Y7GqnBCIdl8YsSQ+5AjnZ4iWDJnJrqzRlMDegCmPPf3WmRZ0sgnRU9iAHWcId9AEIf7SAs3x7Bnv2992zCwJA==} - engines: {node: '>= 10'} - cpu: [ia32] - os: [win32] - - '@napi-rs/wasm-tools-win32-x64-msvc@0.0.1': - resolution: {integrity: sha512-Ab6ljJCQmXqJvE4/8DLvHEVTI7vVUrVfh6gCwnVwwrA/B2LgR98SanpT8/951ZaIH/lSuqkeVm+wqzgYM1FHRg==} - engines: {node: '>= 10'} - cpu: [x64] - os: [win32] - - '@napi-rs/wasm-tools@0.0.1': - resolution: {integrity: sha512-itoKmaVqRKIV37sKIEri1qjaYlWNtXyfymUaqXkLu5F16s+FwqwOmvxmdTHsvNKkMy4qCsSSetiLZO1IwvBMLQ==} - engines: {node: '>= 10'} - - '@nodelib/fs.scandir@2.1.5': - resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} - engines: {node: '>= 8'} - - '@nodelib/fs.stat@2.0.5': - resolution: {integrity: sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==} - engines: {node: '>= 8'} - - '@nodelib/fs.walk@1.2.8': - resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} - engines: {node: '>= 8'} - - '@octokit/auth-token@4.0.0': - resolution: {integrity: sha512-tY/msAuJo6ARbK6SPIxZrPBms3xPbfwBrulZe0Wtr/DIY9lje2HeV1uoebShn6mx7SjCHif6EjMvoREj+gZ+SA==} - engines: {node: '>= 18'} - - '@octokit/core@5.2.0': - resolution: {integrity: sha512-1LFfa/qnMQvEOAdzlQymH0ulepxbxnCYAKJZfMci/5XJyIHWgEYnDmgnKakbTh7CH2tFQ5O60oYDvns4i9RAIg==} - engines: {node: '>= 18'} - - '@octokit/endpoint@9.0.5': - resolution: {integrity: sha512-ekqR4/+PCLkEBF6qgj8WqJfvDq65RH85OAgrtnVp1mSxaXF03u2xW/hUdweGS5654IlC0wkNYC18Z50tSYTAFw==} - engines: {node: '>= 18'} - - '@octokit/graphql@7.1.0': - resolution: {integrity: sha512-r+oZUH7aMFui1ypZnAvZmn0KSqAUgE1/tUXIWaqUCa1758ts/Jio84GZuzsvUkme98kv0WFY8//n0J1Z+vsIsQ==} - engines: {node: '>= 18'} - - '@octokit/openapi-types@20.0.0': - resolution: {integrity: sha512-EtqRBEjp1dL/15V7WiX5LJMIxxkdiGJnabzYx5Apx4FkQIFgAfKumXeYAqqJCj1s+BMX4cPFIFC4OLCR6stlnA==} - - '@octokit/openapi-types@22.1.0': - resolution: {integrity: sha512-pGUdSP+eEPfZiQHNkZI0U01HLipxncisdJQB4G//OAmfeO8sqTQ9KRa0KF03TUPCziNsoXUrTg4B2Q1EX++T0Q==} - - '@octokit/plugin-paginate-rest@9.2.1': - resolution: {integrity: sha512-wfGhE/TAkXZRLjksFXuDZdmGnJQHvtU/joFQdweXUgzo1XwvBCD4o4+75NtFfjfLK5IwLf9vHTfSiU3sLRYpRw==} - engines: {node: '>= 18'} - peerDependencies: - '@octokit/core': '5' - - '@octokit/plugin-request-log@4.0.1': - resolution: {integrity: sha512-GihNqNpGHorUrO7Qa9JbAl0dbLnqJVrV8OXe2Zm5/Y4wFkZQDfTreBzVmiRfJVfE4mClXdihHnbpyyO9FSX4HA==} - engines: {node: '>= 18'} - peerDependencies: - '@octokit/core': '5' - - '@octokit/plugin-rest-endpoint-methods@10.4.1': - resolution: {integrity: sha512-xV1b+ceKV9KytQe3zCVqjg+8GTGfDYwaT1ATU5isiUyVtlVAO3HNdzpS4sr4GBx4hxQ46s7ITtZrAsxG22+rVg==} - engines: {node: '>= 18'} - peerDependencies: - '@octokit/core': '5' - - '@octokit/request-error@5.1.0': - resolution: {integrity: sha512-GETXfE05J0+7H2STzekpKObFe765O5dlAKUTLNGeH+x47z7JjXHfsHKo5z21D/o/IOZTUEI6nyWyR+bZVP/n5Q==} - engines: {node: '>= 18'} - - '@octokit/request@8.4.0': - resolution: {integrity: sha512-9Bb014e+m2TgBeEJGEbdplMVWwPmL1FPtggHQRkV+WVsMggPtEkLKPlcVYm/o8xKLkpJ7B+6N8WfQMtDLX2Dpw==} - engines: {node: '>= 18'} - - '@octokit/rest@20.1.0': - resolution: {integrity: sha512-STVO3itHQLrp80lvcYB2UIKoeil5Ctsgd2s1AM+du3HqZIR35ZH7WE9HLwUOLXH0myA0y3AGNPo8gZtcgIbw0g==} - engines: {node: '>= 18'} - - '@octokit/types@12.6.0': - resolution: {integrity: sha512-1rhSOfRa6H9w4YwK0yrf5faDaDTb+yLyBUKOCV4xtCDB5VmIPqd/v9yr9o6SAzOAlRxMiRiCic6JVM1/kunVkw==} - - '@octokit/types@13.4.1': - resolution: {integrity: sha512-Y73oOAzRBAUzR/iRAbGULzpNkX8vaxKCqEtg6K74Ff3w9f5apFnWtE/2nade7dMWWW3bS5Kkd6DJS4HF04xreg==} - - '@rollup/pluginutils@4.2.1': - resolution: {integrity: sha512-iKnFXr7NkdZAIHiIWE+BX5ULi/ucVFYWD6TbAV+rZctiRTY2PL6tsIKhoIOaoskiWAkgu+VsbXgUVDNLHf+InQ==} - engines: {node: '>= 8.0.0'} - - '@sindresorhus/merge-streams@2.3.0': - resolution: {integrity: sha512-LtoMMhxAlorcGhmFYI+LhPgbPZCkgP6ra1YL604EeF6U98pLlQ3iWIGMdWSC+vWmPBWBNgmDBAhnAobLROJmwg==} - engines: {node: '>=18'} - - '@tybys/wasm-util@0.8.3': - resolution: {integrity: sha512-Z96T/L6dUFFxgFJ+pQtkPpne9q7i6kIPYCFnQBHSgSPV9idTsKfIhCss0h5iM9irweZCatkrdeP8yi5uM1eX6Q==} - - '@types/node@20.12.7': - resolution: {integrity: sha512-wq0cICSkRLVaf3UGLMGItu/PtdY7oaXaI/RVU+xliKVOtRna3PRY57ZDfztpDL0n11vfymMUnXv8QwYCO7L1wg==} - - '@vercel/nft@0.26.4': - resolution: {integrity: sha512-j4jCOOXke2t8cHZCIxu1dzKLHLcFmYzC3yqAK6MfZznOL1QIJKd0xcFsXK3zcqzU7ScsE2zWkiMMNHGMHgp+FA==} - engines: {node: '>=16'} - hasBin: true - - abbrev@1.1.1: - resolution: {integrity: sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==} - - acorn-import-attributes@1.9.5: - resolution: {integrity: sha512-n02Vykv5uA3eHGM/Z2dQrcD56kL8TyDb2p1+0P83PClMnC/nc+anbQRhIOWnSq4Ke/KvDPrY3C9hDtC/A3eHnQ==} - peerDependencies: - acorn: ^8 - - acorn-walk@8.3.2: - resolution: {integrity: sha512-cjkyv4OtNCIeqhHrfS81QWXoCBPExR/J62oyEqepVw8WaQeSqpW2uhuLPh1m9eWhDuOo/jUXVTlifvesOWp/4A==} - engines: {node: '>=0.4.0'} - - acorn@8.11.3: - resolution: {integrity: sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==} - engines: {node: '>=0.4.0'} - hasBin: true - - agent-base@6.0.2: - resolution: {integrity: sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==} - engines: {node: '>= 6.0.0'} - - ansi-escapes@4.3.2: - resolution: {integrity: sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==} - engines: {node: '>=8'} - - ansi-regex@5.0.1: - resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} - engines: {node: '>=8'} - - ansi-regex@6.0.1: - resolution: {integrity: sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==} - engines: {node: '>=12'} - - ansi-styles@4.3.0: - resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} - engines: {node: '>=8'} - - ansi-styles@6.2.1: - resolution: {integrity: sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==} - engines: {node: '>=12'} - - aproba@2.0.0: - resolution: {integrity: sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==} - - are-we-there-yet@2.0.0: - resolution: {integrity: sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw==} - engines: {node: '>=10'} - - argparse@1.0.10: - resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==} - - argparse@2.0.1: - resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} - - array-find-index@1.0.2: - resolution: {integrity: sha512-M1HQyIXcBGtVywBt8WVdim+lrNaK7VHp99Qt5pSNziXznKHViIBbXWtfRTpEFpF/c4FdfxNAsCCwPp5phBYJtw==} - engines: {node: '>=0.10.0'} - - arrgv@1.0.2: - resolution: {integrity: sha512-a4eg4yhp7mmruZDQFqVMlxNRFGi/i1r87pt8SDHy0/I8PqSXoUTlWZRdAZo0VXgvEARcujbtTk8kiZRi1uDGRw==} - engines: {node: '>=8.0.0'} - - arrify@3.0.0: - resolution: {integrity: sha512-tLkvA81vQG/XqE2mjDkGQHoOINtMHtysSnemrmoGe6PydDPMRbVugqyk4A6V/WDWEfm3l+0d8anA9r8cv/5Jaw==} - engines: {node: '>=12'} - - async-sema@3.1.1: - resolution: {integrity: sha512-tLRNUXati5MFePdAk8dw7Qt7DpxPB60ofAgn8WRhW6a2rcimZnYBP9oxHiv0OHy+Wz7kPMG+t4LGdt31+4EmGg==} - - ava@6.1.2: - resolution: {integrity: sha512-WcpxJ8yZ7mk9ABTinD0IAjcemovSeVGjuuwZx0JS9johREWFeLTl8UP6wd7l6nmnrWqkKZdwaD71a/ocH4qPKw==} - engines: {node: ^18.18 || ^20.8 || ^21} - hasBin: true - peerDependencies: - '@ava/typescript': '*' - peerDependenciesMeta: - '@ava/typescript': - optional: true - - balanced-match@1.0.2: - resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} - - base64-js@1.5.1: - resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==} - - before-after-hook@2.2.3: - resolution: {integrity: sha512-NzUnlZexiaH/46WDhANlyR2bXRopNg4F/zuSA3OpZnllCUgRaOF2znDioDWrmbNVsuZk6l9pMquQB38cfBZwkQ==} - - bindings@1.5.0: - resolution: {integrity: sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==} - - bl@4.1.0: - resolution: {integrity: sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==} - - blueimp-md5@2.19.0: - resolution: {integrity: sha512-DRQrD6gJyy8FbiE4s+bDoXS9hiW3Vbx5uCdwvcCf3zLHL+Iv7LtGHLpr+GZV8rHG8tK766FGYBwRbu8pELTt+w==} - - brace-expansion@1.1.11: - resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} - - braces@3.0.2: - resolution: {integrity: sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==} - engines: {node: '>=8'} - - buffer@5.7.1: - resolution: {integrity: sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==} - - call-bind@1.0.7: - resolution: {integrity: sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==} - engines: {node: '>= 0.4'} - - callsites@4.1.0: - resolution: {integrity: sha512-aBMbD1Xxay75ViYezwT40aQONfr+pSXTHwNKvIXhXD6+LY3F1dLIcceoC5OZKBVHbXcysz1hL9D2w0JJIMXpUw==} - engines: {node: '>=12.20'} - - cbor@9.0.2: - resolution: {integrity: sha512-JPypkxsB10s9QOWwa6zwPzqE1Md3vqpPc+cai4sAecuCsRyAtAl/pMyhPlMbT/xtPnm2dznJZYRLui57qiRhaQ==} - engines: {node: '>=16'} - - chalk@4.1.2: - resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} - engines: {node: '>=10'} - - chalk@5.3.0: - resolution: {integrity: sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==} - engines: {node: ^12.17.0 || ^14.13 || >=16.0.0} - - chardet@0.7.0: - resolution: {integrity: sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==} - - chownr@2.0.0: - resolution: {integrity: sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==} - engines: {node: '>=10'} - - chunkd@2.0.1: - resolution: {integrity: sha512-7d58XsFmOq0j6el67Ug9mHf9ELUXsQXYJBkyxhH/k+6Ke0qXRnv0kbemx+Twc6fRJ07C49lcbdgm9FL1Ei/6SQ==} - - ci-info@4.0.0: - resolution: {integrity: sha512-TdHqgGf9odd8SXNuxtUBVx8Nv+qZOejE6qyqiy5NtbYYQOeFa6zmHkxlPzmaLxWWHsU6nJmB7AETdVPi+2NBUg==} - engines: {node: '>=8'} - - ci-parallel-vars@1.0.1: - resolution: {integrity: sha512-uvzpYrpmidaoxvIQHM+rKSrigjOe9feHYbw4uOI2gdfe1C3xIlxO+kVXq83WQWNniTf8bAxVpy+cQeFQsMERKg==} - - cli-cursor@3.1.0: - resolution: {integrity: sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==} - engines: {node: '>=8'} - - cli-spinners@2.9.2: - resolution: {integrity: sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==} - engines: {node: '>=6'} - - cli-truncate@4.0.0: - resolution: {integrity: sha512-nPdaFdQ0h/GEigbPClz11D0v/ZJEwxmeVZGeMo3Z5StPtUTkA9o1lD6QwoirYiSDzbcwn2XcjwmCp68W1IS4TA==} - engines: {node: '>=18'} - - cli-width@4.1.0: - resolution: {integrity: sha512-ouuZd4/dm2Sw5Gmqy6bGyNNNe1qt9RpmxveLSO7KcgsTnU7RXfsw+/bukWGo1abgBiMAic068rclZsO4IWmmxQ==} - engines: {node: '>= 12'} - - clipanion@3.2.1: - resolution: {integrity: sha512-dYFdjLb7y1ajfxQopN05mylEpK9ZX0sO1/RfMXdfmwjlIsPkbh4p7A682x++zFPLDCo1x3p82dtljHf5cW2LKA==} - peerDependencies: - typanion: '*' - - cliui@8.0.1: - resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==} - engines: {node: '>=12'} - - clone@1.0.4: - resolution: {integrity: sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==} - engines: {node: '>=0.8'} - - code-excerpt@4.0.0: - resolution: {integrity: sha512-xxodCmBen3iy2i0WtAK8FlFNrRzjUqjRsMfho58xT/wvZU1YTM3fCnRjcy1gJPMepaRlgm/0e6w8SpWHpn3/cA==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - color-convert@2.0.1: - resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} - engines: {node: '>=7.0.0'} - - color-name@1.1.4: - resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} - - color-support@1.1.3: - resolution: {integrity: sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==} - hasBin: true - - colorette@2.0.20: - resolution: {integrity: sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==} - - common-path-prefix@3.0.0: - resolution: {integrity: sha512-QE33hToZseCH3jS0qN96O/bSh3kaw/h+Tq7ngyY9eWDUnTlTNUyqfqvCXioLe5Na5jFsL78ra/wuBU4iuEgd4w==} - - concat-map@0.0.1: - resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} - - concordance@5.0.4: - resolution: {integrity: sha512-OAcsnTEYu1ARJqWVGwf4zh4JDfHZEaSNlNccFmt8YjB2l/n19/PF2viLINHc57vO4FKIAFl2FWASIGZZWZ2Kxw==} - engines: {node: '>=10.18.0 <11 || >=12.14.0 <13 || >=14'} - - console-control-strings@1.1.0: - resolution: {integrity: sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==} - - convert-to-spaces@2.0.1: - resolution: {integrity: sha512-rcQ1bsQO9799wq24uE5AM2tAILy4gXGIK/njFWcVQkGNZ96edlpY+A7bjwvzjYvLDyzmG1MmMLZhpcsb+klNMQ==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - currently-unhandled@0.4.1: - resolution: {integrity: sha512-/fITjgjGU50vjQ4FH6eUoYu+iUoUKIXws2hL15JJpIR+BbTxaXQsMuuyjtNh2WqsSBS5nsaZHFsFecyw5CCAng==} - engines: {node: '>=0.10.0'} - - date-time@3.1.0: - resolution: {integrity: sha512-uqCUKXE5q1PNBXjPqvwhwJf9SwMoAHBgWJ6DcrnS5o+W2JOiIILl0JEdVD8SGujrNS02GGxgwAg2PN2zONgtjg==} - engines: {node: '>=6'} - - debug@4.3.4: - resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==} - engines: {node: '>=6.0'} - peerDependencies: - supports-color: '*' - peerDependenciesMeta: - supports-color: - optional: true - - defaults@1.0.4: - resolution: {integrity: sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A==} - - define-data-property@1.1.4: - resolution: {integrity: sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==} - engines: {node: '>= 0.4'} - - delegates@1.0.0: - resolution: {integrity: sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==} - - deprecation@2.3.1: - resolution: {integrity: sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==} - - detect-libc@2.0.3: - resolution: {integrity: sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw==} - engines: {node: '>=8'} - - emittery@1.0.3: - resolution: {integrity: sha512-tJdCJitoy2lrC2ldJcqN4vkqJ00lT+tOWNT1hBJjO/3FDMJa5TTIiYGCKGkn/WfCyOzUMObeohbVTj00fhiLiA==} - engines: {node: '>=14.16'} - - emnapi@1.1.1: - resolution: {integrity: sha512-md0YDBLCX+378+zzibHvOLsj28YKFy8vl7BiSzVocCY7HujOkYt+N5LCOYqLeYi5C5/5NlnkNweVdUjrvKpGNg==} - peerDependencies: - node-addon-api: '>= 6.1.0' - peerDependenciesMeta: - node-addon-api: - optional: true - - emoji-regex@10.3.0: - resolution: {integrity: sha512-QpLs9D9v9kArv4lfDEgg1X/gN5XLnf/A6l9cs8SPZLRZR3ZkY9+kwIQTxm+fsSej5UMYGE8fdoaZVIBlqG0XTw==} - - emoji-regex@8.0.0: - resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} - - es-define-property@1.0.0: - resolution: {integrity: sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==} - engines: {node: '>= 0.4'} - - es-errors@1.3.0: - resolution: {integrity: sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==} - engines: {node: '>= 0.4'} - - escalade@3.1.2: - resolution: {integrity: sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==} - engines: {node: '>=6'} - - escape-string-regexp@2.0.0: - resolution: {integrity: sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==} - engines: {node: '>=8'} - - escape-string-regexp@5.0.0: - resolution: {integrity: sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==} - engines: {node: '>=12'} - - esprima@4.0.1: - resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==} - engines: {node: '>=4'} - hasBin: true - - estree-walker@2.0.2: - resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==} - - esutils@2.0.3: - resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} - engines: {node: '>=0.10.0'} - - external-editor@3.1.0: - resolution: {integrity: sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==} - engines: {node: '>=4'} - - fast-diff@1.3.0: - resolution: {integrity: sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==} - - fast-glob@3.3.2: - resolution: {integrity: sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==} - engines: {node: '>=8.6.0'} - - fastq@1.17.1: - resolution: {integrity: sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==} - - figures@6.1.0: - resolution: {integrity: sha512-d+l3qxjSesT4V7v2fh+QnmFnUWv9lSpjarhShNTgBOfA0ttejbQUAlHLitbjkoRiDulW0OPoQPYIGhIC8ohejg==} - engines: {node: '>=18'} - - file-uri-to-path@1.0.0: - resolution: {integrity: sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==} - - fill-range@7.0.1: - resolution: {integrity: sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==} - engines: {node: '>=8'} - - find-up-simple@1.0.0: - resolution: {integrity: sha512-q7Us7kcjj2VMePAa02hDAF6d+MzsdsAWEwYyOpwUtlerRBkOEPBCRZrAV4XfcSN8fHAgaD0hP7miwoay6DCprw==} - engines: {node: '>=18'} - - fs-minipass@2.1.0: - resolution: {integrity: sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==} - engines: {node: '>= 8'} - - fs.realpath@1.0.0: - resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} - - function-bind@1.1.2: - resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==} - - gauge@3.0.2: - resolution: {integrity: sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q==} - engines: {node: '>=10'} - - get-caller-file@2.0.5: - resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} - engines: {node: 6.* || 8.* || >= 10.*} - - get-east-asian-width@1.2.0: - resolution: {integrity: sha512-2nk+7SIVb14QrgXFHcm84tD4bKQz0RxPuMT8Ag5KPOq7J5fEmAg0UbXdTOSHqNuHSU28k55qnceesxXRZGzKWA==} - engines: {node: '>=18'} - - get-intrinsic@1.2.4: - resolution: {integrity: sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==} - engines: {node: '>= 0.4'} - - glob-parent@5.1.2: - resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} - engines: {node: '>= 6'} - - glob@7.2.3: - resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} - - globby@14.0.1: - resolution: {integrity: sha512-jOMLD2Z7MAhyG8aJpNOpmziMOP4rPLcc95oQPKXBazW82z+CEgPFBQvEpRUa1KeIMUJo4Wsm+q6uzO/Q/4BksQ==} - engines: {node: '>=18'} - - gopd@1.0.1: - resolution: {integrity: sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==} - - graceful-fs@4.2.11: - resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} - - has-flag@4.0.0: - resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} - engines: {node: '>=8'} - - has-property-descriptors@1.0.2: - resolution: {integrity: sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==} - - has-proto@1.0.3: - resolution: {integrity: sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==} - engines: {node: '>= 0.4'} - - has-symbols@1.0.3: - resolution: {integrity: sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==} - engines: {node: '>= 0.4'} - - has-unicode@2.0.1: - resolution: {integrity: sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==} - - hasown@2.0.2: - resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==} - engines: {node: '>= 0.4'} - - https-proxy-agent@5.0.1: - resolution: {integrity: sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==} - engines: {node: '>= 6'} - - iconv-lite@0.4.24: - resolution: {integrity: sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==} - engines: {node: '>=0.10.0'} - - ieee754@1.2.1: - resolution: {integrity: sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==} - - ignore-by-default@2.1.0: - resolution: {integrity: sha512-yiWd4GVmJp0Q6ghmM2B/V3oZGRmjrKLXvHR3TE1nfoXsmoggllfZUQe74EN0fJdPFZu2NIvNdrMMLm3OsV7Ohw==} - engines: {node: '>=10 <11 || >=12 <13 || >=14'} - - ignore@5.3.1: - resolution: {integrity: sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==} - engines: {node: '>= 4'} - - imurmurhash@0.1.4: - resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} - engines: {node: '>=0.8.19'} - - indent-string@5.0.0: - resolution: {integrity: sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==} - engines: {node: '>=12'} - - inflight@1.0.6: - resolution: {integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==} - - inherits@2.0.4: - resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} - - inquirer@9.2.19: - resolution: {integrity: sha512-WpxOT71HGsFya6/mj5PUue0sWwbpbiPfAR+332zLj/siB0QA1PZM8v3GepegFV1Op189UxHUCF6y8AySdtOMVA==} - engines: {node: '>=18'} - - irregular-plurals@3.5.0: - resolution: {integrity: sha512-1ANGLZ+Nkv1ptFb2pa8oG8Lem4krflKuX/gINiHJHjJUKaJHk/SXk5x6K3J+39/p0h1RQ2saROclJJ+QLvETCQ==} - engines: {node: '>=8'} - - is-extglob@2.1.1: - resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} - engines: {node: '>=0.10.0'} - - is-fullwidth-code-point@3.0.0: - resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} - engines: {node: '>=8'} - - is-fullwidth-code-point@4.0.0: - resolution: {integrity: sha512-O4L094N2/dZ7xqVdrXhh9r1KODPJpFms8B5sGdJLPy664AgvXsreZUyCQQNItZRDlYug4xStLjNp/sz3HvBowQ==} - engines: {node: '>=12'} - - is-glob@4.0.3: - resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} - engines: {node: '>=0.10.0'} - - is-interactive@1.0.0: - resolution: {integrity: sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w==} - engines: {node: '>=8'} - - is-number@7.0.0: - resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} - engines: {node: '>=0.12.0'} - - is-plain-object@5.0.0: - resolution: {integrity: sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==} - engines: {node: '>=0.10.0'} - - is-promise@4.0.0: - resolution: {integrity: sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==} - - is-unicode-supported@0.1.0: - resolution: {integrity: sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==} - engines: {node: '>=10'} - - is-unicode-supported@2.0.0: - resolution: {integrity: sha512-FRdAyx5lusK1iHG0TWpVtk9+1i+GjrzRffhDg4ovQ7mcidMQ6mj+MhKPmvh7Xwyv5gIS06ns49CA7Sqg7lC22Q==} - engines: {node: '>=18'} - - js-string-escape@1.0.1: - resolution: {integrity: sha512-Smw4xcfIQ5LVjAOuJCvN/zIodzA/BBSsluuoSykP+lUvScIi4U6RJLfwHet5cxFnCswUjISV8oAXaqaJDY3chg==} - engines: {node: '>= 0.8'} - - js-yaml@3.14.1: - resolution: {integrity: sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==} - hasBin: true - - js-yaml@4.1.0: - resolution: {integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==} - hasBin: true - - load-json-file@7.0.1: - resolution: {integrity: sha512-Gnxj3ev3mB5TkVBGad0JM6dmLiQL+o0t23JPBZ9sd+yvSLk05mFoqKBw5N8gbbkU4TNXyqCgIrl/VM17OgUIgQ==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - lodash-es@4.17.21: - resolution: {integrity: sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==} - - lodash@4.17.21: - resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} - - log-symbols@4.1.0: - resolution: {integrity: sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==} - engines: {node: '>=10'} - - lru-cache@6.0.0: - resolution: {integrity: sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==} - engines: {node: '>=10'} - - make-dir@3.1.0: - resolution: {integrity: sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==} - engines: {node: '>=8'} - - matcher@5.0.0: - resolution: {integrity: sha512-s2EMBOWtXFc8dgqvoAzKJXxNHibcdJMV0gwqKUaw9E2JBJuGUK7DrNKrA6g/i+v72TT16+6sVm5mS3thaMLQUw==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - md5-hex@3.0.1: - resolution: {integrity: sha512-BUiRtTtV39LIJwinWBjqVsU9xhdnz7/i889V859IBFpuqGAj6LuOvHv5XLbgZ2R7ptJoJaEcxkv88/h25T7Ciw==} - engines: {node: '>=8'} - - memoize@10.0.0: - resolution: {integrity: sha512-H6cBLgsi6vMWOcCpvVCdFFnl3kerEXbrYh9q+lY6VXvQSmM6CkmV08VOwT+WE2tzIEqRPFfAq3fm4v/UIW6mSA==} - engines: {node: '>=18'} - - merge2@1.4.1: - resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} - engines: {node: '>= 8'} - - micromatch@4.0.5: - resolution: {integrity: sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==} - engines: {node: '>=8.6'} - - mimic-fn@2.1.0: - resolution: {integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==} - engines: {node: '>=6'} - - mimic-function@5.0.1: - resolution: {integrity: sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==} - engines: {node: '>=18'} - - minimatch@3.1.2: - resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} - - minipass@3.3.6: - resolution: {integrity: sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==} - engines: {node: '>=8'} - - minipass@5.0.0: - resolution: {integrity: sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==} - engines: {node: '>=8'} - - minizlib@2.1.2: - resolution: {integrity: sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==} - engines: {node: '>= 8'} - - mkdirp@1.0.4: - resolution: {integrity: sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==} - engines: {node: '>=10'} - hasBin: true - - ms@2.1.2: - resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} - - ms@2.1.3: - resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} - - mute-stream@1.0.0: - resolution: {integrity: sha512-avsJQhyd+680gKXyG/sQc0nXaC6rBkPOfyHYcFb9+hdkqQkR9bdnkJ0AMZhke0oesPqIO+mFFJ+IdBc7mst4IA==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - - node-fetch@2.7.0: - resolution: {integrity: sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==} - engines: {node: 4.x || >=6.0.0} - peerDependencies: - encoding: ^0.1.0 - peerDependenciesMeta: - encoding: - optional: true - - node-gyp-build@4.8.0: - resolution: {integrity: sha512-u6fs2AEUljNho3EYTJNBfImO5QTo/J/1Etd+NVdCj7qWKUSN/bSLkZwhDv7I+w/MSC6qJ4cknepkAYykDdK8og==} - hasBin: true - - nofilter@3.1.0: - resolution: {integrity: sha512-l2NNj07e9afPnhAhvgVrCD/oy2Ai1yfLpuo3EpiO1jFTsB4sFz6oIfAfSZyQzVpkZQ9xS8ZS5g1jCBgq4Hwo0g==} - engines: {node: '>=12.19'} - - nopt@5.0.0: - resolution: {integrity: sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==} - engines: {node: '>=6'} - hasBin: true - - npmlog@5.0.1: - resolution: {integrity: sha512-AqZtDUWOMKs1G/8lwylVjrdYgqA4d9nu8hc+0gzRxlDb1I10+FHBGMXs6aiQHFdCUUlqH99MUMuLfzWDNDtfxw==} - - object-assign@4.1.1: - resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} - engines: {node: '>=0.10.0'} - - once@1.4.0: - resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} - - onetime@5.1.2: - resolution: {integrity: sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==} - engines: {node: '>=6'} - - ora@5.4.1: - resolution: {integrity: sha512-5b6Y85tPxZZ7QytO+BQzysW31HJku27cRIlkbAXaNx+BdcVi+LlRFmVXzeF6a7JCwJpyw5c4b+YSVImQIrBpuQ==} - engines: {node: '>=10'} - - os-tmpdir@1.0.2: - resolution: {integrity: sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==} - engines: {node: '>=0.10.0'} - - p-map@7.0.2: - resolution: {integrity: sha512-z4cYYMMdKHzw4O5UkWJImbZynVIo0lSGTXc7bzB1e/rrDqkgGUNysK/o4bTr+0+xKvvLoTyGqYC4Fgljy9qe1Q==} - engines: {node: '>=18'} - - package-config@5.0.0: - resolution: {integrity: sha512-GYTTew2slBcYdvRHqjhwaaydVMvn/qrGC323+nKclYioNSLTDUM/lGgtGTgyHVtYcozb+XkE8CNhwcraOmZ9Mg==} - engines: {node: '>=18'} - - parse-ms@4.0.0: - resolution: {integrity: sha512-TXfryirbmq34y8QBwgqCVLi+8oA3oWx2eAnSn62ITyEhEYaWRlVZ2DvMM9eZbMs/RfxPu/PK/aBLyGj4IrqMHw==} - engines: {node: '>=18'} - - path-is-absolute@1.0.1: - resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==} - engines: {node: '>=0.10.0'} - - path-type@5.0.0: - resolution: {integrity: sha512-5HviZNaZcfqP95rwpv+1HDgUamezbqdSYTyzjTvwtJSnIH+3vnbmWsItli8OFEndS984VT55M3jduxZbX351gg==} - engines: {node: '>=12'} - - picomatch@2.3.1: - resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} - engines: {node: '>=8.6'} - - picomatch@3.0.1: - resolution: {integrity: sha512-I3EurrIQMlRc9IaAZnqRR044Phh2DXY+55o7uJ0V+hYZAcQYSuFWsc9q5PvyDHUSCe1Qxn/iBz+78s86zWnGag==} - engines: {node: '>=10'} - - plur@5.1.0: - resolution: {integrity: sha512-VP/72JeXqak2KiOzjgKtQen5y3IZHn+9GOuLDafPv0eXa47xq0At93XahYBs26MsifCQ4enGKwbjBTKgb9QJXg==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - pretty-ms@9.0.0: - resolution: {integrity: sha512-E9e9HJ9R9NasGOgPaPE8VMeiPKAyWR5jcFpNnwIejslIhWqdqOrb2wShBsncMPUb+BcCd2OPYfh7p2W6oemTng==} - engines: {node: '>=18'} - - queue-microtask@1.2.3: - resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} - - readable-stream@3.6.2: - resolution: {integrity: sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==} - engines: {node: '>= 6'} - - require-directory@2.1.1: - resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} - engines: {node: '>=0.10.0'} - - resolve-cwd@3.0.0: - resolution: {integrity: sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==} - engines: {node: '>=8'} - - resolve-from@5.0.0: - resolution: {integrity: sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==} - engines: {node: '>=8'} - - restore-cursor@3.1.0: - resolution: {integrity: sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==} - engines: {node: '>=8'} - - reusify@1.0.4: - resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==} - engines: {iojs: '>=1.0.0', node: '>=0.10.0'} - - rimraf@3.0.2: - resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==} - hasBin: true - - run-async@3.0.0: - resolution: {integrity: sha512-540WwVDOMxA6dN6We19EcT9sc3hkXPw5mzRNGM3FkdN/vtE9NFvj5lFAPNwUDmJjXidm3v7TC1cTE7t17Ulm1Q==} - engines: {node: '>=0.12.0'} - - run-parallel@1.2.0: - resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} - - rxjs@7.8.1: - resolution: {integrity: sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==} - - safe-buffer@5.2.1: - resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} - - safer-buffer@2.1.2: - resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} - - semver@6.3.1: - resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} - hasBin: true - - semver@7.6.0: - resolution: {integrity: sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==} - engines: {node: '>=10'} - hasBin: true - - serialize-error@7.0.1: - resolution: {integrity: sha512-8I8TjW5KMOKsZQTvoxjuSIa7foAwPWGOts+6o7sgjz41/qMD9VQHEDxi6PBvK2l0MXUmqZyNpUK+T2tQaaElvw==} - engines: {node: '>=10'} - - set-blocking@2.0.0: - resolution: {integrity: sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==} - - set-function-length@1.2.2: - resolution: {integrity: sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==} - engines: {node: '>= 0.4'} - - signal-exit@3.0.7: - resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} - - signal-exit@4.1.0: - resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} - engines: {node: '>=14'} - - slash@5.1.0: - resolution: {integrity: sha512-ZA6oR3T/pEyuqwMgAKT0/hAv8oAXckzbkmR0UkUosQ+Mc4RxGoJkRmwHgHufaenlyAgE1Mxgpdcrf75y6XcnDg==} - engines: {node: '>=14.16'} - - slice-ansi@5.0.0: - resolution: {integrity: sha512-FC+lgizVPfie0kkhqUScwRu1O/lF6NOgJmlCgK+/LYxDCTk8sGelYaHDhFcDN+Sn3Cv+3VSa4Byeo+IMCzpMgQ==} - engines: {node: '>=12'} - - sprintf-js@1.0.3: - resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==} - - stack-utils@2.0.6: - resolution: {integrity: sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==} - engines: {node: '>=10'} - - string-width@4.2.3: - resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} - engines: {node: '>=8'} - - string-width@7.1.0: - resolution: {integrity: sha512-SEIJCWiX7Kg4c129n48aDRwLbFb2LJmXXFrWBG4NGaRtMQ3myKPKbwrD1BKqQn74oCoNMBVrfDEr5M9YxCsrkw==} - engines: {node: '>=18'} - - string_decoder@1.3.0: - resolution: {integrity: sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==} - - strip-ansi@6.0.1: - resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} - engines: {node: '>=8'} - - strip-ansi@7.1.0: - resolution: {integrity: sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==} - engines: {node: '>=12'} - - supertap@3.0.1: - resolution: {integrity: sha512-u1ZpIBCawJnO+0QePsEiOknOfCRq0yERxiAchT0i4li0WHNUJbf0evXXSXOcCAR4M8iMDoajXYmstm/qO81Isw==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - supports-color@7.2.0: - resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} - engines: {node: '>=8'} - - tar@6.2.1: - resolution: {integrity: sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==} - engines: {node: '>=10'} - - temp-dir@3.0.0: - resolution: {integrity: sha512-nHc6S/bwIilKHNRgK/3jlhDoIHcp45YgyiwcAk46Tr0LfEqGBVpmiAyuiuxeVE44m3mXnEeVhaipLOEWmH+Njw==} - engines: {node: '>=14.16'} - - time-zone@1.0.0: - resolution: {integrity: sha512-TIsDdtKo6+XrPtiTm1ssmMngN1sAhyKnTO2kunQWqNPWIVvCm15Wmw4SWInwTVgJ5u/Tr04+8Ei9TNcw4x4ONA==} - engines: {node: '>=4'} - - tmp@0.0.33: - resolution: {integrity: sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==} - engines: {node: '>=0.6.0'} - - to-regex-range@5.0.1: - resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} - engines: {node: '>=8.0'} - - toml@3.0.0: - resolution: {integrity: sha512-y/mWCZinnvxjTKYhJ+pYxwD0mRLVvOtdS2Awbgxln6iEnt4rk0yBxeSBHkGJcPucRiG0e55mwWp+g/05rsrd6w==} - - tr46@0.0.3: - resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==} - - tslib@2.6.2: - resolution: {integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==} - - typanion@3.14.0: - resolution: {integrity: sha512-ZW/lVMRabETuYCd9O9ZvMhAh8GslSqaUjxmK/JLPCh6l73CvLBiuXswj/+7LdnWOgYsQ130FqLzFz5aGT4I3Ug==} - - type-fest@0.13.1: - resolution: {integrity: sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==} - engines: {node: '>=10'} - - type-fest@0.21.3: - resolution: {integrity: sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==} - engines: {node: '>=10'} - - typescript@5.4.5: - resolution: {integrity: sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==} - engines: {node: '>=14.17'} - hasBin: true - - undici-types@5.26.5: - resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==} - - unicorn-magic@0.1.0: - resolution: {integrity: sha512-lRfVq8fE8gz6QMBuDM6a+LO3IAzTi05H6gCVaUpir2E1Rwpo4ZUog45KpNXKC/Mn3Yb9UDuHumeFTo9iV/D9FQ==} - engines: {node: '>=18'} - - universal-user-agent@6.0.1: - resolution: {integrity: sha512-yCzhz6FN2wU1NiiQRogkTQszlQSlpWaw8SvVegAc+bDxbzHgh1vX8uIe8OYyMH6DwH+sdTJsgMl36+mSMdRJIQ==} - - util-deprecate@1.0.2: - resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} - - wasm-sjlj@1.0.5: - resolution: {integrity: sha512-Z/MHJeOkAvJJVWnGX3/YZGYldGaawZbYHX4ldYG9kLhcdB8H31F5x66M7Zc4BP/7pg0aLsusQj1629m2B3Rilg==} - - wcwidth@1.0.1: - resolution: {integrity: sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==} - - webidl-conversions@3.0.1: - resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==} - - well-known-symbols@2.0.0: - resolution: {integrity: sha512-ZMjC3ho+KXo0BfJb7JgtQ5IBuvnShdlACNkKkdsqBmYw3bPAaJfPeYUo6tLUaT5tG/Gkh7xkpBhKRQ9e7pyg9Q==} - engines: {node: '>=6'} - - whatwg-url@5.0.0: - resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==} - - wide-align@1.1.5: - resolution: {integrity: sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==} - - wrap-ansi@6.2.0: - resolution: {integrity: sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==} - engines: {node: '>=8'} - - wrap-ansi@7.0.0: - resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==} - engines: {node: '>=10'} - - wrappy@1.0.2: - resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} - - write-file-atomic@5.0.1: - resolution: {integrity: sha512-+QU2zd6OTD8XWIJCbffaiQeH9U73qIqafo1x6V1snCWYGJf6cVE0cDR4D8xRzcEnfI21IFrUPzPGtcPf8AC+Rw==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - - y18n@5.0.8: - resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==} - engines: {node: '>=10'} - - yallist@4.0.0: - resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==} - - yargs-parser@21.1.1: - resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} - engines: {node: '>=12'} - - yargs@17.7.2: - resolution: {integrity: sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==} - engines: {node: '>=12'} - -snapshots: - - '@emnapi/core@1.1.1': - dependencies: - tslib: 2.6.2 - - '@emnapi/runtime@1.1.1': - dependencies: - tslib: 2.6.2 - - '@inquirer/figures@1.0.1': {} - - '@ljharb/through@2.3.13': - dependencies: - call-bind: 1.0.7 - - '@mapbox/node-pre-gyp@1.0.11': - dependencies: - detect-libc: 2.0.3 - https-proxy-agent: 5.0.1 - make-dir: 3.1.0 - node-fetch: 2.7.0 - nopt: 5.0.0 - npmlog: 5.0.1 - rimraf: 3.0.2 - semver: 7.6.0 - tar: 6.2.1 - transitivePeerDependencies: - - encoding - - supports-color - - '@napi-rs/cli@3.0.0-alpha.51(@emnapi/runtime@1.1.1)(emnapi@1.1.1)': - dependencies: - '@napi-rs/cross-toolchain': 0.0.14 - '@napi-rs/wasm-tools': 0.0.1 - '@octokit/rest': 20.1.0 - clipanion: 3.2.1(typanion@3.14.0) - colorette: 2.0.20 - debug: 4.3.4 - inquirer: 9.2.19 - js-yaml: 4.1.0 - lodash-es: 4.17.21 - semver: 7.6.0 - toml: 3.0.0 - typanion: 3.14.0 - wasm-sjlj: 1.0.5 - optionalDependencies: - '@emnapi/runtime': 1.1.1 - emnapi: 1.1.1 - transitivePeerDependencies: - - '@napi-rs/cross-toolchain-arm64-target-aarch64' - - '@napi-rs/cross-toolchain-arm64-target-armv7' - - '@napi-rs/cross-toolchain-arm64-target-x86_64' - - '@napi-rs/cross-toolchain-x64-target-aarch64' - - '@napi-rs/cross-toolchain-x64-target-armv7' - - '@napi-rs/cross-toolchain-x64-target-x86_64' - - supports-color - - '@napi-rs/cross-toolchain@0.0.14': - dependencies: - '@napi-rs/lzma': 1.2.1 - '@napi-rs/tar': 0.1.0 - debug: 4.3.4 - transitivePeerDependencies: - - supports-color - - '@napi-rs/lzma-android-arm-eabi@1.2.1': - optional: true - - '@napi-rs/lzma-android-arm64@1.2.1': - optional: true - - '@napi-rs/lzma-darwin-arm64@1.2.1': - optional: true - - '@napi-rs/lzma-darwin-x64@1.2.1': - optional: true - - '@napi-rs/lzma-freebsd-x64@1.2.1': - optional: true - - '@napi-rs/lzma-linux-arm-gnueabihf@1.2.1': - optional: true - - '@napi-rs/lzma-linux-arm64-gnu@1.2.1': - optional: true - - '@napi-rs/lzma-linux-arm64-musl@1.2.1': - optional: true - - '@napi-rs/lzma-linux-x64-gnu@1.2.1': - optional: true - - '@napi-rs/lzma-linux-x64-musl@1.2.1': - optional: true - - '@napi-rs/lzma-win32-arm64-msvc@1.2.1': - optional: true - - '@napi-rs/lzma-win32-ia32-msvc@1.2.1': - optional: true - - '@napi-rs/lzma-win32-x64-msvc@1.2.1': - optional: true - - '@napi-rs/lzma@1.2.1': - optionalDependencies: - '@napi-rs/lzma-android-arm-eabi': 1.2.1 - '@napi-rs/lzma-android-arm64': 1.2.1 - '@napi-rs/lzma-darwin-arm64': 1.2.1 - '@napi-rs/lzma-darwin-x64': 1.2.1 - '@napi-rs/lzma-freebsd-x64': 1.2.1 - '@napi-rs/lzma-linux-arm-gnueabihf': 1.2.1 - '@napi-rs/lzma-linux-arm64-gnu': 1.2.1 - '@napi-rs/lzma-linux-arm64-musl': 1.2.1 - '@napi-rs/lzma-linux-x64-gnu': 1.2.1 - '@napi-rs/lzma-linux-x64-musl': 1.2.1 - '@napi-rs/lzma-win32-arm64-msvc': 1.2.1 - '@napi-rs/lzma-win32-ia32-msvc': 1.2.1 - '@napi-rs/lzma-win32-x64-msvc': 1.2.1 - - '@napi-rs/tar-android-arm-eabi@0.1.0': - optional: true - - '@napi-rs/tar-android-arm64@0.1.0': - optional: true - - '@napi-rs/tar-darwin-arm64@0.1.0': - optional: true - - '@napi-rs/tar-darwin-x64@0.1.0': - optional: true - - '@napi-rs/tar-freebsd-x64@0.1.0': - optional: true - - '@napi-rs/tar-linux-arm-gnueabihf@0.1.0': - optional: true - - '@napi-rs/tar-linux-arm64-gnu@0.1.0': - optional: true - - '@napi-rs/tar-linux-arm64-musl@0.1.0': - optional: true - - '@napi-rs/tar-linux-x64-gnu@0.1.0': - optional: true - - '@napi-rs/tar-linux-x64-musl@0.1.0': - optional: true - - '@napi-rs/tar-win32-arm64-msvc@0.1.0': - optional: true - - '@napi-rs/tar-win32-ia32-msvc@0.1.0': - optional: true - - '@napi-rs/tar-win32-x64-msvc@0.1.0': - optional: true - - '@napi-rs/tar@0.1.0': - optionalDependencies: - '@napi-rs/tar-android-arm-eabi': 0.1.0 - '@napi-rs/tar-android-arm64': 0.1.0 - '@napi-rs/tar-darwin-arm64': 0.1.0 - '@napi-rs/tar-darwin-x64': 0.1.0 - '@napi-rs/tar-freebsd-x64': 0.1.0 - '@napi-rs/tar-linux-arm-gnueabihf': 0.1.0 - '@napi-rs/tar-linux-arm64-gnu': 0.1.0 - '@napi-rs/tar-linux-arm64-musl': 0.1.0 - '@napi-rs/tar-linux-x64-gnu': 0.1.0 - '@napi-rs/tar-linux-x64-musl': 0.1.0 - '@napi-rs/tar-win32-arm64-msvc': 0.1.0 - '@napi-rs/tar-win32-ia32-msvc': 0.1.0 - '@napi-rs/tar-win32-x64-msvc': 0.1.0 - - '@napi-rs/wasm-runtime@0.1.2': - dependencies: - '@emnapi/core': 1.1.1 - '@emnapi/runtime': 1.1.1 - '@tybys/wasm-util': 0.8.3 - optional: true - - '@napi-rs/wasm-runtime@0.2.0': - dependencies: - '@emnapi/core': 1.1.1 - '@emnapi/runtime': 1.1.1 - '@tybys/wasm-util': 0.8.3 - - '@napi-rs/wasm-tools-android-arm-eabi@0.0.1': - optional: true - - '@napi-rs/wasm-tools-android-arm64@0.0.1': - optional: true - - '@napi-rs/wasm-tools-darwin-arm64@0.0.1': - optional: true - - '@napi-rs/wasm-tools-darwin-x64@0.0.1': - optional: true - - '@napi-rs/wasm-tools-freebsd-x64@0.0.1': - optional: true - - '@napi-rs/wasm-tools-linux-arm64-gnu@0.0.1': - optional: true - - '@napi-rs/wasm-tools-linux-arm64-musl@0.0.1': - optional: true - - '@napi-rs/wasm-tools-linux-x64-gnu@0.0.1': - optional: true - - '@napi-rs/wasm-tools-linux-x64-musl@0.0.1': - optional: true - - '@napi-rs/wasm-tools-wasm32-wasi@0.0.1': - dependencies: - '@napi-rs/wasm-runtime': 0.1.2 - optional: true - - '@napi-rs/wasm-tools-win32-arm64-msvc@0.0.1': - optional: true - - '@napi-rs/wasm-tools-win32-ia32-msvc@0.0.1': - optional: true - - '@napi-rs/wasm-tools-win32-x64-msvc@0.0.1': - optional: true - - '@napi-rs/wasm-tools@0.0.1': - optionalDependencies: - '@napi-rs/wasm-tools-android-arm-eabi': 0.0.1 - '@napi-rs/wasm-tools-android-arm64': 0.0.1 - '@napi-rs/wasm-tools-darwin-arm64': 0.0.1 - '@napi-rs/wasm-tools-darwin-x64': 0.0.1 - '@napi-rs/wasm-tools-freebsd-x64': 0.0.1 - '@napi-rs/wasm-tools-linux-arm64-gnu': 0.0.1 - '@napi-rs/wasm-tools-linux-arm64-musl': 0.0.1 - '@napi-rs/wasm-tools-linux-x64-gnu': 0.0.1 - '@napi-rs/wasm-tools-linux-x64-musl': 0.0.1 - '@napi-rs/wasm-tools-wasm32-wasi': 0.0.1 - '@napi-rs/wasm-tools-win32-arm64-msvc': 0.0.1 - '@napi-rs/wasm-tools-win32-ia32-msvc': 0.0.1 - '@napi-rs/wasm-tools-win32-x64-msvc': 0.0.1 - - '@nodelib/fs.scandir@2.1.5': - dependencies: - '@nodelib/fs.stat': 2.0.5 - run-parallel: 1.2.0 - - '@nodelib/fs.stat@2.0.5': {} - - '@nodelib/fs.walk@1.2.8': - dependencies: - '@nodelib/fs.scandir': 2.1.5 - fastq: 1.17.1 - - '@octokit/auth-token@4.0.0': {} - - '@octokit/core@5.2.0': - dependencies: - '@octokit/auth-token': 4.0.0 - '@octokit/graphql': 7.1.0 - '@octokit/request': 8.4.0 - '@octokit/request-error': 5.1.0 - '@octokit/types': 13.4.1 - before-after-hook: 2.2.3 - universal-user-agent: 6.0.1 - - '@octokit/endpoint@9.0.5': - dependencies: - '@octokit/types': 13.4.1 - universal-user-agent: 6.0.1 - - '@octokit/graphql@7.1.0': - dependencies: - '@octokit/request': 8.4.0 - '@octokit/types': 13.4.1 - universal-user-agent: 6.0.1 - - '@octokit/openapi-types@20.0.0': {} - - '@octokit/openapi-types@22.1.0': {} - - '@octokit/plugin-paginate-rest@9.2.1(@octokit/core@5.2.0)': - dependencies: - '@octokit/core': 5.2.0 - '@octokit/types': 12.6.0 - - '@octokit/plugin-request-log@4.0.1(@octokit/core@5.2.0)': - dependencies: - '@octokit/core': 5.2.0 - - '@octokit/plugin-rest-endpoint-methods@10.4.1(@octokit/core@5.2.0)': - dependencies: - '@octokit/core': 5.2.0 - '@octokit/types': 12.6.0 - - '@octokit/request-error@5.1.0': - dependencies: - '@octokit/types': 13.4.1 - deprecation: 2.3.1 - once: 1.4.0 - - '@octokit/request@8.4.0': - dependencies: - '@octokit/endpoint': 9.0.5 - '@octokit/request-error': 5.1.0 - '@octokit/types': 13.4.1 - universal-user-agent: 6.0.1 - - '@octokit/rest@20.1.0': - dependencies: - '@octokit/core': 5.2.0 - '@octokit/plugin-paginate-rest': 9.2.1(@octokit/core@5.2.0) - '@octokit/plugin-request-log': 4.0.1(@octokit/core@5.2.0) - '@octokit/plugin-rest-endpoint-methods': 10.4.1(@octokit/core@5.2.0) - - '@octokit/types@12.6.0': - dependencies: - '@octokit/openapi-types': 20.0.0 - - '@octokit/types@13.4.1': - dependencies: - '@octokit/openapi-types': 22.1.0 - - '@rollup/pluginutils@4.2.1': - dependencies: - estree-walker: 2.0.2 - picomatch: 2.3.1 - - '@sindresorhus/merge-streams@2.3.0': {} - - '@tybys/wasm-util@0.8.3': - dependencies: - tslib: 2.6.2 - - '@types/node@20.12.7': - dependencies: - undici-types: 5.26.5 - - '@vercel/nft@0.26.4': - dependencies: - '@mapbox/node-pre-gyp': 1.0.11 - '@rollup/pluginutils': 4.2.1 - acorn: 8.11.3 - acorn-import-attributes: 1.9.5(acorn@8.11.3) - async-sema: 3.1.1 - bindings: 1.5.0 - estree-walker: 2.0.2 - glob: 7.2.3 - graceful-fs: 4.2.11 - micromatch: 4.0.5 - node-gyp-build: 4.8.0 - resolve-from: 5.0.0 - transitivePeerDependencies: - - encoding - - supports-color - - abbrev@1.1.1: {} - - acorn-import-attributes@1.9.5(acorn@8.11.3): - dependencies: - acorn: 8.11.3 - - acorn-walk@8.3.2: {} - - acorn@8.11.3: {} - - agent-base@6.0.2: - dependencies: - debug: 4.3.4 - transitivePeerDependencies: - - supports-color - - ansi-escapes@4.3.2: - dependencies: - type-fest: 0.21.3 - - ansi-regex@5.0.1: {} - - ansi-regex@6.0.1: {} - - ansi-styles@4.3.0: - dependencies: - color-convert: 2.0.1 - - ansi-styles@6.2.1: {} - - aproba@2.0.0: {} - - are-we-there-yet@2.0.0: - dependencies: - delegates: 1.0.0 - readable-stream: 3.6.2 - - argparse@1.0.10: - dependencies: - sprintf-js: 1.0.3 - - argparse@2.0.1: {} - - array-find-index@1.0.2: {} - - arrgv@1.0.2: {} - - arrify@3.0.0: {} - - async-sema@3.1.1: {} - - ava@6.1.2: - dependencies: - '@vercel/nft': 0.26.4 - acorn: 8.11.3 - acorn-walk: 8.3.2 - ansi-styles: 6.2.1 - arrgv: 1.0.2 - arrify: 3.0.0 - callsites: 4.1.0 - cbor: 9.0.2 - chalk: 5.3.0 - chunkd: 2.0.1 - ci-info: 4.0.0 - ci-parallel-vars: 1.0.1 - cli-truncate: 4.0.0 - code-excerpt: 4.0.0 - common-path-prefix: 3.0.0 - concordance: 5.0.4 - currently-unhandled: 0.4.1 - debug: 4.3.4 - emittery: 1.0.3 - figures: 6.1.0 - globby: 14.0.1 - ignore-by-default: 2.1.0 - indent-string: 5.0.0 - is-plain-object: 5.0.0 - is-promise: 4.0.0 - matcher: 5.0.0 - memoize: 10.0.0 - ms: 2.1.3 - p-map: 7.0.2 - package-config: 5.0.0 - picomatch: 3.0.1 - plur: 5.1.0 - pretty-ms: 9.0.0 - resolve-cwd: 3.0.0 - stack-utils: 2.0.6 - strip-ansi: 7.1.0 - supertap: 3.0.1 - temp-dir: 3.0.0 - write-file-atomic: 5.0.1 - yargs: 17.7.2 - transitivePeerDependencies: - - encoding - - supports-color - - balanced-match@1.0.2: {} - - base64-js@1.5.1: {} - - before-after-hook@2.2.3: {} - - bindings@1.5.0: - dependencies: - file-uri-to-path: 1.0.0 - - bl@4.1.0: - dependencies: - buffer: 5.7.1 - inherits: 2.0.4 - readable-stream: 3.6.2 - - blueimp-md5@2.19.0: {} - - brace-expansion@1.1.11: - dependencies: - balanced-match: 1.0.2 - concat-map: 0.0.1 - - braces@3.0.2: - dependencies: - fill-range: 7.0.1 - - buffer@5.7.1: - dependencies: - base64-js: 1.5.1 - ieee754: 1.2.1 - - call-bind@1.0.7: - dependencies: - es-define-property: 1.0.0 - es-errors: 1.3.0 - function-bind: 1.1.2 - get-intrinsic: 1.2.4 - set-function-length: 1.2.2 - - callsites@4.1.0: {} - - cbor@9.0.2: - dependencies: - nofilter: 3.1.0 - - chalk@4.1.2: - dependencies: - ansi-styles: 4.3.0 - supports-color: 7.2.0 - - chalk@5.3.0: {} - - chardet@0.7.0: {} - - chownr@2.0.0: {} - - chunkd@2.0.1: {} - - ci-info@4.0.0: {} - - ci-parallel-vars@1.0.1: {} - - cli-cursor@3.1.0: - dependencies: - restore-cursor: 3.1.0 - - cli-spinners@2.9.2: {} - - cli-truncate@4.0.0: - dependencies: - slice-ansi: 5.0.0 - string-width: 7.1.0 - - cli-width@4.1.0: {} - - clipanion@3.2.1(typanion@3.14.0): - dependencies: - typanion: 3.14.0 - - cliui@8.0.1: - dependencies: - string-width: 4.2.3 - strip-ansi: 6.0.1 - wrap-ansi: 7.0.0 - - clone@1.0.4: {} - - code-excerpt@4.0.0: - dependencies: - convert-to-spaces: 2.0.1 - - color-convert@2.0.1: - dependencies: - color-name: 1.1.4 - - color-name@1.1.4: {} - - color-support@1.1.3: {} - - colorette@2.0.20: {} - - common-path-prefix@3.0.0: {} - - concat-map@0.0.1: {} - - concordance@5.0.4: - dependencies: - date-time: 3.1.0 - esutils: 2.0.3 - fast-diff: 1.3.0 - js-string-escape: 1.0.1 - lodash: 4.17.21 - md5-hex: 3.0.1 - semver: 7.6.0 - well-known-symbols: 2.0.0 - - console-control-strings@1.1.0: {} - - convert-to-spaces@2.0.1: {} - - currently-unhandled@0.4.1: - dependencies: - array-find-index: 1.0.2 - - date-time@3.1.0: - dependencies: - time-zone: 1.0.0 - - debug@4.3.4: - dependencies: - ms: 2.1.2 - - defaults@1.0.4: - dependencies: - clone: 1.0.4 - - define-data-property@1.1.4: - dependencies: - es-define-property: 1.0.0 - es-errors: 1.3.0 - gopd: 1.0.1 - - delegates@1.0.0: {} - - deprecation@2.3.1: {} - - detect-libc@2.0.3: {} - - emittery@1.0.3: {} - - emnapi@1.1.1: {} - - emoji-regex@10.3.0: {} - - emoji-regex@8.0.0: {} - - es-define-property@1.0.0: - dependencies: - get-intrinsic: 1.2.4 - - es-errors@1.3.0: {} - - escalade@3.1.2: {} - - escape-string-regexp@2.0.0: {} - - escape-string-regexp@5.0.0: {} - - esprima@4.0.1: {} - - estree-walker@2.0.2: {} - - esutils@2.0.3: {} - - external-editor@3.1.0: - dependencies: - chardet: 0.7.0 - iconv-lite: 0.4.24 - tmp: 0.0.33 - - fast-diff@1.3.0: {} - - fast-glob@3.3.2: - dependencies: - '@nodelib/fs.stat': 2.0.5 - '@nodelib/fs.walk': 1.2.8 - glob-parent: 5.1.2 - merge2: 1.4.1 - micromatch: 4.0.5 - - fastq@1.17.1: - dependencies: - reusify: 1.0.4 - - figures@6.1.0: - dependencies: - is-unicode-supported: 2.0.0 - - file-uri-to-path@1.0.0: {} - - fill-range@7.0.1: - dependencies: - to-regex-range: 5.0.1 - - find-up-simple@1.0.0: {} - - fs-minipass@2.1.0: - dependencies: - minipass: 3.3.6 - - fs.realpath@1.0.0: {} - - function-bind@1.1.2: {} - - gauge@3.0.2: - dependencies: - aproba: 2.0.0 - color-support: 1.1.3 - console-control-strings: 1.1.0 - has-unicode: 2.0.1 - object-assign: 4.1.1 - signal-exit: 3.0.7 - string-width: 4.2.3 - strip-ansi: 6.0.1 - wide-align: 1.1.5 - - get-caller-file@2.0.5: {} - - get-east-asian-width@1.2.0: {} - - get-intrinsic@1.2.4: - dependencies: - es-errors: 1.3.0 - function-bind: 1.1.2 - has-proto: 1.0.3 - has-symbols: 1.0.3 - hasown: 2.0.2 - - glob-parent@5.1.2: - dependencies: - is-glob: 4.0.3 - - glob@7.2.3: - dependencies: - fs.realpath: 1.0.0 - inflight: 1.0.6 - inherits: 2.0.4 - minimatch: 3.1.2 - once: 1.4.0 - path-is-absolute: 1.0.1 - - globby@14.0.1: - dependencies: - '@sindresorhus/merge-streams': 2.3.0 - fast-glob: 3.3.2 - ignore: 5.3.1 - path-type: 5.0.0 - slash: 5.1.0 - unicorn-magic: 0.1.0 - - gopd@1.0.1: - dependencies: - get-intrinsic: 1.2.4 - - graceful-fs@4.2.11: {} - - has-flag@4.0.0: {} - - has-property-descriptors@1.0.2: - dependencies: - es-define-property: 1.0.0 - - has-proto@1.0.3: {} - - has-symbols@1.0.3: {} - - has-unicode@2.0.1: {} - - hasown@2.0.2: - dependencies: - function-bind: 1.1.2 - - https-proxy-agent@5.0.1: - dependencies: - agent-base: 6.0.2 - debug: 4.3.4 - transitivePeerDependencies: - - supports-color - - iconv-lite@0.4.24: - dependencies: - safer-buffer: 2.1.2 - - ieee754@1.2.1: {} - - ignore-by-default@2.1.0: {} - - ignore@5.3.1: {} - - imurmurhash@0.1.4: {} - - indent-string@5.0.0: {} - - inflight@1.0.6: - dependencies: - once: 1.4.0 - wrappy: 1.0.2 - - inherits@2.0.4: {} - - inquirer@9.2.19: - dependencies: - '@inquirer/figures': 1.0.1 - '@ljharb/through': 2.3.13 - ansi-escapes: 4.3.2 - chalk: 5.3.0 - cli-cursor: 3.1.0 - cli-width: 4.1.0 - external-editor: 3.1.0 - lodash: 4.17.21 - mute-stream: 1.0.0 - ora: 5.4.1 - run-async: 3.0.0 - rxjs: 7.8.1 - string-width: 4.2.3 - strip-ansi: 6.0.1 - wrap-ansi: 6.2.0 - - irregular-plurals@3.5.0: {} - - is-extglob@2.1.1: {} - - is-fullwidth-code-point@3.0.0: {} - - is-fullwidth-code-point@4.0.0: {} - - is-glob@4.0.3: - dependencies: - is-extglob: 2.1.1 - - is-interactive@1.0.0: {} - - is-number@7.0.0: {} - - is-plain-object@5.0.0: {} - - is-promise@4.0.0: {} - - is-unicode-supported@0.1.0: {} - - is-unicode-supported@2.0.0: {} - - js-string-escape@1.0.1: {} - - js-yaml@3.14.1: - dependencies: - argparse: 1.0.10 - esprima: 4.0.1 - - js-yaml@4.1.0: - dependencies: - argparse: 2.0.1 - - load-json-file@7.0.1: {} - - lodash-es@4.17.21: {} - - lodash@4.17.21: {} - - log-symbols@4.1.0: - dependencies: - chalk: 4.1.2 - is-unicode-supported: 0.1.0 - - lru-cache@6.0.0: - dependencies: - yallist: 4.0.0 - - make-dir@3.1.0: - dependencies: - semver: 6.3.1 - - matcher@5.0.0: - dependencies: - escape-string-regexp: 5.0.0 - - md5-hex@3.0.1: - dependencies: - blueimp-md5: 2.19.0 - - memoize@10.0.0: - dependencies: - mimic-function: 5.0.1 - - merge2@1.4.1: {} - - micromatch@4.0.5: - dependencies: - braces: 3.0.2 - picomatch: 2.3.1 - - mimic-fn@2.1.0: {} - - mimic-function@5.0.1: {} - - minimatch@3.1.2: - dependencies: - brace-expansion: 1.1.11 - - minipass@3.3.6: - dependencies: - yallist: 4.0.0 - - minipass@5.0.0: {} - - minizlib@2.1.2: - dependencies: - minipass: 3.3.6 - yallist: 4.0.0 - - mkdirp@1.0.4: {} - - ms@2.1.2: {} - - ms@2.1.3: {} - - mute-stream@1.0.0: {} - - node-fetch@2.7.0: - dependencies: - whatwg-url: 5.0.0 - - node-gyp-build@4.8.0: {} - - nofilter@3.1.0: {} - - nopt@5.0.0: - dependencies: - abbrev: 1.1.1 - - npmlog@5.0.1: - dependencies: - are-we-there-yet: 2.0.0 - console-control-strings: 1.1.0 - gauge: 3.0.2 - set-blocking: 2.0.0 - - object-assign@4.1.1: {} - - once@1.4.0: - dependencies: - wrappy: 1.0.2 - - onetime@5.1.2: - dependencies: - mimic-fn: 2.1.0 - - ora@5.4.1: - dependencies: - bl: 4.1.0 - chalk: 4.1.2 - cli-cursor: 3.1.0 - cli-spinners: 2.9.2 - is-interactive: 1.0.0 - is-unicode-supported: 0.1.0 - log-symbols: 4.1.0 - strip-ansi: 6.0.1 - wcwidth: 1.0.1 - - os-tmpdir@1.0.2: {} - - p-map@7.0.2: {} - - package-config@5.0.0: - dependencies: - find-up-simple: 1.0.0 - load-json-file: 7.0.1 - - parse-ms@4.0.0: {} - - path-is-absolute@1.0.1: {} - - path-type@5.0.0: {} - - picomatch@2.3.1: {} - - picomatch@3.0.1: {} - - plur@5.1.0: - dependencies: - irregular-plurals: 3.5.0 - - pretty-ms@9.0.0: - dependencies: - parse-ms: 4.0.0 - - queue-microtask@1.2.3: {} - - readable-stream@3.6.2: - dependencies: - inherits: 2.0.4 - string_decoder: 1.3.0 - util-deprecate: 1.0.2 - - require-directory@2.1.1: {} - - resolve-cwd@3.0.0: - dependencies: - resolve-from: 5.0.0 - - resolve-from@5.0.0: {} - - restore-cursor@3.1.0: - dependencies: - onetime: 5.1.2 - signal-exit: 3.0.7 - - reusify@1.0.4: {} - - rimraf@3.0.2: - dependencies: - glob: 7.2.3 - - run-async@3.0.0: {} - - run-parallel@1.2.0: - dependencies: - queue-microtask: 1.2.3 - - rxjs@7.8.1: - dependencies: - tslib: 2.6.2 - - safe-buffer@5.2.1: {} - - safer-buffer@2.1.2: {} - - semver@6.3.1: {} - - semver@7.6.0: - dependencies: - lru-cache: 6.0.0 - - serialize-error@7.0.1: - dependencies: - type-fest: 0.13.1 - - set-blocking@2.0.0: {} - - set-function-length@1.2.2: - 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 - - signal-exit@3.0.7: {} - - signal-exit@4.1.0: {} - - slash@5.1.0: {} - - slice-ansi@5.0.0: - dependencies: - ansi-styles: 6.2.1 - is-fullwidth-code-point: 4.0.0 - - sprintf-js@1.0.3: {} - - stack-utils@2.0.6: - dependencies: - escape-string-regexp: 2.0.0 - - string-width@4.2.3: - dependencies: - emoji-regex: 8.0.0 - is-fullwidth-code-point: 3.0.0 - strip-ansi: 6.0.1 - - string-width@7.1.0: - dependencies: - emoji-regex: 10.3.0 - get-east-asian-width: 1.2.0 - strip-ansi: 7.1.0 - - string_decoder@1.3.0: - dependencies: - safe-buffer: 5.2.1 - - strip-ansi@6.0.1: - dependencies: - ansi-regex: 5.0.1 - - strip-ansi@7.1.0: - dependencies: - ansi-regex: 6.0.1 - - supertap@3.0.1: - dependencies: - indent-string: 5.0.0 - js-yaml: 3.14.1 - serialize-error: 7.0.1 - strip-ansi: 7.1.0 - - supports-color@7.2.0: - dependencies: - has-flag: 4.0.0 - - tar@6.2.1: - dependencies: - chownr: 2.0.0 - fs-minipass: 2.1.0 - minipass: 5.0.0 - minizlib: 2.1.2 - mkdirp: 1.0.4 - yallist: 4.0.0 - - temp-dir@3.0.0: {} - - time-zone@1.0.0: {} - - tmp@0.0.33: - dependencies: - os-tmpdir: 1.0.2 - - to-regex-range@5.0.1: - dependencies: - is-number: 7.0.0 - - toml@3.0.0: {} - - tr46@0.0.3: {} - - tslib@2.6.2: {} - - typanion@3.14.0: {} - - type-fest@0.13.1: {} - - type-fest@0.21.3: {} - - typescript@5.4.5: {} - - undici-types@5.26.5: {} - - unicorn-magic@0.1.0: {} - - universal-user-agent@6.0.1: {} - - util-deprecate@1.0.2: {} - - wasm-sjlj@1.0.5: {} - - wcwidth@1.0.1: - dependencies: - defaults: 1.0.4 - - webidl-conversions@3.0.1: {} - - well-known-symbols@2.0.0: {} - - whatwg-url@5.0.0: - dependencies: - tr46: 0.0.3 - webidl-conversions: 3.0.1 - - wide-align@1.1.5: - dependencies: - string-width: 4.2.3 - - wrap-ansi@6.2.0: - dependencies: - ansi-styles: 4.3.0 - string-width: 4.2.3 - strip-ansi: 6.0.1 - - wrap-ansi@7.0.0: - dependencies: - ansi-styles: 4.3.0 - string-width: 4.2.3 - strip-ansi: 6.0.1 - - wrappy@1.0.2: {} - - write-file-atomic@5.0.1: - dependencies: - imurmurhash: 0.1.4 - signal-exit: 4.1.0 - - y18n@5.0.8: {} - - yallist@4.0.0: {} - - yargs-parser@21.1.1: {} - - yargs@17.7.2: - dependencies: - cliui: 8.0.1 - escalade: 3.1.2 - get-caller-file: 2.0.5 - require-directory: 2.1.1 - string-width: 4.2.3 - y18n: 5.0.8 - yargs-parser: 21.1.1 diff --git a/src/builtins.rs b/src/builtins.rs deleted file mode 100644 index 45a25117..00000000 --- a/src/builtins.rs +++ /dev/null @@ -1,71 +0,0 @@ -/// Node.js built-in modules -/// -/// `node -p "[...require('module').builtinModules].map(b => JSON.stringify(b)).join(',\n')"` -/// -pub const NODEJS_BUILTINS: &[&str] = &[ - "_http_agent", - "_http_client", - "_http_common", - "_http_incoming", - "_http_outgoing", - "_http_server", - "_stream_duplex", - "_stream_passthrough", - "_stream_readable", - "_stream_transform", - "_stream_wrap", - "_stream_writable", - "_tls_common", - "_tls_wrap", - "assert", - "assert/strict", - "async_hooks", - "buffer", - "child_process", - "cluster", - "console", - "constants", - "crypto", - "dgram", - "diagnostics_channel", - "dns", - "dns/promises", - "domain", - "events", - "fs", - "fs/promises", - "http", - "http2", - "https", - "inspector", - "module", - "net", - "os", - "path", - "path/posix", - "path/win32", - "perf_hooks", - "process", - "punycode", - "querystring", - "readline", - "repl", - "stream", - "stream/consumers", - "stream/promises", - "stream/web", - "string_decoder", - "sys", - "timers", - "timers/promises", - "tls", - "trace_events", - "tty", - "url", - "util", - "util/types", - "v8", - "vm", - "worker_threads", - "zlib", -]; diff --git a/src/cache.rs b/src/cache.rs deleted file mode 100644 index a1bde36c..00000000 --- a/src/cache.rs +++ /dev/null @@ -1,369 +0,0 @@ -use once_cell::sync::OnceCell as OnceLock; -use std::{ - borrow::{Borrow, Cow}, - convert::AsRef, - hash::{BuildHasherDefault, Hash, Hasher}, - io, - ops::Deref, - path::{Path, PathBuf}, - sync::Arc, -}; - -use dashmap::{DashMap, DashSet}; -use rustc_hash::FxHasher; - -use crate::{ - context::ResolveContext as Ctx, package_json::PackageJson, path::PathUtil, FileMetadata, - FileSystem, ResolveError, ResolveOptions, TsConfig, -}; - -#[derive(Default)] -pub struct Cache { - pub(crate) fs: Fs, - paths: DashSet>, - tsconfigs: DashMap, BuildHasherDefault>, -} - -impl Cache { - pub fn new(fs: Fs) -> Self { - Self { fs, paths: DashSet::default(), tsconfigs: DashMap::default() } - } - - pub fn clear(&self) { - self.paths.clear(); - self.tsconfigs.clear(); - } - - pub fn value(&self, path: &Path) -> CachedPath { - let hash = { - let mut hasher = FxHasher::default(); - path.hash(&mut hasher); - hasher.finish() - }; - if let Some(cache_entry) = self.paths.get((hash, path).borrow() as &dyn CacheKey) { - return cache_entry.clone(); - } - let parent = path.parent().map(|p| self.value(p)); - let data = CachedPath(Arc::new(CachedPathImpl::new( - hash, - path.to_path_buf().into_boxed_path(), - parent, - ))); - self.paths.insert(data.clone()); - data - } - - pub fn tsconfig Result<(), ResolveError>>( - &self, - root: bool, - path: &Path, - callback: F, // callback for modifying tsconfig with `extends` - ) -> Result, ResolveError> { - if let Some(tsconfig_ref) = self.tsconfigs.get(path) { - return Ok(Arc::clone(tsconfig_ref.value())); - } - let meta = self.fs.metadata(path).ok(); - let tsconfig_path = if meta.is_some_and(|m| m.is_file) { - Cow::Borrowed(path) - } else if meta.is_some_and(|m| m.is_dir) { - Cow::Owned(path.join("tsconfig.json")) - } else { - let mut os_string = path.to_path_buf().into_os_string(); - os_string.push(".json"); - Cow::Owned(PathBuf::from(os_string)) - }; - let mut tsconfig_string = self - .fs - .read_to_string(&tsconfig_path) - .map_err(|_| ResolveError::TsconfigNotFound(path.to_path_buf()))?; - let mut tsconfig = - TsConfig::parse(root, &tsconfig_path, &mut tsconfig_string).map_err(|error| { - ResolveError::from_serde_json_error(tsconfig_path.to_path_buf(), &error) - })?; - callback(&mut tsconfig)?; - let tsconfig = Arc::new(tsconfig.build()); - self.tsconfigs.insert(path.to_path_buf(), Arc::clone(&tsconfig)); - Ok(tsconfig) - } -} - -#[derive(Clone)] -pub struct CachedPath(Arc); - -impl Hash for CachedPath { - fn hash(&self, state: &mut H) { - self.0.hash.hash(state); - } -} - -impl PartialEq for CachedPath { - fn eq(&self, other: &Self) -> bool { - self.0.path == other.0.path - } -} -impl Eq for CachedPath {} - -impl Deref for CachedPath { - type Target = CachedPathImpl; - - fn deref(&self) -> &Self::Target { - self.0.as_ref() - } -} - -impl<'a> Borrow for CachedPath { - fn borrow(&self) -> &(dyn CacheKey + 'a) { - self - } -} - -impl AsRef for CachedPath { - fn as_ref(&self) -> &CachedPathImpl { - self.0.as_ref() - } -} - -impl CacheKey for CachedPath { - fn tuple(&self) -> (u64, &Path) { - (self.hash, &self.path) - } -} - -pub struct CachedPathImpl { - hash: u64, - path: Box, - parent: Option, - meta: OnceLock>, - symlink: OnceLock>, - canonicalized: OnceLock>, - node_modules: OnceLock>, - package_json: OnceLock>>, -} - -impl CachedPathImpl { - fn new(hash: u64, path: Box, parent: Option) -> Self { - Self { - hash, - path, - parent, - meta: OnceLock::new(), - symlink: OnceLock::new(), - canonicalized: OnceLock::new(), - node_modules: OnceLock::new(), - package_json: OnceLock::new(), - } - } - - pub fn path(&self) -> &Path { - &self.path - } - - pub fn to_path_buf(&self) -> PathBuf { - self.path.to_path_buf() - } - - pub fn parent(&self) -> Option<&CachedPath> { - self.parent.as_ref() - } - - fn meta(&self, fs: &Fs) -> Option { - *self.meta.get_or_init(|| fs.metadata(&self.path).ok()) - } - - pub fn is_file(&self, fs: &Fs, ctx: &mut Ctx) -> bool { - if let Some(meta) = self.meta(fs) { - ctx.add_file_dependency(self.path()); - meta.is_file - } else { - ctx.add_missing_dependency(self.path()); - false - } - } - - pub fn is_dir(&self, fs: &Fs, ctx: &mut Ctx) -> bool { - self.meta(fs).map_or_else( - || { - ctx.add_missing_dependency(self.path()); - false - }, - |meta| meta.is_dir, - ) - } - - fn symlink(&self, fs: &Fs) -> io::Result> { - self.symlink - .get_or_try_init(|| { - if let Ok(symlink_metadata) = fs.symlink_metadata(&self.path) { - if symlink_metadata.is_symlink { - return fs.canonicalize(self.path()).map(Some); - } - } - Ok(None) - }) - .cloned() - } - - pub fn realpath(&self, fs: &Fs) -> io::Result { - self.canonicalized - .get_or_try_init(|| { - if let Some(link) = self.symlink(fs)? { - return Ok(Some(link)); - } - if let Some(parent) = self.parent() { - let parent_path = parent.realpath(fs)?; - return Ok(Some( - parent_path.normalize_with(self.path.strip_prefix(&parent.path).unwrap()), - )); - }; - Ok(None) - }) - .cloned() - .map(|r| r.unwrap_or_else(|| self.path.clone().to_path_buf())) - } - - pub fn module_directory( - &self, - module_name: &str, - cache: &Cache, - ctx: &mut Ctx, - ) -> Option { - let cached_path = cache.value(&self.path.join(module_name)); - cached_path.is_dir(&cache.fs, ctx).then_some(cached_path) - } - - pub fn cached_node_modules( - &self, - cache: &Cache, - ctx: &mut Ctx, - ) -> Option { - self.node_modules.get_or_init(|| self.module_directory("node_modules", cache, ctx)).clone() - } - - /// Find package.json of a path by traversing parent directories. - /// - /// # Errors - /// - /// * [ResolveError::JSON] - pub fn find_package_json( - &self, - fs: &Fs, - options: &ResolveOptions, - ctx: &mut Ctx, - ) -> Result>, ResolveError> { - let mut cache_value = self; - // Go up directories when the querying path is not a directory - while !cache_value.is_dir(fs, ctx) { - if let Some(cv) = &cache_value.parent { - cache_value = cv.as_ref(); - } else { - break; - } - } - let mut cache_value = Some(cache_value); - while let Some(cv) = cache_value { - if let Some(package_json) = cv.package_json(fs, options, ctx)? { - return Ok(Some(Arc::clone(&package_json))); - } - cache_value = cv.parent.as_deref(); - } - Ok(None) - } - - /// Get package.json of the given path. - /// - /// # Errors - /// - /// * [ResolveError::JSON] - pub fn package_json( - &self, - fs: &Fs, - options: &ResolveOptions, - ctx: &mut Ctx, - ) -> Result>, ResolveError> { - // Change to `std::sync::OnceLock::get_or_try_init` when it is stable. - let result = self - .package_json - .get_or_try_init(|| { - let package_json_path = self.path.join("package.json"); - let Ok(package_json_string) = fs.read_to_string(&package_json_path) else { - return Ok(None); - }; - let real_path = if options.symlinks { - self.realpath(fs)?.join("package.json") - } else { - package_json_path.clone() - }; - PackageJson::parse(package_json_path.clone(), real_path, &package_json_string) - .map(Arc::new) - .map(Some) - .map_err(|error| ResolveError::from_serde_json_error(package_json_path, &error)) - }) - .cloned(); - // https://github.com/webpack/enhanced-resolve/blob/58464fc7cb56673c9aa849e68e6300239601e615/lib/DescriptionFileUtils.js#L68-L82 - match &result { - Ok(Some(package_json)) => { - ctx.add_file_dependency(&package_json.path); - } - Ok(None) => { - // Avoid an allocation by making this lazy - if let Some(deps) = &mut ctx.missing_dependencies { - deps.push(self.path.join("package.json")); - } - } - Err(_) => { - if let Some(deps) = &mut ctx.file_dependencies { - deps.push(self.path.join("package.json")); - } - } - } - result - } -} - -/// Memoized cache key, code adapted from . -trait CacheKey { - fn tuple(&self) -> (u64, &Path); -} - -impl Hash for dyn CacheKey + '_ { - fn hash(&self, state: &mut H) { - self.tuple().0.hash(state); - } -} - -impl PartialEq for dyn CacheKey + '_ { - fn eq(&self, other: &Self) -> bool { - self.tuple().1 == other.tuple().1 - } -} - -impl Eq for dyn CacheKey + '_ {} - -impl<'a> CacheKey for (u64, &'a Path) { - fn tuple(&self) -> (u64, &Path) { - (self.0, self.1) - } -} - -impl<'a> Borrow for (u64, &'a Path) { - fn borrow(&self) -> &(dyn CacheKey + 'a) { - self - } -} - -/// Since the cache key is memoized, use an identity hasher -/// to avoid double cache. -#[derive(Default)] -struct IdentityHasher(u64); - -impl Hasher for IdentityHasher { - fn write(&mut self, _: &[u8]) { - unreachable!("Invalid use of IdentityHasher") - } - fn write_u64(&mut self, n: u64) { - self.0 = n; - } - fn finish(&self) -> u64 { - self.0 - } -} diff --git a/src/context.rs b/src/context.rs deleted file mode 100644 index 9349de30..00000000 --- a/src/context.rs +++ /dev/null @@ -1,89 +0,0 @@ -use std::{ - ops::{Deref, DerefMut}, - path::{Path, PathBuf}, -}; - -use crate::error::ResolveError; - -#[derive(Debug, Default, Clone)] -pub struct ResolveContext(ResolveContextImpl); - -#[derive(Debug, Default, Clone)] -pub struct ResolveContextImpl { - pub fully_specified: bool, - - pub query: Option, - - pub fragment: Option, - - /// Files that was found on file system - pub file_dependencies: Option>, - - /// Files that was found on file system - pub missing_dependencies: Option>, - - /// The current resolving alias for bailing recursion alias. - pub resolving_alias: Option, - - /// For avoiding infinite recursion, which will cause stack overflow. - depth: u8, -} - -impl Deref for ResolveContext { - type Target = ResolveContextImpl; - - fn deref(&self) -> &Self::Target { - &self.0 - } -} - -impl DerefMut for ResolveContext { - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} - -impl ResolveContext { - pub fn with_fully_specified(&mut self, yes: bool) { - self.fully_specified = yes; - } - - pub fn with_query_fragment(&mut self, query: Option<&str>, fragment: Option<&str>) { - if let Some(query) = query { - self.query.replace(query.to_string()); - } - if let Some(fragment) = fragment { - self.fragment.replace(fragment.to_string()); - } - } - - pub fn init_file_dependencies(&mut self) { - self.file_dependencies.replace(vec![]); - self.missing_dependencies.replace(vec![]); - } - - pub fn add_file_dependency(&mut self, dep: &Path) { - if let Some(deps) = &mut self.file_dependencies { - deps.push(dep.to_path_buf()); - } - } - - pub fn add_missing_dependency(&mut self, dep: &Path) { - if let Some(deps) = &mut self.missing_dependencies { - deps.push(dep.to_path_buf()); - } - } - - pub fn with_resolving_alias(&mut self, alias: String) { - self.resolving_alias = Some(alias); - } - - pub fn test_for_infinite_recursion(&mut self) -> Result<(), ResolveError> { - self.depth += 1; - // 64 should be more than enough for detecting infinite recursion. - if self.depth > 64 { - return Err(ResolveError::Recursion); - } - Ok(()) - } -} diff --git a/src/error.rs b/src/error.rs deleted file mode 100644 index ff2aaa4f..00000000 --- a/src/error.rs +++ /dev/null @@ -1,160 +0,0 @@ -use std::{io, path::PathBuf, sync::Arc}; -use thiserror::Error; - -/// All resolution errors -/// -/// `thiserror` is used to display meaningful error messages. -#[derive(Debug, Clone, PartialEq, Error)] -pub enum ResolveError { - /// Ignored path - /// - /// Derived from ignored path (false value) from browser field in package.json - /// ```json - /// { - /// "browser": { - /// "./module": false - /// } - /// } - /// ``` - /// See - #[error("Path is ignored {0}")] - Ignored(PathBuf), - - /// Module not found - #[error("Cannot find module '{0}'")] - NotFound(/* specifier */ String), - - /// Tsconfig not found - #[error("Tsconfig not found {0}")] - TsconfigNotFound(PathBuf), - - #[error("{0}")] - IOError(IOError), - - /// Node.js builtin modules - /// - /// This is an error due to not being a Node.js runtime. - /// The `alias` option can be used to resolve a builtin module to a polyfill. - #[error("Builtin module {0}")] - Builtin(String), - - /// All of the aliased extension are not found - #[error("All of the aliased extension are not found")] - ExtensionAlias, - - /// The provided path specifier cannot be parsed - #[error("{0}")] - Specifier(SpecifierError), - - /// JSON parse error - #[error("{0:?}")] - JSON(JSONError), - - /// Restricted by `ResolveOptions::restrictions` - #[error(r#"Path "{0}" restricted by {0}"#)] - Restriction(PathBuf, PathBuf), - - #[error(r#"Invalid module "{0}" specifier is not a valid subpath for the "exports" resolution of {1}"#)] - InvalidModuleSpecifier(String, PathBuf), - - #[error(r#"Invalid "exports" target "{0}" defined for '{1}' in the package config {2}"#)] - InvalidPackageTarget(String, String, PathBuf), - - #[error(r#"Package subpath '{0}' is not defined by "exports" in {1}"#)] - PackagePathNotExported(String, PathBuf), - - #[error(r#"Invalid package config "{0}", "exports" cannot contain some keys starting with '.' and some not. The exports object must either be an object of package subpath keys or an object of main entry condition name keys only."#)] - InvalidPackageConfig(PathBuf), - - #[error(r#"Default condition should be last one in "{0}""#)] - InvalidPackageConfigDefault(PathBuf), - - #[error(r#"Expecting folder to folder mapping. "{0}" should end with "/"#)] - InvalidPackageConfigDirectory(PathBuf), - - #[error(r#"Package import specifier "{0}" is not defined in package {1}"#)] - PackageImportNotDefined(String, PathBuf), - - #[error("{0} is unimplemented")] - Unimplemented(&'static str), - - /// Occurs when alias paths reference each other. - #[error("Recursion in resolving")] - Recursion, -} - -impl ResolveError { - pub fn is_ignore(&self) -> bool { - matches!(self, Self::Ignored(_)) - } - - pub(crate) fn from_serde_json_error(path: PathBuf, error: &serde_json::Error) -> Self { - Self::JSON(JSONError { - path, - message: error.to_string(), - line: error.line(), - column: error.column(), - }) - } -} - -/// Error for [ResolveError::Specifier] -#[derive(Debug, Clone, Eq, PartialEq, Error)] -pub enum SpecifierError { - #[error("The specifiers must be a non-empty string. Received \"{0}\"")] - Empty(String), -} - -/// JSON error from [serde_json::Error] -#[derive(Debug, Clone, Eq, PartialEq)] -pub struct JSONError { - pub path: PathBuf, - pub message: String, - pub line: usize, - pub column: usize, -} - -#[derive(Debug, Clone, Error)] -#[error("{0}")] -pub struct IOError(Arc); - -impl PartialEq for IOError { - fn eq(&self, other: &Self) -> bool { - self.0.kind() == other.0.kind() - } -} - -impl From for io::Error { - fn from(error: IOError) -> Self { - let io_error = error.0.as_ref(); - Self::new(io_error.kind(), io_error.to_string()) - } -} - -impl From for ResolveError { - fn from(err: io::Error) -> Self { - Self::IOError(IOError(Arc::new(err))) - } -} - -#[test] -fn test_into_io_error() { - use std::io::{self, ErrorKind}; - let error_string = "IOError occurred"; - let string_error = io::Error::new(ErrorKind::Interrupted, error_string.to_string()); - let string_error2 = io::Error::new(ErrorKind::Interrupted, error_string.to_string()); - let resolve_io_error: ResolveError = ResolveError::from(string_error2); - - assert_eq!(resolve_io_error, ResolveError::from(string_error)); - assert_eq!(resolve_io_error.clone(), resolve_io_error); - if let ResolveError::IOError(io_error) = resolve_io_error { - // fix for https://github.com/web-infra-dev/rspack/issues/4564 - let std_io_error: io::Error = io_error.into(); - assert_eq!(std_io_error.kind(), ErrorKind::Interrupted); - assert_eq!(std_io_error.to_string(), error_string); - assert_eq!( - format!("{std_io_error:?}"), - r#"Custom { kind: Interrupted, error: "IOError occurred" }"# - ); - } -} diff --git a/src/file_system.rs b/src/file_system.rs deleted file mode 100644 index 04d177de..00000000 --- a/src/file_system.rs +++ /dev/null @@ -1,133 +0,0 @@ -use std::{ - fs, io, - path::{Path, PathBuf}, -}; - -/// File System abstraction used for `ResolverGeneric` -pub trait FileSystem: Send + Sync { - /// See [std::fs::read_to_string] - /// - /// # Errors - /// - /// * See [std::fs::read_to_string] - /// ## Warning - /// Use `&Path` instead of a generic `P: AsRef` here, - /// because object safety requirements, it is especially useful, when - /// you want to store multiple `dyn FileSystem` in a `Vec` or use a `ResolverGeneric` in - /// napi env. - fn read_to_string(&self, path: &Path) -> io::Result; - - /// See [std::fs::metadata] - /// - /// # Errors - /// See [std::fs::metadata] - /// ## Warning - /// Use `&Path` instead of a generic `P: AsRef` here, - /// because object safety requirements, it is especially useful, when - /// you want to store multiple `dyn FileSystem` in a `Vec` or use a `ResolverGeneric` in - /// napi env. - fn metadata(&self, path: &Path) -> io::Result; - - /// See [std::fs::symlink_metadata] - /// - /// # Errors - /// - /// See [std::fs::symlink_metadata] - /// ## Warning - /// Use `&Path` instead of a generic `P: AsRef` here, - /// because object safety requirements, it is especially useful, when - /// you want to store multiple `dyn FileSystem` in a `Vec` or use a `ResolverGeneric` in - /// napi env. - fn symlink_metadata(&self, path: &Path) -> io::Result; - - /// See [std::fs::canonicalize] - /// - /// # Errors - /// - /// See [std::fs::read_link] - /// ## Warning - /// Use `&Path` instead of a generic `P: AsRef` here, - /// because object safety requirements, it is especially useful, when - /// you want to store multiple `dyn FileSystem` in a `Vec` or use a `ResolverGeneric` in - /// napi env. - fn canonicalize(&self, path: &Path) -> io::Result; -} - -/// Metadata information about a file -#[derive(Debug, Clone, Copy)] -pub struct FileMetadata { - pub(crate) is_file: bool, - pub(crate) is_dir: bool, - pub(crate) is_symlink: bool, -} - -impl FileMetadata { - pub fn new(is_file: bool, is_dir: bool, is_symlink: bool) -> Self { - Self { is_file, is_dir, is_symlink } - } -} - -impl From for FileMetadata { - fn from(metadata: fs::Metadata) -> Self { - Self::new(metadata.is_file(), metadata.is_dir(), metadata.is_symlink()) - } -} - -/// Operating System -#[derive(Default)] -pub struct FileSystemOs; - -impl FileSystem for FileSystemOs { - fn read_to_string(&self, path: &Path) -> io::Result { - fs::read_to_string(path) - } - - fn metadata(&self, path: &Path) -> io::Result { - fs::metadata(path).map(FileMetadata::from) - } - - fn symlink_metadata(&self, path: &Path) -> io::Result { - fs::symlink_metadata(path).map(FileMetadata::from) - } - - fn canonicalize(&self, path: &Path) -> io::Result { - #[cfg(not(target_os = "wasi"))] - { - dunce::canonicalize(path) - } - #[cfg(target_os = "wasi")] - { - let meta = fs::symlink_metadata(path)?; - if meta.file_type().is_symlink() { - let link = fs::read_link(path)?; - let mut path_buf = path.to_path_buf(); - path_buf.pop(); - for segment in link.iter() { - match segment.to_str() { - Some("..") => { - path_buf.pop(); - } - Some(".") | None => {} - Some(seg) => { - // Need to trim the extra \0 introduces by rust std rust-lang/rust#123727 - path_buf.push(seg.trim_end_matches('\0')); - } - } - } - Ok(path_buf) - } else { - Ok(path.to_path_buf()) - } - } - } -} - -#[test] -fn metadata() { - let meta = FileMetadata { is_file: true, is_dir: true, is_symlink: true }; - assert_eq!( - format!("{meta:?}"), - "FileMetadata { is_file: true, is_dir: true, is_symlink: true }" - ); - let _ = meta; -} diff --git a/src/lib.rs b/src/lib.rs deleted file mode 100644 index fe116552..00000000 --- a/src/lib.rs +++ /dev/null @@ -1,1670 +0,0 @@ -//! # Oxc Resolver -//! -//! Node.js [CommonJS][cjs] and [ECMAScript][esm] Module Resolution. -//! -//! A module resolution is the process of finding the file referenced by a module specifier in -//! `import "specifier"` or `require("specifier")`. -//! -//! All [configuration options](ResolveOptions) are aligned with webpack's [enhanced-resolve]. -//! -//! ## Terminology -//! -//! ### Specifier -//! -//! For [CommonJS modules][cjs], -//! the specifier is the string passed to the `require` function. e.g. `"id"` in `require("id")`. -//! -//! For [ECMAScript modules][esm], -//! the specifier of an `import` statement is the string after the `from` keyword, -//! e.g. `'specifier'` in `import 'specifier'` or `import { sep } from 'specifier'`. -//! Specifiers are also used in export from statements, and as the argument to an `import()` expression. -//! -//! This is also named "request" in some places. -//! -//! ## References: -//! -//! * Algorithm adapted from Node.js [CommonJS Module Resolution Algorithm] and [ECMAScript Module Resolution Algorithm]. -//! * Tests are ported from [enhanced-resolve]. -//! * Some code is adapted from [parcel-resolver]. -//! * The documentation is copied from [webpack's resolve configuration](https://webpack.js.org/configuration/resolve). -//! -//! [enhanced-resolve]: https://github.com/webpack/enhanced-resolve -//! [CommonJS Module Resolution Algorithm]: https://nodejs.org/api/modules.html#all-together -//! [ECMAScript Module Resolution Algorithm]: https://nodejs.org/api/esm.html#resolution-algorithm-specification -//! [parcel-resolver]: https://github.com/parcel-bundler/parcel/blob/v2/packages/utils/node-resolver-rs -//! [cjs]: https://nodejs.org/api/modules.html -//! [esm]: https://nodejs.org/api/esm.html -//! -//! ## Feature flags -#![cfg_attr(feature = "document-features", doc = document_features::document_features!())] -#![cfg_attr(docsrs, feature(doc_auto_cfg))] -//! -//! ## Example -//! -//! ```rust,ignore -#![doc = include_str!("../examples/resolver.rs")] -//! ``` - -mod builtins; -mod cache; -mod context; -mod error; -mod file_system; -mod options; -mod package_json; -mod path; -mod resolution; -mod specifier; -mod tsconfig; - -#[cfg(test)] -mod tests; - -use std::{ - borrow::Cow, - cmp::Ordering, - ffi::OsStr, - fmt, - path::{Component, Path, PathBuf}, - sync::Arc, -}; - -use rustc_hash::FxHashSet; -use serde_json::Value as JSONValue; -use typescript_tsconfig_json::ExtendsField; - -pub use crate::{ - builtins::NODEJS_BUILTINS, - error::{JSONError, ResolveError, SpecifierError}, - file_system::{FileMetadata, FileSystem}, - options::{ - Alias, AliasValue, EnforceExtension, ResolveOptions, Restriction, TsconfigOptions, - TsconfigReferences, - }, - package_json::PackageJson, - resolution::Resolution, -}; -use crate::{ - cache::{Cache, CachedPath}, - context::ResolveContext as Ctx, - file_system::FileSystemOs, - package_json::JSONMap, - path::{PathUtil, SLASH_START}, - specifier::Specifier, - tsconfig::{ProjectReference, TsConfig}, -}; - -type ResolveResult = Result, ResolveError>; - -/// Context returned from the [Resolver::resolve_with_context] API -#[derive(Debug, Default, Clone)] -pub struct ResolveContext { - /// Files that was found on file system - pub file_dependencies: FxHashSet, - - /// Dependencies that was not found on file system - pub missing_dependencies: FxHashSet, -} - -/// Resolver with the current operating system as the file system -pub type Resolver = ResolverGeneric; - -/// Generic implementation of the resolver, can be configured by the [FileSystem] trait -pub struct ResolverGeneric { - options: ResolveOptions, - cache: Arc>, -} - -impl fmt::Debug for ResolverGeneric { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - self.options.fmt(f) - } -} - -impl Default for ResolverGeneric { - fn default() -> Self { - Self::new(ResolveOptions::default()) - } -} - -impl ResolverGeneric { - pub fn new(options: ResolveOptions) -> Self { - Self { options: options.sanitize(), cache: Arc::new(Cache::new(Fs::default())) } - } -} - -impl ResolverGeneric { - pub fn new_with_file_system(file_system: Fs, options: ResolveOptions) -> Self { - Self { cache: Arc::new(Cache::new(file_system)), options: options.sanitize() } - } - - /// Clone the resolver using the same underlying cache. - #[must_use] - pub fn clone_with_options(&self, options: ResolveOptions) -> Self { - Self { options: options.sanitize(), cache: Arc::clone(&self.cache) } - } - - /// Returns the options. - pub fn options(&self) -> &ResolveOptions { - &self.options - } - - /// Clear the underlying cache. - pub fn clear_cache(&self) { - self.cache.clear(); - } - - /// Resolve `specifier` at an absolute `path`. - /// - /// A specifier is the string passed to require or import, i.e. `require("specifier")` or `import "specifier"`. - /// - /// `path` must be an **absolute** path to a directory where the specifier is resolved against. - /// For CommonJS modules, it is the `__dirname` variable that contains the absolute path to the folder containing current module. - /// For ECMAScript modules, it is the value of `import.meta.url`. - /// - /// # Errors - /// - /// * See [ResolveError] - pub fn resolve>( - &self, - path: P, - specifier: &str, - ) -> Result { - let mut ctx = Ctx::default(); - self.resolve_tracing(path.as_ref(), specifier, &mut ctx) - } - - /// Resolve `specifier` at absolute `path` with [ResolveContext] - /// - /// # Errors - /// - /// * See [ResolveError] - pub fn resolve_with_context>( - &self, - path: P, - specifier: &str, - resolve_context: &mut ResolveContext, - ) -> Result { - let mut ctx = Ctx::default(); - ctx.init_file_dependencies(); - let result = self.resolve_tracing(path.as_ref(), specifier, &mut ctx); - if let Some(deps) = &mut ctx.file_dependencies { - resolve_context.file_dependencies.extend(deps.drain(..)); - } - if let Some(deps) = &mut ctx.missing_dependencies { - resolve_context.missing_dependencies.extend(deps.drain(..)); - } - result - } - - /// Wrap `resolve_impl` with `tracing` information - fn resolve_tracing( - &self, - path: &Path, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - let span = tracing::debug_span!("resolve", path = ?path, specifier = specifier); - let _enter = span.enter(); - let r = self.resolve_impl(path, specifier, ctx); - match &r { - Ok(r) => { - tracing::debug!(options = ?self.options, path = ?path, specifier = specifier, ret = ?r.path); - } - Err(err) => { - tracing::debug!(options = ?self.options, path = ?path, specifier = specifier, err = ?err); - } - }; - r - } - - fn resolve_impl( - &self, - path: &Path, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - ctx.with_fully_specified(self.options.fully_specified); - let cached_path = self.cache.value(path); - let cached_path = self.require(&cached_path, specifier, ctx)?; - let path = self.load_realpath(&cached_path)?; - // enhanced-resolve: restrictions - self.check_restrictions(&path)?; - let package_json = cached_path.find_package_json(&self.cache.fs, &self.options, ctx)?; - if let Some(package_json) = &package_json { - // path must be inside the package. - debug_assert!(path.starts_with(package_json.directory())); - } - Ok(Resolution { - path, - query: ctx.query.take(), - fragment: ctx.fragment.take(), - package_json, - }) - } - - /// require(X) from module at path Y - /// - /// X: specifier - /// Y: path - /// - /// - fn require( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - ctx.test_for_infinite_recursion()?; - - // enhanced-resolve: parse - let (parsed, try_fragment_as_path) = self.load_parse(cached_path, specifier, ctx)?; - if let Some(path) = try_fragment_as_path { - return Ok(path); - } - - self.require_without_parse(cached_path, parsed.path(), ctx) - } - - fn require_without_parse( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - // tsconfig-paths - if let Some(path) = self.load_tsconfig_paths(cached_path, specifier, &mut Ctx::default())? { - return Ok(path); - } - - // enhanced-resolve: try alias - if let Some(path) = self.load_alias(cached_path, specifier, &self.options.alias, ctx)? { - return Ok(path); - } - - let result = match Path::new(specifier).components().next() { - // 3. If X begins with './' or '/' or '../' - Some(Component::RootDir | Component::Prefix(_)) => { - self.require_absolute(cached_path, specifier, ctx) - } - // 3. If X begins with './' or '/' or '../' - Some(Component::CurDir | Component::ParentDir) => { - self.require_relative(cached_path, specifier, ctx) - } - // 4. If X begins with '#' - Some(Component::Normal(_)) if specifier.as_bytes()[0] == b'#' => { - self.require_hash(cached_path, specifier, ctx) - } - _ => { - // 1. If X is a core module, - // a. return the core module - // b. STOP - self.require_core(specifier)?; - - // (ESM) 5. Otherwise, - // Note: specifier is now a bare specifier. - // Set resolved the result of PACKAGE_RESOLVE(specifier, parentURL). - self.require_bare(cached_path, specifier, ctx) - } - }; - - result.or_else(|err| { - if err.is_ignore() { - return Err(err); - } - // enhanced-resolve: try fallback - self.load_alias(cached_path, specifier, &self.options.fallback, ctx) - .and_then(|value| value.ok_or(err)) - }) - } - - // PACKAGE_RESOLVE(packageSpecifier, parentURL) - // 3. If packageSpecifier is a Node.js builtin module name, then - // 1. Return the string "node:" concatenated with packageSpecifier. - fn require_core(&self, specifier: &str) -> Result<(), ResolveError> { - if self.options.builtin_modules { - let starts_with_node = specifier.starts_with("node:"); - if starts_with_node || NODEJS_BUILTINS.binary_search(&specifier).is_ok() { - let mut specifier = specifier.to_string(); - if !starts_with_node { - specifier = format!("node:{specifier}"); - } - return Err(ResolveError::Builtin(specifier)); - } - } - Ok(()) - } - - fn require_absolute( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - // Make sure only path prefixes gets called - debug_assert!(Path::new(specifier) - .components() - .next() - .is_some_and(|c| matches!(c, Component::RootDir | Component::Prefix(_)))); - if !self.options.prefer_relative && self.options.prefer_absolute { - if let Ok(path) = self.load_package_self_or_node_modules(cached_path, specifier, ctx) { - return Ok(path); - } - } - if let Some(path) = self.load_roots(specifier, ctx) { - return Ok(path); - } - // 2. If X begins with '/' - // a. set Y to be the file system root - let path = self.cache.value(Path::new(specifier)); - if let Some(path) = self.load_as_file_or_directory(&path, specifier, ctx)? { - return Ok(path); - } - Err(ResolveError::NotFound(specifier.to_string())) - } - - // 3. If X begins with './' or '/' or '../' - fn require_relative( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - // Make sure only relative or normal paths gets called - debug_assert!(Path::new(specifier).components().next().is_some_and(|c| matches!( - c, - Component::CurDir | Component::ParentDir | Component::Normal(_) - ))); - let path = cached_path.path().normalize_with(specifier); - let cached_path = self.cache.value(&path); - // a. LOAD_AS_FILE(Y + X) - // b. LOAD_AS_DIRECTORY(Y + X) - if let Some(path) = self.load_as_file_or_directory(&cached_path, specifier, ctx)? { - return Ok(path); - } - // c. THROW "not found" - Err(ResolveError::NotFound(specifier.to_string())) - } - - fn require_hash( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - debug_assert_eq!(specifier.chars().next(), Some('#')); - // a. LOAD_PACKAGE_IMPORTS(X, dirname(Y)) - if let Some(path) = self.load_package_imports(cached_path, specifier, ctx)? { - return Ok(path); - } - self.load_package_self_or_node_modules(cached_path, specifier, ctx) - } - - fn require_bare( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - // Make sure no other path prefixes gets called - debug_assert!(Path::new(specifier) - .components() - .next() - .is_some_and(|c| matches!(c, Component::Normal(_)))); - if self.options.prefer_relative { - if let Ok(path) = self.require_relative(cached_path, specifier, ctx) { - return Ok(path); - } - } - self.load_package_self_or_node_modules(cached_path, specifier, ctx) - } - - /// enhanced-resolve: ParsePlugin. - /// - /// 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`. - /// - /// - fn load_parse<'s>( - &self, - cached_path: &CachedPath, - specifier: &'s str, - ctx: &mut Ctx, - ) -> Result<(Specifier<'s>, Option), ResolveError> { - let parsed = Specifier::parse(specifier).map_err(ResolveError::Specifier)?; - ctx.with_query_fragment(parsed.query, parsed.fragment); - - // There is an edge-case where a request with # can be a path or a fragment -> try both - if ctx.fragment.is_some() && ctx.query.is_none() { - let specifier = parsed.path(); - let fragment = ctx.fragment.take().unwrap(); - let path = format!("{specifier}{fragment}"); - if let Ok(path) = self.require_without_parse(cached_path, &path, ctx) { - return Ok((parsed, Some(path))); - } - ctx.fragment.replace(fragment); - } - Ok((parsed, None)) - } - - fn load_package_self_or_node_modules( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - let (_, subpath) = Self::parse_package_specifier(specifier); - if subpath.is_empty() { - ctx.with_fully_specified(false); - } - // 5. LOAD_PACKAGE_SELF(X, dirname(Y)) - if let Some(path) = self.load_package_self(cached_path, specifier, ctx)? { - return Ok(path); - } - // 6. LOAD_NODE_MODULES(X, dirname(Y)) - if let Some(path) = self.load_node_modules(cached_path, specifier, ctx)? { - return Ok(path); - } - // 7. THROW "not found" - Err(ResolveError::NotFound(specifier.to_string())) - } - - /// LOAD_PACKAGE_IMPORTS(X, DIR) - fn load_package_imports( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - // 1. Find the closest package scope SCOPE to DIR. - // 2. If no scope was found, return. - let Some(package_json) = - cached_path.find_package_json(&self.cache.fs, &self.options, ctx)? - else { - return Ok(None); - }; - // 3. If the SCOPE/package.json "imports" is null or undefined, return. - // 4. let MATCH = PACKAGE_IMPORTS_RESOLVE(X, pathToFileURL(SCOPE), ["node", "require"]) defined in the ESM resolver. - if let Some(path) = self.package_imports_resolve(specifier, &package_json, ctx)? { - // 5. RESOLVE_ESM_MATCH(MATCH). - return self.resolve_esm_match(specifier, &path, ctx); - } - Ok(None) - } - - fn load_as_file(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - // enhanced-resolve feature: extension_alias - if let Some(path) = self.load_extension_alias(cached_path, ctx)? { - return Ok(Some(path)); - } - if self.options.enforce_extension.is_disabled() { - // 1. If X is a file, load X as its file extension format. STOP - if let Some(path) = self.load_alias_or_file(cached_path, ctx)? { - return Ok(Some(path)); - } - } - // 2. If X.js is a file, load X.js as JavaScript text. STOP - // 3. If X.json is a file, parse X.json to a JavaScript Object. STOP - // 4. If X.node is a file, load X.node as binary addon. STOP - if let Some(path) = - self.load_extensions(cached_path.path(), &self.options.extensions, ctx)? - { - return Ok(Some(path)); - } - Ok(None) - } - - fn load_as_directory(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - // TODO: Only package.json is supported, so warn about having other values - // Checking for empty files is needed for omitting checks on package.json - // 1. If X/package.json is a file, - if !self.options.description_files.is_empty() { - // a. Parse X/package.json, and look for "main" field. - if let Some(package_json) = - cached_path.package_json(&self.cache.fs, &self.options, ctx)? - { - // b. If "main" is a falsy value, GOTO 2. - for main_field in package_json.main_fields(&self.options.main_fields) { - // c. let M = X + (json main field) - let main_field_path = cached_path.path().normalize_with(main_field); - // d. LOAD_AS_FILE(M) - let cached_path = self.cache.value(&main_field_path); - if let Some(path) = self.load_as_file(&cached_path, ctx)? { - return Ok(Some(path)); - } - // e. LOAD_INDEX(M) - if let Some(path) = self.load_index(&cached_path, ctx)? { - return Ok(Some(path)); - } - } - // f. LOAD_INDEX(X) DEPRECATED - // g. THROW "not found" - } - } - // 2. LOAD_INDEX(X) - self.load_index(cached_path, ctx) - } - - fn load_as_file_or_directory( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - if self.options.resolve_to_context { - return Ok(cached_path.is_dir(&self.cache.fs, ctx).then(|| cached_path.clone())); - } - if !specifier.ends_with('/') { - if let Some(path) = self.load_as_file(cached_path, ctx)? { - return Ok(Some(path)); - } - } - if cached_path.is_dir(&self.cache.fs, ctx) { - if let Some(path) = self.load_as_directory(cached_path, ctx)? { - return Ok(Some(path)); - } - } - Ok(None) - } - - fn load_extensions(&self, path: &Path, extensions: &[String], ctx: &mut Ctx) -> ResolveResult { - if ctx.fully_specified { - return Ok(None); - } - let path = path.as_os_str(); - for extension in extensions { - let mut path_with_extension = path.to_os_string(); - path_with_extension.reserve_exact(extension.len()); - path_with_extension.push(extension); - let cached_path = self.cache.value(Path::new(&path_with_extension)); - if let Some(path) = self.load_alias_or_file(&cached_path, ctx)? { - return Ok(Some(path)); - } - } - Ok(None) - } - - fn load_realpath(&self, cached_path: &CachedPath) -> Result { - if self.options.symlinks { - cached_path.realpath(&self.cache.fs).map_err(ResolveError::from) - } else { - Ok(cached_path.to_path_buf()) - } - } - - fn check_restrictions(&self, path: &Path) -> Result<(), ResolveError> { - // https://github.com/webpack/enhanced-resolve/blob/a998c7d218b7a9ec2461fc4fddd1ad5dd7687485/lib/RestrictionsPlugin.js#L19-L24 - fn is_inside(path: &Path, parent: &Path) -> bool { - if !path.starts_with(parent) { - return false; - } - if path.as_os_str().len() == parent.as_os_str().len() { - return true; - } - path.strip_prefix(parent).is_ok_and(|p| p == Path::new("./")) - } - for restriction in &self.options.restrictions { - match restriction { - Restriction::Path(restricted_path) => { - if !is_inside(path, restricted_path) { - return Err(ResolveError::Restriction( - path.to_path_buf(), - restricted_path.clone(), - )); - } - } - Restriction::RegExp(_) => { - return Err(ResolveError::Unimplemented("Restriction with regex")) - } - } - } - Ok(()) - } - - fn load_index(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - for main_file in &self.options.main_files { - let main_path = cached_path.path().normalize_with(main_file); - let cached_path = self.cache.value(&main_path); - if self.options.enforce_extension.is_disabled() { - if let Some(path) = self.load_alias_or_file(&cached_path, ctx)? { - return Ok(Some(path)); - } - } - // 1. If X/index.js is a file, load X/index.js as JavaScript text. STOP - // 2. If X/index.json is a file, parse X/index.json to a JavaScript object. STOP - // 3. If X/index.node is a file, load X/index.node as binary addon. STOP - if let Some(path) = - self.load_extensions(cached_path.path(), &self.options.extensions, ctx)? - { - return Ok(Some(path)); - } - } - Ok(None) - } - - fn load_alias_or_file(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - if let Some(package_json) = - cached_path.find_package_json(&self.cache.fs, &self.options, ctx)? - { - if let Some(path) = self.load_browser_field(cached_path, None, &package_json, ctx)? { - return Ok(Some(path)); - } - } - // enhanced-resolve: try file as alias - let alias_specifier = cached_path.path().to_string_lossy(); - if let Some(path) = - self.load_alias(cached_path, &alias_specifier, &self.options.alias, ctx)? - { - return Ok(Some(path)); - } - if cached_path.is_file(&self.cache.fs, ctx) { - return Ok(Some(cached_path.clone())); - } - Ok(None) - } - - fn load_node_modules( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - let (package_name, subpath) = Self::parse_package_specifier(specifier); - // 1. let DIRS = NODE_MODULES_PATHS(START) - // 2. for each DIR in DIRS: - for module_name in &self.options.modules { - for cached_path in std::iter::successors(Some(cached_path), |p| p.parent()) { - // Skip if /path/to/node_modules does not exist - if !cached_path.is_dir(&self.cache.fs, ctx) { - continue; - } - - let Some(cached_path) = self.get_module_directory(cached_path, module_name, ctx) - else { - continue; - }; - // Optimize node_modules lookup by inspecting whether the package exists - // From LOAD_PACKAGE_EXPORTS(X, DIR) - // 1. Try to interpret X as a combination of NAME and SUBPATH where the name - // may have a @scope/ prefix and the subpath begins with a slash (`/`). - if !package_name.is_empty() { - let package_path = cached_path.path().normalize_with(package_name); - let cached_path = self.cache.value(&package_path); - // Try foo/node_modules/package_name - if cached_path.is_dir(&self.cache.fs, ctx) { - // a. LOAD_PACKAGE_EXPORTS(X, DIR) - if let Some(path) = - self.load_package_exports(specifier, subpath, &cached_path, ctx)? - { - return Ok(Some(path)); - } - } else { - // foo/node_modules/package_name is not a directory, so useless to check inside it - if !subpath.is_empty() { - continue; - } - // Skip if the directory lead to the scope package does not exist - // i.e. `foo/node_modules/@scope` is not a directory for `foo/node_modules/@scope/package` - if package_name.starts_with('@') { - if let Some(path) = cached_path.parent() { - if !path.is_dir(&self.cache.fs, ctx) { - continue; - } - } - } - } - } - - // Try as file or directory for all other cases - // b. LOAD_AS_FILE(DIR/X) - // c. LOAD_AS_DIRECTORY(DIR/X) - let node_module_file = cached_path.path().normalize_with(specifier); - let cached_path = self.cache.value(&node_module_file); - if let Some(path) = self.load_as_file_or_directory(&cached_path, specifier, ctx)? { - return Ok(Some(path)); - } - } - } - Ok(None) - } - - fn get_module_directory( - &self, - cached_path: &CachedPath, - module_name: &str, - ctx: &mut Ctx, - ) -> Option { - if cached_path.path().ends_with(module_name) { - Some(cached_path.clone()) - } else if module_name == "node_modules" { - cached_path.cached_node_modules(&self.cache, ctx) - } else { - cached_path.module_directory(module_name, &self.cache, ctx) - } - } - - fn load_package_exports( - &self, - specifier: &str, - subpath: &str, - cached_path: &CachedPath, - ctx: &mut Ctx, - ) -> ResolveResult { - // 2. If X does not match this pattern or DIR/NAME/package.json is not a file, - // return. - let Some(package_json) = cached_path.package_json(&self.cache.fs, &self.options, ctx)? - else { - return Ok(None); - }; - // 3. Parse DIR/NAME/package.json, and look for "exports" field. - // 4. If "exports" is null or undefined, return. - // 5. let MATCH = PACKAGE_EXPORTS_RESOLVE(pathToFileURL(DIR/NAME), "." + SUBPATH, - // `package.json` "exports", ["node", "require"]) defined in the ESM resolver. - // Note: The subpath is not prepended with a dot on purpose - for exports in package_json.exports_fields(&self.options.exports_fields) { - if let Some(path) = self.package_exports_resolve( - cached_path.path(), - &format!(".{subpath}"), - exports, - ctx, - )? { - // 6. RESOLVE_ESM_MATCH(MATCH) - return self.resolve_esm_match(specifier, &path, ctx); - }; - } - Ok(None) - } - - fn load_package_self( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - // 1. Find the closest package scope SCOPE to DIR. - // 2. If no scope was found, return. - let Some(package_json) = - cached_path.find_package_json(&self.cache.fs, &self.options, ctx)? - else { - return Ok(None); - }; - // 3. If the SCOPE/package.json "exports" is null or undefined, return. - // 4. If the SCOPE/package.json "name" is not the first segment of X, return. - if let Some(subpath) = package_json - .name - .as_ref() - .and_then(|package_name| Self::strip_package_name(specifier, package_name)) - { - // 5. let MATCH = PACKAGE_EXPORTS_RESOLVE(pathToFileURL(SCOPE), - // "." + X.slice("name".length), `package.json` "exports", ["node", "require"]) - // defined in the ESM resolver. - let package_url = package_json.directory(); - // Note: The subpath is not prepended with a dot on purpose - // because `package_exports_resolve` matches subpath without the leading dot. - for exports in package_json.exports_fields(&self.options.exports_fields) { - if let Some(cached_path) = - self.package_exports_resolve(package_url, &format!(".{subpath}"), exports, ctx)? - { - // 6. RESOLVE_ESM_MATCH(MATCH) - return self.resolve_esm_match(specifier, &cached_path, ctx); - } - } - } - self.load_browser_field(cached_path, Some(specifier), &package_json, ctx) - } - - /// RESOLVE_ESM_MATCH(MATCH) - fn resolve_esm_match( - &self, - specifier: &str, - cached_path: &CachedPath, - ctx: &mut Ctx, - ) -> ResolveResult { - // 1. let RESOLVED_PATH = fileURLToPath(MATCH) - // 2. If the file at RESOLVED_PATH exists, load RESOLVED_PATH as its extension format. STOP - // - // Non-compliant ESM can result in a directory, so directory is tried as well. - if let Some(path) = self.load_as_file_or_directory(cached_path, "", ctx)? { - return Ok(Some(path)); - } - // 3. THROW "not found" - Err(ResolveError::NotFound(specifier.to_string())) - } - - /// enhanced-resolve: AliasFieldPlugin for [ResolveOptions::alias_fields] - fn load_browser_field( - &self, - cached_path: &CachedPath, - module_specifier: Option<&str>, - package_json: &PackageJson, - ctx: &mut Ctx, - ) -> ResolveResult { - let path = cached_path.path(); - let Some(new_specifier) = package_json.resolve_browser_field( - path, - module_specifier, - &self.options.alias_fields, - )? - else { - return Ok(None); - }; - // Abort when resolving recursive module - if module_specifier.is_some_and(|s| s == new_specifier) { - return Ok(None); - } - if ctx.resolving_alias.as_ref().is_some_and(|s| s == new_specifier) { - // Complete when resolving to self `{"./a.js": "./a.js"}` - if new_specifier.strip_prefix("./").filter(|s| path.ends_with(Path::new(s))).is_some() { - return if cached_path.is_file(&self.cache.fs, ctx) { - Ok(Some(cached_path.clone())) - } else { - Err(ResolveError::NotFound(new_specifier.to_string())) - }; - } - return Err(ResolveError::Recursion); - } - ctx.with_resolving_alias(new_specifier.to_string()); - ctx.with_fully_specified(false); - let cached_path = self.cache.value(package_json.directory()); - self.require(&cached_path, new_specifier, ctx).map(Some) - } - - /// enhanced-resolve: AliasPlugin for [ResolveOptions::alias] and [ResolveOptions::fallback]. - fn load_alias( - &self, - cached_path: &CachedPath, - specifier: &str, - aliases: &Alias, - ctx: &mut Ctx, - ) -> ResolveResult { - for (alias_key_raw, specifiers) in aliases { - let alias_key = if let Some(alias_key) = alias_key_raw.strip_suffix('$') { - if alias_key != specifier { - continue; - } - alias_key - } else { - let strip_package_name = Self::strip_package_name(specifier, alias_key_raw); - if strip_package_name.is_none() { - continue; - } - alias_key_raw - }; - // It should stop resolving when all of the tried alias values - // failed to resolve. - // - let mut should_stop = false; - for r in specifiers { - match r { - AliasValue::Path(alias_value) => { - if let Some(path) = self.load_alias_value( - cached_path, - alias_key, - alias_value, - specifier, - ctx, - &mut should_stop, - )? { - return Ok(Some(path)); - } - } - AliasValue::Ignore => { - let path = cached_path.path().normalize_with(alias_key); - return Err(ResolveError::Ignored(path)); - } - } - } - if should_stop { - return Err(ResolveError::NotFound(specifier.to_string())); - } - } - Ok(None) - } - - fn load_alias_value( - &self, - cached_path: &CachedPath, - alias_key: &str, - alias_value: &str, - request: &str, - ctx: &mut Ctx, - should_stop: &mut bool, - ) -> ResolveResult { - if request != alias_value - && !request.strip_prefix(alias_value).is_some_and(|prefix| prefix.starts_with('/')) - { - let tail = &request[alias_key.len()..]; - - let new_specifier = if tail.is_empty() { - Cow::Borrowed(alias_value) - } else { - let alias_value = Path::new(alias_value).normalize(); - // Must not append anything to alias_value if it is a file. - let alias_value_cached_path = self.cache.value(&alias_value); - if alias_value_cached_path.is_file(&self.cache.fs, ctx) { - return Ok(None); - } - - // Remove the leading slash so the final path is concatenated. - let tail = tail.trim_start_matches(SLASH_START); - let normalized = alias_value.normalize_with(tail); - Cow::Owned(normalized.to_string_lossy().to_string()) - }; - - *should_stop = true; - ctx.with_fully_specified(false); - return match self.require(cached_path, new_specifier.as_ref(), ctx) { - Err(ResolveError::NotFound(_)) => Ok(None), - Ok(path) => return Ok(Some(path)), - Err(err) => return Err(err), - }; - } - Ok(None) - } - - /// Given an extension alias map `{".js": [".ts", "js"]}`, - /// load the mapping instead of the provided extension - /// - /// This is an enhanced-resolve feature - /// - /// # Errors - /// - /// * [ResolveError::ExtensionAlias]: When all of the aliased extensions are not found - fn load_extension_alias(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - let Some(path_extension) = cached_path.path().extension() else { - return Ok(None); - }; - let Some((_, extensions)) = self - .options - .extension_alias - .iter() - .find(|(ext, _)| OsStr::new(ext.trim_start_matches('.')) == path_extension) - else { - return Ok(None); - }; - let path = cached_path.path().with_extension(""); - ctx.with_fully_specified(false); - if let Some(path) = self.load_extensions(&path, extensions, ctx)? { - return Ok(Some(path)); - } - Err(ResolveError::ExtensionAlias) - } - - /// enhanced-resolve: RootsPlugin - /// - /// A list of directories where requests of server-relative URLs (starting with '/') are resolved, - /// defaults to context configuration option. - /// - /// On non-Windows systems these requests are resolved as an absolute path first. - fn load_roots(&self, specifier: &str, ctx: &mut Ctx) -> Option { - if !self.options.roots.is_empty() { - if let Some(specifier) = specifier.strip_prefix(SLASH_START) { - for root in &self.options.roots { - let cached_path = self.cache.value(root); - if let Ok(path) = self.require_relative(&cached_path, specifier, ctx) { - return Some(path); - } - } - } - } - None - } - - fn load_tsconfig_paths( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - let Some(tsconfig_options) = &self.options.tsconfig else { - return Ok(None); - }; - let tsconfig = self.load_tsconfig( - /* root */ true, - &tsconfig_options.config_file, - &tsconfig_options.references, - )?; - let paths = tsconfig.resolve(cached_path.path(), specifier); - for path in paths { - let cached_path = self.cache.value(&path); - if let Ok(path) = self.require_relative(&cached_path, ".", ctx) { - return Ok(Some(path)); - } - } - Ok(None) - } - - fn load_tsconfig( - &self, - root: bool, - path: &Path, - references: &TsconfigReferences, - ) -> Result, ResolveError> { - self.cache.tsconfig(root, path, |tsconfig| { - let directory = self.cache.value(tsconfig.directory()); - tracing::trace!(tsconfig = ?tsconfig, "load_tsconfig"); - - // Extend tsconfig - if let Some(extends) = &tsconfig.extends { - let extended_tsconfig_paths = match extends { - ExtendsField::Single(s) => { - vec![self.get_extended_tsconfig_path(&directory, tsconfig, s)?] - } - ExtendsField::Multiple(specifiers) => specifiers - .iter() - .map(|s| self.get_extended_tsconfig_path(&directory, tsconfig, s)) - .collect::, ResolveError>>()?, - }; - for extended_tsconfig_path in extended_tsconfig_paths { - let extended_tsconfig = self.load_tsconfig( - /* root */ false, - &extended_tsconfig_path, - &TsconfigReferences::Disabled, - )?; - tsconfig.extend_tsconfig(&extended_tsconfig); - } - } - - // Load project references - match references { - TsconfigReferences::Disabled => { - tsconfig.references.drain(..); - } - TsconfigReferences::Auto => {} - TsconfigReferences::Paths(paths) => { - tsconfig.references = paths - .iter() - .map(|path| ProjectReference { path: path.clone(), tsconfig: None }) - .collect(); - } - } - if !tsconfig.references.is_empty() { - let directory = tsconfig.directory().to_path_buf(); - for reference in &mut tsconfig.references { - let reference_tsconfig_path = directory.normalize_with(&reference.path); - let tsconfig = self.cache.tsconfig( - /* root */ true, - &reference_tsconfig_path, - |_| Ok(()), - )?; - reference.tsconfig.replace(tsconfig); - } - } - Ok(()) - }) - } - - fn get_extended_tsconfig_path( - &self, - directory: &CachedPath, - tsconfig: &TsConfig, - specifier: &str, - ) -> Result { - match specifier.as_bytes().first() { - None => Err(ResolveError::Specifier(SpecifierError::Empty(specifier.to_string()))), - Some(b'/') => Ok(PathBuf::from(specifier)), - Some(b'.') => Ok(tsconfig.directory().normalize_with(specifier)), - _ => self - .clone_with_options(ResolveOptions { - description_files: vec![], - extensions: vec![".json".into()], - main_files: vec!["tsconfig.json".into()], - ..ResolveOptions::default() - }) - .load_package_self_or_node_modules(directory, specifier, &mut Ctx::default()) - .map(|p| p.to_path_buf()) - .map_err(|err| match err { - ResolveError::NotFound(_) => { - ResolveError::TsconfigNotFound(PathBuf::from(specifier)) - } - _ => err, - }), - } - } - - /// PACKAGE_RESOLVE(packageSpecifier, parentURL) - fn package_resolve( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - let (package_name, subpath) = Self::parse_package_specifier(specifier); - - // 3. If packageSpecifier is a Node.js builtin module name, then - // 1. Return the string "node:" concatenated with packageSpecifier. - self.require_core(package_name)?; - - // 11. While parentURL is not the file system root, - for module_name in &self.options.modules { - for cached_path in std::iter::successors(Some(cached_path), |p| p.parent()) { - // 1. Let packageURL be the URL resolution of "node_modules/" concatenated with packageSpecifier, relative to parentURL. - let Some(cached_path) = self.get_module_directory(cached_path, module_name, ctx) - else { - continue; - }; - // 2. Set parentURL to the parent folder URL of parentURL. - let package_path = cached_path.path().normalize_with(package_name); - let cached_path = self.cache.value(&package_path); - // 3. If the folder at packageURL does not exist, then - // 1. Continue the next loop iteration. - if cached_path.is_dir(&self.cache.fs, ctx) { - // 4. Let pjson be the result of READ_PACKAGE_JSON(packageURL). - if let Some(package_json) = - cached_path.package_json(&self.cache.fs, &self.options, ctx)? - { - // 5. If pjson is not null and pjson.exports is not null or undefined, then - // 1. Return the result of PACKAGE_EXPORTS_RESOLVE(packageURL, packageSubpath, pjson.exports, defaultConditions). - for exports in package_json.exports_fields(&self.options.exports_fields) { - if let Some(path) = self.package_exports_resolve( - cached_path.path(), - &format!(".{subpath}"), - exports, - ctx, - )? { - return Ok(Some(path)); - } - } - // 6. Otherwise, if packageSubpath is equal to ".", then - if subpath == "." { - // 1. If pjson.main is a string, then - for main_field in package_json.main_fields(&self.options.main_fields) { - // 1. Return the URL resolution of main in packageURL. - let path = cached_path.path().normalize_with(main_field); - let cached_path = self.cache.value(&path); - if cached_path.is_file(&self.cache.fs, ctx) { - return Ok(Some(cached_path)); - } - } - } - } - let subpath = format!(".{subpath}"); - ctx.with_fully_specified(false); - return self.require(&cached_path, &subpath, ctx).map(Some); - } - } - } - - Err(ResolveError::NotFound(specifier.to_string())) - } - - /// PACKAGE_EXPORTS_RESOLVE(packageURL, subpath, exports, conditions) - fn package_exports_resolve( - &self, - package_url: &Path, - subpath: &str, - exports: &JSONValue, - ctx: &mut Ctx, - ) -> ResolveResult { - let conditions = &self.options.condition_names; - // 1. If exports is an Object with both a key starting with "." and a key not starting with ".", throw an Invalid Package Configuration error. - if let JSONValue::Object(map) = exports { - let mut has_dot = false; - let mut without_dot = false; - for key in map.keys() { - has_dot = has_dot || key.starts_with(|s| s == '.' || s == '#'); - without_dot = without_dot || !key.starts_with(|s| s == '.' || s == '#'); - if has_dot && without_dot { - return Err(ResolveError::InvalidPackageConfig( - package_url.join("package.json"), - )); - } - } - } - // 2. If subpath is equal to ".", then - // Note: subpath is not prepended with a dot when passed in. - if subpath == "." { - // enhanced-resolve appends query and fragment when resolving exports field - // https://github.com/webpack/enhanced-resolve/blob/a998c7d218b7a9ec2461fc4fddd1ad5dd7687485/lib/ExportsFieldPlugin.js#L57-L62 - // This is only need when querying the main export, otherwise ctx is passed through. - if ctx.query.is_some() || ctx.fragment.is_some() { - let query = ctx.query.clone().unwrap_or_default(); - let fragment = ctx.fragment.clone().unwrap_or_default(); - return Err(ResolveError::PackagePathNotExported( - format!("./{}{query}{fragment}", subpath.trim_start_matches('.')), - package_url.join("package.json"), - )); - } - // 1. Let mainExport be undefined. - let main_export = match exports { - // 2. If exports is a String or Array, or an Object containing no keys starting with ".", then - JSONValue::String(_) | JSONValue::Array(_) => { - // 1. Set mainExport to exports. - Some(exports) - } - // 3. Otherwise if exports is an Object containing a "." property, then - JSONValue::Object(map) => { - // 1. Set mainExport to exports["."]. - map.get(".").map_or_else( - || { - if map.keys().any(|key| key.starts_with("./") || key.starts_with('#')) { - None - } else { - Some(exports) - } - }, - Some, - ) - } - _ => None, - }; - // 4. If mainExport is not undefined, then - if let Some(main_export) = main_export { - // 1. Let resolved be the result of PACKAGE_TARGET_RESOLVE( packageURL, mainExport, null, false, conditions). - let resolved = self.package_target_resolve( - package_url, - ".", - main_export, - None, - /* is_imports */ false, - conditions, - ctx, - )?; - // 2. If resolved is not null or undefined, return resolved. - if let Some(path) = resolved { - return Ok(Some(path)); - } - } - } - // 3. Otherwise, if exports is an Object and all keys of exports start with ".", then - if let JSONValue::Object(exports) = exports { - // 1. Let matchKey be the string "./" concatenated with subpath. - // Note: `package_imports_exports_resolve` does not require the leading dot. - let match_key = &subpath; - // 2. Let resolved be the result of PACKAGE_IMPORTS_EXPORTS_RESOLVE( matchKey, exports, packageURL, false, conditions). - if let Some(path) = self.package_imports_exports_resolve( - match_key, - exports, - package_url, - /* is_imports */ false, - conditions, - ctx, - )? { - // 3. If resolved is not null or undefined, return resolved. - return Ok(Some(path)); - } - } - // 4. Throw a Package Path Not Exported error. - Err(ResolveError::PackagePathNotExported( - subpath.to_string(), - package_url.join("package.json"), - )) - } - - /// PACKAGE_IMPORTS_RESOLVE(specifier, parentURL, conditions) - fn package_imports_resolve( - &self, - specifier: &str, - package_json: &PackageJson, - ctx: &mut Ctx, - ) -> Result, ResolveError> { - // 1. Assert: specifier begins with "#". - debug_assert!(specifier.starts_with('#'), "{specifier}"); - // 2. If specifier is exactly equal to "#" or starts with "#/", then - // 1. Throw an Invalid Module Specifier error. - // 3. Let packageURL be the result of LOOKUP_PACKAGE_SCOPE(parentURL). - // 4. If packageURL is not null, then - - // 1. Let pjson be the result of READ_PACKAGE_JSON(packageURL). - // 2. If pjson.imports is a non-null Object, then - - // 1. Let resolved be the result of PACKAGE_IMPORTS_EXPORTS_RESOLVE( specifier, pjson.imports, packageURL, true, conditions). - let mut has_imports = false; - for imports in package_json.imports_fields(&self.options.imports_fields) { - if !has_imports { - has_imports = true; - // TODO: fill in test case for this case - if specifier == "#" || specifier.starts_with("#/") { - return Err(ResolveError::InvalidModuleSpecifier( - specifier.to_string(), - package_json.path.clone(), - )); - } - } - if let Some(path) = self.package_imports_exports_resolve( - specifier, - imports, - package_json.directory(), - /* is_imports */ true, - &self.options.condition_names, - ctx, - )? { - // 2. If resolved is not null or undefined, return resolved. - return Ok(Some(path)); - } - } - - // 5. Throw a Package Import Not Defined error. - if has_imports { - Err(ResolveError::PackageImportNotDefined( - specifier.to_string(), - package_json.path.clone(), - )) - } else { - Ok(None) - } - } - - /// PACKAGE_IMPORTS_EXPORTS_RESOLVE(matchKey, matchObj, packageURL, isImports, conditions) - fn package_imports_exports_resolve( - &self, - match_key: &str, - match_obj: &JSONMap, - package_url: &Path, - is_imports: bool, - conditions: &[String], - ctx: &mut Ctx, - ) -> ResolveResult { - // enhanced-resolve behaves differently, it throws - // Error: CachedPath to directories is not possible with the exports field (specifier was ./dist/) - if match_key.ends_with('/') { - return Ok(None); - } - // 1. If matchKey is a key of matchObj and does not contain "*", then - if !match_key.contains('*') { - // 1. Let target be the value of matchObj[matchKey]. - if let Some(target) = match_obj.get(match_key) { - // 2. Return the result of PACKAGE_TARGET_RESOLVE(packageURL, target, null, isImports, conditions). - return self.package_target_resolve( - package_url, - match_key, - target, - None, - is_imports, - conditions, - ctx, - ); - } - } - - let mut best_target = None; - let mut best_match = ""; - let mut best_key = ""; - // 2. Let expansionKeys be the list of keys of matchObj containing only a single "*", sorted by the sorting function PATTERN_KEY_COMPARE which orders in descending order of specificity. - // 3. For each key expansionKey in expansionKeys, do - for (expansion_key, target) in match_obj { - if expansion_key.starts_with("./") || expansion_key.starts_with('#') { - // 1. Let patternBase be the substring of expansionKey up to but excluding the first "*" character. - if let Some((pattern_base, pattern_trailer)) = expansion_key.split_once('*') { - // 2. If matchKey starts with but is not equal to patternBase, then - if match_key.starts_with(pattern_base) - // 1. Let patternTrailer be the substring of expansionKey from the index after the first "*" character. - && !pattern_trailer.contains('*') - // 2. If patternTrailer has zero length, or if matchKey ends with patternTrailer and the length of matchKey is greater than or equal to the length of expansionKey, then - && (pattern_trailer.is_empty() - || (match_key.len() >= expansion_key.len() - && match_key.ends_with(pattern_trailer))) - && Self::pattern_key_compare(best_key, expansion_key).is_gt() - { - // 1. Let target be the value of matchObj[expansionKey]. - best_target = Some(target); - // 2. Let patternMatch be the substring of matchKey starting at the index of the length of patternBase up to the length of matchKey minus the length of patternTrailer. - best_match = - &match_key[pattern_base.len()..match_key.len() - pattern_trailer.len()]; - best_key = expansion_key; - } - } else if expansion_key.ends_with('/') - && match_key.starts_with(expansion_key) - && Self::pattern_key_compare(best_key, expansion_key).is_gt() - { - // TODO: [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./dist/" in the "exports" field module resolution of the package at xxx/package.json. - best_target = Some(target); - best_match = &match_key[expansion_key.len()..]; - best_key = expansion_key; - } - } - } - if let Some(best_target) = best_target { - // 3. Return the result of PACKAGE_TARGET_RESOLVE(packageURL, target, patternMatch, isImports, conditions). - return self.package_target_resolve( - package_url, - best_key, - best_target, - Some(best_match), - is_imports, - conditions, - ctx, - ); - } - // 4. Return null. - Ok(None) - } - - /// PACKAGE_TARGET_RESOLVE(packageURL, target, patternMatch, isImports, conditions) - #[allow(clippy::too_many_arguments)] - fn package_target_resolve( - &self, - package_url: &Path, - target_key: &str, - target: &JSONValue, - pattern_match: Option<&str>, - is_imports: bool, - conditions: &[String], - ctx: &mut Ctx, - ) -> ResolveResult { - fn normalize_string_target<'a>( - target_key: &'a str, - target: &'a str, - pattern_match: Option<&'a str>, - package_url: &Path, - ) -> Result, ResolveError> { - let target = if let Some(pattern_match) = pattern_match { - if !target_key.contains('*') && !target.contains('*') { - // enhanced-resolve behaviour - // TODO: [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./dist/" in the "exports" field module resolution of the package at xxx/package.json. - if target_key.ends_with('/') && target.ends_with('/') { - Cow::Owned(format!("{target}{pattern_match}")) - } else { - return Err(ResolveError::InvalidPackageConfigDirectory( - package_url.join("package.json"), - )); - } - } else { - Cow::Owned(target.replace('*', pattern_match)) - } - } else { - Cow::Borrowed(target) - }; - Ok(target) - } - - match target { - // 1. If target is a String, then - JSONValue::String(target) => { - // 1. If target does not start with "./", then - if !target.starts_with("./") { - // 1. If isImports is false, or if target starts with "../" or "/", or if target is a valid URL, then - if !is_imports || target.starts_with("../") || target.starts_with('/') { - // 1. Throw an Invalid Package Target error. - return Err(ResolveError::InvalidPackageTarget( - target.to_string(), - target_key.to_string(), - package_url.join("package.json"), - )); - } - // 2. If patternMatch is a String, then - // 1. Return PACKAGE_RESOLVE(target with every instance of "*" replaced by patternMatch, packageURL + "/"). - let target = - normalize_string_target(target_key, target, pattern_match, package_url)?; - let package_url = self.cache.value(package_url); - // // 3. Return PACKAGE_RESOLVE(target, packageURL + "/"). - return self.package_resolve(&package_url, &target, ctx); - } - - // 2. If target split on "/" or "\" contains any "", ".", "..", or "node_modules" segments after the first "." segment, case insensitive and including percent encoded variants, throw an Invalid Package Target error. - // 3. Let resolvedTarget be the URL resolution of the concatenation of packageURL and target. - // 4. Assert: resolvedTarget is contained in packageURL. - // 5. If patternMatch is null, then - let target = - normalize_string_target(target_key, target, pattern_match, package_url)?; - if Path::new(target.as_ref()).is_invalid_exports_target() { - return Err(ResolveError::InvalidPackageTarget( - target.to_string(), - target_key.to_string(), - package_url.join("package.json"), - )); - } - let resolved_target = package_url.normalize_with(target.as_ref()); - // 6. If patternMatch split on "/" or "\" contains any "", ".", "..", or "node_modules" segments, case insensitive and including percent encoded variants, throw an Invalid Module Specifier error. - // 7. Return the URL resolution of resolvedTarget with every instance of "*" replaced with patternMatch. - let value = self.cache.value(&resolved_target); - return Ok(Some(value)); - } - // 2. Otherwise, if target is a non-null Object, then - JSONValue::Object(target) => { - // 1. If exports contains any index property keys, as defined in ECMA-262 6.1.7 Array Index, throw an Invalid Package Configuration error. - // 2. For each property p of target, in object insertion order as, - for (key, target_value) in target { - // 1. If p equals "default" or conditions contains an entry for p, then - if key == "default" || conditions.contains(key) { - // 1. Let targetValue be the value of the p property in target. - // 2. Let resolved be the result of PACKAGE_TARGET_RESOLVE( packageURL, targetValue, patternMatch, isImports, conditions). - let resolved = self.package_target_resolve( - package_url, - target_key, - target_value, - pattern_match, - is_imports, - conditions, - ctx, - ); - // 3. If resolved is equal to undefined, continue the loop. - if let Some(path) = resolved? { - // 4. Return resolved. - return Ok(Some(path)); - } - } - } - // 3. Return undefined. - return Ok(None); - } - // 3. Otherwise, if target is an Array, then - JSONValue::Array(targets) => { - // 1. If _target.length is zero, return null. - if targets.is_empty() { - // Note: return PackagePathNotExported has the same effect as return because there are no matches. - return Err(ResolveError::PackagePathNotExported( - pattern_match.unwrap_or(".").to_string(), - package_url.join("package.json"), - )); - } - // 2. For each item targetValue in target, do - for (i, target_value) in targets.iter().enumerate() { - // 1. Let resolved be the result of PACKAGE_TARGET_RESOLVE( packageURL, targetValue, patternMatch, isImports, conditions), continuing the loop on any Invalid Package Target error. - let resolved = self.package_target_resolve( - package_url, - target_key, - target_value, - pattern_match, - is_imports, - conditions, - ctx, - ); - - if resolved.is_err() && i == targets.len() { - return resolved; - } - - // 2. If resolved is undefined, continue the loop. - if let Ok(Some(path)) = resolved { - // 3. Return resolved. - return Ok(Some(path)); - } - } - // 3. Return or throw the last fallback resolution null return or error. - // Note: see `resolved.is_err() && i == targets.len()` - } - _ => {} - } - // 4. Otherwise, if target is null, return null. - Ok(None) - // 5. Otherwise throw an Invalid Package Target error. - } - - // Returns (module, subpath) - // https://github.com/nodejs/node/blob/8f0f17e1e3b6c4e58ce748e06343c5304062c491/lib/internal/modules/esm/resolve.js#L688 - fn parse_package_specifier(specifier: &str) -> (&str, &str) { - let mut separator_index = specifier.as_bytes().iter().position(|b| *b == b'/'); - // let mut valid_package_name = true; - // let mut is_scoped = false; - if specifier.starts_with('@') { - // is_scoped = true; - if separator_index.is_none() || specifier.is_empty() { - // valid_package_name = false; - } else if let Some(index) = &separator_index { - separator_index = specifier[*index + 1..] - .as_bytes() - .iter() - .position(|b| *b == b'/') - .map(|i| i + *index + 1); - } - } - let package_name = - separator_index.map_or(specifier, |separator_index| &specifier[..separator_index]); - - // TODO: https://github.com/nodejs/node/blob/8f0f17e1e3b6c4e58ce748e06343c5304062c491/lib/internal/modules/esm/resolve.js#L705C1-L714C1 - // Package name cannot have leading . and cannot have percent-encoding or - // \\ separators. - // if (RegExpPrototypeExec(invalidPackageNameRegEx, packageName) !== null) - // validPackageName = false; - - // if (!validPackageName) { - // throw new ERR_INVALID_MODULE_SPECIFIER( - // specifier, 'is not a valid package name', fileURLToPath(base)); - // } - let package_subpath = - separator_index.map_or("", |separator_index| &specifier[separator_index..]); - (package_name, package_subpath) - } - - /// PATTERN_KEY_COMPARE(keyA, keyB) - fn pattern_key_compare(key_a: &str, key_b: &str) -> Ordering { - if key_a.is_empty() { - return Ordering::Greater; - } - // 1. Assert: keyA ends with "/" or contains only a single "*". - debug_assert!(key_a.ends_with('/') || key_a.match_indices('*').count() == 1, "{key_a}"); - // 2. Assert: keyB ends with "/" or contains only a single "*". - debug_assert!(key_b.ends_with('/') || key_b.match_indices('*').count() == 1, "{key_b}"); - // 3. Let baseLengthA be the index of "*" in keyA plus one, if keyA contains "*", or the length of keyA otherwise. - let a_pos = key_a.chars().position(|c| c == '*'); - let base_length_a = a_pos.map_or(key_a.len(), |p| p + 1); - // 4. Let baseLengthB be the index of "*" in keyB plus one, if keyB contains "*", or the length of keyB otherwise. - let b_pos = key_b.chars().position(|c| c == '*'); - let base_length_b = b_pos.map_or(key_b.len(), |p| p + 1); - // 5. If baseLengthA is greater than baseLengthB, return -1. - if base_length_a > base_length_b { - return Ordering::Less; - } - // 6. If baseLengthB is greater than baseLengthA, return 1. - if base_length_b > base_length_a { - return Ordering::Greater; - } - // 7. If keyA does not contain "*", return 1. - if !key_a.contains('*') { - return Ordering::Greater; - } - // 8. If keyB does not contain "*", return -1. - if !key_b.contains('*') { - return Ordering::Less; - } - // 9. If the length of keyA is greater than the length of keyB, return -1. - if key_a.len() > key_b.len() { - return Ordering::Less; - } - // 10. If the length of keyB is greater than the length of keyA, return 1. - if key_b.len() > key_a.len() { - return Ordering::Greater; - } - // 11. Return 0. - Ordering::Equal - } - - fn strip_package_name<'a>(specifier: &'a str, package_name: &'a str) -> Option<&'a str> { - specifier - .strip_prefix(package_name) - .filter(|tail| tail.is_empty() || tail.starts_with(SLASH_START)) - } -} diff --git a/src/options.rs b/src/options.rs deleted file mode 100644 index f473a133..00000000 --- a/src/options.rs +++ /dev/null @@ -1,623 +0,0 @@ -use std::path::Path; -use std::{fmt, path::PathBuf}; - -/// Module Resolution Options -/// -/// Options are directly ported from [enhanced-resolve](https://github.com/webpack/enhanced-resolve#resolver-options). -/// -/// See [webpack resolve](https://webpack.js.org/configuration/resolve/) for information and examples -#[derive(Debug, Clone)] -pub struct ResolveOptions { - /// Path to TypeScript configuration file. - /// - /// Default `None` - pub tsconfig: Option, - - /// Create aliases to import or require certain modules more easily. - /// - /// An alias is used to replace a whole path or part of a path. - /// For example, to alias a commonly used `src/` folders: `vec![("@/src"), vec![AliasValue::Path("/path/to/src")]]` - /// - /// A trailing $ can also be added to the given object's keys to signify an exact match. - /// - /// See [webpack's `resolve.alias` documentation](https://webpack.js.org/configuration/resolve/#resolvealias) for a list of use cases. - pub alias: Alias, - - /// A list of alias fields in description files. - /// - /// Specify a field, such as `browser`, to be parsed according to [this specification](https://github.com/defunctzombie/package-browser-field-spec). - /// Can be a path to json object such as `["path", "to", "exports"]`. - /// - /// Default `[]` - pub alias_fields: Vec>, - - /// Condition names for exports field which defines entry points of a package. - /// - /// The key order in the exports field is significant. During condition matching, earlier entries have higher priority and take precedence over later entries. - /// - /// Default `[]` - pub condition_names: Vec, - - /// The JSON files to use for descriptions. (There was once a `bower.json`.) - /// - /// Default `["package.json"]` - pub description_files: Vec, - - /// Set to [EnforceExtension::Enabled] for [ESM Mandatory file extensions](https://nodejs.org/api/esm.html#mandatory-file-extensions). - /// - /// If `enforce_extension` is set to [EnforceExtension::Enabled], resolution will not allow extension-less files. - /// This means `require('./foo.js')` will resolve, while `require('./foo')` will not. - /// - /// The default value for `enforce_extension` is [EnforceExtension::Auto], which is changed upon initialization. - /// - /// It changes to [EnforceExtension::Enabled] if [ResolveOptions::extensions] contains an empty string; - /// otherwise, this value changes to [EnforceExtension::Disabled]. - /// - /// Explicitly set the value to [EnforceExtension::Disabled] to disable this automatic behavior. - /// - /// For reference, this behavior is aligned with `enhanced-resolve`. See . - pub enforce_extension: EnforceExtension, - - /// A list of exports fields in description files. - /// - /// Can be a path to a JSON object such as `["path", "to", "exports"]`. - /// - /// Default `[["exports"]]`. - pub exports_fields: Vec>, - - /// Fields from `package.json` which are used to provide the internal requests of a package - /// (requests starting with # are considered internal). - /// - /// Can be a path to a JSON object such as `["path", "to", "imports"]`. - /// - /// Default `[["imports"]]`. - pub imports_fields: Vec>, - - /// An object which maps extension to extension aliases. - /// - /// Default `{}` - pub extension_alias: Vec<(String, Vec)>, - - /// Attempt to resolve these extensions in order. - /// - /// If multiple files share the same name but have different extensions, - /// will resolve the one with the extension listed first in the array and skip the rest. - /// - /// All extensions must have a leading dot. - /// - /// Default `[".js", ".json", ".node"]` - pub extensions: Vec, - - /// Redirect module requests when normal resolving fails. - /// - /// Default `[]` - pub fallback: Alias, - - /// 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). - /// - /// See also webpack configuration [resolve.fullySpecified](https://webpack.js.org/configuration/module/#resolvefullyspecified) - /// - /// Default `false` - pub fully_specified: bool, - - /// A list of main fields in description files - /// - /// Default `["main"]`. - pub main_fields: Vec, - - /// The filename to be used while resolving directories. - /// - /// Default `["index"]` - pub main_files: Vec, - - /// A list of directories to resolve modules from, can be absolute path or folder name. - /// - /// Default `["node_modules"]` - pub modules: Vec, - - /// Resolve to a context instead of a file. - /// - /// Default `false` - pub resolve_to_context: bool, - - /// Prefer to resolve module requests as relative requests instead of using modules from node_modules directories. - /// - /// Default `false` - pub prefer_relative: bool, - - /// Prefer to resolve server-relative urls as absolute paths before falling back to resolve in ResolveOptions::roots. - /// - /// Default `false` - pub prefer_absolute: bool, - - /// A list of resolve restrictions to restrict the paths that a request can be resolved on. - /// - /// Default `[]` - pub restrictions: Vec, - - /// A list of directories where requests of server-relative URLs (starting with '/') are resolved. - /// On non-Windows systems these requests are resolved as an absolute path first. - /// - /// Default `[]` - pub roots: Vec, - - /// Whether to resolve symlinks to their symlinked location. - /// When enabled, symlinked resources are resolved to their real path, not their symlinked location. - /// Note that this may cause module resolution to fail when using tools that symlink packages (like npm link). - /// - /// Default `true` - pub symlinks: bool, - - /// Whether to parse [module.builtinModules](https://nodejs.org/api/module.html#modulebuiltinmodules) or not. - /// For example, "zlib" will throw [crate::ResolveError::Builtin] when set to true. - /// - /// Default `false` - pub builtin_modules: bool, -} - -impl ResolveOptions { - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// - /// let options = ResolveOptions::default().with_condition_names(&["bar"]); - /// assert_eq!(options.condition_names, vec!["bar".to_string()]) - /// ``` - #[must_use] - pub fn with_condition_names(mut self, names: &[&str]) -> Self { - self.condition_names = names.iter().map(ToString::to_string).collect::>(); - self - } - - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// - /// let options = ResolveOptions::default().with_builtin_modules(false); - /// assert_eq!(options.builtin_modules, false) - /// ``` - #[must_use] - pub fn with_builtin_modules(mut self, flag: bool) -> Self { - self.builtin_modules = flag; - self - } - - /// Adds a single root to the options - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_root("foo"); - /// assert_eq!(options.roots, vec![PathBuf::from("foo")]) - /// ``` - #[must_use] - pub fn with_root>(mut self, root: P) -> Self { - self.roots.push(root.as_ref().to_path_buf()); - self - } - - /// Adds a single extension to the list of extensions - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_extension("jsonc"); - /// assert!(options.extensions.contains(&"jsonc".to_string())); - /// ``` - #[must_use] - pub fn with_extension>(mut self, extension: S) -> Self { - self.extensions.push(extension.into()); - self - } - - /// Adds a single main field to the list of fields - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_main_field("something"); - /// assert!(options.main_fields.contains(&"something".to_string())); - /// ``` - #[must_use] - pub fn with_main_field>(mut self, field: S) -> Self { - self.main_fields.push(field.into()); - self - } - - /// Changes how the extension should be treated - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions, EnforceExtension}; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_force_extension(EnforceExtension::Enabled); - /// assert_eq!(options.enforce_extension, EnforceExtension::Enabled); - /// ``` - #[must_use] - pub fn with_force_extension(mut self, enforce_extension: EnforceExtension) -> Self { - self.enforce_extension = enforce_extension; - self - } - - /// Sets the value for [ResolveOptions::fully_specified] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_fully_specified(true); - /// assert_eq!(options.fully_specified, true); - /// ``` - #[must_use] - pub fn with_fully_specified(mut self, fully_specified: bool) -> Self { - self.fully_specified = fully_specified; - self - } - /// Sets the value for [ResolveOptions::prefer_relative] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_prefer_relative(true); - /// assert_eq!(options.prefer_relative, true); - /// ``` - #[must_use] - pub fn with_prefer_relative(mut self, flag: bool) -> Self { - self.prefer_relative = flag; - self - } - /// Sets the value for [ResolveOptions::prefer_absolute] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_prefer_absolute(true); - /// assert_eq!(options.prefer_absolute, true); - /// ``` - #[must_use] - pub fn with_prefer_absolute(mut self, flag: bool) -> Self { - self.prefer_absolute = flag; - self - } - - /// Changes the value of [ResolveOptions::symlinks] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// - /// let options = ResolveOptions::default().with_symbolic_link(false); - /// assert_eq!(options.symlinks, false); - /// ``` - #[must_use] - pub fn with_symbolic_link(mut self, flag: bool) -> Self { - self.symlinks = flag; - self - } - - /// Adds a module to [ResolveOptions::modules] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// - /// let options = ResolveOptions::default().with_module("module"); - /// assert!(options.modules.contains(&"module".to_string())); - /// ``` - #[must_use] - pub fn with_module>(mut self, module: M) -> Self { - self.modules.push(module.into()); - self - } - - /// Adds a main file to [ResolveOptions::main_files] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// - /// let options = ResolveOptions::default().with_main_file("foo"); - /// assert!(options.main_files.contains(&"foo".to_string())); - /// ``` - #[must_use] - pub fn with_main_file>(mut self, module: M) -> Self { - self.main_files.push(module.into()); - self - } - - pub(crate) fn sanitize(mut self) -> Self { - debug_assert!( - self.extensions.iter().filter(|e| !e.is_empty()).all(|e| e.starts_with('.')), - "All extensions must start with a leading dot" - ); - // Set `enforceExtension` to `true` when [ResolveOptions::extensions] contains an empty string. - // See - if self.enforce_extension == EnforceExtension::Auto { - if !self.extensions.is_empty() && self.extensions.iter().any(String::is_empty) { - self.enforce_extension = EnforceExtension::Enabled; - } else { - self.enforce_extension = EnforceExtension::Disabled; - } - } - self - } -} - -/// Value for [ResolveOptions::enforce_extension] -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -pub enum EnforceExtension { - Auto, - Enabled, - Disabled, -} - -impl EnforceExtension { - pub const fn is_auto(&self) -> bool { - matches!(self, Self::Auto) - } - - pub const fn is_enabled(&self) -> bool { - matches!(self, Self::Enabled) - } - - pub const fn is_disabled(&self) -> bool { - matches!(self, Self::Disabled) - } -} - -/// Alias for [ResolveOptions::alias] and [ResolveOptions::fallback] -pub type Alias = Vec<(String, Vec)>; - -/// Alias Value for [ResolveOptions::alias] and [ResolveOptions::fallback] -#[derive(Debug, Clone, Hash, PartialEq, Eq)] -pub enum AliasValue { - /// The path value - Path(String), - - /// The `false` value - Ignore, -} - -impl From for AliasValue -where - S: Into, -{ - fn from(value: S) -> Self { - Self::Path(value.into()) - } -} - -/// Value for [ResolveOptions::restrictions] -#[derive(Debug, Clone)] -pub enum Restriction { - Path(PathBuf), - RegExp(String), -} - -/// Tsconfig Options for [ResolveOptions::tsconfig] -/// -/// Derived from [tsconfig-paths-webpack-plugin](https://github.com/dividab/tsconfig-paths-webpack-plugin#options) -#[derive(Debug, Clone)] -pub struct TsconfigOptions { - /// Allows you to specify where to find the TypeScript configuration file. - /// You may provide - /// * a relative path to the configuration file. It will be resolved relative to cwd. - /// * an absolute path to the configuration file. - pub config_file: PathBuf, - - /// Support for Typescript Project References. - pub references: TsconfigReferences, -} - -/// Configuration for [TsconfigOptions::references] -#[derive(Debug, Clone)] -pub enum TsconfigReferences { - Disabled, - /// Use the `references` field from tsconfig of `config_file`. - Auto, - /// Manually provided relative or absolute path. - Paths(Vec), -} - -impl Default for ResolveOptions { - fn default() -> Self { - Self { - tsconfig: None, - alias: vec![], - alias_fields: vec![], - condition_names: vec![], - description_files: vec!["package.json".into()], - enforce_extension: EnforceExtension::Auto, - extension_alias: vec![], - exports_fields: vec![vec!["exports".into()]], - imports_fields: vec![vec!["imports".into()]], - extensions: vec![".js".into(), ".json".into(), ".node".into()], - fallback: vec![], - fully_specified: false, - main_fields: vec!["main".into()], - main_files: vec!["index".into()], - modules: vec!["node_modules".into()], - resolve_to_context: false, - prefer_relative: false, - prefer_absolute: false, - restrictions: vec![], - roots: vec![], - symlinks: true, - builtin_modules: false, - } - } -} - -// For tracing -impl fmt::Display for ResolveOptions { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - if let Some(tsconfig) = &self.tsconfig { - write!(f, "tsconfig:{tsconfig:?},")?; - } - if !self.alias.is_empty() { - write!(f, "alias:{:?},", self.alias)?; - } - if !self.alias_fields.is_empty() { - write!(f, "alias_fields:{:?},", self.alias_fields)?; - } - if !self.condition_names.is_empty() { - write!(f, "condition_names:{:?},", self.condition_names)?; - } - if self.enforce_extension.is_enabled() { - write!(f, "enforce_extension:{:?},", self.enforce_extension)?; - } - if !self.exports_fields.is_empty() { - write!(f, "exports_fields:{:?},", self.exports_fields)?; - } - if !self.imports_fields.is_empty() { - write!(f, "imports_fields:{:?},", self.imports_fields)?; - } - if !self.extension_alias.is_empty() { - write!(f, "extension_alias:{:?},", self.extension_alias)?; - } - if !self.extensions.is_empty() { - write!(f, "extensions:{:?},", self.extensions)?; - } - if !self.fallback.is_empty() { - write!(f, "fallback:{:?},", self.fallback)?; - } - if self.fully_specified { - write!(f, "fully_specified:{:?},", self.fully_specified)?; - } - if !self.main_fields.is_empty() { - write!(f, "main_fields:{:?},", self.main_fields)?; - } - if !self.main_files.is_empty() { - write!(f, "main_files:{:?},", self.main_files)?; - } - if !self.modules.is_empty() { - write!(f, "modules:{:?},", self.modules)?; - } - if self.resolve_to_context { - write!(f, "resolve_to_context:{:?},", self.resolve_to_context)?; - } - if self.prefer_relative { - write!(f, "prefer_relative:{:?},", self.prefer_relative)?; - } - if self.prefer_absolute { - write!(f, "prefer_absolute:{:?},", self.prefer_absolute)?; - } - if !self.restrictions.is_empty() { - write!(f, "restrictions:{:?},", self.restrictions)?; - } - if !self.roots.is_empty() { - write!(f, "roots:{:?},", self.roots)?; - } - if self.symlinks { - write!(f, "symlinks:{:?},", self.symlinks)?; - } - if self.builtin_modules { - write!(f, "builtin_modules:{:?},", self.builtin_modules)?; - } - Ok(()) - } -} - -#[cfg(test)] -mod test { - use super::{ - AliasValue, EnforceExtension, ResolveOptions, Restriction, TsconfigOptions, - TsconfigReferences, - }; - use std::path::PathBuf; - - #[test] - fn enforce_extension() { - assert!(EnforceExtension::Auto.is_auto()); - assert!(!EnforceExtension::Enabled.is_auto()); - assert!(!EnforceExtension::Disabled.is_auto()); - - assert!(!EnforceExtension::Auto.is_enabled()); - assert!(EnforceExtension::Enabled.is_enabled()); - assert!(!EnforceExtension::Disabled.is_enabled()); - - assert!(!EnforceExtension::Auto.is_disabled()); - assert!(!EnforceExtension::Enabled.is_disabled()); - assert!(EnforceExtension::Disabled.is_disabled()); - } - - #[test] - fn display() { - let options = ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: PathBuf::from("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - alias: vec![("a".into(), vec![AliasValue::Ignore])], - alias_fields: vec![vec!["browser".into()]], - condition_names: vec!["require".into()], - enforce_extension: EnforceExtension::Enabled, - extension_alias: vec![(".js".into(), vec![".ts".into()])], - exports_fields: vec![vec!["exports".into()]], - imports_fields: vec![vec!["imports".into()]], - fallback: vec![("fallback".into(), vec![AliasValue::Ignore])], - fully_specified: true, - resolve_to_context: true, - prefer_relative: true, - prefer_absolute: true, - restrictions: vec![Restriction::Path(PathBuf::from("restrictions"))], - roots: vec![PathBuf::from("roots")], - builtin_modules: true, - ..ResolveOptions::default() - }; - - let expected = r#"tsconfig:TsconfigOptions { config_file: "tsconfig.json", references: Auto },alias:[("a", [Ignore])],alias_fields:[["browser"]],condition_names:["require"],enforce_extension:Enabled,exports_fields:[["exports"]],imports_fields:[["imports"]],extension_alias:[(".js", [".ts"])],extensions:[".js", ".json", ".node"],fallback:[("fallback", [Ignore])],fully_specified:true,main_fields:["main"],main_files:["index"],modules:["node_modules"],resolve_to_context:true,prefer_relative:true,prefer_absolute:true,restrictions:[Path("restrictions")],roots:["roots"],symlinks:true,builtin_modules:true,"#; - assert_eq!(format!("{options}"), expected); - - let options = ResolveOptions { - alias: vec![], - alias_fields: vec![], - builtin_modules: false, - condition_names: vec![], - description_files: vec![], - enforce_extension: EnforceExtension::Disabled, - exports_fields: vec![], - extension_alias: vec![], - extensions: vec![], - fallback: vec![], - fully_specified: false, - imports_fields: vec![], - main_fields: vec![], - main_files: vec![], - modules: vec![], - prefer_absolute: false, - prefer_relative: false, - resolve_to_context: false, - restrictions: vec![], - roots: vec![], - symlinks: false, - tsconfig: None, - }; - - assert_eq!(format!("{options}"), ""); - } -} diff --git a/src/package_json.rs b/src/package_json.rs deleted file mode 100644 index 73901faa..00000000 --- a/src/package_json.rs +++ /dev/null @@ -1,207 +0,0 @@ -//! package.json definitions -//! -//! Code related to export field are copied from [Parcel's resolver](https://github.com/parcel-bundler/parcel/blob/v2/packages/utils/node-resolver-rs/src/package_json.rs) -use std::path::{Path, PathBuf}; - -use serde_json::Value as JSONValue; - -use crate::{path::PathUtil, ResolveError}; - -pub type JSONMap = serde_json::Map; - -/// Deserialized package.json -#[derive(Debug, Default)] -pub struct PackageJson { - /// Path to `package.json`. Contains the `package.json` filename. - pub path: PathBuf, - - /// Realpath to `package.json`. Contains the `package.json` filename. - pub realpath: PathBuf, - - /// The "name" field defines your package's name. - /// The "name" field can be used in addition to the "exports" field to self-reference a package using its name. - /// - /// - pub name: Option, - - raw_json: std::sync::Arc, -} - -impl PackageJson { - /// # Panics - /// # Errors - pub(crate) fn parse( - path: PathBuf, - realpath: PathBuf, - json: &str, - ) -> Result { - let mut raw_json: JSONValue = serde_json::from_str(json)?; - let mut package_json = Self::default(); - - if let Some(json_object) = raw_json.as_object_mut() { - // Remove large fields that are useless for pragmatic use. - #[cfg(feature = "package_json_raw_json_api")] - { - json_object.remove("description"); - json_object.remove("keywords"); - json_object.remove("scripts"); - json_object.remove("dependencies"); - json_object.remove("devDependencies"); - json_object.remove("peerDependencies"); - json_object.remove("optionalDependencies"); - } - - // Add name. - package_json.name = - json_object.get("name").and_then(|field| field.as_str()).map(ToString::to_string); - } - - package_json.path = path; - package_json.realpath = realpath; - package_json.raw_json = std::sync::Arc::new(raw_json); - Ok(package_json) - } - - fn get_value_by_path<'a>( - fields: &'a serde_json::Map, - path: &[String], - ) -> Option<&'a JSONValue> { - if path.is_empty() { - return None; - } - let mut value = fields.get(&path[0])?; - for key in path.iter().skip(1) { - if let Some(inner_value) = value.as_object().and_then(|o| o.get(key)) { - value = inner_value; - } else { - return None; - } - } - Some(value) - } - - /// Raw serde json value of `package.json`. - /// - /// This is currently used in Rspack for: - /// * getting the `sideEffects` field - /// * query in - search on GitHub indicates query on the `type` field. - /// - /// To reduce overall memory consumption, large fields that useless for pragmatic use are removed. - /// They are: `description`, `keywords`, `scripts`, - /// `dependencies` and `devDependencies`, `peerDependencies`, `optionalDependencies`. - #[cfg(feature = "package_json_raw_json_api")] - pub fn raw_json(&self) -> &std::sync::Arc { - &self.raw_json - } - - /// Directory to `package.json` - /// - /// # Panics - /// - /// * When the package.json path is misconfigured. - pub fn directory(&self) -> &Path { - debug_assert!(self.realpath.file_name().is_some_and(|x| x == "package.json")); - self.realpath.parent().unwrap() - } - - /// The "main" field defines the entry point of a package when imported by name via a node_modules lookup. Its value is a path. - /// - /// When a package has an "exports" field, this will take precedence over the "main" field when importing the package by name. - /// - /// Values are dynamically retrieved from [ResolveOptions::main_fields]. - /// - /// - pub(crate) fn main_fields<'a>( - &'a self, - main_fields: &'a [String], - ) -> impl Iterator + '_ { - main_fields - .iter() - .filter_map(|main_field| self.raw_json.get(main_field)) - .filter_map(|value| value.as_str()) - } - - /// The "exports" field allows defining the entry points of a package when imported by name loaded either via a node_modules lookup or a self-reference to its own name. - /// - /// - pub(crate) fn exports_fields<'a>( - &'a self, - exports_fields: &'a [Vec], - ) -> impl Iterator + '_ { - exports_fields.iter().filter_map(|object_path| { - self.raw_json - .as_object() - .and_then(|json_object| Self::get_value_by_path(json_object, object_path)) - }) - } - - /// In addition to the "exports" field, there is a package "imports" field to create private mappings that only apply to import specifiers from within the package itself. - /// - /// - pub(crate) fn imports_fields<'a>( - &'a self, - imports_fields: &'a [Vec], - ) -> impl Iterator + '_ { - imports_fields.iter().filter_map(|object_path| { - self.raw_json - .as_object() - .and_then(|json_object| Self::get_value_by_path(json_object, object_path)) - .and_then(|value| value.as_object()) - }) - } - - /// The "browser" field is provided by a module author as a hint to javascript bundlers or component tools when packaging modules for client side use. - /// Multiple values are configured by [ResolveOptions::alias_fields]. - /// - /// - fn browser_fields<'a>( - &'a self, - alias_fields: &'a [Vec], - ) -> impl Iterator + '_ { - alias_fields.iter().filter_map(|object_path| { - self.raw_json - .as_object() - .and_then(|json_object| Self::get_value_by_path(json_object, object_path)) - // Only object is valid, all other types are invalid - // https://github.com/webpack/enhanced-resolve/blob/3a28f47788de794d9da4d1702a3a583d8422cd48/lib/AliasFieldPlugin.js#L44-L52 - .and_then(|value| value.as_object()) - }) - } - - /// Resolve the request string for this package.json by looking at the `browser` field. - /// - /// # Errors - /// - /// * Returns [ResolveError::Ignored] for `"path": false` in `browser` field. - pub(crate) fn resolve_browser_field<'a>( - &'a self, - path: &Path, - request: Option<&str>, - alias_fields: &'a [Vec], - ) -> Result, ResolveError> { - for object in self.browser_fields(alias_fields) { - if let Some(request) = request { - if let Some(value) = object.get(request) { - return Self::alias_value(path, value); - } - } else { - let dir = self.path.parent().unwrap(); - for (key, value) in object { - let joined = dir.normalize_with(key); - if joined == path { - return Self::alias_value(path, value); - } - } - } - } - Ok(None) - } - - fn alias_value<'a>(key: &Path, value: &'a JSONValue) -> Result, ResolveError> { - match value { - JSONValue::String(value) => Ok(Some(value.as_str())), - JSONValue::Bool(b) if !b => Err(ResolveError::Ignored(key.to_path_buf())), - _ => Ok(None), - } - } -} diff --git a/src/path.rs b/src/path.rs deleted file mode 100644 index f66fdd76..00000000 --- a/src/path.rs +++ /dev/null @@ -1,132 +0,0 @@ -//! Path Utilities -//! -//! Code adapted from the following libraries -//! * [path-absolutize](https://docs.rs/path-absolutize) -//! * [normalize_path](https://docs.rs/normalize-path) -use std::path::{Component, Path, PathBuf}; - -pub const SLASH_START: &[char; 2] = &['/', '\\']; - -/// Extension trait to add path normalization to std's [`Path`]. -pub trait PathUtil { - /// Normalize this path without performing I/O. - /// - /// All redundant separator and up-level references are collapsed. - /// - /// However, this does not resolve links. - fn normalize(&self) -> PathBuf; - - /// Normalize with subpath assuming this path is normalized without performing I/O. - /// - /// All redundant separator and up-level references are collapsed. - /// - /// However, this does not resolve links. - fn normalize_with>(&self, subpath: P) -> PathBuf; - - /// Defined in ESM PACKAGE_TARGET_RESOLVE - /// If target split on "/" or "\" contains any "", ".", "..", or "node_modules" segments after the first "." segment, case insensitive and including percent encoded variants - fn is_invalid_exports_target(&self) -> bool; -} - -impl PathUtil for Path { - // https://github.com/parcel-bundler/parcel/blob/e0b99c2a42e9109a9ecbd6f537844a1b33e7faf5/packages/utils/node-resolver-rs/src/path.rs#L7 - fn normalize(&self) -> PathBuf { - let mut components = self.components().peekable(); - let mut ret = if let Some(c @ Component::Prefix(..)) = components.peek() { - let buf = PathBuf::from(c.as_os_str()); - components.next(); - buf - } else { - PathBuf::new() - }; - - for component in components { - match component { - Component::Prefix(..) => unreachable!("Path {:?}", self), - Component::RootDir => { - ret.push(component.as_os_str()); - } - Component::CurDir => {} - Component::ParentDir => { - ret.pop(); - } - Component::Normal(c) => { - ret.push(c); - } - } - } - - ret - } - - // https://github.com/parcel-bundler/parcel/blob/e0b99c2a42e9109a9ecbd6f537844a1b33e7faf5/packages/utils/node-resolver-rs/src/path.rs#L37 - fn normalize_with>(&self, subpath: B) -> PathBuf { - let subpath = subpath.as_ref(); - - let mut components = subpath.components(); - - let Some(head) = components.next() else { return subpath.to_path_buf() }; - - if matches!(head, Component::Prefix(..) | Component::RootDir) { - return subpath.to_path_buf(); - } - - let mut ret = self.to_path_buf(); - for component in std::iter::once(head).chain(components) { - match component { - Component::CurDir => {} - Component::ParentDir => { - ret.pop(); - } - Component::Normal(c) => { - ret.push(c); - } - Component::Prefix(..) | Component::RootDir => { - unreachable!("Path {:?} Subpath {:?}", self, subpath) - } - } - } - - ret - } - - fn is_invalid_exports_target(&self) -> bool { - self.components().enumerate().any(|(index, c)| match c { - Component::ParentDir => true, - Component::CurDir => index > 0, - Component::Normal(c) => c.eq_ignore_ascii_case("node_modules"), - _ => false, - }) - } -} - -// https://github.com/webpack/enhanced-resolve/blob/main/test/path.test.js -#[test] -fn is_invalid_exports_target() { - let test_cases = [ - "../a.js", - "../", - "./a/b/../../../c.js", - "./a/b/../../../", - "./../../c.js", - "./../../", - "./a/../b/../../c.js", - "./a/../b/../../", - "./././../", - ]; - - for case in test_cases { - assert!(Path::new(case).is_invalid_exports_target(), "{case}"); - } - - assert!(!Path::new("C:").is_invalid_exports_target()); - assert!(!Path::new("/").is_invalid_exports_target()); -} - -#[test] -fn normalize() { - assert_eq!(Path::new("/foo/.././foo/").normalize(), Path::new("/foo")); - assert_eq!(Path::new("C://").normalize(), Path::new("C://")); - assert_eq!(Path::new("C:").normalize(), Path::new("C:")); - assert_eq!(Path::new(r"\\server\share").normalize(), Path::new(r"\\server\share")); -} diff --git a/src/resolution.rs b/src/resolution.rs deleted file mode 100644 index a3aaa2e7..00000000 --- a/src/resolution.rs +++ /dev/null @@ -1,92 +0,0 @@ -use crate::package_json::PackageJson; -use std::{ - fmt, - path::{Path, PathBuf}, - sync::Arc, -}; - -/// The final path resolution with optional `?query` and `#fragment` -#[derive(Clone)] -pub struct Resolution { - pub(crate) path: PathBuf, - - /// path query `?query`, contains `?`. - pub(crate) query: Option, - - /// path fragment `#query`, contains `#`. - pub(crate) fragment: Option, - - pub(crate) package_json: Option>, -} - -impl fmt::Debug for Resolution { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - f.debug_struct("Resolution") - .field("path", &self.path) - .field("query", &self.query) - .field("fragment", &self.fragment) - .field("package_json", &self.package_json.as_ref().map(|p| &p.path)) - .finish() - } -} - -impl PartialEq for Resolution { - fn eq(&self, other: &Self) -> bool { - self.path == other.path && self.query == other.query && self.fragment == other.fragment - } -} -impl Eq for Resolution {} - -impl Resolution { - /// Returns the path without query and fragment - pub fn path(&self) -> &Path { - &self.path - } - - /// Returns the path without query and fragment - pub fn into_path_buf(self) -> PathBuf { - self.path - } - - /// Returns the path query `?query`, contains the leading `?` - pub fn query(&self) -> Option<&str> { - self.query.as_deref() - } - - /// Returns the path fragment `#fragment`, contains the leading `#` - pub fn fragment(&self) -> Option<&str> { - self.fragment.as_deref() - } - - /// Returns serialized package_json - pub fn package_json(&self) -> Option<&Arc> { - self.package_json.as_ref() - } - - /// Returns the full path with query and fragment - pub fn full_path(&self) -> PathBuf { - let mut path = self.path.clone().into_os_string(); - if let Some(query) = &self.query { - path.push(query); - } - if let Some(fragment) = &self.fragment { - path.push(fragment); - } - PathBuf::from(path) - } -} - -#[test] -fn test() { - let resolution = Resolution { - path: PathBuf::from("foo"), - query: Some("?query".to_string()), - fragment: Some("#fragment".to_string()), - package_json: None, - }; - assert_eq!(resolution.path(), Path::new("foo")); - assert_eq!(resolution.query(), Some("?query")); - assert_eq!(resolution.fragment(), Some("#fragment")); - assert_eq!(resolution.full_path(), PathBuf::from("foo?query#fragment")); - assert_eq!(resolution.into_path_buf(), PathBuf::from("foo")); -} diff --git a/src/specifier.rs b/src/specifier.rs deleted file mode 100644 index 3d35eafc..00000000 --- a/src/specifier.rs +++ /dev/null @@ -1,230 +0,0 @@ -use crate::error::SpecifierError; -use std::borrow::Cow; - -#[derive(Debug)] -pub struct Specifier<'a> { - path: Cow<'a, str>, - pub query: Option<&'a str>, - pub fragment: Option<&'a str>, -} - -impl<'a> Specifier<'a> { - pub fn path(&'a self) -> &'a str { - self.path.as_ref() - } - - pub fn parse(specifier: &'a str) -> Result, SpecifierError> { - if specifier.is_empty() { - return Err(SpecifierError::Empty(specifier.to_string())); - } - let offset = match specifier.as_bytes()[0] { - b'/' | b'.' | b'#' => 1, - _ => 0, - }; - let (path, query, fragment) = Self::parse_query_framgment(specifier, offset); - if path.is_empty() { - return Err(SpecifierError::Empty(specifier.to_string())); - } - Ok(Self { path, query, fragment }) - } - - fn parse_query_framgment( - specifier: &'a str, - skip: usize, - ) -> (Cow<'a, str>, Option<&str>, Option<&str>) { - let mut query_start: Option = None; - let mut fragment_start: Option = None; - - let mut prev = specifier.chars().next().unwrap(); - let mut escaped_indexes = vec![]; - for (i, c) in specifier.char_indices().skip(skip) { - if c == '?' && query_start.is_none() { - query_start = Some(i); - } - if c == '#' { - if prev == '\0' { - escaped_indexes.push(i - 1); - } else { - fragment_start = Some(i); - break; - } - } - prev = c; - } - - let (path, query, fragment) = match (query_start, fragment_start) { - (Some(i), Some(j)) => { - debug_assert!(i < j); - (&specifier[..i], Some(&specifier[i..j]), Some(&specifier[j..])) - } - (Some(i), None) => (&specifier[..i], Some(&specifier[i..]), None), - (None, Some(j)) => (&specifier[..j], None, Some(&specifier[j..])), - _ => (specifier, None, None), - }; - - let path = if escaped_indexes.is_empty() { - Cow::Borrowed(path) - } else { - // Remove the `\0` characters for a legal path. - Cow::Owned( - path.chars() - .enumerate() - .filter_map(|(i, c)| (!escaped_indexes.contains(&i)).then_some(c)) - .collect::(), - ) - }; - - (path, query, fragment) - } -} - -#[cfg(test)] -mod tests { - use super::{Specifier, SpecifierError}; - - #[test] - fn debug() { - let specifier = Specifier::parse("/").unwrap(); - assert_eq!( - format!("{specifier:?}"), - r#"Specifier { path: "/", query: None, fragment: None }"# - ); - } - - #[test] - fn empty() { - let specifiers = ["", "?"]; - for specifier in specifiers { - let error = Specifier::parse(specifier).unwrap_err(); - assert_eq!(error, SpecifierError::Empty(specifier.to_string())); - } - } - - #[test] - fn absolute() -> Result<(), SpecifierError> { - let specifier = "/test?#"; - let parsed = Specifier::parse(specifier)?; - assert_eq!(parsed.path, "/test"); - assert_eq!(parsed.query, Some("?")); - assert_eq!(parsed.fragment, Some("#")); - Ok(()) - } - - #[test] - fn relative() -> Result<(), SpecifierError> { - let specifiers = ["./test", "../test", "../../test"]; - for specifier in specifiers { - let mut r = specifier.to_string(); - r.push_str("?#"); - let parsed = Specifier::parse(&r)?; - assert_eq!(parsed.path, specifier); - assert_eq!(parsed.query, Some("?")); - assert_eq!(parsed.fragment, Some("#")); - } - Ok(()) - } - - #[test] - fn hash() -> Result<(), SpecifierError> { - let specifiers = ["#", "#path"]; - for specifier in specifiers { - let mut r = specifier.to_string(); - r.push_str("?#"); - let parsed = Specifier::parse(&r)?; - assert_eq!(parsed.path, specifier); - assert_eq!(parsed.query, Some("?")); - assert_eq!(parsed.fragment, Some("#")); - } - Ok(()) - } - - #[test] - fn module() -> Result<(), SpecifierError> { - let specifiers = ["module"]; - for specifier in specifiers { - let mut r = specifier.to_string(); - r.push_str("?#"); - let parsed = Specifier::parse(&r)?; - assert_eq!(parsed.path, specifier); - assert_eq!(parsed.query, Some("?")); - assert_eq!(parsed.fragment, Some("#")); - } - Ok(()) - } - - #[test] - fn query_fragment() -> Result<(), SpecifierError> { - let data = [ - ("a?", Some("?"), None), - ("a?query", Some("?query"), None), - ("a?query1?query2", Some("?query1?query2"), None), - ("a?query1?query2?query3", Some("?query1?query2?query3"), None), - ("a#", None, Some("#")), - ("a#b#c", None, Some("#b#c")), - ("a#fragment", None, Some("#fragment")), - ("a?#", Some("?"), Some("#")), - ("a?#fragment", Some("?"), Some("#fragment")), - ("a?query#", Some("?query"), Some("#")), - ("a?query#fragment", Some("?query"), Some("#fragment")), - ("a#fragment?", None, Some("#fragment?")), - ("a#fragment?query", None, Some("#fragment?query")), - ]; - - for (specifier_str, query, fragment) in data { - let specifier = Specifier::parse(specifier_str)?; - assert_eq!(specifier.path, "a", "{specifier_str}"); - assert_eq!(specifier.query, query, "{specifier_str}"); - assert_eq!(specifier.fragment, fragment, "{specifier_str}"); - } - - Ok(()) - } - - #[test] - // https://github.com/webpack/enhanced-resolve/blob/main/test/identifier.test.js - fn enhanced_resolve_edge_cases() -> Result<(), SpecifierError> { - let data = [ - ("path/#", "path/", "", "#"), - ("path/as/?", "path/as/", "?", ""), - ("path/#/?", "path/", "", "#/?"), - ("path/#repo#hash", "path/", "", "#repo#hash"), - ("path/#r#hash", "path/", "", "#r#hash"), - ("path/#repo/#repo2#hash", "path/", "", "#repo/#repo2#hash"), - ("path/#r/#r#hash", "path/", "", "#r/#r#hash"), - ("path/#/not/a/hash?not-a-query", "path/", "", "#/not/a/hash?not-a-query"), - ]; - - for (specifier_str, path, query, fragment) in data { - let specifier = Specifier::parse(specifier_str)?; - assert_eq!(specifier.path, path, "{specifier_str}"); - assert_eq!(specifier.query.unwrap_or(""), query, "{specifier_str}"); - assert_eq!(specifier.fragment.unwrap_or(""), fragment, "{specifier_str}"); - } - - Ok(()) - } - - // https://github.com/webpack/enhanced-resolve/blob/main/test/identifier.test.js - #[test] - fn enhanced_resolve_windows_like() -> Result<(), SpecifierError> { - let data = [ - ("path\\#", "path\\", "", "#"), - ("path\\as\\?", "path\\as\\", "?", ""), - ("path\\#\\?", "path\\", "", "#\\?"), - ("path\\#repo#hash", "path\\", "", "#repo#hash"), - ("path\\#r#hash", "path\\", "", "#r#hash"), - ("path\\#repo\\#repo2#hash", "path\\", "", "#repo\\#repo2#hash"), - ("path\\#r\\#r#hash", "path\\", "", "#r\\#r#hash"), - ("path\\#/not/a/hash?not-a-query", "path\\", "", "#/not/a/hash?not-a-query"), - ]; - - for (specifier_str, path, query, fragment) in data { - let specifier = Specifier::parse(specifier_str)?; - assert_eq!(specifier.path, path, "{specifier_str}"); - assert_eq!(specifier.query.unwrap_or(""), query, "{specifier_str}"); - assert_eq!(specifier.fragment.unwrap_or(""), fragment, "{specifier_str}"); - } - - Ok(()) - } -} diff --git a/src/tests/alias.rs b/src/tests/alias.rs deleted file mode 100644 index 07c615f4..00000000 --- a/src/tests/alias.rs +++ /dev/null @@ -1,280 +0,0 @@ -//! - -use normalize_path::NormalizePath; -use std::path::Path; - -use crate::{AliasValue, Resolution, ResolveContext, ResolveError, ResolveOptions, Resolver}; - -#[test] -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -fn alias() { - use super::memory_fs::MemoryFS; - use crate::ResolverGeneric; - use std::path::{Path, PathBuf}; - - let f = Path::new("/"); - - let file_system = MemoryFS::new(&[ - ("/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", ""), - ("/dashed-name", ""), - ]); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - alias: vec![ - ("aliasA".into(), vec![AliasValue::from("a")]), - ("b$".into(), vec![AliasValue::from("a/index")]), - ("c$".into(), vec![AliasValue::from("/a/index")]), - ( - "multiAlias".into(), - vec![ - AliasValue::from("b"), - AliasValue::from("c"), - AliasValue::from("d"), - AliasValue::from("e"), - AliasValue::from("a"), - ], - ), - ("recursive".into(), vec![AliasValue::from("recursive/dir")]), - ("/d/dir".into(), vec![AliasValue::from("/c/dir")]), - ("/d/index.js".into(), vec![AliasValue::from("/c/index")]), - ("#".into(), vec![AliasValue::from("/c/dir")]), - ("@".into(), vec![AliasValue::from("/c/dir")]), - ("ignored".into(), vec![AliasValue::Ignore]), - // not part of enhanced-resolve, added to make sure query in alias value works - ("alias_query".into(), vec![AliasValue::from("a?query_after")]), - ("alias_fragment".into(), vec![AliasValue::from("a#fragment_after")]), - ("dash".into(), vec![AliasValue::Ignore]), - ("@scope/package-name/file$".into(), vec![AliasValue::from("/c/dir")]), - ], - modules: vec!["/".into()], - ..ResolveOptions::default() - }, - ); - - #[rustfmt::skip] - let pass = [ - ("should resolve a not aliased module 1", "a", "/a/index"), - ("should resolve a not aliased module 2", "a/index", "/a/index"), - ("should resolve a not aliased module 3", "a/dir", "/a/dir/index"), - ("should resolve a not aliased module 4", "a/dir/index", "/a/dir/index"), - ("should resolve an aliased module 1", "aliasA", "/a/index"), - ("should resolve an aliased module 2", "aliasA/index", "/a/index"), - ("should resolve an aliased module 3", "aliasA/dir", "/a/dir/index"), - ("should resolve an aliased module 4", "aliasA/dir/index", "/a/dir/index"), - ("should resolve '#' alias 1", "#", "/c/dir/index"), - ("should resolve '#' alias 2", "#/index", "/c/dir/index"), - ("should resolve '@' alias 1", "@", "/c/dir/index"), - ("should resolve '@' alias 2", "@/index", "/c/dir/index"), - ("should resolve a recursive aliased module 1", "recursive", "/recursive/dir/index"), - ("should resolve a recursive aliased module 2", "recursive/index", "/recursive/dir/index"), - ("should resolve a recursive aliased module 3", "recursive/dir", "/recursive/dir/index"), - ("should resolve a recursive aliased module 4", "recursive/dir/index", "/recursive/dir/index"), - ("should resolve a file aliased module 1", "b", "/a/index"), - ("should resolve a file aliased module 2", "c", "/a/index"), - ("should resolve a file aliased module with a query 1", "b?query", "/a/index?query"), - ("should resolve a file aliased module with a query 2", "c?query", "/a/index?query"), - ("should resolve a path in a file aliased module 1", "b/index", "/b/index"), - ("should resolve a path in a file aliased module 2", "b/dir", "/b/dir/index"), - ("should resolve a path in a file aliased module 3", "b/dir/index", "/b/dir/index"), - ("should resolve a path in a file aliased module 4", "c/index", "/c/index"), - ("should resolve a path in a file aliased module 5", "c/dir", "/c/dir/index"), - ("should resolve a path in a file aliased module 6", "c/dir/index", "/c/dir/index"), - ("should resolve a file aliased file 1", "d", "/c/index"), - ("should resolve a file aliased file 2", "d/dir/index", "/c/dir/index"), - ("should resolve a file in multiple aliased dirs 1", "multiAlias/dir/file", "/e/dir/file"), - ("should resolve a file in multiple aliased dirs 2", "multiAlias/anotherDir", "/e/anotherDir/index"), - // not part of enhanced-resolve, added to make sure query in alias value works - ("should resolve query in alias value", "alias_query?query_before", "/a/index?query_after"), - ("should resolve query in alias value", "alias_fragment#fragment_before", "/a/index#fragment_after"), - ("should resolve dashed name", "dashed-name", "/dashed-name"), - ("should resolve scoped package name with sub dir", "@scope/package-name/file", "/c/dir/index"), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - - #[rustfmt::skip] - let ignore = [ - ("should resolve an ignore module", "ignored", ResolveError::Ignored(f.join("ignored"))) - ]; - - for (comment, request, expected) in ignore { - let resolution = resolver.resolve(f, request); - assert_eq!(resolution, Err(expected), "{comment} {request}"); - } -} - -// Not part of enhanced-resolve -#[test] -fn infinite_recursion() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![ - ("./a".into(), vec![AliasValue::from("./b")]), - ("./b".into(), vec![AliasValue::from("./a")]), - ], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(f, "./a"); - assert_eq!(resolution, Err(ResolveError::Recursion)); -} - -fn check_slash(path: &Path) { - let s = path.to_string_lossy().to_string(); - #[cfg(target_os = "windows")] - { - assert!(!s.contains('/'), "{s}"); - assert!(s.contains('\\'), "{s}"); - } - #[cfg(not(target_os = "windows"))] - { - assert!(s.contains('/'), "{s}"); - assert!(!s.contains('\\'), "{s}"); - } -} - -#[test] -fn absolute_path() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![(f.join("foo").to_str().unwrap().to_string(), vec![AliasValue::Ignore])], - modules: vec![f.clone().to_str().unwrap().to_string()], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(&f, "foo/index"); - assert_eq!(resolution, Err(ResolveError::Ignored(f.join("foo")))); -} - -#[test] -fn system_path() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![("@app".into(), vec![AliasValue::from(f.join("alias").to_string_lossy())])], - ..ResolveOptions::default() - }); - - let specifiers = ["@app/files/a", "@app/files/a.js"]; - - for specifier in specifiers { - let path = resolver.resolve(&f, specifier).map(Resolution::into_path_buf).unwrap(); - assert_eq!(path, f.join("alias/files/a.js")); - check_slash(&path); - } -} - -#[test] -fn alias_is_full_path() { - let f = super::fixture(); - let dir = f.join("foo"); - let dir_str = dir.to_string_lossy().to_string(); - - let resolver = Resolver::new(ResolveOptions { - alias: vec![("@".into(), vec![AliasValue::Path(dir_str.clone())])], - ..ResolveOptions::default() - }); - - let mut ctx = ResolveContext::default(); - - let specifiers = [ - "@/index".to_string(), - "@/index.js".to_string(), - // specifier has multiple `/` for reasons we'll never know - "@////index".to_string(), - // specifier is a full path - dir_str, - ]; - - for specifier in specifiers { - let resolution = resolver.resolve_with_context(&f, &specifier, &mut ctx); - assert_eq!(resolution.map(|r| r.full_path()), Ok(dir.join("index.js"))); - } - - for path in ctx.file_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - check_slash(&path); - } - - for path in ctx.missing_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - check_slash(&path); - if let Some(path) = path.parent() { - assert!(!path.is_file(), "{path:?} must not be a file"); - } - } -} - -// For the `should_stop` variable in `load_alias` -#[test] -fn all_alias_values_are_not_found() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![( - "m1".to_string(), - vec![AliasValue::Path(f.join("node_modules").join("m2").to_string_lossy().to_string())], - )], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(&f, "m1/a.js"); - assert_eq!(resolution, Err(ResolveError::NotFound("m1/a.js".to_string()))); -} - -#[test] -fn alias_fragment() { - let f = super::fixture(); - - let data = [ - // enhanced-resolve has `#` prepended with a `\0`, they are removed from the - // following 3 expected test results. - // See https://github.com/webpack/enhanced-resolve#escaping - ( - "handle fragment edge case (no fragment)", - "./no#fragment/#/#", - f.join("no#fragment/#/#.js"), - ), - ("handle fragment edge case (fragment)", "./no#fragment/#/", f.join("no.js#fragment/#/")), - ( - "handle fragment escaping", - "./no\0#fragment/\0#/\0##fragment", - f.join("no#fragment/#/#.js#fragment"), - ), - ]; - - for (comment, request, expected) in data { - let resolver = Resolver::new(ResolveOptions { - alias: vec![("foo".to_string(), vec![AliasValue::Path(request.to_string())])], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f, "foo").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } -} - -#[test] -fn alias_try_fragment_as_path() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![( - "#".to_string(), - vec![AliasValue::Path(f.join("#").to_string_lossy().to_string())], - )], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(&f, "#/a").map(|r| r.full_path()); - assert_eq!(resolution, Ok(f.join("#").join("a.js"))); -} diff --git a/src/tests/browser_field.rs b/src/tests/browser_field.rs deleted file mode 100644 index 171ee099..00000000 --- a/src/tests/browser_field.rs +++ /dev/null @@ -1,189 +0,0 @@ -//! - -use crate::{AliasValue, ResolveError, ResolveOptions, Resolver}; - -#[test] -fn ignore() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![ - vec!["browser".into()], - vec!["innerBrowser1".into()], - vec!["innerBrowser2".into()], - vec![], - ], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - (f.clone(), "./lib/ignore", f.join("lib/ignore.js")), - (f.clone(), "./lib/ignore.js", f.join("lib/ignore.js")), - (f.join("lib"), "./ignore", f.join("lib/ignore.js")), - (f.join("lib"), "./ignore.js", f.join("lib/ignore.js")), - ]; - - for (path, request, expected) in data { - let resolution = resolver.resolve(&path, request); - let expected = ResolveError::Ignored(expected); - assert_eq!(resolution, Err(expected), "{path:?} {request}"); - } -} - -#[test] -fn shared_resolvers() { - let f = super::fixture().join("browser-module"); - - let resolver1 = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["innerBrowser1".into(), "field".into(), "browser".into()]], - ..ResolveOptions::default() - }); - let resolved_path = resolver1.resolve(&f, "./lib/main1.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("lib/main.js"))); - - let resolver2 = resolver1.clone_with_options(ResolveOptions { - alias_fields: vec![vec!["innerBrowser2".into(), "browser".into()]], - ..ResolveOptions::default() - }); - let resolved_path = resolver2.resolve(&f, "./lib/main2.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("./lib/replaced.js"))); -} - -#[test] -fn replace_file() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![ - vec!["browser".into()], - vec!["innerBrowser1".into(), "field2".into(), "browser".into()], // not presented - vec!["innerBrowser1".into(), "field".into(), "browser".into()], - vec!["innerBrowser2".into(), "browser".into()], - ], - // Not part of enhanced-resolve. Added to make sure no interaction between these two fields. - main_fields: vec!["browser".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - ("should replace a file 1", f.clone(), "./lib/replaced", f.join("lib/browser.js")), - ("should replace a file 2", f.clone(), "./lib/replaced.js", f.join("lib/browser.js")), - ("should replace a file 3", f.join("lib"), "./replaced", f.join("lib/browser.js")), - ("should replace a file 4", f.join("lib"), "./replaced.js", f.join("lib/browser.js")), - ("should replace a module with a file 1", f.clone(), "module-a", f.join("browser/module-a.js")), - ("should replace a module with a file 2", f.join("lib"), "module-a", f.join("browser/module-a.js")), - ("should replace a module with a module 1", f.clone(), "module-b", f.join("node_modules/module-c.js")), - ("should replace a module with a module 2", f.join("lib"), "module-b", f.join("node_modules/module-c.js")), - ("should resolve in nested property 1", f.clone(), "./lib/main1.js", f.join("lib/main.js")), - ("should resolve in nested property 2", f.clone(), "./lib/main2.js", f.join("lib/browser.js")), - ("should check only alias field properties", f.clone(), "./toString", f.join("lib/toString.js")), - // not part of enhanced-resolve - ("recursion", f.clone(), "module-c", f.join("node_modules/module-c.js")), - ("resolve self 1", f.clone(), "./lib/main.js", f.join("lib/main.js")), - ("resolve self 2", f.clone(), "./main.js", f.join("lib/main.js")), - ]; - - for (comment, path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn recurse_fail() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - ("recurse non existent", f.clone(), "./lib/non-existent.js", ResolveError::NotFound("./lib/non-existent.js".into())), - ("path partial match 1", f.clone(), "./xyz.js", ResolveError::NotFound("./xyz.js".into())), - ("path partial match 2", f, "./lib/xyz.js", ResolveError::NotFound("./lib/xyz.js".into())), - ]; - - for (comment, path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Err(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn broken() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - // The browser field string value should be ignored - (f.clone(), "browser-module-broken", Ok(f.join("node_modules/browser-module-broken/main.js"))), - (f.join("browser-module"), "./number", Err(ResolveError::NotFound("./number".into()))), - ]; - - for (path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, expected, "{path:?} {request}"); - } -} - -#[test] -fn crypto_js() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - fallback: vec![( - "crypto".into(), - vec![AliasValue::from(f.join("lib.js").to_string_lossy())], - )], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(f.join("crypto-js"), "crypto").map(|r| r.full_path()); - assert_eq!(resolved_path, Err(ResolveError::Ignored(f.join("crypto-js")))); -} - -// https://github.com/webpack/webpack/blob/87660921808566ef3b8796f8df61bd79fc026108/test/cases/resolving/browser-field/index.js#L40-L43 -#[test] -fn recursive() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - let data = [ - ("should handle recursive file 1", f.clone(), "recursive-file/a"), - ("should handle recursive file 2", f.clone(), "recursive-file/b"), - ("should handle recursive file 3", f.clone(), "recursive-file/c"), - ("should handle recursive file 4", f, "recursive-file/d"), - ]; - - for (comment, path, request) in data { - let resolved_path = resolver.resolve(&path, request); - assert_eq!(resolved_path, Err(ResolveError::Recursion), "{comment} {path:?} {request}"); - } -} - -#[test] -fn with_query() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "./foo").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("lib").join("browser.js?query"))); -} diff --git a/src/tests/builtins.rs b/src/tests/builtins.rs deleted file mode 100644 index 5d6d14d9..00000000 --- a/src/tests/builtins.rs +++ /dev/null @@ -1,121 +0,0 @@ -use std::path::Path; - -use crate::{ResolveError, ResolveOptions, Resolver}; - -#[test] -fn builtins_off() { - let f = Path::new("/"); - let resolver = Resolver::default(); - let resolved_path = resolver.resolve(f, "zlib").map(|r| r.full_path()); - assert_eq!(resolved_path, Err(ResolveError::NotFound("zlib".into()))); -} - -#[test] -fn builtins() { - let f = Path::new("/"); - - let resolver = Resolver::new(ResolveOptions::default().with_builtin_modules(true)); - - let pass = [ - "_http_agent", - "_http_client", - "_http_common", - "_http_incoming", - "_http_outgoing", - "_http_server", - "_stream_duplex", - "_stream_passthrough", - "_stream_readable", - "_stream_transform", - "_stream_wrap", - "_stream_writable", - "_tls_common", - "_tls_wrap", - "assert", - "assert/strict", - "async_hooks", - "buffer", - "child_process", - "cluster", - "console", - "constants", - "crypto", - "dgram", - "diagnostics_channel", - "dns", - "dns/promises", - "domain", - "events", - "fs", - "fs/promises", - "http", - "http2", - "https", - "inspector", - "module", - "net", - "os", - "path", - "path/posix", - "path/win32", - "perf_hooks", - "process", - "punycode", - "querystring", - "readline", - "repl", - "stream", - "stream/consumers", - "stream/promises", - "stream/web", - "string_decoder", - "sys", - "timers", - "timers/promises", - "tls", - "trace_events", - "tty", - "url", - "util", - "util/types", - "v8", - "vm", - "worker_threads", - "zlib", - ]; - - for request in pass { - let prefixed_request = format!("node:{request}"); - for request in [prefixed_request.clone(), request.to_string()] { - let resolved_path = resolver.resolve(f, &request).map(|r| r.full_path()); - let err = ResolveError::Builtin(prefixed_request.clone()); - assert_eq!(resolved_path, Err(err), "{request}"); - } - } -} - -#[test] -fn fail() { - let f = Path::new("/"); - let resolver = Resolver::new(ResolveOptions::default().with_builtin_modules(true)); - let request = "xxx"; - let resolved_path = resolver.resolve(f, request); - let err = ResolveError::NotFound(request.to_string()); - assert_eq!(resolved_path, Err(err), "{request}"); -} - -#[test] -fn imports() { - let f = super::fixture().join("builtins"); - let resolver = Resolver::new(ResolveOptions { - builtin_modules: true, - condition_names: vec!["node".into()], - ..ResolveOptions::default() - }); - - for request in ["#fs", "#http"] { - let resolved_path = resolver.resolve(f.clone(), request).map(|r| r.full_path()); - let err = ResolveError::Builtin(format!("node:{}", request.trim_start_matches('#'))); - assert_eq!(resolved_path, Err(err)); - } -} diff --git a/src/tests/dependencies.rs b/src/tests/dependencies.rs deleted file mode 100644 index bcc2355b..00000000 --- a/src/tests/dependencies.rs +++ /dev/null @@ -1,110 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/dependencies.test.js - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows { - use rustc_hash::FxHashSet; - use std::path::PathBuf; - - use crate::{ResolveContext, ResolveOptions, ResolverGeneric}; - - use super::super::memory_fs::MemoryFS; - - fn file_system() -> MemoryFS { - MemoryFS::new(&[ - ("/a/b/node_modules/some-module/index.js", ""), - ("/a/node_modules/module/package.json", r#"{"main":"entry.js"}"#), - ("/a/node_modules/module/file.js", r#"{"main":"entry.js"}"#), - ("/modules/other-module/file.js", ""), - ]) - } - - #[test] - fn test() { - let file_system = file_system(); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - extensions: vec![".json".into(), ".js".into()], - modules: vec!["/modules".into(), "node_modules".into()], - ..ResolveOptions::default() - }, - ); - - let data = [ - ( - "middle module request", - "/a/b/c", - "module/file", - "/a/node_modules/module/file.js", - // These dependencies are different from enhanced-resolve due to different code path to - // querying the file system - vec![ - // 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", - // "/", - ], - vec![ - // missing package.jsons - // "/a/b/c/package.json", - "/a/b/package.json", - "/a/package.json", - "/package.json", - // missing modules directories - "/a/b/c", - // "/a/b/c/node_modules", - // missing single file modules - "/modules/module", - "/a/b/node_modules/module", - // missing files with alternative extensions - "/a/node_modules/module/file", - "/a/node_modules/module/file.json", - ], - ), - ( - "fast found module", - "/a/b/c", - "other-module/file.js", - "/modules/other-module/file.js", - // These dependencies are different from enhanced-resolve due to different code path to - // querying the file system - vec![ - // symlink checks - "/modules/other-module/file.js", - // "/modules/other-module", - // "/modules", - // "/", - ], - vec![ - // missing package.jsons - // "/a/b/c/package.json", - "/a/b/c", - "/a/b/package.json", - "/a/package.json", - "/package.json", - "/modules/other-module/package.json", - "/modules/package.json", - ], - ), - ]; - - for (name, context, request, result, file_dependencies, missing_dependencies) in data { - let mut ctx = ResolveContext::default(); - let path = PathBuf::from(context); - let resolved = - resolver.resolve_with_context(path, request, &mut ctx).map(|r| r.full_path()); - assert_eq!(resolved, Ok(PathBuf::from(result))); - let file_dependencies = - FxHashSet::from_iter(file_dependencies.iter().map(PathBuf::from)); - let missing_dependencies = - FxHashSet::from_iter(missing_dependencies.iter().map(PathBuf::from)); - assert_eq!(ctx.file_dependencies, file_dependencies, "{name}"); - assert_eq!(ctx.missing_dependencies, missing_dependencies, "{name}"); - } - } -} diff --git a/src/tests/exports_field.rs b/src/tests/exports_field.rs deleted file mode 100644 index fd68c1f7..00000000 --- a/src/tests/exports_field.rs +++ /dev/null @@ -1,2546 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/exportsField.test.js -//! -//! The huge exports field test cases are at the bottom of this file. - -use crate::{Ctx, PathUtil, ResolveError, ResolveOptions, Resolver}; -use serde_json::json; -use std::path::Path; - -#[test] -fn test_simple() { - let f = super::fixture().join("exports-field"); - let f2 = super::fixture().join("exports-field2"); - let f4 = super::fixture().join("exports-field-error"); - let f5 = super::fixture().join("imports-exports-wildcard"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - fully_specified: true, - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("resolve root using exports field, not a main field", f.clone(), "exports-field", f.join("node_modules/exports-field/x.js")), - ("resolver should respect condition names", f.clone(), "exports-field/dist/main.js", f.join("node_modules/exports-field/lib/lib2/main.js")), - // enhanced_resolve behaves differently to node.js. enhanced_resolve fallbacks when an - // array item is unresolved, where as node.js fallbacks when an array has an - // InvalidPackageTarget error. - // ("resolver should respect fallback", f2.clone(), "exports-field/dist/browser.js", f2.join("node_modules/exports-field/lib/browser.js")), - // The following two tests require fallback from array values, the path is changed here to - // only test query and fragment. - ("resolver should respect query parameters #1", f2.clone(), "exports-field/dist/main.js?foo", f2.join("node_modules/exports-field/lib/lib2/main.js?foo")), - ("resolver should respect fragment parameters #1", f2.clone(), "exports-field/dist/main.js#foo", f2.join("node_modules/exports-field/lib/lib2/main.js#foo")), - ("relative path should work, if relative path as request is used", f.clone(), "./node_modules/exports-field/lib/main.js", f.join("node_modules/exports-field/lib/main.js")), - ("self-resolving root", f.clone(), "@exports-field/core", f.join("a.js")), - ("should resolve with wildcard pattern #1", f5.clone(), "m/features/f.js", f5.join("node_modules/m/src/features/f.js")), - ("should resolve with wildcard pattern #2", f5.clone(), "m/features/y/y.js", f5.join("node_modules/m/src/features/y/y.js")), - ("should resolve with wildcard pattern #3", f5.clone(), "m/features-no-ext/y/y.js", f5.join("node_modules/m/src/features/y/y.js")), - ("should resolve with wildcard pattern #4", f5.clone(), "m/middle/nested/f.js", f5.join("node_modules/m/src/middle/nested/f.js")), - ("should resolve with wildcard pattern #5", f5.clone(), "m/middle-1/nested/f.js", f5.join("node_modules/m/src/middle-1/nested/f.js")), - ("should resolve with wildcard pattern #6", f5.clone(), "m/middle-2/nested/f.js", f5.join("node_modules/m/src/middle-2/nested/f.js")), - ("should resolve with wildcard pattern #7", f5.clone(), "m/middle-3/nested/f", f5.join("node_modules/m/src/middle-3/nested/f/nested/f.js")), - ("should resolve with wildcard pattern #8", f5.clone(), "m/middle-4/f/nested", f5.join("node_modules/m/src/middle-4/f/f.js")), - ("should resolve with wildcard pattern #9", f5.clone(), "m/middle-5/f$/$", f5.join("node_modules/m/src/middle-5/f$/$.js")), - ]; - - // Not needed or snapshot: - // * should log the correct info - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } - - let p = f.join("node_modules/exports-field/package.json"); - let p2 = f2.join("node_modules/exports-field/package.json"); - let p4 = f4.join("node_modules/exports-field/package.json"); - let p5 = f5.join("node_modules/m/package.json"); - - #[rustfmt::skip] - let fail = [ - // ("throw error if extension not provided", f2.clone(), "exports-field/dist/main", ResolveError::NotFound(f2.join("node_modules/exports-field/lib/lib2/main"))), - ("resolver should respect query parameters #2. Direct matching", f2.clone(), "exports-field?foo", ResolveError::PackagePathNotExported("./?foo".into(), p2.clone())), - ("resolver should respect fragment parameters #2. Direct matching", f2, "exports-field#foo", ResolveError::PackagePathNotExported("./#foo".into(), p2)), - ("relative path should not work with exports field", f.clone(), "./node_modules/exports-field/dist/main.js", ResolveError::NotFound("./node_modules/exports-field/dist/main.js".into())), - ("backtracking should not work for request", f.clone(), "exports-field/dist/../../../a.js", ResolveError::InvalidPackageTarget("./lib/../../../a.js".to_string(), "./dist/".to_string(), p.clone())), - ("backtracking should not work for exports field target", f.clone(), "exports-field/dist/a.js", ResolveError::InvalidPackageTarget("./../../a.js".to_string(), "./dist/a.js".to_string(), p.clone())), - ("not exported error", f.clone(), "exports-field/anything/else", ResolveError::PackagePathNotExported("./anything/else".to_string(), p.clone())), - ("request ending with slash #1", f.clone(), "exports-field/", ResolveError::PackagePathNotExported("./".to_string(), p.clone())), - ("request ending with slash #2", f.clone(), "exports-field/dist/", ResolveError::PackagePathNotExported("./dist/".to_string(), p.clone())), - ("request ending with slash #3", f.clone(), "exports-field/lib/", ResolveError::PackagePathNotExported("./lib/".to_string(), p)), - ("should throw error if target is invalid", f4, "exports-field", ResolveError::InvalidPackageTarget("./a/../b/../../pack1/index.js".to_string(), ".".to_string(), p4)), - ("throw error if exports field is invalid", f.clone(), "invalid-exports-field", ResolveError::InvalidPackageConfig(f.join("node_modules/invalid-exports-field/package.json"))), - ("should throw error if target is 'null'", f5, "m/features/internal/file.js", ResolveError::PackagePathNotExported("./features/internal/file.js".to_string(), p5)), - ]; - - for (comment, path, request, error) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!(resolution, Err(error), "{comment} {path:?} {request}"); - } -} - -// resolve using exports field, not a browser field #1 -#[test] -fn exports_not_browser_field1() { - let f = super::fixture().join("exports-field"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - condition_names: vec!["webpack".into()], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "exports-field/dist/main.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("node_modules/exports-field/lib/lib2/main.js"))); -} - -// resolve using exports field and a browser alias field #2 -#[test] -fn exports_not_browser_field2() { - let f2 = super::fixture().join("exports-field2"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - extensions: vec![".js".into()], - condition_names: vec!["node".into()], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f2, "exports-field/dist/main.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f2.join("node_modules/exports-field/lib/browser.js"))); -} - -// should resolve extension without fullySpecified -#[test] -fn extension_without_fully_specified() { - let f2 = super::fixture().join("exports-field2"); - - let commonjs_resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - let resolved_path = - commonjs_resolver.resolve(&f2, "exports-field/dist/main").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f2.join("node_modules/exports-field/lib/lib2/main.js"))); -} - -#[test] -fn field_name_path() { - let f2 = super::fixture().join("exports-field2"); - let f3 = super::fixture().join("exports-field3"); - - // field name path #1 #2 #3 - let exports_fields = [ - vec![vec!["exportsField".into(), "exports".into()]], - vec![vec!["exportsField".into(), "exports".into()], vec!["exports".into()]], - vec![vec!["exports".into()], vec!["exportsField".into(), "exports".into()]], - ]; - - for exports_fields in exports_fields { - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - exports_fields, - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/main.js"))); - } - - // field name path #4 - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - exports_fields: vec![vec!["exports".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f2, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f2.join("node_modules/exports-field/index.js"))); - - // field name path #5 - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - exports_fields: vec![vec!["ex".into()], vec!["exports_field".into(), "exports".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/index"))); - - // non-compliant export targeting a directory - let resolver = Resolver::new(ResolveOptions { - exports_fields: vec![vec!["broken".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/src/index.js"))); -} - -#[test] -fn shared_resolvers() { - let f3 = super::fixture().join("exports-field3"); - - let resolver1 = Resolver::new(ResolveOptions { - exports_fields: vec![vec!["exportsField".into(), "exports".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver1.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/main.js"))); - - let resolver2 = resolver1.clone_with_options(ResolveOptions { - exports_fields: vec![vec!["ex".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver2.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/index"))); -} - -#[test] -fn extension_alias_1_2() { - let f = super::fixture().join("exports-field-and-extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - extension_alias: vec![(".js".into(), vec![".ts".into(), ".js".into()])], - fully_specified: true, - condition_names: vec!["webpack".into(), "default".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve with the `extensionAlias` option", f.clone(), "@org/pkg/string.js", f.join("node_modules/@org/pkg/dist/string.js")), - ("should resolve with the `extensionAlias` option #2", f.clone(), "pkg/string.js", f.join("node_modules/pkg/dist/string.js")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn extension_alias_3() { - let f = super::fixture().join("exports-field-and-extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - extension_alias: vec![( - ".js".into(), - vec![".foo".into(), ".baz".into(), ".baz".into(), ".ts".into(), ".js".into()], - )], - fully_specified: true, - condition_names: vec!["webpack".into(), "default".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve with the `extensionAlias` option #3", f.clone(), "pkg/string.js", f.join("node_modules/pkg/dist/string.js")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn extension_alias_throw_error() { - let f = super::fixture().join("exports-field-and-extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - extension_alias: vec![(".js".into(), vec![".ts".into()])], - fully_specified: true, - condition_names: vec!["webpack".into(), "default".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let fail = [ - // enhanced-resolve has two test cases that are exactly the same here - // https://github.com/webpack/enhanced-resolve/blob/a998c7d218b7a9ec2461fc4fddd1ad5dd7687485/test/exportsField.test.js#L2976-L3024 - ("should throw error with the `extensionAlias` option", f, "pkg/string.js", ResolveError::ExtensionAlias), - // TODO: The error is PackagePathNotExported in enhanced-resolve - // ("should throw error with the `extensionAlias` option", f.clone(), "pkg/string.js", ResolveError::PackagePathNotExported("node_modules/pkg/dist/string.ts".to_string())), - ]; - - for (comment, path, request, error) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!(resolution, Err(error), "{comment} {path:?} {request}"); - } -} - -// Small script for generating the test cases from enhanced-resolve -// for (c of testCases) { -// console.log("TestCase {") -// console.log(`name: ${JSON.stringify(c.name)},`) -// if (c.expect instanceof Error) { -// console.log(`expect: None,`) -// } else { -// console.log(`expect: Some(vec!${JSON.stringify(c.expect)}),`) -// } -// console.log(`exports_field: exports_field(json!(${JSON.stringify(c.suite[0], null, 2)})),`) -// console.log(`request: "${c.suite[1]}",`) -// console.log(`condition_names: vec!${JSON.stringify(c.suite[2])},`) -// console.log("},") -//} -struct TestCase { - name: &'static str, - expect: Option>, - exports_field: serde_json::Value, - request: &'static str, - condition_names: Vec<&'static str>, -} - -#[allow(clippy::needless_pass_by_value)] -fn exports_field(value: serde_json::Value) -> serde_json::Value { - value -} - -#[test] -fn test_cases() { - let test_cases = [ - TestCase { - name: "sample #1", - expect: Some(vec!["./dist/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/": { - "import": [ - "./dist/", - "./src/" - ], - "webpack": "./wp/" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "sample #1", - expect: Some(vec!["./src/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/": { - "import": [ - "./src/" - ], - "webpack": "./wp/" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - TestCase { - name: "sample #1 (wildcard)", - expect: Some(vec!["./dist/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/*": { - "import": [ - "./dist/*", - "./src/*" - ], - "webpack": "./wp/*" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "sample #1 (wildcard)", - expect: Some(vec!["./src/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/*": { - "import": [ - "./src/*" - ], - "webpack": "./wp/*" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - TestCase { - name: "sample #2", - expect: Some(vec!["./data/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./timezones/": "./data/timezones/" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #2 (wildcard)", - expect: Some(vec!["./data/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./timezones/*": "./data/timezones/*" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #3", - expect: Some(vec!["./data/timezones/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./": "./data/timezones/" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #3 (wildcard)", - expect: Some(vec!["./data/timezones/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./*": "./data/timezones/*.mjs" - })), - request: "./timezones/pdt", - condition_names: vec![], - }, - TestCase { - name: "sample #4", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./lib/": { - "browser": [ - "./browser/" - ] - }, - "./dist/index.js": { - "node": "./index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #4 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "node": "./index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #5", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/": { - "browser": [ - "./browser/" - ] - }, - "./dist/index.js": { - "node": "./index.js", - "default": "./browser/index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #5 (wildcard)", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "node": "./index.js", - "default": "./browser/index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./dist/a": "./dist/index.js" - })), - request: "./dist/aaa", - condition_names: vec![], - }, - TestCase { - name: "sample #7", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./dist/a/a/": "./dist/index.js" - })), - request: "./dist/a/a", - condition_names: vec![], - }, - TestCase { - name: "sample #7 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./dist/a/a/*": "./dist/index.js" - })), - request: "./dist/a/a", - condition_names: vec![], - }, - TestCase { - name: "sample #8", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": "./index.js" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #9", - expect: Some(vec!["./main.js"]), - exports_field: exports_field(json!({ - "./index.js": "./main.js" - })), - request: "./index.js", - condition_names: vec![], - }, - TestCase { - name: "sample #10", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #11", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./bar#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #12", - expect: Some(vec!["./ok.js#abc"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/ok.js#abc", - condition_names: vec![], - }, - TestCase { - name: "sample #12", - expect: Some(vec!["./ok.js#abc"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/ok.js#abc", - condition_names: vec![], - }, - TestCase { - name: "sample #13", - expect: Some(vec!["./ok.js?abc"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/ok.js?abc", - condition_names: vec![], - }, - TestCase { - name: "sample #14", - expect: Some(vec!["./🎉.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/🎉.js", - condition_names: vec![], - }, - TestCase { - name: "sample #15", - expect: Some(vec!["./%F0%9F%8E%89.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/%F0%9F%8E%89.js", - condition_names: vec![], - }, - TestCase { - name: "sample #16", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./🎉", - condition_names: vec![], - }, - TestCase { - name: "sample #17", - expect: Some(vec!["./other.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./%F0%9F%8E%89", - condition_names: vec![], - }, - TestCase { - name: "sample #18", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./module", - condition_names: vec![], - }, - TestCase { - name: "sample #19", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./module#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #20", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./module?foo", - condition_names: vec![], - }, - TestCase { - name: "sample #21", - expect: Some(vec!["./zizizi"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./z*z*z*" - })), - request: "./#zippi", - condition_names: vec![], - }, - TestCase { - name: "sample #22", - expect: Some(vec!["./d?e?f"]), - exports_field: exports_field(json!({ - "./a?b?c/": "./" - })), - request: "./a?b?c/d?e?f", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #1", - expect: Some(vec!["./dist/index.js"]), - exports_field: exports_field(json!({ - ".": "./dist/index.js" - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #2", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./": "./", - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #3", - expect: Some(vec!["./dist/a.js"]), - exports_field: exports_field(json!({ - "./dist/": "./dist/", - "./dist/*": "./dist/*", - "./dist*": "./dist*", - "./dist/index.js": "./dist/a.js" - })), - request: "./dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #4", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./": { - "browser": [ - "./browser/" - ] - }, - "./*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "browser": "./index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #5", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./": { - "browser": [ - "./browser/" - ] - }, - "./*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "node": "./node.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #6", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - ".": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #7", - expect: Some(vec!["./src/index.js"]), // `enhanced_resolve` is `None` - exports_field: exports_field(json!({ - ".": { - "default": "./src/index.js", - "browser": "./index.js", - "node": "./src/node/index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #8", - expect: Some(vec!["./src/index.js"]), - exports_field: exports_field(json!({ - ".": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #9", - expect: Some(vec!["./index"]), - exports_field: exports_field(json!({ - ".": "./index" - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #10", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./index": "./index.js" - })), - request: "./index", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #11", - expect: Some(vec!["./foo.js"]), - exports_field: exports_field(json!({ - "./": "./", - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #12", - expect: Some(vec!["./foo/bar/baz.js"]), - exports_field: exports_field(json!({ - "./": "./", - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo/bar/baz.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #13", - expect: Some(vec!["./foo/bar/baz.js"]), - exports_field: exports_field(json!({ - "./": "./", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo/bar/baz.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #14", - expect: Some(vec!["./foo/bar/baz.js"]), - exports_field: exports_field(json!({ - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo/bar/baz.js", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #1", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "require": "./require.js" - }, { - "import": "./import.mjs" - }] - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #2", - expect: Some(vec!["./import.mjs"]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "require": "./require.js" - }, { - "import": "./import.mjs" - }] - })), - request: ".", - condition_names: vec!["import"], - }, - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./require.js"]), - exports_field: exports_field(json!({ - ".": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./import.mjs"]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "import": "./import.mjs" - }] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./require.js"]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "require": [ - "./require.js" - ] - }, { - "import": [ - "./import.mjs", - "./import.js" - ] - }] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./import.mjs"]), - exports_field: exports_field(json!({ - ".": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "./import.mjs", - "./import.js" - ] - } - ] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./import.js"]), - exports_field: exports_field(json!({ - ".": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "./import.js" - ] - } - ] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "mapping to a folder root #1", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./timezones": "./data/timezones/" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #2", - expect: None, - exports_field: exports_field(json!({ - "./timezones/": "./data/timezones" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #3", - expect: Some(vec!["./data/timezones/pdt/index.mjs"]), - exports_field: exports_field(json!({ - "./timezones/pdt/": "./data/timezones/pdt/" - })), - request: "./timezones/pdt/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #3 (wildcard)", - expect: Some(vec!["./data/timezones/pdt/index.mjs"]), - exports_field: exports_field(json!({ - "./timezones/pdt/*": "./data/timezones/pdt/*" - })), - request: "./timezones/pdt/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #4", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./": "./timezones/" - })), - request: "./pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #4 (wildcard)", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./*": "./timezones/*" - })), - request: "./pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #5", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./": "./" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #5 (wildcard)", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./*": "./*" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #6", - expect: None, - exports_field: exports_field(json!({ - "./": "." - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #6 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "./*": "." - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #7", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": "./" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #7 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": "./*" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #1", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./": "./", - "./dist/": "./lib/" - })), - request: "./dist/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #1 (wildcard)", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./*": "./*", - "./dist/*": "./lib/*" - })), - request: "./dist/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #2", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/": "./dist/utils/", - "./dist/": "./lib/" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #2 (wildcard)", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/*": "./dist/utils/*", - "./dist/*": "./lib/*" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #3", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/index.js": "./dist/utils/index.js", - "./dist/utils/": "./dist/utils/index.mjs", - "./dist/": "./lib/" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #3 (wildcard)", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/index.js": "./dist/utils/index.js", - "./dist/utils/*": "./dist/utils/index.mjs", - "./dist/*": "./lib/*" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #4", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./": { - "browser": "./browser/" - }, - "./dist/": "./lib/" - })), - request: "./dist/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "the longest matching path prefix is prioritized #4 (wildcard)", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./*": { - "browser": "./browser/*" - }, - "./dist/*": "./lib/*" - })), - request: "./dist/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #1", - // `lodash/` does not start with './' so fallbacks to util - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "conditional mapping folder #1", - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": [ - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #1 (wildcard)", - // `lodash/` does not start with './' so fallbacks to util - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": [ - "lodash/*", - "./utils/*" - ], - "node": [ - "./utils-node/*" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "conditional mapping folder #1 (wildcard)", - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": [ - "./utils/*" - ], - "node": [ - "./utils-node/*" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #2", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./node/" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "conditional mapping folder #2 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "webpack": "./wpk/*", - "browser": [ - "lodash/*", - "./utils/*" - ], - "node": [ - "./node/*" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "conditional mapping folder #3", - expect: Some(vec!["./wpk/index.mjs"]), - exports_field: exports_field(json!({ - "./utils/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils/" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "conditional mapping folder #3 (wildcard)", - expect: Some(vec!["./wpk/index.mjs"]), - exports_field: exports_field(json!({ - "./utils/*": { - "webpack": "./wpk/*", - "browser": [ - "lodash/*", - "./utils/*" - ], - "node": [ - "./utils/*" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "incorrect exports field #1", - expect: None, - exports_field: exports_field(json!({ - "/utils/": "./a/" - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #2", - expect: None, - exports_field: exports_field(json!({ - "./utils/": "/a/" - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #3", - expect: None, - exports_field: exports_field(json!({ - "/utils/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #4", - expect: None, - exports_field: exports_field(json!({ - "./utils/": { - "browser": "/a/", - "default": "/b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #4 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "/a/", - "default": "/b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #5", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index": "./a/index.js" - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index.mjs": "./a/index.js" - })), - request: "./utils/index", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #7", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #8", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index.mjs": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - // Requests that are not `./` does not apply to `package_exports_resolve` - // TestCase { - // name: "incorrect request #1", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": "./a/" - // })), - // request: "/utils/index.mjs", - // condition_names: vec![], - // }, - // TestCase { - // name: "incorrect request #2", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": { - // "browser": "./a/", - // "default": "./b/" - // } - // })), - // request: "/utils/index.mjs", - // condition_names: vec!["browser"], - // }, - // TestCase { - // name: "incorrect request #3", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": { - // "browser": "./a/", - // "default": "./b/" - // } - // })), - // request: "../utils/index.mjs", - // condition_names: vec!["browser"], - // }, - // TestCase { - // name: "incorrect request #4", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": { - // "browser": "./a/", - // "default": "./b/" - // } - // })), - // request: "/utils/index.mjs/", - // condition_names: vec!["browser"], - // }, - TestCase { - name: "backtracking package base #1", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./../../utils/": "./dist/" - })), - request: "./../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #1 (wildcard)", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./../../utils/*": "./dist/*" - })), - request: "./../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #2", - expect: None, - exports_field: exports_field(json!({ - "../../utils/": "./dist/" - })), - request: "../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #2 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "../../utils/*": "./dist/*" - })), - request: "../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #3", - expect: None, - exports_field: exports_field(json!({ - "./utils/": "../src/" - })), - request: "./utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #3 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "./utils/*": "../src/*" - })), - request: "./utils/index", - condition_names: vec![], - }, - // enhanced-resolve does not handle backtracking here - // TestCase { - // name: "backtracking package base #4", - // expect: Some(vec!["./../src/index"]), - // exports_field: exports_field(json!({ - // "./utils/": "./../src/" - // })), - // request: "./utils/index", - // condition_names: vec![], - // }, - // TestCase { - // name: "backtracking package base #4 (wildcard)", - // expect: Some(vec!["./../src/index"]), - // exports_field: exports_field(json!({ - // "./utils/*": "./../src/*" - // })), - // request: "./utils/index", - // condition_names: vec![], - // }, - // TestCase { - // name: "backtracking package base #5", - // expect: Some(vec!["./src/../index.js"]), - // exports_field: exports_field(json!({ - // "./utils/index": "./src/../index.js" - // })), - // request: "./utils/index", - // condition_names: vec![], - // }, - TestCase { - name: "backtracking package base #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/../utils/index": "./src/../index.js" - })), - request: "./utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #7", - expect: None, - exports_field: exports_field(json!({ - "./utils/": { - "browser": "../this/" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #7", - expect: None, - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "../this/*" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #8", - // We throw "InvalidPackageTarget" - // expect: Some(vec!["./utils/../index"]), - expect: None, - exports_field: exports_field(json!({ - "./utils/": { - "browser": "./utils/../" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #8 (wildcard)", - // We throw "InvalidPackageTarget" - // expect: Some(vec!["./utils/../index"]), - expect: None, - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "./utils/../*" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #9", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./": "./src/../../", - "./dist/": "./dist/" - })), - request: "./dist/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #9 (wildcard)", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./*": "./src/../../*", - "./dist/*": "./dist/*" - })), - request: "./dist/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking target folder #1", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../../index"]), - exports_field: exports_field(json!({ - "./utils/": "./dist/" - })), - request: "./utils/timezone/../../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #1 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../../index"]), - exports_field: exports_field(json!({ - "./utils/*": "./dist/*" - })), - request: "./utils/timezone/../../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #2", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../index"]), - exports_field: exports_field(json!({ - "./utils/": "./dist/" - })), - request: "./utils/timezone/../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #2 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../index"]), - exports_field: exports_field(json!({ - "./utils/*": "./dist/*" - })), - request: "./utils/timezone/../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #3", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/target/../../index"]), - exports_field: exports_field(json!({ - "./utils/": "./dist/target/" - })), - request: "./utils/../../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #3 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/target/../../index"]), - exports_field: exports_field(json!({ - "./utils/*": "./dist/target/*" - })), - request: "./utils/../../index", - condition_names: vec![], - }, - // enhanced-resolve does not handle `node_modules` in target - TestCase { - name: "nested node_modules path #1", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": "./node_modules/" - } - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #1 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "./node_modules/*" - } - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #2", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./utils/../node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/": "./utils/../node_modules/" - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "nested node_modules path #2 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./utils/../node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": "./utils/../node_modules/*" - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "nested mapping #1", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": "./", - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested mapping #1 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": "./*", - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "nested mapping #2 (wildcard)", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #2 (wildcard)", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "nested mapping #3", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["webpack"], - }, - TestCase { - name: "nested mapping #3 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["webpack"], - }, - TestCase { - name: "nested mapping #4", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["node", "browser"], - }, - TestCase { - name: "nested mapping #4 (wildcard)", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["node", "browser"], - }, - TestCase { - name: "nested mapping #5", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node"], - }, - TestCase { - name: "nested mapping #5 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": { - "webpack": [ - "./wpck/*" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node"], - }, - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - TestCase { - name: "nested mapping #6 (wildcard)", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": { - "webpack": [ - "./wpck/*" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #6 (wildcard)", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./node/*" - ], - "default": { - "node": { - "webpack": [ - "./wpck/*" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - TestCase { - name: "nested mapping #7", - expect: Some(vec!["./y.js"]), - exports_field: exports_field(json!({ - "./a.js": { - "abc": { - "def": "./x.js" - }, - "ghi": "./y.js" - } - })), - request: "./a.js", - condition_names: vec!["abc", "ghi"], - }, - TestCase { - name: "nested mapping #8", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./a.js": { - "abc": { - "def": "./x.js", - "default": [] - }, - "ghi": "./y.js" - } - })), - request: "./a.js", - condition_names: vec!["abc", "ghi"], - }, - TestCase { - name: "syntax sugar #1", - expect: Some(vec!["./main.js"]), - exports_field: exports_field(json!("./main.js")), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #2", - expect: Some(vec![]), - exports_field: exports_field(json!("./main.js")), - request: "./lib.js", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #3", - expect: Some(vec!["./a.js"]), - exports_field: exports_field(json!(["./a.js", "./b.js"])), - request: ".", - condition_names: vec![], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "syntax sugar #3", - expect: Some(vec!["./b.js"]), - exports_field: exports_field(json!(["./b.js"])), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #4", - expect: Some(vec![]), - exports_field: exports_field(json!(["./a.js", "./b.js"])), - request: "./lib.js", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #5", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "browser": { - "default": "./index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "syntax sugar #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "browser": { - "default": "./index.js" - } - })), - request: "./lib.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "syntax sugar #7", - expect: None, - exports_field: exports_field(json!({ - "./node": "./node.js", - "browser": { - "default": "./index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "syntax sugar #8", - expect: None, - exports_field: exports_field(json!({ - "browser": { - "default": "./index.js" - }, - "./node": "./node.js" - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #1", - expect: Some(vec!["./abc/d"]), - exports_field: exports_field(json!({ - "./ab*": "./ab/*", - "./abc*": "./abc/*", - "./a*": "./a/*" - })), - request: "./abcd", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #2", - expect: Some(vec!["./abc/d/e"]), - exports_field: exports_field(json!({ - "./ab*": "./ab/*", - "./abc*": "./abc/*", - "./a*": "./a/*" - })), - request: "./abcd/e", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #3", - expect: Some(vec!["./abc/d"]), - exports_field: exports_field(json!({ - "./x/ab*": "./ab/*", - "./x/abc*": "./abc/*", - "./x/a*": "./a/*" - })), - request: "./x/abcd", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #4", - expect: Some(vec!["./abc/d/e"]), - exports_field: exports_field(json!({ - "./x/ab*": "./ab/*", - "./x/abc*": "./abc/*", - "./x/a*": "./a/*" - })), - request: "./x/abcd/e", - condition_names: vec!["browser"], - }, - TestCase { - name: "path tree edge case #1", - expect: Some(vec!["./A/b/d.js"]), - exports_field: exports_field(json!({ - "./a/": "./A/", - "./a/b/c": "./c.js" - })), - request: "./a/b/d.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #1 (wildcard)", - expect: Some(vec!["./A/b/d.js"]), - exports_field: exports_field(json!({ - "./a/*": "./A/*", - "./a/b/c": "./c.js" - })), - request: "./a/b/d.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #2", - expect: Some(vec!["./A/c.js"]), - exports_field: exports_field(json!({ - "./a/": "./A/", - "./a/b": "./b.js" - })), - request: "./a/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #2 (wildcard)", - expect: Some(vec!["./A/c.js"]), - exports_field: exports_field(json!({ - "./a/*": "./A/*", - "./a/b": "./b.js" - })), - request: "./a/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #3", - expect: Some(vec!["./A/b/d/c.js"]), - exports_field: exports_field(json!({ - "./a/": "./A/", - "./a/b/c/d": "./c.js" - })), - request: "./a/b/d/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #3 (wildcard)", - expect: Some(vec!["./A/b/d/c.js"]), - exports_field: exports_field(json!({ - "./a/*": "./A/*", - "./a/b/c/d": "./c.js" - })), - request: "./a/b/d/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #1", - expect: Some(vec!["./A/b.js"]), - exports_field: exports_field(json!({ - "./a/*.js": "./A/*.js" - })), - request: "./a/b.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #2", - expect: Some(vec!["./A/b/c.js"]), - exports_field: exports_field(json!({ - "./a/*.js": "./A/*.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #3", - expect: Some(vec!["./A/b/c.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": "./A/*/c.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #4", - expect: Some(vec!["./A/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": "./A/*/*.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #5", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/*.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #5", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/*.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./lib/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #6", - expect: Some(vec!["./browser/foo/bar.js"]), - exports_field: exports_field(json!({ - "./lib/*/bar.js": { - "browser": [ - "./browser/*/bar.js" - ] - }, - "./dist/*/bar.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./lib/foo/bar.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #6", - expect: Some(vec!["./browser/foo.js"]), - exports_field: exports_field(json!({ - "./lib/*/bar.js": { - "browser": [ - "./browser/*/bar.js" - ] - }, - "./dist/*/bar.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./dist/foo/bar.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #7", - expect: Some(vec!["./browser/foo/default.js"]), - exports_field: exports_field(json!({ - "./lib/*/bar.js": { - "browser": [ - "./browser/*/bar.js" - ] - }, - "./dist/*/bar.js": { - "node": "./*.js", - "default": "./browser/*/default.js" - } - })), - request: "./dist/foo/bar.js", - condition_names: vec!["default"], - }, - TestCase { - name: "wildcard pattern #8", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": "./A/*/*/*.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #9", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": [ - "./A/*/*/*.js", - "./B/*/*/*.js" - ] - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "wildcard pattern #9", - expect: Some(vec!["./B/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": [ - "./B/*/*/*.js" - ] - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #10", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/foo-*/c.js": "./A/*/*/*.js" - })), - request: "./a/foo-b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #11", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*-foo/c.js": "./A/*/*/*.js" - })), - request: "./a/b-foo/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #12", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/foo-*-foo/c.js": "./A/*/*/*.js" - })), - request: "./a/foo-b-foo/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #13", - expect: Some(vec!["./A/b/c/d.js"]), - exports_field: exports_field(json!({ - "./a/foo-*-foo/c.js": "./A/b/c/d.js" - })), - request: "./a/foo-b-foo/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #14", - expect: Some(vec!["./A/b/c/*.js"]), - exports_field: exports_field(json!({ - "./a/foo-foo/c.js": "./A/b/c/*.js" - })), - request: "./a/foo-foo/c.js", - condition_names: vec![], - }, - ]; - - for case in test_cases { - let resolved = Resolver::new(ResolveOptions { - condition_names: case - .condition_names - .iter() - .map(ToString::to_string) - .collect::>(), - ..ResolveOptions::default() - }) - .package_exports_resolve( - Path::new(""), - case.request, - &case.exports_field, - &mut Ctx::default(), - ) - .map(|p| p.map(|p| p.to_path_buf())); - if let Some(expect) = case.expect { - if expect.is_empty() { - assert!( - matches!(resolved, Err(ResolveError::PackagePathNotExported(_, _))), - "{} {:?}", - &case.name, - &resolved - ); - } else { - for expect in expect { - assert_eq!(resolved, Ok(Some(Path::new(expect).normalize())), "{}", &case.name); - } - } - } else { - assert!(resolved.is_err(), "{} {resolved:?}", &case.name); - } - } -} diff --git a/src/tests/extension_alias.rs b/src/tests/extension_alias.rs deleted file mode 100644 index 86afab73..00000000 --- a/src/tests/extension_alias.rs +++ /dev/null @@ -1,66 +0,0 @@ -//! - -use crate::{ResolveError, ResolveOptions, Resolver}; - -#[test] -fn extension_alias() { - let f = super::fixture().join("extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - extension_alias: vec![ - (".js".into(), vec![".ts".into(), ".js".into()]), - (".mjs".into(), vec![".mts".into()]), - ], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should alias fully specified file", f.clone(), "./index.js", f.join("index.ts")), - ("should alias fully specified file when there are two alternatives", f.clone(), "./dir/index.js", f.join("dir/index.ts")), - ("should also allow the second alternative", f.clone(), "./dir2/index.js", f.join("dir2/index.js")), - ("should support alias option without an array", f.clone(), "./dir2/index.mjs", f.join("dir2/index.mts")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } - - #[rustfmt::skip] - let fail = [ - ("should not allow to fallback to the original extension or add extensions", f, "./index.mjs"), - ]; - - for (comment, path, request) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!(resolution, Err(ResolveError::ExtensionAlias), "{comment} {path:?} {request}"); - } -} - -// should not apply extension alias to extensions or mainFiles field -#[test] -fn not_apply_to_extension_nor_main_files() { - let f = super::fixture().join("extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - extension_alias: vec![(".js".into(), vec![])], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("directory", f.clone(), "./dir2", "dir2/index.js"), - ("file", f.clone(), "./dir2/index", "dir2/index.js"), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - let expected = f.join(expected); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} diff --git a/src/tests/extensions.rs b/src/tests/extensions.rs deleted file mode 100644 index 1ebd86f4..00000000 --- a/src/tests/extensions.rs +++ /dev/null @@ -1,125 +0,0 @@ -//! - -use crate::{EnforceExtension, Resolution, ResolveContext, ResolveError, ResolveOptions, Resolver}; -use rustc_hash::FxHashSet; - -#[test] -fn extensions() { - let f = super::fixture().join("extensions"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".ts".into(), ".js".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve according to order of provided extensions", "./foo", "foo.ts"), - ("should resolve according to order of provided extensions (dir index)", "./dir", "dir/index.ts"), - ("should resolve according to main field in module root", ".", "index.js"), - // This is a core module - // ("should resolve single file module before directory", "module", "node_modules/module.js"), - ("should resolve trailing slash directory before single file", "module/", "node_modules/module/index.ts"), - ]; - - for (comment, request, expected_path) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - let expected = f.join(expected_path); - assert_eq!(resolved_path, Ok(expected), "{comment} {request} {expected_path}"); - } - - #[rustfmt::skip] - let fail = [ - ("not resolve to file when request has a trailing slash (relative)", "./foo.js/", "./foo.js/".into()) - ]; - - for (comment, request, expected_error) in fail { - let resolution = resolver.resolve(&f, request); - let error = ResolveError::NotFound(expected_error); - assert_eq!(resolution, Err(error), "{comment} {request} {resolution:?}"); - } -} - -// should default enforceExtension to true when extensions includes an empty string -#[test] -fn default_enforce_extension() { - let f = super::fixture().join("extensions"); - - let mut ctx = ResolveContext::default(); - let resolved = Resolver::new(ResolveOptions { - extensions: vec![".ts".into(), String::new(), ".js".into()], - ..ResolveOptions::default() - }) - .resolve_with_context(&f, "./foo", &mut ctx); - - assert_eq!(resolved.map(Resolution::into_path_buf), Ok(f.join("foo.ts"))); - assert_eq!( - ctx.file_dependencies, - FxHashSet::from_iter([f.join("foo.ts"), f.join("package.json")]) - ); - assert!(ctx.missing_dependencies.is_empty()); -} - -// should respect enforceExtension when extensions includes an empty string -#[test] -fn respect_enforce_extension() { - let f = super::fixture().join("extensions"); - - let mut ctx = ResolveContext::default(); - let resolved = Resolver::new(ResolveOptions { - enforce_extension: EnforceExtension::Disabled, - extensions: vec![".ts".into(), String::new(), ".js".into()], - ..ResolveOptions::default() - }) - .resolve_with_context(&f, "./foo", &mut ctx); - - assert_eq!(resolved.map(Resolution::into_path_buf), Ok(f.join("foo.ts"))); - assert_eq!( - ctx.file_dependencies, - FxHashSet::from_iter([f.join("foo.ts"), f.join("package.json")]) - ); - assert_eq!(ctx.missing_dependencies, FxHashSet::from_iter([f.join("foo")])); -} - -#[test] -fn multi_dot_extension() { - let f = super::fixture().join("extensions"); - - let resolver = Resolver::new(ResolveOptions { - // Test for `.d.ts`, not part of enhanced-resolve. - extensions: vec![".a.b.c".into(), ".d.ts".into(), ".ts".into(), ".js".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve according to order of provided extensions", "./foo", "foo.ts"), - ("should resolve file with extension", "./app.module", "app.module.js") - ]; - - for (comment, request, expected_path) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - let expected = f.join(expected_path); - assert_eq!(resolved_path, Ok(expected), "{comment} {request} {expected_path}"); - } - - #[rustfmt::skip] - let fail = [ - ("not resolve to file", "./index.", "./index.".into()) - ]; - - for (comment, request, expected_error) in fail { - let resolution = resolver.resolve(&f, request); - let error = ResolveError::NotFound(expected_error); - assert_eq!(resolution, Err(error), "{comment} {request} {resolution:?}"); - } -} - -#[test] -#[should_panic = "All extensions must start with a leading dot"] -fn without_leading_dot() { - Resolver::new(ResolveOptions { - extensions: vec!["ts".into(), "js".into()], - ..ResolveOptions::default() - }); -} diff --git a/src/tests/fallback.rs b/src/tests/fallback.rs deleted file mode 100644 index 3da2d767..00000000 --- a/src/tests/fallback.rs +++ /dev/null @@ -1,100 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/fallback.test.js - -#[test] -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -fn fallback() { - use super::memory_fs::MemoryFS; - use crate::{AliasValue, ResolveError, ResolveOptions, ResolverGeneric}; - use std::path::{Path, PathBuf}; - - let f = Path::new("/"); - - let file_system = MemoryFS::new(&[ - ("/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", ""), - ]); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - fallback: vec![ - ("aliasA".into(), vec![AliasValue::Path("a".into())]), - ("b$".into(), vec![AliasValue::Path("a/index".into())]), - ("c$".into(), vec![AliasValue::Path("/a/index".into())]), - ( - "multiAlias".into(), - vec![ - AliasValue::Path("b".into()), - AliasValue::Path("c".into()), - AliasValue::Path("d".into()), - AliasValue::Path("e".into()), - AliasValue::Path("a".into()), - ], - ), - ("recursive".into(), vec![AliasValue::Path("recursive/dir".into())]), - ("/d/dir".into(), vec![AliasValue::Path("/c/dir".into())]), - ("/d/index.js".into(), vec![AliasValue::Path("/c/index".into())]), - ("ignored".into(), vec![AliasValue::Ignore]), - ("node:path".into(), vec![AliasValue::Ignore]), - ], - modules: vec!["/".into()], - ..ResolveOptions::default() - }, - ); - - #[rustfmt::skip] - let pass = [ - ("should resolve a not aliased module 1", "a", "/a/index"), - ("should resolve a not aliased module 2", "a/index", "/a/index"), - ("should resolve a not aliased module 3", "a/dir", "/a/dir/index"), - ("should resolve a not aliased module 4", "a/dir/index", "/a/dir/index"), - ("should resolve an fallback module 1", "aliasA", "/a/index"), - ("should resolve an fallback module 2", "aliasA/index", "/a/index"), - ("should resolve an fallback module 3", "aliasA/dir", "/a/dir/index"), - ("should resolve an fallback module 4", "aliasA/dir/index", "/a/dir/index"), - ("should resolve a recursive aliased module 1", "recursive", "/recursive/index"), - ("should resolve a recursive aliased module 2", "recursive/index", "/recursive/index"), - ("should resolve a recursive aliased module 3", "recursive/dir", "/recursive/dir/index"), - ("should resolve a recursive aliased module 4", "recursive/dir/index", "/recursive/dir/index"), - ("should resolve a recursive aliased module 5", "recursive/file", "/recursive/dir/file"), - ("should resolve a file aliased module with a query 1", "b?query", "/b/index?query"), - ("should resolve a file aliased module with a query 2", "c?query", "/c/index?query"), - ("should resolve a path in a file aliased module 1", "b/index", "/b/index"), - ("should resolve a path in a file aliased module 2", "b/dir", "/b/dir/index"), - ("should resolve a path in a file aliased module 3", "b/dir/index", "/b/dir/index"), - ("should resolve a path in a file aliased module 4", "c/index", "/c/index"), - ("should resolve a path in a file aliased module 5", "c/dir", "/c/dir/index"), - ("should resolve a path in a file aliased module 6", "c/dir/index", "/c/dir/index"), - ("should resolve a file in multiple aliased dirs 1", "multiAlias/dir/file", "/e/dir/file"), - ("should resolve a file in multiple aliased dirs 2", "multiAlias/anotherDir", "/e/anotherDir/index"), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - - #[rustfmt::skip] - let ignore = [ - ("should resolve an ignore module", "ignored", ResolveError::Ignored(f.join("ignored"))), - ("should resolve node: builtin module", "node:path", ResolveError::Ignored(PathBuf::from("/node:path"))), - ]; - - for (comment, request, expected) in ignore { - let resolution = resolver.resolve(f, request); - assert_eq!(resolution, Err(expected), "{comment} {request}"); - } -} diff --git a/src/tests/full_specified.rs b/src/tests/full_specified.rs deleted file mode 100644 index a70c0191..00000000 --- a/src/tests/full_specified.rs +++ /dev/null @@ -1,113 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/fullSpecified.test.js - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows { - use std::path::PathBuf; - - use crate::{AliasValue, ResolveOptions, ResolverGeneric}; - - use super::super::memory_fs::MemoryFS; - - fn file_system() -> MemoryFS { - MemoryFS::new(&[ - ("/a/node_modules/package1/index.js", ""), - ("/a/node_modules/package1/file.js", ""), - ("/a/node_modules/package2/package.json", r#"{"main":"a"}"#), - ("/a/node_modules/package2/a.js", ""), - ("/a/node_modules/package3/package.json", r#"{"main":"dir"}"#), - ("/a/node_modules/package3/dir/index.js", ""), - ("/a/node_modules/package4/package.json", r#"{"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", ""), - ]) - } - - #[test] - fn test() { - let file_system = file_system(); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - alias: vec![ - ("alias1".into(), vec![AliasValue::from("/a/abc")]), - ("alias2".into(), vec![AliasValue::from("/a")]), - ], - alias_fields: vec![vec!["browser".into()]], - fully_specified: true, - ..ResolveOptions::default() - }, - ); - - let failing_resolves = [ - ("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"), - ]; - - for (comment, request) in failing_resolves { - let resolution = resolver.resolve("/a", request); - assert!(resolution.is_err(), "{comment} {request}"); - } - - let successful_resolves = [ - ("fully relative", "./abc.js", "/a/abc.js"), - ("fully absolute", "/a/abc.js", "/a/abc.js"), - ("fully relative in package", "package1/file.js", "/a/node_modules/package1/file.js"), - ("extensions in mainFiles", "package1", "/a/node_modules/package1/index.js"), - ("extensions in mainFields", "package2", "/a/node_modules/package2/a.js"), - ("extensions in alias", "alias1", "/a/abc.js"), - ("directories in alias", "alias2", "/a/index.js"), - ("directories in packages", "package3", "/a/node_modules/package3/dir/index.js"), - ("extensions in aliasFields", "package4/a.js", "/a/node_modules/package4/b.js"), - ]; - - for (comment, request, expected) in successful_resolves { - let resolution = resolver.resolve("/a", request).map(|r| r.full_path()); - assert_eq!(resolution, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - } - - #[test] - #[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. - fn resolve_to_context() { - let file_system = file_system(); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - alias: vec![ - ("alias1".into(), vec![AliasValue::from("/a/abc")]), - ("alias2".into(), vec![AliasValue::from("/a")]), - ], - alias_fields: vec![vec!["browser".into()]], - fully_specified: true, - resolve_to_context: true, - ..ResolveOptions::default() - }, - ); - - let successful_resolves = [ - ("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", "/a/node_modules/package3/dir"), - ]; - - for (comment, request, expected) in successful_resolves { - let resolution = resolver.resolve("/a", request).map(|r| r.full_path()); - assert_eq!(resolution, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - } -} diff --git a/src/tests/imports_field.rs b/src/tests/imports_field.rs deleted file mode 100644 index c928627a..00000000 --- a/src/tests/imports_field.rs +++ /dev/null @@ -1,1320 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/importsField.test.js -//! -//! The huge imports field test cases are at the bottom of this file. - -use serde_json::json; - -use crate::{Ctx, JSONMap, PathUtil, ResolveError, ResolveOptions, Resolver}; -use std::path::Path; - -#[test] -fn test_simple() { - let f = super::fixture().join("imports-field"); - let f2 = super::fixture().join("imports-exports-wildcard/node_modules/m/"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve using imports field instead of self-referencing", f.clone(), "#imports-field", f.join("b.js")), - ("should resolve using imports field instead of self-referencing for a subpath", f.join("dir"), "#imports-field", f.join("b.js")), - ("should resolve package #1", f.clone(), "#a/dist/main.js", f.join("node_modules/a/lib/lib2/main.js")), - ("should resolve package #3", f.clone(), "#ccc/index.js", f.join("node_modules/c/index.js")), - ("should resolve package #4", f.clone(), "#c", f.join("node_modules/c/index.js")), - ("should resolve with wildcard pattern", f2.clone(), "#internal/i.js", f2.join("src/internal/i.js")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } - - // Note added: - // * should resolve absolute path as an imports field target - // * should log the correct info - - #[rustfmt::skip] - let fail = [ - ("should disallow resolve out of package scope", f.clone(), "#b", ResolveError::InvalidPackageTarget("../b.js".to_string(), "#b".to_string(), f.join("package.json"))), - ("should resolve package #2", f.clone(), "#a", ResolveError::PackageImportNotDefined("#a".to_string(), f.join("package.json"))), - ]; - - for (comment, path, request, error) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!(resolution, Err(error), "{comment} {path:?} {request}"); - } -} - -#[test] -fn shared_resolvers() { - let f = super::fixture().join("imports-field"); - - // field name #1 - let resolver1 = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - imports_fields: vec![vec!["imports".into()]], - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - let resolved_path = resolver1.resolve(&f, "#imports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("b.js"))); - - // field name #2 - let resolver2 = resolver1.clone_with_options(ResolveOptions { - imports_fields: vec![vec!["other".into(), "imports".into()]], - ..ResolveOptions::default() - }); - - let resolved_path = resolver2.resolve(&f, "#b").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("a.js"))); -} - -// Small script for generating the test cases from enhanced_resolve -// for (c of testCases) { -// console.log("TestCase {") -// console.log(`name: ${JSON.stringify(c.name)},`) -// if (c.expect instanceof Error) { -// console.log(`expect: None,`) -// } else { -// console.log(`expect: Some(vec!${JSON.stringify(c.expect)}),`) -// } -// console.log(`imports_field: imports_field(json!(${JSON.stringify(c.suite[0], null, 2)})),`) -// console.log(`request: "${c.suite[1]}",`) -// console.log(`condition_names: vec!${JSON.stringify(c.suite[2])},`) -// console.log("},") -// } - -struct TestCase { - name: &'static str, - expect: Option>, - imports_field: JSONMap, - request: &'static str, - condition_names: Vec<&'static str>, -} - -#[allow(clippy::needless_pass_by_value)] -fn imports_field(value: serde_json::Value) -> JSONMap { - let s = serde_json::to_string(&value).unwrap(); - serde_json::from_str(&s).unwrap() -} - -#[test] -fn test_cases() { - let test_cases = [ - TestCase { - name: "sample #1", - expect: Some(vec!["./dist/test/file.js"]), - imports_field: imports_field(json!({ - "#abc/": { - "import": [ - "./dist/", - "./src/" - ], - "webpack": "./wp/" - }, - "#abc": "./main.js" - })), - request: "#abc/test/file.js", - condition_names: vec!["import", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "sample #1", - expect: Some(vec!["./src/test/file.js"]), - imports_field: imports_field(json!({ - "#abc/": { - "import": [ - "./src/" - ], - "webpack": "./wp/" - }, - "#abc": "./main.js" - })), - request: "#abc/test/file.js", - condition_names: vec!["import", "webpack"], - }, - TestCase { - name: "sample #2", - expect: Some(vec!["./data/timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#1/timezones/": "./data/timezones/" - })), - request: "#1/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #3", - expect: Some(vec!["./data/timezones/timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#aaa/": "./data/timezones/", - "#a/": "./data/timezones/" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #4", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/lib/": { - "browser": [ - "./browser/" - ] - }, - "#a/dist/index.js": { - "node": "./index.js" - } - })), - request: "#a/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #5", - expect: Some(vec!["./browser/index.js"]), - imports_field: imports_field(json!({ - "#a/lib/": { - "browser": [ - "./browser/" - ] - }, - "#a/dist/index.js": { - "node": "./index.js", - "default": "./browser/index.js" - } - })), - request: "#a/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #6", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/dist/a": "./dist/index.js" - })), - request: "#a/dist/aaa", - condition_names: vec![], - }, - TestCase { - name: "sample #7", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/a/a/": "./dist/index.js" - })), - request: "#a/a/a", - condition_names: vec![], - }, - TestCase { - name: "sample #8", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": "./index.js" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #9", - expect: Some(vec!["./main.js"]), - imports_field: imports_field(json!({ - "#a/index.js": "./main.js" - })), - request: "#a/index.js", - condition_names: vec![], - }, - TestCase { - name: "sample #10", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #11", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/bar#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #12", - expect: Some(vec!["./ok.js#abc"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/ok.js#abc", - condition_names: vec![], - }, - TestCase { - name: "sample #13", - expect: Some(vec!["./ok.js?abc"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/ok.js?abc", - condition_names: vec![], - }, - TestCase { - name: "sample #14", - expect: Some(vec!["./🎉.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/🎉.js", - condition_names: vec![], - }, - TestCase { - name: "sample #15", - expect: Some(vec!["./%F0%9F%8E%89.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/%F0%9F%8E%89.js", - condition_names: vec![], - }, - TestCase { - name: "sample #16", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/🎉", - condition_names: vec![], - }, - TestCase { - name: "sample #17", - expect: Some(vec!["./other.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/%F0%9F%8E%89", - condition_names: vec![], - }, - TestCase { - name: "sample #18", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/module", - condition_names: vec![], - }, - TestCase { - name: "sample #19", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/module#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #20", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/module?foo", - condition_names: vec![], - }, - TestCase { - name: "sample #21", - expect: Some(vec!["./d?e?f"]), - imports_field: imports_field(json!({ - "#a/a?b?c/": "./" - })), - request: "#a/a?b?c/d?e?f", - condition_names: vec![], - }, - TestCase { - name: "sample #22", - // We throw InvalidPackageTarget - expect: None, - // expect: Some(vec!["/user/a/index"]), - imports_field: imports_field(json!({ - "#a/": "/user/a/" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #1", - expect: Some(vec!["./A/b/d.js"]), - imports_field: imports_field(json!({ - "#a/": "./A/", - "#a/b/c": "./c.js" - })), - request: "#a/b/d.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #2", - expect: Some(vec!["./A/c.js"]), - imports_field: imports_field(json!({ - "#a/": "./A/", - "#a/b": "./b.js" - })), - request: "#a/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #3", - expect: Some(vec!["./A/b/c/d.js"]), - imports_field: imports_field(json!({ - "#a/": "./A/", - "#a/b/c/d": "./c.js" - })), - request: "#a/b/c/d.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #1", - expect: Some(vec!["./dist/index.js"]), - imports_field: imports_field(json!({ - "#a": "./dist/index.js" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #2", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": "./" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #3", - expect: Some(vec!["./dist/a.js"]), - imports_field: imports_field(json!({ - "#a/": "./dist/", - "#a/index.js": "./dist/a.js" - })), - request: "#a/index.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #4", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "./browser/" - ] - }, - "#a/index.js": { - "browser": "./index.js" - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #5", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "./browser/" - ] - }, - "#a/index.js": { - "node": "./node.js" - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #6", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: "#a", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #7", - expect: Some(vec!["./src/index.js"]), // `enhanced_resolve` is `None` - imports_field: imports_field(json!({ - "#a": { - "default": "./src/index.js", - "browser": "./index.js", - "node": "./src/node/index.js" - } - })), - request: "#a", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #8", - expect: Some(vec!["./src/index.js"]), - imports_field: imports_field(json!({ - "#a": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #9", - expect: Some(vec!["./index"]), - imports_field: imports_field(json!({ - "#a": "./index" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #10", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/index": "./index.js" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #11", - // We throw InvalidPackageTarget - // expect: Some(vec!["b"]), - expect: None, - imports_field: imports_field(json!({ - "#a": "b" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #12", - // We throw InvalidPackageTarget - // expect: Some(vec!["b/index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "b/" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #13", - // We throw InvalidPackageTarget - // expect: Some(vec!["b#anotherhashishere"]), - expect: None, - imports_field: imports_field(json!({ - "#a?q=a#hashishere": "b#anotherhashishere" - })), - request: "#a?q=a#hashishere", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #1", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #2", - expect: Some(vec!["./import.mjs"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec!["import"], - }, - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./require.js"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./import.mjs"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./require.js"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": [ - "./require.js" - ] - }, - { - "import": [ - "./import.mjs", - "#b/import.js" - ] - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./import.mjs"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "./import.mjs", - "#b/import.js" - ] - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "#b/import.js" - ] - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "mapping to a folder root #1", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#timezones": "./data/timezones/" - })), - request: "#timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #2", - expect: None, - imports_field: imports_field(json!({ - "#timezones/": "./data/timezones" - })), - request: "#timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #3", - expect: Some(vec!["./data/timezones/pdt/index.mjs"]), - imports_field: imports_field(json!({ - "#timezones/pdt/": "./data/timezones/pdt/" - })), - request: "#timezones/pdt/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #4", - expect: Some(vec!["./timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#a/": "./timezones/" - })), - request: "#a/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #5", - expect: Some(vec!["./timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#a/": "./" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #6", - expect: None, - imports_field: imports_field(json!({ - "#a/": "." - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #7", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": "./" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #1", - expect: Some(vec!["./lib/index.mjs"]), - imports_field: imports_field(json!({ - "#a/": "./", - "#a/dist/": "./lib/" - })), - request: "#a/dist/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #2", - expect: Some(vec!["./dist/utils/index.js"]), - imports_field: imports_field(json!({ - "#a/dist/utils/": "./dist/utils/", - "#a/dist/": "./lib/" - })), - request: "#a/dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #3", - expect: Some(vec!["./dist/utils/index.js"]), - imports_field: imports_field(json!({ - "#a/dist/utils/index.js": "./dist/utils/index.js", - "#a/dist/utils/": "./dist/utils/index.mjs", - "#a/dist/": "./lib/" - })), - request: "#a/dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #4", - expect: Some(vec!["./lib/index.mjs"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./browser/" - }, - "#a/dist/": "./lib/" - })), - request: "#a/dist/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #1", - // This behaves differently from enhanced_resolve, because `lodash/` is an an InvalidPackageConfig - // expect: Some(vec!["lodash/index.js"]), - expect: Some(vec!["./utils/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "conditional mapping folder #1", - expect: Some(vec!["./utils/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #2", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./node/" - ] - } - })), - request: "#a/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "conditional mapping folder #3", - expect: Some(vec!["./wpk/index.mjs"]), - imports_field: imports_field(json!({ - "#a/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils/" - ] - } - })), - request: "#a/index.mjs", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "incorrect exports field #1", - // We throw `PackageImportNotDefined` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "/utils/": "./a/" - })), - request: "#a/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #2", - // We throw `PackageImportNotDefined` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "/utils/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#a/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #3", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index": "./a/index.js" - })), - request: "#a/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #4", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index.mjs": "./a/index.js" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #5", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "#a/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #6", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index.mjs": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "#a/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #1", - // We don't throw in `package_imports_exports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": "./a/" - })), - request: "/utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect request #2", - // We don't throw in `package_imports_exports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #3", - // We don't throw in `package_imports_exports_resolve`, it's thrown in `package_imports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #4", - // We don't throw in `package_imports_exports_resolve`, it's thrown in `package_imports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#/", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #5", - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#a/", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #1", - // expect: Some(vec!["./dist/index"]), - expect: Some(vec!["dist/index"]), - imports_field: imports_field(json!({ - "#a/../../utils/": "./dist/" - })), - request: "#a/../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #2", - // We throw InvalidPackageTarget - // expect: Some(vec!["./dist/../../utils/index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "./dist/" - })), - request: "#a/../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #3", - // We throw InvalidPackageTarget - // expect: Some(vec!["../src/index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "../src/" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #4", - // We throw InvalidPackageTarget - // expect: Some(vec!["./utils/../../../index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": { - "browser": "./utils/../../../" - } - })), - request: "#a/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #1", - // expect: Some(vec!["moment/node_modules/lodash/dist/index.js"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": { - "browser": "moment/node_modules/" - } - })), - request: "#a/lodash/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #2", - // We throw InvalidPackageTarget - // expect: Some(vec!["../node_modules/lodash/dist/index.js"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "../node_modules/" - })), - request: "#a/lodash/dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "nested mapping #1", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": "./", - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./node/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "nested mapping #3", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["webpack"], - }, - TestCase { - name: "nested mapping #4", - // We throw NotFound - // expect: Some(vec!["moment/node/index.js"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "moment/node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["node", "browser"], - }, - TestCase { - name: "nested mapping #5", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "node"], - }, - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./node/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - TestCase { - name: "nested mapping #7", - expect: Some(vec!["./y.js"]), - imports_field: imports_field(json!({ - "#a": { - "abc": { - "def": "./x.js" - }, - "ghi": "./y.js" - } - })), - request: "#a", - condition_names: vec!["abc", "ghi"], - }, - TestCase { - name: "nested mapping #8", - // We throw PackageImportNotDefined - // expect: Some(vec![]), - expect: None, - imports_field: imports_field(json!({ - "#a": { - "abc": { - "def": "./x.js", - "default": [] - }, - "ghi": "./y.js" - } - })), - request: "#a", - condition_names: vec!["abc", "ghi"], - }, - ]; - - for case in test_cases { - let resolved = Resolver::default() - .package_imports_exports_resolve( - case.request, - &case.imports_field, - Path::new(""), - true, - &case.condition_names.iter().map(ToString::to_string).collect::>(), - &mut Ctx::default(), - ) - .map(|p| p.map(|p| p.to_path_buf())); - if let Some(expect) = case.expect { - if expect.is_empty() { - assert!(matches!(resolved, Ok(None)), "{} {:?}", &case.name, &resolved); - } else { - for expect in expect { - assert_eq!(resolved, Ok(Some(Path::new(expect).normalize())), "{}", &case.name); - } - } - } else { - assert!(resolved.is_err(), "{} {resolved:?}", &case.name); - } - } -} diff --git a/src/tests/incorrect_description_file.rs b/src/tests/incorrect_description_file.rs deleted file mode 100644 index a5c81796..00000000 --- a/src/tests/incorrect_description_file.rs +++ /dev/null @@ -1,62 +0,0 @@ -//! - -use rustc_hash::FxHashSet; - -use crate::{JSONError, Resolution, ResolveContext, ResolveError, ResolveOptions, Resolver}; - -// should not resolve main in incorrect description file #1 -#[test] -fn incorrect_description_file_1() { - let f = super::fixture().join("incorrect-package"); - let mut ctx = ResolveContext::default(); - let resolution = Resolver::default().resolve_with_context(f.join("pack1"), ".", &mut ctx); - let error = ResolveError::JSON(JSONError { - path: f.join("pack1/package.json"), - message: String::from("EOF while parsing a value at line 3 column 0"), - line: 3, - column: 0, - }); - assert_eq!(resolution, Err(error)); - assert_eq!(ctx.file_dependencies, FxHashSet::from_iter([f.join("pack1/package.json")])); - assert!(ctx.missing_dependencies.is_empty()); -} - -// should not resolve main in incorrect description file #2 -#[test] -fn incorrect_description_file_2() { - let f = super::fixture().join("incorrect-package"); - let resolution = Resolver::default().resolve(f.join("pack2"), "."); - let error = ResolveError::JSON(JSONError { - path: f.join("pack2/package.json"), - message: String::from("EOF while parsing a value at line 1 column 0"), - line: 1, - column: 0, - }); - assert_eq!(resolution, Err(error)); -} - -// should not resolve main in incorrect description file #3 -#[test] -fn incorrect_description_file_3() { - let f = super::fixture().join("incorrect-package"); - let resolution = Resolver::default().resolve(f.join("pack2"), "."); - assert!(resolution.is_err()); -} - -// `enhanced_resolve` does not have this test case -#[test] -fn no_description_file() { - let f = super::fixture_root().join("enhanced_resolve"); - - // has description file - let resolver = Resolver::default(); - assert_eq!( - resolver.resolve(&f, ".").map(Resolution::into_path_buf), - Ok(f.join("lib/index.js")) - ); - - // without description file - let resolver = - Resolver::new(ResolveOptions { description_files: vec![], ..ResolveOptions::default() }); - assert_eq!(resolver.resolve(&f, "."), Err(ResolveError::NotFound(".".into()))); -} diff --git a/src/tests/main_field.rs b/src/tests/main_field.rs deleted file mode 100644 index 3cadc8ce..00000000 --- a/src/tests/main_field.rs +++ /dev/null @@ -1,24 +0,0 @@ -//! Not part of enhanced_resolve's test suite - -use crate::{ResolveOptions, Resolver}; - -#[test] -fn test() { - let f = super::fixture().join("restrictions"); - - let resolver1 = Resolver::new(ResolveOptions { - main_fields: vec!["style".into()], - ..ResolveOptions::default() - }); - - let resolution = resolver1.resolve(&f, "pck2").map(|r| r.full_path()); - assert_eq!(resolution, Ok(f.join("node_modules/pck2/index.css"))); - - let resolver2 = resolver1.clone_with_options(ResolveOptions { - main_fields: vec!["module".into(), "main".into()], - ..ResolveOptions::default() - }); - - let resolution = resolver2.resolve(&f, "pck2").map(|r| r.full_path()); - assert_eq!(resolution, Ok(f.join("node_modules/pck2/module.js"))); -} diff --git a/src/tests/memory_fs.rs b/src/tests/memory_fs.rs deleted file mode 100644 index e4116609..00000000 --- a/src/tests/memory_fs.rs +++ /dev/null @@ -1,74 +0,0 @@ -use std::{ - io, - path::{Path, PathBuf}, -}; - -use crate::{FileMetadata, FileSystem}; - -#[derive(Default)] -pub struct MemoryFS { - fs: vfs::MemoryFS, -} - -impl MemoryFS { - /// # Panics - /// - /// * Fails to create directory - /// * Fails to write file - #[allow(dead_code)] - pub fn new(data: &[(&'static str, &'static str)]) -> Self { - let mut fs = Self { fs: vfs::MemoryFS::default() }; - for (path, content) in data { - fs.add_file(Path::new(path), content); - } - fs - } - - #[allow(dead_code)] - pub fn add_file(&mut self, path: &Path, content: &str) { - use vfs::FileSystem; - let fs = &mut self.fs; - // Create all parent directories - for path in path.ancestors().collect::>().iter().rev() { - let path = path.to_string_lossy(); - if !fs.exists(path.as_ref()).unwrap() { - fs.create_dir(path.as_ref()).unwrap(); - } - } - // Create file - let mut file = fs.create_file(path.to_string_lossy().as_ref()).unwrap(); - file.write_all(content.as_bytes()).unwrap(); - } -} - -impl FileSystem for MemoryFS { - fn read_to_string(&self, path: &Path) -> io::Result { - use vfs::FileSystem; - let mut file = self - .fs - .open_file(path.to_string_lossy().as_ref()) - .map_err(|err| io::Error::new(io::ErrorKind::NotFound, err))?; - let mut buffer = String::new(); - file.read_to_string(&mut buffer).unwrap(); - Ok(buffer) - } - - fn metadata(&self, path: &Path) -> io::Result { - use vfs::FileSystem; - let metadata = self - .fs - .metadata(path.to_string_lossy().as_ref()) - .map_err(|err| io::Error::new(io::ErrorKind::NotFound, err))?; - let is_file = metadata.file_type == vfs::VfsFileType::File; - let is_dir = metadata.file_type == vfs::VfsFileType::Directory; - Ok(FileMetadata::new(is_file, is_dir, false)) - } - - fn symlink_metadata(&self, path: &Path) -> io::Result { - self.metadata(path) - } - - fn canonicalize(&self, _path: &Path) -> io::Result { - Err(io::Error::new(io::ErrorKind::NotFound, "not a symlink")) - } -} diff --git a/src/tests/missing.rs b/src/tests/missing.rs deleted file mode 100644 index 4bf611ef..00000000 --- a/src/tests/missing.rs +++ /dev/null @@ -1,106 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/missing.test.js - -use normalize_path::NormalizePath; - -use crate::{AliasValue, ResolveContext, ResolveOptions, Resolver}; - -#[test] -fn test() { - let f = super::fixture(); - - let data = [ - ( - "./missing-file", - vec![f.join("missing-file"), f.join("missing-file.js"), f.join("missing-file.node")], - ), - ( - "missing-module", - vec![ - f.join("node_modules/missing-module"), - f.parent().unwrap().join("node_modules"), // enhanced-resolve is "node_modules/missing-module" - ], - ), - ( - "missing-module/missing-file", - vec![ - f.join("node_modules/missing-module"), - // f.parent().unwrap().join("node_modules/missing-module"), // we don't report this - ], - ), - ( - "m1/missing-file", - vec![ - f.join("node_modules/m1/missing-file"), - f.join("node_modules/m1/missing-file.js"), - f.join("node_modules/m1/missing-file.node"), - // f.parent().unwrap().join("node_modules/m1"), // we don't report this - ], - ), - ( - "m1/", - vec![ - f.join("node_modules/m1/index"), - f.join("node_modules/m1/index.js"), - f.join("node_modules/m1/index.json"), - f.join("node_modules/m1/index.node"), - ], - ), - ("m1/a", vec![f.join("node_modules/m1/a")]), - ]; - - let resolver = Resolver::default(); - - for (specifier, missing_dependencies) in data { - let mut ctx = ResolveContext::default(); - let _ = resolver.resolve_with_context(&f, specifier, &mut ctx); - - for path in ctx.file_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - } - - for path in missing_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - assert!( - ctx.missing_dependencies.contains(&path), - "{specifier}: {path:?} not in {:?}", - &ctx.missing_dependencies - ); - } - } -} - -#[test] -fn alias_and_extensions() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias: vec![ - ( - "@scope-js/package-name/dir$".into(), - vec![AliasValue::Path(f.join("foo/index.js").to_string_lossy().to_string())], - ), - ( - "react-dom".into(), - vec![AliasValue::Path(f.join("foo/index.js").to_string_lossy().to_string())], - ), - ], - extensions: vec![".server.ts".into()], - - ..ResolveOptions::default() - }); - - let mut ctx = ResolveContext::default(); - let _ = resolver.resolve_with_context(&f, "@scope-js/package-name/dir/router", &mut ctx); - let _ = resolver.resolve_with_context(&f, "react-dom/client", &mut ctx); - - for path in ctx.file_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - } - - for path in ctx.missing_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - if let Some(path) = path.parent() { - assert!(!path.is_file(), "{path:?} must not be a file"); - } - } -} diff --git a/src/tests/mod.rs b/src/tests/mod.rs deleted file mode 100644 index 94e6bd86..00000000 --- a/src/tests/mod.rs +++ /dev/null @@ -1,49 +0,0 @@ -mod alias; -mod browser_field; -mod builtins; -mod dependencies; -mod exports_field; -mod extension_alias; -mod extensions; -mod fallback; -mod full_specified; -mod imports_field; -mod incorrect_description_file; -mod main_field; -mod memory_fs; -mod missing; -mod resolve; -mod restrictions; -mod roots; -mod scoped_packages; -mod simple; -mod symlink; -mod tsconfig_paths; -mod tsconfig_project_references; - -use crate::Resolver; -use std::{env, path::PathBuf, sync::Arc, thread}; - -pub fn fixture_root() -> PathBuf { - env::current_dir().unwrap().join("fixtures") -} - -pub fn fixture() -> PathBuf { - fixture_root().join("enhanced_resolve").join("test").join("fixtures") -} - -#[test] -fn threaded_environment() { - let cwd = env::current_dir().unwrap(); - let resolver = Arc::new(Resolver::default()); - for _ in 0..2 { - _ = thread::spawn({ - let cwd = cwd.clone(); - let resolver = Arc::clone(&resolver); - move || { - _ = resolver.resolve(cwd, "."); - } - }) - .join(); - } -} diff --git a/src/tests/resolve.rs b/src/tests/resolve.rs deleted file mode 100644 index f2dbb88e..00000000 --- a/src/tests/resolve.rs +++ /dev/null @@ -1,119 +0,0 @@ -//! - -use crate::{ResolveError, ResolveOptions, Resolver}; - -#[test] -fn resolve() { - let f = super::fixture(); - - let resolver = Resolver::default(); - - let main1_js_path = f.join("main1.js").to_string_lossy().to_string(); - - #[rustfmt::skip] - let pass = [ - ("absolute path", f.clone(), main1_js_path.as_str(), f.join("main1.js")), - ("file with .js", f.clone(), "./main1.js", f.join("main1.js")), - ("file without extension", f.clone(), "./main1", f.join("main1.js")), - ("another file with .js", f.clone(), "./a.js", f.join("a.js")), - ("another file without extension", f.clone(), "./a", f.join("a.js")), - ("file in module with .js", f.clone(), "m1/a.js", f.join("node_modules/m1/a.js")), - ("file in module without extension", f.clone(), "m1/a", f.join("node_modules/m1/a.js")), - ("another file in module without extension", f.clone(), "complexm/step1", f.join("node_modules/complexm/step1.js")), - ("from submodule to file in sibling module", f.join("node_modules/complexm"), "m2/b.js", f.join("node_modules/m2/b.js")), - ("from nested directory to overwritten file in module", f.join("multiple_modules"), "m1/a.js", f.join("multiple_modules/node_modules/m1/a.js")), - ("from nested directory to not overwritten file in module", f.join("multiple_modules"), "m1/b.js", f.join("node_modules/m1/b.js")), - ("file with query", f.clone(), "./main1.js?query", f.join("main1.js?query")), - ("file with fragment", f.clone(), "./main1.js#fragment", f.join("main1.js#fragment")), - ("file with fragment and query", f.clone(), "./main1.js#fragment?query", f.join("main1.js#fragment?query")), - ("file with query and fragment", f.clone(), "./main1.js?#fragment", f.join("main1.js?#fragment")), - - ("file with query (unicode)", f.clone(), "./测试.js?query", f.join("测试.js?query")), - ("file with fragment (unicode)", f.clone(), "./测试.js#fragment", f.join("测试.js#fragment")), - ("file with fragment and query (unicode)", f.clone(), "./测试.js#fragment?query", f.join("测试.js#fragment?query")), - ("file with query and fragment (unicode)", f.clone(), "./测试.js?#fragment", f.join("测试.js?#fragment")), - - ("file in module with query", f.clone(), "m1/a?query", f.join("node_modules/m1/a.js?query")), - ("file in module with fragment", f.clone(), "m1/a#fragment", f.join("node_modules/m1/a.js#fragment")), - ("file in module with fragment and query", f.clone(), "m1/a#fragment?query", f.join("node_modules/m1/a.js#fragment?query")), - ("file in module with query and fragment", f.clone(), "m1/a?#fragment", f.join("node_modules/m1/a.js?#fragment")), - ("file in module with query and fragment", f.clone(), "m1/a?#fragment", f.join("node_modules/m1/a.js?#fragment")), - ("differ between directory and file, resolve file", f.clone(), "./dirOrFile", f.join("dirOrFile.js")), - ("differ between directory and file, resolve directory", f.clone(), "./dirOrFile/", f.join("dirOrFile/index.js")), - ("find node_modules outside of node_modules", f.join("browser-module/node_modules"), "m1/a", f.join("node_modules/m1/a.js")), - ("don't crash on main field pointing to self", f.clone(), "./main-field-self", f.join("./main-field-self/index.js")), - ("don't crash on main field pointing to self (2)", f.clone(), "./main-field-self2", f.join("./main-field-self2/index.js")), - // enhanced-resolve has `#` prepended with a `\0`, they are removed from the - // following 3 expected test results. - // See https://github.com/webpack/enhanced-resolve#escaping - ("handle fragment edge case (no fragment)", f.clone(), "./no#fragment/#/#", f.join("no#fragment/#/#.js")), - ("handle fragment edge case (fragment)", f.clone(), "./no#fragment/#/", f.join("no.js#fragment/#/")), - ("handle fragment escaping", f.clone(), "./no\0#fragment/\0#/\0##fragment", f.join("no#fragment/#/#.js#fragment")), - - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn issue238_resolve() { - let f = super::fixture().join("issue-238"); - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into(), ".jsx".into(), ".ts".into(), ".tsx".into()], - modules: vec!["src/a".into(), "src/b".into(), "src/common".into(), "node_modules".into()], - ..ResolveOptions::default() - }); - let resolved_path = - resolver.resolve(f.join("src/common"), "config/myObjectFile").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("src/common/config/myObjectFile.js")),); -} - -#[test] -fn prefer_relative() { - let f = super::fixture(); - - let resolver = - Resolver::new(ResolveOptions { prefer_relative: true, ..ResolveOptions::default() }); - - #[rustfmt::skip] - let pass = [ - ("should correctly resolve with preferRelative 1", "main1.js", f.join("main1.js")), - ("should correctly resolve with preferRelative 2", "m1/a.js", f.join("node_modules/m1/a.js")), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } -} - -#[test] -fn resolve_to_context() { - let f = super::fixture(); - let resolver = - Resolver::new(ResolveOptions { resolve_to_context: true, ..ResolveOptions::default() }); - - #[rustfmt::skip] - let data = [ - ("context for fixtures", f.clone(), "./", f.clone()), - ("context for fixtures/lib", f.clone(), "./lib", f.join("lib")), - ("context for fixtures with ..", f.clone(), "./lib/../../fixtures/./lib/..", f.clone()), - ("context for fixtures with query", f.clone(), "./?query", f.clone().with_file_name("fixtures?query")), - ]; - - for (comment, path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn resolve_hash_as_module() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions::default()); - let resolution = resolver.resolve(f, "#a"); - assert_eq!(resolution, Err(ResolveError::NotFound("#a".into()))); -} diff --git a/src/tests/restrictions.rs b/src/tests/restrictions.rs deleted file mode 100644 index 5ba56596..00000000 --- a/src/tests/restrictions.rs +++ /dev/null @@ -1,25 +0,0 @@ -//! - -use crate::{ResolveError, ResolveOptions, Resolver, Restriction}; - -// TODO: regex -// * should respect RegExp restriction -// * should try to find alternative #1 -// * should try to find alternative #2 -// * should try to find alternative #3 - -// should respect string restriction -#[test] -fn restriction1() { - let fixture = super::fixture(); - let f = fixture.join("restrictions"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - restrictions: vec![Restriction::Path(f.clone())], - ..ResolveOptions::default() - }); - - let resolution = resolver.resolve(&f, "pck2"); - assert_eq!(resolution, Err(ResolveError::Restriction(fixture.join("c.js"), f))); -} diff --git a/src/tests/roots.rs b/src/tests/roots.rs deleted file mode 100644 index b50e2a07..00000000 --- a/src/tests/roots.rs +++ /dev/null @@ -1,92 +0,0 @@ -//! - -use std::path::PathBuf; - -use crate::{AliasValue, ResolveError, ResolveOptions, Resolver}; - -fn dirname() -> PathBuf { - super::fixture_root().join("enhanced_resolve").join("test") -} - -#[test] -fn roots() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - alias: vec![("foo".into(), vec![AliasValue::from("/fixtures")])], - roots: vec![dirname(), f.clone()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should respect roots option", "/fixtures/b.js", f.join("b.js")), - ("should try another root option, if it exists", "/b.js", f.join("b.js")), - ("should respect extension", "/fixtures/b", f.join("b.js")), - ("should resolve in directory", "/fixtures/extensions/dir", f.join("extensions/dir/index.js")), - ("should respect aliases", "foo/b", f.join("b.js")), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } - - #[rustfmt::skip] - let fail = [ - ("should not work with relative path", "fixtures/b.js", ResolveError::NotFound("fixtures/b.js".into())) - ]; - - for (comment, request, expected) in fail { - let resolution = resolver.resolve(&f, request); - assert_eq!(resolution, Err(expected), "{comment} {request}"); - } -} - -#[test] -fn resolve_to_context() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - roots: vec![dirname(), f.clone()], - resolve_to_context: true, - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f, "/fixtures/lib").map(|r| r.full_path()); - let expected = f.join("lib"); - assert_eq!(resolved_path, Ok(expected)); -} - -#[test] -fn prefer_absolute() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - alias: vec![("foo".into(), vec![AliasValue::from("/fixtures")])], - roots: vec![dirname(), f.clone()], - prefer_absolute: true, - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve an absolute path (prefer absolute)", f.join("b.js").to_string_lossy().to_string(), f.join("b.js")), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(&f, &request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } -} - -#[test] -fn roots_fall_through() { - let f = super::fixture(); - let absolute_path = f.join("roots_fall_through/index.js"); - let specifier = absolute_path.to_string_lossy(); - let resolution = Resolver::new(ResolveOptions::default().with_root(&f)).resolve(&f, &specifier); - assert_eq!( - resolution.map(super::super::resolution::Resolution::into_path_buf), - Ok(absolute_path) - ); -} diff --git a/src/tests/scoped_packages.rs b/src/tests/scoped_packages.rs deleted file mode 100644 index 8258f00f..00000000 --- a/src/tests/scoped_packages.rs +++ /dev/null @@ -1,25 +0,0 @@ -//! - -use crate::{ResolveOptions, Resolver}; - -#[test] -fn scoped_packages() { - let f = super::fixture().join("scoped"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("main field should work", f.clone(), "@scope/pack1", f.join("./node_modules/@scope/pack1/main.js")), - ("browser field should work", f.clone(), "@scope/pack2", f.join("./node_modules/@scope/pack2/main.js")), - ("folder request should work", f.clone(), "@scope/pack2/lib", f.join("./node_modules/@scope/pack2/lib/index.js")) - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} diff --git a/src/tests/simple.rs b/src/tests/simple.rs deleted file mode 100644 index 08e1238a..00000000 --- a/src/tests/simple.rs +++ /dev/null @@ -1,68 +0,0 @@ -//! - -use std::env; - -use crate::Resolver; - -#[test] -fn simple() { - // mimic `enhanced-resolve/test/simple.test.js` - let dirname = env::current_dir().unwrap().join("fixtures"); - let f = dirname.join("enhanced_resolve/test"); - - let resolver = Resolver::default(); - - let data = [ - ("direct", f.clone(), "../lib/index"), - ("as directory", f, ".."), - ("as module", dirname.clone(), "./enhanced_resolve"), - ]; - - for (comment, path, request) in data { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - let expected = dirname.join("enhanced_resolve/lib/index.js"); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn dashed_name() { - let f = super::fixture(); - - let resolver = Resolver::default(); - - let data = [ - (f.clone(), "dash", f.join("node_modules/dash/index.js")), - (f.clone(), "dash-name", f.join("node_modules/dash-name/index.js")), - (f.join("node_modules/dash"), "dash", f.join("node_modules/dash/index.js")), - (f.join("node_modules/dash"), "dash-name", f.join("node_modules/dash-name/index.js")), - (f.join("node_modules/dash-name"), "dash", f.join("node_modules/dash/index.js")), - (f.join("node_modules/dash-name"), "dash-name", f.join("node_modules/dash-name/index.js")), - ]; - - for (path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{path:?} {request}"); - } -} - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows { - use super::super::memory_fs::MemoryFS; - - use crate::ResolveOptions; - - #[test] - fn no_package() { - use crate::ResolverGeneric; - use std::path::Path; - let f = Path::new("/"); - let file_system = MemoryFS::new(&[]); - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions::default(), - ); - let resolved_path = resolver.resolve(f, "package"); - assert!(resolved_path.is_err()); - } -} diff --git a/src/tests/symlink.rs b/src/tests/symlink.rs deleted file mode 100644 index 7589b560..00000000 --- a/src/tests/symlink.rs +++ /dev/null @@ -1,121 +0,0 @@ -use std::{fs, io, path::Path}; - -use crate::{ResolveOptions, Resolver}; - -#[derive(Debug, Clone, Copy)] -enum FileType { - File, - Dir, -} - -#[allow(unused_variables)] -fn symlink, Q: AsRef>( - original: P, - link: Q, - file_type: FileType, -) -> io::Result<()> { - #[cfg(target_family = "unix")] - { - std::os::unix::fs::symlink(original, link) - } - - #[cfg(target_family = "windows")] - match file_type { - FileType::File => std::os::windows::fs::symlink_file(original, link), - FileType::Dir => std::os::windows::fs::symlink_dir(original, link), - } -} - -fn init(dirname: &Path, temp_path: &Path) -> io::Result<()> { - if temp_path.exists() { - _ = fs::remove_dir_all(temp_path); - } - fs::create_dir(temp_path)?; - symlink(dirname.join("../lib/index.js"), temp_path.join("test"), FileType::File)?; - symlink(dirname.join("../lib"), temp_path.join("test2"), FileType::Dir)?; - fs::remove_file(temp_path.join("test"))?; - fs::remove_file(temp_path.join("test2"))?; - fs::remove_dir(temp_path) -} - -fn create_symlinks(dirname: &Path, temp_path: &Path) -> io::Result<()> { - fs::create_dir(temp_path).unwrap(); - symlink( - dirname.join("../lib/index.js").canonicalize().unwrap(), - temp_path.join("index.js"), - FileType::File, - )?; - symlink(dirname.join("../lib").canonicalize().unwrap(), temp_path.join("lib"), FileType::Dir)?; - symlink(dirname.join("..").canonicalize().unwrap(), temp_path.join("this"), FileType::Dir)?; - symlink(temp_path.join("this"), temp_path.join("that"), FileType::Dir)?; - symlink(Path::new("../../lib/index.js"), temp_path.join("node.relative.js"), FileType::File)?; - symlink( - Path::new("./node.relative.js"), - temp_path.join("node.relative.sym.js"), - FileType::File, - )?; - Ok(()) -} - -fn cleanup_symlinks(temp_path: &Path) { - _ = fs::remove_dir_all(temp_path); -} - -#[test] -fn test() -> io::Result<()> { - let root = super::fixture_root().join("enhanced_resolve"); - let dirname = root.join("test"); - let temp_path = dirname.join("temp"); - if !temp_path.exists() { - let is_admin = init(&dirname, &temp_path).is_ok(); - if !is_admin { - return Ok(()); - } - if let Err(err) = create_symlinks(&dirname, &temp_path) { - cleanup_symlinks(&temp_path); - return Err(err); - } - } - - let resolver_without_symlinks = - Resolver::new(ResolveOptions { symlinks: false, ..ResolveOptions::default() }); - let resolver_with_symlinks = Resolver::default(); - - #[rustfmt::skip] - let pass = [ - ("with a symlink to a file", temp_path.clone(), "./index.js"), - ("with a relative symlink to a file", temp_path.clone(), "./node.relative.js"), - ("with a relative symlink to a symlink to a file", temp_path.clone(), "./node.relative.sym.js"), - ("with a symlink to a directory 1", temp_path.clone(), "./lib/index.js"), - ("with a symlink to a directory 2", temp_path.clone(), "./this/lib/index.js"), - ("with multiple symlinks in the path 1", temp_path.clone(), "./this/test/temp/index.js"), - ("with multiple symlinks in the path 2", temp_path.clone(), "./this/test/temp/lib/index.js"), - ("with multiple symlinks in the path 3", temp_path.clone(), "./this/test/temp/this/lib/index.js"), - ("with a symlink to a directory 2 (chained)", temp_path.clone(), "./that/lib/index.js"), - ("with multiple symlinks in the path 1 (chained)", temp_path.clone(), "./that/test/temp/index.js"), - ("with multiple symlinks in the path 2 (chained)", temp_path.clone(), "./that/test/temp/lib/index.js"), - ("with multiple symlinks in the path 3 (chained)", temp_path.clone(), "./that/test/temp/that/lib/index.js"), - ("with symlinked directory as context 1", temp_path.join( "lib"), "./index.js"), - ("with symlinked directory as context 2", temp_path.join( "this"), "./lib/index.js"), - ("with symlinked directory as context and in path", temp_path.join( "this"), "./test/temp/lib/index.js"), - ("with symlinked directory in context path", temp_path.join( "this/lib"), "./index.js"), - ("with symlinked directory in context path and symlinked file", temp_path.join( "this/test"), "./temp/index.js"), - ("with symlinked directory in context path and symlinked directory", temp_path.join( "this/test"), "./temp/lib/index.js"), - ("with symlinked directory as context 2 (chained)", temp_path.join( "that"), "./lib/index.js"), - ("with symlinked directory as context and in path (chained)", temp_path.join( "that"), "./test/temp/lib/index.js"), - ("with symlinked directory in context path (chained)", temp_path.join( "that/lib"), "./index.js"), - ("with symlinked directory in context path and symlinked file (chained)", temp_path.join( "that/test"), "./temp/index.js"), - ("with symlinked directory in context path and symlinked directory (chained)", temp_path.join( "that/test"), "./temp/lib/index.js") - ]; - - for (comment, path, request) in pass { - let filename = resolver_with_symlinks.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(filename, Ok(root.join("lib/index.js")), "{comment:?}"); - - let resolved_path = - resolver_without_symlinks.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(path.join(request))); - } - - Ok(()) -} diff --git a/src/tests/tsconfig_paths.rs b/src/tests/tsconfig_paths.rs deleted file mode 100644 index 26935b5c..00000000 --- a/src/tests/tsconfig_paths.rs +++ /dev/null @@ -1,507 +0,0 @@ -//! tests for tsconfig-paths -//! -//! Fixtures copied from . - -use std::path::{Path, PathBuf}; - -use crate::{ - ResolveError, ResolveOptions, Resolver, TsConfig, TsconfigOptions, TsconfigReferences, -}; - -// -#[test] -fn tsconfig() { - let f = super::fixture_root().join("tsconfig"); - - #[rustfmt::skip] - let pass = [ - (f.clone(), None, "ts-path", f.join("foo.js")), - (f.join("nested"), None, "ts-path", f.join("nested/test.js")), - (f.join("cases/index"), None, "foo", f.join("node_modules/tsconfig-index/foo.js")), - // This requires reading package.json.tsconfig field - // (f.join("cases/field"), "foo", f.join("node_modules/tsconfig-field/foo.js")) - (f.join("cases/exports"), None, "foo", f.join("node_modules/tsconfig-exports/foo.js")), - (f.join("cases/extends-extension"), None, "foo", f.join("cases/extends-extension/foo.js")), - (f.join("cases/extends-extensionless"), None, "foo", f.join("node_modules/tsconfig-field/foo.js")), - (f.join("cases/extends-paths"), Some("src"), "@/index", f.join("cases/extends-paths/src/index.js")), - (f.join("cases/extends-multiple"), None, "foo", f.join("cases/extends-multiple/foo.js")), - ]; - - for (dir, subdir, request, expected) in pass { - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: dir.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - let path = subdir.map_or(dir.clone(), |subdir| dir.join(subdir)); - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{request} {path:?}"); - } - - #[rustfmt::skip] - let data = [ - (f.join("node_modules/tsconfig-not-used"), "ts-path", Ok(f.join("foo.js"))), - ]; - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - for (path, request, expected) in data { - let resolution = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolution, expected, "{path:?} {request}"); - } -} - -#[test] -fn tsconfig_fallthrough() { - let f = super::fixture_root().join("tsconfig"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "/"); - assert_eq!(resolved_path, Err(ResolveError::NotFound("/".into()))); -} - -#[test] -fn json_with_comments() { - let f = super::fixture_root().join("tsconfig/cases/trailing-comma"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "foo").map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(f.join("bar.js"))); -} - -// -#[test] -fn test_paths() { - let path = Path::new("/foo/tsconfig.json"); - let mut tsconfig_json = serde_json::json!({ - "compilerOptions": { - "paths": { - "jquery": ["node_modules/jquery/dist/jquery"], - "*": ["generated/*"], - "bar/*": ["test/*"], - "bar/baz/*": ["baz/*", "yo/*"], - "@/components/*": ["components/*"], - "url": ["node_modules/my-url"], - } - } - }) - .to_string(); - let tsconfig = TsConfig::parse(true, path, &mut tsconfig_json).unwrap(); - - let data = [ - ("jquery", vec!["/foo/node_modules/jquery/dist/jquery"]), - ("test", vec!["/foo/generated/test"]), - ("test/hello", vec!["/foo/generated/test/hello"]), - ("bar/hi", vec!["/foo/test/hi"]), - ("bar/baz/hi", vec!["/foo/baz/hi", "/foo/yo/hi"]), - ("@/components/button", vec!["/foo/components/button"]), - ("./jquery", vec![]), - ("url", vec!["/foo/node_modules/my-url"]), - ]; - - for (specifier, expected) in data { - let paths = tsconfig.resolve_path_alias(specifier); - let expected = expected.into_iter().map(PathBuf::from).collect::>(); - assert_eq!(paths, expected, "{specifier}"); - } -} - -// -#[test] -fn test_base_url() { - let path = Path::new("/foo/tsconfig.json"); - let mut tsconfig_json = serde_json::json!({ - "compilerOptions": { - "baseUrl": "./src" - } - }) - .to_string(); - let tsconfig = TsConfig::parse(true, path, &mut tsconfig_json).unwrap(); - - let data = [ - ("foo", vec!["/foo/src/foo"]), - ("components/button", vec!["/foo/src/components/button"]), - ("./jquery", vec![]), - ]; - - for (specifier, expected) in data { - let paths = tsconfig.resolve_path_alias(specifier); - let expected = expected.into_iter().map(PathBuf::from).collect::>(); - assert_eq!(paths, expected, "{specifier}"); - } -} - -// -#[test] -fn test_paths_and_base_url() { - let path = Path::new("/foo/tsconfig.json"); - let mut tsconfig_json = serde_json::json!({ - "compilerOptions": { - "baseUrl": "./src", - "paths": { - "*": ["generated/*"], - "bar/*": ["test/*"], - "bar/baz/*": ["baz/*", "yo/*"], - "@/components/*": ["components/*"] - } - } - }) - .to_string(); - let tsconfig = TsConfig::parse(true, path, &mut tsconfig_json).unwrap(); - - let data = [ - ("test", vec!["/foo/src/generated/test", "/foo/src/test"]), - ("test/hello", vec!["/foo/src/generated/test/hello", "/foo/src/test/hello"]), - ("bar/hi", vec!["/foo/src/test/hi", "/foo/src/bar/hi"]), - ("bar/baz/hi", vec!["/foo/src/baz/hi", "/foo/src/yo/hi", "/foo/src/bar/baz/hi"]), - ("@/components/button", vec!["/foo/src/components/button", "/foo/src/@/components/button"]), - ("./jquery", vec![]), - ]; - - for (specifier, expected) in data { - let paths = tsconfig.resolve_path_alias(specifier); - let expected = expected.into_iter().map(PathBuf::from).collect::>(); - assert_eq!(paths, expected, "{specifier}"); - } -} - -// Template variable ${configDir} for substitution of config files directory path -// https://github.com/microsoft/TypeScript/pull/58042 -#[test] -fn test_template_variable() { - let f = super::fixture_root().join("tsconfig"); - let f2 = f.join("cases").join("paths_template_variable"); - - #[rustfmt::skip] - let pass = [ - (f2.clone(), "tsconfig1.json", "foo", f2.join("foo.js")), - (f2.clone(), "tsconfig2.json", "foo", f2.join("foo.js")), - (f.clone(), "tsconfig_template_variable.json", "foo", f.join("foo.js")), - ]; - - for (dir, tsconfig, request, expected) in pass { - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: dir.join(tsconfig), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&dir, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{request} {tsconfig} {dir:?}"); - } -} - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows_test { - use std::path::{Path, PathBuf}; - - use crate::{ - ResolveError, ResolveOptions, ResolverGeneric, TsconfigOptions, TsconfigReferences, - }; - - use super::super::memory_fs::MemoryFS; - - struct OneTest { - name: &'static str, - tsconfig: String, - package_json: Option<(PathBuf, String)>, - main_fields: Option>, - existing_files: Vec<&'static str>, - requested_module: &'static str, - expected_path: &'static str, - extensions: Vec, - } - - impl Default for OneTest { - fn default() -> Self { - Self { - name: "", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/*": ["location/*"] - } - } - }) - .to_string(), - package_json: None, - main_fields: None, - existing_files: vec![], - requested_module: "", - expected_path: "", - extensions: vec![ - ".js".into(), - ".json".into(), - ".node".into(), - ".ts".into(), - ".tsx".into(), - ], - } - } - } - - impl OneTest { - fn resolver(&self, root: &Path) -> ResolverGeneric { - let mut file_system = MemoryFS::default(); - - file_system.add_file(&root.join("tsconfig.json"), &self.tsconfig); - if let Some((path, package_json)) = &self.package_json { - file_system.add_file(&root.join(path).join("package.json"), package_json); - } - for path in &self.existing_files { - file_system.add_file(Path::new(path), ""); - } - - let mut options = ResolveOptions { - extensions: self.extensions.clone(), - tsconfig: Some(TsconfigOptions { - config_file: root.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }; - if let Some(main_fields) = &self.main_fields { - options.main_fields.clone_from(main_fields); - } - - ResolverGeneric::::new_with_file_system(file_system, options) - } - } - - // Path matching tests from tsconfig-paths - // * - // * - #[test] - fn match_path() { - let pass = [ - OneTest { - name: "should locate path that matches with star and exists", - existing_files: vec!["/root/location/mylib/index.ts"], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve to correct path when many are specified", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/*": ["foo1/*", "foo2/*", "location/*", "foo3/*"], - } - } - }) - .to_string(), - existing_files: vec!["/root/location/mylib/index.ts"], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should locate path that matches with star and prioritize pattern with longest prefix", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "*": ["location/*"], - "lib/*": ["location/*"], - } - } - }) - .to_string(), - existing_files: vec![ - "/root/location/lib/mylib/index.ts", - "/root/location/mylib/index.ts", - ], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should locate path that matches with star and exists with extension", - existing_files: vec![ - "/root/location/mylib.myext", - ], - requested_module: "lib/mylib", - extensions: vec![".js".into(), ".myext".into()], - expected_path: "/root/location/mylib.myext", - ..OneTest::default() - }, - OneTest { - name: "should resolve request with extension specified", - existing_files: vec![ - "/root/location/test.jpg", - ], - requested_module: "lib/test.jpg", - expected_path: "/root/location/test.jpg", - ..OneTest::default() - }, - OneTest { - name: "should locate path that matches without star and exists", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/foo": ["location/foo"] - } - } - }) - .to_string(), - existing_files: vec![ - "/root/location/foo.ts", - ], - requested_module: "lib/foo", - expected_path: "/root/location/foo.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve to parent folder when filename is in subfolder", - existing_files: vec![ - "/root/location/mylib/index.ts", - ], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve from main field in package.json", - package_json: Some((PathBuf::from("/root/location/mylib"), serde_json::json!({ - "main": "./kalle.ts" - }).to_string())), - existing_files: vec![ - "/root/location/mylib/kalle.ts", - ], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/kalle.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve from main field in package.json (js)", - package_json: Some((PathBuf::from("/root/location/mylib.js"), serde_json::json!({ - "main": "./kalle.js" - }).to_string())), - existing_files: vec![ - "/root/location/mylib.js/kalle.js", - ], - extensions: vec![".ts".into(), ".js".into()], - requested_module: "lib/mylib.js", - expected_path: "/root/location/mylib.js/kalle.js", - ..OneTest::default() - }, - OneTest { - name: "should resolve from list of fields by priority in package.json", - main_fields: Some(vec!["missing".into(), "browser".into(), "main".into()]), - package_json: Some((PathBuf::from("/root/location/mylibjs"), serde_json::json!({ - "main": "./main.js", - "browser": "./browser.js" - }).to_string())), - existing_files: vec![ - "/root/location/mylibjs/main.js", - "/root/location/mylibjs/browser.js", - ], - extensions: vec![".ts".into(), ".js".into()], - requested_module: "lib/mylibjs", - expected_path: "/root/location/mylibjs/browser.js", - ..OneTest::default() - }, -OneTest { - name: "should ignore field mappings to missing files in package.json", - main_fields: Some(vec!["browser".into(), "main".into()]), - package_json: Some((PathBuf::from("/root/location/mylibjs"), serde_json::json!({ - "main": "./kalle.js", - "browser": "./nope.js" - }).to_string())), - existing_files: vec![ - "/root/location/mylibjs/kalle.js", - ], - extensions: vec![".ts".into(), ".js".into()], - requested_module: "lib/mylibjs", - expected_path: "/root/location/mylibjs/kalle.js", - ..OneTest::default() - }, - // Tests that are not applicable: - // name: "should resolve nested main fields" - // name: "should ignore advanced field mappings in package.json" - // name: "should resolve to with the help of baseUrl when not explicitly set" - // name: "should not resolve with the help of baseUrl when asked not to" - // name: "should resolve main file with cjs file extension" - OneTest { - name: "should resolve .ts from .js alias", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "@/*": ["src/*"] - } - } - }).to_string(), - existing_files: vec![ - "/root/src/foo.ts", - ], - requested_module: "@/foo", // original data was "@/foo.ts" but I don't get why it is the case? - expected_path: "/root/src/foo.ts", // original data was "/root/src/foo" - ..OneTest::default() - }, - ]; - - let root = PathBuf::from("/root"); - - for test in pass { - let resolved_path = - test.resolver(&root).resolve(&root, test.requested_module).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(PathBuf::from(test.expected_path)), "{}", test.name); - } - - let fail = [ - OneTest { - name: "should not locate path that does not match", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/*": ["location/*"] - } - } - }) - .to_string(), - existing_files: vec!["/root/location/mylib"], - requested_module: "lib/mylibjs", - ..OneTest::default() - }, - OneTest { - name: "should not resolve typings file (index.d.ts)", - existing_files: vec!["/root/location/mylib/index.d.ts"], - requested_module: "lib/mylib", - ..OneTest::default() - }, - ]; - - for test in fail { - let resolved_path = - test.resolver(&root).resolve(&root, test.requested_module).map(|f| f.full_path()); - assert_eq!( - resolved_path, - Err(ResolveError::NotFound(test.requested_module.into())), - "{}", - test.name - ); - } - } -} diff --git a/src/tests/tsconfig_project_references.rs b/src/tests/tsconfig_project_references.rs deleted file mode 100644 index b552fefe..00000000 --- a/src/tests/tsconfig_project_references.rs +++ /dev/null @@ -1,101 +0,0 @@ -//! Tests for tsconfig project references - -use crate::{ResolveError, ResolveOptions, Resolver, TsconfigOptions, TsconfigReferences}; - -#[test] -fn auto() { - let f = super::fixture_root().join("tsconfig/cases/project_references"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("app"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - // Test normal paths alias - (f.join("app"), "@/index.ts", f.join("app/aliased/index.ts")), - (f.join("app"), "@/../index.ts", f.join("app/index.ts")), - // Test project reference - (f.join("project_a"), "@/index.ts", f.join("project_a/aliased/index.ts")), - (f.join("project_b/src"), "@/index.ts", f.join("project_b/src/aliased/index.ts")), - // Does not have paths alias - (f.join("project_a"), "./index.ts", f.join("project_a/index.ts")), - (f.join("project_c"), "./index.ts", f.join("project_c/index.ts")), - // Template variable - { - let dir = f.parent().unwrap().join("paths_template_variable"); - (dir.clone(), "foo", dir.join("foo.js")) - } - ]; - - for (path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{request} {path:?}"); - } -} - -#[test] -fn disabled() { - let f = super::fixture_root().join("tsconfig/cases/project_references"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("app"), - references: TsconfigReferences::Disabled, - }), - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - // Test normal paths alias - (f.join("app"), "@/index.ts", Ok(f.join("app/aliased/index.ts"))), - (f.join("app"), "@/../index.ts", Ok(f.join("app/index.ts"))), - // Test project reference - (f.join("project_a"), "@/index.ts", Err(ResolveError::NotFound("@/index.ts".into()))), - (f.join("project_b/src"), "@/index.ts", Err(ResolveError::NotFound("@/index.ts".into()))), - // Does not have paths alias - (f.join("project_a"), "./index.ts", Ok(f.join("project_a/index.ts"))), - (f.join("project_c"), "./index.ts", Ok(f.join("project_c/index.ts"))), - ]; - - for (path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, expected, "{request} {path:?}"); - } -} - -#[test] -fn manual() { - let f = super::fixture_root().join("tsconfig/cases/project_references"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("app"), - references: TsconfigReferences::Paths(vec!["../project_a/conf.json".into()]), - }), - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - // Test normal paths alias - (f.join("app"), "@/index.ts", Ok(f.join("app/aliased/index.ts"))), - (f.join("app"), "@/../index.ts", Ok(f.join("app/index.ts"))), - // Test project reference - (f.join("project_a"), "@/index.ts", Ok(f.join("project_a/aliased/index.ts"))), - (f.join("project_b/src"), "@/index.ts", Err(ResolveError::NotFound("@/index.ts".into()))), - // Does not have paths alias - (f.join("project_a"), "./index.ts", Ok(f.join("project_a/index.ts"))), - (f.join("project_c"), "./index.ts", Ok(f.join("project_c/index.ts"))), - ]; - - for (path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, expected, "{request} {path:?}"); - } -} diff --git a/src/tsconfig.rs b/src/tsconfig.rs deleted file mode 100644 index aa00f6e4..00000000 --- a/src/tsconfig.rs +++ /dev/null @@ -1,212 +0,0 @@ -use std::{ - path::{Path, PathBuf}, - sync::Arc, -}; - -use serde::Deserialize; -use typescript_tsconfig_json::{CompilerOptionsPathsMap, ExtendsField}; - -use crate::PathUtil; - -#[derive(Debug, Deserialize)] -#[serde(rename_all = "camelCase")] -pub struct TsConfig { - /// Whether this is the caller tsconfig. - /// Used for final template variable substitution when all configs are extended and merged. - #[serde(skip)] - root: bool, - - /// Path to `tsconfig.json`. Contains the `tsconfig.json` filename. - #[serde(skip)] - path: PathBuf, - - #[serde(default)] - pub extends: Option, - - #[serde(default)] - pub compiler_options: CompilerOptions, - - /// Bubbled up project references with a reference to their tsconfig. - #[serde(default)] - pub references: Vec, -} - -/// Compiler Options -/// -/// -#[derive(Debug, Default, Deserialize)] -#[serde(rename_all = "camelCase")] -pub struct CompilerOptions { - base_url: Option, - - /// Path aliases - paths: Option, - - /// The actual base for where path aliases are resolved from. - #[serde(skip)] - paths_base: PathBuf, -} - -/// Project Reference -/// -/// -#[derive(Debug, Deserialize)] -pub struct ProjectReference { - /// The path property of each reference can point to a directory containing a tsconfig.json file, - /// or to the config file itself (which may have any name). - pub path: PathBuf, - - /// Reference to the resolved tsconfig - #[serde(skip)] - pub tsconfig: Option>, -} - -impl TsConfig { - pub fn parse(root: bool, path: &Path, json: &mut str) -> Result { - _ = json_strip_comments::strip(json); - let mut tsconfig: Self = serde_json::from_str(json)?; - tsconfig.root = root; - tsconfig.path = path.to_path_buf(); - let directory = tsconfig.directory().to_path_buf(); - if let Some(base_url) = tsconfig.compiler_options.base_url { - tsconfig.compiler_options.base_url = Some(directory.normalize_with(base_url)); - } - if tsconfig.compiler_options.paths.is_some() { - tsconfig.compiler_options.paths_base = - tsconfig.compiler_options.base_url.as_ref().map_or(directory, Clone::clone); - } - Ok(tsconfig) - } - - pub fn build(mut self) -> Self { - if self.root { - let dir = self.directory().to_path_buf(); - // Substitute template variable in `tsconfig.compilerOptions.paths` - if let Some(paths) = &mut self.compiler_options.paths { - for paths in paths.values_mut() { - for path in paths { - Self::substitute_template_variable(&dir, path); - } - } - } - } - self - } - - /// Directory to `tsconfig.json` - /// - /// # Panics - /// - /// * When the `tsconfig.json` path is misconfigured. - pub fn directory(&self) -> &Path { - debug_assert!(self.path.file_name().is_some()); - self.path.parent().unwrap() - } - - pub fn extend_tsconfig(&mut self, tsconfig: &Self) { - let compiler_options = &mut self.compiler_options; - if compiler_options.paths.is_none() { - compiler_options.paths_base = compiler_options - .base_url - .as_ref() - .map_or_else(|| tsconfig.compiler_options.paths_base.clone(), Clone::clone); - compiler_options.paths.clone_from(&tsconfig.compiler_options.paths); - } - if compiler_options.base_url.is_none() { - compiler_options.base_url.clone_from(&tsconfig.compiler_options.base_url); - } - } - - pub fn resolve(&self, path: &Path, specifier: &str) -> Vec { - if path.starts_with(self.base_path()) { - let paths = self.resolve_path_alias(specifier); - if !paths.is_empty() { - return paths; - } - } - for tsconfig in self.references.iter().filter_map(|reference| reference.tsconfig.as_ref()) { - if path.starts_with(tsconfig.base_path()) { - return tsconfig.resolve_path_alias(specifier); - } - } - vec![] - } - - // Copied from parcel - // - pub fn resolve_path_alias(&self, specifier: &str) -> Vec { - if specifier.starts_with(|s| s == '/' || s == '.') { - return vec![]; - } - - let base_url_iter = self - .compiler_options - .base_url - .as_ref() - .map_or_else(Vec::new, |base_url| vec![base_url.normalize_with(specifier)]); - - let Some(paths_map) = &self.compiler_options.paths else { - return base_url_iter; - }; - - let paths = paths_map.get(specifier).map_or_else( - || { - let mut longest_prefix_length = 0; - let mut longest_suffix_length = 0; - let mut best_key: Option<&String> = None; - - for key in paths_map.keys() { - if let Some((prefix, suffix)) = key.split_once('*') { - if (best_key.is_none() || prefix.len() > longest_prefix_length) - && specifier.starts_with(prefix) - && specifier.ends_with(suffix) - { - longest_prefix_length = prefix.len(); - longest_suffix_length = suffix.len(); - best_key.replace(key); - } - } - } - - best_key.and_then(|key| paths_map.get(key)).map_or_else(Vec::new, |paths| { - paths - .iter() - .map(|path| { - path.replace( - '*', - &specifier[longest_prefix_length - ..specifier.len() - longest_suffix_length], - ) - }) - .collect::>() - }) - }, - Clone::clone, - ); - - paths - .into_iter() - .map(|p| self.compiler_options.paths_base.normalize_with(p)) - .chain(base_url_iter) - .collect() - } - - fn base_path(&self) -> &Path { - self.compiler_options - .base_url - .as_ref() - .map_or_else(|| self.directory(), |path| path.as_ref()) - } - - /// Template variable `${configDir}` for substitution of config files directory path - /// - /// NOTE: All tests cases are just a head replacement of `${configDir}`, so we are constrained as such. - /// - /// See - fn substitute_template_variable(directory: &Path, path: &mut String) { - const TEMPLATE_VARIABLE: &str = "${configDir}/"; - if let Some(stripped_path) = path.strip_prefix(TEMPLATE_VARIABLE) { - *path = directory.join(stripped_path).to_string_lossy().to_string(); - } - } -} diff --git a/tests/integration_test.rs b/tests/integration_test.rs deleted file mode 100644 index d369413f..00000000 --- a/tests/integration_test.rs +++ /dev/null @@ -1,102 +0,0 @@ -//! Test public APIs - -use std::{env, path::PathBuf}; - -use oxc_resolver::{EnforceExtension, Resolution, ResolveContext, ResolveOptions, Resolver}; - -fn dir() -> PathBuf { - env::current_dir().unwrap() -} - -fn resolve(specifier: &str) -> Resolution { - let path = dir(); - Resolver::new(ResolveOptions::default()).resolve(path, specifier).unwrap() -} - -#[test] -fn clone() { - let resolution = resolve("./tests/package.json"); - assert_eq!(resolution.clone(), resolution); -} - -#[test] -fn debug() { - let resolution = resolve("./tests/package.json"); - let s = format!("{resolution:?}"); - assert!(!s.is_empty()); -} - -#[test] -fn eq() { - let resolution = resolve("./tests/package.json"); - assert_eq!(resolution, resolution); -} - -#[test] -fn package_json() { - let resolution = resolve("./tests/package.json"); - assert!(resolution - .package_json() - .is_some_and(|json| json.name.as_ref().is_some_and(|name| name == "name"))); -} - -#[cfg(feature = "package_json_raw_json_api")] -#[test] -fn package_json_raw_json_api() { - let resolution = resolve("./tests/package.json"); - assert!(resolution - .package_json() - .unwrap() - .raw_json() - .get("name") - .is_some_and(|name| name == "name")); -} - -#[test] -fn clear_cache() { - let resolver = Resolver::new(ResolveOptions::default()); - resolver.clear_cache(); // exists -} - -#[test] -fn options() { - let resolver = Resolver::new(ResolveOptions::default()); - let options = resolver.options(); - assert!(!format!("{options:?}").is_empty()); -} - -#[test] -fn debug_resolver() { - let resolver = Resolver::new(ResolveOptions::default()); - assert!(!format!("{resolver:?}").is_empty()); -} - -#[test] -fn dependencies() { - let path = dir(); - let mut ctx = ResolveContext::default(); - let _ = Resolver::new(ResolveOptions::default()).resolve_with_context( - path, - "./tests/package.json", - &mut ctx, - ); - assert!(!ctx.file_dependencies.is_empty()); - assert!(ctx.missing_dependencies.is_empty()); -} - -#[test] -fn options_api() { - _ = ResolveOptions::default() - .with_builtin_modules(true) - .with_condition_names(&[]) - .with_extension(".js") - .with_force_extension(EnforceExtension::Auto) - .with_fully_specified(true) - .with_main_field("asdf") - .with_main_file("main") - .with_module("module") - .with_prefer_absolute(true) - .with_prefer_relative(true) - .with_root(PathBuf::new()) - .with_symbolic_link(true); -} diff --git a/tests/package.json b/tests/package.json deleted file mode 100644 index f099adcf..00000000 --- a/tests/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "name": "name" -} diff --git a/tests/resolve_test.rs b/tests/resolve_test.rs deleted file mode 100644 index 554d707c..00000000 --- a/tests/resolve_test.rs +++ /dev/null @@ -1,104 +0,0 @@ -use std::{env, path::PathBuf}; - -use oxc_resolver::{ResolveError, ResolveOptions, Resolver}; - -fn dir() -> PathBuf { - env::current_dir().unwrap() -} - -#[test] -fn chinese() { - let dir = dir(); - let specifier = "./fixtures/misc/中文/中文.js"; - let resolution = Resolver::new(ResolveOptions::default()).resolve(&dir, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(dir.join("fixtures/misc/中文/中文.js")) - ); -} - -#[test] -fn styled_components() { - let dir = dir(); - let path = dir.join("fixtures/pnpm8"); - let module_path = path.join("node_modules/.pnpm/styled-components@6.1.1_react-dom@18.2.0_react@18.2.0/node_modules/styled-components"); - let specifier = "styled-components"; - - // cjs - let options = - ResolveOptions { alias_fields: vec![vec!["browser".into()]], ..ResolveOptions::default() }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/styled-components.browser.cjs.js")) - ); - - // esm - let options = ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - main_fields: vec!["module".into()], - ..ResolveOptions::default() - }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/styled-components.browser.esm.js")) - ); -} - -#[test] -fn axios() { - let dir = dir(); - let path = dir.join("fixtures/pnpm8"); - let module_path = path.join("node_modules/.pnpm/axios@1.6.2/node_modules/axios"); - let specifier = "axios"; - - // default - let options = ResolveOptions::default(); - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("index.js")) - ); - - // browser - let options = ResolveOptions { - condition_names: vec!["browser".into(), "require".into()], - ..ResolveOptions::default() - }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/browser/axios.cjs")) - ); - - // cjs - let options = ResolveOptions { - condition_names: vec!["node".into(), "require".into()], - ..ResolveOptions::default() - }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/node/axios.cjs")) - ); -} - -#[test] -fn postcss() { - let dir = dir(); - let path = dir.join("fixtures/pnpm8"); - let module_path = path.join("node_modules/postcss"); - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - // should ignore "path" - let resolution = resolver.resolve(&module_path, "path"); - assert_eq!(resolution, Err(ResolveError::Ignored(module_path.clone()))); - - // should ignore "./lib/terminal-highlight" - let resolution = resolver.resolve(&module_path, "./lib/terminal-highlight"); - assert_eq!(resolution, Err(ResolveError::Ignored(module_path.join("lib/terminal-highlight")))); -} From 1389e85256923afd27153d7ac7c2af9b49c3b71d Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Sat, 8 Jun 2024 07:34:48 +0300 Subject: [PATCH 20/82] squash! --- Cargo.lock | 858 ------ fixtures/enhanced_resolve/lib/index.js | 1 - fixtures/enhanced_resolve/package.json | 4 - fixtures/enhanced_resolve/test/.gitignore | 2 - .../enhanced_resolve/test/fixtures/#/a.js | 0 fixtures/enhanced_resolve/test/fixtures/a.js | 3 - .../enhanced_resolve/test/fixtures/abc.txt | 1 - .../test/fixtures/alias/files/a.js | 0 fixtures/enhanced_resolve/test/fixtures/b.js | 3 - .../browser-module/browser/module-a.js | 0 .../fixtures/browser-module/lib/browser.js | 0 .../fixtures/browser-module/lib/ignore.js | 0 .../test/fixtures/browser-module/lib/main.js | 0 .../fixtures/browser-module/lib/replaced.js | 0 .../test/fixtures/browser-module/lib/self.js | 0 .../fixtures/browser-module/lib/toString.js | 0 .../browser-module/node_modules/module-a.js | 0 .../browser-module/node_modules/module-b.js | 0 .../browser-module/node_modules/module-c.js | 0 .../node_modules/recursive-file/a.js | 0 .../node_modules/recursive-file/b.js | 0 .../node_modules/recursive-file/c.js | 0 .../node_modules/recursive-file/d.js | 0 .../node_modules/recursive-file/package.json | 8 - .../test/fixtures/browser-module/package.json | 33 - .../test/fixtures/builtins/package.json | 12 - fixtures/enhanced_resolve/test/fixtures/c.js | 4 - .../enhanced_resolve/test/fixtures/complex.js | 13 - .../test/fixtures/crypto-js/index.js | 0 .../test/fixtures/crypto-js/package.json | 7 - .../test/fixtures/decorated-fs/exists.js | 0 .../test/fixtures/dirOrFile.js | 1 - .../test/fixtures/dirOrFile/index.js | 1 - .../directory-default/directory-default.js | 0 .../node_modules/@org/pkg/dist/string.js | 1 - .../@org/pkg/dist/string.test.d.ts | 1 - .../node_modules/@org/pkg/package.json | 9 - .../node_modules/pkg/dist/string.js | 1 - .../node_modules/pkg/dist/string.test.d.ts | 1 - .../node_modules/pkg/package.json | 9 - .../node_modules/exports-field/package.json | 7 - .../node_modules/pack1/index.js | 0 .../test/fixtures/exports-field/a.js | 1 - .../node_modules/exports-field/lib/browser.js | 1 - .../node_modules/exports-field/lib/index.js | 0 .../exports-field/lib/lib2/main.js | 1 - .../node_modules/exports-field/lib/main.js | 1 - .../node_modules/exports-field/main.js | 1 - .../node_modules/exports-field/package.json | 18 - .../node_modules/exports-field/x.js | 1 - .../invalid-exports-field/index.js | 0 .../invalid-exports-field/package.json | 13 - .../node_modules/invalid-exports-field/umd.js | 0 .../test/fixtures/exports-field/package.json | 5 - .../node_modules/exports-field/index.js | 1 - .../node_modules/exports-field/lib/browser.js | 1 - .../exports-field/lib/lib2/main.js | 1 - .../node_modules/exports-field/lib/main.js | 1 - .../node_modules/exports-field/main.js | 1 - .../node_modules/exports-field/package.json | 17 - .../node_modules/exports-field/index | 0 .../node_modules/exports-field/main.js | 1 - .../node_modules/exports-field/package.json | 10 - .../node_modules/exports-field/src/index.js | 0 .../fixtures/extension-alias/dir/index.js | 0 .../fixtures/extension-alias/dir/index.ts | 0 .../fixtures/extension-alias/dir2/index.js | 0 .../fixtures/extension-alias/dir2/index.mts | 0 .../test/fixtures/extension-alias/index.js | 0 .../test/fixtures/extension-alias/index.mjs | 0 .../fixtures/extension-alias/index.mts.js | 0 .../test/fixtures/extension-alias/index.ts | 0 .../test/fixtures/extensions/app.module.js | 0 .../test/fixtures/extensions/dir/index.js | 0 .../test/fixtures/extensions/dir/index.ts | 0 .../test/fixtures/extensions/foo.js | 0 .../test/fixtures/extensions/foo.ts | 0 .../test/fixtures/extensions/index.js | 0 .../test/fixtures/extensions/index.ts | 0 .../extensions/node_modules/module.js | 0 .../extensions/node_modules/module/index.ts | 0 .../test/fixtures/extensions/package.json | 3 - .../enhanced_resolve/test/fixtures/file.load1 | 0 .../enhanced_resolve/test/fixtures/file.load2 | 0 .../test/fixtures/foo/index.js | 0 .../test/fixtures/foo/package.json | 4 - .../node_modules/m/package.json | 17 - .../node_modules/m/src/features/f.js | 0 .../m/src/features/internal/file.js | 0 .../node_modules/m/src/features/y/y.js | 0 .../node_modules/m/src/internal/i.js | 0 .../node_modules/m/src/middle-1/f.js | 0 .../node_modules/m/src/middle-1/nested/f.js | 0 .../node_modules/m/src/middle-2/nested/f.js | 1 - .../m/src/middle-3/nested/f/nested/f.js | 0 .../node_modules/m/src/middle-4/f/f.js | 0 .../node_modules/m/src/middle-5/f$/$.js | 0 .../node_modules/m/src/middle-5/f/$.js | 0 .../node_modules/m/src/middle/f.js | 0 .../node_modules/m/src/middle/nested/f.js | 0 .../test/fixtures/imports-field/a.js | 1 - .../test/fixtures/imports-field/b.js | 0 .../test/fixtures/imports-field/dir/b.js | 0 .../node_modules/a/lib/browser.js | 1 - .../imports-field/node_modules/a/lib/index.js | 0 .../node_modules/a/lib/lib2/main.js | 1 - .../imports-field/node_modules/a/lib/main.js | 1 - .../imports-field/node_modules/a/main.js | 1 - .../imports-field/node_modules/a/package.json | 18 - .../imports-field/node_modules/a/x.js | 1 - .../imports-field/node_modules/c/index.js | 0 .../test/fixtures/imports-field/package.json | 17 - .../fixtures/incorrect-package/pack1/a.js | 0 .../incorrect-package/pack1/package.json | 2 - .../fixtures/incorrect-package/pack2/a.js | 0 .../incorrect-package/pack2/package.json | 0 .../test/fixtures/issue-238/package.json | 3 - .../test/fixtures/issue-238/src/a/config.js | 0 .../src/common/config/myObjectFile.js | 0 .../enhanced_resolve/test/fixtures/lib.js | 0 .../test/fixtures/lib/complex1.js | 1 - .../test/fixtures/main-field-self/index.js | 0 .../fixtures/main-field-self/package.json | 3 - .../test/fixtures/main-field-self2/index.js | 0 .../fixtures/main-field-self2/package.json | 3 - .../enhanced_resolve/test/fixtures/main1.js | 9 - .../enhanced_resolve/test/fixtures/main2.js | 12 - .../enhanced_resolve/test/fixtures/main3.js | 4 - .../multiple_modules/node_modules/m1/a.js | 3 - .../test/fixtures/no#fragment/#/#.js | 0 fixtures/enhanced_resolve/test/fixtures/no.js | 0 .../browser-module-broken/browser.js | 0 .../browser-module-broken/main.js | 0 .../browser-module-broken/package.json | 4 - .../complexm/node_modules/m1/a.js | 1 - .../complexm/node_modules/m1/index.js | 1 - .../fixtures/node_modules/complexm/step1.js | 1 - .../fixtures/node_modules/complexm/step2.js | 1 - .../fixtures/node_modules/dash-name/index.js | 0 .../node_modules/dash-name/package.json | 4 - .../test/fixtures/node_modules/dash/index.js | 0 .../fixtures/node_modules/dash/package.json | 4 - .../invalidPackageJson/package.json | 0 .../test/fixtures/node_modules/m1/a.js | 3 - .../test/fixtures/node_modules/m1/b.js | 3 - .../test/fixtures/node_modules/m2/b.js | 1 - .../node_modules/recursive-module/file.js | 0 .../node_modules/recursive-module/index.js | 0 .../test/fixtures/pnp-a/m2/a.js | 3 - .../test/fixtures/pnp/pkg/dir/index.js | 0 .../test/fixtures/pnp/pkg/index.js | 0 .../test/fixtures/pnp/pkg/main.js | 0 .../fixtures/pnp/pkg/package-alias/browser.js | 0 .../fixtures/pnp/pkg/package-alias/index.js | 0 .../test/fixtures/pnp/pkg/package.json | 7 - .../test/fixtures/pnp/pkg/typescript/index.ts | 0 .../test/fixtures/pnp/pkg3/a.js | 1 - .../test/fixtures/pnp/pkg3/package.json | 8 - .../prefer-pnp/alternative-modules/m1/b.js | 0 .../restrictions/node_modules/pck1/index.css | 0 .../restrictions/node_modules/pck1/index.js | 0 .../node_modules/pck1/package.json | 3 - .../restrictions/node_modules/pck2/index.css | 0 .../restrictions/node_modules/pck2/module.js | 0 .../node_modules/pck2/package.json | 5 - .../test/fixtures/roots_fall_through/index.js | 0 .../scoped/node_modules/@scope/pack1/main.js | 0 .../node_modules/@scope/pack1/package.json | 5 - .../node_modules/@scope/pack2/lib/index.js | 0 .../scoped/node_modules/@scope/pack2/main.js | 0 .../node_modules/@scope/pack2/package.json | 3 - .../test/fixtures/shortcutdir.js/a.js | 0 .../test/fixtures/yield/a/foo-2/b | 0 .../test/fixtures/yield/a/foo-2/c | 0 .../test/fixtures/yield/a/foo/a | 0 .../test/fixtures/yield/a/foo/b | 0 .../test/fixtures/yield/b/foo/a | 0 .../test/fixtures/yield/c/foo/a | 0 .../test/fixtures/yield/c/foo/package.json | 7 - .../fixtures/\346\265\213\350\257\225.js" | 0 .../\344\270\255\346\226\207.js" | 0 fixtures/pnpm8/.gitignore | 1 - fixtures/pnpm8/package.json | 14 - fixtures/pnpm8/pnpm-lock.yaml | 212 -- fixtures/tsconfig/cases/builtins/thing.js | 0 .../tsconfig/cases/builtins/tsconfig.json | 5 - fixtures/tsconfig/cases/exports/index.js | 0 fixtures/tsconfig/cases/exports/tsconfig.json | 3 - .../extends-extension/base-tsconfig.json | 7 - .../tsconfig/cases/extends-extension/foo.js | 0 .../cases/extends-extension/tsconfig.json | 3 - .../cases/extends-extensionless/foo.js | 0 .../cases/extends-extensionless/tsconfig.json | 3 - .../tsconfig/cases/extends-multiple/foo.js | 0 .../cases/extends-multiple/tsconfig.json | 6 - .../tsconfig/cases/extends-not-found/index.js | 0 .../cases/extends-not-found/tsconfig.json | 3 - .../tsconfig/cases/extends-paths/src/index.js | 0 .../cases/extends-paths/tsconfig.base.json | 7 - .../cases/extends-paths/tsconfig.json | 6 - fixtures/tsconfig/cases/field/index.js | 0 fixtures/tsconfig/cases/field/tsconfig.json | 3 - fixtures/tsconfig/cases/index/index.js | 0 fixtures/tsconfig/cases/index/tsconfig.json | 3 - .../cases/paths_template_variable/foo.js | 0 .../paths_template_variable/tsconfig1.json | 3 - .../paths_template_variable/tsconfig2.json | 8 - .../project_references/app/aliased/index.ts | 0 .../cases/project_references/app/index.ts | 0 .../project_references/app/tsconfig.json | 23 - .../project_a/aliased/index.ts | 0 .../project_references/project_a/conf.json | 8 - .../project_references/project_a/index.ts | 0 .../project_b/src/aliased/index.ts | 0 .../project_b/tsconfig.json | 9 - .../project_references/project_c/index.ts | 0 .../project_c/tsconfig.json | 5 - .../project_references/tsconfig.base.json | 4 - fixtures/tsconfig/cases/suffixes/a.ios.ts | 0 fixtures/tsconfig/cases/suffixes/a.ts | 0 fixtures/tsconfig/cases/suffixes/b.ts | 0 fixtures/tsconfig/cases/suffixes/c-test.ts | 0 fixtures/tsconfig/cases/suffixes/index.ts | 1 - .../tsconfig/cases/suffixes/tsconfig.json | 5 - fixtures/tsconfig/cases/trailing-comma/bar.js | 0 .../tsconfig/cases/trailing-comma/index.js | 0 .../cases/trailing-comma/tsconfig.json | 9 - fixtures/tsconfig/foo.js | 0 fixtures/tsconfig/nested/index.js | 0 fixtures/tsconfig/nested/test.js | 0 fixtures/tsconfig/nested/tsconfig.json | 8 - .../node_modules/tsconfig-exports/conf.json | 7 - .../node_modules/tsconfig-exports/foo.js | 0 .../tsconfig-exports/package.json | 7 - .../node_modules/tsconfig-field/conf.json | 7 - .../node_modules/tsconfig-field/foo.js | 0 .../node_modules/tsconfig-field/package.json | 5 - .../node_modules/tsconfig-index/foo.js | 0 .../node_modules/tsconfig-index/package.json | 4 - .../node_modules/tsconfig-index/tsconfig.json | 7 - .../node_modules/tsconfig-not-used/foo.js | 0 .../tsconfig-not-used/tsconfig.json | 7 - fixtures/tsconfig/package.json | 24 - fixtures/tsconfig/tsconfig.json | 7 - .../tsconfig/tsconfig_template_variable.json | 7 - napi/__test__/resolver.spec.mjs | 259 -- napi/src/lib.rs | 166 -- napi/src/options.rs | 261 -- napi/tests/options.test.mjs | 59 - npm/package.json | 67 +- package.json | 56 +- pnpm-lock.yaml | 2450 ---------------- src/builtins.rs | 71 - src/cache.rs | 369 --- src/context.rs | 89 - src/error.rs | 160 -- src/file_system.rs | 133 - src/lib.rs | 1670 ----------- src/options.rs | 623 ---- src/package_json.rs | 207 -- src/path.rs | 132 - src/resolution.rs | 92 - src/specifier.rs | 230 -- src/tests/alias.rs | 280 -- src/tests/browser_field.rs | 189 -- src/tests/builtins.rs | 121 - src/tests/dependencies.rs | 110 - src/tests/exports_field.rs | 2546 ----------------- src/tests/extension_alias.rs | 66 - src/tests/extensions.rs | 125 - src/tests/fallback.rs | 100 - src/tests/full_specified.rs | 113 - src/tests/imports_field.rs | 1320 --------- src/tests/incorrect_description_file.rs | 62 - src/tests/main_field.rs | 24 - src/tests/memory_fs.rs | 74 - src/tests/missing.rs | 106 - src/tests/mod.rs | 49 - src/tests/resolve.rs | 119 - src/tests/restrictions.rs | 25 - src/tests/roots.rs | 92 - src/tests/scoped_packages.rs | 25 - src/tests/simple.rs | 68 - src/tests/symlink.rs | 121 - src/tests/tsconfig_paths.rs | 507 ---- src/tests/tsconfig_project_references.rs | 101 - src/tsconfig.rs | 212 -- tests/integration_test.rs | 102 - tests/package.json | 3 - tests/resolve_test.rs | 104 - 290 files changed, 50 insertions(+), 15475 deletions(-) delete mode 100644 Cargo.lock delete mode 100644 fixtures/enhanced_resolve/lib/index.js delete mode 100644 fixtures/enhanced_resolve/package.json delete mode 100644 fixtures/enhanced_resolve/test/.gitignore delete mode 100644 fixtures/enhanced_resolve/test/fixtures/#/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/abc.txt delete mode 100644 fixtures/enhanced_resolve/test/fixtures/alias/files/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/browser/module-a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/ignore.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/replaced.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/self.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/toString.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-c.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/c.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/d.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/builtins/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/c.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/complex.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/crypto-js/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/decorated-fs/exists.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/dirOrFile.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/directory-default/directory-default.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/pack1/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/umd.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/index delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/src/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.mts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mjs delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mts.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/app.module.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/foo.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/foo.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/file.load1 delete mode 100644 fixtures/enhanced_resolve/test/fixtures/file.load2 delete mode 100644 fixtures/enhanced_resolve/test/fixtures/foo/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/foo/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/internal/file.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/y/y.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/internal/i.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-3/nested/f/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-4/f/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f$/$.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f/$.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/dir/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/c/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/issue-238/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/issue-238/src/a/config.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/issue-238/src/common/config/myObjectFile.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/lib.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/lib/complex1.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self2/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main1.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main2.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main3.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/no#fragment/#/#.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/no.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/invalidPackageJson/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/file.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/dir/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/typescript/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/prefer-pnp/alternative-modules/m1/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.css delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/index.css delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/module.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/roots_fall_through/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/lib/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/shortcutdir.js/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/b delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/c delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo/a delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo/b delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/b/foo/a delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/c/foo/a delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json delete mode 100644 "fixtures/enhanced_resolve/test/fixtures/\346\265\213\350\257\225.js" delete mode 100644 "fixtures/misc/\344\270\255\346\226\207/\344\270\255\346\226\207.js" delete mode 100644 fixtures/pnpm8/.gitignore delete mode 100644 fixtures/pnpm8/package.json delete mode 100644 fixtures/pnpm8/pnpm-lock.yaml delete mode 100644 fixtures/tsconfig/cases/builtins/thing.js delete mode 100644 fixtures/tsconfig/cases/builtins/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/exports/index.js delete mode 100644 fixtures/tsconfig/cases/exports/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-extension/base-tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-extension/foo.js delete mode 100644 fixtures/tsconfig/cases/extends-extension/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-extensionless/foo.js delete mode 100644 fixtures/tsconfig/cases/extends-extensionless/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-multiple/foo.js delete mode 100644 fixtures/tsconfig/cases/extends-multiple/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-not-found/index.js delete mode 100644 fixtures/tsconfig/cases/extends-not-found/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-paths/src/index.js delete mode 100644 fixtures/tsconfig/cases/extends-paths/tsconfig.base.json delete mode 100644 fixtures/tsconfig/cases/extends-paths/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/field/index.js delete mode 100644 fixtures/tsconfig/cases/field/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/index/index.js delete mode 100644 fixtures/tsconfig/cases/index/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/paths_template_variable/foo.js delete mode 100644 fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json delete mode 100644 fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json delete mode 100644 fixtures/tsconfig/cases/project_references/app/aliased/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/app/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/app/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/project_references/project_a/aliased/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_a/conf.json delete mode 100644 fixtures/tsconfig/cases/project_references/project_a/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_b/src/aliased/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_b/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/project_references/project_c/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_c/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/project_references/tsconfig.base.json delete mode 100644 fixtures/tsconfig/cases/suffixes/a.ios.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/a.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/b.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/c-test.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/index.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/trailing-comma/bar.js delete mode 100644 fixtures/tsconfig/cases/trailing-comma/index.js delete mode 100644 fixtures/tsconfig/cases/trailing-comma/tsconfig.json delete mode 100644 fixtures/tsconfig/foo.js delete mode 100644 fixtures/tsconfig/nested/index.js delete mode 100644 fixtures/tsconfig/nested/test.js delete mode 100644 fixtures/tsconfig/nested/tsconfig.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-exports/conf.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-exports/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-exports/package.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-field/conf.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-field/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-field/package.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-index/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-index/package.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-not-used/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json delete mode 100755 fixtures/tsconfig/package.json delete mode 100644 fixtures/tsconfig/tsconfig.json delete mode 100644 fixtures/tsconfig/tsconfig_template_variable.json delete mode 100644 napi/__test__/resolver.spec.mjs delete mode 100644 napi/src/lib.rs delete mode 100644 napi/src/options.rs delete mode 100644 napi/tests/options.test.mjs delete mode 100644 pnpm-lock.yaml delete mode 100644 src/builtins.rs delete mode 100644 src/cache.rs delete mode 100644 src/context.rs delete mode 100644 src/error.rs delete mode 100644 src/file_system.rs delete mode 100644 src/lib.rs delete mode 100644 src/options.rs delete mode 100644 src/package_json.rs delete mode 100644 src/path.rs delete mode 100644 src/resolution.rs delete mode 100644 src/specifier.rs delete mode 100644 src/tests/alias.rs delete mode 100644 src/tests/browser_field.rs delete mode 100644 src/tests/builtins.rs delete mode 100644 src/tests/dependencies.rs delete mode 100644 src/tests/exports_field.rs delete mode 100644 src/tests/extension_alias.rs delete mode 100644 src/tests/extensions.rs delete mode 100644 src/tests/fallback.rs delete mode 100644 src/tests/full_specified.rs delete mode 100644 src/tests/imports_field.rs delete mode 100644 src/tests/incorrect_description_file.rs delete mode 100644 src/tests/main_field.rs delete mode 100644 src/tests/memory_fs.rs delete mode 100644 src/tests/missing.rs delete mode 100644 src/tests/mod.rs delete mode 100644 src/tests/resolve.rs delete mode 100644 src/tests/restrictions.rs delete mode 100644 src/tests/roots.rs delete mode 100644 src/tests/scoped_packages.rs delete mode 100644 src/tests/simple.rs delete mode 100644 src/tests/symlink.rs delete mode 100644 src/tests/tsconfig_paths.rs delete mode 100644 src/tests/tsconfig_project_references.rs delete mode 100644 src/tsconfig.rs delete mode 100644 tests/integration_test.rs delete mode 100644 tests/package.json delete mode 100644 tests/resolve_test.rs diff --git a/Cargo.lock b/Cargo.lock deleted file mode 100644 index 8aa802af..00000000 --- a/Cargo.lock +++ /dev/null @@ -1,858 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "aho-corasick" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" -dependencies = [ - "memchr", -] - -[[package]] -name = "anes" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "735d4f398ca57cfa2880225c2bf81c3b9af3be5bb22e44ae70118dad38713e84" - -[[package]] -name = "autocfg" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "bitflags" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" - -[[package]] -name = "bpaf" -version = "0.9.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3280efcf6d66bc77c2cf9b67dc8acee47a217d9be67dd590b3230dffe663724d" - -[[package]] -name = "cast" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "ciborium" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42e69ffd6f0917f5c029256a24d0161db17cea3997d185db0d35926308770f0e" -dependencies = [ - "ciborium-io", - "ciborium-ll", - "serde", -] - -[[package]] -name = "ciborium-io" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05afea1e0a06c9be33d539b876f1ce3692f4afea2cb41f740e7743225ed1c757" - -[[package]] -name = "ciborium-ll" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57663b653d948a338bfb3eeba9bb2fd5fcfaecb9e199e87e1eda4d9e8b240fd9" -dependencies = [ - "ciborium-io", - "half", -] - -[[package]] -name = "clean-path" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aaa6b4b263a5d737e9bf6b7c09b72c41a5480aec4d7219af827f6564e950b6a5" - -[[package]] -name = "codspeed" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a104ac948e0188b921eb3fcbdd55dcf62e542df4c7ab7e660623f6288302089" -dependencies = [ - "colored", - "libc", - "serde_json", -] - -[[package]] -name = "colored" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbf2150cce219b664a8a70df7a1f933836724b503f8a413af9365b4dcc4d90b8" -dependencies = [ - "lazy_static", - "windows-sys 0.48.0", -] - -[[package]] -name = "convert_case" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec182b0ca2f35d8fc196cf3404988fd8b8c739a4d270ff118a398feb0cbec1ca" -dependencies = [ - "unicode-segmentation", -] - -[[package]] -name = "criterion2" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f22174bed309c964c1720148dfe793f285cc02fd8b13c91205d485f73468d94d" -dependencies = [ - "anes", - "bpaf", - "cast", - "ciborium", - "codspeed", - "colored", - "num-traits", - "oorandom", - "serde", - "serde_json", - "walkdir", -] - -[[package]] -name = "crossbeam-deque" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" -dependencies = [ - "crossbeam-epoch", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.9.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" -dependencies = [ - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" - -[[package]] -name = "crunchy" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" - -[[package]] -name = "ctor" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edb49164822f3ee45b17acd4a208cfc1251410cf0cad9a833234c9890774dd9f" -dependencies = [ - "quote", - "syn", -] - -[[package]] -name = "dashmap" -version = "5.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" -dependencies = [ - "cfg-if", - "hashbrown", - "lock_api", - "once_cell", - "parking_lot_core", -] - -[[package]] -name = "document-features" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef5282ad69563b5fc40319526ba27e0e7363d552a896f0297d54f767717f9b95" -dependencies = [ - "litrs", -] - -[[package]] -name = "dunce" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b" - -[[package]] -name = "either" -version = "1.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dca9240753cf90908d7e4aac30f630662b02aebaa1b58a3cadabdb23385b58b" - -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "filetime" -version = "0.2.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ee447700ac8aa0b2f2bd7bc4462ad686ba06baa6727ac149a2d6277f0d240fd" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall 0.4.1", - "windows-sys 0.52.0", -] - -[[package]] -name = "half" -version = "2.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dd08c532ae367adf81c312a4580bc67f1d0fe8bc9c460520283f4c0ff277888" -dependencies = [ - "cfg-if", - "crunchy", -] - -[[package]] -name = "hashbrown" -version = "0.14.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" - -[[package]] -name = "indexmap" -version = "2.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" -dependencies = [ - "equivalent", - "hashbrown", - "serde", -] - -[[package]] -name = "itoa" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" - -[[package]] -name = "json-strip-comments" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3d129799327c8f80861e467c59b825ba24c277dba6ad0d71a141dc98f9e04ee" - -[[package]] -name = "lazy_static" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" - -[[package]] -name = "libc" -version = "0.2.155" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" - -[[package]] -name = "libloading" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c2a198fb6b0eada2a8df47933734e6d35d350665a33a3593d7164fa52c75c19" -dependencies = [ - "cfg-if", - "windows-targets 0.52.5", -] - -[[package]] -name = "litrs" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4ce301924b7887e9d637144fdade93f9dfff9b60981d4ac161db09720d39aa5" - -[[package]] -name = "lock_api" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" -dependencies = [ - "autocfg", - "scopeguard", -] - -[[package]] -name = "memchr" -version = "2.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" - -[[package]] -name = "napi" -version = "2.16.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfc300228808a0e6aea5a58115c82889240bcf8dab16fc25ad675b33e454b368" -dependencies = [ - "bitflags 2.5.0", - "ctor", - "napi-derive", - "napi-sys", - "once_cell", - "serde", - "serde_json", -] - -[[package]] -name = "napi-build" -version = "2.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1c0f5d67ee408a4685b61f5ab7e58605c8ae3f2b4189f0127d804ff13d5560a" - -[[package]] -name = "napi-derive" -version = "2.16.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0e034ddf6155192cf83f267ede763fe6c164dfa9971585436b16173718d94c4" -dependencies = [ - "cfg-if", - "convert_case", - "napi-derive-backend", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "napi-derive-backend" -version = "1.0.67" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bff2c00437f3b3266391eb5e6aa25d0029187daf5caf05b8e3271468fb5ae73e" -dependencies = [ - "convert_case", - "once_cell", - "proc-macro2", - "quote", - "regex", - "semver", - "syn", -] - -[[package]] -name = "napi-sys" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "427802e8ec3a734331fec1035594a210ce1ff4dc5bc1950530920ab717964ea3" -dependencies = [ - "libloading", -] - -[[package]] -name = "normalize-path" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5438dd2b2ff4c6df6e1ce22d825ed2fa93ee2922235cc45186991717f0a892d" - -[[package]] -name = "num-traits" -version = "0.2.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" -dependencies = [ - "autocfg", -] - -[[package]] -name = "once_cell" -version = "1.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" - -[[package]] -name = "oorandom" -version = "11.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575" - -[[package]] -name = "oxc_napi_resolver" -version = "0.0.0" -dependencies = [ - "napi", - "napi-build", - "napi-derive", - "oxc_resolver", -] - -[[package]] -name = "oxc_resolver" -version = "1.8.1" -dependencies = [ - "criterion2", - "dashmap", - "document-features", - "dunce", - "json-strip-comments", - "normalize-path", - "once_cell", - "rayon", - "rustc-hash", - "serde", - "serde_json", - "thiserror", - "tracing", - "typescript_tsconfig_json", - "vfs", -] - -[[package]] -name = "parking_lot_core" -version = "0.9.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall 0.5.1", - "smallvec", - "windows-targets 0.52.5", -] - -[[package]] -name = "pin-project-lite" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" - -[[package]] -name = "proc-macro2" -version = "1.0.85" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22244ce15aa966053a896d1accb3a6e68469b97c7f33f284b99f0d576879fc23" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.36" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "rayon" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" -dependencies = [ - "either", - "rayon-core", -] - -[[package]] -name = "rayon-core" -version = "1.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" -dependencies = [ - "crossbeam-deque", - "crossbeam-utils", -] - -[[package]] -name = "redox_syscall" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" -dependencies = [ - "bitflags 1.3.2", -] - -[[package]] -name = "redox_syscall" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "469052894dcb553421e483e4209ee581a45100d31b4018de03e5a7ad86374a7e" -dependencies = [ - "bitflags 2.5.0", -] - -[[package]] -name = "regex" -version = "1.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" -dependencies = [ - "aho-corasick", - "memchr", - "regex-automata", - "regex-syntax", -] - -[[package]] -name = "regex-automata" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", -] - -[[package]] -name = "regex-syntax" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" - -[[package]] -name = "rustc-hash" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" - -[[package]] -name = "ryu" -version = "1.0.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" - -[[package]] -name = "same-file" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "scopeguard" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" - -[[package]] -name = "semver" -version = "1.0.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" - -[[package]] -name = "serde" -version = "1.0.203" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7253ab4de971e72fb7be983802300c30b5a7f0c2e56fab8abfc6a214307c0094" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.203" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "serde_json" -version = "1.0.117" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3" -dependencies = [ - "indexmap", - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "smallvec" -version = "1.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" - -[[package]] -name = "syn" -version = "2.0.66" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c42f3f41a2de00b01c0aaad383c5a45241efc8b2d1eda5661812fda5f3cdcff5" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "thiserror" -version = "1.0.61" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.61" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "tracing" -version = "0.1.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" -dependencies = [ - "pin-project-lite", - "tracing-attributes", - "tracing-core", -] - -[[package]] -name = "tracing-attributes" -version = "0.1.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "tracing-core" -version = "0.1.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" -dependencies = [ - "once_cell", -] - -[[package]] -name = "typescript_tsconfig_json" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7cc416eaf05297012ead9d192226fe9a92e9a20f64f8780efb9085aaae9b590" -dependencies = [ - "clean-path", - "indexmap", - "rustc-hash", - "serde", - "serde_json", -] - -[[package]] -name = "unicode-ident" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" - -[[package]] -name = "unicode-segmentation" -version = "1.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" - -[[package]] -name = "vfs" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "654cd097e182a71dbf899178e6b5662c2157dd0b8afd5975de18008f6fc173d1" -dependencies = [ - "filetime", -] - -[[package]] -name = "walkdir" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" -dependencies = [ - "same-file", - "winapi-util", -] - -[[package]] -name = "winapi-util" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b" -dependencies = [ - "windows-sys 0.52.0", -] - -[[package]] -name = "windows-sys" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" -dependencies = [ - "windows-targets 0.48.5", -] - -[[package]] -name = "windows-sys" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" -dependencies = [ - "windows-targets 0.52.5", -] - -[[package]] -name = "windows-targets" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" -dependencies = [ - "windows_aarch64_gnullvm 0.48.5", - "windows_aarch64_msvc 0.48.5", - "windows_i686_gnu 0.48.5", - "windows_i686_msvc 0.48.5", - "windows_x86_64_gnu 0.48.5", - "windows_x86_64_gnullvm 0.48.5", - "windows_x86_64_msvc 0.48.5", -] - -[[package]] -name = "windows-targets" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" -dependencies = [ - "windows_aarch64_gnullvm 0.52.5", - "windows_aarch64_msvc 0.52.5", - "windows_i686_gnu 0.52.5", - "windows_i686_gnullvm", - "windows_i686_msvc 0.52.5", - "windows_x86_64_gnu 0.52.5", - "windows_x86_64_gnullvm 0.52.5", - "windows_x86_64_msvc 0.52.5", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" - -[[package]] -name = "windows_i686_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" - -[[package]] -name = "windows_i686_gnu" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" - -[[package]] -name = "windows_i686_gnullvm" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" - -[[package]] -name = "windows_i686_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" - -[[package]] -name = "windows_i686_msvc" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" diff --git a/fixtures/enhanced_resolve/lib/index.js b/fixtures/enhanced_resolve/lib/index.js deleted file mode 100644 index 1e872e8f..00000000 --- a/fixtures/enhanced_resolve/lib/index.js +++ /dev/null @@ -1 +0,0 @@ -// mimic enhanced-resolved root directory structure diff --git a/fixtures/enhanced_resolve/package.json b/fixtures/enhanced_resolve/package.json deleted file mode 100644 index d1b845b5..00000000 --- a/fixtures/enhanced_resolve/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "enhanced-resolve", - "main": "lib/index.js" -} diff --git a/fixtures/enhanced_resolve/test/.gitignore b/fixtures/enhanced_resolve/test/.gitignore deleted file mode 100644 index bbbec5f4..00000000 --- a/fixtures/enhanced_resolve/test/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# created by symlink.rs -/temp diff --git a/fixtures/enhanced_resolve/test/fixtures/#/a.js b/fixtures/enhanced_resolve/test/fixtures/#/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/a.js b/fixtures/enhanced_resolve/test/fixtures/a.js deleted file mode 100644 index 896ffc6d..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/abc.txt b/fixtures/enhanced_resolve/test/fixtures/abc.txt deleted file mode 100644 index f2ba8f84..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/abc.txt +++ /dev/null @@ -1 +0,0 @@ -abc \ No newline at end of file diff --git a/fixtures/enhanced_resolve/test/fixtures/alias/files/a.js b/fixtures/enhanced_resolve/test/fixtures/alias/files/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/b.js b/fixtures/enhanced_resolve/test/fixtures/b.js deleted file mode 100644 index 11476340..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/b.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function b() { - return "This is b"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/browser/module-a.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/browser/module-a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/browser.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/ignore.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/ignore.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/replaced.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/replaced.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/self.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/self.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/toString.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/toString.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-a.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-b.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-c.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-c.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/a.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/b.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/c.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/c.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/d.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/d.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json deleted file mode 100644 index c13fe23b..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "browser": { - "a.js": "./a", - "./b.js": "./b", - "c.js": "./d.js", - "./d.js": "./c.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/package.json b/fixtures/enhanced_resolve/test/fixtures/browser-module/package.json deleted file mode 100644 index 19ff7739..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/browser-module/package.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "exports": { - "./lib/index.js": "./lib/index.js" - }, - "browser": { - "./lib/ignore.js": false, - "./lib/replaced.js": "./lib/browser", - "module-a": "./browser/module-a.js", - "module-b": "module-c", - "module-c": "module-c", - "./toString": "./lib/toString.js", - "./lib/main.js": "./lib/main.js", - "./main.js": "./lib/main.js", - "./lib/xyz.js": "./xyz.js", - "./xyz.js": "./lib/xyz.js", - "./lib/non-existent.js": "./lib/non-existent.js", - ".": false, - "./number": 1, - "./foo": "./lib/replaced.js?query" - }, - "innerBrowser1": { - "field": { - "browser": { - "./lib/main1.js": "./lib/main.js" - } - } - }, - "innerBrowser2": { - "browser": { - "./lib/main2.js": "./lib/replaced.js" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/builtins/package.json b/fixtures/enhanced_resolve/test/fixtures/builtins/package.json deleted file mode 100644 index 4a54ea96..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/builtins/package.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "name": "builtins", - "private": true, - "imports": { - "#fs": { - "default": "fs" - }, - "#http": { - "node": "node:http" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/c.js b/fixtures/enhanced_resolve/test/fixtures/c.js deleted file mode 100644 index e3aca8aa..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/c.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = function b() { - require("./a"); - return "This is c"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/complex.js b/fixtures/enhanced_resolve/test/fixtures/complex.js deleted file mode 100644 index 1f62db84..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/complex.js +++ /dev/null @@ -1,13 +0,0 @@ -var 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); diff --git a/fixtures/enhanced_resolve/test/fixtures/crypto-js/index.js b/fixtures/enhanced_resolve/test/fixtures/crypto-js/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json b/fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json deleted file mode 100644 index 1d31aa8b..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "crypto-js", - "main": "index.js", - "browser": { - "crypto": false - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/decorated-fs/exists.js b/fixtures/enhanced_resolve/test/fixtures/decorated-fs/exists.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/dirOrFile.js b/fixtures/enhanced_resolve/test/fixtures/dirOrFile.js deleted file mode 100644 index c3cb885f..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/dirOrFile.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "file"; diff --git a/fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js b/fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js deleted file mode 100644 index 85e01cd4..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "dir"; diff --git a/fixtures/enhanced_resolve/test/fixtures/directory-default/directory-default.js b/fixtures/enhanced_resolve/test/fixtures/directory-default/directory-default.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js deleted file mode 100644 index d1007aae..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js +++ /dev/null @@ -1 +0,0 @@ -export default "string"; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts deleted file mode 100644 index cb0ff5c3..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json deleted file mode 100644 index b523a1e9..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "@org/pkg", - "exports": { - "./*.js": { - "types": "./dist/*.d.ts", - "default": "./dist/*.js" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js deleted file mode 100644 index d1007aae..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js +++ /dev/null @@ -1 +0,0 @@ -export default "string"; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts deleted file mode 100644 index cb0ff5c3..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json deleted file mode 100644 index 8e55fb46..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "@raviqqe/hidash", - "exports": { - "./*.js": { - "types": "./dist/*.d.ts", - "default": "./dist/*.js" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json deleted file mode 100644 index f0edf449..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "exports-field", - "version": "1.0.0", - "exports": { - ".": "./a/../b/../../pack1/index.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/pack1/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/pack1/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/a.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/a.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json deleted file mode 100644 index 6b105c08..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "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/": { - "webpack": ["./lib/lib2/", "./lib/"], - "node": "./lib/", - "default": "./lib/" - }, - "./dist/a.js": "./../../a.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json deleted file mode 100644 index 0012a3de..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "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" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/umd.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/umd.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field/package.json deleted file mode 100644 index 5fa72bb5..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "@exports-field/core", - "version": "1.0.0", - "exports": "./a.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json deleted file mode 100644 index e6f12074..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "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/lib2/", "./lib/"], - "node": "./lib/", - "default": "./lib/" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/index b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/index deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json deleted file mode 100644 index 1a838f49..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "name": "exports-field", - "exportsField": { - "exports": "./main.js" - }, - "ex": "./index", - "broken": { - ".": "./src" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/src/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/src/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.ts b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.mts b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.mts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mjs b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mjs deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mts.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mts.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.ts b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/app.module.js b/fixtures/enhanced_resolve/test/fixtures/extensions/app.module.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.js b/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/foo.js b/fixtures/enhanced_resolve/test/fixtures/extensions/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/foo.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/foo.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/index.js b/fixtures/enhanced_resolve/test/fixtures/extensions/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/index.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module.js b/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module/index.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/package.json b/fixtures/enhanced_resolve/test/fixtures/extensions/package.json deleted file mode 100644 index 5e55a1e8..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/extensions/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "./index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/file.load1 b/fixtures/enhanced_resolve/test/fixtures/file.load1 deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/file.load2 b/fixtures/enhanced_resolve/test/fixtures/file.load2 deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/foo/index.js b/fixtures/enhanced_resolve/test/fixtures/foo/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/foo/package.json b/fixtures/enhanced_resolve/test/fixtures/foo/package.json deleted file mode 100644 index da86787a..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/foo/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "foo", - "version": "1.0.0" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json deleted file mode 100644 index aa2be496..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "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" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/internal/file.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/internal/file.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/y/y.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/y/y.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/internal/i.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/internal/i.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/nested/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js deleted file mode 100644 index e5b70a86..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = { nested: "nested" } diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-3/nested/f/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-3/nested/f/nested/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-4/f/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-4/f/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f$/$.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f$/$.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f/$.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f/$.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/nested/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/a.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/a.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/b.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/dir/b.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/dir/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/index.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json deleted file mode 100644 index 8d8d3a46..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "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/lib2/", "./lib/"], - "node": "./lib/", - "default": "./lib/" - }, - "./dist/a.js": "./../../a.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/c/index.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/c/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/imports-field/package.json deleted file mode 100644 index 248351a9..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "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" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/a.js b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json deleted file mode 100644 index ded7faa2..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json +++ /dev/null @@ -1,2 +0,0 @@ -{ - "main": "./a.js", diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/a.js b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/package.json b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/package.json deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/issue-238/package.json b/fixtures/enhanced_resolve/test/fixtures/issue-238/package.json deleted file mode 100644 index 352055cd..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/issue-238/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "private": true -} diff --git a/fixtures/enhanced_resolve/test/fixtures/issue-238/src/a/config.js b/fixtures/enhanced_resolve/test/fixtures/issue-238/src/a/config.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/issue-238/src/common/config/myObjectFile.js b/fixtures/enhanced_resolve/test/fixtures/issue-238/src/common/config/myObjectFile.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/lib.js b/fixtures/enhanced_resolve/test/fixtures/lib.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/lib/complex1.js b/fixtures/enhanced_resolve/test/fixtures/lib/complex1.js deleted file mode 100644 index b3de3d70..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/lib/complex1.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "lib complex1"; diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self/index.js b/fixtures/enhanced_resolve/test/fixtures/main-field-self/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json b/fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json deleted file mode 100644 index a2b6f341..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "./" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self2/index.js b/fixtures/enhanced_resolve/test/fixtures/main-field-self2/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json b/fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json deleted file mode 100644 index 4fa6f730..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "." -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main1.js b/fixtures/enhanced_resolve/test/fixtures/main1.js deleted file mode 100644 index 168f2a1e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main1.js +++ /dev/null @@ -1,9 +0,0 @@ -var a = require("./a"); -if (x) { - for (var i = 0; i < 100; i++) { - while (true) require("./b"); - do { - i++; - } while (require("m1/a")()); - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main2.js b/fixtures/enhanced_resolve/test/fixtures/main2.js deleted file mode 100644 index 39f062b1..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main2.js +++ /dev/null @@ -1,12 +0,0 @@ -var 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"); - }); - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main3.js b/fixtures/enhanced_resolve/test/fixtures/main3.js deleted file mode 100644 index 1c180166..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main3.js +++ /dev/null @@ -1,4 +0,0 @@ -var a = require("./a"); -require.ensure([], function(require) { - require("./c.js"); -}); diff --git a/fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js b/fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js deleted file mode 100644 index 997c1051..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is nested m1/a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/no#fragment/#/#.js b/fixtures/enhanced_resolve/test/fixtures/no#fragment/#/#.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/no.js b/fixtures/enhanced_resolve/test/fixtures/no.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/browser.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/browser.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/main.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json deleted file mode 100644 index c469e1fd..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "main": "./main.js", - "browser": "./browser.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js deleted file mode 100644 index 549620a5..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "the correct a.js"; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js deleted file mode 100644 index 5db6632e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = " :) " + require("m2/b.js"); diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js deleted file mode 100644 index d308569d..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require("m1/a") + require("m1"); diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js deleted file mode 100644 index cb8127e8..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "Step2"; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json deleted file mode 100644 index 8d6dfa56..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "dash-name", - "exports": "./index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json deleted file mode 100644 index 4fd8706e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "dash", - "exports": "./index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/invalidPackageJson/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/invalidPackageJson/package.json deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js deleted file mode 100644 index 46fc8e6c..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is m1/a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js deleted file mode 100644 index 8565c244..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is m1/b"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js deleted file mode 100644 index 34faaaf5..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "This is m2/b"; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/file.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/file.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js b/fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js deleted file mode 100644 index 997c1051..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is nested m1/a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/dir/index.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/dir/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/index.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/main.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/browser.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/browser.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/index.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json deleted file mode 100644 index e20ceaeb..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "main": "main.js", - "browser": { - "./package-alias/index.js": "./package-alias/browser.js", - "module": "pkg/dir/index" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/typescript/index.ts b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/typescript/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json deleted file mode 100644 index 4a1f838e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "@exports-field/core", - "version": "1.0.0", - "exports": { - ".": "./a.js", - "./x": "./a.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/prefer-pnp/alternative-modules/m1/b.js b/fixtures/enhanced_resolve/test/fixtures/prefer-pnp/alternative-modules/m1/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.css b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.css deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.js b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json deleted file mode 100644 index 14ab704d..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/index.css b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/index.css deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/module.js b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/module.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json deleted file mode 100644 index ee0eb71b..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "main": "../../../c.js", - "module": "module.js", - "style": "index.css" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/roots_fall_through/index.js b/fixtures/enhanced_resolve/test/fixtures/roots_fall_through/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/main.js b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json deleted file mode 100644 index 70a0f20f..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "browser": { - "./index.js": "./main.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/lib/index.js b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/lib/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/main.js b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json deleted file mode 100644 index 2af9e0d1..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "./main.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/shortcutdir.js/a.js b/fixtures/enhanced_resolve/test/fixtures/shortcutdir.js/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/b b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/b deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/c b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/c deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/a b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/a deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/b b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/b deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/b/foo/a b/fixtures/enhanced_resolve/test/fixtures/yield/b/foo/a deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/a b/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/a deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json b/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json deleted file mode 100644 index 0acc4b4c..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "foo", - "version": "1.0.0", - "browser": { - "./a": false - } -} diff --git "a/fixtures/enhanced_resolve/test/fixtures/\346\265\213\350\257\225.js" "b/fixtures/enhanced_resolve/test/fixtures/\346\265\213\350\257\225.js" deleted file mode 100644 index e69de29b..00000000 diff --git "a/fixtures/misc/\344\270\255\346\226\207/\344\270\255\346\226\207.js" "b/fixtures/misc/\344\270\255\346\226\207/\344\270\255\346\226\207.js" deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/pnpm8/.gitignore b/fixtures/pnpm8/.gitignore deleted file mode 100644 index 3c3629e6..00000000 --- a/fixtures/pnpm8/.gitignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/fixtures/pnpm8/package.json b/fixtures/pnpm8/package.json deleted file mode 100644 index cbced892..00000000 --- a/fixtures/pnpm8/package.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "name": "pnpm8", - "version": "1.0.0", - "private": true, - "engines": { - "node": ">=16.0.0" - }, - "packageManager": "pnpm@8.10.5", - "devDependencies": { - "axios": "1.6.2", - "styled-components": "6.1.1", - "postcss": "8.4.33" - } -} diff --git a/fixtures/pnpm8/pnpm-lock.yaml b/fixtures/pnpm8/pnpm-lock.yaml deleted file mode 100644 index e51dfd6a..00000000 --- a/fixtures/pnpm8/pnpm-lock.yaml +++ /dev/null @@ -1,212 +0,0 @@ -lockfileVersion: '6.0' - -settings: - autoInstallPeers: true - excludeLinksFromLockfile: false - -devDependencies: - axios: - specifier: 1.6.2 - version: 1.6.2 - postcss: - specifier: 8.4.33 - version: 8.4.33 - styled-components: - specifier: 6.1.1 - version: 6.1.1(react-dom@18.2.0)(react@18.2.0) - -packages: - - /@emotion/is-prop-valid@1.2.1: - resolution: {integrity: sha512-61Mf7Ufx4aDxx1xlDeOm8aFFigGHE4z+0sKCa+IHCeZKiyP9RLD0Mmx7m8b9/Cf37f7NAvQOOJAbQQGVr5uERw==} - dependencies: - '@emotion/memoize': 0.8.1 - dev: true - - /@emotion/memoize@0.8.1: - resolution: {integrity: sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA==} - dev: true - - /@emotion/unitless@0.8.1: - resolution: {integrity: sha512-KOEGMu6dmJZtpadb476IsZBclKvILjopjUii3V+7MnXIQCYh8W3NgNcgwo21n9LXZX6EDIKvqfjYxXebDwxKmQ==} - dev: true - - /@types/stylis@4.2.4: - resolution: {integrity: sha512-36ZrGJ8fgtBr6nwNnuJ9jXIj+bn/pF6UoqmrQT7+Y99+tFFeHHsoR54+194dHdyhPjgbeoNz3Qru0oRt0l6ASQ==} - dev: true - - /asynckit@0.4.0: - resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} - dev: true - - /axios@1.6.2: - resolution: {integrity: sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A==} - dependencies: - follow-redirects: 1.15.3 - form-data: 4.0.0 - proxy-from-env: 1.1.0 - transitivePeerDependencies: - - debug - dev: true - - /camelize@1.0.1: - resolution: {integrity: sha512-dU+Tx2fsypxTgtLoE36npi3UqcjSSMNYfkqgmoEhtZrraP5VWq0K7FkWVTYa8eMPtnU/G2txVsfdCJTn9uzpuQ==} - dev: true - - /combined-stream@1.0.8: - resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} - engines: {node: '>= 0.8'} - dependencies: - delayed-stream: 1.0.0 - dev: true - - /css-color-keywords@1.0.0: - resolution: {integrity: sha512-FyyrDHZKEjXDpNJYvVsV960FiqQyXc/LlYmsxl2BcdMb2WPx0OGRVgTg55rPSyLSNMqP52R9r8geSp7apN3Ofg==} - engines: {node: '>=4'} - dev: true - - /css-to-react-native@3.2.0: - resolution: {integrity: sha512-e8RKaLXMOFii+02mOlqwjbD00KSEKqblnpO9e++1aXS1fPQOpS1YoqdVHBqPjHNoxeF2mimzVqawm2KCbEdtHQ==} - dependencies: - camelize: 1.0.1 - css-color-keywords: 1.0.0 - postcss-value-parser: 4.2.0 - dev: true - - /csstype@3.1.2: - resolution: {integrity: sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==} - dev: true - - /delayed-stream@1.0.0: - resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} - engines: {node: '>=0.4.0'} - dev: true - - /follow-redirects@1.15.3: - resolution: {integrity: sha512-1VzOtuEM8pC9SFU1E+8KfTjZyMztRsgEfwQl44z8A25uy13jSzTj6dyK2Df52iV0vgHCfBwLhDWevLn95w5v6Q==} - engines: {node: '>=4.0'} - peerDependencies: - debug: '*' - peerDependenciesMeta: - debug: - optional: true - dev: true - - /form-data@4.0.0: - resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==} - engines: {node: '>= 6'} - dependencies: - asynckit: 0.4.0 - combined-stream: 1.0.8 - mime-types: 2.1.35 - dev: true - - /js-tokens@4.0.0: - resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} - dev: true - - /loose-envify@1.4.0: - resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==} - hasBin: true - dependencies: - js-tokens: 4.0.0 - dev: true - - /mime-db@1.52.0: - resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} - engines: {node: '>= 0.6'} - dev: true - - /mime-types@2.1.35: - resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} - engines: {node: '>= 0.6'} - dependencies: - mime-db: 1.52.0 - dev: true - - /nanoid@3.3.7: - resolution: {integrity: sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==} - engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} - hasBin: true - dev: true - - /picocolors@1.0.0: - resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==} - dev: true - - /postcss-value-parser@4.2.0: - resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==} - dev: true - - /postcss@8.4.33: - resolution: {integrity: sha512-Kkpbhhdjw2qQs2O2DGX+8m5OVqEcbB9HRBvuYM9pgrjEFUg30A9LmXNlTAUj4S9kgtGyrMbTzVjH7E+s5Re2yg==} - engines: {node: ^10 || ^12 || >=14} - dependencies: - nanoid: 3.3.7 - picocolors: 1.0.0 - source-map-js: 1.0.2 - dev: true - - /proxy-from-env@1.1.0: - resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==} - dev: true - - /react-dom@18.2.0(react@18.2.0): - resolution: {integrity: sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==} - peerDependencies: - react: ^18.2.0 - dependencies: - loose-envify: 1.4.0 - react: 18.2.0 - scheduler: 0.23.0 - dev: true - - /react@18.2.0: - resolution: {integrity: sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==} - engines: {node: '>=0.10.0'} - dependencies: - loose-envify: 1.4.0 - dev: true - - /scheduler@0.23.0: - resolution: {integrity: sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw==} - dependencies: - loose-envify: 1.4.0 - dev: true - - /shallowequal@1.1.0: - resolution: {integrity: sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ==} - dev: true - - /source-map-js@1.0.2: - resolution: {integrity: sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==} - engines: {node: '>=0.10.0'} - dev: true - - /styled-components@6.1.1(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-cpZZP5RrKRIClBW5Eby4JM1wElLVP4NQrJbJ0h10TidTyJf4SIIwa3zLXOoPb4gJi8MsJ8mjq5mu2IrEhZIAcQ==} - engines: {node: '>= 16'} - peerDependencies: - react: '>= 16.8.0' - react-dom: '>= 16.8.0' - dependencies: - '@emotion/is-prop-valid': 1.2.1 - '@emotion/unitless': 0.8.1 - '@types/stylis': 4.2.4 - css-to-react-native: 3.2.0 - csstype: 3.1.2 - postcss: 8.4.33 - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - shallowequal: 1.1.0 - stylis: 4.3.0 - tslib: 2.6.2 - dev: true - - /stylis@4.3.0: - resolution: {integrity: sha512-E87pIogpwUsUwXw7dNyU4QDjdgVMy52m+XEOPEKUn161cCzWjjhPSQhByfd1CcNvrOLnXQ6OnnZDwnJrz/Z4YQ==} - dev: true - - /tslib@2.6.2: - resolution: {integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==} - dev: true diff --git a/fixtures/tsconfig/cases/builtins/thing.js b/fixtures/tsconfig/cases/builtins/thing.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/builtins/tsconfig.json b/fixtures/tsconfig/cases/builtins/tsconfig.json deleted file mode 100644 index 36aa1a4d..00000000 --- a/fixtures/tsconfig/cases/builtins/tsconfig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compilerOptions": { - "baseUrl": "." - } -} diff --git a/fixtures/tsconfig/cases/exports/index.js b/fixtures/tsconfig/cases/exports/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/exports/tsconfig.json b/fixtures/tsconfig/cases/exports/tsconfig.json deleted file mode 100644 index f0e3159b..00000000 --- a/fixtures/tsconfig/cases/exports/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-exports" -} diff --git a/fixtures/tsconfig/cases/extends-extension/base-tsconfig.json b/fixtures/tsconfig/cases/extends-extension/base-tsconfig.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/cases/extends-extension/base-tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/cases/extends-extension/foo.js b/fixtures/tsconfig/cases/extends-extension/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-extension/tsconfig.json b/fixtures/tsconfig/cases/extends-extension/tsconfig.json deleted file mode 100644 index 0ae4c6a3..00000000 --- a/fixtures/tsconfig/cases/extends-extension/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./base-tsconfig" -} diff --git a/fixtures/tsconfig/cases/extends-extensionless/foo.js b/fixtures/tsconfig/cases/extends-extensionless/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-extensionless/tsconfig.json b/fixtures/tsconfig/cases/extends-extensionless/tsconfig.json deleted file mode 100644 index c36cb7d4..00000000 --- a/fixtures/tsconfig/cases/extends-extensionless/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-field/conf" -} diff --git a/fixtures/tsconfig/cases/extends-multiple/foo.js b/fixtures/tsconfig/cases/extends-multiple/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-multiple/tsconfig.json b/fixtures/tsconfig/cases/extends-multiple/tsconfig.json deleted file mode 100644 index aa2ae783..00000000 --- a/fixtures/tsconfig/cases/extends-multiple/tsconfig.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": ["../extends-extension", "../extends-paths"], - "compilerOptions": { - "baseUrl": ".", - }, -} diff --git a/fixtures/tsconfig/cases/extends-not-found/index.js b/fixtures/tsconfig/cases/extends-not-found/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-not-found/tsconfig.json b/fixtures/tsconfig/cases/extends-not-found/tsconfig.json deleted file mode 100644 index 99df91da..00000000 --- a/fixtures/tsconfig/cases/extends-not-found/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./not-found" -} diff --git a/fixtures/tsconfig/cases/extends-paths/src/index.js b/fixtures/tsconfig/cases/extends-paths/src/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-paths/tsconfig.base.json b/fixtures/tsconfig/cases/extends-paths/tsconfig.base.json deleted file mode 100644 index 5c64b067..00000000 --- a/fixtures/tsconfig/cases/extends-paths/tsconfig.base.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "@/*": ["./*"] - } - } -} diff --git a/fixtures/tsconfig/cases/extends-paths/tsconfig.json b/fixtures/tsconfig/cases/extends-paths/tsconfig.json deleted file mode 100644 index 51086018..00000000 --- a/fixtures/tsconfig/cases/extends-paths/tsconfig.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": "./tsconfig.base.json", - "compilerOptions": { - "baseUrl": "src", - }, -} diff --git a/fixtures/tsconfig/cases/field/index.js b/fixtures/tsconfig/cases/field/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/field/tsconfig.json b/fixtures/tsconfig/cases/field/tsconfig.json deleted file mode 100644 index 9f86c3f4..00000000 --- a/fixtures/tsconfig/cases/field/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-field" -} diff --git a/fixtures/tsconfig/cases/index/index.js b/fixtures/tsconfig/cases/index/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/index/tsconfig.json b/fixtures/tsconfig/cases/index/tsconfig.json deleted file mode 100644 index d20b1774..00000000 --- a/fixtures/tsconfig/cases/index/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-index" -} diff --git a/fixtures/tsconfig/cases/paths_template_variable/foo.js b/fixtures/tsconfig/cases/paths_template_variable/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json b/fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json deleted file mode 100644 index a1a37bb6..00000000 --- a/fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "../../tsconfig_template_variable.json" -} diff --git a/fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json b/fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json deleted file mode 100644 index e7d8e5e5..00000000 --- a/fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "compilerOptions": { - "composite": true, - "paths": { - "foo": ["${configDir}/foo.js"] - } - } -} diff --git a/fixtures/tsconfig/cases/project_references/app/aliased/index.ts b/fixtures/tsconfig/cases/project_references/app/aliased/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/app/index.ts b/fixtures/tsconfig/cases/project_references/app/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/app/tsconfig.json b/fixtures/tsconfig/cases/project_references/app/tsconfig.json deleted file mode 100644 index 7036d2bb..00000000 --- a/fixtures/tsconfig/cases/project_references/app/tsconfig.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "extends": "../tsconfig.base.json", - "compilerOptions": { - "baseUrl": "./", - "paths": { - "@/*": ["./aliased/*"] - } - }, - "references": [ - { - "path": "../project_a/conf.json" - }, - { - "path": "../project_b" - }, - { - "path": "../project_c/tsconfig.json" - }, - { - "path": "../../paths_template_variable/tsconfig2.json" - } - ] -} diff --git a/fixtures/tsconfig/cases/project_references/project_a/aliased/index.ts b/fixtures/tsconfig/cases/project_references/project_a/aliased/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_a/conf.json b/fixtures/tsconfig/cases/project_references/project_a/conf.json deleted file mode 100644 index 4d389d7a..00000000 --- a/fixtures/tsconfig/cases/project_references/project_a/conf.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "compilerOptions": { - "composite": true, - "paths": { - "@/*": ["./aliased/*"] - } - } -} diff --git a/fixtures/tsconfig/cases/project_references/project_a/index.ts b/fixtures/tsconfig/cases/project_references/project_a/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_b/src/aliased/index.ts b/fixtures/tsconfig/cases/project_references/project_b/src/aliased/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_b/tsconfig.json b/fixtures/tsconfig/cases/project_references/project_b/tsconfig.json deleted file mode 100644 index 4ab05cd8..00000000 --- a/fixtures/tsconfig/cases/project_references/project_b/tsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "compilerOptions": { - "composite": true, - "baseUrl": "./src", - "paths": { - "@/*": ["./aliased/*"] - } - } -} diff --git a/fixtures/tsconfig/cases/project_references/project_c/index.ts b/fixtures/tsconfig/cases/project_references/project_c/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_c/tsconfig.json b/fixtures/tsconfig/cases/project_references/project_c/tsconfig.json deleted file mode 100644 index fe520939..00000000 --- a/fixtures/tsconfig/cases/project_references/project_c/tsconfig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compilerOptions": { - "composite": true - } -} diff --git a/fixtures/tsconfig/cases/project_references/tsconfig.base.json b/fixtures/tsconfig/cases/project_references/tsconfig.base.json deleted file mode 100644 index 88ccffe7..00000000 --- a/fixtures/tsconfig/cases/project_references/tsconfig.base.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "compilerOptions": { - } -} diff --git a/fixtures/tsconfig/cases/suffixes/a.ios.ts b/fixtures/tsconfig/cases/suffixes/a.ios.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/a.ts b/fixtures/tsconfig/cases/suffixes/a.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/b.ts b/fixtures/tsconfig/cases/suffixes/b.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/c-test.ts b/fixtures/tsconfig/cases/suffixes/c-test.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/index.ts b/fixtures/tsconfig/cases/suffixes/index.ts deleted file mode 100644 index b09939b9..00000000 --- a/fixtures/tsconfig/cases/suffixes/index.ts +++ /dev/null @@ -1 +0,0 @@ -import './a'; diff --git a/fixtures/tsconfig/cases/suffixes/tsconfig.json b/fixtures/tsconfig/cases/suffixes/tsconfig.json deleted file mode 100644 index 4c2ccc8f..00000000 --- a/fixtures/tsconfig/cases/suffixes/tsconfig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compilerOptions": { - "moduleSuffixes": [".ios", "-test", ""] - } -} diff --git a/fixtures/tsconfig/cases/trailing-comma/bar.js b/fixtures/tsconfig/cases/trailing-comma/bar.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/trailing-comma/index.js b/fixtures/tsconfig/cases/trailing-comma/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/trailing-comma/tsconfig.json b/fixtures/tsconfig/cases/trailing-comma/tsconfig.json deleted file mode 100644 index 6dc20ca5..00000000 --- a/fixtures/tsconfig/cases/trailing-comma/tsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "compilerOptions": { - "paths": { - /* some comment */ - "foo": ["bar.js"], - }, - }, - // another comment -} diff --git a/fixtures/tsconfig/foo.js b/fixtures/tsconfig/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/nested/index.js b/fixtures/tsconfig/nested/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/nested/test.js b/fixtures/tsconfig/nested/test.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/nested/tsconfig.json b/fixtures/tsconfig/nested/tsconfig.json deleted file mode 100644 index 6deb3011..00000000 --- a/fixtures/tsconfig/nested/tsconfig.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "extends": "..", - "compilerOptions": { - "paths": { - "ts-path": ["test.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-exports/conf.json b/fixtures/tsconfig/node_modules/tsconfig-exports/conf.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-exports/conf.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-exports/foo.js b/fixtures/tsconfig/node_modules/tsconfig-exports/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-exports/package.json b/fixtures/tsconfig/node_modules/tsconfig-exports/package.json deleted file mode 100644 index be0ddee6..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-exports/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "tsconfig-exports", - "private": true, - "exports": { - ".": "./conf.json" - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-field/conf.json b/fixtures/tsconfig/node_modules/tsconfig-field/conf.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-field/conf.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-field/foo.js b/fixtures/tsconfig/node_modules/tsconfig-field/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-field/package.json b/fixtures/tsconfig/node_modules/tsconfig-field/package.json deleted file mode 100644 index 7138fdde..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-field/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "tsconfig-field", - "private": true, - "tsconfig": "conf.json" -} \ No newline at end of file diff --git a/fixtures/tsconfig/node_modules/tsconfig-index/foo.js b/fixtures/tsconfig/node_modules/tsconfig-index/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-index/package.json b/fixtures/tsconfig/node_modules/tsconfig-index/package.json deleted file mode 100644 index eb2431e7..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-index/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "tsconfig-index", - "private": true -} \ No newline at end of file diff --git a/fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json b/fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-not-used/foo.js b/fixtures/tsconfig/node_modules/tsconfig-not-used/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json b/fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json deleted file mode 100644 index eb16d127..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "ts-path": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/package.json b/fixtures/tsconfig/package.json deleted file mode 100755 index f48acd1c..00000000 --- a/fixtures/tsconfig/package.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "name": "resolver", - "private": true, - "alias": { - "aliased": "foo", - "aliased-file": "./bar.js", - "something": "./nested/test.js", - "aliasedfolder": "./nested", - "aliasedabsolute": "/nested", - "foo/bar": "./bar.js", - "glob/*/*": "./nested/$2", - "./baz": "./bar.js", - "url": false - }, - "imports": { - "#test": "./bar.js" - }, - "dependencies": { - "foo": "^0.3.4" - }, - "peerDependencies": { - "bar": "*" - } -} diff --git a/fixtures/tsconfig/tsconfig.json b/fixtures/tsconfig/tsconfig.json deleted file mode 100644 index eb16d127..00000000 --- a/fixtures/tsconfig/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "ts-path": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/tsconfig_template_variable.json b/fixtures/tsconfig/tsconfig_template_variable.json deleted file mode 100644 index 6f272344..00000000 --- a/fixtures/tsconfig/tsconfig_template_variable.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["${configDir}/foo.js"] - } - } -} diff --git a/napi/__test__/resolver.spec.mjs b/napi/__test__/resolver.spec.mjs deleted file mode 100644 index 42bafba9..00000000 --- a/napi/__test__/resolver.spec.mjs +++ /dev/null @@ -1,259 +0,0 @@ -import { join } from 'node:path' -import { fileURLToPath } from 'node:url' - -import test from 'ava' - -let ResolverFactory - -if (process.env.WASI_TEST) { - const wasi = await import('../resolver.wasi.cjs') - ResolverFactory = wasi.ResolverFactory -} else { - const napi = await import('../index.js') - ResolverFactory = napi.ResolverFactory -} - -const currentDir = join(fileURLToPath(import.meta.url), '..') - -const enhancedResolveRoot = join( - currentDir, - '..', - '..', - 'fixtures', - 'enhanced_resolve', - 'test', - 'fixtures' -) - -// https://github.com/webpack/enhanced-resolve/blob/main/test/resolve.test.js - -for (const [title, context, request, expected] of [ - [ - 'absolute path', - enhancedResolveRoot, - join(enhancedResolveRoot, 'main1.js'), - join(enhancedResolveRoot, 'main1.js'), - ], - [ - 'file with .js', - enhancedResolveRoot, - './main1.js', - join(enhancedResolveRoot, 'main1.js'), - ], - [ - 'file without extension', - enhancedResolveRoot, - './main1', - join(enhancedResolveRoot, 'main1.js'), - ], - [ - 'another file with .js', - enhancedResolveRoot, - './a.js', - join(enhancedResolveRoot, 'a.js'), - ], - [ - 'another file without extension', - enhancedResolveRoot, - './a', - join(enhancedResolveRoot, 'a.js'), - ], - [ - 'file in module with .js', - enhancedResolveRoot, - 'm1/a.js', - join(enhancedResolveRoot, 'node_modules/m1/a.js'), - ], - [ - 'file in module without extension', - enhancedResolveRoot, - 'm1/a', - join(enhancedResolveRoot, 'node_modules/m1/a.js'), - ], - [ - 'another file in module without extension', - enhancedResolveRoot, - 'complexm/step1', - join(enhancedResolveRoot, 'node_modules/complexm/step1.js'), - ], - [ - 'from submodule to file in sibling module', - join(enhancedResolveRoot, 'node_modules/complexm'), - 'm2/b.js', - join(enhancedResolveRoot, 'node_modules/m2/b.js'), - ], - [ - 'from nested directory to overwritten file in module', - join(enhancedResolveRoot, 'multiple_modules'), - 'm1/a.js', - join(enhancedResolveRoot, 'multiple_modules/node_modules/m1/a.js'), - ], - [ - 'from nested directory to not overwritten file in module', - join(enhancedResolveRoot, 'multiple_modules'), - 'm1/b.js', - join(enhancedResolveRoot, 'node_modules/m1/b.js'), - ], - [ - 'file with query', - enhancedResolveRoot, - './main1.js?query', - join(enhancedResolveRoot, 'main1.js?query'), - ], - [ - 'file with fragment', - enhancedResolveRoot, - './main1.js#fragment', - join(enhancedResolveRoot, 'main1.js#fragment'), - ], - [ - 'file with fragment and query', - enhancedResolveRoot, - './main1.js#fragment?query', - join(enhancedResolveRoot, 'main1.js#fragment?query'), - ], - [ - 'file with query and fragment', - enhancedResolveRoot, - './main1.js?#fragment', - join(enhancedResolveRoot, 'main1.js?#fragment'), - ], - - [ - 'file with query (unicode)', - enhancedResolveRoot, - './测试.js?query', - join(enhancedResolveRoot, '测试.js?query'), - ], - [ - 'file with fragment (unicode)', - enhancedResolveRoot, - './测试.js#fragment', - join(enhancedResolveRoot, '测试.js#fragment'), - ], - [ - 'file with fragment and query (unicode)', - enhancedResolveRoot, - './测试.js#fragment?query', - join(enhancedResolveRoot, '测试.js#fragment?query'), - ], - [ - 'file with query and fragment (unicode)', - enhancedResolveRoot, - './测试.js?#fragment', - join(enhancedResolveRoot, '测试.js?#fragment'), - ], - - [ - 'file in module with query', - enhancedResolveRoot, - 'm1/a?query', - join(enhancedResolveRoot, 'node_modules/m1/a.js?query'), - ], - [ - 'file in module with fragment', - enhancedResolveRoot, - 'm1/a#fragment', - join(enhancedResolveRoot, 'node_modules/m1/a.js#fragment'), - ], - [ - 'file in module with fragment and query', - enhancedResolveRoot, - 'm1/a#fragment?query', - join(enhancedResolveRoot, 'node_modules/m1/a.js#fragment?query'), - ], - [ - 'file in module with query and fragment', - enhancedResolveRoot, - 'm1/a?#fragment', - join(enhancedResolveRoot, 'node_modules/m1/a.js?#fragment'), - ], - [ - 'differ between directory and file, resolve file', - enhancedResolveRoot, - './dirOrFile', - join(enhancedResolveRoot, 'dirOrFile.js'), - ], - [ - 'differ between directory and file, resolve directory', - enhancedResolveRoot, - './dirOrFile/', - join(enhancedResolveRoot, 'dirOrFile/index.js'), - ], - [ - 'find node_modules outside of node_modules', - join(enhancedResolveRoot, 'browser-module/node_modules'), - 'm1/a', - join(enhancedResolveRoot, 'node_modules/m1/a.js'), - ], - [ - "don't crash on main field pointing to self", - enhancedResolveRoot, - './main-field-self', - join(enhancedResolveRoot, './main-field-self/index.js'), - ], - [ - "don't crash on main field pointing to self (2)", - enhancedResolveRoot, - './main-field-self2', - join(enhancedResolveRoot, './main-field-self2/index.js'), - ], - // enhanced-resolve has `#` prepended with a `\0`, they are removed from the - // following 3 expected test results. - // See https://github.com/webpack/enhanced-resolve#escaping - [ - 'handle fragment edge case (no fragment)', - enhancedResolveRoot, - './no#fragment/#/#', - join(enhancedResolveRoot, 'no#fragment', '#', '#.js'), - ], - [ - 'handle fragment edge case (fragment)', - enhancedResolveRoot, - './no#fragment/#/', - join(enhancedResolveRoot, 'no.js#fragment') + '/#/', - ], - [ - 'handle fragment escaping', - enhancedResolveRoot, - './no\0#fragment/\0#/\0##fragment', - join(enhancedResolveRoot, 'no#fragment', '#', '#.js#fragment'), - ], -]) { - test(title, (t) => { - const resolver = new ResolverFactory({ - modules: ['src/a', 'src/b', 'src/common', 'node_modules'], - extensions: ['.js', '.jsx', '.ts', '.tsx'], - }) - - t.is(resolver.sync(context, request).path, expected) - }) -} - -test('resolve pnpm package', (t) => { - const pnpmProjectPath = join(currentDir, '..', '..', 'fixtures', 'pnpm8') - const resolver = new ResolverFactory({ - aliasFields: ['browser'], - }) - t.deepEqual(resolver.sync(pnpmProjectPath, 'styled-components'), { - path: join( - pnpmProjectPath, - 'node_modules/.pnpm/styled-components@6.1.1_react-dom@18.2.0_react@18.2.0/node_modules/styled-components/dist/styled-components.browser.cjs.js' - ), - }) - t.deepEqual( - resolver.sync( - join( - pnpmProjectPath, - 'node_modules/.pnpm/styled-components@6.1.1_react-dom@18.2.0_react@18.2.0/node_modules/styled-components' - ), - 'react' - ), - { - path: join( - pnpmProjectPath, - 'node_modules/.pnpm/react@18.2.0/node_modules/react/index.js' - ), - } - ) -}) diff --git a/napi/src/lib.rs b/napi/src/lib.rs deleted file mode 100644 index 238f99c4..00000000 --- a/napi/src/lib.rs +++ /dev/null @@ -1,166 +0,0 @@ -extern crate napi; -extern crate napi_derive; -extern crate oxc_resolver; - -use std::path::{Path, PathBuf}; - -use napi_derive::napi; -use oxc_resolver::{ResolveOptions, Resolver}; - -use self::options::{NapiResolveOptions, StrOrStrList}; - -mod options; - -#[napi(object)] -pub struct ResolveResult { - pub path: Option, - pub error: Option, -} - -fn resolve(resolver: &Resolver, path: &Path, request: &str) -> ResolveResult { - match resolver.resolve(path, request) { - Ok(resolution) => ResolveResult { - path: Some(resolution.full_path().to_string_lossy().to_string()), - error: None, - }, - Err(err) => ResolveResult { path: None, error: Some(err.to_string()) }, - } -} - -#[allow(clippy::needless_pass_by_value)] -#[napi] -pub fn sync(path: String, request: String) -> ResolveResult { - let path = PathBuf::from(path); - let resolver = Resolver::new(ResolveOptions::default()); - resolve(&resolver, &path, &request) -} - -#[napi] -pub struct ResolverFactory { - resolver: Resolver, -} - -#[napi] -impl ResolverFactory { - #[napi(constructor)] - pub fn new(options: NapiResolveOptions) -> Self { - Self { resolver: Resolver::new(Self::normalize_options(options)) } - } - - #[napi] - pub fn default() -> Self { - let default_options = ResolveOptions::default(); - Self { resolver: Resolver::new(default_options) } - } - - /// Clone the resolver using the same underlying cache. - #[napi] - pub fn clone_with_options(&self, options: NapiResolveOptions) -> Self { - Self { resolver: self.resolver.clone_with_options(Self::normalize_options(options)) } - } - - /// Clear the underlying cache. - #[napi] - pub fn clear_cache(&self) { - self.resolver.clear_cache(); - } - - #[allow(clippy::needless_pass_by_value)] - #[napi] - pub fn sync(&self, path: String, request: String) -> ResolveResult { - let path = PathBuf::from(path); - resolve(&self.resolver, &path, &request) - } - - fn normalize_options(op: NapiResolveOptions) -> ResolveOptions { - let default = ResolveOptions::default(); - // merging options - ResolveOptions { - tsconfig: op.tsconfig.map(|tsconfig| tsconfig.into()), - alias: op - .alias - .map(|alias| { - alias - .into_iter() - .map(|(k, v)| { - let v = v - .into_iter() - .map(|item| match item { - Some(path) => oxc_resolver::AliasValue::from(path), - None => oxc_resolver::AliasValue::Ignore, - }) - .collect(); - (k, v) - }) - .collect::>() - }) - .unwrap_or(default.alias), - alias_fields: op - .alias_fields - .map(|o| o.into_iter().map(|x| StrOrStrList(x).into()).collect::>()) - .unwrap_or(default.alias_fields), - condition_names: op.condition_names.unwrap_or(default.condition_names), - description_files: op.description_files.unwrap_or(default.description_files), - enforce_extension: op - .enforce_extension - .map(|enforce_extension| enforce_extension.into()) - .unwrap_or(default.enforce_extension), - exports_fields: op - .exports_fields - .map(|o| o.into_iter().map(|x| StrOrStrList(x).into()).collect::>()) - .unwrap_or(default.exports_fields), - imports_fields: op - .imports_fields - .map(|o| o.into_iter().map(|x| StrOrStrList(x).into()).collect::>()) - .unwrap_or(default.imports_fields), - extension_alias: op - .extension_alias - .map(|extension_alias| extension_alias.into_iter().collect::>()) - .unwrap_or(default.extension_alias), - extensions: op.extensions.unwrap_or(default.extensions), - fallback: op - .fallback - .map(|fallback| { - fallback - .into_iter() - .map(|(k, v)| { - let v = v - .into_iter() - .map(|item| match item { - Some(path) => oxc_resolver::AliasValue::from(path), - None => oxc_resolver::AliasValue::Ignore, - }) - .collect(); - (k, v) - }) - .collect::>() - }) - .unwrap_or(default.fallback), - fully_specified: op.fully_specified.unwrap_or(default.fully_specified), - main_fields: op - .main_fields - .map(|o| StrOrStrList(o).into()) - .unwrap_or(default.main_fields), - main_files: op.main_files.unwrap_or(default.main_files), - modules: op.modules.map(|o| StrOrStrList(o).into()).unwrap_or(default.modules), - resolve_to_context: op.resolve_to_context.unwrap_or(default.resolve_to_context), - prefer_relative: op.prefer_relative.unwrap_or(default.prefer_relative), - prefer_absolute: op.prefer_absolute.unwrap_or(default.prefer_absolute), - restrictions: op - .restrictions - .map(|restrictions| { - restrictions - .into_iter() - .map(|restriction| restriction.into()) - .collect::>() - }) - .unwrap_or(default.restrictions), - roots: op - .roots - .map(|roots| roots.into_iter().map(PathBuf::from).collect::>()) - .unwrap_or(default.roots), - symlinks: op.symlinks.unwrap_or(default.symlinks), - builtin_modules: op.builtin_modules.unwrap_or(default.builtin_modules), - } - } -} diff --git a/napi/src/options.rs b/napi/src/options.rs deleted file mode 100644 index ea35672f..00000000 --- a/napi/src/options.rs +++ /dev/null @@ -1,261 +0,0 @@ -use std::path::PathBuf; - -use napi::Either; -use napi_derive::napi; -use std::collections::HashMap; - -/// Module Resolution Options -/// -/// Options are directly ported from [enhanced-resolve](https://github.com/webpack/enhanced-resolve#resolver-options). -/// -/// See [webpack resolve](https://webpack.js.org/configuration/resolve/) for information and examples -#[derive(Debug, Clone)] -#[napi(object)] -pub struct NapiResolveOptions { - /// Path to TypeScript configuration file. - /// - /// Default `None` - pub tsconfig: Option, - - /// Alias for [ResolveOptions::alias] and [ResolveOptions::fallback]. - /// - /// For the second value of the tuple, `None -> AliasValue::Ignore`, Some(String) -> - /// AliasValue::Path(String)` - /// Create aliases to import or require certain modules more easily. - /// A trailing $ can also be added to the given object's keys to signify an exact match. - pub alias: Option>>>, - - /// A list of alias fields in description files. - /// Specify a field, such as `browser`, to be parsed according to [this specification](https://github.com/defunctzombie/package-browser-field-spec). - /// Can be a path to json object such as `["path", "to", "exports"]`. - /// - /// Default `[]` - #[napi(ts_type = "(string | string[])[]")] - pub alias_fields: Option>, - - /// Condition names for exports field which defines entry points of a package. - /// The key order in the exports field is significant. During condition matching, earlier entries have higher priority and take precedence over later entries. - /// - /// Default `[]` - pub condition_names: Option>, - - /// The JSON files to use for descriptions. (There was once a `bower.json`.) - /// - /// Default `["package.json"]` - pub description_files: Option>, - - /// If true, it will not allow extension-less files. - /// So by default `require('./foo')` works if `./foo` has a `.js` extension, - /// but with this enabled only `require('./foo.js')` will work. - /// - /// Default to `true` when [ResolveOptions::extensions] contains an empty string. - /// Use `Some(false)` to disable the behavior. - /// See - /// - /// Default None, which is the same as `Some(false)` when the above empty rule is not applied. - pub enforce_extension: Option, - - /// A list of exports fields in description files. - /// Can be a path to json object such as `["path", "to", "exports"]`. - /// - /// Default `[["exports"]]`. - #[napi(ts_type = "(string | string[])[]")] - pub exports_fields: Option>, - - /// Fields from `package.json` which are used to provide the internal requests of a package - /// (requests starting with # are considered internal). - /// - /// Can be a path to a JSON object such as `["path", "to", "imports"]`. - /// - /// Default `[["imports"]]`. - #[napi(ts_type = "(string | string[])[]")] - pub imports_fields: Option>, - - /// An object which maps extension to extension aliases. - /// - /// Default `{}` - pub extension_alias: Option>>, - - /// Attempt to resolve these extensions in order. - /// If multiple files share the same name but have different extensions, - /// will resolve the one with the extension listed first in the array and skip the rest. - /// - /// Default `[".js", ".json", ".node"]` - pub extensions: Option>, - - /// Redirect module requests when normal resolving fails. - /// - /// Default `[]` - pub fallback: Option>>>, - - /// 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). - /// - /// See also webpack configuration [resolve.fullySpecified](https://webpack.js.org/configuration/module/#resolvefullyspecified) - /// - /// Default `false` - pub fully_specified: Option, - - /// A list of main fields in description files - /// - /// Default `["main"]`. - #[napi(ts_type = "string | string[]")] - pub main_fields: Option, - - /// The filename to be used while resolving directories. - /// - /// Default `["index"]` - pub main_files: Option>, - - /// A list of directories to resolve modules from, can be absolute path or folder name. - /// - /// Default `["node_modules"]` - #[napi(ts_type = "string | string[]")] - pub modules: Option, - - /// Resolve to a context instead of a file. - /// - /// Default `false` - pub resolve_to_context: Option, - - /// Prefer to resolve module requests as relative requests instead of using modules from node_modules directories. - /// - /// Default `false` - pub prefer_relative: Option, - - /// Prefer to resolve server-relative urls as absolute paths before falling back to resolve in ResolveOptions::roots. - /// - /// Default `false` - pub prefer_absolute: Option, - - /// A list of resolve restrictions to restrict the paths that a request can be resolved on. - /// - /// Default `[]` - pub restrictions: Option>, - - /// A list of directories where requests of server-relative URLs (starting with '/') are resolved. - /// On non-Windows systems these requests are resolved as an absolute path first. - /// - /// Default `[]` - pub roots: Option>, - - /// Whether to resolve symlinks to their symlinked location. - /// When enabled, symlinked resources are resolved to their real path, not their symlinked location. - /// Note that this may cause module resolution to fail when using tools that symlink packages (like npm link). - /// - /// Default `true` - pub symlinks: Option, - - /// Whether to parse [module.builtinModules](https://nodejs.org/api/module.html#modulebuiltinmodules) or not. - /// For example, "zlib" will throw [crate::ResolveError::Builtin] when set to true. - /// - /// Default `false` - pub builtin_modules: Option, -} - -#[napi] -#[derive(Debug, PartialEq, Eq)] -pub enum EnforceExtension { - Auto, - Enabled, - Disabled, -} - -impl EnforceExtension { - pub fn is_auto(&self) -> bool { - *self == Self::Auto - } - - pub fn is_enabled(&self) -> bool { - *self == Self::Enabled - } - - pub fn is_disabled(&self) -> bool { - *self == Self::Disabled - } -} - -/// Alias Value for [ResolveOptions::alias] and [ResolveOptions::fallback]. -/// Use struct because napi don't support structured union now -#[napi(object)] -#[derive(Debug, Clone)] -pub struct Restriction { - pub path: Option, - pub regex: Option, -} - -/// Tsconfig Options -/// -/// Derived from [tsconfig-paths-webpack-plugin](https://github.com/dividab/tsconfig-paths-webpack-plugin#options) -#[napi(object)] -#[derive(Debug, Clone)] -pub struct TsconfigOptions { - /// Allows you to specify where to find the TypeScript configuration file. - /// You may provide - /// * a relative path to the configuration file. It will be resolved relative to cwd. - /// * an absolute path to the configuration file. - pub config_file: String, - - /// Support for Typescript Project References. - /// - /// * `'auto'`: use the `references` field from tsconfig of `config_file`. - /// * `string[]`: manually provided relative or absolute path. - #[napi(ts_type = "'auto' | string[]")] - pub references: Option>>, -} - -impl Into for Restriction { - fn into(self) -> oxc_resolver::Restriction { - match (self.path, self.regex) { - (None, None) => { - panic!("Should specify path or regex") - } - (None, Some(regex)) => oxc_resolver::Restriction::RegExp(regex), - (Some(path), None) => oxc_resolver::Restriction::Path(PathBuf::from(path)), - (Some(_), Some(_)) => { - panic!("Restriction can't be path and regex at the same time") - } - } - } -} - -impl Into for EnforceExtension { - fn into(self) -> oxc_resolver::EnforceExtension { - match self { - EnforceExtension::Auto => oxc_resolver::EnforceExtension::Auto, - EnforceExtension::Enabled => oxc_resolver::EnforceExtension::Enabled, - EnforceExtension::Disabled => oxc_resolver::EnforceExtension::Disabled, - } - } -} - -impl Into for TsconfigOptions { - fn into(self) -> oxc_resolver::TsconfigOptions { - oxc_resolver::TsconfigOptions { - config_file: PathBuf::from(self.config_file), - references: match self.references { - Some(Either::A(string)) if string.as_str() == "auto" => { - oxc_resolver::TsconfigReferences::Auto - } - Some(Either::A(opt)) => { - panic!("`{}` is not a valid option for tsconfig references", opt) - } - Some(Either::B(paths)) => oxc_resolver::TsconfigReferences::Paths( - paths.into_iter().map(PathBuf::from).collect::>(), - ), - None => oxc_resolver::TsconfigReferences::Disabled, - }, - } - } -} - -type StrOrStrListType = Either>; -pub struct StrOrStrList(pub StrOrStrListType); - -impl Into> for StrOrStrList { - fn into(self) -> Vec { - match self { - StrOrStrList(Either::A(s)) => Vec::from([s]), - StrOrStrList(Either::B(a)) => a, - } - } -} diff --git a/napi/tests/options.test.mjs b/napi/tests/options.test.mjs deleted file mode 100644 index 4a93efff..00000000 --- a/napi/tests/options.test.mjs +++ /dev/null @@ -1,59 +0,0 @@ -import { describe, it } from "node:test"; -import { ResolverFactory } from "../index.js"; -import * as assert from "node:assert"; -import * as path from "node:path"; - -const fixtureDir = new URL( - "../../fixtures/enhanced_resolve/test/fixtures", - import.meta.url -).pathname; - -describe("option", () => { - describe("aliasFields", () => { - it("should allow field string ", () => { - const resolver = new ResolverFactory({ aliasFields: ["browser"] }); - assert.match( - resolver.sync(fixtureDir, "./browser-module/lib/replaced.js").path, - /browser-module\/lib\/browser\.js$/ - ); - }); - it("should allow json path array", () => { - const resolver = new ResolverFactory({ - aliasFields: [["innerBrowser1", "field", "browser"]], - }); - - assert.match( - resolver.sync(fixtureDir, "./browser-module/lib/main1.js").path, - /browser-module\/lib\/main\.js$/ - ); - }); - }); - - describe("exportsFields", () => { - const createTest = (exportsFields) => { - const resolver = new ResolverFactory({ exportsFields }); - assert.match( - resolver.sync( - path.resolve(fixtureDir, "./exports-field3"), - "exports-field" - ).path, - /\/exports-field\/src\/index\.js$/ - ); - }; - it("should allow string as field item", createTest(["broken"])); - it("should allow json path array as field item", createTest([["broken"]])); - }); - - describe("mainFields", () => { - const createTest = (mainFields) => { - const resolver = new ResolverFactory({ mainFields }); - assert.match( - resolver.sync(fixtureDir, "../..").path, - /\/lib\/index\.js$/ - ); - }; - it("should use `'main'` as default", createTest(undefined)); - it("should allow field string", createTest("main")); - it("should allow field array", createTest(["main"])); - }); -}); diff --git a/npm/package.json b/npm/package.json index 6fa93185..b47e6b07 100644 --- a/npm/package.json +++ b/npm/package.json @@ -1,41 +1,30 @@ { - "name": "oxc-resolver", - "version": "1.8.1", - "description": "Oxc Resolver Node API", - "main": "index.js", - "browser": "browser.js", - "files": [ - "index.d.ts", - "index.js", - "browser.js" - ], - "license": "MIT", - "homepage": "https://oxc-project.github.io", - "repository": { - "type": "git", - "url": "git+https://github.com/oxc-project/oxc-resolver.git" - }, - "publishConfig": { - "registry": "https://registry.npmjs.org/", - "access": "public" - }, - "napi": { - "binaryName": "resolver", - "packageName": "@oxc-resolver/binding", - "targets": [ - "x86_64-pc-windows-msvc", - "aarch64-pc-windows-msvc", - "x86_64-unknown-linux-gnu", - "x86_64-unknown-linux-musl", - "aarch64-unknown-linux-gnu", - "aarch64-unknown-linux-musl", - "armv7-unknown-linux-gnueabihf", - "x86_64-apple-darwin", - "aarch64-apple-darwin", - "wasm32-wasip1-threads" - ] - }, - "funding": { - "url": "https://github.com/sponsors/Boshen" - } + "name": "oxc-resolver", + "description": "Oxc Resolver Node API", + "funding": { + "url": "https://github.com/sponsors/Boshen" + }, + "main": "index.js", + "browser": "browser.js", + "files": [ + "index.d.ts", + "index.js", + "browser.js" + ], + "napi": { + "binaryName": "resolver", + "packageName": "@oxc-resolver/binding", + "targets": [ + "x86_64-pc-windows-msvc", + "aarch64-pc-windows-msvc", + "x86_64-unknown-linux-gnu", + "x86_64-unknown-linux-musl", + "aarch64-unknown-linux-gnu", + "aarch64-unknown-linux-musl", + "armv7-unknown-linux-gnueabihf", + "x86_64-apple-darwin", + "aarch64-apple-darwin", + "wasm32-wasip1-threads" + ] + } } diff --git a/package.json b/package.json index f9e933c6..a431e48f 100644 --- a/package.json +++ b/package.json @@ -1,36 +1,24 @@ { - "name": "@oxc-resolver/binding", - "private": true, - "version": "0.0.0", - "scripts": { - "build": "napi build --platform --release --package-json-path npm/package.json --manifest-path napi/Cargo.toml", - "build:debug": "napi build --platform --package-json-path npm/package.json --manifest-path napi/Cargo.toml", - "prepublishOnly": "napi pre-publish -t npm", - "test": "ava" - }, - "devDependencies": { - "@napi-rs/cli": "^3.0.0-alpha.43", - "@napi-rs/wasm-runtime": "^0.2.0", - "@types/node": "^20.10.4", - "ava": "^6.0.1", - "emnapi": "^1.0.0", - "typescript": "^5.3.3" - }, - "engines": { - "node": ">=10" - }, - "ava": { - "files": [ - "napi/__test__/*.spec.mjs" - ], - "cache": false - }, - "packageManager": "pnpm@9.1.4", - "repository": { - "type": "git", - "url": "git+https://github.com/oxc-project/oxc-resolver.git" - }, - "funding": { - "url": "https://github.com/sponsors/Boshen" - } + "name": "@oxc-resolver/binding", + "funding": { + "url": "https://github.com/sponsors/Boshen" + }, + "scripts": { + "build": "napi build --platform --release --package-json-path npm/package.json --manifest-path napi/Cargo.toml", + "build:debug": "napi build --platform --package-json-path npm/package.json --manifest-path napi/Cargo.toml", + "prepublishOnly": "napi pre-publish -t npm" + }, + "ava": { + "cache": false, + "files": [ + "napi/__test__/*.spec.mjs" + ] + }, + "devDependencies": { + "@napi-rs/cli": "^3.0.0-alpha.43", + "@napi-rs/wasm-runtime": "^0.2.0", + "@types/node": "^20.10.4", + "ava": "^6.0.1", + "emnapi": "^1.0.0" + } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml deleted file mode 100644 index 878ba525..00000000 --- a/pnpm-lock.yaml +++ /dev/null @@ -1,2450 +0,0 @@ -lockfileVersion: '9.0' - -settings: - autoInstallPeers: true - excludeLinksFromLockfile: false - -importers: - - .: - devDependencies: - '@napi-rs/cli': - specifier: ^3.0.0-alpha.43 - version: 3.0.0-alpha.51(@emnapi/runtime@1.1.1)(emnapi@1.1.1) - '@napi-rs/wasm-runtime': - specifier: ^0.2.0 - version: 0.2.0 - '@types/node': - specifier: ^20.10.4 - version: 20.12.7 - ava: - specifier: ^6.0.1 - version: 6.1.2 - emnapi: - specifier: ^1.0.0 - version: 1.1.1 - typescript: - specifier: ^5.3.3 - version: 5.4.5 - -packages: - - '@emnapi/core@1.1.1': - resolution: {integrity: sha512-eu4KjHfXg3I+UUR7vSuwZXpRo4c8h4Rtb5Lu2F7Z4JqJFl/eidquONEBiRs6viXKpWBC3BaJBy68xGJ2j56idw==} - - '@emnapi/runtime@1.1.1': - resolution: {integrity: sha512-3bfqkzuR1KLx57nZfjr2NLnFOobvyS0aTszaEGCGqmYMVDRaGvgIZbjGSV/MHSSmLgQ/b9JFHQ5xm5WRZYd+XQ==} - - '@inquirer/figures@1.0.1': - resolution: {integrity: sha512-mtup3wVKia3ZwULPHcbs4Mor8Voi+iIXEWD7wCNbIO6lYR62oPCTQyrddi5OMYVXHzeCSoneZwJuS8sBvlEwDw==} - engines: {node: '>=18'} - - '@ljharb/through@2.3.13': - resolution: {integrity: sha512-/gKJun8NNiWGZJkGzI/Ragc53cOdcLNdzjLaIa+GEjguQs0ulsurx8WN0jijdK9yPqDvziX995sMRLyLt1uZMQ==} - engines: {node: '>= 0.4'} - - '@mapbox/node-pre-gyp@1.0.11': - resolution: {integrity: sha512-Yhlar6v9WQgUp/He7BdgzOz8lqMQ8sU+jkCq7Wx8Myc5YFJLbEe7lgui/V7G1qB1DJykHSGwreceSaD60Y0PUQ==} - hasBin: true - - '@napi-rs/cli@3.0.0-alpha.51': - resolution: {integrity: sha512-fzTQ4RfhaghFNryWTfb0e93N/J7hNfAOpUNL98u9qMymsXa3w2cUTN8W/HjiNVTUvHHus8X5PuHt9q65cDXcSg==} - engines: {node: '>= 16'} - hasBin: true - peerDependencies: - '@emnapi/runtime': ^1.1.0 - emnapi: ^1.1.0 - peerDependenciesMeta: - '@emnapi/runtime': - optional: true - emnapi: - optional: true - - '@napi-rs/cross-toolchain@0.0.14': - resolution: {integrity: sha512-Xgoe1gCEo5s5VUxmSnK4tYFJXW2JAVM02jptSbqA2+gp8pt4Vuk9oK2LvswwO9iRfHapKacYYhegD8Dq/+PBOQ==} - peerDependencies: - '@napi-rs/cross-toolchain-arm64-target-aarch64': ^0.0.14 - '@napi-rs/cross-toolchain-arm64-target-armv7': ^0.0.14 - '@napi-rs/cross-toolchain-arm64-target-x86_64': ^0.0.14 - '@napi-rs/cross-toolchain-x64-target-aarch64': ^0.0.14 - '@napi-rs/cross-toolchain-x64-target-armv7': ^0.0.14 - '@napi-rs/cross-toolchain-x64-target-x86_64': ^0.0.14 - peerDependenciesMeta: - '@napi-rs/cross-toolchain-arm64-target-aarch64': - optional: true - '@napi-rs/cross-toolchain-arm64-target-armv7': - optional: true - '@napi-rs/cross-toolchain-arm64-target-x86_64': - optional: true - '@napi-rs/cross-toolchain-x64-target-aarch64': - optional: true - '@napi-rs/cross-toolchain-x64-target-armv7': - optional: true - '@napi-rs/cross-toolchain-x64-target-x86_64': - optional: true - - '@napi-rs/lzma-android-arm-eabi@1.2.1': - resolution: {integrity: sha512-GKXud2hTddxehff1mAGkbTfseBj+GcM+M/sZuxf9H9CJeOWpfI/HC9Oy3uv8mBqPTkOQdCcZ/xXPU34EOEwiRg==} - engines: {node: '>= 10'} - cpu: [arm] - os: [android] - - '@napi-rs/lzma-android-arm64@1.2.1': - resolution: {integrity: sha512-UKFvc56TdgljbdgLvSwM62pSItV/4SuXXCrJtruPDmbIDe8HKag8hsCKsb66hrc9aX7urJ+KGw1yz5hWiONLyw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [android] - - '@napi-rs/lzma-darwin-arm64@1.2.1': - resolution: {integrity: sha512-eLbHzK5xGVzEABb1ESFELQJzXKoQeP9QH9hMPd4Qq29xD6MkWD2VKlAy40AxrMeWc7fCUIImTTlGuGRvg6tI1g==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [darwin] - - '@napi-rs/lzma-darwin-x64@1.2.1': - resolution: {integrity: sha512-/a5sHZkkO81w/PCpxlwXjADz++jDiTJquMzCLAhupd23wTRmJoCBAwp4Tur+qV5esI7ahAA0lS5P0M4TZv+OUg==} - engines: {node: '>= 10'} - cpu: [x64] - os: [darwin] - - '@napi-rs/lzma-freebsd-x64@1.2.1': - resolution: {integrity: sha512-Ehc0ld148YcqQrDWwUbVta1l45R4PthCIU6ZDbOYzzeYXQnhgr1fWiex7wu4KMFppteHlYntypUIhmMUklqchA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [freebsd] - - '@napi-rs/lzma-linux-arm-gnueabihf@1.2.1': - resolution: {integrity: sha512-EkIsx3kC67viElNetZgaGAtAceA+4pVGj31HKKPn0RZYn3rCNdEEg2i1IRg07Y6m4bHwcaKutLoZ2LDcQ+yiBg==} - engines: {node: '>= 10'} - cpu: [arm] - os: [linux] - - '@napi-rs/lzma-linux-arm64-gnu@1.2.1': - resolution: {integrity: sha512-GxSbp1/X7Ppmf+aNiZ95vl1HgQzRS9C8zCv7unEhYRPAjRkAnlrsLluUBOTPIY2yquuUvfIog9XIml6Hpw2wrA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/lzma-linux-arm64-musl@1.2.1': - resolution: {integrity: sha512-2L3KHFGGdt0xgU0WcKwKmnjVCYs88t4+ixBgPfEydtYsOceg6B8eOzdM7xsziKxJyUJKWBetGLgARQOy35bfvA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/lzma-linux-x64-gnu@1.2.1': - resolution: {integrity: sha512-h29XttA2Og1+6vYHsVcp+i1PkeILKzYnoDun0ul/k/5hvfxJ2Jap+EM07sW4HSz/DiscLAeIZmLKbXEqJgF5bg==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/lzma-linux-x64-musl@1.2.1': - resolution: {integrity: sha512-8EIkpLid4pepkBsljQ7rgma8jdwAuwVyJ2tY6Wuj1I/AqAkVVfxTwIuYc4zgRR3nfcrmWgOfZE0VneVmQCE5hw==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/lzma-win32-arm64-msvc@1.2.1': - resolution: {integrity: sha512-RNPItarWUUbtwz6dyn8FGH9AXEaAsBcMBlTvcRjv8eoqRqyZ9R49Ruk/8WMS57MM1BKdiPDxHBtRi+nZn27Slw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [win32] - - '@napi-rs/lzma-win32-ia32-msvc@1.2.1': - resolution: {integrity: sha512-rNdsCZnzKVgeDd9NzXWk9WuADVUWUWdnws8qBRCfHRUQqJ56Ic1W7Y1XmP+bNa985MXlU6vbznHTHmU5zk2P+A==} - engines: {node: '>= 10'} - cpu: [ia32] - os: [win32] - - '@napi-rs/lzma-win32-x64-msvc@1.2.1': - resolution: {integrity: sha512-1AFrAh1n73Yw+IhDu5HnaiRD4vWEkafY0EarfziPfDsh/GeyNcjbE+Let+XFe8L3j0/CZfsRG3nXarOW1oadUQ==} - engines: {node: '>= 10'} - cpu: [x64] - os: [win32] - - '@napi-rs/lzma@1.2.1': - resolution: {integrity: sha512-vwl34tzF2mXWthnFVN2MP6nRzQ40C5+256EEUjxAwj9dbAhDqb7Yz376Up5SlB4YgNC0YvEqK4jsYP/NP0bgpg==} - engines: {node: '>= 10'} - - '@napi-rs/tar-android-arm-eabi@0.1.0': - resolution: {integrity: sha512-gY9f7HfyU8MQs/ERi2/Fc4dGRf61ZM2pme31t0FkrzTtmeIaf56LiTeTt4aP8xh/0HOVnXrB6I3taY9IsQVB8Q==} - engines: {node: '>= 10'} - cpu: [arm] - os: [android] - - '@napi-rs/tar-android-arm64@0.1.0': - resolution: {integrity: sha512-NxszsTRdAYf25kKuzUYz514/5MFI3w3aHToZBcFjaxUmsayrimFrHIiPLwNQVe55lHPRi13njqQUPjMetHMCZw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [android] - - '@napi-rs/tar-darwin-arm64@0.1.0': - resolution: {integrity: sha512-G+fSNcwhbekTMOElS66mf3ccg8M4NcEHIgo7s6Hxo8U2obUSqEJ0WjTDV8oJy7lqRW/MeeDJj8Vz0ceXC8ueeA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [darwin] - - '@napi-rs/tar-darwin-x64@0.1.0': - resolution: {integrity: sha512-p9aOLk6O2+Cu62fNOdj1Zx0P3J1VkxtihXOVDaK49o5jszhms0roNA7kZfklwjVdwo8R7OQC6mJcFWmiamMNug==} - engines: {node: '>= 10'} - cpu: [x64] - os: [darwin] - - '@napi-rs/tar-freebsd-x64@0.1.0': - resolution: {integrity: sha512-mZQPtyCc2r+P84WV76Ddbe1+CxBscxlDHtgMIxZPveMgq4esZFKp26M735vjxtk/j2ahT0pZoC6fjsJ//Uxzlg==} - engines: {node: '>= 10'} - cpu: [x64] - os: [freebsd] - - '@napi-rs/tar-linux-arm-gnueabihf@0.1.0': - resolution: {integrity: sha512-FHxnmrOS345T3n3XDmY9QEoVv1PXkkuevQbu+gzq5np4fzN/NX2Az5oJTxKOTGtlJSaxxz90raeaWRZrnV5hZQ==} - engines: {node: '>= 10'} - cpu: [arm] - os: [linux] - - '@napi-rs/tar-linux-arm64-gnu@0.1.0': - resolution: {integrity: sha512-+8WHnL/8PPpePYc+5oqNLoE5o98vWF7lJvY/seji7tdcS5TPJ3tgXaF4/y1rFAaSxKsZ9l+ClHsZZ0MpCqMOOQ==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/tar-linux-arm64-musl@0.1.0': - resolution: {integrity: sha512-SXqU4H30/TD9BZa6pH/U5l2V6E4EKOutjHp9Sqr98iH52Zb+1N84ur1Ti7/+PapKunCIJeZzU+792CQagKIzuQ==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/tar-linux-x64-gnu@0.1.0': - resolution: {integrity: sha512-2uZHxl2nH1HbeJuifB1qdK8vU9wKDrxQkFm+u4psUaa/uHLZDUCGS7GMxTnCbR9OehqZcfQabaKsHbxR/8ElDQ==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/tar-linux-x64-musl@0.1.0': - resolution: {integrity: sha512-S1vEqLK4UCHS4AjVZ3g6o7r0Yu6RbhmDj6JrqxBoEIjrMsuIPKQrODHhtlsykOPeu5IHQuyRT+DevorWAVYdoA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/tar-win32-arm64-msvc@0.1.0': - resolution: {integrity: sha512-x23Ganq0hcDbgnhzAFqOu5EWtKvngIsapJL7ZLGgQlqahRb15aQkagYvpju6CLZers6N6znmqxw9Pdov9VFzOQ==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [win32] - - '@napi-rs/tar-win32-ia32-msvc@0.1.0': - resolution: {integrity: sha512-QJgJQEKDbVOrzSJ3EaUuCk+g7t9tKv085eALmRtkiHDBmzd0iAoudcU2N9YgdacSQMe1V/GMuQLky6BFrZb4nw==} - engines: {node: '>= 10'} - cpu: [ia32] - os: [win32] - - '@napi-rs/tar-win32-x64-msvc@0.1.0': - resolution: {integrity: sha512-aEhLcPZXmbcz46utpgYrkhY/TIGVCs4T5c+xpBf6H8feIEz7rF44Bm6kECC42OWcqnws2LGRW9TZsv0bWoAn0A==} - engines: {node: '>= 10'} - cpu: [x64] - os: [win32] - - '@napi-rs/tar@0.1.0': - resolution: {integrity: sha512-HodV5VS/ryhNvSmSHPb6CT5lJKzkoKaiyO8JPkVw3XCXbp51+vZs7LJ66kgFqyr4AagaKqmXsgpGVCIwNdFw/w==} - engines: {node: '>= 10'} - - '@napi-rs/wasm-runtime@0.1.2': - resolution: {integrity: sha512-8JuczewTFIZ/XIjHQ+YlQUydHvlKx2hkcxtuGwh+t/t5zWyZct6YG4+xjHcq8xyc/e7FmFwf42Zj2YgICwmlvA==} - - '@napi-rs/wasm-runtime@0.2.0': - resolution: {integrity: sha512-ETCooPEZJN7cGp6GwE5mUTrStrhIeuEPo0lOhLe48Iz35z6CkbgDauR8nE/K4GaMEu2BwTOm2Epy7ru8w1ua7w==} - - '@napi-rs/wasm-tools-android-arm-eabi@0.0.1': - resolution: {integrity: sha512-Q/SyyO60dbpoLcN/hvGzNWDaCjuaMGFeg92GnsDBWm3OCwhvltr51+VDZbCIHQwfIvH4d63X29nEls7FHK75dA==} - engines: {node: '>= 10'} - cpu: [arm] - os: [android] - - '@napi-rs/wasm-tools-android-arm64@0.0.1': - resolution: {integrity: sha512-mn7QpSWJlQS7Z14DkWqW14HqEiI2R8FV3KT4SNdqm+O+K5uIUvAexxMn9Qu6gqLq1fHXj+7l2luAWmtN7RKLjA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [android] - - '@napi-rs/wasm-tools-darwin-arm64@0.0.1': - resolution: {integrity: sha512-WuxMRtd5rCgqfuk7dehcft5eyGDOuNSMaJybprbX4IXvnjlLQf1zsCfp6wBI2Ptp2D+qEgE2SAMWBfzF9XDDkw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [darwin] - - '@napi-rs/wasm-tools-darwin-x64@0.0.1': - resolution: {integrity: sha512-YGPjgIo1/Y774aAFb/UT+d8VQtTaIkdF0/ynlChe/UilBZX48vLaEM0HaoSqxA1WHvRm8Il8R3rBDDle0965rw==} - engines: {node: '>= 10'} - cpu: [x64] - os: [darwin] - - '@napi-rs/wasm-tools-freebsd-x64@0.0.1': - resolution: {integrity: sha512-e5y+Z89XwI7HpLyCNEvDKdtO5Sga2+o8bDcNQNHjhMunnnHKPtlTvtIhieVmdqnNGPbuNkIx8xbTjkoWCZ49Tw==} - engines: {node: '>= 10'} - cpu: [x64] - os: [freebsd] - - '@napi-rs/wasm-tools-linux-arm64-gnu@0.0.1': - resolution: {integrity: sha512-Hcy+XiCJd8XshxVOYvmyU5FgeY8d6txZf7ZefI38Y3eRm7rzGt/EvABGjvJfujnPaBeWi9fQVm3Zav5pwyxViw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/wasm-tools-linux-arm64-musl@0.0.1': - resolution: {integrity: sha512-1mSquGy4N7jlRu/0OY/rqZa/XdCFGKrsl8SH4jRB318DVweOHLqn15QG4iwIrRVjCJROpaU9HRU/sgOKVbdqrA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/wasm-tools-linux-x64-gnu@0.0.1': - resolution: {integrity: sha512-/+XuGQ9667EqrxRbpt2izLDNzWUWLTXl6KaRSh9TjcT7qL5+yllTqchc0JwIHJW5QnQlC1NW7HnSnwQZ+/v+8g==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/wasm-tools-linux-x64-musl@0.0.1': - resolution: {integrity: sha512-L+5QcEsUS+QNcMI1AF6aBRKLzhxQ5VHRHVslaQwOxHoxyhMB/2hRH4ON6Zea1PyQS/zzZugwBuDEOcFtc3UjPQ==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/wasm-tools-wasm32-wasi@0.0.1': - resolution: {integrity: sha512-I1vAhMQcBblPJPg6pr+xydZ1NjPwKU2ympmI54BZfCOAMHs0ZfVb4yEqYAVIcSWOx3CF/0T2YrcOmiULTU3iGw==} - engines: {node: '>=14.0.0'} - cpu: [wasm32] - - '@napi-rs/wasm-tools-win32-arm64-msvc@0.0.1': - resolution: {integrity: sha512-A9peDWijE9X6qt5SNzqlmSMlOZiqeB9zhUVP5dtJKtpqVO098YVnZFsz/4Hv7LkSoxQE7brAd9yln/wz5qb1yQ==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [win32] - - '@napi-rs/wasm-tools-win32-ia32-msvc@0.0.1': - resolution: {integrity: sha512-6Y7GqnBCIdl8YsSQ+5AjnZ4iWDJnJrqzRlMDegCmPPf3WmRZ0sgnRU9iAHWcId9AEIf7SAs3x7Bnv2992zCwJA==} - engines: {node: '>= 10'} - cpu: [ia32] - os: [win32] - - '@napi-rs/wasm-tools-win32-x64-msvc@0.0.1': - resolution: {integrity: sha512-Ab6ljJCQmXqJvE4/8DLvHEVTI7vVUrVfh6gCwnVwwrA/B2LgR98SanpT8/951ZaIH/lSuqkeVm+wqzgYM1FHRg==} - engines: {node: '>= 10'} - cpu: [x64] - os: [win32] - - '@napi-rs/wasm-tools@0.0.1': - resolution: {integrity: sha512-itoKmaVqRKIV37sKIEri1qjaYlWNtXyfymUaqXkLu5F16s+FwqwOmvxmdTHsvNKkMy4qCsSSetiLZO1IwvBMLQ==} - engines: {node: '>= 10'} - - '@nodelib/fs.scandir@2.1.5': - resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} - engines: {node: '>= 8'} - - '@nodelib/fs.stat@2.0.5': - resolution: {integrity: sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==} - engines: {node: '>= 8'} - - '@nodelib/fs.walk@1.2.8': - resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} - engines: {node: '>= 8'} - - '@octokit/auth-token@4.0.0': - resolution: {integrity: sha512-tY/msAuJo6ARbK6SPIxZrPBms3xPbfwBrulZe0Wtr/DIY9lje2HeV1uoebShn6mx7SjCHif6EjMvoREj+gZ+SA==} - engines: {node: '>= 18'} - - '@octokit/core@5.2.0': - resolution: {integrity: sha512-1LFfa/qnMQvEOAdzlQymH0ulepxbxnCYAKJZfMci/5XJyIHWgEYnDmgnKakbTh7CH2tFQ5O60oYDvns4i9RAIg==} - engines: {node: '>= 18'} - - '@octokit/endpoint@9.0.5': - resolution: {integrity: sha512-ekqR4/+PCLkEBF6qgj8WqJfvDq65RH85OAgrtnVp1mSxaXF03u2xW/hUdweGS5654IlC0wkNYC18Z50tSYTAFw==} - engines: {node: '>= 18'} - - '@octokit/graphql@7.1.0': - resolution: {integrity: sha512-r+oZUH7aMFui1ypZnAvZmn0KSqAUgE1/tUXIWaqUCa1758ts/Jio84GZuzsvUkme98kv0WFY8//n0J1Z+vsIsQ==} - engines: {node: '>= 18'} - - '@octokit/openapi-types@20.0.0': - resolution: {integrity: sha512-EtqRBEjp1dL/15V7WiX5LJMIxxkdiGJnabzYx5Apx4FkQIFgAfKumXeYAqqJCj1s+BMX4cPFIFC4OLCR6stlnA==} - - '@octokit/openapi-types@22.1.0': - resolution: {integrity: sha512-pGUdSP+eEPfZiQHNkZI0U01HLipxncisdJQB4G//OAmfeO8sqTQ9KRa0KF03TUPCziNsoXUrTg4B2Q1EX++T0Q==} - - '@octokit/plugin-paginate-rest@9.2.1': - resolution: {integrity: sha512-wfGhE/TAkXZRLjksFXuDZdmGnJQHvtU/joFQdweXUgzo1XwvBCD4o4+75NtFfjfLK5IwLf9vHTfSiU3sLRYpRw==} - engines: {node: '>= 18'} - peerDependencies: - '@octokit/core': '5' - - '@octokit/plugin-request-log@4.0.1': - resolution: {integrity: sha512-GihNqNpGHorUrO7Qa9JbAl0dbLnqJVrV8OXe2Zm5/Y4wFkZQDfTreBzVmiRfJVfE4mClXdihHnbpyyO9FSX4HA==} - engines: {node: '>= 18'} - peerDependencies: - '@octokit/core': '5' - - '@octokit/plugin-rest-endpoint-methods@10.4.1': - resolution: {integrity: sha512-xV1b+ceKV9KytQe3zCVqjg+8GTGfDYwaT1ATU5isiUyVtlVAO3HNdzpS4sr4GBx4hxQ46s7ITtZrAsxG22+rVg==} - engines: {node: '>= 18'} - peerDependencies: - '@octokit/core': '5' - - '@octokit/request-error@5.1.0': - resolution: {integrity: sha512-GETXfE05J0+7H2STzekpKObFe765O5dlAKUTLNGeH+x47z7JjXHfsHKo5z21D/o/IOZTUEI6nyWyR+bZVP/n5Q==} - engines: {node: '>= 18'} - - '@octokit/request@8.4.0': - resolution: {integrity: sha512-9Bb014e+m2TgBeEJGEbdplMVWwPmL1FPtggHQRkV+WVsMggPtEkLKPlcVYm/o8xKLkpJ7B+6N8WfQMtDLX2Dpw==} - engines: {node: '>= 18'} - - '@octokit/rest@20.1.0': - resolution: {integrity: sha512-STVO3itHQLrp80lvcYB2UIKoeil5Ctsgd2s1AM+du3HqZIR35ZH7WE9HLwUOLXH0myA0y3AGNPo8gZtcgIbw0g==} - engines: {node: '>= 18'} - - '@octokit/types@12.6.0': - resolution: {integrity: sha512-1rhSOfRa6H9w4YwK0yrf5faDaDTb+yLyBUKOCV4xtCDB5VmIPqd/v9yr9o6SAzOAlRxMiRiCic6JVM1/kunVkw==} - - '@octokit/types@13.4.1': - resolution: {integrity: sha512-Y73oOAzRBAUzR/iRAbGULzpNkX8vaxKCqEtg6K74Ff3w9f5apFnWtE/2nade7dMWWW3bS5Kkd6DJS4HF04xreg==} - - '@rollup/pluginutils@4.2.1': - resolution: {integrity: sha512-iKnFXr7NkdZAIHiIWE+BX5ULi/ucVFYWD6TbAV+rZctiRTY2PL6tsIKhoIOaoskiWAkgu+VsbXgUVDNLHf+InQ==} - engines: {node: '>= 8.0.0'} - - '@sindresorhus/merge-streams@2.3.0': - resolution: {integrity: sha512-LtoMMhxAlorcGhmFYI+LhPgbPZCkgP6ra1YL604EeF6U98pLlQ3iWIGMdWSC+vWmPBWBNgmDBAhnAobLROJmwg==} - engines: {node: '>=18'} - - '@tybys/wasm-util@0.8.3': - resolution: {integrity: sha512-Z96T/L6dUFFxgFJ+pQtkPpne9q7i6kIPYCFnQBHSgSPV9idTsKfIhCss0h5iM9irweZCatkrdeP8yi5uM1eX6Q==} - - '@types/node@20.12.7': - resolution: {integrity: sha512-wq0cICSkRLVaf3UGLMGItu/PtdY7oaXaI/RVU+xliKVOtRna3PRY57ZDfztpDL0n11vfymMUnXv8QwYCO7L1wg==} - - '@vercel/nft@0.26.4': - resolution: {integrity: sha512-j4jCOOXke2t8cHZCIxu1dzKLHLcFmYzC3yqAK6MfZznOL1QIJKd0xcFsXK3zcqzU7ScsE2zWkiMMNHGMHgp+FA==} - engines: {node: '>=16'} - hasBin: true - - abbrev@1.1.1: - resolution: {integrity: sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==} - - acorn-import-attributes@1.9.5: - resolution: {integrity: sha512-n02Vykv5uA3eHGM/Z2dQrcD56kL8TyDb2p1+0P83PClMnC/nc+anbQRhIOWnSq4Ke/KvDPrY3C9hDtC/A3eHnQ==} - peerDependencies: - acorn: ^8 - - acorn-walk@8.3.2: - resolution: {integrity: sha512-cjkyv4OtNCIeqhHrfS81QWXoCBPExR/J62oyEqepVw8WaQeSqpW2uhuLPh1m9eWhDuOo/jUXVTlifvesOWp/4A==} - engines: {node: '>=0.4.0'} - - acorn@8.11.3: - resolution: {integrity: sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==} - engines: {node: '>=0.4.0'} - hasBin: true - - agent-base@6.0.2: - resolution: {integrity: sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==} - engines: {node: '>= 6.0.0'} - - ansi-escapes@4.3.2: - resolution: {integrity: sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==} - engines: {node: '>=8'} - - ansi-regex@5.0.1: - resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} - engines: {node: '>=8'} - - ansi-regex@6.0.1: - resolution: {integrity: sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==} - engines: {node: '>=12'} - - ansi-styles@4.3.0: - resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} - engines: {node: '>=8'} - - ansi-styles@6.2.1: - resolution: {integrity: sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==} - engines: {node: '>=12'} - - aproba@2.0.0: - resolution: {integrity: sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==} - - are-we-there-yet@2.0.0: - resolution: {integrity: sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw==} - engines: {node: '>=10'} - - argparse@1.0.10: - resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==} - - argparse@2.0.1: - resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} - - array-find-index@1.0.2: - resolution: {integrity: sha512-M1HQyIXcBGtVywBt8WVdim+lrNaK7VHp99Qt5pSNziXznKHViIBbXWtfRTpEFpF/c4FdfxNAsCCwPp5phBYJtw==} - engines: {node: '>=0.10.0'} - - arrgv@1.0.2: - resolution: {integrity: sha512-a4eg4yhp7mmruZDQFqVMlxNRFGi/i1r87pt8SDHy0/I8PqSXoUTlWZRdAZo0VXgvEARcujbtTk8kiZRi1uDGRw==} - engines: {node: '>=8.0.0'} - - arrify@3.0.0: - resolution: {integrity: sha512-tLkvA81vQG/XqE2mjDkGQHoOINtMHtysSnemrmoGe6PydDPMRbVugqyk4A6V/WDWEfm3l+0d8anA9r8cv/5Jaw==} - engines: {node: '>=12'} - - async-sema@3.1.1: - resolution: {integrity: sha512-tLRNUXati5MFePdAk8dw7Qt7DpxPB60ofAgn8WRhW6a2rcimZnYBP9oxHiv0OHy+Wz7kPMG+t4LGdt31+4EmGg==} - - ava@6.1.2: - resolution: {integrity: sha512-WcpxJ8yZ7mk9ABTinD0IAjcemovSeVGjuuwZx0JS9johREWFeLTl8UP6wd7l6nmnrWqkKZdwaD71a/ocH4qPKw==} - engines: {node: ^18.18 || ^20.8 || ^21} - hasBin: true - peerDependencies: - '@ava/typescript': '*' - peerDependenciesMeta: - '@ava/typescript': - optional: true - - balanced-match@1.0.2: - resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} - - base64-js@1.5.1: - resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==} - - before-after-hook@2.2.3: - resolution: {integrity: sha512-NzUnlZexiaH/46WDhANlyR2bXRopNg4F/zuSA3OpZnllCUgRaOF2znDioDWrmbNVsuZk6l9pMquQB38cfBZwkQ==} - - bindings@1.5.0: - resolution: {integrity: sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==} - - bl@4.1.0: - resolution: {integrity: sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==} - - blueimp-md5@2.19.0: - resolution: {integrity: sha512-DRQrD6gJyy8FbiE4s+bDoXS9hiW3Vbx5uCdwvcCf3zLHL+Iv7LtGHLpr+GZV8rHG8tK766FGYBwRbu8pELTt+w==} - - brace-expansion@1.1.11: - resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} - - braces@3.0.2: - resolution: {integrity: sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==} - engines: {node: '>=8'} - - buffer@5.7.1: - resolution: {integrity: sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==} - - call-bind@1.0.7: - resolution: {integrity: sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==} - engines: {node: '>= 0.4'} - - callsites@4.1.0: - resolution: {integrity: sha512-aBMbD1Xxay75ViYezwT40aQONfr+pSXTHwNKvIXhXD6+LY3F1dLIcceoC5OZKBVHbXcysz1hL9D2w0JJIMXpUw==} - engines: {node: '>=12.20'} - - cbor@9.0.2: - resolution: {integrity: sha512-JPypkxsB10s9QOWwa6zwPzqE1Md3vqpPc+cai4sAecuCsRyAtAl/pMyhPlMbT/xtPnm2dznJZYRLui57qiRhaQ==} - engines: {node: '>=16'} - - chalk@4.1.2: - resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} - engines: {node: '>=10'} - - chalk@5.3.0: - resolution: {integrity: sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==} - engines: {node: ^12.17.0 || ^14.13 || >=16.0.0} - - chardet@0.7.0: - resolution: {integrity: sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==} - - chownr@2.0.0: - resolution: {integrity: sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==} - engines: {node: '>=10'} - - chunkd@2.0.1: - resolution: {integrity: sha512-7d58XsFmOq0j6el67Ug9mHf9ELUXsQXYJBkyxhH/k+6Ke0qXRnv0kbemx+Twc6fRJ07C49lcbdgm9FL1Ei/6SQ==} - - ci-info@4.0.0: - resolution: {integrity: sha512-TdHqgGf9odd8SXNuxtUBVx8Nv+qZOejE6qyqiy5NtbYYQOeFa6zmHkxlPzmaLxWWHsU6nJmB7AETdVPi+2NBUg==} - engines: {node: '>=8'} - - ci-parallel-vars@1.0.1: - resolution: {integrity: sha512-uvzpYrpmidaoxvIQHM+rKSrigjOe9feHYbw4uOI2gdfe1C3xIlxO+kVXq83WQWNniTf8bAxVpy+cQeFQsMERKg==} - - cli-cursor@3.1.0: - resolution: {integrity: sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==} - engines: {node: '>=8'} - - cli-spinners@2.9.2: - resolution: {integrity: sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==} - engines: {node: '>=6'} - - cli-truncate@4.0.0: - resolution: {integrity: sha512-nPdaFdQ0h/GEigbPClz11D0v/ZJEwxmeVZGeMo3Z5StPtUTkA9o1lD6QwoirYiSDzbcwn2XcjwmCp68W1IS4TA==} - engines: {node: '>=18'} - - cli-width@4.1.0: - resolution: {integrity: sha512-ouuZd4/dm2Sw5Gmqy6bGyNNNe1qt9RpmxveLSO7KcgsTnU7RXfsw+/bukWGo1abgBiMAic068rclZsO4IWmmxQ==} - engines: {node: '>= 12'} - - clipanion@3.2.1: - resolution: {integrity: sha512-dYFdjLb7y1ajfxQopN05mylEpK9ZX0sO1/RfMXdfmwjlIsPkbh4p7A682x++zFPLDCo1x3p82dtljHf5cW2LKA==} - peerDependencies: - typanion: '*' - - cliui@8.0.1: - resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==} - engines: {node: '>=12'} - - clone@1.0.4: - resolution: {integrity: sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==} - engines: {node: '>=0.8'} - - code-excerpt@4.0.0: - resolution: {integrity: sha512-xxodCmBen3iy2i0WtAK8FlFNrRzjUqjRsMfho58xT/wvZU1YTM3fCnRjcy1gJPMepaRlgm/0e6w8SpWHpn3/cA==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - color-convert@2.0.1: - resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} - engines: {node: '>=7.0.0'} - - color-name@1.1.4: - resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} - - color-support@1.1.3: - resolution: {integrity: sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==} - hasBin: true - - colorette@2.0.20: - resolution: {integrity: sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==} - - common-path-prefix@3.0.0: - resolution: {integrity: sha512-QE33hToZseCH3jS0qN96O/bSh3kaw/h+Tq7ngyY9eWDUnTlTNUyqfqvCXioLe5Na5jFsL78ra/wuBU4iuEgd4w==} - - concat-map@0.0.1: - resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} - - concordance@5.0.4: - resolution: {integrity: sha512-OAcsnTEYu1ARJqWVGwf4zh4JDfHZEaSNlNccFmt8YjB2l/n19/PF2viLINHc57vO4FKIAFl2FWASIGZZWZ2Kxw==} - engines: {node: '>=10.18.0 <11 || >=12.14.0 <13 || >=14'} - - console-control-strings@1.1.0: - resolution: {integrity: sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==} - - convert-to-spaces@2.0.1: - resolution: {integrity: sha512-rcQ1bsQO9799wq24uE5AM2tAILy4gXGIK/njFWcVQkGNZ96edlpY+A7bjwvzjYvLDyzmG1MmMLZhpcsb+klNMQ==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - currently-unhandled@0.4.1: - resolution: {integrity: sha512-/fITjgjGU50vjQ4FH6eUoYu+iUoUKIXws2hL15JJpIR+BbTxaXQsMuuyjtNh2WqsSBS5nsaZHFsFecyw5CCAng==} - engines: {node: '>=0.10.0'} - - date-time@3.1.0: - resolution: {integrity: sha512-uqCUKXE5q1PNBXjPqvwhwJf9SwMoAHBgWJ6DcrnS5o+W2JOiIILl0JEdVD8SGujrNS02GGxgwAg2PN2zONgtjg==} - engines: {node: '>=6'} - - debug@4.3.4: - resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==} - engines: {node: '>=6.0'} - peerDependencies: - supports-color: '*' - peerDependenciesMeta: - supports-color: - optional: true - - defaults@1.0.4: - resolution: {integrity: sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A==} - - define-data-property@1.1.4: - resolution: {integrity: sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==} - engines: {node: '>= 0.4'} - - delegates@1.0.0: - resolution: {integrity: sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==} - - deprecation@2.3.1: - resolution: {integrity: sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==} - - detect-libc@2.0.3: - resolution: {integrity: sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw==} - engines: {node: '>=8'} - - emittery@1.0.3: - resolution: {integrity: sha512-tJdCJitoy2lrC2ldJcqN4vkqJ00lT+tOWNT1hBJjO/3FDMJa5TTIiYGCKGkn/WfCyOzUMObeohbVTj00fhiLiA==} - engines: {node: '>=14.16'} - - emnapi@1.1.1: - resolution: {integrity: sha512-md0YDBLCX+378+zzibHvOLsj28YKFy8vl7BiSzVocCY7HujOkYt+N5LCOYqLeYi5C5/5NlnkNweVdUjrvKpGNg==} - peerDependencies: - node-addon-api: '>= 6.1.0' - peerDependenciesMeta: - node-addon-api: - optional: true - - emoji-regex@10.3.0: - resolution: {integrity: sha512-QpLs9D9v9kArv4lfDEgg1X/gN5XLnf/A6l9cs8SPZLRZR3ZkY9+kwIQTxm+fsSej5UMYGE8fdoaZVIBlqG0XTw==} - - emoji-regex@8.0.0: - resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} - - es-define-property@1.0.0: - resolution: {integrity: sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==} - engines: {node: '>= 0.4'} - - es-errors@1.3.0: - resolution: {integrity: sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==} - engines: {node: '>= 0.4'} - - escalade@3.1.2: - resolution: {integrity: sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==} - engines: {node: '>=6'} - - escape-string-regexp@2.0.0: - resolution: {integrity: sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==} - engines: {node: '>=8'} - - escape-string-regexp@5.0.0: - resolution: {integrity: sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==} - engines: {node: '>=12'} - - esprima@4.0.1: - resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==} - engines: {node: '>=4'} - hasBin: true - - estree-walker@2.0.2: - resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==} - - esutils@2.0.3: - resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} - engines: {node: '>=0.10.0'} - - external-editor@3.1.0: - resolution: {integrity: sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==} - engines: {node: '>=4'} - - fast-diff@1.3.0: - resolution: {integrity: sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==} - - fast-glob@3.3.2: - resolution: {integrity: sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==} - engines: {node: '>=8.6.0'} - - fastq@1.17.1: - resolution: {integrity: sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==} - - figures@6.1.0: - resolution: {integrity: sha512-d+l3qxjSesT4V7v2fh+QnmFnUWv9lSpjarhShNTgBOfA0ttejbQUAlHLitbjkoRiDulW0OPoQPYIGhIC8ohejg==} - engines: {node: '>=18'} - - file-uri-to-path@1.0.0: - resolution: {integrity: sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==} - - fill-range@7.0.1: - resolution: {integrity: sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==} - engines: {node: '>=8'} - - find-up-simple@1.0.0: - resolution: {integrity: sha512-q7Us7kcjj2VMePAa02hDAF6d+MzsdsAWEwYyOpwUtlerRBkOEPBCRZrAV4XfcSN8fHAgaD0hP7miwoay6DCprw==} - engines: {node: '>=18'} - - fs-minipass@2.1.0: - resolution: {integrity: sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==} - engines: {node: '>= 8'} - - fs.realpath@1.0.0: - resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} - - function-bind@1.1.2: - resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==} - - gauge@3.0.2: - resolution: {integrity: sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q==} - engines: {node: '>=10'} - - get-caller-file@2.0.5: - resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} - engines: {node: 6.* || 8.* || >= 10.*} - - get-east-asian-width@1.2.0: - resolution: {integrity: sha512-2nk+7SIVb14QrgXFHcm84tD4bKQz0RxPuMT8Ag5KPOq7J5fEmAg0UbXdTOSHqNuHSU28k55qnceesxXRZGzKWA==} - engines: {node: '>=18'} - - get-intrinsic@1.2.4: - resolution: {integrity: sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==} - engines: {node: '>= 0.4'} - - glob-parent@5.1.2: - resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} - engines: {node: '>= 6'} - - glob@7.2.3: - resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} - - globby@14.0.1: - resolution: {integrity: sha512-jOMLD2Z7MAhyG8aJpNOpmziMOP4rPLcc95oQPKXBazW82z+CEgPFBQvEpRUa1KeIMUJo4Wsm+q6uzO/Q/4BksQ==} - engines: {node: '>=18'} - - gopd@1.0.1: - resolution: {integrity: sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==} - - graceful-fs@4.2.11: - resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} - - has-flag@4.0.0: - resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} - engines: {node: '>=8'} - - has-property-descriptors@1.0.2: - resolution: {integrity: sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==} - - has-proto@1.0.3: - resolution: {integrity: sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==} - engines: {node: '>= 0.4'} - - has-symbols@1.0.3: - resolution: {integrity: sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==} - engines: {node: '>= 0.4'} - - has-unicode@2.0.1: - resolution: {integrity: sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==} - - hasown@2.0.2: - resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==} - engines: {node: '>= 0.4'} - - https-proxy-agent@5.0.1: - resolution: {integrity: sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==} - engines: {node: '>= 6'} - - iconv-lite@0.4.24: - resolution: {integrity: sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==} - engines: {node: '>=0.10.0'} - - ieee754@1.2.1: - resolution: {integrity: sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==} - - ignore-by-default@2.1.0: - resolution: {integrity: sha512-yiWd4GVmJp0Q6ghmM2B/V3oZGRmjrKLXvHR3TE1nfoXsmoggllfZUQe74EN0fJdPFZu2NIvNdrMMLm3OsV7Ohw==} - engines: {node: '>=10 <11 || >=12 <13 || >=14'} - - ignore@5.3.1: - resolution: {integrity: sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==} - engines: {node: '>= 4'} - - imurmurhash@0.1.4: - resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} - engines: {node: '>=0.8.19'} - - indent-string@5.0.0: - resolution: {integrity: sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==} - engines: {node: '>=12'} - - inflight@1.0.6: - resolution: {integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==} - - inherits@2.0.4: - resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} - - inquirer@9.2.19: - resolution: {integrity: sha512-WpxOT71HGsFya6/mj5PUue0sWwbpbiPfAR+332zLj/siB0QA1PZM8v3GepegFV1Op189UxHUCF6y8AySdtOMVA==} - engines: {node: '>=18'} - - irregular-plurals@3.5.0: - resolution: {integrity: sha512-1ANGLZ+Nkv1ptFb2pa8oG8Lem4krflKuX/gINiHJHjJUKaJHk/SXk5x6K3J+39/p0h1RQ2saROclJJ+QLvETCQ==} - engines: {node: '>=8'} - - is-extglob@2.1.1: - resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} - engines: {node: '>=0.10.0'} - - is-fullwidth-code-point@3.0.0: - resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} - engines: {node: '>=8'} - - is-fullwidth-code-point@4.0.0: - resolution: {integrity: sha512-O4L094N2/dZ7xqVdrXhh9r1KODPJpFms8B5sGdJLPy664AgvXsreZUyCQQNItZRDlYug4xStLjNp/sz3HvBowQ==} - engines: {node: '>=12'} - - is-glob@4.0.3: - resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} - engines: {node: '>=0.10.0'} - - is-interactive@1.0.0: - resolution: {integrity: sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w==} - engines: {node: '>=8'} - - is-number@7.0.0: - resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} - engines: {node: '>=0.12.0'} - - is-plain-object@5.0.0: - resolution: {integrity: sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==} - engines: {node: '>=0.10.0'} - - is-promise@4.0.0: - resolution: {integrity: sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==} - - is-unicode-supported@0.1.0: - resolution: {integrity: sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==} - engines: {node: '>=10'} - - is-unicode-supported@2.0.0: - resolution: {integrity: sha512-FRdAyx5lusK1iHG0TWpVtk9+1i+GjrzRffhDg4ovQ7mcidMQ6mj+MhKPmvh7Xwyv5gIS06ns49CA7Sqg7lC22Q==} - engines: {node: '>=18'} - - js-string-escape@1.0.1: - resolution: {integrity: sha512-Smw4xcfIQ5LVjAOuJCvN/zIodzA/BBSsluuoSykP+lUvScIi4U6RJLfwHet5cxFnCswUjISV8oAXaqaJDY3chg==} - engines: {node: '>= 0.8'} - - js-yaml@3.14.1: - resolution: {integrity: sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==} - hasBin: true - - js-yaml@4.1.0: - resolution: {integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==} - hasBin: true - - load-json-file@7.0.1: - resolution: {integrity: sha512-Gnxj3ev3mB5TkVBGad0JM6dmLiQL+o0t23JPBZ9sd+yvSLk05mFoqKBw5N8gbbkU4TNXyqCgIrl/VM17OgUIgQ==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - lodash-es@4.17.21: - resolution: {integrity: sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==} - - lodash@4.17.21: - resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} - - log-symbols@4.1.0: - resolution: {integrity: sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==} - engines: {node: '>=10'} - - lru-cache@6.0.0: - resolution: {integrity: sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==} - engines: {node: '>=10'} - - make-dir@3.1.0: - resolution: {integrity: sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==} - engines: {node: '>=8'} - - matcher@5.0.0: - resolution: {integrity: sha512-s2EMBOWtXFc8dgqvoAzKJXxNHibcdJMV0gwqKUaw9E2JBJuGUK7DrNKrA6g/i+v72TT16+6sVm5mS3thaMLQUw==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - md5-hex@3.0.1: - resolution: {integrity: sha512-BUiRtTtV39LIJwinWBjqVsU9xhdnz7/i889V859IBFpuqGAj6LuOvHv5XLbgZ2R7ptJoJaEcxkv88/h25T7Ciw==} - engines: {node: '>=8'} - - memoize@10.0.0: - resolution: {integrity: sha512-H6cBLgsi6vMWOcCpvVCdFFnl3kerEXbrYh9q+lY6VXvQSmM6CkmV08VOwT+WE2tzIEqRPFfAq3fm4v/UIW6mSA==} - engines: {node: '>=18'} - - merge2@1.4.1: - resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} - engines: {node: '>= 8'} - - micromatch@4.0.5: - resolution: {integrity: sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==} - engines: {node: '>=8.6'} - - mimic-fn@2.1.0: - resolution: {integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==} - engines: {node: '>=6'} - - mimic-function@5.0.1: - resolution: {integrity: sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==} - engines: {node: '>=18'} - - minimatch@3.1.2: - resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} - - minipass@3.3.6: - resolution: {integrity: sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==} - engines: {node: '>=8'} - - minipass@5.0.0: - resolution: {integrity: sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==} - engines: {node: '>=8'} - - minizlib@2.1.2: - resolution: {integrity: sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==} - engines: {node: '>= 8'} - - mkdirp@1.0.4: - resolution: {integrity: sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==} - engines: {node: '>=10'} - hasBin: true - - ms@2.1.2: - resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} - - ms@2.1.3: - resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} - - mute-stream@1.0.0: - resolution: {integrity: sha512-avsJQhyd+680gKXyG/sQc0nXaC6rBkPOfyHYcFb9+hdkqQkR9bdnkJ0AMZhke0oesPqIO+mFFJ+IdBc7mst4IA==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - - node-fetch@2.7.0: - resolution: {integrity: sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==} - engines: {node: 4.x || >=6.0.0} - peerDependencies: - encoding: ^0.1.0 - peerDependenciesMeta: - encoding: - optional: true - - node-gyp-build@4.8.0: - resolution: {integrity: sha512-u6fs2AEUljNho3EYTJNBfImO5QTo/J/1Etd+NVdCj7qWKUSN/bSLkZwhDv7I+w/MSC6qJ4cknepkAYykDdK8og==} - hasBin: true - - nofilter@3.1.0: - resolution: {integrity: sha512-l2NNj07e9afPnhAhvgVrCD/oy2Ai1yfLpuo3EpiO1jFTsB4sFz6oIfAfSZyQzVpkZQ9xS8ZS5g1jCBgq4Hwo0g==} - engines: {node: '>=12.19'} - - nopt@5.0.0: - resolution: {integrity: sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==} - engines: {node: '>=6'} - hasBin: true - - npmlog@5.0.1: - resolution: {integrity: sha512-AqZtDUWOMKs1G/8lwylVjrdYgqA4d9nu8hc+0gzRxlDb1I10+FHBGMXs6aiQHFdCUUlqH99MUMuLfzWDNDtfxw==} - - object-assign@4.1.1: - resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} - engines: {node: '>=0.10.0'} - - once@1.4.0: - resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} - - onetime@5.1.2: - resolution: {integrity: sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==} - engines: {node: '>=6'} - - ora@5.4.1: - resolution: {integrity: sha512-5b6Y85tPxZZ7QytO+BQzysW31HJku27cRIlkbAXaNx+BdcVi+LlRFmVXzeF6a7JCwJpyw5c4b+YSVImQIrBpuQ==} - engines: {node: '>=10'} - - os-tmpdir@1.0.2: - resolution: {integrity: sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==} - engines: {node: '>=0.10.0'} - - p-map@7.0.2: - resolution: {integrity: sha512-z4cYYMMdKHzw4O5UkWJImbZynVIo0lSGTXc7bzB1e/rrDqkgGUNysK/o4bTr+0+xKvvLoTyGqYC4Fgljy9qe1Q==} - engines: {node: '>=18'} - - package-config@5.0.0: - resolution: {integrity: sha512-GYTTew2slBcYdvRHqjhwaaydVMvn/qrGC323+nKclYioNSLTDUM/lGgtGTgyHVtYcozb+XkE8CNhwcraOmZ9Mg==} - engines: {node: '>=18'} - - parse-ms@4.0.0: - resolution: {integrity: sha512-TXfryirbmq34y8QBwgqCVLi+8oA3oWx2eAnSn62ITyEhEYaWRlVZ2DvMM9eZbMs/RfxPu/PK/aBLyGj4IrqMHw==} - engines: {node: '>=18'} - - path-is-absolute@1.0.1: - resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==} - engines: {node: '>=0.10.0'} - - path-type@5.0.0: - resolution: {integrity: sha512-5HviZNaZcfqP95rwpv+1HDgUamezbqdSYTyzjTvwtJSnIH+3vnbmWsItli8OFEndS984VT55M3jduxZbX351gg==} - engines: {node: '>=12'} - - picomatch@2.3.1: - resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} - engines: {node: '>=8.6'} - - picomatch@3.0.1: - resolution: {integrity: sha512-I3EurrIQMlRc9IaAZnqRR044Phh2DXY+55o7uJ0V+hYZAcQYSuFWsc9q5PvyDHUSCe1Qxn/iBz+78s86zWnGag==} - engines: {node: '>=10'} - - plur@5.1.0: - resolution: {integrity: sha512-VP/72JeXqak2KiOzjgKtQen5y3IZHn+9GOuLDafPv0eXa47xq0At93XahYBs26MsifCQ4enGKwbjBTKgb9QJXg==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - pretty-ms@9.0.0: - resolution: {integrity: sha512-E9e9HJ9R9NasGOgPaPE8VMeiPKAyWR5jcFpNnwIejslIhWqdqOrb2wShBsncMPUb+BcCd2OPYfh7p2W6oemTng==} - engines: {node: '>=18'} - - queue-microtask@1.2.3: - resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} - - readable-stream@3.6.2: - resolution: {integrity: sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==} - engines: {node: '>= 6'} - - require-directory@2.1.1: - resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} - engines: {node: '>=0.10.0'} - - resolve-cwd@3.0.0: - resolution: {integrity: sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==} - engines: {node: '>=8'} - - resolve-from@5.0.0: - resolution: {integrity: sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==} - engines: {node: '>=8'} - - restore-cursor@3.1.0: - resolution: {integrity: sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==} - engines: {node: '>=8'} - - reusify@1.0.4: - resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==} - engines: {iojs: '>=1.0.0', node: '>=0.10.0'} - - rimraf@3.0.2: - resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==} - hasBin: true - - run-async@3.0.0: - resolution: {integrity: sha512-540WwVDOMxA6dN6We19EcT9sc3hkXPw5mzRNGM3FkdN/vtE9NFvj5lFAPNwUDmJjXidm3v7TC1cTE7t17Ulm1Q==} - engines: {node: '>=0.12.0'} - - run-parallel@1.2.0: - resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} - - rxjs@7.8.1: - resolution: {integrity: sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==} - - safe-buffer@5.2.1: - resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} - - safer-buffer@2.1.2: - resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} - - semver@6.3.1: - resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} - hasBin: true - - semver@7.6.0: - resolution: {integrity: sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==} - engines: {node: '>=10'} - hasBin: true - - serialize-error@7.0.1: - resolution: {integrity: sha512-8I8TjW5KMOKsZQTvoxjuSIa7foAwPWGOts+6o7sgjz41/qMD9VQHEDxi6PBvK2l0MXUmqZyNpUK+T2tQaaElvw==} - engines: {node: '>=10'} - - set-blocking@2.0.0: - resolution: {integrity: sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==} - - set-function-length@1.2.2: - resolution: {integrity: sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==} - engines: {node: '>= 0.4'} - - signal-exit@3.0.7: - resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} - - signal-exit@4.1.0: - resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} - engines: {node: '>=14'} - - slash@5.1.0: - resolution: {integrity: sha512-ZA6oR3T/pEyuqwMgAKT0/hAv8oAXckzbkmR0UkUosQ+Mc4RxGoJkRmwHgHufaenlyAgE1Mxgpdcrf75y6XcnDg==} - engines: {node: '>=14.16'} - - slice-ansi@5.0.0: - resolution: {integrity: sha512-FC+lgizVPfie0kkhqUScwRu1O/lF6NOgJmlCgK+/LYxDCTk8sGelYaHDhFcDN+Sn3Cv+3VSa4Byeo+IMCzpMgQ==} - engines: {node: '>=12'} - - sprintf-js@1.0.3: - resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==} - - stack-utils@2.0.6: - resolution: {integrity: sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==} - engines: {node: '>=10'} - - string-width@4.2.3: - resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} - engines: {node: '>=8'} - - string-width@7.1.0: - resolution: {integrity: sha512-SEIJCWiX7Kg4c129n48aDRwLbFb2LJmXXFrWBG4NGaRtMQ3myKPKbwrD1BKqQn74oCoNMBVrfDEr5M9YxCsrkw==} - engines: {node: '>=18'} - - string_decoder@1.3.0: - resolution: {integrity: sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==} - - strip-ansi@6.0.1: - resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} - engines: {node: '>=8'} - - strip-ansi@7.1.0: - resolution: {integrity: sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==} - engines: {node: '>=12'} - - supertap@3.0.1: - resolution: {integrity: sha512-u1ZpIBCawJnO+0QePsEiOknOfCRq0yERxiAchT0i4li0WHNUJbf0evXXSXOcCAR4M8iMDoajXYmstm/qO81Isw==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - supports-color@7.2.0: - resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} - engines: {node: '>=8'} - - tar@6.2.1: - resolution: {integrity: sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==} - engines: {node: '>=10'} - - temp-dir@3.0.0: - resolution: {integrity: sha512-nHc6S/bwIilKHNRgK/3jlhDoIHcp45YgyiwcAk46Tr0LfEqGBVpmiAyuiuxeVE44m3mXnEeVhaipLOEWmH+Njw==} - engines: {node: '>=14.16'} - - time-zone@1.0.0: - resolution: {integrity: sha512-TIsDdtKo6+XrPtiTm1ssmMngN1sAhyKnTO2kunQWqNPWIVvCm15Wmw4SWInwTVgJ5u/Tr04+8Ei9TNcw4x4ONA==} - engines: {node: '>=4'} - - tmp@0.0.33: - resolution: {integrity: sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==} - engines: {node: '>=0.6.0'} - - to-regex-range@5.0.1: - resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} - engines: {node: '>=8.0'} - - toml@3.0.0: - resolution: {integrity: sha512-y/mWCZinnvxjTKYhJ+pYxwD0mRLVvOtdS2Awbgxln6iEnt4rk0yBxeSBHkGJcPucRiG0e55mwWp+g/05rsrd6w==} - - tr46@0.0.3: - resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==} - - tslib@2.6.2: - resolution: {integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==} - - typanion@3.14.0: - resolution: {integrity: sha512-ZW/lVMRabETuYCd9O9ZvMhAh8GslSqaUjxmK/JLPCh6l73CvLBiuXswj/+7LdnWOgYsQ130FqLzFz5aGT4I3Ug==} - - type-fest@0.13.1: - resolution: {integrity: sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==} - engines: {node: '>=10'} - - type-fest@0.21.3: - resolution: {integrity: sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==} - engines: {node: '>=10'} - - typescript@5.4.5: - resolution: {integrity: sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==} - engines: {node: '>=14.17'} - hasBin: true - - undici-types@5.26.5: - resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==} - - unicorn-magic@0.1.0: - resolution: {integrity: sha512-lRfVq8fE8gz6QMBuDM6a+LO3IAzTi05H6gCVaUpir2E1Rwpo4ZUog45KpNXKC/Mn3Yb9UDuHumeFTo9iV/D9FQ==} - engines: {node: '>=18'} - - universal-user-agent@6.0.1: - resolution: {integrity: sha512-yCzhz6FN2wU1NiiQRogkTQszlQSlpWaw8SvVegAc+bDxbzHgh1vX8uIe8OYyMH6DwH+sdTJsgMl36+mSMdRJIQ==} - - util-deprecate@1.0.2: - resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} - - wasm-sjlj@1.0.5: - resolution: {integrity: sha512-Z/MHJeOkAvJJVWnGX3/YZGYldGaawZbYHX4ldYG9kLhcdB8H31F5x66M7Zc4BP/7pg0aLsusQj1629m2B3Rilg==} - - wcwidth@1.0.1: - resolution: {integrity: sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==} - - webidl-conversions@3.0.1: - resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==} - - well-known-symbols@2.0.0: - resolution: {integrity: sha512-ZMjC3ho+KXo0BfJb7JgtQ5IBuvnShdlACNkKkdsqBmYw3bPAaJfPeYUo6tLUaT5tG/Gkh7xkpBhKRQ9e7pyg9Q==} - engines: {node: '>=6'} - - whatwg-url@5.0.0: - resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==} - - wide-align@1.1.5: - resolution: {integrity: sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==} - - wrap-ansi@6.2.0: - resolution: {integrity: sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==} - engines: {node: '>=8'} - - wrap-ansi@7.0.0: - resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==} - engines: {node: '>=10'} - - wrappy@1.0.2: - resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} - - write-file-atomic@5.0.1: - resolution: {integrity: sha512-+QU2zd6OTD8XWIJCbffaiQeH9U73qIqafo1x6V1snCWYGJf6cVE0cDR4D8xRzcEnfI21IFrUPzPGtcPf8AC+Rw==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - - y18n@5.0.8: - resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==} - engines: {node: '>=10'} - - yallist@4.0.0: - resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==} - - yargs-parser@21.1.1: - resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} - engines: {node: '>=12'} - - yargs@17.7.2: - resolution: {integrity: sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==} - engines: {node: '>=12'} - -snapshots: - - '@emnapi/core@1.1.1': - dependencies: - tslib: 2.6.2 - - '@emnapi/runtime@1.1.1': - dependencies: - tslib: 2.6.2 - - '@inquirer/figures@1.0.1': {} - - '@ljharb/through@2.3.13': - dependencies: - call-bind: 1.0.7 - - '@mapbox/node-pre-gyp@1.0.11': - dependencies: - detect-libc: 2.0.3 - https-proxy-agent: 5.0.1 - make-dir: 3.1.0 - node-fetch: 2.7.0 - nopt: 5.0.0 - npmlog: 5.0.1 - rimraf: 3.0.2 - semver: 7.6.0 - tar: 6.2.1 - transitivePeerDependencies: - - encoding - - supports-color - - '@napi-rs/cli@3.0.0-alpha.51(@emnapi/runtime@1.1.1)(emnapi@1.1.1)': - dependencies: - '@napi-rs/cross-toolchain': 0.0.14 - '@napi-rs/wasm-tools': 0.0.1 - '@octokit/rest': 20.1.0 - clipanion: 3.2.1(typanion@3.14.0) - colorette: 2.0.20 - debug: 4.3.4 - inquirer: 9.2.19 - js-yaml: 4.1.0 - lodash-es: 4.17.21 - semver: 7.6.0 - toml: 3.0.0 - typanion: 3.14.0 - wasm-sjlj: 1.0.5 - optionalDependencies: - '@emnapi/runtime': 1.1.1 - emnapi: 1.1.1 - transitivePeerDependencies: - - '@napi-rs/cross-toolchain-arm64-target-aarch64' - - '@napi-rs/cross-toolchain-arm64-target-armv7' - - '@napi-rs/cross-toolchain-arm64-target-x86_64' - - '@napi-rs/cross-toolchain-x64-target-aarch64' - - '@napi-rs/cross-toolchain-x64-target-armv7' - - '@napi-rs/cross-toolchain-x64-target-x86_64' - - supports-color - - '@napi-rs/cross-toolchain@0.0.14': - dependencies: - '@napi-rs/lzma': 1.2.1 - '@napi-rs/tar': 0.1.0 - debug: 4.3.4 - transitivePeerDependencies: - - supports-color - - '@napi-rs/lzma-android-arm-eabi@1.2.1': - optional: true - - '@napi-rs/lzma-android-arm64@1.2.1': - optional: true - - '@napi-rs/lzma-darwin-arm64@1.2.1': - optional: true - - '@napi-rs/lzma-darwin-x64@1.2.1': - optional: true - - '@napi-rs/lzma-freebsd-x64@1.2.1': - optional: true - - '@napi-rs/lzma-linux-arm-gnueabihf@1.2.1': - optional: true - - '@napi-rs/lzma-linux-arm64-gnu@1.2.1': - optional: true - - '@napi-rs/lzma-linux-arm64-musl@1.2.1': - optional: true - - '@napi-rs/lzma-linux-x64-gnu@1.2.1': - optional: true - - '@napi-rs/lzma-linux-x64-musl@1.2.1': - optional: true - - '@napi-rs/lzma-win32-arm64-msvc@1.2.1': - optional: true - - '@napi-rs/lzma-win32-ia32-msvc@1.2.1': - optional: true - - '@napi-rs/lzma-win32-x64-msvc@1.2.1': - optional: true - - '@napi-rs/lzma@1.2.1': - optionalDependencies: - '@napi-rs/lzma-android-arm-eabi': 1.2.1 - '@napi-rs/lzma-android-arm64': 1.2.1 - '@napi-rs/lzma-darwin-arm64': 1.2.1 - '@napi-rs/lzma-darwin-x64': 1.2.1 - '@napi-rs/lzma-freebsd-x64': 1.2.1 - '@napi-rs/lzma-linux-arm-gnueabihf': 1.2.1 - '@napi-rs/lzma-linux-arm64-gnu': 1.2.1 - '@napi-rs/lzma-linux-arm64-musl': 1.2.1 - '@napi-rs/lzma-linux-x64-gnu': 1.2.1 - '@napi-rs/lzma-linux-x64-musl': 1.2.1 - '@napi-rs/lzma-win32-arm64-msvc': 1.2.1 - '@napi-rs/lzma-win32-ia32-msvc': 1.2.1 - '@napi-rs/lzma-win32-x64-msvc': 1.2.1 - - '@napi-rs/tar-android-arm-eabi@0.1.0': - optional: true - - '@napi-rs/tar-android-arm64@0.1.0': - optional: true - - '@napi-rs/tar-darwin-arm64@0.1.0': - optional: true - - '@napi-rs/tar-darwin-x64@0.1.0': - optional: true - - '@napi-rs/tar-freebsd-x64@0.1.0': - optional: true - - '@napi-rs/tar-linux-arm-gnueabihf@0.1.0': - optional: true - - '@napi-rs/tar-linux-arm64-gnu@0.1.0': - optional: true - - '@napi-rs/tar-linux-arm64-musl@0.1.0': - optional: true - - '@napi-rs/tar-linux-x64-gnu@0.1.0': - optional: true - - '@napi-rs/tar-linux-x64-musl@0.1.0': - optional: true - - '@napi-rs/tar-win32-arm64-msvc@0.1.0': - optional: true - - '@napi-rs/tar-win32-ia32-msvc@0.1.0': - optional: true - - '@napi-rs/tar-win32-x64-msvc@0.1.0': - optional: true - - '@napi-rs/tar@0.1.0': - optionalDependencies: - '@napi-rs/tar-android-arm-eabi': 0.1.0 - '@napi-rs/tar-android-arm64': 0.1.0 - '@napi-rs/tar-darwin-arm64': 0.1.0 - '@napi-rs/tar-darwin-x64': 0.1.0 - '@napi-rs/tar-freebsd-x64': 0.1.0 - '@napi-rs/tar-linux-arm-gnueabihf': 0.1.0 - '@napi-rs/tar-linux-arm64-gnu': 0.1.0 - '@napi-rs/tar-linux-arm64-musl': 0.1.0 - '@napi-rs/tar-linux-x64-gnu': 0.1.0 - '@napi-rs/tar-linux-x64-musl': 0.1.0 - '@napi-rs/tar-win32-arm64-msvc': 0.1.0 - '@napi-rs/tar-win32-ia32-msvc': 0.1.0 - '@napi-rs/tar-win32-x64-msvc': 0.1.0 - - '@napi-rs/wasm-runtime@0.1.2': - dependencies: - '@emnapi/core': 1.1.1 - '@emnapi/runtime': 1.1.1 - '@tybys/wasm-util': 0.8.3 - optional: true - - '@napi-rs/wasm-runtime@0.2.0': - dependencies: - '@emnapi/core': 1.1.1 - '@emnapi/runtime': 1.1.1 - '@tybys/wasm-util': 0.8.3 - - '@napi-rs/wasm-tools-android-arm-eabi@0.0.1': - optional: true - - '@napi-rs/wasm-tools-android-arm64@0.0.1': - optional: true - - '@napi-rs/wasm-tools-darwin-arm64@0.0.1': - optional: true - - '@napi-rs/wasm-tools-darwin-x64@0.0.1': - optional: true - - '@napi-rs/wasm-tools-freebsd-x64@0.0.1': - optional: true - - '@napi-rs/wasm-tools-linux-arm64-gnu@0.0.1': - optional: true - - '@napi-rs/wasm-tools-linux-arm64-musl@0.0.1': - optional: true - - '@napi-rs/wasm-tools-linux-x64-gnu@0.0.1': - optional: true - - '@napi-rs/wasm-tools-linux-x64-musl@0.0.1': - optional: true - - '@napi-rs/wasm-tools-wasm32-wasi@0.0.1': - dependencies: - '@napi-rs/wasm-runtime': 0.1.2 - optional: true - - '@napi-rs/wasm-tools-win32-arm64-msvc@0.0.1': - optional: true - - '@napi-rs/wasm-tools-win32-ia32-msvc@0.0.1': - optional: true - - '@napi-rs/wasm-tools-win32-x64-msvc@0.0.1': - optional: true - - '@napi-rs/wasm-tools@0.0.1': - optionalDependencies: - '@napi-rs/wasm-tools-android-arm-eabi': 0.0.1 - '@napi-rs/wasm-tools-android-arm64': 0.0.1 - '@napi-rs/wasm-tools-darwin-arm64': 0.0.1 - '@napi-rs/wasm-tools-darwin-x64': 0.0.1 - '@napi-rs/wasm-tools-freebsd-x64': 0.0.1 - '@napi-rs/wasm-tools-linux-arm64-gnu': 0.0.1 - '@napi-rs/wasm-tools-linux-arm64-musl': 0.0.1 - '@napi-rs/wasm-tools-linux-x64-gnu': 0.0.1 - '@napi-rs/wasm-tools-linux-x64-musl': 0.0.1 - '@napi-rs/wasm-tools-wasm32-wasi': 0.0.1 - '@napi-rs/wasm-tools-win32-arm64-msvc': 0.0.1 - '@napi-rs/wasm-tools-win32-ia32-msvc': 0.0.1 - '@napi-rs/wasm-tools-win32-x64-msvc': 0.0.1 - - '@nodelib/fs.scandir@2.1.5': - dependencies: - '@nodelib/fs.stat': 2.0.5 - run-parallel: 1.2.0 - - '@nodelib/fs.stat@2.0.5': {} - - '@nodelib/fs.walk@1.2.8': - dependencies: - '@nodelib/fs.scandir': 2.1.5 - fastq: 1.17.1 - - '@octokit/auth-token@4.0.0': {} - - '@octokit/core@5.2.0': - dependencies: - '@octokit/auth-token': 4.0.0 - '@octokit/graphql': 7.1.0 - '@octokit/request': 8.4.0 - '@octokit/request-error': 5.1.0 - '@octokit/types': 13.4.1 - before-after-hook: 2.2.3 - universal-user-agent: 6.0.1 - - '@octokit/endpoint@9.0.5': - dependencies: - '@octokit/types': 13.4.1 - universal-user-agent: 6.0.1 - - '@octokit/graphql@7.1.0': - dependencies: - '@octokit/request': 8.4.0 - '@octokit/types': 13.4.1 - universal-user-agent: 6.0.1 - - '@octokit/openapi-types@20.0.0': {} - - '@octokit/openapi-types@22.1.0': {} - - '@octokit/plugin-paginate-rest@9.2.1(@octokit/core@5.2.0)': - dependencies: - '@octokit/core': 5.2.0 - '@octokit/types': 12.6.0 - - '@octokit/plugin-request-log@4.0.1(@octokit/core@5.2.0)': - dependencies: - '@octokit/core': 5.2.0 - - '@octokit/plugin-rest-endpoint-methods@10.4.1(@octokit/core@5.2.0)': - dependencies: - '@octokit/core': 5.2.0 - '@octokit/types': 12.6.0 - - '@octokit/request-error@5.1.0': - dependencies: - '@octokit/types': 13.4.1 - deprecation: 2.3.1 - once: 1.4.0 - - '@octokit/request@8.4.0': - dependencies: - '@octokit/endpoint': 9.0.5 - '@octokit/request-error': 5.1.0 - '@octokit/types': 13.4.1 - universal-user-agent: 6.0.1 - - '@octokit/rest@20.1.0': - dependencies: - '@octokit/core': 5.2.0 - '@octokit/plugin-paginate-rest': 9.2.1(@octokit/core@5.2.0) - '@octokit/plugin-request-log': 4.0.1(@octokit/core@5.2.0) - '@octokit/plugin-rest-endpoint-methods': 10.4.1(@octokit/core@5.2.0) - - '@octokit/types@12.6.0': - dependencies: - '@octokit/openapi-types': 20.0.0 - - '@octokit/types@13.4.1': - dependencies: - '@octokit/openapi-types': 22.1.0 - - '@rollup/pluginutils@4.2.1': - dependencies: - estree-walker: 2.0.2 - picomatch: 2.3.1 - - '@sindresorhus/merge-streams@2.3.0': {} - - '@tybys/wasm-util@0.8.3': - dependencies: - tslib: 2.6.2 - - '@types/node@20.12.7': - dependencies: - undici-types: 5.26.5 - - '@vercel/nft@0.26.4': - dependencies: - '@mapbox/node-pre-gyp': 1.0.11 - '@rollup/pluginutils': 4.2.1 - acorn: 8.11.3 - acorn-import-attributes: 1.9.5(acorn@8.11.3) - async-sema: 3.1.1 - bindings: 1.5.0 - estree-walker: 2.0.2 - glob: 7.2.3 - graceful-fs: 4.2.11 - micromatch: 4.0.5 - node-gyp-build: 4.8.0 - resolve-from: 5.0.0 - transitivePeerDependencies: - - encoding - - supports-color - - abbrev@1.1.1: {} - - acorn-import-attributes@1.9.5(acorn@8.11.3): - dependencies: - acorn: 8.11.3 - - acorn-walk@8.3.2: {} - - acorn@8.11.3: {} - - agent-base@6.0.2: - dependencies: - debug: 4.3.4 - transitivePeerDependencies: - - supports-color - - ansi-escapes@4.3.2: - dependencies: - type-fest: 0.21.3 - - ansi-regex@5.0.1: {} - - ansi-regex@6.0.1: {} - - ansi-styles@4.3.0: - dependencies: - color-convert: 2.0.1 - - ansi-styles@6.2.1: {} - - aproba@2.0.0: {} - - are-we-there-yet@2.0.0: - dependencies: - delegates: 1.0.0 - readable-stream: 3.6.2 - - argparse@1.0.10: - dependencies: - sprintf-js: 1.0.3 - - argparse@2.0.1: {} - - array-find-index@1.0.2: {} - - arrgv@1.0.2: {} - - arrify@3.0.0: {} - - async-sema@3.1.1: {} - - ava@6.1.2: - dependencies: - '@vercel/nft': 0.26.4 - acorn: 8.11.3 - acorn-walk: 8.3.2 - ansi-styles: 6.2.1 - arrgv: 1.0.2 - arrify: 3.0.0 - callsites: 4.1.0 - cbor: 9.0.2 - chalk: 5.3.0 - chunkd: 2.0.1 - ci-info: 4.0.0 - ci-parallel-vars: 1.0.1 - cli-truncate: 4.0.0 - code-excerpt: 4.0.0 - common-path-prefix: 3.0.0 - concordance: 5.0.4 - currently-unhandled: 0.4.1 - debug: 4.3.4 - emittery: 1.0.3 - figures: 6.1.0 - globby: 14.0.1 - ignore-by-default: 2.1.0 - indent-string: 5.0.0 - is-plain-object: 5.0.0 - is-promise: 4.0.0 - matcher: 5.0.0 - memoize: 10.0.0 - ms: 2.1.3 - p-map: 7.0.2 - package-config: 5.0.0 - picomatch: 3.0.1 - plur: 5.1.0 - pretty-ms: 9.0.0 - resolve-cwd: 3.0.0 - stack-utils: 2.0.6 - strip-ansi: 7.1.0 - supertap: 3.0.1 - temp-dir: 3.0.0 - write-file-atomic: 5.0.1 - yargs: 17.7.2 - transitivePeerDependencies: - - encoding - - supports-color - - balanced-match@1.0.2: {} - - base64-js@1.5.1: {} - - before-after-hook@2.2.3: {} - - bindings@1.5.0: - dependencies: - file-uri-to-path: 1.0.0 - - bl@4.1.0: - dependencies: - buffer: 5.7.1 - inherits: 2.0.4 - readable-stream: 3.6.2 - - blueimp-md5@2.19.0: {} - - brace-expansion@1.1.11: - dependencies: - balanced-match: 1.0.2 - concat-map: 0.0.1 - - braces@3.0.2: - dependencies: - fill-range: 7.0.1 - - buffer@5.7.1: - dependencies: - base64-js: 1.5.1 - ieee754: 1.2.1 - - call-bind@1.0.7: - dependencies: - es-define-property: 1.0.0 - es-errors: 1.3.0 - function-bind: 1.1.2 - get-intrinsic: 1.2.4 - set-function-length: 1.2.2 - - callsites@4.1.0: {} - - cbor@9.0.2: - dependencies: - nofilter: 3.1.0 - - chalk@4.1.2: - dependencies: - ansi-styles: 4.3.0 - supports-color: 7.2.0 - - chalk@5.3.0: {} - - chardet@0.7.0: {} - - chownr@2.0.0: {} - - chunkd@2.0.1: {} - - ci-info@4.0.0: {} - - ci-parallel-vars@1.0.1: {} - - cli-cursor@3.1.0: - dependencies: - restore-cursor: 3.1.0 - - cli-spinners@2.9.2: {} - - cli-truncate@4.0.0: - dependencies: - slice-ansi: 5.0.0 - string-width: 7.1.0 - - cli-width@4.1.0: {} - - clipanion@3.2.1(typanion@3.14.0): - dependencies: - typanion: 3.14.0 - - cliui@8.0.1: - dependencies: - string-width: 4.2.3 - strip-ansi: 6.0.1 - wrap-ansi: 7.0.0 - - clone@1.0.4: {} - - code-excerpt@4.0.0: - dependencies: - convert-to-spaces: 2.0.1 - - color-convert@2.0.1: - dependencies: - color-name: 1.1.4 - - color-name@1.1.4: {} - - color-support@1.1.3: {} - - colorette@2.0.20: {} - - common-path-prefix@3.0.0: {} - - concat-map@0.0.1: {} - - concordance@5.0.4: - dependencies: - date-time: 3.1.0 - esutils: 2.0.3 - fast-diff: 1.3.0 - js-string-escape: 1.0.1 - lodash: 4.17.21 - md5-hex: 3.0.1 - semver: 7.6.0 - well-known-symbols: 2.0.0 - - console-control-strings@1.1.0: {} - - convert-to-spaces@2.0.1: {} - - currently-unhandled@0.4.1: - dependencies: - array-find-index: 1.0.2 - - date-time@3.1.0: - dependencies: - time-zone: 1.0.0 - - debug@4.3.4: - dependencies: - ms: 2.1.2 - - defaults@1.0.4: - dependencies: - clone: 1.0.4 - - define-data-property@1.1.4: - dependencies: - es-define-property: 1.0.0 - es-errors: 1.3.0 - gopd: 1.0.1 - - delegates@1.0.0: {} - - deprecation@2.3.1: {} - - detect-libc@2.0.3: {} - - emittery@1.0.3: {} - - emnapi@1.1.1: {} - - emoji-regex@10.3.0: {} - - emoji-regex@8.0.0: {} - - es-define-property@1.0.0: - dependencies: - get-intrinsic: 1.2.4 - - es-errors@1.3.0: {} - - escalade@3.1.2: {} - - escape-string-regexp@2.0.0: {} - - escape-string-regexp@5.0.0: {} - - esprima@4.0.1: {} - - estree-walker@2.0.2: {} - - esutils@2.0.3: {} - - external-editor@3.1.0: - dependencies: - chardet: 0.7.0 - iconv-lite: 0.4.24 - tmp: 0.0.33 - - fast-diff@1.3.0: {} - - fast-glob@3.3.2: - dependencies: - '@nodelib/fs.stat': 2.0.5 - '@nodelib/fs.walk': 1.2.8 - glob-parent: 5.1.2 - merge2: 1.4.1 - micromatch: 4.0.5 - - fastq@1.17.1: - dependencies: - reusify: 1.0.4 - - figures@6.1.0: - dependencies: - is-unicode-supported: 2.0.0 - - file-uri-to-path@1.0.0: {} - - fill-range@7.0.1: - dependencies: - to-regex-range: 5.0.1 - - find-up-simple@1.0.0: {} - - fs-minipass@2.1.0: - dependencies: - minipass: 3.3.6 - - fs.realpath@1.0.0: {} - - function-bind@1.1.2: {} - - gauge@3.0.2: - dependencies: - aproba: 2.0.0 - color-support: 1.1.3 - console-control-strings: 1.1.0 - has-unicode: 2.0.1 - object-assign: 4.1.1 - signal-exit: 3.0.7 - string-width: 4.2.3 - strip-ansi: 6.0.1 - wide-align: 1.1.5 - - get-caller-file@2.0.5: {} - - get-east-asian-width@1.2.0: {} - - get-intrinsic@1.2.4: - dependencies: - es-errors: 1.3.0 - function-bind: 1.1.2 - has-proto: 1.0.3 - has-symbols: 1.0.3 - hasown: 2.0.2 - - glob-parent@5.1.2: - dependencies: - is-glob: 4.0.3 - - glob@7.2.3: - dependencies: - fs.realpath: 1.0.0 - inflight: 1.0.6 - inherits: 2.0.4 - minimatch: 3.1.2 - once: 1.4.0 - path-is-absolute: 1.0.1 - - globby@14.0.1: - dependencies: - '@sindresorhus/merge-streams': 2.3.0 - fast-glob: 3.3.2 - ignore: 5.3.1 - path-type: 5.0.0 - slash: 5.1.0 - unicorn-magic: 0.1.0 - - gopd@1.0.1: - dependencies: - get-intrinsic: 1.2.4 - - graceful-fs@4.2.11: {} - - has-flag@4.0.0: {} - - has-property-descriptors@1.0.2: - dependencies: - es-define-property: 1.0.0 - - has-proto@1.0.3: {} - - has-symbols@1.0.3: {} - - has-unicode@2.0.1: {} - - hasown@2.0.2: - dependencies: - function-bind: 1.1.2 - - https-proxy-agent@5.0.1: - dependencies: - agent-base: 6.0.2 - debug: 4.3.4 - transitivePeerDependencies: - - supports-color - - iconv-lite@0.4.24: - dependencies: - safer-buffer: 2.1.2 - - ieee754@1.2.1: {} - - ignore-by-default@2.1.0: {} - - ignore@5.3.1: {} - - imurmurhash@0.1.4: {} - - indent-string@5.0.0: {} - - inflight@1.0.6: - dependencies: - once: 1.4.0 - wrappy: 1.0.2 - - inherits@2.0.4: {} - - inquirer@9.2.19: - dependencies: - '@inquirer/figures': 1.0.1 - '@ljharb/through': 2.3.13 - ansi-escapes: 4.3.2 - chalk: 5.3.0 - cli-cursor: 3.1.0 - cli-width: 4.1.0 - external-editor: 3.1.0 - lodash: 4.17.21 - mute-stream: 1.0.0 - ora: 5.4.1 - run-async: 3.0.0 - rxjs: 7.8.1 - string-width: 4.2.3 - strip-ansi: 6.0.1 - wrap-ansi: 6.2.0 - - irregular-plurals@3.5.0: {} - - is-extglob@2.1.1: {} - - is-fullwidth-code-point@3.0.0: {} - - is-fullwidth-code-point@4.0.0: {} - - is-glob@4.0.3: - dependencies: - is-extglob: 2.1.1 - - is-interactive@1.0.0: {} - - is-number@7.0.0: {} - - is-plain-object@5.0.0: {} - - is-promise@4.0.0: {} - - is-unicode-supported@0.1.0: {} - - is-unicode-supported@2.0.0: {} - - js-string-escape@1.0.1: {} - - js-yaml@3.14.1: - dependencies: - argparse: 1.0.10 - esprima: 4.0.1 - - js-yaml@4.1.0: - dependencies: - argparse: 2.0.1 - - load-json-file@7.0.1: {} - - lodash-es@4.17.21: {} - - lodash@4.17.21: {} - - log-symbols@4.1.0: - dependencies: - chalk: 4.1.2 - is-unicode-supported: 0.1.0 - - lru-cache@6.0.0: - dependencies: - yallist: 4.0.0 - - make-dir@3.1.0: - dependencies: - semver: 6.3.1 - - matcher@5.0.0: - dependencies: - escape-string-regexp: 5.0.0 - - md5-hex@3.0.1: - dependencies: - blueimp-md5: 2.19.0 - - memoize@10.0.0: - dependencies: - mimic-function: 5.0.1 - - merge2@1.4.1: {} - - micromatch@4.0.5: - dependencies: - braces: 3.0.2 - picomatch: 2.3.1 - - mimic-fn@2.1.0: {} - - mimic-function@5.0.1: {} - - minimatch@3.1.2: - dependencies: - brace-expansion: 1.1.11 - - minipass@3.3.6: - dependencies: - yallist: 4.0.0 - - minipass@5.0.0: {} - - minizlib@2.1.2: - dependencies: - minipass: 3.3.6 - yallist: 4.0.0 - - mkdirp@1.0.4: {} - - ms@2.1.2: {} - - ms@2.1.3: {} - - mute-stream@1.0.0: {} - - node-fetch@2.7.0: - dependencies: - whatwg-url: 5.0.0 - - node-gyp-build@4.8.0: {} - - nofilter@3.1.0: {} - - nopt@5.0.0: - dependencies: - abbrev: 1.1.1 - - npmlog@5.0.1: - dependencies: - are-we-there-yet: 2.0.0 - console-control-strings: 1.1.0 - gauge: 3.0.2 - set-blocking: 2.0.0 - - object-assign@4.1.1: {} - - once@1.4.0: - dependencies: - wrappy: 1.0.2 - - onetime@5.1.2: - dependencies: - mimic-fn: 2.1.0 - - ora@5.4.1: - dependencies: - bl: 4.1.0 - chalk: 4.1.2 - cli-cursor: 3.1.0 - cli-spinners: 2.9.2 - is-interactive: 1.0.0 - is-unicode-supported: 0.1.0 - log-symbols: 4.1.0 - strip-ansi: 6.0.1 - wcwidth: 1.0.1 - - os-tmpdir@1.0.2: {} - - p-map@7.0.2: {} - - package-config@5.0.0: - dependencies: - find-up-simple: 1.0.0 - load-json-file: 7.0.1 - - parse-ms@4.0.0: {} - - path-is-absolute@1.0.1: {} - - path-type@5.0.0: {} - - picomatch@2.3.1: {} - - picomatch@3.0.1: {} - - plur@5.1.0: - dependencies: - irregular-plurals: 3.5.0 - - pretty-ms@9.0.0: - dependencies: - parse-ms: 4.0.0 - - queue-microtask@1.2.3: {} - - readable-stream@3.6.2: - dependencies: - inherits: 2.0.4 - string_decoder: 1.3.0 - util-deprecate: 1.0.2 - - require-directory@2.1.1: {} - - resolve-cwd@3.0.0: - dependencies: - resolve-from: 5.0.0 - - resolve-from@5.0.0: {} - - restore-cursor@3.1.0: - dependencies: - onetime: 5.1.2 - signal-exit: 3.0.7 - - reusify@1.0.4: {} - - rimraf@3.0.2: - dependencies: - glob: 7.2.3 - - run-async@3.0.0: {} - - run-parallel@1.2.0: - dependencies: - queue-microtask: 1.2.3 - - rxjs@7.8.1: - dependencies: - tslib: 2.6.2 - - safe-buffer@5.2.1: {} - - safer-buffer@2.1.2: {} - - semver@6.3.1: {} - - semver@7.6.0: - dependencies: - lru-cache: 6.0.0 - - serialize-error@7.0.1: - dependencies: - type-fest: 0.13.1 - - set-blocking@2.0.0: {} - - set-function-length@1.2.2: - 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 - - signal-exit@3.0.7: {} - - signal-exit@4.1.0: {} - - slash@5.1.0: {} - - slice-ansi@5.0.0: - dependencies: - ansi-styles: 6.2.1 - is-fullwidth-code-point: 4.0.0 - - sprintf-js@1.0.3: {} - - stack-utils@2.0.6: - dependencies: - escape-string-regexp: 2.0.0 - - string-width@4.2.3: - dependencies: - emoji-regex: 8.0.0 - is-fullwidth-code-point: 3.0.0 - strip-ansi: 6.0.1 - - string-width@7.1.0: - dependencies: - emoji-regex: 10.3.0 - get-east-asian-width: 1.2.0 - strip-ansi: 7.1.0 - - string_decoder@1.3.0: - dependencies: - safe-buffer: 5.2.1 - - strip-ansi@6.0.1: - dependencies: - ansi-regex: 5.0.1 - - strip-ansi@7.1.0: - dependencies: - ansi-regex: 6.0.1 - - supertap@3.0.1: - dependencies: - indent-string: 5.0.0 - js-yaml: 3.14.1 - serialize-error: 7.0.1 - strip-ansi: 7.1.0 - - supports-color@7.2.0: - dependencies: - has-flag: 4.0.0 - - tar@6.2.1: - dependencies: - chownr: 2.0.0 - fs-minipass: 2.1.0 - minipass: 5.0.0 - minizlib: 2.1.2 - mkdirp: 1.0.4 - yallist: 4.0.0 - - temp-dir@3.0.0: {} - - time-zone@1.0.0: {} - - tmp@0.0.33: - dependencies: - os-tmpdir: 1.0.2 - - to-regex-range@5.0.1: - dependencies: - is-number: 7.0.0 - - toml@3.0.0: {} - - tr46@0.0.3: {} - - tslib@2.6.2: {} - - typanion@3.14.0: {} - - type-fest@0.13.1: {} - - type-fest@0.21.3: {} - - typescript@5.4.5: {} - - undici-types@5.26.5: {} - - unicorn-magic@0.1.0: {} - - universal-user-agent@6.0.1: {} - - util-deprecate@1.0.2: {} - - wasm-sjlj@1.0.5: {} - - wcwidth@1.0.1: - dependencies: - defaults: 1.0.4 - - webidl-conversions@3.0.1: {} - - well-known-symbols@2.0.0: {} - - whatwg-url@5.0.0: - dependencies: - tr46: 0.0.3 - webidl-conversions: 3.0.1 - - wide-align@1.1.5: - dependencies: - string-width: 4.2.3 - - wrap-ansi@6.2.0: - dependencies: - ansi-styles: 4.3.0 - string-width: 4.2.3 - strip-ansi: 6.0.1 - - wrap-ansi@7.0.0: - dependencies: - ansi-styles: 4.3.0 - string-width: 4.2.3 - strip-ansi: 6.0.1 - - wrappy@1.0.2: {} - - write-file-atomic@5.0.1: - dependencies: - imurmurhash: 0.1.4 - signal-exit: 4.1.0 - - y18n@5.0.8: {} - - yallist@4.0.0: {} - - yargs-parser@21.1.1: {} - - yargs@17.7.2: - dependencies: - cliui: 8.0.1 - escalade: 3.1.2 - get-caller-file: 2.0.5 - require-directory: 2.1.1 - string-width: 4.2.3 - y18n: 5.0.8 - yargs-parser: 21.1.1 diff --git a/src/builtins.rs b/src/builtins.rs deleted file mode 100644 index 45a25117..00000000 --- a/src/builtins.rs +++ /dev/null @@ -1,71 +0,0 @@ -/// Node.js built-in modules -/// -/// `node -p "[...require('module').builtinModules].map(b => JSON.stringify(b)).join(',\n')"` -/// -pub const NODEJS_BUILTINS: &[&str] = &[ - "_http_agent", - "_http_client", - "_http_common", - "_http_incoming", - "_http_outgoing", - "_http_server", - "_stream_duplex", - "_stream_passthrough", - "_stream_readable", - "_stream_transform", - "_stream_wrap", - "_stream_writable", - "_tls_common", - "_tls_wrap", - "assert", - "assert/strict", - "async_hooks", - "buffer", - "child_process", - "cluster", - "console", - "constants", - "crypto", - "dgram", - "diagnostics_channel", - "dns", - "dns/promises", - "domain", - "events", - "fs", - "fs/promises", - "http", - "http2", - "https", - "inspector", - "module", - "net", - "os", - "path", - "path/posix", - "path/win32", - "perf_hooks", - "process", - "punycode", - "querystring", - "readline", - "repl", - "stream", - "stream/consumers", - "stream/promises", - "stream/web", - "string_decoder", - "sys", - "timers", - "timers/promises", - "tls", - "trace_events", - "tty", - "url", - "util", - "util/types", - "v8", - "vm", - "worker_threads", - "zlib", -]; diff --git a/src/cache.rs b/src/cache.rs deleted file mode 100644 index a1bde36c..00000000 --- a/src/cache.rs +++ /dev/null @@ -1,369 +0,0 @@ -use once_cell::sync::OnceCell as OnceLock; -use std::{ - borrow::{Borrow, Cow}, - convert::AsRef, - hash::{BuildHasherDefault, Hash, Hasher}, - io, - ops::Deref, - path::{Path, PathBuf}, - sync::Arc, -}; - -use dashmap::{DashMap, DashSet}; -use rustc_hash::FxHasher; - -use crate::{ - context::ResolveContext as Ctx, package_json::PackageJson, path::PathUtil, FileMetadata, - FileSystem, ResolveError, ResolveOptions, TsConfig, -}; - -#[derive(Default)] -pub struct Cache { - pub(crate) fs: Fs, - paths: DashSet>, - tsconfigs: DashMap, BuildHasherDefault>, -} - -impl Cache { - pub fn new(fs: Fs) -> Self { - Self { fs, paths: DashSet::default(), tsconfigs: DashMap::default() } - } - - pub fn clear(&self) { - self.paths.clear(); - self.tsconfigs.clear(); - } - - pub fn value(&self, path: &Path) -> CachedPath { - let hash = { - let mut hasher = FxHasher::default(); - path.hash(&mut hasher); - hasher.finish() - }; - if let Some(cache_entry) = self.paths.get((hash, path).borrow() as &dyn CacheKey) { - return cache_entry.clone(); - } - let parent = path.parent().map(|p| self.value(p)); - let data = CachedPath(Arc::new(CachedPathImpl::new( - hash, - path.to_path_buf().into_boxed_path(), - parent, - ))); - self.paths.insert(data.clone()); - data - } - - pub fn tsconfig Result<(), ResolveError>>( - &self, - root: bool, - path: &Path, - callback: F, // callback for modifying tsconfig with `extends` - ) -> Result, ResolveError> { - if let Some(tsconfig_ref) = self.tsconfigs.get(path) { - return Ok(Arc::clone(tsconfig_ref.value())); - } - let meta = self.fs.metadata(path).ok(); - let tsconfig_path = if meta.is_some_and(|m| m.is_file) { - Cow::Borrowed(path) - } else if meta.is_some_and(|m| m.is_dir) { - Cow::Owned(path.join("tsconfig.json")) - } else { - let mut os_string = path.to_path_buf().into_os_string(); - os_string.push(".json"); - Cow::Owned(PathBuf::from(os_string)) - }; - let mut tsconfig_string = self - .fs - .read_to_string(&tsconfig_path) - .map_err(|_| ResolveError::TsconfigNotFound(path.to_path_buf()))?; - let mut tsconfig = - TsConfig::parse(root, &tsconfig_path, &mut tsconfig_string).map_err(|error| { - ResolveError::from_serde_json_error(tsconfig_path.to_path_buf(), &error) - })?; - callback(&mut tsconfig)?; - let tsconfig = Arc::new(tsconfig.build()); - self.tsconfigs.insert(path.to_path_buf(), Arc::clone(&tsconfig)); - Ok(tsconfig) - } -} - -#[derive(Clone)] -pub struct CachedPath(Arc); - -impl Hash for CachedPath { - fn hash(&self, state: &mut H) { - self.0.hash.hash(state); - } -} - -impl PartialEq for CachedPath { - fn eq(&self, other: &Self) -> bool { - self.0.path == other.0.path - } -} -impl Eq for CachedPath {} - -impl Deref for CachedPath { - type Target = CachedPathImpl; - - fn deref(&self) -> &Self::Target { - self.0.as_ref() - } -} - -impl<'a> Borrow for CachedPath { - fn borrow(&self) -> &(dyn CacheKey + 'a) { - self - } -} - -impl AsRef for CachedPath { - fn as_ref(&self) -> &CachedPathImpl { - self.0.as_ref() - } -} - -impl CacheKey for CachedPath { - fn tuple(&self) -> (u64, &Path) { - (self.hash, &self.path) - } -} - -pub struct CachedPathImpl { - hash: u64, - path: Box, - parent: Option, - meta: OnceLock>, - symlink: OnceLock>, - canonicalized: OnceLock>, - node_modules: OnceLock>, - package_json: OnceLock>>, -} - -impl CachedPathImpl { - fn new(hash: u64, path: Box, parent: Option) -> Self { - Self { - hash, - path, - parent, - meta: OnceLock::new(), - symlink: OnceLock::new(), - canonicalized: OnceLock::new(), - node_modules: OnceLock::new(), - package_json: OnceLock::new(), - } - } - - pub fn path(&self) -> &Path { - &self.path - } - - pub fn to_path_buf(&self) -> PathBuf { - self.path.to_path_buf() - } - - pub fn parent(&self) -> Option<&CachedPath> { - self.parent.as_ref() - } - - fn meta(&self, fs: &Fs) -> Option { - *self.meta.get_or_init(|| fs.metadata(&self.path).ok()) - } - - pub fn is_file(&self, fs: &Fs, ctx: &mut Ctx) -> bool { - if let Some(meta) = self.meta(fs) { - ctx.add_file_dependency(self.path()); - meta.is_file - } else { - ctx.add_missing_dependency(self.path()); - false - } - } - - pub fn is_dir(&self, fs: &Fs, ctx: &mut Ctx) -> bool { - self.meta(fs).map_or_else( - || { - ctx.add_missing_dependency(self.path()); - false - }, - |meta| meta.is_dir, - ) - } - - fn symlink(&self, fs: &Fs) -> io::Result> { - self.symlink - .get_or_try_init(|| { - if let Ok(symlink_metadata) = fs.symlink_metadata(&self.path) { - if symlink_metadata.is_symlink { - return fs.canonicalize(self.path()).map(Some); - } - } - Ok(None) - }) - .cloned() - } - - pub fn realpath(&self, fs: &Fs) -> io::Result { - self.canonicalized - .get_or_try_init(|| { - if let Some(link) = self.symlink(fs)? { - return Ok(Some(link)); - } - if let Some(parent) = self.parent() { - let parent_path = parent.realpath(fs)?; - return Ok(Some( - parent_path.normalize_with(self.path.strip_prefix(&parent.path).unwrap()), - )); - }; - Ok(None) - }) - .cloned() - .map(|r| r.unwrap_or_else(|| self.path.clone().to_path_buf())) - } - - pub fn module_directory( - &self, - module_name: &str, - cache: &Cache, - ctx: &mut Ctx, - ) -> Option { - let cached_path = cache.value(&self.path.join(module_name)); - cached_path.is_dir(&cache.fs, ctx).then_some(cached_path) - } - - pub fn cached_node_modules( - &self, - cache: &Cache, - ctx: &mut Ctx, - ) -> Option { - self.node_modules.get_or_init(|| self.module_directory("node_modules", cache, ctx)).clone() - } - - /// Find package.json of a path by traversing parent directories. - /// - /// # Errors - /// - /// * [ResolveError::JSON] - pub fn find_package_json( - &self, - fs: &Fs, - options: &ResolveOptions, - ctx: &mut Ctx, - ) -> Result>, ResolveError> { - let mut cache_value = self; - // Go up directories when the querying path is not a directory - while !cache_value.is_dir(fs, ctx) { - if let Some(cv) = &cache_value.parent { - cache_value = cv.as_ref(); - } else { - break; - } - } - let mut cache_value = Some(cache_value); - while let Some(cv) = cache_value { - if let Some(package_json) = cv.package_json(fs, options, ctx)? { - return Ok(Some(Arc::clone(&package_json))); - } - cache_value = cv.parent.as_deref(); - } - Ok(None) - } - - /// Get package.json of the given path. - /// - /// # Errors - /// - /// * [ResolveError::JSON] - pub fn package_json( - &self, - fs: &Fs, - options: &ResolveOptions, - ctx: &mut Ctx, - ) -> Result>, ResolveError> { - // Change to `std::sync::OnceLock::get_or_try_init` when it is stable. - let result = self - .package_json - .get_or_try_init(|| { - let package_json_path = self.path.join("package.json"); - let Ok(package_json_string) = fs.read_to_string(&package_json_path) else { - return Ok(None); - }; - let real_path = if options.symlinks { - self.realpath(fs)?.join("package.json") - } else { - package_json_path.clone() - }; - PackageJson::parse(package_json_path.clone(), real_path, &package_json_string) - .map(Arc::new) - .map(Some) - .map_err(|error| ResolveError::from_serde_json_error(package_json_path, &error)) - }) - .cloned(); - // https://github.com/webpack/enhanced-resolve/blob/58464fc7cb56673c9aa849e68e6300239601e615/lib/DescriptionFileUtils.js#L68-L82 - match &result { - Ok(Some(package_json)) => { - ctx.add_file_dependency(&package_json.path); - } - Ok(None) => { - // Avoid an allocation by making this lazy - if let Some(deps) = &mut ctx.missing_dependencies { - deps.push(self.path.join("package.json")); - } - } - Err(_) => { - if let Some(deps) = &mut ctx.file_dependencies { - deps.push(self.path.join("package.json")); - } - } - } - result - } -} - -/// Memoized cache key, code adapted from . -trait CacheKey { - fn tuple(&self) -> (u64, &Path); -} - -impl Hash for dyn CacheKey + '_ { - fn hash(&self, state: &mut H) { - self.tuple().0.hash(state); - } -} - -impl PartialEq for dyn CacheKey + '_ { - fn eq(&self, other: &Self) -> bool { - self.tuple().1 == other.tuple().1 - } -} - -impl Eq for dyn CacheKey + '_ {} - -impl<'a> CacheKey for (u64, &'a Path) { - fn tuple(&self) -> (u64, &Path) { - (self.0, self.1) - } -} - -impl<'a> Borrow for (u64, &'a Path) { - fn borrow(&self) -> &(dyn CacheKey + 'a) { - self - } -} - -/// Since the cache key is memoized, use an identity hasher -/// to avoid double cache. -#[derive(Default)] -struct IdentityHasher(u64); - -impl Hasher for IdentityHasher { - fn write(&mut self, _: &[u8]) { - unreachable!("Invalid use of IdentityHasher") - } - fn write_u64(&mut self, n: u64) { - self.0 = n; - } - fn finish(&self) -> u64 { - self.0 - } -} diff --git a/src/context.rs b/src/context.rs deleted file mode 100644 index 9349de30..00000000 --- a/src/context.rs +++ /dev/null @@ -1,89 +0,0 @@ -use std::{ - ops::{Deref, DerefMut}, - path::{Path, PathBuf}, -}; - -use crate::error::ResolveError; - -#[derive(Debug, Default, Clone)] -pub struct ResolveContext(ResolveContextImpl); - -#[derive(Debug, Default, Clone)] -pub struct ResolveContextImpl { - pub fully_specified: bool, - - pub query: Option, - - pub fragment: Option, - - /// Files that was found on file system - pub file_dependencies: Option>, - - /// Files that was found on file system - pub missing_dependencies: Option>, - - /// The current resolving alias for bailing recursion alias. - pub resolving_alias: Option, - - /// For avoiding infinite recursion, which will cause stack overflow. - depth: u8, -} - -impl Deref for ResolveContext { - type Target = ResolveContextImpl; - - fn deref(&self) -> &Self::Target { - &self.0 - } -} - -impl DerefMut for ResolveContext { - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} - -impl ResolveContext { - pub fn with_fully_specified(&mut self, yes: bool) { - self.fully_specified = yes; - } - - pub fn with_query_fragment(&mut self, query: Option<&str>, fragment: Option<&str>) { - if let Some(query) = query { - self.query.replace(query.to_string()); - } - if let Some(fragment) = fragment { - self.fragment.replace(fragment.to_string()); - } - } - - pub fn init_file_dependencies(&mut self) { - self.file_dependencies.replace(vec![]); - self.missing_dependencies.replace(vec![]); - } - - pub fn add_file_dependency(&mut self, dep: &Path) { - if let Some(deps) = &mut self.file_dependencies { - deps.push(dep.to_path_buf()); - } - } - - pub fn add_missing_dependency(&mut self, dep: &Path) { - if let Some(deps) = &mut self.missing_dependencies { - deps.push(dep.to_path_buf()); - } - } - - pub fn with_resolving_alias(&mut self, alias: String) { - self.resolving_alias = Some(alias); - } - - pub fn test_for_infinite_recursion(&mut self) -> Result<(), ResolveError> { - self.depth += 1; - // 64 should be more than enough for detecting infinite recursion. - if self.depth > 64 { - return Err(ResolveError::Recursion); - } - Ok(()) - } -} diff --git a/src/error.rs b/src/error.rs deleted file mode 100644 index ff2aaa4f..00000000 --- a/src/error.rs +++ /dev/null @@ -1,160 +0,0 @@ -use std::{io, path::PathBuf, sync::Arc}; -use thiserror::Error; - -/// All resolution errors -/// -/// `thiserror` is used to display meaningful error messages. -#[derive(Debug, Clone, PartialEq, Error)] -pub enum ResolveError { - /// Ignored path - /// - /// Derived from ignored path (false value) from browser field in package.json - /// ```json - /// { - /// "browser": { - /// "./module": false - /// } - /// } - /// ``` - /// See - #[error("Path is ignored {0}")] - Ignored(PathBuf), - - /// Module not found - #[error("Cannot find module '{0}'")] - NotFound(/* specifier */ String), - - /// Tsconfig not found - #[error("Tsconfig not found {0}")] - TsconfigNotFound(PathBuf), - - #[error("{0}")] - IOError(IOError), - - /// Node.js builtin modules - /// - /// This is an error due to not being a Node.js runtime. - /// The `alias` option can be used to resolve a builtin module to a polyfill. - #[error("Builtin module {0}")] - Builtin(String), - - /// All of the aliased extension are not found - #[error("All of the aliased extension are not found")] - ExtensionAlias, - - /// The provided path specifier cannot be parsed - #[error("{0}")] - Specifier(SpecifierError), - - /// JSON parse error - #[error("{0:?}")] - JSON(JSONError), - - /// Restricted by `ResolveOptions::restrictions` - #[error(r#"Path "{0}" restricted by {0}"#)] - Restriction(PathBuf, PathBuf), - - #[error(r#"Invalid module "{0}" specifier is not a valid subpath for the "exports" resolution of {1}"#)] - InvalidModuleSpecifier(String, PathBuf), - - #[error(r#"Invalid "exports" target "{0}" defined for '{1}' in the package config {2}"#)] - InvalidPackageTarget(String, String, PathBuf), - - #[error(r#"Package subpath '{0}' is not defined by "exports" in {1}"#)] - PackagePathNotExported(String, PathBuf), - - #[error(r#"Invalid package config "{0}", "exports" cannot contain some keys starting with '.' and some not. The exports object must either be an object of package subpath keys or an object of main entry condition name keys only."#)] - InvalidPackageConfig(PathBuf), - - #[error(r#"Default condition should be last one in "{0}""#)] - InvalidPackageConfigDefault(PathBuf), - - #[error(r#"Expecting folder to folder mapping. "{0}" should end with "/"#)] - InvalidPackageConfigDirectory(PathBuf), - - #[error(r#"Package import specifier "{0}" is not defined in package {1}"#)] - PackageImportNotDefined(String, PathBuf), - - #[error("{0} is unimplemented")] - Unimplemented(&'static str), - - /// Occurs when alias paths reference each other. - #[error("Recursion in resolving")] - Recursion, -} - -impl ResolveError { - pub fn is_ignore(&self) -> bool { - matches!(self, Self::Ignored(_)) - } - - pub(crate) fn from_serde_json_error(path: PathBuf, error: &serde_json::Error) -> Self { - Self::JSON(JSONError { - path, - message: error.to_string(), - line: error.line(), - column: error.column(), - }) - } -} - -/// Error for [ResolveError::Specifier] -#[derive(Debug, Clone, Eq, PartialEq, Error)] -pub enum SpecifierError { - #[error("The specifiers must be a non-empty string. Received \"{0}\"")] - Empty(String), -} - -/// JSON error from [serde_json::Error] -#[derive(Debug, Clone, Eq, PartialEq)] -pub struct JSONError { - pub path: PathBuf, - pub message: String, - pub line: usize, - pub column: usize, -} - -#[derive(Debug, Clone, Error)] -#[error("{0}")] -pub struct IOError(Arc); - -impl PartialEq for IOError { - fn eq(&self, other: &Self) -> bool { - self.0.kind() == other.0.kind() - } -} - -impl From for io::Error { - fn from(error: IOError) -> Self { - let io_error = error.0.as_ref(); - Self::new(io_error.kind(), io_error.to_string()) - } -} - -impl From for ResolveError { - fn from(err: io::Error) -> Self { - Self::IOError(IOError(Arc::new(err))) - } -} - -#[test] -fn test_into_io_error() { - use std::io::{self, ErrorKind}; - let error_string = "IOError occurred"; - let string_error = io::Error::new(ErrorKind::Interrupted, error_string.to_string()); - let string_error2 = io::Error::new(ErrorKind::Interrupted, error_string.to_string()); - let resolve_io_error: ResolveError = ResolveError::from(string_error2); - - assert_eq!(resolve_io_error, ResolveError::from(string_error)); - assert_eq!(resolve_io_error.clone(), resolve_io_error); - if let ResolveError::IOError(io_error) = resolve_io_error { - // fix for https://github.com/web-infra-dev/rspack/issues/4564 - let std_io_error: io::Error = io_error.into(); - assert_eq!(std_io_error.kind(), ErrorKind::Interrupted); - assert_eq!(std_io_error.to_string(), error_string); - assert_eq!( - format!("{std_io_error:?}"), - r#"Custom { kind: Interrupted, error: "IOError occurred" }"# - ); - } -} diff --git a/src/file_system.rs b/src/file_system.rs deleted file mode 100644 index 04d177de..00000000 --- a/src/file_system.rs +++ /dev/null @@ -1,133 +0,0 @@ -use std::{ - fs, io, - path::{Path, PathBuf}, -}; - -/// File System abstraction used for `ResolverGeneric` -pub trait FileSystem: Send + Sync { - /// See [std::fs::read_to_string] - /// - /// # Errors - /// - /// * See [std::fs::read_to_string] - /// ## Warning - /// Use `&Path` instead of a generic `P: AsRef` here, - /// because object safety requirements, it is especially useful, when - /// you want to store multiple `dyn FileSystem` in a `Vec` or use a `ResolverGeneric` in - /// napi env. - fn read_to_string(&self, path: &Path) -> io::Result; - - /// See [std::fs::metadata] - /// - /// # Errors - /// See [std::fs::metadata] - /// ## Warning - /// Use `&Path` instead of a generic `P: AsRef` here, - /// because object safety requirements, it is especially useful, when - /// you want to store multiple `dyn FileSystem` in a `Vec` or use a `ResolverGeneric` in - /// napi env. - fn metadata(&self, path: &Path) -> io::Result; - - /// See [std::fs::symlink_metadata] - /// - /// # Errors - /// - /// See [std::fs::symlink_metadata] - /// ## Warning - /// Use `&Path` instead of a generic `P: AsRef` here, - /// because object safety requirements, it is especially useful, when - /// you want to store multiple `dyn FileSystem` in a `Vec` or use a `ResolverGeneric` in - /// napi env. - fn symlink_metadata(&self, path: &Path) -> io::Result; - - /// See [std::fs::canonicalize] - /// - /// # Errors - /// - /// See [std::fs::read_link] - /// ## Warning - /// Use `&Path` instead of a generic `P: AsRef` here, - /// because object safety requirements, it is especially useful, when - /// you want to store multiple `dyn FileSystem` in a `Vec` or use a `ResolverGeneric` in - /// napi env. - fn canonicalize(&self, path: &Path) -> io::Result; -} - -/// Metadata information about a file -#[derive(Debug, Clone, Copy)] -pub struct FileMetadata { - pub(crate) is_file: bool, - pub(crate) is_dir: bool, - pub(crate) is_symlink: bool, -} - -impl FileMetadata { - pub fn new(is_file: bool, is_dir: bool, is_symlink: bool) -> Self { - Self { is_file, is_dir, is_symlink } - } -} - -impl From for FileMetadata { - fn from(metadata: fs::Metadata) -> Self { - Self::new(metadata.is_file(), metadata.is_dir(), metadata.is_symlink()) - } -} - -/// Operating System -#[derive(Default)] -pub struct FileSystemOs; - -impl FileSystem for FileSystemOs { - fn read_to_string(&self, path: &Path) -> io::Result { - fs::read_to_string(path) - } - - fn metadata(&self, path: &Path) -> io::Result { - fs::metadata(path).map(FileMetadata::from) - } - - fn symlink_metadata(&self, path: &Path) -> io::Result { - fs::symlink_metadata(path).map(FileMetadata::from) - } - - fn canonicalize(&self, path: &Path) -> io::Result { - #[cfg(not(target_os = "wasi"))] - { - dunce::canonicalize(path) - } - #[cfg(target_os = "wasi")] - { - let meta = fs::symlink_metadata(path)?; - if meta.file_type().is_symlink() { - let link = fs::read_link(path)?; - let mut path_buf = path.to_path_buf(); - path_buf.pop(); - for segment in link.iter() { - match segment.to_str() { - Some("..") => { - path_buf.pop(); - } - Some(".") | None => {} - Some(seg) => { - // Need to trim the extra \0 introduces by rust std rust-lang/rust#123727 - path_buf.push(seg.trim_end_matches('\0')); - } - } - } - Ok(path_buf) - } else { - Ok(path.to_path_buf()) - } - } - } -} - -#[test] -fn metadata() { - let meta = FileMetadata { is_file: true, is_dir: true, is_symlink: true }; - assert_eq!( - format!("{meta:?}"), - "FileMetadata { is_file: true, is_dir: true, is_symlink: true }" - ); - let _ = meta; -} diff --git a/src/lib.rs b/src/lib.rs deleted file mode 100644 index fe116552..00000000 --- a/src/lib.rs +++ /dev/null @@ -1,1670 +0,0 @@ -//! # Oxc Resolver -//! -//! Node.js [CommonJS][cjs] and [ECMAScript][esm] Module Resolution. -//! -//! A module resolution is the process of finding the file referenced by a module specifier in -//! `import "specifier"` or `require("specifier")`. -//! -//! All [configuration options](ResolveOptions) are aligned with webpack's [enhanced-resolve]. -//! -//! ## Terminology -//! -//! ### Specifier -//! -//! For [CommonJS modules][cjs], -//! the specifier is the string passed to the `require` function. e.g. `"id"` in `require("id")`. -//! -//! For [ECMAScript modules][esm], -//! the specifier of an `import` statement is the string after the `from` keyword, -//! e.g. `'specifier'` in `import 'specifier'` or `import { sep } from 'specifier'`. -//! Specifiers are also used in export from statements, and as the argument to an `import()` expression. -//! -//! This is also named "request" in some places. -//! -//! ## References: -//! -//! * Algorithm adapted from Node.js [CommonJS Module Resolution Algorithm] and [ECMAScript Module Resolution Algorithm]. -//! * Tests are ported from [enhanced-resolve]. -//! * Some code is adapted from [parcel-resolver]. -//! * The documentation is copied from [webpack's resolve configuration](https://webpack.js.org/configuration/resolve). -//! -//! [enhanced-resolve]: https://github.com/webpack/enhanced-resolve -//! [CommonJS Module Resolution Algorithm]: https://nodejs.org/api/modules.html#all-together -//! [ECMAScript Module Resolution Algorithm]: https://nodejs.org/api/esm.html#resolution-algorithm-specification -//! [parcel-resolver]: https://github.com/parcel-bundler/parcel/blob/v2/packages/utils/node-resolver-rs -//! [cjs]: https://nodejs.org/api/modules.html -//! [esm]: https://nodejs.org/api/esm.html -//! -//! ## Feature flags -#![cfg_attr(feature = "document-features", doc = document_features::document_features!())] -#![cfg_attr(docsrs, feature(doc_auto_cfg))] -//! -//! ## Example -//! -//! ```rust,ignore -#![doc = include_str!("../examples/resolver.rs")] -//! ``` - -mod builtins; -mod cache; -mod context; -mod error; -mod file_system; -mod options; -mod package_json; -mod path; -mod resolution; -mod specifier; -mod tsconfig; - -#[cfg(test)] -mod tests; - -use std::{ - borrow::Cow, - cmp::Ordering, - ffi::OsStr, - fmt, - path::{Component, Path, PathBuf}, - sync::Arc, -}; - -use rustc_hash::FxHashSet; -use serde_json::Value as JSONValue; -use typescript_tsconfig_json::ExtendsField; - -pub use crate::{ - builtins::NODEJS_BUILTINS, - error::{JSONError, ResolveError, SpecifierError}, - file_system::{FileMetadata, FileSystem}, - options::{ - Alias, AliasValue, EnforceExtension, ResolveOptions, Restriction, TsconfigOptions, - TsconfigReferences, - }, - package_json::PackageJson, - resolution::Resolution, -}; -use crate::{ - cache::{Cache, CachedPath}, - context::ResolveContext as Ctx, - file_system::FileSystemOs, - package_json::JSONMap, - path::{PathUtil, SLASH_START}, - specifier::Specifier, - tsconfig::{ProjectReference, TsConfig}, -}; - -type ResolveResult = Result, ResolveError>; - -/// Context returned from the [Resolver::resolve_with_context] API -#[derive(Debug, Default, Clone)] -pub struct ResolveContext { - /// Files that was found on file system - pub file_dependencies: FxHashSet, - - /// Dependencies that was not found on file system - pub missing_dependencies: FxHashSet, -} - -/// Resolver with the current operating system as the file system -pub type Resolver = ResolverGeneric; - -/// Generic implementation of the resolver, can be configured by the [FileSystem] trait -pub struct ResolverGeneric { - options: ResolveOptions, - cache: Arc>, -} - -impl fmt::Debug for ResolverGeneric { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - self.options.fmt(f) - } -} - -impl Default for ResolverGeneric { - fn default() -> Self { - Self::new(ResolveOptions::default()) - } -} - -impl ResolverGeneric { - pub fn new(options: ResolveOptions) -> Self { - Self { options: options.sanitize(), cache: Arc::new(Cache::new(Fs::default())) } - } -} - -impl ResolverGeneric { - pub fn new_with_file_system(file_system: Fs, options: ResolveOptions) -> Self { - Self { cache: Arc::new(Cache::new(file_system)), options: options.sanitize() } - } - - /// Clone the resolver using the same underlying cache. - #[must_use] - pub fn clone_with_options(&self, options: ResolveOptions) -> Self { - Self { options: options.sanitize(), cache: Arc::clone(&self.cache) } - } - - /// Returns the options. - pub fn options(&self) -> &ResolveOptions { - &self.options - } - - /// Clear the underlying cache. - pub fn clear_cache(&self) { - self.cache.clear(); - } - - /// Resolve `specifier` at an absolute `path`. - /// - /// A specifier is the string passed to require or import, i.e. `require("specifier")` or `import "specifier"`. - /// - /// `path` must be an **absolute** path to a directory where the specifier is resolved against. - /// For CommonJS modules, it is the `__dirname` variable that contains the absolute path to the folder containing current module. - /// For ECMAScript modules, it is the value of `import.meta.url`. - /// - /// # Errors - /// - /// * See [ResolveError] - pub fn resolve>( - &self, - path: P, - specifier: &str, - ) -> Result { - let mut ctx = Ctx::default(); - self.resolve_tracing(path.as_ref(), specifier, &mut ctx) - } - - /// Resolve `specifier` at absolute `path` with [ResolveContext] - /// - /// # Errors - /// - /// * See [ResolveError] - pub fn resolve_with_context>( - &self, - path: P, - specifier: &str, - resolve_context: &mut ResolveContext, - ) -> Result { - let mut ctx = Ctx::default(); - ctx.init_file_dependencies(); - let result = self.resolve_tracing(path.as_ref(), specifier, &mut ctx); - if let Some(deps) = &mut ctx.file_dependencies { - resolve_context.file_dependencies.extend(deps.drain(..)); - } - if let Some(deps) = &mut ctx.missing_dependencies { - resolve_context.missing_dependencies.extend(deps.drain(..)); - } - result - } - - /// Wrap `resolve_impl` with `tracing` information - fn resolve_tracing( - &self, - path: &Path, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - let span = tracing::debug_span!("resolve", path = ?path, specifier = specifier); - let _enter = span.enter(); - let r = self.resolve_impl(path, specifier, ctx); - match &r { - Ok(r) => { - tracing::debug!(options = ?self.options, path = ?path, specifier = specifier, ret = ?r.path); - } - Err(err) => { - tracing::debug!(options = ?self.options, path = ?path, specifier = specifier, err = ?err); - } - }; - r - } - - fn resolve_impl( - &self, - path: &Path, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - ctx.with_fully_specified(self.options.fully_specified); - let cached_path = self.cache.value(path); - let cached_path = self.require(&cached_path, specifier, ctx)?; - let path = self.load_realpath(&cached_path)?; - // enhanced-resolve: restrictions - self.check_restrictions(&path)?; - let package_json = cached_path.find_package_json(&self.cache.fs, &self.options, ctx)?; - if let Some(package_json) = &package_json { - // path must be inside the package. - debug_assert!(path.starts_with(package_json.directory())); - } - Ok(Resolution { - path, - query: ctx.query.take(), - fragment: ctx.fragment.take(), - package_json, - }) - } - - /// require(X) from module at path Y - /// - /// X: specifier - /// Y: path - /// - /// - fn require( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - ctx.test_for_infinite_recursion()?; - - // enhanced-resolve: parse - let (parsed, try_fragment_as_path) = self.load_parse(cached_path, specifier, ctx)?; - if let Some(path) = try_fragment_as_path { - return Ok(path); - } - - self.require_without_parse(cached_path, parsed.path(), ctx) - } - - fn require_without_parse( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - // tsconfig-paths - if let Some(path) = self.load_tsconfig_paths(cached_path, specifier, &mut Ctx::default())? { - return Ok(path); - } - - // enhanced-resolve: try alias - if let Some(path) = self.load_alias(cached_path, specifier, &self.options.alias, ctx)? { - return Ok(path); - } - - let result = match Path::new(specifier).components().next() { - // 3. If X begins with './' or '/' or '../' - Some(Component::RootDir | Component::Prefix(_)) => { - self.require_absolute(cached_path, specifier, ctx) - } - // 3. If X begins with './' or '/' or '../' - Some(Component::CurDir | Component::ParentDir) => { - self.require_relative(cached_path, specifier, ctx) - } - // 4. If X begins with '#' - Some(Component::Normal(_)) if specifier.as_bytes()[0] == b'#' => { - self.require_hash(cached_path, specifier, ctx) - } - _ => { - // 1. If X is a core module, - // a. return the core module - // b. STOP - self.require_core(specifier)?; - - // (ESM) 5. Otherwise, - // Note: specifier is now a bare specifier. - // Set resolved the result of PACKAGE_RESOLVE(specifier, parentURL). - self.require_bare(cached_path, specifier, ctx) - } - }; - - result.or_else(|err| { - if err.is_ignore() { - return Err(err); - } - // enhanced-resolve: try fallback - self.load_alias(cached_path, specifier, &self.options.fallback, ctx) - .and_then(|value| value.ok_or(err)) - }) - } - - // PACKAGE_RESOLVE(packageSpecifier, parentURL) - // 3. If packageSpecifier is a Node.js builtin module name, then - // 1. Return the string "node:" concatenated with packageSpecifier. - fn require_core(&self, specifier: &str) -> Result<(), ResolveError> { - if self.options.builtin_modules { - let starts_with_node = specifier.starts_with("node:"); - if starts_with_node || NODEJS_BUILTINS.binary_search(&specifier).is_ok() { - let mut specifier = specifier.to_string(); - if !starts_with_node { - specifier = format!("node:{specifier}"); - } - return Err(ResolveError::Builtin(specifier)); - } - } - Ok(()) - } - - fn require_absolute( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - // Make sure only path prefixes gets called - debug_assert!(Path::new(specifier) - .components() - .next() - .is_some_and(|c| matches!(c, Component::RootDir | Component::Prefix(_)))); - if !self.options.prefer_relative && self.options.prefer_absolute { - if let Ok(path) = self.load_package_self_or_node_modules(cached_path, specifier, ctx) { - return Ok(path); - } - } - if let Some(path) = self.load_roots(specifier, ctx) { - return Ok(path); - } - // 2. If X begins with '/' - // a. set Y to be the file system root - let path = self.cache.value(Path::new(specifier)); - if let Some(path) = self.load_as_file_or_directory(&path, specifier, ctx)? { - return Ok(path); - } - Err(ResolveError::NotFound(specifier.to_string())) - } - - // 3. If X begins with './' or '/' or '../' - fn require_relative( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - // Make sure only relative or normal paths gets called - debug_assert!(Path::new(specifier).components().next().is_some_and(|c| matches!( - c, - Component::CurDir | Component::ParentDir | Component::Normal(_) - ))); - let path = cached_path.path().normalize_with(specifier); - let cached_path = self.cache.value(&path); - // a. LOAD_AS_FILE(Y + X) - // b. LOAD_AS_DIRECTORY(Y + X) - if let Some(path) = self.load_as_file_or_directory(&cached_path, specifier, ctx)? { - return Ok(path); - } - // c. THROW "not found" - Err(ResolveError::NotFound(specifier.to_string())) - } - - fn require_hash( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - debug_assert_eq!(specifier.chars().next(), Some('#')); - // a. LOAD_PACKAGE_IMPORTS(X, dirname(Y)) - if let Some(path) = self.load_package_imports(cached_path, specifier, ctx)? { - return Ok(path); - } - self.load_package_self_or_node_modules(cached_path, specifier, ctx) - } - - fn require_bare( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - // Make sure no other path prefixes gets called - debug_assert!(Path::new(specifier) - .components() - .next() - .is_some_and(|c| matches!(c, Component::Normal(_)))); - if self.options.prefer_relative { - if let Ok(path) = self.require_relative(cached_path, specifier, ctx) { - return Ok(path); - } - } - self.load_package_self_or_node_modules(cached_path, specifier, ctx) - } - - /// enhanced-resolve: ParsePlugin. - /// - /// 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`. - /// - /// - fn load_parse<'s>( - &self, - cached_path: &CachedPath, - specifier: &'s str, - ctx: &mut Ctx, - ) -> Result<(Specifier<'s>, Option), ResolveError> { - let parsed = Specifier::parse(specifier).map_err(ResolveError::Specifier)?; - ctx.with_query_fragment(parsed.query, parsed.fragment); - - // There is an edge-case where a request with # can be a path or a fragment -> try both - if ctx.fragment.is_some() && ctx.query.is_none() { - let specifier = parsed.path(); - let fragment = ctx.fragment.take().unwrap(); - let path = format!("{specifier}{fragment}"); - if let Ok(path) = self.require_without_parse(cached_path, &path, ctx) { - return Ok((parsed, Some(path))); - } - ctx.fragment.replace(fragment); - } - Ok((parsed, None)) - } - - fn load_package_self_or_node_modules( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - let (_, subpath) = Self::parse_package_specifier(specifier); - if subpath.is_empty() { - ctx.with_fully_specified(false); - } - // 5. LOAD_PACKAGE_SELF(X, dirname(Y)) - if let Some(path) = self.load_package_self(cached_path, specifier, ctx)? { - return Ok(path); - } - // 6. LOAD_NODE_MODULES(X, dirname(Y)) - if let Some(path) = self.load_node_modules(cached_path, specifier, ctx)? { - return Ok(path); - } - // 7. THROW "not found" - Err(ResolveError::NotFound(specifier.to_string())) - } - - /// LOAD_PACKAGE_IMPORTS(X, DIR) - fn load_package_imports( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - // 1. Find the closest package scope SCOPE to DIR. - // 2. If no scope was found, return. - let Some(package_json) = - cached_path.find_package_json(&self.cache.fs, &self.options, ctx)? - else { - return Ok(None); - }; - // 3. If the SCOPE/package.json "imports" is null or undefined, return. - // 4. let MATCH = PACKAGE_IMPORTS_RESOLVE(X, pathToFileURL(SCOPE), ["node", "require"]) defined in the ESM resolver. - if let Some(path) = self.package_imports_resolve(specifier, &package_json, ctx)? { - // 5. RESOLVE_ESM_MATCH(MATCH). - return self.resolve_esm_match(specifier, &path, ctx); - } - Ok(None) - } - - fn load_as_file(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - // enhanced-resolve feature: extension_alias - if let Some(path) = self.load_extension_alias(cached_path, ctx)? { - return Ok(Some(path)); - } - if self.options.enforce_extension.is_disabled() { - // 1. If X is a file, load X as its file extension format. STOP - if let Some(path) = self.load_alias_or_file(cached_path, ctx)? { - return Ok(Some(path)); - } - } - // 2. If X.js is a file, load X.js as JavaScript text. STOP - // 3. If X.json is a file, parse X.json to a JavaScript Object. STOP - // 4. If X.node is a file, load X.node as binary addon. STOP - if let Some(path) = - self.load_extensions(cached_path.path(), &self.options.extensions, ctx)? - { - return Ok(Some(path)); - } - Ok(None) - } - - fn load_as_directory(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - // TODO: Only package.json is supported, so warn about having other values - // Checking for empty files is needed for omitting checks on package.json - // 1. If X/package.json is a file, - if !self.options.description_files.is_empty() { - // a. Parse X/package.json, and look for "main" field. - if let Some(package_json) = - cached_path.package_json(&self.cache.fs, &self.options, ctx)? - { - // b. If "main" is a falsy value, GOTO 2. - for main_field in package_json.main_fields(&self.options.main_fields) { - // c. let M = X + (json main field) - let main_field_path = cached_path.path().normalize_with(main_field); - // d. LOAD_AS_FILE(M) - let cached_path = self.cache.value(&main_field_path); - if let Some(path) = self.load_as_file(&cached_path, ctx)? { - return Ok(Some(path)); - } - // e. LOAD_INDEX(M) - if let Some(path) = self.load_index(&cached_path, ctx)? { - return Ok(Some(path)); - } - } - // f. LOAD_INDEX(X) DEPRECATED - // g. THROW "not found" - } - } - // 2. LOAD_INDEX(X) - self.load_index(cached_path, ctx) - } - - fn load_as_file_or_directory( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - if self.options.resolve_to_context { - return Ok(cached_path.is_dir(&self.cache.fs, ctx).then(|| cached_path.clone())); - } - if !specifier.ends_with('/') { - if let Some(path) = self.load_as_file(cached_path, ctx)? { - return Ok(Some(path)); - } - } - if cached_path.is_dir(&self.cache.fs, ctx) { - if let Some(path) = self.load_as_directory(cached_path, ctx)? { - return Ok(Some(path)); - } - } - Ok(None) - } - - fn load_extensions(&self, path: &Path, extensions: &[String], ctx: &mut Ctx) -> ResolveResult { - if ctx.fully_specified { - return Ok(None); - } - let path = path.as_os_str(); - for extension in extensions { - let mut path_with_extension = path.to_os_string(); - path_with_extension.reserve_exact(extension.len()); - path_with_extension.push(extension); - let cached_path = self.cache.value(Path::new(&path_with_extension)); - if let Some(path) = self.load_alias_or_file(&cached_path, ctx)? { - return Ok(Some(path)); - } - } - Ok(None) - } - - fn load_realpath(&self, cached_path: &CachedPath) -> Result { - if self.options.symlinks { - cached_path.realpath(&self.cache.fs).map_err(ResolveError::from) - } else { - Ok(cached_path.to_path_buf()) - } - } - - fn check_restrictions(&self, path: &Path) -> Result<(), ResolveError> { - // https://github.com/webpack/enhanced-resolve/blob/a998c7d218b7a9ec2461fc4fddd1ad5dd7687485/lib/RestrictionsPlugin.js#L19-L24 - fn is_inside(path: &Path, parent: &Path) -> bool { - if !path.starts_with(parent) { - return false; - } - if path.as_os_str().len() == parent.as_os_str().len() { - return true; - } - path.strip_prefix(parent).is_ok_and(|p| p == Path::new("./")) - } - for restriction in &self.options.restrictions { - match restriction { - Restriction::Path(restricted_path) => { - if !is_inside(path, restricted_path) { - return Err(ResolveError::Restriction( - path.to_path_buf(), - restricted_path.clone(), - )); - } - } - Restriction::RegExp(_) => { - return Err(ResolveError::Unimplemented("Restriction with regex")) - } - } - } - Ok(()) - } - - fn load_index(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - for main_file in &self.options.main_files { - let main_path = cached_path.path().normalize_with(main_file); - let cached_path = self.cache.value(&main_path); - if self.options.enforce_extension.is_disabled() { - if let Some(path) = self.load_alias_or_file(&cached_path, ctx)? { - return Ok(Some(path)); - } - } - // 1. If X/index.js is a file, load X/index.js as JavaScript text. STOP - // 2. If X/index.json is a file, parse X/index.json to a JavaScript object. STOP - // 3. If X/index.node is a file, load X/index.node as binary addon. STOP - if let Some(path) = - self.load_extensions(cached_path.path(), &self.options.extensions, ctx)? - { - return Ok(Some(path)); - } - } - Ok(None) - } - - fn load_alias_or_file(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - if let Some(package_json) = - cached_path.find_package_json(&self.cache.fs, &self.options, ctx)? - { - if let Some(path) = self.load_browser_field(cached_path, None, &package_json, ctx)? { - return Ok(Some(path)); - } - } - // enhanced-resolve: try file as alias - let alias_specifier = cached_path.path().to_string_lossy(); - if let Some(path) = - self.load_alias(cached_path, &alias_specifier, &self.options.alias, ctx)? - { - return Ok(Some(path)); - } - if cached_path.is_file(&self.cache.fs, ctx) { - return Ok(Some(cached_path.clone())); - } - Ok(None) - } - - fn load_node_modules( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - let (package_name, subpath) = Self::parse_package_specifier(specifier); - // 1. let DIRS = NODE_MODULES_PATHS(START) - // 2. for each DIR in DIRS: - for module_name in &self.options.modules { - for cached_path in std::iter::successors(Some(cached_path), |p| p.parent()) { - // Skip if /path/to/node_modules does not exist - if !cached_path.is_dir(&self.cache.fs, ctx) { - continue; - } - - let Some(cached_path) = self.get_module_directory(cached_path, module_name, ctx) - else { - continue; - }; - // Optimize node_modules lookup by inspecting whether the package exists - // From LOAD_PACKAGE_EXPORTS(X, DIR) - // 1. Try to interpret X as a combination of NAME and SUBPATH where the name - // may have a @scope/ prefix and the subpath begins with a slash (`/`). - if !package_name.is_empty() { - let package_path = cached_path.path().normalize_with(package_name); - let cached_path = self.cache.value(&package_path); - // Try foo/node_modules/package_name - if cached_path.is_dir(&self.cache.fs, ctx) { - // a. LOAD_PACKAGE_EXPORTS(X, DIR) - if let Some(path) = - self.load_package_exports(specifier, subpath, &cached_path, ctx)? - { - return Ok(Some(path)); - } - } else { - // foo/node_modules/package_name is not a directory, so useless to check inside it - if !subpath.is_empty() { - continue; - } - // Skip if the directory lead to the scope package does not exist - // i.e. `foo/node_modules/@scope` is not a directory for `foo/node_modules/@scope/package` - if package_name.starts_with('@') { - if let Some(path) = cached_path.parent() { - if !path.is_dir(&self.cache.fs, ctx) { - continue; - } - } - } - } - } - - // Try as file or directory for all other cases - // b. LOAD_AS_FILE(DIR/X) - // c. LOAD_AS_DIRECTORY(DIR/X) - let node_module_file = cached_path.path().normalize_with(specifier); - let cached_path = self.cache.value(&node_module_file); - if let Some(path) = self.load_as_file_or_directory(&cached_path, specifier, ctx)? { - return Ok(Some(path)); - } - } - } - Ok(None) - } - - fn get_module_directory( - &self, - cached_path: &CachedPath, - module_name: &str, - ctx: &mut Ctx, - ) -> Option { - if cached_path.path().ends_with(module_name) { - Some(cached_path.clone()) - } else if module_name == "node_modules" { - cached_path.cached_node_modules(&self.cache, ctx) - } else { - cached_path.module_directory(module_name, &self.cache, ctx) - } - } - - fn load_package_exports( - &self, - specifier: &str, - subpath: &str, - cached_path: &CachedPath, - ctx: &mut Ctx, - ) -> ResolveResult { - // 2. If X does not match this pattern or DIR/NAME/package.json is not a file, - // return. - let Some(package_json) = cached_path.package_json(&self.cache.fs, &self.options, ctx)? - else { - return Ok(None); - }; - // 3. Parse DIR/NAME/package.json, and look for "exports" field. - // 4. If "exports" is null or undefined, return. - // 5. let MATCH = PACKAGE_EXPORTS_RESOLVE(pathToFileURL(DIR/NAME), "." + SUBPATH, - // `package.json` "exports", ["node", "require"]) defined in the ESM resolver. - // Note: The subpath is not prepended with a dot on purpose - for exports in package_json.exports_fields(&self.options.exports_fields) { - if let Some(path) = self.package_exports_resolve( - cached_path.path(), - &format!(".{subpath}"), - exports, - ctx, - )? { - // 6. RESOLVE_ESM_MATCH(MATCH) - return self.resolve_esm_match(specifier, &path, ctx); - }; - } - Ok(None) - } - - fn load_package_self( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - // 1. Find the closest package scope SCOPE to DIR. - // 2. If no scope was found, return. - let Some(package_json) = - cached_path.find_package_json(&self.cache.fs, &self.options, ctx)? - else { - return Ok(None); - }; - // 3. If the SCOPE/package.json "exports" is null or undefined, return. - // 4. If the SCOPE/package.json "name" is not the first segment of X, return. - if let Some(subpath) = package_json - .name - .as_ref() - .and_then(|package_name| Self::strip_package_name(specifier, package_name)) - { - // 5. let MATCH = PACKAGE_EXPORTS_RESOLVE(pathToFileURL(SCOPE), - // "." + X.slice("name".length), `package.json` "exports", ["node", "require"]) - // defined in the ESM resolver. - let package_url = package_json.directory(); - // Note: The subpath is not prepended with a dot on purpose - // because `package_exports_resolve` matches subpath without the leading dot. - for exports in package_json.exports_fields(&self.options.exports_fields) { - if let Some(cached_path) = - self.package_exports_resolve(package_url, &format!(".{subpath}"), exports, ctx)? - { - // 6. RESOLVE_ESM_MATCH(MATCH) - return self.resolve_esm_match(specifier, &cached_path, ctx); - } - } - } - self.load_browser_field(cached_path, Some(specifier), &package_json, ctx) - } - - /// RESOLVE_ESM_MATCH(MATCH) - fn resolve_esm_match( - &self, - specifier: &str, - cached_path: &CachedPath, - ctx: &mut Ctx, - ) -> ResolveResult { - // 1. let RESOLVED_PATH = fileURLToPath(MATCH) - // 2. If the file at RESOLVED_PATH exists, load RESOLVED_PATH as its extension format. STOP - // - // Non-compliant ESM can result in a directory, so directory is tried as well. - if let Some(path) = self.load_as_file_or_directory(cached_path, "", ctx)? { - return Ok(Some(path)); - } - // 3. THROW "not found" - Err(ResolveError::NotFound(specifier.to_string())) - } - - /// enhanced-resolve: AliasFieldPlugin for [ResolveOptions::alias_fields] - fn load_browser_field( - &self, - cached_path: &CachedPath, - module_specifier: Option<&str>, - package_json: &PackageJson, - ctx: &mut Ctx, - ) -> ResolveResult { - let path = cached_path.path(); - let Some(new_specifier) = package_json.resolve_browser_field( - path, - module_specifier, - &self.options.alias_fields, - )? - else { - return Ok(None); - }; - // Abort when resolving recursive module - if module_specifier.is_some_and(|s| s == new_specifier) { - return Ok(None); - } - if ctx.resolving_alias.as_ref().is_some_and(|s| s == new_specifier) { - // Complete when resolving to self `{"./a.js": "./a.js"}` - if new_specifier.strip_prefix("./").filter(|s| path.ends_with(Path::new(s))).is_some() { - return if cached_path.is_file(&self.cache.fs, ctx) { - Ok(Some(cached_path.clone())) - } else { - Err(ResolveError::NotFound(new_specifier.to_string())) - }; - } - return Err(ResolveError::Recursion); - } - ctx.with_resolving_alias(new_specifier.to_string()); - ctx.with_fully_specified(false); - let cached_path = self.cache.value(package_json.directory()); - self.require(&cached_path, new_specifier, ctx).map(Some) - } - - /// enhanced-resolve: AliasPlugin for [ResolveOptions::alias] and [ResolveOptions::fallback]. - fn load_alias( - &self, - cached_path: &CachedPath, - specifier: &str, - aliases: &Alias, - ctx: &mut Ctx, - ) -> ResolveResult { - for (alias_key_raw, specifiers) in aliases { - let alias_key = if let Some(alias_key) = alias_key_raw.strip_suffix('$') { - if alias_key != specifier { - continue; - } - alias_key - } else { - let strip_package_name = Self::strip_package_name(specifier, alias_key_raw); - if strip_package_name.is_none() { - continue; - } - alias_key_raw - }; - // It should stop resolving when all of the tried alias values - // failed to resolve. - // - let mut should_stop = false; - for r in specifiers { - match r { - AliasValue::Path(alias_value) => { - if let Some(path) = self.load_alias_value( - cached_path, - alias_key, - alias_value, - specifier, - ctx, - &mut should_stop, - )? { - return Ok(Some(path)); - } - } - AliasValue::Ignore => { - let path = cached_path.path().normalize_with(alias_key); - return Err(ResolveError::Ignored(path)); - } - } - } - if should_stop { - return Err(ResolveError::NotFound(specifier.to_string())); - } - } - Ok(None) - } - - fn load_alias_value( - &self, - cached_path: &CachedPath, - alias_key: &str, - alias_value: &str, - request: &str, - ctx: &mut Ctx, - should_stop: &mut bool, - ) -> ResolveResult { - if request != alias_value - && !request.strip_prefix(alias_value).is_some_and(|prefix| prefix.starts_with('/')) - { - let tail = &request[alias_key.len()..]; - - let new_specifier = if tail.is_empty() { - Cow::Borrowed(alias_value) - } else { - let alias_value = Path::new(alias_value).normalize(); - // Must not append anything to alias_value if it is a file. - let alias_value_cached_path = self.cache.value(&alias_value); - if alias_value_cached_path.is_file(&self.cache.fs, ctx) { - return Ok(None); - } - - // Remove the leading slash so the final path is concatenated. - let tail = tail.trim_start_matches(SLASH_START); - let normalized = alias_value.normalize_with(tail); - Cow::Owned(normalized.to_string_lossy().to_string()) - }; - - *should_stop = true; - ctx.with_fully_specified(false); - return match self.require(cached_path, new_specifier.as_ref(), ctx) { - Err(ResolveError::NotFound(_)) => Ok(None), - Ok(path) => return Ok(Some(path)), - Err(err) => return Err(err), - }; - } - Ok(None) - } - - /// Given an extension alias map `{".js": [".ts", "js"]}`, - /// load the mapping instead of the provided extension - /// - /// This is an enhanced-resolve feature - /// - /// # Errors - /// - /// * [ResolveError::ExtensionAlias]: When all of the aliased extensions are not found - fn load_extension_alias(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - let Some(path_extension) = cached_path.path().extension() else { - return Ok(None); - }; - let Some((_, extensions)) = self - .options - .extension_alias - .iter() - .find(|(ext, _)| OsStr::new(ext.trim_start_matches('.')) == path_extension) - else { - return Ok(None); - }; - let path = cached_path.path().with_extension(""); - ctx.with_fully_specified(false); - if let Some(path) = self.load_extensions(&path, extensions, ctx)? { - return Ok(Some(path)); - } - Err(ResolveError::ExtensionAlias) - } - - /// enhanced-resolve: RootsPlugin - /// - /// A list of directories where requests of server-relative URLs (starting with '/') are resolved, - /// defaults to context configuration option. - /// - /// On non-Windows systems these requests are resolved as an absolute path first. - fn load_roots(&self, specifier: &str, ctx: &mut Ctx) -> Option { - if !self.options.roots.is_empty() { - if let Some(specifier) = specifier.strip_prefix(SLASH_START) { - for root in &self.options.roots { - let cached_path = self.cache.value(root); - if let Ok(path) = self.require_relative(&cached_path, specifier, ctx) { - return Some(path); - } - } - } - } - None - } - - fn load_tsconfig_paths( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - let Some(tsconfig_options) = &self.options.tsconfig else { - return Ok(None); - }; - let tsconfig = self.load_tsconfig( - /* root */ true, - &tsconfig_options.config_file, - &tsconfig_options.references, - )?; - let paths = tsconfig.resolve(cached_path.path(), specifier); - for path in paths { - let cached_path = self.cache.value(&path); - if let Ok(path) = self.require_relative(&cached_path, ".", ctx) { - return Ok(Some(path)); - } - } - Ok(None) - } - - fn load_tsconfig( - &self, - root: bool, - path: &Path, - references: &TsconfigReferences, - ) -> Result, ResolveError> { - self.cache.tsconfig(root, path, |tsconfig| { - let directory = self.cache.value(tsconfig.directory()); - tracing::trace!(tsconfig = ?tsconfig, "load_tsconfig"); - - // Extend tsconfig - if let Some(extends) = &tsconfig.extends { - let extended_tsconfig_paths = match extends { - ExtendsField::Single(s) => { - vec![self.get_extended_tsconfig_path(&directory, tsconfig, s)?] - } - ExtendsField::Multiple(specifiers) => specifiers - .iter() - .map(|s| self.get_extended_tsconfig_path(&directory, tsconfig, s)) - .collect::, ResolveError>>()?, - }; - for extended_tsconfig_path in extended_tsconfig_paths { - let extended_tsconfig = self.load_tsconfig( - /* root */ false, - &extended_tsconfig_path, - &TsconfigReferences::Disabled, - )?; - tsconfig.extend_tsconfig(&extended_tsconfig); - } - } - - // Load project references - match references { - TsconfigReferences::Disabled => { - tsconfig.references.drain(..); - } - TsconfigReferences::Auto => {} - TsconfigReferences::Paths(paths) => { - tsconfig.references = paths - .iter() - .map(|path| ProjectReference { path: path.clone(), tsconfig: None }) - .collect(); - } - } - if !tsconfig.references.is_empty() { - let directory = tsconfig.directory().to_path_buf(); - for reference in &mut tsconfig.references { - let reference_tsconfig_path = directory.normalize_with(&reference.path); - let tsconfig = self.cache.tsconfig( - /* root */ true, - &reference_tsconfig_path, - |_| Ok(()), - )?; - reference.tsconfig.replace(tsconfig); - } - } - Ok(()) - }) - } - - fn get_extended_tsconfig_path( - &self, - directory: &CachedPath, - tsconfig: &TsConfig, - specifier: &str, - ) -> Result { - match specifier.as_bytes().first() { - None => Err(ResolveError::Specifier(SpecifierError::Empty(specifier.to_string()))), - Some(b'/') => Ok(PathBuf::from(specifier)), - Some(b'.') => Ok(tsconfig.directory().normalize_with(specifier)), - _ => self - .clone_with_options(ResolveOptions { - description_files: vec![], - extensions: vec![".json".into()], - main_files: vec!["tsconfig.json".into()], - ..ResolveOptions::default() - }) - .load_package_self_or_node_modules(directory, specifier, &mut Ctx::default()) - .map(|p| p.to_path_buf()) - .map_err(|err| match err { - ResolveError::NotFound(_) => { - ResolveError::TsconfigNotFound(PathBuf::from(specifier)) - } - _ => err, - }), - } - } - - /// PACKAGE_RESOLVE(packageSpecifier, parentURL) - fn package_resolve( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - let (package_name, subpath) = Self::parse_package_specifier(specifier); - - // 3. If packageSpecifier is a Node.js builtin module name, then - // 1. Return the string "node:" concatenated with packageSpecifier. - self.require_core(package_name)?; - - // 11. While parentURL is not the file system root, - for module_name in &self.options.modules { - for cached_path in std::iter::successors(Some(cached_path), |p| p.parent()) { - // 1. Let packageURL be the URL resolution of "node_modules/" concatenated with packageSpecifier, relative to parentURL. - let Some(cached_path) = self.get_module_directory(cached_path, module_name, ctx) - else { - continue; - }; - // 2. Set parentURL to the parent folder URL of parentURL. - let package_path = cached_path.path().normalize_with(package_name); - let cached_path = self.cache.value(&package_path); - // 3. If the folder at packageURL does not exist, then - // 1. Continue the next loop iteration. - if cached_path.is_dir(&self.cache.fs, ctx) { - // 4. Let pjson be the result of READ_PACKAGE_JSON(packageURL). - if let Some(package_json) = - cached_path.package_json(&self.cache.fs, &self.options, ctx)? - { - // 5. If pjson is not null and pjson.exports is not null or undefined, then - // 1. Return the result of PACKAGE_EXPORTS_RESOLVE(packageURL, packageSubpath, pjson.exports, defaultConditions). - for exports in package_json.exports_fields(&self.options.exports_fields) { - if let Some(path) = self.package_exports_resolve( - cached_path.path(), - &format!(".{subpath}"), - exports, - ctx, - )? { - return Ok(Some(path)); - } - } - // 6. Otherwise, if packageSubpath is equal to ".", then - if subpath == "." { - // 1. If pjson.main is a string, then - for main_field in package_json.main_fields(&self.options.main_fields) { - // 1. Return the URL resolution of main in packageURL. - let path = cached_path.path().normalize_with(main_field); - let cached_path = self.cache.value(&path); - if cached_path.is_file(&self.cache.fs, ctx) { - return Ok(Some(cached_path)); - } - } - } - } - let subpath = format!(".{subpath}"); - ctx.with_fully_specified(false); - return self.require(&cached_path, &subpath, ctx).map(Some); - } - } - } - - Err(ResolveError::NotFound(specifier.to_string())) - } - - /// PACKAGE_EXPORTS_RESOLVE(packageURL, subpath, exports, conditions) - fn package_exports_resolve( - &self, - package_url: &Path, - subpath: &str, - exports: &JSONValue, - ctx: &mut Ctx, - ) -> ResolveResult { - let conditions = &self.options.condition_names; - // 1. If exports is an Object with both a key starting with "." and a key not starting with ".", throw an Invalid Package Configuration error. - if let JSONValue::Object(map) = exports { - let mut has_dot = false; - let mut without_dot = false; - for key in map.keys() { - has_dot = has_dot || key.starts_with(|s| s == '.' || s == '#'); - without_dot = without_dot || !key.starts_with(|s| s == '.' || s == '#'); - if has_dot && without_dot { - return Err(ResolveError::InvalidPackageConfig( - package_url.join("package.json"), - )); - } - } - } - // 2. If subpath is equal to ".", then - // Note: subpath is not prepended with a dot when passed in. - if subpath == "." { - // enhanced-resolve appends query and fragment when resolving exports field - // https://github.com/webpack/enhanced-resolve/blob/a998c7d218b7a9ec2461fc4fddd1ad5dd7687485/lib/ExportsFieldPlugin.js#L57-L62 - // This is only need when querying the main export, otherwise ctx is passed through. - if ctx.query.is_some() || ctx.fragment.is_some() { - let query = ctx.query.clone().unwrap_or_default(); - let fragment = ctx.fragment.clone().unwrap_or_default(); - return Err(ResolveError::PackagePathNotExported( - format!("./{}{query}{fragment}", subpath.trim_start_matches('.')), - package_url.join("package.json"), - )); - } - // 1. Let mainExport be undefined. - let main_export = match exports { - // 2. If exports is a String or Array, or an Object containing no keys starting with ".", then - JSONValue::String(_) | JSONValue::Array(_) => { - // 1. Set mainExport to exports. - Some(exports) - } - // 3. Otherwise if exports is an Object containing a "." property, then - JSONValue::Object(map) => { - // 1. Set mainExport to exports["."]. - map.get(".").map_or_else( - || { - if map.keys().any(|key| key.starts_with("./") || key.starts_with('#')) { - None - } else { - Some(exports) - } - }, - Some, - ) - } - _ => None, - }; - // 4. If mainExport is not undefined, then - if let Some(main_export) = main_export { - // 1. Let resolved be the result of PACKAGE_TARGET_RESOLVE( packageURL, mainExport, null, false, conditions). - let resolved = self.package_target_resolve( - package_url, - ".", - main_export, - None, - /* is_imports */ false, - conditions, - ctx, - )?; - // 2. If resolved is not null or undefined, return resolved. - if let Some(path) = resolved { - return Ok(Some(path)); - } - } - } - // 3. Otherwise, if exports is an Object and all keys of exports start with ".", then - if let JSONValue::Object(exports) = exports { - // 1. Let matchKey be the string "./" concatenated with subpath. - // Note: `package_imports_exports_resolve` does not require the leading dot. - let match_key = &subpath; - // 2. Let resolved be the result of PACKAGE_IMPORTS_EXPORTS_RESOLVE( matchKey, exports, packageURL, false, conditions). - if let Some(path) = self.package_imports_exports_resolve( - match_key, - exports, - package_url, - /* is_imports */ false, - conditions, - ctx, - )? { - // 3. If resolved is not null or undefined, return resolved. - return Ok(Some(path)); - } - } - // 4. Throw a Package Path Not Exported error. - Err(ResolveError::PackagePathNotExported( - subpath.to_string(), - package_url.join("package.json"), - )) - } - - /// PACKAGE_IMPORTS_RESOLVE(specifier, parentURL, conditions) - fn package_imports_resolve( - &self, - specifier: &str, - package_json: &PackageJson, - ctx: &mut Ctx, - ) -> Result, ResolveError> { - // 1. Assert: specifier begins with "#". - debug_assert!(specifier.starts_with('#'), "{specifier}"); - // 2. If specifier is exactly equal to "#" or starts with "#/", then - // 1. Throw an Invalid Module Specifier error. - // 3. Let packageURL be the result of LOOKUP_PACKAGE_SCOPE(parentURL). - // 4. If packageURL is not null, then - - // 1. Let pjson be the result of READ_PACKAGE_JSON(packageURL). - // 2. If pjson.imports is a non-null Object, then - - // 1. Let resolved be the result of PACKAGE_IMPORTS_EXPORTS_RESOLVE( specifier, pjson.imports, packageURL, true, conditions). - let mut has_imports = false; - for imports in package_json.imports_fields(&self.options.imports_fields) { - if !has_imports { - has_imports = true; - // TODO: fill in test case for this case - if specifier == "#" || specifier.starts_with("#/") { - return Err(ResolveError::InvalidModuleSpecifier( - specifier.to_string(), - package_json.path.clone(), - )); - } - } - if let Some(path) = self.package_imports_exports_resolve( - specifier, - imports, - package_json.directory(), - /* is_imports */ true, - &self.options.condition_names, - ctx, - )? { - // 2. If resolved is not null or undefined, return resolved. - return Ok(Some(path)); - } - } - - // 5. Throw a Package Import Not Defined error. - if has_imports { - Err(ResolveError::PackageImportNotDefined( - specifier.to_string(), - package_json.path.clone(), - )) - } else { - Ok(None) - } - } - - /// PACKAGE_IMPORTS_EXPORTS_RESOLVE(matchKey, matchObj, packageURL, isImports, conditions) - fn package_imports_exports_resolve( - &self, - match_key: &str, - match_obj: &JSONMap, - package_url: &Path, - is_imports: bool, - conditions: &[String], - ctx: &mut Ctx, - ) -> ResolveResult { - // enhanced-resolve behaves differently, it throws - // Error: CachedPath to directories is not possible with the exports field (specifier was ./dist/) - if match_key.ends_with('/') { - return Ok(None); - } - // 1. If matchKey is a key of matchObj and does not contain "*", then - if !match_key.contains('*') { - // 1. Let target be the value of matchObj[matchKey]. - if let Some(target) = match_obj.get(match_key) { - // 2. Return the result of PACKAGE_TARGET_RESOLVE(packageURL, target, null, isImports, conditions). - return self.package_target_resolve( - package_url, - match_key, - target, - None, - is_imports, - conditions, - ctx, - ); - } - } - - let mut best_target = None; - let mut best_match = ""; - let mut best_key = ""; - // 2. Let expansionKeys be the list of keys of matchObj containing only a single "*", sorted by the sorting function PATTERN_KEY_COMPARE which orders in descending order of specificity. - // 3. For each key expansionKey in expansionKeys, do - for (expansion_key, target) in match_obj { - if expansion_key.starts_with("./") || expansion_key.starts_with('#') { - // 1. Let patternBase be the substring of expansionKey up to but excluding the first "*" character. - if let Some((pattern_base, pattern_trailer)) = expansion_key.split_once('*') { - // 2. If matchKey starts with but is not equal to patternBase, then - if match_key.starts_with(pattern_base) - // 1. Let patternTrailer be the substring of expansionKey from the index after the first "*" character. - && !pattern_trailer.contains('*') - // 2. If patternTrailer has zero length, or if matchKey ends with patternTrailer and the length of matchKey is greater than or equal to the length of expansionKey, then - && (pattern_trailer.is_empty() - || (match_key.len() >= expansion_key.len() - && match_key.ends_with(pattern_trailer))) - && Self::pattern_key_compare(best_key, expansion_key).is_gt() - { - // 1. Let target be the value of matchObj[expansionKey]. - best_target = Some(target); - // 2. Let patternMatch be the substring of matchKey starting at the index of the length of patternBase up to the length of matchKey minus the length of patternTrailer. - best_match = - &match_key[pattern_base.len()..match_key.len() - pattern_trailer.len()]; - best_key = expansion_key; - } - } else if expansion_key.ends_with('/') - && match_key.starts_with(expansion_key) - && Self::pattern_key_compare(best_key, expansion_key).is_gt() - { - // TODO: [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./dist/" in the "exports" field module resolution of the package at xxx/package.json. - best_target = Some(target); - best_match = &match_key[expansion_key.len()..]; - best_key = expansion_key; - } - } - } - if let Some(best_target) = best_target { - // 3. Return the result of PACKAGE_TARGET_RESOLVE(packageURL, target, patternMatch, isImports, conditions). - return self.package_target_resolve( - package_url, - best_key, - best_target, - Some(best_match), - is_imports, - conditions, - ctx, - ); - } - // 4. Return null. - Ok(None) - } - - /// PACKAGE_TARGET_RESOLVE(packageURL, target, patternMatch, isImports, conditions) - #[allow(clippy::too_many_arguments)] - fn package_target_resolve( - &self, - package_url: &Path, - target_key: &str, - target: &JSONValue, - pattern_match: Option<&str>, - is_imports: bool, - conditions: &[String], - ctx: &mut Ctx, - ) -> ResolveResult { - fn normalize_string_target<'a>( - target_key: &'a str, - target: &'a str, - pattern_match: Option<&'a str>, - package_url: &Path, - ) -> Result, ResolveError> { - let target = if let Some(pattern_match) = pattern_match { - if !target_key.contains('*') && !target.contains('*') { - // enhanced-resolve behaviour - // TODO: [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./dist/" in the "exports" field module resolution of the package at xxx/package.json. - if target_key.ends_with('/') && target.ends_with('/') { - Cow::Owned(format!("{target}{pattern_match}")) - } else { - return Err(ResolveError::InvalidPackageConfigDirectory( - package_url.join("package.json"), - )); - } - } else { - Cow::Owned(target.replace('*', pattern_match)) - } - } else { - Cow::Borrowed(target) - }; - Ok(target) - } - - match target { - // 1. If target is a String, then - JSONValue::String(target) => { - // 1. If target does not start with "./", then - if !target.starts_with("./") { - // 1. If isImports is false, or if target starts with "../" or "/", or if target is a valid URL, then - if !is_imports || target.starts_with("../") || target.starts_with('/') { - // 1. Throw an Invalid Package Target error. - return Err(ResolveError::InvalidPackageTarget( - target.to_string(), - target_key.to_string(), - package_url.join("package.json"), - )); - } - // 2. If patternMatch is a String, then - // 1. Return PACKAGE_RESOLVE(target with every instance of "*" replaced by patternMatch, packageURL + "/"). - let target = - normalize_string_target(target_key, target, pattern_match, package_url)?; - let package_url = self.cache.value(package_url); - // // 3. Return PACKAGE_RESOLVE(target, packageURL + "/"). - return self.package_resolve(&package_url, &target, ctx); - } - - // 2. If target split on "/" or "\" contains any "", ".", "..", or "node_modules" segments after the first "." segment, case insensitive and including percent encoded variants, throw an Invalid Package Target error. - // 3. Let resolvedTarget be the URL resolution of the concatenation of packageURL and target. - // 4. Assert: resolvedTarget is contained in packageURL. - // 5. If patternMatch is null, then - let target = - normalize_string_target(target_key, target, pattern_match, package_url)?; - if Path::new(target.as_ref()).is_invalid_exports_target() { - return Err(ResolveError::InvalidPackageTarget( - target.to_string(), - target_key.to_string(), - package_url.join("package.json"), - )); - } - let resolved_target = package_url.normalize_with(target.as_ref()); - // 6. If patternMatch split on "/" or "\" contains any "", ".", "..", or "node_modules" segments, case insensitive and including percent encoded variants, throw an Invalid Module Specifier error. - // 7. Return the URL resolution of resolvedTarget with every instance of "*" replaced with patternMatch. - let value = self.cache.value(&resolved_target); - return Ok(Some(value)); - } - // 2. Otherwise, if target is a non-null Object, then - JSONValue::Object(target) => { - // 1. If exports contains any index property keys, as defined in ECMA-262 6.1.7 Array Index, throw an Invalid Package Configuration error. - // 2. For each property p of target, in object insertion order as, - for (key, target_value) in target { - // 1. If p equals "default" or conditions contains an entry for p, then - if key == "default" || conditions.contains(key) { - // 1. Let targetValue be the value of the p property in target. - // 2. Let resolved be the result of PACKAGE_TARGET_RESOLVE( packageURL, targetValue, patternMatch, isImports, conditions). - let resolved = self.package_target_resolve( - package_url, - target_key, - target_value, - pattern_match, - is_imports, - conditions, - ctx, - ); - // 3. If resolved is equal to undefined, continue the loop. - if let Some(path) = resolved? { - // 4. Return resolved. - return Ok(Some(path)); - } - } - } - // 3. Return undefined. - return Ok(None); - } - // 3. Otherwise, if target is an Array, then - JSONValue::Array(targets) => { - // 1. If _target.length is zero, return null. - if targets.is_empty() { - // Note: return PackagePathNotExported has the same effect as return because there are no matches. - return Err(ResolveError::PackagePathNotExported( - pattern_match.unwrap_or(".").to_string(), - package_url.join("package.json"), - )); - } - // 2. For each item targetValue in target, do - for (i, target_value) in targets.iter().enumerate() { - // 1. Let resolved be the result of PACKAGE_TARGET_RESOLVE( packageURL, targetValue, patternMatch, isImports, conditions), continuing the loop on any Invalid Package Target error. - let resolved = self.package_target_resolve( - package_url, - target_key, - target_value, - pattern_match, - is_imports, - conditions, - ctx, - ); - - if resolved.is_err() && i == targets.len() { - return resolved; - } - - // 2. If resolved is undefined, continue the loop. - if let Ok(Some(path)) = resolved { - // 3. Return resolved. - return Ok(Some(path)); - } - } - // 3. Return or throw the last fallback resolution null return or error. - // Note: see `resolved.is_err() && i == targets.len()` - } - _ => {} - } - // 4. Otherwise, if target is null, return null. - Ok(None) - // 5. Otherwise throw an Invalid Package Target error. - } - - // Returns (module, subpath) - // https://github.com/nodejs/node/blob/8f0f17e1e3b6c4e58ce748e06343c5304062c491/lib/internal/modules/esm/resolve.js#L688 - fn parse_package_specifier(specifier: &str) -> (&str, &str) { - let mut separator_index = specifier.as_bytes().iter().position(|b| *b == b'/'); - // let mut valid_package_name = true; - // let mut is_scoped = false; - if specifier.starts_with('@') { - // is_scoped = true; - if separator_index.is_none() || specifier.is_empty() { - // valid_package_name = false; - } else if let Some(index) = &separator_index { - separator_index = specifier[*index + 1..] - .as_bytes() - .iter() - .position(|b| *b == b'/') - .map(|i| i + *index + 1); - } - } - let package_name = - separator_index.map_or(specifier, |separator_index| &specifier[..separator_index]); - - // TODO: https://github.com/nodejs/node/blob/8f0f17e1e3b6c4e58ce748e06343c5304062c491/lib/internal/modules/esm/resolve.js#L705C1-L714C1 - // Package name cannot have leading . and cannot have percent-encoding or - // \\ separators. - // if (RegExpPrototypeExec(invalidPackageNameRegEx, packageName) !== null) - // validPackageName = false; - - // if (!validPackageName) { - // throw new ERR_INVALID_MODULE_SPECIFIER( - // specifier, 'is not a valid package name', fileURLToPath(base)); - // } - let package_subpath = - separator_index.map_or("", |separator_index| &specifier[separator_index..]); - (package_name, package_subpath) - } - - /// PATTERN_KEY_COMPARE(keyA, keyB) - fn pattern_key_compare(key_a: &str, key_b: &str) -> Ordering { - if key_a.is_empty() { - return Ordering::Greater; - } - // 1. Assert: keyA ends with "/" or contains only a single "*". - debug_assert!(key_a.ends_with('/') || key_a.match_indices('*').count() == 1, "{key_a}"); - // 2. Assert: keyB ends with "/" or contains only a single "*". - debug_assert!(key_b.ends_with('/') || key_b.match_indices('*').count() == 1, "{key_b}"); - // 3. Let baseLengthA be the index of "*" in keyA plus one, if keyA contains "*", or the length of keyA otherwise. - let a_pos = key_a.chars().position(|c| c == '*'); - let base_length_a = a_pos.map_or(key_a.len(), |p| p + 1); - // 4. Let baseLengthB be the index of "*" in keyB plus one, if keyB contains "*", or the length of keyB otherwise. - let b_pos = key_b.chars().position(|c| c == '*'); - let base_length_b = b_pos.map_or(key_b.len(), |p| p + 1); - // 5. If baseLengthA is greater than baseLengthB, return -1. - if base_length_a > base_length_b { - return Ordering::Less; - } - // 6. If baseLengthB is greater than baseLengthA, return 1. - if base_length_b > base_length_a { - return Ordering::Greater; - } - // 7. If keyA does not contain "*", return 1. - if !key_a.contains('*') { - return Ordering::Greater; - } - // 8. If keyB does not contain "*", return -1. - if !key_b.contains('*') { - return Ordering::Less; - } - // 9. If the length of keyA is greater than the length of keyB, return -1. - if key_a.len() > key_b.len() { - return Ordering::Less; - } - // 10. If the length of keyB is greater than the length of keyA, return 1. - if key_b.len() > key_a.len() { - return Ordering::Greater; - } - // 11. Return 0. - Ordering::Equal - } - - fn strip_package_name<'a>(specifier: &'a str, package_name: &'a str) -> Option<&'a str> { - specifier - .strip_prefix(package_name) - .filter(|tail| tail.is_empty() || tail.starts_with(SLASH_START)) - } -} diff --git a/src/options.rs b/src/options.rs deleted file mode 100644 index f473a133..00000000 --- a/src/options.rs +++ /dev/null @@ -1,623 +0,0 @@ -use std::path::Path; -use std::{fmt, path::PathBuf}; - -/// Module Resolution Options -/// -/// Options are directly ported from [enhanced-resolve](https://github.com/webpack/enhanced-resolve#resolver-options). -/// -/// See [webpack resolve](https://webpack.js.org/configuration/resolve/) for information and examples -#[derive(Debug, Clone)] -pub struct ResolveOptions { - /// Path to TypeScript configuration file. - /// - /// Default `None` - pub tsconfig: Option, - - /// Create aliases to import or require certain modules more easily. - /// - /// An alias is used to replace a whole path or part of a path. - /// For example, to alias a commonly used `src/` folders: `vec![("@/src"), vec![AliasValue::Path("/path/to/src")]]` - /// - /// A trailing $ can also be added to the given object's keys to signify an exact match. - /// - /// See [webpack's `resolve.alias` documentation](https://webpack.js.org/configuration/resolve/#resolvealias) for a list of use cases. - pub alias: Alias, - - /// A list of alias fields in description files. - /// - /// Specify a field, such as `browser`, to be parsed according to [this specification](https://github.com/defunctzombie/package-browser-field-spec). - /// Can be a path to json object such as `["path", "to", "exports"]`. - /// - /// Default `[]` - pub alias_fields: Vec>, - - /// Condition names for exports field which defines entry points of a package. - /// - /// The key order in the exports field is significant. During condition matching, earlier entries have higher priority and take precedence over later entries. - /// - /// Default `[]` - pub condition_names: Vec, - - /// The JSON files to use for descriptions. (There was once a `bower.json`.) - /// - /// Default `["package.json"]` - pub description_files: Vec, - - /// Set to [EnforceExtension::Enabled] for [ESM Mandatory file extensions](https://nodejs.org/api/esm.html#mandatory-file-extensions). - /// - /// If `enforce_extension` is set to [EnforceExtension::Enabled], resolution will not allow extension-less files. - /// This means `require('./foo.js')` will resolve, while `require('./foo')` will not. - /// - /// The default value for `enforce_extension` is [EnforceExtension::Auto], which is changed upon initialization. - /// - /// It changes to [EnforceExtension::Enabled] if [ResolveOptions::extensions] contains an empty string; - /// otherwise, this value changes to [EnforceExtension::Disabled]. - /// - /// Explicitly set the value to [EnforceExtension::Disabled] to disable this automatic behavior. - /// - /// For reference, this behavior is aligned with `enhanced-resolve`. See . - pub enforce_extension: EnforceExtension, - - /// A list of exports fields in description files. - /// - /// Can be a path to a JSON object such as `["path", "to", "exports"]`. - /// - /// Default `[["exports"]]`. - pub exports_fields: Vec>, - - /// Fields from `package.json` which are used to provide the internal requests of a package - /// (requests starting with # are considered internal). - /// - /// Can be a path to a JSON object such as `["path", "to", "imports"]`. - /// - /// Default `[["imports"]]`. - pub imports_fields: Vec>, - - /// An object which maps extension to extension aliases. - /// - /// Default `{}` - pub extension_alias: Vec<(String, Vec)>, - - /// Attempt to resolve these extensions in order. - /// - /// If multiple files share the same name but have different extensions, - /// will resolve the one with the extension listed first in the array and skip the rest. - /// - /// All extensions must have a leading dot. - /// - /// Default `[".js", ".json", ".node"]` - pub extensions: Vec, - - /// Redirect module requests when normal resolving fails. - /// - /// Default `[]` - pub fallback: Alias, - - /// 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). - /// - /// See also webpack configuration [resolve.fullySpecified](https://webpack.js.org/configuration/module/#resolvefullyspecified) - /// - /// Default `false` - pub fully_specified: bool, - - /// A list of main fields in description files - /// - /// Default `["main"]`. - pub main_fields: Vec, - - /// The filename to be used while resolving directories. - /// - /// Default `["index"]` - pub main_files: Vec, - - /// A list of directories to resolve modules from, can be absolute path or folder name. - /// - /// Default `["node_modules"]` - pub modules: Vec, - - /// Resolve to a context instead of a file. - /// - /// Default `false` - pub resolve_to_context: bool, - - /// Prefer to resolve module requests as relative requests instead of using modules from node_modules directories. - /// - /// Default `false` - pub prefer_relative: bool, - - /// Prefer to resolve server-relative urls as absolute paths before falling back to resolve in ResolveOptions::roots. - /// - /// Default `false` - pub prefer_absolute: bool, - - /// A list of resolve restrictions to restrict the paths that a request can be resolved on. - /// - /// Default `[]` - pub restrictions: Vec, - - /// A list of directories where requests of server-relative URLs (starting with '/') are resolved. - /// On non-Windows systems these requests are resolved as an absolute path first. - /// - /// Default `[]` - pub roots: Vec, - - /// Whether to resolve symlinks to their symlinked location. - /// When enabled, symlinked resources are resolved to their real path, not their symlinked location. - /// Note that this may cause module resolution to fail when using tools that symlink packages (like npm link). - /// - /// Default `true` - pub symlinks: bool, - - /// Whether to parse [module.builtinModules](https://nodejs.org/api/module.html#modulebuiltinmodules) or not. - /// For example, "zlib" will throw [crate::ResolveError::Builtin] when set to true. - /// - /// Default `false` - pub builtin_modules: bool, -} - -impl ResolveOptions { - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// - /// let options = ResolveOptions::default().with_condition_names(&["bar"]); - /// assert_eq!(options.condition_names, vec!["bar".to_string()]) - /// ``` - #[must_use] - pub fn with_condition_names(mut self, names: &[&str]) -> Self { - self.condition_names = names.iter().map(ToString::to_string).collect::>(); - self - } - - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// - /// let options = ResolveOptions::default().with_builtin_modules(false); - /// assert_eq!(options.builtin_modules, false) - /// ``` - #[must_use] - pub fn with_builtin_modules(mut self, flag: bool) -> Self { - self.builtin_modules = flag; - self - } - - /// Adds a single root to the options - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_root("foo"); - /// assert_eq!(options.roots, vec![PathBuf::from("foo")]) - /// ``` - #[must_use] - pub fn with_root>(mut self, root: P) -> Self { - self.roots.push(root.as_ref().to_path_buf()); - self - } - - /// Adds a single extension to the list of extensions - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_extension("jsonc"); - /// assert!(options.extensions.contains(&"jsonc".to_string())); - /// ``` - #[must_use] - pub fn with_extension>(mut self, extension: S) -> Self { - self.extensions.push(extension.into()); - self - } - - /// Adds a single main field to the list of fields - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_main_field("something"); - /// assert!(options.main_fields.contains(&"something".to_string())); - /// ``` - #[must_use] - pub fn with_main_field>(mut self, field: S) -> Self { - self.main_fields.push(field.into()); - self - } - - /// Changes how the extension should be treated - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions, EnforceExtension}; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_force_extension(EnforceExtension::Enabled); - /// assert_eq!(options.enforce_extension, EnforceExtension::Enabled); - /// ``` - #[must_use] - pub fn with_force_extension(mut self, enforce_extension: EnforceExtension) -> Self { - self.enforce_extension = enforce_extension; - self - } - - /// Sets the value for [ResolveOptions::fully_specified] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_fully_specified(true); - /// assert_eq!(options.fully_specified, true); - /// ``` - #[must_use] - pub fn with_fully_specified(mut self, fully_specified: bool) -> Self { - self.fully_specified = fully_specified; - self - } - /// Sets the value for [ResolveOptions::prefer_relative] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_prefer_relative(true); - /// assert_eq!(options.prefer_relative, true); - /// ``` - #[must_use] - pub fn with_prefer_relative(mut self, flag: bool) -> Self { - self.prefer_relative = flag; - self - } - /// Sets the value for [ResolveOptions::prefer_absolute] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_prefer_absolute(true); - /// assert_eq!(options.prefer_absolute, true); - /// ``` - #[must_use] - pub fn with_prefer_absolute(mut self, flag: bool) -> Self { - self.prefer_absolute = flag; - self - } - - /// Changes the value of [ResolveOptions::symlinks] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// - /// let options = ResolveOptions::default().with_symbolic_link(false); - /// assert_eq!(options.symlinks, false); - /// ``` - #[must_use] - pub fn with_symbolic_link(mut self, flag: bool) -> Self { - self.symlinks = flag; - self - } - - /// Adds a module to [ResolveOptions::modules] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// - /// let options = ResolveOptions::default().with_module("module"); - /// assert!(options.modules.contains(&"module".to_string())); - /// ``` - #[must_use] - pub fn with_module>(mut self, module: M) -> Self { - self.modules.push(module.into()); - self - } - - /// Adds a main file to [ResolveOptions::main_files] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// - /// let options = ResolveOptions::default().with_main_file("foo"); - /// assert!(options.main_files.contains(&"foo".to_string())); - /// ``` - #[must_use] - pub fn with_main_file>(mut self, module: M) -> Self { - self.main_files.push(module.into()); - self - } - - pub(crate) fn sanitize(mut self) -> Self { - debug_assert!( - self.extensions.iter().filter(|e| !e.is_empty()).all(|e| e.starts_with('.')), - "All extensions must start with a leading dot" - ); - // Set `enforceExtension` to `true` when [ResolveOptions::extensions] contains an empty string. - // See - if self.enforce_extension == EnforceExtension::Auto { - if !self.extensions.is_empty() && self.extensions.iter().any(String::is_empty) { - self.enforce_extension = EnforceExtension::Enabled; - } else { - self.enforce_extension = EnforceExtension::Disabled; - } - } - self - } -} - -/// Value for [ResolveOptions::enforce_extension] -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -pub enum EnforceExtension { - Auto, - Enabled, - Disabled, -} - -impl EnforceExtension { - pub const fn is_auto(&self) -> bool { - matches!(self, Self::Auto) - } - - pub const fn is_enabled(&self) -> bool { - matches!(self, Self::Enabled) - } - - pub const fn is_disabled(&self) -> bool { - matches!(self, Self::Disabled) - } -} - -/// Alias for [ResolveOptions::alias] and [ResolveOptions::fallback] -pub type Alias = Vec<(String, Vec)>; - -/// Alias Value for [ResolveOptions::alias] and [ResolveOptions::fallback] -#[derive(Debug, Clone, Hash, PartialEq, Eq)] -pub enum AliasValue { - /// The path value - Path(String), - - /// The `false` value - Ignore, -} - -impl From for AliasValue -where - S: Into, -{ - fn from(value: S) -> Self { - Self::Path(value.into()) - } -} - -/// Value for [ResolveOptions::restrictions] -#[derive(Debug, Clone)] -pub enum Restriction { - Path(PathBuf), - RegExp(String), -} - -/// Tsconfig Options for [ResolveOptions::tsconfig] -/// -/// Derived from [tsconfig-paths-webpack-plugin](https://github.com/dividab/tsconfig-paths-webpack-plugin#options) -#[derive(Debug, Clone)] -pub struct TsconfigOptions { - /// Allows you to specify where to find the TypeScript configuration file. - /// You may provide - /// * a relative path to the configuration file. It will be resolved relative to cwd. - /// * an absolute path to the configuration file. - pub config_file: PathBuf, - - /// Support for Typescript Project References. - pub references: TsconfigReferences, -} - -/// Configuration for [TsconfigOptions::references] -#[derive(Debug, Clone)] -pub enum TsconfigReferences { - Disabled, - /// Use the `references` field from tsconfig of `config_file`. - Auto, - /// Manually provided relative or absolute path. - Paths(Vec), -} - -impl Default for ResolveOptions { - fn default() -> Self { - Self { - tsconfig: None, - alias: vec![], - alias_fields: vec![], - condition_names: vec![], - description_files: vec!["package.json".into()], - enforce_extension: EnforceExtension::Auto, - extension_alias: vec![], - exports_fields: vec![vec!["exports".into()]], - imports_fields: vec![vec!["imports".into()]], - extensions: vec![".js".into(), ".json".into(), ".node".into()], - fallback: vec![], - fully_specified: false, - main_fields: vec!["main".into()], - main_files: vec!["index".into()], - modules: vec!["node_modules".into()], - resolve_to_context: false, - prefer_relative: false, - prefer_absolute: false, - restrictions: vec![], - roots: vec![], - symlinks: true, - builtin_modules: false, - } - } -} - -// For tracing -impl fmt::Display for ResolveOptions { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - if let Some(tsconfig) = &self.tsconfig { - write!(f, "tsconfig:{tsconfig:?},")?; - } - if !self.alias.is_empty() { - write!(f, "alias:{:?},", self.alias)?; - } - if !self.alias_fields.is_empty() { - write!(f, "alias_fields:{:?},", self.alias_fields)?; - } - if !self.condition_names.is_empty() { - write!(f, "condition_names:{:?},", self.condition_names)?; - } - if self.enforce_extension.is_enabled() { - write!(f, "enforce_extension:{:?},", self.enforce_extension)?; - } - if !self.exports_fields.is_empty() { - write!(f, "exports_fields:{:?},", self.exports_fields)?; - } - if !self.imports_fields.is_empty() { - write!(f, "imports_fields:{:?},", self.imports_fields)?; - } - if !self.extension_alias.is_empty() { - write!(f, "extension_alias:{:?},", self.extension_alias)?; - } - if !self.extensions.is_empty() { - write!(f, "extensions:{:?},", self.extensions)?; - } - if !self.fallback.is_empty() { - write!(f, "fallback:{:?},", self.fallback)?; - } - if self.fully_specified { - write!(f, "fully_specified:{:?},", self.fully_specified)?; - } - if !self.main_fields.is_empty() { - write!(f, "main_fields:{:?},", self.main_fields)?; - } - if !self.main_files.is_empty() { - write!(f, "main_files:{:?},", self.main_files)?; - } - if !self.modules.is_empty() { - write!(f, "modules:{:?},", self.modules)?; - } - if self.resolve_to_context { - write!(f, "resolve_to_context:{:?},", self.resolve_to_context)?; - } - if self.prefer_relative { - write!(f, "prefer_relative:{:?},", self.prefer_relative)?; - } - if self.prefer_absolute { - write!(f, "prefer_absolute:{:?},", self.prefer_absolute)?; - } - if !self.restrictions.is_empty() { - write!(f, "restrictions:{:?},", self.restrictions)?; - } - if !self.roots.is_empty() { - write!(f, "roots:{:?},", self.roots)?; - } - if self.symlinks { - write!(f, "symlinks:{:?},", self.symlinks)?; - } - if self.builtin_modules { - write!(f, "builtin_modules:{:?},", self.builtin_modules)?; - } - Ok(()) - } -} - -#[cfg(test)] -mod test { - use super::{ - AliasValue, EnforceExtension, ResolveOptions, Restriction, TsconfigOptions, - TsconfigReferences, - }; - use std::path::PathBuf; - - #[test] - fn enforce_extension() { - assert!(EnforceExtension::Auto.is_auto()); - assert!(!EnforceExtension::Enabled.is_auto()); - assert!(!EnforceExtension::Disabled.is_auto()); - - assert!(!EnforceExtension::Auto.is_enabled()); - assert!(EnforceExtension::Enabled.is_enabled()); - assert!(!EnforceExtension::Disabled.is_enabled()); - - assert!(!EnforceExtension::Auto.is_disabled()); - assert!(!EnforceExtension::Enabled.is_disabled()); - assert!(EnforceExtension::Disabled.is_disabled()); - } - - #[test] - fn display() { - let options = ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: PathBuf::from("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - alias: vec![("a".into(), vec![AliasValue::Ignore])], - alias_fields: vec![vec!["browser".into()]], - condition_names: vec!["require".into()], - enforce_extension: EnforceExtension::Enabled, - extension_alias: vec![(".js".into(), vec![".ts".into()])], - exports_fields: vec![vec!["exports".into()]], - imports_fields: vec![vec!["imports".into()]], - fallback: vec![("fallback".into(), vec![AliasValue::Ignore])], - fully_specified: true, - resolve_to_context: true, - prefer_relative: true, - prefer_absolute: true, - restrictions: vec![Restriction::Path(PathBuf::from("restrictions"))], - roots: vec![PathBuf::from("roots")], - builtin_modules: true, - ..ResolveOptions::default() - }; - - let expected = r#"tsconfig:TsconfigOptions { config_file: "tsconfig.json", references: Auto },alias:[("a", [Ignore])],alias_fields:[["browser"]],condition_names:["require"],enforce_extension:Enabled,exports_fields:[["exports"]],imports_fields:[["imports"]],extension_alias:[(".js", [".ts"])],extensions:[".js", ".json", ".node"],fallback:[("fallback", [Ignore])],fully_specified:true,main_fields:["main"],main_files:["index"],modules:["node_modules"],resolve_to_context:true,prefer_relative:true,prefer_absolute:true,restrictions:[Path("restrictions")],roots:["roots"],symlinks:true,builtin_modules:true,"#; - assert_eq!(format!("{options}"), expected); - - let options = ResolveOptions { - alias: vec![], - alias_fields: vec![], - builtin_modules: false, - condition_names: vec![], - description_files: vec![], - enforce_extension: EnforceExtension::Disabled, - exports_fields: vec![], - extension_alias: vec![], - extensions: vec![], - fallback: vec![], - fully_specified: false, - imports_fields: vec![], - main_fields: vec![], - main_files: vec![], - modules: vec![], - prefer_absolute: false, - prefer_relative: false, - resolve_to_context: false, - restrictions: vec![], - roots: vec![], - symlinks: false, - tsconfig: None, - }; - - assert_eq!(format!("{options}"), ""); - } -} diff --git a/src/package_json.rs b/src/package_json.rs deleted file mode 100644 index 73901faa..00000000 --- a/src/package_json.rs +++ /dev/null @@ -1,207 +0,0 @@ -//! package.json definitions -//! -//! Code related to export field are copied from [Parcel's resolver](https://github.com/parcel-bundler/parcel/blob/v2/packages/utils/node-resolver-rs/src/package_json.rs) -use std::path::{Path, PathBuf}; - -use serde_json::Value as JSONValue; - -use crate::{path::PathUtil, ResolveError}; - -pub type JSONMap = serde_json::Map; - -/// Deserialized package.json -#[derive(Debug, Default)] -pub struct PackageJson { - /// Path to `package.json`. Contains the `package.json` filename. - pub path: PathBuf, - - /// Realpath to `package.json`. Contains the `package.json` filename. - pub realpath: PathBuf, - - /// The "name" field defines your package's name. - /// The "name" field can be used in addition to the "exports" field to self-reference a package using its name. - /// - /// - pub name: Option, - - raw_json: std::sync::Arc, -} - -impl PackageJson { - /// # Panics - /// # Errors - pub(crate) fn parse( - path: PathBuf, - realpath: PathBuf, - json: &str, - ) -> Result { - let mut raw_json: JSONValue = serde_json::from_str(json)?; - let mut package_json = Self::default(); - - if let Some(json_object) = raw_json.as_object_mut() { - // Remove large fields that are useless for pragmatic use. - #[cfg(feature = "package_json_raw_json_api")] - { - json_object.remove("description"); - json_object.remove("keywords"); - json_object.remove("scripts"); - json_object.remove("dependencies"); - json_object.remove("devDependencies"); - json_object.remove("peerDependencies"); - json_object.remove("optionalDependencies"); - } - - // Add name. - package_json.name = - json_object.get("name").and_then(|field| field.as_str()).map(ToString::to_string); - } - - package_json.path = path; - package_json.realpath = realpath; - package_json.raw_json = std::sync::Arc::new(raw_json); - Ok(package_json) - } - - fn get_value_by_path<'a>( - fields: &'a serde_json::Map, - path: &[String], - ) -> Option<&'a JSONValue> { - if path.is_empty() { - return None; - } - let mut value = fields.get(&path[0])?; - for key in path.iter().skip(1) { - if let Some(inner_value) = value.as_object().and_then(|o| o.get(key)) { - value = inner_value; - } else { - return None; - } - } - Some(value) - } - - /// Raw serde json value of `package.json`. - /// - /// This is currently used in Rspack for: - /// * getting the `sideEffects` field - /// * query in - search on GitHub indicates query on the `type` field. - /// - /// To reduce overall memory consumption, large fields that useless for pragmatic use are removed. - /// They are: `description`, `keywords`, `scripts`, - /// `dependencies` and `devDependencies`, `peerDependencies`, `optionalDependencies`. - #[cfg(feature = "package_json_raw_json_api")] - pub fn raw_json(&self) -> &std::sync::Arc { - &self.raw_json - } - - /// Directory to `package.json` - /// - /// # Panics - /// - /// * When the package.json path is misconfigured. - pub fn directory(&self) -> &Path { - debug_assert!(self.realpath.file_name().is_some_and(|x| x == "package.json")); - self.realpath.parent().unwrap() - } - - /// The "main" field defines the entry point of a package when imported by name via a node_modules lookup. Its value is a path. - /// - /// When a package has an "exports" field, this will take precedence over the "main" field when importing the package by name. - /// - /// Values are dynamically retrieved from [ResolveOptions::main_fields]. - /// - /// - pub(crate) fn main_fields<'a>( - &'a self, - main_fields: &'a [String], - ) -> impl Iterator + '_ { - main_fields - .iter() - .filter_map(|main_field| self.raw_json.get(main_field)) - .filter_map(|value| value.as_str()) - } - - /// The "exports" field allows defining the entry points of a package when imported by name loaded either via a node_modules lookup or a self-reference to its own name. - /// - /// - pub(crate) fn exports_fields<'a>( - &'a self, - exports_fields: &'a [Vec], - ) -> impl Iterator + '_ { - exports_fields.iter().filter_map(|object_path| { - self.raw_json - .as_object() - .and_then(|json_object| Self::get_value_by_path(json_object, object_path)) - }) - } - - /// In addition to the "exports" field, there is a package "imports" field to create private mappings that only apply to import specifiers from within the package itself. - /// - /// - pub(crate) fn imports_fields<'a>( - &'a self, - imports_fields: &'a [Vec], - ) -> impl Iterator + '_ { - imports_fields.iter().filter_map(|object_path| { - self.raw_json - .as_object() - .and_then(|json_object| Self::get_value_by_path(json_object, object_path)) - .and_then(|value| value.as_object()) - }) - } - - /// The "browser" field is provided by a module author as a hint to javascript bundlers or component tools when packaging modules for client side use. - /// Multiple values are configured by [ResolveOptions::alias_fields]. - /// - /// - fn browser_fields<'a>( - &'a self, - alias_fields: &'a [Vec], - ) -> impl Iterator + '_ { - alias_fields.iter().filter_map(|object_path| { - self.raw_json - .as_object() - .and_then(|json_object| Self::get_value_by_path(json_object, object_path)) - // Only object is valid, all other types are invalid - // https://github.com/webpack/enhanced-resolve/blob/3a28f47788de794d9da4d1702a3a583d8422cd48/lib/AliasFieldPlugin.js#L44-L52 - .and_then(|value| value.as_object()) - }) - } - - /// Resolve the request string for this package.json by looking at the `browser` field. - /// - /// # Errors - /// - /// * Returns [ResolveError::Ignored] for `"path": false` in `browser` field. - pub(crate) fn resolve_browser_field<'a>( - &'a self, - path: &Path, - request: Option<&str>, - alias_fields: &'a [Vec], - ) -> Result, ResolveError> { - for object in self.browser_fields(alias_fields) { - if let Some(request) = request { - if let Some(value) = object.get(request) { - return Self::alias_value(path, value); - } - } else { - let dir = self.path.parent().unwrap(); - for (key, value) in object { - let joined = dir.normalize_with(key); - if joined == path { - return Self::alias_value(path, value); - } - } - } - } - Ok(None) - } - - fn alias_value<'a>(key: &Path, value: &'a JSONValue) -> Result, ResolveError> { - match value { - JSONValue::String(value) => Ok(Some(value.as_str())), - JSONValue::Bool(b) if !b => Err(ResolveError::Ignored(key.to_path_buf())), - _ => Ok(None), - } - } -} diff --git a/src/path.rs b/src/path.rs deleted file mode 100644 index f66fdd76..00000000 --- a/src/path.rs +++ /dev/null @@ -1,132 +0,0 @@ -//! Path Utilities -//! -//! Code adapted from the following libraries -//! * [path-absolutize](https://docs.rs/path-absolutize) -//! * [normalize_path](https://docs.rs/normalize-path) -use std::path::{Component, Path, PathBuf}; - -pub const SLASH_START: &[char; 2] = &['/', '\\']; - -/// Extension trait to add path normalization to std's [`Path`]. -pub trait PathUtil { - /// Normalize this path without performing I/O. - /// - /// All redundant separator and up-level references are collapsed. - /// - /// However, this does not resolve links. - fn normalize(&self) -> PathBuf; - - /// Normalize with subpath assuming this path is normalized without performing I/O. - /// - /// All redundant separator and up-level references are collapsed. - /// - /// However, this does not resolve links. - fn normalize_with>(&self, subpath: P) -> PathBuf; - - /// Defined in ESM PACKAGE_TARGET_RESOLVE - /// If target split on "/" or "\" contains any "", ".", "..", or "node_modules" segments after the first "." segment, case insensitive and including percent encoded variants - fn is_invalid_exports_target(&self) -> bool; -} - -impl PathUtil for Path { - // https://github.com/parcel-bundler/parcel/blob/e0b99c2a42e9109a9ecbd6f537844a1b33e7faf5/packages/utils/node-resolver-rs/src/path.rs#L7 - fn normalize(&self) -> PathBuf { - let mut components = self.components().peekable(); - let mut ret = if let Some(c @ Component::Prefix(..)) = components.peek() { - let buf = PathBuf::from(c.as_os_str()); - components.next(); - buf - } else { - PathBuf::new() - }; - - for component in components { - match component { - Component::Prefix(..) => unreachable!("Path {:?}", self), - Component::RootDir => { - ret.push(component.as_os_str()); - } - Component::CurDir => {} - Component::ParentDir => { - ret.pop(); - } - Component::Normal(c) => { - ret.push(c); - } - } - } - - ret - } - - // https://github.com/parcel-bundler/parcel/blob/e0b99c2a42e9109a9ecbd6f537844a1b33e7faf5/packages/utils/node-resolver-rs/src/path.rs#L37 - fn normalize_with>(&self, subpath: B) -> PathBuf { - let subpath = subpath.as_ref(); - - let mut components = subpath.components(); - - let Some(head) = components.next() else { return subpath.to_path_buf() }; - - if matches!(head, Component::Prefix(..) | Component::RootDir) { - return subpath.to_path_buf(); - } - - let mut ret = self.to_path_buf(); - for component in std::iter::once(head).chain(components) { - match component { - Component::CurDir => {} - Component::ParentDir => { - ret.pop(); - } - Component::Normal(c) => { - ret.push(c); - } - Component::Prefix(..) | Component::RootDir => { - unreachable!("Path {:?} Subpath {:?}", self, subpath) - } - } - } - - ret - } - - fn is_invalid_exports_target(&self) -> bool { - self.components().enumerate().any(|(index, c)| match c { - Component::ParentDir => true, - Component::CurDir => index > 0, - Component::Normal(c) => c.eq_ignore_ascii_case("node_modules"), - _ => false, - }) - } -} - -// https://github.com/webpack/enhanced-resolve/blob/main/test/path.test.js -#[test] -fn is_invalid_exports_target() { - let test_cases = [ - "../a.js", - "../", - "./a/b/../../../c.js", - "./a/b/../../../", - "./../../c.js", - "./../../", - "./a/../b/../../c.js", - "./a/../b/../../", - "./././../", - ]; - - for case in test_cases { - assert!(Path::new(case).is_invalid_exports_target(), "{case}"); - } - - assert!(!Path::new("C:").is_invalid_exports_target()); - assert!(!Path::new("/").is_invalid_exports_target()); -} - -#[test] -fn normalize() { - assert_eq!(Path::new("/foo/.././foo/").normalize(), Path::new("/foo")); - assert_eq!(Path::new("C://").normalize(), Path::new("C://")); - assert_eq!(Path::new("C:").normalize(), Path::new("C:")); - assert_eq!(Path::new(r"\\server\share").normalize(), Path::new(r"\\server\share")); -} diff --git a/src/resolution.rs b/src/resolution.rs deleted file mode 100644 index a3aaa2e7..00000000 --- a/src/resolution.rs +++ /dev/null @@ -1,92 +0,0 @@ -use crate::package_json::PackageJson; -use std::{ - fmt, - path::{Path, PathBuf}, - sync::Arc, -}; - -/// The final path resolution with optional `?query` and `#fragment` -#[derive(Clone)] -pub struct Resolution { - pub(crate) path: PathBuf, - - /// path query `?query`, contains `?`. - pub(crate) query: Option, - - /// path fragment `#query`, contains `#`. - pub(crate) fragment: Option, - - pub(crate) package_json: Option>, -} - -impl fmt::Debug for Resolution { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - f.debug_struct("Resolution") - .field("path", &self.path) - .field("query", &self.query) - .field("fragment", &self.fragment) - .field("package_json", &self.package_json.as_ref().map(|p| &p.path)) - .finish() - } -} - -impl PartialEq for Resolution { - fn eq(&self, other: &Self) -> bool { - self.path == other.path && self.query == other.query && self.fragment == other.fragment - } -} -impl Eq for Resolution {} - -impl Resolution { - /// Returns the path without query and fragment - pub fn path(&self) -> &Path { - &self.path - } - - /// Returns the path without query and fragment - pub fn into_path_buf(self) -> PathBuf { - self.path - } - - /// Returns the path query `?query`, contains the leading `?` - pub fn query(&self) -> Option<&str> { - self.query.as_deref() - } - - /// Returns the path fragment `#fragment`, contains the leading `#` - pub fn fragment(&self) -> Option<&str> { - self.fragment.as_deref() - } - - /// Returns serialized package_json - pub fn package_json(&self) -> Option<&Arc> { - self.package_json.as_ref() - } - - /// Returns the full path with query and fragment - pub fn full_path(&self) -> PathBuf { - let mut path = self.path.clone().into_os_string(); - if let Some(query) = &self.query { - path.push(query); - } - if let Some(fragment) = &self.fragment { - path.push(fragment); - } - PathBuf::from(path) - } -} - -#[test] -fn test() { - let resolution = Resolution { - path: PathBuf::from("foo"), - query: Some("?query".to_string()), - fragment: Some("#fragment".to_string()), - package_json: None, - }; - assert_eq!(resolution.path(), Path::new("foo")); - assert_eq!(resolution.query(), Some("?query")); - assert_eq!(resolution.fragment(), Some("#fragment")); - assert_eq!(resolution.full_path(), PathBuf::from("foo?query#fragment")); - assert_eq!(resolution.into_path_buf(), PathBuf::from("foo")); -} diff --git a/src/specifier.rs b/src/specifier.rs deleted file mode 100644 index 3d35eafc..00000000 --- a/src/specifier.rs +++ /dev/null @@ -1,230 +0,0 @@ -use crate::error::SpecifierError; -use std::borrow::Cow; - -#[derive(Debug)] -pub struct Specifier<'a> { - path: Cow<'a, str>, - pub query: Option<&'a str>, - pub fragment: Option<&'a str>, -} - -impl<'a> Specifier<'a> { - pub fn path(&'a self) -> &'a str { - self.path.as_ref() - } - - pub fn parse(specifier: &'a str) -> Result, SpecifierError> { - if specifier.is_empty() { - return Err(SpecifierError::Empty(specifier.to_string())); - } - let offset = match specifier.as_bytes()[0] { - b'/' | b'.' | b'#' => 1, - _ => 0, - }; - let (path, query, fragment) = Self::parse_query_framgment(specifier, offset); - if path.is_empty() { - return Err(SpecifierError::Empty(specifier.to_string())); - } - Ok(Self { path, query, fragment }) - } - - fn parse_query_framgment( - specifier: &'a str, - skip: usize, - ) -> (Cow<'a, str>, Option<&str>, Option<&str>) { - let mut query_start: Option = None; - let mut fragment_start: Option = None; - - let mut prev = specifier.chars().next().unwrap(); - let mut escaped_indexes = vec![]; - for (i, c) in specifier.char_indices().skip(skip) { - if c == '?' && query_start.is_none() { - query_start = Some(i); - } - if c == '#' { - if prev == '\0' { - escaped_indexes.push(i - 1); - } else { - fragment_start = Some(i); - break; - } - } - prev = c; - } - - let (path, query, fragment) = match (query_start, fragment_start) { - (Some(i), Some(j)) => { - debug_assert!(i < j); - (&specifier[..i], Some(&specifier[i..j]), Some(&specifier[j..])) - } - (Some(i), None) => (&specifier[..i], Some(&specifier[i..]), None), - (None, Some(j)) => (&specifier[..j], None, Some(&specifier[j..])), - _ => (specifier, None, None), - }; - - let path = if escaped_indexes.is_empty() { - Cow::Borrowed(path) - } else { - // Remove the `\0` characters for a legal path. - Cow::Owned( - path.chars() - .enumerate() - .filter_map(|(i, c)| (!escaped_indexes.contains(&i)).then_some(c)) - .collect::(), - ) - }; - - (path, query, fragment) - } -} - -#[cfg(test)] -mod tests { - use super::{Specifier, SpecifierError}; - - #[test] - fn debug() { - let specifier = Specifier::parse("/").unwrap(); - assert_eq!( - format!("{specifier:?}"), - r#"Specifier { path: "/", query: None, fragment: None }"# - ); - } - - #[test] - fn empty() { - let specifiers = ["", "?"]; - for specifier in specifiers { - let error = Specifier::parse(specifier).unwrap_err(); - assert_eq!(error, SpecifierError::Empty(specifier.to_string())); - } - } - - #[test] - fn absolute() -> Result<(), SpecifierError> { - let specifier = "/test?#"; - let parsed = Specifier::parse(specifier)?; - assert_eq!(parsed.path, "/test"); - assert_eq!(parsed.query, Some("?")); - assert_eq!(parsed.fragment, Some("#")); - Ok(()) - } - - #[test] - fn relative() -> Result<(), SpecifierError> { - let specifiers = ["./test", "../test", "../../test"]; - for specifier in specifiers { - let mut r = specifier.to_string(); - r.push_str("?#"); - let parsed = Specifier::parse(&r)?; - assert_eq!(parsed.path, specifier); - assert_eq!(parsed.query, Some("?")); - assert_eq!(parsed.fragment, Some("#")); - } - Ok(()) - } - - #[test] - fn hash() -> Result<(), SpecifierError> { - let specifiers = ["#", "#path"]; - for specifier in specifiers { - let mut r = specifier.to_string(); - r.push_str("?#"); - let parsed = Specifier::parse(&r)?; - assert_eq!(parsed.path, specifier); - assert_eq!(parsed.query, Some("?")); - assert_eq!(parsed.fragment, Some("#")); - } - Ok(()) - } - - #[test] - fn module() -> Result<(), SpecifierError> { - let specifiers = ["module"]; - for specifier in specifiers { - let mut r = specifier.to_string(); - r.push_str("?#"); - let parsed = Specifier::parse(&r)?; - assert_eq!(parsed.path, specifier); - assert_eq!(parsed.query, Some("?")); - assert_eq!(parsed.fragment, Some("#")); - } - Ok(()) - } - - #[test] - fn query_fragment() -> Result<(), SpecifierError> { - let data = [ - ("a?", Some("?"), None), - ("a?query", Some("?query"), None), - ("a?query1?query2", Some("?query1?query2"), None), - ("a?query1?query2?query3", Some("?query1?query2?query3"), None), - ("a#", None, Some("#")), - ("a#b#c", None, Some("#b#c")), - ("a#fragment", None, Some("#fragment")), - ("a?#", Some("?"), Some("#")), - ("a?#fragment", Some("?"), Some("#fragment")), - ("a?query#", Some("?query"), Some("#")), - ("a?query#fragment", Some("?query"), Some("#fragment")), - ("a#fragment?", None, Some("#fragment?")), - ("a#fragment?query", None, Some("#fragment?query")), - ]; - - for (specifier_str, query, fragment) in data { - let specifier = Specifier::parse(specifier_str)?; - assert_eq!(specifier.path, "a", "{specifier_str}"); - assert_eq!(specifier.query, query, "{specifier_str}"); - assert_eq!(specifier.fragment, fragment, "{specifier_str}"); - } - - Ok(()) - } - - #[test] - // https://github.com/webpack/enhanced-resolve/blob/main/test/identifier.test.js - fn enhanced_resolve_edge_cases() -> Result<(), SpecifierError> { - let data = [ - ("path/#", "path/", "", "#"), - ("path/as/?", "path/as/", "?", ""), - ("path/#/?", "path/", "", "#/?"), - ("path/#repo#hash", "path/", "", "#repo#hash"), - ("path/#r#hash", "path/", "", "#r#hash"), - ("path/#repo/#repo2#hash", "path/", "", "#repo/#repo2#hash"), - ("path/#r/#r#hash", "path/", "", "#r/#r#hash"), - ("path/#/not/a/hash?not-a-query", "path/", "", "#/not/a/hash?not-a-query"), - ]; - - for (specifier_str, path, query, fragment) in data { - let specifier = Specifier::parse(specifier_str)?; - assert_eq!(specifier.path, path, "{specifier_str}"); - assert_eq!(specifier.query.unwrap_or(""), query, "{specifier_str}"); - assert_eq!(specifier.fragment.unwrap_or(""), fragment, "{specifier_str}"); - } - - Ok(()) - } - - // https://github.com/webpack/enhanced-resolve/blob/main/test/identifier.test.js - #[test] - fn enhanced_resolve_windows_like() -> Result<(), SpecifierError> { - let data = [ - ("path\\#", "path\\", "", "#"), - ("path\\as\\?", "path\\as\\", "?", ""), - ("path\\#\\?", "path\\", "", "#\\?"), - ("path\\#repo#hash", "path\\", "", "#repo#hash"), - ("path\\#r#hash", "path\\", "", "#r#hash"), - ("path\\#repo\\#repo2#hash", "path\\", "", "#repo\\#repo2#hash"), - ("path\\#r\\#r#hash", "path\\", "", "#r\\#r#hash"), - ("path\\#/not/a/hash?not-a-query", "path\\", "", "#/not/a/hash?not-a-query"), - ]; - - for (specifier_str, path, query, fragment) in data { - let specifier = Specifier::parse(specifier_str)?; - assert_eq!(specifier.path, path, "{specifier_str}"); - assert_eq!(specifier.query.unwrap_or(""), query, "{specifier_str}"); - assert_eq!(specifier.fragment.unwrap_or(""), fragment, "{specifier_str}"); - } - - Ok(()) - } -} diff --git a/src/tests/alias.rs b/src/tests/alias.rs deleted file mode 100644 index 07c615f4..00000000 --- a/src/tests/alias.rs +++ /dev/null @@ -1,280 +0,0 @@ -//! - -use normalize_path::NormalizePath; -use std::path::Path; - -use crate::{AliasValue, Resolution, ResolveContext, ResolveError, ResolveOptions, Resolver}; - -#[test] -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -fn alias() { - use super::memory_fs::MemoryFS; - use crate::ResolverGeneric; - use std::path::{Path, PathBuf}; - - let f = Path::new("/"); - - let file_system = MemoryFS::new(&[ - ("/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", ""), - ("/dashed-name", ""), - ]); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - alias: vec![ - ("aliasA".into(), vec![AliasValue::from("a")]), - ("b$".into(), vec![AliasValue::from("a/index")]), - ("c$".into(), vec![AliasValue::from("/a/index")]), - ( - "multiAlias".into(), - vec![ - AliasValue::from("b"), - AliasValue::from("c"), - AliasValue::from("d"), - AliasValue::from("e"), - AliasValue::from("a"), - ], - ), - ("recursive".into(), vec![AliasValue::from("recursive/dir")]), - ("/d/dir".into(), vec![AliasValue::from("/c/dir")]), - ("/d/index.js".into(), vec![AliasValue::from("/c/index")]), - ("#".into(), vec![AliasValue::from("/c/dir")]), - ("@".into(), vec![AliasValue::from("/c/dir")]), - ("ignored".into(), vec![AliasValue::Ignore]), - // not part of enhanced-resolve, added to make sure query in alias value works - ("alias_query".into(), vec![AliasValue::from("a?query_after")]), - ("alias_fragment".into(), vec![AliasValue::from("a#fragment_after")]), - ("dash".into(), vec![AliasValue::Ignore]), - ("@scope/package-name/file$".into(), vec![AliasValue::from("/c/dir")]), - ], - modules: vec!["/".into()], - ..ResolveOptions::default() - }, - ); - - #[rustfmt::skip] - let pass = [ - ("should resolve a not aliased module 1", "a", "/a/index"), - ("should resolve a not aliased module 2", "a/index", "/a/index"), - ("should resolve a not aliased module 3", "a/dir", "/a/dir/index"), - ("should resolve a not aliased module 4", "a/dir/index", "/a/dir/index"), - ("should resolve an aliased module 1", "aliasA", "/a/index"), - ("should resolve an aliased module 2", "aliasA/index", "/a/index"), - ("should resolve an aliased module 3", "aliasA/dir", "/a/dir/index"), - ("should resolve an aliased module 4", "aliasA/dir/index", "/a/dir/index"), - ("should resolve '#' alias 1", "#", "/c/dir/index"), - ("should resolve '#' alias 2", "#/index", "/c/dir/index"), - ("should resolve '@' alias 1", "@", "/c/dir/index"), - ("should resolve '@' alias 2", "@/index", "/c/dir/index"), - ("should resolve a recursive aliased module 1", "recursive", "/recursive/dir/index"), - ("should resolve a recursive aliased module 2", "recursive/index", "/recursive/dir/index"), - ("should resolve a recursive aliased module 3", "recursive/dir", "/recursive/dir/index"), - ("should resolve a recursive aliased module 4", "recursive/dir/index", "/recursive/dir/index"), - ("should resolve a file aliased module 1", "b", "/a/index"), - ("should resolve a file aliased module 2", "c", "/a/index"), - ("should resolve a file aliased module with a query 1", "b?query", "/a/index?query"), - ("should resolve a file aliased module with a query 2", "c?query", "/a/index?query"), - ("should resolve a path in a file aliased module 1", "b/index", "/b/index"), - ("should resolve a path in a file aliased module 2", "b/dir", "/b/dir/index"), - ("should resolve a path in a file aliased module 3", "b/dir/index", "/b/dir/index"), - ("should resolve a path in a file aliased module 4", "c/index", "/c/index"), - ("should resolve a path in a file aliased module 5", "c/dir", "/c/dir/index"), - ("should resolve a path in a file aliased module 6", "c/dir/index", "/c/dir/index"), - ("should resolve a file aliased file 1", "d", "/c/index"), - ("should resolve a file aliased file 2", "d/dir/index", "/c/dir/index"), - ("should resolve a file in multiple aliased dirs 1", "multiAlias/dir/file", "/e/dir/file"), - ("should resolve a file in multiple aliased dirs 2", "multiAlias/anotherDir", "/e/anotherDir/index"), - // not part of enhanced-resolve, added to make sure query in alias value works - ("should resolve query in alias value", "alias_query?query_before", "/a/index?query_after"), - ("should resolve query in alias value", "alias_fragment#fragment_before", "/a/index#fragment_after"), - ("should resolve dashed name", "dashed-name", "/dashed-name"), - ("should resolve scoped package name with sub dir", "@scope/package-name/file", "/c/dir/index"), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - - #[rustfmt::skip] - let ignore = [ - ("should resolve an ignore module", "ignored", ResolveError::Ignored(f.join("ignored"))) - ]; - - for (comment, request, expected) in ignore { - let resolution = resolver.resolve(f, request); - assert_eq!(resolution, Err(expected), "{comment} {request}"); - } -} - -// Not part of enhanced-resolve -#[test] -fn infinite_recursion() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![ - ("./a".into(), vec![AliasValue::from("./b")]), - ("./b".into(), vec![AliasValue::from("./a")]), - ], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(f, "./a"); - assert_eq!(resolution, Err(ResolveError::Recursion)); -} - -fn check_slash(path: &Path) { - let s = path.to_string_lossy().to_string(); - #[cfg(target_os = "windows")] - { - assert!(!s.contains('/'), "{s}"); - assert!(s.contains('\\'), "{s}"); - } - #[cfg(not(target_os = "windows"))] - { - assert!(s.contains('/'), "{s}"); - assert!(!s.contains('\\'), "{s}"); - } -} - -#[test] -fn absolute_path() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![(f.join("foo").to_str().unwrap().to_string(), vec![AliasValue::Ignore])], - modules: vec![f.clone().to_str().unwrap().to_string()], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(&f, "foo/index"); - assert_eq!(resolution, Err(ResolveError::Ignored(f.join("foo")))); -} - -#[test] -fn system_path() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![("@app".into(), vec![AliasValue::from(f.join("alias").to_string_lossy())])], - ..ResolveOptions::default() - }); - - let specifiers = ["@app/files/a", "@app/files/a.js"]; - - for specifier in specifiers { - let path = resolver.resolve(&f, specifier).map(Resolution::into_path_buf).unwrap(); - assert_eq!(path, f.join("alias/files/a.js")); - check_slash(&path); - } -} - -#[test] -fn alias_is_full_path() { - let f = super::fixture(); - let dir = f.join("foo"); - let dir_str = dir.to_string_lossy().to_string(); - - let resolver = Resolver::new(ResolveOptions { - alias: vec![("@".into(), vec![AliasValue::Path(dir_str.clone())])], - ..ResolveOptions::default() - }); - - let mut ctx = ResolveContext::default(); - - let specifiers = [ - "@/index".to_string(), - "@/index.js".to_string(), - // specifier has multiple `/` for reasons we'll never know - "@////index".to_string(), - // specifier is a full path - dir_str, - ]; - - for specifier in specifiers { - let resolution = resolver.resolve_with_context(&f, &specifier, &mut ctx); - assert_eq!(resolution.map(|r| r.full_path()), Ok(dir.join("index.js"))); - } - - for path in ctx.file_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - check_slash(&path); - } - - for path in ctx.missing_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - check_slash(&path); - if let Some(path) = path.parent() { - assert!(!path.is_file(), "{path:?} must not be a file"); - } - } -} - -// For the `should_stop` variable in `load_alias` -#[test] -fn all_alias_values_are_not_found() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![( - "m1".to_string(), - vec![AliasValue::Path(f.join("node_modules").join("m2").to_string_lossy().to_string())], - )], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(&f, "m1/a.js"); - assert_eq!(resolution, Err(ResolveError::NotFound("m1/a.js".to_string()))); -} - -#[test] -fn alias_fragment() { - let f = super::fixture(); - - let data = [ - // enhanced-resolve has `#` prepended with a `\0`, they are removed from the - // following 3 expected test results. - // See https://github.com/webpack/enhanced-resolve#escaping - ( - "handle fragment edge case (no fragment)", - "./no#fragment/#/#", - f.join("no#fragment/#/#.js"), - ), - ("handle fragment edge case (fragment)", "./no#fragment/#/", f.join("no.js#fragment/#/")), - ( - "handle fragment escaping", - "./no\0#fragment/\0#/\0##fragment", - f.join("no#fragment/#/#.js#fragment"), - ), - ]; - - for (comment, request, expected) in data { - let resolver = Resolver::new(ResolveOptions { - alias: vec![("foo".to_string(), vec![AliasValue::Path(request.to_string())])], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f, "foo").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } -} - -#[test] -fn alias_try_fragment_as_path() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![( - "#".to_string(), - vec![AliasValue::Path(f.join("#").to_string_lossy().to_string())], - )], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(&f, "#/a").map(|r| r.full_path()); - assert_eq!(resolution, Ok(f.join("#").join("a.js"))); -} diff --git a/src/tests/browser_field.rs b/src/tests/browser_field.rs deleted file mode 100644 index 171ee099..00000000 --- a/src/tests/browser_field.rs +++ /dev/null @@ -1,189 +0,0 @@ -//! - -use crate::{AliasValue, ResolveError, ResolveOptions, Resolver}; - -#[test] -fn ignore() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![ - vec!["browser".into()], - vec!["innerBrowser1".into()], - vec!["innerBrowser2".into()], - vec![], - ], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - (f.clone(), "./lib/ignore", f.join("lib/ignore.js")), - (f.clone(), "./lib/ignore.js", f.join("lib/ignore.js")), - (f.join("lib"), "./ignore", f.join("lib/ignore.js")), - (f.join("lib"), "./ignore.js", f.join("lib/ignore.js")), - ]; - - for (path, request, expected) in data { - let resolution = resolver.resolve(&path, request); - let expected = ResolveError::Ignored(expected); - assert_eq!(resolution, Err(expected), "{path:?} {request}"); - } -} - -#[test] -fn shared_resolvers() { - let f = super::fixture().join("browser-module"); - - let resolver1 = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["innerBrowser1".into(), "field".into(), "browser".into()]], - ..ResolveOptions::default() - }); - let resolved_path = resolver1.resolve(&f, "./lib/main1.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("lib/main.js"))); - - let resolver2 = resolver1.clone_with_options(ResolveOptions { - alias_fields: vec![vec!["innerBrowser2".into(), "browser".into()]], - ..ResolveOptions::default() - }); - let resolved_path = resolver2.resolve(&f, "./lib/main2.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("./lib/replaced.js"))); -} - -#[test] -fn replace_file() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![ - vec!["browser".into()], - vec!["innerBrowser1".into(), "field2".into(), "browser".into()], // not presented - vec!["innerBrowser1".into(), "field".into(), "browser".into()], - vec!["innerBrowser2".into(), "browser".into()], - ], - // Not part of enhanced-resolve. Added to make sure no interaction between these two fields. - main_fields: vec!["browser".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - ("should replace a file 1", f.clone(), "./lib/replaced", f.join("lib/browser.js")), - ("should replace a file 2", f.clone(), "./lib/replaced.js", f.join("lib/browser.js")), - ("should replace a file 3", f.join("lib"), "./replaced", f.join("lib/browser.js")), - ("should replace a file 4", f.join("lib"), "./replaced.js", f.join("lib/browser.js")), - ("should replace a module with a file 1", f.clone(), "module-a", f.join("browser/module-a.js")), - ("should replace a module with a file 2", f.join("lib"), "module-a", f.join("browser/module-a.js")), - ("should replace a module with a module 1", f.clone(), "module-b", f.join("node_modules/module-c.js")), - ("should replace a module with a module 2", f.join("lib"), "module-b", f.join("node_modules/module-c.js")), - ("should resolve in nested property 1", f.clone(), "./lib/main1.js", f.join("lib/main.js")), - ("should resolve in nested property 2", f.clone(), "./lib/main2.js", f.join("lib/browser.js")), - ("should check only alias field properties", f.clone(), "./toString", f.join("lib/toString.js")), - // not part of enhanced-resolve - ("recursion", f.clone(), "module-c", f.join("node_modules/module-c.js")), - ("resolve self 1", f.clone(), "./lib/main.js", f.join("lib/main.js")), - ("resolve self 2", f.clone(), "./main.js", f.join("lib/main.js")), - ]; - - for (comment, path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn recurse_fail() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - ("recurse non existent", f.clone(), "./lib/non-existent.js", ResolveError::NotFound("./lib/non-existent.js".into())), - ("path partial match 1", f.clone(), "./xyz.js", ResolveError::NotFound("./xyz.js".into())), - ("path partial match 2", f, "./lib/xyz.js", ResolveError::NotFound("./lib/xyz.js".into())), - ]; - - for (comment, path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Err(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn broken() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - // The browser field string value should be ignored - (f.clone(), "browser-module-broken", Ok(f.join("node_modules/browser-module-broken/main.js"))), - (f.join("browser-module"), "./number", Err(ResolveError::NotFound("./number".into()))), - ]; - - for (path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, expected, "{path:?} {request}"); - } -} - -#[test] -fn crypto_js() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - fallback: vec![( - "crypto".into(), - vec![AliasValue::from(f.join("lib.js").to_string_lossy())], - )], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(f.join("crypto-js"), "crypto").map(|r| r.full_path()); - assert_eq!(resolved_path, Err(ResolveError::Ignored(f.join("crypto-js")))); -} - -// https://github.com/webpack/webpack/blob/87660921808566ef3b8796f8df61bd79fc026108/test/cases/resolving/browser-field/index.js#L40-L43 -#[test] -fn recursive() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - let data = [ - ("should handle recursive file 1", f.clone(), "recursive-file/a"), - ("should handle recursive file 2", f.clone(), "recursive-file/b"), - ("should handle recursive file 3", f.clone(), "recursive-file/c"), - ("should handle recursive file 4", f, "recursive-file/d"), - ]; - - for (comment, path, request) in data { - let resolved_path = resolver.resolve(&path, request); - assert_eq!(resolved_path, Err(ResolveError::Recursion), "{comment} {path:?} {request}"); - } -} - -#[test] -fn with_query() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "./foo").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("lib").join("browser.js?query"))); -} diff --git a/src/tests/builtins.rs b/src/tests/builtins.rs deleted file mode 100644 index 5d6d14d9..00000000 --- a/src/tests/builtins.rs +++ /dev/null @@ -1,121 +0,0 @@ -use std::path::Path; - -use crate::{ResolveError, ResolveOptions, Resolver}; - -#[test] -fn builtins_off() { - let f = Path::new("/"); - let resolver = Resolver::default(); - let resolved_path = resolver.resolve(f, "zlib").map(|r| r.full_path()); - assert_eq!(resolved_path, Err(ResolveError::NotFound("zlib".into()))); -} - -#[test] -fn builtins() { - let f = Path::new("/"); - - let resolver = Resolver::new(ResolveOptions::default().with_builtin_modules(true)); - - let pass = [ - "_http_agent", - "_http_client", - "_http_common", - "_http_incoming", - "_http_outgoing", - "_http_server", - "_stream_duplex", - "_stream_passthrough", - "_stream_readable", - "_stream_transform", - "_stream_wrap", - "_stream_writable", - "_tls_common", - "_tls_wrap", - "assert", - "assert/strict", - "async_hooks", - "buffer", - "child_process", - "cluster", - "console", - "constants", - "crypto", - "dgram", - "diagnostics_channel", - "dns", - "dns/promises", - "domain", - "events", - "fs", - "fs/promises", - "http", - "http2", - "https", - "inspector", - "module", - "net", - "os", - "path", - "path/posix", - "path/win32", - "perf_hooks", - "process", - "punycode", - "querystring", - "readline", - "repl", - "stream", - "stream/consumers", - "stream/promises", - "stream/web", - "string_decoder", - "sys", - "timers", - "timers/promises", - "tls", - "trace_events", - "tty", - "url", - "util", - "util/types", - "v8", - "vm", - "worker_threads", - "zlib", - ]; - - for request in pass { - let prefixed_request = format!("node:{request}"); - for request in [prefixed_request.clone(), request.to_string()] { - let resolved_path = resolver.resolve(f, &request).map(|r| r.full_path()); - let err = ResolveError::Builtin(prefixed_request.clone()); - assert_eq!(resolved_path, Err(err), "{request}"); - } - } -} - -#[test] -fn fail() { - let f = Path::new("/"); - let resolver = Resolver::new(ResolveOptions::default().with_builtin_modules(true)); - let request = "xxx"; - let resolved_path = resolver.resolve(f, request); - let err = ResolveError::NotFound(request.to_string()); - assert_eq!(resolved_path, Err(err), "{request}"); -} - -#[test] -fn imports() { - let f = super::fixture().join("builtins"); - let resolver = Resolver::new(ResolveOptions { - builtin_modules: true, - condition_names: vec!["node".into()], - ..ResolveOptions::default() - }); - - for request in ["#fs", "#http"] { - let resolved_path = resolver.resolve(f.clone(), request).map(|r| r.full_path()); - let err = ResolveError::Builtin(format!("node:{}", request.trim_start_matches('#'))); - assert_eq!(resolved_path, Err(err)); - } -} diff --git a/src/tests/dependencies.rs b/src/tests/dependencies.rs deleted file mode 100644 index bcc2355b..00000000 --- a/src/tests/dependencies.rs +++ /dev/null @@ -1,110 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/dependencies.test.js - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows { - use rustc_hash::FxHashSet; - use std::path::PathBuf; - - use crate::{ResolveContext, ResolveOptions, ResolverGeneric}; - - use super::super::memory_fs::MemoryFS; - - fn file_system() -> MemoryFS { - MemoryFS::new(&[ - ("/a/b/node_modules/some-module/index.js", ""), - ("/a/node_modules/module/package.json", r#"{"main":"entry.js"}"#), - ("/a/node_modules/module/file.js", r#"{"main":"entry.js"}"#), - ("/modules/other-module/file.js", ""), - ]) - } - - #[test] - fn test() { - let file_system = file_system(); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - extensions: vec![".json".into(), ".js".into()], - modules: vec!["/modules".into(), "node_modules".into()], - ..ResolveOptions::default() - }, - ); - - let data = [ - ( - "middle module request", - "/a/b/c", - "module/file", - "/a/node_modules/module/file.js", - // These dependencies are different from enhanced-resolve due to different code path to - // querying the file system - vec![ - // 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", - // "/", - ], - vec![ - // missing package.jsons - // "/a/b/c/package.json", - "/a/b/package.json", - "/a/package.json", - "/package.json", - // missing modules directories - "/a/b/c", - // "/a/b/c/node_modules", - // missing single file modules - "/modules/module", - "/a/b/node_modules/module", - // missing files with alternative extensions - "/a/node_modules/module/file", - "/a/node_modules/module/file.json", - ], - ), - ( - "fast found module", - "/a/b/c", - "other-module/file.js", - "/modules/other-module/file.js", - // These dependencies are different from enhanced-resolve due to different code path to - // querying the file system - vec![ - // symlink checks - "/modules/other-module/file.js", - // "/modules/other-module", - // "/modules", - // "/", - ], - vec![ - // missing package.jsons - // "/a/b/c/package.json", - "/a/b/c", - "/a/b/package.json", - "/a/package.json", - "/package.json", - "/modules/other-module/package.json", - "/modules/package.json", - ], - ), - ]; - - for (name, context, request, result, file_dependencies, missing_dependencies) in data { - let mut ctx = ResolveContext::default(); - let path = PathBuf::from(context); - let resolved = - resolver.resolve_with_context(path, request, &mut ctx).map(|r| r.full_path()); - assert_eq!(resolved, Ok(PathBuf::from(result))); - let file_dependencies = - FxHashSet::from_iter(file_dependencies.iter().map(PathBuf::from)); - let missing_dependencies = - FxHashSet::from_iter(missing_dependencies.iter().map(PathBuf::from)); - assert_eq!(ctx.file_dependencies, file_dependencies, "{name}"); - assert_eq!(ctx.missing_dependencies, missing_dependencies, "{name}"); - } - } -} diff --git a/src/tests/exports_field.rs b/src/tests/exports_field.rs deleted file mode 100644 index fd68c1f7..00000000 --- a/src/tests/exports_field.rs +++ /dev/null @@ -1,2546 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/exportsField.test.js -//! -//! The huge exports field test cases are at the bottom of this file. - -use crate::{Ctx, PathUtil, ResolveError, ResolveOptions, Resolver}; -use serde_json::json; -use std::path::Path; - -#[test] -fn test_simple() { - let f = super::fixture().join("exports-field"); - let f2 = super::fixture().join("exports-field2"); - let f4 = super::fixture().join("exports-field-error"); - let f5 = super::fixture().join("imports-exports-wildcard"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - fully_specified: true, - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("resolve root using exports field, not a main field", f.clone(), "exports-field", f.join("node_modules/exports-field/x.js")), - ("resolver should respect condition names", f.clone(), "exports-field/dist/main.js", f.join("node_modules/exports-field/lib/lib2/main.js")), - // enhanced_resolve behaves differently to node.js. enhanced_resolve fallbacks when an - // array item is unresolved, where as node.js fallbacks when an array has an - // InvalidPackageTarget error. - // ("resolver should respect fallback", f2.clone(), "exports-field/dist/browser.js", f2.join("node_modules/exports-field/lib/browser.js")), - // The following two tests require fallback from array values, the path is changed here to - // only test query and fragment. - ("resolver should respect query parameters #1", f2.clone(), "exports-field/dist/main.js?foo", f2.join("node_modules/exports-field/lib/lib2/main.js?foo")), - ("resolver should respect fragment parameters #1", f2.clone(), "exports-field/dist/main.js#foo", f2.join("node_modules/exports-field/lib/lib2/main.js#foo")), - ("relative path should work, if relative path as request is used", f.clone(), "./node_modules/exports-field/lib/main.js", f.join("node_modules/exports-field/lib/main.js")), - ("self-resolving root", f.clone(), "@exports-field/core", f.join("a.js")), - ("should resolve with wildcard pattern #1", f5.clone(), "m/features/f.js", f5.join("node_modules/m/src/features/f.js")), - ("should resolve with wildcard pattern #2", f5.clone(), "m/features/y/y.js", f5.join("node_modules/m/src/features/y/y.js")), - ("should resolve with wildcard pattern #3", f5.clone(), "m/features-no-ext/y/y.js", f5.join("node_modules/m/src/features/y/y.js")), - ("should resolve with wildcard pattern #4", f5.clone(), "m/middle/nested/f.js", f5.join("node_modules/m/src/middle/nested/f.js")), - ("should resolve with wildcard pattern #5", f5.clone(), "m/middle-1/nested/f.js", f5.join("node_modules/m/src/middle-1/nested/f.js")), - ("should resolve with wildcard pattern #6", f5.clone(), "m/middle-2/nested/f.js", f5.join("node_modules/m/src/middle-2/nested/f.js")), - ("should resolve with wildcard pattern #7", f5.clone(), "m/middle-3/nested/f", f5.join("node_modules/m/src/middle-3/nested/f/nested/f.js")), - ("should resolve with wildcard pattern #8", f5.clone(), "m/middle-4/f/nested", f5.join("node_modules/m/src/middle-4/f/f.js")), - ("should resolve with wildcard pattern #9", f5.clone(), "m/middle-5/f$/$", f5.join("node_modules/m/src/middle-5/f$/$.js")), - ]; - - // Not needed or snapshot: - // * should log the correct info - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } - - let p = f.join("node_modules/exports-field/package.json"); - let p2 = f2.join("node_modules/exports-field/package.json"); - let p4 = f4.join("node_modules/exports-field/package.json"); - let p5 = f5.join("node_modules/m/package.json"); - - #[rustfmt::skip] - let fail = [ - // ("throw error if extension not provided", f2.clone(), "exports-field/dist/main", ResolveError::NotFound(f2.join("node_modules/exports-field/lib/lib2/main"))), - ("resolver should respect query parameters #2. Direct matching", f2.clone(), "exports-field?foo", ResolveError::PackagePathNotExported("./?foo".into(), p2.clone())), - ("resolver should respect fragment parameters #2. Direct matching", f2, "exports-field#foo", ResolveError::PackagePathNotExported("./#foo".into(), p2)), - ("relative path should not work with exports field", f.clone(), "./node_modules/exports-field/dist/main.js", ResolveError::NotFound("./node_modules/exports-field/dist/main.js".into())), - ("backtracking should not work for request", f.clone(), "exports-field/dist/../../../a.js", ResolveError::InvalidPackageTarget("./lib/../../../a.js".to_string(), "./dist/".to_string(), p.clone())), - ("backtracking should not work for exports field target", f.clone(), "exports-field/dist/a.js", ResolveError::InvalidPackageTarget("./../../a.js".to_string(), "./dist/a.js".to_string(), p.clone())), - ("not exported error", f.clone(), "exports-field/anything/else", ResolveError::PackagePathNotExported("./anything/else".to_string(), p.clone())), - ("request ending with slash #1", f.clone(), "exports-field/", ResolveError::PackagePathNotExported("./".to_string(), p.clone())), - ("request ending with slash #2", f.clone(), "exports-field/dist/", ResolveError::PackagePathNotExported("./dist/".to_string(), p.clone())), - ("request ending with slash #3", f.clone(), "exports-field/lib/", ResolveError::PackagePathNotExported("./lib/".to_string(), p)), - ("should throw error if target is invalid", f4, "exports-field", ResolveError::InvalidPackageTarget("./a/../b/../../pack1/index.js".to_string(), ".".to_string(), p4)), - ("throw error if exports field is invalid", f.clone(), "invalid-exports-field", ResolveError::InvalidPackageConfig(f.join("node_modules/invalid-exports-field/package.json"))), - ("should throw error if target is 'null'", f5, "m/features/internal/file.js", ResolveError::PackagePathNotExported("./features/internal/file.js".to_string(), p5)), - ]; - - for (comment, path, request, error) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!(resolution, Err(error), "{comment} {path:?} {request}"); - } -} - -// resolve using exports field, not a browser field #1 -#[test] -fn exports_not_browser_field1() { - let f = super::fixture().join("exports-field"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - condition_names: vec!["webpack".into()], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "exports-field/dist/main.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("node_modules/exports-field/lib/lib2/main.js"))); -} - -// resolve using exports field and a browser alias field #2 -#[test] -fn exports_not_browser_field2() { - let f2 = super::fixture().join("exports-field2"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - extensions: vec![".js".into()], - condition_names: vec!["node".into()], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f2, "exports-field/dist/main.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f2.join("node_modules/exports-field/lib/browser.js"))); -} - -// should resolve extension without fullySpecified -#[test] -fn extension_without_fully_specified() { - let f2 = super::fixture().join("exports-field2"); - - let commonjs_resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - let resolved_path = - commonjs_resolver.resolve(&f2, "exports-field/dist/main").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f2.join("node_modules/exports-field/lib/lib2/main.js"))); -} - -#[test] -fn field_name_path() { - let f2 = super::fixture().join("exports-field2"); - let f3 = super::fixture().join("exports-field3"); - - // field name path #1 #2 #3 - let exports_fields = [ - vec![vec!["exportsField".into(), "exports".into()]], - vec![vec!["exportsField".into(), "exports".into()], vec!["exports".into()]], - vec![vec!["exports".into()], vec!["exportsField".into(), "exports".into()]], - ]; - - for exports_fields in exports_fields { - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - exports_fields, - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/main.js"))); - } - - // field name path #4 - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - exports_fields: vec![vec!["exports".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f2, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f2.join("node_modules/exports-field/index.js"))); - - // field name path #5 - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - exports_fields: vec![vec!["ex".into()], vec!["exports_field".into(), "exports".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/index"))); - - // non-compliant export targeting a directory - let resolver = Resolver::new(ResolveOptions { - exports_fields: vec![vec!["broken".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/src/index.js"))); -} - -#[test] -fn shared_resolvers() { - let f3 = super::fixture().join("exports-field3"); - - let resolver1 = Resolver::new(ResolveOptions { - exports_fields: vec![vec!["exportsField".into(), "exports".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver1.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/main.js"))); - - let resolver2 = resolver1.clone_with_options(ResolveOptions { - exports_fields: vec![vec!["ex".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver2.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/index"))); -} - -#[test] -fn extension_alias_1_2() { - let f = super::fixture().join("exports-field-and-extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - extension_alias: vec![(".js".into(), vec![".ts".into(), ".js".into()])], - fully_specified: true, - condition_names: vec!["webpack".into(), "default".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve with the `extensionAlias` option", f.clone(), "@org/pkg/string.js", f.join("node_modules/@org/pkg/dist/string.js")), - ("should resolve with the `extensionAlias` option #2", f.clone(), "pkg/string.js", f.join("node_modules/pkg/dist/string.js")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn extension_alias_3() { - let f = super::fixture().join("exports-field-and-extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - extension_alias: vec![( - ".js".into(), - vec![".foo".into(), ".baz".into(), ".baz".into(), ".ts".into(), ".js".into()], - )], - fully_specified: true, - condition_names: vec!["webpack".into(), "default".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve with the `extensionAlias` option #3", f.clone(), "pkg/string.js", f.join("node_modules/pkg/dist/string.js")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn extension_alias_throw_error() { - let f = super::fixture().join("exports-field-and-extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - extension_alias: vec![(".js".into(), vec![".ts".into()])], - fully_specified: true, - condition_names: vec!["webpack".into(), "default".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let fail = [ - // enhanced-resolve has two test cases that are exactly the same here - // https://github.com/webpack/enhanced-resolve/blob/a998c7d218b7a9ec2461fc4fddd1ad5dd7687485/test/exportsField.test.js#L2976-L3024 - ("should throw error with the `extensionAlias` option", f, "pkg/string.js", ResolveError::ExtensionAlias), - // TODO: The error is PackagePathNotExported in enhanced-resolve - // ("should throw error with the `extensionAlias` option", f.clone(), "pkg/string.js", ResolveError::PackagePathNotExported("node_modules/pkg/dist/string.ts".to_string())), - ]; - - for (comment, path, request, error) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!(resolution, Err(error), "{comment} {path:?} {request}"); - } -} - -// Small script for generating the test cases from enhanced-resolve -// for (c of testCases) { -// console.log("TestCase {") -// console.log(`name: ${JSON.stringify(c.name)},`) -// if (c.expect instanceof Error) { -// console.log(`expect: None,`) -// } else { -// console.log(`expect: Some(vec!${JSON.stringify(c.expect)}),`) -// } -// console.log(`exports_field: exports_field(json!(${JSON.stringify(c.suite[0], null, 2)})),`) -// console.log(`request: "${c.suite[1]}",`) -// console.log(`condition_names: vec!${JSON.stringify(c.suite[2])},`) -// console.log("},") -//} -struct TestCase { - name: &'static str, - expect: Option>, - exports_field: serde_json::Value, - request: &'static str, - condition_names: Vec<&'static str>, -} - -#[allow(clippy::needless_pass_by_value)] -fn exports_field(value: serde_json::Value) -> serde_json::Value { - value -} - -#[test] -fn test_cases() { - let test_cases = [ - TestCase { - name: "sample #1", - expect: Some(vec!["./dist/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/": { - "import": [ - "./dist/", - "./src/" - ], - "webpack": "./wp/" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "sample #1", - expect: Some(vec!["./src/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/": { - "import": [ - "./src/" - ], - "webpack": "./wp/" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - TestCase { - name: "sample #1 (wildcard)", - expect: Some(vec!["./dist/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/*": { - "import": [ - "./dist/*", - "./src/*" - ], - "webpack": "./wp/*" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "sample #1 (wildcard)", - expect: Some(vec!["./src/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/*": { - "import": [ - "./src/*" - ], - "webpack": "./wp/*" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - TestCase { - name: "sample #2", - expect: Some(vec!["./data/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./timezones/": "./data/timezones/" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #2 (wildcard)", - expect: Some(vec!["./data/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./timezones/*": "./data/timezones/*" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #3", - expect: Some(vec!["./data/timezones/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./": "./data/timezones/" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #3 (wildcard)", - expect: Some(vec!["./data/timezones/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./*": "./data/timezones/*.mjs" - })), - request: "./timezones/pdt", - condition_names: vec![], - }, - TestCase { - name: "sample #4", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./lib/": { - "browser": [ - "./browser/" - ] - }, - "./dist/index.js": { - "node": "./index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #4 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "node": "./index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #5", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/": { - "browser": [ - "./browser/" - ] - }, - "./dist/index.js": { - "node": "./index.js", - "default": "./browser/index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #5 (wildcard)", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "node": "./index.js", - "default": "./browser/index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./dist/a": "./dist/index.js" - })), - request: "./dist/aaa", - condition_names: vec![], - }, - TestCase { - name: "sample #7", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./dist/a/a/": "./dist/index.js" - })), - request: "./dist/a/a", - condition_names: vec![], - }, - TestCase { - name: "sample #7 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./dist/a/a/*": "./dist/index.js" - })), - request: "./dist/a/a", - condition_names: vec![], - }, - TestCase { - name: "sample #8", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": "./index.js" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #9", - expect: Some(vec!["./main.js"]), - exports_field: exports_field(json!({ - "./index.js": "./main.js" - })), - request: "./index.js", - condition_names: vec![], - }, - TestCase { - name: "sample #10", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #11", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./bar#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #12", - expect: Some(vec!["./ok.js#abc"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/ok.js#abc", - condition_names: vec![], - }, - TestCase { - name: "sample #12", - expect: Some(vec!["./ok.js#abc"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/ok.js#abc", - condition_names: vec![], - }, - TestCase { - name: "sample #13", - expect: Some(vec!["./ok.js?abc"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/ok.js?abc", - condition_names: vec![], - }, - TestCase { - name: "sample #14", - expect: Some(vec!["./🎉.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/🎉.js", - condition_names: vec![], - }, - TestCase { - name: "sample #15", - expect: Some(vec!["./%F0%9F%8E%89.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/%F0%9F%8E%89.js", - condition_names: vec![], - }, - TestCase { - name: "sample #16", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./🎉", - condition_names: vec![], - }, - TestCase { - name: "sample #17", - expect: Some(vec!["./other.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./%F0%9F%8E%89", - condition_names: vec![], - }, - TestCase { - name: "sample #18", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./module", - condition_names: vec![], - }, - TestCase { - name: "sample #19", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./module#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #20", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./module?foo", - condition_names: vec![], - }, - TestCase { - name: "sample #21", - expect: Some(vec!["./zizizi"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./z*z*z*" - })), - request: "./#zippi", - condition_names: vec![], - }, - TestCase { - name: "sample #22", - expect: Some(vec!["./d?e?f"]), - exports_field: exports_field(json!({ - "./a?b?c/": "./" - })), - request: "./a?b?c/d?e?f", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #1", - expect: Some(vec!["./dist/index.js"]), - exports_field: exports_field(json!({ - ".": "./dist/index.js" - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #2", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./": "./", - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #3", - expect: Some(vec!["./dist/a.js"]), - exports_field: exports_field(json!({ - "./dist/": "./dist/", - "./dist/*": "./dist/*", - "./dist*": "./dist*", - "./dist/index.js": "./dist/a.js" - })), - request: "./dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #4", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./": { - "browser": [ - "./browser/" - ] - }, - "./*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "browser": "./index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #5", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./": { - "browser": [ - "./browser/" - ] - }, - "./*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "node": "./node.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #6", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - ".": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #7", - expect: Some(vec!["./src/index.js"]), // `enhanced_resolve` is `None` - exports_field: exports_field(json!({ - ".": { - "default": "./src/index.js", - "browser": "./index.js", - "node": "./src/node/index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #8", - expect: Some(vec!["./src/index.js"]), - exports_field: exports_field(json!({ - ".": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #9", - expect: Some(vec!["./index"]), - exports_field: exports_field(json!({ - ".": "./index" - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #10", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./index": "./index.js" - })), - request: "./index", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #11", - expect: Some(vec!["./foo.js"]), - exports_field: exports_field(json!({ - "./": "./", - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #12", - expect: Some(vec!["./foo/bar/baz.js"]), - exports_field: exports_field(json!({ - "./": "./", - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo/bar/baz.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #13", - expect: Some(vec!["./foo/bar/baz.js"]), - exports_field: exports_field(json!({ - "./": "./", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo/bar/baz.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #14", - expect: Some(vec!["./foo/bar/baz.js"]), - exports_field: exports_field(json!({ - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo/bar/baz.js", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #1", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "require": "./require.js" - }, { - "import": "./import.mjs" - }] - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #2", - expect: Some(vec!["./import.mjs"]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "require": "./require.js" - }, { - "import": "./import.mjs" - }] - })), - request: ".", - condition_names: vec!["import"], - }, - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./require.js"]), - exports_field: exports_field(json!({ - ".": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./import.mjs"]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "import": "./import.mjs" - }] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./require.js"]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "require": [ - "./require.js" - ] - }, { - "import": [ - "./import.mjs", - "./import.js" - ] - }] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./import.mjs"]), - exports_field: exports_field(json!({ - ".": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "./import.mjs", - "./import.js" - ] - } - ] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./import.js"]), - exports_field: exports_field(json!({ - ".": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "./import.js" - ] - } - ] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "mapping to a folder root #1", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./timezones": "./data/timezones/" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #2", - expect: None, - exports_field: exports_field(json!({ - "./timezones/": "./data/timezones" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #3", - expect: Some(vec!["./data/timezones/pdt/index.mjs"]), - exports_field: exports_field(json!({ - "./timezones/pdt/": "./data/timezones/pdt/" - })), - request: "./timezones/pdt/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #3 (wildcard)", - expect: Some(vec!["./data/timezones/pdt/index.mjs"]), - exports_field: exports_field(json!({ - "./timezones/pdt/*": "./data/timezones/pdt/*" - })), - request: "./timezones/pdt/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #4", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./": "./timezones/" - })), - request: "./pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #4 (wildcard)", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./*": "./timezones/*" - })), - request: "./pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #5", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./": "./" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #5 (wildcard)", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./*": "./*" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #6", - expect: None, - exports_field: exports_field(json!({ - "./": "." - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #6 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "./*": "." - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #7", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": "./" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #7 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": "./*" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #1", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./": "./", - "./dist/": "./lib/" - })), - request: "./dist/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #1 (wildcard)", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./*": "./*", - "./dist/*": "./lib/*" - })), - request: "./dist/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #2", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/": "./dist/utils/", - "./dist/": "./lib/" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #2 (wildcard)", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/*": "./dist/utils/*", - "./dist/*": "./lib/*" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #3", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/index.js": "./dist/utils/index.js", - "./dist/utils/": "./dist/utils/index.mjs", - "./dist/": "./lib/" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #3 (wildcard)", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/index.js": "./dist/utils/index.js", - "./dist/utils/*": "./dist/utils/index.mjs", - "./dist/*": "./lib/*" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #4", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./": { - "browser": "./browser/" - }, - "./dist/": "./lib/" - })), - request: "./dist/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "the longest matching path prefix is prioritized #4 (wildcard)", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./*": { - "browser": "./browser/*" - }, - "./dist/*": "./lib/*" - })), - request: "./dist/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #1", - // `lodash/` does not start with './' so fallbacks to util - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "conditional mapping folder #1", - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": [ - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #1 (wildcard)", - // `lodash/` does not start with './' so fallbacks to util - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": [ - "lodash/*", - "./utils/*" - ], - "node": [ - "./utils-node/*" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "conditional mapping folder #1 (wildcard)", - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": [ - "./utils/*" - ], - "node": [ - "./utils-node/*" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #2", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./node/" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "conditional mapping folder #2 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "webpack": "./wpk/*", - "browser": [ - "lodash/*", - "./utils/*" - ], - "node": [ - "./node/*" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "conditional mapping folder #3", - expect: Some(vec!["./wpk/index.mjs"]), - exports_field: exports_field(json!({ - "./utils/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils/" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "conditional mapping folder #3 (wildcard)", - expect: Some(vec!["./wpk/index.mjs"]), - exports_field: exports_field(json!({ - "./utils/*": { - "webpack": "./wpk/*", - "browser": [ - "lodash/*", - "./utils/*" - ], - "node": [ - "./utils/*" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "incorrect exports field #1", - expect: None, - exports_field: exports_field(json!({ - "/utils/": "./a/" - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #2", - expect: None, - exports_field: exports_field(json!({ - "./utils/": "/a/" - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #3", - expect: None, - exports_field: exports_field(json!({ - "/utils/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #4", - expect: None, - exports_field: exports_field(json!({ - "./utils/": { - "browser": "/a/", - "default": "/b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #4 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "/a/", - "default": "/b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #5", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index": "./a/index.js" - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index.mjs": "./a/index.js" - })), - request: "./utils/index", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #7", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #8", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index.mjs": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - // Requests that are not `./` does not apply to `package_exports_resolve` - // TestCase { - // name: "incorrect request #1", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": "./a/" - // })), - // request: "/utils/index.mjs", - // condition_names: vec![], - // }, - // TestCase { - // name: "incorrect request #2", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": { - // "browser": "./a/", - // "default": "./b/" - // } - // })), - // request: "/utils/index.mjs", - // condition_names: vec!["browser"], - // }, - // TestCase { - // name: "incorrect request #3", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": { - // "browser": "./a/", - // "default": "./b/" - // } - // })), - // request: "../utils/index.mjs", - // condition_names: vec!["browser"], - // }, - // TestCase { - // name: "incorrect request #4", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": { - // "browser": "./a/", - // "default": "./b/" - // } - // })), - // request: "/utils/index.mjs/", - // condition_names: vec!["browser"], - // }, - TestCase { - name: "backtracking package base #1", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./../../utils/": "./dist/" - })), - request: "./../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #1 (wildcard)", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./../../utils/*": "./dist/*" - })), - request: "./../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #2", - expect: None, - exports_field: exports_field(json!({ - "../../utils/": "./dist/" - })), - request: "../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #2 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "../../utils/*": "./dist/*" - })), - request: "../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #3", - expect: None, - exports_field: exports_field(json!({ - "./utils/": "../src/" - })), - request: "./utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #3 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "./utils/*": "../src/*" - })), - request: "./utils/index", - condition_names: vec![], - }, - // enhanced-resolve does not handle backtracking here - // TestCase { - // name: "backtracking package base #4", - // expect: Some(vec!["./../src/index"]), - // exports_field: exports_field(json!({ - // "./utils/": "./../src/" - // })), - // request: "./utils/index", - // condition_names: vec![], - // }, - // TestCase { - // name: "backtracking package base #4 (wildcard)", - // expect: Some(vec!["./../src/index"]), - // exports_field: exports_field(json!({ - // "./utils/*": "./../src/*" - // })), - // request: "./utils/index", - // condition_names: vec![], - // }, - // TestCase { - // name: "backtracking package base #5", - // expect: Some(vec!["./src/../index.js"]), - // exports_field: exports_field(json!({ - // "./utils/index": "./src/../index.js" - // })), - // request: "./utils/index", - // condition_names: vec![], - // }, - TestCase { - name: "backtracking package base #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/../utils/index": "./src/../index.js" - })), - request: "./utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #7", - expect: None, - exports_field: exports_field(json!({ - "./utils/": { - "browser": "../this/" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #7", - expect: None, - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "../this/*" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #8", - // We throw "InvalidPackageTarget" - // expect: Some(vec!["./utils/../index"]), - expect: None, - exports_field: exports_field(json!({ - "./utils/": { - "browser": "./utils/../" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #8 (wildcard)", - // We throw "InvalidPackageTarget" - // expect: Some(vec!["./utils/../index"]), - expect: None, - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "./utils/../*" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #9", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./": "./src/../../", - "./dist/": "./dist/" - })), - request: "./dist/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #9 (wildcard)", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./*": "./src/../../*", - "./dist/*": "./dist/*" - })), - request: "./dist/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking target folder #1", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../../index"]), - exports_field: exports_field(json!({ - "./utils/": "./dist/" - })), - request: "./utils/timezone/../../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #1 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../../index"]), - exports_field: exports_field(json!({ - "./utils/*": "./dist/*" - })), - request: "./utils/timezone/../../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #2", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../index"]), - exports_field: exports_field(json!({ - "./utils/": "./dist/" - })), - request: "./utils/timezone/../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #2 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../index"]), - exports_field: exports_field(json!({ - "./utils/*": "./dist/*" - })), - request: "./utils/timezone/../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #3", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/target/../../index"]), - exports_field: exports_field(json!({ - "./utils/": "./dist/target/" - })), - request: "./utils/../../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #3 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/target/../../index"]), - exports_field: exports_field(json!({ - "./utils/*": "./dist/target/*" - })), - request: "./utils/../../index", - condition_names: vec![], - }, - // enhanced-resolve does not handle `node_modules` in target - TestCase { - name: "nested node_modules path #1", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": "./node_modules/" - } - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #1 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "./node_modules/*" - } - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #2", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./utils/../node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/": "./utils/../node_modules/" - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "nested node_modules path #2 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./utils/../node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": "./utils/../node_modules/*" - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "nested mapping #1", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": "./", - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested mapping #1 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": "./*", - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "nested mapping #2 (wildcard)", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #2 (wildcard)", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "nested mapping #3", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["webpack"], - }, - TestCase { - name: "nested mapping #3 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["webpack"], - }, - TestCase { - name: "nested mapping #4", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["node", "browser"], - }, - TestCase { - name: "nested mapping #4 (wildcard)", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["node", "browser"], - }, - TestCase { - name: "nested mapping #5", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node"], - }, - TestCase { - name: "nested mapping #5 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": { - "webpack": [ - "./wpck/*" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node"], - }, - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - TestCase { - name: "nested mapping #6 (wildcard)", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": { - "webpack": [ - "./wpck/*" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #6 (wildcard)", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./node/*" - ], - "default": { - "node": { - "webpack": [ - "./wpck/*" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - TestCase { - name: "nested mapping #7", - expect: Some(vec!["./y.js"]), - exports_field: exports_field(json!({ - "./a.js": { - "abc": { - "def": "./x.js" - }, - "ghi": "./y.js" - } - })), - request: "./a.js", - condition_names: vec!["abc", "ghi"], - }, - TestCase { - name: "nested mapping #8", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./a.js": { - "abc": { - "def": "./x.js", - "default": [] - }, - "ghi": "./y.js" - } - })), - request: "./a.js", - condition_names: vec!["abc", "ghi"], - }, - TestCase { - name: "syntax sugar #1", - expect: Some(vec!["./main.js"]), - exports_field: exports_field(json!("./main.js")), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #2", - expect: Some(vec![]), - exports_field: exports_field(json!("./main.js")), - request: "./lib.js", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #3", - expect: Some(vec!["./a.js"]), - exports_field: exports_field(json!(["./a.js", "./b.js"])), - request: ".", - condition_names: vec![], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "syntax sugar #3", - expect: Some(vec!["./b.js"]), - exports_field: exports_field(json!(["./b.js"])), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #4", - expect: Some(vec![]), - exports_field: exports_field(json!(["./a.js", "./b.js"])), - request: "./lib.js", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #5", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "browser": { - "default": "./index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "syntax sugar #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "browser": { - "default": "./index.js" - } - })), - request: "./lib.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "syntax sugar #7", - expect: None, - exports_field: exports_field(json!({ - "./node": "./node.js", - "browser": { - "default": "./index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "syntax sugar #8", - expect: None, - exports_field: exports_field(json!({ - "browser": { - "default": "./index.js" - }, - "./node": "./node.js" - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #1", - expect: Some(vec!["./abc/d"]), - exports_field: exports_field(json!({ - "./ab*": "./ab/*", - "./abc*": "./abc/*", - "./a*": "./a/*" - })), - request: "./abcd", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #2", - expect: Some(vec!["./abc/d/e"]), - exports_field: exports_field(json!({ - "./ab*": "./ab/*", - "./abc*": "./abc/*", - "./a*": "./a/*" - })), - request: "./abcd/e", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #3", - expect: Some(vec!["./abc/d"]), - exports_field: exports_field(json!({ - "./x/ab*": "./ab/*", - "./x/abc*": "./abc/*", - "./x/a*": "./a/*" - })), - request: "./x/abcd", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #4", - expect: Some(vec!["./abc/d/e"]), - exports_field: exports_field(json!({ - "./x/ab*": "./ab/*", - "./x/abc*": "./abc/*", - "./x/a*": "./a/*" - })), - request: "./x/abcd/e", - condition_names: vec!["browser"], - }, - TestCase { - name: "path tree edge case #1", - expect: Some(vec!["./A/b/d.js"]), - exports_field: exports_field(json!({ - "./a/": "./A/", - "./a/b/c": "./c.js" - })), - request: "./a/b/d.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #1 (wildcard)", - expect: Some(vec!["./A/b/d.js"]), - exports_field: exports_field(json!({ - "./a/*": "./A/*", - "./a/b/c": "./c.js" - })), - request: "./a/b/d.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #2", - expect: Some(vec!["./A/c.js"]), - exports_field: exports_field(json!({ - "./a/": "./A/", - "./a/b": "./b.js" - })), - request: "./a/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #2 (wildcard)", - expect: Some(vec!["./A/c.js"]), - exports_field: exports_field(json!({ - "./a/*": "./A/*", - "./a/b": "./b.js" - })), - request: "./a/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #3", - expect: Some(vec!["./A/b/d/c.js"]), - exports_field: exports_field(json!({ - "./a/": "./A/", - "./a/b/c/d": "./c.js" - })), - request: "./a/b/d/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #3 (wildcard)", - expect: Some(vec!["./A/b/d/c.js"]), - exports_field: exports_field(json!({ - "./a/*": "./A/*", - "./a/b/c/d": "./c.js" - })), - request: "./a/b/d/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #1", - expect: Some(vec!["./A/b.js"]), - exports_field: exports_field(json!({ - "./a/*.js": "./A/*.js" - })), - request: "./a/b.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #2", - expect: Some(vec!["./A/b/c.js"]), - exports_field: exports_field(json!({ - "./a/*.js": "./A/*.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #3", - expect: Some(vec!["./A/b/c.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": "./A/*/c.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #4", - expect: Some(vec!["./A/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": "./A/*/*.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #5", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/*.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #5", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/*.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./lib/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #6", - expect: Some(vec!["./browser/foo/bar.js"]), - exports_field: exports_field(json!({ - "./lib/*/bar.js": { - "browser": [ - "./browser/*/bar.js" - ] - }, - "./dist/*/bar.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./lib/foo/bar.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #6", - expect: Some(vec!["./browser/foo.js"]), - exports_field: exports_field(json!({ - "./lib/*/bar.js": { - "browser": [ - "./browser/*/bar.js" - ] - }, - "./dist/*/bar.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./dist/foo/bar.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #7", - expect: Some(vec!["./browser/foo/default.js"]), - exports_field: exports_field(json!({ - "./lib/*/bar.js": { - "browser": [ - "./browser/*/bar.js" - ] - }, - "./dist/*/bar.js": { - "node": "./*.js", - "default": "./browser/*/default.js" - } - })), - request: "./dist/foo/bar.js", - condition_names: vec!["default"], - }, - TestCase { - name: "wildcard pattern #8", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": "./A/*/*/*.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #9", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": [ - "./A/*/*/*.js", - "./B/*/*/*.js" - ] - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "wildcard pattern #9", - expect: Some(vec!["./B/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": [ - "./B/*/*/*.js" - ] - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #10", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/foo-*/c.js": "./A/*/*/*.js" - })), - request: "./a/foo-b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #11", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*-foo/c.js": "./A/*/*/*.js" - })), - request: "./a/b-foo/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #12", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/foo-*-foo/c.js": "./A/*/*/*.js" - })), - request: "./a/foo-b-foo/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #13", - expect: Some(vec!["./A/b/c/d.js"]), - exports_field: exports_field(json!({ - "./a/foo-*-foo/c.js": "./A/b/c/d.js" - })), - request: "./a/foo-b-foo/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #14", - expect: Some(vec!["./A/b/c/*.js"]), - exports_field: exports_field(json!({ - "./a/foo-foo/c.js": "./A/b/c/*.js" - })), - request: "./a/foo-foo/c.js", - condition_names: vec![], - }, - ]; - - for case in test_cases { - let resolved = Resolver::new(ResolveOptions { - condition_names: case - .condition_names - .iter() - .map(ToString::to_string) - .collect::>(), - ..ResolveOptions::default() - }) - .package_exports_resolve( - Path::new(""), - case.request, - &case.exports_field, - &mut Ctx::default(), - ) - .map(|p| p.map(|p| p.to_path_buf())); - if let Some(expect) = case.expect { - if expect.is_empty() { - assert!( - matches!(resolved, Err(ResolveError::PackagePathNotExported(_, _))), - "{} {:?}", - &case.name, - &resolved - ); - } else { - for expect in expect { - assert_eq!(resolved, Ok(Some(Path::new(expect).normalize())), "{}", &case.name); - } - } - } else { - assert!(resolved.is_err(), "{} {resolved:?}", &case.name); - } - } -} diff --git a/src/tests/extension_alias.rs b/src/tests/extension_alias.rs deleted file mode 100644 index 86afab73..00000000 --- a/src/tests/extension_alias.rs +++ /dev/null @@ -1,66 +0,0 @@ -//! - -use crate::{ResolveError, ResolveOptions, Resolver}; - -#[test] -fn extension_alias() { - let f = super::fixture().join("extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - extension_alias: vec![ - (".js".into(), vec![".ts".into(), ".js".into()]), - (".mjs".into(), vec![".mts".into()]), - ], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should alias fully specified file", f.clone(), "./index.js", f.join("index.ts")), - ("should alias fully specified file when there are two alternatives", f.clone(), "./dir/index.js", f.join("dir/index.ts")), - ("should also allow the second alternative", f.clone(), "./dir2/index.js", f.join("dir2/index.js")), - ("should support alias option without an array", f.clone(), "./dir2/index.mjs", f.join("dir2/index.mts")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } - - #[rustfmt::skip] - let fail = [ - ("should not allow to fallback to the original extension or add extensions", f, "./index.mjs"), - ]; - - for (comment, path, request) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!(resolution, Err(ResolveError::ExtensionAlias), "{comment} {path:?} {request}"); - } -} - -// should not apply extension alias to extensions or mainFiles field -#[test] -fn not_apply_to_extension_nor_main_files() { - let f = super::fixture().join("extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - extension_alias: vec![(".js".into(), vec![])], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("directory", f.clone(), "./dir2", "dir2/index.js"), - ("file", f.clone(), "./dir2/index", "dir2/index.js"), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - let expected = f.join(expected); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} diff --git a/src/tests/extensions.rs b/src/tests/extensions.rs deleted file mode 100644 index 1ebd86f4..00000000 --- a/src/tests/extensions.rs +++ /dev/null @@ -1,125 +0,0 @@ -//! - -use crate::{EnforceExtension, Resolution, ResolveContext, ResolveError, ResolveOptions, Resolver}; -use rustc_hash::FxHashSet; - -#[test] -fn extensions() { - let f = super::fixture().join("extensions"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".ts".into(), ".js".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve according to order of provided extensions", "./foo", "foo.ts"), - ("should resolve according to order of provided extensions (dir index)", "./dir", "dir/index.ts"), - ("should resolve according to main field in module root", ".", "index.js"), - // This is a core module - // ("should resolve single file module before directory", "module", "node_modules/module.js"), - ("should resolve trailing slash directory before single file", "module/", "node_modules/module/index.ts"), - ]; - - for (comment, request, expected_path) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - let expected = f.join(expected_path); - assert_eq!(resolved_path, Ok(expected), "{comment} {request} {expected_path}"); - } - - #[rustfmt::skip] - let fail = [ - ("not resolve to file when request has a trailing slash (relative)", "./foo.js/", "./foo.js/".into()) - ]; - - for (comment, request, expected_error) in fail { - let resolution = resolver.resolve(&f, request); - let error = ResolveError::NotFound(expected_error); - assert_eq!(resolution, Err(error), "{comment} {request} {resolution:?}"); - } -} - -// should default enforceExtension to true when extensions includes an empty string -#[test] -fn default_enforce_extension() { - let f = super::fixture().join("extensions"); - - let mut ctx = ResolveContext::default(); - let resolved = Resolver::new(ResolveOptions { - extensions: vec![".ts".into(), String::new(), ".js".into()], - ..ResolveOptions::default() - }) - .resolve_with_context(&f, "./foo", &mut ctx); - - assert_eq!(resolved.map(Resolution::into_path_buf), Ok(f.join("foo.ts"))); - assert_eq!( - ctx.file_dependencies, - FxHashSet::from_iter([f.join("foo.ts"), f.join("package.json")]) - ); - assert!(ctx.missing_dependencies.is_empty()); -} - -// should respect enforceExtension when extensions includes an empty string -#[test] -fn respect_enforce_extension() { - let f = super::fixture().join("extensions"); - - let mut ctx = ResolveContext::default(); - let resolved = Resolver::new(ResolveOptions { - enforce_extension: EnforceExtension::Disabled, - extensions: vec![".ts".into(), String::new(), ".js".into()], - ..ResolveOptions::default() - }) - .resolve_with_context(&f, "./foo", &mut ctx); - - assert_eq!(resolved.map(Resolution::into_path_buf), Ok(f.join("foo.ts"))); - assert_eq!( - ctx.file_dependencies, - FxHashSet::from_iter([f.join("foo.ts"), f.join("package.json")]) - ); - assert_eq!(ctx.missing_dependencies, FxHashSet::from_iter([f.join("foo")])); -} - -#[test] -fn multi_dot_extension() { - let f = super::fixture().join("extensions"); - - let resolver = Resolver::new(ResolveOptions { - // Test for `.d.ts`, not part of enhanced-resolve. - extensions: vec![".a.b.c".into(), ".d.ts".into(), ".ts".into(), ".js".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve according to order of provided extensions", "./foo", "foo.ts"), - ("should resolve file with extension", "./app.module", "app.module.js") - ]; - - for (comment, request, expected_path) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - let expected = f.join(expected_path); - assert_eq!(resolved_path, Ok(expected), "{comment} {request} {expected_path}"); - } - - #[rustfmt::skip] - let fail = [ - ("not resolve to file", "./index.", "./index.".into()) - ]; - - for (comment, request, expected_error) in fail { - let resolution = resolver.resolve(&f, request); - let error = ResolveError::NotFound(expected_error); - assert_eq!(resolution, Err(error), "{comment} {request} {resolution:?}"); - } -} - -#[test] -#[should_panic = "All extensions must start with a leading dot"] -fn without_leading_dot() { - Resolver::new(ResolveOptions { - extensions: vec!["ts".into(), "js".into()], - ..ResolveOptions::default() - }); -} diff --git a/src/tests/fallback.rs b/src/tests/fallback.rs deleted file mode 100644 index 3da2d767..00000000 --- a/src/tests/fallback.rs +++ /dev/null @@ -1,100 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/fallback.test.js - -#[test] -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -fn fallback() { - use super::memory_fs::MemoryFS; - use crate::{AliasValue, ResolveError, ResolveOptions, ResolverGeneric}; - use std::path::{Path, PathBuf}; - - let f = Path::new("/"); - - let file_system = MemoryFS::new(&[ - ("/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", ""), - ]); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - fallback: vec![ - ("aliasA".into(), vec![AliasValue::Path("a".into())]), - ("b$".into(), vec![AliasValue::Path("a/index".into())]), - ("c$".into(), vec![AliasValue::Path("/a/index".into())]), - ( - "multiAlias".into(), - vec![ - AliasValue::Path("b".into()), - AliasValue::Path("c".into()), - AliasValue::Path("d".into()), - AliasValue::Path("e".into()), - AliasValue::Path("a".into()), - ], - ), - ("recursive".into(), vec![AliasValue::Path("recursive/dir".into())]), - ("/d/dir".into(), vec![AliasValue::Path("/c/dir".into())]), - ("/d/index.js".into(), vec![AliasValue::Path("/c/index".into())]), - ("ignored".into(), vec![AliasValue::Ignore]), - ("node:path".into(), vec![AliasValue::Ignore]), - ], - modules: vec!["/".into()], - ..ResolveOptions::default() - }, - ); - - #[rustfmt::skip] - let pass = [ - ("should resolve a not aliased module 1", "a", "/a/index"), - ("should resolve a not aliased module 2", "a/index", "/a/index"), - ("should resolve a not aliased module 3", "a/dir", "/a/dir/index"), - ("should resolve a not aliased module 4", "a/dir/index", "/a/dir/index"), - ("should resolve an fallback module 1", "aliasA", "/a/index"), - ("should resolve an fallback module 2", "aliasA/index", "/a/index"), - ("should resolve an fallback module 3", "aliasA/dir", "/a/dir/index"), - ("should resolve an fallback module 4", "aliasA/dir/index", "/a/dir/index"), - ("should resolve a recursive aliased module 1", "recursive", "/recursive/index"), - ("should resolve a recursive aliased module 2", "recursive/index", "/recursive/index"), - ("should resolve a recursive aliased module 3", "recursive/dir", "/recursive/dir/index"), - ("should resolve a recursive aliased module 4", "recursive/dir/index", "/recursive/dir/index"), - ("should resolve a recursive aliased module 5", "recursive/file", "/recursive/dir/file"), - ("should resolve a file aliased module with a query 1", "b?query", "/b/index?query"), - ("should resolve a file aliased module with a query 2", "c?query", "/c/index?query"), - ("should resolve a path in a file aliased module 1", "b/index", "/b/index"), - ("should resolve a path in a file aliased module 2", "b/dir", "/b/dir/index"), - ("should resolve a path in a file aliased module 3", "b/dir/index", "/b/dir/index"), - ("should resolve a path in a file aliased module 4", "c/index", "/c/index"), - ("should resolve a path in a file aliased module 5", "c/dir", "/c/dir/index"), - ("should resolve a path in a file aliased module 6", "c/dir/index", "/c/dir/index"), - ("should resolve a file in multiple aliased dirs 1", "multiAlias/dir/file", "/e/dir/file"), - ("should resolve a file in multiple aliased dirs 2", "multiAlias/anotherDir", "/e/anotherDir/index"), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - - #[rustfmt::skip] - let ignore = [ - ("should resolve an ignore module", "ignored", ResolveError::Ignored(f.join("ignored"))), - ("should resolve node: builtin module", "node:path", ResolveError::Ignored(PathBuf::from("/node:path"))), - ]; - - for (comment, request, expected) in ignore { - let resolution = resolver.resolve(f, request); - assert_eq!(resolution, Err(expected), "{comment} {request}"); - } -} diff --git a/src/tests/full_specified.rs b/src/tests/full_specified.rs deleted file mode 100644 index a70c0191..00000000 --- a/src/tests/full_specified.rs +++ /dev/null @@ -1,113 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/fullSpecified.test.js - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows { - use std::path::PathBuf; - - use crate::{AliasValue, ResolveOptions, ResolverGeneric}; - - use super::super::memory_fs::MemoryFS; - - fn file_system() -> MemoryFS { - MemoryFS::new(&[ - ("/a/node_modules/package1/index.js", ""), - ("/a/node_modules/package1/file.js", ""), - ("/a/node_modules/package2/package.json", r#"{"main":"a"}"#), - ("/a/node_modules/package2/a.js", ""), - ("/a/node_modules/package3/package.json", r#"{"main":"dir"}"#), - ("/a/node_modules/package3/dir/index.js", ""), - ("/a/node_modules/package4/package.json", r#"{"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", ""), - ]) - } - - #[test] - fn test() { - let file_system = file_system(); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - alias: vec![ - ("alias1".into(), vec![AliasValue::from("/a/abc")]), - ("alias2".into(), vec![AliasValue::from("/a")]), - ], - alias_fields: vec![vec!["browser".into()]], - fully_specified: true, - ..ResolveOptions::default() - }, - ); - - let failing_resolves = [ - ("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"), - ]; - - for (comment, request) in failing_resolves { - let resolution = resolver.resolve("/a", request); - assert!(resolution.is_err(), "{comment} {request}"); - } - - let successful_resolves = [ - ("fully relative", "./abc.js", "/a/abc.js"), - ("fully absolute", "/a/abc.js", "/a/abc.js"), - ("fully relative in package", "package1/file.js", "/a/node_modules/package1/file.js"), - ("extensions in mainFiles", "package1", "/a/node_modules/package1/index.js"), - ("extensions in mainFields", "package2", "/a/node_modules/package2/a.js"), - ("extensions in alias", "alias1", "/a/abc.js"), - ("directories in alias", "alias2", "/a/index.js"), - ("directories in packages", "package3", "/a/node_modules/package3/dir/index.js"), - ("extensions in aliasFields", "package4/a.js", "/a/node_modules/package4/b.js"), - ]; - - for (comment, request, expected) in successful_resolves { - let resolution = resolver.resolve("/a", request).map(|r| r.full_path()); - assert_eq!(resolution, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - } - - #[test] - #[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. - fn resolve_to_context() { - let file_system = file_system(); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - alias: vec![ - ("alias1".into(), vec![AliasValue::from("/a/abc")]), - ("alias2".into(), vec![AliasValue::from("/a")]), - ], - alias_fields: vec![vec!["browser".into()]], - fully_specified: true, - resolve_to_context: true, - ..ResolveOptions::default() - }, - ); - - let successful_resolves = [ - ("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", "/a/node_modules/package3/dir"), - ]; - - for (comment, request, expected) in successful_resolves { - let resolution = resolver.resolve("/a", request).map(|r| r.full_path()); - assert_eq!(resolution, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - } -} diff --git a/src/tests/imports_field.rs b/src/tests/imports_field.rs deleted file mode 100644 index c928627a..00000000 --- a/src/tests/imports_field.rs +++ /dev/null @@ -1,1320 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/importsField.test.js -//! -//! The huge imports field test cases are at the bottom of this file. - -use serde_json::json; - -use crate::{Ctx, JSONMap, PathUtil, ResolveError, ResolveOptions, Resolver}; -use std::path::Path; - -#[test] -fn test_simple() { - let f = super::fixture().join("imports-field"); - let f2 = super::fixture().join("imports-exports-wildcard/node_modules/m/"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve using imports field instead of self-referencing", f.clone(), "#imports-field", f.join("b.js")), - ("should resolve using imports field instead of self-referencing for a subpath", f.join("dir"), "#imports-field", f.join("b.js")), - ("should resolve package #1", f.clone(), "#a/dist/main.js", f.join("node_modules/a/lib/lib2/main.js")), - ("should resolve package #3", f.clone(), "#ccc/index.js", f.join("node_modules/c/index.js")), - ("should resolve package #4", f.clone(), "#c", f.join("node_modules/c/index.js")), - ("should resolve with wildcard pattern", f2.clone(), "#internal/i.js", f2.join("src/internal/i.js")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } - - // Note added: - // * should resolve absolute path as an imports field target - // * should log the correct info - - #[rustfmt::skip] - let fail = [ - ("should disallow resolve out of package scope", f.clone(), "#b", ResolveError::InvalidPackageTarget("../b.js".to_string(), "#b".to_string(), f.join("package.json"))), - ("should resolve package #2", f.clone(), "#a", ResolveError::PackageImportNotDefined("#a".to_string(), f.join("package.json"))), - ]; - - for (comment, path, request, error) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!(resolution, Err(error), "{comment} {path:?} {request}"); - } -} - -#[test] -fn shared_resolvers() { - let f = super::fixture().join("imports-field"); - - // field name #1 - let resolver1 = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - imports_fields: vec![vec!["imports".into()]], - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - let resolved_path = resolver1.resolve(&f, "#imports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("b.js"))); - - // field name #2 - let resolver2 = resolver1.clone_with_options(ResolveOptions { - imports_fields: vec![vec!["other".into(), "imports".into()]], - ..ResolveOptions::default() - }); - - let resolved_path = resolver2.resolve(&f, "#b").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("a.js"))); -} - -// Small script for generating the test cases from enhanced_resolve -// for (c of testCases) { -// console.log("TestCase {") -// console.log(`name: ${JSON.stringify(c.name)},`) -// if (c.expect instanceof Error) { -// console.log(`expect: None,`) -// } else { -// console.log(`expect: Some(vec!${JSON.stringify(c.expect)}),`) -// } -// console.log(`imports_field: imports_field(json!(${JSON.stringify(c.suite[0], null, 2)})),`) -// console.log(`request: "${c.suite[1]}",`) -// console.log(`condition_names: vec!${JSON.stringify(c.suite[2])},`) -// console.log("},") -// } - -struct TestCase { - name: &'static str, - expect: Option>, - imports_field: JSONMap, - request: &'static str, - condition_names: Vec<&'static str>, -} - -#[allow(clippy::needless_pass_by_value)] -fn imports_field(value: serde_json::Value) -> JSONMap { - let s = serde_json::to_string(&value).unwrap(); - serde_json::from_str(&s).unwrap() -} - -#[test] -fn test_cases() { - let test_cases = [ - TestCase { - name: "sample #1", - expect: Some(vec!["./dist/test/file.js"]), - imports_field: imports_field(json!({ - "#abc/": { - "import": [ - "./dist/", - "./src/" - ], - "webpack": "./wp/" - }, - "#abc": "./main.js" - })), - request: "#abc/test/file.js", - condition_names: vec!["import", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "sample #1", - expect: Some(vec!["./src/test/file.js"]), - imports_field: imports_field(json!({ - "#abc/": { - "import": [ - "./src/" - ], - "webpack": "./wp/" - }, - "#abc": "./main.js" - })), - request: "#abc/test/file.js", - condition_names: vec!["import", "webpack"], - }, - TestCase { - name: "sample #2", - expect: Some(vec!["./data/timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#1/timezones/": "./data/timezones/" - })), - request: "#1/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #3", - expect: Some(vec!["./data/timezones/timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#aaa/": "./data/timezones/", - "#a/": "./data/timezones/" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #4", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/lib/": { - "browser": [ - "./browser/" - ] - }, - "#a/dist/index.js": { - "node": "./index.js" - } - })), - request: "#a/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #5", - expect: Some(vec!["./browser/index.js"]), - imports_field: imports_field(json!({ - "#a/lib/": { - "browser": [ - "./browser/" - ] - }, - "#a/dist/index.js": { - "node": "./index.js", - "default": "./browser/index.js" - } - })), - request: "#a/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #6", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/dist/a": "./dist/index.js" - })), - request: "#a/dist/aaa", - condition_names: vec![], - }, - TestCase { - name: "sample #7", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/a/a/": "./dist/index.js" - })), - request: "#a/a/a", - condition_names: vec![], - }, - TestCase { - name: "sample #8", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": "./index.js" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #9", - expect: Some(vec!["./main.js"]), - imports_field: imports_field(json!({ - "#a/index.js": "./main.js" - })), - request: "#a/index.js", - condition_names: vec![], - }, - TestCase { - name: "sample #10", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #11", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/bar#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #12", - expect: Some(vec!["./ok.js#abc"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/ok.js#abc", - condition_names: vec![], - }, - TestCase { - name: "sample #13", - expect: Some(vec!["./ok.js?abc"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/ok.js?abc", - condition_names: vec![], - }, - TestCase { - name: "sample #14", - expect: Some(vec!["./🎉.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/🎉.js", - condition_names: vec![], - }, - TestCase { - name: "sample #15", - expect: Some(vec!["./%F0%9F%8E%89.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/%F0%9F%8E%89.js", - condition_names: vec![], - }, - TestCase { - name: "sample #16", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/🎉", - condition_names: vec![], - }, - TestCase { - name: "sample #17", - expect: Some(vec!["./other.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/%F0%9F%8E%89", - condition_names: vec![], - }, - TestCase { - name: "sample #18", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/module", - condition_names: vec![], - }, - TestCase { - name: "sample #19", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/module#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #20", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/module?foo", - condition_names: vec![], - }, - TestCase { - name: "sample #21", - expect: Some(vec!["./d?e?f"]), - imports_field: imports_field(json!({ - "#a/a?b?c/": "./" - })), - request: "#a/a?b?c/d?e?f", - condition_names: vec![], - }, - TestCase { - name: "sample #22", - // We throw InvalidPackageTarget - expect: None, - // expect: Some(vec!["/user/a/index"]), - imports_field: imports_field(json!({ - "#a/": "/user/a/" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #1", - expect: Some(vec!["./A/b/d.js"]), - imports_field: imports_field(json!({ - "#a/": "./A/", - "#a/b/c": "./c.js" - })), - request: "#a/b/d.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #2", - expect: Some(vec!["./A/c.js"]), - imports_field: imports_field(json!({ - "#a/": "./A/", - "#a/b": "./b.js" - })), - request: "#a/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #3", - expect: Some(vec!["./A/b/c/d.js"]), - imports_field: imports_field(json!({ - "#a/": "./A/", - "#a/b/c/d": "./c.js" - })), - request: "#a/b/c/d.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #1", - expect: Some(vec!["./dist/index.js"]), - imports_field: imports_field(json!({ - "#a": "./dist/index.js" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #2", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": "./" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #3", - expect: Some(vec!["./dist/a.js"]), - imports_field: imports_field(json!({ - "#a/": "./dist/", - "#a/index.js": "./dist/a.js" - })), - request: "#a/index.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #4", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "./browser/" - ] - }, - "#a/index.js": { - "browser": "./index.js" - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #5", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "./browser/" - ] - }, - "#a/index.js": { - "node": "./node.js" - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #6", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: "#a", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #7", - expect: Some(vec!["./src/index.js"]), // `enhanced_resolve` is `None` - imports_field: imports_field(json!({ - "#a": { - "default": "./src/index.js", - "browser": "./index.js", - "node": "./src/node/index.js" - } - })), - request: "#a", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #8", - expect: Some(vec!["./src/index.js"]), - imports_field: imports_field(json!({ - "#a": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #9", - expect: Some(vec!["./index"]), - imports_field: imports_field(json!({ - "#a": "./index" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #10", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/index": "./index.js" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #11", - // We throw InvalidPackageTarget - // expect: Some(vec!["b"]), - expect: None, - imports_field: imports_field(json!({ - "#a": "b" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #12", - // We throw InvalidPackageTarget - // expect: Some(vec!["b/index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "b/" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #13", - // We throw InvalidPackageTarget - // expect: Some(vec!["b#anotherhashishere"]), - expect: None, - imports_field: imports_field(json!({ - "#a?q=a#hashishere": "b#anotherhashishere" - })), - request: "#a?q=a#hashishere", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #1", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #2", - expect: Some(vec!["./import.mjs"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec!["import"], - }, - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./require.js"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./import.mjs"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./require.js"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": [ - "./require.js" - ] - }, - { - "import": [ - "./import.mjs", - "#b/import.js" - ] - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./import.mjs"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "./import.mjs", - "#b/import.js" - ] - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "#b/import.js" - ] - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "mapping to a folder root #1", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#timezones": "./data/timezones/" - })), - request: "#timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #2", - expect: None, - imports_field: imports_field(json!({ - "#timezones/": "./data/timezones" - })), - request: "#timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #3", - expect: Some(vec!["./data/timezones/pdt/index.mjs"]), - imports_field: imports_field(json!({ - "#timezones/pdt/": "./data/timezones/pdt/" - })), - request: "#timezones/pdt/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #4", - expect: Some(vec!["./timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#a/": "./timezones/" - })), - request: "#a/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #5", - expect: Some(vec!["./timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#a/": "./" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #6", - expect: None, - imports_field: imports_field(json!({ - "#a/": "." - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #7", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": "./" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #1", - expect: Some(vec!["./lib/index.mjs"]), - imports_field: imports_field(json!({ - "#a/": "./", - "#a/dist/": "./lib/" - })), - request: "#a/dist/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #2", - expect: Some(vec!["./dist/utils/index.js"]), - imports_field: imports_field(json!({ - "#a/dist/utils/": "./dist/utils/", - "#a/dist/": "./lib/" - })), - request: "#a/dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #3", - expect: Some(vec!["./dist/utils/index.js"]), - imports_field: imports_field(json!({ - "#a/dist/utils/index.js": "./dist/utils/index.js", - "#a/dist/utils/": "./dist/utils/index.mjs", - "#a/dist/": "./lib/" - })), - request: "#a/dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #4", - expect: Some(vec!["./lib/index.mjs"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./browser/" - }, - "#a/dist/": "./lib/" - })), - request: "#a/dist/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #1", - // This behaves differently from enhanced_resolve, because `lodash/` is an an InvalidPackageConfig - // expect: Some(vec!["lodash/index.js"]), - expect: Some(vec!["./utils/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "conditional mapping folder #1", - expect: Some(vec!["./utils/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #2", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./node/" - ] - } - })), - request: "#a/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "conditional mapping folder #3", - expect: Some(vec!["./wpk/index.mjs"]), - imports_field: imports_field(json!({ - "#a/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils/" - ] - } - })), - request: "#a/index.mjs", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "incorrect exports field #1", - // We throw `PackageImportNotDefined` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "/utils/": "./a/" - })), - request: "#a/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #2", - // We throw `PackageImportNotDefined` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "/utils/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#a/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #3", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index": "./a/index.js" - })), - request: "#a/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #4", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index.mjs": "./a/index.js" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #5", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "#a/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #6", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index.mjs": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "#a/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #1", - // We don't throw in `package_imports_exports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": "./a/" - })), - request: "/utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect request #2", - // We don't throw in `package_imports_exports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #3", - // We don't throw in `package_imports_exports_resolve`, it's thrown in `package_imports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #4", - // We don't throw in `package_imports_exports_resolve`, it's thrown in `package_imports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#/", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #5", - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#a/", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #1", - // expect: Some(vec!["./dist/index"]), - expect: Some(vec!["dist/index"]), - imports_field: imports_field(json!({ - "#a/../../utils/": "./dist/" - })), - request: "#a/../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #2", - // We throw InvalidPackageTarget - // expect: Some(vec!["./dist/../../utils/index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "./dist/" - })), - request: "#a/../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #3", - // We throw InvalidPackageTarget - // expect: Some(vec!["../src/index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "../src/" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #4", - // We throw InvalidPackageTarget - // expect: Some(vec!["./utils/../../../index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": { - "browser": "./utils/../../../" - } - })), - request: "#a/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #1", - // expect: Some(vec!["moment/node_modules/lodash/dist/index.js"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": { - "browser": "moment/node_modules/" - } - })), - request: "#a/lodash/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #2", - // We throw InvalidPackageTarget - // expect: Some(vec!["../node_modules/lodash/dist/index.js"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "../node_modules/" - })), - request: "#a/lodash/dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "nested mapping #1", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": "./", - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./node/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "nested mapping #3", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["webpack"], - }, - TestCase { - name: "nested mapping #4", - // We throw NotFound - // expect: Some(vec!["moment/node/index.js"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "moment/node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["node", "browser"], - }, - TestCase { - name: "nested mapping #5", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "node"], - }, - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./node/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - TestCase { - name: "nested mapping #7", - expect: Some(vec!["./y.js"]), - imports_field: imports_field(json!({ - "#a": { - "abc": { - "def": "./x.js" - }, - "ghi": "./y.js" - } - })), - request: "#a", - condition_names: vec!["abc", "ghi"], - }, - TestCase { - name: "nested mapping #8", - // We throw PackageImportNotDefined - // expect: Some(vec![]), - expect: None, - imports_field: imports_field(json!({ - "#a": { - "abc": { - "def": "./x.js", - "default": [] - }, - "ghi": "./y.js" - } - })), - request: "#a", - condition_names: vec!["abc", "ghi"], - }, - ]; - - for case in test_cases { - let resolved = Resolver::default() - .package_imports_exports_resolve( - case.request, - &case.imports_field, - Path::new(""), - true, - &case.condition_names.iter().map(ToString::to_string).collect::>(), - &mut Ctx::default(), - ) - .map(|p| p.map(|p| p.to_path_buf())); - if let Some(expect) = case.expect { - if expect.is_empty() { - assert!(matches!(resolved, Ok(None)), "{} {:?}", &case.name, &resolved); - } else { - for expect in expect { - assert_eq!(resolved, Ok(Some(Path::new(expect).normalize())), "{}", &case.name); - } - } - } else { - assert!(resolved.is_err(), "{} {resolved:?}", &case.name); - } - } -} diff --git a/src/tests/incorrect_description_file.rs b/src/tests/incorrect_description_file.rs deleted file mode 100644 index a5c81796..00000000 --- a/src/tests/incorrect_description_file.rs +++ /dev/null @@ -1,62 +0,0 @@ -//! - -use rustc_hash::FxHashSet; - -use crate::{JSONError, Resolution, ResolveContext, ResolveError, ResolveOptions, Resolver}; - -// should not resolve main in incorrect description file #1 -#[test] -fn incorrect_description_file_1() { - let f = super::fixture().join("incorrect-package"); - let mut ctx = ResolveContext::default(); - let resolution = Resolver::default().resolve_with_context(f.join("pack1"), ".", &mut ctx); - let error = ResolveError::JSON(JSONError { - path: f.join("pack1/package.json"), - message: String::from("EOF while parsing a value at line 3 column 0"), - line: 3, - column: 0, - }); - assert_eq!(resolution, Err(error)); - assert_eq!(ctx.file_dependencies, FxHashSet::from_iter([f.join("pack1/package.json")])); - assert!(ctx.missing_dependencies.is_empty()); -} - -// should not resolve main in incorrect description file #2 -#[test] -fn incorrect_description_file_2() { - let f = super::fixture().join("incorrect-package"); - let resolution = Resolver::default().resolve(f.join("pack2"), "."); - let error = ResolveError::JSON(JSONError { - path: f.join("pack2/package.json"), - message: String::from("EOF while parsing a value at line 1 column 0"), - line: 1, - column: 0, - }); - assert_eq!(resolution, Err(error)); -} - -// should not resolve main in incorrect description file #3 -#[test] -fn incorrect_description_file_3() { - let f = super::fixture().join("incorrect-package"); - let resolution = Resolver::default().resolve(f.join("pack2"), "."); - assert!(resolution.is_err()); -} - -// `enhanced_resolve` does not have this test case -#[test] -fn no_description_file() { - let f = super::fixture_root().join("enhanced_resolve"); - - // has description file - let resolver = Resolver::default(); - assert_eq!( - resolver.resolve(&f, ".").map(Resolution::into_path_buf), - Ok(f.join("lib/index.js")) - ); - - // without description file - let resolver = - Resolver::new(ResolveOptions { description_files: vec![], ..ResolveOptions::default() }); - assert_eq!(resolver.resolve(&f, "."), Err(ResolveError::NotFound(".".into()))); -} diff --git a/src/tests/main_field.rs b/src/tests/main_field.rs deleted file mode 100644 index 3cadc8ce..00000000 --- a/src/tests/main_field.rs +++ /dev/null @@ -1,24 +0,0 @@ -//! Not part of enhanced_resolve's test suite - -use crate::{ResolveOptions, Resolver}; - -#[test] -fn test() { - let f = super::fixture().join("restrictions"); - - let resolver1 = Resolver::new(ResolveOptions { - main_fields: vec!["style".into()], - ..ResolveOptions::default() - }); - - let resolution = resolver1.resolve(&f, "pck2").map(|r| r.full_path()); - assert_eq!(resolution, Ok(f.join("node_modules/pck2/index.css"))); - - let resolver2 = resolver1.clone_with_options(ResolveOptions { - main_fields: vec!["module".into(), "main".into()], - ..ResolveOptions::default() - }); - - let resolution = resolver2.resolve(&f, "pck2").map(|r| r.full_path()); - assert_eq!(resolution, Ok(f.join("node_modules/pck2/module.js"))); -} diff --git a/src/tests/memory_fs.rs b/src/tests/memory_fs.rs deleted file mode 100644 index e4116609..00000000 --- a/src/tests/memory_fs.rs +++ /dev/null @@ -1,74 +0,0 @@ -use std::{ - io, - path::{Path, PathBuf}, -}; - -use crate::{FileMetadata, FileSystem}; - -#[derive(Default)] -pub struct MemoryFS { - fs: vfs::MemoryFS, -} - -impl MemoryFS { - /// # Panics - /// - /// * Fails to create directory - /// * Fails to write file - #[allow(dead_code)] - pub fn new(data: &[(&'static str, &'static str)]) -> Self { - let mut fs = Self { fs: vfs::MemoryFS::default() }; - for (path, content) in data { - fs.add_file(Path::new(path), content); - } - fs - } - - #[allow(dead_code)] - pub fn add_file(&mut self, path: &Path, content: &str) { - use vfs::FileSystem; - let fs = &mut self.fs; - // Create all parent directories - for path in path.ancestors().collect::>().iter().rev() { - let path = path.to_string_lossy(); - if !fs.exists(path.as_ref()).unwrap() { - fs.create_dir(path.as_ref()).unwrap(); - } - } - // Create file - let mut file = fs.create_file(path.to_string_lossy().as_ref()).unwrap(); - file.write_all(content.as_bytes()).unwrap(); - } -} - -impl FileSystem for MemoryFS { - fn read_to_string(&self, path: &Path) -> io::Result { - use vfs::FileSystem; - let mut file = self - .fs - .open_file(path.to_string_lossy().as_ref()) - .map_err(|err| io::Error::new(io::ErrorKind::NotFound, err))?; - let mut buffer = String::new(); - file.read_to_string(&mut buffer).unwrap(); - Ok(buffer) - } - - fn metadata(&self, path: &Path) -> io::Result { - use vfs::FileSystem; - let metadata = self - .fs - .metadata(path.to_string_lossy().as_ref()) - .map_err(|err| io::Error::new(io::ErrorKind::NotFound, err))?; - let is_file = metadata.file_type == vfs::VfsFileType::File; - let is_dir = metadata.file_type == vfs::VfsFileType::Directory; - Ok(FileMetadata::new(is_file, is_dir, false)) - } - - fn symlink_metadata(&self, path: &Path) -> io::Result { - self.metadata(path) - } - - fn canonicalize(&self, _path: &Path) -> io::Result { - Err(io::Error::new(io::ErrorKind::NotFound, "not a symlink")) - } -} diff --git a/src/tests/missing.rs b/src/tests/missing.rs deleted file mode 100644 index 4bf611ef..00000000 --- a/src/tests/missing.rs +++ /dev/null @@ -1,106 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/missing.test.js - -use normalize_path::NormalizePath; - -use crate::{AliasValue, ResolveContext, ResolveOptions, Resolver}; - -#[test] -fn test() { - let f = super::fixture(); - - let data = [ - ( - "./missing-file", - vec![f.join("missing-file"), f.join("missing-file.js"), f.join("missing-file.node")], - ), - ( - "missing-module", - vec![ - f.join("node_modules/missing-module"), - f.parent().unwrap().join("node_modules"), // enhanced-resolve is "node_modules/missing-module" - ], - ), - ( - "missing-module/missing-file", - vec![ - f.join("node_modules/missing-module"), - // f.parent().unwrap().join("node_modules/missing-module"), // we don't report this - ], - ), - ( - "m1/missing-file", - vec![ - f.join("node_modules/m1/missing-file"), - f.join("node_modules/m1/missing-file.js"), - f.join("node_modules/m1/missing-file.node"), - // f.parent().unwrap().join("node_modules/m1"), // we don't report this - ], - ), - ( - "m1/", - vec![ - f.join("node_modules/m1/index"), - f.join("node_modules/m1/index.js"), - f.join("node_modules/m1/index.json"), - f.join("node_modules/m1/index.node"), - ], - ), - ("m1/a", vec![f.join("node_modules/m1/a")]), - ]; - - let resolver = Resolver::default(); - - for (specifier, missing_dependencies) in data { - let mut ctx = ResolveContext::default(); - let _ = resolver.resolve_with_context(&f, specifier, &mut ctx); - - for path in ctx.file_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - } - - for path in missing_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - assert!( - ctx.missing_dependencies.contains(&path), - "{specifier}: {path:?} not in {:?}", - &ctx.missing_dependencies - ); - } - } -} - -#[test] -fn alias_and_extensions() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias: vec![ - ( - "@scope-js/package-name/dir$".into(), - vec![AliasValue::Path(f.join("foo/index.js").to_string_lossy().to_string())], - ), - ( - "react-dom".into(), - vec![AliasValue::Path(f.join("foo/index.js").to_string_lossy().to_string())], - ), - ], - extensions: vec![".server.ts".into()], - - ..ResolveOptions::default() - }); - - let mut ctx = ResolveContext::default(); - let _ = resolver.resolve_with_context(&f, "@scope-js/package-name/dir/router", &mut ctx); - let _ = resolver.resolve_with_context(&f, "react-dom/client", &mut ctx); - - for path in ctx.file_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - } - - for path in ctx.missing_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - if let Some(path) = path.parent() { - assert!(!path.is_file(), "{path:?} must not be a file"); - } - } -} diff --git a/src/tests/mod.rs b/src/tests/mod.rs deleted file mode 100644 index 94e6bd86..00000000 --- a/src/tests/mod.rs +++ /dev/null @@ -1,49 +0,0 @@ -mod alias; -mod browser_field; -mod builtins; -mod dependencies; -mod exports_field; -mod extension_alias; -mod extensions; -mod fallback; -mod full_specified; -mod imports_field; -mod incorrect_description_file; -mod main_field; -mod memory_fs; -mod missing; -mod resolve; -mod restrictions; -mod roots; -mod scoped_packages; -mod simple; -mod symlink; -mod tsconfig_paths; -mod tsconfig_project_references; - -use crate::Resolver; -use std::{env, path::PathBuf, sync::Arc, thread}; - -pub fn fixture_root() -> PathBuf { - env::current_dir().unwrap().join("fixtures") -} - -pub fn fixture() -> PathBuf { - fixture_root().join("enhanced_resolve").join("test").join("fixtures") -} - -#[test] -fn threaded_environment() { - let cwd = env::current_dir().unwrap(); - let resolver = Arc::new(Resolver::default()); - for _ in 0..2 { - _ = thread::spawn({ - let cwd = cwd.clone(); - let resolver = Arc::clone(&resolver); - move || { - _ = resolver.resolve(cwd, "."); - } - }) - .join(); - } -} diff --git a/src/tests/resolve.rs b/src/tests/resolve.rs deleted file mode 100644 index f2dbb88e..00000000 --- a/src/tests/resolve.rs +++ /dev/null @@ -1,119 +0,0 @@ -//! - -use crate::{ResolveError, ResolveOptions, Resolver}; - -#[test] -fn resolve() { - let f = super::fixture(); - - let resolver = Resolver::default(); - - let main1_js_path = f.join("main1.js").to_string_lossy().to_string(); - - #[rustfmt::skip] - let pass = [ - ("absolute path", f.clone(), main1_js_path.as_str(), f.join("main1.js")), - ("file with .js", f.clone(), "./main1.js", f.join("main1.js")), - ("file without extension", f.clone(), "./main1", f.join("main1.js")), - ("another file with .js", f.clone(), "./a.js", f.join("a.js")), - ("another file without extension", f.clone(), "./a", f.join("a.js")), - ("file in module with .js", f.clone(), "m1/a.js", f.join("node_modules/m1/a.js")), - ("file in module without extension", f.clone(), "m1/a", f.join("node_modules/m1/a.js")), - ("another file in module without extension", f.clone(), "complexm/step1", f.join("node_modules/complexm/step1.js")), - ("from submodule to file in sibling module", f.join("node_modules/complexm"), "m2/b.js", f.join("node_modules/m2/b.js")), - ("from nested directory to overwritten file in module", f.join("multiple_modules"), "m1/a.js", f.join("multiple_modules/node_modules/m1/a.js")), - ("from nested directory to not overwritten file in module", f.join("multiple_modules"), "m1/b.js", f.join("node_modules/m1/b.js")), - ("file with query", f.clone(), "./main1.js?query", f.join("main1.js?query")), - ("file with fragment", f.clone(), "./main1.js#fragment", f.join("main1.js#fragment")), - ("file with fragment and query", f.clone(), "./main1.js#fragment?query", f.join("main1.js#fragment?query")), - ("file with query and fragment", f.clone(), "./main1.js?#fragment", f.join("main1.js?#fragment")), - - ("file with query (unicode)", f.clone(), "./测试.js?query", f.join("测试.js?query")), - ("file with fragment (unicode)", f.clone(), "./测试.js#fragment", f.join("测试.js#fragment")), - ("file with fragment and query (unicode)", f.clone(), "./测试.js#fragment?query", f.join("测试.js#fragment?query")), - ("file with query and fragment (unicode)", f.clone(), "./测试.js?#fragment", f.join("测试.js?#fragment")), - - ("file in module with query", f.clone(), "m1/a?query", f.join("node_modules/m1/a.js?query")), - ("file in module with fragment", f.clone(), "m1/a#fragment", f.join("node_modules/m1/a.js#fragment")), - ("file in module with fragment and query", f.clone(), "m1/a#fragment?query", f.join("node_modules/m1/a.js#fragment?query")), - ("file in module with query and fragment", f.clone(), "m1/a?#fragment", f.join("node_modules/m1/a.js?#fragment")), - ("file in module with query and fragment", f.clone(), "m1/a?#fragment", f.join("node_modules/m1/a.js?#fragment")), - ("differ between directory and file, resolve file", f.clone(), "./dirOrFile", f.join("dirOrFile.js")), - ("differ between directory and file, resolve directory", f.clone(), "./dirOrFile/", f.join("dirOrFile/index.js")), - ("find node_modules outside of node_modules", f.join("browser-module/node_modules"), "m1/a", f.join("node_modules/m1/a.js")), - ("don't crash on main field pointing to self", f.clone(), "./main-field-self", f.join("./main-field-self/index.js")), - ("don't crash on main field pointing to self (2)", f.clone(), "./main-field-self2", f.join("./main-field-self2/index.js")), - // enhanced-resolve has `#` prepended with a `\0`, they are removed from the - // following 3 expected test results. - // See https://github.com/webpack/enhanced-resolve#escaping - ("handle fragment edge case (no fragment)", f.clone(), "./no#fragment/#/#", f.join("no#fragment/#/#.js")), - ("handle fragment edge case (fragment)", f.clone(), "./no#fragment/#/", f.join("no.js#fragment/#/")), - ("handle fragment escaping", f.clone(), "./no\0#fragment/\0#/\0##fragment", f.join("no#fragment/#/#.js#fragment")), - - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn issue238_resolve() { - let f = super::fixture().join("issue-238"); - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into(), ".jsx".into(), ".ts".into(), ".tsx".into()], - modules: vec!["src/a".into(), "src/b".into(), "src/common".into(), "node_modules".into()], - ..ResolveOptions::default() - }); - let resolved_path = - resolver.resolve(f.join("src/common"), "config/myObjectFile").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("src/common/config/myObjectFile.js")),); -} - -#[test] -fn prefer_relative() { - let f = super::fixture(); - - let resolver = - Resolver::new(ResolveOptions { prefer_relative: true, ..ResolveOptions::default() }); - - #[rustfmt::skip] - let pass = [ - ("should correctly resolve with preferRelative 1", "main1.js", f.join("main1.js")), - ("should correctly resolve with preferRelative 2", "m1/a.js", f.join("node_modules/m1/a.js")), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } -} - -#[test] -fn resolve_to_context() { - let f = super::fixture(); - let resolver = - Resolver::new(ResolveOptions { resolve_to_context: true, ..ResolveOptions::default() }); - - #[rustfmt::skip] - let data = [ - ("context for fixtures", f.clone(), "./", f.clone()), - ("context for fixtures/lib", f.clone(), "./lib", f.join("lib")), - ("context for fixtures with ..", f.clone(), "./lib/../../fixtures/./lib/..", f.clone()), - ("context for fixtures with query", f.clone(), "./?query", f.clone().with_file_name("fixtures?query")), - ]; - - for (comment, path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn resolve_hash_as_module() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions::default()); - let resolution = resolver.resolve(f, "#a"); - assert_eq!(resolution, Err(ResolveError::NotFound("#a".into()))); -} diff --git a/src/tests/restrictions.rs b/src/tests/restrictions.rs deleted file mode 100644 index 5ba56596..00000000 --- a/src/tests/restrictions.rs +++ /dev/null @@ -1,25 +0,0 @@ -//! - -use crate::{ResolveError, ResolveOptions, Resolver, Restriction}; - -// TODO: regex -// * should respect RegExp restriction -// * should try to find alternative #1 -// * should try to find alternative #2 -// * should try to find alternative #3 - -// should respect string restriction -#[test] -fn restriction1() { - let fixture = super::fixture(); - let f = fixture.join("restrictions"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - restrictions: vec![Restriction::Path(f.clone())], - ..ResolveOptions::default() - }); - - let resolution = resolver.resolve(&f, "pck2"); - assert_eq!(resolution, Err(ResolveError::Restriction(fixture.join("c.js"), f))); -} diff --git a/src/tests/roots.rs b/src/tests/roots.rs deleted file mode 100644 index b50e2a07..00000000 --- a/src/tests/roots.rs +++ /dev/null @@ -1,92 +0,0 @@ -//! - -use std::path::PathBuf; - -use crate::{AliasValue, ResolveError, ResolveOptions, Resolver}; - -fn dirname() -> PathBuf { - super::fixture_root().join("enhanced_resolve").join("test") -} - -#[test] -fn roots() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - alias: vec![("foo".into(), vec![AliasValue::from("/fixtures")])], - roots: vec![dirname(), f.clone()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should respect roots option", "/fixtures/b.js", f.join("b.js")), - ("should try another root option, if it exists", "/b.js", f.join("b.js")), - ("should respect extension", "/fixtures/b", f.join("b.js")), - ("should resolve in directory", "/fixtures/extensions/dir", f.join("extensions/dir/index.js")), - ("should respect aliases", "foo/b", f.join("b.js")), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } - - #[rustfmt::skip] - let fail = [ - ("should not work with relative path", "fixtures/b.js", ResolveError::NotFound("fixtures/b.js".into())) - ]; - - for (comment, request, expected) in fail { - let resolution = resolver.resolve(&f, request); - assert_eq!(resolution, Err(expected), "{comment} {request}"); - } -} - -#[test] -fn resolve_to_context() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - roots: vec![dirname(), f.clone()], - resolve_to_context: true, - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f, "/fixtures/lib").map(|r| r.full_path()); - let expected = f.join("lib"); - assert_eq!(resolved_path, Ok(expected)); -} - -#[test] -fn prefer_absolute() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - alias: vec![("foo".into(), vec![AliasValue::from("/fixtures")])], - roots: vec![dirname(), f.clone()], - prefer_absolute: true, - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve an absolute path (prefer absolute)", f.join("b.js").to_string_lossy().to_string(), f.join("b.js")), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(&f, &request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } -} - -#[test] -fn roots_fall_through() { - let f = super::fixture(); - let absolute_path = f.join("roots_fall_through/index.js"); - let specifier = absolute_path.to_string_lossy(); - let resolution = Resolver::new(ResolveOptions::default().with_root(&f)).resolve(&f, &specifier); - assert_eq!( - resolution.map(super::super::resolution::Resolution::into_path_buf), - Ok(absolute_path) - ); -} diff --git a/src/tests/scoped_packages.rs b/src/tests/scoped_packages.rs deleted file mode 100644 index 8258f00f..00000000 --- a/src/tests/scoped_packages.rs +++ /dev/null @@ -1,25 +0,0 @@ -//! - -use crate::{ResolveOptions, Resolver}; - -#[test] -fn scoped_packages() { - let f = super::fixture().join("scoped"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("main field should work", f.clone(), "@scope/pack1", f.join("./node_modules/@scope/pack1/main.js")), - ("browser field should work", f.clone(), "@scope/pack2", f.join("./node_modules/@scope/pack2/main.js")), - ("folder request should work", f.clone(), "@scope/pack2/lib", f.join("./node_modules/@scope/pack2/lib/index.js")) - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} diff --git a/src/tests/simple.rs b/src/tests/simple.rs deleted file mode 100644 index 08e1238a..00000000 --- a/src/tests/simple.rs +++ /dev/null @@ -1,68 +0,0 @@ -//! - -use std::env; - -use crate::Resolver; - -#[test] -fn simple() { - // mimic `enhanced-resolve/test/simple.test.js` - let dirname = env::current_dir().unwrap().join("fixtures"); - let f = dirname.join("enhanced_resolve/test"); - - let resolver = Resolver::default(); - - let data = [ - ("direct", f.clone(), "../lib/index"), - ("as directory", f, ".."), - ("as module", dirname.clone(), "./enhanced_resolve"), - ]; - - for (comment, path, request) in data { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - let expected = dirname.join("enhanced_resolve/lib/index.js"); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn dashed_name() { - let f = super::fixture(); - - let resolver = Resolver::default(); - - let data = [ - (f.clone(), "dash", f.join("node_modules/dash/index.js")), - (f.clone(), "dash-name", f.join("node_modules/dash-name/index.js")), - (f.join("node_modules/dash"), "dash", f.join("node_modules/dash/index.js")), - (f.join("node_modules/dash"), "dash-name", f.join("node_modules/dash-name/index.js")), - (f.join("node_modules/dash-name"), "dash", f.join("node_modules/dash/index.js")), - (f.join("node_modules/dash-name"), "dash-name", f.join("node_modules/dash-name/index.js")), - ]; - - for (path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{path:?} {request}"); - } -} - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows { - use super::super::memory_fs::MemoryFS; - - use crate::ResolveOptions; - - #[test] - fn no_package() { - use crate::ResolverGeneric; - use std::path::Path; - let f = Path::new("/"); - let file_system = MemoryFS::new(&[]); - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions::default(), - ); - let resolved_path = resolver.resolve(f, "package"); - assert!(resolved_path.is_err()); - } -} diff --git a/src/tests/symlink.rs b/src/tests/symlink.rs deleted file mode 100644 index 7589b560..00000000 --- a/src/tests/symlink.rs +++ /dev/null @@ -1,121 +0,0 @@ -use std::{fs, io, path::Path}; - -use crate::{ResolveOptions, Resolver}; - -#[derive(Debug, Clone, Copy)] -enum FileType { - File, - Dir, -} - -#[allow(unused_variables)] -fn symlink, Q: AsRef>( - original: P, - link: Q, - file_type: FileType, -) -> io::Result<()> { - #[cfg(target_family = "unix")] - { - std::os::unix::fs::symlink(original, link) - } - - #[cfg(target_family = "windows")] - match file_type { - FileType::File => std::os::windows::fs::symlink_file(original, link), - FileType::Dir => std::os::windows::fs::symlink_dir(original, link), - } -} - -fn init(dirname: &Path, temp_path: &Path) -> io::Result<()> { - if temp_path.exists() { - _ = fs::remove_dir_all(temp_path); - } - fs::create_dir(temp_path)?; - symlink(dirname.join("../lib/index.js"), temp_path.join("test"), FileType::File)?; - symlink(dirname.join("../lib"), temp_path.join("test2"), FileType::Dir)?; - fs::remove_file(temp_path.join("test"))?; - fs::remove_file(temp_path.join("test2"))?; - fs::remove_dir(temp_path) -} - -fn create_symlinks(dirname: &Path, temp_path: &Path) -> io::Result<()> { - fs::create_dir(temp_path).unwrap(); - symlink( - dirname.join("../lib/index.js").canonicalize().unwrap(), - temp_path.join("index.js"), - FileType::File, - )?; - symlink(dirname.join("../lib").canonicalize().unwrap(), temp_path.join("lib"), FileType::Dir)?; - symlink(dirname.join("..").canonicalize().unwrap(), temp_path.join("this"), FileType::Dir)?; - symlink(temp_path.join("this"), temp_path.join("that"), FileType::Dir)?; - symlink(Path::new("../../lib/index.js"), temp_path.join("node.relative.js"), FileType::File)?; - symlink( - Path::new("./node.relative.js"), - temp_path.join("node.relative.sym.js"), - FileType::File, - )?; - Ok(()) -} - -fn cleanup_symlinks(temp_path: &Path) { - _ = fs::remove_dir_all(temp_path); -} - -#[test] -fn test() -> io::Result<()> { - let root = super::fixture_root().join("enhanced_resolve"); - let dirname = root.join("test"); - let temp_path = dirname.join("temp"); - if !temp_path.exists() { - let is_admin = init(&dirname, &temp_path).is_ok(); - if !is_admin { - return Ok(()); - } - if let Err(err) = create_symlinks(&dirname, &temp_path) { - cleanup_symlinks(&temp_path); - return Err(err); - } - } - - let resolver_without_symlinks = - Resolver::new(ResolveOptions { symlinks: false, ..ResolveOptions::default() }); - let resolver_with_symlinks = Resolver::default(); - - #[rustfmt::skip] - let pass = [ - ("with a symlink to a file", temp_path.clone(), "./index.js"), - ("with a relative symlink to a file", temp_path.clone(), "./node.relative.js"), - ("with a relative symlink to a symlink to a file", temp_path.clone(), "./node.relative.sym.js"), - ("with a symlink to a directory 1", temp_path.clone(), "./lib/index.js"), - ("with a symlink to a directory 2", temp_path.clone(), "./this/lib/index.js"), - ("with multiple symlinks in the path 1", temp_path.clone(), "./this/test/temp/index.js"), - ("with multiple symlinks in the path 2", temp_path.clone(), "./this/test/temp/lib/index.js"), - ("with multiple symlinks in the path 3", temp_path.clone(), "./this/test/temp/this/lib/index.js"), - ("with a symlink to a directory 2 (chained)", temp_path.clone(), "./that/lib/index.js"), - ("with multiple symlinks in the path 1 (chained)", temp_path.clone(), "./that/test/temp/index.js"), - ("with multiple symlinks in the path 2 (chained)", temp_path.clone(), "./that/test/temp/lib/index.js"), - ("with multiple symlinks in the path 3 (chained)", temp_path.clone(), "./that/test/temp/that/lib/index.js"), - ("with symlinked directory as context 1", temp_path.join( "lib"), "./index.js"), - ("with symlinked directory as context 2", temp_path.join( "this"), "./lib/index.js"), - ("with symlinked directory as context and in path", temp_path.join( "this"), "./test/temp/lib/index.js"), - ("with symlinked directory in context path", temp_path.join( "this/lib"), "./index.js"), - ("with symlinked directory in context path and symlinked file", temp_path.join( "this/test"), "./temp/index.js"), - ("with symlinked directory in context path and symlinked directory", temp_path.join( "this/test"), "./temp/lib/index.js"), - ("with symlinked directory as context 2 (chained)", temp_path.join( "that"), "./lib/index.js"), - ("with symlinked directory as context and in path (chained)", temp_path.join( "that"), "./test/temp/lib/index.js"), - ("with symlinked directory in context path (chained)", temp_path.join( "that/lib"), "./index.js"), - ("with symlinked directory in context path and symlinked file (chained)", temp_path.join( "that/test"), "./temp/index.js"), - ("with symlinked directory in context path and symlinked directory (chained)", temp_path.join( "that/test"), "./temp/lib/index.js") - ]; - - for (comment, path, request) in pass { - let filename = resolver_with_symlinks.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(filename, Ok(root.join("lib/index.js")), "{comment:?}"); - - let resolved_path = - resolver_without_symlinks.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(path.join(request))); - } - - Ok(()) -} diff --git a/src/tests/tsconfig_paths.rs b/src/tests/tsconfig_paths.rs deleted file mode 100644 index 26935b5c..00000000 --- a/src/tests/tsconfig_paths.rs +++ /dev/null @@ -1,507 +0,0 @@ -//! tests for tsconfig-paths -//! -//! Fixtures copied from . - -use std::path::{Path, PathBuf}; - -use crate::{ - ResolveError, ResolveOptions, Resolver, TsConfig, TsconfigOptions, TsconfigReferences, -}; - -// -#[test] -fn tsconfig() { - let f = super::fixture_root().join("tsconfig"); - - #[rustfmt::skip] - let pass = [ - (f.clone(), None, "ts-path", f.join("foo.js")), - (f.join("nested"), None, "ts-path", f.join("nested/test.js")), - (f.join("cases/index"), None, "foo", f.join("node_modules/tsconfig-index/foo.js")), - // This requires reading package.json.tsconfig field - // (f.join("cases/field"), "foo", f.join("node_modules/tsconfig-field/foo.js")) - (f.join("cases/exports"), None, "foo", f.join("node_modules/tsconfig-exports/foo.js")), - (f.join("cases/extends-extension"), None, "foo", f.join("cases/extends-extension/foo.js")), - (f.join("cases/extends-extensionless"), None, "foo", f.join("node_modules/tsconfig-field/foo.js")), - (f.join("cases/extends-paths"), Some("src"), "@/index", f.join("cases/extends-paths/src/index.js")), - (f.join("cases/extends-multiple"), None, "foo", f.join("cases/extends-multiple/foo.js")), - ]; - - for (dir, subdir, request, expected) in pass { - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: dir.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - let path = subdir.map_or(dir.clone(), |subdir| dir.join(subdir)); - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{request} {path:?}"); - } - - #[rustfmt::skip] - let data = [ - (f.join("node_modules/tsconfig-not-used"), "ts-path", Ok(f.join("foo.js"))), - ]; - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - for (path, request, expected) in data { - let resolution = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolution, expected, "{path:?} {request}"); - } -} - -#[test] -fn tsconfig_fallthrough() { - let f = super::fixture_root().join("tsconfig"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "/"); - assert_eq!(resolved_path, Err(ResolveError::NotFound("/".into()))); -} - -#[test] -fn json_with_comments() { - let f = super::fixture_root().join("tsconfig/cases/trailing-comma"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "foo").map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(f.join("bar.js"))); -} - -// -#[test] -fn test_paths() { - let path = Path::new("/foo/tsconfig.json"); - let mut tsconfig_json = serde_json::json!({ - "compilerOptions": { - "paths": { - "jquery": ["node_modules/jquery/dist/jquery"], - "*": ["generated/*"], - "bar/*": ["test/*"], - "bar/baz/*": ["baz/*", "yo/*"], - "@/components/*": ["components/*"], - "url": ["node_modules/my-url"], - } - } - }) - .to_string(); - let tsconfig = TsConfig::parse(true, path, &mut tsconfig_json).unwrap(); - - let data = [ - ("jquery", vec!["/foo/node_modules/jquery/dist/jquery"]), - ("test", vec!["/foo/generated/test"]), - ("test/hello", vec!["/foo/generated/test/hello"]), - ("bar/hi", vec!["/foo/test/hi"]), - ("bar/baz/hi", vec!["/foo/baz/hi", "/foo/yo/hi"]), - ("@/components/button", vec!["/foo/components/button"]), - ("./jquery", vec![]), - ("url", vec!["/foo/node_modules/my-url"]), - ]; - - for (specifier, expected) in data { - let paths = tsconfig.resolve_path_alias(specifier); - let expected = expected.into_iter().map(PathBuf::from).collect::>(); - assert_eq!(paths, expected, "{specifier}"); - } -} - -// -#[test] -fn test_base_url() { - let path = Path::new("/foo/tsconfig.json"); - let mut tsconfig_json = serde_json::json!({ - "compilerOptions": { - "baseUrl": "./src" - } - }) - .to_string(); - let tsconfig = TsConfig::parse(true, path, &mut tsconfig_json).unwrap(); - - let data = [ - ("foo", vec!["/foo/src/foo"]), - ("components/button", vec!["/foo/src/components/button"]), - ("./jquery", vec![]), - ]; - - for (specifier, expected) in data { - let paths = tsconfig.resolve_path_alias(specifier); - let expected = expected.into_iter().map(PathBuf::from).collect::>(); - assert_eq!(paths, expected, "{specifier}"); - } -} - -// -#[test] -fn test_paths_and_base_url() { - let path = Path::new("/foo/tsconfig.json"); - let mut tsconfig_json = serde_json::json!({ - "compilerOptions": { - "baseUrl": "./src", - "paths": { - "*": ["generated/*"], - "bar/*": ["test/*"], - "bar/baz/*": ["baz/*", "yo/*"], - "@/components/*": ["components/*"] - } - } - }) - .to_string(); - let tsconfig = TsConfig::parse(true, path, &mut tsconfig_json).unwrap(); - - let data = [ - ("test", vec!["/foo/src/generated/test", "/foo/src/test"]), - ("test/hello", vec!["/foo/src/generated/test/hello", "/foo/src/test/hello"]), - ("bar/hi", vec!["/foo/src/test/hi", "/foo/src/bar/hi"]), - ("bar/baz/hi", vec!["/foo/src/baz/hi", "/foo/src/yo/hi", "/foo/src/bar/baz/hi"]), - ("@/components/button", vec!["/foo/src/components/button", "/foo/src/@/components/button"]), - ("./jquery", vec![]), - ]; - - for (specifier, expected) in data { - let paths = tsconfig.resolve_path_alias(specifier); - let expected = expected.into_iter().map(PathBuf::from).collect::>(); - assert_eq!(paths, expected, "{specifier}"); - } -} - -// Template variable ${configDir} for substitution of config files directory path -// https://github.com/microsoft/TypeScript/pull/58042 -#[test] -fn test_template_variable() { - let f = super::fixture_root().join("tsconfig"); - let f2 = f.join("cases").join("paths_template_variable"); - - #[rustfmt::skip] - let pass = [ - (f2.clone(), "tsconfig1.json", "foo", f2.join("foo.js")), - (f2.clone(), "tsconfig2.json", "foo", f2.join("foo.js")), - (f.clone(), "tsconfig_template_variable.json", "foo", f.join("foo.js")), - ]; - - for (dir, tsconfig, request, expected) in pass { - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: dir.join(tsconfig), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&dir, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{request} {tsconfig} {dir:?}"); - } -} - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows_test { - use std::path::{Path, PathBuf}; - - use crate::{ - ResolveError, ResolveOptions, ResolverGeneric, TsconfigOptions, TsconfigReferences, - }; - - use super::super::memory_fs::MemoryFS; - - struct OneTest { - name: &'static str, - tsconfig: String, - package_json: Option<(PathBuf, String)>, - main_fields: Option>, - existing_files: Vec<&'static str>, - requested_module: &'static str, - expected_path: &'static str, - extensions: Vec, - } - - impl Default for OneTest { - fn default() -> Self { - Self { - name: "", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/*": ["location/*"] - } - } - }) - .to_string(), - package_json: None, - main_fields: None, - existing_files: vec![], - requested_module: "", - expected_path: "", - extensions: vec![ - ".js".into(), - ".json".into(), - ".node".into(), - ".ts".into(), - ".tsx".into(), - ], - } - } - } - - impl OneTest { - fn resolver(&self, root: &Path) -> ResolverGeneric { - let mut file_system = MemoryFS::default(); - - file_system.add_file(&root.join("tsconfig.json"), &self.tsconfig); - if let Some((path, package_json)) = &self.package_json { - file_system.add_file(&root.join(path).join("package.json"), package_json); - } - for path in &self.existing_files { - file_system.add_file(Path::new(path), ""); - } - - let mut options = ResolveOptions { - extensions: self.extensions.clone(), - tsconfig: Some(TsconfigOptions { - config_file: root.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }; - if let Some(main_fields) = &self.main_fields { - options.main_fields.clone_from(main_fields); - } - - ResolverGeneric::::new_with_file_system(file_system, options) - } - } - - // Path matching tests from tsconfig-paths - // * - // * - #[test] - fn match_path() { - let pass = [ - OneTest { - name: "should locate path that matches with star and exists", - existing_files: vec!["/root/location/mylib/index.ts"], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve to correct path when many are specified", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/*": ["foo1/*", "foo2/*", "location/*", "foo3/*"], - } - } - }) - .to_string(), - existing_files: vec!["/root/location/mylib/index.ts"], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should locate path that matches with star and prioritize pattern with longest prefix", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "*": ["location/*"], - "lib/*": ["location/*"], - } - } - }) - .to_string(), - existing_files: vec![ - "/root/location/lib/mylib/index.ts", - "/root/location/mylib/index.ts", - ], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should locate path that matches with star and exists with extension", - existing_files: vec![ - "/root/location/mylib.myext", - ], - requested_module: "lib/mylib", - extensions: vec![".js".into(), ".myext".into()], - expected_path: "/root/location/mylib.myext", - ..OneTest::default() - }, - OneTest { - name: "should resolve request with extension specified", - existing_files: vec![ - "/root/location/test.jpg", - ], - requested_module: "lib/test.jpg", - expected_path: "/root/location/test.jpg", - ..OneTest::default() - }, - OneTest { - name: "should locate path that matches without star and exists", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/foo": ["location/foo"] - } - } - }) - .to_string(), - existing_files: vec![ - "/root/location/foo.ts", - ], - requested_module: "lib/foo", - expected_path: "/root/location/foo.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve to parent folder when filename is in subfolder", - existing_files: vec![ - "/root/location/mylib/index.ts", - ], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve from main field in package.json", - package_json: Some((PathBuf::from("/root/location/mylib"), serde_json::json!({ - "main": "./kalle.ts" - }).to_string())), - existing_files: vec![ - "/root/location/mylib/kalle.ts", - ], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/kalle.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve from main field in package.json (js)", - package_json: Some((PathBuf::from("/root/location/mylib.js"), serde_json::json!({ - "main": "./kalle.js" - }).to_string())), - existing_files: vec![ - "/root/location/mylib.js/kalle.js", - ], - extensions: vec![".ts".into(), ".js".into()], - requested_module: "lib/mylib.js", - expected_path: "/root/location/mylib.js/kalle.js", - ..OneTest::default() - }, - OneTest { - name: "should resolve from list of fields by priority in package.json", - main_fields: Some(vec!["missing".into(), "browser".into(), "main".into()]), - package_json: Some((PathBuf::from("/root/location/mylibjs"), serde_json::json!({ - "main": "./main.js", - "browser": "./browser.js" - }).to_string())), - existing_files: vec![ - "/root/location/mylibjs/main.js", - "/root/location/mylibjs/browser.js", - ], - extensions: vec![".ts".into(), ".js".into()], - requested_module: "lib/mylibjs", - expected_path: "/root/location/mylibjs/browser.js", - ..OneTest::default() - }, -OneTest { - name: "should ignore field mappings to missing files in package.json", - main_fields: Some(vec!["browser".into(), "main".into()]), - package_json: Some((PathBuf::from("/root/location/mylibjs"), serde_json::json!({ - "main": "./kalle.js", - "browser": "./nope.js" - }).to_string())), - existing_files: vec![ - "/root/location/mylibjs/kalle.js", - ], - extensions: vec![".ts".into(), ".js".into()], - requested_module: "lib/mylibjs", - expected_path: "/root/location/mylibjs/kalle.js", - ..OneTest::default() - }, - // Tests that are not applicable: - // name: "should resolve nested main fields" - // name: "should ignore advanced field mappings in package.json" - // name: "should resolve to with the help of baseUrl when not explicitly set" - // name: "should not resolve with the help of baseUrl when asked not to" - // name: "should resolve main file with cjs file extension" - OneTest { - name: "should resolve .ts from .js alias", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "@/*": ["src/*"] - } - } - }).to_string(), - existing_files: vec![ - "/root/src/foo.ts", - ], - requested_module: "@/foo", // original data was "@/foo.ts" but I don't get why it is the case? - expected_path: "/root/src/foo.ts", // original data was "/root/src/foo" - ..OneTest::default() - }, - ]; - - let root = PathBuf::from("/root"); - - for test in pass { - let resolved_path = - test.resolver(&root).resolve(&root, test.requested_module).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(PathBuf::from(test.expected_path)), "{}", test.name); - } - - let fail = [ - OneTest { - name: "should not locate path that does not match", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/*": ["location/*"] - } - } - }) - .to_string(), - existing_files: vec!["/root/location/mylib"], - requested_module: "lib/mylibjs", - ..OneTest::default() - }, - OneTest { - name: "should not resolve typings file (index.d.ts)", - existing_files: vec!["/root/location/mylib/index.d.ts"], - requested_module: "lib/mylib", - ..OneTest::default() - }, - ]; - - for test in fail { - let resolved_path = - test.resolver(&root).resolve(&root, test.requested_module).map(|f| f.full_path()); - assert_eq!( - resolved_path, - Err(ResolveError::NotFound(test.requested_module.into())), - "{}", - test.name - ); - } - } -} diff --git a/src/tests/tsconfig_project_references.rs b/src/tests/tsconfig_project_references.rs deleted file mode 100644 index b552fefe..00000000 --- a/src/tests/tsconfig_project_references.rs +++ /dev/null @@ -1,101 +0,0 @@ -//! Tests for tsconfig project references - -use crate::{ResolveError, ResolveOptions, Resolver, TsconfigOptions, TsconfigReferences}; - -#[test] -fn auto() { - let f = super::fixture_root().join("tsconfig/cases/project_references"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("app"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - // Test normal paths alias - (f.join("app"), "@/index.ts", f.join("app/aliased/index.ts")), - (f.join("app"), "@/../index.ts", f.join("app/index.ts")), - // Test project reference - (f.join("project_a"), "@/index.ts", f.join("project_a/aliased/index.ts")), - (f.join("project_b/src"), "@/index.ts", f.join("project_b/src/aliased/index.ts")), - // Does not have paths alias - (f.join("project_a"), "./index.ts", f.join("project_a/index.ts")), - (f.join("project_c"), "./index.ts", f.join("project_c/index.ts")), - // Template variable - { - let dir = f.parent().unwrap().join("paths_template_variable"); - (dir.clone(), "foo", dir.join("foo.js")) - } - ]; - - for (path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{request} {path:?}"); - } -} - -#[test] -fn disabled() { - let f = super::fixture_root().join("tsconfig/cases/project_references"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("app"), - references: TsconfigReferences::Disabled, - }), - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - // Test normal paths alias - (f.join("app"), "@/index.ts", Ok(f.join("app/aliased/index.ts"))), - (f.join("app"), "@/../index.ts", Ok(f.join("app/index.ts"))), - // Test project reference - (f.join("project_a"), "@/index.ts", Err(ResolveError::NotFound("@/index.ts".into()))), - (f.join("project_b/src"), "@/index.ts", Err(ResolveError::NotFound("@/index.ts".into()))), - // Does not have paths alias - (f.join("project_a"), "./index.ts", Ok(f.join("project_a/index.ts"))), - (f.join("project_c"), "./index.ts", Ok(f.join("project_c/index.ts"))), - ]; - - for (path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, expected, "{request} {path:?}"); - } -} - -#[test] -fn manual() { - let f = super::fixture_root().join("tsconfig/cases/project_references"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("app"), - references: TsconfigReferences::Paths(vec!["../project_a/conf.json".into()]), - }), - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - // Test normal paths alias - (f.join("app"), "@/index.ts", Ok(f.join("app/aliased/index.ts"))), - (f.join("app"), "@/../index.ts", Ok(f.join("app/index.ts"))), - // Test project reference - (f.join("project_a"), "@/index.ts", Ok(f.join("project_a/aliased/index.ts"))), - (f.join("project_b/src"), "@/index.ts", Err(ResolveError::NotFound("@/index.ts".into()))), - // Does not have paths alias - (f.join("project_a"), "./index.ts", Ok(f.join("project_a/index.ts"))), - (f.join("project_c"), "./index.ts", Ok(f.join("project_c/index.ts"))), - ]; - - for (path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, expected, "{request} {path:?}"); - } -} diff --git a/src/tsconfig.rs b/src/tsconfig.rs deleted file mode 100644 index aa00f6e4..00000000 --- a/src/tsconfig.rs +++ /dev/null @@ -1,212 +0,0 @@ -use std::{ - path::{Path, PathBuf}, - sync::Arc, -}; - -use serde::Deserialize; -use typescript_tsconfig_json::{CompilerOptionsPathsMap, ExtendsField}; - -use crate::PathUtil; - -#[derive(Debug, Deserialize)] -#[serde(rename_all = "camelCase")] -pub struct TsConfig { - /// Whether this is the caller tsconfig. - /// Used for final template variable substitution when all configs are extended and merged. - #[serde(skip)] - root: bool, - - /// Path to `tsconfig.json`. Contains the `tsconfig.json` filename. - #[serde(skip)] - path: PathBuf, - - #[serde(default)] - pub extends: Option, - - #[serde(default)] - pub compiler_options: CompilerOptions, - - /// Bubbled up project references with a reference to their tsconfig. - #[serde(default)] - pub references: Vec, -} - -/// Compiler Options -/// -/// -#[derive(Debug, Default, Deserialize)] -#[serde(rename_all = "camelCase")] -pub struct CompilerOptions { - base_url: Option, - - /// Path aliases - paths: Option, - - /// The actual base for where path aliases are resolved from. - #[serde(skip)] - paths_base: PathBuf, -} - -/// Project Reference -/// -/// -#[derive(Debug, Deserialize)] -pub struct ProjectReference { - /// The path property of each reference can point to a directory containing a tsconfig.json file, - /// or to the config file itself (which may have any name). - pub path: PathBuf, - - /// Reference to the resolved tsconfig - #[serde(skip)] - pub tsconfig: Option>, -} - -impl TsConfig { - pub fn parse(root: bool, path: &Path, json: &mut str) -> Result { - _ = json_strip_comments::strip(json); - let mut tsconfig: Self = serde_json::from_str(json)?; - tsconfig.root = root; - tsconfig.path = path.to_path_buf(); - let directory = tsconfig.directory().to_path_buf(); - if let Some(base_url) = tsconfig.compiler_options.base_url { - tsconfig.compiler_options.base_url = Some(directory.normalize_with(base_url)); - } - if tsconfig.compiler_options.paths.is_some() { - tsconfig.compiler_options.paths_base = - tsconfig.compiler_options.base_url.as_ref().map_or(directory, Clone::clone); - } - Ok(tsconfig) - } - - pub fn build(mut self) -> Self { - if self.root { - let dir = self.directory().to_path_buf(); - // Substitute template variable in `tsconfig.compilerOptions.paths` - if let Some(paths) = &mut self.compiler_options.paths { - for paths in paths.values_mut() { - for path in paths { - Self::substitute_template_variable(&dir, path); - } - } - } - } - self - } - - /// Directory to `tsconfig.json` - /// - /// # Panics - /// - /// * When the `tsconfig.json` path is misconfigured. - pub fn directory(&self) -> &Path { - debug_assert!(self.path.file_name().is_some()); - self.path.parent().unwrap() - } - - pub fn extend_tsconfig(&mut self, tsconfig: &Self) { - let compiler_options = &mut self.compiler_options; - if compiler_options.paths.is_none() { - compiler_options.paths_base = compiler_options - .base_url - .as_ref() - .map_or_else(|| tsconfig.compiler_options.paths_base.clone(), Clone::clone); - compiler_options.paths.clone_from(&tsconfig.compiler_options.paths); - } - if compiler_options.base_url.is_none() { - compiler_options.base_url.clone_from(&tsconfig.compiler_options.base_url); - } - } - - pub fn resolve(&self, path: &Path, specifier: &str) -> Vec { - if path.starts_with(self.base_path()) { - let paths = self.resolve_path_alias(specifier); - if !paths.is_empty() { - return paths; - } - } - for tsconfig in self.references.iter().filter_map(|reference| reference.tsconfig.as_ref()) { - if path.starts_with(tsconfig.base_path()) { - return tsconfig.resolve_path_alias(specifier); - } - } - vec![] - } - - // Copied from parcel - // - pub fn resolve_path_alias(&self, specifier: &str) -> Vec { - if specifier.starts_with(|s| s == '/' || s == '.') { - return vec![]; - } - - let base_url_iter = self - .compiler_options - .base_url - .as_ref() - .map_or_else(Vec::new, |base_url| vec![base_url.normalize_with(specifier)]); - - let Some(paths_map) = &self.compiler_options.paths else { - return base_url_iter; - }; - - let paths = paths_map.get(specifier).map_or_else( - || { - let mut longest_prefix_length = 0; - let mut longest_suffix_length = 0; - let mut best_key: Option<&String> = None; - - for key in paths_map.keys() { - if let Some((prefix, suffix)) = key.split_once('*') { - if (best_key.is_none() || prefix.len() > longest_prefix_length) - && specifier.starts_with(prefix) - && specifier.ends_with(suffix) - { - longest_prefix_length = prefix.len(); - longest_suffix_length = suffix.len(); - best_key.replace(key); - } - } - } - - best_key.and_then(|key| paths_map.get(key)).map_or_else(Vec::new, |paths| { - paths - .iter() - .map(|path| { - path.replace( - '*', - &specifier[longest_prefix_length - ..specifier.len() - longest_suffix_length], - ) - }) - .collect::>() - }) - }, - Clone::clone, - ); - - paths - .into_iter() - .map(|p| self.compiler_options.paths_base.normalize_with(p)) - .chain(base_url_iter) - .collect() - } - - fn base_path(&self) -> &Path { - self.compiler_options - .base_url - .as_ref() - .map_or_else(|| self.directory(), |path| path.as_ref()) - } - - /// Template variable `${configDir}` for substitution of config files directory path - /// - /// NOTE: All tests cases are just a head replacement of `${configDir}`, so we are constrained as such. - /// - /// See - fn substitute_template_variable(directory: &Path, path: &mut String) { - const TEMPLATE_VARIABLE: &str = "${configDir}/"; - if let Some(stripped_path) = path.strip_prefix(TEMPLATE_VARIABLE) { - *path = directory.join(stripped_path).to_string_lossy().to_string(); - } - } -} diff --git a/tests/integration_test.rs b/tests/integration_test.rs deleted file mode 100644 index d369413f..00000000 --- a/tests/integration_test.rs +++ /dev/null @@ -1,102 +0,0 @@ -//! Test public APIs - -use std::{env, path::PathBuf}; - -use oxc_resolver::{EnforceExtension, Resolution, ResolveContext, ResolveOptions, Resolver}; - -fn dir() -> PathBuf { - env::current_dir().unwrap() -} - -fn resolve(specifier: &str) -> Resolution { - let path = dir(); - Resolver::new(ResolveOptions::default()).resolve(path, specifier).unwrap() -} - -#[test] -fn clone() { - let resolution = resolve("./tests/package.json"); - assert_eq!(resolution.clone(), resolution); -} - -#[test] -fn debug() { - let resolution = resolve("./tests/package.json"); - let s = format!("{resolution:?}"); - assert!(!s.is_empty()); -} - -#[test] -fn eq() { - let resolution = resolve("./tests/package.json"); - assert_eq!(resolution, resolution); -} - -#[test] -fn package_json() { - let resolution = resolve("./tests/package.json"); - assert!(resolution - .package_json() - .is_some_and(|json| json.name.as_ref().is_some_and(|name| name == "name"))); -} - -#[cfg(feature = "package_json_raw_json_api")] -#[test] -fn package_json_raw_json_api() { - let resolution = resolve("./tests/package.json"); - assert!(resolution - .package_json() - .unwrap() - .raw_json() - .get("name") - .is_some_and(|name| name == "name")); -} - -#[test] -fn clear_cache() { - let resolver = Resolver::new(ResolveOptions::default()); - resolver.clear_cache(); // exists -} - -#[test] -fn options() { - let resolver = Resolver::new(ResolveOptions::default()); - let options = resolver.options(); - assert!(!format!("{options:?}").is_empty()); -} - -#[test] -fn debug_resolver() { - let resolver = Resolver::new(ResolveOptions::default()); - assert!(!format!("{resolver:?}").is_empty()); -} - -#[test] -fn dependencies() { - let path = dir(); - let mut ctx = ResolveContext::default(); - let _ = Resolver::new(ResolveOptions::default()).resolve_with_context( - path, - "./tests/package.json", - &mut ctx, - ); - assert!(!ctx.file_dependencies.is_empty()); - assert!(ctx.missing_dependencies.is_empty()); -} - -#[test] -fn options_api() { - _ = ResolveOptions::default() - .with_builtin_modules(true) - .with_condition_names(&[]) - .with_extension(".js") - .with_force_extension(EnforceExtension::Auto) - .with_fully_specified(true) - .with_main_field("asdf") - .with_main_file("main") - .with_module("module") - .with_prefer_absolute(true) - .with_prefer_relative(true) - .with_root(PathBuf::new()) - .with_symbolic_link(true); -} diff --git a/tests/package.json b/tests/package.json deleted file mode 100644 index f099adcf..00000000 --- a/tests/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "name": "name" -} diff --git a/tests/resolve_test.rs b/tests/resolve_test.rs deleted file mode 100644 index 554d707c..00000000 --- a/tests/resolve_test.rs +++ /dev/null @@ -1,104 +0,0 @@ -use std::{env, path::PathBuf}; - -use oxc_resolver::{ResolveError, ResolveOptions, Resolver}; - -fn dir() -> PathBuf { - env::current_dir().unwrap() -} - -#[test] -fn chinese() { - let dir = dir(); - let specifier = "./fixtures/misc/中文/中文.js"; - let resolution = Resolver::new(ResolveOptions::default()).resolve(&dir, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(dir.join("fixtures/misc/中文/中文.js")) - ); -} - -#[test] -fn styled_components() { - let dir = dir(); - let path = dir.join("fixtures/pnpm8"); - let module_path = path.join("node_modules/.pnpm/styled-components@6.1.1_react-dom@18.2.0_react@18.2.0/node_modules/styled-components"); - let specifier = "styled-components"; - - // cjs - let options = - ResolveOptions { alias_fields: vec![vec!["browser".into()]], ..ResolveOptions::default() }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/styled-components.browser.cjs.js")) - ); - - // esm - let options = ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - main_fields: vec!["module".into()], - ..ResolveOptions::default() - }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/styled-components.browser.esm.js")) - ); -} - -#[test] -fn axios() { - let dir = dir(); - let path = dir.join("fixtures/pnpm8"); - let module_path = path.join("node_modules/.pnpm/axios@1.6.2/node_modules/axios"); - let specifier = "axios"; - - // default - let options = ResolveOptions::default(); - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("index.js")) - ); - - // browser - let options = ResolveOptions { - condition_names: vec!["browser".into(), "require".into()], - ..ResolveOptions::default() - }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/browser/axios.cjs")) - ); - - // cjs - let options = ResolveOptions { - condition_names: vec!["node".into(), "require".into()], - ..ResolveOptions::default() - }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/node/axios.cjs")) - ); -} - -#[test] -fn postcss() { - let dir = dir(); - let path = dir.join("fixtures/pnpm8"); - let module_path = path.join("node_modules/postcss"); - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - // should ignore "path" - let resolution = resolver.resolve(&module_path, "path"); - assert_eq!(resolution, Err(ResolveError::Ignored(module_path.clone()))); - - // should ignore "./lib/terminal-highlight" - let resolution = resolver.resolve(&module_path, "./lib/terminal-highlight"); - assert_eq!(resolution, Err(ResolveError::Ignored(module_path.join("lib/terminal-highlight")))); -} From 38cfd6824028a9246088a7cb94bc4218f85626f0 Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Sun, 9 Jun 2024 19:19:18 +0300 Subject: [PATCH 21/82] squash! --- Cargo.lock | 858 ------ fixtures/enhanced_resolve/lib/index.js | 1 - fixtures/enhanced_resolve/package.json | 4 - fixtures/enhanced_resolve/test/.gitignore | 2 - .../enhanced_resolve/test/fixtures/#/a.js | 0 fixtures/enhanced_resolve/test/fixtures/a.js | 3 - .../enhanced_resolve/test/fixtures/abc.txt | 1 - .../test/fixtures/alias/files/a.js | 0 fixtures/enhanced_resolve/test/fixtures/b.js | 3 - .../browser-module/browser/module-a.js | 0 .../fixtures/browser-module/lib/browser.js | 0 .../fixtures/browser-module/lib/ignore.js | 0 .../test/fixtures/browser-module/lib/main.js | 0 .../fixtures/browser-module/lib/replaced.js | 0 .../test/fixtures/browser-module/lib/self.js | 0 .../fixtures/browser-module/lib/toString.js | 0 .../browser-module/node_modules/module-a.js | 0 .../browser-module/node_modules/module-b.js | 0 .../browser-module/node_modules/module-c.js | 0 .../node_modules/recursive-file/a.js | 0 .../node_modules/recursive-file/b.js | 0 .../node_modules/recursive-file/c.js | 0 .../node_modules/recursive-file/d.js | 0 .../node_modules/recursive-file/package.json | 8 - .../test/fixtures/browser-module/package.json | 33 - .../test/fixtures/builtins/package.json | 12 - fixtures/enhanced_resolve/test/fixtures/c.js | 4 - .../enhanced_resolve/test/fixtures/complex.js | 13 - .../test/fixtures/crypto-js/index.js | 0 .../test/fixtures/crypto-js/package.json | 7 - .../test/fixtures/decorated-fs/exists.js | 0 .../test/fixtures/dirOrFile.js | 1 - .../test/fixtures/dirOrFile/index.js | 1 - .../directory-default/directory-default.js | 0 .../node_modules/@org/pkg/dist/string.js | 1 - .../@org/pkg/dist/string.test.d.ts | 1 - .../node_modules/@org/pkg/package.json | 9 - .../node_modules/pkg/dist/string.js | 1 - .../node_modules/pkg/dist/string.test.d.ts | 1 - .../node_modules/pkg/package.json | 9 - .../node_modules/exports-field/package.json | 7 - .../node_modules/pack1/index.js | 0 .../test/fixtures/exports-field/a.js | 1 - .../node_modules/exports-field/lib/browser.js | 1 - .../node_modules/exports-field/lib/index.js | 0 .../exports-field/lib/lib2/main.js | 1 - .../node_modules/exports-field/lib/main.js | 1 - .../node_modules/exports-field/main.js | 1 - .../node_modules/exports-field/package.json | 18 - .../node_modules/exports-field/x.js | 1 - .../invalid-exports-field/index.js | 0 .../invalid-exports-field/package.json | 13 - .../node_modules/invalid-exports-field/umd.js | 0 .../test/fixtures/exports-field/package.json | 5 - .../node_modules/exports-field/index.js | 1 - .../node_modules/exports-field/lib/browser.js | 1 - .../exports-field/lib/lib2/main.js | 1 - .../node_modules/exports-field/lib/main.js | 1 - .../node_modules/exports-field/main.js | 1 - .../node_modules/exports-field/package.json | 17 - .../node_modules/exports-field/index | 0 .../node_modules/exports-field/main.js | 1 - .../node_modules/exports-field/package.json | 10 - .../node_modules/exports-field/src/index.js | 0 .../fixtures/extension-alias/dir/index.js | 0 .../fixtures/extension-alias/dir/index.ts | 0 .../fixtures/extension-alias/dir2/index.js | 0 .../fixtures/extension-alias/dir2/index.mts | 0 .../test/fixtures/extension-alias/index.js | 0 .../test/fixtures/extension-alias/index.mjs | 0 .../fixtures/extension-alias/index.mts.js | 0 .../test/fixtures/extension-alias/index.ts | 0 .../test/fixtures/extensions/app.module.js | 0 .../test/fixtures/extensions/dir/index.js | 0 .../test/fixtures/extensions/dir/index.ts | 0 .../test/fixtures/extensions/foo.js | 0 .../test/fixtures/extensions/foo.ts | 0 .../test/fixtures/extensions/index.js | 0 .../test/fixtures/extensions/index.ts | 0 .../extensions/node_modules/module.js | 0 .../extensions/node_modules/module/index.ts | 0 .../test/fixtures/extensions/package.json | 3 - .../enhanced_resolve/test/fixtures/file.load1 | 0 .../enhanced_resolve/test/fixtures/file.load2 | 0 .../test/fixtures/foo/index.js | 0 .../test/fixtures/foo/package.json | 4 - .../node_modules/m/package.json | 17 - .../node_modules/m/src/features/f.js | 0 .../m/src/features/internal/file.js | 0 .../node_modules/m/src/features/y/y.js | 0 .../node_modules/m/src/internal/i.js | 0 .../node_modules/m/src/middle-1/f.js | 0 .../node_modules/m/src/middle-1/nested/f.js | 0 .../node_modules/m/src/middle-2/nested/f.js | 1 - .../m/src/middle-3/nested/f/nested/f.js | 0 .../node_modules/m/src/middle-4/f/f.js | 0 .../node_modules/m/src/middle-5/f$/$.js | 0 .../node_modules/m/src/middle-5/f/$.js | 0 .../node_modules/m/src/middle/f.js | 0 .../node_modules/m/src/middle/nested/f.js | 0 .../test/fixtures/imports-field/a.js | 1 - .../test/fixtures/imports-field/b.js | 0 .../test/fixtures/imports-field/dir/b.js | 0 .../node_modules/a/lib/browser.js | 1 - .../imports-field/node_modules/a/lib/index.js | 0 .../node_modules/a/lib/lib2/main.js | 1 - .../imports-field/node_modules/a/lib/main.js | 1 - .../imports-field/node_modules/a/main.js | 1 - .../imports-field/node_modules/a/package.json | 18 - .../imports-field/node_modules/a/x.js | 1 - .../imports-field/node_modules/c/index.js | 0 .../test/fixtures/imports-field/package.json | 17 - .../fixtures/incorrect-package/pack1/a.js | 0 .../incorrect-package/pack1/package.json | 2 - .../fixtures/incorrect-package/pack2/a.js | 0 .../incorrect-package/pack2/package.json | 0 .../test/fixtures/issue-238/package.json | 3 - .../test/fixtures/issue-238/src/a/config.js | 0 .../src/common/config/myObjectFile.js | 0 .../enhanced_resolve/test/fixtures/lib.js | 0 .../test/fixtures/lib/complex1.js | 1 - .../test/fixtures/main-field-self/index.js | 0 .../fixtures/main-field-self/package.json | 3 - .../test/fixtures/main-field-self2/index.js | 0 .../fixtures/main-field-self2/package.json | 3 - .../enhanced_resolve/test/fixtures/main1.js | 9 - .../enhanced_resolve/test/fixtures/main2.js | 12 - .../enhanced_resolve/test/fixtures/main3.js | 4 - .../multiple_modules/node_modules/m1/a.js | 3 - .../test/fixtures/no#fragment/#/#.js | 0 fixtures/enhanced_resolve/test/fixtures/no.js | 0 .../browser-module-broken/browser.js | 0 .../browser-module-broken/main.js | 0 .../browser-module-broken/package.json | 4 - .../complexm/node_modules/m1/a.js | 1 - .../complexm/node_modules/m1/index.js | 1 - .../fixtures/node_modules/complexm/step1.js | 1 - .../fixtures/node_modules/complexm/step2.js | 1 - .../fixtures/node_modules/dash-name/index.js | 0 .../node_modules/dash-name/package.json | 4 - .../test/fixtures/node_modules/dash/index.js | 0 .../fixtures/node_modules/dash/package.json | 4 - .../invalidPackageJson/package.json | 0 .../test/fixtures/node_modules/m1/a.js | 3 - .../test/fixtures/node_modules/m1/b.js | 3 - .../test/fixtures/node_modules/m2/b.js | 1 - .../node_modules/recursive-module/file.js | 0 .../node_modules/recursive-module/index.js | 0 .../test/fixtures/pnp-a/m2/a.js | 3 - .../test/fixtures/pnp/pkg/dir/index.js | 0 .../test/fixtures/pnp/pkg/index.js | 0 .../test/fixtures/pnp/pkg/main.js | 0 .../fixtures/pnp/pkg/package-alias/browser.js | 0 .../fixtures/pnp/pkg/package-alias/index.js | 0 .../test/fixtures/pnp/pkg/package.json | 7 - .../test/fixtures/pnp/pkg/typescript/index.ts | 0 .../test/fixtures/pnp/pkg3/a.js | 1 - .../test/fixtures/pnp/pkg3/package.json | 8 - .../prefer-pnp/alternative-modules/m1/b.js | 0 .../restrictions/node_modules/pck1/index.css | 0 .../restrictions/node_modules/pck1/index.js | 0 .../node_modules/pck1/package.json | 3 - .../restrictions/node_modules/pck2/index.css | 0 .../restrictions/node_modules/pck2/module.js | 0 .../node_modules/pck2/package.json | 5 - .../test/fixtures/roots_fall_through/index.js | 0 .../scoped/node_modules/@scope/pack1/main.js | 0 .../node_modules/@scope/pack1/package.json | 5 - .../node_modules/@scope/pack2/lib/index.js | 0 .../scoped/node_modules/@scope/pack2/main.js | 0 .../node_modules/@scope/pack2/package.json | 3 - .../test/fixtures/shortcutdir.js/a.js | 0 .../test/fixtures/yield/a/foo-2/b | 0 .../test/fixtures/yield/a/foo-2/c | 0 .../test/fixtures/yield/a/foo/a | 0 .../test/fixtures/yield/a/foo/b | 0 .../test/fixtures/yield/b/foo/a | 0 .../test/fixtures/yield/c/foo/a | 0 .../test/fixtures/yield/c/foo/package.json | 7 - .../fixtures/\346\265\213\350\257\225.js" | 0 .../\344\270\255\346\226\207.js" | 0 fixtures/pnpm8/.gitignore | 1 - fixtures/pnpm8/package.json | 14 - fixtures/pnpm8/pnpm-lock.yaml | 212 -- fixtures/tsconfig/cases/builtins/thing.js | 0 .../tsconfig/cases/builtins/tsconfig.json | 5 - fixtures/tsconfig/cases/exports/index.js | 0 fixtures/tsconfig/cases/exports/tsconfig.json | 3 - .../extends-extension/base-tsconfig.json | 7 - .../tsconfig/cases/extends-extension/foo.js | 0 .../cases/extends-extension/tsconfig.json | 3 - .../cases/extends-extensionless/foo.js | 0 .../cases/extends-extensionless/tsconfig.json | 3 - .../tsconfig/cases/extends-multiple/foo.js | 0 .../cases/extends-multiple/tsconfig.json | 6 - .../tsconfig/cases/extends-not-found/index.js | 0 .../cases/extends-not-found/tsconfig.json | 3 - .../tsconfig/cases/extends-paths/src/index.js | 0 .../cases/extends-paths/tsconfig.base.json | 7 - .../cases/extends-paths/tsconfig.json | 6 - fixtures/tsconfig/cases/field/index.js | 0 fixtures/tsconfig/cases/field/tsconfig.json | 3 - fixtures/tsconfig/cases/index/index.js | 0 fixtures/tsconfig/cases/index/tsconfig.json | 3 - .../cases/paths_template_variable/foo.js | 0 .../paths_template_variable/tsconfig1.json | 3 - .../paths_template_variable/tsconfig2.json | 8 - .../project_references/app/aliased/index.ts | 0 .../cases/project_references/app/index.ts | 0 .../project_references/app/tsconfig.json | 23 - .../project_a/aliased/index.ts | 0 .../project_references/project_a/conf.json | 8 - .../project_references/project_a/index.ts | 0 .../project_b/src/aliased/index.ts | 0 .../project_b/tsconfig.json | 9 - .../project_references/project_c/index.ts | 0 .../project_c/tsconfig.json | 5 - .../project_references/tsconfig.base.json | 4 - fixtures/tsconfig/cases/suffixes/a.ios.ts | 0 fixtures/tsconfig/cases/suffixes/a.ts | 0 fixtures/tsconfig/cases/suffixes/b.ts | 0 fixtures/tsconfig/cases/suffixes/c-test.ts | 0 fixtures/tsconfig/cases/suffixes/index.ts | 1 - .../tsconfig/cases/suffixes/tsconfig.json | 5 - fixtures/tsconfig/cases/trailing-comma/bar.js | 0 .../tsconfig/cases/trailing-comma/index.js | 0 .../cases/trailing-comma/tsconfig.json | 9 - fixtures/tsconfig/foo.js | 0 fixtures/tsconfig/nested/index.js | 0 fixtures/tsconfig/nested/test.js | 0 fixtures/tsconfig/nested/tsconfig.json | 8 - .../node_modules/tsconfig-exports/conf.json | 7 - .../node_modules/tsconfig-exports/foo.js | 0 .../tsconfig-exports/package.json | 7 - .../node_modules/tsconfig-field/conf.json | 7 - .../node_modules/tsconfig-field/foo.js | 0 .../node_modules/tsconfig-field/package.json | 5 - .../node_modules/tsconfig-index/foo.js | 0 .../node_modules/tsconfig-index/package.json | 4 - .../node_modules/tsconfig-index/tsconfig.json | 7 - .../node_modules/tsconfig-not-used/foo.js | 0 .../tsconfig-not-used/tsconfig.json | 7 - fixtures/tsconfig/package.json | 24 - fixtures/tsconfig/tsconfig.json | 7 - .../tsconfig/tsconfig_template_variable.json | 7 - napi/__test__/resolver.spec.mjs | 259 -- napi/src/lib.rs | 166 -- napi/src/options.rs | 261 -- napi/tests/options.test.mjs | 59 - npm/package.json | 67 +- package.json | 56 +- pnpm-lock.yaml | 2450 ---------------- src/builtins.rs | 71 - src/cache.rs | 369 --- src/context.rs | 89 - src/error.rs | 160 -- src/file_system.rs | 133 - src/lib.rs | 1670 ----------- src/options.rs | 623 ---- src/package_json.rs | 207 -- src/path.rs | 132 - src/resolution.rs | 92 - src/specifier.rs | 230 -- src/tests/alias.rs | 280 -- src/tests/browser_field.rs | 189 -- src/tests/builtins.rs | 121 - src/tests/dependencies.rs | 110 - src/tests/exports_field.rs | 2546 ----------------- src/tests/extension_alias.rs | 66 - src/tests/extensions.rs | 125 - src/tests/fallback.rs | 100 - src/tests/full_specified.rs | 113 - src/tests/imports_field.rs | 1320 --------- src/tests/incorrect_description_file.rs | 62 - src/tests/main_field.rs | 24 - src/tests/memory_fs.rs | 74 - src/tests/missing.rs | 106 - src/tests/mod.rs | 49 - src/tests/resolve.rs | 119 - src/tests/restrictions.rs | 25 - src/tests/roots.rs | 92 - src/tests/scoped_packages.rs | 25 - src/tests/simple.rs | 68 - src/tests/symlink.rs | 121 - src/tests/tsconfig_paths.rs | 507 ---- src/tests/tsconfig_project_references.rs | 101 - src/tsconfig.rs | 212 -- tests/integration_test.rs | 102 - tests/package.json | 3 - tests/resolve_test.rs | 104 - 290 files changed, 50 insertions(+), 15475 deletions(-) delete mode 100644 Cargo.lock delete mode 100644 fixtures/enhanced_resolve/lib/index.js delete mode 100644 fixtures/enhanced_resolve/package.json delete mode 100644 fixtures/enhanced_resolve/test/.gitignore delete mode 100644 fixtures/enhanced_resolve/test/fixtures/#/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/abc.txt delete mode 100644 fixtures/enhanced_resolve/test/fixtures/alias/files/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/browser/module-a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/ignore.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/replaced.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/self.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/toString.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-c.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/c.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/d.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/builtins/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/c.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/complex.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/crypto-js/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/decorated-fs/exists.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/dirOrFile.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/directory-default/directory-default.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/pack1/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/umd.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/index delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/src/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.mts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mjs delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mts.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/app.module.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/foo.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/foo.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/file.load1 delete mode 100644 fixtures/enhanced_resolve/test/fixtures/file.load2 delete mode 100644 fixtures/enhanced_resolve/test/fixtures/foo/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/foo/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/internal/file.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/y/y.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/internal/i.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-3/nested/f/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-4/f/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f$/$.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f/$.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/dir/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/c/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/issue-238/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/issue-238/src/a/config.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/issue-238/src/common/config/myObjectFile.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/lib.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/lib/complex1.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self2/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main1.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main2.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main3.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/no#fragment/#/#.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/no.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/invalidPackageJson/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/file.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/dir/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/typescript/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/prefer-pnp/alternative-modules/m1/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.css delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/index.css delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/module.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/roots_fall_through/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/lib/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/shortcutdir.js/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/b delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/c delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo/a delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo/b delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/b/foo/a delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/c/foo/a delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json delete mode 100644 "fixtures/enhanced_resolve/test/fixtures/\346\265\213\350\257\225.js" delete mode 100644 "fixtures/misc/\344\270\255\346\226\207/\344\270\255\346\226\207.js" delete mode 100644 fixtures/pnpm8/.gitignore delete mode 100644 fixtures/pnpm8/package.json delete mode 100644 fixtures/pnpm8/pnpm-lock.yaml delete mode 100644 fixtures/tsconfig/cases/builtins/thing.js delete mode 100644 fixtures/tsconfig/cases/builtins/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/exports/index.js delete mode 100644 fixtures/tsconfig/cases/exports/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-extension/base-tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-extension/foo.js delete mode 100644 fixtures/tsconfig/cases/extends-extension/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-extensionless/foo.js delete mode 100644 fixtures/tsconfig/cases/extends-extensionless/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-multiple/foo.js delete mode 100644 fixtures/tsconfig/cases/extends-multiple/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-not-found/index.js delete mode 100644 fixtures/tsconfig/cases/extends-not-found/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-paths/src/index.js delete mode 100644 fixtures/tsconfig/cases/extends-paths/tsconfig.base.json delete mode 100644 fixtures/tsconfig/cases/extends-paths/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/field/index.js delete mode 100644 fixtures/tsconfig/cases/field/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/index/index.js delete mode 100644 fixtures/tsconfig/cases/index/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/paths_template_variable/foo.js delete mode 100644 fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json delete mode 100644 fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json delete mode 100644 fixtures/tsconfig/cases/project_references/app/aliased/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/app/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/app/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/project_references/project_a/aliased/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_a/conf.json delete mode 100644 fixtures/tsconfig/cases/project_references/project_a/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_b/src/aliased/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_b/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/project_references/project_c/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_c/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/project_references/tsconfig.base.json delete mode 100644 fixtures/tsconfig/cases/suffixes/a.ios.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/a.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/b.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/c-test.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/index.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/trailing-comma/bar.js delete mode 100644 fixtures/tsconfig/cases/trailing-comma/index.js delete mode 100644 fixtures/tsconfig/cases/trailing-comma/tsconfig.json delete mode 100644 fixtures/tsconfig/foo.js delete mode 100644 fixtures/tsconfig/nested/index.js delete mode 100644 fixtures/tsconfig/nested/test.js delete mode 100644 fixtures/tsconfig/nested/tsconfig.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-exports/conf.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-exports/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-exports/package.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-field/conf.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-field/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-field/package.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-index/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-index/package.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-not-used/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json delete mode 100755 fixtures/tsconfig/package.json delete mode 100644 fixtures/tsconfig/tsconfig.json delete mode 100644 fixtures/tsconfig/tsconfig_template_variable.json delete mode 100644 napi/__test__/resolver.spec.mjs delete mode 100644 napi/src/lib.rs delete mode 100644 napi/src/options.rs delete mode 100644 napi/tests/options.test.mjs delete mode 100644 pnpm-lock.yaml delete mode 100644 src/builtins.rs delete mode 100644 src/cache.rs delete mode 100644 src/context.rs delete mode 100644 src/error.rs delete mode 100644 src/file_system.rs delete mode 100644 src/lib.rs delete mode 100644 src/options.rs delete mode 100644 src/package_json.rs delete mode 100644 src/path.rs delete mode 100644 src/resolution.rs delete mode 100644 src/specifier.rs delete mode 100644 src/tests/alias.rs delete mode 100644 src/tests/browser_field.rs delete mode 100644 src/tests/builtins.rs delete mode 100644 src/tests/dependencies.rs delete mode 100644 src/tests/exports_field.rs delete mode 100644 src/tests/extension_alias.rs delete mode 100644 src/tests/extensions.rs delete mode 100644 src/tests/fallback.rs delete mode 100644 src/tests/full_specified.rs delete mode 100644 src/tests/imports_field.rs delete mode 100644 src/tests/incorrect_description_file.rs delete mode 100644 src/tests/main_field.rs delete mode 100644 src/tests/memory_fs.rs delete mode 100644 src/tests/missing.rs delete mode 100644 src/tests/mod.rs delete mode 100644 src/tests/resolve.rs delete mode 100644 src/tests/restrictions.rs delete mode 100644 src/tests/roots.rs delete mode 100644 src/tests/scoped_packages.rs delete mode 100644 src/tests/simple.rs delete mode 100644 src/tests/symlink.rs delete mode 100644 src/tests/tsconfig_paths.rs delete mode 100644 src/tests/tsconfig_project_references.rs delete mode 100644 src/tsconfig.rs delete mode 100644 tests/integration_test.rs delete mode 100644 tests/package.json delete mode 100644 tests/resolve_test.rs diff --git a/Cargo.lock b/Cargo.lock deleted file mode 100644 index 8aa802af..00000000 --- a/Cargo.lock +++ /dev/null @@ -1,858 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "aho-corasick" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" -dependencies = [ - "memchr", -] - -[[package]] -name = "anes" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "735d4f398ca57cfa2880225c2bf81c3b9af3be5bb22e44ae70118dad38713e84" - -[[package]] -name = "autocfg" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "bitflags" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" - -[[package]] -name = "bpaf" -version = "0.9.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3280efcf6d66bc77c2cf9b67dc8acee47a217d9be67dd590b3230dffe663724d" - -[[package]] -name = "cast" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "ciborium" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42e69ffd6f0917f5c029256a24d0161db17cea3997d185db0d35926308770f0e" -dependencies = [ - "ciborium-io", - "ciborium-ll", - "serde", -] - -[[package]] -name = "ciborium-io" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05afea1e0a06c9be33d539b876f1ce3692f4afea2cb41f740e7743225ed1c757" - -[[package]] -name = "ciborium-ll" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57663b653d948a338bfb3eeba9bb2fd5fcfaecb9e199e87e1eda4d9e8b240fd9" -dependencies = [ - "ciborium-io", - "half", -] - -[[package]] -name = "clean-path" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aaa6b4b263a5d737e9bf6b7c09b72c41a5480aec4d7219af827f6564e950b6a5" - -[[package]] -name = "codspeed" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a104ac948e0188b921eb3fcbdd55dcf62e542df4c7ab7e660623f6288302089" -dependencies = [ - "colored", - "libc", - "serde_json", -] - -[[package]] -name = "colored" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbf2150cce219b664a8a70df7a1f933836724b503f8a413af9365b4dcc4d90b8" -dependencies = [ - "lazy_static", - "windows-sys 0.48.0", -] - -[[package]] -name = "convert_case" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec182b0ca2f35d8fc196cf3404988fd8b8c739a4d270ff118a398feb0cbec1ca" -dependencies = [ - "unicode-segmentation", -] - -[[package]] -name = "criterion2" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f22174bed309c964c1720148dfe793f285cc02fd8b13c91205d485f73468d94d" -dependencies = [ - "anes", - "bpaf", - "cast", - "ciborium", - "codspeed", - "colored", - "num-traits", - "oorandom", - "serde", - "serde_json", - "walkdir", -] - -[[package]] -name = "crossbeam-deque" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" -dependencies = [ - "crossbeam-epoch", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.9.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" -dependencies = [ - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" - -[[package]] -name = "crunchy" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" - -[[package]] -name = "ctor" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edb49164822f3ee45b17acd4a208cfc1251410cf0cad9a833234c9890774dd9f" -dependencies = [ - "quote", - "syn", -] - -[[package]] -name = "dashmap" -version = "5.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" -dependencies = [ - "cfg-if", - "hashbrown", - "lock_api", - "once_cell", - "parking_lot_core", -] - -[[package]] -name = "document-features" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef5282ad69563b5fc40319526ba27e0e7363d552a896f0297d54f767717f9b95" -dependencies = [ - "litrs", -] - -[[package]] -name = "dunce" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b" - -[[package]] -name = "either" -version = "1.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dca9240753cf90908d7e4aac30f630662b02aebaa1b58a3cadabdb23385b58b" - -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "filetime" -version = "0.2.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ee447700ac8aa0b2f2bd7bc4462ad686ba06baa6727ac149a2d6277f0d240fd" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall 0.4.1", - "windows-sys 0.52.0", -] - -[[package]] -name = "half" -version = "2.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dd08c532ae367adf81c312a4580bc67f1d0fe8bc9c460520283f4c0ff277888" -dependencies = [ - "cfg-if", - "crunchy", -] - -[[package]] -name = "hashbrown" -version = "0.14.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" - -[[package]] -name = "indexmap" -version = "2.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" -dependencies = [ - "equivalent", - "hashbrown", - "serde", -] - -[[package]] -name = "itoa" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" - -[[package]] -name = "json-strip-comments" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3d129799327c8f80861e467c59b825ba24c277dba6ad0d71a141dc98f9e04ee" - -[[package]] -name = "lazy_static" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" - -[[package]] -name = "libc" -version = "0.2.155" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" - -[[package]] -name = "libloading" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c2a198fb6b0eada2a8df47933734e6d35d350665a33a3593d7164fa52c75c19" -dependencies = [ - "cfg-if", - "windows-targets 0.52.5", -] - -[[package]] -name = "litrs" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4ce301924b7887e9d637144fdade93f9dfff9b60981d4ac161db09720d39aa5" - -[[package]] -name = "lock_api" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" -dependencies = [ - "autocfg", - "scopeguard", -] - -[[package]] -name = "memchr" -version = "2.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" - -[[package]] -name = "napi" -version = "2.16.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfc300228808a0e6aea5a58115c82889240bcf8dab16fc25ad675b33e454b368" -dependencies = [ - "bitflags 2.5.0", - "ctor", - "napi-derive", - "napi-sys", - "once_cell", - "serde", - "serde_json", -] - -[[package]] -name = "napi-build" -version = "2.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1c0f5d67ee408a4685b61f5ab7e58605c8ae3f2b4189f0127d804ff13d5560a" - -[[package]] -name = "napi-derive" -version = "2.16.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0e034ddf6155192cf83f267ede763fe6c164dfa9971585436b16173718d94c4" -dependencies = [ - "cfg-if", - "convert_case", - "napi-derive-backend", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "napi-derive-backend" -version = "1.0.67" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bff2c00437f3b3266391eb5e6aa25d0029187daf5caf05b8e3271468fb5ae73e" -dependencies = [ - "convert_case", - "once_cell", - "proc-macro2", - "quote", - "regex", - "semver", - "syn", -] - -[[package]] -name = "napi-sys" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "427802e8ec3a734331fec1035594a210ce1ff4dc5bc1950530920ab717964ea3" -dependencies = [ - "libloading", -] - -[[package]] -name = "normalize-path" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5438dd2b2ff4c6df6e1ce22d825ed2fa93ee2922235cc45186991717f0a892d" - -[[package]] -name = "num-traits" -version = "0.2.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" -dependencies = [ - "autocfg", -] - -[[package]] -name = "once_cell" -version = "1.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" - -[[package]] -name = "oorandom" -version = "11.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575" - -[[package]] -name = "oxc_napi_resolver" -version = "0.0.0" -dependencies = [ - "napi", - "napi-build", - "napi-derive", - "oxc_resolver", -] - -[[package]] -name = "oxc_resolver" -version = "1.8.1" -dependencies = [ - "criterion2", - "dashmap", - "document-features", - "dunce", - "json-strip-comments", - "normalize-path", - "once_cell", - "rayon", - "rustc-hash", - "serde", - "serde_json", - "thiserror", - "tracing", - "typescript_tsconfig_json", - "vfs", -] - -[[package]] -name = "parking_lot_core" -version = "0.9.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall 0.5.1", - "smallvec", - "windows-targets 0.52.5", -] - -[[package]] -name = "pin-project-lite" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" - -[[package]] -name = "proc-macro2" -version = "1.0.85" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22244ce15aa966053a896d1accb3a6e68469b97c7f33f284b99f0d576879fc23" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.36" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "rayon" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" -dependencies = [ - "either", - "rayon-core", -] - -[[package]] -name = "rayon-core" -version = "1.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" -dependencies = [ - "crossbeam-deque", - "crossbeam-utils", -] - -[[package]] -name = "redox_syscall" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" -dependencies = [ - "bitflags 1.3.2", -] - -[[package]] -name = "redox_syscall" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "469052894dcb553421e483e4209ee581a45100d31b4018de03e5a7ad86374a7e" -dependencies = [ - "bitflags 2.5.0", -] - -[[package]] -name = "regex" -version = "1.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" -dependencies = [ - "aho-corasick", - "memchr", - "regex-automata", - "regex-syntax", -] - -[[package]] -name = "regex-automata" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", -] - -[[package]] -name = "regex-syntax" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" - -[[package]] -name = "rustc-hash" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" - -[[package]] -name = "ryu" -version = "1.0.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" - -[[package]] -name = "same-file" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "scopeguard" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" - -[[package]] -name = "semver" -version = "1.0.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" - -[[package]] -name = "serde" -version = "1.0.203" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7253ab4de971e72fb7be983802300c30b5a7f0c2e56fab8abfc6a214307c0094" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.203" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "serde_json" -version = "1.0.117" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3" -dependencies = [ - "indexmap", - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "smallvec" -version = "1.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" - -[[package]] -name = "syn" -version = "2.0.66" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c42f3f41a2de00b01c0aaad383c5a45241efc8b2d1eda5661812fda5f3cdcff5" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "thiserror" -version = "1.0.61" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.61" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "tracing" -version = "0.1.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" -dependencies = [ - "pin-project-lite", - "tracing-attributes", - "tracing-core", -] - -[[package]] -name = "tracing-attributes" -version = "0.1.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "tracing-core" -version = "0.1.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" -dependencies = [ - "once_cell", -] - -[[package]] -name = "typescript_tsconfig_json" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7cc416eaf05297012ead9d192226fe9a92e9a20f64f8780efb9085aaae9b590" -dependencies = [ - "clean-path", - "indexmap", - "rustc-hash", - "serde", - "serde_json", -] - -[[package]] -name = "unicode-ident" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" - -[[package]] -name = "unicode-segmentation" -version = "1.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" - -[[package]] -name = "vfs" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "654cd097e182a71dbf899178e6b5662c2157dd0b8afd5975de18008f6fc173d1" -dependencies = [ - "filetime", -] - -[[package]] -name = "walkdir" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" -dependencies = [ - "same-file", - "winapi-util", -] - -[[package]] -name = "winapi-util" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b" -dependencies = [ - "windows-sys 0.52.0", -] - -[[package]] -name = "windows-sys" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" -dependencies = [ - "windows-targets 0.48.5", -] - -[[package]] -name = "windows-sys" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" -dependencies = [ - "windows-targets 0.52.5", -] - -[[package]] -name = "windows-targets" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" -dependencies = [ - "windows_aarch64_gnullvm 0.48.5", - "windows_aarch64_msvc 0.48.5", - "windows_i686_gnu 0.48.5", - "windows_i686_msvc 0.48.5", - "windows_x86_64_gnu 0.48.5", - "windows_x86_64_gnullvm 0.48.5", - "windows_x86_64_msvc 0.48.5", -] - -[[package]] -name = "windows-targets" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" -dependencies = [ - "windows_aarch64_gnullvm 0.52.5", - "windows_aarch64_msvc 0.52.5", - "windows_i686_gnu 0.52.5", - "windows_i686_gnullvm", - "windows_i686_msvc 0.52.5", - "windows_x86_64_gnu 0.52.5", - "windows_x86_64_gnullvm 0.52.5", - "windows_x86_64_msvc 0.52.5", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" - -[[package]] -name = "windows_i686_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" - -[[package]] -name = "windows_i686_gnu" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" - -[[package]] -name = "windows_i686_gnullvm" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" - -[[package]] -name = "windows_i686_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" - -[[package]] -name = "windows_i686_msvc" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" diff --git a/fixtures/enhanced_resolve/lib/index.js b/fixtures/enhanced_resolve/lib/index.js deleted file mode 100644 index 1e872e8f..00000000 --- a/fixtures/enhanced_resolve/lib/index.js +++ /dev/null @@ -1 +0,0 @@ -// mimic enhanced-resolved root directory structure diff --git a/fixtures/enhanced_resolve/package.json b/fixtures/enhanced_resolve/package.json deleted file mode 100644 index d1b845b5..00000000 --- a/fixtures/enhanced_resolve/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "enhanced-resolve", - "main": "lib/index.js" -} diff --git a/fixtures/enhanced_resolve/test/.gitignore b/fixtures/enhanced_resolve/test/.gitignore deleted file mode 100644 index bbbec5f4..00000000 --- a/fixtures/enhanced_resolve/test/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# created by symlink.rs -/temp diff --git a/fixtures/enhanced_resolve/test/fixtures/#/a.js b/fixtures/enhanced_resolve/test/fixtures/#/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/a.js b/fixtures/enhanced_resolve/test/fixtures/a.js deleted file mode 100644 index 896ffc6d..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/abc.txt b/fixtures/enhanced_resolve/test/fixtures/abc.txt deleted file mode 100644 index f2ba8f84..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/abc.txt +++ /dev/null @@ -1 +0,0 @@ -abc \ No newline at end of file diff --git a/fixtures/enhanced_resolve/test/fixtures/alias/files/a.js b/fixtures/enhanced_resolve/test/fixtures/alias/files/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/b.js b/fixtures/enhanced_resolve/test/fixtures/b.js deleted file mode 100644 index 11476340..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/b.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function b() { - return "This is b"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/browser/module-a.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/browser/module-a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/browser.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/ignore.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/ignore.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/replaced.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/replaced.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/self.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/self.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/toString.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/toString.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-a.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-b.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-c.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-c.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/a.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/b.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/c.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/c.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/d.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/d.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json deleted file mode 100644 index c13fe23b..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "browser": { - "a.js": "./a", - "./b.js": "./b", - "c.js": "./d.js", - "./d.js": "./c.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/package.json b/fixtures/enhanced_resolve/test/fixtures/browser-module/package.json deleted file mode 100644 index 19ff7739..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/browser-module/package.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "exports": { - "./lib/index.js": "./lib/index.js" - }, - "browser": { - "./lib/ignore.js": false, - "./lib/replaced.js": "./lib/browser", - "module-a": "./browser/module-a.js", - "module-b": "module-c", - "module-c": "module-c", - "./toString": "./lib/toString.js", - "./lib/main.js": "./lib/main.js", - "./main.js": "./lib/main.js", - "./lib/xyz.js": "./xyz.js", - "./xyz.js": "./lib/xyz.js", - "./lib/non-existent.js": "./lib/non-existent.js", - ".": false, - "./number": 1, - "./foo": "./lib/replaced.js?query" - }, - "innerBrowser1": { - "field": { - "browser": { - "./lib/main1.js": "./lib/main.js" - } - } - }, - "innerBrowser2": { - "browser": { - "./lib/main2.js": "./lib/replaced.js" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/builtins/package.json b/fixtures/enhanced_resolve/test/fixtures/builtins/package.json deleted file mode 100644 index 4a54ea96..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/builtins/package.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "name": "builtins", - "private": true, - "imports": { - "#fs": { - "default": "fs" - }, - "#http": { - "node": "node:http" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/c.js b/fixtures/enhanced_resolve/test/fixtures/c.js deleted file mode 100644 index e3aca8aa..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/c.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = function b() { - require("./a"); - return "This is c"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/complex.js b/fixtures/enhanced_resolve/test/fixtures/complex.js deleted file mode 100644 index 1f62db84..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/complex.js +++ /dev/null @@ -1,13 +0,0 @@ -var 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); diff --git a/fixtures/enhanced_resolve/test/fixtures/crypto-js/index.js b/fixtures/enhanced_resolve/test/fixtures/crypto-js/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json b/fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json deleted file mode 100644 index 1d31aa8b..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "crypto-js", - "main": "index.js", - "browser": { - "crypto": false - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/decorated-fs/exists.js b/fixtures/enhanced_resolve/test/fixtures/decorated-fs/exists.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/dirOrFile.js b/fixtures/enhanced_resolve/test/fixtures/dirOrFile.js deleted file mode 100644 index c3cb885f..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/dirOrFile.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "file"; diff --git a/fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js b/fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js deleted file mode 100644 index 85e01cd4..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "dir"; diff --git a/fixtures/enhanced_resolve/test/fixtures/directory-default/directory-default.js b/fixtures/enhanced_resolve/test/fixtures/directory-default/directory-default.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js deleted file mode 100644 index d1007aae..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js +++ /dev/null @@ -1 +0,0 @@ -export default "string"; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts deleted file mode 100644 index cb0ff5c3..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json deleted file mode 100644 index b523a1e9..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "@org/pkg", - "exports": { - "./*.js": { - "types": "./dist/*.d.ts", - "default": "./dist/*.js" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js deleted file mode 100644 index d1007aae..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js +++ /dev/null @@ -1 +0,0 @@ -export default "string"; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts deleted file mode 100644 index cb0ff5c3..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json deleted file mode 100644 index 8e55fb46..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "@raviqqe/hidash", - "exports": { - "./*.js": { - "types": "./dist/*.d.ts", - "default": "./dist/*.js" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json deleted file mode 100644 index f0edf449..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "exports-field", - "version": "1.0.0", - "exports": { - ".": "./a/../b/../../pack1/index.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/pack1/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/pack1/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/a.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/a.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json deleted file mode 100644 index 6b105c08..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "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/": { - "webpack": ["./lib/lib2/", "./lib/"], - "node": "./lib/", - "default": "./lib/" - }, - "./dist/a.js": "./../../a.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json deleted file mode 100644 index 0012a3de..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "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" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/umd.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/umd.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field/package.json deleted file mode 100644 index 5fa72bb5..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "@exports-field/core", - "version": "1.0.0", - "exports": "./a.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json deleted file mode 100644 index e6f12074..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "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/lib2/", "./lib/"], - "node": "./lib/", - "default": "./lib/" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/index b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/index deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json deleted file mode 100644 index 1a838f49..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "name": "exports-field", - "exportsField": { - "exports": "./main.js" - }, - "ex": "./index", - "broken": { - ".": "./src" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/src/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/src/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.ts b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.mts b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.mts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mjs b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mjs deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mts.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mts.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.ts b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/app.module.js b/fixtures/enhanced_resolve/test/fixtures/extensions/app.module.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.js b/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/foo.js b/fixtures/enhanced_resolve/test/fixtures/extensions/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/foo.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/foo.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/index.js b/fixtures/enhanced_resolve/test/fixtures/extensions/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/index.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module.js b/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module/index.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/package.json b/fixtures/enhanced_resolve/test/fixtures/extensions/package.json deleted file mode 100644 index 5e55a1e8..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/extensions/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "./index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/file.load1 b/fixtures/enhanced_resolve/test/fixtures/file.load1 deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/file.load2 b/fixtures/enhanced_resolve/test/fixtures/file.load2 deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/foo/index.js b/fixtures/enhanced_resolve/test/fixtures/foo/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/foo/package.json b/fixtures/enhanced_resolve/test/fixtures/foo/package.json deleted file mode 100644 index da86787a..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/foo/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "foo", - "version": "1.0.0" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json deleted file mode 100644 index aa2be496..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "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" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/internal/file.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/internal/file.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/y/y.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/y/y.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/internal/i.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/internal/i.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/nested/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js deleted file mode 100644 index e5b70a86..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = { nested: "nested" } diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-3/nested/f/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-3/nested/f/nested/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-4/f/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-4/f/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f$/$.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f$/$.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f/$.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f/$.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/nested/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/a.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/a.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/b.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/dir/b.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/dir/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/index.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json deleted file mode 100644 index 8d8d3a46..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "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/lib2/", "./lib/"], - "node": "./lib/", - "default": "./lib/" - }, - "./dist/a.js": "./../../a.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/c/index.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/c/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/imports-field/package.json deleted file mode 100644 index 248351a9..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "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" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/a.js b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json deleted file mode 100644 index ded7faa2..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json +++ /dev/null @@ -1,2 +0,0 @@ -{ - "main": "./a.js", diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/a.js b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/package.json b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/package.json deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/issue-238/package.json b/fixtures/enhanced_resolve/test/fixtures/issue-238/package.json deleted file mode 100644 index 352055cd..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/issue-238/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "private": true -} diff --git a/fixtures/enhanced_resolve/test/fixtures/issue-238/src/a/config.js b/fixtures/enhanced_resolve/test/fixtures/issue-238/src/a/config.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/issue-238/src/common/config/myObjectFile.js b/fixtures/enhanced_resolve/test/fixtures/issue-238/src/common/config/myObjectFile.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/lib.js b/fixtures/enhanced_resolve/test/fixtures/lib.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/lib/complex1.js b/fixtures/enhanced_resolve/test/fixtures/lib/complex1.js deleted file mode 100644 index b3de3d70..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/lib/complex1.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "lib complex1"; diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self/index.js b/fixtures/enhanced_resolve/test/fixtures/main-field-self/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json b/fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json deleted file mode 100644 index a2b6f341..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "./" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self2/index.js b/fixtures/enhanced_resolve/test/fixtures/main-field-self2/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json b/fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json deleted file mode 100644 index 4fa6f730..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "." -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main1.js b/fixtures/enhanced_resolve/test/fixtures/main1.js deleted file mode 100644 index 168f2a1e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main1.js +++ /dev/null @@ -1,9 +0,0 @@ -var a = require("./a"); -if (x) { - for (var i = 0; i < 100; i++) { - while (true) require("./b"); - do { - i++; - } while (require("m1/a")()); - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main2.js b/fixtures/enhanced_resolve/test/fixtures/main2.js deleted file mode 100644 index 39f062b1..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main2.js +++ /dev/null @@ -1,12 +0,0 @@ -var 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"); - }); - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main3.js b/fixtures/enhanced_resolve/test/fixtures/main3.js deleted file mode 100644 index 1c180166..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main3.js +++ /dev/null @@ -1,4 +0,0 @@ -var a = require("./a"); -require.ensure([], function(require) { - require("./c.js"); -}); diff --git a/fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js b/fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js deleted file mode 100644 index 997c1051..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is nested m1/a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/no#fragment/#/#.js b/fixtures/enhanced_resolve/test/fixtures/no#fragment/#/#.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/no.js b/fixtures/enhanced_resolve/test/fixtures/no.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/browser.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/browser.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/main.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json deleted file mode 100644 index c469e1fd..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "main": "./main.js", - "browser": "./browser.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js deleted file mode 100644 index 549620a5..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "the correct a.js"; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js deleted file mode 100644 index 5db6632e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = " :) " + require("m2/b.js"); diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js deleted file mode 100644 index d308569d..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require("m1/a") + require("m1"); diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js deleted file mode 100644 index cb8127e8..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "Step2"; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json deleted file mode 100644 index 8d6dfa56..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "dash-name", - "exports": "./index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json deleted file mode 100644 index 4fd8706e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "dash", - "exports": "./index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/invalidPackageJson/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/invalidPackageJson/package.json deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js deleted file mode 100644 index 46fc8e6c..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is m1/a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js deleted file mode 100644 index 8565c244..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is m1/b"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js deleted file mode 100644 index 34faaaf5..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "This is m2/b"; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/file.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/file.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js b/fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js deleted file mode 100644 index 997c1051..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is nested m1/a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/dir/index.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/dir/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/index.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/main.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/browser.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/browser.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/index.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json deleted file mode 100644 index e20ceaeb..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "main": "main.js", - "browser": { - "./package-alias/index.js": "./package-alias/browser.js", - "module": "pkg/dir/index" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/typescript/index.ts b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/typescript/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json deleted file mode 100644 index 4a1f838e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "@exports-field/core", - "version": "1.0.0", - "exports": { - ".": "./a.js", - "./x": "./a.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/prefer-pnp/alternative-modules/m1/b.js b/fixtures/enhanced_resolve/test/fixtures/prefer-pnp/alternative-modules/m1/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.css b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.css deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.js b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json deleted file mode 100644 index 14ab704d..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/index.css b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/index.css deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/module.js b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/module.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json deleted file mode 100644 index ee0eb71b..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "main": "../../../c.js", - "module": "module.js", - "style": "index.css" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/roots_fall_through/index.js b/fixtures/enhanced_resolve/test/fixtures/roots_fall_through/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/main.js b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json deleted file mode 100644 index 70a0f20f..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "browser": { - "./index.js": "./main.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/lib/index.js b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/lib/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/main.js b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json deleted file mode 100644 index 2af9e0d1..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "./main.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/shortcutdir.js/a.js b/fixtures/enhanced_resolve/test/fixtures/shortcutdir.js/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/b b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/b deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/c b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/c deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/a b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/a deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/b b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/b deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/b/foo/a b/fixtures/enhanced_resolve/test/fixtures/yield/b/foo/a deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/a b/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/a deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json b/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json deleted file mode 100644 index 0acc4b4c..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "foo", - "version": "1.0.0", - "browser": { - "./a": false - } -} diff --git "a/fixtures/enhanced_resolve/test/fixtures/\346\265\213\350\257\225.js" "b/fixtures/enhanced_resolve/test/fixtures/\346\265\213\350\257\225.js" deleted file mode 100644 index e69de29b..00000000 diff --git "a/fixtures/misc/\344\270\255\346\226\207/\344\270\255\346\226\207.js" "b/fixtures/misc/\344\270\255\346\226\207/\344\270\255\346\226\207.js" deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/pnpm8/.gitignore b/fixtures/pnpm8/.gitignore deleted file mode 100644 index 3c3629e6..00000000 --- a/fixtures/pnpm8/.gitignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/fixtures/pnpm8/package.json b/fixtures/pnpm8/package.json deleted file mode 100644 index cbced892..00000000 --- a/fixtures/pnpm8/package.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "name": "pnpm8", - "version": "1.0.0", - "private": true, - "engines": { - "node": ">=16.0.0" - }, - "packageManager": "pnpm@8.10.5", - "devDependencies": { - "axios": "1.6.2", - "styled-components": "6.1.1", - "postcss": "8.4.33" - } -} diff --git a/fixtures/pnpm8/pnpm-lock.yaml b/fixtures/pnpm8/pnpm-lock.yaml deleted file mode 100644 index e51dfd6a..00000000 --- a/fixtures/pnpm8/pnpm-lock.yaml +++ /dev/null @@ -1,212 +0,0 @@ -lockfileVersion: '6.0' - -settings: - autoInstallPeers: true - excludeLinksFromLockfile: false - -devDependencies: - axios: - specifier: 1.6.2 - version: 1.6.2 - postcss: - specifier: 8.4.33 - version: 8.4.33 - styled-components: - specifier: 6.1.1 - version: 6.1.1(react-dom@18.2.0)(react@18.2.0) - -packages: - - /@emotion/is-prop-valid@1.2.1: - resolution: {integrity: sha512-61Mf7Ufx4aDxx1xlDeOm8aFFigGHE4z+0sKCa+IHCeZKiyP9RLD0Mmx7m8b9/Cf37f7NAvQOOJAbQQGVr5uERw==} - dependencies: - '@emotion/memoize': 0.8.1 - dev: true - - /@emotion/memoize@0.8.1: - resolution: {integrity: sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA==} - dev: true - - /@emotion/unitless@0.8.1: - resolution: {integrity: sha512-KOEGMu6dmJZtpadb476IsZBclKvILjopjUii3V+7MnXIQCYh8W3NgNcgwo21n9LXZX6EDIKvqfjYxXebDwxKmQ==} - dev: true - - /@types/stylis@4.2.4: - resolution: {integrity: sha512-36ZrGJ8fgtBr6nwNnuJ9jXIj+bn/pF6UoqmrQT7+Y99+tFFeHHsoR54+194dHdyhPjgbeoNz3Qru0oRt0l6ASQ==} - dev: true - - /asynckit@0.4.0: - resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} - dev: true - - /axios@1.6.2: - resolution: {integrity: sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A==} - dependencies: - follow-redirects: 1.15.3 - form-data: 4.0.0 - proxy-from-env: 1.1.0 - transitivePeerDependencies: - - debug - dev: true - - /camelize@1.0.1: - resolution: {integrity: sha512-dU+Tx2fsypxTgtLoE36npi3UqcjSSMNYfkqgmoEhtZrraP5VWq0K7FkWVTYa8eMPtnU/G2txVsfdCJTn9uzpuQ==} - dev: true - - /combined-stream@1.0.8: - resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} - engines: {node: '>= 0.8'} - dependencies: - delayed-stream: 1.0.0 - dev: true - - /css-color-keywords@1.0.0: - resolution: {integrity: sha512-FyyrDHZKEjXDpNJYvVsV960FiqQyXc/LlYmsxl2BcdMb2WPx0OGRVgTg55rPSyLSNMqP52R9r8geSp7apN3Ofg==} - engines: {node: '>=4'} - dev: true - - /css-to-react-native@3.2.0: - resolution: {integrity: sha512-e8RKaLXMOFii+02mOlqwjbD00KSEKqblnpO9e++1aXS1fPQOpS1YoqdVHBqPjHNoxeF2mimzVqawm2KCbEdtHQ==} - dependencies: - camelize: 1.0.1 - css-color-keywords: 1.0.0 - postcss-value-parser: 4.2.0 - dev: true - - /csstype@3.1.2: - resolution: {integrity: sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==} - dev: true - - /delayed-stream@1.0.0: - resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} - engines: {node: '>=0.4.0'} - dev: true - - /follow-redirects@1.15.3: - resolution: {integrity: sha512-1VzOtuEM8pC9SFU1E+8KfTjZyMztRsgEfwQl44z8A25uy13jSzTj6dyK2Df52iV0vgHCfBwLhDWevLn95w5v6Q==} - engines: {node: '>=4.0'} - peerDependencies: - debug: '*' - peerDependenciesMeta: - debug: - optional: true - dev: true - - /form-data@4.0.0: - resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==} - engines: {node: '>= 6'} - dependencies: - asynckit: 0.4.0 - combined-stream: 1.0.8 - mime-types: 2.1.35 - dev: true - - /js-tokens@4.0.0: - resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} - dev: true - - /loose-envify@1.4.0: - resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==} - hasBin: true - dependencies: - js-tokens: 4.0.0 - dev: true - - /mime-db@1.52.0: - resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} - engines: {node: '>= 0.6'} - dev: true - - /mime-types@2.1.35: - resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} - engines: {node: '>= 0.6'} - dependencies: - mime-db: 1.52.0 - dev: true - - /nanoid@3.3.7: - resolution: {integrity: sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==} - engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} - hasBin: true - dev: true - - /picocolors@1.0.0: - resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==} - dev: true - - /postcss-value-parser@4.2.0: - resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==} - dev: true - - /postcss@8.4.33: - resolution: {integrity: sha512-Kkpbhhdjw2qQs2O2DGX+8m5OVqEcbB9HRBvuYM9pgrjEFUg30A9LmXNlTAUj4S9kgtGyrMbTzVjH7E+s5Re2yg==} - engines: {node: ^10 || ^12 || >=14} - dependencies: - nanoid: 3.3.7 - picocolors: 1.0.0 - source-map-js: 1.0.2 - dev: true - - /proxy-from-env@1.1.0: - resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==} - dev: true - - /react-dom@18.2.0(react@18.2.0): - resolution: {integrity: sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==} - peerDependencies: - react: ^18.2.0 - dependencies: - loose-envify: 1.4.0 - react: 18.2.0 - scheduler: 0.23.0 - dev: true - - /react@18.2.0: - resolution: {integrity: sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==} - engines: {node: '>=0.10.0'} - dependencies: - loose-envify: 1.4.0 - dev: true - - /scheduler@0.23.0: - resolution: {integrity: sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw==} - dependencies: - loose-envify: 1.4.0 - dev: true - - /shallowequal@1.1.0: - resolution: {integrity: sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ==} - dev: true - - /source-map-js@1.0.2: - resolution: {integrity: sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==} - engines: {node: '>=0.10.0'} - dev: true - - /styled-components@6.1.1(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-cpZZP5RrKRIClBW5Eby4JM1wElLVP4NQrJbJ0h10TidTyJf4SIIwa3zLXOoPb4gJi8MsJ8mjq5mu2IrEhZIAcQ==} - engines: {node: '>= 16'} - peerDependencies: - react: '>= 16.8.0' - react-dom: '>= 16.8.0' - dependencies: - '@emotion/is-prop-valid': 1.2.1 - '@emotion/unitless': 0.8.1 - '@types/stylis': 4.2.4 - css-to-react-native: 3.2.0 - csstype: 3.1.2 - postcss: 8.4.33 - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - shallowequal: 1.1.0 - stylis: 4.3.0 - tslib: 2.6.2 - dev: true - - /stylis@4.3.0: - resolution: {integrity: sha512-E87pIogpwUsUwXw7dNyU4QDjdgVMy52m+XEOPEKUn161cCzWjjhPSQhByfd1CcNvrOLnXQ6OnnZDwnJrz/Z4YQ==} - dev: true - - /tslib@2.6.2: - resolution: {integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==} - dev: true diff --git a/fixtures/tsconfig/cases/builtins/thing.js b/fixtures/tsconfig/cases/builtins/thing.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/builtins/tsconfig.json b/fixtures/tsconfig/cases/builtins/tsconfig.json deleted file mode 100644 index 36aa1a4d..00000000 --- a/fixtures/tsconfig/cases/builtins/tsconfig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compilerOptions": { - "baseUrl": "." - } -} diff --git a/fixtures/tsconfig/cases/exports/index.js b/fixtures/tsconfig/cases/exports/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/exports/tsconfig.json b/fixtures/tsconfig/cases/exports/tsconfig.json deleted file mode 100644 index f0e3159b..00000000 --- a/fixtures/tsconfig/cases/exports/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-exports" -} diff --git a/fixtures/tsconfig/cases/extends-extension/base-tsconfig.json b/fixtures/tsconfig/cases/extends-extension/base-tsconfig.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/cases/extends-extension/base-tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/cases/extends-extension/foo.js b/fixtures/tsconfig/cases/extends-extension/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-extension/tsconfig.json b/fixtures/tsconfig/cases/extends-extension/tsconfig.json deleted file mode 100644 index 0ae4c6a3..00000000 --- a/fixtures/tsconfig/cases/extends-extension/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./base-tsconfig" -} diff --git a/fixtures/tsconfig/cases/extends-extensionless/foo.js b/fixtures/tsconfig/cases/extends-extensionless/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-extensionless/tsconfig.json b/fixtures/tsconfig/cases/extends-extensionless/tsconfig.json deleted file mode 100644 index c36cb7d4..00000000 --- a/fixtures/tsconfig/cases/extends-extensionless/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-field/conf" -} diff --git a/fixtures/tsconfig/cases/extends-multiple/foo.js b/fixtures/tsconfig/cases/extends-multiple/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-multiple/tsconfig.json b/fixtures/tsconfig/cases/extends-multiple/tsconfig.json deleted file mode 100644 index aa2ae783..00000000 --- a/fixtures/tsconfig/cases/extends-multiple/tsconfig.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": ["../extends-extension", "../extends-paths"], - "compilerOptions": { - "baseUrl": ".", - }, -} diff --git a/fixtures/tsconfig/cases/extends-not-found/index.js b/fixtures/tsconfig/cases/extends-not-found/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-not-found/tsconfig.json b/fixtures/tsconfig/cases/extends-not-found/tsconfig.json deleted file mode 100644 index 99df91da..00000000 --- a/fixtures/tsconfig/cases/extends-not-found/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./not-found" -} diff --git a/fixtures/tsconfig/cases/extends-paths/src/index.js b/fixtures/tsconfig/cases/extends-paths/src/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-paths/tsconfig.base.json b/fixtures/tsconfig/cases/extends-paths/tsconfig.base.json deleted file mode 100644 index 5c64b067..00000000 --- a/fixtures/tsconfig/cases/extends-paths/tsconfig.base.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "@/*": ["./*"] - } - } -} diff --git a/fixtures/tsconfig/cases/extends-paths/tsconfig.json b/fixtures/tsconfig/cases/extends-paths/tsconfig.json deleted file mode 100644 index 51086018..00000000 --- a/fixtures/tsconfig/cases/extends-paths/tsconfig.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": "./tsconfig.base.json", - "compilerOptions": { - "baseUrl": "src", - }, -} diff --git a/fixtures/tsconfig/cases/field/index.js b/fixtures/tsconfig/cases/field/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/field/tsconfig.json b/fixtures/tsconfig/cases/field/tsconfig.json deleted file mode 100644 index 9f86c3f4..00000000 --- a/fixtures/tsconfig/cases/field/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-field" -} diff --git a/fixtures/tsconfig/cases/index/index.js b/fixtures/tsconfig/cases/index/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/index/tsconfig.json b/fixtures/tsconfig/cases/index/tsconfig.json deleted file mode 100644 index d20b1774..00000000 --- a/fixtures/tsconfig/cases/index/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-index" -} diff --git a/fixtures/tsconfig/cases/paths_template_variable/foo.js b/fixtures/tsconfig/cases/paths_template_variable/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json b/fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json deleted file mode 100644 index a1a37bb6..00000000 --- a/fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "../../tsconfig_template_variable.json" -} diff --git a/fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json b/fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json deleted file mode 100644 index e7d8e5e5..00000000 --- a/fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "compilerOptions": { - "composite": true, - "paths": { - "foo": ["${configDir}/foo.js"] - } - } -} diff --git a/fixtures/tsconfig/cases/project_references/app/aliased/index.ts b/fixtures/tsconfig/cases/project_references/app/aliased/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/app/index.ts b/fixtures/tsconfig/cases/project_references/app/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/app/tsconfig.json b/fixtures/tsconfig/cases/project_references/app/tsconfig.json deleted file mode 100644 index 7036d2bb..00000000 --- a/fixtures/tsconfig/cases/project_references/app/tsconfig.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "extends": "../tsconfig.base.json", - "compilerOptions": { - "baseUrl": "./", - "paths": { - "@/*": ["./aliased/*"] - } - }, - "references": [ - { - "path": "../project_a/conf.json" - }, - { - "path": "../project_b" - }, - { - "path": "../project_c/tsconfig.json" - }, - { - "path": "../../paths_template_variable/tsconfig2.json" - } - ] -} diff --git a/fixtures/tsconfig/cases/project_references/project_a/aliased/index.ts b/fixtures/tsconfig/cases/project_references/project_a/aliased/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_a/conf.json b/fixtures/tsconfig/cases/project_references/project_a/conf.json deleted file mode 100644 index 4d389d7a..00000000 --- a/fixtures/tsconfig/cases/project_references/project_a/conf.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "compilerOptions": { - "composite": true, - "paths": { - "@/*": ["./aliased/*"] - } - } -} diff --git a/fixtures/tsconfig/cases/project_references/project_a/index.ts b/fixtures/tsconfig/cases/project_references/project_a/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_b/src/aliased/index.ts b/fixtures/tsconfig/cases/project_references/project_b/src/aliased/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_b/tsconfig.json b/fixtures/tsconfig/cases/project_references/project_b/tsconfig.json deleted file mode 100644 index 4ab05cd8..00000000 --- a/fixtures/tsconfig/cases/project_references/project_b/tsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "compilerOptions": { - "composite": true, - "baseUrl": "./src", - "paths": { - "@/*": ["./aliased/*"] - } - } -} diff --git a/fixtures/tsconfig/cases/project_references/project_c/index.ts b/fixtures/tsconfig/cases/project_references/project_c/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_c/tsconfig.json b/fixtures/tsconfig/cases/project_references/project_c/tsconfig.json deleted file mode 100644 index fe520939..00000000 --- a/fixtures/tsconfig/cases/project_references/project_c/tsconfig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compilerOptions": { - "composite": true - } -} diff --git a/fixtures/tsconfig/cases/project_references/tsconfig.base.json b/fixtures/tsconfig/cases/project_references/tsconfig.base.json deleted file mode 100644 index 88ccffe7..00000000 --- a/fixtures/tsconfig/cases/project_references/tsconfig.base.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "compilerOptions": { - } -} diff --git a/fixtures/tsconfig/cases/suffixes/a.ios.ts b/fixtures/tsconfig/cases/suffixes/a.ios.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/a.ts b/fixtures/tsconfig/cases/suffixes/a.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/b.ts b/fixtures/tsconfig/cases/suffixes/b.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/c-test.ts b/fixtures/tsconfig/cases/suffixes/c-test.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/index.ts b/fixtures/tsconfig/cases/suffixes/index.ts deleted file mode 100644 index b09939b9..00000000 --- a/fixtures/tsconfig/cases/suffixes/index.ts +++ /dev/null @@ -1 +0,0 @@ -import './a'; diff --git a/fixtures/tsconfig/cases/suffixes/tsconfig.json b/fixtures/tsconfig/cases/suffixes/tsconfig.json deleted file mode 100644 index 4c2ccc8f..00000000 --- a/fixtures/tsconfig/cases/suffixes/tsconfig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compilerOptions": { - "moduleSuffixes": [".ios", "-test", ""] - } -} diff --git a/fixtures/tsconfig/cases/trailing-comma/bar.js b/fixtures/tsconfig/cases/trailing-comma/bar.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/trailing-comma/index.js b/fixtures/tsconfig/cases/trailing-comma/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/trailing-comma/tsconfig.json b/fixtures/tsconfig/cases/trailing-comma/tsconfig.json deleted file mode 100644 index 6dc20ca5..00000000 --- a/fixtures/tsconfig/cases/trailing-comma/tsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "compilerOptions": { - "paths": { - /* some comment */ - "foo": ["bar.js"], - }, - }, - // another comment -} diff --git a/fixtures/tsconfig/foo.js b/fixtures/tsconfig/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/nested/index.js b/fixtures/tsconfig/nested/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/nested/test.js b/fixtures/tsconfig/nested/test.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/nested/tsconfig.json b/fixtures/tsconfig/nested/tsconfig.json deleted file mode 100644 index 6deb3011..00000000 --- a/fixtures/tsconfig/nested/tsconfig.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "extends": "..", - "compilerOptions": { - "paths": { - "ts-path": ["test.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-exports/conf.json b/fixtures/tsconfig/node_modules/tsconfig-exports/conf.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-exports/conf.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-exports/foo.js b/fixtures/tsconfig/node_modules/tsconfig-exports/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-exports/package.json b/fixtures/tsconfig/node_modules/tsconfig-exports/package.json deleted file mode 100644 index be0ddee6..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-exports/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "tsconfig-exports", - "private": true, - "exports": { - ".": "./conf.json" - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-field/conf.json b/fixtures/tsconfig/node_modules/tsconfig-field/conf.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-field/conf.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-field/foo.js b/fixtures/tsconfig/node_modules/tsconfig-field/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-field/package.json b/fixtures/tsconfig/node_modules/tsconfig-field/package.json deleted file mode 100644 index 7138fdde..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-field/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "tsconfig-field", - "private": true, - "tsconfig": "conf.json" -} \ No newline at end of file diff --git a/fixtures/tsconfig/node_modules/tsconfig-index/foo.js b/fixtures/tsconfig/node_modules/tsconfig-index/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-index/package.json b/fixtures/tsconfig/node_modules/tsconfig-index/package.json deleted file mode 100644 index eb2431e7..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-index/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "tsconfig-index", - "private": true -} \ No newline at end of file diff --git a/fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json b/fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-not-used/foo.js b/fixtures/tsconfig/node_modules/tsconfig-not-used/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json b/fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json deleted file mode 100644 index eb16d127..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "ts-path": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/package.json b/fixtures/tsconfig/package.json deleted file mode 100755 index f48acd1c..00000000 --- a/fixtures/tsconfig/package.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "name": "resolver", - "private": true, - "alias": { - "aliased": "foo", - "aliased-file": "./bar.js", - "something": "./nested/test.js", - "aliasedfolder": "./nested", - "aliasedabsolute": "/nested", - "foo/bar": "./bar.js", - "glob/*/*": "./nested/$2", - "./baz": "./bar.js", - "url": false - }, - "imports": { - "#test": "./bar.js" - }, - "dependencies": { - "foo": "^0.3.4" - }, - "peerDependencies": { - "bar": "*" - } -} diff --git a/fixtures/tsconfig/tsconfig.json b/fixtures/tsconfig/tsconfig.json deleted file mode 100644 index eb16d127..00000000 --- a/fixtures/tsconfig/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "ts-path": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/tsconfig_template_variable.json b/fixtures/tsconfig/tsconfig_template_variable.json deleted file mode 100644 index 6f272344..00000000 --- a/fixtures/tsconfig/tsconfig_template_variable.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["${configDir}/foo.js"] - } - } -} diff --git a/napi/__test__/resolver.spec.mjs b/napi/__test__/resolver.spec.mjs deleted file mode 100644 index 42bafba9..00000000 --- a/napi/__test__/resolver.spec.mjs +++ /dev/null @@ -1,259 +0,0 @@ -import { join } from 'node:path' -import { fileURLToPath } from 'node:url' - -import test from 'ava' - -let ResolverFactory - -if (process.env.WASI_TEST) { - const wasi = await import('../resolver.wasi.cjs') - ResolverFactory = wasi.ResolverFactory -} else { - const napi = await import('../index.js') - ResolverFactory = napi.ResolverFactory -} - -const currentDir = join(fileURLToPath(import.meta.url), '..') - -const enhancedResolveRoot = join( - currentDir, - '..', - '..', - 'fixtures', - 'enhanced_resolve', - 'test', - 'fixtures' -) - -// https://github.com/webpack/enhanced-resolve/blob/main/test/resolve.test.js - -for (const [title, context, request, expected] of [ - [ - 'absolute path', - enhancedResolveRoot, - join(enhancedResolveRoot, 'main1.js'), - join(enhancedResolveRoot, 'main1.js'), - ], - [ - 'file with .js', - enhancedResolveRoot, - './main1.js', - join(enhancedResolveRoot, 'main1.js'), - ], - [ - 'file without extension', - enhancedResolveRoot, - './main1', - join(enhancedResolveRoot, 'main1.js'), - ], - [ - 'another file with .js', - enhancedResolveRoot, - './a.js', - join(enhancedResolveRoot, 'a.js'), - ], - [ - 'another file without extension', - enhancedResolveRoot, - './a', - join(enhancedResolveRoot, 'a.js'), - ], - [ - 'file in module with .js', - enhancedResolveRoot, - 'm1/a.js', - join(enhancedResolveRoot, 'node_modules/m1/a.js'), - ], - [ - 'file in module without extension', - enhancedResolveRoot, - 'm1/a', - join(enhancedResolveRoot, 'node_modules/m1/a.js'), - ], - [ - 'another file in module without extension', - enhancedResolveRoot, - 'complexm/step1', - join(enhancedResolveRoot, 'node_modules/complexm/step1.js'), - ], - [ - 'from submodule to file in sibling module', - join(enhancedResolveRoot, 'node_modules/complexm'), - 'm2/b.js', - join(enhancedResolveRoot, 'node_modules/m2/b.js'), - ], - [ - 'from nested directory to overwritten file in module', - join(enhancedResolveRoot, 'multiple_modules'), - 'm1/a.js', - join(enhancedResolveRoot, 'multiple_modules/node_modules/m1/a.js'), - ], - [ - 'from nested directory to not overwritten file in module', - join(enhancedResolveRoot, 'multiple_modules'), - 'm1/b.js', - join(enhancedResolveRoot, 'node_modules/m1/b.js'), - ], - [ - 'file with query', - enhancedResolveRoot, - './main1.js?query', - join(enhancedResolveRoot, 'main1.js?query'), - ], - [ - 'file with fragment', - enhancedResolveRoot, - './main1.js#fragment', - join(enhancedResolveRoot, 'main1.js#fragment'), - ], - [ - 'file with fragment and query', - enhancedResolveRoot, - './main1.js#fragment?query', - join(enhancedResolveRoot, 'main1.js#fragment?query'), - ], - [ - 'file with query and fragment', - enhancedResolveRoot, - './main1.js?#fragment', - join(enhancedResolveRoot, 'main1.js?#fragment'), - ], - - [ - 'file with query (unicode)', - enhancedResolveRoot, - './测试.js?query', - join(enhancedResolveRoot, '测试.js?query'), - ], - [ - 'file with fragment (unicode)', - enhancedResolveRoot, - './测试.js#fragment', - join(enhancedResolveRoot, '测试.js#fragment'), - ], - [ - 'file with fragment and query (unicode)', - enhancedResolveRoot, - './测试.js#fragment?query', - join(enhancedResolveRoot, '测试.js#fragment?query'), - ], - [ - 'file with query and fragment (unicode)', - enhancedResolveRoot, - './测试.js?#fragment', - join(enhancedResolveRoot, '测试.js?#fragment'), - ], - - [ - 'file in module with query', - enhancedResolveRoot, - 'm1/a?query', - join(enhancedResolveRoot, 'node_modules/m1/a.js?query'), - ], - [ - 'file in module with fragment', - enhancedResolveRoot, - 'm1/a#fragment', - join(enhancedResolveRoot, 'node_modules/m1/a.js#fragment'), - ], - [ - 'file in module with fragment and query', - enhancedResolveRoot, - 'm1/a#fragment?query', - join(enhancedResolveRoot, 'node_modules/m1/a.js#fragment?query'), - ], - [ - 'file in module with query and fragment', - enhancedResolveRoot, - 'm1/a?#fragment', - join(enhancedResolveRoot, 'node_modules/m1/a.js?#fragment'), - ], - [ - 'differ between directory and file, resolve file', - enhancedResolveRoot, - './dirOrFile', - join(enhancedResolveRoot, 'dirOrFile.js'), - ], - [ - 'differ between directory and file, resolve directory', - enhancedResolveRoot, - './dirOrFile/', - join(enhancedResolveRoot, 'dirOrFile/index.js'), - ], - [ - 'find node_modules outside of node_modules', - join(enhancedResolveRoot, 'browser-module/node_modules'), - 'm1/a', - join(enhancedResolveRoot, 'node_modules/m1/a.js'), - ], - [ - "don't crash on main field pointing to self", - enhancedResolveRoot, - './main-field-self', - join(enhancedResolveRoot, './main-field-self/index.js'), - ], - [ - "don't crash on main field pointing to self (2)", - enhancedResolveRoot, - './main-field-self2', - join(enhancedResolveRoot, './main-field-self2/index.js'), - ], - // enhanced-resolve has `#` prepended with a `\0`, they are removed from the - // following 3 expected test results. - // See https://github.com/webpack/enhanced-resolve#escaping - [ - 'handle fragment edge case (no fragment)', - enhancedResolveRoot, - './no#fragment/#/#', - join(enhancedResolveRoot, 'no#fragment', '#', '#.js'), - ], - [ - 'handle fragment edge case (fragment)', - enhancedResolveRoot, - './no#fragment/#/', - join(enhancedResolveRoot, 'no.js#fragment') + '/#/', - ], - [ - 'handle fragment escaping', - enhancedResolveRoot, - './no\0#fragment/\0#/\0##fragment', - join(enhancedResolveRoot, 'no#fragment', '#', '#.js#fragment'), - ], -]) { - test(title, (t) => { - const resolver = new ResolverFactory({ - modules: ['src/a', 'src/b', 'src/common', 'node_modules'], - extensions: ['.js', '.jsx', '.ts', '.tsx'], - }) - - t.is(resolver.sync(context, request).path, expected) - }) -} - -test('resolve pnpm package', (t) => { - const pnpmProjectPath = join(currentDir, '..', '..', 'fixtures', 'pnpm8') - const resolver = new ResolverFactory({ - aliasFields: ['browser'], - }) - t.deepEqual(resolver.sync(pnpmProjectPath, 'styled-components'), { - path: join( - pnpmProjectPath, - 'node_modules/.pnpm/styled-components@6.1.1_react-dom@18.2.0_react@18.2.0/node_modules/styled-components/dist/styled-components.browser.cjs.js' - ), - }) - t.deepEqual( - resolver.sync( - join( - pnpmProjectPath, - 'node_modules/.pnpm/styled-components@6.1.1_react-dom@18.2.0_react@18.2.0/node_modules/styled-components' - ), - 'react' - ), - { - path: join( - pnpmProjectPath, - 'node_modules/.pnpm/react@18.2.0/node_modules/react/index.js' - ), - } - ) -}) diff --git a/napi/src/lib.rs b/napi/src/lib.rs deleted file mode 100644 index 238f99c4..00000000 --- a/napi/src/lib.rs +++ /dev/null @@ -1,166 +0,0 @@ -extern crate napi; -extern crate napi_derive; -extern crate oxc_resolver; - -use std::path::{Path, PathBuf}; - -use napi_derive::napi; -use oxc_resolver::{ResolveOptions, Resolver}; - -use self::options::{NapiResolveOptions, StrOrStrList}; - -mod options; - -#[napi(object)] -pub struct ResolveResult { - pub path: Option, - pub error: Option, -} - -fn resolve(resolver: &Resolver, path: &Path, request: &str) -> ResolveResult { - match resolver.resolve(path, request) { - Ok(resolution) => ResolveResult { - path: Some(resolution.full_path().to_string_lossy().to_string()), - error: None, - }, - Err(err) => ResolveResult { path: None, error: Some(err.to_string()) }, - } -} - -#[allow(clippy::needless_pass_by_value)] -#[napi] -pub fn sync(path: String, request: String) -> ResolveResult { - let path = PathBuf::from(path); - let resolver = Resolver::new(ResolveOptions::default()); - resolve(&resolver, &path, &request) -} - -#[napi] -pub struct ResolverFactory { - resolver: Resolver, -} - -#[napi] -impl ResolverFactory { - #[napi(constructor)] - pub fn new(options: NapiResolveOptions) -> Self { - Self { resolver: Resolver::new(Self::normalize_options(options)) } - } - - #[napi] - pub fn default() -> Self { - let default_options = ResolveOptions::default(); - Self { resolver: Resolver::new(default_options) } - } - - /// Clone the resolver using the same underlying cache. - #[napi] - pub fn clone_with_options(&self, options: NapiResolveOptions) -> Self { - Self { resolver: self.resolver.clone_with_options(Self::normalize_options(options)) } - } - - /// Clear the underlying cache. - #[napi] - pub fn clear_cache(&self) { - self.resolver.clear_cache(); - } - - #[allow(clippy::needless_pass_by_value)] - #[napi] - pub fn sync(&self, path: String, request: String) -> ResolveResult { - let path = PathBuf::from(path); - resolve(&self.resolver, &path, &request) - } - - fn normalize_options(op: NapiResolveOptions) -> ResolveOptions { - let default = ResolveOptions::default(); - // merging options - ResolveOptions { - tsconfig: op.tsconfig.map(|tsconfig| tsconfig.into()), - alias: op - .alias - .map(|alias| { - alias - .into_iter() - .map(|(k, v)| { - let v = v - .into_iter() - .map(|item| match item { - Some(path) => oxc_resolver::AliasValue::from(path), - None => oxc_resolver::AliasValue::Ignore, - }) - .collect(); - (k, v) - }) - .collect::>() - }) - .unwrap_or(default.alias), - alias_fields: op - .alias_fields - .map(|o| o.into_iter().map(|x| StrOrStrList(x).into()).collect::>()) - .unwrap_or(default.alias_fields), - condition_names: op.condition_names.unwrap_or(default.condition_names), - description_files: op.description_files.unwrap_or(default.description_files), - enforce_extension: op - .enforce_extension - .map(|enforce_extension| enforce_extension.into()) - .unwrap_or(default.enforce_extension), - exports_fields: op - .exports_fields - .map(|o| o.into_iter().map(|x| StrOrStrList(x).into()).collect::>()) - .unwrap_or(default.exports_fields), - imports_fields: op - .imports_fields - .map(|o| o.into_iter().map(|x| StrOrStrList(x).into()).collect::>()) - .unwrap_or(default.imports_fields), - extension_alias: op - .extension_alias - .map(|extension_alias| extension_alias.into_iter().collect::>()) - .unwrap_or(default.extension_alias), - extensions: op.extensions.unwrap_or(default.extensions), - fallback: op - .fallback - .map(|fallback| { - fallback - .into_iter() - .map(|(k, v)| { - let v = v - .into_iter() - .map(|item| match item { - Some(path) => oxc_resolver::AliasValue::from(path), - None => oxc_resolver::AliasValue::Ignore, - }) - .collect(); - (k, v) - }) - .collect::>() - }) - .unwrap_or(default.fallback), - fully_specified: op.fully_specified.unwrap_or(default.fully_specified), - main_fields: op - .main_fields - .map(|o| StrOrStrList(o).into()) - .unwrap_or(default.main_fields), - main_files: op.main_files.unwrap_or(default.main_files), - modules: op.modules.map(|o| StrOrStrList(o).into()).unwrap_or(default.modules), - resolve_to_context: op.resolve_to_context.unwrap_or(default.resolve_to_context), - prefer_relative: op.prefer_relative.unwrap_or(default.prefer_relative), - prefer_absolute: op.prefer_absolute.unwrap_or(default.prefer_absolute), - restrictions: op - .restrictions - .map(|restrictions| { - restrictions - .into_iter() - .map(|restriction| restriction.into()) - .collect::>() - }) - .unwrap_or(default.restrictions), - roots: op - .roots - .map(|roots| roots.into_iter().map(PathBuf::from).collect::>()) - .unwrap_or(default.roots), - symlinks: op.symlinks.unwrap_or(default.symlinks), - builtin_modules: op.builtin_modules.unwrap_or(default.builtin_modules), - } - } -} diff --git a/napi/src/options.rs b/napi/src/options.rs deleted file mode 100644 index ea35672f..00000000 --- a/napi/src/options.rs +++ /dev/null @@ -1,261 +0,0 @@ -use std::path::PathBuf; - -use napi::Either; -use napi_derive::napi; -use std::collections::HashMap; - -/// Module Resolution Options -/// -/// Options are directly ported from [enhanced-resolve](https://github.com/webpack/enhanced-resolve#resolver-options). -/// -/// See [webpack resolve](https://webpack.js.org/configuration/resolve/) for information and examples -#[derive(Debug, Clone)] -#[napi(object)] -pub struct NapiResolveOptions { - /// Path to TypeScript configuration file. - /// - /// Default `None` - pub tsconfig: Option, - - /// Alias for [ResolveOptions::alias] and [ResolveOptions::fallback]. - /// - /// For the second value of the tuple, `None -> AliasValue::Ignore`, Some(String) -> - /// AliasValue::Path(String)` - /// Create aliases to import or require certain modules more easily. - /// A trailing $ can also be added to the given object's keys to signify an exact match. - pub alias: Option>>>, - - /// A list of alias fields in description files. - /// Specify a field, such as `browser`, to be parsed according to [this specification](https://github.com/defunctzombie/package-browser-field-spec). - /// Can be a path to json object such as `["path", "to", "exports"]`. - /// - /// Default `[]` - #[napi(ts_type = "(string | string[])[]")] - pub alias_fields: Option>, - - /// Condition names for exports field which defines entry points of a package. - /// The key order in the exports field is significant. During condition matching, earlier entries have higher priority and take precedence over later entries. - /// - /// Default `[]` - pub condition_names: Option>, - - /// The JSON files to use for descriptions. (There was once a `bower.json`.) - /// - /// Default `["package.json"]` - pub description_files: Option>, - - /// If true, it will not allow extension-less files. - /// So by default `require('./foo')` works if `./foo` has a `.js` extension, - /// but with this enabled only `require('./foo.js')` will work. - /// - /// Default to `true` when [ResolveOptions::extensions] contains an empty string. - /// Use `Some(false)` to disable the behavior. - /// See - /// - /// Default None, which is the same as `Some(false)` when the above empty rule is not applied. - pub enforce_extension: Option, - - /// A list of exports fields in description files. - /// Can be a path to json object such as `["path", "to", "exports"]`. - /// - /// Default `[["exports"]]`. - #[napi(ts_type = "(string | string[])[]")] - pub exports_fields: Option>, - - /// Fields from `package.json` which are used to provide the internal requests of a package - /// (requests starting with # are considered internal). - /// - /// Can be a path to a JSON object such as `["path", "to", "imports"]`. - /// - /// Default `[["imports"]]`. - #[napi(ts_type = "(string | string[])[]")] - pub imports_fields: Option>, - - /// An object which maps extension to extension aliases. - /// - /// Default `{}` - pub extension_alias: Option>>, - - /// Attempt to resolve these extensions in order. - /// If multiple files share the same name but have different extensions, - /// will resolve the one with the extension listed first in the array and skip the rest. - /// - /// Default `[".js", ".json", ".node"]` - pub extensions: Option>, - - /// Redirect module requests when normal resolving fails. - /// - /// Default `[]` - pub fallback: Option>>>, - - /// 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). - /// - /// See also webpack configuration [resolve.fullySpecified](https://webpack.js.org/configuration/module/#resolvefullyspecified) - /// - /// Default `false` - pub fully_specified: Option, - - /// A list of main fields in description files - /// - /// Default `["main"]`. - #[napi(ts_type = "string | string[]")] - pub main_fields: Option, - - /// The filename to be used while resolving directories. - /// - /// Default `["index"]` - pub main_files: Option>, - - /// A list of directories to resolve modules from, can be absolute path or folder name. - /// - /// Default `["node_modules"]` - #[napi(ts_type = "string | string[]")] - pub modules: Option, - - /// Resolve to a context instead of a file. - /// - /// Default `false` - pub resolve_to_context: Option, - - /// Prefer to resolve module requests as relative requests instead of using modules from node_modules directories. - /// - /// Default `false` - pub prefer_relative: Option, - - /// Prefer to resolve server-relative urls as absolute paths before falling back to resolve in ResolveOptions::roots. - /// - /// Default `false` - pub prefer_absolute: Option, - - /// A list of resolve restrictions to restrict the paths that a request can be resolved on. - /// - /// Default `[]` - pub restrictions: Option>, - - /// A list of directories where requests of server-relative URLs (starting with '/') are resolved. - /// On non-Windows systems these requests are resolved as an absolute path first. - /// - /// Default `[]` - pub roots: Option>, - - /// Whether to resolve symlinks to their symlinked location. - /// When enabled, symlinked resources are resolved to their real path, not their symlinked location. - /// Note that this may cause module resolution to fail when using tools that symlink packages (like npm link). - /// - /// Default `true` - pub symlinks: Option, - - /// Whether to parse [module.builtinModules](https://nodejs.org/api/module.html#modulebuiltinmodules) or not. - /// For example, "zlib" will throw [crate::ResolveError::Builtin] when set to true. - /// - /// Default `false` - pub builtin_modules: Option, -} - -#[napi] -#[derive(Debug, PartialEq, Eq)] -pub enum EnforceExtension { - Auto, - Enabled, - Disabled, -} - -impl EnforceExtension { - pub fn is_auto(&self) -> bool { - *self == Self::Auto - } - - pub fn is_enabled(&self) -> bool { - *self == Self::Enabled - } - - pub fn is_disabled(&self) -> bool { - *self == Self::Disabled - } -} - -/// Alias Value for [ResolveOptions::alias] and [ResolveOptions::fallback]. -/// Use struct because napi don't support structured union now -#[napi(object)] -#[derive(Debug, Clone)] -pub struct Restriction { - pub path: Option, - pub regex: Option, -} - -/// Tsconfig Options -/// -/// Derived from [tsconfig-paths-webpack-plugin](https://github.com/dividab/tsconfig-paths-webpack-plugin#options) -#[napi(object)] -#[derive(Debug, Clone)] -pub struct TsconfigOptions { - /// Allows you to specify where to find the TypeScript configuration file. - /// You may provide - /// * a relative path to the configuration file. It will be resolved relative to cwd. - /// * an absolute path to the configuration file. - pub config_file: String, - - /// Support for Typescript Project References. - /// - /// * `'auto'`: use the `references` field from tsconfig of `config_file`. - /// * `string[]`: manually provided relative or absolute path. - #[napi(ts_type = "'auto' | string[]")] - pub references: Option>>, -} - -impl Into for Restriction { - fn into(self) -> oxc_resolver::Restriction { - match (self.path, self.regex) { - (None, None) => { - panic!("Should specify path or regex") - } - (None, Some(regex)) => oxc_resolver::Restriction::RegExp(regex), - (Some(path), None) => oxc_resolver::Restriction::Path(PathBuf::from(path)), - (Some(_), Some(_)) => { - panic!("Restriction can't be path and regex at the same time") - } - } - } -} - -impl Into for EnforceExtension { - fn into(self) -> oxc_resolver::EnforceExtension { - match self { - EnforceExtension::Auto => oxc_resolver::EnforceExtension::Auto, - EnforceExtension::Enabled => oxc_resolver::EnforceExtension::Enabled, - EnforceExtension::Disabled => oxc_resolver::EnforceExtension::Disabled, - } - } -} - -impl Into for TsconfigOptions { - fn into(self) -> oxc_resolver::TsconfigOptions { - oxc_resolver::TsconfigOptions { - config_file: PathBuf::from(self.config_file), - references: match self.references { - Some(Either::A(string)) if string.as_str() == "auto" => { - oxc_resolver::TsconfigReferences::Auto - } - Some(Either::A(opt)) => { - panic!("`{}` is not a valid option for tsconfig references", opt) - } - Some(Either::B(paths)) => oxc_resolver::TsconfigReferences::Paths( - paths.into_iter().map(PathBuf::from).collect::>(), - ), - None => oxc_resolver::TsconfigReferences::Disabled, - }, - } - } -} - -type StrOrStrListType = Either>; -pub struct StrOrStrList(pub StrOrStrListType); - -impl Into> for StrOrStrList { - fn into(self) -> Vec { - match self { - StrOrStrList(Either::A(s)) => Vec::from([s]), - StrOrStrList(Either::B(a)) => a, - } - } -} diff --git a/napi/tests/options.test.mjs b/napi/tests/options.test.mjs deleted file mode 100644 index 4a93efff..00000000 --- a/napi/tests/options.test.mjs +++ /dev/null @@ -1,59 +0,0 @@ -import { describe, it } from "node:test"; -import { ResolverFactory } from "../index.js"; -import * as assert from "node:assert"; -import * as path from "node:path"; - -const fixtureDir = new URL( - "../../fixtures/enhanced_resolve/test/fixtures", - import.meta.url -).pathname; - -describe("option", () => { - describe("aliasFields", () => { - it("should allow field string ", () => { - const resolver = new ResolverFactory({ aliasFields: ["browser"] }); - assert.match( - resolver.sync(fixtureDir, "./browser-module/lib/replaced.js").path, - /browser-module\/lib\/browser\.js$/ - ); - }); - it("should allow json path array", () => { - const resolver = new ResolverFactory({ - aliasFields: [["innerBrowser1", "field", "browser"]], - }); - - assert.match( - resolver.sync(fixtureDir, "./browser-module/lib/main1.js").path, - /browser-module\/lib\/main\.js$/ - ); - }); - }); - - describe("exportsFields", () => { - const createTest = (exportsFields) => { - const resolver = new ResolverFactory({ exportsFields }); - assert.match( - resolver.sync( - path.resolve(fixtureDir, "./exports-field3"), - "exports-field" - ).path, - /\/exports-field\/src\/index\.js$/ - ); - }; - it("should allow string as field item", createTest(["broken"])); - it("should allow json path array as field item", createTest([["broken"]])); - }); - - describe("mainFields", () => { - const createTest = (mainFields) => { - const resolver = new ResolverFactory({ mainFields }); - assert.match( - resolver.sync(fixtureDir, "../..").path, - /\/lib\/index\.js$/ - ); - }; - it("should use `'main'` as default", createTest(undefined)); - it("should allow field string", createTest("main")); - it("should allow field array", createTest(["main"])); - }); -}); diff --git a/npm/package.json b/npm/package.json index 6fa93185..b47e6b07 100644 --- a/npm/package.json +++ b/npm/package.json @@ -1,41 +1,30 @@ { - "name": "oxc-resolver", - "version": "1.8.1", - "description": "Oxc Resolver Node API", - "main": "index.js", - "browser": "browser.js", - "files": [ - "index.d.ts", - "index.js", - "browser.js" - ], - "license": "MIT", - "homepage": "https://oxc-project.github.io", - "repository": { - "type": "git", - "url": "git+https://github.com/oxc-project/oxc-resolver.git" - }, - "publishConfig": { - "registry": "https://registry.npmjs.org/", - "access": "public" - }, - "napi": { - "binaryName": "resolver", - "packageName": "@oxc-resolver/binding", - "targets": [ - "x86_64-pc-windows-msvc", - "aarch64-pc-windows-msvc", - "x86_64-unknown-linux-gnu", - "x86_64-unknown-linux-musl", - "aarch64-unknown-linux-gnu", - "aarch64-unknown-linux-musl", - "armv7-unknown-linux-gnueabihf", - "x86_64-apple-darwin", - "aarch64-apple-darwin", - "wasm32-wasip1-threads" - ] - }, - "funding": { - "url": "https://github.com/sponsors/Boshen" - } + "name": "oxc-resolver", + "description": "Oxc Resolver Node API", + "funding": { + "url": "https://github.com/sponsors/Boshen" + }, + "main": "index.js", + "browser": "browser.js", + "files": [ + "index.d.ts", + "index.js", + "browser.js" + ], + "napi": { + "binaryName": "resolver", + "packageName": "@oxc-resolver/binding", + "targets": [ + "x86_64-pc-windows-msvc", + "aarch64-pc-windows-msvc", + "x86_64-unknown-linux-gnu", + "x86_64-unknown-linux-musl", + "aarch64-unknown-linux-gnu", + "aarch64-unknown-linux-musl", + "armv7-unknown-linux-gnueabihf", + "x86_64-apple-darwin", + "aarch64-apple-darwin", + "wasm32-wasip1-threads" + ] + } } diff --git a/package.json b/package.json index f9e933c6..c80ccc19 100644 --- a/package.json +++ b/package.json @@ -1,36 +1,24 @@ { - "name": "@oxc-resolver/binding", - "private": true, - "version": "0.0.0", - "scripts": { - "build": "napi build --platform --release --package-json-path npm/package.json --manifest-path napi/Cargo.toml", - "build:debug": "napi build --platform --package-json-path npm/package.json --manifest-path napi/Cargo.toml", - "prepublishOnly": "napi pre-publish -t npm", - "test": "ava" - }, - "devDependencies": { - "@napi-rs/cli": "^3.0.0-alpha.43", - "@napi-rs/wasm-runtime": "^0.2.0", - "@types/node": "^20.10.4", - "ava": "^6.0.1", - "emnapi": "^1.0.0", - "typescript": "^5.3.3" - }, - "engines": { - "node": ">=10" - }, - "ava": { - "files": [ - "napi/__test__/*.spec.mjs" - ], - "cache": false - }, - "packageManager": "pnpm@9.1.4", - "repository": { - "type": "git", - "url": "git+https://github.com/oxc-project/oxc-resolver.git" - }, - "funding": { - "url": "https://github.com/sponsors/Boshen" - } + "name": "@oxc-resolver/binding", + "funding": { + "url": "https://github.com/sponsors/Boshen" + }, + "scripts": { + "build": "napi build --platform --release --package-json-path npm/package.json --manifest-path napi/Cargo.toml", + "build:debug": "napi build --platform --package-json-path npm/package.json --manifest-path napi/Cargo.toml", + "prepublishOnly": "napi pre-publish -t npm" + }, + "ava": { + "cache": false, + "files": [ + "napi/__test__/*.spec.mjs" + ] + }, + "devDependencies": { + "@napi-rs/cli": "^3.0.0-alpha.43", + "@napi-rs/wasm-runtime": "^0.2.4", + "@types/node": "^20.14.2", + "ava": "^6.1.3", + "emnapi": "^1.2.0" + } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml deleted file mode 100644 index 878ba525..00000000 --- a/pnpm-lock.yaml +++ /dev/null @@ -1,2450 +0,0 @@ -lockfileVersion: '9.0' - -settings: - autoInstallPeers: true - excludeLinksFromLockfile: false - -importers: - - .: - devDependencies: - '@napi-rs/cli': - specifier: ^3.0.0-alpha.43 - version: 3.0.0-alpha.51(@emnapi/runtime@1.1.1)(emnapi@1.1.1) - '@napi-rs/wasm-runtime': - specifier: ^0.2.0 - version: 0.2.0 - '@types/node': - specifier: ^20.10.4 - version: 20.12.7 - ava: - specifier: ^6.0.1 - version: 6.1.2 - emnapi: - specifier: ^1.0.0 - version: 1.1.1 - typescript: - specifier: ^5.3.3 - version: 5.4.5 - -packages: - - '@emnapi/core@1.1.1': - resolution: {integrity: sha512-eu4KjHfXg3I+UUR7vSuwZXpRo4c8h4Rtb5Lu2F7Z4JqJFl/eidquONEBiRs6viXKpWBC3BaJBy68xGJ2j56idw==} - - '@emnapi/runtime@1.1.1': - resolution: {integrity: sha512-3bfqkzuR1KLx57nZfjr2NLnFOobvyS0aTszaEGCGqmYMVDRaGvgIZbjGSV/MHSSmLgQ/b9JFHQ5xm5WRZYd+XQ==} - - '@inquirer/figures@1.0.1': - resolution: {integrity: sha512-mtup3wVKia3ZwULPHcbs4Mor8Voi+iIXEWD7wCNbIO6lYR62oPCTQyrddi5OMYVXHzeCSoneZwJuS8sBvlEwDw==} - engines: {node: '>=18'} - - '@ljharb/through@2.3.13': - resolution: {integrity: sha512-/gKJun8NNiWGZJkGzI/Ragc53cOdcLNdzjLaIa+GEjguQs0ulsurx8WN0jijdK9yPqDvziX995sMRLyLt1uZMQ==} - engines: {node: '>= 0.4'} - - '@mapbox/node-pre-gyp@1.0.11': - resolution: {integrity: sha512-Yhlar6v9WQgUp/He7BdgzOz8lqMQ8sU+jkCq7Wx8Myc5YFJLbEe7lgui/V7G1qB1DJykHSGwreceSaD60Y0PUQ==} - hasBin: true - - '@napi-rs/cli@3.0.0-alpha.51': - resolution: {integrity: sha512-fzTQ4RfhaghFNryWTfb0e93N/J7hNfAOpUNL98u9qMymsXa3w2cUTN8W/HjiNVTUvHHus8X5PuHt9q65cDXcSg==} - engines: {node: '>= 16'} - hasBin: true - peerDependencies: - '@emnapi/runtime': ^1.1.0 - emnapi: ^1.1.0 - peerDependenciesMeta: - '@emnapi/runtime': - optional: true - emnapi: - optional: true - - '@napi-rs/cross-toolchain@0.0.14': - resolution: {integrity: sha512-Xgoe1gCEo5s5VUxmSnK4tYFJXW2JAVM02jptSbqA2+gp8pt4Vuk9oK2LvswwO9iRfHapKacYYhegD8Dq/+PBOQ==} - peerDependencies: - '@napi-rs/cross-toolchain-arm64-target-aarch64': ^0.0.14 - '@napi-rs/cross-toolchain-arm64-target-armv7': ^0.0.14 - '@napi-rs/cross-toolchain-arm64-target-x86_64': ^0.0.14 - '@napi-rs/cross-toolchain-x64-target-aarch64': ^0.0.14 - '@napi-rs/cross-toolchain-x64-target-armv7': ^0.0.14 - '@napi-rs/cross-toolchain-x64-target-x86_64': ^0.0.14 - peerDependenciesMeta: - '@napi-rs/cross-toolchain-arm64-target-aarch64': - optional: true - '@napi-rs/cross-toolchain-arm64-target-armv7': - optional: true - '@napi-rs/cross-toolchain-arm64-target-x86_64': - optional: true - '@napi-rs/cross-toolchain-x64-target-aarch64': - optional: true - '@napi-rs/cross-toolchain-x64-target-armv7': - optional: true - '@napi-rs/cross-toolchain-x64-target-x86_64': - optional: true - - '@napi-rs/lzma-android-arm-eabi@1.2.1': - resolution: {integrity: sha512-GKXud2hTddxehff1mAGkbTfseBj+GcM+M/sZuxf9H9CJeOWpfI/HC9Oy3uv8mBqPTkOQdCcZ/xXPU34EOEwiRg==} - engines: {node: '>= 10'} - cpu: [arm] - os: [android] - - '@napi-rs/lzma-android-arm64@1.2.1': - resolution: {integrity: sha512-UKFvc56TdgljbdgLvSwM62pSItV/4SuXXCrJtruPDmbIDe8HKag8hsCKsb66hrc9aX7urJ+KGw1yz5hWiONLyw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [android] - - '@napi-rs/lzma-darwin-arm64@1.2.1': - resolution: {integrity: sha512-eLbHzK5xGVzEABb1ESFELQJzXKoQeP9QH9hMPd4Qq29xD6MkWD2VKlAy40AxrMeWc7fCUIImTTlGuGRvg6tI1g==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [darwin] - - '@napi-rs/lzma-darwin-x64@1.2.1': - resolution: {integrity: sha512-/a5sHZkkO81w/PCpxlwXjADz++jDiTJquMzCLAhupd23wTRmJoCBAwp4Tur+qV5esI7ahAA0lS5P0M4TZv+OUg==} - engines: {node: '>= 10'} - cpu: [x64] - os: [darwin] - - '@napi-rs/lzma-freebsd-x64@1.2.1': - resolution: {integrity: sha512-Ehc0ld148YcqQrDWwUbVta1l45R4PthCIU6ZDbOYzzeYXQnhgr1fWiex7wu4KMFppteHlYntypUIhmMUklqchA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [freebsd] - - '@napi-rs/lzma-linux-arm-gnueabihf@1.2.1': - resolution: {integrity: sha512-EkIsx3kC67viElNetZgaGAtAceA+4pVGj31HKKPn0RZYn3rCNdEEg2i1IRg07Y6m4bHwcaKutLoZ2LDcQ+yiBg==} - engines: {node: '>= 10'} - cpu: [arm] - os: [linux] - - '@napi-rs/lzma-linux-arm64-gnu@1.2.1': - resolution: {integrity: sha512-GxSbp1/X7Ppmf+aNiZ95vl1HgQzRS9C8zCv7unEhYRPAjRkAnlrsLluUBOTPIY2yquuUvfIog9XIml6Hpw2wrA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/lzma-linux-arm64-musl@1.2.1': - resolution: {integrity: sha512-2L3KHFGGdt0xgU0WcKwKmnjVCYs88t4+ixBgPfEydtYsOceg6B8eOzdM7xsziKxJyUJKWBetGLgARQOy35bfvA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/lzma-linux-x64-gnu@1.2.1': - resolution: {integrity: sha512-h29XttA2Og1+6vYHsVcp+i1PkeILKzYnoDun0ul/k/5hvfxJ2Jap+EM07sW4HSz/DiscLAeIZmLKbXEqJgF5bg==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/lzma-linux-x64-musl@1.2.1': - resolution: {integrity: sha512-8EIkpLid4pepkBsljQ7rgma8jdwAuwVyJ2tY6Wuj1I/AqAkVVfxTwIuYc4zgRR3nfcrmWgOfZE0VneVmQCE5hw==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/lzma-win32-arm64-msvc@1.2.1': - resolution: {integrity: sha512-RNPItarWUUbtwz6dyn8FGH9AXEaAsBcMBlTvcRjv8eoqRqyZ9R49Ruk/8WMS57MM1BKdiPDxHBtRi+nZn27Slw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [win32] - - '@napi-rs/lzma-win32-ia32-msvc@1.2.1': - resolution: {integrity: sha512-rNdsCZnzKVgeDd9NzXWk9WuADVUWUWdnws8qBRCfHRUQqJ56Ic1W7Y1XmP+bNa985MXlU6vbznHTHmU5zk2P+A==} - engines: {node: '>= 10'} - cpu: [ia32] - os: [win32] - - '@napi-rs/lzma-win32-x64-msvc@1.2.1': - resolution: {integrity: sha512-1AFrAh1n73Yw+IhDu5HnaiRD4vWEkafY0EarfziPfDsh/GeyNcjbE+Let+XFe8L3j0/CZfsRG3nXarOW1oadUQ==} - engines: {node: '>= 10'} - cpu: [x64] - os: [win32] - - '@napi-rs/lzma@1.2.1': - resolution: {integrity: sha512-vwl34tzF2mXWthnFVN2MP6nRzQ40C5+256EEUjxAwj9dbAhDqb7Yz376Up5SlB4YgNC0YvEqK4jsYP/NP0bgpg==} - engines: {node: '>= 10'} - - '@napi-rs/tar-android-arm-eabi@0.1.0': - resolution: {integrity: sha512-gY9f7HfyU8MQs/ERi2/Fc4dGRf61ZM2pme31t0FkrzTtmeIaf56LiTeTt4aP8xh/0HOVnXrB6I3taY9IsQVB8Q==} - engines: {node: '>= 10'} - cpu: [arm] - os: [android] - - '@napi-rs/tar-android-arm64@0.1.0': - resolution: {integrity: sha512-NxszsTRdAYf25kKuzUYz514/5MFI3w3aHToZBcFjaxUmsayrimFrHIiPLwNQVe55lHPRi13njqQUPjMetHMCZw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [android] - - '@napi-rs/tar-darwin-arm64@0.1.0': - resolution: {integrity: sha512-G+fSNcwhbekTMOElS66mf3ccg8M4NcEHIgo7s6Hxo8U2obUSqEJ0WjTDV8oJy7lqRW/MeeDJj8Vz0ceXC8ueeA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [darwin] - - '@napi-rs/tar-darwin-x64@0.1.0': - resolution: {integrity: sha512-p9aOLk6O2+Cu62fNOdj1Zx0P3J1VkxtihXOVDaK49o5jszhms0roNA7kZfklwjVdwo8R7OQC6mJcFWmiamMNug==} - engines: {node: '>= 10'} - cpu: [x64] - os: [darwin] - - '@napi-rs/tar-freebsd-x64@0.1.0': - resolution: {integrity: sha512-mZQPtyCc2r+P84WV76Ddbe1+CxBscxlDHtgMIxZPveMgq4esZFKp26M735vjxtk/j2ahT0pZoC6fjsJ//Uxzlg==} - engines: {node: '>= 10'} - cpu: [x64] - os: [freebsd] - - '@napi-rs/tar-linux-arm-gnueabihf@0.1.0': - resolution: {integrity: sha512-FHxnmrOS345T3n3XDmY9QEoVv1PXkkuevQbu+gzq5np4fzN/NX2Az5oJTxKOTGtlJSaxxz90raeaWRZrnV5hZQ==} - engines: {node: '>= 10'} - cpu: [arm] - os: [linux] - - '@napi-rs/tar-linux-arm64-gnu@0.1.0': - resolution: {integrity: sha512-+8WHnL/8PPpePYc+5oqNLoE5o98vWF7lJvY/seji7tdcS5TPJ3tgXaF4/y1rFAaSxKsZ9l+ClHsZZ0MpCqMOOQ==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/tar-linux-arm64-musl@0.1.0': - resolution: {integrity: sha512-SXqU4H30/TD9BZa6pH/U5l2V6E4EKOutjHp9Sqr98iH52Zb+1N84ur1Ti7/+PapKunCIJeZzU+792CQagKIzuQ==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/tar-linux-x64-gnu@0.1.0': - resolution: {integrity: sha512-2uZHxl2nH1HbeJuifB1qdK8vU9wKDrxQkFm+u4psUaa/uHLZDUCGS7GMxTnCbR9OehqZcfQabaKsHbxR/8ElDQ==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/tar-linux-x64-musl@0.1.0': - resolution: {integrity: sha512-S1vEqLK4UCHS4AjVZ3g6o7r0Yu6RbhmDj6JrqxBoEIjrMsuIPKQrODHhtlsykOPeu5IHQuyRT+DevorWAVYdoA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/tar-win32-arm64-msvc@0.1.0': - resolution: {integrity: sha512-x23Ganq0hcDbgnhzAFqOu5EWtKvngIsapJL7ZLGgQlqahRb15aQkagYvpju6CLZers6N6znmqxw9Pdov9VFzOQ==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [win32] - - '@napi-rs/tar-win32-ia32-msvc@0.1.0': - resolution: {integrity: sha512-QJgJQEKDbVOrzSJ3EaUuCk+g7t9tKv085eALmRtkiHDBmzd0iAoudcU2N9YgdacSQMe1V/GMuQLky6BFrZb4nw==} - engines: {node: '>= 10'} - cpu: [ia32] - os: [win32] - - '@napi-rs/tar-win32-x64-msvc@0.1.0': - resolution: {integrity: sha512-aEhLcPZXmbcz46utpgYrkhY/TIGVCs4T5c+xpBf6H8feIEz7rF44Bm6kECC42OWcqnws2LGRW9TZsv0bWoAn0A==} - engines: {node: '>= 10'} - cpu: [x64] - os: [win32] - - '@napi-rs/tar@0.1.0': - resolution: {integrity: sha512-HodV5VS/ryhNvSmSHPb6CT5lJKzkoKaiyO8JPkVw3XCXbp51+vZs7LJ66kgFqyr4AagaKqmXsgpGVCIwNdFw/w==} - engines: {node: '>= 10'} - - '@napi-rs/wasm-runtime@0.1.2': - resolution: {integrity: sha512-8JuczewTFIZ/XIjHQ+YlQUydHvlKx2hkcxtuGwh+t/t5zWyZct6YG4+xjHcq8xyc/e7FmFwf42Zj2YgICwmlvA==} - - '@napi-rs/wasm-runtime@0.2.0': - resolution: {integrity: sha512-ETCooPEZJN7cGp6GwE5mUTrStrhIeuEPo0lOhLe48Iz35z6CkbgDauR8nE/K4GaMEu2BwTOm2Epy7ru8w1ua7w==} - - '@napi-rs/wasm-tools-android-arm-eabi@0.0.1': - resolution: {integrity: sha512-Q/SyyO60dbpoLcN/hvGzNWDaCjuaMGFeg92GnsDBWm3OCwhvltr51+VDZbCIHQwfIvH4d63X29nEls7FHK75dA==} - engines: {node: '>= 10'} - cpu: [arm] - os: [android] - - '@napi-rs/wasm-tools-android-arm64@0.0.1': - resolution: {integrity: sha512-mn7QpSWJlQS7Z14DkWqW14HqEiI2R8FV3KT4SNdqm+O+K5uIUvAexxMn9Qu6gqLq1fHXj+7l2luAWmtN7RKLjA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [android] - - '@napi-rs/wasm-tools-darwin-arm64@0.0.1': - resolution: {integrity: sha512-WuxMRtd5rCgqfuk7dehcft5eyGDOuNSMaJybprbX4IXvnjlLQf1zsCfp6wBI2Ptp2D+qEgE2SAMWBfzF9XDDkw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [darwin] - - '@napi-rs/wasm-tools-darwin-x64@0.0.1': - resolution: {integrity: sha512-YGPjgIo1/Y774aAFb/UT+d8VQtTaIkdF0/ynlChe/UilBZX48vLaEM0HaoSqxA1WHvRm8Il8R3rBDDle0965rw==} - engines: {node: '>= 10'} - cpu: [x64] - os: [darwin] - - '@napi-rs/wasm-tools-freebsd-x64@0.0.1': - resolution: {integrity: sha512-e5y+Z89XwI7HpLyCNEvDKdtO5Sga2+o8bDcNQNHjhMunnnHKPtlTvtIhieVmdqnNGPbuNkIx8xbTjkoWCZ49Tw==} - engines: {node: '>= 10'} - cpu: [x64] - os: [freebsd] - - '@napi-rs/wasm-tools-linux-arm64-gnu@0.0.1': - resolution: {integrity: sha512-Hcy+XiCJd8XshxVOYvmyU5FgeY8d6txZf7ZefI38Y3eRm7rzGt/EvABGjvJfujnPaBeWi9fQVm3Zav5pwyxViw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/wasm-tools-linux-arm64-musl@0.0.1': - resolution: {integrity: sha512-1mSquGy4N7jlRu/0OY/rqZa/XdCFGKrsl8SH4jRB318DVweOHLqn15QG4iwIrRVjCJROpaU9HRU/sgOKVbdqrA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/wasm-tools-linux-x64-gnu@0.0.1': - resolution: {integrity: sha512-/+XuGQ9667EqrxRbpt2izLDNzWUWLTXl6KaRSh9TjcT7qL5+yllTqchc0JwIHJW5QnQlC1NW7HnSnwQZ+/v+8g==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/wasm-tools-linux-x64-musl@0.0.1': - resolution: {integrity: sha512-L+5QcEsUS+QNcMI1AF6aBRKLzhxQ5VHRHVslaQwOxHoxyhMB/2hRH4ON6Zea1PyQS/zzZugwBuDEOcFtc3UjPQ==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/wasm-tools-wasm32-wasi@0.0.1': - resolution: {integrity: sha512-I1vAhMQcBblPJPg6pr+xydZ1NjPwKU2ympmI54BZfCOAMHs0ZfVb4yEqYAVIcSWOx3CF/0T2YrcOmiULTU3iGw==} - engines: {node: '>=14.0.0'} - cpu: [wasm32] - - '@napi-rs/wasm-tools-win32-arm64-msvc@0.0.1': - resolution: {integrity: sha512-A9peDWijE9X6qt5SNzqlmSMlOZiqeB9zhUVP5dtJKtpqVO098YVnZFsz/4Hv7LkSoxQE7brAd9yln/wz5qb1yQ==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [win32] - - '@napi-rs/wasm-tools-win32-ia32-msvc@0.0.1': - resolution: {integrity: sha512-6Y7GqnBCIdl8YsSQ+5AjnZ4iWDJnJrqzRlMDegCmPPf3WmRZ0sgnRU9iAHWcId9AEIf7SAs3x7Bnv2992zCwJA==} - engines: {node: '>= 10'} - cpu: [ia32] - os: [win32] - - '@napi-rs/wasm-tools-win32-x64-msvc@0.0.1': - resolution: {integrity: sha512-Ab6ljJCQmXqJvE4/8DLvHEVTI7vVUrVfh6gCwnVwwrA/B2LgR98SanpT8/951ZaIH/lSuqkeVm+wqzgYM1FHRg==} - engines: {node: '>= 10'} - cpu: [x64] - os: [win32] - - '@napi-rs/wasm-tools@0.0.1': - resolution: {integrity: sha512-itoKmaVqRKIV37sKIEri1qjaYlWNtXyfymUaqXkLu5F16s+FwqwOmvxmdTHsvNKkMy4qCsSSetiLZO1IwvBMLQ==} - engines: {node: '>= 10'} - - '@nodelib/fs.scandir@2.1.5': - resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} - engines: {node: '>= 8'} - - '@nodelib/fs.stat@2.0.5': - resolution: {integrity: sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==} - engines: {node: '>= 8'} - - '@nodelib/fs.walk@1.2.8': - resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} - engines: {node: '>= 8'} - - '@octokit/auth-token@4.0.0': - resolution: {integrity: sha512-tY/msAuJo6ARbK6SPIxZrPBms3xPbfwBrulZe0Wtr/DIY9lje2HeV1uoebShn6mx7SjCHif6EjMvoREj+gZ+SA==} - engines: {node: '>= 18'} - - '@octokit/core@5.2.0': - resolution: {integrity: sha512-1LFfa/qnMQvEOAdzlQymH0ulepxbxnCYAKJZfMci/5XJyIHWgEYnDmgnKakbTh7CH2tFQ5O60oYDvns4i9RAIg==} - engines: {node: '>= 18'} - - '@octokit/endpoint@9.0.5': - resolution: {integrity: sha512-ekqR4/+PCLkEBF6qgj8WqJfvDq65RH85OAgrtnVp1mSxaXF03u2xW/hUdweGS5654IlC0wkNYC18Z50tSYTAFw==} - engines: {node: '>= 18'} - - '@octokit/graphql@7.1.0': - resolution: {integrity: sha512-r+oZUH7aMFui1ypZnAvZmn0KSqAUgE1/tUXIWaqUCa1758ts/Jio84GZuzsvUkme98kv0WFY8//n0J1Z+vsIsQ==} - engines: {node: '>= 18'} - - '@octokit/openapi-types@20.0.0': - resolution: {integrity: sha512-EtqRBEjp1dL/15V7WiX5LJMIxxkdiGJnabzYx5Apx4FkQIFgAfKumXeYAqqJCj1s+BMX4cPFIFC4OLCR6stlnA==} - - '@octokit/openapi-types@22.1.0': - resolution: {integrity: sha512-pGUdSP+eEPfZiQHNkZI0U01HLipxncisdJQB4G//OAmfeO8sqTQ9KRa0KF03TUPCziNsoXUrTg4B2Q1EX++T0Q==} - - '@octokit/plugin-paginate-rest@9.2.1': - resolution: {integrity: sha512-wfGhE/TAkXZRLjksFXuDZdmGnJQHvtU/joFQdweXUgzo1XwvBCD4o4+75NtFfjfLK5IwLf9vHTfSiU3sLRYpRw==} - engines: {node: '>= 18'} - peerDependencies: - '@octokit/core': '5' - - '@octokit/plugin-request-log@4.0.1': - resolution: {integrity: sha512-GihNqNpGHorUrO7Qa9JbAl0dbLnqJVrV8OXe2Zm5/Y4wFkZQDfTreBzVmiRfJVfE4mClXdihHnbpyyO9FSX4HA==} - engines: {node: '>= 18'} - peerDependencies: - '@octokit/core': '5' - - '@octokit/plugin-rest-endpoint-methods@10.4.1': - resolution: {integrity: sha512-xV1b+ceKV9KytQe3zCVqjg+8GTGfDYwaT1ATU5isiUyVtlVAO3HNdzpS4sr4GBx4hxQ46s7ITtZrAsxG22+rVg==} - engines: {node: '>= 18'} - peerDependencies: - '@octokit/core': '5' - - '@octokit/request-error@5.1.0': - resolution: {integrity: sha512-GETXfE05J0+7H2STzekpKObFe765O5dlAKUTLNGeH+x47z7JjXHfsHKo5z21D/o/IOZTUEI6nyWyR+bZVP/n5Q==} - engines: {node: '>= 18'} - - '@octokit/request@8.4.0': - resolution: {integrity: sha512-9Bb014e+m2TgBeEJGEbdplMVWwPmL1FPtggHQRkV+WVsMggPtEkLKPlcVYm/o8xKLkpJ7B+6N8WfQMtDLX2Dpw==} - engines: {node: '>= 18'} - - '@octokit/rest@20.1.0': - resolution: {integrity: sha512-STVO3itHQLrp80lvcYB2UIKoeil5Ctsgd2s1AM+du3HqZIR35ZH7WE9HLwUOLXH0myA0y3AGNPo8gZtcgIbw0g==} - engines: {node: '>= 18'} - - '@octokit/types@12.6.0': - resolution: {integrity: sha512-1rhSOfRa6H9w4YwK0yrf5faDaDTb+yLyBUKOCV4xtCDB5VmIPqd/v9yr9o6SAzOAlRxMiRiCic6JVM1/kunVkw==} - - '@octokit/types@13.4.1': - resolution: {integrity: sha512-Y73oOAzRBAUzR/iRAbGULzpNkX8vaxKCqEtg6K74Ff3w9f5apFnWtE/2nade7dMWWW3bS5Kkd6DJS4HF04xreg==} - - '@rollup/pluginutils@4.2.1': - resolution: {integrity: sha512-iKnFXr7NkdZAIHiIWE+BX5ULi/ucVFYWD6TbAV+rZctiRTY2PL6tsIKhoIOaoskiWAkgu+VsbXgUVDNLHf+InQ==} - engines: {node: '>= 8.0.0'} - - '@sindresorhus/merge-streams@2.3.0': - resolution: {integrity: sha512-LtoMMhxAlorcGhmFYI+LhPgbPZCkgP6ra1YL604EeF6U98pLlQ3iWIGMdWSC+vWmPBWBNgmDBAhnAobLROJmwg==} - engines: {node: '>=18'} - - '@tybys/wasm-util@0.8.3': - resolution: {integrity: sha512-Z96T/L6dUFFxgFJ+pQtkPpne9q7i6kIPYCFnQBHSgSPV9idTsKfIhCss0h5iM9irweZCatkrdeP8yi5uM1eX6Q==} - - '@types/node@20.12.7': - resolution: {integrity: sha512-wq0cICSkRLVaf3UGLMGItu/PtdY7oaXaI/RVU+xliKVOtRna3PRY57ZDfztpDL0n11vfymMUnXv8QwYCO7L1wg==} - - '@vercel/nft@0.26.4': - resolution: {integrity: sha512-j4jCOOXke2t8cHZCIxu1dzKLHLcFmYzC3yqAK6MfZznOL1QIJKd0xcFsXK3zcqzU7ScsE2zWkiMMNHGMHgp+FA==} - engines: {node: '>=16'} - hasBin: true - - abbrev@1.1.1: - resolution: {integrity: sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==} - - acorn-import-attributes@1.9.5: - resolution: {integrity: sha512-n02Vykv5uA3eHGM/Z2dQrcD56kL8TyDb2p1+0P83PClMnC/nc+anbQRhIOWnSq4Ke/KvDPrY3C9hDtC/A3eHnQ==} - peerDependencies: - acorn: ^8 - - acorn-walk@8.3.2: - resolution: {integrity: sha512-cjkyv4OtNCIeqhHrfS81QWXoCBPExR/J62oyEqepVw8WaQeSqpW2uhuLPh1m9eWhDuOo/jUXVTlifvesOWp/4A==} - engines: {node: '>=0.4.0'} - - acorn@8.11.3: - resolution: {integrity: sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==} - engines: {node: '>=0.4.0'} - hasBin: true - - agent-base@6.0.2: - resolution: {integrity: sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==} - engines: {node: '>= 6.0.0'} - - ansi-escapes@4.3.2: - resolution: {integrity: sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==} - engines: {node: '>=8'} - - ansi-regex@5.0.1: - resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} - engines: {node: '>=8'} - - ansi-regex@6.0.1: - resolution: {integrity: sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==} - engines: {node: '>=12'} - - ansi-styles@4.3.0: - resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} - engines: {node: '>=8'} - - ansi-styles@6.2.1: - resolution: {integrity: sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==} - engines: {node: '>=12'} - - aproba@2.0.0: - resolution: {integrity: sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==} - - are-we-there-yet@2.0.0: - resolution: {integrity: sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw==} - engines: {node: '>=10'} - - argparse@1.0.10: - resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==} - - argparse@2.0.1: - resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} - - array-find-index@1.0.2: - resolution: {integrity: sha512-M1HQyIXcBGtVywBt8WVdim+lrNaK7VHp99Qt5pSNziXznKHViIBbXWtfRTpEFpF/c4FdfxNAsCCwPp5phBYJtw==} - engines: {node: '>=0.10.0'} - - arrgv@1.0.2: - resolution: {integrity: sha512-a4eg4yhp7mmruZDQFqVMlxNRFGi/i1r87pt8SDHy0/I8PqSXoUTlWZRdAZo0VXgvEARcujbtTk8kiZRi1uDGRw==} - engines: {node: '>=8.0.0'} - - arrify@3.0.0: - resolution: {integrity: sha512-tLkvA81vQG/XqE2mjDkGQHoOINtMHtysSnemrmoGe6PydDPMRbVugqyk4A6V/WDWEfm3l+0d8anA9r8cv/5Jaw==} - engines: {node: '>=12'} - - async-sema@3.1.1: - resolution: {integrity: sha512-tLRNUXati5MFePdAk8dw7Qt7DpxPB60ofAgn8WRhW6a2rcimZnYBP9oxHiv0OHy+Wz7kPMG+t4LGdt31+4EmGg==} - - ava@6.1.2: - resolution: {integrity: sha512-WcpxJ8yZ7mk9ABTinD0IAjcemovSeVGjuuwZx0JS9johREWFeLTl8UP6wd7l6nmnrWqkKZdwaD71a/ocH4qPKw==} - engines: {node: ^18.18 || ^20.8 || ^21} - hasBin: true - peerDependencies: - '@ava/typescript': '*' - peerDependenciesMeta: - '@ava/typescript': - optional: true - - balanced-match@1.0.2: - resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} - - base64-js@1.5.1: - resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==} - - before-after-hook@2.2.3: - resolution: {integrity: sha512-NzUnlZexiaH/46WDhANlyR2bXRopNg4F/zuSA3OpZnllCUgRaOF2znDioDWrmbNVsuZk6l9pMquQB38cfBZwkQ==} - - bindings@1.5.0: - resolution: {integrity: sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==} - - bl@4.1.0: - resolution: {integrity: sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==} - - blueimp-md5@2.19.0: - resolution: {integrity: sha512-DRQrD6gJyy8FbiE4s+bDoXS9hiW3Vbx5uCdwvcCf3zLHL+Iv7LtGHLpr+GZV8rHG8tK766FGYBwRbu8pELTt+w==} - - brace-expansion@1.1.11: - resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} - - braces@3.0.2: - resolution: {integrity: sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==} - engines: {node: '>=8'} - - buffer@5.7.1: - resolution: {integrity: sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==} - - call-bind@1.0.7: - resolution: {integrity: sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==} - engines: {node: '>= 0.4'} - - callsites@4.1.0: - resolution: {integrity: sha512-aBMbD1Xxay75ViYezwT40aQONfr+pSXTHwNKvIXhXD6+LY3F1dLIcceoC5OZKBVHbXcysz1hL9D2w0JJIMXpUw==} - engines: {node: '>=12.20'} - - cbor@9.0.2: - resolution: {integrity: sha512-JPypkxsB10s9QOWwa6zwPzqE1Md3vqpPc+cai4sAecuCsRyAtAl/pMyhPlMbT/xtPnm2dznJZYRLui57qiRhaQ==} - engines: {node: '>=16'} - - chalk@4.1.2: - resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} - engines: {node: '>=10'} - - chalk@5.3.0: - resolution: {integrity: sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==} - engines: {node: ^12.17.0 || ^14.13 || >=16.0.0} - - chardet@0.7.0: - resolution: {integrity: sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==} - - chownr@2.0.0: - resolution: {integrity: sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==} - engines: {node: '>=10'} - - chunkd@2.0.1: - resolution: {integrity: sha512-7d58XsFmOq0j6el67Ug9mHf9ELUXsQXYJBkyxhH/k+6Ke0qXRnv0kbemx+Twc6fRJ07C49lcbdgm9FL1Ei/6SQ==} - - ci-info@4.0.0: - resolution: {integrity: sha512-TdHqgGf9odd8SXNuxtUBVx8Nv+qZOejE6qyqiy5NtbYYQOeFa6zmHkxlPzmaLxWWHsU6nJmB7AETdVPi+2NBUg==} - engines: {node: '>=8'} - - ci-parallel-vars@1.0.1: - resolution: {integrity: sha512-uvzpYrpmidaoxvIQHM+rKSrigjOe9feHYbw4uOI2gdfe1C3xIlxO+kVXq83WQWNniTf8bAxVpy+cQeFQsMERKg==} - - cli-cursor@3.1.0: - resolution: {integrity: sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==} - engines: {node: '>=8'} - - cli-spinners@2.9.2: - resolution: {integrity: sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==} - engines: {node: '>=6'} - - cli-truncate@4.0.0: - resolution: {integrity: sha512-nPdaFdQ0h/GEigbPClz11D0v/ZJEwxmeVZGeMo3Z5StPtUTkA9o1lD6QwoirYiSDzbcwn2XcjwmCp68W1IS4TA==} - engines: {node: '>=18'} - - cli-width@4.1.0: - resolution: {integrity: sha512-ouuZd4/dm2Sw5Gmqy6bGyNNNe1qt9RpmxveLSO7KcgsTnU7RXfsw+/bukWGo1abgBiMAic068rclZsO4IWmmxQ==} - engines: {node: '>= 12'} - - clipanion@3.2.1: - resolution: {integrity: sha512-dYFdjLb7y1ajfxQopN05mylEpK9ZX0sO1/RfMXdfmwjlIsPkbh4p7A682x++zFPLDCo1x3p82dtljHf5cW2LKA==} - peerDependencies: - typanion: '*' - - cliui@8.0.1: - resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==} - engines: {node: '>=12'} - - clone@1.0.4: - resolution: {integrity: sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==} - engines: {node: '>=0.8'} - - code-excerpt@4.0.0: - resolution: {integrity: sha512-xxodCmBen3iy2i0WtAK8FlFNrRzjUqjRsMfho58xT/wvZU1YTM3fCnRjcy1gJPMepaRlgm/0e6w8SpWHpn3/cA==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - color-convert@2.0.1: - resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} - engines: {node: '>=7.0.0'} - - color-name@1.1.4: - resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} - - color-support@1.1.3: - resolution: {integrity: sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==} - hasBin: true - - colorette@2.0.20: - resolution: {integrity: sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==} - - common-path-prefix@3.0.0: - resolution: {integrity: sha512-QE33hToZseCH3jS0qN96O/bSh3kaw/h+Tq7ngyY9eWDUnTlTNUyqfqvCXioLe5Na5jFsL78ra/wuBU4iuEgd4w==} - - concat-map@0.0.1: - resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} - - concordance@5.0.4: - resolution: {integrity: sha512-OAcsnTEYu1ARJqWVGwf4zh4JDfHZEaSNlNccFmt8YjB2l/n19/PF2viLINHc57vO4FKIAFl2FWASIGZZWZ2Kxw==} - engines: {node: '>=10.18.0 <11 || >=12.14.0 <13 || >=14'} - - console-control-strings@1.1.0: - resolution: {integrity: sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==} - - convert-to-spaces@2.0.1: - resolution: {integrity: sha512-rcQ1bsQO9799wq24uE5AM2tAILy4gXGIK/njFWcVQkGNZ96edlpY+A7bjwvzjYvLDyzmG1MmMLZhpcsb+klNMQ==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - currently-unhandled@0.4.1: - resolution: {integrity: sha512-/fITjgjGU50vjQ4FH6eUoYu+iUoUKIXws2hL15JJpIR+BbTxaXQsMuuyjtNh2WqsSBS5nsaZHFsFecyw5CCAng==} - engines: {node: '>=0.10.0'} - - date-time@3.1.0: - resolution: {integrity: sha512-uqCUKXE5q1PNBXjPqvwhwJf9SwMoAHBgWJ6DcrnS5o+W2JOiIILl0JEdVD8SGujrNS02GGxgwAg2PN2zONgtjg==} - engines: {node: '>=6'} - - debug@4.3.4: - resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==} - engines: {node: '>=6.0'} - peerDependencies: - supports-color: '*' - peerDependenciesMeta: - supports-color: - optional: true - - defaults@1.0.4: - resolution: {integrity: sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A==} - - define-data-property@1.1.4: - resolution: {integrity: sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==} - engines: {node: '>= 0.4'} - - delegates@1.0.0: - resolution: {integrity: sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==} - - deprecation@2.3.1: - resolution: {integrity: sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==} - - detect-libc@2.0.3: - resolution: {integrity: sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw==} - engines: {node: '>=8'} - - emittery@1.0.3: - resolution: {integrity: sha512-tJdCJitoy2lrC2ldJcqN4vkqJ00lT+tOWNT1hBJjO/3FDMJa5TTIiYGCKGkn/WfCyOzUMObeohbVTj00fhiLiA==} - engines: {node: '>=14.16'} - - emnapi@1.1.1: - resolution: {integrity: sha512-md0YDBLCX+378+zzibHvOLsj28YKFy8vl7BiSzVocCY7HujOkYt+N5LCOYqLeYi5C5/5NlnkNweVdUjrvKpGNg==} - peerDependencies: - node-addon-api: '>= 6.1.0' - peerDependenciesMeta: - node-addon-api: - optional: true - - emoji-regex@10.3.0: - resolution: {integrity: sha512-QpLs9D9v9kArv4lfDEgg1X/gN5XLnf/A6l9cs8SPZLRZR3ZkY9+kwIQTxm+fsSej5UMYGE8fdoaZVIBlqG0XTw==} - - emoji-regex@8.0.0: - resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} - - es-define-property@1.0.0: - resolution: {integrity: sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==} - engines: {node: '>= 0.4'} - - es-errors@1.3.0: - resolution: {integrity: sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==} - engines: {node: '>= 0.4'} - - escalade@3.1.2: - resolution: {integrity: sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==} - engines: {node: '>=6'} - - escape-string-regexp@2.0.0: - resolution: {integrity: sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==} - engines: {node: '>=8'} - - escape-string-regexp@5.0.0: - resolution: {integrity: sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==} - engines: {node: '>=12'} - - esprima@4.0.1: - resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==} - engines: {node: '>=4'} - hasBin: true - - estree-walker@2.0.2: - resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==} - - esutils@2.0.3: - resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} - engines: {node: '>=0.10.0'} - - external-editor@3.1.0: - resolution: {integrity: sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==} - engines: {node: '>=4'} - - fast-diff@1.3.0: - resolution: {integrity: sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==} - - fast-glob@3.3.2: - resolution: {integrity: sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==} - engines: {node: '>=8.6.0'} - - fastq@1.17.1: - resolution: {integrity: sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==} - - figures@6.1.0: - resolution: {integrity: sha512-d+l3qxjSesT4V7v2fh+QnmFnUWv9lSpjarhShNTgBOfA0ttejbQUAlHLitbjkoRiDulW0OPoQPYIGhIC8ohejg==} - engines: {node: '>=18'} - - file-uri-to-path@1.0.0: - resolution: {integrity: sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==} - - fill-range@7.0.1: - resolution: {integrity: sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==} - engines: {node: '>=8'} - - find-up-simple@1.0.0: - resolution: {integrity: sha512-q7Us7kcjj2VMePAa02hDAF6d+MzsdsAWEwYyOpwUtlerRBkOEPBCRZrAV4XfcSN8fHAgaD0hP7miwoay6DCprw==} - engines: {node: '>=18'} - - fs-minipass@2.1.0: - resolution: {integrity: sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==} - engines: {node: '>= 8'} - - fs.realpath@1.0.0: - resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} - - function-bind@1.1.2: - resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==} - - gauge@3.0.2: - resolution: {integrity: sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q==} - engines: {node: '>=10'} - - get-caller-file@2.0.5: - resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} - engines: {node: 6.* || 8.* || >= 10.*} - - get-east-asian-width@1.2.0: - resolution: {integrity: sha512-2nk+7SIVb14QrgXFHcm84tD4bKQz0RxPuMT8Ag5KPOq7J5fEmAg0UbXdTOSHqNuHSU28k55qnceesxXRZGzKWA==} - engines: {node: '>=18'} - - get-intrinsic@1.2.4: - resolution: {integrity: sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==} - engines: {node: '>= 0.4'} - - glob-parent@5.1.2: - resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} - engines: {node: '>= 6'} - - glob@7.2.3: - resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} - - globby@14.0.1: - resolution: {integrity: sha512-jOMLD2Z7MAhyG8aJpNOpmziMOP4rPLcc95oQPKXBazW82z+CEgPFBQvEpRUa1KeIMUJo4Wsm+q6uzO/Q/4BksQ==} - engines: {node: '>=18'} - - gopd@1.0.1: - resolution: {integrity: sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==} - - graceful-fs@4.2.11: - resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} - - has-flag@4.0.0: - resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} - engines: {node: '>=8'} - - has-property-descriptors@1.0.2: - resolution: {integrity: sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==} - - has-proto@1.0.3: - resolution: {integrity: sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==} - engines: {node: '>= 0.4'} - - has-symbols@1.0.3: - resolution: {integrity: sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==} - engines: {node: '>= 0.4'} - - has-unicode@2.0.1: - resolution: {integrity: sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==} - - hasown@2.0.2: - resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==} - engines: {node: '>= 0.4'} - - https-proxy-agent@5.0.1: - resolution: {integrity: sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==} - engines: {node: '>= 6'} - - iconv-lite@0.4.24: - resolution: {integrity: sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==} - engines: {node: '>=0.10.0'} - - ieee754@1.2.1: - resolution: {integrity: sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==} - - ignore-by-default@2.1.0: - resolution: {integrity: sha512-yiWd4GVmJp0Q6ghmM2B/V3oZGRmjrKLXvHR3TE1nfoXsmoggllfZUQe74EN0fJdPFZu2NIvNdrMMLm3OsV7Ohw==} - engines: {node: '>=10 <11 || >=12 <13 || >=14'} - - ignore@5.3.1: - resolution: {integrity: sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==} - engines: {node: '>= 4'} - - imurmurhash@0.1.4: - resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} - engines: {node: '>=0.8.19'} - - indent-string@5.0.0: - resolution: {integrity: sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==} - engines: {node: '>=12'} - - inflight@1.0.6: - resolution: {integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==} - - inherits@2.0.4: - resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} - - inquirer@9.2.19: - resolution: {integrity: sha512-WpxOT71HGsFya6/mj5PUue0sWwbpbiPfAR+332zLj/siB0QA1PZM8v3GepegFV1Op189UxHUCF6y8AySdtOMVA==} - engines: {node: '>=18'} - - irregular-plurals@3.5.0: - resolution: {integrity: sha512-1ANGLZ+Nkv1ptFb2pa8oG8Lem4krflKuX/gINiHJHjJUKaJHk/SXk5x6K3J+39/p0h1RQ2saROclJJ+QLvETCQ==} - engines: {node: '>=8'} - - is-extglob@2.1.1: - resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} - engines: {node: '>=0.10.0'} - - is-fullwidth-code-point@3.0.0: - resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} - engines: {node: '>=8'} - - is-fullwidth-code-point@4.0.0: - resolution: {integrity: sha512-O4L094N2/dZ7xqVdrXhh9r1KODPJpFms8B5sGdJLPy664AgvXsreZUyCQQNItZRDlYug4xStLjNp/sz3HvBowQ==} - engines: {node: '>=12'} - - is-glob@4.0.3: - resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} - engines: {node: '>=0.10.0'} - - is-interactive@1.0.0: - resolution: {integrity: sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w==} - engines: {node: '>=8'} - - is-number@7.0.0: - resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} - engines: {node: '>=0.12.0'} - - is-plain-object@5.0.0: - resolution: {integrity: sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==} - engines: {node: '>=0.10.0'} - - is-promise@4.0.0: - resolution: {integrity: sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==} - - is-unicode-supported@0.1.0: - resolution: {integrity: sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==} - engines: {node: '>=10'} - - is-unicode-supported@2.0.0: - resolution: {integrity: sha512-FRdAyx5lusK1iHG0TWpVtk9+1i+GjrzRffhDg4ovQ7mcidMQ6mj+MhKPmvh7Xwyv5gIS06ns49CA7Sqg7lC22Q==} - engines: {node: '>=18'} - - js-string-escape@1.0.1: - resolution: {integrity: sha512-Smw4xcfIQ5LVjAOuJCvN/zIodzA/BBSsluuoSykP+lUvScIi4U6RJLfwHet5cxFnCswUjISV8oAXaqaJDY3chg==} - engines: {node: '>= 0.8'} - - js-yaml@3.14.1: - resolution: {integrity: sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==} - hasBin: true - - js-yaml@4.1.0: - resolution: {integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==} - hasBin: true - - load-json-file@7.0.1: - resolution: {integrity: sha512-Gnxj3ev3mB5TkVBGad0JM6dmLiQL+o0t23JPBZ9sd+yvSLk05mFoqKBw5N8gbbkU4TNXyqCgIrl/VM17OgUIgQ==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - lodash-es@4.17.21: - resolution: {integrity: sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==} - - lodash@4.17.21: - resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} - - log-symbols@4.1.0: - resolution: {integrity: sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==} - engines: {node: '>=10'} - - lru-cache@6.0.0: - resolution: {integrity: sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==} - engines: {node: '>=10'} - - make-dir@3.1.0: - resolution: {integrity: sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==} - engines: {node: '>=8'} - - matcher@5.0.0: - resolution: {integrity: sha512-s2EMBOWtXFc8dgqvoAzKJXxNHibcdJMV0gwqKUaw9E2JBJuGUK7DrNKrA6g/i+v72TT16+6sVm5mS3thaMLQUw==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - md5-hex@3.0.1: - resolution: {integrity: sha512-BUiRtTtV39LIJwinWBjqVsU9xhdnz7/i889V859IBFpuqGAj6LuOvHv5XLbgZ2R7ptJoJaEcxkv88/h25T7Ciw==} - engines: {node: '>=8'} - - memoize@10.0.0: - resolution: {integrity: sha512-H6cBLgsi6vMWOcCpvVCdFFnl3kerEXbrYh9q+lY6VXvQSmM6CkmV08VOwT+WE2tzIEqRPFfAq3fm4v/UIW6mSA==} - engines: {node: '>=18'} - - merge2@1.4.1: - resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} - engines: {node: '>= 8'} - - micromatch@4.0.5: - resolution: {integrity: sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==} - engines: {node: '>=8.6'} - - mimic-fn@2.1.0: - resolution: {integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==} - engines: {node: '>=6'} - - mimic-function@5.0.1: - resolution: {integrity: sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==} - engines: {node: '>=18'} - - minimatch@3.1.2: - resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} - - minipass@3.3.6: - resolution: {integrity: sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==} - engines: {node: '>=8'} - - minipass@5.0.0: - resolution: {integrity: sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==} - engines: {node: '>=8'} - - minizlib@2.1.2: - resolution: {integrity: sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==} - engines: {node: '>= 8'} - - mkdirp@1.0.4: - resolution: {integrity: sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==} - engines: {node: '>=10'} - hasBin: true - - ms@2.1.2: - resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} - - ms@2.1.3: - resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} - - mute-stream@1.0.0: - resolution: {integrity: sha512-avsJQhyd+680gKXyG/sQc0nXaC6rBkPOfyHYcFb9+hdkqQkR9bdnkJ0AMZhke0oesPqIO+mFFJ+IdBc7mst4IA==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - - node-fetch@2.7.0: - resolution: {integrity: sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==} - engines: {node: 4.x || >=6.0.0} - peerDependencies: - encoding: ^0.1.0 - peerDependenciesMeta: - encoding: - optional: true - - node-gyp-build@4.8.0: - resolution: {integrity: sha512-u6fs2AEUljNho3EYTJNBfImO5QTo/J/1Etd+NVdCj7qWKUSN/bSLkZwhDv7I+w/MSC6qJ4cknepkAYykDdK8og==} - hasBin: true - - nofilter@3.1.0: - resolution: {integrity: sha512-l2NNj07e9afPnhAhvgVrCD/oy2Ai1yfLpuo3EpiO1jFTsB4sFz6oIfAfSZyQzVpkZQ9xS8ZS5g1jCBgq4Hwo0g==} - engines: {node: '>=12.19'} - - nopt@5.0.0: - resolution: {integrity: sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==} - engines: {node: '>=6'} - hasBin: true - - npmlog@5.0.1: - resolution: {integrity: sha512-AqZtDUWOMKs1G/8lwylVjrdYgqA4d9nu8hc+0gzRxlDb1I10+FHBGMXs6aiQHFdCUUlqH99MUMuLfzWDNDtfxw==} - - object-assign@4.1.1: - resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} - engines: {node: '>=0.10.0'} - - once@1.4.0: - resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} - - onetime@5.1.2: - resolution: {integrity: sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==} - engines: {node: '>=6'} - - ora@5.4.1: - resolution: {integrity: sha512-5b6Y85tPxZZ7QytO+BQzysW31HJku27cRIlkbAXaNx+BdcVi+LlRFmVXzeF6a7JCwJpyw5c4b+YSVImQIrBpuQ==} - engines: {node: '>=10'} - - os-tmpdir@1.0.2: - resolution: {integrity: sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==} - engines: {node: '>=0.10.0'} - - p-map@7.0.2: - resolution: {integrity: sha512-z4cYYMMdKHzw4O5UkWJImbZynVIo0lSGTXc7bzB1e/rrDqkgGUNysK/o4bTr+0+xKvvLoTyGqYC4Fgljy9qe1Q==} - engines: {node: '>=18'} - - package-config@5.0.0: - resolution: {integrity: sha512-GYTTew2slBcYdvRHqjhwaaydVMvn/qrGC323+nKclYioNSLTDUM/lGgtGTgyHVtYcozb+XkE8CNhwcraOmZ9Mg==} - engines: {node: '>=18'} - - parse-ms@4.0.0: - resolution: {integrity: sha512-TXfryirbmq34y8QBwgqCVLi+8oA3oWx2eAnSn62ITyEhEYaWRlVZ2DvMM9eZbMs/RfxPu/PK/aBLyGj4IrqMHw==} - engines: {node: '>=18'} - - path-is-absolute@1.0.1: - resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==} - engines: {node: '>=0.10.0'} - - path-type@5.0.0: - resolution: {integrity: sha512-5HviZNaZcfqP95rwpv+1HDgUamezbqdSYTyzjTvwtJSnIH+3vnbmWsItli8OFEndS984VT55M3jduxZbX351gg==} - engines: {node: '>=12'} - - picomatch@2.3.1: - resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} - engines: {node: '>=8.6'} - - picomatch@3.0.1: - resolution: {integrity: sha512-I3EurrIQMlRc9IaAZnqRR044Phh2DXY+55o7uJ0V+hYZAcQYSuFWsc9q5PvyDHUSCe1Qxn/iBz+78s86zWnGag==} - engines: {node: '>=10'} - - plur@5.1.0: - resolution: {integrity: sha512-VP/72JeXqak2KiOzjgKtQen5y3IZHn+9GOuLDafPv0eXa47xq0At93XahYBs26MsifCQ4enGKwbjBTKgb9QJXg==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - pretty-ms@9.0.0: - resolution: {integrity: sha512-E9e9HJ9R9NasGOgPaPE8VMeiPKAyWR5jcFpNnwIejslIhWqdqOrb2wShBsncMPUb+BcCd2OPYfh7p2W6oemTng==} - engines: {node: '>=18'} - - queue-microtask@1.2.3: - resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} - - readable-stream@3.6.2: - resolution: {integrity: sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==} - engines: {node: '>= 6'} - - require-directory@2.1.1: - resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} - engines: {node: '>=0.10.0'} - - resolve-cwd@3.0.0: - resolution: {integrity: sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==} - engines: {node: '>=8'} - - resolve-from@5.0.0: - resolution: {integrity: sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==} - engines: {node: '>=8'} - - restore-cursor@3.1.0: - resolution: {integrity: sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==} - engines: {node: '>=8'} - - reusify@1.0.4: - resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==} - engines: {iojs: '>=1.0.0', node: '>=0.10.0'} - - rimraf@3.0.2: - resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==} - hasBin: true - - run-async@3.0.0: - resolution: {integrity: sha512-540WwVDOMxA6dN6We19EcT9sc3hkXPw5mzRNGM3FkdN/vtE9NFvj5lFAPNwUDmJjXidm3v7TC1cTE7t17Ulm1Q==} - engines: {node: '>=0.12.0'} - - run-parallel@1.2.0: - resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} - - rxjs@7.8.1: - resolution: {integrity: sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==} - - safe-buffer@5.2.1: - resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} - - safer-buffer@2.1.2: - resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} - - semver@6.3.1: - resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} - hasBin: true - - semver@7.6.0: - resolution: {integrity: sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==} - engines: {node: '>=10'} - hasBin: true - - serialize-error@7.0.1: - resolution: {integrity: sha512-8I8TjW5KMOKsZQTvoxjuSIa7foAwPWGOts+6o7sgjz41/qMD9VQHEDxi6PBvK2l0MXUmqZyNpUK+T2tQaaElvw==} - engines: {node: '>=10'} - - set-blocking@2.0.0: - resolution: {integrity: sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==} - - set-function-length@1.2.2: - resolution: {integrity: sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==} - engines: {node: '>= 0.4'} - - signal-exit@3.0.7: - resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} - - signal-exit@4.1.0: - resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} - engines: {node: '>=14'} - - slash@5.1.0: - resolution: {integrity: sha512-ZA6oR3T/pEyuqwMgAKT0/hAv8oAXckzbkmR0UkUosQ+Mc4RxGoJkRmwHgHufaenlyAgE1Mxgpdcrf75y6XcnDg==} - engines: {node: '>=14.16'} - - slice-ansi@5.0.0: - resolution: {integrity: sha512-FC+lgizVPfie0kkhqUScwRu1O/lF6NOgJmlCgK+/LYxDCTk8sGelYaHDhFcDN+Sn3Cv+3VSa4Byeo+IMCzpMgQ==} - engines: {node: '>=12'} - - sprintf-js@1.0.3: - resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==} - - stack-utils@2.0.6: - resolution: {integrity: sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==} - engines: {node: '>=10'} - - string-width@4.2.3: - resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} - engines: {node: '>=8'} - - string-width@7.1.0: - resolution: {integrity: sha512-SEIJCWiX7Kg4c129n48aDRwLbFb2LJmXXFrWBG4NGaRtMQ3myKPKbwrD1BKqQn74oCoNMBVrfDEr5M9YxCsrkw==} - engines: {node: '>=18'} - - string_decoder@1.3.0: - resolution: {integrity: sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==} - - strip-ansi@6.0.1: - resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} - engines: {node: '>=8'} - - strip-ansi@7.1.0: - resolution: {integrity: sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==} - engines: {node: '>=12'} - - supertap@3.0.1: - resolution: {integrity: sha512-u1ZpIBCawJnO+0QePsEiOknOfCRq0yERxiAchT0i4li0WHNUJbf0evXXSXOcCAR4M8iMDoajXYmstm/qO81Isw==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - supports-color@7.2.0: - resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} - engines: {node: '>=8'} - - tar@6.2.1: - resolution: {integrity: sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==} - engines: {node: '>=10'} - - temp-dir@3.0.0: - resolution: {integrity: sha512-nHc6S/bwIilKHNRgK/3jlhDoIHcp45YgyiwcAk46Tr0LfEqGBVpmiAyuiuxeVE44m3mXnEeVhaipLOEWmH+Njw==} - engines: {node: '>=14.16'} - - time-zone@1.0.0: - resolution: {integrity: sha512-TIsDdtKo6+XrPtiTm1ssmMngN1sAhyKnTO2kunQWqNPWIVvCm15Wmw4SWInwTVgJ5u/Tr04+8Ei9TNcw4x4ONA==} - engines: {node: '>=4'} - - tmp@0.0.33: - resolution: {integrity: sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==} - engines: {node: '>=0.6.0'} - - to-regex-range@5.0.1: - resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} - engines: {node: '>=8.0'} - - toml@3.0.0: - resolution: {integrity: sha512-y/mWCZinnvxjTKYhJ+pYxwD0mRLVvOtdS2Awbgxln6iEnt4rk0yBxeSBHkGJcPucRiG0e55mwWp+g/05rsrd6w==} - - tr46@0.0.3: - resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==} - - tslib@2.6.2: - resolution: {integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==} - - typanion@3.14.0: - resolution: {integrity: sha512-ZW/lVMRabETuYCd9O9ZvMhAh8GslSqaUjxmK/JLPCh6l73CvLBiuXswj/+7LdnWOgYsQ130FqLzFz5aGT4I3Ug==} - - type-fest@0.13.1: - resolution: {integrity: sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==} - engines: {node: '>=10'} - - type-fest@0.21.3: - resolution: {integrity: sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==} - engines: {node: '>=10'} - - typescript@5.4.5: - resolution: {integrity: sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==} - engines: {node: '>=14.17'} - hasBin: true - - undici-types@5.26.5: - resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==} - - unicorn-magic@0.1.0: - resolution: {integrity: sha512-lRfVq8fE8gz6QMBuDM6a+LO3IAzTi05H6gCVaUpir2E1Rwpo4ZUog45KpNXKC/Mn3Yb9UDuHumeFTo9iV/D9FQ==} - engines: {node: '>=18'} - - universal-user-agent@6.0.1: - resolution: {integrity: sha512-yCzhz6FN2wU1NiiQRogkTQszlQSlpWaw8SvVegAc+bDxbzHgh1vX8uIe8OYyMH6DwH+sdTJsgMl36+mSMdRJIQ==} - - util-deprecate@1.0.2: - resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} - - wasm-sjlj@1.0.5: - resolution: {integrity: sha512-Z/MHJeOkAvJJVWnGX3/YZGYldGaawZbYHX4ldYG9kLhcdB8H31F5x66M7Zc4BP/7pg0aLsusQj1629m2B3Rilg==} - - wcwidth@1.0.1: - resolution: {integrity: sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==} - - webidl-conversions@3.0.1: - resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==} - - well-known-symbols@2.0.0: - resolution: {integrity: sha512-ZMjC3ho+KXo0BfJb7JgtQ5IBuvnShdlACNkKkdsqBmYw3bPAaJfPeYUo6tLUaT5tG/Gkh7xkpBhKRQ9e7pyg9Q==} - engines: {node: '>=6'} - - whatwg-url@5.0.0: - resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==} - - wide-align@1.1.5: - resolution: {integrity: sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==} - - wrap-ansi@6.2.0: - resolution: {integrity: sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==} - engines: {node: '>=8'} - - wrap-ansi@7.0.0: - resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==} - engines: {node: '>=10'} - - wrappy@1.0.2: - resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} - - write-file-atomic@5.0.1: - resolution: {integrity: sha512-+QU2zd6OTD8XWIJCbffaiQeH9U73qIqafo1x6V1snCWYGJf6cVE0cDR4D8xRzcEnfI21IFrUPzPGtcPf8AC+Rw==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - - y18n@5.0.8: - resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==} - engines: {node: '>=10'} - - yallist@4.0.0: - resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==} - - yargs-parser@21.1.1: - resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} - engines: {node: '>=12'} - - yargs@17.7.2: - resolution: {integrity: sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==} - engines: {node: '>=12'} - -snapshots: - - '@emnapi/core@1.1.1': - dependencies: - tslib: 2.6.2 - - '@emnapi/runtime@1.1.1': - dependencies: - tslib: 2.6.2 - - '@inquirer/figures@1.0.1': {} - - '@ljharb/through@2.3.13': - dependencies: - call-bind: 1.0.7 - - '@mapbox/node-pre-gyp@1.0.11': - dependencies: - detect-libc: 2.0.3 - https-proxy-agent: 5.0.1 - make-dir: 3.1.0 - node-fetch: 2.7.0 - nopt: 5.0.0 - npmlog: 5.0.1 - rimraf: 3.0.2 - semver: 7.6.0 - tar: 6.2.1 - transitivePeerDependencies: - - encoding - - supports-color - - '@napi-rs/cli@3.0.0-alpha.51(@emnapi/runtime@1.1.1)(emnapi@1.1.1)': - dependencies: - '@napi-rs/cross-toolchain': 0.0.14 - '@napi-rs/wasm-tools': 0.0.1 - '@octokit/rest': 20.1.0 - clipanion: 3.2.1(typanion@3.14.0) - colorette: 2.0.20 - debug: 4.3.4 - inquirer: 9.2.19 - js-yaml: 4.1.0 - lodash-es: 4.17.21 - semver: 7.6.0 - toml: 3.0.0 - typanion: 3.14.0 - wasm-sjlj: 1.0.5 - optionalDependencies: - '@emnapi/runtime': 1.1.1 - emnapi: 1.1.1 - transitivePeerDependencies: - - '@napi-rs/cross-toolchain-arm64-target-aarch64' - - '@napi-rs/cross-toolchain-arm64-target-armv7' - - '@napi-rs/cross-toolchain-arm64-target-x86_64' - - '@napi-rs/cross-toolchain-x64-target-aarch64' - - '@napi-rs/cross-toolchain-x64-target-armv7' - - '@napi-rs/cross-toolchain-x64-target-x86_64' - - supports-color - - '@napi-rs/cross-toolchain@0.0.14': - dependencies: - '@napi-rs/lzma': 1.2.1 - '@napi-rs/tar': 0.1.0 - debug: 4.3.4 - transitivePeerDependencies: - - supports-color - - '@napi-rs/lzma-android-arm-eabi@1.2.1': - optional: true - - '@napi-rs/lzma-android-arm64@1.2.1': - optional: true - - '@napi-rs/lzma-darwin-arm64@1.2.1': - optional: true - - '@napi-rs/lzma-darwin-x64@1.2.1': - optional: true - - '@napi-rs/lzma-freebsd-x64@1.2.1': - optional: true - - '@napi-rs/lzma-linux-arm-gnueabihf@1.2.1': - optional: true - - '@napi-rs/lzma-linux-arm64-gnu@1.2.1': - optional: true - - '@napi-rs/lzma-linux-arm64-musl@1.2.1': - optional: true - - '@napi-rs/lzma-linux-x64-gnu@1.2.1': - optional: true - - '@napi-rs/lzma-linux-x64-musl@1.2.1': - optional: true - - '@napi-rs/lzma-win32-arm64-msvc@1.2.1': - optional: true - - '@napi-rs/lzma-win32-ia32-msvc@1.2.1': - optional: true - - '@napi-rs/lzma-win32-x64-msvc@1.2.1': - optional: true - - '@napi-rs/lzma@1.2.1': - optionalDependencies: - '@napi-rs/lzma-android-arm-eabi': 1.2.1 - '@napi-rs/lzma-android-arm64': 1.2.1 - '@napi-rs/lzma-darwin-arm64': 1.2.1 - '@napi-rs/lzma-darwin-x64': 1.2.1 - '@napi-rs/lzma-freebsd-x64': 1.2.1 - '@napi-rs/lzma-linux-arm-gnueabihf': 1.2.1 - '@napi-rs/lzma-linux-arm64-gnu': 1.2.1 - '@napi-rs/lzma-linux-arm64-musl': 1.2.1 - '@napi-rs/lzma-linux-x64-gnu': 1.2.1 - '@napi-rs/lzma-linux-x64-musl': 1.2.1 - '@napi-rs/lzma-win32-arm64-msvc': 1.2.1 - '@napi-rs/lzma-win32-ia32-msvc': 1.2.1 - '@napi-rs/lzma-win32-x64-msvc': 1.2.1 - - '@napi-rs/tar-android-arm-eabi@0.1.0': - optional: true - - '@napi-rs/tar-android-arm64@0.1.0': - optional: true - - '@napi-rs/tar-darwin-arm64@0.1.0': - optional: true - - '@napi-rs/tar-darwin-x64@0.1.0': - optional: true - - '@napi-rs/tar-freebsd-x64@0.1.0': - optional: true - - '@napi-rs/tar-linux-arm-gnueabihf@0.1.0': - optional: true - - '@napi-rs/tar-linux-arm64-gnu@0.1.0': - optional: true - - '@napi-rs/tar-linux-arm64-musl@0.1.0': - optional: true - - '@napi-rs/tar-linux-x64-gnu@0.1.0': - optional: true - - '@napi-rs/tar-linux-x64-musl@0.1.0': - optional: true - - '@napi-rs/tar-win32-arm64-msvc@0.1.0': - optional: true - - '@napi-rs/tar-win32-ia32-msvc@0.1.0': - optional: true - - '@napi-rs/tar-win32-x64-msvc@0.1.0': - optional: true - - '@napi-rs/tar@0.1.0': - optionalDependencies: - '@napi-rs/tar-android-arm-eabi': 0.1.0 - '@napi-rs/tar-android-arm64': 0.1.0 - '@napi-rs/tar-darwin-arm64': 0.1.0 - '@napi-rs/tar-darwin-x64': 0.1.0 - '@napi-rs/tar-freebsd-x64': 0.1.0 - '@napi-rs/tar-linux-arm-gnueabihf': 0.1.0 - '@napi-rs/tar-linux-arm64-gnu': 0.1.0 - '@napi-rs/tar-linux-arm64-musl': 0.1.0 - '@napi-rs/tar-linux-x64-gnu': 0.1.0 - '@napi-rs/tar-linux-x64-musl': 0.1.0 - '@napi-rs/tar-win32-arm64-msvc': 0.1.0 - '@napi-rs/tar-win32-ia32-msvc': 0.1.0 - '@napi-rs/tar-win32-x64-msvc': 0.1.0 - - '@napi-rs/wasm-runtime@0.1.2': - dependencies: - '@emnapi/core': 1.1.1 - '@emnapi/runtime': 1.1.1 - '@tybys/wasm-util': 0.8.3 - optional: true - - '@napi-rs/wasm-runtime@0.2.0': - dependencies: - '@emnapi/core': 1.1.1 - '@emnapi/runtime': 1.1.1 - '@tybys/wasm-util': 0.8.3 - - '@napi-rs/wasm-tools-android-arm-eabi@0.0.1': - optional: true - - '@napi-rs/wasm-tools-android-arm64@0.0.1': - optional: true - - '@napi-rs/wasm-tools-darwin-arm64@0.0.1': - optional: true - - '@napi-rs/wasm-tools-darwin-x64@0.0.1': - optional: true - - '@napi-rs/wasm-tools-freebsd-x64@0.0.1': - optional: true - - '@napi-rs/wasm-tools-linux-arm64-gnu@0.0.1': - optional: true - - '@napi-rs/wasm-tools-linux-arm64-musl@0.0.1': - optional: true - - '@napi-rs/wasm-tools-linux-x64-gnu@0.0.1': - optional: true - - '@napi-rs/wasm-tools-linux-x64-musl@0.0.1': - optional: true - - '@napi-rs/wasm-tools-wasm32-wasi@0.0.1': - dependencies: - '@napi-rs/wasm-runtime': 0.1.2 - optional: true - - '@napi-rs/wasm-tools-win32-arm64-msvc@0.0.1': - optional: true - - '@napi-rs/wasm-tools-win32-ia32-msvc@0.0.1': - optional: true - - '@napi-rs/wasm-tools-win32-x64-msvc@0.0.1': - optional: true - - '@napi-rs/wasm-tools@0.0.1': - optionalDependencies: - '@napi-rs/wasm-tools-android-arm-eabi': 0.0.1 - '@napi-rs/wasm-tools-android-arm64': 0.0.1 - '@napi-rs/wasm-tools-darwin-arm64': 0.0.1 - '@napi-rs/wasm-tools-darwin-x64': 0.0.1 - '@napi-rs/wasm-tools-freebsd-x64': 0.0.1 - '@napi-rs/wasm-tools-linux-arm64-gnu': 0.0.1 - '@napi-rs/wasm-tools-linux-arm64-musl': 0.0.1 - '@napi-rs/wasm-tools-linux-x64-gnu': 0.0.1 - '@napi-rs/wasm-tools-linux-x64-musl': 0.0.1 - '@napi-rs/wasm-tools-wasm32-wasi': 0.0.1 - '@napi-rs/wasm-tools-win32-arm64-msvc': 0.0.1 - '@napi-rs/wasm-tools-win32-ia32-msvc': 0.0.1 - '@napi-rs/wasm-tools-win32-x64-msvc': 0.0.1 - - '@nodelib/fs.scandir@2.1.5': - dependencies: - '@nodelib/fs.stat': 2.0.5 - run-parallel: 1.2.0 - - '@nodelib/fs.stat@2.0.5': {} - - '@nodelib/fs.walk@1.2.8': - dependencies: - '@nodelib/fs.scandir': 2.1.5 - fastq: 1.17.1 - - '@octokit/auth-token@4.0.0': {} - - '@octokit/core@5.2.0': - dependencies: - '@octokit/auth-token': 4.0.0 - '@octokit/graphql': 7.1.0 - '@octokit/request': 8.4.0 - '@octokit/request-error': 5.1.0 - '@octokit/types': 13.4.1 - before-after-hook: 2.2.3 - universal-user-agent: 6.0.1 - - '@octokit/endpoint@9.0.5': - dependencies: - '@octokit/types': 13.4.1 - universal-user-agent: 6.0.1 - - '@octokit/graphql@7.1.0': - dependencies: - '@octokit/request': 8.4.0 - '@octokit/types': 13.4.1 - universal-user-agent: 6.0.1 - - '@octokit/openapi-types@20.0.0': {} - - '@octokit/openapi-types@22.1.0': {} - - '@octokit/plugin-paginate-rest@9.2.1(@octokit/core@5.2.0)': - dependencies: - '@octokit/core': 5.2.0 - '@octokit/types': 12.6.0 - - '@octokit/plugin-request-log@4.0.1(@octokit/core@5.2.0)': - dependencies: - '@octokit/core': 5.2.0 - - '@octokit/plugin-rest-endpoint-methods@10.4.1(@octokit/core@5.2.0)': - dependencies: - '@octokit/core': 5.2.0 - '@octokit/types': 12.6.0 - - '@octokit/request-error@5.1.0': - dependencies: - '@octokit/types': 13.4.1 - deprecation: 2.3.1 - once: 1.4.0 - - '@octokit/request@8.4.0': - dependencies: - '@octokit/endpoint': 9.0.5 - '@octokit/request-error': 5.1.0 - '@octokit/types': 13.4.1 - universal-user-agent: 6.0.1 - - '@octokit/rest@20.1.0': - dependencies: - '@octokit/core': 5.2.0 - '@octokit/plugin-paginate-rest': 9.2.1(@octokit/core@5.2.0) - '@octokit/plugin-request-log': 4.0.1(@octokit/core@5.2.0) - '@octokit/plugin-rest-endpoint-methods': 10.4.1(@octokit/core@5.2.0) - - '@octokit/types@12.6.0': - dependencies: - '@octokit/openapi-types': 20.0.0 - - '@octokit/types@13.4.1': - dependencies: - '@octokit/openapi-types': 22.1.0 - - '@rollup/pluginutils@4.2.1': - dependencies: - estree-walker: 2.0.2 - picomatch: 2.3.1 - - '@sindresorhus/merge-streams@2.3.0': {} - - '@tybys/wasm-util@0.8.3': - dependencies: - tslib: 2.6.2 - - '@types/node@20.12.7': - dependencies: - undici-types: 5.26.5 - - '@vercel/nft@0.26.4': - dependencies: - '@mapbox/node-pre-gyp': 1.0.11 - '@rollup/pluginutils': 4.2.1 - acorn: 8.11.3 - acorn-import-attributes: 1.9.5(acorn@8.11.3) - async-sema: 3.1.1 - bindings: 1.5.0 - estree-walker: 2.0.2 - glob: 7.2.3 - graceful-fs: 4.2.11 - micromatch: 4.0.5 - node-gyp-build: 4.8.0 - resolve-from: 5.0.0 - transitivePeerDependencies: - - encoding - - supports-color - - abbrev@1.1.1: {} - - acorn-import-attributes@1.9.5(acorn@8.11.3): - dependencies: - acorn: 8.11.3 - - acorn-walk@8.3.2: {} - - acorn@8.11.3: {} - - agent-base@6.0.2: - dependencies: - debug: 4.3.4 - transitivePeerDependencies: - - supports-color - - ansi-escapes@4.3.2: - dependencies: - type-fest: 0.21.3 - - ansi-regex@5.0.1: {} - - ansi-regex@6.0.1: {} - - ansi-styles@4.3.0: - dependencies: - color-convert: 2.0.1 - - ansi-styles@6.2.1: {} - - aproba@2.0.0: {} - - are-we-there-yet@2.0.0: - dependencies: - delegates: 1.0.0 - readable-stream: 3.6.2 - - argparse@1.0.10: - dependencies: - sprintf-js: 1.0.3 - - argparse@2.0.1: {} - - array-find-index@1.0.2: {} - - arrgv@1.0.2: {} - - arrify@3.0.0: {} - - async-sema@3.1.1: {} - - ava@6.1.2: - dependencies: - '@vercel/nft': 0.26.4 - acorn: 8.11.3 - acorn-walk: 8.3.2 - ansi-styles: 6.2.1 - arrgv: 1.0.2 - arrify: 3.0.0 - callsites: 4.1.0 - cbor: 9.0.2 - chalk: 5.3.0 - chunkd: 2.0.1 - ci-info: 4.0.0 - ci-parallel-vars: 1.0.1 - cli-truncate: 4.0.0 - code-excerpt: 4.0.0 - common-path-prefix: 3.0.0 - concordance: 5.0.4 - currently-unhandled: 0.4.1 - debug: 4.3.4 - emittery: 1.0.3 - figures: 6.1.0 - globby: 14.0.1 - ignore-by-default: 2.1.0 - indent-string: 5.0.0 - is-plain-object: 5.0.0 - is-promise: 4.0.0 - matcher: 5.0.0 - memoize: 10.0.0 - ms: 2.1.3 - p-map: 7.0.2 - package-config: 5.0.0 - picomatch: 3.0.1 - plur: 5.1.0 - pretty-ms: 9.0.0 - resolve-cwd: 3.0.0 - stack-utils: 2.0.6 - strip-ansi: 7.1.0 - supertap: 3.0.1 - temp-dir: 3.0.0 - write-file-atomic: 5.0.1 - yargs: 17.7.2 - transitivePeerDependencies: - - encoding - - supports-color - - balanced-match@1.0.2: {} - - base64-js@1.5.1: {} - - before-after-hook@2.2.3: {} - - bindings@1.5.0: - dependencies: - file-uri-to-path: 1.0.0 - - bl@4.1.0: - dependencies: - buffer: 5.7.1 - inherits: 2.0.4 - readable-stream: 3.6.2 - - blueimp-md5@2.19.0: {} - - brace-expansion@1.1.11: - dependencies: - balanced-match: 1.0.2 - concat-map: 0.0.1 - - braces@3.0.2: - dependencies: - fill-range: 7.0.1 - - buffer@5.7.1: - dependencies: - base64-js: 1.5.1 - ieee754: 1.2.1 - - call-bind@1.0.7: - dependencies: - es-define-property: 1.0.0 - es-errors: 1.3.0 - function-bind: 1.1.2 - get-intrinsic: 1.2.4 - set-function-length: 1.2.2 - - callsites@4.1.0: {} - - cbor@9.0.2: - dependencies: - nofilter: 3.1.0 - - chalk@4.1.2: - dependencies: - ansi-styles: 4.3.0 - supports-color: 7.2.0 - - chalk@5.3.0: {} - - chardet@0.7.0: {} - - chownr@2.0.0: {} - - chunkd@2.0.1: {} - - ci-info@4.0.0: {} - - ci-parallel-vars@1.0.1: {} - - cli-cursor@3.1.0: - dependencies: - restore-cursor: 3.1.0 - - cli-spinners@2.9.2: {} - - cli-truncate@4.0.0: - dependencies: - slice-ansi: 5.0.0 - string-width: 7.1.0 - - cli-width@4.1.0: {} - - clipanion@3.2.1(typanion@3.14.0): - dependencies: - typanion: 3.14.0 - - cliui@8.0.1: - dependencies: - string-width: 4.2.3 - strip-ansi: 6.0.1 - wrap-ansi: 7.0.0 - - clone@1.0.4: {} - - code-excerpt@4.0.0: - dependencies: - convert-to-spaces: 2.0.1 - - color-convert@2.0.1: - dependencies: - color-name: 1.1.4 - - color-name@1.1.4: {} - - color-support@1.1.3: {} - - colorette@2.0.20: {} - - common-path-prefix@3.0.0: {} - - concat-map@0.0.1: {} - - concordance@5.0.4: - dependencies: - date-time: 3.1.0 - esutils: 2.0.3 - fast-diff: 1.3.0 - js-string-escape: 1.0.1 - lodash: 4.17.21 - md5-hex: 3.0.1 - semver: 7.6.0 - well-known-symbols: 2.0.0 - - console-control-strings@1.1.0: {} - - convert-to-spaces@2.0.1: {} - - currently-unhandled@0.4.1: - dependencies: - array-find-index: 1.0.2 - - date-time@3.1.0: - dependencies: - time-zone: 1.0.0 - - debug@4.3.4: - dependencies: - ms: 2.1.2 - - defaults@1.0.4: - dependencies: - clone: 1.0.4 - - define-data-property@1.1.4: - dependencies: - es-define-property: 1.0.0 - es-errors: 1.3.0 - gopd: 1.0.1 - - delegates@1.0.0: {} - - deprecation@2.3.1: {} - - detect-libc@2.0.3: {} - - emittery@1.0.3: {} - - emnapi@1.1.1: {} - - emoji-regex@10.3.0: {} - - emoji-regex@8.0.0: {} - - es-define-property@1.0.0: - dependencies: - get-intrinsic: 1.2.4 - - es-errors@1.3.0: {} - - escalade@3.1.2: {} - - escape-string-regexp@2.0.0: {} - - escape-string-regexp@5.0.0: {} - - esprima@4.0.1: {} - - estree-walker@2.0.2: {} - - esutils@2.0.3: {} - - external-editor@3.1.0: - dependencies: - chardet: 0.7.0 - iconv-lite: 0.4.24 - tmp: 0.0.33 - - fast-diff@1.3.0: {} - - fast-glob@3.3.2: - dependencies: - '@nodelib/fs.stat': 2.0.5 - '@nodelib/fs.walk': 1.2.8 - glob-parent: 5.1.2 - merge2: 1.4.1 - micromatch: 4.0.5 - - fastq@1.17.1: - dependencies: - reusify: 1.0.4 - - figures@6.1.0: - dependencies: - is-unicode-supported: 2.0.0 - - file-uri-to-path@1.0.0: {} - - fill-range@7.0.1: - dependencies: - to-regex-range: 5.0.1 - - find-up-simple@1.0.0: {} - - fs-minipass@2.1.0: - dependencies: - minipass: 3.3.6 - - fs.realpath@1.0.0: {} - - function-bind@1.1.2: {} - - gauge@3.0.2: - dependencies: - aproba: 2.0.0 - color-support: 1.1.3 - console-control-strings: 1.1.0 - has-unicode: 2.0.1 - object-assign: 4.1.1 - signal-exit: 3.0.7 - string-width: 4.2.3 - strip-ansi: 6.0.1 - wide-align: 1.1.5 - - get-caller-file@2.0.5: {} - - get-east-asian-width@1.2.0: {} - - get-intrinsic@1.2.4: - dependencies: - es-errors: 1.3.0 - function-bind: 1.1.2 - has-proto: 1.0.3 - has-symbols: 1.0.3 - hasown: 2.0.2 - - glob-parent@5.1.2: - dependencies: - is-glob: 4.0.3 - - glob@7.2.3: - dependencies: - fs.realpath: 1.0.0 - inflight: 1.0.6 - inherits: 2.0.4 - minimatch: 3.1.2 - once: 1.4.0 - path-is-absolute: 1.0.1 - - globby@14.0.1: - dependencies: - '@sindresorhus/merge-streams': 2.3.0 - fast-glob: 3.3.2 - ignore: 5.3.1 - path-type: 5.0.0 - slash: 5.1.0 - unicorn-magic: 0.1.0 - - gopd@1.0.1: - dependencies: - get-intrinsic: 1.2.4 - - graceful-fs@4.2.11: {} - - has-flag@4.0.0: {} - - has-property-descriptors@1.0.2: - dependencies: - es-define-property: 1.0.0 - - has-proto@1.0.3: {} - - has-symbols@1.0.3: {} - - has-unicode@2.0.1: {} - - hasown@2.0.2: - dependencies: - function-bind: 1.1.2 - - https-proxy-agent@5.0.1: - dependencies: - agent-base: 6.0.2 - debug: 4.3.4 - transitivePeerDependencies: - - supports-color - - iconv-lite@0.4.24: - dependencies: - safer-buffer: 2.1.2 - - ieee754@1.2.1: {} - - ignore-by-default@2.1.0: {} - - ignore@5.3.1: {} - - imurmurhash@0.1.4: {} - - indent-string@5.0.0: {} - - inflight@1.0.6: - dependencies: - once: 1.4.0 - wrappy: 1.0.2 - - inherits@2.0.4: {} - - inquirer@9.2.19: - dependencies: - '@inquirer/figures': 1.0.1 - '@ljharb/through': 2.3.13 - ansi-escapes: 4.3.2 - chalk: 5.3.0 - cli-cursor: 3.1.0 - cli-width: 4.1.0 - external-editor: 3.1.0 - lodash: 4.17.21 - mute-stream: 1.0.0 - ora: 5.4.1 - run-async: 3.0.0 - rxjs: 7.8.1 - string-width: 4.2.3 - strip-ansi: 6.0.1 - wrap-ansi: 6.2.0 - - irregular-plurals@3.5.0: {} - - is-extglob@2.1.1: {} - - is-fullwidth-code-point@3.0.0: {} - - is-fullwidth-code-point@4.0.0: {} - - is-glob@4.0.3: - dependencies: - is-extglob: 2.1.1 - - is-interactive@1.0.0: {} - - is-number@7.0.0: {} - - is-plain-object@5.0.0: {} - - is-promise@4.0.0: {} - - is-unicode-supported@0.1.0: {} - - is-unicode-supported@2.0.0: {} - - js-string-escape@1.0.1: {} - - js-yaml@3.14.1: - dependencies: - argparse: 1.0.10 - esprima: 4.0.1 - - js-yaml@4.1.0: - dependencies: - argparse: 2.0.1 - - load-json-file@7.0.1: {} - - lodash-es@4.17.21: {} - - lodash@4.17.21: {} - - log-symbols@4.1.0: - dependencies: - chalk: 4.1.2 - is-unicode-supported: 0.1.0 - - lru-cache@6.0.0: - dependencies: - yallist: 4.0.0 - - make-dir@3.1.0: - dependencies: - semver: 6.3.1 - - matcher@5.0.0: - dependencies: - escape-string-regexp: 5.0.0 - - md5-hex@3.0.1: - dependencies: - blueimp-md5: 2.19.0 - - memoize@10.0.0: - dependencies: - mimic-function: 5.0.1 - - merge2@1.4.1: {} - - micromatch@4.0.5: - dependencies: - braces: 3.0.2 - picomatch: 2.3.1 - - mimic-fn@2.1.0: {} - - mimic-function@5.0.1: {} - - minimatch@3.1.2: - dependencies: - brace-expansion: 1.1.11 - - minipass@3.3.6: - dependencies: - yallist: 4.0.0 - - minipass@5.0.0: {} - - minizlib@2.1.2: - dependencies: - minipass: 3.3.6 - yallist: 4.0.0 - - mkdirp@1.0.4: {} - - ms@2.1.2: {} - - ms@2.1.3: {} - - mute-stream@1.0.0: {} - - node-fetch@2.7.0: - dependencies: - whatwg-url: 5.0.0 - - node-gyp-build@4.8.0: {} - - nofilter@3.1.0: {} - - nopt@5.0.0: - dependencies: - abbrev: 1.1.1 - - npmlog@5.0.1: - dependencies: - are-we-there-yet: 2.0.0 - console-control-strings: 1.1.0 - gauge: 3.0.2 - set-blocking: 2.0.0 - - object-assign@4.1.1: {} - - once@1.4.0: - dependencies: - wrappy: 1.0.2 - - onetime@5.1.2: - dependencies: - mimic-fn: 2.1.0 - - ora@5.4.1: - dependencies: - bl: 4.1.0 - chalk: 4.1.2 - cli-cursor: 3.1.0 - cli-spinners: 2.9.2 - is-interactive: 1.0.0 - is-unicode-supported: 0.1.0 - log-symbols: 4.1.0 - strip-ansi: 6.0.1 - wcwidth: 1.0.1 - - os-tmpdir@1.0.2: {} - - p-map@7.0.2: {} - - package-config@5.0.0: - dependencies: - find-up-simple: 1.0.0 - load-json-file: 7.0.1 - - parse-ms@4.0.0: {} - - path-is-absolute@1.0.1: {} - - path-type@5.0.0: {} - - picomatch@2.3.1: {} - - picomatch@3.0.1: {} - - plur@5.1.0: - dependencies: - irregular-plurals: 3.5.0 - - pretty-ms@9.0.0: - dependencies: - parse-ms: 4.0.0 - - queue-microtask@1.2.3: {} - - readable-stream@3.6.2: - dependencies: - inherits: 2.0.4 - string_decoder: 1.3.0 - util-deprecate: 1.0.2 - - require-directory@2.1.1: {} - - resolve-cwd@3.0.0: - dependencies: - resolve-from: 5.0.0 - - resolve-from@5.0.0: {} - - restore-cursor@3.1.0: - dependencies: - onetime: 5.1.2 - signal-exit: 3.0.7 - - reusify@1.0.4: {} - - rimraf@3.0.2: - dependencies: - glob: 7.2.3 - - run-async@3.0.0: {} - - run-parallel@1.2.0: - dependencies: - queue-microtask: 1.2.3 - - rxjs@7.8.1: - dependencies: - tslib: 2.6.2 - - safe-buffer@5.2.1: {} - - safer-buffer@2.1.2: {} - - semver@6.3.1: {} - - semver@7.6.0: - dependencies: - lru-cache: 6.0.0 - - serialize-error@7.0.1: - dependencies: - type-fest: 0.13.1 - - set-blocking@2.0.0: {} - - set-function-length@1.2.2: - 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 - - signal-exit@3.0.7: {} - - signal-exit@4.1.0: {} - - slash@5.1.0: {} - - slice-ansi@5.0.0: - dependencies: - ansi-styles: 6.2.1 - is-fullwidth-code-point: 4.0.0 - - sprintf-js@1.0.3: {} - - stack-utils@2.0.6: - dependencies: - escape-string-regexp: 2.0.0 - - string-width@4.2.3: - dependencies: - emoji-regex: 8.0.0 - is-fullwidth-code-point: 3.0.0 - strip-ansi: 6.0.1 - - string-width@7.1.0: - dependencies: - emoji-regex: 10.3.0 - get-east-asian-width: 1.2.0 - strip-ansi: 7.1.0 - - string_decoder@1.3.0: - dependencies: - safe-buffer: 5.2.1 - - strip-ansi@6.0.1: - dependencies: - ansi-regex: 5.0.1 - - strip-ansi@7.1.0: - dependencies: - ansi-regex: 6.0.1 - - supertap@3.0.1: - dependencies: - indent-string: 5.0.0 - js-yaml: 3.14.1 - serialize-error: 7.0.1 - strip-ansi: 7.1.0 - - supports-color@7.2.0: - dependencies: - has-flag: 4.0.0 - - tar@6.2.1: - dependencies: - chownr: 2.0.0 - fs-minipass: 2.1.0 - minipass: 5.0.0 - minizlib: 2.1.2 - mkdirp: 1.0.4 - yallist: 4.0.0 - - temp-dir@3.0.0: {} - - time-zone@1.0.0: {} - - tmp@0.0.33: - dependencies: - os-tmpdir: 1.0.2 - - to-regex-range@5.0.1: - dependencies: - is-number: 7.0.0 - - toml@3.0.0: {} - - tr46@0.0.3: {} - - tslib@2.6.2: {} - - typanion@3.14.0: {} - - type-fest@0.13.1: {} - - type-fest@0.21.3: {} - - typescript@5.4.5: {} - - undici-types@5.26.5: {} - - unicorn-magic@0.1.0: {} - - universal-user-agent@6.0.1: {} - - util-deprecate@1.0.2: {} - - wasm-sjlj@1.0.5: {} - - wcwidth@1.0.1: - dependencies: - defaults: 1.0.4 - - webidl-conversions@3.0.1: {} - - well-known-symbols@2.0.0: {} - - whatwg-url@5.0.0: - dependencies: - tr46: 0.0.3 - webidl-conversions: 3.0.1 - - wide-align@1.1.5: - dependencies: - string-width: 4.2.3 - - wrap-ansi@6.2.0: - dependencies: - ansi-styles: 4.3.0 - string-width: 4.2.3 - strip-ansi: 6.0.1 - - wrap-ansi@7.0.0: - dependencies: - ansi-styles: 4.3.0 - string-width: 4.2.3 - strip-ansi: 6.0.1 - - wrappy@1.0.2: {} - - write-file-atomic@5.0.1: - dependencies: - imurmurhash: 0.1.4 - signal-exit: 4.1.0 - - y18n@5.0.8: {} - - yallist@4.0.0: {} - - yargs-parser@21.1.1: {} - - yargs@17.7.2: - dependencies: - cliui: 8.0.1 - escalade: 3.1.2 - get-caller-file: 2.0.5 - require-directory: 2.1.1 - string-width: 4.2.3 - y18n: 5.0.8 - yargs-parser: 21.1.1 diff --git a/src/builtins.rs b/src/builtins.rs deleted file mode 100644 index 45a25117..00000000 --- a/src/builtins.rs +++ /dev/null @@ -1,71 +0,0 @@ -/// Node.js built-in modules -/// -/// `node -p "[...require('module').builtinModules].map(b => JSON.stringify(b)).join(',\n')"` -/// -pub const NODEJS_BUILTINS: &[&str] = &[ - "_http_agent", - "_http_client", - "_http_common", - "_http_incoming", - "_http_outgoing", - "_http_server", - "_stream_duplex", - "_stream_passthrough", - "_stream_readable", - "_stream_transform", - "_stream_wrap", - "_stream_writable", - "_tls_common", - "_tls_wrap", - "assert", - "assert/strict", - "async_hooks", - "buffer", - "child_process", - "cluster", - "console", - "constants", - "crypto", - "dgram", - "diagnostics_channel", - "dns", - "dns/promises", - "domain", - "events", - "fs", - "fs/promises", - "http", - "http2", - "https", - "inspector", - "module", - "net", - "os", - "path", - "path/posix", - "path/win32", - "perf_hooks", - "process", - "punycode", - "querystring", - "readline", - "repl", - "stream", - "stream/consumers", - "stream/promises", - "stream/web", - "string_decoder", - "sys", - "timers", - "timers/promises", - "tls", - "trace_events", - "tty", - "url", - "util", - "util/types", - "v8", - "vm", - "worker_threads", - "zlib", -]; diff --git a/src/cache.rs b/src/cache.rs deleted file mode 100644 index a1bde36c..00000000 --- a/src/cache.rs +++ /dev/null @@ -1,369 +0,0 @@ -use once_cell::sync::OnceCell as OnceLock; -use std::{ - borrow::{Borrow, Cow}, - convert::AsRef, - hash::{BuildHasherDefault, Hash, Hasher}, - io, - ops::Deref, - path::{Path, PathBuf}, - sync::Arc, -}; - -use dashmap::{DashMap, DashSet}; -use rustc_hash::FxHasher; - -use crate::{ - context::ResolveContext as Ctx, package_json::PackageJson, path::PathUtil, FileMetadata, - FileSystem, ResolveError, ResolveOptions, TsConfig, -}; - -#[derive(Default)] -pub struct Cache { - pub(crate) fs: Fs, - paths: DashSet>, - tsconfigs: DashMap, BuildHasherDefault>, -} - -impl Cache { - pub fn new(fs: Fs) -> Self { - Self { fs, paths: DashSet::default(), tsconfigs: DashMap::default() } - } - - pub fn clear(&self) { - self.paths.clear(); - self.tsconfigs.clear(); - } - - pub fn value(&self, path: &Path) -> CachedPath { - let hash = { - let mut hasher = FxHasher::default(); - path.hash(&mut hasher); - hasher.finish() - }; - if let Some(cache_entry) = self.paths.get((hash, path).borrow() as &dyn CacheKey) { - return cache_entry.clone(); - } - let parent = path.parent().map(|p| self.value(p)); - let data = CachedPath(Arc::new(CachedPathImpl::new( - hash, - path.to_path_buf().into_boxed_path(), - parent, - ))); - self.paths.insert(data.clone()); - data - } - - pub fn tsconfig Result<(), ResolveError>>( - &self, - root: bool, - path: &Path, - callback: F, // callback for modifying tsconfig with `extends` - ) -> Result, ResolveError> { - if let Some(tsconfig_ref) = self.tsconfigs.get(path) { - return Ok(Arc::clone(tsconfig_ref.value())); - } - let meta = self.fs.metadata(path).ok(); - let tsconfig_path = if meta.is_some_and(|m| m.is_file) { - Cow::Borrowed(path) - } else if meta.is_some_and(|m| m.is_dir) { - Cow::Owned(path.join("tsconfig.json")) - } else { - let mut os_string = path.to_path_buf().into_os_string(); - os_string.push(".json"); - Cow::Owned(PathBuf::from(os_string)) - }; - let mut tsconfig_string = self - .fs - .read_to_string(&tsconfig_path) - .map_err(|_| ResolveError::TsconfigNotFound(path.to_path_buf()))?; - let mut tsconfig = - TsConfig::parse(root, &tsconfig_path, &mut tsconfig_string).map_err(|error| { - ResolveError::from_serde_json_error(tsconfig_path.to_path_buf(), &error) - })?; - callback(&mut tsconfig)?; - let tsconfig = Arc::new(tsconfig.build()); - self.tsconfigs.insert(path.to_path_buf(), Arc::clone(&tsconfig)); - Ok(tsconfig) - } -} - -#[derive(Clone)] -pub struct CachedPath(Arc); - -impl Hash for CachedPath { - fn hash(&self, state: &mut H) { - self.0.hash.hash(state); - } -} - -impl PartialEq for CachedPath { - fn eq(&self, other: &Self) -> bool { - self.0.path == other.0.path - } -} -impl Eq for CachedPath {} - -impl Deref for CachedPath { - type Target = CachedPathImpl; - - fn deref(&self) -> &Self::Target { - self.0.as_ref() - } -} - -impl<'a> Borrow for CachedPath { - fn borrow(&self) -> &(dyn CacheKey + 'a) { - self - } -} - -impl AsRef for CachedPath { - fn as_ref(&self) -> &CachedPathImpl { - self.0.as_ref() - } -} - -impl CacheKey for CachedPath { - fn tuple(&self) -> (u64, &Path) { - (self.hash, &self.path) - } -} - -pub struct CachedPathImpl { - hash: u64, - path: Box, - parent: Option, - meta: OnceLock>, - symlink: OnceLock>, - canonicalized: OnceLock>, - node_modules: OnceLock>, - package_json: OnceLock>>, -} - -impl CachedPathImpl { - fn new(hash: u64, path: Box, parent: Option) -> Self { - Self { - hash, - path, - parent, - meta: OnceLock::new(), - symlink: OnceLock::new(), - canonicalized: OnceLock::new(), - node_modules: OnceLock::new(), - package_json: OnceLock::new(), - } - } - - pub fn path(&self) -> &Path { - &self.path - } - - pub fn to_path_buf(&self) -> PathBuf { - self.path.to_path_buf() - } - - pub fn parent(&self) -> Option<&CachedPath> { - self.parent.as_ref() - } - - fn meta(&self, fs: &Fs) -> Option { - *self.meta.get_or_init(|| fs.metadata(&self.path).ok()) - } - - pub fn is_file(&self, fs: &Fs, ctx: &mut Ctx) -> bool { - if let Some(meta) = self.meta(fs) { - ctx.add_file_dependency(self.path()); - meta.is_file - } else { - ctx.add_missing_dependency(self.path()); - false - } - } - - pub fn is_dir(&self, fs: &Fs, ctx: &mut Ctx) -> bool { - self.meta(fs).map_or_else( - || { - ctx.add_missing_dependency(self.path()); - false - }, - |meta| meta.is_dir, - ) - } - - fn symlink(&self, fs: &Fs) -> io::Result> { - self.symlink - .get_or_try_init(|| { - if let Ok(symlink_metadata) = fs.symlink_metadata(&self.path) { - if symlink_metadata.is_symlink { - return fs.canonicalize(self.path()).map(Some); - } - } - Ok(None) - }) - .cloned() - } - - pub fn realpath(&self, fs: &Fs) -> io::Result { - self.canonicalized - .get_or_try_init(|| { - if let Some(link) = self.symlink(fs)? { - return Ok(Some(link)); - } - if let Some(parent) = self.parent() { - let parent_path = parent.realpath(fs)?; - return Ok(Some( - parent_path.normalize_with(self.path.strip_prefix(&parent.path).unwrap()), - )); - }; - Ok(None) - }) - .cloned() - .map(|r| r.unwrap_or_else(|| self.path.clone().to_path_buf())) - } - - pub fn module_directory( - &self, - module_name: &str, - cache: &Cache, - ctx: &mut Ctx, - ) -> Option { - let cached_path = cache.value(&self.path.join(module_name)); - cached_path.is_dir(&cache.fs, ctx).then_some(cached_path) - } - - pub fn cached_node_modules( - &self, - cache: &Cache, - ctx: &mut Ctx, - ) -> Option { - self.node_modules.get_or_init(|| self.module_directory("node_modules", cache, ctx)).clone() - } - - /// Find package.json of a path by traversing parent directories. - /// - /// # Errors - /// - /// * [ResolveError::JSON] - pub fn find_package_json( - &self, - fs: &Fs, - options: &ResolveOptions, - ctx: &mut Ctx, - ) -> Result>, ResolveError> { - let mut cache_value = self; - // Go up directories when the querying path is not a directory - while !cache_value.is_dir(fs, ctx) { - if let Some(cv) = &cache_value.parent { - cache_value = cv.as_ref(); - } else { - break; - } - } - let mut cache_value = Some(cache_value); - while let Some(cv) = cache_value { - if let Some(package_json) = cv.package_json(fs, options, ctx)? { - return Ok(Some(Arc::clone(&package_json))); - } - cache_value = cv.parent.as_deref(); - } - Ok(None) - } - - /// Get package.json of the given path. - /// - /// # Errors - /// - /// * [ResolveError::JSON] - pub fn package_json( - &self, - fs: &Fs, - options: &ResolveOptions, - ctx: &mut Ctx, - ) -> Result>, ResolveError> { - // Change to `std::sync::OnceLock::get_or_try_init` when it is stable. - let result = self - .package_json - .get_or_try_init(|| { - let package_json_path = self.path.join("package.json"); - let Ok(package_json_string) = fs.read_to_string(&package_json_path) else { - return Ok(None); - }; - let real_path = if options.symlinks { - self.realpath(fs)?.join("package.json") - } else { - package_json_path.clone() - }; - PackageJson::parse(package_json_path.clone(), real_path, &package_json_string) - .map(Arc::new) - .map(Some) - .map_err(|error| ResolveError::from_serde_json_error(package_json_path, &error)) - }) - .cloned(); - // https://github.com/webpack/enhanced-resolve/blob/58464fc7cb56673c9aa849e68e6300239601e615/lib/DescriptionFileUtils.js#L68-L82 - match &result { - Ok(Some(package_json)) => { - ctx.add_file_dependency(&package_json.path); - } - Ok(None) => { - // Avoid an allocation by making this lazy - if let Some(deps) = &mut ctx.missing_dependencies { - deps.push(self.path.join("package.json")); - } - } - Err(_) => { - if let Some(deps) = &mut ctx.file_dependencies { - deps.push(self.path.join("package.json")); - } - } - } - result - } -} - -/// Memoized cache key, code adapted from . -trait CacheKey { - fn tuple(&self) -> (u64, &Path); -} - -impl Hash for dyn CacheKey + '_ { - fn hash(&self, state: &mut H) { - self.tuple().0.hash(state); - } -} - -impl PartialEq for dyn CacheKey + '_ { - fn eq(&self, other: &Self) -> bool { - self.tuple().1 == other.tuple().1 - } -} - -impl Eq for dyn CacheKey + '_ {} - -impl<'a> CacheKey for (u64, &'a Path) { - fn tuple(&self) -> (u64, &Path) { - (self.0, self.1) - } -} - -impl<'a> Borrow for (u64, &'a Path) { - fn borrow(&self) -> &(dyn CacheKey + 'a) { - self - } -} - -/// Since the cache key is memoized, use an identity hasher -/// to avoid double cache. -#[derive(Default)] -struct IdentityHasher(u64); - -impl Hasher for IdentityHasher { - fn write(&mut self, _: &[u8]) { - unreachable!("Invalid use of IdentityHasher") - } - fn write_u64(&mut self, n: u64) { - self.0 = n; - } - fn finish(&self) -> u64 { - self.0 - } -} diff --git a/src/context.rs b/src/context.rs deleted file mode 100644 index 9349de30..00000000 --- a/src/context.rs +++ /dev/null @@ -1,89 +0,0 @@ -use std::{ - ops::{Deref, DerefMut}, - path::{Path, PathBuf}, -}; - -use crate::error::ResolveError; - -#[derive(Debug, Default, Clone)] -pub struct ResolveContext(ResolveContextImpl); - -#[derive(Debug, Default, Clone)] -pub struct ResolveContextImpl { - pub fully_specified: bool, - - pub query: Option, - - pub fragment: Option, - - /// Files that was found on file system - pub file_dependencies: Option>, - - /// Files that was found on file system - pub missing_dependencies: Option>, - - /// The current resolving alias for bailing recursion alias. - pub resolving_alias: Option, - - /// For avoiding infinite recursion, which will cause stack overflow. - depth: u8, -} - -impl Deref for ResolveContext { - type Target = ResolveContextImpl; - - fn deref(&self) -> &Self::Target { - &self.0 - } -} - -impl DerefMut for ResolveContext { - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} - -impl ResolveContext { - pub fn with_fully_specified(&mut self, yes: bool) { - self.fully_specified = yes; - } - - pub fn with_query_fragment(&mut self, query: Option<&str>, fragment: Option<&str>) { - if let Some(query) = query { - self.query.replace(query.to_string()); - } - if let Some(fragment) = fragment { - self.fragment.replace(fragment.to_string()); - } - } - - pub fn init_file_dependencies(&mut self) { - self.file_dependencies.replace(vec![]); - self.missing_dependencies.replace(vec![]); - } - - pub fn add_file_dependency(&mut self, dep: &Path) { - if let Some(deps) = &mut self.file_dependencies { - deps.push(dep.to_path_buf()); - } - } - - pub fn add_missing_dependency(&mut self, dep: &Path) { - if let Some(deps) = &mut self.missing_dependencies { - deps.push(dep.to_path_buf()); - } - } - - pub fn with_resolving_alias(&mut self, alias: String) { - self.resolving_alias = Some(alias); - } - - pub fn test_for_infinite_recursion(&mut self) -> Result<(), ResolveError> { - self.depth += 1; - // 64 should be more than enough for detecting infinite recursion. - if self.depth > 64 { - return Err(ResolveError::Recursion); - } - Ok(()) - } -} diff --git a/src/error.rs b/src/error.rs deleted file mode 100644 index ff2aaa4f..00000000 --- a/src/error.rs +++ /dev/null @@ -1,160 +0,0 @@ -use std::{io, path::PathBuf, sync::Arc}; -use thiserror::Error; - -/// All resolution errors -/// -/// `thiserror` is used to display meaningful error messages. -#[derive(Debug, Clone, PartialEq, Error)] -pub enum ResolveError { - /// Ignored path - /// - /// Derived from ignored path (false value) from browser field in package.json - /// ```json - /// { - /// "browser": { - /// "./module": false - /// } - /// } - /// ``` - /// See - #[error("Path is ignored {0}")] - Ignored(PathBuf), - - /// Module not found - #[error("Cannot find module '{0}'")] - NotFound(/* specifier */ String), - - /// Tsconfig not found - #[error("Tsconfig not found {0}")] - TsconfigNotFound(PathBuf), - - #[error("{0}")] - IOError(IOError), - - /// Node.js builtin modules - /// - /// This is an error due to not being a Node.js runtime. - /// The `alias` option can be used to resolve a builtin module to a polyfill. - #[error("Builtin module {0}")] - Builtin(String), - - /// All of the aliased extension are not found - #[error("All of the aliased extension are not found")] - ExtensionAlias, - - /// The provided path specifier cannot be parsed - #[error("{0}")] - Specifier(SpecifierError), - - /// JSON parse error - #[error("{0:?}")] - JSON(JSONError), - - /// Restricted by `ResolveOptions::restrictions` - #[error(r#"Path "{0}" restricted by {0}"#)] - Restriction(PathBuf, PathBuf), - - #[error(r#"Invalid module "{0}" specifier is not a valid subpath for the "exports" resolution of {1}"#)] - InvalidModuleSpecifier(String, PathBuf), - - #[error(r#"Invalid "exports" target "{0}" defined for '{1}' in the package config {2}"#)] - InvalidPackageTarget(String, String, PathBuf), - - #[error(r#"Package subpath '{0}' is not defined by "exports" in {1}"#)] - PackagePathNotExported(String, PathBuf), - - #[error(r#"Invalid package config "{0}", "exports" cannot contain some keys starting with '.' and some not. The exports object must either be an object of package subpath keys or an object of main entry condition name keys only."#)] - InvalidPackageConfig(PathBuf), - - #[error(r#"Default condition should be last one in "{0}""#)] - InvalidPackageConfigDefault(PathBuf), - - #[error(r#"Expecting folder to folder mapping. "{0}" should end with "/"#)] - InvalidPackageConfigDirectory(PathBuf), - - #[error(r#"Package import specifier "{0}" is not defined in package {1}"#)] - PackageImportNotDefined(String, PathBuf), - - #[error("{0} is unimplemented")] - Unimplemented(&'static str), - - /// Occurs when alias paths reference each other. - #[error("Recursion in resolving")] - Recursion, -} - -impl ResolveError { - pub fn is_ignore(&self) -> bool { - matches!(self, Self::Ignored(_)) - } - - pub(crate) fn from_serde_json_error(path: PathBuf, error: &serde_json::Error) -> Self { - Self::JSON(JSONError { - path, - message: error.to_string(), - line: error.line(), - column: error.column(), - }) - } -} - -/// Error for [ResolveError::Specifier] -#[derive(Debug, Clone, Eq, PartialEq, Error)] -pub enum SpecifierError { - #[error("The specifiers must be a non-empty string. Received \"{0}\"")] - Empty(String), -} - -/// JSON error from [serde_json::Error] -#[derive(Debug, Clone, Eq, PartialEq)] -pub struct JSONError { - pub path: PathBuf, - pub message: String, - pub line: usize, - pub column: usize, -} - -#[derive(Debug, Clone, Error)] -#[error("{0}")] -pub struct IOError(Arc); - -impl PartialEq for IOError { - fn eq(&self, other: &Self) -> bool { - self.0.kind() == other.0.kind() - } -} - -impl From for io::Error { - fn from(error: IOError) -> Self { - let io_error = error.0.as_ref(); - Self::new(io_error.kind(), io_error.to_string()) - } -} - -impl From for ResolveError { - fn from(err: io::Error) -> Self { - Self::IOError(IOError(Arc::new(err))) - } -} - -#[test] -fn test_into_io_error() { - use std::io::{self, ErrorKind}; - let error_string = "IOError occurred"; - let string_error = io::Error::new(ErrorKind::Interrupted, error_string.to_string()); - let string_error2 = io::Error::new(ErrorKind::Interrupted, error_string.to_string()); - let resolve_io_error: ResolveError = ResolveError::from(string_error2); - - assert_eq!(resolve_io_error, ResolveError::from(string_error)); - assert_eq!(resolve_io_error.clone(), resolve_io_error); - if let ResolveError::IOError(io_error) = resolve_io_error { - // fix for https://github.com/web-infra-dev/rspack/issues/4564 - let std_io_error: io::Error = io_error.into(); - assert_eq!(std_io_error.kind(), ErrorKind::Interrupted); - assert_eq!(std_io_error.to_string(), error_string); - assert_eq!( - format!("{std_io_error:?}"), - r#"Custom { kind: Interrupted, error: "IOError occurred" }"# - ); - } -} diff --git a/src/file_system.rs b/src/file_system.rs deleted file mode 100644 index 04d177de..00000000 --- a/src/file_system.rs +++ /dev/null @@ -1,133 +0,0 @@ -use std::{ - fs, io, - path::{Path, PathBuf}, -}; - -/// File System abstraction used for `ResolverGeneric` -pub trait FileSystem: Send + Sync { - /// See [std::fs::read_to_string] - /// - /// # Errors - /// - /// * See [std::fs::read_to_string] - /// ## Warning - /// Use `&Path` instead of a generic `P: AsRef` here, - /// because object safety requirements, it is especially useful, when - /// you want to store multiple `dyn FileSystem` in a `Vec` or use a `ResolverGeneric` in - /// napi env. - fn read_to_string(&self, path: &Path) -> io::Result; - - /// See [std::fs::metadata] - /// - /// # Errors - /// See [std::fs::metadata] - /// ## Warning - /// Use `&Path` instead of a generic `P: AsRef` here, - /// because object safety requirements, it is especially useful, when - /// you want to store multiple `dyn FileSystem` in a `Vec` or use a `ResolverGeneric` in - /// napi env. - fn metadata(&self, path: &Path) -> io::Result; - - /// See [std::fs::symlink_metadata] - /// - /// # Errors - /// - /// See [std::fs::symlink_metadata] - /// ## Warning - /// Use `&Path` instead of a generic `P: AsRef` here, - /// because object safety requirements, it is especially useful, when - /// you want to store multiple `dyn FileSystem` in a `Vec` or use a `ResolverGeneric` in - /// napi env. - fn symlink_metadata(&self, path: &Path) -> io::Result; - - /// See [std::fs::canonicalize] - /// - /// # Errors - /// - /// See [std::fs::read_link] - /// ## Warning - /// Use `&Path` instead of a generic `P: AsRef` here, - /// because object safety requirements, it is especially useful, when - /// you want to store multiple `dyn FileSystem` in a `Vec` or use a `ResolverGeneric` in - /// napi env. - fn canonicalize(&self, path: &Path) -> io::Result; -} - -/// Metadata information about a file -#[derive(Debug, Clone, Copy)] -pub struct FileMetadata { - pub(crate) is_file: bool, - pub(crate) is_dir: bool, - pub(crate) is_symlink: bool, -} - -impl FileMetadata { - pub fn new(is_file: bool, is_dir: bool, is_symlink: bool) -> Self { - Self { is_file, is_dir, is_symlink } - } -} - -impl From for FileMetadata { - fn from(metadata: fs::Metadata) -> Self { - Self::new(metadata.is_file(), metadata.is_dir(), metadata.is_symlink()) - } -} - -/// Operating System -#[derive(Default)] -pub struct FileSystemOs; - -impl FileSystem for FileSystemOs { - fn read_to_string(&self, path: &Path) -> io::Result { - fs::read_to_string(path) - } - - fn metadata(&self, path: &Path) -> io::Result { - fs::metadata(path).map(FileMetadata::from) - } - - fn symlink_metadata(&self, path: &Path) -> io::Result { - fs::symlink_metadata(path).map(FileMetadata::from) - } - - fn canonicalize(&self, path: &Path) -> io::Result { - #[cfg(not(target_os = "wasi"))] - { - dunce::canonicalize(path) - } - #[cfg(target_os = "wasi")] - { - let meta = fs::symlink_metadata(path)?; - if meta.file_type().is_symlink() { - let link = fs::read_link(path)?; - let mut path_buf = path.to_path_buf(); - path_buf.pop(); - for segment in link.iter() { - match segment.to_str() { - Some("..") => { - path_buf.pop(); - } - Some(".") | None => {} - Some(seg) => { - // Need to trim the extra \0 introduces by rust std rust-lang/rust#123727 - path_buf.push(seg.trim_end_matches('\0')); - } - } - } - Ok(path_buf) - } else { - Ok(path.to_path_buf()) - } - } - } -} - -#[test] -fn metadata() { - let meta = FileMetadata { is_file: true, is_dir: true, is_symlink: true }; - assert_eq!( - format!("{meta:?}"), - "FileMetadata { is_file: true, is_dir: true, is_symlink: true }" - ); - let _ = meta; -} diff --git a/src/lib.rs b/src/lib.rs deleted file mode 100644 index fe116552..00000000 --- a/src/lib.rs +++ /dev/null @@ -1,1670 +0,0 @@ -//! # Oxc Resolver -//! -//! Node.js [CommonJS][cjs] and [ECMAScript][esm] Module Resolution. -//! -//! A module resolution is the process of finding the file referenced by a module specifier in -//! `import "specifier"` or `require("specifier")`. -//! -//! All [configuration options](ResolveOptions) are aligned with webpack's [enhanced-resolve]. -//! -//! ## Terminology -//! -//! ### Specifier -//! -//! For [CommonJS modules][cjs], -//! the specifier is the string passed to the `require` function. e.g. `"id"` in `require("id")`. -//! -//! For [ECMAScript modules][esm], -//! the specifier of an `import` statement is the string after the `from` keyword, -//! e.g. `'specifier'` in `import 'specifier'` or `import { sep } from 'specifier'`. -//! Specifiers are also used in export from statements, and as the argument to an `import()` expression. -//! -//! This is also named "request" in some places. -//! -//! ## References: -//! -//! * Algorithm adapted from Node.js [CommonJS Module Resolution Algorithm] and [ECMAScript Module Resolution Algorithm]. -//! * Tests are ported from [enhanced-resolve]. -//! * Some code is adapted from [parcel-resolver]. -//! * The documentation is copied from [webpack's resolve configuration](https://webpack.js.org/configuration/resolve). -//! -//! [enhanced-resolve]: https://github.com/webpack/enhanced-resolve -//! [CommonJS Module Resolution Algorithm]: https://nodejs.org/api/modules.html#all-together -//! [ECMAScript Module Resolution Algorithm]: https://nodejs.org/api/esm.html#resolution-algorithm-specification -//! [parcel-resolver]: https://github.com/parcel-bundler/parcel/blob/v2/packages/utils/node-resolver-rs -//! [cjs]: https://nodejs.org/api/modules.html -//! [esm]: https://nodejs.org/api/esm.html -//! -//! ## Feature flags -#![cfg_attr(feature = "document-features", doc = document_features::document_features!())] -#![cfg_attr(docsrs, feature(doc_auto_cfg))] -//! -//! ## Example -//! -//! ```rust,ignore -#![doc = include_str!("../examples/resolver.rs")] -//! ``` - -mod builtins; -mod cache; -mod context; -mod error; -mod file_system; -mod options; -mod package_json; -mod path; -mod resolution; -mod specifier; -mod tsconfig; - -#[cfg(test)] -mod tests; - -use std::{ - borrow::Cow, - cmp::Ordering, - ffi::OsStr, - fmt, - path::{Component, Path, PathBuf}, - sync::Arc, -}; - -use rustc_hash::FxHashSet; -use serde_json::Value as JSONValue; -use typescript_tsconfig_json::ExtendsField; - -pub use crate::{ - builtins::NODEJS_BUILTINS, - error::{JSONError, ResolveError, SpecifierError}, - file_system::{FileMetadata, FileSystem}, - options::{ - Alias, AliasValue, EnforceExtension, ResolveOptions, Restriction, TsconfigOptions, - TsconfigReferences, - }, - package_json::PackageJson, - resolution::Resolution, -}; -use crate::{ - cache::{Cache, CachedPath}, - context::ResolveContext as Ctx, - file_system::FileSystemOs, - package_json::JSONMap, - path::{PathUtil, SLASH_START}, - specifier::Specifier, - tsconfig::{ProjectReference, TsConfig}, -}; - -type ResolveResult = Result, ResolveError>; - -/// Context returned from the [Resolver::resolve_with_context] API -#[derive(Debug, Default, Clone)] -pub struct ResolveContext { - /// Files that was found on file system - pub file_dependencies: FxHashSet, - - /// Dependencies that was not found on file system - pub missing_dependencies: FxHashSet, -} - -/// Resolver with the current operating system as the file system -pub type Resolver = ResolverGeneric; - -/// Generic implementation of the resolver, can be configured by the [FileSystem] trait -pub struct ResolverGeneric { - options: ResolveOptions, - cache: Arc>, -} - -impl fmt::Debug for ResolverGeneric { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - self.options.fmt(f) - } -} - -impl Default for ResolverGeneric { - fn default() -> Self { - Self::new(ResolveOptions::default()) - } -} - -impl ResolverGeneric { - pub fn new(options: ResolveOptions) -> Self { - Self { options: options.sanitize(), cache: Arc::new(Cache::new(Fs::default())) } - } -} - -impl ResolverGeneric { - pub fn new_with_file_system(file_system: Fs, options: ResolveOptions) -> Self { - Self { cache: Arc::new(Cache::new(file_system)), options: options.sanitize() } - } - - /// Clone the resolver using the same underlying cache. - #[must_use] - pub fn clone_with_options(&self, options: ResolveOptions) -> Self { - Self { options: options.sanitize(), cache: Arc::clone(&self.cache) } - } - - /// Returns the options. - pub fn options(&self) -> &ResolveOptions { - &self.options - } - - /// Clear the underlying cache. - pub fn clear_cache(&self) { - self.cache.clear(); - } - - /// Resolve `specifier` at an absolute `path`. - /// - /// A specifier is the string passed to require or import, i.e. `require("specifier")` or `import "specifier"`. - /// - /// `path` must be an **absolute** path to a directory where the specifier is resolved against. - /// For CommonJS modules, it is the `__dirname` variable that contains the absolute path to the folder containing current module. - /// For ECMAScript modules, it is the value of `import.meta.url`. - /// - /// # Errors - /// - /// * See [ResolveError] - pub fn resolve>( - &self, - path: P, - specifier: &str, - ) -> Result { - let mut ctx = Ctx::default(); - self.resolve_tracing(path.as_ref(), specifier, &mut ctx) - } - - /// Resolve `specifier` at absolute `path` with [ResolveContext] - /// - /// # Errors - /// - /// * See [ResolveError] - pub fn resolve_with_context>( - &self, - path: P, - specifier: &str, - resolve_context: &mut ResolveContext, - ) -> Result { - let mut ctx = Ctx::default(); - ctx.init_file_dependencies(); - let result = self.resolve_tracing(path.as_ref(), specifier, &mut ctx); - if let Some(deps) = &mut ctx.file_dependencies { - resolve_context.file_dependencies.extend(deps.drain(..)); - } - if let Some(deps) = &mut ctx.missing_dependencies { - resolve_context.missing_dependencies.extend(deps.drain(..)); - } - result - } - - /// Wrap `resolve_impl` with `tracing` information - fn resolve_tracing( - &self, - path: &Path, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - let span = tracing::debug_span!("resolve", path = ?path, specifier = specifier); - let _enter = span.enter(); - let r = self.resolve_impl(path, specifier, ctx); - match &r { - Ok(r) => { - tracing::debug!(options = ?self.options, path = ?path, specifier = specifier, ret = ?r.path); - } - Err(err) => { - tracing::debug!(options = ?self.options, path = ?path, specifier = specifier, err = ?err); - } - }; - r - } - - fn resolve_impl( - &self, - path: &Path, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - ctx.with_fully_specified(self.options.fully_specified); - let cached_path = self.cache.value(path); - let cached_path = self.require(&cached_path, specifier, ctx)?; - let path = self.load_realpath(&cached_path)?; - // enhanced-resolve: restrictions - self.check_restrictions(&path)?; - let package_json = cached_path.find_package_json(&self.cache.fs, &self.options, ctx)?; - if let Some(package_json) = &package_json { - // path must be inside the package. - debug_assert!(path.starts_with(package_json.directory())); - } - Ok(Resolution { - path, - query: ctx.query.take(), - fragment: ctx.fragment.take(), - package_json, - }) - } - - /// require(X) from module at path Y - /// - /// X: specifier - /// Y: path - /// - /// - fn require( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - ctx.test_for_infinite_recursion()?; - - // enhanced-resolve: parse - let (parsed, try_fragment_as_path) = self.load_parse(cached_path, specifier, ctx)?; - if let Some(path) = try_fragment_as_path { - return Ok(path); - } - - self.require_without_parse(cached_path, parsed.path(), ctx) - } - - fn require_without_parse( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - // tsconfig-paths - if let Some(path) = self.load_tsconfig_paths(cached_path, specifier, &mut Ctx::default())? { - return Ok(path); - } - - // enhanced-resolve: try alias - if let Some(path) = self.load_alias(cached_path, specifier, &self.options.alias, ctx)? { - return Ok(path); - } - - let result = match Path::new(specifier).components().next() { - // 3. If X begins with './' or '/' or '../' - Some(Component::RootDir | Component::Prefix(_)) => { - self.require_absolute(cached_path, specifier, ctx) - } - // 3. If X begins with './' or '/' or '../' - Some(Component::CurDir | Component::ParentDir) => { - self.require_relative(cached_path, specifier, ctx) - } - // 4. If X begins with '#' - Some(Component::Normal(_)) if specifier.as_bytes()[0] == b'#' => { - self.require_hash(cached_path, specifier, ctx) - } - _ => { - // 1. If X is a core module, - // a. return the core module - // b. STOP - self.require_core(specifier)?; - - // (ESM) 5. Otherwise, - // Note: specifier is now a bare specifier. - // Set resolved the result of PACKAGE_RESOLVE(specifier, parentURL). - self.require_bare(cached_path, specifier, ctx) - } - }; - - result.or_else(|err| { - if err.is_ignore() { - return Err(err); - } - // enhanced-resolve: try fallback - self.load_alias(cached_path, specifier, &self.options.fallback, ctx) - .and_then(|value| value.ok_or(err)) - }) - } - - // PACKAGE_RESOLVE(packageSpecifier, parentURL) - // 3. If packageSpecifier is a Node.js builtin module name, then - // 1. Return the string "node:" concatenated with packageSpecifier. - fn require_core(&self, specifier: &str) -> Result<(), ResolveError> { - if self.options.builtin_modules { - let starts_with_node = specifier.starts_with("node:"); - if starts_with_node || NODEJS_BUILTINS.binary_search(&specifier).is_ok() { - let mut specifier = specifier.to_string(); - if !starts_with_node { - specifier = format!("node:{specifier}"); - } - return Err(ResolveError::Builtin(specifier)); - } - } - Ok(()) - } - - fn require_absolute( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - // Make sure only path prefixes gets called - debug_assert!(Path::new(specifier) - .components() - .next() - .is_some_and(|c| matches!(c, Component::RootDir | Component::Prefix(_)))); - if !self.options.prefer_relative && self.options.prefer_absolute { - if let Ok(path) = self.load_package_self_or_node_modules(cached_path, specifier, ctx) { - return Ok(path); - } - } - if let Some(path) = self.load_roots(specifier, ctx) { - return Ok(path); - } - // 2. If X begins with '/' - // a. set Y to be the file system root - let path = self.cache.value(Path::new(specifier)); - if let Some(path) = self.load_as_file_or_directory(&path, specifier, ctx)? { - return Ok(path); - } - Err(ResolveError::NotFound(specifier.to_string())) - } - - // 3. If X begins with './' or '/' or '../' - fn require_relative( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - // Make sure only relative or normal paths gets called - debug_assert!(Path::new(specifier).components().next().is_some_and(|c| matches!( - c, - Component::CurDir | Component::ParentDir | Component::Normal(_) - ))); - let path = cached_path.path().normalize_with(specifier); - let cached_path = self.cache.value(&path); - // a. LOAD_AS_FILE(Y + X) - // b. LOAD_AS_DIRECTORY(Y + X) - if let Some(path) = self.load_as_file_or_directory(&cached_path, specifier, ctx)? { - return Ok(path); - } - // c. THROW "not found" - Err(ResolveError::NotFound(specifier.to_string())) - } - - fn require_hash( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - debug_assert_eq!(specifier.chars().next(), Some('#')); - // a. LOAD_PACKAGE_IMPORTS(X, dirname(Y)) - if let Some(path) = self.load_package_imports(cached_path, specifier, ctx)? { - return Ok(path); - } - self.load_package_self_or_node_modules(cached_path, specifier, ctx) - } - - fn require_bare( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - // Make sure no other path prefixes gets called - debug_assert!(Path::new(specifier) - .components() - .next() - .is_some_and(|c| matches!(c, Component::Normal(_)))); - if self.options.prefer_relative { - if let Ok(path) = self.require_relative(cached_path, specifier, ctx) { - return Ok(path); - } - } - self.load_package_self_or_node_modules(cached_path, specifier, ctx) - } - - /// enhanced-resolve: ParsePlugin. - /// - /// 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`. - /// - /// - fn load_parse<'s>( - &self, - cached_path: &CachedPath, - specifier: &'s str, - ctx: &mut Ctx, - ) -> Result<(Specifier<'s>, Option), ResolveError> { - let parsed = Specifier::parse(specifier).map_err(ResolveError::Specifier)?; - ctx.with_query_fragment(parsed.query, parsed.fragment); - - // There is an edge-case where a request with # can be a path or a fragment -> try both - if ctx.fragment.is_some() && ctx.query.is_none() { - let specifier = parsed.path(); - let fragment = ctx.fragment.take().unwrap(); - let path = format!("{specifier}{fragment}"); - if let Ok(path) = self.require_without_parse(cached_path, &path, ctx) { - return Ok((parsed, Some(path))); - } - ctx.fragment.replace(fragment); - } - Ok((parsed, None)) - } - - fn load_package_self_or_node_modules( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - let (_, subpath) = Self::parse_package_specifier(specifier); - if subpath.is_empty() { - ctx.with_fully_specified(false); - } - // 5. LOAD_PACKAGE_SELF(X, dirname(Y)) - if let Some(path) = self.load_package_self(cached_path, specifier, ctx)? { - return Ok(path); - } - // 6. LOAD_NODE_MODULES(X, dirname(Y)) - if let Some(path) = self.load_node_modules(cached_path, specifier, ctx)? { - return Ok(path); - } - // 7. THROW "not found" - Err(ResolveError::NotFound(specifier.to_string())) - } - - /// LOAD_PACKAGE_IMPORTS(X, DIR) - fn load_package_imports( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - // 1. Find the closest package scope SCOPE to DIR. - // 2. If no scope was found, return. - let Some(package_json) = - cached_path.find_package_json(&self.cache.fs, &self.options, ctx)? - else { - return Ok(None); - }; - // 3. If the SCOPE/package.json "imports" is null or undefined, return. - // 4. let MATCH = PACKAGE_IMPORTS_RESOLVE(X, pathToFileURL(SCOPE), ["node", "require"]) defined in the ESM resolver. - if let Some(path) = self.package_imports_resolve(specifier, &package_json, ctx)? { - // 5. RESOLVE_ESM_MATCH(MATCH). - return self.resolve_esm_match(specifier, &path, ctx); - } - Ok(None) - } - - fn load_as_file(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - // enhanced-resolve feature: extension_alias - if let Some(path) = self.load_extension_alias(cached_path, ctx)? { - return Ok(Some(path)); - } - if self.options.enforce_extension.is_disabled() { - // 1. If X is a file, load X as its file extension format. STOP - if let Some(path) = self.load_alias_or_file(cached_path, ctx)? { - return Ok(Some(path)); - } - } - // 2. If X.js is a file, load X.js as JavaScript text. STOP - // 3. If X.json is a file, parse X.json to a JavaScript Object. STOP - // 4. If X.node is a file, load X.node as binary addon. STOP - if let Some(path) = - self.load_extensions(cached_path.path(), &self.options.extensions, ctx)? - { - return Ok(Some(path)); - } - Ok(None) - } - - fn load_as_directory(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - // TODO: Only package.json is supported, so warn about having other values - // Checking for empty files is needed for omitting checks on package.json - // 1. If X/package.json is a file, - if !self.options.description_files.is_empty() { - // a. Parse X/package.json, and look for "main" field. - if let Some(package_json) = - cached_path.package_json(&self.cache.fs, &self.options, ctx)? - { - // b. If "main" is a falsy value, GOTO 2. - for main_field in package_json.main_fields(&self.options.main_fields) { - // c. let M = X + (json main field) - let main_field_path = cached_path.path().normalize_with(main_field); - // d. LOAD_AS_FILE(M) - let cached_path = self.cache.value(&main_field_path); - if let Some(path) = self.load_as_file(&cached_path, ctx)? { - return Ok(Some(path)); - } - // e. LOAD_INDEX(M) - if let Some(path) = self.load_index(&cached_path, ctx)? { - return Ok(Some(path)); - } - } - // f. LOAD_INDEX(X) DEPRECATED - // g. THROW "not found" - } - } - // 2. LOAD_INDEX(X) - self.load_index(cached_path, ctx) - } - - fn load_as_file_or_directory( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - if self.options.resolve_to_context { - return Ok(cached_path.is_dir(&self.cache.fs, ctx).then(|| cached_path.clone())); - } - if !specifier.ends_with('/') { - if let Some(path) = self.load_as_file(cached_path, ctx)? { - return Ok(Some(path)); - } - } - if cached_path.is_dir(&self.cache.fs, ctx) { - if let Some(path) = self.load_as_directory(cached_path, ctx)? { - return Ok(Some(path)); - } - } - Ok(None) - } - - fn load_extensions(&self, path: &Path, extensions: &[String], ctx: &mut Ctx) -> ResolveResult { - if ctx.fully_specified { - return Ok(None); - } - let path = path.as_os_str(); - for extension in extensions { - let mut path_with_extension = path.to_os_string(); - path_with_extension.reserve_exact(extension.len()); - path_with_extension.push(extension); - let cached_path = self.cache.value(Path::new(&path_with_extension)); - if let Some(path) = self.load_alias_or_file(&cached_path, ctx)? { - return Ok(Some(path)); - } - } - Ok(None) - } - - fn load_realpath(&self, cached_path: &CachedPath) -> Result { - if self.options.symlinks { - cached_path.realpath(&self.cache.fs).map_err(ResolveError::from) - } else { - Ok(cached_path.to_path_buf()) - } - } - - fn check_restrictions(&self, path: &Path) -> Result<(), ResolveError> { - // https://github.com/webpack/enhanced-resolve/blob/a998c7d218b7a9ec2461fc4fddd1ad5dd7687485/lib/RestrictionsPlugin.js#L19-L24 - fn is_inside(path: &Path, parent: &Path) -> bool { - if !path.starts_with(parent) { - return false; - } - if path.as_os_str().len() == parent.as_os_str().len() { - return true; - } - path.strip_prefix(parent).is_ok_and(|p| p == Path::new("./")) - } - for restriction in &self.options.restrictions { - match restriction { - Restriction::Path(restricted_path) => { - if !is_inside(path, restricted_path) { - return Err(ResolveError::Restriction( - path.to_path_buf(), - restricted_path.clone(), - )); - } - } - Restriction::RegExp(_) => { - return Err(ResolveError::Unimplemented("Restriction with regex")) - } - } - } - Ok(()) - } - - fn load_index(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - for main_file in &self.options.main_files { - let main_path = cached_path.path().normalize_with(main_file); - let cached_path = self.cache.value(&main_path); - if self.options.enforce_extension.is_disabled() { - if let Some(path) = self.load_alias_or_file(&cached_path, ctx)? { - return Ok(Some(path)); - } - } - // 1. If X/index.js is a file, load X/index.js as JavaScript text. STOP - // 2. If X/index.json is a file, parse X/index.json to a JavaScript object. STOP - // 3. If X/index.node is a file, load X/index.node as binary addon. STOP - if let Some(path) = - self.load_extensions(cached_path.path(), &self.options.extensions, ctx)? - { - return Ok(Some(path)); - } - } - Ok(None) - } - - fn load_alias_or_file(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - if let Some(package_json) = - cached_path.find_package_json(&self.cache.fs, &self.options, ctx)? - { - if let Some(path) = self.load_browser_field(cached_path, None, &package_json, ctx)? { - return Ok(Some(path)); - } - } - // enhanced-resolve: try file as alias - let alias_specifier = cached_path.path().to_string_lossy(); - if let Some(path) = - self.load_alias(cached_path, &alias_specifier, &self.options.alias, ctx)? - { - return Ok(Some(path)); - } - if cached_path.is_file(&self.cache.fs, ctx) { - return Ok(Some(cached_path.clone())); - } - Ok(None) - } - - fn load_node_modules( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - let (package_name, subpath) = Self::parse_package_specifier(specifier); - // 1. let DIRS = NODE_MODULES_PATHS(START) - // 2. for each DIR in DIRS: - for module_name in &self.options.modules { - for cached_path in std::iter::successors(Some(cached_path), |p| p.parent()) { - // Skip if /path/to/node_modules does not exist - if !cached_path.is_dir(&self.cache.fs, ctx) { - continue; - } - - let Some(cached_path) = self.get_module_directory(cached_path, module_name, ctx) - else { - continue; - }; - // Optimize node_modules lookup by inspecting whether the package exists - // From LOAD_PACKAGE_EXPORTS(X, DIR) - // 1. Try to interpret X as a combination of NAME and SUBPATH where the name - // may have a @scope/ prefix and the subpath begins with a slash (`/`). - if !package_name.is_empty() { - let package_path = cached_path.path().normalize_with(package_name); - let cached_path = self.cache.value(&package_path); - // Try foo/node_modules/package_name - if cached_path.is_dir(&self.cache.fs, ctx) { - // a. LOAD_PACKAGE_EXPORTS(X, DIR) - if let Some(path) = - self.load_package_exports(specifier, subpath, &cached_path, ctx)? - { - return Ok(Some(path)); - } - } else { - // foo/node_modules/package_name is not a directory, so useless to check inside it - if !subpath.is_empty() { - continue; - } - // Skip if the directory lead to the scope package does not exist - // i.e. `foo/node_modules/@scope` is not a directory for `foo/node_modules/@scope/package` - if package_name.starts_with('@') { - if let Some(path) = cached_path.parent() { - if !path.is_dir(&self.cache.fs, ctx) { - continue; - } - } - } - } - } - - // Try as file or directory for all other cases - // b. LOAD_AS_FILE(DIR/X) - // c. LOAD_AS_DIRECTORY(DIR/X) - let node_module_file = cached_path.path().normalize_with(specifier); - let cached_path = self.cache.value(&node_module_file); - if let Some(path) = self.load_as_file_or_directory(&cached_path, specifier, ctx)? { - return Ok(Some(path)); - } - } - } - Ok(None) - } - - fn get_module_directory( - &self, - cached_path: &CachedPath, - module_name: &str, - ctx: &mut Ctx, - ) -> Option { - if cached_path.path().ends_with(module_name) { - Some(cached_path.clone()) - } else if module_name == "node_modules" { - cached_path.cached_node_modules(&self.cache, ctx) - } else { - cached_path.module_directory(module_name, &self.cache, ctx) - } - } - - fn load_package_exports( - &self, - specifier: &str, - subpath: &str, - cached_path: &CachedPath, - ctx: &mut Ctx, - ) -> ResolveResult { - // 2. If X does not match this pattern or DIR/NAME/package.json is not a file, - // return. - let Some(package_json) = cached_path.package_json(&self.cache.fs, &self.options, ctx)? - else { - return Ok(None); - }; - // 3. Parse DIR/NAME/package.json, and look for "exports" field. - // 4. If "exports" is null or undefined, return. - // 5. let MATCH = PACKAGE_EXPORTS_RESOLVE(pathToFileURL(DIR/NAME), "." + SUBPATH, - // `package.json` "exports", ["node", "require"]) defined in the ESM resolver. - // Note: The subpath is not prepended with a dot on purpose - for exports in package_json.exports_fields(&self.options.exports_fields) { - if let Some(path) = self.package_exports_resolve( - cached_path.path(), - &format!(".{subpath}"), - exports, - ctx, - )? { - // 6. RESOLVE_ESM_MATCH(MATCH) - return self.resolve_esm_match(specifier, &path, ctx); - }; - } - Ok(None) - } - - fn load_package_self( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - // 1. Find the closest package scope SCOPE to DIR. - // 2. If no scope was found, return. - let Some(package_json) = - cached_path.find_package_json(&self.cache.fs, &self.options, ctx)? - else { - return Ok(None); - }; - // 3. If the SCOPE/package.json "exports" is null or undefined, return. - // 4. If the SCOPE/package.json "name" is not the first segment of X, return. - if let Some(subpath) = package_json - .name - .as_ref() - .and_then(|package_name| Self::strip_package_name(specifier, package_name)) - { - // 5. let MATCH = PACKAGE_EXPORTS_RESOLVE(pathToFileURL(SCOPE), - // "." + X.slice("name".length), `package.json` "exports", ["node", "require"]) - // defined in the ESM resolver. - let package_url = package_json.directory(); - // Note: The subpath is not prepended with a dot on purpose - // because `package_exports_resolve` matches subpath without the leading dot. - for exports in package_json.exports_fields(&self.options.exports_fields) { - if let Some(cached_path) = - self.package_exports_resolve(package_url, &format!(".{subpath}"), exports, ctx)? - { - // 6. RESOLVE_ESM_MATCH(MATCH) - return self.resolve_esm_match(specifier, &cached_path, ctx); - } - } - } - self.load_browser_field(cached_path, Some(specifier), &package_json, ctx) - } - - /// RESOLVE_ESM_MATCH(MATCH) - fn resolve_esm_match( - &self, - specifier: &str, - cached_path: &CachedPath, - ctx: &mut Ctx, - ) -> ResolveResult { - // 1. let RESOLVED_PATH = fileURLToPath(MATCH) - // 2. If the file at RESOLVED_PATH exists, load RESOLVED_PATH as its extension format. STOP - // - // Non-compliant ESM can result in a directory, so directory is tried as well. - if let Some(path) = self.load_as_file_or_directory(cached_path, "", ctx)? { - return Ok(Some(path)); - } - // 3. THROW "not found" - Err(ResolveError::NotFound(specifier.to_string())) - } - - /// enhanced-resolve: AliasFieldPlugin for [ResolveOptions::alias_fields] - fn load_browser_field( - &self, - cached_path: &CachedPath, - module_specifier: Option<&str>, - package_json: &PackageJson, - ctx: &mut Ctx, - ) -> ResolveResult { - let path = cached_path.path(); - let Some(new_specifier) = package_json.resolve_browser_field( - path, - module_specifier, - &self.options.alias_fields, - )? - else { - return Ok(None); - }; - // Abort when resolving recursive module - if module_specifier.is_some_and(|s| s == new_specifier) { - return Ok(None); - } - if ctx.resolving_alias.as_ref().is_some_and(|s| s == new_specifier) { - // Complete when resolving to self `{"./a.js": "./a.js"}` - if new_specifier.strip_prefix("./").filter(|s| path.ends_with(Path::new(s))).is_some() { - return if cached_path.is_file(&self.cache.fs, ctx) { - Ok(Some(cached_path.clone())) - } else { - Err(ResolveError::NotFound(new_specifier.to_string())) - }; - } - return Err(ResolveError::Recursion); - } - ctx.with_resolving_alias(new_specifier.to_string()); - ctx.with_fully_specified(false); - let cached_path = self.cache.value(package_json.directory()); - self.require(&cached_path, new_specifier, ctx).map(Some) - } - - /// enhanced-resolve: AliasPlugin for [ResolveOptions::alias] and [ResolveOptions::fallback]. - fn load_alias( - &self, - cached_path: &CachedPath, - specifier: &str, - aliases: &Alias, - ctx: &mut Ctx, - ) -> ResolveResult { - for (alias_key_raw, specifiers) in aliases { - let alias_key = if let Some(alias_key) = alias_key_raw.strip_suffix('$') { - if alias_key != specifier { - continue; - } - alias_key - } else { - let strip_package_name = Self::strip_package_name(specifier, alias_key_raw); - if strip_package_name.is_none() { - continue; - } - alias_key_raw - }; - // It should stop resolving when all of the tried alias values - // failed to resolve. - // - let mut should_stop = false; - for r in specifiers { - match r { - AliasValue::Path(alias_value) => { - if let Some(path) = self.load_alias_value( - cached_path, - alias_key, - alias_value, - specifier, - ctx, - &mut should_stop, - )? { - return Ok(Some(path)); - } - } - AliasValue::Ignore => { - let path = cached_path.path().normalize_with(alias_key); - return Err(ResolveError::Ignored(path)); - } - } - } - if should_stop { - return Err(ResolveError::NotFound(specifier.to_string())); - } - } - Ok(None) - } - - fn load_alias_value( - &self, - cached_path: &CachedPath, - alias_key: &str, - alias_value: &str, - request: &str, - ctx: &mut Ctx, - should_stop: &mut bool, - ) -> ResolveResult { - if request != alias_value - && !request.strip_prefix(alias_value).is_some_and(|prefix| prefix.starts_with('/')) - { - let tail = &request[alias_key.len()..]; - - let new_specifier = if tail.is_empty() { - Cow::Borrowed(alias_value) - } else { - let alias_value = Path::new(alias_value).normalize(); - // Must not append anything to alias_value if it is a file. - let alias_value_cached_path = self.cache.value(&alias_value); - if alias_value_cached_path.is_file(&self.cache.fs, ctx) { - return Ok(None); - } - - // Remove the leading slash so the final path is concatenated. - let tail = tail.trim_start_matches(SLASH_START); - let normalized = alias_value.normalize_with(tail); - Cow::Owned(normalized.to_string_lossy().to_string()) - }; - - *should_stop = true; - ctx.with_fully_specified(false); - return match self.require(cached_path, new_specifier.as_ref(), ctx) { - Err(ResolveError::NotFound(_)) => Ok(None), - Ok(path) => return Ok(Some(path)), - Err(err) => return Err(err), - }; - } - Ok(None) - } - - /// Given an extension alias map `{".js": [".ts", "js"]}`, - /// load the mapping instead of the provided extension - /// - /// This is an enhanced-resolve feature - /// - /// # Errors - /// - /// * [ResolveError::ExtensionAlias]: When all of the aliased extensions are not found - fn load_extension_alias(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - let Some(path_extension) = cached_path.path().extension() else { - return Ok(None); - }; - let Some((_, extensions)) = self - .options - .extension_alias - .iter() - .find(|(ext, _)| OsStr::new(ext.trim_start_matches('.')) == path_extension) - else { - return Ok(None); - }; - let path = cached_path.path().with_extension(""); - ctx.with_fully_specified(false); - if let Some(path) = self.load_extensions(&path, extensions, ctx)? { - return Ok(Some(path)); - } - Err(ResolveError::ExtensionAlias) - } - - /// enhanced-resolve: RootsPlugin - /// - /// A list of directories where requests of server-relative URLs (starting with '/') are resolved, - /// defaults to context configuration option. - /// - /// On non-Windows systems these requests are resolved as an absolute path first. - fn load_roots(&self, specifier: &str, ctx: &mut Ctx) -> Option { - if !self.options.roots.is_empty() { - if let Some(specifier) = specifier.strip_prefix(SLASH_START) { - for root in &self.options.roots { - let cached_path = self.cache.value(root); - if let Ok(path) = self.require_relative(&cached_path, specifier, ctx) { - return Some(path); - } - } - } - } - None - } - - fn load_tsconfig_paths( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - let Some(tsconfig_options) = &self.options.tsconfig else { - return Ok(None); - }; - let tsconfig = self.load_tsconfig( - /* root */ true, - &tsconfig_options.config_file, - &tsconfig_options.references, - )?; - let paths = tsconfig.resolve(cached_path.path(), specifier); - for path in paths { - let cached_path = self.cache.value(&path); - if let Ok(path) = self.require_relative(&cached_path, ".", ctx) { - return Ok(Some(path)); - } - } - Ok(None) - } - - fn load_tsconfig( - &self, - root: bool, - path: &Path, - references: &TsconfigReferences, - ) -> Result, ResolveError> { - self.cache.tsconfig(root, path, |tsconfig| { - let directory = self.cache.value(tsconfig.directory()); - tracing::trace!(tsconfig = ?tsconfig, "load_tsconfig"); - - // Extend tsconfig - if let Some(extends) = &tsconfig.extends { - let extended_tsconfig_paths = match extends { - ExtendsField::Single(s) => { - vec![self.get_extended_tsconfig_path(&directory, tsconfig, s)?] - } - ExtendsField::Multiple(specifiers) => specifiers - .iter() - .map(|s| self.get_extended_tsconfig_path(&directory, tsconfig, s)) - .collect::, ResolveError>>()?, - }; - for extended_tsconfig_path in extended_tsconfig_paths { - let extended_tsconfig = self.load_tsconfig( - /* root */ false, - &extended_tsconfig_path, - &TsconfigReferences::Disabled, - )?; - tsconfig.extend_tsconfig(&extended_tsconfig); - } - } - - // Load project references - match references { - TsconfigReferences::Disabled => { - tsconfig.references.drain(..); - } - TsconfigReferences::Auto => {} - TsconfigReferences::Paths(paths) => { - tsconfig.references = paths - .iter() - .map(|path| ProjectReference { path: path.clone(), tsconfig: None }) - .collect(); - } - } - if !tsconfig.references.is_empty() { - let directory = tsconfig.directory().to_path_buf(); - for reference in &mut tsconfig.references { - let reference_tsconfig_path = directory.normalize_with(&reference.path); - let tsconfig = self.cache.tsconfig( - /* root */ true, - &reference_tsconfig_path, - |_| Ok(()), - )?; - reference.tsconfig.replace(tsconfig); - } - } - Ok(()) - }) - } - - fn get_extended_tsconfig_path( - &self, - directory: &CachedPath, - tsconfig: &TsConfig, - specifier: &str, - ) -> Result { - match specifier.as_bytes().first() { - None => Err(ResolveError::Specifier(SpecifierError::Empty(specifier.to_string()))), - Some(b'/') => Ok(PathBuf::from(specifier)), - Some(b'.') => Ok(tsconfig.directory().normalize_with(specifier)), - _ => self - .clone_with_options(ResolveOptions { - description_files: vec![], - extensions: vec![".json".into()], - main_files: vec!["tsconfig.json".into()], - ..ResolveOptions::default() - }) - .load_package_self_or_node_modules(directory, specifier, &mut Ctx::default()) - .map(|p| p.to_path_buf()) - .map_err(|err| match err { - ResolveError::NotFound(_) => { - ResolveError::TsconfigNotFound(PathBuf::from(specifier)) - } - _ => err, - }), - } - } - - /// PACKAGE_RESOLVE(packageSpecifier, parentURL) - fn package_resolve( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - let (package_name, subpath) = Self::parse_package_specifier(specifier); - - // 3. If packageSpecifier is a Node.js builtin module name, then - // 1. Return the string "node:" concatenated with packageSpecifier. - self.require_core(package_name)?; - - // 11. While parentURL is not the file system root, - for module_name in &self.options.modules { - for cached_path in std::iter::successors(Some(cached_path), |p| p.parent()) { - // 1. Let packageURL be the URL resolution of "node_modules/" concatenated with packageSpecifier, relative to parentURL. - let Some(cached_path) = self.get_module_directory(cached_path, module_name, ctx) - else { - continue; - }; - // 2. Set parentURL to the parent folder URL of parentURL. - let package_path = cached_path.path().normalize_with(package_name); - let cached_path = self.cache.value(&package_path); - // 3. If the folder at packageURL does not exist, then - // 1. Continue the next loop iteration. - if cached_path.is_dir(&self.cache.fs, ctx) { - // 4. Let pjson be the result of READ_PACKAGE_JSON(packageURL). - if let Some(package_json) = - cached_path.package_json(&self.cache.fs, &self.options, ctx)? - { - // 5. If pjson is not null and pjson.exports is not null or undefined, then - // 1. Return the result of PACKAGE_EXPORTS_RESOLVE(packageURL, packageSubpath, pjson.exports, defaultConditions). - for exports in package_json.exports_fields(&self.options.exports_fields) { - if let Some(path) = self.package_exports_resolve( - cached_path.path(), - &format!(".{subpath}"), - exports, - ctx, - )? { - return Ok(Some(path)); - } - } - // 6. Otherwise, if packageSubpath is equal to ".", then - if subpath == "." { - // 1. If pjson.main is a string, then - for main_field in package_json.main_fields(&self.options.main_fields) { - // 1. Return the URL resolution of main in packageURL. - let path = cached_path.path().normalize_with(main_field); - let cached_path = self.cache.value(&path); - if cached_path.is_file(&self.cache.fs, ctx) { - return Ok(Some(cached_path)); - } - } - } - } - let subpath = format!(".{subpath}"); - ctx.with_fully_specified(false); - return self.require(&cached_path, &subpath, ctx).map(Some); - } - } - } - - Err(ResolveError::NotFound(specifier.to_string())) - } - - /// PACKAGE_EXPORTS_RESOLVE(packageURL, subpath, exports, conditions) - fn package_exports_resolve( - &self, - package_url: &Path, - subpath: &str, - exports: &JSONValue, - ctx: &mut Ctx, - ) -> ResolveResult { - let conditions = &self.options.condition_names; - // 1. If exports is an Object with both a key starting with "." and a key not starting with ".", throw an Invalid Package Configuration error. - if let JSONValue::Object(map) = exports { - let mut has_dot = false; - let mut without_dot = false; - for key in map.keys() { - has_dot = has_dot || key.starts_with(|s| s == '.' || s == '#'); - without_dot = without_dot || !key.starts_with(|s| s == '.' || s == '#'); - if has_dot && without_dot { - return Err(ResolveError::InvalidPackageConfig( - package_url.join("package.json"), - )); - } - } - } - // 2. If subpath is equal to ".", then - // Note: subpath is not prepended with a dot when passed in. - if subpath == "." { - // enhanced-resolve appends query and fragment when resolving exports field - // https://github.com/webpack/enhanced-resolve/blob/a998c7d218b7a9ec2461fc4fddd1ad5dd7687485/lib/ExportsFieldPlugin.js#L57-L62 - // This is only need when querying the main export, otherwise ctx is passed through. - if ctx.query.is_some() || ctx.fragment.is_some() { - let query = ctx.query.clone().unwrap_or_default(); - let fragment = ctx.fragment.clone().unwrap_or_default(); - return Err(ResolveError::PackagePathNotExported( - format!("./{}{query}{fragment}", subpath.trim_start_matches('.')), - package_url.join("package.json"), - )); - } - // 1. Let mainExport be undefined. - let main_export = match exports { - // 2. If exports is a String or Array, or an Object containing no keys starting with ".", then - JSONValue::String(_) | JSONValue::Array(_) => { - // 1. Set mainExport to exports. - Some(exports) - } - // 3. Otherwise if exports is an Object containing a "." property, then - JSONValue::Object(map) => { - // 1. Set mainExport to exports["."]. - map.get(".").map_or_else( - || { - if map.keys().any(|key| key.starts_with("./") || key.starts_with('#')) { - None - } else { - Some(exports) - } - }, - Some, - ) - } - _ => None, - }; - // 4. If mainExport is not undefined, then - if let Some(main_export) = main_export { - // 1. Let resolved be the result of PACKAGE_TARGET_RESOLVE( packageURL, mainExport, null, false, conditions). - let resolved = self.package_target_resolve( - package_url, - ".", - main_export, - None, - /* is_imports */ false, - conditions, - ctx, - )?; - // 2. If resolved is not null or undefined, return resolved. - if let Some(path) = resolved { - return Ok(Some(path)); - } - } - } - // 3. Otherwise, if exports is an Object and all keys of exports start with ".", then - if let JSONValue::Object(exports) = exports { - // 1. Let matchKey be the string "./" concatenated with subpath. - // Note: `package_imports_exports_resolve` does not require the leading dot. - let match_key = &subpath; - // 2. Let resolved be the result of PACKAGE_IMPORTS_EXPORTS_RESOLVE( matchKey, exports, packageURL, false, conditions). - if let Some(path) = self.package_imports_exports_resolve( - match_key, - exports, - package_url, - /* is_imports */ false, - conditions, - ctx, - )? { - // 3. If resolved is not null or undefined, return resolved. - return Ok(Some(path)); - } - } - // 4. Throw a Package Path Not Exported error. - Err(ResolveError::PackagePathNotExported( - subpath.to_string(), - package_url.join("package.json"), - )) - } - - /// PACKAGE_IMPORTS_RESOLVE(specifier, parentURL, conditions) - fn package_imports_resolve( - &self, - specifier: &str, - package_json: &PackageJson, - ctx: &mut Ctx, - ) -> Result, ResolveError> { - // 1. Assert: specifier begins with "#". - debug_assert!(specifier.starts_with('#'), "{specifier}"); - // 2. If specifier is exactly equal to "#" or starts with "#/", then - // 1. Throw an Invalid Module Specifier error. - // 3. Let packageURL be the result of LOOKUP_PACKAGE_SCOPE(parentURL). - // 4. If packageURL is not null, then - - // 1. Let pjson be the result of READ_PACKAGE_JSON(packageURL). - // 2. If pjson.imports is a non-null Object, then - - // 1. Let resolved be the result of PACKAGE_IMPORTS_EXPORTS_RESOLVE( specifier, pjson.imports, packageURL, true, conditions). - let mut has_imports = false; - for imports in package_json.imports_fields(&self.options.imports_fields) { - if !has_imports { - has_imports = true; - // TODO: fill in test case for this case - if specifier == "#" || specifier.starts_with("#/") { - return Err(ResolveError::InvalidModuleSpecifier( - specifier.to_string(), - package_json.path.clone(), - )); - } - } - if let Some(path) = self.package_imports_exports_resolve( - specifier, - imports, - package_json.directory(), - /* is_imports */ true, - &self.options.condition_names, - ctx, - )? { - // 2. If resolved is not null or undefined, return resolved. - return Ok(Some(path)); - } - } - - // 5. Throw a Package Import Not Defined error. - if has_imports { - Err(ResolveError::PackageImportNotDefined( - specifier.to_string(), - package_json.path.clone(), - )) - } else { - Ok(None) - } - } - - /// PACKAGE_IMPORTS_EXPORTS_RESOLVE(matchKey, matchObj, packageURL, isImports, conditions) - fn package_imports_exports_resolve( - &self, - match_key: &str, - match_obj: &JSONMap, - package_url: &Path, - is_imports: bool, - conditions: &[String], - ctx: &mut Ctx, - ) -> ResolveResult { - // enhanced-resolve behaves differently, it throws - // Error: CachedPath to directories is not possible with the exports field (specifier was ./dist/) - if match_key.ends_with('/') { - return Ok(None); - } - // 1. If matchKey is a key of matchObj and does not contain "*", then - if !match_key.contains('*') { - // 1. Let target be the value of matchObj[matchKey]. - if let Some(target) = match_obj.get(match_key) { - // 2. Return the result of PACKAGE_TARGET_RESOLVE(packageURL, target, null, isImports, conditions). - return self.package_target_resolve( - package_url, - match_key, - target, - None, - is_imports, - conditions, - ctx, - ); - } - } - - let mut best_target = None; - let mut best_match = ""; - let mut best_key = ""; - // 2. Let expansionKeys be the list of keys of matchObj containing only a single "*", sorted by the sorting function PATTERN_KEY_COMPARE which orders in descending order of specificity. - // 3. For each key expansionKey in expansionKeys, do - for (expansion_key, target) in match_obj { - if expansion_key.starts_with("./") || expansion_key.starts_with('#') { - // 1. Let patternBase be the substring of expansionKey up to but excluding the first "*" character. - if let Some((pattern_base, pattern_trailer)) = expansion_key.split_once('*') { - // 2. If matchKey starts with but is not equal to patternBase, then - if match_key.starts_with(pattern_base) - // 1. Let patternTrailer be the substring of expansionKey from the index after the first "*" character. - && !pattern_trailer.contains('*') - // 2. If patternTrailer has zero length, or if matchKey ends with patternTrailer and the length of matchKey is greater than or equal to the length of expansionKey, then - && (pattern_trailer.is_empty() - || (match_key.len() >= expansion_key.len() - && match_key.ends_with(pattern_trailer))) - && Self::pattern_key_compare(best_key, expansion_key).is_gt() - { - // 1. Let target be the value of matchObj[expansionKey]. - best_target = Some(target); - // 2. Let patternMatch be the substring of matchKey starting at the index of the length of patternBase up to the length of matchKey minus the length of patternTrailer. - best_match = - &match_key[pattern_base.len()..match_key.len() - pattern_trailer.len()]; - best_key = expansion_key; - } - } else if expansion_key.ends_with('/') - && match_key.starts_with(expansion_key) - && Self::pattern_key_compare(best_key, expansion_key).is_gt() - { - // TODO: [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./dist/" in the "exports" field module resolution of the package at xxx/package.json. - best_target = Some(target); - best_match = &match_key[expansion_key.len()..]; - best_key = expansion_key; - } - } - } - if let Some(best_target) = best_target { - // 3. Return the result of PACKAGE_TARGET_RESOLVE(packageURL, target, patternMatch, isImports, conditions). - return self.package_target_resolve( - package_url, - best_key, - best_target, - Some(best_match), - is_imports, - conditions, - ctx, - ); - } - // 4. Return null. - Ok(None) - } - - /// PACKAGE_TARGET_RESOLVE(packageURL, target, patternMatch, isImports, conditions) - #[allow(clippy::too_many_arguments)] - fn package_target_resolve( - &self, - package_url: &Path, - target_key: &str, - target: &JSONValue, - pattern_match: Option<&str>, - is_imports: bool, - conditions: &[String], - ctx: &mut Ctx, - ) -> ResolveResult { - fn normalize_string_target<'a>( - target_key: &'a str, - target: &'a str, - pattern_match: Option<&'a str>, - package_url: &Path, - ) -> Result, ResolveError> { - let target = if let Some(pattern_match) = pattern_match { - if !target_key.contains('*') && !target.contains('*') { - // enhanced-resolve behaviour - // TODO: [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./dist/" in the "exports" field module resolution of the package at xxx/package.json. - if target_key.ends_with('/') && target.ends_with('/') { - Cow::Owned(format!("{target}{pattern_match}")) - } else { - return Err(ResolveError::InvalidPackageConfigDirectory( - package_url.join("package.json"), - )); - } - } else { - Cow::Owned(target.replace('*', pattern_match)) - } - } else { - Cow::Borrowed(target) - }; - Ok(target) - } - - match target { - // 1. If target is a String, then - JSONValue::String(target) => { - // 1. If target does not start with "./", then - if !target.starts_with("./") { - // 1. If isImports is false, or if target starts with "../" or "/", or if target is a valid URL, then - if !is_imports || target.starts_with("../") || target.starts_with('/') { - // 1. Throw an Invalid Package Target error. - return Err(ResolveError::InvalidPackageTarget( - target.to_string(), - target_key.to_string(), - package_url.join("package.json"), - )); - } - // 2. If patternMatch is a String, then - // 1. Return PACKAGE_RESOLVE(target with every instance of "*" replaced by patternMatch, packageURL + "/"). - let target = - normalize_string_target(target_key, target, pattern_match, package_url)?; - let package_url = self.cache.value(package_url); - // // 3. Return PACKAGE_RESOLVE(target, packageURL + "/"). - return self.package_resolve(&package_url, &target, ctx); - } - - // 2. If target split on "/" or "\" contains any "", ".", "..", or "node_modules" segments after the first "." segment, case insensitive and including percent encoded variants, throw an Invalid Package Target error. - // 3. Let resolvedTarget be the URL resolution of the concatenation of packageURL and target. - // 4. Assert: resolvedTarget is contained in packageURL. - // 5. If patternMatch is null, then - let target = - normalize_string_target(target_key, target, pattern_match, package_url)?; - if Path::new(target.as_ref()).is_invalid_exports_target() { - return Err(ResolveError::InvalidPackageTarget( - target.to_string(), - target_key.to_string(), - package_url.join("package.json"), - )); - } - let resolved_target = package_url.normalize_with(target.as_ref()); - // 6. If patternMatch split on "/" or "\" contains any "", ".", "..", or "node_modules" segments, case insensitive and including percent encoded variants, throw an Invalid Module Specifier error. - // 7. Return the URL resolution of resolvedTarget with every instance of "*" replaced with patternMatch. - let value = self.cache.value(&resolved_target); - return Ok(Some(value)); - } - // 2. Otherwise, if target is a non-null Object, then - JSONValue::Object(target) => { - // 1. If exports contains any index property keys, as defined in ECMA-262 6.1.7 Array Index, throw an Invalid Package Configuration error. - // 2. For each property p of target, in object insertion order as, - for (key, target_value) in target { - // 1. If p equals "default" or conditions contains an entry for p, then - if key == "default" || conditions.contains(key) { - // 1. Let targetValue be the value of the p property in target. - // 2. Let resolved be the result of PACKAGE_TARGET_RESOLVE( packageURL, targetValue, patternMatch, isImports, conditions). - let resolved = self.package_target_resolve( - package_url, - target_key, - target_value, - pattern_match, - is_imports, - conditions, - ctx, - ); - // 3. If resolved is equal to undefined, continue the loop. - if let Some(path) = resolved? { - // 4. Return resolved. - return Ok(Some(path)); - } - } - } - // 3. Return undefined. - return Ok(None); - } - // 3. Otherwise, if target is an Array, then - JSONValue::Array(targets) => { - // 1. If _target.length is zero, return null. - if targets.is_empty() { - // Note: return PackagePathNotExported has the same effect as return because there are no matches. - return Err(ResolveError::PackagePathNotExported( - pattern_match.unwrap_or(".").to_string(), - package_url.join("package.json"), - )); - } - // 2. For each item targetValue in target, do - for (i, target_value) in targets.iter().enumerate() { - // 1. Let resolved be the result of PACKAGE_TARGET_RESOLVE( packageURL, targetValue, patternMatch, isImports, conditions), continuing the loop on any Invalid Package Target error. - let resolved = self.package_target_resolve( - package_url, - target_key, - target_value, - pattern_match, - is_imports, - conditions, - ctx, - ); - - if resolved.is_err() && i == targets.len() { - return resolved; - } - - // 2. If resolved is undefined, continue the loop. - if let Ok(Some(path)) = resolved { - // 3. Return resolved. - return Ok(Some(path)); - } - } - // 3. Return or throw the last fallback resolution null return or error. - // Note: see `resolved.is_err() && i == targets.len()` - } - _ => {} - } - // 4. Otherwise, if target is null, return null. - Ok(None) - // 5. Otherwise throw an Invalid Package Target error. - } - - // Returns (module, subpath) - // https://github.com/nodejs/node/blob/8f0f17e1e3b6c4e58ce748e06343c5304062c491/lib/internal/modules/esm/resolve.js#L688 - fn parse_package_specifier(specifier: &str) -> (&str, &str) { - let mut separator_index = specifier.as_bytes().iter().position(|b| *b == b'/'); - // let mut valid_package_name = true; - // let mut is_scoped = false; - if specifier.starts_with('@') { - // is_scoped = true; - if separator_index.is_none() || specifier.is_empty() { - // valid_package_name = false; - } else if let Some(index) = &separator_index { - separator_index = specifier[*index + 1..] - .as_bytes() - .iter() - .position(|b| *b == b'/') - .map(|i| i + *index + 1); - } - } - let package_name = - separator_index.map_or(specifier, |separator_index| &specifier[..separator_index]); - - // TODO: https://github.com/nodejs/node/blob/8f0f17e1e3b6c4e58ce748e06343c5304062c491/lib/internal/modules/esm/resolve.js#L705C1-L714C1 - // Package name cannot have leading . and cannot have percent-encoding or - // \\ separators. - // if (RegExpPrototypeExec(invalidPackageNameRegEx, packageName) !== null) - // validPackageName = false; - - // if (!validPackageName) { - // throw new ERR_INVALID_MODULE_SPECIFIER( - // specifier, 'is not a valid package name', fileURLToPath(base)); - // } - let package_subpath = - separator_index.map_or("", |separator_index| &specifier[separator_index..]); - (package_name, package_subpath) - } - - /// PATTERN_KEY_COMPARE(keyA, keyB) - fn pattern_key_compare(key_a: &str, key_b: &str) -> Ordering { - if key_a.is_empty() { - return Ordering::Greater; - } - // 1. Assert: keyA ends with "/" or contains only a single "*". - debug_assert!(key_a.ends_with('/') || key_a.match_indices('*').count() == 1, "{key_a}"); - // 2. Assert: keyB ends with "/" or contains only a single "*". - debug_assert!(key_b.ends_with('/') || key_b.match_indices('*').count() == 1, "{key_b}"); - // 3. Let baseLengthA be the index of "*" in keyA plus one, if keyA contains "*", or the length of keyA otherwise. - let a_pos = key_a.chars().position(|c| c == '*'); - let base_length_a = a_pos.map_or(key_a.len(), |p| p + 1); - // 4. Let baseLengthB be the index of "*" in keyB plus one, if keyB contains "*", or the length of keyB otherwise. - let b_pos = key_b.chars().position(|c| c == '*'); - let base_length_b = b_pos.map_or(key_b.len(), |p| p + 1); - // 5. If baseLengthA is greater than baseLengthB, return -1. - if base_length_a > base_length_b { - return Ordering::Less; - } - // 6. If baseLengthB is greater than baseLengthA, return 1. - if base_length_b > base_length_a { - return Ordering::Greater; - } - // 7. If keyA does not contain "*", return 1. - if !key_a.contains('*') { - return Ordering::Greater; - } - // 8. If keyB does not contain "*", return -1. - if !key_b.contains('*') { - return Ordering::Less; - } - // 9. If the length of keyA is greater than the length of keyB, return -1. - if key_a.len() > key_b.len() { - return Ordering::Less; - } - // 10. If the length of keyB is greater than the length of keyA, return 1. - if key_b.len() > key_a.len() { - return Ordering::Greater; - } - // 11. Return 0. - Ordering::Equal - } - - fn strip_package_name<'a>(specifier: &'a str, package_name: &'a str) -> Option<&'a str> { - specifier - .strip_prefix(package_name) - .filter(|tail| tail.is_empty() || tail.starts_with(SLASH_START)) - } -} diff --git a/src/options.rs b/src/options.rs deleted file mode 100644 index f473a133..00000000 --- a/src/options.rs +++ /dev/null @@ -1,623 +0,0 @@ -use std::path::Path; -use std::{fmt, path::PathBuf}; - -/// Module Resolution Options -/// -/// Options are directly ported from [enhanced-resolve](https://github.com/webpack/enhanced-resolve#resolver-options). -/// -/// See [webpack resolve](https://webpack.js.org/configuration/resolve/) for information and examples -#[derive(Debug, Clone)] -pub struct ResolveOptions { - /// Path to TypeScript configuration file. - /// - /// Default `None` - pub tsconfig: Option, - - /// Create aliases to import or require certain modules more easily. - /// - /// An alias is used to replace a whole path or part of a path. - /// For example, to alias a commonly used `src/` folders: `vec![("@/src"), vec![AliasValue::Path("/path/to/src")]]` - /// - /// A trailing $ can also be added to the given object's keys to signify an exact match. - /// - /// See [webpack's `resolve.alias` documentation](https://webpack.js.org/configuration/resolve/#resolvealias) for a list of use cases. - pub alias: Alias, - - /// A list of alias fields in description files. - /// - /// Specify a field, such as `browser`, to be parsed according to [this specification](https://github.com/defunctzombie/package-browser-field-spec). - /// Can be a path to json object such as `["path", "to", "exports"]`. - /// - /// Default `[]` - pub alias_fields: Vec>, - - /// Condition names for exports field which defines entry points of a package. - /// - /// The key order in the exports field is significant. During condition matching, earlier entries have higher priority and take precedence over later entries. - /// - /// Default `[]` - pub condition_names: Vec, - - /// The JSON files to use for descriptions. (There was once a `bower.json`.) - /// - /// Default `["package.json"]` - pub description_files: Vec, - - /// Set to [EnforceExtension::Enabled] for [ESM Mandatory file extensions](https://nodejs.org/api/esm.html#mandatory-file-extensions). - /// - /// If `enforce_extension` is set to [EnforceExtension::Enabled], resolution will not allow extension-less files. - /// This means `require('./foo.js')` will resolve, while `require('./foo')` will not. - /// - /// The default value for `enforce_extension` is [EnforceExtension::Auto], which is changed upon initialization. - /// - /// It changes to [EnforceExtension::Enabled] if [ResolveOptions::extensions] contains an empty string; - /// otherwise, this value changes to [EnforceExtension::Disabled]. - /// - /// Explicitly set the value to [EnforceExtension::Disabled] to disable this automatic behavior. - /// - /// For reference, this behavior is aligned with `enhanced-resolve`. See . - pub enforce_extension: EnforceExtension, - - /// A list of exports fields in description files. - /// - /// Can be a path to a JSON object such as `["path", "to", "exports"]`. - /// - /// Default `[["exports"]]`. - pub exports_fields: Vec>, - - /// Fields from `package.json` which are used to provide the internal requests of a package - /// (requests starting with # are considered internal). - /// - /// Can be a path to a JSON object such as `["path", "to", "imports"]`. - /// - /// Default `[["imports"]]`. - pub imports_fields: Vec>, - - /// An object which maps extension to extension aliases. - /// - /// Default `{}` - pub extension_alias: Vec<(String, Vec)>, - - /// Attempt to resolve these extensions in order. - /// - /// If multiple files share the same name but have different extensions, - /// will resolve the one with the extension listed first in the array and skip the rest. - /// - /// All extensions must have a leading dot. - /// - /// Default `[".js", ".json", ".node"]` - pub extensions: Vec, - - /// Redirect module requests when normal resolving fails. - /// - /// Default `[]` - pub fallback: Alias, - - /// 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). - /// - /// See also webpack configuration [resolve.fullySpecified](https://webpack.js.org/configuration/module/#resolvefullyspecified) - /// - /// Default `false` - pub fully_specified: bool, - - /// A list of main fields in description files - /// - /// Default `["main"]`. - pub main_fields: Vec, - - /// The filename to be used while resolving directories. - /// - /// Default `["index"]` - pub main_files: Vec, - - /// A list of directories to resolve modules from, can be absolute path or folder name. - /// - /// Default `["node_modules"]` - pub modules: Vec, - - /// Resolve to a context instead of a file. - /// - /// Default `false` - pub resolve_to_context: bool, - - /// Prefer to resolve module requests as relative requests instead of using modules from node_modules directories. - /// - /// Default `false` - pub prefer_relative: bool, - - /// Prefer to resolve server-relative urls as absolute paths before falling back to resolve in ResolveOptions::roots. - /// - /// Default `false` - pub prefer_absolute: bool, - - /// A list of resolve restrictions to restrict the paths that a request can be resolved on. - /// - /// Default `[]` - pub restrictions: Vec, - - /// A list of directories where requests of server-relative URLs (starting with '/') are resolved. - /// On non-Windows systems these requests are resolved as an absolute path first. - /// - /// Default `[]` - pub roots: Vec, - - /// Whether to resolve symlinks to their symlinked location. - /// When enabled, symlinked resources are resolved to their real path, not their symlinked location. - /// Note that this may cause module resolution to fail when using tools that symlink packages (like npm link). - /// - /// Default `true` - pub symlinks: bool, - - /// Whether to parse [module.builtinModules](https://nodejs.org/api/module.html#modulebuiltinmodules) or not. - /// For example, "zlib" will throw [crate::ResolveError::Builtin] when set to true. - /// - /// Default `false` - pub builtin_modules: bool, -} - -impl ResolveOptions { - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// - /// let options = ResolveOptions::default().with_condition_names(&["bar"]); - /// assert_eq!(options.condition_names, vec!["bar".to_string()]) - /// ``` - #[must_use] - pub fn with_condition_names(mut self, names: &[&str]) -> Self { - self.condition_names = names.iter().map(ToString::to_string).collect::>(); - self - } - - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// - /// let options = ResolveOptions::default().with_builtin_modules(false); - /// assert_eq!(options.builtin_modules, false) - /// ``` - #[must_use] - pub fn with_builtin_modules(mut self, flag: bool) -> Self { - self.builtin_modules = flag; - self - } - - /// Adds a single root to the options - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_root("foo"); - /// assert_eq!(options.roots, vec![PathBuf::from("foo")]) - /// ``` - #[must_use] - pub fn with_root>(mut self, root: P) -> Self { - self.roots.push(root.as_ref().to_path_buf()); - self - } - - /// Adds a single extension to the list of extensions - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_extension("jsonc"); - /// assert!(options.extensions.contains(&"jsonc".to_string())); - /// ``` - #[must_use] - pub fn with_extension>(mut self, extension: S) -> Self { - self.extensions.push(extension.into()); - self - } - - /// Adds a single main field to the list of fields - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_main_field("something"); - /// assert!(options.main_fields.contains(&"something".to_string())); - /// ``` - #[must_use] - pub fn with_main_field>(mut self, field: S) -> Self { - self.main_fields.push(field.into()); - self - } - - /// Changes how the extension should be treated - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions, EnforceExtension}; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_force_extension(EnforceExtension::Enabled); - /// assert_eq!(options.enforce_extension, EnforceExtension::Enabled); - /// ``` - #[must_use] - pub fn with_force_extension(mut self, enforce_extension: EnforceExtension) -> Self { - self.enforce_extension = enforce_extension; - self - } - - /// Sets the value for [ResolveOptions::fully_specified] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_fully_specified(true); - /// assert_eq!(options.fully_specified, true); - /// ``` - #[must_use] - pub fn with_fully_specified(mut self, fully_specified: bool) -> Self { - self.fully_specified = fully_specified; - self - } - /// Sets the value for [ResolveOptions::prefer_relative] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_prefer_relative(true); - /// assert_eq!(options.prefer_relative, true); - /// ``` - #[must_use] - pub fn with_prefer_relative(mut self, flag: bool) -> Self { - self.prefer_relative = flag; - self - } - /// Sets the value for [ResolveOptions::prefer_absolute] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_prefer_absolute(true); - /// assert_eq!(options.prefer_absolute, true); - /// ``` - #[must_use] - pub fn with_prefer_absolute(mut self, flag: bool) -> Self { - self.prefer_absolute = flag; - self - } - - /// Changes the value of [ResolveOptions::symlinks] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// - /// let options = ResolveOptions::default().with_symbolic_link(false); - /// assert_eq!(options.symlinks, false); - /// ``` - #[must_use] - pub fn with_symbolic_link(mut self, flag: bool) -> Self { - self.symlinks = flag; - self - } - - /// Adds a module to [ResolveOptions::modules] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// - /// let options = ResolveOptions::default().with_module("module"); - /// assert!(options.modules.contains(&"module".to_string())); - /// ``` - #[must_use] - pub fn with_module>(mut self, module: M) -> Self { - self.modules.push(module.into()); - self - } - - /// Adds a main file to [ResolveOptions::main_files] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// - /// let options = ResolveOptions::default().with_main_file("foo"); - /// assert!(options.main_files.contains(&"foo".to_string())); - /// ``` - #[must_use] - pub fn with_main_file>(mut self, module: M) -> Self { - self.main_files.push(module.into()); - self - } - - pub(crate) fn sanitize(mut self) -> Self { - debug_assert!( - self.extensions.iter().filter(|e| !e.is_empty()).all(|e| e.starts_with('.')), - "All extensions must start with a leading dot" - ); - // Set `enforceExtension` to `true` when [ResolveOptions::extensions] contains an empty string. - // See - if self.enforce_extension == EnforceExtension::Auto { - if !self.extensions.is_empty() && self.extensions.iter().any(String::is_empty) { - self.enforce_extension = EnforceExtension::Enabled; - } else { - self.enforce_extension = EnforceExtension::Disabled; - } - } - self - } -} - -/// Value for [ResolveOptions::enforce_extension] -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -pub enum EnforceExtension { - Auto, - Enabled, - Disabled, -} - -impl EnforceExtension { - pub const fn is_auto(&self) -> bool { - matches!(self, Self::Auto) - } - - pub const fn is_enabled(&self) -> bool { - matches!(self, Self::Enabled) - } - - pub const fn is_disabled(&self) -> bool { - matches!(self, Self::Disabled) - } -} - -/// Alias for [ResolveOptions::alias] and [ResolveOptions::fallback] -pub type Alias = Vec<(String, Vec)>; - -/// Alias Value for [ResolveOptions::alias] and [ResolveOptions::fallback] -#[derive(Debug, Clone, Hash, PartialEq, Eq)] -pub enum AliasValue { - /// The path value - Path(String), - - /// The `false` value - Ignore, -} - -impl From for AliasValue -where - S: Into, -{ - fn from(value: S) -> Self { - Self::Path(value.into()) - } -} - -/// Value for [ResolveOptions::restrictions] -#[derive(Debug, Clone)] -pub enum Restriction { - Path(PathBuf), - RegExp(String), -} - -/// Tsconfig Options for [ResolveOptions::tsconfig] -/// -/// Derived from [tsconfig-paths-webpack-plugin](https://github.com/dividab/tsconfig-paths-webpack-plugin#options) -#[derive(Debug, Clone)] -pub struct TsconfigOptions { - /// Allows you to specify where to find the TypeScript configuration file. - /// You may provide - /// * a relative path to the configuration file. It will be resolved relative to cwd. - /// * an absolute path to the configuration file. - pub config_file: PathBuf, - - /// Support for Typescript Project References. - pub references: TsconfigReferences, -} - -/// Configuration for [TsconfigOptions::references] -#[derive(Debug, Clone)] -pub enum TsconfigReferences { - Disabled, - /// Use the `references` field from tsconfig of `config_file`. - Auto, - /// Manually provided relative or absolute path. - Paths(Vec), -} - -impl Default for ResolveOptions { - fn default() -> Self { - Self { - tsconfig: None, - alias: vec![], - alias_fields: vec![], - condition_names: vec![], - description_files: vec!["package.json".into()], - enforce_extension: EnforceExtension::Auto, - extension_alias: vec![], - exports_fields: vec![vec!["exports".into()]], - imports_fields: vec![vec!["imports".into()]], - extensions: vec![".js".into(), ".json".into(), ".node".into()], - fallback: vec![], - fully_specified: false, - main_fields: vec!["main".into()], - main_files: vec!["index".into()], - modules: vec!["node_modules".into()], - resolve_to_context: false, - prefer_relative: false, - prefer_absolute: false, - restrictions: vec![], - roots: vec![], - symlinks: true, - builtin_modules: false, - } - } -} - -// For tracing -impl fmt::Display for ResolveOptions { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - if let Some(tsconfig) = &self.tsconfig { - write!(f, "tsconfig:{tsconfig:?},")?; - } - if !self.alias.is_empty() { - write!(f, "alias:{:?},", self.alias)?; - } - if !self.alias_fields.is_empty() { - write!(f, "alias_fields:{:?},", self.alias_fields)?; - } - if !self.condition_names.is_empty() { - write!(f, "condition_names:{:?},", self.condition_names)?; - } - if self.enforce_extension.is_enabled() { - write!(f, "enforce_extension:{:?},", self.enforce_extension)?; - } - if !self.exports_fields.is_empty() { - write!(f, "exports_fields:{:?},", self.exports_fields)?; - } - if !self.imports_fields.is_empty() { - write!(f, "imports_fields:{:?},", self.imports_fields)?; - } - if !self.extension_alias.is_empty() { - write!(f, "extension_alias:{:?},", self.extension_alias)?; - } - if !self.extensions.is_empty() { - write!(f, "extensions:{:?},", self.extensions)?; - } - if !self.fallback.is_empty() { - write!(f, "fallback:{:?},", self.fallback)?; - } - if self.fully_specified { - write!(f, "fully_specified:{:?},", self.fully_specified)?; - } - if !self.main_fields.is_empty() { - write!(f, "main_fields:{:?},", self.main_fields)?; - } - if !self.main_files.is_empty() { - write!(f, "main_files:{:?},", self.main_files)?; - } - if !self.modules.is_empty() { - write!(f, "modules:{:?},", self.modules)?; - } - if self.resolve_to_context { - write!(f, "resolve_to_context:{:?},", self.resolve_to_context)?; - } - if self.prefer_relative { - write!(f, "prefer_relative:{:?},", self.prefer_relative)?; - } - if self.prefer_absolute { - write!(f, "prefer_absolute:{:?},", self.prefer_absolute)?; - } - if !self.restrictions.is_empty() { - write!(f, "restrictions:{:?},", self.restrictions)?; - } - if !self.roots.is_empty() { - write!(f, "roots:{:?},", self.roots)?; - } - if self.symlinks { - write!(f, "symlinks:{:?},", self.symlinks)?; - } - if self.builtin_modules { - write!(f, "builtin_modules:{:?},", self.builtin_modules)?; - } - Ok(()) - } -} - -#[cfg(test)] -mod test { - use super::{ - AliasValue, EnforceExtension, ResolveOptions, Restriction, TsconfigOptions, - TsconfigReferences, - }; - use std::path::PathBuf; - - #[test] - fn enforce_extension() { - assert!(EnforceExtension::Auto.is_auto()); - assert!(!EnforceExtension::Enabled.is_auto()); - assert!(!EnforceExtension::Disabled.is_auto()); - - assert!(!EnforceExtension::Auto.is_enabled()); - assert!(EnforceExtension::Enabled.is_enabled()); - assert!(!EnforceExtension::Disabled.is_enabled()); - - assert!(!EnforceExtension::Auto.is_disabled()); - assert!(!EnforceExtension::Enabled.is_disabled()); - assert!(EnforceExtension::Disabled.is_disabled()); - } - - #[test] - fn display() { - let options = ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: PathBuf::from("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - alias: vec![("a".into(), vec![AliasValue::Ignore])], - alias_fields: vec![vec!["browser".into()]], - condition_names: vec!["require".into()], - enforce_extension: EnforceExtension::Enabled, - extension_alias: vec![(".js".into(), vec![".ts".into()])], - exports_fields: vec![vec!["exports".into()]], - imports_fields: vec![vec!["imports".into()]], - fallback: vec![("fallback".into(), vec![AliasValue::Ignore])], - fully_specified: true, - resolve_to_context: true, - prefer_relative: true, - prefer_absolute: true, - restrictions: vec![Restriction::Path(PathBuf::from("restrictions"))], - roots: vec![PathBuf::from("roots")], - builtin_modules: true, - ..ResolveOptions::default() - }; - - let expected = r#"tsconfig:TsconfigOptions { config_file: "tsconfig.json", references: Auto },alias:[("a", [Ignore])],alias_fields:[["browser"]],condition_names:["require"],enforce_extension:Enabled,exports_fields:[["exports"]],imports_fields:[["imports"]],extension_alias:[(".js", [".ts"])],extensions:[".js", ".json", ".node"],fallback:[("fallback", [Ignore])],fully_specified:true,main_fields:["main"],main_files:["index"],modules:["node_modules"],resolve_to_context:true,prefer_relative:true,prefer_absolute:true,restrictions:[Path("restrictions")],roots:["roots"],symlinks:true,builtin_modules:true,"#; - assert_eq!(format!("{options}"), expected); - - let options = ResolveOptions { - alias: vec![], - alias_fields: vec![], - builtin_modules: false, - condition_names: vec![], - description_files: vec![], - enforce_extension: EnforceExtension::Disabled, - exports_fields: vec![], - extension_alias: vec![], - extensions: vec![], - fallback: vec![], - fully_specified: false, - imports_fields: vec![], - main_fields: vec![], - main_files: vec![], - modules: vec![], - prefer_absolute: false, - prefer_relative: false, - resolve_to_context: false, - restrictions: vec![], - roots: vec![], - symlinks: false, - tsconfig: None, - }; - - assert_eq!(format!("{options}"), ""); - } -} diff --git a/src/package_json.rs b/src/package_json.rs deleted file mode 100644 index 73901faa..00000000 --- a/src/package_json.rs +++ /dev/null @@ -1,207 +0,0 @@ -//! package.json definitions -//! -//! Code related to export field are copied from [Parcel's resolver](https://github.com/parcel-bundler/parcel/blob/v2/packages/utils/node-resolver-rs/src/package_json.rs) -use std::path::{Path, PathBuf}; - -use serde_json::Value as JSONValue; - -use crate::{path::PathUtil, ResolveError}; - -pub type JSONMap = serde_json::Map; - -/// Deserialized package.json -#[derive(Debug, Default)] -pub struct PackageJson { - /// Path to `package.json`. Contains the `package.json` filename. - pub path: PathBuf, - - /// Realpath to `package.json`. Contains the `package.json` filename. - pub realpath: PathBuf, - - /// The "name" field defines your package's name. - /// The "name" field can be used in addition to the "exports" field to self-reference a package using its name. - /// - /// - pub name: Option, - - raw_json: std::sync::Arc, -} - -impl PackageJson { - /// # Panics - /// # Errors - pub(crate) fn parse( - path: PathBuf, - realpath: PathBuf, - json: &str, - ) -> Result { - let mut raw_json: JSONValue = serde_json::from_str(json)?; - let mut package_json = Self::default(); - - if let Some(json_object) = raw_json.as_object_mut() { - // Remove large fields that are useless for pragmatic use. - #[cfg(feature = "package_json_raw_json_api")] - { - json_object.remove("description"); - json_object.remove("keywords"); - json_object.remove("scripts"); - json_object.remove("dependencies"); - json_object.remove("devDependencies"); - json_object.remove("peerDependencies"); - json_object.remove("optionalDependencies"); - } - - // Add name. - package_json.name = - json_object.get("name").and_then(|field| field.as_str()).map(ToString::to_string); - } - - package_json.path = path; - package_json.realpath = realpath; - package_json.raw_json = std::sync::Arc::new(raw_json); - Ok(package_json) - } - - fn get_value_by_path<'a>( - fields: &'a serde_json::Map, - path: &[String], - ) -> Option<&'a JSONValue> { - if path.is_empty() { - return None; - } - let mut value = fields.get(&path[0])?; - for key in path.iter().skip(1) { - if let Some(inner_value) = value.as_object().and_then(|o| o.get(key)) { - value = inner_value; - } else { - return None; - } - } - Some(value) - } - - /// Raw serde json value of `package.json`. - /// - /// This is currently used in Rspack for: - /// * getting the `sideEffects` field - /// * query in - search on GitHub indicates query on the `type` field. - /// - /// To reduce overall memory consumption, large fields that useless for pragmatic use are removed. - /// They are: `description`, `keywords`, `scripts`, - /// `dependencies` and `devDependencies`, `peerDependencies`, `optionalDependencies`. - #[cfg(feature = "package_json_raw_json_api")] - pub fn raw_json(&self) -> &std::sync::Arc { - &self.raw_json - } - - /// Directory to `package.json` - /// - /// # Panics - /// - /// * When the package.json path is misconfigured. - pub fn directory(&self) -> &Path { - debug_assert!(self.realpath.file_name().is_some_and(|x| x == "package.json")); - self.realpath.parent().unwrap() - } - - /// The "main" field defines the entry point of a package when imported by name via a node_modules lookup. Its value is a path. - /// - /// When a package has an "exports" field, this will take precedence over the "main" field when importing the package by name. - /// - /// Values are dynamically retrieved from [ResolveOptions::main_fields]. - /// - /// - pub(crate) fn main_fields<'a>( - &'a self, - main_fields: &'a [String], - ) -> impl Iterator + '_ { - main_fields - .iter() - .filter_map(|main_field| self.raw_json.get(main_field)) - .filter_map(|value| value.as_str()) - } - - /// The "exports" field allows defining the entry points of a package when imported by name loaded either via a node_modules lookup or a self-reference to its own name. - /// - /// - pub(crate) fn exports_fields<'a>( - &'a self, - exports_fields: &'a [Vec], - ) -> impl Iterator + '_ { - exports_fields.iter().filter_map(|object_path| { - self.raw_json - .as_object() - .and_then(|json_object| Self::get_value_by_path(json_object, object_path)) - }) - } - - /// In addition to the "exports" field, there is a package "imports" field to create private mappings that only apply to import specifiers from within the package itself. - /// - /// - pub(crate) fn imports_fields<'a>( - &'a self, - imports_fields: &'a [Vec], - ) -> impl Iterator + '_ { - imports_fields.iter().filter_map(|object_path| { - self.raw_json - .as_object() - .and_then(|json_object| Self::get_value_by_path(json_object, object_path)) - .and_then(|value| value.as_object()) - }) - } - - /// The "browser" field is provided by a module author as a hint to javascript bundlers or component tools when packaging modules for client side use. - /// Multiple values are configured by [ResolveOptions::alias_fields]. - /// - /// - fn browser_fields<'a>( - &'a self, - alias_fields: &'a [Vec], - ) -> impl Iterator + '_ { - alias_fields.iter().filter_map(|object_path| { - self.raw_json - .as_object() - .and_then(|json_object| Self::get_value_by_path(json_object, object_path)) - // Only object is valid, all other types are invalid - // https://github.com/webpack/enhanced-resolve/blob/3a28f47788de794d9da4d1702a3a583d8422cd48/lib/AliasFieldPlugin.js#L44-L52 - .and_then(|value| value.as_object()) - }) - } - - /// Resolve the request string for this package.json by looking at the `browser` field. - /// - /// # Errors - /// - /// * Returns [ResolveError::Ignored] for `"path": false` in `browser` field. - pub(crate) fn resolve_browser_field<'a>( - &'a self, - path: &Path, - request: Option<&str>, - alias_fields: &'a [Vec], - ) -> Result, ResolveError> { - for object in self.browser_fields(alias_fields) { - if let Some(request) = request { - if let Some(value) = object.get(request) { - return Self::alias_value(path, value); - } - } else { - let dir = self.path.parent().unwrap(); - for (key, value) in object { - let joined = dir.normalize_with(key); - if joined == path { - return Self::alias_value(path, value); - } - } - } - } - Ok(None) - } - - fn alias_value<'a>(key: &Path, value: &'a JSONValue) -> Result, ResolveError> { - match value { - JSONValue::String(value) => Ok(Some(value.as_str())), - JSONValue::Bool(b) if !b => Err(ResolveError::Ignored(key.to_path_buf())), - _ => Ok(None), - } - } -} diff --git a/src/path.rs b/src/path.rs deleted file mode 100644 index f66fdd76..00000000 --- a/src/path.rs +++ /dev/null @@ -1,132 +0,0 @@ -//! Path Utilities -//! -//! Code adapted from the following libraries -//! * [path-absolutize](https://docs.rs/path-absolutize) -//! * [normalize_path](https://docs.rs/normalize-path) -use std::path::{Component, Path, PathBuf}; - -pub const SLASH_START: &[char; 2] = &['/', '\\']; - -/// Extension trait to add path normalization to std's [`Path`]. -pub trait PathUtil { - /// Normalize this path without performing I/O. - /// - /// All redundant separator and up-level references are collapsed. - /// - /// However, this does not resolve links. - fn normalize(&self) -> PathBuf; - - /// Normalize with subpath assuming this path is normalized without performing I/O. - /// - /// All redundant separator and up-level references are collapsed. - /// - /// However, this does not resolve links. - fn normalize_with>(&self, subpath: P) -> PathBuf; - - /// Defined in ESM PACKAGE_TARGET_RESOLVE - /// If target split on "/" or "\" contains any "", ".", "..", or "node_modules" segments after the first "." segment, case insensitive and including percent encoded variants - fn is_invalid_exports_target(&self) -> bool; -} - -impl PathUtil for Path { - // https://github.com/parcel-bundler/parcel/blob/e0b99c2a42e9109a9ecbd6f537844a1b33e7faf5/packages/utils/node-resolver-rs/src/path.rs#L7 - fn normalize(&self) -> PathBuf { - let mut components = self.components().peekable(); - let mut ret = if let Some(c @ Component::Prefix(..)) = components.peek() { - let buf = PathBuf::from(c.as_os_str()); - components.next(); - buf - } else { - PathBuf::new() - }; - - for component in components { - match component { - Component::Prefix(..) => unreachable!("Path {:?}", self), - Component::RootDir => { - ret.push(component.as_os_str()); - } - Component::CurDir => {} - Component::ParentDir => { - ret.pop(); - } - Component::Normal(c) => { - ret.push(c); - } - } - } - - ret - } - - // https://github.com/parcel-bundler/parcel/blob/e0b99c2a42e9109a9ecbd6f537844a1b33e7faf5/packages/utils/node-resolver-rs/src/path.rs#L37 - fn normalize_with>(&self, subpath: B) -> PathBuf { - let subpath = subpath.as_ref(); - - let mut components = subpath.components(); - - let Some(head) = components.next() else { return subpath.to_path_buf() }; - - if matches!(head, Component::Prefix(..) | Component::RootDir) { - return subpath.to_path_buf(); - } - - let mut ret = self.to_path_buf(); - for component in std::iter::once(head).chain(components) { - match component { - Component::CurDir => {} - Component::ParentDir => { - ret.pop(); - } - Component::Normal(c) => { - ret.push(c); - } - Component::Prefix(..) | Component::RootDir => { - unreachable!("Path {:?} Subpath {:?}", self, subpath) - } - } - } - - ret - } - - fn is_invalid_exports_target(&self) -> bool { - self.components().enumerate().any(|(index, c)| match c { - Component::ParentDir => true, - Component::CurDir => index > 0, - Component::Normal(c) => c.eq_ignore_ascii_case("node_modules"), - _ => false, - }) - } -} - -// https://github.com/webpack/enhanced-resolve/blob/main/test/path.test.js -#[test] -fn is_invalid_exports_target() { - let test_cases = [ - "../a.js", - "../", - "./a/b/../../../c.js", - "./a/b/../../../", - "./../../c.js", - "./../../", - "./a/../b/../../c.js", - "./a/../b/../../", - "./././../", - ]; - - for case in test_cases { - assert!(Path::new(case).is_invalid_exports_target(), "{case}"); - } - - assert!(!Path::new("C:").is_invalid_exports_target()); - assert!(!Path::new("/").is_invalid_exports_target()); -} - -#[test] -fn normalize() { - assert_eq!(Path::new("/foo/.././foo/").normalize(), Path::new("/foo")); - assert_eq!(Path::new("C://").normalize(), Path::new("C://")); - assert_eq!(Path::new("C:").normalize(), Path::new("C:")); - assert_eq!(Path::new(r"\\server\share").normalize(), Path::new(r"\\server\share")); -} diff --git a/src/resolution.rs b/src/resolution.rs deleted file mode 100644 index a3aaa2e7..00000000 --- a/src/resolution.rs +++ /dev/null @@ -1,92 +0,0 @@ -use crate::package_json::PackageJson; -use std::{ - fmt, - path::{Path, PathBuf}, - sync::Arc, -}; - -/// The final path resolution with optional `?query` and `#fragment` -#[derive(Clone)] -pub struct Resolution { - pub(crate) path: PathBuf, - - /// path query `?query`, contains `?`. - pub(crate) query: Option, - - /// path fragment `#query`, contains `#`. - pub(crate) fragment: Option, - - pub(crate) package_json: Option>, -} - -impl fmt::Debug for Resolution { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - f.debug_struct("Resolution") - .field("path", &self.path) - .field("query", &self.query) - .field("fragment", &self.fragment) - .field("package_json", &self.package_json.as_ref().map(|p| &p.path)) - .finish() - } -} - -impl PartialEq for Resolution { - fn eq(&self, other: &Self) -> bool { - self.path == other.path && self.query == other.query && self.fragment == other.fragment - } -} -impl Eq for Resolution {} - -impl Resolution { - /// Returns the path without query and fragment - pub fn path(&self) -> &Path { - &self.path - } - - /// Returns the path without query and fragment - pub fn into_path_buf(self) -> PathBuf { - self.path - } - - /// Returns the path query `?query`, contains the leading `?` - pub fn query(&self) -> Option<&str> { - self.query.as_deref() - } - - /// Returns the path fragment `#fragment`, contains the leading `#` - pub fn fragment(&self) -> Option<&str> { - self.fragment.as_deref() - } - - /// Returns serialized package_json - pub fn package_json(&self) -> Option<&Arc> { - self.package_json.as_ref() - } - - /// Returns the full path with query and fragment - pub fn full_path(&self) -> PathBuf { - let mut path = self.path.clone().into_os_string(); - if let Some(query) = &self.query { - path.push(query); - } - if let Some(fragment) = &self.fragment { - path.push(fragment); - } - PathBuf::from(path) - } -} - -#[test] -fn test() { - let resolution = Resolution { - path: PathBuf::from("foo"), - query: Some("?query".to_string()), - fragment: Some("#fragment".to_string()), - package_json: None, - }; - assert_eq!(resolution.path(), Path::new("foo")); - assert_eq!(resolution.query(), Some("?query")); - assert_eq!(resolution.fragment(), Some("#fragment")); - assert_eq!(resolution.full_path(), PathBuf::from("foo?query#fragment")); - assert_eq!(resolution.into_path_buf(), PathBuf::from("foo")); -} diff --git a/src/specifier.rs b/src/specifier.rs deleted file mode 100644 index 3d35eafc..00000000 --- a/src/specifier.rs +++ /dev/null @@ -1,230 +0,0 @@ -use crate::error::SpecifierError; -use std::borrow::Cow; - -#[derive(Debug)] -pub struct Specifier<'a> { - path: Cow<'a, str>, - pub query: Option<&'a str>, - pub fragment: Option<&'a str>, -} - -impl<'a> Specifier<'a> { - pub fn path(&'a self) -> &'a str { - self.path.as_ref() - } - - pub fn parse(specifier: &'a str) -> Result, SpecifierError> { - if specifier.is_empty() { - return Err(SpecifierError::Empty(specifier.to_string())); - } - let offset = match specifier.as_bytes()[0] { - b'/' | b'.' | b'#' => 1, - _ => 0, - }; - let (path, query, fragment) = Self::parse_query_framgment(specifier, offset); - if path.is_empty() { - return Err(SpecifierError::Empty(specifier.to_string())); - } - Ok(Self { path, query, fragment }) - } - - fn parse_query_framgment( - specifier: &'a str, - skip: usize, - ) -> (Cow<'a, str>, Option<&str>, Option<&str>) { - let mut query_start: Option = None; - let mut fragment_start: Option = None; - - let mut prev = specifier.chars().next().unwrap(); - let mut escaped_indexes = vec![]; - for (i, c) in specifier.char_indices().skip(skip) { - if c == '?' && query_start.is_none() { - query_start = Some(i); - } - if c == '#' { - if prev == '\0' { - escaped_indexes.push(i - 1); - } else { - fragment_start = Some(i); - break; - } - } - prev = c; - } - - let (path, query, fragment) = match (query_start, fragment_start) { - (Some(i), Some(j)) => { - debug_assert!(i < j); - (&specifier[..i], Some(&specifier[i..j]), Some(&specifier[j..])) - } - (Some(i), None) => (&specifier[..i], Some(&specifier[i..]), None), - (None, Some(j)) => (&specifier[..j], None, Some(&specifier[j..])), - _ => (specifier, None, None), - }; - - let path = if escaped_indexes.is_empty() { - Cow::Borrowed(path) - } else { - // Remove the `\0` characters for a legal path. - Cow::Owned( - path.chars() - .enumerate() - .filter_map(|(i, c)| (!escaped_indexes.contains(&i)).then_some(c)) - .collect::(), - ) - }; - - (path, query, fragment) - } -} - -#[cfg(test)] -mod tests { - use super::{Specifier, SpecifierError}; - - #[test] - fn debug() { - let specifier = Specifier::parse("/").unwrap(); - assert_eq!( - format!("{specifier:?}"), - r#"Specifier { path: "/", query: None, fragment: None }"# - ); - } - - #[test] - fn empty() { - let specifiers = ["", "?"]; - for specifier in specifiers { - let error = Specifier::parse(specifier).unwrap_err(); - assert_eq!(error, SpecifierError::Empty(specifier.to_string())); - } - } - - #[test] - fn absolute() -> Result<(), SpecifierError> { - let specifier = "/test?#"; - let parsed = Specifier::parse(specifier)?; - assert_eq!(parsed.path, "/test"); - assert_eq!(parsed.query, Some("?")); - assert_eq!(parsed.fragment, Some("#")); - Ok(()) - } - - #[test] - fn relative() -> Result<(), SpecifierError> { - let specifiers = ["./test", "../test", "../../test"]; - for specifier in specifiers { - let mut r = specifier.to_string(); - r.push_str("?#"); - let parsed = Specifier::parse(&r)?; - assert_eq!(parsed.path, specifier); - assert_eq!(parsed.query, Some("?")); - assert_eq!(parsed.fragment, Some("#")); - } - Ok(()) - } - - #[test] - fn hash() -> Result<(), SpecifierError> { - let specifiers = ["#", "#path"]; - for specifier in specifiers { - let mut r = specifier.to_string(); - r.push_str("?#"); - let parsed = Specifier::parse(&r)?; - assert_eq!(parsed.path, specifier); - assert_eq!(parsed.query, Some("?")); - assert_eq!(parsed.fragment, Some("#")); - } - Ok(()) - } - - #[test] - fn module() -> Result<(), SpecifierError> { - let specifiers = ["module"]; - for specifier in specifiers { - let mut r = specifier.to_string(); - r.push_str("?#"); - let parsed = Specifier::parse(&r)?; - assert_eq!(parsed.path, specifier); - assert_eq!(parsed.query, Some("?")); - assert_eq!(parsed.fragment, Some("#")); - } - Ok(()) - } - - #[test] - fn query_fragment() -> Result<(), SpecifierError> { - let data = [ - ("a?", Some("?"), None), - ("a?query", Some("?query"), None), - ("a?query1?query2", Some("?query1?query2"), None), - ("a?query1?query2?query3", Some("?query1?query2?query3"), None), - ("a#", None, Some("#")), - ("a#b#c", None, Some("#b#c")), - ("a#fragment", None, Some("#fragment")), - ("a?#", Some("?"), Some("#")), - ("a?#fragment", Some("?"), Some("#fragment")), - ("a?query#", Some("?query"), Some("#")), - ("a?query#fragment", Some("?query"), Some("#fragment")), - ("a#fragment?", None, Some("#fragment?")), - ("a#fragment?query", None, Some("#fragment?query")), - ]; - - for (specifier_str, query, fragment) in data { - let specifier = Specifier::parse(specifier_str)?; - assert_eq!(specifier.path, "a", "{specifier_str}"); - assert_eq!(specifier.query, query, "{specifier_str}"); - assert_eq!(specifier.fragment, fragment, "{specifier_str}"); - } - - Ok(()) - } - - #[test] - // https://github.com/webpack/enhanced-resolve/blob/main/test/identifier.test.js - fn enhanced_resolve_edge_cases() -> Result<(), SpecifierError> { - let data = [ - ("path/#", "path/", "", "#"), - ("path/as/?", "path/as/", "?", ""), - ("path/#/?", "path/", "", "#/?"), - ("path/#repo#hash", "path/", "", "#repo#hash"), - ("path/#r#hash", "path/", "", "#r#hash"), - ("path/#repo/#repo2#hash", "path/", "", "#repo/#repo2#hash"), - ("path/#r/#r#hash", "path/", "", "#r/#r#hash"), - ("path/#/not/a/hash?not-a-query", "path/", "", "#/not/a/hash?not-a-query"), - ]; - - for (specifier_str, path, query, fragment) in data { - let specifier = Specifier::parse(specifier_str)?; - assert_eq!(specifier.path, path, "{specifier_str}"); - assert_eq!(specifier.query.unwrap_or(""), query, "{specifier_str}"); - assert_eq!(specifier.fragment.unwrap_or(""), fragment, "{specifier_str}"); - } - - Ok(()) - } - - // https://github.com/webpack/enhanced-resolve/blob/main/test/identifier.test.js - #[test] - fn enhanced_resolve_windows_like() -> Result<(), SpecifierError> { - let data = [ - ("path\\#", "path\\", "", "#"), - ("path\\as\\?", "path\\as\\", "?", ""), - ("path\\#\\?", "path\\", "", "#\\?"), - ("path\\#repo#hash", "path\\", "", "#repo#hash"), - ("path\\#r#hash", "path\\", "", "#r#hash"), - ("path\\#repo\\#repo2#hash", "path\\", "", "#repo\\#repo2#hash"), - ("path\\#r\\#r#hash", "path\\", "", "#r\\#r#hash"), - ("path\\#/not/a/hash?not-a-query", "path\\", "", "#/not/a/hash?not-a-query"), - ]; - - for (specifier_str, path, query, fragment) in data { - let specifier = Specifier::parse(specifier_str)?; - assert_eq!(specifier.path, path, "{specifier_str}"); - assert_eq!(specifier.query.unwrap_or(""), query, "{specifier_str}"); - assert_eq!(specifier.fragment.unwrap_or(""), fragment, "{specifier_str}"); - } - - Ok(()) - } -} diff --git a/src/tests/alias.rs b/src/tests/alias.rs deleted file mode 100644 index 07c615f4..00000000 --- a/src/tests/alias.rs +++ /dev/null @@ -1,280 +0,0 @@ -//! - -use normalize_path::NormalizePath; -use std::path::Path; - -use crate::{AliasValue, Resolution, ResolveContext, ResolveError, ResolveOptions, Resolver}; - -#[test] -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -fn alias() { - use super::memory_fs::MemoryFS; - use crate::ResolverGeneric; - use std::path::{Path, PathBuf}; - - let f = Path::new("/"); - - let file_system = MemoryFS::new(&[ - ("/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", ""), - ("/dashed-name", ""), - ]); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - alias: vec![ - ("aliasA".into(), vec![AliasValue::from("a")]), - ("b$".into(), vec![AliasValue::from("a/index")]), - ("c$".into(), vec![AliasValue::from("/a/index")]), - ( - "multiAlias".into(), - vec![ - AliasValue::from("b"), - AliasValue::from("c"), - AliasValue::from("d"), - AliasValue::from("e"), - AliasValue::from("a"), - ], - ), - ("recursive".into(), vec![AliasValue::from("recursive/dir")]), - ("/d/dir".into(), vec![AliasValue::from("/c/dir")]), - ("/d/index.js".into(), vec![AliasValue::from("/c/index")]), - ("#".into(), vec![AliasValue::from("/c/dir")]), - ("@".into(), vec![AliasValue::from("/c/dir")]), - ("ignored".into(), vec![AliasValue::Ignore]), - // not part of enhanced-resolve, added to make sure query in alias value works - ("alias_query".into(), vec![AliasValue::from("a?query_after")]), - ("alias_fragment".into(), vec![AliasValue::from("a#fragment_after")]), - ("dash".into(), vec![AliasValue::Ignore]), - ("@scope/package-name/file$".into(), vec![AliasValue::from("/c/dir")]), - ], - modules: vec!["/".into()], - ..ResolveOptions::default() - }, - ); - - #[rustfmt::skip] - let pass = [ - ("should resolve a not aliased module 1", "a", "/a/index"), - ("should resolve a not aliased module 2", "a/index", "/a/index"), - ("should resolve a not aliased module 3", "a/dir", "/a/dir/index"), - ("should resolve a not aliased module 4", "a/dir/index", "/a/dir/index"), - ("should resolve an aliased module 1", "aliasA", "/a/index"), - ("should resolve an aliased module 2", "aliasA/index", "/a/index"), - ("should resolve an aliased module 3", "aliasA/dir", "/a/dir/index"), - ("should resolve an aliased module 4", "aliasA/dir/index", "/a/dir/index"), - ("should resolve '#' alias 1", "#", "/c/dir/index"), - ("should resolve '#' alias 2", "#/index", "/c/dir/index"), - ("should resolve '@' alias 1", "@", "/c/dir/index"), - ("should resolve '@' alias 2", "@/index", "/c/dir/index"), - ("should resolve a recursive aliased module 1", "recursive", "/recursive/dir/index"), - ("should resolve a recursive aliased module 2", "recursive/index", "/recursive/dir/index"), - ("should resolve a recursive aliased module 3", "recursive/dir", "/recursive/dir/index"), - ("should resolve a recursive aliased module 4", "recursive/dir/index", "/recursive/dir/index"), - ("should resolve a file aliased module 1", "b", "/a/index"), - ("should resolve a file aliased module 2", "c", "/a/index"), - ("should resolve a file aliased module with a query 1", "b?query", "/a/index?query"), - ("should resolve a file aliased module with a query 2", "c?query", "/a/index?query"), - ("should resolve a path in a file aliased module 1", "b/index", "/b/index"), - ("should resolve a path in a file aliased module 2", "b/dir", "/b/dir/index"), - ("should resolve a path in a file aliased module 3", "b/dir/index", "/b/dir/index"), - ("should resolve a path in a file aliased module 4", "c/index", "/c/index"), - ("should resolve a path in a file aliased module 5", "c/dir", "/c/dir/index"), - ("should resolve a path in a file aliased module 6", "c/dir/index", "/c/dir/index"), - ("should resolve a file aliased file 1", "d", "/c/index"), - ("should resolve a file aliased file 2", "d/dir/index", "/c/dir/index"), - ("should resolve a file in multiple aliased dirs 1", "multiAlias/dir/file", "/e/dir/file"), - ("should resolve a file in multiple aliased dirs 2", "multiAlias/anotherDir", "/e/anotherDir/index"), - // not part of enhanced-resolve, added to make sure query in alias value works - ("should resolve query in alias value", "alias_query?query_before", "/a/index?query_after"), - ("should resolve query in alias value", "alias_fragment#fragment_before", "/a/index#fragment_after"), - ("should resolve dashed name", "dashed-name", "/dashed-name"), - ("should resolve scoped package name with sub dir", "@scope/package-name/file", "/c/dir/index"), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - - #[rustfmt::skip] - let ignore = [ - ("should resolve an ignore module", "ignored", ResolveError::Ignored(f.join("ignored"))) - ]; - - for (comment, request, expected) in ignore { - let resolution = resolver.resolve(f, request); - assert_eq!(resolution, Err(expected), "{comment} {request}"); - } -} - -// Not part of enhanced-resolve -#[test] -fn infinite_recursion() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![ - ("./a".into(), vec![AliasValue::from("./b")]), - ("./b".into(), vec![AliasValue::from("./a")]), - ], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(f, "./a"); - assert_eq!(resolution, Err(ResolveError::Recursion)); -} - -fn check_slash(path: &Path) { - let s = path.to_string_lossy().to_string(); - #[cfg(target_os = "windows")] - { - assert!(!s.contains('/'), "{s}"); - assert!(s.contains('\\'), "{s}"); - } - #[cfg(not(target_os = "windows"))] - { - assert!(s.contains('/'), "{s}"); - assert!(!s.contains('\\'), "{s}"); - } -} - -#[test] -fn absolute_path() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![(f.join("foo").to_str().unwrap().to_string(), vec![AliasValue::Ignore])], - modules: vec![f.clone().to_str().unwrap().to_string()], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(&f, "foo/index"); - assert_eq!(resolution, Err(ResolveError::Ignored(f.join("foo")))); -} - -#[test] -fn system_path() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![("@app".into(), vec![AliasValue::from(f.join("alias").to_string_lossy())])], - ..ResolveOptions::default() - }); - - let specifiers = ["@app/files/a", "@app/files/a.js"]; - - for specifier in specifiers { - let path = resolver.resolve(&f, specifier).map(Resolution::into_path_buf).unwrap(); - assert_eq!(path, f.join("alias/files/a.js")); - check_slash(&path); - } -} - -#[test] -fn alias_is_full_path() { - let f = super::fixture(); - let dir = f.join("foo"); - let dir_str = dir.to_string_lossy().to_string(); - - let resolver = Resolver::new(ResolveOptions { - alias: vec![("@".into(), vec![AliasValue::Path(dir_str.clone())])], - ..ResolveOptions::default() - }); - - let mut ctx = ResolveContext::default(); - - let specifiers = [ - "@/index".to_string(), - "@/index.js".to_string(), - // specifier has multiple `/` for reasons we'll never know - "@////index".to_string(), - // specifier is a full path - dir_str, - ]; - - for specifier in specifiers { - let resolution = resolver.resolve_with_context(&f, &specifier, &mut ctx); - assert_eq!(resolution.map(|r| r.full_path()), Ok(dir.join("index.js"))); - } - - for path in ctx.file_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - check_slash(&path); - } - - for path in ctx.missing_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - check_slash(&path); - if let Some(path) = path.parent() { - assert!(!path.is_file(), "{path:?} must not be a file"); - } - } -} - -// For the `should_stop` variable in `load_alias` -#[test] -fn all_alias_values_are_not_found() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![( - "m1".to_string(), - vec![AliasValue::Path(f.join("node_modules").join("m2").to_string_lossy().to_string())], - )], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(&f, "m1/a.js"); - assert_eq!(resolution, Err(ResolveError::NotFound("m1/a.js".to_string()))); -} - -#[test] -fn alias_fragment() { - let f = super::fixture(); - - let data = [ - // enhanced-resolve has `#` prepended with a `\0`, they are removed from the - // following 3 expected test results. - // See https://github.com/webpack/enhanced-resolve#escaping - ( - "handle fragment edge case (no fragment)", - "./no#fragment/#/#", - f.join("no#fragment/#/#.js"), - ), - ("handle fragment edge case (fragment)", "./no#fragment/#/", f.join("no.js#fragment/#/")), - ( - "handle fragment escaping", - "./no\0#fragment/\0#/\0##fragment", - f.join("no#fragment/#/#.js#fragment"), - ), - ]; - - for (comment, request, expected) in data { - let resolver = Resolver::new(ResolveOptions { - alias: vec![("foo".to_string(), vec![AliasValue::Path(request.to_string())])], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f, "foo").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } -} - -#[test] -fn alias_try_fragment_as_path() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![( - "#".to_string(), - vec![AliasValue::Path(f.join("#").to_string_lossy().to_string())], - )], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(&f, "#/a").map(|r| r.full_path()); - assert_eq!(resolution, Ok(f.join("#").join("a.js"))); -} diff --git a/src/tests/browser_field.rs b/src/tests/browser_field.rs deleted file mode 100644 index 171ee099..00000000 --- a/src/tests/browser_field.rs +++ /dev/null @@ -1,189 +0,0 @@ -//! - -use crate::{AliasValue, ResolveError, ResolveOptions, Resolver}; - -#[test] -fn ignore() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![ - vec!["browser".into()], - vec!["innerBrowser1".into()], - vec!["innerBrowser2".into()], - vec![], - ], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - (f.clone(), "./lib/ignore", f.join("lib/ignore.js")), - (f.clone(), "./lib/ignore.js", f.join("lib/ignore.js")), - (f.join("lib"), "./ignore", f.join("lib/ignore.js")), - (f.join("lib"), "./ignore.js", f.join("lib/ignore.js")), - ]; - - for (path, request, expected) in data { - let resolution = resolver.resolve(&path, request); - let expected = ResolveError::Ignored(expected); - assert_eq!(resolution, Err(expected), "{path:?} {request}"); - } -} - -#[test] -fn shared_resolvers() { - let f = super::fixture().join("browser-module"); - - let resolver1 = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["innerBrowser1".into(), "field".into(), "browser".into()]], - ..ResolveOptions::default() - }); - let resolved_path = resolver1.resolve(&f, "./lib/main1.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("lib/main.js"))); - - let resolver2 = resolver1.clone_with_options(ResolveOptions { - alias_fields: vec![vec!["innerBrowser2".into(), "browser".into()]], - ..ResolveOptions::default() - }); - let resolved_path = resolver2.resolve(&f, "./lib/main2.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("./lib/replaced.js"))); -} - -#[test] -fn replace_file() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![ - vec!["browser".into()], - vec!["innerBrowser1".into(), "field2".into(), "browser".into()], // not presented - vec!["innerBrowser1".into(), "field".into(), "browser".into()], - vec!["innerBrowser2".into(), "browser".into()], - ], - // Not part of enhanced-resolve. Added to make sure no interaction between these two fields. - main_fields: vec!["browser".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - ("should replace a file 1", f.clone(), "./lib/replaced", f.join("lib/browser.js")), - ("should replace a file 2", f.clone(), "./lib/replaced.js", f.join("lib/browser.js")), - ("should replace a file 3", f.join("lib"), "./replaced", f.join("lib/browser.js")), - ("should replace a file 4", f.join("lib"), "./replaced.js", f.join("lib/browser.js")), - ("should replace a module with a file 1", f.clone(), "module-a", f.join("browser/module-a.js")), - ("should replace a module with a file 2", f.join("lib"), "module-a", f.join("browser/module-a.js")), - ("should replace a module with a module 1", f.clone(), "module-b", f.join("node_modules/module-c.js")), - ("should replace a module with a module 2", f.join("lib"), "module-b", f.join("node_modules/module-c.js")), - ("should resolve in nested property 1", f.clone(), "./lib/main1.js", f.join("lib/main.js")), - ("should resolve in nested property 2", f.clone(), "./lib/main2.js", f.join("lib/browser.js")), - ("should check only alias field properties", f.clone(), "./toString", f.join("lib/toString.js")), - // not part of enhanced-resolve - ("recursion", f.clone(), "module-c", f.join("node_modules/module-c.js")), - ("resolve self 1", f.clone(), "./lib/main.js", f.join("lib/main.js")), - ("resolve self 2", f.clone(), "./main.js", f.join("lib/main.js")), - ]; - - for (comment, path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn recurse_fail() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - ("recurse non existent", f.clone(), "./lib/non-existent.js", ResolveError::NotFound("./lib/non-existent.js".into())), - ("path partial match 1", f.clone(), "./xyz.js", ResolveError::NotFound("./xyz.js".into())), - ("path partial match 2", f, "./lib/xyz.js", ResolveError::NotFound("./lib/xyz.js".into())), - ]; - - for (comment, path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Err(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn broken() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - // The browser field string value should be ignored - (f.clone(), "browser-module-broken", Ok(f.join("node_modules/browser-module-broken/main.js"))), - (f.join("browser-module"), "./number", Err(ResolveError::NotFound("./number".into()))), - ]; - - for (path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, expected, "{path:?} {request}"); - } -} - -#[test] -fn crypto_js() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - fallback: vec![( - "crypto".into(), - vec![AliasValue::from(f.join("lib.js").to_string_lossy())], - )], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(f.join("crypto-js"), "crypto").map(|r| r.full_path()); - assert_eq!(resolved_path, Err(ResolveError::Ignored(f.join("crypto-js")))); -} - -// https://github.com/webpack/webpack/blob/87660921808566ef3b8796f8df61bd79fc026108/test/cases/resolving/browser-field/index.js#L40-L43 -#[test] -fn recursive() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - let data = [ - ("should handle recursive file 1", f.clone(), "recursive-file/a"), - ("should handle recursive file 2", f.clone(), "recursive-file/b"), - ("should handle recursive file 3", f.clone(), "recursive-file/c"), - ("should handle recursive file 4", f, "recursive-file/d"), - ]; - - for (comment, path, request) in data { - let resolved_path = resolver.resolve(&path, request); - assert_eq!(resolved_path, Err(ResolveError::Recursion), "{comment} {path:?} {request}"); - } -} - -#[test] -fn with_query() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "./foo").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("lib").join("browser.js?query"))); -} diff --git a/src/tests/builtins.rs b/src/tests/builtins.rs deleted file mode 100644 index 5d6d14d9..00000000 --- a/src/tests/builtins.rs +++ /dev/null @@ -1,121 +0,0 @@ -use std::path::Path; - -use crate::{ResolveError, ResolveOptions, Resolver}; - -#[test] -fn builtins_off() { - let f = Path::new("/"); - let resolver = Resolver::default(); - let resolved_path = resolver.resolve(f, "zlib").map(|r| r.full_path()); - assert_eq!(resolved_path, Err(ResolveError::NotFound("zlib".into()))); -} - -#[test] -fn builtins() { - let f = Path::new("/"); - - let resolver = Resolver::new(ResolveOptions::default().with_builtin_modules(true)); - - let pass = [ - "_http_agent", - "_http_client", - "_http_common", - "_http_incoming", - "_http_outgoing", - "_http_server", - "_stream_duplex", - "_stream_passthrough", - "_stream_readable", - "_stream_transform", - "_stream_wrap", - "_stream_writable", - "_tls_common", - "_tls_wrap", - "assert", - "assert/strict", - "async_hooks", - "buffer", - "child_process", - "cluster", - "console", - "constants", - "crypto", - "dgram", - "diagnostics_channel", - "dns", - "dns/promises", - "domain", - "events", - "fs", - "fs/promises", - "http", - "http2", - "https", - "inspector", - "module", - "net", - "os", - "path", - "path/posix", - "path/win32", - "perf_hooks", - "process", - "punycode", - "querystring", - "readline", - "repl", - "stream", - "stream/consumers", - "stream/promises", - "stream/web", - "string_decoder", - "sys", - "timers", - "timers/promises", - "tls", - "trace_events", - "tty", - "url", - "util", - "util/types", - "v8", - "vm", - "worker_threads", - "zlib", - ]; - - for request in pass { - let prefixed_request = format!("node:{request}"); - for request in [prefixed_request.clone(), request.to_string()] { - let resolved_path = resolver.resolve(f, &request).map(|r| r.full_path()); - let err = ResolveError::Builtin(prefixed_request.clone()); - assert_eq!(resolved_path, Err(err), "{request}"); - } - } -} - -#[test] -fn fail() { - let f = Path::new("/"); - let resolver = Resolver::new(ResolveOptions::default().with_builtin_modules(true)); - let request = "xxx"; - let resolved_path = resolver.resolve(f, request); - let err = ResolveError::NotFound(request.to_string()); - assert_eq!(resolved_path, Err(err), "{request}"); -} - -#[test] -fn imports() { - let f = super::fixture().join("builtins"); - let resolver = Resolver::new(ResolveOptions { - builtin_modules: true, - condition_names: vec!["node".into()], - ..ResolveOptions::default() - }); - - for request in ["#fs", "#http"] { - let resolved_path = resolver.resolve(f.clone(), request).map(|r| r.full_path()); - let err = ResolveError::Builtin(format!("node:{}", request.trim_start_matches('#'))); - assert_eq!(resolved_path, Err(err)); - } -} diff --git a/src/tests/dependencies.rs b/src/tests/dependencies.rs deleted file mode 100644 index bcc2355b..00000000 --- a/src/tests/dependencies.rs +++ /dev/null @@ -1,110 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/dependencies.test.js - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows { - use rustc_hash::FxHashSet; - use std::path::PathBuf; - - use crate::{ResolveContext, ResolveOptions, ResolverGeneric}; - - use super::super::memory_fs::MemoryFS; - - fn file_system() -> MemoryFS { - MemoryFS::new(&[ - ("/a/b/node_modules/some-module/index.js", ""), - ("/a/node_modules/module/package.json", r#"{"main":"entry.js"}"#), - ("/a/node_modules/module/file.js", r#"{"main":"entry.js"}"#), - ("/modules/other-module/file.js", ""), - ]) - } - - #[test] - fn test() { - let file_system = file_system(); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - extensions: vec![".json".into(), ".js".into()], - modules: vec!["/modules".into(), "node_modules".into()], - ..ResolveOptions::default() - }, - ); - - let data = [ - ( - "middle module request", - "/a/b/c", - "module/file", - "/a/node_modules/module/file.js", - // These dependencies are different from enhanced-resolve due to different code path to - // querying the file system - vec![ - // 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", - // "/", - ], - vec![ - // missing package.jsons - // "/a/b/c/package.json", - "/a/b/package.json", - "/a/package.json", - "/package.json", - // missing modules directories - "/a/b/c", - // "/a/b/c/node_modules", - // missing single file modules - "/modules/module", - "/a/b/node_modules/module", - // missing files with alternative extensions - "/a/node_modules/module/file", - "/a/node_modules/module/file.json", - ], - ), - ( - "fast found module", - "/a/b/c", - "other-module/file.js", - "/modules/other-module/file.js", - // These dependencies are different from enhanced-resolve due to different code path to - // querying the file system - vec![ - // symlink checks - "/modules/other-module/file.js", - // "/modules/other-module", - // "/modules", - // "/", - ], - vec![ - // missing package.jsons - // "/a/b/c/package.json", - "/a/b/c", - "/a/b/package.json", - "/a/package.json", - "/package.json", - "/modules/other-module/package.json", - "/modules/package.json", - ], - ), - ]; - - for (name, context, request, result, file_dependencies, missing_dependencies) in data { - let mut ctx = ResolveContext::default(); - let path = PathBuf::from(context); - let resolved = - resolver.resolve_with_context(path, request, &mut ctx).map(|r| r.full_path()); - assert_eq!(resolved, Ok(PathBuf::from(result))); - let file_dependencies = - FxHashSet::from_iter(file_dependencies.iter().map(PathBuf::from)); - let missing_dependencies = - FxHashSet::from_iter(missing_dependencies.iter().map(PathBuf::from)); - assert_eq!(ctx.file_dependencies, file_dependencies, "{name}"); - assert_eq!(ctx.missing_dependencies, missing_dependencies, "{name}"); - } - } -} diff --git a/src/tests/exports_field.rs b/src/tests/exports_field.rs deleted file mode 100644 index fd68c1f7..00000000 --- a/src/tests/exports_field.rs +++ /dev/null @@ -1,2546 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/exportsField.test.js -//! -//! The huge exports field test cases are at the bottom of this file. - -use crate::{Ctx, PathUtil, ResolveError, ResolveOptions, Resolver}; -use serde_json::json; -use std::path::Path; - -#[test] -fn test_simple() { - let f = super::fixture().join("exports-field"); - let f2 = super::fixture().join("exports-field2"); - let f4 = super::fixture().join("exports-field-error"); - let f5 = super::fixture().join("imports-exports-wildcard"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - fully_specified: true, - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("resolve root using exports field, not a main field", f.clone(), "exports-field", f.join("node_modules/exports-field/x.js")), - ("resolver should respect condition names", f.clone(), "exports-field/dist/main.js", f.join("node_modules/exports-field/lib/lib2/main.js")), - // enhanced_resolve behaves differently to node.js. enhanced_resolve fallbacks when an - // array item is unresolved, where as node.js fallbacks when an array has an - // InvalidPackageTarget error. - // ("resolver should respect fallback", f2.clone(), "exports-field/dist/browser.js", f2.join("node_modules/exports-field/lib/browser.js")), - // The following two tests require fallback from array values, the path is changed here to - // only test query and fragment. - ("resolver should respect query parameters #1", f2.clone(), "exports-field/dist/main.js?foo", f2.join("node_modules/exports-field/lib/lib2/main.js?foo")), - ("resolver should respect fragment parameters #1", f2.clone(), "exports-field/dist/main.js#foo", f2.join("node_modules/exports-field/lib/lib2/main.js#foo")), - ("relative path should work, if relative path as request is used", f.clone(), "./node_modules/exports-field/lib/main.js", f.join("node_modules/exports-field/lib/main.js")), - ("self-resolving root", f.clone(), "@exports-field/core", f.join("a.js")), - ("should resolve with wildcard pattern #1", f5.clone(), "m/features/f.js", f5.join("node_modules/m/src/features/f.js")), - ("should resolve with wildcard pattern #2", f5.clone(), "m/features/y/y.js", f5.join("node_modules/m/src/features/y/y.js")), - ("should resolve with wildcard pattern #3", f5.clone(), "m/features-no-ext/y/y.js", f5.join("node_modules/m/src/features/y/y.js")), - ("should resolve with wildcard pattern #4", f5.clone(), "m/middle/nested/f.js", f5.join("node_modules/m/src/middle/nested/f.js")), - ("should resolve with wildcard pattern #5", f5.clone(), "m/middle-1/nested/f.js", f5.join("node_modules/m/src/middle-1/nested/f.js")), - ("should resolve with wildcard pattern #6", f5.clone(), "m/middle-2/nested/f.js", f5.join("node_modules/m/src/middle-2/nested/f.js")), - ("should resolve with wildcard pattern #7", f5.clone(), "m/middle-3/nested/f", f5.join("node_modules/m/src/middle-3/nested/f/nested/f.js")), - ("should resolve with wildcard pattern #8", f5.clone(), "m/middle-4/f/nested", f5.join("node_modules/m/src/middle-4/f/f.js")), - ("should resolve with wildcard pattern #9", f5.clone(), "m/middle-5/f$/$", f5.join("node_modules/m/src/middle-5/f$/$.js")), - ]; - - // Not needed or snapshot: - // * should log the correct info - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } - - let p = f.join("node_modules/exports-field/package.json"); - let p2 = f2.join("node_modules/exports-field/package.json"); - let p4 = f4.join("node_modules/exports-field/package.json"); - let p5 = f5.join("node_modules/m/package.json"); - - #[rustfmt::skip] - let fail = [ - // ("throw error if extension not provided", f2.clone(), "exports-field/dist/main", ResolveError::NotFound(f2.join("node_modules/exports-field/lib/lib2/main"))), - ("resolver should respect query parameters #2. Direct matching", f2.clone(), "exports-field?foo", ResolveError::PackagePathNotExported("./?foo".into(), p2.clone())), - ("resolver should respect fragment parameters #2. Direct matching", f2, "exports-field#foo", ResolveError::PackagePathNotExported("./#foo".into(), p2)), - ("relative path should not work with exports field", f.clone(), "./node_modules/exports-field/dist/main.js", ResolveError::NotFound("./node_modules/exports-field/dist/main.js".into())), - ("backtracking should not work for request", f.clone(), "exports-field/dist/../../../a.js", ResolveError::InvalidPackageTarget("./lib/../../../a.js".to_string(), "./dist/".to_string(), p.clone())), - ("backtracking should not work for exports field target", f.clone(), "exports-field/dist/a.js", ResolveError::InvalidPackageTarget("./../../a.js".to_string(), "./dist/a.js".to_string(), p.clone())), - ("not exported error", f.clone(), "exports-field/anything/else", ResolveError::PackagePathNotExported("./anything/else".to_string(), p.clone())), - ("request ending with slash #1", f.clone(), "exports-field/", ResolveError::PackagePathNotExported("./".to_string(), p.clone())), - ("request ending with slash #2", f.clone(), "exports-field/dist/", ResolveError::PackagePathNotExported("./dist/".to_string(), p.clone())), - ("request ending with slash #3", f.clone(), "exports-field/lib/", ResolveError::PackagePathNotExported("./lib/".to_string(), p)), - ("should throw error if target is invalid", f4, "exports-field", ResolveError::InvalidPackageTarget("./a/../b/../../pack1/index.js".to_string(), ".".to_string(), p4)), - ("throw error if exports field is invalid", f.clone(), "invalid-exports-field", ResolveError::InvalidPackageConfig(f.join("node_modules/invalid-exports-field/package.json"))), - ("should throw error if target is 'null'", f5, "m/features/internal/file.js", ResolveError::PackagePathNotExported("./features/internal/file.js".to_string(), p5)), - ]; - - for (comment, path, request, error) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!(resolution, Err(error), "{comment} {path:?} {request}"); - } -} - -// resolve using exports field, not a browser field #1 -#[test] -fn exports_not_browser_field1() { - let f = super::fixture().join("exports-field"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - condition_names: vec!["webpack".into()], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "exports-field/dist/main.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("node_modules/exports-field/lib/lib2/main.js"))); -} - -// resolve using exports field and a browser alias field #2 -#[test] -fn exports_not_browser_field2() { - let f2 = super::fixture().join("exports-field2"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - extensions: vec![".js".into()], - condition_names: vec!["node".into()], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f2, "exports-field/dist/main.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f2.join("node_modules/exports-field/lib/browser.js"))); -} - -// should resolve extension without fullySpecified -#[test] -fn extension_without_fully_specified() { - let f2 = super::fixture().join("exports-field2"); - - let commonjs_resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - let resolved_path = - commonjs_resolver.resolve(&f2, "exports-field/dist/main").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f2.join("node_modules/exports-field/lib/lib2/main.js"))); -} - -#[test] -fn field_name_path() { - let f2 = super::fixture().join("exports-field2"); - let f3 = super::fixture().join("exports-field3"); - - // field name path #1 #2 #3 - let exports_fields = [ - vec![vec!["exportsField".into(), "exports".into()]], - vec![vec!["exportsField".into(), "exports".into()], vec!["exports".into()]], - vec![vec!["exports".into()], vec!["exportsField".into(), "exports".into()]], - ]; - - for exports_fields in exports_fields { - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - exports_fields, - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/main.js"))); - } - - // field name path #4 - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - exports_fields: vec![vec!["exports".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f2, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f2.join("node_modules/exports-field/index.js"))); - - // field name path #5 - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - exports_fields: vec![vec!["ex".into()], vec!["exports_field".into(), "exports".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/index"))); - - // non-compliant export targeting a directory - let resolver = Resolver::new(ResolveOptions { - exports_fields: vec![vec!["broken".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/src/index.js"))); -} - -#[test] -fn shared_resolvers() { - let f3 = super::fixture().join("exports-field3"); - - let resolver1 = Resolver::new(ResolveOptions { - exports_fields: vec![vec!["exportsField".into(), "exports".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver1.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/main.js"))); - - let resolver2 = resolver1.clone_with_options(ResolveOptions { - exports_fields: vec![vec!["ex".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver2.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/index"))); -} - -#[test] -fn extension_alias_1_2() { - let f = super::fixture().join("exports-field-and-extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - extension_alias: vec![(".js".into(), vec![".ts".into(), ".js".into()])], - fully_specified: true, - condition_names: vec!["webpack".into(), "default".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve with the `extensionAlias` option", f.clone(), "@org/pkg/string.js", f.join("node_modules/@org/pkg/dist/string.js")), - ("should resolve with the `extensionAlias` option #2", f.clone(), "pkg/string.js", f.join("node_modules/pkg/dist/string.js")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn extension_alias_3() { - let f = super::fixture().join("exports-field-and-extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - extension_alias: vec![( - ".js".into(), - vec![".foo".into(), ".baz".into(), ".baz".into(), ".ts".into(), ".js".into()], - )], - fully_specified: true, - condition_names: vec!["webpack".into(), "default".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve with the `extensionAlias` option #3", f.clone(), "pkg/string.js", f.join("node_modules/pkg/dist/string.js")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn extension_alias_throw_error() { - let f = super::fixture().join("exports-field-and-extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - extension_alias: vec![(".js".into(), vec![".ts".into()])], - fully_specified: true, - condition_names: vec!["webpack".into(), "default".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let fail = [ - // enhanced-resolve has two test cases that are exactly the same here - // https://github.com/webpack/enhanced-resolve/blob/a998c7d218b7a9ec2461fc4fddd1ad5dd7687485/test/exportsField.test.js#L2976-L3024 - ("should throw error with the `extensionAlias` option", f, "pkg/string.js", ResolveError::ExtensionAlias), - // TODO: The error is PackagePathNotExported in enhanced-resolve - // ("should throw error with the `extensionAlias` option", f.clone(), "pkg/string.js", ResolveError::PackagePathNotExported("node_modules/pkg/dist/string.ts".to_string())), - ]; - - for (comment, path, request, error) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!(resolution, Err(error), "{comment} {path:?} {request}"); - } -} - -// Small script for generating the test cases from enhanced-resolve -// for (c of testCases) { -// console.log("TestCase {") -// console.log(`name: ${JSON.stringify(c.name)},`) -// if (c.expect instanceof Error) { -// console.log(`expect: None,`) -// } else { -// console.log(`expect: Some(vec!${JSON.stringify(c.expect)}),`) -// } -// console.log(`exports_field: exports_field(json!(${JSON.stringify(c.suite[0], null, 2)})),`) -// console.log(`request: "${c.suite[1]}",`) -// console.log(`condition_names: vec!${JSON.stringify(c.suite[2])},`) -// console.log("},") -//} -struct TestCase { - name: &'static str, - expect: Option>, - exports_field: serde_json::Value, - request: &'static str, - condition_names: Vec<&'static str>, -} - -#[allow(clippy::needless_pass_by_value)] -fn exports_field(value: serde_json::Value) -> serde_json::Value { - value -} - -#[test] -fn test_cases() { - let test_cases = [ - TestCase { - name: "sample #1", - expect: Some(vec!["./dist/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/": { - "import": [ - "./dist/", - "./src/" - ], - "webpack": "./wp/" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "sample #1", - expect: Some(vec!["./src/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/": { - "import": [ - "./src/" - ], - "webpack": "./wp/" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - TestCase { - name: "sample #1 (wildcard)", - expect: Some(vec!["./dist/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/*": { - "import": [ - "./dist/*", - "./src/*" - ], - "webpack": "./wp/*" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "sample #1 (wildcard)", - expect: Some(vec!["./src/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/*": { - "import": [ - "./src/*" - ], - "webpack": "./wp/*" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - TestCase { - name: "sample #2", - expect: Some(vec!["./data/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./timezones/": "./data/timezones/" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #2 (wildcard)", - expect: Some(vec!["./data/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./timezones/*": "./data/timezones/*" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #3", - expect: Some(vec!["./data/timezones/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./": "./data/timezones/" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #3 (wildcard)", - expect: Some(vec!["./data/timezones/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./*": "./data/timezones/*.mjs" - })), - request: "./timezones/pdt", - condition_names: vec![], - }, - TestCase { - name: "sample #4", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./lib/": { - "browser": [ - "./browser/" - ] - }, - "./dist/index.js": { - "node": "./index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #4 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "node": "./index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #5", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/": { - "browser": [ - "./browser/" - ] - }, - "./dist/index.js": { - "node": "./index.js", - "default": "./browser/index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #5 (wildcard)", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "node": "./index.js", - "default": "./browser/index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./dist/a": "./dist/index.js" - })), - request: "./dist/aaa", - condition_names: vec![], - }, - TestCase { - name: "sample #7", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./dist/a/a/": "./dist/index.js" - })), - request: "./dist/a/a", - condition_names: vec![], - }, - TestCase { - name: "sample #7 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./dist/a/a/*": "./dist/index.js" - })), - request: "./dist/a/a", - condition_names: vec![], - }, - TestCase { - name: "sample #8", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": "./index.js" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #9", - expect: Some(vec!["./main.js"]), - exports_field: exports_field(json!({ - "./index.js": "./main.js" - })), - request: "./index.js", - condition_names: vec![], - }, - TestCase { - name: "sample #10", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #11", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./bar#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #12", - expect: Some(vec!["./ok.js#abc"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/ok.js#abc", - condition_names: vec![], - }, - TestCase { - name: "sample #12", - expect: Some(vec!["./ok.js#abc"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/ok.js#abc", - condition_names: vec![], - }, - TestCase { - name: "sample #13", - expect: Some(vec!["./ok.js?abc"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/ok.js?abc", - condition_names: vec![], - }, - TestCase { - name: "sample #14", - expect: Some(vec!["./🎉.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/🎉.js", - condition_names: vec![], - }, - TestCase { - name: "sample #15", - expect: Some(vec!["./%F0%9F%8E%89.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/%F0%9F%8E%89.js", - condition_names: vec![], - }, - TestCase { - name: "sample #16", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./🎉", - condition_names: vec![], - }, - TestCase { - name: "sample #17", - expect: Some(vec!["./other.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./%F0%9F%8E%89", - condition_names: vec![], - }, - TestCase { - name: "sample #18", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./module", - condition_names: vec![], - }, - TestCase { - name: "sample #19", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./module#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #20", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./module?foo", - condition_names: vec![], - }, - TestCase { - name: "sample #21", - expect: Some(vec!["./zizizi"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./z*z*z*" - })), - request: "./#zippi", - condition_names: vec![], - }, - TestCase { - name: "sample #22", - expect: Some(vec!["./d?e?f"]), - exports_field: exports_field(json!({ - "./a?b?c/": "./" - })), - request: "./a?b?c/d?e?f", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #1", - expect: Some(vec!["./dist/index.js"]), - exports_field: exports_field(json!({ - ".": "./dist/index.js" - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #2", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./": "./", - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #3", - expect: Some(vec!["./dist/a.js"]), - exports_field: exports_field(json!({ - "./dist/": "./dist/", - "./dist/*": "./dist/*", - "./dist*": "./dist*", - "./dist/index.js": "./dist/a.js" - })), - request: "./dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #4", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./": { - "browser": [ - "./browser/" - ] - }, - "./*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "browser": "./index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #5", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./": { - "browser": [ - "./browser/" - ] - }, - "./*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "node": "./node.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #6", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - ".": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #7", - expect: Some(vec!["./src/index.js"]), // `enhanced_resolve` is `None` - exports_field: exports_field(json!({ - ".": { - "default": "./src/index.js", - "browser": "./index.js", - "node": "./src/node/index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #8", - expect: Some(vec!["./src/index.js"]), - exports_field: exports_field(json!({ - ".": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #9", - expect: Some(vec!["./index"]), - exports_field: exports_field(json!({ - ".": "./index" - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #10", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./index": "./index.js" - })), - request: "./index", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #11", - expect: Some(vec!["./foo.js"]), - exports_field: exports_field(json!({ - "./": "./", - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #12", - expect: Some(vec!["./foo/bar/baz.js"]), - exports_field: exports_field(json!({ - "./": "./", - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo/bar/baz.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #13", - expect: Some(vec!["./foo/bar/baz.js"]), - exports_field: exports_field(json!({ - "./": "./", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo/bar/baz.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #14", - expect: Some(vec!["./foo/bar/baz.js"]), - exports_field: exports_field(json!({ - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo/bar/baz.js", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #1", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "require": "./require.js" - }, { - "import": "./import.mjs" - }] - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #2", - expect: Some(vec!["./import.mjs"]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "require": "./require.js" - }, { - "import": "./import.mjs" - }] - })), - request: ".", - condition_names: vec!["import"], - }, - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./require.js"]), - exports_field: exports_field(json!({ - ".": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./import.mjs"]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "import": "./import.mjs" - }] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./require.js"]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "require": [ - "./require.js" - ] - }, { - "import": [ - "./import.mjs", - "./import.js" - ] - }] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./import.mjs"]), - exports_field: exports_field(json!({ - ".": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "./import.mjs", - "./import.js" - ] - } - ] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./import.js"]), - exports_field: exports_field(json!({ - ".": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "./import.js" - ] - } - ] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "mapping to a folder root #1", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./timezones": "./data/timezones/" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #2", - expect: None, - exports_field: exports_field(json!({ - "./timezones/": "./data/timezones" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #3", - expect: Some(vec!["./data/timezones/pdt/index.mjs"]), - exports_field: exports_field(json!({ - "./timezones/pdt/": "./data/timezones/pdt/" - })), - request: "./timezones/pdt/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #3 (wildcard)", - expect: Some(vec!["./data/timezones/pdt/index.mjs"]), - exports_field: exports_field(json!({ - "./timezones/pdt/*": "./data/timezones/pdt/*" - })), - request: "./timezones/pdt/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #4", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./": "./timezones/" - })), - request: "./pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #4 (wildcard)", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./*": "./timezones/*" - })), - request: "./pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #5", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./": "./" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #5 (wildcard)", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./*": "./*" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #6", - expect: None, - exports_field: exports_field(json!({ - "./": "." - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #6 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "./*": "." - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #7", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": "./" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #7 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": "./*" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #1", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./": "./", - "./dist/": "./lib/" - })), - request: "./dist/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #1 (wildcard)", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./*": "./*", - "./dist/*": "./lib/*" - })), - request: "./dist/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #2", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/": "./dist/utils/", - "./dist/": "./lib/" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #2 (wildcard)", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/*": "./dist/utils/*", - "./dist/*": "./lib/*" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #3", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/index.js": "./dist/utils/index.js", - "./dist/utils/": "./dist/utils/index.mjs", - "./dist/": "./lib/" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #3 (wildcard)", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/index.js": "./dist/utils/index.js", - "./dist/utils/*": "./dist/utils/index.mjs", - "./dist/*": "./lib/*" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #4", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./": { - "browser": "./browser/" - }, - "./dist/": "./lib/" - })), - request: "./dist/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "the longest matching path prefix is prioritized #4 (wildcard)", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./*": { - "browser": "./browser/*" - }, - "./dist/*": "./lib/*" - })), - request: "./dist/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #1", - // `lodash/` does not start with './' so fallbacks to util - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "conditional mapping folder #1", - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": [ - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #1 (wildcard)", - // `lodash/` does not start with './' so fallbacks to util - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": [ - "lodash/*", - "./utils/*" - ], - "node": [ - "./utils-node/*" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "conditional mapping folder #1 (wildcard)", - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": [ - "./utils/*" - ], - "node": [ - "./utils-node/*" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #2", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./node/" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "conditional mapping folder #2 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "webpack": "./wpk/*", - "browser": [ - "lodash/*", - "./utils/*" - ], - "node": [ - "./node/*" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "conditional mapping folder #3", - expect: Some(vec!["./wpk/index.mjs"]), - exports_field: exports_field(json!({ - "./utils/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils/" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "conditional mapping folder #3 (wildcard)", - expect: Some(vec!["./wpk/index.mjs"]), - exports_field: exports_field(json!({ - "./utils/*": { - "webpack": "./wpk/*", - "browser": [ - "lodash/*", - "./utils/*" - ], - "node": [ - "./utils/*" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "incorrect exports field #1", - expect: None, - exports_field: exports_field(json!({ - "/utils/": "./a/" - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #2", - expect: None, - exports_field: exports_field(json!({ - "./utils/": "/a/" - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #3", - expect: None, - exports_field: exports_field(json!({ - "/utils/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #4", - expect: None, - exports_field: exports_field(json!({ - "./utils/": { - "browser": "/a/", - "default": "/b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #4 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "/a/", - "default": "/b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #5", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index": "./a/index.js" - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index.mjs": "./a/index.js" - })), - request: "./utils/index", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #7", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #8", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index.mjs": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - // Requests that are not `./` does not apply to `package_exports_resolve` - // TestCase { - // name: "incorrect request #1", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": "./a/" - // })), - // request: "/utils/index.mjs", - // condition_names: vec![], - // }, - // TestCase { - // name: "incorrect request #2", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": { - // "browser": "./a/", - // "default": "./b/" - // } - // })), - // request: "/utils/index.mjs", - // condition_names: vec!["browser"], - // }, - // TestCase { - // name: "incorrect request #3", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": { - // "browser": "./a/", - // "default": "./b/" - // } - // })), - // request: "../utils/index.mjs", - // condition_names: vec!["browser"], - // }, - // TestCase { - // name: "incorrect request #4", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": { - // "browser": "./a/", - // "default": "./b/" - // } - // })), - // request: "/utils/index.mjs/", - // condition_names: vec!["browser"], - // }, - TestCase { - name: "backtracking package base #1", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./../../utils/": "./dist/" - })), - request: "./../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #1 (wildcard)", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./../../utils/*": "./dist/*" - })), - request: "./../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #2", - expect: None, - exports_field: exports_field(json!({ - "../../utils/": "./dist/" - })), - request: "../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #2 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "../../utils/*": "./dist/*" - })), - request: "../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #3", - expect: None, - exports_field: exports_field(json!({ - "./utils/": "../src/" - })), - request: "./utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #3 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "./utils/*": "../src/*" - })), - request: "./utils/index", - condition_names: vec![], - }, - // enhanced-resolve does not handle backtracking here - // TestCase { - // name: "backtracking package base #4", - // expect: Some(vec!["./../src/index"]), - // exports_field: exports_field(json!({ - // "./utils/": "./../src/" - // })), - // request: "./utils/index", - // condition_names: vec![], - // }, - // TestCase { - // name: "backtracking package base #4 (wildcard)", - // expect: Some(vec!["./../src/index"]), - // exports_field: exports_field(json!({ - // "./utils/*": "./../src/*" - // })), - // request: "./utils/index", - // condition_names: vec![], - // }, - // TestCase { - // name: "backtracking package base #5", - // expect: Some(vec!["./src/../index.js"]), - // exports_field: exports_field(json!({ - // "./utils/index": "./src/../index.js" - // })), - // request: "./utils/index", - // condition_names: vec![], - // }, - TestCase { - name: "backtracking package base #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/../utils/index": "./src/../index.js" - })), - request: "./utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #7", - expect: None, - exports_field: exports_field(json!({ - "./utils/": { - "browser": "../this/" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #7", - expect: None, - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "../this/*" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #8", - // We throw "InvalidPackageTarget" - // expect: Some(vec!["./utils/../index"]), - expect: None, - exports_field: exports_field(json!({ - "./utils/": { - "browser": "./utils/../" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #8 (wildcard)", - // We throw "InvalidPackageTarget" - // expect: Some(vec!["./utils/../index"]), - expect: None, - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "./utils/../*" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #9", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./": "./src/../../", - "./dist/": "./dist/" - })), - request: "./dist/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #9 (wildcard)", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./*": "./src/../../*", - "./dist/*": "./dist/*" - })), - request: "./dist/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking target folder #1", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../../index"]), - exports_field: exports_field(json!({ - "./utils/": "./dist/" - })), - request: "./utils/timezone/../../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #1 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../../index"]), - exports_field: exports_field(json!({ - "./utils/*": "./dist/*" - })), - request: "./utils/timezone/../../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #2", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../index"]), - exports_field: exports_field(json!({ - "./utils/": "./dist/" - })), - request: "./utils/timezone/../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #2 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../index"]), - exports_field: exports_field(json!({ - "./utils/*": "./dist/*" - })), - request: "./utils/timezone/../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #3", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/target/../../index"]), - exports_field: exports_field(json!({ - "./utils/": "./dist/target/" - })), - request: "./utils/../../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #3 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/target/../../index"]), - exports_field: exports_field(json!({ - "./utils/*": "./dist/target/*" - })), - request: "./utils/../../index", - condition_names: vec![], - }, - // enhanced-resolve does not handle `node_modules` in target - TestCase { - name: "nested node_modules path #1", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": "./node_modules/" - } - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #1 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "./node_modules/*" - } - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #2", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./utils/../node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/": "./utils/../node_modules/" - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "nested node_modules path #2 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./utils/../node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": "./utils/../node_modules/*" - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "nested mapping #1", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": "./", - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested mapping #1 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": "./*", - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "nested mapping #2 (wildcard)", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #2 (wildcard)", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "nested mapping #3", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["webpack"], - }, - TestCase { - name: "nested mapping #3 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["webpack"], - }, - TestCase { - name: "nested mapping #4", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["node", "browser"], - }, - TestCase { - name: "nested mapping #4 (wildcard)", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["node", "browser"], - }, - TestCase { - name: "nested mapping #5", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node"], - }, - TestCase { - name: "nested mapping #5 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": { - "webpack": [ - "./wpck/*" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node"], - }, - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - TestCase { - name: "nested mapping #6 (wildcard)", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": { - "webpack": [ - "./wpck/*" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #6 (wildcard)", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./node/*" - ], - "default": { - "node": { - "webpack": [ - "./wpck/*" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - TestCase { - name: "nested mapping #7", - expect: Some(vec!["./y.js"]), - exports_field: exports_field(json!({ - "./a.js": { - "abc": { - "def": "./x.js" - }, - "ghi": "./y.js" - } - })), - request: "./a.js", - condition_names: vec!["abc", "ghi"], - }, - TestCase { - name: "nested mapping #8", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./a.js": { - "abc": { - "def": "./x.js", - "default": [] - }, - "ghi": "./y.js" - } - })), - request: "./a.js", - condition_names: vec!["abc", "ghi"], - }, - TestCase { - name: "syntax sugar #1", - expect: Some(vec!["./main.js"]), - exports_field: exports_field(json!("./main.js")), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #2", - expect: Some(vec![]), - exports_field: exports_field(json!("./main.js")), - request: "./lib.js", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #3", - expect: Some(vec!["./a.js"]), - exports_field: exports_field(json!(["./a.js", "./b.js"])), - request: ".", - condition_names: vec![], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "syntax sugar #3", - expect: Some(vec!["./b.js"]), - exports_field: exports_field(json!(["./b.js"])), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #4", - expect: Some(vec![]), - exports_field: exports_field(json!(["./a.js", "./b.js"])), - request: "./lib.js", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #5", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "browser": { - "default": "./index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "syntax sugar #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "browser": { - "default": "./index.js" - } - })), - request: "./lib.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "syntax sugar #7", - expect: None, - exports_field: exports_field(json!({ - "./node": "./node.js", - "browser": { - "default": "./index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "syntax sugar #8", - expect: None, - exports_field: exports_field(json!({ - "browser": { - "default": "./index.js" - }, - "./node": "./node.js" - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #1", - expect: Some(vec!["./abc/d"]), - exports_field: exports_field(json!({ - "./ab*": "./ab/*", - "./abc*": "./abc/*", - "./a*": "./a/*" - })), - request: "./abcd", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #2", - expect: Some(vec!["./abc/d/e"]), - exports_field: exports_field(json!({ - "./ab*": "./ab/*", - "./abc*": "./abc/*", - "./a*": "./a/*" - })), - request: "./abcd/e", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #3", - expect: Some(vec!["./abc/d"]), - exports_field: exports_field(json!({ - "./x/ab*": "./ab/*", - "./x/abc*": "./abc/*", - "./x/a*": "./a/*" - })), - request: "./x/abcd", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #4", - expect: Some(vec!["./abc/d/e"]), - exports_field: exports_field(json!({ - "./x/ab*": "./ab/*", - "./x/abc*": "./abc/*", - "./x/a*": "./a/*" - })), - request: "./x/abcd/e", - condition_names: vec!["browser"], - }, - TestCase { - name: "path tree edge case #1", - expect: Some(vec!["./A/b/d.js"]), - exports_field: exports_field(json!({ - "./a/": "./A/", - "./a/b/c": "./c.js" - })), - request: "./a/b/d.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #1 (wildcard)", - expect: Some(vec!["./A/b/d.js"]), - exports_field: exports_field(json!({ - "./a/*": "./A/*", - "./a/b/c": "./c.js" - })), - request: "./a/b/d.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #2", - expect: Some(vec!["./A/c.js"]), - exports_field: exports_field(json!({ - "./a/": "./A/", - "./a/b": "./b.js" - })), - request: "./a/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #2 (wildcard)", - expect: Some(vec!["./A/c.js"]), - exports_field: exports_field(json!({ - "./a/*": "./A/*", - "./a/b": "./b.js" - })), - request: "./a/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #3", - expect: Some(vec!["./A/b/d/c.js"]), - exports_field: exports_field(json!({ - "./a/": "./A/", - "./a/b/c/d": "./c.js" - })), - request: "./a/b/d/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #3 (wildcard)", - expect: Some(vec!["./A/b/d/c.js"]), - exports_field: exports_field(json!({ - "./a/*": "./A/*", - "./a/b/c/d": "./c.js" - })), - request: "./a/b/d/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #1", - expect: Some(vec!["./A/b.js"]), - exports_field: exports_field(json!({ - "./a/*.js": "./A/*.js" - })), - request: "./a/b.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #2", - expect: Some(vec!["./A/b/c.js"]), - exports_field: exports_field(json!({ - "./a/*.js": "./A/*.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #3", - expect: Some(vec!["./A/b/c.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": "./A/*/c.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #4", - expect: Some(vec!["./A/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": "./A/*/*.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #5", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/*.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #5", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/*.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./lib/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #6", - expect: Some(vec!["./browser/foo/bar.js"]), - exports_field: exports_field(json!({ - "./lib/*/bar.js": { - "browser": [ - "./browser/*/bar.js" - ] - }, - "./dist/*/bar.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./lib/foo/bar.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #6", - expect: Some(vec!["./browser/foo.js"]), - exports_field: exports_field(json!({ - "./lib/*/bar.js": { - "browser": [ - "./browser/*/bar.js" - ] - }, - "./dist/*/bar.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./dist/foo/bar.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #7", - expect: Some(vec!["./browser/foo/default.js"]), - exports_field: exports_field(json!({ - "./lib/*/bar.js": { - "browser": [ - "./browser/*/bar.js" - ] - }, - "./dist/*/bar.js": { - "node": "./*.js", - "default": "./browser/*/default.js" - } - })), - request: "./dist/foo/bar.js", - condition_names: vec!["default"], - }, - TestCase { - name: "wildcard pattern #8", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": "./A/*/*/*.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #9", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": [ - "./A/*/*/*.js", - "./B/*/*/*.js" - ] - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "wildcard pattern #9", - expect: Some(vec!["./B/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": [ - "./B/*/*/*.js" - ] - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #10", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/foo-*/c.js": "./A/*/*/*.js" - })), - request: "./a/foo-b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #11", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*-foo/c.js": "./A/*/*/*.js" - })), - request: "./a/b-foo/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #12", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/foo-*-foo/c.js": "./A/*/*/*.js" - })), - request: "./a/foo-b-foo/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #13", - expect: Some(vec!["./A/b/c/d.js"]), - exports_field: exports_field(json!({ - "./a/foo-*-foo/c.js": "./A/b/c/d.js" - })), - request: "./a/foo-b-foo/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #14", - expect: Some(vec!["./A/b/c/*.js"]), - exports_field: exports_field(json!({ - "./a/foo-foo/c.js": "./A/b/c/*.js" - })), - request: "./a/foo-foo/c.js", - condition_names: vec![], - }, - ]; - - for case in test_cases { - let resolved = Resolver::new(ResolveOptions { - condition_names: case - .condition_names - .iter() - .map(ToString::to_string) - .collect::>(), - ..ResolveOptions::default() - }) - .package_exports_resolve( - Path::new(""), - case.request, - &case.exports_field, - &mut Ctx::default(), - ) - .map(|p| p.map(|p| p.to_path_buf())); - if let Some(expect) = case.expect { - if expect.is_empty() { - assert!( - matches!(resolved, Err(ResolveError::PackagePathNotExported(_, _))), - "{} {:?}", - &case.name, - &resolved - ); - } else { - for expect in expect { - assert_eq!(resolved, Ok(Some(Path::new(expect).normalize())), "{}", &case.name); - } - } - } else { - assert!(resolved.is_err(), "{} {resolved:?}", &case.name); - } - } -} diff --git a/src/tests/extension_alias.rs b/src/tests/extension_alias.rs deleted file mode 100644 index 86afab73..00000000 --- a/src/tests/extension_alias.rs +++ /dev/null @@ -1,66 +0,0 @@ -//! - -use crate::{ResolveError, ResolveOptions, Resolver}; - -#[test] -fn extension_alias() { - let f = super::fixture().join("extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - extension_alias: vec![ - (".js".into(), vec![".ts".into(), ".js".into()]), - (".mjs".into(), vec![".mts".into()]), - ], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should alias fully specified file", f.clone(), "./index.js", f.join("index.ts")), - ("should alias fully specified file when there are two alternatives", f.clone(), "./dir/index.js", f.join("dir/index.ts")), - ("should also allow the second alternative", f.clone(), "./dir2/index.js", f.join("dir2/index.js")), - ("should support alias option without an array", f.clone(), "./dir2/index.mjs", f.join("dir2/index.mts")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } - - #[rustfmt::skip] - let fail = [ - ("should not allow to fallback to the original extension or add extensions", f, "./index.mjs"), - ]; - - for (comment, path, request) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!(resolution, Err(ResolveError::ExtensionAlias), "{comment} {path:?} {request}"); - } -} - -// should not apply extension alias to extensions or mainFiles field -#[test] -fn not_apply_to_extension_nor_main_files() { - let f = super::fixture().join("extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - extension_alias: vec![(".js".into(), vec![])], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("directory", f.clone(), "./dir2", "dir2/index.js"), - ("file", f.clone(), "./dir2/index", "dir2/index.js"), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - let expected = f.join(expected); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} diff --git a/src/tests/extensions.rs b/src/tests/extensions.rs deleted file mode 100644 index 1ebd86f4..00000000 --- a/src/tests/extensions.rs +++ /dev/null @@ -1,125 +0,0 @@ -//! - -use crate::{EnforceExtension, Resolution, ResolveContext, ResolveError, ResolveOptions, Resolver}; -use rustc_hash::FxHashSet; - -#[test] -fn extensions() { - let f = super::fixture().join("extensions"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".ts".into(), ".js".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve according to order of provided extensions", "./foo", "foo.ts"), - ("should resolve according to order of provided extensions (dir index)", "./dir", "dir/index.ts"), - ("should resolve according to main field in module root", ".", "index.js"), - // This is a core module - // ("should resolve single file module before directory", "module", "node_modules/module.js"), - ("should resolve trailing slash directory before single file", "module/", "node_modules/module/index.ts"), - ]; - - for (comment, request, expected_path) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - let expected = f.join(expected_path); - assert_eq!(resolved_path, Ok(expected), "{comment} {request} {expected_path}"); - } - - #[rustfmt::skip] - let fail = [ - ("not resolve to file when request has a trailing slash (relative)", "./foo.js/", "./foo.js/".into()) - ]; - - for (comment, request, expected_error) in fail { - let resolution = resolver.resolve(&f, request); - let error = ResolveError::NotFound(expected_error); - assert_eq!(resolution, Err(error), "{comment} {request} {resolution:?}"); - } -} - -// should default enforceExtension to true when extensions includes an empty string -#[test] -fn default_enforce_extension() { - let f = super::fixture().join("extensions"); - - let mut ctx = ResolveContext::default(); - let resolved = Resolver::new(ResolveOptions { - extensions: vec![".ts".into(), String::new(), ".js".into()], - ..ResolveOptions::default() - }) - .resolve_with_context(&f, "./foo", &mut ctx); - - assert_eq!(resolved.map(Resolution::into_path_buf), Ok(f.join("foo.ts"))); - assert_eq!( - ctx.file_dependencies, - FxHashSet::from_iter([f.join("foo.ts"), f.join("package.json")]) - ); - assert!(ctx.missing_dependencies.is_empty()); -} - -// should respect enforceExtension when extensions includes an empty string -#[test] -fn respect_enforce_extension() { - let f = super::fixture().join("extensions"); - - let mut ctx = ResolveContext::default(); - let resolved = Resolver::new(ResolveOptions { - enforce_extension: EnforceExtension::Disabled, - extensions: vec![".ts".into(), String::new(), ".js".into()], - ..ResolveOptions::default() - }) - .resolve_with_context(&f, "./foo", &mut ctx); - - assert_eq!(resolved.map(Resolution::into_path_buf), Ok(f.join("foo.ts"))); - assert_eq!( - ctx.file_dependencies, - FxHashSet::from_iter([f.join("foo.ts"), f.join("package.json")]) - ); - assert_eq!(ctx.missing_dependencies, FxHashSet::from_iter([f.join("foo")])); -} - -#[test] -fn multi_dot_extension() { - let f = super::fixture().join("extensions"); - - let resolver = Resolver::new(ResolveOptions { - // Test for `.d.ts`, not part of enhanced-resolve. - extensions: vec![".a.b.c".into(), ".d.ts".into(), ".ts".into(), ".js".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve according to order of provided extensions", "./foo", "foo.ts"), - ("should resolve file with extension", "./app.module", "app.module.js") - ]; - - for (comment, request, expected_path) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - let expected = f.join(expected_path); - assert_eq!(resolved_path, Ok(expected), "{comment} {request} {expected_path}"); - } - - #[rustfmt::skip] - let fail = [ - ("not resolve to file", "./index.", "./index.".into()) - ]; - - for (comment, request, expected_error) in fail { - let resolution = resolver.resolve(&f, request); - let error = ResolveError::NotFound(expected_error); - assert_eq!(resolution, Err(error), "{comment} {request} {resolution:?}"); - } -} - -#[test] -#[should_panic = "All extensions must start with a leading dot"] -fn without_leading_dot() { - Resolver::new(ResolveOptions { - extensions: vec!["ts".into(), "js".into()], - ..ResolveOptions::default() - }); -} diff --git a/src/tests/fallback.rs b/src/tests/fallback.rs deleted file mode 100644 index 3da2d767..00000000 --- a/src/tests/fallback.rs +++ /dev/null @@ -1,100 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/fallback.test.js - -#[test] -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -fn fallback() { - use super::memory_fs::MemoryFS; - use crate::{AliasValue, ResolveError, ResolveOptions, ResolverGeneric}; - use std::path::{Path, PathBuf}; - - let f = Path::new("/"); - - let file_system = MemoryFS::new(&[ - ("/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", ""), - ]); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - fallback: vec![ - ("aliasA".into(), vec![AliasValue::Path("a".into())]), - ("b$".into(), vec![AliasValue::Path("a/index".into())]), - ("c$".into(), vec![AliasValue::Path("/a/index".into())]), - ( - "multiAlias".into(), - vec![ - AliasValue::Path("b".into()), - AliasValue::Path("c".into()), - AliasValue::Path("d".into()), - AliasValue::Path("e".into()), - AliasValue::Path("a".into()), - ], - ), - ("recursive".into(), vec![AliasValue::Path("recursive/dir".into())]), - ("/d/dir".into(), vec![AliasValue::Path("/c/dir".into())]), - ("/d/index.js".into(), vec![AliasValue::Path("/c/index".into())]), - ("ignored".into(), vec![AliasValue::Ignore]), - ("node:path".into(), vec![AliasValue::Ignore]), - ], - modules: vec!["/".into()], - ..ResolveOptions::default() - }, - ); - - #[rustfmt::skip] - let pass = [ - ("should resolve a not aliased module 1", "a", "/a/index"), - ("should resolve a not aliased module 2", "a/index", "/a/index"), - ("should resolve a not aliased module 3", "a/dir", "/a/dir/index"), - ("should resolve a not aliased module 4", "a/dir/index", "/a/dir/index"), - ("should resolve an fallback module 1", "aliasA", "/a/index"), - ("should resolve an fallback module 2", "aliasA/index", "/a/index"), - ("should resolve an fallback module 3", "aliasA/dir", "/a/dir/index"), - ("should resolve an fallback module 4", "aliasA/dir/index", "/a/dir/index"), - ("should resolve a recursive aliased module 1", "recursive", "/recursive/index"), - ("should resolve a recursive aliased module 2", "recursive/index", "/recursive/index"), - ("should resolve a recursive aliased module 3", "recursive/dir", "/recursive/dir/index"), - ("should resolve a recursive aliased module 4", "recursive/dir/index", "/recursive/dir/index"), - ("should resolve a recursive aliased module 5", "recursive/file", "/recursive/dir/file"), - ("should resolve a file aliased module with a query 1", "b?query", "/b/index?query"), - ("should resolve a file aliased module with a query 2", "c?query", "/c/index?query"), - ("should resolve a path in a file aliased module 1", "b/index", "/b/index"), - ("should resolve a path in a file aliased module 2", "b/dir", "/b/dir/index"), - ("should resolve a path in a file aliased module 3", "b/dir/index", "/b/dir/index"), - ("should resolve a path in a file aliased module 4", "c/index", "/c/index"), - ("should resolve a path in a file aliased module 5", "c/dir", "/c/dir/index"), - ("should resolve a path in a file aliased module 6", "c/dir/index", "/c/dir/index"), - ("should resolve a file in multiple aliased dirs 1", "multiAlias/dir/file", "/e/dir/file"), - ("should resolve a file in multiple aliased dirs 2", "multiAlias/anotherDir", "/e/anotherDir/index"), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - - #[rustfmt::skip] - let ignore = [ - ("should resolve an ignore module", "ignored", ResolveError::Ignored(f.join("ignored"))), - ("should resolve node: builtin module", "node:path", ResolveError::Ignored(PathBuf::from("/node:path"))), - ]; - - for (comment, request, expected) in ignore { - let resolution = resolver.resolve(f, request); - assert_eq!(resolution, Err(expected), "{comment} {request}"); - } -} diff --git a/src/tests/full_specified.rs b/src/tests/full_specified.rs deleted file mode 100644 index a70c0191..00000000 --- a/src/tests/full_specified.rs +++ /dev/null @@ -1,113 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/fullSpecified.test.js - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows { - use std::path::PathBuf; - - use crate::{AliasValue, ResolveOptions, ResolverGeneric}; - - use super::super::memory_fs::MemoryFS; - - fn file_system() -> MemoryFS { - MemoryFS::new(&[ - ("/a/node_modules/package1/index.js", ""), - ("/a/node_modules/package1/file.js", ""), - ("/a/node_modules/package2/package.json", r#"{"main":"a"}"#), - ("/a/node_modules/package2/a.js", ""), - ("/a/node_modules/package3/package.json", r#"{"main":"dir"}"#), - ("/a/node_modules/package3/dir/index.js", ""), - ("/a/node_modules/package4/package.json", r#"{"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", ""), - ]) - } - - #[test] - fn test() { - let file_system = file_system(); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - alias: vec![ - ("alias1".into(), vec![AliasValue::from("/a/abc")]), - ("alias2".into(), vec![AliasValue::from("/a")]), - ], - alias_fields: vec![vec!["browser".into()]], - fully_specified: true, - ..ResolveOptions::default() - }, - ); - - let failing_resolves = [ - ("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"), - ]; - - for (comment, request) in failing_resolves { - let resolution = resolver.resolve("/a", request); - assert!(resolution.is_err(), "{comment} {request}"); - } - - let successful_resolves = [ - ("fully relative", "./abc.js", "/a/abc.js"), - ("fully absolute", "/a/abc.js", "/a/abc.js"), - ("fully relative in package", "package1/file.js", "/a/node_modules/package1/file.js"), - ("extensions in mainFiles", "package1", "/a/node_modules/package1/index.js"), - ("extensions in mainFields", "package2", "/a/node_modules/package2/a.js"), - ("extensions in alias", "alias1", "/a/abc.js"), - ("directories in alias", "alias2", "/a/index.js"), - ("directories in packages", "package3", "/a/node_modules/package3/dir/index.js"), - ("extensions in aliasFields", "package4/a.js", "/a/node_modules/package4/b.js"), - ]; - - for (comment, request, expected) in successful_resolves { - let resolution = resolver.resolve("/a", request).map(|r| r.full_path()); - assert_eq!(resolution, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - } - - #[test] - #[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. - fn resolve_to_context() { - let file_system = file_system(); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - alias: vec![ - ("alias1".into(), vec![AliasValue::from("/a/abc")]), - ("alias2".into(), vec![AliasValue::from("/a")]), - ], - alias_fields: vec![vec!["browser".into()]], - fully_specified: true, - resolve_to_context: true, - ..ResolveOptions::default() - }, - ); - - let successful_resolves = [ - ("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", "/a/node_modules/package3/dir"), - ]; - - for (comment, request, expected) in successful_resolves { - let resolution = resolver.resolve("/a", request).map(|r| r.full_path()); - assert_eq!(resolution, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - } -} diff --git a/src/tests/imports_field.rs b/src/tests/imports_field.rs deleted file mode 100644 index c928627a..00000000 --- a/src/tests/imports_field.rs +++ /dev/null @@ -1,1320 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/importsField.test.js -//! -//! The huge imports field test cases are at the bottom of this file. - -use serde_json::json; - -use crate::{Ctx, JSONMap, PathUtil, ResolveError, ResolveOptions, Resolver}; -use std::path::Path; - -#[test] -fn test_simple() { - let f = super::fixture().join("imports-field"); - let f2 = super::fixture().join("imports-exports-wildcard/node_modules/m/"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve using imports field instead of self-referencing", f.clone(), "#imports-field", f.join("b.js")), - ("should resolve using imports field instead of self-referencing for a subpath", f.join("dir"), "#imports-field", f.join("b.js")), - ("should resolve package #1", f.clone(), "#a/dist/main.js", f.join("node_modules/a/lib/lib2/main.js")), - ("should resolve package #3", f.clone(), "#ccc/index.js", f.join("node_modules/c/index.js")), - ("should resolve package #4", f.clone(), "#c", f.join("node_modules/c/index.js")), - ("should resolve with wildcard pattern", f2.clone(), "#internal/i.js", f2.join("src/internal/i.js")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } - - // Note added: - // * should resolve absolute path as an imports field target - // * should log the correct info - - #[rustfmt::skip] - let fail = [ - ("should disallow resolve out of package scope", f.clone(), "#b", ResolveError::InvalidPackageTarget("../b.js".to_string(), "#b".to_string(), f.join("package.json"))), - ("should resolve package #2", f.clone(), "#a", ResolveError::PackageImportNotDefined("#a".to_string(), f.join("package.json"))), - ]; - - for (comment, path, request, error) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!(resolution, Err(error), "{comment} {path:?} {request}"); - } -} - -#[test] -fn shared_resolvers() { - let f = super::fixture().join("imports-field"); - - // field name #1 - let resolver1 = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - imports_fields: vec![vec!["imports".into()]], - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - let resolved_path = resolver1.resolve(&f, "#imports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("b.js"))); - - // field name #2 - let resolver2 = resolver1.clone_with_options(ResolveOptions { - imports_fields: vec![vec!["other".into(), "imports".into()]], - ..ResolveOptions::default() - }); - - let resolved_path = resolver2.resolve(&f, "#b").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("a.js"))); -} - -// Small script for generating the test cases from enhanced_resolve -// for (c of testCases) { -// console.log("TestCase {") -// console.log(`name: ${JSON.stringify(c.name)},`) -// if (c.expect instanceof Error) { -// console.log(`expect: None,`) -// } else { -// console.log(`expect: Some(vec!${JSON.stringify(c.expect)}),`) -// } -// console.log(`imports_field: imports_field(json!(${JSON.stringify(c.suite[0], null, 2)})),`) -// console.log(`request: "${c.suite[1]}",`) -// console.log(`condition_names: vec!${JSON.stringify(c.suite[2])},`) -// console.log("},") -// } - -struct TestCase { - name: &'static str, - expect: Option>, - imports_field: JSONMap, - request: &'static str, - condition_names: Vec<&'static str>, -} - -#[allow(clippy::needless_pass_by_value)] -fn imports_field(value: serde_json::Value) -> JSONMap { - let s = serde_json::to_string(&value).unwrap(); - serde_json::from_str(&s).unwrap() -} - -#[test] -fn test_cases() { - let test_cases = [ - TestCase { - name: "sample #1", - expect: Some(vec!["./dist/test/file.js"]), - imports_field: imports_field(json!({ - "#abc/": { - "import": [ - "./dist/", - "./src/" - ], - "webpack": "./wp/" - }, - "#abc": "./main.js" - })), - request: "#abc/test/file.js", - condition_names: vec!["import", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "sample #1", - expect: Some(vec!["./src/test/file.js"]), - imports_field: imports_field(json!({ - "#abc/": { - "import": [ - "./src/" - ], - "webpack": "./wp/" - }, - "#abc": "./main.js" - })), - request: "#abc/test/file.js", - condition_names: vec!["import", "webpack"], - }, - TestCase { - name: "sample #2", - expect: Some(vec!["./data/timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#1/timezones/": "./data/timezones/" - })), - request: "#1/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #3", - expect: Some(vec!["./data/timezones/timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#aaa/": "./data/timezones/", - "#a/": "./data/timezones/" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #4", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/lib/": { - "browser": [ - "./browser/" - ] - }, - "#a/dist/index.js": { - "node": "./index.js" - } - })), - request: "#a/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #5", - expect: Some(vec!["./browser/index.js"]), - imports_field: imports_field(json!({ - "#a/lib/": { - "browser": [ - "./browser/" - ] - }, - "#a/dist/index.js": { - "node": "./index.js", - "default": "./browser/index.js" - } - })), - request: "#a/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #6", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/dist/a": "./dist/index.js" - })), - request: "#a/dist/aaa", - condition_names: vec![], - }, - TestCase { - name: "sample #7", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/a/a/": "./dist/index.js" - })), - request: "#a/a/a", - condition_names: vec![], - }, - TestCase { - name: "sample #8", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": "./index.js" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #9", - expect: Some(vec!["./main.js"]), - imports_field: imports_field(json!({ - "#a/index.js": "./main.js" - })), - request: "#a/index.js", - condition_names: vec![], - }, - TestCase { - name: "sample #10", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #11", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/bar#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #12", - expect: Some(vec!["./ok.js#abc"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/ok.js#abc", - condition_names: vec![], - }, - TestCase { - name: "sample #13", - expect: Some(vec!["./ok.js?abc"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/ok.js?abc", - condition_names: vec![], - }, - TestCase { - name: "sample #14", - expect: Some(vec!["./🎉.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/🎉.js", - condition_names: vec![], - }, - TestCase { - name: "sample #15", - expect: Some(vec!["./%F0%9F%8E%89.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/%F0%9F%8E%89.js", - condition_names: vec![], - }, - TestCase { - name: "sample #16", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/🎉", - condition_names: vec![], - }, - TestCase { - name: "sample #17", - expect: Some(vec!["./other.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/%F0%9F%8E%89", - condition_names: vec![], - }, - TestCase { - name: "sample #18", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/module", - condition_names: vec![], - }, - TestCase { - name: "sample #19", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/module#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #20", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/module?foo", - condition_names: vec![], - }, - TestCase { - name: "sample #21", - expect: Some(vec!["./d?e?f"]), - imports_field: imports_field(json!({ - "#a/a?b?c/": "./" - })), - request: "#a/a?b?c/d?e?f", - condition_names: vec![], - }, - TestCase { - name: "sample #22", - // We throw InvalidPackageTarget - expect: None, - // expect: Some(vec!["/user/a/index"]), - imports_field: imports_field(json!({ - "#a/": "/user/a/" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #1", - expect: Some(vec!["./A/b/d.js"]), - imports_field: imports_field(json!({ - "#a/": "./A/", - "#a/b/c": "./c.js" - })), - request: "#a/b/d.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #2", - expect: Some(vec!["./A/c.js"]), - imports_field: imports_field(json!({ - "#a/": "./A/", - "#a/b": "./b.js" - })), - request: "#a/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #3", - expect: Some(vec!["./A/b/c/d.js"]), - imports_field: imports_field(json!({ - "#a/": "./A/", - "#a/b/c/d": "./c.js" - })), - request: "#a/b/c/d.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #1", - expect: Some(vec!["./dist/index.js"]), - imports_field: imports_field(json!({ - "#a": "./dist/index.js" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #2", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": "./" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #3", - expect: Some(vec!["./dist/a.js"]), - imports_field: imports_field(json!({ - "#a/": "./dist/", - "#a/index.js": "./dist/a.js" - })), - request: "#a/index.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #4", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "./browser/" - ] - }, - "#a/index.js": { - "browser": "./index.js" - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #5", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "./browser/" - ] - }, - "#a/index.js": { - "node": "./node.js" - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #6", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: "#a", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #7", - expect: Some(vec!["./src/index.js"]), // `enhanced_resolve` is `None` - imports_field: imports_field(json!({ - "#a": { - "default": "./src/index.js", - "browser": "./index.js", - "node": "./src/node/index.js" - } - })), - request: "#a", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #8", - expect: Some(vec!["./src/index.js"]), - imports_field: imports_field(json!({ - "#a": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #9", - expect: Some(vec!["./index"]), - imports_field: imports_field(json!({ - "#a": "./index" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #10", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/index": "./index.js" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #11", - // We throw InvalidPackageTarget - // expect: Some(vec!["b"]), - expect: None, - imports_field: imports_field(json!({ - "#a": "b" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #12", - // We throw InvalidPackageTarget - // expect: Some(vec!["b/index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "b/" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #13", - // We throw InvalidPackageTarget - // expect: Some(vec!["b#anotherhashishere"]), - expect: None, - imports_field: imports_field(json!({ - "#a?q=a#hashishere": "b#anotherhashishere" - })), - request: "#a?q=a#hashishere", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #1", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #2", - expect: Some(vec!["./import.mjs"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec!["import"], - }, - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./require.js"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./import.mjs"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./require.js"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": [ - "./require.js" - ] - }, - { - "import": [ - "./import.mjs", - "#b/import.js" - ] - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./import.mjs"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "./import.mjs", - "#b/import.js" - ] - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "#b/import.js" - ] - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "mapping to a folder root #1", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#timezones": "./data/timezones/" - })), - request: "#timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #2", - expect: None, - imports_field: imports_field(json!({ - "#timezones/": "./data/timezones" - })), - request: "#timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #3", - expect: Some(vec!["./data/timezones/pdt/index.mjs"]), - imports_field: imports_field(json!({ - "#timezones/pdt/": "./data/timezones/pdt/" - })), - request: "#timezones/pdt/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #4", - expect: Some(vec!["./timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#a/": "./timezones/" - })), - request: "#a/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #5", - expect: Some(vec!["./timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#a/": "./" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #6", - expect: None, - imports_field: imports_field(json!({ - "#a/": "." - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #7", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": "./" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #1", - expect: Some(vec!["./lib/index.mjs"]), - imports_field: imports_field(json!({ - "#a/": "./", - "#a/dist/": "./lib/" - })), - request: "#a/dist/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #2", - expect: Some(vec!["./dist/utils/index.js"]), - imports_field: imports_field(json!({ - "#a/dist/utils/": "./dist/utils/", - "#a/dist/": "./lib/" - })), - request: "#a/dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #3", - expect: Some(vec!["./dist/utils/index.js"]), - imports_field: imports_field(json!({ - "#a/dist/utils/index.js": "./dist/utils/index.js", - "#a/dist/utils/": "./dist/utils/index.mjs", - "#a/dist/": "./lib/" - })), - request: "#a/dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #4", - expect: Some(vec!["./lib/index.mjs"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./browser/" - }, - "#a/dist/": "./lib/" - })), - request: "#a/dist/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #1", - // This behaves differently from enhanced_resolve, because `lodash/` is an an InvalidPackageConfig - // expect: Some(vec!["lodash/index.js"]), - expect: Some(vec!["./utils/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "conditional mapping folder #1", - expect: Some(vec!["./utils/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #2", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./node/" - ] - } - })), - request: "#a/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "conditional mapping folder #3", - expect: Some(vec!["./wpk/index.mjs"]), - imports_field: imports_field(json!({ - "#a/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils/" - ] - } - })), - request: "#a/index.mjs", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "incorrect exports field #1", - // We throw `PackageImportNotDefined` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "/utils/": "./a/" - })), - request: "#a/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #2", - // We throw `PackageImportNotDefined` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "/utils/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#a/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #3", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index": "./a/index.js" - })), - request: "#a/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #4", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index.mjs": "./a/index.js" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #5", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "#a/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #6", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index.mjs": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "#a/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #1", - // We don't throw in `package_imports_exports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": "./a/" - })), - request: "/utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect request #2", - // We don't throw in `package_imports_exports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #3", - // We don't throw in `package_imports_exports_resolve`, it's thrown in `package_imports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #4", - // We don't throw in `package_imports_exports_resolve`, it's thrown in `package_imports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#/", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #5", - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#a/", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #1", - // expect: Some(vec!["./dist/index"]), - expect: Some(vec!["dist/index"]), - imports_field: imports_field(json!({ - "#a/../../utils/": "./dist/" - })), - request: "#a/../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #2", - // We throw InvalidPackageTarget - // expect: Some(vec!["./dist/../../utils/index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "./dist/" - })), - request: "#a/../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #3", - // We throw InvalidPackageTarget - // expect: Some(vec!["../src/index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "../src/" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #4", - // We throw InvalidPackageTarget - // expect: Some(vec!["./utils/../../../index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": { - "browser": "./utils/../../../" - } - })), - request: "#a/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #1", - // expect: Some(vec!["moment/node_modules/lodash/dist/index.js"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": { - "browser": "moment/node_modules/" - } - })), - request: "#a/lodash/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #2", - // We throw InvalidPackageTarget - // expect: Some(vec!["../node_modules/lodash/dist/index.js"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "../node_modules/" - })), - request: "#a/lodash/dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "nested mapping #1", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": "./", - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./node/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "nested mapping #3", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["webpack"], - }, - TestCase { - name: "nested mapping #4", - // We throw NotFound - // expect: Some(vec!["moment/node/index.js"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "moment/node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["node", "browser"], - }, - TestCase { - name: "nested mapping #5", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "node"], - }, - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./node/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - TestCase { - name: "nested mapping #7", - expect: Some(vec!["./y.js"]), - imports_field: imports_field(json!({ - "#a": { - "abc": { - "def": "./x.js" - }, - "ghi": "./y.js" - } - })), - request: "#a", - condition_names: vec!["abc", "ghi"], - }, - TestCase { - name: "nested mapping #8", - // We throw PackageImportNotDefined - // expect: Some(vec![]), - expect: None, - imports_field: imports_field(json!({ - "#a": { - "abc": { - "def": "./x.js", - "default": [] - }, - "ghi": "./y.js" - } - })), - request: "#a", - condition_names: vec!["abc", "ghi"], - }, - ]; - - for case in test_cases { - let resolved = Resolver::default() - .package_imports_exports_resolve( - case.request, - &case.imports_field, - Path::new(""), - true, - &case.condition_names.iter().map(ToString::to_string).collect::>(), - &mut Ctx::default(), - ) - .map(|p| p.map(|p| p.to_path_buf())); - if let Some(expect) = case.expect { - if expect.is_empty() { - assert!(matches!(resolved, Ok(None)), "{} {:?}", &case.name, &resolved); - } else { - for expect in expect { - assert_eq!(resolved, Ok(Some(Path::new(expect).normalize())), "{}", &case.name); - } - } - } else { - assert!(resolved.is_err(), "{} {resolved:?}", &case.name); - } - } -} diff --git a/src/tests/incorrect_description_file.rs b/src/tests/incorrect_description_file.rs deleted file mode 100644 index a5c81796..00000000 --- a/src/tests/incorrect_description_file.rs +++ /dev/null @@ -1,62 +0,0 @@ -//! - -use rustc_hash::FxHashSet; - -use crate::{JSONError, Resolution, ResolveContext, ResolveError, ResolveOptions, Resolver}; - -// should not resolve main in incorrect description file #1 -#[test] -fn incorrect_description_file_1() { - let f = super::fixture().join("incorrect-package"); - let mut ctx = ResolveContext::default(); - let resolution = Resolver::default().resolve_with_context(f.join("pack1"), ".", &mut ctx); - let error = ResolveError::JSON(JSONError { - path: f.join("pack1/package.json"), - message: String::from("EOF while parsing a value at line 3 column 0"), - line: 3, - column: 0, - }); - assert_eq!(resolution, Err(error)); - assert_eq!(ctx.file_dependencies, FxHashSet::from_iter([f.join("pack1/package.json")])); - assert!(ctx.missing_dependencies.is_empty()); -} - -// should not resolve main in incorrect description file #2 -#[test] -fn incorrect_description_file_2() { - let f = super::fixture().join("incorrect-package"); - let resolution = Resolver::default().resolve(f.join("pack2"), "."); - let error = ResolveError::JSON(JSONError { - path: f.join("pack2/package.json"), - message: String::from("EOF while parsing a value at line 1 column 0"), - line: 1, - column: 0, - }); - assert_eq!(resolution, Err(error)); -} - -// should not resolve main in incorrect description file #3 -#[test] -fn incorrect_description_file_3() { - let f = super::fixture().join("incorrect-package"); - let resolution = Resolver::default().resolve(f.join("pack2"), "."); - assert!(resolution.is_err()); -} - -// `enhanced_resolve` does not have this test case -#[test] -fn no_description_file() { - let f = super::fixture_root().join("enhanced_resolve"); - - // has description file - let resolver = Resolver::default(); - assert_eq!( - resolver.resolve(&f, ".").map(Resolution::into_path_buf), - Ok(f.join("lib/index.js")) - ); - - // without description file - let resolver = - Resolver::new(ResolveOptions { description_files: vec![], ..ResolveOptions::default() }); - assert_eq!(resolver.resolve(&f, "."), Err(ResolveError::NotFound(".".into()))); -} diff --git a/src/tests/main_field.rs b/src/tests/main_field.rs deleted file mode 100644 index 3cadc8ce..00000000 --- a/src/tests/main_field.rs +++ /dev/null @@ -1,24 +0,0 @@ -//! Not part of enhanced_resolve's test suite - -use crate::{ResolveOptions, Resolver}; - -#[test] -fn test() { - let f = super::fixture().join("restrictions"); - - let resolver1 = Resolver::new(ResolveOptions { - main_fields: vec!["style".into()], - ..ResolveOptions::default() - }); - - let resolution = resolver1.resolve(&f, "pck2").map(|r| r.full_path()); - assert_eq!(resolution, Ok(f.join("node_modules/pck2/index.css"))); - - let resolver2 = resolver1.clone_with_options(ResolveOptions { - main_fields: vec!["module".into(), "main".into()], - ..ResolveOptions::default() - }); - - let resolution = resolver2.resolve(&f, "pck2").map(|r| r.full_path()); - assert_eq!(resolution, Ok(f.join("node_modules/pck2/module.js"))); -} diff --git a/src/tests/memory_fs.rs b/src/tests/memory_fs.rs deleted file mode 100644 index e4116609..00000000 --- a/src/tests/memory_fs.rs +++ /dev/null @@ -1,74 +0,0 @@ -use std::{ - io, - path::{Path, PathBuf}, -}; - -use crate::{FileMetadata, FileSystem}; - -#[derive(Default)] -pub struct MemoryFS { - fs: vfs::MemoryFS, -} - -impl MemoryFS { - /// # Panics - /// - /// * Fails to create directory - /// * Fails to write file - #[allow(dead_code)] - pub fn new(data: &[(&'static str, &'static str)]) -> Self { - let mut fs = Self { fs: vfs::MemoryFS::default() }; - for (path, content) in data { - fs.add_file(Path::new(path), content); - } - fs - } - - #[allow(dead_code)] - pub fn add_file(&mut self, path: &Path, content: &str) { - use vfs::FileSystem; - let fs = &mut self.fs; - // Create all parent directories - for path in path.ancestors().collect::>().iter().rev() { - let path = path.to_string_lossy(); - if !fs.exists(path.as_ref()).unwrap() { - fs.create_dir(path.as_ref()).unwrap(); - } - } - // Create file - let mut file = fs.create_file(path.to_string_lossy().as_ref()).unwrap(); - file.write_all(content.as_bytes()).unwrap(); - } -} - -impl FileSystem for MemoryFS { - fn read_to_string(&self, path: &Path) -> io::Result { - use vfs::FileSystem; - let mut file = self - .fs - .open_file(path.to_string_lossy().as_ref()) - .map_err(|err| io::Error::new(io::ErrorKind::NotFound, err))?; - let mut buffer = String::new(); - file.read_to_string(&mut buffer).unwrap(); - Ok(buffer) - } - - fn metadata(&self, path: &Path) -> io::Result { - use vfs::FileSystem; - let metadata = self - .fs - .metadata(path.to_string_lossy().as_ref()) - .map_err(|err| io::Error::new(io::ErrorKind::NotFound, err))?; - let is_file = metadata.file_type == vfs::VfsFileType::File; - let is_dir = metadata.file_type == vfs::VfsFileType::Directory; - Ok(FileMetadata::new(is_file, is_dir, false)) - } - - fn symlink_metadata(&self, path: &Path) -> io::Result { - self.metadata(path) - } - - fn canonicalize(&self, _path: &Path) -> io::Result { - Err(io::Error::new(io::ErrorKind::NotFound, "not a symlink")) - } -} diff --git a/src/tests/missing.rs b/src/tests/missing.rs deleted file mode 100644 index 4bf611ef..00000000 --- a/src/tests/missing.rs +++ /dev/null @@ -1,106 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/missing.test.js - -use normalize_path::NormalizePath; - -use crate::{AliasValue, ResolveContext, ResolveOptions, Resolver}; - -#[test] -fn test() { - let f = super::fixture(); - - let data = [ - ( - "./missing-file", - vec![f.join("missing-file"), f.join("missing-file.js"), f.join("missing-file.node")], - ), - ( - "missing-module", - vec![ - f.join("node_modules/missing-module"), - f.parent().unwrap().join("node_modules"), // enhanced-resolve is "node_modules/missing-module" - ], - ), - ( - "missing-module/missing-file", - vec![ - f.join("node_modules/missing-module"), - // f.parent().unwrap().join("node_modules/missing-module"), // we don't report this - ], - ), - ( - "m1/missing-file", - vec![ - f.join("node_modules/m1/missing-file"), - f.join("node_modules/m1/missing-file.js"), - f.join("node_modules/m1/missing-file.node"), - // f.parent().unwrap().join("node_modules/m1"), // we don't report this - ], - ), - ( - "m1/", - vec![ - f.join("node_modules/m1/index"), - f.join("node_modules/m1/index.js"), - f.join("node_modules/m1/index.json"), - f.join("node_modules/m1/index.node"), - ], - ), - ("m1/a", vec![f.join("node_modules/m1/a")]), - ]; - - let resolver = Resolver::default(); - - for (specifier, missing_dependencies) in data { - let mut ctx = ResolveContext::default(); - let _ = resolver.resolve_with_context(&f, specifier, &mut ctx); - - for path in ctx.file_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - } - - for path in missing_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - assert!( - ctx.missing_dependencies.contains(&path), - "{specifier}: {path:?} not in {:?}", - &ctx.missing_dependencies - ); - } - } -} - -#[test] -fn alias_and_extensions() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias: vec![ - ( - "@scope-js/package-name/dir$".into(), - vec![AliasValue::Path(f.join("foo/index.js").to_string_lossy().to_string())], - ), - ( - "react-dom".into(), - vec![AliasValue::Path(f.join("foo/index.js").to_string_lossy().to_string())], - ), - ], - extensions: vec![".server.ts".into()], - - ..ResolveOptions::default() - }); - - let mut ctx = ResolveContext::default(); - let _ = resolver.resolve_with_context(&f, "@scope-js/package-name/dir/router", &mut ctx); - let _ = resolver.resolve_with_context(&f, "react-dom/client", &mut ctx); - - for path in ctx.file_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - } - - for path in ctx.missing_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - if let Some(path) = path.parent() { - assert!(!path.is_file(), "{path:?} must not be a file"); - } - } -} diff --git a/src/tests/mod.rs b/src/tests/mod.rs deleted file mode 100644 index 94e6bd86..00000000 --- a/src/tests/mod.rs +++ /dev/null @@ -1,49 +0,0 @@ -mod alias; -mod browser_field; -mod builtins; -mod dependencies; -mod exports_field; -mod extension_alias; -mod extensions; -mod fallback; -mod full_specified; -mod imports_field; -mod incorrect_description_file; -mod main_field; -mod memory_fs; -mod missing; -mod resolve; -mod restrictions; -mod roots; -mod scoped_packages; -mod simple; -mod symlink; -mod tsconfig_paths; -mod tsconfig_project_references; - -use crate::Resolver; -use std::{env, path::PathBuf, sync::Arc, thread}; - -pub fn fixture_root() -> PathBuf { - env::current_dir().unwrap().join("fixtures") -} - -pub fn fixture() -> PathBuf { - fixture_root().join("enhanced_resolve").join("test").join("fixtures") -} - -#[test] -fn threaded_environment() { - let cwd = env::current_dir().unwrap(); - let resolver = Arc::new(Resolver::default()); - for _ in 0..2 { - _ = thread::spawn({ - let cwd = cwd.clone(); - let resolver = Arc::clone(&resolver); - move || { - _ = resolver.resolve(cwd, "."); - } - }) - .join(); - } -} diff --git a/src/tests/resolve.rs b/src/tests/resolve.rs deleted file mode 100644 index f2dbb88e..00000000 --- a/src/tests/resolve.rs +++ /dev/null @@ -1,119 +0,0 @@ -//! - -use crate::{ResolveError, ResolveOptions, Resolver}; - -#[test] -fn resolve() { - let f = super::fixture(); - - let resolver = Resolver::default(); - - let main1_js_path = f.join("main1.js").to_string_lossy().to_string(); - - #[rustfmt::skip] - let pass = [ - ("absolute path", f.clone(), main1_js_path.as_str(), f.join("main1.js")), - ("file with .js", f.clone(), "./main1.js", f.join("main1.js")), - ("file without extension", f.clone(), "./main1", f.join("main1.js")), - ("another file with .js", f.clone(), "./a.js", f.join("a.js")), - ("another file without extension", f.clone(), "./a", f.join("a.js")), - ("file in module with .js", f.clone(), "m1/a.js", f.join("node_modules/m1/a.js")), - ("file in module without extension", f.clone(), "m1/a", f.join("node_modules/m1/a.js")), - ("another file in module without extension", f.clone(), "complexm/step1", f.join("node_modules/complexm/step1.js")), - ("from submodule to file in sibling module", f.join("node_modules/complexm"), "m2/b.js", f.join("node_modules/m2/b.js")), - ("from nested directory to overwritten file in module", f.join("multiple_modules"), "m1/a.js", f.join("multiple_modules/node_modules/m1/a.js")), - ("from nested directory to not overwritten file in module", f.join("multiple_modules"), "m1/b.js", f.join("node_modules/m1/b.js")), - ("file with query", f.clone(), "./main1.js?query", f.join("main1.js?query")), - ("file with fragment", f.clone(), "./main1.js#fragment", f.join("main1.js#fragment")), - ("file with fragment and query", f.clone(), "./main1.js#fragment?query", f.join("main1.js#fragment?query")), - ("file with query and fragment", f.clone(), "./main1.js?#fragment", f.join("main1.js?#fragment")), - - ("file with query (unicode)", f.clone(), "./测试.js?query", f.join("测试.js?query")), - ("file with fragment (unicode)", f.clone(), "./测试.js#fragment", f.join("测试.js#fragment")), - ("file with fragment and query (unicode)", f.clone(), "./测试.js#fragment?query", f.join("测试.js#fragment?query")), - ("file with query and fragment (unicode)", f.clone(), "./测试.js?#fragment", f.join("测试.js?#fragment")), - - ("file in module with query", f.clone(), "m1/a?query", f.join("node_modules/m1/a.js?query")), - ("file in module with fragment", f.clone(), "m1/a#fragment", f.join("node_modules/m1/a.js#fragment")), - ("file in module with fragment and query", f.clone(), "m1/a#fragment?query", f.join("node_modules/m1/a.js#fragment?query")), - ("file in module with query and fragment", f.clone(), "m1/a?#fragment", f.join("node_modules/m1/a.js?#fragment")), - ("file in module with query and fragment", f.clone(), "m1/a?#fragment", f.join("node_modules/m1/a.js?#fragment")), - ("differ between directory and file, resolve file", f.clone(), "./dirOrFile", f.join("dirOrFile.js")), - ("differ between directory and file, resolve directory", f.clone(), "./dirOrFile/", f.join("dirOrFile/index.js")), - ("find node_modules outside of node_modules", f.join("browser-module/node_modules"), "m1/a", f.join("node_modules/m1/a.js")), - ("don't crash on main field pointing to self", f.clone(), "./main-field-self", f.join("./main-field-self/index.js")), - ("don't crash on main field pointing to self (2)", f.clone(), "./main-field-self2", f.join("./main-field-self2/index.js")), - // enhanced-resolve has `#` prepended with a `\0`, they are removed from the - // following 3 expected test results. - // See https://github.com/webpack/enhanced-resolve#escaping - ("handle fragment edge case (no fragment)", f.clone(), "./no#fragment/#/#", f.join("no#fragment/#/#.js")), - ("handle fragment edge case (fragment)", f.clone(), "./no#fragment/#/", f.join("no.js#fragment/#/")), - ("handle fragment escaping", f.clone(), "./no\0#fragment/\0#/\0##fragment", f.join("no#fragment/#/#.js#fragment")), - - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn issue238_resolve() { - let f = super::fixture().join("issue-238"); - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into(), ".jsx".into(), ".ts".into(), ".tsx".into()], - modules: vec!["src/a".into(), "src/b".into(), "src/common".into(), "node_modules".into()], - ..ResolveOptions::default() - }); - let resolved_path = - resolver.resolve(f.join("src/common"), "config/myObjectFile").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("src/common/config/myObjectFile.js")),); -} - -#[test] -fn prefer_relative() { - let f = super::fixture(); - - let resolver = - Resolver::new(ResolveOptions { prefer_relative: true, ..ResolveOptions::default() }); - - #[rustfmt::skip] - let pass = [ - ("should correctly resolve with preferRelative 1", "main1.js", f.join("main1.js")), - ("should correctly resolve with preferRelative 2", "m1/a.js", f.join("node_modules/m1/a.js")), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } -} - -#[test] -fn resolve_to_context() { - let f = super::fixture(); - let resolver = - Resolver::new(ResolveOptions { resolve_to_context: true, ..ResolveOptions::default() }); - - #[rustfmt::skip] - let data = [ - ("context for fixtures", f.clone(), "./", f.clone()), - ("context for fixtures/lib", f.clone(), "./lib", f.join("lib")), - ("context for fixtures with ..", f.clone(), "./lib/../../fixtures/./lib/..", f.clone()), - ("context for fixtures with query", f.clone(), "./?query", f.clone().with_file_name("fixtures?query")), - ]; - - for (comment, path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn resolve_hash_as_module() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions::default()); - let resolution = resolver.resolve(f, "#a"); - assert_eq!(resolution, Err(ResolveError::NotFound("#a".into()))); -} diff --git a/src/tests/restrictions.rs b/src/tests/restrictions.rs deleted file mode 100644 index 5ba56596..00000000 --- a/src/tests/restrictions.rs +++ /dev/null @@ -1,25 +0,0 @@ -//! - -use crate::{ResolveError, ResolveOptions, Resolver, Restriction}; - -// TODO: regex -// * should respect RegExp restriction -// * should try to find alternative #1 -// * should try to find alternative #2 -// * should try to find alternative #3 - -// should respect string restriction -#[test] -fn restriction1() { - let fixture = super::fixture(); - let f = fixture.join("restrictions"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - restrictions: vec![Restriction::Path(f.clone())], - ..ResolveOptions::default() - }); - - let resolution = resolver.resolve(&f, "pck2"); - assert_eq!(resolution, Err(ResolveError::Restriction(fixture.join("c.js"), f))); -} diff --git a/src/tests/roots.rs b/src/tests/roots.rs deleted file mode 100644 index b50e2a07..00000000 --- a/src/tests/roots.rs +++ /dev/null @@ -1,92 +0,0 @@ -//! - -use std::path::PathBuf; - -use crate::{AliasValue, ResolveError, ResolveOptions, Resolver}; - -fn dirname() -> PathBuf { - super::fixture_root().join("enhanced_resolve").join("test") -} - -#[test] -fn roots() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - alias: vec![("foo".into(), vec![AliasValue::from("/fixtures")])], - roots: vec![dirname(), f.clone()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should respect roots option", "/fixtures/b.js", f.join("b.js")), - ("should try another root option, if it exists", "/b.js", f.join("b.js")), - ("should respect extension", "/fixtures/b", f.join("b.js")), - ("should resolve in directory", "/fixtures/extensions/dir", f.join("extensions/dir/index.js")), - ("should respect aliases", "foo/b", f.join("b.js")), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } - - #[rustfmt::skip] - let fail = [ - ("should not work with relative path", "fixtures/b.js", ResolveError::NotFound("fixtures/b.js".into())) - ]; - - for (comment, request, expected) in fail { - let resolution = resolver.resolve(&f, request); - assert_eq!(resolution, Err(expected), "{comment} {request}"); - } -} - -#[test] -fn resolve_to_context() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - roots: vec![dirname(), f.clone()], - resolve_to_context: true, - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f, "/fixtures/lib").map(|r| r.full_path()); - let expected = f.join("lib"); - assert_eq!(resolved_path, Ok(expected)); -} - -#[test] -fn prefer_absolute() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - alias: vec![("foo".into(), vec![AliasValue::from("/fixtures")])], - roots: vec![dirname(), f.clone()], - prefer_absolute: true, - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve an absolute path (prefer absolute)", f.join("b.js").to_string_lossy().to_string(), f.join("b.js")), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(&f, &request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } -} - -#[test] -fn roots_fall_through() { - let f = super::fixture(); - let absolute_path = f.join("roots_fall_through/index.js"); - let specifier = absolute_path.to_string_lossy(); - let resolution = Resolver::new(ResolveOptions::default().with_root(&f)).resolve(&f, &specifier); - assert_eq!( - resolution.map(super::super::resolution::Resolution::into_path_buf), - Ok(absolute_path) - ); -} diff --git a/src/tests/scoped_packages.rs b/src/tests/scoped_packages.rs deleted file mode 100644 index 8258f00f..00000000 --- a/src/tests/scoped_packages.rs +++ /dev/null @@ -1,25 +0,0 @@ -//! - -use crate::{ResolveOptions, Resolver}; - -#[test] -fn scoped_packages() { - let f = super::fixture().join("scoped"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("main field should work", f.clone(), "@scope/pack1", f.join("./node_modules/@scope/pack1/main.js")), - ("browser field should work", f.clone(), "@scope/pack2", f.join("./node_modules/@scope/pack2/main.js")), - ("folder request should work", f.clone(), "@scope/pack2/lib", f.join("./node_modules/@scope/pack2/lib/index.js")) - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} diff --git a/src/tests/simple.rs b/src/tests/simple.rs deleted file mode 100644 index 08e1238a..00000000 --- a/src/tests/simple.rs +++ /dev/null @@ -1,68 +0,0 @@ -//! - -use std::env; - -use crate::Resolver; - -#[test] -fn simple() { - // mimic `enhanced-resolve/test/simple.test.js` - let dirname = env::current_dir().unwrap().join("fixtures"); - let f = dirname.join("enhanced_resolve/test"); - - let resolver = Resolver::default(); - - let data = [ - ("direct", f.clone(), "../lib/index"), - ("as directory", f, ".."), - ("as module", dirname.clone(), "./enhanced_resolve"), - ]; - - for (comment, path, request) in data { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - let expected = dirname.join("enhanced_resolve/lib/index.js"); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn dashed_name() { - let f = super::fixture(); - - let resolver = Resolver::default(); - - let data = [ - (f.clone(), "dash", f.join("node_modules/dash/index.js")), - (f.clone(), "dash-name", f.join("node_modules/dash-name/index.js")), - (f.join("node_modules/dash"), "dash", f.join("node_modules/dash/index.js")), - (f.join("node_modules/dash"), "dash-name", f.join("node_modules/dash-name/index.js")), - (f.join("node_modules/dash-name"), "dash", f.join("node_modules/dash/index.js")), - (f.join("node_modules/dash-name"), "dash-name", f.join("node_modules/dash-name/index.js")), - ]; - - for (path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{path:?} {request}"); - } -} - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows { - use super::super::memory_fs::MemoryFS; - - use crate::ResolveOptions; - - #[test] - fn no_package() { - use crate::ResolverGeneric; - use std::path::Path; - let f = Path::new("/"); - let file_system = MemoryFS::new(&[]); - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions::default(), - ); - let resolved_path = resolver.resolve(f, "package"); - assert!(resolved_path.is_err()); - } -} diff --git a/src/tests/symlink.rs b/src/tests/symlink.rs deleted file mode 100644 index 7589b560..00000000 --- a/src/tests/symlink.rs +++ /dev/null @@ -1,121 +0,0 @@ -use std::{fs, io, path::Path}; - -use crate::{ResolveOptions, Resolver}; - -#[derive(Debug, Clone, Copy)] -enum FileType { - File, - Dir, -} - -#[allow(unused_variables)] -fn symlink, Q: AsRef>( - original: P, - link: Q, - file_type: FileType, -) -> io::Result<()> { - #[cfg(target_family = "unix")] - { - std::os::unix::fs::symlink(original, link) - } - - #[cfg(target_family = "windows")] - match file_type { - FileType::File => std::os::windows::fs::symlink_file(original, link), - FileType::Dir => std::os::windows::fs::symlink_dir(original, link), - } -} - -fn init(dirname: &Path, temp_path: &Path) -> io::Result<()> { - if temp_path.exists() { - _ = fs::remove_dir_all(temp_path); - } - fs::create_dir(temp_path)?; - symlink(dirname.join("../lib/index.js"), temp_path.join("test"), FileType::File)?; - symlink(dirname.join("../lib"), temp_path.join("test2"), FileType::Dir)?; - fs::remove_file(temp_path.join("test"))?; - fs::remove_file(temp_path.join("test2"))?; - fs::remove_dir(temp_path) -} - -fn create_symlinks(dirname: &Path, temp_path: &Path) -> io::Result<()> { - fs::create_dir(temp_path).unwrap(); - symlink( - dirname.join("../lib/index.js").canonicalize().unwrap(), - temp_path.join("index.js"), - FileType::File, - )?; - symlink(dirname.join("../lib").canonicalize().unwrap(), temp_path.join("lib"), FileType::Dir)?; - symlink(dirname.join("..").canonicalize().unwrap(), temp_path.join("this"), FileType::Dir)?; - symlink(temp_path.join("this"), temp_path.join("that"), FileType::Dir)?; - symlink(Path::new("../../lib/index.js"), temp_path.join("node.relative.js"), FileType::File)?; - symlink( - Path::new("./node.relative.js"), - temp_path.join("node.relative.sym.js"), - FileType::File, - )?; - Ok(()) -} - -fn cleanup_symlinks(temp_path: &Path) { - _ = fs::remove_dir_all(temp_path); -} - -#[test] -fn test() -> io::Result<()> { - let root = super::fixture_root().join("enhanced_resolve"); - let dirname = root.join("test"); - let temp_path = dirname.join("temp"); - if !temp_path.exists() { - let is_admin = init(&dirname, &temp_path).is_ok(); - if !is_admin { - return Ok(()); - } - if let Err(err) = create_symlinks(&dirname, &temp_path) { - cleanup_symlinks(&temp_path); - return Err(err); - } - } - - let resolver_without_symlinks = - Resolver::new(ResolveOptions { symlinks: false, ..ResolveOptions::default() }); - let resolver_with_symlinks = Resolver::default(); - - #[rustfmt::skip] - let pass = [ - ("with a symlink to a file", temp_path.clone(), "./index.js"), - ("with a relative symlink to a file", temp_path.clone(), "./node.relative.js"), - ("with a relative symlink to a symlink to a file", temp_path.clone(), "./node.relative.sym.js"), - ("with a symlink to a directory 1", temp_path.clone(), "./lib/index.js"), - ("with a symlink to a directory 2", temp_path.clone(), "./this/lib/index.js"), - ("with multiple symlinks in the path 1", temp_path.clone(), "./this/test/temp/index.js"), - ("with multiple symlinks in the path 2", temp_path.clone(), "./this/test/temp/lib/index.js"), - ("with multiple symlinks in the path 3", temp_path.clone(), "./this/test/temp/this/lib/index.js"), - ("with a symlink to a directory 2 (chained)", temp_path.clone(), "./that/lib/index.js"), - ("with multiple symlinks in the path 1 (chained)", temp_path.clone(), "./that/test/temp/index.js"), - ("with multiple symlinks in the path 2 (chained)", temp_path.clone(), "./that/test/temp/lib/index.js"), - ("with multiple symlinks in the path 3 (chained)", temp_path.clone(), "./that/test/temp/that/lib/index.js"), - ("with symlinked directory as context 1", temp_path.join( "lib"), "./index.js"), - ("with symlinked directory as context 2", temp_path.join( "this"), "./lib/index.js"), - ("with symlinked directory as context and in path", temp_path.join( "this"), "./test/temp/lib/index.js"), - ("with symlinked directory in context path", temp_path.join( "this/lib"), "./index.js"), - ("with symlinked directory in context path and symlinked file", temp_path.join( "this/test"), "./temp/index.js"), - ("with symlinked directory in context path and symlinked directory", temp_path.join( "this/test"), "./temp/lib/index.js"), - ("with symlinked directory as context 2 (chained)", temp_path.join( "that"), "./lib/index.js"), - ("with symlinked directory as context and in path (chained)", temp_path.join( "that"), "./test/temp/lib/index.js"), - ("with symlinked directory in context path (chained)", temp_path.join( "that/lib"), "./index.js"), - ("with symlinked directory in context path and symlinked file (chained)", temp_path.join( "that/test"), "./temp/index.js"), - ("with symlinked directory in context path and symlinked directory (chained)", temp_path.join( "that/test"), "./temp/lib/index.js") - ]; - - for (comment, path, request) in pass { - let filename = resolver_with_symlinks.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(filename, Ok(root.join("lib/index.js")), "{comment:?}"); - - let resolved_path = - resolver_without_symlinks.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(path.join(request))); - } - - Ok(()) -} diff --git a/src/tests/tsconfig_paths.rs b/src/tests/tsconfig_paths.rs deleted file mode 100644 index 26935b5c..00000000 --- a/src/tests/tsconfig_paths.rs +++ /dev/null @@ -1,507 +0,0 @@ -//! tests for tsconfig-paths -//! -//! Fixtures copied from . - -use std::path::{Path, PathBuf}; - -use crate::{ - ResolveError, ResolveOptions, Resolver, TsConfig, TsconfigOptions, TsconfigReferences, -}; - -// -#[test] -fn tsconfig() { - let f = super::fixture_root().join("tsconfig"); - - #[rustfmt::skip] - let pass = [ - (f.clone(), None, "ts-path", f.join("foo.js")), - (f.join("nested"), None, "ts-path", f.join("nested/test.js")), - (f.join("cases/index"), None, "foo", f.join("node_modules/tsconfig-index/foo.js")), - // This requires reading package.json.tsconfig field - // (f.join("cases/field"), "foo", f.join("node_modules/tsconfig-field/foo.js")) - (f.join("cases/exports"), None, "foo", f.join("node_modules/tsconfig-exports/foo.js")), - (f.join("cases/extends-extension"), None, "foo", f.join("cases/extends-extension/foo.js")), - (f.join("cases/extends-extensionless"), None, "foo", f.join("node_modules/tsconfig-field/foo.js")), - (f.join("cases/extends-paths"), Some("src"), "@/index", f.join("cases/extends-paths/src/index.js")), - (f.join("cases/extends-multiple"), None, "foo", f.join("cases/extends-multiple/foo.js")), - ]; - - for (dir, subdir, request, expected) in pass { - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: dir.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - let path = subdir.map_or(dir.clone(), |subdir| dir.join(subdir)); - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{request} {path:?}"); - } - - #[rustfmt::skip] - let data = [ - (f.join("node_modules/tsconfig-not-used"), "ts-path", Ok(f.join("foo.js"))), - ]; - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - for (path, request, expected) in data { - let resolution = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolution, expected, "{path:?} {request}"); - } -} - -#[test] -fn tsconfig_fallthrough() { - let f = super::fixture_root().join("tsconfig"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "/"); - assert_eq!(resolved_path, Err(ResolveError::NotFound("/".into()))); -} - -#[test] -fn json_with_comments() { - let f = super::fixture_root().join("tsconfig/cases/trailing-comma"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "foo").map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(f.join("bar.js"))); -} - -// -#[test] -fn test_paths() { - let path = Path::new("/foo/tsconfig.json"); - let mut tsconfig_json = serde_json::json!({ - "compilerOptions": { - "paths": { - "jquery": ["node_modules/jquery/dist/jquery"], - "*": ["generated/*"], - "bar/*": ["test/*"], - "bar/baz/*": ["baz/*", "yo/*"], - "@/components/*": ["components/*"], - "url": ["node_modules/my-url"], - } - } - }) - .to_string(); - let tsconfig = TsConfig::parse(true, path, &mut tsconfig_json).unwrap(); - - let data = [ - ("jquery", vec!["/foo/node_modules/jquery/dist/jquery"]), - ("test", vec!["/foo/generated/test"]), - ("test/hello", vec!["/foo/generated/test/hello"]), - ("bar/hi", vec!["/foo/test/hi"]), - ("bar/baz/hi", vec!["/foo/baz/hi", "/foo/yo/hi"]), - ("@/components/button", vec!["/foo/components/button"]), - ("./jquery", vec![]), - ("url", vec!["/foo/node_modules/my-url"]), - ]; - - for (specifier, expected) in data { - let paths = tsconfig.resolve_path_alias(specifier); - let expected = expected.into_iter().map(PathBuf::from).collect::>(); - assert_eq!(paths, expected, "{specifier}"); - } -} - -// -#[test] -fn test_base_url() { - let path = Path::new("/foo/tsconfig.json"); - let mut tsconfig_json = serde_json::json!({ - "compilerOptions": { - "baseUrl": "./src" - } - }) - .to_string(); - let tsconfig = TsConfig::parse(true, path, &mut tsconfig_json).unwrap(); - - let data = [ - ("foo", vec!["/foo/src/foo"]), - ("components/button", vec!["/foo/src/components/button"]), - ("./jquery", vec![]), - ]; - - for (specifier, expected) in data { - let paths = tsconfig.resolve_path_alias(specifier); - let expected = expected.into_iter().map(PathBuf::from).collect::>(); - assert_eq!(paths, expected, "{specifier}"); - } -} - -// -#[test] -fn test_paths_and_base_url() { - let path = Path::new("/foo/tsconfig.json"); - let mut tsconfig_json = serde_json::json!({ - "compilerOptions": { - "baseUrl": "./src", - "paths": { - "*": ["generated/*"], - "bar/*": ["test/*"], - "bar/baz/*": ["baz/*", "yo/*"], - "@/components/*": ["components/*"] - } - } - }) - .to_string(); - let tsconfig = TsConfig::parse(true, path, &mut tsconfig_json).unwrap(); - - let data = [ - ("test", vec!["/foo/src/generated/test", "/foo/src/test"]), - ("test/hello", vec!["/foo/src/generated/test/hello", "/foo/src/test/hello"]), - ("bar/hi", vec!["/foo/src/test/hi", "/foo/src/bar/hi"]), - ("bar/baz/hi", vec!["/foo/src/baz/hi", "/foo/src/yo/hi", "/foo/src/bar/baz/hi"]), - ("@/components/button", vec!["/foo/src/components/button", "/foo/src/@/components/button"]), - ("./jquery", vec![]), - ]; - - for (specifier, expected) in data { - let paths = tsconfig.resolve_path_alias(specifier); - let expected = expected.into_iter().map(PathBuf::from).collect::>(); - assert_eq!(paths, expected, "{specifier}"); - } -} - -// Template variable ${configDir} for substitution of config files directory path -// https://github.com/microsoft/TypeScript/pull/58042 -#[test] -fn test_template_variable() { - let f = super::fixture_root().join("tsconfig"); - let f2 = f.join("cases").join("paths_template_variable"); - - #[rustfmt::skip] - let pass = [ - (f2.clone(), "tsconfig1.json", "foo", f2.join("foo.js")), - (f2.clone(), "tsconfig2.json", "foo", f2.join("foo.js")), - (f.clone(), "tsconfig_template_variable.json", "foo", f.join("foo.js")), - ]; - - for (dir, tsconfig, request, expected) in pass { - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: dir.join(tsconfig), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&dir, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{request} {tsconfig} {dir:?}"); - } -} - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows_test { - use std::path::{Path, PathBuf}; - - use crate::{ - ResolveError, ResolveOptions, ResolverGeneric, TsconfigOptions, TsconfigReferences, - }; - - use super::super::memory_fs::MemoryFS; - - struct OneTest { - name: &'static str, - tsconfig: String, - package_json: Option<(PathBuf, String)>, - main_fields: Option>, - existing_files: Vec<&'static str>, - requested_module: &'static str, - expected_path: &'static str, - extensions: Vec, - } - - impl Default for OneTest { - fn default() -> Self { - Self { - name: "", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/*": ["location/*"] - } - } - }) - .to_string(), - package_json: None, - main_fields: None, - existing_files: vec![], - requested_module: "", - expected_path: "", - extensions: vec![ - ".js".into(), - ".json".into(), - ".node".into(), - ".ts".into(), - ".tsx".into(), - ], - } - } - } - - impl OneTest { - fn resolver(&self, root: &Path) -> ResolverGeneric { - let mut file_system = MemoryFS::default(); - - file_system.add_file(&root.join("tsconfig.json"), &self.tsconfig); - if let Some((path, package_json)) = &self.package_json { - file_system.add_file(&root.join(path).join("package.json"), package_json); - } - for path in &self.existing_files { - file_system.add_file(Path::new(path), ""); - } - - let mut options = ResolveOptions { - extensions: self.extensions.clone(), - tsconfig: Some(TsconfigOptions { - config_file: root.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }; - if let Some(main_fields) = &self.main_fields { - options.main_fields.clone_from(main_fields); - } - - ResolverGeneric::::new_with_file_system(file_system, options) - } - } - - // Path matching tests from tsconfig-paths - // * - // * - #[test] - fn match_path() { - let pass = [ - OneTest { - name: "should locate path that matches with star and exists", - existing_files: vec!["/root/location/mylib/index.ts"], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve to correct path when many are specified", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/*": ["foo1/*", "foo2/*", "location/*", "foo3/*"], - } - } - }) - .to_string(), - existing_files: vec!["/root/location/mylib/index.ts"], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should locate path that matches with star and prioritize pattern with longest prefix", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "*": ["location/*"], - "lib/*": ["location/*"], - } - } - }) - .to_string(), - existing_files: vec![ - "/root/location/lib/mylib/index.ts", - "/root/location/mylib/index.ts", - ], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should locate path that matches with star and exists with extension", - existing_files: vec![ - "/root/location/mylib.myext", - ], - requested_module: "lib/mylib", - extensions: vec![".js".into(), ".myext".into()], - expected_path: "/root/location/mylib.myext", - ..OneTest::default() - }, - OneTest { - name: "should resolve request with extension specified", - existing_files: vec![ - "/root/location/test.jpg", - ], - requested_module: "lib/test.jpg", - expected_path: "/root/location/test.jpg", - ..OneTest::default() - }, - OneTest { - name: "should locate path that matches without star and exists", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/foo": ["location/foo"] - } - } - }) - .to_string(), - existing_files: vec![ - "/root/location/foo.ts", - ], - requested_module: "lib/foo", - expected_path: "/root/location/foo.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve to parent folder when filename is in subfolder", - existing_files: vec![ - "/root/location/mylib/index.ts", - ], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve from main field in package.json", - package_json: Some((PathBuf::from("/root/location/mylib"), serde_json::json!({ - "main": "./kalle.ts" - }).to_string())), - existing_files: vec![ - "/root/location/mylib/kalle.ts", - ], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/kalle.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve from main field in package.json (js)", - package_json: Some((PathBuf::from("/root/location/mylib.js"), serde_json::json!({ - "main": "./kalle.js" - }).to_string())), - existing_files: vec![ - "/root/location/mylib.js/kalle.js", - ], - extensions: vec![".ts".into(), ".js".into()], - requested_module: "lib/mylib.js", - expected_path: "/root/location/mylib.js/kalle.js", - ..OneTest::default() - }, - OneTest { - name: "should resolve from list of fields by priority in package.json", - main_fields: Some(vec!["missing".into(), "browser".into(), "main".into()]), - package_json: Some((PathBuf::from("/root/location/mylibjs"), serde_json::json!({ - "main": "./main.js", - "browser": "./browser.js" - }).to_string())), - existing_files: vec![ - "/root/location/mylibjs/main.js", - "/root/location/mylibjs/browser.js", - ], - extensions: vec![".ts".into(), ".js".into()], - requested_module: "lib/mylibjs", - expected_path: "/root/location/mylibjs/browser.js", - ..OneTest::default() - }, -OneTest { - name: "should ignore field mappings to missing files in package.json", - main_fields: Some(vec!["browser".into(), "main".into()]), - package_json: Some((PathBuf::from("/root/location/mylibjs"), serde_json::json!({ - "main": "./kalle.js", - "browser": "./nope.js" - }).to_string())), - existing_files: vec![ - "/root/location/mylibjs/kalle.js", - ], - extensions: vec![".ts".into(), ".js".into()], - requested_module: "lib/mylibjs", - expected_path: "/root/location/mylibjs/kalle.js", - ..OneTest::default() - }, - // Tests that are not applicable: - // name: "should resolve nested main fields" - // name: "should ignore advanced field mappings in package.json" - // name: "should resolve to with the help of baseUrl when not explicitly set" - // name: "should not resolve with the help of baseUrl when asked not to" - // name: "should resolve main file with cjs file extension" - OneTest { - name: "should resolve .ts from .js alias", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "@/*": ["src/*"] - } - } - }).to_string(), - existing_files: vec![ - "/root/src/foo.ts", - ], - requested_module: "@/foo", // original data was "@/foo.ts" but I don't get why it is the case? - expected_path: "/root/src/foo.ts", // original data was "/root/src/foo" - ..OneTest::default() - }, - ]; - - let root = PathBuf::from("/root"); - - for test in pass { - let resolved_path = - test.resolver(&root).resolve(&root, test.requested_module).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(PathBuf::from(test.expected_path)), "{}", test.name); - } - - let fail = [ - OneTest { - name: "should not locate path that does not match", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/*": ["location/*"] - } - } - }) - .to_string(), - existing_files: vec!["/root/location/mylib"], - requested_module: "lib/mylibjs", - ..OneTest::default() - }, - OneTest { - name: "should not resolve typings file (index.d.ts)", - existing_files: vec!["/root/location/mylib/index.d.ts"], - requested_module: "lib/mylib", - ..OneTest::default() - }, - ]; - - for test in fail { - let resolved_path = - test.resolver(&root).resolve(&root, test.requested_module).map(|f| f.full_path()); - assert_eq!( - resolved_path, - Err(ResolveError::NotFound(test.requested_module.into())), - "{}", - test.name - ); - } - } -} diff --git a/src/tests/tsconfig_project_references.rs b/src/tests/tsconfig_project_references.rs deleted file mode 100644 index b552fefe..00000000 --- a/src/tests/tsconfig_project_references.rs +++ /dev/null @@ -1,101 +0,0 @@ -//! Tests for tsconfig project references - -use crate::{ResolveError, ResolveOptions, Resolver, TsconfigOptions, TsconfigReferences}; - -#[test] -fn auto() { - let f = super::fixture_root().join("tsconfig/cases/project_references"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("app"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - // Test normal paths alias - (f.join("app"), "@/index.ts", f.join("app/aliased/index.ts")), - (f.join("app"), "@/../index.ts", f.join("app/index.ts")), - // Test project reference - (f.join("project_a"), "@/index.ts", f.join("project_a/aliased/index.ts")), - (f.join("project_b/src"), "@/index.ts", f.join("project_b/src/aliased/index.ts")), - // Does not have paths alias - (f.join("project_a"), "./index.ts", f.join("project_a/index.ts")), - (f.join("project_c"), "./index.ts", f.join("project_c/index.ts")), - // Template variable - { - let dir = f.parent().unwrap().join("paths_template_variable"); - (dir.clone(), "foo", dir.join("foo.js")) - } - ]; - - for (path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{request} {path:?}"); - } -} - -#[test] -fn disabled() { - let f = super::fixture_root().join("tsconfig/cases/project_references"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("app"), - references: TsconfigReferences::Disabled, - }), - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - // Test normal paths alias - (f.join("app"), "@/index.ts", Ok(f.join("app/aliased/index.ts"))), - (f.join("app"), "@/../index.ts", Ok(f.join("app/index.ts"))), - // Test project reference - (f.join("project_a"), "@/index.ts", Err(ResolveError::NotFound("@/index.ts".into()))), - (f.join("project_b/src"), "@/index.ts", Err(ResolveError::NotFound("@/index.ts".into()))), - // Does not have paths alias - (f.join("project_a"), "./index.ts", Ok(f.join("project_a/index.ts"))), - (f.join("project_c"), "./index.ts", Ok(f.join("project_c/index.ts"))), - ]; - - for (path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, expected, "{request} {path:?}"); - } -} - -#[test] -fn manual() { - let f = super::fixture_root().join("tsconfig/cases/project_references"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("app"), - references: TsconfigReferences::Paths(vec!["../project_a/conf.json".into()]), - }), - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - // Test normal paths alias - (f.join("app"), "@/index.ts", Ok(f.join("app/aliased/index.ts"))), - (f.join("app"), "@/../index.ts", Ok(f.join("app/index.ts"))), - // Test project reference - (f.join("project_a"), "@/index.ts", Ok(f.join("project_a/aliased/index.ts"))), - (f.join("project_b/src"), "@/index.ts", Err(ResolveError::NotFound("@/index.ts".into()))), - // Does not have paths alias - (f.join("project_a"), "./index.ts", Ok(f.join("project_a/index.ts"))), - (f.join("project_c"), "./index.ts", Ok(f.join("project_c/index.ts"))), - ]; - - for (path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, expected, "{request} {path:?}"); - } -} diff --git a/src/tsconfig.rs b/src/tsconfig.rs deleted file mode 100644 index aa00f6e4..00000000 --- a/src/tsconfig.rs +++ /dev/null @@ -1,212 +0,0 @@ -use std::{ - path::{Path, PathBuf}, - sync::Arc, -}; - -use serde::Deserialize; -use typescript_tsconfig_json::{CompilerOptionsPathsMap, ExtendsField}; - -use crate::PathUtil; - -#[derive(Debug, Deserialize)] -#[serde(rename_all = "camelCase")] -pub struct TsConfig { - /// Whether this is the caller tsconfig. - /// Used for final template variable substitution when all configs are extended and merged. - #[serde(skip)] - root: bool, - - /// Path to `tsconfig.json`. Contains the `tsconfig.json` filename. - #[serde(skip)] - path: PathBuf, - - #[serde(default)] - pub extends: Option, - - #[serde(default)] - pub compiler_options: CompilerOptions, - - /// Bubbled up project references with a reference to their tsconfig. - #[serde(default)] - pub references: Vec, -} - -/// Compiler Options -/// -/// -#[derive(Debug, Default, Deserialize)] -#[serde(rename_all = "camelCase")] -pub struct CompilerOptions { - base_url: Option, - - /// Path aliases - paths: Option, - - /// The actual base for where path aliases are resolved from. - #[serde(skip)] - paths_base: PathBuf, -} - -/// Project Reference -/// -/// -#[derive(Debug, Deserialize)] -pub struct ProjectReference { - /// The path property of each reference can point to a directory containing a tsconfig.json file, - /// or to the config file itself (which may have any name). - pub path: PathBuf, - - /// Reference to the resolved tsconfig - #[serde(skip)] - pub tsconfig: Option>, -} - -impl TsConfig { - pub fn parse(root: bool, path: &Path, json: &mut str) -> Result { - _ = json_strip_comments::strip(json); - let mut tsconfig: Self = serde_json::from_str(json)?; - tsconfig.root = root; - tsconfig.path = path.to_path_buf(); - let directory = tsconfig.directory().to_path_buf(); - if let Some(base_url) = tsconfig.compiler_options.base_url { - tsconfig.compiler_options.base_url = Some(directory.normalize_with(base_url)); - } - if tsconfig.compiler_options.paths.is_some() { - tsconfig.compiler_options.paths_base = - tsconfig.compiler_options.base_url.as_ref().map_or(directory, Clone::clone); - } - Ok(tsconfig) - } - - pub fn build(mut self) -> Self { - if self.root { - let dir = self.directory().to_path_buf(); - // Substitute template variable in `tsconfig.compilerOptions.paths` - if let Some(paths) = &mut self.compiler_options.paths { - for paths in paths.values_mut() { - for path in paths { - Self::substitute_template_variable(&dir, path); - } - } - } - } - self - } - - /// Directory to `tsconfig.json` - /// - /// # Panics - /// - /// * When the `tsconfig.json` path is misconfigured. - pub fn directory(&self) -> &Path { - debug_assert!(self.path.file_name().is_some()); - self.path.parent().unwrap() - } - - pub fn extend_tsconfig(&mut self, tsconfig: &Self) { - let compiler_options = &mut self.compiler_options; - if compiler_options.paths.is_none() { - compiler_options.paths_base = compiler_options - .base_url - .as_ref() - .map_or_else(|| tsconfig.compiler_options.paths_base.clone(), Clone::clone); - compiler_options.paths.clone_from(&tsconfig.compiler_options.paths); - } - if compiler_options.base_url.is_none() { - compiler_options.base_url.clone_from(&tsconfig.compiler_options.base_url); - } - } - - pub fn resolve(&self, path: &Path, specifier: &str) -> Vec { - if path.starts_with(self.base_path()) { - let paths = self.resolve_path_alias(specifier); - if !paths.is_empty() { - return paths; - } - } - for tsconfig in self.references.iter().filter_map(|reference| reference.tsconfig.as_ref()) { - if path.starts_with(tsconfig.base_path()) { - return tsconfig.resolve_path_alias(specifier); - } - } - vec![] - } - - // Copied from parcel - // - pub fn resolve_path_alias(&self, specifier: &str) -> Vec { - if specifier.starts_with(|s| s == '/' || s == '.') { - return vec![]; - } - - let base_url_iter = self - .compiler_options - .base_url - .as_ref() - .map_or_else(Vec::new, |base_url| vec![base_url.normalize_with(specifier)]); - - let Some(paths_map) = &self.compiler_options.paths else { - return base_url_iter; - }; - - let paths = paths_map.get(specifier).map_or_else( - || { - let mut longest_prefix_length = 0; - let mut longest_suffix_length = 0; - let mut best_key: Option<&String> = None; - - for key in paths_map.keys() { - if let Some((prefix, suffix)) = key.split_once('*') { - if (best_key.is_none() || prefix.len() > longest_prefix_length) - && specifier.starts_with(prefix) - && specifier.ends_with(suffix) - { - longest_prefix_length = prefix.len(); - longest_suffix_length = suffix.len(); - best_key.replace(key); - } - } - } - - best_key.and_then(|key| paths_map.get(key)).map_or_else(Vec::new, |paths| { - paths - .iter() - .map(|path| { - path.replace( - '*', - &specifier[longest_prefix_length - ..specifier.len() - longest_suffix_length], - ) - }) - .collect::>() - }) - }, - Clone::clone, - ); - - paths - .into_iter() - .map(|p| self.compiler_options.paths_base.normalize_with(p)) - .chain(base_url_iter) - .collect() - } - - fn base_path(&self) -> &Path { - self.compiler_options - .base_url - .as_ref() - .map_or_else(|| self.directory(), |path| path.as_ref()) - } - - /// Template variable `${configDir}` for substitution of config files directory path - /// - /// NOTE: All tests cases are just a head replacement of `${configDir}`, so we are constrained as such. - /// - /// See - fn substitute_template_variable(directory: &Path, path: &mut String) { - const TEMPLATE_VARIABLE: &str = "${configDir}/"; - if let Some(stripped_path) = path.strip_prefix(TEMPLATE_VARIABLE) { - *path = directory.join(stripped_path).to_string_lossy().to_string(); - } - } -} diff --git a/tests/integration_test.rs b/tests/integration_test.rs deleted file mode 100644 index d369413f..00000000 --- a/tests/integration_test.rs +++ /dev/null @@ -1,102 +0,0 @@ -//! Test public APIs - -use std::{env, path::PathBuf}; - -use oxc_resolver::{EnforceExtension, Resolution, ResolveContext, ResolveOptions, Resolver}; - -fn dir() -> PathBuf { - env::current_dir().unwrap() -} - -fn resolve(specifier: &str) -> Resolution { - let path = dir(); - Resolver::new(ResolveOptions::default()).resolve(path, specifier).unwrap() -} - -#[test] -fn clone() { - let resolution = resolve("./tests/package.json"); - assert_eq!(resolution.clone(), resolution); -} - -#[test] -fn debug() { - let resolution = resolve("./tests/package.json"); - let s = format!("{resolution:?}"); - assert!(!s.is_empty()); -} - -#[test] -fn eq() { - let resolution = resolve("./tests/package.json"); - assert_eq!(resolution, resolution); -} - -#[test] -fn package_json() { - let resolution = resolve("./tests/package.json"); - assert!(resolution - .package_json() - .is_some_and(|json| json.name.as_ref().is_some_and(|name| name == "name"))); -} - -#[cfg(feature = "package_json_raw_json_api")] -#[test] -fn package_json_raw_json_api() { - let resolution = resolve("./tests/package.json"); - assert!(resolution - .package_json() - .unwrap() - .raw_json() - .get("name") - .is_some_and(|name| name == "name")); -} - -#[test] -fn clear_cache() { - let resolver = Resolver::new(ResolveOptions::default()); - resolver.clear_cache(); // exists -} - -#[test] -fn options() { - let resolver = Resolver::new(ResolveOptions::default()); - let options = resolver.options(); - assert!(!format!("{options:?}").is_empty()); -} - -#[test] -fn debug_resolver() { - let resolver = Resolver::new(ResolveOptions::default()); - assert!(!format!("{resolver:?}").is_empty()); -} - -#[test] -fn dependencies() { - let path = dir(); - let mut ctx = ResolveContext::default(); - let _ = Resolver::new(ResolveOptions::default()).resolve_with_context( - path, - "./tests/package.json", - &mut ctx, - ); - assert!(!ctx.file_dependencies.is_empty()); - assert!(ctx.missing_dependencies.is_empty()); -} - -#[test] -fn options_api() { - _ = ResolveOptions::default() - .with_builtin_modules(true) - .with_condition_names(&[]) - .with_extension(".js") - .with_force_extension(EnforceExtension::Auto) - .with_fully_specified(true) - .with_main_field("asdf") - .with_main_file("main") - .with_module("module") - .with_prefer_absolute(true) - .with_prefer_relative(true) - .with_root(PathBuf::new()) - .with_symbolic_link(true); -} diff --git a/tests/package.json b/tests/package.json deleted file mode 100644 index f099adcf..00000000 --- a/tests/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "name": "name" -} diff --git a/tests/resolve_test.rs b/tests/resolve_test.rs deleted file mode 100644 index 554d707c..00000000 --- a/tests/resolve_test.rs +++ /dev/null @@ -1,104 +0,0 @@ -use std::{env, path::PathBuf}; - -use oxc_resolver::{ResolveError, ResolveOptions, Resolver}; - -fn dir() -> PathBuf { - env::current_dir().unwrap() -} - -#[test] -fn chinese() { - let dir = dir(); - let specifier = "./fixtures/misc/中文/中文.js"; - let resolution = Resolver::new(ResolveOptions::default()).resolve(&dir, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(dir.join("fixtures/misc/中文/中文.js")) - ); -} - -#[test] -fn styled_components() { - let dir = dir(); - let path = dir.join("fixtures/pnpm8"); - let module_path = path.join("node_modules/.pnpm/styled-components@6.1.1_react-dom@18.2.0_react@18.2.0/node_modules/styled-components"); - let specifier = "styled-components"; - - // cjs - let options = - ResolveOptions { alias_fields: vec![vec!["browser".into()]], ..ResolveOptions::default() }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/styled-components.browser.cjs.js")) - ); - - // esm - let options = ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - main_fields: vec!["module".into()], - ..ResolveOptions::default() - }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/styled-components.browser.esm.js")) - ); -} - -#[test] -fn axios() { - let dir = dir(); - let path = dir.join("fixtures/pnpm8"); - let module_path = path.join("node_modules/.pnpm/axios@1.6.2/node_modules/axios"); - let specifier = "axios"; - - // default - let options = ResolveOptions::default(); - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("index.js")) - ); - - // browser - let options = ResolveOptions { - condition_names: vec!["browser".into(), "require".into()], - ..ResolveOptions::default() - }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/browser/axios.cjs")) - ); - - // cjs - let options = ResolveOptions { - condition_names: vec!["node".into(), "require".into()], - ..ResolveOptions::default() - }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/node/axios.cjs")) - ); -} - -#[test] -fn postcss() { - let dir = dir(); - let path = dir.join("fixtures/pnpm8"); - let module_path = path.join("node_modules/postcss"); - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - // should ignore "path" - let resolution = resolver.resolve(&module_path, "path"); - assert_eq!(resolution, Err(ResolveError::Ignored(module_path.clone()))); - - // should ignore "./lib/terminal-highlight" - let resolution = resolver.resolve(&module_path, "./lib/terminal-highlight"); - assert_eq!(resolution, Err(ResolveError::Ignored(module_path.join("lib/terminal-highlight")))); -} From 75c943dd1fd662f6ad53fa7ac2345d47946f62f3 Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Wed, 12 Jun 2024 12:47:59 +0300 Subject: [PATCH 22/82] squash! --- package.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index c80ccc19..c30d80fe 100644 --- a/package.json +++ b/package.json @@ -15,10 +15,10 @@ ] }, "devDependencies": { - "@napi-rs/cli": "^3.0.0-alpha.43", - "@napi-rs/wasm-runtime": "^0.2.4", - "@types/node": "^20.14.2", - "ava": "^6.1.3", - "emnapi": "^1.2.0" + "@napi-rs/cli": "3.0.0-alpha.43", + "@napi-rs/wasm-runtime": "0.2.4", + "@types/node": "20.14.2", + "ava": "6.1.3", + "emnapi": "1.2.0" } } From d41b1b56c8d031c5f8cd5d3ca34fd6c48727d73b Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Wed, 12 Jun 2024 22:05:05 +0300 Subject: [PATCH 23/82] squash! --- .github/workflows/Node.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Node.yml b/.github/workflows/Node.yml index cfd38750..cd0f236a 100644 --- a/.github/workflows/Node.yml +++ b/.github/workflows/Node.yml @@ -61,7 +61,7 @@ jobs: - uses: pnpm/action-setup@v4.0.0 with: - version: 8.15.5 + version: 9.3.0 run_install: | - recursive: true args: [ From 3fa7e096acf62f801896679812e4e97e7775452e Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Thu, 13 Jun 2024 18:30:11 +0300 Subject: [PATCH 24/82] squash! --- Cargo.lock | 858 ------ Source/lib.rs | 2 +- fixtures/enhanced_resolve/lib/index.js | 1 - fixtures/enhanced_resolve/package.json | 4 - fixtures/enhanced_resolve/test/.gitignore | 2 - .../enhanced_resolve/test/fixtures/#/a.js | 0 fixtures/enhanced_resolve/test/fixtures/a.js | 3 - .../enhanced_resolve/test/fixtures/abc.txt | 1 - .../test/fixtures/alias/files/a.js | 0 fixtures/enhanced_resolve/test/fixtures/b.js | 3 - .../browser-module/browser/module-a.js | 0 .../fixtures/browser-module/lib/browser.js | 0 .../fixtures/browser-module/lib/ignore.js | 0 .../test/fixtures/browser-module/lib/main.js | 0 .../fixtures/browser-module/lib/replaced.js | 0 .../test/fixtures/browser-module/lib/self.js | 0 .../fixtures/browser-module/lib/toString.js | 0 .../browser-module/node_modules/module-a.js | 0 .../browser-module/node_modules/module-b.js | 0 .../browser-module/node_modules/module-c.js | 0 .../node_modules/recursive-file/a.js | 0 .../node_modules/recursive-file/b.js | 0 .../node_modules/recursive-file/c.js | 0 .../node_modules/recursive-file/d.js | 0 .../node_modules/recursive-file/package.json | 8 - .../test/fixtures/browser-module/package.json | 33 - .../test/fixtures/builtins/package.json | 12 - fixtures/enhanced_resolve/test/fixtures/c.js | 4 - .../enhanced_resolve/test/fixtures/complex.js | 13 - .../test/fixtures/crypto-js/index.js | 0 .../test/fixtures/crypto-js/package.json | 7 - .../test/fixtures/decorated-fs/exists.js | 0 .../test/fixtures/dirOrFile.js | 1 - .../test/fixtures/dirOrFile/index.js | 1 - .../directory-default/directory-default.js | 0 .../node_modules/@org/pkg/dist/string.js | 1 - .../@org/pkg/dist/string.test.d.ts | 1 - .../node_modules/@org/pkg/package.json | 9 - .../node_modules/pkg/dist/string.js | 1 - .../node_modules/pkg/dist/string.test.d.ts | 1 - .../node_modules/pkg/package.json | 9 - .../node_modules/exports-field/package.json | 7 - .../node_modules/pack1/index.js | 0 .../test/fixtures/exports-field/a.js | 1 - .../node_modules/exports-field/lib/browser.js | 1 - .../node_modules/exports-field/lib/index.js | 0 .../exports-field/lib/lib2/main.js | 1 - .../node_modules/exports-field/lib/main.js | 1 - .../node_modules/exports-field/main.js | 1 - .../node_modules/exports-field/package.json | 18 - .../node_modules/exports-field/x.js | 1 - .../invalid-exports-field/index.js | 0 .../invalid-exports-field/package.json | 13 - .../node_modules/invalid-exports-field/umd.js | 0 .../test/fixtures/exports-field/package.json | 5 - .../node_modules/exports-field/index.js | 1 - .../node_modules/exports-field/lib/browser.js | 1 - .../exports-field/lib/lib2/main.js | 1 - .../node_modules/exports-field/lib/main.js | 1 - .../node_modules/exports-field/main.js | 1 - .../node_modules/exports-field/package.json | 17 - .../node_modules/exports-field/index | 0 .../node_modules/exports-field/main.js | 1 - .../node_modules/exports-field/package.json | 10 - .../node_modules/exports-field/src/index.js | 0 .../fixtures/extension-alias/dir/index.js | 0 .../fixtures/extension-alias/dir/index.ts | 0 .../fixtures/extension-alias/dir2/index.js | 0 .../fixtures/extension-alias/dir2/index.mts | 0 .../test/fixtures/extension-alias/index.js | 0 .../test/fixtures/extension-alias/index.mjs | 0 .../fixtures/extension-alias/index.mts.js | 0 .../test/fixtures/extension-alias/index.ts | 0 .../test/fixtures/extensions/app.module.js | 0 .../test/fixtures/extensions/dir/index.js | 0 .../test/fixtures/extensions/dir/index.ts | 0 .../test/fixtures/extensions/foo.js | 0 .../test/fixtures/extensions/foo.ts | 0 .../test/fixtures/extensions/index.js | 0 .../test/fixtures/extensions/index.ts | 0 .../extensions/node_modules/module.js | 0 .../extensions/node_modules/module/index.ts | 0 .../test/fixtures/extensions/package.json | 3 - .../enhanced_resolve/test/fixtures/file.load1 | 0 .../enhanced_resolve/test/fixtures/file.load2 | 0 .../test/fixtures/foo/index.js | 0 .../test/fixtures/foo/package.json | 4 - .../node_modules/m/package.json | 17 - .../node_modules/m/src/features/f.js | 0 .../m/src/features/internal/file.js | 0 .../node_modules/m/src/features/y/y.js | 0 .../node_modules/m/src/internal/i.js | 0 .../node_modules/m/src/middle-1/f.js | 0 .../node_modules/m/src/middle-1/nested/f.js | 0 .../node_modules/m/src/middle-2/nested/f.js | 1 - .../m/src/middle-3/nested/f/nested/f.js | 0 .../node_modules/m/src/middle-4/f/f.js | 0 .../node_modules/m/src/middle-5/f$/$.js | 0 .../node_modules/m/src/middle-5/f/$.js | 0 .../node_modules/m/src/middle/f.js | 0 .../node_modules/m/src/middle/nested/f.js | 0 .../test/fixtures/imports-field/a.js | 1 - .../test/fixtures/imports-field/b.js | 0 .../test/fixtures/imports-field/dir/b.js | 0 .../node_modules/a/lib/browser.js | 1 - .../imports-field/node_modules/a/lib/index.js | 0 .../node_modules/a/lib/lib2/main.js | 1 - .../imports-field/node_modules/a/lib/main.js | 1 - .../imports-field/node_modules/a/main.js | 1 - .../imports-field/node_modules/a/package.json | 18 - .../imports-field/node_modules/a/x.js | 1 - .../imports-field/node_modules/c/index.js | 0 .../test/fixtures/imports-field/package.json | 17 - .../fixtures/incorrect-package/pack1/a.js | 0 .../incorrect-package/pack1/package.json | 2 - .../fixtures/incorrect-package/pack2/a.js | 0 .../incorrect-package/pack2/package.json | 0 .../test/fixtures/issue-238/package.json | 3 - .../test/fixtures/issue-238/src/a/config.js | 0 .../src/common/config/myObjectFile.js | 0 .../enhanced_resolve/test/fixtures/lib.js | 0 .../test/fixtures/lib/complex1.js | 1 - .../test/fixtures/main-field-self/index.js | 0 .../fixtures/main-field-self/package.json | 3 - .../test/fixtures/main-field-self2/index.js | 0 .../fixtures/main-field-self2/package.json | 3 - .../enhanced_resolve/test/fixtures/main1.js | 9 - .../enhanced_resolve/test/fixtures/main2.js | 12 - .../enhanced_resolve/test/fixtures/main3.js | 4 - .../multiple_modules/node_modules/m1/a.js | 3 - .../test/fixtures/no#fragment/#/#.js | 0 fixtures/enhanced_resolve/test/fixtures/no.js | 0 .../browser-module-broken/browser.js | 0 .../browser-module-broken/main.js | 0 .../browser-module-broken/package.json | 4 - .../complexm/node_modules/m1/a.js | 1 - .../complexm/node_modules/m1/index.js | 1 - .../fixtures/node_modules/complexm/step1.js | 1 - .../fixtures/node_modules/complexm/step2.js | 1 - .../fixtures/node_modules/dash-name/index.js | 0 .../node_modules/dash-name/package.json | 4 - .../test/fixtures/node_modules/dash/index.js | 0 .../fixtures/node_modules/dash/package.json | 4 - .../invalidPackageJson/package.json | 0 .../test/fixtures/node_modules/m1/a.js | 3 - .../test/fixtures/node_modules/m1/b.js | 3 - .../test/fixtures/node_modules/m2/b.js | 1 - .../node_modules/recursive-module/file.js | 0 .../node_modules/recursive-module/index.js | 0 .../test/fixtures/pnp-a/m2/a.js | 3 - .../test/fixtures/pnp/pkg/dir/index.js | 0 .../test/fixtures/pnp/pkg/index.js | 0 .../test/fixtures/pnp/pkg/main.js | 0 .../fixtures/pnp/pkg/package-alias/browser.js | 0 .../fixtures/pnp/pkg/package-alias/index.js | 0 .../test/fixtures/pnp/pkg/package.json | 7 - .../test/fixtures/pnp/pkg/typescript/index.ts | 0 .../test/fixtures/pnp/pkg3/a.js | 1 - .../test/fixtures/pnp/pkg3/package.json | 8 - .../prefer-pnp/alternative-modules/m1/b.js | 0 .../restrictions/node_modules/pck1/index.css | 0 .../restrictions/node_modules/pck1/index.js | 0 .../node_modules/pck1/package.json | 3 - .../restrictions/node_modules/pck2/index.css | 0 .../restrictions/node_modules/pck2/module.js | 0 .../node_modules/pck2/package.json | 5 - .../test/fixtures/roots_fall_through/index.js | 0 .../scoped/node_modules/@scope/pack1/main.js | 0 .../node_modules/@scope/pack1/package.json | 5 - .../node_modules/@scope/pack2/lib/index.js | 0 .../scoped/node_modules/@scope/pack2/main.js | 0 .../node_modules/@scope/pack2/package.json | 3 - .../test/fixtures/shortcutdir.js/a.js | 0 .../test/fixtures/yield/a/foo-2/b | 0 .../test/fixtures/yield/a/foo-2/c | 0 .../test/fixtures/yield/a/foo/a | 0 .../test/fixtures/yield/a/foo/b | 0 .../test/fixtures/yield/b/foo/a | 0 .../test/fixtures/yield/c/foo/a | 0 .../test/fixtures/yield/c/foo/package.json | 7 - .../fixtures/\346\265\213\350\257\225.js" | 0 .../\344\270\255\346\226\207.js" | 0 fixtures/pnpm8/.gitignore | 1 - fixtures/pnpm8/package.json | 14 - fixtures/pnpm8/pnpm-lock.yaml | 212 -- fixtures/tsconfig/cases/builtins/thing.js | 0 .../tsconfig/cases/builtins/tsconfig.json | 5 - fixtures/tsconfig/cases/exports/index.js | 0 fixtures/tsconfig/cases/exports/tsconfig.json | 3 - .../extends-extension/base-tsconfig.json | 7 - .../tsconfig/cases/extends-extension/foo.js | 0 .../cases/extends-extension/tsconfig.json | 3 - .../cases/extends-extensionless/foo.js | 0 .../cases/extends-extensionless/tsconfig.json | 3 - .../tsconfig/cases/extends-multiple/foo.js | 0 .../cases/extends-multiple/tsconfig.json | 6 - .../tsconfig/cases/extends-not-found/index.js | 0 .../cases/extends-not-found/tsconfig.json | 3 - .../tsconfig/cases/extends-paths/src/index.js | 0 .../cases/extends-paths/tsconfig.base.json | 7 - .../cases/extends-paths/tsconfig.json | 6 - fixtures/tsconfig/cases/field/index.js | 0 fixtures/tsconfig/cases/field/tsconfig.json | 3 - fixtures/tsconfig/cases/index/index.js | 0 fixtures/tsconfig/cases/index/tsconfig.json | 3 - .../cases/paths_template_variable/foo.js | 0 .../paths_template_variable/tsconfig1.json | 3 - .../paths_template_variable/tsconfig2.json | 8 - .../project_references/app/aliased/index.ts | 0 .../cases/project_references/app/index.ts | 0 .../project_references/app/tsconfig.json | 23 - .../project_a/aliased/index.ts | 0 .../project_references/project_a/conf.json | 8 - .../project_references/project_a/index.ts | 0 .../project_b/src/aliased/index.ts | 0 .../project_b/tsconfig.json | 9 - .../project_references/project_c/index.ts | 0 .../project_c/tsconfig.json | 5 - .../project_references/tsconfig.base.json | 4 - fixtures/tsconfig/cases/suffixes/a.ios.ts | 0 fixtures/tsconfig/cases/suffixes/a.ts | 0 fixtures/tsconfig/cases/suffixes/b.ts | 0 fixtures/tsconfig/cases/suffixes/c-test.ts | 0 fixtures/tsconfig/cases/suffixes/index.ts | 1 - .../tsconfig/cases/suffixes/tsconfig.json | 5 - fixtures/tsconfig/cases/trailing-comma/bar.js | 0 .../tsconfig/cases/trailing-comma/index.js | 0 .../cases/trailing-comma/tsconfig.json | 9 - fixtures/tsconfig/foo.js | 0 fixtures/tsconfig/nested/index.js | 0 fixtures/tsconfig/nested/test.js | 0 fixtures/tsconfig/nested/tsconfig.json | 8 - .../node_modules/tsconfig-exports/conf.json | 7 - .../node_modules/tsconfig-exports/foo.js | 0 .../tsconfig-exports/package.json | 7 - .../node_modules/tsconfig-field/conf.json | 7 - .../node_modules/tsconfig-field/foo.js | 0 .../node_modules/tsconfig-field/package.json | 5 - .../node_modules/tsconfig-index/foo.js | 0 .../node_modules/tsconfig-index/package.json | 4 - .../node_modules/tsconfig-index/tsconfig.json | 7 - .../node_modules/tsconfig-not-used/foo.js | 0 .../tsconfig-not-used/tsconfig.json | 7 - fixtures/tsconfig/package.json | 24 - fixtures/tsconfig/tsconfig.json | 7 - .../tsconfig/tsconfig_template_variable.json | 7 - napi/__test__/resolver.spec.mjs | 259 -- napi/src/lib.rs | 166 -- napi/src/options.rs | 261 -- napi/tests/options.test.mjs | 59 - npm/package.json | 67 +- package.json | 53 +- pnpm-lock.yaml | 2450 ---------------- src/builtins.rs | 71 - src/cache.rs | 369 --- src/context.rs | 89 - src/error.rs | 160 -- src/file_system.rs | 133 - src/lib.rs | 1670 ----------- src/options.rs | 623 ---- src/package_json.rs | 207 -- src/path.rs | 132 - src/resolution.rs | 92 - src/specifier.rs | 230 -- src/tests/alias.rs | 280 -- src/tests/browser_field.rs | 189 -- src/tests/builtins.rs | 121 - src/tests/dependencies.rs | 110 - src/tests/exports_field.rs | 2546 ----------------- src/tests/extension_alias.rs | 66 - src/tests/extensions.rs | 125 - src/tests/fallback.rs | 100 - src/tests/full_specified.rs | 113 - src/tests/imports_field.rs | 1320 --------- src/tests/incorrect_description_file.rs | 62 - src/tests/main_field.rs | 24 - src/tests/memory_fs.rs | 74 - src/tests/missing.rs | 106 - src/tests/mod.rs | 49 - src/tests/resolve.rs | 119 - src/tests/restrictions.rs | 25 - src/tests/roots.rs | 92 - src/tests/scoped_packages.rs | 25 - src/tests/simple.rs | 68 - src/tests/symlink.rs | 121 - src/tests/tsconfig_paths.rs | 507 ---- src/tests/tsconfig_project_references.rs | 101 - src/tsconfig.rs | 212 -- tests/integration_test.rs | 102 - tests/package.json | 3 - tests/resolve_test.rs | 104 - 291 files changed, 51 insertions(+), 15473 deletions(-) delete mode 100644 Cargo.lock delete mode 100644 fixtures/enhanced_resolve/lib/index.js delete mode 100644 fixtures/enhanced_resolve/package.json delete mode 100644 fixtures/enhanced_resolve/test/.gitignore delete mode 100644 fixtures/enhanced_resolve/test/fixtures/#/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/abc.txt delete mode 100644 fixtures/enhanced_resolve/test/fixtures/alias/files/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/browser/module-a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/ignore.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/replaced.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/self.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/toString.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-c.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/c.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/d.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/builtins/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/c.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/complex.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/crypto-js/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/decorated-fs/exists.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/dirOrFile.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/directory-default/directory-default.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/pack1/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/umd.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/index delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/src/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.mts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mjs delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mts.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/app.module.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/foo.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/foo.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/file.load1 delete mode 100644 fixtures/enhanced_resolve/test/fixtures/file.load2 delete mode 100644 fixtures/enhanced_resolve/test/fixtures/foo/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/foo/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/internal/file.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/y/y.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/internal/i.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-3/nested/f/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-4/f/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f$/$.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f/$.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/dir/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/c/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/issue-238/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/issue-238/src/a/config.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/issue-238/src/common/config/myObjectFile.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/lib.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/lib/complex1.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self2/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main1.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main2.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main3.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/no#fragment/#/#.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/no.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/invalidPackageJson/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/file.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/dir/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/typescript/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/prefer-pnp/alternative-modules/m1/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.css delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/index.css delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/module.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/roots_fall_through/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/lib/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/shortcutdir.js/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/b delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/c delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo/a delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo/b delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/b/foo/a delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/c/foo/a delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json delete mode 100644 "fixtures/enhanced_resolve/test/fixtures/\346\265\213\350\257\225.js" delete mode 100644 "fixtures/misc/\344\270\255\346\226\207/\344\270\255\346\226\207.js" delete mode 100644 fixtures/pnpm8/.gitignore delete mode 100644 fixtures/pnpm8/package.json delete mode 100644 fixtures/pnpm8/pnpm-lock.yaml delete mode 100644 fixtures/tsconfig/cases/builtins/thing.js delete mode 100644 fixtures/tsconfig/cases/builtins/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/exports/index.js delete mode 100644 fixtures/tsconfig/cases/exports/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-extension/base-tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-extension/foo.js delete mode 100644 fixtures/tsconfig/cases/extends-extension/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-extensionless/foo.js delete mode 100644 fixtures/tsconfig/cases/extends-extensionless/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-multiple/foo.js delete mode 100644 fixtures/tsconfig/cases/extends-multiple/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-not-found/index.js delete mode 100644 fixtures/tsconfig/cases/extends-not-found/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-paths/src/index.js delete mode 100644 fixtures/tsconfig/cases/extends-paths/tsconfig.base.json delete mode 100644 fixtures/tsconfig/cases/extends-paths/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/field/index.js delete mode 100644 fixtures/tsconfig/cases/field/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/index/index.js delete mode 100644 fixtures/tsconfig/cases/index/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/paths_template_variable/foo.js delete mode 100644 fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json delete mode 100644 fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json delete mode 100644 fixtures/tsconfig/cases/project_references/app/aliased/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/app/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/app/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/project_references/project_a/aliased/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_a/conf.json delete mode 100644 fixtures/tsconfig/cases/project_references/project_a/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_b/src/aliased/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_b/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/project_references/project_c/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_c/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/project_references/tsconfig.base.json delete mode 100644 fixtures/tsconfig/cases/suffixes/a.ios.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/a.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/b.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/c-test.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/index.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/trailing-comma/bar.js delete mode 100644 fixtures/tsconfig/cases/trailing-comma/index.js delete mode 100644 fixtures/tsconfig/cases/trailing-comma/tsconfig.json delete mode 100644 fixtures/tsconfig/foo.js delete mode 100644 fixtures/tsconfig/nested/index.js delete mode 100644 fixtures/tsconfig/nested/test.js delete mode 100644 fixtures/tsconfig/nested/tsconfig.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-exports/conf.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-exports/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-exports/package.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-field/conf.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-field/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-field/package.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-index/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-index/package.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-not-used/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json delete mode 100755 fixtures/tsconfig/package.json delete mode 100644 fixtures/tsconfig/tsconfig.json delete mode 100644 fixtures/tsconfig/tsconfig_template_variable.json delete mode 100644 napi/__test__/resolver.spec.mjs delete mode 100644 napi/src/lib.rs delete mode 100644 napi/src/options.rs delete mode 100644 napi/tests/options.test.mjs delete mode 100644 pnpm-lock.yaml delete mode 100644 src/builtins.rs delete mode 100644 src/cache.rs delete mode 100644 src/context.rs delete mode 100644 src/error.rs delete mode 100644 src/file_system.rs delete mode 100644 src/lib.rs delete mode 100644 src/options.rs delete mode 100644 src/package_json.rs delete mode 100644 src/path.rs delete mode 100644 src/resolution.rs delete mode 100644 src/specifier.rs delete mode 100644 src/tests/alias.rs delete mode 100644 src/tests/browser_field.rs delete mode 100644 src/tests/builtins.rs delete mode 100644 src/tests/dependencies.rs delete mode 100644 src/tests/exports_field.rs delete mode 100644 src/tests/extension_alias.rs delete mode 100644 src/tests/extensions.rs delete mode 100644 src/tests/fallback.rs delete mode 100644 src/tests/full_specified.rs delete mode 100644 src/tests/imports_field.rs delete mode 100644 src/tests/incorrect_description_file.rs delete mode 100644 src/tests/main_field.rs delete mode 100644 src/tests/memory_fs.rs delete mode 100644 src/tests/missing.rs delete mode 100644 src/tests/mod.rs delete mode 100644 src/tests/resolve.rs delete mode 100644 src/tests/restrictions.rs delete mode 100644 src/tests/roots.rs delete mode 100644 src/tests/scoped_packages.rs delete mode 100644 src/tests/simple.rs delete mode 100644 src/tests/symlink.rs delete mode 100644 src/tests/tsconfig_paths.rs delete mode 100644 src/tests/tsconfig_project_references.rs delete mode 100644 src/tsconfig.rs delete mode 100644 tests/integration_test.rs delete mode 100644 tests/package.json delete mode 100644 tests/resolve_test.rs diff --git a/Cargo.lock b/Cargo.lock deleted file mode 100644 index 4ec5ea2f..00000000 --- a/Cargo.lock +++ /dev/null @@ -1,858 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "aho-corasick" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" -dependencies = [ - "memchr", -] - -[[package]] -name = "anes" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "735d4f398ca57cfa2880225c2bf81c3b9af3be5bb22e44ae70118dad38713e84" - -[[package]] -name = "autocfg" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "bitflags" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" - -[[package]] -name = "bpaf" -version = "0.9.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3280efcf6d66bc77c2cf9b67dc8acee47a217d9be67dd590b3230dffe663724d" - -[[package]] -name = "cast" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "ciborium" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42e69ffd6f0917f5c029256a24d0161db17cea3997d185db0d35926308770f0e" -dependencies = [ - "ciborium-io", - "ciborium-ll", - "serde", -] - -[[package]] -name = "ciborium-io" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05afea1e0a06c9be33d539b876f1ce3692f4afea2cb41f740e7743225ed1c757" - -[[package]] -name = "ciborium-ll" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57663b653d948a338bfb3eeba9bb2fd5fcfaecb9e199e87e1eda4d9e8b240fd9" -dependencies = [ - "ciborium-io", - "half", -] - -[[package]] -name = "clean-path" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aaa6b4b263a5d737e9bf6b7c09b72c41a5480aec4d7219af827f6564e950b6a5" - -[[package]] -name = "codspeed" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a104ac948e0188b921eb3fcbdd55dcf62e542df4c7ab7e660623f6288302089" -dependencies = [ - "colored", - "libc", - "serde_json", -] - -[[package]] -name = "colored" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbf2150cce219b664a8a70df7a1f933836724b503f8a413af9365b4dcc4d90b8" -dependencies = [ - "lazy_static", - "windows-sys 0.48.0", -] - -[[package]] -name = "convert_case" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec182b0ca2f35d8fc196cf3404988fd8b8c739a4d270ff118a398feb0cbec1ca" -dependencies = [ - "unicode-segmentation", -] - -[[package]] -name = "criterion2" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f22174bed309c964c1720148dfe793f285cc02fd8b13c91205d485f73468d94d" -dependencies = [ - "anes", - "bpaf", - "cast", - "ciborium", - "codspeed", - "colored", - "num-traits", - "oorandom", - "serde", - "serde_json", - "walkdir", -] - -[[package]] -name = "crossbeam-deque" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" -dependencies = [ - "crossbeam-epoch", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.9.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" -dependencies = [ - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" - -[[package]] -name = "crunchy" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" - -[[package]] -name = "ctor" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edb49164822f3ee45b17acd4a208cfc1251410cf0cad9a833234c9890774dd9f" -dependencies = [ - "quote", - "syn", -] - -[[package]] -name = "dashmap" -version = "5.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" -dependencies = [ - "cfg-if", - "hashbrown", - "lock_api", - "once_cell", - "parking_lot_core", -] - -[[package]] -name = "document-features" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef5282ad69563b5fc40319526ba27e0e7363d552a896f0297d54f767717f9b95" -dependencies = [ - "litrs", -] - -[[package]] -name = "dunce" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b" - -[[package]] -name = "either" -version = "1.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dca9240753cf90908d7e4aac30f630662b02aebaa1b58a3cadabdb23385b58b" - -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "filetime" -version = "0.2.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ee447700ac8aa0b2f2bd7bc4462ad686ba06baa6727ac149a2d6277f0d240fd" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall 0.4.1", - "windows-sys 0.52.0", -] - -[[package]] -name = "half" -version = "2.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dd08c532ae367adf81c312a4580bc67f1d0fe8bc9c460520283f4c0ff277888" -dependencies = [ - "cfg-if", - "crunchy", -] - -[[package]] -name = "hashbrown" -version = "0.14.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" - -[[package]] -name = "indexmap" -version = "2.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" -dependencies = [ - "equivalent", - "hashbrown", - "serde", -] - -[[package]] -name = "itoa" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" - -[[package]] -name = "json-strip-comments" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3d129799327c8f80861e467c59b825ba24c277dba6ad0d71a141dc98f9e04ee" - -[[package]] -name = "lazy_static" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" - -[[package]] -name = "libc" -version = "0.2.155" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" - -[[package]] -name = "libloading" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c2a198fb6b0eada2a8df47933734e6d35d350665a33a3593d7164fa52c75c19" -dependencies = [ - "cfg-if", - "windows-targets 0.48.5", -] - -[[package]] -name = "litrs" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4ce301924b7887e9d637144fdade93f9dfff9b60981d4ac161db09720d39aa5" - -[[package]] -name = "lock_api" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" -dependencies = [ - "autocfg", - "scopeguard", -] - -[[package]] -name = "memchr" -version = "2.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" - -[[package]] -name = "napi" -version = "2.16.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfc300228808a0e6aea5a58115c82889240bcf8dab16fc25ad675b33e454b368" -dependencies = [ - "bitflags 2.5.0", - "ctor", - "napi-derive", - "napi-sys", - "once_cell", - "serde", - "serde_json", -] - -[[package]] -name = "napi-build" -version = "2.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1c0f5d67ee408a4685b61f5ab7e58605c8ae3f2b4189f0127d804ff13d5560a" - -[[package]] -name = "napi-derive" -version = "2.16.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0e034ddf6155192cf83f267ede763fe6c164dfa9971585436b16173718d94c4" -dependencies = [ - "cfg-if", - "convert_case", - "napi-derive-backend", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "napi-derive-backend" -version = "1.0.67" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bff2c00437f3b3266391eb5e6aa25d0029187daf5caf05b8e3271468fb5ae73e" -dependencies = [ - "convert_case", - "once_cell", - "proc-macro2", - "quote", - "regex", - "semver", - "syn", -] - -[[package]] -name = "napi-sys" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "427802e8ec3a734331fec1035594a210ce1ff4dc5bc1950530920ab717964ea3" -dependencies = [ - "libloading", -] - -[[package]] -name = "normalize-path" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5438dd2b2ff4c6df6e1ce22d825ed2fa93ee2922235cc45186991717f0a892d" - -[[package]] -name = "num-traits" -version = "0.2.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" -dependencies = [ - "autocfg", -] - -[[package]] -name = "once_cell" -version = "1.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" - -[[package]] -name = "oorandom" -version = "11.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575" - -[[package]] -name = "oxc_napi_resolver" -version = "0.0.0" -dependencies = [ - "napi", - "napi-build", - "napi-derive", - "oxc_resolver", -] - -[[package]] -name = "oxc_resolver" -version = "1.8.1" -dependencies = [ - "criterion2", - "dashmap", - "document-features", - "dunce", - "json-strip-comments", - "normalize-path", - "once_cell", - "rayon", - "rustc-hash", - "serde", - "serde_json", - "thiserror", - "tracing", - "typescript_tsconfig_json", - "vfs", -] - -[[package]] -name = "parking_lot_core" -version = "0.9.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall 0.5.1", - "smallvec", - "windows-targets 0.52.5", -] - -[[package]] -name = "pin-project-lite" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" - -[[package]] -name = "proc-macro2" -version = "1.0.85" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22244ce15aa966053a896d1accb3a6e68469b97c7f33f284b99f0d576879fc23" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.36" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "rayon" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" -dependencies = [ - "either", - "rayon-core", -] - -[[package]] -name = "rayon-core" -version = "1.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" -dependencies = [ - "crossbeam-deque", - "crossbeam-utils", -] - -[[package]] -name = "redox_syscall" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" -dependencies = [ - "bitflags 1.3.2", -] - -[[package]] -name = "redox_syscall" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "469052894dcb553421e483e4209ee581a45100d31b4018de03e5a7ad86374a7e" -dependencies = [ - "bitflags 2.5.0", -] - -[[package]] -name = "regex" -version = "1.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" -dependencies = [ - "aho-corasick", - "memchr", - "regex-automata", - "regex-syntax", -] - -[[package]] -name = "regex-automata" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", -] - -[[package]] -name = "regex-syntax" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" - -[[package]] -name = "rustc-hash" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" - -[[package]] -name = "ryu" -version = "1.0.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" - -[[package]] -name = "same-file" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "scopeguard" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" - -[[package]] -name = "semver" -version = "1.0.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" - -[[package]] -name = "serde" -version = "1.0.203" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7253ab4de971e72fb7be983802300c30b5a7f0c2e56fab8abfc6a214307c0094" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.203" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "serde_json" -version = "1.0.117" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3" -dependencies = [ - "indexmap", - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "smallvec" -version = "1.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" - -[[package]] -name = "syn" -version = "2.0.66" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c42f3f41a2de00b01c0aaad383c5a45241efc8b2d1eda5661812fda5f3cdcff5" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "thiserror" -version = "1.0.61" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.61" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "tracing" -version = "0.1.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" -dependencies = [ - "pin-project-lite", - "tracing-attributes", - "tracing-core", -] - -[[package]] -name = "tracing-attributes" -version = "0.1.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "tracing-core" -version = "0.1.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" -dependencies = [ - "once_cell", -] - -[[package]] -name = "typescript_tsconfig_json" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7cc416eaf05297012ead9d192226fe9a92e9a20f64f8780efb9085aaae9b590" -dependencies = [ - "clean-path", - "indexmap", - "rustc-hash", - "serde", - "serde_json", -] - -[[package]] -name = "unicode-ident" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" - -[[package]] -name = "unicode-segmentation" -version = "1.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" - -[[package]] -name = "vfs" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "654cd097e182a71dbf899178e6b5662c2157dd0b8afd5975de18008f6fc173d1" -dependencies = [ - "filetime", -] - -[[package]] -name = "walkdir" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" -dependencies = [ - "same-file", - "winapi-util", -] - -[[package]] -name = "winapi-util" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b" -dependencies = [ - "windows-sys 0.52.0", -] - -[[package]] -name = "windows-sys" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" -dependencies = [ - "windows-targets 0.48.5", -] - -[[package]] -name = "windows-sys" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" -dependencies = [ - "windows-targets 0.52.5", -] - -[[package]] -name = "windows-targets" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" -dependencies = [ - "windows_aarch64_gnullvm 0.48.5", - "windows_aarch64_msvc 0.48.5", - "windows_i686_gnu 0.48.5", - "windows_i686_msvc 0.48.5", - "windows_x86_64_gnu 0.48.5", - "windows_x86_64_gnullvm 0.48.5", - "windows_x86_64_msvc 0.48.5", -] - -[[package]] -name = "windows-targets" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" -dependencies = [ - "windows_aarch64_gnullvm 0.52.5", - "windows_aarch64_msvc 0.52.5", - "windows_i686_gnu 0.52.5", - "windows_i686_gnullvm", - "windows_i686_msvc 0.52.5", - "windows_x86_64_gnu 0.52.5", - "windows_x86_64_gnullvm 0.52.5", - "windows_x86_64_msvc 0.52.5", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" - -[[package]] -name = "windows_i686_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" - -[[package]] -name = "windows_i686_gnu" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" - -[[package]] -name = "windows_i686_gnullvm" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" - -[[package]] -name = "windows_i686_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" - -[[package]] -name = "windows_i686_msvc" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" diff --git a/Source/lib.rs b/Source/lib.rs index fe116552..8ec2ad8a 100644 --- a/Source/lib.rs +++ b/Source/lib.rs @@ -283,7 +283,7 @@ impl ResolverGeneric { } let result = match Path::new(specifier).components().next() { - // 3. If X begins with './' or '/' or '../' + // 2. If X begins with '/' Some(Component::RootDir | Component::Prefix(_)) => { self.require_absolute(cached_path, specifier, ctx) } diff --git a/fixtures/enhanced_resolve/lib/index.js b/fixtures/enhanced_resolve/lib/index.js deleted file mode 100644 index 1e872e8f..00000000 --- a/fixtures/enhanced_resolve/lib/index.js +++ /dev/null @@ -1 +0,0 @@ -// mimic enhanced-resolved root directory structure diff --git a/fixtures/enhanced_resolve/package.json b/fixtures/enhanced_resolve/package.json deleted file mode 100644 index d1b845b5..00000000 --- a/fixtures/enhanced_resolve/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "enhanced-resolve", - "main": "lib/index.js" -} diff --git a/fixtures/enhanced_resolve/test/.gitignore b/fixtures/enhanced_resolve/test/.gitignore deleted file mode 100644 index bbbec5f4..00000000 --- a/fixtures/enhanced_resolve/test/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# created by symlink.rs -/temp diff --git a/fixtures/enhanced_resolve/test/fixtures/#/a.js b/fixtures/enhanced_resolve/test/fixtures/#/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/a.js b/fixtures/enhanced_resolve/test/fixtures/a.js deleted file mode 100644 index 896ffc6d..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/abc.txt b/fixtures/enhanced_resolve/test/fixtures/abc.txt deleted file mode 100644 index f2ba8f84..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/abc.txt +++ /dev/null @@ -1 +0,0 @@ -abc \ No newline at end of file diff --git a/fixtures/enhanced_resolve/test/fixtures/alias/files/a.js b/fixtures/enhanced_resolve/test/fixtures/alias/files/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/b.js b/fixtures/enhanced_resolve/test/fixtures/b.js deleted file mode 100644 index 11476340..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/b.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function b() { - return "This is b"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/browser/module-a.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/browser/module-a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/browser.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/ignore.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/ignore.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/replaced.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/replaced.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/self.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/self.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/toString.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/toString.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-a.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-b.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-c.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-c.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/a.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/b.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/c.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/c.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/d.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/d.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json deleted file mode 100644 index c13fe23b..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "browser": { - "a.js": "./a", - "./b.js": "./b", - "c.js": "./d.js", - "./d.js": "./c.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/package.json b/fixtures/enhanced_resolve/test/fixtures/browser-module/package.json deleted file mode 100644 index 19ff7739..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/browser-module/package.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "exports": { - "./lib/index.js": "./lib/index.js" - }, - "browser": { - "./lib/ignore.js": false, - "./lib/replaced.js": "./lib/browser", - "module-a": "./browser/module-a.js", - "module-b": "module-c", - "module-c": "module-c", - "./toString": "./lib/toString.js", - "./lib/main.js": "./lib/main.js", - "./main.js": "./lib/main.js", - "./lib/xyz.js": "./xyz.js", - "./xyz.js": "./lib/xyz.js", - "./lib/non-existent.js": "./lib/non-existent.js", - ".": false, - "./number": 1, - "./foo": "./lib/replaced.js?query" - }, - "innerBrowser1": { - "field": { - "browser": { - "./lib/main1.js": "./lib/main.js" - } - } - }, - "innerBrowser2": { - "browser": { - "./lib/main2.js": "./lib/replaced.js" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/builtins/package.json b/fixtures/enhanced_resolve/test/fixtures/builtins/package.json deleted file mode 100644 index 4a54ea96..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/builtins/package.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "name": "builtins", - "private": true, - "imports": { - "#fs": { - "default": "fs" - }, - "#http": { - "node": "node:http" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/c.js b/fixtures/enhanced_resolve/test/fixtures/c.js deleted file mode 100644 index e3aca8aa..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/c.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = function b() { - require("./a"); - return "This is c"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/complex.js b/fixtures/enhanced_resolve/test/fixtures/complex.js deleted file mode 100644 index 1f62db84..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/complex.js +++ /dev/null @@ -1,13 +0,0 @@ -var 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); diff --git a/fixtures/enhanced_resolve/test/fixtures/crypto-js/index.js b/fixtures/enhanced_resolve/test/fixtures/crypto-js/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json b/fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json deleted file mode 100644 index 1d31aa8b..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "crypto-js", - "main": "index.js", - "browser": { - "crypto": false - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/decorated-fs/exists.js b/fixtures/enhanced_resolve/test/fixtures/decorated-fs/exists.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/dirOrFile.js b/fixtures/enhanced_resolve/test/fixtures/dirOrFile.js deleted file mode 100644 index c3cb885f..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/dirOrFile.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "file"; diff --git a/fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js b/fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js deleted file mode 100644 index 85e01cd4..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "dir"; diff --git a/fixtures/enhanced_resolve/test/fixtures/directory-default/directory-default.js b/fixtures/enhanced_resolve/test/fixtures/directory-default/directory-default.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js deleted file mode 100644 index d1007aae..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js +++ /dev/null @@ -1 +0,0 @@ -export default "string"; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts deleted file mode 100644 index cb0ff5c3..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json deleted file mode 100644 index b523a1e9..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "@org/pkg", - "exports": { - "./*.js": { - "types": "./dist/*.d.ts", - "default": "./dist/*.js" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js deleted file mode 100644 index d1007aae..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js +++ /dev/null @@ -1 +0,0 @@ -export default "string"; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts deleted file mode 100644 index cb0ff5c3..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json deleted file mode 100644 index 8e55fb46..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "@raviqqe/hidash", - "exports": { - "./*.js": { - "types": "./dist/*.d.ts", - "default": "./dist/*.js" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json deleted file mode 100644 index f0edf449..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "exports-field", - "version": "1.0.0", - "exports": { - ".": "./a/../b/../../pack1/index.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/pack1/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/pack1/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/a.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/a.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json deleted file mode 100644 index 6b105c08..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "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/": { - "webpack": ["./lib/lib2/", "./lib/"], - "node": "./lib/", - "default": "./lib/" - }, - "./dist/a.js": "./../../a.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json deleted file mode 100644 index 0012a3de..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "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" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/umd.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/umd.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field/package.json deleted file mode 100644 index 5fa72bb5..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "@exports-field/core", - "version": "1.0.0", - "exports": "./a.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json deleted file mode 100644 index e6f12074..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "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/lib2/", "./lib/"], - "node": "./lib/", - "default": "./lib/" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/index b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/index deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json deleted file mode 100644 index 1a838f49..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "name": "exports-field", - "exportsField": { - "exports": "./main.js" - }, - "ex": "./index", - "broken": { - ".": "./src" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/src/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/src/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.ts b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.mts b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.mts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mjs b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mjs deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mts.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mts.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.ts b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/app.module.js b/fixtures/enhanced_resolve/test/fixtures/extensions/app.module.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.js b/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/foo.js b/fixtures/enhanced_resolve/test/fixtures/extensions/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/foo.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/foo.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/index.js b/fixtures/enhanced_resolve/test/fixtures/extensions/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/index.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module.js b/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module/index.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/package.json b/fixtures/enhanced_resolve/test/fixtures/extensions/package.json deleted file mode 100644 index 5e55a1e8..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/extensions/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "./index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/file.load1 b/fixtures/enhanced_resolve/test/fixtures/file.load1 deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/file.load2 b/fixtures/enhanced_resolve/test/fixtures/file.load2 deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/foo/index.js b/fixtures/enhanced_resolve/test/fixtures/foo/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/foo/package.json b/fixtures/enhanced_resolve/test/fixtures/foo/package.json deleted file mode 100644 index da86787a..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/foo/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "foo", - "version": "1.0.0" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json deleted file mode 100644 index aa2be496..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "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" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/internal/file.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/internal/file.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/y/y.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/y/y.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/internal/i.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/internal/i.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/nested/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js deleted file mode 100644 index e5b70a86..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = { nested: "nested" } diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-3/nested/f/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-3/nested/f/nested/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-4/f/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-4/f/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f$/$.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f$/$.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f/$.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f/$.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/nested/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/a.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/a.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/b.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/dir/b.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/dir/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/index.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json deleted file mode 100644 index 8d8d3a46..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "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/lib2/", "./lib/"], - "node": "./lib/", - "default": "./lib/" - }, - "./dist/a.js": "./../../a.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/c/index.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/c/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/imports-field/package.json deleted file mode 100644 index 248351a9..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "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" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/a.js b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json deleted file mode 100644 index ded7faa2..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json +++ /dev/null @@ -1,2 +0,0 @@ -{ - "main": "./a.js", diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/a.js b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/package.json b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/package.json deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/issue-238/package.json b/fixtures/enhanced_resolve/test/fixtures/issue-238/package.json deleted file mode 100644 index 352055cd..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/issue-238/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "private": true -} diff --git a/fixtures/enhanced_resolve/test/fixtures/issue-238/src/a/config.js b/fixtures/enhanced_resolve/test/fixtures/issue-238/src/a/config.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/issue-238/src/common/config/myObjectFile.js b/fixtures/enhanced_resolve/test/fixtures/issue-238/src/common/config/myObjectFile.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/lib.js b/fixtures/enhanced_resolve/test/fixtures/lib.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/lib/complex1.js b/fixtures/enhanced_resolve/test/fixtures/lib/complex1.js deleted file mode 100644 index b3de3d70..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/lib/complex1.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "lib complex1"; diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self/index.js b/fixtures/enhanced_resolve/test/fixtures/main-field-self/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json b/fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json deleted file mode 100644 index a2b6f341..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "./" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self2/index.js b/fixtures/enhanced_resolve/test/fixtures/main-field-self2/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json b/fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json deleted file mode 100644 index 4fa6f730..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "." -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main1.js b/fixtures/enhanced_resolve/test/fixtures/main1.js deleted file mode 100644 index 168f2a1e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main1.js +++ /dev/null @@ -1,9 +0,0 @@ -var a = require("./a"); -if (x) { - for (var i = 0; i < 100; i++) { - while (true) require("./b"); - do { - i++; - } while (require("m1/a")()); - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main2.js b/fixtures/enhanced_resolve/test/fixtures/main2.js deleted file mode 100644 index 39f062b1..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main2.js +++ /dev/null @@ -1,12 +0,0 @@ -var 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"); - }); - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main3.js b/fixtures/enhanced_resolve/test/fixtures/main3.js deleted file mode 100644 index 1c180166..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main3.js +++ /dev/null @@ -1,4 +0,0 @@ -var a = require("./a"); -require.ensure([], function(require) { - require("./c.js"); -}); diff --git a/fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js b/fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js deleted file mode 100644 index 997c1051..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is nested m1/a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/no#fragment/#/#.js b/fixtures/enhanced_resolve/test/fixtures/no#fragment/#/#.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/no.js b/fixtures/enhanced_resolve/test/fixtures/no.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/browser.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/browser.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/main.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json deleted file mode 100644 index c469e1fd..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "main": "./main.js", - "browser": "./browser.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js deleted file mode 100644 index 549620a5..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "the correct a.js"; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js deleted file mode 100644 index 5db6632e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = " :) " + require("m2/b.js"); diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js deleted file mode 100644 index d308569d..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require("m1/a") + require("m1"); diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js deleted file mode 100644 index cb8127e8..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "Step2"; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json deleted file mode 100644 index 8d6dfa56..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "dash-name", - "exports": "./index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json deleted file mode 100644 index 4fd8706e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "dash", - "exports": "./index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/invalidPackageJson/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/invalidPackageJson/package.json deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js deleted file mode 100644 index 46fc8e6c..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is m1/a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js deleted file mode 100644 index 8565c244..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is m1/b"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js deleted file mode 100644 index 34faaaf5..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "This is m2/b"; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/file.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/file.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js b/fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js deleted file mode 100644 index 997c1051..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is nested m1/a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/dir/index.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/dir/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/index.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/main.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/browser.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/browser.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/index.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json deleted file mode 100644 index e20ceaeb..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "main": "main.js", - "browser": { - "./package-alias/index.js": "./package-alias/browser.js", - "module": "pkg/dir/index" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/typescript/index.ts b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/typescript/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json deleted file mode 100644 index 4a1f838e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "@exports-field/core", - "version": "1.0.0", - "exports": { - ".": "./a.js", - "./x": "./a.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/prefer-pnp/alternative-modules/m1/b.js b/fixtures/enhanced_resolve/test/fixtures/prefer-pnp/alternative-modules/m1/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.css b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.css deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.js b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json deleted file mode 100644 index 14ab704d..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/index.css b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/index.css deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/module.js b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/module.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json deleted file mode 100644 index ee0eb71b..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "main": "../../../c.js", - "module": "module.js", - "style": "index.css" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/roots_fall_through/index.js b/fixtures/enhanced_resolve/test/fixtures/roots_fall_through/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/main.js b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json deleted file mode 100644 index 70a0f20f..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "browser": { - "./index.js": "./main.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/lib/index.js b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/lib/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/main.js b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json deleted file mode 100644 index 2af9e0d1..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "./main.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/shortcutdir.js/a.js b/fixtures/enhanced_resolve/test/fixtures/shortcutdir.js/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/b b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/b deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/c b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/c deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/a b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/a deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/b b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/b deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/b/foo/a b/fixtures/enhanced_resolve/test/fixtures/yield/b/foo/a deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/a b/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/a deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json b/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json deleted file mode 100644 index 0acc4b4c..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "foo", - "version": "1.0.0", - "browser": { - "./a": false - } -} diff --git "a/fixtures/enhanced_resolve/test/fixtures/\346\265\213\350\257\225.js" "b/fixtures/enhanced_resolve/test/fixtures/\346\265\213\350\257\225.js" deleted file mode 100644 index e69de29b..00000000 diff --git "a/fixtures/misc/\344\270\255\346\226\207/\344\270\255\346\226\207.js" "b/fixtures/misc/\344\270\255\346\226\207/\344\270\255\346\226\207.js" deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/pnpm8/.gitignore b/fixtures/pnpm8/.gitignore deleted file mode 100644 index 3c3629e6..00000000 --- a/fixtures/pnpm8/.gitignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/fixtures/pnpm8/package.json b/fixtures/pnpm8/package.json deleted file mode 100644 index cbced892..00000000 --- a/fixtures/pnpm8/package.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "name": "pnpm8", - "version": "1.0.0", - "private": true, - "engines": { - "node": ">=16.0.0" - }, - "packageManager": "pnpm@8.10.5", - "devDependencies": { - "axios": "1.6.2", - "styled-components": "6.1.1", - "postcss": "8.4.33" - } -} diff --git a/fixtures/pnpm8/pnpm-lock.yaml b/fixtures/pnpm8/pnpm-lock.yaml deleted file mode 100644 index e51dfd6a..00000000 --- a/fixtures/pnpm8/pnpm-lock.yaml +++ /dev/null @@ -1,212 +0,0 @@ -lockfileVersion: '6.0' - -settings: - autoInstallPeers: true - excludeLinksFromLockfile: false - -devDependencies: - axios: - specifier: 1.6.2 - version: 1.6.2 - postcss: - specifier: 8.4.33 - version: 8.4.33 - styled-components: - specifier: 6.1.1 - version: 6.1.1(react-dom@18.2.0)(react@18.2.0) - -packages: - - /@emotion/is-prop-valid@1.2.1: - resolution: {integrity: sha512-61Mf7Ufx4aDxx1xlDeOm8aFFigGHE4z+0sKCa+IHCeZKiyP9RLD0Mmx7m8b9/Cf37f7NAvQOOJAbQQGVr5uERw==} - dependencies: - '@emotion/memoize': 0.8.1 - dev: true - - /@emotion/memoize@0.8.1: - resolution: {integrity: sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA==} - dev: true - - /@emotion/unitless@0.8.1: - resolution: {integrity: sha512-KOEGMu6dmJZtpadb476IsZBclKvILjopjUii3V+7MnXIQCYh8W3NgNcgwo21n9LXZX6EDIKvqfjYxXebDwxKmQ==} - dev: true - - /@types/stylis@4.2.4: - resolution: {integrity: sha512-36ZrGJ8fgtBr6nwNnuJ9jXIj+bn/pF6UoqmrQT7+Y99+tFFeHHsoR54+194dHdyhPjgbeoNz3Qru0oRt0l6ASQ==} - dev: true - - /asynckit@0.4.0: - resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} - dev: true - - /axios@1.6.2: - resolution: {integrity: sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A==} - dependencies: - follow-redirects: 1.15.3 - form-data: 4.0.0 - proxy-from-env: 1.1.0 - transitivePeerDependencies: - - debug - dev: true - - /camelize@1.0.1: - resolution: {integrity: sha512-dU+Tx2fsypxTgtLoE36npi3UqcjSSMNYfkqgmoEhtZrraP5VWq0K7FkWVTYa8eMPtnU/G2txVsfdCJTn9uzpuQ==} - dev: true - - /combined-stream@1.0.8: - resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} - engines: {node: '>= 0.8'} - dependencies: - delayed-stream: 1.0.0 - dev: true - - /css-color-keywords@1.0.0: - resolution: {integrity: sha512-FyyrDHZKEjXDpNJYvVsV960FiqQyXc/LlYmsxl2BcdMb2WPx0OGRVgTg55rPSyLSNMqP52R9r8geSp7apN3Ofg==} - engines: {node: '>=4'} - dev: true - - /css-to-react-native@3.2.0: - resolution: {integrity: sha512-e8RKaLXMOFii+02mOlqwjbD00KSEKqblnpO9e++1aXS1fPQOpS1YoqdVHBqPjHNoxeF2mimzVqawm2KCbEdtHQ==} - dependencies: - camelize: 1.0.1 - css-color-keywords: 1.0.0 - postcss-value-parser: 4.2.0 - dev: true - - /csstype@3.1.2: - resolution: {integrity: sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==} - dev: true - - /delayed-stream@1.0.0: - resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} - engines: {node: '>=0.4.0'} - dev: true - - /follow-redirects@1.15.3: - resolution: {integrity: sha512-1VzOtuEM8pC9SFU1E+8KfTjZyMztRsgEfwQl44z8A25uy13jSzTj6dyK2Df52iV0vgHCfBwLhDWevLn95w5v6Q==} - engines: {node: '>=4.0'} - peerDependencies: - debug: '*' - peerDependenciesMeta: - debug: - optional: true - dev: true - - /form-data@4.0.0: - resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==} - engines: {node: '>= 6'} - dependencies: - asynckit: 0.4.0 - combined-stream: 1.0.8 - mime-types: 2.1.35 - dev: true - - /js-tokens@4.0.0: - resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} - dev: true - - /loose-envify@1.4.0: - resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==} - hasBin: true - dependencies: - js-tokens: 4.0.0 - dev: true - - /mime-db@1.52.0: - resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} - engines: {node: '>= 0.6'} - dev: true - - /mime-types@2.1.35: - resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} - engines: {node: '>= 0.6'} - dependencies: - mime-db: 1.52.0 - dev: true - - /nanoid@3.3.7: - resolution: {integrity: sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==} - engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} - hasBin: true - dev: true - - /picocolors@1.0.0: - resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==} - dev: true - - /postcss-value-parser@4.2.0: - resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==} - dev: true - - /postcss@8.4.33: - resolution: {integrity: sha512-Kkpbhhdjw2qQs2O2DGX+8m5OVqEcbB9HRBvuYM9pgrjEFUg30A9LmXNlTAUj4S9kgtGyrMbTzVjH7E+s5Re2yg==} - engines: {node: ^10 || ^12 || >=14} - dependencies: - nanoid: 3.3.7 - picocolors: 1.0.0 - source-map-js: 1.0.2 - dev: true - - /proxy-from-env@1.1.0: - resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==} - dev: true - - /react-dom@18.2.0(react@18.2.0): - resolution: {integrity: sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==} - peerDependencies: - react: ^18.2.0 - dependencies: - loose-envify: 1.4.0 - react: 18.2.0 - scheduler: 0.23.0 - dev: true - - /react@18.2.0: - resolution: {integrity: sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==} - engines: {node: '>=0.10.0'} - dependencies: - loose-envify: 1.4.0 - dev: true - - /scheduler@0.23.0: - resolution: {integrity: sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw==} - dependencies: - loose-envify: 1.4.0 - dev: true - - /shallowequal@1.1.0: - resolution: {integrity: sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ==} - dev: true - - /source-map-js@1.0.2: - resolution: {integrity: sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==} - engines: {node: '>=0.10.0'} - dev: true - - /styled-components@6.1.1(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-cpZZP5RrKRIClBW5Eby4JM1wElLVP4NQrJbJ0h10TidTyJf4SIIwa3zLXOoPb4gJi8MsJ8mjq5mu2IrEhZIAcQ==} - engines: {node: '>= 16'} - peerDependencies: - react: '>= 16.8.0' - react-dom: '>= 16.8.0' - dependencies: - '@emotion/is-prop-valid': 1.2.1 - '@emotion/unitless': 0.8.1 - '@types/stylis': 4.2.4 - css-to-react-native: 3.2.0 - csstype: 3.1.2 - postcss: 8.4.33 - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - shallowequal: 1.1.0 - stylis: 4.3.0 - tslib: 2.6.2 - dev: true - - /stylis@4.3.0: - resolution: {integrity: sha512-E87pIogpwUsUwXw7dNyU4QDjdgVMy52m+XEOPEKUn161cCzWjjhPSQhByfd1CcNvrOLnXQ6OnnZDwnJrz/Z4YQ==} - dev: true - - /tslib@2.6.2: - resolution: {integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==} - dev: true diff --git a/fixtures/tsconfig/cases/builtins/thing.js b/fixtures/tsconfig/cases/builtins/thing.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/builtins/tsconfig.json b/fixtures/tsconfig/cases/builtins/tsconfig.json deleted file mode 100644 index 36aa1a4d..00000000 --- a/fixtures/tsconfig/cases/builtins/tsconfig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compilerOptions": { - "baseUrl": "." - } -} diff --git a/fixtures/tsconfig/cases/exports/index.js b/fixtures/tsconfig/cases/exports/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/exports/tsconfig.json b/fixtures/tsconfig/cases/exports/tsconfig.json deleted file mode 100644 index f0e3159b..00000000 --- a/fixtures/tsconfig/cases/exports/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-exports" -} diff --git a/fixtures/tsconfig/cases/extends-extension/base-tsconfig.json b/fixtures/tsconfig/cases/extends-extension/base-tsconfig.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/cases/extends-extension/base-tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/cases/extends-extension/foo.js b/fixtures/tsconfig/cases/extends-extension/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-extension/tsconfig.json b/fixtures/tsconfig/cases/extends-extension/tsconfig.json deleted file mode 100644 index 0ae4c6a3..00000000 --- a/fixtures/tsconfig/cases/extends-extension/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./base-tsconfig" -} diff --git a/fixtures/tsconfig/cases/extends-extensionless/foo.js b/fixtures/tsconfig/cases/extends-extensionless/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-extensionless/tsconfig.json b/fixtures/tsconfig/cases/extends-extensionless/tsconfig.json deleted file mode 100644 index c36cb7d4..00000000 --- a/fixtures/tsconfig/cases/extends-extensionless/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-field/conf" -} diff --git a/fixtures/tsconfig/cases/extends-multiple/foo.js b/fixtures/tsconfig/cases/extends-multiple/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-multiple/tsconfig.json b/fixtures/tsconfig/cases/extends-multiple/tsconfig.json deleted file mode 100644 index aa2ae783..00000000 --- a/fixtures/tsconfig/cases/extends-multiple/tsconfig.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": ["../extends-extension", "../extends-paths"], - "compilerOptions": { - "baseUrl": ".", - }, -} diff --git a/fixtures/tsconfig/cases/extends-not-found/index.js b/fixtures/tsconfig/cases/extends-not-found/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-not-found/tsconfig.json b/fixtures/tsconfig/cases/extends-not-found/tsconfig.json deleted file mode 100644 index 99df91da..00000000 --- a/fixtures/tsconfig/cases/extends-not-found/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./not-found" -} diff --git a/fixtures/tsconfig/cases/extends-paths/src/index.js b/fixtures/tsconfig/cases/extends-paths/src/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-paths/tsconfig.base.json b/fixtures/tsconfig/cases/extends-paths/tsconfig.base.json deleted file mode 100644 index 5c64b067..00000000 --- a/fixtures/tsconfig/cases/extends-paths/tsconfig.base.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "@/*": ["./*"] - } - } -} diff --git a/fixtures/tsconfig/cases/extends-paths/tsconfig.json b/fixtures/tsconfig/cases/extends-paths/tsconfig.json deleted file mode 100644 index 51086018..00000000 --- a/fixtures/tsconfig/cases/extends-paths/tsconfig.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": "./tsconfig.base.json", - "compilerOptions": { - "baseUrl": "src", - }, -} diff --git a/fixtures/tsconfig/cases/field/index.js b/fixtures/tsconfig/cases/field/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/field/tsconfig.json b/fixtures/tsconfig/cases/field/tsconfig.json deleted file mode 100644 index 9f86c3f4..00000000 --- a/fixtures/tsconfig/cases/field/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-field" -} diff --git a/fixtures/tsconfig/cases/index/index.js b/fixtures/tsconfig/cases/index/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/index/tsconfig.json b/fixtures/tsconfig/cases/index/tsconfig.json deleted file mode 100644 index d20b1774..00000000 --- a/fixtures/tsconfig/cases/index/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-index" -} diff --git a/fixtures/tsconfig/cases/paths_template_variable/foo.js b/fixtures/tsconfig/cases/paths_template_variable/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json b/fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json deleted file mode 100644 index a1a37bb6..00000000 --- a/fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "../../tsconfig_template_variable.json" -} diff --git a/fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json b/fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json deleted file mode 100644 index e7d8e5e5..00000000 --- a/fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "compilerOptions": { - "composite": true, - "paths": { - "foo": ["${configDir}/foo.js"] - } - } -} diff --git a/fixtures/tsconfig/cases/project_references/app/aliased/index.ts b/fixtures/tsconfig/cases/project_references/app/aliased/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/app/index.ts b/fixtures/tsconfig/cases/project_references/app/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/app/tsconfig.json b/fixtures/tsconfig/cases/project_references/app/tsconfig.json deleted file mode 100644 index 7036d2bb..00000000 --- a/fixtures/tsconfig/cases/project_references/app/tsconfig.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "extends": "../tsconfig.base.json", - "compilerOptions": { - "baseUrl": "./", - "paths": { - "@/*": ["./aliased/*"] - } - }, - "references": [ - { - "path": "../project_a/conf.json" - }, - { - "path": "../project_b" - }, - { - "path": "../project_c/tsconfig.json" - }, - { - "path": "../../paths_template_variable/tsconfig2.json" - } - ] -} diff --git a/fixtures/tsconfig/cases/project_references/project_a/aliased/index.ts b/fixtures/tsconfig/cases/project_references/project_a/aliased/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_a/conf.json b/fixtures/tsconfig/cases/project_references/project_a/conf.json deleted file mode 100644 index 4d389d7a..00000000 --- a/fixtures/tsconfig/cases/project_references/project_a/conf.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "compilerOptions": { - "composite": true, - "paths": { - "@/*": ["./aliased/*"] - } - } -} diff --git a/fixtures/tsconfig/cases/project_references/project_a/index.ts b/fixtures/tsconfig/cases/project_references/project_a/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_b/src/aliased/index.ts b/fixtures/tsconfig/cases/project_references/project_b/src/aliased/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_b/tsconfig.json b/fixtures/tsconfig/cases/project_references/project_b/tsconfig.json deleted file mode 100644 index 4ab05cd8..00000000 --- a/fixtures/tsconfig/cases/project_references/project_b/tsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "compilerOptions": { - "composite": true, - "baseUrl": "./src", - "paths": { - "@/*": ["./aliased/*"] - } - } -} diff --git a/fixtures/tsconfig/cases/project_references/project_c/index.ts b/fixtures/tsconfig/cases/project_references/project_c/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_c/tsconfig.json b/fixtures/tsconfig/cases/project_references/project_c/tsconfig.json deleted file mode 100644 index fe520939..00000000 --- a/fixtures/tsconfig/cases/project_references/project_c/tsconfig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compilerOptions": { - "composite": true - } -} diff --git a/fixtures/tsconfig/cases/project_references/tsconfig.base.json b/fixtures/tsconfig/cases/project_references/tsconfig.base.json deleted file mode 100644 index 88ccffe7..00000000 --- a/fixtures/tsconfig/cases/project_references/tsconfig.base.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "compilerOptions": { - } -} diff --git a/fixtures/tsconfig/cases/suffixes/a.ios.ts b/fixtures/tsconfig/cases/suffixes/a.ios.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/a.ts b/fixtures/tsconfig/cases/suffixes/a.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/b.ts b/fixtures/tsconfig/cases/suffixes/b.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/c-test.ts b/fixtures/tsconfig/cases/suffixes/c-test.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/index.ts b/fixtures/tsconfig/cases/suffixes/index.ts deleted file mode 100644 index b09939b9..00000000 --- a/fixtures/tsconfig/cases/suffixes/index.ts +++ /dev/null @@ -1 +0,0 @@ -import './a'; diff --git a/fixtures/tsconfig/cases/suffixes/tsconfig.json b/fixtures/tsconfig/cases/suffixes/tsconfig.json deleted file mode 100644 index 4c2ccc8f..00000000 --- a/fixtures/tsconfig/cases/suffixes/tsconfig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compilerOptions": { - "moduleSuffixes": [".ios", "-test", ""] - } -} diff --git a/fixtures/tsconfig/cases/trailing-comma/bar.js b/fixtures/tsconfig/cases/trailing-comma/bar.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/trailing-comma/index.js b/fixtures/tsconfig/cases/trailing-comma/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/trailing-comma/tsconfig.json b/fixtures/tsconfig/cases/trailing-comma/tsconfig.json deleted file mode 100644 index 6dc20ca5..00000000 --- a/fixtures/tsconfig/cases/trailing-comma/tsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "compilerOptions": { - "paths": { - /* some comment */ - "foo": ["bar.js"], - }, - }, - // another comment -} diff --git a/fixtures/tsconfig/foo.js b/fixtures/tsconfig/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/nested/index.js b/fixtures/tsconfig/nested/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/nested/test.js b/fixtures/tsconfig/nested/test.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/nested/tsconfig.json b/fixtures/tsconfig/nested/tsconfig.json deleted file mode 100644 index 6deb3011..00000000 --- a/fixtures/tsconfig/nested/tsconfig.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "extends": "..", - "compilerOptions": { - "paths": { - "ts-path": ["test.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-exports/conf.json b/fixtures/tsconfig/node_modules/tsconfig-exports/conf.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-exports/conf.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-exports/foo.js b/fixtures/tsconfig/node_modules/tsconfig-exports/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-exports/package.json b/fixtures/tsconfig/node_modules/tsconfig-exports/package.json deleted file mode 100644 index be0ddee6..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-exports/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "tsconfig-exports", - "private": true, - "exports": { - ".": "./conf.json" - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-field/conf.json b/fixtures/tsconfig/node_modules/tsconfig-field/conf.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-field/conf.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-field/foo.js b/fixtures/tsconfig/node_modules/tsconfig-field/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-field/package.json b/fixtures/tsconfig/node_modules/tsconfig-field/package.json deleted file mode 100644 index 7138fdde..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-field/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "tsconfig-field", - "private": true, - "tsconfig": "conf.json" -} \ No newline at end of file diff --git a/fixtures/tsconfig/node_modules/tsconfig-index/foo.js b/fixtures/tsconfig/node_modules/tsconfig-index/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-index/package.json b/fixtures/tsconfig/node_modules/tsconfig-index/package.json deleted file mode 100644 index eb2431e7..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-index/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "tsconfig-index", - "private": true -} \ No newline at end of file diff --git a/fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json b/fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-not-used/foo.js b/fixtures/tsconfig/node_modules/tsconfig-not-used/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json b/fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json deleted file mode 100644 index eb16d127..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "ts-path": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/package.json b/fixtures/tsconfig/package.json deleted file mode 100755 index f48acd1c..00000000 --- a/fixtures/tsconfig/package.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "name": "resolver", - "private": true, - "alias": { - "aliased": "foo", - "aliased-file": "./bar.js", - "something": "./nested/test.js", - "aliasedfolder": "./nested", - "aliasedabsolute": "/nested", - "foo/bar": "./bar.js", - "glob/*/*": "./nested/$2", - "./baz": "./bar.js", - "url": false - }, - "imports": { - "#test": "./bar.js" - }, - "dependencies": { - "foo": "^0.3.4" - }, - "peerDependencies": { - "bar": "*" - } -} diff --git a/fixtures/tsconfig/tsconfig.json b/fixtures/tsconfig/tsconfig.json deleted file mode 100644 index eb16d127..00000000 --- a/fixtures/tsconfig/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "ts-path": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/tsconfig_template_variable.json b/fixtures/tsconfig/tsconfig_template_variable.json deleted file mode 100644 index 6f272344..00000000 --- a/fixtures/tsconfig/tsconfig_template_variable.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["${configDir}/foo.js"] - } - } -} diff --git a/napi/__test__/resolver.spec.mjs b/napi/__test__/resolver.spec.mjs deleted file mode 100644 index 42bafba9..00000000 --- a/napi/__test__/resolver.spec.mjs +++ /dev/null @@ -1,259 +0,0 @@ -import { join } from 'node:path' -import { fileURLToPath } from 'node:url' - -import test from 'ava' - -let ResolverFactory - -if (process.env.WASI_TEST) { - const wasi = await import('../resolver.wasi.cjs') - ResolverFactory = wasi.ResolverFactory -} else { - const napi = await import('../index.js') - ResolverFactory = napi.ResolverFactory -} - -const currentDir = join(fileURLToPath(import.meta.url), '..') - -const enhancedResolveRoot = join( - currentDir, - '..', - '..', - 'fixtures', - 'enhanced_resolve', - 'test', - 'fixtures' -) - -// https://github.com/webpack/enhanced-resolve/blob/main/test/resolve.test.js - -for (const [title, context, request, expected] of [ - [ - 'absolute path', - enhancedResolveRoot, - join(enhancedResolveRoot, 'main1.js'), - join(enhancedResolveRoot, 'main1.js'), - ], - [ - 'file with .js', - enhancedResolveRoot, - './main1.js', - join(enhancedResolveRoot, 'main1.js'), - ], - [ - 'file without extension', - enhancedResolveRoot, - './main1', - join(enhancedResolveRoot, 'main1.js'), - ], - [ - 'another file with .js', - enhancedResolveRoot, - './a.js', - join(enhancedResolveRoot, 'a.js'), - ], - [ - 'another file without extension', - enhancedResolveRoot, - './a', - join(enhancedResolveRoot, 'a.js'), - ], - [ - 'file in module with .js', - enhancedResolveRoot, - 'm1/a.js', - join(enhancedResolveRoot, 'node_modules/m1/a.js'), - ], - [ - 'file in module without extension', - enhancedResolveRoot, - 'm1/a', - join(enhancedResolveRoot, 'node_modules/m1/a.js'), - ], - [ - 'another file in module without extension', - enhancedResolveRoot, - 'complexm/step1', - join(enhancedResolveRoot, 'node_modules/complexm/step1.js'), - ], - [ - 'from submodule to file in sibling module', - join(enhancedResolveRoot, 'node_modules/complexm'), - 'm2/b.js', - join(enhancedResolveRoot, 'node_modules/m2/b.js'), - ], - [ - 'from nested directory to overwritten file in module', - join(enhancedResolveRoot, 'multiple_modules'), - 'm1/a.js', - join(enhancedResolveRoot, 'multiple_modules/node_modules/m1/a.js'), - ], - [ - 'from nested directory to not overwritten file in module', - join(enhancedResolveRoot, 'multiple_modules'), - 'm1/b.js', - join(enhancedResolveRoot, 'node_modules/m1/b.js'), - ], - [ - 'file with query', - enhancedResolveRoot, - './main1.js?query', - join(enhancedResolveRoot, 'main1.js?query'), - ], - [ - 'file with fragment', - enhancedResolveRoot, - './main1.js#fragment', - join(enhancedResolveRoot, 'main1.js#fragment'), - ], - [ - 'file with fragment and query', - enhancedResolveRoot, - './main1.js#fragment?query', - join(enhancedResolveRoot, 'main1.js#fragment?query'), - ], - [ - 'file with query and fragment', - enhancedResolveRoot, - './main1.js?#fragment', - join(enhancedResolveRoot, 'main1.js?#fragment'), - ], - - [ - 'file with query (unicode)', - enhancedResolveRoot, - './测试.js?query', - join(enhancedResolveRoot, '测试.js?query'), - ], - [ - 'file with fragment (unicode)', - enhancedResolveRoot, - './测试.js#fragment', - join(enhancedResolveRoot, '测试.js#fragment'), - ], - [ - 'file with fragment and query (unicode)', - enhancedResolveRoot, - './测试.js#fragment?query', - join(enhancedResolveRoot, '测试.js#fragment?query'), - ], - [ - 'file with query and fragment (unicode)', - enhancedResolveRoot, - './测试.js?#fragment', - join(enhancedResolveRoot, '测试.js?#fragment'), - ], - - [ - 'file in module with query', - enhancedResolveRoot, - 'm1/a?query', - join(enhancedResolveRoot, 'node_modules/m1/a.js?query'), - ], - [ - 'file in module with fragment', - enhancedResolveRoot, - 'm1/a#fragment', - join(enhancedResolveRoot, 'node_modules/m1/a.js#fragment'), - ], - [ - 'file in module with fragment and query', - enhancedResolveRoot, - 'm1/a#fragment?query', - join(enhancedResolveRoot, 'node_modules/m1/a.js#fragment?query'), - ], - [ - 'file in module with query and fragment', - enhancedResolveRoot, - 'm1/a?#fragment', - join(enhancedResolveRoot, 'node_modules/m1/a.js?#fragment'), - ], - [ - 'differ between directory and file, resolve file', - enhancedResolveRoot, - './dirOrFile', - join(enhancedResolveRoot, 'dirOrFile.js'), - ], - [ - 'differ between directory and file, resolve directory', - enhancedResolveRoot, - './dirOrFile/', - join(enhancedResolveRoot, 'dirOrFile/index.js'), - ], - [ - 'find node_modules outside of node_modules', - join(enhancedResolveRoot, 'browser-module/node_modules'), - 'm1/a', - join(enhancedResolveRoot, 'node_modules/m1/a.js'), - ], - [ - "don't crash on main field pointing to self", - enhancedResolveRoot, - './main-field-self', - join(enhancedResolveRoot, './main-field-self/index.js'), - ], - [ - "don't crash on main field pointing to self (2)", - enhancedResolveRoot, - './main-field-self2', - join(enhancedResolveRoot, './main-field-self2/index.js'), - ], - // enhanced-resolve has `#` prepended with a `\0`, they are removed from the - // following 3 expected test results. - // See https://github.com/webpack/enhanced-resolve#escaping - [ - 'handle fragment edge case (no fragment)', - enhancedResolveRoot, - './no#fragment/#/#', - join(enhancedResolveRoot, 'no#fragment', '#', '#.js'), - ], - [ - 'handle fragment edge case (fragment)', - enhancedResolveRoot, - './no#fragment/#/', - join(enhancedResolveRoot, 'no.js#fragment') + '/#/', - ], - [ - 'handle fragment escaping', - enhancedResolveRoot, - './no\0#fragment/\0#/\0##fragment', - join(enhancedResolveRoot, 'no#fragment', '#', '#.js#fragment'), - ], -]) { - test(title, (t) => { - const resolver = new ResolverFactory({ - modules: ['src/a', 'src/b', 'src/common', 'node_modules'], - extensions: ['.js', '.jsx', '.ts', '.tsx'], - }) - - t.is(resolver.sync(context, request).path, expected) - }) -} - -test('resolve pnpm package', (t) => { - const pnpmProjectPath = join(currentDir, '..', '..', 'fixtures', 'pnpm8') - const resolver = new ResolverFactory({ - aliasFields: ['browser'], - }) - t.deepEqual(resolver.sync(pnpmProjectPath, 'styled-components'), { - path: join( - pnpmProjectPath, - 'node_modules/.pnpm/styled-components@6.1.1_react-dom@18.2.0_react@18.2.0/node_modules/styled-components/dist/styled-components.browser.cjs.js' - ), - }) - t.deepEqual( - resolver.sync( - join( - pnpmProjectPath, - 'node_modules/.pnpm/styled-components@6.1.1_react-dom@18.2.0_react@18.2.0/node_modules/styled-components' - ), - 'react' - ), - { - path: join( - pnpmProjectPath, - 'node_modules/.pnpm/react@18.2.0/node_modules/react/index.js' - ), - } - ) -}) diff --git a/napi/src/lib.rs b/napi/src/lib.rs deleted file mode 100644 index 238f99c4..00000000 --- a/napi/src/lib.rs +++ /dev/null @@ -1,166 +0,0 @@ -extern crate napi; -extern crate napi_derive; -extern crate oxc_resolver; - -use std::path::{Path, PathBuf}; - -use napi_derive::napi; -use oxc_resolver::{ResolveOptions, Resolver}; - -use self::options::{NapiResolveOptions, StrOrStrList}; - -mod options; - -#[napi(object)] -pub struct ResolveResult { - pub path: Option, - pub error: Option, -} - -fn resolve(resolver: &Resolver, path: &Path, request: &str) -> ResolveResult { - match resolver.resolve(path, request) { - Ok(resolution) => ResolveResult { - path: Some(resolution.full_path().to_string_lossy().to_string()), - error: None, - }, - Err(err) => ResolveResult { path: None, error: Some(err.to_string()) }, - } -} - -#[allow(clippy::needless_pass_by_value)] -#[napi] -pub fn sync(path: String, request: String) -> ResolveResult { - let path = PathBuf::from(path); - let resolver = Resolver::new(ResolveOptions::default()); - resolve(&resolver, &path, &request) -} - -#[napi] -pub struct ResolverFactory { - resolver: Resolver, -} - -#[napi] -impl ResolverFactory { - #[napi(constructor)] - pub fn new(options: NapiResolveOptions) -> Self { - Self { resolver: Resolver::new(Self::normalize_options(options)) } - } - - #[napi] - pub fn default() -> Self { - let default_options = ResolveOptions::default(); - Self { resolver: Resolver::new(default_options) } - } - - /// Clone the resolver using the same underlying cache. - #[napi] - pub fn clone_with_options(&self, options: NapiResolveOptions) -> Self { - Self { resolver: self.resolver.clone_with_options(Self::normalize_options(options)) } - } - - /// Clear the underlying cache. - #[napi] - pub fn clear_cache(&self) { - self.resolver.clear_cache(); - } - - #[allow(clippy::needless_pass_by_value)] - #[napi] - pub fn sync(&self, path: String, request: String) -> ResolveResult { - let path = PathBuf::from(path); - resolve(&self.resolver, &path, &request) - } - - fn normalize_options(op: NapiResolveOptions) -> ResolveOptions { - let default = ResolveOptions::default(); - // merging options - ResolveOptions { - tsconfig: op.tsconfig.map(|tsconfig| tsconfig.into()), - alias: op - .alias - .map(|alias| { - alias - .into_iter() - .map(|(k, v)| { - let v = v - .into_iter() - .map(|item| match item { - Some(path) => oxc_resolver::AliasValue::from(path), - None => oxc_resolver::AliasValue::Ignore, - }) - .collect(); - (k, v) - }) - .collect::>() - }) - .unwrap_or(default.alias), - alias_fields: op - .alias_fields - .map(|o| o.into_iter().map(|x| StrOrStrList(x).into()).collect::>()) - .unwrap_or(default.alias_fields), - condition_names: op.condition_names.unwrap_or(default.condition_names), - description_files: op.description_files.unwrap_or(default.description_files), - enforce_extension: op - .enforce_extension - .map(|enforce_extension| enforce_extension.into()) - .unwrap_or(default.enforce_extension), - exports_fields: op - .exports_fields - .map(|o| o.into_iter().map(|x| StrOrStrList(x).into()).collect::>()) - .unwrap_or(default.exports_fields), - imports_fields: op - .imports_fields - .map(|o| o.into_iter().map(|x| StrOrStrList(x).into()).collect::>()) - .unwrap_or(default.imports_fields), - extension_alias: op - .extension_alias - .map(|extension_alias| extension_alias.into_iter().collect::>()) - .unwrap_or(default.extension_alias), - extensions: op.extensions.unwrap_or(default.extensions), - fallback: op - .fallback - .map(|fallback| { - fallback - .into_iter() - .map(|(k, v)| { - let v = v - .into_iter() - .map(|item| match item { - Some(path) => oxc_resolver::AliasValue::from(path), - None => oxc_resolver::AliasValue::Ignore, - }) - .collect(); - (k, v) - }) - .collect::>() - }) - .unwrap_or(default.fallback), - fully_specified: op.fully_specified.unwrap_or(default.fully_specified), - main_fields: op - .main_fields - .map(|o| StrOrStrList(o).into()) - .unwrap_or(default.main_fields), - main_files: op.main_files.unwrap_or(default.main_files), - modules: op.modules.map(|o| StrOrStrList(o).into()).unwrap_or(default.modules), - resolve_to_context: op.resolve_to_context.unwrap_or(default.resolve_to_context), - prefer_relative: op.prefer_relative.unwrap_or(default.prefer_relative), - prefer_absolute: op.prefer_absolute.unwrap_or(default.prefer_absolute), - restrictions: op - .restrictions - .map(|restrictions| { - restrictions - .into_iter() - .map(|restriction| restriction.into()) - .collect::>() - }) - .unwrap_or(default.restrictions), - roots: op - .roots - .map(|roots| roots.into_iter().map(PathBuf::from).collect::>()) - .unwrap_or(default.roots), - symlinks: op.symlinks.unwrap_or(default.symlinks), - builtin_modules: op.builtin_modules.unwrap_or(default.builtin_modules), - } - } -} diff --git a/napi/src/options.rs b/napi/src/options.rs deleted file mode 100644 index ea35672f..00000000 --- a/napi/src/options.rs +++ /dev/null @@ -1,261 +0,0 @@ -use std::path::PathBuf; - -use napi::Either; -use napi_derive::napi; -use std::collections::HashMap; - -/// Module Resolution Options -/// -/// Options are directly ported from [enhanced-resolve](https://github.com/webpack/enhanced-resolve#resolver-options). -/// -/// See [webpack resolve](https://webpack.js.org/configuration/resolve/) for information and examples -#[derive(Debug, Clone)] -#[napi(object)] -pub struct NapiResolveOptions { - /// Path to TypeScript configuration file. - /// - /// Default `None` - pub tsconfig: Option, - - /// Alias for [ResolveOptions::alias] and [ResolveOptions::fallback]. - /// - /// For the second value of the tuple, `None -> AliasValue::Ignore`, Some(String) -> - /// AliasValue::Path(String)` - /// Create aliases to import or require certain modules more easily. - /// A trailing $ can also be added to the given object's keys to signify an exact match. - pub alias: Option>>>, - - /// A list of alias fields in description files. - /// Specify a field, such as `browser`, to be parsed according to [this specification](https://github.com/defunctzombie/package-browser-field-spec). - /// Can be a path to json object such as `["path", "to", "exports"]`. - /// - /// Default `[]` - #[napi(ts_type = "(string | string[])[]")] - pub alias_fields: Option>, - - /// Condition names for exports field which defines entry points of a package. - /// The key order in the exports field is significant. During condition matching, earlier entries have higher priority and take precedence over later entries. - /// - /// Default `[]` - pub condition_names: Option>, - - /// The JSON files to use for descriptions. (There was once a `bower.json`.) - /// - /// Default `["package.json"]` - pub description_files: Option>, - - /// If true, it will not allow extension-less files. - /// So by default `require('./foo')` works if `./foo` has a `.js` extension, - /// but with this enabled only `require('./foo.js')` will work. - /// - /// Default to `true` when [ResolveOptions::extensions] contains an empty string. - /// Use `Some(false)` to disable the behavior. - /// See - /// - /// Default None, which is the same as `Some(false)` when the above empty rule is not applied. - pub enforce_extension: Option, - - /// A list of exports fields in description files. - /// Can be a path to json object such as `["path", "to", "exports"]`. - /// - /// Default `[["exports"]]`. - #[napi(ts_type = "(string | string[])[]")] - pub exports_fields: Option>, - - /// Fields from `package.json` which are used to provide the internal requests of a package - /// (requests starting with # are considered internal). - /// - /// Can be a path to a JSON object such as `["path", "to", "imports"]`. - /// - /// Default `[["imports"]]`. - #[napi(ts_type = "(string | string[])[]")] - pub imports_fields: Option>, - - /// An object which maps extension to extension aliases. - /// - /// Default `{}` - pub extension_alias: Option>>, - - /// Attempt to resolve these extensions in order. - /// If multiple files share the same name but have different extensions, - /// will resolve the one with the extension listed first in the array and skip the rest. - /// - /// Default `[".js", ".json", ".node"]` - pub extensions: Option>, - - /// Redirect module requests when normal resolving fails. - /// - /// Default `[]` - pub fallback: Option>>>, - - /// 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). - /// - /// See also webpack configuration [resolve.fullySpecified](https://webpack.js.org/configuration/module/#resolvefullyspecified) - /// - /// Default `false` - pub fully_specified: Option, - - /// A list of main fields in description files - /// - /// Default `["main"]`. - #[napi(ts_type = "string | string[]")] - pub main_fields: Option, - - /// The filename to be used while resolving directories. - /// - /// Default `["index"]` - pub main_files: Option>, - - /// A list of directories to resolve modules from, can be absolute path or folder name. - /// - /// Default `["node_modules"]` - #[napi(ts_type = "string | string[]")] - pub modules: Option, - - /// Resolve to a context instead of a file. - /// - /// Default `false` - pub resolve_to_context: Option, - - /// Prefer to resolve module requests as relative requests instead of using modules from node_modules directories. - /// - /// Default `false` - pub prefer_relative: Option, - - /// Prefer to resolve server-relative urls as absolute paths before falling back to resolve in ResolveOptions::roots. - /// - /// Default `false` - pub prefer_absolute: Option, - - /// A list of resolve restrictions to restrict the paths that a request can be resolved on. - /// - /// Default `[]` - pub restrictions: Option>, - - /// A list of directories where requests of server-relative URLs (starting with '/') are resolved. - /// On non-Windows systems these requests are resolved as an absolute path first. - /// - /// Default `[]` - pub roots: Option>, - - /// Whether to resolve symlinks to their symlinked location. - /// When enabled, symlinked resources are resolved to their real path, not their symlinked location. - /// Note that this may cause module resolution to fail when using tools that symlink packages (like npm link). - /// - /// Default `true` - pub symlinks: Option, - - /// Whether to parse [module.builtinModules](https://nodejs.org/api/module.html#modulebuiltinmodules) or not. - /// For example, "zlib" will throw [crate::ResolveError::Builtin] when set to true. - /// - /// Default `false` - pub builtin_modules: Option, -} - -#[napi] -#[derive(Debug, PartialEq, Eq)] -pub enum EnforceExtension { - Auto, - Enabled, - Disabled, -} - -impl EnforceExtension { - pub fn is_auto(&self) -> bool { - *self == Self::Auto - } - - pub fn is_enabled(&self) -> bool { - *self == Self::Enabled - } - - pub fn is_disabled(&self) -> bool { - *self == Self::Disabled - } -} - -/// Alias Value for [ResolveOptions::alias] and [ResolveOptions::fallback]. -/// Use struct because napi don't support structured union now -#[napi(object)] -#[derive(Debug, Clone)] -pub struct Restriction { - pub path: Option, - pub regex: Option, -} - -/// Tsconfig Options -/// -/// Derived from [tsconfig-paths-webpack-plugin](https://github.com/dividab/tsconfig-paths-webpack-plugin#options) -#[napi(object)] -#[derive(Debug, Clone)] -pub struct TsconfigOptions { - /// Allows you to specify where to find the TypeScript configuration file. - /// You may provide - /// * a relative path to the configuration file. It will be resolved relative to cwd. - /// * an absolute path to the configuration file. - pub config_file: String, - - /// Support for Typescript Project References. - /// - /// * `'auto'`: use the `references` field from tsconfig of `config_file`. - /// * `string[]`: manually provided relative or absolute path. - #[napi(ts_type = "'auto' | string[]")] - pub references: Option>>, -} - -impl Into for Restriction { - fn into(self) -> oxc_resolver::Restriction { - match (self.path, self.regex) { - (None, None) => { - panic!("Should specify path or regex") - } - (None, Some(regex)) => oxc_resolver::Restriction::RegExp(regex), - (Some(path), None) => oxc_resolver::Restriction::Path(PathBuf::from(path)), - (Some(_), Some(_)) => { - panic!("Restriction can't be path and regex at the same time") - } - } - } -} - -impl Into for EnforceExtension { - fn into(self) -> oxc_resolver::EnforceExtension { - match self { - EnforceExtension::Auto => oxc_resolver::EnforceExtension::Auto, - EnforceExtension::Enabled => oxc_resolver::EnforceExtension::Enabled, - EnforceExtension::Disabled => oxc_resolver::EnforceExtension::Disabled, - } - } -} - -impl Into for TsconfigOptions { - fn into(self) -> oxc_resolver::TsconfigOptions { - oxc_resolver::TsconfigOptions { - config_file: PathBuf::from(self.config_file), - references: match self.references { - Some(Either::A(string)) if string.as_str() == "auto" => { - oxc_resolver::TsconfigReferences::Auto - } - Some(Either::A(opt)) => { - panic!("`{}` is not a valid option for tsconfig references", opt) - } - Some(Either::B(paths)) => oxc_resolver::TsconfigReferences::Paths( - paths.into_iter().map(PathBuf::from).collect::>(), - ), - None => oxc_resolver::TsconfigReferences::Disabled, - }, - } - } -} - -type StrOrStrListType = Either>; -pub struct StrOrStrList(pub StrOrStrListType); - -impl Into> for StrOrStrList { - fn into(self) -> Vec { - match self { - StrOrStrList(Either::A(s)) => Vec::from([s]), - StrOrStrList(Either::B(a)) => a, - } - } -} diff --git a/napi/tests/options.test.mjs b/napi/tests/options.test.mjs deleted file mode 100644 index 4a93efff..00000000 --- a/napi/tests/options.test.mjs +++ /dev/null @@ -1,59 +0,0 @@ -import { describe, it } from "node:test"; -import { ResolverFactory } from "../index.js"; -import * as assert from "node:assert"; -import * as path from "node:path"; - -const fixtureDir = new URL( - "../../fixtures/enhanced_resolve/test/fixtures", - import.meta.url -).pathname; - -describe("option", () => { - describe("aliasFields", () => { - it("should allow field string ", () => { - const resolver = new ResolverFactory({ aliasFields: ["browser"] }); - assert.match( - resolver.sync(fixtureDir, "./browser-module/lib/replaced.js").path, - /browser-module\/lib\/browser\.js$/ - ); - }); - it("should allow json path array", () => { - const resolver = new ResolverFactory({ - aliasFields: [["innerBrowser1", "field", "browser"]], - }); - - assert.match( - resolver.sync(fixtureDir, "./browser-module/lib/main1.js").path, - /browser-module\/lib\/main\.js$/ - ); - }); - }); - - describe("exportsFields", () => { - const createTest = (exportsFields) => { - const resolver = new ResolverFactory({ exportsFields }); - assert.match( - resolver.sync( - path.resolve(fixtureDir, "./exports-field3"), - "exports-field" - ).path, - /\/exports-field\/src\/index\.js$/ - ); - }; - it("should allow string as field item", createTest(["broken"])); - it("should allow json path array as field item", createTest([["broken"]])); - }); - - describe("mainFields", () => { - const createTest = (mainFields) => { - const resolver = new ResolverFactory({ mainFields }); - assert.match( - resolver.sync(fixtureDir, "../..").path, - /\/lib\/index\.js$/ - ); - }; - it("should use `'main'` as default", createTest(undefined)); - it("should allow field string", createTest("main")); - it("should allow field array", createTest(["main"])); - }); -}); diff --git a/npm/package.json b/npm/package.json index 6fa93185..b47e6b07 100644 --- a/npm/package.json +++ b/npm/package.json @@ -1,41 +1,30 @@ { - "name": "oxc-resolver", - "version": "1.8.1", - "description": "Oxc Resolver Node API", - "main": "index.js", - "browser": "browser.js", - "files": [ - "index.d.ts", - "index.js", - "browser.js" - ], - "license": "MIT", - "homepage": "https://oxc-project.github.io", - "repository": { - "type": "git", - "url": "git+https://github.com/oxc-project/oxc-resolver.git" - }, - "publishConfig": { - "registry": "https://registry.npmjs.org/", - "access": "public" - }, - "napi": { - "binaryName": "resolver", - "packageName": "@oxc-resolver/binding", - "targets": [ - "x86_64-pc-windows-msvc", - "aarch64-pc-windows-msvc", - "x86_64-unknown-linux-gnu", - "x86_64-unknown-linux-musl", - "aarch64-unknown-linux-gnu", - "aarch64-unknown-linux-musl", - "armv7-unknown-linux-gnueabihf", - "x86_64-apple-darwin", - "aarch64-apple-darwin", - "wasm32-wasip1-threads" - ] - }, - "funding": { - "url": "https://github.com/sponsors/Boshen" - } + "name": "oxc-resolver", + "description": "Oxc Resolver Node API", + "funding": { + "url": "https://github.com/sponsors/Boshen" + }, + "main": "index.js", + "browser": "browser.js", + "files": [ + "index.d.ts", + "index.js", + "browser.js" + ], + "napi": { + "binaryName": "resolver", + "packageName": "@oxc-resolver/binding", + "targets": [ + "x86_64-pc-windows-msvc", + "aarch64-pc-windows-msvc", + "x86_64-unknown-linux-gnu", + "x86_64-unknown-linux-musl", + "aarch64-unknown-linux-gnu", + "aarch64-unknown-linux-musl", + "armv7-unknown-linux-gnueabihf", + "x86_64-apple-darwin", + "aarch64-apple-darwin", + "wasm32-wasip1-threads" + ] + } } diff --git a/package.json b/package.json index 8d0dedc4..a431e48f 100644 --- a/package.json +++ b/package.json @@ -1,33 +1,24 @@ { - "name": "@oxc-resolver/binding", - "private": true, - "version": "0.0.0", - "scripts": { - "build": "napi build --platform --release --package-json-path npm/package.json --manifest-path napi/Cargo.toml", - "build:debug": "napi build --platform --package-json-path npm/package.json --manifest-path napi/Cargo.toml", - "prepublishOnly": "napi pre-publish -t npm", - "test": "ava" - }, - "devDependencies": { - "@napi-rs/cli": "^3.0.0-alpha.43", - "@napi-rs/wasm-runtime": "^0.2.0", - "@types/node": "^20.10.4", - "ava": "^6.0.1", - "emnapi": "^1.0.0", - "typescript": "^5.3.3" - }, - "ava": { - "files": [ - "napi/__test__/*.spec.mjs" - ], - "cache": false - }, - "packageManager": "pnpm@9.2.0", - "repository": { - "type": "git", - "url": "git+https://github.com/oxc-project/oxc-resolver.git" - }, - "funding": { - "url": "https://github.com/sponsors/Boshen" - } + "name": "@oxc-resolver/binding", + "funding": { + "url": "https://github.com/sponsors/Boshen" + }, + "scripts": { + "build": "napi build --platform --release --package-json-path npm/package.json --manifest-path napi/Cargo.toml", + "build:debug": "napi build --platform --package-json-path npm/package.json --manifest-path napi/Cargo.toml", + "prepublishOnly": "napi pre-publish -t npm" + }, + "ava": { + "cache": false, + "files": [ + "napi/__test__/*.spec.mjs" + ] + }, + "devDependencies": { + "@napi-rs/cli": "^3.0.0-alpha.43", + "@napi-rs/wasm-runtime": "^0.2.0", + "@types/node": "^20.10.4", + "ava": "^6.0.1", + "emnapi": "^1.0.0" + } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml deleted file mode 100644 index 878ba525..00000000 --- a/pnpm-lock.yaml +++ /dev/null @@ -1,2450 +0,0 @@ -lockfileVersion: '9.0' - -settings: - autoInstallPeers: true - excludeLinksFromLockfile: false - -importers: - - .: - devDependencies: - '@napi-rs/cli': - specifier: ^3.0.0-alpha.43 - version: 3.0.0-alpha.51(@emnapi/runtime@1.1.1)(emnapi@1.1.1) - '@napi-rs/wasm-runtime': - specifier: ^0.2.0 - version: 0.2.0 - '@types/node': - specifier: ^20.10.4 - version: 20.12.7 - ava: - specifier: ^6.0.1 - version: 6.1.2 - emnapi: - specifier: ^1.0.0 - version: 1.1.1 - typescript: - specifier: ^5.3.3 - version: 5.4.5 - -packages: - - '@emnapi/core@1.1.1': - resolution: {integrity: sha512-eu4KjHfXg3I+UUR7vSuwZXpRo4c8h4Rtb5Lu2F7Z4JqJFl/eidquONEBiRs6viXKpWBC3BaJBy68xGJ2j56idw==} - - '@emnapi/runtime@1.1.1': - resolution: {integrity: sha512-3bfqkzuR1KLx57nZfjr2NLnFOobvyS0aTszaEGCGqmYMVDRaGvgIZbjGSV/MHSSmLgQ/b9JFHQ5xm5WRZYd+XQ==} - - '@inquirer/figures@1.0.1': - resolution: {integrity: sha512-mtup3wVKia3ZwULPHcbs4Mor8Voi+iIXEWD7wCNbIO6lYR62oPCTQyrddi5OMYVXHzeCSoneZwJuS8sBvlEwDw==} - engines: {node: '>=18'} - - '@ljharb/through@2.3.13': - resolution: {integrity: sha512-/gKJun8NNiWGZJkGzI/Ragc53cOdcLNdzjLaIa+GEjguQs0ulsurx8WN0jijdK9yPqDvziX995sMRLyLt1uZMQ==} - engines: {node: '>= 0.4'} - - '@mapbox/node-pre-gyp@1.0.11': - resolution: {integrity: sha512-Yhlar6v9WQgUp/He7BdgzOz8lqMQ8sU+jkCq7Wx8Myc5YFJLbEe7lgui/V7G1qB1DJykHSGwreceSaD60Y0PUQ==} - hasBin: true - - '@napi-rs/cli@3.0.0-alpha.51': - resolution: {integrity: sha512-fzTQ4RfhaghFNryWTfb0e93N/J7hNfAOpUNL98u9qMymsXa3w2cUTN8W/HjiNVTUvHHus8X5PuHt9q65cDXcSg==} - engines: {node: '>= 16'} - hasBin: true - peerDependencies: - '@emnapi/runtime': ^1.1.0 - emnapi: ^1.1.0 - peerDependenciesMeta: - '@emnapi/runtime': - optional: true - emnapi: - optional: true - - '@napi-rs/cross-toolchain@0.0.14': - resolution: {integrity: sha512-Xgoe1gCEo5s5VUxmSnK4tYFJXW2JAVM02jptSbqA2+gp8pt4Vuk9oK2LvswwO9iRfHapKacYYhegD8Dq/+PBOQ==} - peerDependencies: - '@napi-rs/cross-toolchain-arm64-target-aarch64': ^0.0.14 - '@napi-rs/cross-toolchain-arm64-target-armv7': ^0.0.14 - '@napi-rs/cross-toolchain-arm64-target-x86_64': ^0.0.14 - '@napi-rs/cross-toolchain-x64-target-aarch64': ^0.0.14 - '@napi-rs/cross-toolchain-x64-target-armv7': ^0.0.14 - '@napi-rs/cross-toolchain-x64-target-x86_64': ^0.0.14 - peerDependenciesMeta: - '@napi-rs/cross-toolchain-arm64-target-aarch64': - optional: true - '@napi-rs/cross-toolchain-arm64-target-armv7': - optional: true - '@napi-rs/cross-toolchain-arm64-target-x86_64': - optional: true - '@napi-rs/cross-toolchain-x64-target-aarch64': - optional: true - '@napi-rs/cross-toolchain-x64-target-armv7': - optional: true - '@napi-rs/cross-toolchain-x64-target-x86_64': - optional: true - - '@napi-rs/lzma-android-arm-eabi@1.2.1': - resolution: {integrity: sha512-GKXud2hTddxehff1mAGkbTfseBj+GcM+M/sZuxf9H9CJeOWpfI/HC9Oy3uv8mBqPTkOQdCcZ/xXPU34EOEwiRg==} - engines: {node: '>= 10'} - cpu: [arm] - os: [android] - - '@napi-rs/lzma-android-arm64@1.2.1': - resolution: {integrity: sha512-UKFvc56TdgljbdgLvSwM62pSItV/4SuXXCrJtruPDmbIDe8HKag8hsCKsb66hrc9aX7urJ+KGw1yz5hWiONLyw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [android] - - '@napi-rs/lzma-darwin-arm64@1.2.1': - resolution: {integrity: sha512-eLbHzK5xGVzEABb1ESFELQJzXKoQeP9QH9hMPd4Qq29xD6MkWD2VKlAy40AxrMeWc7fCUIImTTlGuGRvg6tI1g==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [darwin] - - '@napi-rs/lzma-darwin-x64@1.2.1': - resolution: {integrity: sha512-/a5sHZkkO81w/PCpxlwXjADz++jDiTJquMzCLAhupd23wTRmJoCBAwp4Tur+qV5esI7ahAA0lS5P0M4TZv+OUg==} - engines: {node: '>= 10'} - cpu: [x64] - os: [darwin] - - '@napi-rs/lzma-freebsd-x64@1.2.1': - resolution: {integrity: sha512-Ehc0ld148YcqQrDWwUbVta1l45R4PthCIU6ZDbOYzzeYXQnhgr1fWiex7wu4KMFppteHlYntypUIhmMUklqchA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [freebsd] - - '@napi-rs/lzma-linux-arm-gnueabihf@1.2.1': - resolution: {integrity: sha512-EkIsx3kC67viElNetZgaGAtAceA+4pVGj31HKKPn0RZYn3rCNdEEg2i1IRg07Y6m4bHwcaKutLoZ2LDcQ+yiBg==} - engines: {node: '>= 10'} - cpu: [arm] - os: [linux] - - '@napi-rs/lzma-linux-arm64-gnu@1.2.1': - resolution: {integrity: sha512-GxSbp1/X7Ppmf+aNiZ95vl1HgQzRS9C8zCv7unEhYRPAjRkAnlrsLluUBOTPIY2yquuUvfIog9XIml6Hpw2wrA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/lzma-linux-arm64-musl@1.2.1': - resolution: {integrity: sha512-2L3KHFGGdt0xgU0WcKwKmnjVCYs88t4+ixBgPfEydtYsOceg6B8eOzdM7xsziKxJyUJKWBetGLgARQOy35bfvA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/lzma-linux-x64-gnu@1.2.1': - resolution: {integrity: sha512-h29XttA2Og1+6vYHsVcp+i1PkeILKzYnoDun0ul/k/5hvfxJ2Jap+EM07sW4HSz/DiscLAeIZmLKbXEqJgF5bg==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/lzma-linux-x64-musl@1.2.1': - resolution: {integrity: sha512-8EIkpLid4pepkBsljQ7rgma8jdwAuwVyJ2tY6Wuj1I/AqAkVVfxTwIuYc4zgRR3nfcrmWgOfZE0VneVmQCE5hw==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/lzma-win32-arm64-msvc@1.2.1': - resolution: {integrity: sha512-RNPItarWUUbtwz6dyn8FGH9AXEaAsBcMBlTvcRjv8eoqRqyZ9R49Ruk/8WMS57MM1BKdiPDxHBtRi+nZn27Slw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [win32] - - '@napi-rs/lzma-win32-ia32-msvc@1.2.1': - resolution: {integrity: sha512-rNdsCZnzKVgeDd9NzXWk9WuADVUWUWdnws8qBRCfHRUQqJ56Ic1W7Y1XmP+bNa985MXlU6vbznHTHmU5zk2P+A==} - engines: {node: '>= 10'} - cpu: [ia32] - os: [win32] - - '@napi-rs/lzma-win32-x64-msvc@1.2.1': - resolution: {integrity: sha512-1AFrAh1n73Yw+IhDu5HnaiRD4vWEkafY0EarfziPfDsh/GeyNcjbE+Let+XFe8L3j0/CZfsRG3nXarOW1oadUQ==} - engines: {node: '>= 10'} - cpu: [x64] - os: [win32] - - '@napi-rs/lzma@1.2.1': - resolution: {integrity: sha512-vwl34tzF2mXWthnFVN2MP6nRzQ40C5+256EEUjxAwj9dbAhDqb7Yz376Up5SlB4YgNC0YvEqK4jsYP/NP0bgpg==} - engines: {node: '>= 10'} - - '@napi-rs/tar-android-arm-eabi@0.1.0': - resolution: {integrity: sha512-gY9f7HfyU8MQs/ERi2/Fc4dGRf61ZM2pme31t0FkrzTtmeIaf56LiTeTt4aP8xh/0HOVnXrB6I3taY9IsQVB8Q==} - engines: {node: '>= 10'} - cpu: [arm] - os: [android] - - '@napi-rs/tar-android-arm64@0.1.0': - resolution: {integrity: sha512-NxszsTRdAYf25kKuzUYz514/5MFI3w3aHToZBcFjaxUmsayrimFrHIiPLwNQVe55lHPRi13njqQUPjMetHMCZw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [android] - - '@napi-rs/tar-darwin-arm64@0.1.0': - resolution: {integrity: sha512-G+fSNcwhbekTMOElS66mf3ccg8M4NcEHIgo7s6Hxo8U2obUSqEJ0WjTDV8oJy7lqRW/MeeDJj8Vz0ceXC8ueeA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [darwin] - - '@napi-rs/tar-darwin-x64@0.1.0': - resolution: {integrity: sha512-p9aOLk6O2+Cu62fNOdj1Zx0P3J1VkxtihXOVDaK49o5jszhms0roNA7kZfklwjVdwo8R7OQC6mJcFWmiamMNug==} - engines: {node: '>= 10'} - cpu: [x64] - os: [darwin] - - '@napi-rs/tar-freebsd-x64@0.1.0': - resolution: {integrity: sha512-mZQPtyCc2r+P84WV76Ddbe1+CxBscxlDHtgMIxZPveMgq4esZFKp26M735vjxtk/j2ahT0pZoC6fjsJ//Uxzlg==} - engines: {node: '>= 10'} - cpu: [x64] - os: [freebsd] - - '@napi-rs/tar-linux-arm-gnueabihf@0.1.0': - resolution: {integrity: sha512-FHxnmrOS345T3n3XDmY9QEoVv1PXkkuevQbu+gzq5np4fzN/NX2Az5oJTxKOTGtlJSaxxz90raeaWRZrnV5hZQ==} - engines: {node: '>= 10'} - cpu: [arm] - os: [linux] - - '@napi-rs/tar-linux-arm64-gnu@0.1.0': - resolution: {integrity: sha512-+8WHnL/8PPpePYc+5oqNLoE5o98vWF7lJvY/seji7tdcS5TPJ3tgXaF4/y1rFAaSxKsZ9l+ClHsZZ0MpCqMOOQ==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/tar-linux-arm64-musl@0.1.0': - resolution: {integrity: sha512-SXqU4H30/TD9BZa6pH/U5l2V6E4EKOutjHp9Sqr98iH52Zb+1N84ur1Ti7/+PapKunCIJeZzU+792CQagKIzuQ==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/tar-linux-x64-gnu@0.1.0': - resolution: {integrity: sha512-2uZHxl2nH1HbeJuifB1qdK8vU9wKDrxQkFm+u4psUaa/uHLZDUCGS7GMxTnCbR9OehqZcfQabaKsHbxR/8ElDQ==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/tar-linux-x64-musl@0.1.0': - resolution: {integrity: sha512-S1vEqLK4UCHS4AjVZ3g6o7r0Yu6RbhmDj6JrqxBoEIjrMsuIPKQrODHhtlsykOPeu5IHQuyRT+DevorWAVYdoA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/tar-win32-arm64-msvc@0.1.0': - resolution: {integrity: sha512-x23Ganq0hcDbgnhzAFqOu5EWtKvngIsapJL7ZLGgQlqahRb15aQkagYvpju6CLZers6N6znmqxw9Pdov9VFzOQ==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [win32] - - '@napi-rs/tar-win32-ia32-msvc@0.1.0': - resolution: {integrity: sha512-QJgJQEKDbVOrzSJ3EaUuCk+g7t9tKv085eALmRtkiHDBmzd0iAoudcU2N9YgdacSQMe1V/GMuQLky6BFrZb4nw==} - engines: {node: '>= 10'} - cpu: [ia32] - os: [win32] - - '@napi-rs/tar-win32-x64-msvc@0.1.0': - resolution: {integrity: sha512-aEhLcPZXmbcz46utpgYrkhY/TIGVCs4T5c+xpBf6H8feIEz7rF44Bm6kECC42OWcqnws2LGRW9TZsv0bWoAn0A==} - engines: {node: '>= 10'} - cpu: [x64] - os: [win32] - - '@napi-rs/tar@0.1.0': - resolution: {integrity: sha512-HodV5VS/ryhNvSmSHPb6CT5lJKzkoKaiyO8JPkVw3XCXbp51+vZs7LJ66kgFqyr4AagaKqmXsgpGVCIwNdFw/w==} - engines: {node: '>= 10'} - - '@napi-rs/wasm-runtime@0.1.2': - resolution: {integrity: sha512-8JuczewTFIZ/XIjHQ+YlQUydHvlKx2hkcxtuGwh+t/t5zWyZct6YG4+xjHcq8xyc/e7FmFwf42Zj2YgICwmlvA==} - - '@napi-rs/wasm-runtime@0.2.0': - resolution: {integrity: sha512-ETCooPEZJN7cGp6GwE5mUTrStrhIeuEPo0lOhLe48Iz35z6CkbgDauR8nE/K4GaMEu2BwTOm2Epy7ru8w1ua7w==} - - '@napi-rs/wasm-tools-android-arm-eabi@0.0.1': - resolution: {integrity: sha512-Q/SyyO60dbpoLcN/hvGzNWDaCjuaMGFeg92GnsDBWm3OCwhvltr51+VDZbCIHQwfIvH4d63X29nEls7FHK75dA==} - engines: {node: '>= 10'} - cpu: [arm] - os: [android] - - '@napi-rs/wasm-tools-android-arm64@0.0.1': - resolution: {integrity: sha512-mn7QpSWJlQS7Z14DkWqW14HqEiI2R8FV3KT4SNdqm+O+K5uIUvAexxMn9Qu6gqLq1fHXj+7l2luAWmtN7RKLjA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [android] - - '@napi-rs/wasm-tools-darwin-arm64@0.0.1': - resolution: {integrity: sha512-WuxMRtd5rCgqfuk7dehcft5eyGDOuNSMaJybprbX4IXvnjlLQf1zsCfp6wBI2Ptp2D+qEgE2SAMWBfzF9XDDkw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [darwin] - - '@napi-rs/wasm-tools-darwin-x64@0.0.1': - resolution: {integrity: sha512-YGPjgIo1/Y774aAFb/UT+d8VQtTaIkdF0/ynlChe/UilBZX48vLaEM0HaoSqxA1WHvRm8Il8R3rBDDle0965rw==} - engines: {node: '>= 10'} - cpu: [x64] - os: [darwin] - - '@napi-rs/wasm-tools-freebsd-x64@0.0.1': - resolution: {integrity: sha512-e5y+Z89XwI7HpLyCNEvDKdtO5Sga2+o8bDcNQNHjhMunnnHKPtlTvtIhieVmdqnNGPbuNkIx8xbTjkoWCZ49Tw==} - engines: {node: '>= 10'} - cpu: [x64] - os: [freebsd] - - '@napi-rs/wasm-tools-linux-arm64-gnu@0.0.1': - resolution: {integrity: sha512-Hcy+XiCJd8XshxVOYvmyU5FgeY8d6txZf7ZefI38Y3eRm7rzGt/EvABGjvJfujnPaBeWi9fQVm3Zav5pwyxViw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/wasm-tools-linux-arm64-musl@0.0.1': - resolution: {integrity: sha512-1mSquGy4N7jlRu/0OY/rqZa/XdCFGKrsl8SH4jRB318DVweOHLqn15QG4iwIrRVjCJROpaU9HRU/sgOKVbdqrA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/wasm-tools-linux-x64-gnu@0.0.1': - resolution: {integrity: sha512-/+XuGQ9667EqrxRbpt2izLDNzWUWLTXl6KaRSh9TjcT7qL5+yllTqchc0JwIHJW5QnQlC1NW7HnSnwQZ+/v+8g==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/wasm-tools-linux-x64-musl@0.0.1': - resolution: {integrity: sha512-L+5QcEsUS+QNcMI1AF6aBRKLzhxQ5VHRHVslaQwOxHoxyhMB/2hRH4ON6Zea1PyQS/zzZugwBuDEOcFtc3UjPQ==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/wasm-tools-wasm32-wasi@0.0.1': - resolution: {integrity: sha512-I1vAhMQcBblPJPg6pr+xydZ1NjPwKU2ympmI54BZfCOAMHs0ZfVb4yEqYAVIcSWOx3CF/0T2YrcOmiULTU3iGw==} - engines: {node: '>=14.0.0'} - cpu: [wasm32] - - '@napi-rs/wasm-tools-win32-arm64-msvc@0.0.1': - resolution: {integrity: sha512-A9peDWijE9X6qt5SNzqlmSMlOZiqeB9zhUVP5dtJKtpqVO098YVnZFsz/4Hv7LkSoxQE7brAd9yln/wz5qb1yQ==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [win32] - - '@napi-rs/wasm-tools-win32-ia32-msvc@0.0.1': - resolution: {integrity: sha512-6Y7GqnBCIdl8YsSQ+5AjnZ4iWDJnJrqzRlMDegCmPPf3WmRZ0sgnRU9iAHWcId9AEIf7SAs3x7Bnv2992zCwJA==} - engines: {node: '>= 10'} - cpu: [ia32] - os: [win32] - - '@napi-rs/wasm-tools-win32-x64-msvc@0.0.1': - resolution: {integrity: sha512-Ab6ljJCQmXqJvE4/8DLvHEVTI7vVUrVfh6gCwnVwwrA/B2LgR98SanpT8/951ZaIH/lSuqkeVm+wqzgYM1FHRg==} - engines: {node: '>= 10'} - cpu: [x64] - os: [win32] - - '@napi-rs/wasm-tools@0.0.1': - resolution: {integrity: sha512-itoKmaVqRKIV37sKIEri1qjaYlWNtXyfymUaqXkLu5F16s+FwqwOmvxmdTHsvNKkMy4qCsSSetiLZO1IwvBMLQ==} - engines: {node: '>= 10'} - - '@nodelib/fs.scandir@2.1.5': - resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} - engines: {node: '>= 8'} - - '@nodelib/fs.stat@2.0.5': - resolution: {integrity: sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==} - engines: {node: '>= 8'} - - '@nodelib/fs.walk@1.2.8': - resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} - engines: {node: '>= 8'} - - '@octokit/auth-token@4.0.0': - resolution: {integrity: sha512-tY/msAuJo6ARbK6SPIxZrPBms3xPbfwBrulZe0Wtr/DIY9lje2HeV1uoebShn6mx7SjCHif6EjMvoREj+gZ+SA==} - engines: {node: '>= 18'} - - '@octokit/core@5.2.0': - resolution: {integrity: sha512-1LFfa/qnMQvEOAdzlQymH0ulepxbxnCYAKJZfMci/5XJyIHWgEYnDmgnKakbTh7CH2tFQ5O60oYDvns4i9RAIg==} - engines: {node: '>= 18'} - - '@octokit/endpoint@9.0.5': - resolution: {integrity: sha512-ekqR4/+PCLkEBF6qgj8WqJfvDq65RH85OAgrtnVp1mSxaXF03u2xW/hUdweGS5654IlC0wkNYC18Z50tSYTAFw==} - engines: {node: '>= 18'} - - '@octokit/graphql@7.1.0': - resolution: {integrity: sha512-r+oZUH7aMFui1ypZnAvZmn0KSqAUgE1/tUXIWaqUCa1758ts/Jio84GZuzsvUkme98kv0WFY8//n0J1Z+vsIsQ==} - engines: {node: '>= 18'} - - '@octokit/openapi-types@20.0.0': - resolution: {integrity: sha512-EtqRBEjp1dL/15V7WiX5LJMIxxkdiGJnabzYx5Apx4FkQIFgAfKumXeYAqqJCj1s+BMX4cPFIFC4OLCR6stlnA==} - - '@octokit/openapi-types@22.1.0': - resolution: {integrity: sha512-pGUdSP+eEPfZiQHNkZI0U01HLipxncisdJQB4G//OAmfeO8sqTQ9KRa0KF03TUPCziNsoXUrTg4B2Q1EX++T0Q==} - - '@octokit/plugin-paginate-rest@9.2.1': - resolution: {integrity: sha512-wfGhE/TAkXZRLjksFXuDZdmGnJQHvtU/joFQdweXUgzo1XwvBCD4o4+75NtFfjfLK5IwLf9vHTfSiU3sLRYpRw==} - engines: {node: '>= 18'} - peerDependencies: - '@octokit/core': '5' - - '@octokit/plugin-request-log@4.0.1': - resolution: {integrity: sha512-GihNqNpGHorUrO7Qa9JbAl0dbLnqJVrV8OXe2Zm5/Y4wFkZQDfTreBzVmiRfJVfE4mClXdihHnbpyyO9FSX4HA==} - engines: {node: '>= 18'} - peerDependencies: - '@octokit/core': '5' - - '@octokit/plugin-rest-endpoint-methods@10.4.1': - resolution: {integrity: sha512-xV1b+ceKV9KytQe3zCVqjg+8GTGfDYwaT1ATU5isiUyVtlVAO3HNdzpS4sr4GBx4hxQ46s7ITtZrAsxG22+rVg==} - engines: {node: '>= 18'} - peerDependencies: - '@octokit/core': '5' - - '@octokit/request-error@5.1.0': - resolution: {integrity: sha512-GETXfE05J0+7H2STzekpKObFe765O5dlAKUTLNGeH+x47z7JjXHfsHKo5z21D/o/IOZTUEI6nyWyR+bZVP/n5Q==} - engines: {node: '>= 18'} - - '@octokit/request@8.4.0': - resolution: {integrity: sha512-9Bb014e+m2TgBeEJGEbdplMVWwPmL1FPtggHQRkV+WVsMggPtEkLKPlcVYm/o8xKLkpJ7B+6N8WfQMtDLX2Dpw==} - engines: {node: '>= 18'} - - '@octokit/rest@20.1.0': - resolution: {integrity: sha512-STVO3itHQLrp80lvcYB2UIKoeil5Ctsgd2s1AM+du3HqZIR35ZH7WE9HLwUOLXH0myA0y3AGNPo8gZtcgIbw0g==} - engines: {node: '>= 18'} - - '@octokit/types@12.6.0': - resolution: {integrity: sha512-1rhSOfRa6H9w4YwK0yrf5faDaDTb+yLyBUKOCV4xtCDB5VmIPqd/v9yr9o6SAzOAlRxMiRiCic6JVM1/kunVkw==} - - '@octokit/types@13.4.1': - resolution: {integrity: sha512-Y73oOAzRBAUzR/iRAbGULzpNkX8vaxKCqEtg6K74Ff3w9f5apFnWtE/2nade7dMWWW3bS5Kkd6DJS4HF04xreg==} - - '@rollup/pluginutils@4.2.1': - resolution: {integrity: sha512-iKnFXr7NkdZAIHiIWE+BX5ULi/ucVFYWD6TbAV+rZctiRTY2PL6tsIKhoIOaoskiWAkgu+VsbXgUVDNLHf+InQ==} - engines: {node: '>= 8.0.0'} - - '@sindresorhus/merge-streams@2.3.0': - resolution: {integrity: sha512-LtoMMhxAlorcGhmFYI+LhPgbPZCkgP6ra1YL604EeF6U98pLlQ3iWIGMdWSC+vWmPBWBNgmDBAhnAobLROJmwg==} - engines: {node: '>=18'} - - '@tybys/wasm-util@0.8.3': - resolution: {integrity: sha512-Z96T/L6dUFFxgFJ+pQtkPpne9q7i6kIPYCFnQBHSgSPV9idTsKfIhCss0h5iM9irweZCatkrdeP8yi5uM1eX6Q==} - - '@types/node@20.12.7': - resolution: {integrity: sha512-wq0cICSkRLVaf3UGLMGItu/PtdY7oaXaI/RVU+xliKVOtRna3PRY57ZDfztpDL0n11vfymMUnXv8QwYCO7L1wg==} - - '@vercel/nft@0.26.4': - resolution: {integrity: sha512-j4jCOOXke2t8cHZCIxu1dzKLHLcFmYzC3yqAK6MfZznOL1QIJKd0xcFsXK3zcqzU7ScsE2zWkiMMNHGMHgp+FA==} - engines: {node: '>=16'} - hasBin: true - - abbrev@1.1.1: - resolution: {integrity: sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==} - - acorn-import-attributes@1.9.5: - resolution: {integrity: sha512-n02Vykv5uA3eHGM/Z2dQrcD56kL8TyDb2p1+0P83PClMnC/nc+anbQRhIOWnSq4Ke/KvDPrY3C9hDtC/A3eHnQ==} - peerDependencies: - acorn: ^8 - - acorn-walk@8.3.2: - resolution: {integrity: sha512-cjkyv4OtNCIeqhHrfS81QWXoCBPExR/J62oyEqepVw8WaQeSqpW2uhuLPh1m9eWhDuOo/jUXVTlifvesOWp/4A==} - engines: {node: '>=0.4.0'} - - acorn@8.11.3: - resolution: {integrity: sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==} - engines: {node: '>=0.4.0'} - hasBin: true - - agent-base@6.0.2: - resolution: {integrity: sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==} - engines: {node: '>= 6.0.0'} - - ansi-escapes@4.3.2: - resolution: {integrity: sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==} - engines: {node: '>=8'} - - ansi-regex@5.0.1: - resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} - engines: {node: '>=8'} - - ansi-regex@6.0.1: - resolution: {integrity: sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==} - engines: {node: '>=12'} - - ansi-styles@4.3.0: - resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} - engines: {node: '>=8'} - - ansi-styles@6.2.1: - resolution: {integrity: sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==} - engines: {node: '>=12'} - - aproba@2.0.0: - resolution: {integrity: sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==} - - are-we-there-yet@2.0.0: - resolution: {integrity: sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw==} - engines: {node: '>=10'} - - argparse@1.0.10: - resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==} - - argparse@2.0.1: - resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} - - array-find-index@1.0.2: - resolution: {integrity: sha512-M1HQyIXcBGtVywBt8WVdim+lrNaK7VHp99Qt5pSNziXznKHViIBbXWtfRTpEFpF/c4FdfxNAsCCwPp5phBYJtw==} - engines: {node: '>=0.10.0'} - - arrgv@1.0.2: - resolution: {integrity: sha512-a4eg4yhp7mmruZDQFqVMlxNRFGi/i1r87pt8SDHy0/I8PqSXoUTlWZRdAZo0VXgvEARcujbtTk8kiZRi1uDGRw==} - engines: {node: '>=8.0.0'} - - arrify@3.0.0: - resolution: {integrity: sha512-tLkvA81vQG/XqE2mjDkGQHoOINtMHtysSnemrmoGe6PydDPMRbVugqyk4A6V/WDWEfm3l+0d8anA9r8cv/5Jaw==} - engines: {node: '>=12'} - - async-sema@3.1.1: - resolution: {integrity: sha512-tLRNUXati5MFePdAk8dw7Qt7DpxPB60ofAgn8WRhW6a2rcimZnYBP9oxHiv0OHy+Wz7kPMG+t4LGdt31+4EmGg==} - - ava@6.1.2: - resolution: {integrity: sha512-WcpxJ8yZ7mk9ABTinD0IAjcemovSeVGjuuwZx0JS9johREWFeLTl8UP6wd7l6nmnrWqkKZdwaD71a/ocH4qPKw==} - engines: {node: ^18.18 || ^20.8 || ^21} - hasBin: true - peerDependencies: - '@ava/typescript': '*' - peerDependenciesMeta: - '@ava/typescript': - optional: true - - balanced-match@1.0.2: - resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} - - base64-js@1.5.1: - resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==} - - before-after-hook@2.2.3: - resolution: {integrity: sha512-NzUnlZexiaH/46WDhANlyR2bXRopNg4F/zuSA3OpZnllCUgRaOF2znDioDWrmbNVsuZk6l9pMquQB38cfBZwkQ==} - - bindings@1.5.0: - resolution: {integrity: sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==} - - bl@4.1.0: - resolution: {integrity: sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==} - - blueimp-md5@2.19.0: - resolution: {integrity: sha512-DRQrD6gJyy8FbiE4s+bDoXS9hiW3Vbx5uCdwvcCf3zLHL+Iv7LtGHLpr+GZV8rHG8tK766FGYBwRbu8pELTt+w==} - - brace-expansion@1.1.11: - resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} - - braces@3.0.2: - resolution: {integrity: sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==} - engines: {node: '>=8'} - - buffer@5.7.1: - resolution: {integrity: sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==} - - call-bind@1.0.7: - resolution: {integrity: sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==} - engines: {node: '>= 0.4'} - - callsites@4.1.0: - resolution: {integrity: sha512-aBMbD1Xxay75ViYezwT40aQONfr+pSXTHwNKvIXhXD6+LY3F1dLIcceoC5OZKBVHbXcysz1hL9D2w0JJIMXpUw==} - engines: {node: '>=12.20'} - - cbor@9.0.2: - resolution: {integrity: sha512-JPypkxsB10s9QOWwa6zwPzqE1Md3vqpPc+cai4sAecuCsRyAtAl/pMyhPlMbT/xtPnm2dznJZYRLui57qiRhaQ==} - engines: {node: '>=16'} - - chalk@4.1.2: - resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} - engines: {node: '>=10'} - - chalk@5.3.0: - resolution: {integrity: sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==} - engines: {node: ^12.17.0 || ^14.13 || >=16.0.0} - - chardet@0.7.0: - resolution: {integrity: sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==} - - chownr@2.0.0: - resolution: {integrity: sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==} - engines: {node: '>=10'} - - chunkd@2.0.1: - resolution: {integrity: sha512-7d58XsFmOq0j6el67Ug9mHf9ELUXsQXYJBkyxhH/k+6Ke0qXRnv0kbemx+Twc6fRJ07C49lcbdgm9FL1Ei/6SQ==} - - ci-info@4.0.0: - resolution: {integrity: sha512-TdHqgGf9odd8SXNuxtUBVx8Nv+qZOejE6qyqiy5NtbYYQOeFa6zmHkxlPzmaLxWWHsU6nJmB7AETdVPi+2NBUg==} - engines: {node: '>=8'} - - ci-parallel-vars@1.0.1: - resolution: {integrity: sha512-uvzpYrpmidaoxvIQHM+rKSrigjOe9feHYbw4uOI2gdfe1C3xIlxO+kVXq83WQWNniTf8bAxVpy+cQeFQsMERKg==} - - cli-cursor@3.1.0: - resolution: {integrity: sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==} - engines: {node: '>=8'} - - cli-spinners@2.9.2: - resolution: {integrity: sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==} - engines: {node: '>=6'} - - cli-truncate@4.0.0: - resolution: {integrity: sha512-nPdaFdQ0h/GEigbPClz11D0v/ZJEwxmeVZGeMo3Z5StPtUTkA9o1lD6QwoirYiSDzbcwn2XcjwmCp68W1IS4TA==} - engines: {node: '>=18'} - - cli-width@4.1.0: - resolution: {integrity: sha512-ouuZd4/dm2Sw5Gmqy6bGyNNNe1qt9RpmxveLSO7KcgsTnU7RXfsw+/bukWGo1abgBiMAic068rclZsO4IWmmxQ==} - engines: {node: '>= 12'} - - clipanion@3.2.1: - resolution: {integrity: sha512-dYFdjLb7y1ajfxQopN05mylEpK9ZX0sO1/RfMXdfmwjlIsPkbh4p7A682x++zFPLDCo1x3p82dtljHf5cW2LKA==} - peerDependencies: - typanion: '*' - - cliui@8.0.1: - resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==} - engines: {node: '>=12'} - - clone@1.0.4: - resolution: {integrity: sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==} - engines: {node: '>=0.8'} - - code-excerpt@4.0.0: - resolution: {integrity: sha512-xxodCmBen3iy2i0WtAK8FlFNrRzjUqjRsMfho58xT/wvZU1YTM3fCnRjcy1gJPMepaRlgm/0e6w8SpWHpn3/cA==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - color-convert@2.0.1: - resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} - engines: {node: '>=7.0.0'} - - color-name@1.1.4: - resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} - - color-support@1.1.3: - resolution: {integrity: sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==} - hasBin: true - - colorette@2.0.20: - resolution: {integrity: sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==} - - common-path-prefix@3.0.0: - resolution: {integrity: sha512-QE33hToZseCH3jS0qN96O/bSh3kaw/h+Tq7ngyY9eWDUnTlTNUyqfqvCXioLe5Na5jFsL78ra/wuBU4iuEgd4w==} - - concat-map@0.0.1: - resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} - - concordance@5.0.4: - resolution: {integrity: sha512-OAcsnTEYu1ARJqWVGwf4zh4JDfHZEaSNlNccFmt8YjB2l/n19/PF2viLINHc57vO4FKIAFl2FWASIGZZWZ2Kxw==} - engines: {node: '>=10.18.0 <11 || >=12.14.0 <13 || >=14'} - - console-control-strings@1.1.0: - resolution: {integrity: sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==} - - convert-to-spaces@2.0.1: - resolution: {integrity: sha512-rcQ1bsQO9799wq24uE5AM2tAILy4gXGIK/njFWcVQkGNZ96edlpY+A7bjwvzjYvLDyzmG1MmMLZhpcsb+klNMQ==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - currently-unhandled@0.4.1: - resolution: {integrity: sha512-/fITjgjGU50vjQ4FH6eUoYu+iUoUKIXws2hL15JJpIR+BbTxaXQsMuuyjtNh2WqsSBS5nsaZHFsFecyw5CCAng==} - engines: {node: '>=0.10.0'} - - date-time@3.1.0: - resolution: {integrity: sha512-uqCUKXE5q1PNBXjPqvwhwJf9SwMoAHBgWJ6DcrnS5o+W2JOiIILl0JEdVD8SGujrNS02GGxgwAg2PN2zONgtjg==} - engines: {node: '>=6'} - - debug@4.3.4: - resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==} - engines: {node: '>=6.0'} - peerDependencies: - supports-color: '*' - peerDependenciesMeta: - supports-color: - optional: true - - defaults@1.0.4: - resolution: {integrity: sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A==} - - define-data-property@1.1.4: - resolution: {integrity: sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==} - engines: {node: '>= 0.4'} - - delegates@1.0.0: - resolution: {integrity: sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==} - - deprecation@2.3.1: - resolution: {integrity: sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==} - - detect-libc@2.0.3: - resolution: {integrity: sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw==} - engines: {node: '>=8'} - - emittery@1.0.3: - resolution: {integrity: sha512-tJdCJitoy2lrC2ldJcqN4vkqJ00lT+tOWNT1hBJjO/3FDMJa5TTIiYGCKGkn/WfCyOzUMObeohbVTj00fhiLiA==} - engines: {node: '>=14.16'} - - emnapi@1.1.1: - resolution: {integrity: sha512-md0YDBLCX+378+zzibHvOLsj28YKFy8vl7BiSzVocCY7HujOkYt+N5LCOYqLeYi5C5/5NlnkNweVdUjrvKpGNg==} - peerDependencies: - node-addon-api: '>= 6.1.0' - peerDependenciesMeta: - node-addon-api: - optional: true - - emoji-regex@10.3.0: - resolution: {integrity: sha512-QpLs9D9v9kArv4lfDEgg1X/gN5XLnf/A6l9cs8SPZLRZR3ZkY9+kwIQTxm+fsSej5UMYGE8fdoaZVIBlqG0XTw==} - - emoji-regex@8.0.0: - resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} - - es-define-property@1.0.0: - resolution: {integrity: sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==} - engines: {node: '>= 0.4'} - - es-errors@1.3.0: - resolution: {integrity: sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==} - engines: {node: '>= 0.4'} - - escalade@3.1.2: - resolution: {integrity: sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==} - engines: {node: '>=6'} - - escape-string-regexp@2.0.0: - resolution: {integrity: sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==} - engines: {node: '>=8'} - - escape-string-regexp@5.0.0: - resolution: {integrity: sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==} - engines: {node: '>=12'} - - esprima@4.0.1: - resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==} - engines: {node: '>=4'} - hasBin: true - - estree-walker@2.0.2: - resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==} - - esutils@2.0.3: - resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} - engines: {node: '>=0.10.0'} - - external-editor@3.1.0: - resolution: {integrity: sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==} - engines: {node: '>=4'} - - fast-diff@1.3.0: - resolution: {integrity: sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==} - - fast-glob@3.3.2: - resolution: {integrity: sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==} - engines: {node: '>=8.6.0'} - - fastq@1.17.1: - resolution: {integrity: sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==} - - figures@6.1.0: - resolution: {integrity: sha512-d+l3qxjSesT4V7v2fh+QnmFnUWv9lSpjarhShNTgBOfA0ttejbQUAlHLitbjkoRiDulW0OPoQPYIGhIC8ohejg==} - engines: {node: '>=18'} - - file-uri-to-path@1.0.0: - resolution: {integrity: sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==} - - fill-range@7.0.1: - resolution: {integrity: sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==} - engines: {node: '>=8'} - - find-up-simple@1.0.0: - resolution: {integrity: sha512-q7Us7kcjj2VMePAa02hDAF6d+MzsdsAWEwYyOpwUtlerRBkOEPBCRZrAV4XfcSN8fHAgaD0hP7miwoay6DCprw==} - engines: {node: '>=18'} - - fs-minipass@2.1.0: - resolution: {integrity: sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==} - engines: {node: '>= 8'} - - fs.realpath@1.0.0: - resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} - - function-bind@1.1.2: - resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==} - - gauge@3.0.2: - resolution: {integrity: sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q==} - engines: {node: '>=10'} - - get-caller-file@2.0.5: - resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} - engines: {node: 6.* || 8.* || >= 10.*} - - get-east-asian-width@1.2.0: - resolution: {integrity: sha512-2nk+7SIVb14QrgXFHcm84tD4bKQz0RxPuMT8Ag5KPOq7J5fEmAg0UbXdTOSHqNuHSU28k55qnceesxXRZGzKWA==} - engines: {node: '>=18'} - - get-intrinsic@1.2.4: - resolution: {integrity: sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==} - engines: {node: '>= 0.4'} - - glob-parent@5.1.2: - resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} - engines: {node: '>= 6'} - - glob@7.2.3: - resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} - - globby@14.0.1: - resolution: {integrity: sha512-jOMLD2Z7MAhyG8aJpNOpmziMOP4rPLcc95oQPKXBazW82z+CEgPFBQvEpRUa1KeIMUJo4Wsm+q6uzO/Q/4BksQ==} - engines: {node: '>=18'} - - gopd@1.0.1: - resolution: {integrity: sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==} - - graceful-fs@4.2.11: - resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} - - has-flag@4.0.0: - resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} - engines: {node: '>=8'} - - has-property-descriptors@1.0.2: - resolution: {integrity: sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==} - - has-proto@1.0.3: - resolution: {integrity: sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==} - engines: {node: '>= 0.4'} - - has-symbols@1.0.3: - resolution: {integrity: sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==} - engines: {node: '>= 0.4'} - - has-unicode@2.0.1: - resolution: {integrity: sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==} - - hasown@2.0.2: - resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==} - engines: {node: '>= 0.4'} - - https-proxy-agent@5.0.1: - resolution: {integrity: sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==} - engines: {node: '>= 6'} - - iconv-lite@0.4.24: - resolution: {integrity: sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==} - engines: {node: '>=0.10.0'} - - ieee754@1.2.1: - resolution: {integrity: sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==} - - ignore-by-default@2.1.0: - resolution: {integrity: sha512-yiWd4GVmJp0Q6ghmM2B/V3oZGRmjrKLXvHR3TE1nfoXsmoggllfZUQe74EN0fJdPFZu2NIvNdrMMLm3OsV7Ohw==} - engines: {node: '>=10 <11 || >=12 <13 || >=14'} - - ignore@5.3.1: - resolution: {integrity: sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==} - engines: {node: '>= 4'} - - imurmurhash@0.1.4: - resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} - engines: {node: '>=0.8.19'} - - indent-string@5.0.0: - resolution: {integrity: sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==} - engines: {node: '>=12'} - - inflight@1.0.6: - resolution: {integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==} - - inherits@2.0.4: - resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} - - inquirer@9.2.19: - resolution: {integrity: sha512-WpxOT71HGsFya6/mj5PUue0sWwbpbiPfAR+332zLj/siB0QA1PZM8v3GepegFV1Op189UxHUCF6y8AySdtOMVA==} - engines: {node: '>=18'} - - irregular-plurals@3.5.0: - resolution: {integrity: sha512-1ANGLZ+Nkv1ptFb2pa8oG8Lem4krflKuX/gINiHJHjJUKaJHk/SXk5x6K3J+39/p0h1RQ2saROclJJ+QLvETCQ==} - engines: {node: '>=8'} - - is-extglob@2.1.1: - resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} - engines: {node: '>=0.10.0'} - - is-fullwidth-code-point@3.0.0: - resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} - engines: {node: '>=8'} - - is-fullwidth-code-point@4.0.0: - resolution: {integrity: sha512-O4L094N2/dZ7xqVdrXhh9r1KODPJpFms8B5sGdJLPy664AgvXsreZUyCQQNItZRDlYug4xStLjNp/sz3HvBowQ==} - engines: {node: '>=12'} - - is-glob@4.0.3: - resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} - engines: {node: '>=0.10.0'} - - is-interactive@1.0.0: - resolution: {integrity: sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w==} - engines: {node: '>=8'} - - is-number@7.0.0: - resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} - engines: {node: '>=0.12.0'} - - is-plain-object@5.0.0: - resolution: {integrity: sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==} - engines: {node: '>=0.10.0'} - - is-promise@4.0.0: - resolution: {integrity: sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==} - - is-unicode-supported@0.1.0: - resolution: {integrity: sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==} - engines: {node: '>=10'} - - is-unicode-supported@2.0.0: - resolution: {integrity: sha512-FRdAyx5lusK1iHG0TWpVtk9+1i+GjrzRffhDg4ovQ7mcidMQ6mj+MhKPmvh7Xwyv5gIS06ns49CA7Sqg7lC22Q==} - engines: {node: '>=18'} - - js-string-escape@1.0.1: - resolution: {integrity: sha512-Smw4xcfIQ5LVjAOuJCvN/zIodzA/BBSsluuoSykP+lUvScIi4U6RJLfwHet5cxFnCswUjISV8oAXaqaJDY3chg==} - engines: {node: '>= 0.8'} - - js-yaml@3.14.1: - resolution: {integrity: sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==} - hasBin: true - - js-yaml@4.1.0: - resolution: {integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==} - hasBin: true - - load-json-file@7.0.1: - resolution: {integrity: sha512-Gnxj3ev3mB5TkVBGad0JM6dmLiQL+o0t23JPBZ9sd+yvSLk05mFoqKBw5N8gbbkU4TNXyqCgIrl/VM17OgUIgQ==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - lodash-es@4.17.21: - resolution: {integrity: sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==} - - lodash@4.17.21: - resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} - - log-symbols@4.1.0: - resolution: {integrity: sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==} - engines: {node: '>=10'} - - lru-cache@6.0.0: - resolution: {integrity: sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==} - engines: {node: '>=10'} - - make-dir@3.1.0: - resolution: {integrity: sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==} - engines: {node: '>=8'} - - matcher@5.0.0: - resolution: {integrity: sha512-s2EMBOWtXFc8dgqvoAzKJXxNHibcdJMV0gwqKUaw9E2JBJuGUK7DrNKrA6g/i+v72TT16+6sVm5mS3thaMLQUw==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - md5-hex@3.0.1: - resolution: {integrity: sha512-BUiRtTtV39LIJwinWBjqVsU9xhdnz7/i889V859IBFpuqGAj6LuOvHv5XLbgZ2R7ptJoJaEcxkv88/h25T7Ciw==} - engines: {node: '>=8'} - - memoize@10.0.0: - resolution: {integrity: sha512-H6cBLgsi6vMWOcCpvVCdFFnl3kerEXbrYh9q+lY6VXvQSmM6CkmV08VOwT+WE2tzIEqRPFfAq3fm4v/UIW6mSA==} - engines: {node: '>=18'} - - merge2@1.4.1: - resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} - engines: {node: '>= 8'} - - micromatch@4.0.5: - resolution: {integrity: sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==} - engines: {node: '>=8.6'} - - mimic-fn@2.1.0: - resolution: {integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==} - engines: {node: '>=6'} - - mimic-function@5.0.1: - resolution: {integrity: sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==} - engines: {node: '>=18'} - - minimatch@3.1.2: - resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} - - minipass@3.3.6: - resolution: {integrity: sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==} - engines: {node: '>=8'} - - minipass@5.0.0: - resolution: {integrity: sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==} - engines: {node: '>=8'} - - minizlib@2.1.2: - resolution: {integrity: sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==} - engines: {node: '>= 8'} - - mkdirp@1.0.4: - resolution: {integrity: sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==} - engines: {node: '>=10'} - hasBin: true - - ms@2.1.2: - resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} - - ms@2.1.3: - resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} - - mute-stream@1.0.0: - resolution: {integrity: sha512-avsJQhyd+680gKXyG/sQc0nXaC6rBkPOfyHYcFb9+hdkqQkR9bdnkJ0AMZhke0oesPqIO+mFFJ+IdBc7mst4IA==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - - node-fetch@2.7.0: - resolution: {integrity: sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==} - engines: {node: 4.x || >=6.0.0} - peerDependencies: - encoding: ^0.1.0 - peerDependenciesMeta: - encoding: - optional: true - - node-gyp-build@4.8.0: - resolution: {integrity: sha512-u6fs2AEUljNho3EYTJNBfImO5QTo/J/1Etd+NVdCj7qWKUSN/bSLkZwhDv7I+w/MSC6qJ4cknepkAYykDdK8og==} - hasBin: true - - nofilter@3.1.0: - resolution: {integrity: sha512-l2NNj07e9afPnhAhvgVrCD/oy2Ai1yfLpuo3EpiO1jFTsB4sFz6oIfAfSZyQzVpkZQ9xS8ZS5g1jCBgq4Hwo0g==} - engines: {node: '>=12.19'} - - nopt@5.0.0: - resolution: {integrity: sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==} - engines: {node: '>=6'} - hasBin: true - - npmlog@5.0.1: - resolution: {integrity: sha512-AqZtDUWOMKs1G/8lwylVjrdYgqA4d9nu8hc+0gzRxlDb1I10+FHBGMXs6aiQHFdCUUlqH99MUMuLfzWDNDtfxw==} - - object-assign@4.1.1: - resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} - engines: {node: '>=0.10.0'} - - once@1.4.0: - resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} - - onetime@5.1.2: - resolution: {integrity: sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==} - engines: {node: '>=6'} - - ora@5.4.1: - resolution: {integrity: sha512-5b6Y85tPxZZ7QytO+BQzysW31HJku27cRIlkbAXaNx+BdcVi+LlRFmVXzeF6a7JCwJpyw5c4b+YSVImQIrBpuQ==} - engines: {node: '>=10'} - - os-tmpdir@1.0.2: - resolution: {integrity: sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==} - engines: {node: '>=0.10.0'} - - p-map@7.0.2: - resolution: {integrity: sha512-z4cYYMMdKHzw4O5UkWJImbZynVIo0lSGTXc7bzB1e/rrDqkgGUNysK/o4bTr+0+xKvvLoTyGqYC4Fgljy9qe1Q==} - engines: {node: '>=18'} - - package-config@5.0.0: - resolution: {integrity: sha512-GYTTew2slBcYdvRHqjhwaaydVMvn/qrGC323+nKclYioNSLTDUM/lGgtGTgyHVtYcozb+XkE8CNhwcraOmZ9Mg==} - engines: {node: '>=18'} - - parse-ms@4.0.0: - resolution: {integrity: sha512-TXfryirbmq34y8QBwgqCVLi+8oA3oWx2eAnSn62ITyEhEYaWRlVZ2DvMM9eZbMs/RfxPu/PK/aBLyGj4IrqMHw==} - engines: {node: '>=18'} - - path-is-absolute@1.0.1: - resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==} - engines: {node: '>=0.10.0'} - - path-type@5.0.0: - resolution: {integrity: sha512-5HviZNaZcfqP95rwpv+1HDgUamezbqdSYTyzjTvwtJSnIH+3vnbmWsItli8OFEndS984VT55M3jduxZbX351gg==} - engines: {node: '>=12'} - - picomatch@2.3.1: - resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} - engines: {node: '>=8.6'} - - picomatch@3.0.1: - resolution: {integrity: sha512-I3EurrIQMlRc9IaAZnqRR044Phh2DXY+55o7uJ0V+hYZAcQYSuFWsc9q5PvyDHUSCe1Qxn/iBz+78s86zWnGag==} - engines: {node: '>=10'} - - plur@5.1.0: - resolution: {integrity: sha512-VP/72JeXqak2KiOzjgKtQen5y3IZHn+9GOuLDafPv0eXa47xq0At93XahYBs26MsifCQ4enGKwbjBTKgb9QJXg==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - pretty-ms@9.0.0: - resolution: {integrity: sha512-E9e9HJ9R9NasGOgPaPE8VMeiPKAyWR5jcFpNnwIejslIhWqdqOrb2wShBsncMPUb+BcCd2OPYfh7p2W6oemTng==} - engines: {node: '>=18'} - - queue-microtask@1.2.3: - resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} - - readable-stream@3.6.2: - resolution: {integrity: sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==} - engines: {node: '>= 6'} - - require-directory@2.1.1: - resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} - engines: {node: '>=0.10.0'} - - resolve-cwd@3.0.0: - resolution: {integrity: sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==} - engines: {node: '>=8'} - - resolve-from@5.0.0: - resolution: {integrity: sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==} - engines: {node: '>=8'} - - restore-cursor@3.1.0: - resolution: {integrity: sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==} - engines: {node: '>=8'} - - reusify@1.0.4: - resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==} - engines: {iojs: '>=1.0.0', node: '>=0.10.0'} - - rimraf@3.0.2: - resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==} - hasBin: true - - run-async@3.0.0: - resolution: {integrity: sha512-540WwVDOMxA6dN6We19EcT9sc3hkXPw5mzRNGM3FkdN/vtE9NFvj5lFAPNwUDmJjXidm3v7TC1cTE7t17Ulm1Q==} - engines: {node: '>=0.12.0'} - - run-parallel@1.2.0: - resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} - - rxjs@7.8.1: - resolution: {integrity: sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==} - - safe-buffer@5.2.1: - resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} - - safer-buffer@2.1.2: - resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} - - semver@6.3.1: - resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} - hasBin: true - - semver@7.6.0: - resolution: {integrity: sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==} - engines: {node: '>=10'} - hasBin: true - - serialize-error@7.0.1: - resolution: {integrity: sha512-8I8TjW5KMOKsZQTvoxjuSIa7foAwPWGOts+6o7sgjz41/qMD9VQHEDxi6PBvK2l0MXUmqZyNpUK+T2tQaaElvw==} - engines: {node: '>=10'} - - set-blocking@2.0.0: - resolution: {integrity: sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==} - - set-function-length@1.2.2: - resolution: {integrity: sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==} - engines: {node: '>= 0.4'} - - signal-exit@3.0.7: - resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} - - signal-exit@4.1.0: - resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} - engines: {node: '>=14'} - - slash@5.1.0: - resolution: {integrity: sha512-ZA6oR3T/pEyuqwMgAKT0/hAv8oAXckzbkmR0UkUosQ+Mc4RxGoJkRmwHgHufaenlyAgE1Mxgpdcrf75y6XcnDg==} - engines: {node: '>=14.16'} - - slice-ansi@5.0.0: - resolution: {integrity: sha512-FC+lgizVPfie0kkhqUScwRu1O/lF6NOgJmlCgK+/LYxDCTk8sGelYaHDhFcDN+Sn3Cv+3VSa4Byeo+IMCzpMgQ==} - engines: {node: '>=12'} - - sprintf-js@1.0.3: - resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==} - - stack-utils@2.0.6: - resolution: {integrity: sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==} - engines: {node: '>=10'} - - string-width@4.2.3: - resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} - engines: {node: '>=8'} - - string-width@7.1.0: - resolution: {integrity: sha512-SEIJCWiX7Kg4c129n48aDRwLbFb2LJmXXFrWBG4NGaRtMQ3myKPKbwrD1BKqQn74oCoNMBVrfDEr5M9YxCsrkw==} - engines: {node: '>=18'} - - string_decoder@1.3.0: - resolution: {integrity: sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==} - - strip-ansi@6.0.1: - resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} - engines: {node: '>=8'} - - strip-ansi@7.1.0: - resolution: {integrity: sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==} - engines: {node: '>=12'} - - supertap@3.0.1: - resolution: {integrity: sha512-u1ZpIBCawJnO+0QePsEiOknOfCRq0yERxiAchT0i4li0WHNUJbf0evXXSXOcCAR4M8iMDoajXYmstm/qO81Isw==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - supports-color@7.2.0: - resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} - engines: {node: '>=8'} - - tar@6.2.1: - resolution: {integrity: sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==} - engines: {node: '>=10'} - - temp-dir@3.0.0: - resolution: {integrity: sha512-nHc6S/bwIilKHNRgK/3jlhDoIHcp45YgyiwcAk46Tr0LfEqGBVpmiAyuiuxeVE44m3mXnEeVhaipLOEWmH+Njw==} - engines: {node: '>=14.16'} - - time-zone@1.0.0: - resolution: {integrity: sha512-TIsDdtKo6+XrPtiTm1ssmMngN1sAhyKnTO2kunQWqNPWIVvCm15Wmw4SWInwTVgJ5u/Tr04+8Ei9TNcw4x4ONA==} - engines: {node: '>=4'} - - tmp@0.0.33: - resolution: {integrity: sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==} - engines: {node: '>=0.6.0'} - - to-regex-range@5.0.1: - resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} - engines: {node: '>=8.0'} - - toml@3.0.0: - resolution: {integrity: sha512-y/mWCZinnvxjTKYhJ+pYxwD0mRLVvOtdS2Awbgxln6iEnt4rk0yBxeSBHkGJcPucRiG0e55mwWp+g/05rsrd6w==} - - tr46@0.0.3: - resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==} - - tslib@2.6.2: - resolution: {integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==} - - typanion@3.14.0: - resolution: {integrity: sha512-ZW/lVMRabETuYCd9O9ZvMhAh8GslSqaUjxmK/JLPCh6l73CvLBiuXswj/+7LdnWOgYsQ130FqLzFz5aGT4I3Ug==} - - type-fest@0.13.1: - resolution: {integrity: sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==} - engines: {node: '>=10'} - - type-fest@0.21.3: - resolution: {integrity: sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==} - engines: {node: '>=10'} - - typescript@5.4.5: - resolution: {integrity: sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==} - engines: {node: '>=14.17'} - hasBin: true - - undici-types@5.26.5: - resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==} - - unicorn-magic@0.1.0: - resolution: {integrity: sha512-lRfVq8fE8gz6QMBuDM6a+LO3IAzTi05H6gCVaUpir2E1Rwpo4ZUog45KpNXKC/Mn3Yb9UDuHumeFTo9iV/D9FQ==} - engines: {node: '>=18'} - - universal-user-agent@6.0.1: - resolution: {integrity: sha512-yCzhz6FN2wU1NiiQRogkTQszlQSlpWaw8SvVegAc+bDxbzHgh1vX8uIe8OYyMH6DwH+sdTJsgMl36+mSMdRJIQ==} - - util-deprecate@1.0.2: - resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} - - wasm-sjlj@1.0.5: - resolution: {integrity: sha512-Z/MHJeOkAvJJVWnGX3/YZGYldGaawZbYHX4ldYG9kLhcdB8H31F5x66M7Zc4BP/7pg0aLsusQj1629m2B3Rilg==} - - wcwidth@1.0.1: - resolution: {integrity: sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==} - - webidl-conversions@3.0.1: - resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==} - - well-known-symbols@2.0.0: - resolution: {integrity: sha512-ZMjC3ho+KXo0BfJb7JgtQ5IBuvnShdlACNkKkdsqBmYw3bPAaJfPeYUo6tLUaT5tG/Gkh7xkpBhKRQ9e7pyg9Q==} - engines: {node: '>=6'} - - whatwg-url@5.0.0: - resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==} - - wide-align@1.1.5: - resolution: {integrity: sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==} - - wrap-ansi@6.2.0: - resolution: {integrity: sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==} - engines: {node: '>=8'} - - wrap-ansi@7.0.0: - resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==} - engines: {node: '>=10'} - - wrappy@1.0.2: - resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} - - write-file-atomic@5.0.1: - resolution: {integrity: sha512-+QU2zd6OTD8XWIJCbffaiQeH9U73qIqafo1x6V1snCWYGJf6cVE0cDR4D8xRzcEnfI21IFrUPzPGtcPf8AC+Rw==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - - y18n@5.0.8: - resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==} - engines: {node: '>=10'} - - yallist@4.0.0: - resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==} - - yargs-parser@21.1.1: - resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} - engines: {node: '>=12'} - - yargs@17.7.2: - resolution: {integrity: sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==} - engines: {node: '>=12'} - -snapshots: - - '@emnapi/core@1.1.1': - dependencies: - tslib: 2.6.2 - - '@emnapi/runtime@1.1.1': - dependencies: - tslib: 2.6.2 - - '@inquirer/figures@1.0.1': {} - - '@ljharb/through@2.3.13': - dependencies: - call-bind: 1.0.7 - - '@mapbox/node-pre-gyp@1.0.11': - dependencies: - detect-libc: 2.0.3 - https-proxy-agent: 5.0.1 - make-dir: 3.1.0 - node-fetch: 2.7.0 - nopt: 5.0.0 - npmlog: 5.0.1 - rimraf: 3.0.2 - semver: 7.6.0 - tar: 6.2.1 - transitivePeerDependencies: - - encoding - - supports-color - - '@napi-rs/cli@3.0.0-alpha.51(@emnapi/runtime@1.1.1)(emnapi@1.1.1)': - dependencies: - '@napi-rs/cross-toolchain': 0.0.14 - '@napi-rs/wasm-tools': 0.0.1 - '@octokit/rest': 20.1.0 - clipanion: 3.2.1(typanion@3.14.0) - colorette: 2.0.20 - debug: 4.3.4 - inquirer: 9.2.19 - js-yaml: 4.1.0 - lodash-es: 4.17.21 - semver: 7.6.0 - toml: 3.0.0 - typanion: 3.14.0 - wasm-sjlj: 1.0.5 - optionalDependencies: - '@emnapi/runtime': 1.1.1 - emnapi: 1.1.1 - transitivePeerDependencies: - - '@napi-rs/cross-toolchain-arm64-target-aarch64' - - '@napi-rs/cross-toolchain-arm64-target-armv7' - - '@napi-rs/cross-toolchain-arm64-target-x86_64' - - '@napi-rs/cross-toolchain-x64-target-aarch64' - - '@napi-rs/cross-toolchain-x64-target-armv7' - - '@napi-rs/cross-toolchain-x64-target-x86_64' - - supports-color - - '@napi-rs/cross-toolchain@0.0.14': - dependencies: - '@napi-rs/lzma': 1.2.1 - '@napi-rs/tar': 0.1.0 - debug: 4.3.4 - transitivePeerDependencies: - - supports-color - - '@napi-rs/lzma-android-arm-eabi@1.2.1': - optional: true - - '@napi-rs/lzma-android-arm64@1.2.1': - optional: true - - '@napi-rs/lzma-darwin-arm64@1.2.1': - optional: true - - '@napi-rs/lzma-darwin-x64@1.2.1': - optional: true - - '@napi-rs/lzma-freebsd-x64@1.2.1': - optional: true - - '@napi-rs/lzma-linux-arm-gnueabihf@1.2.1': - optional: true - - '@napi-rs/lzma-linux-arm64-gnu@1.2.1': - optional: true - - '@napi-rs/lzma-linux-arm64-musl@1.2.1': - optional: true - - '@napi-rs/lzma-linux-x64-gnu@1.2.1': - optional: true - - '@napi-rs/lzma-linux-x64-musl@1.2.1': - optional: true - - '@napi-rs/lzma-win32-arm64-msvc@1.2.1': - optional: true - - '@napi-rs/lzma-win32-ia32-msvc@1.2.1': - optional: true - - '@napi-rs/lzma-win32-x64-msvc@1.2.1': - optional: true - - '@napi-rs/lzma@1.2.1': - optionalDependencies: - '@napi-rs/lzma-android-arm-eabi': 1.2.1 - '@napi-rs/lzma-android-arm64': 1.2.1 - '@napi-rs/lzma-darwin-arm64': 1.2.1 - '@napi-rs/lzma-darwin-x64': 1.2.1 - '@napi-rs/lzma-freebsd-x64': 1.2.1 - '@napi-rs/lzma-linux-arm-gnueabihf': 1.2.1 - '@napi-rs/lzma-linux-arm64-gnu': 1.2.1 - '@napi-rs/lzma-linux-arm64-musl': 1.2.1 - '@napi-rs/lzma-linux-x64-gnu': 1.2.1 - '@napi-rs/lzma-linux-x64-musl': 1.2.1 - '@napi-rs/lzma-win32-arm64-msvc': 1.2.1 - '@napi-rs/lzma-win32-ia32-msvc': 1.2.1 - '@napi-rs/lzma-win32-x64-msvc': 1.2.1 - - '@napi-rs/tar-android-arm-eabi@0.1.0': - optional: true - - '@napi-rs/tar-android-arm64@0.1.0': - optional: true - - '@napi-rs/tar-darwin-arm64@0.1.0': - optional: true - - '@napi-rs/tar-darwin-x64@0.1.0': - optional: true - - '@napi-rs/tar-freebsd-x64@0.1.0': - optional: true - - '@napi-rs/tar-linux-arm-gnueabihf@0.1.0': - optional: true - - '@napi-rs/tar-linux-arm64-gnu@0.1.0': - optional: true - - '@napi-rs/tar-linux-arm64-musl@0.1.0': - optional: true - - '@napi-rs/tar-linux-x64-gnu@0.1.0': - optional: true - - '@napi-rs/tar-linux-x64-musl@0.1.0': - optional: true - - '@napi-rs/tar-win32-arm64-msvc@0.1.0': - optional: true - - '@napi-rs/tar-win32-ia32-msvc@0.1.0': - optional: true - - '@napi-rs/tar-win32-x64-msvc@0.1.0': - optional: true - - '@napi-rs/tar@0.1.0': - optionalDependencies: - '@napi-rs/tar-android-arm-eabi': 0.1.0 - '@napi-rs/tar-android-arm64': 0.1.0 - '@napi-rs/tar-darwin-arm64': 0.1.0 - '@napi-rs/tar-darwin-x64': 0.1.0 - '@napi-rs/tar-freebsd-x64': 0.1.0 - '@napi-rs/tar-linux-arm-gnueabihf': 0.1.0 - '@napi-rs/tar-linux-arm64-gnu': 0.1.0 - '@napi-rs/tar-linux-arm64-musl': 0.1.0 - '@napi-rs/tar-linux-x64-gnu': 0.1.0 - '@napi-rs/tar-linux-x64-musl': 0.1.0 - '@napi-rs/tar-win32-arm64-msvc': 0.1.0 - '@napi-rs/tar-win32-ia32-msvc': 0.1.0 - '@napi-rs/tar-win32-x64-msvc': 0.1.0 - - '@napi-rs/wasm-runtime@0.1.2': - dependencies: - '@emnapi/core': 1.1.1 - '@emnapi/runtime': 1.1.1 - '@tybys/wasm-util': 0.8.3 - optional: true - - '@napi-rs/wasm-runtime@0.2.0': - dependencies: - '@emnapi/core': 1.1.1 - '@emnapi/runtime': 1.1.1 - '@tybys/wasm-util': 0.8.3 - - '@napi-rs/wasm-tools-android-arm-eabi@0.0.1': - optional: true - - '@napi-rs/wasm-tools-android-arm64@0.0.1': - optional: true - - '@napi-rs/wasm-tools-darwin-arm64@0.0.1': - optional: true - - '@napi-rs/wasm-tools-darwin-x64@0.0.1': - optional: true - - '@napi-rs/wasm-tools-freebsd-x64@0.0.1': - optional: true - - '@napi-rs/wasm-tools-linux-arm64-gnu@0.0.1': - optional: true - - '@napi-rs/wasm-tools-linux-arm64-musl@0.0.1': - optional: true - - '@napi-rs/wasm-tools-linux-x64-gnu@0.0.1': - optional: true - - '@napi-rs/wasm-tools-linux-x64-musl@0.0.1': - optional: true - - '@napi-rs/wasm-tools-wasm32-wasi@0.0.1': - dependencies: - '@napi-rs/wasm-runtime': 0.1.2 - optional: true - - '@napi-rs/wasm-tools-win32-arm64-msvc@0.0.1': - optional: true - - '@napi-rs/wasm-tools-win32-ia32-msvc@0.0.1': - optional: true - - '@napi-rs/wasm-tools-win32-x64-msvc@0.0.1': - optional: true - - '@napi-rs/wasm-tools@0.0.1': - optionalDependencies: - '@napi-rs/wasm-tools-android-arm-eabi': 0.0.1 - '@napi-rs/wasm-tools-android-arm64': 0.0.1 - '@napi-rs/wasm-tools-darwin-arm64': 0.0.1 - '@napi-rs/wasm-tools-darwin-x64': 0.0.1 - '@napi-rs/wasm-tools-freebsd-x64': 0.0.1 - '@napi-rs/wasm-tools-linux-arm64-gnu': 0.0.1 - '@napi-rs/wasm-tools-linux-arm64-musl': 0.0.1 - '@napi-rs/wasm-tools-linux-x64-gnu': 0.0.1 - '@napi-rs/wasm-tools-linux-x64-musl': 0.0.1 - '@napi-rs/wasm-tools-wasm32-wasi': 0.0.1 - '@napi-rs/wasm-tools-win32-arm64-msvc': 0.0.1 - '@napi-rs/wasm-tools-win32-ia32-msvc': 0.0.1 - '@napi-rs/wasm-tools-win32-x64-msvc': 0.0.1 - - '@nodelib/fs.scandir@2.1.5': - dependencies: - '@nodelib/fs.stat': 2.0.5 - run-parallel: 1.2.0 - - '@nodelib/fs.stat@2.0.5': {} - - '@nodelib/fs.walk@1.2.8': - dependencies: - '@nodelib/fs.scandir': 2.1.5 - fastq: 1.17.1 - - '@octokit/auth-token@4.0.0': {} - - '@octokit/core@5.2.0': - dependencies: - '@octokit/auth-token': 4.0.0 - '@octokit/graphql': 7.1.0 - '@octokit/request': 8.4.0 - '@octokit/request-error': 5.1.0 - '@octokit/types': 13.4.1 - before-after-hook: 2.2.3 - universal-user-agent: 6.0.1 - - '@octokit/endpoint@9.0.5': - dependencies: - '@octokit/types': 13.4.1 - universal-user-agent: 6.0.1 - - '@octokit/graphql@7.1.0': - dependencies: - '@octokit/request': 8.4.0 - '@octokit/types': 13.4.1 - universal-user-agent: 6.0.1 - - '@octokit/openapi-types@20.0.0': {} - - '@octokit/openapi-types@22.1.0': {} - - '@octokit/plugin-paginate-rest@9.2.1(@octokit/core@5.2.0)': - dependencies: - '@octokit/core': 5.2.0 - '@octokit/types': 12.6.0 - - '@octokit/plugin-request-log@4.0.1(@octokit/core@5.2.0)': - dependencies: - '@octokit/core': 5.2.0 - - '@octokit/plugin-rest-endpoint-methods@10.4.1(@octokit/core@5.2.0)': - dependencies: - '@octokit/core': 5.2.0 - '@octokit/types': 12.6.0 - - '@octokit/request-error@5.1.0': - dependencies: - '@octokit/types': 13.4.1 - deprecation: 2.3.1 - once: 1.4.0 - - '@octokit/request@8.4.0': - dependencies: - '@octokit/endpoint': 9.0.5 - '@octokit/request-error': 5.1.0 - '@octokit/types': 13.4.1 - universal-user-agent: 6.0.1 - - '@octokit/rest@20.1.0': - dependencies: - '@octokit/core': 5.2.0 - '@octokit/plugin-paginate-rest': 9.2.1(@octokit/core@5.2.0) - '@octokit/plugin-request-log': 4.0.1(@octokit/core@5.2.0) - '@octokit/plugin-rest-endpoint-methods': 10.4.1(@octokit/core@5.2.0) - - '@octokit/types@12.6.0': - dependencies: - '@octokit/openapi-types': 20.0.0 - - '@octokit/types@13.4.1': - dependencies: - '@octokit/openapi-types': 22.1.0 - - '@rollup/pluginutils@4.2.1': - dependencies: - estree-walker: 2.0.2 - picomatch: 2.3.1 - - '@sindresorhus/merge-streams@2.3.0': {} - - '@tybys/wasm-util@0.8.3': - dependencies: - tslib: 2.6.2 - - '@types/node@20.12.7': - dependencies: - undici-types: 5.26.5 - - '@vercel/nft@0.26.4': - dependencies: - '@mapbox/node-pre-gyp': 1.0.11 - '@rollup/pluginutils': 4.2.1 - acorn: 8.11.3 - acorn-import-attributes: 1.9.5(acorn@8.11.3) - async-sema: 3.1.1 - bindings: 1.5.0 - estree-walker: 2.0.2 - glob: 7.2.3 - graceful-fs: 4.2.11 - micromatch: 4.0.5 - node-gyp-build: 4.8.0 - resolve-from: 5.0.0 - transitivePeerDependencies: - - encoding - - supports-color - - abbrev@1.1.1: {} - - acorn-import-attributes@1.9.5(acorn@8.11.3): - dependencies: - acorn: 8.11.3 - - acorn-walk@8.3.2: {} - - acorn@8.11.3: {} - - agent-base@6.0.2: - dependencies: - debug: 4.3.4 - transitivePeerDependencies: - - supports-color - - ansi-escapes@4.3.2: - dependencies: - type-fest: 0.21.3 - - ansi-regex@5.0.1: {} - - ansi-regex@6.0.1: {} - - ansi-styles@4.3.0: - dependencies: - color-convert: 2.0.1 - - ansi-styles@6.2.1: {} - - aproba@2.0.0: {} - - are-we-there-yet@2.0.0: - dependencies: - delegates: 1.0.0 - readable-stream: 3.6.2 - - argparse@1.0.10: - dependencies: - sprintf-js: 1.0.3 - - argparse@2.0.1: {} - - array-find-index@1.0.2: {} - - arrgv@1.0.2: {} - - arrify@3.0.0: {} - - async-sema@3.1.1: {} - - ava@6.1.2: - dependencies: - '@vercel/nft': 0.26.4 - acorn: 8.11.3 - acorn-walk: 8.3.2 - ansi-styles: 6.2.1 - arrgv: 1.0.2 - arrify: 3.0.0 - callsites: 4.1.0 - cbor: 9.0.2 - chalk: 5.3.0 - chunkd: 2.0.1 - ci-info: 4.0.0 - ci-parallel-vars: 1.0.1 - cli-truncate: 4.0.0 - code-excerpt: 4.0.0 - common-path-prefix: 3.0.0 - concordance: 5.0.4 - currently-unhandled: 0.4.1 - debug: 4.3.4 - emittery: 1.0.3 - figures: 6.1.0 - globby: 14.0.1 - ignore-by-default: 2.1.0 - indent-string: 5.0.0 - is-plain-object: 5.0.0 - is-promise: 4.0.0 - matcher: 5.0.0 - memoize: 10.0.0 - ms: 2.1.3 - p-map: 7.0.2 - package-config: 5.0.0 - picomatch: 3.0.1 - plur: 5.1.0 - pretty-ms: 9.0.0 - resolve-cwd: 3.0.0 - stack-utils: 2.0.6 - strip-ansi: 7.1.0 - supertap: 3.0.1 - temp-dir: 3.0.0 - write-file-atomic: 5.0.1 - yargs: 17.7.2 - transitivePeerDependencies: - - encoding - - supports-color - - balanced-match@1.0.2: {} - - base64-js@1.5.1: {} - - before-after-hook@2.2.3: {} - - bindings@1.5.0: - dependencies: - file-uri-to-path: 1.0.0 - - bl@4.1.0: - dependencies: - buffer: 5.7.1 - inherits: 2.0.4 - readable-stream: 3.6.2 - - blueimp-md5@2.19.0: {} - - brace-expansion@1.1.11: - dependencies: - balanced-match: 1.0.2 - concat-map: 0.0.1 - - braces@3.0.2: - dependencies: - fill-range: 7.0.1 - - buffer@5.7.1: - dependencies: - base64-js: 1.5.1 - ieee754: 1.2.1 - - call-bind@1.0.7: - dependencies: - es-define-property: 1.0.0 - es-errors: 1.3.0 - function-bind: 1.1.2 - get-intrinsic: 1.2.4 - set-function-length: 1.2.2 - - callsites@4.1.0: {} - - cbor@9.0.2: - dependencies: - nofilter: 3.1.0 - - chalk@4.1.2: - dependencies: - ansi-styles: 4.3.0 - supports-color: 7.2.0 - - chalk@5.3.0: {} - - chardet@0.7.0: {} - - chownr@2.0.0: {} - - chunkd@2.0.1: {} - - ci-info@4.0.0: {} - - ci-parallel-vars@1.0.1: {} - - cli-cursor@3.1.0: - dependencies: - restore-cursor: 3.1.0 - - cli-spinners@2.9.2: {} - - cli-truncate@4.0.0: - dependencies: - slice-ansi: 5.0.0 - string-width: 7.1.0 - - cli-width@4.1.0: {} - - clipanion@3.2.1(typanion@3.14.0): - dependencies: - typanion: 3.14.0 - - cliui@8.0.1: - dependencies: - string-width: 4.2.3 - strip-ansi: 6.0.1 - wrap-ansi: 7.0.0 - - clone@1.0.4: {} - - code-excerpt@4.0.0: - dependencies: - convert-to-spaces: 2.0.1 - - color-convert@2.0.1: - dependencies: - color-name: 1.1.4 - - color-name@1.1.4: {} - - color-support@1.1.3: {} - - colorette@2.0.20: {} - - common-path-prefix@3.0.0: {} - - concat-map@0.0.1: {} - - concordance@5.0.4: - dependencies: - date-time: 3.1.0 - esutils: 2.0.3 - fast-diff: 1.3.0 - js-string-escape: 1.0.1 - lodash: 4.17.21 - md5-hex: 3.0.1 - semver: 7.6.0 - well-known-symbols: 2.0.0 - - console-control-strings@1.1.0: {} - - convert-to-spaces@2.0.1: {} - - currently-unhandled@0.4.1: - dependencies: - array-find-index: 1.0.2 - - date-time@3.1.0: - dependencies: - time-zone: 1.0.0 - - debug@4.3.4: - dependencies: - ms: 2.1.2 - - defaults@1.0.4: - dependencies: - clone: 1.0.4 - - define-data-property@1.1.4: - dependencies: - es-define-property: 1.0.0 - es-errors: 1.3.0 - gopd: 1.0.1 - - delegates@1.0.0: {} - - deprecation@2.3.1: {} - - detect-libc@2.0.3: {} - - emittery@1.0.3: {} - - emnapi@1.1.1: {} - - emoji-regex@10.3.0: {} - - emoji-regex@8.0.0: {} - - es-define-property@1.0.0: - dependencies: - get-intrinsic: 1.2.4 - - es-errors@1.3.0: {} - - escalade@3.1.2: {} - - escape-string-regexp@2.0.0: {} - - escape-string-regexp@5.0.0: {} - - esprima@4.0.1: {} - - estree-walker@2.0.2: {} - - esutils@2.0.3: {} - - external-editor@3.1.0: - dependencies: - chardet: 0.7.0 - iconv-lite: 0.4.24 - tmp: 0.0.33 - - fast-diff@1.3.0: {} - - fast-glob@3.3.2: - dependencies: - '@nodelib/fs.stat': 2.0.5 - '@nodelib/fs.walk': 1.2.8 - glob-parent: 5.1.2 - merge2: 1.4.1 - micromatch: 4.0.5 - - fastq@1.17.1: - dependencies: - reusify: 1.0.4 - - figures@6.1.0: - dependencies: - is-unicode-supported: 2.0.0 - - file-uri-to-path@1.0.0: {} - - fill-range@7.0.1: - dependencies: - to-regex-range: 5.0.1 - - find-up-simple@1.0.0: {} - - fs-minipass@2.1.0: - dependencies: - minipass: 3.3.6 - - fs.realpath@1.0.0: {} - - function-bind@1.1.2: {} - - gauge@3.0.2: - dependencies: - aproba: 2.0.0 - color-support: 1.1.3 - console-control-strings: 1.1.0 - has-unicode: 2.0.1 - object-assign: 4.1.1 - signal-exit: 3.0.7 - string-width: 4.2.3 - strip-ansi: 6.0.1 - wide-align: 1.1.5 - - get-caller-file@2.0.5: {} - - get-east-asian-width@1.2.0: {} - - get-intrinsic@1.2.4: - dependencies: - es-errors: 1.3.0 - function-bind: 1.1.2 - has-proto: 1.0.3 - has-symbols: 1.0.3 - hasown: 2.0.2 - - glob-parent@5.1.2: - dependencies: - is-glob: 4.0.3 - - glob@7.2.3: - dependencies: - fs.realpath: 1.0.0 - inflight: 1.0.6 - inherits: 2.0.4 - minimatch: 3.1.2 - once: 1.4.0 - path-is-absolute: 1.0.1 - - globby@14.0.1: - dependencies: - '@sindresorhus/merge-streams': 2.3.0 - fast-glob: 3.3.2 - ignore: 5.3.1 - path-type: 5.0.0 - slash: 5.1.0 - unicorn-magic: 0.1.0 - - gopd@1.0.1: - dependencies: - get-intrinsic: 1.2.4 - - graceful-fs@4.2.11: {} - - has-flag@4.0.0: {} - - has-property-descriptors@1.0.2: - dependencies: - es-define-property: 1.0.0 - - has-proto@1.0.3: {} - - has-symbols@1.0.3: {} - - has-unicode@2.0.1: {} - - hasown@2.0.2: - dependencies: - function-bind: 1.1.2 - - https-proxy-agent@5.0.1: - dependencies: - agent-base: 6.0.2 - debug: 4.3.4 - transitivePeerDependencies: - - supports-color - - iconv-lite@0.4.24: - dependencies: - safer-buffer: 2.1.2 - - ieee754@1.2.1: {} - - ignore-by-default@2.1.0: {} - - ignore@5.3.1: {} - - imurmurhash@0.1.4: {} - - indent-string@5.0.0: {} - - inflight@1.0.6: - dependencies: - once: 1.4.0 - wrappy: 1.0.2 - - inherits@2.0.4: {} - - inquirer@9.2.19: - dependencies: - '@inquirer/figures': 1.0.1 - '@ljharb/through': 2.3.13 - ansi-escapes: 4.3.2 - chalk: 5.3.0 - cli-cursor: 3.1.0 - cli-width: 4.1.0 - external-editor: 3.1.0 - lodash: 4.17.21 - mute-stream: 1.0.0 - ora: 5.4.1 - run-async: 3.0.0 - rxjs: 7.8.1 - string-width: 4.2.3 - strip-ansi: 6.0.1 - wrap-ansi: 6.2.0 - - irregular-plurals@3.5.0: {} - - is-extglob@2.1.1: {} - - is-fullwidth-code-point@3.0.0: {} - - is-fullwidth-code-point@4.0.0: {} - - is-glob@4.0.3: - dependencies: - is-extglob: 2.1.1 - - is-interactive@1.0.0: {} - - is-number@7.0.0: {} - - is-plain-object@5.0.0: {} - - is-promise@4.0.0: {} - - is-unicode-supported@0.1.0: {} - - is-unicode-supported@2.0.0: {} - - js-string-escape@1.0.1: {} - - js-yaml@3.14.1: - dependencies: - argparse: 1.0.10 - esprima: 4.0.1 - - js-yaml@4.1.0: - dependencies: - argparse: 2.0.1 - - load-json-file@7.0.1: {} - - lodash-es@4.17.21: {} - - lodash@4.17.21: {} - - log-symbols@4.1.0: - dependencies: - chalk: 4.1.2 - is-unicode-supported: 0.1.0 - - lru-cache@6.0.0: - dependencies: - yallist: 4.0.0 - - make-dir@3.1.0: - dependencies: - semver: 6.3.1 - - matcher@5.0.0: - dependencies: - escape-string-regexp: 5.0.0 - - md5-hex@3.0.1: - dependencies: - blueimp-md5: 2.19.0 - - memoize@10.0.0: - dependencies: - mimic-function: 5.0.1 - - merge2@1.4.1: {} - - micromatch@4.0.5: - dependencies: - braces: 3.0.2 - picomatch: 2.3.1 - - mimic-fn@2.1.0: {} - - mimic-function@5.0.1: {} - - minimatch@3.1.2: - dependencies: - brace-expansion: 1.1.11 - - minipass@3.3.6: - dependencies: - yallist: 4.0.0 - - minipass@5.0.0: {} - - minizlib@2.1.2: - dependencies: - minipass: 3.3.6 - yallist: 4.0.0 - - mkdirp@1.0.4: {} - - ms@2.1.2: {} - - ms@2.1.3: {} - - mute-stream@1.0.0: {} - - node-fetch@2.7.0: - dependencies: - whatwg-url: 5.0.0 - - node-gyp-build@4.8.0: {} - - nofilter@3.1.0: {} - - nopt@5.0.0: - dependencies: - abbrev: 1.1.1 - - npmlog@5.0.1: - dependencies: - are-we-there-yet: 2.0.0 - console-control-strings: 1.1.0 - gauge: 3.0.2 - set-blocking: 2.0.0 - - object-assign@4.1.1: {} - - once@1.4.0: - dependencies: - wrappy: 1.0.2 - - onetime@5.1.2: - dependencies: - mimic-fn: 2.1.0 - - ora@5.4.1: - dependencies: - bl: 4.1.0 - chalk: 4.1.2 - cli-cursor: 3.1.0 - cli-spinners: 2.9.2 - is-interactive: 1.0.0 - is-unicode-supported: 0.1.0 - log-symbols: 4.1.0 - strip-ansi: 6.0.1 - wcwidth: 1.0.1 - - os-tmpdir@1.0.2: {} - - p-map@7.0.2: {} - - package-config@5.0.0: - dependencies: - find-up-simple: 1.0.0 - load-json-file: 7.0.1 - - parse-ms@4.0.0: {} - - path-is-absolute@1.0.1: {} - - path-type@5.0.0: {} - - picomatch@2.3.1: {} - - picomatch@3.0.1: {} - - plur@5.1.0: - dependencies: - irregular-plurals: 3.5.0 - - pretty-ms@9.0.0: - dependencies: - parse-ms: 4.0.0 - - queue-microtask@1.2.3: {} - - readable-stream@3.6.2: - dependencies: - inherits: 2.0.4 - string_decoder: 1.3.0 - util-deprecate: 1.0.2 - - require-directory@2.1.1: {} - - resolve-cwd@3.0.0: - dependencies: - resolve-from: 5.0.0 - - resolve-from@5.0.0: {} - - restore-cursor@3.1.0: - dependencies: - onetime: 5.1.2 - signal-exit: 3.0.7 - - reusify@1.0.4: {} - - rimraf@3.0.2: - dependencies: - glob: 7.2.3 - - run-async@3.0.0: {} - - run-parallel@1.2.0: - dependencies: - queue-microtask: 1.2.3 - - rxjs@7.8.1: - dependencies: - tslib: 2.6.2 - - safe-buffer@5.2.1: {} - - safer-buffer@2.1.2: {} - - semver@6.3.1: {} - - semver@7.6.0: - dependencies: - lru-cache: 6.0.0 - - serialize-error@7.0.1: - dependencies: - type-fest: 0.13.1 - - set-blocking@2.0.0: {} - - set-function-length@1.2.2: - 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 - - signal-exit@3.0.7: {} - - signal-exit@4.1.0: {} - - slash@5.1.0: {} - - slice-ansi@5.0.0: - dependencies: - ansi-styles: 6.2.1 - is-fullwidth-code-point: 4.0.0 - - sprintf-js@1.0.3: {} - - stack-utils@2.0.6: - dependencies: - escape-string-regexp: 2.0.0 - - string-width@4.2.3: - dependencies: - emoji-regex: 8.0.0 - is-fullwidth-code-point: 3.0.0 - strip-ansi: 6.0.1 - - string-width@7.1.0: - dependencies: - emoji-regex: 10.3.0 - get-east-asian-width: 1.2.0 - strip-ansi: 7.1.0 - - string_decoder@1.3.0: - dependencies: - safe-buffer: 5.2.1 - - strip-ansi@6.0.1: - dependencies: - ansi-regex: 5.0.1 - - strip-ansi@7.1.0: - dependencies: - ansi-regex: 6.0.1 - - supertap@3.0.1: - dependencies: - indent-string: 5.0.0 - js-yaml: 3.14.1 - serialize-error: 7.0.1 - strip-ansi: 7.1.0 - - supports-color@7.2.0: - dependencies: - has-flag: 4.0.0 - - tar@6.2.1: - dependencies: - chownr: 2.0.0 - fs-minipass: 2.1.0 - minipass: 5.0.0 - minizlib: 2.1.2 - mkdirp: 1.0.4 - yallist: 4.0.0 - - temp-dir@3.0.0: {} - - time-zone@1.0.0: {} - - tmp@0.0.33: - dependencies: - os-tmpdir: 1.0.2 - - to-regex-range@5.0.1: - dependencies: - is-number: 7.0.0 - - toml@3.0.0: {} - - tr46@0.0.3: {} - - tslib@2.6.2: {} - - typanion@3.14.0: {} - - type-fest@0.13.1: {} - - type-fest@0.21.3: {} - - typescript@5.4.5: {} - - undici-types@5.26.5: {} - - unicorn-magic@0.1.0: {} - - universal-user-agent@6.0.1: {} - - util-deprecate@1.0.2: {} - - wasm-sjlj@1.0.5: {} - - wcwidth@1.0.1: - dependencies: - defaults: 1.0.4 - - webidl-conversions@3.0.1: {} - - well-known-symbols@2.0.0: {} - - whatwg-url@5.0.0: - dependencies: - tr46: 0.0.3 - webidl-conversions: 3.0.1 - - wide-align@1.1.5: - dependencies: - string-width: 4.2.3 - - wrap-ansi@6.2.0: - dependencies: - ansi-styles: 4.3.0 - string-width: 4.2.3 - strip-ansi: 6.0.1 - - wrap-ansi@7.0.0: - dependencies: - ansi-styles: 4.3.0 - string-width: 4.2.3 - strip-ansi: 6.0.1 - - wrappy@1.0.2: {} - - write-file-atomic@5.0.1: - dependencies: - imurmurhash: 0.1.4 - signal-exit: 4.1.0 - - y18n@5.0.8: {} - - yallist@4.0.0: {} - - yargs-parser@21.1.1: {} - - yargs@17.7.2: - dependencies: - cliui: 8.0.1 - escalade: 3.1.2 - get-caller-file: 2.0.5 - require-directory: 2.1.1 - string-width: 4.2.3 - y18n: 5.0.8 - yargs-parser: 21.1.1 diff --git a/src/builtins.rs b/src/builtins.rs deleted file mode 100644 index 45a25117..00000000 --- a/src/builtins.rs +++ /dev/null @@ -1,71 +0,0 @@ -/// Node.js built-in modules -/// -/// `node -p "[...require('module').builtinModules].map(b => JSON.stringify(b)).join(',\n')"` -/// -pub const NODEJS_BUILTINS: &[&str] = &[ - "_http_agent", - "_http_client", - "_http_common", - "_http_incoming", - "_http_outgoing", - "_http_server", - "_stream_duplex", - "_stream_passthrough", - "_stream_readable", - "_stream_transform", - "_stream_wrap", - "_stream_writable", - "_tls_common", - "_tls_wrap", - "assert", - "assert/strict", - "async_hooks", - "buffer", - "child_process", - "cluster", - "console", - "constants", - "crypto", - "dgram", - "diagnostics_channel", - "dns", - "dns/promises", - "domain", - "events", - "fs", - "fs/promises", - "http", - "http2", - "https", - "inspector", - "module", - "net", - "os", - "path", - "path/posix", - "path/win32", - "perf_hooks", - "process", - "punycode", - "querystring", - "readline", - "repl", - "stream", - "stream/consumers", - "stream/promises", - "stream/web", - "string_decoder", - "sys", - "timers", - "timers/promises", - "tls", - "trace_events", - "tty", - "url", - "util", - "util/types", - "v8", - "vm", - "worker_threads", - "zlib", -]; diff --git a/src/cache.rs b/src/cache.rs deleted file mode 100644 index a1bde36c..00000000 --- a/src/cache.rs +++ /dev/null @@ -1,369 +0,0 @@ -use once_cell::sync::OnceCell as OnceLock; -use std::{ - borrow::{Borrow, Cow}, - convert::AsRef, - hash::{BuildHasherDefault, Hash, Hasher}, - io, - ops::Deref, - path::{Path, PathBuf}, - sync::Arc, -}; - -use dashmap::{DashMap, DashSet}; -use rustc_hash::FxHasher; - -use crate::{ - context::ResolveContext as Ctx, package_json::PackageJson, path::PathUtil, FileMetadata, - FileSystem, ResolveError, ResolveOptions, TsConfig, -}; - -#[derive(Default)] -pub struct Cache { - pub(crate) fs: Fs, - paths: DashSet>, - tsconfigs: DashMap, BuildHasherDefault>, -} - -impl Cache { - pub fn new(fs: Fs) -> Self { - Self { fs, paths: DashSet::default(), tsconfigs: DashMap::default() } - } - - pub fn clear(&self) { - self.paths.clear(); - self.tsconfigs.clear(); - } - - pub fn value(&self, path: &Path) -> CachedPath { - let hash = { - let mut hasher = FxHasher::default(); - path.hash(&mut hasher); - hasher.finish() - }; - if let Some(cache_entry) = self.paths.get((hash, path).borrow() as &dyn CacheKey) { - return cache_entry.clone(); - } - let parent = path.parent().map(|p| self.value(p)); - let data = CachedPath(Arc::new(CachedPathImpl::new( - hash, - path.to_path_buf().into_boxed_path(), - parent, - ))); - self.paths.insert(data.clone()); - data - } - - pub fn tsconfig Result<(), ResolveError>>( - &self, - root: bool, - path: &Path, - callback: F, // callback for modifying tsconfig with `extends` - ) -> Result, ResolveError> { - if let Some(tsconfig_ref) = self.tsconfigs.get(path) { - return Ok(Arc::clone(tsconfig_ref.value())); - } - let meta = self.fs.metadata(path).ok(); - let tsconfig_path = if meta.is_some_and(|m| m.is_file) { - Cow::Borrowed(path) - } else if meta.is_some_and(|m| m.is_dir) { - Cow::Owned(path.join("tsconfig.json")) - } else { - let mut os_string = path.to_path_buf().into_os_string(); - os_string.push(".json"); - Cow::Owned(PathBuf::from(os_string)) - }; - let mut tsconfig_string = self - .fs - .read_to_string(&tsconfig_path) - .map_err(|_| ResolveError::TsconfigNotFound(path.to_path_buf()))?; - let mut tsconfig = - TsConfig::parse(root, &tsconfig_path, &mut tsconfig_string).map_err(|error| { - ResolveError::from_serde_json_error(tsconfig_path.to_path_buf(), &error) - })?; - callback(&mut tsconfig)?; - let tsconfig = Arc::new(tsconfig.build()); - self.tsconfigs.insert(path.to_path_buf(), Arc::clone(&tsconfig)); - Ok(tsconfig) - } -} - -#[derive(Clone)] -pub struct CachedPath(Arc); - -impl Hash for CachedPath { - fn hash(&self, state: &mut H) { - self.0.hash.hash(state); - } -} - -impl PartialEq for CachedPath { - fn eq(&self, other: &Self) -> bool { - self.0.path == other.0.path - } -} -impl Eq for CachedPath {} - -impl Deref for CachedPath { - type Target = CachedPathImpl; - - fn deref(&self) -> &Self::Target { - self.0.as_ref() - } -} - -impl<'a> Borrow for CachedPath { - fn borrow(&self) -> &(dyn CacheKey + 'a) { - self - } -} - -impl AsRef for CachedPath { - fn as_ref(&self) -> &CachedPathImpl { - self.0.as_ref() - } -} - -impl CacheKey for CachedPath { - fn tuple(&self) -> (u64, &Path) { - (self.hash, &self.path) - } -} - -pub struct CachedPathImpl { - hash: u64, - path: Box, - parent: Option, - meta: OnceLock>, - symlink: OnceLock>, - canonicalized: OnceLock>, - node_modules: OnceLock>, - package_json: OnceLock>>, -} - -impl CachedPathImpl { - fn new(hash: u64, path: Box, parent: Option) -> Self { - Self { - hash, - path, - parent, - meta: OnceLock::new(), - symlink: OnceLock::new(), - canonicalized: OnceLock::new(), - node_modules: OnceLock::new(), - package_json: OnceLock::new(), - } - } - - pub fn path(&self) -> &Path { - &self.path - } - - pub fn to_path_buf(&self) -> PathBuf { - self.path.to_path_buf() - } - - pub fn parent(&self) -> Option<&CachedPath> { - self.parent.as_ref() - } - - fn meta(&self, fs: &Fs) -> Option { - *self.meta.get_or_init(|| fs.metadata(&self.path).ok()) - } - - pub fn is_file(&self, fs: &Fs, ctx: &mut Ctx) -> bool { - if let Some(meta) = self.meta(fs) { - ctx.add_file_dependency(self.path()); - meta.is_file - } else { - ctx.add_missing_dependency(self.path()); - false - } - } - - pub fn is_dir(&self, fs: &Fs, ctx: &mut Ctx) -> bool { - self.meta(fs).map_or_else( - || { - ctx.add_missing_dependency(self.path()); - false - }, - |meta| meta.is_dir, - ) - } - - fn symlink(&self, fs: &Fs) -> io::Result> { - self.symlink - .get_or_try_init(|| { - if let Ok(symlink_metadata) = fs.symlink_metadata(&self.path) { - if symlink_metadata.is_symlink { - return fs.canonicalize(self.path()).map(Some); - } - } - Ok(None) - }) - .cloned() - } - - pub fn realpath(&self, fs: &Fs) -> io::Result { - self.canonicalized - .get_or_try_init(|| { - if let Some(link) = self.symlink(fs)? { - return Ok(Some(link)); - } - if let Some(parent) = self.parent() { - let parent_path = parent.realpath(fs)?; - return Ok(Some( - parent_path.normalize_with(self.path.strip_prefix(&parent.path).unwrap()), - )); - }; - Ok(None) - }) - .cloned() - .map(|r| r.unwrap_or_else(|| self.path.clone().to_path_buf())) - } - - pub fn module_directory( - &self, - module_name: &str, - cache: &Cache, - ctx: &mut Ctx, - ) -> Option { - let cached_path = cache.value(&self.path.join(module_name)); - cached_path.is_dir(&cache.fs, ctx).then_some(cached_path) - } - - pub fn cached_node_modules( - &self, - cache: &Cache, - ctx: &mut Ctx, - ) -> Option { - self.node_modules.get_or_init(|| self.module_directory("node_modules", cache, ctx)).clone() - } - - /// Find package.json of a path by traversing parent directories. - /// - /// # Errors - /// - /// * [ResolveError::JSON] - pub fn find_package_json( - &self, - fs: &Fs, - options: &ResolveOptions, - ctx: &mut Ctx, - ) -> Result>, ResolveError> { - let mut cache_value = self; - // Go up directories when the querying path is not a directory - while !cache_value.is_dir(fs, ctx) { - if let Some(cv) = &cache_value.parent { - cache_value = cv.as_ref(); - } else { - break; - } - } - let mut cache_value = Some(cache_value); - while let Some(cv) = cache_value { - if let Some(package_json) = cv.package_json(fs, options, ctx)? { - return Ok(Some(Arc::clone(&package_json))); - } - cache_value = cv.parent.as_deref(); - } - Ok(None) - } - - /// Get package.json of the given path. - /// - /// # Errors - /// - /// * [ResolveError::JSON] - pub fn package_json( - &self, - fs: &Fs, - options: &ResolveOptions, - ctx: &mut Ctx, - ) -> Result>, ResolveError> { - // Change to `std::sync::OnceLock::get_or_try_init` when it is stable. - let result = self - .package_json - .get_or_try_init(|| { - let package_json_path = self.path.join("package.json"); - let Ok(package_json_string) = fs.read_to_string(&package_json_path) else { - return Ok(None); - }; - let real_path = if options.symlinks { - self.realpath(fs)?.join("package.json") - } else { - package_json_path.clone() - }; - PackageJson::parse(package_json_path.clone(), real_path, &package_json_string) - .map(Arc::new) - .map(Some) - .map_err(|error| ResolveError::from_serde_json_error(package_json_path, &error)) - }) - .cloned(); - // https://github.com/webpack/enhanced-resolve/blob/58464fc7cb56673c9aa849e68e6300239601e615/lib/DescriptionFileUtils.js#L68-L82 - match &result { - Ok(Some(package_json)) => { - ctx.add_file_dependency(&package_json.path); - } - Ok(None) => { - // Avoid an allocation by making this lazy - if let Some(deps) = &mut ctx.missing_dependencies { - deps.push(self.path.join("package.json")); - } - } - Err(_) => { - if let Some(deps) = &mut ctx.file_dependencies { - deps.push(self.path.join("package.json")); - } - } - } - result - } -} - -/// Memoized cache key, code adapted from . -trait CacheKey { - fn tuple(&self) -> (u64, &Path); -} - -impl Hash for dyn CacheKey + '_ { - fn hash(&self, state: &mut H) { - self.tuple().0.hash(state); - } -} - -impl PartialEq for dyn CacheKey + '_ { - fn eq(&self, other: &Self) -> bool { - self.tuple().1 == other.tuple().1 - } -} - -impl Eq for dyn CacheKey + '_ {} - -impl<'a> CacheKey for (u64, &'a Path) { - fn tuple(&self) -> (u64, &Path) { - (self.0, self.1) - } -} - -impl<'a> Borrow for (u64, &'a Path) { - fn borrow(&self) -> &(dyn CacheKey + 'a) { - self - } -} - -/// Since the cache key is memoized, use an identity hasher -/// to avoid double cache. -#[derive(Default)] -struct IdentityHasher(u64); - -impl Hasher for IdentityHasher { - fn write(&mut self, _: &[u8]) { - unreachable!("Invalid use of IdentityHasher") - } - fn write_u64(&mut self, n: u64) { - self.0 = n; - } - fn finish(&self) -> u64 { - self.0 - } -} diff --git a/src/context.rs b/src/context.rs deleted file mode 100644 index 9349de30..00000000 --- a/src/context.rs +++ /dev/null @@ -1,89 +0,0 @@ -use std::{ - ops::{Deref, DerefMut}, - path::{Path, PathBuf}, -}; - -use crate::error::ResolveError; - -#[derive(Debug, Default, Clone)] -pub struct ResolveContext(ResolveContextImpl); - -#[derive(Debug, Default, Clone)] -pub struct ResolveContextImpl { - pub fully_specified: bool, - - pub query: Option, - - pub fragment: Option, - - /// Files that was found on file system - pub file_dependencies: Option>, - - /// Files that was found on file system - pub missing_dependencies: Option>, - - /// The current resolving alias for bailing recursion alias. - pub resolving_alias: Option, - - /// For avoiding infinite recursion, which will cause stack overflow. - depth: u8, -} - -impl Deref for ResolveContext { - type Target = ResolveContextImpl; - - fn deref(&self) -> &Self::Target { - &self.0 - } -} - -impl DerefMut for ResolveContext { - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} - -impl ResolveContext { - pub fn with_fully_specified(&mut self, yes: bool) { - self.fully_specified = yes; - } - - pub fn with_query_fragment(&mut self, query: Option<&str>, fragment: Option<&str>) { - if let Some(query) = query { - self.query.replace(query.to_string()); - } - if let Some(fragment) = fragment { - self.fragment.replace(fragment.to_string()); - } - } - - pub fn init_file_dependencies(&mut self) { - self.file_dependencies.replace(vec![]); - self.missing_dependencies.replace(vec![]); - } - - pub fn add_file_dependency(&mut self, dep: &Path) { - if let Some(deps) = &mut self.file_dependencies { - deps.push(dep.to_path_buf()); - } - } - - pub fn add_missing_dependency(&mut self, dep: &Path) { - if let Some(deps) = &mut self.missing_dependencies { - deps.push(dep.to_path_buf()); - } - } - - pub fn with_resolving_alias(&mut self, alias: String) { - self.resolving_alias = Some(alias); - } - - pub fn test_for_infinite_recursion(&mut self) -> Result<(), ResolveError> { - self.depth += 1; - // 64 should be more than enough for detecting infinite recursion. - if self.depth > 64 { - return Err(ResolveError::Recursion); - } - Ok(()) - } -} diff --git a/src/error.rs b/src/error.rs deleted file mode 100644 index ff2aaa4f..00000000 --- a/src/error.rs +++ /dev/null @@ -1,160 +0,0 @@ -use std::{io, path::PathBuf, sync::Arc}; -use thiserror::Error; - -/// All resolution errors -/// -/// `thiserror` is used to display meaningful error messages. -#[derive(Debug, Clone, PartialEq, Error)] -pub enum ResolveError { - /// Ignored path - /// - /// Derived from ignored path (false value) from browser field in package.json - /// ```json - /// { - /// "browser": { - /// "./module": false - /// } - /// } - /// ``` - /// See - #[error("Path is ignored {0}")] - Ignored(PathBuf), - - /// Module not found - #[error("Cannot find module '{0}'")] - NotFound(/* specifier */ String), - - /// Tsconfig not found - #[error("Tsconfig not found {0}")] - TsconfigNotFound(PathBuf), - - #[error("{0}")] - IOError(IOError), - - /// Node.js builtin modules - /// - /// This is an error due to not being a Node.js runtime. - /// The `alias` option can be used to resolve a builtin module to a polyfill. - #[error("Builtin module {0}")] - Builtin(String), - - /// All of the aliased extension are not found - #[error("All of the aliased extension are not found")] - ExtensionAlias, - - /// The provided path specifier cannot be parsed - #[error("{0}")] - Specifier(SpecifierError), - - /// JSON parse error - #[error("{0:?}")] - JSON(JSONError), - - /// Restricted by `ResolveOptions::restrictions` - #[error(r#"Path "{0}" restricted by {0}"#)] - Restriction(PathBuf, PathBuf), - - #[error(r#"Invalid module "{0}" specifier is not a valid subpath for the "exports" resolution of {1}"#)] - InvalidModuleSpecifier(String, PathBuf), - - #[error(r#"Invalid "exports" target "{0}" defined for '{1}' in the package config {2}"#)] - InvalidPackageTarget(String, String, PathBuf), - - #[error(r#"Package subpath '{0}' is not defined by "exports" in {1}"#)] - PackagePathNotExported(String, PathBuf), - - #[error(r#"Invalid package config "{0}", "exports" cannot contain some keys starting with '.' and some not. The exports object must either be an object of package subpath keys or an object of main entry condition name keys only."#)] - InvalidPackageConfig(PathBuf), - - #[error(r#"Default condition should be last one in "{0}""#)] - InvalidPackageConfigDefault(PathBuf), - - #[error(r#"Expecting folder to folder mapping. "{0}" should end with "/"#)] - InvalidPackageConfigDirectory(PathBuf), - - #[error(r#"Package import specifier "{0}" is not defined in package {1}"#)] - PackageImportNotDefined(String, PathBuf), - - #[error("{0} is unimplemented")] - Unimplemented(&'static str), - - /// Occurs when alias paths reference each other. - #[error("Recursion in resolving")] - Recursion, -} - -impl ResolveError { - pub fn is_ignore(&self) -> bool { - matches!(self, Self::Ignored(_)) - } - - pub(crate) fn from_serde_json_error(path: PathBuf, error: &serde_json::Error) -> Self { - Self::JSON(JSONError { - path, - message: error.to_string(), - line: error.line(), - column: error.column(), - }) - } -} - -/// Error for [ResolveError::Specifier] -#[derive(Debug, Clone, Eq, PartialEq, Error)] -pub enum SpecifierError { - #[error("The specifiers must be a non-empty string. Received \"{0}\"")] - Empty(String), -} - -/// JSON error from [serde_json::Error] -#[derive(Debug, Clone, Eq, PartialEq)] -pub struct JSONError { - pub path: PathBuf, - pub message: String, - pub line: usize, - pub column: usize, -} - -#[derive(Debug, Clone, Error)] -#[error("{0}")] -pub struct IOError(Arc); - -impl PartialEq for IOError { - fn eq(&self, other: &Self) -> bool { - self.0.kind() == other.0.kind() - } -} - -impl From for io::Error { - fn from(error: IOError) -> Self { - let io_error = error.0.as_ref(); - Self::new(io_error.kind(), io_error.to_string()) - } -} - -impl From for ResolveError { - fn from(err: io::Error) -> Self { - Self::IOError(IOError(Arc::new(err))) - } -} - -#[test] -fn test_into_io_error() { - use std::io::{self, ErrorKind}; - let error_string = "IOError occurred"; - let string_error = io::Error::new(ErrorKind::Interrupted, error_string.to_string()); - let string_error2 = io::Error::new(ErrorKind::Interrupted, error_string.to_string()); - let resolve_io_error: ResolveError = ResolveError::from(string_error2); - - assert_eq!(resolve_io_error, ResolveError::from(string_error)); - assert_eq!(resolve_io_error.clone(), resolve_io_error); - if let ResolveError::IOError(io_error) = resolve_io_error { - // fix for https://github.com/web-infra-dev/rspack/issues/4564 - let std_io_error: io::Error = io_error.into(); - assert_eq!(std_io_error.kind(), ErrorKind::Interrupted); - assert_eq!(std_io_error.to_string(), error_string); - assert_eq!( - format!("{std_io_error:?}"), - r#"Custom { kind: Interrupted, error: "IOError occurred" }"# - ); - } -} diff --git a/src/file_system.rs b/src/file_system.rs deleted file mode 100644 index 04d177de..00000000 --- a/src/file_system.rs +++ /dev/null @@ -1,133 +0,0 @@ -use std::{ - fs, io, - path::{Path, PathBuf}, -}; - -/// File System abstraction used for `ResolverGeneric` -pub trait FileSystem: Send + Sync { - /// See [std::fs::read_to_string] - /// - /// # Errors - /// - /// * See [std::fs::read_to_string] - /// ## Warning - /// Use `&Path` instead of a generic `P: AsRef` here, - /// because object safety requirements, it is especially useful, when - /// you want to store multiple `dyn FileSystem` in a `Vec` or use a `ResolverGeneric` in - /// napi env. - fn read_to_string(&self, path: &Path) -> io::Result; - - /// See [std::fs::metadata] - /// - /// # Errors - /// See [std::fs::metadata] - /// ## Warning - /// Use `&Path` instead of a generic `P: AsRef` here, - /// because object safety requirements, it is especially useful, when - /// you want to store multiple `dyn FileSystem` in a `Vec` or use a `ResolverGeneric` in - /// napi env. - fn metadata(&self, path: &Path) -> io::Result; - - /// See [std::fs::symlink_metadata] - /// - /// # Errors - /// - /// See [std::fs::symlink_metadata] - /// ## Warning - /// Use `&Path` instead of a generic `P: AsRef` here, - /// because object safety requirements, it is especially useful, when - /// you want to store multiple `dyn FileSystem` in a `Vec` or use a `ResolverGeneric` in - /// napi env. - fn symlink_metadata(&self, path: &Path) -> io::Result; - - /// See [std::fs::canonicalize] - /// - /// # Errors - /// - /// See [std::fs::read_link] - /// ## Warning - /// Use `&Path` instead of a generic `P: AsRef` here, - /// because object safety requirements, it is especially useful, when - /// you want to store multiple `dyn FileSystem` in a `Vec` or use a `ResolverGeneric` in - /// napi env. - fn canonicalize(&self, path: &Path) -> io::Result; -} - -/// Metadata information about a file -#[derive(Debug, Clone, Copy)] -pub struct FileMetadata { - pub(crate) is_file: bool, - pub(crate) is_dir: bool, - pub(crate) is_symlink: bool, -} - -impl FileMetadata { - pub fn new(is_file: bool, is_dir: bool, is_symlink: bool) -> Self { - Self { is_file, is_dir, is_symlink } - } -} - -impl From for FileMetadata { - fn from(metadata: fs::Metadata) -> Self { - Self::new(metadata.is_file(), metadata.is_dir(), metadata.is_symlink()) - } -} - -/// Operating System -#[derive(Default)] -pub struct FileSystemOs; - -impl FileSystem for FileSystemOs { - fn read_to_string(&self, path: &Path) -> io::Result { - fs::read_to_string(path) - } - - fn metadata(&self, path: &Path) -> io::Result { - fs::metadata(path).map(FileMetadata::from) - } - - fn symlink_metadata(&self, path: &Path) -> io::Result { - fs::symlink_metadata(path).map(FileMetadata::from) - } - - fn canonicalize(&self, path: &Path) -> io::Result { - #[cfg(not(target_os = "wasi"))] - { - dunce::canonicalize(path) - } - #[cfg(target_os = "wasi")] - { - let meta = fs::symlink_metadata(path)?; - if meta.file_type().is_symlink() { - let link = fs::read_link(path)?; - let mut path_buf = path.to_path_buf(); - path_buf.pop(); - for segment in link.iter() { - match segment.to_str() { - Some("..") => { - path_buf.pop(); - } - Some(".") | None => {} - Some(seg) => { - // Need to trim the extra \0 introduces by rust std rust-lang/rust#123727 - path_buf.push(seg.trim_end_matches('\0')); - } - } - } - Ok(path_buf) - } else { - Ok(path.to_path_buf()) - } - } - } -} - -#[test] -fn metadata() { - let meta = FileMetadata { is_file: true, is_dir: true, is_symlink: true }; - assert_eq!( - format!("{meta:?}"), - "FileMetadata { is_file: true, is_dir: true, is_symlink: true }" - ); - let _ = meta; -} diff --git a/src/lib.rs b/src/lib.rs deleted file mode 100644 index 8ec2ad8a..00000000 --- a/src/lib.rs +++ /dev/null @@ -1,1670 +0,0 @@ -//! # Oxc Resolver -//! -//! Node.js [CommonJS][cjs] and [ECMAScript][esm] Module Resolution. -//! -//! A module resolution is the process of finding the file referenced by a module specifier in -//! `import "specifier"` or `require("specifier")`. -//! -//! All [configuration options](ResolveOptions) are aligned with webpack's [enhanced-resolve]. -//! -//! ## Terminology -//! -//! ### Specifier -//! -//! For [CommonJS modules][cjs], -//! the specifier is the string passed to the `require` function. e.g. `"id"` in `require("id")`. -//! -//! For [ECMAScript modules][esm], -//! the specifier of an `import` statement is the string after the `from` keyword, -//! e.g. `'specifier'` in `import 'specifier'` or `import { sep } from 'specifier'`. -//! Specifiers are also used in export from statements, and as the argument to an `import()` expression. -//! -//! This is also named "request" in some places. -//! -//! ## References: -//! -//! * Algorithm adapted from Node.js [CommonJS Module Resolution Algorithm] and [ECMAScript Module Resolution Algorithm]. -//! * Tests are ported from [enhanced-resolve]. -//! * Some code is adapted from [parcel-resolver]. -//! * The documentation is copied from [webpack's resolve configuration](https://webpack.js.org/configuration/resolve). -//! -//! [enhanced-resolve]: https://github.com/webpack/enhanced-resolve -//! [CommonJS Module Resolution Algorithm]: https://nodejs.org/api/modules.html#all-together -//! [ECMAScript Module Resolution Algorithm]: https://nodejs.org/api/esm.html#resolution-algorithm-specification -//! [parcel-resolver]: https://github.com/parcel-bundler/parcel/blob/v2/packages/utils/node-resolver-rs -//! [cjs]: https://nodejs.org/api/modules.html -//! [esm]: https://nodejs.org/api/esm.html -//! -//! ## Feature flags -#![cfg_attr(feature = "document-features", doc = document_features::document_features!())] -#![cfg_attr(docsrs, feature(doc_auto_cfg))] -//! -//! ## Example -//! -//! ```rust,ignore -#![doc = include_str!("../examples/resolver.rs")] -//! ``` - -mod builtins; -mod cache; -mod context; -mod error; -mod file_system; -mod options; -mod package_json; -mod path; -mod resolution; -mod specifier; -mod tsconfig; - -#[cfg(test)] -mod tests; - -use std::{ - borrow::Cow, - cmp::Ordering, - ffi::OsStr, - fmt, - path::{Component, Path, PathBuf}, - sync::Arc, -}; - -use rustc_hash::FxHashSet; -use serde_json::Value as JSONValue; -use typescript_tsconfig_json::ExtendsField; - -pub use crate::{ - builtins::NODEJS_BUILTINS, - error::{JSONError, ResolveError, SpecifierError}, - file_system::{FileMetadata, FileSystem}, - options::{ - Alias, AliasValue, EnforceExtension, ResolveOptions, Restriction, TsconfigOptions, - TsconfigReferences, - }, - package_json::PackageJson, - resolution::Resolution, -}; -use crate::{ - cache::{Cache, CachedPath}, - context::ResolveContext as Ctx, - file_system::FileSystemOs, - package_json::JSONMap, - path::{PathUtil, SLASH_START}, - specifier::Specifier, - tsconfig::{ProjectReference, TsConfig}, -}; - -type ResolveResult = Result, ResolveError>; - -/// Context returned from the [Resolver::resolve_with_context] API -#[derive(Debug, Default, Clone)] -pub struct ResolveContext { - /// Files that was found on file system - pub file_dependencies: FxHashSet, - - /// Dependencies that was not found on file system - pub missing_dependencies: FxHashSet, -} - -/// Resolver with the current operating system as the file system -pub type Resolver = ResolverGeneric; - -/// Generic implementation of the resolver, can be configured by the [FileSystem] trait -pub struct ResolverGeneric { - options: ResolveOptions, - cache: Arc>, -} - -impl fmt::Debug for ResolverGeneric { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - self.options.fmt(f) - } -} - -impl Default for ResolverGeneric { - fn default() -> Self { - Self::new(ResolveOptions::default()) - } -} - -impl ResolverGeneric { - pub fn new(options: ResolveOptions) -> Self { - Self { options: options.sanitize(), cache: Arc::new(Cache::new(Fs::default())) } - } -} - -impl ResolverGeneric { - pub fn new_with_file_system(file_system: Fs, options: ResolveOptions) -> Self { - Self { cache: Arc::new(Cache::new(file_system)), options: options.sanitize() } - } - - /// Clone the resolver using the same underlying cache. - #[must_use] - pub fn clone_with_options(&self, options: ResolveOptions) -> Self { - Self { options: options.sanitize(), cache: Arc::clone(&self.cache) } - } - - /// Returns the options. - pub fn options(&self) -> &ResolveOptions { - &self.options - } - - /// Clear the underlying cache. - pub fn clear_cache(&self) { - self.cache.clear(); - } - - /// Resolve `specifier` at an absolute `path`. - /// - /// A specifier is the string passed to require or import, i.e. `require("specifier")` or `import "specifier"`. - /// - /// `path` must be an **absolute** path to a directory where the specifier is resolved against. - /// For CommonJS modules, it is the `__dirname` variable that contains the absolute path to the folder containing current module. - /// For ECMAScript modules, it is the value of `import.meta.url`. - /// - /// # Errors - /// - /// * See [ResolveError] - pub fn resolve>( - &self, - path: P, - specifier: &str, - ) -> Result { - let mut ctx = Ctx::default(); - self.resolve_tracing(path.as_ref(), specifier, &mut ctx) - } - - /// Resolve `specifier` at absolute `path` with [ResolveContext] - /// - /// # Errors - /// - /// * See [ResolveError] - pub fn resolve_with_context>( - &self, - path: P, - specifier: &str, - resolve_context: &mut ResolveContext, - ) -> Result { - let mut ctx = Ctx::default(); - ctx.init_file_dependencies(); - let result = self.resolve_tracing(path.as_ref(), specifier, &mut ctx); - if let Some(deps) = &mut ctx.file_dependencies { - resolve_context.file_dependencies.extend(deps.drain(..)); - } - if let Some(deps) = &mut ctx.missing_dependencies { - resolve_context.missing_dependencies.extend(deps.drain(..)); - } - result - } - - /// Wrap `resolve_impl` with `tracing` information - fn resolve_tracing( - &self, - path: &Path, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - let span = tracing::debug_span!("resolve", path = ?path, specifier = specifier); - let _enter = span.enter(); - let r = self.resolve_impl(path, specifier, ctx); - match &r { - Ok(r) => { - tracing::debug!(options = ?self.options, path = ?path, specifier = specifier, ret = ?r.path); - } - Err(err) => { - tracing::debug!(options = ?self.options, path = ?path, specifier = specifier, err = ?err); - } - }; - r - } - - fn resolve_impl( - &self, - path: &Path, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - ctx.with_fully_specified(self.options.fully_specified); - let cached_path = self.cache.value(path); - let cached_path = self.require(&cached_path, specifier, ctx)?; - let path = self.load_realpath(&cached_path)?; - // enhanced-resolve: restrictions - self.check_restrictions(&path)?; - let package_json = cached_path.find_package_json(&self.cache.fs, &self.options, ctx)?; - if let Some(package_json) = &package_json { - // path must be inside the package. - debug_assert!(path.starts_with(package_json.directory())); - } - Ok(Resolution { - path, - query: ctx.query.take(), - fragment: ctx.fragment.take(), - package_json, - }) - } - - /// require(X) from module at path Y - /// - /// X: specifier - /// Y: path - /// - /// - fn require( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - ctx.test_for_infinite_recursion()?; - - // enhanced-resolve: parse - let (parsed, try_fragment_as_path) = self.load_parse(cached_path, specifier, ctx)?; - if let Some(path) = try_fragment_as_path { - return Ok(path); - } - - self.require_without_parse(cached_path, parsed.path(), ctx) - } - - fn require_without_parse( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - // tsconfig-paths - if let Some(path) = self.load_tsconfig_paths(cached_path, specifier, &mut Ctx::default())? { - return Ok(path); - } - - // enhanced-resolve: try alias - if let Some(path) = self.load_alias(cached_path, specifier, &self.options.alias, ctx)? { - return Ok(path); - } - - let result = match Path::new(specifier).components().next() { - // 2. If X begins with '/' - Some(Component::RootDir | Component::Prefix(_)) => { - self.require_absolute(cached_path, specifier, ctx) - } - // 3. If X begins with './' or '/' or '../' - Some(Component::CurDir | Component::ParentDir) => { - self.require_relative(cached_path, specifier, ctx) - } - // 4. If X begins with '#' - Some(Component::Normal(_)) if specifier.as_bytes()[0] == b'#' => { - self.require_hash(cached_path, specifier, ctx) - } - _ => { - // 1. If X is a core module, - // a. return the core module - // b. STOP - self.require_core(specifier)?; - - // (ESM) 5. Otherwise, - // Note: specifier is now a bare specifier. - // Set resolved the result of PACKAGE_RESOLVE(specifier, parentURL). - self.require_bare(cached_path, specifier, ctx) - } - }; - - result.or_else(|err| { - if err.is_ignore() { - return Err(err); - } - // enhanced-resolve: try fallback - self.load_alias(cached_path, specifier, &self.options.fallback, ctx) - .and_then(|value| value.ok_or(err)) - }) - } - - // PACKAGE_RESOLVE(packageSpecifier, parentURL) - // 3. If packageSpecifier is a Node.js builtin module name, then - // 1. Return the string "node:" concatenated with packageSpecifier. - fn require_core(&self, specifier: &str) -> Result<(), ResolveError> { - if self.options.builtin_modules { - let starts_with_node = specifier.starts_with("node:"); - if starts_with_node || NODEJS_BUILTINS.binary_search(&specifier).is_ok() { - let mut specifier = specifier.to_string(); - if !starts_with_node { - specifier = format!("node:{specifier}"); - } - return Err(ResolveError::Builtin(specifier)); - } - } - Ok(()) - } - - fn require_absolute( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - // Make sure only path prefixes gets called - debug_assert!(Path::new(specifier) - .components() - .next() - .is_some_and(|c| matches!(c, Component::RootDir | Component::Prefix(_)))); - if !self.options.prefer_relative && self.options.prefer_absolute { - if let Ok(path) = self.load_package_self_or_node_modules(cached_path, specifier, ctx) { - return Ok(path); - } - } - if let Some(path) = self.load_roots(specifier, ctx) { - return Ok(path); - } - // 2. If X begins with '/' - // a. set Y to be the file system root - let path = self.cache.value(Path::new(specifier)); - if let Some(path) = self.load_as_file_or_directory(&path, specifier, ctx)? { - return Ok(path); - } - Err(ResolveError::NotFound(specifier.to_string())) - } - - // 3. If X begins with './' or '/' or '../' - fn require_relative( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - // Make sure only relative or normal paths gets called - debug_assert!(Path::new(specifier).components().next().is_some_and(|c| matches!( - c, - Component::CurDir | Component::ParentDir | Component::Normal(_) - ))); - let path = cached_path.path().normalize_with(specifier); - let cached_path = self.cache.value(&path); - // a. LOAD_AS_FILE(Y + X) - // b. LOAD_AS_DIRECTORY(Y + X) - if let Some(path) = self.load_as_file_or_directory(&cached_path, specifier, ctx)? { - return Ok(path); - } - // c. THROW "not found" - Err(ResolveError::NotFound(specifier.to_string())) - } - - fn require_hash( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - debug_assert_eq!(specifier.chars().next(), Some('#')); - // a. LOAD_PACKAGE_IMPORTS(X, dirname(Y)) - if let Some(path) = self.load_package_imports(cached_path, specifier, ctx)? { - return Ok(path); - } - self.load_package_self_or_node_modules(cached_path, specifier, ctx) - } - - fn require_bare( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - // Make sure no other path prefixes gets called - debug_assert!(Path::new(specifier) - .components() - .next() - .is_some_and(|c| matches!(c, Component::Normal(_)))); - if self.options.prefer_relative { - if let Ok(path) = self.require_relative(cached_path, specifier, ctx) { - return Ok(path); - } - } - self.load_package_self_or_node_modules(cached_path, specifier, ctx) - } - - /// enhanced-resolve: ParsePlugin. - /// - /// 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`. - /// - /// - fn load_parse<'s>( - &self, - cached_path: &CachedPath, - specifier: &'s str, - ctx: &mut Ctx, - ) -> Result<(Specifier<'s>, Option), ResolveError> { - let parsed = Specifier::parse(specifier).map_err(ResolveError::Specifier)?; - ctx.with_query_fragment(parsed.query, parsed.fragment); - - // There is an edge-case where a request with # can be a path or a fragment -> try both - if ctx.fragment.is_some() && ctx.query.is_none() { - let specifier = parsed.path(); - let fragment = ctx.fragment.take().unwrap(); - let path = format!("{specifier}{fragment}"); - if let Ok(path) = self.require_without_parse(cached_path, &path, ctx) { - return Ok((parsed, Some(path))); - } - ctx.fragment.replace(fragment); - } - Ok((parsed, None)) - } - - fn load_package_self_or_node_modules( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - let (_, subpath) = Self::parse_package_specifier(specifier); - if subpath.is_empty() { - ctx.with_fully_specified(false); - } - // 5. LOAD_PACKAGE_SELF(X, dirname(Y)) - if let Some(path) = self.load_package_self(cached_path, specifier, ctx)? { - return Ok(path); - } - // 6. LOAD_NODE_MODULES(X, dirname(Y)) - if let Some(path) = self.load_node_modules(cached_path, specifier, ctx)? { - return Ok(path); - } - // 7. THROW "not found" - Err(ResolveError::NotFound(specifier.to_string())) - } - - /// LOAD_PACKAGE_IMPORTS(X, DIR) - fn load_package_imports( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - // 1. Find the closest package scope SCOPE to DIR. - // 2. If no scope was found, return. - let Some(package_json) = - cached_path.find_package_json(&self.cache.fs, &self.options, ctx)? - else { - return Ok(None); - }; - // 3. If the SCOPE/package.json "imports" is null or undefined, return. - // 4. let MATCH = PACKAGE_IMPORTS_RESOLVE(X, pathToFileURL(SCOPE), ["node", "require"]) defined in the ESM resolver. - if let Some(path) = self.package_imports_resolve(specifier, &package_json, ctx)? { - // 5. RESOLVE_ESM_MATCH(MATCH). - return self.resolve_esm_match(specifier, &path, ctx); - } - Ok(None) - } - - fn load_as_file(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - // enhanced-resolve feature: extension_alias - if let Some(path) = self.load_extension_alias(cached_path, ctx)? { - return Ok(Some(path)); - } - if self.options.enforce_extension.is_disabled() { - // 1. If X is a file, load X as its file extension format. STOP - if let Some(path) = self.load_alias_or_file(cached_path, ctx)? { - return Ok(Some(path)); - } - } - // 2. If X.js is a file, load X.js as JavaScript text. STOP - // 3. If X.json is a file, parse X.json to a JavaScript Object. STOP - // 4. If X.node is a file, load X.node as binary addon. STOP - if let Some(path) = - self.load_extensions(cached_path.path(), &self.options.extensions, ctx)? - { - return Ok(Some(path)); - } - Ok(None) - } - - fn load_as_directory(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - // TODO: Only package.json is supported, so warn about having other values - // Checking for empty files is needed for omitting checks on package.json - // 1. If X/package.json is a file, - if !self.options.description_files.is_empty() { - // a. Parse X/package.json, and look for "main" field. - if let Some(package_json) = - cached_path.package_json(&self.cache.fs, &self.options, ctx)? - { - // b. If "main" is a falsy value, GOTO 2. - for main_field in package_json.main_fields(&self.options.main_fields) { - // c. let M = X + (json main field) - let main_field_path = cached_path.path().normalize_with(main_field); - // d. LOAD_AS_FILE(M) - let cached_path = self.cache.value(&main_field_path); - if let Some(path) = self.load_as_file(&cached_path, ctx)? { - return Ok(Some(path)); - } - // e. LOAD_INDEX(M) - if let Some(path) = self.load_index(&cached_path, ctx)? { - return Ok(Some(path)); - } - } - // f. LOAD_INDEX(X) DEPRECATED - // g. THROW "not found" - } - } - // 2. LOAD_INDEX(X) - self.load_index(cached_path, ctx) - } - - fn load_as_file_or_directory( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - if self.options.resolve_to_context { - return Ok(cached_path.is_dir(&self.cache.fs, ctx).then(|| cached_path.clone())); - } - if !specifier.ends_with('/') { - if let Some(path) = self.load_as_file(cached_path, ctx)? { - return Ok(Some(path)); - } - } - if cached_path.is_dir(&self.cache.fs, ctx) { - if let Some(path) = self.load_as_directory(cached_path, ctx)? { - return Ok(Some(path)); - } - } - Ok(None) - } - - fn load_extensions(&self, path: &Path, extensions: &[String], ctx: &mut Ctx) -> ResolveResult { - if ctx.fully_specified { - return Ok(None); - } - let path = path.as_os_str(); - for extension in extensions { - let mut path_with_extension = path.to_os_string(); - path_with_extension.reserve_exact(extension.len()); - path_with_extension.push(extension); - let cached_path = self.cache.value(Path::new(&path_with_extension)); - if let Some(path) = self.load_alias_or_file(&cached_path, ctx)? { - return Ok(Some(path)); - } - } - Ok(None) - } - - fn load_realpath(&self, cached_path: &CachedPath) -> Result { - if self.options.symlinks { - cached_path.realpath(&self.cache.fs).map_err(ResolveError::from) - } else { - Ok(cached_path.to_path_buf()) - } - } - - fn check_restrictions(&self, path: &Path) -> Result<(), ResolveError> { - // https://github.com/webpack/enhanced-resolve/blob/a998c7d218b7a9ec2461fc4fddd1ad5dd7687485/lib/RestrictionsPlugin.js#L19-L24 - fn is_inside(path: &Path, parent: &Path) -> bool { - if !path.starts_with(parent) { - return false; - } - if path.as_os_str().len() == parent.as_os_str().len() { - return true; - } - path.strip_prefix(parent).is_ok_and(|p| p == Path::new("./")) - } - for restriction in &self.options.restrictions { - match restriction { - Restriction::Path(restricted_path) => { - if !is_inside(path, restricted_path) { - return Err(ResolveError::Restriction( - path.to_path_buf(), - restricted_path.clone(), - )); - } - } - Restriction::RegExp(_) => { - return Err(ResolveError::Unimplemented("Restriction with regex")) - } - } - } - Ok(()) - } - - fn load_index(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - for main_file in &self.options.main_files { - let main_path = cached_path.path().normalize_with(main_file); - let cached_path = self.cache.value(&main_path); - if self.options.enforce_extension.is_disabled() { - if let Some(path) = self.load_alias_or_file(&cached_path, ctx)? { - return Ok(Some(path)); - } - } - // 1. If X/index.js is a file, load X/index.js as JavaScript text. STOP - // 2. If X/index.json is a file, parse X/index.json to a JavaScript object. STOP - // 3. If X/index.node is a file, load X/index.node as binary addon. STOP - if let Some(path) = - self.load_extensions(cached_path.path(), &self.options.extensions, ctx)? - { - return Ok(Some(path)); - } - } - Ok(None) - } - - fn load_alias_or_file(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - if let Some(package_json) = - cached_path.find_package_json(&self.cache.fs, &self.options, ctx)? - { - if let Some(path) = self.load_browser_field(cached_path, None, &package_json, ctx)? { - return Ok(Some(path)); - } - } - // enhanced-resolve: try file as alias - let alias_specifier = cached_path.path().to_string_lossy(); - if let Some(path) = - self.load_alias(cached_path, &alias_specifier, &self.options.alias, ctx)? - { - return Ok(Some(path)); - } - if cached_path.is_file(&self.cache.fs, ctx) { - return Ok(Some(cached_path.clone())); - } - Ok(None) - } - - fn load_node_modules( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - let (package_name, subpath) = Self::parse_package_specifier(specifier); - // 1. let DIRS = NODE_MODULES_PATHS(START) - // 2. for each DIR in DIRS: - for module_name in &self.options.modules { - for cached_path in std::iter::successors(Some(cached_path), |p| p.parent()) { - // Skip if /path/to/node_modules does not exist - if !cached_path.is_dir(&self.cache.fs, ctx) { - continue; - } - - let Some(cached_path) = self.get_module_directory(cached_path, module_name, ctx) - else { - continue; - }; - // Optimize node_modules lookup by inspecting whether the package exists - // From LOAD_PACKAGE_EXPORTS(X, DIR) - // 1. Try to interpret X as a combination of NAME and SUBPATH where the name - // may have a @scope/ prefix and the subpath begins with a slash (`/`). - if !package_name.is_empty() { - let package_path = cached_path.path().normalize_with(package_name); - let cached_path = self.cache.value(&package_path); - // Try foo/node_modules/package_name - if cached_path.is_dir(&self.cache.fs, ctx) { - // a. LOAD_PACKAGE_EXPORTS(X, DIR) - if let Some(path) = - self.load_package_exports(specifier, subpath, &cached_path, ctx)? - { - return Ok(Some(path)); - } - } else { - // foo/node_modules/package_name is not a directory, so useless to check inside it - if !subpath.is_empty() { - continue; - } - // Skip if the directory lead to the scope package does not exist - // i.e. `foo/node_modules/@scope` is not a directory for `foo/node_modules/@scope/package` - if package_name.starts_with('@') { - if let Some(path) = cached_path.parent() { - if !path.is_dir(&self.cache.fs, ctx) { - continue; - } - } - } - } - } - - // Try as file or directory for all other cases - // b. LOAD_AS_FILE(DIR/X) - // c. LOAD_AS_DIRECTORY(DIR/X) - let node_module_file = cached_path.path().normalize_with(specifier); - let cached_path = self.cache.value(&node_module_file); - if let Some(path) = self.load_as_file_or_directory(&cached_path, specifier, ctx)? { - return Ok(Some(path)); - } - } - } - Ok(None) - } - - fn get_module_directory( - &self, - cached_path: &CachedPath, - module_name: &str, - ctx: &mut Ctx, - ) -> Option { - if cached_path.path().ends_with(module_name) { - Some(cached_path.clone()) - } else if module_name == "node_modules" { - cached_path.cached_node_modules(&self.cache, ctx) - } else { - cached_path.module_directory(module_name, &self.cache, ctx) - } - } - - fn load_package_exports( - &self, - specifier: &str, - subpath: &str, - cached_path: &CachedPath, - ctx: &mut Ctx, - ) -> ResolveResult { - // 2. If X does not match this pattern or DIR/NAME/package.json is not a file, - // return. - let Some(package_json) = cached_path.package_json(&self.cache.fs, &self.options, ctx)? - else { - return Ok(None); - }; - // 3. Parse DIR/NAME/package.json, and look for "exports" field. - // 4. If "exports" is null or undefined, return. - // 5. let MATCH = PACKAGE_EXPORTS_RESOLVE(pathToFileURL(DIR/NAME), "." + SUBPATH, - // `package.json` "exports", ["node", "require"]) defined in the ESM resolver. - // Note: The subpath is not prepended with a dot on purpose - for exports in package_json.exports_fields(&self.options.exports_fields) { - if let Some(path) = self.package_exports_resolve( - cached_path.path(), - &format!(".{subpath}"), - exports, - ctx, - )? { - // 6. RESOLVE_ESM_MATCH(MATCH) - return self.resolve_esm_match(specifier, &path, ctx); - }; - } - Ok(None) - } - - fn load_package_self( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - // 1. Find the closest package scope SCOPE to DIR. - // 2. If no scope was found, return. - let Some(package_json) = - cached_path.find_package_json(&self.cache.fs, &self.options, ctx)? - else { - return Ok(None); - }; - // 3. If the SCOPE/package.json "exports" is null or undefined, return. - // 4. If the SCOPE/package.json "name" is not the first segment of X, return. - if let Some(subpath) = package_json - .name - .as_ref() - .and_then(|package_name| Self::strip_package_name(specifier, package_name)) - { - // 5. let MATCH = PACKAGE_EXPORTS_RESOLVE(pathToFileURL(SCOPE), - // "." + X.slice("name".length), `package.json` "exports", ["node", "require"]) - // defined in the ESM resolver. - let package_url = package_json.directory(); - // Note: The subpath is not prepended with a dot on purpose - // because `package_exports_resolve` matches subpath without the leading dot. - for exports in package_json.exports_fields(&self.options.exports_fields) { - if let Some(cached_path) = - self.package_exports_resolve(package_url, &format!(".{subpath}"), exports, ctx)? - { - // 6. RESOLVE_ESM_MATCH(MATCH) - return self.resolve_esm_match(specifier, &cached_path, ctx); - } - } - } - self.load_browser_field(cached_path, Some(specifier), &package_json, ctx) - } - - /// RESOLVE_ESM_MATCH(MATCH) - fn resolve_esm_match( - &self, - specifier: &str, - cached_path: &CachedPath, - ctx: &mut Ctx, - ) -> ResolveResult { - // 1. let RESOLVED_PATH = fileURLToPath(MATCH) - // 2. If the file at RESOLVED_PATH exists, load RESOLVED_PATH as its extension format. STOP - // - // Non-compliant ESM can result in a directory, so directory is tried as well. - if let Some(path) = self.load_as_file_or_directory(cached_path, "", ctx)? { - return Ok(Some(path)); - } - // 3. THROW "not found" - Err(ResolveError::NotFound(specifier.to_string())) - } - - /// enhanced-resolve: AliasFieldPlugin for [ResolveOptions::alias_fields] - fn load_browser_field( - &self, - cached_path: &CachedPath, - module_specifier: Option<&str>, - package_json: &PackageJson, - ctx: &mut Ctx, - ) -> ResolveResult { - let path = cached_path.path(); - let Some(new_specifier) = package_json.resolve_browser_field( - path, - module_specifier, - &self.options.alias_fields, - )? - else { - return Ok(None); - }; - // Abort when resolving recursive module - if module_specifier.is_some_and(|s| s == new_specifier) { - return Ok(None); - } - if ctx.resolving_alias.as_ref().is_some_and(|s| s == new_specifier) { - // Complete when resolving to self `{"./a.js": "./a.js"}` - if new_specifier.strip_prefix("./").filter(|s| path.ends_with(Path::new(s))).is_some() { - return if cached_path.is_file(&self.cache.fs, ctx) { - Ok(Some(cached_path.clone())) - } else { - Err(ResolveError::NotFound(new_specifier.to_string())) - }; - } - return Err(ResolveError::Recursion); - } - ctx.with_resolving_alias(new_specifier.to_string()); - ctx.with_fully_specified(false); - let cached_path = self.cache.value(package_json.directory()); - self.require(&cached_path, new_specifier, ctx).map(Some) - } - - /// enhanced-resolve: AliasPlugin for [ResolveOptions::alias] and [ResolveOptions::fallback]. - fn load_alias( - &self, - cached_path: &CachedPath, - specifier: &str, - aliases: &Alias, - ctx: &mut Ctx, - ) -> ResolveResult { - for (alias_key_raw, specifiers) in aliases { - let alias_key = if let Some(alias_key) = alias_key_raw.strip_suffix('$') { - if alias_key != specifier { - continue; - } - alias_key - } else { - let strip_package_name = Self::strip_package_name(specifier, alias_key_raw); - if strip_package_name.is_none() { - continue; - } - alias_key_raw - }; - // It should stop resolving when all of the tried alias values - // failed to resolve. - // - let mut should_stop = false; - for r in specifiers { - match r { - AliasValue::Path(alias_value) => { - if let Some(path) = self.load_alias_value( - cached_path, - alias_key, - alias_value, - specifier, - ctx, - &mut should_stop, - )? { - return Ok(Some(path)); - } - } - AliasValue::Ignore => { - let path = cached_path.path().normalize_with(alias_key); - return Err(ResolveError::Ignored(path)); - } - } - } - if should_stop { - return Err(ResolveError::NotFound(specifier.to_string())); - } - } - Ok(None) - } - - fn load_alias_value( - &self, - cached_path: &CachedPath, - alias_key: &str, - alias_value: &str, - request: &str, - ctx: &mut Ctx, - should_stop: &mut bool, - ) -> ResolveResult { - if request != alias_value - && !request.strip_prefix(alias_value).is_some_and(|prefix| prefix.starts_with('/')) - { - let tail = &request[alias_key.len()..]; - - let new_specifier = if tail.is_empty() { - Cow::Borrowed(alias_value) - } else { - let alias_value = Path::new(alias_value).normalize(); - // Must not append anything to alias_value if it is a file. - let alias_value_cached_path = self.cache.value(&alias_value); - if alias_value_cached_path.is_file(&self.cache.fs, ctx) { - return Ok(None); - } - - // Remove the leading slash so the final path is concatenated. - let tail = tail.trim_start_matches(SLASH_START); - let normalized = alias_value.normalize_with(tail); - Cow::Owned(normalized.to_string_lossy().to_string()) - }; - - *should_stop = true; - ctx.with_fully_specified(false); - return match self.require(cached_path, new_specifier.as_ref(), ctx) { - Err(ResolveError::NotFound(_)) => Ok(None), - Ok(path) => return Ok(Some(path)), - Err(err) => return Err(err), - }; - } - Ok(None) - } - - /// Given an extension alias map `{".js": [".ts", "js"]}`, - /// load the mapping instead of the provided extension - /// - /// This is an enhanced-resolve feature - /// - /// # Errors - /// - /// * [ResolveError::ExtensionAlias]: When all of the aliased extensions are not found - fn load_extension_alias(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - let Some(path_extension) = cached_path.path().extension() else { - return Ok(None); - }; - let Some((_, extensions)) = self - .options - .extension_alias - .iter() - .find(|(ext, _)| OsStr::new(ext.trim_start_matches('.')) == path_extension) - else { - return Ok(None); - }; - let path = cached_path.path().with_extension(""); - ctx.with_fully_specified(false); - if let Some(path) = self.load_extensions(&path, extensions, ctx)? { - return Ok(Some(path)); - } - Err(ResolveError::ExtensionAlias) - } - - /// enhanced-resolve: RootsPlugin - /// - /// A list of directories where requests of server-relative URLs (starting with '/') are resolved, - /// defaults to context configuration option. - /// - /// On non-Windows systems these requests are resolved as an absolute path first. - fn load_roots(&self, specifier: &str, ctx: &mut Ctx) -> Option { - if !self.options.roots.is_empty() { - if let Some(specifier) = specifier.strip_prefix(SLASH_START) { - for root in &self.options.roots { - let cached_path = self.cache.value(root); - if let Ok(path) = self.require_relative(&cached_path, specifier, ctx) { - return Some(path); - } - } - } - } - None - } - - fn load_tsconfig_paths( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - let Some(tsconfig_options) = &self.options.tsconfig else { - return Ok(None); - }; - let tsconfig = self.load_tsconfig( - /* root */ true, - &tsconfig_options.config_file, - &tsconfig_options.references, - )?; - let paths = tsconfig.resolve(cached_path.path(), specifier); - for path in paths { - let cached_path = self.cache.value(&path); - if let Ok(path) = self.require_relative(&cached_path, ".", ctx) { - return Ok(Some(path)); - } - } - Ok(None) - } - - fn load_tsconfig( - &self, - root: bool, - path: &Path, - references: &TsconfigReferences, - ) -> Result, ResolveError> { - self.cache.tsconfig(root, path, |tsconfig| { - let directory = self.cache.value(tsconfig.directory()); - tracing::trace!(tsconfig = ?tsconfig, "load_tsconfig"); - - // Extend tsconfig - if let Some(extends) = &tsconfig.extends { - let extended_tsconfig_paths = match extends { - ExtendsField::Single(s) => { - vec![self.get_extended_tsconfig_path(&directory, tsconfig, s)?] - } - ExtendsField::Multiple(specifiers) => specifiers - .iter() - .map(|s| self.get_extended_tsconfig_path(&directory, tsconfig, s)) - .collect::, ResolveError>>()?, - }; - for extended_tsconfig_path in extended_tsconfig_paths { - let extended_tsconfig = self.load_tsconfig( - /* root */ false, - &extended_tsconfig_path, - &TsconfigReferences::Disabled, - )?; - tsconfig.extend_tsconfig(&extended_tsconfig); - } - } - - // Load project references - match references { - TsconfigReferences::Disabled => { - tsconfig.references.drain(..); - } - TsconfigReferences::Auto => {} - TsconfigReferences::Paths(paths) => { - tsconfig.references = paths - .iter() - .map(|path| ProjectReference { path: path.clone(), tsconfig: None }) - .collect(); - } - } - if !tsconfig.references.is_empty() { - let directory = tsconfig.directory().to_path_buf(); - for reference in &mut tsconfig.references { - let reference_tsconfig_path = directory.normalize_with(&reference.path); - let tsconfig = self.cache.tsconfig( - /* root */ true, - &reference_tsconfig_path, - |_| Ok(()), - )?; - reference.tsconfig.replace(tsconfig); - } - } - Ok(()) - }) - } - - fn get_extended_tsconfig_path( - &self, - directory: &CachedPath, - tsconfig: &TsConfig, - specifier: &str, - ) -> Result { - match specifier.as_bytes().first() { - None => Err(ResolveError::Specifier(SpecifierError::Empty(specifier.to_string()))), - Some(b'/') => Ok(PathBuf::from(specifier)), - Some(b'.') => Ok(tsconfig.directory().normalize_with(specifier)), - _ => self - .clone_with_options(ResolveOptions { - description_files: vec![], - extensions: vec![".json".into()], - main_files: vec!["tsconfig.json".into()], - ..ResolveOptions::default() - }) - .load_package_self_or_node_modules(directory, specifier, &mut Ctx::default()) - .map(|p| p.to_path_buf()) - .map_err(|err| match err { - ResolveError::NotFound(_) => { - ResolveError::TsconfigNotFound(PathBuf::from(specifier)) - } - _ => err, - }), - } - } - - /// PACKAGE_RESOLVE(packageSpecifier, parentURL) - fn package_resolve( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - let (package_name, subpath) = Self::parse_package_specifier(specifier); - - // 3. If packageSpecifier is a Node.js builtin module name, then - // 1. Return the string "node:" concatenated with packageSpecifier. - self.require_core(package_name)?; - - // 11. While parentURL is not the file system root, - for module_name in &self.options.modules { - for cached_path in std::iter::successors(Some(cached_path), |p| p.parent()) { - // 1. Let packageURL be the URL resolution of "node_modules/" concatenated with packageSpecifier, relative to parentURL. - let Some(cached_path) = self.get_module_directory(cached_path, module_name, ctx) - else { - continue; - }; - // 2. Set parentURL to the parent folder URL of parentURL. - let package_path = cached_path.path().normalize_with(package_name); - let cached_path = self.cache.value(&package_path); - // 3. If the folder at packageURL does not exist, then - // 1. Continue the next loop iteration. - if cached_path.is_dir(&self.cache.fs, ctx) { - // 4. Let pjson be the result of READ_PACKAGE_JSON(packageURL). - if let Some(package_json) = - cached_path.package_json(&self.cache.fs, &self.options, ctx)? - { - // 5. If pjson is not null and pjson.exports is not null or undefined, then - // 1. Return the result of PACKAGE_EXPORTS_RESOLVE(packageURL, packageSubpath, pjson.exports, defaultConditions). - for exports in package_json.exports_fields(&self.options.exports_fields) { - if let Some(path) = self.package_exports_resolve( - cached_path.path(), - &format!(".{subpath}"), - exports, - ctx, - )? { - return Ok(Some(path)); - } - } - // 6. Otherwise, if packageSubpath is equal to ".", then - if subpath == "." { - // 1. If pjson.main is a string, then - for main_field in package_json.main_fields(&self.options.main_fields) { - // 1. Return the URL resolution of main in packageURL. - let path = cached_path.path().normalize_with(main_field); - let cached_path = self.cache.value(&path); - if cached_path.is_file(&self.cache.fs, ctx) { - return Ok(Some(cached_path)); - } - } - } - } - let subpath = format!(".{subpath}"); - ctx.with_fully_specified(false); - return self.require(&cached_path, &subpath, ctx).map(Some); - } - } - } - - Err(ResolveError::NotFound(specifier.to_string())) - } - - /// PACKAGE_EXPORTS_RESOLVE(packageURL, subpath, exports, conditions) - fn package_exports_resolve( - &self, - package_url: &Path, - subpath: &str, - exports: &JSONValue, - ctx: &mut Ctx, - ) -> ResolveResult { - let conditions = &self.options.condition_names; - // 1. If exports is an Object with both a key starting with "." and a key not starting with ".", throw an Invalid Package Configuration error. - if let JSONValue::Object(map) = exports { - let mut has_dot = false; - let mut without_dot = false; - for key in map.keys() { - has_dot = has_dot || key.starts_with(|s| s == '.' || s == '#'); - without_dot = without_dot || !key.starts_with(|s| s == '.' || s == '#'); - if has_dot && without_dot { - return Err(ResolveError::InvalidPackageConfig( - package_url.join("package.json"), - )); - } - } - } - // 2. If subpath is equal to ".", then - // Note: subpath is not prepended with a dot when passed in. - if subpath == "." { - // enhanced-resolve appends query and fragment when resolving exports field - // https://github.com/webpack/enhanced-resolve/blob/a998c7d218b7a9ec2461fc4fddd1ad5dd7687485/lib/ExportsFieldPlugin.js#L57-L62 - // This is only need when querying the main export, otherwise ctx is passed through. - if ctx.query.is_some() || ctx.fragment.is_some() { - let query = ctx.query.clone().unwrap_or_default(); - let fragment = ctx.fragment.clone().unwrap_or_default(); - return Err(ResolveError::PackagePathNotExported( - format!("./{}{query}{fragment}", subpath.trim_start_matches('.')), - package_url.join("package.json"), - )); - } - // 1. Let mainExport be undefined. - let main_export = match exports { - // 2. If exports is a String or Array, or an Object containing no keys starting with ".", then - JSONValue::String(_) | JSONValue::Array(_) => { - // 1. Set mainExport to exports. - Some(exports) - } - // 3. Otherwise if exports is an Object containing a "." property, then - JSONValue::Object(map) => { - // 1. Set mainExport to exports["."]. - map.get(".").map_or_else( - || { - if map.keys().any(|key| key.starts_with("./") || key.starts_with('#')) { - None - } else { - Some(exports) - } - }, - Some, - ) - } - _ => None, - }; - // 4. If mainExport is not undefined, then - if let Some(main_export) = main_export { - // 1. Let resolved be the result of PACKAGE_TARGET_RESOLVE( packageURL, mainExport, null, false, conditions). - let resolved = self.package_target_resolve( - package_url, - ".", - main_export, - None, - /* is_imports */ false, - conditions, - ctx, - )?; - // 2. If resolved is not null or undefined, return resolved. - if let Some(path) = resolved { - return Ok(Some(path)); - } - } - } - // 3. Otherwise, if exports is an Object and all keys of exports start with ".", then - if let JSONValue::Object(exports) = exports { - // 1. Let matchKey be the string "./" concatenated with subpath. - // Note: `package_imports_exports_resolve` does not require the leading dot. - let match_key = &subpath; - // 2. Let resolved be the result of PACKAGE_IMPORTS_EXPORTS_RESOLVE( matchKey, exports, packageURL, false, conditions). - if let Some(path) = self.package_imports_exports_resolve( - match_key, - exports, - package_url, - /* is_imports */ false, - conditions, - ctx, - )? { - // 3. If resolved is not null or undefined, return resolved. - return Ok(Some(path)); - } - } - // 4. Throw a Package Path Not Exported error. - Err(ResolveError::PackagePathNotExported( - subpath.to_string(), - package_url.join("package.json"), - )) - } - - /// PACKAGE_IMPORTS_RESOLVE(specifier, parentURL, conditions) - fn package_imports_resolve( - &self, - specifier: &str, - package_json: &PackageJson, - ctx: &mut Ctx, - ) -> Result, ResolveError> { - // 1. Assert: specifier begins with "#". - debug_assert!(specifier.starts_with('#'), "{specifier}"); - // 2. If specifier is exactly equal to "#" or starts with "#/", then - // 1. Throw an Invalid Module Specifier error. - // 3. Let packageURL be the result of LOOKUP_PACKAGE_SCOPE(parentURL). - // 4. If packageURL is not null, then - - // 1. Let pjson be the result of READ_PACKAGE_JSON(packageURL). - // 2. If pjson.imports is a non-null Object, then - - // 1. Let resolved be the result of PACKAGE_IMPORTS_EXPORTS_RESOLVE( specifier, pjson.imports, packageURL, true, conditions). - let mut has_imports = false; - for imports in package_json.imports_fields(&self.options.imports_fields) { - if !has_imports { - has_imports = true; - // TODO: fill in test case for this case - if specifier == "#" || specifier.starts_with("#/") { - return Err(ResolveError::InvalidModuleSpecifier( - specifier.to_string(), - package_json.path.clone(), - )); - } - } - if let Some(path) = self.package_imports_exports_resolve( - specifier, - imports, - package_json.directory(), - /* is_imports */ true, - &self.options.condition_names, - ctx, - )? { - // 2. If resolved is not null or undefined, return resolved. - return Ok(Some(path)); - } - } - - // 5. Throw a Package Import Not Defined error. - if has_imports { - Err(ResolveError::PackageImportNotDefined( - specifier.to_string(), - package_json.path.clone(), - )) - } else { - Ok(None) - } - } - - /// PACKAGE_IMPORTS_EXPORTS_RESOLVE(matchKey, matchObj, packageURL, isImports, conditions) - fn package_imports_exports_resolve( - &self, - match_key: &str, - match_obj: &JSONMap, - package_url: &Path, - is_imports: bool, - conditions: &[String], - ctx: &mut Ctx, - ) -> ResolveResult { - // enhanced-resolve behaves differently, it throws - // Error: CachedPath to directories is not possible with the exports field (specifier was ./dist/) - if match_key.ends_with('/') { - return Ok(None); - } - // 1. If matchKey is a key of matchObj and does not contain "*", then - if !match_key.contains('*') { - // 1. Let target be the value of matchObj[matchKey]. - if let Some(target) = match_obj.get(match_key) { - // 2. Return the result of PACKAGE_TARGET_RESOLVE(packageURL, target, null, isImports, conditions). - return self.package_target_resolve( - package_url, - match_key, - target, - None, - is_imports, - conditions, - ctx, - ); - } - } - - let mut best_target = None; - let mut best_match = ""; - let mut best_key = ""; - // 2. Let expansionKeys be the list of keys of matchObj containing only a single "*", sorted by the sorting function PATTERN_KEY_COMPARE which orders in descending order of specificity. - // 3. For each key expansionKey in expansionKeys, do - for (expansion_key, target) in match_obj { - if expansion_key.starts_with("./") || expansion_key.starts_with('#') { - // 1. Let patternBase be the substring of expansionKey up to but excluding the first "*" character. - if let Some((pattern_base, pattern_trailer)) = expansion_key.split_once('*') { - // 2. If matchKey starts with but is not equal to patternBase, then - if match_key.starts_with(pattern_base) - // 1. Let patternTrailer be the substring of expansionKey from the index after the first "*" character. - && !pattern_trailer.contains('*') - // 2. If patternTrailer has zero length, or if matchKey ends with patternTrailer and the length of matchKey is greater than or equal to the length of expansionKey, then - && (pattern_trailer.is_empty() - || (match_key.len() >= expansion_key.len() - && match_key.ends_with(pattern_trailer))) - && Self::pattern_key_compare(best_key, expansion_key).is_gt() - { - // 1. Let target be the value of matchObj[expansionKey]. - best_target = Some(target); - // 2. Let patternMatch be the substring of matchKey starting at the index of the length of patternBase up to the length of matchKey minus the length of patternTrailer. - best_match = - &match_key[pattern_base.len()..match_key.len() - pattern_trailer.len()]; - best_key = expansion_key; - } - } else if expansion_key.ends_with('/') - && match_key.starts_with(expansion_key) - && Self::pattern_key_compare(best_key, expansion_key).is_gt() - { - // TODO: [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./dist/" in the "exports" field module resolution of the package at xxx/package.json. - best_target = Some(target); - best_match = &match_key[expansion_key.len()..]; - best_key = expansion_key; - } - } - } - if let Some(best_target) = best_target { - // 3. Return the result of PACKAGE_TARGET_RESOLVE(packageURL, target, patternMatch, isImports, conditions). - return self.package_target_resolve( - package_url, - best_key, - best_target, - Some(best_match), - is_imports, - conditions, - ctx, - ); - } - // 4. Return null. - Ok(None) - } - - /// PACKAGE_TARGET_RESOLVE(packageURL, target, patternMatch, isImports, conditions) - #[allow(clippy::too_many_arguments)] - fn package_target_resolve( - &self, - package_url: &Path, - target_key: &str, - target: &JSONValue, - pattern_match: Option<&str>, - is_imports: bool, - conditions: &[String], - ctx: &mut Ctx, - ) -> ResolveResult { - fn normalize_string_target<'a>( - target_key: &'a str, - target: &'a str, - pattern_match: Option<&'a str>, - package_url: &Path, - ) -> Result, ResolveError> { - let target = if let Some(pattern_match) = pattern_match { - if !target_key.contains('*') && !target.contains('*') { - // enhanced-resolve behaviour - // TODO: [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./dist/" in the "exports" field module resolution of the package at xxx/package.json. - if target_key.ends_with('/') && target.ends_with('/') { - Cow::Owned(format!("{target}{pattern_match}")) - } else { - return Err(ResolveError::InvalidPackageConfigDirectory( - package_url.join("package.json"), - )); - } - } else { - Cow::Owned(target.replace('*', pattern_match)) - } - } else { - Cow::Borrowed(target) - }; - Ok(target) - } - - match target { - // 1. If target is a String, then - JSONValue::String(target) => { - // 1. If target does not start with "./", then - if !target.starts_with("./") { - // 1. If isImports is false, or if target starts with "../" or "/", or if target is a valid URL, then - if !is_imports || target.starts_with("../") || target.starts_with('/') { - // 1. Throw an Invalid Package Target error. - return Err(ResolveError::InvalidPackageTarget( - target.to_string(), - target_key.to_string(), - package_url.join("package.json"), - )); - } - // 2. If patternMatch is a String, then - // 1. Return PACKAGE_RESOLVE(target with every instance of "*" replaced by patternMatch, packageURL + "/"). - let target = - normalize_string_target(target_key, target, pattern_match, package_url)?; - let package_url = self.cache.value(package_url); - // // 3. Return PACKAGE_RESOLVE(target, packageURL + "/"). - return self.package_resolve(&package_url, &target, ctx); - } - - // 2. If target split on "/" or "\" contains any "", ".", "..", or "node_modules" segments after the first "." segment, case insensitive and including percent encoded variants, throw an Invalid Package Target error. - // 3. Let resolvedTarget be the URL resolution of the concatenation of packageURL and target. - // 4. Assert: resolvedTarget is contained in packageURL. - // 5. If patternMatch is null, then - let target = - normalize_string_target(target_key, target, pattern_match, package_url)?; - if Path::new(target.as_ref()).is_invalid_exports_target() { - return Err(ResolveError::InvalidPackageTarget( - target.to_string(), - target_key.to_string(), - package_url.join("package.json"), - )); - } - let resolved_target = package_url.normalize_with(target.as_ref()); - // 6. If patternMatch split on "/" or "\" contains any "", ".", "..", or "node_modules" segments, case insensitive and including percent encoded variants, throw an Invalid Module Specifier error. - // 7. Return the URL resolution of resolvedTarget with every instance of "*" replaced with patternMatch. - let value = self.cache.value(&resolved_target); - return Ok(Some(value)); - } - // 2. Otherwise, if target is a non-null Object, then - JSONValue::Object(target) => { - // 1. If exports contains any index property keys, as defined in ECMA-262 6.1.7 Array Index, throw an Invalid Package Configuration error. - // 2. For each property p of target, in object insertion order as, - for (key, target_value) in target { - // 1. If p equals "default" or conditions contains an entry for p, then - if key == "default" || conditions.contains(key) { - // 1. Let targetValue be the value of the p property in target. - // 2. Let resolved be the result of PACKAGE_TARGET_RESOLVE( packageURL, targetValue, patternMatch, isImports, conditions). - let resolved = self.package_target_resolve( - package_url, - target_key, - target_value, - pattern_match, - is_imports, - conditions, - ctx, - ); - // 3. If resolved is equal to undefined, continue the loop. - if let Some(path) = resolved? { - // 4. Return resolved. - return Ok(Some(path)); - } - } - } - // 3. Return undefined. - return Ok(None); - } - // 3. Otherwise, if target is an Array, then - JSONValue::Array(targets) => { - // 1. If _target.length is zero, return null. - if targets.is_empty() { - // Note: return PackagePathNotExported has the same effect as return because there are no matches. - return Err(ResolveError::PackagePathNotExported( - pattern_match.unwrap_or(".").to_string(), - package_url.join("package.json"), - )); - } - // 2. For each item targetValue in target, do - for (i, target_value) in targets.iter().enumerate() { - // 1. Let resolved be the result of PACKAGE_TARGET_RESOLVE( packageURL, targetValue, patternMatch, isImports, conditions), continuing the loop on any Invalid Package Target error. - let resolved = self.package_target_resolve( - package_url, - target_key, - target_value, - pattern_match, - is_imports, - conditions, - ctx, - ); - - if resolved.is_err() && i == targets.len() { - return resolved; - } - - // 2. If resolved is undefined, continue the loop. - if let Ok(Some(path)) = resolved { - // 3. Return resolved. - return Ok(Some(path)); - } - } - // 3. Return or throw the last fallback resolution null return or error. - // Note: see `resolved.is_err() && i == targets.len()` - } - _ => {} - } - // 4. Otherwise, if target is null, return null. - Ok(None) - // 5. Otherwise throw an Invalid Package Target error. - } - - // Returns (module, subpath) - // https://github.com/nodejs/node/blob/8f0f17e1e3b6c4e58ce748e06343c5304062c491/lib/internal/modules/esm/resolve.js#L688 - fn parse_package_specifier(specifier: &str) -> (&str, &str) { - let mut separator_index = specifier.as_bytes().iter().position(|b| *b == b'/'); - // let mut valid_package_name = true; - // let mut is_scoped = false; - if specifier.starts_with('@') { - // is_scoped = true; - if separator_index.is_none() || specifier.is_empty() { - // valid_package_name = false; - } else if let Some(index) = &separator_index { - separator_index = specifier[*index + 1..] - .as_bytes() - .iter() - .position(|b| *b == b'/') - .map(|i| i + *index + 1); - } - } - let package_name = - separator_index.map_or(specifier, |separator_index| &specifier[..separator_index]); - - // TODO: https://github.com/nodejs/node/blob/8f0f17e1e3b6c4e58ce748e06343c5304062c491/lib/internal/modules/esm/resolve.js#L705C1-L714C1 - // Package name cannot have leading . and cannot have percent-encoding or - // \\ separators. - // if (RegExpPrototypeExec(invalidPackageNameRegEx, packageName) !== null) - // validPackageName = false; - - // if (!validPackageName) { - // throw new ERR_INVALID_MODULE_SPECIFIER( - // specifier, 'is not a valid package name', fileURLToPath(base)); - // } - let package_subpath = - separator_index.map_or("", |separator_index| &specifier[separator_index..]); - (package_name, package_subpath) - } - - /// PATTERN_KEY_COMPARE(keyA, keyB) - fn pattern_key_compare(key_a: &str, key_b: &str) -> Ordering { - if key_a.is_empty() { - return Ordering::Greater; - } - // 1. Assert: keyA ends with "/" or contains only a single "*". - debug_assert!(key_a.ends_with('/') || key_a.match_indices('*').count() == 1, "{key_a}"); - // 2. Assert: keyB ends with "/" or contains only a single "*". - debug_assert!(key_b.ends_with('/') || key_b.match_indices('*').count() == 1, "{key_b}"); - // 3. Let baseLengthA be the index of "*" in keyA plus one, if keyA contains "*", or the length of keyA otherwise. - let a_pos = key_a.chars().position(|c| c == '*'); - let base_length_a = a_pos.map_or(key_a.len(), |p| p + 1); - // 4. Let baseLengthB be the index of "*" in keyB plus one, if keyB contains "*", or the length of keyB otherwise. - let b_pos = key_b.chars().position(|c| c == '*'); - let base_length_b = b_pos.map_or(key_b.len(), |p| p + 1); - // 5. If baseLengthA is greater than baseLengthB, return -1. - if base_length_a > base_length_b { - return Ordering::Less; - } - // 6. If baseLengthB is greater than baseLengthA, return 1. - if base_length_b > base_length_a { - return Ordering::Greater; - } - // 7. If keyA does not contain "*", return 1. - if !key_a.contains('*') { - return Ordering::Greater; - } - // 8. If keyB does not contain "*", return -1. - if !key_b.contains('*') { - return Ordering::Less; - } - // 9. If the length of keyA is greater than the length of keyB, return -1. - if key_a.len() > key_b.len() { - return Ordering::Less; - } - // 10. If the length of keyB is greater than the length of keyA, return 1. - if key_b.len() > key_a.len() { - return Ordering::Greater; - } - // 11. Return 0. - Ordering::Equal - } - - fn strip_package_name<'a>(specifier: &'a str, package_name: &'a str) -> Option<&'a str> { - specifier - .strip_prefix(package_name) - .filter(|tail| tail.is_empty() || tail.starts_with(SLASH_START)) - } -} diff --git a/src/options.rs b/src/options.rs deleted file mode 100644 index f473a133..00000000 --- a/src/options.rs +++ /dev/null @@ -1,623 +0,0 @@ -use std::path::Path; -use std::{fmt, path::PathBuf}; - -/// Module Resolution Options -/// -/// Options are directly ported from [enhanced-resolve](https://github.com/webpack/enhanced-resolve#resolver-options). -/// -/// See [webpack resolve](https://webpack.js.org/configuration/resolve/) for information and examples -#[derive(Debug, Clone)] -pub struct ResolveOptions { - /// Path to TypeScript configuration file. - /// - /// Default `None` - pub tsconfig: Option, - - /// Create aliases to import or require certain modules more easily. - /// - /// An alias is used to replace a whole path or part of a path. - /// For example, to alias a commonly used `src/` folders: `vec![("@/src"), vec![AliasValue::Path("/path/to/src")]]` - /// - /// A trailing $ can also be added to the given object's keys to signify an exact match. - /// - /// See [webpack's `resolve.alias` documentation](https://webpack.js.org/configuration/resolve/#resolvealias) for a list of use cases. - pub alias: Alias, - - /// A list of alias fields in description files. - /// - /// Specify a field, such as `browser`, to be parsed according to [this specification](https://github.com/defunctzombie/package-browser-field-spec). - /// Can be a path to json object such as `["path", "to", "exports"]`. - /// - /// Default `[]` - pub alias_fields: Vec>, - - /// Condition names for exports field which defines entry points of a package. - /// - /// The key order in the exports field is significant. During condition matching, earlier entries have higher priority and take precedence over later entries. - /// - /// Default `[]` - pub condition_names: Vec, - - /// The JSON files to use for descriptions. (There was once a `bower.json`.) - /// - /// Default `["package.json"]` - pub description_files: Vec, - - /// Set to [EnforceExtension::Enabled] for [ESM Mandatory file extensions](https://nodejs.org/api/esm.html#mandatory-file-extensions). - /// - /// If `enforce_extension` is set to [EnforceExtension::Enabled], resolution will not allow extension-less files. - /// This means `require('./foo.js')` will resolve, while `require('./foo')` will not. - /// - /// The default value for `enforce_extension` is [EnforceExtension::Auto], which is changed upon initialization. - /// - /// It changes to [EnforceExtension::Enabled] if [ResolveOptions::extensions] contains an empty string; - /// otherwise, this value changes to [EnforceExtension::Disabled]. - /// - /// Explicitly set the value to [EnforceExtension::Disabled] to disable this automatic behavior. - /// - /// For reference, this behavior is aligned with `enhanced-resolve`. See . - pub enforce_extension: EnforceExtension, - - /// A list of exports fields in description files. - /// - /// Can be a path to a JSON object such as `["path", "to", "exports"]`. - /// - /// Default `[["exports"]]`. - pub exports_fields: Vec>, - - /// Fields from `package.json` which are used to provide the internal requests of a package - /// (requests starting with # are considered internal). - /// - /// Can be a path to a JSON object such as `["path", "to", "imports"]`. - /// - /// Default `[["imports"]]`. - pub imports_fields: Vec>, - - /// An object which maps extension to extension aliases. - /// - /// Default `{}` - pub extension_alias: Vec<(String, Vec)>, - - /// Attempt to resolve these extensions in order. - /// - /// If multiple files share the same name but have different extensions, - /// will resolve the one with the extension listed first in the array and skip the rest. - /// - /// All extensions must have a leading dot. - /// - /// Default `[".js", ".json", ".node"]` - pub extensions: Vec, - - /// Redirect module requests when normal resolving fails. - /// - /// Default `[]` - pub fallback: Alias, - - /// 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). - /// - /// See also webpack configuration [resolve.fullySpecified](https://webpack.js.org/configuration/module/#resolvefullyspecified) - /// - /// Default `false` - pub fully_specified: bool, - - /// A list of main fields in description files - /// - /// Default `["main"]`. - pub main_fields: Vec, - - /// The filename to be used while resolving directories. - /// - /// Default `["index"]` - pub main_files: Vec, - - /// A list of directories to resolve modules from, can be absolute path or folder name. - /// - /// Default `["node_modules"]` - pub modules: Vec, - - /// Resolve to a context instead of a file. - /// - /// Default `false` - pub resolve_to_context: bool, - - /// Prefer to resolve module requests as relative requests instead of using modules from node_modules directories. - /// - /// Default `false` - pub prefer_relative: bool, - - /// Prefer to resolve server-relative urls as absolute paths before falling back to resolve in ResolveOptions::roots. - /// - /// Default `false` - pub prefer_absolute: bool, - - /// A list of resolve restrictions to restrict the paths that a request can be resolved on. - /// - /// Default `[]` - pub restrictions: Vec, - - /// A list of directories where requests of server-relative URLs (starting with '/') are resolved. - /// On non-Windows systems these requests are resolved as an absolute path first. - /// - /// Default `[]` - pub roots: Vec, - - /// Whether to resolve symlinks to their symlinked location. - /// When enabled, symlinked resources are resolved to their real path, not their symlinked location. - /// Note that this may cause module resolution to fail when using tools that symlink packages (like npm link). - /// - /// Default `true` - pub symlinks: bool, - - /// Whether to parse [module.builtinModules](https://nodejs.org/api/module.html#modulebuiltinmodules) or not. - /// For example, "zlib" will throw [crate::ResolveError::Builtin] when set to true. - /// - /// Default `false` - pub builtin_modules: bool, -} - -impl ResolveOptions { - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// - /// let options = ResolveOptions::default().with_condition_names(&["bar"]); - /// assert_eq!(options.condition_names, vec!["bar".to_string()]) - /// ``` - #[must_use] - pub fn with_condition_names(mut self, names: &[&str]) -> Self { - self.condition_names = names.iter().map(ToString::to_string).collect::>(); - self - } - - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// - /// let options = ResolveOptions::default().with_builtin_modules(false); - /// assert_eq!(options.builtin_modules, false) - /// ``` - #[must_use] - pub fn with_builtin_modules(mut self, flag: bool) -> Self { - self.builtin_modules = flag; - self - } - - /// Adds a single root to the options - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_root("foo"); - /// assert_eq!(options.roots, vec![PathBuf::from("foo")]) - /// ``` - #[must_use] - pub fn with_root>(mut self, root: P) -> Self { - self.roots.push(root.as_ref().to_path_buf()); - self - } - - /// Adds a single extension to the list of extensions - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_extension("jsonc"); - /// assert!(options.extensions.contains(&"jsonc".to_string())); - /// ``` - #[must_use] - pub fn with_extension>(mut self, extension: S) -> Self { - self.extensions.push(extension.into()); - self - } - - /// Adds a single main field to the list of fields - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_main_field("something"); - /// assert!(options.main_fields.contains(&"something".to_string())); - /// ``` - #[must_use] - pub fn with_main_field>(mut self, field: S) -> Self { - self.main_fields.push(field.into()); - self - } - - /// Changes how the extension should be treated - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions, EnforceExtension}; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_force_extension(EnforceExtension::Enabled); - /// assert_eq!(options.enforce_extension, EnforceExtension::Enabled); - /// ``` - #[must_use] - pub fn with_force_extension(mut self, enforce_extension: EnforceExtension) -> Self { - self.enforce_extension = enforce_extension; - self - } - - /// Sets the value for [ResolveOptions::fully_specified] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_fully_specified(true); - /// assert_eq!(options.fully_specified, true); - /// ``` - #[must_use] - pub fn with_fully_specified(mut self, fully_specified: bool) -> Self { - self.fully_specified = fully_specified; - self - } - /// Sets the value for [ResolveOptions::prefer_relative] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_prefer_relative(true); - /// assert_eq!(options.prefer_relative, true); - /// ``` - #[must_use] - pub fn with_prefer_relative(mut self, flag: bool) -> Self { - self.prefer_relative = flag; - self - } - /// Sets the value for [ResolveOptions::prefer_absolute] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_prefer_absolute(true); - /// assert_eq!(options.prefer_absolute, true); - /// ``` - #[must_use] - pub fn with_prefer_absolute(mut self, flag: bool) -> Self { - self.prefer_absolute = flag; - self - } - - /// Changes the value of [ResolveOptions::symlinks] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// - /// let options = ResolveOptions::default().with_symbolic_link(false); - /// assert_eq!(options.symlinks, false); - /// ``` - #[must_use] - pub fn with_symbolic_link(mut self, flag: bool) -> Self { - self.symlinks = flag; - self - } - - /// Adds a module to [ResolveOptions::modules] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// - /// let options = ResolveOptions::default().with_module("module"); - /// assert!(options.modules.contains(&"module".to_string())); - /// ``` - #[must_use] - pub fn with_module>(mut self, module: M) -> Self { - self.modules.push(module.into()); - self - } - - /// Adds a main file to [ResolveOptions::main_files] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// - /// let options = ResolveOptions::default().with_main_file("foo"); - /// assert!(options.main_files.contains(&"foo".to_string())); - /// ``` - #[must_use] - pub fn with_main_file>(mut self, module: M) -> Self { - self.main_files.push(module.into()); - self - } - - pub(crate) fn sanitize(mut self) -> Self { - debug_assert!( - self.extensions.iter().filter(|e| !e.is_empty()).all(|e| e.starts_with('.')), - "All extensions must start with a leading dot" - ); - // Set `enforceExtension` to `true` when [ResolveOptions::extensions] contains an empty string. - // See - if self.enforce_extension == EnforceExtension::Auto { - if !self.extensions.is_empty() && self.extensions.iter().any(String::is_empty) { - self.enforce_extension = EnforceExtension::Enabled; - } else { - self.enforce_extension = EnforceExtension::Disabled; - } - } - self - } -} - -/// Value for [ResolveOptions::enforce_extension] -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -pub enum EnforceExtension { - Auto, - Enabled, - Disabled, -} - -impl EnforceExtension { - pub const fn is_auto(&self) -> bool { - matches!(self, Self::Auto) - } - - pub const fn is_enabled(&self) -> bool { - matches!(self, Self::Enabled) - } - - pub const fn is_disabled(&self) -> bool { - matches!(self, Self::Disabled) - } -} - -/// Alias for [ResolveOptions::alias] and [ResolveOptions::fallback] -pub type Alias = Vec<(String, Vec)>; - -/// Alias Value for [ResolveOptions::alias] and [ResolveOptions::fallback] -#[derive(Debug, Clone, Hash, PartialEq, Eq)] -pub enum AliasValue { - /// The path value - Path(String), - - /// The `false` value - Ignore, -} - -impl From for AliasValue -where - S: Into, -{ - fn from(value: S) -> Self { - Self::Path(value.into()) - } -} - -/// Value for [ResolveOptions::restrictions] -#[derive(Debug, Clone)] -pub enum Restriction { - Path(PathBuf), - RegExp(String), -} - -/// Tsconfig Options for [ResolveOptions::tsconfig] -/// -/// Derived from [tsconfig-paths-webpack-plugin](https://github.com/dividab/tsconfig-paths-webpack-plugin#options) -#[derive(Debug, Clone)] -pub struct TsconfigOptions { - /// Allows you to specify where to find the TypeScript configuration file. - /// You may provide - /// * a relative path to the configuration file. It will be resolved relative to cwd. - /// * an absolute path to the configuration file. - pub config_file: PathBuf, - - /// Support for Typescript Project References. - pub references: TsconfigReferences, -} - -/// Configuration for [TsconfigOptions::references] -#[derive(Debug, Clone)] -pub enum TsconfigReferences { - Disabled, - /// Use the `references` field from tsconfig of `config_file`. - Auto, - /// Manually provided relative or absolute path. - Paths(Vec), -} - -impl Default for ResolveOptions { - fn default() -> Self { - Self { - tsconfig: None, - alias: vec![], - alias_fields: vec![], - condition_names: vec![], - description_files: vec!["package.json".into()], - enforce_extension: EnforceExtension::Auto, - extension_alias: vec![], - exports_fields: vec![vec!["exports".into()]], - imports_fields: vec![vec!["imports".into()]], - extensions: vec![".js".into(), ".json".into(), ".node".into()], - fallback: vec![], - fully_specified: false, - main_fields: vec!["main".into()], - main_files: vec!["index".into()], - modules: vec!["node_modules".into()], - resolve_to_context: false, - prefer_relative: false, - prefer_absolute: false, - restrictions: vec![], - roots: vec![], - symlinks: true, - builtin_modules: false, - } - } -} - -// For tracing -impl fmt::Display for ResolveOptions { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - if let Some(tsconfig) = &self.tsconfig { - write!(f, "tsconfig:{tsconfig:?},")?; - } - if !self.alias.is_empty() { - write!(f, "alias:{:?},", self.alias)?; - } - if !self.alias_fields.is_empty() { - write!(f, "alias_fields:{:?},", self.alias_fields)?; - } - if !self.condition_names.is_empty() { - write!(f, "condition_names:{:?},", self.condition_names)?; - } - if self.enforce_extension.is_enabled() { - write!(f, "enforce_extension:{:?},", self.enforce_extension)?; - } - if !self.exports_fields.is_empty() { - write!(f, "exports_fields:{:?},", self.exports_fields)?; - } - if !self.imports_fields.is_empty() { - write!(f, "imports_fields:{:?},", self.imports_fields)?; - } - if !self.extension_alias.is_empty() { - write!(f, "extension_alias:{:?},", self.extension_alias)?; - } - if !self.extensions.is_empty() { - write!(f, "extensions:{:?},", self.extensions)?; - } - if !self.fallback.is_empty() { - write!(f, "fallback:{:?},", self.fallback)?; - } - if self.fully_specified { - write!(f, "fully_specified:{:?},", self.fully_specified)?; - } - if !self.main_fields.is_empty() { - write!(f, "main_fields:{:?},", self.main_fields)?; - } - if !self.main_files.is_empty() { - write!(f, "main_files:{:?},", self.main_files)?; - } - if !self.modules.is_empty() { - write!(f, "modules:{:?},", self.modules)?; - } - if self.resolve_to_context { - write!(f, "resolve_to_context:{:?},", self.resolve_to_context)?; - } - if self.prefer_relative { - write!(f, "prefer_relative:{:?},", self.prefer_relative)?; - } - if self.prefer_absolute { - write!(f, "prefer_absolute:{:?},", self.prefer_absolute)?; - } - if !self.restrictions.is_empty() { - write!(f, "restrictions:{:?},", self.restrictions)?; - } - if !self.roots.is_empty() { - write!(f, "roots:{:?},", self.roots)?; - } - if self.symlinks { - write!(f, "symlinks:{:?},", self.symlinks)?; - } - if self.builtin_modules { - write!(f, "builtin_modules:{:?},", self.builtin_modules)?; - } - Ok(()) - } -} - -#[cfg(test)] -mod test { - use super::{ - AliasValue, EnforceExtension, ResolveOptions, Restriction, TsconfigOptions, - TsconfigReferences, - }; - use std::path::PathBuf; - - #[test] - fn enforce_extension() { - assert!(EnforceExtension::Auto.is_auto()); - assert!(!EnforceExtension::Enabled.is_auto()); - assert!(!EnforceExtension::Disabled.is_auto()); - - assert!(!EnforceExtension::Auto.is_enabled()); - assert!(EnforceExtension::Enabled.is_enabled()); - assert!(!EnforceExtension::Disabled.is_enabled()); - - assert!(!EnforceExtension::Auto.is_disabled()); - assert!(!EnforceExtension::Enabled.is_disabled()); - assert!(EnforceExtension::Disabled.is_disabled()); - } - - #[test] - fn display() { - let options = ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: PathBuf::from("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - alias: vec![("a".into(), vec![AliasValue::Ignore])], - alias_fields: vec![vec!["browser".into()]], - condition_names: vec!["require".into()], - enforce_extension: EnforceExtension::Enabled, - extension_alias: vec![(".js".into(), vec![".ts".into()])], - exports_fields: vec![vec!["exports".into()]], - imports_fields: vec![vec!["imports".into()]], - fallback: vec![("fallback".into(), vec![AliasValue::Ignore])], - fully_specified: true, - resolve_to_context: true, - prefer_relative: true, - prefer_absolute: true, - restrictions: vec![Restriction::Path(PathBuf::from("restrictions"))], - roots: vec![PathBuf::from("roots")], - builtin_modules: true, - ..ResolveOptions::default() - }; - - let expected = r#"tsconfig:TsconfigOptions { config_file: "tsconfig.json", references: Auto },alias:[("a", [Ignore])],alias_fields:[["browser"]],condition_names:["require"],enforce_extension:Enabled,exports_fields:[["exports"]],imports_fields:[["imports"]],extension_alias:[(".js", [".ts"])],extensions:[".js", ".json", ".node"],fallback:[("fallback", [Ignore])],fully_specified:true,main_fields:["main"],main_files:["index"],modules:["node_modules"],resolve_to_context:true,prefer_relative:true,prefer_absolute:true,restrictions:[Path("restrictions")],roots:["roots"],symlinks:true,builtin_modules:true,"#; - assert_eq!(format!("{options}"), expected); - - let options = ResolveOptions { - alias: vec![], - alias_fields: vec![], - builtin_modules: false, - condition_names: vec![], - description_files: vec![], - enforce_extension: EnforceExtension::Disabled, - exports_fields: vec![], - extension_alias: vec![], - extensions: vec![], - fallback: vec![], - fully_specified: false, - imports_fields: vec![], - main_fields: vec![], - main_files: vec![], - modules: vec![], - prefer_absolute: false, - prefer_relative: false, - resolve_to_context: false, - restrictions: vec![], - roots: vec![], - symlinks: false, - tsconfig: None, - }; - - assert_eq!(format!("{options}"), ""); - } -} diff --git a/src/package_json.rs b/src/package_json.rs deleted file mode 100644 index 73901faa..00000000 --- a/src/package_json.rs +++ /dev/null @@ -1,207 +0,0 @@ -//! package.json definitions -//! -//! Code related to export field are copied from [Parcel's resolver](https://github.com/parcel-bundler/parcel/blob/v2/packages/utils/node-resolver-rs/src/package_json.rs) -use std::path::{Path, PathBuf}; - -use serde_json::Value as JSONValue; - -use crate::{path::PathUtil, ResolveError}; - -pub type JSONMap = serde_json::Map; - -/// Deserialized package.json -#[derive(Debug, Default)] -pub struct PackageJson { - /// Path to `package.json`. Contains the `package.json` filename. - pub path: PathBuf, - - /// Realpath to `package.json`. Contains the `package.json` filename. - pub realpath: PathBuf, - - /// The "name" field defines your package's name. - /// The "name" field can be used in addition to the "exports" field to self-reference a package using its name. - /// - /// - pub name: Option, - - raw_json: std::sync::Arc, -} - -impl PackageJson { - /// # Panics - /// # Errors - pub(crate) fn parse( - path: PathBuf, - realpath: PathBuf, - json: &str, - ) -> Result { - let mut raw_json: JSONValue = serde_json::from_str(json)?; - let mut package_json = Self::default(); - - if let Some(json_object) = raw_json.as_object_mut() { - // Remove large fields that are useless for pragmatic use. - #[cfg(feature = "package_json_raw_json_api")] - { - json_object.remove("description"); - json_object.remove("keywords"); - json_object.remove("scripts"); - json_object.remove("dependencies"); - json_object.remove("devDependencies"); - json_object.remove("peerDependencies"); - json_object.remove("optionalDependencies"); - } - - // Add name. - package_json.name = - json_object.get("name").and_then(|field| field.as_str()).map(ToString::to_string); - } - - package_json.path = path; - package_json.realpath = realpath; - package_json.raw_json = std::sync::Arc::new(raw_json); - Ok(package_json) - } - - fn get_value_by_path<'a>( - fields: &'a serde_json::Map, - path: &[String], - ) -> Option<&'a JSONValue> { - if path.is_empty() { - return None; - } - let mut value = fields.get(&path[0])?; - for key in path.iter().skip(1) { - if let Some(inner_value) = value.as_object().and_then(|o| o.get(key)) { - value = inner_value; - } else { - return None; - } - } - Some(value) - } - - /// Raw serde json value of `package.json`. - /// - /// This is currently used in Rspack for: - /// * getting the `sideEffects` field - /// * query in - search on GitHub indicates query on the `type` field. - /// - /// To reduce overall memory consumption, large fields that useless for pragmatic use are removed. - /// They are: `description`, `keywords`, `scripts`, - /// `dependencies` and `devDependencies`, `peerDependencies`, `optionalDependencies`. - #[cfg(feature = "package_json_raw_json_api")] - pub fn raw_json(&self) -> &std::sync::Arc { - &self.raw_json - } - - /// Directory to `package.json` - /// - /// # Panics - /// - /// * When the package.json path is misconfigured. - pub fn directory(&self) -> &Path { - debug_assert!(self.realpath.file_name().is_some_and(|x| x == "package.json")); - self.realpath.parent().unwrap() - } - - /// The "main" field defines the entry point of a package when imported by name via a node_modules lookup. Its value is a path. - /// - /// When a package has an "exports" field, this will take precedence over the "main" field when importing the package by name. - /// - /// Values are dynamically retrieved from [ResolveOptions::main_fields]. - /// - /// - pub(crate) fn main_fields<'a>( - &'a self, - main_fields: &'a [String], - ) -> impl Iterator + '_ { - main_fields - .iter() - .filter_map(|main_field| self.raw_json.get(main_field)) - .filter_map(|value| value.as_str()) - } - - /// The "exports" field allows defining the entry points of a package when imported by name loaded either via a node_modules lookup or a self-reference to its own name. - /// - /// - pub(crate) fn exports_fields<'a>( - &'a self, - exports_fields: &'a [Vec], - ) -> impl Iterator + '_ { - exports_fields.iter().filter_map(|object_path| { - self.raw_json - .as_object() - .and_then(|json_object| Self::get_value_by_path(json_object, object_path)) - }) - } - - /// In addition to the "exports" field, there is a package "imports" field to create private mappings that only apply to import specifiers from within the package itself. - /// - /// - pub(crate) fn imports_fields<'a>( - &'a self, - imports_fields: &'a [Vec], - ) -> impl Iterator + '_ { - imports_fields.iter().filter_map(|object_path| { - self.raw_json - .as_object() - .and_then(|json_object| Self::get_value_by_path(json_object, object_path)) - .and_then(|value| value.as_object()) - }) - } - - /// The "browser" field is provided by a module author as a hint to javascript bundlers or component tools when packaging modules for client side use. - /// Multiple values are configured by [ResolveOptions::alias_fields]. - /// - /// - fn browser_fields<'a>( - &'a self, - alias_fields: &'a [Vec], - ) -> impl Iterator + '_ { - alias_fields.iter().filter_map(|object_path| { - self.raw_json - .as_object() - .and_then(|json_object| Self::get_value_by_path(json_object, object_path)) - // Only object is valid, all other types are invalid - // https://github.com/webpack/enhanced-resolve/blob/3a28f47788de794d9da4d1702a3a583d8422cd48/lib/AliasFieldPlugin.js#L44-L52 - .and_then(|value| value.as_object()) - }) - } - - /// Resolve the request string for this package.json by looking at the `browser` field. - /// - /// # Errors - /// - /// * Returns [ResolveError::Ignored] for `"path": false` in `browser` field. - pub(crate) fn resolve_browser_field<'a>( - &'a self, - path: &Path, - request: Option<&str>, - alias_fields: &'a [Vec], - ) -> Result, ResolveError> { - for object in self.browser_fields(alias_fields) { - if let Some(request) = request { - if let Some(value) = object.get(request) { - return Self::alias_value(path, value); - } - } else { - let dir = self.path.parent().unwrap(); - for (key, value) in object { - let joined = dir.normalize_with(key); - if joined == path { - return Self::alias_value(path, value); - } - } - } - } - Ok(None) - } - - fn alias_value<'a>(key: &Path, value: &'a JSONValue) -> Result, ResolveError> { - match value { - JSONValue::String(value) => Ok(Some(value.as_str())), - JSONValue::Bool(b) if !b => Err(ResolveError::Ignored(key.to_path_buf())), - _ => Ok(None), - } - } -} diff --git a/src/path.rs b/src/path.rs deleted file mode 100644 index f66fdd76..00000000 --- a/src/path.rs +++ /dev/null @@ -1,132 +0,0 @@ -//! Path Utilities -//! -//! Code adapted from the following libraries -//! * [path-absolutize](https://docs.rs/path-absolutize) -//! * [normalize_path](https://docs.rs/normalize-path) -use std::path::{Component, Path, PathBuf}; - -pub const SLASH_START: &[char; 2] = &['/', '\\']; - -/// Extension trait to add path normalization to std's [`Path`]. -pub trait PathUtil { - /// Normalize this path without performing I/O. - /// - /// All redundant separator and up-level references are collapsed. - /// - /// However, this does not resolve links. - fn normalize(&self) -> PathBuf; - - /// Normalize with subpath assuming this path is normalized without performing I/O. - /// - /// All redundant separator and up-level references are collapsed. - /// - /// However, this does not resolve links. - fn normalize_with>(&self, subpath: P) -> PathBuf; - - /// Defined in ESM PACKAGE_TARGET_RESOLVE - /// If target split on "/" or "\" contains any "", ".", "..", or "node_modules" segments after the first "." segment, case insensitive and including percent encoded variants - fn is_invalid_exports_target(&self) -> bool; -} - -impl PathUtil for Path { - // https://github.com/parcel-bundler/parcel/blob/e0b99c2a42e9109a9ecbd6f537844a1b33e7faf5/packages/utils/node-resolver-rs/src/path.rs#L7 - fn normalize(&self) -> PathBuf { - let mut components = self.components().peekable(); - let mut ret = if let Some(c @ Component::Prefix(..)) = components.peek() { - let buf = PathBuf::from(c.as_os_str()); - components.next(); - buf - } else { - PathBuf::new() - }; - - for component in components { - match component { - Component::Prefix(..) => unreachable!("Path {:?}", self), - Component::RootDir => { - ret.push(component.as_os_str()); - } - Component::CurDir => {} - Component::ParentDir => { - ret.pop(); - } - Component::Normal(c) => { - ret.push(c); - } - } - } - - ret - } - - // https://github.com/parcel-bundler/parcel/blob/e0b99c2a42e9109a9ecbd6f537844a1b33e7faf5/packages/utils/node-resolver-rs/src/path.rs#L37 - fn normalize_with>(&self, subpath: B) -> PathBuf { - let subpath = subpath.as_ref(); - - let mut components = subpath.components(); - - let Some(head) = components.next() else { return subpath.to_path_buf() }; - - if matches!(head, Component::Prefix(..) | Component::RootDir) { - return subpath.to_path_buf(); - } - - let mut ret = self.to_path_buf(); - for component in std::iter::once(head).chain(components) { - match component { - Component::CurDir => {} - Component::ParentDir => { - ret.pop(); - } - Component::Normal(c) => { - ret.push(c); - } - Component::Prefix(..) | Component::RootDir => { - unreachable!("Path {:?} Subpath {:?}", self, subpath) - } - } - } - - ret - } - - fn is_invalid_exports_target(&self) -> bool { - self.components().enumerate().any(|(index, c)| match c { - Component::ParentDir => true, - Component::CurDir => index > 0, - Component::Normal(c) => c.eq_ignore_ascii_case("node_modules"), - _ => false, - }) - } -} - -// https://github.com/webpack/enhanced-resolve/blob/main/test/path.test.js -#[test] -fn is_invalid_exports_target() { - let test_cases = [ - "../a.js", - "../", - "./a/b/../../../c.js", - "./a/b/../../../", - "./../../c.js", - "./../../", - "./a/../b/../../c.js", - "./a/../b/../../", - "./././../", - ]; - - for case in test_cases { - assert!(Path::new(case).is_invalid_exports_target(), "{case}"); - } - - assert!(!Path::new("C:").is_invalid_exports_target()); - assert!(!Path::new("/").is_invalid_exports_target()); -} - -#[test] -fn normalize() { - assert_eq!(Path::new("/foo/.././foo/").normalize(), Path::new("/foo")); - assert_eq!(Path::new("C://").normalize(), Path::new("C://")); - assert_eq!(Path::new("C:").normalize(), Path::new("C:")); - assert_eq!(Path::new(r"\\server\share").normalize(), Path::new(r"\\server\share")); -} diff --git a/src/resolution.rs b/src/resolution.rs deleted file mode 100644 index a3aaa2e7..00000000 --- a/src/resolution.rs +++ /dev/null @@ -1,92 +0,0 @@ -use crate::package_json::PackageJson; -use std::{ - fmt, - path::{Path, PathBuf}, - sync::Arc, -}; - -/// The final path resolution with optional `?query` and `#fragment` -#[derive(Clone)] -pub struct Resolution { - pub(crate) path: PathBuf, - - /// path query `?query`, contains `?`. - pub(crate) query: Option, - - /// path fragment `#query`, contains `#`. - pub(crate) fragment: Option, - - pub(crate) package_json: Option>, -} - -impl fmt::Debug for Resolution { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - f.debug_struct("Resolution") - .field("path", &self.path) - .field("query", &self.query) - .field("fragment", &self.fragment) - .field("package_json", &self.package_json.as_ref().map(|p| &p.path)) - .finish() - } -} - -impl PartialEq for Resolution { - fn eq(&self, other: &Self) -> bool { - self.path == other.path && self.query == other.query && self.fragment == other.fragment - } -} -impl Eq for Resolution {} - -impl Resolution { - /// Returns the path without query and fragment - pub fn path(&self) -> &Path { - &self.path - } - - /// Returns the path without query and fragment - pub fn into_path_buf(self) -> PathBuf { - self.path - } - - /// Returns the path query `?query`, contains the leading `?` - pub fn query(&self) -> Option<&str> { - self.query.as_deref() - } - - /// Returns the path fragment `#fragment`, contains the leading `#` - pub fn fragment(&self) -> Option<&str> { - self.fragment.as_deref() - } - - /// Returns serialized package_json - pub fn package_json(&self) -> Option<&Arc> { - self.package_json.as_ref() - } - - /// Returns the full path with query and fragment - pub fn full_path(&self) -> PathBuf { - let mut path = self.path.clone().into_os_string(); - if let Some(query) = &self.query { - path.push(query); - } - if let Some(fragment) = &self.fragment { - path.push(fragment); - } - PathBuf::from(path) - } -} - -#[test] -fn test() { - let resolution = Resolution { - path: PathBuf::from("foo"), - query: Some("?query".to_string()), - fragment: Some("#fragment".to_string()), - package_json: None, - }; - assert_eq!(resolution.path(), Path::new("foo")); - assert_eq!(resolution.query(), Some("?query")); - assert_eq!(resolution.fragment(), Some("#fragment")); - assert_eq!(resolution.full_path(), PathBuf::from("foo?query#fragment")); - assert_eq!(resolution.into_path_buf(), PathBuf::from("foo")); -} diff --git a/src/specifier.rs b/src/specifier.rs deleted file mode 100644 index 3d35eafc..00000000 --- a/src/specifier.rs +++ /dev/null @@ -1,230 +0,0 @@ -use crate::error::SpecifierError; -use std::borrow::Cow; - -#[derive(Debug)] -pub struct Specifier<'a> { - path: Cow<'a, str>, - pub query: Option<&'a str>, - pub fragment: Option<&'a str>, -} - -impl<'a> Specifier<'a> { - pub fn path(&'a self) -> &'a str { - self.path.as_ref() - } - - pub fn parse(specifier: &'a str) -> Result, SpecifierError> { - if specifier.is_empty() { - return Err(SpecifierError::Empty(specifier.to_string())); - } - let offset = match specifier.as_bytes()[0] { - b'/' | b'.' | b'#' => 1, - _ => 0, - }; - let (path, query, fragment) = Self::parse_query_framgment(specifier, offset); - if path.is_empty() { - return Err(SpecifierError::Empty(specifier.to_string())); - } - Ok(Self { path, query, fragment }) - } - - fn parse_query_framgment( - specifier: &'a str, - skip: usize, - ) -> (Cow<'a, str>, Option<&str>, Option<&str>) { - let mut query_start: Option = None; - let mut fragment_start: Option = None; - - let mut prev = specifier.chars().next().unwrap(); - let mut escaped_indexes = vec![]; - for (i, c) in specifier.char_indices().skip(skip) { - if c == '?' && query_start.is_none() { - query_start = Some(i); - } - if c == '#' { - if prev == '\0' { - escaped_indexes.push(i - 1); - } else { - fragment_start = Some(i); - break; - } - } - prev = c; - } - - let (path, query, fragment) = match (query_start, fragment_start) { - (Some(i), Some(j)) => { - debug_assert!(i < j); - (&specifier[..i], Some(&specifier[i..j]), Some(&specifier[j..])) - } - (Some(i), None) => (&specifier[..i], Some(&specifier[i..]), None), - (None, Some(j)) => (&specifier[..j], None, Some(&specifier[j..])), - _ => (specifier, None, None), - }; - - let path = if escaped_indexes.is_empty() { - Cow::Borrowed(path) - } else { - // Remove the `\0` characters for a legal path. - Cow::Owned( - path.chars() - .enumerate() - .filter_map(|(i, c)| (!escaped_indexes.contains(&i)).then_some(c)) - .collect::(), - ) - }; - - (path, query, fragment) - } -} - -#[cfg(test)] -mod tests { - use super::{Specifier, SpecifierError}; - - #[test] - fn debug() { - let specifier = Specifier::parse("/").unwrap(); - assert_eq!( - format!("{specifier:?}"), - r#"Specifier { path: "/", query: None, fragment: None }"# - ); - } - - #[test] - fn empty() { - let specifiers = ["", "?"]; - for specifier in specifiers { - let error = Specifier::parse(specifier).unwrap_err(); - assert_eq!(error, SpecifierError::Empty(specifier.to_string())); - } - } - - #[test] - fn absolute() -> Result<(), SpecifierError> { - let specifier = "/test?#"; - let parsed = Specifier::parse(specifier)?; - assert_eq!(parsed.path, "/test"); - assert_eq!(parsed.query, Some("?")); - assert_eq!(parsed.fragment, Some("#")); - Ok(()) - } - - #[test] - fn relative() -> Result<(), SpecifierError> { - let specifiers = ["./test", "../test", "../../test"]; - for specifier in specifiers { - let mut r = specifier.to_string(); - r.push_str("?#"); - let parsed = Specifier::parse(&r)?; - assert_eq!(parsed.path, specifier); - assert_eq!(parsed.query, Some("?")); - assert_eq!(parsed.fragment, Some("#")); - } - Ok(()) - } - - #[test] - fn hash() -> Result<(), SpecifierError> { - let specifiers = ["#", "#path"]; - for specifier in specifiers { - let mut r = specifier.to_string(); - r.push_str("?#"); - let parsed = Specifier::parse(&r)?; - assert_eq!(parsed.path, specifier); - assert_eq!(parsed.query, Some("?")); - assert_eq!(parsed.fragment, Some("#")); - } - Ok(()) - } - - #[test] - fn module() -> Result<(), SpecifierError> { - let specifiers = ["module"]; - for specifier in specifiers { - let mut r = specifier.to_string(); - r.push_str("?#"); - let parsed = Specifier::parse(&r)?; - assert_eq!(parsed.path, specifier); - assert_eq!(parsed.query, Some("?")); - assert_eq!(parsed.fragment, Some("#")); - } - Ok(()) - } - - #[test] - fn query_fragment() -> Result<(), SpecifierError> { - let data = [ - ("a?", Some("?"), None), - ("a?query", Some("?query"), None), - ("a?query1?query2", Some("?query1?query2"), None), - ("a?query1?query2?query3", Some("?query1?query2?query3"), None), - ("a#", None, Some("#")), - ("a#b#c", None, Some("#b#c")), - ("a#fragment", None, Some("#fragment")), - ("a?#", Some("?"), Some("#")), - ("a?#fragment", Some("?"), Some("#fragment")), - ("a?query#", Some("?query"), Some("#")), - ("a?query#fragment", Some("?query"), Some("#fragment")), - ("a#fragment?", None, Some("#fragment?")), - ("a#fragment?query", None, Some("#fragment?query")), - ]; - - for (specifier_str, query, fragment) in data { - let specifier = Specifier::parse(specifier_str)?; - assert_eq!(specifier.path, "a", "{specifier_str}"); - assert_eq!(specifier.query, query, "{specifier_str}"); - assert_eq!(specifier.fragment, fragment, "{specifier_str}"); - } - - Ok(()) - } - - #[test] - // https://github.com/webpack/enhanced-resolve/blob/main/test/identifier.test.js - fn enhanced_resolve_edge_cases() -> Result<(), SpecifierError> { - let data = [ - ("path/#", "path/", "", "#"), - ("path/as/?", "path/as/", "?", ""), - ("path/#/?", "path/", "", "#/?"), - ("path/#repo#hash", "path/", "", "#repo#hash"), - ("path/#r#hash", "path/", "", "#r#hash"), - ("path/#repo/#repo2#hash", "path/", "", "#repo/#repo2#hash"), - ("path/#r/#r#hash", "path/", "", "#r/#r#hash"), - ("path/#/not/a/hash?not-a-query", "path/", "", "#/not/a/hash?not-a-query"), - ]; - - for (specifier_str, path, query, fragment) in data { - let specifier = Specifier::parse(specifier_str)?; - assert_eq!(specifier.path, path, "{specifier_str}"); - assert_eq!(specifier.query.unwrap_or(""), query, "{specifier_str}"); - assert_eq!(specifier.fragment.unwrap_or(""), fragment, "{specifier_str}"); - } - - Ok(()) - } - - // https://github.com/webpack/enhanced-resolve/blob/main/test/identifier.test.js - #[test] - fn enhanced_resolve_windows_like() -> Result<(), SpecifierError> { - let data = [ - ("path\\#", "path\\", "", "#"), - ("path\\as\\?", "path\\as\\", "?", ""), - ("path\\#\\?", "path\\", "", "#\\?"), - ("path\\#repo#hash", "path\\", "", "#repo#hash"), - ("path\\#r#hash", "path\\", "", "#r#hash"), - ("path\\#repo\\#repo2#hash", "path\\", "", "#repo\\#repo2#hash"), - ("path\\#r\\#r#hash", "path\\", "", "#r\\#r#hash"), - ("path\\#/not/a/hash?not-a-query", "path\\", "", "#/not/a/hash?not-a-query"), - ]; - - for (specifier_str, path, query, fragment) in data { - let specifier = Specifier::parse(specifier_str)?; - assert_eq!(specifier.path, path, "{specifier_str}"); - assert_eq!(specifier.query.unwrap_or(""), query, "{specifier_str}"); - assert_eq!(specifier.fragment.unwrap_or(""), fragment, "{specifier_str}"); - } - - Ok(()) - } -} diff --git a/src/tests/alias.rs b/src/tests/alias.rs deleted file mode 100644 index 07c615f4..00000000 --- a/src/tests/alias.rs +++ /dev/null @@ -1,280 +0,0 @@ -//! - -use normalize_path::NormalizePath; -use std::path::Path; - -use crate::{AliasValue, Resolution, ResolveContext, ResolveError, ResolveOptions, Resolver}; - -#[test] -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -fn alias() { - use super::memory_fs::MemoryFS; - use crate::ResolverGeneric; - use std::path::{Path, PathBuf}; - - let f = Path::new("/"); - - let file_system = MemoryFS::new(&[ - ("/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", ""), - ("/dashed-name", ""), - ]); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - alias: vec![ - ("aliasA".into(), vec![AliasValue::from("a")]), - ("b$".into(), vec![AliasValue::from("a/index")]), - ("c$".into(), vec![AliasValue::from("/a/index")]), - ( - "multiAlias".into(), - vec![ - AliasValue::from("b"), - AliasValue::from("c"), - AliasValue::from("d"), - AliasValue::from("e"), - AliasValue::from("a"), - ], - ), - ("recursive".into(), vec![AliasValue::from("recursive/dir")]), - ("/d/dir".into(), vec![AliasValue::from("/c/dir")]), - ("/d/index.js".into(), vec![AliasValue::from("/c/index")]), - ("#".into(), vec![AliasValue::from("/c/dir")]), - ("@".into(), vec![AliasValue::from("/c/dir")]), - ("ignored".into(), vec![AliasValue::Ignore]), - // not part of enhanced-resolve, added to make sure query in alias value works - ("alias_query".into(), vec![AliasValue::from("a?query_after")]), - ("alias_fragment".into(), vec![AliasValue::from("a#fragment_after")]), - ("dash".into(), vec![AliasValue::Ignore]), - ("@scope/package-name/file$".into(), vec![AliasValue::from("/c/dir")]), - ], - modules: vec!["/".into()], - ..ResolveOptions::default() - }, - ); - - #[rustfmt::skip] - let pass = [ - ("should resolve a not aliased module 1", "a", "/a/index"), - ("should resolve a not aliased module 2", "a/index", "/a/index"), - ("should resolve a not aliased module 3", "a/dir", "/a/dir/index"), - ("should resolve a not aliased module 4", "a/dir/index", "/a/dir/index"), - ("should resolve an aliased module 1", "aliasA", "/a/index"), - ("should resolve an aliased module 2", "aliasA/index", "/a/index"), - ("should resolve an aliased module 3", "aliasA/dir", "/a/dir/index"), - ("should resolve an aliased module 4", "aliasA/dir/index", "/a/dir/index"), - ("should resolve '#' alias 1", "#", "/c/dir/index"), - ("should resolve '#' alias 2", "#/index", "/c/dir/index"), - ("should resolve '@' alias 1", "@", "/c/dir/index"), - ("should resolve '@' alias 2", "@/index", "/c/dir/index"), - ("should resolve a recursive aliased module 1", "recursive", "/recursive/dir/index"), - ("should resolve a recursive aliased module 2", "recursive/index", "/recursive/dir/index"), - ("should resolve a recursive aliased module 3", "recursive/dir", "/recursive/dir/index"), - ("should resolve a recursive aliased module 4", "recursive/dir/index", "/recursive/dir/index"), - ("should resolve a file aliased module 1", "b", "/a/index"), - ("should resolve a file aliased module 2", "c", "/a/index"), - ("should resolve a file aliased module with a query 1", "b?query", "/a/index?query"), - ("should resolve a file aliased module with a query 2", "c?query", "/a/index?query"), - ("should resolve a path in a file aliased module 1", "b/index", "/b/index"), - ("should resolve a path in a file aliased module 2", "b/dir", "/b/dir/index"), - ("should resolve a path in a file aliased module 3", "b/dir/index", "/b/dir/index"), - ("should resolve a path in a file aliased module 4", "c/index", "/c/index"), - ("should resolve a path in a file aliased module 5", "c/dir", "/c/dir/index"), - ("should resolve a path in a file aliased module 6", "c/dir/index", "/c/dir/index"), - ("should resolve a file aliased file 1", "d", "/c/index"), - ("should resolve a file aliased file 2", "d/dir/index", "/c/dir/index"), - ("should resolve a file in multiple aliased dirs 1", "multiAlias/dir/file", "/e/dir/file"), - ("should resolve a file in multiple aliased dirs 2", "multiAlias/anotherDir", "/e/anotherDir/index"), - // not part of enhanced-resolve, added to make sure query in alias value works - ("should resolve query in alias value", "alias_query?query_before", "/a/index?query_after"), - ("should resolve query in alias value", "alias_fragment#fragment_before", "/a/index#fragment_after"), - ("should resolve dashed name", "dashed-name", "/dashed-name"), - ("should resolve scoped package name with sub dir", "@scope/package-name/file", "/c/dir/index"), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - - #[rustfmt::skip] - let ignore = [ - ("should resolve an ignore module", "ignored", ResolveError::Ignored(f.join("ignored"))) - ]; - - for (comment, request, expected) in ignore { - let resolution = resolver.resolve(f, request); - assert_eq!(resolution, Err(expected), "{comment} {request}"); - } -} - -// Not part of enhanced-resolve -#[test] -fn infinite_recursion() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![ - ("./a".into(), vec![AliasValue::from("./b")]), - ("./b".into(), vec![AliasValue::from("./a")]), - ], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(f, "./a"); - assert_eq!(resolution, Err(ResolveError::Recursion)); -} - -fn check_slash(path: &Path) { - let s = path.to_string_lossy().to_string(); - #[cfg(target_os = "windows")] - { - assert!(!s.contains('/'), "{s}"); - assert!(s.contains('\\'), "{s}"); - } - #[cfg(not(target_os = "windows"))] - { - assert!(s.contains('/'), "{s}"); - assert!(!s.contains('\\'), "{s}"); - } -} - -#[test] -fn absolute_path() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![(f.join("foo").to_str().unwrap().to_string(), vec![AliasValue::Ignore])], - modules: vec![f.clone().to_str().unwrap().to_string()], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(&f, "foo/index"); - assert_eq!(resolution, Err(ResolveError::Ignored(f.join("foo")))); -} - -#[test] -fn system_path() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![("@app".into(), vec![AliasValue::from(f.join("alias").to_string_lossy())])], - ..ResolveOptions::default() - }); - - let specifiers = ["@app/files/a", "@app/files/a.js"]; - - for specifier in specifiers { - let path = resolver.resolve(&f, specifier).map(Resolution::into_path_buf).unwrap(); - assert_eq!(path, f.join("alias/files/a.js")); - check_slash(&path); - } -} - -#[test] -fn alias_is_full_path() { - let f = super::fixture(); - let dir = f.join("foo"); - let dir_str = dir.to_string_lossy().to_string(); - - let resolver = Resolver::new(ResolveOptions { - alias: vec![("@".into(), vec![AliasValue::Path(dir_str.clone())])], - ..ResolveOptions::default() - }); - - let mut ctx = ResolveContext::default(); - - let specifiers = [ - "@/index".to_string(), - "@/index.js".to_string(), - // specifier has multiple `/` for reasons we'll never know - "@////index".to_string(), - // specifier is a full path - dir_str, - ]; - - for specifier in specifiers { - let resolution = resolver.resolve_with_context(&f, &specifier, &mut ctx); - assert_eq!(resolution.map(|r| r.full_path()), Ok(dir.join("index.js"))); - } - - for path in ctx.file_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - check_slash(&path); - } - - for path in ctx.missing_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - check_slash(&path); - if let Some(path) = path.parent() { - assert!(!path.is_file(), "{path:?} must not be a file"); - } - } -} - -// For the `should_stop` variable in `load_alias` -#[test] -fn all_alias_values_are_not_found() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![( - "m1".to_string(), - vec![AliasValue::Path(f.join("node_modules").join("m2").to_string_lossy().to_string())], - )], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(&f, "m1/a.js"); - assert_eq!(resolution, Err(ResolveError::NotFound("m1/a.js".to_string()))); -} - -#[test] -fn alias_fragment() { - let f = super::fixture(); - - let data = [ - // enhanced-resolve has `#` prepended with a `\0`, they are removed from the - // following 3 expected test results. - // See https://github.com/webpack/enhanced-resolve#escaping - ( - "handle fragment edge case (no fragment)", - "./no#fragment/#/#", - f.join("no#fragment/#/#.js"), - ), - ("handle fragment edge case (fragment)", "./no#fragment/#/", f.join("no.js#fragment/#/")), - ( - "handle fragment escaping", - "./no\0#fragment/\0#/\0##fragment", - f.join("no#fragment/#/#.js#fragment"), - ), - ]; - - for (comment, request, expected) in data { - let resolver = Resolver::new(ResolveOptions { - alias: vec![("foo".to_string(), vec![AliasValue::Path(request.to_string())])], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f, "foo").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } -} - -#[test] -fn alias_try_fragment_as_path() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![( - "#".to_string(), - vec![AliasValue::Path(f.join("#").to_string_lossy().to_string())], - )], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(&f, "#/a").map(|r| r.full_path()); - assert_eq!(resolution, Ok(f.join("#").join("a.js"))); -} diff --git a/src/tests/browser_field.rs b/src/tests/browser_field.rs deleted file mode 100644 index 171ee099..00000000 --- a/src/tests/browser_field.rs +++ /dev/null @@ -1,189 +0,0 @@ -//! - -use crate::{AliasValue, ResolveError, ResolveOptions, Resolver}; - -#[test] -fn ignore() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![ - vec!["browser".into()], - vec!["innerBrowser1".into()], - vec!["innerBrowser2".into()], - vec![], - ], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - (f.clone(), "./lib/ignore", f.join("lib/ignore.js")), - (f.clone(), "./lib/ignore.js", f.join("lib/ignore.js")), - (f.join("lib"), "./ignore", f.join("lib/ignore.js")), - (f.join("lib"), "./ignore.js", f.join("lib/ignore.js")), - ]; - - for (path, request, expected) in data { - let resolution = resolver.resolve(&path, request); - let expected = ResolveError::Ignored(expected); - assert_eq!(resolution, Err(expected), "{path:?} {request}"); - } -} - -#[test] -fn shared_resolvers() { - let f = super::fixture().join("browser-module"); - - let resolver1 = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["innerBrowser1".into(), "field".into(), "browser".into()]], - ..ResolveOptions::default() - }); - let resolved_path = resolver1.resolve(&f, "./lib/main1.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("lib/main.js"))); - - let resolver2 = resolver1.clone_with_options(ResolveOptions { - alias_fields: vec![vec!["innerBrowser2".into(), "browser".into()]], - ..ResolveOptions::default() - }); - let resolved_path = resolver2.resolve(&f, "./lib/main2.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("./lib/replaced.js"))); -} - -#[test] -fn replace_file() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![ - vec!["browser".into()], - vec!["innerBrowser1".into(), "field2".into(), "browser".into()], // not presented - vec!["innerBrowser1".into(), "field".into(), "browser".into()], - vec!["innerBrowser2".into(), "browser".into()], - ], - // Not part of enhanced-resolve. Added to make sure no interaction between these two fields. - main_fields: vec!["browser".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - ("should replace a file 1", f.clone(), "./lib/replaced", f.join("lib/browser.js")), - ("should replace a file 2", f.clone(), "./lib/replaced.js", f.join("lib/browser.js")), - ("should replace a file 3", f.join("lib"), "./replaced", f.join("lib/browser.js")), - ("should replace a file 4", f.join("lib"), "./replaced.js", f.join("lib/browser.js")), - ("should replace a module with a file 1", f.clone(), "module-a", f.join("browser/module-a.js")), - ("should replace a module with a file 2", f.join("lib"), "module-a", f.join("browser/module-a.js")), - ("should replace a module with a module 1", f.clone(), "module-b", f.join("node_modules/module-c.js")), - ("should replace a module with a module 2", f.join("lib"), "module-b", f.join("node_modules/module-c.js")), - ("should resolve in nested property 1", f.clone(), "./lib/main1.js", f.join("lib/main.js")), - ("should resolve in nested property 2", f.clone(), "./lib/main2.js", f.join("lib/browser.js")), - ("should check only alias field properties", f.clone(), "./toString", f.join("lib/toString.js")), - // not part of enhanced-resolve - ("recursion", f.clone(), "module-c", f.join("node_modules/module-c.js")), - ("resolve self 1", f.clone(), "./lib/main.js", f.join("lib/main.js")), - ("resolve self 2", f.clone(), "./main.js", f.join("lib/main.js")), - ]; - - for (comment, path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn recurse_fail() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - ("recurse non existent", f.clone(), "./lib/non-existent.js", ResolveError::NotFound("./lib/non-existent.js".into())), - ("path partial match 1", f.clone(), "./xyz.js", ResolveError::NotFound("./xyz.js".into())), - ("path partial match 2", f, "./lib/xyz.js", ResolveError::NotFound("./lib/xyz.js".into())), - ]; - - for (comment, path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Err(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn broken() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - // The browser field string value should be ignored - (f.clone(), "browser-module-broken", Ok(f.join("node_modules/browser-module-broken/main.js"))), - (f.join("browser-module"), "./number", Err(ResolveError::NotFound("./number".into()))), - ]; - - for (path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, expected, "{path:?} {request}"); - } -} - -#[test] -fn crypto_js() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - fallback: vec![( - "crypto".into(), - vec![AliasValue::from(f.join("lib.js").to_string_lossy())], - )], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(f.join("crypto-js"), "crypto").map(|r| r.full_path()); - assert_eq!(resolved_path, Err(ResolveError::Ignored(f.join("crypto-js")))); -} - -// https://github.com/webpack/webpack/blob/87660921808566ef3b8796f8df61bd79fc026108/test/cases/resolving/browser-field/index.js#L40-L43 -#[test] -fn recursive() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - let data = [ - ("should handle recursive file 1", f.clone(), "recursive-file/a"), - ("should handle recursive file 2", f.clone(), "recursive-file/b"), - ("should handle recursive file 3", f.clone(), "recursive-file/c"), - ("should handle recursive file 4", f, "recursive-file/d"), - ]; - - for (comment, path, request) in data { - let resolved_path = resolver.resolve(&path, request); - assert_eq!(resolved_path, Err(ResolveError::Recursion), "{comment} {path:?} {request}"); - } -} - -#[test] -fn with_query() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "./foo").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("lib").join("browser.js?query"))); -} diff --git a/src/tests/builtins.rs b/src/tests/builtins.rs deleted file mode 100644 index 5d6d14d9..00000000 --- a/src/tests/builtins.rs +++ /dev/null @@ -1,121 +0,0 @@ -use std::path::Path; - -use crate::{ResolveError, ResolveOptions, Resolver}; - -#[test] -fn builtins_off() { - let f = Path::new("/"); - let resolver = Resolver::default(); - let resolved_path = resolver.resolve(f, "zlib").map(|r| r.full_path()); - assert_eq!(resolved_path, Err(ResolveError::NotFound("zlib".into()))); -} - -#[test] -fn builtins() { - let f = Path::new("/"); - - let resolver = Resolver::new(ResolveOptions::default().with_builtin_modules(true)); - - let pass = [ - "_http_agent", - "_http_client", - "_http_common", - "_http_incoming", - "_http_outgoing", - "_http_server", - "_stream_duplex", - "_stream_passthrough", - "_stream_readable", - "_stream_transform", - "_stream_wrap", - "_stream_writable", - "_tls_common", - "_tls_wrap", - "assert", - "assert/strict", - "async_hooks", - "buffer", - "child_process", - "cluster", - "console", - "constants", - "crypto", - "dgram", - "diagnostics_channel", - "dns", - "dns/promises", - "domain", - "events", - "fs", - "fs/promises", - "http", - "http2", - "https", - "inspector", - "module", - "net", - "os", - "path", - "path/posix", - "path/win32", - "perf_hooks", - "process", - "punycode", - "querystring", - "readline", - "repl", - "stream", - "stream/consumers", - "stream/promises", - "stream/web", - "string_decoder", - "sys", - "timers", - "timers/promises", - "tls", - "trace_events", - "tty", - "url", - "util", - "util/types", - "v8", - "vm", - "worker_threads", - "zlib", - ]; - - for request in pass { - let prefixed_request = format!("node:{request}"); - for request in [prefixed_request.clone(), request.to_string()] { - let resolved_path = resolver.resolve(f, &request).map(|r| r.full_path()); - let err = ResolveError::Builtin(prefixed_request.clone()); - assert_eq!(resolved_path, Err(err), "{request}"); - } - } -} - -#[test] -fn fail() { - let f = Path::new("/"); - let resolver = Resolver::new(ResolveOptions::default().with_builtin_modules(true)); - let request = "xxx"; - let resolved_path = resolver.resolve(f, request); - let err = ResolveError::NotFound(request.to_string()); - assert_eq!(resolved_path, Err(err), "{request}"); -} - -#[test] -fn imports() { - let f = super::fixture().join("builtins"); - let resolver = Resolver::new(ResolveOptions { - builtin_modules: true, - condition_names: vec!["node".into()], - ..ResolveOptions::default() - }); - - for request in ["#fs", "#http"] { - let resolved_path = resolver.resolve(f.clone(), request).map(|r| r.full_path()); - let err = ResolveError::Builtin(format!("node:{}", request.trim_start_matches('#'))); - assert_eq!(resolved_path, Err(err)); - } -} diff --git a/src/tests/dependencies.rs b/src/tests/dependencies.rs deleted file mode 100644 index bcc2355b..00000000 --- a/src/tests/dependencies.rs +++ /dev/null @@ -1,110 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/dependencies.test.js - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows { - use rustc_hash::FxHashSet; - use std::path::PathBuf; - - use crate::{ResolveContext, ResolveOptions, ResolverGeneric}; - - use super::super::memory_fs::MemoryFS; - - fn file_system() -> MemoryFS { - MemoryFS::new(&[ - ("/a/b/node_modules/some-module/index.js", ""), - ("/a/node_modules/module/package.json", r#"{"main":"entry.js"}"#), - ("/a/node_modules/module/file.js", r#"{"main":"entry.js"}"#), - ("/modules/other-module/file.js", ""), - ]) - } - - #[test] - fn test() { - let file_system = file_system(); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - extensions: vec![".json".into(), ".js".into()], - modules: vec!["/modules".into(), "node_modules".into()], - ..ResolveOptions::default() - }, - ); - - let data = [ - ( - "middle module request", - "/a/b/c", - "module/file", - "/a/node_modules/module/file.js", - // These dependencies are different from enhanced-resolve due to different code path to - // querying the file system - vec![ - // 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", - // "/", - ], - vec![ - // missing package.jsons - // "/a/b/c/package.json", - "/a/b/package.json", - "/a/package.json", - "/package.json", - // missing modules directories - "/a/b/c", - // "/a/b/c/node_modules", - // missing single file modules - "/modules/module", - "/a/b/node_modules/module", - // missing files with alternative extensions - "/a/node_modules/module/file", - "/a/node_modules/module/file.json", - ], - ), - ( - "fast found module", - "/a/b/c", - "other-module/file.js", - "/modules/other-module/file.js", - // These dependencies are different from enhanced-resolve due to different code path to - // querying the file system - vec![ - // symlink checks - "/modules/other-module/file.js", - // "/modules/other-module", - // "/modules", - // "/", - ], - vec![ - // missing package.jsons - // "/a/b/c/package.json", - "/a/b/c", - "/a/b/package.json", - "/a/package.json", - "/package.json", - "/modules/other-module/package.json", - "/modules/package.json", - ], - ), - ]; - - for (name, context, request, result, file_dependencies, missing_dependencies) in data { - let mut ctx = ResolveContext::default(); - let path = PathBuf::from(context); - let resolved = - resolver.resolve_with_context(path, request, &mut ctx).map(|r| r.full_path()); - assert_eq!(resolved, Ok(PathBuf::from(result))); - let file_dependencies = - FxHashSet::from_iter(file_dependencies.iter().map(PathBuf::from)); - let missing_dependencies = - FxHashSet::from_iter(missing_dependencies.iter().map(PathBuf::from)); - assert_eq!(ctx.file_dependencies, file_dependencies, "{name}"); - assert_eq!(ctx.missing_dependencies, missing_dependencies, "{name}"); - } - } -} diff --git a/src/tests/exports_field.rs b/src/tests/exports_field.rs deleted file mode 100644 index fd68c1f7..00000000 --- a/src/tests/exports_field.rs +++ /dev/null @@ -1,2546 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/exportsField.test.js -//! -//! The huge exports field test cases are at the bottom of this file. - -use crate::{Ctx, PathUtil, ResolveError, ResolveOptions, Resolver}; -use serde_json::json; -use std::path::Path; - -#[test] -fn test_simple() { - let f = super::fixture().join("exports-field"); - let f2 = super::fixture().join("exports-field2"); - let f4 = super::fixture().join("exports-field-error"); - let f5 = super::fixture().join("imports-exports-wildcard"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - fully_specified: true, - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("resolve root using exports field, not a main field", f.clone(), "exports-field", f.join("node_modules/exports-field/x.js")), - ("resolver should respect condition names", f.clone(), "exports-field/dist/main.js", f.join("node_modules/exports-field/lib/lib2/main.js")), - // enhanced_resolve behaves differently to node.js. enhanced_resolve fallbacks when an - // array item is unresolved, where as node.js fallbacks when an array has an - // InvalidPackageTarget error. - // ("resolver should respect fallback", f2.clone(), "exports-field/dist/browser.js", f2.join("node_modules/exports-field/lib/browser.js")), - // The following two tests require fallback from array values, the path is changed here to - // only test query and fragment. - ("resolver should respect query parameters #1", f2.clone(), "exports-field/dist/main.js?foo", f2.join("node_modules/exports-field/lib/lib2/main.js?foo")), - ("resolver should respect fragment parameters #1", f2.clone(), "exports-field/dist/main.js#foo", f2.join("node_modules/exports-field/lib/lib2/main.js#foo")), - ("relative path should work, if relative path as request is used", f.clone(), "./node_modules/exports-field/lib/main.js", f.join("node_modules/exports-field/lib/main.js")), - ("self-resolving root", f.clone(), "@exports-field/core", f.join("a.js")), - ("should resolve with wildcard pattern #1", f5.clone(), "m/features/f.js", f5.join("node_modules/m/src/features/f.js")), - ("should resolve with wildcard pattern #2", f5.clone(), "m/features/y/y.js", f5.join("node_modules/m/src/features/y/y.js")), - ("should resolve with wildcard pattern #3", f5.clone(), "m/features-no-ext/y/y.js", f5.join("node_modules/m/src/features/y/y.js")), - ("should resolve with wildcard pattern #4", f5.clone(), "m/middle/nested/f.js", f5.join("node_modules/m/src/middle/nested/f.js")), - ("should resolve with wildcard pattern #5", f5.clone(), "m/middle-1/nested/f.js", f5.join("node_modules/m/src/middle-1/nested/f.js")), - ("should resolve with wildcard pattern #6", f5.clone(), "m/middle-2/nested/f.js", f5.join("node_modules/m/src/middle-2/nested/f.js")), - ("should resolve with wildcard pattern #7", f5.clone(), "m/middle-3/nested/f", f5.join("node_modules/m/src/middle-3/nested/f/nested/f.js")), - ("should resolve with wildcard pattern #8", f5.clone(), "m/middle-4/f/nested", f5.join("node_modules/m/src/middle-4/f/f.js")), - ("should resolve with wildcard pattern #9", f5.clone(), "m/middle-5/f$/$", f5.join("node_modules/m/src/middle-5/f$/$.js")), - ]; - - // Not needed or snapshot: - // * should log the correct info - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } - - let p = f.join("node_modules/exports-field/package.json"); - let p2 = f2.join("node_modules/exports-field/package.json"); - let p4 = f4.join("node_modules/exports-field/package.json"); - let p5 = f5.join("node_modules/m/package.json"); - - #[rustfmt::skip] - let fail = [ - // ("throw error if extension not provided", f2.clone(), "exports-field/dist/main", ResolveError::NotFound(f2.join("node_modules/exports-field/lib/lib2/main"))), - ("resolver should respect query parameters #2. Direct matching", f2.clone(), "exports-field?foo", ResolveError::PackagePathNotExported("./?foo".into(), p2.clone())), - ("resolver should respect fragment parameters #2. Direct matching", f2, "exports-field#foo", ResolveError::PackagePathNotExported("./#foo".into(), p2)), - ("relative path should not work with exports field", f.clone(), "./node_modules/exports-field/dist/main.js", ResolveError::NotFound("./node_modules/exports-field/dist/main.js".into())), - ("backtracking should not work for request", f.clone(), "exports-field/dist/../../../a.js", ResolveError::InvalidPackageTarget("./lib/../../../a.js".to_string(), "./dist/".to_string(), p.clone())), - ("backtracking should not work for exports field target", f.clone(), "exports-field/dist/a.js", ResolveError::InvalidPackageTarget("./../../a.js".to_string(), "./dist/a.js".to_string(), p.clone())), - ("not exported error", f.clone(), "exports-field/anything/else", ResolveError::PackagePathNotExported("./anything/else".to_string(), p.clone())), - ("request ending with slash #1", f.clone(), "exports-field/", ResolveError::PackagePathNotExported("./".to_string(), p.clone())), - ("request ending with slash #2", f.clone(), "exports-field/dist/", ResolveError::PackagePathNotExported("./dist/".to_string(), p.clone())), - ("request ending with slash #3", f.clone(), "exports-field/lib/", ResolveError::PackagePathNotExported("./lib/".to_string(), p)), - ("should throw error if target is invalid", f4, "exports-field", ResolveError::InvalidPackageTarget("./a/../b/../../pack1/index.js".to_string(), ".".to_string(), p4)), - ("throw error if exports field is invalid", f.clone(), "invalid-exports-field", ResolveError::InvalidPackageConfig(f.join("node_modules/invalid-exports-field/package.json"))), - ("should throw error if target is 'null'", f5, "m/features/internal/file.js", ResolveError::PackagePathNotExported("./features/internal/file.js".to_string(), p5)), - ]; - - for (comment, path, request, error) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!(resolution, Err(error), "{comment} {path:?} {request}"); - } -} - -// resolve using exports field, not a browser field #1 -#[test] -fn exports_not_browser_field1() { - let f = super::fixture().join("exports-field"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - condition_names: vec!["webpack".into()], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "exports-field/dist/main.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("node_modules/exports-field/lib/lib2/main.js"))); -} - -// resolve using exports field and a browser alias field #2 -#[test] -fn exports_not_browser_field2() { - let f2 = super::fixture().join("exports-field2"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - extensions: vec![".js".into()], - condition_names: vec!["node".into()], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f2, "exports-field/dist/main.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f2.join("node_modules/exports-field/lib/browser.js"))); -} - -// should resolve extension without fullySpecified -#[test] -fn extension_without_fully_specified() { - let f2 = super::fixture().join("exports-field2"); - - let commonjs_resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - let resolved_path = - commonjs_resolver.resolve(&f2, "exports-field/dist/main").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f2.join("node_modules/exports-field/lib/lib2/main.js"))); -} - -#[test] -fn field_name_path() { - let f2 = super::fixture().join("exports-field2"); - let f3 = super::fixture().join("exports-field3"); - - // field name path #1 #2 #3 - let exports_fields = [ - vec![vec!["exportsField".into(), "exports".into()]], - vec![vec!["exportsField".into(), "exports".into()], vec!["exports".into()]], - vec![vec!["exports".into()], vec!["exportsField".into(), "exports".into()]], - ]; - - for exports_fields in exports_fields { - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - exports_fields, - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/main.js"))); - } - - // field name path #4 - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - exports_fields: vec![vec!["exports".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f2, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f2.join("node_modules/exports-field/index.js"))); - - // field name path #5 - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - exports_fields: vec![vec!["ex".into()], vec!["exports_field".into(), "exports".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/index"))); - - // non-compliant export targeting a directory - let resolver = Resolver::new(ResolveOptions { - exports_fields: vec![vec!["broken".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/src/index.js"))); -} - -#[test] -fn shared_resolvers() { - let f3 = super::fixture().join("exports-field3"); - - let resolver1 = Resolver::new(ResolveOptions { - exports_fields: vec![vec!["exportsField".into(), "exports".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver1.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/main.js"))); - - let resolver2 = resolver1.clone_with_options(ResolveOptions { - exports_fields: vec![vec!["ex".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver2.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/index"))); -} - -#[test] -fn extension_alias_1_2() { - let f = super::fixture().join("exports-field-and-extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - extension_alias: vec![(".js".into(), vec![".ts".into(), ".js".into()])], - fully_specified: true, - condition_names: vec!["webpack".into(), "default".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve with the `extensionAlias` option", f.clone(), "@org/pkg/string.js", f.join("node_modules/@org/pkg/dist/string.js")), - ("should resolve with the `extensionAlias` option #2", f.clone(), "pkg/string.js", f.join("node_modules/pkg/dist/string.js")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn extension_alias_3() { - let f = super::fixture().join("exports-field-and-extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - extension_alias: vec![( - ".js".into(), - vec![".foo".into(), ".baz".into(), ".baz".into(), ".ts".into(), ".js".into()], - )], - fully_specified: true, - condition_names: vec!["webpack".into(), "default".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve with the `extensionAlias` option #3", f.clone(), "pkg/string.js", f.join("node_modules/pkg/dist/string.js")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn extension_alias_throw_error() { - let f = super::fixture().join("exports-field-and-extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - extension_alias: vec![(".js".into(), vec![".ts".into()])], - fully_specified: true, - condition_names: vec!["webpack".into(), "default".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let fail = [ - // enhanced-resolve has two test cases that are exactly the same here - // https://github.com/webpack/enhanced-resolve/blob/a998c7d218b7a9ec2461fc4fddd1ad5dd7687485/test/exportsField.test.js#L2976-L3024 - ("should throw error with the `extensionAlias` option", f, "pkg/string.js", ResolveError::ExtensionAlias), - // TODO: The error is PackagePathNotExported in enhanced-resolve - // ("should throw error with the `extensionAlias` option", f.clone(), "pkg/string.js", ResolveError::PackagePathNotExported("node_modules/pkg/dist/string.ts".to_string())), - ]; - - for (comment, path, request, error) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!(resolution, Err(error), "{comment} {path:?} {request}"); - } -} - -// Small script for generating the test cases from enhanced-resolve -// for (c of testCases) { -// console.log("TestCase {") -// console.log(`name: ${JSON.stringify(c.name)},`) -// if (c.expect instanceof Error) { -// console.log(`expect: None,`) -// } else { -// console.log(`expect: Some(vec!${JSON.stringify(c.expect)}),`) -// } -// console.log(`exports_field: exports_field(json!(${JSON.stringify(c.suite[0], null, 2)})),`) -// console.log(`request: "${c.suite[1]}",`) -// console.log(`condition_names: vec!${JSON.stringify(c.suite[2])},`) -// console.log("},") -//} -struct TestCase { - name: &'static str, - expect: Option>, - exports_field: serde_json::Value, - request: &'static str, - condition_names: Vec<&'static str>, -} - -#[allow(clippy::needless_pass_by_value)] -fn exports_field(value: serde_json::Value) -> serde_json::Value { - value -} - -#[test] -fn test_cases() { - let test_cases = [ - TestCase { - name: "sample #1", - expect: Some(vec!["./dist/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/": { - "import": [ - "./dist/", - "./src/" - ], - "webpack": "./wp/" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "sample #1", - expect: Some(vec!["./src/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/": { - "import": [ - "./src/" - ], - "webpack": "./wp/" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - TestCase { - name: "sample #1 (wildcard)", - expect: Some(vec!["./dist/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/*": { - "import": [ - "./dist/*", - "./src/*" - ], - "webpack": "./wp/*" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "sample #1 (wildcard)", - expect: Some(vec!["./src/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/*": { - "import": [ - "./src/*" - ], - "webpack": "./wp/*" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - TestCase { - name: "sample #2", - expect: Some(vec!["./data/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./timezones/": "./data/timezones/" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #2 (wildcard)", - expect: Some(vec!["./data/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./timezones/*": "./data/timezones/*" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #3", - expect: Some(vec!["./data/timezones/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./": "./data/timezones/" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #3 (wildcard)", - expect: Some(vec!["./data/timezones/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./*": "./data/timezones/*.mjs" - })), - request: "./timezones/pdt", - condition_names: vec![], - }, - TestCase { - name: "sample #4", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./lib/": { - "browser": [ - "./browser/" - ] - }, - "./dist/index.js": { - "node": "./index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #4 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "node": "./index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #5", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/": { - "browser": [ - "./browser/" - ] - }, - "./dist/index.js": { - "node": "./index.js", - "default": "./browser/index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #5 (wildcard)", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "node": "./index.js", - "default": "./browser/index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./dist/a": "./dist/index.js" - })), - request: "./dist/aaa", - condition_names: vec![], - }, - TestCase { - name: "sample #7", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./dist/a/a/": "./dist/index.js" - })), - request: "./dist/a/a", - condition_names: vec![], - }, - TestCase { - name: "sample #7 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./dist/a/a/*": "./dist/index.js" - })), - request: "./dist/a/a", - condition_names: vec![], - }, - TestCase { - name: "sample #8", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": "./index.js" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #9", - expect: Some(vec!["./main.js"]), - exports_field: exports_field(json!({ - "./index.js": "./main.js" - })), - request: "./index.js", - condition_names: vec![], - }, - TestCase { - name: "sample #10", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #11", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./bar#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #12", - expect: Some(vec!["./ok.js#abc"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/ok.js#abc", - condition_names: vec![], - }, - TestCase { - name: "sample #12", - expect: Some(vec!["./ok.js#abc"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/ok.js#abc", - condition_names: vec![], - }, - TestCase { - name: "sample #13", - expect: Some(vec!["./ok.js?abc"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/ok.js?abc", - condition_names: vec![], - }, - TestCase { - name: "sample #14", - expect: Some(vec!["./🎉.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/🎉.js", - condition_names: vec![], - }, - TestCase { - name: "sample #15", - expect: Some(vec!["./%F0%9F%8E%89.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/%F0%9F%8E%89.js", - condition_names: vec![], - }, - TestCase { - name: "sample #16", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./🎉", - condition_names: vec![], - }, - TestCase { - name: "sample #17", - expect: Some(vec!["./other.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./%F0%9F%8E%89", - condition_names: vec![], - }, - TestCase { - name: "sample #18", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./module", - condition_names: vec![], - }, - TestCase { - name: "sample #19", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./module#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #20", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./module?foo", - condition_names: vec![], - }, - TestCase { - name: "sample #21", - expect: Some(vec!["./zizizi"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./z*z*z*" - })), - request: "./#zippi", - condition_names: vec![], - }, - TestCase { - name: "sample #22", - expect: Some(vec!["./d?e?f"]), - exports_field: exports_field(json!({ - "./a?b?c/": "./" - })), - request: "./a?b?c/d?e?f", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #1", - expect: Some(vec!["./dist/index.js"]), - exports_field: exports_field(json!({ - ".": "./dist/index.js" - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #2", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./": "./", - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #3", - expect: Some(vec!["./dist/a.js"]), - exports_field: exports_field(json!({ - "./dist/": "./dist/", - "./dist/*": "./dist/*", - "./dist*": "./dist*", - "./dist/index.js": "./dist/a.js" - })), - request: "./dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #4", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./": { - "browser": [ - "./browser/" - ] - }, - "./*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "browser": "./index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #5", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./": { - "browser": [ - "./browser/" - ] - }, - "./*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "node": "./node.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #6", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - ".": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #7", - expect: Some(vec!["./src/index.js"]), // `enhanced_resolve` is `None` - exports_field: exports_field(json!({ - ".": { - "default": "./src/index.js", - "browser": "./index.js", - "node": "./src/node/index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #8", - expect: Some(vec!["./src/index.js"]), - exports_field: exports_field(json!({ - ".": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #9", - expect: Some(vec!["./index"]), - exports_field: exports_field(json!({ - ".": "./index" - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #10", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./index": "./index.js" - })), - request: "./index", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #11", - expect: Some(vec!["./foo.js"]), - exports_field: exports_field(json!({ - "./": "./", - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #12", - expect: Some(vec!["./foo/bar/baz.js"]), - exports_field: exports_field(json!({ - "./": "./", - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo/bar/baz.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #13", - expect: Some(vec!["./foo/bar/baz.js"]), - exports_field: exports_field(json!({ - "./": "./", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo/bar/baz.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #14", - expect: Some(vec!["./foo/bar/baz.js"]), - exports_field: exports_field(json!({ - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo/bar/baz.js", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #1", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "require": "./require.js" - }, { - "import": "./import.mjs" - }] - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #2", - expect: Some(vec!["./import.mjs"]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "require": "./require.js" - }, { - "import": "./import.mjs" - }] - })), - request: ".", - condition_names: vec!["import"], - }, - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./require.js"]), - exports_field: exports_field(json!({ - ".": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./import.mjs"]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "import": "./import.mjs" - }] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./require.js"]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "require": [ - "./require.js" - ] - }, { - "import": [ - "./import.mjs", - "./import.js" - ] - }] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./import.mjs"]), - exports_field: exports_field(json!({ - ".": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "./import.mjs", - "./import.js" - ] - } - ] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./import.js"]), - exports_field: exports_field(json!({ - ".": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "./import.js" - ] - } - ] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "mapping to a folder root #1", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./timezones": "./data/timezones/" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #2", - expect: None, - exports_field: exports_field(json!({ - "./timezones/": "./data/timezones" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #3", - expect: Some(vec!["./data/timezones/pdt/index.mjs"]), - exports_field: exports_field(json!({ - "./timezones/pdt/": "./data/timezones/pdt/" - })), - request: "./timezones/pdt/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #3 (wildcard)", - expect: Some(vec!["./data/timezones/pdt/index.mjs"]), - exports_field: exports_field(json!({ - "./timezones/pdt/*": "./data/timezones/pdt/*" - })), - request: "./timezones/pdt/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #4", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./": "./timezones/" - })), - request: "./pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #4 (wildcard)", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./*": "./timezones/*" - })), - request: "./pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #5", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./": "./" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #5 (wildcard)", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./*": "./*" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #6", - expect: None, - exports_field: exports_field(json!({ - "./": "." - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #6 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "./*": "." - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #7", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": "./" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #7 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": "./*" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #1", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./": "./", - "./dist/": "./lib/" - })), - request: "./dist/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #1 (wildcard)", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./*": "./*", - "./dist/*": "./lib/*" - })), - request: "./dist/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #2", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/": "./dist/utils/", - "./dist/": "./lib/" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #2 (wildcard)", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/*": "./dist/utils/*", - "./dist/*": "./lib/*" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #3", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/index.js": "./dist/utils/index.js", - "./dist/utils/": "./dist/utils/index.mjs", - "./dist/": "./lib/" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #3 (wildcard)", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/index.js": "./dist/utils/index.js", - "./dist/utils/*": "./dist/utils/index.mjs", - "./dist/*": "./lib/*" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #4", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./": { - "browser": "./browser/" - }, - "./dist/": "./lib/" - })), - request: "./dist/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "the longest matching path prefix is prioritized #4 (wildcard)", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./*": { - "browser": "./browser/*" - }, - "./dist/*": "./lib/*" - })), - request: "./dist/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #1", - // `lodash/` does not start with './' so fallbacks to util - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "conditional mapping folder #1", - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": [ - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #1 (wildcard)", - // `lodash/` does not start with './' so fallbacks to util - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": [ - "lodash/*", - "./utils/*" - ], - "node": [ - "./utils-node/*" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "conditional mapping folder #1 (wildcard)", - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": [ - "./utils/*" - ], - "node": [ - "./utils-node/*" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #2", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./node/" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "conditional mapping folder #2 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "webpack": "./wpk/*", - "browser": [ - "lodash/*", - "./utils/*" - ], - "node": [ - "./node/*" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "conditional mapping folder #3", - expect: Some(vec!["./wpk/index.mjs"]), - exports_field: exports_field(json!({ - "./utils/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils/" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "conditional mapping folder #3 (wildcard)", - expect: Some(vec!["./wpk/index.mjs"]), - exports_field: exports_field(json!({ - "./utils/*": { - "webpack": "./wpk/*", - "browser": [ - "lodash/*", - "./utils/*" - ], - "node": [ - "./utils/*" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "incorrect exports field #1", - expect: None, - exports_field: exports_field(json!({ - "/utils/": "./a/" - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #2", - expect: None, - exports_field: exports_field(json!({ - "./utils/": "/a/" - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #3", - expect: None, - exports_field: exports_field(json!({ - "/utils/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #4", - expect: None, - exports_field: exports_field(json!({ - "./utils/": { - "browser": "/a/", - "default": "/b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #4 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "/a/", - "default": "/b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #5", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index": "./a/index.js" - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index.mjs": "./a/index.js" - })), - request: "./utils/index", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #7", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #8", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index.mjs": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - // Requests that are not `./` does not apply to `package_exports_resolve` - // TestCase { - // name: "incorrect request #1", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": "./a/" - // })), - // request: "/utils/index.mjs", - // condition_names: vec![], - // }, - // TestCase { - // name: "incorrect request #2", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": { - // "browser": "./a/", - // "default": "./b/" - // } - // })), - // request: "/utils/index.mjs", - // condition_names: vec!["browser"], - // }, - // TestCase { - // name: "incorrect request #3", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": { - // "browser": "./a/", - // "default": "./b/" - // } - // })), - // request: "../utils/index.mjs", - // condition_names: vec!["browser"], - // }, - // TestCase { - // name: "incorrect request #4", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": { - // "browser": "./a/", - // "default": "./b/" - // } - // })), - // request: "/utils/index.mjs/", - // condition_names: vec!["browser"], - // }, - TestCase { - name: "backtracking package base #1", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./../../utils/": "./dist/" - })), - request: "./../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #1 (wildcard)", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./../../utils/*": "./dist/*" - })), - request: "./../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #2", - expect: None, - exports_field: exports_field(json!({ - "../../utils/": "./dist/" - })), - request: "../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #2 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "../../utils/*": "./dist/*" - })), - request: "../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #3", - expect: None, - exports_field: exports_field(json!({ - "./utils/": "../src/" - })), - request: "./utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #3 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "./utils/*": "../src/*" - })), - request: "./utils/index", - condition_names: vec![], - }, - // enhanced-resolve does not handle backtracking here - // TestCase { - // name: "backtracking package base #4", - // expect: Some(vec!["./../src/index"]), - // exports_field: exports_field(json!({ - // "./utils/": "./../src/" - // })), - // request: "./utils/index", - // condition_names: vec![], - // }, - // TestCase { - // name: "backtracking package base #4 (wildcard)", - // expect: Some(vec!["./../src/index"]), - // exports_field: exports_field(json!({ - // "./utils/*": "./../src/*" - // })), - // request: "./utils/index", - // condition_names: vec![], - // }, - // TestCase { - // name: "backtracking package base #5", - // expect: Some(vec!["./src/../index.js"]), - // exports_field: exports_field(json!({ - // "./utils/index": "./src/../index.js" - // })), - // request: "./utils/index", - // condition_names: vec![], - // }, - TestCase { - name: "backtracking package base #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/../utils/index": "./src/../index.js" - })), - request: "./utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #7", - expect: None, - exports_field: exports_field(json!({ - "./utils/": { - "browser": "../this/" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #7", - expect: None, - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "../this/*" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #8", - // We throw "InvalidPackageTarget" - // expect: Some(vec!["./utils/../index"]), - expect: None, - exports_field: exports_field(json!({ - "./utils/": { - "browser": "./utils/../" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #8 (wildcard)", - // We throw "InvalidPackageTarget" - // expect: Some(vec!["./utils/../index"]), - expect: None, - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "./utils/../*" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #9", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./": "./src/../../", - "./dist/": "./dist/" - })), - request: "./dist/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #9 (wildcard)", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./*": "./src/../../*", - "./dist/*": "./dist/*" - })), - request: "./dist/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking target folder #1", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../../index"]), - exports_field: exports_field(json!({ - "./utils/": "./dist/" - })), - request: "./utils/timezone/../../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #1 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../../index"]), - exports_field: exports_field(json!({ - "./utils/*": "./dist/*" - })), - request: "./utils/timezone/../../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #2", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../index"]), - exports_field: exports_field(json!({ - "./utils/": "./dist/" - })), - request: "./utils/timezone/../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #2 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../index"]), - exports_field: exports_field(json!({ - "./utils/*": "./dist/*" - })), - request: "./utils/timezone/../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #3", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/target/../../index"]), - exports_field: exports_field(json!({ - "./utils/": "./dist/target/" - })), - request: "./utils/../../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #3 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/target/../../index"]), - exports_field: exports_field(json!({ - "./utils/*": "./dist/target/*" - })), - request: "./utils/../../index", - condition_names: vec![], - }, - // enhanced-resolve does not handle `node_modules` in target - TestCase { - name: "nested node_modules path #1", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": "./node_modules/" - } - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #1 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "./node_modules/*" - } - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #2", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./utils/../node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/": "./utils/../node_modules/" - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "nested node_modules path #2 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./utils/../node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": "./utils/../node_modules/*" - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "nested mapping #1", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": "./", - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested mapping #1 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": "./*", - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "nested mapping #2 (wildcard)", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #2 (wildcard)", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "nested mapping #3", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["webpack"], - }, - TestCase { - name: "nested mapping #3 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["webpack"], - }, - TestCase { - name: "nested mapping #4", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["node", "browser"], - }, - TestCase { - name: "nested mapping #4 (wildcard)", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["node", "browser"], - }, - TestCase { - name: "nested mapping #5", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node"], - }, - TestCase { - name: "nested mapping #5 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": { - "webpack": [ - "./wpck/*" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node"], - }, - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - TestCase { - name: "nested mapping #6 (wildcard)", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": { - "webpack": [ - "./wpck/*" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #6 (wildcard)", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./node/*" - ], - "default": { - "node": { - "webpack": [ - "./wpck/*" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - TestCase { - name: "nested mapping #7", - expect: Some(vec!["./y.js"]), - exports_field: exports_field(json!({ - "./a.js": { - "abc": { - "def": "./x.js" - }, - "ghi": "./y.js" - } - })), - request: "./a.js", - condition_names: vec!["abc", "ghi"], - }, - TestCase { - name: "nested mapping #8", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./a.js": { - "abc": { - "def": "./x.js", - "default": [] - }, - "ghi": "./y.js" - } - })), - request: "./a.js", - condition_names: vec!["abc", "ghi"], - }, - TestCase { - name: "syntax sugar #1", - expect: Some(vec!["./main.js"]), - exports_field: exports_field(json!("./main.js")), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #2", - expect: Some(vec![]), - exports_field: exports_field(json!("./main.js")), - request: "./lib.js", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #3", - expect: Some(vec!["./a.js"]), - exports_field: exports_field(json!(["./a.js", "./b.js"])), - request: ".", - condition_names: vec![], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "syntax sugar #3", - expect: Some(vec!["./b.js"]), - exports_field: exports_field(json!(["./b.js"])), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #4", - expect: Some(vec![]), - exports_field: exports_field(json!(["./a.js", "./b.js"])), - request: "./lib.js", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #5", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "browser": { - "default": "./index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "syntax sugar #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "browser": { - "default": "./index.js" - } - })), - request: "./lib.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "syntax sugar #7", - expect: None, - exports_field: exports_field(json!({ - "./node": "./node.js", - "browser": { - "default": "./index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "syntax sugar #8", - expect: None, - exports_field: exports_field(json!({ - "browser": { - "default": "./index.js" - }, - "./node": "./node.js" - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #1", - expect: Some(vec!["./abc/d"]), - exports_field: exports_field(json!({ - "./ab*": "./ab/*", - "./abc*": "./abc/*", - "./a*": "./a/*" - })), - request: "./abcd", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #2", - expect: Some(vec!["./abc/d/e"]), - exports_field: exports_field(json!({ - "./ab*": "./ab/*", - "./abc*": "./abc/*", - "./a*": "./a/*" - })), - request: "./abcd/e", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #3", - expect: Some(vec!["./abc/d"]), - exports_field: exports_field(json!({ - "./x/ab*": "./ab/*", - "./x/abc*": "./abc/*", - "./x/a*": "./a/*" - })), - request: "./x/abcd", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #4", - expect: Some(vec!["./abc/d/e"]), - exports_field: exports_field(json!({ - "./x/ab*": "./ab/*", - "./x/abc*": "./abc/*", - "./x/a*": "./a/*" - })), - request: "./x/abcd/e", - condition_names: vec!["browser"], - }, - TestCase { - name: "path tree edge case #1", - expect: Some(vec!["./A/b/d.js"]), - exports_field: exports_field(json!({ - "./a/": "./A/", - "./a/b/c": "./c.js" - })), - request: "./a/b/d.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #1 (wildcard)", - expect: Some(vec!["./A/b/d.js"]), - exports_field: exports_field(json!({ - "./a/*": "./A/*", - "./a/b/c": "./c.js" - })), - request: "./a/b/d.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #2", - expect: Some(vec!["./A/c.js"]), - exports_field: exports_field(json!({ - "./a/": "./A/", - "./a/b": "./b.js" - })), - request: "./a/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #2 (wildcard)", - expect: Some(vec!["./A/c.js"]), - exports_field: exports_field(json!({ - "./a/*": "./A/*", - "./a/b": "./b.js" - })), - request: "./a/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #3", - expect: Some(vec!["./A/b/d/c.js"]), - exports_field: exports_field(json!({ - "./a/": "./A/", - "./a/b/c/d": "./c.js" - })), - request: "./a/b/d/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #3 (wildcard)", - expect: Some(vec!["./A/b/d/c.js"]), - exports_field: exports_field(json!({ - "./a/*": "./A/*", - "./a/b/c/d": "./c.js" - })), - request: "./a/b/d/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #1", - expect: Some(vec!["./A/b.js"]), - exports_field: exports_field(json!({ - "./a/*.js": "./A/*.js" - })), - request: "./a/b.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #2", - expect: Some(vec!["./A/b/c.js"]), - exports_field: exports_field(json!({ - "./a/*.js": "./A/*.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #3", - expect: Some(vec!["./A/b/c.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": "./A/*/c.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #4", - expect: Some(vec!["./A/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": "./A/*/*.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #5", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/*.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #5", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/*.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./lib/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #6", - expect: Some(vec!["./browser/foo/bar.js"]), - exports_field: exports_field(json!({ - "./lib/*/bar.js": { - "browser": [ - "./browser/*/bar.js" - ] - }, - "./dist/*/bar.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./lib/foo/bar.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #6", - expect: Some(vec!["./browser/foo.js"]), - exports_field: exports_field(json!({ - "./lib/*/bar.js": { - "browser": [ - "./browser/*/bar.js" - ] - }, - "./dist/*/bar.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./dist/foo/bar.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #7", - expect: Some(vec!["./browser/foo/default.js"]), - exports_field: exports_field(json!({ - "./lib/*/bar.js": { - "browser": [ - "./browser/*/bar.js" - ] - }, - "./dist/*/bar.js": { - "node": "./*.js", - "default": "./browser/*/default.js" - } - })), - request: "./dist/foo/bar.js", - condition_names: vec!["default"], - }, - TestCase { - name: "wildcard pattern #8", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": "./A/*/*/*.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #9", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": [ - "./A/*/*/*.js", - "./B/*/*/*.js" - ] - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "wildcard pattern #9", - expect: Some(vec!["./B/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": [ - "./B/*/*/*.js" - ] - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #10", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/foo-*/c.js": "./A/*/*/*.js" - })), - request: "./a/foo-b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #11", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*-foo/c.js": "./A/*/*/*.js" - })), - request: "./a/b-foo/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #12", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/foo-*-foo/c.js": "./A/*/*/*.js" - })), - request: "./a/foo-b-foo/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #13", - expect: Some(vec!["./A/b/c/d.js"]), - exports_field: exports_field(json!({ - "./a/foo-*-foo/c.js": "./A/b/c/d.js" - })), - request: "./a/foo-b-foo/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #14", - expect: Some(vec!["./A/b/c/*.js"]), - exports_field: exports_field(json!({ - "./a/foo-foo/c.js": "./A/b/c/*.js" - })), - request: "./a/foo-foo/c.js", - condition_names: vec![], - }, - ]; - - for case in test_cases { - let resolved = Resolver::new(ResolveOptions { - condition_names: case - .condition_names - .iter() - .map(ToString::to_string) - .collect::>(), - ..ResolveOptions::default() - }) - .package_exports_resolve( - Path::new(""), - case.request, - &case.exports_field, - &mut Ctx::default(), - ) - .map(|p| p.map(|p| p.to_path_buf())); - if let Some(expect) = case.expect { - if expect.is_empty() { - assert!( - matches!(resolved, Err(ResolveError::PackagePathNotExported(_, _))), - "{} {:?}", - &case.name, - &resolved - ); - } else { - for expect in expect { - assert_eq!(resolved, Ok(Some(Path::new(expect).normalize())), "{}", &case.name); - } - } - } else { - assert!(resolved.is_err(), "{} {resolved:?}", &case.name); - } - } -} diff --git a/src/tests/extension_alias.rs b/src/tests/extension_alias.rs deleted file mode 100644 index 86afab73..00000000 --- a/src/tests/extension_alias.rs +++ /dev/null @@ -1,66 +0,0 @@ -//! - -use crate::{ResolveError, ResolveOptions, Resolver}; - -#[test] -fn extension_alias() { - let f = super::fixture().join("extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - extension_alias: vec![ - (".js".into(), vec![".ts".into(), ".js".into()]), - (".mjs".into(), vec![".mts".into()]), - ], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should alias fully specified file", f.clone(), "./index.js", f.join("index.ts")), - ("should alias fully specified file when there are two alternatives", f.clone(), "./dir/index.js", f.join("dir/index.ts")), - ("should also allow the second alternative", f.clone(), "./dir2/index.js", f.join("dir2/index.js")), - ("should support alias option without an array", f.clone(), "./dir2/index.mjs", f.join("dir2/index.mts")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } - - #[rustfmt::skip] - let fail = [ - ("should not allow to fallback to the original extension or add extensions", f, "./index.mjs"), - ]; - - for (comment, path, request) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!(resolution, Err(ResolveError::ExtensionAlias), "{comment} {path:?} {request}"); - } -} - -// should not apply extension alias to extensions or mainFiles field -#[test] -fn not_apply_to_extension_nor_main_files() { - let f = super::fixture().join("extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - extension_alias: vec![(".js".into(), vec![])], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("directory", f.clone(), "./dir2", "dir2/index.js"), - ("file", f.clone(), "./dir2/index", "dir2/index.js"), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - let expected = f.join(expected); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} diff --git a/src/tests/extensions.rs b/src/tests/extensions.rs deleted file mode 100644 index 1ebd86f4..00000000 --- a/src/tests/extensions.rs +++ /dev/null @@ -1,125 +0,0 @@ -//! - -use crate::{EnforceExtension, Resolution, ResolveContext, ResolveError, ResolveOptions, Resolver}; -use rustc_hash::FxHashSet; - -#[test] -fn extensions() { - let f = super::fixture().join("extensions"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".ts".into(), ".js".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve according to order of provided extensions", "./foo", "foo.ts"), - ("should resolve according to order of provided extensions (dir index)", "./dir", "dir/index.ts"), - ("should resolve according to main field in module root", ".", "index.js"), - // This is a core module - // ("should resolve single file module before directory", "module", "node_modules/module.js"), - ("should resolve trailing slash directory before single file", "module/", "node_modules/module/index.ts"), - ]; - - for (comment, request, expected_path) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - let expected = f.join(expected_path); - assert_eq!(resolved_path, Ok(expected), "{comment} {request} {expected_path}"); - } - - #[rustfmt::skip] - let fail = [ - ("not resolve to file when request has a trailing slash (relative)", "./foo.js/", "./foo.js/".into()) - ]; - - for (comment, request, expected_error) in fail { - let resolution = resolver.resolve(&f, request); - let error = ResolveError::NotFound(expected_error); - assert_eq!(resolution, Err(error), "{comment} {request} {resolution:?}"); - } -} - -// should default enforceExtension to true when extensions includes an empty string -#[test] -fn default_enforce_extension() { - let f = super::fixture().join("extensions"); - - let mut ctx = ResolveContext::default(); - let resolved = Resolver::new(ResolveOptions { - extensions: vec![".ts".into(), String::new(), ".js".into()], - ..ResolveOptions::default() - }) - .resolve_with_context(&f, "./foo", &mut ctx); - - assert_eq!(resolved.map(Resolution::into_path_buf), Ok(f.join("foo.ts"))); - assert_eq!( - ctx.file_dependencies, - FxHashSet::from_iter([f.join("foo.ts"), f.join("package.json")]) - ); - assert!(ctx.missing_dependencies.is_empty()); -} - -// should respect enforceExtension when extensions includes an empty string -#[test] -fn respect_enforce_extension() { - let f = super::fixture().join("extensions"); - - let mut ctx = ResolveContext::default(); - let resolved = Resolver::new(ResolveOptions { - enforce_extension: EnforceExtension::Disabled, - extensions: vec![".ts".into(), String::new(), ".js".into()], - ..ResolveOptions::default() - }) - .resolve_with_context(&f, "./foo", &mut ctx); - - assert_eq!(resolved.map(Resolution::into_path_buf), Ok(f.join("foo.ts"))); - assert_eq!( - ctx.file_dependencies, - FxHashSet::from_iter([f.join("foo.ts"), f.join("package.json")]) - ); - assert_eq!(ctx.missing_dependencies, FxHashSet::from_iter([f.join("foo")])); -} - -#[test] -fn multi_dot_extension() { - let f = super::fixture().join("extensions"); - - let resolver = Resolver::new(ResolveOptions { - // Test for `.d.ts`, not part of enhanced-resolve. - extensions: vec![".a.b.c".into(), ".d.ts".into(), ".ts".into(), ".js".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve according to order of provided extensions", "./foo", "foo.ts"), - ("should resolve file with extension", "./app.module", "app.module.js") - ]; - - for (comment, request, expected_path) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - let expected = f.join(expected_path); - assert_eq!(resolved_path, Ok(expected), "{comment} {request} {expected_path}"); - } - - #[rustfmt::skip] - let fail = [ - ("not resolve to file", "./index.", "./index.".into()) - ]; - - for (comment, request, expected_error) in fail { - let resolution = resolver.resolve(&f, request); - let error = ResolveError::NotFound(expected_error); - assert_eq!(resolution, Err(error), "{comment} {request} {resolution:?}"); - } -} - -#[test] -#[should_panic = "All extensions must start with a leading dot"] -fn without_leading_dot() { - Resolver::new(ResolveOptions { - extensions: vec!["ts".into(), "js".into()], - ..ResolveOptions::default() - }); -} diff --git a/src/tests/fallback.rs b/src/tests/fallback.rs deleted file mode 100644 index 3da2d767..00000000 --- a/src/tests/fallback.rs +++ /dev/null @@ -1,100 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/fallback.test.js - -#[test] -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -fn fallback() { - use super::memory_fs::MemoryFS; - use crate::{AliasValue, ResolveError, ResolveOptions, ResolverGeneric}; - use std::path::{Path, PathBuf}; - - let f = Path::new("/"); - - let file_system = MemoryFS::new(&[ - ("/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", ""), - ]); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - fallback: vec![ - ("aliasA".into(), vec![AliasValue::Path("a".into())]), - ("b$".into(), vec![AliasValue::Path("a/index".into())]), - ("c$".into(), vec![AliasValue::Path("/a/index".into())]), - ( - "multiAlias".into(), - vec![ - AliasValue::Path("b".into()), - AliasValue::Path("c".into()), - AliasValue::Path("d".into()), - AliasValue::Path("e".into()), - AliasValue::Path("a".into()), - ], - ), - ("recursive".into(), vec![AliasValue::Path("recursive/dir".into())]), - ("/d/dir".into(), vec![AliasValue::Path("/c/dir".into())]), - ("/d/index.js".into(), vec![AliasValue::Path("/c/index".into())]), - ("ignored".into(), vec![AliasValue::Ignore]), - ("node:path".into(), vec![AliasValue::Ignore]), - ], - modules: vec!["/".into()], - ..ResolveOptions::default() - }, - ); - - #[rustfmt::skip] - let pass = [ - ("should resolve a not aliased module 1", "a", "/a/index"), - ("should resolve a not aliased module 2", "a/index", "/a/index"), - ("should resolve a not aliased module 3", "a/dir", "/a/dir/index"), - ("should resolve a not aliased module 4", "a/dir/index", "/a/dir/index"), - ("should resolve an fallback module 1", "aliasA", "/a/index"), - ("should resolve an fallback module 2", "aliasA/index", "/a/index"), - ("should resolve an fallback module 3", "aliasA/dir", "/a/dir/index"), - ("should resolve an fallback module 4", "aliasA/dir/index", "/a/dir/index"), - ("should resolve a recursive aliased module 1", "recursive", "/recursive/index"), - ("should resolve a recursive aliased module 2", "recursive/index", "/recursive/index"), - ("should resolve a recursive aliased module 3", "recursive/dir", "/recursive/dir/index"), - ("should resolve a recursive aliased module 4", "recursive/dir/index", "/recursive/dir/index"), - ("should resolve a recursive aliased module 5", "recursive/file", "/recursive/dir/file"), - ("should resolve a file aliased module with a query 1", "b?query", "/b/index?query"), - ("should resolve a file aliased module with a query 2", "c?query", "/c/index?query"), - ("should resolve a path in a file aliased module 1", "b/index", "/b/index"), - ("should resolve a path in a file aliased module 2", "b/dir", "/b/dir/index"), - ("should resolve a path in a file aliased module 3", "b/dir/index", "/b/dir/index"), - ("should resolve a path in a file aliased module 4", "c/index", "/c/index"), - ("should resolve a path in a file aliased module 5", "c/dir", "/c/dir/index"), - ("should resolve a path in a file aliased module 6", "c/dir/index", "/c/dir/index"), - ("should resolve a file in multiple aliased dirs 1", "multiAlias/dir/file", "/e/dir/file"), - ("should resolve a file in multiple aliased dirs 2", "multiAlias/anotherDir", "/e/anotherDir/index"), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - - #[rustfmt::skip] - let ignore = [ - ("should resolve an ignore module", "ignored", ResolveError::Ignored(f.join("ignored"))), - ("should resolve node: builtin module", "node:path", ResolveError::Ignored(PathBuf::from("/node:path"))), - ]; - - for (comment, request, expected) in ignore { - let resolution = resolver.resolve(f, request); - assert_eq!(resolution, Err(expected), "{comment} {request}"); - } -} diff --git a/src/tests/full_specified.rs b/src/tests/full_specified.rs deleted file mode 100644 index a70c0191..00000000 --- a/src/tests/full_specified.rs +++ /dev/null @@ -1,113 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/fullSpecified.test.js - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows { - use std::path::PathBuf; - - use crate::{AliasValue, ResolveOptions, ResolverGeneric}; - - use super::super::memory_fs::MemoryFS; - - fn file_system() -> MemoryFS { - MemoryFS::new(&[ - ("/a/node_modules/package1/index.js", ""), - ("/a/node_modules/package1/file.js", ""), - ("/a/node_modules/package2/package.json", r#"{"main":"a"}"#), - ("/a/node_modules/package2/a.js", ""), - ("/a/node_modules/package3/package.json", r#"{"main":"dir"}"#), - ("/a/node_modules/package3/dir/index.js", ""), - ("/a/node_modules/package4/package.json", r#"{"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", ""), - ]) - } - - #[test] - fn test() { - let file_system = file_system(); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - alias: vec![ - ("alias1".into(), vec![AliasValue::from("/a/abc")]), - ("alias2".into(), vec![AliasValue::from("/a")]), - ], - alias_fields: vec![vec!["browser".into()]], - fully_specified: true, - ..ResolveOptions::default() - }, - ); - - let failing_resolves = [ - ("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"), - ]; - - for (comment, request) in failing_resolves { - let resolution = resolver.resolve("/a", request); - assert!(resolution.is_err(), "{comment} {request}"); - } - - let successful_resolves = [ - ("fully relative", "./abc.js", "/a/abc.js"), - ("fully absolute", "/a/abc.js", "/a/abc.js"), - ("fully relative in package", "package1/file.js", "/a/node_modules/package1/file.js"), - ("extensions in mainFiles", "package1", "/a/node_modules/package1/index.js"), - ("extensions in mainFields", "package2", "/a/node_modules/package2/a.js"), - ("extensions in alias", "alias1", "/a/abc.js"), - ("directories in alias", "alias2", "/a/index.js"), - ("directories in packages", "package3", "/a/node_modules/package3/dir/index.js"), - ("extensions in aliasFields", "package4/a.js", "/a/node_modules/package4/b.js"), - ]; - - for (comment, request, expected) in successful_resolves { - let resolution = resolver.resolve("/a", request).map(|r| r.full_path()); - assert_eq!(resolution, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - } - - #[test] - #[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. - fn resolve_to_context() { - let file_system = file_system(); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - alias: vec![ - ("alias1".into(), vec![AliasValue::from("/a/abc")]), - ("alias2".into(), vec![AliasValue::from("/a")]), - ], - alias_fields: vec![vec!["browser".into()]], - fully_specified: true, - resolve_to_context: true, - ..ResolveOptions::default() - }, - ); - - let successful_resolves = [ - ("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", "/a/node_modules/package3/dir"), - ]; - - for (comment, request, expected) in successful_resolves { - let resolution = resolver.resolve("/a", request).map(|r| r.full_path()); - assert_eq!(resolution, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - } -} diff --git a/src/tests/imports_field.rs b/src/tests/imports_field.rs deleted file mode 100644 index c928627a..00000000 --- a/src/tests/imports_field.rs +++ /dev/null @@ -1,1320 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/importsField.test.js -//! -//! The huge imports field test cases are at the bottom of this file. - -use serde_json::json; - -use crate::{Ctx, JSONMap, PathUtil, ResolveError, ResolveOptions, Resolver}; -use std::path::Path; - -#[test] -fn test_simple() { - let f = super::fixture().join("imports-field"); - let f2 = super::fixture().join("imports-exports-wildcard/node_modules/m/"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve using imports field instead of self-referencing", f.clone(), "#imports-field", f.join("b.js")), - ("should resolve using imports field instead of self-referencing for a subpath", f.join("dir"), "#imports-field", f.join("b.js")), - ("should resolve package #1", f.clone(), "#a/dist/main.js", f.join("node_modules/a/lib/lib2/main.js")), - ("should resolve package #3", f.clone(), "#ccc/index.js", f.join("node_modules/c/index.js")), - ("should resolve package #4", f.clone(), "#c", f.join("node_modules/c/index.js")), - ("should resolve with wildcard pattern", f2.clone(), "#internal/i.js", f2.join("src/internal/i.js")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } - - // Note added: - // * should resolve absolute path as an imports field target - // * should log the correct info - - #[rustfmt::skip] - let fail = [ - ("should disallow resolve out of package scope", f.clone(), "#b", ResolveError::InvalidPackageTarget("../b.js".to_string(), "#b".to_string(), f.join("package.json"))), - ("should resolve package #2", f.clone(), "#a", ResolveError::PackageImportNotDefined("#a".to_string(), f.join("package.json"))), - ]; - - for (comment, path, request, error) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!(resolution, Err(error), "{comment} {path:?} {request}"); - } -} - -#[test] -fn shared_resolvers() { - let f = super::fixture().join("imports-field"); - - // field name #1 - let resolver1 = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - imports_fields: vec![vec!["imports".into()]], - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - let resolved_path = resolver1.resolve(&f, "#imports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("b.js"))); - - // field name #2 - let resolver2 = resolver1.clone_with_options(ResolveOptions { - imports_fields: vec![vec!["other".into(), "imports".into()]], - ..ResolveOptions::default() - }); - - let resolved_path = resolver2.resolve(&f, "#b").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("a.js"))); -} - -// Small script for generating the test cases from enhanced_resolve -// for (c of testCases) { -// console.log("TestCase {") -// console.log(`name: ${JSON.stringify(c.name)},`) -// if (c.expect instanceof Error) { -// console.log(`expect: None,`) -// } else { -// console.log(`expect: Some(vec!${JSON.stringify(c.expect)}),`) -// } -// console.log(`imports_field: imports_field(json!(${JSON.stringify(c.suite[0], null, 2)})),`) -// console.log(`request: "${c.suite[1]}",`) -// console.log(`condition_names: vec!${JSON.stringify(c.suite[2])},`) -// console.log("},") -// } - -struct TestCase { - name: &'static str, - expect: Option>, - imports_field: JSONMap, - request: &'static str, - condition_names: Vec<&'static str>, -} - -#[allow(clippy::needless_pass_by_value)] -fn imports_field(value: serde_json::Value) -> JSONMap { - let s = serde_json::to_string(&value).unwrap(); - serde_json::from_str(&s).unwrap() -} - -#[test] -fn test_cases() { - let test_cases = [ - TestCase { - name: "sample #1", - expect: Some(vec!["./dist/test/file.js"]), - imports_field: imports_field(json!({ - "#abc/": { - "import": [ - "./dist/", - "./src/" - ], - "webpack": "./wp/" - }, - "#abc": "./main.js" - })), - request: "#abc/test/file.js", - condition_names: vec!["import", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "sample #1", - expect: Some(vec!["./src/test/file.js"]), - imports_field: imports_field(json!({ - "#abc/": { - "import": [ - "./src/" - ], - "webpack": "./wp/" - }, - "#abc": "./main.js" - })), - request: "#abc/test/file.js", - condition_names: vec!["import", "webpack"], - }, - TestCase { - name: "sample #2", - expect: Some(vec!["./data/timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#1/timezones/": "./data/timezones/" - })), - request: "#1/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #3", - expect: Some(vec!["./data/timezones/timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#aaa/": "./data/timezones/", - "#a/": "./data/timezones/" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #4", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/lib/": { - "browser": [ - "./browser/" - ] - }, - "#a/dist/index.js": { - "node": "./index.js" - } - })), - request: "#a/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #5", - expect: Some(vec!["./browser/index.js"]), - imports_field: imports_field(json!({ - "#a/lib/": { - "browser": [ - "./browser/" - ] - }, - "#a/dist/index.js": { - "node": "./index.js", - "default": "./browser/index.js" - } - })), - request: "#a/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #6", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/dist/a": "./dist/index.js" - })), - request: "#a/dist/aaa", - condition_names: vec![], - }, - TestCase { - name: "sample #7", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/a/a/": "./dist/index.js" - })), - request: "#a/a/a", - condition_names: vec![], - }, - TestCase { - name: "sample #8", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": "./index.js" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #9", - expect: Some(vec!["./main.js"]), - imports_field: imports_field(json!({ - "#a/index.js": "./main.js" - })), - request: "#a/index.js", - condition_names: vec![], - }, - TestCase { - name: "sample #10", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #11", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/bar#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #12", - expect: Some(vec!["./ok.js#abc"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/ok.js#abc", - condition_names: vec![], - }, - TestCase { - name: "sample #13", - expect: Some(vec!["./ok.js?abc"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/ok.js?abc", - condition_names: vec![], - }, - TestCase { - name: "sample #14", - expect: Some(vec!["./🎉.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/🎉.js", - condition_names: vec![], - }, - TestCase { - name: "sample #15", - expect: Some(vec!["./%F0%9F%8E%89.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/%F0%9F%8E%89.js", - condition_names: vec![], - }, - TestCase { - name: "sample #16", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/🎉", - condition_names: vec![], - }, - TestCase { - name: "sample #17", - expect: Some(vec!["./other.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/%F0%9F%8E%89", - condition_names: vec![], - }, - TestCase { - name: "sample #18", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/module", - condition_names: vec![], - }, - TestCase { - name: "sample #19", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/module#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #20", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/module?foo", - condition_names: vec![], - }, - TestCase { - name: "sample #21", - expect: Some(vec!["./d?e?f"]), - imports_field: imports_field(json!({ - "#a/a?b?c/": "./" - })), - request: "#a/a?b?c/d?e?f", - condition_names: vec![], - }, - TestCase { - name: "sample #22", - // We throw InvalidPackageTarget - expect: None, - // expect: Some(vec!["/user/a/index"]), - imports_field: imports_field(json!({ - "#a/": "/user/a/" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #1", - expect: Some(vec!["./A/b/d.js"]), - imports_field: imports_field(json!({ - "#a/": "./A/", - "#a/b/c": "./c.js" - })), - request: "#a/b/d.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #2", - expect: Some(vec!["./A/c.js"]), - imports_field: imports_field(json!({ - "#a/": "./A/", - "#a/b": "./b.js" - })), - request: "#a/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #3", - expect: Some(vec!["./A/b/c/d.js"]), - imports_field: imports_field(json!({ - "#a/": "./A/", - "#a/b/c/d": "./c.js" - })), - request: "#a/b/c/d.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #1", - expect: Some(vec!["./dist/index.js"]), - imports_field: imports_field(json!({ - "#a": "./dist/index.js" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #2", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": "./" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #3", - expect: Some(vec!["./dist/a.js"]), - imports_field: imports_field(json!({ - "#a/": "./dist/", - "#a/index.js": "./dist/a.js" - })), - request: "#a/index.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #4", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "./browser/" - ] - }, - "#a/index.js": { - "browser": "./index.js" - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #5", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "./browser/" - ] - }, - "#a/index.js": { - "node": "./node.js" - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #6", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: "#a", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #7", - expect: Some(vec!["./src/index.js"]), // `enhanced_resolve` is `None` - imports_field: imports_field(json!({ - "#a": { - "default": "./src/index.js", - "browser": "./index.js", - "node": "./src/node/index.js" - } - })), - request: "#a", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #8", - expect: Some(vec!["./src/index.js"]), - imports_field: imports_field(json!({ - "#a": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #9", - expect: Some(vec!["./index"]), - imports_field: imports_field(json!({ - "#a": "./index" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #10", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/index": "./index.js" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #11", - // We throw InvalidPackageTarget - // expect: Some(vec!["b"]), - expect: None, - imports_field: imports_field(json!({ - "#a": "b" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #12", - // We throw InvalidPackageTarget - // expect: Some(vec!["b/index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "b/" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #13", - // We throw InvalidPackageTarget - // expect: Some(vec!["b#anotherhashishere"]), - expect: None, - imports_field: imports_field(json!({ - "#a?q=a#hashishere": "b#anotherhashishere" - })), - request: "#a?q=a#hashishere", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #1", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #2", - expect: Some(vec!["./import.mjs"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec!["import"], - }, - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./require.js"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./import.mjs"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./require.js"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": [ - "./require.js" - ] - }, - { - "import": [ - "./import.mjs", - "#b/import.js" - ] - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./import.mjs"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "./import.mjs", - "#b/import.js" - ] - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "#b/import.js" - ] - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "mapping to a folder root #1", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#timezones": "./data/timezones/" - })), - request: "#timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #2", - expect: None, - imports_field: imports_field(json!({ - "#timezones/": "./data/timezones" - })), - request: "#timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #3", - expect: Some(vec!["./data/timezones/pdt/index.mjs"]), - imports_field: imports_field(json!({ - "#timezones/pdt/": "./data/timezones/pdt/" - })), - request: "#timezones/pdt/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #4", - expect: Some(vec!["./timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#a/": "./timezones/" - })), - request: "#a/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #5", - expect: Some(vec!["./timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#a/": "./" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #6", - expect: None, - imports_field: imports_field(json!({ - "#a/": "." - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #7", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": "./" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #1", - expect: Some(vec!["./lib/index.mjs"]), - imports_field: imports_field(json!({ - "#a/": "./", - "#a/dist/": "./lib/" - })), - request: "#a/dist/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #2", - expect: Some(vec!["./dist/utils/index.js"]), - imports_field: imports_field(json!({ - "#a/dist/utils/": "./dist/utils/", - "#a/dist/": "./lib/" - })), - request: "#a/dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #3", - expect: Some(vec!["./dist/utils/index.js"]), - imports_field: imports_field(json!({ - "#a/dist/utils/index.js": "./dist/utils/index.js", - "#a/dist/utils/": "./dist/utils/index.mjs", - "#a/dist/": "./lib/" - })), - request: "#a/dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #4", - expect: Some(vec!["./lib/index.mjs"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./browser/" - }, - "#a/dist/": "./lib/" - })), - request: "#a/dist/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #1", - // This behaves differently from enhanced_resolve, because `lodash/` is an an InvalidPackageConfig - // expect: Some(vec!["lodash/index.js"]), - expect: Some(vec!["./utils/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "conditional mapping folder #1", - expect: Some(vec!["./utils/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #2", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./node/" - ] - } - })), - request: "#a/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "conditional mapping folder #3", - expect: Some(vec!["./wpk/index.mjs"]), - imports_field: imports_field(json!({ - "#a/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils/" - ] - } - })), - request: "#a/index.mjs", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "incorrect exports field #1", - // We throw `PackageImportNotDefined` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "/utils/": "./a/" - })), - request: "#a/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #2", - // We throw `PackageImportNotDefined` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "/utils/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#a/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #3", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index": "./a/index.js" - })), - request: "#a/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #4", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index.mjs": "./a/index.js" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #5", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "#a/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #6", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index.mjs": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "#a/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #1", - // We don't throw in `package_imports_exports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": "./a/" - })), - request: "/utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect request #2", - // We don't throw in `package_imports_exports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #3", - // We don't throw in `package_imports_exports_resolve`, it's thrown in `package_imports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #4", - // We don't throw in `package_imports_exports_resolve`, it's thrown in `package_imports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#/", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #5", - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#a/", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #1", - // expect: Some(vec!["./dist/index"]), - expect: Some(vec!["dist/index"]), - imports_field: imports_field(json!({ - "#a/../../utils/": "./dist/" - })), - request: "#a/../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #2", - // We throw InvalidPackageTarget - // expect: Some(vec!["./dist/../../utils/index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "./dist/" - })), - request: "#a/../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #3", - // We throw InvalidPackageTarget - // expect: Some(vec!["../src/index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "../src/" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #4", - // We throw InvalidPackageTarget - // expect: Some(vec!["./utils/../../../index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": { - "browser": "./utils/../../../" - } - })), - request: "#a/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #1", - // expect: Some(vec!["moment/node_modules/lodash/dist/index.js"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": { - "browser": "moment/node_modules/" - } - })), - request: "#a/lodash/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #2", - // We throw InvalidPackageTarget - // expect: Some(vec!["../node_modules/lodash/dist/index.js"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "../node_modules/" - })), - request: "#a/lodash/dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "nested mapping #1", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": "./", - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./node/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "nested mapping #3", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["webpack"], - }, - TestCase { - name: "nested mapping #4", - // We throw NotFound - // expect: Some(vec!["moment/node/index.js"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "moment/node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["node", "browser"], - }, - TestCase { - name: "nested mapping #5", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "node"], - }, - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./node/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - TestCase { - name: "nested mapping #7", - expect: Some(vec!["./y.js"]), - imports_field: imports_field(json!({ - "#a": { - "abc": { - "def": "./x.js" - }, - "ghi": "./y.js" - } - })), - request: "#a", - condition_names: vec!["abc", "ghi"], - }, - TestCase { - name: "nested mapping #8", - // We throw PackageImportNotDefined - // expect: Some(vec![]), - expect: None, - imports_field: imports_field(json!({ - "#a": { - "abc": { - "def": "./x.js", - "default": [] - }, - "ghi": "./y.js" - } - })), - request: "#a", - condition_names: vec!["abc", "ghi"], - }, - ]; - - for case in test_cases { - let resolved = Resolver::default() - .package_imports_exports_resolve( - case.request, - &case.imports_field, - Path::new(""), - true, - &case.condition_names.iter().map(ToString::to_string).collect::>(), - &mut Ctx::default(), - ) - .map(|p| p.map(|p| p.to_path_buf())); - if let Some(expect) = case.expect { - if expect.is_empty() { - assert!(matches!(resolved, Ok(None)), "{} {:?}", &case.name, &resolved); - } else { - for expect in expect { - assert_eq!(resolved, Ok(Some(Path::new(expect).normalize())), "{}", &case.name); - } - } - } else { - assert!(resolved.is_err(), "{} {resolved:?}", &case.name); - } - } -} diff --git a/src/tests/incorrect_description_file.rs b/src/tests/incorrect_description_file.rs deleted file mode 100644 index a5c81796..00000000 --- a/src/tests/incorrect_description_file.rs +++ /dev/null @@ -1,62 +0,0 @@ -//! - -use rustc_hash::FxHashSet; - -use crate::{JSONError, Resolution, ResolveContext, ResolveError, ResolveOptions, Resolver}; - -// should not resolve main in incorrect description file #1 -#[test] -fn incorrect_description_file_1() { - let f = super::fixture().join("incorrect-package"); - let mut ctx = ResolveContext::default(); - let resolution = Resolver::default().resolve_with_context(f.join("pack1"), ".", &mut ctx); - let error = ResolveError::JSON(JSONError { - path: f.join("pack1/package.json"), - message: String::from("EOF while parsing a value at line 3 column 0"), - line: 3, - column: 0, - }); - assert_eq!(resolution, Err(error)); - assert_eq!(ctx.file_dependencies, FxHashSet::from_iter([f.join("pack1/package.json")])); - assert!(ctx.missing_dependencies.is_empty()); -} - -// should not resolve main in incorrect description file #2 -#[test] -fn incorrect_description_file_2() { - let f = super::fixture().join("incorrect-package"); - let resolution = Resolver::default().resolve(f.join("pack2"), "."); - let error = ResolveError::JSON(JSONError { - path: f.join("pack2/package.json"), - message: String::from("EOF while parsing a value at line 1 column 0"), - line: 1, - column: 0, - }); - assert_eq!(resolution, Err(error)); -} - -// should not resolve main in incorrect description file #3 -#[test] -fn incorrect_description_file_3() { - let f = super::fixture().join("incorrect-package"); - let resolution = Resolver::default().resolve(f.join("pack2"), "."); - assert!(resolution.is_err()); -} - -// `enhanced_resolve` does not have this test case -#[test] -fn no_description_file() { - let f = super::fixture_root().join("enhanced_resolve"); - - // has description file - let resolver = Resolver::default(); - assert_eq!( - resolver.resolve(&f, ".").map(Resolution::into_path_buf), - Ok(f.join("lib/index.js")) - ); - - // without description file - let resolver = - Resolver::new(ResolveOptions { description_files: vec![], ..ResolveOptions::default() }); - assert_eq!(resolver.resolve(&f, "."), Err(ResolveError::NotFound(".".into()))); -} diff --git a/src/tests/main_field.rs b/src/tests/main_field.rs deleted file mode 100644 index 3cadc8ce..00000000 --- a/src/tests/main_field.rs +++ /dev/null @@ -1,24 +0,0 @@ -//! Not part of enhanced_resolve's test suite - -use crate::{ResolveOptions, Resolver}; - -#[test] -fn test() { - let f = super::fixture().join("restrictions"); - - let resolver1 = Resolver::new(ResolveOptions { - main_fields: vec!["style".into()], - ..ResolveOptions::default() - }); - - let resolution = resolver1.resolve(&f, "pck2").map(|r| r.full_path()); - assert_eq!(resolution, Ok(f.join("node_modules/pck2/index.css"))); - - let resolver2 = resolver1.clone_with_options(ResolveOptions { - main_fields: vec!["module".into(), "main".into()], - ..ResolveOptions::default() - }); - - let resolution = resolver2.resolve(&f, "pck2").map(|r| r.full_path()); - assert_eq!(resolution, Ok(f.join("node_modules/pck2/module.js"))); -} diff --git a/src/tests/memory_fs.rs b/src/tests/memory_fs.rs deleted file mode 100644 index e4116609..00000000 --- a/src/tests/memory_fs.rs +++ /dev/null @@ -1,74 +0,0 @@ -use std::{ - io, - path::{Path, PathBuf}, -}; - -use crate::{FileMetadata, FileSystem}; - -#[derive(Default)] -pub struct MemoryFS { - fs: vfs::MemoryFS, -} - -impl MemoryFS { - /// # Panics - /// - /// * Fails to create directory - /// * Fails to write file - #[allow(dead_code)] - pub fn new(data: &[(&'static str, &'static str)]) -> Self { - let mut fs = Self { fs: vfs::MemoryFS::default() }; - for (path, content) in data { - fs.add_file(Path::new(path), content); - } - fs - } - - #[allow(dead_code)] - pub fn add_file(&mut self, path: &Path, content: &str) { - use vfs::FileSystem; - let fs = &mut self.fs; - // Create all parent directories - for path in path.ancestors().collect::>().iter().rev() { - let path = path.to_string_lossy(); - if !fs.exists(path.as_ref()).unwrap() { - fs.create_dir(path.as_ref()).unwrap(); - } - } - // Create file - let mut file = fs.create_file(path.to_string_lossy().as_ref()).unwrap(); - file.write_all(content.as_bytes()).unwrap(); - } -} - -impl FileSystem for MemoryFS { - fn read_to_string(&self, path: &Path) -> io::Result { - use vfs::FileSystem; - let mut file = self - .fs - .open_file(path.to_string_lossy().as_ref()) - .map_err(|err| io::Error::new(io::ErrorKind::NotFound, err))?; - let mut buffer = String::new(); - file.read_to_string(&mut buffer).unwrap(); - Ok(buffer) - } - - fn metadata(&self, path: &Path) -> io::Result { - use vfs::FileSystem; - let metadata = self - .fs - .metadata(path.to_string_lossy().as_ref()) - .map_err(|err| io::Error::new(io::ErrorKind::NotFound, err))?; - let is_file = metadata.file_type == vfs::VfsFileType::File; - let is_dir = metadata.file_type == vfs::VfsFileType::Directory; - Ok(FileMetadata::new(is_file, is_dir, false)) - } - - fn symlink_metadata(&self, path: &Path) -> io::Result { - self.metadata(path) - } - - fn canonicalize(&self, _path: &Path) -> io::Result { - Err(io::Error::new(io::ErrorKind::NotFound, "not a symlink")) - } -} diff --git a/src/tests/missing.rs b/src/tests/missing.rs deleted file mode 100644 index 4bf611ef..00000000 --- a/src/tests/missing.rs +++ /dev/null @@ -1,106 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/missing.test.js - -use normalize_path::NormalizePath; - -use crate::{AliasValue, ResolveContext, ResolveOptions, Resolver}; - -#[test] -fn test() { - let f = super::fixture(); - - let data = [ - ( - "./missing-file", - vec![f.join("missing-file"), f.join("missing-file.js"), f.join("missing-file.node")], - ), - ( - "missing-module", - vec![ - f.join("node_modules/missing-module"), - f.parent().unwrap().join("node_modules"), // enhanced-resolve is "node_modules/missing-module" - ], - ), - ( - "missing-module/missing-file", - vec![ - f.join("node_modules/missing-module"), - // f.parent().unwrap().join("node_modules/missing-module"), // we don't report this - ], - ), - ( - "m1/missing-file", - vec![ - f.join("node_modules/m1/missing-file"), - f.join("node_modules/m1/missing-file.js"), - f.join("node_modules/m1/missing-file.node"), - // f.parent().unwrap().join("node_modules/m1"), // we don't report this - ], - ), - ( - "m1/", - vec![ - f.join("node_modules/m1/index"), - f.join("node_modules/m1/index.js"), - f.join("node_modules/m1/index.json"), - f.join("node_modules/m1/index.node"), - ], - ), - ("m1/a", vec![f.join("node_modules/m1/a")]), - ]; - - let resolver = Resolver::default(); - - for (specifier, missing_dependencies) in data { - let mut ctx = ResolveContext::default(); - let _ = resolver.resolve_with_context(&f, specifier, &mut ctx); - - for path in ctx.file_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - } - - for path in missing_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - assert!( - ctx.missing_dependencies.contains(&path), - "{specifier}: {path:?} not in {:?}", - &ctx.missing_dependencies - ); - } - } -} - -#[test] -fn alias_and_extensions() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias: vec![ - ( - "@scope-js/package-name/dir$".into(), - vec![AliasValue::Path(f.join("foo/index.js").to_string_lossy().to_string())], - ), - ( - "react-dom".into(), - vec![AliasValue::Path(f.join("foo/index.js").to_string_lossy().to_string())], - ), - ], - extensions: vec![".server.ts".into()], - - ..ResolveOptions::default() - }); - - let mut ctx = ResolveContext::default(); - let _ = resolver.resolve_with_context(&f, "@scope-js/package-name/dir/router", &mut ctx); - let _ = resolver.resolve_with_context(&f, "react-dom/client", &mut ctx); - - for path in ctx.file_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - } - - for path in ctx.missing_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - if let Some(path) = path.parent() { - assert!(!path.is_file(), "{path:?} must not be a file"); - } - } -} diff --git a/src/tests/mod.rs b/src/tests/mod.rs deleted file mode 100644 index 94e6bd86..00000000 --- a/src/tests/mod.rs +++ /dev/null @@ -1,49 +0,0 @@ -mod alias; -mod browser_field; -mod builtins; -mod dependencies; -mod exports_field; -mod extension_alias; -mod extensions; -mod fallback; -mod full_specified; -mod imports_field; -mod incorrect_description_file; -mod main_field; -mod memory_fs; -mod missing; -mod resolve; -mod restrictions; -mod roots; -mod scoped_packages; -mod simple; -mod symlink; -mod tsconfig_paths; -mod tsconfig_project_references; - -use crate::Resolver; -use std::{env, path::PathBuf, sync::Arc, thread}; - -pub fn fixture_root() -> PathBuf { - env::current_dir().unwrap().join("fixtures") -} - -pub fn fixture() -> PathBuf { - fixture_root().join("enhanced_resolve").join("test").join("fixtures") -} - -#[test] -fn threaded_environment() { - let cwd = env::current_dir().unwrap(); - let resolver = Arc::new(Resolver::default()); - for _ in 0..2 { - _ = thread::spawn({ - let cwd = cwd.clone(); - let resolver = Arc::clone(&resolver); - move || { - _ = resolver.resolve(cwd, "."); - } - }) - .join(); - } -} diff --git a/src/tests/resolve.rs b/src/tests/resolve.rs deleted file mode 100644 index f2dbb88e..00000000 --- a/src/tests/resolve.rs +++ /dev/null @@ -1,119 +0,0 @@ -//! - -use crate::{ResolveError, ResolveOptions, Resolver}; - -#[test] -fn resolve() { - let f = super::fixture(); - - let resolver = Resolver::default(); - - let main1_js_path = f.join("main1.js").to_string_lossy().to_string(); - - #[rustfmt::skip] - let pass = [ - ("absolute path", f.clone(), main1_js_path.as_str(), f.join("main1.js")), - ("file with .js", f.clone(), "./main1.js", f.join("main1.js")), - ("file without extension", f.clone(), "./main1", f.join("main1.js")), - ("another file with .js", f.clone(), "./a.js", f.join("a.js")), - ("another file without extension", f.clone(), "./a", f.join("a.js")), - ("file in module with .js", f.clone(), "m1/a.js", f.join("node_modules/m1/a.js")), - ("file in module without extension", f.clone(), "m1/a", f.join("node_modules/m1/a.js")), - ("another file in module without extension", f.clone(), "complexm/step1", f.join("node_modules/complexm/step1.js")), - ("from submodule to file in sibling module", f.join("node_modules/complexm"), "m2/b.js", f.join("node_modules/m2/b.js")), - ("from nested directory to overwritten file in module", f.join("multiple_modules"), "m1/a.js", f.join("multiple_modules/node_modules/m1/a.js")), - ("from nested directory to not overwritten file in module", f.join("multiple_modules"), "m1/b.js", f.join("node_modules/m1/b.js")), - ("file with query", f.clone(), "./main1.js?query", f.join("main1.js?query")), - ("file with fragment", f.clone(), "./main1.js#fragment", f.join("main1.js#fragment")), - ("file with fragment and query", f.clone(), "./main1.js#fragment?query", f.join("main1.js#fragment?query")), - ("file with query and fragment", f.clone(), "./main1.js?#fragment", f.join("main1.js?#fragment")), - - ("file with query (unicode)", f.clone(), "./测试.js?query", f.join("测试.js?query")), - ("file with fragment (unicode)", f.clone(), "./测试.js#fragment", f.join("测试.js#fragment")), - ("file with fragment and query (unicode)", f.clone(), "./测试.js#fragment?query", f.join("测试.js#fragment?query")), - ("file with query and fragment (unicode)", f.clone(), "./测试.js?#fragment", f.join("测试.js?#fragment")), - - ("file in module with query", f.clone(), "m1/a?query", f.join("node_modules/m1/a.js?query")), - ("file in module with fragment", f.clone(), "m1/a#fragment", f.join("node_modules/m1/a.js#fragment")), - ("file in module with fragment and query", f.clone(), "m1/a#fragment?query", f.join("node_modules/m1/a.js#fragment?query")), - ("file in module with query and fragment", f.clone(), "m1/a?#fragment", f.join("node_modules/m1/a.js?#fragment")), - ("file in module with query and fragment", f.clone(), "m1/a?#fragment", f.join("node_modules/m1/a.js?#fragment")), - ("differ between directory and file, resolve file", f.clone(), "./dirOrFile", f.join("dirOrFile.js")), - ("differ between directory and file, resolve directory", f.clone(), "./dirOrFile/", f.join("dirOrFile/index.js")), - ("find node_modules outside of node_modules", f.join("browser-module/node_modules"), "m1/a", f.join("node_modules/m1/a.js")), - ("don't crash on main field pointing to self", f.clone(), "./main-field-self", f.join("./main-field-self/index.js")), - ("don't crash on main field pointing to self (2)", f.clone(), "./main-field-self2", f.join("./main-field-self2/index.js")), - // enhanced-resolve has `#` prepended with a `\0`, they are removed from the - // following 3 expected test results. - // See https://github.com/webpack/enhanced-resolve#escaping - ("handle fragment edge case (no fragment)", f.clone(), "./no#fragment/#/#", f.join("no#fragment/#/#.js")), - ("handle fragment edge case (fragment)", f.clone(), "./no#fragment/#/", f.join("no.js#fragment/#/")), - ("handle fragment escaping", f.clone(), "./no\0#fragment/\0#/\0##fragment", f.join("no#fragment/#/#.js#fragment")), - - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn issue238_resolve() { - let f = super::fixture().join("issue-238"); - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into(), ".jsx".into(), ".ts".into(), ".tsx".into()], - modules: vec!["src/a".into(), "src/b".into(), "src/common".into(), "node_modules".into()], - ..ResolveOptions::default() - }); - let resolved_path = - resolver.resolve(f.join("src/common"), "config/myObjectFile").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("src/common/config/myObjectFile.js")),); -} - -#[test] -fn prefer_relative() { - let f = super::fixture(); - - let resolver = - Resolver::new(ResolveOptions { prefer_relative: true, ..ResolveOptions::default() }); - - #[rustfmt::skip] - let pass = [ - ("should correctly resolve with preferRelative 1", "main1.js", f.join("main1.js")), - ("should correctly resolve with preferRelative 2", "m1/a.js", f.join("node_modules/m1/a.js")), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } -} - -#[test] -fn resolve_to_context() { - let f = super::fixture(); - let resolver = - Resolver::new(ResolveOptions { resolve_to_context: true, ..ResolveOptions::default() }); - - #[rustfmt::skip] - let data = [ - ("context for fixtures", f.clone(), "./", f.clone()), - ("context for fixtures/lib", f.clone(), "./lib", f.join("lib")), - ("context for fixtures with ..", f.clone(), "./lib/../../fixtures/./lib/..", f.clone()), - ("context for fixtures with query", f.clone(), "./?query", f.clone().with_file_name("fixtures?query")), - ]; - - for (comment, path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn resolve_hash_as_module() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions::default()); - let resolution = resolver.resolve(f, "#a"); - assert_eq!(resolution, Err(ResolveError::NotFound("#a".into()))); -} diff --git a/src/tests/restrictions.rs b/src/tests/restrictions.rs deleted file mode 100644 index 5ba56596..00000000 --- a/src/tests/restrictions.rs +++ /dev/null @@ -1,25 +0,0 @@ -//! - -use crate::{ResolveError, ResolveOptions, Resolver, Restriction}; - -// TODO: regex -// * should respect RegExp restriction -// * should try to find alternative #1 -// * should try to find alternative #2 -// * should try to find alternative #3 - -// should respect string restriction -#[test] -fn restriction1() { - let fixture = super::fixture(); - let f = fixture.join("restrictions"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - restrictions: vec![Restriction::Path(f.clone())], - ..ResolveOptions::default() - }); - - let resolution = resolver.resolve(&f, "pck2"); - assert_eq!(resolution, Err(ResolveError::Restriction(fixture.join("c.js"), f))); -} diff --git a/src/tests/roots.rs b/src/tests/roots.rs deleted file mode 100644 index b50e2a07..00000000 --- a/src/tests/roots.rs +++ /dev/null @@ -1,92 +0,0 @@ -//! - -use std::path::PathBuf; - -use crate::{AliasValue, ResolveError, ResolveOptions, Resolver}; - -fn dirname() -> PathBuf { - super::fixture_root().join("enhanced_resolve").join("test") -} - -#[test] -fn roots() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - alias: vec![("foo".into(), vec![AliasValue::from("/fixtures")])], - roots: vec![dirname(), f.clone()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should respect roots option", "/fixtures/b.js", f.join("b.js")), - ("should try another root option, if it exists", "/b.js", f.join("b.js")), - ("should respect extension", "/fixtures/b", f.join("b.js")), - ("should resolve in directory", "/fixtures/extensions/dir", f.join("extensions/dir/index.js")), - ("should respect aliases", "foo/b", f.join("b.js")), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } - - #[rustfmt::skip] - let fail = [ - ("should not work with relative path", "fixtures/b.js", ResolveError::NotFound("fixtures/b.js".into())) - ]; - - for (comment, request, expected) in fail { - let resolution = resolver.resolve(&f, request); - assert_eq!(resolution, Err(expected), "{comment} {request}"); - } -} - -#[test] -fn resolve_to_context() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - roots: vec![dirname(), f.clone()], - resolve_to_context: true, - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f, "/fixtures/lib").map(|r| r.full_path()); - let expected = f.join("lib"); - assert_eq!(resolved_path, Ok(expected)); -} - -#[test] -fn prefer_absolute() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - alias: vec![("foo".into(), vec![AliasValue::from("/fixtures")])], - roots: vec![dirname(), f.clone()], - prefer_absolute: true, - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve an absolute path (prefer absolute)", f.join("b.js").to_string_lossy().to_string(), f.join("b.js")), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(&f, &request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } -} - -#[test] -fn roots_fall_through() { - let f = super::fixture(); - let absolute_path = f.join("roots_fall_through/index.js"); - let specifier = absolute_path.to_string_lossy(); - let resolution = Resolver::new(ResolveOptions::default().with_root(&f)).resolve(&f, &specifier); - assert_eq!( - resolution.map(super::super::resolution::Resolution::into_path_buf), - Ok(absolute_path) - ); -} diff --git a/src/tests/scoped_packages.rs b/src/tests/scoped_packages.rs deleted file mode 100644 index 8258f00f..00000000 --- a/src/tests/scoped_packages.rs +++ /dev/null @@ -1,25 +0,0 @@ -//! - -use crate::{ResolveOptions, Resolver}; - -#[test] -fn scoped_packages() { - let f = super::fixture().join("scoped"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("main field should work", f.clone(), "@scope/pack1", f.join("./node_modules/@scope/pack1/main.js")), - ("browser field should work", f.clone(), "@scope/pack2", f.join("./node_modules/@scope/pack2/main.js")), - ("folder request should work", f.clone(), "@scope/pack2/lib", f.join("./node_modules/@scope/pack2/lib/index.js")) - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} diff --git a/src/tests/simple.rs b/src/tests/simple.rs deleted file mode 100644 index 08e1238a..00000000 --- a/src/tests/simple.rs +++ /dev/null @@ -1,68 +0,0 @@ -//! - -use std::env; - -use crate::Resolver; - -#[test] -fn simple() { - // mimic `enhanced-resolve/test/simple.test.js` - let dirname = env::current_dir().unwrap().join("fixtures"); - let f = dirname.join("enhanced_resolve/test"); - - let resolver = Resolver::default(); - - let data = [ - ("direct", f.clone(), "../lib/index"), - ("as directory", f, ".."), - ("as module", dirname.clone(), "./enhanced_resolve"), - ]; - - for (comment, path, request) in data { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - let expected = dirname.join("enhanced_resolve/lib/index.js"); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn dashed_name() { - let f = super::fixture(); - - let resolver = Resolver::default(); - - let data = [ - (f.clone(), "dash", f.join("node_modules/dash/index.js")), - (f.clone(), "dash-name", f.join("node_modules/dash-name/index.js")), - (f.join("node_modules/dash"), "dash", f.join("node_modules/dash/index.js")), - (f.join("node_modules/dash"), "dash-name", f.join("node_modules/dash-name/index.js")), - (f.join("node_modules/dash-name"), "dash", f.join("node_modules/dash/index.js")), - (f.join("node_modules/dash-name"), "dash-name", f.join("node_modules/dash-name/index.js")), - ]; - - for (path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{path:?} {request}"); - } -} - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows { - use super::super::memory_fs::MemoryFS; - - use crate::ResolveOptions; - - #[test] - fn no_package() { - use crate::ResolverGeneric; - use std::path::Path; - let f = Path::new("/"); - let file_system = MemoryFS::new(&[]); - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions::default(), - ); - let resolved_path = resolver.resolve(f, "package"); - assert!(resolved_path.is_err()); - } -} diff --git a/src/tests/symlink.rs b/src/tests/symlink.rs deleted file mode 100644 index 7589b560..00000000 --- a/src/tests/symlink.rs +++ /dev/null @@ -1,121 +0,0 @@ -use std::{fs, io, path::Path}; - -use crate::{ResolveOptions, Resolver}; - -#[derive(Debug, Clone, Copy)] -enum FileType { - File, - Dir, -} - -#[allow(unused_variables)] -fn symlink, Q: AsRef>( - original: P, - link: Q, - file_type: FileType, -) -> io::Result<()> { - #[cfg(target_family = "unix")] - { - std::os::unix::fs::symlink(original, link) - } - - #[cfg(target_family = "windows")] - match file_type { - FileType::File => std::os::windows::fs::symlink_file(original, link), - FileType::Dir => std::os::windows::fs::symlink_dir(original, link), - } -} - -fn init(dirname: &Path, temp_path: &Path) -> io::Result<()> { - if temp_path.exists() { - _ = fs::remove_dir_all(temp_path); - } - fs::create_dir(temp_path)?; - symlink(dirname.join("../lib/index.js"), temp_path.join("test"), FileType::File)?; - symlink(dirname.join("../lib"), temp_path.join("test2"), FileType::Dir)?; - fs::remove_file(temp_path.join("test"))?; - fs::remove_file(temp_path.join("test2"))?; - fs::remove_dir(temp_path) -} - -fn create_symlinks(dirname: &Path, temp_path: &Path) -> io::Result<()> { - fs::create_dir(temp_path).unwrap(); - symlink( - dirname.join("../lib/index.js").canonicalize().unwrap(), - temp_path.join("index.js"), - FileType::File, - )?; - symlink(dirname.join("../lib").canonicalize().unwrap(), temp_path.join("lib"), FileType::Dir)?; - symlink(dirname.join("..").canonicalize().unwrap(), temp_path.join("this"), FileType::Dir)?; - symlink(temp_path.join("this"), temp_path.join("that"), FileType::Dir)?; - symlink(Path::new("../../lib/index.js"), temp_path.join("node.relative.js"), FileType::File)?; - symlink( - Path::new("./node.relative.js"), - temp_path.join("node.relative.sym.js"), - FileType::File, - )?; - Ok(()) -} - -fn cleanup_symlinks(temp_path: &Path) { - _ = fs::remove_dir_all(temp_path); -} - -#[test] -fn test() -> io::Result<()> { - let root = super::fixture_root().join("enhanced_resolve"); - let dirname = root.join("test"); - let temp_path = dirname.join("temp"); - if !temp_path.exists() { - let is_admin = init(&dirname, &temp_path).is_ok(); - if !is_admin { - return Ok(()); - } - if let Err(err) = create_symlinks(&dirname, &temp_path) { - cleanup_symlinks(&temp_path); - return Err(err); - } - } - - let resolver_without_symlinks = - Resolver::new(ResolveOptions { symlinks: false, ..ResolveOptions::default() }); - let resolver_with_symlinks = Resolver::default(); - - #[rustfmt::skip] - let pass = [ - ("with a symlink to a file", temp_path.clone(), "./index.js"), - ("with a relative symlink to a file", temp_path.clone(), "./node.relative.js"), - ("with a relative symlink to a symlink to a file", temp_path.clone(), "./node.relative.sym.js"), - ("with a symlink to a directory 1", temp_path.clone(), "./lib/index.js"), - ("with a symlink to a directory 2", temp_path.clone(), "./this/lib/index.js"), - ("with multiple symlinks in the path 1", temp_path.clone(), "./this/test/temp/index.js"), - ("with multiple symlinks in the path 2", temp_path.clone(), "./this/test/temp/lib/index.js"), - ("with multiple symlinks in the path 3", temp_path.clone(), "./this/test/temp/this/lib/index.js"), - ("with a symlink to a directory 2 (chained)", temp_path.clone(), "./that/lib/index.js"), - ("with multiple symlinks in the path 1 (chained)", temp_path.clone(), "./that/test/temp/index.js"), - ("with multiple symlinks in the path 2 (chained)", temp_path.clone(), "./that/test/temp/lib/index.js"), - ("with multiple symlinks in the path 3 (chained)", temp_path.clone(), "./that/test/temp/that/lib/index.js"), - ("with symlinked directory as context 1", temp_path.join( "lib"), "./index.js"), - ("with symlinked directory as context 2", temp_path.join( "this"), "./lib/index.js"), - ("with symlinked directory as context and in path", temp_path.join( "this"), "./test/temp/lib/index.js"), - ("with symlinked directory in context path", temp_path.join( "this/lib"), "./index.js"), - ("with symlinked directory in context path and symlinked file", temp_path.join( "this/test"), "./temp/index.js"), - ("with symlinked directory in context path and symlinked directory", temp_path.join( "this/test"), "./temp/lib/index.js"), - ("with symlinked directory as context 2 (chained)", temp_path.join( "that"), "./lib/index.js"), - ("with symlinked directory as context and in path (chained)", temp_path.join( "that"), "./test/temp/lib/index.js"), - ("with symlinked directory in context path (chained)", temp_path.join( "that/lib"), "./index.js"), - ("with symlinked directory in context path and symlinked file (chained)", temp_path.join( "that/test"), "./temp/index.js"), - ("with symlinked directory in context path and symlinked directory (chained)", temp_path.join( "that/test"), "./temp/lib/index.js") - ]; - - for (comment, path, request) in pass { - let filename = resolver_with_symlinks.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(filename, Ok(root.join("lib/index.js")), "{comment:?}"); - - let resolved_path = - resolver_without_symlinks.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(path.join(request))); - } - - Ok(()) -} diff --git a/src/tests/tsconfig_paths.rs b/src/tests/tsconfig_paths.rs deleted file mode 100644 index 26935b5c..00000000 --- a/src/tests/tsconfig_paths.rs +++ /dev/null @@ -1,507 +0,0 @@ -//! tests for tsconfig-paths -//! -//! Fixtures copied from . - -use std::path::{Path, PathBuf}; - -use crate::{ - ResolveError, ResolveOptions, Resolver, TsConfig, TsconfigOptions, TsconfigReferences, -}; - -// -#[test] -fn tsconfig() { - let f = super::fixture_root().join("tsconfig"); - - #[rustfmt::skip] - let pass = [ - (f.clone(), None, "ts-path", f.join("foo.js")), - (f.join("nested"), None, "ts-path", f.join("nested/test.js")), - (f.join("cases/index"), None, "foo", f.join("node_modules/tsconfig-index/foo.js")), - // This requires reading package.json.tsconfig field - // (f.join("cases/field"), "foo", f.join("node_modules/tsconfig-field/foo.js")) - (f.join("cases/exports"), None, "foo", f.join("node_modules/tsconfig-exports/foo.js")), - (f.join("cases/extends-extension"), None, "foo", f.join("cases/extends-extension/foo.js")), - (f.join("cases/extends-extensionless"), None, "foo", f.join("node_modules/tsconfig-field/foo.js")), - (f.join("cases/extends-paths"), Some("src"), "@/index", f.join("cases/extends-paths/src/index.js")), - (f.join("cases/extends-multiple"), None, "foo", f.join("cases/extends-multiple/foo.js")), - ]; - - for (dir, subdir, request, expected) in pass { - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: dir.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - let path = subdir.map_or(dir.clone(), |subdir| dir.join(subdir)); - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{request} {path:?}"); - } - - #[rustfmt::skip] - let data = [ - (f.join("node_modules/tsconfig-not-used"), "ts-path", Ok(f.join("foo.js"))), - ]; - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - for (path, request, expected) in data { - let resolution = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolution, expected, "{path:?} {request}"); - } -} - -#[test] -fn tsconfig_fallthrough() { - let f = super::fixture_root().join("tsconfig"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "/"); - assert_eq!(resolved_path, Err(ResolveError::NotFound("/".into()))); -} - -#[test] -fn json_with_comments() { - let f = super::fixture_root().join("tsconfig/cases/trailing-comma"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "foo").map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(f.join("bar.js"))); -} - -// -#[test] -fn test_paths() { - let path = Path::new("/foo/tsconfig.json"); - let mut tsconfig_json = serde_json::json!({ - "compilerOptions": { - "paths": { - "jquery": ["node_modules/jquery/dist/jquery"], - "*": ["generated/*"], - "bar/*": ["test/*"], - "bar/baz/*": ["baz/*", "yo/*"], - "@/components/*": ["components/*"], - "url": ["node_modules/my-url"], - } - } - }) - .to_string(); - let tsconfig = TsConfig::parse(true, path, &mut tsconfig_json).unwrap(); - - let data = [ - ("jquery", vec!["/foo/node_modules/jquery/dist/jquery"]), - ("test", vec!["/foo/generated/test"]), - ("test/hello", vec!["/foo/generated/test/hello"]), - ("bar/hi", vec!["/foo/test/hi"]), - ("bar/baz/hi", vec!["/foo/baz/hi", "/foo/yo/hi"]), - ("@/components/button", vec!["/foo/components/button"]), - ("./jquery", vec![]), - ("url", vec!["/foo/node_modules/my-url"]), - ]; - - for (specifier, expected) in data { - let paths = tsconfig.resolve_path_alias(specifier); - let expected = expected.into_iter().map(PathBuf::from).collect::>(); - assert_eq!(paths, expected, "{specifier}"); - } -} - -// -#[test] -fn test_base_url() { - let path = Path::new("/foo/tsconfig.json"); - let mut tsconfig_json = serde_json::json!({ - "compilerOptions": { - "baseUrl": "./src" - } - }) - .to_string(); - let tsconfig = TsConfig::parse(true, path, &mut tsconfig_json).unwrap(); - - let data = [ - ("foo", vec!["/foo/src/foo"]), - ("components/button", vec!["/foo/src/components/button"]), - ("./jquery", vec![]), - ]; - - for (specifier, expected) in data { - let paths = tsconfig.resolve_path_alias(specifier); - let expected = expected.into_iter().map(PathBuf::from).collect::>(); - assert_eq!(paths, expected, "{specifier}"); - } -} - -// -#[test] -fn test_paths_and_base_url() { - let path = Path::new("/foo/tsconfig.json"); - let mut tsconfig_json = serde_json::json!({ - "compilerOptions": { - "baseUrl": "./src", - "paths": { - "*": ["generated/*"], - "bar/*": ["test/*"], - "bar/baz/*": ["baz/*", "yo/*"], - "@/components/*": ["components/*"] - } - } - }) - .to_string(); - let tsconfig = TsConfig::parse(true, path, &mut tsconfig_json).unwrap(); - - let data = [ - ("test", vec!["/foo/src/generated/test", "/foo/src/test"]), - ("test/hello", vec!["/foo/src/generated/test/hello", "/foo/src/test/hello"]), - ("bar/hi", vec!["/foo/src/test/hi", "/foo/src/bar/hi"]), - ("bar/baz/hi", vec!["/foo/src/baz/hi", "/foo/src/yo/hi", "/foo/src/bar/baz/hi"]), - ("@/components/button", vec!["/foo/src/components/button", "/foo/src/@/components/button"]), - ("./jquery", vec![]), - ]; - - for (specifier, expected) in data { - let paths = tsconfig.resolve_path_alias(specifier); - let expected = expected.into_iter().map(PathBuf::from).collect::>(); - assert_eq!(paths, expected, "{specifier}"); - } -} - -// Template variable ${configDir} for substitution of config files directory path -// https://github.com/microsoft/TypeScript/pull/58042 -#[test] -fn test_template_variable() { - let f = super::fixture_root().join("tsconfig"); - let f2 = f.join("cases").join("paths_template_variable"); - - #[rustfmt::skip] - let pass = [ - (f2.clone(), "tsconfig1.json", "foo", f2.join("foo.js")), - (f2.clone(), "tsconfig2.json", "foo", f2.join("foo.js")), - (f.clone(), "tsconfig_template_variable.json", "foo", f.join("foo.js")), - ]; - - for (dir, tsconfig, request, expected) in pass { - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: dir.join(tsconfig), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&dir, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{request} {tsconfig} {dir:?}"); - } -} - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows_test { - use std::path::{Path, PathBuf}; - - use crate::{ - ResolveError, ResolveOptions, ResolverGeneric, TsconfigOptions, TsconfigReferences, - }; - - use super::super::memory_fs::MemoryFS; - - struct OneTest { - name: &'static str, - tsconfig: String, - package_json: Option<(PathBuf, String)>, - main_fields: Option>, - existing_files: Vec<&'static str>, - requested_module: &'static str, - expected_path: &'static str, - extensions: Vec, - } - - impl Default for OneTest { - fn default() -> Self { - Self { - name: "", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/*": ["location/*"] - } - } - }) - .to_string(), - package_json: None, - main_fields: None, - existing_files: vec![], - requested_module: "", - expected_path: "", - extensions: vec![ - ".js".into(), - ".json".into(), - ".node".into(), - ".ts".into(), - ".tsx".into(), - ], - } - } - } - - impl OneTest { - fn resolver(&self, root: &Path) -> ResolverGeneric { - let mut file_system = MemoryFS::default(); - - file_system.add_file(&root.join("tsconfig.json"), &self.tsconfig); - if let Some((path, package_json)) = &self.package_json { - file_system.add_file(&root.join(path).join("package.json"), package_json); - } - for path in &self.existing_files { - file_system.add_file(Path::new(path), ""); - } - - let mut options = ResolveOptions { - extensions: self.extensions.clone(), - tsconfig: Some(TsconfigOptions { - config_file: root.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }; - if let Some(main_fields) = &self.main_fields { - options.main_fields.clone_from(main_fields); - } - - ResolverGeneric::::new_with_file_system(file_system, options) - } - } - - // Path matching tests from tsconfig-paths - // * - // * - #[test] - fn match_path() { - let pass = [ - OneTest { - name: "should locate path that matches with star and exists", - existing_files: vec!["/root/location/mylib/index.ts"], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve to correct path when many are specified", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/*": ["foo1/*", "foo2/*", "location/*", "foo3/*"], - } - } - }) - .to_string(), - existing_files: vec!["/root/location/mylib/index.ts"], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should locate path that matches with star and prioritize pattern with longest prefix", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "*": ["location/*"], - "lib/*": ["location/*"], - } - } - }) - .to_string(), - existing_files: vec![ - "/root/location/lib/mylib/index.ts", - "/root/location/mylib/index.ts", - ], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should locate path that matches with star and exists with extension", - existing_files: vec![ - "/root/location/mylib.myext", - ], - requested_module: "lib/mylib", - extensions: vec![".js".into(), ".myext".into()], - expected_path: "/root/location/mylib.myext", - ..OneTest::default() - }, - OneTest { - name: "should resolve request with extension specified", - existing_files: vec![ - "/root/location/test.jpg", - ], - requested_module: "lib/test.jpg", - expected_path: "/root/location/test.jpg", - ..OneTest::default() - }, - OneTest { - name: "should locate path that matches without star and exists", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/foo": ["location/foo"] - } - } - }) - .to_string(), - existing_files: vec![ - "/root/location/foo.ts", - ], - requested_module: "lib/foo", - expected_path: "/root/location/foo.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve to parent folder when filename is in subfolder", - existing_files: vec![ - "/root/location/mylib/index.ts", - ], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve from main field in package.json", - package_json: Some((PathBuf::from("/root/location/mylib"), serde_json::json!({ - "main": "./kalle.ts" - }).to_string())), - existing_files: vec![ - "/root/location/mylib/kalle.ts", - ], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/kalle.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve from main field in package.json (js)", - package_json: Some((PathBuf::from("/root/location/mylib.js"), serde_json::json!({ - "main": "./kalle.js" - }).to_string())), - existing_files: vec![ - "/root/location/mylib.js/kalle.js", - ], - extensions: vec![".ts".into(), ".js".into()], - requested_module: "lib/mylib.js", - expected_path: "/root/location/mylib.js/kalle.js", - ..OneTest::default() - }, - OneTest { - name: "should resolve from list of fields by priority in package.json", - main_fields: Some(vec!["missing".into(), "browser".into(), "main".into()]), - package_json: Some((PathBuf::from("/root/location/mylibjs"), serde_json::json!({ - "main": "./main.js", - "browser": "./browser.js" - }).to_string())), - existing_files: vec![ - "/root/location/mylibjs/main.js", - "/root/location/mylibjs/browser.js", - ], - extensions: vec![".ts".into(), ".js".into()], - requested_module: "lib/mylibjs", - expected_path: "/root/location/mylibjs/browser.js", - ..OneTest::default() - }, -OneTest { - name: "should ignore field mappings to missing files in package.json", - main_fields: Some(vec!["browser".into(), "main".into()]), - package_json: Some((PathBuf::from("/root/location/mylibjs"), serde_json::json!({ - "main": "./kalle.js", - "browser": "./nope.js" - }).to_string())), - existing_files: vec![ - "/root/location/mylibjs/kalle.js", - ], - extensions: vec![".ts".into(), ".js".into()], - requested_module: "lib/mylibjs", - expected_path: "/root/location/mylibjs/kalle.js", - ..OneTest::default() - }, - // Tests that are not applicable: - // name: "should resolve nested main fields" - // name: "should ignore advanced field mappings in package.json" - // name: "should resolve to with the help of baseUrl when not explicitly set" - // name: "should not resolve with the help of baseUrl when asked not to" - // name: "should resolve main file with cjs file extension" - OneTest { - name: "should resolve .ts from .js alias", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "@/*": ["src/*"] - } - } - }).to_string(), - existing_files: vec![ - "/root/src/foo.ts", - ], - requested_module: "@/foo", // original data was "@/foo.ts" but I don't get why it is the case? - expected_path: "/root/src/foo.ts", // original data was "/root/src/foo" - ..OneTest::default() - }, - ]; - - let root = PathBuf::from("/root"); - - for test in pass { - let resolved_path = - test.resolver(&root).resolve(&root, test.requested_module).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(PathBuf::from(test.expected_path)), "{}", test.name); - } - - let fail = [ - OneTest { - name: "should not locate path that does not match", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/*": ["location/*"] - } - } - }) - .to_string(), - existing_files: vec!["/root/location/mylib"], - requested_module: "lib/mylibjs", - ..OneTest::default() - }, - OneTest { - name: "should not resolve typings file (index.d.ts)", - existing_files: vec!["/root/location/mylib/index.d.ts"], - requested_module: "lib/mylib", - ..OneTest::default() - }, - ]; - - for test in fail { - let resolved_path = - test.resolver(&root).resolve(&root, test.requested_module).map(|f| f.full_path()); - assert_eq!( - resolved_path, - Err(ResolveError::NotFound(test.requested_module.into())), - "{}", - test.name - ); - } - } -} diff --git a/src/tests/tsconfig_project_references.rs b/src/tests/tsconfig_project_references.rs deleted file mode 100644 index b552fefe..00000000 --- a/src/tests/tsconfig_project_references.rs +++ /dev/null @@ -1,101 +0,0 @@ -//! Tests for tsconfig project references - -use crate::{ResolveError, ResolveOptions, Resolver, TsconfigOptions, TsconfigReferences}; - -#[test] -fn auto() { - let f = super::fixture_root().join("tsconfig/cases/project_references"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("app"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - // Test normal paths alias - (f.join("app"), "@/index.ts", f.join("app/aliased/index.ts")), - (f.join("app"), "@/../index.ts", f.join("app/index.ts")), - // Test project reference - (f.join("project_a"), "@/index.ts", f.join("project_a/aliased/index.ts")), - (f.join("project_b/src"), "@/index.ts", f.join("project_b/src/aliased/index.ts")), - // Does not have paths alias - (f.join("project_a"), "./index.ts", f.join("project_a/index.ts")), - (f.join("project_c"), "./index.ts", f.join("project_c/index.ts")), - // Template variable - { - let dir = f.parent().unwrap().join("paths_template_variable"); - (dir.clone(), "foo", dir.join("foo.js")) - } - ]; - - for (path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{request} {path:?}"); - } -} - -#[test] -fn disabled() { - let f = super::fixture_root().join("tsconfig/cases/project_references"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("app"), - references: TsconfigReferences::Disabled, - }), - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - // Test normal paths alias - (f.join("app"), "@/index.ts", Ok(f.join("app/aliased/index.ts"))), - (f.join("app"), "@/../index.ts", Ok(f.join("app/index.ts"))), - // Test project reference - (f.join("project_a"), "@/index.ts", Err(ResolveError::NotFound("@/index.ts".into()))), - (f.join("project_b/src"), "@/index.ts", Err(ResolveError::NotFound("@/index.ts".into()))), - // Does not have paths alias - (f.join("project_a"), "./index.ts", Ok(f.join("project_a/index.ts"))), - (f.join("project_c"), "./index.ts", Ok(f.join("project_c/index.ts"))), - ]; - - for (path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, expected, "{request} {path:?}"); - } -} - -#[test] -fn manual() { - let f = super::fixture_root().join("tsconfig/cases/project_references"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("app"), - references: TsconfigReferences::Paths(vec!["../project_a/conf.json".into()]), - }), - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - // Test normal paths alias - (f.join("app"), "@/index.ts", Ok(f.join("app/aliased/index.ts"))), - (f.join("app"), "@/../index.ts", Ok(f.join("app/index.ts"))), - // Test project reference - (f.join("project_a"), "@/index.ts", Ok(f.join("project_a/aliased/index.ts"))), - (f.join("project_b/src"), "@/index.ts", Err(ResolveError::NotFound("@/index.ts".into()))), - // Does not have paths alias - (f.join("project_a"), "./index.ts", Ok(f.join("project_a/index.ts"))), - (f.join("project_c"), "./index.ts", Ok(f.join("project_c/index.ts"))), - ]; - - for (path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, expected, "{request} {path:?}"); - } -} diff --git a/src/tsconfig.rs b/src/tsconfig.rs deleted file mode 100644 index aa00f6e4..00000000 --- a/src/tsconfig.rs +++ /dev/null @@ -1,212 +0,0 @@ -use std::{ - path::{Path, PathBuf}, - sync::Arc, -}; - -use serde::Deserialize; -use typescript_tsconfig_json::{CompilerOptionsPathsMap, ExtendsField}; - -use crate::PathUtil; - -#[derive(Debug, Deserialize)] -#[serde(rename_all = "camelCase")] -pub struct TsConfig { - /// Whether this is the caller tsconfig. - /// Used for final template variable substitution when all configs are extended and merged. - #[serde(skip)] - root: bool, - - /// Path to `tsconfig.json`. Contains the `tsconfig.json` filename. - #[serde(skip)] - path: PathBuf, - - #[serde(default)] - pub extends: Option, - - #[serde(default)] - pub compiler_options: CompilerOptions, - - /// Bubbled up project references with a reference to their tsconfig. - #[serde(default)] - pub references: Vec, -} - -/// Compiler Options -/// -/// -#[derive(Debug, Default, Deserialize)] -#[serde(rename_all = "camelCase")] -pub struct CompilerOptions { - base_url: Option, - - /// Path aliases - paths: Option, - - /// The actual base for where path aliases are resolved from. - #[serde(skip)] - paths_base: PathBuf, -} - -/// Project Reference -/// -/// -#[derive(Debug, Deserialize)] -pub struct ProjectReference { - /// The path property of each reference can point to a directory containing a tsconfig.json file, - /// or to the config file itself (which may have any name). - pub path: PathBuf, - - /// Reference to the resolved tsconfig - #[serde(skip)] - pub tsconfig: Option>, -} - -impl TsConfig { - pub fn parse(root: bool, path: &Path, json: &mut str) -> Result { - _ = json_strip_comments::strip(json); - let mut tsconfig: Self = serde_json::from_str(json)?; - tsconfig.root = root; - tsconfig.path = path.to_path_buf(); - let directory = tsconfig.directory().to_path_buf(); - if let Some(base_url) = tsconfig.compiler_options.base_url { - tsconfig.compiler_options.base_url = Some(directory.normalize_with(base_url)); - } - if tsconfig.compiler_options.paths.is_some() { - tsconfig.compiler_options.paths_base = - tsconfig.compiler_options.base_url.as_ref().map_or(directory, Clone::clone); - } - Ok(tsconfig) - } - - pub fn build(mut self) -> Self { - if self.root { - let dir = self.directory().to_path_buf(); - // Substitute template variable in `tsconfig.compilerOptions.paths` - if let Some(paths) = &mut self.compiler_options.paths { - for paths in paths.values_mut() { - for path in paths { - Self::substitute_template_variable(&dir, path); - } - } - } - } - self - } - - /// Directory to `tsconfig.json` - /// - /// # Panics - /// - /// * When the `tsconfig.json` path is misconfigured. - pub fn directory(&self) -> &Path { - debug_assert!(self.path.file_name().is_some()); - self.path.parent().unwrap() - } - - pub fn extend_tsconfig(&mut self, tsconfig: &Self) { - let compiler_options = &mut self.compiler_options; - if compiler_options.paths.is_none() { - compiler_options.paths_base = compiler_options - .base_url - .as_ref() - .map_or_else(|| tsconfig.compiler_options.paths_base.clone(), Clone::clone); - compiler_options.paths.clone_from(&tsconfig.compiler_options.paths); - } - if compiler_options.base_url.is_none() { - compiler_options.base_url.clone_from(&tsconfig.compiler_options.base_url); - } - } - - pub fn resolve(&self, path: &Path, specifier: &str) -> Vec { - if path.starts_with(self.base_path()) { - let paths = self.resolve_path_alias(specifier); - if !paths.is_empty() { - return paths; - } - } - for tsconfig in self.references.iter().filter_map(|reference| reference.tsconfig.as_ref()) { - if path.starts_with(tsconfig.base_path()) { - return tsconfig.resolve_path_alias(specifier); - } - } - vec![] - } - - // Copied from parcel - // - pub fn resolve_path_alias(&self, specifier: &str) -> Vec { - if specifier.starts_with(|s| s == '/' || s == '.') { - return vec![]; - } - - let base_url_iter = self - .compiler_options - .base_url - .as_ref() - .map_or_else(Vec::new, |base_url| vec![base_url.normalize_with(specifier)]); - - let Some(paths_map) = &self.compiler_options.paths else { - return base_url_iter; - }; - - let paths = paths_map.get(specifier).map_or_else( - || { - let mut longest_prefix_length = 0; - let mut longest_suffix_length = 0; - let mut best_key: Option<&String> = None; - - for key in paths_map.keys() { - if let Some((prefix, suffix)) = key.split_once('*') { - if (best_key.is_none() || prefix.len() > longest_prefix_length) - && specifier.starts_with(prefix) - && specifier.ends_with(suffix) - { - longest_prefix_length = prefix.len(); - longest_suffix_length = suffix.len(); - best_key.replace(key); - } - } - } - - best_key.and_then(|key| paths_map.get(key)).map_or_else(Vec::new, |paths| { - paths - .iter() - .map(|path| { - path.replace( - '*', - &specifier[longest_prefix_length - ..specifier.len() - longest_suffix_length], - ) - }) - .collect::>() - }) - }, - Clone::clone, - ); - - paths - .into_iter() - .map(|p| self.compiler_options.paths_base.normalize_with(p)) - .chain(base_url_iter) - .collect() - } - - fn base_path(&self) -> &Path { - self.compiler_options - .base_url - .as_ref() - .map_or_else(|| self.directory(), |path| path.as_ref()) - } - - /// Template variable `${configDir}` for substitution of config files directory path - /// - /// NOTE: All tests cases are just a head replacement of `${configDir}`, so we are constrained as such. - /// - /// See - fn substitute_template_variable(directory: &Path, path: &mut String) { - const TEMPLATE_VARIABLE: &str = "${configDir}/"; - if let Some(stripped_path) = path.strip_prefix(TEMPLATE_VARIABLE) { - *path = directory.join(stripped_path).to_string_lossy().to_string(); - } - } -} diff --git a/tests/integration_test.rs b/tests/integration_test.rs deleted file mode 100644 index d369413f..00000000 --- a/tests/integration_test.rs +++ /dev/null @@ -1,102 +0,0 @@ -//! Test public APIs - -use std::{env, path::PathBuf}; - -use oxc_resolver::{EnforceExtension, Resolution, ResolveContext, ResolveOptions, Resolver}; - -fn dir() -> PathBuf { - env::current_dir().unwrap() -} - -fn resolve(specifier: &str) -> Resolution { - let path = dir(); - Resolver::new(ResolveOptions::default()).resolve(path, specifier).unwrap() -} - -#[test] -fn clone() { - let resolution = resolve("./tests/package.json"); - assert_eq!(resolution.clone(), resolution); -} - -#[test] -fn debug() { - let resolution = resolve("./tests/package.json"); - let s = format!("{resolution:?}"); - assert!(!s.is_empty()); -} - -#[test] -fn eq() { - let resolution = resolve("./tests/package.json"); - assert_eq!(resolution, resolution); -} - -#[test] -fn package_json() { - let resolution = resolve("./tests/package.json"); - assert!(resolution - .package_json() - .is_some_and(|json| json.name.as_ref().is_some_and(|name| name == "name"))); -} - -#[cfg(feature = "package_json_raw_json_api")] -#[test] -fn package_json_raw_json_api() { - let resolution = resolve("./tests/package.json"); - assert!(resolution - .package_json() - .unwrap() - .raw_json() - .get("name") - .is_some_and(|name| name == "name")); -} - -#[test] -fn clear_cache() { - let resolver = Resolver::new(ResolveOptions::default()); - resolver.clear_cache(); // exists -} - -#[test] -fn options() { - let resolver = Resolver::new(ResolveOptions::default()); - let options = resolver.options(); - assert!(!format!("{options:?}").is_empty()); -} - -#[test] -fn debug_resolver() { - let resolver = Resolver::new(ResolveOptions::default()); - assert!(!format!("{resolver:?}").is_empty()); -} - -#[test] -fn dependencies() { - let path = dir(); - let mut ctx = ResolveContext::default(); - let _ = Resolver::new(ResolveOptions::default()).resolve_with_context( - path, - "./tests/package.json", - &mut ctx, - ); - assert!(!ctx.file_dependencies.is_empty()); - assert!(ctx.missing_dependencies.is_empty()); -} - -#[test] -fn options_api() { - _ = ResolveOptions::default() - .with_builtin_modules(true) - .with_condition_names(&[]) - .with_extension(".js") - .with_force_extension(EnforceExtension::Auto) - .with_fully_specified(true) - .with_main_field("asdf") - .with_main_file("main") - .with_module("module") - .with_prefer_absolute(true) - .with_prefer_relative(true) - .with_root(PathBuf::new()) - .with_symbolic_link(true); -} diff --git a/tests/package.json b/tests/package.json deleted file mode 100644 index f099adcf..00000000 --- a/tests/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "name": "name" -} diff --git a/tests/resolve_test.rs b/tests/resolve_test.rs deleted file mode 100644 index 554d707c..00000000 --- a/tests/resolve_test.rs +++ /dev/null @@ -1,104 +0,0 @@ -use std::{env, path::PathBuf}; - -use oxc_resolver::{ResolveError, ResolveOptions, Resolver}; - -fn dir() -> PathBuf { - env::current_dir().unwrap() -} - -#[test] -fn chinese() { - let dir = dir(); - let specifier = "./fixtures/misc/中文/中文.js"; - let resolution = Resolver::new(ResolveOptions::default()).resolve(&dir, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(dir.join("fixtures/misc/中文/中文.js")) - ); -} - -#[test] -fn styled_components() { - let dir = dir(); - let path = dir.join("fixtures/pnpm8"); - let module_path = path.join("node_modules/.pnpm/styled-components@6.1.1_react-dom@18.2.0_react@18.2.0/node_modules/styled-components"); - let specifier = "styled-components"; - - // cjs - let options = - ResolveOptions { alias_fields: vec![vec!["browser".into()]], ..ResolveOptions::default() }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/styled-components.browser.cjs.js")) - ); - - // esm - let options = ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - main_fields: vec!["module".into()], - ..ResolveOptions::default() - }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/styled-components.browser.esm.js")) - ); -} - -#[test] -fn axios() { - let dir = dir(); - let path = dir.join("fixtures/pnpm8"); - let module_path = path.join("node_modules/.pnpm/axios@1.6.2/node_modules/axios"); - let specifier = "axios"; - - // default - let options = ResolveOptions::default(); - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("index.js")) - ); - - // browser - let options = ResolveOptions { - condition_names: vec!["browser".into(), "require".into()], - ..ResolveOptions::default() - }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/browser/axios.cjs")) - ); - - // cjs - let options = ResolveOptions { - condition_names: vec!["node".into(), "require".into()], - ..ResolveOptions::default() - }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/node/axios.cjs")) - ); -} - -#[test] -fn postcss() { - let dir = dir(); - let path = dir.join("fixtures/pnpm8"); - let module_path = path.join("node_modules/postcss"); - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - // should ignore "path" - let resolution = resolver.resolve(&module_path, "path"); - assert_eq!(resolution, Err(ResolveError::Ignored(module_path.clone()))); - - // should ignore "./lib/terminal-highlight" - let resolution = resolver.resolve(&module_path, "./lib/terminal-highlight"); - assert_eq!(resolution, Err(ResolveError::Ignored(module_path.join("lib/terminal-highlight")))); -} From b371be9ff9f1511c6b910e85e2896a4817547442 Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Sat, 15 Jun 2024 17:47:36 +0300 Subject: [PATCH 25/82] squash! --- package.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index a431e48f..c80ccc19 100644 --- a/package.json +++ b/package.json @@ -16,9 +16,9 @@ }, "devDependencies": { "@napi-rs/cli": "^3.0.0-alpha.43", - "@napi-rs/wasm-runtime": "^0.2.0", - "@types/node": "^20.10.4", - "ava": "^6.0.1", - "emnapi": "^1.0.0" + "@napi-rs/wasm-runtime": "^0.2.4", + "@types/node": "^20.14.2", + "ava": "^6.1.3", + "emnapi": "^1.2.0" } } From 89fe8ab742d8805655e975526dfcc08185b949d9 Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Sun, 16 Jun 2024 16:43:40 +0300 Subject: [PATCH 26/82] squash! --- Cargo.lock | 858 ------ fixtures/enhanced_resolve/lib/index.js | 1 - fixtures/enhanced_resolve/package.json | 4 - fixtures/enhanced_resolve/test/.gitignore | 2 - .../enhanced_resolve/test/fixtures/#/a.js | 0 fixtures/enhanced_resolve/test/fixtures/a.js | 3 - .../enhanced_resolve/test/fixtures/abc.txt | 1 - .../test/fixtures/alias/files/a.js | 0 fixtures/enhanced_resolve/test/fixtures/b.js | 3 - .../browser-module/browser/module-a.js | 0 .../fixtures/browser-module/lib/browser.js | 0 .../fixtures/browser-module/lib/ignore.js | 0 .../test/fixtures/browser-module/lib/main.js | 0 .../fixtures/browser-module/lib/replaced.js | 0 .../test/fixtures/browser-module/lib/self.js | 0 .../fixtures/browser-module/lib/toString.js | 0 .../browser-module/node_modules/module-a.js | 0 .../browser-module/node_modules/module-b.js | 0 .../browser-module/node_modules/module-c.js | 0 .../node_modules/recursive-file/a.js | 0 .../node_modules/recursive-file/b.js | 0 .../node_modules/recursive-file/c.js | 0 .../node_modules/recursive-file/d.js | 0 .../node_modules/recursive-file/package.json | 8 - .../test/fixtures/browser-module/package.json | 33 - .../test/fixtures/builtins/package.json | 12 - fixtures/enhanced_resolve/test/fixtures/c.js | 4 - .../enhanced_resolve/test/fixtures/complex.js | 13 - .../test/fixtures/crypto-js/index.js | 0 .../test/fixtures/crypto-js/package.json | 7 - .../test/fixtures/decorated-fs/exists.js | 0 .../test/fixtures/dirOrFile.js | 1 - .../test/fixtures/dirOrFile/index.js | 1 - .../directory-default/directory-default.js | 0 .../node_modules/@org/pkg/dist/string.js | 1 - .../@org/pkg/dist/string.test.d.ts | 1 - .../node_modules/@org/pkg/package.json | 9 - .../node_modules/pkg/dist/string.js | 1 - .../node_modules/pkg/dist/string.test.d.ts | 1 - .../node_modules/pkg/package.json | 9 - .../node_modules/exports-field/package.json | 7 - .../node_modules/pack1/index.js | 0 .../test/fixtures/exports-field/a.js | 1 - .../node_modules/exports-field/lib/browser.js | 1 - .../node_modules/exports-field/lib/index.js | 0 .../exports-field/lib/lib2/main.js | 1 - .../node_modules/exports-field/lib/main.js | 1 - .../node_modules/exports-field/main.js | 1 - .../node_modules/exports-field/package.json | 18 - .../node_modules/exports-field/x.js | 1 - .../invalid-exports-field/index.js | 0 .../invalid-exports-field/package.json | 13 - .../node_modules/invalid-exports-field/umd.js | 0 .../test/fixtures/exports-field/package.json | 5 - .../node_modules/exports-field/index.js | 1 - .../node_modules/exports-field/lib/browser.js | 1 - .../exports-field/lib/lib2/main.js | 1 - .../node_modules/exports-field/lib/main.js | 1 - .../node_modules/exports-field/main.js | 1 - .../node_modules/exports-field/package.json | 17 - .../node_modules/exports-field/index | 0 .../node_modules/exports-field/main.js | 1 - .../node_modules/exports-field/package.json | 10 - .../node_modules/exports-field/src/index.js | 0 .../fixtures/extension-alias/dir/index.js | 0 .../fixtures/extension-alias/dir/index.ts | 0 .../fixtures/extension-alias/dir2/index.js | 0 .../fixtures/extension-alias/dir2/index.mts | 0 .../test/fixtures/extension-alias/index.js | 0 .../test/fixtures/extension-alias/index.mjs | 0 .../fixtures/extension-alias/index.mts.js | 0 .../test/fixtures/extension-alias/index.ts | 0 .../test/fixtures/extensions/app.module.js | 0 .../test/fixtures/extensions/dir/index.js | 0 .../test/fixtures/extensions/dir/index.ts | 0 .../test/fixtures/extensions/foo.js | 0 .../test/fixtures/extensions/foo.ts | 0 .../test/fixtures/extensions/index.js | 0 .../test/fixtures/extensions/index.ts | 0 .../extensions/node_modules/module.js | 0 .../extensions/node_modules/module/index.ts | 0 .../test/fixtures/extensions/package.json | 3 - .../enhanced_resolve/test/fixtures/file.load1 | 0 .../enhanced_resolve/test/fixtures/file.load2 | 0 .../test/fixtures/foo/index.js | 0 .../test/fixtures/foo/package.json | 4 - .../node_modules/m/package.json | 17 - .../node_modules/m/src/features/f.js | 0 .../m/src/features/internal/file.js | 0 .../node_modules/m/src/features/y/y.js | 0 .../node_modules/m/src/internal/i.js | 0 .../node_modules/m/src/middle-1/f.js | 0 .../node_modules/m/src/middle-1/nested/f.js | 0 .../node_modules/m/src/middle-2/nested/f.js | 1 - .../m/src/middle-3/nested/f/nested/f.js | 0 .../node_modules/m/src/middle-4/f/f.js | 0 .../node_modules/m/src/middle-5/f$/$.js | 0 .../node_modules/m/src/middle-5/f/$.js | 0 .../node_modules/m/src/middle/f.js | 0 .../node_modules/m/src/middle/nested/f.js | 0 .../test/fixtures/imports-field/a.js | 1 - .../test/fixtures/imports-field/b.js | 0 .../test/fixtures/imports-field/dir/b.js | 0 .../node_modules/a/lib/browser.js | 1 - .../imports-field/node_modules/a/lib/index.js | 0 .../node_modules/a/lib/lib2/main.js | 1 - .../imports-field/node_modules/a/lib/main.js | 1 - .../imports-field/node_modules/a/main.js | 1 - .../imports-field/node_modules/a/package.json | 18 - .../imports-field/node_modules/a/x.js | 1 - .../imports-field/node_modules/c/index.js | 0 .../test/fixtures/imports-field/package.json | 17 - .../fixtures/incorrect-package/pack1/a.js | 0 .../incorrect-package/pack1/package.json | 2 - .../fixtures/incorrect-package/pack2/a.js | 0 .../incorrect-package/pack2/package.json | 0 .../test/fixtures/issue-238/package.json | 3 - .../test/fixtures/issue-238/src/a/config.js | 0 .../src/common/config/myObjectFile.js | 0 .../enhanced_resolve/test/fixtures/lib.js | 0 .../test/fixtures/lib/complex1.js | 1 - .../test/fixtures/main-field-self/index.js | 0 .../fixtures/main-field-self/package.json | 3 - .../test/fixtures/main-field-self2/index.js | 0 .../fixtures/main-field-self2/package.json | 3 - .../enhanced_resolve/test/fixtures/main1.js | 9 - .../enhanced_resolve/test/fixtures/main2.js | 12 - .../enhanced_resolve/test/fixtures/main3.js | 4 - .../multiple_modules/node_modules/m1/a.js | 3 - .../test/fixtures/no#fragment/#/#.js | 0 fixtures/enhanced_resolve/test/fixtures/no.js | 0 .../browser-module-broken/browser.js | 0 .../browser-module-broken/main.js | 0 .../browser-module-broken/package.json | 4 - .../complexm/node_modules/m1/a.js | 1 - .../complexm/node_modules/m1/index.js | 1 - .../fixtures/node_modules/complexm/step1.js | 1 - .../fixtures/node_modules/complexm/step2.js | 1 - .../fixtures/node_modules/dash-name/index.js | 0 .../node_modules/dash-name/package.json | 4 - .../test/fixtures/node_modules/dash/index.js | 0 .../fixtures/node_modules/dash/package.json | 4 - .../invalidPackageJson/package.json | 0 .../test/fixtures/node_modules/m1/a.js | 3 - .../test/fixtures/node_modules/m1/b.js | 3 - .../test/fixtures/node_modules/m2/b.js | 1 - .../node_modules/recursive-module/file.js | 0 .../node_modules/recursive-module/index.js | 0 .../test/fixtures/pnp-a/m2/a.js | 3 - .../test/fixtures/pnp/pkg/dir/index.js | 0 .../test/fixtures/pnp/pkg/index.js | 0 .../test/fixtures/pnp/pkg/main.js | 0 .../fixtures/pnp/pkg/package-alias/browser.js | 0 .../fixtures/pnp/pkg/package-alias/index.js | 0 .../test/fixtures/pnp/pkg/package.json | 7 - .../test/fixtures/pnp/pkg/typescript/index.ts | 0 .../test/fixtures/pnp/pkg3/a.js | 1 - .../test/fixtures/pnp/pkg3/package.json | 8 - .../prefer-pnp/alternative-modules/m1/b.js | 0 .../restrictions/node_modules/pck1/index.css | 0 .../restrictions/node_modules/pck1/index.js | 0 .../node_modules/pck1/package.json | 3 - .../restrictions/node_modules/pck2/index.css | 0 .../restrictions/node_modules/pck2/module.js | 0 .../node_modules/pck2/package.json | 5 - .../test/fixtures/roots_fall_through/index.js | 0 .../scoped/node_modules/@scope/pack1/main.js | 0 .../node_modules/@scope/pack1/package.json | 5 - .../node_modules/@scope/pack2/lib/index.js | 0 .../scoped/node_modules/@scope/pack2/main.js | 0 .../node_modules/@scope/pack2/package.json | 3 - .../test/fixtures/shortcutdir.js/a.js | 0 .../test/fixtures/yield/a/foo-2/b | 0 .../test/fixtures/yield/a/foo-2/c | 0 .../test/fixtures/yield/a/foo/a | 0 .../test/fixtures/yield/a/foo/b | 0 .../test/fixtures/yield/b/foo/a | 0 .../test/fixtures/yield/c/foo/a | 0 .../test/fixtures/yield/c/foo/package.json | 7 - .../fixtures/\346\265\213\350\257\225.js" | 0 .../\344\270\255\346\226\207.js" | 0 fixtures/pnpm/.gitignore | 1 - fixtures/pnpm/package.json | 10 - fixtures/pnpm/pnpm-lock.yaml | 212 -- fixtures/tsconfig/cases/builtins/thing.js | 0 .../tsconfig/cases/builtins/tsconfig.json | 5 - fixtures/tsconfig/cases/exports/index.js | 0 fixtures/tsconfig/cases/exports/tsconfig.json | 3 - .../extends-extension/base-tsconfig.json | 7 - .../tsconfig/cases/extends-extension/foo.js | 0 .../cases/extends-extension/tsconfig.json | 3 - .../cases/extends-extensionless/foo.js | 0 .../cases/extends-extensionless/tsconfig.json | 3 - .../tsconfig/cases/extends-multiple/foo.js | 0 .../cases/extends-multiple/tsconfig.json | 6 - .../tsconfig/cases/extends-not-found/index.js | 0 .../cases/extends-not-found/tsconfig.json | 3 - .../tsconfig/cases/extends-paths/src/index.js | 0 .../cases/extends-paths/tsconfig.base.json | 7 - .../cases/extends-paths/tsconfig.json | 6 - fixtures/tsconfig/cases/field/index.js | 0 fixtures/tsconfig/cases/field/tsconfig.json | 3 - fixtures/tsconfig/cases/index/index.js | 0 fixtures/tsconfig/cases/index/tsconfig.json | 3 - .../cases/paths_template_variable/foo.js | 0 .../paths_template_variable/tsconfig1.json | 3 - .../paths_template_variable/tsconfig2.json | 8 - .../project_references/app/aliased/index.ts | 0 .../cases/project_references/app/index.ts | 0 .../project_references/app/tsconfig.json | 23 - .../project_a/aliased/index.ts | 0 .../project_references/project_a/conf.json | 8 - .../project_references/project_a/index.ts | 0 .../project_b/src/aliased/index.ts | 0 .../project_b/tsconfig.json | 9 - .../project_references/project_c/index.ts | 0 .../project_c/tsconfig.json | 5 - .../project_references/tsconfig.base.json | 4 - fixtures/tsconfig/cases/suffixes/a.ios.ts | 0 fixtures/tsconfig/cases/suffixes/a.ts | 0 fixtures/tsconfig/cases/suffixes/b.ts | 0 fixtures/tsconfig/cases/suffixes/c-test.ts | 0 fixtures/tsconfig/cases/suffixes/index.ts | 1 - .../tsconfig/cases/suffixes/tsconfig.json | 5 - fixtures/tsconfig/cases/trailing-comma/bar.js | 0 .../tsconfig/cases/trailing-comma/index.js | 0 .../cases/trailing-comma/tsconfig.json | 9 - fixtures/tsconfig/foo.js | 0 fixtures/tsconfig/nested/index.js | 0 fixtures/tsconfig/nested/test.js | 0 fixtures/tsconfig/nested/tsconfig.json | 8 - .../node_modules/tsconfig-exports/conf.json | 7 - .../node_modules/tsconfig-exports/foo.js | 0 .../tsconfig-exports/package.json | 7 - .../node_modules/tsconfig-field/conf.json | 7 - .../node_modules/tsconfig-field/foo.js | 0 .../node_modules/tsconfig-field/package.json | 5 - .../node_modules/tsconfig-index/foo.js | 0 .../node_modules/tsconfig-index/package.json | 4 - .../node_modules/tsconfig-index/tsconfig.json | 7 - .../node_modules/tsconfig-not-used/foo.js | 0 .../tsconfig-not-used/tsconfig.json | 7 - fixtures/tsconfig/package.json | 24 - fixtures/tsconfig/tsconfig.json | 7 - .../tsconfig/tsconfig_template_variable.json | 7 - napi/__test__/resolver.spec.mjs | 260 -- napi/src/lib.rs | 166 - napi/src/options.rs | 261 -- napi/tests/options.test.mjs | 59 - npm/package.json | 67 +- package.json | 53 +- pnpm-lock.yaml | 2684 ----------------- src/builtins.rs | 71 - src/cache.rs | 369 --- src/context.rs | 89 - src/error.rs | 160 - src/file_system.rs | 133 - src/lib.rs | 1670 ---------- src/options.rs | 623 ---- src/package_json.rs | 207 -- src/path.rs | 132 - src/resolution.rs | 92 - src/specifier.rs | 230 -- src/tests/alias.rs | 280 -- src/tests/browser_field.rs | 189 -- src/tests/builtins.rs | 121 - src/tests/dependencies.rs | 110 - src/tests/exports_field.rs | 2546 ---------------- src/tests/extension_alias.rs | 66 - src/tests/extensions.rs | 125 - src/tests/fallback.rs | 100 - src/tests/full_specified.rs | 113 - src/tests/imports_field.rs | 1320 -------- src/tests/incorrect_description_file.rs | 62 - src/tests/main_field.rs | 24 - src/tests/memory_fs.rs | 74 - src/tests/missing.rs | 106 - src/tests/mod.rs | 49 - src/tests/resolve.rs | 119 - src/tests/restrictions.rs | 25 - src/tests/roots.rs | 92 - src/tests/scoped_packages.rs | 25 - src/tests/simple.rs | 68 - src/tests/symlink.rs | 121 - src/tests/tsconfig_paths.rs | 507 ---- src/tests/tsconfig_project_references.rs | 101 - src/tsconfig.rs | 212 -- tests/integration_test.rs | 102 - tests/package.json | 3 - tests/resolve_test.rs | 104 - 290 files changed, 50 insertions(+), 15703 deletions(-) delete mode 100644 Cargo.lock delete mode 100644 fixtures/enhanced_resolve/lib/index.js delete mode 100644 fixtures/enhanced_resolve/package.json delete mode 100644 fixtures/enhanced_resolve/test/.gitignore delete mode 100644 fixtures/enhanced_resolve/test/fixtures/#/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/abc.txt delete mode 100644 fixtures/enhanced_resolve/test/fixtures/alias/files/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/browser/module-a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/ignore.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/replaced.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/self.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/toString.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-c.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/c.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/d.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/builtins/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/c.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/complex.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/crypto-js/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/decorated-fs/exists.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/dirOrFile.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/directory-default/directory-default.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/pack1/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/umd.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/index delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/src/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.mts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mjs delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mts.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/app.module.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/foo.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/foo.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/file.load1 delete mode 100644 fixtures/enhanced_resolve/test/fixtures/file.load2 delete mode 100644 fixtures/enhanced_resolve/test/fixtures/foo/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/foo/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/internal/file.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/y/y.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/internal/i.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-3/nested/f/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-4/f/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f$/$.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f/$.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/dir/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/c/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/issue-238/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/issue-238/src/a/config.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/issue-238/src/common/config/myObjectFile.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/lib.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/lib/complex1.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self2/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main1.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main2.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main3.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/no#fragment/#/#.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/no.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/invalidPackageJson/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/file.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/dir/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/typescript/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/prefer-pnp/alternative-modules/m1/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.css delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/index.css delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/module.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/roots_fall_through/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/lib/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/shortcutdir.js/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/b delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/c delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo/a delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo/b delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/b/foo/a delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/c/foo/a delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json delete mode 100644 "fixtures/enhanced_resolve/test/fixtures/\346\265\213\350\257\225.js" delete mode 100644 "fixtures/misc/\344\270\255\346\226\207/\344\270\255\346\226\207.js" delete mode 100644 fixtures/pnpm/.gitignore delete mode 100644 fixtures/pnpm/package.json delete mode 100644 fixtures/pnpm/pnpm-lock.yaml delete mode 100644 fixtures/tsconfig/cases/builtins/thing.js delete mode 100644 fixtures/tsconfig/cases/builtins/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/exports/index.js delete mode 100644 fixtures/tsconfig/cases/exports/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-extension/base-tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-extension/foo.js delete mode 100644 fixtures/tsconfig/cases/extends-extension/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-extensionless/foo.js delete mode 100644 fixtures/tsconfig/cases/extends-extensionless/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-multiple/foo.js delete mode 100644 fixtures/tsconfig/cases/extends-multiple/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-not-found/index.js delete mode 100644 fixtures/tsconfig/cases/extends-not-found/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-paths/src/index.js delete mode 100644 fixtures/tsconfig/cases/extends-paths/tsconfig.base.json delete mode 100644 fixtures/tsconfig/cases/extends-paths/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/field/index.js delete mode 100644 fixtures/tsconfig/cases/field/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/index/index.js delete mode 100644 fixtures/tsconfig/cases/index/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/paths_template_variable/foo.js delete mode 100644 fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json delete mode 100644 fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json delete mode 100644 fixtures/tsconfig/cases/project_references/app/aliased/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/app/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/app/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/project_references/project_a/aliased/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_a/conf.json delete mode 100644 fixtures/tsconfig/cases/project_references/project_a/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_b/src/aliased/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_b/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/project_references/project_c/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_c/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/project_references/tsconfig.base.json delete mode 100644 fixtures/tsconfig/cases/suffixes/a.ios.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/a.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/b.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/c-test.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/index.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/trailing-comma/bar.js delete mode 100644 fixtures/tsconfig/cases/trailing-comma/index.js delete mode 100644 fixtures/tsconfig/cases/trailing-comma/tsconfig.json delete mode 100644 fixtures/tsconfig/foo.js delete mode 100644 fixtures/tsconfig/nested/index.js delete mode 100644 fixtures/tsconfig/nested/test.js delete mode 100644 fixtures/tsconfig/nested/tsconfig.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-exports/conf.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-exports/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-exports/package.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-field/conf.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-field/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-field/package.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-index/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-index/package.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-not-used/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json delete mode 100755 fixtures/tsconfig/package.json delete mode 100644 fixtures/tsconfig/tsconfig.json delete mode 100644 fixtures/tsconfig/tsconfig_template_variable.json delete mode 100644 napi/__test__/resolver.spec.mjs delete mode 100644 napi/src/lib.rs delete mode 100644 napi/src/options.rs delete mode 100644 napi/tests/options.test.mjs delete mode 100644 pnpm-lock.yaml delete mode 100644 src/builtins.rs delete mode 100644 src/cache.rs delete mode 100644 src/context.rs delete mode 100644 src/error.rs delete mode 100644 src/file_system.rs delete mode 100644 src/lib.rs delete mode 100644 src/options.rs delete mode 100644 src/package_json.rs delete mode 100644 src/path.rs delete mode 100644 src/resolution.rs delete mode 100644 src/specifier.rs delete mode 100644 src/tests/alias.rs delete mode 100644 src/tests/browser_field.rs delete mode 100644 src/tests/builtins.rs delete mode 100644 src/tests/dependencies.rs delete mode 100644 src/tests/exports_field.rs delete mode 100644 src/tests/extension_alias.rs delete mode 100644 src/tests/extensions.rs delete mode 100644 src/tests/fallback.rs delete mode 100644 src/tests/full_specified.rs delete mode 100644 src/tests/imports_field.rs delete mode 100644 src/tests/incorrect_description_file.rs delete mode 100644 src/tests/main_field.rs delete mode 100644 src/tests/memory_fs.rs delete mode 100644 src/tests/missing.rs delete mode 100644 src/tests/mod.rs delete mode 100644 src/tests/resolve.rs delete mode 100644 src/tests/restrictions.rs delete mode 100644 src/tests/roots.rs delete mode 100644 src/tests/scoped_packages.rs delete mode 100644 src/tests/simple.rs delete mode 100644 src/tests/symlink.rs delete mode 100644 src/tests/tsconfig_paths.rs delete mode 100644 src/tests/tsconfig_project_references.rs delete mode 100644 src/tsconfig.rs delete mode 100644 tests/integration_test.rs delete mode 100644 tests/package.json delete mode 100644 tests/resolve_test.rs diff --git a/Cargo.lock b/Cargo.lock deleted file mode 100644 index 4ec5ea2f..00000000 --- a/Cargo.lock +++ /dev/null @@ -1,858 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "aho-corasick" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" -dependencies = [ - "memchr", -] - -[[package]] -name = "anes" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "735d4f398ca57cfa2880225c2bf81c3b9af3be5bb22e44ae70118dad38713e84" - -[[package]] -name = "autocfg" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "bitflags" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" - -[[package]] -name = "bpaf" -version = "0.9.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3280efcf6d66bc77c2cf9b67dc8acee47a217d9be67dd590b3230dffe663724d" - -[[package]] -name = "cast" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "ciborium" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42e69ffd6f0917f5c029256a24d0161db17cea3997d185db0d35926308770f0e" -dependencies = [ - "ciborium-io", - "ciborium-ll", - "serde", -] - -[[package]] -name = "ciborium-io" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05afea1e0a06c9be33d539b876f1ce3692f4afea2cb41f740e7743225ed1c757" - -[[package]] -name = "ciborium-ll" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57663b653d948a338bfb3eeba9bb2fd5fcfaecb9e199e87e1eda4d9e8b240fd9" -dependencies = [ - "ciborium-io", - "half", -] - -[[package]] -name = "clean-path" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aaa6b4b263a5d737e9bf6b7c09b72c41a5480aec4d7219af827f6564e950b6a5" - -[[package]] -name = "codspeed" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a104ac948e0188b921eb3fcbdd55dcf62e542df4c7ab7e660623f6288302089" -dependencies = [ - "colored", - "libc", - "serde_json", -] - -[[package]] -name = "colored" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbf2150cce219b664a8a70df7a1f933836724b503f8a413af9365b4dcc4d90b8" -dependencies = [ - "lazy_static", - "windows-sys 0.48.0", -] - -[[package]] -name = "convert_case" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec182b0ca2f35d8fc196cf3404988fd8b8c739a4d270ff118a398feb0cbec1ca" -dependencies = [ - "unicode-segmentation", -] - -[[package]] -name = "criterion2" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f22174bed309c964c1720148dfe793f285cc02fd8b13c91205d485f73468d94d" -dependencies = [ - "anes", - "bpaf", - "cast", - "ciborium", - "codspeed", - "colored", - "num-traits", - "oorandom", - "serde", - "serde_json", - "walkdir", -] - -[[package]] -name = "crossbeam-deque" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" -dependencies = [ - "crossbeam-epoch", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.9.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" -dependencies = [ - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" - -[[package]] -name = "crunchy" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" - -[[package]] -name = "ctor" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edb49164822f3ee45b17acd4a208cfc1251410cf0cad9a833234c9890774dd9f" -dependencies = [ - "quote", - "syn", -] - -[[package]] -name = "dashmap" -version = "5.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" -dependencies = [ - "cfg-if", - "hashbrown", - "lock_api", - "once_cell", - "parking_lot_core", -] - -[[package]] -name = "document-features" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef5282ad69563b5fc40319526ba27e0e7363d552a896f0297d54f767717f9b95" -dependencies = [ - "litrs", -] - -[[package]] -name = "dunce" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b" - -[[package]] -name = "either" -version = "1.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dca9240753cf90908d7e4aac30f630662b02aebaa1b58a3cadabdb23385b58b" - -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "filetime" -version = "0.2.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ee447700ac8aa0b2f2bd7bc4462ad686ba06baa6727ac149a2d6277f0d240fd" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall 0.4.1", - "windows-sys 0.52.0", -] - -[[package]] -name = "half" -version = "2.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dd08c532ae367adf81c312a4580bc67f1d0fe8bc9c460520283f4c0ff277888" -dependencies = [ - "cfg-if", - "crunchy", -] - -[[package]] -name = "hashbrown" -version = "0.14.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" - -[[package]] -name = "indexmap" -version = "2.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" -dependencies = [ - "equivalent", - "hashbrown", - "serde", -] - -[[package]] -name = "itoa" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" - -[[package]] -name = "json-strip-comments" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3d129799327c8f80861e467c59b825ba24c277dba6ad0d71a141dc98f9e04ee" - -[[package]] -name = "lazy_static" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" - -[[package]] -name = "libc" -version = "0.2.155" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" - -[[package]] -name = "libloading" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c2a198fb6b0eada2a8df47933734e6d35d350665a33a3593d7164fa52c75c19" -dependencies = [ - "cfg-if", - "windows-targets 0.48.5", -] - -[[package]] -name = "litrs" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4ce301924b7887e9d637144fdade93f9dfff9b60981d4ac161db09720d39aa5" - -[[package]] -name = "lock_api" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" -dependencies = [ - "autocfg", - "scopeguard", -] - -[[package]] -name = "memchr" -version = "2.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" - -[[package]] -name = "napi" -version = "2.16.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfc300228808a0e6aea5a58115c82889240bcf8dab16fc25ad675b33e454b368" -dependencies = [ - "bitflags 2.5.0", - "ctor", - "napi-derive", - "napi-sys", - "once_cell", - "serde", - "serde_json", -] - -[[package]] -name = "napi-build" -version = "2.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1c0f5d67ee408a4685b61f5ab7e58605c8ae3f2b4189f0127d804ff13d5560a" - -[[package]] -name = "napi-derive" -version = "2.16.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0e034ddf6155192cf83f267ede763fe6c164dfa9971585436b16173718d94c4" -dependencies = [ - "cfg-if", - "convert_case", - "napi-derive-backend", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "napi-derive-backend" -version = "1.0.67" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bff2c00437f3b3266391eb5e6aa25d0029187daf5caf05b8e3271468fb5ae73e" -dependencies = [ - "convert_case", - "once_cell", - "proc-macro2", - "quote", - "regex", - "semver", - "syn", -] - -[[package]] -name = "napi-sys" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "427802e8ec3a734331fec1035594a210ce1ff4dc5bc1950530920ab717964ea3" -dependencies = [ - "libloading", -] - -[[package]] -name = "normalize-path" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5438dd2b2ff4c6df6e1ce22d825ed2fa93ee2922235cc45186991717f0a892d" - -[[package]] -name = "num-traits" -version = "0.2.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" -dependencies = [ - "autocfg", -] - -[[package]] -name = "once_cell" -version = "1.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" - -[[package]] -name = "oorandom" -version = "11.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575" - -[[package]] -name = "oxc_napi_resolver" -version = "0.0.0" -dependencies = [ - "napi", - "napi-build", - "napi-derive", - "oxc_resolver", -] - -[[package]] -name = "oxc_resolver" -version = "1.8.1" -dependencies = [ - "criterion2", - "dashmap", - "document-features", - "dunce", - "json-strip-comments", - "normalize-path", - "once_cell", - "rayon", - "rustc-hash", - "serde", - "serde_json", - "thiserror", - "tracing", - "typescript_tsconfig_json", - "vfs", -] - -[[package]] -name = "parking_lot_core" -version = "0.9.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall 0.5.1", - "smallvec", - "windows-targets 0.52.5", -] - -[[package]] -name = "pin-project-lite" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" - -[[package]] -name = "proc-macro2" -version = "1.0.85" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22244ce15aa966053a896d1accb3a6e68469b97c7f33f284b99f0d576879fc23" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.36" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "rayon" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" -dependencies = [ - "either", - "rayon-core", -] - -[[package]] -name = "rayon-core" -version = "1.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" -dependencies = [ - "crossbeam-deque", - "crossbeam-utils", -] - -[[package]] -name = "redox_syscall" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" -dependencies = [ - "bitflags 1.3.2", -] - -[[package]] -name = "redox_syscall" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "469052894dcb553421e483e4209ee581a45100d31b4018de03e5a7ad86374a7e" -dependencies = [ - "bitflags 2.5.0", -] - -[[package]] -name = "regex" -version = "1.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" -dependencies = [ - "aho-corasick", - "memchr", - "regex-automata", - "regex-syntax", -] - -[[package]] -name = "regex-automata" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", -] - -[[package]] -name = "regex-syntax" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" - -[[package]] -name = "rustc-hash" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" - -[[package]] -name = "ryu" -version = "1.0.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" - -[[package]] -name = "same-file" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "scopeguard" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" - -[[package]] -name = "semver" -version = "1.0.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" - -[[package]] -name = "serde" -version = "1.0.203" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7253ab4de971e72fb7be983802300c30b5a7f0c2e56fab8abfc6a214307c0094" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.203" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "serde_json" -version = "1.0.117" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3" -dependencies = [ - "indexmap", - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "smallvec" -version = "1.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" - -[[package]] -name = "syn" -version = "2.0.66" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c42f3f41a2de00b01c0aaad383c5a45241efc8b2d1eda5661812fda5f3cdcff5" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "thiserror" -version = "1.0.61" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.61" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "tracing" -version = "0.1.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" -dependencies = [ - "pin-project-lite", - "tracing-attributes", - "tracing-core", -] - -[[package]] -name = "tracing-attributes" -version = "0.1.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "tracing-core" -version = "0.1.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" -dependencies = [ - "once_cell", -] - -[[package]] -name = "typescript_tsconfig_json" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7cc416eaf05297012ead9d192226fe9a92e9a20f64f8780efb9085aaae9b590" -dependencies = [ - "clean-path", - "indexmap", - "rustc-hash", - "serde", - "serde_json", -] - -[[package]] -name = "unicode-ident" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" - -[[package]] -name = "unicode-segmentation" -version = "1.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" - -[[package]] -name = "vfs" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "654cd097e182a71dbf899178e6b5662c2157dd0b8afd5975de18008f6fc173d1" -dependencies = [ - "filetime", -] - -[[package]] -name = "walkdir" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" -dependencies = [ - "same-file", - "winapi-util", -] - -[[package]] -name = "winapi-util" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b" -dependencies = [ - "windows-sys 0.52.0", -] - -[[package]] -name = "windows-sys" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" -dependencies = [ - "windows-targets 0.48.5", -] - -[[package]] -name = "windows-sys" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" -dependencies = [ - "windows-targets 0.52.5", -] - -[[package]] -name = "windows-targets" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" -dependencies = [ - "windows_aarch64_gnullvm 0.48.5", - "windows_aarch64_msvc 0.48.5", - "windows_i686_gnu 0.48.5", - "windows_i686_msvc 0.48.5", - "windows_x86_64_gnu 0.48.5", - "windows_x86_64_gnullvm 0.48.5", - "windows_x86_64_msvc 0.48.5", -] - -[[package]] -name = "windows-targets" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" -dependencies = [ - "windows_aarch64_gnullvm 0.52.5", - "windows_aarch64_msvc 0.52.5", - "windows_i686_gnu 0.52.5", - "windows_i686_gnullvm", - "windows_i686_msvc 0.52.5", - "windows_x86_64_gnu 0.52.5", - "windows_x86_64_gnullvm 0.52.5", - "windows_x86_64_msvc 0.52.5", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" - -[[package]] -name = "windows_i686_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" - -[[package]] -name = "windows_i686_gnu" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" - -[[package]] -name = "windows_i686_gnullvm" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" - -[[package]] -name = "windows_i686_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" - -[[package]] -name = "windows_i686_msvc" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" diff --git a/fixtures/enhanced_resolve/lib/index.js b/fixtures/enhanced_resolve/lib/index.js deleted file mode 100644 index 1e872e8f..00000000 --- a/fixtures/enhanced_resolve/lib/index.js +++ /dev/null @@ -1 +0,0 @@ -// mimic enhanced-resolved root directory structure diff --git a/fixtures/enhanced_resolve/package.json b/fixtures/enhanced_resolve/package.json deleted file mode 100644 index d1b845b5..00000000 --- a/fixtures/enhanced_resolve/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "enhanced-resolve", - "main": "lib/index.js" -} diff --git a/fixtures/enhanced_resolve/test/.gitignore b/fixtures/enhanced_resolve/test/.gitignore deleted file mode 100644 index bbbec5f4..00000000 --- a/fixtures/enhanced_resolve/test/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# created by symlink.rs -/temp diff --git a/fixtures/enhanced_resolve/test/fixtures/#/a.js b/fixtures/enhanced_resolve/test/fixtures/#/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/a.js b/fixtures/enhanced_resolve/test/fixtures/a.js deleted file mode 100644 index 896ffc6d..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/abc.txt b/fixtures/enhanced_resolve/test/fixtures/abc.txt deleted file mode 100644 index f2ba8f84..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/abc.txt +++ /dev/null @@ -1 +0,0 @@ -abc \ No newline at end of file diff --git a/fixtures/enhanced_resolve/test/fixtures/alias/files/a.js b/fixtures/enhanced_resolve/test/fixtures/alias/files/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/b.js b/fixtures/enhanced_resolve/test/fixtures/b.js deleted file mode 100644 index 11476340..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/b.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function b() { - return "This is b"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/browser/module-a.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/browser/module-a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/browser.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/ignore.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/ignore.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/replaced.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/replaced.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/self.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/self.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/toString.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/toString.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-a.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-b.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-c.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-c.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/a.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/b.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/c.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/c.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/d.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/d.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json deleted file mode 100644 index c13fe23b..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "browser": { - "a.js": "./a", - "./b.js": "./b", - "c.js": "./d.js", - "./d.js": "./c.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/package.json b/fixtures/enhanced_resolve/test/fixtures/browser-module/package.json deleted file mode 100644 index 19ff7739..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/browser-module/package.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "exports": { - "./lib/index.js": "./lib/index.js" - }, - "browser": { - "./lib/ignore.js": false, - "./lib/replaced.js": "./lib/browser", - "module-a": "./browser/module-a.js", - "module-b": "module-c", - "module-c": "module-c", - "./toString": "./lib/toString.js", - "./lib/main.js": "./lib/main.js", - "./main.js": "./lib/main.js", - "./lib/xyz.js": "./xyz.js", - "./xyz.js": "./lib/xyz.js", - "./lib/non-existent.js": "./lib/non-existent.js", - ".": false, - "./number": 1, - "./foo": "./lib/replaced.js?query" - }, - "innerBrowser1": { - "field": { - "browser": { - "./lib/main1.js": "./lib/main.js" - } - } - }, - "innerBrowser2": { - "browser": { - "./lib/main2.js": "./lib/replaced.js" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/builtins/package.json b/fixtures/enhanced_resolve/test/fixtures/builtins/package.json deleted file mode 100644 index 4a54ea96..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/builtins/package.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "name": "builtins", - "private": true, - "imports": { - "#fs": { - "default": "fs" - }, - "#http": { - "node": "node:http" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/c.js b/fixtures/enhanced_resolve/test/fixtures/c.js deleted file mode 100644 index e3aca8aa..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/c.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = function b() { - require("./a"); - return "This is c"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/complex.js b/fixtures/enhanced_resolve/test/fixtures/complex.js deleted file mode 100644 index 1f62db84..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/complex.js +++ /dev/null @@ -1,13 +0,0 @@ -var 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); diff --git a/fixtures/enhanced_resolve/test/fixtures/crypto-js/index.js b/fixtures/enhanced_resolve/test/fixtures/crypto-js/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json b/fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json deleted file mode 100644 index 1d31aa8b..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "crypto-js", - "main": "index.js", - "browser": { - "crypto": false - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/decorated-fs/exists.js b/fixtures/enhanced_resolve/test/fixtures/decorated-fs/exists.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/dirOrFile.js b/fixtures/enhanced_resolve/test/fixtures/dirOrFile.js deleted file mode 100644 index c3cb885f..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/dirOrFile.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "file"; diff --git a/fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js b/fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js deleted file mode 100644 index 85e01cd4..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "dir"; diff --git a/fixtures/enhanced_resolve/test/fixtures/directory-default/directory-default.js b/fixtures/enhanced_resolve/test/fixtures/directory-default/directory-default.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js deleted file mode 100644 index d1007aae..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js +++ /dev/null @@ -1 +0,0 @@ -export default "string"; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts deleted file mode 100644 index cb0ff5c3..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json deleted file mode 100644 index b523a1e9..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "@org/pkg", - "exports": { - "./*.js": { - "types": "./dist/*.d.ts", - "default": "./dist/*.js" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js deleted file mode 100644 index d1007aae..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js +++ /dev/null @@ -1 +0,0 @@ -export default "string"; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts deleted file mode 100644 index cb0ff5c3..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json deleted file mode 100644 index 8e55fb46..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "@raviqqe/hidash", - "exports": { - "./*.js": { - "types": "./dist/*.d.ts", - "default": "./dist/*.js" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json deleted file mode 100644 index f0edf449..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "exports-field", - "version": "1.0.0", - "exports": { - ".": "./a/../b/../../pack1/index.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/pack1/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/pack1/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/a.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/a.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json deleted file mode 100644 index 6b105c08..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "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/": { - "webpack": ["./lib/lib2/", "./lib/"], - "node": "./lib/", - "default": "./lib/" - }, - "./dist/a.js": "./../../a.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json deleted file mode 100644 index 0012a3de..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "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" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/umd.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/umd.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field/package.json deleted file mode 100644 index 5fa72bb5..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "@exports-field/core", - "version": "1.0.0", - "exports": "./a.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json deleted file mode 100644 index e6f12074..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "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/lib2/", "./lib/"], - "node": "./lib/", - "default": "./lib/" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/index b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/index deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json deleted file mode 100644 index 1a838f49..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "name": "exports-field", - "exportsField": { - "exports": "./main.js" - }, - "ex": "./index", - "broken": { - ".": "./src" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/src/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/src/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.ts b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.mts b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.mts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mjs b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mjs deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mts.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mts.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.ts b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/app.module.js b/fixtures/enhanced_resolve/test/fixtures/extensions/app.module.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.js b/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/foo.js b/fixtures/enhanced_resolve/test/fixtures/extensions/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/foo.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/foo.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/index.js b/fixtures/enhanced_resolve/test/fixtures/extensions/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/index.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module.js b/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module/index.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/package.json b/fixtures/enhanced_resolve/test/fixtures/extensions/package.json deleted file mode 100644 index 5e55a1e8..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/extensions/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "./index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/file.load1 b/fixtures/enhanced_resolve/test/fixtures/file.load1 deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/file.load2 b/fixtures/enhanced_resolve/test/fixtures/file.load2 deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/foo/index.js b/fixtures/enhanced_resolve/test/fixtures/foo/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/foo/package.json b/fixtures/enhanced_resolve/test/fixtures/foo/package.json deleted file mode 100644 index da86787a..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/foo/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "foo", - "version": "1.0.0" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json deleted file mode 100644 index aa2be496..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "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" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/internal/file.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/internal/file.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/y/y.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/y/y.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/internal/i.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/internal/i.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/nested/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js deleted file mode 100644 index e5b70a86..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = { nested: "nested" } diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-3/nested/f/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-3/nested/f/nested/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-4/f/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-4/f/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f$/$.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f$/$.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f/$.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f/$.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/nested/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/a.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/a.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/b.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/dir/b.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/dir/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/index.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json deleted file mode 100644 index 8d8d3a46..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "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/lib2/", "./lib/"], - "node": "./lib/", - "default": "./lib/" - }, - "./dist/a.js": "./../../a.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/c/index.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/c/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/imports-field/package.json deleted file mode 100644 index 248351a9..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "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" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/a.js b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json deleted file mode 100644 index ded7faa2..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json +++ /dev/null @@ -1,2 +0,0 @@ -{ - "main": "./a.js", diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/a.js b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/package.json b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/package.json deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/issue-238/package.json b/fixtures/enhanced_resolve/test/fixtures/issue-238/package.json deleted file mode 100644 index 352055cd..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/issue-238/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "private": true -} diff --git a/fixtures/enhanced_resolve/test/fixtures/issue-238/src/a/config.js b/fixtures/enhanced_resolve/test/fixtures/issue-238/src/a/config.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/issue-238/src/common/config/myObjectFile.js b/fixtures/enhanced_resolve/test/fixtures/issue-238/src/common/config/myObjectFile.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/lib.js b/fixtures/enhanced_resolve/test/fixtures/lib.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/lib/complex1.js b/fixtures/enhanced_resolve/test/fixtures/lib/complex1.js deleted file mode 100644 index b3de3d70..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/lib/complex1.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "lib complex1"; diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self/index.js b/fixtures/enhanced_resolve/test/fixtures/main-field-self/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json b/fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json deleted file mode 100644 index a2b6f341..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "./" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self2/index.js b/fixtures/enhanced_resolve/test/fixtures/main-field-self2/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json b/fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json deleted file mode 100644 index 4fa6f730..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "." -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main1.js b/fixtures/enhanced_resolve/test/fixtures/main1.js deleted file mode 100644 index 168f2a1e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main1.js +++ /dev/null @@ -1,9 +0,0 @@ -var a = require("./a"); -if (x) { - for (var i = 0; i < 100; i++) { - while (true) require("./b"); - do { - i++; - } while (require("m1/a")()); - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main2.js b/fixtures/enhanced_resolve/test/fixtures/main2.js deleted file mode 100644 index 39f062b1..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main2.js +++ /dev/null @@ -1,12 +0,0 @@ -var 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"); - }); - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main3.js b/fixtures/enhanced_resolve/test/fixtures/main3.js deleted file mode 100644 index 1c180166..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main3.js +++ /dev/null @@ -1,4 +0,0 @@ -var a = require("./a"); -require.ensure([], function(require) { - require("./c.js"); -}); diff --git a/fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js b/fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js deleted file mode 100644 index 997c1051..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is nested m1/a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/no#fragment/#/#.js b/fixtures/enhanced_resolve/test/fixtures/no#fragment/#/#.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/no.js b/fixtures/enhanced_resolve/test/fixtures/no.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/browser.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/browser.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/main.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json deleted file mode 100644 index c469e1fd..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "main": "./main.js", - "browser": "./browser.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js deleted file mode 100644 index 549620a5..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "the correct a.js"; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js deleted file mode 100644 index 5db6632e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = " :) " + require("m2/b.js"); diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js deleted file mode 100644 index d308569d..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require("m1/a") + require("m1"); diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js deleted file mode 100644 index cb8127e8..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "Step2"; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json deleted file mode 100644 index 8d6dfa56..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "dash-name", - "exports": "./index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json deleted file mode 100644 index 4fd8706e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "dash", - "exports": "./index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/invalidPackageJson/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/invalidPackageJson/package.json deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js deleted file mode 100644 index 46fc8e6c..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is m1/a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js deleted file mode 100644 index 8565c244..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is m1/b"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js deleted file mode 100644 index 34faaaf5..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "This is m2/b"; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/file.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/file.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js b/fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js deleted file mode 100644 index 997c1051..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is nested m1/a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/dir/index.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/dir/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/index.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/main.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/browser.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/browser.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/index.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json deleted file mode 100644 index e20ceaeb..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "main": "main.js", - "browser": { - "./package-alias/index.js": "./package-alias/browser.js", - "module": "pkg/dir/index" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/typescript/index.ts b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/typescript/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json deleted file mode 100644 index 4a1f838e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "@exports-field/core", - "version": "1.0.0", - "exports": { - ".": "./a.js", - "./x": "./a.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/prefer-pnp/alternative-modules/m1/b.js b/fixtures/enhanced_resolve/test/fixtures/prefer-pnp/alternative-modules/m1/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.css b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.css deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.js b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json deleted file mode 100644 index 14ab704d..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/index.css b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/index.css deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/module.js b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/module.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json deleted file mode 100644 index ee0eb71b..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "main": "../../../c.js", - "module": "module.js", - "style": "index.css" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/roots_fall_through/index.js b/fixtures/enhanced_resolve/test/fixtures/roots_fall_through/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/main.js b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json deleted file mode 100644 index 70a0f20f..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "browser": { - "./index.js": "./main.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/lib/index.js b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/lib/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/main.js b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json deleted file mode 100644 index 2af9e0d1..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "./main.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/shortcutdir.js/a.js b/fixtures/enhanced_resolve/test/fixtures/shortcutdir.js/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/b b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/b deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/c b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/c deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/a b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/a deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/b b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/b deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/b/foo/a b/fixtures/enhanced_resolve/test/fixtures/yield/b/foo/a deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/a b/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/a deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json b/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json deleted file mode 100644 index 0acc4b4c..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "foo", - "version": "1.0.0", - "browser": { - "./a": false - } -} diff --git "a/fixtures/enhanced_resolve/test/fixtures/\346\265\213\350\257\225.js" "b/fixtures/enhanced_resolve/test/fixtures/\346\265\213\350\257\225.js" deleted file mode 100644 index e69de29b..00000000 diff --git "a/fixtures/misc/\344\270\255\346\226\207/\344\270\255\346\226\207.js" "b/fixtures/misc/\344\270\255\346\226\207/\344\270\255\346\226\207.js" deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/pnpm/.gitignore b/fixtures/pnpm/.gitignore deleted file mode 100644 index 3c3629e6..00000000 --- a/fixtures/pnpm/.gitignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/fixtures/pnpm/package.json b/fixtures/pnpm/package.json deleted file mode 100644 index 78712e2b..00000000 --- a/fixtures/pnpm/package.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "name": "pnpm", - "version": "1.0.0", - "private": true, - "devDependencies": { - "axios": "1.6.2", - "styled-components": "6.1.1", - "postcss": "8.4.33" - } -} diff --git a/fixtures/pnpm/pnpm-lock.yaml b/fixtures/pnpm/pnpm-lock.yaml deleted file mode 100644 index e51dfd6a..00000000 --- a/fixtures/pnpm/pnpm-lock.yaml +++ /dev/null @@ -1,212 +0,0 @@ -lockfileVersion: '6.0' - -settings: - autoInstallPeers: true - excludeLinksFromLockfile: false - -devDependencies: - axios: - specifier: 1.6.2 - version: 1.6.2 - postcss: - specifier: 8.4.33 - version: 8.4.33 - styled-components: - specifier: 6.1.1 - version: 6.1.1(react-dom@18.2.0)(react@18.2.0) - -packages: - - /@emotion/is-prop-valid@1.2.1: - resolution: {integrity: sha512-61Mf7Ufx4aDxx1xlDeOm8aFFigGHE4z+0sKCa+IHCeZKiyP9RLD0Mmx7m8b9/Cf37f7NAvQOOJAbQQGVr5uERw==} - dependencies: - '@emotion/memoize': 0.8.1 - dev: true - - /@emotion/memoize@0.8.1: - resolution: {integrity: sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA==} - dev: true - - /@emotion/unitless@0.8.1: - resolution: {integrity: sha512-KOEGMu6dmJZtpadb476IsZBclKvILjopjUii3V+7MnXIQCYh8W3NgNcgwo21n9LXZX6EDIKvqfjYxXebDwxKmQ==} - dev: true - - /@types/stylis@4.2.4: - resolution: {integrity: sha512-36ZrGJ8fgtBr6nwNnuJ9jXIj+bn/pF6UoqmrQT7+Y99+tFFeHHsoR54+194dHdyhPjgbeoNz3Qru0oRt0l6ASQ==} - dev: true - - /asynckit@0.4.0: - resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} - dev: true - - /axios@1.6.2: - resolution: {integrity: sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A==} - dependencies: - follow-redirects: 1.15.3 - form-data: 4.0.0 - proxy-from-env: 1.1.0 - transitivePeerDependencies: - - debug - dev: true - - /camelize@1.0.1: - resolution: {integrity: sha512-dU+Tx2fsypxTgtLoE36npi3UqcjSSMNYfkqgmoEhtZrraP5VWq0K7FkWVTYa8eMPtnU/G2txVsfdCJTn9uzpuQ==} - dev: true - - /combined-stream@1.0.8: - resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} - engines: {node: '>= 0.8'} - dependencies: - delayed-stream: 1.0.0 - dev: true - - /css-color-keywords@1.0.0: - resolution: {integrity: sha512-FyyrDHZKEjXDpNJYvVsV960FiqQyXc/LlYmsxl2BcdMb2WPx0OGRVgTg55rPSyLSNMqP52R9r8geSp7apN3Ofg==} - engines: {node: '>=4'} - dev: true - - /css-to-react-native@3.2.0: - resolution: {integrity: sha512-e8RKaLXMOFii+02mOlqwjbD00KSEKqblnpO9e++1aXS1fPQOpS1YoqdVHBqPjHNoxeF2mimzVqawm2KCbEdtHQ==} - dependencies: - camelize: 1.0.1 - css-color-keywords: 1.0.0 - postcss-value-parser: 4.2.0 - dev: true - - /csstype@3.1.2: - resolution: {integrity: sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==} - dev: true - - /delayed-stream@1.0.0: - resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} - engines: {node: '>=0.4.0'} - dev: true - - /follow-redirects@1.15.3: - resolution: {integrity: sha512-1VzOtuEM8pC9SFU1E+8KfTjZyMztRsgEfwQl44z8A25uy13jSzTj6dyK2Df52iV0vgHCfBwLhDWevLn95w5v6Q==} - engines: {node: '>=4.0'} - peerDependencies: - debug: '*' - peerDependenciesMeta: - debug: - optional: true - dev: true - - /form-data@4.0.0: - resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==} - engines: {node: '>= 6'} - dependencies: - asynckit: 0.4.0 - combined-stream: 1.0.8 - mime-types: 2.1.35 - dev: true - - /js-tokens@4.0.0: - resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} - dev: true - - /loose-envify@1.4.0: - resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==} - hasBin: true - dependencies: - js-tokens: 4.0.0 - dev: true - - /mime-db@1.52.0: - resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} - engines: {node: '>= 0.6'} - dev: true - - /mime-types@2.1.35: - resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} - engines: {node: '>= 0.6'} - dependencies: - mime-db: 1.52.0 - dev: true - - /nanoid@3.3.7: - resolution: {integrity: sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==} - engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} - hasBin: true - dev: true - - /picocolors@1.0.0: - resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==} - dev: true - - /postcss-value-parser@4.2.0: - resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==} - dev: true - - /postcss@8.4.33: - resolution: {integrity: sha512-Kkpbhhdjw2qQs2O2DGX+8m5OVqEcbB9HRBvuYM9pgrjEFUg30A9LmXNlTAUj4S9kgtGyrMbTzVjH7E+s5Re2yg==} - engines: {node: ^10 || ^12 || >=14} - dependencies: - nanoid: 3.3.7 - picocolors: 1.0.0 - source-map-js: 1.0.2 - dev: true - - /proxy-from-env@1.1.0: - resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==} - dev: true - - /react-dom@18.2.0(react@18.2.0): - resolution: {integrity: sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==} - peerDependencies: - react: ^18.2.0 - dependencies: - loose-envify: 1.4.0 - react: 18.2.0 - scheduler: 0.23.0 - dev: true - - /react@18.2.0: - resolution: {integrity: sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==} - engines: {node: '>=0.10.0'} - dependencies: - loose-envify: 1.4.0 - dev: true - - /scheduler@0.23.0: - resolution: {integrity: sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw==} - dependencies: - loose-envify: 1.4.0 - dev: true - - /shallowequal@1.1.0: - resolution: {integrity: sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ==} - dev: true - - /source-map-js@1.0.2: - resolution: {integrity: sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==} - engines: {node: '>=0.10.0'} - dev: true - - /styled-components@6.1.1(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-cpZZP5RrKRIClBW5Eby4JM1wElLVP4NQrJbJ0h10TidTyJf4SIIwa3zLXOoPb4gJi8MsJ8mjq5mu2IrEhZIAcQ==} - engines: {node: '>= 16'} - peerDependencies: - react: '>= 16.8.0' - react-dom: '>= 16.8.0' - dependencies: - '@emotion/is-prop-valid': 1.2.1 - '@emotion/unitless': 0.8.1 - '@types/stylis': 4.2.4 - css-to-react-native: 3.2.0 - csstype: 3.1.2 - postcss: 8.4.33 - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - shallowequal: 1.1.0 - stylis: 4.3.0 - tslib: 2.6.2 - dev: true - - /stylis@4.3.0: - resolution: {integrity: sha512-E87pIogpwUsUwXw7dNyU4QDjdgVMy52m+XEOPEKUn161cCzWjjhPSQhByfd1CcNvrOLnXQ6OnnZDwnJrz/Z4YQ==} - dev: true - - /tslib@2.6.2: - resolution: {integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==} - dev: true diff --git a/fixtures/tsconfig/cases/builtins/thing.js b/fixtures/tsconfig/cases/builtins/thing.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/builtins/tsconfig.json b/fixtures/tsconfig/cases/builtins/tsconfig.json deleted file mode 100644 index 36aa1a4d..00000000 --- a/fixtures/tsconfig/cases/builtins/tsconfig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compilerOptions": { - "baseUrl": "." - } -} diff --git a/fixtures/tsconfig/cases/exports/index.js b/fixtures/tsconfig/cases/exports/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/exports/tsconfig.json b/fixtures/tsconfig/cases/exports/tsconfig.json deleted file mode 100644 index f0e3159b..00000000 --- a/fixtures/tsconfig/cases/exports/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-exports" -} diff --git a/fixtures/tsconfig/cases/extends-extension/base-tsconfig.json b/fixtures/tsconfig/cases/extends-extension/base-tsconfig.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/cases/extends-extension/base-tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/cases/extends-extension/foo.js b/fixtures/tsconfig/cases/extends-extension/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-extension/tsconfig.json b/fixtures/tsconfig/cases/extends-extension/tsconfig.json deleted file mode 100644 index 0ae4c6a3..00000000 --- a/fixtures/tsconfig/cases/extends-extension/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./base-tsconfig" -} diff --git a/fixtures/tsconfig/cases/extends-extensionless/foo.js b/fixtures/tsconfig/cases/extends-extensionless/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-extensionless/tsconfig.json b/fixtures/tsconfig/cases/extends-extensionless/tsconfig.json deleted file mode 100644 index c36cb7d4..00000000 --- a/fixtures/tsconfig/cases/extends-extensionless/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-field/conf" -} diff --git a/fixtures/tsconfig/cases/extends-multiple/foo.js b/fixtures/tsconfig/cases/extends-multiple/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-multiple/tsconfig.json b/fixtures/tsconfig/cases/extends-multiple/tsconfig.json deleted file mode 100644 index aa2ae783..00000000 --- a/fixtures/tsconfig/cases/extends-multiple/tsconfig.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": ["../extends-extension", "../extends-paths"], - "compilerOptions": { - "baseUrl": ".", - }, -} diff --git a/fixtures/tsconfig/cases/extends-not-found/index.js b/fixtures/tsconfig/cases/extends-not-found/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-not-found/tsconfig.json b/fixtures/tsconfig/cases/extends-not-found/tsconfig.json deleted file mode 100644 index 99df91da..00000000 --- a/fixtures/tsconfig/cases/extends-not-found/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./not-found" -} diff --git a/fixtures/tsconfig/cases/extends-paths/src/index.js b/fixtures/tsconfig/cases/extends-paths/src/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-paths/tsconfig.base.json b/fixtures/tsconfig/cases/extends-paths/tsconfig.base.json deleted file mode 100644 index 5c64b067..00000000 --- a/fixtures/tsconfig/cases/extends-paths/tsconfig.base.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "@/*": ["./*"] - } - } -} diff --git a/fixtures/tsconfig/cases/extends-paths/tsconfig.json b/fixtures/tsconfig/cases/extends-paths/tsconfig.json deleted file mode 100644 index 51086018..00000000 --- a/fixtures/tsconfig/cases/extends-paths/tsconfig.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": "./tsconfig.base.json", - "compilerOptions": { - "baseUrl": "src", - }, -} diff --git a/fixtures/tsconfig/cases/field/index.js b/fixtures/tsconfig/cases/field/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/field/tsconfig.json b/fixtures/tsconfig/cases/field/tsconfig.json deleted file mode 100644 index 9f86c3f4..00000000 --- a/fixtures/tsconfig/cases/field/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-field" -} diff --git a/fixtures/tsconfig/cases/index/index.js b/fixtures/tsconfig/cases/index/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/index/tsconfig.json b/fixtures/tsconfig/cases/index/tsconfig.json deleted file mode 100644 index d20b1774..00000000 --- a/fixtures/tsconfig/cases/index/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-index" -} diff --git a/fixtures/tsconfig/cases/paths_template_variable/foo.js b/fixtures/tsconfig/cases/paths_template_variable/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json b/fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json deleted file mode 100644 index a1a37bb6..00000000 --- a/fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "../../tsconfig_template_variable.json" -} diff --git a/fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json b/fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json deleted file mode 100644 index e7d8e5e5..00000000 --- a/fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "compilerOptions": { - "composite": true, - "paths": { - "foo": ["${configDir}/foo.js"] - } - } -} diff --git a/fixtures/tsconfig/cases/project_references/app/aliased/index.ts b/fixtures/tsconfig/cases/project_references/app/aliased/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/app/index.ts b/fixtures/tsconfig/cases/project_references/app/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/app/tsconfig.json b/fixtures/tsconfig/cases/project_references/app/tsconfig.json deleted file mode 100644 index 7036d2bb..00000000 --- a/fixtures/tsconfig/cases/project_references/app/tsconfig.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "extends": "../tsconfig.base.json", - "compilerOptions": { - "baseUrl": "./", - "paths": { - "@/*": ["./aliased/*"] - } - }, - "references": [ - { - "path": "../project_a/conf.json" - }, - { - "path": "../project_b" - }, - { - "path": "../project_c/tsconfig.json" - }, - { - "path": "../../paths_template_variable/tsconfig2.json" - } - ] -} diff --git a/fixtures/tsconfig/cases/project_references/project_a/aliased/index.ts b/fixtures/tsconfig/cases/project_references/project_a/aliased/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_a/conf.json b/fixtures/tsconfig/cases/project_references/project_a/conf.json deleted file mode 100644 index 4d389d7a..00000000 --- a/fixtures/tsconfig/cases/project_references/project_a/conf.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "compilerOptions": { - "composite": true, - "paths": { - "@/*": ["./aliased/*"] - } - } -} diff --git a/fixtures/tsconfig/cases/project_references/project_a/index.ts b/fixtures/tsconfig/cases/project_references/project_a/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_b/src/aliased/index.ts b/fixtures/tsconfig/cases/project_references/project_b/src/aliased/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_b/tsconfig.json b/fixtures/tsconfig/cases/project_references/project_b/tsconfig.json deleted file mode 100644 index 4ab05cd8..00000000 --- a/fixtures/tsconfig/cases/project_references/project_b/tsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "compilerOptions": { - "composite": true, - "baseUrl": "./src", - "paths": { - "@/*": ["./aliased/*"] - } - } -} diff --git a/fixtures/tsconfig/cases/project_references/project_c/index.ts b/fixtures/tsconfig/cases/project_references/project_c/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_c/tsconfig.json b/fixtures/tsconfig/cases/project_references/project_c/tsconfig.json deleted file mode 100644 index fe520939..00000000 --- a/fixtures/tsconfig/cases/project_references/project_c/tsconfig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compilerOptions": { - "composite": true - } -} diff --git a/fixtures/tsconfig/cases/project_references/tsconfig.base.json b/fixtures/tsconfig/cases/project_references/tsconfig.base.json deleted file mode 100644 index 88ccffe7..00000000 --- a/fixtures/tsconfig/cases/project_references/tsconfig.base.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "compilerOptions": { - } -} diff --git a/fixtures/tsconfig/cases/suffixes/a.ios.ts b/fixtures/tsconfig/cases/suffixes/a.ios.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/a.ts b/fixtures/tsconfig/cases/suffixes/a.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/b.ts b/fixtures/tsconfig/cases/suffixes/b.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/c-test.ts b/fixtures/tsconfig/cases/suffixes/c-test.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/index.ts b/fixtures/tsconfig/cases/suffixes/index.ts deleted file mode 100644 index b09939b9..00000000 --- a/fixtures/tsconfig/cases/suffixes/index.ts +++ /dev/null @@ -1 +0,0 @@ -import './a'; diff --git a/fixtures/tsconfig/cases/suffixes/tsconfig.json b/fixtures/tsconfig/cases/suffixes/tsconfig.json deleted file mode 100644 index 4c2ccc8f..00000000 --- a/fixtures/tsconfig/cases/suffixes/tsconfig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compilerOptions": { - "moduleSuffixes": [".ios", "-test", ""] - } -} diff --git a/fixtures/tsconfig/cases/trailing-comma/bar.js b/fixtures/tsconfig/cases/trailing-comma/bar.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/trailing-comma/index.js b/fixtures/tsconfig/cases/trailing-comma/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/trailing-comma/tsconfig.json b/fixtures/tsconfig/cases/trailing-comma/tsconfig.json deleted file mode 100644 index 6dc20ca5..00000000 --- a/fixtures/tsconfig/cases/trailing-comma/tsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "compilerOptions": { - "paths": { - /* some comment */ - "foo": ["bar.js"], - }, - }, - // another comment -} diff --git a/fixtures/tsconfig/foo.js b/fixtures/tsconfig/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/nested/index.js b/fixtures/tsconfig/nested/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/nested/test.js b/fixtures/tsconfig/nested/test.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/nested/tsconfig.json b/fixtures/tsconfig/nested/tsconfig.json deleted file mode 100644 index 6deb3011..00000000 --- a/fixtures/tsconfig/nested/tsconfig.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "extends": "..", - "compilerOptions": { - "paths": { - "ts-path": ["test.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-exports/conf.json b/fixtures/tsconfig/node_modules/tsconfig-exports/conf.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-exports/conf.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-exports/foo.js b/fixtures/tsconfig/node_modules/tsconfig-exports/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-exports/package.json b/fixtures/tsconfig/node_modules/tsconfig-exports/package.json deleted file mode 100644 index be0ddee6..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-exports/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "tsconfig-exports", - "private": true, - "exports": { - ".": "./conf.json" - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-field/conf.json b/fixtures/tsconfig/node_modules/tsconfig-field/conf.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-field/conf.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-field/foo.js b/fixtures/tsconfig/node_modules/tsconfig-field/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-field/package.json b/fixtures/tsconfig/node_modules/tsconfig-field/package.json deleted file mode 100644 index 7138fdde..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-field/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "tsconfig-field", - "private": true, - "tsconfig": "conf.json" -} \ No newline at end of file diff --git a/fixtures/tsconfig/node_modules/tsconfig-index/foo.js b/fixtures/tsconfig/node_modules/tsconfig-index/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-index/package.json b/fixtures/tsconfig/node_modules/tsconfig-index/package.json deleted file mode 100644 index eb2431e7..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-index/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "tsconfig-index", - "private": true -} \ No newline at end of file diff --git a/fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json b/fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-not-used/foo.js b/fixtures/tsconfig/node_modules/tsconfig-not-used/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json b/fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json deleted file mode 100644 index eb16d127..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "ts-path": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/package.json b/fixtures/tsconfig/package.json deleted file mode 100755 index f48acd1c..00000000 --- a/fixtures/tsconfig/package.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "name": "resolver", - "private": true, - "alias": { - "aliased": "foo", - "aliased-file": "./bar.js", - "something": "./nested/test.js", - "aliasedfolder": "./nested", - "aliasedabsolute": "/nested", - "foo/bar": "./bar.js", - "glob/*/*": "./nested/$2", - "./baz": "./bar.js", - "url": false - }, - "imports": { - "#test": "./bar.js" - }, - "dependencies": { - "foo": "^0.3.4" - }, - "peerDependencies": { - "bar": "*" - } -} diff --git a/fixtures/tsconfig/tsconfig.json b/fixtures/tsconfig/tsconfig.json deleted file mode 100644 index eb16d127..00000000 --- a/fixtures/tsconfig/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "ts-path": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/tsconfig_template_variable.json b/fixtures/tsconfig/tsconfig_template_variable.json deleted file mode 100644 index 6f272344..00000000 --- a/fixtures/tsconfig/tsconfig_template_variable.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["${configDir}/foo.js"] - } - } -} diff --git a/napi/__test__/resolver.spec.mjs b/napi/__test__/resolver.spec.mjs deleted file mode 100644 index ac6ee0ef..00000000 --- a/napi/__test__/resolver.spec.mjs +++ /dev/null @@ -1,260 +0,0 @@ -import { join } from 'node:path' -import { fileURLToPath } from 'node:url' - -import test from 'ava' - -let ResolverFactory - -if (process.env.WASI_TEST) { - const wasi = await import('../resolver.wasi.cjs') - ResolverFactory = wasi.ResolverFactory -} else { - const napi = await import('../index.js') - ResolverFactory = napi.ResolverFactory -} - -const currentDir = join(fileURLToPath(import.meta.url), '..') - -const enhancedResolveRoot = join( - currentDir, - '..', - '..', - 'fixtures', - 'enhanced_resolve', - 'test', - 'fixtures' -) - -// https://github.com/webpack/enhanced-resolve/blob/main/test/resolve.test.js - -for (const [title, context, request, expected] of [ - [ - 'absolute path', - enhancedResolveRoot, - join(enhancedResolveRoot, 'main1.js'), - join(enhancedResolveRoot, 'main1.js'), - ], - [ - 'file with .js', - enhancedResolveRoot, - './main1.js', - join(enhancedResolveRoot, 'main1.js'), - ], - [ - 'file without extension', - enhancedResolveRoot, - './main1', - join(enhancedResolveRoot, 'main1.js'), - ], - [ - 'another file with .js', - enhancedResolveRoot, - './a.js', - join(enhancedResolveRoot, 'a.js'), - ], - [ - 'another file without extension', - enhancedResolveRoot, - './a', - join(enhancedResolveRoot, 'a.js'), - ], - [ - 'file in module with .js', - enhancedResolveRoot, - 'm1/a.js', - join(enhancedResolveRoot, 'node_modules/m1/a.js'), - ], - [ - 'file in module without extension', - enhancedResolveRoot, - 'm1/a', - join(enhancedResolveRoot, 'node_modules/m1/a.js'), - ], - [ - 'another file in module without extension', - enhancedResolveRoot, - 'complexm/step1', - join(enhancedResolveRoot, 'node_modules/complexm/step1.js'), - ], - [ - 'from submodule to file in sibling module', - join(enhancedResolveRoot, 'node_modules/complexm'), - 'm2/b.js', - join(enhancedResolveRoot, 'node_modules/m2/b.js'), - ], - [ - 'from nested directory to overwritten file in module', - join(enhancedResolveRoot, 'multiple_modules'), - 'm1/a.js', - join(enhancedResolveRoot, 'multiple_modules/node_modules/m1/a.js'), - ], - [ - 'from nested directory to not overwritten file in module', - join(enhancedResolveRoot, 'multiple_modules'), - 'm1/b.js', - join(enhancedResolveRoot, 'node_modules/m1/b.js'), - ], - [ - 'file with query', - enhancedResolveRoot, - './main1.js?query', - join(enhancedResolveRoot, 'main1.js?query'), - ], - [ - 'file with fragment', - enhancedResolveRoot, - './main1.js#fragment', - join(enhancedResolveRoot, 'main1.js#fragment'), - ], - [ - 'file with fragment and query', - enhancedResolveRoot, - './main1.js#fragment?query', - join(enhancedResolveRoot, 'main1.js#fragment?query'), - ], - [ - 'file with query and fragment', - enhancedResolveRoot, - './main1.js?#fragment', - join(enhancedResolveRoot, 'main1.js?#fragment'), - ], - - [ - 'file with query (unicode)', - enhancedResolveRoot, - './测试.js?query', - join(enhancedResolveRoot, '测试.js?query'), - ], - [ - 'file with fragment (unicode)', - enhancedResolveRoot, - './测试.js#fragment', - join(enhancedResolveRoot, '测试.js#fragment'), - ], - [ - 'file with fragment and query (unicode)', - enhancedResolveRoot, - './测试.js#fragment?query', - join(enhancedResolveRoot, '测试.js#fragment?query'), - ], - [ - 'file with query and fragment (unicode)', - enhancedResolveRoot, - './测试.js?#fragment', - join(enhancedResolveRoot, '测试.js?#fragment'), - ], - - [ - 'file in module with query', - enhancedResolveRoot, - 'm1/a?query', - join(enhancedResolveRoot, 'node_modules/m1/a.js?query'), - ], - [ - 'file in module with fragment', - enhancedResolveRoot, - 'm1/a#fragment', - join(enhancedResolveRoot, 'node_modules/m1/a.js#fragment'), - ], - [ - 'file in module with fragment and query', - enhancedResolveRoot, - 'm1/a#fragment?query', - join(enhancedResolveRoot, 'node_modules/m1/a.js#fragment?query'), - ], - [ - 'file in module with query and fragment', - enhancedResolveRoot, - 'm1/a?#fragment', - join(enhancedResolveRoot, 'node_modules/m1/a.js?#fragment'), - ], - [ - 'differ between directory and file, resolve file', - enhancedResolveRoot, - './dirOrFile', - join(enhancedResolveRoot, 'dirOrFile.js'), - ], - [ - 'differ between directory and file, resolve directory', - enhancedResolveRoot, - './dirOrFile/', - join(enhancedResolveRoot, 'dirOrFile/index.js'), - ], - [ - 'find node_modules outside of node_modules', - join(enhancedResolveRoot, 'browser-module/node_modules'), - 'm1/a', - join(enhancedResolveRoot, 'node_modules/m1/a.js'), - ], - [ - "don't crash on main field pointing to self", - enhancedResolveRoot, - './main-field-self', - join(enhancedResolveRoot, './main-field-self/index.js'), - ], - [ - "don't crash on main field pointing to self (2)", - enhancedResolveRoot, - './main-field-self2', - join(enhancedResolveRoot, './main-field-self2/index.js'), - ], - // enhanced-resolve has `#` prepended with a `\0`, they are removed from the - // following 3 expected test results. - // See https://github.com/webpack/enhanced-resolve#escaping - [ - 'handle fragment edge case (no fragment)', - enhancedResolveRoot, - './no#fragment/#/#', - join(enhancedResolveRoot, 'no#fragment', '#', '#.js'), - ], - [ - 'handle fragment edge case (fragment)', - enhancedResolveRoot, - './no#fragment/#/', - join(enhancedResolveRoot, 'no.js#fragment') + '/#/', - ], - [ - 'handle fragment escaping', - enhancedResolveRoot, - './no\0#fragment/\0#/\0##fragment', - join(enhancedResolveRoot, 'no#fragment', '#', '#.js#fragment'), - ], -]) { - test(title, (t) => { - const resolver = new ResolverFactory({ - modules: ['src/a', 'src/b', 'src/common', 'node_modules'], - extensions: ['.js', '.jsx', '.ts', '.tsx'], - }) - - t.is(resolver.sync(context, request).path, expected) - }) -} - -test('resolve pnpm package', (t) => { - const rootDir = join(currentDir, '..', '..'); - const pnpmProjectPath = join(rootDir, 'fixtures', 'pnpm') - const resolver = new ResolverFactory({ - aliasFields: ['browser'], - }) - t.deepEqual(resolver.sync(pnpmProjectPath, 'styled-components'), { - path: join( - rootDir, - 'node_modules/.pnpm/styled-components@6.1.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/styled-components/dist/styled-components.browser.cjs.js' - ), - }) - t.deepEqual( - resolver.sync( - join( - rootDir, - 'node_modules/.pnpm/styled-components@6.1.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/styled-components' - ), - 'react' - ), - { - path: join( - rootDir, - 'node_modules/.pnpm/react@18.3.1/node_modules/react/index.js' - ), - } - ) -}) diff --git a/napi/src/lib.rs b/napi/src/lib.rs deleted file mode 100644 index 238f99c4..00000000 --- a/napi/src/lib.rs +++ /dev/null @@ -1,166 +0,0 @@ -extern crate napi; -extern crate napi_derive; -extern crate oxc_resolver; - -use std::path::{Path, PathBuf}; - -use napi_derive::napi; -use oxc_resolver::{ResolveOptions, Resolver}; - -use self::options::{NapiResolveOptions, StrOrStrList}; - -mod options; - -#[napi(object)] -pub struct ResolveResult { - pub path: Option, - pub error: Option, -} - -fn resolve(resolver: &Resolver, path: &Path, request: &str) -> ResolveResult { - match resolver.resolve(path, request) { - Ok(resolution) => ResolveResult { - path: Some(resolution.full_path().to_string_lossy().to_string()), - error: None, - }, - Err(err) => ResolveResult { path: None, error: Some(err.to_string()) }, - } -} - -#[allow(clippy::needless_pass_by_value)] -#[napi] -pub fn sync(path: String, request: String) -> ResolveResult { - let path = PathBuf::from(path); - let resolver = Resolver::new(ResolveOptions::default()); - resolve(&resolver, &path, &request) -} - -#[napi] -pub struct ResolverFactory { - resolver: Resolver, -} - -#[napi] -impl ResolverFactory { - #[napi(constructor)] - pub fn new(options: NapiResolveOptions) -> Self { - Self { resolver: Resolver::new(Self::normalize_options(options)) } - } - - #[napi] - pub fn default() -> Self { - let default_options = ResolveOptions::default(); - Self { resolver: Resolver::new(default_options) } - } - - /// Clone the resolver using the same underlying cache. - #[napi] - pub fn clone_with_options(&self, options: NapiResolveOptions) -> Self { - Self { resolver: self.resolver.clone_with_options(Self::normalize_options(options)) } - } - - /// Clear the underlying cache. - #[napi] - pub fn clear_cache(&self) { - self.resolver.clear_cache(); - } - - #[allow(clippy::needless_pass_by_value)] - #[napi] - pub fn sync(&self, path: String, request: String) -> ResolveResult { - let path = PathBuf::from(path); - resolve(&self.resolver, &path, &request) - } - - fn normalize_options(op: NapiResolveOptions) -> ResolveOptions { - let default = ResolveOptions::default(); - // merging options - ResolveOptions { - tsconfig: op.tsconfig.map(|tsconfig| tsconfig.into()), - alias: op - .alias - .map(|alias| { - alias - .into_iter() - .map(|(k, v)| { - let v = v - .into_iter() - .map(|item| match item { - Some(path) => oxc_resolver::AliasValue::from(path), - None => oxc_resolver::AliasValue::Ignore, - }) - .collect(); - (k, v) - }) - .collect::>() - }) - .unwrap_or(default.alias), - alias_fields: op - .alias_fields - .map(|o| o.into_iter().map(|x| StrOrStrList(x).into()).collect::>()) - .unwrap_or(default.alias_fields), - condition_names: op.condition_names.unwrap_or(default.condition_names), - description_files: op.description_files.unwrap_or(default.description_files), - enforce_extension: op - .enforce_extension - .map(|enforce_extension| enforce_extension.into()) - .unwrap_or(default.enforce_extension), - exports_fields: op - .exports_fields - .map(|o| o.into_iter().map(|x| StrOrStrList(x).into()).collect::>()) - .unwrap_or(default.exports_fields), - imports_fields: op - .imports_fields - .map(|o| o.into_iter().map(|x| StrOrStrList(x).into()).collect::>()) - .unwrap_or(default.imports_fields), - extension_alias: op - .extension_alias - .map(|extension_alias| extension_alias.into_iter().collect::>()) - .unwrap_or(default.extension_alias), - extensions: op.extensions.unwrap_or(default.extensions), - fallback: op - .fallback - .map(|fallback| { - fallback - .into_iter() - .map(|(k, v)| { - let v = v - .into_iter() - .map(|item| match item { - Some(path) => oxc_resolver::AliasValue::from(path), - None => oxc_resolver::AliasValue::Ignore, - }) - .collect(); - (k, v) - }) - .collect::>() - }) - .unwrap_or(default.fallback), - fully_specified: op.fully_specified.unwrap_or(default.fully_specified), - main_fields: op - .main_fields - .map(|o| StrOrStrList(o).into()) - .unwrap_or(default.main_fields), - main_files: op.main_files.unwrap_or(default.main_files), - modules: op.modules.map(|o| StrOrStrList(o).into()).unwrap_or(default.modules), - resolve_to_context: op.resolve_to_context.unwrap_or(default.resolve_to_context), - prefer_relative: op.prefer_relative.unwrap_or(default.prefer_relative), - prefer_absolute: op.prefer_absolute.unwrap_or(default.prefer_absolute), - restrictions: op - .restrictions - .map(|restrictions| { - restrictions - .into_iter() - .map(|restriction| restriction.into()) - .collect::>() - }) - .unwrap_or(default.restrictions), - roots: op - .roots - .map(|roots| roots.into_iter().map(PathBuf::from).collect::>()) - .unwrap_or(default.roots), - symlinks: op.symlinks.unwrap_or(default.symlinks), - builtin_modules: op.builtin_modules.unwrap_or(default.builtin_modules), - } - } -} diff --git a/napi/src/options.rs b/napi/src/options.rs deleted file mode 100644 index ea35672f..00000000 --- a/napi/src/options.rs +++ /dev/null @@ -1,261 +0,0 @@ -use std::path::PathBuf; - -use napi::Either; -use napi_derive::napi; -use std::collections::HashMap; - -/// Module Resolution Options -/// -/// Options are directly ported from [enhanced-resolve](https://github.com/webpack/enhanced-resolve#resolver-options). -/// -/// See [webpack resolve](https://webpack.js.org/configuration/resolve/) for information and examples -#[derive(Debug, Clone)] -#[napi(object)] -pub struct NapiResolveOptions { - /// Path to TypeScript configuration file. - /// - /// Default `None` - pub tsconfig: Option, - - /// Alias for [ResolveOptions::alias] and [ResolveOptions::fallback]. - /// - /// For the second value of the tuple, `None -> AliasValue::Ignore`, Some(String) -> - /// AliasValue::Path(String)` - /// Create aliases to import or require certain modules more easily. - /// A trailing $ can also be added to the given object's keys to signify an exact match. - pub alias: Option>>>, - - /// A list of alias fields in description files. - /// Specify a field, such as `browser`, to be parsed according to [this specification](https://github.com/defunctzombie/package-browser-field-spec). - /// Can be a path to json object such as `["path", "to", "exports"]`. - /// - /// Default `[]` - #[napi(ts_type = "(string | string[])[]")] - pub alias_fields: Option>, - - /// Condition names for exports field which defines entry points of a package. - /// The key order in the exports field is significant. During condition matching, earlier entries have higher priority and take precedence over later entries. - /// - /// Default `[]` - pub condition_names: Option>, - - /// The JSON files to use for descriptions. (There was once a `bower.json`.) - /// - /// Default `["package.json"]` - pub description_files: Option>, - - /// If true, it will not allow extension-less files. - /// So by default `require('./foo')` works if `./foo` has a `.js` extension, - /// but with this enabled only `require('./foo.js')` will work. - /// - /// Default to `true` when [ResolveOptions::extensions] contains an empty string. - /// Use `Some(false)` to disable the behavior. - /// See - /// - /// Default None, which is the same as `Some(false)` when the above empty rule is not applied. - pub enforce_extension: Option, - - /// A list of exports fields in description files. - /// Can be a path to json object such as `["path", "to", "exports"]`. - /// - /// Default `[["exports"]]`. - #[napi(ts_type = "(string | string[])[]")] - pub exports_fields: Option>, - - /// Fields from `package.json` which are used to provide the internal requests of a package - /// (requests starting with # are considered internal). - /// - /// Can be a path to a JSON object such as `["path", "to", "imports"]`. - /// - /// Default `[["imports"]]`. - #[napi(ts_type = "(string | string[])[]")] - pub imports_fields: Option>, - - /// An object which maps extension to extension aliases. - /// - /// Default `{}` - pub extension_alias: Option>>, - - /// Attempt to resolve these extensions in order. - /// If multiple files share the same name but have different extensions, - /// will resolve the one with the extension listed first in the array and skip the rest. - /// - /// Default `[".js", ".json", ".node"]` - pub extensions: Option>, - - /// Redirect module requests when normal resolving fails. - /// - /// Default `[]` - pub fallback: Option>>>, - - /// 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). - /// - /// See also webpack configuration [resolve.fullySpecified](https://webpack.js.org/configuration/module/#resolvefullyspecified) - /// - /// Default `false` - pub fully_specified: Option, - - /// A list of main fields in description files - /// - /// Default `["main"]`. - #[napi(ts_type = "string | string[]")] - pub main_fields: Option, - - /// The filename to be used while resolving directories. - /// - /// Default `["index"]` - pub main_files: Option>, - - /// A list of directories to resolve modules from, can be absolute path or folder name. - /// - /// Default `["node_modules"]` - #[napi(ts_type = "string | string[]")] - pub modules: Option, - - /// Resolve to a context instead of a file. - /// - /// Default `false` - pub resolve_to_context: Option, - - /// Prefer to resolve module requests as relative requests instead of using modules from node_modules directories. - /// - /// Default `false` - pub prefer_relative: Option, - - /// Prefer to resolve server-relative urls as absolute paths before falling back to resolve in ResolveOptions::roots. - /// - /// Default `false` - pub prefer_absolute: Option, - - /// A list of resolve restrictions to restrict the paths that a request can be resolved on. - /// - /// Default `[]` - pub restrictions: Option>, - - /// A list of directories where requests of server-relative URLs (starting with '/') are resolved. - /// On non-Windows systems these requests are resolved as an absolute path first. - /// - /// Default `[]` - pub roots: Option>, - - /// Whether to resolve symlinks to their symlinked location. - /// When enabled, symlinked resources are resolved to their real path, not their symlinked location. - /// Note that this may cause module resolution to fail when using tools that symlink packages (like npm link). - /// - /// Default `true` - pub symlinks: Option, - - /// Whether to parse [module.builtinModules](https://nodejs.org/api/module.html#modulebuiltinmodules) or not. - /// For example, "zlib" will throw [crate::ResolveError::Builtin] when set to true. - /// - /// Default `false` - pub builtin_modules: Option, -} - -#[napi] -#[derive(Debug, PartialEq, Eq)] -pub enum EnforceExtension { - Auto, - Enabled, - Disabled, -} - -impl EnforceExtension { - pub fn is_auto(&self) -> bool { - *self == Self::Auto - } - - pub fn is_enabled(&self) -> bool { - *self == Self::Enabled - } - - pub fn is_disabled(&self) -> bool { - *self == Self::Disabled - } -} - -/// Alias Value for [ResolveOptions::alias] and [ResolveOptions::fallback]. -/// Use struct because napi don't support structured union now -#[napi(object)] -#[derive(Debug, Clone)] -pub struct Restriction { - pub path: Option, - pub regex: Option, -} - -/// Tsconfig Options -/// -/// Derived from [tsconfig-paths-webpack-plugin](https://github.com/dividab/tsconfig-paths-webpack-plugin#options) -#[napi(object)] -#[derive(Debug, Clone)] -pub struct TsconfigOptions { - /// Allows you to specify where to find the TypeScript configuration file. - /// You may provide - /// * a relative path to the configuration file. It will be resolved relative to cwd. - /// * an absolute path to the configuration file. - pub config_file: String, - - /// Support for Typescript Project References. - /// - /// * `'auto'`: use the `references` field from tsconfig of `config_file`. - /// * `string[]`: manually provided relative or absolute path. - #[napi(ts_type = "'auto' | string[]")] - pub references: Option>>, -} - -impl Into for Restriction { - fn into(self) -> oxc_resolver::Restriction { - match (self.path, self.regex) { - (None, None) => { - panic!("Should specify path or regex") - } - (None, Some(regex)) => oxc_resolver::Restriction::RegExp(regex), - (Some(path), None) => oxc_resolver::Restriction::Path(PathBuf::from(path)), - (Some(_), Some(_)) => { - panic!("Restriction can't be path and regex at the same time") - } - } - } -} - -impl Into for EnforceExtension { - fn into(self) -> oxc_resolver::EnforceExtension { - match self { - EnforceExtension::Auto => oxc_resolver::EnforceExtension::Auto, - EnforceExtension::Enabled => oxc_resolver::EnforceExtension::Enabled, - EnforceExtension::Disabled => oxc_resolver::EnforceExtension::Disabled, - } - } -} - -impl Into for TsconfigOptions { - fn into(self) -> oxc_resolver::TsconfigOptions { - oxc_resolver::TsconfigOptions { - config_file: PathBuf::from(self.config_file), - references: match self.references { - Some(Either::A(string)) if string.as_str() == "auto" => { - oxc_resolver::TsconfigReferences::Auto - } - Some(Either::A(opt)) => { - panic!("`{}` is not a valid option for tsconfig references", opt) - } - Some(Either::B(paths)) => oxc_resolver::TsconfigReferences::Paths( - paths.into_iter().map(PathBuf::from).collect::>(), - ), - None => oxc_resolver::TsconfigReferences::Disabled, - }, - } - } -} - -type StrOrStrListType = Either>; -pub struct StrOrStrList(pub StrOrStrListType); - -impl Into> for StrOrStrList { - fn into(self) -> Vec { - match self { - StrOrStrList(Either::A(s)) => Vec::from([s]), - StrOrStrList(Either::B(a)) => a, - } - } -} diff --git a/napi/tests/options.test.mjs b/napi/tests/options.test.mjs deleted file mode 100644 index 4a93efff..00000000 --- a/napi/tests/options.test.mjs +++ /dev/null @@ -1,59 +0,0 @@ -import { describe, it } from "node:test"; -import { ResolverFactory } from "../index.js"; -import * as assert from "node:assert"; -import * as path from "node:path"; - -const fixtureDir = new URL( - "../../fixtures/enhanced_resolve/test/fixtures", - import.meta.url -).pathname; - -describe("option", () => { - describe("aliasFields", () => { - it("should allow field string ", () => { - const resolver = new ResolverFactory({ aliasFields: ["browser"] }); - assert.match( - resolver.sync(fixtureDir, "./browser-module/lib/replaced.js").path, - /browser-module\/lib\/browser\.js$/ - ); - }); - it("should allow json path array", () => { - const resolver = new ResolverFactory({ - aliasFields: [["innerBrowser1", "field", "browser"]], - }); - - assert.match( - resolver.sync(fixtureDir, "./browser-module/lib/main1.js").path, - /browser-module\/lib\/main\.js$/ - ); - }); - }); - - describe("exportsFields", () => { - const createTest = (exportsFields) => { - const resolver = new ResolverFactory({ exportsFields }); - assert.match( - resolver.sync( - path.resolve(fixtureDir, "./exports-field3"), - "exports-field" - ).path, - /\/exports-field\/src\/index\.js$/ - ); - }; - it("should allow string as field item", createTest(["broken"])); - it("should allow json path array as field item", createTest([["broken"]])); - }); - - describe("mainFields", () => { - const createTest = (mainFields) => { - const resolver = new ResolverFactory({ mainFields }); - assert.match( - resolver.sync(fixtureDir, "../..").path, - /\/lib\/index\.js$/ - ); - }; - it("should use `'main'` as default", createTest(undefined)); - it("should allow field string", createTest("main")); - it("should allow field array", createTest(["main"])); - }); -}); diff --git a/npm/package.json b/npm/package.json index 6fa93185..b47e6b07 100644 --- a/npm/package.json +++ b/npm/package.json @@ -1,41 +1,30 @@ { - "name": "oxc-resolver", - "version": "1.8.1", - "description": "Oxc Resolver Node API", - "main": "index.js", - "browser": "browser.js", - "files": [ - "index.d.ts", - "index.js", - "browser.js" - ], - "license": "MIT", - "homepage": "https://oxc-project.github.io", - "repository": { - "type": "git", - "url": "git+https://github.com/oxc-project/oxc-resolver.git" - }, - "publishConfig": { - "registry": "https://registry.npmjs.org/", - "access": "public" - }, - "napi": { - "binaryName": "resolver", - "packageName": "@oxc-resolver/binding", - "targets": [ - "x86_64-pc-windows-msvc", - "aarch64-pc-windows-msvc", - "x86_64-unknown-linux-gnu", - "x86_64-unknown-linux-musl", - "aarch64-unknown-linux-gnu", - "aarch64-unknown-linux-musl", - "armv7-unknown-linux-gnueabihf", - "x86_64-apple-darwin", - "aarch64-apple-darwin", - "wasm32-wasip1-threads" - ] - }, - "funding": { - "url": "https://github.com/sponsors/Boshen" - } + "name": "oxc-resolver", + "description": "Oxc Resolver Node API", + "funding": { + "url": "https://github.com/sponsors/Boshen" + }, + "main": "index.js", + "browser": "browser.js", + "files": [ + "index.d.ts", + "index.js", + "browser.js" + ], + "napi": { + "binaryName": "resolver", + "packageName": "@oxc-resolver/binding", + "targets": [ + "x86_64-pc-windows-msvc", + "aarch64-pc-windows-msvc", + "x86_64-unknown-linux-gnu", + "x86_64-unknown-linux-musl", + "aarch64-unknown-linux-gnu", + "aarch64-unknown-linux-musl", + "armv7-unknown-linux-gnueabihf", + "x86_64-apple-darwin", + "aarch64-apple-darwin", + "wasm32-wasip1-threads" + ] + } } diff --git a/package.json b/package.json index 47300b76..a431e48f 100644 --- a/package.json +++ b/package.json @@ -1,33 +1,24 @@ { - "name": "@oxc-resolver/binding", - "private": true, - "version": "0.0.0", - "scripts": { - "build": "napi build --platform --release --package-json-path npm/package.json --manifest-path napi/Cargo.toml", - "build:debug": "napi build --platform --package-json-path npm/package.json --manifest-path napi/Cargo.toml", - "prepublishOnly": "napi pre-publish -t npm", - "test": "ava" - }, - "devDependencies": { - "@napi-rs/cli": "^3.0.0-alpha.43", - "@napi-rs/wasm-runtime": "^0.2.0", - "@types/node": "^20.10.4", - "ava": "^6.0.1", - "emnapi": "^1.0.0", - "typescript": "^5.3.3" - }, - "ava": { - "files": [ - "napi/__test__/*.spec.mjs" - ], - "cache": false - }, - "packageManager": "pnpm@9.3.0", - "repository": { - "type": "git", - "url": "git+https://github.com/oxc-project/oxc-resolver.git" - }, - "funding": { - "url": "https://github.com/sponsors/Boshen" - } + "name": "@oxc-resolver/binding", + "funding": { + "url": "https://github.com/sponsors/Boshen" + }, + "scripts": { + "build": "napi build --platform --release --package-json-path npm/package.json --manifest-path napi/Cargo.toml", + "build:debug": "napi build --platform --package-json-path npm/package.json --manifest-path napi/Cargo.toml", + "prepublishOnly": "napi pre-publish -t npm" + }, + "ava": { + "cache": false, + "files": [ + "napi/__test__/*.spec.mjs" + ] + }, + "devDependencies": { + "@napi-rs/cli": "^3.0.0-alpha.43", + "@napi-rs/wasm-runtime": "^0.2.0", + "@types/node": "^20.10.4", + "ava": "^6.0.1", + "emnapi": "^1.0.0" + } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml deleted file mode 100644 index 2dec7fb3..00000000 --- a/pnpm-lock.yaml +++ /dev/null @@ -1,2684 +0,0 @@ -lockfileVersion: '9.0' - -settings: - autoInstallPeers: true - excludeLinksFromLockfile: false - -importers: - - .: - devDependencies: - '@napi-rs/cli': - specifier: ^3.0.0-alpha.43 - version: 3.0.0-alpha.51(@emnapi/runtime@1.1.1)(emnapi@1.1.1) - '@napi-rs/wasm-runtime': - specifier: ^0.2.0 - version: 0.2.0 - '@types/node': - specifier: ^20.10.4 - version: 20.12.7 - ava: - specifier: ^6.0.1 - version: 6.1.2 - emnapi: - specifier: ^1.0.0 - version: 1.1.1 - typescript: - specifier: ^5.3.3 - version: 5.4.5 - - fixtures/pnpm: - devDependencies: - axios: - specifier: 1.6.2 - version: 1.6.2 - postcss: - specifier: 8.4.33 - version: 8.4.33 - styled-components: - specifier: 6.1.1 - version: 6.1.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - - npm: {} - -packages: - - '@emnapi/core@1.1.1': - resolution: {integrity: sha512-eu4KjHfXg3I+UUR7vSuwZXpRo4c8h4Rtb5Lu2F7Z4JqJFl/eidquONEBiRs6viXKpWBC3BaJBy68xGJ2j56idw==} - - '@emnapi/runtime@1.1.1': - resolution: {integrity: sha512-3bfqkzuR1KLx57nZfjr2NLnFOobvyS0aTszaEGCGqmYMVDRaGvgIZbjGSV/MHSSmLgQ/b9JFHQ5xm5WRZYd+XQ==} - - '@emotion/is-prop-valid@1.2.2': - resolution: {integrity: sha512-uNsoYd37AFmaCdXlg6EYD1KaPOaRWRByMCYzbKUX4+hhMfrxdVSelShywL4JVaAeM/eHUOSprYBQls+/neX3pw==} - - '@emotion/memoize@0.8.1': - resolution: {integrity: sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA==} - - '@emotion/unitless@0.8.1': - resolution: {integrity: sha512-KOEGMu6dmJZtpadb476IsZBclKvILjopjUii3V+7MnXIQCYh8W3NgNcgwo21n9LXZX6EDIKvqfjYxXebDwxKmQ==} - - '@inquirer/figures@1.0.1': - resolution: {integrity: sha512-mtup3wVKia3ZwULPHcbs4Mor8Voi+iIXEWD7wCNbIO6lYR62oPCTQyrddi5OMYVXHzeCSoneZwJuS8sBvlEwDw==} - engines: {node: '>=18'} - - '@ljharb/through@2.3.13': - resolution: {integrity: sha512-/gKJun8NNiWGZJkGzI/Ragc53cOdcLNdzjLaIa+GEjguQs0ulsurx8WN0jijdK9yPqDvziX995sMRLyLt1uZMQ==} - engines: {node: '>= 0.4'} - - '@mapbox/node-pre-gyp@1.0.11': - resolution: {integrity: sha512-Yhlar6v9WQgUp/He7BdgzOz8lqMQ8sU+jkCq7Wx8Myc5YFJLbEe7lgui/V7G1qB1DJykHSGwreceSaD60Y0PUQ==} - hasBin: true - - '@napi-rs/cli@3.0.0-alpha.51': - resolution: {integrity: sha512-fzTQ4RfhaghFNryWTfb0e93N/J7hNfAOpUNL98u9qMymsXa3w2cUTN8W/HjiNVTUvHHus8X5PuHt9q65cDXcSg==} - engines: {node: '>= 16'} - hasBin: true - peerDependencies: - '@emnapi/runtime': ^1.1.0 - emnapi: ^1.1.0 - peerDependenciesMeta: - '@emnapi/runtime': - optional: true - emnapi: - optional: true - - '@napi-rs/cross-toolchain@0.0.14': - resolution: {integrity: sha512-Xgoe1gCEo5s5VUxmSnK4tYFJXW2JAVM02jptSbqA2+gp8pt4Vuk9oK2LvswwO9iRfHapKacYYhegD8Dq/+PBOQ==} - peerDependencies: - '@napi-rs/cross-toolchain-arm64-target-aarch64': ^0.0.14 - '@napi-rs/cross-toolchain-arm64-target-armv7': ^0.0.14 - '@napi-rs/cross-toolchain-arm64-target-x86_64': ^0.0.14 - '@napi-rs/cross-toolchain-x64-target-aarch64': ^0.0.14 - '@napi-rs/cross-toolchain-x64-target-armv7': ^0.0.14 - '@napi-rs/cross-toolchain-x64-target-x86_64': ^0.0.14 - peerDependenciesMeta: - '@napi-rs/cross-toolchain-arm64-target-aarch64': - optional: true - '@napi-rs/cross-toolchain-arm64-target-armv7': - optional: true - '@napi-rs/cross-toolchain-arm64-target-x86_64': - optional: true - '@napi-rs/cross-toolchain-x64-target-aarch64': - optional: true - '@napi-rs/cross-toolchain-x64-target-armv7': - optional: true - '@napi-rs/cross-toolchain-x64-target-x86_64': - optional: true - - '@napi-rs/lzma-android-arm-eabi@1.2.1': - resolution: {integrity: sha512-GKXud2hTddxehff1mAGkbTfseBj+GcM+M/sZuxf9H9CJeOWpfI/HC9Oy3uv8mBqPTkOQdCcZ/xXPU34EOEwiRg==} - engines: {node: '>= 10'} - cpu: [arm] - os: [android] - - '@napi-rs/lzma-android-arm64@1.2.1': - resolution: {integrity: sha512-UKFvc56TdgljbdgLvSwM62pSItV/4SuXXCrJtruPDmbIDe8HKag8hsCKsb66hrc9aX7urJ+KGw1yz5hWiONLyw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [android] - - '@napi-rs/lzma-darwin-arm64@1.2.1': - resolution: {integrity: sha512-eLbHzK5xGVzEABb1ESFELQJzXKoQeP9QH9hMPd4Qq29xD6MkWD2VKlAy40AxrMeWc7fCUIImTTlGuGRvg6tI1g==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [darwin] - - '@napi-rs/lzma-darwin-x64@1.2.1': - resolution: {integrity: sha512-/a5sHZkkO81w/PCpxlwXjADz++jDiTJquMzCLAhupd23wTRmJoCBAwp4Tur+qV5esI7ahAA0lS5P0M4TZv+OUg==} - engines: {node: '>= 10'} - cpu: [x64] - os: [darwin] - - '@napi-rs/lzma-freebsd-x64@1.2.1': - resolution: {integrity: sha512-Ehc0ld148YcqQrDWwUbVta1l45R4PthCIU6ZDbOYzzeYXQnhgr1fWiex7wu4KMFppteHlYntypUIhmMUklqchA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [freebsd] - - '@napi-rs/lzma-linux-arm-gnueabihf@1.2.1': - resolution: {integrity: sha512-EkIsx3kC67viElNetZgaGAtAceA+4pVGj31HKKPn0RZYn3rCNdEEg2i1IRg07Y6m4bHwcaKutLoZ2LDcQ+yiBg==} - engines: {node: '>= 10'} - cpu: [arm] - os: [linux] - - '@napi-rs/lzma-linux-arm64-gnu@1.2.1': - resolution: {integrity: sha512-GxSbp1/X7Ppmf+aNiZ95vl1HgQzRS9C8zCv7unEhYRPAjRkAnlrsLluUBOTPIY2yquuUvfIog9XIml6Hpw2wrA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/lzma-linux-arm64-musl@1.2.1': - resolution: {integrity: sha512-2L3KHFGGdt0xgU0WcKwKmnjVCYs88t4+ixBgPfEydtYsOceg6B8eOzdM7xsziKxJyUJKWBetGLgARQOy35bfvA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/lzma-linux-x64-gnu@1.2.1': - resolution: {integrity: sha512-h29XttA2Og1+6vYHsVcp+i1PkeILKzYnoDun0ul/k/5hvfxJ2Jap+EM07sW4HSz/DiscLAeIZmLKbXEqJgF5bg==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/lzma-linux-x64-musl@1.2.1': - resolution: {integrity: sha512-8EIkpLid4pepkBsljQ7rgma8jdwAuwVyJ2tY6Wuj1I/AqAkVVfxTwIuYc4zgRR3nfcrmWgOfZE0VneVmQCE5hw==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/lzma-win32-arm64-msvc@1.2.1': - resolution: {integrity: sha512-RNPItarWUUbtwz6dyn8FGH9AXEaAsBcMBlTvcRjv8eoqRqyZ9R49Ruk/8WMS57MM1BKdiPDxHBtRi+nZn27Slw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [win32] - - '@napi-rs/lzma-win32-ia32-msvc@1.2.1': - resolution: {integrity: sha512-rNdsCZnzKVgeDd9NzXWk9WuADVUWUWdnws8qBRCfHRUQqJ56Ic1W7Y1XmP+bNa985MXlU6vbznHTHmU5zk2P+A==} - engines: {node: '>= 10'} - cpu: [ia32] - os: [win32] - - '@napi-rs/lzma-win32-x64-msvc@1.2.1': - resolution: {integrity: sha512-1AFrAh1n73Yw+IhDu5HnaiRD4vWEkafY0EarfziPfDsh/GeyNcjbE+Let+XFe8L3j0/CZfsRG3nXarOW1oadUQ==} - engines: {node: '>= 10'} - cpu: [x64] - os: [win32] - - '@napi-rs/lzma@1.2.1': - resolution: {integrity: sha512-vwl34tzF2mXWthnFVN2MP6nRzQ40C5+256EEUjxAwj9dbAhDqb7Yz376Up5SlB4YgNC0YvEqK4jsYP/NP0bgpg==} - engines: {node: '>= 10'} - - '@napi-rs/tar-android-arm-eabi@0.1.0': - resolution: {integrity: sha512-gY9f7HfyU8MQs/ERi2/Fc4dGRf61ZM2pme31t0FkrzTtmeIaf56LiTeTt4aP8xh/0HOVnXrB6I3taY9IsQVB8Q==} - engines: {node: '>= 10'} - cpu: [arm] - os: [android] - - '@napi-rs/tar-android-arm64@0.1.0': - resolution: {integrity: sha512-NxszsTRdAYf25kKuzUYz514/5MFI3w3aHToZBcFjaxUmsayrimFrHIiPLwNQVe55lHPRi13njqQUPjMetHMCZw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [android] - - '@napi-rs/tar-darwin-arm64@0.1.0': - resolution: {integrity: sha512-G+fSNcwhbekTMOElS66mf3ccg8M4NcEHIgo7s6Hxo8U2obUSqEJ0WjTDV8oJy7lqRW/MeeDJj8Vz0ceXC8ueeA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [darwin] - - '@napi-rs/tar-darwin-x64@0.1.0': - resolution: {integrity: sha512-p9aOLk6O2+Cu62fNOdj1Zx0P3J1VkxtihXOVDaK49o5jszhms0roNA7kZfklwjVdwo8R7OQC6mJcFWmiamMNug==} - engines: {node: '>= 10'} - cpu: [x64] - os: [darwin] - - '@napi-rs/tar-freebsd-x64@0.1.0': - resolution: {integrity: sha512-mZQPtyCc2r+P84WV76Ddbe1+CxBscxlDHtgMIxZPveMgq4esZFKp26M735vjxtk/j2ahT0pZoC6fjsJ//Uxzlg==} - engines: {node: '>= 10'} - cpu: [x64] - os: [freebsd] - - '@napi-rs/tar-linux-arm-gnueabihf@0.1.0': - resolution: {integrity: sha512-FHxnmrOS345T3n3XDmY9QEoVv1PXkkuevQbu+gzq5np4fzN/NX2Az5oJTxKOTGtlJSaxxz90raeaWRZrnV5hZQ==} - engines: {node: '>= 10'} - cpu: [arm] - os: [linux] - - '@napi-rs/tar-linux-arm64-gnu@0.1.0': - resolution: {integrity: sha512-+8WHnL/8PPpePYc+5oqNLoE5o98vWF7lJvY/seji7tdcS5TPJ3tgXaF4/y1rFAaSxKsZ9l+ClHsZZ0MpCqMOOQ==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/tar-linux-arm64-musl@0.1.0': - resolution: {integrity: sha512-SXqU4H30/TD9BZa6pH/U5l2V6E4EKOutjHp9Sqr98iH52Zb+1N84ur1Ti7/+PapKunCIJeZzU+792CQagKIzuQ==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/tar-linux-x64-gnu@0.1.0': - resolution: {integrity: sha512-2uZHxl2nH1HbeJuifB1qdK8vU9wKDrxQkFm+u4psUaa/uHLZDUCGS7GMxTnCbR9OehqZcfQabaKsHbxR/8ElDQ==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/tar-linux-x64-musl@0.1.0': - resolution: {integrity: sha512-S1vEqLK4UCHS4AjVZ3g6o7r0Yu6RbhmDj6JrqxBoEIjrMsuIPKQrODHhtlsykOPeu5IHQuyRT+DevorWAVYdoA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/tar-win32-arm64-msvc@0.1.0': - resolution: {integrity: sha512-x23Ganq0hcDbgnhzAFqOu5EWtKvngIsapJL7ZLGgQlqahRb15aQkagYvpju6CLZers6N6znmqxw9Pdov9VFzOQ==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [win32] - - '@napi-rs/tar-win32-ia32-msvc@0.1.0': - resolution: {integrity: sha512-QJgJQEKDbVOrzSJ3EaUuCk+g7t9tKv085eALmRtkiHDBmzd0iAoudcU2N9YgdacSQMe1V/GMuQLky6BFrZb4nw==} - engines: {node: '>= 10'} - cpu: [ia32] - os: [win32] - - '@napi-rs/tar-win32-x64-msvc@0.1.0': - resolution: {integrity: sha512-aEhLcPZXmbcz46utpgYrkhY/TIGVCs4T5c+xpBf6H8feIEz7rF44Bm6kECC42OWcqnws2LGRW9TZsv0bWoAn0A==} - engines: {node: '>= 10'} - cpu: [x64] - os: [win32] - - '@napi-rs/tar@0.1.0': - resolution: {integrity: sha512-HodV5VS/ryhNvSmSHPb6CT5lJKzkoKaiyO8JPkVw3XCXbp51+vZs7LJ66kgFqyr4AagaKqmXsgpGVCIwNdFw/w==} - engines: {node: '>= 10'} - - '@napi-rs/wasm-runtime@0.1.2': - resolution: {integrity: sha512-8JuczewTFIZ/XIjHQ+YlQUydHvlKx2hkcxtuGwh+t/t5zWyZct6YG4+xjHcq8xyc/e7FmFwf42Zj2YgICwmlvA==} - - '@napi-rs/wasm-runtime@0.2.0': - resolution: {integrity: sha512-ETCooPEZJN7cGp6GwE5mUTrStrhIeuEPo0lOhLe48Iz35z6CkbgDauR8nE/K4GaMEu2BwTOm2Epy7ru8w1ua7w==} - - '@napi-rs/wasm-tools-android-arm-eabi@0.0.1': - resolution: {integrity: sha512-Q/SyyO60dbpoLcN/hvGzNWDaCjuaMGFeg92GnsDBWm3OCwhvltr51+VDZbCIHQwfIvH4d63X29nEls7FHK75dA==} - engines: {node: '>= 10'} - cpu: [arm] - os: [android] - - '@napi-rs/wasm-tools-android-arm64@0.0.1': - resolution: {integrity: sha512-mn7QpSWJlQS7Z14DkWqW14HqEiI2R8FV3KT4SNdqm+O+K5uIUvAexxMn9Qu6gqLq1fHXj+7l2luAWmtN7RKLjA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [android] - - '@napi-rs/wasm-tools-darwin-arm64@0.0.1': - resolution: {integrity: sha512-WuxMRtd5rCgqfuk7dehcft5eyGDOuNSMaJybprbX4IXvnjlLQf1zsCfp6wBI2Ptp2D+qEgE2SAMWBfzF9XDDkw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [darwin] - - '@napi-rs/wasm-tools-darwin-x64@0.0.1': - resolution: {integrity: sha512-YGPjgIo1/Y774aAFb/UT+d8VQtTaIkdF0/ynlChe/UilBZX48vLaEM0HaoSqxA1WHvRm8Il8R3rBDDle0965rw==} - engines: {node: '>= 10'} - cpu: [x64] - os: [darwin] - - '@napi-rs/wasm-tools-freebsd-x64@0.0.1': - resolution: {integrity: sha512-e5y+Z89XwI7HpLyCNEvDKdtO5Sga2+o8bDcNQNHjhMunnnHKPtlTvtIhieVmdqnNGPbuNkIx8xbTjkoWCZ49Tw==} - engines: {node: '>= 10'} - cpu: [x64] - os: [freebsd] - - '@napi-rs/wasm-tools-linux-arm64-gnu@0.0.1': - resolution: {integrity: sha512-Hcy+XiCJd8XshxVOYvmyU5FgeY8d6txZf7ZefI38Y3eRm7rzGt/EvABGjvJfujnPaBeWi9fQVm3Zav5pwyxViw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/wasm-tools-linux-arm64-musl@0.0.1': - resolution: {integrity: sha512-1mSquGy4N7jlRu/0OY/rqZa/XdCFGKrsl8SH4jRB318DVweOHLqn15QG4iwIrRVjCJROpaU9HRU/sgOKVbdqrA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/wasm-tools-linux-x64-gnu@0.0.1': - resolution: {integrity: sha512-/+XuGQ9667EqrxRbpt2izLDNzWUWLTXl6KaRSh9TjcT7qL5+yllTqchc0JwIHJW5QnQlC1NW7HnSnwQZ+/v+8g==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/wasm-tools-linux-x64-musl@0.0.1': - resolution: {integrity: sha512-L+5QcEsUS+QNcMI1AF6aBRKLzhxQ5VHRHVslaQwOxHoxyhMB/2hRH4ON6Zea1PyQS/zzZugwBuDEOcFtc3UjPQ==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/wasm-tools-wasm32-wasi@0.0.1': - resolution: {integrity: sha512-I1vAhMQcBblPJPg6pr+xydZ1NjPwKU2ympmI54BZfCOAMHs0ZfVb4yEqYAVIcSWOx3CF/0T2YrcOmiULTU3iGw==} - engines: {node: '>=14.0.0'} - cpu: [wasm32] - - '@napi-rs/wasm-tools-win32-arm64-msvc@0.0.1': - resolution: {integrity: sha512-A9peDWijE9X6qt5SNzqlmSMlOZiqeB9zhUVP5dtJKtpqVO098YVnZFsz/4Hv7LkSoxQE7brAd9yln/wz5qb1yQ==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [win32] - - '@napi-rs/wasm-tools-win32-ia32-msvc@0.0.1': - resolution: {integrity: sha512-6Y7GqnBCIdl8YsSQ+5AjnZ4iWDJnJrqzRlMDegCmPPf3WmRZ0sgnRU9iAHWcId9AEIf7SAs3x7Bnv2992zCwJA==} - engines: {node: '>= 10'} - cpu: [ia32] - os: [win32] - - '@napi-rs/wasm-tools-win32-x64-msvc@0.0.1': - resolution: {integrity: sha512-Ab6ljJCQmXqJvE4/8DLvHEVTI7vVUrVfh6gCwnVwwrA/B2LgR98SanpT8/951ZaIH/lSuqkeVm+wqzgYM1FHRg==} - engines: {node: '>= 10'} - cpu: [x64] - os: [win32] - - '@napi-rs/wasm-tools@0.0.1': - resolution: {integrity: sha512-itoKmaVqRKIV37sKIEri1qjaYlWNtXyfymUaqXkLu5F16s+FwqwOmvxmdTHsvNKkMy4qCsSSetiLZO1IwvBMLQ==} - engines: {node: '>= 10'} - - '@nodelib/fs.scandir@2.1.5': - resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} - engines: {node: '>= 8'} - - '@nodelib/fs.stat@2.0.5': - resolution: {integrity: sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==} - engines: {node: '>= 8'} - - '@nodelib/fs.walk@1.2.8': - resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} - engines: {node: '>= 8'} - - '@octokit/auth-token@4.0.0': - resolution: {integrity: sha512-tY/msAuJo6ARbK6SPIxZrPBms3xPbfwBrulZe0Wtr/DIY9lje2HeV1uoebShn6mx7SjCHif6EjMvoREj+gZ+SA==} - engines: {node: '>= 18'} - - '@octokit/core@5.2.0': - resolution: {integrity: sha512-1LFfa/qnMQvEOAdzlQymH0ulepxbxnCYAKJZfMci/5XJyIHWgEYnDmgnKakbTh7CH2tFQ5O60oYDvns4i9RAIg==} - engines: {node: '>= 18'} - - '@octokit/endpoint@9.0.5': - resolution: {integrity: sha512-ekqR4/+PCLkEBF6qgj8WqJfvDq65RH85OAgrtnVp1mSxaXF03u2xW/hUdweGS5654IlC0wkNYC18Z50tSYTAFw==} - engines: {node: '>= 18'} - - '@octokit/graphql@7.1.0': - resolution: {integrity: sha512-r+oZUH7aMFui1ypZnAvZmn0KSqAUgE1/tUXIWaqUCa1758ts/Jio84GZuzsvUkme98kv0WFY8//n0J1Z+vsIsQ==} - engines: {node: '>= 18'} - - '@octokit/openapi-types@20.0.0': - resolution: {integrity: sha512-EtqRBEjp1dL/15V7WiX5LJMIxxkdiGJnabzYx5Apx4FkQIFgAfKumXeYAqqJCj1s+BMX4cPFIFC4OLCR6stlnA==} - - '@octokit/openapi-types@22.1.0': - resolution: {integrity: sha512-pGUdSP+eEPfZiQHNkZI0U01HLipxncisdJQB4G//OAmfeO8sqTQ9KRa0KF03TUPCziNsoXUrTg4B2Q1EX++T0Q==} - - '@octokit/plugin-paginate-rest@9.2.1': - resolution: {integrity: sha512-wfGhE/TAkXZRLjksFXuDZdmGnJQHvtU/joFQdweXUgzo1XwvBCD4o4+75NtFfjfLK5IwLf9vHTfSiU3sLRYpRw==} - engines: {node: '>= 18'} - peerDependencies: - '@octokit/core': '5' - - '@octokit/plugin-request-log@4.0.1': - resolution: {integrity: sha512-GihNqNpGHorUrO7Qa9JbAl0dbLnqJVrV8OXe2Zm5/Y4wFkZQDfTreBzVmiRfJVfE4mClXdihHnbpyyO9FSX4HA==} - engines: {node: '>= 18'} - peerDependencies: - '@octokit/core': '5' - - '@octokit/plugin-rest-endpoint-methods@10.4.1': - resolution: {integrity: sha512-xV1b+ceKV9KytQe3zCVqjg+8GTGfDYwaT1ATU5isiUyVtlVAO3HNdzpS4sr4GBx4hxQ46s7ITtZrAsxG22+rVg==} - engines: {node: '>= 18'} - peerDependencies: - '@octokit/core': '5' - - '@octokit/request-error@5.1.0': - resolution: {integrity: sha512-GETXfE05J0+7H2STzekpKObFe765O5dlAKUTLNGeH+x47z7JjXHfsHKo5z21D/o/IOZTUEI6nyWyR+bZVP/n5Q==} - engines: {node: '>= 18'} - - '@octokit/request@8.4.0': - resolution: {integrity: sha512-9Bb014e+m2TgBeEJGEbdplMVWwPmL1FPtggHQRkV+WVsMggPtEkLKPlcVYm/o8xKLkpJ7B+6N8WfQMtDLX2Dpw==} - engines: {node: '>= 18'} - - '@octokit/rest@20.1.0': - resolution: {integrity: sha512-STVO3itHQLrp80lvcYB2UIKoeil5Ctsgd2s1AM+du3HqZIR35ZH7WE9HLwUOLXH0myA0y3AGNPo8gZtcgIbw0g==} - engines: {node: '>= 18'} - - '@octokit/types@12.6.0': - resolution: {integrity: sha512-1rhSOfRa6H9w4YwK0yrf5faDaDTb+yLyBUKOCV4xtCDB5VmIPqd/v9yr9o6SAzOAlRxMiRiCic6JVM1/kunVkw==} - - '@octokit/types@13.4.1': - resolution: {integrity: sha512-Y73oOAzRBAUzR/iRAbGULzpNkX8vaxKCqEtg6K74Ff3w9f5apFnWtE/2nade7dMWWW3bS5Kkd6DJS4HF04xreg==} - - '@rollup/pluginutils@4.2.1': - resolution: {integrity: sha512-iKnFXr7NkdZAIHiIWE+BX5ULi/ucVFYWD6TbAV+rZctiRTY2PL6tsIKhoIOaoskiWAkgu+VsbXgUVDNLHf+InQ==} - engines: {node: '>= 8.0.0'} - - '@sindresorhus/merge-streams@2.3.0': - resolution: {integrity: sha512-LtoMMhxAlorcGhmFYI+LhPgbPZCkgP6ra1YL604EeF6U98pLlQ3iWIGMdWSC+vWmPBWBNgmDBAhnAobLROJmwg==} - engines: {node: '>=18'} - - '@tybys/wasm-util@0.8.3': - resolution: {integrity: sha512-Z96T/L6dUFFxgFJ+pQtkPpne9q7i6kIPYCFnQBHSgSPV9idTsKfIhCss0h5iM9irweZCatkrdeP8yi5uM1eX6Q==} - - '@types/node@20.12.7': - resolution: {integrity: sha512-wq0cICSkRLVaf3UGLMGItu/PtdY7oaXaI/RVU+xliKVOtRna3PRY57ZDfztpDL0n11vfymMUnXv8QwYCO7L1wg==} - - '@types/stylis@4.2.6': - resolution: {integrity: sha512-4nebF2ZJGzQk0ka0O6+FZUWceyFv4vWq/0dXBMmrSeAwzOuOd/GxE5Pa64d/ndeNLG73dXoBsRzvtsVsYUv6Uw==} - - '@vercel/nft@0.26.4': - resolution: {integrity: sha512-j4jCOOXke2t8cHZCIxu1dzKLHLcFmYzC3yqAK6MfZznOL1QIJKd0xcFsXK3zcqzU7ScsE2zWkiMMNHGMHgp+FA==} - engines: {node: '>=16'} - hasBin: true - - abbrev@1.1.1: - resolution: {integrity: sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==} - - acorn-import-attributes@1.9.5: - resolution: {integrity: sha512-n02Vykv5uA3eHGM/Z2dQrcD56kL8TyDb2p1+0P83PClMnC/nc+anbQRhIOWnSq4Ke/KvDPrY3C9hDtC/A3eHnQ==} - peerDependencies: - acorn: ^8 - - acorn-walk@8.3.2: - resolution: {integrity: sha512-cjkyv4OtNCIeqhHrfS81QWXoCBPExR/J62oyEqepVw8WaQeSqpW2uhuLPh1m9eWhDuOo/jUXVTlifvesOWp/4A==} - engines: {node: '>=0.4.0'} - - acorn@8.11.3: - resolution: {integrity: sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==} - engines: {node: '>=0.4.0'} - hasBin: true - - agent-base@6.0.2: - resolution: {integrity: sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==} - engines: {node: '>= 6.0.0'} - - ansi-escapes@4.3.2: - resolution: {integrity: sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==} - engines: {node: '>=8'} - - ansi-regex@5.0.1: - resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} - engines: {node: '>=8'} - - ansi-regex@6.0.1: - resolution: {integrity: sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==} - engines: {node: '>=12'} - - ansi-styles@4.3.0: - resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} - engines: {node: '>=8'} - - ansi-styles@6.2.1: - resolution: {integrity: sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==} - engines: {node: '>=12'} - - aproba@2.0.0: - resolution: {integrity: sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==} - - are-we-there-yet@2.0.0: - resolution: {integrity: sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw==} - engines: {node: '>=10'} - - argparse@1.0.10: - resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==} - - argparse@2.0.1: - resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} - - array-find-index@1.0.2: - resolution: {integrity: sha512-M1HQyIXcBGtVywBt8WVdim+lrNaK7VHp99Qt5pSNziXznKHViIBbXWtfRTpEFpF/c4FdfxNAsCCwPp5phBYJtw==} - engines: {node: '>=0.10.0'} - - arrgv@1.0.2: - resolution: {integrity: sha512-a4eg4yhp7mmruZDQFqVMlxNRFGi/i1r87pt8SDHy0/I8PqSXoUTlWZRdAZo0VXgvEARcujbtTk8kiZRi1uDGRw==} - engines: {node: '>=8.0.0'} - - arrify@3.0.0: - resolution: {integrity: sha512-tLkvA81vQG/XqE2mjDkGQHoOINtMHtysSnemrmoGe6PydDPMRbVugqyk4A6V/WDWEfm3l+0d8anA9r8cv/5Jaw==} - engines: {node: '>=12'} - - async-sema@3.1.1: - resolution: {integrity: sha512-tLRNUXati5MFePdAk8dw7Qt7DpxPB60ofAgn8WRhW6a2rcimZnYBP9oxHiv0OHy+Wz7kPMG+t4LGdt31+4EmGg==} - - asynckit@0.4.0: - resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} - - ava@6.1.2: - resolution: {integrity: sha512-WcpxJ8yZ7mk9ABTinD0IAjcemovSeVGjuuwZx0JS9johREWFeLTl8UP6wd7l6nmnrWqkKZdwaD71a/ocH4qPKw==} - engines: {node: ^18.18 || ^20.8 || ^21} - hasBin: true - peerDependencies: - '@ava/typescript': '*' - peerDependenciesMeta: - '@ava/typescript': - optional: true - - axios@1.6.2: - resolution: {integrity: sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A==} - - balanced-match@1.0.2: - resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} - - base64-js@1.5.1: - resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==} - - before-after-hook@2.2.3: - resolution: {integrity: sha512-NzUnlZexiaH/46WDhANlyR2bXRopNg4F/zuSA3OpZnllCUgRaOF2znDioDWrmbNVsuZk6l9pMquQB38cfBZwkQ==} - - bindings@1.5.0: - resolution: {integrity: sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==} - - bl@4.1.0: - resolution: {integrity: sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==} - - blueimp-md5@2.19.0: - resolution: {integrity: sha512-DRQrD6gJyy8FbiE4s+bDoXS9hiW3Vbx5uCdwvcCf3zLHL+Iv7LtGHLpr+GZV8rHG8tK766FGYBwRbu8pELTt+w==} - - brace-expansion@1.1.11: - resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} - - braces@3.0.2: - resolution: {integrity: sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==} - engines: {node: '>=8'} - - buffer@5.7.1: - resolution: {integrity: sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==} - - call-bind@1.0.7: - resolution: {integrity: sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==} - engines: {node: '>= 0.4'} - - callsites@4.1.0: - resolution: {integrity: sha512-aBMbD1Xxay75ViYezwT40aQONfr+pSXTHwNKvIXhXD6+LY3F1dLIcceoC5OZKBVHbXcysz1hL9D2w0JJIMXpUw==} - engines: {node: '>=12.20'} - - camelize@1.0.1: - resolution: {integrity: sha512-dU+Tx2fsypxTgtLoE36npi3UqcjSSMNYfkqgmoEhtZrraP5VWq0K7FkWVTYa8eMPtnU/G2txVsfdCJTn9uzpuQ==} - - cbor@9.0.2: - resolution: {integrity: sha512-JPypkxsB10s9QOWwa6zwPzqE1Md3vqpPc+cai4sAecuCsRyAtAl/pMyhPlMbT/xtPnm2dznJZYRLui57qiRhaQ==} - engines: {node: '>=16'} - - chalk@4.1.2: - resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} - engines: {node: '>=10'} - - chalk@5.3.0: - resolution: {integrity: sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==} - engines: {node: ^12.17.0 || ^14.13 || >=16.0.0} - - chardet@0.7.0: - resolution: {integrity: sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==} - - chownr@2.0.0: - resolution: {integrity: sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==} - engines: {node: '>=10'} - - chunkd@2.0.1: - resolution: {integrity: sha512-7d58XsFmOq0j6el67Ug9mHf9ELUXsQXYJBkyxhH/k+6Ke0qXRnv0kbemx+Twc6fRJ07C49lcbdgm9FL1Ei/6SQ==} - - ci-info@4.0.0: - resolution: {integrity: sha512-TdHqgGf9odd8SXNuxtUBVx8Nv+qZOejE6qyqiy5NtbYYQOeFa6zmHkxlPzmaLxWWHsU6nJmB7AETdVPi+2NBUg==} - engines: {node: '>=8'} - - ci-parallel-vars@1.0.1: - resolution: {integrity: sha512-uvzpYrpmidaoxvIQHM+rKSrigjOe9feHYbw4uOI2gdfe1C3xIlxO+kVXq83WQWNniTf8bAxVpy+cQeFQsMERKg==} - - cli-cursor@3.1.0: - resolution: {integrity: sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==} - engines: {node: '>=8'} - - cli-spinners@2.9.2: - resolution: {integrity: sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==} - engines: {node: '>=6'} - - cli-truncate@4.0.0: - resolution: {integrity: sha512-nPdaFdQ0h/GEigbPClz11D0v/ZJEwxmeVZGeMo3Z5StPtUTkA9o1lD6QwoirYiSDzbcwn2XcjwmCp68W1IS4TA==} - engines: {node: '>=18'} - - cli-width@4.1.0: - resolution: {integrity: sha512-ouuZd4/dm2Sw5Gmqy6bGyNNNe1qt9RpmxveLSO7KcgsTnU7RXfsw+/bukWGo1abgBiMAic068rclZsO4IWmmxQ==} - engines: {node: '>= 12'} - - clipanion@3.2.1: - resolution: {integrity: sha512-dYFdjLb7y1ajfxQopN05mylEpK9ZX0sO1/RfMXdfmwjlIsPkbh4p7A682x++zFPLDCo1x3p82dtljHf5cW2LKA==} - peerDependencies: - typanion: '*' - - cliui@8.0.1: - resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==} - engines: {node: '>=12'} - - clone@1.0.4: - resolution: {integrity: sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==} - engines: {node: '>=0.8'} - - code-excerpt@4.0.0: - resolution: {integrity: sha512-xxodCmBen3iy2i0WtAK8FlFNrRzjUqjRsMfho58xT/wvZU1YTM3fCnRjcy1gJPMepaRlgm/0e6w8SpWHpn3/cA==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - color-convert@2.0.1: - resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} - engines: {node: '>=7.0.0'} - - color-name@1.1.4: - resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} - - color-support@1.1.3: - resolution: {integrity: sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==} - hasBin: true - - colorette@2.0.20: - resolution: {integrity: sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==} - - combined-stream@1.0.8: - resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} - engines: {node: '>= 0.8'} - - common-path-prefix@3.0.0: - resolution: {integrity: sha512-QE33hToZseCH3jS0qN96O/bSh3kaw/h+Tq7ngyY9eWDUnTlTNUyqfqvCXioLe5Na5jFsL78ra/wuBU4iuEgd4w==} - - concat-map@0.0.1: - resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} - - concordance@5.0.4: - resolution: {integrity: sha512-OAcsnTEYu1ARJqWVGwf4zh4JDfHZEaSNlNccFmt8YjB2l/n19/PF2viLINHc57vO4FKIAFl2FWASIGZZWZ2Kxw==} - engines: {node: '>=10.18.0 <11 || >=12.14.0 <13 || >=14'} - - console-control-strings@1.1.0: - resolution: {integrity: sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==} - - convert-to-spaces@2.0.1: - resolution: {integrity: sha512-rcQ1bsQO9799wq24uE5AM2tAILy4gXGIK/njFWcVQkGNZ96edlpY+A7bjwvzjYvLDyzmG1MmMLZhpcsb+klNMQ==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - css-color-keywords@1.0.0: - resolution: {integrity: sha512-FyyrDHZKEjXDpNJYvVsV960FiqQyXc/LlYmsxl2BcdMb2WPx0OGRVgTg55rPSyLSNMqP52R9r8geSp7apN3Ofg==} - engines: {node: '>=4'} - - css-to-react-native@3.2.0: - resolution: {integrity: sha512-e8RKaLXMOFii+02mOlqwjbD00KSEKqblnpO9e++1aXS1fPQOpS1YoqdVHBqPjHNoxeF2mimzVqawm2KCbEdtHQ==} - - csstype@3.1.3: - resolution: {integrity: sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==} - - currently-unhandled@0.4.1: - resolution: {integrity: sha512-/fITjgjGU50vjQ4FH6eUoYu+iUoUKIXws2hL15JJpIR+BbTxaXQsMuuyjtNh2WqsSBS5nsaZHFsFecyw5CCAng==} - engines: {node: '>=0.10.0'} - - date-time@3.1.0: - resolution: {integrity: sha512-uqCUKXE5q1PNBXjPqvwhwJf9SwMoAHBgWJ6DcrnS5o+W2JOiIILl0JEdVD8SGujrNS02GGxgwAg2PN2zONgtjg==} - engines: {node: '>=6'} - - debug@4.3.4: - resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==} - engines: {node: '>=6.0'} - peerDependencies: - supports-color: '*' - peerDependenciesMeta: - supports-color: - optional: true - - defaults@1.0.4: - resolution: {integrity: sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A==} - - define-data-property@1.1.4: - resolution: {integrity: sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==} - engines: {node: '>= 0.4'} - - delayed-stream@1.0.0: - resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} - engines: {node: '>=0.4.0'} - - delegates@1.0.0: - resolution: {integrity: sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==} - - deprecation@2.3.1: - resolution: {integrity: sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==} - - detect-libc@2.0.3: - resolution: {integrity: sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw==} - engines: {node: '>=8'} - - emittery@1.0.3: - resolution: {integrity: sha512-tJdCJitoy2lrC2ldJcqN4vkqJ00lT+tOWNT1hBJjO/3FDMJa5TTIiYGCKGkn/WfCyOzUMObeohbVTj00fhiLiA==} - engines: {node: '>=14.16'} - - emnapi@1.1.1: - resolution: {integrity: sha512-md0YDBLCX+378+zzibHvOLsj28YKFy8vl7BiSzVocCY7HujOkYt+N5LCOYqLeYi5C5/5NlnkNweVdUjrvKpGNg==} - peerDependencies: - node-addon-api: '>= 6.1.0' - peerDependenciesMeta: - node-addon-api: - optional: true - - emoji-regex@10.3.0: - resolution: {integrity: sha512-QpLs9D9v9kArv4lfDEgg1X/gN5XLnf/A6l9cs8SPZLRZR3ZkY9+kwIQTxm+fsSej5UMYGE8fdoaZVIBlqG0XTw==} - - emoji-regex@8.0.0: - resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} - - es-define-property@1.0.0: - resolution: {integrity: sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==} - engines: {node: '>= 0.4'} - - es-errors@1.3.0: - resolution: {integrity: sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==} - engines: {node: '>= 0.4'} - - escalade@3.1.2: - resolution: {integrity: sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==} - engines: {node: '>=6'} - - escape-string-regexp@2.0.0: - resolution: {integrity: sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==} - engines: {node: '>=8'} - - escape-string-regexp@5.0.0: - resolution: {integrity: sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==} - engines: {node: '>=12'} - - esprima@4.0.1: - resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==} - engines: {node: '>=4'} - hasBin: true - - estree-walker@2.0.2: - resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==} - - esutils@2.0.3: - resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} - engines: {node: '>=0.10.0'} - - external-editor@3.1.0: - resolution: {integrity: sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==} - engines: {node: '>=4'} - - fast-diff@1.3.0: - resolution: {integrity: sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==} - - fast-glob@3.3.2: - resolution: {integrity: sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==} - engines: {node: '>=8.6.0'} - - fastq@1.17.1: - resolution: {integrity: sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==} - - figures@6.1.0: - resolution: {integrity: sha512-d+l3qxjSesT4V7v2fh+QnmFnUWv9lSpjarhShNTgBOfA0ttejbQUAlHLitbjkoRiDulW0OPoQPYIGhIC8ohejg==} - engines: {node: '>=18'} - - file-uri-to-path@1.0.0: - resolution: {integrity: sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==} - - fill-range@7.0.1: - resolution: {integrity: sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==} - engines: {node: '>=8'} - - find-up-simple@1.0.0: - resolution: {integrity: sha512-q7Us7kcjj2VMePAa02hDAF6d+MzsdsAWEwYyOpwUtlerRBkOEPBCRZrAV4XfcSN8fHAgaD0hP7miwoay6DCprw==} - engines: {node: '>=18'} - - follow-redirects@1.15.6: - resolution: {integrity: sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==} - engines: {node: '>=4.0'} - peerDependencies: - debug: '*' - peerDependenciesMeta: - debug: - optional: true - - form-data@4.0.0: - resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==} - engines: {node: '>= 6'} - - fs-minipass@2.1.0: - resolution: {integrity: sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==} - engines: {node: '>= 8'} - - fs.realpath@1.0.0: - resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} - - function-bind@1.1.2: - resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==} - - gauge@3.0.2: - resolution: {integrity: sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q==} - engines: {node: '>=10'} - - get-caller-file@2.0.5: - resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} - engines: {node: 6.* || 8.* || >= 10.*} - - get-east-asian-width@1.2.0: - resolution: {integrity: sha512-2nk+7SIVb14QrgXFHcm84tD4bKQz0RxPuMT8Ag5KPOq7J5fEmAg0UbXdTOSHqNuHSU28k55qnceesxXRZGzKWA==} - engines: {node: '>=18'} - - get-intrinsic@1.2.4: - resolution: {integrity: sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==} - engines: {node: '>= 0.4'} - - glob-parent@5.1.2: - resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} - engines: {node: '>= 6'} - - glob@7.2.3: - resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} - - globby@14.0.1: - resolution: {integrity: sha512-jOMLD2Z7MAhyG8aJpNOpmziMOP4rPLcc95oQPKXBazW82z+CEgPFBQvEpRUa1KeIMUJo4Wsm+q6uzO/Q/4BksQ==} - engines: {node: '>=18'} - - gopd@1.0.1: - resolution: {integrity: sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==} - - graceful-fs@4.2.11: - resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} - - has-flag@4.0.0: - resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} - engines: {node: '>=8'} - - has-property-descriptors@1.0.2: - resolution: {integrity: sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==} - - has-proto@1.0.3: - resolution: {integrity: sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==} - engines: {node: '>= 0.4'} - - has-symbols@1.0.3: - resolution: {integrity: sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==} - engines: {node: '>= 0.4'} - - has-unicode@2.0.1: - resolution: {integrity: sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==} - - hasown@2.0.2: - resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==} - engines: {node: '>= 0.4'} - - https-proxy-agent@5.0.1: - resolution: {integrity: sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==} - engines: {node: '>= 6'} - - iconv-lite@0.4.24: - resolution: {integrity: sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==} - engines: {node: '>=0.10.0'} - - ieee754@1.2.1: - resolution: {integrity: sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==} - - ignore-by-default@2.1.0: - resolution: {integrity: sha512-yiWd4GVmJp0Q6ghmM2B/V3oZGRmjrKLXvHR3TE1nfoXsmoggllfZUQe74EN0fJdPFZu2NIvNdrMMLm3OsV7Ohw==} - engines: {node: '>=10 <11 || >=12 <13 || >=14'} - - ignore@5.3.1: - resolution: {integrity: sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==} - engines: {node: '>= 4'} - - imurmurhash@0.1.4: - resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} - engines: {node: '>=0.8.19'} - - indent-string@5.0.0: - resolution: {integrity: sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==} - engines: {node: '>=12'} - - inflight@1.0.6: - resolution: {integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==} - - inherits@2.0.4: - resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} - - inquirer@9.2.19: - resolution: {integrity: sha512-WpxOT71HGsFya6/mj5PUue0sWwbpbiPfAR+332zLj/siB0QA1PZM8v3GepegFV1Op189UxHUCF6y8AySdtOMVA==} - engines: {node: '>=18'} - - irregular-plurals@3.5.0: - resolution: {integrity: sha512-1ANGLZ+Nkv1ptFb2pa8oG8Lem4krflKuX/gINiHJHjJUKaJHk/SXk5x6K3J+39/p0h1RQ2saROclJJ+QLvETCQ==} - engines: {node: '>=8'} - - is-extglob@2.1.1: - resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} - engines: {node: '>=0.10.0'} - - is-fullwidth-code-point@3.0.0: - resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} - engines: {node: '>=8'} - - is-fullwidth-code-point@4.0.0: - resolution: {integrity: sha512-O4L094N2/dZ7xqVdrXhh9r1KODPJpFms8B5sGdJLPy664AgvXsreZUyCQQNItZRDlYug4xStLjNp/sz3HvBowQ==} - engines: {node: '>=12'} - - is-glob@4.0.3: - resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} - engines: {node: '>=0.10.0'} - - is-interactive@1.0.0: - resolution: {integrity: sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w==} - engines: {node: '>=8'} - - is-number@7.0.0: - resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} - engines: {node: '>=0.12.0'} - - is-plain-object@5.0.0: - resolution: {integrity: sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==} - engines: {node: '>=0.10.0'} - - is-promise@4.0.0: - resolution: {integrity: sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==} - - is-unicode-supported@0.1.0: - resolution: {integrity: sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==} - engines: {node: '>=10'} - - is-unicode-supported@2.0.0: - resolution: {integrity: sha512-FRdAyx5lusK1iHG0TWpVtk9+1i+GjrzRffhDg4ovQ7mcidMQ6mj+MhKPmvh7Xwyv5gIS06ns49CA7Sqg7lC22Q==} - engines: {node: '>=18'} - - js-string-escape@1.0.1: - resolution: {integrity: sha512-Smw4xcfIQ5LVjAOuJCvN/zIodzA/BBSsluuoSykP+lUvScIi4U6RJLfwHet5cxFnCswUjISV8oAXaqaJDY3chg==} - engines: {node: '>= 0.8'} - - js-tokens@4.0.0: - resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} - - js-yaml@3.14.1: - resolution: {integrity: sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==} - hasBin: true - - js-yaml@4.1.0: - resolution: {integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==} - hasBin: true - - load-json-file@7.0.1: - resolution: {integrity: sha512-Gnxj3ev3mB5TkVBGad0JM6dmLiQL+o0t23JPBZ9sd+yvSLk05mFoqKBw5N8gbbkU4TNXyqCgIrl/VM17OgUIgQ==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - lodash-es@4.17.21: - resolution: {integrity: sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==} - - lodash@4.17.21: - resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} - - log-symbols@4.1.0: - resolution: {integrity: sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==} - engines: {node: '>=10'} - - loose-envify@1.4.0: - resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==} - hasBin: true - - lru-cache@6.0.0: - resolution: {integrity: sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==} - engines: {node: '>=10'} - - make-dir@3.1.0: - resolution: {integrity: sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==} - engines: {node: '>=8'} - - matcher@5.0.0: - resolution: {integrity: sha512-s2EMBOWtXFc8dgqvoAzKJXxNHibcdJMV0gwqKUaw9E2JBJuGUK7DrNKrA6g/i+v72TT16+6sVm5mS3thaMLQUw==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - md5-hex@3.0.1: - resolution: {integrity: sha512-BUiRtTtV39LIJwinWBjqVsU9xhdnz7/i889V859IBFpuqGAj6LuOvHv5XLbgZ2R7ptJoJaEcxkv88/h25T7Ciw==} - engines: {node: '>=8'} - - memoize@10.0.0: - resolution: {integrity: sha512-H6cBLgsi6vMWOcCpvVCdFFnl3kerEXbrYh9q+lY6VXvQSmM6CkmV08VOwT+WE2tzIEqRPFfAq3fm4v/UIW6mSA==} - engines: {node: '>=18'} - - merge2@1.4.1: - resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} - engines: {node: '>= 8'} - - micromatch@4.0.5: - resolution: {integrity: sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==} - engines: {node: '>=8.6'} - - mime-db@1.52.0: - resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} - engines: {node: '>= 0.6'} - - mime-types@2.1.35: - resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} - engines: {node: '>= 0.6'} - - mimic-fn@2.1.0: - resolution: {integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==} - engines: {node: '>=6'} - - mimic-function@5.0.1: - resolution: {integrity: sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==} - engines: {node: '>=18'} - - minimatch@3.1.2: - resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} - - minipass@3.3.6: - resolution: {integrity: sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==} - engines: {node: '>=8'} - - minipass@5.0.0: - resolution: {integrity: sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==} - engines: {node: '>=8'} - - minizlib@2.1.2: - resolution: {integrity: sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==} - engines: {node: '>= 8'} - - mkdirp@1.0.4: - resolution: {integrity: sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==} - engines: {node: '>=10'} - hasBin: true - - ms@2.1.2: - resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} - - ms@2.1.3: - resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} - - mute-stream@1.0.0: - resolution: {integrity: sha512-avsJQhyd+680gKXyG/sQc0nXaC6rBkPOfyHYcFb9+hdkqQkR9bdnkJ0AMZhke0oesPqIO+mFFJ+IdBc7mst4IA==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - - nanoid@3.3.7: - resolution: {integrity: sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==} - engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} - hasBin: true - - node-fetch@2.7.0: - resolution: {integrity: sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==} - engines: {node: 4.x || >=6.0.0} - peerDependencies: - encoding: ^0.1.0 - peerDependenciesMeta: - encoding: - optional: true - - node-gyp-build@4.8.0: - resolution: {integrity: sha512-u6fs2AEUljNho3EYTJNBfImO5QTo/J/1Etd+NVdCj7qWKUSN/bSLkZwhDv7I+w/MSC6qJ4cknepkAYykDdK8og==} - hasBin: true - - nofilter@3.1.0: - resolution: {integrity: sha512-l2NNj07e9afPnhAhvgVrCD/oy2Ai1yfLpuo3EpiO1jFTsB4sFz6oIfAfSZyQzVpkZQ9xS8ZS5g1jCBgq4Hwo0g==} - engines: {node: '>=12.19'} - - nopt@5.0.0: - resolution: {integrity: sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==} - engines: {node: '>=6'} - hasBin: true - - npmlog@5.0.1: - resolution: {integrity: sha512-AqZtDUWOMKs1G/8lwylVjrdYgqA4d9nu8hc+0gzRxlDb1I10+FHBGMXs6aiQHFdCUUlqH99MUMuLfzWDNDtfxw==} - - object-assign@4.1.1: - resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} - engines: {node: '>=0.10.0'} - - once@1.4.0: - resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} - - onetime@5.1.2: - resolution: {integrity: sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==} - engines: {node: '>=6'} - - ora@5.4.1: - resolution: {integrity: sha512-5b6Y85tPxZZ7QytO+BQzysW31HJku27cRIlkbAXaNx+BdcVi+LlRFmVXzeF6a7JCwJpyw5c4b+YSVImQIrBpuQ==} - engines: {node: '>=10'} - - os-tmpdir@1.0.2: - resolution: {integrity: sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==} - engines: {node: '>=0.10.0'} - - p-map@7.0.2: - resolution: {integrity: sha512-z4cYYMMdKHzw4O5UkWJImbZynVIo0lSGTXc7bzB1e/rrDqkgGUNysK/o4bTr+0+xKvvLoTyGqYC4Fgljy9qe1Q==} - engines: {node: '>=18'} - - package-config@5.0.0: - resolution: {integrity: sha512-GYTTew2slBcYdvRHqjhwaaydVMvn/qrGC323+nKclYioNSLTDUM/lGgtGTgyHVtYcozb+XkE8CNhwcraOmZ9Mg==} - engines: {node: '>=18'} - - parse-ms@4.0.0: - resolution: {integrity: sha512-TXfryirbmq34y8QBwgqCVLi+8oA3oWx2eAnSn62ITyEhEYaWRlVZ2DvMM9eZbMs/RfxPu/PK/aBLyGj4IrqMHw==} - engines: {node: '>=18'} - - path-is-absolute@1.0.1: - resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==} - engines: {node: '>=0.10.0'} - - path-type@5.0.0: - resolution: {integrity: sha512-5HviZNaZcfqP95rwpv+1HDgUamezbqdSYTyzjTvwtJSnIH+3vnbmWsItli8OFEndS984VT55M3jduxZbX351gg==} - engines: {node: '>=12'} - - picocolors@1.0.1: - resolution: {integrity: sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==} - - picomatch@2.3.1: - resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} - engines: {node: '>=8.6'} - - picomatch@3.0.1: - resolution: {integrity: sha512-I3EurrIQMlRc9IaAZnqRR044Phh2DXY+55o7uJ0V+hYZAcQYSuFWsc9q5PvyDHUSCe1Qxn/iBz+78s86zWnGag==} - engines: {node: '>=10'} - - plur@5.1.0: - resolution: {integrity: sha512-VP/72JeXqak2KiOzjgKtQen5y3IZHn+9GOuLDafPv0eXa47xq0At93XahYBs26MsifCQ4enGKwbjBTKgb9QJXg==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - postcss-value-parser@4.2.0: - resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==} - - postcss@8.4.33: - resolution: {integrity: sha512-Kkpbhhdjw2qQs2O2DGX+8m5OVqEcbB9HRBvuYM9pgrjEFUg30A9LmXNlTAUj4S9kgtGyrMbTzVjH7E+s5Re2yg==} - engines: {node: ^10 || ^12 || >=14} - - pretty-ms@9.0.0: - resolution: {integrity: sha512-E9e9HJ9R9NasGOgPaPE8VMeiPKAyWR5jcFpNnwIejslIhWqdqOrb2wShBsncMPUb+BcCd2OPYfh7p2W6oemTng==} - engines: {node: '>=18'} - - proxy-from-env@1.1.0: - resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==} - - queue-microtask@1.2.3: - resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} - - react-dom@18.3.1: - resolution: {integrity: sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==} - peerDependencies: - react: ^18.3.1 - - react@18.3.1: - resolution: {integrity: sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==} - engines: {node: '>=0.10.0'} - - readable-stream@3.6.2: - resolution: {integrity: sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==} - engines: {node: '>= 6'} - - require-directory@2.1.1: - resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} - engines: {node: '>=0.10.0'} - - resolve-cwd@3.0.0: - resolution: {integrity: sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==} - engines: {node: '>=8'} - - resolve-from@5.0.0: - resolution: {integrity: sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==} - engines: {node: '>=8'} - - restore-cursor@3.1.0: - resolution: {integrity: sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==} - engines: {node: '>=8'} - - reusify@1.0.4: - resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==} - engines: {iojs: '>=1.0.0', node: '>=0.10.0'} - - rimraf@3.0.2: - resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==} - hasBin: true - - run-async@3.0.0: - resolution: {integrity: sha512-540WwVDOMxA6dN6We19EcT9sc3hkXPw5mzRNGM3FkdN/vtE9NFvj5lFAPNwUDmJjXidm3v7TC1cTE7t17Ulm1Q==} - engines: {node: '>=0.12.0'} - - run-parallel@1.2.0: - resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} - - rxjs@7.8.1: - resolution: {integrity: sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==} - - safe-buffer@5.2.1: - resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} - - safer-buffer@2.1.2: - resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} - - scheduler@0.23.2: - resolution: {integrity: sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ==} - - semver@6.3.1: - resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} - hasBin: true - - semver@7.6.0: - resolution: {integrity: sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==} - engines: {node: '>=10'} - hasBin: true - - serialize-error@7.0.1: - resolution: {integrity: sha512-8I8TjW5KMOKsZQTvoxjuSIa7foAwPWGOts+6o7sgjz41/qMD9VQHEDxi6PBvK2l0MXUmqZyNpUK+T2tQaaElvw==} - engines: {node: '>=10'} - - set-blocking@2.0.0: - resolution: {integrity: sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==} - - set-function-length@1.2.2: - resolution: {integrity: sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==} - engines: {node: '>= 0.4'} - - shallowequal@1.1.0: - resolution: {integrity: sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ==} - - signal-exit@3.0.7: - resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} - - signal-exit@4.1.0: - resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} - engines: {node: '>=14'} - - slash@5.1.0: - resolution: {integrity: sha512-ZA6oR3T/pEyuqwMgAKT0/hAv8oAXckzbkmR0UkUosQ+Mc4RxGoJkRmwHgHufaenlyAgE1Mxgpdcrf75y6XcnDg==} - engines: {node: '>=14.16'} - - slice-ansi@5.0.0: - resolution: {integrity: sha512-FC+lgizVPfie0kkhqUScwRu1O/lF6NOgJmlCgK+/LYxDCTk8sGelYaHDhFcDN+Sn3Cv+3VSa4Byeo+IMCzpMgQ==} - engines: {node: '>=12'} - - source-map-js@1.2.0: - resolution: {integrity: sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==} - engines: {node: '>=0.10.0'} - - sprintf-js@1.0.3: - resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==} - - stack-utils@2.0.6: - resolution: {integrity: sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==} - engines: {node: '>=10'} - - string-width@4.2.3: - resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} - engines: {node: '>=8'} - - string-width@7.1.0: - resolution: {integrity: sha512-SEIJCWiX7Kg4c129n48aDRwLbFb2LJmXXFrWBG4NGaRtMQ3myKPKbwrD1BKqQn74oCoNMBVrfDEr5M9YxCsrkw==} - engines: {node: '>=18'} - - string_decoder@1.3.0: - resolution: {integrity: sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==} - - strip-ansi@6.0.1: - resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} - engines: {node: '>=8'} - - strip-ansi@7.1.0: - resolution: {integrity: sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==} - engines: {node: '>=12'} - - styled-components@6.1.1: - resolution: {integrity: sha512-cpZZP5RrKRIClBW5Eby4JM1wElLVP4NQrJbJ0h10TidTyJf4SIIwa3zLXOoPb4gJi8MsJ8mjq5mu2IrEhZIAcQ==} - engines: {node: '>= 16'} - peerDependencies: - react: '>= 16.8.0' - react-dom: '>= 16.8.0' - - stylis@4.3.2: - resolution: {integrity: sha512-bhtUjWd/z6ltJiQwg0dUfxEJ+W+jdqQd8TbWLWyeIJHlnsqmGLRFFd8e5mA0AZi/zx90smXRlN66YMTcaSFifg==} - - supertap@3.0.1: - resolution: {integrity: sha512-u1ZpIBCawJnO+0QePsEiOknOfCRq0yERxiAchT0i4li0WHNUJbf0evXXSXOcCAR4M8iMDoajXYmstm/qO81Isw==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - supports-color@7.2.0: - resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} - engines: {node: '>=8'} - - tar@6.2.1: - resolution: {integrity: sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==} - engines: {node: '>=10'} - - temp-dir@3.0.0: - resolution: {integrity: sha512-nHc6S/bwIilKHNRgK/3jlhDoIHcp45YgyiwcAk46Tr0LfEqGBVpmiAyuiuxeVE44m3mXnEeVhaipLOEWmH+Njw==} - engines: {node: '>=14.16'} - - time-zone@1.0.0: - resolution: {integrity: sha512-TIsDdtKo6+XrPtiTm1ssmMngN1sAhyKnTO2kunQWqNPWIVvCm15Wmw4SWInwTVgJ5u/Tr04+8Ei9TNcw4x4ONA==} - engines: {node: '>=4'} - - tmp@0.0.33: - resolution: {integrity: sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==} - engines: {node: '>=0.6.0'} - - to-regex-range@5.0.1: - resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} - engines: {node: '>=8.0'} - - toml@3.0.0: - resolution: {integrity: sha512-y/mWCZinnvxjTKYhJ+pYxwD0mRLVvOtdS2Awbgxln6iEnt4rk0yBxeSBHkGJcPucRiG0e55mwWp+g/05rsrd6w==} - - tr46@0.0.3: - resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==} - - tslib@2.6.2: - resolution: {integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==} - - typanion@3.14.0: - resolution: {integrity: sha512-ZW/lVMRabETuYCd9O9ZvMhAh8GslSqaUjxmK/JLPCh6l73CvLBiuXswj/+7LdnWOgYsQ130FqLzFz5aGT4I3Ug==} - - type-fest@0.13.1: - resolution: {integrity: sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==} - engines: {node: '>=10'} - - type-fest@0.21.3: - resolution: {integrity: sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==} - engines: {node: '>=10'} - - typescript@5.4.5: - resolution: {integrity: sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==} - engines: {node: '>=14.17'} - hasBin: true - - undici-types@5.26.5: - resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==} - - unicorn-magic@0.1.0: - resolution: {integrity: sha512-lRfVq8fE8gz6QMBuDM6a+LO3IAzTi05H6gCVaUpir2E1Rwpo4ZUog45KpNXKC/Mn3Yb9UDuHumeFTo9iV/D9FQ==} - engines: {node: '>=18'} - - universal-user-agent@6.0.1: - resolution: {integrity: sha512-yCzhz6FN2wU1NiiQRogkTQszlQSlpWaw8SvVegAc+bDxbzHgh1vX8uIe8OYyMH6DwH+sdTJsgMl36+mSMdRJIQ==} - - util-deprecate@1.0.2: - resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} - - wasm-sjlj@1.0.5: - resolution: {integrity: sha512-Z/MHJeOkAvJJVWnGX3/YZGYldGaawZbYHX4ldYG9kLhcdB8H31F5x66M7Zc4BP/7pg0aLsusQj1629m2B3Rilg==} - - wcwidth@1.0.1: - resolution: {integrity: sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==} - - webidl-conversions@3.0.1: - resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==} - - well-known-symbols@2.0.0: - resolution: {integrity: sha512-ZMjC3ho+KXo0BfJb7JgtQ5IBuvnShdlACNkKkdsqBmYw3bPAaJfPeYUo6tLUaT5tG/Gkh7xkpBhKRQ9e7pyg9Q==} - engines: {node: '>=6'} - - whatwg-url@5.0.0: - resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==} - - wide-align@1.1.5: - resolution: {integrity: sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==} - - wrap-ansi@6.2.0: - resolution: {integrity: sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==} - engines: {node: '>=8'} - - wrap-ansi@7.0.0: - resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==} - engines: {node: '>=10'} - - wrappy@1.0.2: - resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} - - write-file-atomic@5.0.1: - resolution: {integrity: sha512-+QU2zd6OTD8XWIJCbffaiQeH9U73qIqafo1x6V1snCWYGJf6cVE0cDR4D8xRzcEnfI21IFrUPzPGtcPf8AC+Rw==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - - y18n@5.0.8: - resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==} - engines: {node: '>=10'} - - yallist@4.0.0: - resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==} - - yargs-parser@21.1.1: - resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} - engines: {node: '>=12'} - - yargs@17.7.2: - resolution: {integrity: sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==} - engines: {node: '>=12'} - -snapshots: - - '@emnapi/core@1.1.1': - dependencies: - tslib: 2.6.2 - - '@emnapi/runtime@1.1.1': - dependencies: - tslib: 2.6.2 - - '@emotion/is-prop-valid@1.2.2': - dependencies: - '@emotion/memoize': 0.8.1 - - '@emotion/memoize@0.8.1': {} - - '@emotion/unitless@0.8.1': {} - - '@inquirer/figures@1.0.1': {} - - '@ljharb/through@2.3.13': - dependencies: - call-bind: 1.0.7 - - '@mapbox/node-pre-gyp@1.0.11': - dependencies: - detect-libc: 2.0.3 - https-proxy-agent: 5.0.1 - make-dir: 3.1.0 - node-fetch: 2.7.0 - nopt: 5.0.0 - npmlog: 5.0.1 - rimraf: 3.0.2 - semver: 7.6.0 - tar: 6.2.1 - transitivePeerDependencies: - - encoding - - supports-color - - '@napi-rs/cli@3.0.0-alpha.51(@emnapi/runtime@1.1.1)(emnapi@1.1.1)': - dependencies: - '@napi-rs/cross-toolchain': 0.0.14 - '@napi-rs/wasm-tools': 0.0.1 - '@octokit/rest': 20.1.0 - clipanion: 3.2.1(typanion@3.14.0) - colorette: 2.0.20 - debug: 4.3.4 - inquirer: 9.2.19 - js-yaml: 4.1.0 - lodash-es: 4.17.21 - semver: 7.6.0 - toml: 3.0.0 - typanion: 3.14.0 - wasm-sjlj: 1.0.5 - optionalDependencies: - '@emnapi/runtime': 1.1.1 - emnapi: 1.1.1 - transitivePeerDependencies: - - '@napi-rs/cross-toolchain-arm64-target-aarch64' - - '@napi-rs/cross-toolchain-arm64-target-armv7' - - '@napi-rs/cross-toolchain-arm64-target-x86_64' - - '@napi-rs/cross-toolchain-x64-target-aarch64' - - '@napi-rs/cross-toolchain-x64-target-armv7' - - '@napi-rs/cross-toolchain-x64-target-x86_64' - - supports-color - - '@napi-rs/cross-toolchain@0.0.14': - dependencies: - '@napi-rs/lzma': 1.2.1 - '@napi-rs/tar': 0.1.0 - debug: 4.3.4 - transitivePeerDependencies: - - supports-color - - '@napi-rs/lzma-android-arm-eabi@1.2.1': - optional: true - - '@napi-rs/lzma-android-arm64@1.2.1': - optional: true - - '@napi-rs/lzma-darwin-arm64@1.2.1': - optional: true - - '@napi-rs/lzma-darwin-x64@1.2.1': - optional: true - - '@napi-rs/lzma-freebsd-x64@1.2.1': - optional: true - - '@napi-rs/lzma-linux-arm-gnueabihf@1.2.1': - optional: true - - '@napi-rs/lzma-linux-arm64-gnu@1.2.1': - optional: true - - '@napi-rs/lzma-linux-arm64-musl@1.2.1': - optional: true - - '@napi-rs/lzma-linux-x64-gnu@1.2.1': - optional: true - - '@napi-rs/lzma-linux-x64-musl@1.2.1': - optional: true - - '@napi-rs/lzma-win32-arm64-msvc@1.2.1': - optional: true - - '@napi-rs/lzma-win32-ia32-msvc@1.2.1': - optional: true - - '@napi-rs/lzma-win32-x64-msvc@1.2.1': - optional: true - - '@napi-rs/lzma@1.2.1': - optionalDependencies: - '@napi-rs/lzma-android-arm-eabi': 1.2.1 - '@napi-rs/lzma-android-arm64': 1.2.1 - '@napi-rs/lzma-darwin-arm64': 1.2.1 - '@napi-rs/lzma-darwin-x64': 1.2.1 - '@napi-rs/lzma-freebsd-x64': 1.2.1 - '@napi-rs/lzma-linux-arm-gnueabihf': 1.2.1 - '@napi-rs/lzma-linux-arm64-gnu': 1.2.1 - '@napi-rs/lzma-linux-arm64-musl': 1.2.1 - '@napi-rs/lzma-linux-x64-gnu': 1.2.1 - '@napi-rs/lzma-linux-x64-musl': 1.2.1 - '@napi-rs/lzma-win32-arm64-msvc': 1.2.1 - '@napi-rs/lzma-win32-ia32-msvc': 1.2.1 - '@napi-rs/lzma-win32-x64-msvc': 1.2.1 - - '@napi-rs/tar-android-arm-eabi@0.1.0': - optional: true - - '@napi-rs/tar-android-arm64@0.1.0': - optional: true - - '@napi-rs/tar-darwin-arm64@0.1.0': - optional: true - - '@napi-rs/tar-darwin-x64@0.1.0': - optional: true - - '@napi-rs/tar-freebsd-x64@0.1.0': - optional: true - - '@napi-rs/tar-linux-arm-gnueabihf@0.1.0': - optional: true - - '@napi-rs/tar-linux-arm64-gnu@0.1.0': - optional: true - - '@napi-rs/tar-linux-arm64-musl@0.1.0': - optional: true - - '@napi-rs/tar-linux-x64-gnu@0.1.0': - optional: true - - '@napi-rs/tar-linux-x64-musl@0.1.0': - optional: true - - '@napi-rs/tar-win32-arm64-msvc@0.1.0': - optional: true - - '@napi-rs/tar-win32-ia32-msvc@0.1.0': - optional: true - - '@napi-rs/tar-win32-x64-msvc@0.1.0': - optional: true - - '@napi-rs/tar@0.1.0': - optionalDependencies: - '@napi-rs/tar-android-arm-eabi': 0.1.0 - '@napi-rs/tar-android-arm64': 0.1.0 - '@napi-rs/tar-darwin-arm64': 0.1.0 - '@napi-rs/tar-darwin-x64': 0.1.0 - '@napi-rs/tar-freebsd-x64': 0.1.0 - '@napi-rs/tar-linux-arm-gnueabihf': 0.1.0 - '@napi-rs/tar-linux-arm64-gnu': 0.1.0 - '@napi-rs/tar-linux-arm64-musl': 0.1.0 - '@napi-rs/tar-linux-x64-gnu': 0.1.0 - '@napi-rs/tar-linux-x64-musl': 0.1.0 - '@napi-rs/tar-win32-arm64-msvc': 0.1.0 - '@napi-rs/tar-win32-ia32-msvc': 0.1.0 - '@napi-rs/tar-win32-x64-msvc': 0.1.0 - - '@napi-rs/wasm-runtime@0.1.2': - dependencies: - '@emnapi/core': 1.1.1 - '@emnapi/runtime': 1.1.1 - '@tybys/wasm-util': 0.8.3 - optional: true - - '@napi-rs/wasm-runtime@0.2.0': - dependencies: - '@emnapi/core': 1.1.1 - '@emnapi/runtime': 1.1.1 - '@tybys/wasm-util': 0.8.3 - - '@napi-rs/wasm-tools-android-arm-eabi@0.0.1': - optional: true - - '@napi-rs/wasm-tools-android-arm64@0.0.1': - optional: true - - '@napi-rs/wasm-tools-darwin-arm64@0.0.1': - optional: true - - '@napi-rs/wasm-tools-darwin-x64@0.0.1': - optional: true - - '@napi-rs/wasm-tools-freebsd-x64@0.0.1': - optional: true - - '@napi-rs/wasm-tools-linux-arm64-gnu@0.0.1': - optional: true - - '@napi-rs/wasm-tools-linux-arm64-musl@0.0.1': - optional: true - - '@napi-rs/wasm-tools-linux-x64-gnu@0.0.1': - optional: true - - '@napi-rs/wasm-tools-linux-x64-musl@0.0.1': - optional: true - - '@napi-rs/wasm-tools-wasm32-wasi@0.0.1': - dependencies: - '@napi-rs/wasm-runtime': 0.1.2 - optional: true - - '@napi-rs/wasm-tools-win32-arm64-msvc@0.0.1': - optional: true - - '@napi-rs/wasm-tools-win32-ia32-msvc@0.0.1': - optional: true - - '@napi-rs/wasm-tools-win32-x64-msvc@0.0.1': - optional: true - - '@napi-rs/wasm-tools@0.0.1': - optionalDependencies: - '@napi-rs/wasm-tools-android-arm-eabi': 0.0.1 - '@napi-rs/wasm-tools-android-arm64': 0.0.1 - '@napi-rs/wasm-tools-darwin-arm64': 0.0.1 - '@napi-rs/wasm-tools-darwin-x64': 0.0.1 - '@napi-rs/wasm-tools-freebsd-x64': 0.0.1 - '@napi-rs/wasm-tools-linux-arm64-gnu': 0.0.1 - '@napi-rs/wasm-tools-linux-arm64-musl': 0.0.1 - '@napi-rs/wasm-tools-linux-x64-gnu': 0.0.1 - '@napi-rs/wasm-tools-linux-x64-musl': 0.0.1 - '@napi-rs/wasm-tools-wasm32-wasi': 0.0.1 - '@napi-rs/wasm-tools-win32-arm64-msvc': 0.0.1 - '@napi-rs/wasm-tools-win32-ia32-msvc': 0.0.1 - '@napi-rs/wasm-tools-win32-x64-msvc': 0.0.1 - - '@nodelib/fs.scandir@2.1.5': - dependencies: - '@nodelib/fs.stat': 2.0.5 - run-parallel: 1.2.0 - - '@nodelib/fs.stat@2.0.5': {} - - '@nodelib/fs.walk@1.2.8': - dependencies: - '@nodelib/fs.scandir': 2.1.5 - fastq: 1.17.1 - - '@octokit/auth-token@4.0.0': {} - - '@octokit/core@5.2.0': - dependencies: - '@octokit/auth-token': 4.0.0 - '@octokit/graphql': 7.1.0 - '@octokit/request': 8.4.0 - '@octokit/request-error': 5.1.0 - '@octokit/types': 13.4.1 - before-after-hook: 2.2.3 - universal-user-agent: 6.0.1 - - '@octokit/endpoint@9.0.5': - dependencies: - '@octokit/types': 13.4.1 - universal-user-agent: 6.0.1 - - '@octokit/graphql@7.1.0': - dependencies: - '@octokit/request': 8.4.0 - '@octokit/types': 13.4.1 - universal-user-agent: 6.0.1 - - '@octokit/openapi-types@20.0.0': {} - - '@octokit/openapi-types@22.1.0': {} - - '@octokit/plugin-paginate-rest@9.2.1(@octokit/core@5.2.0)': - dependencies: - '@octokit/core': 5.2.0 - '@octokit/types': 12.6.0 - - '@octokit/plugin-request-log@4.0.1(@octokit/core@5.2.0)': - dependencies: - '@octokit/core': 5.2.0 - - '@octokit/plugin-rest-endpoint-methods@10.4.1(@octokit/core@5.2.0)': - dependencies: - '@octokit/core': 5.2.0 - '@octokit/types': 12.6.0 - - '@octokit/request-error@5.1.0': - dependencies: - '@octokit/types': 13.4.1 - deprecation: 2.3.1 - once: 1.4.0 - - '@octokit/request@8.4.0': - dependencies: - '@octokit/endpoint': 9.0.5 - '@octokit/request-error': 5.1.0 - '@octokit/types': 13.4.1 - universal-user-agent: 6.0.1 - - '@octokit/rest@20.1.0': - dependencies: - '@octokit/core': 5.2.0 - '@octokit/plugin-paginate-rest': 9.2.1(@octokit/core@5.2.0) - '@octokit/plugin-request-log': 4.0.1(@octokit/core@5.2.0) - '@octokit/plugin-rest-endpoint-methods': 10.4.1(@octokit/core@5.2.0) - - '@octokit/types@12.6.0': - dependencies: - '@octokit/openapi-types': 20.0.0 - - '@octokit/types@13.4.1': - dependencies: - '@octokit/openapi-types': 22.1.0 - - '@rollup/pluginutils@4.2.1': - dependencies: - estree-walker: 2.0.2 - picomatch: 2.3.1 - - '@sindresorhus/merge-streams@2.3.0': {} - - '@tybys/wasm-util@0.8.3': - dependencies: - tslib: 2.6.2 - - '@types/node@20.12.7': - dependencies: - undici-types: 5.26.5 - - '@types/stylis@4.2.6': {} - - '@vercel/nft@0.26.4': - dependencies: - '@mapbox/node-pre-gyp': 1.0.11 - '@rollup/pluginutils': 4.2.1 - acorn: 8.11.3 - acorn-import-attributes: 1.9.5(acorn@8.11.3) - async-sema: 3.1.1 - bindings: 1.5.0 - estree-walker: 2.0.2 - glob: 7.2.3 - graceful-fs: 4.2.11 - micromatch: 4.0.5 - node-gyp-build: 4.8.0 - resolve-from: 5.0.0 - transitivePeerDependencies: - - encoding - - supports-color - - abbrev@1.1.1: {} - - acorn-import-attributes@1.9.5(acorn@8.11.3): - dependencies: - acorn: 8.11.3 - - acorn-walk@8.3.2: {} - - acorn@8.11.3: {} - - agent-base@6.0.2: - dependencies: - debug: 4.3.4 - transitivePeerDependencies: - - supports-color - - ansi-escapes@4.3.2: - dependencies: - type-fest: 0.21.3 - - ansi-regex@5.0.1: {} - - ansi-regex@6.0.1: {} - - ansi-styles@4.3.0: - dependencies: - color-convert: 2.0.1 - - ansi-styles@6.2.1: {} - - aproba@2.0.0: {} - - are-we-there-yet@2.0.0: - dependencies: - delegates: 1.0.0 - readable-stream: 3.6.2 - - argparse@1.0.10: - dependencies: - sprintf-js: 1.0.3 - - argparse@2.0.1: {} - - array-find-index@1.0.2: {} - - arrgv@1.0.2: {} - - arrify@3.0.0: {} - - async-sema@3.1.1: {} - - asynckit@0.4.0: {} - - ava@6.1.2: - dependencies: - '@vercel/nft': 0.26.4 - acorn: 8.11.3 - acorn-walk: 8.3.2 - ansi-styles: 6.2.1 - arrgv: 1.0.2 - arrify: 3.0.0 - callsites: 4.1.0 - cbor: 9.0.2 - chalk: 5.3.0 - chunkd: 2.0.1 - ci-info: 4.0.0 - ci-parallel-vars: 1.0.1 - cli-truncate: 4.0.0 - code-excerpt: 4.0.0 - common-path-prefix: 3.0.0 - concordance: 5.0.4 - currently-unhandled: 0.4.1 - debug: 4.3.4 - emittery: 1.0.3 - figures: 6.1.0 - globby: 14.0.1 - ignore-by-default: 2.1.0 - indent-string: 5.0.0 - is-plain-object: 5.0.0 - is-promise: 4.0.0 - matcher: 5.0.0 - memoize: 10.0.0 - ms: 2.1.3 - p-map: 7.0.2 - package-config: 5.0.0 - picomatch: 3.0.1 - plur: 5.1.0 - pretty-ms: 9.0.0 - resolve-cwd: 3.0.0 - stack-utils: 2.0.6 - strip-ansi: 7.1.0 - supertap: 3.0.1 - temp-dir: 3.0.0 - write-file-atomic: 5.0.1 - yargs: 17.7.2 - transitivePeerDependencies: - - encoding - - supports-color - - axios@1.6.2: - dependencies: - follow-redirects: 1.15.6 - form-data: 4.0.0 - proxy-from-env: 1.1.0 - transitivePeerDependencies: - - debug - - balanced-match@1.0.2: {} - - base64-js@1.5.1: {} - - before-after-hook@2.2.3: {} - - bindings@1.5.0: - dependencies: - file-uri-to-path: 1.0.0 - - bl@4.1.0: - dependencies: - buffer: 5.7.1 - inherits: 2.0.4 - readable-stream: 3.6.2 - - blueimp-md5@2.19.0: {} - - brace-expansion@1.1.11: - dependencies: - balanced-match: 1.0.2 - concat-map: 0.0.1 - - braces@3.0.2: - dependencies: - fill-range: 7.0.1 - - buffer@5.7.1: - dependencies: - base64-js: 1.5.1 - ieee754: 1.2.1 - - call-bind@1.0.7: - dependencies: - es-define-property: 1.0.0 - es-errors: 1.3.0 - function-bind: 1.1.2 - get-intrinsic: 1.2.4 - set-function-length: 1.2.2 - - callsites@4.1.0: {} - - camelize@1.0.1: {} - - cbor@9.0.2: - dependencies: - nofilter: 3.1.0 - - chalk@4.1.2: - dependencies: - ansi-styles: 4.3.0 - supports-color: 7.2.0 - - chalk@5.3.0: {} - - chardet@0.7.0: {} - - chownr@2.0.0: {} - - chunkd@2.0.1: {} - - ci-info@4.0.0: {} - - ci-parallel-vars@1.0.1: {} - - cli-cursor@3.1.0: - dependencies: - restore-cursor: 3.1.0 - - cli-spinners@2.9.2: {} - - cli-truncate@4.0.0: - dependencies: - slice-ansi: 5.0.0 - string-width: 7.1.0 - - cli-width@4.1.0: {} - - clipanion@3.2.1(typanion@3.14.0): - dependencies: - typanion: 3.14.0 - - cliui@8.0.1: - dependencies: - string-width: 4.2.3 - strip-ansi: 6.0.1 - wrap-ansi: 7.0.0 - - clone@1.0.4: {} - - code-excerpt@4.0.0: - dependencies: - convert-to-spaces: 2.0.1 - - color-convert@2.0.1: - dependencies: - color-name: 1.1.4 - - color-name@1.1.4: {} - - color-support@1.1.3: {} - - colorette@2.0.20: {} - - combined-stream@1.0.8: - dependencies: - delayed-stream: 1.0.0 - - common-path-prefix@3.0.0: {} - - concat-map@0.0.1: {} - - concordance@5.0.4: - dependencies: - date-time: 3.1.0 - esutils: 2.0.3 - fast-diff: 1.3.0 - js-string-escape: 1.0.1 - lodash: 4.17.21 - md5-hex: 3.0.1 - semver: 7.6.0 - well-known-symbols: 2.0.0 - - console-control-strings@1.1.0: {} - - convert-to-spaces@2.0.1: {} - - css-color-keywords@1.0.0: {} - - css-to-react-native@3.2.0: - dependencies: - camelize: 1.0.1 - css-color-keywords: 1.0.0 - postcss-value-parser: 4.2.0 - - csstype@3.1.3: {} - - currently-unhandled@0.4.1: - dependencies: - array-find-index: 1.0.2 - - date-time@3.1.0: - dependencies: - time-zone: 1.0.0 - - debug@4.3.4: - dependencies: - ms: 2.1.2 - - defaults@1.0.4: - dependencies: - clone: 1.0.4 - - define-data-property@1.1.4: - dependencies: - es-define-property: 1.0.0 - es-errors: 1.3.0 - gopd: 1.0.1 - - delayed-stream@1.0.0: {} - - delegates@1.0.0: {} - - deprecation@2.3.1: {} - - detect-libc@2.0.3: {} - - emittery@1.0.3: {} - - emnapi@1.1.1: {} - - emoji-regex@10.3.0: {} - - emoji-regex@8.0.0: {} - - es-define-property@1.0.0: - dependencies: - get-intrinsic: 1.2.4 - - es-errors@1.3.0: {} - - escalade@3.1.2: {} - - escape-string-regexp@2.0.0: {} - - escape-string-regexp@5.0.0: {} - - esprima@4.0.1: {} - - estree-walker@2.0.2: {} - - esutils@2.0.3: {} - - external-editor@3.1.0: - dependencies: - chardet: 0.7.0 - iconv-lite: 0.4.24 - tmp: 0.0.33 - - fast-diff@1.3.0: {} - - fast-glob@3.3.2: - dependencies: - '@nodelib/fs.stat': 2.0.5 - '@nodelib/fs.walk': 1.2.8 - glob-parent: 5.1.2 - merge2: 1.4.1 - micromatch: 4.0.5 - - fastq@1.17.1: - dependencies: - reusify: 1.0.4 - - figures@6.1.0: - dependencies: - is-unicode-supported: 2.0.0 - - file-uri-to-path@1.0.0: {} - - fill-range@7.0.1: - dependencies: - to-regex-range: 5.0.1 - - find-up-simple@1.0.0: {} - - follow-redirects@1.15.6: {} - - form-data@4.0.0: - dependencies: - asynckit: 0.4.0 - combined-stream: 1.0.8 - mime-types: 2.1.35 - - fs-minipass@2.1.0: - dependencies: - minipass: 3.3.6 - - fs.realpath@1.0.0: {} - - function-bind@1.1.2: {} - - gauge@3.0.2: - dependencies: - aproba: 2.0.0 - color-support: 1.1.3 - console-control-strings: 1.1.0 - has-unicode: 2.0.1 - object-assign: 4.1.1 - signal-exit: 3.0.7 - string-width: 4.2.3 - strip-ansi: 6.0.1 - wide-align: 1.1.5 - - get-caller-file@2.0.5: {} - - get-east-asian-width@1.2.0: {} - - get-intrinsic@1.2.4: - dependencies: - es-errors: 1.3.0 - function-bind: 1.1.2 - has-proto: 1.0.3 - has-symbols: 1.0.3 - hasown: 2.0.2 - - glob-parent@5.1.2: - dependencies: - is-glob: 4.0.3 - - glob@7.2.3: - dependencies: - fs.realpath: 1.0.0 - inflight: 1.0.6 - inherits: 2.0.4 - minimatch: 3.1.2 - once: 1.4.0 - path-is-absolute: 1.0.1 - - globby@14.0.1: - dependencies: - '@sindresorhus/merge-streams': 2.3.0 - fast-glob: 3.3.2 - ignore: 5.3.1 - path-type: 5.0.0 - slash: 5.1.0 - unicorn-magic: 0.1.0 - - gopd@1.0.1: - dependencies: - get-intrinsic: 1.2.4 - - graceful-fs@4.2.11: {} - - has-flag@4.0.0: {} - - has-property-descriptors@1.0.2: - dependencies: - es-define-property: 1.0.0 - - has-proto@1.0.3: {} - - has-symbols@1.0.3: {} - - has-unicode@2.0.1: {} - - hasown@2.0.2: - dependencies: - function-bind: 1.1.2 - - https-proxy-agent@5.0.1: - dependencies: - agent-base: 6.0.2 - debug: 4.3.4 - transitivePeerDependencies: - - supports-color - - iconv-lite@0.4.24: - dependencies: - safer-buffer: 2.1.2 - - ieee754@1.2.1: {} - - ignore-by-default@2.1.0: {} - - ignore@5.3.1: {} - - imurmurhash@0.1.4: {} - - indent-string@5.0.0: {} - - inflight@1.0.6: - dependencies: - once: 1.4.0 - wrappy: 1.0.2 - - inherits@2.0.4: {} - - inquirer@9.2.19: - dependencies: - '@inquirer/figures': 1.0.1 - '@ljharb/through': 2.3.13 - ansi-escapes: 4.3.2 - chalk: 5.3.0 - cli-cursor: 3.1.0 - cli-width: 4.1.0 - external-editor: 3.1.0 - lodash: 4.17.21 - mute-stream: 1.0.0 - ora: 5.4.1 - run-async: 3.0.0 - rxjs: 7.8.1 - string-width: 4.2.3 - strip-ansi: 6.0.1 - wrap-ansi: 6.2.0 - - irregular-plurals@3.5.0: {} - - is-extglob@2.1.1: {} - - is-fullwidth-code-point@3.0.0: {} - - is-fullwidth-code-point@4.0.0: {} - - is-glob@4.0.3: - dependencies: - is-extglob: 2.1.1 - - is-interactive@1.0.0: {} - - is-number@7.0.0: {} - - is-plain-object@5.0.0: {} - - is-promise@4.0.0: {} - - is-unicode-supported@0.1.0: {} - - is-unicode-supported@2.0.0: {} - - js-string-escape@1.0.1: {} - - js-tokens@4.0.0: {} - - js-yaml@3.14.1: - dependencies: - argparse: 1.0.10 - esprima: 4.0.1 - - js-yaml@4.1.0: - dependencies: - argparse: 2.0.1 - - load-json-file@7.0.1: {} - - lodash-es@4.17.21: {} - - lodash@4.17.21: {} - - log-symbols@4.1.0: - dependencies: - chalk: 4.1.2 - is-unicode-supported: 0.1.0 - - loose-envify@1.4.0: - dependencies: - js-tokens: 4.0.0 - - lru-cache@6.0.0: - dependencies: - yallist: 4.0.0 - - make-dir@3.1.0: - dependencies: - semver: 6.3.1 - - matcher@5.0.0: - dependencies: - escape-string-regexp: 5.0.0 - - md5-hex@3.0.1: - dependencies: - blueimp-md5: 2.19.0 - - memoize@10.0.0: - dependencies: - mimic-function: 5.0.1 - - merge2@1.4.1: {} - - micromatch@4.0.5: - dependencies: - braces: 3.0.2 - picomatch: 2.3.1 - - mime-db@1.52.0: {} - - mime-types@2.1.35: - dependencies: - mime-db: 1.52.0 - - mimic-fn@2.1.0: {} - - mimic-function@5.0.1: {} - - minimatch@3.1.2: - dependencies: - brace-expansion: 1.1.11 - - minipass@3.3.6: - dependencies: - yallist: 4.0.0 - - minipass@5.0.0: {} - - minizlib@2.1.2: - dependencies: - minipass: 3.3.6 - yallist: 4.0.0 - - mkdirp@1.0.4: {} - - ms@2.1.2: {} - - ms@2.1.3: {} - - mute-stream@1.0.0: {} - - nanoid@3.3.7: {} - - node-fetch@2.7.0: - dependencies: - whatwg-url: 5.0.0 - - node-gyp-build@4.8.0: {} - - nofilter@3.1.0: {} - - nopt@5.0.0: - dependencies: - abbrev: 1.1.1 - - npmlog@5.0.1: - dependencies: - are-we-there-yet: 2.0.0 - console-control-strings: 1.1.0 - gauge: 3.0.2 - set-blocking: 2.0.0 - - object-assign@4.1.1: {} - - once@1.4.0: - dependencies: - wrappy: 1.0.2 - - onetime@5.1.2: - dependencies: - mimic-fn: 2.1.0 - - ora@5.4.1: - dependencies: - bl: 4.1.0 - chalk: 4.1.2 - cli-cursor: 3.1.0 - cli-spinners: 2.9.2 - is-interactive: 1.0.0 - is-unicode-supported: 0.1.0 - log-symbols: 4.1.0 - strip-ansi: 6.0.1 - wcwidth: 1.0.1 - - os-tmpdir@1.0.2: {} - - p-map@7.0.2: {} - - package-config@5.0.0: - dependencies: - find-up-simple: 1.0.0 - load-json-file: 7.0.1 - - parse-ms@4.0.0: {} - - path-is-absolute@1.0.1: {} - - path-type@5.0.0: {} - - picocolors@1.0.1: {} - - picomatch@2.3.1: {} - - picomatch@3.0.1: {} - - plur@5.1.0: - dependencies: - irregular-plurals: 3.5.0 - - postcss-value-parser@4.2.0: {} - - postcss@8.4.33: - dependencies: - nanoid: 3.3.7 - picocolors: 1.0.1 - source-map-js: 1.2.0 - - pretty-ms@9.0.0: - dependencies: - parse-ms: 4.0.0 - - proxy-from-env@1.1.0: {} - - queue-microtask@1.2.3: {} - - react-dom@18.3.1(react@18.3.1): - dependencies: - loose-envify: 1.4.0 - react: 18.3.1 - scheduler: 0.23.2 - - react@18.3.1: - dependencies: - loose-envify: 1.4.0 - - readable-stream@3.6.2: - dependencies: - inherits: 2.0.4 - string_decoder: 1.3.0 - util-deprecate: 1.0.2 - - require-directory@2.1.1: {} - - resolve-cwd@3.0.0: - dependencies: - resolve-from: 5.0.0 - - resolve-from@5.0.0: {} - - restore-cursor@3.1.0: - dependencies: - onetime: 5.1.2 - signal-exit: 3.0.7 - - reusify@1.0.4: {} - - rimraf@3.0.2: - dependencies: - glob: 7.2.3 - - run-async@3.0.0: {} - - run-parallel@1.2.0: - dependencies: - queue-microtask: 1.2.3 - - rxjs@7.8.1: - dependencies: - tslib: 2.6.2 - - safe-buffer@5.2.1: {} - - safer-buffer@2.1.2: {} - - scheduler@0.23.2: - dependencies: - loose-envify: 1.4.0 - - semver@6.3.1: {} - - semver@7.6.0: - dependencies: - lru-cache: 6.0.0 - - serialize-error@7.0.1: - dependencies: - type-fest: 0.13.1 - - set-blocking@2.0.0: {} - - set-function-length@1.2.2: - 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 - - shallowequal@1.1.0: {} - - signal-exit@3.0.7: {} - - signal-exit@4.1.0: {} - - slash@5.1.0: {} - - slice-ansi@5.0.0: - dependencies: - ansi-styles: 6.2.1 - is-fullwidth-code-point: 4.0.0 - - source-map-js@1.2.0: {} - - sprintf-js@1.0.3: {} - - stack-utils@2.0.6: - dependencies: - escape-string-regexp: 2.0.0 - - string-width@4.2.3: - dependencies: - emoji-regex: 8.0.0 - is-fullwidth-code-point: 3.0.0 - strip-ansi: 6.0.1 - - string-width@7.1.0: - dependencies: - emoji-regex: 10.3.0 - get-east-asian-width: 1.2.0 - strip-ansi: 7.1.0 - - string_decoder@1.3.0: - dependencies: - safe-buffer: 5.2.1 - - strip-ansi@6.0.1: - dependencies: - ansi-regex: 5.0.1 - - strip-ansi@7.1.0: - dependencies: - ansi-regex: 6.0.1 - - styled-components@6.1.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1): - dependencies: - '@emotion/is-prop-valid': 1.2.2 - '@emotion/unitless': 0.8.1 - '@types/stylis': 4.2.6 - css-to-react-native: 3.2.0 - csstype: 3.1.3 - postcss: 8.4.33 - react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) - shallowequal: 1.1.0 - stylis: 4.3.2 - tslib: 2.6.2 - - stylis@4.3.2: {} - - supertap@3.0.1: - dependencies: - indent-string: 5.0.0 - js-yaml: 3.14.1 - serialize-error: 7.0.1 - strip-ansi: 7.1.0 - - supports-color@7.2.0: - dependencies: - has-flag: 4.0.0 - - tar@6.2.1: - dependencies: - chownr: 2.0.0 - fs-minipass: 2.1.0 - minipass: 5.0.0 - minizlib: 2.1.2 - mkdirp: 1.0.4 - yallist: 4.0.0 - - temp-dir@3.0.0: {} - - time-zone@1.0.0: {} - - tmp@0.0.33: - dependencies: - os-tmpdir: 1.0.2 - - to-regex-range@5.0.1: - dependencies: - is-number: 7.0.0 - - toml@3.0.0: {} - - tr46@0.0.3: {} - - tslib@2.6.2: {} - - typanion@3.14.0: {} - - type-fest@0.13.1: {} - - type-fest@0.21.3: {} - - typescript@5.4.5: {} - - undici-types@5.26.5: {} - - unicorn-magic@0.1.0: {} - - universal-user-agent@6.0.1: {} - - util-deprecate@1.0.2: {} - - wasm-sjlj@1.0.5: {} - - wcwidth@1.0.1: - dependencies: - defaults: 1.0.4 - - webidl-conversions@3.0.1: {} - - well-known-symbols@2.0.0: {} - - whatwg-url@5.0.0: - dependencies: - tr46: 0.0.3 - webidl-conversions: 3.0.1 - - wide-align@1.1.5: - dependencies: - string-width: 4.2.3 - - wrap-ansi@6.2.0: - dependencies: - ansi-styles: 4.3.0 - string-width: 4.2.3 - strip-ansi: 6.0.1 - - wrap-ansi@7.0.0: - dependencies: - ansi-styles: 4.3.0 - string-width: 4.2.3 - strip-ansi: 6.0.1 - - wrappy@1.0.2: {} - - write-file-atomic@5.0.1: - dependencies: - imurmurhash: 0.1.4 - signal-exit: 4.1.0 - - y18n@5.0.8: {} - - yallist@4.0.0: {} - - yargs-parser@21.1.1: {} - - yargs@17.7.2: - dependencies: - cliui: 8.0.1 - escalade: 3.1.2 - get-caller-file: 2.0.5 - require-directory: 2.1.1 - string-width: 4.2.3 - y18n: 5.0.8 - yargs-parser: 21.1.1 diff --git a/src/builtins.rs b/src/builtins.rs deleted file mode 100644 index 45a25117..00000000 --- a/src/builtins.rs +++ /dev/null @@ -1,71 +0,0 @@ -/// Node.js built-in modules -/// -/// `node -p "[...require('module').builtinModules].map(b => JSON.stringify(b)).join(',\n')"` -/// -pub const NODEJS_BUILTINS: &[&str] = &[ - "_http_agent", - "_http_client", - "_http_common", - "_http_incoming", - "_http_outgoing", - "_http_server", - "_stream_duplex", - "_stream_passthrough", - "_stream_readable", - "_stream_transform", - "_stream_wrap", - "_stream_writable", - "_tls_common", - "_tls_wrap", - "assert", - "assert/strict", - "async_hooks", - "buffer", - "child_process", - "cluster", - "console", - "constants", - "crypto", - "dgram", - "diagnostics_channel", - "dns", - "dns/promises", - "domain", - "events", - "fs", - "fs/promises", - "http", - "http2", - "https", - "inspector", - "module", - "net", - "os", - "path", - "path/posix", - "path/win32", - "perf_hooks", - "process", - "punycode", - "querystring", - "readline", - "repl", - "stream", - "stream/consumers", - "stream/promises", - "stream/web", - "string_decoder", - "sys", - "timers", - "timers/promises", - "tls", - "trace_events", - "tty", - "url", - "util", - "util/types", - "v8", - "vm", - "worker_threads", - "zlib", -]; diff --git a/src/cache.rs b/src/cache.rs deleted file mode 100644 index a1bde36c..00000000 --- a/src/cache.rs +++ /dev/null @@ -1,369 +0,0 @@ -use once_cell::sync::OnceCell as OnceLock; -use std::{ - borrow::{Borrow, Cow}, - convert::AsRef, - hash::{BuildHasherDefault, Hash, Hasher}, - io, - ops::Deref, - path::{Path, PathBuf}, - sync::Arc, -}; - -use dashmap::{DashMap, DashSet}; -use rustc_hash::FxHasher; - -use crate::{ - context::ResolveContext as Ctx, package_json::PackageJson, path::PathUtil, FileMetadata, - FileSystem, ResolveError, ResolveOptions, TsConfig, -}; - -#[derive(Default)] -pub struct Cache { - pub(crate) fs: Fs, - paths: DashSet>, - tsconfigs: DashMap, BuildHasherDefault>, -} - -impl Cache { - pub fn new(fs: Fs) -> Self { - Self { fs, paths: DashSet::default(), tsconfigs: DashMap::default() } - } - - pub fn clear(&self) { - self.paths.clear(); - self.tsconfigs.clear(); - } - - pub fn value(&self, path: &Path) -> CachedPath { - let hash = { - let mut hasher = FxHasher::default(); - path.hash(&mut hasher); - hasher.finish() - }; - if let Some(cache_entry) = self.paths.get((hash, path).borrow() as &dyn CacheKey) { - return cache_entry.clone(); - } - let parent = path.parent().map(|p| self.value(p)); - let data = CachedPath(Arc::new(CachedPathImpl::new( - hash, - path.to_path_buf().into_boxed_path(), - parent, - ))); - self.paths.insert(data.clone()); - data - } - - pub fn tsconfig Result<(), ResolveError>>( - &self, - root: bool, - path: &Path, - callback: F, // callback for modifying tsconfig with `extends` - ) -> Result, ResolveError> { - if let Some(tsconfig_ref) = self.tsconfigs.get(path) { - return Ok(Arc::clone(tsconfig_ref.value())); - } - let meta = self.fs.metadata(path).ok(); - let tsconfig_path = if meta.is_some_and(|m| m.is_file) { - Cow::Borrowed(path) - } else if meta.is_some_and(|m| m.is_dir) { - Cow::Owned(path.join("tsconfig.json")) - } else { - let mut os_string = path.to_path_buf().into_os_string(); - os_string.push(".json"); - Cow::Owned(PathBuf::from(os_string)) - }; - let mut tsconfig_string = self - .fs - .read_to_string(&tsconfig_path) - .map_err(|_| ResolveError::TsconfigNotFound(path.to_path_buf()))?; - let mut tsconfig = - TsConfig::parse(root, &tsconfig_path, &mut tsconfig_string).map_err(|error| { - ResolveError::from_serde_json_error(tsconfig_path.to_path_buf(), &error) - })?; - callback(&mut tsconfig)?; - let tsconfig = Arc::new(tsconfig.build()); - self.tsconfigs.insert(path.to_path_buf(), Arc::clone(&tsconfig)); - Ok(tsconfig) - } -} - -#[derive(Clone)] -pub struct CachedPath(Arc); - -impl Hash for CachedPath { - fn hash(&self, state: &mut H) { - self.0.hash.hash(state); - } -} - -impl PartialEq for CachedPath { - fn eq(&self, other: &Self) -> bool { - self.0.path == other.0.path - } -} -impl Eq for CachedPath {} - -impl Deref for CachedPath { - type Target = CachedPathImpl; - - fn deref(&self) -> &Self::Target { - self.0.as_ref() - } -} - -impl<'a> Borrow for CachedPath { - fn borrow(&self) -> &(dyn CacheKey + 'a) { - self - } -} - -impl AsRef for CachedPath { - fn as_ref(&self) -> &CachedPathImpl { - self.0.as_ref() - } -} - -impl CacheKey for CachedPath { - fn tuple(&self) -> (u64, &Path) { - (self.hash, &self.path) - } -} - -pub struct CachedPathImpl { - hash: u64, - path: Box, - parent: Option, - meta: OnceLock>, - symlink: OnceLock>, - canonicalized: OnceLock>, - node_modules: OnceLock>, - package_json: OnceLock>>, -} - -impl CachedPathImpl { - fn new(hash: u64, path: Box, parent: Option) -> Self { - Self { - hash, - path, - parent, - meta: OnceLock::new(), - symlink: OnceLock::new(), - canonicalized: OnceLock::new(), - node_modules: OnceLock::new(), - package_json: OnceLock::new(), - } - } - - pub fn path(&self) -> &Path { - &self.path - } - - pub fn to_path_buf(&self) -> PathBuf { - self.path.to_path_buf() - } - - pub fn parent(&self) -> Option<&CachedPath> { - self.parent.as_ref() - } - - fn meta(&self, fs: &Fs) -> Option { - *self.meta.get_or_init(|| fs.metadata(&self.path).ok()) - } - - pub fn is_file(&self, fs: &Fs, ctx: &mut Ctx) -> bool { - if let Some(meta) = self.meta(fs) { - ctx.add_file_dependency(self.path()); - meta.is_file - } else { - ctx.add_missing_dependency(self.path()); - false - } - } - - pub fn is_dir(&self, fs: &Fs, ctx: &mut Ctx) -> bool { - self.meta(fs).map_or_else( - || { - ctx.add_missing_dependency(self.path()); - false - }, - |meta| meta.is_dir, - ) - } - - fn symlink(&self, fs: &Fs) -> io::Result> { - self.symlink - .get_or_try_init(|| { - if let Ok(symlink_metadata) = fs.symlink_metadata(&self.path) { - if symlink_metadata.is_symlink { - return fs.canonicalize(self.path()).map(Some); - } - } - Ok(None) - }) - .cloned() - } - - pub fn realpath(&self, fs: &Fs) -> io::Result { - self.canonicalized - .get_or_try_init(|| { - if let Some(link) = self.symlink(fs)? { - return Ok(Some(link)); - } - if let Some(parent) = self.parent() { - let parent_path = parent.realpath(fs)?; - return Ok(Some( - parent_path.normalize_with(self.path.strip_prefix(&parent.path).unwrap()), - )); - }; - Ok(None) - }) - .cloned() - .map(|r| r.unwrap_or_else(|| self.path.clone().to_path_buf())) - } - - pub fn module_directory( - &self, - module_name: &str, - cache: &Cache, - ctx: &mut Ctx, - ) -> Option { - let cached_path = cache.value(&self.path.join(module_name)); - cached_path.is_dir(&cache.fs, ctx).then_some(cached_path) - } - - pub fn cached_node_modules( - &self, - cache: &Cache, - ctx: &mut Ctx, - ) -> Option { - self.node_modules.get_or_init(|| self.module_directory("node_modules", cache, ctx)).clone() - } - - /// Find package.json of a path by traversing parent directories. - /// - /// # Errors - /// - /// * [ResolveError::JSON] - pub fn find_package_json( - &self, - fs: &Fs, - options: &ResolveOptions, - ctx: &mut Ctx, - ) -> Result>, ResolveError> { - let mut cache_value = self; - // Go up directories when the querying path is not a directory - while !cache_value.is_dir(fs, ctx) { - if let Some(cv) = &cache_value.parent { - cache_value = cv.as_ref(); - } else { - break; - } - } - let mut cache_value = Some(cache_value); - while let Some(cv) = cache_value { - if let Some(package_json) = cv.package_json(fs, options, ctx)? { - return Ok(Some(Arc::clone(&package_json))); - } - cache_value = cv.parent.as_deref(); - } - Ok(None) - } - - /// Get package.json of the given path. - /// - /// # Errors - /// - /// * [ResolveError::JSON] - pub fn package_json( - &self, - fs: &Fs, - options: &ResolveOptions, - ctx: &mut Ctx, - ) -> Result>, ResolveError> { - // Change to `std::sync::OnceLock::get_or_try_init` when it is stable. - let result = self - .package_json - .get_or_try_init(|| { - let package_json_path = self.path.join("package.json"); - let Ok(package_json_string) = fs.read_to_string(&package_json_path) else { - return Ok(None); - }; - let real_path = if options.symlinks { - self.realpath(fs)?.join("package.json") - } else { - package_json_path.clone() - }; - PackageJson::parse(package_json_path.clone(), real_path, &package_json_string) - .map(Arc::new) - .map(Some) - .map_err(|error| ResolveError::from_serde_json_error(package_json_path, &error)) - }) - .cloned(); - // https://github.com/webpack/enhanced-resolve/blob/58464fc7cb56673c9aa849e68e6300239601e615/lib/DescriptionFileUtils.js#L68-L82 - match &result { - Ok(Some(package_json)) => { - ctx.add_file_dependency(&package_json.path); - } - Ok(None) => { - // Avoid an allocation by making this lazy - if let Some(deps) = &mut ctx.missing_dependencies { - deps.push(self.path.join("package.json")); - } - } - Err(_) => { - if let Some(deps) = &mut ctx.file_dependencies { - deps.push(self.path.join("package.json")); - } - } - } - result - } -} - -/// Memoized cache key, code adapted from . -trait CacheKey { - fn tuple(&self) -> (u64, &Path); -} - -impl Hash for dyn CacheKey + '_ { - fn hash(&self, state: &mut H) { - self.tuple().0.hash(state); - } -} - -impl PartialEq for dyn CacheKey + '_ { - fn eq(&self, other: &Self) -> bool { - self.tuple().1 == other.tuple().1 - } -} - -impl Eq for dyn CacheKey + '_ {} - -impl<'a> CacheKey for (u64, &'a Path) { - fn tuple(&self) -> (u64, &Path) { - (self.0, self.1) - } -} - -impl<'a> Borrow for (u64, &'a Path) { - fn borrow(&self) -> &(dyn CacheKey + 'a) { - self - } -} - -/// Since the cache key is memoized, use an identity hasher -/// to avoid double cache. -#[derive(Default)] -struct IdentityHasher(u64); - -impl Hasher for IdentityHasher { - fn write(&mut self, _: &[u8]) { - unreachable!("Invalid use of IdentityHasher") - } - fn write_u64(&mut self, n: u64) { - self.0 = n; - } - fn finish(&self) -> u64 { - self.0 - } -} diff --git a/src/context.rs b/src/context.rs deleted file mode 100644 index 9349de30..00000000 --- a/src/context.rs +++ /dev/null @@ -1,89 +0,0 @@ -use std::{ - ops::{Deref, DerefMut}, - path::{Path, PathBuf}, -}; - -use crate::error::ResolveError; - -#[derive(Debug, Default, Clone)] -pub struct ResolveContext(ResolveContextImpl); - -#[derive(Debug, Default, Clone)] -pub struct ResolveContextImpl { - pub fully_specified: bool, - - pub query: Option, - - pub fragment: Option, - - /// Files that was found on file system - pub file_dependencies: Option>, - - /// Files that was found on file system - pub missing_dependencies: Option>, - - /// The current resolving alias for bailing recursion alias. - pub resolving_alias: Option, - - /// For avoiding infinite recursion, which will cause stack overflow. - depth: u8, -} - -impl Deref for ResolveContext { - type Target = ResolveContextImpl; - - fn deref(&self) -> &Self::Target { - &self.0 - } -} - -impl DerefMut for ResolveContext { - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} - -impl ResolveContext { - pub fn with_fully_specified(&mut self, yes: bool) { - self.fully_specified = yes; - } - - pub fn with_query_fragment(&mut self, query: Option<&str>, fragment: Option<&str>) { - if let Some(query) = query { - self.query.replace(query.to_string()); - } - if let Some(fragment) = fragment { - self.fragment.replace(fragment.to_string()); - } - } - - pub fn init_file_dependencies(&mut self) { - self.file_dependencies.replace(vec![]); - self.missing_dependencies.replace(vec![]); - } - - pub fn add_file_dependency(&mut self, dep: &Path) { - if let Some(deps) = &mut self.file_dependencies { - deps.push(dep.to_path_buf()); - } - } - - pub fn add_missing_dependency(&mut self, dep: &Path) { - if let Some(deps) = &mut self.missing_dependencies { - deps.push(dep.to_path_buf()); - } - } - - pub fn with_resolving_alias(&mut self, alias: String) { - self.resolving_alias = Some(alias); - } - - pub fn test_for_infinite_recursion(&mut self) -> Result<(), ResolveError> { - self.depth += 1; - // 64 should be more than enough for detecting infinite recursion. - if self.depth > 64 { - return Err(ResolveError::Recursion); - } - Ok(()) - } -} diff --git a/src/error.rs b/src/error.rs deleted file mode 100644 index ff2aaa4f..00000000 --- a/src/error.rs +++ /dev/null @@ -1,160 +0,0 @@ -use std::{io, path::PathBuf, sync::Arc}; -use thiserror::Error; - -/// All resolution errors -/// -/// `thiserror` is used to display meaningful error messages. -#[derive(Debug, Clone, PartialEq, Error)] -pub enum ResolveError { - /// Ignored path - /// - /// Derived from ignored path (false value) from browser field in package.json - /// ```json - /// { - /// "browser": { - /// "./module": false - /// } - /// } - /// ``` - /// See - #[error("Path is ignored {0}")] - Ignored(PathBuf), - - /// Module not found - #[error("Cannot find module '{0}'")] - NotFound(/* specifier */ String), - - /// Tsconfig not found - #[error("Tsconfig not found {0}")] - TsconfigNotFound(PathBuf), - - #[error("{0}")] - IOError(IOError), - - /// Node.js builtin modules - /// - /// This is an error due to not being a Node.js runtime. - /// The `alias` option can be used to resolve a builtin module to a polyfill. - #[error("Builtin module {0}")] - Builtin(String), - - /// All of the aliased extension are not found - #[error("All of the aliased extension are not found")] - ExtensionAlias, - - /// The provided path specifier cannot be parsed - #[error("{0}")] - Specifier(SpecifierError), - - /// JSON parse error - #[error("{0:?}")] - JSON(JSONError), - - /// Restricted by `ResolveOptions::restrictions` - #[error(r#"Path "{0}" restricted by {0}"#)] - Restriction(PathBuf, PathBuf), - - #[error(r#"Invalid module "{0}" specifier is not a valid subpath for the "exports" resolution of {1}"#)] - InvalidModuleSpecifier(String, PathBuf), - - #[error(r#"Invalid "exports" target "{0}" defined for '{1}' in the package config {2}"#)] - InvalidPackageTarget(String, String, PathBuf), - - #[error(r#"Package subpath '{0}' is not defined by "exports" in {1}"#)] - PackagePathNotExported(String, PathBuf), - - #[error(r#"Invalid package config "{0}", "exports" cannot contain some keys starting with '.' and some not. The exports object must either be an object of package subpath keys or an object of main entry condition name keys only."#)] - InvalidPackageConfig(PathBuf), - - #[error(r#"Default condition should be last one in "{0}""#)] - InvalidPackageConfigDefault(PathBuf), - - #[error(r#"Expecting folder to folder mapping. "{0}" should end with "/"#)] - InvalidPackageConfigDirectory(PathBuf), - - #[error(r#"Package import specifier "{0}" is not defined in package {1}"#)] - PackageImportNotDefined(String, PathBuf), - - #[error("{0} is unimplemented")] - Unimplemented(&'static str), - - /// Occurs when alias paths reference each other. - #[error("Recursion in resolving")] - Recursion, -} - -impl ResolveError { - pub fn is_ignore(&self) -> bool { - matches!(self, Self::Ignored(_)) - } - - pub(crate) fn from_serde_json_error(path: PathBuf, error: &serde_json::Error) -> Self { - Self::JSON(JSONError { - path, - message: error.to_string(), - line: error.line(), - column: error.column(), - }) - } -} - -/// Error for [ResolveError::Specifier] -#[derive(Debug, Clone, Eq, PartialEq, Error)] -pub enum SpecifierError { - #[error("The specifiers must be a non-empty string. Received \"{0}\"")] - Empty(String), -} - -/// JSON error from [serde_json::Error] -#[derive(Debug, Clone, Eq, PartialEq)] -pub struct JSONError { - pub path: PathBuf, - pub message: String, - pub line: usize, - pub column: usize, -} - -#[derive(Debug, Clone, Error)] -#[error("{0}")] -pub struct IOError(Arc); - -impl PartialEq for IOError { - fn eq(&self, other: &Self) -> bool { - self.0.kind() == other.0.kind() - } -} - -impl From for io::Error { - fn from(error: IOError) -> Self { - let io_error = error.0.as_ref(); - Self::new(io_error.kind(), io_error.to_string()) - } -} - -impl From for ResolveError { - fn from(err: io::Error) -> Self { - Self::IOError(IOError(Arc::new(err))) - } -} - -#[test] -fn test_into_io_error() { - use std::io::{self, ErrorKind}; - let error_string = "IOError occurred"; - let string_error = io::Error::new(ErrorKind::Interrupted, error_string.to_string()); - let string_error2 = io::Error::new(ErrorKind::Interrupted, error_string.to_string()); - let resolve_io_error: ResolveError = ResolveError::from(string_error2); - - assert_eq!(resolve_io_error, ResolveError::from(string_error)); - assert_eq!(resolve_io_error.clone(), resolve_io_error); - if let ResolveError::IOError(io_error) = resolve_io_error { - // fix for https://github.com/web-infra-dev/rspack/issues/4564 - let std_io_error: io::Error = io_error.into(); - assert_eq!(std_io_error.kind(), ErrorKind::Interrupted); - assert_eq!(std_io_error.to_string(), error_string); - assert_eq!( - format!("{std_io_error:?}"), - r#"Custom { kind: Interrupted, error: "IOError occurred" }"# - ); - } -} diff --git a/src/file_system.rs b/src/file_system.rs deleted file mode 100644 index 04d177de..00000000 --- a/src/file_system.rs +++ /dev/null @@ -1,133 +0,0 @@ -use std::{ - fs, io, - path::{Path, PathBuf}, -}; - -/// File System abstraction used for `ResolverGeneric` -pub trait FileSystem: Send + Sync { - /// See [std::fs::read_to_string] - /// - /// # Errors - /// - /// * See [std::fs::read_to_string] - /// ## Warning - /// Use `&Path` instead of a generic `P: AsRef` here, - /// because object safety requirements, it is especially useful, when - /// you want to store multiple `dyn FileSystem` in a `Vec` or use a `ResolverGeneric` in - /// napi env. - fn read_to_string(&self, path: &Path) -> io::Result; - - /// See [std::fs::metadata] - /// - /// # Errors - /// See [std::fs::metadata] - /// ## Warning - /// Use `&Path` instead of a generic `P: AsRef` here, - /// because object safety requirements, it is especially useful, when - /// you want to store multiple `dyn FileSystem` in a `Vec` or use a `ResolverGeneric` in - /// napi env. - fn metadata(&self, path: &Path) -> io::Result; - - /// See [std::fs::symlink_metadata] - /// - /// # Errors - /// - /// See [std::fs::symlink_metadata] - /// ## Warning - /// Use `&Path` instead of a generic `P: AsRef` here, - /// because object safety requirements, it is especially useful, when - /// you want to store multiple `dyn FileSystem` in a `Vec` or use a `ResolverGeneric` in - /// napi env. - fn symlink_metadata(&self, path: &Path) -> io::Result; - - /// See [std::fs::canonicalize] - /// - /// # Errors - /// - /// See [std::fs::read_link] - /// ## Warning - /// Use `&Path` instead of a generic `P: AsRef` here, - /// because object safety requirements, it is especially useful, when - /// you want to store multiple `dyn FileSystem` in a `Vec` or use a `ResolverGeneric` in - /// napi env. - fn canonicalize(&self, path: &Path) -> io::Result; -} - -/// Metadata information about a file -#[derive(Debug, Clone, Copy)] -pub struct FileMetadata { - pub(crate) is_file: bool, - pub(crate) is_dir: bool, - pub(crate) is_symlink: bool, -} - -impl FileMetadata { - pub fn new(is_file: bool, is_dir: bool, is_symlink: bool) -> Self { - Self { is_file, is_dir, is_symlink } - } -} - -impl From for FileMetadata { - fn from(metadata: fs::Metadata) -> Self { - Self::new(metadata.is_file(), metadata.is_dir(), metadata.is_symlink()) - } -} - -/// Operating System -#[derive(Default)] -pub struct FileSystemOs; - -impl FileSystem for FileSystemOs { - fn read_to_string(&self, path: &Path) -> io::Result { - fs::read_to_string(path) - } - - fn metadata(&self, path: &Path) -> io::Result { - fs::metadata(path).map(FileMetadata::from) - } - - fn symlink_metadata(&self, path: &Path) -> io::Result { - fs::symlink_metadata(path).map(FileMetadata::from) - } - - fn canonicalize(&self, path: &Path) -> io::Result { - #[cfg(not(target_os = "wasi"))] - { - dunce::canonicalize(path) - } - #[cfg(target_os = "wasi")] - { - let meta = fs::symlink_metadata(path)?; - if meta.file_type().is_symlink() { - let link = fs::read_link(path)?; - let mut path_buf = path.to_path_buf(); - path_buf.pop(); - for segment in link.iter() { - match segment.to_str() { - Some("..") => { - path_buf.pop(); - } - Some(".") | None => {} - Some(seg) => { - // Need to trim the extra \0 introduces by rust std rust-lang/rust#123727 - path_buf.push(seg.trim_end_matches('\0')); - } - } - } - Ok(path_buf) - } else { - Ok(path.to_path_buf()) - } - } - } -} - -#[test] -fn metadata() { - let meta = FileMetadata { is_file: true, is_dir: true, is_symlink: true }; - assert_eq!( - format!("{meta:?}"), - "FileMetadata { is_file: true, is_dir: true, is_symlink: true }" - ); - let _ = meta; -} diff --git a/src/lib.rs b/src/lib.rs deleted file mode 100644 index 8ec2ad8a..00000000 --- a/src/lib.rs +++ /dev/null @@ -1,1670 +0,0 @@ -//! # Oxc Resolver -//! -//! Node.js [CommonJS][cjs] and [ECMAScript][esm] Module Resolution. -//! -//! A module resolution is the process of finding the file referenced by a module specifier in -//! `import "specifier"` or `require("specifier")`. -//! -//! All [configuration options](ResolveOptions) are aligned with webpack's [enhanced-resolve]. -//! -//! ## Terminology -//! -//! ### Specifier -//! -//! For [CommonJS modules][cjs], -//! the specifier is the string passed to the `require` function. e.g. `"id"` in `require("id")`. -//! -//! For [ECMAScript modules][esm], -//! the specifier of an `import` statement is the string after the `from` keyword, -//! e.g. `'specifier'` in `import 'specifier'` or `import { sep } from 'specifier'`. -//! Specifiers are also used in export from statements, and as the argument to an `import()` expression. -//! -//! This is also named "request" in some places. -//! -//! ## References: -//! -//! * Algorithm adapted from Node.js [CommonJS Module Resolution Algorithm] and [ECMAScript Module Resolution Algorithm]. -//! * Tests are ported from [enhanced-resolve]. -//! * Some code is adapted from [parcel-resolver]. -//! * The documentation is copied from [webpack's resolve configuration](https://webpack.js.org/configuration/resolve). -//! -//! [enhanced-resolve]: https://github.com/webpack/enhanced-resolve -//! [CommonJS Module Resolution Algorithm]: https://nodejs.org/api/modules.html#all-together -//! [ECMAScript Module Resolution Algorithm]: https://nodejs.org/api/esm.html#resolution-algorithm-specification -//! [parcel-resolver]: https://github.com/parcel-bundler/parcel/blob/v2/packages/utils/node-resolver-rs -//! [cjs]: https://nodejs.org/api/modules.html -//! [esm]: https://nodejs.org/api/esm.html -//! -//! ## Feature flags -#![cfg_attr(feature = "document-features", doc = document_features::document_features!())] -#![cfg_attr(docsrs, feature(doc_auto_cfg))] -//! -//! ## Example -//! -//! ```rust,ignore -#![doc = include_str!("../examples/resolver.rs")] -//! ``` - -mod builtins; -mod cache; -mod context; -mod error; -mod file_system; -mod options; -mod package_json; -mod path; -mod resolution; -mod specifier; -mod tsconfig; - -#[cfg(test)] -mod tests; - -use std::{ - borrow::Cow, - cmp::Ordering, - ffi::OsStr, - fmt, - path::{Component, Path, PathBuf}, - sync::Arc, -}; - -use rustc_hash::FxHashSet; -use serde_json::Value as JSONValue; -use typescript_tsconfig_json::ExtendsField; - -pub use crate::{ - builtins::NODEJS_BUILTINS, - error::{JSONError, ResolveError, SpecifierError}, - file_system::{FileMetadata, FileSystem}, - options::{ - Alias, AliasValue, EnforceExtension, ResolveOptions, Restriction, TsconfigOptions, - TsconfigReferences, - }, - package_json::PackageJson, - resolution::Resolution, -}; -use crate::{ - cache::{Cache, CachedPath}, - context::ResolveContext as Ctx, - file_system::FileSystemOs, - package_json::JSONMap, - path::{PathUtil, SLASH_START}, - specifier::Specifier, - tsconfig::{ProjectReference, TsConfig}, -}; - -type ResolveResult = Result, ResolveError>; - -/// Context returned from the [Resolver::resolve_with_context] API -#[derive(Debug, Default, Clone)] -pub struct ResolveContext { - /// Files that was found on file system - pub file_dependencies: FxHashSet, - - /// Dependencies that was not found on file system - pub missing_dependencies: FxHashSet, -} - -/// Resolver with the current operating system as the file system -pub type Resolver = ResolverGeneric; - -/// Generic implementation of the resolver, can be configured by the [FileSystem] trait -pub struct ResolverGeneric { - options: ResolveOptions, - cache: Arc>, -} - -impl fmt::Debug for ResolverGeneric { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - self.options.fmt(f) - } -} - -impl Default for ResolverGeneric { - fn default() -> Self { - Self::new(ResolveOptions::default()) - } -} - -impl ResolverGeneric { - pub fn new(options: ResolveOptions) -> Self { - Self { options: options.sanitize(), cache: Arc::new(Cache::new(Fs::default())) } - } -} - -impl ResolverGeneric { - pub fn new_with_file_system(file_system: Fs, options: ResolveOptions) -> Self { - Self { cache: Arc::new(Cache::new(file_system)), options: options.sanitize() } - } - - /// Clone the resolver using the same underlying cache. - #[must_use] - pub fn clone_with_options(&self, options: ResolveOptions) -> Self { - Self { options: options.sanitize(), cache: Arc::clone(&self.cache) } - } - - /// Returns the options. - pub fn options(&self) -> &ResolveOptions { - &self.options - } - - /// Clear the underlying cache. - pub fn clear_cache(&self) { - self.cache.clear(); - } - - /// Resolve `specifier` at an absolute `path`. - /// - /// A specifier is the string passed to require or import, i.e. `require("specifier")` or `import "specifier"`. - /// - /// `path` must be an **absolute** path to a directory where the specifier is resolved against. - /// For CommonJS modules, it is the `__dirname` variable that contains the absolute path to the folder containing current module. - /// For ECMAScript modules, it is the value of `import.meta.url`. - /// - /// # Errors - /// - /// * See [ResolveError] - pub fn resolve>( - &self, - path: P, - specifier: &str, - ) -> Result { - let mut ctx = Ctx::default(); - self.resolve_tracing(path.as_ref(), specifier, &mut ctx) - } - - /// Resolve `specifier` at absolute `path` with [ResolveContext] - /// - /// # Errors - /// - /// * See [ResolveError] - pub fn resolve_with_context>( - &self, - path: P, - specifier: &str, - resolve_context: &mut ResolveContext, - ) -> Result { - let mut ctx = Ctx::default(); - ctx.init_file_dependencies(); - let result = self.resolve_tracing(path.as_ref(), specifier, &mut ctx); - if let Some(deps) = &mut ctx.file_dependencies { - resolve_context.file_dependencies.extend(deps.drain(..)); - } - if let Some(deps) = &mut ctx.missing_dependencies { - resolve_context.missing_dependencies.extend(deps.drain(..)); - } - result - } - - /// Wrap `resolve_impl` with `tracing` information - fn resolve_tracing( - &self, - path: &Path, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - let span = tracing::debug_span!("resolve", path = ?path, specifier = specifier); - let _enter = span.enter(); - let r = self.resolve_impl(path, specifier, ctx); - match &r { - Ok(r) => { - tracing::debug!(options = ?self.options, path = ?path, specifier = specifier, ret = ?r.path); - } - Err(err) => { - tracing::debug!(options = ?self.options, path = ?path, specifier = specifier, err = ?err); - } - }; - r - } - - fn resolve_impl( - &self, - path: &Path, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - ctx.with_fully_specified(self.options.fully_specified); - let cached_path = self.cache.value(path); - let cached_path = self.require(&cached_path, specifier, ctx)?; - let path = self.load_realpath(&cached_path)?; - // enhanced-resolve: restrictions - self.check_restrictions(&path)?; - let package_json = cached_path.find_package_json(&self.cache.fs, &self.options, ctx)?; - if let Some(package_json) = &package_json { - // path must be inside the package. - debug_assert!(path.starts_with(package_json.directory())); - } - Ok(Resolution { - path, - query: ctx.query.take(), - fragment: ctx.fragment.take(), - package_json, - }) - } - - /// require(X) from module at path Y - /// - /// X: specifier - /// Y: path - /// - /// - fn require( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - ctx.test_for_infinite_recursion()?; - - // enhanced-resolve: parse - let (parsed, try_fragment_as_path) = self.load_parse(cached_path, specifier, ctx)?; - if let Some(path) = try_fragment_as_path { - return Ok(path); - } - - self.require_without_parse(cached_path, parsed.path(), ctx) - } - - fn require_without_parse( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - // tsconfig-paths - if let Some(path) = self.load_tsconfig_paths(cached_path, specifier, &mut Ctx::default())? { - return Ok(path); - } - - // enhanced-resolve: try alias - if let Some(path) = self.load_alias(cached_path, specifier, &self.options.alias, ctx)? { - return Ok(path); - } - - let result = match Path::new(specifier).components().next() { - // 2. If X begins with '/' - Some(Component::RootDir | Component::Prefix(_)) => { - self.require_absolute(cached_path, specifier, ctx) - } - // 3. If X begins with './' or '/' or '../' - Some(Component::CurDir | Component::ParentDir) => { - self.require_relative(cached_path, specifier, ctx) - } - // 4. If X begins with '#' - Some(Component::Normal(_)) if specifier.as_bytes()[0] == b'#' => { - self.require_hash(cached_path, specifier, ctx) - } - _ => { - // 1. If X is a core module, - // a. return the core module - // b. STOP - self.require_core(specifier)?; - - // (ESM) 5. Otherwise, - // Note: specifier is now a bare specifier. - // Set resolved the result of PACKAGE_RESOLVE(specifier, parentURL). - self.require_bare(cached_path, specifier, ctx) - } - }; - - result.or_else(|err| { - if err.is_ignore() { - return Err(err); - } - // enhanced-resolve: try fallback - self.load_alias(cached_path, specifier, &self.options.fallback, ctx) - .and_then(|value| value.ok_or(err)) - }) - } - - // PACKAGE_RESOLVE(packageSpecifier, parentURL) - // 3. If packageSpecifier is a Node.js builtin module name, then - // 1. Return the string "node:" concatenated with packageSpecifier. - fn require_core(&self, specifier: &str) -> Result<(), ResolveError> { - if self.options.builtin_modules { - let starts_with_node = specifier.starts_with("node:"); - if starts_with_node || NODEJS_BUILTINS.binary_search(&specifier).is_ok() { - let mut specifier = specifier.to_string(); - if !starts_with_node { - specifier = format!("node:{specifier}"); - } - return Err(ResolveError::Builtin(specifier)); - } - } - Ok(()) - } - - fn require_absolute( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - // Make sure only path prefixes gets called - debug_assert!(Path::new(specifier) - .components() - .next() - .is_some_and(|c| matches!(c, Component::RootDir | Component::Prefix(_)))); - if !self.options.prefer_relative && self.options.prefer_absolute { - if let Ok(path) = self.load_package_self_or_node_modules(cached_path, specifier, ctx) { - return Ok(path); - } - } - if let Some(path) = self.load_roots(specifier, ctx) { - return Ok(path); - } - // 2. If X begins with '/' - // a. set Y to be the file system root - let path = self.cache.value(Path::new(specifier)); - if let Some(path) = self.load_as_file_or_directory(&path, specifier, ctx)? { - return Ok(path); - } - Err(ResolveError::NotFound(specifier.to_string())) - } - - // 3. If X begins with './' or '/' or '../' - fn require_relative( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - // Make sure only relative or normal paths gets called - debug_assert!(Path::new(specifier).components().next().is_some_and(|c| matches!( - c, - Component::CurDir | Component::ParentDir | Component::Normal(_) - ))); - let path = cached_path.path().normalize_with(specifier); - let cached_path = self.cache.value(&path); - // a. LOAD_AS_FILE(Y + X) - // b. LOAD_AS_DIRECTORY(Y + X) - if let Some(path) = self.load_as_file_or_directory(&cached_path, specifier, ctx)? { - return Ok(path); - } - // c. THROW "not found" - Err(ResolveError::NotFound(specifier.to_string())) - } - - fn require_hash( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - debug_assert_eq!(specifier.chars().next(), Some('#')); - // a. LOAD_PACKAGE_IMPORTS(X, dirname(Y)) - if let Some(path) = self.load_package_imports(cached_path, specifier, ctx)? { - return Ok(path); - } - self.load_package_self_or_node_modules(cached_path, specifier, ctx) - } - - fn require_bare( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - // Make sure no other path prefixes gets called - debug_assert!(Path::new(specifier) - .components() - .next() - .is_some_and(|c| matches!(c, Component::Normal(_)))); - if self.options.prefer_relative { - if let Ok(path) = self.require_relative(cached_path, specifier, ctx) { - return Ok(path); - } - } - self.load_package_self_or_node_modules(cached_path, specifier, ctx) - } - - /// enhanced-resolve: ParsePlugin. - /// - /// 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`. - /// - /// - fn load_parse<'s>( - &self, - cached_path: &CachedPath, - specifier: &'s str, - ctx: &mut Ctx, - ) -> Result<(Specifier<'s>, Option), ResolveError> { - let parsed = Specifier::parse(specifier).map_err(ResolveError::Specifier)?; - ctx.with_query_fragment(parsed.query, parsed.fragment); - - // There is an edge-case where a request with # can be a path or a fragment -> try both - if ctx.fragment.is_some() && ctx.query.is_none() { - let specifier = parsed.path(); - let fragment = ctx.fragment.take().unwrap(); - let path = format!("{specifier}{fragment}"); - if let Ok(path) = self.require_without_parse(cached_path, &path, ctx) { - return Ok((parsed, Some(path))); - } - ctx.fragment.replace(fragment); - } - Ok((parsed, None)) - } - - fn load_package_self_or_node_modules( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - let (_, subpath) = Self::parse_package_specifier(specifier); - if subpath.is_empty() { - ctx.with_fully_specified(false); - } - // 5. LOAD_PACKAGE_SELF(X, dirname(Y)) - if let Some(path) = self.load_package_self(cached_path, specifier, ctx)? { - return Ok(path); - } - // 6. LOAD_NODE_MODULES(X, dirname(Y)) - if let Some(path) = self.load_node_modules(cached_path, specifier, ctx)? { - return Ok(path); - } - // 7. THROW "not found" - Err(ResolveError::NotFound(specifier.to_string())) - } - - /// LOAD_PACKAGE_IMPORTS(X, DIR) - fn load_package_imports( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - // 1. Find the closest package scope SCOPE to DIR. - // 2. If no scope was found, return. - let Some(package_json) = - cached_path.find_package_json(&self.cache.fs, &self.options, ctx)? - else { - return Ok(None); - }; - // 3. If the SCOPE/package.json "imports" is null or undefined, return. - // 4. let MATCH = PACKAGE_IMPORTS_RESOLVE(X, pathToFileURL(SCOPE), ["node", "require"]) defined in the ESM resolver. - if let Some(path) = self.package_imports_resolve(specifier, &package_json, ctx)? { - // 5. RESOLVE_ESM_MATCH(MATCH). - return self.resolve_esm_match(specifier, &path, ctx); - } - Ok(None) - } - - fn load_as_file(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - // enhanced-resolve feature: extension_alias - if let Some(path) = self.load_extension_alias(cached_path, ctx)? { - return Ok(Some(path)); - } - if self.options.enforce_extension.is_disabled() { - // 1. If X is a file, load X as its file extension format. STOP - if let Some(path) = self.load_alias_or_file(cached_path, ctx)? { - return Ok(Some(path)); - } - } - // 2. If X.js is a file, load X.js as JavaScript text. STOP - // 3. If X.json is a file, parse X.json to a JavaScript Object. STOP - // 4. If X.node is a file, load X.node as binary addon. STOP - if let Some(path) = - self.load_extensions(cached_path.path(), &self.options.extensions, ctx)? - { - return Ok(Some(path)); - } - Ok(None) - } - - fn load_as_directory(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - // TODO: Only package.json is supported, so warn about having other values - // Checking for empty files is needed for omitting checks on package.json - // 1. If X/package.json is a file, - if !self.options.description_files.is_empty() { - // a. Parse X/package.json, and look for "main" field. - if let Some(package_json) = - cached_path.package_json(&self.cache.fs, &self.options, ctx)? - { - // b. If "main" is a falsy value, GOTO 2. - for main_field in package_json.main_fields(&self.options.main_fields) { - // c. let M = X + (json main field) - let main_field_path = cached_path.path().normalize_with(main_field); - // d. LOAD_AS_FILE(M) - let cached_path = self.cache.value(&main_field_path); - if let Some(path) = self.load_as_file(&cached_path, ctx)? { - return Ok(Some(path)); - } - // e. LOAD_INDEX(M) - if let Some(path) = self.load_index(&cached_path, ctx)? { - return Ok(Some(path)); - } - } - // f. LOAD_INDEX(X) DEPRECATED - // g. THROW "not found" - } - } - // 2. LOAD_INDEX(X) - self.load_index(cached_path, ctx) - } - - fn load_as_file_or_directory( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - if self.options.resolve_to_context { - return Ok(cached_path.is_dir(&self.cache.fs, ctx).then(|| cached_path.clone())); - } - if !specifier.ends_with('/') { - if let Some(path) = self.load_as_file(cached_path, ctx)? { - return Ok(Some(path)); - } - } - if cached_path.is_dir(&self.cache.fs, ctx) { - if let Some(path) = self.load_as_directory(cached_path, ctx)? { - return Ok(Some(path)); - } - } - Ok(None) - } - - fn load_extensions(&self, path: &Path, extensions: &[String], ctx: &mut Ctx) -> ResolveResult { - if ctx.fully_specified { - return Ok(None); - } - let path = path.as_os_str(); - for extension in extensions { - let mut path_with_extension = path.to_os_string(); - path_with_extension.reserve_exact(extension.len()); - path_with_extension.push(extension); - let cached_path = self.cache.value(Path::new(&path_with_extension)); - if let Some(path) = self.load_alias_or_file(&cached_path, ctx)? { - return Ok(Some(path)); - } - } - Ok(None) - } - - fn load_realpath(&self, cached_path: &CachedPath) -> Result { - if self.options.symlinks { - cached_path.realpath(&self.cache.fs).map_err(ResolveError::from) - } else { - Ok(cached_path.to_path_buf()) - } - } - - fn check_restrictions(&self, path: &Path) -> Result<(), ResolveError> { - // https://github.com/webpack/enhanced-resolve/blob/a998c7d218b7a9ec2461fc4fddd1ad5dd7687485/lib/RestrictionsPlugin.js#L19-L24 - fn is_inside(path: &Path, parent: &Path) -> bool { - if !path.starts_with(parent) { - return false; - } - if path.as_os_str().len() == parent.as_os_str().len() { - return true; - } - path.strip_prefix(parent).is_ok_and(|p| p == Path::new("./")) - } - for restriction in &self.options.restrictions { - match restriction { - Restriction::Path(restricted_path) => { - if !is_inside(path, restricted_path) { - return Err(ResolveError::Restriction( - path.to_path_buf(), - restricted_path.clone(), - )); - } - } - Restriction::RegExp(_) => { - return Err(ResolveError::Unimplemented("Restriction with regex")) - } - } - } - Ok(()) - } - - fn load_index(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - for main_file in &self.options.main_files { - let main_path = cached_path.path().normalize_with(main_file); - let cached_path = self.cache.value(&main_path); - if self.options.enforce_extension.is_disabled() { - if let Some(path) = self.load_alias_or_file(&cached_path, ctx)? { - return Ok(Some(path)); - } - } - // 1. If X/index.js is a file, load X/index.js as JavaScript text. STOP - // 2. If X/index.json is a file, parse X/index.json to a JavaScript object. STOP - // 3. If X/index.node is a file, load X/index.node as binary addon. STOP - if let Some(path) = - self.load_extensions(cached_path.path(), &self.options.extensions, ctx)? - { - return Ok(Some(path)); - } - } - Ok(None) - } - - fn load_alias_or_file(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - if let Some(package_json) = - cached_path.find_package_json(&self.cache.fs, &self.options, ctx)? - { - if let Some(path) = self.load_browser_field(cached_path, None, &package_json, ctx)? { - return Ok(Some(path)); - } - } - // enhanced-resolve: try file as alias - let alias_specifier = cached_path.path().to_string_lossy(); - if let Some(path) = - self.load_alias(cached_path, &alias_specifier, &self.options.alias, ctx)? - { - return Ok(Some(path)); - } - if cached_path.is_file(&self.cache.fs, ctx) { - return Ok(Some(cached_path.clone())); - } - Ok(None) - } - - fn load_node_modules( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - let (package_name, subpath) = Self::parse_package_specifier(specifier); - // 1. let DIRS = NODE_MODULES_PATHS(START) - // 2. for each DIR in DIRS: - for module_name in &self.options.modules { - for cached_path in std::iter::successors(Some(cached_path), |p| p.parent()) { - // Skip if /path/to/node_modules does not exist - if !cached_path.is_dir(&self.cache.fs, ctx) { - continue; - } - - let Some(cached_path) = self.get_module_directory(cached_path, module_name, ctx) - else { - continue; - }; - // Optimize node_modules lookup by inspecting whether the package exists - // From LOAD_PACKAGE_EXPORTS(X, DIR) - // 1. Try to interpret X as a combination of NAME and SUBPATH where the name - // may have a @scope/ prefix and the subpath begins with a slash (`/`). - if !package_name.is_empty() { - let package_path = cached_path.path().normalize_with(package_name); - let cached_path = self.cache.value(&package_path); - // Try foo/node_modules/package_name - if cached_path.is_dir(&self.cache.fs, ctx) { - // a. LOAD_PACKAGE_EXPORTS(X, DIR) - if let Some(path) = - self.load_package_exports(specifier, subpath, &cached_path, ctx)? - { - return Ok(Some(path)); - } - } else { - // foo/node_modules/package_name is not a directory, so useless to check inside it - if !subpath.is_empty() { - continue; - } - // Skip if the directory lead to the scope package does not exist - // i.e. `foo/node_modules/@scope` is not a directory for `foo/node_modules/@scope/package` - if package_name.starts_with('@') { - if let Some(path) = cached_path.parent() { - if !path.is_dir(&self.cache.fs, ctx) { - continue; - } - } - } - } - } - - // Try as file or directory for all other cases - // b. LOAD_AS_FILE(DIR/X) - // c. LOAD_AS_DIRECTORY(DIR/X) - let node_module_file = cached_path.path().normalize_with(specifier); - let cached_path = self.cache.value(&node_module_file); - if let Some(path) = self.load_as_file_or_directory(&cached_path, specifier, ctx)? { - return Ok(Some(path)); - } - } - } - Ok(None) - } - - fn get_module_directory( - &self, - cached_path: &CachedPath, - module_name: &str, - ctx: &mut Ctx, - ) -> Option { - if cached_path.path().ends_with(module_name) { - Some(cached_path.clone()) - } else if module_name == "node_modules" { - cached_path.cached_node_modules(&self.cache, ctx) - } else { - cached_path.module_directory(module_name, &self.cache, ctx) - } - } - - fn load_package_exports( - &self, - specifier: &str, - subpath: &str, - cached_path: &CachedPath, - ctx: &mut Ctx, - ) -> ResolveResult { - // 2. If X does not match this pattern or DIR/NAME/package.json is not a file, - // return. - let Some(package_json) = cached_path.package_json(&self.cache.fs, &self.options, ctx)? - else { - return Ok(None); - }; - // 3. Parse DIR/NAME/package.json, and look for "exports" field. - // 4. If "exports" is null or undefined, return. - // 5. let MATCH = PACKAGE_EXPORTS_RESOLVE(pathToFileURL(DIR/NAME), "." + SUBPATH, - // `package.json` "exports", ["node", "require"]) defined in the ESM resolver. - // Note: The subpath is not prepended with a dot on purpose - for exports in package_json.exports_fields(&self.options.exports_fields) { - if let Some(path) = self.package_exports_resolve( - cached_path.path(), - &format!(".{subpath}"), - exports, - ctx, - )? { - // 6. RESOLVE_ESM_MATCH(MATCH) - return self.resolve_esm_match(specifier, &path, ctx); - }; - } - Ok(None) - } - - fn load_package_self( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - // 1. Find the closest package scope SCOPE to DIR. - // 2. If no scope was found, return. - let Some(package_json) = - cached_path.find_package_json(&self.cache.fs, &self.options, ctx)? - else { - return Ok(None); - }; - // 3. If the SCOPE/package.json "exports" is null or undefined, return. - // 4. If the SCOPE/package.json "name" is not the first segment of X, return. - if let Some(subpath) = package_json - .name - .as_ref() - .and_then(|package_name| Self::strip_package_name(specifier, package_name)) - { - // 5. let MATCH = PACKAGE_EXPORTS_RESOLVE(pathToFileURL(SCOPE), - // "." + X.slice("name".length), `package.json` "exports", ["node", "require"]) - // defined in the ESM resolver. - let package_url = package_json.directory(); - // Note: The subpath is not prepended with a dot on purpose - // because `package_exports_resolve` matches subpath without the leading dot. - for exports in package_json.exports_fields(&self.options.exports_fields) { - if let Some(cached_path) = - self.package_exports_resolve(package_url, &format!(".{subpath}"), exports, ctx)? - { - // 6. RESOLVE_ESM_MATCH(MATCH) - return self.resolve_esm_match(specifier, &cached_path, ctx); - } - } - } - self.load_browser_field(cached_path, Some(specifier), &package_json, ctx) - } - - /// RESOLVE_ESM_MATCH(MATCH) - fn resolve_esm_match( - &self, - specifier: &str, - cached_path: &CachedPath, - ctx: &mut Ctx, - ) -> ResolveResult { - // 1. let RESOLVED_PATH = fileURLToPath(MATCH) - // 2. If the file at RESOLVED_PATH exists, load RESOLVED_PATH as its extension format. STOP - // - // Non-compliant ESM can result in a directory, so directory is tried as well. - if let Some(path) = self.load_as_file_or_directory(cached_path, "", ctx)? { - return Ok(Some(path)); - } - // 3. THROW "not found" - Err(ResolveError::NotFound(specifier.to_string())) - } - - /// enhanced-resolve: AliasFieldPlugin for [ResolveOptions::alias_fields] - fn load_browser_field( - &self, - cached_path: &CachedPath, - module_specifier: Option<&str>, - package_json: &PackageJson, - ctx: &mut Ctx, - ) -> ResolveResult { - let path = cached_path.path(); - let Some(new_specifier) = package_json.resolve_browser_field( - path, - module_specifier, - &self.options.alias_fields, - )? - else { - return Ok(None); - }; - // Abort when resolving recursive module - if module_specifier.is_some_and(|s| s == new_specifier) { - return Ok(None); - } - if ctx.resolving_alias.as_ref().is_some_and(|s| s == new_specifier) { - // Complete when resolving to self `{"./a.js": "./a.js"}` - if new_specifier.strip_prefix("./").filter(|s| path.ends_with(Path::new(s))).is_some() { - return if cached_path.is_file(&self.cache.fs, ctx) { - Ok(Some(cached_path.clone())) - } else { - Err(ResolveError::NotFound(new_specifier.to_string())) - }; - } - return Err(ResolveError::Recursion); - } - ctx.with_resolving_alias(new_specifier.to_string()); - ctx.with_fully_specified(false); - let cached_path = self.cache.value(package_json.directory()); - self.require(&cached_path, new_specifier, ctx).map(Some) - } - - /// enhanced-resolve: AliasPlugin for [ResolveOptions::alias] and [ResolveOptions::fallback]. - fn load_alias( - &self, - cached_path: &CachedPath, - specifier: &str, - aliases: &Alias, - ctx: &mut Ctx, - ) -> ResolveResult { - for (alias_key_raw, specifiers) in aliases { - let alias_key = if let Some(alias_key) = alias_key_raw.strip_suffix('$') { - if alias_key != specifier { - continue; - } - alias_key - } else { - let strip_package_name = Self::strip_package_name(specifier, alias_key_raw); - if strip_package_name.is_none() { - continue; - } - alias_key_raw - }; - // It should stop resolving when all of the tried alias values - // failed to resolve. - // - let mut should_stop = false; - for r in specifiers { - match r { - AliasValue::Path(alias_value) => { - if let Some(path) = self.load_alias_value( - cached_path, - alias_key, - alias_value, - specifier, - ctx, - &mut should_stop, - )? { - return Ok(Some(path)); - } - } - AliasValue::Ignore => { - let path = cached_path.path().normalize_with(alias_key); - return Err(ResolveError::Ignored(path)); - } - } - } - if should_stop { - return Err(ResolveError::NotFound(specifier.to_string())); - } - } - Ok(None) - } - - fn load_alias_value( - &self, - cached_path: &CachedPath, - alias_key: &str, - alias_value: &str, - request: &str, - ctx: &mut Ctx, - should_stop: &mut bool, - ) -> ResolveResult { - if request != alias_value - && !request.strip_prefix(alias_value).is_some_and(|prefix| prefix.starts_with('/')) - { - let tail = &request[alias_key.len()..]; - - let new_specifier = if tail.is_empty() { - Cow::Borrowed(alias_value) - } else { - let alias_value = Path::new(alias_value).normalize(); - // Must not append anything to alias_value if it is a file. - let alias_value_cached_path = self.cache.value(&alias_value); - if alias_value_cached_path.is_file(&self.cache.fs, ctx) { - return Ok(None); - } - - // Remove the leading slash so the final path is concatenated. - let tail = tail.trim_start_matches(SLASH_START); - let normalized = alias_value.normalize_with(tail); - Cow::Owned(normalized.to_string_lossy().to_string()) - }; - - *should_stop = true; - ctx.with_fully_specified(false); - return match self.require(cached_path, new_specifier.as_ref(), ctx) { - Err(ResolveError::NotFound(_)) => Ok(None), - Ok(path) => return Ok(Some(path)), - Err(err) => return Err(err), - }; - } - Ok(None) - } - - /// Given an extension alias map `{".js": [".ts", "js"]}`, - /// load the mapping instead of the provided extension - /// - /// This is an enhanced-resolve feature - /// - /// # Errors - /// - /// * [ResolveError::ExtensionAlias]: When all of the aliased extensions are not found - fn load_extension_alias(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - let Some(path_extension) = cached_path.path().extension() else { - return Ok(None); - }; - let Some((_, extensions)) = self - .options - .extension_alias - .iter() - .find(|(ext, _)| OsStr::new(ext.trim_start_matches('.')) == path_extension) - else { - return Ok(None); - }; - let path = cached_path.path().with_extension(""); - ctx.with_fully_specified(false); - if let Some(path) = self.load_extensions(&path, extensions, ctx)? { - return Ok(Some(path)); - } - Err(ResolveError::ExtensionAlias) - } - - /// enhanced-resolve: RootsPlugin - /// - /// A list of directories where requests of server-relative URLs (starting with '/') are resolved, - /// defaults to context configuration option. - /// - /// On non-Windows systems these requests are resolved as an absolute path first. - fn load_roots(&self, specifier: &str, ctx: &mut Ctx) -> Option { - if !self.options.roots.is_empty() { - if let Some(specifier) = specifier.strip_prefix(SLASH_START) { - for root in &self.options.roots { - let cached_path = self.cache.value(root); - if let Ok(path) = self.require_relative(&cached_path, specifier, ctx) { - return Some(path); - } - } - } - } - None - } - - fn load_tsconfig_paths( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - let Some(tsconfig_options) = &self.options.tsconfig else { - return Ok(None); - }; - let tsconfig = self.load_tsconfig( - /* root */ true, - &tsconfig_options.config_file, - &tsconfig_options.references, - )?; - let paths = tsconfig.resolve(cached_path.path(), specifier); - for path in paths { - let cached_path = self.cache.value(&path); - if let Ok(path) = self.require_relative(&cached_path, ".", ctx) { - return Ok(Some(path)); - } - } - Ok(None) - } - - fn load_tsconfig( - &self, - root: bool, - path: &Path, - references: &TsconfigReferences, - ) -> Result, ResolveError> { - self.cache.tsconfig(root, path, |tsconfig| { - let directory = self.cache.value(tsconfig.directory()); - tracing::trace!(tsconfig = ?tsconfig, "load_tsconfig"); - - // Extend tsconfig - if let Some(extends) = &tsconfig.extends { - let extended_tsconfig_paths = match extends { - ExtendsField::Single(s) => { - vec![self.get_extended_tsconfig_path(&directory, tsconfig, s)?] - } - ExtendsField::Multiple(specifiers) => specifiers - .iter() - .map(|s| self.get_extended_tsconfig_path(&directory, tsconfig, s)) - .collect::, ResolveError>>()?, - }; - for extended_tsconfig_path in extended_tsconfig_paths { - let extended_tsconfig = self.load_tsconfig( - /* root */ false, - &extended_tsconfig_path, - &TsconfigReferences::Disabled, - )?; - tsconfig.extend_tsconfig(&extended_tsconfig); - } - } - - // Load project references - match references { - TsconfigReferences::Disabled => { - tsconfig.references.drain(..); - } - TsconfigReferences::Auto => {} - TsconfigReferences::Paths(paths) => { - tsconfig.references = paths - .iter() - .map(|path| ProjectReference { path: path.clone(), tsconfig: None }) - .collect(); - } - } - if !tsconfig.references.is_empty() { - let directory = tsconfig.directory().to_path_buf(); - for reference in &mut tsconfig.references { - let reference_tsconfig_path = directory.normalize_with(&reference.path); - let tsconfig = self.cache.tsconfig( - /* root */ true, - &reference_tsconfig_path, - |_| Ok(()), - )?; - reference.tsconfig.replace(tsconfig); - } - } - Ok(()) - }) - } - - fn get_extended_tsconfig_path( - &self, - directory: &CachedPath, - tsconfig: &TsConfig, - specifier: &str, - ) -> Result { - match specifier.as_bytes().first() { - None => Err(ResolveError::Specifier(SpecifierError::Empty(specifier.to_string()))), - Some(b'/') => Ok(PathBuf::from(specifier)), - Some(b'.') => Ok(tsconfig.directory().normalize_with(specifier)), - _ => self - .clone_with_options(ResolveOptions { - description_files: vec![], - extensions: vec![".json".into()], - main_files: vec!["tsconfig.json".into()], - ..ResolveOptions::default() - }) - .load_package_self_or_node_modules(directory, specifier, &mut Ctx::default()) - .map(|p| p.to_path_buf()) - .map_err(|err| match err { - ResolveError::NotFound(_) => { - ResolveError::TsconfigNotFound(PathBuf::from(specifier)) - } - _ => err, - }), - } - } - - /// PACKAGE_RESOLVE(packageSpecifier, parentURL) - fn package_resolve( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - let (package_name, subpath) = Self::parse_package_specifier(specifier); - - // 3. If packageSpecifier is a Node.js builtin module name, then - // 1. Return the string "node:" concatenated with packageSpecifier. - self.require_core(package_name)?; - - // 11. While parentURL is not the file system root, - for module_name in &self.options.modules { - for cached_path in std::iter::successors(Some(cached_path), |p| p.parent()) { - // 1. Let packageURL be the URL resolution of "node_modules/" concatenated with packageSpecifier, relative to parentURL. - let Some(cached_path) = self.get_module_directory(cached_path, module_name, ctx) - else { - continue; - }; - // 2. Set parentURL to the parent folder URL of parentURL. - let package_path = cached_path.path().normalize_with(package_name); - let cached_path = self.cache.value(&package_path); - // 3. If the folder at packageURL does not exist, then - // 1. Continue the next loop iteration. - if cached_path.is_dir(&self.cache.fs, ctx) { - // 4. Let pjson be the result of READ_PACKAGE_JSON(packageURL). - if let Some(package_json) = - cached_path.package_json(&self.cache.fs, &self.options, ctx)? - { - // 5. If pjson is not null and pjson.exports is not null or undefined, then - // 1. Return the result of PACKAGE_EXPORTS_RESOLVE(packageURL, packageSubpath, pjson.exports, defaultConditions). - for exports in package_json.exports_fields(&self.options.exports_fields) { - if let Some(path) = self.package_exports_resolve( - cached_path.path(), - &format!(".{subpath}"), - exports, - ctx, - )? { - return Ok(Some(path)); - } - } - // 6. Otherwise, if packageSubpath is equal to ".", then - if subpath == "." { - // 1. If pjson.main is a string, then - for main_field in package_json.main_fields(&self.options.main_fields) { - // 1. Return the URL resolution of main in packageURL. - let path = cached_path.path().normalize_with(main_field); - let cached_path = self.cache.value(&path); - if cached_path.is_file(&self.cache.fs, ctx) { - return Ok(Some(cached_path)); - } - } - } - } - let subpath = format!(".{subpath}"); - ctx.with_fully_specified(false); - return self.require(&cached_path, &subpath, ctx).map(Some); - } - } - } - - Err(ResolveError::NotFound(specifier.to_string())) - } - - /// PACKAGE_EXPORTS_RESOLVE(packageURL, subpath, exports, conditions) - fn package_exports_resolve( - &self, - package_url: &Path, - subpath: &str, - exports: &JSONValue, - ctx: &mut Ctx, - ) -> ResolveResult { - let conditions = &self.options.condition_names; - // 1. If exports is an Object with both a key starting with "." and a key not starting with ".", throw an Invalid Package Configuration error. - if let JSONValue::Object(map) = exports { - let mut has_dot = false; - let mut without_dot = false; - for key in map.keys() { - has_dot = has_dot || key.starts_with(|s| s == '.' || s == '#'); - without_dot = without_dot || !key.starts_with(|s| s == '.' || s == '#'); - if has_dot && without_dot { - return Err(ResolveError::InvalidPackageConfig( - package_url.join("package.json"), - )); - } - } - } - // 2. If subpath is equal to ".", then - // Note: subpath is not prepended with a dot when passed in. - if subpath == "." { - // enhanced-resolve appends query and fragment when resolving exports field - // https://github.com/webpack/enhanced-resolve/blob/a998c7d218b7a9ec2461fc4fddd1ad5dd7687485/lib/ExportsFieldPlugin.js#L57-L62 - // This is only need when querying the main export, otherwise ctx is passed through. - if ctx.query.is_some() || ctx.fragment.is_some() { - let query = ctx.query.clone().unwrap_or_default(); - let fragment = ctx.fragment.clone().unwrap_or_default(); - return Err(ResolveError::PackagePathNotExported( - format!("./{}{query}{fragment}", subpath.trim_start_matches('.')), - package_url.join("package.json"), - )); - } - // 1. Let mainExport be undefined. - let main_export = match exports { - // 2. If exports is a String or Array, or an Object containing no keys starting with ".", then - JSONValue::String(_) | JSONValue::Array(_) => { - // 1. Set mainExport to exports. - Some(exports) - } - // 3. Otherwise if exports is an Object containing a "." property, then - JSONValue::Object(map) => { - // 1. Set mainExport to exports["."]. - map.get(".").map_or_else( - || { - if map.keys().any(|key| key.starts_with("./") || key.starts_with('#')) { - None - } else { - Some(exports) - } - }, - Some, - ) - } - _ => None, - }; - // 4. If mainExport is not undefined, then - if let Some(main_export) = main_export { - // 1. Let resolved be the result of PACKAGE_TARGET_RESOLVE( packageURL, mainExport, null, false, conditions). - let resolved = self.package_target_resolve( - package_url, - ".", - main_export, - None, - /* is_imports */ false, - conditions, - ctx, - )?; - // 2. If resolved is not null or undefined, return resolved. - if let Some(path) = resolved { - return Ok(Some(path)); - } - } - } - // 3. Otherwise, if exports is an Object and all keys of exports start with ".", then - if let JSONValue::Object(exports) = exports { - // 1. Let matchKey be the string "./" concatenated with subpath. - // Note: `package_imports_exports_resolve` does not require the leading dot. - let match_key = &subpath; - // 2. Let resolved be the result of PACKAGE_IMPORTS_EXPORTS_RESOLVE( matchKey, exports, packageURL, false, conditions). - if let Some(path) = self.package_imports_exports_resolve( - match_key, - exports, - package_url, - /* is_imports */ false, - conditions, - ctx, - )? { - // 3. If resolved is not null or undefined, return resolved. - return Ok(Some(path)); - } - } - // 4. Throw a Package Path Not Exported error. - Err(ResolveError::PackagePathNotExported( - subpath.to_string(), - package_url.join("package.json"), - )) - } - - /// PACKAGE_IMPORTS_RESOLVE(specifier, parentURL, conditions) - fn package_imports_resolve( - &self, - specifier: &str, - package_json: &PackageJson, - ctx: &mut Ctx, - ) -> Result, ResolveError> { - // 1. Assert: specifier begins with "#". - debug_assert!(specifier.starts_with('#'), "{specifier}"); - // 2. If specifier is exactly equal to "#" or starts with "#/", then - // 1. Throw an Invalid Module Specifier error. - // 3. Let packageURL be the result of LOOKUP_PACKAGE_SCOPE(parentURL). - // 4. If packageURL is not null, then - - // 1. Let pjson be the result of READ_PACKAGE_JSON(packageURL). - // 2. If pjson.imports is a non-null Object, then - - // 1. Let resolved be the result of PACKAGE_IMPORTS_EXPORTS_RESOLVE( specifier, pjson.imports, packageURL, true, conditions). - let mut has_imports = false; - for imports in package_json.imports_fields(&self.options.imports_fields) { - if !has_imports { - has_imports = true; - // TODO: fill in test case for this case - if specifier == "#" || specifier.starts_with("#/") { - return Err(ResolveError::InvalidModuleSpecifier( - specifier.to_string(), - package_json.path.clone(), - )); - } - } - if let Some(path) = self.package_imports_exports_resolve( - specifier, - imports, - package_json.directory(), - /* is_imports */ true, - &self.options.condition_names, - ctx, - )? { - // 2. If resolved is not null or undefined, return resolved. - return Ok(Some(path)); - } - } - - // 5. Throw a Package Import Not Defined error. - if has_imports { - Err(ResolveError::PackageImportNotDefined( - specifier.to_string(), - package_json.path.clone(), - )) - } else { - Ok(None) - } - } - - /// PACKAGE_IMPORTS_EXPORTS_RESOLVE(matchKey, matchObj, packageURL, isImports, conditions) - fn package_imports_exports_resolve( - &self, - match_key: &str, - match_obj: &JSONMap, - package_url: &Path, - is_imports: bool, - conditions: &[String], - ctx: &mut Ctx, - ) -> ResolveResult { - // enhanced-resolve behaves differently, it throws - // Error: CachedPath to directories is not possible with the exports field (specifier was ./dist/) - if match_key.ends_with('/') { - return Ok(None); - } - // 1. If matchKey is a key of matchObj and does not contain "*", then - if !match_key.contains('*') { - // 1. Let target be the value of matchObj[matchKey]. - if let Some(target) = match_obj.get(match_key) { - // 2. Return the result of PACKAGE_TARGET_RESOLVE(packageURL, target, null, isImports, conditions). - return self.package_target_resolve( - package_url, - match_key, - target, - None, - is_imports, - conditions, - ctx, - ); - } - } - - let mut best_target = None; - let mut best_match = ""; - let mut best_key = ""; - // 2. Let expansionKeys be the list of keys of matchObj containing only a single "*", sorted by the sorting function PATTERN_KEY_COMPARE which orders in descending order of specificity. - // 3. For each key expansionKey in expansionKeys, do - for (expansion_key, target) in match_obj { - if expansion_key.starts_with("./") || expansion_key.starts_with('#') { - // 1. Let patternBase be the substring of expansionKey up to but excluding the first "*" character. - if let Some((pattern_base, pattern_trailer)) = expansion_key.split_once('*') { - // 2. If matchKey starts with but is not equal to patternBase, then - if match_key.starts_with(pattern_base) - // 1. Let patternTrailer be the substring of expansionKey from the index after the first "*" character. - && !pattern_trailer.contains('*') - // 2. If patternTrailer has zero length, or if matchKey ends with patternTrailer and the length of matchKey is greater than or equal to the length of expansionKey, then - && (pattern_trailer.is_empty() - || (match_key.len() >= expansion_key.len() - && match_key.ends_with(pattern_trailer))) - && Self::pattern_key_compare(best_key, expansion_key).is_gt() - { - // 1. Let target be the value of matchObj[expansionKey]. - best_target = Some(target); - // 2. Let patternMatch be the substring of matchKey starting at the index of the length of patternBase up to the length of matchKey minus the length of patternTrailer. - best_match = - &match_key[pattern_base.len()..match_key.len() - pattern_trailer.len()]; - best_key = expansion_key; - } - } else if expansion_key.ends_with('/') - && match_key.starts_with(expansion_key) - && Self::pattern_key_compare(best_key, expansion_key).is_gt() - { - // TODO: [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./dist/" in the "exports" field module resolution of the package at xxx/package.json. - best_target = Some(target); - best_match = &match_key[expansion_key.len()..]; - best_key = expansion_key; - } - } - } - if let Some(best_target) = best_target { - // 3. Return the result of PACKAGE_TARGET_RESOLVE(packageURL, target, patternMatch, isImports, conditions). - return self.package_target_resolve( - package_url, - best_key, - best_target, - Some(best_match), - is_imports, - conditions, - ctx, - ); - } - // 4. Return null. - Ok(None) - } - - /// PACKAGE_TARGET_RESOLVE(packageURL, target, patternMatch, isImports, conditions) - #[allow(clippy::too_many_arguments)] - fn package_target_resolve( - &self, - package_url: &Path, - target_key: &str, - target: &JSONValue, - pattern_match: Option<&str>, - is_imports: bool, - conditions: &[String], - ctx: &mut Ctx, - ) -> ResolveResult { - fn normalize_string_target<'a>( - target_key: &'a str, - target: &'a str, - pattern_match: Option<&'a str>, - package_url: &Path, - ) -> Result, ResolveError> { - let target = if let Some(pattern_match) = pattern_match { - if !target_key.contains('*') && !target.contains('*') { - // enhanced-resolve behaviour - // TODO: [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./dist/" in the "exports" field module resolution of the package at xxx/package.json. - if target_key.ends_with('/') && target.ends_with('/') { - Cow::Owned(format!("{target}{pattern_match}")) - } else { - return Err(ResolveError::InvalidPackageConfigDirectory( - package_url.join("package.json"), - )); - } - } else { - Cow::Owned(target.replace('*', pattern_match)) - } - } else { - Cow::Borrowed(target) - }; - Ok(target) - } - - match target { - // 1. If target is a String, then - JSONValue::String(target) => { - // 1. If target does not start with "./", then - if !target.starts_with("./") { - // 1. If isImports is false, or if target starts with "../" or "/", or if target is a valid URL, then - if !is_imports || target.starts_with("../") || target.starts_with('/') { - // 1. Throw an Invalid Package Target error. - return Err(ResolveError::InvalidPackageTarget( - target.to_string(), - target_key.to_string(), - package_url.join("package.json"), - )); - } - // 2. If patternMatch is a String, then - // 1. Return PACKAGE_RESOLVE(target with every instance of "*" replaced by patternMatch, packageURL + "/"). - let target = - normalize_string_target(target_key, target, pattern_match, package_url)?; - let package_url = self.cache.value(package_url); - // // 3. Return PACKAGE_RESOLVE(target, packageURL + "/"). - return self.package_resolve(&package_url, &target, ctx); - } - - // 2. If target split on "/" or "\" contains any "", ".", "..", or "node_modules" segments after the first "." segment, case insensitive and including percent encoded variants, throw an Invalid Package Target error. - // 3. Let resolvedTarget be the URL resolution of the concatenation of packageURL and target. - // 4. Assert: resolvedTarget is contained in packageURL. - // 5. If patternMatch is null, then - let target = - normalize_string_target(target_key, target, pattern_match, package_url)?; - if Path::new(target.as_ref()).is_invalid_exports_target() { - return Err(ResolveError::InvalidPackageTarget( - target.to_string(), - target_key.to_string(), - package_url.join("package.json"), - )); - } - let resolved_target = package_url.normalize_with(target.as_ref()); - // 6. If patternMatch split on "/" or "\" contains any "", ".", "..", or "node_modules" segments, case insensitive and including percent encoded variants, throw an Invalid Module Specifier error. - // 7. Return the URL resolution of resolvedTarget with every instance of "*" replaced with patternMatch. - let value = self.cache.value(&resolved_target); - return Ok(Some(value)); - } - // 2. Otherwise, if target is a non-null Object, then - JSONValue::Object(target) => { - // 1. If exports contains any index property keys, as defined in ECMA-262 6.1.7 Array Index, throw an Invalid Package Configuration error. - // 2. For each property p of target, in object insertion order as, - for (key, target_value) in target { - // 1. If p equals "default" or conditions contains an entry for p, then - if key == "default" || conditions.contains(key) { - // 1. Let targetValue be the value of the p property in target. - // 2. Let resolved be the result of PACKAGE_TARGET_RESOLVE( packageURL, targetValue, patternMatch, isImports, conditions). - let resolved = self.package_target_resolve( - package_url, - target_key, - target_value, - pattern_match, - is_imports, - conditions, - ctx, - ); - // 3. If resolved is equal to undefined, continue the loop. - if let Some(path) = resolved? { - // 4. Return resolved. - return Ok(Some(path)); - } - } - } - // 3. Return undefined. - return Ok(None); - } - // 3. Otherwise, if target is an Array, then - JSONValue::Array(targets) => { - // 1. If _target.length is zero, return null. - if targets.is_empty() { - // Note: return PackagePathNotExported has the same effect as return because there are no matches. - return Err(ResolveError::PackagePathNotExported( - pattern_match.unwrap_or(".").to_string(), - package_url.join("package.json"), - )); - } - // 2. For each item targetValue in target, do - for (i, target_value) in targets.iter().enumerate() { - // 1. Let resolved be the result of PACKAGE_TARGET_RESOLVE( packageURL, targetValue, patternMatch, isImports, conditions), continuing the loop on any Invalid Package Target error. - let resolved = self.package_target_resolve( - package_url, - target_key, - target_value, - pattern_match, - is_imports, - conditions, - ctx, - ); - - if resolved.is_err() && i == targets.len() { - return resolved; - } - - // 2. If resolved is undefined, continue the loop. - if let Ok(Some(path)) = resolved { - // 3. Return resolved. - return Ok(Some(path)); - } - } - // 3. Return or throw the last fallback resolution null return or error. - // Note: see `resolved.is_err() && i == targets.len()` - } - _ => {} - } - // 4. Otherwise, if target is null, return null. - Ok(None) - // 5. Otherwise throw an Invalid Package Target error. - } - - // Returns (module, subpath) - // https://github.com/nodejs/node/blob/8f0f17e1e3b6c4e58ce748e06343c5304062c491/lib/internal/modules/esm/resolve.js#L688 - fn parse_package_specifier(specifier: &str) -> (&str, &str) { - let mut separator_index = specifier.as_bytes().iter().position(|b| *b == b'/'); - // let mut valid_package_name = true; - // let mut is_scoped = false; - if specifier.starts_with('@') { - // is_scoped = true; - if separator_index.is_none() || specifier.is_empty() { - // valid_package_name = false; - } else if let Some(index) = &separator_index { - separator_index = specifier[*index + 1..] - .as_bytes() - .iter() - .position(|b| *b == b'/') - .map(|i| i + *index + 1); - } - } - let package_name = - separator_index.map_or(specifier, |separator_index| &specifier[..separator_index]); - - // TODO: https://github.com/nodejs/node/blob/8f0f17e1e3b6c4e58ce748e06343c5304062c491/lib/internal/modules/esm/resolve.js#L705C1-L714C1 - // Package name cannot have leading . and cannot have percent-encoding or - // \\ separators. - // if (RegExpPrototypeExec(invalidPackageNameRegEx, packageName) !== null) - // validPackageName = false; - - // if (!validPackageName) { - // throw new ERR_INVALID_MODULE_SPECIFIER( - // specifier, 'is not a valid package name', fileURLToPath(base)); - // } - let package_subpath = - separator_index.map_or("", |separator_index| &specifier[separator_index..]); - (package_name, package_subpath) - } - - /// PATTERN_KEY_COMPARE(keyA, keyB) - fn pattern_key_compare(key_a: &str, key_b: &str) -> Ordering { - if key_a.is_empty() { - return Ordering::Greater; - } - // 1. Assert: keyA ends with "/" or contains only a single "*". - debug_assert!(key_a.ends_with('/') || key_a.match_indices('*').count() == 1, "{key_a}"); - // 2. Assert: keyB ends with "/" or contains only a single "*". - debug_assert!(key_b.ends_with('/') || key_b.match_indices('*').count() == 1, "{key_b}"); - // 3. Let baseLengthA be the index of "*" in keyA plus one, if keyA contains "*", or the length of keyA otherwise. - let a_pos = key_a.chars().position(|c| c == '*'); - let base_length_a = a_pos.map_or(key_a.len(), |p| p + 1); - // 4. Let baseLengthB be the index of "*" in keyB plus one, if keyB contains "*", or the length of keyB otherwise. - let b_pos = key_b.chars().position(|c| c == '*'); - let base_length_b = b_pos.map_or(key_b.len(), |p| p + 1); - // 5. If baseLengthA is greater than baseLengthB, return -1. - if base_length_a > base_length_b { - return Ordering::Less; - } - // 6. If baseLengthB is greater than baseLengthA, return 1. - if base_length_b > base_length_a { - return Ordering::Greater; - } - // 7. If keyA does not contain "*", return 1. - if !key_a.contains('*') { - return Ordering::Greater; - } - // 8. If keyB does not contain "*", return -1. - if !key_b.contains('*') { - return Ordering::Less; - } - // 9. If the length of keyA is greater than the length of keyB, return -1. - if key_a.len() > key_b.len() { - return Ordering::Less; - } - // 10. If the length of keyB is greater than the length of keyA, return 1. - if key_b.len() > key_a.len() { - return Ordering::Greater; - } - // 11. Return 0. - Ordering::Equal - } - - fn strip_package_name<'a>(specifier: &'a str, package_name: &'a str) -> Option<&'a str> { - specifier - .strip_prefix(package_name) - .filter(|tail| tail.is_empty() || tail.starts_with(SLASH_START)) - } -} diff --git a/src/options.rs b/src/options.rs deleted file mode 100644 index f473a133..00000000 --- a/src/options.rs +++ /dev/null @@ -1,623 +0,0 @@ -use std::path::Path; -use std::{fmt, path::PathBuf}; - -/// Module Resolution Options -/// -/// Options are directly ported from [enhanced-resolve](https://github.com/webpack/enhanced-resolve#resolver-options). -/// -/// See [webpack resolve](https://webpack.js.org/configuration/resolve/) for information and examples -#[derive(Debug, Clone)] -pub struct ResolveOptions { - /// Path to TypeScript configuration file. - /// - /// Default `None` - pub tsconfig: Option, - - /// Create aliases to import or require certain modules more easily. - /// - /// An alias is used to replace a whole path or part of a path. - /// For example, to alias a commonly used `src/` folders: `vec![("@/src"), vec![AliasValue::Path("/path/to/src")]]` - /// - /// A trailing $ can also be added to the given object's keys to signify an exact match. - /// - /// See [webpack's `resolve.alias` documentation](https://webpack.js.org/configuration/resolve/#resolvealias) for a list of use cases. - pub alias: Alias, - - /// A list of alias fields in description files. - /// - /// Specify a field, such as `browser`, to be parsed according to [this specification](https://github.com/defunctzombie/package-browser-field-spec). - /// Can be a path to json object such as `["path", "to", "exports"]`. - /// - /// Default `[]` - pub alias_fields: Vec>, - - /// Condition names for exports field which defines entry points of a package. - /// - /// The key order in the exports field is significant. During condition matching, earlier entries have higher priority and take precedence over later entries. - /// - /// Default `[]` - pub condition_names: Vec, - - /// The JSON files to use for descriptions. (There was once a `bower.json`.) - /// - /// Default `["package.json"]` - pub description_files: Vec, - - /// Set to [EnforceExtension::Enabled] for [ESM Mandatory file extensions](https://nodejs.org/api/esm.html#mandatory-file-extensions). - /// - /// If `enforce_extension` is set to [EnforceExtension::Enabled], resolution will not allow extension-less files. - /// This means `require('./foo.js')` will resolve, while `require('./foo')` will not. - /// - /// The default value for `enforce_extension` is [EnforceExtension::Auto], which is changed upon initialization. - /// - /// It changes to [EnforceExtension::Enabled] if [ResolveOptions::extensions] contains an empty string; - /// otherwise, this value changes to [EnforceExtension::Disabled]. - /// - /// Explicitly set the value to [EnforceExtension::Disabled] to disable this automatic behavior. - /// - /// For reference, this behavior is aligned with `enhanced-resolve`. See . - pub enforce_extension: EnforceExtension, - - /// A list of exports fields in description files. - /// - /// Can be a path to a JSON object such as `["path", "to", "exports"]`. - /// - /// Default `[["exports"]]`. - pub exports_fields: Vec>, - - /// Fields from `package.json` which are used to provide the internal requests of a package - /// (requests starting with # are considered internal). - /// - /// Can be a path to a JSON object such as `["path", "to", "imports"]`. - /// - /// Default `[["imports"]]`. - pub imports_fields: Vec>, - - /// An object which maps extension to extension aliases. - /// - /// Default `{}` - pub extension_alias: Vec<(String, Vec)>, - - /// Attempt to resolve these extensions in order. - /// - /// If multiple files share the same name but have different extensions, - /// will resolve the one with the extension listed first in the array and skip the rest. - /// - /// All extensions must have a leading dot. - /// - /// Default `[".js", ".json", ".node"]` - pub extensions: Vec, - - /// Redirect module requests when normal resolving fails. - /// - /// Default `[]` - pub fallback: Alias, - - /// 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). - /// - /// See also webpack configuration [resolve.fullySpecified](https://webpack.js.org/configuration/module/#resolvefullyspecified) - /// - /// Default `false` - pub fully_specified: bool, - - /// A list of main fields in description files - /// - /// Default `["main"]`. - pub main_fields: Vec, - - /// The filename to be used while resolving directories. - /// - /// Default `["index"]` - pub main_files: Vec, - - /// A list of directories to resolve modules from, can be absolute path or folder name. - /// - /// Default `["node_modules"]` - pub modules: Vec, - - /// Resolve to a context instead of a file. - /// - /// Default `false` - pub resolve_to_context: bool, - - /// Prefer to resolve module requests as relative requests instead of using modules from node_modules directories. - /// - /// Default `false` - pub prefer_relative: bool, - - /// Prefer to resolve server-relative urls as absolute paths before falling back to resolve in ResolveOptions::roots. - /// - /// Default `false` - pub prefer_absolute: bool, - - /// A list of resolve restrictions to restrict the paths that a request can be resolved on. - /// - /// Default `[]` - pub restrictions: Vec, - - /// A list of directories where requests of server-relative URLs (starting with '/') are resolved. - /// On non-Windows systems these requests are resolved as an absolute path first. - /// - /// Default `[]` - pub roots: Vec, - - /// Whether to resolve symlinks to their symlinked location. - /// When enabled, symlinked resources are resolved to their real path, not their symlinked location. - /// Note that this may cause module resolution to fail when using tools that symlink packages (like npm link). - /// - /// Default `true` - pub symlinks: bool, - - /// Whether to parse [module.builtinModules](https://nodejs.org/api/module.html#modulebuiltinmodules) or not. - /// For example, "zlib" will throw [crate::ResolveError::Builtin] when set to true. - /// - /// Default `false` - pub builtin_modules: bool, -} - -impl ResolveOptions { - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// - /// let options = ResolveOptions::default().with_condition_names(&["bar"]); - /// assert_eq!(options.condition_names, vec!["bar".to_string()]) - /// ``` - #[must_use] - pub fn with_condition_names(mut self, names: &[&str]) -> Self { - self.condition_names = names.iter().map(ToString::to_string).collect::>(); - self - } - - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// - /// let options = ResolveOptions::default().with_builtin_modules(false); - /// assert_eq!(options.builtin_modules, false) - /// ``` - #[must_use] - pub fn with_builtin_modules(mut self, flag: bool) -> Self { - self.builtin_modules = flag; - self - } - - /// Adds a single root to the options - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_root("foo"); - /// assert_eq!(options.roots, vec![PathBuf::from("foo")]) - /// ``` - #[must_use] - pub fn with_root>(mut self, root: P) -> Self { - self.roots.push(root.as_ref().to_path_buf()); - self - } - - /// Adds a single extension to the list of extensions - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_extension("jsonc"); - /// assert!(options.extensions.contains(&"jsonc".to_string())); - /// ``` - #[must_use] - pub fn with_extension>(mut self, extension: S) -> Self { - self.extensions.push(extension.into()); - self - } - - /// Adds a single main field to the list of fields - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_main_field("something"); - /// assert!(options.main_fields.contains(&"something".to_string())); - /// ``` - #[must_use] - pub fn with_main_field>(mut self, field: S) -> Self { - self.main_fields.push(field.into()); - self - } - - /// Changes how the extension should be treated - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions, EnforceExtension}; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_force_extension(EnforceExtension::Enabled); - /// assert_eq!(options.enforce_extension, EnforceExtension::Enabled); - /// ``` - #[must_use] - pub fn with_force_extension(mut self, enforce_extension: EnforceExtension) -> Self { - self.enforce_extension = enforce_extension; - self - } - - /// Sets the value for [ResolveOptions::fully_specified] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_fully_specified(true); - /// assert_eq!(options.fully_specified, true); - /// ``` - #[must_use] - pub fn with_fully_specified(mut self, fully_specified: bool) -> Self { - self.fully_specified = fully_specified; - self - } - /// Sets the value for [ResolveOptions::prefer_relative] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_prefer_relative(true); - /// assert_eq!(options.prefer_relative, true); - /// ``` - #[must_use] - pub fn with_prefer_relative(mut self, flag: bool) -> Self { - self.prefer_relative = flag; - self - } - /// Sets the value for [ResolveOptions::prefer_absolute] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_prefer_absolute(true); - /// assert_eq!(options.prefer_absolute, true); - /// ``` - #[must_use] - pub fn with_prefer_absolute(mut self, flag: bool) -> Self { - self.prefer_absolute = flag; - self - } - - /// Changes the value of [ResolveOptions::symlinks] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// - /// let options = ResolveOptions::default().with_symbolic_link(false); - /// assert_eq!(options.symlinks, false); - /// ``` - #[must_use] - pub fn with_symbolic_link(mut self, flag: bool) -> Self { - self.symlinks = flag; - self - } - - /// Adds a module to [ResolveOptions::modules] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// - /// let options = ResolveOptions::default().with_module("module"); - /// assert!(options.modules.contains(&"module".to_string())); - /// ``` - #[must_use] - pub fn with_module>(mut self, module: M) -> Self { - self.modules.push(module.into()); - self - } - - /// Adds a main file to [ResolveOptions::main_files] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// - /// let options = ResolveOptions::default().with_main_file("foo"); - /// assert!(options.main_files.contains(&"foo".to_string())); - /// ``` - #[must_use] - pub fn with_main_file>(mut self, module: M) -> Self { - self.main_files.push(module.into()); - self - } - - pub(crate) fn sanitize(mut self) -> Self { - debug_assert!( - self.extensions.iter().filter(|e| !e.is_empty()).all(|e| e.starts_with('.')), - "All extensions must start with a leading dot" - ); - // Set `enforceExtension` to `true` when [ResolveOptions::extensions] contains an empty string. - // See - if self.enforce_extension == EnforceExtension::Auto { - if !self.extensions.is_empty() && self.extensions.iter().any(String::is_empty) { - self.enforce_extension = EnforceExtension::Enabled; - } else { - self.enforce_extension = EnforceExtension::Disabled; - } - } - self - } -} - -/// Value for [ResolveOptions::enforce_extension] -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -pub enum EnforceExtension { - Auto, - Enabled, - Disabled, -} - -impl EnforceExtension { - pub const fn is_auto(&self) -> bool { - matches!(self, Self::Auto) - } - - pub const fn is_enabled(&self) -> bool { - matches!(self, Self::Enabled) - } - - pub const fn is_disabled(&self) -> bool { - matches!(self, Self::Disabled) - } -} - -/// Alias for [ResolveOptions::alias] and [ResolveOptions::fallback] -pub type Alias = Vec<(String, Vec)>; - -/// Alias Value for [ResolveOptions::alias] and [ResolveOptions::fallback] -#[derive(Debug, Clone, Hash, PartialEq, Eq)] -pub enum AliasValue { - /// The path value - Path(String), - - /// The `false` value - Ignore, -} - -impl From for AliasValue -where - S: Into, -{ - fn from(value: S) -> Self { - Self::Path(value.into()) - } -} - -/// Value for [ResolveOptions::restrictions] -#[derive(Debug, Clone)] -pub enum Restriction { - Path(PathBuf), - RegExp(String), -} - -/// Tsconfig Options for [ResolveOptions::tsconfig] -/// -/// Derived from [tsconfig-paths-webpack-plugin](https://github.com/dividab/tsconfig-paths-webpack-plugin#options) -#[derive(Debug, Clone)] -pub struct TsconfigOptions { - /// Allows you to specify where to find the TypeScript configuration file. - /// You may provide - /// * a relative path to the configuration file. It will be resolved relative to cwd. - /// * an absolute path to the configuration file. - pub config_file: PathBuf, - - /// Support for Typescript Project References. - pub references: TsconfigReferences, -} - -/// Configuration for [TsconfigOptions::references] -#[derive(Debug, Clone)] -pub enum TsconfigReferences { - Disabled, - /// Use the `references` field from tsconfig of `config_file`. - Auto, - /// Manually provided relative or absolute path. - Paths(Vec), -} - -impl Default for ResolveOptions { - fn default() -> Self { - Self { - tsconfig: None, - alias: vec![], - alias_fields: vec![], - condition_names: vec![], - description_files: vec!["package.json".into()], - enforce_extension: EnforceExtension::Auto, - extension_alias: vec![], - exports_fields: vec![vec!["exports".into()]], - imports_fields: vec![vec!["imports".into()]], - extensions: vec![".js".into(), ".json".into(), ".node".into()], - fallback: vec![], - fully_specified: false, - main_fields: vec!["main".into()], - main_files: vec!["index".into()], - modules: vec!["node_modules".into()], - resolve_to_context: false, - prefer_relative: false, - prefer_absolute: false, - restrictions: vec![], - roots: vec![], - symlinks: true, - builtin_modules: false, - } - } -} - -// For tracing -impl fmt::Display for ResolveOptions { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - if let Some(tsconfig) = &self.tsconfig { - write!(f, "tsconfig:{tsconfig:?},")?; - } - if !self.alias.is_empty() { - write!(f, "alias:{:?},", self.alias)?; - } - if !self.alias_fields.is_empty() { - write!(f, "alias_fields:{:?},", self.alias_fields)?; - } - if !self.condition_names.is_empty() { - write!(f, "condition_names:{:?},", self.condition_names)?; - } - if self.enforce_extension.is_enabled() { - write!(f, "enforce_extension:{:?},", self.enforce_extension)?; - } - if !self.exports_fields.is_empty() { - write!(f, "exports_fields:{:?},", self.exports_fields)?; - } - if !self.imports_fields.is_empty() { - write!(f, "imports_fields:{:?},", self.imports_fields)?; - } - if !self.extension_alias.is_empty() { - write!(f, "extension_alias:{:?},", self.extension_alias)?; - } - if !self.extensions.is_empty() { - write!(f, "extensions:{:?},", self.extensions)?; - } - if !self.fallback.is_empty() { - write!(f, "fallback:{:?},", self.fallback)?; - } - if self.fully_specified { - write!(f, "fully_specified:{:?},", self.fully_specified)?; - } - if !self.main_fields.is_empty() { - write!(f, "main_fields:{:?},", self.main_fields)?; - } - if !self.main_files.is_empty() { - write!(f, "main_files:{:?},", self.main_files)?; - } - if !self.modules.is_empty() { - write!(f, "modules:{:?},", self.modules)?; - } - if self.resolve_to_context { - write!(f, "resolve_to_context:{:?},", self.resolve_to_context)?; - } - if self.prefer_relative { - write!(f, "prefer_relative:{:?},", self.prefer_relative)?; - } - if self.prefer_absolute { - write!(f, "prefer_absolute:{:?},", self.prefer_absolute)?; - } - if !self.restrictions.is_empty() { - write!(f, "restrictions:{:?},", self.restrictions)?; - } - if !self.roots.is_empty() { - write!(f, "roots:{:?},", self.roots)?; - } - if self.symlinks { - write!(f, "symlinks:{:?},", self.symlinks)?; - } - if self.builtin_modules { - write!(f, "builtin_modules:{:?},", self.builtin_modules)?; - } - Ok(()) - } -} - -#[cfg(test)] -mod test { - use super::{ - AliasValue, EnforceExtension, ResolveOptions, Restriction, TsconfigOptions, - TsconfigReferences, - }; - use std::path::PathBuf; - - #[test] - fn enforce_extension() { - assert!(EnforceExtension::Auto.is_auto()); - assert!(!EnforceExtension::Enabled.is_auto()); - assert!(!EnforceExtension::Disabled.is_auto()); - - assert!(!EnforceExtension::Auto.is_enabled()); - assert!(EnforceExtension::Enabled.is_enabled()); - assert!(!EnforceExtension::Disabled.is_enabled()); - - assert!(!EnforceExtension::Auto.is_disabled()); - assert!(!EnforceExtension::Enabled.is_disabled()); - assert!(EnforceExtension::Disabled.is_disabled()); - } - - #[test] - fn display() { - let options = ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: PathBuf::from("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - alias: vec![("a".into(), vec![AliasValue::Ignore])], - alias_fields: vec![vec!["browser".into()]], - condition_names: vec!["require".into()], - enforce_extension: EnforceExtension::Enabled, - extension_alias: vec![(".js".into(), vec![".ts".into()])], - exports_fields: vec![vec!["exports".into()]], - imports_fields: vec![vec!["imports".into()]], - fallback: vec![("fallback".into(), vec![AliasValue::Ignore])], - fully_specified: true, - resolve_to_context: true, - prefer_relative: true, - prefer_absolute: true, - restrictions: vec![Restriction::Path(PathBuf::from("restrictions"))], - roots: vec![PathBuf::from("roots")], - builtin_modules: true, - ..ResolveOptions::default() - }; - - let expected = r#"tsconfig:TsconfigOptions { config_file: "tsconfig.json", references: Auto },alias:[("a", [Ignore])],alias_fields:[["browser"]],condition_names:["require"],enforce_extension:Enabled,exports_fields:[["exports"]],imports_fields:[["imports"]],extension_alias:[(".js", [".ts"])],extensions:[".js", ".json", ".node"],fallback:[("fallback", [Ignore])],fully_specified:true,main_fields:["main"],main_files:["index"],modules:["node_modules"],resolve_to_context:true,prefer_relative:true,prefer_absolute:true,restrictions:[Path("restrictions")],roots:["roots"],symlinks:true,builtin_modules:true,"#; - assert_eq!(format!("{options}"), expected); - - let options = ResolveOptions { - alias: vec![], - alias_fields: vec![], - builtin_modules: false, - condition_names: vec![], - description_files: vec![], - enforce_extension: EnforceExtension::Disabled, - exports_fields: vec![], - extension_alias: vec![], - extensions: vec![], - fallback: vec![], - fully_specified: false, - imports_fields: vec![], - main_fields: vec![], - main_files: vec![], - modules: vec![], - prefer_absolute: false, - prefer_relative: false, - resolve_to_context: false, - restrictions: vec![], - roots: vec![], - symlinks: false, - tsconfig: None, - }; - - assert_eq!(format!("{options}"), ""); - } -} diff --git a/src/package_json.rs b/src/package_json.rs deleted file mode 100644 index 73901faa..00000000 --- a/src/package_json.rs +++ /dev/null @@ -1,207 +0,0 @@ -//! package.json definitions -//! -//! Code related to export field are copied from [Parcel's resolver](https://github.com/parcel-bundler/parcel/blob/v2/packages/utils/node-resolver-rs/src/package_json.rs) -use std::path::{Path, PathBuf}; - -use serde_json::Value as JSONValue; - -use crate::{path::PathUtil, ResolveError}; - -pub type JSONMap = serde_json::Map; - -/// Deserialized package.json -#[derive(Debug, Default)] -pub struct PackageJson { - /// Path to `package.json`. Contains the `package.json` filename. - pub path: PathBuf, - - /// Realpath to `package.json`. Contains the `package.json` filename. - pub realpath: PathBuf, - - /// The "name" field defines your package's name. - /// The "name" field can be used in addition to the "exports" field to self-reference a package using its name. - /// - /// - pub name: Option, - - raw_json: std::sync::Arc, -} - -impl PackageJson { - /// # Panics - /// # Errors - pub(crate) fn parse( - path: PathBuf, - realpath: PathBuf, - json: &str, - ) -> Result { - let mut raw_json: JSONValue = serde_json::from_str(json)?; - let mut package_json = Self::default(); - - if let Some(json_object) = raw_json.as_object_mut() { - // Remove large fields that are useless for pragmatic use. - #[cfg(feature = "package_json_raw_json_api")] - { - json_object.remove("description"); - json_object.remove("keywords"); - json_object.remove("scripts"); - json_object.remove("dependencies"); - json_object.remove("devDependencies"); - json_object.remove("peerDependencies"); - json_object.remove("optionalDependencies"); - } - - // Add name. - package_json.name = - json_object.get("name").and_then(|field| field.as_str()).map(ToString::to_string); - } - - package_json.path = path; - package_json.realpath = realpath; - package_json.raw_json = std::sync::Arc::new(raw_json); - Ok(package_json) - } - - fn get_value_by_path<'a>( - fields: &'a serde_json::Map, - path: &[String], - ) -> Option<&'a JSONValue> { - if path.is_empty() { - return None; - } - let mut value = fields.get(&path[0])?; - for key in path.iter().skip(1) { - if let Some(inner_value) = value.as_object().and_then(|o| o.get(key)) { - value = inner_value; - } else { - return None; - } - } - Some(value) - } - - /// Raw serde json value of `package.json`. - /// - /// This is currently used in Rspack for: - /// * getting the `sideEffects` field - /// * query in - search on GitHub indicates query on the `type` field. - /// - /// To reduce overall memory consumption, large fields that useless for pragmatic use are removed. - /// They are: `description`, `keywords`, `scripts`, - /// `dependencies` and `devDependencies`, `peerDependencies`, `optionalDependencies`. - #[cfg(feature = "package_json_raw_json_api")] - pub fn raw_json(&self) -> &std::sync::Arc { - &self.raw_json - } - - /// Directory to `package.json` - /// - /// # Panics - /// - /// * When the package.json path is misconfigured. - pub fn directory(&self) -> &Path { - debug_assert!(self.realpath.file_name().is_some_and(|x| x == "package.json")); - self.realpath.parent().unwrap() - } - - /// The "main" field defines the entry point of a package when imported by name via a node_modules lookup. Its value is a path. - /// - /// When a package has an "exports" field, this will take precedence over the "main" field when importing the package by name. - /// - /// Values are dynamically retrieved from [ResolveOptions::main_fields]. - /// - /// - pub(crate) fn main_fields<'a>( - &'a self, - main_fields: &'a [String], - ) -> impl Iterator + '_ { - main_fields - .iter() - .filter_map(|main_field| self.raw_json.get(main_field)) - .filter_map(|value| value.as_str()) - } - - /// The "exports" field allows defining the entry points of a package when imported by name loaded either via a node_modules lookup or a self-reference to its own name. - /// - /// - pub(crate) fn exports_fields<'a>( - &'a self, - exports_fields: &'a [Vec], - ) -> impl Iterator + '_ { - exports_fields.iter().filter_map(|object_path| { - self.raw_json - .as_object() - .and_then(|json_object| Self::get_value_by_path(json_object, object_path)) - }) - } - - /// In addition to the "exports" field, there is a package "imports" field to create private mappings that only apply to import specifiers from within the package itself. - /// - /// - pub(crate) fn imports_fields<'a>( - &'a self, - imports_fields: &'a [Vec], - ) -> impl Iterator + '_ { - imports_fields.iter().filter_map(|object_path| { - self.raw_json - .as_object() - .and_then(|json_object| Self::get_value_by_path(json_object, object_path)) - .and_then(|value| value.as_object()) - }) - } - - /// The "browser" field is provided by a module author as a hint to javascript bundlers or component tools when packaging modules for client side use. - /// Multiple values are configured by [ResolveOptions::alias_fields]. - /// - /// - fn browser_fields<'a>( - &'a self, - alias_fields: &'a [Vec], - ) -> impl Iterator + '_ { - alias_fields.iter().filter_map(|object_path| { - self.raw_json - .as_object() - .and_then(|json_object| Self::get_value_by_path(json_object, object_path)) - // Only object is valid, all other types are invalid - // https://github.com/webpack/enhanced-resolve/blob/3a28f47788de794d9da4d1702a3a583d8422cd48/lib/AliasFieldPlugin.js#L44-L52 - .and_then(|value| value.as_object()) - }) - } - - /// Resolve the request string for this package.json by looking at the `browser` field. - /// - /// # Errors - /// - /// * Returns [ResolveError::Ignored] for `"path": false` in `browser` field. - pub(crate) fn resolve_browser_field<'a>( - &'a self, - path: &Path, - request: Option<&str>, - alias_fields: &'a [Vec], - ) -> Result, ResolveError> { - for object in self.browser_fields(alias_fields) { - if let Some(request) = request { - if let Some(value) = object.get(request) { - return Self::alias_value(path, value); - } - } else { - let dir = self.path.parent().unwrap(); - for (key, value) in object { - let joined = dir.normalize_with(key); - if joined == path { - return Self::alias_value(path, value); - } - } - } - } - Ok(None) - } - - fn alias_value<'a>(key: &Path, value: &'a JSONValue) -> Result, ResolveError> { - match value { - JSONValue::String(value) => Ok(Some(value.as_str())), - JSONValue::Bool(b) if !b => Err(ResolveError::Ignored(key.to_path_buf())), - _ => Ok(None), - } - } -} diff --git a/src/path.rs b/src/path.rs deleted file mode 100644 index f66fdd76..00000000 --- a/src/path.rs +++ /dev/null @@ -1,132 +0,0 @@ -//! Path Utilities -//! -//! Code adapted from the following libraries -//! * [path-absolutize](https://docs.rs/path-absolutize) -//! * [normalize_path](https://docs.rs/normalize-path) -use std::path::{Component, Path, PathBuf}; - -pub const SLASH_START: &[char; 2] = &['/', '\\']; - -/// Extension trait to add path normalization to std's [`Path`]. -pub trait PathUtil { - /// Normalize this path without performing I/O. - /// - /// All redundant separator and up-level references are collapsed. - /// - /// However, this does not resolve links. - fn normalize(&self) -> PathBuf; - - /// Normalize with subpath assuming this path is normalized without performing I/O. - /// - /// All redundant separator and up-level references are collapsed. - /// - /// However, this does not resolve links. - fn normalize_with>(&self, subpath: P) -> PathBuf; - - /// Defined in ESM PACKAGE_TARGET_RESOLVE - /// If target split on "/" or "\" contains any "", ".", "..", or "node_modules" segments after the first "." segment, case insensitive and including percent encoded variants - fn is_invalid_exports_target(&self) -> bool; -} - -impl PathUtil for Path { - // https://github.com/parcel-bundler/parcel/blob/e0b99c2a42e9109a9ecbd6f537844a1b33e7faf5/packages/utils/node-resolver-rs/src/path.rs#L7 - fn normalize(&self) -> PathBuf { - let mut components = self.components().peekable(); - let mut ret = if let Some(c @ Component::Prefix(..)) = components.peek() { - let buf = PathBuf::from(c.as_os_str()); - components.next(); - buf - } else { - PathBuf::new() - }; - - for component in components { - match component { - Component::Prefix(..) => unreachable!("Path {:?}", self), - Component::RootDir => { - ret.push(component.as_os_str()); - } - Component::CurDir => {} - Component::ParentDir => { - ret.pop(); - } - Component::Normal(c) => { - ret.push(c); - } - } - } - - ret - } - - // https://github.com/parcel-bundler/parcel/blob/e0b99c2a42e9109a9ecbd6f537844a1b33e7faf5/packages/utils/node-resolver-rs/src/path.rs#L37 - fn normalize_with>(&self, subpath: B) -> PathBuf { - let subpath = subpath.as_ref(); - - let mut components = subpath.components(); - - let Some(head) = components.next() else { return subpath.to_path_buf() }; - - if matches!(head, Component::Prefix(..) | Component::RootDir) { - return subpath.to_path_buf(); - } - - let mut ret = self.to_path_buf(); - for component in std::iter::once(head).chain(components) { - match component { - Component::CurDir => {} - Component::ParentDir => { - ret.pop(); - } - Component::Normal(c) => { - ret.push(c); - } - Component::Prefix(..) | Component::RootDir => { - unreachable!("Path {:?} Subpath {:?}", self, subpath) - } - } - } - - ret - } - - fn is_invalid_exports_target(&self) -> bool { - self.components().enumerate().any(|(index, c)| match c { - Component::ParentDir => true, - Component::CurDir => index > 0, - Component::Normal(c) => c.eq_ignore_ascii_case("node_modules"), - _ => false, - }) - } -} - -// https://github.com/webpack/enhanced-resolve/blob/main/test/path.test.js -#[test] -fn is_invalid_exports_target() { - let test_cases = [ - "../a.js", - "../", - "./a/b/../../../c.js", - "./a/b/../../../", - "./../../c.js", - "./../../", - "./a/../b/../../c.js", - "./a/../b/../../", - "./././../", - ]; - - for case in test_cases { - assert!(Path::new(case).is_invalid_exports_target(), "{case}"); - } - - assert!(!Path::new("C:").is_invalid_exports_target()); - assert!(!Path::new("/").is_invalid_exports_target()); -} - -#[test] -fn normalize() { - assert_eq!(Path::new("/foo/.././foo/").normalize(), Path::new("/foo")); - assert_eq!(Path::new("C://").normalize(), Path::new("C://")); - assert_eq!(Path::new("C:").normalize(), Path::new("C:")); - assert_eq!(Path::new(r"\\server\share").normalize(), Path::new(r"\\server\share")); -} diff --git a/src/resolution.rs b/src/resolution.rs deleted file mode 100644 index a3aaa2e7..00000000 --- a/src/resolution.rs +++ /dev/null @@ -1,92 +0,0 @@ -use crate::package_json::PackageJson; -use std::{ - fmt, - path::{Path, PathBuf}, - sync::Arc, -}; - -/// The final path resolution with optional `?query` and `#fragment` -#[derive(Clone)] -pub struct Resolution { - pub(crate) path: PathBuf, - - /// path query `?query`, contains `?`. - pub(crate) query: Option, - - /// path fragment `#query`, contains `#`. - pub(crate) fragment: Option, - - pub(crate) package_json: Option>, -} - -impl fmt::Debug for Resolution { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - f.debug_struct("Resolution") - .field("path", &self.path) - .field("query", &self.query) - .field("fragment", &self.fragment) - .field("package_json", &self.package_json.as_ref().map(|p| &p.path)) - .finish() - } -} - -impl PartialEq for Resolution { - fn eq(&self, other: &Self) -> bool { - self.path == other.path && self.query == other.query && self.fragment == other.fragment - } -} -impl Eq for Resolution {} - -impl Resolution { - /// Returns the path without query and fragment - pub fn path(&self) -> &Path { - &self.path - } - - /// Returns the path without query and fragment - pub fn into_path_buf(self) -> PathBuf { - self.path - } - - /// Returns the path query `?query`, contains the leading `?` - pub fn query(&self) -> Option<&str> { - self.query.as_deref() - } - - /// Returns the path fragment `#fragment`, contains the leading `#` - pub fn fragment(&self) -> Option<&str> { - self.fragment.as_deref() - } - - /// Returns serialized package_json - pub fn package_json(&self) -> Option<&Arc> { - self.package_json.as_ref() - } - - /// Returns the full path with query and fragment - pub fn full_path(&self) -> PathBuf { - let mut path = self.path.clone().into_os_string(); - if let Some(query) = &self.query { - path.push(query); - } - if let Some(fragment) = &self.fragment { - path.push(fragment); - } - PathBuf::from(path) - } -} - -#[test] -fn test() { - let resolution = Resolution { - path: PathBuf::from("foo"), - query: Some("?query".to_string()), - fragment: Some("#fragment".to_string()), - package_json: None, - }; - assert_eq!(resolution.path(), Path::new("foo")); - assert_eq!(resolution.query(), Some("?query")); - assert_eq!(resolution.fragment(), Some("#fragment")); - assert_eq!(resolution.full_path(), PathBuf::from("foo?query#fragment")); - assert_eq!(resolution.into_path_buf(), PathBuf::from("foo")); -} diff --git a/src/specifier.rs b/src/specifier.rs deleted file mode 100644 index 3d35eafc..00000000 --- a/src/specifier.rs +++ /dev/null @@ -1,230 +0,0 @@ -use crate::error::SpecifierError; -use std::borrow::Cow; - -#[derive(Debug)] -pub struct Specifier<'a> { - path: Cow<'a, str>, - pub query: Option<&'a str>, - pub fragment: Option<&'a str>, -} - -impl<'a> Specifier<'a> { - pub fn path(&'a self) -> &'a str { - self.path.as_ref() - } - - pub fn parse(specifier: &'a str) -> Result, SpecifierError> { - if specifier.is_empty() { - return Err(SpecifierError::Empty(specifier.to_string())); - } - let offset = match specifier.as_bytes()[0] { - b'/' | b'.' | b'#' => 1, - _ => 0, - }; - let (path, query, fragment) = Self::parse_query_framgment(specifier, offset); - if path.is_empty() { - return Err(SpecifierError::Empty(specifier.to_string())); - } - Ok(Self { path, query, fragment }) - } - - fn parse_query_framgment( - specifier: &'a str, - skip: usize, - ) -> (Cow<'a, str>, Option<&str>, Option<&str>) { - let mut query_start: Option = None; - let mut fragment_start: Option = None; - - let mut prev = specifier.chars().next().unwrap(); - let mut escaped_indexes = vec![]; - for (i, c) in specifier.char_indices().skip(skip) { - if c == '?' && query_start.is_none() { - query_start = Some(i); - } - if c == '#' { - if prev == '\0' { - escaped_indexes.push(i - 1); - } else { - fragment_start = Some(i); - break; - } - } - prev = c; - } - - let (path, query, fragment) = match (query_start, fragment_start) { - (Some(i), Some(j)) => { - debug_assert!(i < j); - (&specifier[..i], Some(&specifier[i..j]), Some(&specifier[j..])) - } - (Some(i), None) => (&specifier[..i], Some(&specifier[i..]), None), - (None, Some(j)) => (&specifier[..j], None, Some(&specifier[j..])), - _ => (specifier, None, None), - }; - - let path = if escaped_indexes.is_empty() { - Cow::Borrowed(path) - } else { - // Remove the `\0` characters for a legal path. - Cow::Owned( - path.chars() - .enumerate() - .filter_map(|(i, c)| (!escaped_indexes.contains(&i)).then_some(c)) - .collect::(), - ) - }; - - (path, query, fragment) - } -} - -#[cfg(test)] -mod tests { - use super::{Specifier, SpecifierError}; - - #[test] - fn debug() { - let specifier = Specifier::parse("/").unwrap(); - assert_eq!( - format!("{specifier:?}"), - r#"Specifier { path: "/", query: None, fragment: None }"# - ); - } - - #[test] - fn empty() { - let specifiers = ["", "?"]; - for specifier in specifiers { - let error = Specifier::parse(specifier).unwrap_err(); - assert_eq!(error, SpecifierError::Empty(specifier.to_string())); - } - } - - #[test] - fn absolute() -> Result<(), SpecifierError> { - let specifier = "/test?#"; - let parsed = Specifier::parse(specifier)?; - assert_eq!(parsed.path, "/test"); - assert_eq!(parsed.query, Some("?")); - assert_eq!(parsed.fragment, Some("#")); - Ok(()) - } - - #[test] - fn relative() -> Result<(), SpecifierError> { - let specifiers = ["./test", "../test", "../../test"]; - for specifier in specifiers { - let mut r = specifier.to_string(); - r.push_str("?#"); - let parsed = Specifier::parse(&r)?; - assert_eq!(parsed.path, specifier); - assert_eq!(parsed.query, Some("?")); - assert_eq!(parsed.fragment, Some("#")); - } - Ok(()) - } - - #[test] - fn hash() -> Result<(), SpecifierError> { - let specifiers = ["#", "#path"]; - for specifier in specifiers { - let mut r = specifier.to_string(); - r.push_str("?#"); - let parsed = Specifier::parse(&r)?; - assert_eq!(parsed.path, specifier); - assert_eq!(parsed.query, Some("?")); - assert_eq!(parsed.fragment, Some("#")); - } - Ok(()) - } - - #[test] - fn module() -> Result<(), SpecifierError> { - let specifiers = ["module"]; - for specifier in specifiers { - let mut r = specifier.to_string(); - r.push_str("?#"); - let parsed = Specifier::parse(&r)?; - assert_eq!(parsed.path, specifier); - assert_eq!(parsed.query, Some("?")); - assert_eq!(parsed.fragment, Some("#")); - } - Ok(()) - } - - #[test] - fn query_fragment() -> Result<(), SpecifierError> { - let data = [ - ("a?", Some("?"), None), - ("a?query", Some("?query"), None), - ("a?query1?query2", Some("?query1?query2"), None), - ("a?query1?query2?query3", Some("?query1?query2?query3"), None), - ("a#", None, Some("#")), - ("a#b#c", None, Some("#b#c")), - ("a#fragment", None, Some("#fragment")), - ("a?#", Some("?"), Some("#")), - ("a?#fragment", Some("?"), Some("#fragment")), - ("a?query#", Some("?query"), Some("#")), - ("a?query#fragment", Some("?query"), Some("#fragment")), - ("a#fragment?", None, Some("#fragment?")), - ("a#fragment?query", None, Some("#fragment?query")), - ]; - - for (specifier_str, query, fragment) in data { - let specifier = Specifier::parse(specifier_str)?; - assert_eq!(specifier.path, "a", "{specifier_str}"); - assert_eq!(specifier.query, query, "{specifier_str}"); - assert_eq!(specifier.fragment, fragment, "{specifier_str}"); - } - - Ok(()) - } - - #[test] - // https://github.com/webpack/enhanced-resolve/blob/main/test/identifier.test.js - fn enhanced_resolve_edge_cases() -> Result<(), SpecifierError> { - let data = [ - ("path/#", "path/", "", "#"), - ("path/as/?", "path/as/", "?", ""), - ("path/#/?", "path/", "", "#/?"), - ("path/#repo#hash", "path/", "", "#repo#hash"), - ("path/#r#hash", "path/", "", "#r#hash"), - ("path/#repo/#repo2#hash", "path/", "", "#repo/#repo2#hash"), - ("path/#r/#r#hash", "path/", "", "#r/#r#hash"), - ("path/#/not/a/hash?not-a-query", "path/", "", "#/not/a/hash?not-a-query"), - ]; - - for (specifier_str, path, query, fragment) in data { - let specifier = Specifier::parse(specifier_str)?; - assert_eq!(specifier.path, path, "{specifier_str}"); - assert_eq!(specifier.query.unwrap_or(""), query, "{specifier_str}"); - assert_eq!(specifier.fragment.unwrap_or(""), fragment, "{specifier_str}"); - } - - Ok(()) - } - - // https://github.com/webpack/enhanced-resolve/blob/main/test/identifier.test.js - #[test] - fn enhanced_resolve_windows_like() -> Result<(), SpecifierError> { - let data = [ - ("path\\#", "path\\", "", "#"), - ("path\\as\\?", "path\\as\\", "?", ""), - ("path\\#\\?", "path\\", "", "#\\?"), - ("path\\#repo#hash", "path\\", "", "#repo#hash"), - ("path\\#r#hash", "path\\", "", "#r#hash"), - ("path\\#repo\\#repo2#hash", "path\\", "", "#repo\\#repo2#hash"), - ("path\\#r\\#r#hash", "path\\", "", "#r\\#r#hash"), - ("path\\#/not/a/hash?not-a-query", "path\\", "", "#/not/a/hash?not-a-query"), - ]; - - for (specifier_str, path, query, fragment) in data { - let specifier = Specifier::parse(specifier_str)?; - assert_eq!(specifier.path, path, "{specifier_str}"); - assert_eq!(specifier.query.unwrap_or(""), query, "{specifier_str}"); - assert_eq!(specifier.fragment.unwrap_or(""), fragment, "{specifier_str}"); - } - - Ok(()) - } -} diff --git a/src/tests/alias.rs b/src/tests/alias.rs deleted file mode 100644 index 07c615f4..00000000 --- a/src/tests/alias.rs +++ /dev/null @@ -1,280 +0,0 @@ -//! - -use normalize_path::NormalizePath; -use std::path::Path; - -use crate::{AliasValue, Resolution, ResolveContext, ResolveError, ResolveOptions, Resolver}; - -#[test] -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -fn alias() { - use super::memory_fs::MemoryFS; - use crate::ResolverGeneric; - use std::path::{Path, PathBuf}; - - let f = Path::new("/"); - - let file_system = MemoryFS::new(&[ - ("/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", ""), - ("/dashed-name", ""), - ]); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - alias: vec![ - ("aliasA".into(), vec![AliasValue::from("a")]), - ("b$".into(), vec![AliasValue::from("a/index")]), - ("c$".into(), vec![AliasValue::from("/a/index")]), - ( - "multiAlias".into(), - vec![ - AliasValue::from("b"), - AliasValue::from("c"), - AliasValue::from("d"), - AliasValue::from("e"), - AliasValue::from("a"), - ], - ), - ("recursive".into(), vec![AliasValue::from("recursive/dir")]), - ("/d/dir".into(), vec![AliasValue::from("/c/dir")]), - ("/d/index.js".into(), vec![AliasValue::from("/c/index")]), - ("#".into(), vec![AliasValue::from("/c/dir")]), - ("@".into(), vec![AliasValue::from("/c/dir")]), - ("ignored".into(), vec![AliasValue::Ignore]), - // not part of enhanced-resolve, added to make sure query in alias value works - ("alias_query".into(), vec![AliasValue::from("a?query_after")]), - ("alias_fragment".into(), vec![AliasValue::from("a#fragment_after")]), - ("dash".into(), vec![AliasValue::Ignore]), - ("@scope/package-name/file$".into(), vec![AliasValue::from("/c/dir")]), - ], - modules: vec!["/".into()], - ..ResolveOptions::default() - }, - ); - - #[rustfmt::skip] - let pass = [ - ("should resolve a not aliased module 1", "a", "/a/index"), - ("should resolve a not aliased module 2", "a/index", "/a/index"), - ("should resolve a not aliased module 3", "a/dir", "/a/dir/index"), - ("should resolve a not aliased module 4", "a/dir/index", "/a/dir/index"), - ("should resolve an aliased module 1", "aliasA", "/a/index"), - ("should resolve an aliased module 2", "aliasA/index", "/a/index"), - ("should resolve an aliased module 3", "aliasA/dir", "/a/dir/index"), - ("should resolve an aliased module 4", "aliasA/dir/index", "/a/dir/index"), - ("should resolve '#' alias 1", "#", "/c/dir/index"), - ("should resolve '#' alias 2", "#/index", "/c/dir/index"), - ("should resolve '@' alias 1", "@", "/c/dir/index"), - ("should resolve '@' alias 2", "@/index", "/c/dir/index"), - ("should resolve a recursive aliased module 1", "recursive", "/recursive/dir/index"), - ("should resolve a recursive aliased module 2", "recursive/index", "/recursive/dir/index"), - ("should resolve a recursive aliased module 3", "recursive/dir", "/recursive/dir/index"), - ("should resolve a recursive aliased module 4", "recursive/dir/index", "/recursive/dir/index"), - ("should resolve a file aliased module 1", "b", "/a/index"), - ("should resolve a file aliased module 2", "c", "/a/index"), - ("should resolve a file aliased module with a query 1", "b?query", "/a/index?query"), - ("should resolve a file aliased module with a query 2", "c?query", "/a/index?query"), - ("should resolve a path in a file aliased module 1", "b/index", "/b/index"), - ("should resolve a path in a file aliased module 2", "b/dir", "/b/dir/index"), - ("should resolve a path in a file aliased module 3", "b/dir/index", "/b/dir/index"), - ("should resolve a path in a file aliased module 4", "c/index", "/c/index"), - ("should resolve a path in a file aliased module 5", "c/dir", "/c/dir/index"), - ("should resolve a path in a file aliased module 6", "c/dir/index", "/c/dir/index"), - ("should resolve a file aliased file 1", "d", "/c/index"), - ("should resolve a file aliased file 2", "d/dir/index", "/c/dir/index"), - ("should resolve a file in multiple aliased dirs 1", "multiAlias/dir/file", "/e/dir/file"), - ("should resolve a file in multiple aliased dirs 2", "multiAlias/anotherDir", "/e/anotherDir/index"), - // not part of enhanced-resolve, added to make sure query in alias value works - ("should resolve query in alias value", "alias_query?query_before", "/a/index?query_after"), - ("should resolve query in alias value", "alias_fragment#fragment_before", "/a/index#fragment_after"), - ("should resolve dashed name", "dashed-name", "/dashed-name"), - ("should resolve scoped package name with sub dir", "@scope/package-name/file", "/c/dir/index"), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - - #[rustfmt::skip] - let ignore = [ - ("should resolve an ignore module", "ignored", ResolveError::Ignored(f.join("ignored"))) - ]; - - for (comment, request, expected) in ignore { - let resolution = resolver.resolve(f, request); - assert_eq!(resolution, Err(expected), "{comment} {request}"); - } -} - -// Not part of enhanced-resolve -#[test] -fn infinite_recursion() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![ - ("./a".into(), vec![AliasValue::from("./b")]), - ("./b".into(), vec![AliasValue::from("./a")]), - ], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(f, "./a"); - assert_eq!(resolution, Err(ResolveError::Recursion)); -} - -fn check_slash(path: &Path) { - let s = path.to_string_lossy().to_string(); - #[cfg(target_os = "windows")] - { - assert!(!s.contains('/'), "{s}"); - assert!(s.contains('\\'), "{s}"); - } - #[cfg(not(target_os = "windows"))] - { - assert!(s.contains('/'), "{s}"); - assert!(!s.contains('\\'), "{s}"); - } -} - -#[test] -fn absolute_path() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![(f.join("foo").to_str().unwrap().to_string(), vec![AliasValue::Ignore])], - modules: vec![f.clone().to_str().unwrap().to_string()], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(&f, "foo/index"); - assert_eq!(resolution, Err(ResolveError::Ignored(f.join("foo")))); -} - -#[test] -fn system_path() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![("@app".into(), vec![AliasValue::from(f.join("alias").to_string_lossy())])], - ..ResolveOptions::default() - }); - - let specifiers = ["@app/files/a", "@app/files/a.js"]; - - for specifier in specifiers { - let path = resolver.resolve(&f, specifier).map(Resolution::into_path_buf).unwrap(); - assert_eq!(path, f.join("alias/files/a.js")); - check_slash(&path); - } -} - -#[test] -fn alias_is_full_path() { - let f = super::fixture(); - let dir = f.join("foo"); - let dir_str = dir.to_string_lossy().to_string(); - - let resolver = Resolver::new(ResolveOptions { - alias: vec![("@".into(), vec![AliasValue::Path(dir_str.clone())])], - ..ResolveOptions::default() - }); - - let mut ctx = ResolveContext::default(); - - let specifiers = [ - "@/index".to_string(), - "@/index.js".to_string(), - // specifier has multiple `/` for reasons we'll never know - "@////index".to_string(), - // specifier is a full path - dir_str, - ]; - - for specifier in specifiers { - let resolution = resolver.resolve_with_context(&f, &specifier, &mut ctx); - assert_eq!(resolution.map(|r| r.full_path()), Ok(dir.join("index.js"))); - } - - for path in ctx.file_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - check_slash(&path); - } - - for path in ctx.missing_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - check_slash(&path); - if let Some(path) = path.parent() { - assert!(!path.is_file(), "{path:?} must not be a file"); - } - } -} - -// For the `should_stop` variable in `load_alias` -#[test] -fn all_alias_values_are_not_found() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![( - "m1".to_string(), - vec![AliasValue::Path(f.join("node_modules").join("m2").to_string_lossy().to_string())], - )], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(&f, "m1/a.js"); - assert_eq!(resolution, Err(ResolveError::NotFound("m1/a.js".to_string()))); -} - -#[test] -fn alias_fragment() { - let f = super::fixture(); - - let data = [ - // enhanced-resolve has `#` prepended with a `\0`, they are removed from the - // following 3 expected test results. - // See https://github.com/webpack/enhanced-resolve#escaping - ( - "handle fragment edge case (no fragment)", - "./no#fragment/#/#", - f.join("no#fragment/#/#.js"), - ), - ("handle fragment edge case (fragment)", "./no#fragment/#/", f.join("no.js#fragment/#/")), - ( - "handle fragment escaping", - "./no\0#fragment/\0#/\0##fragment", - f.join("no#fragment/#/#.js#fragment"), - ), - ]; - - for (comment, request, expected) in data { - let resolver = Resolver::new(ResolveOptions { - alias: vec![("foo".to_string(), vec![AliasValue::Path(request.to_string())])], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f, "foo").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } -} - -#[test] -fn alias_try_fragment_as_path() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![( - "#".to_string(), - vec![AliasValue::Path(f.join("#").to_string_lossy().to_string())], - )], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(&f, "#/a").map(|r| r.full_path()); - assert_eq!(resolution, Ok(f.join("#").join("a.js"))); -} diff --git a/src/tests/browser_field.rs b/src/tests/browser_field.rs deleted file mode 100644 index 171ee099..00000000 --- a/src/tests/browser_field.rs +++ /dev/null @@ -1,189 +0,0 @@ -//! - -use crate::{AliasValue, ResolveError, ResolveOptions, Resolver}; - -#[test] -fn ignore() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![ - vec!["browser".into()], - vec!["innerBrowser1".into()], - vec!["innerBrowser2".into()], - vec![], - ], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - (f.clone(), "./lib/ignore", f.join("lib/ignore.js")), - (f.clone(), "./lib/ignore.js", f.join("lib/ignore.js")), - (f.join("lib"), "./ignore", f.join("lib/ignore.js")), - (f.join("lib"), "./ignore.js", f.join("lib/ignore.js")), - ]; - - for (path, request, expected) in data { - let resolution = resolver.resolve(&path, request); - let expected = ResolveError::Ignored(expected); - assert_eq!(resolution, Err(expected), "{path:?} {request}"); - } -} - -#[test] -fn shared_resolvers() { - let f = super::fixture().join("browser-module"); - - let resolver1 = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["innerBrowser1".into(), "field".into(), "browser".into()]], - ..ResolveOptions::default() - }); - let resolved_path = resolver1.resolve(&f, "./lib/main1.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("lib/main.js"))); - - let resolver2 = resolver1.clone_with_options(ResolveOptions { - alias_fields: vec![vec!["innerBrowser2".into(), "browser".into()]], - ..ResolveOptions::default() - }); - let resolved_path = resolver2.resolve(&f, "./lib/main2.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("./lib/replaced.js"))); -} - -#[test] -fn replace_file() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![ - vec!["browser".into()], - vec!["innerBrowser1".into(), "field2".into(), "browser".into()], // not presented - vec!["innerBrowser1".into(), "field".into(), "browser".into()], - vec!["innerBrowser2".into(), "browser".into()], - ], - // Not part of enhanced-resolve. Added to make sure no interaction between these two fields. - main_fields: vec!["browser".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - ("should replace a file 1", f.clone(), "./lib/replaced", f.join("lib/browser.js")), - ("should replace a file 2", f.clone(), "./lib/replaced.js", f.join("lib/browser.js")), - ("should replace a file 3", f.join("lib"), "./replaced", f.join("lib/browser.js")), - ("should replace a file 4", f.join("lib"), "./replaced.js", f.join("lib/browser.js")), - ("should replace a module with a file 1", f.clone(), "module-a", f.join("browser/module-a.js")), - ("should replace a module with a file 2", f.join("lib"), "module-a", f.join("browser/module-a.js")), - ("should replace a module with a module 1", f.clone(), "module-b", f.join("node_modules/module-c.js")), - ("should replace a module with a module 2", f.join("lib"), "module-b", f.join("node_modules/module-c.js")), - ("should resolve in nested property 1", f.clone(), "./lib/main1.js", f.join("lib/main.js")), - ("should resolve in nested property 2", f.clone(), "./lib/main2.js", f.join("lib/browser.js")), - ("should check only alias field properties", f.clone(), "./toString", f.join("lib/toString.js")), - // not part of enhanced-resolve - ("recursion", f.clone(), "module-c", f.join("node_modules/module-c.js")), - ("resolve self 1", f.clone(), "./lib/main.js", f.join("lib/main.js")), - ("resolve self 2", f.clone(), "./main.js", f.join("lib/main.js")), - ]; - - for (comment, path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn recurse_fail() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - ("recurse non existent", f.clone(), "./lib/non-existent.js", ResolveError::NotFound("./lib/non-existent.js".into())), - ("path partial match 1", f.clone(), "./xyz.js", ResolveError::NotFound("./xyz.js".into())), - ("path partial match 2", f, "./lib/xyz.js", ResolveError::NotFound("./lib/xyz.js".into())), - ]; - - for (comment, path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Err(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn broken() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - // The browser field string value should be ignored - (f.clone(), "browser-module-broken", Ok(f.join("node_modules/browser-module-broken/main.js"))), - (f.join("browser-module"), "./number", Err(ResolveError::NotFound("./number".into()))), - ]; - - for (path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, expected, "{path:?} {request}"); - } -} - -#[test] -fn crypto_js() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - fallback: vec![( - "crypto".into(), - vec![AliasValue::from(f.join("lib.js").to_string_lossy())], - )], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(f.join("crypto-js"), "crypto").map(|r| r.full_path()); - assert_eq!(resolved_path, Err(ResolveError::Ignored(f.join("crypto-js")))); -} - -// https://github.com/webpack/webpack/blob/87660921808566ef3b8796f8df61bd79fc026108/test/cases/resolving/browser-field/index.js#L40-L43 -#[test] -fn recursive() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - let data = [ - ("should handle recursive file 1", f.clone(), "recursive-file/a"), - ("should handle recursive file 2", f.clone(), "recursive-file/b"), - ("should handle recursive file 3", f.clone(), "recursive-file/c"), - ("should handle recursive file 4", f, "recursive-file/d"), - ]; - - for (comment, path, request) in data { - let resolved_path = resolver.resolve(&path, request); - assert_eq!(resolved_path, Err(ResolveError::Recursion), "{comment} {path:?} {request}"); - } -} - -#[test] -fn with_query() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "./foo").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("lib").join("browser.js?query"))); -} diff --git a/src/tests/builtins.rs b/src/tests/builtins.rs deleted file mode 100644 index 5d6d14d9..00000000 --- a/src/tests/builtins.rs +++ /dev/null @@ -1,121 +0,0 @@ -use std::path::Path; - -use crate::{ResolveError, ResolveOptions, Resolver}; - -#[test] -fn builtins_off() { - let f = Path::new("/"); - let resolver = Resolver::default(); - let resolved_path = resolver.resolve(f, "zlib").map(|r| r.full_path()); - assert_eq!(resolved_path, Err(ResolveError::NotFound("zlib".into()))); -} - -#[test] -fn builtins() { - let f = Path::new("/"); - - let resolver = Resolver::new(ResolveOptions::default().with_builtin_modules(true)); - - let pass = [ - "_http_agent", - "_http_client", - "_http_common", - "_http_incoming", - "_http_outgoing", - "_http_server", - "_stream_duplex", - "_stream_passthrough", - "_stream_readable", - "_stream_transform", - "_stream_wrap", - "_stream_writable", - "_tls_common", - "_tls_wrap", - "assert", - "assert/strict", - "async_hooks", - "buffer", - "child_process", - "cluster", - "console", - "constants", - "crypto", - "dgram", - "diagnostics_channel", - "dns", - "dns/promises", - "domain", - "events", - "fs", - "fs/promises", - "http", - "http2", - "https", - "inspector", - "module", - "net", - "os", - "path", - "path/posix", - "path/win32", - "perf_hooks", - "process", - "punycode", - "querystring", - "readline", - "repl", - "stream", - "stream/consumers", - "stream/promises", - "stream/web", - "string_decoder", - "sys", - "timers", - "timers/promises", - "tls", - "trace_events", - "tty", - "url", - "util", - "util/types", - "v8", - "vm", - "worker_threads", - "zlib", - ]; - - for request in pass { - let prefixed_request = format!("node:{request}"); - for request in [prefixed_request.clone(), request.to_string()] { - let resolved_path = resolver.resolve(f, &request).map(|r| r.full_path()); - let err = ResolveError::Builtin(prefixed_request.clone()); - assert_eq!(resolved_path, Err(err), "{request}"); - } - } -} - -#[test] -fn fail() { - let f = Path::new("/"); - let resolver = Resolver::new(ResolveOptions::default().with_builtin_modules(true)); - let request = "xxx"; - let resolved_path = resolver.resolve(f, request); - let err = ResolveError::NotFound(request.to_string()); - assert_eq!(resolved_path, Err(err), "{request}"); -} - -#[test] -fn imports() { - let f = super::fixture().join("builtins"); - let resolver = Resolver::new(ResolveOptions { - builtin_modules: true, - condition_names: vec!["node".into()], - ..ResolveOptions::default() - }); - - for request in ["#fs", "#http"] { - let resolved_path = resolver.resolve(f.clone(), request).map(|r| r.full_path()); - let err = ResolveError::Builtin(format!("node:{}", request.trim_start_matches('#'))); - assert_eq!(resolved_path, Err(err)); - } -} diff --git a/src/tests/dependencies.rs b/src/tests/dependencies.rs deleted file mode 100644 index bcc2355b..00000000 --- a/src/tests/dependencies.rs +++ /dev/null @@ -1,110 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/dependencies.test.js - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows { - use rustc_hash::FxHashSet; - use std::path::PathBuf; - - use crate::{ResolveContext, ResolveOptions, ResolverGeneric}; - - use super::super::memory_fs::MemoryFS; - - fn file_system() -> MemoryFS { - MemoryFS::new(&[ - ("/a/b/node_modules/some-module/index.js", ""), - ("/a/node_modules/module/package.json", r#"{"main":"entry.js"}"#), - ("/a/node_modules/module/file.js", r#"{"main":"entry.js"}"#), - ("/modules/other-module/file.js", ""), - ]) - } - - #[test] - fn test() { - let file_system = file_system(); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - extensions: vec![".json".into(), ".js".into()], - modules: vec!["/modules".into(), "node_modules".into()], - ..ResolveOptions::default() - }, - ); - - let data = [ - ( - "middle module request", - "/a/b/c", - "module/file", - "/a/node_modules/module/file.js", - // These dependencies are different from enhanced-resolve due to different code path to - // querying the file system - vec![ - // 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", - // "/", - ], - vec![ - // missing package.jsons - // "/a/b/c/package.json", - "/a/b/package.json", - "/a/package.json", - "/package.json", - // missing modules directories - "/a/b/c", - // "/a/b/c/node_modules", - // missing single file modules - "/modules/module", - "/a/b/node_modules/module", - // missing files with alternative extensions - "/a/node_modules/module/file", - "/a/node_modules/module/file.json", - ], - ), - ( - "fast found module", - "/a/b/c", - "other-module/file.js", - "/modules/other-module/file.js", - // These dependencies are different from enhanced-resolve due to different code path to - // querying the file system - vec![ - // symlink checks - "/modules/other-module/file.js", - // "/modules/other-module", - // "/modules", - // "/", - ], - vec![ - // missing package.jsons - // "/a/b/c/package.json", - "/a/b/c", - "/a/b/package.json", - "/a/package.json", - "/package.json", - "/modules/other-module/package.json", - "/modules/package.json", - ], - ), - ]; - - for (name, context, request, result, file_dependencies, missing_dependencies) in data { - let mut ctx = ResolveContext::default(); - let path = PathBuf::from(context); - let resolved = - resolver.resolve_with_context(path, request, &mut ctx).map(|r| r.full_path()); - assert_eq!(resolved, Ok(PathBuf::from(result))); - let file_dependencies = - FxHashSet::from_iter(file_dependencies.iter().map(PathBuf::from)); - let missing_dependencies = - FxHashSet::from_iter(missing_dependencies.iter().map(PathBuf::from)); - assert_eq!(ctx.file_dependencies, file_dependencies, "{name}"); - assert_eq!(ctx.missing_dependencies, missing_dependencies, "{name}"); - } - } -} diff --git a/src/tests/exports_field.rs b/src/tests/exports_field.rs deleted file mode 100644 index fd68c1f7..00000000 --- a/src/tests/exports_field.rs +++ /dev/null @@ -1,2546 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/exportsField.test.js -//! -//! The huge exports field test cases are at the bottom of this file. - -use crate::{Ctx, PathUtil, ResolveError, ResolveOptions, Resolver}; -use serde_json::json; -use std::path::Path; - -#[test] -fn test_simple() { - let f = super::fixture().join("exports-field"); - let f2 = super::fixture().join("exports-field2"); - let f4 = super::fixture().join("exports-field-error"); - let f5 = super::fixture().join("imports-exports-wildcard"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - fully_specified: true, - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("resolve root using exports field, not a main field", f.clone(), "exports-field", f.join("node_modules/exports-field/x.js")), - ("resolver should respect condition names", f.clone(), "exports-field/dist/main.js", f.join("node_modules/exports-field/lib/lib2/main.js")), - // enhanced_resolve behaves differently to node.js. enhanced_resolve fallbacks when an - // array item is unresolved, where as node.js fallbacks when an array has an - // InvalidPackageTarget error. - // ("resolver should respect fallback", f2.clone(), "exports-field/dist/browser.js", f2.join("node_modules/exports-field/lib/browser.js")), - // The following two tests require fallback from array values, the path is changed here to - // only test query and fragment. - ("resolver should respect query parameters #1", f2.clone(), "exports-field/dist/main.js?foo", f2.join("node_modules/exports-field/lib/lib2/main.js?foo")), - ("resolver should respect fragment parameters #1", f2.clone(), "exports-field/dist/main.js#foo", f2.join("node_modules/exports-field/lib/lib2/main.js#foo")), - ("relative path should work, if relative path as request is used", f.clone(), "./node_modules/exports-field/lib/main.js", f.join("node_modules/exports-field/lib/main.js")), - ("self-resolving root", f.clone(), "@exports-field/core", f.join("a.js")), - ("should resolve with wildcard pattern #1", f5.clone(), "m/features/f.js", f5.join("node_modules/m/src/features/f.js")), - ("should resolve with wildcard pattern #2", f5.clone(), "m/features/y/y.js", f5.join("node_modules/m/src/features/y/y.js")), - ("should resolve with wildcard pattern #3", f5.clone(), "m/features-no-ext/y/y.js", f5.join("node_modules/m/src/features/y/y.js")), - ("should resolve with wildcard pattern #4", f5.clone(), "m/middle/nested/f.js", f5.join("node_modules/m/src/middle/nested/f.js")), - ("should resolve with wildcard pattern #5", f5.clone(), "m/middle-1/nested/f.js", f5.join("node_modules/m/src/middle-1/nested/f.js")), - ("should resolve with wildcard pattern #6", f5.clone(), "m/middle-2/nested/f.js", f5.join("node_modules/m/src/middle-2/nested/f.js")), - ("should resolve with wildcard pattern #7", f5.clone(), "m/middle-3/nested/f", f5.join("node_modules/m/src/middle-3/nested/f/nested/f.js")), - ("should resolve with wildcard pattern #8", f5.clone(), "m/middle-4/f/nested", f5.join("node_modules/m/src/middle-4/f/f.js")), - ("should resolve with wildcard pattern #9", f5.clone(), "m/middle-5/f$/$", f5.join("node_modules/m/src/middle-5/f$/$.js")), - ]; - - // Not needed or snapshot: - // * should log the correct info - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } - - let p = f.join("node_modules/exports-field/package.json"); - let p2 = f2.join("node_modules/exports-field/package.json"); - let p4 = f4.join("node_modules/exports-field/package.json"); - let p5 = f5.join("node_modules/m/package.json"); - - #[rustfmt::skip] - let fail = [ - // ("throw error if extension not provided", f2.clone(), "exports-field/dist/main", ResolveError::NotFound(f2.join("node_modules/exports-field/lib/lib2/main"))), - ("resolver should respect query parameters #2. Direct matching", f2.clone(), "exports-field?foo", ResolveError::PackagePathNotExported("./?foo".into(), p2.clone())), - ("resolver should respect fragment parameters #2. Direct matching", f2, "exports-field#foo", ResolveError::PackagePathNotExported("./#foo".into(), p2)), - ("relative path should not work with exports field", f.clone(), "./node_modules/exports-field/dist/main.js", ResolveError::NotFound("./node_modules/exports-field/dist/main.js".into())), - ("backtracking should not work for request", f.clone(), "exports-field/dist/../../../a.js", ResolveError::InvalidPackageTarget("./lib/../../../a.js".to_string(), "./dist/".to_string(), p.clone())), - ("backtracking should not work for exports field target", f.clone(), "exports-field/dist/a.js", ResolveError::InvalidPackageTarget("./../../a.js".to_string(), "./dist/a.js".to_string(), p.clone())), - ("not exported error", f.clone(), "exports-field/anything/else", ResolveError::PackagePathNotExported("./anything/else".to_string(), p.clone())), - ("request ending with slash #1", f.clone(), "exports-field/", ResolveError::PackagePathNotExported("./".to_string(), p.clone())), - ("request ending with slash #2", f.clone(), "exports-field/dist/", ResolveError::PackagePathNotExported("./dist/".to_string(), p.clone())), - ("request ending with slash #3", f.clone(), "exports-field/lib/", ResolveError::PackagePathNotExported("./lib/".to_string(), p)), - ("should throw error if target is invalid", f4, "exports-field", ResolveError::InvalidPackageTarget("./a/../b/../../pack1/index.js".to_string(), ".".to_string(), p4)), - ("throw error if exports field is invalid", f.clone(), "invalid-exports-field", ResolveError::InvalidPackageConfig(f.join("node_modules/invalid-exports-field/package.json"))), - ("should throw error if target is 'null'", f5, "m/features/internal/file.js", ResolveError::PackagePathNotExported("./features/internal/file.js".to_string(), p5)), - ]; - - for (comment, path, request, error) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!(resolution, Err(error), "{comment} {path:?} {request}"); - } -} - -// resolve using exports field, not a browser field #1 -#[test] -fn exports_not_browser_field1() { - let f = super::fixture().join("exports-field"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - condition_names: vec!["webpack".into()], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "exports-field/dist/main.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("node_modules/exports-field/lib/lib2/main.js"))); -} - -// resolve using exports field and a browser alias field #2 -#[test] -fn exports_not_browser_field2() { - let f2 = super::fixture().join("exports-field2"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - extensions: vec![".js".into()], - condition_names: vec!["node".into()], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f2, "exports-field/dist/main.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f2.join("node_modules/exports-field/lib/browser.js"))); -} - -// should resolve extension without fullySpecified -#[test] -fn extension_without_fully_specified() { - let f2 = super::fixture().join("exports-field2"); - - let commonjs_resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - let resolved_path = - commonjs_resolver.resolve(&f2, "exports-field/dist/main").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f2.join("node_modules/exports-field/lib/lib2/main.js"))); -} - -#[test] -fn field_name_path() { - let f2 = super::fixture().join("exports-field2"); - let f3 = super::fixture().join("exports-field3"); - - // field name path #1 #2 #3 - let exports_fields = [ - vec![vec!["exportsField".into(), "exports".into()]], - vec![vec!["exportsField".into(), "exports".into()], vec!["exports".into()]], - vec![vec!["exports".into()], vec!["exportsField".into(), "exports".into()]], - ]; - - for exports_fields in exports_fields { - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - exports_fields, - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/main.js"))); - } - - // field name path #4 - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - exports_fields: vec![vec!["exports".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f2, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f2.join("node_modules/exports-field/index.js"))); - - // field name path #5 - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - exports_fields: vec![vec!["ex".into()], vec!["exports_field".into(), "exports".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/index"))); - - // non-compliant export targeting a directory - let resolver = Resolver::new(ResolveOptions { - exports_fields: vec![vec!["broken".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/src/index.js"))); -} - -#[test] -fn shared_resolvers() { - let f3 = super::fixture().join("exports-field3"); - - let resolver1 = Resolver::new(ResolveOptions { - exports_fields: vec![vec!["exportsField".into(), "exports".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver1.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/main.js"))); - - let resolver2 = resolver1.clone_with_options(ResolveOptions { - exports_fields: vec![vec!["ex".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver2.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/index"))); -} - -#[test] -fn extension_alias_1_2() { - let f = super::fixture().join("exports-field-and-extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - extension_alias: vec![(".js".into(), vec![".ts".into(), ".js".into()])], - fully_specified: true, - condition_names: vec!["webpack".into(), "default".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve with the `extensionAlias` option", f.clone(), "@org/pkg/string.js", f.join("node_modules/@org/pkg/dist/string.js")), - ("should resolve with the `extensionAlias` option #2", f.clone(), "pkg/string.js", f.join("node_modules/pkg/dist/string.js")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn extension_alias_3() { - let f = super::fixture().join("exports-field-and-extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - extension_alias: vec![( - ".js".into(), - vec![".foo".into(), ".baz".into(), ".baz".into(), ".ts".into(), ".js".into()], - )], - fully_specified: true, - condition_names: vec!["webpack".into(), "default".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve with the `extensionAlias` option #3", f.clone(), "pkg/string.js", f.join("node_modules/pkg/dist/string.js")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn extension_alias_throw_error() { - let f = super::fixture().join("exports-field-and-extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - extension_alias: vec![(".js".into(), vec![".ts".into()])], - fully_specified: true, - condition_names: vec!["webpack".into(), "default".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let fail = [ - // enhanced-resolve has two test cases that are exactly the same here - // https://github.com/webpack/enhanced-resolve/blob/a998c7d218b7a9ec2461fc4fddd1ad5dd7687485/test/exportsField.test.js#L2976-L3024 - ("should throw error with the `extensionAlias` option", f, "pkg/string.js", ResolveError::ExtensionAlias), - // TODO: The error is PackagePathNotExported in enhanced-resolve - // ("should throw error with the `extensionAlias` option", f.clone(), "pkg/string.js", ResolveError::PackagePathNotExported("node_modules/pkg/dist/string.ts".to_string())), - ]; - - for (comment, path, request, error) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!(resolution, Err(error), "{comment} {path:?} {request}"); - } -} - -// Small script for generating the test cases from enhanced-resolve -// for (c of testCases) { -// console.log("TestCase {") -// console.log(`name: ${JSON.stringify(c.name)},`) -// if (c.expect instanceof Error) { -// console.log(`expect: None,`) -// } else { -// console.log(`expect: Some(vec!${JSON.stringify(c.expect)}),`) -// } -// console.log(`exports_field: exports_field(json!(${JSON.stringify(c.suite[0], null, 2)})),`) -// console.log(`request: "${c.suite[1]}",`) -// console.log(`condition_names: vec!${JSON.stringify(c.suite[2])},`) -// console.log("},") -//} -struct TestCase { - name: &'static str, - expect: Option>, - exports_field: serde_json::Value, - request: &'static str, - condition_names: Vec<&'static str>, -} - -#[allow(clippy::needless_pass_by_value)] -fn exports_field(value: serde_json::Value) -> serde_json::Value { - value -} - -#[test] -fn test_cases() { - let test_cases = [ - TestCase { - name: "sample #1", - expect: Some(vec!["./dist/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/": { - "import": [ - "./dist/", - "./src/" - ], - "webpack": "./wp/" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "sample #1", - expect: Some(vec!["./src/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/": { - "import": [ - "./src/" - ], - "webpack": "./wp/" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - TestCase { - name: "sample #1 (wildcard)", - expect: Some(vec!["./dist/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/*": { - "import": [ - "./dist/*", - "./src/*" - ], - "webpack": "./wp/*" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "sample #1 (wildcard)", - expect: Some(vec!["./src/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/*": { - "import": [ - "./src/*" - ], - "webpack": "./wp/*" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - TestCase { - name: "sample #2", - expect: Some(vec!["./data/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./timezones/": "./data/timezones/" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #2 (wildcard)", - expect: Some(vec!["./data/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./timezones/*": "./data/timezones/*" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #3", - expect: Some(vec!["./data/timezones/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./": "./data/timezones/" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #3 (wildcard)", - expect: Some(vec!["./data/timezones/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./*": "./data/timezones/*.mjs" - })), - request: "./timezones/pdt", - condition_names: vec![], - }, - TestCase { - name: "sample #4", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./lib/": { - "browser": [ - "./browser/" - ] - }, - "./dist/index.js": { - "node": "./index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #4 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "node": "./index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #5", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/": { - "browser": [ - "./browser/" - ] - }, - "./dist/index.js": { - "node": "./index.js", - "default": "./browser/index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #5 (wildcard)", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "node": "./index.js", - "default": "./browser/index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./dist/a": "./dist/index.js" - })), - request: "./dist/aaa", - condition_names: vec![], - }, - TestCase { - name: "sample #7", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./dist/a/a/": "./dist/index.js" - })), - request: "./dist/a/a", - condition_names: vec![], - }, - TestCase { - name: "sample #7 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./dist/a/a/*": "./dist/index.js" - })), - request: "./dist/a/a", - condition_names: vec![], - }, - TestCase { - name: "sample #8", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": "./index.js" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #9", - expect: Some(vec!["./main.js"]), - exports_field: exports_field(json!({ - "./index.js": "./main.js" - })), - request: "./index.js", - condition_names: vec![], - }, - TestCase { - name: "sample #10", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #11", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./bar#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #12", - expect: Some(vec!["./ok.js#abc"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/ok.js#abc", - condition_names: vec![], - }, - TestCase { - name: "sample #12", - expect: Some(vec!["./ok.js#abc"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/ok.js#abc", - condition_names: vec![], - }, - TestCase { - name: "sample #13", - expect: Some(vec!["./ok.js?abc"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/ok.js?abc", - condition_names: vec![], - }, - TestCase { - name: "sample #14", - expect: Some(vec!["./🎉.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/🎉.js", - condition_names: vec![], - }, - TestCase { - name: "sample #15", - expect: Some(vec!["./%F0%9F%8E%89.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/%F0%9F%8E%89.js", - condition_names: vec![], - }, - TestCase { - name: "sample #16", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./🎉", - condition_names: vec![], - }, - TestCase { - name: "sample #17", - expect: Some(vec!["./other.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./%F0%9F%8E%89", - condition_names: vec![], - }, - TestCase { - name: "sample #18", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./module", - condition_names: vec![], - }, - TestCase { - name: "sample #19", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./module#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #20", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./module?foo", - condition_names: vec![], - }, - TestCase { - name: "sample #21", - expect: Some(vec!["./zizizi"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./z*z*z*" - })), - request: "./#zippi", - condition_names: vec![], - }, - TestCase { - name: "sample #22", - expect: Some(vec!["./d?e?f"]), - exports_field: exports_field(json!({ - "./a?b?c/": "./" - })), - request: "./a?b?c/d?e?f", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #1", - expect: Some(vec!["./dist/index.js"]), - exports_field: exports_field(json!({ - ".": "./dist/index.js" - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #2", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./": "./", - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #3", - expect: Some(vec!["./dist/a.js"]), - exports_field: exports_field(json!({ - "./dist/": "./dist/", - "./dist/*": "./dist/*", - "./dist*": "./dist*", - "./dist/index.js": "./dist/a.js" - })), - request: "./dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #4", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./": { - "browser": [ - "./browser/" - ] - }, - "./*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "browser": "./index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #5", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./": { - "browser": [ - "./browser/" - ] - }, - "./*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "node": "./node.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #6", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - ".": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #7", - expect: Some(vec!["./src/index.js"]), // `enhanced_resolve` is `None` - exports_field: exports_field(json!({ - ".": { - "default": "./src/index.js", - "browser": "./index.js", - "node": "./src/node/index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #8", - expect: Some(vec!["./src/index.js"]), - exports_field: exports_field(json!({ - ".": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #9", - expect: Some(vec!["./index"]), - exports_field: exports_field(json!({ - ".": "./index" - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #10", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./index": "./index.js" - })), - request: "./index", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #11", - expect: Some(vec!["./foo.js"]), - exports_field: exports_field(json!({ - "./": "./", - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #12", - expect: Some(vec!["./foo/bar/baz.js"]), - exports_field: exports_field(json!({ - "./": "./", - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo/bar/baz.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #13", - expect: Some(vec!["./foo/bar/baz.js"]), - exports_field: exports_field(json!({ - "./": "./", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo/bar/baz.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #14", - expect: Some(vec!["./foo/bar/baz.js"]), - exports_field: exports_field(json!({ - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo/bar/baz.js", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #1", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "require": "./require.js" - }, { - "import": "./import.mjs" - }] - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #2", - expect: Some(vec!["./import.mjs"]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "require": "./require.js" - }, { - "import": "./import.mjs" - }] - })), - request: ".", - condition_names: vec!["import"], - }, - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./require.js"]), - exports_field: exports_field(json!({ - ".": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./import.mjs"]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "import": "./import.mjs" - }] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./require.js"]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "require": [ - "./require.js" - ] - }, { - "import": [ - "./import.mjs", - "./import.js" - ] - }] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./import.mjs"]), - exports_field: exports_field(json!({ - ".": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "./import.mjs", - "./import.js" - ] - } - ] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./import.js"]), - exports_field: exports_field(json!({ - ".": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "./import.js" - ] - } - ] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "mapping to a folder root #1", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./timezones": "./data/timezones/" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #2", - expect: None, - exports_field: exports_field(json!({ - "./timezones/": "./data/timezones" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #3", - expect: Some(vec!["./data/timezones/pdt/index.mjs"]), - exports_field: exports_field(json!({ - "./timezones/pdt/": "./data/timezones/pdt/" - })), - request: "./timezones/pdt/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #3 (wildcard)", - expect: Some(vec!["./data/timezones/pdt/index.mjs"]), - exports_field: exports_field(json!({ - "./timezones/pdt/*": "./data/timezones/pdt/*" - })), - request: "./timezones/pdt/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #4", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./": "./timezones/" - })), - request: "./pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #4 (wildcard)", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./*": "./timezones/*" - })), - request: "./pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #5", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./": "./" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #5 (wildcard)", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./*": "./*" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #6", - expect: None, - exports_field: exports_field(json!({ - "./": "." - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #6 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "./*": "." - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #7", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": "./" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #7 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": "./*" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #1", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./": "./", - "./dist/": "./lib/" - })), - request: "./dist/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #1 (wildcard)", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./*": "./*", - "./dist/*": "./lib/*" - })), - request: "./dist/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #2", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/": "./dist/utils/", - "./dist/": "./lib/" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #2 (wildcard)", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/*": "./dist/utils/*", - "./dist/*": "./lib/*" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #3", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/index.js": "./dist/utils/index.js", - "./dist/utils/": "./dist/utils/index.mjs", - "./dist/": "./lib/" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #3 (wildcard)", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/index.js": "./dist/utils/index.js", - "./dist/utils/*": "./dist/utils/index.mjs", - "./dist/*": "./lib/*" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #4", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./": { - "browser": "./browser/" - }, - "./dist/": "./lib/" - })), - request: "./dist/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "the longest matching path prefix is prioritized #4 (wildcard)", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./*": { - "browser": "./browser/*" - }, - "./dist/*": "./lib/*" - })), - request: "./dist/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #1", - // `lodash/` does not start with './' so fallbacks to util - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "conditional mapping folder #1", - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": [ - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #1 (wildcard)", - // `lodash/` does not start with './' so fallbacks to util - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": [ - "lodash/*", - "./utils/*" - ], - "node": [ - "./utils-node/*" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "conditional mapping folder #1 (wildcard)", - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": [ - "./utils/*" - ], - "node": [ - "./utils-node/*" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #2", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./node/" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "conditional mapping folder #2 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "webpack": "./wpk/*", - "browser": [ - "lodash/*", - "./utils/*" - ], - "node": [ - "./node/*" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "conditional mapping folder #3", - expect: Some(vec!["./wpk/index.mjs"]), - exports_field: exports_field(json!({ - "./utils/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils/" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "conditional mapping folder #3 (wildcard)", - expect: Some(vec!["./wpk/index.mjs"]), - exports_field: exports_field(json!({ - "./utils/*": { - "webpack": "./wpk/*", - "browser": [ - "lodash/*", - "./utils/*" - ], - "node": [ - "./utils/*" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "incorrect exports field #1", - expect: None, - exports_field: exports_field(json!({ - "/utils/": "./a/" - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #2", - expect: None, - exports_field: exports_field(json!({ - "./utils/": "/a/" - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #3", - expect: None, - exports_field: exports_field(json!({ - "/utils/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #4", - expect: None, - exports_field: exports_field(json!({ - "./utils/": { - "browser": "/a/", - "default": "/b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #4 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "/a/", - "default": "/b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #5", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index": "./a/index.js" - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index.mjs": "./a/index.js" - })), - request: "./utils/index", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #7", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #8", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index.mjs": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - // Requests that are not `./` does not apply to `package_exports_resolve` - // TestCase { - // name: "incorrect request #1", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": "./a/" - // })), - // request: "/utils/index.mjs", - // condition_names: vec![], - // }, - // TestCase { - // name: "incorrect request #2", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": { - // "browser": "./a/", - // "default": "./b/" - // } - // })), - // request: "/utils/index.mjs", - // condition_names: vec!["browser"], - // }, - // TestCase { - // name: "incorrect request #3", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": { - // "browser": "./a/", - // "default": "./b/" - // } - // })), - // request: "../utils/index.mjs", - // condition_names: vec!["browser"], - // }, - // TestCase { - // name: "incorrect request #4", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": { - // "browser": "./a/", - // "default": "./b/" - // } - // })), - // request: "/utils/index.mjs/", - // condition_names: vec!["browser"], - // }, - TestCase { - name: "backtracking package base #1", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./../../utils/": "./dist/" - })), - request: "./../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #1 (wildcard)", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./../../utils/*": "./dist/*" - })), - request: "./../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #2", - expect: None, - exports_field: exports_field(json!({ - "../../utils/": "./dist/" - })), - request: "../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #2 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "../../utils/*": "./dist/*" - })), - request: "../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #3", - expect: None, - exports_field: exports_field(json!({ - "./utils/": "../src/" - })), - request: "./utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #3 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "./utils/*": "../src/*" - })), - request: "./utils/index", - condition_names: vec![], - }, - // enhanced-resolve does not handle backtracking here - // TestCase { - // name: "backtracking package base #4", - // expect: Some(vec!["./../src/index"]), - // exports_field: exports_field(json!({ - // "./utils/": "./../src/" - // })), - // request: "./utils/index", - // condition_names: vec![], - // }, - // TestCase { - // name: "backtracking package base #4 (wildcard)", - // expect: Some(vec!["./../src/index"]), - // exports_field: exports_field(json!({ - // "./utils/*": "./../src/*" - // })), - // request: "./utils/index", - // condition_names: vec![], - // }, - // TestCase { - // name: "backtracking package base #5", - // expect: Some(vec!["./src/../index.js"]), - // exports_field: exports_field(json!({ - // "./utils/index": "./src/../index.js" - // })), - // request: "./utils/index", - // condition_names: vec![], - // }, - TestCase { - name: "backtracking package base #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/../utils/index": "./src/../index.js" - })), - request: "./utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #7", - expect: None, - exports_field: exports_field(json!({ - "./utils/": { - "browser": "../this/" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #7", - expect: None, - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "../this/*" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #8", - // We throw "InvalidPackageTarget" - // expect: Some(vec!["./utils/../index"]), - expect: None, - exports_field: exports_field(json!({ - "./utils/": { - "browser": "./utils/../" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #8 (wildcard)", - // We throw "InvalidPackageTarget" - // expect: Some(vec!["./utils/../index"]), - expect: None, - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "./utils/../*" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #9", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./": "./src/../../", - "./dist/": "./dist/" - })), - request: "./dist/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #9 (wildcard)", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./*": "./src/../../*", - "./dist/*": "./dist/*" - })), - request: "./dist/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking target folder #1", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../../index"]), - exports_field: exports_field(json!({ - "./utils/": "./dist/" - })), - request: "./utils/timezone/../../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #1 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../../index"]), - exports_field: exports_field(json!({ - "./utils/*": "./dist/*" - })), - request: "./utils/timezone/../../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #2", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../index"]), - exports_field: exports_field(json!({ - "./utils/": "./dist/" - })), - request: "./utils/timezone/../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #2 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../index"]), - exports_field: exports_field(json!({ - "./utils/*": "./dist/*" - })), - request: "./utils/timezone/../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #3", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/target/../../index"]), - exports_field: exports_field(json!({ - "./utils/": "./dist/target/" - })), - request: "./utils/../../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #3 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/target/../../index"]), - exports_field: exports_field(json!({ - "./utils/*": "./dist/target/*" - })), - request: "./utils/../../index", - condition_names: vec![], - }, - // enhanced-resolve does not handle `node_modules` in target - TestCase { - name: "nested node_modules path #1", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": "./node_modules/" - } - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #1 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "./node_modules/*" - } - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #2", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./utils/../node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/": "./utils/../node_modules/" - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "nested node_modules path #2 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./utils/../node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": "./utils/../node_modules/*" - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "nested mapping #1", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": "./", - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested mapping #1 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": "./*", - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "nested mapping #2 (wildcard)", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #2 (wildcard)", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "nested mapping #3", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["webpack"], - }, - TestCase { - name: "nested mapping #3 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["webpack"], - }, - TestCase { - name: "nested mapping #4", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["node", "browser"], - }, - TestCase { - name: "nested mapping #4 (wildcard)", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["node", "browser"], - }, - TestCase { - name: "nested mapping #5", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node"], - }, - TestCase { - name: "nested mapping #5 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": { - "webpack": [ - "./wpck/*" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node"], - }, - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - TestCase { - name: "nested mapping #6 (wildcard)", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": { - "webpack": [ - "./wpck/*" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #6 (wildcard)", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./node/*" - ], - "default": { - "node": { - "webpack": [ - "./wpck/*" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - TestCase { - name: "nested mapping #7", - expect: Some(vec!["./y.js"]), - exports_field: exports_field(json!({ - "./a.js": { - "abc": { - "def": "./x.js" - }, - "ghi": "./y.js" - } - })), - request: "./a.js", - condition_names: vec!["abc", "ghi"], - }, - TestCase { - name: "nested mapping #8", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./a.js": { - "abc": { - "def": "./x.js", - "default": [] - }, - "ghi": "./y.js" - } - })), - request: "./a.js", - condition_names: vec!["abc", "ghi"], - }, - TestCase { - name: "syntax sugar #1", - expect: Some(vec!["./main.js"]), - exports_field: exports_field(json!("./main.js")), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #2", - expect: Some(vec![]), - exports_field: exports_field(json!("./main.js")), - request: "./lib.js", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #3", - expect: Some(vec!["./a.js"]), - exports_field: exports_field(json!(["./a.js", "./b.js"])), - request: ".", - condition_names: vec![], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "syntax sugar #3", - expect: Some(vec!["./b.js"]), - exports_field: exports_field(json!(["./b.js"])), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #4", - expect: Some(vec![]), - exports_field: exports_field(json!(["./a.js", "./b.js"])), - request: "./lib.js", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #5", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "browser": { - "default": "./index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "syntax sugar #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "browser": { - "default": "./index.js" - } - })), - request: "./lib.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "syntax sugar #7", - expect: None, - exports_field: exports_field(json!({ - "./node": "./node.js", - "browser": { - "default": "./index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "syntax sugar #8", - expect: None, - exports_field: exports_field(json!({ - "browser": { - "default": "./index.js" - }, - "./node": "./node.js" - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #1", - expect: Some(vec!["./abc/d"]), - exports_field: exports_field(json!({ - "./ab*": "./ab/*", - "./abc*": "./abc/*", - "./a*": "./a/*" - })), - request: "./abcd", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #2", - expect: Some(vec!["./abc/d/e"]), - exports_field: exports_field(json!({ - "./ab*": "./ab/*", - "./abc*": "./abc/*", - "./a*": "./a/*" - })), - request: "./abcd/e", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #3", - expect: Some(vec!["./abc/d"]), - exports_field: exports_field(json!({ - "./x/ab*": "./ab/*", - "./x/abc*": "./abc/*", - "./x/a*": "./a/*" - })), - request: "./x/abcd", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #4", - expect: Some(vec!["./abc/d/e"]), - exports_field: exports_field(json!({ - "./x/ab*": "./ab/*", - "./x/abc*": "./abc/*", - "./x/a*": "./a/*" - })), - request: "./x/abcd/e", - condition_names: vec!["browser"], - }, - TestCase { - name: "path tree edge case #1", - expect: Some(vec!["./A/b/d.js"]), - exports_field: exports_field(json!({ - "./a/": "./A/", - "./a/b/c": "./c.js" - })), - request: "./a/b/d.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #1 (wildcard)", - expect: Some(vec!["./A/b/d.js"]), - exports_field: exports_field(json!({ - "./a/*": "./A/*", - "./a/b/c": "./c.js" - })), - request: "./a/b/d.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #2", - expect: Some(vec!["./A/c.js"]), - exports_field: exports_field(json!({ - "./a/": "./A/", - "./a/b": "./b.js" - })), - request: "./a/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #2 (wildcard)", - expect: Some(vec!["./A/c.js"]), - exports_field: exports_field(json!({ - "./a/*": "./A/*", - "./a/b": "./b.js" - })), - request: "./a/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #3", - expect: Some(vec!["./A/b/d/c.js"]), - exports_field: exports_field(json!({ - "./a/": "./A/", - "./a/b/c/d": "./c.js" - })), - request: "./a/b/d/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #3 (wildcard)", - expect: Some(vec!["./A/b/d/c.js"]), - exports_field: exports_field(json!({ - "./a/*": "./A/*", - "./a/b/c/d": "./c.js" - })), - request: "./a/b/d/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #1", - expect: Some(vec!["./A/b.js"]), - exports_field: exports_field(json!({ - "./a/*.js": "./A/*.js" - })), - request: "./a/b.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #2", - expect: Some(vec!["./A/b/c.js"]), - exports_field: exports_field(json!({ - "./a/*.js": "./A/*.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #3", - expect: Some(vec!["./A/b/c.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": "./A/*/c.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #4", - expect: Some(vec!["./A/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": "./A/*/*.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #5", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/*.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #5", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/*.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./lib/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #6", - expect: Some(vec!["./browser/foo/bar.js"]), - exports_field: exports_field(json!({ - "./lib/*/bar.js": { - "browser": [ - "./browser/*/bar.js" - ] - }, - "./dist/*/bar.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./lib/foo/bar.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #6", - expect: Some(vec!["./browser/foo.js"]), - exports_field: exports_field(json!({ - "./lib/*/bar.js": { - "browser": [ - "./browser/*/bar.js" - ] - }, - "./dist/*/bar.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./dist/foo/bar.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #7", - expect: Some(vec!["./browser/foo/default.js"]), - exports_field: exports_field(json!({ - "./lib/*/bar.js": { - "browser": [ - "./browser/*/bar.js" - ] - }, - "./dist/*/bar.js": { - "node": "./*.js", - "default": "./browser/*/default.js" - } - })), - request: "./dist/foo/bar.js", - condition_names: vec!["default"], - }, - TestCase { - name: "wildcard pattern #8", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": "./A/*/*/*.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #9", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": [ - "./A/*/*/*.js", - "./B/*/*/*.js" - ] - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "wildcard pattern #9", - expect: Some(vec!["./B/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": [ - "./B/*/*/*.js" - ] - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #10", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/foo-*/c.js": "./A/*/*/*.js" - })), - request: "./a/foo-b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #11", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*-foo/c.js": "./A/*/*/*.js" - })), - request: "./a/b-foo/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #12", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/foo-*-foo/c.js": "./A/*/*/*.js" - })), - request: "./a/foo-b-foo/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #13", - expect: Some(vec!["./A/b/c/d.js"]), - exports_field: exports_field(json!({ - "./a/foo-*-foo/c.js": "./A/b/c/d.js" - })), - request: "./a/foo-b-foo/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #14", - expect: Some(vec!["./A/b/c/*.js"]), - exports_field: exports_field(json!({ - "./a/foo-foo/c.js": "./A/b/c/*.js" - })), - request: "./a/foo-foo/c.js", - condition_names: vec![], - }, - ]; - - for case in test_cases { - let resolved = Resolver::new(ResolveOptions { - condition_names: case - .condition_names - .iter() - .map(ToString::to_string) - .collect::>(), - ..ResolveOptions::default() - }) - .package_exports_resolve( - Path::new(""), - case.request, - &case.exports_field, - &mut Ctx::default(), - ) - .map(|p| p.map(|p| p.to_path_buf())); - if let Some(expect) = case.expect { - if expect.is_empty() { - assert!( - matches!(resolved, Err(ResolveError::PackagePathNotExported(_, _))), - "{} {:?}", - &case.name, - &resolved - ); - } else { - for expect in expect { - assert_eq!(resolved, Ok(Some(Path::new(expect).normalize())), "{}", &case.name); - } - } - } else { - assert!(resolved.is_err(), "{} {resolved:?}", &case.name); - } - } -} diff --git a/src/tests/extension_alias.rs b/src/tests/extension_alias.rs deleted file mode 100644 index 86afab73..00000000 --- a/src/tests/extension_alias.rs +++ /dev/null @@ -1,66 +0,0 @@ -//! - -use crate::{ResolveError, ResolveOptions, Resolver}; - -#[test] -fn extension_alias() { - let f = super::fixture().join("extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - extension_alias: vec![ - (".js".into(), vec![".ts".into(), ".js".into()]), - (".mjs".into(), vec![".mts".into()]), - ], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should alias fully specified file", f.clone(), "./index.js", f.join("index.ts")), - ("should alias fully specified file when there are two alternatives", f.clone(), "./dir/index.js", f.join("dir/index.ts")), - ("should also allow the second alternative", f.clone(), "./dir2/index.js", f.join("dir2/index.js")), - ("should support alias option without an array", f.clone(), "./dir2/index.mjs", f.join("dir2/index.mts")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } - - #[rustfmt::skip] - let fail = [ - ("should not allow to fallback to the original extension or add extensions", f, "./index.mjs"), - ]; - - for (comment, path, request) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!(resolution, Err(ResolveError::ExtensionAlias), "{comment} {path:?} {request}"); - } -} - -// should not apply extension alias to extensions or mainFiles field -#[test] -fn not_apply_to_extension_nor_main_files() { - let f = super::fixture().join("extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - extension_alias: vec![(".js".into(), vec![])], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("directory", f.clone(), "./dir2", "dir2/index.js"), - ("file", f.clone(), "./dir2/index", "dir2/index.js"), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - let expected = f.join(expected); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} diff --git a/src/tests/extensions.rs b/src/tests/extensions.rs deleted file mode 100644 index 1ebd86f4..00000000 --- a/src/tests/extensions.rs +++ /dev/null @@ -1,125 +0,0 @@ -//! - -use crate::{EnforceExtension, Resolution, ResolveContext, ResolveError, ResolveOptions, Resolver}; -use rustc_hash::FxHashSet; - -#[test] -fn extensions() { - let f = super::fixture().join("extensions"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".ts".into(), ".js".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve according to order of provided extensions", "./foo", "foo.ts"), - ("should resolve according to order of provided extensions (dir index)", "./dir", "dir/index.ts"), - ("should resolve according to main field in module root", ".", "index.js"), - // This is a core module - // ("should resolve single file module before directory", "module", "node_modules/module.js"), - ("should resolve trailing slash directory before single file", "module/", "node_modules/module/index.ts"), - ]; - - for (comment, request, expected_path) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - let expected = f.join(expected_path); - assert_eq!(resolved_path, Ok(expected), "{comment} {request} {expected_path}"); - } - - #[rustfmt::skip] - let fail = [ - ("not resolve to file when request has a trailing slash (relative)", "./foo.js/", "./foo.js/".into()) - ]; - - for (comment, request, expected_error) in fail { - let resolution = resolver.resolve(&f, request); - let error = ResolveError::NotFound(expected_error); - assert_eq!(resolution, Err(error), "{comment} {request} {resolution:?}"); - } -} - -// should default enforceExtension to true when extensions includes an empty string -#[test] -fn default_enforce_extension() { - let f = super::fixture().join("extensions"); - - let mut ctx = ResolveContext::default(); - let resolved = Resolver::new(ResolveOptions { - extensions: vec![".ts".into(), String::new(), ".js".into()], - ..ResolveOptions::default() - }) - .resolve_with_context(&f, "./foo", &mut ctx); - - assert_eq!(resolved.map(Resolution::into_path_buf), Ok(f.join("foo.ts"))); - assert_eq!( - ctx.file_dependencies, - FxHashSet::from_iter([f.join("foo.ts"), f.join("package.json")]) - ); - assert!(ctx.missing_dependencies.is_empty()); -} - -// should respect enforceExtension when extensions includes an empty string -#[test] -fn respect_enforce_extension() { - let f = super::fixture().join("extensions"); - - let mut ctx = ResolveContext::default(); - let resolved = Resolver::new(ResolveOptions { - enforce_extension: EnforceExtension::Disabled, - extensions: vec![".ts".into(), String::new(), ".js".into()], - ..ResolveOptions::default() - }) - .resolve_with_context(&f, "./foo", &mut ctx); - - assert_eq!(resolved.map(Resolution::into_path_buf), Ok(f.join("foo.ts"))); - assert_eq!( - ctx.file_dependencies, - FxHashSet::from_iter([f.join("foo.ts"), f.join("package.json")]) - ); - assert_eq!(ctx.missing_dependencies, FxHashSet::from_iter([f.join("foo")])); -} - -#[test] -fn multi_dot_extension() { - let f = super::fixture().join("extensions"); - - let resolver = Resolver::new(ResolveOptions { - // Test for `.d.ts`, not part of enhanced-resolve. - extensions: vec![".a.b.c".into(), ".d.ts".into(), ".ts".into(), ".js".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve according to order of provided extensions", "./foo", "foo.ts"), - ("should resolve file with extension", "./app.module", "app.module.js") - ]; - - for (comment, request, expected_path) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - let expected = f.join(expected_path); - assert_eq!(resolved_path, Ok(expected), "{comment} {request} {expected_path}"); - } - - #[rustfmt::skip] - let fail = [ - ("not resolve to file", "./index.", "./index.".into()) - ]; - - for (comment, request, expected_error) in fail { - let resolution = resolver.resolve(&f, request); - let error = ResolveError::NotFound(expected_error); - assert_eq!(resolution, Err(error), "{comment} {request} {resolution:?}"); - } -} - -#[test] -#[should_panic = "All extensions must start with a leading dot"] -fn without_leading_dot() { - Resolver::new(ResolveOptions { - extensions: vec!["ts".into(), "js".into()], - ..ResolveOptions::default() - }); -} diff --git a/src/tests/fallback.rs b/src/tests/fallback.rs deleted file mode 100644 index 3da2d767..00000000 --- a/src/tests/fallback.rs +++ /dev/null @@ -1,100 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/fallback.test.js - -#[test] -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -fn fallback() { - use super::memory_fs::MemoryFS; - use crate::{AliasValue, ResolveError, ResolveOptions, ResolverGeneric}; - use std::path::{Path, PathBuf}; - - let f = Path::new("/"); - - let file_system = MemoryFS::new(&[ - ("/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", ""), - ]); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - fallback: vec![ - ("aliasA".into(), vec![AliasValue::Path("a".into())]), - ("b$".into(), vec![AliasValue::Path("a/index".into())]), - ("c$".into(), vec![AliasValue::Path("/a/index".into())]), - ( - "multiAlias".into(), - vec![ - AliasValue::Path("b".into()), - AliasValue::Path("c".into()), - AliasValue::Path("d".into()), - AliasValue::Path("e".into()), - AliasValue::Path("a".into()), - ], - ), - ("recursive".into(), vec![AliasValue::Path("recursive/dir".into())]), - ("/d/dir".into(), vec![AliasValue::Path("/c/dir".into())]), - ("/d/index.js".into(), vec![AliasValue::Path("/c/index".into())]), - ("ignored".into(), vec![AliasValue::Ignore]), - ("node:path".into(), vec![AliasValue::Ignore]), - ], - modules: vec!["/".into()], - ..ResolveOptions::default() - }, - ); - - #[rustfmt::skip] - let pass = [ - ("should resolve a not aliased module 1", "a", "/a/index"), - ("should resolve a not aliased module 2", "a/index", "/a/index"), - ("should resolve a not aliased module 3", "a/dir", "/a/dir/index"), - ("should resolve a not aliased module 4", "a/dir/index", "/a/dir/index"), - ("should resolve an fallback module 1", "aliasA", "/a/index"), - ("should resolve an fallback module 2", "aliasA/index", "/a/index"), - ("should resolve an fallback module 3", "aliasA/dir", "/a/dir/index"), - ("should resolve an fallback module 4", "aliasA/dir/index", "/a/dir/index"), - ("should resolve a recursive aliased module 1", "recursive", "/recursive/index"), - ("should resolve a recursive aliased module 2", "recursive/index", "/recursive/index"), - ("should resolve a recursive aliased module 3", "recursive/dir", "/recursive/dir/index"), - ("should resolve a recursive aliased module 4", "recursive/dir/index", "/recursive/dir/index"), - ("should resolve a recursive aliased module 5", "recursive/file", "/recursive/dir/file"), - ("should resolve a file aliased module with a query 1", "b?query", "/b/index?query"), - ("should resolve a file aliased module with a query 2", "c?query", "/c/index?query"), - ("should resolve a path in a file aliased module 1", "b/index", "/b/index"), - ("should resolve a path in a file aliased module 2", "b/dir", "/b/dir/index"), - ("should resolve a path in a file aliased module 3", "b/dir/index", "/b/dir/index"), - ("should resolve a path in a file aliased module 4", "c/index", "/c/index"), - ("should resolve a path in a file aliased module 5", "c/dir", "/c/dir/index"), - ("should resolve a path in a file aliased module 6", "c/dir/index", "/c/dir/index"), - ("should resolve a file in multiple aliased dirs 1", "multiAlias/dir/file", "/e/dir/file"), - ("should resolve a file in multiple aliased dirs 2", "multiAlias/anotherDir", "/e/anotherDir/index"), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - - #[rustfmt::skip] - let ignore = [ - ("should resolve an ignore module", "ignored", ResolveError::Ignored(f.join("ignored"))), - ("should resolve node: builtin module", "node:path", ResolveError::Ignored(PathBuf::from("/node:path"))), - ]; - - for (comment, request, expected) in ignore { - let resolution = resolver.resolve(f, request); - assert_eq!(resolution, Err(expected), "{comment} {request}"); - } -} diff --git a/src/tests/full_specified.rs b/src/tests/full_specified.rs deleted file mode 100644 index a70c0191..00000000 --- a/src/tests/full_specified.rs +++ /dev/null @@ -1,113 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/fullSpecified.test.js - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows { - use std::path::PathBuf; - - use crate::{AliasValue, ResolveOptions, ResolverGeneric}; - - use super::super::memory_fs::MemoryFS; - - fn file_system() -> MemoryFS { - MemoryFS::new(&[ - ("/a/node_modules/package1/index.js", ""), - ("/a/node_modules/package1/file.js", ""), - ("/a/node_modules/package2/package.json", r#"{"main":"a"}"#), - ("/a/node_modules/package2/a.js", ""), - ("/a/node_modules/package3/package.json", r#"{"main":"dir"}"#), - ("/a/node_modules/package3/dir/index.js", ""), - ("/a/node_modules/package4/package.json", r#"{"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", ""), - ]) - } - - #[test] - fn test() { - let file_system = file_system(); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - alias: vec![ - ("alias1".into(), vec![AliasValue::from("/a/abc")]), - ("alias2".into(), vec![AliasValue::from("/a")]), - ], - alias_fields: vec![vec!["browser".into()]], - fully_specified: true, - ..ResolveOptions::default() - }, - ); - - let failing_resolves = [ - ("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"), - ]; - - for (comment, request) in failing_resolves { - let resolution = resolver.resolve("/a", request); - assert!(resolution.is_err(), "{comment} {request}"); - } - - let successful_resolves = [ - ("fully relative", "./abc.js", "/a/abc.js"), - ("fully absolute", "/a/abc.js", "/a/abc.js"), - ("fully relative in package", "package1/file.js", "/a/node_modules/package1/file.js"), - ("extensions in mainFiles", "package1", "/a/node_modules/package1/index.js"), - ("extensions in mainFields", "package2", "/a/node_modules/package2/a.js"), - ("extensions in alias", "alias1", "/a/abc.js"), - ("directories in alias", "alias2", "/a/index.js"), - ("directories in packages", "package3", "/a/node_modules/package3/dir/index.js"), - ("extensions in aliasFields", "package4/a.js", "/a/node_modules/package4/b.js"), - ]; - - for (comment, request, expected) in successful_resolves { - let resolution = resolver.resolve("/a", request).map(|r| r.full_path()); - assert_eq!(resolution, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - } - - #[test] - #[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. - fn resolve_to_context() { - let file_system = file_system(); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - alias: vec![ - ("alias1".into(), vec![AliasValue::from("/a/abc")]), - ("alias2".into(), vec![AliasValue::from("/a")]), - ], - alias_fields: vec![vec!["browser".into()]], - fully_specified: true, - resolve_to_context: true, - ..ResolveOptions::default() - }, - ); - - let successful_resolves = [ - ("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", "/a/node_modules/package3/dir"), - ]; - - for (comment, request, expected) in successful_resolves { - let resolution = resolver.resolve("/a", request).map(|r| r.full_path()); - assert_eq!(resolution, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - } -} diff --git a/src/tests/imports_field.rs b/src/tests/imports_field.rs deleted file mode 100644 index c928627a..00000000 --- a/src/tests/imports_field.rs +++ /dev/null @@ -1,1320 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/importsField.test.js -//! -//! The huge imports field test cases are at the bottom of this file. - -use serde_json::json; - -use crate::{Ctx, JSONMap, PathUtil, ResolveError, ResolveOptions, Resolver}; -use std::path::Path; - -#[test] -fn test_simple() { - let f = super::fixture().join("imports-field"); - let f2 = super::fixture().join("imports-exports-wildcard/node_modules/m/"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve using imports field instead of self-referencing", f.clone(), "#imports-field", f.join("b.js")), - ("should resolve using imports field instead of self-referencing for a subpath", f.join("dir"), "#imports-field", f.join("b.js")), - ("should resolve package #1", f.clone(), "#a/dist/main.js", f.join("node_modules/a/lib/lib2/main.js")), - ("should resolve package #3", f.clone(), "#ccc/index.js", f.join("node_modules/c/index.js")), - ("should resolve package #4", f.clone(), "#c", f.join("node_modules/c/index.js")), - ("should resolve with wildcard pattern", f2.clone(), "#internal/i.js", f2.join("src/internal/i.js")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } - - // Note added: - // * should resolve absolute path as an imports field target - // * should log the correct info - - #[rustfmt::skip] - let fail = [ - ("should disallow resolve out of package scope", f.clone(), "#b", ResolveError::InvalidPackageTarget("../b.js".to_string(), "#b".to_string(), f.join("package.json"))), - ("should resolve package #2", f.clone(), "#a", ResolveError::PackageImportNotDefined("#a".to_string(), f.join("package.json"))), - ]; - - for (comment, path, request, error) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!(resolution, Err(error), "{comment} {path:?} {request}"); - } -} - -#[test] -fn shared_resolvers() { - let f = super::fixture().join("imports-field"); - - // field name #1 - let resolver1 = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - imports_fields: vec![vec!["imports".into()]], - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - let resolved_path = resolver1.resolve(&f, "#imports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("b.js"))); - - // field name #2 - let resolver2 = resolver1.clone_with_options(ResolveOptions { - imports_fields: vec![vec!["other".into(), "imports".into()]], - ..ResolveOptions::default() - }); - - let resolved_path = resolver2.resolve(&f, "#b").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("a.js"))); -} - -// Small script for generating the test cases from enhanced_resolve -// for (c of testCases) { -// console.log("TestCase {") -// console.log(`name: ${JSON.stringify(c.name)},`) -// if (c.expect instanceof Error) { -// console.log(`expect: None,`) -// } else { -// console.log(`expect: Some(vec!${JSON.stringify(c.expect)}),`) -// } -// console.log(`imports_field: imports_field(json!(${JSON.stringify(c.suite[0], null, 2)})),`) -// console.log(`request: "${c.suite[1]}",`) -// console.log(`condition_names: vec!${JSON.stringify(c.suite[2])},`) -// console.log("},") -// } - -struct TestCase { - name: &'static str, - expect: Option>, - imports_field: JSONMap, - request: &'static str, - condition_names: Vec<&'static str>, -} - -#[allow(clippy::needless_pass_by_value)] -fn imports_field(value: serde_json::Value) -> JSONMap { - let s = serde_json::to_string(&value).unwrap(); - serde_json::from_str(&s).unwrap() -} - -#[test] -fn test_cases() { - let test_cases = [ - TestCase { - name: "sample #1", - expect: Some(vec!["./dist/test/file.js"]), - imports_field: imports_field(json!({ - "#abc/": { - "import": [ - "./dist/", - "./src/" - ], - "webpack": "./wp/" - }, - "#abc": "./main.js" - })), - request: "#abc/test/file.js", - condition_names: vec!["import", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "sample #1", - expect: Some(vec!["./src/test/file.js"]), - imports_field: imports_field(json!({ - "#abc/": { - "import": [ - "./src/" - ], - "webpack": "./wp/" - }, - "#abc": "./main.js" - })), - request: "#abc/test/file.js", - condition_names: vec!["import", "webpack"], - }, - TestCase { - name: "sample #2", - expect: Some(vec!["./data/timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#1/timezones/": "./data/timezones/" - })), - request: "#1/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #3", - expect: Some(vec!["./data/timezones/timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#aaa/": "./data/timezones/", - "#a/": "./data/timezones/" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #4", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/lib/": { - "browser": [ - "./browser/" - ] - }, - "#a/dist/index.js": { - "node": "./index.js" - } - })), - request: "#a/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #5", - expect: Some(vec!["./browser/index.js"]), - imports_field: imports_field(json!({ - "#a/lib/": { - "browser": [ - "./browser/" - ] - }, - "#a/dist/index.js": { - "node": "./index.js", - "default": "./browser/index.js" - } - })), - request: "#a/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #6", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/dist/a": "./dist/index.js" - })), - request: "#a/dist/aaa", - condition_names: vec![], - }, - TestCase { - name: "sample #7", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/a/a/": "./dist/index.js" - })), - request: "#a/a/a", - condition_names: vec![], - }, - TestCase { - name: "sample #8", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": "./index.js" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #9", - expect: Some(vec!["./main.js"]), - imports_field: imports_field(json!({ - "#a/index.js": "./main.js" - })), - request: "#a/index.js", - condition_names: vec![], - }, - TestCase { - name: "sample #10", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #11", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/bar#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #12", - expect: Some(vec!["./ok.js#abc"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/ok.js#abc", - condition_names: vec![], - }, - TestCase { - name: "sample #13", - expect: Some(vec!["./ok.js?abc"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/ok.js?abc", - condition_names: vec![], - }, - TestCase { - name: "sample #14", - expect: Some(vec!["./🎉.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/🎉.js", - condition_names: vec![], - }, - TestCase { - name: "sample #15", - expect: Some(vec!["./%F0%9F%8E%89.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/%F0%9F%8E%89.js", - condition_names: vec![], - }, - TestCase { - name: "sample #16", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/🎉", - condition_names: vec![], - }, - TestCase { - name: "sample #17", - expect: Some(vec!["./other.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/%F0%9F%8E%89", - condition_names: vec![], - }, - TestCase { - name: "sample #18", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/module", - condition_names: vec![], - }, - TestCase { - name: "sample #19", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/module#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #20", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/module?foo", - condition_names: vec![], - }, - TestCase { - name: "sample #21", - expect: Some(vec!["./d?e?f"]), - imports_field: imports_field(json!({ - "#a/a?b?c/": "./" - })), - request: "#a/a?b?c/d?e?f", - condition_names: vec![], - }, - TestCase { - name: "sample #22", - // We throw InvalidPackageTarget - expect: None, - // expect: Some(vec!["/user/a/index"]), - imports_field: imports_field(json!({ - "#a/": "/user/a/" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #1", - expect: Some(vec!["./A/b/d.js"]), - imports_field: imports_field(json!({ - "#a/": "./A/", - "#a/b/c": "./c.js" - })), - request: "#a/b/d.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #2", - expect: Some(vec!["./A/c.js"]), - imports_field: imports_field(json!({ - "#a/": "./A/", - "#a/b": "./b.js" - })), - request: "#a/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #3", - expect: Some(vec!["./A/b/c/d.js"]), - imports_field: imports_field(json!({ - "#a/": "./A/", - "#a/b/c/d": "./c.js" - })), - request: "#a/b/c/d.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #1", - expect: Some(vec!["./dist/index.js"]), - imports_field: imports_field(json!({ - "#a": "./dist/index.js" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #2", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": "./" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #3", - expect: Some(vec!["./dist/a.js"]), - imports_field: imports_field(json!({ - "#a/": "./dist/", - "#a/index.js": "./dist/a.js" - })), - request: "#a/index.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #4", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "./browser/" - ] - }, - "#a/index.js": { - "browser": "./index.js" - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #5", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "./browser/" - ] - }, - "#a/index.js": { - "node": "./node.js" - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #6", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: "#a", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #7", - expect: Some(vec!["./src/index.js"]), // `enhanced_resolve` is `None` - imports_field: imports_field(json!({ - "#a": { - "default": "./src/index.js", - "browser": "./index.js", - "node": "./src/node/index.js" - } - })), - request: "#a", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #8", - expect: Some(vec!["./src/index.js"]), - imports_field: imports_field(json!({ - "#a": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #9", - expect: Some(vec!["./index"]), - imports_field: imports_field(json!({ - "#a": "./index" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #10", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/index": "./index.js" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #11", - // We throw InvalidPackageTarget - // expect: Some(vec!["b"]), - expect: None, - imports_field: imports_field(json!({ - "#a": "b" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #12", - // We throw InvalidPackageTarget - // expect: Some(vec!["b/index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "b/" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #13", - // We throw InvalidPackageTarget - // expect: Some(vec!["b#anotherhashishere"]), - expect: None, - imports_field: imports_field(json!({ - "#a?q=a#hashishere": "b#anotherhashishere" - })), - request: "#a?q=a#hashishere", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #1", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #2", - expect: Some(vec!["./import.mjs"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec!["import"], - }, - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./require.js"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./import.mjs"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./require.js"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": [ - "./require.js" - ] - }, - { - "import": [ - "./import.mjs", - "#b/import.js" - ] - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./import.mjs"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "./import.mjs", - "#b/import.js" - ] - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "#b/import.js" - ] - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "mapping to a folder root #1", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#timezones": "./data/timezones/" - })), - request: "#timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #2", - expect: None, - imports_field: imports_field(json!({ - "#timezones/": "./data/timezones" - })), - request: "#timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #3", - expect: Some(vec!["./data/timezones/pdt/index.mjs"]), - imports_field: imports_field(json!({ - "#timezones/pdt/": "./data/timezones/pdt/" - })), - request: "#timezones/pdt/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #4", - expect: Some(vec!["./timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#a/": "./timezones/" - })), - request: "#a/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #5", - expect: Some(vec!["./timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#a/": "./" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #6", - expect: None, - imports_field: imports_field(json!({ - "#a/": "." - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #7", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": "./" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #1", - expect: Some(vec!["./lib/index.mjs"]), - imports_field: imports_field(json!({ - "#a/": "./", - "#a/dist/": "./lib/" - })), - request: "#a/dist/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #2", - expect: Some(vec!["./dist/utils/index.js"]), - imports_field: imports_field(json!({ - "#a/dist/utils/": "./dist/utils/", - "#a/dist/": "./lib/" - })), - request: "#a/dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #3", - expect: Some(vec!["./dist/utils/index.js"]), - imports_field: imports_field(json!({ - "#a/dist/utils/index.js": "./dist/utils/index.js", - "#a/dist/utils/": "./dist/utils/index.mjs", - "#a/dist/": "./lib/" - })), - request: "#a/dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #4", - expect: Some(vec!["./lib/index.mjs"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./browser/" - }, - "#a/dist/": "./lib/" - })), - request: "#a/dist/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #1", - // This behaves differently from enhanced_resolve, because `lodash/` is an an InvalidPackageConfig - // expect: Some(vec!["lodash/index.js"]), - expect: Some(vec!["./utils/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "conditional mapping folder #1", - expect: Some(vec!["./utils/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #2", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./node/" - ] - } - })), - request: "#a/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "conditional mapping folder #3", - expect: Some(vec!["./wpk/index.mjs"]), - imports_field: imports_field(json!({ - "#a/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils/" - ] - } - })), - request: "#a/index.mjs", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "incorrect exports field #1", - // We throw `PackageImportNotDefined` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "/utils/": "./a/" - })), - request: "#a/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #2", - // We throw `PackageImportNotDefined` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "/utils/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#a/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #3", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index": "./a/index.js" - })), - request: "#a/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #4", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index.mjs": "./a/index.js" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #5", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "#a/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #6", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index.mjs": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "#a/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #1", - // We don't throw in `package_imports_exports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": "./a/" - })), - request: "/utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect request #2", - // We don't throw in `package_imports_exports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #3", - // We don't throw in `package_imports_exports_resolve`, it's thrown in `package_imports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #4", - // We don't throw in `package_imports_exports_resolve`, it's thrown in `package_imports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#/", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #5", - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#a/", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #1", - // expect: Some(vec!["./dist/index"]), - expect: Some(vec!["dist/index"]), - imports_field: imports_field(json!({ - "#a/../../utils/": "./dist/" - })), - request: "#a/../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #2", - // We throw InvalidPackageTarget - // expect: Some(vec!["./dist/../../utils/index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "./dist/" - })), - request: "#a/../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #3", - // We throw InvalidPackageTarget - // expect: Some(vec!["../src/index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "../src/" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #4", - // We throw InvalidPackageTarget - // expect: Some(vec!["./utils/../../../index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": { - "browser": "./utils/../../../" - } - })), - request: "#a/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #1", - // expect: Some(vec!["moment/node_modules/lodash/dist/index.js"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": { - "browser": "moment/node_modules/" - } - })), - request: "#a/lodash/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #2", - // We throw InvalidPackageTarget - // expect: Some(vec!["../node_modules/lodash/dist/index.js"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "../node_modules/" - })), - request: "#a/lodash/dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "nested mapping #1", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": "./", - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./node/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "nested mapping #3", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["webpack"], - }, - TestCase { - name: "nested mapping #4", - // We throw NotFound - // expect: Some(vec!["moment/node/index.js"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "moment/node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["node", "browser"], - }, - TestCase { - name: "nested mapping #5", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "node"], - }, - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./node/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - TestCase { - name: "nested mapping #7", - expect: Some(vec!["./y.js"]), - imports_field: imports_field(json!({ - "#a": { - "abc": { - "def": "./x.js" - }, - "ghi": "./y.js" - } - })), - request: "#a", - condition_names: vec!["abc", "ghi"], - }, - TestCase { - name: "nested mapping #8", - // We throw PackageImportNotDefined - // expect: Some(vec![]), - expect: None, - imports_field: imports_field(json!({ - "#a": { - "abc": { - "def": "./x.js", - "default": [] - }, - "ghi": "./y.js" - } - })), - request: "#a", - condition_names: vec!["abc", "ghi"], - }, - ]; - - for case in test_cases { - let resolved = Resolver::default() - .package_imports_exports_resolve( - case.request, - &case.imports_field, - Path::new(""), - true, - &case.condition_names.iter().map(ToString::to_string).collect::>(), - &mut Ctx::default(), - ) - .map(|p| p.map(|p| p.to_path_buf())); - if let Some(expect) = case.expect { - if expect.is_empty() { - assert!(matches!(resolved, Ok(None)), "{} {:?}", &case.name, &resolved); - } else { - for expect in expect { - assert_eq!(resolved, Ok(Some(Path::new(expect).normalize())), "{}", &case.name); - } - } - } else { - assert!(resolved.is_err(), "{} {resolved:?}", &case.name); - } - } -} diff --git a/src/tests/incorrect_description_file.rs b/src/tests/incorrect_description_file.rs deleted file mode 100644 index a5c81796..00000000 --- a/src/tests/incorrect_description_file.rs +++ /dev/null @@ -1,62 +0,0 @@ -//! - -use rustc_hash::FxHashSet; - -use crate::{JSONError, Resolution, ResolveContext, ResolveError, ResolveOptions, Resolver}; - -// should not resolve main in incorrect description file #1 -#[test] -fn incorrect_description_file_1() { - let f = super::fixture().join("incorrect-package"); - let mut ctx = ResolveContext::default(); - let resolution = Resolver::default().resolve_with_context(f.join("pack1"), ".", &mut ctx); - let error = ResolveError::JSON(JSONError { - path: f.join("pack1/package.json"), - message: String::from("EOF while parsing a value at line 3 column 0"), - line: 3, - column: 0, - }); - assert_eq!(resolution, Err(error)); - assert_eq!(ctx.file_dependencies, FxHashSet::from_iter([f.join("pack1/package.json")])); - assert!(ctx.missing_dependencies.is_empty()); -} - -// should not resolve main in incorrect description file #2 -#[test] -fn incorrect_description_file_2() { - let f = super::fixture().join("incorrect-package"); - let resolution = Resolver::default().resolve(f.join("pack2"), "."); - let error = ResolveError::JSON(JSONError { - path: f.join("pack2/package.json"), - message: String::from("EOF while parsing a value at line 1 column 0"), - line: 1, - column: 0, - }); - assert_eq!(resolution, Err(error)); -} - -// should not resolve main in incorrect description file #3 -#[test] -fn incorrect_description_file_3() { - let f = super::fixture().join("incorrect-package"); - let resolution = Resolver::default().resolve(f.join("pack2"), "."); - assert!(resolution.is_err()); -} - -// `enhanced_resolve` does not have this test case -#[test] -fn no_description_file() { - let f = super::fixture_root().join("enhanced_resolve"); - - // has description file - let resolver = Resolver::default(); - assert_eq!( - resolver.resolve(&f, ".").map(Resolution::into_path_buf), - Ok(f.join("lib/index.js")) - ); - - // without description file - let resolver = - Resolver::new(ResolveOptions { description_files: vec![], ..ResolveOptions::default() }); - assert_eq!(resolver.resolve(&f, "."), Err(ResolveError::NotFound(".".into()))); -} diff --git a/src/tests/main_field.rs b/src/tests/main_field.rs deleted file mode 100644 index 3cadc8ce..00000000 --- a/src/tests/main_field.rs +++ /dev/null @@ -1,24 +0,0 @@ -//! Not part of enhanced_resolve's test suite - -use crate::{ResolveOptions, Resolver}; - -#[test] -fn test() { - let f = super::fixture().join("restrictions"); - - let resolver1 = Resolver::new(ResolveOptions { - main_fields: vec!["style".into()], - ..ResolveOptions::default() - }); - - let resolution = resolver1.resolve(&f, "pck2").map(|r| r.full_path()); - assert_eq!(resolution, Ok(f.join("node_modules/pck2/index.css"))); - - let resolver2 = resolver1.clone_with_options(ResolveOptions { - main_fields: vec!["module".into(), "main".into()], - ..ResolveOptions::default() - }); - - let resolution = resolver2.resolve(&f, "pck2").map(|r| r.full_path()); - assert_eq!(resolution, Ok(f.join("node_modules/pck2/module.js"))); -} diff --git a/src/tests/memory_fs.rs b/src/tests/memory_fs.rs deleted file mode 100644 index e4116609..00000000 --- a/src/tests/memory_fs.rs +++ /dev/null @@ -1,74 +0,0 @@ -use std::{ - io, - path::{Path, PathBuf}, -}; - -use crate::{FileMetadata, FileSystem}; - -#[derive(Default)] -pub struct MemoryFS { - fs: vfs::MemoryFS, -} - -impl MemoryFS { - /// # Panics - /// - /// * Fails to create directory - /// * Fails to write file - #[allow(dead_code)] - pub fn new(data: &[(&'static str, &'static str)]) -> Self { - let mut fs = Self { fs: vfs::MemoryFS::default() }; - for (path, content) in data { - fs.add_file(Path::new(path), content); - } - fs - } - - #[allow(dead_code)] - pub fn add_file(&mut self, path: &Path, content: &str) { - use vfs::FileSystem; - let fs = &mut self.fs; - // Create all parent directories - for path in path.ancestors().collect::>().iter().rev() { - let path = path.to_string_lossy(); - if !fs.exists(path.as_ref()).unwrap() { - fs.create_dir(path.as_ref()).unwrap(); - } - } - // Create file - let mut file = fs.create_file(path.to_string_lossy().as_ref()).unwrap(); - file.write_all(content.as_bytes()).unwrap(); - } -} - -impl FileSystem for MemoryFS { - fn read_to_string(&self, path: &Path) -> io::Result { - use vfs::FileSystem; - let mut file = self - .fs - .open_file(path.to_string_lossy().as_ref()) - .map_err(|err| io::Error::new(io::ErrorKind::NotFound, err))?; - let mut buffer = String::new(); - file.read_to_string(&mut buffer).unwrap(); - Ok(buffer) - } - - fn metadata(&self, path: &Path) -> io::Result { - use vfs::FileSystem; - let metadata = self - .fs - .metadata(path.to_string_lossy().as_ref()) - .map_err(|err| io::Error::new(io::ErrorKind::NotFound, err))?; - let is_file = metadata.file_type == vfs::VfsFileType::File; - let is_dir = metadata.file_type == vfs::VfsFileType::Directory; - Ok(FileMetadata::new(is_file, is_dir, false)) - } - - fn symlink_metadata(&self, path: &Path) -> io::Result { - self.metadata(path) - } - - fn canonicalize(&self, _path: &Path) -> io::Result { - Err(io::Error::new(io::ErrorKind::NotFound, "not a symlink")) - } -} diff --git a/src/tests/missing.rs b/src/tests/missing.rs deleted file mode 100644 index 4bf611ef..00000000 --- a/src/tests/missing.rs +++ /dev/null @@ -1,106 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/missing.test.js - -use normalize_path::NormalizePath; - -use crate::{AliasValue, ResolveContext, ResolveOptions, Resolver}; - -#[test] -fn test() { - let f = super::fixture(); - - let data = [ - ( - "./missing-file", - vec![f.join("missing-file"), f.join("missing-file.js"), f.join("missing-file.node")], - ), - ( - "missing-module", - vec![ - f.join("node_modules/missing-module"), - f.parent().unwrap().join("node_modules"), // enhanced-resolve is "node_modules/missing-module" - ], - ), - ( - "missing-module/missing-file", - vec![ - f.join("node_modules/missing-module"), - // f.parent().unwrap().join("node_modules/missing-module"), // we don't report this - ], - ), - ( - "m1/missing-file", - vec![ - f.join("node_modules/m1/missing-file"), - f.join("node_modules/m1/missing-file.js"), - f.join("node_modules/m1/missing-file.node"), - // f.parent().unwrap().join("node_modules/m1"), // we don't report this - ], - ), - ( - "m1/", - vec![ - f.join("node_modules/m1/index"), - f.join("node_modules/m1/index.js"), - f.join("node_modules/m1/index.json"), - f.join("node_modules/m1/index.node"), - ], - ), - ("m1/a", vec![f.join("node_modules/m1/a")]), - ]; - - let resolver = Resolver::default(); - - for (specifier, missing_dependencies) in data { - let mut ctx = ResolveContext::default(); - let _ = resolver.resolve_with_context(&f, specifier, &mut ctx); - - for path in ctx.file_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - } - - for path in missing_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - assert!( - ctx.missing_dependencies.contains(&path), - "{specifier}: {path:?} not in {:?}", - &ctx.missing_dependencies - ); - } - } -} - -#[test] -fn alias_and_extensions() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias: vec![ - ( - "@scope-js/package-name/dir$".into(), - vec![AliasValue::Path(f.join("foo/index.js").to_string_lossy().to_string())], - ), - ( - "react-dom".into(), - vec![AliasValue::Path(f.join("foo/index.js").to_string_lossy().to_string())], - ), - ], - extensions: vec![".server.ts".into()], - - ..ResolveOptions::default() - }); - - let mut ctx = ResolveContext::default(); - let _ = resolver.resolve_with_context(&f, "@scope-js/package-name/dir/router", &mut ctx); - let _ = resolver.resolve_with_context(&f, "react-dom/client", &mut ctx); - - for path in ctx.file_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - } - - for path in ctx.missing_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - if let Some(path) = path.parent() { - assert!(!path.is_file(), "{path:?} must not be a file"); - } - } -} diff --git a/src/tests/mod.rs b/src/tests/mod.rs deleted file mode 100644 index 94e6bd86..00000000 --- a/src/tests/mod.rs +++ /dev/null @@ -1,49 +0,0 @@ -mod alias; -mod browser_field; -mod builtins; -mod dependencies; -mod exports_field; -mod extension_alias; -mod extensions; -mod fallback; -mod full_specified; -mod imports_field; -mod incorrect_description_file; -mod main_field; -mod memory_fs; -mod missing; -mod resolve; -mod restrictions; -mod roots; -mod scoped_packages; -mod simple; -mod symlink; -mod tsconfig_paths; -mod tsconfig_project_references; - -use crate::Resolver; -use std::{env, path::PathBuf, sync::Arc, thread}; - -pub fn fixture_root() -> PathBuf { - env::current_dir().unwrap().join("fixtures") -} - -pub fn fixture() -> PathBuf { - fixture_root().join("enhanced_resolve").join("test").join("fixtures") -} - -#[test] -fn threaded_environment() { - let cwd = env::current_dir().unwrap(); - let resolver = Arc::new(Resolver::default()); - for _ in 0..2 { - _ = thread::spawn({ - let cwd = cwd.clone(); - let resolver = Arc::clone(&resolver); - move || { - _ = resolver.resolve(cwd, "."); - } - }) - .join(); - } -} diff --git a/src/tests/resolve.rs b/src/tests/resolve.rs deleted file mode 100644 index f2dbb88e..00000000 --- a/src/tests/resolve.rs +++ /dev/null @@ -1,119 +0,0 @@ -//! - -use crate::{ResolveError, ResolveOptions, Resolver}; - -#[test] -fn resolve() { - let f = super::fixture(); - - let resolver = Resolver::default(); - - let main1_js_path = f.join("main1.js").to_string_lossy().to_string(); - - #[rustfmt::skip] - let pass = [ - ("absolute path", f.clone(), main1_js_path.as_str(), f.join("main1.js")), - ("file with .js", f.clone(), "./main1.js", f.join("main1.js")), - ("file without extension", f.clone(), "./main1", f.join("main1.js")), - ("another file with .js", f.clone(), "./a.js", f.join("a.js")), - ("another file without extension", f.clone(), "./a", f.join("a.js")), - ("file in module with .js", f.clone(), "m1/a.js", f.join("node_modules/m1/a.js")), - ("file in module without extension", f.clone(), "m1/a", f.join("node_modules/m1/a.js")), - ("another file in module without extension", f.clone(), "complexm/step1", f.join("node_modules/complexm/step1.js")), - ("from submodule to file in sibling module", f.join("node_modules/complexm"), "m2/b.js", f.join("node_modules/m2/b.js")), - ("from nested directory to overwritten file in module", f.join("multiple_modules"), "m1/a.js", f.join("multiple_modules/node_modules/m1/a.js")), - ("from nested directory to not overwritten file in module", f.join("multiple_modules"), "m1/b.js", f.join("node_modules/m1/b.js")), - ("file with query", f.clone(), "./main1.js?query", f.join("main1.js?query")), - ("file with fragment", f.clone(), "./main1.js#fragment", f.join("main1.js#fragment")), - ("file with fragment and query", f.clone(), "./main1.js#fragment?query", f.join("main1.js#fragment?query")), - ("file with query and fragment", f.clone(), "./main1.js?#fragment", f.join("main1.js?#fragment")), - - ("file with query (unicode)", f.clone(), "./测试.js?query", f.join("测试.js?query")), - ("file with fragment (unicode)", f.clone(), "./测试.js#fragment", f.join("测试.js#fragment")), - ("file with fragment and query (unicode)", f.clone(), "./测试.js#fragment?query", f.join("测试.js#fragment?query")), - ("file with query and fragment (unicode)", f.clone(), "./测试.js?#fragment", f.join("测试.js?#fragment")), - - ("file in module with query", f.clone(), "m1/a?query", f.join("node_modules/m1/a.js?query")), - ("file in module with fragment", f.clone(), "m1/a#fragment", f.join("node_modules/m1/a.js#fragment")), - ("file in module with fragment and query", f.clone(), "m1/a#fragment?query", f.join("node_modules/m1/a.js#fragment?query")), - ("file in module with query and fragment", f.clone(), "m1/a?#fragment", f.join("node_modules/m1/a.js?#fragment")), - ("file in module with query and fragment", f.clone(), "m1/a?#fragment", f.join("node_modules/m1/a.js?#fragment")), - ("differ between directory and file, resolve file", f.clone(), "./dirOrFile", f.join("dirOrFile.js")), - ("differ between directory and file, resolve directory", f.clone(), "./dirOrFile/", f.join("dirOrFile/index.js")), - ("find node_modules outside of node_modules", f.join("browser-module/node_modules"), "m1/a", f.join("node_modules/m1/a.js")), - ("don't crash on main field pointing to self", f.clone(), "./main-field-self", f.join("./main-field-self/index.js")), - ("don't crash on main field pointing to self (2)", f.clone(), "./main-field-self2", f.join("./main-field-self2/index.js")), - // enhanced-resolve has `#` prepended with a `\0`, they are removed from the - // following 3 expected test results. - // See https://github.com/webpack/enhanced-resolve#escaping - ("handle fragment edge case (no fragment)", f.clone(), "./no#fragment/#/#", f.join("no#fragment/#/#.js")), - ("handle fragment edge case (fragment)", f.clone(), "./no#fragment/#/", f.join("no.js#fragment/#/")), - ("handle fragment escaping", f.clone(), "./no\0#fragment/\0#/\0##fragment", f.join("no#fragment/#/#.js#fragment")), - - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn issue238_resolve() { - let f = super::fixture().join("issue-238"); - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into(), ".jsx".into(), ".ts".into(), ".tsx".into()], - modules: vec!["src/a".into(), "src/b".into(), "src/common".into(), "node_modules".into()], - ..ResolveOptions::default() - }); - let resolved_path = - resolver.resolve(f.join("src/common"), "config/myObjectFile").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("src/common/config/myObjectFile.js")),); -} - -#[test] -fn prefer_relative() { - let f = super::fixture(); - - let resolver = - Resolver::new(ResolveOptions { prefer_relative: true, ..ResolveOptions::default() }); - - #[rustfmt::skip] - let pass = [ - ("should correctly resolve with preferRelative 1", "main1.js", f.join("main1.js")), - ("should correctly resolve with preferRelative 2", "m1/a.js", f.join("node_modules/m1/a.js")), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } -} - -#[test] -fn resolve_to_context() { - let f = super::fixture(); - let resolver = - Resolver::new(ResolveOptions { resolve_to_context: true, ..ResolveOptions::default() }); - - #[rustfmt::skip] - let data = [ - ("context for fixtures", f.clone(), "./", f.clone()), - ("context for fixtures/lib", f.clone(), "./lib", f.join("lib")), - ("context for fixtures with ..", f.clone(), "./lib/../../fixtures/./lib/..", f.clone()), - ("context for fixtures with query", f.clone(), "./?query", f.clone().with_file_name("fixtures?query")), - ]; - - for (comment, path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn resolve_hash_as_module() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions::default()); - let resolution = resolver.resolve(f, "#a"); - assert_eq!(resolution, Err(ResolveError::NotFound("#a".into()))); -} diff --git a/src/tests/restrictions.rs b/src/tests/restrictions.rs deleted file mode 100644 index 5ba56596..00000000 --- a/src/tests/restrictions.rs +++ /dev/null @@ -1,25 +0,0 @@ -//! - -use crate::{ResolveError, ResolveOptions, Resolver, Restriction}; - -// TODO: regex -// * should respect RegExp restriction -// * should try to find alternative #1 -// * should try to find alternative #2 -// * should try to find alternative #3 - -// should respect string restriction -#[test] -fn restriction1() { - let fixture = super::fixture(); - let f = fixture.join("restrictions"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - restrictions: vec![Restriction::Path(f.clone())], - ..ResolveOptions::default() - }); - - let resolution = resolver.resolve(&f, "pck2"); - assert_eq!(resolution, Err(ResolveError::Restriction(fixture.join("c.js"), f))); -} diff --git a/src/tests/roots.rs b/src/tests/roots.rs deleted file mode 100644 index b50e2a07..00000000 --- a/src/tests/roots.rs +++ /dev/null @@ -1,92 +0,0 @@ -//! - -use std::path::PathBuf; - -use crate::{AliasValue, ResolveError, ResolveOptions, Resolver}; - -fn dirname() -> PathBuf { - super::fixture_root().join("enhanced_resolve").join("test") -} - -#[test] -fn roots() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - alias: vec![("foo".into(), vec![AliasValue::from("/fixtures")])], - roots: vec![dirname(), f.clone()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should respect roots option", "/fixtures/b.js", f.join("b.js")), - ("should try another root option, if it exists", "/b.js", f.join("b.js")), - ("should respect extension", "/fixtures/b", f.join("b.js")), - ("should resolve in directory", "/fixtures/extensions/dir", f.join("extensions/dir/index.js")), - ("should respect aliases", "foo/b", f.join("b.js")), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } - - #[rustfmt::skip] - let fail = [ - ("should not work with relative path", "fixtures/b.js", ResolveError::NotFound("fixtures/b.js".into())) - ]; - - for (comment, request, expected) in fail { - let resolution = resolver.resolve(&f, request); - assert_eq!(resolution, Err(expected), "{comment} {request}"); - } -} - -#[test] -fn resolve_to_context() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - roots: vec![dirname(), f.clone()], - resolve_to_context: true, - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f, "/fixtures/lib").map(|r| r.full_path()); - let expected = f.join("lib"); - assert_eq!(resolved_path, Ok(expected)); -} - -#[test] -fn prefer_absolute() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - alias: vec![("foo".into(), vec![AliasValue::from("/fixtures")])], - roots: vec![dirname(), f.clone()], - prefer_absolute: true, - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve an absolute path (prefer absolute)", f.join("b.js").to_string_lossy().to_string(), f.join("b.js")), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(&f, &request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } -} - -#[test] -fn roots_fall_through() { - let f = super::fixture(); - let absolute_path = f.join("roots_fall_through/index.js"); - let specifier = absolute_path.to_string_lossy(); - let resolution = Resolver::new(ResolveOptions::default().with_root(&f)).resolve(&f, &specifier); - assert_eq!( - resolution.map(super::super::resolution::Resolution::into_path_buf), - Ok(absolute_path) - ); -} diff --git a/src/tests/scoped_packages.rs b/src/tests/scoped_packages.rs deleted file mode 100644 index 8258f00f..00000000 --- a/src/tests/scoped_packages.rs +++ /dev/null @@ -1,25 +0,0 @@ -//! - -use crate::{ResolveOptions, Resolver}; - -#[test] -fn scoped_packages() { - let f = super::fixture().join("scoped"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("main field should work", f.clone(), "@scope/pack1", f.join("./node_modules/@scope/pack1/main.js")), - ("browser field should work", f.clone(), "@scope/pack2", f.join("./node_modules/@scope/pack2/main.js")), - ("folder request should work", f.clone(), "@scope/pack2/lib", f.join("./node_modules/@scope/pack2/lib/index.js")) - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} diff --git a/src/tests/simple.rs b/src/tests/simple.rs deleted file mode 100644 index 08e1238a..00000000 --- a/src/tests/simple.rs +++ /dev/null @@ -1,68 +0,0 @@ -//! - -use std::env; - -use crate::Resolver; - -#[test] -fn simple() { - // mimic `enhanced-resolve/test/simple.test.js` - let dirname = env::current_dir().unwrap().join("fixtures"); - let f = dirname.join("enhanced_resolve/test"); - - let resolver = Resolver::default(); - - let data = [ - ("direct", f.clone(), "../lib/index"), - ("as directory", f, ".."), - ("as module", dirname.clone(), "./enhanced_resolve"), - ]; - - for (comment, path, request) in data { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - let expected = dirname.join("enhanced_resolve/lib/index.js"); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn dashed_name() { - let f = super::fixture(); - - let resolver = Resolver::default(); - - let data = [ - (f.clone(), "dash", f.join("node_modules/dash/index.js")), - (f.clone(), "dash-name", f.join("node_modules/dash-name/index.js")), - (f.join("node_modules/dash"), "dash", f.join("node_modules/dash/index.js")), - (f.join("node_modules/dash"), "dash-name", f.join("node_modules/dash-name/index.js")), - (f.join("node_modules/dash-name"), "dash", f.join("node_modules/dash/index.js")), - (f.join("node_modules/dash-name"), "dash-name", f.join("node_modules/dash-name/index.js")), - ]; - - for (path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{path:?} {request}"); - } -} - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows { - use super::super::memory_fs::MemoryFS; - - use crate::ResolveOptions; - - #[test] - fn no_package() { - use crate::ResolverGeneric; - use std::path::Path; - let f = Path::new("/"); - let file_system = MemoryFS::new(&[]); - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions::default(), - ); - let resolved_path = resolver.resolve(f, "package"); - assert!(resolved_path.is_err()); - } -} diff --git a/src/tests/symlink.rs b/src/tests/symlink.rs deleted file mode 100644 index 7589b560..00000000 --- a/src/tests/symlink.rs +++ /dev/null @@ -1,121 +0,0 @@ -use std::{fs, io, path::Path}; - -use crate::{ResolveOptions, Resolver}; - -#[derive(Debug, Clone, Copy)] -enum FileType { - File, - Dir, -} - -#[allow(unused_variables)] -fn symlink, Q: AsRef>( - original: P, - link: Q, - file_type: FileType, -) -> io::Result<()> { - #[cfg(target_family = "unix")] - { - std::os::unix::fs::symlink(original, link) - } - - #[cfg(target_family = "windows")] - match file_type { - FileType::File => std::os::windows::fs::symlink_file(original, link), - FileType::Dir => std::os::windows::fs::symlink_dir(original, link), - } -} - -fn init(dirname: &Path, temp_path: &Path) -> io::Result<()> { - if temp_path.exists() { - _ = fs::remove_dir_all(temp_path); - } - fs::create_dir(temp_path)?; - symlink(dirname.join("../lib/index.js"), temp_path.join("test"), FileType::File)?; - symlink(dirname.join("../lib"), temp_path.join("test2"), FileType::Dir)?; - fs::remove_file(temp_path.join("test"))?; - fs::remove_file(temp_path.join("test2"))?; - fs::remove_dir(temp_path) -} - -fn create_symlinks(dirname: &Path, temp_path: &Path) -> io::Result<()> { - fs::create_dir(temp_path).unwrap(); - symlink( - dirname.join("../lib/index.js").canonicalize().unwrap(), - temp_path.join("index.js"), - FileType::File, - )?; - symlink(dirname.join("../lib").canonicalize().unwrap(), temp_path.join("lib"), FileType::Dir)?; - symlink(dirname.join("..").canonicalize().unwrap(), temp_path.join("this"), FileType::Dir)?; - symlink(temp_path.join("this"), temp_path.join("that"), FileType::Dir)?; - symlink(Path::new("../../lib/index.js"), temp_path.join("node.relative.js"), FileType::File)?; - symlink( - Path::new("./node.relative.js"), - temp_path.join("node.relative.sym.js"), - FileType::File, - )?; - Ok(()) -} - -fn cleanup_symlinks(temp_path: &Path) { - _ = fs::remove_dir_all(temp_path); -} - -#[test] -fn test() -> io::Result<()> { - let root = super::fixture_root().join("enhanced_resolve"); - let dirname = root.join("test"); - let temp_path = dirname.join("temp"); - if !temp_path.exists() { - let is_admin = init(&dirname, &temp_path).is_ok(); - if !is_admin { - return Ok(()); - } - if let Err(err) = create_symlinks(&dirname, &temp_path) { - cleanup_symlinks(&temp_path); - return Err(err); - } - } - - let resolver_without_symlinks = - Resolver::new(ResolveOptions { symlinks: false, ..ResolveOptions::default() }); - let resolver_with_symlinks = Resolver::default(); - - #[rustfmt::skip] - let pass = [ - ("with a symlink to a file", temp_path.clone(), "./index.js"), - ("with a relative symlink to a file", temp_path.clone(), "./node.relative.js"), - ("with a relative symlink to a symlink to a file", temp_path.clone(), "./node.relative.sym.js"), - ("with a symlink to a directory 1", temp_path.clone(), "./lib/index.js"), - ("with a symlink to a directory 2", temp_path.clone(), "./this/lib/index.js"), - ("with multiple symlinks in the path 1", temp_path.clone(), "./this/test/temp/index.js"), - ("with multiple symlinks in the path 2", temp_path.clone(), "./this/test/temp/lib/index.js"), - ("with multiple symlinks in the path 3", temp_path.clone(), "./this/test/temp/this/lib/index.js"), - ("with a symlink to a directory 2 (chained)", temp_path.clone(), "./that/lib/index.js"), - ("with multiple symlinks in the path 1 (chained)", temp_path.clone(), "./that/test/temp/index.js"), - ("with multiple symlinks in the path 2 (chained)", temp_path.clone(), "./that/test/temp/lib/index.js"), - ("with multiple symlinks in the path 3 (chained)", temp_path.clone(), "./that/test/temp/that/lib/index.js"), - ("with symlinked directory as context 1", temp_path.join( "lib"), "./index.js"), - ("with symlinked directory as context 2", temp_path.join( "this"), "./lib/index.js"), - ("with symlinked directory as context and in path", temp_path.join( "this"), "./test/temp/lib/index.js"), - ("with symlinked directory in context path", temp_path.join( "this/lib"), "./index.js"), - ("with symlinked directory in context path and symlinked file", temp_path.join( "this/test"), "./temp/index.js"), - ("with symlinked directory in context path and symlinked directory", temp_path.join( "this/test"), "./temp/lib/index.js"), - ("with symlinked directory as context 2 (chained)", temp_path.join( "that"), "./lib/index.js"), - ("with symlinked directory as context and in path (chained)", temp_path.join( "that"), "./test/temp/lib/index.js"), - ("with symlinked directory in context path (chained)", temp_path.join( "that/lib"), "./index.js"), - ("with symlinked directory in context path and symlinked file (chained)", temp_path.join( "that/test"), "./temp/index.js"), - ("with symlinked directory in context path and symlinked directory (chained)", temp_path.join( "that/test"), "./temp/lib/index.js") - ]; - - for (comment, path, request) in pass { - let filename = resolver_with_symlinks.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(filename, Ok(root.join("lib/index.js")), "{comment:?}"); - - let resolved_path = - resolver_without_symlinks.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(path.join(request))); - } - - Ok(()) -} diff --git a/src/tests/tsconfig_paths.rs b/src/tests/tsconfig_paths.rs deleted file mode 100644 index 26935b5c..00000000 --- a/src/tests/tsconfig_paths.rs +++ /dev/null @@ -1,507 +0,0 @@ -//! tests for tsconfig-paths -//! -//! Fixtures copied from . - -use std::path::{Path, PathBuf}; - -use crate::{ - ResolveError, ResolveOptions, Resolver, TsConfig, TsconfigOptions, TsconfigReferences, -}; - -// -#[test] -fn tsconfig() { - let f = super::fixture_root().join("tsconfig"); - - #[rustfmt::skip] - let pass = [ - (f.clone(), None, "ts-path", f.join("foo.js")), - (f.join("nested"), None, "ts-path", f.join("nested/test.js")), - (f.join("cases/index"), None, "foo", f.join("node_modules/tsconfig-index/foo.js")), - // This requires reading package.json.tsconfig field - // (f.join("cases/field"), "foo", f.join("node_modules/tsconfig-field/foo.js")) - (f.join("cases/exports"), None, "foo", f.join("node_modules/tsconfig-exports/foo.js")), - (f.join("cases/extends-extension"), None, "foo", f.join("cases/extends-extension/foo.js")), - (f.join("cases/extends-extensionless"), None, "foo", f.join("node_modules/tsconfig-field/foo.js")), - (f.join("cases/extends-paths"), Some("src"), "@/index", f.join("cases/extends-paths/src/index.js")), - (f.join("cases/extends-multiple"), None, "foo", f.join("cases/extends-multiple/foo.js")), - ]; - - for (dir, subdir, request, expected) in pass { - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: dir.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - let path = subdir.map_or(dir.clone(), |subdir| dir.join(subdir)); - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{request} {path:?}"); - } - - #[rustfmt::skip] - let data = [ - (f.join("node_modules/tsconfig-not-used"), "ts-path", Ok(f.join("foo.js"))), - ]; - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - for (path, request, expected) in data { - let resolution = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolution, expected, "{path:?} {request}"); - } -} - -#[test] -fn tsconfig_fallthrough() { - let f = super::fixture_root().join("tsconfig"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "/"); - assert_eq!(resolved_path, Err(ResolveError::NotFound("/".into()))); -} - -#[test] -fn json_with_comments() { - let f = super::fixture_root().join("tsconfig/cases/trailing-comma"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "foo").map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(f.join("bar.js"))); -} - -// -#[test] -fn test_paths() { - let path = Path::new("/foo/tsconfig.json"); - let mut tsconfig_json = serde_json::json!({ - "compilerOptions": { - "paths": { - "jquery": ["node_modules/jquery/dist/jquery"], - "*": ["generated/*"], - "bar/*": ["test/*"], - "bar/baz/*": ["baz/*", "yo/*"], - "@/components/*": ["components/*"], - "url": ["node_modules/my-url"], - } - } - }) - .to_string(); - let tsconfig = TsConfig::parse(true, path, &mut tsconfig_json).unwrap(); - - let data = [ - ("jquery", vec!["/foo/node_modules/jquery/dist/jquery"]), - ("test", vec!["/foo/generated/test"]), - ("test/hello", vec!["/foo/generated/test/hello"]), - ("bar/hi", vec!["/foo/test/hi"]), - ("bar/baz/hi", vec!["/foo/baz/hi", "/foo/yo/hi"]), - ("@/components/button", vec!["/foo/components/button"]), - ("./jquery", vec![]), - ("url", vec!["/foo/node_modules/my-url"]), - ]; - - for (specifier, expected) in data { - let paths = tsconfig.resolve_path_alias(specifier); - let expected = expected.into_iter().map(PathBuf::from).collect::>(); - assert_eq!(paths, expected, "{specifier}"); - } -} - -// -#[test] -fn test_base_url() { - let path = Path::new("/foo/tsconfig.json"); - let mut tsconfig_json = serde_json::json!({ - "compilerOptions": { - "baseUrl": "./src" - } - }) - .to_string(); - let tsconfig = TsConfig::parse(true, path, &mut tsconfig_json).unwrap(); - - let data = [ - ("foo", vec!["/foo/src/foo"]), - ("components/button", vec!["/foo/src/components/button"]), - ("./jquery", vec![]), - ]; - - for (specifier, expected) in data { - let paths = tsconfig.resolve_path_alias(specifier); - let expected = expected.into_iter().map(PathBuf::from).collect::>(); - assert_eq!(paths, expected, "{specifier}"); - } -} - -// -#[test] -fn test_paths_and_base_url() { - let path = Path::new("/foo/tsconfig.json"); - let mut tsconfig_json = serde_json::json!({ - "compilerOptions": { - "baseUrl": "./src", - "paths": { - "*": ["generated/*"], - "bar/*": ["test/*"], - "bar/baz/*": ["baz/*", "yo/*"], - "@/components/*": ["components/*"] - } - } - }) - .to_string(); - let tsconfig = TsConfig::parse(true, path, &mut tsconfig_json).unwrap(); - - let data = [ - ("test", vec!["/foo/src/generated/test", "/foo/src/test"]), - ("test/hello", vec!["/foo/src/generated/test/hello", "/foo/src/test/hello"]), - ("bar/hi", vec!["/foo/src/test/hi", "/foo/src/bar/hi"]), - ("bar/baz/hi", vec!["/foo/src/baz/hi", "/foo/src/yo/hi", "/foo/src/bar/baz/hi"]), - ("@/components/button", vec!["/foo/src/components/button", "/foo/src/@/components/button"]), - ("./jquery", vec![]), - ]; - - for (specifier, expected) in data { - let paths = tsconfig.resolve_path_alias(specifier); - let expected = expected.into_iter().map(PathBuf::from).collect::>(); - assert_eq!(paths, expected, "{specifier}"); - } -} - -// Template variable ${configDir} for substitution of config files directory path -// https://github.com/microsoft/TypeScript/pull/58042 -#[test] -fn test_template_variable() { - let f = super::fixture_root().join("tsconfig"); - let f2 = f.join("cases").join("paths_template_variable"); - - #[rustfmt::skip] - let pass = [ - (f2.clone(), "tsconfig1.json", "foo", f2.join("foo.js")), - (f2.clone(), "tsconfig2.json", "foo", f2.join("foo.js")), - (f.clone(), "tsconfig_template_variable.json", "foo", f.join("foo.js")), - ]; - - for (dir, tsconfig, request, expected) in pass { - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: dir.join(tsconfig), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&dir, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{request} {tsconfig} {dir:?}"); - } -} - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows_test { - use std::path::{Path, PathBuf}; - - use crate::{ - ResolveError, ResolveOptions, ResolverGeneric, TsconfigOptions, TsconfigReferences, - }; - - use super::super::memory_fs::MemoryFS; - - struct OneTest { - name: &'static str, - tsconfig: String, - package_json: Option<(PathBuf, String)>, - main_fields: Option>, - existing_files: Vec<&'static str>, - requested_module: &'static str, - expected_path: &'static str, - extensions: Vec, - } - - impl Default for OneTest { - fn default() -> Self { - Self { - name: "", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/*": ["location/*"] - } - } - }) - .to_string(), - package_json: None, - main_fields: None, - existing_files: vec![], - requested_module: "", - expected_path: "", - extensions: vec![ - ".js".into(), - ".json".into(), - ".node".into(), - ".ts".into(), - ".tsx".into(), - ], - } - } - } - - impl OneTest { - fn resolver(&self, root: &Path) -> ResolverGeneric { - let mut file_system = MemoryFS::default(); - - file_system.add_file(&root.join("tsconfig.json"), &self.tsconfig); - if let Some((path, package_json)) = &self.package_json { - file_system.add_file(&root.join(path).join("package.json"), package_json); - } - for path in &self.existing_files { - file_system.add_file(Path::new(path), ""); - } - - let mut options = ResolveOptions { - extensions: self.extensions.clone(), - tsconfig: Some(TsconfigOptions { - config_file: root.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }; - if let Some(main_fields) = &self.main_fields { - options.main_fields.clone_from(main_fields); - } - - ResolverGeneric::::new_with_file_system(file_system, options) - } - } - - // Path matching tests from tsconfig-paths - // * - // * - #[test] - fn match_path() { - let pass = [ - OneTest { - name: "should locate path that matches with star and exists", - existing_files: vec!["/root/location/mylib/index.ts"], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve to correct path when many are specified", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/*": ["foo1/*", "foo2/*", "location/*", "foo3/*"], - } - } - }) - .to_string(), - existing_files: vec!["/root/location/mylib/index.ts"], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should locate path that matches with star and prioritize pattern with longest prefix", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "*": ["location/*"], - "lib/*": ["location/*"], - } - } - }) - .to_string(), - existing_files: vec![ - "/root/location/lib/mylib/index.ts", - "/root/location/mylib/index.ts", - ], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should locate path that matches with star and exists with extension", - existing_files: vec![ - "/root/location/mylib.myext", - ], - requested_module: "lib/mylib", - extensions: vec![".js".into(), ".myext".into()], - expected_path: "/root/location/mylib.myext", - ..OneTest::default() - }, - OneTest { - name: "should resolve request with extension specified", - existing_files: vec![ - "/root/location/test.jpg", - ], - requested_module: "lib/test.jpg", - expected_path: "/root/location/test.jpg", - ..OneTest::default() - }, - OneTest { - name: "should locate path that matches without star and exists", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/foo": ["location/foo"] - } - } - }) - .to_string(), - existing_files: vec![ - "/root/location/foo.ts", - ], - requested_module: "lib/foo", - expected_path: "/root/location/foo.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve to parent folder when filename is in subfolder", - existing_files: vec![ - "/root/location/mylib/index.ts", - ], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve from main field in package.json", - package_json: Some((PathBuf::from("/root/location/mylib"), serde_json::json!({ - "main": "./kalle.ts" - }).to_string())), - existing_files: vec![ - "/root/location/mylib/kalle.ts", - ], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/kalle.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve from main field in package.json (js)", - package_json: Some((PathBuf::from("/root/location/mylib.js"), serde_json::json!({ - "main": "./kalle.js" - }).to_string())), - existing_files: vec![ - "/root/location/mylib.js/kalle.js", - ], - extensions: vec![".ts".into(), ".js".into()], - requested_module: "lib/mylib.js", - expected_path: "/root/location/mylib.js/kalle.js", - ..OneTest::default() - }, - OneTest { - name: "should resolve from list of fields by priority in package.json", - main_fields: Some(vec!["missing".into(), "browser".into(), "main".into()]), - package_json: Some((PathBuf::from("/root/location/mylibjs"), serde_json::json!({ - "main": "./main.js", - "browser": "./browser.js" - }).to_string())), - existing_files: vec![ - "/root/location/mylibjs/main.js", - "/root/location/mylibjs/browser.js", - ], - extensions: vec![".ts".into(), ".js".into()], - requested_module: "lib/mylibjs", - expected_path: "/root/location/mylibjs/browser.js", - ..OneTest::default() - }, -OneTest { - name: "should ignore field mappings to missing files in package.json", - main_fields: Some(vec!["browser".into(), "main".into()]), - package_json: Some((PathBuf::from("/root/location/mylibjs"), serde_json::json!({ - "main": "./kalle.js", - "browser": "./nope.js" - }).to_string())), - existing_files: vec![ - "/root/location/mylibjs/kalle.js", - ], - extensions: vec![".ts".into(), ".js".into()], - requested_module: "lib/mylibjs", - expected_path: "/root/location/mylibjs/kalle.js", - ..OneTest::default() - }, - // Tests that are not applicable: - // name: "should resolve nested main fields" - // name: "should ignore advanced field mappings in package.json" - // name: "should resolve to with the help of baseUrl when not explicitly set" - // name: "should not resolve with the help of baseUrl when asked not to" - // name: "should resolve main file with cjs file extension" - OneTest { - name: "should resolve .ts from .js alias", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "@/*": ["src/*"] - } - } - }).to_string(), - existing_files: vec![ - "/root/src/foo.ts", - ], - requested_module: "@/foo", // original data was "@/foo.ts" but I don't get why it is the case? - expected_path: "/root/src/foo.ts", // original data was "/root/src/foo" - ..OneTest::default() - }, - ]; - - let root = PathBuf::from("/root"); - - for test in pass { - let resolved_path = - test.resolver(&root).resolve(&root, test.requested_module).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(PathBuf::from(test.expected_path)), "{}", test.name); - } - - let fail = [ - OneTest { - name: "should not locate path that does not match", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/*": ["location/*"] - } - } - }) - .to_string(), - existing_files: vec!["/root/location/mylib"], - requested_module: "lib/mylibjs", - ..OneTest::default() - }, - OneTest { - name: "should not resolve typings file (index.d.ts)", - existing_files: vec!["/root/location/mylib/index.d.ts"], - requested_module: "lib/mylib", - ..OneTest::default() - }, - ]; - - for test in fail { - let resolved_path = - test.resolver(&root).resolve(&root, test.requested_module).map(|f| f.full_path()); - assert_eq!( - resolved_path, - Err(ResolveError::NotFound(test.requested_module.into())), - "{}", - test.name - ); - } - } -} diff --git a/src/tests/tsconfig_project_references.rs b/src/tests/tsconfig_project_references.rs deleted file mode 100644 index b552fefe..00000000 --- a/src/tests/tsconfig_project_references.rs +++ /dev/null @@ -1,101 +0,0 @@ -//! Tests for tsconfig project references - -use crate::{ResolveError, ResolveOptions, Resolver, TsconfigOptions, TsconfigReferences}; - -#[test] -fn auto() { - let f = super::fixture_root().join("tsconfig/cases/project_references"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("app"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - // Test normal paths alias - (f.join("app"), "@/index.ts", f.join("app/aliased/index.ts")), - (f.join("app"), "@/../index.ts", f.join("app/index.ts")), - // Test project reference - (f.join("project_a"), "@/index.ts", f.join("project_a/aliased/index.ts")), - (f.join("project_b/src"), "@/index.ts", f.join("project_b/src/aliased/index.ts")), - // Does not have paths alias - (f.join("project_a"), "./index.ts", f.join("project_a/index.ts")), - (f.join("project_c"), "./index.ts", f.join("project_c/index.ts")), - // Template variable - { - let dir = f.parent().unwrap().join("paths_template_variable"); - (dir.clone(), "foo", dir.join("foo.js")) - } - ]; - - for (path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{request} {path:?}"); - } -} - -#[test] -fn disabled() { - let f = super::fixture_root().join("tsconfig/cases/project_references"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("app"), - references: TsconfigReferences::Disabled, - }), - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - // Test normal paths alias - (f.join("app"), "@/index.ts", Ok(f.join("app/aliased/index.ts"))), - (f.join("app"), "@/../index.ts", Ok(f.join("app/index.ts"))), - // Test project reference - (f.join("project_a"), "@/index.ts", Err(ResolveError::NotFound("@/index.ts".into()))), - (f.join("project_b/src"), "@/index.ts", Err(ResolveError::NotFound("@/index.ts".into()))), - // Does not have paths alias - (f.join("project_a"), "./index.ts", Ok(f.join("project_a/index.ts"))), - (f.join("project_c"), "./index.ts", Ok(f.join("project_c/index.ts"))), - ]; - - for (path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, expected, "{request} {path:?}"); - } -} - -#[test] -fn manual() { - let f = super::fixture_root().join("tsconfig/cases/project_references"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("app"), - references: TsconfigReferences::Paths(vec!["../project_a/conf.json".into()]), - }), - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - // Test normal paths alias - (f.join("app"), "@/index.ts", Ok(f.join("app/aliased/index.ts"))), - (f.join("app"), "@/../index.ts", Ok(f.join("app/index.ts"))), - // Test project reference - (f.join("project_a"), "@/index.ts", Ok(f.join("project_a/aliased/index.ts"))), - (f.join("project_b/src"), "@/index.ts", Err(ResolveError::NotFound("@/index.ts".into()))), - // Does not have paths alias - (f.join("project_a"), "./index.ts", Ok(f.join("project_a/index.ts"))), - (f.join("project_c"), "./index.ts", Ok(f.join("project_c/index.ts"))), - ]; - - for (path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, expected, "{request} {path:?}"); - } -} diff --git a/src/tsconfig.rs b/src/tsconfig.rs deleted file mode 100644 index aa00f6e4..00000000 --- a/src/tsconfig.rs +++ /dev/null @@ -1,212 +0,0 @@ -use std::{ - path::{Path, PathBuf}, - sync::Arc, -}; - -use serde::Deserialize; -use typescript_tsconfig_json::{CompilerOptionsPathsMap, ExtendsField}; - -use crate::PathUtil; - -#[derive(Debug, Deserialize)] -#[serde(rename_all = "camelCase")] -pub struct TsConfig { - /// Whether this is the caller tsconfig. - /// Used for final template variable substitution when all configs are extended and merged. - #[serde(skip)] - root: bool, - - /// Path to `tsconfig.json`. Contains the `tsconfig.json` filename. - #[serde(skip)] - path: PathBuf, - - #[serde(default)] - pub extends: Option, - - #[serde(default)] - pub compiler_options: CompilerOptions, - - /// Bubbled up project references with a reference to their tsconfig. - #[serde(default)] - pub references: Vec, -} - -/// Compiler Options -/// -/// -#[derive(Debug, Default, Deserialize)] -#[serde(rename_all = "camelCase")] -pub struct CompilerOptions { - base_url: Option, - - /// Path aliases - paths: Option, - - /// The actual base for where path aliases are resolved from. - #[serde(skip)] - paths_base: PathBuf, -} - -/// Project Reference -/// -/// -#[derive(Debug, Deserialize)] -pub struct ProjectReference { - /// The path property of each reference can point to a directory containing a tsconfig.json file, - /// or to the config file itself (which may have any name). - pub path: PathBuf, - - /// Reference to the resolved tsconfig - #[serde(skip)] - pub tsconfig: Option>, -} - -impl TsConfig { - pub fn parse(root: bool, path: &Path, json: &mut str) -> Result { - _ = json_strip_comments::strip(json); - let mut tsconfig: Self = serde_json::from_str(json)?; - tsconfig.root = root; - tsconfig.path = path.to_path_buf(); - let directory = tsconfig.directory().to_path_buf(); - if let Some(base_url) = tsconfig.compiler_options.base_url { - tsconfig.compiler_options.base_url = Some(directory.normalize_with(base_url)); - } - if tsconfig.compiler_options.paths.is_some() { - tsconfig.compiler_options.paths_base = - tsconfig.compiler_options.base_url.as_ref().map_or(directory, Clone::clone); - } - Ok(tsconfig) - } - - pub fn build(mut self) -> Self { - if self.root { - let dir = self.directory().to_path_buf(); - // Substitute template variable in `tsconfig.compilerOptions.paths` - if let Some(paths) = &mut self.compiler_options.paths { - for paths in paths.values_mut() { - for path in paths { - Self::substitute_template_variable(&dir, path); - } - } - } - } - self - } - - /// Directory to `tsconfig.json` - /// - /// # Panics - /// - /// * When the `tsconfig.json` path is misconfigured. - pub fn directory(&self) -> &Path { - debug_assert!(self.path.file_name().is_some()); - self.path.parent().unwrap() - } - - pub fn extend_tsconfig(&mut self, tsconfig: &Self) { - let compiler_options = &mut self.compiler_options; - if compiler_options.paths.is_none() { - compiler_options.paths_base = compiler_options - .base_url - .as_ref() - .map_or_else(|| tsconfig.compiler_options.paths_base.clone(), Clone::clone); - compiler_options.paths.clone_from(&tsconfig.compiler_options.paths); - } - if compiler_options.base_url.is_none() { - compiler_options.base_url.clone_from(&tsconfig.compiler_options.base_url); - } - } - - pub fn resolve(&self, path: &Path, specifier: &str) -> Vec { - if path.starts_with(self.base_path()) { - let paths = self.resolve_path_alias(specifier); - if !paths.is_empty() { - return paths; - } - } - for tsconfig in self.references.iter().filter_map(|reference| reference.tsconfig.as_ref()) { - if path.starts_with(tsconfig.base_path()) { - return tsconfig.resolve_path_alias(specifier); - } - } - vec![] - } - - // Copied from parcel - // - pub fn resolve_path_alias(&self, specifier: &str) -> Vec { - if specifier.starts_with(|s| s == '/' || s == '.') { - return vec![]; - } - - let base_url_iter = self - .compiler_options - .base_url - .as_ref() - .map_or_else(Vec::new, |base_url| vec![base_url.normalize_with(specifier)]); - - let Some(paths_map) = &self.compiler_options.paths else { - return base_url_iter; - }; - - let paths = paths_map.get(specifier).map_or_else( - || { - let mut longest_prefix_length = 0; - let mut longest_suffix_length = 0; - let mut best_key: Option<&String> = None; - - for key in paths_map.keys() { - if let Some((prefix, suffix)) = key.split_once('*') { - if (best_key.is_none() || prefix.len() > longest_prefix_length) - && specifier.starts_with(prefix) - && specifier.ends_with(suffix) - { - longest_prefix_length = prefix.len(); - longest_suffix_length = suffix.len(); - best_key.replace(key); - } - } - } - - best_key.and_then(|key| paths_map.get(key)).map_or_else(Vec::new, |paths| { - paths - .iter() - .map(|path| { - path.replace( - '*', - &specifier[longest_prefix_length - ..specifier.len() - longest_suffix_length], - ) - }) - .collect::>() - }) - }, - Clone::clone, - ); - - paths - .into_iter() - .map(|p| self.compiler_options.paths_base.normalize_with(p)) - .chain(base_url_iter) - .collect() - } - - fn base_path(&self) -> &Path { - self.compiler_options - .base_url - .as_ref() - .map_or_else(|| self.directory(), |path| path.as_ref()) - } - - /// Template variable `${configDir}` for substitution of config files directory path - /// - /// NOTE: All tests cases are just a head replacement of `${configDir}`, so we are constrained as such. - /// - /// See - fn substitute_template_variable(directory: &Path, path: &mut String) { - const TEMPLATE_VARIABLE: &str = "${configDir}/"; - if let Some(stripped_path) = path.strip_prefix(TEMPLATE_VARIABLE) { - *path = directory.join(stripped_path).to_string_lossy().to_string(); - } - } -} diff --git a/tests/integration_test.rs b/tests/integration_test.rs deleted file mode 100644 index d369413f..00000000 --- a/tests/integration_test.rs +++ /dev/null @@ -1,102 +0,0 @@ -//! Test public APIs - -use std::{env, path::PathBuf}; - -use oxc_resolver::{EnforceExtension, Resolution, ResolveContext, ResolveOptions, Resolver}; - -fn dir() -> PathBuf { - env::current_dir().unwrap() -} - -fn resolve(specifier: &str) -> Resolution { - let path = dir(); - Resolver::new(ResolveOptions::default()).resolve(path, specifier).unwrap() -} - -#[test] -fn clone() { - let resolution = resolve("./tests/package.json"); - assert_eq!(resolution.clone(), resolution); -} - -#[test] -fn debug() { - let resolution = resolve("./tests/package.json"); - let s = format!("{resolution:?}"); - assert!(!s.is_empty()); -} - -#[test] -fn eq() { - let resolution = resolve("./tests/package.json"); - assert_eq!(resolution, resolution); -} - -#[test] -fn package_json() { - let resolution = resolve("./tests/package.json"); - assert!(resolution - .package_json() - .is_some_and(|json| json.name.as_ref().is_some_and(|name| name == "name"))); -} - -#[cfg(feature = "package_json_raw_json_api")] -#[test] -fn package_json_raw_json_api() { - let resolution = resolve("./tests/package.json"); - assert!(resolution - .package_json() - .unwrap() - .raw_json() - .get("name") - .is_some_and(|name| name == "name")); -} - -#[test] -fn clear_cache() { - let resolver = Resolver::new(ResolveOptions::default()); - resolver.clear_cache(); // exists -} - -#[test] -fn options() { - let resolver = Resolver::new(ResolveOptions::default()); - let options = resolver.options(); - assert!(!format!("{options:?}").is_empty()); -} - -#[test] -fn debug_resolver() { - let resolver = Resolver::new(ResolveOptions::default()); - assert!(!format!("{resolver:?}").is_empty()); -} - -#[test] -fn dependencies() { - let path = dir(); - let mut ctx = ResolveContext::default(); - let _ = Resolver::new(ResolveOptions::default()).resolve_with_context( - path, - "./tests/package.json", - &mut ctx, - ); - assert!(!ctx.file_dependencies.is_empty()); - assert!(ctx.missing_dependencies.is_empty()); -} - -#[test] -fn options_api() { - _ = ResolveOptions::default() - .with_builtin_modules(true) - .with_condition_names(&[]) - .with_extension(".js") - .with_force_extension(EnforceExtension::Auto) - .with_fully_specified(true) - .with_main_field("asdf") - .with_main_file("main") - .with_module("module") - .with_prefer_absolute(true) - .with_prefer_relative(true) - .with_root(PathBuf::new()) - .with_symbolic_link(true); -} diff --git a/tests/package.json b/tests/package.json deleted file mode 100644 index f099adcf..00000000 --- a/tests/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "name": "name" -} diff --git a/tests/resolve_test.rs b/tests/resolve_test.rs deleted file mode 100644 index 30d1ceff..00000000 --- a/tests/resolve_test.rs +++ /dev/null @@ -1,104 +0,0 @@ -use std::{env, path::PathBuf}; - -use oxc_resolver::{ResolveError, ResolveOptions, Resolver}; - -fn dir() -> PathBuf { - env::current_dir().unwrap() -} - -#[test] -fn chinese() { - let dir = dir(); - let specifier = "./fixtures/misc/中文/中文.js"; - let resolution = Resolver::new(ResolveOptions::default()).resolve(&dir, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(dir.join("fixtures/misc/中文/中文.js")) - ); -} - -#[test] -fn styled_components() { - let dir = dir(); - let path = dir.join("fixtures/pnpm"); - let module_path = dir.join("node_modules/.pnpm/styled-components@6.1.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/styled-components"); - let specifier = "styled-components"; - - // cjs - let options = - ResolveOptions { alias_fields: vec![vec!["browser".into()]], ..ResolveOptions::default() }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/styled-components.browser.cjs.js")) - ); - - // esm - let options = ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - main_fields: vec!["module".into()], - ..ResolveOptions::default() - }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/styled-components.browser.esm.js")) - ); -} - -#[test] -fn axios() { - let dir = dir(); - let path = dir.join("fixtures/pnpm"); - let module_path = dir.join("node_modules/.pnpm/axios@1.6.2/node_modules/axios"); - let specifier = "axios"; - - // default - let options = ResolveOptions::default(); - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("index.js")) - ); - - // browser - let options = ResolveOptions { - condition_names: vec!["browser".into(), "require".into()], - ..ResolveOptions::default() - }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/browser/axios.cjs")) - ); - - // cjs - let options = ResolveOptions { - condition_names: vec!["node".into(), "require".into()], - ..ResolveOptions::default() - }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/node/axios.cjs")) - ); -} - -#[test] -fn postcss() { - let dir = dir(); - let path = dir.join("fixtures/pnpm"); - let module_path = path.join("node_modules/postcss"); - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - // should ignore "path" - let resolution = resolver.resolve(&module_path, "path"); - assert_eq!(resolution, Err(ResolveError::Ignored(module_path.clone()))); - - // should ignore "./lib/terminal-highlight" - let resolution = resolver.resolve(&module_path, "./lib/terminal-highlight"); - assert_eq!(resolution, Err(ResolveError::Ignored(module_path.join("lib/terminal-highlight")))); -} From 825ff5afc98d1dc2fbe04c5e7e36b2b959701bb5 Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Sun, 16 Jun 2024 21:18:15 +0300 Subject: [PATCH 27/82] squash! --- .github/workflows/NPM.yml | 2 +- .github/workflows/Node.yml | 2 +- .github/workflows/Rust.yml | 2 +- package.json | 8 ++++---- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/NPM.yml b/.github/workflows/NPM.yml index 788002bc..4eb3b12a 100644 --- a/.github/workflows/NPM.yml +++ b/.github/workflows/NPM.yml @@ -24,7 +24,7 @@ jobs: id-token: write steps: - - uses: actions/checkout@v4.1.6 + - uses: actions/checkout@v4.1.7 - uses: actions/setup-node@v4.0.2 with: diff --git a/.github/workflows/Node.yml b/.github/workflows/Node.yml index cd0f236a..be3738a3 100644 --- a/.github/workflows/Node.yml +++ b/.github/workflows/Node.yml @@ -57,7 +57,7 @@ jobs: node-version: [18, 19, 20] steps: - - uses: actions/checkout@v4.1.6 + - uses: actions/checkout@v4.1.7 - uses: pnpm/action-setup@v4.0.0 with: diff --git a/.github/workflows/Rust.yml b/.github/workflows/Rust.yml index 1514667c..9ca23ee6 100644 --- a/.github/workflows/Rust.yml +++ b/.github/workflows/Rust.yml @@ -55,7 +55,7 @@ jobs: toolchain: ["stable", "nightly"] steps: - - uses: actions/checkout@v4.1.6 + - uses: actions/checkout@v4.1.7 - uses: actions-rs/toolchain@v1.0.7 with: diff --git a/package.json b/package.json index a431e48f..c80ccc19 100644 --- a/package.json +++ b/package.json @@ -16,9 +16,9 @@ }, "devDependencies": { "@napi-rs/cli": "^3.0.0-alpha.43", - "@napi-rs/wasm-runtime": "^0.2.0", - "@types/node": "^20.10.4", - "ava": "^6.0.1", - "emnapi": "^1.0.0" + "@napi-rs/wasm-runtime": "^0.2.4", + "@types/node": "^20.14.2", + "ava": "^6.1.3", + "emnapi": "^1.2.0" } } From 10339ed1440ed84738e05973fccfb1f065b4951f Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Mon, 17 Jun 2024 17:52:43 +0300 Subject: [PATCH 28/82] squash! --- Cargo.lock | 858 ------ fixtures/enhanced_resolve/lib/index.js | 1 - fixtures/enhanced_resolve/package.json | 4 - fixtures/enhanced_resolve/test/.gitignore | 2 - .../enhanced_resolve/test/fixtures/#/a.js | 0 fixtures/enhanced_resolve/test/fixtures/a.js | 3 - .../enhanced_resolve/test/fixtures/abc.txt | 1 - .../test/fixtures/alias/files/a.js | 0 fixtures/enhanced_resolve/test/fixtures/b.js | 3 - .../browser-module/browser/module-a.js | 0 .../fixtures/browser-module/lib/browser.js | 0 .../fixtures/browser-module/lib/ignore.js | 0 .../test/fixtures/browser-module/lib/main.js | 0 .../fixtures/browser-module/lib/replaced.js | 0 .../test/fixtures/browser-module/lib/self.js | 0 .../fixtures/browser-module/lib/toString.js | 0 .../browser-module/node_modules/module-a.js | 0 .../browser-module/node_modules/module-b.js | 0 .../browser-module/node_modules/module-c.js | 0 .../node_modules/recursive-file/a.js | 0 .../node_modules/recursive-file/b.js | 0 .../node_modules/recursive-file/c.js | 0 .../node_modules/recursive-file/d.js | 0 .../node_modules/recursive-file/package.json | 8 - .../test/fixtures/browser-module/package.json | 33 - .../test/fixtures/builtins/package.json | 12 - fixtures/enhanced_resolve/test/fixtures/c.js | 4 - .../enhanced_resolve/test/fixtures/complex.js | 13 - .../test/fixtures/crypto-js/index.js | 0 .../test/fixtures/crypto-js/package.json | 7 - .../test/fixtures/decorated-fs/exists.js | 0 .../test/fixtures/dirOrFile.js | 1 - .../test/fixtures/dirOrFile/index.js | 1 - .../directory-default/directory-default.js | 0 .../node_modules/@org/pkg/dist/string.js | 1 - .../@org/pkg/dist/string.test.d.ts | 1 - .../node_modules/@org/pkg/package.json | 9 - .../node_modules/pkg/dist/string.js | 1 - .../node_modules/pkg/dist/string.test.d.ts | 1 - .../node_modules/pkg/package.json | 9 - .../node_modules/exports-field/package.json | 7 - .../node_modules/pack1/index.js | 0 .../test/fixtures/exports-field/a.js | 1 - .../node_modules/exports-field/lib/browser.js | 1 - .../node_modules/exports-field/lib/index.js | 0 .../exports-field/lib/lib2/main.js | 1 - .../node_modules/exports-field/lib/main.js | 1 - .../node_modules/exports-field/main.js | 1 - .../node_modules/exports-field/package.json | 18 - .../node_modules/exports-field/x.js | 1 - .../invalid-exports-field/index.js | 0 .../invalid-exports-field/package.json | 13 - .../node_modules/invalid-exports-field/umd.js | 0 .../test/fixtures/exports-field/package.json | 5 - .../node_modules/exports-field/index.js | 1 - .../node_modules/exports-field/lib/browser.js | 1 - .../exports-field/lib/lib2/main.js | 1 - .../node_modules/exports-field/lib/main.js | 1 - .../node_modules/exports-field/main.js | 1 - .../node_modules/exports-field/package.json | 17 - .../node_modules/exports-field/index | 0 .../node_modules/exports-field/main.js | 1 - .../node_modules/exports-field/package.json | 10 - .../node_modules/exports-field/src/index.js | 0 .../fixtures/extension-alias/dir/index.js | 0 .../fixtures/extension-alias/dir/index.ts | 0 .../fixtures/extension-alias/dir2/index.js | 0 .../fixtures/extension-alias/dir2/index.mts | 0 .../test/fixtures/extension-alias/index.js | 0 .../test/fixtures/extension-alias/index.mjs | 0 .../fixtures/extension-alias/index.mts.js | 0 .../test/fixtures/extension-alias/index.ts | 0 .../test/fixtures/extensions/app.module.js | 0 .../test/fixtures/extensions/dir/index.js | 0 .../test/fixtures/extensions/dir/index.ts | 0 .../test/fixtures/extensions/foo.js | 0 .../test/fixtures/extensions/foo.ts | 0 .../test/fixtures/extensions/index.js | 0 .../test/fixtures/extensions/index.ts | 0 .../extensions/node_modules/module.js | 0 .../extensions/node_modules/module/index.ts | 0 .../test/fixtures/extensions/package.json | 3 - .../enhanced_resolve/test/fixtures/file.load1 | 0 .../enhanced_resolve/test/fixtures/file.load2 | 0 .../test/fixtures/foo/index.js | 0 .../test/fixtures/foo/package.json | 4 - .../node_modules/m/package.json | 17 - .../node_modules/m/src/features/f.js | 0 .../m/src/features/internal/file.js | 0 .../node_modules/m/src/features/y/y.js | 0 .../node_modules/m/src/internal/i.js | 0 .../node_modules/m/src/middle-1/f.js | 0 .../node_modules/m/src/middle-1/nested/f.js | 0 .../node_modules/m/src/middle-2/nested/f.js | 1 - .../m/src/middle-3/nested/f/nested/f.js | 0 .../node_modules/m/src/middle-4/f/f.js | 0 .../node_modules/m/src/middle-5/f$/$.js | 0 .../node_modules/m/src/middle-5/f/$.js | 0 .../node_modules/m/src/middle/f.js | 0 .../node_modules/m/src/middle/nested/f.js | 0 .../test/fixtures/imports-field/a.js | 1 - .../test/fixtures/imports-field/b.js | 0 .../test/fixtures/imports-field/dir/b.js | 0 .../node_modules/a/lib/browser.js | 1 - .../imports-field/node_modules/a/lib/index.js | 0 .../node_modules/a/lib/lib2/main.js | 1 - .../imports-field/node_modules/a/lib/main.js | 1 - .../imports-field/node_modules/a/main.js | 1 - .../imports-field/node_modules/a/package.json | 18 - .../imports-field/node_modules/a/x.js | 1 - .../imports-field/node_modules/c/index.js | 0 .../test/fixtures/imports-field/package.json | 17 - .../fixtures/incorrect-package/pack1/a.js | 0 .../incorrect-package/pack1/package.json | 2 - .../fixtures/incorrect-package/pack2/a.js | 0 .../incorrect-package/pack2/package.json | 0 .../test/fixtures/issue-238/package.json | 3 - .../test/fixtures/issue-238/src/a/config.js | 0 .../src/common/config/myObjectFile.js | 0 .../enhanced_resolve/test/fixtures/lib.js | 0 .../test/fixtures/lib/complex1.js | 1 - .../test/fixtures/main-field-self/index.js | 0 .../fixtures/main-field-self/package.json | 3 - .../test/fixtures/main-field-self2/index.js | 0 .../fixtures/main-field-self2/package.json | 3 - .../enhanced_resolve/test/fixtures/main1.js | 9 - .../enhanced_resolve/test/fixtures/main2.js | 12 - .../enhanced_resolve/test/fixtures/main3.js | 4 - .../multiple_modules/node_modules/m1/a.js | 3 - .../test/fixtures/no#fragment/#/#.js | 0 fixtures/enhanced_resolve/test/fixtures/no.js | 0 .../browser-module-broken/browser.js | 0 .../browser-module-broken/main.js | 0 .../browser-module-broken/package.json | 4 - .../complexm/node_modules/m1/a.js | 1 - .../complexm/node_modules/m1/index.js | 1 - .../fixtures/node_modules/complexm/step1.js | 1 - .../fixtures/node_modules/complexm/step2.js | 1 - .../fixtures/node_modules/dash-name/index.js | 0 .../node_modules/dash-name/package.json | 4 - .../test/fixtures/node_modules/dash/index.js | 0 .../fixtures/node_modules/dash/package.json | 4 - .../invalidPackageJson/package.json | 0 .../test/fixtures/node_modules/m1/a.js | 3 - .../test/fixtures/node_modules/m1/b.js | 3 - .../test/fixtures/node_modules/m2/b.js | 1 - .../node_modules/recursive-module/file.js | 0 .../node_modules/recursive-module/index.js | 0 .../test/fixtures/pnp-a/m2/a.js | 3 - .../test/fixtures/pnp/pkg/dir/index.js | 0 .../test/fixtures/pnp/pkg/index.js | 0 .../test/fixtures/pnp/pkg/main.js | 0 .../fixtures/pnp/pkg/package-alias/browser.js | 0 .../fixtures/pnp/pkg/package-alias/index.js | 0 .../test/fixtures/pnp/pkg/package.json | 7 - .../test/fixtures/pnp/pkg/typescript/index.ts | 0 .../test/fixtures/pnp/pkg3/a.js | 1 - .../test/fixtures/pnp/pkg3/package.json | 8 - .../prefer-pnp/alternative-modules/m1/b.js | 0 .../restrictions/node_modules/pck1/index.css | 0 .../restrictions/node_modules/pck1/index.js | 0 .../node_modules/pck1/package.json | 3 - .../restrictions/node_modules/pck2/index.css | 0 .../restrictions/node_modules/pck2/module.js | 0 .../node_modules/pck2/package.json | 5 - .../test/fixtures/roots_fall_through/index.js | 0 .../scoped/node_modules/@scope/pack1/main.js | 0 .../node_modules/@scope/pack1/package.json | 5 - .../node_modules/@scope/pack2/lib/index.js | 0 .../scoped/node_modules/@scope/pack2/main.js | 0 .../node_modules/@scope/pack2/package.json | 3 - .../test/fixtures/shortcutdir.js/a.js | 0 .../test/fixtures/yield/a/foo-2/b | 0 .../test/fixtures/yield/a/foo-2/c | 0 .../test/fixtures/yield/a/foo/a | 0 .../test/fixtures/yield/a/foo/b | 0 .../test/fixtures/yield/b/foo/a | 0 .../test/fixtures/yield/c/foo/a | 0 .../test/fixtures/yield/c/foo/package.json | 7 - .../fixtures/\346\265\213\350\257\225.js" | 0 .../\344\270\255\346\226\207.js" | 0 fixtures/pnpm/.gitignore | 1 - fixtures/pnpm/package.json | 10 - fixtures/pnpm/pnpm-lock.yaml | 212 -- fixtures/tsconfig/cases/builtins/thing.js | 0 .../tsconfig/cases/builtins/tsconfig.json | 5 - fixtures/tsconfig/cases/exports/index.js | 0 fixtures/tsconfig/cases/exports/tsconfig.json | 3 - .../extends-extension/base-tsconfig.json | 7 - .../tsconfig/cases/extends-extension/foo.js | 0 .../cases/extends-extension/tsconfig.json | 3 - .../cases/extends-extensionless/foo.js | 0 .../cases/extends-extensionless/tsconfig.json | 3 - .../tsconfig/cases/extends-multiple/foo.js | 0 .../cases/extends-multiple/tsconfig.json | 6 - .../tsconfig/cases/extends-not-found/index.js | 0 .../cases/extends-not-found/tsconfig.json | 3 - .../tsconfig/cases/extends-paths/src/index.js | 0 .../cases/extends-paths/tsconfig.base.json | 7 - .../cases/extends-paths/tsconfig.json | 6 - fixtures/tsconfig/cases/field/index.js | 0 fixtures/tsconfig/cases/field/tsconfig.json | 3 - fixtures/tsconfig/cases/index/index.js | 0 fixtures/tsconfig/cases/index/tsconfig.json | 3 - .../cases/paths_template_variable/foo.js | 0 .../paths_template_variable/tsconfig1.json | 3 - .../paths_template_variable/tsconfig2.json | 8 - .../project_references/app/aliased/index.ts | 0 .../cases/project_references/app/index.ts | 0 .../project_references/app/tsconfig.json | 23 - .../project_a/aliased/index.ts | 0 .../project_references/project_a/conf.json | 8 - .../project_references/project_a/index.ts | 0 .../project_b/src/aliased/index.ts | 0 .../project_b/tsconfig.json | 9 - .../project_references/project_c/index.ts | 0 .../project_c/tsconfig.json | 5 - .../project_references/tsconfig.base.json | 4 - fixtures/tsconfig/cases/suffixes/a.ios.ts | 0 fixtures/tsconfig/cases/suffixes/a.ts | 0 fixtures/tsconfig/cases/suffixes/b.ts | 0 fixtures/tsconfig/cases/suffixes/c-test.ts | 0 fixtures/tsconfig/cases/suffixes/index.ts | 1 - .../tsconfig/cases/suffixes/tsconfig.json | 5 - fixtures/tsconfig/cases/trailing-comma/bar.js | 0 .../tsconfig/cases/trailing-comma/index.js | 0 .../cases/trailing-comma/tsconfig.json | 9 - fixtures/tsconfig/foo.js | 0 fixtures/tsconfig/nested/index.js | 0 fixtures/tsconfig/nested/test.js | 0 fixtures/tsconfig/nested/tsconfig.json | 8 - .../node_modules/tsconfig-exports/conf.json | 7 - .../node_modules/tsconfig-exports/foo.js | 0 .../tsconfig-exports/package.json | 7 - .../node_modules/tsconfig-field/conf.json | 7 - .../node_modules/tsconfig-field/foo.js | 0 .../node_modules/tsconfig-field/package.json | 5 - .../node_modules/tsconfig-index/foo.js | 0 .../node_modules/tsconfig-index/package.json | 4 - .../node_modules/tsconfig-index/tsconfig.json | 7 - .../node_modules/tsconfig-not-used/foo.js | 0 .../tsconfig-not-used/tsconfig.json | 7 - fixtures/tsconfig/package.json | 24 - fixtures/tsconfig/tsconfig.json | 7 - .../tsconfig/tsconfig_template_variable.json | 7 - napi/__test__/resolver.spec.mjs | 260 -- napi/src/lib.rs | 166 - napi/src/options.rs | 261 -- napi/tests/options.test.mjs | 59 - npm/package.json | 67 +- package.json | 53 +- pnpm-lock.yaml | 2690 ----------------- src/builtins.rs | 71 - src/cache.rs | 369 --- src/context.rs | 89 - src/error.rs | 160 - src/file_system.rs | 133 - src/lib.rs | 1670 ---------- src/options.rs | 623 ---- src/package_json.rs | 207 -- src/path.rs | 132 - src/resolution.rs | 92 - src/specifier.rs | 230 -- src/tests/alias.rs | 280 -- src/tests/browser_field.rs | 189 -- src/tests/builtins.rs | 121 - src/tests/dependencies.rs | 110 - src/tests/exports_field.rs | 2546 ---------------- src/tests/extension_alias.rs | 66 - src/tests/extensions.rs | 125 - src/tests/fallback.rs | 100 - src/tests/full_specified.rs | 113 - src/tests/imports_field.rs | 1320 -------- src/tests/incorrect_description_file.rs | 62 - src/tests/main_field.rs | 24 - src/tests/memory_fs.rs | 74 - src/tests/missing.rs | 106 - src/tests/mod.rs | 49 - src/tests/resolve.rs | 119 - src/tests/restrictions.rs | 25 - src/tests/roots.rs | 92 - src/tests/scoped_packages.rs | 25 - src/tests/simple.rs | 68 - src/tests/symlink.rs | 121 - src/tests/tsconfig_paths.rs | 507 ---- src/tests/tsconfig_project_references.rs | 101 - src/tsconfig.rs | 212 -- tests/integration_test.rs | 102 - tests/package.json | 3 - tests/resolve_test.rs | 104 - 290 files changed, 50 insertions(+), 15709 deletions(-) delete mode 100644 Cargo.lock delete mode 100644 fixtures/enhanced_resolve/lib/index.js delete mode 100644 fixtures/enhanced_resolve/package.json delete mode 100644 fixtures/enhanced_resolve/test/.gitignore delete mode 100644 fixtures/enhanced_resolve/test/fixtures/#/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/abc.txt delete mode 100644 fixtures/enhanced_resolve/test/fixtures/alias/files/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/browser/module-a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/ignore.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/replaced.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/self.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/toString.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-c.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/c.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/d.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/builtins/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/c.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/complex.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/crypto-js/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/decorated-fs/exists.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/dirOrFile.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/directory-default/directory-default.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/pack1/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/umd.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/index delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/src/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.mts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mjs delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mts.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/app.module.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/foo.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/foo.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/file.load1 delete mode 100644 fixtures/enhanced_resolve/test/fixtures/file.load2 delete mode 100644 fixtures/enhanced_resolve/test/fixtures/foo/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/foo/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/internal/file.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/y/y.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/internal/i.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-3/nested/f/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-4/f/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f$/$.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f/$.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/dir/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/c/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/issue-238/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/issue-238/src/a/config.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/issue-238/src/common/config/myObjectFile.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/lib.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/lib/complex1.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self2/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main1.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main2.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main3.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/no#fragment/#/#.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/no.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/invalidPackageJson/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/file.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/dir/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/typescript/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/prefer-pnp/alternative-modules/m1/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.css delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/index.css delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/module.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/roots_fall_through/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/lib/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/shortcutdir.js/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/b delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/c delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo/a delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo/b delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/b/foo/a delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/c/foo/a delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json delete mode 100644 "fixtures/enhanced_resolve/test/fixtures/\346\265\213\350\257\225.js" delete mode 100644 "fixtures/misc/\344\270\255\346\226\207/\344\270\255\346\226\207.js" delete mode 100644 fixtures/pnpm/.gitignore delete mode 100644 fixtures/pnpm/package.json delete mode 100644 fixtures/pnpm/pnpm-lock.yaml delete mode 100644 fixtures/tsconfig/cases/builtins/thing.js delete mode 100644 fixtures/tsconfig/cases/builtins/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/exports/index.js delete mode 100644 fixtures/tsconfig/cases/exports/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-extension/base-tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-extension/foo.js delete mode 100644 fixtures/tsconfig/cases/extends-extension/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-extensionless/foo.js delete mode 100644 fixtures/tsconfig/cases/extends-extensionless/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-multiple/foo.js delete mode 100644 fixtures/tsconfig/cases/extends-multiple/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-not-found/index.js delete mode 100644 fixtures/tsconfig/cases/extends-not-found/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-paths/src/index.js delete mode 100644 fixtures/tsconfig/cases/extends-paths/tsconfig.base.json delete mode 100644 fixtures/tsconfig/cases/extends-paths/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/field/index.js delete mode 100644 fixtures/tsconfig/cases/field/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/index/index.js delete mode 100644 fixtures/tsconfig/cases/index/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/paths_template_variable/foo.js delete mode 100644 fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json delete mode 100644 fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json delete mode 100644 fixtures/tsconfig/cases/project_references/app/aliased/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/app/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/app/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/project_references/project_a/aliased/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_a/conf.json delete mode 100644 fixtures/tsconfig/cases/project_references/project_a/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_b/src/aliased/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_b/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/project_references/project_c/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_c/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/project_references/tsconfig.base.json delete mode 100644 fixtures/tsconfig/cases/suffixes/a.ios.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/a.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/b.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/c-test.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/index.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/trailing-comma/bar.js delete mode 100644 fixtures/tsconfig/cases/trailing-comma/index.js delete mode 100644 fixtures/tsconfig/cases/trailing-comma/tsconfig.json delete mode 100644 fixtures/tsconfig/foo.js delete mode 100644 fixtures/tsconfig/nested/index.js delete mode 100644 fixtures/tsconfig/nested/test.js delete mode 100644 fixtures/tsconfig/nested/tsconfig.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-exports/conf.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-exports/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-exports/package.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-field/conf.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-field/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-field/package.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-index/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-index/package.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-not-used/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json delete mode 100755 fixtures/tsconfig/package.json delete mode 100644 fixtures/tsconfig/tsconfig.json delete mode 100644 fixtures/tsconfig/tsconfig_template_variable.json delete mode 100644 napi/__test__/resolver.spec.mjs delete mode 100644 napi/src/lib.rs delete mode 100644 napi/src/options.rs delete mode 100644 napi/tests/options.test.mjs delete mode 100644 pnpm-lock.yaml delete mode 100644 src/builtins.rs delete mode 100644 src/cache.rs delete mode 100644 src/context.rs delete mode 100644 src/error.rs delete mode 100644 src/file_system.rs delete mode 100644 src/lib.rs delete mode 100644 src/options.rs delete mode 100644 src/package_json.rs delete mode 100644 src/path.rs delete mode 100644 src/resolution.rs delete mode 100644 src/specifier.rs delete mode 100644 src/tests/alias.rs delete mode 100644 src/tests/browser_field.rs delete mode 100644 src/tests/builtins.rs delete mode 100644 src/tests/dependencies.rs delete mode 100644 src/tests/exports_field.rs delete mode 100644 src/tests/extension_alias.rs delete mode 100644 src/tests/extensions.rs delete mode 100644 src/tests/fallback.rs delete mode 100644 src/tests/full_specified.rs delete mode 100644 src/tests/imports_field.rs delete mode 100644 src/tests/incorrect_description_file.rs delete mode 100644 src/tests/main_field.rs delete mode 100644 src/tests/memory_fs.rs delete mode 100644 src/tests/missing.rs delete mode 100644 src/tests/mod.rs delete mode 100644 src/tests/resolve.rs delete mode 100644 src/tests/restrictions.rs delete mode 100644 src/tests/roots.rs delete mode 100644 src/tests/scoped_packages.rs delete mode 100644 src/tests/simple.rs delete mode 100644 src/tests/symlink.rs delete mode 100644 src/tests/tsconfig_paths.rs delete mode 100644 src/tests/tsconfig_project_references.rs delete mode 100644 src/tsconfig.rs delete mode 100644 tests/integration_test.rs delete mode 100644 tests/package.json delete mode 100644 tests/resolve_test.rs diff --git a/Cargo.lock b/Cargo.lock deleted file mode 100644 index c83523b3..00000000 --- a/Cargo.lock +++ /dev/null @@ -1,858 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "aho-corasick" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" -dependencies = [ - "memchr", -] - -[[package]] -name = "anes" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "735d4f398ca57cfa2880225c2bf81c3b9af3be5bb22e44ae70118dad38713e84" - -[[package]] -name = "autocfg" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "bitflags" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" - -[[package]] -name = "bpaf" -version = "0.9.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3280efcf6d66bc77c2cf9b67dc8acee47a217d9be67dd590b3230dffe663724d" - -[[package]] -name = "cast" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "ciborium" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42e69ffd6f0917f5c029256a24d0161db17cea3997d185db0d35926308770f0e" -dependencies = [ - "ciborium-io", - "ciborium-ll", - "serde", -] - -[[package]] -name = "ciborium-io" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05afea1e0a06c9be33d539b876f1ce3692f4afea2cb41f740e7743225ed1c757" - -[[package]] -name = "ciborium-ll" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57663b653d948a338bfb3eeba9bb2fd5fcfaecb9e199e87e1eda4d9e8b240fd9" -dependencies = [ - "ciborium-io", - "half", -] - -[[package]] -name = "clean-path" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aaa6b4b263a5d737e9bf6b7c09b72c41a5480aec4d7219af827f6564e950b6a5" - -[[package]] -name = "codspeed" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a104ac948e0188b921eb3fcbdd55dcf62e542df4c7ab7e660623f6288302089" -dependencies = [ - "colored", - "libc", - "serde_json", -] - -[[package]] -name = "colored" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbf2150cce219b664a8a70df7a1f933836724b503f8a413af9365b4dcc4d90b8" -dependencies = [ - "lazy_static", - "windows-sys 0.48.0", -] - -[[package]] -name = "convert_case" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec182b0ca2f35d8fc196cf3404988fd8b8c739a4d270ff118a398feb0cbec1ca" -dependencies = [ - "unicode-segmentation", -] - -[[package]] -name = "criterion2" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7258985df1aa8b33359ee2392cbc3b7802875242cdacdda91a17a602132c24a9" -dependencies = [ - "anes", - "bpaf", - "cast", - "ciborium", - "codspeed", - "colored", - "num-traits", - "oorandom", - "serde", - "serde_json", - "walkdir", -] - -[[package]] -name = "crossbeam-deque" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" -dependencies = [ - "crossbeam-epoch", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.9.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" -dependencies = [ - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" - -[[package]] -name = "crunchy" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" - -[[package]] -name = "ctor" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edb49164822f3ee45b17acd4a208cfc1251410cf0cad9a833234c9890774dd9f" -dependencies = [ - "quote", - "syn", -] - -[[package]] -name = "dashmap" -version = "5.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" -dependencies = [ - "cfg-if", - "hashbrown", - "lock_api", - "once_cell", - "parking_lot_core", -] - -[[package]] -name = "document-features" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef5282ad69563b5fc40319526ba27e0e7363d552a896f0297d54f767717f9b95" -dependencies = [ - "litrs", -] - -[[package]] -name = "dunce" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b" - -[[package]] -name = "either" -version = "1.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dca9240753cf90908d7e4aac30f630662b02aebaa1b58a3cadabdb23385b58b" - -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "filetime" -version = "0.2.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ee447700ac8aa0b2f2bd7bc4462ad686ba06baa6727ac149a2d6277f0d240fd" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall 0.4.1", - "windows-sys 0.52.0", -] - -[[package]] -name = "half" -version = "2.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dd08c532ae367adf81c312a4580bc67f1d0fe8bc9c460520283f4c0ff277888" -dependencies = [ - "cfg-if", - "crunchy", -] - -[[package]] -name = "hashbrown" -version = "0.14.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" - -[[package]] -name = "indexmap" -version = "2.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" -dependencies = [ - "equivalent", - "hashbrown", - "serde", -] - -[[package]] -name = "itoa" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" - -[[package]] -name = "json-strip-comments" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3d129799327c8f80861e467c59b825ba24c277dba6ad0d71a141dc98f9e04ee" - -[[package]] -name = "lazy_static" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" - -[[package]] -name = "libc" -version = "0.2.155" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" - -[[package]] -name = "libloading" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c2a198fb6b0eada2a8df47933734e6d35d350665a33a3593d7164fa52c75c19" -dependencies = [ - "cfg-if", - "windows-targets 0.52.5", -] - -[[package]] -name = "litrs" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4ce301924b7887e9d637144fdade93f9dfff9b60981d4ac161db09720d39aa5" - -[[package]] -name = "lock_api" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" -dependencies = [ - "autocfg", - "scopeguard", -] - -[[package]] -name = "memchr" -version = "2.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" - -[[package]] -name = "napi" -version = "2.16.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfc300228808a0e6aea5a58115c82889240bcf8dab16fc25ad675b33e454b368" -dependencies = [ - "bitflags 2.5.0", - "ctor", - "napi-derive", - "napi-sys", - "once_cell", - "serde", - "serde_json", -] - -[[package]] -name = "napi-build" -version = "2.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1c0f5d67ee408a4685b61f5ab7e58605c8ae3f2b4189f0127d804ff13d5560a" - -[[package]] -name = "napi-derive" -version = "2.16.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0e034ddf6155192cf83f267ede763fe6c164dfa9971585436b16173718d94c4" -dependencies = [ - "cfg-if", - "convert_case", - "napi-derive-backend", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "napi-derive-backend" -version = "1.0.67" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bff2c00437f3b3266391eb5e6aa25d0029187daf5caf05b8e3271468fb5ae73e" -dependencies = [ - "convert_case", - "once_cell", - "proc-macro2", - "quote", - "regex", - "semver", - "syn", -] - -[[package]] -name = "napi-sys" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "427802e8ec3a734331fec1035594a210ce1ff4dc5bc1950530920ab717964ea3" -dependencies = [ - "libloading", -] - -[[package]] -name = "normalize-path" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5438dd2b2ff4c6df6e1ce22d825ed2fa93ee2922235cc45186991717f0a892d" - -[[package]] -name = "num-traits" -version = "0.2.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" -dependencies = [ - "autocfg", -] - -[[package]] -name = "once_cell" -version = "1.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" - -[[package]] -name = "oorandom" -version = "11.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575" - -[[package]] -name = "oxc_napi_resolver" -version = "0.0.0" -dependencies = [ - "napi", - "napi-build", - "napi-derive", - "oxc_resolver", -] - -[[package]] -name = "oxc_resolver" -version = "1.8.1" -dependencies = [ - "criterion2", - "dashmap", - "document-features", - "dunce", - "json-strip-comments", - "normalize-path", - "once_cell", - "rayon", - "rustc-hash", - "serde", - "serde_json", - "thiserror", - "tracing", - "typescript_tsconfig_json", - "vfs", -] - -[[package]] -name = "parking_lot_core" -version = "0.9.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall 0.5.1", - "smallvec", - "windows-targets 0.52.5", -] - -[[package]] -name = "pin-project-lite" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" - -[[package]] -name = "proc-macro2" -version = "1.0.85" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22244ce15aa966053a896d1accb3a6e68469b97c7f33f284b99f0d576879fc23" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.36" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "rayon" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" -dependencies = [ - "either", - "rayon-core", -] - -[[package]] -name = "rayon-core" -version = "1.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" -dependencies = [ - "crossbeam-deque", - "crossbeam-utils", -] - -[[package]] -name = "redox_syscall" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" -dependencies = [ - "bitflags 1.3.2", -] - -[[package]] -name = "redox_syscall" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "469052894dcb553421e483e4209ee581a45100d31b4018de03e5a7ad86374a7e" -dependencies = [ - "bitflags 2.5.0", -] - -[[package]] -name = "regex" -version = "1.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" -dependencies = [ - "aho-corasick", - "memchr", - "regex-automata", - "regex-syntax", -] - -[[package]] -name = "regex-automata" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", -] - -[[package]] -name = "regex-syntax" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" - -[[package]] -name = "rustc-hash" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" - -[[package]] -name = "ryu" -version = "1.0.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" - -[[package]] -name = "same-file" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "scopeguard" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" - -[[package]] -name = "semver" -version = "1.0.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" - -[[package]] -name = "serde" -version = "1.0.203" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7253ab4de971e72fb7be983802300c30b5a7f0c2e56fab8abfc6a214307c0094" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.203" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "serde_json" -version = "1.0.117" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3" -dependencies = [ - "indexmap", - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "smallvec" -version = "1.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" - -[[package]] -name = "syn" -version = "2.0.66" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c42f3f41a2de00b01c0aaad383c5a45241efc8b2d1eda5661812fda5f3cdcff5" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "thiserror" -version = "1.0.61" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.61" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "tracing" -version = "0.1.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" -dependencies = [ - "pin-project-lite", - "tracing-attributes", - "tracing-core", -] - -[[package]] -name = "tracing-attributes" -version = "0.1.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "tracing-core" -version = "0.1.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" -dependencies = [ - "once_cell", -] - -[[package]] -name = "typescript_tsconfig_json" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7cc416eaf05297012ead9d192226fe9a92e9a20f64f8780efb9085aaae9b590" -dependencies = [ - "clean-path", - "indexmap", - "rustc-hash", - "serde", - "serde_json", -] - -[[package]] -name = "unicode-ident" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" - -[[package]] -name = "unicode-segmentation" -version = "1.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" - -[[package]] -name = "vfs" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "654cd097e182a71dbf899178e6b5662c2157dd0b8afd5975de18008f6fc173d1" -dependencies = [ - "filetime", -] - -[[package]] -name = "walkdir" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" -dependencies = [ - "same-file", - "winapi-util", -] - -[[package]] -name = "winapi-util" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b" -dependencies = [ - "windows-sys 0.52.0", -] - -[[package]] -name = "windows-sys" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" -dependencies = [ - "windows-targets 0.48.5", -] - -[[package]] -name = "windows-sys" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" -dependencies = [ - "windows-targets 0.52.5", -] - -[[package]] -name = "windows-targets" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" -dependencies = [ - "windows_aarch64_gnullvm 0.48.5", - "windows_aarch64_msvc 0.48.5", - "windows_i686_gnu 0.48.5", - "windows_i686_msvc 0.48.5", - "windows_x86_64_gnu 0.48.5", - "windows_x86_64_gnullvm 0.48.5", - "windows_x86_64_msvc 0.48.5", -] - -[[package]] -name = "windows-targets" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" -dependencies = [ - "windows_aarch64_gnullvm 0.52.5", - "windows_aarch64_msvc 0.52.5", - "windows_i686_gnu 0.52.5", - "windows_i686_gnullvm", - "windows_i686_msvc 0.52.5", - "windows_x86_64_gnu 0.52.5", - "windows_x86_64_gnullvm 0.52.5", - "windows_x86_64_msvc 0.52.5", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" - -[[package]] -name = "windows_i686_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" - -[[package]] -name = "windows_i686_gnu" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" - -[[package]] -name = "windows_i686_gnullvm" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" - -[[package]] -name = "windows_i686_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" - -[[package]] -name = "windows_i686_msvc" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" diff --git a/fixtures/enhanced_resolve/lib/index.js b/fixtures/enhanced_resolve/lib/index.js deleted file mode 100644 index 1e872e8f..00000000 --- a/fixtures/enhanced_resolve/lib/index.js +++ /dev/null @@ -1 +0,0 @@ -// mimic enhanced-resolved root directory structure diff --git a/fixtures/enhanced_resolve/package.json b/fixtures/enhanced_resolve/package.json deleted file mode 100644 index d1b845b5..00000000 --- a/fixtures/enhanced_resolve/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "enhanced-resolve", - "main": "lib/index.js" -} diff --git a/fixtures/enhanced_resolve/test/.gitignore b/fixtures/enhanced_resolve/test/.gitignore deleted file mode 100644 index bbbec5f4..00000000 --- a/fixtures/enhanced_resolve/test/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# created by symlink.rs -/temp diff --git a/fixtures/enhanced_resolve/test/fixtures/#/a.js b/fixtures/enhanced_resolve/test/fixtures/#/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/a.js b/fixtures/enhanced_resolve/test/fixtures/a.js deleted file mode 100644 index 896ffc6d..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/abc.txt b/fixtures/enhanced_resolve/test/fixtures/abc.txt deleted file mode 100644 index f2ba8f84..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/abc.txt +++ /dev/null @@ -1 +0,0 @@ -abc \ No newline at end of file diff --git a/fixtures/enhanced_resolve/test/fixtures/alias/files/a.js b/fixtures/enhanced_resolve/test/fixtures/alias/files/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/b.js b/fixtures/enhanced_resolve/test/fixtures/b.js deleted file mode 100644 index 11476340..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/b.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function b() { - return "This is b"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/browser/module-a.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/browser/module-a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/browser.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/ignore.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/ignore.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/replaced.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/replaced.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/self.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/self.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/toString.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/toString.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-a.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-b.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-c.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-c.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/a.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/b.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/c.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/c.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/d.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/d.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json deleted file mode 100644 index c13fe23b..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "browser": { - "a.js": "./a", - "./b.js": "./b", - "c.js": "./d.js", - "./d.js": "./c.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/package.json b/fixtures/enhanced_resolve/test/fixtures/browser-module/package.json deleted file mode 100644 index 19ff7739..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/browser-module/package.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "exports": { - "./lib/index.js": "./lib/index.js" - }, - "browser": { - "./lib/ignore.js": false, - "./lib/replaced.js": "./lib/browser", - "module-a": "./browser/module-a.js", - "module-b": "module-c", - "module-c": "module-c", - "./toString": "./lib/toString.js", - "./lib/main.js": "./lib/main.js", - "./main.js": "./lib/main.js", - "./lib/xyz.js": "./xyz.js", - "./xyz.js": "./lib/xyz.js", - "./lib/non-existent.js": "./lib/non-existent.js", - ".": false, - "./number": 1, - "./foo": "./lib/replaced.js?query" - }, - "innerBrowser1": { - "field": { - "browser": { - "./lib/main1.js": "./lib/main.js" - } - } - }, - "innerBrowser2": { - "browser": { - "./lib/main2.js": "./lib/replaced.js" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/builtins/package.json b/fixtures/enhanced_resolve/test/fixtures/builtins/package.json deleted file mode 100644 index 4a54ea96..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/builtins/package.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "name": "builtins", - "private": true, - "imports": { - "#fs": { - "default": "fs" - }, - "#http": { - "node": "node:http" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/c.js b/fixtures/enhanced_resolve/test/fixtures/c.js deleted file mode 100644 index e3aca8aa..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/c.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = function b() { - require("./a"); - return "This is c"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/complex.js b/fixtures/enhanced_resolve/test/fixtures/complex.js deleted file mode 100644 index 1f62db84..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/complex.js +++ /dev/null @@ -1,13 +0,0 @@ -var 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); diff --git a/fixtures/enhanced_resolve/test/fixtures/crypto-js/index.js b/fixtures/enhanced_resolve/test/fixtures/crypto-js/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json b/fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json deleted file mode 100644 index 1d31aa8b..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "crypto-js", - "main": "index.js", - "browser": { - "crypto": false - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/decorated-fs/exists.js b/fixtures/enhanced_resolve/test/fixtures/decorated-fs/exists.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/dirOrFile.js b/fixtures/enhanced_resolve/test/fixtures/dirOrFile.js deleted file mode 100644 index c3cb885f..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/dirOrFile.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "file"; diff --git a/fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js b/fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js deleted file mode 100644 index 85e01cd4..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "dir"; diff --git a/fixtures/enhanced_resolve/test/fixtures/directory-default/directory-default.js b/fixtures/enhanced_resolve/test/fixtures/directory-default/directory-default.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js deleted file mode 100644 index d1007aae..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js +++ /dev/null @@ -1 +0,0 @@ -export default "string"; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts deleted file mode 100644 index cb0ff5c3..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json deleted file mode 100644 index b523a1e9..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "@org/pkg", - "exports": { - "./*.js": { - "types": "./dist/*.d.ts", - "default": "./dist/*.js" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js deleted file mode 100644 index d1007aae..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js +++ /dev/null @@ -1 +0,0 @@ -export default "string"; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts deleted file mode 100644 index cb0ff5c3..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json deleted file mode 100644 index 8e55fb46..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "@raviqqe/hidash", - "exports": { - "./*.js": { - "types": "./dist/*.d.ts", - "default": "./dist/*.js" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json deleted file mode 100644 index f0edf449..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "exports-field", - "version": "1.0.0", - "exports": { - ".": "./a/../b/../../pack1/index.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/pack1/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/pack1/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/a.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/a.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json deleted file mode 100644 index 6b105c08..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "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/": { - "webpack": ["./lib/lib2/", "./lib/"], - "node": "./lib/", - "default": "./lib/" - }, - "./dist/a.js": "./../../a.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json deleted file mode 100644 index 0012a3de..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "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" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/umd.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/umd.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field/package.json deleted file mode 100644 index 5fa72bb5..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "@exports-field/core", - "version": "1.0.0", - "exports": "./a.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json deleted file mode 100644 index e6f12074..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "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/lib2/", "./lib/"], - "node": "./lib/", - "default": "./lib/" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/index b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/index deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json deleted file mode 100644 index 1a838f49..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "name": "exports-field", - "exportsField": { - "exports": "./main.js" - }, - "ex": "./index", - "broken": { - ".": "./src" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/src/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/src/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.ts b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.mts b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.mts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mjs b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mjs deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mts.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mts.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.ts b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/app.module.js b/fixtures/enhanced_resolve/test/fixtures/extensions/app.module.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.js b/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/foo.js b/fixtures/enhanced_resolve/test/fixtures/extensions/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/foo.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/foo.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/index.js b/fixtures/enhanced_resolve/test/fixtures/extensions/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/index.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module.js b/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module/index.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/package.json b/fixtures/enhanced_resolve/test/fixtures/extensions/package.json deleted file mode 100644 index 5e55a1e8..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/extensions/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "./index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/file.load1 b/fixtures/enhanced_resolve/test/fixtures/file.load1 deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/file.load2 b/fixtures/enhanced_resolve/test/fixtures/file.load2 deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/foo/index.js b/fixtures/enhanced_resolve/test/fixtures/foo/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/foo/package.json b/fixtures/enhanced_resolve/test/fixtures/foo/package.json deleted file mode 100644 index da86787a..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/foo/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "foo", - "version": "1.0.0" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json deleted file mode 100644 index aa2be496..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "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" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/internal/file.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/internal/file.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/y/y.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/y/y.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/internal/i.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/internal/i.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/nested/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js deleted file mode 100644 index e5b70a86..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = { nested: "nested" } diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-3/nested/f/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-3/nested/f/nested/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-4/f/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-4/f/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f$/$.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f$/$.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f/$.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f/$.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/nested/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/a.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/a.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/b.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/dir/b.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/dir/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/index.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json deleted file mode 100644 index 8d8d3a46..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "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/lib2/", "./lib/"], - "node": "./lib/", - "default": "./lib/" - }, - "./dist/a.js": "./../../a.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/c/index.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/c/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/imports-field/package.json deleted file mode 100644 index 248351a9..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "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" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/a.js b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json deleted file mode 100644 index ded7faa2..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json +++ /dev/null @@ -1,2 +0,0 @@ -{ - "main": "./a.js", diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/a.js b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/package.json b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/package.json deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/issue-238/package.json b/fixtures/enhanced_resolve/test/fixtures/issue-238/package.json deleted file mode 100644 index 352055cd..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/issue-238/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "private": true -} diff --git a/fixtures/enhanced_resolve/test/fixtures/issue-238/src/a/config.js b/fixtures/enhanced_resolve/test/fixtures/issue-238/src/a/config.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/issue-238/src/common/config/myObjectFile.js b/fixtures/enhanced_resolve/test/fixtures/issue-238/src/common/config/myObjectFile.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/lib.js b/fixtures/enhanced_resolve/test/fixtures/lib.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/lib/complex1.js b/fixtures/enhanced_resolve/test/fixtures/lib/complex1.js deleted file mode 100644 index b3de3d70..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/lib/complex1.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "lib complex1"; diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self/index.js b/fixtures/enhanced_resolve/test/fixtures/main-field-self/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json b/fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json deleted file mode 100644 index a2b6f341..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "./" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self2/index.js b/fixtures/enhanced_resolve/test/fixtures/main-field-self2/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json b/fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json deleted file mode 100644 index 4fa6f730..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "." -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main1.js b/fixtures/enhanced_resolve/test/fixtures/main1.js deleted file mode 100644 index 168f2a1e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main1.js +++ /dev/null @@ -1,9 +0,0 @@ -var a = require("./a"); -if (x) { - for (var i = 0; i < 100; i++) { - while (true) require("./b"); - do { - i++; - } while (require("m1/a")()); - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main2.js b/fixtures/enhanced_resolve/test/fixtures/main2.js deleted file mode 100644 index 39f062b1..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main2.js +++ /dev/null @@ -1,12 +0,0 @@ -var 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"); - }); - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main3.js b/fixtures/enhanced_resolve/test/fixtures/main3.js deleted file mode 100644 index 1c180166..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main3.js +++ /dev/null @@ -1,4 +0,0 @@ -var a = require("./a"); -require.ensure([], function(require) { - require("./c.js"); -}); diff --git a/fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js b/fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js deleted file mode 100644 index 997c1051..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is nested m1/a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/no#fragment/#/#.js b/fixtures/enhanced_resolve/test/fixtures/no#fragment/#/#.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/no.js b/fixtures/enhanced_resolve/test/fixtures/no.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/browser.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/browser.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/main.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json deleted file mode 100644 index c469e1fd..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "main": "./main.js", - "browser": "./browser.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js deleted file mode 100644 index 549620a5..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "the correct a.js"; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js deleted file mode 100644 index 5db6632e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = " :) " + require("m2/b.js"); diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js deleted file mode 100644 index d308569d..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require("m1/a") + require("m1"); diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js deleted file mode 100644 index cb8127e8..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "Step2"; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json deleted file mode 100644 index 8d6dfa56..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "dash-name", - "exports": "./index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json deleted file mode 100644 index 4fd8706e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "dash", - "exports": "./index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/invalidPackageJson/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/invalidPackageJson/package.json deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js deleted file mode 100644 index 46fc8e6c..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is m1/a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js deleted file mode 100644 index 8565c244..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is m1/b"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js deleted file mode 100644 index 34faaaf5..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "This is m2/b"; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/file.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/file.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js b/fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js deleted file mode 100644 index 997c1051..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is nested m1/a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/dir/index.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/dir/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/index.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/main.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/browser.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/browser.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/index.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json deleted file mode 100644 index e20ceaeb..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "main": "main.js", - "browser": { - "./package-alias/index.js": "./package-alias/browser.js", - "module": "pkg/dir/index" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/typescript/index.ts b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/typescript/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json deleted file mode 100644 index 4a1f838e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "@exports-field/core", - "version": "1.0.0", - "exports": { - ".": "./a.js", - "./x": "./a.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/prefer-pnp/alternative-modules/m1/b.js b/fixtures/enhanced_resolve/test/fixtures/prefer-pnp/alternative-modules/m1/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.css b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.css deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.js b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json deleted file mode 100644 index 14ab704d..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/index.css b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/index.css deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/module.js b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/module.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json deleted file mode 100644 index ee0eb71b..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "main": "../../../c.js", - "module": "module.js", - "style": "index.css" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/roots_fall_through/index.js b/fixtures/enhanced_resolve/test/fixtures/roots_fall_through/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/main.js b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json deleted file mode 100644 index 70a0f20f..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "browser": { - "./index.js": "./main.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/lib/index.js b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/lib/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/main.js b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json deleted file mode 100644 index 2af9e0d1..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "./main.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/shortcutdir.js/a.js b/fixtures/enhanced_resolve/test/fixtures/shortcutdir.js/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/b b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/b deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/c b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/c deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/a b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/a deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/b b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/b deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/b/foo/a b/fixtures/enhanced_resolve/test/fixtures/yield/b/foo/a deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/a b/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/a deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json b/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json deleted file mode 100644 index 0acc4b4c..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "foo", - "version": "1.0.0", - "browser": { - "./a": false - } -} diff --git "a/fixtures/enhanced_resolve/test/fixtures/\346\265\213\350\257\225.js" "b/fixtures/enhanced_resolve/test/fixtures/\346\265\213\350\257\225.js" deleted file mode 100644 index e69de29b..00000000 diff --git "a/fixtures/misc/\344\270\255\346\226\207/\344\270\255\346\226\207.js" "b/fixtures/misc/\344\270\255\346\226\207/\344\270\255\346\226\207.js" deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/pnpm/.gitignore b/fixtures/pnpm/.gitignore deleted file mode 100644 index 3c3629e6..00000000 --- a/fixtures/pnpm/.gitignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/fixtures/pnpm/package.json b/fixtures/pnpm/package.json deleted file mode 100644 index 78712e2b..00000000 --- a/fixtures/pnpm/package.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "name": "pnpm", - "version": "1.0.0", - "private": true, - "devDependencies": { - "axios": "1.6.2", - "styled-components": "6.1.1", - "postcss": "8.4.33" - } -} diff --git a/fixtures/pnpm/pnpm-lock.yaml b/fixtures/pnpm/pnpm-lock.yaml deleted file mode 100644 index e51dfd6a..00000000 --- a/fixtures/pnpm/pnpm-lock.yaml +++ /dev/null @@ -1,212 +0,0 @@ -lockfileVersion: '6.0' - -settings: - autoInstallPeers: true - excludeLinksFromLockfile: false - -devDependencies: - axios: - specifier: 1.6.2 - version: 1.6.2 - postcss: - specifier: 8.4.33 - version: 8.4.33 - styled-components: - specifier: 6.1.1 - version: 6.1.1(react-dom@18.2.0)(react@18.2.0) - -packages: - - /@emotion/is-prop-valid@1.2.1: - resolution: {integrity: sha512-61Mf7Ufx4aDxx1xlDeOm8aFFigGHE4z+0sKCa+IHCeZKiyP9RLD0Mmx7m8b9/Cf37f7NAvQOOJAbQQGVr5uERw==} - dependencies: - '@emotion/memoize': 0.8.1 - dev: true - - /@emotion/memoize@0.8.1: - resolution: {integrity: sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA==} - dev: true - - /@emotion/unitless@0.8.1: - resolution: {integrity: sha512-KOEGMu6dmJZtpadb476IsZBclKvILjopjUii3V+7MnXIQCYh8W3NgNcgwo21n9LXZX6EDIKvqfjYxXebDwxKmQ==} - dev: true - - /@types/stylis@4.2.4: - resolution: {integrity: sha512-36ZrGJ8fgtBr6nwNnuJ9jXIj+bn/pF6UoqmrQT7+Y99+tFFeHHsoR54+194dHdyhPjgbeoNz3Qru0oRt0l6ASQ==} - dev: true - - /asynckit@0.4.0: - resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} - dev: true - - /axios@1.6.2: - resolution: {integrity: sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A==} - dependencies: - follow-redirects: 1.15.3 - form-data: 4.0.0 - proxy-from-env: 1.1.0 - transitivePeerDependencies: - - debug - dev: true - - /camelize@1.0.1: - resolution: {integrity: sha512-dU+Tx2fsypxTgtLoE36npi3UqcjSSMNYfkqgmoEhtZrraP5VWq0K7FkWVTYa8eMPtnU/G2txVsfdCJTn9uzpuQ==} - dev: true - - /combined-stream@1.0.8: - resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} - engines: {node: '>= 0.8'} - dependencies: - delayed-stream: 1.0.0 - dev: true - - /css-color-keywords@1.0.0: - resolution: {integrity: sha512-FyyrDHZKEjXDpNJYvVsV960FiqQyXc/LlYmsxl2BcdMb2WPx0OGRVgTg55rPSyLSNMqP52R9r8geSp7apN3Ofg==} - engines: {node: '>=4'} - dev: true - - /css-to-react-native@3.2.0: - resolution: {integrity: sha512-e8RKaLXMOFii+02mOlqwjbD00KSEKqblnpO9e++1aXS1fPQOpS1YoqdVHBqPjHNoxeF2mimzVqawm2KCbEdtHQ==} - dependencies: - camelize: 1.0.1 - css-color-keywords: 1.0.0 - postcss-value-parser: 4.2.0 - dev: true - - /csstype@3.1.2: - resolution: {integrity: sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==} - dev: true - - /delayed-stream@1.0.0: - resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} - engines: {node: '>=0.4.0'} - dev: true - - /follow-redirects@1.15.3: - resolution: {integrity: sha512-1VzOtuEM8pC9SFU1E+8KfTjZyMztRsgEfwQl44z8A25uy13jSzTj6dyK2Df52iV0vgHCfBwLhDWevLn95w5v6Q==} - engines: {node: '>=4.0'} - peerDependencies: - debug: '*' - peerDependenciesMeta: - debug: - optional: true - dev: true - - /form-data@4.0.0: - resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==} - engines: {node: '>= 6'} - dependencies: - asynckit: 0.4.0 - combined-stream: 1.0.8 - mime-types: 2.1.35 - dev: true - - /js-tokens@4.0.0: - resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} - dev: true - - /loose-envify@1.4.0: - resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==} - hasBin: true - dependencies: - js-tokens: 4.0.0 - dev: true - - /mime-db@1.52.0: - resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} - engines: {node: '>= 0.6'} - dev: true - - /mime-types@2.1.35: - resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} - engines: {node: '>= 0.6'} - dependencies: - mime-db: 1.52.0 - dev: true - - /nanoid@3.3.7: - resolution: {integrity: sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==} - engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} - hasBin: true - dev: true - - /picocolors@1.0.0: - resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==} - dev: true - - /postcss-value-parser@4.2.0: - resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==} - dev: true - - /postcss@8.4.33: - resolution: {integrity: sha512-Kkpbhhdjw2qQs2O2DGX+8m5OVqEcbB9HRBvuYM9pgrjEFUg30A9LmXNlTAUj4S9kgtGyrMbTzVjH7E+s5Re2yg==} - engines: {node: ^10 || ^12 || >=14} - dependencies: - nanoid: 3.3.7 - picocolors: 1.0.0 - source-map-js: 1.0.2 - dev: true - - /proxy-from-env@1.1.0: - resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==} - dev: true - - /react-dom@18.2.0(react@18.2.0): - resolution: {integrity: sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==} - peerDependencies: - react: ^18.2.0 - dependencies: - loose-envify: 1.4.0 - react: 18.2.0 - scheduler: 0.23.0 - dev: true - - /react@18.2.0: - resolution: {integrity: sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==} - engines: {node: '>=0.10.0'} - dependencies: - loose-envify: 1.4.0 - dev: true - - /scheduler@0.23.0: - resolution: {integrity: sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw==} - dependencies: - loose-envify: 1.4.0 - dev: true - - /shallowequal@1.1.0: - resolution: {integrity: sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ==} - dev: true - - /source-map-js@1.0.2: - resolution: {integrity: sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==} - engines: {node: '>=0.10.0'} - dev: true - - /styled-components@6.1.1(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-cpZZP5RrKRIClBW5Eby4JM1wElLVP4NQrJbJ0h10TidTyJf4SIIwa3zLXOoPb4gJi8MsJ8mjq5mu2IrEhZIAcQ==} - engines: {node: '>= 16'} - peerDependencies: - react: '>= 16.8.0' - react-dom: '>= 16.8.0' - dependencies: - '@emotion/is-prop-valid': 1.2.1 - '@emotion/unitless': 0.8.1 - '@types/stylis': 4.2.4 - css-to-react-native: 3.2.0 - csstype: 3.1.2 - postcss: 8.4.33 - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - shallowequal: 1.1.0 - stylis: 4.3.0 - tslib: 2.6.2 - dev: true - - /stylis@4.3.0: - resolution: {integrity: sha512-E87pIogpwUsUwXw7dNyU4QDjdgVMy52m+XEOPEKUn161cCzWjjhPSQhByfd1CcNvrOLnXQ6OnnZDwnJrz/Z4YQ==} - dev: true - - /tslib@2.6.2: - resolution: {integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==} - dev: true diff --git a/fixtures/tsconfig/cases/builtins/thing.js b/fixtures/tsconfig/cases/builtins/thing.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/builtins/tsconfig.json b/fixtures/tsconfig/cases/builtins/tsconfig.json deleted file mode 100644 index 36aa1a4d..00000000 --- a/fixtures/tsconfig/cases/builtins/tsconfig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compilerOptions": { - "baseUrl": "." - } -} diff --git a/fixtures/tsconfig/cases/exports/index.js b/fixtures/tsconfig/cases/exports/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/exports/tsconfig.json b/fixtures/tsconfig/cases/exports/tsconfig.json deleted file mode 100644 index f0e3159b..00000000 --- a/fixtures/tsconfig/cases/exports/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-exports" -} diff --git a/fixtures/tsconfig/cases/extends-extension/base-tsconfig.json b/fixtures/tsconfig/cases/extends-extension/base-tsconfig.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/cases/extends-extension/base-tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/cases/extends-extension/foo.js b/fixtures/tsconfig/cases/extends-extension/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-extension/tsconfig.json b/fixtures/tsconfig/cases/extends-extension/tsconfig.json deleted file mode 100644 index 0ae4c6a3..00000000 --- a/fixtures/tsconfig/cases/extends-extension/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./base-tsconfig" -} diff --git a/fixtures/tsconfig/cases/extends-extensionless/foo.js b/fixtures/tsconfig/cases/extends-extensionless/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-extensionless/tsconfig.json b/fixtures/tsconfig/cases/extends-extensionless/tsconfig.json deleted file mode 100644 index c36cb7d4..00000000 --- a/fixtures/tsconfig/cases/extends-extensionless/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-field/conf" -} diff --git a/fixtures/tsconfig/cases/extends-multiple/foo.js b/fixtures/tsconfig/cases/extends-multiple/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-multiple/tsconfig.json b/fixtures/tsconfig/cases/extends-multiple/tsconfig.json deleted file mode 100644 index aa2ae783..00000000 --- a/fixtures/tsconfig/cases/extends-multiple/tsconfig.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": ["../extends-extension", "../extends-paths"], - "compilerOptions": { - "baseUrl": ".", - }, -} diff --git a/fixtures/tsconfig/cases/extends-not-found/index.js b/fixtures/tsconfig/cases/extends-not-found/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-not-found/tsconfig.json b/fixtures/tsconfig/cases/extends-not-found/tsconfig.json deleted file mode 100644 index 99df91da..00000000 --- a/fixtures/tsconfig/cases/extends-not-found/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./not-found" -} diff --git a/fixtures/tsconfig/cases/extends-paths/src/index.js b/fixtures/tsconfig/cases/extends-paths/src/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-paths/tsconfig.base.json b/fixtures/tsconfig/cases/extends-paths/tsconfig.base.json deleted file mode 100644 index 5c64b067..00000000 --- a/fixtures/tsconfig/cases/extends-paths/tsconfig.base.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "@/*": ["./*"] - } - } -} diff --git a/fixtures/tsconfig/cases/extends-paths/tsconfig.json b/fixtures/tsconfig/cases/extends-paths/tsconfig.json deleted file mode 100644 index 51086018..00000000 --- a/fixtures/tsconfig/cases/extends-paths/tsconfig.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": "./tsconfig.base.json", - "compilerOptions": { - "baseUrl": "src", - }, -} diff --git a/fixtures/tsconfig/cases/field/index.js b/fixtures/tsconfig/cases/field/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/field/tsconfig.json b/fixtures/tsconfig/cases/field/tsconfig.json deleted file mode 100644 index 9f86c3f4..00000000 --- a/fixtures/tsconfig/cases/field/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-field" -} diff --git a/fixtures/tsconfig/cases/index/index.js b/fixtures/tsconfig/cases/index/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/index/tsconfig.json b/fixtures/tsconfig/cases/index/tsconfig.json deleted file mode 100644 index d20b1774..00000000 --- a/fixtures/tsconfig/cases/index/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-index" -} diff --git a/fixtures/tsconfig/cases/paths_template_variable/foo.js b/fixtures/tsconfig/cases/paths_template_variable/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json b/fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json deleted file mode 100644 index a1a37bb6..00000000 --- a/fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "../../tsconfig_template_variable.json" -} diff --git a/fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json b/fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json deleted file mode 100644 index e7d8e5e5..00000000 --- a/fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "compilerOptions": { - "composite": true, - "paths": { - "foo": ["${configDir}/foo.js"] - } - } -} diff --git a/fixtures/tsconfig/cases/project_references/app/aliased/index.ts b/fixtures/tsconfig/cases/project_references/app/aliased/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/app/index.ts b/fixtures/tsconfig/cases/project_references/app/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/app/tsconfig.json b/fixtures/tsconfig/cases/project_references/app/tsconfig.json deleted file mode 100644 index 7036d2bb..00000000 --- a/fixtures/tsconfig/cases/project_references/app/tsconfig.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "extends": "../tsconfig.base.json", - "compilerOptions": { - "baseUrl": "./", - "paths": { - "@/*": ["./aliased/*"] - } - }, - "references": [ - { - "path": "../project_a/conf.json" - }, - { - "path": "../project_b" - }, - { - "path": "../project_c/tsconfig.json" - }, - { - "path": "../../paths_template_variable/tsconfig2.json" - } - ] -} diff --git a/fixtures/tsconfig/cases/project_references/project_a/aliased/index.ts b/fixtures/tsconfig/cases/project_references/project_a/aliased/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_a/conf.json b/fixtures/tsconfig/cases/project_references/project_a/conf.json deleted file mode 100644 index 4d389d7a..00000000 --- a/fixtures/tsconfig/cases/project_references/project_a/conf.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "compilerOptions": { - "composite": true, - "paths": { - "@/*": ["./aliased/*"] - } - } -} diff --git a/fixtures/tsconfig/cases/project_references/project_a/index.ts b/fixtures/tsconfig/cases/project_references/project_a/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_b/src/aliased/index.ts b/fixtures/tsconfig/cases/project_references/project_b/src/aliased/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_b/tsconfig.json b/fixtures/tsconfig/cases/project_references/project_b/tsconfig.json deleted file mode 100644 index 4ab05cd8..00000000 --- a/fixtures/tsconfig/cases/project_references/project_b/tsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "compilerOptions": { - "composite": true, - "baseUrl": "./src", - "paths": { - "@/*": ["./aliased/*"] - } - } -} diff --git a/fixtures/tsconfig/cases/project_references/project_c/index.ts b/fixtures/tsconfig/cases/project_references/project_c/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_c/tsconfig.json b/fixtures/tsconfig/cases/project_references/project_c/tsconfig.json deleted file mode 100644 index fe520939..00000000 --- a/fixtures/tsconfig/cases/project_references/project_c/tsconfig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compilerOptions": { - "composite": true - } -} diff --git a/fixtures/tsconfig/cases/project_references/tsconfig.base.json b/fixtures/tsconfig/cases/project_references/tsconfig.base.json deleted file mode 100644 index 88ccffe7..00000000 --- a/fixtures/tsconfig/cases/project_references/tsconfig.base.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "compilerOptions": { - } -} diff --git a/fixtures/tsconfig/cases/suffixes/a.ios.ts b/fixtures/tsconfig/cases/suffixes/a.ios.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/a.ts b/fixtures/tsconfig/cases/suffixes/a.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/b.ts b/fixtures/tsconfig/cases/suffixes/b.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/c-test.ts b/fixtures/tsconfig/cases/suffixes/c-test.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/index.ts b/fixtures/tsconfig/cases/suffixes/index.ts deleted file mode 100644 index b09939b9..00000000 --- a/fixtures/tsconfig/cases/suffixes/index.ts +++ /dev/null @@ -1 +0,0 @@ -import './a'; diff --git a/fixtures/tsconfig/cases/suffixes/tsconfig.json b/fixtures/tsconfig/cases/suffixes/tsconfig.json deleted file mode 100644 index 4c2ccc8f..00000000 --- a/fixtures/tsconfig/cases/suffixes/tsconfig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compilerOptions": { - "moduleSuffixes": [".ios", "-test", ""] - } -} diff --git a/fixtures/tsconfig/cases/trailing-comma/bar.js b/fixtures/tsconfig/cases/trailing-comma/bar.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/trailing-comma/index.js b/fixtures/tsconfig/cases/trailing-comma/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/trailing-comma/tsconfig.json b/fixtures/tsconfig/cases/trailing-comma/tsconfig.json deleted file mode 100644 index 6dc20ca5..00000000 --- a/fixtures/tsconfig/cases/trailing-comma/tsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "compilerOptions": { - "paths": { - /* some comment */ - "foo": ["bar.js"], - }, - }, - // another comment -} diff --git a/fixtures/tsconfig/foo.js b/fixtures/tsconfig/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/nested/index.js b/fixtures/tsconfig/nested/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/nested/test.js b/fixtures/tsconfig/nested/test.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/nested/tsconfig.json b/fixtures/tsconfig/nested/tsconfig.json deleted file mode 100644 index 6deb3011..00000000 --- a/fixtures/tsconfig/nested/tsconfig.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "extends": "..", - "compilerOptions": { - "paths": { - "ts-path": ["test.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-exports/conf.json b/fixtures/tsconfig/node_modules/tsconfig-exports/conf.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-exports/conf.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-exports/foo.js b/fixtures/tsconfig/node_modules/tsconfig-exports/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-exports/package.json b/fixtures/tsconfig/node_modules/tsconfig-exports/package.json deleted file mode 100644 index be0ddee6..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-exports/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "tsconfig-exports", - "private": true, - "exports": { - ".": "./conf.json" - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-field/conf.json b/fixtures/tsconfig/node_modules/tsconfig-field/conf.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-field/conf.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-field/foo.js b/fixtures/tsconfig/node_modules/tsconfig-field/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-field/package.json b/fixtures/tsconfig/node_modules/tsconfig-field/package.json deleted file mode 100644 index 7138fdde..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-field/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "tsconfig-field", - "private": true, - "tsconfig": "conf.json" -} \ No newline at end of file diff --git a/fixtures/tsconfig/node_modules/tsconfig-index/foo.js b/fixtures/tsconfig/node_modules/tsconfig-index/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-index/package.json b/fixtures/tsconfig/node_modules/tsconfig-index/package.json deleted file mode 100644 index eb2431e7..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-index/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "tsconfig-index", - "private": true -} \ No newline at end of file diff --git a/fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json b/fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-not-used/foo.js b/fixtures/tsconfig/node_modules/tsconfig-not-used/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json b/fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json deleted file mode 100644 index eb16d127..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "ts-path": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/package.json b/fixtures/tsconfig/package.json deleted file mode 100755 index f48acd1c..00000000 --- a/fixtures/tsconfig/package.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "name": "resolver", - "private": true, - "alias": { - "aliased": "foo", - "aliased-file": "./bar.js", - "something": "./nested/test.js", - "aliasedfolder": "./nested", - "aliasedabsolute": "/nested", - "foo/bar": "./bar.js", - "glob/*/*": "./nested/$2", - "./baz": "./bar.js", - "url": false - }, - "imports": { - "#test": "./bar.js" - }, - "dependencies": { - "foo": "^0.3.4" - }, - "peerDependencies": { - "bar": "*" - } -} diff --git a/fixtures/tsconfig/tsconfig.json b/fixtures/tsconfig/tsconfig.json deleted file mode 100644 index eb16d127..00000000 --- a/fixtures/tsconfig/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "ts-path": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/tsconfig_template_variable.json b/fixtures/tsconfig/tsconfig_template_variable.json deleted file mode 100644 index 6f272344..00000000 --- a/fixtures/tsconfig/tsconfig_template_variable.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["${configDir}/foo.js"] - } - } -} diff --git a/napi/__test__/resolver.spec.mjs b/napi/__test__/resolver.spec.mjs deleted file mode 100644 index ac6ee0ef..00000000 --- a/napi/__test__/resolver.spec.mjs +++ /dev/null @@ -1,260 +0,0 @@ -import { join } from 'node:path' -import { fileURLToPath } from 'node:url' - -import test from 'ava' - -let ResolverFactory - -if (process.env.WASI_TEST) { - const wasi = await import('../resolver.wasi.cjs') - ResolverFactory = wasi.ResolverFactory -} else { - const napi = await import('../index.js') - ResolverFactory = napi.ResolverFactory -} - -const currentDir = join(fileURLToPath(import.meta.url), '..') - -const enhancedResolveRoot = join( - currentDir, - '..', - '..', - 'fixtures', - 'enhanced_resolve', - 'test', - 'fixtures' -) - -// https://github.com/webpack/enhanced-resolve/blob/main/test/resolve.test.js - -for (const [title, context, request, expected] of [ - [ - 'absolute path', - enhancedResolveRoot, - join(enhancedResolveRoot, 'main1.js'), - join(enhancedResolveRoot, 'main1.js'), - ], - [ - 'file with .js', - enhancedResolveRoot, - './main1.js', - join(enhancedResolveRoot, 'main1.js'), - ], - [ - 'file without extension', - enhancedResolveRoot, - './main1', - join(enhancedResolveRoot, 'main1.js'), - ], - [ - 'another file with .js', - enhancedResolveRoot, - './a.js', - join(enhancedResolveRoot, 'a.js'), - ], - [ - 'another file without extension', - enhancedResolveRoot, - './a', - join(enhancedResolveRoot, 'a.js'), - ], - [ - 'file in module with .js', - enhancedResolveRoot, - 'm1/a.js', - join(enhancedResolveRoot, 'node_modules/m1/a.js'), - ], - [ - 'file in module without extension', - enhancedResolveRoot, - 'm1/a', - join(enhancedResolveRoot, 'node_modules/m1/a.js'), - ], - [ - 'another file in module without extension', - enhancedResolveRoot, - 'complexm/step1', - join(enhancedResolveRoot, 'node_modules/complexm/step1.js'), - ], - [ - 'from submodule to file in sibling module', - join(enhancedResolveRoot, 'node_modules/complexm'), - 'm2/b.js', - join(enhancedResolveRoot, 'node_modules/m2/b.js'), - ], - [ - 'from nested directory to overwritten file in module', - join(enhancedResolveRoot, 'multiple_modules'), - 'm1/a.js', - join(enhancedResolveRoot, 'multiple_modules/node_modules/m1/a.js'), - ], - [ - 'from nested directory to not overwritten file in module', - join(enhancedResolveRoot, 'multiple_modules'), - 'm1/b.js', - join(enhancedResolveRoot, 'node_modules/m1/b.js'), - ], - [ - 'file with query', - enhancedResolveRoot, - './main1.js?query', - join(enhancedResolveRoot, 'main1.js?query'), - ], - [ - 'file with fragment', - enhancedResolveRoot, - './main1.js#fragment', - join(enhancedResolveRoot, 'main1.js#fragment'), - ], - [ - 'file with fragment and query', - enhancedResolveRoot, - './main1.js#fragment?query', - join(enhancedResolveRoot, 'main1.js#fragment?query'), - ], - [ - 'file with query and fragment', - enhancedResolveRoot, - './main1.js?#fragment', - join(enhancedResolveRoot, 'main1.js?#fragment'), - ], - - [ - 'file with query (unicode)', - enhancedResolveRoot, - './测试.js?query', - join(enhancedResolveRoot, '测试.js?query'), - ], - [ - 'file with fragment (unicode)', - enhancedResolveRoot, - './测试.js#fragment', - join(enhancedResolveRoot, '测试.js#fragment'), - ], - [ - 'file with fragment and query (unicode)', - enhancedResolveRoot, - './测试.js#fragment?query', - join(enhancedResolveRoot, '测试.js#fragment?query'), - ], - [ - 'file with query and fragment (unicode)', - enhancedResolveRoot, - './测试.js?#fragment', - join(enhancedResolveRoot, '测试.js?#fragment'), - ], - - [ - 'file in module with query', - enhancedResolveRoot, - 'm1/a?query', - join(enhancedResolveRoot, 'node_modules/m1/a.js?query'), - ], - [ - 'file in module with fragment', - enhancedResolveRoot, - 'm1/a#fragment', - join(enhancedResolveRoot, 'node_modules/m1/a.js#fragment'), - ], - [ - 'file in module with fragment and query', - enhancedResolveRoot, - 'm1/a#fragment?query', - join(enhancedResolveRoot, 'node_modules/m1/a.js#fragment?query'), - ], - [ - 'file in module with query and fragment', - enhancedResolveRoot, - 'm1/a?#fragment', - join(enhancedResolveRoot, 'node_modules/m1/a.js?#fragment'), - ], - [ - 'differ between directory and file, resolve file', - enhancedResolveRoot, - './dirOrFile', - join(enhancedResolveRoot, 'dirOrFile.js'), - ], - [ - 'differ between directory and file, resolve directory', - enhancedResolveRoot, - './dirOrFile/', - join(enhancedResolveRoot, 'dirOrFile/index.js'), - ], - [ - 'find node_modules outside of node_modules', - join(enhancedResolveRoot, 'browser-module/node_modules'), - 'm1/a', - join(enhancedResolveRoot, 'node_modules/m1/a.js'), - ], - [ - "don't crash on main field pointing to self", - enhancedResolveRoot, - './main-field-self', - join(enhancedResolveRoot, './main-field-self/index.js'), - ], - [ - "don't crash on main field pointing to self (2)", - enhancedResolveRoot, - './main-field-self2', - join(enhancedResolveRoot, './main-field-self2/index.js'), - ], - // enhanced-resolve has `#` prepended with a `\0`, they are removed from the - // following 3 expected test results. - // See https://github.com/webpack/enhanced-resolve#escaping - [ - 'handle fragment edge case (no fragment)', - enhancedResolveRoot, - './no#fragment/#/#', - join(enhancedResolveRoot, 'no#fragment', '#', '#.js'), - ], - [ - 'handle fragment edge case (fragment)', - enhancedResolveRoot, - './no#fragment/#/', - join(enhancedResolveRoot, 'no.js#fragment') + '/#/', - ], - [ - 'handle fragment escaping', - enhancedResolveRoot, - './no\0#fragment/\0#/\0##fragment', - join(enhancedResolveRoot, 'no#fragment', '#', '#.js#fragment'), - ], -]) { - test(title, (t) => { - const resolver = new ResolverFactory({ - modules: ['src/a', 'src/b', 'src/common', 'node_modules'], - extensions: ['.js', '.jsx', '.ts', '.tsx'], - }) - - t.is(resolver.sync(context, request).path, expected) - }) -} - -test('resolve pnpm package', (t) => { - const rootDir = join(currentDir, '..', '..'); - const pnpmProjectPath = join(rootDir, 'fixtures', 'pnpm') - const resolver = new ResolverFactory({ - aliasFields: ['browser'], - }) - t.deepEqual(resolver.sync(pnpmProjectPath, 'styled-components'), { - path: join( - rootDir, - 'node_modules/.pnpm/styled-components@6.1.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/styled-components/dist/styled-components.browser.cjs.js' - ), - }) - t.deepEqual( - resolver.sync( - join( - rootDir, - 'node_modules/.pnpm/styled-components@6.1.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/styled-components' - ), - 'react' - ), - { - path: join( - rootDir, - 'node_modules/.pnpm/react@18.3.1/node_modules/react/index.js' - ), - } - ) -}) diff --git a/napi/src/lib.rs b/napi/src/lib.rs deleted file mode 100644 index 238f99c4..00000000 --- a/napi/src/lib.rs +++ /dev/null @@ -1,166 +0,0 @@ -extern crate napi; -extern crate napi_derive; -extern crate oxc_resolver; - -use std::path::{Path, PathBuf}; - -use napi_derive::napi; -use oxc_resolver::{ResolveOptions, Resolver}; - -use self::options::{NapiResolveOptions, StrOrStrList}; - -mod options; - -#[napi(object)] -pub struct ResolveResult { - pub path: Option, - pub error: Option, -} - -fn resolve(resolver: &Resolver, path: &Path, request: &str) -> ResolveResult { - match resolver.resolve(path, request) { - Ok(resolution) => ResolveResult { - path: Some(resolution.full_path().to_string_lossy().to_string()), - error: None, - }, - Err(err) => ResolveResult { path: None, error: Some(err.to_string()) }, - } -} - -#[allow(clippy::needless_pass_by_value)] -#[napi] -pub fn sync(path: String, request: String) -> ResolveResult { - let path = PathBuf::from(path); - let resolver = Resolver::new(ResolveOptions::default()); - resolve(&resolver, &path, &request) -} - -#[napi] -pub struct ResolverFactory { - resolver: Resolver, -} - -#[napi] -impl ResolverFactory { - #[napi(constructor)] - pub fn new(options: NapiResolveOptions) -> Self { - Self { resolver: Resolver::new(Self::normalize_options(options)) } - } - - #[napi] - pub fn default() -> Self { - let default_options = ResolveOptions::default(); - Self { resolver: Resolver::new(default_options) } - } - - /// Clone the resolver using the same underlying cache. - #[napi] - pub fn clone_with_options(&self, options: NapiResolveOptions) -> Self { - Self { resolver: self.resolver.clone_with_options(Self::normalize_options(options)) } - } - - /// Clear the underlying cache. - #[napi] - pub fn clear_cache(&self) { - self.resolver.clear_cache(); - } - - #[allow(clippy::needless_pass_by_value)] - #[napi] - pub fn sync(&self, path: String, request: String) -> ResolveResult { - let path = PathBuf::from(path); - resolve(&self.resolver, &path, &request) - } - - fn normalize_options(op: NapiResolveOptions) -> ResolveOptions { - let default = ResolveOptions::default(); - // merging options - ResolveOptions { - tsconfig: op.tsconfig.map(|tsconfig| tsconfig.into()), - alias: op - .alias - .map(|alias| { - alias - .into_iter() - .map(|(k, v)| { - let v = v - .into_iter() - .map(|item| match item { - Some(path) => oxc_resolver::AliasValue::from(path), - None => oxc_resolver::AliasValue::Ignore, - }) - .collect(); - (k, v) - }) - .collect::>() - }) - .unwrap_or(default.alias), - alias_fields: op - .alias_fields - .map(|o| o.into_iter().map(|x| StrOrStrList(x).into()).collect::>()) - .unwrap_or(default.alias_fields), - condition_names: op.condition_names.unwrap_or(default.condition_names), - description_files: op.description_files.unwrap_or(default.description_files), - enforce_extension: op - .enforce_extension - .map(|enforce_extension| enforce_extension.into()) - .unwrap_or(default.enforce_extension), - exports_fields: op - .exports_fields - .map(|o| o.into_iter().map(|x| StrOrStrList(x).into()).collect::>()) - .unwrap_or(default.exports_fields), - imports_fields: op - .imports_fields - .map(|o| o.into_iter().map(|x| StrOrStrList(x).into()).collect::>()) - .unwrap_or(default.imports_fields), - extension_alias: op - .extension_alias - .map(|extension_alias| extension_alias.into_iter().collect::>()) - .unwrap_or(default.extension_alias), - extensions: op.extensions.unwrap_or(default.extensions), - fallback: op - .fallback - .map(|fallback| { - fallback - .into_iter() - .map(|(k, v)| { - let v = v - .into_iter() - .map(|item| match item { - Some(path) => oxc_resolver::AliasValue::from(path), - None => oxc_resolver::AliasValue::Ignore, - }) - .collect(); - (k, v) - }) - .collect::>() - }) - .unwrap_or(default.fallback), - fully_specified: op.fully_specified.unwrap_or(default.fully_specified), - main_fields: op - .main_fields - .map(|o| StrOrStrList(o).into()) - .unwrap_or(default.main_fields), - main_files: op.main_files.unwrap_or(default.main_files), - modules: op.modules.map(|o| StrOrStrList(o).into()).unwrap_or(default.modules), - resolve_to_context: op.resolve_to_context.unwrap_or(default.resolve_to_context), - prefer_relative: op.prefer_relative.unwrap_or(default.prefer_relative), - prefer_absolute: op.prefer_absolute.unwrap_or(default.prefer_absolute), - restrictions: op - .restrictions - .map(|restrictions| { - restrictions - .into_iter() - .map(|restriction| restriction.into()) - .collect::>() - }) - .unwrap_or(default.restrictions), - roots: op - .roots - .map(|roots| roots.into_iter().map(PathBuf::from).collect::>()) - .unwrap_or(default.roots), - symlinks: op.symlinks.unwrap_or(default.symlinks), - builtin_modules: op.builtin_modules.unwrap_or(default.builtin_modules), - } - } -} diff --git a/napi/src/options.rs b/napi/src/options.rs deleted file mode 100644 index ea35672f..00000000 --- a/napi/src/options.rs +++ /dev/null @@ -1,261 +0,0 @@ -use std::path::PathBuf; - -use napi::Either; -use napi_derive::napi; -use std::collections::HashMap; - -/// Module Resolution Options -/// -/// Options are directly ported from [enhanced-resolve](https://github.com/webpack/enhanced-resolve#resolver-options). -/// -/// See [webpack resolve](https://webpack.js.org/configuration/resolve/) for information and examples -#[derive(Debug, Clone)] -#[napi(object)] -pub struct NapiResolveOptions { - /// Path to TypeScript configuration file. - /// - /// Default `None` - pub tsconfig: Option, - - /// Alias for [ResolveOptions::alias] and [ResolveOptions::fallback]. - /// - /// For the second value of the tuple, `None -> AliasValue::Ignore`, Some(String) -> - /// AliasValue::Path(String)` - /// Create aliases to import or require certain modules more easily. - /// A trailing $ can also be added to the given object's keys to signify an exact match. - pub alias: Option>>>, - - /// A list of alias fields in description files. - /// Specify a field, such as `browser`, to be parsed according to [this specification](https://github.com/defunctzombie/package-browser-field-spec). - /// Can be a path to json object such as `["path", "to", "exports"]`. - /// - /// Default `[]` - #[napi(ts_type = "(string | string[])[]")] - pub alias_fields: Option>, - - /// Condition names for exports field which defines entry points of a package. - /// The key order in the exports field is significant. During condition matching, earlier entries have higher priority and take precedence over later entries. - /// - /// Default `[]` - pub condition_names: Option>, - - /// The JSON files to use for descriptions. (There was once a `bower.json`.) - /// - /// Default `["package.json"]` - pub description_files: Option>, - - /// If true, it will not allow extension-less files. - /// So by default `require('./foo')` works if `./foo` has a `.js` extension, - /// but with this enabled only `require('./foo.js')` will work. - /// - /// Default to `true` when [ResolveOptions::extensions] contains an empty string. - /// Use `Some(false)` to disable the behavior. - /// See - /// - /// Default None, which is the same as `Some(false)` when the above empty rule is not applied. - pub enforce_extension: Option, - - /// A list of exports fields in description files. - /// Can be a path to json object such as `["path", "to", "exports"]`. - /// - /// Default `[["exports"]]`. - #[napi(ts_type = "(string | string[])[]")] - pub exports_fields: Option>, - - /// Fields from `package.json` which are used to provide the internal requests of a package - /// (requests starting with # are considered internal). - /// - /// Can be a path to a JSON object such as `["path", "to", "imports"]`. - /// - /// Default `[["imports"]]`. - #[napi(ts_type = "(string | string[])[]")] - pub imports_fields: Option>, - - /// An object which maps extension to extension aliases. - /// - /// Default `{}` - pub extension_alias: Option>>, - - /// Attempt to resolve these extensions in order. - /// If multiple files share the same name but have different extensions, - /// will resolve the one with the extension listed first in the array and skip the rest. - /// - /// Default `[".js", ".json", ".node"]` - pub extensions: Option>, - - /// Redirect module requests when normal resolving fails. - /// - /// Default `[]` - pub fallback: Option>>>, - - /// 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). - /// - /// See also webpack configuration [resolve.fullySpecified](https://webpack.js.org/configuration/module/#resolvefullyspecified) - /// - /// Default `false` - pub fully_specified: Option, - - /// A list of main fields in description files - /// - /// Default `["main"]`. - #[napi(ts_type = "string | string[]")] - pub main_fields: Option, - - /// The filename to be used while resolving directories. - /// - /// Default `["index"]` - pub main_files: Option>, - - /// A list of directories to resolve modules from, can be absolute path or folder name. - /// - /// Default `["node_modules"]` - #[napi(ts_type = "string | string[]")] - pub modules: Option, - - /// Resolve to a context instead of a file. - /// - /// Default `false` - pub resolve_to_context: Option, - - /// Prefer to resolve module requests as relative requests instead of using modules from node_modules directories. - /// - /// Default `false` - pub prefer_relative: Option, - - /// Prefer to resolve server-relative urls as absolute paths before falling back to resolve in ResolveOptions::roots. - /// - /// Default `false` - pub prefer_absolute: Option, - - /// A list of resolve restrictions to restrict the paths that a request can be resolved on. - /// - /// Default `[]` - pub restrictions: Option>, - - /// A list of directories where requests of server-relative URLs (starting with '/') are resolved. - /// On non-Windows systems these requests are resolved as an absolute path first. - /// - /// Default `[]` - pub roots: Option>, - - /// Whether to resolve symlinks to their symlinked location. - /// When enabled, symlinked resources are resolved to their real path, not their symlinked location. - /// Note that this may cause module resolution to fail when using tools that symlink packages (like npm link). - /// - /// Default `true` - pub symlinks: Option, - - /// Whether to parse [module.builtinModules](https://nodejs.org/api/module.html#modulebuiltinmodules) or not. - /// For example, "zlib" will throw [crate::ResolveError::Builtin] when set to true. - /// - /// Default `false` - pub builtin_modules: Option, -} - -#[napi] -#[derive(Debug, PartialEq, Eq)] -pub enum EnforceExtension { - Auto, - Enabled, - Disabled, -} - -impl EnforceExtension { - pub fn is_auto(&self) -> bool { - *self == Self::Auto - } - - pub fn is_enabled(&self) -> bool { - *self == Self::Enabled - } - - pub fn is_disabled(&self) -> bool { - *self == Self::Disabled - } -} - -/// Alias Value for [ResolveOptions::alias] and [ResolveOptions::fallback]. -/// Use struct because napi don't support structured union now -#[napi(object)] -#[derive(Debug, Clone)] -pub struct Restriction { - pub path: Option, - pub regex: Option, -} - -/// Tsconfig Options -/// -/// Derived from [tsconfig-paths-webpack-plugin](https://github.com/dividab/tsconfig-paths-webpack-plugin#options) -#[napi(object)] -#[derive(Debug, Clone)] -pub struct TsconfigOptions { - /// Allows you to specify where to find the TypeScript configuration file. - /// You may provide - /// * a relative path to the configuration file. It will be resolved relative to cwd. - /// * an absolute path to the configuration file. - pub config_file: String, - - /// Support for Typescript Project References. - /// - /// * `'auto'`: use the `references` field from tsconfig of `config_file`. - /// * `string[]`: manually provided relative or absolute path. - #[napi(ts_type = "'auto' | string[]")] - pub references: Option>>, -} - -impl Into for Restriction { - fn into(self) -> oxc_resolver::Restriction { - match (self.path, self.regex) { - (None, None) => { - panic!("Should specify path or regex") - } - (None, Some(regex)) => oxc_resolver::Restriction::RegExp(regex), - (Some(path), None) => oxc_resolver::Restriction::Path(PathBuf::from(path)), - (Some(_), Some(_)) => { - panic!("Restriction can't be path and regex at the same time") - } - } - } -} - -impl Into for EnforceExtension { - fn into(self) -> oxc_resolver::EnforceExtension { - match self { - EnforceExtension::Auto => oxc_resolver::EnforceExtension::Auto, - EnforceExtension::Enabled => oxc_resolver::EnforceExtension::Enabled, - EnforceExtension::Disabled => oxc_resolver::EnforceExtension::Disabled, - } - } -} - -impl Into for TsconfigOptions { - fn into(self) -> oxc_resolver::TsconfigOptions { - oxc_resolver::TsconfigOptions { - config_file: PathBuf::from(self.config_file), - references: match self.references { - Some(Either::A(string)) if string.as_str() == "auto" => { - oxc_resolver::TsconfigReferences::Auto - } - Some(Either::A(opt)) => { - panic!("`{}` is not a valid option for tsconfig references", opt) - } - Some(Either::B(paths)) => oxc_resolver::TsconfigReferences::Paths( - paths.into_iter().map(PathBuf::from).collect::>(), - ), - None => oxc_resolver::TsconfigReferences::Disabled, - }, - } - } -} - -type StrOrStrListType = Either>; -pub struct StrOrStrList(pub StrOrStrListType); - -impl Into> for StrOrStrList { - fn into(self) -> Vec { - match self { - StrOrStrList(Either::A(s)) => Vec::from([s]), - StrOrStrList(Either::B(a)) => a, - } - } -} diff --git a/napi/tests/options.test.mjs b/napi/tests/options.test.mjs deleted file mode 100644 index 4a93efff..00000000 --- a/napi/tests/options.test.mjs +++ /dev/null @@ -1,59 +0,0 @@ -import { describe, it } from "node:test"; -import { ResolverFactory } from "../index.js"; -import * as assert from "node:assert"; -import * as path from "node:path"; - -const fixtureDir = new URL( - "../../fixtures/enhanced_resolve/test/fixtures", - import.meta.url -).pathname; - -describe("option", () => { - describe("aliasFields", () => { - it("should allow field string ", () => { - const resolver = new ResolverFactory({ aliasFields: ["browser"] }); - assert.match( - resolver.sync(fixtureDir, "./browser-module/lib/replaced.js").path, - /browser-module\/lib\/browser\.js$/ - ); - }); - it("should allow json path array", () => { - const resolver = new ResolverFactory({ - aliasFields: [["innerBrowser1", "field", "browser"]], - }); - - assert.match( - resolver.sync(fixtureDir, "./browser-module/lib/main1.js").path, - /browser-module\/lib\/main\.js$/ - ); - }); - }); - - describe("exportsFields", () => { - const createTest = (exportsFields) => { - const resolver = new ResolverFactory({ exportsFields }); - assert.match( - resolver.sync( - path.resolve(fixtureDir, "./exports-field3"), - "exports-field" - ).path, - /\/exports-field\/src\/index\.js$/ - ); - }; - it("should allow string as field item", createTest(["broken"])); - it("should allow json path array as field item", createTest([["broken"]])); - }); - - describe("mainFields", () => { - const createTest = (mainFields) => { - const resolver = new ResolverFactory({ mainFields }); - assert.match( - resolver.sync(fixtureDir, "../..").path, - /\/lib\/index\.js$/ - ); - }; - it("should use `'main'` as default", createTest(undefined)); - it("should allow field string", createTest("main")); - it("should allow field array", createTest(["main"])); - }); -}); diff --git a/npm/package.json b/npm/package.json index 6fa93185..b47e6b07 100644 --- a/npm/package.json +++ b/npm/package.json @@ -1,41 +1,30 @@ { - "name": "oxc-resolver", - "version": "1.8.1", - "description": "Oxc Resolver Node API", - "main": "index.js", - "browser": "browser.js", - "files": [ - "index.d.ts", - "index.js", - "browser.js" - ], - "license": "MIT", - "homepage": "https://oxc-project.github.io", - "repository": { - "type": "git", - "url": "git+https://github.com/oxc-project/oxc-resolver.git" - }, - "publishConfig": { - "registry": "https://registry.npmjs.org/", - "access": "public" - }, - "napi": { - "binaryName": "resolver", - "packageName": "@oxc-resolver/binding", - "targets": [ - "x86_64-pc-windows-msvc", - "aarch64-pc-windows-msvc", - "x86_64-unknown-linux-gnu", - "x86_64-unknown-linux-musl", - "aarch64-unknown-linux-gnu", - "aarch64-unknown-linux-musl", - "armv7-unknown-linux-gnueabihf", - "x86_64-apple-darwin", - "aarch64-apple-darwin", - "wasm32-wasip1-threads" - ] - }, - "funding": { - "url": "https://github.com/sponsors/Boshen" - } + "name": "oxc-resolver", + "description": "Oxc Resolver Node API", + "funding": { + "url": "https://github.com/sponsors/Boshen" + }, + "main": "index.js", + "browser": "browser.js", + "files": [ + "index.d.ts", + "index.js", + "browser.js" + ], + "napi": { + "binaryName": "resolver", + "packageName": "@oxc-resolver/binding", + "targets": [ + "x86_64-pc-windows-msvc", + "aarch64-pc-windows-msvc", + "x86_64-unknown-linux-gnu", + "x86_64-unknown-linux-musl", + "aarch64-unknown-linux-gnu", + "aarch64-unknown-linux-musl", + "armv7-unknown-linux-gnueabihf", + "x86_64-apple-darwin", + "aarch64-apple-darwin", + "wasm32-wasip1-threads" + ] + } } diff --git a/package.json b/package.json index 47300b76..a431e48f 100644 --- a/package.json +++ b/package.json @@ -1,33 +1,24 @@ { - "name": "@oxc-resolver/binding", - "private": true, - "version": "0.0.0", - "scripts": { - "build": "napi build --platform --release --package-json-path npm/package.json --manifest-path napi/Cargo.toml", - "build:debug": "napi build --platform --package-json-path npm/package.json --manifest-path napi/Cargo.toml", - "prepublishOnly": "napi pre-publish -t npm", - "test": "ava" - }, - "devDependencies": { - "@napi-rs/cli": "^3.0.0-alpha.43", - "@napi-rs/wasm-runtime": "^0.2.0", - "@types/node": "^20.10.4", - "ava": "^6.0.1", - "emnapi": "^1.0.0", - "typescript": "^5.3.3" - }, - "ava": { - "files": [ - "napi/__test__/*.spec.mjs" - ], - "cache": false - }, - "packageManager": "pnpm@9.3.0", - "repository": { - "type": "git", - "url": "git+https://github.com/oxc-project/oxc-resolver.git" - }, - "funding": { - "url": "https://github.com/sponsors/Boshen" - } + "name": "@oxc-resolver/binding", + "funding": { + "url": "https://github.com/sponsors/Boshen" + }, + "scripts": { + "build": "napi build --platform --release --package-json-path npm/package.json --manifest-path napi/Cargo.toml", + "build:debug": "napi build --platform --package-json-path npm/package.json --manifest-path napi/Cargo.toml", + "prepublishOnly": "napi pre-publish -t npm" + }, + "ava": { + "cache": false, + "files": [ + "napi/__test__/*.spec.mjs" + ] + }, + "devDependencies": { + "@napi-rs/cli": "^3.0.0-alpha.43", + "@napi-rs/wasm-runtime": "^0.2.0", + "@types/node": "^20.10.4", + "ava": "^6.0.1", + "emnapi": "^1.0.0" + } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml deleted file mode 100644 index 1e8670db..00000000 --- a/pnpm-lock.yaml +++ /dev/null @@ -1,2690 +0,0 @@ -lockfileVersion: '9.0' - -settings: - autoInstallPeers: true - excludeLinksFromLockfile: false - -importers: - - .: - devDependencies: - '@napi-rs/cli': - specifier: ^3.0.0-alpha.43 - version: 3.0.0-alpha.55(@emnapi/runtime@1.2.0)(emnapi@1.2.0) - '@napi-rs/wasm-runtime': - specifier: ^0.2.0 - version: 0.2.4 - '@types/node': - specifier: ^20.10.4 - version: 20.14.2 - ava: - specifier: ^6.0.1 - version: 6.1.3 - emnapi: - specifier: ^1.0.0 - version: 1.2.0 - typescript: - specifier: ^5.3.3 - version: 5.4.5 - - fixtures/pnpm: - devDependencies: - axios: - specifier: 1.6.2 - version: 1.6.2 - postcss: - specifier: 8.4.33 - version: 8.4.33 - styled-components: - specifier: 6.1.1 - version: 6.1.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - - npm: {} - -packages: - - '@emnapi/core@1.2.0': - resolution: {integrity: sha512-E7Vgw78I93we4ZWdYCb4DGAwRROGkMIXk7/y87UmANR+J6qsWusmC3gLt0H+O0KOt5e6O38U8oJamgbudrES/w==} - - '@emnapi/runtime@1.2.0': - resolution: {integrity: sha512-bV21/9LQmcQeCPEg3BDFtvwL6cwiTMksYNWQQ4KOxCZikEGalWtenoZ0wCiukJINlGCIi2KXx01g4FoH/LxpzQ==} - - '@emnapi/wasi-threads@1.0.1': - resolution: {integrity: sha512-iIBu7mwkq4UQGeMEM8bLwNK962nXdhodeScX4slfQnRhEMMzvYivHhutCIk8uojvmASXXPC2WNEjwxFWk72Oqw==} - - '@emotion/is-prop-valid@1.2.2': - resolution: {integrity: sha512-uNsoYd37AFmaCdXlg6EYD1KaPOaRWRByMCYzbKUX4+hhMfrxdVSelShywL4JVaAeM/eHUOSprYBQls+/neX3pw==} - - '@emotion/memoize@0.8.1': - resolution: {integrity: sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA==} - - '@emotion/unitless@0.8.1': - resolution: {integrity: sha512-KOEGMu6dmJZtpadb476IsZBclKvILjopjUii3V+7MnXIQCYh8W3NgNcgwo21n9LXZX6EDIKvqfjYxXebDwxKmQ==} - - '@inquirer/figures@1.0.3': - resolution: {integrity: sha512-ErXXzENMH5pJt5/ssXV0DfWUZqly8nGzf0UcBV9xTnP+KyffE2mqyxIMBrZ8ijQck2nU0TQm40EQB53YreyWHw==} - engines: {node: '>=18'} - - '@ljharb/through@2.3.13': - resolution: {integrity: sha512-/gKJun8NNiWGZJkGzI/Ragc53cOdcLNdzjLaIa+GEjguQs0ulsurx8WN0jijdK9yPqDvziX995sMRLyLt1uZMQ==} - engines: {node: '>= 0.4'} - - '@mapbox/node-pre-gyp@1.0.11': - resolution: {integrity: sha512-Yhlar6v9WQgUp/He7BdgzOz8lqMQ8sU+jkCq7Wx8Myc5YFJLbEe7lgui/V7G1qB1DJykHSGwreceSaD60Y0PUQ==} - hasBin: true - - '@napi-rs/cli@3.0.0-alpha.55': - resolution: {integrity: sha512-6XgBBTX8O28W5gcSzqYkI72UVJV6Y2YcyQNrEqak39JavJRLlXCv09uLF97raynXAOO50KeP6DEXFy5P8MR2sw==} - engines: {node: '>= 16'} - hasBin: true - peerDependencies: - '@emnapi/runtime': ^1.1.0 - emnapi: ^1.1.0 - peerDependenciesMeta: - '@emnapi/runtime': - optional: true - emnapi: - optional: true - - '@napi-rs/cross-toolchain@0.0.16': - resolution: {integrity: sha512-jwdjHT5L0m9MH0CmzDwPp0ckn/UO7afHCsPeo7NugHUvYgvlgS7SWhdMVgIgJW2HHqhcW/2nhaLLGpAU1c7QRQ==} - peerDependencies: - '@napi-rs/cross-toolchain-arm64-target-aarch64': ^0.0.16 - '@napi-rs/cross-toolchain-arm64-target-armv7': ^0.0.16 - '@napi-rs/cross-toolchain-arm64-target-x86_64': ^0.0.16 - '@napi-rs/cross-toolchain-x64-target-aarch64': ^0.0.16 - '@napi-rs/cross-toolchain-x64-target-armv7': ^0.0.16 - '@napi-rs/cross-toolchain-x64-target-x86_64': ^0.0.16 - peerDependenciesMeta: - '@napi-rs/cross-toolchain-arm64-target-aarch64': - optional: true - '@napi-rs/cross-toolchain-arm64-target-armv7': - optional: true - '@napi-rs/cross-toolchain-arm64-target-x86_64': - optional: true - '@napi-rs/cross-toolchain-x64-target-aarch64': - optional: true - '@napi-rs/cross-toolchain-x64-target-armv7': - optional: true - '@napi-rs/cross-toolchain-x64-target-x86_64': - optional: true - - '@napi-rs/lzma-android-arm-eabi@1.3.1': - resolution: {integrity: sha512-mtGOg8jXlc+pTBI86cqohfndS9UmOAkk9d5CChKMb8btVks70yhUN1e7YYS3QFbmoxbPs2Ee+wmuH1Khdc7B2w==} - engines: {node: '>= 10'} - cpu: [arm] - os: [android] - - '@napi-rs/lzma-android-arm64@1.3.1': - resolution: {integrity: sha512-4uGkQgAv9Tnc/i0k2eIgbhZgyzs94+iECWxz4MFZNcZ1fNGvGbRL2j+SITE4OmwrUn3TuFK/uYWfgzooq8E1Qg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [android] - - '@napi-rs/lzma-darwin-arm64@1.3.1': - resolution: {integrity: sha512-MZBg4iwHTS8icjTiCMdzh8kYrMmKBCEglFPa+vjI91R2XDwuuwSzqmpATRpmMH8cWUUWtGPF4fnxKzjgkzhd4Q==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [darwin] - - '@napi-rs/lzma-darwin-x64@1.3.1': - resolution: {integrity: sha512-7vte+1lYV7xgZERKH/pjAeh4T16aQASKOzu4op70pK6VP/64Plr5rrvqxQqQmlAIe4pwyo/RkFl1n4LXDod3xg==} - engines: {node: '>= 10'} - cpu: [x64] - os: [darwin] - - '@napi-rs/lzma-freebsd-x64@1.3.1': - resolution: {integrity: sha512-uBS74fynTqLUC3catIxyezCafn8UDlr2yxVV47vz1T6Vop2PGDz/cMQdV6rnLSjPE08Rv66ihM36mgf/MmOkOg==} - engines: {node: '>= 10'} - cpu: [x64] - os: [freebsd] - - '@napi-rs/lzma-linux-arm-gnueabihf@1.3.1': - resolution: {integrity: sha512-rrVLyqBJeN29gPJCNkPbZ7dAzaseEcERKyhjwM+DfbFrDUvtkEcrYPvo+iwE/NmF+OkZQkzcanrVMGnq/mcJYQ==} - engines: {node: '>= 10'} - cpu: [arm] - os: [linux] - - '@napi-rs/lzma-linux-arm64-gnu@1.3.1': - resolution: {integrity: sha512-vDmVsthRbX2opkgRirJJGKQxUP/spvyVM2Y5CyCWZ7sadSID3hA97r38gf9ISn/sJ8/r93IPWLq+iycudNKi+Q==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/lzma-linux-arm64-musl@1.3.1': - resolution: {integrity: sha512-x4m/J3hRdFd3IoqKc+4aBcSUkcuDEP7hH6vdss8bKNLjPfXmnG/lcHJEQX3hNnNOULPP8xVRxgiY8jeL62cnsw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/lzma-linux-x64-gnu@1.3.1': - resolution: {integrity: sha512-riB+Xg72NfH8Kcpq07omshVu0QsLW0v2bhywBNYxvA+t2dGGWSIEN1U/zazUXys+IEA6pBQKqLVseurWE6Cl8g==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/lzma-linux-x64-musl@1.3.1': - resolution: {integrity: sha512-JXLgJFwoeysxdSg7rdVYP8wrliCQVJlU5JcLYjRVSCL4P0mQTjnYi7R7VdaOkDACw/Fvlji7oIJXt0KiaDTcOw==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/lzma-wasm32-wasi@1.3.1': - resolution: {integrity: sha512-XTA9XTUtj0KPKuzNS2oi3bWN6tJodk00wwMd/TiKoEqx9Fe/zu+OfDGuXAn+xs+P7S3YCDHqjYinuTQMZ0ucJw==} - engines: {node: '>=14.0.0'} - cpu: [wasm32] - - '@napi-rs/lzma-win32-arm64-msvc@1.3.1': - resolution: {integrity: sha512-qLDfs9UEtLPPTN/FdSz3gSdlx86VwFQBuLBrQtaiYQtUTKZCOYV1Z1fXqFt5Zqa1HKV2oyXnwGcTI7RpcyXxtg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [win32] - - '@napi-rs/lzma-win32-ia32-msvc@1.3.1': - resolution: {integrity: sha512-rWNlxLFMIfvxzfdQCfeQ3D/HEnQG3vfladFYrXUx6ePXO6r+BLCGn6/LWSSuKlw4vKkb1iHEWsAVaRLIcJEMIA==} - engines: {node: '>= 10'} - cpu: [ia32] - os: [win32] - - '@napi-rs/lzma-win32-x64-msvc@1.3.1': - resolution: {integrity: sha512-SNfHNqEjabXfTL1+KRi0qiAhwIlZHhQystvfSYX6p1g+2trSC/3WUpUQ4fbbR7KyE31g2AAnwjXivnlQ0af/pg==} - engines: {node: '>= 10'} - cpu: [x64] - os: [win32] - - '@napi-rs/lzma@1.3.1': - resolution: {integrity: sha512-XyZoBlYNMvCulK/RmVK/0nB3j7IdH7HpqcrMMg0U+HqQqKRLOQBwvnKNBocPC1bZQ7iZuKWYTLn1ayZwTyek8w==} - engines: {node: '>= 10'} - - '@napi-rs/tar-android-arm-eabi@0.1.1': - resolution: {integrity: sha512-Ufa0ahZvE5KGrC2WBux5svCe/jvC+e8IgtleiicwqnfgTfbDknYyq/QuqkP1AnMp/IvTmx2iutCZt6OFIG0zAg==} - engines: {node: '>= 10'} - cpu: [arm] - os: [android] - - '@napi-rs/tar-android-arm64@0.1.1': - resolution: {integrity: sha512-KUu5fHIiIObSuZ/crHxUrQ243+LiCRKPwdCVLHwjtftqFjzls+R2Mp6GrpM41XxexDMN00SUta3kazi93Xr19A==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [android] - - '@napi-rs/tar-darwin-arm64@0.1.1': - resolution: {integrity: sha512-jaqgdX20iIga+2gzotQ78eF00Cm8vECocUYeMY62WqyzJNv/jx1dlOfELWEccOjpmawFT9tjWebsS9F1QMvSUg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [darwin] - - '@napi-rs/tar-darwin-x64@0.1.1': - resolution: {integrity: sha512-80sa32IxfRso9x9sGTFpfLSx3BnruyJODpSkUzalOCz9i14n5gOKA8KR/JrnSWwDz0p5l5P9kfQD3pu8Voj7WA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [darwin] - - '@napi-rs/tar-freebsd-x64@0.1.1': - resolution: {integrity: sha512-P7V1zBjjC1dCrTwtUzuzYM4AeZduigeCtd8qQw2IUZowM5AsmhMd77oYuXjdU29cEpKUpyYjJRxjPCzFy+WbAQ==} - engines: {node: '>= 10'} - cpu: [x64] - os: [freebsd] - - '@napi-rs/tar-linux-arm-gnueabihf@0.1.1': - resolution: {integrity: sha512-qpC71ILPkWKt8k1iJCYt5gjwcOkd2VFSQIelTRr12t5CVNKV04rE/TMdwFoCP7kxbtb9Fl2cZzCRISw2BhMCmQ==} - engines: {node: '>= 10'} - cpu: [arm] - os: [linux] - - '@napi-rs/tar-linux-arm64-gnu@0.1.1': - resolution: {integrity: sha512-71QgxcFJCog6O4Tauoge8D0ILkDGJTRk3ru7zG8PUFG1QXJ1kkiRikdT77YmoVxtomc9FUOt+bdEdU5Yn+3QUQ==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/tar-linux-arm64-musl@0.1.1': - resolution: {integrity: sha512-R2e7YEILPKc447N1hUt1zQuyy0st83HX6nhmtFywS1aOj76/3hzxLVrebGiiS6kifyCrO82o66CNTYe7DixMZw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/tar-linux-x64-gnu@0.1.1': - resolution: {integrity: sha512-tmy9q2LXUB2GQ+IgUzJn3+us52leplMu96ORyFq1iHQEelGSqXt4xi5DzU07JhX3obJPqVqkybtcRS4enBfmBA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/tar-linux-x64-musl@0.1.1': - resolution: {integrity: sha512-j5ePbe6vihApl0cGPPDUVTWZbf2mF4NhxngAoG2jp7AeX3cWP2O4pjsvaOraW6QfvWEMFPeER7S0b6eBS7duvA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/tar-wasm32-wasi@0.1.1': - resolution: {integrity: sha512-se0+DlOiIRt7mcz7BeOJDoZtCrROpKLwiAOGmNgrjQ/SZS7TnOPuwm3wy9XN9WLoepttEjCEem6UP8yD5GJuQg==} - engines: {node: '>=14.0.0'} - cpu: [wasm32] - - '@napi-rs/tar-win32-arm64-msvc@0.1.1': - resolution: {integrity: sha512-FDZPi2wC7RwzvodogigLh/pJvhqCTVTUqOYuHlLkPSUbSAGiEkI55wk9RqH3y3EdJQaDuzyqC0QKz5ket2U+GA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [win32] - - '@napi-rs/tar-win32-ia32-msvc@0.1.1': - resolution: {integrity: sha512-OPR9Tou5z5M912G7Kc7gkf1ltinbOQx5dS/OeDIWHvPGOfdFDIxt0YVKhzSLRJi43+zIDp8/+cbeMD/cKXfX8w==} - engines: {node: '>= 10'} - cpu: [ia32] - os: [win32] - - '@napi-rs/tar-win32-x64-msvc@0.1.1': - resolution: {integrity: sha512-hiv5KfhrMSg8tTRC2oQXVckVg1h6ZVjwbd5aF9Esl0V3p2TaNFwwbqgnAN4Gm/PmSnHWNL/IRTHkk3cOzDWihQ==} - engines: {node: '>= 10'} - cpu: [x64] - os: [win32] - - '@napi-rs/tar@0.1.1': - resolution: {integrity: sha512-FOMhwwlvoYjHaDBxP26K3D92ltw1Y/CC4CIjgC6qXdzW4MYNwTlEyI58smCM3k+nCVJH3kpOYyH3sgbK4WZA4A==} - engines: {node: '>= 10'} - - '@napi-rs/wasm-runtime@0.2.4': - resolution: {integrity: sha512-9zESzOO5aDByvhIAsOy9TbpZ0Ur2AJbUI7UT73kcUTS2mxAMHOBaa1st/jAymNoCtvrit99kkzT1FZuXVcgfIQ==} - - '@napi-rs/wasm-tools-android-arm-eabi@0.0.2': - resolution: {integrity: sha512-/b+UU3suXjW4P0DzHRNdrnebQtFKcQf/YMeZJH+xUlKgvwli5kbmWjx8Wqqz0VETVkUTuPqJMBDIVLyc+14FGw==} - engines: {node: '>= 10'} - cpu: [arm] - os: [android] - - '@napi-rs/wasm-tools-android-arm64@0.0.2': - resolution: {integrity: sha512-j57GbDflwJdZtT8pZj5fOV4JAP+LdKN+wzsUYs+QRUoBqpWbbUANudolqfw63bkS9sD4z7fbCuz8iwtJqzxTVA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [android] - - '@napi-rs/wasm-tools-darwin-arm64@0.0.2': - resolution: {integrity: sha512-P2ChgWgVuv9GwmbxN89R84KzIImoTqXINteEixUvmkdnhyFiR+I8deNs89Yed+5w8QLC6MEfrtRqLP9YI+NoQA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [darwin] - - '@napi-rs/wasm-tools-darwin-x64@0.0.2': - resolution: {integrity: sha512-T/kQQ0gt8+wau1Z821PKVAD76QhmwVoLs2CT7Z9tTBs2pJvwSCP0C/kQiQAHcJIMi7A2E9Ab/Mez0BERy50EFA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [darwin] - - '@napi-rs/wasm-tools-freebsd-x64@0.0.2': - resolution: {integrity: sha512-GnnHu+r5sfzuxC/1J5UMF/h3BOZnHb3NQZ5hmbCfZYCKzpzRxrAJhzRunlbRN+v0x8M/49dztVTYR3s7K4ooAw==} - engines: {node: '>= 10'} - cpu: [x64] - os: [freebsd] - - '@napi-rs/wasm-tools-linux-arm64-gnu@0.0.2': - resolution: {integrity: sha512-KnZdLT0OnKb1CG2kdt3/WvM43vr9i+FEwXCvSOVC/6Tsifz7ynhMg7LAVESILd03HubzQJfg9nbRsk0bQ+IOwg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/wasm-tools-linux-arm64-musl@0.0.2': - resolution: {integrity: sha512-HkpZOID2U8P6pWqK3mqZ8bxU5xcuT3iA2fO+jrxn78h006iYgfNmdc5JaVhHnHazMmk32xKhSV4iV0VUh8UWDg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/wasm-tools-linux-x64-gnu@0.0.2': - resolution: {integrity: sha512-YksJWBCyOalB9ogtP9+/dZKP+vR6+h7BmzMXaXMT71WW/GvIsifMVgv+DY/FRSNJQupp5Y+ugjqVAOUOc/G65g==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/wasm-tools-linux-x64-musl@0.0.2': - resolution: {integrity: sha512-sPtRxPMdw05KdTcxgSPMmSXG2+PiK3vJ/l2+g9hvjnnKtvslJN2Hr7j8zgzuoKRAUFPaJVe6+D2xVh5cpdqhww==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/wasm-tools-wasm32-wasi@0.0.2': - resolution: {integrity: sha512-muRvZK7AIuo88G2AxYx3gA59rHMQgoN004saQkBvXnz3K/DVHKfTZ6TtUebss8zI3dURU6xExL8drxFWYxjEbQ==} - engines: {node: '>=14.0.0'} - cpu: [wasm32] - - '@napi-rs/wasm-tools-win32-arm64-msvc@0.0.2': - resolution: {integrity: sha512-Cn13WQ+tpFqdVwx0DIWKbsI9auFyzVZV4F5UNOUeDt6GgOL+NndgJul0Pc9bSU6fi03AylMPfF/nTCaDWO2Wgw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [win32] - - '@napi-rs/wasm-tools-win32-ia32-msvc@0.0.2': - resolution: {integrity: sha512-xsg5DkIQi82a8rcx6246Y3XC8TIqHamY+/C6sIlPLaZEuHctDkMECAw0AANwRf5vN//D2oo2oljOuoYtB1GOKw==} - engines: {node: '>= 10'} - cpu: [ia32] - os: [win32] - - '@napi-rs/wasm-tools-win32-x64-msvc@0.0.2': - resolution: {integrity: sha512-yHigltEt33eq8bappvKsIliz4MxfMPn1M+NWbIFRWN+IS1Z57mhmc1osuk+IRXrSlq0Tom0R6MYN1jpkZKz81Q==} - engines: {node: '>= 10'} - cpu: [x64] - os: [win32] - - '@napi-rs/wasm-tools@0.0.2': - resolution: {integrity: sha512-kBvDQCP5BLw2TxTENXLp3Of7vVEx0uyIye824JHE4dduzzOHVgSoOFVhVqAT3Fx/hLV445RVWfEqQbXMg4w/Mw==} - engines: {node: '>= 10'} - - '@nodelib/fs.scandir@2.1.5': - resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} - engines: {node: '>= 8'} - - '@nodelib/fs.stat@2.0.5': - resolution: {integrity: sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==} - engines: {node: '>= 8'} - - '@nodelib/fs.walk@1.2.8': - resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} - engines: {node: '>= 8'} - - '@octokit/auth-token@4.0.0': - resolution: {integrity: sha512-tY/msAuJo6ARbK6SPIxZrPBms3xPbfwBrulZe0Wtr/DIY9lje2HeV1uoebShn6mx7SjCHif6EjMvoREj+gZ+SA==} - engines: {node: '>= 18'} - - '@octokit/core@5.2.0': - resolution: {integrity: sha512-1LFfa/qnMQvEOAdzlQymH0ulepxbxnCYAKJZfMci/5XJyIHWgEYnDmgnKakbTh7CH2tFQ5O60oYDvns4i9RAIg==} - engines: {node: '>= 18'} - - '@octokit/endpoint@9.0.5': - resolution: {integrity: sha512-ekqR4/+PCLkEBF6qgj8WqJfvDq65RH85OAgrtnVp1mSxaXF03u2xW/hUdweGS5654IlC0wkNYC18Z50tSYTAFw==} - engines: {node: '>= 18'} - - '@octokit/graphql@7.1.0': - resolution: {integrity: sha512-r+oZUH7aMFui1ypZnAvZmn0KSqAUgE1/tUXIWaqUCa1758ts/Jio84GZuzsvUkme98kv0WFY8//n0J1Z+vsIsQ==} - engines: {node: '>= 18'} - - '@octokit/openapi-types@22.2.0': - resolution: {integrity: sha512-QBhVjcUa9W7Wwhm6DBFu6ZZ+1/t/oYxqc2tp81Pi41YNuJinbFRx8B133qVOrAaBbF7D/m0Et6f9/pZt9Rc+tg==} - - '@octokit/plugin-paginate-rest@11.3.1': - resolution: {integrity: sha512-ryqobs26cLtM1kQxqeZui4v8FeznirUsksiA+RYemMPJ7Micju0WSkv50dBksTuZks9O5cg4wp+t8fZ/cLY56g==} - engines: {node: '>= 18'} - peerDependencies: - '@octokit/core': '5' - - '@octokit/plugin-request-log@4.0.1': - resolution: {integrity: sha512-GihNqNpGHorUrO7Qa9JbAl0dbLnqJVrV8OXe2Zm5/Y4wFkZQDfTreBzVmiRfJVfE4mClXdihHnbpyyO9FSX4HA==} - engines: {node: '>= 18'} - peerDependencies: - '@octokit/core': '5' - - '@octokit/plugin-rest-endpoint-methods@13.2.2': - resolution: {integrity: sha512-EI7kXWidkt3Xlok5uN43suK99VWqc8OaIMktY9d9+RNKl69juoTyxmLoWPIZgJYzi41qj/9zU7G/ljnNOJ5AFA==} - engines: {node: '>= 18'} - peerDependencies: - '@octokit/core': ^5 - - '@octokit/request-error@5.1.0': - resolution: {integrity: sha512-GETXfE05J0+7H2STzekpKObFe765O5dlAKUTLNGeH+x47z7JjXHfsHKo5z21D/o/IOZTUEI6nyWyR+bZVP/n5Q==} - engines: {node: '>= 18'} - - '@octokit/request@8.4.0': - resolution: {integrity: sha512-9Bb014e+m2TgBeEJGEbdplMVWwPmL1FPtggHQRkV+WVsMggPtEkLKPlcVYm/o8xKLkpJ7B+6N8WfQMtDLX2Dpw==} - engines: {node: '>= 18'} - - '@octokit/rest@20.1.1': - resolution: {integrity: sha512-MB4AYDsM5jhIHro/dq4ix1iWTLGToIGk6cWF5L6vanFaMble5jTX/UBQyiv05HsWnwUtY8JrfHy2LWfKwihqMw==} - engines: {node: '>= 18'} - - '@octokit/types@13.5.0': - resolution: {integrity: sha512-HdqWTf5Z3qwDVlzCrP8UJquMwunpDiMPt5er+QjGzL4hqr/vBVY/MauQgS1xWxCDT1oMx1EULyqxncdCY/NVSQ==} - - '@rollup/pluginutils@4.2.1': - resolution: {integrity: sha512-iKnFXr7NkdZAIHiIWE+BX5ULi/ucVFYWD6TbAV+rZctiRTY2PL6tsIKhoIOaoskiWAkgu+VsbXgUVDNLHf+InQ==} - engines: {node: '>= 8.0.0'} - - '@sindresorhus/merge-streams@2.3.0': - resolution: {integrity: sha512-LtoMMhxAlorcGhmFYI+LhPgbPZCkgP6ra1YL604EeF6U98pLlQ3iWIGMdWSC+vWmPBWBNgmDBAhnAobLROJmwg==} - engines: {node: '>=18'} - - '@tybys/wasm-util@0.9.0': - resolution: {integrity: sha512-6+7nlbMVX/PVDCwaIQ8nTOPveOcFLSt8GcXdx8hD0bt39uWxYT88uXzqTd4fTvqta7oeUJqudepapKNt2DYJFw==} - - '@types/node@20.14.2': - resolution: {integrity: sha512-xyu6WAMVwv6AKFLB+e/7ySZVr/0zLCzOa7rSpq6jNwpqOrUbcACDWC+53d4n2QHOnDou0fbIsg8wZu/sxrnI4Q==} - - '@types/stylis@4.2.6': - resolution: {integrity: sha512-4nebF2ZJGzQk0ka0O6+FZUWceyFv4vWq/0dXBMmrSeAwzOuOd/GxE5Pa64d/ndeNLG73dXoBsRzvtsVsYUv6Uw==} - - '@vercel/nft@0.26.5': - resolution: {integrity: sha512-NHxohEqad6Ra/r4lGknO52uc/GrWILXAMs1BB4401GTqww0fw1bAqzpG1XHuDO+dprg4GvsD9ZLLSsdo78p9hQ==} - engines: {node: '>=16'} - hasBin: true - - abbrev@1.1.1: - resolution: {integrity: sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==} - - acorn-import-attributes@1.9.5: - resolution: {integrity: sha512-n02Vykv5uA3eHGM/Z2dQrcD56kL8TyDb2p1+0P83PClMnC/nc+anbQRhIOWnSq4Ke/KvDPrY3C9hDtC/A3eHnQ==} - peerDependencies: - acorn: ^8 - - acorn-walk@8.3.3: - resolution: {integrity: sha512-MxXdReSRhGO7VlFe1bRG/oI7/mdLV9B9JJT0N8vZOhF7gFRR5l3M8W9G8JxmKV+JC5mGqJ0QvqfSOLsCPa4nUw==} - engines: {node: '>=0.4.0'} - - acorn@8.12.0: - resolution: {integrity: sha512-RTvkC4w+KNXrM39/lWCUaG0IbRkWdCv7W/IOW9oU6SawyxulvkQy5HQPVTKxEjczcUvapcrw3cFx/60VN/NRNw==} - engines: {node: '>=0.4.0'} - hasBin: true - - agent-base@6.0.2: - resolution: {integrity: sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==} - engines: {node: '>= 6.0.0'} - - ansi-escapes@4.3.2: - resolution: {integrity: sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==} - engines: {node: '>=8'} - - ansi-regex@5.0.1: - resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} - engines: {node: '>=8'} - - ansi-regex@6.0.1: - resolution: {integrity: sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==} - engines: {node: '>=12'} - - ansi-styles@4.3.0: - resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} - engines: {node: '>=8'} - - ansi-styles@6.2.1: - resolution: {integrity: sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==} - engines: {node: '>=12'} - - aproba@2.0.0: - resolution: {integrity: sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==} - - are-we-there-yet@2.0.0: - resolution: {integrity: sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw==} - engines: {node: '>=10'} - deprecated: This package is no longer supported. - - argparse@1.0.10: - resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==} - - argparse@2.0.1: - resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} - - array-find-index@1.0.2: - resolution: {integrity: sha512-M1HQyIXcBGtVywBt8WVdim+lrNaK7VHp99Qt5pSNziXznKHViIBbXWtfRTpEFpF/c4FdfxNAsCCwPp5phBYJtw==} - engines: {node: '>=0.10.0'} - - arrgv@1.0.2: - resolution: {integrity: sha512-a4eg4yhp7mmruZDQFqVMlxNRFGi/i1r87pt8SDHy0/I8PqSXoUTlWZRdAZo0VXgvEARcujbtTk8kiZRi1uDGRw==} - engines: {node: '>=8.0.0'} - - arrify@3.0.0: - resolution: {integrity: sha512-tLkvA81vQG/XqE2mjDkGQHoOINtMHtysSnemrmoGe6PydDPMRbVugqyk4A6V/WDWEfm3l+0d8anA9r8cv/5Jaw==} - engines: {node: '>=12'} - - async-sema@3.1.1: - resolution: {integrity: sha512-tLRNUXati5MFePdAk8dw7Qt7DpxPB60ofAgn8WRhW6a2rcimZnYBP9oxHiv0OHy+Wz7kPMG+t4LGdt31+4EmGg==} - - asynckit@0.4.0: - resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} - - ava@6.1.3: - resolution: {integrity: sha512-tkKbpF1pIiC+q09wNU9OfyTDYZa8yuWvU2up3+lFJ3lr1RmnYh2GBpPwzYUEB0wvTPIUysGjcZLNZr7STDviRA==} - engines: {node: ^18.18 || ^20.8 || ^21 || ^22} - hasBin: true - peerDependencies: - '@ava/typescript': '*' - peerDependenciesMeta: - '@ava/typescript': - optional: true - - axios@1.6.2: - resolution: {integrity: sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A==} - - balanced-match@1.0.2: - resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} - - base64-js@1.5.1: - resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==} - - before-after-hook@2.2.3: - resolution: {integrity: sha512-NzUnlZexiaH/46WDhANlyR2bXRopNg4F/zuSA3OpZnllCUgRaOF2znDioDWrmbNVsuZk6l9pMquQB38cfBZwkQ==} - - bindings@1.5.0: - resolution: {integrity: sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==} - - bl@4.1.0: - resolution: {integrity: sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==} - - blueimp-md5@2.19.0: - resolution: {integrity: sha512-DRQrD6gJyy8FbiE4s+bDoXS9hiW3Vbx5uCdwvcCf3zLHL+Iv7LtGHLpr+GZV8rHG8tK766FGYBwRbu8pELTt+w==} - - brace-expansion@1.1.11: - resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} - - braces@3.0.3: - resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==} - engines: {node: '>=8'} - - buffer@5.7.1: - resolution: {integrity: sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==} - - call-bind@1.0.7: - resolution: {integrity: sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==} - engines: {node: '>= 0.4'} - - callsites@4.1.0: - resolution: {integrity: sha512-aBMbD1Xxay75ViYezwT40aQONfr+pSXTHwNKvIXhXD6+LY3F1dLIcceoC5OZKBVHbXcysz1hL9D2w0JJIMXpUw==} - engines: {node: '>=12.20'} - - camelize@1.0.1: - resolution: {integrity: sha512-dU+Tx2fsypxTgtLoE36npi3UqcjSSMNYfkqgmoEhtZrraP5VWq0K7FkWVTYa8eMPtnU/G2txVsfdCJTn9uzpuQ==} - - cbor@9.0.2: - resolution: {integrity: sha512-JPypkxsB10s9QOWwa6zwPzqE1Md3vqpPc+cai4sAecuCsRyAtAl/pMyhPlMbT/xtPnm2dznJZYRLui57qiRhaQ==} - engines: {node: '>=16'} - - chalk@4.1.2: - resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} - engines: {node: '>=10'} - - chalk@5.3.0: - resolution: {integrity: sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==} - engines: {node: ^12.17.0 || ^14.13 || >=16.0.0} - - chardet@0.7.0: - resolution: {integrity: sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==} - - chownr@2.0.0: - resolution: {integrity: sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==} - engines: {node: '>=10'} - - chunkd@2.0.1: - resolution: {integrity: sha512-7d58XsFmOq0j6el67Ug9mHf9ELUXsQXYJBkyxhH/k+6Ke0qXRnv0kbemx+Twc6fRJ07C49lcbdgm9FL1Ei/6SQ==} - - ci-info@4.0.0: - resolution: {integrity: sha512-TdHqgGf9odd8SXNuxtUBVx8Nv+qZOejE6qyqiy5NtbYYQOeFa6zmHkxlPzmaLxWWHsU6nJmB7AETdVPi+2NBUg==} - engines: {node: '>=8'} - - ci-parallel-vars@1.0.1: - resolution: {integrity: sha512-uvzpYrpmidaoxvIQHM+rKSrigjOe9feHYbw4uOI2gdfe1C3xIlxO+kVXq83WQWNniTf8bAxVpy+cQeFQsMERKg==} - - cli-cursor@3.1.0: - resolution: {integrity: sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==} - engines: {node: '>=8'} - - cli-spinners@2.9.2: - resolution: {integrity: sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==} - engines: {node: '>=6'} - - cli-truncate@4.0.0: - resolution: {integrity: sha512-nPdaFdQ0h/GEigbPClz11D0v/ZJEwxmeVZGeMo3Z5StPtUTkA9o1lD6QwoirYiSDzbcwn2XcjwmCp68W1IS4TA==} - engines: {node: '>=18'} - - cli-width@4.1.0: - resolution: {integrity: sha512-ouuZd4/dm2Sw5Gmqy6bGyNNNe1qt9RpmxveLSO7KcgsTnU7RXfsw+/bukWGo1abgBiMAic068rclZsO4IWmmxQ==} - engines: {node: '>= 12'} - - clipanion@3.2.1: - resolution: {integrity: sha512-dYFdjLb7y1ajfxQopN05mylEpK9ZX0sO1/RfMXdfmwjlIsPkbh4p7A682x++zFPLDCo1x3p82dtljHf5cW2LKA==} - peerDependencies: - typanion: '*' - - cliui@8.0.1: - resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==} - engines: {node: '>=12'} - - clone@1.0.4: - resolution: {integrity: sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==} - engines: {node: '>=0.8'} - - code-excerpt@4.0.0: - resolution: {integrity: sha512-xxodCmBen3iy2i0WtAK8FlFNrRzjUqjRsMfho58xT/wvZU1YTM3fCnRjcy1gJPMepaRlgm/0e6w8SpWHpn3/cA==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - color-convert@2.0.1: - resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} - engines: {node: '>=7.0.0'} - - color-name@1.1.4: - resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} - - color-support@1.1.3: - resolution: {integrity: sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==} - hasBin: true - - colorette@2.0.20: - resolution: {integrity: sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==} - - combined-stream@1.0.8: - resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} - engines: {node: '>= 0.8'} - - common-path-prefix@3.0.0: - resolution: {integrity: sha512-QE33hToZseCH3jS0qN96O/bSh3kaw/h+Tq7ngyY9eWDUnTlTNUyqfqvCXioLe5Na5jFsL78ra/wuBU4iuEgd4w==} - - concat-map@0.0.1: - resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} - - concordance@5.0.4: - resolution: {integrity: sha512-OAcsnTEYu1ARJqWVGwf4zh4JDfHZEaSNlNccFmt8YjB2l/n19/PF2viLINHc57vO4FKIAFl2FWASIGZZWZ2Kxw==} - engines: {node: '>=10.18.0 <11 || >=12.14.0 <13 || >=14'} - - console-control-strings@1.1.0: - resolution: {integrity: sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==} - - convert-to-spaces@2.0.1: - resolution: {integrity: sha512-rcQ1bsQO9799wq24uE5AM2tAILy4gXGIK/njFWcVQkGNZ96edlpY+A7bjwvzjYvLDyzmG1MmMLZhpcsb+klNMQ==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - css-color-keywords@1.0.0: - resolution: {integrity: sha512-FyyrDHZKEjXDpNJYvVsV960FiqQyXc/LlYmsxl2BcdMb2WPx0OGRVgTg55rPSyLSNMqP52R9r8geSp7apN3Ofg==} - engines: {node: '>=4'} - - css-to-react-native@3.2.0: - resolution: {integrity: sha512-e8RKaLXMOFii+02mOlqwjbD00KSEKqblnpO9e++1aXS1fPQOpS1YoqdVHBqPjHNoxeF2mimzVqawm2KCbEdtHQ==} - - csstype@3.1.3: - resolution: {integrity: sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==} - - currently-unhandled@0.4.1: - resolution: {integrity: sha512-/fITjgjGU50vjQ4FH6eUoYu+iUoUKIXws2hL15JJpIR+BbTxaXQsMuuyjtNh2WqsSBS5nsaZHFsFecyw5CCAng==} - engines: {node: '>=0.10.0'} - - date-time@3.1.0: - resolution: {integrity: sha512-uqCUKXE5q1PNBXjPqvwhwJf9SwMoAHBgWJ6DcrnS5o+W2JOiIILl0JEdVD8SGujrNS02GGxgwAg2PN2zONgtjg==} - engines: {node: '>=6'} - - debug@4.3.5: - resolution: {integrity: sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg==} - engines: {node: '>=6.0'} - peerDependencies: - supports-color: '*' - peerDependenciesMeta: - supports-color: - optional: true - - defaults@1.0.4: - resolution: {integrity: sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A==} - - define-data-property@1.1.4: - resolution: {integrity: sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==} - engines: {node: '>= 0.4'} - - delayed-stream@1.0.0: - resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} - engines: {node: '>=0.4.0'} - - delegates@1.0.0: - resolution: {integrity: sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==} - - deprecation@2.3.1: - resolution: {integrity: sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==} - - detect-libc@2.0.3: - resolution: {integrity: sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw==} - engines: {node: '>=8'} - - emittery@1.0.3: - resolution: {integrity: sha512-tJdCJitoy2lrC2ldJcqN4vkqJ00lT+tOWNT1hBJjO/3FDMJa5TTIiYGCKGkn/WfCyOzUMObeohbVTj00fhiLiA==} - engines: {node: '>=14.16'} - - emnapi@1.2.0: - resolution: {integrity: sha512-rcq+dJCcfr08I0XM/57LPRqaUokGfni/+SvhO7NaJthTTjRdohhIy0FQwyC5rR1enAsjkldQg83th8J5hURv0Q==} - peerDependencies: - node-addon-api: '>= 6.1.0' - peerDependenciesMeta: - node-addon-api: - optional: true - - emoji-regex@10.3.0: - resolution: {integrity: sha512-QpLs9D9v9kArv4lfDEgg1X/gN5XLnf/A6l9cs8SPZLRZR3ZkY9+kwIQTxm+fsSej5UMYGE8fdoaZVIBlqG0XTw==} - - emoji-regex@8.0.0: - resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} - - es-define-property@1.0.0: - resolution: {integrity: sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==} - engines: {node: '>= 0.4'} - - es-errors@1.3.0: - resolution: {integrity: sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==} - engines: {node: '>= 0.4'} - - escalade@3.1.2: - resolution: {integrity: sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==} - engines: {node: '>=6'} - - escape-string-regexp@2.0.0: - resolution: {integrity: sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==} - engines: {node: '>=8'} - - escape-string-regexp@5.0.0: - resolution: {integrity: sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==} - engines: {node: '>=12'} - - esprima@4.0.1: - resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==} - engines: {node: '>=4'} - hasBin: true - - estree-walker@2.0.2: - resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==} - - esutils@2.0.3: - resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} - engines: {node: '>=0.10.0'} - - external-editor@3.1.0: - resolution: {integrity: sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==} - engines: {node: '>=4'} - - fast-diff@1.3.0: - resolution: {integrity: sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==} - - fast-glob@3.3.2: - resolution: {integrity: sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==} - engines: {node: '>=8.6.0'} - - fastq@1.17.1: - resolution: {integrity: sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==} - - figures@6.1.0: - resolution: {integrity: sha512-d+l3qxjSesT4V7v2fh+QnmFnUWv9lSpjarhShNTgBOfA0ttejbQUAlHLitbjkoRiDulW0OPoQPYIGhIC8ohejg==} - engines: {node: '>=18'} - - file-uri-to-path@1.0.0: - resolution: {integrity: sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==} - - fill-range@7.1.1: - resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==} - engines: {node: '>=8'} - - find-up-simple@1.0.0: - resolution: {integrity: sha512-q7Us7kcjj2VMePAa02hDAF6d+MzsdsAWEwYyOpwUtlerRBkOEPBCRZrAV4XfcSN8fHAgaD0hP7miwoay6DCprw==} - engines: {node: '>=18'} - - follow-redirects@1.15.6: - resolution: {integrity: sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==} - engines: {node: '>=4.0'} - peerDependencies: - debug: '*' - peerDependenciesMeta: - debug: - optional: true - - form-data@4.0.0: - resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==} - engines: {node: '>= 6'} - - fs-minipass@2.1.0: - resolution: {integrity: sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==} - engines: {node: '>= 8'} - - fs.realpath@1.0.0: - resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} - - function-bind@1.1.2: - resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==} - - gauge@3.0.2: - resolution: {integrity: sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q==} - engines: {node: '>=10'} - deprecated: This package is no longer supported. - - get-caller-file@2.0.5: - resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} - engines: {node: 6.* || 8.* || >= 10.*} - - get-east-asian-width@1.2.0: - resolution: {integrity: sha512-2nk+7SIVb14QrgXFHcm84tD4bKQz0RxPuMT8Ag5KPOq7J5fEmAg0UbXdTOSHqNuHSU28k55qnceesxXRZGzKWA==} - engines: {node: '>=18'} - - get-intrinsic@1.2.4: - resolution: {integrity: sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==} - engines: {node: '>= 0.4'} - - glob-parent@5.1.2: - resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} - engines: {node: '>= 6'} - - glob@7.2.3: - resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} - deprecated: Glob versions prior to v9 are no longer supported - - globby@14.0.1: - resolution: {integrity: sha512-jOMLD2Z7MAhyG8aJpNOpmziMOP4rPLcc95oQPKXBazW82z+CEgPFBQvEpRUa1KeIMUJo4Wsm+q6uzO/Q/4BksQ==} - engines: {node: '>=18'} - - gopd@1.0.1: - resolution: {integrity: sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==} - - graceful-fs@4.2.11: - resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} - - has-flag@4.0.0: - resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} - engines: {node: '>=8'} - - has-property-descriptors@1.0.2: - resolution: {integrity: sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==} - - has-proto@1.0.3: - resolution: {integrity: sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==} - engines: {node: '>= 0.4'} - - has-symbols@1.0.3: - resolution: {integrity: sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==} - engines: {node: '>= 0.4'} - - has-unicode@2.0.1: - resolution: {integrity: sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==} - - hasown@2.0.2: - resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==} - engines: {node: '>= 0.4'} - - https-proxy-agent@5.0.1: - resolution: {integrity: sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==} - engines: {node: '>= 6'} - - iconv-lite@0.4.24: - resolution: {integrity: sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==} - engines: {node: '>=0.10.0'} - - ieee754@1.2.1: - resolution: {integrity: sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==} - - ignore-by-default@2.1.0: - resolution: {integrity: sha512-yiWd4GVmJp0Q6ghmM2B/V3oZGRmjrKLXvHR3TE1nfoXsmoggllfZUQe74EN0fJdPFZu2NIvNdrMMLm3OsV7Ohw==} - engines: {node: '>=10 <11 || >=12 <13 || >=14'} - - ignore@5.3.1: - resolution: {integrity: sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==} - engines: {node: '>= 4'} - - imurmurhash@0.1.4: - resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} - engines: {node: '>=0.8.19'} - - indent-string@5.0.0: - resolution: {integrity: sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==} - engines: {node: '>=12'} - - inflight@1.0.6: - resolution: {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. - - inherits@2.0.4: - resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} - - inquirer@9.2.23: - resolution: {integrity: sha512-kod5s+FBPIDM2xiy9fu+6wdU/SkK5le5GS9lh4FEBjBHqiMgD9lLFbCbuqFNAjNL2ZOy9Wd9F694IOzN9pZHBA==} - engines: {node: '>=18'} - - irregular-plurals@3.5.0: - resolution: {integrity: sha512-1ANGLZ+Nkv1ptFb2pa8oG8Lem4krflKuX/gINiHJHjJUKaJHk/SXk5x6K3J+39/p0h1RQ2saROclJJ+QLvETCQ==} - engines: {node: '>=8'} - - is-extglob@2.1.1: - resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} - engines: {node: '>=0.10.0'} - - is-fullwidth-code-point@3.0.0: - resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} - engines: {node: '>=8'} - - is-fullwidth-code-point@4.0.0: - resolution: {integrity: sha512-O4L094N2/dZ7xqVdrXhh9r1KODPJpFms8B5sGdJLPy664AgvXsreZUyCQQNItZRDlYug4xStLjNp/sz3HvBowQ==} - engines: {node: '>=12'} - - is-glob@4.0.3: - resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} - engines: {node: '>=0.10.0'} - - is-interactive@1.0.0: - resolution: {integrity: sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w==} - engines: {node: '>=8'} - - is-number@7.0.0: - resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} - engines: {node: '>=0.12.0'} - - is-plain-object@5.0.0: - resolution: {integrity: sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==} - engines: {node: '>=0.10.0'} - - is-promise@4.0.0: - resolution: {integrity: sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==} - - is-unicode-supported@0.1.0: - resolution: {integrity: sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==} - engines: {node: '>=10'} - - is-unicode-supported@2.0.0: - resolution: {integrity: sha512-FRdAyx5lusK1iHG0TWpVtk9+1i+GjrzRffhDg4ovQ7mcidMQ6mj+MhKPmvh7Xwyv5gIS06ns49CA7Sqg7lC22Q==} - engines: {node: '>=18'} - - js-string-escape@1.0.1: - resolution: {integrity: sha512-Smw4xcfIQ5LVjAOuJCvN/zIodzA/BBSsluuoSykP+lUvScIi4U6RJLfwHet5cxFnCswUjISV8oAXaqaJDY3chg==} - engines: {node: '>= 0.8'} - - js-tokens@4.0.0: - resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} - - js-yaml@3.14.1: - resolution: {integrity: sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==} - hasBin: true - - js-yaml@4.1.0: - resolution: {integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==} - hasBin: true - - load-json-file@7.0.1: - resolution: {integrity: sha512-Gnxj3ev3mB5TkVBGad0JM6dmLiQL+o0t23JPBZ9sd+yvSLk05mFoqKBw5N8gbbkU4TNXyqCgIrl/VM17OgUIgQ==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - lodash-es@4.17.21: - resolution: {integrity: sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==} - - lodash@4.17.21: - resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} - - log-symbols@4.1.0: - resolution: {integrity: sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==} - engines: {node: '>=10'} - - loose-envify@1.4.0: - resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==} - hasBin: true - - make-dir@3.1.0: - resolution: {integrity: sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==} - engines: {node: '>=8'} - - matcher@5.0.0: - resolution: {integrity: sha512-s2EMBOWtXFc8dgqvoAzKJXxNHibcdJMV0gwqKUaw9E2JBJuGUK7DrNKrA6g/i+v72TT16+6sVm5mS3thaMLQUw==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - md5-hex@3.0.1: - resolution: {integrity: sha512-BUiRtTtV39LIJwinWBjqVsU9xhdnz7/i889V859IBFpuqGAj6LuOvHv5XLbgZ2R7ptJoJaEcxkv88/h25T7Ciw==} - engines: {node: '>=8'} - - memoize@10.0.0: - resolution: {integrity: sha512-H6cBLgsi6vMWOcCpvVCdFFnl3kerEXbrYh9q+lY6VXvQSmM6CkmV08VOwT+WE2tzIEqRPFfAq3fm4v/UIW6mSA==} - engines: {node: '>=18'} - - merge2@1.4.1: - resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} - engines: {node: '>= 8'} - - micromatch@4.0.7: - resolution: {integrity: sha512-LPP/3KorzCwBxfeUuZmaR6bG2kdeHSbe0P2tY3FLRU4vYrjYz5hI4QZwV0njUx3jeuKe67YukQ1LSPZBKDqO/Q==} - engines: {node: '>=8.6'} - - mime-db@1.52.0: - resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} - engines: {node: '>= 0.6'} - - mime-types@2.1.35: - resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} - engines: {node: '>= 0.6'} - - mimic-fn@2.1.0: - resolution: {integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==} - engines: {node: '>=6'} - - mimic-function@5.0.1: - resolution: {integrity: sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==} - engines: {node: '>=18'} - - minimatch@3.1.2: - resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} - - minipass@3.3.6: - resolution: {integrity: sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==} - engines: {node: '>=8'} - - minipass@5.0.0: - resolution: {integrity: sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==} - engines: {node: '>=8'} - - minizlib@2.1.2: - resolution: {integrity: sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==} - engines: {node: '>= 8'} - - mkdirp@1.0.4: - resolution: {integrity: sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==} - engines: {node: '>=10'} - hasBin: true - - ms@2.1.2: - resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} - - ms@2.1.3: - resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} - - mute-stream@1.0.0: - resolution: {integrity: sha512-avsJQhyd+680gKXyG/sQc0nXaC6rBkPOfyHYcFb9+hdkqQkR9bdnkJ0AMZhke0oesPqIO+mFFJ+IdBc7mst4IA==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - - nanoid@3.3.7: - resolution: {integrity: sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==} - engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} - hasBin: true - - node-fetch@2.7.0: - resolution: {integrity: sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==} - engines: {node: 4.x || >=6.0.0} - peerDependencies: - encoding: ^0.1.0 - peerDependenciesMeta: - encoding: - optional: true - - node-gyp-build@4.8.1: - resolution: {integrity: sha512-OSs33Z9yWr148JZcbZd5WiAXhh/n9z8TxQcdMhIOlpN9AhWpLfvVFO73+m77bBABQMaY9XSvIa+qk0jlI7Gcaw==} - hasBin: true - - nofilter@3.1.0: - resolution: {integrity: sha512-l2NNj07e9afPnhAhvgVrCD/oy2Ai1yfLpuo3EpiO1jFTsB4sFz6oIfAfSZyQzVpkZQ9xS8ZS5g1jCBgq4Hwo0g==} - engines: {node: '>=12.19'} - - nopt@5.0.0: - resolution: {integrity: sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==} - engines: {node: '>=6'} - hasBin: true - - npmlog@5.0.1: - resolution: {integrity: sha512-AqZtDUWOMKs1G/8lwylVjrdYgqA4d9nu8hc+0gzRxlDb1I10+FHBGMXs6aiQHFdCUUlqH99MUMuLfzWDNDtfxw==} - deprecated: This package is no longer supported. - - object-assign@4.1.1: - resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} - engines: {node: '>=0.10.0'} - - once@1.4.0: - resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} - - onetime@5.1.2: - resolution: {integrity: sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==} - engines: {node: '>=6'} - - ora@5.4.1: - resolution: {integrity: sha512-5b6Y85tPxZZ7QytO+BQzysW31HJku27cRIlkbAXaNx+BdcVi+LlRFmVXzeF6a7JCwJpyw5c4b+YSVImQIrBpuQ==} - engines: {node: '>=10'} - - os-tmpdir@1.0.2: - resolution: {integrity: sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==} - engines: {node: '>=0.10.0'} - - p-map@7.0.2: - resolution: {integrity: sha512-z4cYYMMdKHzw4O5UkWJImbZynVIo0lSGTXc7bzB1e/rrDqkgGUNysK/o4bTr+0+xKvvLoTyGqYC4Fgljy9qe1Q==} - engines: {node: '>=18'} - - package-config@5.0.0: - resolution: {integrity: sha512-GYTTew2slBcYdvRHqjhwaaydVMvn/qrGC323+nKclYioNSLTDUM/lGgtGTgyHVtYcozb+XkE8CNhwcraOmZ9Mg==} - engines: {node: '>=18'} - - parse-ms@4.0.0: - resolution: {integrity: sha512-TXfryirbmq34y8QBwgqCVLi+8oA3oWx2eAnSn62ITyEhEYaWRlVZ2DvMM9eZbMs/RfxPu/PK/aBLyGj4IrqMHw==} - engines: {node: '>=18'} - - path-is-absolute@1.0.1: - resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==} - engines: {node: '>=0.10.0'} - - path-type@5.0.0: - resolution: {integrity: sha512-5HviZNaZcfqP95rwpv+1HDgUamezbqdSYTyzjTvwtJSnIH+3vnbmWsItli8OFEndS984VT55M3jduxZbX351gg==} - engines: {node: '>=12'} - - picocolors@1.0.1: - resolution: {integrity: sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==} - - picomatch@2.3.1: - resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} - engines: {node: '>=8.6'} - - picomatch@3.0.1: - resolution: {integrity: sha512-I3EurrIQMlRc9IaAZnqRR044Phh2DXY+55o7uJ0V+hYZAcQYSuFWsc9q5PvyDHUSCe1Qxn/iBz+78s86zWnGag==} - engines: {node: '>=10'} - - plur@5.1.0: - resolution: {integrity: sha512-VP/72JeXqak2KiOzjgKtQen5y3IZHn+9GOuLDafPv0eXa47xq0At93XahYBs26MsifCQ4enGKwbjBTKgb9QJXg==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - postcss-value-parser@4.2.0: - resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==} - - postcss@8.4.33: - resolution: {integrity: sha512-Kkpbhhdjw2qQs2O2DGX+8m5OVqEcbB9HRBvuYM9pgrjEFUg30A9LmXNlTAUj4S9kgtGyrMbTzVjH7E+s5Re2yg==} - engines: {node: ^10 || ^12 || >=14} - - pretty-ms@9.0.0: - resolution: {integrity: sha512-E9e9HJ9R9NasGOgPaPE8VMeiPKAyWR5jcFpNnwIejslIhWqdqOrb2wShBsncMPUb+BcCd2OPYfh7p2W6oemTng==} - engines: {node: '>=18'} - - proxy-from-env@1.1.0: - resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==} - - queue-microtask@1.2.3: - resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} - - react-dom@18.3.1: - resolution: {integrity: sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==} - peerDependencies: - react: ^18.3.1 - - react@18.3.1: - resolution: {integrity: sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==} - engines: {node: '>=0.10.0'} - - readable-stream@3.6.2: - resolution: {integrity: sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==} - engines: {node: '>= 6'} - - require-directory@2.1.1: - resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} - engines: {node: '>=0.10.0'} - - resolve-cwd@3.0.0: - resolution: {integrity: sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==} - engines: {node: '>=8'} - - resolve-from@5.0.0: - resolution: {integrity: sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==} - engines: {node: '>=8'} - - restore-cursor@3.1.0: - resolution: {integrity: sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==} - engines: {node: '>=8'} - - reusify@1.0.4: - resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==} - engines: {iojs: '>=1.0.0', node: '>=0.10.0'} - - rimraf@3.0.2: - resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==} - deprecated: Rimraf versions prior to v4 are no longer supported - hasBin: true - - run-async@3.0.0: - resolution: {integrity: sha512-540WwVDOMxA6dN6We19EcT9sc3hkXPw5mzRNGM3FkdN/vtE9NFvj5lFAPNwUDmJjXidm3v7TC1cTE7t17Ulm1Q==} - engines: {node: '>=0.12.0'} - - run-parallel@1.2.0: - resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} - - rxjs@7.8.1: - resolution: {integrity: sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==} - - safe-buffer@5.2.1: - resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} - - safer-buffer@2.1.2: - resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} - - scheduler@0.23.2: - resolution: {integrity: sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ==} - - semver@6.3.1: - resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} - hasBin: true - - semver@7.6.2: - resolution: {integrity: sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==} - engines: {node: '>=10'} - hasBin: true - - serialize-error@7.0.1: - resolution: {integrity: sha512-8I8TjW5KMOKsZQTvoxjuSIa7foAwPWGOts+6o7sgjz41/qMD9VQHEDxi6PBvK2l0MXUmqZyNpUK+T2tQaaElvw==} - engines: {node: '>=10'} - - set-blocking@2.0.0: - resolution: {integrity: sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==} - - set-function-length@1.2.2: - resolution: {integrity: sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==} - engines: {node: '>= 0.4'} - - shallowequal@1.1.0: - resolution: {integrity: sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ==} - - signal-exit@3.0.7: - resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} - - signal-exit@4.1.0: - resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} - engines: {node: '>=14'} - - slash@5.1.0: - resolution: {integrity: sha512-ZA6oR3T/pEyuqwMgAKT0/hAv8oAXckzbkmR0UkUosQ+Mc4RxGoJkRmwHgHufaenlyAgE1Mxgpdcrf75y6XcnDg==} - engines: {node: '>=14.16'} - - slice-ansi@5.0.0: - resolution: {integrity: sha512-FC+lgizVPfie0kkhqUScwRu1O/lF6NOgJmlCgK+/LYxDCTk8sGelYaHDhFcDN+Sn3Cv+3VSa4Byeo+IMCzpMgQ==} - engines: {node: '>=12'} - - source-map-js@1.2.0: - resolution: {integrity: sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==} - engines: {node: '>=0.10.0'} - - sprintf-js@1.0.3: - resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==} - - stack-utils@2.0.6: - resolution: {integrity: sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==} - engines: {node: '>=10'} - - string-width@4.2.3: - resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} - engines: {node: '>=8'} - - string-width@7.1.0: - resolution: {integrity: sha512-SEIJCWiX7Kg4c129n48aDRwLbFb2LJmXXFrWBG4NGaRtMQ3myKPKbwrD1BKqQn74oCoNMBVrfDEr5M9YxCsrkw==} - engines: {node: '>=18'} - - string_decoder@1.3.0: - resolution: {integrity: sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==} - - strip-ansi@6.0.1: - resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} - engines: {node: '>=8'} - - strip-ansi@7.1.0: - resolution: {integrity: sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==} - engines: {node: '>=12'} - - styled-components@6.1.1: - resolution: {integrity: sha512-cpZZP5RrKRIClBW5Eby4JM1wElLVP4NQrJbJ0h10TidTyJf4SIIwa3zLXOoPb4gJi8MsJ8mjq5mu2IrEhZIAcQ==} - engines: {node: '>= 16'} - peerDependencies: - react: '>= 16.8.0' - react-dom: '>= 16.8.0' - - stylis@4.3.2: - resolution: {integrity: sha512-bhtUjWd/z6ltJiQwg0dUfxEJ+W+jdqQd8TbWLWyeIJHlnsqmGLRFFd8e5mA0AZi/zx90smXRlN66YMTcaSFifg==} - - supertap@3.0.1: - resolution: {integrity: sha512-u1ZpIBCawJnO+0QePsEiOknOfCRq0yERxiAchT0i4li0WHNUJbf0evXXSXOcCAR4M8iMDoajXYmstm/qO81Isw==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - supports-color@7.2.0: - resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} - engines: {node: '>=8'} - - tar@6.2.1: - resolution: {integrity: sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==} - engines: {node: '>=10'} - - temp-dir@3.0.0: - resolution: {integrity: sha512-nHc6S/bwIilKHNRgK/3jlhDoIHcp45YgyiwcAk46Tr0LfEqGBVpmiAyuiuxeVE44m3mXnEeVhaipLOEWmH+Njw==} - engines: {node: '>=14.16'} - - time-zone@1.0.0: - resolution: {integrity: sha512-TIsDdtKo6+XrPtiTm1ssmMngN1sAhyKnTO2kunQWqNPWIVvCm15Wmw4SWInwTVgJ5u/Tr04+8Ei9TNcw4x4ONA==} - engines: {node: '>=4'} - - tmp@0.0.33: - resolution: {integrity: sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==} - engines: {node: '>=0.6.0'} - - to-regex-range@5.0.1: - resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} - engines: {node: '>=8.0'} - - toml@3.0.0: - resolution: {integrity: sha512-y/mWCZinnvxjTKYhJ+pYxwD0mRLVvOtdS2Awbgxln6iEnt4rk0yBxeSBHkGJcPucRiG0e55mwWp+g/05rsrd6w==} - - tr46@0.0.3: - resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==} - - tslib@2.6.3: - resolution: {integrity: sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ==} - - typanion@3.14.0: - resolution: {integrity: sha512-ZW/lVMRabETuYCd9O9ZvMhAh8GslSqaUjxmK/JLPCh6l73CvLBiuXswj/+7LdnWOgYsQ130FqLzFz5aGT4I3Ug==} - - type-fest@0.13.1: - resolution: {integrity: sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==} - engines: {node: '>=10'} - - type-fest@0.21.3: - resolution: {integrity: sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==} - engines: {node: '>=10'} - - typescript@5.4.5: - resolution: {integrity: sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==} - engines: {node: '>=14.17'} - hasBin: true - - undici-types@5.26.5: - resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==} - - unicorn-magic@0.1.0: - resolution: {integrity: sha512-lRfVq8fE8gz6QMBuDM6a+LO3IAzTi05H6gCVaUpir2E1Rwpo4ZUog45KpNXKC/Mn3Yb9UDuHumeFTo9iV/D9FQ==} - engines: {node: '>=18'} - - universal-user-agent@6.0.1: - resolution: {integrity: sha512-yCzhz6FN2wU1NiiQRogkTQszlQSlpWaw8SvVegAc+bDxbzHgh1vX8uIe8OYyMH6DwH+sdTJsgMl36+mSMdRJIQ==} - - util-deprecate@1.0.2: - resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} - - wasm-sjlj@1.0.5: - resolution: {integrity: sha512-Z/MHJeOkAvJJVWnGX3/YZGYldGaawZbYHX4ldYG9kLhcdB8H31F5x66M7Zc4BP/7pg0aLsusQj1629m2B3Rilg==} - - wcwidth@1.0.1: - resolution: {integrity: sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==} - - webidl-conversions@3.0.1: - resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==} - - well-known-symbols@2.0.0: - resolution: {integrity: sha512-ZMjC3ho+KXo0BfJb7JgtQ5IBuvnShdlACNkKkdsqBmYw3bPAaJfPeYUo6tLUaT5tG/Gkh7xkpBhKRQ9e7pyg9Q==} - engines: {node: '>=6'} - - whatwg-url@5.0.0: - resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==} - - wide-align@1.1.5: - resolution: {integrity: sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==} - - wrap-ansi@6.2.0: - resolution: {integrity: sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==} - engines: {node: '>=8'} - - wrap-ansi@7.0.0: - resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==} - engines: {node: '>=10'} - - wrappy@1.0.2: - resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} - - write-file-atomic@5.0.1: - resolution: {integrity: sha512-+QU2zd6OTD8XWIJCbffaiQeH9U73qIqafo1x6V1snCWYGJf6cVE0cDR4D8xRzcEnfI21IFrUPzPGtcPf8AC+Rw==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - - y18n@5.0.8: - resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==} - engines: {node: '>=10'} - - yallist@4.0.0: - resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==} - - yargs-parser@21.1.1: - resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} - engines: {node: '>=12'} - - yargs@17.7.2: - resolution: {integrity: sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==} - engines: {node: '>=12'} - -snapshots: - - '@emnapi/core@1.2.0': - dependencies: - '@emnapi/wasi-threads': 1.0.1 - tslib: 2.6.3 - - '@emnapi/runtime@1.2.0': - dependencies: - tslib: 2.6.3 - - '@emnapi/wasi-threads@1.0.1': - dependencies: - tslib: 2.6.3 - - '@emotion/is-prop-valid@1.2.2': - dependencies: - '@emotion/memoize': 0.8.1 - - '@emotion/memoize@0.8.1': {} - - '@emotion/unitless@0.8.1': {} - - '@inquirer/figures@1.0.3': {} - - '@ljharb/through@2.3.13': - dependencies: - call-bind: 1.0.7 - - '@mapbox/node-pre-gyp@1.0.11': - dependencies: - detect-libc: 2.0.3 - https-proxy-agent: 5.0.1 - make-dir: 3.1.0 - node-fetch: 2.7.0 - nopt: 5.0.0 - npmlog: 5.0.1 - rimraf: 3.0.2 - semver: 7.6.2 - tar: 6.2.1 - transitivePeerDependencies: - - encoding - - supports-color - - '@napi-rs/cli@3.0.0-alpha.55(@emnapi/runtime@1.2.0)(emnapi@1.2.0)': - dependencies: - '@napi-rs/cross-toolchain': 0.0.16 - '@napi-rs/wasm-tools': 0.0.2 - '@octokit/rest': 20.1.1 - clipanion: 3.2.1(typanion@3.14.0) - colorette: 2.0.20 - debug: 4.3.5 - inquirer: 9.2.23 - js-yaml: 4.1.0 - lodash-es: 4.17.21 - semver: 7.6.2 - toml: 3.0.0 - typanion: 3.14.0 - wasm-sjlj: 1.0.5 - optionalDependencies: - '@emnapi/runtime': 1.2.0 - emnapi: 1.2.0 - transitivePeerDependencies: - - '@napi-rs/cross-toolchain-arm64-target-aarch64' - - '@napi-rs/cross-toolchain-arm64-target-armv7' - - '@napi-rs/cross-toolchain-arm64-target-x86_64' - - '@napi-rs/cross-toolchain-x64-target-aarch64' - - '@napi-rs/cross-toolchain-x64-target-armv7' - - '@napi-rs/cross-toolchain-x64-target-x86_64' - - supports-color - - '@napi-rs/cross-toolchain@0.0.16': - dependencies: - '@napi-rs/lzma': 1.3.1 - '@napi-rs/tar': 0.1.1 - debug: 4.3.5 - transitivePeerDependencies: - - supports-color - - '@napi-rs/lzma-android-arm-eabi@1.3.1': - optional: true - - '@napi-rs/lzma-android-arm64@1.3.1': - optional: true - - '@napi-rs/lzma-darwin-arm64@1.3.1': - optional: true - - '@napi-rs/lzma-darwin-x64@1.3.1': - optional: true - - '@napi-rs/lzma-freebsd-x64@1.3.1': - optional: true - - '@napi-rs/lzma-linux-arm-gnueabihf@1.3.1': - optional: true - - '@napi-rs/lzma-linux-arm64-gnu@1.3.1': - optional: true - - '@napi-rs/lzma-linux-arm64-musl@1.3.1': - optional: true - - '@napi-rs/lzma-linux-x64-gnu@1.3.1': - optional: true - - '@napi-rs/lzma-linux-x64-musl@1.3.1': - optional: true - - '@napi-rs/lzma-wasm32-wasi@1.3.1': - dependencies: - '@napi-rs/wasm-runtime': 0.2.4 - optional: true - - '@napi-rs/lzma-win32-arm64-msvc@1.3.1': - optional: true - - '@napi-rs/lzma-win32-ia32-msvc@1.3.1': - optional: true - - '@napi-rs/lzma-win32-x64-msvc@1.3.1': - optional: true - - '@napi-rs/lzma@1.3.1': - optionalDependencies: - '@napi-rs/lzma-android-arm-eabi': 1.3.1 - '@napi-rs/lzma-android-arm64': 1.3.1 - '@napi-rs/lzma-darwin-arm64': 1.3.1 - '@napi-rs/lzma-darwin-x64': 1.3.1 - '@napi-rs/lzma-freebsd-x64': 1.3.1 - '@napi-rs/lzma-linux-arm-gnueabihf': 1.3.1 - '@napi-rs/lzma-linux-arm64-gnu': 1.3.1 - '@napi-rs/lzma-linux-arm64-musl': 1.3.1 - '@napi-rs/lzma-linux-x64-gnu': 1.3.1 - '@napi-rs/lzma-linux-x64-musl': 1.3.1 - '@napi-rs/lzma-wasm32-wasi': 1.3.1 - '@napi-rs/lzma-win32-arm64-msvc': 1.3.1 - '@napi-rs/lzma-win32-ia32-msvc': 1.3.1 - '@napi-rs/lzma-win32-x64-msvc': 1.3.1 - - '@napi-rs/tar-android-arm-eabi@0.1.1': - optional: true - - '@napi-rs/tar-android-arm64@0.1.1': - optional: true - - '@napi-rs/tar-darwin-arm64@0.1.1': - optional: true - - '@napi-rs/tar-darwin-x64@0.1.1': - optional: true - - '@napi-rs/tar-freebsd-x64@0.1.1': - optional: true - - '@napi-rs/tar-linux-arm-gnueabihf@0.1.1': - optional: true - - '@napi-rs/tar-linux-arm64-gnu@0.1.1': - optional: true - - '@napi-rs/tar-linux-arm64-musl@0.1.1': - optional: true - - '@napi-rs/tar-linux-x64-gnu@0.1.1': - optional: true - - '@napi-rs/tar-linux-x64-musl@0.1.1': - optional: true - - '@napi-rs/tar-wasm32-wasi@0.1.1': - dependencies: - '@napi-rs/wasm-runtime': 0.2.4 - optional: true - - '@napi-rs/tar-win32-arm64-msvc@0.1.1': - optional: true - - '@napi-rs/tar-win32-ia32-msvc@0.1.1': - optional: true - - '@napi-rs/tar-win32-x64-msvc@0.1.1': - optional: true - - '@napi-rs/tar@0.1.1': - optionalDependencies: - '@napi-rs/tar-android-arm-eabi': 0.1.1 - '@napi-rs/tar-android-arm64': 0.1.1 - '@napi-rs/tar-darwin-arm64': 0.1.1 - '@napi-rs/tar-darwin-x64': 0.1.1 - '@napi-rs/tar-freebsd-x64': 0.1.1 - '@napi-rs/tar-linux-arm-gnueabihf': 0.1.1 - '@napi-rs/tar-linux-arm64-gnu': 0.1.1 - '@napi-rs/tar-linux-arm64-musl': 0.1.1 - '@napi-rs/tar-linux-x64-gnu': 0.1.1 - '@napi-rs/tar-linux-x64-musl': 0.1.1 - '@napi-rs/tar-wasm32-wasi': 0.1.1 - '@napi-rs/tar-win32-arm64-msvc': 0.1.1 - '@napi-rs/tar-win32-ia32-msvc': 0.1.1 - '@napi-rs/tar-win32-x64-msvc': 0.1.1 - - '@napi-rs/wasm-runtime@0.2.4': - dependencies: - '@emnapi/core': 1.2.0 - '@emnapi/runtime': 1.2.0 - '@tybys/wasm-util': 0.9.0 - - '@napi-rs/wasm-tools-android-arm-eabi@0.0.2': - optional: true - - '@napi-rs/wasm-tools-android-arm64@0.0.2': - optional: true - - '@napi-rs/wasm-tools-darwin-arm64@0.0.2': - optional: true - - '@napi-rs/wasm-tools-darwin-x64@0.0.2': - optional: true - - '@napi-rs/wasm-tools-freebsd-x64@0.0.2': - optional: true - - '@napi-rs/wasm-tools-linux-arm64-gnu@0.0.2': - optional: true - - '@napi-rs/wasm-tools-linux-arm64-musl@0.0.2': - optional: true - - '@napi-rs/wasm-tools-linux-x64-gnu@0.0.2': - optional: true - - '@napi-rs/wasm-tools-linux-x64-musl@0.0.2': - optional: true - - '@napi-rs/wasm-tools-wasm32-wasi@0.0.2': - dependencies: - '@napi-rs/wasm-runtime': 0.2.4 - optional: true - - '@napi-rs/wasm-tools-win32-arm64-msvc@0.0.2': - optional: true - - '@napi-rs/wasm-tools-win32-ia32-msvc@0.0.2': - optional: true - - '@napi-rs/wasm-tools-win32-x64-msvc@0.0.2': - optional: true - - '@napi-rs/wasm-tools@0.0.2': - optionalDependencies: - '@napi-rs/wasm-tools-android-arm-eabi': 0.0.2 - '@napi-rs/wasm-tools-android-arm64': 0.0.2 - '@napi-rs/wasm-tools-darwin-arm64': 0.0.2 - '@napi-rs/wasm-tools-darwin-x64': 0.0.2 - '@napi-rs/wasm-tools-freebsd-x64': 0.0.2 - '@napi-rs/wasm-tools-linux-arm64-gnu': 0.0.2 - '@napi-rs/wasm-tools-linux-arm64-musl': 0.0.2 - '@napi-rs/wasm-tools-linux-x64-gnu': 0.0.2 - '@napi-rs/wasm-tools-linux-x64-musl': 0.0.2 - '@napi-rs/wasm-tools-wasm32-wasi': 0.0.2 - '@napi-rs/wasm-tools-win32-arm64-msvc': 0.0.2 - '@napi-rs/wasm-tools-win32-ia32-msvc': 0.0.2 - '@napi-rs/wasm-tools-win32-x64-msvc': 0.0.2 - - '@nodelib/fs.scandir@2.1.5': - dependencies: - '@nodelib/fs.stat': 2.0.5 - run-parallel: 1.2.0 - - '@nodelib/fs.stat@2.0.5': {} - - '@nodelib/fs.walk@1.2.8': - dependencies: - '@nodelib/fs.scandir': 2.1.5 - fastq: 1.17.1 - - '@octokit/auth-token@4.0.0': {} - - '@octokit/core@5.2.0': - dependencies: - '@octokit/auth-token': 4.0.0 - '@octokit/graphql': 7.1.0 - '@octokit/request': 8.4.0 - '@octokit/request-error': 5.1.0 - '@octokit/types': 13.5.0 - before-after-hook: 2.2.3 - universal-user-agent: 6.0.1 - - '@octokit/endpoint@9.0.5': - dependencies: - '@octokit/types': 13.5.0 - universal-user-agent: 6.0.1 - - '@octokit/graphql@7.1.0': - dependencies: - '@octokit/request': 8.4.0 - '@octokit/types': 13.5.0 - universal-user-agent: 6.0.1 - - '@octokit/openapi-types@22.2.0': {} - - '@octokit/plugin-paginate-rest@11.3.1(@octokit/core@5.2.0)': - dependencies: - '@octokit/core': 5.2.0 - '@octokit/types': 13.5.0 - - '@octokit/plugin-request-log@4.0.1(@octokit/core@5.2.0)': - dependencies: - '@octokit/core': 5.2.0 - - '@octokit/plugin-rest-endpoint-methods@13.2.2(@octokit/core@5.2.0)': - dependencies: - '@octokit/core': 5.2.0 - '@octokit/types': 13.5.0 - - '@octokit/request-error@5.1.0': - dependencies: - '@octokit/types': 13.5.0 - deprecation: 2.3.1 - once: 1.4.0 - - '@octokit/request@8.4.0': - dependencies: - '@octokit/endpoint': 9.0.5 - '@octokit/request-error': 5.1.0 - '@octokit/types': 13.5.0 - universal-user-agent: 6.0.1 - - '@octokit/rest@20.1.1': - dependencies: - '@octokit/core': 5.2.0 - '@octokit/plugin-paginate-rest': 11.3.1(@octokit/core@5.2.0) - '@octokit/plugin-request-log': 4.0.1(@octokit/core@5.2.0) - '@octokit/plugin-rest-endpoint-methods': 13.2.2(@octokit/core@5.2.0) - - '@octokit/types@13.5.0': - dependencies: - '@octokit/openapi-types': 22.2.0 - - '@rollup/pluginutils@4.2.1': - dependencies: - estree-walker: 2.0.2 - picomatch: 2.3.1 - - '@sindresorhus/merge-streams@2.3.0': {} - - '@tybys/wasm-util@0.9.0': - dependencies: - tslib: 2.6.3 - - '@types/node@20.14.2': - dependencies: - undici-types: 5.26.5 - - '@types/stylis@4.2.6': {} - - '@vercel/nft@0.26.5': - dependencies: - '@mapbox/node-pre-gyp': 1.0.11 - '@rollup/pluginutils': 4.2.1 - acorn: 8.12.0 - acorn-import-attributes: 1.9.5(acorn@8.12.0) - async-sema: 3.1.1 - bindings: 1.5.0 - estree-walker: 2.0.2 - glob: 7.2.3 - graceful-fs: 4.2.11 - micromatch: 4.0.7 - node-gyp-build: 4.8.1 - resolve-from: 5.0.0 - transitivePeerDependencies: - - encoding - - supports-color - - abbrev@1.1.1: {} - - acorn-import-attributes@1.9.5(acorn@8.12.0): - dependencies: - acorn: 8.12.0 - - acorn-walk@8.3.3: - dependencies: - acorn: 8.12.0 - - acorn@8.12.0: {} - - agent-base@6.0.2: - dependencies: - debug: 4.3.5 - transitivePeerDependencies: - - supports-color - - ansi-escapes@4.3.2: - dependencies: - type-fest: 0.21.3 - - ansi-regex@5.0.1: {} - - ansi-regex@6.0.1: {} - - ansi-styles@4.3.0: - dependencies: - color-convert: 2.0.1 - - ansi-styles@6.2.1: {} - - aproba@2.0.0: {} - - are-we-there-yet@2.0.0: - dependencies: - delegates: 1.0.0 - readable-stream: 3.6.2 - - argparse@1.0.10: - dependencies: - sprintf-js: 1.0.3 - - argparse@2.0.1: {} - - array-find-index@1.0.2: {} - - arrgv@1.0.2: {} - - arrify@3.0.0: {} - - async-sema@3.1.1: {} - - asynckit@0.4.0: {} - - ava@6.1.3: - dependencies: - '@vercel/nft': 0.26.5 - acorn: 8.12.0 - acorn-walk: 8.3.3 - ansi-styles: 6.2.1 - arrgv: 1.0.2 - arrify: 3.0.0 - callsites: 4.1.0 - cbor: 9.0.2 - chalk: 5.3.0 - chunkd: 2.0.1 - ci-info: 4.0.0 - ci-parallel-vars: 1.0.1 - cli-truncate: 4.0.0 - code-excerpt: 4.0.0 - common-path-prefix: 3.0.0 - concordance: 5.0.4 - currently-unhandled: 0.4.1 - debug: 4.3.5 - emittery: 1.0.3 - figures: 6.1.0 - globby: 14.0.1 - ignore-by-default: 2.1.0 - indent-string: 5.0.0 - is-plain-object: 5.0.0 - is-promise: 4.0.0 - matcher: 5.0.0 - memoize: 10.0.0 - ms: 2.1.3 - p-map: 7.0.2 - package-config: 5.0.0 - picomatch: 3.0.1 - plur: 5.1.0 - pretty-ms: 9.0.0 - resolve-cwd: 3.0.0 - stack-utils: 2.0.6 - strip-ansi: 7.1.0 - supertap: 3.0.1 - temp-dir: 3.0.0 - write-file-atomic: 5.0.1 - yargs: 17.7.2 - transitivePeerDependencies: - - encoding - - supports-color - - axios@1.6.2: - dependencies: - follow-redirects: 1.15.6 - form-data: 4.0.0 - proxy-from-env: 1.1.0 - transitivePeerDependencies: - - debug - - balanced-match@1.0.2: {} - - base64-js@1.5.1: {} - - before-after-hook@2.2.3: {} - - bindings@1.5.0: - dependencies: - file-uri-to-path: 1.0.0 - - bl@4.1.0: - dependencies: - buffer: 5.7.1 - inherits: 2.0.4 - readable-stream: 3.6.2 - - blueimp-md5@2.19.0: {} - - brace-expansion@1.1.11: - dependencies: - balanced-match: 1.0.2 - concat-map: 0.0.1 - - braces@3.0.3: - dependencies: - fill-range: 7.1.1 - - buffer@5.7.1: - dependencies: - base64-js: 1.5.1 - ieee754: 1.2.1 - - call-bind@1.0.7: - dependencies: - es-define-property: 1.0.0 - es-errors: 1.3.0 - function-bind: 1.1.2 - get-intrinsic: 1.2.4 - set-function-length: 1.2.2 - - callsites@4.1.0: {} - - camelize@1.0.1: {} - - cbor@9.0.2: - dependencies: - nofilter: 3.1.0 - - chalk@4.1.2: - dependencies: - ansi-styles: 4.3.0 - supports-color: 7.2.0 - - chalk@5.3.0: {} - - chardet@0.7.0: {} - - chownr@2.0.0: {} - - chunkd@2.0.1: {} - - ci-info@4.0.0: {} - - ci-parallel-vars@1.0.1: {} - - cli-cursor@3.1.0: - dependencies: - restore-cursor: 3.1.0 - - cli-spinners@2.9.2: {} - - cli-truncate@4.0.0: - dependencies: - slice-ansi: 5.0.0 - string-width: 7.1.0 - - cli-width@4.1.0: {} - - clipanion@3.2.1(typanion@3.14.0): - dependencies: - typanion: 3.14.0 - - cliui@8.0.1: - dependencies: - string-width: 4.2.3 - strip-ansi: 6.0.1 - wrap-ansi: 7.0.0 - - clone@1.0.4: {} - - code-excerpt@4.0.0: - dependencies: - convert-to-spaces: 2.0.1 - - color-convert@2.0.1: - dependencies: - color-name: 1.1.4 - - color-name@1.1.4: {} - - color-support@1.1.3: {} - - colorette@2.0.20: {} - - combined-stream@1.0.8: - dependencies: - delayed-stream: 1.0.0 - - common-path-prefix@3.0.0: {} - - concat-map@0.0.1: {} - - concordance@5.0.4: - dependencies: - date-time: 3.1.0 - esutils: 2.0.3 - fast-diff: 1.3.0 - js-string-escape: 1.0.1 - lodash: 4.17.21 - md5-hex: 3.0.1 - semver: 7.6.2 - well-known-symbols: 2.0.0 - - console-control-strings@1.1.0: {} - - convert-to-spaces@2.0.1: {} - - css-color-keywords@1.0.0: {} - - css-to-react-native@3.2.0: - dependencies: - camelize: 1.0.1 - css-color-keywords: 1.0.0 - postcss-value-parser: 4.2.0 - - csstype@3.1.3: {} - - currently-unhandled@0.4.1: - dependencies: - array-find-index: 1.0.2 - - date-time@3.1.0: - dependencies: - time-zone: 1.0.0 - - debug@4.3.5: - dependencies: - ms: 2.1.2 - - defaults@1.0.4: - dependencies: - clone: 1.0.4 - - define-data-property@1.1.4: - dependencies: - es-define-property: 1.0.0 - es-errors: 1.3.0 - gopd: 1.0.1 - - delayed-stream@1.0.0: {} - - delegates@1.0.0: {} - - deprecation@2.3.1: {} - - detect-libc@2.0.3: {} - - emittery@1.0.3: {} - - emnapi@1.2.0: {} - - emoji-regex@10.3.0: {} - - emoji-regex@8.0.0: {} - - es-define-property@1.0.0: - dependencies: - get-intrinsic: 1.2.4 - - es-errors@1.3.0: {} - - escalade@3.1.2: {} - - escape-string-regexp@2.0.0: {} - - escape-string-regexp@5.0.0: {} - - esprima@4.0.1: {} - - estree-walker@2.0.2: {} - - esutils@2.0.3: {} - - external-editor@3.1.0: - dependencies: - chardet: 0.7.0 - iconv-lite: 0.4.24 - tmp: 0.0.33 - - fast-diff@1.3.0: {} - - fast-glob@3.3.2: - dependencies: - '@nodelib/fs.stat': 2.0.5 - '@nodelib/fs.walk': 1.2.8 - glob-parent: 5.1.2 - merge2: 1.4.1 - micromatch: 4.0.7 - - fastq@1.17.1: - dependencies: - reusify: 1.0.4 - - figures@6.1.0: - dependencies: - is-unicode-supported: 2.0.0 - - file-uri-to-path@1.0.0: {} - - fill-range@7.1.1: - dependencies: - to-regex-range: 5.0.1 - - find-up-simple@1.0.0: {} - - follow-redirects@1.15.6: {} - - form-data@4.0.0: - dependencies: - asynckit: 0.4.0 - combined-stream: 1.0.8 - mime-types: 2.1.35 - - fs-minipass@2.1.0: - dependencies: - minipass: 3.3.6 - - fs.realpath@1.0.0: {} - - function-bind@1.1.2: {} - - gauge@3.0.2: - dependencies: - aproba: 2.0.0 - color-support: 1.1.3 - console-control-strings: 1.1.0 - has-unicode: 2.0.1 - object-assign: 4.1.1 - signal-exit: 3.0.7 - string-width: 4.2.3 - strip-ansi: 6.0.1 - wide-align: 1.1.5 - - get-caller-file@2.0.5: {} - - get-east-asian-width@1.2.0: {} - - get-intrinsic@1.2.4: - dependencies: - es-errors: 1.3.0 - function-bind: 1.1.2 - has-proto: 1.0.3 - has-symbols: 1.0.3 - hasown: 2.0.2 - - glob-parent@5.1.2: - dependencies: - is-glob: 4.0.3 - - glob@7.2.3: - dependencies: - fs.realpath: 1.0.0 - inflight: 1.0.6 - inherits: 2.0.4 - minimatch: 3.1.2 - once: 1.4.0 - path-is-absolute: 1.0.1 - - globby@14.0.1: - dependencies: - '@sindresorhus/merge-streams': 2.3.0 - fast-glob: 3.3.2 - ignore: 5.3.1 - path-type: 5.0.0 - slash: 5.1.0 - unicorn-magic: 0.1.0 - - gopd@1.0.1: - dependencies: - get-intrinsic: 1.2.4 - - graceful-fs@4.2.11: {} - - has-flag@4.0.0: {} - - has-property-descriptors@1.0.2: - dependencies: - es-define-property: 1.0.0 - - has-proto@1.0.3: {} - - has-symbols@1.0.3: {} - - has-unicode@2.0.1: {} - - hasown@2.0.2: - dependencies: - function-bind: 1.1.2 - - https-proxy-agent@5.0.1: - dependencies: - agent-base: 6.0.2 - debug: 4.3.5 - transitivePeerDependencies: - - supports-color - - iconv-lite@0.4.24: - dependencies: - safer-buffer: 2.1.2 - - ieee754@1.2.1: {} - - ignore-by-default@2.1.0: {} - - ignore@5.3.1: {} - - imurmurhash@0.1.4: {} - - indent-string@5.0.0: {} - - inflight@1.0.6: - dependencies: - once: 1.4.0 - wrappy: 1.0.2 - - inherits@2.0.4: {} - - inquirer@9.2.23: - dependencies: - '@inquirer/figures': 1.0.3 - '@ljharb/through': 2.3.13 - ansi-escapes: 4.3.2 - chalk: 5.3.0 - cli-cursor: 3.1.0 - cli-width: 4.1.0 - external-editor: 3.1.0 - lodash: 4.17.21 - mute-stream: 1.0.0 - ora: 5.4.1 - run-async: 3.0.0 - rxjs: 7.8.1 - string-width: 4.2.3 - strip-ansi: 6.0.1 - wrap-ansi: 6.2.0 - - irregular-plurals@3.5.0: {} - - is-extglob@2.1.1: {} - - is-fullwidth-code-point@3.0.0: {} - - is-fullwidth-code-point@4.0.0: {} - - is-glob@4.0.3: - dependencies: - is-extglob: 2.1.1 - - is-interactive@1.0.0: {} - - is-number@7.0.0: {} - - is-plain-object@5.0.0: {} - - is-promise@4.0.0: {} - - is-unicode-supported@0.1.0: {} - - is-unicode-supported@2.0.0: {} - - js-string-escape@1.0.1: {} - - js-tokens@4.0.0: {} - - js-yaml@3.14.1: - dependencies: - argparse: 1.0.10 - esprima: 4.0.1 - - js-yaml@4.1.0: - dependencies: - argparse: 2.0.1 - - load-json-file@7.0.1: {} - - lodash-es@4.17.21: {} - - lodash@4.17.21: {} - - log-symbols@4.1.0: - dependencies: - chalk: 4.1.2 - is-unicode-supported: 0.1.0 - - loose-envify@1.4.0: - dependencies: - js-tokens: 4.0.0 - - make-dir@3.1.0: - dependencies: - semver: 6.3.1 - - matcher@5.0.0: - dependencies: - escape-string-regexp: 5.0.0 - - md5-hex@3.0.1: - dependencies: - blueimp-md5: 2.19.0 - - memoize@10.0.0: - dependencies: - mimic-function: 5.0.1 - - merge2@1.4.1: {} - - micromatch@4.0.7: - dependencies: - braces: 3.0.3 - picomatch: 2.3.1 - - mime-db@1.52.0: {} - - mime-types@2.1.35: - dependencies: - mime-db: 1.52.0 - - mimic-fn@2.1.0: {} - - mimic-function@5.0.1: {} - - minimatch@3.1.2: - dependencies: - brace-expansion: 1.1.11 - - minipass@3.3.6: - dependencies: - yallist: 4.0.0 - - minipass@5.0.0: {} - - minizlib@2.1.2: - dependencies: - minipass: 3.3.6 - yallist: 4.0.0 - - mkdirp@1.0.4: {} - - ms@2.1.2: {} - - ms@2.1.3: {} - - mute-stream@1.0.0: {} - - nanoid@3.3.7: {} - - node-fetch@2.7.0: - dependencies: - whatwg-url: 5.0.0 - - node-gyp-build@4.8.1: {} - - nofilter@3.1.0: {} - - nopt@5.0.0: - dependencies: - abbrev: 1.1.1 - - npmlog@5.0.1: - dependencies: - are-we-there-yet: 2.0.0 - console-control-strings: 1.1.0 - gauge: 3.0.2 - set-blocking: 2.0.0 - - object-assign@4.1.1: {} - - once@1.4.0: - dependencies: - wrappy: 1.0.2 - - onetime@5.1.2: - dependencies: - mimic-fn: 2.1.0 - - ora@5.4.1: - dependencies: - bl: 4.1.0 - chalk: 4.1.2 - cli-cursor: 3.1.0 - cli-spinners: 2.9.2 - is-interactive: 1.0.0 - is-unicode-supported: 0.1.0 - log-symbols: 4.1.0 - strip-ansi: 6.0.1 - wcwidth: 1.0.1 - - os-tmpdir@1.0.2: {} - - p-map@7.0.2: {} - - package-config@5.0.0: - dependencies: - find-up-simple: 1.0.0 - load-json-file: 7.0.1 - - parse-ms@4.0.0: {} - - path-is-absolute@1.0.1: {} - - path-type@5.0.0: {} - - picocolors@1.0.1: {} - - picomatch@2.3.1: {} - - picomatch@3.0.1: {} - - plur@5.1.0: - dependencies: - irregular-plurals: 3.5.0 - - postcss-value-parser@4.2.0: {} - - postcss@8.4.33: - dependencies: - nanoid: 3.3.7 - picocolors: 1.0.1 - source-map-js: 1.2.0 - - pretty-ms@9.0.0: - dependencies: - parse-ms: 4.0.0 - - proxy-from-env@1.1.0: {} - - queue-microtask@1.2.3: {} - - react-dom@18.3.1(react@18.3.1): - dependencies: - loose-envify: 1.4.0 - react: 18.3.1 - scheduler: 0.23.2 - - react@18.3.1: - dependencies: - loose-envify: 1.4.0 - - readable-stream@3.6.2: - dependencies: - inherits: 2.0.4 - string_decoder: 1.3.0 - util-deprecate: 1.0.2 - - require-directory@2.1.1: {} - - resolve-cwd@3.0.0: - dependencies: - resolve-from: 5.0.0 - - resolve-from@5.0.0: {} - - restore-cursor@3.1.0: - dependencies: - onetime: 5.1.2 - signal-exit: 3.0.7 - - reusify@1.0.4: {} - - rimraf@3.0.2: - dependencies: - glob: 7.2.3 - - run-async@3.0.0: {} - - run-parallel@1.2.0: - dependencies: - queue-microtask: 1.2.3 - - rxjs@7.8.1: - dependencies: - tslib: 2.6.3 - - safe-buffer@5.2.1: {} - - safer-buffer@2.1.2: {} - - scheduler@0.23.2: - dependencies: - loose-envify: 1.4.0 - - semver@6.3.1: {} - - semver@7.6.2: {} - - serialize-error@7.0.1: - dependencies: - type-fest: 0.13.1 - - set-blocking@2.0.0: {} - - set-function-length@1.2.2: - 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 - - shallowequal@1.1.0: {} - - signal-exit@3.0.7: {} - - signal-exit@4.1.0: {} - - slash@5.1.0: {} - - slice-ansi@5.0.0: - dependencies: - ansi-styles: 6.2.1 - is-fullwidth-code-point: 4.0.0 - - source-map-js@1.2.0: {} - - sprintf-js@1.0.3: {} - - stack-utils@2.0.6: - dependencies: - escape-string-regexp: 2.0.0 - - string-width@4.2.3: - dependencies: - emoji-regex: 8.0.0 - is-fullwidth-code-point: 3.0.0 - strip-ansi: 6.0.1 - - string-width@7.1.0: - dependencies: - emoji-regex: 10.3.0 - get-east-asian-width: 1.2.0 - strip-ansi: 7.1.0 - - string_decoder@1.3.0: - dependencies: - safe-buffer: 5.2.1 - - strip-ansi@6.0.1: - dependencies: - ansi-regex: 5.0.1 - - strip-ansi@7.1.0: - dependencies: - ansi-regex: 6.0.1 - - styled-components@6.1.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1): - dependencies: - '@emotion/is-prop-valid': 1.2.2 - '@emotion/unitless': 0.8.1 - '@types/stylis': 4.2.6 - css-to-react-native: 3.2.0 - csstype: 3.1.3 - postcss: 8.4.33 - react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) - shallowequal: 1.1.0 - stylis: 4.3.2 - tslib: 2.6.3 - - stylis@4.3.2: {} - - supertap@3.0.1: - dependencies: - indent-string: 5.0.0 - js-yaml: 3.14.1 - serialize-error: 7.0.1 - strip-ansi: 7.1.0 - - supports-color@7.2.0: - dependencies: - has-flag: 4.0.0 - - tar@6.2.1: - dependencies: - chownr: 2.0.0 - fs-minipass: 2.1.0 - minipass: 5.0.0 - minizlib: 2.1.2 - mkdirp: 1.0.4 - yallist: 4.0.0 - - temp-dir@3.0.0: {} - - time-zone@1.0.0: {} - - tmp@0.0.33: - dependencies: - os-tmpdir: 1.0.2 - - to-regex-range@5.0.1: - dependencies: - is-number: 7.0.0 - - toml@3.0.0: {} - - tr46@0.0.3: {} - - tslib@2.6.3: {} - - typanion@3.14.0: {} - - type-fest@0.13.1: {} - - type-fest@0.21.3: {} - - typescript@5.4.5: {} - - undici-types@5.26.5: {} - - unicorn-magic@0.1.0: {} - - universal-user-agent@6.0.1: {} - - util-deprecate@1.0.2: {} - - wasm-sjlj@1.0.5: {} - - wcwidth@1.0.1: - dependencies: - defaults: 1.0.4 - - webidl-conversions@3.0.1: {} - - well-known-symbols@2.0.0: {} - - whatwg-url@5.0.0: - dependencies: - tr46: 0.0.3 - webidl-conversions: 3.0.1 - - wide-align@1.1.5: - dependencies: - string-width: 4.2.3 - - wrap-ansi@6.2.0: - dependencies: - ansi-styles: 4.3.0 - string-width: 4.2.3 - strip-ansi: 6.0.1 - - wrap-ansi@7.0.0: - dependencies: - ansi-styles: 4.3.0 - string-width: 4.2.3 - strip-ansi: 6.0.1 - - wrappy@1.0.2: {} - - write-file-atomic@5.0.1: - dependencies: - imurmurhash: 0.1.4 - signal-exit: 4.1.0 - - y18n@5.0.8: {} - - yallist@4.0.0: {} - - yargs-parser@21.1.1: {} - - yargs@17.7.2: - dependencies: - cliui: 8.0.1 - escalade: 3.1.2 - get-caller-file: 2.0.5 - require-directory: 2.1.1 - string-width: 4.2.3 - y18n: 5.0.8 - yargs-parser: 21.1.1 diff --git a/src/builtins.rs b/src/builtins.rs deleted file mode 100644 index 45a25117..00000000 --- a/src/builtins.rs +++ /dev/null @@ -1,71 +0,0 @@ -/// Node.js built-in modules -/// -/// `node -p "[...require('module').builtinModules].map(b => JSON.stringify(b)).join(',\n')"` -/// -pub const NODEJS_BUILTINS: &[&str] = &[ - "_http_agent", - "_http_client", - "_http_common", - "_http_incoming", - "_http_outgoing", - "_http_server", - "_stream_duplex", - "_stream_passthrough", - "_stream_readable", - "_stream_transform", - "_stream_wrap", - "_stream_writable", - "_tls_common", - "_tls_wrap", - "assert", - "assert/strict", - "async_hooks", - "buffer", - "child_process", - "cluster", - "console", - "constants", - "crypto", - "dgram", - "diagnostics_channel", - "dns", - "dns/promises", - "domain", - "events", - "fs", - "fs/promises", - "http", - "http2", - "https", - "inspector", - "module", - "net", - "os", - "path", - "path/posix", - "path/win32", - "perf_hooks", - "process", - "punycode", - "querystring", - "readline", - "repl", - "stream", - "stream/consumers", - "stream/promises", - "stream/web", - "string_decoder", - "sys", - "timers", - "timers/promises", - "tls", - "trace_events", - "tty", - "url", - "util", - "util/types", - "v8", - "vm", - "worker_threads", - "zlib", -]; diff --git a/src/cache.rs b/src/cache.rs deleted file mode 100644 index a1bde36c..00000000 --- a/src/cache.rs +++ /dev/null @@ -1,369 +0,0 @@ -use once_cell::sync::OnceCell as OnceLock; -use std::{ - borrow::{Borrow, Cow}, - convert::AsRef, - hash::{BuildHasherDefault, Hash, Hasher}, - io, - ops::Deref, - path::{Path, PathBuf}, - sync::Arc, -}; - -use dashmap::{DashMap, DashSet}; -use rustc_hash::FxHasher; - -use crate::{ - context::ResolveContext as Ctx, package_json::PackageJson, path::PathUtil, FileMetadata, - FileSystem, ResolveError, ResolveOptions, TsConfig, -}; - -#[derive(Default)] -pub struct Cache { - pub(crate) fs: Fs, - paths: DashSet>, - tsconfigs: DashMap, BuildHasherDefault>, -} - -impl Cache { - pub fn new(fs: Fs) -> Self { - Self { fs, paths: DashSet::default(), tsconfigs: DashMap::default() } - } - - pub fn clear(&self) { - self.paths.clear(); - self.tsconfigs.clear(); - } - - pub fn value(&self, path: &Path) -> CachedPath { - let hash = { - let mut hasher = FxHasher::default(); - path.hash(&mut hasher); - hasher.finish() - }; - if let Some(cache_entry) = self.paths.get((hash, path).borrow() as &dyn CacheKey) { - return cache_entry.clone(); - } - let parent = path.parent().map(|p| self.value(p)); - let data = CachedPath(Arc::new(CachedPathImpl::new( - hash, - path.to_path_buf().into_boxed_path(), - parent, - ))); - self.paths.insert(data.clone()); - data - } - - pub fn tsconfig Result<(), ResolveError>>( - &self, - root: bool, - path: &Path, - callback: F, // callback for modifying tsconfig with `extends` - ) -> Result, ResolveError> { - if let Some(tsconfig_ref) = self.tsconfigs.get(path) { - return Ok(Arc::clone(tsconfig_ref.value())); - } - let meta = self.fs.metadata(path).ok(); - let tsconfig_path = if meta.is_some_and(|m| m.is_file) { - Cow::Borrowed(path) - } else if meta.is_some_and(|m| m.is_dir) { - Cow::Owned(path.join("tsconfig.json")) - } else { - let mut os_string = path.to_path_buf().into_os_string(); - os_string.push(".json"); - Cow::Owned(PathBuf::from(os_string)) - }; - let mut tsconfig_string = self - .fs - .read_to_string(&tsconfig_path) - .map_err(|_| ResolveError::TsconfigNotFound(path.to_path_buf()))?; - let mut tsconfig = - TsConfig::parse(root, &tsconfig_path, &mut tsconfig_string).map_err(|error| { - ResolveError::from_serde_json_error(tsconfig_path.to_path_buf(), &error) - })?; - callback(&mut tsconfig)?; - let tsconfig = Arc::new(tsconfig.build()); - self.tsconfigs.insert(path.to_path_buf(), Arc::clone(&tsconfig)); - Ok(tsconfig) - } -} - -#[derive(Clone)] -pub struct CachedPath(Arc); - -impl Hash for CachedPath { - fn hash(&self, state: &mut H) { - self.0.hash.hash(state); - } -} - -impl PartialEq for CachedPath { - fn eq(&self, other: &Self) -> bool { - self.0.path == other.0.path - } -} -impl Eq for CachedPath {} - -impl Deref for CachedPath { - type Target = CachedPathImpl; - - fn deref(&self) -> &Self::Target { - self.0.as_ref() - } -} - -impl<'a> Borrow for CachedPath { - fn borrow(&self) -> &(dyn CacheKey + 'a) { - self - } -} - -impl AsRef for CachedPath { - fn as_ref(&self) -> &CachedPathImpl { - self.0.as_ref() - } -} - -impl CacheKey for CachedPath { - fn tuple(&self) -> (u64, &Path) { - (self.hash, &self.path) - } -} - -pub struct CachedPathImpl { - hash: u64, - path: Box, - parent: Option, - meta: OnceLock>, - symlink: OnceLock>, - canonicalized: OnceLock>, - node_modules: OnceLock>, - package_json: OnceLock>>, -} - -impl CachedPathImpl { - fn new(hash: u64, path: Box, parent: Option) -> Self { - Self { - hash, - path, - parent, - meta: OnceLock::new(), - symlink: OnceLock::new(), - canonicalized: OnceLock::new(), - node_modules: OnceLock::new(), - package_json: OnceLock::new(), - } - } - - pub fn path(&self) -> &Path { - &self.path - } - - pub fn to_path_buf(&self) -> PathBuf { - self.path.to_path_buf() - } - - pub fn parent(&self) -> Option<&CachedPath> { - self.parent.as_ref() - } - - fn meta(&self, fs: &Fs) -> Option { - *self.meta.get_or_init(|| fs.metadata(&self.path).ok()) - } - - pub fn is_file(&self, fs: &Fs, ctx: &mut Ctx) -> bool { - if let Some(meta) = self.meta(fs) { - ctx.add_file_dependency(self.path()); - meta.is_file - } else { - ctx.add_missing_dependency(self.path()); - false - } - } - - pub fn is_dir(&self, fs: &Fs, ctx: &mut Ctx) -> bool { - self.meta(fs).map_or_else( - || { - ctx.add_missing_dependency(self.path()); - false - }, - |meta| meta.is_dir, - ) - } - - fn symlink(&self, fs: &Fs) -> io::Result> { - self.symlink - .get_or_try_init(|| { - if let Ok(symlink_metadata) = fs.symlink_metadata(&self.path) { - if symlink_metadata.is_symlink { - return fs.canonicalize(self.path()).map(Some); - } - } - Ok(None) - }) - .cloned() - } - - pub fn realpath(&self, fs: &Fs) -> io::Result { - self.canonicalized - .get_or_try_init(|| { - if let Some(link) = self.symlink(fs)? { - return Ok(Some(link)); - } - if let Some(parent) = self.parent() { - let parent_path = parent.realpath(fs)?; - return Ok(Some( - parent_path.normalize_with(self.path.strip_prefix(&parent.path).unwrap()), - )); - }; - Ok(None) - }) - .cloned() - .map(|r| r.unwrap_or_else(|| self.path.clone().to_path_buf())) - } - - pub fn module_directory( - &self, - module_name: &str, - cache: &Cache, - ctx: &mut Ctx, - ) -> Option { - let cached_path = cache.value(&self.path.join(module_name)); - cached_path.is_dir(&cache.fs, ctx).then_some(cached_path) - } - - pub fn cached_node_modules( - &self, - cache: &Cache, - ctx: &mut Ctx, - ) -> Option { - self.node_modules.get_or_init(|| self.module_directory("node_modules", cache, ctx)).clone() - } - - /// Find package.json of a path by traversing parent directories. - /// - /// # Errors - /// - /// * [ResolveError::JSON] - pub fn find_package_json( - &self, - fs: &Fs, - options: &ResolveOptions, - ctx: &mut Ctx, - ) -> Result>, ResolveError> { - let mut cache_value = self; - // Go up directories when the querying path is not a directory - while !cache_value.is_dir(fs, ctx) { - if let Some(cv) = &cache_value.parent { - cache_value = cv.as_ref(); - } else { - break; - } - } - let mut cache_value = Some(cache_value); - while let Some(cv) = cache_value { - if let Some(package_json) = cv.package_json(fs, options, ctx)? { - return Ok(Some(Arc::clone(&package_json))); - } - cache_value = cv.parent.as_deref(); - } - Ok(None) - } - - /// Get package.json of the given path. - /// - /// # Errors - /// - /// * [ResolveError::JSON] - pub fn package_json( - &self, - fs: &Fs, - options: &ResolveOptions, - ctx: &mut Ctx, - ) -> Result>, ResolveError> { - // Change to `std::sync::OnceLock::get_or_try_init` when it is stable. - let result = self - .package_json - .get_or_try_init(|| { - let package_json_path = self.path.join("package.json"); - let Ok(package_json_string) = fs.read_to_string(&package_json_path) else { - return Ok(None); - }; - let real_path = if options.symlinks { - self.realpath(fs)?.join("package.json") - } else { - package_json_path.clone() - }; - PackageJson::parse(package_json_path.clone(), real_path, &package_json_string) - .map(Arc::new) - .map(Some) - .map_err(|error| ResolveError::from_serde_json_error(package_json_path, &error)) - }) - .cloned(); - // https://github.com/webpack/enhanced-resolve/blob/58464fc7cb56673c9aa849e68e6300239601e615/lib/DescriptionFileUtils.js#L68-L82 - match &result { - Ok(Some(package_json)) => { - ctx.add_file_dependency(&package_json.path); - } - Ok(None) => { - // Avoid an allocation by making this lazy - if let Some(deps) = &mut ctx.missing_dependencies { - deps.push(self.path.join("package.json")); - } - } - Err(_) => { - if let Some(deps) = &mut ctx.file_dependencies { - deps.push(self.path.join("package.json")); - } - } - } - result - } -} - -/// Memoized cache key, code adapted from . -trait CacheKey { - fn tuple(&self) -> (u64, &Path); -} - -impl Hash for dyn CacheKey + '_ { - fn hash(&self, state: &mut H) { - self.tuple().0.hash(state); - } -} - -impl PartialEq for dyn CacheKey + '_ { - fn eq(&self, other: &Self) -> bool { - self.tuple().1 == other.tuple().1 - } -} - -impl Eq for dyn CacheKey + '_ {} - -impl<'a> CacheKey for (u64, &'a Path) { - fn tuple(&self) -> (u64, &Path) { - (self.0, self.1) - } -} - -impl<'a> Borrow for (u64, &'a Path) { - fn borrow(&self) -> &(dyn CacheKey + 'a) { - self - } -} - -/// Since the cache key is memoized, use an identity hasher -/// to avoid double cache. -#[derive(Default)] -struct IdentityHasher(u64); - -impl Hasher for IdentityHasher { - fn write(&mut self, _: &[u8]) { - unreachable!("Invalid use of IdentityHasher") - } - fn write_u64(&mut self, n: u64) { - self.0 = n; - } - fn finish(&self) -> u64 { - self.0 - } -} diff --git a/src/context.rs b/src/context.rs deleted file mode 100644 index 9349de30..00000000 --- a/src/context.rs +++ /dev/null @@ -1,89 +0,0 @@ -use std::{ - ops::{Deref, DerefMut}, - path::{Path, PathBuf}, -}; - -use crate::error::ResolveError; - -#[derive(Debug, Default, Clone)] -pub struct ResolveContext(ResolveContextImpl); - -#[derive(Debug, Default, Clone)] -pub struct ResolveContextImpl { - pub fully_specified: bool, - - pub query: Option, - - pub fragment: Option, - - /// Files that was found on file system - pub file_dependencies: Option>, - - /// Files that was found on file system - pub missing_dependencies: Option>, - - /// The current resolving alias for bailing recursion alias. - pub resolving_alias: Option, - - /// For avoiding infinite recursion, which will cause stack overflow. - depth: u8, -} - -impl Deref for ResolveContext { - type Target = ResolveContextImpl; - - fn deref(&self) -> &Self::Target { - &self.0 - } -} - -impl DerefMut for ResolveContext { - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} - -impl ResolveContext { - pub fn with_fully_specified(&mut self, yes: bool) { - self.fully_specified = yes; - } - - pub fn with_query_fragment(&mut self, query: Option<&str>, fragment: Option<&str>) { - if let Some(query) = query { - self.query.replace(query.to_string()); - } - if let Some(fragment) = fragment { - self.fragment.replace(fragment.to_string()); - } - } - - pub fn init_file_dependencies(&mut self) { - self.file_dependencies.replace(vec![]); - self.missing_dependencies.replace(vec![]); - } - - pub fn add_file_dependency(&mut self, dep: &Path) { - if let Some(deps) = &mut self.file_dependencies { - deps.push(dep.to_path_buf()); - } - } - - pub fn add_missing_dependency(&mut self, dep: &Path) { - if let Some(deps) = &mut self.missing_dependencies { - deps.push(dep.to_path_buf()); - } - } - - pub fn with_resolving_alias(&mut self, alias: String) { - self.resolving_alias = Some(alias); - } - - pub fn test_for_infinite_recursion(&mut self) -> Result<(), ResolveError> { - self.depth += 1; - // 64 should be more than enough for detecting infinite recursion. - if self.depth > 64 { - return Err(ResolveError::Recursion); - } - Ok(()) - } -} diff --git a/src/error.rs b/src/error.rs deleted file mode 100644 index ff2aaa4f..00000000 --- a/src/error.rs +++ /dev/null @@ -1,160 +0,0 @@ -use std::{io, path::PathBuf, sync::Arc}; -use thiserror::Error; - -/// All resolution errors -/// -/// `thiserror` is used to display meaningful error messages. -#[derive(Debug, Clone, PartialEq, Error)] -pub enum ResolveError { - /// Ignored path - /// - /// Derived from ignored path (false value) from browser field in package.json - /// ```json - /// { - /// "browser": { - /// "./module": false - /// } - /// } - /// ``` - /// See - #[error("Path is ignored {0}")] - Ignored(PathBuf), - - /// Module not found - #[error("Cannot find module '{0}'")] - NotFound(/* specifier */ String), - - /// Tsconfig not found - #[error("Tsconfig not found {0}")] - TsconfigNotFound(PathBuf), - - #[error("{0}")] - IOError(IOError), - - /// Node.js builtin modules - /// - /// This is an error due to not being a Node.js runtime. - /// The `alias` option can be used to resolve a builtin module to a polyfill. - #[error("Builtin module {0}")] - Builtin(String), - - /// All of the aliased extension are not found - #[error("All of the aliased extension are not found")] - ExtensionAlias, - - /// The provided path specifier cannot be parsed - #[error("{0}")] - Specifier(SpecifierError), - - /// JSON parse error - #[error("{0:?}")] - JSON(JSONError), - - /// Restricted by `ResolveOptions::restrictions` - #[error(r#"Path "{0}" restricted by {0}"#)] - Restriction(PathBuf, PathBuf), - - #[error(r#"Invalid module "{0}" specifier is not a valid subpath for the "exports" resolution of {1}"#)] - InvalidModuleSpecifier(String, PathBuf), - - #[error(r#"Invalid "exports" target "{0}" defined for '{1}' in the package config {2}"#)] - InvalidPackageTarget(String, String, PathBuf), - - #[error(r#"Package subpath '{0}' is not defined by "exports" in {1}"#)] - PackagePathNotExported(String, PathBuf), - - #[error(r#"Invalid package config "{0}", "exports" cannot contain some keys starting with '.' and some not. The exports object must either be an object of package subpath keys or an object of main entry condition name keys only."#)] - InvalidPackageConfig(PathBuf), - - #[error(r#"Default condition should be last one in "{0}""#)] - InvalidPackageConfigDefault(PathBuf), - - #[error(r#"Expecting folder to folder mapping. "{0}" should end with "/"#)] - InvalidPackageConfigDirectory(PathBuf), - - #[error(r#"Package import specifier "{0}" is not defined in package {1}"#)] - PackageImportNotDefined(String, PathBuf), - - #[error("{0} is unimplemented")] - Unimplemented(&'static str), - - /// Occurs when alias paths reference each other. - #[error("Recursion in resolving")] - Recursion, -} - -impl ResolveError { - pub fn is_ignore(&self) -> bool { - matches!(self, Self::Ignored(_)) - } - - pub(crate) fn from_serde_json_error(path: PathBuf, error: &serde_json::Error) -> Self { - Self::JSON(JSONError { - path, - message: error.to_string(), - line: error.line(), - column: error.column(), - }) - } -} - -/// Error for [ResolveError::Specifier] -#[derive(Debug, Clone, Eq, PartialEq, Error)] -pub enum SpecifierError { - #[error("The specifiers must be a non-empty string. Received \"{0}\"")] - Empty(String), -} - -/// JSON error from [serde_json::Error] -#[derive(Debug, Clone, Eq, PartialEq)] -pub struct JSONError { - pub path: PathBuf, - pub message: String, - pub line: usize, - pub column: usize, -} - -#[derive(Debug, Clone, Error)] -#[error("{0}")] -pub struct IOError(Arc); - -impl PartialEq for IOError { - fn eq(&self, other: &Self) -> bool { - self.0.kind() == other.0.kind() - } -} - -impl From for io::Error { - fn from(error: IOError) -> Self { - let io_error = error.0.as_ref(); - Self::new(io_error.kind(), io_error.to_string()) - } -} - -impl From for ResolveError { - fn from(err: io::Error) -> Self { - Self::IOError(IOError(Arc::new(err))) - } -} - -#[test] -fn test_into_io_error() { - use std::io::{self, ErrorKind}; - let error_string = "IOError occurred"; - let string_error = io::Error::new(ErrorKind::Interrupted, error_string.to_string()); - let string_error2 = io::Error::new(ErrorKind::Interrupted, error_string.to_string()); - let resolve_io_error: ResolveError = ResolveError::from(string_error2); - - assert_eq!(resolve_io_error, ResolveError::from(string_error)); - assert_eq!(resolve_io_error.clone(), resolve_io_error); - if let ResolveError::IOError(io_error) = resolve_io_error { - // fix for https://github.com/web-infra-dev/rspack/issues/4564 - let std_io_error: io::Error = io_error.into(); - assert_eq!(std_io_error.kind(), ErrorKind::Interrupted); - assert_eq!(std_io_error.to_string(), error_string); - assert_eq!( - format!("{std_io_error:?}"), - r#"Custom { kind: Interrupted, error: "IOError occurred" }"# - ); - } -} diff --git a/src/file_system.rs b/src/file_system.rs deleted file mode 100644 index 04d177de..00000000 --- a/src/file_system.rs +++ /dev/null @@ -1,133 +0,0 @@ -use std::{ - fs, io, - path::{Path, PathBuf}, -}; - -/// File System abstraction used for `ResolverGeneric` -pub trait FileSystem: Send + Sync { - /// See [std::fs::read_to_string] - /// - /// # Errors - /// - /// * See [std::fs::read_to_string] - /// ## Warning - /// Use `&Path` instead of a generic `P: AsRef` here, - /// because object safety requirements, it is especially useful, when - /// you want to store multiple `dyn FileSystem` in a `Vec` or use a `ResolverGeneric` in - /// napi env. - fn read_to_string(&self, path: &Path) -> io::Result; - - /// See [std::fs::metadata] - /// - /// # Errors - /// See [std::fs::metadata] - /// ## Warning - /// Use `&Path` instead of a generic `P: AsRef` here, - /// because object safety requirements, it is especially useful, when - /// you want to store multiple `dyn FileSystem` in a `Vec` or use a `ResolverGeneric` in - /// napi env. - fn metadata(&self, path: &Path) -> io::Result; - - /// See [std::fs::symlink_metadata] - /// - /// # Errors - /// - /// See [std::fs::symlink_metadata] - /// ## Warning - /// Use `&Path` instead of a generic `P: AsRef` here, - /// because object safety requirements, it is especially useful, when - /// you want to store multiple `dyn FileSystem` in a `Vec` or use a `ResolverGeneric` in - /// napi env. - fn symlink_metadata(&self, path: &Path) -> io::Result; - - /// See [std::fs::canonicalize] - /// - /// # Errors - /// - /// See [std::fs::read_link] - /// ## Warning - /// Use `&Path` instead of a generic `P: AsRef` here, - /// because object safety requirements, it is especially useful, when - /// you want to store multiple `dyn FileSystem` in a `Vec` or use a `ResolverGeneric` in - /// napi env. - fn canonicalize(&self, path: &Path) -> io::Result; -} - -/// Metadata information about a file -#[derive(Debug, Clone, Copy)] -pub struct FileMetadata { - pub(crate) is_file: bool, - pub(crate) is_dir: bool, - pub(crate) is_symlink: bool, -} - -impl FileMetadata { - pub fn new(is_file: bool, is_dir: bool, is_symlink: bool) -> Self { - Self { is_file, is_dir, is_symlink } - } -} - -impl From for FileMetadata { - fn from(metadata: fs::Metadata) -> Self { - Self::new(metadata.is_file(), metadata.is_dir(), metadata.is_symlink()) - } -} - -/// Operating System -#[derive(Default)] -pub struct FileSystemOs; - -impl FileSystem for FileSystemOs { - fn read_to_string(&self, path: &Path) -> io::Result { - fs::read_to_string(path) - } - - fn metadata(&self, path: &Path) -> io::Result { - fs::metadata(path).map(FileMetadata::from) - } - - fn symlink_metadata(&self, path: &Path) -> io::Result { - fs::symlink_metadata(path).map(FileMetadata::from) - } - - fn canonicalize(&self, path: &Path) -> io::Result { - #[cfg(not(target_os = "wasi"))] - { - dunce::canonicalize(path) - } - #[cfg(target_os = "wasi")] - { - let meta = fs::symlink_metadata(path)?; - if meta.file_type().is_symlink() { - let link = fs::read_link(path)?; - let mut path_buf = path.to_path_buf(); - path_buf.pop(); - for segment in link.iter() { - match segment.to_str() { - Some("..") => { - path_buf.pop(); - } - Some(".") | None => {} - Some(seg) => { - // Need to trim the extra \0 introduces by rust std rust-lang/rust#123727 - path_buf.push(seg.trim_end_matches('\0')); - } - } - } - Ok(path_buf) - } else { - Ok(path.to_path_buf()) - } - } - } -} - -#[test] -fn metadata() { - let meta = FileMetadata { is_file: true, is_dir: true, is_symlink: true }; - assert_eq!( - format!("{meta:?}"), - "FileMetadata { is_file: true, is_dir: true, is_symlink: true }" - ); - let _ = meta; -} diff --git a/src/lib.rs b/src/lib.rs deleted file mode 100644 index 8ec2ad8a..00000000 --- a/src/lib.rs +++ /dev/null @@ -1,1670 +0,0 @@ -//! # Oxc Resolver -//! -//! Node.js [CommonJS][cjs] and [ECMAScript][esm] Module Resolution. -//! -//! A module resolution is the process of finding the file referenced by a module specifier in -//! `import "specifier"` or `require("specifier")`. -//! -//! All [configuration options](ResolveOptions) are aligned with webpack's [enhanced-resolve]. -//! -//! ## Terminology -//! -//! ### Specifier -//! -//! For [CommonJS modules][cjs], -//! the specifier is the string passed to the `require` function. e.g. `"id"` in `require("id")`. -//! -//! For [ECMAScript modules][esm], -//! the specifier of an `import` statement is the string after the `from` keyword, -//! e.g. `'specifier'` in `import 'specifier'` or `import { sep } from 'specifier'`. -//! Specifiers are also used in export from statements, and as the argument to an `import()` expression. -//! -//! This is also named "request" in some places. -//! -//! ## References: -//! -//! * Algorithm adapted from Node.js [CommonJS Module Resolution Algorithm] and [ECMAScript Module Resolution Algorithm]. -//! * Tests are ported from [enhanced-resolve]. -//! * Some code is adapted from [parcel-resolver]. -//! * The documentation is copied from [webpack's resolve configuration](https://webpack.js.org/configuration/resolve). -//! -//! [enhanced-resolve]: https://github.com/webpack/enhanced-resolve -//! [CommonJS Module Resolution Algorithm]: https://nodejs.org/api/modules.html#all-together -//! [ECMAScript Module Resolution Algorithm]: https://nodejs.org/api/esm.html#resolution-algorithm-specification -//! [parcel-resolver]: https://github.com/parcel-bundler/parcel/blob/v2/packages/utils/node-resolver-rs -//! [cjs]: https://nodejs.org/api/modules.html -//! [esm]: https://nodejs.org/api/esm.html -//! -//! ## Feature flags -#![cfg_attr(feature = "document-features", doc = document_features::document_features!())] -#![cfg_attr(docsrs, feature(doc_auto_cfg))] -//! -//! ## Example -//! -//! ```rust,ignore -#![doc = include_str!("../examples/resolver.rs")] -//! ``` - -mod builtins; -mod cache; -mod context; -mod error; -mod file_system; -mod options; -mod package_json; -mod path; -mod resolution; -mod specifier; -mod tsconfig; - -#[cfg(test)] -mod tests; - -use std::{ - borrow::Cow, - cmp::Ordering, - ffi::OsStr, - fmt, - path::{Component, Path, PathBuf}, - sync::Arc, -}; - -use rustc_hash::FxHashSet; -use serde_json::Value as JSONValue; -use typescript_tsconfig_json::ExtendsField; - -pub use crate::{ - builtins::NODEJS_BUILTINS, - error::{JSONError, ResolveError, SpecifierError}, - file_system::{FileMetadata, FileSystem}, - options::{ - Alias, AliasValue, EnforceExtension, ResolveOptions, Restriction, TsconfigOptions, - TsconfigReferences, - }, - package_json::PackageJson, - resolution::Resolution, -}; -use crate::{ - cache::{Cache, CachedPath}, - context::ResolveContext as Ctx, - file_system::FileSystemOs, - package_json::JSONMap, - path::{PathUtil, SLASH_START}, - specifier::Specifier, - tsconfig::{ProjectReference, TsConfig}, -}; - -type ResolveResult = Result, ResolveError>; - -/// Context returned from the [Resolver::resolve_with_context] API -#[derive(Debug, Default, Clone)] -pub struct ResolveContext { - /// Files that was found on file system - pub file_dependencies: FxHashSet, - - /// Dependencies that was not found on file system - pub missing_dependencies: FxHashSet, -} - -/// Resolver with the current operating system as the file system -pub type Resolver = ResolverGeneric; - -/// Generic implementation of the resolver, can be configured by the [FileSystem] trait -pub struct ResolverGeneric { - options: ResolveOptions, - cache: Arc>, -} - -impl fmt::Debug for ResolverGeneric { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - self.options.fmt(f) - } -} - -impl Default for ResolverGeneric { - fn default() -> Self { - Self::new(ResolveOptions::default()) - } -} - -impl ResolverGeneric { - pub fn new(options: ResolveOptions) -> Self { - Self { options: options.sanitize(), cache: Arc::new(Cache::new(Fs::default())) } - } -} - -impl ResolverGeneric { - pub fn new_with_file_system(file_system: Fs, options: ResolveOptions) -> Self { - Self { cache: Arc::new(Cache::new(file_system)), options: options.sanitize() } - } - - /// Clone the resolver using the same underlying cache. - #[must_use] - pub fn clone_with_options(&self, options: ResolveOptions) -> Self { - Self { options: options.sanitize(), cache: Arc::clone(&self.cache) } - } - - /// Returns the options. - pub fn options(&self) -> &ResolveOptions { - &self.options - } - - /// Clear the underlying cache. - pub fn clear_cache(&self) { - self.cache.clear(); - } - - /// Resolve `specifier` at an absolute `path`. - /// - /// A specifier is the string passed to require or import, i.e. `require("specifier")` or `import "specifier"`. - /// - /// `path` must be an **absolute** path to a directory where the specifier is resolved against. - /// For CommonJS modules, it is the `__dirname` variable that contains the absolute path to the folder containing current module. - /// For ECMAScript modules, it is the value of `import.meta.url`. - /// - /// # Errors - /// - /// * See [ResolveError] - pub fn resolve>( - &self, - path: P, - specifier: &str, - ) -> Result { - let mut ctx = Ctx::default(); - self.resolve_tracing(path.as_ref(), specifier, &mut ctx) - } - - /// Resolve `specifier` at absolute `path` with [ResolveContext] - /// - /// # Errors - /// - /// * See [ResolveError] - pub fn resolve_with_context>( - &self, - path: P, - specifier: &str, - resolve_context: &mut ResolveContext, - ) -> Result { - let mut ctx = Ctx::default(); - ctx.init_file_dependencies(); - let result = self.resolve_tracing(path.as_ref(), specifier, &mut ctx); - if let Some(deps) = &mut ctx.file_dependencies { - resolve_context.file_dependencies.extend(deps.drain(..)); - } - if let Some(deps) = &mut ctx.missing_dependencies { - resolve_context.missing_dependencies.extend(deps.drain(..)); - } - result - } - - /// Wrap `resolve_impl` with `tracing` information - fn resolve_tracing( - &self, - path: &Path, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - let span = tracing::debug_span!("resolve", path = ?path, specifier = specifier); - let _enter = span.enter(); - let r = self.resolve_impl(path, specifier, ctx); - match &r { - Ok(r) => { - tracing::debug!(options = ?self.options, path = ?path, specifier = specifier, ret = ?r.path); - } - Err(err) => { - tracing::debug!(options = ?self.options, path = ?path, specifier = specifier, err = ?err); - } - }; - r - } - - fn resolve_impl( - &self, - path: &Path, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - ctx.with_fully_specified(self.options.fully_specified); - let cached_path = self.cache.value(path); - let cached_path = self.require(&cached_path, specifier, ctx)?; - let path = self.load_realpath(&cached_path)?; - // enhanced-resolve: restrictions - self.check_restrictions(&path)?; - let package_json = cached_path.find_package_json(&self.cache.fs, &self.options, ctx)?; - if let Some(package_json) = &package_json { - // path must be inside the package. - debug_assert!(path.starts_with(package_json.directory())); - } - Ok(Resolution { - path, - query: ctx.query.take(), - fragment: ctx.fragment.take(), - package_json, - }) - } - - /// require(X) from module at path Y - /// - /// X: specifier - /// Y: path - /// - /// - fn require( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - ctx.test_for_infinite_recursion()?; - - // enhanced-resolve: parse - let (parsed, try_fragment_as_path) = self.load_parse(cached_path, specifier, ctx)?; - if let Some(path) = try_fragment_as_path { - return Ok(path); - } - - self.require_without_parse(cached_path, parsed.path(), ctx) - } - - fn require_without_parse( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - // tsconfig-paths - if let Some(path) = self.load_tsconfig_paths(cached_path, specifier, &mut Ctx::default())? { - return Ok(path); - } - - // enhanced-resolve: try alias - if let Some(path) = self.load_alias(cached_path, specifier, &self.options.alias, ctx)? { - return Ok(path); - } - - let result = match Path::new(specifier).components().next() { - // 2. If X begins with '/' - Some(Component::RootDir | Component::Prefix(_)) => { - self.require_absolute(cached_path, specifier, ctx) - } - // 3. If X begins with './' or '/' or '../' - Some(Component::CurDir | Component::ParentDir) => { - self.require_relative(cached_path, specifier, ctx) - } - // 4. If X begins with '#' - Some(Component::Normal(_)) if specifier.as_bytes()[0] == b'#' => { - self.require_hash(cached_path, specifier, ctx) - } - _ => { - // 1. If X is a core module, - // a. return the core module - // b. STOP - self.require_core(specifier)?; - - // (ESM) 5. Otherwise, - // Note: specifier is now a bare specifier. - // Set resolved the result of PACKAGE_RESOLVE(specifier, parentURL). - self.require_bare(cached_path, specifier, ctx) - } - }; - - result.or_else(|err| { - if err.is_ignore() { - return Err(err); - } - // enhanced-resolve: try fallback - self.load_alias(cached_path, specifier, &self.options.fallback, ctx) - .and_then(|value| value.ok_or(err)) - }) - } - - // PACKAGE_RESOLVE(packageSpecifier, parentURL) - // 3. If packageSpecifier is a Node.js builtin module name, then - // 1. Return the string "node:" concatenated with packageSpecifier. - fn require_core(&self, specifier: &str) -> Result<(), ResolveError> { - if self.options.builtin_modules { - let starts_with_node = specifier.starts_with("node:"); - if starts_with_node || NODEJS_BUILTINS.binary_search(&specifier).is_ok() { - let mut specifier = specifier.to_string(); - if !starts_with_node { - specifier = format!("node:{specifier}"); - } - return Err(ResolveError::Builtin(specifier)); - } - } - Ok(()) - } - - fn require_absolute( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - // Make sure only path prefixes gets called - debug_assert!(Path::new(specifier) - .components() - .next() - .is_some_and(|c| matches!(c, Component::RootDir | Component::Prefix(_)))); - if !self.options.prefer_relative && self.options.prefer_absolute { - if let Ok(path) = self.load_package_self_or_node_modules(cached_path, specifier, ctx) { - return Ok(path); - } - } - if let Some(path) = self.load_roots(specifier, ctx) { - return Ok(path); - } - // 2. If X begins with '/' - // a. set Y to be the file system root - let path = self.cache.value(Path::new(specifier)); - if let Some(path) = self.load_as_file_or_directory(&path, specifier, ctx)? { - return Ok(path); - } - Err(ResolveError::NotFound(specifier.to_string())) - } - - // 3. If X begins with './' or '/' or '../' - fn require_relative( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - // Make sure only relative or normal paths gets called - debug_assert!(Path::new(specifier).components().next().is_some_and(|c| matches!( - c, - Component::CurDir | Component::ParentDir | Component::Normal(_) - ))); - let path = cached_path.path().normalize_with(specifier); - let cached_path = self.cache.value(&path); - // a. LOAD_AS_FILE(Y + X) - // b. LOAD_AS_DIRECTORY(Y + X) - if let Some(path) = self.load_as_file_or_directory(&cached_path, specifier, ctx)? { - return Ok(path); - } - // c. THROW "not found" - Err(ResolveError::NotFound(specifier.to_string())) - } - - fn require_hash( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - debug_assert_eq!(specifier.chars().next(), Some('#')); - // a. LOAD_PACKAGE_IMPORTS(X, dirname(Y)) - if let Some(path) = self.load_package_imports(cached_path, specifier, ctx)? { - return Ok(path); - } - self.load_package_self_or_node_modules(cached_path, specifier, ctx) - } - - fn require_bare( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - // Make sure no other path prefixes gets called - debug_assert!(Path::new(specifier) - .components() - .next() - .is_some_and(|c| matches!(c, Component::Normal(_)))); - if self.options.prefer_relative { - if let Ok(path) = self.require_relative(cached_path, specifier, ctx) { - return Ok(path); - } - } - self.load_package_self_or_node_modules(cached_path, specifier, ctx) - } - - /// enhanced-resolve: ParsePlugin. - /// - /// 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`. - /// - /// - fn load_parse<'s>( - &self, - cached_path: &CachedPath, - specifier: &'s str, - ctx: &mut Ctx, - ) -> Result<(Specifier<'s>, Option), ResolveError> { - let parsed = Specifier::parse(specifier).map_err(ResolveError::Specifier)?; - ctx.with_query_fragment(parsed.query, parsed.fragment); - - // There is an edge-case where a request with # can be a path or a fragment -> try both - if ctx.fragment.is_some() && ctx.query.is_none() { - let specifier = parsed.path(); - let fragment = ctx.fragment.take().unwrap(); - let path = format!("{specifier}{fragment}"); - if let Ok(path) = self.require_without_parse(cached_path, &path, ctx) { - return Ok((parsed, Some(path))); - } - ctx.fragment.replace(fragment); - } - Ok((parsed, None)) - } - - fn load_package_self_or_node_modules( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - let (_, subpath) = Self::parse_package_specifier(specifier); - if subpath.is_empty() { - ctx.with_fully_specified(false); - } - // 5. LOAD_PACKAGE_SELF(X, dirname(Y)) - if let Some(path) = self.load_package_self(cached_path, specifier, ctx)? { - return Ok(path); - } - // 6. LOAD_NODE_MODULES(X, dirname(Y)) - if let Some(path) = self.load_node_modules(cached_path, specifier, ctx)? { - return Ok(path); - } - // 7. THROW "not found" - Err(ResolveError::NotFound(specifier.to_string())) - } - - /// LOAD_PACKAGE_IMPORTS(X, DIR) - fn load_package_imports( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - // 1. Find the closest package scope SCOPE to DIR. - // 2. If no scope was found, return. - let Some(package_json) = - cached_path.find_package_json(&self.cache.fs, &self.options, ctx)? - else { - return Ok(None); - }; - // 3. If the SCOPE/package.json "imports" is null or undefined, return. - // 4. let MATCH = PACKAGE_IMPORTS_RESOLVE(X, pathToFileURL(SCOPE), ["node", "require"]) defined in the ESM resolver. - if let Some(path) = self.package_imports_resolve(specifier, &package_json, ctx)? { - // 5. RESOLVE_ESM_MATCH(MATCH). - return self.resolve_esm_match(specifier, &path, ctx); - } - Ok(None) - } - - fn load_as_file(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - // enhanced-resolve feature: extension_alias - if let Some(path) = self.load_extension_alias(cached_path, ctx)? { - return Ok(Some(path)); - } - if self.options.enforce_extension.is_disabled() { - // 1. If X is a file, load X as its file extension format. STOP - if let Some(path) = self.load_alias_or_file(cached_path, ctx)? { - return Ok(Some(path)); - } - } - // 2. If X.js is a file, load X.js as JavaScript text. STOP - // 3. If X.json is a file, parse X.json to a JavaScript Object. STOP - // 4. If X.node is a file, load X.node as binary addon. STOP - if let Some(path) = - self.load_extensions(cached_path.path(), &self.options.extensions, ctx)? - { - return Ok(Some(path)); - } - Ok(None) - } - - fn load_as_directory(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - // TODO: Only package.json is supported, so warn about having other values - // Checking for empty files is needed for omitting checks on package.json - // 1. If X/package.json is a file, - if !self.options.description_files.is_empty() { - // a. Parse X/package.json, and look for "main" field. - if let Some(package_json) = - cached_path.package_json(&self.cache.fs, &self.options, ctx)? - { - // b. If "main" is a falsy value, GOTO 2. - for main_field in package_json.main_fields(&self.options.main_fields) { - // c. let M = X + (json main field) - let main_field_path = cached_path.path().normalize_with(main_field); - // d. LOAD_AS_FILE(M) - let cached_path = self.cache.value(&main_field_path); - if let Some(path) = self.load_as_file(&cached_path, ctx)? { - return Ok(Some(path)); - } - // e. LOAD_INDEX(M) - if let Some(path) = self.load_index(&cached_path, ctx)? { - return Ok(Some(path)); - } - } - // f. LOAD_INDEX(X) DEPRECATED - // g. THROW "not found" - } - } - // 2. LOAD_INDEX(X) - self.load_index(cached_path, ctx) - } - - fn load_as_file_or_directory( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - if self.options.resolve_to_context { - return Ok(cached_path.is_dir(&self.cache.fs, ctx).then(|| cached_path.clone())); - } - if !specifier.ends_with('/') { - if let Some(path) = self.load_as_file(cached_path, ctx)? { - return Ok(Some(path)); - } - } - if cached_path.is_dir(&self.cache.fs, ctx) { - if let Some(path) = self.load_as_directory(cached_path, ctx)? { - return Ok(Some(path)); - } - } - Ok(None) - } - - fn load_extensions(&self, path: &Path, extensions: &[String], ctx: &mut Ctx) -> ResolveResult { - if ctx.fully_specified { - return Ok(None); - } - let path = path.as_os_str(); - for extension in extensions { - let mut path_with_extension = path.to_os_string(); - path_with_extension.reserve_exact(extension.len()); - path_with_extension.push(extension); - let cached_path = self.cache.value(Path::new(&path_with_extension)); - if let Some(path) = self.load_alias_or_file(&cached_path, ctx)? { - return Ok(Some(path)); - } - } - Ok(None) - } - - fn load_realpath(&self, cached_path: &CachedPath) -> Result { - if self.options.symlinks { - cached_path.realpath(&self.cache.fs).map_err(ResolveError::from) - } else { - Ok(cached_path.to_path_buf()) - } - } - - fn check_restrictions(&self, path: &Path) -> Result<(), ResolveError> { - // https://github.com/webpack/enhanced-resolve/blob/a998c7d218b7a9ec2461fc4fddd1ad5dd7687485/lib/RestrictionsPlugin.js#L19-L24 - fn is_inside(path: &Path, parent: &Path) -> bool { - if !path.starts_with(parent) { - return false; - } - if path.as_os_str().len() == parent.as_os_str().len() { - return true; - } - path.strip_prefix(parent).is_ok_and(|p| p == Path::new("./")) - } - for restriction in &self.options.restrictions { - match restriction { - Restriction::Path(restricted_path) => { - if !is_inside(path, restricted_path) { - return Err(ResolveError::Restriction( - path.to_path_buf(), - restricted_path.clone(), - )); - } - } - Restriction::RegExp(_) => { - return Err(ResolveError::Unimplemented("Restriction with regex")) - } - } - } - Ok(()) - } - - fn load_index(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - for main_file in &self.options.main_files { - let main_path = cached_path.path().normalize_with(main_file); - let cached_path = self.cache.value(&main_path); - if self.options.enforce_extension.is_disabled() { - if let Some(path) = self.load_alias_or_file(&cached_path, ctx)? { - return Ok(Some(path)); - } - } - // 1. If X/index.js is a file, load X/index.js as JavaScript text. STOP - // 2. If X/index.json is a file, parse X/index.json to a JavaScript object. STOP - // 3. If X/index.node is a file, load X/index.node as binary addon. STOP - if let Some(path) = - self.load_extensions(cached_path.path(), &self.options.extensions, ctx)? - { - return Ok(Some(path)); - } - } - Ok(None) - } - - fn load_alias_or_file(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - if let Some(package_json) = - cached_path.find_package_json(&self.cache.fs, &self.options, ctx)? - { - if let Some(path) = self.load_browser_field(cached_path, None, &package_json, ctx)? { - return Ok(Some(path)); - } - } - // enhanced-resolve: try file as alias - let alias_specifier = cached_path.path().to_string_lossy(); - if let Some(path) = - self.load_alias(cached_path, &alias_specifier, &self.options.alias, ctx)? - { - return Ok(Some(path)); - } - if cached_path.is_file(&self.cache.fs, ctx) { - return Ok(Some(cached_path.clone())); - } - Ok(None) - } - - fn load_node_modules( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - let (package_name, subpath) = Self::parse_package_specifier(specifier); - // 1. let DIRS = NODE_MODULES_PATHS(START) - // 2. for each DIR in DIRS: - for module_name in &self.options.modules { - for cached_path in std::iter::successors(Some(cached_path), |p| p.parent()) { - // Skip if /path/to/node_modules does not exist - if !cached_path.is_dir(&self.cache.fs, ctx) { - continue; - } - - let Some(cached_path) = self.get_module_directory(cached_path, module_name, ctx) - else { - continue; - }; - // Optimize node_modules lookup by inspecting whether the package exists - // From LOAD_PACKAGE_EXPORTS(X, DIR) - // 1. Try to interpret X as a combination of NAME and SUBPATH where the name - // may have a @scope/ prefix and the subpath begins with a slash (`/`). - if !package_name.is_empty() { - let package_path = cached_path.path().normalize_with(package_name); - let cached_path = self.cache.value(&package_path); - // Try foo/node_modules/package_name - if cached_path.is_dir(&self.cache.fs, ctx) { - // a. LOAD_PACKAGE_EXPORTS(X, DIR) - if let Some(path) = - self.load_package_exports(specifier, subpath, &cached_path, ctx)? - { - return Ok(Some(path)); - } - } else { - // foo/node_modules/package_name is not a directory, so useless to check inside it - if !subpath.is_empty() { - continue; - } - // Skip if the directory lead to the scope package does not exist - // i.e. `foo/node_modules/@scope` is not a directory for `foo/node_modules/@scope/package` - if package_name.starts_with('@') { - if let Some(path) = cached_path.parent() { - if !path.is_dir(&self.cache.fs, ctx) { - continue; - } - } - } - } - } - - // Try as file or directory for all other cases - // b. LOAD_AS_FILE(DIR/X) - // c. LOAD_AS_DIRECTORY(DIR/X) - let node_module_file = cached_path.path().normalize_with(specifier); - let cached_path = self.cache.value(&node_module_file); - if let Some(path) = self.load_as_file_or_directory(&cached_path, specifier, ctx)? { - return Ok(Some(path)); - } - } - } - Ok(None) - } - - fn get_module_directory( - &self, - cached_path: &CachedPath, - module_name: &str, - ctx: &mut Ctx, - ) -> Option { - if cached_path.path().ends_with(module_name) { - Some(cached_path.clone()) - } else if module_name == "node_modules" { - cached_path.cached_node_modules(&self.cache, ctx) - } else { - cached_path.module_directory(module_name, &self.cache, ctx) - } - } - - fn load_package_exports( - &self, - specifier: &str, - subpath: &str, - cached_path: &CachedPath, - ctx: &mut Ctx, - ) -> ResolveResult { - // 2. If X does not match this pattern or DIR/NAME/package.json is not a file, - // return. - let Some(package_json) = cached_path.package_json(&self.cache.fs, &self.options, ctx)? - else { - return Ok(None); - }; - // 3. Parse DIR/NAME/package.json, and look for "exports" field. - // 4. If "exports" is null or undefined, return. - // 5. let MATCH = PACKAGE_EXPORTS_RESOLVE(pathToFileURL(DIR/NAME), "." + SUBPATH, - // `package.json` "exports", ["node", "require"]) defined in the ESM resolver. - // Note: The subpath is not prepended with a dot on purpose - for exports in package_json.exports_fields(&self.options.exports_fields) { - if let Some(path) = self.package_exports_resolve( - cached_path.path(), - &format!(".{subpath}"), - exports, - ctx, - )? { - // 6. RESOLVE_ESM_MATCH(MATCH) - return self.resolve_esm_match(specifier, &path, ctx); - }; - } - Ok(None) - } - - fn load_package_self( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - // 1. Find the closest package scope SCOPE to DIR. - // 2. If no scope was found, return. - let Some(package_json) = - cached_path.find_package_json(&self.cache.fs, &self.options, ctx)? - else { - return Ok(None); - }; - // 3. If the SCOPE/package.json "exports" is null or undefined, return. - // 4. If the SCOPE/package.json "name" is not the first segment of X, return. - if let Some(subpath) = package_json - .name - .as_ref() - .and_then(|package_name| Self::strip_package_name(specifier, package_name)) - { - // 5. let MATCH = PACKAGE_EXPORTS_RESOLVE(pathToFileURL(SCOPE), - // "." + X.slice("name".length), `package.json` "exports", ["node", "require"]) - // defined in the ESM resolver. - let package_url = package_json.directory(); - // Note: The subpath is not prepended with a dot on purpose - // because `package_exports_resolve` matches subpath without the leading dot. - for exports in package_json.exports_fields(&self.options.exports_fields) { - if let Some(cached_path) = - self.package_exports_resolve(package_url, &format!(".{subpath}"), exports, ctx)? - { - // 6. RESOLVE_ESM_MATCH(MATCH) - return self.resolve_esm_match(specifier, &cached_path, ctx); - } - } - } - self.load_browser_field(cached_path, Some(specifier), &package_json, ctx) - } - - /// RESOLVE_ESM_MATCH(MATCH) - fn resolve_esm_match( - &self, - specifier: &str, - cached_path: &CachedPath, - ctx: &mut Ctx, - ) -> ResolveResult { - // 1. let RESOLVED_PATH = fileURLToPath(MATCH) - // 2. If the file at RESOLVED_PATH exists, load RESOLVED_PATH as its extension format. STOP - // - // Non-compliant ESM can result in a directory, so directory is tried as well. - if let Some(path) = self.load_as_file_or_directory(cached_path, "", ctx)? { - return Ok(Some(path)); - } - // 3. THROW "not found" - Err(ResolveError::NotFound(specifier.to_string())) - } - - /// enhanced-resolve: AliasFieldPlugin for [ResolveOptions::alias_fields] - fn load_browser_field( - &self, - cached_path: &CachedPath, - module_specifier: Option<&str>, - package_json: &PackageJson, - ctx: &mut Ctx, - ) -> ResolveResult { - let path = cached_path.path(); - let Some(new_specifier) = package_json.resolve_browser_field( - path, - module_specifier, - &self.options.alias_fields, - )? - else { - return Ok(None); - }; - // Abort when resolving recursive module - if module_specifier.is_some_and(|s| s == new_specifier) { - return Ok(None); - } - if ctx.resolving_alias.as_ref().is_some_and(|s| s == new_specifier) { - // Complete when resolving to self `{"./a.js": "./a.js"}` - if new_specifier.strip_prefix("./").filter(|s| path.ends_with(Path::new(s))).is_some() { - return if cached_path.is_file(&self.cache.fs, ctx) { - Ok(Some(cached_path.clone())) - } else { - Err(ResolveError::NotFound(new_specifier.to_string())) - }; - } - return Err(ResolveError::Recursion); - } - ctx.with_resolving_alias(new_specifier.to_string()); - ctx.with_fully_specified(false); - let cached_path = self.cache.value(package_json.directory()); - self.require(&cached_path, new_specifier, ctx).map(Some) - } - - /// enhanced-resolve: AliasPlugin for [ResolveOptions::alias] and [ResolveOptions::fallback]. - fn load_alias( - &self, - cached_path: &CachedPath, - specifier: &str, - aliases: &Alias, - ctx: &mut Ctx, - ) -> ResolveResult { - for (alias_key_raw, specifiers) in aliases { - let alias_key = if let Some(alias_key) = alias_key_raw.strip_suffix('$') { - if alias_key != specifier { - continue; - } - alias_key - } else { - let strip_package_name = Self::strip_package_name(specifier, alias_key_raw); - if strip_package_name.is_none() { - continue; - } - alias_key_raw - }; - // It should stop resolving when all of the tried alias values - // failed to resolve. - // - let mut should_stop = false; - for r in specifiers { - match r { - AliasValue::Path(alias_value) => { - if let Some(path) = self.load_alias_value( - cached_path, - alias_key, - alias_value, - specifier, - ctx, - &mut should_stop, - )? { - return Ok(Some(path)); - } - } - AliasValue::Ignore => { - let path = cached_path.path().normalize_with(alias_key); - return Err(ResolveError::Ignored(path)); - } - } - } - if should_stop { - return Err(ResolveError::NotFound(specifier.to_string())); - } - } - Ok(None) - } - - fn load_alias_value( - &self, - cached_path: &CachedPath, - alias_key: &str, - alias_value: &str, - request: &str, - ctx: &mut Ctx, - should_stop: &mut bool, - ) -> ResolveResult { - if request != alias_value - && !request.strip_prefix(alias_value).is_some_and(|prefix| prefix.starts_with('/')) - { - let tail = &request[alias_key.len()..]; - - let new_specifier = if tail.is_empty() { - Cow::Borrowed(alias_value) - } else { - let alias_value = Path::new(alias_value).normalize(); - // Must not append anything to alias_value if it is a file. - let alias_value_cached_path = self.cache.value(&alias_value); - if alias_value_cached_path.is_file(&self.cache.fs, ctx) { - return Ok(None); - } - - // Remove the leading slash so the final path is concatenated. - let tail = tail.trim_start_matches(SLASH_START); - let normalized = alias_value.normalize_with(tail); - Cow::Owned(normalized.to_string_lossy().to_string()) - }; - - *should_stop = true; - ctx.with_fully_specified(false); - return match self.require(cached_path, new_specifier.as_ref(), ctx) { - Err(ResolveError::NotFound(_)) => Ok(None), - Ok(path) => return Ok(Some(path)), - Err(err) => return Err(err), - }; - } - Ok(None) - } - - /// Given an extension alias map `{".js": [".ts", "js"]}`, - /// load the mapping instead of the provided extension - /// - /// This is an enhanced-resolve feature - /// - /// # Errors - /// - /// * [ResolveError::ExtensionAlias]: When all of the aliased extensions are not found - fn load_extension_alias(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - let Some(path_extension) = cached_path.path().extension() else { - return Ok(None); - }; - let Some((_, extensions)) = self - .options - .extension_alias - .iter() - .find(|(ext, _)| OsStr::new(ext.trim_start_matches('.')) == path_extension) - else { - return Ok(None); - }; - let path = cached_path.path().with_extension(""); - ctx.with_fully_specified(false); - if let Some(path) = self.load_extensions(&path, extensions, ctx)? { - return Ok(Some(path)); - } - Err(ResolveError::ExtensionAlias) - } - - /// enhanced-resolve: RootsPlugin - /// - /// A list of directories where requests of server-relative URLs (starting with '/') are resolved, - /// defaults to context configuration option. - /// - /// On non-Windows systems these requests are resolved as an absolute path first. - fn load_roots(&self, specifier: &str, ctx: &mut Ctx) -> Option { - if !self.options.roots.is_empty() { - if let Some(specifier) = specifier.strip_prefix(SLASH_START) { - for root in &self.options.roots { - let cached_path = self.cache.value(root); - if let Ok(path) = self.require_relative(&cached_path, specifier, ctx) { - return Some(path); - } - } - } - } - None - } - - fn load_tsconfig_paths( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - let Some(tsconfig_options) = &self.options.tsconfig else { - return Ok(None); - }; - let tsconfig = self.load_tsconfig( - /* root */ true, - &tsconfig_options.config_file, - &tsconfig_options.references, - )?; - let paths = tsconfig.resolve(cached_path.path(), specifier); - for path in paths { - let cached_path = self.cache.value(&path); - if let Ok(path) = self.require_relative(&cached_path, ".", ctx) { - return Ok(Some(path)); - } - } - Ok(None) - } - - fn load_tsconfig( - &self, - root: bool, - path: &Path, - references: &TsconfigReferences, - ) -> Result, ResolveError> { - self.cache.tsconfig(root, path, |tsconfig| { - let directory = self.cache.value(tsconfig.directory()); - tracing::trace!(tsconfig = ?tsconfig, "load_tsconfig"); - - // Extend tsconfig - if let Some(extends) = &tsconfig.extends { - let extended_tsconfig_paths = match extends { - ExtendsField::Single(s) => { - vec![self.get_extended_tsconfig_path(&directory, tsconfig, s)?] - } - ExtendsField::Multiple(specifiers) => specifiers - .iter() - .map(|s| self.get_extended_tsconfig_path(&directory, tsconfig, s)) - .collect::, ResolveError>>()?, - }; - for extended_tsconfig_path in extended_tsconfig_paths { - let extended_tsconfig = self.load_tsconfig( - /* root */ false, - &extended_tsconfig_path, - &TsconfigReferences::Disabled, - )?; - tsconfig.extend_tsconfig(&extended_tsconfig); - } - } - - // Load project references - match references { - TsconfigReferences::Disabled => { - tsconfig.references.drain(..); - } - TsconfigReferences::Auto => {} - TsconfigReferences::Paths(paths) => { - tsconfig.references = paths - .iter() - .map(|path| ProjectReference { path: path.clone(), tsconfig: None }) - .collect(); - } - } - if !tsconfig.references.is_empty() { - let directory = tsconfig.directory().to_path_buf(); - for reference in &mut tsconfig.references { - let reference_tsconfig_path = directory.normalize_with(&reference.path); - let tsconfig = self.cache.tsconfig( - /* root */ true, - &reference_tsconfig_path, - |_| Ok(()), - )?; - reference.tsconfig.replace(tsconfig); - } - } - Ok(()) - }) - } - - fn get_extended_tsconfig_path( - &self, - directory: &CachedPath, - tsconfig: &TsConfig, - specifier: &str, - ) -> Result { - match specifier.as_bytes().first() { - None => Err(ResolveError::Specifier(SpecifierError::Empty(specifier.to_string()))), - Some(b'/') => Ok(PathBuf::from(specifier)), - Some(b'.') => Ok(tsconfig.directory().normalize_with(specifier)), - _ => self - .clone_with_options(ResolveOptions { - description_files: vec![], - extensions: vec![".json".into()], - main_files: vec!["tsconfig.json".into()], - ..ResolveOptions::default() - }) - .load_package_self_or_node_modules(directory, specifier, &mut Ctx::default()) - .map(|p| p.to_path_buf()) - .map_err(|err| match err { - ResolveError::NotFound(_) => { - ResolveError::TsconfigNotFound(PathBuf::from(specifier)) - } - _ => err, - }), - } - } - - /// PACKAGE_RESOLVE(packageSpecifier, parentURL) - fn package_resolve( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - let (package_name, subpath) = Self::parse_package_specifier(specifier); - - // 3. If packageSpecifier is a Node.js builtin module name, then - // 1. Return the string "node:" concatenated with packageSpecifier. - self.require_core(package_name)?; - - // 11. While parentURL is not the file system root, - for module_name in &self.options.modules { - for cached_path in std::iter::successors(Some(cached_path), |p| p.parent()) { - // 1. Let packageURL be the URL resolution of "node_modules/" concatenated with packageSpecifier, relative to parentURL. - let Some(cached_path) = self.get_module_directory(cached_path, module_name, ctx) - else { - continue; - }; - // 2. Set parentURL to the parent folder URL of parentURL. - let package_path = cached_path.path().normalize_with(package_name); - let cached_path = self.cache.value(&package_path); - // 3. If the folder at packageURL does not exist, then - // 1. Continue the next loop iteration. - if cached_path.is_dir(&self.cache.fs, ctx) { - // 4. Let pjson be the result of READ_PACKAGE_JSON(packageURL). - if let Some(package_json) = - cached_path.package_json(&self.cache.fs, &self.options, ctx)? - { - // 5. If pjson is not null and pjson.exports is not null or undefined, then - // 1. Return the result of PACKAGE_EXPORTS_RESOLVE(packageURL, packageSubpath, pjson.exports, defaultConditions). - for exports in package_json.exports_fields(&self.options.exports_fields) { - if let Some(path) = self.package_exports_resolve( - cached_path.path(), - &format!(".{subpath}"), - exports, - ctx, - )? { - return Ok(Some(path)); - } - } - // 6. Otherwise, if packageSubpath is equal to ".", then - if subpath == "." { - // 1. If pjson.main is a string, then - for main_field in package_json.main_fields(&self.options.main_fields) { - // 1. Return the URL resolution of main in packageURL. - let path = cached_path.path().normalize_with(main_field); - let cached_path = self.cache.value(&path); - if cached_path.is_file(&self.cache.fs, ctx) { - return Ok(Some(cached_path)); - } - } - } - } - let subpath = format!(".{subpath}"); - ctx.with_fully_specified(false); - return self.require(&cached_path, &subpath, ctx).map(Some); - } - } - } - - Err(ResolveError::NotFound(specifier.to_string())) - } - - /// PACKAGE_EXPORTS_RESOLVE(packageURL, subpath, exports, conditions) - fn package_exports_resolve( - &self, - package_url: &Path, - subpath: &str, - exports: &JSONValue, - ctx: &mut Ctx, - ) -> ResolveResult { - let conditions = &self.options.condition_names; - // 1. If exports is an Object with both a key starting with "." and a key not starting with ".", throw an Invalid Package Configuration error. - if let JSONValue::Object(map) = exports { - let mut has_dot = false; - let mut without_dot = false; - for key in map.keys() { - has_dot = has_dot || key.starts_with(|s| s == '.' || s == '#'); - without_dot = without_dot || !key.starts_with(|s| s == '.' || s == '#'); - if has_dot && without_dot { - return Err(ResolveError::InvalidPackageConfig( - package_url.join("package.json"), - )); - } - } - } - // 2. If subpath is equal to ".", then - // Note: subpath is not prepended with a dot when passed in. - if subpath == "." { - // enhanced-resolve appends query and fragment when resolving exports field - // https://github.com/webpack/enhanced-resolve/blob/a998c7d218b7a9ec2461fc4fddd1ad5dd7687485/lib/ExportsFieldPlugin.js#L57-L62 - // This is only need when querying the main export, otherwise ctx is passed through. - if ctx.query.is_some() || ctx.fragment.is_some() { - let query = ctx.query.clone().unwrap_or_default(); - let fragment = ctx.fragment.clone().unwrap_or_default(); - return Err(ResolveError::PackagePathNotExported( - format!("./{}{query}{fragment}", subpath.trim_start_matches('.')), - package_url.join("package.json"), - )); - } - // 1. Let mainExport be undefined. - let main_export = match exports { - // 2. If exports is a String or Array, or an Object containing no keys starting with ".", then - JSONValue::String(_) | JSONValue::Array(_) => { - // 1. Set mainExport to exports. - Some(exports) - } - // 3. Otherwise if exports is an Object containing a "." property, then - JSONValue::Object(map) => { - // 1. Set mainExport to exports["."]. - map.get(".").map_or_else( - || { - if map.keys().any(|key| key.starts_with("./") || key.starts_with('#')) { - None - } else { - Some(exports) - } - }, - Some, - ) - } - _ => None, - }; - // 4. If mainExport is not undefined, then - if let Some(main_export) = main_export { - // 1. Let resolved be the result of PACKAGE_TARGET_RESOLVE( packageURL, mainExport, null, false, conditions). - let resolved = self.package_target_resolve( - package_url, - ".", - main_export, - None, - /* is_imports */ false, - conditions, - ctx, - )?; - // 2. If resolved is not null or undefined, return resolved. - if let Some(path) = resolved { - return Ok(Some(path)); - } - } - } - // 3. Otherwise, if exports is an Object and all keys of exports start with ".", then - if let JSONValue::Object(exports) = exports { - // 1. Let matchKey be the string "./" concatenated with subpath. - // Note: `package_imports_exports_resolve` does not require the leading dot. - let match_key = &subpath; - // 2. Let resolved be the result of PACKAGE_IMPORTS_EXPORTS_RESOLVE( matchKey, exports, packageURL, false, conditions). - if let Some(path) = self.package_imports_exports_resolve( - match_key, - exports, - package_url, - /* is_imports */ false, - conditions, - ctx, - )? { - // 3. If resolved is not null or undefined, return resolved. - return Ok(Some(path)); - } - } - // 4. Throw a Package Path Not Exported error. - Err(ResolveError::PackagePathNotExported( - subpath.to_string(), - package_url.join("package.json"), - )) - } - - /// PACKAGE_IMPORTS_RESOLVE(specifier, parentURL, conditions) - fn package_imports_resolve( - &self, - specifier: &str, - package_json: &PackageJson, - ctx: &mut Ctx, - ) -> Result, ResolveError> { - // 1. Assert: specifier begins with "#". - debug_assert!(specifier.starts_with('#'), "{specifier}"); - // 2. If specifier is exactly equal to "#" or starts with "#/", then - // 1. Throw an Invalid Module Specifier error. - // 3. Let packageURL be the result of LOOKUP_PACKAGE_SCOPE(parentURL). - // 4. If packageURL is not null, then - - // 1. Let pjson be the result of READ_PACKAGE_JSON(packageURL). - // 2. If pjson.imports is a non-null Object, then - - // 1. Let resolved be the result of PACKAGE_IMPORTS_EXPORTS_RESOLVE( specifier, pjson.imports, packageURL, true, conditions). - let mut has_imports = false; - for imports in package_json.imports_fields(&self.options.imports_fields) { - if !has_imports { - has_imports = true; - // TODO: fill in test case for this case - if specifier == "#" || specifier.starts_with("#/") { - return Err(ResolveError::InvalidModuleSpecifier( - specifier.to_string(), - package_json.path.clone(), - )); - } - } - if let Some(path) = self.package_imports_exports_resolve( - specifier, - imports, - package_json.directory(), - /* is_imports */ true, - &self.options.condition_names, - ctx, - )? { - // 2. If resolved is not null or undefined, return resolved. - return Ok(Some(path)); - } - } - - // 5. Throw a Package Import Not Defined error. - if has_imports { - Err(ResolveError::PackageImportNotDefined( - specifier.to_string(), - package_json.path.clone(), - )) - } else { - Ok(None) - } - } - - /// PACKAGE_IMPORTS_EXPORTS_RESOLVE(matchKey, matchObj, packageURL, isImports, conditions) - fn package_imports_exports_resolve( - &self, - match_key: &str, - match_obj: &JSONMap, - package_url: &Path, - is_imports: bool, - conditions: &[String], - ctx: &mut Ctx, - ) -> ResolveResult { - // enhanced-resolve behaves differently, it throws - // Error: CachedPath to directories is not possible with the exports field (specifier was ./dist/) - if match_key.ends_with('/') { - return Ok(None); - } - // 1. If matchKey is a key of matchObj and does not contain "*", then - if !match_key.contains('*') { - // 1. Let target be the value of matchObj[matchKey]. - if let Some(target) = match_obj.get(match_key) { - // 2. Return the result of PACKAGE_TARGET_RESOLVE(packageURL, target, null, isImports, conditions). - return self.package_target_resolve( - package_url, - match_key, - target, - None, - is_imports, - conditions, - ctx, - ); - } - } - - let mut best_target = None; - let mut best_match = ""; - let mut best_key = ""; - // 2. Let expansionKeys be the list of keys of matchObj containing only a single "*", sorted by the sorting function PATTERN_KEY_COMPARE which orders in descending order of specificity. - // 3. For each key expansionKey in expansionKeys, do - for (expansion_key, target) in match_obj { - if expansion_key.starts_with("./") || expansion_key.starts_with('#') { - // 1. Let patternBase be the substring of expansionKey up to but excluding the first "*" character. - if let Some((pattern_base, pattern_trailer)) = expansion_key.split_once('*') { - // 2. If matchKey starts with but is not equal to patternBase, then - if match_key.starts_with(pattern_base) - // 1. Let patternTrailer be the substring of expansionKey from the index after the first "*" character. - && !pattern_trailer.contains('*') - // 2. If patternTrailer has zero length, or if matchKey ends with patternTrailer and the length of matchKey is greater than or equal to the length of expansionKey, then - && (pattern_trailer.is_empty() - || (match_key.len() >= expansion_key.len() - && match_key.ends_with(pattern_trailer))) - && Self::pattern_key_compare(best_key, expansion_key).is_gt() - { - // 1. Let target be the value of matchObj[expansionKey]. - best_target = Some(target); - // 2. Let patternMatch be the substring of matchKey starting at the index of the length of patternBase up to the length of matchKey minus the length of patternTrailer. - best_match = - &match_key[pattern_base.len()..match_key.len() - pattern_trailer.len()]; - best_key = expansion_key; - } - } else if expansion_key.ends_with('/') - && match_key.starts_with(expansion_key) - && Self::pattern_key_compare(best_key, expansion_key).is_gt() - { - // TODO: [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./dist/" in the "exports" field module resolution of the package at xxx/package.json. - best_target = Some(target); - best_match = &match_key[expansion_key.len()..]; - best_key = expansion_key; - } - } - } - if let Some(best_target) = best_target { - // 3. Return the result of PACKAGE_TARGET_RESOLVE(packageURL, target, patternMatch, isImports, conditions). - return self.package_target_resolve( - package_url, - best_key, - best_target, - Some(best_match), - is_imports, - conditions, - ctx, - ); - } - // 4. Return null. - Ok(None) - } - - /// PACKAGE_TARGET_RESOLVE(packageURL, target, patternMatch, isImports, conditions) - #[allow(clippy::too_many_arguments)] - fn package_target_resolve( - &self, - package_url: &Path, - target_key: &str, - target: &JSONValue, - pattern_match: Option<&str>, - is_imports: bool, - conditions: &[String], - ctx: &mut Ctx, - ) -> ResolveResult { - fn normalize_string_target<'a>( - target_key: &'a str, - target: &'a str, - pattern_match: Option<&'a str>, - package_url: &Path, - ) -> Result, ResolveError> { - let target = if let Some(pattern_match) = pattern_match { - if !target_key.contains('*') && !target.contains('*') { - // enhanced-resolve behaviour - // TODO: [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./dist/" in the "exports" field module resolution of the package at xxx/package.json. - if target_key.ends_with('/') && target.ends_with('/') { - Cow::Owned(format!("{target}{pattern_match}")) - } else { - return Err(ResolveError::InvalidPackageConfigDirectory( - package_url.join("package.json"), - )); - } - } else { - Cow::Owned(target.replace('*', pattern_match)) - } - } else { - Cow::Borrowed(target) - }; - Ok(target) - } - - match target { - // 1. If target is a String, then - JSONValue::String(target) => { - // 1. If target does not start with "./", then - if !target.starts_with("./") { - // 1. If isImports is false, or if target starts with "../" or "/", or if target is a valid URL, then - if !is_imports || target.starts_with("../") || target.starts_with('/') { - // 1. Throw an Invalid Package Target error. - return Err(ResolveError::InvalidPackageTarget( - target.to_string(), - target_key.to_string(), - package_url.join("package.json"), - )); - } - // 2. If patternMatch is a String, then - // 1. Return PACKAGE_RESOLVE(target with every instance of "*" replaced by patternMatch, packageURL + "/"). - let target = - normalize_string_target(target_key, target, pattern_match, package_url)?; - let package_url = self.cache.value(package_url); - // // 3. Return PACKAGE_RESOLVE(target, packageURL + "/"). - return self.package_resolve(&package_url, &target, ctx); - } - - // 2. If target split on "/" or "\" contains any "", ".", "..", or "node_modules" segments after the first "." segment, case insensitive and including percent encoded variants, throw an Invalid Package Target error. - // 3. Let resolvedTarget be the URL resolution of the concatenation of packageURL and target. - // 4. Assert: resolvedTarget is contained in packageURL. - // 5. If patternMatch is null, then - let target = - normalize_string_target(target_key, target, pattern_match, package_url)?; - if Path::new(target.as_ref()).is_invalid_exports_target() { - return Err(ResolveError::InvalidPackageTarget( - target.to_string(), - target_key.to_string(), - package_url.join("package.json"), - )); - } - let resolved_target = package_url.normalize_with(target.as_ref()); - // 6. If patternMatch split on "/" or "\" contains any "", ".", "..", or "node_modules" segments, case insensitive and including percent encoded variants, throw an Invalid Module Specifier error. - // 7. Return the URL resolution of resolvedTarget with every instance of "*" replaced with patternMatch. - let value = self.cache.value(&resolved_target); - return Ok(Some(value)); - } - // 2. Otherwise, if target is a non-null Object, then - JSONValue::Object(target) => { - // 1. If exports contains any index property keys, as defined in ECMA-262 6.1.7 Array Index, throw an Invalid Package Configuration error. - // 2. For each property p of target, in object insertion order as, - for (key, target_value) in target { - // 1. If p equals "default" or conditions contains an entry for p, then - if key == "default" || conditions.contains(key) { - // 1. Let targetValue be the value of the p property in target. - // 2. Let resolved be the result of PACKAGE_TARGET_RESOLVE( packageURL, targetValue, patternMatch, isImports, conditions). - let resolved = self.package_target_resolve( - package_url, - target_key, - target_value, - pattern_match, - is_imports, - conditions, - ctx, - ); - // 3. If resolved is equal to undefined, continue the loop. - if let Some(path) = resolved? { - // 4. Return resolved. - return Ok(Some(path)); - } - } - } - // 3. Return undefined. - return Ok(None); - } - // 3. Otherwise, if target is an Array, then - JSONValue::Array(targets) => { - // 1. If _target.length is zero, return null. - if targets.is_empty() { - // Note: return PackagePathNotExported has the same effect as return because there are no matches. - return Err(ResolveError::PackagePathNotExported( - pattern_match.unwrap_or(".").to_string(), - package_url.join("package.json"), - )); - } - // 2. For each item targetValue in target, do - for (i, target_value) in targets.iter().enumerate() { - // 1. Let resolved be the result of PACKAGE_TARGET_RESOLVE( packageURL, targetValue, patternMatch, isImports, conditions), continuing the loop on any Invalid Package Target error. - let resolved = self.package_target_resolve( - package_url, - target_key, - target_value, - pattern_match, - is_imports, - conditions, - ctx, - ); - - if resolved.is_err() && i == targets.len() { - return resolved; - } - - // 2. If resolved is undefined, continue the loop. - if let Ok(Some(path)) = resolved { - // 3. Return resolved. - return Ok(Some(path)); - } - } - // 3. Return or throw the last fallback resolution null return or error. - // Note: see `resolved.is_err() && i == targets.len()` - } - _ => {} - } - // 4. Otherwise, if target is null, return null. - Ok(None) - // 5. Otherwise throw an Invalid Package Target error. - } - - // Returns (module, subpath) - // https://github.com/nodejs/node/blob/8f0f17e1e3b6c4e58ce748e06343c5304062c491/lib/internal/modules/esm/resolve.js#L688 - fn parse_package_specifier(specifier: &str) -> (&str, &str) { - let mut separator_index = specifier.as_bytes().iter().position(|b| *b == b'/'); - // let mut valid_package_name = true; - // let mut is_scoped = false; - if specifier.starts_with('@') { - // is_scoped = true; - if separator_index.is_none() || specifier.is_empty() { - // valid_package_name = false; - } else if let Some(index) = &separator_index { - separator_index = specifier[*index + 1..] - .as_bytes() - .iter() - .position(|b| *b == b'/') - .map(|i| i + *index + 1); - } - } - let package_name = - separator_index.map_or(specifier, |separator_index| &specifier[..separator_index]); - - // TODO: https://github.com/nodejs/node/blob/8f0f17e1e3b6c4e58ce748e06343c5304062c491/lib/internal/modules/esm/resolve.js#L705C1-L714C1 - // Package name cannot have leading . and cannot have percent-encoding or - // \\ separators. - // if (RegExpPrototypeExec(invalidPackageNameRegEx, packageName) !== null) - // validPackageName = false; - - // if (!validPackageName) { - // throw new ERR_INVALID_MODULE_SPECIFIER( - // specifier, 'is not a valid package name', fileURLToPath(base)); - // } - let package_subpath = - separator_index.map_or("", |separator_index| &specifier[separator_index..]); - (package_name, package_subpath) - } - - /// PATTERN_KEY_COMPARE(keyA, keyB) - fn pattern_key_compare(key_a: &str, key_b: &str) -> Ordering { - if key_a.is_empty() { - return Ordering::Greater; - } - // 1. Assert: keyA ends with "/" or contains only a single "*". - debug_assert!(key_a.ends_with('/') || key_a.match_indices('*').count() == 1, "{key_a}"); - // 2. Assert: keyB ends with "/" or contains only a single "*". - debug_assert!(key_b.ends_with('/') || key_b.match_indices('*').count() == 1, "{key_b}"); - // 3. Let baseLengthA be the index of "*" in keyA plus one, if keyA contains "*", or the length of keyA otherwise. - let a_pos = key_a.chars().position(|c| c == '*'); - let base_length_a = a_pos.map_or(key_a.len(), |p| p + 1); - // 4. Let baseLengthB be the index of "*" in keyB plus one, if keyB contains "*", or the length of keyB otherwise. - let b_pos = key_b.chars().position(|c| c == '*'); - let base_length_b = b_pos.map_or(key_b.len(), |p| p + 1); - // 5. If baseLengthA is greater than baseLengthB, return -1. - if base_length_a > base_length_b { - return Ordering::Less; - } - // 6. If baseLengthB is greater than baseLengthA, return 1. - if base_length_b > base_length_a { - return Ordering::Greater; - } - // 7. If keyA does not contain "*", return 1. - if !key_a.contains('*') { - return Ordering::Greater; - } - // 8. If keyB does not contain "*", return -1. - if !key_b.contains('*') { - return Ordering::Less; - } - // 9. If the length of keyA is greater than the length of keyB, return -1. - if key_a.len() > key_b.len() { - return Ordering::Less; - } - // 10. If the length of keyB is greater than the length of keyA, return 1. - if key_b.len() > key_a.len() { - return Ordering::Greater; - } - // 11. Return 0. - Ordering::Equal - } - - fn strip_package_name<'a>(specifier: &'a str, package_name: &'a str) -> Option<&'a str> { - specifier - .strip_prefix(package_name) - .filter(|tail| tail.is_empty() || tail.starts_with(SLASH_START)) - } -} diff --git a/src/options.rs b/src/options.rs deleted file mode 100644 index f473a133..00000000 --- a/src/options.rs +++ /dev/null @@ -1,623 +0,0 @@ -use std::path::Path; -use std::{fmt, path::PathBuf}; - -/// Module Resolution Options -/// -/// Options are directly ported from [enhanced-resolve](https://github.com/webpack/enhanced-resolve#resolver-options). -/// -/// See [webpack resolve](https://webpack.js.org/configuration/resolve/) for information and examples -#[derive(Debug, Clone)] -pub struct ResolveOptions { - /// Path to TypeScript configuration file. - /// - /// Default `None` - pub tsconfig: Option, - - /// Create aliases to import or require certain modules more easily. - /// - /// An alias is used to replace a whole path or part of a path. - /// For example, to alias a commonly used `src/` folders: `vec![("@/src"), vec![AliasValue::Path("/path/to/src")]]` - /// - /// A trailing $ can also be added to the given object's keys to signify an exact match. - /// - /// See [webpack's `resolve.alias` documentation](https://webpack.js.org/configuration/resolve/#resolvealias) for a list of use cases. - pub alias: Alias, - - /// A list of alias fields in description files. - /// - /// Specify a field, such as `browser`, to be parsed according to [this specification](https://github.com/defunctzombie/package-browser-field-spec). - /// Can be a path to json object such as `["path", "to", "exports"]`. - /// - /// Default `[]` - pub alias_fields: Vec>, - - /// Condition names for exports field which defines entry points of a package. - /// - /// The key order in the exports field is significant. During condition matching, earlier entries have higher priority and take precedence over later entries. - /// - /// Default `[]` - pub condition_names: Vec, - - /// The JSON files to use for descriptions. (There was once a `bower.json`.) - /// - /// Default `["package.json"]` - pub description_files: Vec, - - /// Set to [EnforceExtension::Enabled] for [ESM Mandatory file extensions](https://nodejs.org/api/esm.html#mandatory-file-extensions). - /// - /// If `enforce_extension` is set to [EnforceExtension::Enabled], resolution will not allow extension-less files. - /// This means `require('./foo.js')` will resolve, while `require('./foo')` will not. - /// - /// The default value for `enforce_extension` is [EnforceExtension::Auto], which is changed upon initialization. - /// - /// It changes to [EnforceExtension::Enabled] if [ResolveOptions::extensions] contains an empty string; - /// otherwise, this value changes to [EnforceExtension::Disabled]. - /// - /// Explicitly set the value to [EnforceExtension::Disabled] to disable this automatic behavior. - /// - /// For reference, this behavior is aligned with `enhanced-resolve`. See . - pub enforce_extension: EnforceExtension, - - /// A list of exports fields in description files. - /// - /// Can be a path to a JSON object such as `["path", "to", "exports"]`. - /// - /// Default `[["exports"]]`. - pub exports_fields: Vec>, - - /// Fields from `package.json` which are used to provide the internal requests of a package - /// (requests starting with # are considered internal). - /// - /// Can be a path to a JSON object such as `["path", "to", "imports"]`. - /// - /// Default `[["imports"]]`. - pub imports_fields: Vec>, - - /// An object which maps extension to extension aliases. - /// - /// Default `{}` - pub extension_alias: Vec<(String, Vec)>, - - /// Attempt to resolve these extensions in order. - /// - /// If multiple files share the same name but have different extensions, - /// will resolve the one with the extension listed first in the array and skip the rest. - /// - /// All extensions must have a leading dot. - /// - /// Default `[".js", ".json", ".node"]` - pub extensions: Vec, - - /// Redirect module requests when normal resolving fails. - /// - /// Default `[]` - pub fallback: Alias, - - /// 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). - /// - /// See also webpack configuration [resolve.fullySpecified](https://webpack.js.org/configuration/module/#resolvefullyspecified) - /// - /// Default `false` - pub fully_specified: bool, - - /// A list of main fields in description files - /// - /// Default `["main"]`. - pub main_fields: Vec, - - /// The filename to be used while resolving directories. - /// - /// Default `["index"]` - pub main_files: Vec, - - /// A list of directories to resolve modules from, can be absolute path or folder name. - /// - /// Default `["node_modules"]` - pub modules: Vec, - - /// Resolve to a context instead of a file. - /// - /// Default `false` - pub resolve_to_context: bool, - - /// Prefer to resolve module requests as relative requests instead of using modules from node_modules directories. - /// - /// Default `false` - pub prefer_relative: bool, - - /// Prefer to resolve server-relative urls as absolute paths before falling back to resolve in ResolveOptions::roots. - /// - /// Default `false` - pub prefer_absolute: bool, - - /// A list of resolve restrictions to restrict the paths that a request can be resolved on. - /// - /// Default `[]` - pub restrictions: Vec, - - /// A list of directories where requests of server-relative URLs (starting with '/') are resolved. - /// On non-Windows systems these requests are resolved as an absolute path first. - /// - /// Default `[]` - pub roots: Vec, - - /// Whether to resolve symlinks to their symlinked location. - /// When enabled, symlinked resources are resolved to their real path, not their symlinked location. - /// Note that this may cause module resolution to fail when using tools that symlink packages (like npm link). - /// - /// Default `true` - pub symlinks: bool, - - /// Whether to parse [module.builtinModules](https://nodejs.org/api/module.html#modulebuiltinmodules) or not. - /// For example, "zlib" will throw [crate::ResolveError::Builtin] when set to true. - /// - /// Default `false` - pub builtin_modules: bool, -} - -impl ResolveOptions { - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// - /// let options = ResolveOptions::default().with_condition_names(&["bar"]); - /// assert_eq!(options.condition_names, vec!["bar".to_string()]) - /// ``` - #[must_use] - pub fn with_condition_names(mut self, names: &[&str]) -> Self { - self.condition_names = names.iter().map(ToString::to_string).collect::>(); - self - } - - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// - /// let options = ResolveOptions::default().with_builtin_modules(false); - /// assert_eq!(options.builtin_modules, false) - /// ``` - #[must_use] - pub fn with_builtin_modules(mut self, flag: bool) -> Self { - self.builtin_modules = flag; - self - } - - /// Adds a single root to the options - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_root("foo"); - /// assert_eq!(options.roots, vec![PathBuf::from("foo")]) - /// ``` - #[must_use] - pub fn with_root>(mut self, root: P) -> Self { - self.roots.push(root.as_ref().to_path_buf()); - self - } - - /// Adds a single extension to the list of extensions - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_extension("jsonc"); - /// assert!(options.extensions.contains(&"jsonc".to_string())); - /// ``` - #[must_use] - pub fn with_extension>(mut self, extension: S) -> Self { - self.extensions.push(extension.into()); - self - } - - /// Adds a single main field to the list of fields - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_main_field("something"); - /// assert!(options.main_fields.contains(&"something".to_string())); - /// ``` - #[must_use] - pub fn with_main_field>(mut self, field: S) -> Self { - self.main_fields.push(field.into()); - self - } - - /// Changes how the extension should be treated - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions, EnforceExtension}; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_force_extension(EnforceExtension::Enabled); - /// assert_eq!(options.enforce_extension, EnforceExtension::Enabled); - /// ``` - #[must_use] - pub fn with_force_extension(mut self, enforce_extension: EnforceExtension) -> Self { - self.enforce_extension = enforce_extension; - self - } - - /// Sets the value for [ResolveOptions::fully_specified] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_fully_specified(true); - /// assert_eq!(options.fully_specified, true); - /// ``` - #[must_use] - pub fn with_fully_specified(mut self, fully_specified: bool) -> Self { - self.fully_specified = fully_specified; - self - } - /// Sets the value for [ResolveOptions::prefer_relative] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_prefer_relative(true); - /// assert_eq!(options.prefer_relative, true); - /// ``` - #[must_use] - pub fn with_prefer_relative(mut self, flag: bool) -> Self { - self.prefer_relative = flag; - self - } - /// Sets the value for [ResolveOptions::prefer_absolute] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_prefer_absolute(true); - /// assert_eq!(options.prefer_absolute, true); - /// ``` - #[must_use] - pub fn with_prefer_absolute(mut self, flag: bool) -> Self { - self.prefer_absolute = flag; - self - } - - /// Changes the value of [ResolveOptions::symlinks] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// - /// let options = ResolveOptions::default().with_symbolic_link(false); - /// assert_eq!(options.symlinks, false); - /// ``` - #[must_use] - pub fn with_symbolic_link(mut self, flag: bool) -> Self { - self.symlinks = flag; - self - } - - /// Adds a module to [ResolveOptions::modules] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// - /// let options = ResolveOptions::default().with_module("module"); - /// assert!(options.modules.contains(&"module".to_string())); - /// ``` - #[must_use] - pub fn with_module>(mut self, module: M) -> Self { - self.modules.push(module.into()); - self - } - - /// Adds a main file to [ResolveOptions::main_files] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// - /// let options = ResolveOptions::default().with_main_file("foo"); - /// assert!(options.main_files.contains(&"foo".to_string())); - /// ``` - #[must_use] - pub fn with_main_file>(mut self, module: M) -> Self { - self.main_files.push(module.into()); - self - } - - pub(crate) fn sanitize(mut self) -> Self { - debug_assert!( - self.extensions.iter().filter(|e| !e.is_empty()).all(|e| e.starts_with('.')), - "All extensions must start with a leading dot" - ); - // Set `enforceExtension` to `true` when [ResolveOptions::extensions] contains an empty string. - // See - if self.enforce_extension == EnforceExtension::Auto { - if !self.extensions.is_empty() && self.extensions.iter().any(String::is_empty) { - self.enforce_extension = EnforceExtension::Enabled; - } else { - self.enforce_extension = EnforceExtension::Disabled; - } - } - self - } -} - -/// Value for [ResolveOptions::enforce_extension] -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -pub enum EnforceExtension { - Auto, - Enabled, - Disabled, -} - -impl EnforceExtension { - pub const fn is_auto(&self) -> bool { - matches!(self, Self::Auto) - } - - pub const fn is_enabled(&self) -> bool { - matches!(self, Self::Enabled) - } - - pub const fn is_disabled(&self) -> bool { - matches!(self, Self::Disabled) - } -} - -/// Alias for [ResolveOptions::alias] and [ResolveOptions::fallback] -pub type Alias = Vec<(String, Vec)>; - -/// Alias Value for [ResolveOptions::alias] and [ResolveOptions::fallback] -#[derive(Debug, Clone, Hash, PartialEq, Eq)] -pub enum AliasValue { - /// The path value - Path(String), - - /// The `false` value - Ignore, -} - -impl From for AliasValue -where - S: Into, -{ - fn from(value: S) -> Self { - Self::Path(value.into()) - } -} - -/// Value for [ResolveOptions::restrictions] -#[derive(Debug, Clone)] -pub enum Restriction { - Path(PathBuf), - RegExp(String), -} - -/// Tsconfig Options for [ResolveOptions::tsconfig] -/// -/// Derived from [tsconfig-paths-webpack-plugin](https://github.com/dividab/tsconfig-paths-webpack-plugin#options) -#[derive(Debug, Clone)] -pub struct TsconfigOptions { - /// Allows you to specify where to find the TypeScript configuration file. - /// You may provide - /// * a relative path to the configuration file. It will be resolved relative to cwd. - /// * an absolute path to the configuration file. - pub config_file: PathBuf, - - /// Support for Typescript Project References. - pub references: TsconfigReferences, -} - -/// Configuration for [TsconfigOptions::references] -#[derive(Debug, Clone)] -pub enum TsconfigReferences { - Disabled, - /// Use the `references` field from tsconfig of `config_file`. - Auto, - /// Manually provided relative or absolute path. - Paths(Vec), -} - -impl Default for ResolveOptions { - fn default() -> Self { - Self { - tsconfig: None, - alias: vec![], - alias_fields: vec![], - condition_names: vec![], - description_files: vec!["package.json".into()], - enforce_extension: EnforceExtension::Auto, - extension_alias: vec![], - exports_fields: vec![vec!["exports".into()]], - imports_fields: vec![vec!["imports".into()]], - extensions: vec![".js".into(), ".json".into(), ".node".into()], - fallback: vec![], - fully_specified: false, - main_fields: vec!["main".into()], - main_files: vec!["index".into()], - modules: vec!["node_modules".into()], - resolve_to_context: false, - prefer_relative: false, - prefer_absolute: false, - restrictions: vec![], - roots: vec![], - symlinks: true, - builtin_modules: false, - } - } -} - -// For tracing -impl fmt::Display for ResolveOptions { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - if let Some(tsconfig) = &self.tsconfig { - write!(f, "tsconfig:{tsconfig:?},")?; - } - if !self.alias.is_empty() { - write!(f, "alias:{:?},", self.alias)?; - } - if !self.alias_fields.is_empty() { - write!(f, "alias_fields:{:?},", self.alias_fields)?; - } - if !self.condition_names.is_empty() { - write!(f, "condition_names:{:?},", self.condition_names)?; - } - if self.enforce_extension.is_enabled() { - write!(f, "enforce_extension:{:?},", self.enforce_extension)?; - } - if !self.exports_fields.is_empty() { - write!(f, "exports_fields:{:?},", self.exports_fields)?; - } - if !self.imports_fields.is_empty() { - write!(f, "imports_fields:{:?},", self.imports_fields)?; - } - if !self.extension_alias.is_empty() { - write!(f, "extension_alias:{:?},", self.extension_alias)?; - } - if !self.extensions.is_empty() { - write!(f, "extensions:{:?},", self.extensions)?; - } - if !self.fallback.is_empty() { - write!(f, "fallback:{:?},", self.fallback)?; - } - if self.fully_specified { - write!(f, "fully_specified:{:?},", self.fully_specified)?; - } - if !self.main_fields.is_empty() { - write!(f, "main_fields:{:?},", self.main_fields)?; - } - if !self.main_files.is_empty() { - write!(f, "main_files:{:?},", self.main_files)?; - } - if !self.modules.is_empty() { - write!(f, "modules:{:?},", self.modules)?; - } - if self.resolve_to_context { - write!(f, "resolve_to_context:{:?},", self.resolve_to_context)?; - } - if self.prefer_relative { - write!(f, "prefer_relative:{:?},", self.prefer_relative)?; - } - if self.prefer_absolute { - write!(f, "prefer_absolute:{:?},", self.prefer_absolute)?; - } - if !self.restrictions.is_empty() { - write!(f, "restrictions:{:?},", self.restrictions)?; - } - if !self.roots.is_empty() { - write!(f, "roots:{:?},", self.roots)?; - } - if self.symlinks { - write!(f, "symlinks:{:?},", self.symlinks)?; - } - if self.builtin_modules { - write!(f, "builtin_modules:{:?},", self.builtin_modules)?; - } - Ok(()) - } -} - -#[cfg(test)] -mod test { - use super::{ - AliasValue, EnforceExtension, ResolveOptions, Restriction, TsconfigOptions, - TsconfigReferences, - }; - use std::path::PathBuf; - - #[test] - fn enforce_extension() { - assert!(EnforceExtension::Auto.is_auto()); - assert!(!EnforceExtension::Enabled.is_auto()); - assert!(!EnforceExtension::Disabled.is_auto()); - - assert!(!EnforceExtension::Auto.is_enabled()); - assert!(EnforceExtension::Enabled.is_enabled()); - assert!(!EnforceExtension::Disabled.is_enabled()); - - assert!(!EnforceExtension::Auto.is_disabled()); - assert!(!EnforceExtension::Enabled.is_disabled()); - assert!(EnforceExtension::Disabled.is_disabled()); - } - - #[test] - fn display() { - let options = ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: PathBuf::from("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - alias: vec![("a".into(), vec![AliasValue::Ignore])], - alias_fields: vec![vec!["browser".into()]], - condition_names: vec!["require".into()], - enforce_extension: EnforceExtension::Enabled, - extension_alias: vec![(".js".into(), vec![".ts".into()])], - exports_fields: vec![vec!["exports".into()]], - imports_fields: vec![vec!["imports".into()]], - fallback: vec![("fallback".into(), vec![AliasValue::Ignore])], - fully_specified: true, - resolve_to_context: true, - prefer_relative: true, - prefer_absolute: true, - restrictions: vec![Restriction::Path(PathBuf::from("restrictions"))], - roots: vec![PathBuf::from("roots")], - builtin_modules: true, - ..ResolveOptions::default() - }; - - let expected = r#"tsconfig:TsconfigOptions { config_file: "tsconfig.json", references: Auto },alias:[("a", [Ignore])],alias_fields:[["browser"]],condition_names:["require"],enforce_extension:Enabled,exports_fields:[["exports"]],imports_fields:[["imports"]],extension_alias:[(".js", [".ts"])],extensions:[".js", ".json", ".node"],fallback:[("fallback", [Ignore])],fully_specified:true,main_fields:["main"],main_files:["index"],modules:["node_modules"],resolve_to_context:true,prefer_relative:true,prefer_absolute:true,restrictions:[Path("restrictions")],roots:["roots"],symlinks:true,builtin_modules:true,"#; - assert_eq!(format!("{options}"), expected); - - let options = ResolveOptions { - alias: vec![], - alias_fields: vec![], - builtin_modules: false, - condition_names: vec![], - description_files: vec![], - enforce_extension: EnforceExtension::Disabled, - exports_fields: vec![], - extension_alias: vec![], - extensions: vec![], - fallback: vec![], - fully_specified: false, - imports_fields: vec![], - main_fields: vec![], - main_files: vec![], - modules: vec![], - prefer_absolute: false, - prefer_relative: false, - resolve_to_context: false, - restrictions: vec![], - roots: vec![], - symlinks: false, - tsconfig: None, - }; - - assert_eq!(format!("{options}"), ""); - } -} diff --git a/src/package_json.rs b/src/package_json.rs deleted file mode 100644 index 73901faa..00000000 --- a/src/package_json.rs +++ /dev/null @@ -1,207 +0,0 @@ -//! package.json definitions -//! -//! Code related to export field are copied from [Parcel's resolver](https://github.com/parcel-bundler/parcel/blob/v2/packages/utils/node-resolver-rs/src/package_json.rs) -use std::path::{Path, PathBuf}; - -use serde_json::Value as JSONValue; - -use crate::{path::PathUtil, ResolveError}; - -pub type JSONMap = serde_json::Map; - -/// Deserialized package.json -#[derive(Debug, Default)] -pub struct PackageJson { - /// Path to `package.json`. Contains the `package.json` filename. - pub path: PathBuf, - - /// Realpath to `package.json`. Contains the `package.json` filename. - pub realpath: PathBuf, - - /// The "name" field defines your package's name. - /// The "name" field can be used in addition to the "exports" field to self-reference a package using its name. - /// - /// - pub name: Option, - - raw_json: std::sync::Arc, -} - -impl PackageJson { - /// # Panics - /// # Errors - pub(crate) fn parse( - path: PathBuf, - realpath: PathBuf, - json: &str, - ) -> Result { - let mut raw_json: JSONValue = serde_json::from_str(json)?; - let mut package_json = Self::default(); - - if let Some(json_object) = raw_json.as_object_mut() { - // Remove large fields that are useless for pragmatic use. - #[cfg(feature = "package_json_raw_json_api")] - { - json_object.remove("description"); - json_object.remove("keywords"); - json_object.remove("scripts"); - json_object.remove("dependencies"); - json_object.remove("devDependencies"); - json_object.remove("peerDependencies"); - json_object.remove("optionalDependencies"); - } - - // Add name. - package_json.name = - json_object.get("name").and_then(|field| field.as_str()).map(ToString::to_string); - } - - package_json.path = path; - package_json.realpath = realpath; - package_json.raw_json = std::sync::Arc::new(raw_json); - Ok(package_json) - } - - fn get_value_by_path<'a>( - fields: &'a serde_json::Map, - path: &[String], - ) -> Option<&'a JSONValue> { - if path.is_empty() { - return None; - } - let mut value = fields.get(&path[0])?; - for key in path.iter().skip(1) { - if let Some(inner_value) = value.as_object().and_then(|o| o.get(key)) { - value = inner_value; - } else { - return None; - } - } - Some(value) - } - - /// Raw serde json value of `package.json`. - /// - /// This is currently used in Rspack for: - /// * getting the `sideEffects` field - /// * query in - search on GitHub indicates query on the `type` field. - /// - /// To reduce overall memory consumption, large fields that useless for pragmatic use are removed. - /// They are: `description`, `keywords`, `scripts`, - /// `dependencies` and `devDependencies`, `peerDependencies`, `optionalDependencies`. - #[cfg(feature = "package_json_raw_json_api")] - pub fn raw_json(&self) -> &std::sync::Arc { - &self.raw_json - } - - /// Directory to `package.json` - /// - /// # Panics - /// - /// * When the package.json path is misconfigured. - pub fn directory(&self) -> &Path { - debug_assert!(self.realpath.file_name().is_some_and(|x| x == "package.json")); - self.realpath.parent().unwrap() - } - - /// The "main" field defines the entry point of a package when imported by name via a node_modules lookup. Its value is a path. - /// - /// When a package has an "exports" field, this will take precedence over the "main" field when importing the package by name. - /// - /// Values are dynamically retrieved from [ResolveOptions::main_fields]. - /// - /// - pub(crate) fn main_fields<'a>( - &'a self, - main_fields: &'a [String], - ) -> impl Iterator + '_ { - main_fields - .iter() - .filter_map(|main_field| self.raw_json.get(main_field)) - .filter_map(|value| value.as_str()) - } - - /// The "exports" field allows defining the entry points of a package when imported by name loaded either via a node_modules lookup or a self-reference to its own name. - /// - /// - pub(crate) fn exports_fields<'a>( - &'a self, - exports_fields: &'a [Vec], - ) -> impl Iterator + '_ { - exports_fields.iter().filter_map(|object_path| { - self.raw_json - .as_object() - .and_then(|json_object| Self::get_value_by_path(json_object, object_path)) - }) - } - - /// In addition to the "exports" field, there is a package "imports" field to create private mappings that only apply to import specifiers from within the package itself. - /// - /// - pub(crate) fn imports_fields<'a>( - &'a self, - imports_fields: &'a [Vec], - ) -> impl Iterator + '_ { - imports_fields.iter().filter_map(|object_path| { - self.raw_json - .as_object() - .and_then(|json_object| Self::get_value_by_path(json_object, object_path)) - .and_then(|value| value.as_object()) - }) - } - - /// The "browser" field is provided by a module author as a hint to javascript bundlers or component tools when packaging modules for client side use. - /// Multiple values are configured by [ResolveOptions::alias_fields]. - /// - /// - fn browser_fields<'a>( - &'a self, - alias_fields: &'a [Vec], - ) -> impl Iterator + '_ { - alias_fields.iter().filter_map(|object_path| { - self.raw_json - .as_object() - .and_then(|json_object| Self::get_value_by_path(json_object, object_path)) - // Only object is valid, all other types are invalid - // https://github.com/webpack/enhanced-resolve/blob/3a28f47788de794d9da4d1702a3a583d8422cd48/lib/AliasFieldPlugin.js#L44-L52 - .and_then(|value| value.as_object()) - }) - } - - /// Resolve the request string for this package.json by looking at the `browser` field. - /// - /// # Errors - /// - /// * Returns [ResolveError::Ignored] for `"path": false` in `browser` field. - pub(crate) fn resolve_browser_field<'a>( - &'a self, - path: &Path, - request: Option<&str>, - alias_fields: &'a [Vec], - ) -> Result, ResolveError> { - for object in self.browser_fields(alias_fields) { - if let Some(request) = request { - if let Some(value) = object.get(request) { - return Self::alias_value(path, value); - } - } else { - let dir = self.path.parent().unwrap(); - for (key, value) in object { - let joined = dir.normalize_with(key); - if joined == path { - return Self::alias_value(path, value); - } - } - } - } - Ok(None) - } - - fn alias_value<'a>(key: &Path, value: &'a JSONValue) -> Result, ResolveError> { - match value { - JSONValue::String(value) => Ok(Some(value.as_str())), - JSONValue::Bool(b) if !b => Err(ResolveError::Ignored(key.to_path_buf())), - _ => Ok(None), - } - } -} diff --git a/src/path.rs b/src/path.rs deleted file mode 100644 index f66fdd76..00000000 --- a/src/path.rs +++ /dev/null @@ -1,132 +0,0 @@ -//! Path Utilities -//! -//! Code adapted from the following libraries -//! * [path-absolutize](https://docs.rs/path-absolutize) -//! * [normalize_path](https://docs.rs/normalize-path) -use std::path::{Component, Path, PathBuf}; - -pub const SLASH_START: &[char; 2] = &['/', '\\']; - -/// Extension trait to add path normalization to std's [`Path`]. -pub trait PathUtil { - /// Normalize this path without performing I/O. - /// - /// All redundant separator and up-level references are collapsed. - /// - /// However, this does not resolve links. - fn normalize(&self) -> PathBuf; - - /// Normalize with subpath assuming this path is normalized without performing I/O. - /// - /// All redundant separator and up-level references are collapsed. - /// - /// However, this does not resolve links. - fn normalize_with>(&self, subpath: P) -> PathBuf; - - /// Defined in ESM PACKAGE_TARGET_RESOLVE - /// If target split on "/" or "\" contains any "", ".", "..", or "node_modules" segments after the first "." segment, case insensitive and including percent encoded variants - fn is_invalid_exports_target(&self) -> bool; -} - -impl PathUtil for Path { - // https://github.com/parcel-bundler/parcel/blob/e0b99c2a42e9109a9ecbd6f537844a1b33e7faf5/packages/utils/node-resolver-rs/src/path.rs#L7 - fn normalize(&self) -> PathBuf { - let mut components = self.components().peekable(); - let mut ret = if let Some(c @ Component::Prefix(..)) = components.peek() { - let buf = PathBuf::from(c.as_os_str()); - components.next(); - buf - } else { - PathBuf::new() - }; - - for component in components { - match component { - Component::Prefix(..) => unreachable!("Path {:?}", self), - Component::RootDir => { - ret.push(component.as_os_str()); - } - Component::CurDir => {} - Component::ParentDir => { - ret.pop(); - } - Component::Normal(c) => { - ret.push(c); - } - } - } - - ret - } - - // https://github.com/parcel-bundler/parcel/blob/e0b99c2a42e9109a9ecbd6f537844a1b33e7faf5/packages/utils/node-resolver-rs/src/path.rs#L37 - fn normalize_with>(&self, subpath: B) -> PathBuf { - let subpath = subpath.as_ref(); - - let mut components = subpath.components(); - - let Some(head) = components.next() else { return subpath.to_path_buf() }; - - if matches!(head, Component::Prefix(..) | Component::RootDir) { - return subpath.to_path_buf(); - } - - let mut ret = self.to_path_buf(); - for component in std::iter::once(head).chain(components) { - match component { - Component::CurDir => {} - Component::ParentDir => { - ret.pop(); - } - Component::Normal(c) => { - ret.push(c); - } - Component::Prefix(..) | Component::RootDir => { - unreachable!("Path {:?} Subpath {:?}", self, subpath) - } - } - } - - ret - } - - fn is_invalid_exports_target(&self) -> bool { - self.components().enumerate().any(|(index, c)| match c { - Component::ParentDir => true, - Component::CurDir => index > 0, - Component::Normal(c) => c.eq_ignore_ascii_case("node_modules"), - _ => false, - }) - } -} - -// https://github.com/webpack/enhanced-resolve/blob/main/test/path.test.js -#[test] -fn is_invalid_exports_target() { - let test_cases = [ - "../a.js", - "../", - "./a/b/../../../c.js", - "./a/b/../../../", - "./../../c.js", - "./../../", - "./a/../b/../../c.js", - "./a/../b/../../", - "./././../", - ]; - - for case in test_cases { - assert!(Path::new(case).is_invalid_exports_target(), "{case}"); - } - - assert!(!Path::new("C:").is_invalid_exports_target()); - assert!(!Path::new("/").is_invalid_exports_target()); -} - -#[test] -fn normalize() { - assert_eq!(Path::new("/foo/.././foo/").normalize(), Path::new("/foo")); - assert_eq!(Path::new("C://").normalize(), Path::new("C://")); - assert_eq!(Path::new("C:").normalize(), Path::new("C:")); - assert_eq!(Path::new(r"\\server\share").normalize(), Path::new(r"\\server\share")); -} diff --git a/src/resolution.rs b/src/resolution.rs deleted file mode 100644 index a3aaa2e7..00000000 --- a/src/resolution.rs +++ /dev/null @@ -1,92 +0,0 @@ -use crate::package_json::PackageJson; -use std::{ - fmt, - path::{Path, PathBuf}, - sync::Arc, -}; - -/// The final path resolution with optional `?query` and `#fragment` -#[derive(Clone)] -pub struct Resolution { - pub(crate) path: PathBuf, - - /// path query `?query`, contains `?`. - pub(crate) query: Option, - - /// path fragment `#query`, contains `#`. - pub(crate) fragment: Option, - - pub(crate) package_json: Option>, -} - -impl fmt::Debug for Resolution { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - f.debug_struct("Resolution") - .field("path", &self.path) - .field("query", &self.query) - .field("fragment", &self.fragment) - .field("package_json", &self.package_json.as_ref().map(|p| &p.path)) - .finish() - } -} - -impl PartialEq for Resolution { - fn eq(&self, other: &Self) -> bool { - self.path == other.path && self.query == other.query && self.fragment == other.fragment - } -} -impl Eq for Resolution {} - -impl Resolution { - /// Returns the path without query and fragment - pub fn path(&self) -> &Path { - &self.path - } - - /// Returns the path without query and fragment - pub fn into_path_buf(self) -> PathBuf { - self.path - } - - /// Returns the path query `?query`, contains the leading `?` - pub fn query(&self) -> Option<&str> { - self.query.as_deref() - } - - /// Returns the path fragment `#fragment`, contains the leading `#` - pub fn fragment(&self) -> Option<&str> { - self.fragment.as_deref() - } - - /// Returns serialized package_json - pub fn package_json(&self) -> Option<&Arc> { - self.package_json.as_ref() - } - - /// Returns the full path with query and fragment - pub fn full_path(&self) -> PathBuf { - let mut path = self.path.clone().into_os_string(); - if let Some(query) = &self.query { - path.push(query); - } - if let Some(fragment) = &self.fragment { - path.push(fragment); - } - PathBuf::from(path) - } -} - -#[test] -fn test() { - let resolution = Resolution { - path: PathBuf::from("foo"), - query: Some("?query".to_string()), - fragment: Some("#fragment".to_string()), - package_json: None, - }; - assert_eq!(resolution.path(), Path::new("foo")); - assert_eq!(resolution.query(), Some("?query")); - assert_eq!(resolution.fragment(), Some("#fragment")); - assert_eq!(resolution.full_path(), PathBuf::from("foo?query#fragment")); - assert_eq!(resolution.into_path_buf(), PathBuf::from("foo")); -} diff --git a/src/specifier.rs b/src/specifier.rs deleted file mode 100644 index 3d35eafc..00000000 --- a/src/specifier.rs +++ /dev/null @@ -1,230 +0,0 @@ -use crate::error::SpecifierError; -use std::borrow::Cow; - -#[derive(Debug)] -pub struct Specifier<'a> { - path: Cow<'a, str>, - pub query: Option<&'a str>, - pub fragment: Option<&'a str>, -} - -impl<'a> Specifier<'a> { - pub fn path(&'a self) -> &'a str { - self.path.as_ref() - } - - pub fn parse(specifier: &'a str) -> Result, SpecifierError> { - if specifier.is_empty() { - return Err(SpecifierError::Empty(specifier.to_string())); - } - let offset = match specifier.as_bytes()[0] { - b'/' | b'.' | b'#' => 1, - _ => 0, - }; - let (path, query, fragment) = Self::parse_query_framgment(specifier, offset); - if path.is_empty() { - return Err(SpecifierError::Empty(specifier.to_string())); - } - Ok(Self { path, query, fragment }) - } - - fn parse_query_framgment( - specifier: &'a str, - skip: usize, - ) -> (Cow<'a, str>, Option<&str>, Option<&str>) { - let mut query_start: Option = None; - let mut fragment_start: Option = None; - - let mut prev = specifier.chars().next().unwrap(); - let mut escaped_indexes = vec![]; - for (i, c) in specifier.char_indices().skip(skip) { - if c == '?' && query_start.is_none() { - query_start = Some(i); - } - if c == '#' { - if prev == '\0' { - escaped_indexes.push(i - 1); - } else { - fragment_start = Some(i); - break; - } - } - prev = c; - } - - let (path, query, fragment) = match (query_start, fragment_start) { - (Some(i), Some(j)) => { - debug_assert!(i < j); - (&specifier[..i], Some(&specifier[i..j]), Some(&specifier[j..])) - } - (Some(i), None) => (&specifier[..i], Some(&specifier[i..]), None), - (None, Some(j)) => (&specifier[..j], None, Some(&specifier[j..])), - _ => (specifier, None, None), - }; - - let path = if escaped_indexes.is_empty() { - Cow::Borrowed(path) - } else { - // Remove the `\0` characters for a legal path. - Cow::Owned( - path.chars() - .enumerate() - .filter_map(|(i, c)| (!escaped_indexes.contains(&i)).then_some(c)) - .collect::(), - ) - }; - - (path, query, fragment) - } -} - -#[cfg(test)] -mod tests { - use super::{Specifier, SpecifierError}; - - #[test] - fn debug() { - let specifier = Specifier::parse("/").unwrap(); - assert_eq!( - format!("{specifier:?}"), - r#"Specifier { path: "/", query: None, fragment: None }"# - ); - } - - #[test] - fn empty() { - let specifiers = ["", "?"]; - for specifier in specifiers { - let error = Specifier::parse(specifier).unwrap_err(); - assert_eq!(error, SpecifierError::Empty(specifier.to_string())); - } - } - - #[test] - fn absolute() -> Result<(), SpecifierError> { - let specifier = "/test?#"; - let parsed = Specifier::parse(specifier)?; - assert_eq!(parsed.path, "/test"); - assert_eq!(parsed.query, Some("?")); - assert_eq!(parsed.fragment, Some("#")); - Ok(()) - } - - #[test] - fn relative() -> Result<(), SpecifierError> { - let specifiers = ["./test", "../test", "../../test"]; - for specifier in specifiers { - let mut r = specifier.to_string(); - r.push_str("?#"); - let parsed = Specifier::parse(&r)?; - assert_eq!(parsed.path, specifier); - assert_eq!(parsed.query, Some("?")); - assert_eq!(parsed.fragment, Some("#")); - } - Ok(()) - } - - #[test] - fn hash() -> Result<(), SpecifierError> { - let specifiers = ["#", "#path"]; - for specifier in specifiers { - let mut r = specifier.to_string(); - r.push_str("?#"); - let parsed = Specifier::parse(&r)?; - assert_eq!(parsed.path, specifier); - assert_eq!(parsed.query, Some("?")); - assert_eq!(parsed.fragment, Some("#")); - } - Ok(()) - } - - #[test] - fn module() -> Result<(), SpecifierError> { - let specifiers = ["module"]; - for specifier in specifiers { - let mut r = specifier.to_string(); - r.push_str("?#"); - let parsed = Specifier::parse(&r)?; - assert_eq!(parsed.path, specifier); - assert_eq!(parsed.query, Some("?")); - assert_eq!(parsed.fragment, Some("#")); - } - Ok(()) - } - - #[test] - fn query_fragment() -> Result<(), SpecifierError> { - let data = [ - ("a?", Some("?"), None), - ("a?query", Some("?query"), None), - ("a?query1?query2", Some("?query1?query2"), None), - ("a?query1?query2?query3", Some("?query1?query2?query3"), None), - ("a#", None, Some("#")), - ("a#b#c", None, Some("#b#c")), - ("a#fragment", None, Some("#fragment")), - ("a?#", Some("?"), Some("#")), - ("a?#fragment", Some("?"), Some("#fragment")), - ("a?query#", Some("?query"), Some("#")), - ("a?query#fragment", Some("?query"), Some("#fragment")), - ("a#fragment?", None, Some("#fragment?")), - ("a#fragment?query", None, Some("#fragment?query")), - ]; - - for (specifier_str, query, fragment) in data { - let specifier = Specifier::parse(specifier_str)?; - assert_eq!(specifier.path, "a", "{specifier_str}"); - assert_eq!(specifier.query, query, "{specifier_str}"); - assert_eq!(specifier.fragment, fragment, "{specifier_str}"); - } - - Ok(()) - } - - #[test] - // https://github.com/webpack/enhanced-resolve/blob/main/test/identifier.test.js - fn enhanced_resolve_edge_cases() -> Result<(), SpecifierError> { - let data = [ - ("path/#", "path/", "", "#"), - ("path/as/?", "path/as/", "?", ""), - ("path/#/?", "path/", "", "#/?"), - ("path/#repo#hash", "path/", "", "#repo#hash"), - ("path/#r#hash", "path/", "", "#r#hash"), - ("path/#repo/#repo2#hash", "path/", "", "#repo/#repo2#hash"), - ("path/#r/#r#hash", "path/", "", "#r/#r#hash"), - ("path/#/not/a/hash?not-a-query", "path/", "", "#/not/a/hash?not-a-query"), - ]; - - for (specifier_str, path, query, fragment) in data { - let specifier = Specifier::parse(specifier_str)?; - assert_eq!(specifier.path, path, "{specifier_str}"); - assert_eq!(specifier.query.unwrap_or(""), query, "{specifier_str}"); - assert_eq!(specifier.fragment.unwrap_or(""), fragment, "{specifier_str}"); - } - - Ok(()) - } - - // https://github.com/webpack/enhanced-resolve/blob/main/test/identifier.test.js - #[test] - fn enhanced_resolve_windows_like() -> Result<(), SpecifierError> { - let data = [ - ("path\\#", "path\\", "", "#"), - ("path\\as\\?", "path\\as\\", "?", ""), - ("path\\#\\?", "path\\", "", "#\\?"), - ("path\\#repo#hash", "path\\", "", "#repo#hash"), - ("path\\#r#hash", "path\\", "", "#r#hash"), - ("path\\#repo\\#repo2#hash", "path\\", "", "#repo\\#repo2#hash"), - ("path\\#r\\#r#hash", "path\\", "", "#r\\#r#hash"), - ("path\\#/not/a/hash?not-a-query", "path\\", "", "#/not/a/hash?not-a-query"), - ]; - - for (specifier_str, path, query, fragment) in data { - let specifier = Specifier::parse(specifier_str)?; - assert_eq!(specifier.path, path, "{specifier_str}"); - assert_eq!(specifier.query.unwrap_or(""), query, "{specifier_str}"); - assert_eq!(specifier.fragment.unwrap_or(""), fragment, "{specifier_str}"); - } - - Ok(()) - } -} diff --git a/src/tests/alias.rs b/src/tests/alias.rs deleted file mode 100644 index 07c615f4..00000000 --- a/src/tests/alias.rs +++ /dev/null @@ -1,280 +0,0 @@ -//! - -use normalize_path::NormalizePath; -use std::path::Path; - -use crate::{AliasValue, Resolution, ResolveContext, ResolveError, ResolveOptions, Resolver}; - -#[test] -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -fn alias() { - use super::memory_fs::MemoryFS; - use crate::ResolverGeneric; - use std::path::{Path, PathBuf}; - - let f = Path::new("/"); - - let file_system = MemoryFS::new(&[ - ("/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", ""), - ("/dashed-name", ""), - ]); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - alias: vec![ - ("aliasA".into(), vec![AliasValue::from("a")]), - ("b$".into(), vec![AliasValue::from("a/index")]), - ("c$".into(), vec![AliasValue::from("/a/index")]), - ( - "multiAlias".into(), - vec![ - AliasValue::from("b"), - AliasValue::from("c"), - AliasValue::from("d"), - AliasValue::from("e"), - AliasValue::from("a"), - ], - ), - ("recursive".into(), vec![AliasValue::from("recursive/dir")]), - ("/d/dir".into(), vec![AliasValue::from("/c/dir")]), - ("/d/index.js".into(), vec![AliasValue::from("/c/index")]), - ("#".into(), vec![AliasValue::from("/c/dir")]), - ("@".into(), vec![AliasValue::from("/c/dir")]), - ("ignored".into(), vec![AliasValue::Ignore]), - // not part of enhanced-resolve, added to make sure query in alias value works - ("alias_query".into(), vec![AliasValue::from("a?query_after")]), - ("alias_fragment".into(), vec![AliasValue::from("a#fragment_after")]), - ("dash".into(), vec![AliasValue::Ignore]), - ("@scope/package-name/file$".into(), vec![AliasValue::from("/c/dir")]), - ], - modules: vec!["/".into()], - ..ResolveOptions::default() - }, - ); - - #[rustfmt::skip] - let pass = [ - ("should resolve a not aliased module 1", "a", "/a/index"), - ("should resolve a not aliased module 2", "a/index", "/a/index"), - ("should resolve a not aliased module 3", "a/dir", "/a/dir/index"), - ("should resolve a not aliased module 4", "a/dir/index", "/a/dir/index"), - ("should resolve an aliased module 1", "aliasA", "/a/index"), - ("should resolve an aliased module 2", "aliasA/index", "/a/index"), - ("should resolve an aliased module 3", "aliasA/dir", "/a/dir/index"), - ("should resolve an aliased module 4", "aliasA/dir/index", "/a/dir/index"), - ("should resolve '#' alias 1", "#", "/c/dir/index"), - ("should resolve '#' alias 2", "#/index", "/c/dir/index"), - ("should resolve '@' alias 1", "@", "/c/dir/index"), - ("should resolve '@' alias 2", "@/index", "/c/dir/index"), - ("should resolve a recursive aliased module 1", "recursive", "/recursive/dir/index"), - ("should resolve a recursive aliased module 2", "recursive/index", "/recursive/dir/index"), - ("should resolve a recursive aliased module 3", "recursive/dir", "/recursive/dir/index"), - ("should resolve a recursive aliased module 4", "recursive/dir/index", "/recursive/dir/index"), - ("should resolve a file aliased module 1", "b", "/a/index"), - ("should resolve a file aliased module 2", "c", "/a/index"), - ("should resolve a file aliased module with a query 1", "b?query", "/a/index?query"), - ("should resolve a file aliased module with a query 2", "c?query", "/a/index?query"), - ("should resolve a path in a file aliased module 1", "b/index", "/b/index"), - ("should resolve a path in a file aliased module 2", "b/dir", "/b/dir/index"), - ("should resolve a path in a file aliased module 3", "b/dir/index", "/b/dir/index"), - ("should resolve a path in a file aliased module 4", "c/index", "/c/index"), - ("should resolve a path in a file aliased module 5", "c/dir", "/c/dir/index"), - ("should resolve a path in a file aliased module 6", "c/dir/index", "/c/dir/index"), - ("should resolve a file aliased file 1", "d", "/c/index"), - ("should resolve a file aliased file 2", "d/dir/index", "/c/dir/index"), - ("should resolve a file in multiple aliased dirs 1", "multiAlias/dir/file", "/e/dir/file"), - ("should resolve a file in multiple aliased dirs 2", "multiAlias/anotherDir", "/e/anotherDir/index"), - // not part of enhanced-resolve, added to make sure query in alias value works - ("should resolve query in alias value", "alias_query?query_before", "/a/index?query_after"), - ("should resolve query in alias value", "alias_fragment#fragment_before", "/a/index#fragment_after"), - ("should resolve dashed name", "dashed-name", "/dashed-name"), - ("should resolve scoped package name with sub dir", "@scope/package-name/file", "/c/dir/index"), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - - #[rustfmt::skip] - let ignore = [ - ("should resolve an ignore module", "ignored", ResolveError::Ignored(f.join("ignored"))) - ]; - - for (comment, request, expected) in ignore { - let resolution = resolver.resolve(f, request); - assert_eq!(resolution, Err(expected), "{comment} {request}"); - } -} - -// Not part of enhanced-resolve -#[test] -fn infinite_recursion() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![ - ("./a".into(), vec![AliasValue::from("./b")]), - ("./b".into(), vec![AliasValue::from("./a")]), - ], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(f, "./a"); - assert_eq!(resolution, Err(ResolveError::Recursion)); -} - -fn check_slash(path: &Path) { - let s = path.to_string_lossy().to_string(); - #[cfg(target_os = "windows")] - { - assert!(!s.contains('/'), "{s}"); - assert!(s.contains('\\'), "{s}"); - } - #[cfg(not(target_os = "windows"))] - { - assert!(s.contains('/'), "{s}"); - assert!(!s.contains('\\'), "{s}"); - } -} - -#[test] -fn absolute_path() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![(f.join("foo").to_str().unwrap().to_string(), vec![AliasValue::Ignore])], - modules: vec![f.clone().to_str().unwrap().to_string()], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(&f, "foo/index"); - assert_eq!(resolution, Err(ResolveError::Ignored(f.join("foo")))); -} - -#[test] -fn system_path() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![("@app".into(), vec![AliasValue::from(f.join("alias").to_string_lossy())])], - ..ResolveOptions::default() - }); - - let specifiers = ["@app/files/a", "@app/files/a.js"]; - - for specifier in specifiers { - let path = resolver.resolve(&f, specifier).map(Resolution::into_path_buf).unwrap(); - assert_eq!(path, f.join("alias/files/a.js")); - check_slash(&path); - } -} - -#[test] -fn alias_is_full_path() { - let f = super::fixture(); - let dir = f.join("foo"); - let dir_str = dir.to_string_lossy().to_string(); - - let resolver = Resolver::new(ResolveOptions { - alias: vec![("@".into(), vec![AliasValue::Path(dir_str.clone())])], - ..ResolveOptions::default() - }); - - let mut ctx = ResolveContext::default(); - - let specifiers = [ - "@/index".to_string(), - "@/index.js".to_string(), - // specifier has multiple `/` for reasons we'll never know - "@////index".to_string(), - // specifier is a full path - dir_str, - ]; - - for specifier in specifiers { - let resolution = resolver.resolve_with_context(&f, &specifier, &mut ctx); - assert_eq!(resolution.map(|r| r.full_path()), Ok(dir.join("index.js"))); - } - - for path in ctx.file_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - check_slash(&path); - } - - for path in ctx.missing_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - check_slash(&path); - if let Some(path) = path.parent() { - assert!(!path.is_file(), "{path:?} must not be a file"); - } - } -} - -// For the `should_stop` variable in `load_alias` -#[test] -fn all_alias_values_are_not_found() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![( - "m1".to_string(), - vec![AliasValue::Path(f.join("node_modules").join("m2").to_string_lossy().to_string())], - )], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(&f, "m1/a.js"); - assert_eq!(resolution, Err(ResolveError::NotFound("m1/a.js".to_string()))); -} - -#[test] -fn alias_fragment() { - let f = super::fixture(); - - let data = [ - // enhanced-resolve has `#` prepended with a `\0`, they are removed from the - // following 3 expected test results. - // See https://github.com/webpack/enhanced-resolve#escaping - ( - "handle fragment edge case (no fragment)", - "./no#fragment/#/#", - f.join("no#fragment/#/#.js"), - ), - ("handle fragment edge case (fragment)", "./no#fragment/#/", f.join("no.js#fragment/#/")), - ( - "handle fragment escaping", - "./no\0#fragment/\0#/\0##fragment", - f.join("no#fragment/#/#.js#fragment"), - ), - ]; - - for (comment, request, expected) in data { - let resolver = Resolver::new(ResolveOptions { - alias: vec![("foo".to_string(), vec![AliasValue::Path(request.to_string())])], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f, "foo").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } -} - -#[test] -fn alias_try_fragment_as_path() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![( - "#".to_string(), - vec![AliasValue::Path(f.join("#").to_string_lossy().to_string())], - )], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(&f, "#/a").map(|r| r.full_path()); - assert_eq!(resolution, Ok(f.join("#").join("a.js"))); -} diff --git a/src/tests/browser_field.rs b/src/tests/browser_field.rs deleted file mode 100644 index 171ee099..00000000 --- a/src/tests/browser_field.rs +++ /dev/null @@ -1,189 +0,0 @@ -//! - -use crate::{AliasValue, ResolveError, ResolveOptions, Resolver}; - -#[test] -fn ignore() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![ - vec!["browser".into()], - vec!["innerBrowser1".into()], - vec!["innerBrowser2".into()], - vec![], - ], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - (f.clone(), "./lib/ignore", f.join("lib/ignore.js")), - (f.clone(), "./lib/ignore.js", f.join("lib/ignore.js")), - (f.join("lib"), "./ignore", f.join("lib/ignore.js")), - (f.join("lib"), "./ignore.js", f.join("lib/ignore.js")), - ]; - - for (path, request, expected) in data { - let resolution = resolver.resolve(&path, request); - let expected = ResolveError::Ignored(expected); - assert_eq!(resolution, Err(expected), "{path:?} {request}"); - } -} - -#[test] -fn shared_resolvers() { - let f = super::fixture().join("browser-module"); - - let resolver1 = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["innerBrowser1".into(), "field".into(), "browser".into()]], - ..ResolveOptions::default() - }); - let resolved_path = resolver1.resolve(&f, "./lib/main1.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("lib/main.js"))); - - let resolver2 = resolver1.clone_with_options(ResolveOptions { - alias_fields: vec![vec!["innerBrowser2".into(), "browser".into()]], - ..ResolveOptions::default() - }); - let resolved_path = resolver2.resolve(&f, "./lib/main2.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("./lib/replaced.js"))); -} - -#[test] -fn replace_file() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![ - vec!["browser".into()], - vec!["innerBrowser1".into(), "field2".into(), "browser".into()], // not presented - vec!["innerBrowser1".into(), "field".into(), "browser".into()], - vec!["innerBrowser2".into(), "browser".into()], - ], - // Not part of enhanced-resolve. Added to make sure no interaction between these two fields. - main_fields: vec!["browser".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - ("should replace a file 1", f.clone(), "./lib/replaced", f.join("lib/browser.js")), - ("should replace a file 2", f.clone(), "./lib/replaced.js", f.join("lib/browser.js")), - ("should replace a file 3", f.join("lib"), "./replaced", f.join("lib/browser.js")), - ("should replace a file 4", f.join("lib"), "./replaced.js", f.join("lib/browser.js")), - ("should replace a module with a file 1", f.clone(), "module-a", f.join("browser/module-a.js")), - ("should replace a module with a file 2", f.join("lib"), "module-a", f.join("browser/module-a.js")), - ("should replace a module with a module 1", f.clone(), "module-b", f.join("node_modules/module-c.js")), - ("should replace a module with a module 2", f.join("lib"), "module-b", f.join("node_modules/module-c.js")), - ("should resolve in nested property 1", f.clone(), "./lib/main1.js", f.join("lib/main.js")), - ("should resolve in nested property 2", f.clone(), "./lib/main2.js", f.join("lib/browser.js")), - ("should check only alias field properties", f.clone(), "./toString", f.join("lib/toString.js")), - // not part of enhanced-resolve - ("recursion", f.clone(), "module-c", f.join("node_modules/module-c.js")), - ("resolve self 1", f.clone(), "./lib/main.js", f.join("lib/main.js")), - ("resolve self 2", f.clone(), "./main.js", f.join("lib/main.js")), - ]; - - for (comment, path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn recurse_fail() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - ("recurse non existent", f.clone(), "./lib/non-existent.js", ResolveError::NotFound("./lib/non-existent.js".into())), - ("path partial match 1", f.clone(), "./xyz.js", ResolveError::NotFound("./xyz.js".into())), - ("path partial match 2", f, "./lib/xyz.js", ResolveError::NotFound("./lib/xyz.js".into())), - ]; - - for (comment, path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Err(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn broken() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - // The browser field string value should be ignored - (f.clone(), "browser-module-broken", Ok(f.join("node_modules/browser-module-broken/main.js"))), - (f.join("browser-module"), "./number", Err(ResolveError::NotFound("./number".into()))), - ]; - - for (path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, expected, "{path:?} {request}"); - } -} - -#[test] -fn crypto_js() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - fallback: vec![( - "crypto".into(), - vec![AliasValue::from(f.join("lib.js").to_string_lossy())], - )], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(f.join("crypto-js"), "crypto").map(|r| r.full_path()); - assert_eq!(resolved_path, Err(ResolveError::Ignored(f.join("crypto-js")))); -} - -// https://github.com/webpack/webpack/blob/87660921808566ef3b8796f8df61bd79fc026108/test/cases/resolving/browser-field/index.js#L40-L43 -#[test] -fn recursive() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - let data = [ - ("should handle recursive file 1", f.clone(), "recursive-file/a"), - ("should handle recursive file 2", f.clone(), "recursive-file/b"), - ("should handle recursive file 3", f.clone(), "recursive-file/c"), - ("should handle recursive file 4", f, "recursive-file/d"), - ]; - - for (comment, path, request) in data { - let resolved_path = resolver.resolve(&path, request); - assert_eq!(resolved_path, Err(ResolveError::Recursion), "{comment} {path:?} {request}"); - } -} - -#[test] -fn with_query() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "./foo").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("lib").join("browser.js?query"))); -} diff --git a/src/tests/builtins.rs b/src/tests/builtins.rs deleted file mode 100644 index 5d6d14d9..00000000 --- a/src/tests/builtins.rs +++ /dev/null @@ -1,121 +0,0 @@ -use std::path::Path; - -use crate::{ResolveError, ResolveOptions, Resolver}; - -#[test] -fn builtins_off() { - let f = Path::new("/"); - let resolver = Resolver::default(); - let resolved_path = resolver.resolve(f, "zlib").map(|r| r.full_path()); - assert_eq!(resolved_path, Err(ResolveError::NotFound("zlib".into()))); -} - -#[test] -fn builtins() { - let f = Path::new("/"); - - let resolver = Resolver::new(ResolveOptions::default().with_builtin_modules(true)); - - let pass = [ - "_http_agent", - "_http_client", - "_http_common", - "_http_incoming", - "_http_outgoing", - "_http_server", - "_stream_duplex", - "_stream_passthrough", - "_stream_readable", - "_stream_transform", - "_stream_wrap", - "_stream_writable", - "_tls_common", - "_tls_wrap", - "assert", - "assert/strict", - "async_hooks", - "buffer", - "child_process", - "cluster", - "console", - "constants", - "crypto", - "dgram", - "diagnostics_channel", - "dns", - "dns/promises", - "domain", - "events", - "fs", - "fs/promises", - "http", - "http2", - "https", - "inspector", - "module", - "net", - "os", - "path", - "path/posix", - "path/win32", - "perf_hooks", - "process", - "punycode", - "querystring", - "readline", - "repl", - "stream", - "stream/consumers", - "stream/promises", - "stream/web", - "string_decoder", - "sys", - "timers", - "timers/promises", - "tls", - "trace_events", - "tty", - "url", - "util", - "util/types", - "v8", - "vm", - "worker_threads", - "zlib", - ]; - - for request in pass { - let prefixed_request = format!("node:{request}"); - for request in [prefixed_request.clone(), request.to_string()] { - let resolved_path = resolver.resolve(f, &request).map(|r| r.full_path()); - let err = ResolveError::Builtin(prefixed_request.clone()); - assert_eq!(resolved_path, Err(err), "{request}"); - } - } -} - -#[test] -fn fail() { - let f = Path::new("/"); - let resolver = Resolver::new(ResolveOptions::default().with_builtin_modules(true)); - let request = "xxx"; - let resolved_path = resolver.resolve(f, request); - let err = ResolveError::NotFound(request.to_string()); - assert_eq!(resolved_path, Err(err), "{request}"); -} - -#[test] -fn imports() { - let f = super::fixture().join("builtins"); - let resolver = Resolver::new(ResolveOptions { - builtin_modules: true, - condition_names: vec!["node".into()], - ..ResolveOptions::default() - }); - - for request in ["#fs", "#http"] { - let resolved_path = resolver.resolve(f.clone(), request).map(|r| r.full_path()); - let err = ResolveError::Builtin(format!("node:{}", request.trim_start_matches('#'))); - assert_eq!(resolved_path, Err(err)); - } -} diff --git a/src/tests/dependencies.rs b/src/tests/dependencies.rs deleted file mode 100644 index bcc2355b..00000000 --- a/src/tests/dependencies.rs +++ /dev/null @@ -1,110 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/dependencies.test.js - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows { - use rustc_hash::FxHashSet; - use std::path::PathBuf; - - use crate::{ResolveContext, ResolveOptions, ResolverGeneric}; - - use super::super::memory_fs::MemoryFS; - - fn file_system() -> MemoryFS { - MemoryFS::new(&[ - ("/a/b/node_modules/some-module/index.js", ""), - ("/a/node_modules/module/package.json", r#"{"main":"entry.js"}"#), - ("/a/node_modules/module/file.js", r#"{"main":"entry.js"}"#), - ("/modules/other-module/file.js", ""), - ]) - } - - #[test] - fn test() { - let file_system = file_system(); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - extensions: vec![".json".into(), ".js".into()], - modules: vec!["/modules".into(), "node_modules".into()], - ..ResolveOptions::default() - }, - ); - - let data = [ - ( - "middle module request", - "/a/b/c", - "module/file", - "/a/node_modules/module/file.js", - // These dependencies are different from enhanced-resolve due to different code path to - // querying the file system - vec![ - // 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", - // "/", - ], - vec![ - // missing package.jsons - // "/a/b/c/package.json", - "/a/b/package.json", - "/a/package.json", - "/package.json", - // missing modules directories - "/a/b/c", - // "/a/b/c/node_modules", - // missing single file modules - "/modules/module", - "/a/b/node_modules/module", - // missing files with alternative extensions - "/a/node_modules/module/file", - "/a/node_modules/module/file.json", - ], - ), - ( - "fast found module", - "/a/b/c", - "other-module/file.js", - "/modules/other-module/file.js", - // These dependencies are different from enhanced-resolve due to different code path to - // querying the file system - vec![ - // symlink checks - "/modules/other-module/file.js", - // "/modules/other-module", - // "/modules", - // "/", - ], - vec![ - // missing package.jsons - // "/a/b/c/package.json", - "/a/b/c", - "/a/b/package.json", - "/a/package.json", - "/package.json", - "/modules/other-module/package.json", - "/modules/package.json", - ], - ), - ]; - - for (name, context, request, result, file_dependencies, missing_dependencies) in data { - let mut ctx = ResolveContext::default(); - let path = PathBuf::from(context); - let resolved = - resolver.resolve_with_context(path, request, &mut ctx).map(|r| r.full_path()); - assert_eq!(resolved, Ok(PathBuf::from(result))); - let file_dependencies = - FxHashSet::from_iter(file_dependencies.iter().map(PathBuf::from)); - let missing_dependencies = - FxHashSet::from_iter(missing_dependencies.iter().map(PathBuf::from)); - assert_eq!(ctx.file_dependencies, file_dependencies, "{name}"); - assert_eq!(ctx.missing_dependencies, missing_dependencies, "{name}"); - } - } -} diff --git a/src/tests/exports_field.rs b/src/tests/exports_field.rs deleted file mode 100644 index fd68c1f7..00000000 --- a/src/tests/exports_field.rs +++ /dev/null @@ -1,2546 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/exportsField.test.js -//! -//! The huge exports field test cases are at the bottom of this file. - -use crate::{Ctx, PathUtil, ResolveError, ResolveOptions, Resolver}; -use serde_json::json; -use std::path::Path; - -#[test] -fn test_simple() { - let f = super::fixture().join("exports-field"); - let f2 = super::fixture().join("exports-field2"); - let f4 = super::fixture().join("exports-field-error"); - let f5 = super::fixture().join("imports-exports-wildcard"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - fully_specified: true, - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("resolve root using exports field, not a main field", f.clone(), "exports-field", f.join("node_modules/exports-field/x.js")), - ("resolver should respect condition names", f.clone(), "exports-field/dist/main.js", f.join("node_modules/exports-field/lib/lib2/main.js")), - // enhanced_resolve behaves differently to node.js. enhanced_resolve fallbacks when an - // array item is unresolved, where as node.js fallbacks when an array has an - // InvalidPackageTarget error. - // ("resolver should respect fallback", f2.clone(), "exports-field/dist/browser.js", f2.join("node_modules/exports-field/lib/browser.js")), - // The following two tests require fallback from array values, the path is changed here to - // only test query and fragment. - ("resolver should respect query parameters #1", f2.clone(), "exports-field/dist/main.js?foo", f2.join("node_modules/exports-field/lib/lib2/main.js?foo")), - ("resolver should respect fragment parameters #1", f2.clone(), "exports-field/dist/main.js#foo", f2.join("node_modules/exports-field/lib/lib2/main.js#foo")), - ("relative path should work, if relative path as request is used", f.clone(), "./node_modules/exports-field/lib/main.js", f.join("node_modules/exports-field/lib/main.js")), - ("self-resolving root", f.clone(), "@exports-field/core", f.join("a.js")), - ("should resolve with wildcard pattern #1", f5.clone(), "m/features/f.js", f5.join("node_modules/m/src/features/f.js")), - ("should resolve with wildcard pattern #2", f5.clone(), "m/features/y/y.js", f5.join("node_modules/m/src/features/y/y.js")), - ("should resolve with wildcard pattern #3", f5.clone(), "m/features-no-ext/y/y.js", f5.join("node_modules/m/src/features/y/y.js")), - ("should resolve with wildcard pattern #4", f5.clone(), "m/middle/nested/f.js", f5.join("node_modules/m/src/middle/nested/f.js")), - ("should resolve with wildcard pattern #5", f5.clone(), "m/middle-1/nested/f.js", f5.join("node_modules/m/src/middle-1/nested/f.js")), - ("should resolve with wildcard pattern #6", f5.clone(), "m/middle-2/nested/f.js", f5.join("node_modules/m/src/middle-2/nested/f.js")), - ("should resolve with wildcard pattern #7", f5.clone(), "m/middle-3/nested/f", f5.join("node_modules/m/src/middle-3/nested/f/nested/f.js")), - ("should resolve with wildcard pattern #8", f5.clone(), "m/middle-4/f/nested", f5.join("node_modules/m/src/middle-4/f/f.js")), - ("should resolve with wildcard pattern #9", f5.clone(), "m/middle-5/f$/$", f5.join("node_modules/m/src/middle-5/f$/$.js")), - ]; - - // Not needed or snapshot: - // * should log the correct info - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } - - let p = f.join("node_modules/exports-field/package.json"); - let p2 = f2.join("node_modules/exports-field/package.json"); - let p4 = f4.join("node_modules/exports-field/package.json"); - let p5 = f5.join("node_modules/m/package.json"); - - #[rustfmt::skip] - let fail = [ - // ("throw error if extension not provided", f2.clone(), "exports-field/dist/main", ResolveError::NotFound(f2.join("node_modules/exports-field/lib/lib2/main"))), - ("resolver should respect query parameters #2. Direct matching", f2.clone(), "exports-field?foo", ResolveError::PackagePathNotExported("./?foo".into(), p2.clone())), - ("resolver should respect fragment parameters #2. Direct matching", f2, "exports-field#foo", ResolveError::PackagePathNotExported("./#foo".into(), p2)), - ("relative path should not work with exports field", f.clone(), "./node_modules/exports-field/dist/main.js", ResolveError::NotFound("./node_modules/exports-field/dist/main.js".into())), - ("backtracking should not work for request", f.clone(), "exports-field/dist/../../../a.js", ResolveError::InvalidPackageTarget("./lib/../../../a.js".to_string(), "./dist/".to_string(), p.clone())), - ("backtracking should not work for exports field target", f.clone(), "exports-field/dist/a.js", ResolveError::InvalidPackageTarget("./../../a.js".to_string(), "./dist/a.js".to_string(), p.clone())), - ("not exported error", f.clone(), "exports-field/anything/else", ResolveError::PackagePathNotExported("./anything/else".to_string(), p.clone())), - ("request ending with slash #1", f.clone(), "exports-field/", ResolveError::PackagePathNotExported("./".to_string(), p.clone())), - ("request ending with slash #2", f.clone(), "exports-field/dist/", ResolveError::PackagePathNotExported("./dist/".to_string(), p.clone())), - ("request ending with slash #3", f.clone(), "exports-field/lib/", ResolveError::PackagePathNotExported("./lib/".to_string(), p)), - ("should throw error if target is invalid", f4, "exports-field", ResolveError::InvalidPackageTarget("./a/../b/../../pack1/index.js".to_string(), ".".to_string(), p4)), - ("throw error if exports field is invalid", f.clone(), "invalid-exports-field", ResolveError::InvalidPackageConfig(f.join("node_modules/invalid-exports-field/package.json"))), - ("should throw error if target is 'null'", f5, "m/features/internal/file.js", ResolveError::PackagePathNotExported("./features/internal/file.js".to_string(), p5)), - ]; - - for (comment, path, request, error) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!(resolution, Err(error), "{comment} {path:?} {request}"); - } -} - -// resolve using exports field, not a browser field #1 -#[test] -fn exports_not_browser_field1() { - let f = super::fixture().join("exports-field"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - condition_names: vec!["webpack".into()], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "exports-field/dist/main.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("node_modules/exports-field/lib/lib2/main.js"))); -} - -// resolve using exports field and a browser alias field #2 -#[test] -fn exports_not_browser_field2() { - let f2 = super::fixture().join("exports-field2"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - extensions: vec![".js".into()], - condition_names: vec!["node".into()], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f2, "exports-field/dist/main.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f2.join("node_modules/exports-field/lib/browser.js"))); -} - -// should resolve extension without fullySpecified -#[test] -fn extension_without_fully_specified() { - let f2 = super::fixture().join("exports-field2"); - - let commonjs_resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - let resolved_path = - commonjs_resolver.resolve(&f2, "exports-field/dist/main").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f2.join("node_modules/exports-field/lib/lib2/main.js"))); -} - -#[test] -fn field_name_path() { - let f2 = super::fixture().join("exports-field2"); - let f3 = super::fixture().join("exports-field3"); - - // field name path #1 #2 #3 - let exports_fields = [ - vec![vec!["exportsField".into(), "exports".into()]], - vec![vec!["exportsField".into(), "exports".into()], vec!["exports".into()]], - vec![vec!["exports".into()], vec!["exportsField".into(), "exports".into()]], - ]; - - for exports_fields in exports_fields { - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - exports_fields, - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/main.js"))); - } - - // field name path #4 - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - exports_fields: vec![vec!["exports".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f2, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f2.join("node_modules/exports-field/index.js"))); - - // field name path #5 - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - exports_fields: vec![vec!["ex".into()], vec!["exports_field".into(), "exports".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/index"))); - - // non-compliant export targeting a directory - let resolver = Resolver::new(ResolveOptions { - exports_fields: vec![vec!["broken".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/src/index.js"))); -} - -#[test] -fn shared_resolvers() { - let f3 = super::fixture().join("exports-field3"); - - let resolver1 = Resolver::new(ResolveOptions { - exports_fields: vec![vec!["exportsField".into(), "exports".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver1.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/main.js"))); - - let resolver2 = resolver1.clone_with_options(ResolveOptions { - exports_fields: vec![vec!["ex".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver2.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/index"))); -} - -#[test] -fn extension_alias_1_2() { - let f = super::fixture().join("exports-field-and-extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - extension_alias: vec![(".js".into(), vec![".ts".into(), ".js".into()])], - fully_specified: true, - condition_names: vec!["webpack".into(), "default".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve with the `extensionAlias` option", f.clone(), "@org/pkg/string.js", f.join("node_modules/@org/pkg/dist/string.js")), - ("should resolve with the `extensionAlias` option #2", f.clone(), "pkg/string.js", f.join("node_modules/pkg/dist/string.js")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn extension_alias_3() { - let f = super::fixture().join("exports-field-and-extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - extension_alias: vec![( - ".js".into(), - vec![".foo".into(), ".baz".into(), ".baz".into(), ".ts".into(), ".js".into()], - )], - fully_specified: true, - condition_names: vec!["webpack".into(), "default".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve with the `extensionAlias` option #3", f.clone(), "pkg/string.js", f.join("node_modules/pkg/dist/string.js")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn extension_alias_throw_error() { - let f = super::fixture().join("exports-field-and-extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - extension_alias: vec![(".js".into(), vec![".ts".into()])], - fully_specified: true, - condition_names: vec!["webpack".into(), "default".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let fail = [ - // enhanced-resolve has two test cases that are exactly the same here - // https://github.com/webpack/enhanced-resolve/blob/a998c7d218b7a9ec2461fc4fddd1ad5dd7687485/test/exportsField.test.js#L2976-L3024 - ("should throw error with the `extensionAlias` option", f, "pkg/string.js", ResolveError::ExtensionAlias), - // TODO: The error is PackagePathNotExported in enhanced-resolve - // ("should throw error with the `extensionAlias` option", f.clone(), "pkg/string.js", ResolveError::PackagePathNotExported("node_modules/pkg/dist/string.ts".to_string())), - ]; - - for (comment, path, request, error) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!(resolution, Err(error), "{comment} {path:?} {request}"); - } -} - -// Small script for generating the test cases from enhanced-resolve -// for (c of testCases) { -// console.log("TestCase {") -// console.log(`name: ${JSON.stringify(c.name)},`) -// if (c.expect instanceof Error) { -// console.log(`expect: None,`) -// } else { -// console.log(`expect: Some(vec!${JSON.stringify(c.expect)}),`) -// } -// console.log(`exports_field: exports_field(json!(${JSON.stringify(c.suite[0], null, 2)})),`) -// console.log(`request: "${c.suite[1]}",`) -// console.log(`condition_names: vec!${JSON.stringify(c.suite[2])},`) -// console.log("},") -//} -struct TestCase { - name: &'static str, - expect: Option>, - exports_field: serde_json::Value, - request: &'static str, - condition_names: Vec<&'static str>, -} - -#[allow(clippy::needless_pass_by_value)] -fn exports_field(value: serde_json::Value) -> serde_json::Value { - value -} - -#[test] -fn test_cases() { - let test_cases = [ - TestCase { - name: "sample #1", - expect: Some(vec!["./dist/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/": { - "import": [ - "./dist/", - "./src/" - ], - "webpack": "./wp/" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "sample #1", - expect: Some(vec!["./src/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/": { - "import": [ - "./src/" - ], - "webpack": "./wp/" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - TestCase { - name: "sample #1 (wildcard)", - expect: Some(vec!["./dist/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/*": { - "import": [ - "./dist/*", - "./src/*" - ], - "webpack": "./wp/*" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "sample #1 (wildcard)", - expect: Some(vec!["./src/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/*": { - "import": [ - "./src/*" - ], - "webpack": "./wp/*" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - TestCase { - name: "sample #2", - expect: Some(vec!["./data/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./timezones/": "./data/timezones/" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #2 (wildcard)", - expect: Some(vec!["./data/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./timezones/*": "./data/timezones/*" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #3", - expect: Some(vec!["./data/timezones/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./": "./data/timezones/" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #3 (wildcard)", - expect: Some(vec!["./data/timezones/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./*": "./data/timezones/*.mjs" - })), - request: "./timezones/pdt", - condition_names: vec![], - }, - TestCase { - name: "sample #4", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./lib/": { - "browser": [ - "./browser/" - ] - }, - "./dist/index.js": { - "node": "./index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #4 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "node": "./index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #5", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/": { - "browser": [ - "./browser/" - ] - }, - "./dist/index.js": { - "node": "./index.js", - "default": "./browser/index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #5 (wildcard)", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "node": "./index.js", - "default": "./browser/index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./dist/a": "./dist/index.js" - })), - request: "./dist/aaa", - condition_names: vec![], - }, - TestCase { - name: "sample #7", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./dist/a/a/": "./dist/index.js" - })), - request: "./dist/a/a", - condition_names: vec![], - }, - TestCase { - name: "sample #7 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./dist/a/a/*": "./dist/index.js" - })), - request: "./dist/a/a", - condition_names: vec![], - }, - TestCase { - name: "sample #8", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": "./index.js" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #9", - expect: Some(vec!["./main.js"]), - exports_field: exports_field(json!({ - "./index.js": "./main.js" - })), - request: "./index.js", - condition_names: vec![], - }, - TestCase { - name: "sample #10", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #11", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./bar#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #12", - expect: Some(vec!["./ok.js#abc"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/ok.js#abc", - condition_names: vec![], - }, - TestCase { - name: "sample #12", - expect: Some(vec!["./ok.js#abc"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/ok.js#abc", - condition_names: vec![], - }, - TestCase { - name: "sample #13", - expect: Some(vec!["./ok.js?abc"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/ok.js?abc", - condition_names: vec![], - }, - TestCase { - name: "sample #14", - expect: Some(vec!["./🎉.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/🎉.js", - condition_names: vec![], - }, - TestCase { - name: "sample #15", - expect: Some(vec!["./%F0%9F%8E%89.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/%F0%9F%8E%89.js", - condition_names: vec![], - }, - TestCase { - name: "sample #16", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./🎉", - condition_names: vec![], - }, - TestCase { - name: "sample #17", - expect: Some(vec!["./other.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./%F0%9F%8E%89", - condition_names: vec![], - }, - TestCase { - name: "sample #18", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./module", - condition_names: vec![], - }, - TestCase { - name: "sample #19", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./module#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #20", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./module?foo", - condition_names: vec![], - }, - TestCase { - name: "sample #21", - expect: Some(vec!["./zizizi"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./z*z*z*" - })), - request: "./#zippi", - condition_names: vec![], - }, - TestCase { - name: "sample #22", - expect: Some(vec!["./d?e?f"]), - exports_field: exports_field(json!({ - "./a?b?c/": "./" - })), - request: "./a?b?c/d?e?f", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #1", - expect: Some(vec!["./dist/index.js"]), - exports_field: exports_field(json!({ - ".": "./dist/index.js" - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #2", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./": "./", - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #3", - expect: Some(vec!["./dist/a.js"]), - exports_field: exports_field(json!({ - "./dist/": "./dist/", - "./dist/*": "./dist/*", - "./dist*": "./dist*", - "./dist/index.js": "./dist/a.js" - })), - request: "./dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #4", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./": { - "browser": [ - "./browser/" - ] - }, - "./*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "browser": "./index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #5", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./": { - "browser": [ - "./browser/" - ] - }, - "./*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "node": "./node.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #6", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - ".": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #7", - expect: Some(vec!["./src/index.js"]), // `enhanced_resolve` is `None` - exports_field: exports_field(json!({ - ".": { - "default": "./src/index.js", - "browser": "./index.js", - "node": "./src/node/index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #8", - expect: Some(vec!["./src/index.js"]), - exports_field: exports_field(json!({ - ".": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #9", - expect: Some(vec!["./index"]), - exports_field: exports_field(json!({ - ".": "./index" - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #10", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./index": "./index.js" - })), - request: "./index", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #11", - expect: Some(vec!["./foo.js"]), - exports_field: exports_field(json!({ - "./": "./", - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #12", - expect: Some(vec!["./foo/bar/baz.js"]), - exports_field: exports_field(json!({ - "./": "./", - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo/bar/baz.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #13", - expect: Some(vec!["./foo/bar/baz.js"]), - exports_field: exports_field(json!({ - "./": "./", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo/bar/baz.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #14", - expect: Some(vec!["./foo/bar/baz.js"]), - exports_field: exports_field(json!({ - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo/bar/baz.js", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #1", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "require": "./require.js" - }, { - "import": "./import.mjs" - }] - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #2", - expect: Some(vec!["./import.mjs"]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "require": "./require.js" - }, { - "import": "./import.mjs" - }] - })), - request: ".", - condition_names: vec!["import"], - }, - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./require.js"]), - exports_field: exports_field(json!({ - ".": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./import.mjs"]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "import": "./import.mjs" - }] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./require.js"]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "require": [ - "./require.js" - ] - }, { - "import": [ - "./import.mjs", - "./import.js" - ] - }] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./import.mjs"]), - exports_field: exports_field(json!({ - ".": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "./import.mjs", - "./import.js" - ] - } - ] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./import.js"]), - exports_field: exports_field(json!({ - ".": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "./import.js" - ] - } - ] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "mapping to a folder root #1", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./timezones": "./data/timezones/" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #2", - expect: None, - exports_field: exports_field(json!({ - "./timezones/": "./data/timezones" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #3", - expect: Some(vec!["./data/timezones/pdt/index.mjs"]), - exports_field: exports_field(json!({ - "./timezones/pdt/": "./data/timezones/pdt/" - })), - request: "./timezones/pdt/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #3 (wildcard)", - expect: Some(vec!["./data/timezones/pdt/index.mjs"]), - exports_field: exports_field(json!({ - "./timezones/pdt/*": "./data/timezones/pdt/*" - })), - request: "./timezones/pdt/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #4", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./": "./timezones/" - })), - request: "./pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #4 (wildcard)", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./*": "./timezones/*" - })), - request: "./pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #5", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./": "./" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #5 (wildcard)", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./*": "./*" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #6", - expect: None, - exports_field: exports_field(json!({ - "./": "." - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #6 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "./*": "." - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #7", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": "./" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #7 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": "./*" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #1", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./": "./", - "./dist/": "./lib/" - })), - request: "./dist/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #1 (wildcard)", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./*": "./*", - "./dist/*": "./lib/*" - })), - request: "./dist/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #2", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/": "./dist/utils/", - "./dist/": "./lib/" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #2 (wildcard)", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/*": "./dist/utils/*", - "./dist/*": "./lib/*" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #3", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/index.js": "./dist/utils/index.js", - "./dist/utils/": "./dist/utils/index.mjs", - "./dist/": "./lib/" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #3 (wildcard)", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/index.js": "./dist/utils/index.js", - "./dist/utils/*": "./dist/utils/index.mjs", - "./dist/*": "./lib/*" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #4", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./": { - "browser": "./browser/" - }, - "./dist/": "./lib/" - })), - request: "./dist/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "the longest matching path prefix is prioritized #4 (wildcard)", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./*": { - "browser": "./browser/*" - }, - "./dist/*": "./lib/*" - })), - request: "./dist/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #1", - // `lodash/` does not start with './' so fallbacks to util - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "conditional mapping folder #1", - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": [ - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #1 (wildcard)", - // `lodash/` does not start with './' so fallbacks to util - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": [ - "lodash/*", - "./utils/*" - ], - "node": [ - "./utils-node/*" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "conditional mapping folder #1 (wildcard)", - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": [ - "./utils/*" - ], - "node": [ - "./utils-node/*" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #2", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./node/" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "conditional mapping folder #2 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "webpack": "./wpk/*", - "browser": [ - "lodash/*", - "./utils/*" - ], - "node": [ - "./node/*" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "conditional mapping folder #3", - expect: Some(vec!["./wpk/index.mjs"]), - exports_field: exports_field(json!({ - "./utils/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils/" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "conditional mapping folder #3 (wildcard)", - expect: Some(vec!["./wpk/index.mjs"]), - exports_field: exports_field(json!({ - "./utils/*": { - "webpack": "./wpk/*", - "browser": [ - "lodash/*", - "./utils/*" - ], - "node": [ - "./utils/*" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "incorrect exports field #1", - expect: None, - exports_field: exports_field(json!({ - "/utils/": "./a/" - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #2", - expect: None, - exports_field: exports_field(json!({ - "./utils/": "/a/" - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #3", - expect: None, - exports_field: exports_field(json!({ - "/utils/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #4", - expect: None, - exports_field: exports_field(json!({ - "./utils/": { - "browser": "/a/", - "default": "/b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #4 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "/a/", - "default": "/b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #5", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index": "./a/index.js" - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index.mjs": "./a/index.js" - })), - request: "./utils/index", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #7", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #8", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index.mjs": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - // Requests that are not `./` does not apply to `package_exports_resolve` - // TestCase { - // name: "incorrect request #1", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": "./a/" - // })), - // request: "/utils/index.mjs", - // condition_names: vec![], - // }, - // TestCase { - // name: "incorrect request #2", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": { - // "browser": "./a/", - // "default": "./b/" - // } - // })), - // request: "/utils/index.mjs", - // condition_names: vec!["browser"], - // }, - // TestCase { - // name: "incorrect request #3", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": { - // "browser": "./a/", - // "default": "./b/" - // } - // })), - // request: "../utils/index.mjs", - // condition_names: vec!["browser"], - // }, - // TestCase { - // name: "incorrect request #4", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": { - // "browser": "./a/", - // "default": "./b/" - // } - // })), - // request: "/utils/index.mjs/", - // condition_names: vec!["browser"], - // }, - TestCase { - name: "backtracking package base #1", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./../../utils/": "./dist/" - })), - request: "./../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #1 (wildcard)", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./../../utils/*": "./dist/*" - })), - request: "./../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #2", - expect: None, - exports_field: exports_field(json!({ - "../../utils/": "./dist/" - })), - request: "../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #2 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "../../utils/*": "./dist/*" - })), - request: "../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #3", - expect: None, - exports_field: exports_field(json!({ - "./utils/": "../src/" - })), - request: "./utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #3 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "./utils/*": "../src/*" - })), - request: "./utils/index", - condition_names: vec![], - }, - // enhanced-resolve does not handle backtracking here - // TestCase { - // name: "backtracking package base #4", - // expect: Some(vec!["./../src/index"]), - // exports_field: exports_field(json!({ - // "./utils/": "./../src/" - // })), - // request: "./utils/index", - // condition_names: vec![], - // }, - // TestCase { - // name: "backtracking package base #4 (wildcard)", - // expect: Some(vec!["./../src/index"]), - // exports_field: exports_field(json!({ - // "./utils/*": "./../src/*" - // })), - // request: "./utils/index", - // condition_names: vec![], - // }, - // TestCase { - // name: "backtracking package base #5", - // expect: Some(vec!["./src/../index.js"]), - // exports_field: exports_field(json!({ - // "./utils/index": "./src/../index.js" - // })), - // request: "./utils/index", - // condition_names: vec![], - // }, - TestCase { - name: "backtracking package base #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/../utils/index": "./src/../index.js" - })), - request: "./utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #7", - expect: None, - exports_field: exports_field(json!({ - "./utils/": { - "browser": "../this/" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #7", - expect: None, - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "../this/*" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #8", - // We throw "InvalidPackageTarget" - // expect: Some(vec!["./utils/../index"]), - expect: None, - exports_field: exports_field(json!({ - "./utils/": { - "browser": "./utils/../" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #8 (wildcard)", - // We throw "InvalidPackageTarget" - // expect: Some(vec!["./utils/../index"]), - expect: None, - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "./utils/../*" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #9", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./": "./src/../../", - "./dist/": "./dist/" - })), - request: "./dist/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #9 (wildcard)", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./*": "./src/../../*", - "./dist/*": "./dist/*" - })), - request: "./dist/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking target folder #1", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../../index"]), - exports_field: exports_field(json!({ - "./utils/": "./dist/" - })), - request: "./utils/timezone/../../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #1 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../../index"]), - exports_field: exports_field(json!({ - "./utils/*": "./dist/*" - })), - request: "./utils/timezone/../../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #2", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../index"]), - exports_field: exports_field(json!({ - "./utils/": "./dist/" - })), - request: "./utils/timezone/../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #2 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../index"]), - exports_field: exports_field(json!({ - "./utils/*": "./dist/*" - })), - request: "./utils/timezone/../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #3", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/target/../../index"]), - exports_field: exports_field(json!({ - "./utils/": "./dist/target/" - })), - request: "./utils/../../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #3 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/target/../../index"]), - exports_field: exports_field(json!({ - "./utils/*": "./dist/target/*" - })), - request: "./utils/../../index", - condition_names: vec![], - }, - // enhanced-resolve does not handle `node_modules` in target - TestCase { - name: "nested node_modules path #1", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": "./node_modules/" - } - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #1 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "./node_modules/*" - } - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #2", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./utils/../node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/": "./utils/../node_modules/" - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "nested node_modules path #2 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./utils/../node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": "./utils/../node_modules/*" - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "nested mapping #1", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": "./", - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested mapping #1 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": "./*", - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "nested mapping #2 (wildcard)", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #2 (wildcard)", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "nested mapping #3", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["webpack"], - }, - TestCase { - name: "nested mapping #3 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["webpack"], - }, - TestCase { - name: "nested mapping #4", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["node", "browser"], - }, - TestCase { - name: "nested mapping #4 (wildcard)", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["node", "browser"], - }, - TestCase { - name: "nested mapping #5", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node"], - }, - TestCase { - name: "nested mapping #5 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": { - "webpack": [ - "./wpck/*" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node"], - }, - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - TestCase { - name: "nested mapping #6 (wildcard)", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": { - "webpack": [ - "./wpck/*" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #6 (wildcard)", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./node/*" - ], - "default": { - "node": { - "webpack": [ - "./wpck/*" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - TestCase { - name: "nested mapping #7", - expect: Some(vec!["./y.js"]), - exports_field: exports_field(json!({ - "./a.js": { - "abc": { - "def": "./x.js" - }, - "ghi": "./y.js" - } - })), - request: "./a.js", - condition_names: vec!["abc", "ghi"], - }, - TestCase { - name: "nested mapping #8", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./a.js": { - "abc": { - "def": "./x.js", - "default": [] - }, - "ghi": "./y.js" - } - })), - request: "./a.js", - condition_names: vec!["abc", "ghi"], - }, - TestCase { - name: "syntax sugar #1", - expect: Some(vec!["./main.js"]), - exports_field: exports_field(json!("./main.js")), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #2", - expect: Some(vec![]), - exports_field: exports_field(json!("./main.js")), - request: "./lib.js", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #3", - expect: Some(vec!["./a.js"]), - exports_field: exports_field(json!(["./a.js", "./b.js"])), - request: ".", - condition_names: vec![], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "syntax sugar #3", - expect: Some(vec!["./b.js"]), - exports_field: exports_field(json!(["./b.js"])), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #4", - expect: Some(vec![]), - exports_field: exports_field(json!(["./a.js", "./b.js"])), - request: "./lib.js", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #5", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "browser": { - "default": "./index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "syntax sugar #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "browser": { - "default": "./index.js" - } - })), - request: "./lib.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "syntax sugar #7", - expect: None, - exports_field: exports_field(json!({ - "./node": "./node.js", - "browser": { - "default": "./index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "syntax sugar #8", - expect: None, - exports_field: exports_field(json!({ - "browser": { - "default": "./index.js" - }, - "./node": "./node.js" - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #1", - expect: Some(vec!["./abc/d"]), - exports_field: exports_field(json!({ - "./ab*": "./ab/*", - "./abc*": "./abc/*", - "./a*": "./a/*" - })), - request: "./abcd", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #2", - expect: Some(vec!["./abc/d/e"]), - exports_field: exports_field(json!({ - "./ab*": "./ab/*", - "./abc*": "./abc/*", - "./a*": "./a/*" - })), - request: "./abcd/e", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #3", - expect: Some(vec!["./abc/d"]), - exports_field: exports_field(json!({ - "./x/ab*": "./ab/*", - "./x/abc*": "./abc/*", - "./x/a*": "./a/*" - })), - request: "./x/abcd", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #4", - expect: Some(vec!["./abc/d/e"]), - exports_field: exports_field(json!({ - "./x/ab*": "./ab/*", - "./x/abc*": "./abc/*", - "./x/a*": "./a/*" - })), - request: "./x/abcd/e", - condition_names: vec!["browser"], - }, - TestCase { - name: "path tree edge case #1", - expect: Some(vec!["./A/b/d.js"]), - exports_field: exports_field(json!({ - "./a/": "./A/", - "./a/b/c": "./c.js" - })), - request: "./a/b/d.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #1 (wildcard)", - expect: Some(vec!["./A/b/d.js"]), - exports_field: exports_field(json!({ - "./a/*": "./A/*", - "./a/b/c": "./c.js" - })), - request: "./a/b/d.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #2", - expect: Some(vec!["./A/c.js"]), - exports_field: exports_field(json!({ - "./a/": "./A/", - "./a/b": "./b.js" - })), - request: "./a/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #2 (wildcard)", - expect: Some(vec!["./A/c.js"]), - exports_field: exports_field(json!({ - "./a/*": "./A/*", - "./a/b": "./b.js" - })), - request: "./a/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #3", - expect: Some(vec!["./A/b/d/c.js"]), - exports_field: exports_field(json!({ - "./a/": "./A/", - "./a/b/c/d": "./c.js" - })), - request: "./a/b/d/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #3 (wildcard)", - expect: Some(vec!["./A/b/d/c.js"]), - exports_field: exports_field(json!({ - "./a/*": "./A/*", - "./a/b/c/d": "./c.js" - })), - request: "./a/b/d/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #1", - expect: Some(vec!["./A/b.js"]), - exports_field: exports_field(json!({ - "./a/*.js": "./A/*.js" - })), - request: "./a/b.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #2", - expect: Some(vec!["./A/b/c.js"]), - exports_field: exports_field(json!({ - "./a/*.js": "./A/*.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #3", - expect: Some(vec!["./A/b/c.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": "./A/*/c.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #4", - expect: Some(vec!["./A/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": "./A/*/*.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #5", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/*.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #5", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/*.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./lib/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #6", - expect: Some(vec!["./browser/foo/bar.js"]), - exports_field: exports_field(json!({ - "./lib/*/bar.js": { - "browser": [ - "./browser/*/bar.js" - ] - }, - "./dist/*/bar.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./lib/foo/bar.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #6", - expect: Some(vec!["./browser/foo.js"]), - exports_field: exports_field(json!({ - "./lib/*/bar.js": { - "browser": [ - "./browser/*/bar.js" - ] - }, - "./dist/*/bar.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./dist/foo/bar.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #7", - expect: Some(vec!["./browser/foo/default.js"]), - exports_field: exports_field(json!({ - "./lib/*/bar.js": { - "browser": [ - "./browser/*/bar.js" - ] - }, - "./dist/*/bar.js": { - "node": "./*.js", - "default": "./browser/*/default.js" - } - })), - request: "./dist/foo/bar.js", - condition_names: vec!["default"], - }, - TestCase { - name: "wildcard pattern #8", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": "./A/*/*/*.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #9", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": [ - "./A/*/*/*.js", - "./B/*/*/*.js" - ] - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "wildcard pattern #9", - expect: Some(vec!["./B/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": [ - "./B/*/*/*.js" - ] - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #10", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/foo-*/c.js": "./A/*/*/*.js" - })), - request: "./a/foo-b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #11", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*-foo/c.js": "./A/*/*/*.js" - })), - request: "./a/b-foo/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #12", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/foo-*-foo/c.js": "./A/*/*/*.js" - })), - request: "./a/foo-b-foo/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #13", - expect: Some(vec!["./A/b/c/d.js"]), - exports_field: exports_field(json!({ - "./a/foo-*-foo/c.js": "./A/b/c/d.js" - })), - request: "./a/foo-b-foo/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #14", - expect: Some(vec!["./A/b/c/*.js"]), - exports_field: exports_field(json!({ - "./a/foo-foo/c.js": "./A/b/c/*.js" - })), - request: "./a/foo-foo/c.js", - condition_names: vec![], - }, - ]; - - for case in test_cases { - let resolved = Resolver::new(ResolveOptions { - condition_names: case - .condition_names - .iter() - .map(ToString::to_string) - .collect::>(), - ..ResolveOptions::default() - }) - .package_exports_resolve( - Path::new(""), - case.request, - &case.exports_field, - &mut Ctx::default(), - ) - .map(|p| p.map(|p| p.to_path_buf())); - if let Some(expect) = case.expect { - if expect.is_empty() { - assert!( - matches!(resolved, Err(ResolveError::PackagePathNotExported(_, _))), - "{} {:?}", - &case.name, - &resolved - ); - } else { - for expect in expect { - assert_eq!(resolved, Ok(Some(Path::new(expect).normalize())), "{}", &case.name); - } - } - } else { - assert!(resolved.is_err(), "{} {resolved:?}", &case.name); - } - } -} diff --git a/src/tests/extension_alias.rs b/src/tests/extension_alias.rs deleted file mode 100644 index 86afab73..00000000 --- a/src/tests/extension_alias.rs +++ /dev/null @@ -1,66 +0,0 @@ -//! - -use crate::{ResolveError, ResolveOptions, Resolver}; - -#[test] -fn extension_alias() { - let f = super::fixture().join("extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - extension_alias: vec![ - (".js".into(), vec![".ts".into(), ".js".into()]), - (".mjs".into(), vec![".mts".into()]), - ], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should alias fully specified file", f.clone(), "./index.js", f.join("index.ts")), - ("should alias fully specified file when there are two alternatives", f.clone(), "./dir/index.js", f.join("dir/index.ts")), - ("should also allow the second alternative", f.clone(), "./dir2/index.js", f.join("dir2/index.js")), - ("should support alias option without an array", f.clone(), "./dir2/index.mjs", f.join("dir2/index.mts")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } - - #[rustfmt::skip] - let fail = [ - ("should not allow to fallback to the original extension or add extensions", f, "./index.mjs"), - ]; - - for (comment, path, request) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!(resolution, Err(ResolveError::ExtensionAlias), "{comment} {path:?} {request}"); - } -} - -// should not apply extension alias to extensions or mainFiles field -#[test] -fn not_apply_to_extension_nor_main_files() { - let f = super::fixture().join("extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - extension_alias: vec![(".js".into(), vec![])], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("directory", f.clone(), "./dir2", "dir2/index.js"), - ("file", f.clone(), "./dir2/index", "dir2/index.js"), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - let expected = f.join(expected); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} diff --git a/src/tests/extensions.rs b/src/tests/extensions.rs deleted file mode 100644 index 1ebd86f4..00000000 --- a/src/tests/extensions.rs +++ /dev/null @@ -1,125 +0,0 @@ -//! - -use crate::{EnforceExtension, Resolution, ResolveContext, ResolveError, ResolveOptions, Resolver}; -use rustc_hash::FxHashSet; - -#[test] -fn extensions() { - let f = super::fixture().join("extensions"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".ts".into(), ".js".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve according to order of provided extensions", "./foo", "foo.ts"), - ("should resolve according to order of provided extensions (dir index)", "./dir", "dir/index.ts"), - ("should resolve according to main field in module root", ".", "index.js"), - // This is a core module - // ("should resolve single file module before directory", "module", "node_modules/module.js"), - ("should resolve trailing slash directory before single file", "module/", "node_modules/module/index.ts"), - ]; - - for (comment, request, expected_path) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - let expected = f.join(expected_path); - assert_eq!(resolved_path, Ok(expected), "{comment} {request} {expected_path}"); - } - - #[rustfmt::skip] - let fail = [ - ("not resolve to file when request has a trailing slash (relative)", "./foo.js/", "./foo.js/".into()) - ]; - - for (comment, request, expected_error) in fail { - let resolution = resolver.resolve(&f, request); - let error = ResolveError::NotFound(expected_error); - assert_eq!(resolution, Err(error), "{comment} {request} {resolution:?}"); - } -} - -// should default enforceExtension to true when extensions includes an empty string -#[test] -fn default_enforce_extension() { - let f = super::fixture().join("extensions"); - - let mut ctx = ResolveContext::default(); - let resolved = Resolver::new(ResolveOptions { - extensions: vec![".ts".into(), String::new(), ".js".into()], - ..ResolveOptions::default() - }) - .resolve_with_context(&f, "./foo", &mut ctx); - - assert_eq!(resolved.map(Resolution::into_path_buf), Ok(f.join("foo.ts"))); - assert_eq!( - ctx.file_dependencies, - FxHashSet::from_iter([f.join("foo.ts"), f.join("package.json")]) - ); - assert!(ctx.missing_dependencies.is_empty()); -} - -// should respect enforceExtension when extensions includes an empty string -#[test] -fn respect_enforce_extension() { - let f = super::fixture().join("extensions"); - - let mut ctx = ResolveContext::default(); - let resolved = Resolver::new(ResolveOptions { - enforce_extension: EnforceExtension::Disabled, - extensions: vec![".ts".into(), String::new(), ".js".into()], - ..ResolveOptions::default() - }) - .resolve_with_context(&f, "./foo", &mut ctx); - - assert_eq!(resolved.map(Resolution::into_path_buf), Ok(f.join("foo.ts"))); - assert_eq!( - ctx.file_dependencies, - FxHashSet::from_iter([f.join("foo.ts"), f.join("package.json")]) - ); - assert_eq!(ctx.missing_dependencies, FxHashSet::from_iter([f.join("foo")])); -} - -#[test] -fn multi_dot_extension() { - let f = super::fixture().join("extensions"); - - let resolver = Resolver::new(ResolveOptions { - // Test for `.d.ts`, not part of enhanced-resolve. - extensions: vec![".a.b.c".into(), ".d.ts".into(), ".ts".into(), ".js".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve according to order of provided extensions", "./foo", "foo.ts"), - ("should resolve file with extension", "./app.module", "app.module.js") - ]; - - for (comment, request, expected_path) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - let expected = f.join(expected_path); - assert_eq!(resolved_path, Ok(expected), "{comment} {request} {expected_path}"); - } - - #[rustfmt::skip] - let fail = [ - ("not resolve to file", "./index.", "./index.".into()) - ]; - - for (comment, request, expected_error) in fail { - let resolution = resolver.resolve(&f, request); - let error = ResolveError::NotFound(expected_error); - assert_eq!(resolution, Err(error), "{comment} {request} {resolution:?}"); - } -} - -#[test] -#[should_panic = "All extensions must start with a leading dot"] -fn without_leading_dot() { - Resolver::new(ResolveOptions { - extensions: vec!["ts".into(), "js".into()], - ..ResolveOptions::default() - }); -} diff --git a/src/tests/fallback.rs b/src/tests/fallback.rs deleted file mode 100644 index 3da2d767..00000000 --- a/src/tests/fallback.rs +++ /dev/null @@ -1,100 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/fallback.test.js - -#[test] -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -fn fallback() { - use super::memory_fs::MemoryFS; - use crate::{AliasValue, ResolveError, ResolveOptions, ResolverGeneric}; - use std::path::{Path, PathBuf}; - - let f = Path::new("/"); - - let file_system = MemoryFS::new(&[ - ("/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", ""), - ]); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - fallback: vec![ - ("aliasA".into(), vec![AliasValue::Path("a".into())]), - ("b$".into(), vec![AliasValue::Path("a/index".into())]), - ("c$".into(), vec![AliasValue::Path("/a/index".into())]), - ( - "multiAlias".into(), - vec![ - AliasValue::Path("b".into()), - AliasValue::Path("c".into()), - AliasValue::Path("d".into()), - AliasValue::Path("e".into()), - AliasValue::Path("a".into()), - ], - ), - ("recursive".into(), vec![AliasValue::Path("recursive/dir".into())]), - ("/d/dir".into(), vec![AliasValue::Path("/c/dir".into())]), - ("/d/index.js".into(), vec![AliasValue::Path("/c/index".into())]), - ("ignored".into(), vec![AliasValue::Ignore]), - ("node:path".into(), vec![AliasValue::Ignore]), - ], - modules: vec!["/".into()], - ..ResolveOptions::default() - }, - ); - - #[rustfmt::skip] - let pass = [ - ("should resolve a not aliased module 1", "a", "/a/index"), - ("should resolve a not aliased module 2", "a/index", "/a/index"), - ("should resolve a not aliased module 3", "a/dir", "/a/dir/index"), - ("should resolve a not aliased module 4", "a/dir/index", "/a/dir/index"), - ("should resolve an fallback module 1", "aliasA", "/a/index"), - ("should resolve an fallback module 2", "aliasA/index", "/a/index"), - ("should resolve an fallback module 3", "aliasA/dir", "/a/dir/index"), - ("should resolve an fallback module 4", "aliasA/dir/index", "/a/dir/index"), - ("should resolve a recursive aliased module 1", "recursive", "/recursive/index"), - ("should resolve a recursive aliased module 2", "recursive/index", "/recursive/index"), - ("should resolve a recursive aliased module 3", "recursive/dir", "/recursive/dir/index"), - ("should resolve a recursive aliased module 4", "recursive/dir/index", "/recursive/dir/index"), - ("should resolve a recursive aliased module 5", "recursive/file", "/recursive/dir/file"), - ("should resolve a file aliased module with a query 1", "b?query", "/b/index?query"), - ("should resolve a file aliased module with a query 2", "c?query", "/c/index?query"), - ("should resolve a path in a file aliased module 1", "b/index", "/b/index"), - ("should resolve a path in a file aliased module 2", "b/dir", "/b/dir/index"), - ("should resolve a path in a file aliased module 3", "b/dir/index", "/b/dir/index"), - ("should resolve a path in a file aliased module 4", "c/index", "/c/index"), - ("should resolve a path in a file aliased module 5", "c/dir", "/c/dir/index"), - ("should resolve a path in a file aliased module 6", "c/dir/index", "/c/dir/index"), - ("should resolve a file in multiple aliased dirs 1", "multiAlias/dir/file", "/e/dir/file"), - ("should resolve a file in multiple aliased dirs 2", "multiAlias/anotherDir", "/e/anotherDir/index"), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - - #[rustfmt::skip] - let ignore = [ - ("should resolve an ignore module", "ignored", ResolveError::Ignored(f.join("ignored"))), - ("should resolve node: builtin module", "node:path", ResolveError::Ignored(PathBuf::from("/node:path"))), - ]; - - for (comment, request, expected) in ignore { - let resolution = resolver.resolve(f, request); - assert_eq!(resolution, Err(expected), "{comment} {request}"); - } -} diff --git a/src/tests/full_specified.rs b/src/tests/full_specified.rs deleted file mode 100644 index a70c0191..00000000 --- a/src/tests/full_specified.rs +++ /dev/null @@ -1,113 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/fullSpecified.test.js - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows { - use std::path::PathBuf; - - use crate::{AliasValue, ResolveOptions, ResolverGeneric}; - - use super::super::memory_fs::MemoryFS; - - fn file_system() -> MemoryFS { - MemoryFS::new(&[ - ("/a/node_modules/package1/index.js", ""), - ("/a/node_modules/package1/file.js", ""), - ("/a/node_modules/package2/package.json", r#"{"main":"a"}"#), - ("/a/node_modules/package2/a.js", ""), - ("/a/node_modules/package3/package.json", r#"{"main":"dir"}"#), - ("/a/node_modules/package3/dir/index.js", ""), - ("/a/node_modules/package4/package.json", r#"{"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", ""), - ]) - } - - #[test] - fn test() { - let file_system = file_system(); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - alias: vec![ - ("alias1".into(), vec![AliasValue::from("/a/abc")]), - ("alias2".into(), vec![AliasValue::from("/a")]), - ], - alias_fields: vec![vec!["browser".into()]], - fully_specified: true, - ..ResolveOptions::default() - }, - ); - - let failing_resolves = [ - ("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"), - ]; - - for (comment, request) in failing_resolves { - let resolution = resolver.resolve("/a", request); - assert!(resolution.is_err(), "{comment} {request}"); - } - - let successful_resolves = [ - ("fully relative", "./abc.js", "/a/abc.js"), - ("fully absolute", "/a/abc.js", "/a/abc.js"), - ("fully relative in package", "package1/file.js", "/a/node_modules/package1/file.js"), - ("extensions in mainFiles", "package1", "/a/node_modules/package1/index.js"), - ("extensions in mainFields", "package2", "/a/node_modules/package2/a.js"), - ("extensions in alias", "alias1", "/a/abc.js"), - ("directories in alias", "alias2", "/a/index.js"), - ("directories in packages", "package3", "/a/node_modules/package3/dir/index.js"), - ("extensions in aliasFields", "package4/a.js", "/a/node_modules/package4/b.js"), - ]; - - for (comment, request, expected) in successful_resolves { - let resolution = resolver.resolve("/a", request).map(|r| r.full_path()); - assert_eq!(resolution, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - } - - #[test] - #[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. - fn resolve_to_context() { - let file_system = file_system(); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - alias: vec![ - ("alias1".into(), vec![AliasValue::from("/a/abc")]), - ("alias2".into(), vec![AliasValue::from("/a")]), - ], - alias_fields: vec![vec!["browser".into()]], - fully_specified: true, - resolve_to_context: true, - ..ResolveOptions::default() - }, - ); - - let successful_resolves = [ - ("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", "/a/node_modules/package3/dir"), - ]; - - for (comment, request, expected) in successful_resolves { - let resolution = resolver.resolve("/a", request).map(|r| r.full_path()); - assert_eq!(resolution, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - } -} diff --git a/src/tests/imports_field.rs b/src/tests/imports_field.rs deleted file mode 100644 index c928627a..00000000 --- a/src/tests/imports_field.rs +++ /dev/null @@ -1,1320 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/importsField.test.js -//! -//! The huge imports field test cases are at the bottom of this file. - -use serde_json::json; - -use crate::{Ctx, JSONMap, PathUtil, ResolveError, ResolveOptions, Resolver}; -use std::path::Path; - -#[test] -fn test_simple() { - let f = super::fixture().join("imports-field"); - let f2 = super::fixture().join("imports-exports-wildcard/node_modules/m/"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve using imports field instead of self-referencing", f.clone(), "#imports-field", f.join("b.js")), - ("should resolve using imports field instead of self-referencing for a subpath", f.join("dir"), "#imports-field", f.join("b.js")), - ("should resolve package #1", f.clone(), "#a/dist/main.js", f.join("node_modules/a/lib/lib2/main.js")), - ("should resolve package #3", f.clone(), "#ccc/index.js", f.join("node_modules/c/index.js")), - ("should resolve package #4", f.clone(), "#c", f.join("node_modules/c/index.js")), - ("should resolve with wildcard pattern", f2.clone(), "#internal/i.js", f2.join("src/internal/i.js")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } - - // Note added: - // * should resolve absolute path as an imports field target - // * should log the correct info - - #[rustfmt::skip] - let fail = [ - ("should disallow resolve out of package scope", f.clone(), "#b", ResolveError::InvalidPackageTarget("../b.js".to_string(), "#b".to_string(), f.join("package.json"))), - ("should resolve package #2", f.clone(), "#a", ResolveError::PackageImportNotDefined("#a".to_string(), f.join("package.json"))), - ]; - - for (comment, path, request, error) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!(resolution, Err(error), "{comment} {path:?} {request}"); - } -} - -#[test] -fn shared_resolvers() { - let f = super::fixture().join("imports-field"); - - // field name #1 - let resolver1 = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - imports_fields: vec![vec!["imports".into()]], - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - let resolved_path = resolver1.resolve(&f, "#imports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("b.js"))); - - // field name #2 - let resolver2 = resolver1.clone_with_options(ResolveOptions { - imports_fields: vec![vec!["other".into(), "imports".into()]], - ..ResolveOptions::default() - }); - - let resolved_path = resolver2.resolve(&f, "#b").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("a.js"))); -} - -// Small script for generating the test cases from enhanced_resolve -// for (c of testCases) { -// console.log("TestCase {") -// console.log(`name: ${JSON.stringify(c.name)},`) -// if (c.expect instanceof Error) { -// console.log(`expect: None,`) -// } else { -// console.log(`expect: Some(vec!${JSON.stringify(c.expect)}),`) -// } -// console.log(`imports_field: imports_field(json!(${JSON.stringify(c.suite[0], null, 2)})),`) -// console.log(`request: "${c.suite[1]}",`) -// console.log(`condition_names: vec!${JSON.stringify(c.suite[2])},`) -// console.log("},") -// } - -struct TestCase { - name: &'static str, - expect: Option>, - imports_field: JSONMap, - request: &'static str, - condition_names: Vec<&'static str>, -} - -#[allow(clippy::needless_pass_by_value)] -fn imports_field(value: serde_json::Value) -> JSONMap { - let s = serde_json::to_string(&value).unwrap(); - serde_json::from_str(&s).unwrap() -} - -#[test] -fn test_cases() { - let test_cases = [ - TestCase { - name: "sample #1", - expect: Some(vec!["./dist/test/file.js"]), - imports_field: imports_field(json!({ - "#abc/": { - "import": [ - "./dist/", - "./src/" - ], - "webpack": "./wp/" - }, - "#abc": "./main.js" - })), - request: "#abc/test/file.js", - condition_names: vec!["import", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "sample #1", - expect: Some(vec!["./src/test/file.js"]), - imports_field: imports_field(json!({ - "#abc/": { - "import": [ - "./src/" - ], - "webpack": "./wp/" - }, - "#abc": "./main.js" - })), - request: "#abc/test/file.js", - condition_names: vec!["import", "webpack"], - }, - TestCase { - name: "sample #2", - expect: Some(vec!["./data/timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#1/timezones/": "./data/timezones/" - })), - request: "#1/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #3", - expect: Some(vec!["./data/timezones/timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#aaa/": "./data/timezones/", - "#a/": "./data/timezones/" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #4", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/lib/": { - "browser": [ - "./browser/" - ] - }, - "#a/dist/index.js": { - "node": "./index.js" - } - })), - request: "#a/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #5", - expect: Some(vec!["./browser/index.js"]), - imports_field: imports_field(json!({ - "#a/lib/": { - "browser": [ - "./browser/" - ] - }, - "#a/dist/index.js": { - "node": "./index.js", - "default": "./browser/index.js" - } - })), - request: "#a/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #6", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/dist/a": "./dist/index.js" - })), - request: "#a/dist/aaa", - condition_names: vec![], - }, - TestCase { - name: "sample #7", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/a/a/": "./dist/index.js" - })), - request: "#a/a/a", - condition_names: vec![], - }, - TestCase { - name: "sample #8", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": "./index.js" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #9", - expect: Some(vec!["./main.js"]), - imports_field: imports_field(json!({ - "#a/index.js": "./main.js" - })), - request: "#a/index.js", - condition_names: vec![], - }, - TestCase { - name: "sample #10", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #11", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/bar#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #12", - expect: Some(vec!["./ok.js#abc"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/ok.js#abc", - condition_names: vec![], - }, - TestCase { - name: "sample #13", - expect: Some(vec!["./ok.js?abc"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/ok.js?abc", - condition_names: vec![], - }, - TestCase { - name: "sample #14", - expect: Some(vec!["./🎉.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/🎉.js", - condition_names: vec![], - }, - TestCase { - name: "sample #15", - expect: Some(vec!["./%F0%9F%8E%89.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/%F0%9F%8E%89.js", - condition_names: vec![], - }, - TestCase { - name: "sample #16", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/🎉", - condition_names: vec![], - }, - TestCase { - name: "sample #17", - expect: Some(vec!["./other.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/%F0%9F%8E%89", - condition_names: vec![], - }, - TestCase { - name: "sample #18", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/module", - condition_names: vec![], - }, - TestCase { - name: "sample #19", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/module#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #20", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/module?foo", - condition_names: vec![], - }, - TestCase { - name: "sample #21", - expect: Some(vec!["./d?e?f"]), - imports_field: imports_field(json!({ - "#a/a?b?c/": "./" - })), - request: "#a/a?b?c/d?e?f", - condition_names: vec![], - }, - TestCase { - name: "sample #22", - // We throw InvalidPackageTarget - expect: None, - // expect: Some(vec!["/user/a/index"]), - imports_field: imports_field(json!({ - "#a/": "/user/a/" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #1", - expect: Some(vec!["./A/b/d.js"]), - imports_field: imports_field(json!({ - "#a/": "./A/", - "#a/b/c": "./c.js" - })), - request: "#a/b/d.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #2", - expect: Some(vec!["./A/c.js"]), - imports_field: imports_field(json!({ - "#a/": "./A/", - "#a/b": "./b.js" - })), - request: "#a/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #3", - expect: Some(vec!["./A/b/c/d.js"]), - imports_field: imports_field(json!({ - "#a/": "./A/", - "#a/b/c/d": "./c.js" - })), - request: "#a/b/c/d.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #1", - expect: Some(vec!["./dist/index.js"]), - imports_field: imports_field(json!({ - "#a": "./dist/index.js" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #2", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": "./" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #3", - expect: Some(vec!["./dist/a.js"]), - imports_field: imports_field(json!({ - "#a/": "./dist/", - "#a/index.js": "./dist/a.js" - })), - request: "#a/index.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #4", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "./browser/" - ] - }, - "#a/index.js": { - "browser": "./index.js" - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #5", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "./browser/" - ] - }, - "#a/index.js": { - "node": "./node.js" - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #6", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: "#a", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #7", - expect: Some(vec!["./src/index.js"]), // `enhanced_resolve` is `None` - imports_field: imports_field(json!({ - "#a": { - "default": "./src/index.js", - "browser": "./index.js", - "node": "./src/node/index.js" - } - })), - request: "#a", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #8", - expect: Some(vec!["./src/index.js"]), - imports_field: imports_field(json!({ - "#a": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #9", - expect: Some(vec!["./index"]), - imports_field: imports_field(json!({ - "#a": "./index" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #10", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/index": "./index.js" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #11", - // We throw InvalidPackageTarget - // expect: Some(vec!["b"]), - expect: None, - imports_field: imports_field(json!({ - "#a": "b" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #12", - // We throw InvalidPackageTarget - // expect: Some(vec!["b/index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "b/" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #13", - // We throw InvalidPackageTarget - // expect: Some(vec!["b#anotherhashishere"]), - expect: None, - imports_field: imports_field(json!({ - "#a?q=a#hashishere": "b#anotherhashishere" - })), - request: "#a?q=a#hashishere", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #1", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #2", - expect: Some(vec!["./import.mjs"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec!["import"], - }, - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./require.js"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./import.mjs"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./require.js"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": [ - "./require.js" - ] - }, - { - "import": [ - "./import.mjs", - "#b/import.js" - ] - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./import.mjs"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "./import.mjs", - "#b/import.js" - ] - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "#b/import.js" - ] - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "mapping to a folder root #1", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#timezones": "./data/timezones/" - })), - request: "#timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #2", - expect: None, - imports_field: imports_field(json!({ - "#timezones/": "./data/timezones" - })), - request: "#timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #3", - expect: Some(vec!["./data/timezones/pdt/index.mjs"]), - imports_field: imports_field(json!({ - "#timezones/pdt/": "./data/timezones/pdt/" - })), - request: "#timezones/pdt/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #4", - expect: Some(vec!["./timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#a/": "./timezones/" - })), - request: "#a/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #5", - expect: Some(vec!["./timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#a/": "./" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #6", - expect: None, - imports_field: imports_field(json!({ - "#a/": "." - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #7", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": "./" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #1", - expect: Some(vec!["./lib/index.mjs"]), - imports_field: imports_field(json!({ - "#a/": "./", - "#a/dist/": "./lib/" - })), - request: "#a/dist/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #2", - expect: Some(vec!["./dist/utils/index.js"]), - imports_field: imports_field(json!({ - "#a/dist/utils/": "./dist/utils/", - "#a/dist/": "./lib/" - })), - request: "#a/dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #3", - expect: Some(vec!["./dist/utils/index.js"]), - imports_field: imports_field(json!({ - "#a/dist/utils/index.js": "./dist/utils/index.js", - "#a/dist/utils/": "./dist/utils/index.mjs", - "#a/dist/": "./lib/" - })), - request: "#a/dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #4", - expect: Some(vec!["./lib/index.mjs"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./browser/" - }, - "#a/dist/": "./lib/" - })), - request: "#a/dist/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #1", - // This behaves differently from enhanced_resolve, because `lodash/` is an an InvalidPackageConfig - // expect: Some(vec!["lodash/index.js"]), - expect: Some(vec!["./utils/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "conditional mapping folder #1", - expect: Some(vec!["./utils/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #2", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./node/" - ] - } - })), - request: "#a/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "conditional mapping folder #3", - expect: Some(vec!["./wpk/index.mjs"]), - imports_field: imports_field(json!({ - "#a/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils/" - ] - } - })), - request: "#a/index.mjs", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "incorrect exports field #1", - // We throw `PackageImportNotDefined` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "/utils/": "./a/" - })), - request: "#a/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #2", - // We throw `PackageImportNotDefined` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "/utils/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#a/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #3", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index": "./a/index.js" - })), - request: "#a/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #4", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index.mjs": "./a/index.js" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #5", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "#a/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #6", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index.mjs": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "#a/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #1", - // We don't throw in `package_imports_exports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": "./a/" - })), - request: "/utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect request #2", - // We don't throw in `package_imports_exports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #3", - // We don't throw in `package_imports_exports_resolve`, it's thrown in `package_imports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #4", - // We don't throw in `package_imports_exports_resolve`, it's thrown in `package_imports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#/", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #5", - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#a/", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #1", - // expect: Some(vec!["./dist/index"]), - expect: Some(vec!["dist/index"]), - imports_field: imports_field(json!({ - "#a/../../utils/": "./dist/" - })), - request: "#a/../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #2", - // We throw InvalidPackageTarget - // expect: Some(vec!["./dist/../../utils/index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "./dist/" - })), - request: "#a/../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #3", - // We throw InvalidPackageTarget - // expect: Some(vec!["../src/index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "../src/" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #4", - // We throw InvalidPackageTarget - // expect: Some(vec!["./utils/../../../index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": { - "browser": "./utils/../../../" - } - })), - request: "#a/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #1", - // expect: Some(vec!["moment/node_modules/lodash/dist/index.js"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": { - "browser": "moment/node_modules/" - } - })), - request: "#a/lodash/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #2", - // We throw InvalidPackageTarget - // expect: Some(vec!["../node_modules/lodash/dist/index.js"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "../node_modules/" - })), - request: "#a/lodash/dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "nested mapping #1", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": "./", - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./node/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "nested mapping #3", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["webpack"], - }, - TestCase { - name: "nested mapping #4", - // We throw NotFound - // expect: Some(vec!["moment/node/index.js"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "moment/node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["node", "browser"], - }, - TestCase { - name: "nested mapping #5", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "node"], - }, - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./node/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - TestCase { - name: "nested mapping #7", - expect: Some(vec!["./y.js"]), - imports_field: imports_field(json!({ - "#a": { - "abc": { - "def": "./x.js" - }, - "ghi": "./y.js" - } - })), - request: "#a", - condition_names: vec!["abc", "ghi"], - }, - TestCase { - name: "nested mapping #8", - // We throw PackageImportNotDefined - // expect: Some(vec![]), - expect: None, - imports_field: imports_field(json!({ - "#a": { - "abc": { - "def": "./x.js", - "default": [] - }, - "ghi": "./y.js" - } - })), - request: "#a", - condition_names: vec!["abc", "ghi"], - }, - ]; - - for case in test_cases { - let resolved = Resolver::default() - .package_imports_exports_resolve( - case.request, - &case.imports_field, - Path::new(""), - true, - &case.condition_names.iter().map(ToString::to_string).collect::>(), - &mut Ctx::default(), - ) - .map(|p| p.map(|p| p.to_path_buf())); - if let Some(expect) = case.expect { - if expect.is_empty() { - assert!(matches!(resolved, Ok(None)), "{} {:?}", &case.name, &resolved); - } else { - for expect in expect { - assert_eq!(resolved, Ok(Some(Path::new(expect).normalize())), "{}", &case.name); - } - } - } else { - assert!(resolved.is_err(), "{} {resolved:?}", &case.name); - } - } -} diff --git a/src/tests/incorrect_description_file.rs b/src/tests/incorrect_description_file.rs deleted file mode 100644 index a5c81796..00000000 --- a/src/tests/incorrect_description_file.rs +++ /dev/null @@ -1,62 +0,0 @@ -//! - -use rustc_hash::FxHashSet; - -use crate::{JSONError, Resolution, ResolveContext, ResolveError, ResolveOptions, Resolver}; - -// should not resolve main in incorrect description file #1 -#[test] -fn incorrect_description_file_1() { - let f = super::fixture().join("incorrect-package"); - let mut ctx = ResolveContext::default(); - let resolution = Resolver::default().resolve_with_context(f.join("pack1"), ".", &mut ctx); - let error = ResolveError::JSON(JSONError { - path: f.join("pack1/package.json"), - message: String::from("EOF while parsing a value at line 3 column 0"), - line: 3, - column: 0, - }); - assert_eq!(resolution, Err(error)); - assert_eq!(ctx.file_dependencies, FxHashSet::from_iter([f.join("pack1/package.json")])); - assert!(ctx.missing_dependencies.is_empty()); -} - -// should not resolve main in incorrect description file #2 -#[test] -fn incorrect_description_file_2() { - let f = super::fixture().join("incorrect-package"); - let resolution = Resolver::default().resolve(f.join("pack2"), "."); - let error = ResolveError::JSON(JSONError { - path: f.join("pack2/package.json"), - message: String::from("EOF while parsing a value at line 1 column 0"), - line: 1, - column: 0, - }); - assert_eq!(resolution, Err(error)); -} - -// should not resolve main in incorrect description file #3 -#[test] -fn incorrect_description_file_3() { - let f = super::fixture().join("incorrect-package"); - let resolution = Resolver::default().resolve(f.join("pack2"), "."); - assert!(resolution.is_err()); -} - -// `enhanced_resolve` does not have this test case -#[test] -fn no_description_file() { - let f = super::fixture_root().join("enhanced_resolve"); - - // has description file - let resolver = Resolver::default(); - assert_eq!( - resolver.resolve(&f, ".").map(Resolution::into_path_buf), - Ok(f.join("lib/index.js")) - ); - - // without description file - let resolver = - Resolver::new(ResolveOptions { description_files: vec![], ..ResolveOptions::default() }); - assert_eq!(resolver.resolve(&f, "."), Err(ResolveError::NotFound(".".into()))); -} diff --git a/src/tests/main_field.rs b/src/tests/main_field.rs deleted file mode 100644 index 3cadc8ce..00000000 --- a/src/tests/main_field.rs +++ /dev/null @@ -1,24 +0,0 @@ -//! Not part of enhanced_resolve's test suite - -use crate::{ResolveOptions, Resolver}; - -#[test] -fn test() { - let f = super::fixture().join("restrictions"); - - let resolver1 = Resolver::new(ResolveOptions { - main_fields: vec!["style".into()], - ..ResolveOptions::default() - }); - - let resolution = resolver1.resolve(&f, "pck2").map(|r| r.full_path()); - assert_eq!(resolution, Ok(f.join("node_modules/pck2/index.css"))); - - let resolver2 = resolver1.clone_with_options(ResolveOptions { - main_fields: vec!["module".into(), "main".into()], - ..ResolveOptions::default() - }); - - let resolution = resolver2.resolve(&f, "pck2").map(|r| r.full_path()); - assert_eq!(resolution, Ok(f.join("node_modules/pck2/module.js"))); -} diff --git a/src/tests/memory_fs.rs b/src/tests/memory_fs.rs deleted file mode 100644 index e4116609..00000000 --- a/src/tests/memory_fs.rs +++ /dev/null @@ -1,74 +0,0 @@ -use std::{ - io, - path::{Path, PathBuf}, -}; - -use crate::{FileMetadata, FileSystem}; - -#[derive(Default)] -pub struct MemoryFS { - fs: vfs::MemoryFS, -} - -impl MemoryFS { - /// # Panics - /// - /// * Fails to create directory - /// * Fails to write file - #[allow(dead_code)] - pub fn new(data: &[(&'static str, &'static str)]) -> Self { - let mut fs = Self { fs: vfs::MemoryFS::default() }; - for (path, content) in data { - fs.add_file(Path::new(path), content); - } - fs - } - - #[allow(dead_code)] - pub fn add_file(&mut self, path: &Path, content: &str) { - use vfs::FileSystem; - let fs = &mut self.fs; - // Create all parent directories - for path in path.ancestors().collect::>().iter().rev() { - let path = path.to_string_lossy(); - if !fs.exists(path.as_ref()).unwrap() { - fs.create_dir(path.as_ref()).unwrap(); - } - } - // Create file - let mut file = fs.create_file(path.to_string_lossy().as_ref()).unwrap(); - file.write_all(content.as_bytes()).unwrap(); - } -} - -impl FileSystem for MemoryFS { - fn read_to_string(&self, path: &Path) -> io::Result { - use vfs::FileSystem; - let mut file = self - .fs - .open_file(path.to_string_lossy().as_ref()) - .map_err(|err| io::Error::new(io::ErrorKind::NotFound, err))?; - let mut buffer = String::new(); - file.read_to_string(&mut buffer).unwrap(); - Ok(buffer) - } - - fn metadata(&self, path: &Path) -> io::Result { - use vfs::FileSystem; - let metadata = self - .fs - .metadata(path.to_string_lossy().as_ref()) - .map_err(|err| io::Error::new(io::ErrorKind::NotFound, err))?; - let is_file = metadata.file_type == vfs::VfsFileType::File; - let is_dir = metadata.file_type == vfs::VfsFileType::Directory; - Ok(FileMetadata::new(is_file, is_dir, false)) - } - - fn symlink_metadata(&self, path: &Path) -> io::Result { - self.metadata(path) - } - - fn canonicalize(&self, _path: &Path) -> io::Result { - Err(io::Error::new(io::ErrorKind::NotFound, "not a symlink")) - } -} diff --git a/src/tests/missing.rs b/src/tests/missing.rs deleted file mode 100644 index 4bf611ef..00000000 --- a/src/tests/missing.rs +++ /dev/null @@ -1,106 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/missing.test.js - -use normalize_path::NormalizePath; - -use crate::{AliasValue, ResolveContext, ResolveOptions, Resolver}; - -#[test] -fn test() { - let f = super::fixture(); - - let data = [ - ( - "./missing-file", - vec![f.join("missing-file"), f.join("missing-file.js"), f.join("missing-file.node")], - ), - ( - "missing-module", - vec![ - f.join("node_modules/missing-module"), - f.parent().unwrap().join("node_modules"), // enhanced-resolve is "node_modules/missing-module" - ], - ), - ( - "missing-module/missing-file", - vec![ - f.join("node_modules/missing-module"), - // f.parent().unwrap().join("node_modules/missing-module"), // we don't report this - ], - ), - ( - "m1/missing-file", - vec![ - f.join("node_modules/m1/missing-file"), - f.join("node_modules/m1/missing-file.js"), - f.join("node_modules/m1/missing-file.node"), - // f.parent().unwrap().join("node_modules/m1"), // we don't report this - ], - ), - ( - "m1/", - vec![ - f.join("node_modules/m1/index"), - f.join("node_modules/m1/index.js"), - f.join("node_modules/m1/index.json"), - f.join("node_modules/m1/index.node"), - ], - ), - ("m1/a", vec![f.join("node_modules/m1/a")]), - ]; - - let resolver = Resolver::default(); - - for (specifier, missing_dependencies) in data { - let mut ctx = ResolveContext::default(); - let _ = resolver.resolve_with_context(&f, specifier, &mut ctx); - - for path in ctx.file_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - } - - for path in missing_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - assert!( - ctx.missing_dependencies.contains(&path), - "{specifier}: {path:?} not in {:?}", - &ctx.missing_dependencies - ); - } - } -} - -#[test] -fn alias_and_extensions() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias: vec![ - ( - "@scope-js/package-name/dir$".into(), - vec![AliasValue::Path(f.join("foo/index.js").to_string_lossy().to_string())], - ), - ( - "react-dom".into(), - vec![AliasValue::Path(f.join("foo/index.js").to_string_lossy().to_string())], - ), - ], - extensions: vec![".server.ts".into()], - - ..ResolveOptions::default() - }); - - let mut ctx = ResolveContext::default(); - let _ = resolver.resolve_with_context(&f, "@scope-js/package-name/dir/router", &mut ctx); - let _ = resolver.resolve_with_context(&f, "react-dom/client", &mut ctx); - - for path in ctx.file_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - } - - for path in ctx.missing_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - if let Some(path) = path.parent() { - assert!(!path.is_file(), "{path:?} must not be a file"); - } - } -} diff --git a/src/tests/mod.rs b/src/tests/mod.rs deleted file mode 100644 index 94e6bd86..00000000 --- a/src/tests/mod.rs +++ /dev/null @@ -1,49 +0,0 @@ -mod alias; -mod browser_field; -mod builtins; -mod dependencies; -mod exports_field; -mod extension_alias; -mod extensions; -mod fallback; -mod full_specified; -mod imports_field; -mod incorrect_description_file; -mod main_field; -mod memory_fs; -mod missing; -mod resolve; -mod restrictions; -mod roots; -mod scoped_packages; -mod simple; -mod symlink; -mod tsconfig_paths; -mod tsconfig_project_references; - -use crate::Resolver; -use std::{env, path::PathBuf, sync::Arc, thread}; - -pub fn fixture_root() -> PathBuf { - env::current_dir().unwrap().join("fixtures") -} - -pub fn fixture() -> PathBuf { - fixture_root().join("enhanced_resolve").join("test").join("fixtures") -} - -#[test] -fn threaded_environment() { - let cwd = env::current_dir().unwrap(); - let resolver = Arc::new(Resolver::default()); - for _ in 0..2 { - _ = thread::spawn({ - let cwd = cwd.clone(); - let resolver = Arc::clone(&resolver); - move || { - _ = resolver.resolve(cwd, "."); - } - }) - .join(); - } -} diff --git a/src/tests/resolve.rs b/src/tests/resolve.rs deleted file mode 100644 index f2dbb88e..00000000 --- a/src/tests/resolve.rs +++ /dev/null @@ -1,119 +0,0 @@ -//! - -use crate::{ResolveError, ResolveOptions, Resolver}; - -#[test] -fn resolve() { - let f = super::fixture(); - - let resolver = Resolver::default(); - - let main1_js_path = f.join("main1.js").to_string_lossy().to_string(); - - #[rustfmt::skip] - let pass = [ - ("absolute path", f.clone(), main1_js_path.as_str(), f.join("main1.js")), - ("file with .js", f.clone(), "./main1.js", f.join("main1.js")), - ("file without extension", f.clone(), "./main1", f.join("main1.js")), - ("another file with .js", f.clone(), "./a.js", f.join("a.js")), - ("another file without extension", f.clone(), "./a", f.join("a.js")), - ("file in module with .js", f.clone(), "m1/a.js", f.join("node_modules/m1/a.js")), - ("file in module without extension", f.clone(), "m1/a", f.join("node_modules/m1/a.js")), - ("another file in module without extension", f.clone(), "complexm/step1", f.join("node_modules/complexm/step1.js")), - ("from submodule to file in sibling module", f.join("node_modules/complexm"), "m2/b.js", f.join("node_modules/m2/b.js")), - ("from nested directory to overwritten file in module", f.join("multiple_modules"), "m1/a.js", f.join("multiple_modules/node_modules/m1/a.js")), - ("from nested directory to not overwritten file in module", f.join("multiple_modules"), "m1/b.js", f.join("node_modules/m1/b.js")), - ("file with query", f.clone(), "./main1.js?query", f.join("main1.js?query")), - ("file with fragment", f.clone(), "./main1.js#fragment", f.join("main1.js#fragment")), - ("file with fragment and query", f.clone(), "./main1.js#fragment?query", f.join("main1.js#fragment?query")), - ("file with query and fragment", f.clone(), "./main1.js?#fragment", f.join("main1.js?#fragment")), - - ("file with query (unicode)", f.clone(), "./测试.js?query", f.join("测试.js?query")), - ("file with fragment (unicode)", f.clone(), "./测试.js#fragment", f.join("测试.js#fragment")), - ("file with fragment and query (unicode)", f.clone(), "./测试.js#fragment?query", f.join("测试.js#fragment?query")), - ("file with query and fragment (unicode)", f.clone(), "./测试.js?#fragment", f.join("测试.js?#fragment")), - - ("file in module with query", f.clone(), "m1/a?query", f.join("node_modules/m1/a.js?query")), - ("file in module with fragment", f.clone(), "m1/a#fragment", f.join("node_modules/m1/a.js#fragment")), - ("file in module with fragment and query", f.clone(), "m1/a#fragment?query", f.join("node_modules/m1/a.js#fragment?query")), - ("file in module with query and fragment", f.clone(), "m1/a?#fragment", f.join("node_modules/m1/a.js?#fragment")), - ("file in module with query and fragment", f.clone(), "m1/a?#fragment", f.join("node_modules/m1/a.js?#fragment")), - ("differ between directory and file, resolve file", f.clone(), "./dirOrFile", f.join("dirOrFile.js")), - ("differ between directory and file, resolve directory", f.clone(), "./dirOrFile/", f.join("dirOrFile/index.js")), - ("find node_modules outside of node_modules", f.join("browser-module/node_modules"), "m1/a", f.join("node_modules/m1/a.js")), - ("don't crash on main field pointing to self", f.clone(), "./main-field-self", f.join("./main-field-self/index.js")), - ("don't crash on main field pointing to self (2)", f.clone(), "./main-field-self2", f.join("./main-field-self2/index.js")), - // enhanced-resolve has `#` prepended with a `\0`, they are removed from the - // following 3 expected test results. - // See https://github.com/webpack/enhanced-resolve#escaping - ("handle fragment edge case (no fragment)", f.clone(), "./no#fragment/#/#", f.join("no#fragment/#/#.js")), - ("handle fragment edge case (fragment)", f.clone(), "./no#fragment/#/", f.join("no.js#fragment/#/")), - ("handle fragment escaping", f.clone(), "./no\0#fragment/\0#/\0##fragment", f.join("no#fragment/#/#.js#fragment")), - - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn issue238_resolve() { - let f = super::fixture().join("issue-238"); - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into(), ".jsx".into(), ".ts".into(), ".tsx".into()], - modules: vec!["src/a".into(), "src/b".into(), "src/common".into(), "node_modules".into()], - ..ResolveOptions::default() - }); - let resolved_path = - resolver.resolve(f.join("src/common"), "config/myObjectFile").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("src/common/config/myObjectFile.js")),); -} - -#[test] -fn prefer_relative() { - let f = super::fixture(); - - let resolver = - Resolver::new(ResolveOptions { prefer_relative: true, ..ResolveOptions::default() }); - - #[rustfmt::skip] - let pass = [ - ("should correctly resolve with preferRelative 1", "main1.js", f.join("main1.js")), - ("should correctly resolve with preferRelative 2", "m1/a.js", f.join("node_modules/m1/a.js")), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } -} - -#[test] -fn resolve_to_context() { - let f = super::fixture(); - let resolver = - Resolver::new(ResolveOptions { resolve_to_context: true, ..ResolveOptions::default() }); - - #[rustfmt::skip] - let data = [ - ("context for fixtures", f.clone(), "./", f.clone()), - ("context for fixtures/lib", f.clone(), "./lib", f.join("lib")), - ("context for fixtures with ..", f.clone(), "./lib/../../fixtures/./lib/..", f.clone()), - ("context for fixtures with query", f.clone(), "./?query", f.clone().with_file_name("fixtures?query")), - ]; - - for (comment, path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn resolve_hash_as_module() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions::default()); - let resolution = resolver.resolve(f, "#a"); - assert_eq!(resolution, Err(ResolveError::NotFound("#a".into()))); -} diff --git a/src/tests/restrictions.rs b/src/tests/restrictions.rs deleted file mode 100644 index 5ba56596..00000000 --- a/src/tests/restrictions.rs +++ /dev/null @@ -1,25 +0,0 @@ -//! - -use crate::{ResolveError, ResolveOptions, Resolver, Restriction}; - -// TODO: regex -// * should respect RegExp restriction -// * should try to find alternative #1 -// * should try to find alternative #2 -// * should try to find alternative #3 - -// should respect string restriction -#[test] -fn restriction1() { - let fixture = super::fixture(); - let f = fixture.join("restrictions"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - restrictions: vec![Restriction::Path(f.clone())], - ..ResolveOptions::default() - }); - - let resolution = resolver.resolve(&f, "pck2"); - assert_eq!(resolution, Err(ResolveError::Restriction(fixture.join("c.js"), f))); -} diff --git a/src/tests/roots.rs b/src/tests/roots.rs deleted file mode 100644 index b50e2a07..00000000 --- a/src/tests/roots.rs +++ /dev/null @@ -1,92 +0,0 @@ -//! - -use std::path::PathBuf; - -use crate::{AliasValue, ResolveError, ResolveOptions, Resolver}; - -fn dirname() -> PathBuf { - super::fixture_root().join("enhanced_resolve").join("test") -} - -#[test] -fn roots() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - alias: vec![("foo".into(), vec![AliasValue::from("/fixtures")])], - roots: vec![dirname(), f.clone()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should respect roots option", "/fixtures/b.js", f.join("b.js")), - ("should try another root option, if it exists", "/b.js", f.join("b.js")), - ("should respect extension", "/fixtures/b", f.join("b.js")), - ("should resolve in directory", "/fixtures/extensions/dir", f.join("extensions/dir/index.js")), - ("should respect aliases", "foo/b", f.join("b.js")), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } - - #[rustfmt::skip] - let fail = [ - ("should not work with relative path", "fixtures/b.js", ResolveError::NotFound("fixtures/b.js".into())) - ]; - - for (comment, request, expected) in fail { - let resolution = resolver.resolve(&f, request); - assert_eq!(resolution, Err(expected), "{comment} {request}"); - } -} - -#[test] -fn resolve_to_context() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - roots: vec![dirname(), f.clone()], - resolve_to_context: true, - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f, "/fixtures/lib").map(|r| r.full_path()); - let expected = f.join("lib"); - assert_eq!(resolved_path, Ok(expected)); -} - -#[test] -fn prefer_absolute() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - alias: vec![("foo".into(), vec![AliasValue::from("/fixtures")])], - roots: vec![dirname(), f.clone()], - prefer_absolute: true, - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve an absolute path (prefer absolute)", f.join("b.js").to_string_lossy().to_string(), f.join("b.js")), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(&f, &request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } -} - -#[test] -fn roots_fall_through() { - let f = super::fixture(); - let absolute_path = f.join("roots_fall_through/index.js"); - let specifier = absolute_path.to_string_lossy(); - let resolution = Resolver::new(ResolveOptions::default().with_root(&f)).resolve(&f, &specifier); - assert_eq!( - resolution.map(super::super::resolution::Resolution::into_path_buf), - Ok(absolute_path) - ); -} diff --git a/src/tests/scoped_packages.rs b/src/tests/scoped_packages.rs deleted file mode 100644 index 8258f00f..00000000 --- a/src/tests/scoped_packages.rs +++ /dev/null @@ -1,25 +0,0 @@ -//! - -use crate::{ResolveOptions, Resolver}; - -#[test] -fn scoped_packages() { - let f = super::fixture().join("scoped"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("main field should work", f.clone(), "@scope/pack1", f.join("./node_modules/@scope/pack1/main.js")), - ("browser field should work", f.clone(), "@scope/pack2", f.join("./node_modules/@scope/pack2/main.js")), - ("folder request should work", f.clone(), "@scope/pack2/lib", f.join("./node_modules/@scope/pack2/lib/index.js")) - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} diff --git a/src/tests/simple.rs b/src/tests/simple.rs deleted file mode 100644 index 08e1238a..00000000 --- a/src/tests/simple.rs +++ /dev/null @@ -1,68 +0,0 @@ -//! - -use std::env; - -use crate::Resolver; - -#[test] -fn simple() { - // mimic `enhanced-resolve/test/simple.test.js` - let dirname = env::current_dir().unwrap().join("fixtures"); - let f = dirname.join("enhanced_resolve/test"); - - let resolver = Resolver::default(); - - let data = [ - ("direct", f.clone(), "../lib/index"), - ("as directory", f, ".."), - ("as module", dirname.clone(), "./enhanced_resolve"), - ]; - - for (comment, path, request) in data { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - let expected = dirname.join("enhanced_resolve/lib/index.js"); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn dashed_name() { - let f = super::fixture(); - - let resolver = Resolver::default(); - - let data = [ - (f.clone(), "dash", f.join("node_modules/dash/index.js")), - (f.clone(), "dash-name", f.join("node_modules/dash-name/index.js")), - (f.join("node_modules/dash"), "dash", f.join("node_modules/dash/index.js")), - (f.join("node_modules/dash"), "dash-name", f.join("node_modules/dash-name/index.js")), - (f.join("node_modules/dash-name"), "dash", f.join("node_modules/dash/index.js")), - (f.join("node_modules/dash-name"), "dash-name", f.join("node_modules/dash-name/index.js")), - ]; - - for (path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{path:?} {request}"); - } -} - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows { - use super::super::memory_fs::MemoryFS; - - use crate::ResolveOptions; - - #[test] - fn no_package() { - use crate::ResolverGeneric; - use std::path::Path; - let f = Path::new("/"); - let file_system = MemoryFS::new(&[]); - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions::default(), - ); - let resolved_path = resolver.resolve(f, "package"); - assert!(resolved_path.is_err()); - } -} diff --git a/src/tests/symlink.rs b/src/tests/symlink.rs deleted file mode 100644 index 7589b560..00000000 --- a/src/tests/symlink.rs +++ /dev/null @@ -1,121 +0,0 @@ -use std::{fs, io, path::Path}; - -use crate::{ResolveOptions, Resolver}; - -#[derive(Debug, Clone, Copy)] -enum FileType { - File, - Dir, -} - -#[allow(unused_variables)] -fn symlink, Q: AsRef>( - original: P, - link: Q, - file_type: FileType, -) -> io::Result<()> { - #[cfg(target_family = "unix")] - { - std::os::unix::fs::symlink(original, link) - } - - #[cfg(target_family = "windows")] - match file_type { - FileType::File => std::os::windows::fs::symlink_file(original, link), - FileType::Dir => std::os::windows::fs::symlink_dir(original, link), - } -} - -fn init(dirname: &Path, temp_path: &Path) -> io::Result<()> { - if temp_path.exists() { - _ = fs::remove_dir_all(temp_path); - } - fs::create_dir(temp_path)?; - symlink(dirname.join("../lib/index.js"), temp_path.join("test"), FileType::File)?; - symlink(dirname.join("../lib"), temp_path.join("test2"), FileType::Dir)?; - fs::remove_file(temp_path.join("test"))?; - fs::remove_file(temp_path.join("test2"))?; - fs::remove_dir(temp_path) -} - -fn create_symlinks(dirname: &Path, temp_path: &Path) -> io::Result<()> { - fs::create_dir(temp_path).unwrap(); - symlink( - dirname.join("../lib/index.js").canonicalize().unwrap(), - temp_path.join("index.js"), - FileType::File, - )?; - symlink(dirname.join("../lib").canonicalize().unwrap(), temp_path.join("lib"), FileType::Dir)?; - symlink(dirname.join("..").canonicalize().unwrap(), temp_path.join("this"), FileType::Dir)?; - symlink(temp_path.join("this"), temp_path.join("that"), FileType::Dir)?; - symlink(Path::new("../../lib/index.js"), temp_path.join("node.relative.js"), FileType::File)?; - symlink( - Path::new("./node.relative.js"), - temp_path.join("node.relative.sym.js"), - FileType::File, - )?; - Ok(()) -} - -fn cleanup_symlinks(temp_path: &Path) { - _ = fs::remove_dir_all(temp_path); -} - -#[test] -fn test() -> io::Result<()> { - let root = super::fixture_root().join("enhanced_resolve"); - let dirname = root.join("test"); - let temp_path = dirname.join("temp"); - if !temp_path.exists() { - let is_admin = init(&dirname, &temp_path).is_ok(); - if !is_admin { - return Ok(()); - } - if let Err(err) = create_symlinks(&dirname, &temp_path) { - cleanup_symlinks(&temp_path); - return Err(err); - } - } - - let resolver_without_symlinks = - Resolver::new(ResolveOptions { symlinks: false, ..ResolveOptions::default() }); - let resolver_with_symlinks = Resolver::default(); - - #[rustfmt::skip] - let pass = [ - ("with a symlink to a file", temp_path.clone(), "./index.js"), - ("with a relative symlink to a file", temp_path.clone(), "./node.relative.js"), - ("with a relative symlink to a symlink to a file", temp_path.clone(), "./node.relative.sym.js"), - ("with a symlink to a directory 1", temp_path.clone(), "./lib/index.js"), - ("with a symlink to a directory 2", temp_path.clone(), "./this/lib/index.js"), - ("with multiple symlinks in the path 1", temp_path.clone(), "./this/test/temp/index.js"), - ("with multiple symlinks in the path 2", temp_path.clone(), "./this/test/temp/lib/index.js"), - ("with multiple symlinks in the path 3", temp_path.clone(), "./this/test/temp/this/lib/index.js"), - ("with a symlink to a directory 2 (chained)", temp_path.clone(), "./that/lib/index.js"), - ("with multiple symlinks in the path 1 (chained)", temp_path.clone(), "./that/test/temp/index.js"), - ("with multiple symlinks in the path 2 (chained)", temp_path.clone(), "./that/test/temp/lib/index.js"), - ("with multiple symlinks in the path 3 (chained)", temp_path.clone(), "./that/test/temp/that/lib/index.js"), - ("with symlinked directory as context 1", temp_path.join( "lib"), "./index.js"), - ("with symlinked directory as context 2", temp_path.join( "this"), "./lib/index.js"), - ("with symlinked directory as context and in path", temp_path.join( "this"), "./test/temp/lib/index.js"), - ("with symlinked directory in context path", temp_path.join( "this/lib"), "./index.js"), - ("with symlinked directory in context path and symlinked file", temp_path.join( "this/test"), "./temp/index.js"), - ("with symlinked directory in context path and symlinked directory", temp_path.join( "this/test"), "./temp/lib/index.js"), - ("with symlinked directory as context 2 (chained)", temp_path.join( "that"), "./lib/index.js"), - ("with symlinked directory as context and in path (chained)", temp_path.join( "that"), "./test/temp/lib/index.js"), - ("with symlinked directory in context path (chained)", temp_path.join( "that/lib"), "./index.js"), - ("with symlinked directory in context path and symlinked file (chained)", temp_path.join( "that/test"), "./temp/index.js"), - ("with symlinked directory in context path and symlinked directory (chained)", temp_path.join( "that/test"), "./temp/lib/index.js") - ]; - - for (comment, path, request) in pass { - let filename = resolver_with_symlinks.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(filename, Ok(root.join("lib/index.js")), "{comment:?}"); - - let resolved_path = - resolver_without_symlinks.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(path.join(request))); - } - - Ok(()) -} diff --git a/src/tests/tsconfig_paths.rs b/src/tests/tsconfig_paths.rs deleted file mode 100644 index 26935b5c..00000000 --- a/src/tests/tsconfig_paths.rs +++ /dev/null @@ -1,507 +0,0 @@ -//! tests for tsconfig-paths -//! -//! Fixtures copied from . - -use std::path::{Path, PathBuf}; - -use crate::{ - ResolveError, ResolveOptions, Resolver, TsConfig, TsconfigOptions, TsconfigReferences, -}; - -// -#[test] -fn tsconfig() { - let f = super::fixture_root().join("tsconfig"); - - #[rustfmt::skip] - let pass = [ - (f.clone(), None, "ts-path", f.join("foo.js")), - (f.join("nested"), None, "ts-path", f.join("nested/test.js")), - (f.join("cases/index"), None, "foo", f.join("node_modules/tsconfig-index/foo.js")), - // This requires reading package.json.tsconfig field - // (f.join("cases/field"), "foo", f.join("node_modules/tsconfig-field/foo.js")) - (f.join("cases/exports"), None, "foo", f.join("node_modules/tsconfig-exports/foo.js")), - (f.join("cases/extends-extension"), None, "foo", f.join("cases/extends-extension/foo.js")), - (f.join("cases/extends-extensionless"), None, "foo", f.join("node_modules/tsconfig-field/foo.js")), - (f.join("cases/extends-paths"), Some("src"), "@/index", f.join("cases/extends-paths/src/index.js")), - (f.join("cases/extends-multiple"), None, "foo", f.join("cases/extends-multiple/foo.js")), - ]; - - for (dir, subdir, request, expected) in pass { - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: dir.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - let path = subdir.map_or(dir.clone(), |subdir| dir.join(subdir)); - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{request} {path:?}"); - } - - #[rustfmt::skip] - let data = [ - (f.join("node_modules/tsconfig-not-used"), "ts-path", Ok(f.join("foo.js"))), - ]; - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - for (path, request, expected) in data { - let resolution = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolution, expected, "{path:?} {request}"); - } -} - -#[test] -fn tsconfig_fallthrough() { - let f = super::fixture_root().join("tsconfig"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "/"); - assert_eq!(resolved_path, Err(ResolveError::NotFound("/".into()))); -} - -#[test] -fn json_with_comments() { - let f = super::fixture_root().join("tsconfig/cases/trailing-comma"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "foo").map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(f.join("bar.js"))); -} - -// -#[test] -fn test_paths() { - let path = Path::new("/foo/tsconfig.json"); - let mut tsconfig_json = serde_json::json!({ - "compilerOptions": { - "paths": { - "jquery": ["node_modules/jquery/dist/jquery"], - "*": ["generated/*"], - "bar/*": ["test/*"], - "bar/baz/*": ["baz/*", "yo/*"], - "@/components/*": ["components/*"], - "url": ["node_modules/my-url"], - } - } - }) - .to_string(); - let tsconfig = TsConfig::parse(true, path, &mut tsconfig_json).unwrap(); - - let data = [ - ("jquery", vec!["/foo/node_modules/jquery/dist/jquery"]), - ("test", vec!["/foo/generated/test"]), - ("test/hello", vec!["/foo/generated/test/hello"]), - ("bar/hi", vec!["/foo/test/hi"]), - ("bar/baz/hi", vec!["/foo/baz/hi", "/foo/yo/hi"]), - ("@/components/button", vec!["/foo/components/button"]), - ("./jquery", vec![]), - ("url", vec!["/foo/node_modules/my-url"]), - ]; - - for (specifier, expected) in data { - let paths = tsconfig.resolve_path_alias(specifier); - let expected = expected.into_iter().map(PathBuf::from).collect::>(); - assert_eq!(paths, expected, "{specifier}"); - } -} - -// -#[test] -fn test_base_url() { - let path = Path::new("/foo/tsconfig.json"); - let mut tsconfig_json = serde_json::json!({ - "compilerOptions": { - "baseUrl": "./src" - } - }) - .to_string(); - let tsconfig = TsConfig::parse(true, path, &mut tsconfig_json).unwrap(); - - let data = [ - ("foo", vec!["/foo/src/foo"]), - ("components/button", vec!["/foo/src/components/button"]), - ("./jquery", vec![]), - ]; - - for (specifier, expected) in data { - let paths = tsconfig.resolve_path_alias(specifier); - let expected = expected.into_iter().map(PathBuf::from).collect::>(); - assert_eq!(paths, expected, "{specifier}"); - } -} - -// -#[test] -fn test_paths_and_base_url() { - let path = Path::new("/foo/tsconfig.json"); - let mut tsconfig_json = serde_json::json!({ - "compilerOptions": { - "baseUrl": "./src", - "paths": { - "*": ["generated/*"], - "bar/*": ["test/*"], - "bar/baz/*": ["baz/*", "yo/*"], - "@/components/*": ["components/*"] - } - } - }) - .to_string(); - let tsconfig = TsConfig::parse(true, path, &mut tsconfig_json).unwrap(); - - let data = [ - ("test", vec!["/foo/src/generated/test", "/foo/src/test"]), - ("test/hello", vec!["/foo/src/generated/test/hello", "/foo/src/test/hello"]), - ("bar/hi", vec!["/foo/src/test/hi", "/foo/src/bar/hi"]), - ("bar/baz/hi", vec!["/foo/src/baz/hi", "/foo/src/yo/hi", "/foo/src/bar/baz/hi"]), - ("@/components/button", vec!["/foo/src/components/button", "/foo/src/@/components/button"]), - ("./jquery", vec![]), - ]; - - for (specifier, expected) in data { - let paths = tsconfig.resolve_path_alias(specifier); - let expected = expected.into_iter().map(PathBuf::from).collect::>(); - assert_eq!(paths, expected, "{specifier}"); - } -} - -// Template variable ${configDir} for substitution of config files directory path -// https://github.com/microsoft/TypeScript/pull/58042 -#[test] -fn test_template_variable() { - let f = super::fixture_root().join("tsconfig"); - let f2 = f.join("cases").join("paths_template_variable"); - - #[rustfmt::skip] - let pass = [ - (f2.clone(), "tsconfig1.json", "foo", f2.join("foo.js")), - (f2.clone(), "tsconfig2.json", "foo", f2.join("foo.js")), - (f.clone(), "tsconfig_template_variable.json", "foo", f.join("foo.js")), - ]; - - for (dir, tsconfig, request, expected) in pass { - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: dir.join(tsconfig), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&dir, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{request} {tsconfig} {dir:?}"); - } -} - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows_test { - use std::path::{Path, PathBuf}; - - use crate::{ - ResolveError, ResolveOptions, ResolverGeneric, TsconfigOptions, TsconfigReferences, - }; - - use super::super::memory_fs::MemoryFS; - - struct OneTest { - name: &'static str, - tsconfig: String, - package_json: Option<(PathBuf, String)>, - main_fields: Option>, - existing_files: Vec<&'static str>, - requested_module: &'static str, - expected_path: &'static str, - extensions: Vec, - } - - impl Default for OneTest { - fn default() -> Self { - Self { - name: "", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/*": ["location/*"] - } - } - }) - .to_string(), - package_json: None, - main_fields: None, - existing_files: vec![], - requested_module: "", - expected_path: "", - extensions: vec![ - ".js".into(), - ".json".into(), - ".node".into(), - ".ts".into(), - ".tsx".into(), - ], - } - } - } - - impl OneTest { - fn resolver(&self, root: &Path) -> ResolverGeneric { - let mut file_system = MemoryFS::default(); - - file_system.add_file(&root.join("tsconfig.json"), &self.tsconfig); - if let Some((path, package_json)) = &self.package_json { - file_system.add_file(&root.join(path).join("package.json"), package_json); - } - for path in &self.existing_files { - file_system.add_file(Path::new(path), ""); - } - - let mut options = ResolveOptions { - extensions: self.extensions.clone(), - tsconfig: Some(TsconfigOptions { - config_file: root.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }; - if let Some(main_fields) = &self.main_fields { - options.main_fields.clone_from(main_fields); - } - - ResolverGeneric::::new_with_file_system(file_system, options) - } - } - - // Path matching tests from tsconfig-paths - // * - // * - #[test] - fn match_path() { - let pass = [ - OneTest { - name: "should locate path that matches with star and exists", - existing_files: vec!["/root/location/mylib/index.ts"], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve to correct path when many are specified", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/*": ["foo1/*", "foo2/*", "location/*", "foo3/*"], - } - } - }) - .to_string(), - existing_files: vec!["/root/location/mylib/index.ts"], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should locate path that matches with star and prioritize pattern with longest prefix", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "*": ["location/*"], - "lib/*": ["location/*"], - } - } - }) - .to_string(), - existing_files: vec![ - "/root/location/lib/mylib/index.ts", - "/root/location/mylib/index.ts", - ], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should locate path that matches with star and exists with extension", - existing_files: vec![ - "/root/location/mylib.myext", - ], - requested_module: "lib/mylib", - extensions: vec![".js".into(), ".myext".into()], - expected_path: "/root/location/mylib.myext", - ..OneTest::default() - }, - OneTest { - name: "should resolve request with extension specified", - existing_files: vec![ - "/root/location/test.jpg", - ], - requested_module: "lib/test.jpg", - expected_path: "/root/location/test.jpg", - ..OneTest::default() - }, - OneTest { - name: "should locate path that matches without star and exists", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/foo": ["location/foo"] - } - } - }) - .to_string(), - existing_files: vec![ - "/root/location/foo.ts", - ], - requested_module: "lib/foo", - expected_path: "/root/location/foo.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve to parent folder when filename is in subfolder", - existing_files: vec![ - "/root/location/mylib/index.ts", - ], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve from main field in package.json", - package_json: Some((PathBuf::from("/root/location/mylib"), serde_json::json!({ - "main": "./kalle.ts" - }).to_string())), - existing_files: vec![ - "/root/location/mylib/kalle.ts", - ], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/kalle.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve from main field in package.json (js)", - package_json: Some((PathBuf::from("/root/location/mylib.js"), serde_json::json!({ - "main": "./kalle.js" - }).to_string())), - existing_files: vec![ - "/root/location/mylib.js/kalle.js", - ], - extensions: vec![".ts".into(), ".js".into()], - requested_module: "lib/mylib.js", - expected_path: "/root/location/mylib.js/kalle.js", - ..OneTest::default() - }, - OneTest { - name: "should resolve from list of fields by priority in package.json", - main_fields: Some(vec!["missing".into(), "browser".into(), "main".into()]), - package_json: Some((PathBuf::from("/root/location/mylibjs"), serde_json::json!({ - "main": "./main.js", - "browser": "./browser.js" - }).to_string())), - existing_files: vec![ - "/root/location/mylibjs/main.js", - "/root/location/mylibjs/browser.js", - ], - extensions: vec![".ts".into(), ".js".into()], - requested_module: "lib/mylibjs", - expected_path: "/root/location/mylibjs/browser.js", - ..OneTest::default() - }, -OneTest { - name: "should ignore field mappings to missing files in package.json", - main_fields: Some(vec!["browser".into(), "main".into()]), - package_json: Some((PathBuf::from("/root/location/mylibjs"), serde_json::json!({ - "main": "./kalle.js", - "browser": "./nope.js" - }).to_string())), - existing_files: vec![ - "/root/location/mylibjs/kalle.js", - ], - extensions: vec![".ts".into(), ".js".into()], - requested_module: "lib/mylibjs", - expected_path: "/root/location/mylibjs/kalle.js", - ..OneTest::default() - }, - // Tests that are not applicable: - // name: "should resolve nested main fields" - // name: "should ignore advanced field mappings in package.json" - // name: "should resolve to with the help of baseUrl when not explicitly set" - // name: "should not resolve with the help of baseUrl when asked not to" - // name: "should resolve main file with cjs file extension" - OneTest { - name: "should resolve .ts from .js alias", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "@/*": ["src/*"] - } - } - }).to_string(), - existing_files: vec![ - "/root/src/foo.ts", - ], - requested_module: "@/foo", // original data was "@/foo.ts" but I don't get why it is the case? - expected_path: "/root/src/foo.ts", // original data was "/root/src/foo" - ..OneTest::default() - }, - ]; - - let root = PathBuf::from("/root"); - - for test in pass { - let resolved_path = - test.resolver(&root).resolve(&root, test.requested_module).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(PathBuf::from(test.expected_path)), "{}", test.name); - } - - let fail = [ - OneTest { - name: "should not locate path that does not match", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/*": ["location/*"] - } - } - }) - .to_string(), - existing_files: vec!["/root/location/mylib"], - requested_module: "lib/mylibjs", - ..OneTest::default() - }, - OneTest { - name: "should not resolve typings file (index.d.ts)", - existing_files: vec!["/root/location/mylib/index.d.ts"], - requested_module: "lib/mylib", - ..OneTest::default() - }, - ]; - - for test in fail { - let resolved_path = - test.resolver(&root).resolve(&root, test.requested_module).map(|f| f.full_path()); - assert_eq!( - resolved_path, - Err(ResolveError::NotFound(test.requested_module.into())), - "{}", - test.name - ); - } - } -} diff --git a/src/tests/tsconfig_project_references.rs b/src/tests/tsconfig_project_references.rs deleted file mode 100644 index b552fefe..00000000 --- a/src/tests/tsconfig_project_references.rs +++ /dev/null @@ -1,101 +0,0 @@ -//! Tests for tsconfig project references - -use crate::{ResolveError, ResolveOptions, Resolver, TsconfigOptions, TsconfigReferences}; - -#[test] -fn auto() { - let f = super::fixture_root().join("tsconfig/cases/project_references"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("app"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - // Test normal paths alias - (f.join("app"), "@/index.ts", f.join("app/aliased/index.ts")), - (f.join("app"), "@/../index.ts", f.join("app/index.ts")), - // Test project reference - (f.join("project_a"), "@/index.ts", f.join("project_a/aliased/index.ts")), - (f.join("project_b/src"), "@/index.ts", f.join("project_b/src/aliased/index.ts")), - // Does not have paths alias - (f.join("project_a"), "./index.ts", f.join("project_a/index.ts")), - (f.join("project_c"), "./index.ts", f.join("project_c/index.ts")), - // Template variable - { - let dir = f.parent().unwrap().join("paths_template_variable"); - (dir.clone(), "foo", dir.join("foo.js")) - } - ]; - - for (path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{request} {path:?}"); - } -} - -#[test] -fn disabled() { - let f = super::fixture_root().join("tsconfig/cases/project_references"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("app"), - references: TsconfigReferences::Disabled, - }), - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - // Test normal paths alias - (f.join("app"), "@/index.ts", Ok(f.join("app/aliased/index.ts"))), - (f.join("app"), "@/../index.ts", Ok(f.join("app/index.ts"))), - // Test project reference - (f.join("project_a"), "@/index.ts", Err(ResolveError::NotFound("@/index.ts".into()))), - (f.join("project_b/src"), "@/index.ts", Err(ResolveError::NotFound("@/index.ts".into()))), - // Does not have paths alias - (f.join("project_a"), "./index.ts", Ok(f.join("project_a/index.ts"))), - (f.join("project_c"), "./index.ts", Ok(f.join("project_c/index.ts"))), - ]; - - for (path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, expected, "{request} {path:?}"); - } -} - -#[test] -fn manual() { - let f = super::fixture_root().join("tsconfig/cases/project_references"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("app"), - references: TsconfigReferences::Paths(vec!["../project_a/conf.json".into()]), - }), - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - // Test normal paths alias - (f.join("app"), "@/index.ts", Ok(f.join("app/aliased/index.ts"))), - (f.join("app"), "@/../index.ts", Ok(f.join("app/index.ts"))), - // Test project reference - (f.join("project_a"), "@/index.ts", Ok(f.join("project_a/aliased/index.ts"))), - (f.join("project_b/src"), "@/index.ts", Err(ResolveError::NotFound("@/index.ts".into()))), - // Does not have paths alias - (f.join("project_a"), "./index.ts", Ok(f.join("project_a/index.ts"))), - (f.join("project_c"), "./index.ts", Ok(f.join("project_c/index.ts"))), - ]; - - for (path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, expected, "{request} {path:?}"); - } -} diff --git a/src/tsconfig.rs b/src/tsconfig.rs deleted file mode 100644 index aa00f6e4..00000000 --- a/src/tsconfig.rs +++ /dev/null @@ -1,212 +0,0 @@ -use std::{ - path::{Path, PathBuf}, - sync::Arc, -}; - -use serde::Deserialize; -use typescript_tsconfig_json::{CompilerOptionsPathsMap, ExtendsField}; - -use crate::PathUtil; - -#[derive(Debug, Deserialize)] -#[serde(rename_all = "camelCase")] -pub struct TsConfig { - /// Whether this is the caller tsconfig. - /// Used for final template variable substitution when all configs are extended and merged. - #[serde(skip)] - root: bool, - - /// Path to `tsconfig.json`. Contains the `tsconfig.json` filename. - #[serde(skip)] - path: PathBuf, - - #[serde(default)] - pub extends: Option, - - #[serde(default)] - pub compiler_options: CompilerOptions, - - /// Bubbled up project references with a reference to their tsconfig. - #[serde(default)] - pub references: Vec, -} - -/// Compiler Options -/// -/// -#[derive(Debug, Default, Deserialize)] -#[serde(rename_all = "camelCase")] -pub struct CompilerOptions { - base_url: Option, - - /// Path aliases - paths: Option, - - /// The actual base for where path aliases are resolved from. - #[serde(skip)] - paths_base: PathBuf, -} - -/// Project Reference -/// -/// -#[derive(Debug, Deserialize)] -pub struct ProjectReference { - /// The path property of each reference can point to a directory containing a tsconfig.json file, - /// or to the config file itself (which may have any name). - pub path: PathBuf, - - /// Reference to the resolved tsconfig - #[serde(skip)] - pub tsconfig: Option>, -} - -impl TsConfig { - pub fn parse(root: bool, path: &Path, json: &mut str) -> Result { - _ = json_strip_comments::strip(json); - let mut tsconfig: Self = serde_json::from_str(json)?; - tsconfig.root = root; - tsconfig.path = path.to_path_buf(); - let directory = tsconfig.directory().to_path_buf(); - if let Some(base_url) = tsconfig.compiler_options.base_url { - tsconfig.compiler_options.base_url = Some(directory.normalize_with(base_url)); - } - if tsconfig.compiler_options.paths.is_some() { - tsconfig.compiler_options.paths_base = - tsconfig.compiler_options.base_url.as_ref().map_or(directory, Clone::clone); - } - Ok(tsconfig) - } - - pub fn build(mut self) -> Self { - if self.root { - let dir = self.directory().to_path_buf(); - // Substitute template variable in `tsconfig.compilerOptions.paths` - if let Some(paths) = &mut self.compiler_options.paths { - for paths in paths.values_mut() { - for path in paths { - Self::substitute_template_variable(&dir, path); - } - } - } - } - self - } - - /// Directory to `tsconfig.json` - /// - /// # Panics - /// - /// * When the `tsconfig.json` path is misconfigured. - pub fn directory(&self) -> &Path { - debug_assert!(self.path.file_name().is_some()); - self.path.parent().unwrap() - } - - pub fn extend_tsconfig(&mut self, tsconfig: &Self) { - let compiler_options = &mut self.compiler_options; - if compiler_options.paths.is_none() { - compiler_options.paths_base = compiler_options - .base_url - .as_ref() - .map_or_else(|| tsconfig.compiler_options.paths_base.clone(), Clone::clone); - compiler_options.paths.clone_from(&tsconfig.compiler_options.paths); - } - if compiler_options.base_url.is_none() { - compiler_options.base_url.clone_from(&tsconfig.compiler_options.base_url); - } - } - - pub fn resolve(&self, path: &Path, specifier: &str) -> Vec { - if path.starts_with(self.base_path()) { - let paths = self.resolve_path_alias(specifier); - if !paths.is_empty() { - return paths; - } - } - for tsconfig in self.references.iter().filter_map(|reference| reference.tsconfig.as_ref()) { - if path.starts_with(tsconfig.base_path()) { - return tsconfig.resolve_path_alias(specifier); - } - } - vec![] - } - - // Copied from parcel - // - pub fn resolve_path_alias(&self, specifier: &str) -> Vec { - if specifier.starts_with(|s| s == '/' || s == '.') { - return vec![]; - } - - let base_url_iter = self - .compiler_options - .base_url - .as_ref() - .map_or_else(Vec::new, |base_url| vec![base_url.normalize_with(specifier)]); - - let Some(paths_map) = &self.compiler_options.paths else { - return base_url_iter; - }; - - let paths = paths_map.get(specifier).map_or_else( - || { - let mut longest_prefix_length = 0; - let mut longest_suffix_length = 0; - let mut best_key: Option<&String> = None; - - for key in paths_map.keys() { - if let Some((prefix, suffix)) = key.split_once('*') { - if (best_key.is_none() || prefix.len() > longest_prefix_length) - && specifier.starts_with(prefix) - && specifier.ends_with(suffix) - { - longest_prefix_length = prefix.len(); - longest_suffix_length = suffix.len(); - best_key.replace(key); - } - } - } - - best_key.and_then(|key| paths_map.get(key)).map_or_else(Vec::new, |paths| { - paths - .iter() - .map(|path| { - path.replace( - '*', - &specifier[longest_prefix_length - ..specifier.len() - longest_suffix_length], - ) - }) - .collect::>() - }) - }, - Clone::clone, - ); - - paths - .into_iter() - .map(|p| self.compiler_options.paths_base.normalize_with(p)) - .chain(base_url_iter) - .collect() - } - - fn base_path(&self) -> &Path { - self.compiler_options - .base_url - .as_ref() - .map_or_else(|| self.directory(), |path| path.as_ref()) - } - - /// Template variable `${configDir}` for substitution of config files directory path - /// - /// NOTE: All tests cases are just a head replacement of `${configDir}`, so we are constrained as such. - /// - /// See - fn substitute_template_variable(directory: &Path, path: &mut String) { - const TEMPLATE_VARIABLE: &str = "${configDir}/"; - if let Some(stripped_path) = path.strip_prefix(TEMPLATE_VARIABLE) { - *path = directory.join(stripped_path).to_string_lossy().to_string(); - } - } -} diff --git a/tests/integration_test.rs b/tests/integration_test.rs deleted file mode 100644 index d369413f..00000000 --- a/tests/integration_test.rs +++ /dev/null @@ -1,102 +0,0 @@ -//! Test public APIs - -use std::{env, path::PathBuf}; - -use oxc_resolver::{EnforceExtension, Resolution, ResolveContext, ResolveOptions, Resolver}; - -fn dir() -> PathBuf { - env::current_dir().unwrap() -} - -fn resolve(specifier: &str) -> Resolution { - let path = dir(); - Resolver::new(ResolveOptions::default()).resolve(path, specifier).unwrap() -} - -#[test] -fn clone() { - let resolution = resolve("./tests/package.json"); - assert_eq!(resolution.clone(), resolution); -} - -#[test] -fn debug() { - let resolution = resolve("./tests/package.json"); - let s = format!("{resolution:?}"); - assert!(!s.is_empty()); -} - -#[test] -fn eq() { - let resolution = resolve("./tests/package.json"); - assert_eq!(resolution, resolution); -} - -#[test] -fn package_json() { - let resolution = resolve("./tests/package.json"); - assert!(resolution - .package_json() - .is_some_and(|json| json.name.as_ref().is_some_and(|name| name == "name"))); -} - -#[cfg(feature = "package_json_raw_json_api")] -#[test] -fn package_json_raw_json_api() { - let resolution = resolve("./tests/package.json"); - assert!(resolution - .package_json() - .unwrap() - .raw_json() - .get("name") - .is_some_and(|name| name == "name")); -} - -#[test] -fn clear_cache() { - let resolver = Resolver::new(ResolveOptions::default()); - resolver.clear_cache(); // exists -} - -#[test] -fn options() { - let resolver = Resolver::new(ResolveOptions::default()); - let options = resolver.options(); - assert!(!format!("{options:?}").is_empty()); -} - -#[test] -fn debug_resolver() { - let resolver = Resolver::new(ResolveOptions::default()); - assert!(!format!("{resolver:?}").is_empty()); -} - -#[test] -fn dependencies() { - let path = dir(); - let mut ctx = ResolveContext::default(); - let _ = Resolver::new(ResolveOptions::default()).resolve_with_context( - path, - "./tests/package.json", - &mut ctx, - ); - assert!(!ctx.file_dependencies.is_empty()); - assert!(ctx.missing_dependencies.is_empty()); -} - -#[test] -fn options_api() { - _ = ResolveOptions::default() - .with_builtin_modules(true) - .with_condition_names(&[]) - .with_extension(".js") - .with_force_extension(EnforceExtension::Auto) - .with_fully_specified(true) - .with_main_field("asdf") - .with_main_file("main") - .with_module("module") - .with_prefer_absolute(true) - .with_prefer_relative(true) - .with_root(PathBuf::new()) - .with_symbolic_link(true); -} diff --git a/tests/package.json b/tests/package.json deleted file mode 100644 index f099adcf..00000000 --- a/tests/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "name": "name" -} diff --git a/tests/resolve_test.rs b/tests/resolve_test.rs deleted file mode 100644 index 30d1ceff..00000000 --- a/tests/resolve_test.rs +++ /dev/null @@ -1,104 +0,0 @@ -use std::{env, path::PathBuf}; - -use oxc_resolver::{ResolveError, ResolveOptions, Resolver}; - -fn dir() -> PathBuf { - env::current_dir().unwrap() -} - -#[test] -fn chinese() { - let dir = dir(); - let specifier = "./fixtures/misc/中文/中文.js"; - let resolution = Resolver::new(ResolveOptions::default()).resolve(&dir, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(dir.join("fixtures/misc/中文/中文.js")) - ); -} - -#[test] -fn styled_components() { - let dir = dir(); - let path = dir.join("fixtures/pnpm"); - let module_path = dir.join("node_modules/.pnpm/styled-components@6.1.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/styled-components"); - let specifier = "styled-components"; - - // cjs - let options = - ResolveOptions { alias_fields: vec![vec!["browser".into()]], ..ResolveOptions::default() }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/styled-components.browser.cjs.js")) - ); - - // esm - let options = ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - main_fields: vec!["module".into()], - ..ResolveOptions::default() - }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/styled-components.browser.esm.js")) - ); -} - -#[test] -fn axios() { - let dir = dir(); - let path = dir.join("fixtures/pnpm"); - let module_path = dir.join("node_modules/.pnpm/axios@1.6.2/node_modules/axios"); - let specifier = "axios"; - - // default - let options = ResolveOptions::default(); - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("index.js")) - ); - - // browser - let options = ResolveOptions { - condition_names: vec!["browser".into(), "require".into()], - ..ResolveOptions::default() - }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/browser/axios.cjs")) - ); - - // cjs - let options = ResolveOptions { - condition_names: vec!["node".into(), "require".into()], - ..ResolveOptions::default() - }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/node/axios.cjs")) - ); -} - -#[test] -fn postcss() { - let dir = dir(); - let path = dir.join("fixtures/pnpm"); - let module_path = path.join("node_modules/postcss"); - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - // should ignore "path" - let resolution = resolver.resolve(&module_path, "path"); - assert_eq!(resolution, Err(ResolveError::Ignored(module_path.clone()))); - - // should ignore "./lib/terminal-highlight" - let resolution = resolver.resolve(&module_path, "./lib/terminal-highlight"); - assert_eq!(resolution, Err(ResolveError::Ignored(module_path.join("lib/terminal-highlight")))); -} From 887885f4139063528b83c67da378c16064aef8b5 Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Wed, 19 Jun 2024 02:52:27 +0300 Subject: [PATCH 29/82] squash! --- package.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index a431e48f..271d2817 100644 --- a/package.json +++ b/package.json @@ -15,10 +15,10 @@ ] }, "devDependencies": { - "@napi-rs/cli": "^3.0.0-alpha.43", - "@napi-rs/wasm-runtime": "^0.2.0", - "@types/node": "^20.10.4", - "ava": "^6.0.1", - "emnapi": "^1.0.0" + "@napi-rs/cli": "3.0.0-alpha.43", + "@napi-rs/wasm-runtime": "0.2.4", + "@types/node": "20.14.5", + "ava": "6.1.3", + "emnapi": "1.2.0" } } From e53a8d1cbc4e231ab89eb4e88402ea71cf65da7f Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Wed, 19 Jun 2024 21:57:45 +0300 Subject: [PATCH 30/82] squash! --- Cargo.lock | 858 ------ fixtures/enhanced_resolve/lib/index.js | 1 - fixtures/enhanced_resolve/package.json | 4 - fixtures/enhanced_resolve/test/.gitignore | 2 - .../enhanced_resolve/test/fixtures/#/a.js | 0 fixtures/enhanced_resolve/test/fixtures/a.js | 3 - .../enhanced_resolve/test/fixtures/abc.txt | 1 - .../test/fixtures/alias/files/a.js | 0 fixtures/enhanced_resolve/test/fixtures/b.js | 3 - .../browser-module/browser/module-a.js | 0 .../fixtures/browser-module/lib/browser.js | 0 .../fixtures/browser-module/lib/ignore.js | 0 .../test/fixtures/browser-module/lib/main.js | 0 .../fixtures/browser-module/lib/replaced.js | 0 .../test/fixtures/browser-module/lib/self.js | 0 .../fixtures/browser-module/lib/toString.js | 0 .../browser-module/node_modules/module-a.js | 0 .../browser-module/node_modules/module-b.js | 0 .../browser-module/node_modules/module-c.js | 0 .../node_modules/recursive-file/a.js | 0 .../node_modules/recursive-file/b.js | 0 .../node_modules/recursive-file/c.js | 0 .../node_modules/recursive-file/d.js | 0 .../node_modules/recursive-file/package.json | 8 - .../test/fixtures/browser-module/package.json | 33 - .../test/fixtures/builtins/package.json | 12 - fixtures/enhanced_resolve/test/fixtures/c.js | 4 - .../enhanced_resolve/test/fixtures/complex.js | 13 - .../test/fixtures/crypto-js/index.js | 0 .../test/fixtures/crypto-js/package.json | 7 - .../test/fixtures/decorated-fs/exists.js | 0 .../test/fixtures/dirOrFile.js | 1 - .../test/fixtures/dirOrFile/index.js | 1 - .../directory-default/directory-default.js | 0 .../node_modules/@org/pkg/dist/string.js | 1 - .../@org/pkg/dist/string.test.d.ts | 1 - .../node_modules/@org/pkg/package.json | 9 - .../node_modules/pkg/dist/string.js | 1 - .../node_modules/pkg/dist/string.test.d.ts | 1 - .../node_modules/pkg/package.json | 9 - .../node_modules/exports-field/package.json | 7 - .../node_modules/pack1/index.js | 0 .../test/fixtures/exports-field/a.js | 1 - .../node_modules/exports-field/lib/browser.js | 1 - .../node_modules/exports-field/lib/index.js | 0 .../exports-field/lib/lib2/main.js | 1 - .../node_modules/exports-field/lib/main.js | 1 - .../node_modules/exports-field/main.js | 1 - .../node_modules/exports-field/package.json | 18 - .../node_modules/exports-field/x.js | 1 - .../invalid-exports-field/index.js | 0 .../invalid-exports-field/package.json | 13 - .../node_modules/invalid-exports-field/umd.js | 0 .../test/fixtures/exports-field/package.json | 5 - .../node_modules/exports-field/index.js | 1 - .../node_modules/exports-field/lib/browser.js | 1 - .../exports-field/lib/lib2/main.js | 1 - .../node_modules/exports-field/lib/main.js | 1 - .../node_modules/exports-field/main.js | 1 - .../node_modules/exports-field/package.json | 17 - .../node_modules/exports-field/index | 0 .../node_modules/exports-field/main.js | 1 - .../node_modules/exports-field/package.json | 10 - .../node_modules/exports-field/src/index.js | 0 .../fixtures/extension-alias/dir/index.js | 0 .../fixtures/extension-alias/dir/index.ts | 0 .../fixtures/extension-alias/dir2/index.js | 0 .../fixtures/extension-alias/dir2/index.mts | 0 .../test/fixtures/extension-alias/index.js | 0 .../test/fixtures/extension-alias/index.mjs | 0 .../fixtures/extension-alias/index.mts.js | 0 .../test/fixtures/extension-alias/index.ts | 0 .../test/fixtures/extensions/app.module.js | 0 .../test/fixtures/extensions/dir/index.js | 0 .../test/fixtures/extensions/dir/index.ts | 0 .../test/fixtures/extensions/foo.js | 0 .../test/fixtures/extensions/foo.ts | 0 .../test/fixtures/extensions/index.js | 0 .../test/fixtures/extensions/index.ts | 0 .../extensions/node_modules/module.js | 0 .../extensions/node_modules/module/index.ts | 0 .../test/fixtures/extensions/package.json | 3 - .../enhanced_resolve/test/fixtures/file.load1 | 0 .../enhanced_resolve/test/fixtures/file.load2 | 0 .../test/fixtures/foo/index.js | 0 .../test/fixtures/foo/package.json | 4 - .../node_modules/m/package.json | 17 - .../node_modules/m/src/features/f.js | 0 .../m/src/features/internal/file.js | 0 .../node_modules/m/src/features/y/y.js | 0 .../node_modules/m/src/internal/i.js | 0 .../node_modules/m/src/middle-1/f.js | 0 .../node_modules/m/src/middle-1/nested/f.js | 0 .../node_modules/m/src/middle-2/nested/f.js | 1 - .../m/src/middle-3/nested/f/nested/f.js | 0 .../node_modules/m/src/middle-4/f/f.js | 0 .../node_modules/m/src/middle-5/f$/$.js | 0 .../node_modules/m/src/middle-5/f/$.js | 0 .../node_modules/m/src/middle/f.js | 0 .../node_modules/m/src/middle/nested/f.js | 0 .../test/fixtures/imports-field/a.js | 1 - .../test/fixtures/imports-field/b.js | 0 .../test/fixtures/imports-field/dir/b.js | 0 .../node_modules/a/lib/browser.js | 1 - .../imports-field/node_modules/a/lib/index.js | 0 .../node_modules/a/lib/lib2/main.js | 1 - .../imports-field/node_modules/a/lib/main.js | 1 - .../imports-field/node_modules/a/main.js | 1 - .../imports-field/node_modules/a/package.json | 18 - .../imports-field/node_modules/a/x.js | 1 - .../imports-field/node_modules/c/index.js | 0 .../test/fixtures/imports-field/package.json | 17 - .../fixtures/incorrect-package/pack1/a.js | 0 .../incorrect-package/pack1/package.json | 2 - .../fixtures/incorrect-package/pack2/a.js | 0 .../incorrect-package/pack2/package.json | 0 .../test/fixtures/issue-238/package.json | 3 - .../test/fixtures/issue-238/src/a/config.js | 0 .../src/common/config/myObjectFile.js | 0 .../enhanced_resolve/test/fixtures/lib.js | 0 .../test/fixtures/lib/complex1.js | 1 - .../test/fixtures/main-field-self/index.js | 0 .../fixtures/main-field-self/package.json | 3 - .../test/fixtures/main-field-self2/index.js | 0 .../fixtures/main-field-self2/package.json | 3 - .../enhanced_resolve/test/fixtures/main1.js | 9 - .../enhanced_resolve/test/fixtures/main2.js | 12 - .../enhanced_resolve/test/fixtures/main3.js | 4 - .../multiple_modules/node_modules/m1/a.js | 3 - .../test/fixtures/no#fragment/#/#.js | 0 fixtures/enhanced_resolve/test/fixtures/no.js | 0 .../browser-module-broken/browser.js | 0 .../browser-module-broken/main.js | 0 .../browser-module-broken/package.json | 4 - .../complexm/node_modules/m1/a.js | 1 - .../complexm/node_modules/m1/index.js | 1 - .../fixtures/node_modules/complexm/step1.js | 1 - .../fixtures/node_modules/complexm/step2.js | 1 - .../fixtures/node_modules/dash-name/index.js | 0 .../node_modules/dash-name/package.json | 4 - .../test/fixtures/node_modules/dash/index.js | 0 .../fixtures/node_modules/dash/package.json | 4 - .../invalidPackageJson/package.json | 0 .../test/fixtures/node_modules/m1/a.js | 3 - .../test/fixtures/node_modules/m1/b.js | 3 - .../test/fixtures/node_modules/m2/b.js | 1 - .../node_modules/recursive-module/file.js | 0 .../node_modules/recursive-module/index.js | 0 .../test/fixtures/pnp-a/m2/a.js | 3 - .../test/fixtures/pnp/pkg/dir/index.js | 0 .../test/fixtures/pnp/pkg/index.js | 0 .../test/fixtures/pnp/pkg/main.js | 0 .../fixtures/pnp/pkg/package-alias/browser.js | 0 .../fixtures/pnp/pkg/package-alias/index.js | 0 .../test/fixtures/pnp/pkg/package.json | 7 - .../test/fixtures/pnp/pkg/typescript/index.ts | 0 .../test/fixtures/pnp/pkg3/a.js | 1 - .../test/fixtures/pnp/pkg3/package.json | 8 - .../prefer-pnp/alternative-modules/m1/b.js | 0 .../restrictions/node_modules/pck1/index.css | 0 .../restrictions/node_modules/pck1/index.js | 0 .../node_modules/pck1/package.json | 3 - .../restrictions/node_modules/pck2/index.css | 0 .../restrictions/node_modules/pck2/module.js | 0 .../node_modules/pck2/package.json | 5 - .../test/fixtures/roots_fall_through/index.js | 0 .../scoped/node_modules/@scope/pack1/main.js | 0 .../node_modules/@scope/pack1/package.json | 5 - .../node_modules/@scope/pack2/lib/index.js | 0 .../scoped/node_modules/@scope/pack2/main.js | 0 .../node_modules/@scope/pack2/package.json | 3 - .../test/fixtures/shortcutdir.js/a.js | 0 .../test/fixtures/yield/a/foo-2/b | 0 .../test/fixtures/yield/a/foo-2/c | 0 .../test/fixtures/yield/a/foo/a | 0 .../test/fixtures/yield/a/foo/b | 0 .../test/fixtures/yield/b/foo/a | 0 .../test/fixtures/yield/c/foo/a | 0 .../test/fixtures/yield/c/foo/package.json | 7 - .../fixtures/\346\265\213\350\257\225.js" | 0 .../\344\270\255\346\226\207.js" | 0 fixtures/pnpm/.gitignore | 1 - fixtures/pnpm/package.json | 10 - fixtures/pnpm/pnpm-lock.yaml | 212 -- fixtures/tsconfig/cases/builtins/thing.js | 0 .../tsconfig/cases/builtins/tsconfig.json | 5 - fixtures/tsconfig/cases/exports/index.js | 0 fixtures/tsconfig/cases/exports/tsconfig.json | 3 - .../extends-extension/base-tsconfig.json | 7 - .../tsconfig/cases/extends-extension/foo.js | 0 .../cases/extends-extension/tsconfig.json | 3 - .../cases/extends-extensionless/foo.js | 0 .../cases/extends-extensionless/tsconfig.json | 3 - .../tsconfig/cases/extends-multiple/foo.js | 0 .../cases/extends-multiple/tsconfig.json | 6 - .../tsconfig/cases/extends-not-found/index.js | 0 .../cases/extends-not-found/tsconfig.json | 3 - .../tsconfig/cases/extends-paths/src/index.js | 0 .../cases/extends-paths/tsconfig.base.json | 7 - .../cases/extends-paths/tsconfig.json | 6 - fixtures/tsconfig/cases/field/index.js | 0 fixtures/tsconfig/cases/field/tsconfig.json | 3 - fixtures/tsconfig/cases/index/index.js | 0 fixtures/tsconfig/cases/index/tsconfig.json | 3 - .../cases/paths_template_variable/foo.js | 0 .../paths_template_variable/tsconfig1.json | 3 - .../paths_template_variable/tsconfig2.json | 8 - .../project_references/app/aliased/index.ts | 0 .../cases/project_references/app/index.ts | 0 .../project_references/app/tsconfig.json | 23 - .../project_a/aliased/index.ts | 0 .../project_references/project_a/conf.json | 8 - .../project_references/project_a/index.ts | 0 .../project_b/src/aliased/index.ts | 0 .../project_b/tsconfig.json | 9 - .../project_references/project_c/index.ts | 0 .../project_c/tsconfig.json | 5 - .../project_references/tsconfig.base.json | 4 - fixtures/tsconfig/cases/suffixes/a.ios.ts | 0 fixtures/tsconfig/cases/suffixes/a.ts | 0 fixtures/tsconfig/cases/suffixes/b.ts | 0 fixtures/tsconfig/cases/suffixes/c-test.ts | 0 fixtures/tsconfig/cases/suffixes/index.ts | 1 - .../tsconfig/cases/suffixes/tsconfig.json | 5 - fixtures/tsconfig/cases/trailing-comma/bar.js | 0 .../tsconfig/cases/trailing-comma/index.js | 0 .../cases/trailing-comma/tsconfig.json | 9 - fixtures/tsconfig/foo.js | 0 fixtures/tsconfig/nested/index.js | 0 fixtures/tsconfig/nested/test.js | 0 fixtures/tsconfig/nested/tsconfig.json | 8 - .../node_modules/tsconfig-exports/conf.json | 7 - .../node_modules/tsconfig-exports/foo.js | 0 .../tsconfig-exports/package.json | 7 - .../node_modules/tsconfig-field/conf.json | 7 - .../node_modules/tsconfig-field/foo.js | 0 .../node_modules/tsconfig-field/package.json | 5 - .../node_modules/tsconfig-index/foo.js | 0 .../node_modules/tsconfig-index/package.json | 4 - .../node_modules/tsconfig-index/tsconfig.json | 7 - .../node_modules/tsconfig-not-used/foo.js | 0 .../tsconfig-not-used/tsconfig.json | 7 - fixtures/tsconfig/package.json | 24 - fixtures/tsconfig/tsconfig.json | 7 - .../tsconfig/tsconfig_template_variable.json | 7 - napi/__test__/resolver.spec.mjs | 260 -- napi/src/lib.rs | 166 - napi/src/options.rs | 261 -- napi/tests/options.test.mjs | 59 - npm/package.json | 67 +- package.json | 53 +- pnpm-lock.yaml | 2690 ----------------- src/builtins.rs | 71 - src/cache.rs | 369 --- src/context.rs | 89 - src/error.rs | 160 - src/file_system.rs | 133 - src/lib.rs | 1670 ---------- src/options.rs | 623 ---- src/package_json.rs | 207 -- src/path.rs | 132 - src/resolution.rs | 92 - src/specifier.rs | 230 -- src/tests/alias.rs | 280 -- src/tests/browser_field.rs | 189 -- src/tests/builtins.rs | 121 - src/tests/dependencies.rs | 110 - src/tests/exports_field.rs | 2546 ---------------- src/tests/extension_alias.rs | 66 - src/tests/extensions.rs | 125 - src/tests/fallback.rs | 100 - src/tests/full_specified.rs | 113 - src/tests/imports_field.rs | 1320 -------- src/tests/incorrect_description_file.rs | 62 - src/tests/main_field.rs | 24 - src/tests/memory_fs.rs | 74 - src/tests/missing.rs | 106 - src/tests/mod.rs | 49 - src/tests/resolve.rs | 119 - src/tests/restrictions.rs | 25 - src/tests/roots.rs | 92 - src/tests/scoped_packages.rs | 25 - src/tests/simple.rs | 68 - src/tests/symlink.rs | 121 - src/tests/tsconfig_paths.rs | 507 ---- src/tests/tsconfig_project_references.rs | 101 - src/tsconfig.rs | 212 -- tests/integration_test.rs | 102 - tests/package.json | 3 - tests/resolve_test.rs | 104 - 290 files changed, 50 insertions(+), 15709 deletions(-) delete mode 100644 Cargo.lock delete mode 100644 fixtures/enhanced_resolve/lib/index.js delete mode 100644 fixtures/enhanced_resolve/package.json delete mode 100644 fixtures/enhanced_resolve/test/.gitignore delete mode 100644 fixtures/enhanced_resolve/test/fixtures/#/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/abc.txt delete mode 100644 fixtures/enhanced_resolve/test/fixtures/alias/files/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/browser/module-a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/ignore.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/replaced.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/self.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/toString.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-c.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/c.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/d.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/builtins/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/c.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/complex.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/crypto-js/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/decorated-fs/exists.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/dirOrFile.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/directory-default/directory-default.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/pack1/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/umd.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/index delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/src/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.mts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mjs delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mts.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/app.module.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/foo.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/foo.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/file.load1 delete mode 100644 fixtures/enhanced_resolve/test/fixtures/file.load2 delete mode 100644 fixtures/enhanced_resolve/test/fixtures/foo/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/foo/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/internal/file.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/y/y.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/internal/i.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-3/nested/f/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-4/f/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f$/$.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f/$.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/dir/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/c/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/issue-238/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/issue-238/src/a/config.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/issue-238/src/common/config/myObjectFile.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/lib.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/lib/complex1.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self2/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main1.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main2.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main3.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/no#fragment/#/#.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/no.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/invalidPackageJson/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/file.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/dir/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/typescript/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/prefer-pnp/alternative-modules/m1/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.css delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/index.css delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/module.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/roots_fall_through/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/lib/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/shortcutdir.js/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/b delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/c delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo/a delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo/b delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/b/foo/a delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/c/foo/a delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json delete mode 100644 "fixtures/enhanced_resolve/test/fixtures/\346\265\213\350\257\225.js" delete mode 100644 "fixtures/misc/\344\270\255\346\226\207/\344\270\255\346\226\207.js" delete mode 100644 fixtures/pnpm/.gitignore delete mode 100644 fixtures/pnpm/package.json delete mode 100644 fixtures/pnpm/pnpm-lock.yaml delete mode 100644 fixtures/tsconfig/cases/builtins/thing.js delete mode 100644 fixtures/tsconfig/cases/builtins/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/exports/index.js delete mode 100644 fixtures/tsconfig/cases/exports/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-extension/base-tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-extension/foo.js delete mode 100644 fixtures/tsconfig/cases/extends-extension/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-extensionless/foo.js delete mode 100644 fixtures/tsconfig/cases/extends-extensionless/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-multiple/foo.js delete mode 100644 fixtures/tsconfig/cases/extends-multiple/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-not-found/index.js delete mode 100644 fixtures/tsconfig/cases/extends-not-found/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-paths/src/index.js delete mode 100644 fixtures/tsconfig/cases/extends-paths/tsconfig.base.json delete mode 100644 fixtures/tsconfig/cases/extends-paths/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/field/index.js delete mode 100644 fixtures/tsconfig/cases/field/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/index/index.js delete mode 100644 fixtures/tsconfig/cases/index/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/paths_template_variable/foo.js delete mode 100644 fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json delete mode 100644 fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json delete mode 100644 fixtures/tsconfig/cases/project_references/app/aliased/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/app/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/app/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/project_references/project_a/aliased/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_a/conf.json delete mode 100644 fixtures/tsconfig/cases/project_references/project_a/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_b/src/aliased/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_b/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/project_references/project_c/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_c/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/project_references/tsconfig.base.json delete mode 100644 fixtures/tsconfig/cases/suffixes/a.ios.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/a.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/b.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/c-test.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/index.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/trailing-comma/bar.js delete mode 100644 fixtures/tsconfig/cases/trailing-comma/index.js delete mode 100644 fixtures/tsconfig/cases/trailing-comma/tsconfig.json delete mode 100644 fixtures/tsconfig/foo.js delete mode 100644 fixtures/tsconfig/nested/index.js delete mode 100644 fixtures/tsconfig/nested/test.js delete mode 100644 fixtures/tsconfig/nested/tsconfig.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-exports/conf.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-exports/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-exports/package.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-field/conf.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-field/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-field/package.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-index/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-index/package.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-not-used/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json delete mode 100755 fixtures/tsconfig/package.json delete mode 100644 fixtures/tsconfig/tsconfig.json delete mode 100644 fixtures/tsconfig/tsconfig_template_variable.json delete mode 100644 napi/__test__/resolver.spec.mjs delete mode 100644 napi/src/lib.rs delete mode 100644 napi/src/options.rs delete mode 100644 napi/tests/options.test.mjs delete mode 100644 pnpm-lock.yaml delete mode 100644 src/builtins.rs delete mode 100644 src/cache.rs delete mode 100644 src/context.rs delete mode 100644 src/error.rs delete mode 100644 src/file_system.rs delete mode 100644 src/lib.rs delete mode 100644 src/options.rs delete mode 100644 src/package_json.rs delete mode 100644 src/path.rs delete mode 100644 src/resolution.rs delete mode 100644 src/specifier.rs delete mode 100644 src/tests/alias.rs delete mode 100644 src/tests/browser_field.rs delete mode 100644 src/tests/builtins.rs delete mode 100644 src/tests/dependencies.rs delete mode 100644 src/tests/exports_field.rs delete mode 100644 src/tests/extension_alias.rs delete mode 100644 src/tests/extensions.rs delete mode 100644 src/tests/fallback.rs delete mode 100644 src/tests/full_specified.rs delete mode 100644 src/tests/imports_field.rs delete mode 100644 src/tests/incorrect_description_file.rs delete mode 100644 src/tests/main_field.rs delete mode 100644 src/tests/memory_fs.rs delete mode 100644 src/tests/missing.rs delete mode 100644 src/tests/mod.rs delete mode 100644 src/tests/resolve.rs delete mode 100644 src/tests/restrictions.rs delete mode 100644 src/tests/roots.rs delete mode 100644 src/tests/scoped_packages.rs delete mode 100644 src/tests/simple.rs delete mode 100644 src/tests/symlink.rs delete mode 100644 src/tests/tsconfig_paths.rs delete mode 100644 src/tests/tsconfig_project_references.rs delete mode 100644 src/tsconfig.rs delete mode 100644 tests/integration_test.rs delete mode 100644 tests/package.json delete mode 100644 tests/resolve_test.rs diff --git a/Cargo.lock b/Cargo.lock deleted file mode 100644 index c83523b3..00000000 --- a/Cargo.lock +++ /dev/null @@ -1,858 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "aho-corasick" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" -dependencies = [ - "memchr", -] - -[[package]] -name = "anes" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "735d4f398ca57cfa2880225c2bf81c3b9af3be5bb22e44ae70118dad38713e84" - -[[package]] -name = "autocfg" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "bitflags" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" - -[[package]] -name = "bpaf" -version = "0.9.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3280efcf6d66bc77c2cf9b67dc8acee47a217d9be67dd590b3230dffe663724d" - -[[package]] -name = "cast" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "ciborium" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42e69ffd6f0917f5c029256a24d0161db17cea3997d185db0d35926308770f0e" -dependencies = [ - "ciborium-io", - "ciborium-ll", - "serde", -] - -[[package]] -name = "ciborium-io" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05afea1e0a06c9be33d539b876f1ce3692f4afea2cb41f740e7743225ed1c757" - -[[package]] -name = "ciborium-ll" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57663b653d948a338bfb3eeba9bb2fd5fcfaecb9e199e87e1eda4d9e8b240fd9" -dependencies = [ - "ciborium-io", - "half", -] - -[[package]] -name = "clean-path" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aaa6b4b263a5d737e9bf6b7c09b72c41a5480aec4d7219af827f6564e950b6a5" - -[[package]] -name = "codspeed" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a104ac948e0188b921eb3fcbdd55dcf62e542df4c7ab7e660623f6288302089" -dependencies = [ - "colored", - "libc", - "serde_json", -] - -[[package]] -name = "colored" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbf2150cce219b664a8a70df7a1f933836724b503f8a413af9365b4dcc4d90b8" -dependencies = [ - "lazy_static", - "windows-sys 0.48.0", -] - -[[package]] -name = "convert_case" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec182b0ca2f35d8fc196cf3404988fd8b8c739a4d270ff118a398feb0cbec1ca" -dependencies = [ - "unicode-segmentation", -] - -[[package]] -name = "criterion2" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7258985df1aa8b33359ee2392cbc3b7802875242cdacdda91a17a602132c24a9" -dependencies = [ - "anes", - "bpaf", - "cast", - "ciborium", - "codspeed", - "colored", - "num-traits", - "oorandom", - "serde", - "serde_json", - "walkdir", -] - -[[package]] -name = "crossbeam-deque" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" -dependencies = [ - "crossbeam-epoch", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.9.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" -dependencies = [ - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" - -[[package]] -name = "crunchy" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" - -[[package]] -name = "ctor" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edb49164822f3ee45b17acd4a208cfc1251410cf0cad9a833234c9890774dd9f" -dependencies = [ - "quote", - "syn", -] - -[[package]] -name = "dashmap" -version = "5.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" -dependencies = [ - "cfg-if", - "hashbrown", - "lock_api", - "once_cell", - "parking_lot_core", -] - -[[package]] -name = "document-features" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef5282ad69563b5fc40319526ba27e0e7363d552a896f0297d54f767717f9b95" -dependencies = [ - "litrs", -] - -[[package]] -name = "dunce" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b" - -[[package]] -name = "either" -version = "1.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dca9240753cf90908d7e4aac30f630662b02aebaa1b58a3cadabdb23385b58b" - -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "filetime" -version = "0.2.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ee447700ac8aa0b2f2bd7bc4462ad686ba06baa6727ac149a2d6277f0d240fd" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall 0.4.1", - "windows-sys 0.52.0", -] - -[[package]] -name = "half" -version = "2.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dd08c532ae367adf81c312a4580bc67f1d0fe8bc9c460520283f4c0ff277888" -dependencies = [ - "cfg-if", - "crunchy", -] - -[[package]] -name = "hashbrown" -version = "0.14.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" - -[[package]] -name = "indexmap" -version = "2.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" -dependencies = [ - "equivalent", - "hashbrown", - "serde", -] - -[[package]] -name = "itoa" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" - -[[package]] -name = "json-strip-comments" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3d129799327c8f80861e467c59b825ba24c277dba6ad0d71a141dc98f9e04ee" - -[[package]] -name = "lazy_static" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" - -[[package]] -name = "libc" -version = "0.2.155" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" - -[[package]] -name = "libloading" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c2a198fb6b0eada2a8df47933734e6d35d350665a33a3593d7164fa52c75c19" -dependencies = [ - "cfg-if", - "windows-targets 0.52.5", -] - -[[package]] -name = "litrs" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4ce301924b7887e9d637144fdade93f9dfff9b60981d4ac161db09720d39aa5" - -[[package]] -name = "lock_api" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" -dependencies = [ - "autocfg", - "scopeguard", -] - -[[package]] -name = "memchr" -version = "2.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" - -[[package]] -name = "napi" -version = "2.16.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfc300228808a0e6aea5a58115c82889240bcf8dab16fc25ad675b33e454b368" -dependencies = [ - "bitflags 2.5.0", - "ctor", - "napi-derive", - "napi-sys", - "once_cell", - "serde", - "serde_json", -] - -[[package]] -name = "napi-build" -version = "2.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1c0f5d67ee408a4685b61f5ab7e58605c8ae3f2b4189f0127d804ff13d5560a" - -[[package]] -name = "napi-derive" -version = "2.16.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0e034ddf6155192cf83f267ede763fe6c164dfa9971585436b16173718d94c4" -dependencies = [ - "cfg-if", - "convert_case", - "napi-derive-backend", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "napi-derive-backend" -version = "1.0.67" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bff2c00437f3b3266391eb5e6aa25d0029187daf5caf05b8e3271468fb5ae73e" -dependencies = [ - "convert_case", - "once_cell", - "proc-macro2", - "quote", - "regex", - "semver", - "syn", -] - -[[package]] -name = "napi-sys" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "427802e8ec3a734331fec1035594a210ce1ff4dc5bc1950530920ab717964ea3" -dependencies = [ - "libloading", -] - -[[package]] -name = "normalize-path" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5438dd2b2ff4c6df6e1ce22d825ed2fa93ee2922235cc45186991717f0a892d" - -[[package]] -name = "num-traits" -version = "0.2.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" -dependencies = [ - "autocfg", -] - -[[package]] -name = "once_cell" -version = "1.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" - -[[package]] -name = "oorandom" -version = "11.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575" - -[[package]] -name = "oxc_napi_resolver" -version = "0.0.0" -dependencies = [ - "napi", - "napi-build", - "napi-derive", - "oxc_resolver", -] - -[[package]] -name = "oxc_resolver" -version = "1.8.1" -dependencies = [ - "criterion2", - "dashmap", - "document-features", - "dunce", - "json-strip-comments", - "normalize-path", - "once_cell", - "rayon", - "rustc-hash", - "serde", - "serde_json", - "thiserror", - "tracing", - "typescript_tsconfig_json", - "vfs", -] - -[[package]] -name = "parking_lot_core" -version = "0.9.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall 0.5.1", - "smallvec", - "windows-targets 0.52.5", -] - -[[package]] -name = "pin-project-lite" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" - -[[package]] -name = "proc-macro2" -version = "1.0.85" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22244ce15aa966053a896d1accb3a6e68469b97c7f33f284b99f0d576879fc23" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.36" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "rayon" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" -dependencies = [ - "either", - "rayon-core", -] - -[[package]] -name = "rayon-core" -version = "1.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" -dependencies = [ - "crossbeam-deque", - "crossbeam-utils", -] - -[[package]] -name = "redox_syscall" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" -dependencies = [ - "bitflags 1.3.2", -] - -[[package]] -name = "redox_syscall" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "469052894dcb553421e483e4209ee581a45100d31b4018de03e5a7ad86374a7e" -dependencies = [ - "bitflags 2.5.0", -] - -[[package]] -name = "regex" -version = "1.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" -dependencies = [ - "aho-corasick", - "memchr", - "regex-automata", - "regex-syntax", -] - -[[package]] -name = "regex-automata" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", -] - -[[package]] -name = "regex-syntax" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" - -[[package]] -name = "rustc-hash" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" - -[[package]] -name = "ryu" -version = "1.0.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" - -[[package]] -name = "same-file" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "scopeguard" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" - -[[package]] -name = "semver" -version = "1.0.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" - -[[package]] -name = "serde" -version = "1.0.203" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7253ab4de971e72fb7be983802300c30b5a7f0c2e56fab8abfc6a214307c0094" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.203" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "serde_json" -version = "1.0.117" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3" -dependencies = [ - "indexmap", - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "smallvec" -version = "1.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" - -[[package]] -name = "syn" -version = "2.0.66" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c42f3f41a2de00b01c0aaad383c5a45241efc8b2d1eda5661812fda5f3cdcff5" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "thiserror" -version = "1.0.61" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.61" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "tracing" -version = "0.1.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" -dependencies = [ - "pin-project-lite", - "tracing-attributes", - "tracing-core", -] - -[[package]] -name = "tracing-attributes" -version = "0.1.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "tracing-core" -version = "0.1.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" -dependencies = [ - "once_cell", -] - -[[package]] -name = "typescript_tsconfig_json" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7cc416eaf05297012ead9d192226fe9a92e9a20f64f8780efb9085aaae9b590" -dependencies = [ - "clean-path", - "indexmap", - "rustc-hash", - "serde", - "serde_json", -] - -[[package]] -name = "unicode-ident" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" - -[[package]] -name = "unicode-segmentation" -version = "1.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" - -[[package]] -name = "vfs" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "654cd097e182a71dbf899178e6b5662c2157dd0b8afd5975de18008f6fc173d1" -dependencies = [ - "filetime", -] - -[[package]] -name = "walkdir" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" -dependencies = [ - "same-file", - "winapi-util", -] - -[[package]] -name = "winapi-util" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b" -dependencies = [ - "windows-sys 0.52.0", -] - -[[package]] -name = "windows-sys" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" -dependencies = [ - "windows-targets 0.48.5", -] - -[[package]] -name = "windows-sys" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" -dependencies = [ - "windows-targets 0.52.5", -] - -[[package]] -name = "windows-targets" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" -dependencies = [ - "windows_aarch64_gnullvm 0.48.5", - "windows_aarch64_msvc 0.48.5", - "windows_i686_gnu 0.48.5", - "windows_i686_msvc 0.48.5", - "windows_x86_64_gnu 0.48.5", - "windows_x86_64_gnullvm 0.48.5", - "windows_x86_64_msvc 0.48.5", -] - -[[package]] -name = "windows-targets" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" -dependencies = [ - "windows_aarch64_gnullvm 0.52.5", - "windows_aarch64_msvc 0.52.5", - "windows_i686_gnu 0.52.5", - "windows_i686_gnullvm", - "windows_i686_msvc 0.52.5", - "windows_x86_64_gnu 0.52.5", - "windows_x86_64_gnullvm 0.52.5", - "windows_x86_64_msvc 0.52.5", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" - -[[package]] -name = "windows_i686_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" - -[[package]] -name = "windows_i686_gnu" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" - -[[package]] -name = "windows_i686_gnullvm" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" - -[[package]] -name = "windows_i686_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" - -[[package]] -name = "windows_i686_msvc" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" diff --git a/fixtures/enhanced_resolve/lib/index.js b/fixtures/enhanced_resolve/lib/index.js deleted file mode 100644 index 1e872e8f..00000000 --- a/fixtures/enhanced_resolve/lib/index.js +++ /dev/null @@ -1 +0,0 @@ -// mimic enhanced-resolved root directory structure diff --git a/fixtures/enhanced_resolve/package.json b/fixtures/enhanced_resolve/package.json deleted file mode 100644 index d1b845b5..00000000 --- a/fixtures/enhanced_resolve/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "enhanced-resolve", - "main": "lib/index.js" -} diff --git a/fixtures/enhanced_resolve/test/.gitignore b/fixtures/enhanced_resolve/test/.gitignore deleted file mode 100644 index bbbec5f4..00000000 --- a/fixtures/enhanced_resolve/test/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# created by symlink.rs -/temp diff --git a/fixtures/enhanced_resolve/test/fixtures/#/a.js b/fixtures/enhanced_resolve/test/fixtures/#/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/a.js b/fixtures/enhanced_resolve/test/fixtures/a.js deleted file mode 100644 index 896ffc6d..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/abc.txt b/fixtures/enhanced_resolve/test/fixtures/abc.txt deleted file mode 100644 index f2ba8f84..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/abc.txt +++ /dev/null @@ -1 +0,0 @@ -abc \ No newline at end of file diff --git a/fixtures/enhanced_resolve/test/fixtures/alias/files/a.js b/fixtures/enhanced_resolve/test/fixtures/alias/files/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/b.js b/fixtures/enhanced_resolve/test/fixtures/b.js deleted file mode 100644 index 11476340..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/b.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function b() { - return "This is b"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/browser/module-a.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/browser/module-a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/browser.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/ignore.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/ignore.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/replaced.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/replaced.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/self.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/self.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/toString.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/toString.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-a.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-b.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-c.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-c.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/a.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/b.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/c.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/c.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/d.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/d.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json deleted file mode 100644 index c13fe23b..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "browser": { - "a.js": "./a", - "./b.js": "./b", - "c.js": "./d.js", - "./d.js": "./c.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/package.json b/fixtures/enhanced_resolve/test/fixtures/browser-module/package.json deleted file mode 100644 index 19ff7739..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/browser-module/package.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "exports": { - "./lib/index.js": "./lib/index.js" - }, - "browser": { - "./lib/ignore.js": false, - "./lib/replaced.js": "./lib/browser", - "module-a": "./browser/module-a.js", - "module-b": "module-c", - "module-c": "module-c", - "./toString": "./lib/toString.js", - "./lib/main.js": "./lib/main.js", - "./main.js": "./lib/main.js", - "./lib/xyz.js": "./xyz.js", - "./xyz.js": "./lib/xyz.js", - "./lib/non-existent.js": "./lib/non-existent.js", - ".": false, - "./number": 1, - "./foo": "./lib/replaced.js?query" - }, - "innerBrowser1": { - "field": { - "browser": { - "./lib/main1.js": "./lib/main.js" - } - } - }, - "innerBrowser2": { - "browser": { - "./lib/main2.js": "./lib/replaced.js" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/builtins/package.json b/fixtures/enhanced_resolve/test/fixtures/builtins/package.json deleted file mode 100644 index 4a54ea96..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/builtins/package.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "name": "builtins", - "private": true, - "imports": { - "#fs": { - "default": "fs" - }, - "#http": { - "node": "node:http" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/c.js b/fixtures/enhanced_resolve/test/fixtures/c.js deleted file mode 100644 index e3aca8aa..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/c.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = function b() { - require("./a"); - return "This is c"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/complex.js b/fixtures/enhanced_resolve/test/fixtures/complex.js deleted file mode 100644 index 1f62db84..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/complex.js +++ /dev/null @@ -1,13 +0,0 @@ -var 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); diff --git a/fixtures/enhanced_resolve/test/fixtures/crypto-js/index.js b/fixtures/enhanced_resolve/test/fixtures/crypto-js/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json b/fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json deleted file mode 100644 index 1d31aa8b..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "crypto-js", - "main": "index.js", - "browser": { - "crypto": false - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/decorated-fs/exists.js b/fixtures/enhanced_resolve/test/fixtures/decorated-fs/exists.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/dirOrFile.js b/fixtures/enhanced_resolve/test/fixtures/dirOrFile.js deleted file mode 100644 index c3cb885f..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/dirOrFile.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "file"; diff --git a/fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js b/fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js deleted file mode 100644 index 85e01cd4..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "dir"; diff --git a/fixtures/enhanced_resolve/test/fixtures/directory-default/directory-default.js b/fixtures/enhanced_resolve/test/fixtures/directory-default/directory-default.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js deleted file mode 100644 index d1007aae..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js +++ /dev/null @@ -1 +0,0 @@ -export default "string"; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts deleted file mode 100644 index cb0ff5c3..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json deleted file mode 100644 index b523a1e9..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "@org/pkg", - "exports": { - "./*.js": { - "types": "./dist/*.d.ts", - "default": "./dist/*.js" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js deleted file mode 100644 index d1007aae..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js +++ /dev/null @@ -1 +0,0 @@ -export default "string"; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts deleted file mode 100644 index cb0ff5c3..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json deleted file mode 100644 index 8e55fb46..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "@raviqqe/hidash", - "exports": { - "./*.js": { - "types": "./dist/*.d.ts", - "default": "./dist/*.js" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json deleted file mode 100644 index f0edf449..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "exports-field", - "version": "1.0.0", - "exports": { - ".": "./a/../b/../../pack1/index.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/pack1/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/pack1/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/a.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/a.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json deleted file mode 100644 index 6b105c08..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "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/": { - "webpack": ["./lib/lib2/", "./lib/"], - "node": "./lib/", - "default": "./lib/" - }, - "./dist/a.js": "./../../a.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json deleted file mode 100644 index 0012a3de..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "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" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/umd.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/umd.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field/package.json deleted file mode 100644 index 5fa72bb5..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "@exports-field/core", - "version": "1.0.0", - "exports": "./a.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json deleted file mode 100644 index e6f12074..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "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/lib2/", "./lib/"], - "node": "./lib/", - "default": "./lib/" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/index b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/index deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json deleted file mode 100644 index 1a838f49..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "name": "exports-field", - "exportsField": { - "exports": "./main.js" - }, - "ex": "./index", - "broken": { - ".": "./src" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/src/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/src/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.ts b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.mts b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.mts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mjs b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mjs deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mts.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mts.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.ts b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/app.module.js b/fixtures/enhanced_resolve/test/fixtures/extensions/app.module.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.js b/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/foo.js b/fixtures/enhanced_resolve/test/fixtures/extensions/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/foo.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/foo.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/index.js b/fixtures/enhanced_resolve/test/fixtures/extensions/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/index.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module.js b/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module/index.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/package.json b/fixtures/enhanced_resolve/test/fixtures/extensions/package.json deleted file mode 100644 index 5e55a1e8..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/extensions/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "./index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/file.load1 b/fixtures/enhanced_resolve/test/fixtures/file.load1 deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/file.load2 b/fixtures/enhanced_resolve/test/fixtures/file.load2 deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/foo/index.js b/fixtures/enhanced_resolve/test/fixtures/foo/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/foo/package.json b/fixtures/enhanced_resolve/test/fixtures/foo/package.json deleted file mode 100644 index da86787a..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/foo/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "foo", - "version": "1.0.0" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json deleted file mode 100644 index aa2be496..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "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" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/internal/file.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/internal/file.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/y/y.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/y/y.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/internal/i.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/internal/i.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/nested/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js deleted file mode 100644 index e5b70a86..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = { nested: "nested" } diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-3/nested/f/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-3/nested/f/nested/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-4/f/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-4/f/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f$/$.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f$/$.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f/$.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f/$.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/nested/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/a.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/a.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/b.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/dir/b.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/dir/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/index.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json deleted file mode 100644 index 8d8d3a46..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "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/lib2/", "./lib/"], - "node": "./lib/", - "default": "./lib/" - }, - "./dist/a.js": "./../../a.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/c/index.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/c/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/imports-field/package.json deleted file mode 100644 index 248351a9..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "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" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/a.js b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json deleted file mode 100644 index ded7faa2..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json +++ /dev/null @@ -1,2 +0,0 @@ -{ - "main": "./a.js", diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/a.js b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/package.json b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/package.json deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/issue-238/package.json b/fixtures/enhanced_resolve/test/fixtures/issue-238/package.json deleted file mode 100644 index 352055cd..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/issue-238/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "private": true -} diff --git a/fixtures/enhanced_resolve/test/fixtures/issue-238/src/a/config.js b/fixtures/enhanced_resolve/test/fixtures/issue-238/src/a/config.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/issue-238/src/common/config/myObjectFile.js b/fixtures/enhanced_resolve/test/fixtures/issue-238/src/common/config/myObjectFile.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/lib.js b/fixtures/enhanced_resolve/test/fixtures/lib.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/lib/complex1.js b/fixtures/enhanced_resolve/test/fixtures/lib/complex1.js deleted file mode 100644 index b3de3d70..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/lib/complex1.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "lib complex1"; diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self/index.js b/fixtures/enhanced_resolve/test/fixtures/main-field-self/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json b/fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json deleted file mode 100644 index a2b6f341..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "./" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self2/index.js b/fixtures/enhanced_resolve/test/fixtures/main-field-self2/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json b/fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json deleted file mode 100644 index 4fa6f730..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "." -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main1.js b/fixtures/enhanced_resolve/test/fixtures/main1.js deleted file mode 100644 index 168f2a1e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main1.js +++ /dev/null @@ -1,9 +0,0 @@ -var a = require("./a"); -if (x) { - for (var i = 0; i < 100; i++) { - while (true) require("./b"); - do { - i++; - } while (require("m1/a")()); - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main2.js b/fixtures/enhanced_resolve/test/fixtures/main2.js deleted file mode 100644 index 39f062b1..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main2.js +++ /dev/null @@ -1,12 +0,0 @@ -var 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"); - }); - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main3.js b/fixtures/enhanced_resolve/test/fixtures/main3.js deleted file mode 100644 index 1c180166..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main3.js +++ /dev/null @@ -1,4 +0,0 @@ -var a = require("./a"); -require.ensure([], function(require) { - require("./c.js"); -}); diff --git a/fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js b/fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js deleted file mode 100644 index 997c1051..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is nested m1/a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/no#fragment/#/#.js b/fixtures/enhanced_resolve/test/fixtures/no#fragment/#/#.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/no.js b/fixtures/enhanced_resolve/test/fixtures/no.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/browser.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/browser.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/main.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json deleted file mode 100644 index c469e1fd..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "main": "./main.js", - "browser": "./browser.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js deleted file mode 100644 index 549620a5..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "the correct a.js"; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js deleted file mode 100644 index 5db6632e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = " :) " + require("m2/b.js"); diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js deleted file mode 100644 index d308569d..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require("m1/a") + require("m1"); diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js deleted file mode 100644 index cb8127e8..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "Step2"; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json deleted file mode 100644 index 8d6dfa56..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "dash-name", - "exports": "./index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json deleted file mode 100644 index 4fd8706e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "dash", - "exports": "./index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/invalidPackageJson/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/invalidPackageJson/package.json deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js deleted file mode 100644 index 46fc8e6c..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is m1/a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js deleted file mode 100644 index 8565c244..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is m1/b"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js deleted file mode 100644 index 34faaaf5..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "This is m2/b"; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/file.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/file.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js b/fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js deleted file mode 100644 index 997c1051..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is nested m1/a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/dir/index.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/dir/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/index.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/main.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/browser.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/browser.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/index.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json deleted file mode 100644 index e20ceaeb..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "main": "main.js", - "browser": { - "./package-alias/index.js": "./package-alias/browser.js", - "module": "pkg/dir/index" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/typescript/index.ts b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/typescript/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json deleted file mode 100644 index 4a1f838e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "@exports-field/core", - "version": "1.0.0", - "exports": { - ".": "./a.js", - "./x": "./a.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/prefer-pnp/alternative-modules/m1/b.js b/fixtures/enhanced_resolve/test/fixtures/prefer-pnp/alternative-modules/m1/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.css b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.css deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.js b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json deleted file mode 100644 index 14ab704d..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/index.css b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/index.css deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/module.js b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/module.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json deleted file mode 100644 index ee0eb71b..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "main": "../../../c.js", - "module": "module.js", - "style": "index.css" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/roots_fall_through/index.js b/fixtures/enhanced_resolve/test/fixtures/roots_fall_through/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/main.js b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json deleted file mode 100644 index 70a0f20f..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "browser": { - "./index.js": "./main.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/lib/index.js b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/lib/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/main.js b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json deleted file mode 100644 index 2af9e0d1..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "./main.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/shortcutdir.js/a.js b/fixtures/enhanced_resolve/test/fixtures/shortcutdir.js/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/b b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/b deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/c b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/c deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/a b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/a deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/b b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/b deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/b/foo/a b/fixtures/enhanced_resolve/test/fixtures/yield/b/foo/a deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/a b/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/a deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json b/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json deleted file mode 100644 index 0acc4b4c..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "foo", - "version": "1.0.0", - "browser": { - "./a": false - } -} diff --git "a/fixtures/enhanced_resolve/test/fixtures/\346\265\213\350\257\225.js" "b/fixtures/enhanced_resolve/test/fixtures/\346\265\213\350\257\225.js" deleted file mode 100644 index e69de29b..00000000 diff --git "a/fixtures/misc/\344\270\255\346\226\207/\344\270\255\346\226\207.js" "b/fixtures/misc/\344\270\255\346\226\207/\344\270\255\346\226\207.js" deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/pnpm/.gitignore b/fixtures/pnpm/.gitignore deleted file mode 100644 index 3c3629e6..00000000 --- a/fixtures/pnpm/.gitignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/fixtures/pnpm/package.json b/fixtures/pnpm/package.json deleted file mode 100644 index 78712e2b..00000000 --- a/fixtures/pnpm/package.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "name": "pnpm", - "version": "1.0.0", - "private": true, - "devDependencies": { - "axios": "1.6.2", - "styled-components": "6.1.1", - "postcss": "8.4.33" - } -} diff --git a/fixtures/pnpm/pnpm-lock.yaml b/fixtures/pnpm/pnpm-lock.yaml deleted file mode 100644 index e51dfd6a..00000000 --- a/fixtures/pnpm/pnpm-lock.yaml +++ /dev/null @@ -1,212 +0,0 @@ -lockfileVersion: '6.0' - -settings: - autoInstallPeers: true - excludeLinksFromLockfile: false - -devDependencies: - axios: - specifier: 1.6.2 - version: 1.6.2 - postcss: - specifier: 8.4.33 - version: 8.4.33 - styled-components: - specifier: 6.1.1 - version: 6.1.1(react-dom@18.2.0)(react@18.2.0) - -packages: - - /@emotion/is-prop-valid@1.2.1: - resolution: {integrity: sha512-61Mf7Ufx4aDxx1xlDeOm8aFFigGHE4z+0sKCa+IHCeZKiyP9RLD0Mmx7m8b9/Cf37f7NAvQOOJAbQQGVr5uERw==} - dependencies: - '@emotion/memoize': 0.8.1 - dev: true - - /@emotion/memoize@0.8.1: - resolution: {integrity: sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA==} - dev: true - - /@emotion/unitless@0.8.1: - resolution: {integrity: sha512-KOEGMu6dmJZtpadb476IsZBclKvILjopjUii3V+7MnXIQCYh8W3NgNcgwo21n9LXZX6EDIKvqfjYxXebDwxKmQ==} - dev: true - - /@types/stylis@4.2.4: - resolution: {integrity: sha512-36ZrGJ8fgtBr6nwNnuJ9jXIj+bn/pF6UoqmrQT7+Y99+tFFeHHsoR54+194dHdyhPjgbeoNz3Qru0oRt0l6ASQ==} - dev: true - - /asynckit@0.4.0: - resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} - dev: true - - /axios@1.6.2: - resolution: {integrity: sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A==} - dependencies: - follow-redirects: 1.15.3 - form-data: 4.0.0 - proxy-from-env: 1.1.0 - transitivePeerDependencies: - - debug - dev: true - - /camelize@1.0.1: - resolution: {integrity: sha512-dU+Tx2fsypxTgtLoE36npi3UqcjSSMNYfkqgmoEhtZrraP5VWq0K7FkWVTYa8eMPtnU/G2txVsfdCJTn9uzpuQ==} - dev: true - - /combined-stream@1.0.8: - resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} - engines: {node: '>= 0.8'} - dependencies: - delayed-stream: 1.0.0 - dev: true - - /css-color-keywords@1.0.0: - resolution: {integrity: sha512-FyyrDHZKEjXDpNJYvVsV960FiqQyXc/LlYmsxl2BcdMb2WPx0OGRVgTg55rPSyLSNMqP52R9r8geSp7apN3Ofg==} - engines: {node: '>=4'} - dev: true - - /css-to-react-native@3.2.0: - resolution: {integrity: sha512-e8RKaLXMOFii+02mOlqwjbD00KSEKqblnpO9e++1aXS1fPQOpS1YoqdVHBqPjHNoxeF2mimzVqawm2KCbEdtHQ==} - dependencies: - camelize: 1.0.1 - css-color-keywords: 1.0.0 - postcss-value-parser: 4.2.0 - dev: true - - /csstype@3.1.2: - resolution: {integrity: sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==} - dev: true - - /delayed-stream@1.0.0: - resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} - engines: {node: '>=0.4.0'} - dev: true - - /follow-redirects@1.15.3: - resolution: {integrity: sha512-1VzOtuEM8pC9SFU1E+8KfTjZyMztRsgEfwQl44z8A25uy13jSzTj6dyK2Df52iV0vgHCfBwLhDWevLn95w5v6Q==} - engines: {node: '>=4.0'} - peerDependencies: - debug: '*' - peerDependenciesMeta: - debug: - optional: true - dev: true - - /form-data@4.0.0: - resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==} - engines: {node: '>= 6'} - dependencies: - asynckit: 0.4.0 - combined-stream: 1.0.8 - mime-types: 2.1.35 - dev: true - - /js-tokens@4.0.0: - resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} - dev: true - - /loose-envify@1.4.0: - resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==} - hasBin: true - dependencies: - js-tokens: 4.0.0 - dev: true - - /mime-db@1.52.0: - resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} - engines: {node: '>= 0.6'} - dev: true - - /mime-types@2.1.35: - resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} - engines: {node: '>= 0.6'} - dependencies: - mime-db: 1.52.0 - dev: true - - /nanoid@3.3.7: - resolution: {integrity: sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==} - engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} - hasBin: true - dev: true - - /picocolors@1.0.0: - resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==} - dev: true - - /postcss-value-parser@4.2.0: - resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==} - dev: true - - /postcss@8.4.33: - resolution: {integrity: sha512-Kkpbhhdjw2qQs2O2DGX+8m5OVqEcbB9HRBvuYM9pgrjEFUg30A9LmXNlTAUj4S9kgtGyrMbTzVjH7E+s5Re2yg==} - engines: {node: ^10 || ^12 || >=14} - dependencies: - nanoid: 3.3.7 - picocolors: 1.0.0 - source-map-js: 1.0.2 - dev: true - - /proxy-from-env@1.1.0: - resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==} - dev: true - - /react-dom@18.2.0(react@18.2.0): - resolution: {integrity: sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==} - peerDependencies: - react: ^18.2.0 - dependencies: - loose-envify: 1.4.0 - react: 18.2.0 - scheduler: 0.23.0 - dev: true - - /react@18.2.0: - resolution: {integrity: sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==} - engines: {node: '>=0.10.0'} - dependencies: - loose-envify: 1.4.0 - dev: true - - /scheduler@0.23.0: - resolution: {integrity: sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw==} - dependencies: - loose-envify: 1.4.0 - dev: true - - /shallowequal@1.1.0: - resolution: {integrity: sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ==} - dev: true - - /source-map-js@1.0.2: - resolution: {integrity: sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==} - engines: {node: '>=0.10.0'} - dev: true - - /styled-components@6.1.1(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-cpZZP5RrKRIClBW5Eby4JM1wElLVP4NQrJbJ0h10TidTyJf4SIIwa3zLXOoPb4gJi8MsJ8mjq5mu2IrEhZIAcQ==} - engines: {node: '>= 16'} - peerDependencies: - react: '>= 16.8.0' - react-dom: '>= 16.8.0' - dependencies: - '@emotion/is-prop-valid': 1.2.1 - '@emotion/unitless': 0.8.1 - '@types/stylis': 4.2.4 - css-to-react-native: 3.2.0 - csstype: 3.1.2 - postcss: 8.4.33 - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - shallowequal: 1.1.0 - stylis: 4.3.0 - tslib: 2.6.2 - dev: true - - /stylis@4.3.0: - resolution: {integrity: sha512-E87pIogpwUsUwXw7dNyU4QDjdgVMy52m+XEOPEKUn161cCzWjjhPSQhByfd1CcNvrOLnXQ6OnnZDwnJrz/Z4YQ==} - dev: true - - /tslib@2.6.2: - resolution: {integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==} - dev: true diff --git a/fixtures/tsconfig/cases/builtins/thing.js b/fixtures/tsconfig/cases/builtins/thing.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/builtins/tsconfig.json b/fixtures/tsconfig/cases/builtins/tsconfig.json deleted file mode 100644 index 36aa1a4d..00000000 --- a/fixtures/tsconfig/cases/builtins/tsconfig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compilerOptions": { - "baseUrl": "." - } -} diff --git a/fixtures/tsconfig/cases/exports/index.js b/fixtures/tsconfig/cases/exports/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/exports/tsconfig.json b/fixtures/tsconfig/cases/exports/tsconfig.json deleted file mode 100644 index f0e3159b..00000000 --- a/fixtures/tsconfig/cases/exports/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-exports" -} diff --git a/fixtures/tsconfig/cases/extends-extension/base-tsconfig.json b/fixtures/tsconfig/cases/extends-extension/base-tsconfig.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/cases/extends-extension/base-tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/cases/extends-extension/foo.js b/fixtures/tsconfig/cases/extends-extension/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-extension/tsconfig.json b/fixtures/tsconfig/cases/extends-extension/tsconfig.json deleted file mode 100644 index 0ae4c6a3..00000000 --- a/fixtures/tsconfig/cases/extends-extension/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./base-tsconfig" -} diff --git a/fixtures/tsconfig/cases/extends-extensionless/foo.js b/fixtures/tsconfig/cases/extends-extensionless/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-extensionless/tsconfig.json b/fixtures/tsconfig/cases/extends-extensionless/tsconfig.json deleted file mode 100644 index c36cb7d4..00000000 --- a/fixtures/tsconfig/cases/extends-extensionless/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-field/conf" -} diff --git a/fixtures/tsconfig/cases/extends-multiple/foo.js b/fixtures/tsconfig/cases/extends-multiple/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-multiple/tsconfig.json b/fixtures/tsconfig/cases/extends-multiple/tsconfig.json deleted file mode 100644 index aa2ae783..00000000 --- a/fixtures/tsconfig/cases/extends-multiple/tsconfig.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": ["../extends-extension", "../extends-paths"], - "compilerOptions": { - "baseUrl": ".", - }, -} diff --git a/fixtures/tsconfig/cases/extends-not-found/index.js b/fixtures/tsconfig/cases/extends-not-found/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-not-found/tsconfig.json b/fixtures/tsconfig/cases/extends-not-found/tsconfig.json deleted file mode 100644 index 99df91da..00000000 --- a/fixtures/tsconfig/cases/extends-not-found/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./not-found" -} diff --git a/fixtures/tsconfig/cases/extends-paths/src/index.js b/fixtures/tsconfig/cases/extends-paths/src/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-paths/tsconfig.base.json b/fixtures/tsconfig/cases/extends-paths/tsconfig.base.json deleted file mode 100644 index 5c64b067..00000000 --- a/fixtures/tsconfig/cases/extends-paths/tsconfig.base.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "@/*": ["./*"] - } - } -} diff --git a/fixtures/tsconfig/cases/extends-paths/tsconfig.json b/fixtures/tsconfig/cases/extends-paths/tsconfig.json deleted file mode 100644 index 51086018..00000000 --- a/fixtures/tsconfig/cases/extends-paths/tsconfig.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": "./tsconfig.base.json", - "compilerOptions": { - "baseUrl": "src", - }, -} diff --git a/fixtures/tsconfig/cases/field/index.js b/fixtures/tsconfig/cases/field/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/field/tsconfig.json b/fixtures/tsconfig/cases/field/tsconfig.json deleted file mode 100644 index 9f86c3f4..00000000 --- a/fixtures/tsconfig/cases/field/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-field" -} diff --git a/fixtures/tsconfig/cases/index/index.js b/fixtures/tsconfig/cases/index/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/index/tsconfig.json b/fixtures/tsconfig/cases/index/tsconfig.json deleted file mode 100644 index d20b1774..00000000 --- a/fixtures/tsconfig/cases/index/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-index" -} diff --git a/fixtures/tsconfig/cases/paths_template_variable/foo.js b/fixtures/tsconfig/cases/paths_template_variable/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json b/fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json deleted file mode 100644 index a1a37bb6..00000000 --- a/fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "../../tsconfig_template_variable.json" -} diff --git a/fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json b/fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json deleted file mode 100644 index e7d8e5e5..00000000 --- a/fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "compilerOptions": { - "composite": true, - "paths": { - "foo": ["${configDir}/foo.js"] - } - } -} diff --git a/fixtures/tsconfig/cases/project_references/app/aliased/index.ts b/fixtures/tsconfig/cases/project_references/app/aliased/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/app/index.ts b/fixtures/tsconfig/cases/project_references/app/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/app/tsconfig.json b/fixtures/tsconfig/cases/project_references/app/tsconfig.json deleted file mode 100644 index 7036d2bb..00000000 --- a/fixtures/tsconfig/cases/project_references/app/tsconfig.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "extends": "../tsconfig.base.json", - "compilerOptions": { - "baseUrl": "./", - "paths": { - "@/*": ["./aliased/*"] - } - }, - "references": [ - { - "path": "../project_a/conf.json" - }, - { - "path": "../project_b" - }, - { - "path": "../project_c/tsconfig.json" - }, - { - "path": "../../paths_template_variable/tsconfig2.json" - } - ] -} diff --git a/fixtures/tsconfig/cases/project_references/project_a/aliased/index.ts b/fixtures/tsconfig/cases/project_references/project_a/aliased/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_a/conf.json b/fixtures/tsconfig/cases/project_references/project_a/conf.json deleted file mode 100644 index 4d389d7a..00000000 --- a/fixtures/tsconfig/cases/project_references/project_a/conf.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "compilerOptions": { - "composite": true, - "paths": { - "@/*": ["./aliased/*"] - } - } -} diff --git a/fixtures/tsconfig/cases/project_references/project_a/index.ts b/fixtures/tsconfig/cases/project_references/project_a/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_b/src/aliased/index.ts b/fixtures/tsconfig/cases/project_references/project_b/src/aliased/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_b/tsconfig.json b/fixtures/tsconfig/cases/project_references/project_b/tsconfig.json deleted file mode 100644 index 4ab05cd8..00000000 --- a/fixtures/tsconfig/cases/project_references/project_b/tsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "compilerOptions": { - "composite": true, - "baseUrl": "./src", - "paths": { - "@/*": ["./aliased/*"] - } - } -} diff --git a/fixtures/tsconfig/cases/project_references/project_c/index.ts b/fixtures/tsconfig/cases/project_references/project_c/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_c/tsconfig.json b/fixtures/tsconfig/cases/project_references/project_c/tsconfig.json deleted file mode 100644 index fe520939..00000000 --- a/fixtures/tsconfig/cases/project_references/project_c/tsconfig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compilerOptions": { - "composite": true - } -} diff --git a/fixtures/tsconfig/cases/project_references/tsconfig.base.json b/fixtures/tsconfig/cases/project_references/tsconfig.base.json deleted file mode 100644 index 88ccffe7..00000000 --- a/fixtures/tsconfig/cases/project_references/tsconfig.base.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "compilerOptions": { - } -} diff --git a/fixtures/tsconfig/cases/suffixes/a.ios.ts b/fixtures/tsconfig/cases/suffixes/a.ios.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/a.ts b/fixtures/tsconfig/cases/suffixes/a.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/b.ts b/fixtures/tsconfig/cases/suffixes/b.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/c-test.ts b/fixtures/tsconfig/cases/suffixes/c-test.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/index.ts b/fixtures/tsconfig/cases/suffixes/index.ts deleted file mode 100644 index b09939b9..00000000 --- a/fixtures/tsconfig/cases/suffixes/index.ts +++ /dev/null @@ -1 +0,0 @@ -import './a'; diff --git a/fixtures/tsconfig/cases/suffixes/tsconfig.json b/fixtures/tsconfig/cases/suffixes/tsconfig.json deleted file mode 100644 index 4c2ccc8f..00000000 --- a/fixtures/tsconfig/cases/suffixes/tsconfig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compilerOptions": { - "moduleSuffixes": [".ios", "-test", ""] - } -} diff --git a/fixtures/tsconfig/cases/trailing-comma/bar.js b/fixtures/tsconfig/cases/trailing-comma/bar.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/trailing-comma/index.js b/fixtures/tsconfig/cases/trailing-comma/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/trailing-comma/tsconfig.json b/fixtures/tsconfig/cases/trailing-comma/tsconfig.json deleted file mode 100644 index 6dc20ca5..00000000 --- a/fixtures/tsconfig/cases/trailing-comma/tsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "compilerOptions": { - "paths": { - /* some comment */ - "foo": ["bar.js"], - }, - }, - // another comment -} diff --git a/fixtures/tsconfig/foo.js b/fixtures/tsconfig/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/nested/index.js b/fixtures/tsconfig/nested/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/nested/test.js b/fixtures/tsconfig/nested/test.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/nested/tsconfig.json b/fixtures/tsconfig/nested/tsconfig.json deleted file mode 100644 index 6deb3011..00000000 --- a/fixtures/tsconfig/nested/tsconfig.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "extends": "..", - "compilerOptions": { - "paths": { - "ts-path": ["test.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-exports/conf.json b/fixtures/tsconfig/node_modules/tsconfig-exports/conf.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-exports/conf.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-exports/foo.js b/fixtures/tsconfig/node_modules/tsconfig-exports/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-exports/package.json b/fixtures/tsconfig/node_modules/tsconfig-exports/package.json deleted file mode 100644 index be0ddee6..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-exports/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "tsconfig-exports", - "private": true, - "exports": { - ".": "./conf.json" - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-field/conf.json b/fixtures/tsconfig/node_modules/tsconfig-field/conf.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-field/conf.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-field/foo.js b/fixtures/tsconfig/node_modules/tsconfig-field/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-field/package.json b/fixtures/tsconfig/node_modules/tsconfig-field/package.json deleted file mode 100644 index 7138fdde..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-field/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "tsconfig-field", - "private": true, - "tsconfig": "conf.json" -} \ No newline at end of file diff --git a/fixtures/tsconfig/node_modules/tsconfig-index/foo.js b/fixtures/tsconfig/node_modules/tsconfig-index/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-index/package.json b/fixtures/tsconfig/node_modules/tsconfig-index/package.json deleted file mode 100644 index eb2431e7..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-index/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "tsconfig-index", - "private": true -} \ No newline at end of file diff --git a/fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json b/fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-not-used/foo.js b/fixtures/tsconfig/node_modules/tsconfig-not-used/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json b/fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json deleted file mode 100644 index eb16d127..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "ts-path": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/package.json b/fixtures/tsconfig/package.json deleted file mode 100755 index f48acd1c..00000000 --- a/fixtures/tsconfig/package.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "name": "resolver", - "private": true, - "alias": { - "aliased": "foo", - "aliased-file": "./bar.js", - "something": "./nested/test.js", - "aliasedfolder": "./nested", - "aliasedabsolute": "/nested", - "foo/bar": "./bar.js", - "glob/*/*": "./nested/$2", - "./baz": "./bar.js", - "url": false - }, - "imports": { - "#test": "./bar.js" - }, - "dependencies": { - "foo": "^0.3.4" - }, - "peerDependencies": { - "bar": "*" - } -} diff --git a/fixtures/tsconfig/tsconfig.json b/fixtures/tsconfig/tsconfig.json deleted file mode 100644 index eb16d127..00000000 --- a/fixtures/tsconfig/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "ts-path": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/tsconfig_template_variable.json b/fixtures/tsconfig/tsconfig_template_variable.json deleted file mode 100644 index 6f272344..00000000 --- a/fixtures/tsconfig/tsconfig_template_variable.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["${configDir}/foo.js"] - } - } -} diff --git a/napi/__test__/resolver.spec.mjs b/napi/__test__/resolver.spec.mjs deleted file mode 100644 index ac6ee0ef..00000000 --- a/napi/__test__/resolver.spec.mjs +++ /dev/null @@ -1,260 +0,0 @@ -import { join } from 'node:path' -import { fileURLToPath } from 'node:url' - -import test from 'ava' - -let ResolverFactory - -if (process.env.WASI_TEST) { - const wasi = await import('../resolver.wasi.cjs') - ResolverFactory = wasi.ResolverFactory -} else { - const napi = await import('../index.js') - ResolverFactory = napi.ResolverFactory -} - -const currentDir = join(fileURLToPath(import.meta.url), '..') - -const enhancedResolveRoot = join( - currentDir, - '..', - '..', - 'fixtures', - 'enhanced_resolve', - 'test', - 'fixtures' -) - -// https://github.com/webpack/enhanced-resolve/blob/main/test/resolve.test.js - -for (const [title, context, request, expected] of [ - [ - 'absolute path', - enhancedResolveRoot, - join(enhancedResolveRoot, 'main1.js'), - join(enhancedResolveRoot, 'main1.js'), - ], - [ - 'file with .js', - enhancedResolveRoot, - './main1.js', - join(enhancedResolveRoot, 'main1.js'), - ], - [ - 'file without extension', - enhancedResolveRoot, - './main1', - join(enhancedResolveRoot, 'main1.js'), - ], - [ - 'another file with .js', - enhancedResolveRoot, - './a.js', - join(enhancedResolveRoot, 'a.js'), - ], - [ - 'another file without extension', - enhancedResolveRoot, - './a', - join(enhancedResolveRoot, 'a.js'), - ], - [ - 'file in module with .js', - enhancedResolveRoot, - 'm1/a.js', - join(enhancedResolveRoot, 'node_modules/m1/a.js'), - ], - [ - 'file in module without extension', - enhancedResolveRoot, - 'm1/a', - join(enhancedResolveRoot, 'node_modules/m1/a.js'), - ], - [ - 'another file in module without extension', - enhancedResolveRoot, - 'complexm/step1', - join(enhancedResolveRoot, 'node_modules/complexm/step1.js'), - ], - [ - 'from submodule to file in sibling module', - join(enhancedResolveRoot, 'node_modules/complexm'), - 'm2/b.js', - join(enhancedResolveRoot, 'node_modules/m2/b.js'), - ], - [ - 'from nested directory to overwritten file in module', - join(enhancedResolveRoot, 'multiple_modules'), - 'm1/a.js', - join(enhancedResolveRoot, 'multiple_modules/node_modules/m1/a.js'), - ], - [ - 'from nested directory to not overwritten file in module', - join(enhancedResolveRoot, 'multiple_modules'), - 'm1/b.js', - join(enhancedResolveRoot, 'node_modules/m1/b.js'), - ], - [ - 'file with query', - enhancedResolveRoot, - './main1.js?query', - join(enhancedResolveRoot, 'main1.js?query'), - ], - [ - 'file with fragment', - enhancedResolveRoot, - './main1.js#fragment', - join(enhancedResolveRoot, 'main1.js#fragment'), - ], - [ - 'file with fragment and query', - enhancedResolveRoot, - './main1.js#fragment?query', - join(enhancedResolveRoot, 'main1.js#fragment?query'), - ], - [ - 'file with query and fragment', - enhancedResolveRoot, - './main1.js?#fragment', - join(enhancedResolveRoot, 'main1.js?#fragment'), - ], - - [ - 'file with query (unicode)', - enhancedResolveRoot, - './测试.js?query', - join(enhancedResolveRoot, '测试.js?query'), - ], - [ - 'file with fragment (unicode)', - enhancedResolveRoot, - './测试.js#fragment', - join(enhancedResolveRoot, '测试.js#fragment'), - ], - [ - 'file with fragment and query (unicode)', - enhancedResolveRoot, - './测试.js#fragment?query', - join(enhancedResolveRoot, '测试.js#fragment?query'), - ], - [ - 'file with query and fragment (unicode)', - enhancedResolveRoot, - './测试.js?#fragment', - join(enhancedResolveRoot, '测试.js?#fragment'), - ], - - [ - 'file in module with query', - enhancedResolveRoot, - 'm1/a?query', - join(enhancedResolveRoot, 'node_modules/m1/a.js?query'), - ], - [ - 'file in module with fragment', - enhancedResolveRoot, - 'm1/a#fragment', - join(enhancedResolveRoot, 'node_modules/m1/a.js#fragment'), - ], - [ - 'file in module with fragment and query', - enhancedResolveRoot, - 'm1/a#fragment?query', - join(enhancedResolveRoot, 'node_modules/m1/a.js#fragment?query'), - ], - [ - 'file in module with query and fragment', - enhancedResolveRoot, - 'm1/a?#fragment', - join(enhancedResolveRoot, 'node_modules/m1/a.js?#fragment'), - ], - [ - 'differ between directory and file, resolve file', - enhancedResolveRoot, - './dirOrFile', - join(enhancedResolveRoot, 'dirOrFile.js'), - ], - [ - 'differ between directory and file, resolve directory', - enhancedResolveRoot, - './dirOrFile/', - join(enhancedResolveRoot, 'dirOrFile/index.js'), - ], - [ - 'find node_modules outside of node_modules', - join(enhancedResolveRoot, 'browser-module/node_modules'), - 'm1/a', - join(enhancedResolveRoot, 'node_modules/m1/a.js'), - ], - [ - "don't crash on main field pointing to self", - enhancedResolveRoot, - './main-field-self', - join(enhancedResolveRoot, './main-field-self/index.js'), - ], - [ - "don't crash on main field pointing to self (2)", - enhancedResolveRoot, - './main-field-self2', - join(enhancedResolveRoot, './main-field-self2/index.js'), - ], - // enhanced-resolve has `#` prepended with a `\0`, they are removed from the - // following 3 expected test results. - // See https://github.com/webpack/enhanced-resolve#escaping - [ - 'handle fragment edge case (no fragment)', - enhancedResolveRoot, - './no#fragment/#/#', - join(enhancedResolveRoot, 'no#fragment', '#', '#.js'), - ], - [ - 'handle fragment edge case (fragment)', - enhancedResolveRoot, - './no#fragment/#/', - join(enhancedResolveRoot, 'no.js#fragment') + '/#/', - ], - [ - 'handle fragment escaping', - enhancedResolveRoot, - './no\0#fragment/\0#/\0##fragment', - join(enhancedResolveRoot, 'no#fragment', '#', '#.js#fragment'), - ], -]) { - test(title, (t) => { - const resolver = new ResolverFactory({ - modules: ['src/a', 'src/b', 'src/common', 'node_modules'], - extensions: ['.js', '.jsx', '.ts', '.tsx'], - }) - - t.is(resolver.sync(context, request).path, expected) - }) -} - -test('resolve pnpm package', (t) => { - const rootDir = join(currentDir, '..', '..'); - const pnpmProjectPath = join(rootDir, 'fixtures', 'pnpm') - const resolver = new ResolverFactory({ - aliasFields: ['browser'], - }) - t.deepEqual(resolver.sync(pnpmProjectPath, 'styled-components'), { - path: join( - rootDir, - 'node_modules/.pnpm/styled-components@6.1.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/styled-components/dist/styled-components.browser.cjs.js' - ), - }) - t.deepEqual( - resolver.sync( - join( - rootDir, - 'node_modules/.pnpm/styled-components@6.1.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/styled-components' - ), - 'react' - ), - { - path: join( - rootDir, - 'node_modules/.pnpm/react@18.3.1/node_modules/react/index.js' - ), - } - ) -}) diff --git a/napi/src/lib.rs b/napi/src/lib.rs deleted file mode 100644 index 238f99c4..00000000 --- a/napi/src/lib.rs +++ /dev/null @@ -1,166 +0,0 @@ -extern crate napi; -extern crate napi_derive; -extern crate oxc_resolver; - -use std::path::{Path, PathBuf}; - -use napi_derive::napi; -use oxc_resolver::{ResolveOptions, Resolver}; - -use self::options::{NapiResolveOptions, StrOrStrList}; - -mod options; - -#[napi(object)] -pub struct ResolveResult { - pub path: Option, - pub error: Option, -} - -fn resolve(resolver: &Resolver, path: &Path, request: &str) -> ResolveResult { - match resolver.resolve(path, request) { - Ok(resolution) => ResolveResult { - path: Some(resolution.full_path().to_string_lossy().to_string()), - error: None, - }, - Err(err) => ResolveResult { path: None, error: Some(err.to_string()) }, - } -} - -#[allow(clippy::needless_pass_by_value)] -#[napi] -pub fn sync(path: String, request: String) -> ResolveResult { - let path = PathBuf::from(path); - let resolver = Resolver::new(ResolveOptions::default()); - resolve(&resolver, &path, &request) -} - -#[napi] -pub struct ResolverFactory { - resolver: Resolver, -} - -#[napi] -impl ResolverFactory { - #[napi(constructor)] - pub fn new(options: NapiResolveOptions) -> Self { - Self { resolver: Resolver::new(Self::normalize_options(options)) } - } - - #[napi] - pub fn default() -> Self { - let default_options = ResolveOptions::default(); - Self { resolver: Resolver::new(default_options) } - } - - /// Clone the resolver using the same underlying cache. - #[napi] - pub fn clone_with_options(&self, options: NapiResolveOptions) -> Self { - Self { resolver: self.resolver.clone_with_options(Self::normalize_options(options)) } - } - - /// Clear the underlying cache. - #[napi] - pub fn clear_cache(&self) { - self.resolver.clear_cache(); - } - - #[allow(clippy::needless_pass_by_value)] - #[napi] - pub fn sync(&self, path: String, request: String) -> ResolveResult { - let path = PathBuf::from(path); - resolve(&self.resolver, &path, &request) - } - - fn normalize_options(op: NapiResolveOptions) -> ResolveOptions { - let default = ResolveOptions::default(); - // merging options - ResolveOptions { - tsconfig: op.tsconfig.map(|tsconfig| tsconfig.into()), - alias: op - .alias - .map(|alias| { - alias - .into_iter() - .map(|(k, v)| { - let v = v - .into_iter() - .map(|item| match item { - Some(path) => oxc_resolver::AliasValue::from(path), - None => oxc_resolver::AliasValue::Ignore, - }) - .collect(); - (k, v) - }) - .collect::>() - }) - .unwrap_or(default.alias), - alias_fields: op - .alias_fields - .map(|o| o.into_iter().map(|x| StrOrStrList(x).into()).collect::>()) - .unwrap_or(default.alias_fields), - condition_names: op.condition_names.unwrap_or(default.condition_names), - description_files: op.description_files.unwrap_or(default.description_files), - enforce_extension: op - .enforce_extension - .map(|enforce_extension| enforce_extension.into()) - .unwrap_or(default.enforce_extension), - exports_fields: op - .exports_fields - .map(|o| o.into_iter().map(|x| StrOrStrList(x).into()).collect::>()) - .unwrap_or(default.exports_fields), - imports_fields: op - .imports_fields - .map(|o| o.into_iter().map(|x| StrOrStrList(x).into()).collect::>()) - .unwrap_or(default.imports_fields), - extension_alias: op - .extension_alias - .map(|extension_alias| extension_alias.into_iter().collect::>()) - .unwrap_or(default.extension_alias), - extensions: op.extensions.unwrap_or(default.extensions), - fallback: op - .fallback - .map(|fallback| { - fallback - .into_iter() - .map(|(k, v)| { - let v = v - .into_iter() - .map(|item| match item { - Some(path) => oxc_resolver::AliasValue::from(path), - None => oxc_resolver::AliasValue::Ignore, - }) - .collect(); - (k, v) - }) - .collect::>() - }) - .unwrap_or(default.fallback), - fully_specified: op.fully_specified.unwrap_or(default.fully_specified), - main_fields: op - .main_fields - .map(|o| StrOrStrList(o).into()) - .unwrap_or(default.main_fields), - main_files: op.main_files.unwrap_or(default.main_files), - modules: op.modules.map(|o| StrOrStrList(o).into()).unwrap_or(default.modules), - resolve_to_context: op.resolve_to_context.unwrap_or(default.resolve_to_context), - prefer_relative: op.prefer_relative.unwrap_or(default.prefer_relative), - prefer_absolute: op.prefer_absolute.unwrap_or(default.prefer_absolute), - restrictions: op - .restrictions - .map(|restrictions| { - restrictions - .into_iter() - .map(|restriction| restriction.into()) - .collect::>() - }) - .unwrap_or(default.restrictions), - roots: op - .roots - .map(|roots| roots.into_iter().map(PathBuf::from).collect::>()) - .unwrap_or(default.roots), - symlinks: op.symlinks.unwrap_or(default.symlinks), - builtin_modules: op.builtin_modules.unwrap_or(default.builtin_modules), - } - } -} diff --git a/napi/src/options.rs b/napi/src/options.rs deleted file mode 100644 index ea35672f..00000000 --- a/napi/src/options.rs +++ /dev/null @@ -1,261 +0,0 @@ -use std::path::PathBuf; - -use napi::Either; -use napi_derive::napi; -use std::collections::HashMap; - -/// Module Resolution Options -/// -/// Options are directly ported from [enhanced-resolve](https://github.com/webpack/enhanced-resolve#resolver-options). -/// -/// See [webpack resolve](https://webpack.js.org/configuration/resolve/) for information and examples -#[derive(Debug, Clone)] -#[napi(object)] -pub struct NapiResolveOptions { - /// Path to TypeScript configuration file. - /// - /// Default `None` - pub tsconfig: Option, - - /// Alias for [ResolveOptions::alias] and [ResolveOptions::fallback]. - /// - /// For the second value of the tuple, `None -> AliasValue::Ignore`, Some(String) -> - /// AliasValue::Path(String)` - /// Create aliases to import or require certain modules more easily. - /// A trailing $ can also be added to the given object's keys to signify an exact match. - pub alias: Option>>>, - - /// A list of alias fields in description files. - /// Specify a field, such as `browser`, to be parsed according to [this specification](https://github.com/defunctzombie/package-browser-field-spec). - /// Can be a path to json object such as `["path", "to", "exports"]`. - /// - /// Default `[]` - #[napi(ts_type = "(string | string[])[]")] - pub alias_fields: Option>, - - /// Condition names for exports field which defines entry points of a package. - /// The key order in the exports field is significant. During condition matching, earlier entries have higher priority and take precedence over later entries. - /// - /// Default `[]` - pub condition_names: Option>, - - /// The JSON files to use for descriptions. (There was once a `bower.json`.) - /// - /// Default `["package.json"]` - pub description_files: Option>, - - /// If true, it will not allow extension-less files. - /// So by default `require('./foo')` works if `./foo` has a `.js` extension, - /// but with this enabled only `require('./foo.js')` will work. - /// - /// Default to `true` when [ResolveOptions::extensions] contains an empty string. - /// Use `Some(false)` to disable the behavior. - /// See - /// - /// Default None, which is the same as `Some(false)` when the above empty rule is not applied. - pub enforce_extension: Option, - - /// A list of exports fields in description files. - /// Can be a path to json object such as `["path", "to", "exports"]`. - /// - /// Default `[["exports"]]`. - #[napi(ts_type = "(string | string[])[]")] - pub exports_fields: Option>, - - /// Fields from `package.json` which are used to provide the internal requests of a package - /// (requests starting with # are considered internal). - /// - /// Can be a path to a JSON object such as `["path", "to", "imports"]`. - /// - /// Default `[["imports"]]`. - #[napi(ts_type = "(string | string[])[]")] - pub imports_fields: Option>, - - /// An object which maps extension to extension aliases. - /// - /// Default `{}` - pub extension_alias: Option>>, - - /// Attempt to resolve these extensions in order. - /// If multiple files share the same name but have different extensions, - /// will resolve the one with the extension listed first in the array and skip the rest. - /// - /// Default `[".js", ".json", ".node"]` - pub extensions: Option>, - - /// Redirect module requests when normal resolving fails. - /// - /// Default `[]` - pub fallback: Option>>>, - - /// 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). - /// - /// See also webpack configuration [resolve.fullySpecified](https://webpack.js.org/configuration/module/#resolvefullyspecified) - /// - /// Default `false` - pub fully_specified: Option, - - /// A list of main fields in description files - /// - /// Default `["main"]`. - #[napi(ts_type = "string | string[]")] - pub main_fields: Option, - - /// The filename to be used while resolving directories. - /// - /// Default `["index"]` - pub main_files: Option>, - - /// A list of directories to resolve modules from, can be absolute path or folder name. - /// - /// Default `["node_modules"]` - #[napi(ts_type = "string | string[]")] - pub modules: Option, - - /// Resolve to a context instead of a file. - /// - /// Default `false` - pub resolve_to_context: Option, - - /// Prefer to resolve module requests as relative requests instead of using modules from node_modules directories. - /// - /// Default `false` - pub prefer_relative: Option, - - /// Prefer to resolve server-relative urls as absolute paths before falling back to resolve in ResolveOptions::roots. - /// - /// Default `false` - pub prefer_absolute: Option, - - /// A list of resolve restrictions to restrict the paths that a request can be resolved on. - /// - /// Default `[]` - pub restrictions: Option>, - - /// A list of directories where requests of server-relative URLs (starting with '/') are resolved. - /// On non-Windows systems these requests are resolved as an absolute path first. - /// - /// Default `[]` - pub roots: Option>, - - /// Whether to resolve symlinks to their symlinked location. - /// When enabled, symlinked resources are resolved to their real path, not their symlinked location. - /// Note that this may cause module resolution to fail when using tools that symlink packages (like npm link). - /// - /// Default `true` - pub symlinks: Option, - - /// Whether to parse [module.builtinModules](https://nodejs.org/api/module.html#modulebuiltinmodules) or not. - /// For example, "zlib" will throw [crate::ResolveError::Builtin] when set to true. - /// - /// Default `false` - pub builtin_modules: Option, -} - -#[napi] -#[derive(Debug, PartialEq, Eq)] -pub enum EnforceExtension { - Auto, - Enabled, - Disabled, -} - -impl EnforceExtension { - pub fn is_auto(&self) -> bool { - *self == Self::Auto - } - - pub fn is_enabled(&self) -> bool { - *self == Self::Enabled - } - - pub fn is_disabled(&self) -> bool { - *self == Self::Disabled - } -} - -/// Alias Value for [ResolveOptions::alias] and [ResolveOptions::fallback]. -/// Use struct because napi don't support structured union now -#[napi(object)] -#[derive(Debug, Clone)] -pub struct Restriction { - pub path: Option, - pub regex: Option, -} - -/// Tsconfig Options -/// -/// Derived from [tsconfig-paths-webpack-plugin](https://github.com/dividab/tsconfig-paths-webpack-plugin#options) -#[napi(object)] -#[derive(Debug, Clone)] -pub struct TsconfigOptions { - /// Allows you to specify where to find the TypeScript configuration file. - /// You may provide - /// * a relative path to the configuration file. It will be resolved relative to cwd. - /// * an absolute path to the configuration file. - pub config_file: String, - - /// Support for Typescript Project References. - /// - /// * `'auto'`: use the `references` field from tsconfig of `config_file`. - /// * `string[]`: manually provided relative or absolute path. - #[napi(ts_type = "'auto' | string[]")] - pub references: Option>>, -} - -impl Into for Restriction { - fn into(self) -> oxc_resolver::Restriction { - match (self.path, self.regex) { - (None, None) => { - panic!("Should specify path or regex") - } - (None, Some(regex)) => oxc_resolver::Restriction::RegExp(regex), - (Some(path), None) => oxc_resolver::Restriction::Path(PathBuf::from(path)), - (Some(_), Some(_)) => { - panic!("Restriction can't be path and regex at the same time") - } - } - } -} - -impl Into for EnforceExtension { - fn into(self) -> oxc_resolver::EnforceExtension { - match self { - EnforceExtension::Auto => oxc_resolver::EnforceExtension::Auto, - EnforceExtension::Enabled => oxc_resolver::EnforceExtension::Enabled, - EnforceExtension::Disabled => oxc_resolver::EnforceExtension::Disabled, - } - } -} - -impl Into for TsconfigOptions { - fn into(self) -> oxc_resolver::TsconfigOptions { - oxc_resolver::TsconfigOptions { - config_file: PathBuf::from(self.config_file), - references: match self.references { - Some(Either::A(string)) if string.as_str() == "auto" => { - oxc_resolver::TsconfigReferences::Auto - } - Some(Either::A(opt)) => { - panic!("`{}` is not a valid option for tsconfig references", opt) - } - Some(Either::B(paths)) => oxc_resolver::TsconfigReferences::Paths( - paths.into_iter().map(PathBuf::from).collect::>(), - ), - None => oxc_resolver::TsconfigReferences::Disabled, - }, - } - } -} - -type StrOrStrListType = Either>; -pub struct StrOrStrList(pub StrOrStrListType); - -impl Into> for StrOrStrList { - fn into(self) -> Vec { - match self { - StrOrStrList(Either::A(s)) => Vec::from([s]), - StrOrStrList(Either::B(a)) => a, - } - } -} diff --git a/napi/tests/options.test.mjs b/napi/tests/options.test.mjs deleted file mode 100644 index 4a93efff..00000000 --- a/napi/tests/options.test.mjs +++ /dev/null @@ -1,59 +0,0 @@ -import { describe, it } from "node:test"; -import { ResolverFactory } from "../index.js"; -import * as assert from "node:assert"; -import * as path from "node:path"; - -const fixtureDir = new URL( - "../../fixtures/enhanced_resolve/test/fixtures", - import.meta.url -).pathname; - -describe("option", () => { - describe("aliasFields", () => { - it("should allow field string ", () => { - const resolver = new ResolverFactory({ aliasFields: ["browser"] }); - assert.match( - resolver.sync(fixtureDir, "./browser-module/lib/replaced.js").path, - /browser-module\/lib\/browser\.js$/ - ); - }); - it("should allow json path array", () => { - const resolver = new ResolverFactory({ - aliasFields: [["innerBrowser1", "field", "browser"]], - }); - - assert.match( - resolver.sync(fixtureDir, "./browser-module/lib/main1.js").path, - /browser-module\/lib\/main\.js$/ - ); - }); - }); - - describe("exportsFields", () => { - const createTest = (exportsFields) => { - const resolver = new ResolverFactory({ exportsFields }); - assert.match( - resolver.sync( - path.resolve(fixtureDir, "./exports-field3"), - "exports-field" - ).path, - /\/exports-field\/src\/index\.js$/ - ); - }; - it("should allow string as field item", createTest(["broken"])); - it("should allow json path array as field item", createTest([["broken"]])); - }); - - describe("mainFields", () => { - const createTest = (mainFields) => { - const resolver = new ResolverFactory({ mainFields }); - assert.match( - resolver.sync(fixtureDir, "../..").path, - /\/lib\/index\.js$/ - ); - }; - it("should use `'main'` as default", createTest(undefined)); - it("should allow field string", createTest("main")); - it("should allow field array", createTest(["main"])); - }); -}); diff --git a/npm/package.json b/npm/package.json index 6fa93185..b47e6b07 100644 --- a/npm/package.json +++ b/npm/package.json @@ -1,41 +1,30 @@ { - "name": "oxc-resolver", - "version": "1.8.1", - "description": "Oxc Resolver Node API", - "main": "index.js", - "browser": "browser.js", - "files": [ - "index.d.ts", - "index.js", - "browser.js" - ], - "license": "MIT", - "homepage": "https://oxc-project.github.io", - "repository": { - "type": "git", - "url": "git+https://github.com/oxc-project/oxc-resolver.git" - }, - "publishConfig": { - "registry": "https://registry.npmjs.org/", - "access": "public" - }, - "napi": { - "binaryName": "resolver", - "packageName": "@oxc-resolver/binding", - "targets": [ - "x86_64-pc-windows-msvc", - "aarch64-pc-windows-msvc", - "x86_64-unknown-linux-gnu", - "x86_64-unknown-linux-musl", - "aarch64-unknown-linux-gnu", - "aarch64-unknown-linux-musl", - "armv7-unknown-linux-gnueabihf", - "x86_64-apple-darwin", - "aarch64-apple-darwin", - "wasm32-wasip1-threads" - ] - }, - "funding": { - "url": "https://github.com/sponsors/Boshen" - } + "name": "oxc-resolver", + "description": "Oxc Resolver Node API", + "funding": { + "url": "https://github.com/sponsors/Boshen" + }, + "main": "index.js", + "browser": "browser.js", + "files": [ + "index.d.ts", + "index.js", + "browser.js" + ], + "napi": { + "binaryName": "resolver", + "packageName": "@oxc-resolver/binding", + "targets": [ + "x86_64-pc-windows-msvc", + "aarch64-pc-windows-msvc", + "x86_64-unknown-linux-gnu", + "x86_64-unknown-linux-musl", + "aarch64-unknown-linux-gnu", + "aarch64-unknown-linux-musl", + "armv7-unknown-linux-gnueabihf", + "x86_64-apple-darwin", + "aarch64-apple-darwin", + "wasm32-wasip1-threads" + ] + } } diff --git a/package.json b/package.json index 47300b76..a431e48f 100644 --- a/package.json +++ b/package.json @@ -1,33 +1,24 @@ { - "name": "@oxc-resolver/binding", - "private": true, - "version": "0.0.0", - "scripts": { - "build": "napi build --platform --release --package-json-path npm/package.json --manifest-path napi/Cargo.toml", - "build:debug": "napi build --platform --package-json-path npm/package.json --manifest-path napi/Cargo.toml", - "prepublishOnly": "napi pre-publish -t npm", - "test": "ava" - }, - "devDependencies": { - "@napi-rs/cli": "^3.0.0-alpha.43", - "@napi-rs/wasm-runtime": "^0.2.0", - "@types/node": "^20.10.4", - "ava": "^6.0.1", - "emnapi": "^1.0.0", - "typescript": "^5.3.3" - }, - "ava": { - "files": [ - "napi/__test__/*.spec.mjs" - ], - "cache": false - }, - "packageManager": "pnpm@9.3.0", - "repository": { - "type": "git", - "url": "git+https://github.com/oxc-project/oxc-resolver.git" - }, - "funding": { - "url": "https://github.com/sponsors/Boshen" - } + "name": "@oxc-resolver/binding", + "funding": { + "url": "https://github.com/sponsors/Boshen" + }, + "scripts": { + "build": "napi build --platform --release --package-json-path npm/package.json --manifest-path napi/Cargo.toml", + "build:debug": "napi build --platform --package-json-path npm/package.json --manifest-path napi/Cargo.toml", + "prepublishOnly": "napi pre-publish -t npm" + }, + "ava": { + "cache": false, + "files": [ + "napi/__test__/*.spec.mjs" + ] + }, + "devDependencies": { + "@napi-rs/cli": "^3.0.0-alpha.43", + "@napi-rs/wasm-runtime": "^0.2.0", + "@types/node": "^20.10.4", + "ava": "^6.0.1", + "emnapi": "^1.0.0" + } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml deleted file mode 100644 index 1e8670db..00000000 --- a/pnpm-lock.yaml +++ /dev/null @@ -1,2690 +0,0 @@ -lockfileVersion: '9.0' - -settings: - autoInstallPeers: true - excludeLinksFromLockfile: false - -importers: - - .: - devDependencies: - '@napi-rs/cli': - specifier: ^3.0.0-alpha.43 - version: 3.0.0-alpha.55(@emnapi/runtime@1.2.0)(emnapi@1.2.0) - '@napi-rs/wasm-runtime': - specifier: ^0.2.0 - version: 0.2.4 - '@types/node': - specifier: ^20.10.4 - version: 20.14.2 - ava: - specifier: ^6.0.1 - version: 6.1.3 - emnapi: - specifier: ^1.0.0 - version: 1.2.0 - typescript: - specifier: ^5.3.3 - version: 5.4.5 - - fixtures/pnpm: - devDependencies: - axios: - specifier: 1.6.2 - version: 1.6.2 - postcss: - specifier: 8.4.33 - version: 8.4.33 - styled-components: - specifier: 6.1.1 - version: 6.1.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - - npm: {} - -packages: - - '@emnapi/core@1.2.0': - resolution: {integrity: sha512-E7Vgw78I93we4ZWdYCb4DGAwRROGkMIXk7/y87UmANR+J6qsWusmC3gLt0H+O0KOt5e6O38U8oJamgbudrES/w==} - - '@emnapi/runtime@1.2.0': - resolution: {integrity: sha512-bV21/9LQmcQeCPEg3BDFtvwL6cwiTMksYNWQQ4KOxCZikEGalWtenoZ0wCiukJINlGCIi2KXx01g4FoH/LxpzQ==} - - '@emnapi/wasi-threads@1.0.1': - resolution: {integrity: sha512-iIBu7mwkq4UQGeMEM8bLwNK962nXdhodeScX4slfQnRhEMMzvYivHhutCIk8uojvmASXXPC2WNEjwxFWk72Oqw==} - - '@emotion/is-prop-valid@1.2.2': - resolution: {integrity: sha512-uNsoYd37AFmaCdXlg6EYD1KaPOaRWRByMCYzbKUX4+hhMfrxdVSelShywL4JVaAeM/eHUOSprYBQls+/neX3pw==} - - '@emotion/memoize@0.8.1': - resolution: {integrity: sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA==} - - '@emotion/unitless@0.8.1': - resolution: {integrity: sha512-KOEGMu6dmJZtpadb476IsZBclKvILjopjUii3V+7MnXIQCYh8W3NgNcgwo21n9LXZX6EDIKvqfjYxXebDwxKmQ==} - - '@inquirer/figures@1.0.3': - resolution: {integrity: sha512-ErXXzENMH5pJt5/ssXV0DfWUZqly8nGzf0UcBV9xTnP+KyffE2mqyxIMBrZ8ijQck2nU0TQm40EQB53YreyWHw==} - engines: {node: '>=18'} - - '@ljharb/through@2.3.13': - resolution: {integrity: sha512-/gKJun8NNiWGZJkGzI/Ragc53cOdcLNdzjLaIa+GEjguQs0ulsurx8WN0jijdK9yPqDvziX995sMRLyLt1uZMQ==} - engines: {node: '>= 0.4'} - - '@mapbox/node-pre-gyp@1.0.11': - resolution: {integrity: sha512-Yhlar6v9WQgUp/He7BdgzOz8lqMQ8sU+jkCq7Wx8Myc5YFJLbEe7lgui/V7G1qB1DJykHSGwreceSaD60Y0PUQ==} - hasBin: true - - '@napi-rs/cli@3.0.0-alpha.55': - resolution: {integrity: sha512-6XgBBTX8O28W5gcSzqYkI72UVJV6Y2YcyQNrEqak39JavJRLlXCv09uLF97raynXAOO50KeP6DEXFy5P8MR2sw==} - engines: {node: '>= 16'} - hasBin: true - peerDependencies: - '@emnapi/runtime': ^1.1.0 - emnapi: ^1.1.0 - peerDependenciesMeta: - '@emnapi/runtime': - optional: true - emnapi: - optional: true - - '@napi-rs/cross-toolchain@0.0.16': - resolution: {integrity: sha512-jwdjHT5L0m9MH0CmzDwPp0ckn/UO7afHCsPeo7NugHUvYgvlgS7SWhdMVgIgJW2HHqhcW/2nhaLLGpAU1c7QRQ==} - peerDependencies: - '@napi-rs/cross-toolchain-arm64-target-aarch64': ^0.0.16 - '@napi-rs/cross-toolchain-arm64-target-armv7': ^0.0.16 - '@napi-rs/cross-toolchain-arm64-target-x86_64': ^0.0.16 - '@napi-rs/cross-toolchain-x64-target-aarch64': ^0.0.16 - '@napi-rs/cross-toolchain-x64-target-armv7': ^0.0.16 - '@napi-rs/cross-toolchain-x64-target-x86_64': ^0.0.16 - peerDependenciesMeta: - '@napi-rs/cross-toolchain-arm64-target-aarch64': - optional: true - '@napi-rs/cross-toolchain-arm64-target-armv7': - optional: true - '@napi-rs/cross-toolchain-arm64-target-x86_64': - optional: true - '@napi-rs/cross-toolchain-x64-target-aarch64': - optional: true - '@napi-rs/cross-toolchain-x64-target-armv7': - optional: true - '@napi-rs/cross-toolchain-x64-target-x86_64': - optional: true - - '@napi-rs/lzma-android-arm-eabi@1.3.1': - resolution: {integrity: sha512-mtGOg8jXlc+pTBI86cqohfndS9UmOAkk9d5CChKMb8btVks70yhUN1e7YYS3QFbmoxbPs2Ee+wmuH1Khdc7B2w==} - engines: {node: '>= 10'} - cpu: [arm] - os: [android] - - '@napi-rs/lzma-android-arm64@1.3.1': - resolution: {integrity: sha512-4uGkQgAv9Tnc/i0k2eIgbhZgyzs94+iECWxz4MFZNcZ1fNGvGbRL2j+SITE4OmwrUn3TuFK/uYWfgzooq8E1Qg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [android] - - '@napi-rs/lzma-darwin-arm64@1.3.1': - resolution: {integrity: sha512-MZBg4iwHTS8icjTiCMdzh8kYrMmKBCEglFPa+vjI91R2XDwuuwSzqmpATRpmMH8cWUUWtGPF4fnxKzjgkzhd4Q==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [darwin] - - '@napi-rs/lzma-darwin-x64@1.3.1': - resolution: {integrity: sha512-7vte+1lYV7xgZERKH/pjAeh4T16aQASKOzu4op70pK6VP/64Plr5rrvqxQqQmlAIe4pwyo/RkFl1n4LXDod3xg==} - engines: {node: '>= 10'} - cpu: [x64] - os: [darwin] - - '@napi-rs/lzma-freebsd-x64@1.3.1': - resolution: {integrity: sha512-uBS74fynTqLUC3catIxyezCafn8UDlr2yxVV47vz1T6Vop2PGDz/cMQdV6rnLSjPE08Rv66ihM36mgf/MmOkOg==} - engines: {node: '>= 10'} - cpu: [x64] - os: [freebsd] - - '@napi-rs/lzma-linux-arm-gnueabihf@1.3.1': - resolution: {integrity: sha512-rrVLyqBJeN29gPJCNkPbZ7dAzaseEcERKyhjwM+DfbFrDUvtkEcrYPvo+iwE/NmF+OkZQkzcanrVMGnq/mcJYQ==} - engines: {node: '>= 10'} - cpu: [arm] - os: [linux] - - '@napi-rs/lzma-linux-arm64-gnu@1.3.1': - resolution: {integrity: sha512-vDmVsthRbX2opkgRirJJGKQxUP/spvyVM2Y5CyCWZ7sadSID3hA97r38gf9ISn/sJ8/r93IPWLq+iycudNKi+Q==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/lzma-linux-arm64-musl@1.3.1': - resolution: {integrity: sha512-x4m/J3hRdFd3IoqKc+4aBcSUkcuDEP7hH6vdss8bKNLjPfXmnG/lcHJEQX3hNnNOULPP8xVRxgiY8jeL62cnsw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/lzma-linux-x64-gnu@1.3.1': - resolution: {integrity: sha512-riB+Xg72NfH8Kcpq07omshVu0QsLW0v2bhywBNYxvA+t2dGGWSIEN1U/zazUXys+IEA6pBQKqLVseurWE6Cl8g==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/lzma-linux-x64-musl@1.3.1': - resolution: {integrity: sha512-JXLgJFwoeysxdSg7rdVYP8wrliCQVJlU5JcLYjRVSCL4P0mQTjnYi7R7VdaOkDACw/Fvlji7oIJXt0KiaDTcOw==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/lzma-wasm32-wasi@1.3.1': - resolution: {integrity: sha512-XTA9XTUtj0KPKuzNS2oi3bWN6tJodk00wwMd/TiKoEqx9Fe/zu+OfDGuXAn+xs+P7S3YCDHqjYinuTQMZ0ucJw==} - engines: {node: '>=14.0.0'} - cpu: [wasm32] - - '@napi-rs/lzma-win32-arm64-msvc@1.3.1': - resolution: {integrity: sha512-qLDfs9UEtLPPTN/FdSz3gSdlx86VwFQBuLBrQtaiYQtUTKZCOYV1Z1fXqFt5Zqa1HKV2oyXnwGcTI7RpcyXxtg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [win32] - - '@napi-rs/lzma-win32-ia32-msvc@1.3.1': - resolution: {integrity: sha512-rWNlxLFMIfvxzfdQCfeQ3D/HEnQG3vfladFYrXUx6ePXO6r+BLCGn6/LWSSuKlw4vKkb1iHEWsAVaRLIcJEMIA==} - engines: {node: '>= 10'} - cpu: [ia32] - os: [win32] - - '@napi-rs/lzma-win32-x64-msvc@1.3.1': - resolution: {integrity: sha512-SNfHNqEjabXfTL1+KRi0qiAhwIlZHhQystvfSYX6p1g+2trSC/3WUpUQ4fbbR7KyE31g2AAnwjXivnlQ0af/pg==} - engines: {node: '>= 10'} - cpu: [x64] - os: [win32] - - '@napi-rs/lzma@1.3.1': - resolution: {integrity: sha512-XyZoBlYNMvCulK/RmVK/0nB3j7IdH7HpqcrMMg0U+HqQqKRLOQBwvnKNBocPC1bZQ7iZuKWYTLn1ayZwTyek8w==} - engines: {node: '>= 10'} - - '@napi-rs/tar-android-arm-eabi@0.1.1': - resolution: {integrity: sha512-Ufa0ahZvE5KGrC2WBux5svCe/jvC+e8IgtleiicwqnfgTfbDknYyq/QuqkP1AnMp/IvTmx2iutCZt6OFIG0zAg==} - engines: {node: '>= 10'} - cpu: [arm] - os: [android] - - '@napi-rs/tar-android-arm64@0.1.1': - resolution: {integrity: sha512-KUu5fHIiIObSuZ/crHxUrQ243+LiCRKPwdCVLHwjtftqFjzls+R2Mp6GrpM41XxexDMN00SUta3kazi93Xr19A==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [android] - - '@napi-rs/tar-darwin-arm64@0.1.1': - resolution: {integrity: sha512-jaqgdX20iIga+2gzotQ78eF00Cm8vECocUYeMY62WqyzJNv/jx1dlOfELWEccOjpmawFT9tjWebsS9F1QMvSUg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [darwin] - - '@napi-rs/tar-darwin-x64@0.1.1': - resolution: {integrity: sha512-80sa32IxfRso9x9sGTFpfLSx3BnruyJODpSkUzalOCz9i14n5gOKA8KR/JrnSWwDz0p5l5P9kfQD3pu8Voj7WA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [darwin] - - '@napi-rs/tar-freebsd-x64@0.1.1': - resolution: {integrity: sha512-P7V1zBjjC1dCrTwtUzuzYM4AeZduigeCtd8qQw2IUZowM5AsmhMd77oYuXjdU29cEpKUpyYjJRxjPCzFy+WbAQ==} - engines: {node: '>= 10'} - cpu: [x64] - os: [freebsd] - - '@napi-rs/tar-linux-arm-gnueabihf@0.1.1': - resolution: {integrity: sha512-qpC71ILPkWKt8k1iJCYt5gjwcOkd2VFSQIelTRr12t5CVNKV04rE/TMdwFoCP7kxbtb9Fl2cZzCRISw2BhMCmQ==} - engines: {node: '>= 10'} - cpu: [arm] - os: [linux] - - '@napi-rs/tar-linux-arm64-gnu@0.1.1': - resolution: {integrity: sha512-71QgxcFJCog6O4Tauoge8D0ILkDGJTRk3ru7zG8PUFG1QXJ1kkiRikdT77YmoVxtomc9FUOt+bdEdU5Yn+3QUQ==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/tar-linux-arm64-musl@0.1.1': - resolution: {integrity: sha512-R2e7YEILPKc447N1hUt1zQuyy0st83HX6nhmtFywS1aOj76/3hzxLVrebGiiS6kifyCrO82o66CNTYe7DixMZw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/tar-linux-x64-gnu@0.1.1': - resolution: {integrity: sha512-tmy9q2LXUB2GQ+IgUzJn3+us52leplMu96ORyFq1iHQEelGSqXt4xi5DzU07JhX3obJPqVqkybtcRS4enBfmBA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/tar-linux-x64-musl@0.1.1': - resolution: {integrity: sha512-j5ePbe6vihApl0cGPPDUVTWZbf2mF4NhxngAoG2jp7AeX3cWP2O4pjsvaOraW6QfvWEMFPeER7S0b6eBS7duvA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/tar-wasm32-wasi@0.1.1': - resolution: {integrity: sha512-se0+DlOiIRt7mcz7BeOJDoZtCrROpKLwiAOGmNgrjQ/SZS7TnOPuwm3wy9XN9WLoepttEjCEem6UP8yD5GJuQg==} - engines: {node: '>=14.0.0'} - cpu: [wasm32] - - '@napi-rs/tar-win32-arm64-msvc@0.1.1': - resolution: {integrity: sha512-FDZPi2wC7RwzvodogigLh/pJvhqCTVTUqOYuHlLkPSUbSAGiEkI55wk9RqH3y3EdJQaDuzyqC0QKz5ket2U+GA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [win32] - - '@napi-rs/tar-win32-ia32-msvc@0.1.1': - resolution: {integrity: sha512-OPR9Tou5z5M912G7Kc7gkf1ltinbOQx5dS/OeDIWHvPGOfdFDIxt0YVKhzSLRJi43+zIDp8/+cbeMD/cKXfX8w==} - engines: {node: '>= 10'} - cpu: [ia32] - os: [win32] - - '@napi-rs/tar-win32-x64-msvc@0.1.1': - resolution: {integrity: sha512-hiv5KfhrMSg8tTRC2oQXVckVg1h6ZVjwbd5aF9Esl0V3p2TaNFwwbqgnAN4Gm/PmSnHWNL/IRTHkk3cOzDWihQ==} - engines: {node: '>= 10'} - cpu: [x64] - os: [win32] - - '@napi-rs/tar@0.1.1': - resolution: {integrity: sha512-FOMhwwlvoYjHaDBxP26K3D92ltw1Y/CC4CIjgC6qXdzW4MYNwTlEyI58smCM3k+nCVJH3kpOYyH3sgbK4WZA4A==} - engines: {node: '>= 10'} - - '@napi-rs/wasm-runtime@0.2.4': - resolution: {integrity: sha512-9zESzOO5aDByvhIAsOy9TbpZ0Ur2AJbUI7UT73kcUTS2mxAMHOBaa1st/jAymNoCtvrit99kkzT1FZuXVcgfIQ==} - - '@napi-rs/wasm-tools-android-arm-eabi@0.0.2': - resolution: {integrity: sha512-/b+UU3suXjW4P0DzHRNdrnebQtFKcQf/YMeZJH+xUlKgvwli5kbmWjx8Wqqz0VETVkUTuPqJMBDIVLyc+14FGw==} - engines: {node: '>= 10'} - cpu: [arm] - os: [android] - - '@napi-rs/wasm-tools-android-arm64@0.0.2': - resolution: {integrity: sha512-j57GbDflwJdZtT8pZj5fOV4JAP+LdKN+wzsUYs+QRUoBqpWbbUANudolqfw63bkS9sD4z7fbCuz8iwtJqzxTVA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [android] - - '@napi-rs/wasm-tools-darwin-arm64@0.0.2': - resolution: {integrity: sha512-P2ChgWgVuv9GwmbxN89R84KzIImoTqXINteEixUvmkdnhyFiR+I8deNs89Yed+5w8QLC6MEfrtRqLP9YI+NoQA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [darwin] - - '@napi-rs/wasm-tools-darwin-x64@0.0.2': - resolution: {integrity: sha512-T/kQQ0gt8+wau1Z821PKVAD76QhmwVoLs2CT7Z9tTBs2pJvwSCP0C/kQiQAHcJIMi7A2E9Ab/Mez0BERy50EFA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [darwin] - - '@napi-rs/wasm-tools-freebsd-x64@0.0.2': - resolution: {integrity: sha512-GnnHu+r5sfzuxC/1J5UMF/h3BOZnHb3NQZ5hmbCfZYCKzpzRxrAJhzRunlbRN+v0x8M/49dztVTYR3s7K4ooAw==} - engines: {node: '>= 10'} - cpu: [x64] - os: [freebsd] - - '@napi-rs/wasm-tools-linux-arm64-gnu@0.0.2': - resolution: {integrity: sha512-KnZdLT0OnKb1CG2kdt3/WvM43vr9i+FEwXCvSOVC/6Tsifz7ynhMg7LAVESILd03HubzQJfg9nbRsk0bQ+IOwg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/wasm-tools-linux-arm64-musl@0.0.2': - resolution: {integrity: sha512-HkpZOID2U8P6pWqK3mqZ8bxU5xcuT3iA2fO+jrxn78h006iYgfNmdc5JaVhHnHazMmk32xKhSV4iV0VUh8UWDg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/wasm-tools-linux-x64-gnu@0.0.2': - resolution: {integrity: sha512-YksJWBCyOalB9ogtP9+/dZKP+vR6+h7BmzMXaXMT71WW/GvIsifMVgv+DY/FRSNJQupp5Y+ugjqVAOUOc/G65g==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/wasm-tools-linux-x64-musl@0.0.2': - resolution: {integrity: sha512-sPtRxPMdw05KdTcxgSPMmSXG2+PiK3vJ/l2+g9hvjnnKtvslJN2Hr7j8zgzuoKRAUFPaJVe6+D2xVh5cpdqhww==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/wasm-tools-wasm32-wasi@0.0.2': - resolution: {integrity: sha512-muRvZK7AIuo88G2AxYx3gA59rHMQgoN004saQkBvXnz3K/DVHKfTZ6TtUebss8zI3dURU6xExL8drxFWYxjEbQ==} - engines: {node: '>=14.0.0'} - cpu: [wasm32] - - '@napi-rs/wasm-tools-win32-arm64-msvc@0.0.2': - resolution: {integrity: sha512-Cn13WQ+tpFqdVwx0DIWKbsI9auFyzVZV4F5UNOUeDt6GgOL+NndgJul0Pc9bSU6fi03AylMPfF/nTCaDWO2Wgw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [win32] - - '@napi-rs/wasm-tools-win32-ia32-msvc@0.0.2': - resolution: {integrity: sha512-xsg5DkIQi82a8rcx6246Y3XC8TIqHamY+/C6sIlPLaZEuHctDkMECAw0AANwRf5vN//D2oo2oljOuoYtB1GOKw==} - engines: {node: '>= 10'} - cpu: [ia32] - os: [win32] - - '@napi-rs/wasm-tools-win32-x64-msvc@0.0.2': - resolution: {integrity: sha512-yHigltEt33eq8bappvKsIliz4MxfMPn1M+NWbIFRWN+IS1Z57mhmc1osuk+IRXrSlq0Tom0R6MYN1jpkZKz81Q==} - engines: {node: '>= 10'} - cpu: [x64] - os: [win32] - - '@napi-rs/wasm-tools@0.0.2': - resolution: {integrity: sha512-kBvDQCP5BLw2TxTENXLp3Of7vVEx0uyIye824JHE4dduzzOHVgSoOFVhVqAT3Fx/hLV445RVWfEqQbXMg4w/Mw==} - engines: {node: '>= 10'} - - '@nodelib/fs.scandir@2.1.5': - resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} - engines: {node: '>= 8'} - - '@nodelib/fs.stat@2.0.5': - resolution: {integrity: sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==} - engines: {node: '>= 8'} - - '@nodelib/fs.walk@1.2.8': - resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} - engines: {node: '>= 8'} - - '@octokit/auth-token@4.0.0': - resolution: {integrity: sha512-tY/msAuJo6ARbK6SPIxZrPBms3xPbfwBrulZe0Wtr/DIY9lje2HeV1uoebShn6mx7SjCHif6EjMvoREj+gZ+SA==} - engines: {node: '>= 18'} - - '@octokit/core@5.2.0': - resolution: {integrity: sha512-1LFfa/qnMQvEOAdzlQymH0ulepxbxnCYAKJZfMci/5XJyIHWgEYnDmgnKakbTh7CH2tFQ5O60oYDvns4i9RAIg==} - engines: {node: '>= 18'} - - '@octokit/endpoint@9.0.5': - resolution: {integrity: sha512-ekqR4/+PCLkEBF6qgj8WqJfvDq65RH85OAgrtnVp1mSxaXF03u2xW/hUdweGS5654IlC0wkNYC18Z50tSYTAFw==} - engines: {node: '>= 18'} - - '@octokit/graphql@7.1.0': - resolution: {integrity: sha512-r+oZUH7aMFui1ypZnAvZmn0KSqAUgE1/tUXIWaqUCa1758ts/Jio84GZuzsvUkme98kv0WFY8//n0J1Z+vsIsQ==} - engines: {node: '>= 18'} - - '@octokit/openapi-types@22.2.0': - resolution: {integrity: sha512-QBhVjcUa9W7Wwhm6DBFu6ZZ+1/t/oYxqc2tp81Pi41YNuJinbFRx8B133qVOrAaBbF7D/m0Et6f9/pZt9Rc+tg==} - - '@octokit/plugin-paginate-rest@11.3.1': - resolution: {integrity: sha512-ryqobs26cLtM1kQxqeZui4v8FeznirUsksiA+RYemMPJ7Micju0WSkv50dBksTuZks9O5cg4wp+t8fZ/cLY56g==} - engines: {node: '>= 18'} - peerDependencies: - '@octokit/core': '5' - - '@octokit/plugin-request-log@4.0.1': - resolution: {integrity: sha512-GihNqNpGHorUrO7Qa9JbAl0dbLnqJVrV8OXe2Zm5/Y4wFkZQDfTreBzVmiRfJVfE4mClXdihHnbpyyO9FSX4HA==} - engines: {node: '>= 18'} - peerDependencies: - '@octokit/core': '5' - - '@octokit/plugin-rest-endpoint-methods@13.2.2': - resolution: {integrity: sha512-EI7kXWidkt3Xlok5uN43suK99VWqc8OaIMktY9d9+RNKl69juoTyxmLoWPIZgJYzi41qj/9zU7G/ljnNOJ5AFA==} - engines: {node: '>= 18'} - peerDependencies: - '@octokit/core': ^5 - - '@octokit/request-error@5.1.0': - resolution: {integrity: sha512-GETXfE05J0+7H2STzekpKObFe765O5dlAKUTLNGeH+x47z7JjXHfsHKo5z21D/o/IOZTUEI6nyWyR+bZVP/n5Q==} - engines: {node: '>= 18'} - - '@octokit/request@8.4.0': - resolution: {integrity: sha512-9Bb014e+m2TgBeEJGEbdplMVWwPmL1FPtggHQRkV+WVsMggPtEkLKPlcVYm/o8xKLkpJ7B+6N8WfQMtDLX2Dpw==} - engines: {node: '>= 18'} - - '@octokit/rest@20.1.1': - resolution: {integrity: sha512-MB4AYDsM5jhIHro/dq4ix1iWTLGToIGk6cWF5L6vanFaMble5jTX/UBQyiv05HsWnwUtY8JrfHy2LWfKwihqMw==} - engines: {node: '>= 18'} - - '@octokit/types@13.5.0': - resolution: {integrity: sha512-HdqWTf5Z3qwDVlzCrP8UJquMwunpDiMPt5er+QjGzL4hqr/vBVY/MauQgS1xWxCDT1oMx1EULyqxncdCY/NVSQ==} - - '@rollup/pluginutils@4.2.1': - resolution: {integrity: sha512-iKnFXr7NkdZAIHiIWE+BX5ULi/ucVFYWD6TbAV+rZctiRTY2PL6tsIKhoIOaoskiWAkgu+VsbXgUVDNLHf+InQ==} - engines: {node: '>= 8.0.0'} - - '@sindresorhus/merge-streams@2.3.0': - resolution: {integrity: sha512-LtoMMhxAlorcGhmFYI+LhPgbPZCkgP6ra1YL604EeF6U98pLlQ3iWIGMdWSC+vWmPBWBNgmDBAhnAobLROJmwg==} - engines: {node: '>=18'} - - '@tybys/wasm-util@0.9.0': - resolution: {integrity: sha512-6+7nlbMVX/PVDCwaIQ8nTOPveOcFLSt8GcXdx8hD0bt39uWxYT88uXzqTd4fTvqta7oeUJqudepapKNt2DYJFw==} - - '@types/node@20.14.2': - resolution: {integrity: sha512-xyu6WAMVwv6AKFLB+e/7ySZVr/0zLCzOa7rSpq6jNwpqOrUbcACDWC+53d4n2QHOnDou0fbIsg8wZu/sxrnI4Q==} - - '@types/stylis@4.2.6': - resolution: {integrity: sha512-4nebF2ZJGzQk0ka0O6+FZUWceyFv4vWq/0dXBMmrSeAwzOuOd/GxE5Pa64d/ndeNLG73dXoBsRzvtsVsYUv6Uw==} - - '@vercel/nft@0.26.5': - resolution: {integrity: sha512-NHxohEqad6Ra/r4lGknO52uc/GrWILXAMs1BB4401GTqww0fw1bAqzpG1XHuDO+dprg4GvsD9ZLLSsdo78p9hQ==} - engines: {node: '>=16'} - hasBin: true - - abbrev@1.1.1: - resolution: {integrity: sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==} - - acorn-import-attributes@1.9.5: - resolution: {integrity: sha512-n02Vykv5uA3eHGM/Z2dQrcD56kL8TyDb2p1+0P83PClMnC/nc+anbQRhIOWnSq4Ke/KvDPrY3C9hDtC/A3eHnQ==} - peerDependencies: - acorn: ^8 - - acorn-walk@8.3.3: - resolution: {integrity: sha512-MxXdReSRhGO7VlFe1bRG/oI7/mdLV9B9JJT0N8vZOhF7gFRR5l3M8W9G8JxmKV+JC5mGqJ0QvqfSOLsCPa4nUw==} - engines: {node: '>=0.4.0'} - - acorn@8.12.0: - resolution: {integrity: sha512-RTvkC4w+KNXrM39/lWCUaG0IbRkWdCv7W/IOW9oU6SawyxulvkQy5HQPVTKxEjczcUvapcrw3cFx/60VN/NRNw==} - engines: {node: '>=0.4.0'} - hasBin: true - - agent-base@6.0.2: - resolution: {integrity: sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==} - engines: {node: '>= 6.0.0'} - - ansi-escapes@4.3.2: - resolution: {integrity: sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==} - engines: {node: '>=8'} - - ansi-regex@5.0.1: - resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} - engines: {node: '>=8'} - - ansi-regex@6.0.1: - resolution: {integrity: sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==} - engines: {node: '>=12'} - - ansi-styles@4.3.0: - resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} - engines: {node: '>=8'} - - ansi-styles@6.2.1: - resolution: {integrity: sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==} - engines: {node: '>=12'} - - aproba@2.0.0: - resolution: {integrity: sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==} - - are-we-there-yet@2.0.0: - resolution: {integrity: sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw==} - engines: {node: '>=10'} - deprecated: This package is no longer supported. - - argparse@1.0.10: - resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==} - - argparse@2.0.1: - resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} - - array-find-index@1.0.2: - resolution: {integrity: sha512-M1HQyIXcBGtVywBt8WVdim+lrNaK7VHp99Qt5pSNziXznKHViIBbXWtfRTpEFpF/c4FdfxNAsCCwPp5phBYJtw==} - engines: {node: '>=0.10.0'} - - arrgv@1.0.2: - resolution: {integrity: sha512-a4eg4yhp7mmruZDQFqVMlxNRFGi/i1r87pt8SDHy0/I8PqSXoUTlWZRdAZo0VXgvEARcujbtTk8kiZRi1uDGRw==} - engines: {node: '>=8.0.0'} - - arrify@3.0.0: - resolution: {integrity: sha512-tLkvA81vQG/XqE2mjDkGQHoOINtMHtysSnemrmoGe6PydDPMRbVugqyk4A6V/WDWEfm3l+0d8anA9r8cv/5Jaw==} - engines: {node: '>=12'} - - async-sema@3.1.1: - resolution: {integrity: sha512-tLRNUXati5MFePdAk8dw7Qt7DpxPB60ofAgn8WRhW6a2rcimZnYBP9oxHiv0OHy+Wz7kPMG+t4LGdt31+4EmGg==} - - asynckit@0.4.0: - resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} - - ava@6.1.3: - resolution: {integrity: sha512-tkKbpF1pIiC+q09wNU9OfyTDYZa8yuWvU2up3+lFJ3lr1RmnYh2GBpPwzYUEB0wvTPIUysGjcZLNZr7STDviRA==} - engines: {node: ^18.18 || ^20.8 || ^21 || ^22} - hasBin: true - peerDependencies: - '@ava/typescript': '*' - peerDependenciesMeta: - '@ava/typescript': - optional: true - - axios@1.6.2: - resolution: {integrity: sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A==} - - balanced-match@1.0.2: - resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} - - base64-js@1.5.1: - resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==} - - before-after-hook@2.2.3: - resolution: {integrity: sha512-NzUnlZexiaH/46WDhANlyR2bXRopNg4F/zuSA3OpZnllCUgRaOF2znDioDWrmbNVsuZk6l9pMquQB38cfBZwkQ==} - - bindings@1.5.0: - resolution: {integrity: sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==} - - bl@4.1.0: - resolution: {integrity: sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==} - - blueimp-md5@2.19.0: - resolution: {integrity: sha512-DRQrD6gJyy8FbiE4s+bDoXS9hiW3Vbx5uCdwvcCf3zLHL+Iv7LtGHLpr+GZV8rHG8tK766FGYBwRbu8pELTt+w==} - - brace-expansion@1.1.11: - resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} - - braces@3.0.3: - resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==} - engines: {node: '>=8'} - - buffer@5.7.1: - resolution: {integrity: sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==} - - call-bind@1.0.7: - resolution: {integrity: sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==} - engines: {node: '>= 0.4'} - - callsites@4.1.0: - resolution: {integrity: sha512-aBMbD1Xxay75ViYezwT40aQONfr+pSXTHwNKvIXhXD6+LY3F1dLIcceoC5OZKBVHbXcysz1hL9D2w0JJIMXpUw==} - engines: {node: '>=12.20'} - - camelize@1.0.1: - resolution: {integrity: sha512-dU+Tx2fsypxTgtLoE36npi3UqcjSSMNYfkqgmoEhtZrraP5VWq0K7FkWVTYa8eMPtnU/G2txVsfdCJTn9uzpuQ==} - - cbor@9.0.2: - resolution: {integrity: sha512-JPypkxsB10s9QOWwa6zwPzqE1Md3vqpPc+cai4sAecuCsRyAtAl/pMyhPlMbT/xtPnm2dznJZYRLui57qiRhaQ==} - engines: {node: '>=16'} - - chalk@4.1.2: - resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} - engines: {node: '>=10'} - - chalk@5.3.0: - resolution: {integrity: sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==} - engines: {node: ^12.17.0 || ^14.13 || >=16.0.0} - - chardet@0.7.0: - resolution: {integrity: sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==} - - chownr@2.0.0: - resolution: {integrity: sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==} - engines: {node: '>=10'} - - chunkd@2.0.1: - resolution: {integrity: sha512-7d58XsFmOq0j6el67Ug9mHf9ELUXsQXYJBkyxhH/k+6Ke0qXRnv0kbemx+Twc6fRJ07C49lcbdgm9FL1Ei/6SQ==} - - ci-info@4.0.0: - resolution: {integrity: sha512-TdHqgGf9odd8SXNuxtUBVx8Nv+qZOejE6qyqiy5NtbYYQOeFa6zmHkxlPzmaLxWWHsU6nJmB7AETdVPi+2NBUg==} - engines: {node: '>=8'} - - ci-parallel-vars@1.0.1: - resolution: {integrity: sha512-uvzpYrpmidaoxvIQHM+rKSrigjOe9feHYbw4uOI2gdfe1C3xIlxO+kVXq83WQWNniTf8bAxVpy+cQeFQsMERKg==} - - cli-cursor@3.1.0: - resolution: {integrity: sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==} - engines: {node: '>=8'} - - cli-spinners@2.9.2: - resolution: {integrity: sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==} - engines: {node: '>=6'} - - cli-truncate@4.0.0: - resolution: {integrity: sha512-nPdaFdQ0h/GEigbPClz11D0v/ZJEwxmeVZGeMo3Z5StPtUTkA9o1lD6QwoirYiSDzbcwn2XcjwmCp68W1IS4TA==} - engines: {node: '>=18'} - - cli-width@4.1.0: - resolution: {integrity: sha512-ouuZd4/dm2Sw5Gmqy6bGyNNNe1qt9RpmxveLSO7KcgsTnU7RXfsw+/bukWGo1abgBiMAic068rclZsO4IWmmxQ==} - engines: {node: '>= 12'} - - clipanion@3.2.1: - resolution: {integrity: sha512-dYFdjLb7y1ajfxQopN05mylEpK9ZX0sO1/RfMXdfmwjlIsPkbh4p7A682x++zFPLDCo1x3p82dtljHf5cW2LKA==} - peerDependencies: - typanion: '*' - - cliui@8.0.1: - resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==} - engines: {node: '>=12'} - - clone@1.0.4: - resolution: {integrity: sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==} - engines: {node: '>=0.8'} - - code-excerpt@4.0.0: - resolution: {integrity: sha512-xxodCmBen3iy2i0WtAK8FlFNrRzjUqjRsMfho58xT/wvZU1YTM3fCnRjcy1gJPMepaRlgm/0e6w8SpWHpn3/cA==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - color-convert@2.0.1: - resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} - engines: {node: '>=7.0.0'} - - color-name@1.1.4: - resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} - - color-support@1.1.3: - resolution: {integrity: sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==} - hasBin: true - - colorette@2.0.20: - resolution: {integrity: sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==} - - combined-stream@1.0.8: - resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} - engines: {node: '>= 0.8'} - - common-path-prefix@3.0.0: - resolution: {integrity: sha512-QE33hToZseCH3jS0qN96O/bSh3kaw/h+Tq7ngyY9eWDUnTlTNUyqfqvCXioLe5Na5jFsL78ra/wuBU4iuEgd4w==} - - concat-map@0.0.1: - resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} - - concordance@5.0.4: - resolution: {integrity: sha512-OAcsnTEYu1ARJqWVGwf4zh4JDfHZEaSNlNccFmt8YjB2l/n19/PF2viLINHc57vO4FKIAFl2FWASIGZZWZ2Kxw==} - engines: {node: '>=10.18.0 <11 || >=12.14.0 <13 || >=14'} - - console-control-strings@1.1.0: - resolution: {integrity: sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==} - - convert-to-spaces@2.0.1: - resolution: {integrity: sha512-rcQ1bsQO9799wq24uE5AM2tAILy4gXGIK/njFWcVQkGNZ96edlpY+A7bjwvzjYvLDyzmG1MmMLZhpcsb+klNMQ==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - css-color-keywords@1.0.0: - resolution: {integrity: sha512-FyyrDHZKEjXDpNJYvVsV960FiqQyXc/LlYmsxl2BcdMb2WPx0OGRVgTg55rPSyLSNMqP52R9r8geSp7apN3Ofg==} - engines: {node: '>=4'} - - css-to-react-native@3.2.0: - resolution: {integrity: sha512-e8RKaLXMOFii+02mOlqwjbD00KSEKqblnpO9e++1aXS1fPQOpS1YoqdVHBqPjHNoxeF2mimzVqawm2KCbEdtHQ==} - - csstype@3.1.3: - resolution: {integrity: sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==} - - currently-unhandled@0.4.1: - resolution: {integrity: sha512-/fITjgjGU50vjQ4FH6eUoYu+iUoUKIXws2hL15JJpIR+BbTxaXQsMuuyjtNh2WqsSBS5nsaZHFsFecyw5CCAng==} - engines: {node: '>=0.10.0'} - - date-time@3.1.0: - resolution: {integrity: sha512-uqCUKXE5q1PNBXjPqvwhwJf9SwMoAHBgWJ6DcrnS5o+W2JOiIILl0JEdVD8SGujrNS02GGxgwAg2PN2zONgtjg==} - engines: {node: '>=6'} - - debug@4.3.5: - resolution: {integrity: sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg==} - engines: {node: '>=6.0'} - peerDependencies: - supports-color: '*' - peerDependenciesMeta: - supports-color: - optional: true - - defaults@1.0.4: - resolution: {integrity: sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A==} - - define-data-property@1.1.4: - resolution: {integrity: sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==} - engines: {node: '>= 0.4'} - - delayed-stream@1.0.0: - resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} - engines: {node: '>=0.4.0'} - - delegates@1.0.0: - resolution: {integrity: sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==} - - deprecation@2.3.1: - resolution: {integrity: sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==} - - detect-libc@2.0.3: - resolution: {integrity: sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw==} - engines: {node: '>=8'} - - emittery@1.0.3: - resolution: {integrity: sha512-tJdCJitoy2lrC2ldJcqN4vkqJ00lT+tOWNT1hBJjO/3FDMJa5TTIiYGCKGkn/WfCyOzUMObeohbVTj00fhiLiA==} - engines: {node: '>=14.16'} - - emnapi@1.2.0: - resolution: {integrity: sha512-rcq+dJCcfr08I0XM/57LPRqaUokGfni/+SvhO7NaJthTTjRdohhIy0FQwyC5rR1enAsjkldQg83th8J5hURv0Q==} - peerDependencies: - node-addon-api: '>= 6.1.0' - peerDependenciesMeta: - node-addon-api: - optional: true - - emoji-regex@10.3.0: - resolution: {integrity: sha512-QpLs9D9v9kArv4lfDEgg1X/gN5XLnf/A6l9cs8SPZLRZR3ZkY9+kwIQTxm+fsSej5UMYGE8fdoaZVIBlqG0XTw==} - - emoji-regex@8.0.0: - resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} - - es-define-property@1.0.0: - resolution: {integrity: sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==} - engines: {node: '>= 0.4'} - - es-errors@1.3.0: - resolution: {integrity: sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==} - engines: {node: '>= 0.4'} - - escalade@3.1.2: - resolution: {integrity: sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==} - engines: {node: '>=6'} - - escape-string-regexp@2.0.0: - resolution: {integrity: sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==} - engines: {node: '>=8'} - - escape-string-regexp@5.0.0: - resolution: {integrity: sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==} - engines: {node: '>=12'} - - esprima@4.0.1: - resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==} - engines: {node: '>=4'} - hasBin: true - - estree-walker@2.0.2: - resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==} - - esutils@2.0.3: - resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} - engines: {node: '>=0.10.0'} - - external-editor@3.1.0: - resolution: {integrity: sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==} - engines: {node: '>=4'} - - fast-diff@1.3.0: - resolution: {integrity: sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==} - - fast-glob@3.3.2: - resolution: {integrity: sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==} - engines: {node: '>=8.6.0'} - - fastq@1.17.1: - resolution: {integrity: sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==} - - figures@6.1.0: - resolution: {integrity: sha512-d+l3qxjSesT4V7v2fh+QnmFnUWv9lSpjarhShNTgBOfA0ttejbQUAlHLitbjkoRiDulW0OPoQPYIGhIC8ohejg==} - engines: {node: '>=18'} - - file-uri-to-path@1.0.0: - resolution: {integrity: sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==} - - fill-range@7.1.1: - resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==} - engines: {node: '>=8'} - - find-up-simple@1.0.0: - resolution: {integrity: sha512-q7Us7kcjj2VMePAa02hDAF6d+MzsdsAWEwYyOpwUtlerRBkOEPBCRZrAV4XfcSN8fHAgaD0hP7miwoay6DCprw==} - engines: {node: '>=18'} - - follow-redirects@1.15.6: - resolution: {integrity: sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==} - engines: {node: '>=4.0'} - peerDependencies: - debug: '*' - peerDependenciesMeta: - debug: - optional: true - - form-data@4.0.0: - resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==} - engines: {node: '>= 6'} - - fs-minipass@2.1.0: - resolution: {integrity: sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==} - engines: {node: '>= 8'} - - fs.realpath@1.0.0: - resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} - - function-bind@1.1.2: - resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==} - - gauge@3.0.2: - resolution: {integrity: sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q==} - engines: {node: '>=10'} - deprecated: This package is no longer supported. - - get-caller-file@2.0.5: - resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} - engines: {node: 6.* || 8.* || >= 10.*} - - get-east-asian-width@1.2.0: - resolution: {integrity: sha512-2nk+7SIVb14QrgXFHcm84tD4bKQz0RxPuMT8Ag5KPOq7J5fEmAg0UbXdTOSHqNuHSU28k55qnceesxXRZGzKWA==} - engines: {node: '>=18'} - - get-intrinsic@1.2.4: - resolution: {integrity: sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==} - engines: {node: '>= 0.4'} - - glob-parent@5.1.2: - resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} - engines: {node: '>= 6'} - - glob@7.2.3: - resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} - deprecated: Glob versions prior to v9 are no longer supported - - globby@14.0.1: - resolution: {integrity: sha512-jOMLD2Z7MAhyG8aJpNOpmziMOP4rPLcc95oQPKXBazW82z+CEgPFBQvEpRUa1KeIMUJo4Wsm+q6uzO/Q/4BksQ==} - engines: {node: '>=18'} - - gopd@1.0.1: - resolution: {integrity: sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==} - - graceful-fs@4.2.11: - resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} - - has-flag@4.0.0: - resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} - engines: {node: '>=8'} - - has-property-descriptors@1.0.2: - resolution: {integrity: sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==} - - has-proto@1.0.3: - resolution: {integrity: sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==} - engines: {node: '>= 0.4'} - - has-symbols@1.0.3: - resolution: {integrity: sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==} - engines: {node: '>= 0.4'} - - has-unicode@2.0.1: - resolution: {integrity: sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==} - - hasown@2.0.2: - resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==} - engines: {node: '>= 0.4'} - - https-proxy-agent@5.0.1: - resolution: {integrity: sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==} - engines: {node: '>= 6'} - - iconv-lite@0.4.24: - resolution: {integrity: sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==} - engines: {node: '>=0.10.0'} - - ieee754@1.2.1: - resolution: {integrity: sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==} - - ignore-by-default@2.1.0: - resolution: {integrity: sha512-yiWd4GVmJp0Q6ghmM2B/V3oZGRmjrKLXvHR3TE1nfoXsmoggllfZUQe74EN0fJdPFZu2NIvNdrMMLm3OsV7Ohw==} - engines: {node: '>=10 <11 || >=12 <13 || >=14'} - - ignore@5.3.1: - resolution: {integrity: sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==} - engines: {node: '>= 4'} - - imurmurhash@0.1.4: - resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} - engines: {node: '>=0.8.19'} - - indent-string@5.0.0: - resolution: {integrity: sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==} - engines: {node: '>=12'} - - inflight@1.0.6: - resolution: {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. - - inherits@2.0.4: - resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} - - inquirer@9.2.23: - resolution: {integrity: sha512-kod5s+FBPIDM2xiy9fu+6wdU/SkK5le5GS9lh4FEBjBHqiMgD9lLFbCbuqFNAjNL2ZOy9Wd9F694IOzN9pZHBA==} - engines: {node: '>=18'} - - irregular-plurals@3.5.0: - resolution: {integrity: sha512-1ANGLZ+Nkv1ptFb2pa8oG8Lem4krflKuX/gINiHJHjJUKaJHk/SXk5x6K3J+39/p0h1RQ2saROclJJ+QLvETCQ==} - engines: {node: '>=8'} - - is-extglob@2.1.1: - resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} - engines: {node: '>=0.10.0'} - - is-fullwidth-code-point@3.0.0: - resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} - engines: {node: '>=8'} - - is-fullwidth-code-point@4.0.0: - resolution: {integrity: sha512-O4L094N2/dZ7xqVdrXhh9r1KODPJpFms8B5sGdJLPy664AgvXsreZUyCQQNItZRDlYug4xStLjNp/sz3HvBowQ==} - engines: {node: '>=12'} - - is-glob@4.0.3: - resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} - engines: {node: '>=0.10.0'} - - is-interactive@1.0.0: - resolution: {integrity: sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w==} - engines: {node: '>=8'} - - is-number@7.0.0: - resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} - engines: {node: '>=0.12.0'} - - is-plain-object@5.0.0: - resolution: {integrity: sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==} - engines: {node: '>=0.10.0'} - - is-promise@4.0.0: - resolution: {integrity: sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==} - - is-unicode-supported@0.1.0: - resolution: {integrity: sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==} - engines: {node: '>=10'} - - is-unicode-supported@2.0.0: - resolution: {integrity: sha512-FRdAyx5lusK1iHG0TWpVtk9+1i+GjrzRffhDg4ovQ7mcidMQ6mj+MhKPmvh7Xwyv5gIS06ns49CA7Sqg7lC22Q==} - engines: {node: '>=18'} - - js-string-escape@1.0.1: - resolution: {integrity: sha512-Smw4xcfIQ5LVjAOuJCvN/zIodzA/BBSsluuoSykP+lUvScIi4U6RJLfwHet5cxFnCswUjISV8oAXaqaJDY3chg==} - engines: {node: '>= 0.8'} - - js-tokens@4.0.0: - resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} - - js-yaml@3.14.1: - resolution: {integrity: sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==} - hasBin: true - - js-yaml@4.1.0: - resolution: {integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==} - hasBin: true - - load-json-file@7.0.1: - resolution: {integrity: sha512-Gnxj3ev3mB5TkVBGad0JM6dmLiQL+o0t23JPBZ9sd+yvSLk05mFoqKBw5N8gbbkU4TNXyqCgIrl/VM17OgUIgQ==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - lodash-es@4.17.21: - resolution: {integrity: sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==} - - lodash@4.17.21: - resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} - - log-symbols@4.1.0: - resolution: {integrity: sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==} - engines: {node: '>=10'} - - loose-envify@1.4.0: - resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==} - hasBin: true - - make-dir@3.1.0: - resolution: {integrity: sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==} - engines: {node: '>=8'} - - matcher@5.0.0: - resolution: {integrity: sha512-s2EMBOWtXFc8dgqvoAzKJXxNHibcdJMV0gwqKUaw9E2JBJuGUK7DrNKrA6g/i+v72TT16+6sVm5mS3thaMLQUw==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - md5-hex@3.0.1: - resolution: {integrity: sha512-BUiRtTtV39LIJwinWBjqVsU9xhdnz7/i889V859IBFpuqGAj6LuOvHv5XLbgZ2R7ptJoJaEcxkv88/h25T7Ciw==} - engines: {node: '>=8'} - - memoize@10.0.0: - resolution: {integrity: sha512-H6cBLgsi6vMWOcCpvVCdFFnl3kerEXbrYh9q+lY6VXvQSmM6CkmV08VOwT+WE2tzIEqRPFfAq3fm4v/UIW6mSA==} - engines: {node: '>=18'} - - merge2@1.4.1: - resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} - engines: {node: '>= 8'} - - micromatch@4.0.7: - resolution: {integrity: sha512-LPP/3KorzCwBxfeUuZmaR6bG2kdeHSbe0P2tY3FLRU4vYrjYz5hI4QZwV0njUx3jeuKe67YukQ1LSPZBKDqO/Q==} - engines: {node: '>=8.6'} - - mime-db@1.52.0: - resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} - engines: {node: '>= 0.6'} - - mime-types@2.1.35: - resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} - engines: {node: '>= 0.6'} - - mimic-fn@2.1.0: - resolution: {integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==} - engines: {node: '>=6'} - - mimic-function@5.0.1: - resolution: {integrity: sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==} - engines: {node: '>=18'} - - minimatch@3.1.2: - resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} - - minipass@3.3.6: - resolution: {integrity: sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==} - engines: {node: '>=8'} - - minipass@5.0.0: - resolution: {integrity: sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==} - engines: {node: '>=8'} - - minizlib@2.1.2: - resolution: {integrity: sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==} - engines: {node: '>= 8'} - - mkdirp@1.0.4: - resolution: {integrity: sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==} - engines: {node: '>=10'} - hasBin: true - - ms@2.1.2: - resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} - - ms@2.1.3: - resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} - - mute-stream@1.0.0: - resolution: {integrity: sha512-avsJQhyd+680gKXyG/sQc0nXaC6rBkPOfyHYcFb9+hdkqQkR9bdnkJ0AMZhke0oesPqIO+mFFJ+IdBc7mst4IA==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - - nanoid@3.3.7: - resolution: {integrity: sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==} - engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} - hasBin: true - - node-fetch@2.7.0: - resolution: {integrity: sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==} - engines: {node: 4.x || >=6.0.0} - peerDependencies: - encoding: ^0.1.0 - peerDependenciesMeta: - encoding: - optional: true - - node-gyp-build@4.8.1: - resolution: {integrity: sha512-OSs33Z9yWr148JZcbZd5WiAXhh/n9z8TxQcdMhIOlpN9AhWpLfvVFO73+m77bBABQMaY9XSvIa+qk0jlI7Gcaw==} - hasBin: true - - nofilter@3.1.0: - resolution: {integrity: sha512-l2NNj07e9afPnhAhvgVrCD/oy2Ai1yfLpuo3EpiO1jFTsB4sFz6oIfAfSZyQzVpkZQ9xS8ZS5g1jCBgq4Hwo0g==} - engines: {node: '>=12.19'} - - nopt@5.0.0: - resolution: {integrity: sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==} - engines: {node: '>=6'} - hasBin: true - - npmlog@5.0.1: - resolution: {integrity: sha512-AqZtDUWOMKs1G/8lwylVjrdYgqA4d9nu8hc+0gzRxlDb1I10+FHBGMXs6aiQHFdCUUlqH99MUMuLfzWDNDtfxw==} - deprecated: This package is no longer supported. - - object-assign@4.1.1: - resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} - engines: {node: '>=0.10.0'} - - once@1.4.0: - resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} - - onetime@5.1.2: - resolution: {integrity: sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==} - engines: {node: '>=6'} - - ora@5.4.1: - resolution: {integrity: sha512-5b6Y85tPxZZ7QytO+BQzysW31HJku27cRIlkbAXaNx+BdcVi+LlRFmVXzeF6a7JCwJpyw5c4b+YSVImQIrBpuQ==} - engines: {node: '>=10'} - - os-tmpdir@1.0.2: - resolution: {integrity: sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==} - engines: {node: '>=0.10.0'} - - p-map@7.0.2: - resolution: {integrity: sha512-z4cYYMMdKHzw4O5UkWJImbZynVIo0lSGTXc7bzB1e/rrDqkgGUNysK/o4bTr+0+xKvvLoTyGqYC4Fgljy9qe1Q==} - engines: {node: '>=18'} - - package-config@5.0.0: - resolution: {integrity: sha512-GYTTew2slBcYdvRHqjhwaaydVMvn/qrGC323+nKclYioNSLTDUM/lGgtGTgyHVtYcozb+XkE8CNhwcraOmZ9Mg==} - engines: {node: '>=18'} - - parse-ms@4.0.0: - resolution: {integrity: sha512-TXfryirbmq34y8QBwgqCVLi+8oA3oWx2eAnSn62ITyEhEYaWRlVZ2DvMM9eZbMs/RfxPu/PK/aBLyGj4IrqMHw==} - engines: {node: '>=18'} - - path-is-absolute@1.0.1: - resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==} - engines: {node: '>=0.10.0'} - - path-type@5.0.0: - resolution: {integrity: sha512-5HviZNaZcfqP95rwpv+1HDgUamezbqdSYTyzjTvwtJSnIH+3vnbmWsItli8OFEndS984VT55M3jduxZbX351gg==} - engines: {node: '>=12'} - - picocolors@1.0.1: - resolution: {integrity: sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==} - - picomatch@2.3.1: - resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} - engines: {node: '>=8.6'} - - picomatch@3.0.1: - resolution: {integrity: sha512-I3EurrIQMlRc9IaAZnqRR044Phh2DXY+55o7uJ0V+hYZAcQYSuFWsc9q5PvyDHUSCe1Qxn/iBz+78s86zWnGag==} - engines: {node: '>=10'} - - plur@5.1.0: - resolution: {integrity: sha512-VP/72JeXqak2KiOzjgKtQen5y3IZHn+9GOuLDafPv0eXa47xq0At93XahYBs26MsifCQ4enGKwbjBTKgb9QJXg==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - postcss-value-parser@4.2.0: - resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==} - - postcss@8.4.33: - resolution: {integrity: sha512-Kkpbhhdjw2qQs2O2DGX+8m5OVqEcbB9HRBvuYM9pgrjEFUg30A9LmXNlTAUj4S9kgtGyrMbTzVjH7E+s5Re2yg==} - engines: {node: ^10 || ^12 || >=14} - - pretty-ms@9.0.0: - resolution: {integrity: sha512-E9e9HJ9R9NasGOgPaPE8VMeiPKAyWR5jcFpNnwIejslIhWqdqOrb2wShBsncMPUb+BcCd2OPYfh7p2W6oemTng==} - engines: {node: '>=18'} - - proxy-from-env@1.1.0: - resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==} - - queue-microtask@1.2.3: - resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} - - react-dom@18.3.1: - resolution: {integrity: sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==} - peerDependencies: - react: ^18.3.1 - - react@18.3.1: - resolution: {integrity: sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==} - engines: {node: '>=0.10.0'} - - readable-stream@3.6.2: - resolution: {integrity: sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==} - engines: {node: '>= 6'} - - require-directory@2.1.1: - resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} - engines: {node: '>=0.10.0'} - - resolve-cwd@3.0.0: - resolution: {integrity: sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==} - engines: {node: '>=8'} - - resolve-from@5.0.0: - resolution: {integrity: sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==} - engines: {node: '>=8'} - - restore-cursor@3.1.0: - resolution: {integrity: sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==} - engines: {node: '>=8'} - - reusify@1.0.4: - resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==} - engines: {iojs: '>=1.0.0', node: '>=0.10.0'} - - rimraf@3.0.2: - resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==} - deprecated: Rimraf versions prior to v4 are no longer supported - hasBin: true - - run-async@3.0.0: - resolution: {integrity: sha512-540WwVDOMxA6dN6We19EcT9sc3hkXPw5mzRNGM3FkdN/vtE9NFvj5lFAPNwUDmJjXidm3v7TC1cTE7t17Ulm1Q==} - engines: {node: '>=0.12.0'} - - run-parallel@1.2.0: - resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} - - rxjs@7.8.1: - resolution: {integrity: sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==} - - safe-buffer@5.2.1: - resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} - - safer-buffer@2.1.2: - resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} - - scheduler@0.23.2: - resolution: {integrity: sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ==} - - semver@6.3.1: - resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} - hasBin: true - - semver@7.6.2: - resolution: {integrity: sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==} - engines: {node: '>=10'} - hasBin: true - - serialize-error@7.0.1: - resolution: {integrity: sha512-8I8TjW5KMOKsZQTvoxjuSIa7foAwPWGOts+6o7sgjz41/qMD9VQHEDxi6PBvK2l0MXUmqZyNpUK+T2tQaaElvw==} - engines: {node: '>=10'} - - set-blocking@2.0.0: - resolution: {integrity: sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==} - - set-function-length@1.2.2: - resolution: {integrity: sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==} - engines: {node: '>= 0.4'} - - shallowequal@1.1.0: - resolution: {integrity: sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ==} - - signal-exit@3.0.7: - resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} - - signal-exit@4.1.0: - resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} - engines: {node: '>=14'} - - slash@5.1.0: - resolution: {integrity: sha512-ZA6oR3T/pEyuqwMgAKT0/hAv8oAXckzbkmR0UkUosQ+Mc4RxGoJkRmwHgHufaenlyAgE1Mxgpdcrf75y6XcnDg==} - engines: {node: '>=14.16'} - - slice-ansi@5.0.0: - resolution: {integrity: sha512-FC+lgizVPfie0kkhqUScwRu1O/lF6NOgJmlCgK+/LYxDCTk8sGelYaHDhFcDN+Sn3Cv+3VSa4Byeo+IMCzpMgQ==} - engines: {node: '>=12'} - - source-map-js@1.2.0: - resolution: {integrity: sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==} - engines: {node: '>=0.10.0'} - - sprintf-js@1.0.3: - resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==} - - stack-utils@2.0.6: - resolution: {integrity: sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==} - engines: {node: '>=10'} - - string-width@4.2.3: - resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} - engines: {node: '>=8'} - - string-width@7.1.0: - resolution: {integrity: sha512-SEIJCWiX7Kg4c129n48aDRwLbFb2LJmXXFrWBG4NGaRtMQ3myKPKbwrD1BKqQn74oCoNMBVrfDEr5M9YxCsrkw==} - engines: {node: '>=18'} - - string_decoder@1.3.0: - resolution: {integrity: sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==} - - strip-ansi@6.0.1: - resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} - engines: {node: '>=8'} - - strip-ansi@7.1.0: - resolution: {integrity: sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==} - engines: {node: '>=12'} - - styled-components@6.1.1: - resolution: {integrity: sha512-cpZZP5RrKRIClBW5Eby4JM1wElLVP4NQrJbJ0h10TidTyJf4SIIwa3zLXOoPb4gJi8MsJ8mjq5mu2IrEhZIAcQ==} - engines: {node: '>= 16'} - peerDependencies: - react: '>= 16.8.0' - react-dom: '>= 16.8.0' - - stylis@4.3.2: - resolution: {integrity: sha512-bhtUjWd/z6ltJiQwg0dUfxEJ+W+jdqQd8TbWLWyeIJHlnsqmGLRFFd8e5mA0AZi/zx90smXRlN66YMTcaSFifg==} - - supertap@3.0.1: - resolution: {integrity: sha512-u1ZpIBCawJnO+0QePsEiOknOfCRq0yERxiAchT0i4li0WHNUJbf0evXXSXOcCAR4M8iMDoajXYmstm/qO81Isw==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - supports-color@7.2.0: - resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} - engines: {node: '>=8'} - - tar@6.2.1: - resolution: {integrity: sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==} - engines: {node: '>=10'} - - temp-dir@3.0.0: - resolution: {integrity: sha512-nHc6S/bwIilKHNRgK/3jlhDoIHcp45YgyiwcAk46Tr0LfEqGBVpmiAyuiuxeVE44m3mXnEeVhaipLOEWmH+Njw==} - engines: {node: '>=14.16'} - - time-zone@1.0.0: - resolution: {integrity: sha512-TIsDdtKo6+XrPtiTm1ssmMngN1sAhyKnTO2kunQWqNPWIVvCm15Wmw4SWInwTVgJ5u/Tr04+8Ei9TNcw4x4ONA==} - engines: {node: '>=4'} - - tmp@0.0.33: - resolution: {integrity: sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==} - engines: {node: '>=0.6.0'} - - to-regex-range@5.0.1: - resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} - engines: {node: '>=8.0'} - - toml@3.0.0: - resolution: {integrity: sha512-y/mWCZinnvxjTKYhJ+pYxwD0mRLVvOtdS2Awbgxln6iEnt4rk0yBxeSBHkGJcPucRiG0e55mwWp+g/05rsrd6w==} - - tr46@0.0.3: - resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==} - - tslib@2.6.3: - resolution: {integrity: sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ==} - - typanion@3.14.0: - resolution: {integrity: sha512-ZW/lVMRabETuYCd9O9ZvMhAh8GslSqaUjxmK/JLPCh6l73CvLBiuXswj/+7LdnWOgYsQ130FqLzFz5aGT4I3Ug==} - - type-fest@0.13.1: - resolution: {integrity: sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==} - engines: {node: '>=10'} - - type-fest@0.21.3: - resolution: {integrity: sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==} - engines: {node: '>=10'} - - typescript@5.4.5: - resolution: {integrity: sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==} - engines: {node: '>=14.17'} - hasBin: true - - undici-types@5.26.5: - resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==} - - unicorn-magic@0.1.0: - resolution: {integrity: sha512-lRfVq8fE8gz6QMBuDM6a+LO3IAzTi05H6gCVaUpir2E1Rwpo4ZUog45KpNXKC/Mn3Yb9UDuHumeFTo9iV/D9FQ==} - engines: {node: '>=18'} - - universal-user-agent@6.0.1: - resolution: {integrity: sha512-yCzhz6FN2wU1NiiQRogkTQszlQSlpWaw8SvVegAc+bDxbzHgh1vX8uIe8OYyMH6DwH+sdTJsgMl36+mSMdRJIQ==} - - util-deprecate@1.0.2: - resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} - - wasm-sjlj@1.0.5: - resolution: {integrity: sha512-Z/MHJeOkAvJJVWnGX3/YZGYldGaawZbYHX4ldYG9kLhcdB8H31F5x66M7Zc4BP/7pg0aLsusQj1629m2B3Rilg==} - - wcwidth@1.0.1: - resolution: {integrity: sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==} - - webidl-conversions@3.0.1: - resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==} - - well-known-symbols@2.0.0: - resolution: {integrity: sha512-ZMjC3ho+KXo0BfJb7JgtQ5IBuvnShdlACNkKkdsqBmYw3bPAaJfPeYUo6tLUaT5tG/Gkh7xkpBhKRQ9e7pyg9Q==} - engines: {node: '>=6'} - - whatwg-url@5.0.0: - resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==} - - wide-align@1.1.5: - resolution: {integrity: sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==} - - wrap-ansi@6.2.0: - resolution: {integrity: sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==} - engines: {node: '>=8'} - - wrap-ansi@7.0.0: - resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==} - engines: {node: '>=10'} - - wrappy@1.0.2: - resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} - - write-file-atomic@5.0.1: - resolution: {integrity: sha512-+QU2zd6OTD8XWIJCbffaiQeH9U73qIqafo1x6V1snCWYGJf6cVE0cDR4D8xRzcEnfI21IFrUPzPGtcPf8AC+Rw==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - - y18n@5.0.8: - resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==} - engines: {node: '>=10'} - - yallist@4.0.0: - resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==} - - yargs-parser@21.1.1: - resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} - engines: {node: '>=12'} - - yargs@17.7.2: - resolution: {integrity: sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==} - engines: {node: '>=12'} - -snapshots: - - '@emnapi/core@1.2.0': - dependencies: - '@emnapi/wasi-threads': 1.0.1 - tslib: 2.6.3 - - '@emnapi/runtime@1.2.0': - dependencies: - tslib: 2.6.3 - - '@emnapi/wasi-threads@1.0.1': - dependencies: - tslib: 2.6.3 - - '@emotion/is-prop-valid@1.2.2': - dependencies: - '@emotion/memoize': 0.8.1 - - '@emotion/memoize@0.8.1': {} - - '@emotion/unitless@0.8.1': {} - - '@inquirer/figures@1.0.3': {} - - '@ljharb/through@2.3.13': - dependencies: - call-bind: 1.0.7 - - '@mapbox/node-pre-gyp@1.0.11': - dependencies: - detect-libc: 2.0.3 - https-proxy-agent: 5.0.1 - make-dir: 3.1.0 - node-fetch: 2.7.0 - nopt: 5.0.0 - npmlog: 5.0.1 - rimraf: 3.0.2 - semver: 7.6.2 - tar: 6.2.1 - transitivePeerDependencies: - - encoding - - supports-color - - '@napi-rs/cli@3.0.0-alpha.55(@emnapi/runtime@1.2.0)(emnapi@1.2.0)': - dependencies: - '@napi-rs/cross-toolchain': 0.0.16 - '@napi-rs/wasm-tools': 0.0.2 - '@octokit/rest': 20.1.1 - clipanion: 3.2.1(typanion@3.14.0) - colorette: 2.0.20 - debug: 4.3.5 - inquirer: 9.2.23 - js-yaml: 4.1.0 - lodash-es: 4.17.21 - semver: 7.6.2 - toml: 3.0.0 - typanion: 3.14.0 - wasm-sjlj: 1.0.5 - optionalDependencies: - '@emnapi/runtime': 1.2.0 - emnapi: 1.2.0 - transitivePeerDependencies: - - '@napi-rs/cross-toolchain-arm64-target-aarch64' - - '@napi-rs/cross-toolchain-arm64-target-armv7' - - '@napi-rs/cross-toolchain-arm64-target-x86_64' - - '@napi-rs/cross-toolchain-x64-target-aarch64' - - '@napi-rs/cross-toolchain-x64-target-armv7' - - '@napi-rs/cross-toolchain-x64-target-x86_64' - - supports-color - - '@napi-rs/cross-toolchain@0.0.16': - dependencies: - '@napi-rs/lzma': 1.3.1 - '@napi-rs/tar': 0.1.1 - debug: 4.3.5 - transitivePeerDependencies: - - supports-color - - '@napi-rs/lzma-android-arm-eabi@1.3.1': - optional: true - - '@napi-rs/lzma-android-arm64@1.3.1': - optional: true - - '@napi-rs/lzma-darwin-arm64@1.3.1': - optional: true - - '@napi-rs/lzma-darwin-x64@1.3.1': - optional: true - - '@napi-rs/lzma-freebsd-x64@1.3.1': - optional: true - - '@napi-rs/lzma-linux-arm-gnueabihf@1.3.1': - optional: true - - '@napi-rs/lzma-linux-arm64-gnu@1.3.1': - optional: true - - '@napi-rs/lzma-linux-arm64-musl@1.3.1': - optional: true - - '@napi-rs/lzma-linux-x64-gnu@1.3.1': - optional: true - - '@napi-rs/lzma-linux-x64-musl@1.3.1': - optional: true - - '@napi-rs/lzma-wasm32-wasi@1.3.1': - dependencies: - '@napi-rs/wasm-runtime': 0.2.4 - optional: true - - '@napi-rs/lzma-win32-arm64-msvc@1.3.1': - optional: true - - '@napi-rs/lzma-win32-ia32-msvc@1.3.1': - optional: true - - '@napi-rs/lzma-win32-x64-msvc@1.3.1': - optional: true - - '@napi-rs/lzma@1.3.1': - optionalDependencies: - '@napi-rs/lzma-android-arm-eabi': 1.3.1 - '@napi-rs/lzma-android-arm64': 1.3.1 - '@napi-rs/lzma-darwin-arm64': 1.3.1 - '@napi-rs/lzma-darwin-x64': 1.3.1 - '@napi-rs/lzma-freebsd-x64': 1.3.1 - '@napi-rs/lzma-linux-arm-gnueabihf': 1.3.1 - '@napi-rs/lzma-linux-arm64-gnu': 1.3.1 - '@napi-rs/lzma-linux-arm64-musl': 1.3.1 - '@napi-rs/lzma-linux-x64-gnu': 1.3.1 - '@napi-rs/lzma-linux-x64-musl': 1.3.1 - '@napi-rs/lzma-wasm32-wasi': 1.3.1 - '@napi-rs/lzma-win32-arm64-msvc': 1.3.1 - '@napi-rs/lzma-win32-ia32-msvc': 1.3.1 - '@napi-rs/lzma-win32-x64-msvc': 1.3.1 - - '@napi-rs/tar-android-arm-eabi@0.1.1': - optional: true - - '@napi-rs/tar-android-arm64@0.1.1': - optional: true - - '@napi-rs/tar-darwin-arm64@0.1.1': - optional: true - - '@napi-rs/tar-darwin-x64@0.1.1': - optional: true - - '@napi-rs/tar-freebsd-x64@0.1.1': - optional: true - - '@napi-rs/tar-linux-arm-gnueabihf@0.1.1': - optional: true - - '@napi-rs/tar-linux-arm64-gnu@0.1.1': - optional: true - - '@napi-rs/tar-linux-arm64-musl@0.1.1': - optional: true - - '@napi-rs/tar-linux-x64-gnu@0.1.1': - optional: true - - '@napi-rs/tar-linux-x64-musl@0.1.1': - optional: true - - '@napi-rs/tar-wasm32-wasi@0.1.1': - dependencies: - '@napi-rs/wasm-runtime': 0.2.4 - optional: true - - '@napi-rs/tar-win32-arm64-msvc@0.1.1': - optional: true - - '@napi-rs/tar-win32-ia32-msvc@0.1.1': - optional: true - - '@napi-rs/tar-win32-x64-msvc@0.1.1': - optional: true - - '@napi-rs/tar@0.1.1': - optionalDependencies: - '@napi-rs/tar-android-arm-eabi': 0.1.1 - '@napi-rs/tar-android-arm64': 0.1.1 - '@napi-rs/tar-darwin-arm64': 0.1.1 - '@napi-rs/tar-darwin-x64': 0.1.1 - '@napi-rs/tar-freebsd-x64': 0.1.1 - '@napi-rs/tar-linux-arm-gnueabihf': 0.1.1 - '@napi-rs/tar-linux-arm64-gnu': 0.1.1 - '@napi-rs/tar-linux-arm64-musl': 0.1.1 - '@napi-rs/tar-linux-x64-gnu': 0.1.1 - '@napi-rs/tar-linux-x64-musl': 0.1.1 - '@napi-rs/tar-wasm32-wasi': 0.1.1 - '@napi-rs/tar-win32-arm64-msvc': 0.1.1 - '@napi-rs/tar-win32-ia32-msvc': 0.1.1 - '@napi-rs/tar-win32-x64-msvc': 0.1.1 - - '@napi-rs/wasm-runtime@0.2.4': - dependencies: - '@emnapi/core': 1.2.0 - '@emnapi/runtime': 1.2.0 - '@tybys/wasm-util': 0.9.0 - - '@napi-rs/wasm-tools-android-arm-eabi@0.0.2': - optional: true - - '@napi-rs/wasm-tools-android-arm64@0.0.2': - optional: true - - '@napi-rs/wasm-tools-darwin-arm64@0.0.2': - optional: true - - '@napi-rs/wasm-tools-darwin-x64@0.0.2': - optional: true - - '@napi-rs/wasm-tools-freebsd-x64@0.0.2': - optional: true - - '@napi-rs/wasm-tools-linux-arm64-gnu@0.0.2': - optional: true - - '@napi-rs/wasm-tools-linux-arm64-musl@0.0.2': - optional: true - - '@napi-rs/wasm-tools-linux-x64-gnu@0.0.2': - optional: true - - '@napi-rs/wasm-tools-linux-x64-musl@0.0.2': - optional: true - - '@napi-rs/wasm-tools-wasm32-wasi@0.0.2': - dependencies: - '@napi-rs/wasm-runtime': 0.2.4 - optional: true - - '@napi-rs/wasm-tools-win32-arm64-msvc@0.0.2': - optional: true - - '@napi-rs/wasm-tools-win32-ia32-msvc@0.0.2': - optional: true - - '@napi-rs/wasm-tools-win32-x64-msvc@0.0.2': - optional: true - - '@napi-rs/wasm-tools@0.0.2': - optionalDependencies: - '@napi-rs/wasm-tools-android-arm-eabi': 0.0.2 - '@napi-rs/wasm-tools-android-arm64': 0.0.2 - '@napi-rs/wasm-tools-darwin-arm64': 0.0.2 - '@napi-rs/wasm-tools-darwin-x64': 0.0.2 - '@napi-rs/wasm-tools-freebsd-x64': 0.0.2 - '@napi-rs/wasm-tools-linux-arm64-gnu': 0.0.2 - '@napi-rs/wasm-tools-linux-arm64-musl': 0.0.2 - '@napi-rs/wasm-tools-linux-x64-gnu': 0.0.2 - '@napi-rs/wasm-tools-linux-x64-musl': 0.0.2 - '@napi-rs/wasm-tools-wasm32-wasi': 0.0.2 - '@napi-rs/wasm-tools-win32-arm64-msvc': 0.0.2 - '@napi-rs/wasm-tools-win32-ia32-msvc': 0.0.2 - '@napi-rs/wasm-tools-win32-x64-msvc': 0.0.2 - - '@nodelib/fs.scandir@2.1.5': - dependencies: - '@nodelib/fs.stat': 2.0.5 - run-parallel: 1.2.0 - - '@nodelib/fs.stat@2.0.5': {} - - '@nodelib/fs.walk@1.2.8': - dependencies: - '@nodelib/fs.scandir': 2.1.5 - fastq: 1.17.1 - - '@octokit/auth-token@4.0.0': {} - - '@octokit/core@5.2.0': - dependencies: - '@octokit/auth-token': 4.0.0 - '@octokit/graphql': 7.1.0 - '@octokit/request': 8.4.0 - '@octokit/request-error': 5.1.0 - '@octokit/types': 13.5.0 - before-after-hook: 2.2.3 - universal-user-agent: 6.0.1 - - '@octokit/endpoint@9.0.5': - dependencies: - '@octokit/types': 13.5.0 - universal-user-agent: 6.0.1 - - '@octokit/graphql@7.1.0': - dependencies: - '@octokit/request': 8.4.0 - '@octokit/types': 13.5.0 - universal-user-agent: 6.0.1 - - '@octokit/openapi-types@22.2.0': {} - - '@octokit/plugin-paginate-rest@11.3.1(@octokit/core@5.2.0)': - dependencies: - '@octokit/core': 5.2.0 - '@octokit/types': 13.5.0 - - '@octokit/plugin-request-log@4.0.1(@octokit/core@5.2.0)': - dependencies: - '@octokit/core': 5.2.0 - - '@octokit/plugin-rest-endpoint-methods@13.2.2(@octokit/core@5.2.0)': - dependencies: - '@octokit/core': 5.2.0 - '@octokit/types': 13.5.0 - - '@octokit/request-error@5.1.0': - dependencies: - '@octokit/types': 13.5.0 - deprecation: 2.3.1 - once: 1.4.0 - - '@octokit/request@8.4.0': - dependencies: - '@octokit/endpoint': 9.0.5 - '@octokit/request-error': 5.1.0 - '@octokit/types': 13.5.0 - universal-user-agent: 6.0.1 - - '@octokit/rest@20.1.1': - dependencies: - '@octokit/core': 5.2.0 - '@octokit/plugin-paginate-rest': 11.3.1(@octokit/core@5.2.0) - '@octokit/plugin-request-log': 4.0.1(@octokit/core@5.2.0) - '@octokit/plugin-rest-endpoint-methods': 13.2.2(@octokit/core@5.2.0) - - '@octokit/types@13.5.0': - dependencies: - '@octokit/openapi-types': 22.2.0 - - '@rollup/pluginutils@4.2.1': - dependencies: - estree-walker: 2.0.2 - picomatch: 2.3.1 - - '@sindresorhus/merge-streams@2.3.0': {} - - '@tybys/wasm-util@0.9.0': - dependencies: - tslib: 2.6.3 - - '@types/node@20.14.2': - dependencies: - undici-types: 5.26.5 - - '@types/stylis@4.2.6': {} - - '@vercel/nft@0.26.5': - dependencies: - '@mapbox/node-pre-gyp': 1.0.11 - '@rollup/pluginutils': 4.2.1 - acorn: 8.12.0 - acorn-import-attributes: 1.9.5(acorn@8.12.0) - async-sema: 3.1.1 - bindings: 1.5.0 - estree-walker: 2.0.2 - glob: 7.2.3 - graceful-fs: 4.2.11 - micromatch: 4.0.7 - node-gyp-build: 4.8.1 - resolve-from: 5.0.0 - transitivePeerDependencies: - - encoding - - supports-color - - abbrev@1.1.1: {} - - acorn-import-attributes@1.9.5(acorn@8.12.0): - dependencies: - acorn: 8.12.0 - - acorn-walk@8.3.3: - dependencies: - acorn: 8.12.0 - - acorn@8.12.0: {} - - agent-base@6.0.2: - dependencies: - debug: 4.3.5 - transitivePeerDependencies: - - supports-color - - ansi-escapes@4.3.2: - dependencies: - type-fest: 0.21.3 - - ansi-regex@5.0.1: {} - - ansi-regex@6.0.1: {} - - ansi-styles@4.3.0: - dependencies: - color-convert: 2.0.1 - - ansi-styles@6.2.1: {} - - aproba@2.0.0: {} - - are-we-there-yet@2.0.0: - dependencies: - delegates: 1.0.0 - readable-stream: 3.6.2 - - argparse@1.0.10: - dependencies: - sprintf-js: 1.0.3 - - argparse@2.0.1: {} - - array-find-index@1.0.2: {} - - arrgv@1.0.2: {} - - arrify@3.0.0: {} - - async-sema@3.1.1: {} - - asynckit@0.4.0: {} - - ava@6.1.3: - dependencies: - '@vercel/nft': 0.26.5 - acorn: 8.12.0 - acorn-walk: 8.3.3 - ansi-styles: 6.2.1 - arrgv: 1.0.2 - arrify: 3.0.0 - callsites: 4.1.0 - cbor: 9.0.2 - chalk: 5.3.0 - chunkd: 2.0.1 - ci-info: 4.0.0 - ci-parallel-vars: 1.0.1 - cli-truncate: 4.0.0 - code-excerpt: 4.0.0 - common-path-prefix: 3.0.0 - concordance: 5.0.4 - currently-unhandled: 0.4.1 - debug: 4.3.5 - emittery: 1.0.3 - figures: 6.1.0 - globby: 14.0.1 - ignore-by-default: 2.1.0 - indent-string: 5.0.0 - is-plain-object: 5.0.0 - is-promise: 4.0.0 - matcher: 5.0.0 - memoize: 10.0.0 - ms: 2.1.3 - p-map: 7.0.2 - package-config: 5.0.0 - picomatch: 3.0.1 - plur: 5.1.0 - pretty-ms: 9.0.0 - resolve-cwd: 3.0.0 - stack-utils: 2.0.6 - strip-ansi: 7.1.0 - supertap: 3.0.1 - temp-dir: 3.0.0 - write-file-atomic: 5.0.1 - yargs: 17.7.2 - transitivePeerDependencies: - - encoding - - supports-color - - axios@1.6.2: - dependencies: - follow-redirects: 1.15.6 - form-data: 4.0.0 - proxy-from-env: 1.1.0 - transitivePeerDependencies: - - debug - - balanced-match@1.0.2: {} - - base64-js@1.5.1: {} - - before-after-hook@2.2.3: {} - - bindings@1.5.0: - dependencies: - file-uri-to-path: 1.0.0 - - bl@4.1.0: - dependencies: - buffer: 5.7.1 - inherits: 2.0.4 - readable-stream: 3.6.2 - - blueimp-md5@2.19.0: {} - - brace-expansion@1.1.11: - dependencies: - balanced-match: 1.0.2 - concat-map: 0.0.1 - - braces@3.0.3: - dependencies: - fill-range: 7.1.1 - - buffer@5.7.1: - dependencies: - base64-js: 1.5.1 - ieee754: 1.2.1 - - call-bind@1.0.7: - dependencies: - es-define-property: 1.0.0 - es-errors: 1.3.0 - function-bind: 1.1.2 - get-intrinsic: 1.2.4 - set-function-length: 1.2.2 - - callsites@4.1.0: {} - - camelize@1.0.1: {} - - cbor@9.0.2: - dependencies: - nofilter: 3.1.0 - - chalk@4.1.2: - dependencies: - ansi-styles: 4.3.0 - supports-color: 7.2.0 - - chalk@5.3.0: {} - - chardet@0.7.0: {} - - chownr@2.0.0: {} - - chunkd@2.0.1: {} - - ci-info@4.0.0: {} - - ci-parallel-vars@1.0.1: {} - - cli-cursor@3.1.0: - dependencies: - restore-cursor: 3.1.0 - - cli-spinners@2.9.2: {} - - cli-truncate@4.0.0: - dependencies: - slice-ansi: 5.0.0 - string-width: 7.1.0 - - cli-width@4.1.0: {} - - clipanion@3.2.1(typanion@3.14.0): - dependencies: - typanion: 3.14.0 - - cliui@8.0.1: - dependencies: - string-width: 4.2.3 - strip-ansi: 6.0.1 - wrap-ansi: 7.0.0 - - clone@1.0.4: {} - - code-excerpt@4.0.0: - dependencies: - convert-to-spaces: 2.0.1 - - color-convert@2.0.1: - dependencies: - color-name: 1.1.4 - - color-name@1.1.4: {} - - color-support@1.1.3: {} - - colorette@2.0.20: {} - - combined-stream@1.0.8: - dependencies: - delayed-stream: 1.0.0 - - common-path-prefix@3.0.0: {} - - concat-map@0.0.1: {} - - concordance@5.0.4: - dependencies: - date-time: 3.1.0 - esutils: 2.0.3 - fast-diff: 1.3.0 - js-string-escape: 1.0.1 - lodash: 4.17.21 - md5-hex: 3.0.1 - semver: 7.6.2 - well-known-symbols: 2.0.0 - - console-control-strings@1.1.0: {} - - convert-to-spaces@2.0.1: {} - - css-color-keywords@1.0.0: {} - - css-to-react-native@3.2.0: - dependencies: - camelize: 1.0.1 - css-color-keywords: 1.0.0 - postcss-value-parser: 4.2.0 - - csstype@3.1.3: {} - - currently-unhandled@0.4.1: - dependencies: - array-find-index: 1.0.2 - - date-time@3.1.0: - dependencies: - time-zone: 1.0.0 - - debug@4.3.5: - dependencies: - ms: 2.1.2 - - defaults@1.0.4: - dependencies: - clone: 1.0.4 - - define-data-property@1.1.4: - dependencies: - es-define-property: 1.0.0 - es-errors: 1.3.0 - gopd: 1.0.1 - - delayed-stream@1.0.0: {} - - delegates@1.0.0: {} - - deprecation@2.3.1: {} - - detect-libc@2.0.3: {} - - emittery@1.0.3: {} - - emnapi@1.2.0: {} - - emoji-regex@10.3.0: {} - - emoji-regex@8.0.0: {} - - es-define-property@1.0.0: - dependencies: - get-intrinsic: 1.2.4 - - es-errors@1.3.0: {} - - escalade@3.1.2: {} - - escape-string-regexp@2.0.0: {} - - escape-string-regexp@5.0.0: {} - - esprima@4.0.1: {} - - estree-walker@2.0.2: {} - - esutils@2.0.3: {} - - external-editor@3.1.0: - dependencies: - chardet: 0.7.0 - iconv-lite: 0.4.24 - tmp: 0.0.33 - - fast-diff@1.3.0: {} - - fast-glob@3.3.2: - dependencies: - '@nodelib/fs.stat': 2.0.5 - '@nodelib/fs.walk': 1.2.8 - glob-parent: 5.1.2 - merge2: 1.4.1 - micromatch: 4.0.7 - - fastq@1.17.1: - dependencies: - reusify: 1.0.4 - - figures@6.1.0: - dependencies: - is-unicode-supported: 2.0.0 - - file-uri-to-path@1.0.0: {} - - fill-range@7.1.1: - dependencies: - to-regex-range: 5.0.1 - - find-up-simple@1.0.0: {} - - follow-redirects@1.15.6: {} - - form-data@4.0.0: - dependencies: - asynckit: 0.4.0 - combined-stream: 1.0.8 - mime-types: 2.1.35 - - fs-minipass@2.1.0: - dependencies: - minipass: 3.3.6 - - fs.realpath@1.0.0: {} - - function-bind@1.1.2: {} - - gauge@3.0.2: - dependencies: - aproba: 2.0.0 - color-support: 1.1.3 - console-control-strings: 1.1.0 - has-unicode: 2.0.1 - object-assign: 4.1.1 - signal-exit: 3.0.7 - string-width: 4.2.3 - strip-ansi: 6.0.1 - wide-align: 1.1.5 - - get-caller-file@2.0.5: {} - - get-east-asian-width@1.2.0: {} - - get-intrinsic@1.2.4: - dependencies: - es-errors: 1.3.0 - function-bind: 1.1.2 - has-proto: 1.0.3 - has-symbols: 1.0.3 - hasown: 2.0.2 - - glob-parent@5.1.2: - dependencies: - is-glob: 4.0.3 - - glob@7.2.3: - dependencies: - fs.realpath: 1.0.0 - inflight: 1.0.6 - inherits: 2.0.4 - minimatch: 3.1.2 - once: 1.4.0 - path-is-absolute: 1.0.1 - - globby@14.0.1: - dependencies: - '@sindresorhus/merge-streams': 2.3.0 - fast-glob: 3.3.2 - ignore: 5.3.1 - path-type: 5.0.0 - slash: 5.1.0 - unicorn-magic: 0.1.0 - - gopd@1.0.1: - dependencies: - get-intrinsic: 1.2.4 - - graceful-fs@4.2.11: {} - - has-flag@4.0.0: {} - - has-property-descriptors@1.0.2: - dependencies: - es-define-property: 1.0.0 - - has-proto@1.0.3: {} - - has-symbols@1.0.3: {} - - has-unicode@2.0.1: {} - - hasown@2.0.2: - dependencies: - function-bind: 1.1.2 - - https-proxy-agent@5.0.1: - dependencies: - agent-base: 6.0.2 - debug: 4.3.5 - transitivePeerDependencies: - - supports-color - - iconv-lite@0.4.24: - dependencies: - safer-buffer: 2.1.2 - - ieee754@1.2.1: {} - - ignore-by-default@2.1.0: {} - - ignore@5.3.1: {} - - imurmurhash@0.1.4: {} - - indent-string@5.0.0: {} - - inflight@1.0.6: - dependencies: - once: 1.4.0 - wrappy: 1.0.2 - - inherits@2.0.4: {} - - inquirer@9.2.23: - dependencies: - '@inquirer/figures': 1.0.3 - '@ljharb/through': 2.3.13 - ansi-escapes: 4.3.2 - chalk: 5.3.0 - cli-cursor: 3.1.0 - cli-width: 4.1.0 - external-editor: 3.1.0 - lodash: 4.17.21 - mute-stream: 1.0.0 - ora: 5.4.1 - run-async: 3.0.0 - rxjs: 7.8.1 - string-width: 4.2.3 - strip-ansi: 6.0.1 - wrap-ansi: 6.2.0 - - irregular-plurals@3.5.0: {} - - is-extglob@2.1.1: {} - - is-fullwidth-code-point@3.0.0: {} - - is-fullwidth-code-point@4.0.0: {} - - is-glob@4.0.3: - dependencies: - is-extglob: 2.1.1 - - is-interactive@1.0.0: {} - - is-number@7.0.0: {} - - is-plain-object@5.0.0: {} - - is-promise@4.0.0: {} - - is-unicode-supported@0.1.0: {} - - is-unicode-supported@2.0.0: {} - - js-string-escape@1.0.1: {} - - js-tokens@4.0.0: {} - - js-yaml@3.14.1: - dependencies: - argparse: 1.0.10 - esprima: 4.0.1 - - js-yaml@4.1.0: - dependencies: - argparse: 2.0.1 - - load-json-file@7.0.1: {} - - lodash-es@4.17.21: {} - - lodash@4.17.21: {} - - log-symbols@4.1.0: - dependencies: - chalk: 4.1.2 - is-unicode-supported: 0.1.0 - - loose-envify@1.4.0: - dependencies: - js-tokens: 4.0.0 - - make-dir@3.1.0: - dependencies: - semver: 6.3.1 - - matcher@5.0.0: - dependencies: - escape-string-regexp: 5.0.0 - - md5-hex@3.0.1: - dependencies: - blueimp-md5: 2.19.0 - - memoize@10.0.0: - dependencies: - mimic-function: 5.0.1 - - merge2@1.4.1: {} - - micromatch@4.0.7: - dependencies: - braces: 3.0.3 - picomatch: 2.3.1 - - mime-db@1.52.0: {} - - mime-types@2.1.35: - dependencies: - mime-db: 1.52.0 - - mimic-fn@2.1.0: {} - - mimic-function@5.0.1: {} - - minimatch@3.1.2: - dependencies: - brace-expansion: 1.1.11 - - minipass@3.3.6: - dependencies: - yallist: 4.0.0 - - minipass@5.0.0: {} - - minizlib@2.1.2: - dependencies: - minipass: 3.3.6 - yallist: 4.0.0 - - mkdirp@1.0.4: {} - - ms@2.1.2: {} - - ms@2.1.3: {} - - mute-stream@1.0.0: {} - - nanoid@3.3.7: {} - - node-fetch@2.7.0: - dependencies: - whatwg-url: 5.0.0 - - node-gyp-build@4.8.1: {} - - nofilter@3.1.0: {} - - nopt@5.0.0: - dependencies: - abbrev: 1.1.1 - - npmlog@5.0.1: - dependencies: - are-we-there-yet: 2.0.0 - console-control-strings: 1.1.0 - gauge: 3.0.2 - set-blocking: 2.0.0 - - object-assign@4.1.1: {} - - once@1.4.0: - dependencies: - wrappy: 1.0.2 - - onetime@5.1.2: - dependencies: - mimic-fn: 2.1.0 - - ora@5.4.1: - dependencies: - bl: 4.1.0 - chalk: 4.1.2 - cli-cursor: 3.1.0 - cli-spinners: 2.9.2 - is-interactive: 1.0.0 - is-unicode-supported: 0.1.0 - log-symbols: 4.1.0 - strip-ansi: 6.0.1 - wcwidth: 1.0.1 - - os-tmpdir@1.0.2: {} - - p-map@7.0.2: {} - - package-config@5.0.0: - dependencies: - find-up-simple: 1.0.0 - load-json-file: 7.0.1 - - parse-ms@4.0.0: {} - - path-is-absolute@1.0.1: {} - - path-type@5.0.0: {} - - picocolors@1.0.1: {} - - picomatch@2.3.1: {} - - picomatch@3.0.1: {} - - plur@5.1.0: - dependencies: - irregular-plurals: 3.5.0 - - postcss-value-parser@4.2.0: {} - - postcss@8.4.33: - dependencies: - nanoid: 3.3.7 - picocolors: 1.0.1 - source-map-js: 1.2.0 - - pretty-ms@9.0.0: - dependencies: - parse-ms: 4.0.0 - - proxy-from-env@1.1.0: {} - - queue-microtask@1.2.3: {} - - react-dom@18.3.1(react@18.3.1): - dependencies: - loose-envify: 1.4.0 - react: 18.3.1 - scheduler: 0.23.2 - - react@18.3.1: - dependencies: - loose-envify: 1.4.0 - - readable-stream@3.6.2: - dependencies: - inherits: 2.0.4 - string_decoder: 1.3.0 - util-deprecate: 1.0.2 - - require-directory@2.1.1: {} - - resolve-cwd@3.0.0: - dependencies: - resolve-from: 5.0.0 - - resolve-from@5.0.0: {} - - restore-cursor@3.1.0: - dependencies: - onetime: 5.1.2 - signal-exit: 3.0.7 - - reusify@1.0.4: {} - - rimraf@3.0.2: - dependencies: - glob: 7.2.3 - - run-async@3.0.0: {} - - run-parallel@1.2.0: - dependencies: - queue-microtask: 1.2.3 - - rxjs@7.8.1: - dependencies: - tslib: 2.6.3 - - safe-buffer@5.2.1: {} - - safer-buffer@2.1.2: {} - - scheduler@0.23.2: - dependencies: - loose-envify: 1.4.0 - - semver@6.3.1: {} - - semver@7.6.2: {} - - serialize-error@7.0.1: - dependencies: - type-fest: 0.13.1 - - set-blocking@2.0.0: {} - - set-function-length@1.2.2: - 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 - - shallowequal@1.1.0: {} - - signal-exit@3.0.7: {} - - signal-exit@4.1.0: {} - - slash@5.1.0: {} - - slice-ansi@5.0.0: - dependencies: - ansi-styles: 6.2.1 - is-fullwidth-code-point: 4.0.0 - - source-map-js@1.2.0: {} - - sprintf-js@1.0.3: {} - - stack-utils@2.0.6: - dependencies: - escape-string-regexp: 2.0.0 - - string-width@4.2.3: - dependencies: - emoji-regex: 8.0.0 - is-fullwidth-code-point: 3.0.0 - strip-ansi: 6.0.1 - - string-width@7.1.0: - dependencies: - emoji-regex: 10.3.0 - get-east-asian-width: 1.2.0 - strip-ansi: 7.1.0 - - string_decoder@1.3.0: - dependencies: - safe-buffer: 5.2.1 - - strip-ansi@6.0.1: - dependencies: - ansi-regex: 5.0.1 - - strip-ansi@7.1.0: - dependencies: - ansi-regex: 6.0.1 - - styled-components@6.1.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1): - dependencies: - '@emotion/is-prop-valid': 1.2.2 - '@emotion/unitless': 0.8.1 - '@types/stylis': 4.2.6 - css-to-react-native: 3.2.0 - csstype: 3.1.3 - postcss: 8.4.33 - react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) - shallowequal: 1.1.0 - stylis: 4.3.2 - tslib: 2.6.3 - - stylis@4.3.2: {} - - supertap@3.0.1: - dependencies: - indent-string: 5.0.0 - js-yaml: 3.14.1 - serialize-error: 7.0.1 - strip-ansi: 7.1.0 - - supports-color@7.2.0: - dependencies: - has-flag: 4.0.0 - - tar@6.2.1: - dependencies: - chownr: 2.0.0 - fs-minipass: 2.1.0 - minipass: 5.0.0 - minizlib: 2.1.2 - mkdirp: 1.0.4 - yallist: 4.0.0 - - temp-dir@3.0.0: {} - - time-zone@1.0.0: {} - - tmp@0.0.33: - dependencies: - os-tmpdir: 1.0.2 - - to-regex-range@5.0.1: - dependencies: - is-number: 7.0.0 - - toml@3.0.0: {} - - tr46@0.0.3: {} - - tslib@2.6.3: {} - - typanion@3.14.0: {} - - type-fest@0.13.1: {} - - type-fest@0.21.3: {} - - typescript@5.4.5: {} - - undici-types@5.26.5: {} - - unicorn-magic@0.1.0: {} - - universal-user-agent@6.0.1: {} - - util-deprecate@1.0.2: {} - - wasm-sjlj@1.0.5: {} - - wcwidth@1.0.1: - dependencies: - defaults: 1.0.4 - - webidl-conversions@3.0.1: {} - - well-known-symbols@2.0.0: {} - - whatwg-url@5.0.0: - dependencies: - tr46: 0.0.3 - webidl-conversions: 3.0.1 - - wide-align@1.1.5: - dependencies: - string-width: 4.2.3 - - wrap-ansi@6.2.0: - dependencies: - ansi-styles: 4.3.0 - string-width: 4.2.3 - strip-ansi: 6.0.1 - - wrap-ansi@7.0.0: - dependencies: - ansi-styles: 4.3.0 - string-width: 4.2.3 - strip-ansi: 6.0.1 - - wrappy@1.0.2: {} - - write-file-atomic@5.0.1: - dependencies: - imurmurhash: 0.1.4 - signal-exit: 4.1.0 - - y18n@5.0.8: {} - - yallist@4.0.0: {} - - yargs-parser@21.1.1: {} - - yargs@17.7.2: - dependencies: - cliui: 8.0.1 - escalade: 3.1.2 - get-caller-file: 2.0.5 - require-directory: 2.1.1 - string-width: 4.2.3 - y18n: 5.0.8 - yargs-parser: 21.1.1 diff --git a/src/builtins.rs b/src/builtins.rs deleted file mode 100644 index 45a25117..00000000 --- a/src/builtins.rs +++ /dev/null @@ -1,71 +0,0 @@ -/// Node.js built-in modules -/// -/// `node -p "[...require('module').builtinModules].map(b => JSON.stringify(b)).join(',\n')"` -/// -pub const NODEJS_BUILTINS: &[&str] = &[ - "_http_agent", - "_http_client", - "_http_common", - "_http_incoming", - "_http_outgoing", - "_http_server", - "_stream_duplex", - "_stream_passthrough", - "_stream_readable", - "_stream_transform", - "_stream_wrap", - "_stream_writable", - "_tls_common", - "_tls_wrap", - "assert", - "assert/strict", - "async_hooks", - "buffer", - "child_process", - "cluster", - "console", - "constants", - "crypto", - "dgram", - "diagnostics_channel", - "dns", - "dns/promises", - "domain", - "events", - "fs", - "fs/promises", - "http", - "http2", - "https", - "inspector", - "module", - "net", - "os", - "path", - "path/posix", - "path/win32", - "perf_hooks", - "process", - "punycode", - "querystring", - "readline", - "repl", - "stream", - "stream/consumers", - "stream/promises", - "stream/web", - "string_decoder", - "sys", - "timers", - "timers/promises", - "tls", - "trace_events", - "tty", - "url", - "util", - "util/types", - "v8", - "vm", - "worker_threads", - "zlib", -]; diff --git a/src/cache.rs b/src/cache.rs deleted file mode 100644 index a1bde36c..00000000 --- a/src/cache.rs +++ /dev/null @@ -1,369 +0,0 @@ -use once_cell::sync::OnceCell as OnceLock; -use std::{ - borrow::{Borrow, Cow}, - convert::AsRef, - hash::{BuildHasherDefault, Hash, Hasher}, - io, - ops::Deref, - path::{Path, PathBuf}, - sync::Arc, -}; - -use dashmap::{DashMap, DashSet}; -use rustc_hash::FxHasher; - -use crate::{ - context::ResolveContext as Ctx, package_json::PackageJson, path::PathUtil, FileMetadata, - FileSystem, ResolveError, ResolveOptions, TsConfig, -}; - -#[derive(Default)] -pub struct Cache { - pub(crate) fs: Fs, - paths: DashSet>, - tsconfigs: DashMap, BuildHasherDefault>, -} - -impl Cache { - pub fn new(fs: Fs) -> Self { - Self { fs, paths: DashSet::default(), tsconfigs: DashMap::default() } - } - - pub fn clear(&self) { - self.paths.clear(); - self.tsconfigs.clear(); - } - - pub fn value(&self, path: &Path) -> CachedPath { - let hash = { - let mut hasher = FxHasher::default(); - path.hash(&mut hasher); - hasher.finish() - }; - if let Some(cache_entry) = self.paths.get((hash, path).borrow() as &dyn CacheKey) { - return cache_entry.clone(); - } - let parent = path.parent().map(|p| self.value(p)); - let data = CachedPath(Arc::new(CachedPathImpl::new( - hash, - path.to_path_buf().into_boxed_path(), - parent, - ))); - self.paths.insert(data.clone()); - data - } - - pub fn tsconfig Result<(), ResolveError>>( - &self, - root: bool, - path: &Path, - callback: F, // callback for modifying tsconfig with `extends` - ) -> Result, ResolveError> { - if let Some(tsconfig_ref) = self.tsconfigs.get(path) { - return Ok(Arc::clone(tsconfig_ref.value())); - } - let meta = self.fs.metadata(path).ok(); - let tsconfig_path = if meta.is_some_and(|m| m.is_file) { - Cow::Borrowed(path) - } else if meta.is_some_and(|m| m.is_dir) { - Cow::Owned(path.join("tsconfig.json")) - } else { - let mut os_string = path.to_path_buf().into_os_string(); - os_string.push(".json"); - Cow::Owned(PathBuf::from(os_string)) - }; - let mut tsconfig_string = self - .fs - .read_to_string(&tsconfig_path) - .map_err(|_| ResolveError::TsconfigNotFound(path.to_path_buf()))?; - let mut tsconfig = - TsConfig::parse(root, &tsconfig_path, &mut tsconfig_string).map_err(|error| { - ResolveError::from_serde_json_error(tsconfig_path.to_path_buf(), &error) - })?; - callback(&mut tsconfig)?; - let tsconfig = Arc::new(tsconfig.build()); - self.tsconfigs.insert(path.to_path_buf(), Arc::clone(&tsconfig)); - Ok(tsconfig) - } -} - -#[derive(Clone)] -pub struct CachedPath(Arc); - -impl Hash for CachedPath { - fn hash(&self, state: &mut H) { - self.0.hash.hash(state); - } -} - -impl PartialEq for CachedPath { - fn eq(&self, other: &Self) -> bool { - self.0.path == other.0.path - } -} -impl Eq for CachedPath {} - -impl Deref for CachedPath { - type Target = CachedPathImpl; - - fn deref(&self) -> &Self::Target { - self.0.as_ref() - } -} - -impl<'a> Borrow for CachedPath { - fn borrow(&self) -> &(dyn CacheKey + 'a) { - self - } -} - -impl AsRef for CachedPath { - fn as_ref(&self) -> &CachedPathImpl { - self.0.as_ref() - } -} - -impl CacheKey for CachedPath { - fn tuple(&self) -> (u64, &Path) { - (self.hash, &self.path) - } -} - -pub struct CachedPathImpl { - hash: u64, - path: Box, - parent: Option, - meta: OnceLock>, - symlink: OnceLock>, - canonicalized: OnceLock>, - node_modules: OnceLock>, - package_json: OnceLock>>, -} - -impl CachedPathImpl { - fn new(hash: u64, path: Box, parent: Option) -> Self { - Self { - hash, - path, - parent, - meta: OnceLock::new(), - symlink: OnceLock::new(), - canonicalized: OnceLock::new(), - node_modules: OnceLock::new(), - package_json: OnceLock::new(), - } - } - - pub fn path(&self) -> &Path { - &self.path - } - - pub fn to_path_buf(&self) -> PathBuf { - self.path.to_path_buf() - } - - pub fn parent(&self) -> Option<&CachedPath> { - self.parent.as_ref() - } - - fn meta(&self, fs: &Fs) -> Option { - *self.meta.get_or_init(|| fs.metadata(&self.path).ok()) - } - - pub fn is_file(&self, fs: &Fs, ctx: &mut Ctx) -> bool { - if let Some(meta) = self.meta(fs) { - ctx.add_file_dependency(self.path()); - meta.is_file - } else { - ctx.add_missing_dependency(self.path()); - false - } - } - - pub fn is_dir(&self, fs: &Fs, ctx: &mut Ctx) -> bool { - self.meta(fs).map_or_else( - || { - ctx.add_missing_dependency(self.path()); - false - }, - |meta| meta.is_dir, - ) - } - - fn symlink(&self, fs: &Fs) -> io::Result> { - self.symlink - .get_or_try_init(|| { - if let Ok(symlink_metadata) = fs.symlink_metadata(&self.path) { - if symlink_metadata.is_symlink { - return fs.canonicalize(self.path()).map(Some); - } - } - Ok(None) - }) - .cloned() - } - - pub fn realpath(&self, fs: &Fs) -> io::Result { - self.canonicalized - .get_or_try_init(|| { - if let Some(link) = self.symlink(fs)? { - return Ok(Some(link)); - } - if let Some(parent) = self.parent() { - let parent_path = parent.realpath(fs)?; - return Ok(Some( - parent_path.normalize_with(self.path.strip_prefix(&parent.path).unwrap()), - )); - }; - Ok(None) - }) - .cloned() - .map(|r| r.unwrap_or_else(|| self.path.clone().to_path_buf())) - } - - pub fn module_directory( - &self, - module_name: &str, - cache: &Cache, - ctx: &mut Ctx, - ) -> Option { - let cached_path = cache.value(&self.path.join(module_name)); - cached_path.is_dir(&cache.fs, ctx).then_some(cached_path) - } - - pub fn cached_node_modules( - &self, - cache: &Cache, - ctx: &mut Ctx, - ) -> Option { - self.node_modules.get_or_init(|| self.module_directory("node_modules", cache, ctx)).clone() - } - - /// Find package.json of a path by traversing parent directories. - /// - /// # Errors - /// - /// * [ResolveError::JSON] - pub fn find_package_json( - &self, - fs: &Fs, - options: &ResolveOptions, - ctx: &mut Ctx, - ) -> Result>, ResolveError> { - let mut cache_value = self; - // Go up directories when the querying path is not a directory - while !cache_value.is_dir(fs, ctx) { - if let Some(cv) = &cache_value.parent { - cache_value = cv.as_ref(); - } else { - break; - } - } - let mut cache_value = Some(cache_value); - while let Some(cv) = cache_value { - if let Some(package_json) = cv.package_json(fs, options, ctx)? { - return Ok(Some(Arc::clone(&package_json))); - } - cache_value = cv.parent.as_deref(); - } - Ok(None) - } - - /// Get package.json of the given path. - /// - /// # Errors - /// - /// * [ResolveError::JSON] - pub fn package_json( - &self, - fs: &Fs, - options: &ResolveOptions, - ctx: &mut Ctx, - ) -> Result>, ResolveError> { - // Change to `std::sync::OnceLock::get_or_try_init` when it is stable. - let result = self - .package_json - .get_or_try_init(|| { - let package_json_path = self.path.join("package.json"); - let Ok(package_json_string) = fs.read_to_string(&package_json_path) else { - return Ok(None); - }; - let real_path = if options.symlinks { - self.realpath(fs)?.join("package.json") - } else { - package_json_path.clone() - }; - PackageJson::parse(package_json_path.clone(), real_path, &package_json_string) - .map(Arc::new) - .map(Some) - .map_err(|error| ResolveError::from_serde_json_error(package_json_path, &error)) - }) - .cloned(); - // https://github.com/webpack/enhanced-resolve/blob/58464fc7cb56673c9aa849e68e6300239601e615/lib/DescriptionFileUtils.js#L68-L82 - match &result { - Ok(Some(package_json)) => { - ctx.add_file_dependency(&package_json.path); - } - Ok(None) => { - // Avoid an allocation by making this lazy - if let Some(deps) = &mut ctx.missing_dependencies { - deps.push(self.path.join("package.json")); - } - } - Err(_) => { - if let Some(deps) = &mut ctx.file_dependencies { - deps.push(self.path.join("package.json")); - } - } - } - result - } -} - -/// Memoized cache key, code adapted from . -trait CacheKey { - fn tuple(&self) -> (u64, &Path); -} - -impl Hash for dyn CacheKey + '_ { - fn hash(&self, state: &mut H) { - self.tuple().0.hash(state); - } -} - -impl PartialEq for dyn CacheKey + '_ { - fn eq(&self, other: &Self) -> bool { - self.tuple().1 == other.tuple().1 - } -} - -impl Eq for dyn CacheKey + '_ {} - -impl<'a> CacheKey for (u64, &'a Path) { - fn tuple(&self) -> (u64, &Path) { - (self.0, self.1) - } -} - -impl<'a> Borrow for (u64, &'a Path) { - fn borrow(&self) -> &(dyn CacheKey + 'a) { - self - } -} - -/// Since the cache key is memoized, use an identity hasher -/// to avoid double cache. -#[derive(Default)] -struct IdentityHasher(u64); - -impl Hasher for IdentityHasher { - fn write(&mut self, _: &[u8]) { - unreachable!("Invalid use of IdentityHasher") - } - fn write_u64(&mut self, n: u64) { - self.0 = n; - } - fn finish(&self) -> u64 { - self.0 - } -} diff --git a/src/context.rs b/src/context.rs deleted file mode 100644 index 9349de30..00000000 --- a/src/context.rs +++ /dev/null @@ -1,89 +0,0 @@ -use std::{ - ops::{Deref, DerefMut}, - path::{Path, PathBuf}, -}; - -use crate::error::ResolveError; - -#[derive(Debug, Default, Clone)] -pub struct ResolveContext(ResolveContextImpl); - -#[derive(Debug, Default, Clone)] -pub struct ResolveContextImpl { - pub fully_specified: bool, - - pub query: Option, - - pub fragment: Option, - - /// Files that was found on file system - pub file_dependencies: Option>, - - /// Files that was found on file system - pub missing_dependencies: Option>, - - /// The current resolving alias for bailing recursion alias. - pub resolving_alias: Option, - - /// For avoiding infinite recursion, which will cause stack overflow. - depth: u8, -} - -impl Deref for ResolveContext { - type Target = ResolveContextImpl; - - fn deref(&self) -> &Self::Target { - &self.0 - } -} - -impl DerefMut for ResolveContext { - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} - -impl ResolveContext { - pub fn with_fully_specified(&mut self, yes: bool) { - self.fully_specified = yes; - } - - pub fn with_query_fragment(&mut self, query: Option<&str>, fragment: Option<&str>) { - if let Some(query) = query { - self.query.replace(query.to_string()); - } - if let Some(fragment) = fragment { - self.fragment.replace(fragment.to_string()); - } - } - - pub fn init_file_dependencies(&mut self) { - self.file_dependencies.replace(vec![]); - self.missing_dependencies.replace(vec![]); - } - - pub fn add_file_dependency(&mut self, dep: &Path) { - if let Some(deps) = &mut self.file_dependencies { - deps.push(dep.to_path_buf()); - } - } - - pub fn add_missing_dependency(&mut self, dep: &Path) { - if let Some(deps) = &mut self.missing_dependencies { - deps.push(dep.to_path_buf()); - } - } - - pub fn with_resolving_alias(&mut self, alias: String) { - self.resolving_alias = Some(alias); - } - - pub fn test_for_infinite_recursion(&mut self) -> Result<(), ResolveError> { - self.depth += 1; - // 64 should be more than enough for detecting infinite recursion. - if self.depth > 64 { - return Err(ResolveError::Recursion); - } - Ok(()) - } -} diff --git a/src/error.rs b/src/error.rs deleted file mode 100644 index ff2aaa4f..00000000 --- a/src/error.rs +++ /dev/null @@ -1,160 +0,0 @@ -use std::{io, path::PathBuf, sync::Arc}; -use thiserror::Error; - -/// All resolution errors -/// -/// `thiserror` is used to display meaningful error messages. -#[derive(Debug, Clone, PartialEq, Error)] -pub enum ResolveError { - /// Ignored path - /// - /// Derived from ignored path (false value) from browser field in package.json - /// ```json - /// { - /// "browser": { - /// "./module": false - /// } - /// } - /// ``` - /// See - #[error("Path is ignored {0}")] - Ignored(PathBuf), - - /// Module not found - #[error("Cannot find module '{0}'")] - NotFound(/* specifier */ String), - - /// Tsconfig not found - #[error("Tsconfig not found {0}")] - TsconfigNotFound(PathBuf), - - #[error("{0}")] - IOError(IOError), - - /// Node.js builtin modules - /// - /// This is an error due to not being a Node.js runtime. - /// The `alias` option can be used to resolve a builtin module to a polyfill. - #[error("Builtin module {0}")] - Builtin(String), - - /// All of the aliased extension are not found - #[error("All of the aliased extension are not found")] - ExtensionAlias, - - /// The provided path specifier cannot be parsed - #[error("{0}")] - Specifier(SpecifierError), - - /// JSON parse error - #[error("{0:?}")] - JSON(JSONError), - - /// Restricted by `ResolveOptions::restrictions` - #[error(r#"Path "{0}" restricted by {0}"#)] - Restriction(PathBuf, PathBuf), - - #[error(r#"Invalid module "{0}" specifier is not a valid subpath for the "exports" resolution of {1}"#)] - InvalidModuleSpecifier(String, PathBuf), - - #[error(r#"Invalid "exports" target "{0}" defined for '{1}' in the package config {2}"#)] - InvalidPackageTarget(String, String, PathBuf), - - #[error(r#"Package subpath '{0}' is not defined by "exports" in {1}"#)] - PackagePathNotExported(String, PathBuf), - - #[error(r#"Invalid package config "{0}", "exports" cannot contain some keys starting with '.' and some not. The exports object must either be an object of package subpath keys or an object of main entry condition name keys only."#)] - InvalidPackageConfig(PathBuf), - - #[error(r#"Default condition should be last one in "{0}""#)] - InvalidPackageConfigDefault(PathBuf), - - #[error(r#"Expecting folder to folder mapping. "{0}" should end with "/"#)] - InvalidPackageConfigDirectory(PathBuf), - - #[error(r#"Package import specifier "{0}" is not defined in package {1}"#)] - PackageImportNotDefined(String, PathBuf), - - #[error("{0} is unimplemented")] - Unimplemented(&'static str), - - /// Occurs when alias paths reference each other. - #[error("Recursion in resolving")] - Recursion, -} - -impl ResolveError { - pub fn is_ignore(&self) -> bool { - matches!(self, Self::Ignored(_)) - } - - pub(crate) fn from_serde_json_error(path: PathBuf, error: &serde_json::Error) -> Self { - Self::JSON(JSONError { - path, - message: error.to_string(), - line: error.line(), - column: error.column(), - }) - } -} - -/// Error for [ResolveError::Specifier] -#[derive(Debug, Clone, Eq, PartialEq, Error)] -pub enum SpecifierError { - #[error("The specifiers must be a non-empty string. Received \"{0}\"")] - Empty(String), -} - -/// JSON error from [serde_json::Error] -#[derive(Debug, Clone, Eq, PartialEq)] -pub struct JSONError { - pub path: PathBuf, - pub message: String, - pub line: usize, - pub column: usize, -} - -#[derive(Debug, Clone, Error)] -#[error("{0}")] -pub struct IOError(Arc); - -impl PartialEq for IOError { - fn eq(&self, other: &Self) -> bool { - self.0.kind() == other.0.kind() - } -} - -impl From for io::Error { - fn from(error: IOError) -> Self { - let io_error = error.0.as_ref(); - Self::new(io_error.kind(), io_error.to_string()) - } -} - -impl From for ResolveError { - fn from(err: io::Error) -> Self { - Self::IOError(IOError(Arc::new(err))) - } -} - -#[test] -fn test_into_io_error() { - use std::io::{self, ErrorKind}; - let error_string = "IOError occurred"; - let string_error = io::Error::new(ErrorKind::Interrupted, error_string.to_string()); - let string_error2 = io::Error::new(ErrorKind::Interrupted, error_string.to_string()); - let resolve_io_error: ResolveError = ResolveError::from(string_error2); - - assert_eq!(resolve_io_error, ResolveError::from(string_error)); - assert_eq!(resolve_io_error.clone(), resolve_io_error); - if let ResolveError::IOError(io_error) = resolve_io_error { - // fix for https://github.com/web-infra-dev/rspack/issues/4564 - let std_io_error: io::Error = io_error.into(); - assert_eq!(std_io_error.kind(), ErrorKind::Interrupted); - assert_eq!(std_io_error.to_string(), error_string); - assert_eq!( - format!("{std_io_error:?}"), - r#"Custom { kind: Interrupted, error: "IOError occurred" }"# - ); - } -} diff --git a/src/file_system.rs b/src/file_system.rs deleted file mode 100644 index 04d177de..00000000 --- a/src/file_system.rs +++ /dev/null @@ -1,133 +0,0 @@ -use std::{ - fs, io, - path::{Path, PathBuf}, -}; - -/// File System abstraction used for `ResolverGeneric` -pub trait FileSystem: Send + Sync { - /// See [std::fs::read_to_string] - /// - /// # Errors - /// - /// * See [std::fs::read_to_string] - /// ## Warning - /// Use `&Path` instead of a generic `P: AsRef` here, - /// because object safety requirements, it is especially useful, when - /// you want to store multiple `dyn FileSystem` in a `Vec` or use a `ResolverGeneric` in - /// napi env. - fn read_to_string(&self, path: &Path) -> io::Result; - - /// See [std::fs::metadata] - /// - /// # Errors - /// See [std::fs::metadata] - /// ## Warning - /// Use `&Path` instead of a generic `P: AsRef` here, - /// because object safety requirements, it is especially useful, when - /// you want to store multiple `dyn FileSystem` in a `Vec` or use a `ResolverGeneric` in - /// napi env. - fn metadata(&self, path: &Path) -> io::Result; - - /// See [std::fs::symlink_metadata] - /// - /// # Errors - /// - /// See [std::fs::symlink_metadata] - /// ## Warning - /// Use `&Path` instead of a generic `P: AsRef` here, - /// because object safety requirements, it is especially useful, when - /// you want to store multiple `dyn FileSystem` in a `Vec` or use a `ResolverGeneric` in - /// napi env. - fn symlink_metadata(&self, path: &Path) -> io::Result; - - /// See [std::fs::canonicalize] - /// - /// # Errors - /// - /// See [std::fs::read_link] - /// ## Warning - /// Use `&Path` instead of a generic `P: AsRef` here, - /// because object safety requirements, it is especially useful, when - /// you want to store multiple `dyn FileSystem` in a `Vec` or use a `ResolverGeneric` in - /// napi env. - fn canonicalize(&self, path: &Path) -> io::Result; -} - -/// Metadata information about a file -#[derive(Debug, Clone, Copy)] -pub struct FileMetadata { - pub(crate) is_file: bool, - pub(crate) is_dir: bool, - pub(crate) is_symlink: bool, -} - -impl FileMetadata { - pub fn new(is_file: bool, is_dir: bool, is_symlink: bool) -> Self { - Self { is_file, is_dir, is_symlink } - } -} - -impl From for FileMetadata { - fn from(metadata: fs::Metadata) -> Self { - Self::new(metadata.is_file(), metadata.is_dir(), metadata.is_symlink()) - } -} - -/// Operating System -#[derive(Default)] -pub struct FileSystemOs; - -impl FileSystem for FileSystemOs { - fn read_to_string(&self, path: &Path) -> io::Result { - fs::read_to_string(path) - } - - fn metadata(&self, path: &Path) -> io::Result { - fs::metadata(path).map(FileMetadata::from) - } - - fn symlink_metadata(&self, path: &Path) -> io::Result { - fs::symlink_metadata(path).map(FileMetadata::from) - } - - fn canonicalize(&self, path: &Path) -> io::Result { - #[cfg(not(target_os = "wasi"))] - { - dunce::canonicalize(path) - } - #[cfg(target_os = "wasi")] - { - let meta = fs::symlink_metadata(path)?; - if meta.file_type().is_symlink() { - let link = fs::read_link(path)?; - let mut path_buf = path.to_path_buf(); - path_buf.pop(); - for segment in link.iter() { - match segment.to_str() { - Some("..") => { - path_buf.pop(); - } - Some(".") | None => {} - Some(seg) => { - // Need to trim the extra \0 introduces by rust std rust-lang/rust#123727 - path_buf.push(seg.trim_end_matches('\0')); - } - } - } - Ok(path_buf) - } else { - Ok(path.to_path_buf()) - } - } - } -} - -#[test] -fn metadata() { - let meta = FileMetadata { is_file: true, is_dir: true, is_symlink: true }; - assert_eq!( - format!("{meta:?}"), - "FileMetadata { is_file: true, is_dir: true, is_symlink: true }" - ); - let _ = meta; -} diff --git a/src/lib.rs b/src/lib.rs deleted file mode 100644 index 8ec2ad8a..00000000 --- a/src/lib.rs +++ /dev/null @@ -1,1670 +0,0 @@ -//! # Oxc Resolver -//! -//! Node.js [CommonJS][cjs] and [ECMAScript][esm] Module Resolution. -//! -//! A module resolution is the process of finding the file referenced by a module specifier in -//! `import "specifier"` or `require("specifier")`. -//! -//! All [configuration options](ResolveOptions) are aligned with webpack's [enhanced-resolve]. -//! -//! ## Terminology -//! -//! ### Specifier -//! -//! For [CommonJS modules][cjs], -//! the specifier is the string passed to the `require` function. e.g. `"id"` in `require("id")`. -//! -//! For [ECMAScript modules][esm], -//! the specifier of an `import` statement is the string after the `from` keyword, -//! e.g. `'specifier'` in `import 'specifier'` or `import { sep } from 'specifier'`. -//! Specifiers are also used in export from statements, and as the argument to an `import()` expression. -//! -//! This is also named "request" in some places. -//! -//! ## References: -//! -//! * Algorithm adapted from Node.js [CommonJS Module Resolution Algorithm] and [ECMAScript Module Resolution Algorithm]. -//! * Tests are ported from [enhanced-resolve]. -//! * Some code is adapted from [parcel-resolver]. -//! * The documentation is copied from [webpack's resolve configuration](https://webpack.js.org/configuration/resolve). -//! -//! [enhanced-resolve]: https://github.com/webpack/enhanced-resolve -//! [CommonJS Module Resolution Algorithm]: https://nodejs.org/api/modules.html#all-together -//! [ECMAScript Module Resolution Algorithm]: https://nodejs.org/api/esm.html#resolution-algorithm-specification -//! [parcel-resolver]: https://github.com/parcel-bundler/parcel/blob/v2/packages/utils/node-resolver-rs -//! [cjs]: https://nodejs.org/api/modules.html -//! [esm]: https://nodejs.org/api/esm.html -//! -//! ## Feature flags -#![cfg_attr(feature = "document-features", doc = document_features::document_features!())] -#![cfg_attr(docsrs, feature(doc_auto_cfg))] -//! -//! ## Example -//! -//! ```rust,ignore -#![doc = include_str!("../examples/resolver.rs")] -//! ``` - -mod builtins; -mod cache; -mod context; -mod error; -mod file_system; -mod options; -mod package_json; -mod path; -mod resolution; -mod specifier; -mod tsconfig; - -#[cfg(test)] -mod tests; - -use std::{ - borrow::Cow, - cmp::Ordering, - ffi::OsStr, - fmt, - path::{Component, Path, PathBuf}, - sync::Arc, -}; - -use rustc_hash::FxHashSet; -use serde_json::Value as JSONValue; -use typescript_tsconfig_json::ExtendsField; - -pub use crate::{ - builtins::NODEJS_BUILTINS, - error::{JSONError, ResolveError, SpecifierError}, - file_system::{FileMetadata, FileSystem}, - options::{ - Alias, AliasValue, EnforceExtension, ResolveOptions, Restriction, TsconfigOptions, - TsconfigReferences, - }, - package_json::PackageJson, - resolution::Resolution, -}; -use crate::{ - cache::{Cache, CachedPath}, - context::ResolveContext as Ctx, - file_system::FileSystemOs, - package_json::JSONMap, - path::{PathUtil, SLASH_START}, - specifier::Specifier, - tsconfig::{ProjectReference, TsConfig}, -}; - -type ResolveResult = Result, ResolveError>; - -/// Context returned from the [Resolver::resolve_with_context] API -#[derive(Debug, Default, Clone)] -pub struct ResolveContext { - /// Files that was found on file system - pub file_dependencies: FxHashSet, - - /// Dependencies that was not found on file system - pub missing_dependencies: FxHashSet, -} - -/// Resolver with the current operating system as the file system -pub type Resolver = ResolverGeneric; - -/// Generic implementation of the resolver, can be configured by the [FileSystem] trait -pub struct ResolverGeneric { - options: ResolveOptions, - cache: Arc>, -} - -impl fmt::Debug for ResolverGeneric { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - self.options.fmt(f) - } -} - -impl Default for ResolverGeneric { - fn default() -> Self { - Self::new(ResolveOptions::default()) - } -} - -impl ResolverGeneric { - pub fn new(options: ResolveOptions) -> Self { - Self { options: options.sanitize(), cache: Arc::new(Cache::new(Fs::default())) } - } -} - -impl ResolverGeneric { - pub fn new_with_file_system(file_system: Fs, options: ResolveOptions) -> Self { - Self { cache: Arc::new(Cache::new(file_system)), options: options.sanitize() } - } - - /// Clone the resolver using the same underlying cache. - #[must_use] - pub fn clone_with_options(&self, options: ResolveOptions) -> Self { - Self { options: options.sanitize(), cache: Arc::clone(&self.cache) } - } - - /// Returns the options. - pub fn options(&self) -> &ResolveOptions { - &self.options - } - - /// Clear the underlying cache. - pub fn clear_cache(&self) { - self.cache.clear(); - } - - /// Resolve `specifier` at an absolute `path`. - /// - /// A specifier is the string passed to require or import, i.e. `require("specifier")` or `import "specifier"`. - /// - /// `path` must be an **absolute** path to a directory where the specifier is resolved against. - /// For CommonJS modules, it is the `__dirname` variable that contains the absolute path to the folder containing current module. - /// For ECMAScript modules, it is the value of `import.meta.url`. - /// - /// # Errors - /// - /// * See [ResolveError] - pub fn resolve>( - &self, - path: P, - specifier: &str, - ) -> Result { - let mut ctx = Ctx::default(); - self.resolve_tracing(path.as_ref(), specifier, &mut ctx) - } - - /// Resolve `specifier` at absolute `path` with [ResolveContext] - /// - /// # Errors - /// - /// * See [ResolveError] - pub fn resolve_with_context>( - &self, - path: P, - specifier: &str, - resolve_context: &mut ResolveContext, - ) -> Result { - let mut ctx = Ctx::default(); - ctx.init_file_dependencies(); - let result = self.resolve_tracing(path.as_ref(), specifier, &mut ctx); - if let Some(deps) = &mut ctx.file_dependencies { - resolve_context.file_dependencies.extend(deps.drain(..)); - } - if let Some(deps) = &mut ctx.missing_dependencies { - resolve_context.missing_dependencies.extend(deps.drain(..)); - } - result - } - - /// Wrap `resolve_impl` with `tracing` information - fn resolve_tracing( - &self, - path: &Path, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - let span = tracing::debug_span!("resolve", path = ?path, specifier = specifier); - let _enter = span.enter(); - let r = self.resolve_impl(path, specifier, ctx); - match &r { - Ok(r) => { - tracing::debug!(options = ?self.options, path = ?path, specifier = specifier, ret = ?r.path); - } - Err(err) => { - tracing::debug!(options = ?self.options, path = ?path, specifier = specifier, err = ?err); - } - }; - r - } - - fn resolve_impl( - &self, - path: &Path, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - ctx.with_fully_specified(self.options.fully_specified); - let cached_path = self.cache.value(path); - let cached_path = self.require(&cached_path, specifier, ctx)?; - let path = self.load_realpath(&cached_path)?; - // enhanced-resolve: restrictions - self.check_restrictions(&path)?; - let package_json = cached_path.find_package_json(&self.cache.fs, &self.options, ctx)?; - if let Some(package_json) = &package_json { - // path must be inside the package. - debug_assert!(path.starts_with(package_json.directory())); - } - Ok(Resolution { - path, - query: ctx.query.take(), - fragment: ctx.fragment.take(), - package_json, - }) - } - - /// require(X) from module at path Y - /// - /// X: specifier - /// Y: path - /// - /// - fn require( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - ctx.test_for_infinite_recursion()?; - - // enhanced-resolve: parse - let (parsed, try_fragment_as_path) = self.load_parse(cached_path, specifier, ctx)?; - if let Some(path) = try_fragment_as_path { - return Ok(path); - } - - self.require_without_parse(cached_path, parsed.path(), ctx) - } - - fn require_without_parse( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - // tsconfig-paths - if let Some(path) = self.load_tsconfig_paths(cached_path, specifier, &mut Ctx::default())? { - return Ok(path); - } - - // enhanced-resolve: try alias - if let Some(path) = self.load_alias(cached_path, specifier, &self.options.alias, ctx)? { - return Ok(path); - } - - let result = match Path::new(specifier).components().next() { - // 2. If X begins with '/' - Some(Component::RootDir | Component::Prefix(_)) => { - self.require_absolute(cached_path, specifier, ctx) - } - // 3. If X begins with './' or '/' or '../' - Some(Component::CurDir | Component::ParentDir) => { - self.require_relative(cached_path, specifier, ctx) - } - // 4. If X begins with '#' - Some(Component::Normal(_)) if specifier.as_bytes()[0] == b'#' => { - self.require_hash(cached_path, specifier, ctx) - } - _ => { - // 1. If X is a core module, - // a. return the core module - // b. STOP - self.require_core(specifier)?; - - // (ESM) 5. Otherwise, - // Note: specifier is now a bare specifier. - // Set resolved the result of PACKAGE_RESOLVE(specifier, parentURL). - self.require_bare(cached_path, specifier, ctx) - } - }; - - result.or_else(|err| { - if err.is_ignore() { - return Err(err); - } - // enhanced-resolve: try fallback - self.load_alias(cached_path, specifier, &self.options.fallback, ctx) - .and_then(|value| value.ok_or(err)) - }) - } - - // PACKAGE_RESOLVE(packageSpecifier, parentURL) - // 3. If packageSpecifier is a Node.js builtin module name, then - // 1. Return the string "node:" concatenated with packageSpecifier. - fn require_core(&self, specifier: &str) -> Result<(), ResolveError> { - if self.options.builtin_modules { - let starts_with_node = specifier.starts_with("node:"); - if starts_with_node || NODEJS_BUILTINS.binary_search(&specifier).is_ok() { - let mut specifier = specifier.to_string(); - if !starts_with_node { - specifier = format!("node:{specifier}"); - } - return Err(ResolveError::Builtin(specifier)); - } - } - Ok(()) - } - - fn require_absolute( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - // Make sure only path prefixes gets called - debug_assert!(Path::new(specifier) - .components() - .next() - .is_some_and(|c| matches!(c, Component::RootDir | Component::Prefix(_)))); - if !self.options.prefer_relative && self.options.prefer_absolute { - if let Ok(path) = self.load_package_self_or_node_modules(cached_path, specifier, ctx) { - return Ok(path); - } - } - if let Some(path) = self.load_roots(specifier, ctx) { - return Ok(path); - } - // 2. If X begins with '/' - // a. set Y to be the file system root - let path = self.cache.value(Path::new(specifier)); - if let Some(path) = self.load_as_file_or_directory(&path, specifier, ctx)? { - return Ok(path); - } - Err(ResolveError::NotFound(specifier.to_string())) - } - - // 3. If X begins with './' or '/' or '../' - fn require_relative( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - // Make sure only relative or normal paths gets called - debug_assert!(Path::new(specifier).components().next().is_some_and(|c| matches!( - c, - Component::CurDir | Component::ParentDir | Component::Normal(_) - ))); - let path = cached_path.path().normalize_with(specifier); - let cached_path = self.cache.value(&path); - // a. LOAD_AS_FILE(Y + X) - // b. LOAD_AS_DIRECTORY(Y + X) - if let Some(path) = self.load_as_file_or_directory(&cached_path, specifier, ctx)? { - return Ok(path); - } - // c. THROW "not found" - Err(ResolveError::NotFound(specifier.to_string())) - } - - fn require_hash( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - debug_assert_eq!(specifier.chars().next(), Some('#')); - // a. LOAD_PACKAGE_IMPORTS(X, dirname(Y)) - if let Some(path) = self.load_package_imports(cached_path, specifier, ctx)? { - return Ok(path); - } - self.load_package_self_or_node_modules(cached_path, specifier, ctx) - } - - fn require_bare( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - // Make sure no other path prefixes gets called - debug_assert!(Path::new(specifier) - .components() - .next() - .is_some_and(|c| matches!(c, Component::Normal(_)))); - if self.options.prefer_relative { - if let Ok(path) = self.require_relative(cached_path, specifier, ctx) { - return Ok(path); - } - } - self.load_package_self_or_node_modules(cached_path, specifier, ctx) - } - - /// enhanced-resolve: ParsePlugin. - /// - /// 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`. - /// - /// - fn load_parse<'s>( - &self, - cached_path: &CachedPath, - specifier: &'s str, - ctx: &mut Ctx, - ) -> Result<(Specifier<'s>, Option), ResolveError> { - let parsed = Specifier::parse(specifier).map_err(ResolveError::Specifier)?; - ctx.with_query_fragment(parsed.query, parsed.fragment); - - // There is an edge-case where a request with # can be a path or a fragment -> try both - if ctx.fragment.is_some() && ctx.query.is_none() { - let specifier = parsed.path(); - let fragment = ctx.fragment.take().unwrap(); - let path = format!("{specifier}{fragment}"); - if let Ok(path) = self.require_without_parse(cached_path, &path, ctx) { - return Ok((parsed, Some(path))); - } - ctx.fragment.replace(fragment); - } - Ok((parsed, None)) - } - - fn load_package_self_or_node_modules( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - let (_, subpath) = Self::parse_package_specifier(specifier); - if subpath.is_empty() { - ctx.with_fully_specified(false); - } - // 5. LOAD_PACKAGE_SELF(X, dirname(Y)) - if let Some(path) = self.load_package_self(cached_path, specifier, ctx)? { - return Ok(path); - } - // 6. LOAD_NODE_MODULES(X, dirname(Y)) - if let Some(path) = self.load_node_modules(cached_path, specifier, ctx)? { - return Ok(path); - } - // 7. THROW "not found" - Err(ResolveError::NotFound(specifier.to_string())) - } - - /// LOAD_PACKAGE_IMPORTS(X, DIR) - fn load_package_imports( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - // 1. Find the closest package scope SCOPE to DIR. - // 2. If no scope was found, return. - let Some(package_json) = - cached_path.find_package_json(&self.cache.fs, &self.options, ctx)? - else { - return Ok(None); - }; - // 3. If the SCOPE/package.json "imports" is null or undefined, return. - // 4. let MATCH = PACKAGE_IMPORTS_RESOLVE(X, pathToFileURL(SCOPE), ["node", "require"]) defined in the ESM resolver. - if let Some(path) = self.package_imports_resolve(specifier, &package_json, ctx)? { - // 5. RESOLVE_ESM_MATCH(MATCH). - return self.resolve_esm_match(specifier, &path, ctx); - } - Ok(None) - } - - fn load_as_file(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - // enhanced-resolve feature: extension_alias - if let Some(path) = self.load_extension_alias(cached_path, ctx)? { - return Ok(Some(path)); - } - if self.options.enforce_extension.is_disabled() { - // 1. If X is a file, load X as its file extension format. STOP - if let Some(path) = self.load_alias_or_file(cached_path, ctx)? { - return Ok(Some(path)); - } - } - // 2. If X.js is a file, load X.js as JavaScript text. STOP - // 3. If X.json is a file, parse X.json to a JavaScript Object. STOP - // 4. If X.node is a file, load X.node as binary addon. STOP - if let Some(path) = - self.load_extensions(cached_path.path(), &self.options.extensions, ctx)? - { - return Ok(Some(path)); - } - Ok(None) - } - - fn load_as_directory(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - // TODO: Only package.json is supported, so warn about having other values - // Checking for empty files is needed for omitting checks on package.json - // 1. If X/package.json is a file, - if !self.options.description_files.is_empty() { - // a. Parse X/package.json, and look for "main" field. - if let Some(package_json) = - cached_path.package_json(&self.cache.fs, &self.options, ctx)? - { - // b. If "main" is a falsy value, GOTO 2. - for main_field in package_json.main_fields(&self.options.main_fields) { - // c. let M = X + (json main field) - let main_field_path = cached_path.path().normalize_with(main_field); - // d. LOAD_AS_FILE(M) - let cached_path = self.cache.value(&main_field_path); - if let Some(path) = self.load_as_file(&cached_path, ctx)? { - return Ok(Some(path)); - } - // e. LOAD_INDEX(M) - if let Some(path) = self.load_index(&cached_path, ctx)? { - return Ok(Some(path)); - } - } - // f. LOAD_INDEX(X) DEPRECATED - // g. THROW "not found" - } - } - // 2. LOAD_INDEX(X) - self.load_index(cached_path, ctx) - } - - fn load_as_file_or_directory( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - if self.options.resolve_to_context { - return Ok(cached_path.is_dir(&self.cache.fs, ctx).then(|| cached_path.clone())); - } - if !specifier.ends_with('/') { - if let Some(path) = self.load_as_file(cached_path, ctx)? { - return Ok(Some(path)); - } - } - if cached_path.is_dir(&self.cache.fs, ctx) { - if let Some(path) = self.load_as_directory(cached_path, ctx)? { - return Ok(Some(path)); - } - } - Ok(None) - } - - fn load_extensions(&self, path: &Path, extensions: &[String], ctx: &mut Ctx) -> ResolveResult { - if ctx.fully_specified { - return Ok(None); - } - let path = path.as_os_str(); - for extension in extensions { - let mut path_with_extension = path.to_os_string(); - path_with_extension.reserve_exact(extension.len()); - path_with_extension.push(extension); - let cached_path = self.cache.value(Path::new(&path_with_extension)); - if let Some(path) = self.load_alias_or_file(&cached_path, ctx)? { - return Ok(Some(path)); - } - } - Ok(None) - } - - fn load_realpath(&self, cached_path: &CachedPath) -> Result { - if self.options.symlinks { - cached_path.realpath(&self.cache.fs).map_err(ResolveError::from) - } else { - Ok(cached_path.to_path_buf()) - } - } - - fn check_restrictions(&self, path: &Path) -> Result<(), ResolveError> { - // https://github.com/webpack/enhanced-resolve/blob/a998c7d218b7a9ec2461fc4fddd1ad5dd7687485/lib/RestrictionsPlugin.js#L19-L24 - fn is_inside(path: &Path, parent: &Path) -> bool { - if !path.starts_with(parent) { - return false; - } - if path.as_os_str().len() == parent.as_os_str().len() { - return true; - } - path.strip_prefix(parent).is_ok_and(|p| p == Path::new("./")) - } - for restriction in &self.options.restrictions { - match restriction { - Restriction::Path(restricted_path) => { - if !is_inside(path, restricted_path) { - return Err(ResolveError::Restriction( - path.to_path_buf(), - restricted_path.clone(), - )); - } - } - Restriction::RegExp(_) => { - return Err(ResolveError::Unimplemented("Restriction with regex")) - } - } - } - Ok(()) - } - - fn load_index(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - for main_file in &self.options.main_files { - let main_path = cached_path.path().normalize_with(main_file); - let cached_path = self.cache.value(&main_path); - if self.options.enforce_extension.is_disabled() { - if let Some(path) = self.load_alias_or_file(&cached_path, ctx)? { - return Ok(Some(path)); - } - } - // 1. If X/index.js is a file, load X/index.js as JavaScript text. STOP - // 2. If X/index.json is a file, parse X/index.json to a JavaScript object. STOP - // 3. If X/index.node is a file, load X/index.node as binary addon. STOP - if let Some(path) = - self.load_extensions(cached_path.path(), &self.options.extensions, ctx)? - { - return Ok(Some(path)); - } - } - Ok(None) - } - - fn load_alias_or_file(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - if let Some(package_json) = - cached_path.find_package_json(&self.cache.fs, &self.options, ctx)? - { - if let Some(path) = self.load_browser_field(cached_path, None, &package_json, ctx)? { - return Ok(Some(path)); - } - } - // enhanced-resolve: try file as alias - let alias_specifier = cached_path.path().to_string_lossy(); - if let Some(path) = - self.load_alias(cached_path, &alias_specifier, &self.options.alias, ctx)? - { - return Ok(Some(path)); - } - if cached_path.is_file(&self.cache.fs, ctx) { - return Ok(Some(cached_path.clone())); - } - Ok(None) - } - - fn load_node_modules( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - let (package_name, subpath) = Self::parse_package_specifier(specifier); - // 1. let DIRS = NODE_MODULES_PATHS(START) - // 2. for each DIR in DIRS: - for module_name in &self.options.modules { - for cached_path in std::iter::successors(Some(cached_path), |p| p.parent()) { - // Skip if /path/to/node_modules does not exist - if !cached_path.is_dir(&self.cache.fs, ctx) { - continue; - } - - let Some(cached_path) = self.get_module_directory(cached_path, module_name, ctx) - else { - continue; - }; - // Optimize node_modules lookup by inspecting whether the package exists - // From LOAD_PACKAGE_EXPORTS(X, DIR) - // 1. Try to interpret X as a combination of NAME and SUBPATH where the name - // may have a @scope/ prefix and the subpath begins with a slash (`/`). - if !package_name.is_empty() { - let package_path = cached_path.path().normalize_with(package_name); - let cached_path = self.cache.value(&package_path); - // Try foo/node_modules/package_name - if cached_path.is_dir(&self.cache.fs, ctx) { - // a. LOAD_PACKAGE_EXPORTS(X, DIR) - if let Some(path) = - self.load_package_exports(specifier, subpath, &cached_path, ctx)? - { - return Ok(Some(path)); - } - } else { - // foo/node_modules/package_name is not a directory, so useless to check inside it - if !subpath.is_empty() { - continue; - } - // Skip if the directory lead to the scope package does not exist - // i.e. `foo/node_modules/@scope` is not a directory for `foo/node_modules/@scope/package` - if package_name.starts_with('@') { - if let Some(path) = cached_path.parent() { - if !path.is_dir(&self.cache.fs, ctx) { - continue; - } - } - } - } - } - - // Try as file or directory for all other cases - // b. LOAD_AS_FILE(DIR/X) - // c. LOAD_AS_DIRECTORY(DIR/X) - let node_module_file = cached_path.path().normalize_with(specifier); - let cached_path = self.cache.value(&node_module_file); - if let Some(path) = self.load_as_file_or_directory(&cached_path, specifier, ctx)? { - return Ok(Some(path)); - } - } - } - Ok(None) - } - - fn get_module_directory( - &self, - cached_path: &CachedPath, - module_name: &str, - ctx: &mut Ctx, - ) -> Option { - if cached_path.path().ends_with(module_name) { - Some(cached_path.clone()) - } else if module_name == "node_modules" { - cached_path.cached_node_modules(&self.cache, ctx) - } else { - cached_path.module_directory(module_name, &self.cache, ctx) - } - } - - fn load_package_exports( - &self, - specifier: &str, - subpath: &str, - cached_path: &CachedPath, - ctx: &mut Ctx, - ) -> ResolveResult { - // 2. If X does not match this pattern or DIR/NAME/package.json is not a file, - // return. - let Some(package_json) = cached_path.package_json(&self.cache.fs, &self.options, ctx)? - else { - return Ok(None); - }; - // 3. Parse DIR/NAME/package.json, and look for "exports" field. - // 4. If "exports" is null or undefined, return. - // 5. let MATCH = PACKAGE_EXPORTS_RESOLVE(pathToFileURL(DIR/NAME), "." + SUBPATH, - // `package.json` "exports", ["node", "require"]) defined in the ESM resolver. - // Note: The subpath is not prepended with a dot on purpose - for exports in package_json.exports_fields(&self.options.exports_fields) { - if let Some(path) = self.package_exports_resolve( - cached_path.path(), - &format!(".{subpath}"), - exports, - ctx, - )? { - // 6. RESOLVE_ESM_MATCH(MATCH) - return self.resolve_esm_match(specifier, &path, ctx); - }; - } - Ok(None) - } - - fn load_package_self( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - // 1. Find the closest package scope SCOPE to DIR. - // 2. If no scope was found, return. - let Some(package_json) = - cached_path.find_package_json(&self.cache.fs, &self.options, ctx)? - else { - return Ok(None); - }; - // 3. If the SCOPE/package.json "exports" is null or undefined, return. - // 4. If the SCOPE/package.json "name" is not the first segment of X, return. - if let Some(subpath) = package_json - .name - .as_ref() - .and_then(|package_name| Self::strip_package_name(specifier, package_name)) - { - // 5. let MATCH = PACKAGE_EXPORTS_RESOLVE(pathToFileURL(SCOPE), - // "." + X.slice("name".length), `package.json` "exports", ["node", "require"]) - // defined in the ESM resolver. - let package_url = package_json.directory(); - // Note: The subpath is not prepended with a dot on purpose - // because `package_exports_resolve` matches subpath without the leading dot. - for exports in package_json.exports_fields(&self.options.exports_fields) { - if let Some(cached_path) = - self.package_exports_resolve(package_url, &format!(".{subpath}"), exports, ctx)? - { - // 6. RESOLVE_ESM_MATCH(MATCH) - return self.resolve_esm_match(specifier, &cached_path, ctx); - } - } - } - self.load_browser_field(cached_path, Some(specifier), &package_json, ctx) - } - - /// RESOLVE_ESM_MATCH(MATCH) - fn resolve_esm_match( - &self, - specifier: &str, - cached_path: &CachedPath, - ctx: &mut Ctx, - ) -> ResolveResult { - // 1. let RESOLVED_PATH = fileURLToPath(MATCH) - // 2. If the file at RESOLVED_PATH exists, load RESOLVED_PATH as its extension format. STOP - // - // Non-compliant ESM can result in a directory, so directory is tried as well. - if let Some(path) = self.load_as_file_or_directory(cached_path, "", ctx)? { - return Ok(Some(path)); - } - // 3. THROW "not found" - Err(ResolveError::NotFound(specifier.to_string())) - } - - /// enhanced-resolve: AliasFieldPlugin for [ResolveOptions::alias_fields] - fn load_browser_field( - &self, - cached_path: &CachedPath, - module_specifier: Option<&str>, - package_json: &PackageJson, - ctx: &mut Ctx, - ) -> ResolveResult { - let path = cached_path.path(); - let Some(new_specifier) = package_json.resolve_browser_field( - path, - module_specifier, - &self.options.alias_fields, - )? - else { - return Ok(None); - }; - // Abort when resolving recursive module - if module_specifier.is_some_and(|s| s == new_specifier) { - return Ok(None); - } - if ctx.resolving_alias.as_ref().is_some_and(|s| s == new_specifier) { - // Complete when resolving to self `{"./a.js": "./a.js"}` - if new_specifier.strip_prefix("./").filter(|s| path.ends_with(Path::new(s))).is_some() { - return if cached_path.is_file(&self.cache.fs, ctx) { - Ok(Some(cached_path.clone())) - } else { - Err(ResolveError::NotFound(new_specifier.to_string())) - }; - } - return Err(ResolveError::Recursion); - } - ctx.with_resolving_alias(new_specifier.to_string()); - ctx.with_fully_specified(false); - let cached_path = self.cache.value(package_json.directory()); - self.require(&cached_path, new_specifier, ctx).map(Some) - } - - /// enhanced-resolve: AliasPlugin for [ResolveOptions::alias] and [ResolveOptions::fallback]. - fn load_alias( - &self, - cached_path: &CachedPath, - specifier: &str, - aliases: &Alias, - ctx: &mut Ctx, - ) -> ResolveResult { - for (alias_key_raw, specifiers) in aliases { - let alias_key = if let Some(alias_key) = alias_key_raw.strip_suffix('$') { - if alias_key != specifier { - continue; - } - alias_key - } else { - let strip_package_name = Self::strip_package_name(specifier, alias_key_raw); - if strip_package_name.is_none() { - continue; - } - alias_key_raw - }; - // It should stop resolving when all of the tried alias values - // failed to resolve. - // - let mut should_stop = false; - for r in specifiers { - match r { - AliasValue::Path(alias_value) => { - if let Some(path) = self.load_alias_value( - cached_path, - alias_key, - alias_value, - specifier, - ctx, - &mut should_stop, - )? { - return Ok(Some(path)); - } - } - AliasValue::Ignore => { - let path = cached_path.path().normalize_with(alias_key); - return Err(ResolveError::Ignored(path)); - } - } - } - if should_stop { - return Err(ResolveError::NotFound(specifier.to_string())); - } - } - Ok(None) - } - - fn load_alias_value( - &self, - cached_path: &CachedPath, - alias_key: &str, - alias_value: &str, - request: &str, - ctx: &mut Ctx, - should_stop: &mut bool, - ) -> ResolveResult { - if request != alias_value - && !request.strip_prefix(alias_value).is_some_and(|prefix| prefix.starts_with('/')) - { - let tail = &request[alias_key.len()..]; - - let new_specifier = if tail.is_empty() { - Cow::Borrowed(alias_value) - } else { - let alias_value = Path::new(alias_value).normalize(); - // Must not append anything to alias_value if it is a file. - let alias_value_cached_path = self.cache.value(&alias_value); - if alias_value_cached_path.is_file(&self.cache.fs, ctx) { - return Ok(None); - } - - // Remove the leading slash so the final path is concatenated. - let tail = tail.trim_start_matches(SLASH_START); - let normalized = alias_value.normalize_with(tail); - Cow::Owned(normalized.to_string_lossy().to_string()) - }; - - *should_stop = true; - ctx.with_fully_specified(false); - return match self.require(cached_path, new_specifier.as_ref(), ctx) { - Err(ResolveError::NotFound(_)) => Ok(None), - Ok(path) => return Ok(Some(path)), - Err(err) => return Err(err), - }; - } - Ok(None) - } - - /// Given an extension alias map `{".js": [".ts", "js"]}`, - /// load the mapping instead of the provided extension - /// - /// This is an enhanced-resolve feature - /// - /// # Errors - /// - /// * [ResolveError::ExtensionAlias]: When all of the aliased extensions are not found - fn load_extension_alias(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - let Some(path_extension) = cached_path.path().extension() else { - return Ok(None); - }; - let Some((_, extensions)) = self - .options - .extension_alias - .iter() - .find(|(ext, _)| OsStr::new(ext.trim_start_matches('.')) == path_extension) - else { - return Ok(None); - }; - let path = cached_path.path().with_extension(""); - ctx.with_fully_specified(false); - if let Some(path) = self.load_extensions(&path, extensions, ctx)? { - return Ok(Some(path)); - } - Err(ResolveError::ExtensionAlias) - } - - /// enhanced-resolve: RootsPlugin - /// - /// A list of directories where requests of server-relative URLs (starting with '/') are resolved, - /// defaults to context configuration option. - /// - /// On non-Windows systems these requests are resolved as an absolute path first. - fn load_roots(&self, specifier: &str, ctx: &mut Ctx) -> Option { - if !self.options.roots.is_empty() { - if let Some(specifier) = specifier.strip_prefix(SLASH_START) { - for root in &self.options.roots { - let cached_path = self.cache.value(root); - if let Ok(path) = self.require_relative(&cached_path, specifier, ctx) { - return Some(path); - } - } - } - } - None - } - - fn load_tsconfig_paths( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - let Some(tsconfig_options) = &self.options.tsconfig else { - return Ok(None); - }; - let tsconfig = self.load_tsconfig( - /* root */ true, - &tsconfig_options.config_file, - &tsconfig_options.references, - )?; - let paths = tsconfig.resolve(cached_path.path(), specifier); - for path in paths { - let cached_path = self.cache.value(&path); - if let Ok(path) = self.require_relative(&cached_path, ".", ctx) { - return Ok(Some(path)); - } - } - Ok(None) - } - - fn load_tsconfig( - &self, - root: bool, - path: &Path, - references: &TsconfigReferences, - ) -> Result, ResolveError> { - self.cache.tsconfig(root, path, |tsconfig| { - let directory = self.cache.value(tsconfig.directory()); - tracing::trace!(tsconfig = ?tsconfig, "load_tsconfig"); - - // Extend tsconfig - if let Some(extends) = &tsconfig.extends { - let extended_tsconfig_paths = match extends { - ExtendsField::Single(s) => { - vec![self.get_extended_tsconfig_path(&directory, tsconfig, s)?] - } - ExtendsField::Multiple(specifiers) => specifiers - .iter() - .map(|s| self.get_extended_tsconfig_path(&directory, tsconfig, s)) - .collect::, ResolveError>>()?, - }; - for extended_tsconfig_path in extended_tsconfig_paths { - let extended_tsconfig = self.load_tsconfig( - /* root */ false, - &extended_tsconfig_path, - &TsconfigReferences::Disabled, - )?; - tsconfig.extend_tsconfig(&extended_tsconfig); - } - } - - // Load project references - match references { - TsconfigReferences::Disabled => { - tsconfig.references.drain(..); - } - TsconfigReferences::Auto => {} - TsconfigReferences::Paths(paths) => { - tsconfig.references = paths - .iter() - .map(|path| ProjectReference { path: path.clone(), tsconfig: None }) - .collect(); - } - } - if !tsconfig.references.is_empty() { - let directory = tsconfig.directory().to_path_buf(); - for reference in &mut tsconfig.references { - let reference_tsconfig_path = directory.normalize_with(&reference.path); - let tsconfig = self.cache.tsconfig( - /* root */ true, - &reference_tsconfig_path, - |_| Ok(()), - )?; - reference.tsconfig.replace(tsconfig); - } - } - Ok(()) - }) - } - - fn get_extended_tsconfig_path( - &self, - directory: &CachedPath, - tsconfig: &TsConfig, - specifier: &str, - ) -> Result { - match specifier.as_bytes().first() { - None => Err(ResolveError::Specifier(SpecifierError::Empty(specifier.to_string()))), - Some(b'/') => Ok(PathBuf::from(specifier)), - Some(b'.') => Ok(tsconfig.directory().normalize_with(specifier)), - _ => self - .clone_with_options(ResolveOptions { - description_files: vec![], - extensions: vec![".json".into()], - main_files: vec!["tsconfig.json".into()], - ..ResolveOptions::default() - }) - .load_package_self_or_node_modules(directory, specifier, &mut Ctx::default()) - .map(|p| p.to_path_buf()) - .map_err(|err| match err { - ResolveError::NotFound(_) => { - ResolveError::TsconfigNotFound(PathBuf::from(specifier)) - } - _ => err, - }), - } - } - - /// PACKAGE_RESOLVE(packageSpecifier, parentURL) - fn package_resolve( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - let (package_name, subpath) = Self::parse_package_specifier(specifier); - - // 3. If packageSpecifier is a Node.js builtin module name, then - // 1. Return the string "node:" concatenated with packageSpecifier. - self.require_core(package_name)?; - - // 11. While parentURL is not the file system root, - for module_name in &self.options.modules { - for cached_path in std::iter::successors(Some(cached_path), |p| p.parent()) { - // 1. Let packageURL be the URL resolution of "node_modules/" concatenated with packageSpecifier, relative to parentURL. - let Some(cached_path) = self.get_module_directory(cached_path, module_name, ctx) - else { - continue; - }; - // 2. Set parentURL to the parent folder URL of parentURL. - let package_path = cached_path.path().normalize_with(package_name); - let cached_path = self.cache.value(&package_path); - // 3. If the folder at packageURL does not exist, then - // 1. Continue the next loop iteration. - if cached_path.is_dir(&self.cache.fs, ctx) { - // 4. Let pjson be the result of READ_PACKAGE_JSON(packageURL). - if let Some(package_json) = - cached_path.package_json(&self.cache.fs, &self.options, ctx)? - { - // 5. If pjson is not null and pjson.exports is not null or undefined, then - // 1. Return the result of PACKAGE_EXPORTS_RESOLVE(packageURL, packageSubpath, pjson.exports, defaultConditions). - for exports in package_json.exports_fields(&self.options.exports_fields) { - if let Some(path) = self.package_exports_resolve( - cached_path.path(), - &format!(".{subpath}"), - exports, - ctx, - )? { - return Ok(Some(path)); - } - } - // 6. Otherwise, if packageSubpath is equal to ".", then - if subpath == "." { - // 1. If pjson.main is a string, then - for main_field in package_json.main_fields(&self.options.main_fields) { - // 1. Return the URL resolution of main in packageURL. - let path = cached_path.path().normalize_with(main_field); - let cached_path = self.cache.value(&path); - if cached_path.is_file(&self.cache.fs, ctx) { - return Ok(Some(cached_path)); - } - } - } - } - let subpath = format!(".{subpath}"); - ctx.with_fully_specified(false); - return self.require(&cached_path, &subpath, ctx).map(Some); - } - } - } - - Err(ResolveError::NotFound(specifier.to_string())) - } - - /// PACKAGE_EXPORTS_RESOLVE(packageURL, subpath, exports, conditions) - fn package_exports_resolve( - &self, - package_url: &Path, - subpath: &str, - exports: &JSONValue, - ctx: &mut Ctx, - ) -> ResolveResult { - let conditions = &self.options.condition_names; - // 1. If exports is an Object with both a key starting with "." and a key not starting with ".", throw an Invalid Package Configuration error. - if let JSONValue::Object(map) = exports { - let mut has_dot = false; - let mut without_dot = false; - for key in map.keys() { - has_dot = has_dot || key.starts_with(|s| s == '.' || s == '#'); - without_dot = without_dot || !key.starts_with(|s| s == '.' || s == '#'); - if has_dot && without_dot { - return Err(ResolveError::InvalidPackageConfig( - package_url.join("package.json"), - )); - } - } - } - // 2. If subpath is equal to ".", then - // Note: subpath is not prepended with a dot when passed in. - if subpath == "." { - // enhanced-resolve appends query and fragment when resolving exports field - // https://github.com/webpack/enhanced-resolve/blob/a998c7d218b7a9ec2461fc4fddd1ad5dd7687485/lib/ExportsFieldPlugin.js#L57-L62 - // This is only need when querying the main export, otherwise ctx is passed through. - if ctx.query.is_some() || ctx.fragment.is_some() { - let query = ctx.query.clone().unwrap_or_default(); - let fragment = ctx.fragment.clone().unwrap_or_default(); - return Err(ResolveError::PackagePathNotExported( - format!("./{}{query}{fragment}", subpath.trim_start_matches('.')), - package_url.join("package.json"), - )); - } - // 1. Let mainExport be undefined. - let main_export = match exports { - // 2. If exports is a String or Array, or an Object containing no keys starting with ".", then - JSONValue::String(_) | JSONValue::Array(_) => { - // 1. Set mainExport to exports. - Some(exports) - } - // 3. Otherwise if exports is an Object containing a "." property, then - JSONValue::Object(map) => { - // 1. Set mainExport to exports["."]. - map.get(".").map_or_else( - || { - if map.keys().any(|key| key.starts_with("./") || key.starts_with('#')) { - None - } else { - Some(exports) - } - }, - Some, - ) - } - _ => None, - }; - // 4. If mainExport is not undefined, then - if let Some(main_export) = main_export { - // 1. Let resolved be the result of PACKAGE_TARGET_RESOLVE( packageURL, mainExport, null, false, conditions). - let resolved = self.package_target_resolve( - package_url, - ".", - main_export, - None, - /* is_imports */ false, - conditions, - ctx, - )?; - // 2. If resolved is not null or undefined, return resolved. - if let Some(path) = resolved { - return Ok(Some(path)); - } - } - } - // 3. Otherwise, if exports is an Object and all keys of exports start with ".", then - if let JSONValue::Object(exports) = exports { - // 1. Let matchKey be the string "./" concatenated with subpath. - // Note: `package_imports_exports_resolve` does not require the leading dot. - let match_key = &subpath; - // 2. Let resolved be the result of PACKAGE_IMPORTS_EXPORTS_RESOLVE( matchKey, exports, packageURL, false, conditions). - if let Some(path) = self.package_imports_exports_resolve( - match_key, - exports, - package_url, - /* is_imports */ false, - conditions, - ctx, - )? { - // 3. If resolved is not null or undefined, return resolved. - return Ok(Some(path)); - } - } - // 4. Throw a Package Path Not Exported error. - Err(ResolveError::PackagePathNotExported( - subpath.to_string(), - package_url.join("package.json"), - )) - } - - /// PACKAGE_IMPORTS_RESOLVE(specifier, parentURL, conditions) - fn package_imports_resolve( - &self, - specifier: &str, - package_json: &PackageJson, - ctx: &mut Ctx, - ) -> Result, ResolveError> { - // 1. Assert: specifier begins with "#". - debug_assert!(specifier.starts_with('#'), "{specifier}"); - // 2. If specifier is exactly equal to "#" or starts with "#/", then - // 1. Throw an Invalid Module Specifier error. - // 3. Let packageURL be the result of LOOKUP_PACKAGE_SCOPE(parentURL). - // 4. If packageURL is not null, then - - // 1. Let pjson be the result of READ_PACKAGE_JSON(packageURL). - // 2. If pjson.imports is a non-null Object, then - - // 1. Let resolved be the result of PACKAGE_IMPORTS_EXPORTS_RESOLVE( specifier, pjson.imports, packageURL, true, conditions). - let mut has_imports = false; - for imports in package_json.imports_fields(&self.options.imports_fields) { - if !has_imports { - has_imports = true; - // TODO: fill in test case for this case - if specifier == "#" || specifier.starts_with("#/") { - return Err(ResolveError::InvalidModuleSpecifier( - specifier.to_string(), - package_json.path.clone(), - )); - } - } - if let Some(path) = self.package_imports_exports_resolve( - specifier, - imports, - package_json.directory(), - /* is_imports */ true, - &self.options.condition_names, - ctx, - )? { - // 2. If resolved is not null or undefined, return resolved. - return Ok(Some(path)); - } - } - - // 5. Throw a Package Import Not Defined error. - if has_imports { - Err(ResolveError::PackageImportNotDefined( - specifier.to_string(), - package_json.path.clone(), - )) - } else { - Ok(None) - } - } - - /// PACKAGE_IMPORTS_EXPORTS_RESOLVE(matchKey, matchObj, packageURL, isImports, conditions) - fn package_imports_exports_resolve( - &self, - match_key: &str, - match_obj: &JSONMap, - package_url: &Path, - is_imports: bool, - conditions: &[String], - ctx: &mut Ctx, - ) -> ResolveResult { - // enhanced-resolve behaves differently, it throws - // Error: CachedPath to directories is not possible with the exports field (specifier was ./dist/) - if match_key.ends_with('/') { - return Ok(None); - } - // 1. If matchKey is a key of matchObj and does not contain "*", then - if !match_key.contains('*') { - // 1. Let target be the value of matchObj[matchKey]. - if let Some(target) = match_obj.get(match_key) { - // 2. Return the result of PACKAGE_TARGET_RESOLVE(packageURL, target, null, isImports, conditions). - return self.package_target_resolve( - package_url, - match_key, - target, - None, - is_imports, - conditions, - ctx, - ); - } - } - - let mut best_target = None; - let mut best_match = ""; - let mut best_key = ""; - // 2. Let expansionKeys be the list of keys of matchObj containing only a single "*", sorted by the sorting function PATTERN_KEY_COMPARE which orders in descending order of specificity. - // 3. For each key expansionKey in expansionKeys, do - for (expansion_key, target) in match_obj { - if expansion_key.starts_with("./") || expansion_key.starts_with('#') { - // 1. Let patternBase be the substring of expansionKey up to but excluding the first "*" character. - if let Some((pattern_base, pattern_trailer)) = expansion_key.split_once('*') { - // 2. If matchKey starts with but is not equal to patternBase, then - if match_key.starts_with(pattern_base) - // 1. Let patternTrailer be the substring of expansionKey from the index after the first "*" character. - && !pattern_trailer.contains('*') - // 2. If patternTrailer has zero length, or if matchKey ends with patternTrailer and the length of matchKey is greater than or equal to the length of expansionKey, then - && (pattern_trailer.is_empty() - || (match_key.len() >= expansion_key.len() - && match_key.ends_with(pattern_trailer))) - && Self::pattern_key_compare(best_key, expansion_key).is_gt() - { - // 1. Let target be the value of matchObj[expansionKey]. - best_target = Some(target); - // 2. Let patternMatch be the substring of matchKey starting at the index of the length of patternBase up to the length of matchKey minus the length of patternTrailer. - best_match = - &match_key[pattern_base.len()..match_key.len() - pattern_trailer.len()]; - best_key = expansion_key; - } - } else if expansion_key.ends_with('/') - && match_key.starts_with(expansion_key) - && Self::pattern_key_compare(best_key, expansion_key).is_gt() - { - // TODO: [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./dist/" in the "exports" field module resolution of the package at xxx/package.json. - best_target = Some(target); - best_match = &match_key[expansion_key.len()..]; - best_key = expansion_key; - } - } - } - if let Some(best_target) = best_target { - // 3. Return the result of PACKAGE_TARGET_RESOLVE(packageURL, target, patternMatch, isImports, conditions). - return self.package_target_resolve( - package_url, - best_key, - best_target, - Some(best_match), - is_imports, - conditions, - ctx, - ); - } - // 4. Return null. - Ok(None) - } - - /// PACKAGE_TARGET_RESOLVE(packageURL, target, patternMatch, isImports, conditions) - #[allow(clippy::too_many_arguments)] - fn package_target_resolve( - &self, - package_url: &Path, - target_key: &str, - target: &JSONValue, - pattern_match: Option<&str>, - is_imports: bool, - conditions: &[String], - ctx: &mut Ctx, - ) -> ResolveResult { - fn normalize_string_target<'a>( - target_key: &'a str, - target: &'a str, - pattern_match: Option<&'a str>, - package_url: &Path, - ) -> Result, ResolveError> { - let target = if let Some(pattern_match) = pattern_match { - if !target_key.contains('*') && !target.contains('*') { - // enhanced-resolve behaviour - // TODO: [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./dist/" in the "exports" field module resolution of the package at xxx/package.json. - if target_key.ends_with('/') && target.ends_with('/') { - Cow::Owned(format!("{target}{pattern_match}")) - } else { - return Err(ResolveError::InvalidPackageConfigDirectory( - package_url.join("package.json"), - )); - } - } else { - Cow::Owned(target.replace('*', pattern_match)) - } - } else { - Cow::Borrowed(target) - }; - Ok(target) - } - - match target { - // 1. If target is a String, then - JSONValue::String(target) => { - // 1. If target does not start with "./", then - if !target.starts_with("./") { - // 1. If isImports is false, or if target starts with "../" or "/", or if target is a valid URL, then - if !is_imports || target.starts_with("../") || target.starts_with('/') { - // 1. Throw an Invalid Package Target error. - return Err(ResolveError::InvalidPackageTarget( - target.to_string(), - target_key.to_string(), - package_url.join("package.json"), - )); - } - // 2. If patternMatch is a String, then - // 1. Return PACKAGE_RESOLVE(target with every instance of "*" replaced by patternMatch, packageURL + "/"). - let target = - normalize_string_target(target_key, target, pattern_match, package_url)?; - let package_url = self.cache.value(package_url); - // // 3. Return PACKAGE_RESOLVE(target, packageURL + "/"). - return self.package_resolve(&package_url, &target, ctx); - } - - // 2. If target split on "/" or "\" contains any "", ".", "..", or "node_modules" segments after the first "." segment, case insensitive and including percent encoded variants, throw an Invalid Package Target error. - // 3. Let resolvedTarget be the URL resolution of the concatenation of packageURL and target. - // 4. Assert: resolvedTarget is contained in packageURL. - // 5. If patternMatch is null, then - let target = - normalize_string_target(target_key, target, pattern_match, package_url)?; - if Path::new(target.as_ref()).is_invalid_exports_target() { - return Err(ResolveError::InvalidPackageTarget( - target.to_string(), - target_key.to_string(), - package_url.join("package.json"), - )); - } - let resolved_target = package_url.normalize_with(target.as_ref()); - // 6. If patternMatch split on "/" or "\" contains any "", ".", "..", or "node_modules" segments, case insensitive and including percent encoded variants, throw an Invalid Module Specifier error. - // 7. Return the URL resolution of resolvedTarget with every instance of "*" replaced with patternMatch. - let value = self.cache.value(&resolved_target); - return Ok(Some(value)); - } - // 2. Otherwise, if target is a non-null Object, then - JSONValue::Object(target) => { - // 1. If exports contains any index property keys, as defined in ECMA-262 6.1.7 Array Index, throw an Invalid Package Configuration error. - // 2. For each property p of target, in object insertion order as, - for (key, target_value) in target { - // 1. If p equals "default" or conditions contains an entry for p, then - if key == "default" || conditions.contains(key) { - // 1. Let targetValue be the value of the p property in target. - // 2. Let resolved be the result of PACKAGE_TARGET_RESOLVE( packageURL, targetValue, patternMatch, isImports, conditions). - let resolved = self.package_target_resolve( - package_url, - target_key, - target_value, - pattern_match, - is_imports, - conditions, - ctx, - ); - // 3. If resolved is equal to undefined, continue the loop. - if let Some(path) = resolved? { - // 4. Return resolved. - return Ok(Some(path)); - } - } - } - // 3. Return undefined. - return Ok(None); - } - // 3. Otherwise, if target is an Array, then - JSONValue::Array(targets) => { - // 1. If _target.length is zero, return null. - if targets.is_empty() { - // Note: return PackagePathNotExported has the same effect as return because there are no matches. - return Err(ResolveError::PackagePathNotExported( - pattern_match.unwrap_or(".").to_string(), - package_url.join("package.json"), - )); - } - // 2. For each item targetValue in target, do - for (i, target_value) in targets.iter().enumerate() { - // 1. Let resolved be the result of PACKAGE_TARGET_RESOLVE( packageURL, targetValue, patternMatch, isImports, conditions), continuing the loop on any Invalid Package Target error. - let resolved = self.package_target_resolve( - package_url, - target_key, - target_value, - pattern_match, - is_imports, - conditions, - ctx, - ); - - if resolved.is_err() && i == targets.len() { - return resolved; - } - - // 2. If resolved is undefined, continue the loop. - if let Ok(Some(path)) = resolved { - // 3. Return resolved. - return Ok(Some(path)); - } - } - // 3. Return or throw the last fallback resolution null return or error. - // Note: see `resolved.is_err() && i == targets.len()` - } - _ => {} - } - // 4. Otherwise, if target is null, return null. - Ok(None) - // 5. Otherwise throw an Invalid Package Target error. - } - - // Returns (module, subpath) - // https://github.com/nodejs/node/blob/8f0f17e1e3b6c4e58ce748e06343c5304062c491/lib/internal/modules/esm/resolve.js#L688 - fn parse_package_specifier(specifier: &str) -> (&str, &str) { - let mut separator_index = specifier.as_bytes().iter().position(|b| *b == b'/'); - // let mut valid_package_name = true; - // let mut is_scoped = false; - if specifier.starts_with('@') { - // is_scoped = true; - if separator_index.is_none() || specifier.is_empty() { - // valid_package_name = false; - } else if let Some(index) = &separator_index { - separator_index = specifier[*index + 1..] - .as_bytes() - .iter() - .position(|b| *b == b'/') - .map(|i| i + *index + 1); - } - } - let package_name = - separator_index.map_or(specifier, |separator_index| &specifier[..separator_index]); - - // TODO: https://github.com/nodejs/node/blob/8f0f17e1e3b6c4e58ce748e06343c5304062c491/lib/internal/modules/esm/resolve.js#L705C1-L714C1 - // Package name cannot have leading . and cannot have percent-encoding or - // \\ separators. - // if (RegExpPrototypeExec(invalidPackageNameRegEx, packageName) !== null) - // validPackageName = false; - - // if (!validPackageName) { - // throw new ERR_INVALID_MODULE_SPECIFIER( - // specifier, 'is not a valid package name', fileURLToPath(base)); - // } - let package_subpath = - separator_index.map_or("", |separator_index| &specifier[separator_index..]); - (package_name, package_subpath) - } - - /// PATTERN_KEY_COMPARE(keyA, keyB) - fn pattern_key_compare(key_a: &str, key_b: &str) -> Ordering { - if key_a.is_empty() { - return Ordering::Greater; - } - // 1. Assert: keyA ends with "/" or contains only a single "*". - debug_assert!(key_a.ends_with('/') || key_a.match_indices('*').count() == 1, "{key_a}"); - // 2. Assert: keyB ends with "/" or contains only a single "*". - debug_assert!(key_b.ends_with('/') || key_b.match_indices('*').count() == 1, "{key_b}"); - // 3. Let baseLengthA be the index of "*" in keyA plus one, if keyA contains "*", or the length of keyA otherwise. - let a_pos = key_a.chars().position(|c| c == '*'); - let base_length_a = a_pos.map_or(key_a.len(), |p| p + 1); - // 4. Let baseLengthB be the index of "*" in keyB plus one, if keyB contains "*", or the length of keyB otherwise. - let b_pos = key_b.chars().position(|c| c == '*'); - let base_length_b = b_pos.map_or(key_b.len(), |p| p + 1); - // 5. If baseLengthA is greater than baseLengthB, return -1. - if base_length_a > base_length_b { - return Ordering::Less; - } - // 6. If baseLengthB is greater than baseLengthA, return 1. - if base_length_b > base_length_a { - return Ordering::Greater; - } - // 7. If keyA does not contain "*", return 1. - if !key_a.contains('*') { - return Ordering::Greater; - } - // 8. If keyB does not contain "*", return -1. - if !key_b.contains('*') { - return Ordering::Less; - } - // 9. If the length of keyA is greater than the length of keyB, return -1. - if key_a.len() > key_b.len() { - return Ordering::Less; - } - // 10. If the length of keyB is greater than the length of keyA, return 1. - if key_b.len() > key_a.len() { - return Ordering::Greater; - } - // 11. Return 0. - Ordering::Equal - } - - fn strip_package_name<'a>(specifier: &'a str, package_name: &'a str) -> Option<&'a str> { - specifier - .strip_prefix(package_name) - .filter(|tail| tail.is_empty() || tail.starts_with(SLASH_START)) - } -} diff --git a/src/options.rs b/src/options.rs deleted file mode 100644 index f473a133..00000000 --- a/src/options.rs +++ /dev/null @@ -1,623 +0,0 @@ -use std::path::Path; -use std::{fmt, path::PathBuf}; - -/// Module Resolution Options -/// -/// Options are directly ported from [enhanced-resolve](https://github.com/webpack/enhanced-resolve#resolver-options). -/// -/// See [webpack resolve](https://webpack.js.org/configuration/resolve/) for information and examples -#[derive(Debug, Clone)] -pub struct ResolveOptions { - /// Path to TypeScript configuration file. - /// - /// Default `None` - pub tsconfig: Option, - - /// Create aliases to import or require certain modules more easily. - /// - /// An alias is used to replace a whole path or part of a path. - /// For example, to alias a commonly used `src/` folders: `vec![("@/src"), vec![AliasValue::Path("/path/to/src")]]` - /// - /// A trailing $ can also be added to the given object's keys to signify an exact match. - /// - /// See [webpack's `resolve.alias` documentation](https://webpack.js.org/configuration/resolve/#resolvealias) for a list of use cases. - pub alias: Alias, - - /// A list of alias fields in description files. - /// - /// Specify a field, such as `browser`, to be parsed according to [this specification](https://github.com/defunctzombie/package-browser-field-spec). - /// Can be a path to json object such as `["path", "to", "exports"]`. - /// - /// Default `[]` - pub alias_fields: Vec>, - - /// Condition names for exports field which defines entry points of a package. - /// - /// The key order in the exports field is significant. During condition matching, earlier entries have higher priority and take precedence over later entries. - /// - /// Default `[]` - pub condition_names: Vec, - - /// The JSON files to use for descriptions. (There was once a `bower.json`.) - /// - /// Default `["package.json"]` - pub description_files: Vec, - - /// Set to [EnforceExtension::Enabled] for [ESM Mandatory file extensions](https://nodejs.org/api/esm.html#mandatory-file-extensions). - /// - /// If `enforce_extension` is set to [EnforceExtension::Enabled], resolution will not allow extension-less files. - /// This means `require('./foo.js')` will resolve, while `require('./foo')` will not. - /// - /// The default value for `enforce_extension` is [EnforceExtension::Auto], which is changed upon initialization. - /// - /// It changes to [EnforceExtension::Enabled] if [ResolveOptions::extensions] contains an empty string; - /// otherwise, this value changes to [EnforceExtension::Disabled]. - /// - /// Explicitly set the value to [EnforceExtension::Disabled] to disable this automatic behavior. - /// - /// For reference, this behavior is aligned with `enhanced-resolve`. See . - pub enforce_extension: EnforceExtension, - - /// A list of exports fields in description files. - /// - /// Can be a path to a JSON object such as `["path", "to", "exports"]`. - /// - /// Default `[["exports"]]`. - pub exports_fields: Vec>, - - /// Fields from `package.json` which are used to provide the internal requests of a package - /// (requests starting with # are considered internal). - /// - /// Can be a path to a JSON object such as `["path", "to", "imports"]`. - /// - /// Default `[["imports"]]`. - pub imports_fields: Vec>, - - /// An object which maps extension to extension aliases. - /// - /// Default `{}` - pub extension_alias: Vec<(String, Vec)>, - - /// Attempt to resolve these extensions in order. - /// - /// If multiple files share the same name but have different extensions, - /// will resolve the one with the extension listed first in the array and skip the rest. - /// - /// All extensions must have a leading dot. - /// - /// Default `[".js", ".json", ".node"]` - pub extensions: Vec, - - /// Redirect module requests when normal resolving fails. - /// - /// Default `[]` - pub fallback: Alias, - - /// 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). - /// - /// See also webpack configuration [resolve.fullySpecified](https://webpack.js.org/configuration/module/#resolvefullyspecified) - /// - /// Default `false` - pub fully_specified: bool, - - /// A list of main fields in description files - /// - /// Default `["main"]`. - pub main_fields: Vec, - - /// The filename to be used while resolving directories. - /// - /// Default `["index"]` - pub main_files: Vec, - - /// A list of directories to resolve modules from, can be absolute path or folder name. - /// - /// Default `["node_modules"]` - pub modules: Vec, - - /// Resolve to a context instead of a file. - /// - /// Default `false` - pub resolve_to_context: bool, - - /// Prefer to resolve module requests as relative requests instead of using modules from node_modules directories. - /// - /// Default `false` - pub prefer_relative: bool, - - /// Prefer to resolve server-relative urls as absolute paths before falling back to resolve in ResolveOptions::roots. - /// - /// Default `false` - pub prefer_absolute: bool, - - /// A list of resolve restrictions to restrict the paths that a request can be resolved on. - /// - /// Default `[]` - pub restrictions: Vec, - - /// A list of directories where requests of server-relative URLs (starting with '/') are resolved. - /// On non-Windows systems these requests are resolved as an absolute path first. - /// - /// Default `[]` - pub roots: Vec, - - /// Whether to resolve symlinks to their symlinked location. - /// When enabled, symlinked resources are resolved to their real path, not their symlinked location. - /// Note that this may cause module resolution to fail when using tools that symlink packages (like npm link). - /// - /// Default `true` - pub symlinks: bool, - - /// Whether to parse [module.builtinModules](https://nodejs.org/api/module.html#modulebuiltinmodules) or not. - /// For example, "zlib" will throw [crate::ResolveError::Builtin] when set to true. - /// - /// Default `false` - pub builtin_modules: bool, -} - -impl ResolveOptions { - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// - /// let options = ResolveOptions::default().with_condition_names(&["bar"]); - /// assert_eq!(options.condition_names, vec!["bar".to_string()]) - /// ``` - #[must_use] - pub fn with_condition_names(mut self, names: &[&str]) -> Self { - self.condition_names = names.iter().map(ToString::to_string).collect::>(); - self - } - - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// - /// let options = ResolveOptions::default().with_builtin_modules(false); - /// assert_eq!(options.builtin_modules, false) - /// ``` - #[must_use] - pub fn with_builtin_modules(mut self, flag: bool) -> Self { - self.builtin_modules = flag; - self - } - - /// Adds a single root to the options - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_root("foo"); - /// assert_eq!(options.roots, vec![PathBuf::from("foo")]) - /// ``` - #[must_use] - pub fn with_root>(mut self, root: P) -> Self { - self.roots.push(root.as_ref().to_path_buf()); - self - } - - /// Adds a single extension to the list of extensions - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_extension("jsonc"); - /// assert!(options.extensions.contains(&"jsonc".to_string())); - /// ``` - #[must_use] - pub fn with_extension>(mut self, extension: S) -> Self { - self.extensions.push(extension.into()); - self - } - - /// Adds a single main field to the list of fields - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_main_field("something"); - /// assert!(options.main_fields.contains(&"something".to_string())); - /// ``` - #[must_use] - pub fn with_main_field>(mut self, field: S) -> Self { - self.main_fields.push(field.into()); - self - } - - /// Changes how the extension should be treated - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions, EnforceExtension}; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_force_extension(EnforceExtension::Enabled); - /// assert_eq!(options.enforce_extension, EnforceExtension::Enabled); - /// ``` - #[must_use] - pub fn with_force_extension(mut self, enforce_extension: EnforceExtension) -> Self { - self.enforce_extension = enforce_extension; - self - } - - /// Sets the value for [ResolveOptions::fully_specified] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_fully_specified(true); - /// assert_eq!(options.fully_specified, true); - /// ``` - #[must_use] - pub fn with_fully_specified(mut self, fully_specified: bool) -> Self { - self.fully_specified = fully_specified; - self - } - /// Sets the value for [ResolveOptions::prefer_relative] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_prefer_relative(true); - /// assert_eq!(options.prefer_relative, true); - /// ``` - #[must_use] - pub fn with_prefer_relative(mut self, flag: bool) -> Self { - self.prefer_relative = flag; - self - } - /// Sets the value for [ResolveOptions::prefer_absolute] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_prefer_absolute(true); - /// assert_eq!(options.prefer_absolute, true); - /// ``` - #[must_use] - pub fn with_prefer_absolute(mut self, flag: bool) -> Self { - self.prefer_absolute = flag; - self - } - - /// Changes the value of [ResolveOptions::symlinks] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// - /// let options = ResolveOptions::default().with_symbolic_link(false); - /// assert_eq!(options.symlinks, false); - /// ``` - #[must_use] - pub fn with_symbolic_link(mut self, flag: bool) -> Self { - self.symlinks = flag; - self - } - - /// Adds a module to [ResolveOptions::modules] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// - /// let options = ResolveOptions::default().with_module("module"); - /// assert!(options.modules.contains(&"module".to_string())); - /// ``` - #[must_use] - pub fn with_module>(mut self, module: M) -> Self { - self.modules.push(module.into()); - self - } - - /// Adds a main file to [ResolveOptions::main_files] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// - /// let options = ResolveOptions::default().with_main_file("foo"); - /// assert!(options.main_files.contains(&"foo".to_string())); - /// ``` - #[must_use] - pub fn with_main_file>(mut self, module: M) -> Self { - self.main_files.push(module.into()); - self - } - - pub(crate) fn sanitize(mut self) -> Self { - debug_assert!( - self.extensions.iter().filter(|e| !e.is_empty()).all(|e| e.starts_with('.')), - "All extensions must start with a leading dot" - ); - // Set `enforceExtension` to `true` when [ResolveOptions::extensions] contains an empty string. - // See - if self.enforce_extension == EnforceExtension::Auto { - if !self.extensions.is_empty() && self.extensions.iter().any(String::is_empty) { - self.enforce_extension = EnforceExtension::Enabled; - } else { - self.enforce_extension = EnforceExtension::Disabled; - } - } - self - } -} - -/// Value for [ResolveOptions::enforce_extension] -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -pub enum EnforceExtension { - Auto, - Enabled, - Disabled, -} - -impl EnforceExtension { - pub const fn is_auto(&self) -> bool { - matches!(self, Self::Auto) - } - - pub const fn is_enabled(&self) -> bool { - matches!(self, Self::Enabled) - } - - pub const fn is_disabled(&self) -> bool { - matches!(self, Self::Disabled) - } -} - -/// Alias for [ResolveOptions::alias] and [ResolveOptions::fallback] -pub type Alias = Vec<(String, Vec)>; - -/// Alias Value for [ResolveOptions::alias] and [ResolveOptions::fallback] -#[derive(Debug, Clone, Hash, PartialEq, Eq)] -pub enum AliasValue { - /// The path value - Path(String), - - /// The `false` value - Ignore, -} - -impl From for AliasValue -where - S: Into, -{ - fn from(value: S) -> Self { - Self::Path(value.into()) - } -} - -/// Value for [ResolveOptions::restrictions] -#[derive(Debug, Clone)] -pub enum Restriction { - Path(PathBuf), - RegExp(String), -} - -/// Tsconfig Options for [ResolveOptions::tsconfig] -/// -/// Derived from [tsconfig-paths-webpack-plugin](https://github.com/dividab/tsconfig-paths-webpack-plugin#options) -#[derive(Debug, Clone)] -pub struct TsconfigOptions { - /// Allows you to specify where to find the TypeScript configuration file. - /// You may provide - /// * a relative path to the configuration file. It will be resolved relative to cwd. - /// * an absolute path to the configuration file. - pub config_file: PathBuf, - - /// Support for Typescript Project References. - pub references: TsconfigReferences, -} - -/// Configuration for [TsconfigOptions::references] -#[derive(Debug, Clone)] -pub enum TsconfigReferences { - Disabled, - /// Use the `references` field from tsconfig of `config_file`. - Auto, - /// Manually provided relative or absolute path. - Paths(Vec), -} - -impl Default for ResolveOptions { - fn default() -> Self { - Self { - tsconfig: None, - alias: vec![], - alias_fields: vec![], - condition_names: vec![], - description_files: vec!["package.json".into()], - enforce_extension: EnforceExtension::Auto, - extension_alias: vec![], - exports_fields: vec![vec!["exports".into()]], - imports_fields: vec![vec!["imports".into()]], - extensions: vec![".js".into(), ".json".into(), ".node".into()], - fallback: vec![], - fully_specified: false, - main_fields: vec!["main".into()], - main_files: vec!["index".into()], - modules: vec!["node_modules".into()], - resolve_to_context: false, - prefer_relative: false, - prefer_absolute: false, - restrictions: vec![], - roots: vec![], - symlinks: true, - builtin_modules: false, - } - } -} - -// For tracing -impl fmt::Display for ResolveOptions { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - if let Some(tsconfig) = &self.tsconfig { - write!(f, "tsconfig:{tsconfig:?},")?; - } - if !self.alias.is_empty() { - write!(f, "alias:{:?},", self.alias)?; - } - if !self.alias_fields.is_empty() { - write!(f, "alias_fields:{:?},", self.alias_fields)?; - } - if !self.condition_names.is_empty() { - write!(f, "condition_names:{:?},", self.condition_names)?; - } - if self.enforce_extension.is_enabled() { - write!(f, "enforce_extension:{:?},", self.enforce_extension)?; - } - if !self.exports_fields.is_empty() { - write!(f, "exports_fields:{:?},", self.exports_fields)?; - } - if !self.imports_fields.is_empty() { - write!(f, "imports_fields:{:?},", self.imports_fields)?; - } - if !self.extension_alias.is_empty() { - write!(f, "extension_alias:{:?},", self.extension_alias)?; - } - if !self.extensions.is_empty() { - write!(f, "extensions:{:?},", self.extensions)?; - } - if !self.fallback.is_empty() { - write!(f, "fallback:{:?},", self.fallback)?; - } - if self.fully_specified { - write!(f, "fully_specified:{:?},", self.fully_specified)?; - } - if !self.main_fields.is_empty() { - write!(f, "main_fields:{:?},", self.main_fields)?; - } - if !self.main_files.is_empty() { - write!(f, "main_files:{:?},", self.main_files)?; - } - if !self.modules.is_empty() { - write!(f, "modules:{:?},", self.modules)?; - } - if self.resolve_to_context { - write!(f, "resolve_to_context:{:?},", self.resolve_to_context)?; - } - if self.prefer_relative { - write!(f, "prefer_relative:{:?},", self.prefer_relative)?; - } - if self.prefer_absolute { - write!(f, "prefer_absolute:{:?},", self.prefer_absolute)?; - } - if !self.restrictions.is_empty() { - write!(f, "restrictions:{:?},", self.restrictions)?; - } - if !self.roots.is_empty() { - write!(f, "roots:{:?},", self.roots)?; - } - if self.symlinks { - write!(f, "symlinks:{:?},", self.symlinks)?; - } - if self.builtin_modules { - write!(f, "builtin_modules:{:?},", self.builtin_modules)?; - } - Ok(()) - } -} - -#[cfg(test)] -mod test { - use super::{ - AliasValue, EnforceExtension, ResolveOptions, Restriction, TsconfigOptions, - TsconfigReferences, - }; - use std::path::PathBuf; - - #[test] - fn enforce_extension() { - assert!(EnforceExtension::Auto.is_auto()); - assert!(!EnforceExtension::Enabled.is_auto()); - assert!(!EnforceExtension::Disabled.is_auto()); - - assert!(!EnforceExtension::Auto.is_enabled()); - assert!(EnforceExtension::Enabled.is_enabled()); - assert!(!EnforceExtension::Disabled.is_enabled()); - - assert!(!EnforceExtension::Auto.is_disabled()); - assert!(!EnforceExtension::Enabled.is_disabled()); - assert!(EnforceExtension::Disabled.is_disabled()); - } - - #[test] - fn display() { - let options = ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: PathBuf::from("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - alias: vec![("a".into(), vec![AliasValue::Ignore])], - alias_fields: vec![vec!["browser".into()]], - condition_names: vec!["require".into()], - enforce_extension: EnforceExtension::Enabled, - extension_alias: vec![(".js".into(), vec![".ts".into()])], - exports_fields: vec![vec!["exports".into()]], - imports_fields: vec![vec!["imports".into()]], - fallback: vec![("fallback".into(), vec![AliasValue::Ignore])], - fully_specified: true, - resolve_to_context: true, - prefer_relative: true, - prefer_absolute: true, - restrictions: vec![Restriction::Path(PathBuf::from("restrictions"))], - roots: vec![PathBuf::from("roots")], - builtin_modules: true, - ..ResolveOptions::default() - }; - - let expected = r#"tsconfig:TsconfigOptions { config_file: "tsconfig.json", references: Auto },alias:[("a", [Ignore])],alias_fields:[["browser"]],condition_names:["require"],enforce_extension:Enabled,exports_fields:[["exports"]],imports_fields:[["imports"]],extension_alias:[(".js", [".ts"])],extensions:[".js", ".json", ".node"],fallback:[("fallback", [Ignore])],fully_specified:true,main_fields:["main"],main_files:["index"],modules:["node_modules"],resolve_to_context:true,prefer_relative:true,prefer_absolute:true,restrictions:[Path("restrictions")],roots:["roots"],symlinks:true,builtin_modules:true,"#; - assert_eq!(format!("{options}"), expected); - - let options = ResolveOptions { - alias: vec![], - alias_fields: vec![], - builtin_modules: false, - condition_names: vec![], - description_files: vec![], - enforce_extension: EnforceExtension::Disabled, - exports_fields: vec![], - extension_alias: vec![], - extensions: vec![], - fallback: vec![], - fully_specified: false, - imports_fields: vec![], - main_fields: vec![], - main_files: vec![], - modules: vec![], - prefer_absolute: false, - prefer_relative: false, - resolve_to_context: false, - restrictions: vec![], - roots: vec![], - symlinks: false, - tsconfig: None, - }; - - assert_eq!(format!("{options}"), ""); - } -} diff --git a/src/package_json.rs b/src/package_json.rs deleted file mode 100644 index 73901faa..00000000 --- a/src/package_json.rs +++ /dev/null @@ -1,207 +0,0 @@ -//! package.json definitions -//! -//! Code related to export field are copied from [Parcel's resolver](https://github.com/parcel-bundler/parcel/blob/v2/packages/utils/node-resolver-rs/src/package_json.rs) -use std::path::{Path, PathBuf}; - -use serde_json::Value as JSONValue; - -use crate::{path::PathUtil, ResolveError}; - -pub type JSONMap = serde_json::Map; - -/// Deserialized package.json -#[derive(Debug, Default)] -pub struct PackageJson { - /// Path to `package.json`. Contains the `package.json` filename. - pub path: PathBuf, - - /// Realpath to `package.json`. Contains the `package.json` filename. - pub realpath: PathBuf, - - /// The "name" field defines your package's name. - /// The "name" field can be used in addition to the "exports" field to self-reference a package using its name. - /// - /// - pub name: Option, - - raw_json: std::sync::Arc, -} - -impl PackageJson { - /// # Panics - /// # Errors - pub(crate) fn parse( - path: PathBuf, - realpath: PathBuf, - json: &str, - ) -> Result { - let mut raw_json: JSONValue = serde_json::from_str(json)?; - let mut package_json = Self::default(); - - if let Some(json_object) = raw_json.as_object_mut() { - // Remove large fields that are useless for pragmatic use. - #[cfg(feature = "package_json_raw_json_api")] - { - json_object.remove("description"); - json_object.remove("keywords"); - json_object.remove("scripts"); - json_object.remove("dependencies"); - json_object.remove("devDependencies"); - json_object.remove("peerDependencies"); - json_object.remove("optionalDependencies"); - } - - // Add name. - package_json.name = - json_object.get("name").and_then(|field| field.as_str()).map(ToString::to_string); - } - - package_json.path = path; - package_json.realpath = realpath; - package_json.raw_json = std::sync::Arc::new(raw_json); - Ok(package_json) - } - - fn get_value_by_path<'a>( - fields: &'a serde_json::Map, - path: &[String], - ) -> Option<&'a JSONValue> { - if path.is_empty() { - return None; - } - let mut value = fields.get(&path[0])?; - for key in path.iter().skip(1) { - if let Some(inner_value) = value.as_object().and_then(|o| o.get(key)) { - value = inner_value; - } else { - return None; - } - } - Some(value) - } - - /// Raw serde json value of `package.json`. - /// - /// This is currently used in Rspack for: - /// * getting the `sideEffects` field - /// * query in - search on GitHub indicates query on the `type` field. - /// - /// To reduce overall memory consumption, large fields that useless for pragmatic use are removed. - /// They are: `description`, `keywords`, `scripts`, - /// `dependencies` and `devDependencies`, `peerDependencies`, `optionalDependencies`. - #[cfg(feature = "package_json_raw_json_api")] - pub fn raw_json(&self) -> &std::sync::Arc { - &self.raw_json - } - - /// Directory to `package.json` - /// - /// # Panics - /// - /// * When the package.json path is misconfigured. - pub fn directory(&self) -> &Path { - debug_assert!(self.realpath.file_name().is_some_and(|x| x == "package.json")); - self.realpath.parent().unwrap() - } - - /// The "main" field defines the entry point of a package when imported by name via a node_modules lookup. Its value is a path. - /// - /// When a package has an "exports" field, this will take precedence over the "main" field when importing the package by name. - /// - /// Values are dynamically retrieved from [ResolveOptions::main_fields]. - /// - /// - pub(crate) fn main_fields<'a>( - &'a self, - main_fields: &'a [String], - ) -> impl Iterator + '_ { - main_fields - .iter() - .filter_map(|main_field| self.raw_json.get(main_field)) - .filter_map(|value| value.as_str()) - } - - /// The "exports" field allows defining the entry points of a package when imported by name loaded either via a node_modules lookup or a self-reference to its own name. - /// - /// - pub(crate) fn exports_fields<'a>( - &'a self, - exports_fields: &'a [Vec], - ) -> impl Iterator + '_ { - exports_fields.iter().filter_map(|object_path| { - self.raw_json - .as_object() - .and_then(|json_object| Self::get_value_by_path(json_object, object_path)) - }) - } - - /// In addition to the "exports" field, there is a package "imports" field to create private mappings that only apply to import specifiers from within the package itself. - /// - /// - pub(crate) fn imports_fields<'a>( - &'a self, - imports_fields: &'a [Vec], - ) -> impl Iterator + '_ { - imports_fields.iter().filter_map(|object_path| { - self.raw_json - .as_object() - .and_then(|json_object| Self::get_value_by_path(json_object, object_path)) - .and_then(|value| value.as_object()) - }) - } - - /// The "browser" field is provided by a module author as a hint to javascript bundlers or component tools when packaging modules for client side use. - /// Multiple values are configured by [ResolveOptions::alias_fields]. - /// - /// - fn browser_fields<'a>( - &'a self, - alias_fields: &'a [Vec], - ) -> impl Iterator + '_ { - alias_fields.iter().filter_map(|object_path| { - self.raw_json - .as_object() - .and_then(|json_object| Self::get_value_by_path(json_object, object_path)) - // Only object is valid, all other types are invalid - // https://github.com/webpack/enhanced-resolve/blob/3a28f47788de794d9da4d1702a3a583d8422cd48/lib/AliasFieldPlugin.js#L44-L52 - .and_then(|value| value.as_object()) - }) - } - - /// Resolve the request string for this package.json by looking at the `browser` field. - /// - /// # Errors - /// - /// * Returns [ResolveError::Ignored] for `"path": false` in `browser` field. - pub(crate) fn resolve_browser_field<'a>( - &'a self, - path: &Path, - request: Option<&str>, - alias_fields: &'a [Vec], - ) -> Result, ResolveError> { - for object in self.browser_fields(alias_fields) { - if let Some(request) = request { - if let Some(value) = object.get(request) { - return Self::alias_value(path, value); - } - } else { - let dir = self.path.parent().unwrap(); - for (key, value) in object { - let joined = dir.normalize_with(key); - if joined == path { - return Self::alias_value(path, value); - } - } - } - } - Ok(None) - } - - fn alias_value<'a>(key: &Path, value: &'a JSONValue) -> Result, ResolveError> { - match value { - JSONValue::String(value) => Ok(Some(value.as_str())), - JSONValue::Bool(b) if !b => Err(ResolveError::Ignored(key.to_path_buf())), - _ => Ok(None), - } - } -} diff --git a/src/path.rs b/src/path.rs deleted file mode 100644 index f66fdd76..00000000 --- a/src/path.rs +++ /dev/null @@ -1,132 +0,0 @@ -//! Path Utilities -//! -//! Code adapted from the following libraries -//! * [path-absolutize](https://docs.rs/path-absolutize) -//! * [normalize_path](https://docs.rs/normalize-path) -use std::path::{Component, Path, PathBuf}; - -pub const SLASH_START: &[char; 2] = &['/', '\\']; - -/// Extension trait to add path normalization to std's [`Path`]. -pub trait PathUtil { - /// Normalize this path without performing I/O. - /// - /// All redundant separator and up-level references are collapsed. - /// - /// However, this does not resolve links. - fn normalize(&self) -> PathBuf; - - /// Normalize with subpath assuming this path is normalized without performing I/O. - /// - /// All redundant separator and up-level references are collapsed. - /// - /// However, this does not resolve links. - fn normalize_with>(&self, subpath: P) -> PathBuf; - - /// Defined in ESM PACKAGE_TARGET_RESOLVE - /// If target split on "/" or "\" contains any "", ".", "..", or "node_modules" segments after the first "." segment, case insensitive and including percent encoded variants - fn is_invalid_exports_target(&self) -> bool; -} - -impl PathUtil for Path { - // https://github.com/parcel-bundler/parcel/blob/e0b99c2a42e9109a9ecbd6f537844a1b33e7faf5/packages/utils/node-resolver-rs/src/path.rs#L7 - fn normalize(&self) -> PathBuf { - let mut components = self.components().peekable(); - let mut ret = if let Some(c @ Component::Prefix(..)) = components.peek() { - let buf = PathBuf::from(c.as_os_str()); - components.next(); - buf - } else { - PathBuf::new() - }; - - for component in components { - match component { - Component::Prefix(..) => unreachable!("Path {:?}", self), - Component::RootDir => { - ret.push(component.as_os_str()); - } - Component::CurDir => {} - Component::ParentDir => { - ret.pop(); - } - Component::Normal(c) => { - ret.push(c); - } - } - } - - ret - } - - // https://github.com/parcel-bundler/parcel/blob/e0b99c2a42e9109a9ecbd6f537844a1b33e7faf5/packages/utils/node-resolver-rs/src/path.rs#L37 - fn normalize_with>(&self, subpath: B) -> PathBuf { - let subpath = subpath.as_ref(); - - let mut components = subpath.components(); - - let Some(head) = components.next() else { return subpath.to_path_buf() }; - - if matches!(head, Component::Prefix(..) | Component::RootDir) { - return subpath.to_path_buf(); - } - - let mut ret = self.to_path_buf(); - for component in std::iter::once(head).chain(components) { - match component { - Component::CurDir => {} - Component::ParentDir => { - ret.pop(); - } - Component::Normal(c) => { - ret.push(c); - } - Component::Prefix(..) | Component::RootDir => { - unreachable!("Path {:?} Subpath {:?}", self, subpath) - } - } - } - - ret - } - - fn is_invalid_exports_target(&self) -> bool { - self.components().enumerate().any(|(index, c)| match c { - Component::ParentDir => true, - Component::CurDir => index > 0, - Component::Normal(c) => c.eq_ignore_ascii_case("node_modules"), - _ => false, - }) - } -} - -// https://github.com/webpack/enhanced-resolve/blob/main/test/path.test.js -#[test] -fn is_invalid_exports_target() { - let test_cases = [ - "../a.js", - "../", - "./a/b/../../../c.js", - "./a/b/../../../", - "./../../c.js", - "./../../", - "./a/../b/../../c.js", - "./a/../b/../../", - "./././../", - ]; - - for case in test_cases { - assert!(Path::new(case).is_invalid_exports_target(), "{case}"); - } - - assert!(!Path::new("C:").is_invalid_exports_target()); - assert!(!Path::new("/").is_invalid_exports_target()); -} - -#[test] -fn normalize() { - assert_eq!(Path::new("/foo/.././foo/").normalize(), Path::new("/foo")); - assert_eq!(Path::new("C://").normalize(), Path::new("C://")); - assert_eq!(Path::new("C:").normalize(), Path::new("C:")); - assert_eq!(Path::new(r"\\server\share").normalize(), Path::new(r"\\server\share")); -} diff --git a/src/resolution.rs b/src/resolution.rs deleted file mode 100644 index a3aaa2e7..00000000 --- a/src/resolution.rs +++ /dev/null @@ -1,92 +0,0 @@ -use crate::package_json::PackageJson; -use std::{ - fmt, - path::{Path, PathBuf}, - sync::Arc, -}; - -/// The final path resolution with optional `?query` and `#fragment` -#[derive(Clone)] -pub struct Resolution { - pub(crate) path: PathBuf, - - /// path query `?query`, contains `?`. - pub(crate) query: Option, - - /// path fragment `#query`, contains `#`. - pub(crate) fragment: Option, - - pub(crate) package_json: Option>, -} - -impl fmt::Debug for Resolution { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - f.debug_struct("Resolution") - .field("path", &self.path) - .field("query", &self.query) - .field("fragment", &self.fragment) - .field("package_json", &self.package_json.as_ref().map(|p| &p.path)) - .finish() - } -} - -impl PartialEq for Resolution { - fn eq(&self, other: &Self) -> bool { - self.path == other.path && self.query == other.query && self.fragment == other.fragment - } -} -impl Eq for Resolution {} - -impl Resolution { - /// Returns the path without query and fragment - pub fn path(&self) -> &Path { - &self.path - } - - /// Returns the path without query and fragment - pub fn into_path_buf(self) -> PathBuf { - self.path - } - - /// Returns the path query `?query`, contains the leading `?` - pub fn query(&self) -> Option<&str> { - self.query.as_deref() - } - - /// Returns the path fragment `#fragment`, contains the leading `#` - pub fn fragment(&self) -> Option<&str> { - self.fragment.as_deref() - } - - /// Returns serialized package_json - pub fn package_json(&self) -> Option<&Arc> { - self.package_json.as_ref() - } - - /// Returns the full path with query and fragment - pub fn full_path(&self) -> PathBuf { - let mut path = self.path.clone().into_os_string(); - if let Some(query) = &self.query { - path.push(query); - } - if let Some(fragment) = &self.fragment { - path.push(fragment); - } - PathBuf::from(path) - } -} - -#[test] -fn test() { - let resolution = Resolution { - path: PathBuf::from("foo"), - query: Some("?query".to_string()), - fragment: Some("#fragment".to_string()), - package_json: None, - }; - assert_eq!(resolution.path(), Path::new("foo")); - assert_eq!(resolution.query(), Some("?query")); - assert_eq!(resolution.fragment(), Some("#fragment")); - assert_eq!(resolution.full_path(), PathBuf::from("foo?query#fragment")); - assert_eq!(resolution.into_path_buf(), PathBuf::from("foo")); -} diff --git a/src/specifier.rs b/src/specifier.rs deleted file mode 100644 index 3d35eafc..00000000 --- a/src/specifier.rs +++ /dev/null @@ -1,230 +0,0 @@ -use crate::error::SpecifierError; -use std::borrow::Cow; - -#[derive(Debug)] -pub struct Specifier<'a> { - path: Cow<'a, str>, - pub query: Option<&'a str>, - pub fragment: Option<&'a str>, -} - -impl<'a> Specifier<'a> { - pub fn path(&'a self) -> &'a str { - self.path.as_ref() - } - - pub fn parse(specifier: &'a str) -> Result, SpecifierError> { - if specifier.is_empty() { - return Err(SpecifierError::Empty(specifier.to_string())); - } - let offset = match specifier.as_bytes()[0] { - b'/' | b'.' | b'#' => 1, - _ => 0, - }; - let (path, query, fragment) = Self::parse_query_framgment(specifier, offset); - if path.is_empty() { - return Err(SpecifierError::Empty(specifier.to_string())); - } - Ok(Self { path, query, fragment }) - } - - fn parse_query_framgment( - specifier: &'a str, - skip: usize, - ) -> (Cow<'a, str>, Option<&str>, Option<&str>) { - let mut query_start: Option = None; - let mut fragment_start: Option = None; - - let mut prev = specifier.chars().next().unwrap(); - let mut escaped_indexes = vec![]; - for (i, c) in specifier.char_indices().skip(skip) { - if c == '?' && query_start.is_none() { - query_start = Some(i); - } - if c == '#' { - if prev == '\0' { - escaped_indexes.push(i - 1); - } else { - fragment_start = Some(i); - break; - } - } - prev = c; - } - - let (path, query, fragment) = match (query_start, fragment_start) { - (Some(i), Some(j)) => { - debug_assert!(i < j); - (&specifier[..i], Some(&specifier[i..j]), Some(&specifier[j..])) - } - (Some(i), None) => (&specifier[..i], Some(&specifier[i..]), None), - (None, Some(j)) => (&specifier[..j], None, Some(&specifier[j..])), - _ => (specifier, None, None), - }; - - let path = if escaped_indexes.is_empty() { - Cow::Borrowed(path) - } else { - // Remove the `\0` characters for a legal path. - Cow::Owned( - path.chars() - .enumerate() - .filter_map(|(i, c)| (!escaped_indexes.contains(&i)).then_some(c)) - .collect::(), - ) - }; - - (path, query, fragment) - } -} - -#[cfg(test)] -mod tests { - use super::{Specifier, SpecifierError}; - - #[test] - fn debug() { - let specifier = Specifier::parse("/").unwrap(); - assert_eq!( - format!("{specifier:?}"), - r#"Specifier { path: "/", query: None, fragment: None }"# - ); - } - - #[test] - fn empty() { - let specifiers = ["", "?"]; - for specifier in specifiers { - let error = Specifier::parse(specifier).unwrap_err(); - assert_eq!(error, SpecifierError::Empty(specifier.to_string())); - } - } - - #[test] - fn absolute() -> Result<(), SpecifierError> { - let specifier = "/test?#"; - let parsed = Specifier::parse(specifier)?; - assert_eq!(parsed.path, "/test"); - assert_eq!(parsed.query, Some("?")); - assert_eq!(parsed.fragment, Some("#")); - Ok(()) - } - - #[test] - fn relative() -> Result<(), SpecifierError> { - let specifiers = ["./test", "../test", "../../test"]; - for specifier in specifiers { - let mut r = specifier.to_string(); - r.push_str("?#"); - let parsed = Specifier::parse(&r)?; - assert_eq!(parsed.path, specifier); - assert_eq!(parsed.query, Some("?")); - assert_eq!(parsed.fragment, Some("#")); - } - Ok(()) - } - - #[test] - fn hash() -> Result<(), SpecifierError> { - let specifiers = ["#", "#path"]; - for specifier in specifiers { - let mut r = specifier.to_string(); - r.push_str("?#"); - let parsed = Specifier::parse(&r)?; - assert_eq!(parsed.path, specifier); - assert_eq!(parsed.query, Some("?")); - assert_eq!(parsed.fragment, Some("#")); - } - Ok(()) - } - - #[test] - fn module() -> Result<(), SpecifierError> { - let specifiers = ["module"]; - for specifier in specifiers { - let mut r = specifier.to_string(); - r.push_str("?#"); - let parsed = Specifier::parse(&r)?; - assert_eq!(parsed.path, specifier); - assert_eq!(parsed.query, Some("?")); - assert_eq!(parsed.fragment, Some("#")); - } - Ok(()) - } - - #[test] - fn query_fragment() -> Result<(), SpecifierError> { - let data = [ - ("a?", Some("?"), None), - ("a?query", Some("?query"), None), - ("a?query1?query2", Some("?query1?query2"), None), - ("a?query1?query2?query3", Some("?query1?query2?query3"), None), - ("a#", None, Some("#")), - ("a#b#c", None, Some("#b#c")), - ("a#fragment", None, Some("#fragment")), - ("a?#", Some("?"), Some("#")), - ("a?#fragment", Some("?"), Some("#fragment")), - ("a?query#", Some("?query"), Some("#")), - ("a?query#fragment", Some("?query"), Some("#fragment")), - ("a#fragment?", None, Some("#fragment?")), - ("a#fragment?query", None, Some("#fragment?query")), - ]; - - for (specifier_str, query, fragment) in data { - let specifier = Specifier::parse(specifier_str)?; - assert_eq!(specifier.path, "a", "{specifier_str}"); - assert_eq!(specifier.query, query, "{specifier_str}"); - assert_eq!(specifier.fragment, fragment, "{specifier_str}"); - } - - Ok(()) - } - - #[test] - // https://github.com/webpack/enhanced-resolve/blob/main/test/identifier.test.js - fn enhanced_resolve_edge_cases() -> Result<(), SpecifierError> { - let data = [ - ("path/#", "path/", "", "#"), - ("path/as/?", "path/as/", "?", ""), - ("path/#/?", "path/", "", "#/?"), - ("path/#repo#hash", "path/", "", "#repo#hash"), - ("path/#r#hash", "path/", "", "#r#hash"), - ("path/#repo/#repo2#hash", "path/", "", "#repo/#repo2#hash"), - ("path/#r/#r#hash", "path/", "", "#r/#r#hash"), - ("path/#/not/a/hash?not-a-query", "path/", "", "#/not/a/hash?not-a-query"), - ]; - - for (specifier_str, path, query, fragment) in data { - let specifier = Specifier::parse(specifier_str)?; - assert_eq!(specifier.path, path, "{specifier_str}"); - assert_eq!(specifier.query.unwrap_or(""), query, "{specifier_str}"); - assert_eq!(specifier.fragment.unwrap_or(""), fragment, "{specifier_str}"); - } - - Ok(()) - } - - // https://github.com/webpack/enhanced-resolve/blob/main/test/identifier.test.js - #[test] - fn enhanced_resolve_windows_like() -> Result<(), SpecifierError> { - let data = [ - ("path\\#", "path\\", "", "#"), - ("path\\as\\?", "path\\as\\", "?", ""), - ("path\\#\\?", "path\\", "", "#\\?"), - ("path\\#repo#hash", "path\\", "", "#repo#hash"), - ("path\\#r#hash", "path\\", "", "#r#hash"), - ("path\\#repo\\#repo2#hash", "path\\", "", "#repo\\#repo2#hash"), - ("path\\#r\\#r#hash", "path\\", "", "#r\\#r#hash"), - ("path\\#/not/a/hash?not-a-query", "path\\", "", "#/not/a/hash?not-a-query"), - ]; - - for (specifier_str, path, query, fragment) in data { - let specifier = Specifier::parse(specifier_str)?; - assert_eq!(specifier.path, path, "{specifier_str}"); - assert_eq!(specifier.query.unwrap_or(""), query, "{specifier_str}"); - assert_eq!(specifier.fragment.unwrap_or(""), fragment, "{specifier_str}"); - } - - Ok(()) - } -} diff --git a/src/tests/alias.rs b/src/tests/alias.rs deleted file mode 100644 index 07c615f4..00000000 --- a/src/tests/alias.rs +++ /dev/null @@ -1,280 +0,0 @@ -//! - -use normalize_path::NormalizePath; -use std::path::Path; - -use crate::{AliasValue, Resolution, ResolveContext, ResolveError, ResolveOptions, Resolver}; - -#[test] -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -fn alias() { - use super::memory_fs::MemoryFS; - use crate::ResolverGeneric; - use std::path::{Path, PathBuf}; - - let f = Path::new("/"); - - let file_system = MemoryFS::new(&[ - ("/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", ""), - ("/dashed-name", ""), - ]); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - alias: vec![ - ("aliasA".into(), vec![AliasValue::from("a")]), - ("b$".into(), vec![AliasValue::from("a/index")]), - ("c$".into(), vec![AliasValue::from("/a/index")]), - ( - "multiAlias".into(), - vec![ - AliasValue::from("b"), - AliasValue::from("c"), - AliasValue::from("d"), - AliasValue::from("e"), - AliasValue::from("a"), - ], - ), - ("recursive".into(), vec![AliasValue::from("recursive/dir")]), - ("/d/dir".into(), vec![AliasValue::from("/c/dir")]), - ("/d/index.js".into(), vec![AliasValue::from("/c/index")]), - ("#".into(), vec![AliasValue::from("/c/dir")]), - ("@".into(), vec![AliasValue::from("/c/dir")]), - ("ignored".into(), vec![AliasValue::Ignore]), - // not part of enhanced-resolve, added to make sure query in alias value works - ("alias_query".into(), vec![AliasValue::from("a?query_after")]), - ("alias_fragment".into(), vec![AliasValue::from("a#fragment_after")]), - ("dash".into(), vec![AliasValue::Ignore]), - ("@scope/package-name/file$".into(), vec![AliasValue::from("/c/dir")]), - ], - modules: vec!["/".into()], - ..ResolveOptions::default() - }, - ); - - #[rustfmt::skip] - let pass = [ - ("should resolve a not aliased module 1", "a", "/a/index"), - ("should resolve a not aliased module 2", "a/index", "/a/index"), - ("should resolve a not aliased module 3", "a/dir", "/a/dir/index"), - ("should resolve a not aliased module 4", "a/dir/index", "/a/dir/index"), - ("should resolve an aliased module 1", "aliasA", "/a/index"), - ("should resolve an aliased module 2", "aliasA/index", "/a/index"), - ("should resolve an aliased module 3", "aliasA/dir", "/a/dir/index"), - ("should resolve an aliased module 4", "aliasA/dir/index", "/a/dir/index"), - ("should resolve '#' alias 1", "#", "/c/dir/index"), - ("should resolve '#' alias 2", "#/index", "/c/dir/index"), - ("should resolve '@' alias 1", "@", "/c/dir/index"), - ("should resolve '@' alias 2", "@/index", "/c/dir/index"), - ("should resolve a recursive aliased module 1", "recursive", "/recursive/dir/index"), - ("should resolve a recursive aliased module 2", "recursive/index", "/recursive/dir/index"), - ("should resolve a recursive aliased module 3", "recursive/dir", "/recursive/dir/index"), - ("should resolve a recursive aliased module 4", "recursive/dir/index", "/recursive/dir/index"), - ("should resolve a file aliased module 1", "b", "/a/index"), - ("should resolve a file aliased module 2", "c", "/a/index"), - ("should resolve a file aliased module with a query 1", "b?query", "/a/index?query"), - ("should resolve a file aliased module with a query 2", "c?query", "/a/index?query"), - ("should resolve a path in a file aliased module 1", "b/index", "/b/index"), - ("should resolve a path in a file aliased module 2", "b/dir", "/b/dir/index"), - ("should resolve a path in a file aliased module 3", "b/dir/index", "/b/dir/index"), - ("should resolve a path in a file aliased module 4", "c/index", "/c/index"), - ("should resolve a path in a file aliased module 5", "c/dir", "/c/dir/index"), - ("should resolve a path in a file aliased module 6", "c/dir/index", "/c/dir/index"), - ("should resolve a file aliased file 1", "d", "/c/index"), - ("should resolve a file aliased file 2", "d/dir/index", "/c/dir/index"), - ("should resolve a file in multiple aliased dirs 1", "multiAlias/dir/file", "/e/dir/file"), - ("should resolve a file in multiple aliased dirs 2", "multiAlias/anotherDir", "/e/anotherDir/index"), - // not part of enhanced-resolve, added to make sure query in alias value works - ("should resolve query in alias value", "alias_query?query_before", "/a/index?query_after"), - ("should resolve query in alias value", "alias_fragment#fragment_before", "/a/index#fragment_after"), - ("should resolve dashed name", "dashed-name", "/dashed-name"), - ("should resolve scoped package name with sub dir", "@scope/package-name/file", "/c/dir/index"), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - - #[rustfmt::skip] - let ignore = [ - ("should resolve an ignore module", "ignored", ResolveError::Ignored(f.join("ignored"))) - ]; - - for (comment, request, expected) in ignore { - let resolution = resolver.resolve(f, request); - assert_eq!(resolution, Err(expected), "{comment} {request}"); - } -} - -// Not part of enhanced-resolve -#[test] -fn infinite_recursion() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![ - ("./a".into(), vec![AliasValue::from("./b")]), - ("./b".into(), vec![AliasValue::from("./a")]), - ], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(f, "./a"); - assert_eq!(resolution, Err(ResolveError::Recursion)); -} - -fn check_slash(path: &Path) { - let s = path.to_string_lossy().to_string(); - #[cfg(target_os = "windows")] - { - assert!(!s.contains('/'), "{s}"); - assert!(s.contains('\\'), "{s}"); - } - #[cfg(not(target_os = "windows"))] - { - assert!(s.contains('/'), "{s}"); - assert!(!s.contains('\\'), "{s}"); - } -} - -#[test] -fn absolute_path() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![(f.join("foo").to_str().unwrap().to_string(), vec![AliasValue::Ignore])], - modules: vec![f.clone().to_str().unwrap().to_string()], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(&f, "foo/index"); - assert_eq!(resolution, Err(ResolveError::Ignored(f.join("foo")))); -} - -#[test] -fn system_path() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![("@app".into(), vec![AliasValue::from(f.join("alias").to_string_lossy())])], - ..ResolveOptions::default() - }); - - let specifiers = ["@app/files/a", "@app/files/a.js"]; - - for specifier in specifiers { - let path = resolver.resolve(&f, specifier).map(Resolution::into_path_buf).unwrap(); - assert_eq!(path, f.join("alias/files/a.js")); - check_slash(&path); - } -} - -#[test] -fn alias_is_full_path() { - let f = super::fixture(); - let dir = f.join("foo"); - let dir_str = dir.to_string_lossy().to_string(); - - let resolver = Resolver::new(ResolveOptions { - alias: vec![("@".into(), vec![AliasValue::Path(dir_str.clone())])], - ..ResolveOptions::default() - }); - - let mut ctx = ResolveContext::default(); - - let specifiers = [ - "@/index".to_string(), - "@/index.js".to_string(), - // specifier has multiple `/` for reasons we'll never know - "@////index".to_string(), - // specifier is a full path - dir_str, - ]; - - for specifier in specifiers { - let resolution = resolver.resolve_with_context(&f, &specifier, &mut ctx); - assert_eq!(resolution.map(|r| r.full_path()), Ok(dir.join("index.js"))); - } - - for path in ctx.file_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - check_slash(&path); - } - - for path in ctx.missing_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - check_slash(&path); - if let Some(path) = path.parent() { - assert!(!path.is_file(), "{path:?} must not be a file"); - } - } -} - -// For the `should_stop` variable in `load_alias` -#[test] -fn all_alias_values_are_not_found() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![( - "m1".to_string(), - vec![AliasValue::Path(f.join("node_modules").join("m2").to_string_lossy().to_string())], - )], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(&f, "m1/a.js"); - assert_eq!(resolution, Err(ResolveError::NotFound("m1/a.js".to_string()))); -} - -#[test] -fn alias_fragment() { - let f = super::fixture(); - - let data = [ - // enhanced-resolve has `#` prepended with a `\0`, they are removed from the - // following 3 expected test results. - // See https://github.com/webpack/enhanced-resolve#escaping - ( - "handle fragment edge case (no fragment)", - "./no#fragment/#/#", - f.join("no#fragment/#/#.js"), - ), - ("handle fragment edge case (fragment)", "./no#fragment/#/", f.join("no.js#fragment/#/")), - ( - "handle fragment escaping", - "./no\0#fragment/\0#/\0##fragment", - f.join("no#fragment/#/#.js#fragment"), - ), - ]; - - for (comment, request, expected) in data { - let resolver = Resolver::new(ResolveOptions { - alias: vec![("foo".to_string(), vec![AliasValue::Path(request.to_string())])], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f, "foo").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } -} - -#[test] -fn alias_try_fragment_as_path() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![( - "#".to_string(), - vec![AliasValue::Path(f.join("#").to_string_lossy().to_string())], - )], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(&f, "#/a").map(|r| r.full_path()); - assert_eq!(resolution, Ok(f.join("#").join("a.js"))); -} diff --git a/src/tests/browser_field.rs b/src/tests/browser_field.rs deleted file mode 100644 index 171ee099..00000000 --- a/src/tests/browser_field.rs +++ /dev/null @@ -1,189 +0,0 @@ -//! - -use crate::{AliasValue, ResolveError, ResolveOptions, Resolver}; - -#[test] -fn ignore() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![ - vec!["browser".into()], - vec!["innerBrowser1".into()], - vec!["innerBrowser2".into()], - vec![], - ], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - (f.clone(), "./lib/ignore", f.join("lib/ignore.js")), - (f.clone(), "./lib/ignore.js", f.join("lib/ignore.js")), - (f.join("lib"), "./ignore", f.join("lib/ignore.js")), - (f.join("lib"), "./ignore.js", f.join("lib/ignore.js")), - ]; - - for (path, request, expected) in data { - let resolution = resolver.resolve(&path, request); - let expected = ResolveError::Ignored(expected); - assert_eq!(resolution, Err(expected), "{path:?} {request}"); - } -} - -#[test] -fn shared_resolvers() { - let f = super::fixture().join("browser-module"); - - let resolver1 = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["innerBrowser1".into(), "field".into(), "browser".into()]], - ..ResolveOptions::default() - }); - let resolved_path = resolver1.resolve(&f, "./lib/main1.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("lib/main.js"))); - - let resolver2 = resolver1.clone_with_options(ResolveOptions { - alias_fields: vec![vec!["innerBrowser2".into(), "browser".into()]], - ..ResolveOptions::default() - }); - let resolved_path = resolver2.resolve(&f, "./lib/main2.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("./lib/replaced.js"))); -} - -#[test] -fn replace_file() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![ - vec!["browser".into()], - vec!["innerBrowser1".into(), "field2".into(), "browser".into()], // not presented - vec!["innerBrowser1".into(), "field".into(), "browser".into()], - vec!["innerBrowser2".into(), "browser".into()], - ], - // Not part of enhanced-resolve. Added to make sure no interaction between these two fields. - main_fields: vec!["browser".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - ("should replace a file 1", f.clone(), "./lib/replaced", f.join("lib/browser.js")), - ("should replace a file 2", f.clone(), "./lib/replaced.js", f.join("lib/browser.js")), - ("should replace a file 3", f.join("lib"), "./replaced", f.join("lib/browser.js")), - ("should replace a file 4", f.join("lib"), "./replaced.js", f.join("lib/browser.js")), - ("should replace a module with a file 1", f.clone(), "module-a", f.join("browser/module-a.js")), - ("should replace a module with a file 2", f.join("lib"), "module-a", f.join("browser/module-a.js")), - ("should replace a module with a module 1", f.clone(), "module-b", f.join("node_modules/module-c.js")), - ("should replace a module with a module 2", f.join("lib"), "module-b", f.join("node_modules/module-c.js")), - ("should resolve in nested property 1", f.clone(), "./lib/main1.js", f.join("lib/main.js")), - ("should resolve in nested property 2", f.clone(), "./lib/main2.js", f.join("lib/browser.js")), - ("should check only alias field properties", f.clone(), "./toString", f.join("lib/toString.js")), - // not part of enhanced-resolve - ("recursion", f.clone(), "module-c", f.join("node_modules/module-c.js")), - ("resolve self 1", f.clone(), "./lib/main.js", f.join("lib/main.js")), - ("resolve self 2", f.clone(), "./main.js", f.join("lib/main.js")), - ]; - - for (comment, path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn recurse_fail() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - ("recurse non existent", f.clone(), "./lib/non-existent.js", ResolveError::NotFound("./lib/non-existent.js".into())), - ("path partial match 1", f.clone(), "./xyz.js", ResolveError::NotFound("./xyz.js".into())), - ("path partial match 2", f, "./lib/xyz.js", ResolveError::NotFound("./lib/xyz.js".into())), - ]; - - for (comment, path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Err(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn broken() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - // The browser field string value should be ignored - (f.clone(), "browser-module-broken", Ok(f.join("node_modules/browser-module-broken/main.js"))), - (f.join("browser-module"), "./number", Err(ResolveError::NotFound("./number".into()))), - ]; - - for (path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, expected, "{path:?} {request}"); - } -} - -#[test] -fn crypto_js() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - fallback: vec![( - "crypto".into(), - vec![AliasValue::from(f.join("lib.js").to_string_lossy())], - )], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(f.join("crypto-js"), "crypto").map(|r| r.full_path()); - assert_eq!(resolved_path, Err(ResolveError::Ignored(f.join("crypto-js")))); -} - -// https://github.com/webpack/webpack/blob/87660921808566ef3b8796f8df61bd79fc026108/test/cases/resolving/browser-field/index.js#L40-L43 -#[test] -fn recursive() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - let data = [ - ("should handle recursive file 1", f.clone(), "recursive-file/a"), - ("should handle recursive file 2", f.clone(), "recursive-file/b"), - ("should handle recursive file 3", f.clone(), "recursive-file/c"), - ("should handle recursive file 4", f, "recursive-file/d"), - ]; - - for (comment, path, request) in data { - let resolved_path = resolver.resolve(&path, request); - assert_eq!(resolved_path, Err(ResolveError::Recursion), "{comment} {path:?} {request}"); - } -} - -#[test] -fn with_query() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "./foo").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("lib").join("browser.js?query"))); -} diff --git a/src/tests/builtins.rs b/src/tests/builtins.rs deleted file mode 100644 index 5d6d14d9..00000000 --- a/src/tests/builtins.rs +++ /dev/null @@ -1,121 +0,0 @@ -use std::path::Path; - -use crate::{ResolveError, ResolveOptions, Resolver}; - -#[test] -fn builtins_off() { - let f = Path::new("/"); - let resolver = Resolver::default(); - let resolved_path = resolver.resolve(f, "zlib").map(|r| r.full_path()); - assert_eq!(resolved_path, Err(ResolveError::NotFound("zlib".into()))); -} - -#[test] -fn builtins() { - let f = Path::new("/"); - - let resolver = Resolver::new(ResolveOptions::default().with_builtin_modules(true)); - - let pass = [ - "_http_agent", - "_http_client", - "_http_common", - "_http_incoming", - "_http_outgoing", - "_http_server", - "_stream_duplex", - "_stream_passthrough", - "_stream_readable", - "_stream_transform", - "_stream_wrap", - "_stream_writable", - "_tls_common", - "_tls_wrap", - "assert", - "assert/strict", - "async_hooks", - "buffer", - "child_process", - "cluster", - "console", - "constants", - "crypto", - "dgram", - "diagnostics_channel", - "dns", - "dns/promises", - "domain", - "events", - "fs", - "fs/promises", - "http", - "http2", - "https", - "inspector", - "module", - "net", - "os", - "path", - "path/posix", - "path/win32", - "perf_hooks", - "process", - "punycode", - "querystring", - "readline", - "repl", - "stream", - "stream/consumers", - "stream/promises", - "stream/web", - "string_decoder", - "sys", - "timers", - "timers/promises", - "tls", - "trace_events", - "tty", - "url", - "util", - "util/types", - "v8", - "vm", - "worker_threads", - "zlib", - ]; - - for request in pass { - let prefixed_request = format!("node:{request}"); - for request in [prefixed_request.clone(), request.to_string()] { - let resolved_path = resolver.resolve(f, &request).map(|r| r.full_path()); - let err = ResolveError::Builtin(prefixed_request.clone()); - assert_eq!(resolved_path, Err(err), "{request}"); - } - } -} - -#[test] -fn fail() { - let f = Path::new("/"); - let resolver = Resolver::new(ResolveOptions::default().with_builtin_modules(true)); - let request = "xxx"; - let resolved_path = resolver.resolve(f, request); - let err = ResolveError::NotFound(request.to_string()); - assert_eq!(resolved_path, Err(err), "{request}"); -} - -#[test] -fn imports() { - let f = super::fixture().join("builtins"); - let resolver = Resolver::new(ResolveOptions { - builtin_modules: true, - condition_names: vec!["node".into()], - ..ResolveOptions::default() - }); - - for request in ["#fs", "#http"] { - let resolved_path = resolver.resolve(f.clone(), request).map(|r| r.full_path()); - let err = ResolveError::Builtin(format!("node:{}", request.trim_start_matches('#'))); - assert_eq!(resolved_path, Err(err)); - } -} diff --git a/src/tests/dependencies.rs b/src/tests/dependencies.rs deleted file mode 100644 index bcc2355b..00000000 --- a/src/tests/dependencies.rs +++ /dev/null @@ -1,110 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/dependencies.test.js - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows { - use rustc_hash::FxHashSet; - use std::path::PathBuf; - - use crate::{ResolveContext, ResolveOptions, ResolverGeneric}; - - use super::super::memory_fs::MemoryFS; - - fn file_system() -> MemoryFS { - MemoryFS::new(&[ - ("/a/b/node_modules/some-module/index.js", ""), - ("/a/node_modules/module/package.json", r#"{"main":"entry.js"}"#), - ("/a/node_modules/module/file.js", r#"{"main":"entry.js"}"#), - ("/modules/other-module/file.js", ""), - ]) - } - - #[test] - fn test() { - let file_system = file_system(); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - extensions: vec![".json".into(), ".js".into()], - modules: vec!["/modules".into(), "node_modules".into()], - ..ResolveOptions::default() - }, - ); - - let data = [ - ( - "middle module request", - "/a/b/c", - "module/file", - "/a/node_modules/module/file.js", - // These dependencies are different from enhanced-resolve due to different code path to - // querying the file system - vec![ - // 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", - // "/", - ], - vec![ - // missing package.jsons - // "/a/b/c/package.json", - "/a/b/package.json", - "/a/package.json", - "/package.json", - // missing modules directories - "/a/b/c", - // "/a/b/c/node_modules", - // missing single file modules - "/modules/module", - "/a/b/node_modules/module", - // missing files with alternative extensions - "/a/node_modules/module/file", - "/a/node_modules/module/file.json", - ], - ), - ( - "fast found module", - "/a/b/c", - "other-module/file.js", - "/modules/other-module/file.js", - // These dependencies are different from enhanced-resolve due to different code path to - // querying the file system - vec![ - // symlink checks - "/modules/other-module/file.js", - // "/modules/other-module", - // "/modules", - // "/", - ], - vec![ - // missing package.jsons - // "/a/b/c/package.json", - "/a/b/c", - "/a/b/package.json", - "/a/package.json", - "/package.json", - "/modules/other-module/package.json", - "/modules/package.json", - ], - ), - ]; - - for (name, context, request, result, file_dependencies, missing_dependencies) in data { - let mut ctx = ResolveContext::default(); - let path = PathBuf::from(context); - let resolved = - resolver.resolve_with_context(path, request, &mut ctx).map(|r| r.full_path()); - assert_eq!(resolved, Ok(PathBuf::from(result))); - let file_dependencies = - FxHashSet::from_iter(file_dependencies.iter().map(PathBuf::from)); - let missing_dependencies = - FxHashSet::from_iter(missing_dependencies.iter().map(PathBuf::from)); - assert_eq!(ctx.file_dependencies, file_dependencies, "{name}"); - assert_eq!(ctx.missing_dependencies, missing_dependencies, "{name}"); - } - } -} diff --git a/src/tests/exports_field.rs b/src/tests/exports_field.rs deleted file mode 100644 index fd68c1f7..00000000 --- a/src/tests/exports_field.rs +++ /dev/null @@ -1,2546 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/exportsField.test.js -//! -//! The huge exports field test cases are at the bottom of this file. - -use crate::{Ctx, PathUtil, ResolveError, ResolveOptions, Resolver}; -use serde_json::json; -use std::path::Path; - -#[test] -fn test_simple() { - let f = super::fixture().join("exports-field"); - let f2 = super::fixture().join("exports-field2"); - let f4 = super::fixture().join("exports-field-error"); - let f5 = super::fixture().join("imports-exports-wildcard"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - fully_specified: true, - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("resolve root using exports field, not a main field", f.clone(), "exports-field", f.join("node_modules/exports-field/x.js")), - ("resolver should respect condition names", f.clone(), "exports-field/dist/main.js", f.join("node_modules/exports-field/lib/lib2/main.js")), - // enhanced_resolve behaves differently to node.js. enhanced_resolve fallbacks when an - // array item is unresolved, where as node.js fallbacks when an array has an - // InvalidPackageTarget error. - // ("resolver should respect fallback", f2.clone(), "exports-field/dist/browser.js", f2.join("node_modules/exports-field/lib/browser.js")), - // The following two tests require fallback from array values, the path is changed here to - // only test query and fragment. - ("resolver should respect query parameters #1", f2.clone(), "exports-field/dist/main.js?foo", f2.join("node_modules/exports-field/lib/lib2/main.js?foo")), - ("resolver should respect fragment parameters #1", f2.clone(), "exports-field/dist/main.js#foo", f2.join("node_modules/exports-field/lib/lib2/main.js#foo")), - ("relative path should work, if relative path as request is used", f.clone(), "./node_modules/exports-field/lib/main.js", f.join("node_modules/exports-field/lib/main.js")), - ("self-resolving root", f.clone(), "@exports-field/core", f.join("a.js")), - ("should resolve with wildcard pattern #1", f5.clone(), "m/features/f.js", f5.join("node_modules/m/src/features/f.js")), - ("should resolve with wildcard pattern #2", f5.clone(), "m/features/y/y.js", f5.join("node_modules/m/src/features/y/y.js")), - ("should resolve with wildcard pattern #3", f5.clone(), "m/features-no-ext/y/y.js", f5.join("node_modules/m/src/features/y/y.js")), - ("should resolve with wildcard pattern #4", f5.clone(), "m/middle/nested/f.js", f5.join("node_modules/m/src/middle/nested/f.js")), - ("should resolve with wildcard pattern #5", f5.clone(), "m/middle-1/nested/f.js", f5.join("node_modules/m/src/middle-1/nested/f.js")), - ("should resolve with wildcard pattern #6", f5.clone(), "m/middle-2/nested/f.js", f5.join("node_modules/m/src/middle-2/nested/f.js")), - ("should resolve with wildcard pattern #7", f5.clone(), "m/middle-3/nested/f", f5.join("node_modules/m/src/middle-3/nested/f/nested/f.js")), - ("should resolve with wildcard pattern #8", f5.clone(), "m/middle-4/f/nested", f5.join("node_modules/m/src/middle-4/f/f.js")), - ("should resolve with wildcard pattern #9", f5.clone(), "m/middle-5/f$/$", f5.join("node_modules/m/src/middle-5/f$/$.js")), - ]; - - // Not needed or snapshot: - // * should log the correct info - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } - - let p = f.join("node_modules/exports-field/package.json"); - let p2 = f2.join("node_modules/exports-field/package.json"); - let p4 = f4.join("node_modules/exports-field/package.json"); - let p5 = f5.join("node_modules/m/package.json"); - - #[rustfmt::skip] - let fail = [ - // ("throw error if extension not provided", f2.clone(), "exports-field/dist/main", ResolveError::NotFound(f2.join("node_modules/exports-field/lib/lib2/main"))), - ("resolver should respect query parameters #2. Direct matching", f2.clone(), "exports-field?foo", ResolveError::PackagePathNotExported("./?foo".into(), p2.clone())), - ("resolver should respect fragment parameters #2. Direct matching", f2, "exports-field#foo", ResolveError::PackagePathNotExported("./#foo".into(), p2)), - ("relative path should not work with exports field", f.clone(), "./node_modules/exports-field/dist/main.js", ResolveError::NotFound("./node_modules/exports-field/dist/main.js".into())), - ("backtracking should not work for request", f.clone(), "exports-field/dist/../../../a.js", ResolveError::InvalidPackageTarget("./lib/../../../a.js".to_string(), "./dist/".to_string(), p.clone())), - ("backtracking should not work for exports field target", f.clone(), "exports-field/dist/a.js", ResolveError::InvalidPackageTarget("./../../a.js".to_string(), "./dist/a.js".to_string(), p.clone())), - ("not exported error", f.clone(), "exports-field/anything/else", ResolveError::PackagePathNotExported("./anything/else".to_string(), p.clone())), - ("request ending with slash #1", f.clone(), "exports-field/", ResolveError::PackagePathNotExported("./".to_string(), p.clone())), - ("request ending with slash #2", f.clone(), "exports-field/dist/", ResolveError::PackagePathNotExported("./dist/".to_string(), p.clone())), - ("request ending with slash #3", f.clone(), "exports-field/lib/", ResolveError::PackagePathNotExported("./lib/".to_string(), p)), - ("should throw error if target is invalid", f4, "exports-field", ResolveError::InvalidPackageTarget("./a/../b/../../pack1/index.js".to_string(), ".".to_string(), p4)), - ("throw error if exports field is invalid", f.clone(), "invalid-exports-field", ResolveError::InvalidPackageConfig(f.join("node_modules/invalid-exports-field/package.json"))), - ("should throw error if target is 'null'", f5, "m/features/internal/file.js", ResolveError::PackagePathNotExported("./features/internal/file.js".to_string(), p5)), - ]; - - for (comment, path, request, error) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!(resolution, Err(error), "{comment} {path:?} {request}"); - } -} - -// resolve using exports field, not a browser field #1 -#[test] -fn exports_not_browser_field1() { - let f = super::fixture().join("exports-field"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - condition_names: vec!["webpack".into()], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "exports-field/dist/main.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("node_modules/exports-field/lib/lib2/main.js"))); -} - -// resolve using exports field and a browser alias field #2 -#[test] -fn exports_not_browser_field2() { - let f2 = super::fixture().join("exports-field2"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - extensions: vec![".js".into()], - condition_names: vec!["node".into()], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f2, "exports-field/dist/main.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f2.join("node_modules/exports-field/lib/browser.js"))); -} - -// should resolve extension without fullySpecified -#[test] -fn extension_without_fully_specified() { - let f2 = super::fixture().join("exports-field2"); - - let commonjs_resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - let resolved_path = - commonjs_resolver.resolve(&f2, "exports-field/dist/main").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f2.join("node_modules/exports-field/lib/lib2/main.js"))); -} - -#[test] -fn field_name_path() { - let f2 = super::fixture().join("exports-field2"); - let f3 = super::fixture().join("exports-field3"); - - // field name path #1 #2 #3 - let exports_fields = [ - vec![vec!["exportsField".into(), "exports".into()]], - vec![vec!["exportsField".into(), "exports".into()], vec!["exports".into()]], - vec![vec!["exports".into()], vec!["exportsField".into(), "exports".into()]], - ]; - - for exports_fields in exports_fields { - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - exports_fields, - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/main.js"))); - } - - // field name path #4 - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - exports_fields: vec![vec!["exports".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f2, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f2.join("node_modules/exports-field/index.js"))); - - // field name path #5 - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - exports_fields: vec![vec!["ex".into()], vec!["exports_field".into(), "exports".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/index"))); - - // non-compliant export targeting a directory - let resolver = Resolver::new(ResolveOptions { - exports_fields: vec![vec!["broken".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/src/index.js"))); -} - -#[test] -fn shared_resolvers() { - let f3 = super::fixture().join("exports-field3"); - - let resolver1 = Resolver::new(ResolveOptions { - exports_fields: vec![vec!["exportsField".into(), "exports".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver1.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/main.js"))); - - let resolver2 = resolver1.clone_with_options(ResolveOptions { - exports_fields: vec![vec!["ex".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver2.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/index"))); -} - -#[test] -fn extension_alias_1_2() { - let f = super::fixture().join("exports-field-and-extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - extension_alias: vec![(".js".into(), vec![".ts".into(), ".js".into()])], - fully_specified: true, - condition_names: vec!["webpack".into(), "default".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve with the `extensionAlias` option", f.clone(), "@org/pkg/string.js", f.join("node_modules/@org/pkg/dist/string.js")), - ("should resolve with the `extensionAlias` option #2", f.clone(), "pkg/string.js", f.join("node_modules/pkg/dist/string.js")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn extension_alias_3() { - let f = super::fixture().join("exports-field-and-extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - extension_alias: vec![( - ".js".into(), - vec![".foo".into(), ".baz".into(), ".baz".into(), ".ts".into(), ".js".into()], - )], - fully_specified: true, - condition_names: vec!["webpack".into(), "default".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve with the `extensionAlias` option #3", f.clone(), "pkg/string.js", f.join("node_modules/pkg/dist/string.js")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn extension_alias_throw_error() { - let f = super::fixture().join("exports-field-and-extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - extension_alias: vec![(".js".into(), vec![".ts".into()])], - fully_specified: true, - condition_names: vec!["webpack".into(), "default".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let fail = [ - // enhanced-resolve has two test cases that are exactly the same here - // https://github.com/webpack/enhanced-resolve/blob/a998c7d218b7a9ec2461fc4fddd1ad5dd7687485/test/exportsField.test.js#L2976-L3024 - ("should throw error with the `extensionAlias` option", f, "pkg/string.js", ResolveError::ExtensionAlias), - // TODO: The error is PackagePathNotExported in enhanced-resolve - // ("should throw error with the `extensionAlias` option", f.clone(), "pkg/string.js", ResolveError::PackagePathNotExported("node_modules/pkg/dist/string.ts".to_string())), - ]; - - for (comment, path, request, error) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!(resolution, Err(error), "{comment} {path:?} {request}"); - } -} - -// Small script for generating the test cases from enhanced-resolve -// for (c of testCases) { -// console.log("TestCase {") -// console.log(`name: ${JSON.stringify(c.name)},`) -// if (c.expect instanceof Error) { -// console.log(`expect: None,`) -// } else { -// console.log(`expect: Some(vec!${JSON.stringify(c.expect)}),`) -// } -// console.log(`exports_field: exports_field(json!(${JSON.stringify(c.suite[0], null, 2)})),`) -// console.log(`request: "${c.suite[1]}",`) -// console.log(`condition_names: vec!${JSON.stringify(c.suite[2])},`) -// console.log("},") -//} -struct TestCase { - name: &'static str, - expect: Option>, - exports_field: serde_json::Value, - request: &'static str, - condition_names: Vec<&'static str>, -} - -#[allow(clippy::needless_pass_by_value)] -fn exports_field(value: serde_json::Value) -> serde_json::Value { - value -} - -#[test] -fn test_cases() { - let test_cases = [ - TestCase { - name: "sample #1", - expect: Some(vec!["./dist/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/": { - "import": [ - "./dist/", - "./src/" - ], - "webpack": "./wp/" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "sample #1", - expect: Some(vec!["./src/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/": { - "import": [ - "./src/" - ], - "webpack": "./wp/" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - TestCase { - name: "sample #1 (wildcard)", - expect: Some(vec!["./dist/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/*": { - "import": [ - "./dist/*", - "./src/*" - ], - "webpack": "./wp/*" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "sample #1 (wildcard)", - expect: Some(vec!["./src/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/*": { - "import": [ - "./src/*" - ], - "webpack": "./wp/*" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - TestCase { - name: "sample #2", - expect: Some(vec!["./data/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./timezones/": "./data/timezones/" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #2 (wildcard)", - expect: Some(vec!["./data/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./timezones/*": "./data/timezones/*" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #3", - expect: Some(vec!["./data/timezones/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./": "./data/timezones/" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #3 (wildcard)", - expect: Some(vec!["./data/timezones/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./*": "./data/timezones/*.mjs" - })), - request: "./timezones/pdt", - condition_names: vec![], - }, - TestCase { - name: "sample #4", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./lib/": { - "browser": [ - "./browser/" - ] - }, - "./dist/index.js": { - "node": "./index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #4 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "node": "./index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #5", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/": { - "browser": [ - "./browser/" - ] - }, - "./dist/index.js": { - "node": "./index.js", - "default": "./browser/index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #5 (wildcard)", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "node": "./index.js", - "default": "./browser/index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./dist/a": "./dist/index.js" - })), - request: "./dist/aaa", - condition_names: vec![], - }, - TestCase { - name: "sample #7", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./dist/a/a/": "./dist/index.js" - })), - request: "./dist/a/a", - condition_names: vec![], - }, - TestCase { - name: "sample #7 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./dist/a/a/*": "./dist/index.js" - })), - request: "./dist/a/a", - condition_names: vec![], - }, - TestCase { - name: "sample #8", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": "./index.js" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #9", - expect: Some(vec!["./main.js"]), - exports_field: exports_field(json!({ - "./index.js": "./main.js" - })), - request: "./index.js", - condition_names: vec![], - }, - TestCase { - name: "sample #10", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #11", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./bar#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #12", - expect: Some(vec!["./ok.js#abc"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/ok.js#abc", - condition_names: vec![], - }, - TestCase { - name: "sample #12", - expect: Some(vec!["./ok.js#abc"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/ok.js#abc", - condition_names: vec![], - }, - TestCase { - name: "sample #13", - expect: Some(vec!["./ok.js?abc"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/ok.js?abc", - condition_names: vec![], - }, - TestCase { - name: "sample #14", - expect: Some(vec!["./🎉.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/🎉.js", - condition_names: vec![], - }, - TestCase { - name: "sample #15", - expect: Some(vec!["./%F0%9F%8E%89.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/%F0%9F%8E%89.js", - condition_names: vec![], - }, - TestCase { - name: "sample #16", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./🎉", - condition_names: vec![], - }, - TestCase { - name: "sample #17", - expect: Some(vec!["./other.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./%F0%9F%8E%89", - condition_names: vec![], - }, - TestCase { - name: "sample #18", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./module", - condition_names: vec![], - }, - TestCase { - name: "sample #19", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./module#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #20", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./module?foo", - condition_names: vec![], - }, - TestCase { - name: "sample #21", - expect: Some(vec!["./zizizi"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./z*z*z*" - })), - request: "./#zippi", - condition_names: vec![], - }, - TestCase { - name: "sample #22", - expect: Some(vec!["./d?e?f"]), - exports_field: exports_field(json!({ - "./a?b?c/": "./" - })), - request: "./a?b?c/d?e?f", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #1", - expect: Some(vec!["./dist/index.js"]), - exports_field: exports_field(json!({ - ".": "./dist/index.js" - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #2", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./": "./", - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #3", - expect: Some(vec!["./dist/a.js"]), - exports_field: exports_field(json!({ - "./dist/": "./dist/", - "./dist/*": "./dist/*", - "./dist*": "./dist*", - "./dist/index.js": "./dist/a.js" - })), - request: "./dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #4", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./": { - "browser": [ - "./browser/" - ] - }, - "./*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "browser": "./index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #5", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./": { - "browser": [ - "./browser/" - ] - }, - "./*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "node": "./node.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #6", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - ".": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #7", - expect: Some(vec!["./src/index.js"]), // `enhanced_resolve` is `None` - exports_field: exports_field(json!({ - ".": { - "default": "./src/index.js", - "browser": "./index.js", - "node": "./src/node/index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #8", - expect: Some(vec!["./src/index.js"]), - exports_field: exports_field(json!({ - ".": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #9", - expect: Some(vec!["./index"]), - exports_field: exports_field(json!({ - ".": "./index" - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #10", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./index": "./index.js" - })), - request: "./index", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #11", - expect: Some(vec!["./foo.js"]), - exports_field: exports_field(json!({ - "./": "./", - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #12", - expect: Some(vec!["./foo/bar/baz.js"]), - exports_field: exports_field(json!({ - "./": "./", - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo/bar/baz.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #13", - expect: Some(vec!["./foo/bar/baz.js"]), - exports_field: exports_field(json!({ - "./": "./", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo/bar/baz.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #14", - expect: Some(vec!["./foo/bar/baz.js"]), - exports_field: exports_field(json!({ - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo/bar/baz.js", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #1", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "require": "./require.js" - }, { - "import": "./import.mjs" - }] - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #2", - expect: Some(vec!["./import.mjs"]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "require": "./require.js" - }, { - "import": "./import.mjs" - }] - })), - request: ".", - condition_names: vec!["import"], - }, - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./require.js"]), - exports_field: exports_field(json!({ - ".": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./import.mjs"]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "import": "./import.mjs" - }] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./require.js"]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "require": [ - "./require.js" - ] - }, { - "import": [ - "./import.mjs", - "./import.js" - ] - }] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./import.mjs"]), - exports_field: exports_field(json!({ - ".": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "./import.mjs", - "./import.js" - ] - } - ] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./import.js"]), - exports_field: exports_field(json!({ - ".": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "./import.js" - ] - } - ] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "mapping to a folder root #1", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./timezones": "./data/timezones/" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #2", - expect: None, - exports_field: exports_field(json!({ - "./timezones/": "./data/timezones" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #3", - expect: Some(vec!["./data/timezones/pdt/index.mjs"]), - exports_field: exports_field(json!({ - "./timezones/pdt/": "./data/timezones/pdt/" - })), - request: "./timezones/pdt/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #3 (wildcard)", - expect: Some(vec!["./data/timezones/pdt/index.mjs"]), - exports_field: exports_field(json!({ - "./timezones/pdt/*": "./data/timezones/pdt/*" - })), - request: "./timezones/pdt/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #4", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./": "./timezones/" - })), - request: "./pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #4 (wildcard)", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./*": "./timezones/*" - })), - request: "./pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #5", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./": "./" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #5 (wildcard)", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./*": "./*" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #6", - expect: None, - exports_field: exports_field(json!({ - "./": "." - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #6 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "./*": "." - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #7", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": "./" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #7 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": "./*" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #1", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./": "./", - "./dist/": "./lib/" - })), - request: "./dist/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #1 (wildcard)", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./*": "./*", - "./dist/*": "./lib/*" - })), - request: "./dist/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #2", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/": "./dist/utils/", - "./dist/": "./lib/" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #2 (wildcard)", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/*": "./dist/utils/*", - "./dist/*": "./lib/*" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #3", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/index.js": "./dist/utils/index.js", - "./dist/utils/": "./dist/utils/index.mjs", - "./dist/": "./lib/" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #3 (wildcard)", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/index.js": "./dist/utils/index.js", - "./dist/utils/*": "./dist/utils/index.mjs", - "./dist/*": "./lib/*" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #4", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./": { - "browser": "./browser/" - }, - "./dist/": "./lib/" - })), - request: "./dist/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "the longest matching path prefix is prioritized #4 (wildcard)", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./*": { - "browser": "./browser/*" - }, - "./dist/*": "./lib/*" - })), - request: "./dist/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #1", - // `lodash/` does not start with './' so fallbacks to util - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "conditional mapping folder #1", - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": [ - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #1 (wildcard)", - // `lodash/` does not start with './' so fallbacks to util - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": [ - "lodash/*", - "./utils/*" - ], - "node": [ - "./utils-node/*" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "conditional mapping folder #1 (wildcard)", - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": [ - "./utils/*" - ], - "node": [ - "./utils-node/*" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #2", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./node/" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "conditional mapping folder #2 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "webpack": "./wpk/*", - "browser": [ - "lodash/*", - "./utils/*" - ], - "node": [ - "./node/*" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "conditional mapping folder #3", - expect: Some(vec!["./wpk/index.mjs"]), - exports_field: exports_field(json!({ - "./utils/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils/" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "conditional mapping folder #3 (wildcard)", - expect: Some(vec!["./wpk/index.mjs"]), - exports_field: exports_field(json!({ - "./utils/*": { - "webpack": "./wpk/*", - "browser": [ - "lodash/*", - "./utils/*" - ], - "node": [ - "./utils/*" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "incorrect exports field #1", - expect: None, - exports_field: exports_field(json!({ - "/utils/": "./a/" - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #2", - expect: None, - exports_field: exports_field(json!({ - "./utils/": "/a/" - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #3", - expect: None, - exports_field: exports_field(json!({ - "/utils/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #4", - expect: None, - exports_field: exports_field(json!({ - "./utils/": { - "browser": "/a/", - "default": "/b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #4 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "/a/", - "default": "/b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #5", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index": "./a/index.js" - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index.mjs": "./a/index.js" - })), - request: "./utils/index", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #7", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #8", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index.mjs": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - // Requests that are not `./` does not apply to `package_exports_resolve` - // TestCase { - // name: "incorrect request #1", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": "./a/" - // })), - // request: "/utils/index.mjs", - // condition_names: vec![], - // }, - // TestCase { - // name: "incorrect request #2", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": { - // "browser": "./a/", - // "default": "./b/" - // } - // })), - // request: "/utils/index.mjs", - // condition_names: vec!["browser"], - // }, - // TestCase { - // name: "incorrect request #3", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": { - // "browser": "./a/", - // "default": "./b/" - // } - // })), - // request: "../utils/index.mjs", - // condition_names: vec!["browser"], - // }, - // TestCase { - // name: "incorrect request #4", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": { - // "browser": "./a/", - // "default": "./b/" - // } - // })), - // request: "/utils/index.mjs/", - // condition_names: vec!["browser"], - // }, - TestCase { - name: "backtracking package base #1", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./../../utils/": "./dist/" - })), - request: "./../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #1 (wildcard)", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./../../utils/*": "./dist/*" - })), - request: "./../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #2", - expect: None, - exports_field: exports_field(json!({ - "../../utils/": "./dist/" - })), - request: "../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #2 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "../../utils/*": "./dist/*" - })), - request: "../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #3", - expect: None, - exports_field: exports_field(json!({ - "./utils/": "../src/" - })), - request: "./utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #3 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "./utils/*": "../src/*" - })), - request: "./utils/index", - condition_names: vec![], - }, - // enhanced-resolve does not handle backtracking here - // TestCase { - // name: "backtracking package base #4", - // expect: Some(vec!["./../src/index"]), - // exports_field: exports_field(json!({ - // "./utils/": "./../src/" - // })), - // request: "./utils/index", - // condition_names: vec![], - // }, - // TestCase { - // name: "backtracking package base #4 (wildcard)", - // expect: Some(vec!["./../src/index"]), - // exports_field: exports_field(json!({ - // "./utils/*": "./../src/*" - // })), - // request: "./utils/index", - // condition_names: vec![], - // }, - // TestCase { - // name: "backtracking package base #5", - // expect: Some(vec!["./src/../index.js"]), - // exports_field: exports_field(json!({ - // "./utils/index": "./src/../index.js" - // })), - // request: "./utils/index", - // condition_names: vec![], - // }, - TestCase { - name: "backtracking package base #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/../utils/index": "./src/../index.js" - })), - request: "./utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #7", - expect: None, - exports_field: exports_field(json!({ - "./utils/": { - "browser": "../this/" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #7", - expect: None, - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "../this/*" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #8", - // We throw "InvalidPackageTarget" - // expect: Some(vec!["./utils/../index"]), - expect: None, - exports_field: exports_field(json!({ - "./utils/": { - "browser": "./utils/../" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #8 (wildcard)", - // We throw "InvalidPackageTarget" - // expect: Some(vec!["./utils/../index"]), - expect: None, - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "./utils/../*" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #9", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./": "./src/../../", - "./dist/": "./dist/" - })), - request: "./dist/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #9 (wildcard)", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./*": "./src/../../*", - "./dist/*": "./dist/*" - })), - request: "./dist/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking target folder #1", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../../index"]), - exports_field: exports_field(json!({ - "./utils/": "./dist/" - })), - request: "./utils/timezone/../../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #1 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../../index"]), - exports_field: exports_field(json!({ - "./utils/*": "./dist/*" - })), - request: "./utils/timezone/../../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #2", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../index"]), - exports_field: exports_field(json!({ - "./utils/": "./dist/" - })), - request: "./utils/timezone/../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #2 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../index"]), - exports_field: exports_field(json!({ - "./utils/*": "./dist/*" - })), - request: "./utils/timezone/../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #3", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/target/../../index"]), - exports_field: exports_field(json!({ - "./utils/": "./dist/target/" - })), - request: "./utils/../../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #3 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/target/../../index"]), - exports_field: exports_field(json!({ - "./utils/*": "./dist/target/*" - })), - request: "./utils/../../index", - condition_names: vec![], - }, - // enhanced-resolve does not handle `node_modules` in target - TestCase { - name: "nested node_modules path #1", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": "./node_modules/" - } - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #1 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "./node_modules/*" - } - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #2", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./utils/../node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/": "./utils/../node_modules/" - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "nested node_modules path #2 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./utils/../node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": "./utils/../node_modules/*" - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "nested mapping #1", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": "./", - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested mapping #1 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": "./*", - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "nested mapping #2 (wildcard)", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #2 (wildcard)", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "nested mapping #3", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["webpack"], - }, - TestCase { - name: "nested mapping #3 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["webpack"], - }, - TestCase { - name: "nested mapping #4", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["node", "browser"], - }, - TestCase { - name: "nested mapping #4 (wildcard)", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["node", "browser"], - }, - TestCase { - name: "nested mapping #5", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node"], - }, - TestCase { - name: "nested mapping #5 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": { - "webpack": [ - "./wpck/*" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node"], - }, - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - TestCase { - name: "nested mapping #6 (wildcard)", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": { - "webpack": [ - "./wpck/*" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #6 (wildcard)", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./node/*" - ], - "default": { - "node": { - "webpack": [ - "./wpck/*" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - TestCase { - name: "nested mapping #7", - expect: Some(vec!["./y.js"]), - exports_field: exports_field(json!({ - "./a.js": { - "abc": { - "def": "./x.js" - }, - "ghi": "./y.js" - } - })), - request: "./a.js", - condition_names: vec!["abc", "ghi"], - }, - TestCase { - name: "nested mapping #8", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./a.js": { - "abc": { - "def": "./x.js", - "default": [] - }, - "ghi": "./y.js" - } - })), - request: "./a.js", - condition_names: vec!["abc", "ghi"], - }, - TestCase { - name: "syntax sugar #1", - expect: Some(vec!["./main.js"]), - exports_field: exports_field(json!("./main.js")), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #2", - expect: Some(vec![]), - exports_field: exports_field(json!("./main.js")), - request: "./lib.js", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #3", - expect: Some(vec!["./a.js"]), - exports_field: exports_field(json!(["./a.js", "./b.js"])), - request: ".", - condition_names: vec![], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "syntax sugar #3", - expect: Some(vec!["./b.js"]), - exports_field: exports_field(json!(["./b.js"])), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #4", - expect: Some(vec![]), - exports_field: exports_field(json!(["./a.js", "./b.js"])), - request: "./lib.js", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #5", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "browser": { - "default": "./index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "syntax sugar #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "browser": { - "default": "./index.js" - } - })), - request: "./lib.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "syntax sugar #7", - expect: None, - exports_field: exports_field(json!({ - "./node": "./node.js", - "browser": { - "default": "./index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "syntax sugar #8", - expect: None, - exports_field: exports_field(json!({ - "browser": { - "default": "./index.js" - }, - "./node": "./node.js" - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #1", - expect: Some(vec!["./abc/d"]), - exports_field: exports_field(json!({ - "./ab*": "./ab/*", - "./abc*": "./abc/*", - "./a*": "./a/*" - })), - request: "./abcd", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #2", - expect: Some(vec!["./abc/d/e"]), - exports_field: exports_field(json!({ - "./ab*": "./ab/*", - "./abc*": "./abc/*", - "./a*": "./a/*" - })), - request: "./abcd/e", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #3", - expect: Some(vec!["./abc/d"]), - exports_field: exports_field(json!({ - "./x/ab*": "./ab/*", - "./x/abc*": "./abc/*", - "./x/a*": "./a/*" - })), - request: "./x/abcd", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #4", - expect: Some(vec!["./abc/d/e"]), - exports_field: exports_field(json!({ - "./x/ab*": "./ab/*", - "./x/abc*": "./abc/*", - "./x/a*": "./a/*" - })), - request: "./x/abcd/e", - condition_names: vec!["browser"], - }, - TestCase { - name: "path tree edge case #1", - expect: Some(vec!["./A/b/d.js"]), - exports_field: exports_field(json!({ - "./a/": "./A/", - "./a/b/c": "./c.js" - })), - request: "./a/b/d.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #1 (wildcard)", - expect: Some(vec!["./A/b/d.js"]), - exports_field: exports_field(json!({ - "./a/*": "./A/*", - "./a/b/c": "./c.js" - })), - request: "./a/b/d.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #2", - expect: Some(vec!["./A/c.js"]), - exports_field: exports_field(json!({ - "./a/": "./A/", - "./a/b": "./b.js" - })), - request: "./a/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #2 (wildcard)", - expect: Some(vec!["./A/c.js"]), - exports_field: exports_field(json!({ - "./a/*": "./A/*", - "./a/b": "./b.js" - })), - request: "./a/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #3", - expect: Some(vec!["./A/b/d/c.js"]), - exports_field: exports_field(json!({ - "./a/": "./A/", - "./a/b/c/d": "./c.js" - })), - request: "./a/b/d/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #3 (wildcard)", - expect: Some(vec!["./A/b/d/c.js"]), - exports_field: exports_field(json!({ - "./a/*": "./A/*", - "./a/b/c/d": "./c.js" - })), - request: "./a/b/d/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #1", - expect: Some(vec!["./A/b.js"]), - exports_field: exports_field(json!({ - "./a/*.js": "./A/*.js" - })), - request: "./a/b.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #2", - expect: Some(vec!["./A/b/c.js"]), - exports_field: exports_field(json!({ - "./a/*.js": "./A/*.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #3", - expect: Some(vec!["./A/b/c.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": "./A/*/c.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #4", - expect: Some(vec!["./A/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": "./A/*/*.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #5", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/*.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #5", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/*.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./lib/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #6", - expect: Some(vec!["./browser/foo/bar.js"]), - exports_field: exports_field(json!({ - "./lib/*/bar.js": { - "browser": [ - "./browser/*/bar.js" - ] - }, - "./dist/*/bar.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./lib/foo/bar.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #6", - expect: Some(vec!["./browser/foo.js"]), - exports_field: exports_field(json!({ - "./lib/*/bar.js": { - "browser": [ - "./browser/*/bar.js" - ] - }, - "./dist/*/bar.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./dist/foo/bar.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #7", - expect: Some(vec!["./browser/foo/default.js"]), - exports_field: exports_field(json!({ - "./lib/*/bar.js": { - "browser": [ - "./browser/*/bar.js" - ] - }, - "./dist/*/bar.js": { - "node": "./*.js", - "default": "./browser/*/default.js" - } - })), - request: "./dist/foo/bar.js", - condition_names: vec!["default"], - }, - TestCase { - name: "wildcard pattern #8", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": "./A/*/*/*.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #9", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": [ - "./A/*/*/*.js", - "./B/*/*/*.js" - ] - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "wildcard pattern #9", - expect: Some(vec!["./B/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": [ - "./B/*/*/*.js" - ] - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #10", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/foo-*/c.js": "./A/*/*/*.js" - })), - request: "./a/foo-b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #11", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*-foo/c.js": "./A/*/*/*.js" - })), - request: "./a/b-foo/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #12", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/foo-*-foo/c.js": "./A/*/*/*.js" - })), - request: "./a/foo-b-foo/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #13", - expect: Some(vec!["./A/b/c/d.js"]), - exports_field: exports_field(json!({ - "./a/foo-*-foo/c.js": "./A/b/c/d.js" - })), - request: "./a/foo-b-foo/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #14", - expect: Some(vec!["./A/b/c/*.js"]), - exports_field: exports_field(json!({ - "./a/foo-foo/c.js": "./A/b/c/*.js" - })), - request: "./a/foo-foo/c.js", - condition_names: vec![], - }, - ]; - - for case in test_cases { - let resolved = Resolver::new(ResolveOptions { - condition_names: case - .condition_names - .iter() - .map(ToString::to_string) - .collect::>(), - ..ResolveOptions::default() - }) - .package_exports_resolve( - Path::new(""), - case.request, - &case.exports_field, - &mut Ctx::default(), - ) - .map(|p| p.map(|p| p.to_path_buf())); - if let Some(expect) = case.expect { - if expect.is_empty() { - assert!( - matches!(resolved, Err(ResolveError::PackagePathNotExported(_, _))), - "{} {:?}", - &case.name, - &resolved - ); - } else { - for expect in expect { - assert_eq!(resolved, Ok(Some(Path::new(expect).normalize())), "{}", &case.name); - } - } - } else { - assert!(resolved.is_err(), "{} {resolved:?}", &case.name); - } - } -} diff --git a/src/tests/extension_alias.rs b/src/tests/extension_alias.rs deleted file mode 100644 index 86afab73..00000000 --- a/src/tests/extension_alias.rs +++ /dev/null @@ -1,66 +0,0 @@ -//! - -use crate::{ResolveError, ResolveOptions, Resolver}; - -#[test] -fn extension_alias() { - let f = super::fixture().join("extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - extension_alias: vec![ - (".js".into(), vec![".ts".into(), ".js".into()]), - (".mjs".into(), vec![".mts".into()]), - ], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should alias fully specified file", f.clone(), "./index.js", f.join("index.ts")), - ("should alias fully specified file when there are two alternatives", f.clone(), "./dir/index.js", f.join("dir/index.ts")), - ("should also allow the second alternative", f.clone(), "./dir2/index.js", f.join("dir2/index.js")), - ("should support alias option without an array", f.clone(), "./dir2/index.mjs", f.join("dir2/index.mts")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } - - #[rustfmt::skip] - let fail = [ - ("should not allow to fallback to the original extension or add extensions", f, "./index.mjs"), - ]; - - for (comment, path, request) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!(resolution, Err(ResolveError::ExtensionAlias), "{comment} {path:?} {request}"); - } -} - -// should not apply extension alias to extensions or mainFiles field -#[test] -fn not_apply_to_extension_nor_main_files() { - let f = super::fixture().join("extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - extension_alias: vec![(".js".into(), vec![])], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("directory", f.clone(), "./dir2", "dir2/index.js"), - ("file", f.clone(), "./dir2/index", "dir2/index.js"), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - let expected = f.join(expected); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} diff --git a/src/tests/extensions.rs b/src/tests/extensions.rs deleted file mode 100644 index 1ebd86f4..00000000 --- a/src/tests/extensions.rs +++ /dev/null @@ -1,125 +0,0 @@ -//! - -use crate::{EnforceExtension, Resolution, ResolveContext, ResolveError, ResolveOptions, Resolver}; -use rustc_hash::FxHashSet; - -#[test] -fn extensions() { - let f = super::fixture().join("extensions"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".ts".into(), ".js".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve according to order of provided extensions", "./foo", "foo.ts"), - ("should resolve according to order of provided extensions (dir index)", "./dir", "dir/index.ts"), - ("should resolve according to main field in module root", ".", "index.js"), - // This is a core module - // ("should resolve single file module before directory", "module", "node_modules/module.js"), - ("should resolve trailing slash directory before single file", "module/", "node_modules/module/index.ts"), - ]; - - for (comment, request, expected_path) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - let expected = f.join(expected_path); - assert_eq!(resolved_path, Ok(expected), "{comment} {request} {expected_path}"); - } - - #[rustfmt::skip] - let fail = [ - ("not resolve to file when request has a trailing slash (relative)", "./foo.js/", "./foo.js/".into()) - ]; - - for (comment, request, expected_error) in fail { - let resolution = resolver.resolve(&f, request); - let error = ResolveError::NotFound(expected_error); - assert_eq!(resolution, Err(error), "{comment} {request} {resolution:?}"); - } -} - -// should default enforceExtension to true when extensions includes an empty string -#[test] -fn default_enforce_extension() { - let f = super::fixture().join("extensions"); - - let mut ctx = ResolveContext::default(); - let resolved = Resolver::new(ResolveOptions { - extensions: vec![".ts".into(), String::new(), ".js".into()], - ..ResolveOptions::default() - }) - .resolve_with_context(&f, "./foo", &mut ctx); - - assert_eq!(resolved.map(Resolution::into_path_buf), Ok(f.join("foo.ts"))); - assert_eq!( - ctx.file_dependencies, - FxHashSet::from_iter([f.join("foo.ts"), f.join("package.json")]) - ); - assert!(ctx.missing_dependencies.is_empty()); -} - -// should respect enforceExtension when extensions includes an empty string -#[test] -fn respect_enforce_extension() { - let f = super::fixture().join("extensions"); - - let mut ctx = ResolveContext::default(); - let resolved = Resolver::new(ResolveOptions { - enforce_extension: EnforceExtension::Disabled, - extensions: vec![".ts".into(), String::new(), ".js".into()], - ..ResolveOptions::default() - }) - .resolve_with_context(&f, "./foo", &mut ctx); - - assert_eq!(resolved.map(Resolution::into_path_buf), Ok(f.join("foo.ts"))); - assert_eq!( - ctx.file_dependencies, - FxHashSet::from_iter([f.join("foo.ts"), f.join("package.json")]) - ); - assert_eq!(ctx.missing_dependencies, FxHashSet::from_iter([f.join("foo")])); -} - -#[test] -fn multi_dot_extension() { - let f = super::fixture().join("extensions"); - - let resolver = Resolver::new(ResolveOptions { - // Test for `.d.ts`, not part of enhanced-resolve. - extensions: vec![".a.b.c".into(), ".d.ts".into(), ".ts".into(), ".js".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve according to order of provided extensions", "./foo", "foo.ts"), - ("should resolve file with extension", "./app.module", "app.module.js") - ]; - - for (comment, request, expected_path) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - let expected = f.join(expected_path); - assert_eq!(resolved_path, Ok(expected), "{comment} {request} {expected_path}"); - } - - #[rustfmt::skip] - let fail = [ - ("not resolve to file", "./index.", "./index.".into()) - ]; - - for (comment, request, expected_error) in fail { - let resolution = resolver.resolve(&f, request); - let error = ResolveError::NotFound(expected_error); - assert_eq!(resolution, Err(error), "{comment} {request} {resolution:?}"); - } -} - -#[test] -#[should_panic = "All extensions must start with a leading dot"] -fn without_leading_dot() { - Resolver::new(ResolveOptions { - extensions: vec!["ts".into(), "js".into()], - ..ResolveOptions::default() - }); -} diff --git a/src/tests/fallback.rs b/src/tests/fallback.rs deleted file mode 100644 index 3da2d767..00000000 --- a/src/tests/fallback.rs +++ /dev/null @@ -1,100 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/fallback.test.js - -#[test] -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -fn fallback() { - use super::memory_fs::MemoryFS; - use crate::{AliasValue, ResolveError, ResolveOptions, ResolverGeneric}; - use std::path::{Path, PathBuf}; - - let f = Path::new("/"); - - let file_system = MemoryFS::new(&[ - ("/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", ""), - ]); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - fallback: vec![ - ("aliasA".into(), vec![AliasValue::Path("a".into())]), - ("b$".into(), vec![AliasValue::Path("a/index".into())]), - ("c$".into(), vec![AliasValue::Path("/a/index".into())]), - ( - "multiAlias".into(), - vec![ - AliasValue::Path("b".into()), - AliasValue::Path("c".into()), - AliasValue::Path("d".into()), - AliasValue::Path("e".into()), - AliasValue::Path("a".into()), - ], - ), - ("recursive".into(), vec![AliasValue::Path("recursive/dir".into())]), - ("/d/dir".into(), vec![AliasValue::Path("/c/dir".into())]), - ("/d/index.js".into(), vec![AliasValue::Path("/c/index".into())]), - ("ignored".into(), vec![AliasValue::Ignore]), - ("node:path".into(), vec![AliasValue::Ignore]), - ], - modules: vec!["/".into()], - ..ResolveOptions::default() - }, - ); - - #[rustfmt::skip] - let pass = [ - ("should resolve a not aliased module 1", "a", "/a/index"), - ("should resolve a not aliased module 2", "a/index", "/a/index"), - ("should resolve a not aliased module 3", "a/dir", "/a/dir/index"), - ("should resolve a not aliased module 4", "a/dir/index", "/a/dir/index"), - ("should resolve an fallback module 1", "aliasA", "/a/index"), - ("should resolve an fallback module 2", "aliasA/index", "/a/index"), - ("should resolve an fallback module 3", "aliasA/dir", "/a/dir/index"), - ("should resolve an fallback module 4", "aliasA/dir/index", "/a/dir/index"), - ("should resolve a recursive aliased module 1", "recursive", "/recursive/index"), - ("should resolve a recursive aliased module 2", "recursive/index", "/recursive/index"), - ("should resolve a recursive aliased module 3", "recursive/dir", "/recursive/dir/index"), - ("should resolve a recursive aliased module 4", "recursive/dir/index", "/recursive/dir/index"), - ("should resolve a recursive aliased module 5", "recursive/file", "/recursive/dir/file"), - ("should resolve a file aliased module with a query 1", "b?query", "/b/index?query"), - ("should resolve a file aliased module with a query 2", "c?query", "/c/index?query"), - ("should resolve a path in a file aliased module 1", "b/index", "/b/index"), - ("should resolve a path in a file aliased module 2", "b/dir", "/b/dir/index"), - ("should resolve a path in a file aliased module 3", "b/dir/index", "/b/dir/index"), - ("should resolve a path in a file aliased module 4", "c/index", "/c/index"), - ("should resolve a path in a file aliased module 5", "c/dir", "/c/dir/index"), - ("should resolve a path in a file aliased module 6", "c/dir/index", "/c/dir/index"), - ("should resolve a file in multiple aliased dirs 1", "multiAlias/dir/file", "/e/dir/file"), - ("should resolve a file in multiple aliased dirs 2", "multiAlias/anotherDir", "/e/anotherDir/index"), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - - #[rustfmt::skip] - let ignore = [ - ("should resolve an ignore module", "ignored", ResolveError::Ignored(f.join("ignored"))), - ("should resolve node: builtin module", "node:path", ResolveError::Ignored(PathBuf::from("/node:path"))), - ]; - - for (comment, request, expected) in ignore { - let resolution = resolver.resolve(f, request); - assert_eq!(resolution, Err(expected), "{comment} {request}"); - } -} diff --git a/src/tests/full_specified.rs b/src/tests/full_specified.rs deleted file mode 100644 index a70c0191..00000000 --- a/src/tests/full_specified.rs +++ /dev/null @@ -1,113 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/fullSpecified.test.js - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows { - use std::path::PathBuf; - - use crate::{AliasValue, ResolveOptions, ResolverGeneric}; - - use super::super::memory_fs::MemoryFS; - - fn file_system() -> MemoryFS { - MemoryFS::new(&[ - ("/a/node_modules/package1/index.js", ""), - ("/a/node_modules/package1/file.js", ""), - ("/a/node_modules/package2/package.json", r#"{"main":"a"}"#), - ("/a/node_modules/package2/a.js", ""), - ("/a/node_modules/package3/package.json", r#"{"main":"dir"}"#), - ("/a/node_modules/package3/dir/index.js", ""), - ("/a/node_modules/package4/package.json", r#"{"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", ""), - ]) - } - - #[test] - fn test() { - let file_system = file_system(); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - alias: vec![ - ("alias1".into(), vec![AliasValue::from("/a/abc")]), - ("alias2".into(), vec![AliasValue::from("/a")]), - ], - alias_fields: vec![vec!["browser".into()]], - fully_specified: true, - ..ResolveOptions::default() - }, - ); - - let failing_resolves = [ - ("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"), - ]; - - for (comment, request) in failing_resolves { - let resolution = resolver.resolve("/a", request); - assert!(resolution.is_err(), "{comment} {request}"); - } - - let successful_resolves = [ - ("fully relative", "./abc.js", "/a/abc.js"), - ("fully absolute", "/a/abc.js", "/a/abc.js"), - ("fully relative in package", "package1/file.js", "/a/node_modules/package1/file.js"), - ("extensions in mainFiles", "package1", "/a/node_modules/package1/index.js"), - ("extensions in mainFields", "package2", "/a/node_modules/package2/a.js"), - ("extensions in alias", "alias1", "/a/abc.js"), - ("directories in alias", "alias2", "/a/index.js"), - ("directories in packages", "package3", "/a/node_modules/package3/dir/index.js"), - ("extensions in aliasFields", "package4/a.js", "/a/node_modules/package4/b.js"), - ]; - - for (comment, request, expected) in successful_resolves { - let resolution = resolver.resolve("/a", request).map(|r| r.full_path()); - assert_eq!(resolution, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - } - - #[test] - #[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. - fn resolve_to_context() { - let file_system = file_system(); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - alias: vec![ - ("alias1".into(), vec![AliasValue::from("/a/abc")]), - ("alias2".into(), vec![AliasValue::from("/a")]), - ], - alias_fields: vec![vec!["browser".into()]], - fully_specified: true, - resolve_to_context: true, - ..ResolveOptions::default() - }, - ); - - let successful_resolves = [ - ("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", "/a/node_modules/package3/dir"), - ]; - - for (comment, request, expected) in successful_resolves { - let resolution = resolver.resolve("/a", request).map(|r| r.full_path()); - assert_eq!(resolution, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - } -} diff --git a/src/tests/imports_field.rs b/src/tests/imports_field.rs deleted file mode 100644 index c928627a..00000000 --- a/src/tests/imports_field.rs +++ /dev/null @@ -1,1320 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/importsField.test.js -//! -//! The huge imports field test cases are at the bottom of this file. - -use serde_json::json; - -use crate::{Ctx, JSONMap, PathUtil, ResolveError, ResolveOptions, Resolver}; -use std::path::Path; - -#[test] -fn test_simple() { - let f = super::fixture().join("imports-field"); - let f2 = super::fixture().join("imports-exports-wildcard/node_modules/m/"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve using imports field instead of self-referencing", f.clone(), "#imports-field", f.join("b.js")), - ("should resolve using imports field instead of self-referencing for a subpath", f.join("dir"), "#imports-field", f.join("b.js")), - ("should resolve package #1", f.clone(), "#a/dist/main.js", f.join("node_modules/a/lib/lib2/main.js")), - ("should resolve package #3", f.clone(), "#ccc/index.js", f.join("node_modules/c/index.js")), - ("should resolve package #4", f.clone(), "#c", f.join("node_modules/c/index.js")), - ("should resolve with wildcard pattern", f2.clone(), "#internal/i.js", f2.join("src/internal/i.js")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } - - // Note added: - // * should resolve absolute path as an imports field target - // * should log the correct info - - #[rustfmt::skip] - let fail = [ - ("should disallow resolve out of package scope", f.clone(), "#b", ResolveError::InvalidPackageTarget("../b.js".to_string(), "#b".to_string(), f.join("package.json"))), - ("should resolve package #2", f.clone(), "#a", ResolveError::PackageImportNotDefined("#a".to_string(), f.join("package.json"))), - ]; - - for (comment, path, request, error) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!(resolution, Err(error), "{comment} {path:?} {request}"); - } -} - -#[test] -fn shared_resolvers() { - let f = super::fixture().join("imports-field"); - - // field name #1 - let resolver1 = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - imports_fields: vec![vec!["imports".into()]], - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - let resolved_path = resolver1.resolve(&f, "#imports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("b.js"))); - - // field name #2 - let resolver2 = resolver1.clone_with_options(ResolveOptions { - imports_fields: vec![vec!["other".into(), "imports".into()]], - ..ResolveOptions::default() - }); - - let resolved_path = resolver2.resolve(&f, "#b").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("a.js"))); -} - -// Small script for generating the test cases from enhanced_resolve -// for (c of testCases) { -// console.log("TestCase {") -// console.log(`name: ${JSON.stringify(c.name)},`) -// if (c.expect instanceof Error) { -// console.log(`expect: None,`) -// } else { -// console.log(`expect: Some(vec!${JSON.stringify(c.expect)}),`) -// } -// console.log(`imports_field: imports_field(json!(${JSON.stringify(c.suite[0], null, 2)})),`) -// console.log(`request: "${c.suite[1]}",`) -// console.log(`condition_names: vec!${JSON.stringify(c.suite[2])},`) -// console.log("},") -// } - -struct TestCase { - name: &'static str, - expect: Option>, - imports_field: JSONMap, - request: &'static str, - condition_names: Vec<&'static str>, -} - -#[allow(clippy::needless_pass_by_value)] -fn imports_field(value: serde_json::Value) -> JSONMap { - let s = serde_json::to_string(&value).unwrap(); - serde_json::from_str(&s).unwrap() -} - -#[test] -fn test_cases() { - let test_cases = [ - TestCase { - name: "sample #1", - expect: Some(vec!["./dist/test/file.js"]), - imports_field: imports_field(json!({ - "#abc/": { - "import": [ - "./dist/", - "./src/" - ], - "webpack": "./wp/" - }, - "#abc": "./main.js" - })), - request: "#abc/test/file.js", - condition_names: vec!["import", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "sample #1", - expect: Some(vec!["./src/test/file.js"]), - imports_field: imports_field(json!({ - "#abc/": { - "import": [ - "./src/" - ], - "webpack": "./wp/" - }, - "#abc": "./main.js" - })), - request: "#abc/test/file.js", - condition_names: vec!["import", "webpack"], - }, - TestCase { - name: "sample #2", - expect: Some(vec!["./data/timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#1/timezones/": "./data/timezones/" - })), - request: "#1/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #3", - expect: Some(vec!["./data/timezones/timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#aaa/": "./data/timezones/", - "#a/": "./data/timezones/" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #4", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/lib/": { - "browser": [ - "./browser/" - ] - }, - "#a/dist/index.js": { - "node": "./index.js" - } - })), - request: "#a/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #5", - expect: Some(vec!["./browser/index.js"]), - imports_field: imports_field(json!({ - "#a/lib/": { - "browser": [ - "./browser/" - ] - }, - "#a/dist/index.js": { - "node": "./index.js", - "default": "./browser/index.js" - } - })), - request: "#a/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #6", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/dist/a": "./dist/index.js" - })), - request: "#a/dist/aaa", - condition_names: vec![], - }, - TestCase { - name: "sample #7", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/a/a/": "./dist/index.js" - })), - request: "#a/a/a", - condition_names: vec![], - }, - TestCase { - name: "sample #8", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": "./index.js" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #9", - expect: Some(vec!["./main.js"]), - imports_field: imports_field(json!({ - "#a/index.js": "./main.js" - })), - request: "#a/index.js", - condition_names: vec![], - }, - TestCase { - name: "sample #10", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #11", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/bar#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #12", - expect: Some(vec!["./ok.js#abc"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/ok.js#abc", - condition_names: vec![], - }, - TestCase { - name: "sample #13", - expect: Some(vec!["./ok.js?abc"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/ok.js?abc", - condition_names: vec![], - }, - TestCase { - name: "sample #14", - expect: Some(vec!["./🎉.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/🎉.js", - condition_names: vec![], - }, - TestCase { - name: "sample #15", - expect: Some(vec!["./%F0%9F%8E%89.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/%F0%9F%8E%89.js", - condition_names: vec![], - }, - TestCase { - name: "sample #16", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/🎉", - condition_names: vec![], - }, - TestCase { - name: "sample #17", - expect: Some(vec!["./other.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/%F0%9F%8E%89", - condition_names: vec![], - }, - TestCase { - name: "sample #18", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/module", - condition_names: vec![], - }, - TestCase { - name: "sample #19", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/module#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #20", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/module?foo", - condition_names: vec![], - }, - TestCase { - name: "sample #21", - expect: Some(vec!["./d?e?f"]), - imports_field: imports_field(json!({ - "#a/a?b?c/": "./" - })), - request: "#a/a?b?c/d?e?f", - condition_names: vec![], - }, - TestCase { - name: "sample #22", - // We throw InvalidPackageTarget - expect: None, - // expect: Some(vec!["/user/a/index"]), - imports_field: imports_field(json!({ - "#a/": "/user/a/" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #1", - expect: Some(vec!["./A/b/d.js"]), - imports_field: imports_field(json!({ - "#a/": "./A/", - "#a/b/c": "./c.js" - })), - request: "#a/b/d.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #2", - expect: Some(vec!["./A/c.js"]), - imports_field: imports_field(json!({ - "#a/": "./A/", - "#a/b": "./b.js" - })), - request: "#a/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #3", - expect: Some(vec!["./A/b/c/d.js"]), - imports_field: imports_field(json!({ - "#a/": "./A/", - "#a/b/c/d": "./c.js" - })), - request: "#a/b/c/d.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #1", - expect: Some(vec!["./dist/index.js"]), - imports_field: imports_field(json!({ - "#a": "./dist/index.js" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #2", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": "./" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #3", - expect: Some(vec!["./dist/a.js"]), - imports_field: imports_field(json!({ - "#a/": "./dist/", - "#a/index.js": "./dist/a.js" - })), - request: "#a/index.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #4", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "./browser/" - ] - }, - "#a/index.js": { - "browser": "./index.js" - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #5", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "./browser/" - ] - }, - "#a/index.js": { - "node": "./node.js" - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #6", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: "#a", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #7", - expect: Some(vec!["./src/index.js"]), // `enhanced_resolve` is `None` - imports_field: imports_field(json!({ - "#a": { - "default": "./src/index.js", - "browser": "./index.js", - "node": "./src/node/index.js" - } - })), - request: "#a", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #8", - expect: Some(vec!["./src/index.js"]), - imports_field: imports_field(json!({ - "#a": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #9", - expect: Some(vec!["./index"]), - imports_field: imports_field(json!({ - "#a": "./index" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #10", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/index": "./index.js" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #11", - // We throw InvalidPackageTarget - // expect: Some(vec!["b"]), - expect: None, - imports_field: imports_field(json!({ - "#a": "b" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #12", - // We throw InvalidPackageTarget - // expect: Some(vec!["b/index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "b/" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #13", - // We throw InvalidPackageTarget - // expect: Some(vec!["b#anotherhashishere"]), - expect: None, - imports_field: imports_field(json!({ - "#a?q=a#hashishere": "b#anotherhashishere" - })), - request: "#a?q=a#hashishere", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #1", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #2", - expect: Some(vec!["./import.mjs"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec!["import"], - }, - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./require.js"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./import.mjs"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./require.js"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": [ - "./require.js" - ] - }, - { - "import": [ - "./import.mjs", - "#b/import.js" - ] - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./import.mjs"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "./import.mjs", - "#b/import.js" - ] - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "#b/import.js" - ] - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "mapping to a folder root #1", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#timezones": "./data/timezones/" - })), - request: "#timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #2", - expect: None, - imports_field: imports_field(json!({ - "#timezones/": "./data/timezones" - })), - request: "#timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #3", - expect: Some(vec!["./data/timezones/pdt/index.mjs"]), - imports_field: imports_field(json!({ - "#timezones/pdt/": "./data/timezones/pdt/" - })), - request: "#timezones/pdt/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #4", - expect: Some(vec!["./timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#a/": "./timezones/" - })), - request: "#a/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #5", - expect: Some(vec!["./timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#a/": "./" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #6", - expect: None, - imports_field: imports_field(json!({ - "#a/": "." - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #7", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": "./" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #1", - expect: Some(vec!["./lib/index.mjs"]), - imports_field: imports_field(json!({ - "#a/": "./", - "#a/dist/": "./lib/" - })), - request: "#a/dist/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #2", - expect: Some(vec!["./dist/utils/index.js"]), - imports_field: imports_field(json!({ - "#a/dist/utils/": "./dist/utils/", - "#a/dist/": "./lib/" - })), - request: "#a/dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #3", - expect: Some(vec!["./dist/utils/index.js"]), - imports_field: imports_field(json!({ - "#a/dist/utils/index.js": "./dist/utils/index.js", - "#a/dist/utils/": "./dist/utils/index.mjs", - "#a/dist/": "./lib/" - })), - request: "#a/dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #4", - expect: Some(vec!["./lib/index.mjs"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./browser/" - }, - "#a/dist/": "./lib/" - })), - request: "#a/dist/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #1", - // This behaves differently from enhanced_resolve, because `lodash/` is an an InvalidPackageConfig - // expect: Some(vec!["lodash/index.js"]), - expect: Some(vec!["./utils/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "conditional mapping folder #1", - expect: Some(vec!["./utils/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #2", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./node/" - ] - } - })), - request: "#a/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "conditional mapping folder #3", - expect: Some(vec!["./wpk/index.mjs"]), - imports_field: imports_field(json!({ - "#a/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils/" - ] - } - })), - request: "#a/index.mjs", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "incorrect exports field #1", - // We throw `PackageImportNotDefined` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "/utils/": "./a/" - })), - request: "#a/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #2", - // We throw `PackageImportNotDefined` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "/utils/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#a/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #3", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index": "./a/index.js" - })), - request: "#a/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #4", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index.mjs": "./a/index.js" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #5", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "#a/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #6", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index.mjs": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "#a/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #1", - // We don't throw in `package_imports_exports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": "./a/" - })), - request: "/utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect request #2", - // We don't throw in `package_imports_exports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #3", - // We don't throw in `package_imports_exports_resolve`, it's thrown in `package_imports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #4", - // We don't throw in `package_imports_exports_resolve`, it's thrown in `package_imports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#/", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #5", - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#a/", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #1", - // expect: Some(vec!["./dist/index"]), - expect: Some(vec!["dist/index"]), - imports_field: imports_field(json!({ - "#a/../../utils/": "./dist/" - })), - request: "#a/../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #2", - // We throw InvalidPackageTarget - // expect: Some(vec!["./dist/../../utils/index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "./dist/" - })), - request: "#a/../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #3", - // We throw InvalidPackageTarget - // expect: Some(vec!["../src/index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "../src/" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #4", - // We throw InvalidPackageTarget - // expect: Some(vec!["./utils/../../../index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": { - "browser": "./utils/../../../" - } - })), - request: "#a/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #1", - // expect: Some(vec!["moment/node_modules/lodash/dist/index.js"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": { - "browser": "moment/node_modules/" - } - })), - request: "#a/lodash/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #2", - // We throw InvalidPackageTarget - // expect: Some(vec!["../node_modules/lodash/dist/index.js"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "../node_modules/" - })), - request: "#a/lodash/dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "nested mapping #1", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": "./", - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./node/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "nested mapping #3", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["webpack"], - }, - TestCase { - name: "nested mapping #4", - // We throw NotFound - // expect: Some(vec!["moment/node/index.js"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "moment/node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["node", "browser"], - }, - TestCase { - name: "nested mapping #5", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "node"], - }, - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./node/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - TestCase { - name: "nested mapping #7", - expect: Some(vec!["./y.js"]), - imports_field: imports_field(json!({ - "#a": { - "abc": { - "def": "./x.js" - }, - "ghi": "./y.js" - } - })), - request: "#a", - condition_names: vec!["abc", "ghi"], - }, - TestCase { - name: "nested mapping #8", - // We throw PackageImportNotDefined - // expect: Some(vec![]), - expect: None, - imports_field: imports_field(json!({ - "#a": { - "abc": { - "def": "./x.js", - "default": [] - }, - "ghi": "./y.js" - } - })), - request: "#a", - condition_names: vec!["abc", "ghi"], - }, - ]; - - for case in test_cases { - let resolved = Resolver::default() - .package_imports_exports_resolve( - case.request, - &case.imports_field, - Path::new(""), - true, - &case.condition_names.iter().map(ToString::to_string).collect::>(), - &mut Ctx::default(), - ) - .map(|p| p.map(|p| p.to_path_buf())); - if let Some(expect) = case.expect { - if expect.is_empty() { - assert!(matches!(resolved, Ok(None)), "{} {:?}", &case.name, &resolved); - } else { - for expect in expect { - assert_eq!(resolved, Ok(Some(Path::new(expect).normalize())), "{}", &case.name); - } - } - } else { - assert!(resolved.is_err(), "{} {resolved:?}", &case.name); - } - } -} diff --git a/src/tests/incorrect_description_file.rs b/src/tests/incorrect_description_file.rs deleted file mode 100644 index a5c81796..00000000 --- a/src/tests/incorrect_description_file.rs +++ /dev/null @@ -1,62 +0,0 @@ -//! - -use rustc_hash::FxHashSet; - -use crate::{JSONError, Resolution, ResolveContext, ResolveError, ResolveOptions, Resolver}; - -// should not resolve main in incorrect description file #1 -#[test] -fn incorrect_description_file_1() { - let f = super::fixture().join("incorrect-package"); - let mut ctx = ResolveContext::default(); - let resolution = Resolver::default().resolve_with_context(f.join("pack1"), ".", &mut ctx); - let error = ResolveError::JSON(JSONError { - path: f.join("pack1/package.json"), - message: String::from("EOF while parsing a value at line 3 column 0"), - line: 3, - column: 0, - }); - assert_eq!(resolution, Err(error)); - assert_eq!(ctx.file_dependencies, FxHashSet::from_iter([f.join("pack1/package.json")])); - assert!(ctx.missing_dependencies.is_empty()); -} - -// should not resolve main in incorrect description file #2 -#[test] -fn incorrect_description_file_2() { - let f = super::fixture().join("incorrect-package"); - let resolution = Resolver::default().resolve(f.join("pack2"), "."); - let error = ResolveError::JSON(JSONError { - path: f.join("pack2/package.json"), - message: String::from("EOF while parsing a value at line 1 column 0"), - line: 1, - column: 0, - }); - assert_eq!(resolution, Err(error)); -} - -// should not resolve main in incorrect description file #3 -#[test] -fn incorrect_description_file_3() { - let f = super::fixture().join("incorrect-package"); - let resolution = Resolver::default().resolve(f.join("pack2"), "."); - assert!(resolution.is_err()); -} - -// `enhanced_resolve` does not have this test case -#[test] -fn no_description_file() { - let f = super::fixture_root().join("enhanced_resolve"); - - // has description file - let resolver = Resolver::default(); - assert_eq!( - resolver.resolve(&f, ".").map(Resolution::into_path_buf), - Ok(f.join("lib/index.js")) - ); - - // without description file - let resolver = - Resolver::new(ResolveOptions { description_files: vec![], ..ResolveOptions::default() }); - assert_eq!(resolver.resolve(&f, "."), Err(ResolveError::NotFound(".".into()))); -} diff --git a/src/tests/main_field.rs b/src/tests/main_field.rs deleted file mode 100644 index 3cadc8ce..00000000 --- a/src/tests/main_field.rs +++ /dev/null @@ -1,24 +0,0 @@ -//! Not part of enhanced_resolve's test suite - -use crate::{ResolveOptions, Resolver}; - -#[test] -fn test() { - let f = super::fixture().join("restrictions"); - - let resolver1 = Resolver::new(ResolveOptions { - main_fields: vec!["style".into()], - ..ResolveOptions::default() - }); - - let resolution = resolver1.resolve(&f, "pck2").map(|r| r.full_path()); - assert_eq!(resolution, Ok(f.join("node_modules/pck2/index.css"))); - - let resolver2 = resolver1.clone_with_options(ResolveOptions { - main_fields: vec!["module".into(), "main".into()], - ..ResolveOptions::default() - }); - - let resolution = resolver2.resolve(&f, "pck2").map(|r| r.full_path()); - assert_eq!(resolution, Ok(f.join("node_modules/pck2/module.js"))); -} diff --git a/src/tests/memory_fs.rs b/src/tests/memory_fs.rs deleted file mode 100644 index e4116609..00000000 --- a/src/tests/memory_fs.rs +++ /dev/null @@ -1,74 +0,0 @@ -use std::{ - io, - path::{Path, PathBuf}, -}; - -use crate::{FileMetadata, FileSystem}; - -#[derive(Default)] -pub struct MemoryFS { - fs: vfs::MemoryFS, -} - -impl MemoryFS { - /// # Panics - /// - /// * Fails to create directory - /// * Fails to write file - #[allow(dead_code)] - pub fn new(data: &[(&'static str, &'static str)]) -> Self { - let mut fs = Self { fs: vfs::MemoryFS::default() }; - for (path, content) in data { - fs.add_file(Path::new(path), content); - } - fs - } - - #[allow(dead_code)] - pub fn add_file(&mut self, path: &Path, content: &str) { - use vfs::FileSystem; - let fs = &mut self.fs; - // Create all parent directories - for path in path.ancestors().collect::>().iter().rev() { - let path = path.to_string_lossy(); - if !fs.exists(path.as_ref()).unwrap() { - fs.create_dir(path.as_ref()).unwrap(); - } - } - // Create file - let mut file = fs.create_file(path.to_string_lossy().as_ref()).unwrap(); - file.write_all(content.as_bytes()).unwrap(); - } -} - -impl FileSystem for MemoryFS { - fn read_to_string(&self, path: &Path) -> io::Result { - use vfs::FileSystem; - let mut file = self - .fs - .open_file(path.to_string_lossy().as_ref()) - .map_err(|err| io::Error::new(io::ErrorKind::NotFound, err))?; - let mut buffer = String::new(); - file.read_to_string(&mut buffer).unwrap(); - Ok(buffer) - } - - fn metadata(&self, path: &Path) -> io::Result { - use vfs::FileSystem; - let metadata = self - .fs - .metadata(path.to_string_lossy().as_ref()) - .map_err(|err| io::Error::new(io::ErrorKind::NotFound, err))?; - let is_file = metadata.file_type == vfs::VfsFileType::File; - let is_dir = metadata.file_type == vfs::VfsFileType::Directory; - Ok(FileMetadata::new(is_file, is_dir, false)) - } - - fn symlink_metadata(&self, path: &Path) -> io::Result { - self.metadata(path) - } - - fn canonicalize(&self, _path: &Path) -> io::Result { - Err(io::Error::new(io::ErrorKind::NotFound, "not a symlink")) - } -} diff --git a/src/tests/missing.rs b/src/tests/missing.rs deleted file mode 100644 index 4bf611ef..00000000 --- a/src/tests/missing.rs +++ /dev/null @@ -1,106 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/missing.test.js - -use normalize_path::NormalizePath; - -use crate::{AliasValue, ResolveContext, ResolveOptions, Resolver}; - -#[test] -fn test() { - let f = super::fixture(); - - let data = [ - ( - "./missing-file", - vec![f.join("missing-file"), f.join("missing-file.js"), f.join("missing-file.node")], - ), - ( - "missing-module", - vec![ - f.join("node_modules/missing-module"), - f.parent().unwrap().join("node_modules"), // enhanced-resolve is "node_modules/missing-module" - ], - ), - ( - "missing-module/missing-file", - vec![ - f.join("node_modules/missing-module"), - // f.parent().unwrap().join("node_modules/missing-module"), // we don't report this - ], - ), - ( - "m1/missing-file", - vec![ - f.join("node_modules/m1/missing-file"), - f.join("node_modules/m1/missing-file.js"), - f.join("node_modules/m1/missing-file.node"), - // f.parent().unwrap().join("node_modules/m1"), // we don't report this - ], - ), - ( - "m1/", - vec![ - f.join("node_modules/m1/index"), - f.join("node_modules/m1/index.js"), - f.join("node_modules/m1/index.json"), - f.join("node_modules/m1/index.node"), - ], - ), - ("m1/a", vec![f.join("node_modules/m1/a")]), - ]; - - let resolver = Resolver::default(); - - for (specifier, missing_dependencies) in data { - let mut ctx = ResolveContext::default(); - let _ = resolver.resolve_with_context(&f, specifier, &mut ctx); - - for path in ctx.file_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - } - - for path in missing_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - assert!( - ctx.missing_dependencies.contains(&path), - "{specifier}: {path:?} not in {:?}", - &ctx.missing_dependencies - ); - } - } -} - -#[test] -fn alias_and_extensions() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias: vec![ - ( - "@scope-js/package-name/dir$".into(), - vec![AliasValue::Path(f.join("foo/index.js").to_string_lossy().to_string())], - ), - ( - "react-dom".into(), - vec![AliasValue::Path(f.join("foo/index.js").to_string_lossy().to_string())], - ), - ], - extensions: vec![".server.ts".into()], - - ..ResolveOptions::default() - }); - - let mut ctx = ResolveContext::default(); - let _ = resolver.resolve_with_context(&f, "@scope-js/package-name/dir/router", &mut ctx); - let _ = resolver.resolve_with_context(&f, "react-dom/client", &mut ctx); - - for path in ctx.file_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - } - - for path in ctx.missing_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - if let Some(path) = path.parent() { - assert!(!path.is_file(), "{path:?} must not be a file"); - } - } -} diff --git a/src/tests/mod.rs b/src/tests/mod.rs deleted file mode 100644 index 94e6bd86..00000000 --- a/src/tests/mod.rs +++ /dev/null @@ -1,49 +0,0 @@ -mod alias; -mod browser_field; -mod builtins; -mod dependencies; -mod exports_field; -mod extension_alias; -mod extensions; -mod fallback; -mod full_specified; -mod imports_field; -mod incorrect_description_file; -mod main_field; -mod memory_fs; -mod missing; -mod resolve; -mod restrictions; -mod roots; -mod scoped_packages; -mod simple; -mod symlink; -mod tsconfig_paths; -mod tsconfig_project_references; - -use crate::Resolver; -use std::{env, path::PathBuf, sync::Arc, thread}; - -pub fn fixture_root() -> PathBuf { - env::current_dir().unwrap().join("fixtures") -} - -pub fn fixture() -> PathBuf { - fixture_root().join("enhanced_resolve").join("test").join("fixtures") -} - -#[test] -fn threaded_environment() { - let cwd = env::current_dir().unwrap(); - let resolver = Arc::new(Resolver::default()); - for _ in 0..2 { - _ = thread::spawn({ - let cwd = cwd.clone(); - let resolver = Arc::clone(&resolver); - move || { - _ = resolver.resolve(cwd, "."); - } - }) - .join(); - } -} diff --git a/src/tests/resolve.rs b/src/tests/resolve.rs deleted file mode 100644 index f2dbb88e..00000000 --- a/src/tests/resolve.rs +++ /dev/null @@ -1,119 +0,0 @@ -//! - -use crate::{ResolveError, ResolveOptions, Resolver}; - -#[test] -fn resolve() { - let f = super::fixture(); - - let resolver = Resolver::default(); - - let main1_js_path = f.join("main1.js").to_string_lossy().to_string(); - - #[rustfmt::skip] - let pass = [ - ("absolute path", f.clone(), main1_js_path.as_str(), f.join("main1.js")), - ("file with .js", f.clone(), "./main1.js", f.join("main1.js")), - ("file without extension", f.clone(), "./main1", f.join("main1.js")), - ("another file with .js", f.clone(), "./a.js", f.join("a.js")), - ("another file without extension", f.clone(), "./a", f.join("a.js")), - ("file in module with .js", f.clone(), "m1/a.js", f.join("node_modules/m1/a.js")), - ("file in module without extension", f.clone(), "m1/a", f.join("node_modules/m1/a.js")), - ("another file in module without extension", f.clone(), "complexm/step1", f.join("node_modules/complexm/step1.js")), - ("from submodule to file in sibling module", f.join("node_modules/complexm"), "m2/b.js", f.join("node_modules/m2/b.js")), - ("from nested directory to overwritten file in module", f.join("multiple_modules"), "m1/a.js", f.join("multiple_modules/node_modules/m1/a.js")), - ("from nested directory to not overwritten file in module", f.join("multiple_modules"), "m1/b.js", f.join("node_modules/m1/b.js")), - ("file with query", f.clone(), "./main1.js?query", f.join("main1.js?query")), - ("file with fragment", f.clone(), "./main1.js#fragment", f.join("main1.js#fragment")), - ("file with fragment and query", f.clone(), "./main1.js#fragment?query", f.join("main1.js#fragment?query")), - ("file with query and fragment", f.clone(), "./main1.js?#fragment", f.join("main1.js?#fragment")), - - ("file with query (unicode)", f.clone(), "./测试.js?query", f.join("测试.js?query")), - ("file with fragment (unicode)", f.clone(), "./测试.js#fragment", f.join("测试.js#fragment")), - ("file with fragment and query (unicode)", f.clone(), "./测试.js#fragment?query", f.join("测试.js#fragment?query")), - ("file with query and fragment (unicode)", f.clone(), "./测试.js?#fragment", f.join("测试.js?#fragment")), - - ("file in module with query", f.clone(), "m1/a?query", f.join("node_modules/m1/a.js?query")), - ("file in module with fragment", f.clone(), "m1/a#fragment", f.join("node_modules/m1/a.js#fragment")), - ("file in module with fragment and query", f.clone(), "m1/a#fragment?query", f.join("node_modules/m1/a.js#fragment?query")), - ("file in module with query and fragment", f.clone(), "m1/a?#fragment", f.join("node_modules/m1/a.js?#fragment")), - ("file in module with query and fragment", f.clone(), "m1/a?#fragment", f.join("node_modules/m1/a.js?#fragment")), - ("differ between directory and file, resolve file", f.clone(), "./dirOrFile", f.join("dirOrFile.js")), - ("differ between directory and file, resolve directory", f.clone(), "./dirOrFile/", f.join("dirOrFile/index.js")), - ("find node_modules outside of node_modules", f.join("browser-module/node_modules"), "m1/a", f.join("node_modules/m1/a.js")), - ("don't crash on main field pointing to self", f.clone(), "./main-field-self", f.join("./main-field-self/index.js")), - ("don't crash on main field pointing to self (2)", f.clone(), "./main-field-self2", f.join("./main-field-self2/index.js")), - // enhanced-resolve has `#` prepended with a `\0`, they are removed from the - // following 3 expected test results. - // See https://github.com/webpack/enhanced-resolve#escaping - ("handle fragment edge case (no fragment)", f.clone(), "./no#fragment/#/#", f.join("no#fragment/#/#.js")), - ("handle fragment edge case (fragment)", f.clone(), "./no#fragment/#/", f.join("no.js#fragment/#/")), - ("handle fragment escaping", f.clone(), "./no\0#fragment/\0#/\0##fragment", f.join("no#fragment/#/#.js#fragment")), - - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn issue238_resolve() { - let f = super::fixture().join("issue-238"); - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into(), ".jsx".into(), ".ts".into(), ".tsx".into()], - modules: vec!["src/a".into(), "src/b".into(), "src/common".into(), "node_modules".into()], - ..ResolveOptions::default() - }); - let resolved_path = - resolver.resolve(f.join("src/common"), "config/myObjectFile").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("src/common/config/myObjectFile.js")),); -} - -#[test] -fn prefer_relative() { - let f = super::fixture(); - - let resolver = - Resolver::new(ResolveOptions { prefer_relative: true, ..ResolveOptions::default() }); - - #[rustfmt::skip] - let pass = [ - ("should correctly resolve with preferRelative 1", "main1.js", f.join("main1.js")), - ("should correctly resolve with preferRelative 2", "m1/a.js", f.join("node_modules/m1/a.js")), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } -} - -#[test] -fn resolve_to_context() { - let f = super::fixture(); - let resolver = - Resolver::new(ResolveOptions { resolve_to_context: true, ..ResolveOptions::default() }); - - #[rustfmt::skip] - let data = [ - ("context for fixtures", f.clone(), "./", f.clone()), - ("context for fixtures/lib", f.clone(), "./lib", f.join("lib")), - ("context for fixtures with ..", f.clone(), "./lib/../../fixtures/./lib/..", f.clone()), - ("context for fixtures with query", f.clone(), "./?query", f.clone().with_file_name("fixtures?query")), - ]; - - for (comment, path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn resolve_hash_as_module() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions::default()); - let resolution = resolver.resolve(f, "#a"); - assert_eq!(resolution, Err(ResolveError::NotFound("#a".into()))); -} diff --git a/src/tests/restrictions.rs b/src/tests/restrictions.rs deleted file mode 100644 index 5ba56596..00000000 --- a/src/tests/restrictions.rs +++ /dev/null @@ -1,25 +0,0 @@ -//! - -use crate::{ResolveError, ResolveOptions, Resolver, Restriction}; - -// TODO: regex -// * should respect RegExp restriction -// * should try to find alternative #1 -// * should try to find alternative #2 -// * should try to find alternative #3 - -// should respect string restriction -#[test] -fn restriction1() { - let fixture = super::fixture(); - let f = fixture.join("restrictions"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - restrictions: vec![Restriction::Path(f.clone())], - ..ResolveOptions::default() - }); - - let resolution = resolver.resolve(&f, "pck2"); - assert_eq!(resolution, Err(ResolveError::Restriction(fixture.join("c.js"), f))); -} diff --git a/src/tests/roots.rs b/src/tests/roots.rs deleted file mode 100644 index b50e2a07..00000000 --- a/src/tests/roots.rs +++ /dev/null @@ -1,92 +0,0 @@ -//! - -use std::path::PathBuf; - -use crate::{AliasValue, ResolveError, ResolveOptions, Resolver}; - -fn dirname() -> PathBuf { - super::fixture_root().join("enhanced_resolve").join("test") -} - -#[test] -fn roots() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - alias: vec![("foo".into(), vec![AliasValue::from("/fixtures")])], - roots: vec![dirname(), f.clone()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should respect roots option", "/fixtures/b.js", f.join("b.js")), - ("should try another root option, if it exists", "/b.js", f.join("b.js")), - ("should respect extension", "/fixtures/b", f.join("b.js")), - ("should resolve in directory", "/fixtures/extensions/dir", f.join("extensions/dir/index.js")), - ("should respect aliases", "foo/b", f.join("b.js")), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } - - #[rustfmt::skip] - let fail = [ - ("should not work with relative path", "fixtures/b.js", ResolveError::NotFound("fixtures/b.js".into())) - ]; - - for (comment, request, expected) in fail { - let resolution = resolver.resolve(&f, request); - assert_eq!(resolution, Err(expected), "{comment} {request}"); - } -} - -#[test] -fn resolve_to_context() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - roots: vec![dirname(), f.clone()], - resolve_to_context: true, - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f, "/fixtures/lib").map(|r| r.full_path()); - let expected = f.join("lib"); - assert_eq!(resolved_path, Ok(expected)); -} - -#[test] -fn prefer_absolute() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - alias: vec![("foo".into(), vec![AliasValue::from("/fixtures")])], - roots: vec![dirname(), f.clone()], - prefer_absolute: true, - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve an absolute path (prefer absolute)", f.join("b.js").to_string_lossy().to_string(), f.join("b.js")), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(&f, &request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } -} - -#[test] -fn roots_fall_through() { - let f = super::fixture(); - let absolute_path = f.join("roots_fall_through/index.js"); - let specifier = absolute_path.to_string_lossy(); - let resolution = Resolver::new(ResolveOptions::default().with_root(&f)).resolve(&f, &specifier); - assert_eq!( - resolution.map(super::super::resolution::Resolution::into_path_buf), - Ok(absolute_path) - ); -} diff --git a/src/tests/scoped_packages.rs b/src/tests/scoped_packages.rs deleted file mode 100644 index 8258f00f..00000000 --- a/src/tests/scoped_packages.rs +++ /dev/null @@ -1,25 +0,0 @@ -//! - -use crate::{ResolveOptions, Resolver}; - -#[test] -fn scoped_packages() { - let f = super::fixture().join("scoped"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("main field should work", f.clone(), "@scope/pack1", f.join("./node_modules/@scope/pack1/main.js")), - ("browser field should work", f.clone(), "@scope/pack2", f.join("./node_modules/@scope/pack2/main.js")), - ("folder request should work", f.clone(), "@scope/pack2/lib", f.join("./node_modules/@scope/pack2/lib/index.js")) - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} diff --git a/src/tests/simple.rs b/src/tests/simple.rs deleted file mode 100644 index 08e1238a..00000000 --- a/src/tests/simple.rs +++ /dev/null @@ -1,68 +0,0 @@ -//! - -use std::env; - -use crate::Resolver; - -#[test] -fn simple() { - // mimic `enhanced-resolve/test/simple.test.js` - let dirname = env::current_dir().unwrap().join("fixtures"); - let f = dirname.join("enhanced_resolve/test"); - - let resolver = Resolver::default(); - - let data = [ - ("direct", f.clone(), "../lib/index"), - ("as directory", f, ".."), - ("as module", dirname.clone(), "./enhanced_resolve"), - ]; - - for (comment, path, request) in data { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - let expected = dirname.join("enhanced_resolve/lib/index.js"); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn dashed_name() { - let f = super::fixture(); - - let resolver = Resolver::default(); - - let data = [ - (f.clone(), "dash", f.join("node_modules/dash/index.js")), - (f.clone(), "dash-name", f.join("node_modules/dash-name/index.js")), - (f.join("node_modules/dash"), "dash", f.join("node_modules/dash/index.js")), - (f.join("node_modules/dash"), "dash-name", f.join("node_modules/dash-name/index.js")), - (f.join("node_modules/dash-name"), "dash", f.join("node_modules/dash/index.js")), - (f.join("node_modules/dash-name"), "dash-name", f.join("node_modules/dash-name/index.js")), - ]; - - for (path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{path:?} {request}"); - } -} - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows { - use super::super::memory_fs::MemoryFS; - - use crate::ResolveOptions; - - #[test] - fn no_package() { - use crate::ResolverGeneric; - use std::path::Path; - let f = Path::new("/"); - let file_system = MemoryFS::new(&[]); - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions::default(), - ); - let resolved_path = resolver.resolve(f, "package"); - assert!(resolved_path.is_err()); - } -} diff --git a/src/tests/symlink.rs b/src/tests/symlink.rs deleted file mode 100644 index 7589b560..00000000 --- a/src/tests/symlink.rs +++ /dev/null @@ -1,121 +0,0 @@ -use std::{fs, io, path::Path}; - -use crate::{ResolveOptions, Resolver}; - -#[derive(Debug, Clone, Copy)] -enum FileType { - File, - Dir, -} - -#[allow(unused_variables)] -fn symlink, Q: AsRef>( - original: P, - link: Q, - file_type: FileType, -) -> io::Result<()> { - #[cfg(target_family = "unix")] - { - std::os::unix::fs::symlink(original, link) - } - - #[cfg(target_family = "windows")] - match file_type { - FileType::File => std::os::windows::fs::symlink_file(original, link), - FileType::Dir => std::os::windows::fs::symlink_dir(original, link), - } -} - -fn init(dirname: &Path, temp_path: &Path) -> io::Result<()> { - if temp_path.exists() { - _ = fs::remove_dir_all(temp_path); - } - fs::create_dir(temp_path)?; - symlink(dirname.join("../lib/index.js"), temp_path.join("test"), FileType::File)?; - symlink(dirname.join("../lib"), temp_path.join("test2"), FileType::Dir)?; - fs::remove_file(temp_path.join("test"))?; - fs::remove_file(temp_path.join("test2"))?; - fs::remove_dir(temp_path) -} - -fn create_symlinks(dirname: &Path, temp_path: &Path) -> io::Result<()> { - fs::create_dir(temp_path).unwrap(); - symlink( - dirname.join("../lib/index.js").canonicalize().unwrap(), - temp_path.join("index.js"), - FileType::File, - )?; - symlink(dirname.join("../lib").canonicalize().unwrap(), temp_path.join("lib"), FileType::Dir)?; - symlink(dirname.join("..").canonicalize().unwrap(), temp_path.join("this"), FileType::Dir)?; - symlink(temp_path.join("this"), temp_path.join("that"), FileType::Dir)?; - symlink(Path::new("../../lib/index.js"), temp_path.join("node.relative.js"), FileType::File)?; - symlink( - Path::new("./node.relative.js"), - temp_path.join("node.relative.sym.js"), - FileType::File, - )?; - Ok(()) -} - -fn cleanup_symlinks(temp_path: &Path) { - _ = fs::remove_dir_all(temp_path); -} - -#[test] -fn test() -> io::Result<()> { - let root = super::fixture_root().join("enhanced_resolve"); - let dirname = root.join("test"); - let temp_path = dirname.join("temp"); - if !temp_path.exists() { - let is_admin = init(&dirname, &temp_path).is_ok(); - if !is_admin { - return Ok(()); - } - if let Err(err) = create_symlinks(&dirname, &temp_path) { - cleanup_symlinks(&temp_path); - return Err(err); - } - } - - let resolver_without_symlinks = - Resolver::new(ResolveOptions { symlinks: false, ..ResolveOptions::default() }); - let resolver_with_symlinks = Resolver::default(); - - #[rustfmt::skip] - let pass = [ - ("with a symlink to a file", temp_path.clone(), "./index.js"), - ("with a relative symlink to a file", temp_path.clone(), "./node.relative.js"), - ("with a relative symlink to a symlink to a file", temp_path.clone(), "./node.relative.sym.js"), - ("with a symlink to a directory 1", temp_path.clone(), "./lib/index.js"), - ("with a symlink to a directory 2", temp_path.clone(), "./this/lib/index.js"), - ("with multiple symlinks in the path 1", temp_path.clone(), "./this/test/temp/index.js"), - ("with multiple symlinks in the path 2", temp_path.clone(), "./this/test/temp/lib/index.js"), - ("with multiple symlinks in the path 3", temp_path.clone(), "./this/test/temp/this/lib/index.js"), - ("with a symlink to a directory 2 (chained)", temp_path.clone(), "./that/lib/index.js"), - ("with multiple symlinks in the path 1 (chained)", temp_path.clone(), "./that/test/temp/index.js"), - ("with multiple symlinks in the path 2 (chained)", temp_path.clone(), "./that/test/temp/lib/index.js"), - ("with multiple symlinks in the path 3 (chained)", temp_path.clone(), "./that/test/temp/that/lib/index.js"), - ("with symlinked directory as context 1", temp_path.join( "lib"), "./index.js"), - ("with symlinked directory as context 2", temp_path.join( "this"), "./lib/index.js"), - ("with symlinked directory as context and in path", temp_path.join( "this"), "./test/temp/lib/index.js"), - ("with symlinked directory in context path", temp_path.join( "this/lib"), "./index.js"), - ("with symlinked directory in context path and symlinked file", temp_path.join( "this/test"), "./temp/index.js"), - ("with symlinked directory in context path and symlinked directory", temp_path.join( "this/test"), "./temp/lib/index.js"), - ("with symlinked directory as context 2 (chained)", temp_path.join( "that"), "./lib/index.js"), - ("with symlinked directory as context and in path (chained)", temp_path.join( "that"), "./test/temp/lib/index.js"), - ("with symlinked directory in context path (chained)", temp_path.join( "that/lib"), "./index.js"), - ("with symlinked directory in context path and symlinked file (chained)", temp_path.join( "that/test"), "./temp/index.js"), - ("with symlinked directory in context path and symlinked directory (chained)", temp_path.join( "that/test"), "./temp/lib/index.js") - ]; - - for (comment, path, request) in pass { - let filename = resolver_with_symlinks.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(filename, Ok(root.join("lib/index.js")), "{comment:?}"); - - let resolved_path = - resolver_without_symlinks.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(path.join(request))); - } - - Ok(()) -} diff --git a/src/tests/tsconfig_paths.rs b/src/tests/tsconfig_paths.rs deleted file mode 100644 index 26935b5c..00000000 --- a/src/tests/tsconfig_paths.rs +++ /dev/null @@ -1,507 +0,0 @@ -//! tests for tsconfig-paths -//! -//! Fixtures copied from . - -use std::path::{Path, PathBuf}; - -use crate::{ - ResolveError, ResolveOptions, Resolver, TsConfig, TsconfigOptions, TsconfigReferences, -}; - -// -#[test] -fn tsconfig() { - let f = super::fixture_root().join("tsconfig"); - - #[rustfmt::skip] - let pass = [ - (f.clone(), None, "ts-path", f.join("foo.js")), - (f.join("nested"), None, "ts-path", f.join("nested/test.js")), - (f.join("cases/index"), None, "foo", f.join("node_modules/tsconfig-index/foo.js")), - // This requires reading package.json.tsconfig field - // (f.join("cases/field"), "foo", f.join("node_modules/tsconfig-field/foo.js")) - (f.join("cases/exports"), None, "foo", f.join("node_modules/tsconfig-exports/foo.js")), - (f.join("cases/extends-extension"), None, "foo", f.join("cases/extends-extension/foo.js")), - (f.join("cases/extends-extensionless"), None, "foo", f.join("node_modules/tsconfig-field/foo.js")), - (f.join("cases/extends-paths"), Some("src"), "@/index", f.join("cases/extends-paths/src/index.js")), - (f.join("cases/extends-multiple"), None, "foo", f.join("cases/extends-multiple/foo.js")), - ]; - - for (dir, subdir, request, expected) in pass { - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: dir.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - let path = subdir.map_or(dir.clone(), |subdir| dir.join(subdir)); - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{request} {path:?}"); - } - - #[rustfmt::skip] - let data = [ - (f.join("node_modules/tsconfig-not-used"), "ts-path", Ok(f.join("foo.js"))), - ]; - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - for (path, request, expected) in data { - let resolution = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolution, expected, "{path:?} {request}"); - } -} - -#[test] -fn tsconfig_fallthrough() { - let f = super::fixture_root().join("tsconfig"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "/"); - assert_eq!(resolved_path, Err(ResolveError::NotFound("/".into()))); -} - -#[test] -fn json_with_comments() { - let f = super::fixture_root().join("tsconfig/cases/trailing-comma"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "foo").map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(f.join("bar.js"))); -} - -// -#[test] -fn test_paths() { - let path = Path::new("/foo/tsconfig.json"); - let mut tsconfig_json = serde_json::json!({ - "compilerOptions": { - "paths": { - "jquery": ["node_modules/jquery/dist/jquery"], - "*": ["generated/*"], - "bar/*": ["test/*"], - "bar/baz/*": ["baz/*", "yo/*"], - "@/components/*": ["components/*"], - "url": ["node_modules/my-url"], - } - } - }) - .to_string(); - let tsconfig = TsConfig::parse(true, path, &mut tsconfig_json).unwrap(); - - let data = [ - ("jquery", vec!["/foo/node_modules/jquery/dist/jquery"]), - ("test", vec!["/foo/generated/test"]), - ("test/hello", vec!["/foo/generated/test/hello"]), - ("bar/hi", vec!["/foo/test/hi"]), - ("bar/baz/hi", vec!["/foo/baz/hi", "/foo/yo/hi"]), - ("@/components/button", vec!["/foo/components/button"]), - ("./jquery", vec![]), - ("url", vec!["/foo/node_modules/my-url"]), - ]; - - for (specifier, expected) in data { - let paths = tsconfig.resolve_path_alias(specifier); - let expected = expected.into_iter().map(PathBuf::from).collect::>(); - assert_eq!(paths, expected, "{specifier}"); - } -} - -// -#[test] -fn test_base_url() { - let path = Path::new("/foo/tsconfig.json"); - let mut tsconfig_json = serde_json::json!({ - "compilerOptions": { - "baseUrl": "./src" - } - }) - .to_string(); - let tsconfig = TsConfig::parse(true, path, &mut tsconfig_json).unwrap(); - - let data = [ - ("foo", vec!["/foo/src/foo"]), - ("components/button", vec!["/foo/src/components/button"]), - ("./jquery", vec![]), - ]; - - for (specifier, expected) in data { - let paths = tsconfig.resolve_path_alias(specifier); - let expected = expected.into_iter().map(PathBuf::from).collect::>(); - assert_eq!(paths, expected, "{specifier}"); - } -} - -// -#[test] -fn test_paths_and_base_url() { - let path = Path::new("/foo/tsconfig.json"); - let mut tsconfig_json = serde_json::json!({ - "compilerOptions": { - "baseUrl": "./src", - "paths": { - "*": ["generated/*"], - "bar/*": ["test/*"], - "bar/baz/*": ["baz/*", "yo/*"], - "@/components/*": ["components/*"] - } - } - }) - .to_string(); - let tsconfig = TsConfig::parse(true, path, &mut tsconfig_json).unwrap(); - - let data = [ - ("test", vec!["/foo/src/generated/test", "/foo/src/test"]), - ("test/hello", vec!["/foo/src/generated/test/hello", "/foo/src/test/hello"]), - ("bar/hi", vec!["/foo/src/test/hi", "/foo/src/bar/hi"]), - ("bar/baz/hi", vec!["/foo/src/baz/hi", "/foo/src/yo/hi", "/foo/src/bar/baz/hi"]), - ("@/components/button", vec!["/foo/src/components/button", "/foo/src/@/components/button"]), - ("./jquery", vec![]), - ]; - - for (specifier, expected) in data { - let paths = tsconfig.resolve_path_alias(specifier); - let expected = expected.into_iter().map(PathBuf::from).collect::>(); - assert_eq!(paths, expected, "{specifier}"); - } -} - -// Template variable ${configDir} for substitution of config files directory path -// https://github.com/microsoft/TypeScript/pull/58042 -#[test] -fn test_template_variable() { - let f = super::fixture_root().join("tsconfig"); - let f2 = f.join("cases").join("paths_template_variable"); - - #[rustfmt::skip] - let pass = [ - (f2.clone(), "tsconfig1.json", "foo", f2.join("foo.js")), - (f2.clone(), "tsconfig2.json", "foo", f2.join("foo.js")), - (f.clone(), "tsconfig_template_variable.json", "foo", f.join("foo.js")), - ]; - - for (dir, tsconfig, request, expected) in pass { - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: dir.join(tsconfig), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&dir, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{request} {tsconfig} {dir:?}"); - } -} - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows_test { - use std::path::{Path, PathBuf}; - - use crate::{ - ResolveError, ResolveOptions, ResolverGeneric, TsconfigOptions, TsconfigReferences, - }; - - use super::super::memory_fs::MemoryFS; - - struct OneTest { - name: &'static str, - tsconfig: String, - package_json: Option<(PathBuf, String)>, - main_fields: Option>, - existing_files: Vec<&'static str>, - requested_module: &'static str, - expected_path: &'static str, - extensions: Vec, - } - - impl Default for OneTest { - fn default() -> Self { - Self { - name: "", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/*": ["location/*"] - } - } - }) - .to_string(), - package_json: None, - main_fields: None, - existing_files: vec![], - requested_module: "", - expected_path: "", - extensions: vec![ - ".js".into(), - ".json".into(), - ".node".into(), - ".ts".into(), - ".tsx".into(), - ], - } - } - } - - impl OneTest { - fn resolver(&self, root: &Path) -> ResolverGeneric { - let mut file_system = MemoryFS::default(); - - file_system.add_file(&root.join("tsconfig.json"), &self.tsconfig); - if let Some((path, package_json)) = &self.package_json { - file_system.add_file(&root.join(path).join("package.json"), package_json); - } - for path in &self.existing_files { - file_system.add_file(Path::new(path), ""); - } - - let mut options = ResolveOptions { - extensions: self.extensions.clone(), - tsconfig: Some(TsconfigOptions { - config_file: root.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }; - if let Some(main_fields) = &self.main_fields { - options.main_fields.clone_from(main_fields); - } - - ResolverGeneric::::new_with_file_system(file_system, options) - } - } - - // Path matching tests from tsconfig-paths - // * - // * - #[test] - fn match_path() { - let pass = [ - OneTest { - name: "should locate path that matches with star and exists", - existing_files: vec!["/root/location/mylib/index.ts"], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve to correct path when many are specified", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/*": ["foo1/*", "foo2/*", "location/*", "foo3/*"], - } - } - }) - .to_string(), - existing_files: vec!["/root/location/mylib/index.ts"], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should locate path that matches with star and prioritize pattern with longest prefix", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "*": ["location/*"], - "lib/*": ["location/*"], - } - } - }) - .to_string(), - existing_files: vec![ - "/root/location/lib/mylib/index.ts", - "/root/location/mylib/index.ts", - ], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should locate path that matches with star and exists with extension", - existing_files: vec![ - "/root/location/mylib.myext", - ], - requested_module: "lib/mylib", - extensions: vec![".js".into(), ".myext".into()], - expected_path: "/root/location/mylib.myext", - ..OneTest::default() - }, - OneTest { - name: "should resolve request with extension specified", - existing_files: vec![ - "/root/location/test.jpg", - ], - requested_module: "lib/test.jpg", - expected_path: "/root/location/test.jpg", - ..OneTest::default() - }, - OneTest { - name: "should locate path that matches without star and exists", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/foo": ["location/foo"] - } - } - }) - .to_string(), - existing_files: vec![ - "/root/location/foo.ts", - ], - requested_module: "lib/foo", - expected_path: "/root/location/foo.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve to parent folder when filename is in subfolder", - existing_files: vec![ - "/root/location/mylib/index.ts", - ], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve from main field in package.json", - package_json: Some((PathBuf::from("/root/location/mylib"), serde_json::json!({ - "main": "./kalle.ts" - }).to_string())), - existing_files: vec![ - "/root/location/mylib/kalle.ts", - ], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/kalle.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve from main field in package.json (js)", - package_json: Some((PathBuf::from("/root/location/mylib.js"), serde_json::json!({ - "main": "./kalle.js" - }).to_string())), - existing_files: vec![ - "/root/location/mylib.js/kalle.js", - ], - extensions: vec![".ts".into(), ".js".into()], - requested_module: "lib/mylib.js", - expected_path: "/root/location/mylib.js/kalle.js", - ..OneTest::default() - }, - OneTest { - name: "should resolve from list of fields by priority in package.json", - main_fields: Some(vec!["missing".into(), "browser".into(), "main".into()]), - package_json: Some((PathBuf::from("/root/location/mylibjs"), serde_json::json!({ - "main": "./main.js", - "browser": "./browser.js" - }).to_string())), - existing_files: vec![ - "/root/location/mylibjs/main.js", - "/root/location/mylibjs/browser.js", - ], - extensions: vec![".ts".into(), ".js".into()], - requested_module: "lib/mylibjs", - expected_path: "/root/location/mylibjs/browser.js", - ..OneTest::default() - }, -OneTest { - name: "should ignore field mappings to missing files in package.json", - main_fields: Some(vec!["browser".into(), "main".into()]), - package_json: Some((PathBuf::from("/root/location/mylibjs"), serde_json::json!({ - "main": "./kalle.js", - "browser": "./nope.js" - }).to_string())), - existing_files: vec![ - "/root/location/mylibjs/kalle.js", - ], - extensions: vec![".ts".into(), ".js".into()], - requested_module: "lib/mylibjs", - expected_path: "/root/location/mylibjs/kalle.js", - ..OneTest::default() - }, - // Tests that are not applicable: - // name: "should resolve nested main fields" - // name: "should ignore advanced field mappings in package.json" - // name: "should resolve to with the help of baseUrl when not explicitly set" - // name: "should not resolve with the help of baseUrl when asked not to" - // name: "should resolve main file with cjs file extension" - OneTest { - name: "should resolve .ts from .js alias", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "@/*": ["src/*"] - } - } - }).to_string(), - existing_files: vec![ - "/root/src/foo.ts", - ], - requested_module: "@/foo", // original data was "@/foo.ts" but I don't get why it is the case? - expected_path: "/root/src/foo.ts", // original data was "/root/src/foo" - ..OneTest::default() - }, - ]; - - let root = PathBuf::from("/root"); - - for test in pass { - let resolved_path = - test.resolver(&root).resolve(&root, test.requested_module).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(PathBuf::from(test.expected_path)), "{}", test.name); - } - - let fail = [ - OneTest { - name: "should not locate path that does not match", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/*": ["location/*"] - } - } - }) - .to_string(), - existing_files: vec!["/root/location/mylib"], - requested_module: "lib/mylibjs", - ..OneTest::default() - }, - OneTest { - name: "should not resolve typings file (index.d.ts)", - existing_files: vec!["/root/location/mylib/index.d.ts"], - requested_module: "lib/mylib", - ..OneTest::default() - }, - ]; - - for test in fail { - let resolved_path = - test.resolver(&root).resolve(&root, test.requested_module).map(|f| f.full_path()); - assert_eq!( - resolved_path, - Err(ResolveError::NotFound(test.requested_module.into())), - "{}", - test.name - ); - } - } -} diff --git a/src/tests/tsconfig_project_references.rs b/src/tests/tsconfig_project_references.rs deleted file mode 100644 index b552fefe..00000000 --- a/src/tests/tsconfig_project_references.rs +++ /dev/null @@ -1,101 +0,0 @@ -//! Tests for tsconfig project references - -use crate::{ResolveError, ResolveOptions, Resolver, TsconfigOptions, TsconfigReferences}; - -#[test] -fn auto() { - let f = super::fixture_root().join("tsconfig/cases/project_references"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("app"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - // Test normal paths alias - (f.join("app"), "@/index.ts", f.join("app/aliased/index.ts")), - (f.join("app"), "@/../index.ts", f.join("app/index.ts")), - // Test project reference - (f.join("project_a"), "@/index.ts", f.join("project_a/aliased/index.ts")), - (f.join("project_b/src"), "@/index.ts", f.join("project_b/src/aliased/index.ts")), - // Does not have paths alias - (f.join("project_a"), "./index.ts", f.join("project_a/index.ts")), - (f.join("project_c"), "./index.ts", f.join("project_c/index.ts")), - // Template variable - { - let dir = f.parent().unwrap().join("paths_template_variable"); - (dir.clone(), "foo", dir.join("foo.js")) - } - ]; - - for (path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{request} {path:?}"); - } -} - -#[test] -fn disabled() { - let f = super::fixture_root().join("tsconfig/cases/project_references"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("app"), - references: TsconfigReferences::Disabled, - }), - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - // Test normal paths alias - (f.join("app"), "@/index.ts", Ok(f.join("app/aliased/index.ts"))), - (f.join("app"), "@/../index.ts", Ok(f.join("app/index.ts"))), - // Test project reference - (f.join("project_a"), "@/index.ts", Err(ResolveError::NotFound("@/index.ts".into()))), - (f.join("project_b/src"), "@/index.ts", Err(ResolveError::NotFound("@/index.ts".into()))), - // Does not have paths alias - (f.join("project_a"), "./index.ts", Ok(f.join("project_a/index.ts"))), - (f.join("project_c"), "./index.ts", Ok(f.join("project_c/index.ts"))), - ]; - - for (path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, expected, "{request} {path:?}"); - } -} - -#[test] -fn manual() { - let f = super::fixture_root().join("tsconfig/cases/project_references"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("app"), - references: TsconfigReferences::Paths(vec!["../project_a/conf.json".into()]), - }), - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - // Test normal paths alias - (f.join("app"), "@/index.ts", Ok(f.join("app/aliased/index.ts"))), - (f.join("app"), "@/../index.ts", Ok(f.join("app/index.ts"))), - // Test project reference - (f.join("project_a"), "@/index.ts", Ok(f.join("project_a/aliased/index.ts"))), - (f.join("project_b/src"), "@/index.ts", Err(ResolveError::NotFound("@/index.ts".into()))), - // Does not have paths alias - (f.join("project_a"), "./index.ts", Ok(f.join("project_a/index.ts"))), - (f.join("project_c"), "./index.ts", Ok(f.join("project_c/index.ts"))), - ]; - - for (path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, expected, "{request} {path:?}"); - } -} diff --git a/src/tsconfig.rs b/src/tsconfig.rs deleted file mode 100644 index aa00f6e4..00000000 --- a/src/tsconfig.rs +++ /dev/null @@ -1,212 +0,0 @@ -use std::{ - path::{Path, PathBuf}, - sync::Arc, -}; - -use serde::Deserialize; -use typescript_tsconfig_json::{CompilerOptionsPathsMap, ExtendsField}; - -use crate::PathUtil; - -#[derive(Debug, Deserialize)] -#[serde(rename_all = "camelCase")] -pub struct TsConfig { - /// Whether this is the caller tsconfig. - /// Used for final template variable substitution when all configs are extended and merged. - #[serde(skip)] - root: bool, - - /// Path to `tsconfig.json`. Contains the `tsconfig.json` filename. - #[serde(skip)] - path: PathBuf, - - #[serde(default)] - pub extends: Option, - - #[serde(default)] - pub compiler_options: CompilerOptions, - - /// Bubbled up project references with a reference to their tsconfig. - #[serde(default)] - pub references: Vec, -} - -/// Compiler Options -/// -/// -#[derive(Debug, Default, Deserialize)] -#[serde(rename_all = "camelCase")] -pub struct CompilerOptions { - base_url: Option, - - /// Path aliases - paths: Option, - - /// The actual base for where path aliases are resolved from. - #[serde(skip)] - paths_base: PathBuf, -} - -/// Project Reference -/// -/// -#[derive(Debug, Deserialize)] -pub struct ProjectReference { - /// The path property of each reference can point to a directory containing a tsconfig.json file, - /// or to the config file itself (which may have any name). - pub path: PathBuf, - - /// Reference to the resolved tsconfig - #[serde(skip)] - pub tsconfig: Option>, -} - -impl TsConfig { - pub fn parse(root: bool, path: &Path, json: &mut str) -> Result { - _ = json_strip_comments::strip(json); - let mut tsconfig: Self = serde_json::from_str(json)?; - tsconfig.root = root; - tsconfig.path = path.to_path_buf(); - let directory = tsconfig.directory().to_path_buf(); - if let Some(base_url) = tsconfig.compiler_options.base_url { - tsconfig.compiler_options.base_url = Some(directory.normalize_with(base_url)); - } - if tsconfig.compiler_options.paths.is_some() { - tsconfig.compiler_options.paths_base = - tsconfig.compiler_options.base_url.as_ref().map_or(directory, Clone::clone); - } - Ok(tsconfig) - } - - pub fn build(mut self) -> Self { - if self.root { - let dir = self.directory().to_path_buf(); - // Substitute template variable in `tsconfig.compilerOptions.paths` - if let Some(paths) = &mut self.compiler_options.paths { - for paths in paths.values_mut() { - for path in paths { - Self::substitute_template_variable(&dir, path); - } - } - } - } - self - } - - /// Directory to `tsconfig.json` - /// - /// # Panics - /// - /// * When the `tsconfig.json` path is misconfigured. - pub fn directory(&self) -> &Path { - debug_assert!(self.path.file_name().is_some()); - self.path.parent().unwrap() - } - - pub fn extend_tsconfig(&mut self, tsconfig: &Self) { - let compiler_options = &mut self.compiler_options; - if compiler_options.paths.is_none() { - compiler_options.paths_base = compiler_options - .base_url - .as_ref() - .map_or_else(|| tsconfig.compiler_options.paths_base.clone(), Clone::clone); - compiler_options.paths.clone_from(&tsconfig.compiler_options.paths); - } - if compiler_options.base_url.is_none() { - compiler_options.base_url.clone_from(&tsconfig.compiler_options.base_url); - } - } - - pub fn resolve(&self, path: &Path, specifier: &str) -> Vec { - if path.starts_with(self.base_path()) { - let paths = self.resolve_path_alias(specifier); - if !paths.is_empty() { - return paths; - } - } - for tsconfig in self.references.iter().filter_map(|reference| reference.tsconfig.as_ref()) { - if path.starts_with(tsconfig.base_path()) { - return tsconfig.resolve_path_alias(specifier); - } - } - vec![] - } - - // Copied from parcel - // - pub fn resolve_path_alias(&self, specifier: &str) -> Vec { - if specifier.starts_with(|s| s == '/' || s == '.') { - return vec![]; - } - - let base_url_iter = self - .compiler_options - .base_url - .as_ref() - .map_or_else(Vec::new, |base_url| vec![base_url.normalize_with(specifier)]); - - let Some(paths_map) = &self.compiler_options.paths else { - return base_url_iter; - }; - - let paths = paths_map.get(specifier).map_or_else( - || { - let mut longest_prefix_length = 0; - let mut longest_suffix_length = 0; - let mut best_key: Option<&String> = None; - - for key in paths_map.keys() { - if let Some((prefix, suffix)) = key.split_once('*') { - if (best_key.is_none() || prefix.len() > longest_prefix_length) - && specifier.starts_with(prefix) - && specifier.ends_with(suffix) - { - longest_prefix_length = prefix.len(); - longest_suffix_length = suffix.len(); - best_key.replace(key); - } - } - } - - best_key.and_then(|key| paths_map.get(key)).map_or_else(Vec::new, |paths| { - paths - .iter() - .map(|path| { - path.replace( - '*', - &specifier[longest_prefix_length - ..specifier.len() - longest_suffix_length], - ) - }) - .collect::>() - }) - }, - Clone::clone, - ); - - paths - .into_iter() - .map(|p| self.compiler_options.paths_base.normalize_with(p)) - .chain(base_url_iter) - .collect() - } - - fn base_path(&self) -> &Path { - self.compiler_options - .base_url - .as_ref() - .map_or_else(|| self.directory(), |path| path.as_ref()) - } - - /// Template variable `${configDir}` for substitution of config files directory path - /// - /// NOTE: All tests cases are just a head replacement of `${configDir}`, so we are constrained as such. - /// - /// See - fn substitute_template_variable(directory: &Path, path: &mut String) { - const TEMPLATE_VARIABLE: &str = "${configDir}/"; - if let Some(stripped_path) = path.strip_prefix(TEMPLATE_VARIABLE) { - *path = directory.join(stripped_path).to_string_lossy().to_string(); - } - } -} diff --git a/tests/integration_test.rs b/tests/integration_test.rs deleted file mode 100644 index d369413f..00000000 --- a/tests/integration_test.rs +++ /dev/null @@ -1,102 +0,0 @@ -//! Test public APIs - -use std::{env, path::PathBuf}; - -use oxc_resolver::{EnforceExtension, Resolution, ResolveContext, ResolveOptions, Resolver}; - -fn dir() -> PathBuf { - env::current_dir().unwrap() -} - -fn resolve(specifier: &str) -> Resolution { - let path = dir(); - Resolver::new(ResolveOptions::default()).resolve(path, specifier).unwrap() -} - -#[test] -fn clone() { - let resolution = resolve("./tests/package.json"); - assert_eq!(resolution.clone(), resolution); -} - -#[test] -fn debug() { - let resolution = resolve("./tests/package.json"); - let s = format!("{resolution:?}"); - assert!(!s.is_empty()); -} - -#[test] -fn eq() { - let resolution = resolve("./tests/package.json"); - assert_eq!(resolution, resolution); -} - -#[test] -fn package_json() { - let resolution = resolve("./tests/package.json"); - assert!(resolution - .package_json() - .is_some_and(|json| json.name.as_ref().is_some_and(|name| name == "name"))); -} - -#[cfg(feature = "package_json_raw_json_api")] -#[test] -fn package_json_raw_json_api() { - let resolution = resolve("./tests/package.json"); - assert!(resolution - .package_json() - .unwrap() - .raw_json() - .get("name") - .is_some_and(|name| name == "name")); -} - -#[test] -fn clear_cache() { - let resolver = Resolver::new(ResolveOptions::default()); - resolver.clear_cache(); // exists -} - -#[test] -fn options() { - let resolver = Resolver::new(ResolveOptions::default()); - let options = resolver.options(); - assert!(!format!("{options:?}").is_empty()); -} - -#[test] -fn debug_resolver() { - let resolver = Resolver::new(ResolveOptions::default()); - assert!(!format!("{resolver:?}").is_empty()); -} - -#[test] -fn dependencies() { - let path = dir(); - let mut ctx = ResolveContext::default(); - let _ = Resolver::new(ResolveOptions::default()).resolve_with_context( - path, - "./tests/package.json", - &mut ctx, - ); - assert!(!ctx.file_dependencies.is_empty()); - assert!(ctx.missing_dependencies.is_empty()); -} - -#[test] -fn options_api() { - _ = ResolveOptions::default() - .with_builtin_modules(true) - .with_condition_names(&[]) - .with_extension(".js") - .with_force_extension(EnforceExtension::Auto) - .with_fully_specified(true) - .with_main_field("asdf") - .with_main_file("main") - .with_module("module") - .with_prefer_absolute(true) - .with_prefer_relative(true) - .with_root(PathBuf::new()) - .with_symbolic_link(true); -} diff --git a/tests/package.json b/tests/package.json deleted file mode 100644 index f099adcf..00000000 --- a/tests/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "name": "name" -} diff --git a/tests/resolve_test.rs b/tests/resolve_test.rs deleted file mode 100644 index 30d1ceff..00000000 --- a/tests/resolve_test.rs +++ /dev/null @@ -1,104 +0,0 @@ -use std::{env, path::PathBuf}; - -use oxc_resolver::{ResolveError, ResolveOptions, Resolver}; - -fn dir() -> PathBuf { - env::current_dir().unwrap() -} - -#[test] -fn chinese() { - let dir = dir(); - let specifier = "./fixtures/misc/中文/中文.js"; - let resolution = Resolver::new(ResolveOptions::default()).resolve(&dir, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(dir.join("fixtures/misc/中文/中文.js")) - ); -} - -#[test] -fn styled_components() { - let dir = dir(); - let path = dir.join("fixtures/pnpm"); - let module_path = dir.join("node_modules/.pnpm/styled-components@6.1.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/styled-components"); - let specifier = "styled-components"; - - // cjs - let options = - ResolveOptions { alias_fields: vec![vec!["browser".into()]], ..ResolveOptions::default() }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/styled-components.browser.cjs.js")) - ); - - // esm - let options = ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - main_fields: vec!["module".into()], - ..ResolveOptions::default() - }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/styled-components.browser.esm.js")) - ); -} - -#[test] -fn axios() { - let dir = dir(); - let path = dir.join("fixtures/pnpm"); - let module_path = dir.join("node_modules/.pnpm/axios@1.6.2/node_modules/axios"); - let specifier = "axios"; - - // default - let options = ResolveOptions::default(); - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("index.js")) - ); - - // browser - let options = ResolveOptions { - condition_names: vec!["browser".into(), "require".into()], - ..ResolveOptions::default() - }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/browser/axios.cjs")) - ); - - // cjs - let options = ResolveOptions { - condition_names: vec!["node".into(), "require".into()], - ..ResolveOptions::default() - }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/node/axios.cjs")) - ); -} - -#[test] -fn postcss() { - let dir = dir(); - let path = dir.join("fixtures/pnpm"); - let module_path = path.join("node_modules/postcss"); - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - // should ignore "path" - let resolution = resolver.resolve(&module_path, "path"); - assert_eq!(resolution, Err(ResolveError::Ignored(module_path.clone()))); - - // should ignore "./lib/terminal-highlight" - let resolution = resolver.resolve(&module_path, "./lib/terminal-highlight"); - assert_eq!(resolution, Err(ResolveError::Ignored(module_path.join("lib/terminal-highlight")))); -} From f7e59920dd6d083292a318a16f2e21d2290bc8a7 Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Thu, 20 Jun 2024 15:11:20 +0300 Subject: [PATCH 31/82] squash! --- Cargo.lock | 858 ------ fixtures/enhanced_resolve/lib/index.js | 1 - fixtures/enhanced_resolve/package.json | 4 - fixtures/enhanced_resolve/test/.gitignore | 2 - .../enhanced_resolve/test/fixtures/#/a.js | 0 fixtures/enhanced_resolve/test/fixtures/a.js | 3 - .../enhanced_resolve/test/fixtures/abc.txt | 1 - .../test/fixtures/alias/files/a.js | 0 fixtures/enhanced_resolve/test/fixtures/b.js | 3 - .../browser-module/browser/module-a.js | 0 .../fixtures/browser-module/lib/browser.js | 0 .../fixtures/browser-module/lib/ignore.js | 0 .../test/fixtures/browser-module/lib/main.js | 0 .../fixtures/browser-module/lib/replaced.js | 0 .../test/fixtures/browser-module/lib/self.js | 0 .../fixtures/browser-module/lib/toString.js | 0 .../browser-module/node_modules/module-a.js | 0 .../browser-module/node_modules/module-b.js | 0 .../browser-module/node_modules/module-c.js | 0 .../node_modules/recursive-file/a.js | 0 .../node_modules/recursive-file/b.js | 0 .../node_modules/recursive-file/c.js | 0 .../node_modules/recursive-file/d.js | 0 .../node_modules/recursive-file/package.json | 8 - .../test/fixtures/browser-module/package.json | 33 - .../test/fixtures/builtins/package.json | 12 - fixtures/enhanced_resolve/test/fixtures/c.js | 4 - .../enhanced_resolve/test/fixtures/complex.js | 13 - .../test/fixtures/crypto-js/index.js | 0 .../test/fixtures/crypto-js/package.json | 7 - .../test/fixtures/decorated-fs/exists.js | 0 .../test/fixtures/dirOrFile.js | 1 - .../test/fixtures/dirOrFile/index.js | 1 - .../directory-default/directory-default.js | 0 .../node_modules/@org/pkg/dist/string.js | 1 - .../@org/pkg/dist/string.test.d.ts | 1 - .../node_modules/@org/pkg/package.json | 9 - .../node_modules/pkg/dist/string.js | 1 - .../node_modules/pkg/dist/string.test.d.ts | 1 - .../node_modules/pkg/package.json | 9 - .../node_modules/exports-field/package.json | 7 - .../node_modules/pack1/index.js | 0 .../test/fixtures/exports-field/a.js | 1 - .../node_modules/exports-field/lib/browser.js | 1 - .../node_modules/exports-field/lib/index.js | 0 .../exports-field/lib/lib2/main.js | 1 - .../node_modules/exports-field/lib/main.js | 1 - .../node_modules/exports-field/main.js | 1 - .../node_modules/exports-field/package.json | 18 - .../node_modules/exports-field/x.js | 1 - .../invalid-exports-field/index.js | 0 .../invalid-exports-field/package.json | 13 - .../node_modules/invalid-exports-field/umd.js | 0 .../test/fixtures/exports-field/package.json | 5 - .../node_modules/exports-field/index.js | 1 - .../node_modules/exports-field/lib/browser.js | 1 - .../exports-field/lib/lib2/main.js | 1 - .../node_modules/exports-field/lib/main.js | 1 - .../node_modules/exports-field/main.js | 1 - .../node_modules/exports-field/package.json | 17 - .../node_modules/exports-field/index | 0 .../node_modules/exports-field/main.js | 1 - .../node_modules/exports-field/package.json | 10 - .../node_modules/exports-field/src/index.js | 0 .../fixtures/extension-alias/dir/index.js | 0 .../fixtures/extension-alias/dir/index.ts | 0 .../fixtures/extension-alias/dir2/index.js | 0 .../fixtures/extension-alias/dir2/index.mts | 0 .../test/fixtures/extension-alias/index.js | 0 .../test/fixtures/extension-alias/index.mjs | 0 .../fixtures/extension-alias/index.mts.js | 0 .../test/fixtures/extension-alias/index.ts | 0 .../test/fixtures/extensions/app.module.js | 0 .../test/fixtures/extensions/dir/index.js | 0 .../test/fixtures/extensions/dir/index.ts | 0 .../test/fixtures/extensions/foo.js | 0 .../test/fixtures/extensions/foo.ts | 0 .../test/fixtures/extensions/index.js | 0 .../test/fixtures/extensions/index.ts | 0 .../extensions/node_modules/module.js | 0 .../extensions/node_modules/module/index.ts | 0 .../test/fixtures/extensions/package.json | 3 - .../enhanced_resolve/test/fixtures/file.load1 | 0 .../enhanced_resolve/test/fixtures/file.load2 | 0 .../test/fixtures/foo/index.js | 0 .../test/fixtures/foo/package.json | 4 - .../node_modules/m/package.json | 17 - .../node_modules/m/src/features/f.js | 0 .../m/src/features/internal/file.js | 0 .../node_modules/m/src/features/y/y.js | 0 .../node_modules/m/src/internal/i.js | 0 .../node_modules/m/src/middle-1/f.js | 0 .../node_modules/m/src/middle-1/nested/f.js | 0 .../node_modules/m/src/middle-2/nested/f.js | 1 - .../m/src/middle-3/nested/f/nested/f.js | 0 .../node_modules/m/src/middle-4/f/f.js | 0 .../node_modules/m/src/middle-5/f$/$.js | 0 .../node_modules/m/src/middle-5/f/$.js | 0 .../node_modules/m/src/middle/f.js | 0 .../node_modules/m/src/middle/nested/f.js | 0 .../test/fixtures/imports-field/a.js | 1 - .../test/fixtures/imports-field/b.js | 0 .../test/fixtures/imports-field/dir/b.js | 0 .../node_modules/a/lib/browser.js | 1 - .../imports-field/node_modules/a/lib/index.js | 0 .../node_modules/a/lib/lib2/main.js | 1 - .../imports-field/node_modules/a/lib/main.js | 1 - .../imports-field/node_modules/a/main.js | 1 - .../imports-field/node_modules/a/package.json | 18 - .../imports-field/node_modules/a/x.js | 1 - .../imports-field/node_modules/c/index.js | 0 .../test/fixtures/imports-field/package.json | 17 - .../fixtures/incorrect-package/pack1/a.js | 0 .../incorrect-package/pack1/package.json | 2 - .../fixtures/incorrect-package/pack2/a.js | 0 .../incorrect-package/pack2/package.json | 0 .../test/fixtures/issue-238/package.json | 3 - .../test/fixtures/issue-238/src/a/config.js | 0 .../src/common/config/myObjectFile.js | 0 .../enhanced_resolve/test/fixtures/lib.js | 0 .../test/fixtures/lib/complex1.js | 1 - .../test/fixtures/main-field-self/index.js | 0 .../fixtures/main-field-self/package.json | 3 - .../test/fixtures/main-field-self2/index.js | 0 .../fixtures/main-field-self2/package.json | 3 - .../enhanced_resolve/test/fixtures/main1.js | 9 - .../enhanced_resolve/test/fixtures/main2.js | 12 - .../enhanced_resolve/test/fixtures/main3.js | 4 - .../multiple_modules/node_modules/m1/a.js | 3 - .../test/fixtures/no#fragment/#/#.js | 0 fixtures/enhanced_resolve/test/fixtures/no.js | 0 .../browser-module-broken/browser.js | 0 .../browser-module-broken/main.js | 0 .../browser-module-broken/package.json | 4 - .../complexm/node_modules/m1/a.js | 1 - .../complexm/node_modules/m1/index.js | 1 - .../fixtures/node_modules/complexm/step1.js | 1 - .../fixtures/node_modules/complexm/step2.js | 1 - .../fixtures/node_modules/dash-name/index.js | 0 .../node_modules/dash-name/package.json | 4 - .../test/fixtures/node_modules/dash/index.js | 0 .../fixtures/node_modules/dash/package.json | 4 - .../invalidPackageJson/package.json | 0 .../test/fixtures/node_modules/m1/a.js | 3 - .../test/fixtures/node_modules/m1/b.js | 3 - .../test/fixtures/node_modules/m2/b.js | 1 - .../node_modules/recursive-module/file.js | 0 .../node_modules/recursive-module/index.js | 0 .../test/fixtures/pnp-a/m2/a.js | 3 - .../test/fixtures/pnp/pkg/dir/index.js | 0 .../test/fixtures/pnp/pkg/index.js | 0 .../test/fixtures/pnp/pkg/main.js | 0 .../fixtures/pnp/pkg/package-alias/browser.js | 0 .../fixtures/pnp/pkg/package-alias/index.js | 0 .../test/fixtures/pnp/pkg/package.json | 7 - .../test/fixtures/pnp/pkg/typescript/index.ts | 0 .../test/fixtures/pnp/pkg3/a.js | 1 - .../test/fixtures/pnp/pkg3/package.json | 8 - .../prefer-pnp/alternative-modules/m1/b.js | 0 .../restrictions/node_modules/pck1/index.css | 0 .../restrictions/node_modules/pck1/index.js | 0 .../node_modules/pck1/package.json | 3 - .../restrictions/node_modules/pck2/index.css | 0 .../restrictions/node_modules/pck2/module.js | 0 .../node_modules/pck2/package.json | 5 - .../test/fixtures/roots_fall_through/index.js | 0 .../scoped/node_modules/@scope/pack1/main.js | 0 .../node_modules/@scope/pack1/package.json | 5 - .../node_modules/@scope/pack2/lib/index.js | 0 .../scoped/node_modules/@scope/pack2/main.js | 0 .../node_modules/@scope/pack2/package.json | 3 - .../test/fixtures/shortcutdir.js/a.js | 0 .../test/fixtures/yield/a/foo-2/b | 0 .../test/fixtures/yield/a/foo-2/c | 0 .../test/fixtures/yield/a/foo/a | 0 .../test/fixtures/yield/a/foo/b | 0 .../test/fixtures/yield/b/foo/a | 0 .../test/fixtures/yield/c/foo/a | 0 .../test/fixtures/yield/c/foo/package.json | 7 - .../fixtures/\346\265\213\350\257\225.js" | 0 .../\344\270\255\346\226\207.js" | 0 fixtures/pnpm/.gitignore | 1 - fixtures/pnpm/package.json | 10 - fixtures/pnpm/pnpm-lock.yaml | 212 -- fixtures/tsconfig/cases/builtins/thing.js | 0 .../tsconfig/cases/builtins/tsconfig.json | 5 - fixtures/tsconfig/cases/exports/index.js | 0 fixtures/tsconfig/cases/exports/tsconfig.json | 3 - .../extends-extension/base-tsconfig.json | 7 - .../tsconfig/cases/extends-extension/foo.js | 0 .../cases/extends-extension/tsconfig.json | 3 - .../cases/extends-extensionless/foo.js | 0 .../cases/extends-extensionless/tsconfig.json | 3 - .../tsconfig/cases/extends-multiple/foo.js | 0 .../cases/extends-multiple/tsconfig.json | 6 - .../tsconfig/cases/extends-not-found/index.js | 0 .../cases/extends-not-found/tsconfig.json | 3 - .../tsconfig/cases/extends-paths/src/index.js | 0 .../cases/extends-paths/tsconfig.base.json | 7 - .../cases/extends-paths/tsconfig.json | 6 - fixtures/tsconfig/cases/field/index.js | 0 fixtures/tsconfig/cases/field/tsconfig.json | 3 - fixtures/tsconfig/cases/index/index.js | 0 fixtures/tsconfig/cases/index/tsconfig.json | 3 - .../cases/paths_template_variable/foo.js | 0 .../paths_template_variable/tsconfig1.json | 3 - .../paths_template_variable/tsconfig2.json | 8 - .../project_references/app/aliased/index.ts | 0 .../cases/project_references/app/index.ts | 0 .../project_references/app/tsconfig.json | 23 - .../project_a/aliased/index.ts | 0 .../project_references/project_a/conf.json | 8 - .../project_references/project_a/index.ts | 0 .../project_b/src/aliased/index.ts | 0 .../project_b/tsconfig.json | 9 - .../project_references/project_c/index.ts | 0 .../project_c/tsconfig.json | 5 - .../project_references/tsconfig.base.json | 4 - fixtures/tsconfig/cases/suffixes/a.ios.ts | 0 fixtures/tsconfig/cases/suffixes/a.ts | 0 fixtures/tsconfig/cases/suffixes/b.ts | 0 fixtures/tsconfig/cases/suffixes/c-test.ts | 0 fixtures/tsconfig/cases/suffixes/index.ts | 1 - .../tsconfig/cases/suffixes/tsconfig.json | 5 - fixtures/tsconfig/cases/trailing-comma/bar.js | 0 .../tsconfig/cases/trailing-comma/index.js | 0 .../cases/trailing-comma/tsconfig.json | 9 - fixtures/tsconfig/foo.js | 0 fixtures/tsconfig/nested/index.js | 0 fixtures/tsconfig/nested/test.js | 0 fixtures/tsconfig/nested/tsconfig.json | 8 - .../node_modules/tsconfig-exports/conf.json | 7 - .../node_modules/tsconfig-exports/foo.js | 0 .../tsconfig-exports/package.json | 7 - .../node_modules/tsconfig-field/conf.json | 7 - .../node_modules/tsconfig-field/foo.js | 0 .../node_modules/tsconfig-field/package.json | 5 - .../node_modules/tsconfig-index/foo.js | 0 .../node_modules/tsconfig-index/package.json | 4 - .../node_modules/tsconfig-index/tsconfig.json | 7 - .../node_modules/tsconfig-not-used/foo.js | 0 .../tsconfig-not-used/tsconfig.json | 7 - fixtures/tsconfig/package.json | 24 - fixtures/tsconfig/tsconfig.json | 7 - .../tsconfig/tsconfig_template_variable.json | 7 - napi/__test__/resolver.spec.mjs | 260 -- napi/src/lib.rs | 166 - napi/src/options.rs | 261 -- napi/tests/options.test.mjs | 59 - npm/package.json | 67 +- package.json | 53 +- pnpm-lock.yaml | 2690 ----------------- src/builtins.rs | 71 - src/cache.rs | 369 --- src/context.rs | 89 - src/error.rs | 160 - src/file_system.rs | 133 - src/lib.rs | 1670 ---------- src/options.rs | 623 ---- src/package_json.rs | 207 -- src/path.rs | 132 - src/resolution.rs | 92 - src/specifier.rs | 230 -- src/tests/alias.rs | 280 -- src/tests/browser_field.rs | 189 -- src/tests/builtins.rs | 121 - src/tests/dependencies.rs | 110 - src/tests/exports_field.rs | 2546 ---------------- src/tests/extension_alias.rs | 66 - src/tests/extensions.rs | 125 - src/tests/fallback.rs | 100 - src/tests/full_specified.rs | 113 - src/tests/imports_field.rs | 1320 -------- src/tests/incorrect_description_file.rs | 62 - src/tests/main_field.rs | 24 - src/tests/memory_fs.rs | 74 - src/tests/missing.rs | 106 - src/tests/mod.rs | 49 - src/tests/resolve.rs | 119 - src/tests/restrictions.rs | 25 - src/tests/roots.rs | 92 - src/tests/scoped_packages.rs | 25 - src/tests/simple.rs | 68 - src/tests/symlink.rs | 121 - src/tests/tsconfig_paths.rs | 507 ---- src/tests/tsconfig_project_references.rs | 101 - src/tsconfig.rs | 212 -- tests/integration_test.rs | 102 - tests/package.json | 3 - tests/resolve_test.rs | 104 - 290 files changed, 50 insertions(+), 15709 deletions(-) delete mode 100644 Cargo.lock delete mode 100644 fixtures/enhanced_resolve/lib/index.js delete mode 100644 fixtures/enhanced_resolve/package.json delete mode 100644 fixtures/enhanced_resolve/test/.gitignore delete mode 100644 fixtures/enhanced_resolve/test/fixtures/#/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/abc.txt delete mode 100644 fixtures/enhanced_resolve/test/fixtures/alias/files/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/browser/module-a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/ignore.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/replaced.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/self.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/toString.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-c.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/c.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/d.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/builtins/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/c.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/complex.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/crypto-js/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/decorated-fs/exists.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/dirOrFile.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/directory-default/directory-default.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/pack1/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/umd.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/index delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/src/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.mts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mjs delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mts.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/app.module.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/foo.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/foo.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/file.load1 delete mode 100644 fixtures/enhanced_resolve/test/fixtures/file.load2 delete mode 100644 fixtures/enhanced_resolve/test/fixtures/foo/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/foo/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/internal/file.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/y/y.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/internal/i.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-3/nested/f/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-4/f/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f$/$.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f/$.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/dir/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/c/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/issue-238/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/issue-238/src/a/config.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/issue-238/src/common/config/myObjectFile.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/lib.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/lib/complex1.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self2/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main1.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main2.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main3.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/no#fragment/#/#.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/no.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/invalidPackageJson/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/file.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/dir/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/typescript/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/prefer-pnp/alternative-modules/m1/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.css delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/index.css delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/module.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/roots_fall_through/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/lib/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/shortcutdir.js/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/b delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/c delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo/a delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo/b delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/b/foo/a delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/c/foo/a delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json delete mode 100644 "fixtures/enhanced_resolve/test/fixtures/\346\265\213\350\257\225.js" delete mode 100644 "fixtures/misc/\344\270\255\346\226\207/\344\270\255\346\226\207.js" delete mode 100644 fixtures/pnpm/.gitignore delete mode 100644 fixtures/pnpm/package.json delete mode 100644 fixtures/pnpm/pnpm-lock.yaml delete mode 100644 fixtures/tsconfig/cases/builtins/thing.js delete mode 100644 fixtures/tsconfig/cases/builtins/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/exports/index.js delete mode 100644 fixtures/tsconfig/cases/exports/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-extension/base-tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-extension/foo.js delete mode 100644 fixtures/tsconfig/cases/extends-extension/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-extensionless/foo.js delete mode 100644 fixtures/tsconfig/cases/extends-extensionless/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-multiple/foo.js delete mode 100644 fixtures/tsconfig/cases/extends-multiple/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-not-found/index.js delete mode 100644 fixtures/tsconfig/cases/extends-not-found/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-paths/src/index.js delete mode 100644 fixtures/tsconfig/cases/extends-paths/tsconfig.base.json delete mode 100644 fixtures/tsconfig/cases/extends-paths/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/field/index.js delete mode 100644 fixtures/tsconfig/cases/field/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/index/index.js delete mode 100644 fixtures/tsconfig/cases/index/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/paths_template_variable/foo.js delete mode 100644 fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json delete mode 100644 fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json delete mode 100644 fixtures/tsconfig/cases/project_references/app/aliased/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/app/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/app/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/project_references/project_a/aliased/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_a/conf.json delete mode 100644 fixtures/tsconfig/cases/project_references/project_a/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_b/src/aliased/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_b/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/project_references/project_c/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_c/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/project_references/tsconfig.base.json delete mode 100644 fixtures/tsconfig/cases/suffixes/a.ios.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/a.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/b.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/c-test.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/index.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/trailing-comma/bar.js delete mode 100644 fixtures/tsconfig/cases/trailing-comma/index.js delete mode 100644 fixtures/tsconfig/cases/trailing-comma/tsconfig.json delete mode 100644 fixtures/tsconfig/foo.js delete mode 100644 fixtures/tsconfig/nested/index.js delete mode 100644 fixtures/tsconfig/nested/test.js delete mode 100644 fixtures/tsconfig/nested/tsconfig.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-exports/conf.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-exports/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-exports/package.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-field/conf.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-field/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-field/package.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-index/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-index/package.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-not-used/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json delete mode 100755 fixtures/tsconfig/package.json delete mode 100644 fixtures/tsconfig/tsconfig.json delete mode 100644 fixtures/tsconfig/tsconfig_template_variable.json delete mode 100644 napi/__test__/resolver.spec.mjs delete mode 100644 napi/src/lib.rs delete mode 100644 napi/src/options.rs delete mode 100644 napi/tests/options.test.mjs delete mode 100644 pnpm-lock.yaml delete mode 100644 src/builtins.rs delete mode 100644 src/cache.rs delete mode 100644 src/context.rs delete mode 100644 src/error.rs delete mode 100644 src/file_system.rs delete mode 100644 src/lib.rs delete mode 100644 src/options.rs delete mode 100644 src/package_json.rs delete mode 100644 src/path.rs delete mode 100644 src/resolution.rs delete mode 100644 src/specifier.rs delete mode 100644 src/tests/alias.rs delete mode 100644 src/tests/browser_field.rs delete mode 100644 src/tests/builtins.rs delete mode 100644 src/tests/dependencies.rs delete mode 100644 src/tests/exports_field.rs delete mode 100644 src/tests/extension_alias.rs delete mode 100644 src/tests/extensions.rs delete mode 100644 src/tests/fallback.rs delete mode 100644 src/tests/full_specified.rs delete mode 100644 src/tests/imports_field.rs delete mode 100644 src/tests/incorrect_description_file.rs delete mode 100644 src/tests/main_field.rs delete mode 100644 src/tests/memory_fs.rs delete mode 100644 src/tests/missing.rs delete mode 100644 src/tests/mod.rs delete mode 100644 src/tests/resolve.rs delete mode 100644 src/tests/restrictions.rs delete mode 100644 src/tests/roots.rs delete mode 100644 src/tests/scoped_packages.rs delete mode 100644 src/tests/simple.rs delete mode 100644 src/tests/symlink.rs delete mode 100644 src/tests/tsconfig_paths.rs delete mode 100644 src/tests/tsconfig_project_references.rs delete mode 100644 src/tsconfig.rs delete mode 100644 tests/integration_test.rs delete mode 100644 tests/package.json delete mode 100644 tests/resolve_test.rs diff --git a/Cargo.lock b/Cargo.lock deleted file mode 100644 index c83523b3..00000000 --- a/Cargo.lock +++ /dev/null @@ -1,858 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "aho-corasick" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" -dependencies = [ - "memchr", -] - -[[package]] -name = "anes" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "735d4f398ca57cfa2880225c2bf81c3b9af3be5bb22e44ae70118dad38713e84" - -[[package]] -name = "autocfg" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "bitflags" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" - -[[package]] -name = "bpaf" -version = "0.9.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3280efcf6d66bc77c2cf9b67dc8acee47a217d9be67dd590b3230dffe663724d" - -[[package]] -name = "cast" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "ciborium" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42e69ffd6f0917f5c029256a24d0161db17cea3997d185db0d35926308770f0e" -dependencies = [ - "ciborium-io", - "ciborium-ll", - "serde", -] - -[[package]] -name = "ciborium-io" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05afea1e0a06c9be33d539b876f1ce3692f4afea2cb41f740e7743225ed1c757" - -[[package]] -name = "ciborium-ll" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57663b653d948a338bfb3eeba9bb2fd5fcfaecb9e199e87e1eda4d9e8b240fd9" -dependencies = [ - "ciborium-io", - "half", -] - -[[package]] -name = "clean-path" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aaa6b4b263a5d737e9bf6b7c09b72c41a5480aec4d7219af827f6564e950b6a5" - -[[package]] -name = "codspeed" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a104ac948e0188b921eb3fcbdd55dcf62e542df4c7ab7e660623f6288302089" -dependencies = [ - "colored", - "libc", - "serde_json", -] - -[[package]] -name = "colored" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbf2150cce219b664a8a70df7a1f933836724b503f8a413af9365b4dcc4d90b8" -dependencies = [ - "lazy_static", - "windows-sys 0.48.0", -] - -[[package]] -name = "convert_case" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec182b0ca2f35d8fc196cf3404988fd8b8c739a4d270ff118a398feb0cbec1ca" -dependencies = [ - "unicode-segmentation", -] - -[[package]] -name = "criterion2" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7258985df1aa8b33359ee2392cbc3b7802875242cdacdda91a17a602132c24a9" -dependencies = [ - "anes", - "bpaf", - "cast", - "ciborium", - "codspeed", - "colored", - "num-traits", - "oorandom", - "serde", - "serde_json", - "walkdir", -] - -[[package]] -name = "crossbeam-deque" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" -dependencies = [ - "crossbeam-epoch", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.9.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" -dependencies = [ - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" - -[[package]] -name = "crunchy" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" - -[[package]] -name = "ctor" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edb49164822f3ee45b17acd4a208cfc1251410cf0cad9a833234c9890774dd9f" -dependencies = [ - "quote", - "syn", -] - -[[package]] -name = "dashmap" -version = "5.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" -dependencies = [ - "cfg-if", - "hashbrown", - "lock_api", - "once_cell", - "parking_lot_core", -] - -[[package]] -name = "document-features" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef5282ad69563b5fc40319526ba27e0e7363d552a896f0297d54f767717f9b95" -dependencies = [ - "litrs", -] - -[[package]] -name = "dunce" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b" - -[[package]] -name = "either" -version = "1.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dca9240753cf90908d7e4aac30f630662b02aebaa1b58a3cadabdb23385b58b" - -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "filetime" -version = "0.2.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ee447700ac8aa0b2f2bd7bc4462ad686ba06baa6727ac149a2d6277f0d240fd" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall 0.4.1", - "windows-sys 0.52.0", -] - -[[package]] -name = "half" -version = "2.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dd08c532ae367adf81c312a4580bc67f1d0fe8bc9c460520283f4c0ff277888" -dependencies = [ - "cfg-if", - "crunchy", -] - -[[package]] -name = "hashbrown" -version = "0.14.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" - -[[package]] -name = "indexmap" -version = "2.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" -dependencies = [ - "equivalent", - "hashbrown", - "serde", -] - -[[package]] -name = "itoa" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" - -[[package]] -name = "json-strip-comments" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3d129799327c8f80861e467c59b825ba24c277dba6ad0d71a141dc98f9e04ee" - -[[package]] -name = "lazy_static" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" - -[[package]] -name = "libc" -version = "0.2.155" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" - -[[package]] -name = "libloading" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c2a198fb6b0eada2a8df47933734e6d35d350665a33a3593d7164fa52c75c19" -dependencies = [ - "cfg-if", - "windows-targets 0.52.5", -] - -[[package]] -name = "litrs" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4ce301924b7887e9d637144fdade93f9dfff9b60981d4ac161db09720d39aa5" - -[[package]] -name = "lock_api" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" -dependencies = [ - "autocfg", - "scopeguard", -] - -[[package]] -name = "memchr" -version = "2.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" - -[[package]] -name = "napi" -version = "2.16.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfc300228808a0e6aea5a58115c82889240bcf8dab16fc25ad675b33e454b368" -dependencies = [ - "bitflags 2.5.0", - "ctor", - "napi-derive", - "napi-sys", - "once_cell", - "serde", - "serde_json", -] - -[[package]] -name = "napi-build" -version = "2.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1c0f5d67ee408a4685b61f5ab7e58605c8ae3f2b4189f0127d804ff13d5560a" - -[[package]] -name = "napi-derive" -version = "2.16.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0e034ddf6155192cf83f267ede763fe6c164dfa9971585436b16173718d94c4" -dependencies = [ - "cfg-if", - "convert_case", - "napi-derive-backend", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "napi-derive-backend" -version = "1.0.67" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bff2c00437f3b3266391eb5e6aa25d0029187daf5caf05b8e3271468fb5ae73e" -dependencies = [ - "convert_case", - "once_cell", - "proc-macro2", - "quote", - "regex", - "semver", - "syn", -] - -[[package]] -name = "napi-sys" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "427802e8ec3a734331fec1035594a210ce1ff4dc5bc1950530920ab717964ea3" -dependencies = [ - "libloading", -] - -[[package]] -name = "normalize-path" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5438dd2b2ff4c6df6e1ce22d825ed2fa93ee2922235cc45186991717f0a892d" - -[[package]] -name = "num-traits" -version = "0.2.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" -dependencies = [ - "autocfg", -] - -[[package]] -name = "once_cell" -version = "1.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" - -[[package]] -name = "oorandom" -version = "11.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575" - -[[package]] -name = "oxc_napi_resolver" -version = "0.0.0" -dependencies = [ - "napi", - "napi-build", - "napi-derive", - "oxc_resolver", -] - -[[package]] -name = "oxc_resolver" -version = "1.8.1" -dependencies = [ - "criterion2", - "dashmap", - "document-features", - "dunce", - "json-strip-comments", - "normalize-path", - "once_cell", - "rayon", - "rustc-hash", - "serde", - "serde_json", - "thiserror", - "tracing", - "typescript_tsconfig_json", - "vfs", -] - -[[package]] -name = "parking_lot_core" -version = "0.9.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall 0.5.1", - "smallvec", - "windows-targets 0.52.5", -] - -[[package]] -name = "pin-project-lite" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" - -[[package]] -name = "proc-macro2" -version = "1.0.85" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22244ce15aa966053a896d1accb3a6e68469b97c7f33f284b99f0d576879fc23" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.36" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "rayon" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" -dependencies = [ - "either", - "rayon-core", -] - -[[package]] -name = "rayon-core" -version = "1.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" -dependencies = [ - "crossbeam-deque", - "crossbeam-utils", -] - -[[package]] -name = "redox_syscall" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" -dependencies = [ - "bitflags 1.3.2", -] - -[[package]] -name = "redox_syscall" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "469052894dcb553421e483e4209ee581a45100d31b4018de03e5a7ad86374a7e" -dependencies = [ - "bitflags 2.5.0", -] - -[[package]] -name = "regex" -version = "1.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" -dependencies = [ - "aho-corasick", - "memchr", - "regex-automata", - "regex-syntax", -] - -[[package]] -name = "regex-automata" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", -] - -[[package]] -name = "regex-syntax" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" - -[[package]] -name = "rustc-hash" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" - -[[package]] -name = "ryu" -version = "1.0.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" - -[[package]] -name = "same-file" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "scopeguard" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" - -[[package]] -name = "semver" -version = "1.0.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" - -[[package]] -name = "serde" -version = "1.0.203" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7253ab4de971e72fb7be983802300c30b5a7f0c2e56fab8abfc6a214307c0094" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.203" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "serde_json" -version = "1.0.117" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3" -dependencies = [ - "indexmap", - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "smallvec" -version = "1.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" - -[[package]] -name = "syn" -version = "2.0.66" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c42f3f41a2de00b01c0aaad383c5a45241efc8b2d1eda5661812fda5f3cdcff5" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "thiserror" -version = "1.0.61" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.61" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "tracing" -version = "0.1.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" -dependencies = [ - "pin-project-lite", - "tracing-attributes", - "tracing-core", -] - -[[package]] -name = "tracing-attributes" -version = "0.1.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "tracing-core" -version = "0.1.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" -dependencies = [ - "once_cell", -] - -[[package]] -name = "typescript_tsconfig_json" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7cc416eaf05297012ead9d192226fe9a92e9a20f64f8780efb9085aaae9b590" -dependencies = [ - "clean-path", - "indexmap", - "rustc-hash", - "serde", - "serde_json", -] - -[[package]] -name = "unicode-ident" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" - -[[package]] -name = "unicode-segmentation" -version = "1.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" - -[[package]] -name = "vfs" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "654cd097e182a71dbf899178e6b5662c2157dd0b8afd5975de18008f6fc173d1" -dependencies = [ - "filetime", -] - -[[package]] -name = "walkdir" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" -dependencies = [ - "same-file", - "winapi-util", -] - -[[package]] -name = "winapi-util" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b" -dependencies = [ - "windows-sys 0.52.0", -] - -[[package]] -name = "windows-sys" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" -dependencies = [ - "windows-targets 0.48.5", -] - -[[package]] -name = "windows-sys" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" -dependencies = [ - "windows-targets 0.52.5", -] - -[[package]] -name = "windows-targets" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" -dependencies = [ - "windows_aarch64_gnullvm 0.48.5", - "windows_aarch64_msvc 0.48.5", - "windows_i686_gnu 0.48.5", - "windows_i686_msvc 0.48.5", - "windows_x86_64_gnu 0.48.5", - "windows_x86_64_gnullvm 0.48.5", - "windows_x86_64_msvc 0.48.5", -] - -[[package]] -name = "windows-targets" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" -dependencies = [ - "windows_aarch64_gnullvm 0.52.5", - "windows_aarch64_msvc 0.52.5", - "windows_i686_gnu 0.52.5", - "windows_i686_gnullvm", - "windows_i686_msvc 0.52.5", - "windows_x86_64_gnu 0.52.5", - "windows_x86_64_gnullvm 0.52.5", - "windows_x86_64_msvc 0.52.5", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" - -[[package]] -name = "windows_i686_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" - -[[package]] -name = "windows_i686_gnu" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" - -[[package]] -name = "windows_i686_gnullvm" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" - -[[package]] -name = "windows_i686_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" - -[[package]] -name = "windows_i686_msvc" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" diff --git a/fixtures/enhanced_resolve/lib/index.js b/fixtures/enhanced_resolve/lib/index.js deleted file mode 100644 index 1e872e8f..00000000 --- a/fixtures/enhanced_resolve/lib/index.js +++ /dev/null @@ -1 +0,0 @@ -// mimic enhanced-resolved root directory structure diff --git a/fixtures/enhanced_resolve/package.json b/fixtures/enhanced_resolve/package.json deleted file mode 100644 index d1b845b5..00000000 --- a/fixtures/enhanced_resolve/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "enhanced-resolve", - "main": "lib/index.js" -} diff --git a/fixtures/enhanced_resolve/test/.gitignore b/fixtures/enhanced_resolve/test/.gitignore deleted file mode 100644 index bbbec5f4..00000000 --- a/fixtures/enhanced_resolve/test/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# created by symlink.rs -/temp diff --git a/fixtures/enhanced_resolve/test/fixtures/#/a.js b/fixtures/enhanced_resolve/test/fixtures/#/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/a.js b/fixtures/enhanced_resolve/test/fixtures/a.js deleted file mode 100644 index 896ffc6d..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/abc.txt b/fixtures/enhanced_resolve/test/fixtures/abc.txt deleted file mode 100644 index f2ba8f84..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/abc.txt +++ /dev/null @@ -1 +0,0 @@ -abc \ No newline at end of file diff --git a/fixtures/enhanced_resolve/test/fixtures/alias/files/a.js b/fixtures/enhanced_resolve/test/fixtures/alias/files/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/b.js b/fixtures/enhanced_resolve/test/fixtures/b.js deleted file mode 100644 index 11476340..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/b.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function b() { - return "This is b"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/browser/module-a.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/browser/module-a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/browser.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/ignore.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/ignore.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/replaced.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/replaced.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/self.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/self.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/toString.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/toString.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-a.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-b.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-c.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-c.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/a.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/b.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/c.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/c.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/d.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/d.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json deleted file mode 100644 index c13fe23b..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "browser": { - "a.js": "./a", - "./b.js": "./b", - "c.js": "./d.js", - "./d.js": "./c.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/package.json b/fixtures/enhanced_resolve/test/fixtures/browser-module/package.json deleted file mode 100644 index 19ff7739..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/browser-module/package.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "exports": { - "./lib/index.js": "./lib/index.js" - }, - "browser": { - "./lib/ignore.js": false, - "./lib/replaced.js": "./lib/browser", - "module-a": "./browser/module-a.js", - "module-b": "module-c", - "module-c": "module-c", - "./toString": "./lib/toString.js", - "./lib/main.js": "./lib/main.js", - "./main.js": "./lib/main.js", - "./lib/xyz.js": "./xyz.js", - "./xyz.js": "./lib/xyz.js", - "./lib/non-existent.js": "./lib/non-existent.js", - ".": false, - "./number": 1, - "./foo": "./lib/replaced.js?query" - }, - "innerBrowser1": { - "field": { - "browser": { - "./lib/main1.js": "./lib/main.js" - } - } - }, - "innerBrowser2": { - "browser": { - "./lib/main2.js": "./lib/replaced.js" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/builtins/package.json b/fixtures/enhanced_resolve/test/fixtures/builtins/package.json deleted file mode 100644 index 4a54ea96..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/builtins/package.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "name": "builtins", - "private": true, - "imports": { - "#fs": { - "default": "fs" - }, - "#http": { - "node": "node:http" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/c.js b/fixtures/enhanced_resolve/test/fixtures/c.js deleted file mode 100644 index e3aca8aa..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/c.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = function b() { - require("./a"); - return "This is c"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/complex.js b/fixtures/enhanced_resolve/test/fixtures/complex.js deleted file mode 100644 index 1f62db84..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/complex.js +++ /dev/null @@ -1,13 +0,0 @@ -var 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); diff --git a/fixtures/enhanced_resolve/test/fixtures/crypto-js/index.js b/fixtures/enhanced_resolve/test/fixtures/crypto-js/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json b/fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json deleted file mode 100644 index 1d31aa8b..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "crypto-js", - "main": "index.js", - "browser": { - "crypto": false - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/decorated-fs/exists.js b/fixtures/enhanced_resolve/test/fixtures/decorated-fs/exists.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/dirOrFile.js b/fixtures/enhanced_resolve/test/fixtures/dirOrFile.js deleted file mode 100644 index c3cb885f..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/dirOrFile.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "file"; diff --git a/fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js b/fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js deleted file mode 100644 index 85e01cd4..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "dir"; diff --git a/fixtures/enhanced_resolve/test/fixtures/directory-default/directory-default.js b/fixtures/enhanced_resolve/test/fixtures/directory-default/directory-default.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js deleted file mode 100644 index d1007aae..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js +++ /dev/null @@ -1 +0,0 @@ -export default "string"; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts deleted file mode 100644 index cb0ff5c3..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json deleted file mode 100644 index b523a1e9..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "@org/pkg", - "exports": { - "./*.js": { - "types": "./dist/*.d.ts", - "default": "./dist/*.js" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js deleted file mode 100644 index d1007aae..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js +++ /dev/null @@ -1 +0,0 @@ -export default "string"; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts deleted file mode 100644 index cb0ff5c3..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json deleted file mode 100644 index 8e55fb46..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "@raviqqe/hidash", - "exports": { - "./*.js": { - "types": "./dist/*.d.ts", - "default": "./dist/*.js" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json deleted file mode 100644 index f0edf449..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "exports-field", - "version": "1.0.0", - "exports": { - ".": "./a/../b/../../pack1/index.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/pack1/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/pack1/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/a.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/a.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json deleted file mode 100644 index 6b105c08..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "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/": { - "webpack": ["./lib/lib2/", "./lib/"], - "node": "./lib/", - "default": "./lib/" - }, - "./dist/a.js": "./../../a.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json deleted file mode 100644 index 0012a3de..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "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" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/umd.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/umd.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field/package.json deleted file mode 100644 index 5fa72bb5..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "@exports-field/core", - "version": "1.0.0", - "exports": "./a.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json deleted file mode 100644 index e6f12074..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "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/lib2/", "./lib/"], - "node": "./lib/", - "default": "./lib/" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/index b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/index deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json deleted file mode 100644 index 1a838f49..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "name": "exports-field", - "exportsField": { - "exports": "./main.js" - }, - "ex": "./index", - "broken": { - ".": "./src" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/src/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/src/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.ts b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.mts b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.mts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mjs b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mjs deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mts.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mts.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.ts b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/app.module.js b/fixtures/enhanced_resolve/test/fixtures/extensions/app.module.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.js b/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/foo.js b/fixtures/enhanced_resolve/test/fixtures/extensions/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/foo.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/foo.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/index.js b/fixtures/enhanced_resolve/test/fixtures/extensions/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/index.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module.js b/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module/index.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/package.json b/fixtures/enhanced_resolve/test/fixtures/extensions/package.json deleted file mode 100644 index 5e55a1e8..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/extensions/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "./index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/file.load1 b/fixtures/enhanced_resolve/test/fixtures/file.load1 deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/file.load2 b/fixtures/enhanced_resolve/test/fixtures/file.load2 deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/foo/index.js b/fixtures/enhanced_resolve/test/fixtures/foo/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/foo/package.json b/fixtures/enhanced_resolve/test/fixtures/foo/package.json deleted file mode 100644 index da86787a..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/foo/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "foo", - "version": "1.0.0" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json deleted file mode 100644 index aa2be496..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "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" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/internal/file.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/internal/file.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/y/y.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/y/y.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/internal/i.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/internal/i.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/nested/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js deleted file mode 100644 index e5b70a86..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = { nested: "nested" } diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-3/nested/f/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-3/nested/f/nested/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-4/f/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-4/f/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f$/$.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f$/$.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f/$.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f/$.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/nested/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/a.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/a.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/b.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/dir/b.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/dir/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/index.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json deleted file mode 100644 index 8d8d3a46..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "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/lib2/", "./lib/"], - "node": "./lib/", - "default": "./lib/" - }, - "./dist/a.js": "./../../a.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/c/index.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/c/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/imports-field/package.json deleted file mode 100644 index 248351a9..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "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" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/a.js b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json deleted file mode 100644 index ded7faa2..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json +++ /dev/null @@ -1,2 +0,0 @@ -{ - "main": "./a.js", diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/a.js b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/package.json b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/package.json deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/issue-238/package.json b/fixtures/enhanced_resolve/test/fixtures/issue-238/package.json deleted file mode 100644 index 352055cd..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/issue-238/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "private": true -} diff --git a/fixtures/enhanced_resolve/test/fixtures/issue-238/src/a/config.js b/fixtures/enhanced_resolve/test/fixtures/issue-238/src/a/config.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/issue-238/src/common/config/myObjectFile.js b/fixtures/enhanced_resolve/test/fixtures/issue-238/src/common/config/myObjectFile.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/lib.js b/fixtures/enhanced_resolve/test/fixtures/lib.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/lib/complex1.js b/fixtures/enhanced_resolve/test/fixtures/lib/complex1.js deleted file mode 100644 index b3de3d70..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/lib/complex1.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "lib complex1"; diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self/index.js b/fixtures/enhanced_resolve/test/fixtures/main-field-self/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json b/fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json deleted file mode 100644 index a2b6f341..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "./" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self2/index.js b/fixtures/enhanced_resolve/test/fixtures/main-field-self2/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json b/fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json deleted file mode 100644 index 4fa6f730..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "." -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main1.js b/fixtures/enhanced_resolve/test/fixtures/main1.js deleted file mode 100644 index 168f2a1e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main1.js +++ /dev/null @@ -1,9 +0,0 @@ -var a = require("./a"); -if (x) { - for (var i = 0; i < 100; i++) { - while (true) require("./b"); - do { - i++; - } while (require("m1/a")()); - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main2.js b/fixtures/enhanced_resolve/test/fixtures/main2.js deleted file mode 100644 index 39f062b1..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main2.js +++ /dev/null @@ -1,12 +0,0 @@ -var 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"); - }); - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main3.js b/fixtures/enhanced_resolve/test/fixtures/main3.js deleted file mode 100644 index 1c180166..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main3.js +++ /dev/null @@ -1,4 +0,0 @@ -var a = require("./a"); -require.ensure([], function(require) { - require("./c.js"); -}); diff --git a/fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js b/fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js deleted file mode 100644 index 997c1051..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is nested m1/a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/no#fragment/#/#.js b/fixtures/enhanced_resolve/test/fixtures/no#fragment/#/#.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/no.js b/fixtures/enhanced_resolve/test/fixtures/no.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/browser.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/browser.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/main.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json deleted file mode 100644 index c469e1fd..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "main": "./main.js", - "browser": "./browser.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js deleted file mode 100644 index 549620a5..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "the correct a.js"; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js deleted file mode 100644 index 5db6632e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = " :) " + require("m2/b.js"); diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js deleted file mode 100644 index d308569d..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require("m1/a") + require("m1"); diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js deleted file mode 100644 index cb8127e8..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "Step2"; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json deleted file mode 100644 index 8d6dfa56..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "dash-name", - "exports": "./index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json deleted file mode 100644 index 4fd8706e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "dash", - "exports": "./index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/invalidPackageJson/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/invalidPackageJson/package.json deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js deleted file mode 100644 index 46fc8e6c..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is m1/a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js deleted file mode 100644 index 8565c244..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is m1/b"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js deleted file mode 100644 index 34faaaf5..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "This is m2/b"; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/file.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/file.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js b/fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js deleted file mode 100644 index 997c1051..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is nested m1/a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/dir/index.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/dir/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/index.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/main.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/browser.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/browser.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/index.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json deleted file mode 100644 index e20ceaeb..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "main": "main.js", - "browser": { - "./package-alias/index.js": "./package-alias/browser.js", - "module": "pkg/dir/index" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/typescript/index.ts b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/typescript/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json deleted file mode 100644 index 4a1f838e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "@exports-field/core", - "version": "1.0.0", - "exports": { - ".": "./a.js", - "./x": "./a.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/prefer-pnp/alternative-modules/m1/b.js b/fixtures/enhanced_resolve/test/fixtures/prefer-pnp/alternative-modules/m1/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.css b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.css deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.js b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json deleted file mode 100644 index 14ab704d..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/index.css b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/index.css deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/module.js b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/module.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json deleted file mode 100644 index ee0eb71b..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "main": "../../../c.js", - "module": "module.js", - "style": "index.css" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/roots_fall_through/index.js b/fixtures/enhanced_resolve/test/fixtures/roots_fall_through/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/main.js b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json deleted file mode 100644 index 70a0f20f..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "browser": { - "./index.js": "./main.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/lib/index.js b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/lib/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/main.js b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json deleted file mode 100644 index 2af9e0d1..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "./main.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/shortcutdir.js/a.js b/fixtures/enhanced_resolve/test/fixtures/shortcutdir.js/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/b b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/b deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/c b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/c deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/a b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/a deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/b b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/b deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/b/foo/a b/fixtures/enhanced_resolve/test/fixtures/yield/b/foo/a deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/a b/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/a deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json b/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json deleted file mode 100644 index 0acc4b4c..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "foo", - "version": "1.0.0", - "browser": { - "./a": false - } -} diff --git "a/fixtures/enhanced_resolve/test/fixtures/\346\265\213\350\257\225.js" "b/fixtures/enhanced_resolve/test/fixtures/\346\265\213\350\257\225.js" deleted file mode 100644 index e69de29b..00000000 diff --git "a/fixtures/misc/\344\270\255\346\226\207/\344\270\255\346\226\207.js" "b/fixtures/misc/\344\270\255\346\226\207/\344\270\255\346\226\207.js" deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/pnpm/.gitignore b/fixtures/pnpm/.gitignore deleted file mode 100644 index 3c3629e6..00000000 --- a/fixtures/pnpm/.gitignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/fixtures/pnpm/package.json b/fixtures/pnpm/package.json deleted file mode 100644 index 78712e2b..00000000 --- a/fixtures/pnpm/package.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "name": "pnpm", - "version": "1.0.0", - "private": true, - "devDependencies": { - "axios": "1.6.2", - "styled-components": "6.1.1", - "postcss": "8.4.33" - } -} diff --git a/fixtures/pnpm/pnpm-lock.yaml b/fixtures/pnpm/pnpm-lock.yaml deleted file mode 100644 index e51dfd6a..00000000 --- a/fixtures/pnpm/pnpm-lock.yaml +++ /dev/null @@ -1,212 +0,0 @@ -lockfileVersion: '6.0' - -settings: - autoInstallPeers: true - excludeLinksFromLockfile: false - -devDependencies: - axios: - specifier: 1.6.2 - version: 1.6.2 - postcss: - specifier: 8.4.33 - version: 8.4.33 - styled-components: - specifier: 6.1.1 - version: 6.1.1(react-dom@18.2.0)(react@18.2.0) - -packages: - - /@emotion/is-prop-valid@1.2.1: - resolution: {integrity: sha512-61Mf7Ufx4aDxx1xlDeOm8aFFigGHE4z+0sKCa+IHCeZKiyP9RLD0Mmx7m8b9/Cf37f7NAvQOOJAbQQGVr5uERw==} - dependencies: - '@emotion/memoize': 0.8.1 - dev: true - - /@emotion/memoize@0.8.1: - resolution: {integrity: sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA==} - dev: true - - /@emotion/unitless@0.8.1: - resolution: {integrity: sha512-KOEGMu6dmJZtpadb476IsZBclKvILjopjUii3V+7MnXIQCYh8W3NgNcgwo21n9LXZX6EDIKvqfjYxXebDwxKmQ==} - dev: true - - /@types/stylis@4.2.4: - resolution: {integrity: sha512-36ZrGJ8fgtBr6nwNnuJ9jXIj+bn/pF6UoqmrQT7+Y99+tFFeHHsoR54+194dHdyhPjgbeoNz3Qru0oRt0l6ASQ==} - dev: true - - /asynckit@0.4.0: - resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} - dev: true - - /axios@1.6.2: - resolution: {integrity: sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A==} - dependencies: - follow-redirects: 1.15.3 - form-data: 4.0.0 - proxy-from-env: 1.1.0 - transitivePeerDependencies: - - debug - dev: true - - /camelize@1.0.1: - resolution: {integrity: sha512-dU+Tx2fsypxTgtLoE36npi3UqcjSSMNYfkqgmoEhtZrraP5VWq0K7FkWVTYa8eMPtnU/G2txVsfdCJTn9uzpuQ==} - dev: true - - /combined-stream@1.0.8: - resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} - engines: {node: '>= 0.8'} - dependencies: - delayed-stream: 1.0.0 - dev: true - - /css-color-keywords@1.0.0: - resolution: {integrity: sha512-FyyrDHZKEjXDpNJYvVsV960FiqQyXc/LlYmsxl2BcdMb2WPx0OGRVgTg55rPSyLSNMqP52R9r8geSp7apN3Ofg==} - engines: {node: '>=4'} - dev: true - - /css-to-react-native@3.2.0: - resolution: {integrity: sha512-e8RKaLXMOFii+02mOlqwjbD00KSEKqblnpO9e++1aXS1fPQOpS1YoqdVHBqPjHNoxeF2mimzVqawm2KCbEdtHQ==} - dependencies: - camelize: 1.0.1 - css-color-keywords: 1.0.0 - postcss-value-parser: 4.2.0 - dev: true - - /csstype@3.1.2: - resolution: {integrity: sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==} - dev: true - - /delayed-stream@1.0.0: - resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} - engines: {node: '>=0.4.0'} - dev: true - - /follow-redirects@1.15.3: - resolution: {integrity: sha512-1VzOtuEM8pC9SFU1E+8KfTjZyMztRsgEfwQl44z8A25uy13jSzTj6dyK2Df52iV0vgHCfBwLhDWevLn95w5v6Q==} - engines: {node: '>=4.0'} - peerDependencies: - debug: '*' - peerDependenciesMeta: - debug: - optional: true - dev: true - - /form-data@4.0.0: - resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==} - engines: {node: '>= 6'} - dependencies: - asynckit: 0.4.0 - combined-stream: 1.0.8 - mime-types: 2.1.35 - dev: true - - /js-tokens@4.0.0: - resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} - dev: true - - /loose-envify@1.4.0: - resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==} - hasBin: true - dependencies: - js-tokens: 4.0.0 - dev: true - - /mime-db@1.52.0: - resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} - engines: {node: '>= 0.6'} - dev: true - - /mime-types@2.1.35: - resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} - engines: {node: '>= 0.6'} - dependencies: - mime-db: 1.52.0 - dev: true - - /nanoid@3.3.7: - resolution: {integrity: sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==} - engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} - hasBin: true - dev: true - - /picocolors@1.0.0: - resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==} - dev: true - - /postcss-value-parser@4.2.0: - resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==} - dev: true - - /postcss@8.4.33: - resolution: {integrity: sha512-Kkpbhhdjw2qQs2O2DGX+8m5OVqEcbB9HRBvuYM9pgrjEFUg30A9LmXNlTAUj4S9kgtGyrMbTzVjH7E+s5Re2yg==} - engines: {node: ^10 || ^12 || >=14} - dependencies: - nanoid: 3.3.7 - picocolors: 1.0.0 - source-map-js: 1.0.2 - dev: true - - /proxy-from-env@1.1.0: - resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==} - dev: true - - /react-dom@18.2.0(react@18.2.0): - resolution: {integrity: sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==} - peerDependencies: - react: ^18.2.0 - dependencies: - loose-envify: 1.4.0 - react: 18.2.0 - scheduler: 0.23.0 - dev: true - - /react@18.2.0: - resolution: {integrity: sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==} - engines: {node: '>=0.10.0'} - dependencies: - loose-envify: 1.4.0 - dev: true - - /scheduler@0.23.0: - resolution: {integrity: sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw==} - dependencies: - loose-envify: 1.4.0 - dev: true - - /shallowequal@1.1.0: - resolution: {integrity: sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ==} - dev: true - - /source-map-js@1.0.2: - resolution: {integrity: sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==} - engines: {node: '>=0.10.0'} - dev: true - - /styled-components@6.1.1(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-cpZZP5RrKRIClBW5Eby4JM1wElLVP4NQrJbJ0h10TidTyJf4SIIwa3zLXOoPb4gJi8MsJ8mjq5mu2IrEhZIAcQ==} - engines: {node: '>= 16'} - peerDependencies: - react: '>= 16.8.0' - react-dom: '>= 16.8.0' - dependencies: - '@emotion/is-prop-valid': 1.2.1 - '@emotion/unitless': 0.8.1 - '@types/stylis': 4.2.4 - css-to-react-native: 3.2.0 - csstype: 3.1.2 - postcss: 8.4.33 - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - shallowequal: 1.1.0 - stylis: 4.3.0 - tslib: 2.6.2 - dev: true - - /stylis@4.3.0: - resolution: {integrity: sha512-E87pIogpwUsUwXw7dNyU4QDjdgVMy52m+XEOPEKUn161cCzWjjhPSQhByfd1CcNvrOLnXQ6OnnZDwnJrz/Z4YQ==} - dev: true - - /tslib@2.6.2: - resolution: {integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==} - dev: true diff --git a/fixtures/tsconfig/cases/builtins/thing.js b/fixtures/tsconfig/cases/builtins/thing.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/builtins/tsconfig.json b/fixtures/tsconfig/cases/builtins/tsconfig.json deleted file mode 100644 index 36aa1a4d..00000000 --- a/fixtures/tsconfig/cases/builtins/tsconfig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compilerOptions": { - "baseUrl": "." - } -} diff --git a/fixtures/tsconfig/cases/exports/index.js b/fixtures/tsconfig/cases/exports/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/exports/tsconfig.json b/fixtures/tsconfig/cases/exports/tsconfig.json deleted file mode 100644 index f0e3159b..00000000 --- a/fixtures/tsconfig/cases/exports/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-exports" -} diff --git a/fixtures/tsconfig/cases/extends-extension/base-tsconfig.json b/fixtures/tsconfig/cases/extends-extension/base-tsconfig.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/cases/extends-extension/base-tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/cases/extends-extension/foo.js b/fixtures/tsconfig/cases/extends-extension/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-extension/tsconfig.json b/fixtures/tsconfig/cases/extends-extension/tsconfig.json deleted file mode 100644 index 0ae4c6a3..00000000 --- a/fixtures/tsconfig/cases/extends-extension/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./base-tsconfig" -} diff --git a/fixtures/tsconfig/cases/extends-extensionless/foo.js b/fixtures/tsconfig/cases/extends-extensionless/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-extensionless/tsconfig.json b/fixtures/tsconfig/cases/extends-extensionless/tsconfig.json deleted file mode 100644 index c36cb7d4..00000000 --- a/fixtures/tsconfig/cases/extends-extensionless/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-field/conf" -} diff --git a/fixtures/tsconfig/cases/extends-multiple/foo.js b/fixtures/tsconfig/cases/extends-multiple/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-multiple/tsconfig.json b/fixtures/tsconfig/cases/extends-multiple/tsconfig.json deleted file mode 100644 index aa2ae783..00000000 --- a/fixtures/tsconfig/cases/extends-multiple/tsconfig.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": ["../extends-extension", "../extends-paths"], - "compilerOptions": { - "baseUrl": ".", - }, -} diff --git a/fixtures/tsconfig/cases/extends-not-found/index.js b/fixtures/tsconfig/cases/extends-not-found/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-not-found/tsconfig.json b/fixtures/tsconfig/cases/extends-not-found/tsconfig.json deleted file mode 100644 index 99df91da..00000000 --- a/fixtures/tsconfig/cases/extends-not-found/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./not-found" -} diff --git a/fixtures/tsconfig/cases/extends-paths/src/index.js b/fixtures/tsconfig/cases/extends-paths/src/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-paths/tsconfig.base.json b/fixtures/tsconfig/cases/extends-paths/tsconfig.base.json deleted file mode 100644 index 5c64b067..00000000 --- a/fixtures/tsconfig/cases/extends-paths/tsconfig.base.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "@/*": ["./*"] - } - } -} diff --git a/fixtures/tsconfig/cases/extends-paths/tsconfig.json b/fixtures/tsconfig/cases/extends-paths/tsconfig.json deleted file mode 100644 index 51086018..00000000 --- a/fixtures/tsconfig/cases/extends-paths/tsconfig.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": "./tsconfig.base.json", - "compilerOptions": { - "baseUrl": "src", - }, -} diff --git a/fixtures/tsconfig/cases/field/index.js b/fixtures/tsconfig/cases/field/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/field/tsconfig.json b/fixtures/tsconfig/cases/field/tsconfig.json deleted file mode 100644 index 9f86c3f4..00000000 --- a/fixtures/tsconfig/cases/field/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-field" -} diff --git a/fixtures/tsconfig/cases/index/index.js b/fixtures/tsconfig/cases/index/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/index/tsconfig.json b/fixtures/tsconfig/cases/index/tsconfig.json deleted file mode 100644 index d20b1774..00000000 --- a/fixtures/tsconfig/cases/index/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-index" -} diff --git a/fixtures/tsconfig/cases/paths_template_variable/foo.js b/fixtures/tsconfig/cases/paths_template_variable/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json b/fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json deleted file mode 100644 index a1a37bb6..00000000 --- a/fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "../../tsconfig_template_variable.json" -} diff --git a/fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json b/fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json deleted file mode 100644 index e7d8e5e5..00000000 --- a/fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "compilerOptions": { - "composite": true, - "paths": { - "foo": ["${configDir}/foo.js"] - } - } -} diff --git a/fixtures/tsconfig/cases/project_references/app/aliased/index.ts b/fixtures/tsconfig/cases/project_references/app/aliased/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/app/index.ts b/fixtures/tsconfig/cases/project_references/app/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/app/tsconfig.json b/fixtures/tsconfig/cases/project_references/app/tsconfig.json deleted file mode 100644 index 7036d2bb..00000000 --- a/fixtures/tsconfig/cases/project_references/app/tsconfig.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "extends": "../tsconfig.base.json", - "compilerOptions": { - "baseUrl": "./", - "paths": { - "@/*": ["./aliased/*"] - } - }, - "references": [ - { - "path": "../project_a/conf.json" - }, - { - "path": "../project_b" - }, - { - "path": "../project_c/tsconfig.json" - }, - { - "path": "../../paths_template_variable/tsconfig2.json" - } - ] -} diff --git a/fixtures/tsconfig/cases/project_references/project_a/aliased/index.ts b/fixtures/tsconfig/cases/project_references/project_a/aliased/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_a/conf.json b/fixtures/tsconfig/cases/project_references/project_a/conf.json deleted file mode 100644 index 4d389d7a..00000000 --- a/fixtures/tsconfig/cases/project_references/project_a/conf.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "compilerOptions": { - "composite": true, - "paths": { - "@/*": ["./aliased/*"] - } - } -} diff --git a/fixtures/tsconfig/cases/project_references/project_a/index.ts b/fixtures/tsconfig/cases/project_references/project_a/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_b/src/aliased/index.ts b/fixtures/tsconfig/cases/project_references/project_b/src/aliased/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_b/tsconfig.json b/fixtures/tsconfig/cases/project_references/project_b/tsconfig.json deleted file mode 100644 index 4ab05cd8..00000000 --- a/fixtures/tsconfig/cases/project_references/project_b/tsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "compilerOptions": { - "composite": true, - "baseUrl": "./src", - "paths": { - "@/*": ["./aliased/*"] - } - } -} diff --git a/fixtures/tsconfig/cases/project_references/project_c/index.ts b/fixtures/tsconfig/cases/project_references/project_c/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_c/tsconfig.json b/fixtures/tsconfig/cases/project_references/project_c/tsconfig.json deleted file mode 100644 index fe520939..00000000 --- a/fixtures/tsconfig/cases/project_references/project_c/tsconfig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compilerOptions": { - "composite": true - } -} diff --git a/fixtures/tsconfig/cases/project_references/tsconfig.base.json b/fixtures/tsconfig/cases/project_references/tsconfig.base.json deleted file mode 100644 index 88ccffe7..00000000 --- a/fixtures/tsconfig/cases/project_references/tsconfig.base.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "compilerOptions": { - } -} diff --git a/fixtures/tsconfig/cases/suffixes/a.ios.ts b/fixtures/tsconfig/cases/suffixes/a.ios.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/a.ts b/fixtures/tsconfig/cases/suffixes/a.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/b.ts b/fixtures/tsconfig/cases/suffixes/b.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/c-test.ts b/fixtures/tsconfig/cases/suffixes/c-test.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/index.ts b/fixtures/tsconfig/cases/suffixes/index.ts deleted file mode 100644 index b09939b9..00000000 --- a/fixtures/tsconfig/cases/suffixes/index.ts +++ /dev/null @@ -1 +0,0 @@ -import './a'; diff --git a/fixtures/tsconfig/cases/suffixes/tsconfig.json b/fixtures/tsconfig/cases/suffixes/tsconfig.json deleted file mode 100644 index 4c2ccc8f..00000000 --- a/fixtures/tsconfig/cases/suffixes/tsconfig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compilerOptions": { - "moduleSuffixes": [".ios", "-test", ""] - } -} diff --git a/fixtures/tsconfig/cases/trailing-comma/bar.js b/fixtures/tsconfig/cases/trailing-comma/bar.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/trailing-comma/index.js b/fixtures/tsconfig/cases/trailing-comma/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/trailing-comma/tsconfig.json b/fixtures/tsconfig/cases/trailing-comma/tsconfig.json deleted file mode 100644 index 6dc20ca5..00000000 --- a/fixtures/tsconfig/cases/trailing-comma/tsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "compilerOptions": { - "paths": { - /* some comment */ - "foo": ["bar.js"], - }, - }, - // another comment -} diff --git a/fixtures/tsconfig/foo.js b/fixtures/tsconfig/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/nested/index.js b/fixtures/tsconfig/nested/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/nested/test.js b/fixtures/tsconfig/nested/test.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/nested/tsconfig.json b/fixtures/tsconfig/nested/tsconfig.json deleted file mode 100644 index 6deb3011..00000000 --- a/fixtures/tsconfig/nested/tsconfig.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "extends": "..", - "compilerOptions": { - "paths": { - "ts-path": ["test.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-exports/conf.json b/fixtures/tsconfig/node_modules/tsconfig-exports/conf.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-exports/conf.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-exports/foo.js b/fixtures/tsconfig/node_modules/tsconfig-exports/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-exports/package.json b/fixtures/tsconfig/node_modules/tsconfig-exports/package.json deleted file mode 100644 index be0ddee6..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-exports/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "tsconfig-exports", - "private": true, - "exports": { - ".": "./conf.json" - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-field/conf.json b/fixtures/tsconfig/node_modules/tsconfig-field/conf.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-field/conf.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-field/foo.js b/fixtures/tsconfig/node_modules/tsconfig-field/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-field/package.json b/fixtures/tsconfig/node_modules/tsconfig-field/package.json deleted file mode 100644 index 7138fdde..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-field/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "tsconfig-field", - "private": true, - "tsconfig": "conf.json" -} \ No newline at end of file diff --git a/fixtures/tsconfig/node_modules/tsconfig-index/foo.js b/fixtures/tsconfig/node_modules/tsconfig-index/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-index/package.json b/fixtures/tsconfig/node_modules/tsconfig-index/package.json deleted file mode 100644 index eb2431e7..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-index/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "tsconfig-index", - "private": true -} \ No newline at end of file diff --git a/fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json b/fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-not-used/foo.js b/fixtures/tsconfig/node_modules/tsconfig-not-used/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json b/fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json deleted file mode 100644 index eb16d127..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "ts-path": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/package.json b/fixtures/tsconfig/package.json deleted file mode 100755 index f48acd1c..00000000 --- a/fixtures/tsconfig/package.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "name": "resolver", - "private": true, - "alias": { - "aliased": "foo", - "aliased-file": "./bar.js", - "something": "./nested/test.js", - "aliasedfolder": "./nested", - "aliasedabsolute": "/nested", - "foo/bar": "./bar.js", - "glob/*/*": "./nested/$2", - "./baz": "./bar.js", - "url": false - }, - "imports": { - "#test": "./bar.js" - }, - "dependencies": { - "foo": "^0.3.4" - }, - "peerDependencies": { - "bar": "*" - } -} diff --git a/fixtures/tsconfig/tsconfig.json b/fixtures/tsconfig/tsconfig.json deleted file mode 100644 index eb16d127..00000000 --- a/fixtures/tsconfig/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "ts-path": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/tsconfig_template_variable.json b/fixtures/tsconfig/tsconfig_template_variable.json deleted file mode 100644 index 6f272344..00000000 --- a/fixtures/tsconfig/tsconfig_template_variable.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["${configDir}/foo.js"] - } - } -} diff --git a/napi/__test__/resolver.spec.mjs b/napi/__test__/resolver.spec.mjs deleted file mode 100644 index ac6ee0ef..00000000 --- a/napi/__test__/resolver.spec.mjs +++ /dev/null @@ -1,260 +0,0 @@ -import { join } from 'node:path' -import { fileURLToPath } from 'node:url' - -import test from 'ava' - -let ResolverFactory - -if (process.env.WASI_TEST) { - const wasi = await import('../resolver.wasi.cjs') - ResolverFactory = wasi.ResolverFactory -} else { - const napi = await import('../index.js') - ResolverFactory = napi.ResolverFactory -} - -const currentDir = join(fileURLToPath(import.meta.url), '..') - -const enhancedResolveRoot = join( - currentDir, - '..', - '..', - 'fixtures', - 'enhanced_resolve', - 'test', - 'fixtures' -) - -// https://github.com/webpack/enhanced-resolve/blob/main/test/resolve.test.js - -for (const [title, context, request, expected] of [ - [ - 'absolute path', - enhancedResolveRoot, - join(enhancedResolveRoot, 'main1.js'), - join(enhancedResolveRoot, 'main1.js'), - ], - [ - 'file with .js', - enhancedResolveRoot, - './main1.js', - join(enhancedResolveRoot, 'main1.js'), - ], - [ - 'file without extension', - enhancedResolveRoot, - './main1', - join(enhancedResolveRoot, 'main1.js'), - ], - [ - 'another file with .js', - enhancedResolveRoot, - './a.js', - join(enhancedResolveRoot, 'a.js'), - ], - [ - 'another file without extension', - enhancedResolveRoot, - './a', - join(enhancedResolveRoot, 'a.js'), - ], - [ - 'file in module with .js', - enhancedResolveRoot, - 'm1/a.js', - join(enhancedResolveRoot, 'node_modules/m1/a.js'), - ], - [ - 'file in module without extension', - enhancedResolveRoot, - 'm1/a', - join(enhancedResolveRoot, 'node_modules/m1/a.js'), - ], - [ - 'another file in module without extension', - enhancedResolveRoot, - 'complexm/step1', - join(enhancedResolveRoot, 'node_modules/complexm/step1.js'), - ], - [ - 'from submodule to file in sibling module', - join(enhancedResolveRoot, 'node_modules/complexm'), - 'm2/b.js', - join(enhancedResolveRoot, 'node_modules/m2/b.js'), - ], - [ - 'from nested directory to overwritten file in module', - join(enhancedResolveRoot, 'multiple_modules'), - 'm1/a.js', - join(enhancedResolveRoot, 'multiple_modules/node_modules/m1/a.js'), - ], - [ - 'from nested directory to not overwritten file in module', - join(enhancedResolveRoot, 'multiple_modules'), - 'm1/b.js', - join(enhancedResolveRoot, 'node_modules/m1/b.js'), - ], - [ - 'file with query', - enhancedResolveRoot, - './main1.js?query', - join(enhancedResolveRoot, 'main1.js?query'), - ], - [ - 'file with fragment', - enhancedResolveRoot, - './main1.js#fragment', - join(enhancedResolveRoot, 'main1.js#fragment'), - ], - [ - 'file with fragment and query', - enhancedResolveRoot, - './main1.js#fragment?query', - join(enhancedResolveRoot, 'main1.js#fragment?query'), - ], - [ - 'file with query and fragment', - enhancedResolveRoot, - './main1.js?#fragment', - join(enhancedResolveRoot, 'main1.js?#fragment'), - ], - - [ - 'file with query (unicode)', - enhancedResolveRoot, - './测试.js?query', - join(enhancedResolveRoot, '测试.js?query'), - ], - [ - 'file with fragment (unicode)', - enhancedResolveRoot, - './测试.js#fragment', - join(enhancedResolveRoot, '测试.js#fragment'), - ], - [ - 'file with fragment and query (unicode)', - enhancedResolveRoot, - './测试.js#fragment?query', - join(enhancedResolveRoot, '测试.js#fragment?query'), - ], - [ - 'file with query and fragment (unicode)', - enhancedResolveRoot, - './测试.js?#fragment', - join(enhancedResolveRoot, '测试.js?#fragment'), - ], - - [ - 'file in module with query', - enhancedResolveRoot, - 'm1/a?query', - join(enhancedResolveRoot, 'node_modules/m1/a.js?query'), - ], - [ - 'file in module with fragment', - enhancedResolveRoot, - 'm1/a#fragment', - join(enhancedResolveRoot, 'node_modules/m1/a.js#fragment'), - ], - [ - 'file in module with fragment and query', - enhancedResolveRoot, - 'm1/a#fragment?query', - join(enhancedResolveRoot, 'node_modules/m1/a.js#fragment?query'), - ], - [ - 'file in module with query and fragment', - enhancedResolveRoot, - 'm1/a?#fragment', - join(enhancedResolveRoot, 'node_modules/m1/a.js?#fragment'), - ], - [ - 'differ between directory and file, resolve file', - enhancedResolveRoot, - './dirOrFile', - join(enhancedResolveRoot, 'dirOrFile.js'), - ], - [ - 'differ between directory and file, resolve directory', - enhancedResolveRoot, - './dirOrFile/', - join(enhancedResolveRoot, 'dirOrFile/index.js'), - ], - [ - 'find node_modules outside of node_modules', - join(enhancedResolveRoot, 'browser-module/node_modules'), - 'm1/a', - join(enhancedResolveRoot, 'node_modules/m1/a.js'), - ], - [ - "don't crash on main field pointing to self", - enhancedResolveRoot, - './main-field-self', - join(enhancedResolveRoot, './main-field-self/index.js'), - ], - [ - "don't crash on main field pointing to self (2)", - enhancedResolveRoot, - './main-field-self2', - join(enhancedResolveRoot, './main-field-self2/index.js'), - ], - // enhanced-resolve has `#` prepended with a `\0`, they are removed from the - // following 3 expected test results. - // See https://github.com/webpack/enhanced-resolve#escaping - [ - 'handle fragment edge case (no fragment)', - enhancedResolveRoot, - './no#fragment/#/#', - join(enhancedResolveRoot, 'no#fragment', '#', '#.js'), - ], - [ - 'handle fragment edge case (fragment)', - enhancedResolveRoot, - './no#fragment/#/', - join(enhancedResolveRoot, 'no.js#fragment') + '/#/', - ], - [ - 'handle fragment escaping', - enhancedResolveRoot, - './no\0#fragment/\0#/\0##fragment', - join(enhancedResolveRoot, 'no#fragment', '#', '#.js#fragment'), - ], -]) { - test(title, (t) => { - const resolver = new ResolverFactory({ - modules: ['src/a', 'src/b', 'src/common', 'node_modules'], - extensions: ['.js', '.jsx', '.ts', '.tsx'], - }) - - t.is(resolver.sync(context, request).path, expected) - }) -} - -test('resolve pnpm package', (t) => { - const rootDir = join(currentDir, '..', '..'); - const pnpmProjectPath = join(rootDir, 'fixtures', 'pnpm') - const resolver = new ResolverFactory({ - aliasFields: ['browser'], - }) - t.deepEqual(resolver.sync(pnpmProjectPath, 'styled-components'), { - path: join( - rootDir, - 'node_modules/.pnpm/styled-components@6.1.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/styled-components/dist/styled-components.browser.cjs.js' - ), - }) - t.deepEqual( - resolver.sync( - join( - rootDir, - 'node_modules/.pnpm/styled-components@6.1.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/styled-components' - ), - 'react' - ), - { - path: join( - rootDir, - 'node_modules/.pnpm/react@18.3.1/node_modules/react/index.js' - ), - } - ) -}) diff --git a/napi/src/lib.rs b/napi/src/lib.rs deleted file mode 100644 index 238f99c4..00000000 --- a/napi/src/lib.rs +++ /dev/null @@ -1,166 +0,0 @@ -extern crate napi; -extern crate napi_derive; -extern crate oxc_resolver; - -use std::path::{Path, PathBuf}; - -use napi_derive::napi; -use oxc_resolver::{ResolveOptions, Resolver}; - -use self::options::{NapiResolveOptions, StrOrStrList}; - -mod options; - -#[napi(object)] -pub struct ResolveResult { - pub path: Option, - pub error: Option, -} - -fn resolve(resolver: &Resolver, path: &Path, request: &str) -> ResolveResult { - match resolver.resolve(path, request) { - Ok(resolution) => ResolveResult { - path: Some(resolution.full_path().to_string_lossy().to_string()), - error: None, - }, - Err(err) => ResolveResult { path: None, error: Some(err.to_string()) }, - } -} - -#[allow(clippy::needless_pass_by_value)] -#[napi] -pub fn sync(path: String, request: String) -> ResolveResult { - let path = PathBuf::from(path); - let resolver = Resolver::new(ResolveOptions::default()); - resolve(&resolver, &path, &request) -} - -#[napi] -pub struct ResolverFactory { - resolver: Resolver, -} - -#[napi] -impl ResolverFactory { - #[napi(constructor)] - pub fn new(options: NapiResolveOptions) -> Self { - Self { resolver: Resolver::new(Self::normalize_options(options)) } - } - - #[napi] - pub fn default() -> Self { - let default_options = ResolveOptions::default(); - Self { resolver: Resolver::new(default_options) } - } - - /// Clone the resolver using the same underlying cache. - #[napi] - pub fn clone_with_options(&self, options: NapiResolveOptions) -> Self { - Self { resolver: self.resolver.clone_with_options(Self::normalize_options(options)) } - } - - /// Clear the underlying cache. - #[napi] - pub fn clear_cache(&self) { - self.resolver.clear_cache(); - } - - #[allow(clippy::needless_pass_by_value)] - #[napi] - pub fn sync(&self, path: String, request: String) -> ResolveResult { - let path = PathBuf::from(path); - resolve(&self.resolver, &path, &request) - } - - fn normalize_options(op: NapiResolveOptions) -> ResolveOptions { - let default = ResolveOptions::default(); - // merging options - ResolveOptions { - tsconfig: op.tsconfig.map(|tsconfig| tsconfig.into()), - alias: op - .alias - .map(|alias| { - alias - .into_iter() - .map(|(k, v)| { - let v = v - .into_iter() - .map(|item| match item { - Some(path) => oxc_resolver::AliasValue::from(path), - None => oxc_resolver::AliasValue::Ignore, - }) - .collect(); - (k, v) - }) - .collect::>() - }) - .unwrap_or(default.alias), - alias_fields: op - .alias_fields - .map(|o| o.into_iter().map(|x| StrOrStrList(x).into()).collect::>()) - .unwrap_or(default.alias_fields), - condition_names: op.condition_names.unwrap_or(default.condition_names), - description_files: op.description_files.unwrap_or(default.description_files), - enforce_extension: op - .enforce_extension - .map(|enforce_extension| enforce_extension.into()) - .unwrap_or(default.enforce_extension), - exports_fields: op - .exports_fields - .map(|o| o.into_iter().map(|x| StrOrStrList(x).into()).collect::>()) - .unwrap_or(default.exports_fields), - imports_fields: op - .imports_fields - .map(|o| o.into_iter().map(|x| StrOrStrList(x).into()).collect::>()) - .unwrap_or(default.imports_fields), - extension_alias: op - .extension_alias - .map(|extension_alias| extension_alias.into_iter().collect::>()) - .unwrap_or(default.extension_alias), - extensions: op.extensions.unwrap_or(default.extensions), - fallback: op - .fallback - .map(|fallback| { - fallback - .into_iter() - .map(|(k, v)| { - let v = v - .into_iter() - .map(|item| match item { - Some(path) => oxc_resolver::AliasValue::from(path), - None => oxc_resolver::AliasValue::Ignore, - }) - .collect(); - (k, v) - }) - .collect::>() - }) - .unwrap_or(default.fallback), - fully_specified: op.fully_specified.unwrap_or(default.fully_specified), - main_fields: op - .main_fields - .map(|o| StrOrStrList(o).into()) - .unwrap_or(default.main_fields), - main_files: op.main_files.unwrap_or(default.main_files), - modules: op.modules.map(|o| StrOrStrList(o).into()).unwrap_or(default.modules), - resolve_to_context: op.resolve_to_context.unwrap_or(default.resolve_to_context), - prefer_relative: op.prefer_relative.unwrap_or(default.prefer_relative), - prefer_absolute: op.prefer_absolute.unwrap_or(default.prefer_absolute), - restrictions: op - .restrictions - .map(|restrictions| { - restrictions - .into_iter() - .map(|restriction| restriction.into()) - .collect::>() - }) - .unwrap_or(default.restrictions), - roots: op - .roots - .map(|roots| roots.into_iter().map(PathBuf::from).collect::>()) - .unwrap_or(default.roots), - symlinks: op.symlinks.unwrap_or(default.symlinks), - builtin_modules: op.builtin_modules.unwrap_or(default.builtin_modules), - } - } -} diff --git a/napi/src/options.rs b/napi/src/options.rs deleted file mode 100644 index ea35672f..00000000 --- a/napi/src/options.rs +++ /dev/null @@ -1,261 +0,0 @@ -use std::path::PathBuf; - -use napi::Either; -use napi_derive::napi; -use std::collections::HashMap; - -/// Module Resolution Options -/// -/// Options are directly ported from [enhanced-resolve](https://github.com/webpack/enhanced-resolve#resolver-options). -/// -/// See [webpack resolve](https://webpack.js.org/configuration/resolve/) for information and examples -#[derive(Debug, Clone)] -#[napi(object)] -pub struct NapiResolveOptions { - /// Path to TypeScript configuration file. - /// - /// Default `None` - pub tsconfig: Option, - - /// Alias for [ResolveOptions::alias] and [ResolveOptions::fallback]. - /// - /// For the second value of the tuple, `None -> AliasValue::Ignore`, Some(String) -> - /// AliasValue::Path(String)` - /// Create aliases to import or require certain modules more easily. - /// A trailing $ can also be added to the given object's keys to signify an exact match. - pub alias: Option>>>, - - /// A list of alias fields in description files. - /// Specify a field, such as `browser`, to be parsed according to [this specification](https://github.com/defunctzombie/package-browser-field-spec). - /// Can be a path to json object such as `["path", "to", "exports"]`. - /// - /// Default `[]` - #[napi(ts_type = "(string | string[])[]")] - pub alias_fields: Option>, - - /// Condition names for exports field which defines entry points of a package. - /// The key order in the exports field is significant. During condition matching, earlier entries have higher priority and take precedence over later entries. - /// - /// Default `[]` - pub condition_names: Option>, - - /// The JSON files to use for descriptions. (There was once a `bower.json`.) - /// - /// Default `["package.json"]` - pub description_files: Option>, - - /// If true, it will not allow extension-less files. - /// So by default `require('./foo')` works if `./foo` has a `.js` extension, - /// but with this enabled only `require('./foo.js')` will work. - /// - /// Default to `true` when [ResolveOptions::extensions] contains an empty string. - /// Use `Some(false)` to disable the behavior. - /// See - /// - /// Default None, which is the same as `Some(false)` when the above empty rule is not applied. - pub enforce_extension: Option, - - /// A list of exports fields in description files. - /// Can be a path to json object such as `["path", "to", "exports"]`. - /// - /// Default `[["exports"]]`. - #[napi(ts_type = "(string | string[])[]")] - pub exports_fields: Option>, - - /// Fields from `package.json` which are used to provide the internal requests of a package - /// (requests starting with # are considered internal). - /// - /// Can be a path to a JSON object such as `["path", "to", "imports"]`. - /// - /// Default `[["imports"]]`. - #[napi(ts_type = "(string | string[])[]")] - pub imports_fields: Option>, - - /// An object which maps extension to extension aliases. - /// - /// Default `{}` - pub extension_alias: Option>>, - - /// Attempt to resolve these extensions in order. - /// If multiple files share the same name but have different extensions, - /// will resolve the one with the extension listed first in the array and skip the rest. - /// - /// Default `[".js", ".json", ".node"]` - pub extensions: Option>, - - /// Redirect module requests when normal resolving fails. - /// - /// Default `[]` - pub fallback: Option>>>, - - /// 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). - /// - /// See also webpack configuration [resolve.fullySpecified](https://webpack.js.org/configuration/module/#resolvefullyspecified) - /// - /// Default `false` - pub fully_specified: Option, - - /// A list of main fields in description files - /// - /// Default `["main"]`. - #[napi(ts_type = "string | string[]")] - pub main_fields: Option, - - /// The filename to be used while resolving directories. - /// - /// Default `["index"]` - pub main_files: Option>, - - /// A list of directories to resolve modules from, can be absolute path or folder name. - /// - /// Default `["node_modules"]` - #[napi(ts_type = "string | string[]")] - pub modules: Option, - - /// Resolve to a context instead of a file. - /// - /// Default `false` - pub resolve_to_context: Option, - - /// Prefer to resolve module requests as relative requests instead of using modules from node_modules directories. - /// - /// Default `false` - pub prefer_relative: Option, - - /// Prefer to resolve server-relative urls as absolute paths before falling back to resolve in ResolveOptions::roots. - /// - /// Default `false` - pub prefer_absolute: Option, - - /// A list of resolve restrictions to restrict the paths that a request can be resolved on. - /// - /// Default `[]` - pub restrictions: Option>, - - /// A list of directories where requests of server-relative URLs (starting with '/') are resolved. - /// On non-Windows systems these requests are resolved as an absolute path first. - /// - /// Default `[]` - pub roots: Option>, - - /// Whether to resolve symlinks to their symlinked location. - /// When enabled, symlinked resources are resolved to their real path, not their symlinked location. - /// Note that this may cause module resolution to fail when using tools that symlink packages (like npm link). - /// - /// Default `true` - pub symlinks: Option, - - /// Whether to parse [module.builtinModules](https://nodejs.org/api/module.html#modulebuiltinmodules) or not. - /// For example, "zlib" will throw [crate::ResolveError::Builtin] when set to true. - /// - /// Default `false` - pub builtin_modules: Option, -} - -#[napi] -#[derive(Debug, PartialEq, Eq)] -pub enum EnforceExtension { - Auto, - Enabled, - Disabled, -} - -impl EnforceExtension { - pub fn is_auto(&self) -> bool { - *self == Self::Auto - } - - pub fn is_enabled(&self) -> bool { - *self == Self::Enabled - } - - pub fn is_disabled(&self) -> bool { - *self == Self::Disabled - } -} - -/// Alias Value for [ResolveOptions::alias] and [ResolveOptions::fallback]. -/// Use struct because napi don't support structured union now -#[napi(object)] -#[derive(Debug, Clone)] -pub struct Restriction { - pub path: Option, - pub regex: Option, -} - -/// Tsconfig Options -/// -/// Derived from [tsconfig-paths-webpack-plugin](https://github.com/dividab/tsconfig-paths-webpack-plugin#options) -#[napi(object)] -#[derive(Debug, Clone)] -pub struct TsconfigOptions { - /// Allows you to specify where to find the TypeScript configuration file. - /// You may provide - /// * a relative path to the configuration file. It will be resolved relative to cwd. - /// * an absolute path to the configuration file. - pub config_file: String, - - /// Support for Typescript Project References. - /// - /// * `'auto'`: use the `references` field from tsconfig of `config_file`. - /// * `string[]`: manually provided relative or absolute path. - #[napi(ts_type = "'auto' | string[]")] - pub references: Option>>, -} - -impl Into for Restriction { - fn into(self) -> oxc_resolver::Restriction { - match (self.path, self.regex) { - (None, None) => { - panic!("Should specify path or regex") - } - (None, Some(regex)) => oxc_resolver::Restriction::RegExp(regex), - (Some(path), None) => oxc_resolver::Restriction::Path(PathBuf::from(path)), - (Some(_), Some(_)) => { - panic!("Restriction can't be path and regex at the same time") - } - } - } -} - -impl Into for EnforceExtension { - fn into(self) -> oxc_resolver::EnforceExtension { - match self { - EnforceExtension::Auto => oxc_resolver::EnforceExtension::Auto, - EnforceExtension::Enabled => oxc_resolver::EnforceExtension::Enabled, - EnforceExtension::Disabled => oxc_resolver::EnforceExtension::Disabled, - } - } -} - -impl Into for TsconfigOptions { - fn into(self) -> oxc_resolver::TsconfigOptions { - oxc_resolver::TsconfigOptions { - config_file: PathBuf::from(self.config_file), - references: match self.references { - Some(Either::A(string)) if string.as_str() == "auto" => { - oxc_resolver::TsconfigReferences::Auto - } - Some(Either::A(opt)) => { - panic!("`{}` is not a valid option for tsconfig references", opt) - } - Some(Either::B(paths)) => oxc_resolver::TsconfigReferences::Paths( - paths.into_iter().map(PathBuf::from).collect::>(), - ), - None => oxc_resolver::TsconfigReferences::Disabled, - }, - } - } -} - -type StrOrStrListType = Either>; -pub struct StrOrStrList(pub StrOrStrListType); - -impl Into> for StrOrStrList { - fn into(self) -> Vec { - match self { - StrOrStrList(Either::A(s)) => Vec::from([s]), - StrOrStrList(Either::B(a)) => a, - } - } -} diff --git a/napi/tests/options.test.mjs b/napi/tests/options.test.mjs deleted file mode 100644 index 4a93efff..00000000 --- a/napi/tests/options.test.mjs +++ /dev/null @@ -1,59 +0,0 @@ -import { describe, it } from "node:test"; -import { ResolverFactory } from "../index.js"; -import * as assert from "node:assert"; -import * as path from "node:path"; - -const fixtureDir = new URL( - "../../fixtures/enhanced_resolve/test/fixtures", - import.meta.url -).pathname; - -describe("option", () => { - describe("aliasFields", () => { - it("should allow field string ", () => { - const resolver = new ResolverFactory({ aliasFields: ["browser"] }); - assert.match( - resolver.sync(fixtureDir, "./browser-module/lib/replaced.js").path, - /browser-module\/lib\/browser\.js$/ - ); - }); - it("should allow json path array", () => { - const resolver = new ResolverFactory({ - aliasFields: [["innerBrowser1", "field", "browser"]], - }); - - assert.match( - resolver.sync(fixtureDir, "./browser-module/lib/main1.js").path, - /browser-module\/lib\/main\.js$/ - ); - }); - }); - - describe("exportsFields", () => { - const createTest = (exportsFields) => { - const resolver = new ResolverFactory({ exportsFields }); - assert.match( - resolver.sync( - path.resolve(fixtureDir, "./exports-field3"), - "exports-field" - ).path, - /\/exports-field\/src\/index\.js$/ - ); - }; - it("should allow string as field item", createTest(["broken"])); - it("should allow json path array as field item", createTest([["broken"]])); - }); - - describe("mainFields", () => { - const createTest = (mainFields) => { - const resolver = new ResolverFactory({ mainFields }); - assert.match( - resolver.sync(fixtureDir, "../..").path, - /\/lib\/index\.js$/ - ); - }; - it("should use `'main'` as default", createTest(undefined)); - it("should allow field string", createTest("main")); - it("should allow field array", createTest(["main"])); - }); -}); diff --git a/npm/package.json b/npm/package.json index 6fa93185..b47e6b07 100644 --- a/npm/package.json +++ b/npm/package.json @@ -1,41 +1,30 @@ { - "name": "oxc-resolver", - "version": "1.8.1", - "description": "Oxc Resolver Node API", - "main": "index.js", - "browser": "browser.js", - "files": [ - "index.d.ts", - "index.js", - "browser.js" - ], - "license": "MIT", - "homepage": "https://oxc-project.github.io", - "repository": { - "type": "git", - "url": "git+https://github.com/oxc-project/oxc-resolver.git" - }, - "publishConfig": { - "registry": "https://registry.npmjs.org/", - "access": "public" - }, - "napi": { - "binaryName": "resolver", - "packageName": "@oxc-resolver/binding", - "targets": [ - "x86_64-pc-windows-msvc", - "aarch64-pc-windows-msvc", - "x86_64-unknown-linux-gnu", - "x86_64-unknown-linux-musl", - "aarch64-unknown-linux-gnu", - "aarch64-unknown-linux-musl", - "armv7-unknown-linux-gnueabihf", - "x86_64-apple-darwin", - "aarch64-apple-darwin", - "wasm32-wasip1-threads" - ] - }, - "funding": { - "url": "https://github.com/sponsors/Boshen" - } + "name": "oxc-resolver", + "description": "Oxc Resolver Node API", + "funding": { + "url": "https://github.com/sponsors/Boshen" + }, + "main": "index.js", + "browser": "browser.js", + "files": [ + "index.d.ts", + "index.js", + "browser.js" + ], + "napi": { + "binaryName": "resolver", + "packageName": "@oxc-resolver/binding", + "targets": [ + "x86_64-pc-windows-msvc", + "aarch64-pc-windows-msvc", + "x86_64-unknown-linux-gnu", + "x86_64-unknown-linux-musl", + "aarch64-unknown-linux-gnu", + "aarch64-unknown-linux-musl", + "armv7-unknown-linux-gnueabihf", + "x86_64-apple-darwin", + "aarch64-apple-darwin", + "wasm32-wasip1-threads" + ] + } } diff --git a/package.json b/package.json index 47300b76..a431e48f 100644 --- a/package.json +++ b/package.json @@ -1,33 +1,24 @@ { - "name": "@oxc-resolver/binding", - "private": true, - "version": "0.0.0", - "scripts": { - "build": "napi build --platform --release --package-json-path npm/package.json --manifest-path napi/Cargo.toml", - "build:debug": "napi build --platform --package-json-path npm/package.json --manifest-path napi/Cargo.toml", - "prepublishOnly": "napi pre-publish -t npm", - "test": "ava" - }, - "devDependencies": { - "@napi-rs/cli": "^3.0.0-alpha.43", - "@napi-rs/wasm-runtime": "^0.2.0", - "@types/node": "^20.10.4", - "ava": "^6.0.1", - "emnapi": "^1.0.0", - "typescript": "^5.3.3" - }, - "ava": { - "files": [ - "napi/__test__/*.spec.mjs" - ], - "cache": false - }, - "packageManager": "pnpm@9.3.0", - "repository": { - "type": "git", - "url": "git+https://github.com/oxc-project/oxc-resolver.git" - }, - "funding": { - "url": "https://github.com/sponsors/Boshen" - } + "name": "@oxc-resolver/binding", + "funding": { + "url": "https://github.com/sponsors/Boshen" + }, + "scripts": { + "build": "napi build --platform --release --package-json-path npm/package.json --manifest-path napi/Cargo.toml", + "build:debug": "napi build --platform --package-json-path npm/package.json --manifest-path napi/Cargo.toml", + "prepublishOnly": "napi pre-publish -t npm" + }, + "ava": { + "cache": false, + "files": [ + "napi/__test__/*.spec.mjs" + ] + }, + "devDependencies": { + "@napi-rs/cli": "^3.0.0-alpha.43", + "@napi-rs/wasm-runtime": "^0.2.0", + "@types/node": "^20.10.4", + "ava": "^6.0.1", + "emnapi": "^1.0.0" + } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml deleted file mode 100644 index 1e8670db..00000000 --- a/pnpm-lock.yaml +++ /dev/null @@ -1,2690 +0,0 @@ -lockfileVersion: '9.0' - -settings: - autoInstallPeers: true - excludeLinksFromLockfile: false - -importers: - - .: - devDependencies: - '@napi-rs/cli': - specifier: ^3.0.0-alpha.43 - version: 3.0.0-alpha.55(@emnapi/runtime@1.2.0)(emnapi@1.2.0) - '@napi-rs/wasm-runtime': - specifier: ^0.2.0 - version: 0.2.4 - '@types/node': - specifier: ^20.10.4 - version: 20.14.2 - ava: - specifier: ^6.0.1 - version: 6.1.3 - emnapi: - specifier: ^1.0.0 - version: 1.2.0 - typescript: - specifier: ^5.3.3 - version: 5.4.5 - - fixtures/pnpm: - devDependencies: - axios: - specifier: 1.6.2 - version: 1.6.2 - postcss: - specifier: 8.4.33 - version: 8.4.33 - styled-components: - specifier: 6.1.1 - version: 6.1.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - - npm: {} - -packages: - - '@emnapi/core@1.2.0': - resolution: {integrity: sha512-E7Vgw78I93we4ZWdYCb4DGAwRROGkMIXk7/y87UmANR+J6qsWusmC3gLt0H+O0KOt5e6O38U8oJamgbudrES/w==} - - '@emnapi/runtime@1.2.0': - resolution: {integrity: sha512-bV21/9LQmcQeCPEg3BDFtvwL6cwiTMksYNWQQ4KOxCZikEGalWtenoZ0wCiukJINlGCIi2KXx01g4FoH/LxpzQ==} - - '@emnapi/wasi-threads@1.0.1': - resolution: {integrity: sha512-iIBu7mwkq4UQGeMEM8bLwNK962nXdhodeScX4slfQnRhEMMzvYivHhutCIk8uojvmASXXPC2WNEjwxFWk72Oqw==} - - '@emotion/is-prop-valid@1.2.2': - resolution: {integrity: sha512-uNsoYd37AFmaCdXlg6EYD1KaPOaRWRByMCYzbKUX4+hhMfrxdVSelShywL4JVaAeM/eHUOSprYBQls+/neX3pw==} - - '@emotion/memoize@0.8.1': - resolution: {integrity: sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA==} - - '@emotion/unitless@0.8.1': - resolution: {integrity: sha512-KOEGMu6dmJZtpadb476IsZBclKvILjopjUii3V+7MnXIQCYh8W3NgNcgwo21n9LXZX6EDIKvqfjYxXebDwxKmQ==} - - '@inquirer/figures@1.0.3': - resolution: {integrity: sha512-ErXXzENMH5pJt5/ssXV0DfWUZqly8nGzf0UcBV9xTnP+KyffE2mqyxIMBrZ8ijQck2nU0TQm40EQB53YreyWHw==} - engines: {node: '>=18'} - - '@ljharb/through@2.3.13': - resolution: {integrity: sha512-/gKJun8NNiWGZJkGzI/Ragc53cOdcLNdzjLaIa+GEjguQs0ulsurx8WN0jijdK9yPqDvziX995sMRLyLt1uZMQ==} - engines: {node: '>= 0.4'} - - '@mapbox/node-pre-gyp@1.0.11': - resolution: {integrity: sha512-Yhlar6v9WQgUp/He7BdgzOz8lqMQ8sU+jkCq7Wx8Myc5YFJLbEe7lgui/V7G1qB1DJykHSGwreceSaD60Y0PUQ==} - hasBin: true - - '@napi-rs/cli@3.0.0-alpha.55': - resolution: {integrity: sha512-6XgBBTX8O28W5gcSzqYkI72UVJV6Y2YcyQNrEqak39JavJRLlXCv09uLF97raynXAOO50KeP6DEXFy5P8MR2sw==} - engines: {node: '>= 16'} - hasBin: true - peerDependencies: - '@emnapi/runtime': ^1.1.0 - emnapi: ^1.1.0 - peerDependenciesMeta: - '@emnapi/runtime': - optional: true - emnapi: - optional: true - - '@napi-rs/cross-toolchain@0.0.16': - resolution: {integrity: sha512-jwdjHT5L0m9MH0CmzDwPp0ckn/UO7afHCsPeo7NugHUvYgvlgS7SWhdMVgIgJW2HHqhcW/2nhaLLGpAU1c7QRQ==} - peerDependencies: - '@napi-rs/cross-toolchain-arm64-target-aarch64': ^0.0.16 - '@napi-rs/cross-toolchain-arm64-target-armv7': ^0.0.16 - '@napi-rs/cross-toolchain-arm64-target-x86_64': ^0.0.16 - '@napi-rs/cross-toolchain-x64-target-aarch64': ^0.0.16 - '@napi-rs/cross-toolchain-x64-target-armv7': ^0.0.16 - '@napi-rs/cross-toolchain-x64-target-x86_64': ^0.0.16 - peerDependenciesMeta: - '@napi-rs/cross-toolchain-arm64-target-aarch64': - optional: true - '@napi-rs/cross-toolchain-arm64-target-armv7': - optional: true - '@napi-rs/cross-toolchain-arm64-target-x86_64': - optional: true - '@napi-rs/cross-toolchain-x64-target-aarch64': - optional: true - '@napi-rs/cross-toolchain-x64-target-armv7': - optional: true - '@napi-rs/cross-toolchain-x64-target-x86_64': - optional: true - - '@napi-rs/lzma-android-arm-eabi@1.3.1': - resolution: {integrity: sha512-mtGOg8jXlc+pTBI86cqohfndS9UmOAkk9d5CChKMb8btVks70yhUN1e7YYS3QFbmoxbPs2Ee+wmuH1Khdc7B2w==} - engines: {node: '>= 10'} - cpu: [arm] - os: [android] - - '@napi-rs/lzma-android-arm64@1.3.1': - resolution: {integrity: sha512-4uGkQgAv9Tnc/i0k2eIgbhZgyzs94+iECWxz4MFZNcZ1fNGvGbRL2j+SITE4OmwrUn3TuFK/uYWfgzooq8E1Qg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [android] - - '@napi-rs/lzma-darwin-arm64@1.3.1': - resolution: {integrity: sha512-MZBg4iwHTS8icjTiCMdzh8kYrMmKBCEglFPa+vjI91R2XDwuuwSzqmpATRpmMH8cWUUWtGPF4fnxKzjgkzhd4Q==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [darwin] - - '@napi-rs/lzma-darwin-x64@1.3.1': - resolution: {integrity: sha512-7vte+1lYV7xgZERKH/pjAeh4T16aQASKOzu4op70pK6VP/64Plr5rrvqxQqQmlAIe4pwyo/RkFl1n4LXDod3xg==} - engines: {node: '>= 10'} - cpu: [x64] - os: [darwin] - - '@napi-rs/lzma-freebsd-x64@1.3.1': - resolution: {integrity: sha512-uBS74fynTqLUC3catIxyezCafn8UDlr2yxVV47vz1T6Vop2PGDz/cMQdV6rnLSjPE08Rv66ihM36mgf/MmOkOg==} - engines: {node: '>= 10'} - cpu: [x64] - os: [freebsd] - - '@napi-rs/lzma-linux-arm-gnueabihf@1.3.1': - resolution: {integrity: sha512-rrVLyqBJeN29gPJCNkPbZ7dAzaseEcERKyhjwM+DfbFrDUvtkEcrYPvo+iwE/NmF+OkZQkzcanrVMGnq/mcJYQ==} - engines: {node: '>= 10'} - cpu: [arm] - os: [linux] - - '@napi-rs/lzma-linux-arm64-gnu@1.3.1': - resolution: {integrity: sha512-vDmVsthRbX2opkgRirJJGKQxUP/spvyVM2Y5CyCWZ7sadSID3hA97r38gf9ISn/sJ8/r93IPWLq+iycudNKi+Q==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/lzma-linux-arm64-musl@1.3.1': - resolution: {integrity: sha512-x4m/J3hRdFd3IoqKc+4aBcSUkcuDEP7hH6vdss8bKNLjPfXmnG/lcHJEQX3hNnNOULPP8xVRxgiY8jeL62cnsw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/lzma-linux-x64-gnu@1.3.1': - resolution: {integrity: sha512-riB+Xg72NfH8Kcpq07omshVu0QsLW0v2bhywBNYxvA+t2dGGWSIEN1U/zazUXys+IEA6pBQKqLVseurWE6Cl8g==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/lzma-linux-x64-musl@1.3.1': - resolution: {integrity: sha512-JXLgJFwoeysxdSg7rdVYP8wrliCQVJlU5JcLYjRVSCL4P0mQTjnYi7R7VdaOkDACw/Fvlji7oIJXt0KiaDTcOw==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/lzma-wasm32-wasi@1.3.1': - resolution: {integrity: sha512-XTA9XTUtj0KPKuzNS2oi3bWN6tJodk00wwMd/TiKoEqx9Fe/zu+OfDGuXAn+xs+P7S3YCDHqjYinuTQMZ0ucJw==} - engines: {node: '>=14.0.0'} - cpu: [wasm32] - - '@napi-rs/lzma-win32-arm64-msvc@1.3.1': - resolution: {integrity: sha512-qLDfs9UEtLPPTN/FdSz3gSdlx86VwFQBuLBrQtaiYQtUTKZCOYV1Z1fXqFt5Zqa1HKV2oyXnwGcTI7RpcyXxtg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [win32] - - '@napi-rs/lzma-win32-ia32-msvc@1.3.1': - resolution: {integrity: sha512-rWNlxLFMIfvxzfdQCfeQ3D/HEnQG3vfladFYrXUx6ePXO6r+BLCGn6/LWSSuKlw4vKkb1iHEWsAVaRLIcJEMIA==} - engines: {node: '>= 10'} - cpu: [ia32] - os: [win32] - - '@napi-rs/lzma-win32-x64-msvc@1.3.1': - resolution: {integrity: sha512-SNfHNqEjabXfTL1+KRi0qiAhwIlZHhQystvfSYX6p1g+2trSC/3WUpUQ4fbbR7KyE31g2AAnwjXivnlQ0af/pg==} - engines: {node: '>= 10'} - cpu: [x64] - os: [win32] - - '@napi-rs/lzma@1.3.1': - resolution: {integrity: sha512-XyZoBlYNMvCulK/RmVK/0nB3j7IdH7HpqcrMMg0U+HqQqKRLOQBwvnKNBocPC1bZQ7iZuKWYTLn1ayZwTyek8w==} - engines: {node: '>= 10'} - - '@napi-rs/tar-android-arm-eabi@0.1.1': - resolution: {integrity: sha512-Ufa0ahZvE5KGrC2WBux5svCe/jvC+e8IgtleiicwqnfgTfbDknYyq/QuqkP1AnMp/IvTmx2iutCZt6OFIG0zAg==} - engines: {node: '>= 10'} - cpu: [arm] - os: [android] - - '@napi-rs/tar-android-arm64@0.1.1': - resolution: {integrity: sha512-KUu5fHIiIObSuZ/crHxUrQ243+LiCRKPwdCVLHwjtftqFjzls+R2Mp6GrpM41XxexDMN00SUta3kazi93Xr19A==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [android] - - '@napi-rs/tar-darwin-arm64@0.1.1': - resolution: {integrity: sha512-jaqgdX20iIga+2gzotQ78eF00Cm8vECocUYeMY62WqyzJNv/jx1dlOfELWEccOjpmawFT9tjWebsS9F1QMvSUg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [darwin] - - '@napi-rs/tar-darwin-x64@0.1.1': - resolution: {integrity: sha512-80sa32IxfRso9x9sGTFpfLSx3BnruyJODpSkUzalOCz9i14n5gOKA8KR/JrnSWwDz0p5l5P9kfQD3pu8Voj7WA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [darwin] - - '@napi-rs/tar-freebsd-x64@0.1.1': - resolution: {integrity: sha512-P7V1zBjjC1dCrTwtUzuzYM4AeZduigeCtd8qQw2IUZowM5AsmhMd77oYuXjdU29cEpKUpyYjJRxjPCzFy+WbAQ==} - engines: {node: '>= 10'} - cpu: [x64] - os: [freebsd] - - '@napi-rs/tar-linux-arm-gnueabihf@0.1.1': - resolution: {integrity: sha512-qpC71ILPkWKt8k1iJCYt5gjwcOkd2VFSQIelTRr12t5CVNKV04rE/TMdwFoCP7kxbtb9Fl2cZzCRISw2BhMCmQ==} - engines: {node: '>= 10'} - cpu: [arm] - os: [linux] - - '@napi-rs/tar-linux-arm64-gnu@0.1.1': - resolution: {integrity: sha512-71QgxcFJCog6O4Tauoge8D0ILkDGJTRk3ru7zG8PUFG1QXJ1kkiRikdT77YmoVxtomc9FUOt+bdEdU5Yn+3QUQ==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/tar-linux-arm64-musl@0.1.1': - resolution: {integrity: sha512-R2e7YEILPKc447N1hUt1zQuyy0st83HX6nhmtFywS1aOj76/3hzxLVrebGiiS6kifyCrO82o66CNTYe7DixMZw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/tar-linux-x64-gnu@0.1.1': - resolution: {integrity: sha512-tmy9q2LXUB2GQ+IgUzJn3+us52leplMu96ORyFq1iHQEelGSqXt4xi5DzU07JhX3obJPqVqkybtcRS4enBfmBA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/tar-linux-x64-musl@0.1.1': - resolution: {integrity: sha512-j5ePbe6vihApl0cGPPDUVTWZbf2mF4NhxngAoG2jp7AeX3cWP2O4pjsvaOraW6QfvWEMFPeER7S0b6eBS7duvA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/tar-wasm32-wasi@0.1.1': - resolution: {integrity: sha512-se0+DlOiIRt7mcz7BeOJDoZtCrROpKLwiAOGmNgrjQ/SZS7TnOPuwm3wy9XN9WLoepttEjCEem6UP8yD5GJuQg==} - engines: {node: '>=14.0.0'} - cpu: [wasm32] - - '@napi-rs/tar-win32-arm64-msvc@0.1.1': - resolution: {integrity: sha512-FDZPi2wC7RwzvodogigLh/pJvhqCTVTUqOYuHlLkPSUbSAGiEkI55wk9RqH3y3EdJQaDuzyqC0QKz5ket2U+GA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [win32] - - '@napi-rs/tar-win32-ia32-msvc@0.1.1': - resolution: {integrity: sha512-OPR9Tou5z5M912G7Kc7gkf1ltinbOQx5dS/OeDIWHvPGOfdFDIxt0YVKhzSLRJi43+zIDp8/+cbeMD/cKXfX8w==} - engines: {node: '>= 10'} - cpu: [ia32] - os: [win32] - - '@napi-rs/tar-win32-x64-msvc@0.1.1': - resolution: {integrity: sha512-hiv5KfhrMSg8tTRC2oQXVckVg1h6ZVjwbd5aF9Esl0V3p2TaNFwwbqgnAN4Gm/PmSnHWNL/IRTHkk3cOzDWihQ==} - engines: {node: '>= 10'} - cpu: [x64] - os: [win32] - - '@napi-rs/tar@0.1.1': - resolution: {integrity: sha512-FOMhwwlvoYjHaDBxP26K3D92ltw1Y/CC4CIjgC6qXdzW4MYNwTlEyI58smCM3k+nCVJH3kpOYyH3sgbK4WZA4A==} - engines: {node: '>= 10'} - - '@napi-rs/wasm-runtime@0.2.4': - resolution: {integrity: sha512-9zESzOO5aDByvhIAsOy9TbpZ0Ur2AJbUI7UT73kcUTS2mxAMHOBaa1st/jAymNoCtvrit99kkzT1FZuXVcgfIQ==} - - '@napi-rs/wasm-tools-android-arm-eabi@0.0.2': - resolution: {integrity: sha512-/b+UU3suXjW4P0DzHRNdrnebQtFKcQf/YMeZJH+xUlKgvwli5kbmWjx8Wqqz0VETVkUTuPqJMBDIVLyc+14FGw==} - engines: {node: '>= 10'} - cpu: [arm] - os: [android] - - '@napi-rs/wasm-tools-android-arm64@0.0.2': - resolution: {integrity: sha512-j57GbDflwJdZtT8pZj5fOV4JAP+LdKN+wzsUYs+QRUoBqpWbbUANudolqfw63bkS9sD4z7fbCuz8iwtJqzxTVA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [android] - - '@napi-rs/wasm-tools-darwin-arm64@0.0.2': - resolution: {integrity: sha512-P2ChgWgVuv9GwmbxN89R84KzIImoTqXINteEixUvmkdnhyFiR+I8deNs89Yed+5w8QLC6MEfrtRqLP9YI+NoQA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [darwin] - - '@napi-rs/wasm-tools-darwin-x64@0.0.2': - resolution: {integrity: sha512-T/kQQ0gt8+wau1Z821PKVAD76QhmwVoLs2CT7Z9tTBs2pJvwSCP0C/kQiQAHcJIMi7A2E9Ab/Mez0BERy50EFA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [darwin] - - '@napi-rs/wasm-tools-freebsd-x64@0.0.2': - resolution: {integrity: sha512-GnnHu+r5sfzuxC/1J5UMF/h3BOZnHb3NQZ5hmbCfZYCKzpzRxrAJhzRunlbRN+v0x8M/49dztVTYR3s7K4ooAw==} - engines: {node: '>= 10'} - cpu: [x64] - os: [freebsd] - - '@napi-rs/wasm-tools-linux-arm64-gnu@0.0.2': - resolution: {integrity: sha512-KnZdLT0OnKb1CG2kdt3/WvM43vr9i+FEwXCvSOVC/6Tsifz7ynhMg7LAVESILd03HubzQJfg9nbRsk0bQ+IOwg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/wasm-tools-linux-arm64-musl@0.0.2': - resolution: {integrity: sha512-HkpZOID2U8P6pWqK3mqZ8bxU5xcuT3iA2fO+jrxn78h006iYgfNmdc5JaVhHnHazMmk32xKhSV4iV0VUh8UWDg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/wasm-tools-linux-x64-gnu@0.0.2': - resolution: {integrity: sha512-YksJWBCyOalB9ogtP9+/dZKP+vR6+h7BmzMXaXMT71WW/GvIsifMVgv+DY/FRSNJQupp5Y+ugjqVAOUOc/G65g==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/wasm-tools-linux-x64-musl@0.0.2': - resolution: {integrity: sha512-sPtRxPMdw05KdTcxgSPMmSXG2+PiK3vJ/l2+g9hvjnnKtvslJN2Hr7j8zgzuoKRAUFPaJVe6+D2xVh5cpdqhww==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/wasm-tools-wasm32-wasi@0.0.2': - resolution: {integrity: sha512-muRvZK7AIuo88G2AxYx3gA59rHMQgoN004saQkBvXnz3K/DVHKfTZ6TtUebss8zI3dURU6xExL8drxFWYxjEbQ==} - engines: {node: '>=14.0.0'} - cpu: [wasm32] - - '@napi-rs/wasm-tools-win32-arm64-msvc@0.0.2': - resolution: {integrity: sha512-Cn13WQ+tpFqdVwx0DIWKbsI9auFyzVZV4F5UNOUeDt6GgOL+NndgJul0Pc9bSU6fi03AylMPfF/nTCaDWO2Wgw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [win32] - - '@napi-rs/wasm-tools-win32-ia32-msvc@0.0.2': - resolution: {integrity: sha512-xsg5DkIQi82a8rcx6246Y3XC8TIqHamY+/C6sIlPLaZEuHctDkMECAw0AANwRf5vN//D2oo2oljOuoYtB1GOKw==} - engines: {node: '>= 10'} - cpu: [ia32] - os: [win32] - - '@napi-rs/wasm-tools-win32-x64-msvc@0.0.2': - resolution: {integrity: sha512-yHigltEt33eq8bappvKsIliz4MxfMPn1M+NWbIFRWN+IS1Z57mhmc1osuk+IRXrSlq0Tom0R6MYN1jpkZKz81Q==} - engines: {node: '>= 10'} - cpu: [x64] - os: [win32] - - '@napi-rs/wasm-tools@0.0.2': - resolution: {integrity: sha512-kBvDQCP5BLw2TxTENXLp3Of7vVEx0uyIye824JHE4dduzzOHVgSoOFVhVqAT3Fx/hLV445RVWfEqQbXMg4w/Mw==} - engines: {node: '>= 10'} - - '@nodelib/fs.scandir@2.1.5': - resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} - engines: {node: '>= 8'} - - '@nodelib/fs.stat@2.0.5': - resolution: {integrity: sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==} - engines: {node: '>= 8'} - - '@nodelib/fs.walk@1.2.8': - resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} - engines: {node: '>= 8'} - - '@octokit/auth-token@4.0.0': - resolution: {integrity: sha512-tY/msAuJo6ARbK6SPIxZrPBms3xPbfwBrulZe0Wtr/DIY9lje2HeV1uoebShn6mx7SjCHif6EjMvoREj+gZ+SA==} - engines: {node: '>= 18'} - - '@octokit/core@5.2.0': - resolution: {integrity: sha512-1LFfa/qnMQvEOAdzlQymH0ulepxbxnCYAKJZfMci/5XJyIHWgEYnDmgnKakbTh7CH2tFQ5O60oYDvns4i9RAIg==} - engines: {node: '>= 18'} - - '@octokit/endpoint@9.0.5': - resolution: {integrity: sha512-ekqR4/+PCLkEBF6qgj8WqJfvDq65RH85OAgrtnVp1mSxaXF03u2xW/hUdweGS5654IlC0wkNYC18Z50tSYTAFw==} - engines: {node: '>= 18'} - - '@octokit/graphql@7.1.0': - resolution: {integrity: sha512-r+oZUH7aMFui1ypZnAvZmn0KSqAUgE1/tUXIWaqUCa1758ts/Jio84GZuzsvUkme98kv0WFY8//n0J1Z+vsIsQ==} - engines: {node: '>= 18'} - - '@octokit/openapi-types@22.2.0': - resolution: {integrity: sha512-QBhVjcUa9W7Wwhm6DBFu6ZZ+1/t/oYxqc2tp81Pi41YNuJinbFRx8B133qVOrAaBbF7D/m0Et6f9/pZt9Rc+tg==} - - '@octokit/plugin-paginate-rest@11.3.1': - resolution: {integrity: sha512-ryqobs26cLtM1kQxqeZui4v8FeznirUsksiA+RYemMPJ7Micju0WSkv50dBksTuZks9O5cg4wp+t8fZ/cLY56g==} - engines: {node: '>= 18'} - peerDependencies: - '@octokit/core': '5' - - '@octokit/plugin-request-log@4.0.1': - resolution: {integrity: sha512-GihNqNpGHorUrO7Qa9JbAl0dbLnqJVrV8OXe2Zm5/Y4wFkZQDfTreBzVmiRfJVfE4mClXdihHnbpyyO9FSX4HA==} - engines: {node: '>= 18'} - peerDependencies: - '@octokit/core': '5' - - '@octokit/plugin-rest-endpoint-methods@13.2.2': - resolution: {integrity: sha512-EI7kXWidkt3Xlok5uN43suK99VWqc8OaIMktY9d9+RNKl69juoTyxmLoWPIZgJYzi41qj/9zU7G/ljnNOJ5AFA==} - engines: {node: '>= 18'} - peerDependencies: - '@octokit/core': ^5 - - '@octokit/request-error@5.1.0': - resolution: {integrity: sha512-GETXfE05J0+7H2STzekpKObFe765O5dlAKUTLNGeH+x47z7JjXHfsHKo5z21D/o/IOZTUEI6nyWyR+bZVP/n5Q==} - engines: {node: '>= 18'} - - '@octokit/request@8.4.0': - resolution: {integrity: sha512-9Bb014e+m2TgBeEJGEbdplMVWwPmL1FPtggHQRkV+WVsMggPtEkLKPlcVYm/o8xKLkpJ7B+6N8WfQMtDLX2Dpw==} - engines: {node: '>= 18'} - - '@octokit/rest@20.1.1': - resolution: {integrity: sha512-MB4AYDsM5jhIHro/dq4ix1iWTLGToIGk6cWF5L6vanFaMble5jTX/UBQyiv05HsWnwUtY8JrfHy2LWfKwihqMw==} - engines: {node: '>= 18'} - - '@octokit/types@13.5.0': - resolution: {integrity: sha512-HdqWTf5Z3qwDVlzCrP8UJquMwunpDiMPt5er+QjGzL4hqr/vBVY/MauQgS1xWxCDT1oMx1EULyqxncdCY/NVSQ==} - - '@rollup/pluginutils@4.2.1': - resolution: {integrity: sha512-iKnFXr7NkdZAIHiIWE+BX5ULi/ucVFYWD6TbAV+rZctiRTY2PL6tsIKhoIOaoskiWAkgu+VsbXgUVDNLHf+InQ==} - engines: {node: '>= 8.0.0'} - - '@sindresorhus/merge-streams@2.3.0': - resolution: {integrity: sha512-LtoMMhxAlorcGhmFYI+LhPgbPZCkgP6ra1YL604EeF6U98pLlQ3iWIGMdWSC+vWmPBWBNgmDBAhnAobLROJmwg==} - engines: {node: '>=18'} - - '@tybys/wasm-util@0.9.0': - resolution: {integrity: sha512-6+7nlbMVX/PVDCwaIQ8nTOPveOcFLSt8GcXdx8hD0bt39uWxYT88uXzqTd4fTvqta7oeUJqudepapKNt2DYJFw==} - - '@types/node@20.14.2': - resolution: {integrity: sha512-xyu6WAMVwv6AKFLB+e/7ySZVr/0zLCzOa7rSpq6jNwpqOrUbcACDWC+53d4n2QHOnDou0fbIsg8wZu/sxrnI4Q==} - - '@types/stylis@4.2.6': - resolution: {integrity: sha512-4nebF2ZJGzQk0ka0O6+FZUWceyFv4vWq/0dXBMmrSeAwzOuOd/GxE5Pa64d/ndeNLG73dXoBsRzvtsVsYUv6Uw==} - - '@vercel/nft@0.26.5': - resolution: {integrity: sha512-NHxohEqad6Ra/r4lGknO52uc/GrWILXAMs1BB4401GTqww0fw1bAqzpG1XHuDO+dprg4GvsD9ZLLSsdo78p9hQ==} - engines: {node: '>=16'} - hasBin: true - - abbrev@1.1.1: - resolution: {integrity: sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==} - - acorn-import-attributes@1.9.5: - resolution: {integrity: sha512-n02Vykv5uA3eHGM/Z2dQrcD56kL8TyDb2p1+0P83PClMnC/nc+anbQRhIOWnSq4Ke/KvDPrY3C9hDtC/A3eHnQ==} - peerDependencies: - acorn: ^8 - - acorn-walk@8.3.3: - resolution: {integrity: sha512-MxXdReSRhGO7VlFe1bRG/oI7/mdLV9B9JJT0N8vZOhF7gFRR5l3M8W9G8JxmKV+JC5mGqJ0QvqfSOLsCPa4nUw==} - engines: {node: '>=0.4.0'} - - acorn@8.12.0: - resolution: {integrity: sha512-RTvkC4w+KNXrM39/lWCUaG0IbRkWdCv7W/IOW9oU6SawyxulvkQy5HQPVTKxEjczcUvapcrw3cFx/60VN/NRNw==} - engines: {node: '>=0.4.0'} - hasBin: true - - agent-base@6.0.2: - resolution: {integrity: sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==} - engines: {node: '>= 6.0.0'} - - ansi-escapes@4.3.2: - resolution: {integrity: sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==} - engines: {node: '>=8'} - - ansi-regex@5.0.1: - resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} - engines: {node: '>=8'} - - ansi-regex@6.0.1: - resolution: {integrity: sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==} - engines: {node: '>=12'} - - ansi-styles@4.3.0: - resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} - engines: {node: '>=8'} - - ansi-styles@6.2.1: - resolution: {integrity: sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==} - engines: {node: '>=12'} - - aproba@2.0.0: - resolution: {integrity: sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==} - - are-we-there-yet@2.0.0: - resolution: {integrity: sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw==} - engines: {node: '>=10'} - deprecated: This package is no longer supported. - - argparse@1.0.10: - resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==} - - argparse@2.0.1: - resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} - - array-find-index@1.0.2: - resolution: {integrity: sha512-M1HQyIXcBGtVywBt8WVdim+lrNaK7VHp99Qt5pSNziXznKHViIBbXWtfRTpEFpF/c4FdfxNAsCCwPp5phBYJtw==} - engines: {node: '>=0.10.0'} - - arrgv@1.0.2: - resolution: {integrity: sha512-a4eg4yhp7mmruZDQFqVMlxNRFGi/i1r87pt8SDHy0/I8PqSXoUTlWZRdAZo0VXgvEARcujbtTk8kiZRi1uDGRw==} - engines: {node: '>=8.0.0'} - - arrify@3.0.0: - resolution: {integrity: sha512-tLkvA81vQG/XqE2mjDkGQHoOINtMHtysSnemrmoGe6PydDPMRbVugqyk4A6V/WDWEfm3l+0d8anA9r8cv/5Jaw==} - engines: {node: '>=12'} - - async-sema@3.1.1: - resolution: {integrity: sha512-tLRNUXati5MFePdAk8dw7Qt7DpxPB60ofAgn8WRhW6a2rcimZnYBP9oxHiv0OHy+Wz7kPMG+t4LGdt31+4EmGg==} - - asynckit@0.4.0: - resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} - - ava@6.1.3: - resolution: {integrity: sha512-tkKbpF1pIiC+q09wNU9OfyTDYZa8yuWvU2up3+lFJ3lr1RmnYh2GBpPwzYUEB0wvTPIUysGjcZLNZr7STDviRA==} - engines: {node: ^18.18 || ^20.8 || ^21 || ^22} - hasBin: true - peerDependencies: - '@ava/typescript': '*' - peerDependenciesMeta: - '@ava/typescript': - optional: true - - axios@1.6.2: - resolution: {integrity: sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A==} - - balanced-match@1.0.2: - resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} - - base64-js@1.5.1: - resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==} - - before-after-hook@2.2.3: - resolution: {integrity: sha512-NzUnlZexiaH/46WDhANlyR2bXRopNg4F/zuSA3OpZnllCUgRaOF2znDioDWrmbNVsuZk6l9pMquQB38cfBZwkQ==} - - bindings@1.5.0: - resolution: {integrity: sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==} - - bl@4.1.0: - resolution: {integrity: sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==} - - blueimp-md5@2.19.0: - resolution: {integrity: sha512-DRQrD6gJyy8FbiE4s+bDoXS9hiW3Vbx5uCdwvcCf3zLHL+Iv7LtGHLpr+GZV8rHG8tK766FGYBwRbu8pELTt+w==} - - brace-expansion@1.1.11: - resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} - - braces@3.0.3: - resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==} - engines: {node: '>=8'} - - buffer@5.7.1: - resolution: {integrity: sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==} - - call-bind@1.0.7: - resolution: {integrity: sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==} - engines: {node: '>= 0.4'} - - callsites@4.1.0: - resolution: {integrity: sha512-aBMbD1Xxay75ViYezwT40aQONfr+pSXTHwNKvIXhXD6+LY3F1dLIcceoC5OZKBVHbXcysz1hL9D2w0JJIMXpUw==} - engines: {node: '>=12.20'} - - camelize@1.0.1: - resolution: {integrity: sha512-dU+Tx2fsypxTgtLoE36npi3UqcjSSMNYfkqgmoEhtZrraP5VWq0K7FkWVTYa8eMPtnU/G2txVsfdCJTn9uzpuQ==} - - cbor@9.0.2: - resolution: {integrity: sha512-JPypkxsB10s9QOWwa6zwPzqE1Md3vqpPc+cai4sAecuCsRyAtAl/pMyhPlMbT/xtPnm2dznJZYRLui57qiRhaQ==} - engines: {node: '>=16'} - - chalk@4.1.2: - resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} - engines: {node: '>=10'} - - chalk@5.3.0: - resolution: {integrity: sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==} - engines: {node: ^12.17.0 || ^14.13 || >=16.0.0} - - chardet@0.7.0: - resolution: {integrity: sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==} - - chownr@2.0.0: - resolution: {integrity: sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==} - engines: {node: '>=10'} - - chunkd@2.0.1: - resolution: {integrity: sha512-7d58XsFmOq0j6el67Ug9mHf9ELUXsQXYJBkyxhH/k+6Ke0qXRnv0kbemx+Twc6fRJ07C49lcbdgm9FL1Ei/6SQ==} - - ci-info@4.0.0: - resolution: {integrity: sha512-TdHqgGf9odd8SXNuxtUBVx8Nv+qZOejE6qyqiy5NtbYYQOeFa6zmHkxlPzmaLxWWHsU6nJmB7AETdVPi+2NBUg==} - engines: {node: '>=8'} - - ci-parallel-vars@1.0.1: - resolution: {integrity: sha512-uvzpYrpmidaoxvIQHM+rKSrigjOe9feHYbw4uOI2gdfe1C3xIlxO+kVXq83WQWNniTf8bAxVpy+cQeFQsMERKg==} - - cli-cursor@3.1.0: - resolution: {integrity: sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==} - engines: {node: '>=8'} - - cli-spinners@2.9.2: - resolution: {integrity: sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==} - engines: {node: '>=6'} - - cli-truncate@4.0.0: - resolution: {integrity: sha512-nPdaFdQ0h/GEigbPClz11D0v/ZJEwxmeVZGeMo3Z5StPtUTkA9o1lD6QwoirYiSDzbcwn2XcjwmCp68W1IS4TA==} - engines: {node: '>=18'} - - cli-width@4.1.0: - resolution: {integrity: sha512-ouuZd4/dm2Sw5Gmqy6bGyNNNe1qt9RpmxveLSO7KcgsTnU7RXfsw+/bukWGo1abgBiMAic068rclZsO4IWmmxQ==} - engines: {node: '>= 12'} - - clipanion@3.2.1: - resolution: {integrity: sha512-dYFdjLb7y1ajfxQopN05mylEpK9ZX0sO1/RfMXdfmwjlIsPkbh4p7A682x++zFPLDCo1x3p82dtljHf5cW2LKA==} - peerDependencies: - typanion: '*' - - cliui@8.0.1: - resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==} - engines: {node: '>=12'} - - clone@1.0.4: - resolution: {integrity: sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==} - engines: {node: '>=0.8'} - - code-excerpt@4.0.0: - resolution: {integrity: sha512-xxodCmBen3iy2i0WtAK8FlFNrRzjUqjRsMfho58xT/wvZU1YTM3fCnRjcy1gJPMepaRlgm/0e6w8SpWHpn3/cA==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - color-convert@2.0.1: - resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} - engines: {node: '>=7.0.0'} - - color-name@1.1.4: - resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} - - color-support@1.1.3: - resolution: {integrity: sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==} - hasBin: true - - colorette@2.0.20: - resolution: {integrity: sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==} - - combined-stream@1.0.8: - resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} - engines: {node: '>= 0.8'} - - common-path-prefix@3.0.0: - resolution: {integrity: sha512-QE33hToZseCH3jS0qN96O/bSh3kaw/h+Tq7ngyY9eWDUnTlTNUyqfqvCXioLe5Na5jFsL78ra/wuBU4iuEgd4w==} - - concat-map@0.0.1: - resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} - - concordance@5.0.4: - resolution: {integrity: sha512-OAcsnTEYu1ARJqWVGwf4zh4JDfHZEaSNlNccFmt8YjB2l/n19/PF2viLINHc57vO4FKIAFl2FWASIGZZWZ2Kxw==} - engines: {node: '>=10.18.0 <11 || >=12.14.0 <13 || >=14'} - - console-control-strings@1.1.0: - resolution: {integrity: sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==} - - convert-to-spaces@2.0.1: - resolution: {integrity: sha512-rcQ1bsQO9799wq24uE5AM2tAILy4gXGIK/njFWcVQkGNZ96edlpY+A7bjwvzjYvLDyzmG1MmMLZhpcsb+klNMQ==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - css-color-keywords@1.0.0: - resolution: {integrity: sha512-FyyrDHZKEjXDpNJYvVsV960FiqQyXc/LlYmsxl2BcdMb2WPx0OGRVgTg55rPSyLSNMqP52R9r8geSp7apN3Ofg==} - engines: {node: '>=4'} - - css-to-react-native@3.2.0: - resolution: {integrity: sha512-e8RKaLXMOFii+02mOlqwjbD00KSEKqblnpO9e++1aXS1fPQOpS1YoqdVHBqPjHNoxeF2mimzVqawm2KCbEdtHQ==} - - csstype@3.1.3: - resolution: {integrity: sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==} - - currently-unhandled@0.4.1: - resolution: {integrity: sha512-/fITjgjGU50vjQ4FH6eUoYu+iUoUKIXws2hL15JJpIR+BbTxaXQsMuuyjtNh2WqsSBS5nsaZHFsFecyw5CCAng==} - engines: {node: '>=0.10.0'} - - date-time@3.1.0: - resolution: {integrity: sha512-uqCUKXE5q1PNBXjPqvwhwJf9SwMoAHBgWJ6DcrnS5o+W2JOiIILl0JEdVD8SGujrNS02GGxgwAg2PN2zONgtjg==} - engines: {node: '>=6'} - - debug@4.3.5: - resolution: {integrity: sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg==} - engines: {node: '>=6.0'} - peerDependencies: - supports-color: '*' - peerDependenciesMeta: - supports-color: - optional: true - - defaults@1.0.4: - resolution: {integrity: sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A==} - - define-data-property@1.1.4: - resolution: {integrity: sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==} - engines: {node: '>= 0.4'} - - delayed-stream@1.0.0: - resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} - engines: {node: '>=0.4.0'} - - delegates@1.0.0: - resolution: {integrity: sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==} - - deprecation@2.3.1: - resolution: {integrity: sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==} - - detect-libc@2.0.3: - resolution: {integrity: sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw==} - engines: {node: '>=8'} - - emittery@1.0.3: - resolution: {integrity: sha512-tJdCJitoy2lrC2ldJcqN4vkqJ00lT+tOWNT1hBJjO/3FDMJa5TTIiYGCKGkn/WfCyOzUMObeohbVTj00fhiLiA==} - engines: {node: '>=14.16'} - - emnapi@1.2.0: - resolution: {integrity: sha512-rcq+dJCcfr08I0XM/57LPRqaUokGfni/+SvhO7NaJthTTjRdohhIy0FQwyC5rR1enAsjkldQg83th8J5hURv0Q==} - peerDependencies: - node-addon-api: '>= 6.1.0' - peerDependenciesMeta: - node-addon-api: - optional: true - - emoji-regex@10.3.0: - resolution: {integrity: sha512-QpLs9D9v9kArv4lfDEgg1X/gN5XLnf/A6l9cs8SPZLRZR3ZkY9+kwIQTxm+fsSej5UMYGE8fdoaZVIBlqG0XTw==} - - emoji-regex@8.0.0: - resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} - - es-define-property@1.0.0: - resolution: {integrity: sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==} - engines: {node: '>= 0.4'} - - es-errors@1.3.0: - resolution: {integrity: sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==} - engines: {node: '>= 0.4'} - - escalade@3.1.2: - resolution: {integrity: sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==} - engines: {node: '>=6'} - - escape-string-regexp@2.0.0: - resolution: {integrity: sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==} - engines: {node: '>=8'} - - escape-string-regexp@5.0.0: - resolution: {integrity: sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==} - engines: {node: '>=12'} - - esprima@4.0.1: - resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==} - engines: {node: '>=4'} - hasBin: true - - estree-walker@2.0.2: - resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==} - - esutils@2.0.3: - resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} - engines: {node: '>=0.10.0'} - - external-editor@3.1.0: - resolution: {integrity: sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==} - engines: {node: '>=4'} - - fast-diff@1.3.0: - resolution: {integrity: sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==} - - fast-glob@3.3.2: - resolution: {integrity: sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==} - engines: {node: '>=8.6.0'} - - fastq@1.17.1: - resolution: {integrity: sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==} - - figures@6.1.0: - resolution: {integrity: sha512-d+l3qxjSesT4V7v2fh+QnmFnUWv9lSpjarhShNTgBOfA0ttejbQUAlHLitbjkoRiDulW0OPoQPYIGhIC8ohejg==} - engines: {node: '>=18'} - - file-uri-to-path@1.0.0: - resolution: {integrity: sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==} - - fill-range@7.1.1: - resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==} - engines: {node: '>=8'} - - find-up-simple@1.0.0: - resolution: {integrity: sha512-q7Us7kcjj2VMePAa02hDAF6d+MzsdsAWEwYyOpwUtlerRBkOEPBCRZrAV4XfcSN8fHAgaD0hP7miwoay6DCprw==} - engines: {node: '>=18'} - - follow-redirects@1.15.6: - resolution: {integrity: sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==} - engines: {node: '>=4.0'} - peerDependencies: - debug: '*' - peerDependenciesMeta: - debug: - optional: true - - form-data@4.0.0: - resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==} - engines: {node: '>= 6'} - - fs-minipass@2.1.0: - resolution: {integrity: sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==} - engines: {node: '>= 8'} - - fs.realpath@1.0.0: - resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} - - function-bind@1.1.2: - resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==} - - gauge@3.0.2: - resolution: {integrity: sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q==} - engines: {node: '>=10'} - deprecated: This package is no longer supported. - - get-caller-file@2.0.5: - resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} - engines: {node: 6.* || 8.* || >= 10.*} - - get-east-asian-width@1.2.0: - resolution: {integrity: sha512-2nk+7SIVb14QrgXFHcm84tD4bKQz0RxPuMT8Ag5KPOq7J5fEmAg0UbXdTOSHqNuHSU28k55qnceesxXRZGzKWA==} - engines: {node: '>=18'} - - get-intrinsic@1.2.4: - resolution: {integrity: sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==} - engines: {node: '>= 0.4'} - - glob-parent@5.1.2: - resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} - engines: {node: '>= 6'} - - glob@7.2.3: - resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} - deprecated: Glob versions prior to v9 are no longer supported - - globby@14.0.1: - resolution: {integrity: sha512-jOMLD2Z7MAhyG8aJpNOpmziMOP4rPLcc95oQPKXBazW82z+CEgPFBQvEpRUa1KeIMUJo4Wsm+q6uzO/Q/4BksQ==} - engines: {node: '>=18'} - - gopd@1.0.1: - resolution: {integrity: sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==} - - graceful-fs@4.2.11: - resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} - - has-flag@4.0.0: - resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} - engines: {node: '>=8'} - - has-property-descriptors@1.0.2: - resolution: {integrity: sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==} - - has-proto@1.0.3: - resolution: {integrity: sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==} - engines: {node: '>= 0.4'} - - has-symbols@1.0.3: - resolution: {integrity: sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==} - engines: {node: '>= 0.4'} - - has-unicode@2.0.1: - resolution: {integrity: sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==} - - hasown@2.0.2: - resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==} - engines: {node: '>= 0.4'} - - https-proxy-agent@5.0.1: - resolution: {integrity: sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==} - engines: {node: '>= 6'} - - iconv-lite@0.4.24: - resolution: {integrity: sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==} - engines: {node: '>=0.10.0'} - - ieee754@1.2.1: - resolution: {integrity: sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==} - - ignore-by-default@2.1.0: - resolution: {integrity: sha512-yiWd4GVmJp0Q6ghmM2B/V3oZGRmjrKLXvHR3TE1nfoXsmoggllfZUQe74EN0fJdPFZu2NIvNdrMMLm3OsV7Ohw==} - engines: {node: '>=10 <11 || >=12 <13 || >=14'} - - ignore@5.3.1: - resolution: {integrity: sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==} - engines: {node: '>= 4'} - - imurmurhash@0.1.4: - resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} - engines: {node: '>=0.8.19'} - - indent-string@5.0.0: - resolution: {integrity: sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==} - engines: {node: '>=12'} - - inflight@1.0.6: - resolution: {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. - - inherits@2.0.4: - resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} - - inquirer@9.2.23: - resolution: {integrity: sha512-kod5s+FBPIDM2xiy9fu+6wdU/SkK5le5GS9lh4FEBjBHqiMgD9lLFbCbuqFNAjNL2ZOy9Wd9F694IOzN9pZHBA==} - engines: {node: '>=18'} - - irregular-plurals@3.5.0: - resolution: {integrity: sha512-1ANGLZ+Nkv1ptFb2pa8oG8Lem4krflKuX/gINiHJHjJUKaJHk/SXk5x6K3J+39/p0h1RQ2saROclJJ+QLvETCQ==} - engines: {node: '>=8'} - - is-extglob@2.1.1: - resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} - engines: {node: '>=0.10.0'} - - is-fullwidth-code-point@3.0.0: - resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} - engines: {node: '>=8'} - - is-fullwidth-code-point@4.0.0: - resolution: {integrity: sha512-O4L094N2/dZ7xqVdrXhh9r1KODPJpFms8B5sGdJLPy664AgvXsreZUyCQQNItZRDlYug4xStLjNp/sz3HvBowQ==} - engines: {node: '>=12'} - - is-glob@4.0.3: - resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} - engines: {node: '>=0.10.0'} - - is-interactive@1.0.0: - resolution: {integrity: sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w==} - engines: {node: '>=8'} - - is-number@7.0.0: - resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} - engines: {node: '>=0.12.0'} - - is-plain-object@5.0.0: - resolution: {integrity: sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==} - engines: {node: '>=0.10.0'} - - is-promise@4.0.0: - resolution: {integrity: sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==} - - is-unicode-supported@0.1.0: - resolution: {integrity: sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==} - engines: {node: '>=10'} - - is-unicode-supported@2.0.0: - resolution: {integrity: sha512-FRdAyx5lusK1iHG0TWpVtk9+1i+GjrzRffhDg4ovQ7mcidMQ6mj+MhKPmvh7Xwyv5gIS06ns49CA7Sqg7lC22Q==} - engines: {node: '>=18'} - - js-string-escape@1.0.1: - resolution: {integrity: sha512-Smw4xcfIQ5LVjAOuJCvN/zIodzA/BBSsluuoSykP+lUvScIi4U6RJLfwHet5cxFnCswUjISV8oAXaqaJDY3chg==} - engines: {node: '>= 0.8'} - - js-tokens@4.0.0: - resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} - - js-yaml@3.14.1: - resolution: {integrity: sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==} - hasBin: true - - js-yaml@4.1.0: - resolution: {integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==} - hasBin: true - - load-json-file@7.0.1: - resolution: {integrity: sha512-Gnxj3ev3mB5TkVBGad0JM6dmLiQL+o0t23JPBZ9sd+yvSLk05mFoqKBw5N8gbbkU4TNXyqCgIrl/VM17OgUIgQ==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - lodash-es@4.17.21: - resolution: {integrity: sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==} - - lodash@4.17.21: - resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} - - log-symbols@4.1.0: - resolution: {integrity: sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==} - engines: {node: '>=10'} - - loose-envify@1.4.0: - resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==} - hasBin: true - - make-dir@3.1.0: - resolution: {integrity: sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==} - engines: {node: '>=8'} - - matcher@5.0.0: - resolution: {integrity: sha512-s2EMBOWtXFc8dgqvoAzKJXxNHibcdJMV0gwqKUaw9E2JBJuGUK7DrNKrA6g/i+v72TT16+6sVm5mS3thaMLQUw==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - md5-hex@3.0.1: - resolution: {integrity: sha512-BUiRtTtV39LIJwinWBjqVsU9xhdnz7/i889V859IBFpuqGAj6LuOvHv5XLbgZ2R7ptJoJaEcxkv88/h25T7Ciw==} - engines: {node: '>=8'} - - memoize@10.0.0: - resolution: {integrity: sha512-H6cBLgsi6vMWOcCpvVCdFFnl3kerEXbrYh9q+lY6VXvQSmM6CkmV08VOwT+WE2tzIEqRPFfAq3fm4v/UIW6mSA==} - engines: {node: '>=18'} - - merge2@1.4.1: - resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} - engines: {node: '>= 8'} - - micromatch@4.0.7: - resolution: {integrity: sha512-LPP/3KorzCwBxfeUuZmaR6bG2kdeHSbe0P2tY3FLRU4vYrjYz5hI4QZwV0njUx3jeuKe67YukQ1LSPZBKDqO/Q==} - engines: {node: '>=8.6'} - - mime-db@1.52.0: - resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} - engines: {node: '>= 0.6'} - - mime-types@2.1.35: - resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} - engines: {node: '>= 0.6'} - - mimic-fn@2.1.0: - resolution: {integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==} - engines: {node: '>=6'} - - mimic-function@5.0.1: - resolution: {integrity: sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==} - engines: {node: '>=18'} - - minimatch@3.1.2: - resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} - - minipass@3.3.6: - resolution: {integrity: sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==} - engines: {node: '>=8'} - - minipass@5.0.0: - resolution: {integrity: sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==} - engines: {node: '>=8'} - - minizlib@2.1.2: - resolution: {integrity: sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==} - engines: {node: '>= 8'} - - mkdirp@1.0.4: - resolution: {integrity: sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==} - engines: {node: '>=10'} - hasBin: true - - ms@2.1.2: - resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} - - ms@2.1.3: - resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} - - mute-stream@1.0.0: - resolution: {integrity: sha512-avsJQhyd+680gKXyG/sQc0nXaC6rBkPOfyHYcFb9+hdkqQkR9bdnkJ0AMZhke0oesPqIO+mFFJ+IdBc7mst4IA==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - - nanoid@3.3.7: - resolution: {integrity: sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==} - engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} - hasBin: true - - node-fetch@2.7.0: - resolution: {integrity: sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==} - engines: {node: 4.x || >=6.0.0} - peerDependencies: - encoding: ^0.1.0 - peerDependenciesMeta: - encoding: - optional: true - - node-gyp-build@4.8.1: - resolution: {integrity: sha512-OSs33Z9yWr148JZcbZd5WiAXhh/n9z8TxQcdMhIOlpN9AhWpLfvVFO73+m77bBABQMaY9XSvIa+qk0jlI7Gcaw==} - hasBin: true - - nofilter@3.1.0: - resolution: {integrity: sha512-l2NNj07e9afPnhAhvgVrCD/oy2Ai1yfLpuo3EpiO1jFTsB4sFz6oIfAfSZyQzVpkZQ9xS8ZS5g1jCBgq4Hwo0g==} - engines: {node: '>=12.19'} - - nopt@5.0.0: - resolution: {integrity: sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==} - engines: {node: '>=6'} - hasBin: true - - npmlog@5.0.1: - resolution: {integrity: sha512-AqZtDUWOMKs1G/8lwylVjrdYgqA4d9nu8hc+0gzRxlDb1I10+FHBGMXs6aiQHFdCUUlqH99MUMuLfzWDNDtfxw==} - deprecated: This package is no longer supported. - - object-assign@4.1.1: - resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} - engines: {node: '>=0.10.0'} - - once@1.4.0: - resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} - - onetime@5.1.2: - resolution: {integrity: sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==} - engines: {node: '>=6'} - - ora@5.4.1: - resolution: {integrity: sha512-5b6Y85tPxZZ7QytO+BQzysW31HJku27cRIlkbAXaNx+BdcVi+LlRFmVXzeF6a7JCwJpyw5c4b+YSVImQIrBpuQ==} - engines: {node: '>=10'} - - os-tmpdir@1.0.2: - resolution: {integrity: sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==} - engines: {node: '>=0.10.0'} - - p-map@7.0.2: - resolution: {integrity: sha512-z4cYYMMdKHzw4O5UkWJImbZynVIo0lSGTXc7bzB1e/rrDqkgGUNysK/o4bTr+0+xKvvLoTyGqYC4Fgljy9qe1Q==} - engines: {node: '>=18'} - - package-config@5.0.0: - resolution: {integrity: sha512-GYTTew2slBcYdvRHqjhwaaydVMvn/qrGC323+nKclYioNSLTDUM/lGgtGTgyHVtYcozb+XkE8CNhwcraOmZ9Mg==} - engines: {node: '>=18'} - - parse-ms@4.0.0: - resolution: {integrity: sha512-TXfryirbmq34y8QBwgqCVLi+8oA3oWx2eAnSn62ITyEhEYaWRlVZ2DvMM9eZbMs/RfxPu/PK/aBLyGj4IrqMHw==} - engines: {node: '>=18'} - - path-is-absolute@1.0.1: - resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==} - engines: {node: '>=0.10.0'} - - path-type@5.0.0: - resolution: {integrity: sha512-5HviZNaZcfqP95rwpv+1HDgUamezbqdSYTyzjTvwtJSnIH+3vnbmWsItli8OFEndS984VT55M3jduxZbX351gg==} - engines: {node: '>=12'} - - picocolors@1.0.1: - resolution: {integrity: sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==} - - picomatch@2.3.1: - resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} - engines: {node: '>=8.6'} - - picomatch@3.0.1: - resolution: {integrity: sha512-I3EurrIQMlRc9IaAZnqRR044Phh2DXY+55o7uJ0V+hYZAcQYSuFWsc9q5PvyDHUSCe1Qxn/iBz+78s86zWnGag==} - engines: {node: '>=10'} - - plur@5.1.0: - resolution: {integrity: sha512-VP/72JeXqak2KiOzjgKtQen5y3IZHn+9GOuLDafPv0eXa47xq0At93XahYBs26MsifCQ4enGKwbjBTKgb9QJXg==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - postcss-value-parser@4.2.0: - resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==} - - postcss@8.4.33: - resolution: {integrity: sha512-Kkpbhhdjw2qQs2O2DGX+8m5OVqEcbB9HRBvuYM9pgrjEFUg30A9LmXNlTAUj4S9kgtGyrMbTzVjH7E+s5Re2yg==} - engines: {node: ^10 || ^12 || >=14} - - pretty-ms@9.0.0: - resolution: {integrity: sha512-E9e9HJ9R9NasGOgPaPE8VMeiPKAyWR5jcFpNnwIejslIhWqdqOrb2wShBsncMPUb+BcCd2OPYfh7p2W6oemTng==} - engines: {node: '>=18'} - - proxy-from-env@1.1.0: - resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==} - - queue-microtask@1.2.3: - resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} - - react-dom@18.3.1: - resolution: {integrity: sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==} - peerDependencies: - react: ^18.3.1 - - react@18.3.1: - resolution: {integrity: sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==} - engines: {node: '>=0.10.0'} - - readable-stream@3.6.2: - resolution: {integrity: sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==} - engines: {node: '>= 6'} - - require-directory@2.1.1: - resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} - engines: {node: '>=0.10.0'} - - resolve-cwd@3.0.0: - resolution: {integrity: sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==} - engines: {node: '>=8'} - - resolve-from@5.0.0: - resolution: {integrity: sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==} - engines: {node: '>=8'} - - restore-cursor@3.1.0: - resolution: {integrity: sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==} - engines: {node: '>=8'} - - reusify@1.0.4: - resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==} - engines: {iojs: '>=1.0.0', node: '>=0.10.0'} - - rimraf@3.0.2: - resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==} - deprecated: Rimraf versions prior to v4 are no longer supported - hasBin: true - - run-async@3.0.0: - resolution: {integrity: sha512-540WwVDOMxA6dN6We19EcT9sc3hkXPw5mzRNGM3FkdN/vtE9NFvj5lFAPNwUDmJjXidm3v7TC1cTE7t17Ulm1Q==} - engines: {node: '>=0.12.0'} - - run-parallel@1.2.0: - resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} - - rxjs@7.8.1: - resolution: {integrity: sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==} - - safe-buffer@5.2.1: - resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} - - safer-buffer@2.1.2: - resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} - - scheduler@0.23.2: - resolution: {integrity: sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ==} - - semver@6.3.1: - resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} - hasBin: true - - semver@7.6.2: - resolution: {integrity: sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==} - engines: {node: '>=10'} - hasBin: true - - serialize-error@7.0.1: - resolution: {integrity: sha512-8I8TjW5KMOKsZQTvoxjuSIa7foAwPWGOts+6o7sgjz41/qMD9VQHEDxi6PBvK2l0MXUmqZyNpUK+T2tQaaElvw==} - engines: {node: '>=10'} - - set-blocking@2.0.0: - resolution: {integrity: sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==} - - set-function-length@1.2.2: - resolution: {integrity: sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==} - engines: {node: '>= 0.4'} - - shallowequal@1.1.0: - resolution: {integrity: sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ==} - - signal-exit@3.0.7: - resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} - - signal-exit@4.1.0: - resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} - engines: {node: '>=14'} - - slash@5.1.0: - resolution: {integrity: sha512-ZA6oR3T/pEyuqwMgAKT0/hAv8oAXckzbkmR0UkUosQ+Mc4RxGoJkRmwHgHufaenlyAgE1Mxgpdcrf75y6XcnDg==} - engines: {node: '>=14.16'} - - slice-ansi@5.0.0: - resolution: {integrity: sha512-FC+lgizVPfie0kkhqUScwRu1O/lF6NOgJmlCgK+/LYxDCTk8sGelYaHDhFcDN+Sn3Cv+3VSa4Byeo+IMCzpMgQ==} - engines: {node: '>=12'} - - source-map-js@1.2.0: - resolution: {integrity: sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==} - engines: {node: '>=0.10.0'} - - sprintf-js@1.0.3: - resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==} - - stack-utils@2.0.6: - resolution: {integrity: sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==} - engines: {node: '>=10'} - - string-width@4.2.3: - resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} - engines: {node: '>=8'} - - string-width@7.1.0: - resolution: {integrity: sha512-SEIJCWiX7Kg4c129n48aDRwLbFb2LJmXXFrWBG4NGaRtMQ3myKPKbwrD1BKqQn74oCoNMBVrfDEr5M9YxCsrkw==} - engines: {node: '>=18'} - - string_decoder@1.3.0: - resolution: {integrity: sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==} - - strip-ansi@6.0.1: - resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} - engines: {node: '>=8'} - - strip-ansi@7.1.0: - resolution: {integrity: sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==} - engines: {node: '>=12'} - - styled-components@6.1.1: - resolution: {integrity: sha512-cpZZP5RrKRIClBW5Eby4JM1wElLVP4NQrJbJ0h10TidTyJf4SIIwa3zLXOoPb4gJi8MsJ8mjq5mu2IrEhZIAcQ==} - engines: {node: '>= 16'} - peerDependencies: - react: '>= 16.8.0' - react-dom: '>= 16.8.0' - - stylis@4.3.2: - resolution: {integrity: sha512-bhtUjWd/z6ltJiQwg0dUfxEJ+W+jdqQd8TbWLWyeIJHlnsqmGLRFFd8e5mA0AZi/zx90smXRlN66YMTcaSFifg==} - - supertap@3.0.1: - resolution: {integrity: sha512-u1ZpIBCawJnO+0QePsEiOknOfCRq0yERxiAchT0i4li0WHNUJbf0evXXSXOcCAR4M8iMDoajXYmstm/qO81Isw==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - supports-color@7.2.0: - resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} - engines: {node: '>=8'} - - tar@6.2.1: - resolution: {integrity: sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==} - engines: {node: '>=10'} - - temp-dir@3.0.0: - resolution: {integrity: sha512-nHc6S/bwIilKHNRgK/3jlhDoIHcp45YgyiwcAk46Tr0LfEqGBVpmiAyuiuxeVE44m3mXnEeVhaipLOEWmH+Njw==} - engines: {node: '>=14.16'} - - time-zone@1.0.0: - resolution: {integrity: sha512-TIsDdtKo6+XrPtiTm1ssmMngN1sAhyKnTO2kunQWqNPWIVvCm15Wmw4SWInwTVgJ5u/Tr04+8Ei9TNcw4x4ONA==} - engines: {node: '>=4'} - - tmp@0.0.33: - resolution: {integrity: sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==} - engines: {node: '>=0.6.0'} - - to-regex-range@5.0.1: - resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} - engines: {node: '>=8.0'} - - toml@3.0.0: - resolution: {integrity: sha512-y/mWCZinnvxjTKYhJ+pYxwD0mRLVvOtdS2Awbgxln6iEnt4rk0yBxeSBHkGJcPucRiG0e55mwWp+g/05rsrd6w==} - - tr46@0.0.3: - resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==} - - tslib@2.6.3: - resolution: {integrity: sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ==} - - typanion@3.14.0: - resolution: {integrity: sha512-ZW/lVMRabETuYCd9O9ZvMhAh8GslSqaUjxmK/JLPCh6l73CvLBiuXswj/+7LdnWOgYsQ130FqLzFz5aGT4I3Ug==} - - type-fest@0.13.1: - resolution: {integrity: sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==} - engines: {node: '>=10'} - - type-fest@0.21.3: - resolution: {integrity: sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==} - engines: {node: '>=10'} - - typescript@5.4.5: - resolution: {integrity: sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==} - engines: {node: '>=14.17'} - hasBin: true - - undici-types@5.26.5: - resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==} - - unicorn-magic@0.1.0: - resolution: {integrity: sha512-lRfVq8fE8gz6QMBuDM6a+LO3IAzTi05H6gCVaUpir2E1Rwpo4ZUog45KpNXKC/Mn3Yb9UDuHumeFTo9iV/D9FQ==} - engines: {node: '>=18'} - - universal-user-agent@6.0.1: - resolution: {integrity: sha512-yCzhz6FN2wU1NiiQRogkTQszlQSlpWaw8SvVegAc+bDxbzHgh1vX8uIe8OYyMH6DwH+sdTJsgMl36+mSMdRJIQ==} - - util-deprecate@1.0.2: - resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} - - wasm-sjlj@1.0.5: - resolution: {integrity: sha512-Z/MHJeOkAvJJVWnGX3/YZGYldGaawZbYHX4ldYG9kLhcdB8H31F5x66M7Zc4BP/7pg0aLsusQj1629m2B3Rilg==} - - wcwidth@1.0.1: - resolution: {integrity: sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==} - - webidl-conversions@3.0.1: - resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==} - - well-known-symbols@2.0.0: - resolution: {integrity: sha512-ZMjC3ho+KXo0BfJb7JgtQ5IBuvnShdlACNkKkdsqBmYw3bPAaJfPeYUo6tLUaT5tG/Gkh7xkpBhKRQ9e7pyg9Q==} - engines: {node: '>=6'} - - whatwg-url@5.0.0: - resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==} - - wide-align@1.1.5: - resolution: {integrity: sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==} - - wrap-ansi@6.2.0: - resolution: {integrity: sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==} - engines: {node: '>=8'} - - wrap-ansi@7.0.0: - resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==} - engines: {node: '>=10'} - - wrappy@1.0.2: - resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} - - write-file-atomic@5.0.1: - resolution: {integrity: sha512-+QU2zd6OTD8XWIJCbffaiQeH9U73qIqafo1x6V1snCWYGJf6cVE0cDR4D8xRzcEnfI21IFrUPzPGtcPf8AC+Rw==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - - y18n@5.0.8: - resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==} - engines: {node: '>=10'} - - yallist@4.0.0: - resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==} - - yargs-parser@21.1.1: - resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} - engines: {node: '>=12'} - - yargs@17.7.2: - resolution: {integrity: sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==} - engines: {node: '>=12'} - -snapshots: - - '@emnapi/core@1.2.0': - dependencies: - '@emnapi/wasi-threads': 1.0.1 - tslib: 2.6.3 - - '@emnapi/runtime@1.2.0': - dependencies: - tslib: 2.6.3 - - '@emnapi/wasi-threads@1.0.1': - dependencies: - tslib: 2.6.3 - - '@emotion/is-prop-valid@1.2.2': - dependencies: - '@emotion/memoize': 0.8.1 - - '@emotion/memoize@0.8.1': {} - - '@emotion/unitless@0.8.1': {} - - '@inquirer/figures@1.0.3': {} - - '@ljharb/through@2.3.13': - dependencies: - call-bind: 1.0.7 - - '@mapbox/node-pre-gyp@1.0.11': - dependencies: - detect-libc: 2.0.3 - https-proxy-agent: 5.0.1 - make-dir: 3.1.0 - node-fetch: 2.7.0 - nopt: 5.0.0 - npmlog: 5.0.1 - rimraf: 3.0.2 - semver: 7.6.2 - tar: 6.2.1 - transitivePeerDependencies: - - encoding - - supports-color - - '@napi-rs/cli@3.0.0-alpha.55(@emnapi/runtime@1.2.0)(emnapi@1.2.0)': - dependencies: - '@napi-rs/cross-toolchain': 0.0.16 - '@napi-rs/wasm-tools': 0.0.2 - '@octokit/rest': 20.1.1 - clipanion: 3.2.1(typanion@3.14.0) - colorette: 2.0.20 - debug: 4.3.5 - inquirer: 9.2.23 - js-yaml: 4.1.0 - lodash-es: 4.17.21 - semver: 7.6.2 - toml: 3.0.0 - typanion: 3.14.0 - wasm-sjlj: 1.0.5 - optionalDependencies: - '@emnapi/runtime': 1.2.0 - emnapi: 1.2.0 - transitivePeerDependencies: - - '@napi-rs/cross-toolchain-arm64-target-aarch64' - - '@napi-rs/cross-toolchain-arm64-target-armv7' - - '@napi-rs/cross-toolchain-arm64-target-x86_64' - - '@napi-rs/cross-toolchain-x64-target-aarch64' - - '@napi-rs/cross-toolchain-x64-target-armv7' - - '@napi-rs/cross-toolchain-x64-target-x86_64' - - supports-color - - '@napi-rs/cross-toolchain@0.0.16': - dependencies: - '@napi-rs/lzma': 1.3.1 - '@napi-rs/tar': 0.1.1 - debug: 4.3.5 - transitivePeerDependencies: - - supports-color - - '@napi-rs/lzma-android-arm-eabi@1.3.1': - optional: true - - '@napi-rs/lzma-android-arm64@1.3.1': - optional: true - - '@napi-rs/lzma-darwin-arm64@1.3.1': - optional: true - - '@napi-rs/lzma-darwin-x64@1.3.1': - optional: true - - '@napi-rs/lzma-freebsd-x64@1.3.1': - optional: true - - '@napi-rs/lzma-linux-arm-gnueabihf@1.3.1': - optional: true - - '@napi-rs/lzma-linux-arm64-gnu@1.3.1': - optional: true - - '@napi-rs/lzma-linux-arm64-musl@1.3.1': - optional: true - - '@napi-rs/lzma-linux-x64-gnu@1.3.1': - optional: true - - '@napi-rs/lzma-linux-x64-musl@1.3.1': - optional: true - - '@napi-rs/lzma-wasm32-wasi@1.3.1': - dependencies: - '@napi-rs/wasm-runtime': 0.2.4 - optional: true - - '@napi-rs/lzma-win32-arm64-msvc@1.3.1': - optional: true - - '@napi-rs/lzma-win32-ia32-msvc@1.3.1': - optional: true - - '@napi-rs/lzma-win32-x64-msvc@1.3.1': - optional: true - - '@napi-rs/lzma@1.3.1': - optionalDependencies: - '@napi-rs/lzma-android-arm-eabi': 1.3.1 - '@napi-rs/lzma-android-arm64': 1.3.1 - '@napi-rs/lzma-darwin-arm64': 1.3.1 - '@napi-rs/lzma-darwin-x64': 1.3.1 - '@napi-rs/lzma-freebsd-x64': 1.3.1 - '@napi-rs/lzma-linux-arm-gnueabihf': 1.3.1 - '@napi-rs/lzma-linux-arm64-gnu': 1.3.1 - '@napi-rs/lzma-linux-arm64-musl': 1.3.1 - '@napi-rs/lzma-linux-x64-gnu': 1.3.1 - '@napi-rs/lzma-linux-x64-musl': 1.3.1 - '@napi-rs/lzma-wasm32-wasi': 1.3.1 - '@napi-rs/lzma-win32-arm64-msvc': 1.3.1 - '@napi-rs/lzma-win32-ia32-msvc': 1.3.1 - '@napi-rs/lzma-win32-x64-msvc': 1.3.1 - - '@napi-rs/tar-android-arm-eabi@0.1.1': - optional: true - - '@napi-rs/tar-android-arm64@0.1.1': - optional: true - - '@napi-rs/tar-darwin-arm64@0.1.1': - optional: true - - '@napi-rs/tar-darwin-x64@0.1.1': - optional: true - - '@napi-rs/tar-freebsd-x64@0.1.1': - optional: true - - '@napi-rs/tar-linux-arm-gnueabihf@0.1.1': - optional: true - - '@napi-rs/tar-linux-arm64-gnu@0.1.1': - optional: true - - '@napi-rs/tar-linux-arm64-musl@0.1.1': - optional: true - - '@napi-rs/tar-linux-x64-gnu@0.1.1': - optional: true - - '@napi-rs/tar-linux-x64-musl@0.1.1': - optional: true - - '@napi-rs/tar-wasm32-wasi@0.1.1': - dependencies: - '@napi-rs/wasm-runtime': 0.2.4 - optional: true - - '@napi-rs/tar-win32-arm64-msvc@0.1.1': - optional: true - - '@napi-rs/tar-win32-ia32-msvc@0.1.1': - optional: true - - '@napi-rs/tar-win32-x64-msvc@0.1.1': - optional: true - - '@napi-rs/tar@0.1.1': - optionalDependencies: - '@napi-rs/tar-android-arm-eabi': 0.1.1 - '@napi-rs/tar-android-arm64': 0.1.1 - '@napi-rs/tar-darwin-arm64': 0.1.1 - '@napi-rs/tar-darwin-x64': 0.1.1 - '@napi-rs/tar-freebsd-x64': 0.1.1 - '@napi-rs/tar-linux-arm-gnueabihf': 0.1.1 - '@napi-rs/tar-linux-arm64-gnu': 0.1.1 - '@napi-rs/tar-linux-arm64-musl': 0.1.1 - '@napi-rs/tar-linux-x64-gnu': 0.1.1 - '@napi-rs/tar-linux-x64-musl': 0.1.1 - '@napi-rs/tar-wasm32-wasi': 0.1.1 - '@napi-rs/tar-win32-arm64-msvc': 0.1.1 - '@napi-rs/tar-win32-ia32-msvc': 0.1.1 - '@napi-rs/tar-win32-x64-msvc': 0.1.1 - - '@napi-rs/wasm-runtime@0.2.4': - dependencies: - '@emnapi/core': 1.2.0 - '@emnapi/runtime': 1.2.0 - '@tybys/wasm-util': 0.9.0 - - '@napi-rs/wasm-tools-android-arm-eabi@0.0.2': - optional: true - - '@napi-rs/wasm-tools-android-arm64@0.0.2': - optional: true - - '@napi-rs/wasm-tools-darwin-arm64@0.0.2': - optional: true - - '@napi-rs/wasm-tools-darwin-x64@0.0.2': - optional: true - - '@napi-rs/wasm-tools-freebsd-x64@0.0.2': - optional: true - - '@napi-rs/wasm-tools-linux-arm64-gnu@0.0.2': - optional: true - - '@napi-rs/wasm-tools-linux-arm64-musl@0.0.2': - optional: true - - '@napi-rs/wasm-tools-linux-x64-gnu@0.0.2': - optional: true - - '@napi-rs/wasm-tools-linux-x64-musl@0.0.2': - optional: true - - '@napi-rs/wasm-tools-wasm32-wasi@0.0.2': - dependencies: - '@napi-rs/wasm-runtime': 0.2.4 - optional: true - - '@napi-rs/wasm-tools-win32-arm64-msvc@0.0.2': - optional: true - - '@napi-rs/wasm-tools-win32-ia32-msvc@0.0.2': - optional: true - - '@napi-rs/wasm-tools-win32-x64-msvc@0.0.2': - optional: true - - '@napi-rs/wasm-tools@0.0.2': - optionalDependencies: - '@napi-rs/wasm-tools-android-arm-eabi': 0.0.2 - '@napi-rs/wasm-tools-android-arm64': 0.0.2 - '@napi-rs/wasm-tools-darwin-arm64': 0.0.2 - '@napi-rs/wasm-tools-darwin-x64': 0.0.2 - '@napi-rs/wasm-tools-freebsd-x64': 0.0.2 - '@napi-rs/wasm-tools-linux-arm64-gnu': 0.0.2 - '@napi-rs/wasm-tools-linux-arm64-musl': 0.0.2 - '@napi-rs/wasm-tools-linux-x64-gnu': 0.0.2 - '@napi-rs/wasm-tools-linux-x64-musl': 0.0.2 - '@napi-rs/wasm-tools-wasm32-wasi': 0.0.2 - '@napi-rs/wasm-tools-win32-arm64-msvc': 0.0.2 - '@napi-rs/wasm-tools-win32-ia32-msvc': 0.0.2 - '@napi-rs/wasm-tools-win32-x64-msvc': 0.0.2 - - '@nodelib/fs.scandir@2.1.5': - dependencies: - '@nodelib/fs.stat': 2.0.5 - run-parallel: 1.2.0 - - '@nodelib/fs.stat@2.0.5': {} - - '@nodelib/fs.walk@1.2.8': - dependencies: - '@nodelib/fs.scandir': 2.1.5 - fastq: 1.17.1 - - '@octokit/auth-token@4.0.0': {} - - '@octokit/core@5.2.0': - dependencies: - '@octokit/auth-token': 4.0.0 - '@octokit/graphql': 7.1.0 - '@octokit/request': 8.4.0 - '@octokit/request-error': 5.1.0 - '@octokit/types': 13.5.0 - before-after-hook: 2.2.3 - universal-user-agent: 6.0.1 - - '@octokit/endpoint@9.0.5': - dependencies: - '@octokit/types': 13.5.0 - universal-user-agent: 6.0.1 - - '@octokit/graphql@7.1.0': - dependencies: - '@octokit/request': 8.4.0 - '@octokit/types': 13.5.0 - universal-user-agent: 6.0.1 - - '@octokit/openapi-types@22.2.0': {} - - '@octokit/plugin-paginate-rest@11.3.1(@octokit/core@5.2.0)': - dependencies: - '@octokit/core': 5.2.0 - '@octokit/types': 13.5.0 - - '@octokit/plugin-request-log@4.0.1(@octokit/core@5.2.0)': - dependencies: - '@octokit/core': 5.2.0 - - '@octokit/plugin-rest-endpoint-methods@13.2.2(@octokit/core@5.2.0)': - dependencies: - '@octokit/core': 5.2.0 - '@octokit/types': 13.5.0 - - '@octokit/request-error@5.1.0': - dependencies: - '@octokit/types': 13.5.0 - deprecation: 2.3.1 - once: 1.4.0 - - '@octokit/request@8.4.0': - dependencies: - '@octokit/endpoint': 9.0.5 - '@octokit/request-error': 5.1.0 - '@octokit/types': 13.5.0 - universal-user-agent: 6.0.1 - - '@octokit/rest@20.1.1': - dependencies: - '@octokit/core': 5.2.0 - '@octokit/plugin-paginate-rest': 11.3.1(@octokit/core@5.2.0) - '@octokit/plugin-request-log': 4.0.1(@octokit/core@5.2.0) - '@octokit/plugin-rest-endpoint-methods': 13.2.2(@octokit/core@5.2.0) - - '@octokit/types@13.5.0': - dependencies: - '@octokit/openapi-types': 22.2.0 - - '@rollup/pluginutils@4.2.1': - dependencies: - estree-walker: 2.0.2 - picomatch: 2.3.1 - - '@sindresorhus/merge-streams@2.3.0': {} - - '@tybys/wasm-util@0.9.0': - dependencies: - tslib: 2.6.3 - - '@types/node@20.14.2': - dependencies: - undici-types: 5.26.5 - - '@types/stylis@4.2.6': {} - - '@vercel/nft@0.26.5': - dependencies: - '@mapbox/node-pre-gyp': 1.0.11 - '@rollup/pluginutils': 4.2.1 - acorn: 8.12.0 - acorn-import-attributes: 1.9.5(acorn@8.12.0) - async-sema: 3.1.1 - bindings: 1.5.0 - estree-walker: 2.0.2 - glob: 7.2.3 - graceful-fs: 4.2.11 - micromatch: 4.0.7 - node-gyp-build: 4.8.1 - resolve-from: 5.0.0 - transitivePeerDependencies: - - encoding - - supports-color - - abbrev@1.1.1: {} - - acorn-import-attributes@1.9.5(acorn@8.12.0): - dependencies: - acorn: 8.12.0 - - acorn-walk@8.3.3: - dependencies: - acorn: 8.12.0 - - acorn@8.12.0: {} - - agent-base@6.0.2: - dependencies: - debug: 4.3.5 - transitivePeerDependencies: - - supports-color - - ansi-escapes@4.3.2: - dependencies: - type-fest: 0.21.3 - - ansi-regex@5.0.1: {} - - ansi-regex@6.0.1: {} - - ansi-styles@4.3.0: - dependencies: - color-convert: 2.0.1 - - ansi-styles@6.2.1: {} - - aproba@2.0.0: {} - - are-we-there-yet@2.0.0: - dependencies: - delegates: 1.0.0 - readable-stream: 3.6.2 - - argparse@1.0.10: - dependencies: - sprintf-js: 1.0.3 - - argparse@2.0.1: {} - - array-find-index@1.0.2: {} - - arrgv@1.0.2: {} - - arrify@3.0.0: {} - - async-sema@3.1.1: {} - - asynckit@0.4.0: {} - - ava@6.1.3: - dependencies: - '@vercel/nft': 0.26.5 - acorn: 8.12.0 - acorn-walk: 8.3.3 - ansi-styles: 6.2.1 - arrgv: 1.0.2 - arrify: 3.0.0 - callsites: 4.1.0 - cbor: 9.0.2 - chalk: 5.3.0 - chunkd: 2.0.1 - ci-info: 4.0.0 - ci-parallel-vars: 1.0.1 - cli-truncate: 4.0.0 - code-excerpt: 4.0.0 - common-path-prefix: 3.0.0 - concordance: 5.0.4 - currently-unhandled: 0.4.1 - debug: 4.3.5 - emittery: 1.0.3 - figures: 6.1.0 - globby: 14.0.1 - ignore-by-default: 2.1.0 - indent-string: 5.0.0 - is-plain-object: 5.0.0 - is-promise: 4.0.0 - matcher: 5.0.0 - memoize: 10.0.0 - ms: 2.1.3 - p-map: 7.0.2 - package-config: 5.0.0 - picomatch: 3.0.1 - plur: 5.1.0 - pretty-ms: 9.0.0 - resolve-cwd: 3.0.0 - stack-utils: 2.0.6 - strip-ansi: 7.1.0 - supertap: 3.0.1 - temp-dir: 3.0.0 - write-file-atomic: 5.0.1 - yargs: 17.7.2 - transitivePeerDependencies: - - encoding - - supports-color - - axios@1.6.2: - dependencies: - follow-redirects: 1.15.6 - form-data: 4.0.0 - proxy-from-env: 1.1.0 - transitivePeerDependencies: - - debug - - balanced-match@1.0.2: {} - - base64-js@1.5.1: {} - - before-after-hook@2.2.3: {} - - bindings@1.5.0: - dependencies: - file-uri-to-path: 1.0.0 - - bl@4.1.0: - dependencies: - buffer: 5.7.1 - inherits: 2.0.4 - readable-stream: 3.6.2 - - blueimp-md5@2.19.0: {} - - brace-expansion@1.1.11: - dependencies: - balanced-match: 1.0.2 - concat-map: 0.0.1 - - braces@3.0.3: - dependencies: - fill-range: 7.1.1 - - buffer@5.7.1: - dependencies: - base64-js: 1.5.1 - ieee754: 1.2.1 - - call-bind@1.0.7: - dependencies: - es-define-property: 1.0.0 - es-errors: 1.3.0 - function-bind: 1.1.2 - get-intrinsic: 1.2.4 - set-function-length: 1.2.2 - - callsites@4.1.0: {} - - camelize@1.0.1: {} - - cbor@9.0.2: - dependencies: - nofilter: 3.1.0 - - chalk@4.1.2: - dependencies: - ansi-styles: 4.3.0 - supports-color: 7.2.0 - - chalk@5.3.0: {} - - chardet@0.7.0: {} - - chownr@2.0.0: {} - - chunkd@2.0.1: {} - - ci-info@4.0.0: {} - - ci-parallel-vars@1.0.1: {} - - cli-cursor@3.1.0: - dependencies: - restore-cursor: 3.1.0 - - cli-spinners@2.9.2: {} - - cli-truncate@4.0.0: - dependencies: - slice-ansi: 5.0.0 - string-width: 7.1.0 - - cli-width@4.1.0: {} - - clipanion@3.2.1(typanion@3.14.0): - dependencies: - typanion: 3.14.0 - - cliui@8.0.1: - dependencies: - string-width: 4.2.3 - strip-ansi: 6.0.1 - wrap-ansi: 7.0.0 - - clone@1.0.4: {} - - code-excerpt@4.0.0: - dependencies: - convert-to-spaces: 2.0.1 - - color-convert@2.0.1: - dependencies: - color-name: 1.1.4 - - color-name@1.1.4: {} - - color-support@1.1.3: {} - - colorette@2.0.20: {} - - combined-stream@1.0.8: - dependencies: - delayed-stream: 1.0.0 - - common-path-prefix@3.0.0: {} - - concat-map@0.0.1: {} - - concordance@5.0.4: - dependencies: - date-time: 3.1.0 - esutils: 2.0.3 - fast-diff: 1.3.0 - js-string-escape: 1.0.1 - lodash: 4.17.21 - md5-hex: 3.0.1 - semver: 7.6.2 - well-known-symbols: 2.0.0 - - console-control-strings@1.1.0: {} - - convert-to-spaces@2.0.1: {} - - css-color-keywords@1.0.0: {} - - css-to-react-native@3.2.0: - dependencies: - camelize: 1.0.1 - css-color-keywords: 1.0.0 - postcss-value-parser: 4.2.0 - - csstype@3.1.3: {} - - currently-unhandled@0.4.1: - dependencies: - array-find-index: 1.0.2 - - date-time@3.1.0: - dependencies: - time-zone: 1.0.0 - - debug@4.3.5: - dependencies: - ms: 2.1.2 - - defaults@1.0.4: - dependencies: - clone: 1.0.4 - - define-data-property@1.1.4: - dependencies: - es-define-property: 1.0.0 - es-errors: 1.3.0 - gopd: 1.0.1 - - delayed-stream@1.0.0: {} - - delegates@1.0.0: {} - - deprecation@2.3.1: {} - - detect-libc@2.0.3: {} - - emittery@1.0.3: {} - - emnapi@1.2.0: {} - - emoji-regex@10.3.0: {} - - emoji-regex@8.0.0: {} - - es-define-property@1.0.0: - dependencies: - get-intrinsic: 1.2.4 - - es-errors@1.3.0: {} - - escalade@3.1.2: {} - - escape-string-regexp@2.0.0: {} - - escape-string-regexp@5.0.0: {} - - esprima@4.0.1: {} - - estree-walker@2.0.2: {} - - esutils@2.0.3: {} - - external-editor@3.1.0: - dependencies: - chardet: 0.7.0 - iconv-lite: 0.4.24 - tmp: 0.0.33 - - fast-diff@1.3.0: {} - - fast-glob@3.3.2: - dependencies: - '@nodelib/fs.stat': 2.0.5 - '@nodelib/fs.walk': 1.2.8 - glob-parent: 5.1.2 - merge2: 1.4.1 - micromatch: 4.0.7 - - fastq@1.17.1: - dependencies: - reusify: 1.0.4 - - figures@6.1.0: - dependencies: - is-unicode-supported: 2.0.0 - - file-uri-to-path@1.0.0: {} - - fill-range@7.1.1: - dependencies: - to-regex-range: 5.0.1 - - find-up-simple@1.0.0: {} - - follow-redirects@1.15.6: {} - - form-data@4.0.0: - dependencies: - asynckit: 0.4.0 - combined-stream: 1.0.8 - mime-types: 2.1.35 - - fs-minipass@2.1.0: - dependencies: - minipass: 3.3.6 - - fs.realpath@1.0.0: {} - - function-bind@1.1.2: {} - - gauge@3.0.2: - dependencies: - aproba: 2.0.0 - color-support: 1.1.3 - console-control-strings: 1.1.0 - has-unicode: 2.0.1 - object-assign: 4.1.1 - signal-exit: 3.0.7 - string-width: 4.2.3 - strip-ansi: 6.0.1 - wide-align: 1.1.5 - - get-caller-file@2.0.5: {} - - get-east-asian-width@1.2.0: {} - - get-intrinsic@1.2.4: - dependencies: - es-errors: 1.3.0 - function-bind: 1.1.2 - has-proto: 1.0.3 - has-symbols: 1.0.3 - hasown: 2.0.2 - - glob-parent@5.1.2: - dependencies: - is-glob: 4.0.3 - - glob@7.2.3: - dependencies: - fs.realpath: 1.0.0 - inflight: 1.0.6 - inherits: 2.0.4 - minimatch: 3.1.2 - once: 1.4.0 - path-is-absolute: 1.0.1 - - globby@14.0.1: - dependencies: - '@sindresorhus/merge-streams': 2.3.0 - fast-glob: 3.3.2 - ignore: 5.3.1 - path-type: 5.0.0 - slash: 5.1.0 - unicorn-magic: 0.1.0 - - gopd@1.0.1: - dependencies: - get-intrinsic: 1.2.4 - - graceful-fs@4.2.11: {} - - has-flag@4.0.0: {} - - has-property-descriptors@1.0.2: - dependencies: - es-define-property: 1.0.0 - - has-proto@1.0.3: {} - - has-symbols@1.0.3: {} - - has-unicode@2.0.1: {} - - hasown@2.0.2: - dependencies: - function-bind: 1.1.2 - - https-proxy-agent@5.0.1: - dependencies: - agent-base: 6.0.2 - debug: 4.3.5 - transitivePeerDependencies: - - supports-color - - iconv-lite@0.4.24: - dependencies: - safer-buffer: 2.1.2 - - ieee754@1.2.1: {} - - ignore-by-default@2.1.0: {} - - ignore@5.3.1: {} - - imurmurhash@0.1.4: {} - - indent-string@5.0.0: {} - - inflight@1.0.6: - dependencies: - once: 1.4.0 - wrappy: 1.0.2 - - inherits@2.0.4: {} - - inquirer@9.2.23: - dependencies: - '@inquirer/figures': 1.0.3 - '@ljharb/through': 2.3.13 - ansi-escapes: 4.3.2 - chalk: 5.3.0 - cli-cursor: 3.1.0 - cli-width: 4.1.0 - external-editor: 3.1.0 - lodash: 4.17.21 - mute-stream: 1.0.0 - ora: 5.4.1 - run-async: 3.0.0 - rxjs: 7.8.1 - string-width: 4.2.3 - strip-ansi: 6.0.1 - wrap-ansi: 6.2.0 - - irregular-plurals@3.5.0: {} - - is-extglob@2.1.1: {} - - is-fullwidth-code-point@3.0.0: {} - - is-fullwidth-code-point@4.0.0: {} - - is-glob@4.0.3: - dependencies: - is-extglob: 2.1.1 - - is-interactive@1.0.0: {} - - is-number@7.0.0: {} - - is-plain-object@5.0.0: {} - - is-promise@4.0.0: {} - - is-unicode-supported@0.1.0: {} - - is-unicode-supported@2.0.0: {} - - js-string-escape@1.0.1: {} - - js-tokens@4.0.0: {} - - js-yaml@3.14.1: - dependencies: - argparse: 1.0.10 - esprima: 4.0.1 - - js-yaml@4.1.0: - dependencies: - argparse: 2.0.1 - - load-json-file@7.0.1: {} - - lodash-es@4.17.21: {} - - lodash@4.17.21: {} - - log-symbols@4.1.0: - dependencies: - chalk: 4.1.2 - is-unicode-supported: 0.1.0 - - loose-envify@1.4.0: - dependencies: - js-tokens: 4.0.0 - - make-dir@3.1.0: - dependencies: - semver: 6.3.1 - - matcher@5.0.0: - dependencies: - escape-string-regexp: 5.0.0 - - md5-hex@3.0.1: - dependencies: - blueimp-md5: 2.19.0 - - memoize@10.0.0: - dependencies: - mimic-function: 5.0.1 - - merge2@1.4.1: {} - - micromatch@4.0.7: - dependencies: - braces: 3.0.3 - picomatch: 2.3.1 - - mime-db@1.52.0: {} - - mime-types@2.1.35: - dependencies: - mime-db: 1.52.0 - - mimic-fn@2.1.0: {} - - mimic-function@5.0.1: {} - - minimatch@3.1.2: - dependencies: - brace-expansion: 1.1.11 - - minipass@3.3.6: - dependencies: - yallist: 4.0.0 - - minipass@5.0.0: {} - - minizlib@2.1.2: - dependencies: - minipass: 3.3.6 - yallist: 4.0.0 - - mkdirp@1.0.4: {} - - ms@2.1.2: {} - - ms@2.1.3: {} - - mute-stream@1.0.0: {} - - nanoid@3.3.7: {} - - node-fetch@2.7.0: - dependencies: - whatwg-url: 5.0.0 - - node-gyp-build@4.8.1: {} - - nofilter@3.1.0: {} - - nopt@5.0.0: - dependencies: - abbrev: 1.1.1 - - npmlog@5.0.1: - dependencies: - are-we-there-yet: 2.0.0 - console-control-strings: 1.1.0 - gauge: 3.0.2 - set-blocking: 2.0.0 - - object-assign@4.1.1: {} - - once@1.4.0: - dependencies: - wrappy: 1.0.2 - - onetime@5.1.2: - dependencies: - mimic-fn: 2.1.0 - - ora@5.4.1: - dependencies: - bl: 4.1.0 - chalk: 4.1.2 - cli-cursor: 3.1.0 - cli-spinners: 2.9.2 - is-interactive: 1.0.0 - is-unicode-supported: 0.1.0 - log-symbols: 4.1.0 - strip-ansi: 6.0.1 - wcwidth: 1.0.1 - - os-tmpdir@1.0.2: {} - - p-map@7.0.2: {} - - package-config@5.0.0: - dependencies: - find-up-simple: 1.0.0 - load-json-file: 7.0.1 - - parse-ms@4.0.0: {} - - path-is-absolute@1.0.1: {} - - path-type@5.0.0: {} - - picocolors@1.0.1: {} - - picomatch@2.3.1: {} - - picomatch@3.0.1: {} - - plur@5.1.0: - dependencies: - irregular-plurals: 3.5.0 - - postcss-value-parser@4.2.0: {} - - postcss@8.4.33: - dependencies: - nanoid: 3.3.7 - picocolors: 1.0.1 - source-map-js: 1.2.0 - - pretty-ms@9.0.0: - dependencies: - parse-ms: 4.0.0 - - proxy-from-env@1.1.0: {} - - queue-microtask@1.2.3: {} - - react-dom@18.3.1(react@18.3.1): - dependencies: - loose-envify: 1.4.0 - react: 18.3.1 - scheduler: 0.23.2 - - react@18.3.1: - dependencies: - loose-envify: 1.4.0 - - readable-stream@3.6.2: - dependencies: - inherits: 2.0.4 - string_decoder: 1.3.0 - util-deprecate: 1.0.2 - - require-directory@2.1.1: {} - - resolve-cwd@3.0.0: - dependencies: - resolve-from: 5.0.0 - - resolve-from@5.0.0: {} - - restore-cursor@3.1.0: - dependencies: - onetime: 5.1.2 - signal-exit: 3.0.7 - - reusify@1.0.4: {} - - rimraf@3.0.2: - dependencies: - glob: 7.2.3 - - run-async@3.0.0: {} - - run-parallel@1.2.0: - dependencies: - queue-microtask: 1.2.3 - - rxjs@7.8.1: - dependencies: - tslib: 2.6.3 - - safe-buffer@5.2.1: {} - - safer-buffer@2.1.2: {} - - scheduler@0.23.2: - dependencies: - loose-envify: 1.4.0 - - semver@6.3.1: {} - - semver@7.6.2: {} - - serialize-error@7.0.1: - dependencies: - type-fest: 0.13.1 - - set-blocking@2.0.0: {} - - set-function-length@1.2.2: - 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 - - shallowequal@1.1.0: {} - - signal-exit@3.0.7: {} - - signal-exit@4.1.0: {} - - slash@5.1.0: {} - - slice-ansi@5.0.0: - dependencies: - ansi-styles: 6.2.1 - is-fullwidth-code-point: 4.0.0 - - source-map-js@1.2.0: {} - - sprintf-js@1.0.3: {} - - stack-utils@2.0.6: - dependencies: - escape-string-regexp: 2.0.0 - - string-width@4.2.3: - dependencies: - emoji-regex: 8.0.0 - is-fullwidth-code-point: 3.0.0 - strip-ansi: 6.0.1 - - string-width@7.1.0: - dependencies: - emoji-regex: 10.3.0 - get-east-asian-width: 1.2.0 - strip-ansi: 7.1.0 - - string_decoder@1.3.0: - dependencies: - safe-buffer: 5.2.1 - - strip-ansi@6.0.1: - dependencies: - ansi-regex: 5.0.1 - - strip-ansi@7.1.0: - dependencies: - ansi-regex: 6.0.1 - - styled-components@6.1.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1): - dependencies: - '@emotion/is-prop-valid': 1.2.2 - '@emotion/unitless': 0.8.1 - '@types/stylis': 4.2.6 - css-to-react-native: 3.2.0 - csstype: 3.1.3 - postcss: 8.4.33 - react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) - shallowequal: 1.1.0 - stylis: 4.3.2 - tslib: 2.6.3 - - stylis@4.3.2: {} - - supertap@3.0.1: - dependencies: - indent-string: 5.0.0 - js-yaml: 3.14.1 - serialize-error: 7.0.1 - strip-ansi: 7.1.0 - - supports-color@7.2.0: - dependencies: - has-flag: 4.0.0 - - tar@6.2.1: - dependencies: - chownr: 2.0.0 - fs-minipass: 2.1.0 - minipass: 5.0.0 - minizlib: 2.1.2 - mkdirp: 1.0.4 - yallist: 4.0.0 - - temp-dir@3.0.0: {} - - time-zone@1.0.0: {} - - tmp@0.0.33: - dependencies: - os-tmpdir: 1.0.2 - - to-regex-range@5.0.1: - dependencies: - is-number: 7.0.0 - - toml@3.0.0: {} - - tr46@0.0.3: {} - - tslib@2.6.3: {} - - typanion@3.14.0: {} - - type-fest@0.13.1: {} - - type-fest@0.21.3: {} - - typescript@5.4.5: {} - - undici-types@5.26.5: {} - - unicorn-magic@0.1.0: {} - - universal-user-agent@6.0.1: {} - - util-deprecate@1.0.2: {} - - wasm-sjlj@1.0.5: {} - - wcwidth@1.0.1: - dependencies: - defaults: 1.0.4 - - webidl-conversions@3.0.1: {} - - well-known-symbols@2.0.0: {} - - whatwg-url@5.0.0: - dependencies: - tr46: 0.0.3 - webidl-conversions: 3.0.1 - - wide-align@1.1.5: - dependencies: - string-width: 4.2.3 - - wrap-ansi@6.2.0: - dependencies: - ansi-styles: 4.3.0 - string-width: 4.2.3 - strip-ansi: 6.0.1 - - wrap-ansi@7.0.0: - dependencies: - ansi-styles: 4.3.0 - string-width: 4.2.3 - strip-ansi: 6.0.1 - - wrappy@1.0.2: {} - - write-file-atomic@5.0.1: - dependencies: - imurmurhash: 0.1.4 - signal-exit: 4.1.0 - - y18n@5.0.8: {} - - yallist@4.0.0: {} - - yargs-parser@21.1.1: {} - - yargs@17.7.2: - dependencies: - cliui: 8.0.1 - escalade: 3.1.2 - get-caller-file: 2.0.5 - require-directory: 2.1.1 - string-width: 4.2.3 - y18n: 5.0.8 - yargs-parser: 21.1.1 diff --git a/src/builtins.rs b/src/builtins.rs deleted file mode 100644 index 45a25117..00000000 --- a/src/builtins.rs +++ /dev/null @@ -1,71 +0,0 @@ -/// Node.js built-in modules -/// -/// `node -p "[...require('module').builtinModules].map(b => JSON.stringify(b)).join(',\n')"` -/// -pub const NODEJS_BUILTINS: &[&str] = &[ - "_http_agent", - "_http_client", - "_http_common", - "_http_incoming", - "_http_outgoing", - "_http_server", - "_stream_duplex", - "_stream_passthrough", - "_stream_readable", - "_stream_transform", - "_stream_wrap", - "_stream_writable", - "_tls_common", - "_tls_wrap", - "assert", - "assert/strict", - "async_hooks", - "buffer", - "child_process", - "cluster", - "console", - "constants", - "crypto", - "dgram", - "diagnostics_channel", - "dns", - "dns/promises", - "domain", - "events", - "fs", - "fs/promises", - "http", - "http2", - "https", - "inspector", - "module", - "net", - "os", - "path", - "path/posix", - "path/win32", - "perf_hooks", - "process", - "punycode", - "querystring", - "readline", - "repl", - "stream", - "stream/consumers", - "stream/promises", - "stream/web", - "string_decoder", - "sys", - "timers", - "timers/promises", - "tls", - "trace_events", - "tty", - "url", - "util", - "util/types", - "v8", - "vm", - "worker_threads", - "zlib", -]; diff --git a/src/cache.rs b/src/cache.rs deleted file mode 100644 index a1bde36c..00000000 --- a/src/cache.rs +++ /dev/null @@ -1,369 +0,0 @@ -use once_cell::sync::OnceCell as OnceLock; -use std::{ - borrow::{Borrow, Cow}, - convert::AsRef, - hash::{BuildHasherDefault, Hash, Hasher}, - io, - ops::Deref, - path::{Path, PathBuf}, - sync::Arc, -}; - -use dashmap::{DashMap, DashSet}; -use rustc_hash::FxHasher; - -use crate::{ - context::ResolveContext as Ctx, package_json::PackageJson, path::PathUtil, FileMetadata, - FileSystem, ResolveError, ResolveOptions, TsConfig, -}; - -#[derive(Default)] -pub struct Cache { - pub(crate) fs: Fs, - paths: DashSet>, - tsconfigs: DashMap, BuildHasherDefault>, -} - -impl Cache { - pub fn new(fs: Fs) -> Self { - Self { fs, paths: DashSet::default(), tsconfigs: DashMap::default() } - } - - pub fn clear(&self) { - self.paths.clear(); - self.tsconfigs.clear(); - } - - pub fn value(&self, path: &Path) -> CachedPath { - let hash = { - let mut hasher = FxHasher::default(); - path.hash(&mut hasher); - hasher.finish() - }; - if let Some(cache_entry) = self.paths.get((hash, path).borrow() as &dyn CacheKey) { - return cache_entry.clone(); - } - let parent = path.parent().map(|p| self.value(p)); - let data = CachedPath(Arc::new(CachedPathImpl::new( - hash, - path.to_path_buf().into_boxed_path(), - parent, - ))); - self.paths.insert(data.clone()); - data - } - - pub fn tsconfig Result<(), ResolveError>>( - &self, - root: bool, - path: &Path, - callback: F, // callback for modifying tsconfig with `extends` - ) -> Result, ResolveError> { - if let Some(tsconfig_ref) = self.tsconfigs.get(path) { - return Ok(Arc::clone(tsconfig_ref.value())); - } - let meta = self.fs.metadata(path).ok(); - let tsconfig_path = if meta.is_some_and(|m| m.is_file) { - Cow::Borrowed(path) - } else if meta.is_some_and(|m| m.is_dir) { - Cow::Owned(path.join("tsconfig.json")) - } else { - let mut os_string = path.to_path_buf().into_os_string(); - os_string.push(".json"); - Cow::Owned(PathBuf::from(os_string)) - }; - let mut tsconfig_string = self - .fs - .read_to_string(&tsconfig_path) - .map_err(|_| ResolveError::TsconfigNotFound(path.to_path_buf()))?; - let mut tsconfig = - TsConfig::parse(root, &tsconfig_path, &mut tsconfig_string).map_err(|error| { - ResolveError::from_serde_json_error(tsconfig_path.to_path_buf(), &error) - })?; - callback(&mut tsconfig)?; - let tsconfig = Arc::new(tsconfig.build()); - self.tsconfigs.insert(path.to_path_buf(), Arc::clone(&tsconfig)); - Ok(tsconfig) - } -} - -#[derive(Clone)] -pub struct CachedPath(Arc); - -impl Hash for CachedPath { - fn hash(&self, state: &mut H) { - self.0.hash.hash(state); - } -} - -impl PartialEq for CachedPath { - fn eq(&self, other: &Self) -> bool { - self.0.path == other.0.path - } -} -impl Eq for CachedPath {} - -impl Deref for CachedPath { - type Target = CachedPathImpl; - - fn deref(&self) -> &Self::Target { - self.0.as_ref() - } -} - -impl<'a> Borrow for CachedPath { - fn borrow(&self) -> &(dyn CacheKey + 'a) { - self - } -} - -impl AsRef for CachedPath { - fn as_ref(&self) -> &CachedPathImpl { - self.0.as_ref() - } -} - -impl CacheKey for CachedPath { - fn tuple(&self) -> (u64, &Path) { - (self.hash, &self.path) - } -} - -pub struct CachedPathImpl { - hash: u64, - path: Box, - parent: Option, - meta: OnceLock>, - symlink: OnceLock>, - canonicalized: OnceLock>, - node_modules: OnceLock>, - package_json: OnceLock>>, -} - -impl CachedPathImpl { - fn new(hash: u64, path: Box, parent: Option) -> Self { - Self { - hash, - path, - parent, - meta: OnceLock::new(), - symlink: OnceLock::new(), - canonicalized: OnceLock::new(), - node_modules: OnceLock::new(), - package_json: OnceLock::new(), - } - } - - pub fn path(&self) -> &Path { - &self.path - } - - pub fn to_path_buf(&self) -> PathBuf { - self.path.to_path_buf() - } - - pub fn parent(&self) -> Option<&CachedPath> { - self.parent.as_ref() - } - - fn meta(&self, fs: &Fs) -> Option { - *self.meta.get_or_init(|| fs.metadata(&self.path).ok()) - } - - pub fn is_file(&self, fs: &Fs, ctx: &mut Ctx) -> bool { - if let Some(meta) = self.meta(fs) { - ctx.add_file_dependency(self.path()); - meta.is_file - } else { - ctx.add_missing_dependency(self.path()); - false - } - } - - pub fn is_dir(&self, fs: &Fs, ctx: &mut Ctx) -> bool { - self.meta(fs).map_or_else( - || { - ctx.add_missing_dependency(self.path()); - false - }, - |meta| meta.is_dir, - ) - } - - fn symlink(&self, fs: &Fs) -> io::Result> { - self.symlink - .get_or_try_init(|| { - if let Ok(symlink_metadata) = fs.symlink_metadata(&self.path) { - if symlink_metadata.is_symlink { - return fs.canonicalize(self.path()).map(Some); - } - } - Ok(None) - }) - .cloned() - } - - pub fn realpath(&self, fs: &Fs) -> io::Result { - self.canonicalized - .get_or_try_init(|| { - if let Some(link) = self.symlink(fs)? { - return Ok(Some(link)); - } - if let Some(parent) = self.parent() { - let parent_path = parent.realpath(fs)?; - return Ok(Some( - parent_path.normalize_with(self.path.strip_prefix(&parent.path).unwrap()), - )); - }; - Ok(None) - }) - .cloned() - .map(|r| r.unwrap_or_else(|| self.path.clone().to_path_buf())) - } - - pub fn module_directory( - &self, - module_name: &str, - cache: &Cache, - ctx: &mut Ctx, - ) -> Option { - let cached_path = cache.value(&self.path.join(module_name)); - cached_path.is_dir(&cache.fs, ctx).then_some(cached_path) - } - - pub fn cached_node_modules( - &self, - cache: &Cache, - ctx: &mut Ctx, - ) -> Option { - self.node_modules.get_or_init(|| self.module_directory("node_modules", cache, ctx)).clone() - } - - /// Find package.json of a path by traversing parent directories. - /// - /// # Errors - /// - /// * [ResolveError::JSON] - pub fn find_package_json( - &self, - fs: &Fs, - options: &ResolveOptions, - ctx: &mut Ctx, - ) -> Result>, ResolveError> { - let mut cache_value = self; - // Go up directories when the querying path is not a directory - while !cache_value.is_dir(fs, ctx) { - if let Some(cv) = &cache_value.parent { - cache_value = cv.as_ref(); - } else { - break; - } - } - let mut cache_value = Some(cache_value); - while let Some(cv) = cache_value { - if let Some(package_json) = cv.package_json(fs, options, ctx)? { - return Ok(Some(Arc::clone(&package_json))); - } - cache_value = cv.parent.as_deref(); - } - Ok(None) - } - - /// Get package.json of the given path. - /// - /// # Errors - /// - /// * [ResolveError::JSON] - pub fn package_json( - &self, - fs: &Fs, - options: &ResolveOptions, - ctx: &mut Ctx, - ) -> Result>, ResolveError> { - // Change to `std::sync::OnceLock::get_or_try_init` when it is stable. - let result = self - .package_json - .get_or_try_init(|| { - let package_json_path = self.path.join("package.json"); - let Ok(package_json_string) = fs.read_to_string(&package_json_path) else { - return Ok(None); - }; - let real_path = if options.symlinks { - self.realpath(fs)?.join("package.json") - } else { - package_json_path.clone() - }; - PackageJson::parse(package_json_path.clone(), real_path, &package_json_string) - .map(Arc::new) - .map(Some) - .map_err(|error| ResolveError::from_serde_json_error(package_json_path, &error)) - }) - .cloned(); - // https://github.com/webpack/enhanced-resolve/blob/58464fc7cb56673c9aa849e68e6300239601e615/lib/DescriptionFileUtils.js#L68-L82 - match &result { - Ok(Some(package_json)) => { - ctx.add_file_dependency(&package_json.path); - } - Ok(None) => { - // Avoid an allocation by making this lazy - if let Some(deps) = &mut ctx.missing_dependencies { - deps.push(self.path.join("package.json")); - } - } - Err(_) => { - if let Some(deps) = &mut ctx.file_dependencies { - deps.push(self.path.join("package.json")); - } - } - } - result - } -} - -/// Memoized cache key, code adapted from . -trait CacheKey { - fn tuple(&self) -> (u64, &Path); -} - -impl Hash for dyn CacheKey + '_ { - fn hash(&self, state: &mut H) { - self.tuple().0.hash(state); - } -} - -impl PartialEq for dyn CacheKey + '_ { - fn eq(&self, other: &Self) -> bool { - self.tuple().1 == other.tuple().1 - } -} - -impl Eq for dyn CacheKey + '_ {} - -impl<'a> CacheKey for (u64, &'a Path) { - fn tuple(&self) -> (u64, &Path) { - (self.0, self.1) - } -} - -impl<'a> Borrow for (u64, &'a Path) { - fn borrow(&self) -> &(dyn CacheKey + 'a) { - self - } -} - -/// Since the cache key is memoized, use an identity hasher -/// to avoid double cache. -#[derive(Default)] -struct IdentityHasher(u64); - -impl Hasher for IdentityHasher { - fn write(&mut self, _: &[u8]) { - unreachable!("Invalid use of IdentityHasher") - } - fn write_u64(&mut self, n: u64) { - self.0 = n; - } - fn finish(&self) -> u64 { - self.0 - } -} diff --git a/src/context.rs b/src/context.rs deleted file mode 100644 index 9349de30..00000000 --- a/src/context.rs +++ /dev/null @@ -1,89 +0,0 @@ -use std::{ - ops::{Deref, DerefMut}, - path::{Path, PathBuf}, -}; - -use crate::error::ResolveError; - -#[derive(Debug, Default, Clone)] -pub struct ResolveContext(ResolveContextImpl); - -#[derive(Debug, Default, Clone)] -pub struct ResolveContextImpl { - pub fully_specified: bool, - - pub query: Option, - - pub fragment: Option, - - /// Files that was found on file system - pub file_dependencies: Option>, - - /// Files that was found on file system - pub missing_dependencies: Option>, - - /// The current resolving alias for bailing recursion alias. - pub resolving_alias: Option, - - /// For avoiding infinite recursion, which will cause stack overflow. - depth: u8, -} - -impl Deref for ResolveContext { - type Target = ResolveContextImpl; - - fn deref(&self) -> &Self::Target { - &self.0 - } -} - -impl DerefMut for ResolveContext { - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} - -impl ResolveContext { - pub fn with_fully_specified(&mut self, yes: bool) { - self.fully_specified = yes; - } - - pub fn with_query_fragment(&mut self, query: Option<&str>, fragment: Option<&str>) { - if let Some(query) = query { - self.query.replace(query.to_string()); - } - if let Some(fragment) = fragment { - self.fragment.replace(fragment.to_string()); - } - } - - pub fn init_file_dependencies(&mut self) { - self.file_dependencies.replace(vec![]); - self.missing_dependencies.replace(vec![]); - } - - pub fn add_file_dependency(&mut self, dep: &Path) { - if let Some(deps) = &mut self.file_dependencies { - deps.push(dep.to_path_buf()); - } - } - - pub fn add_missing_dependency(&mut self, dep: &Path) { - if let Some(deps) = &mut self.missing_dependencies { - deps.push(dep.to_path_buf()); - } - } - - pub fn with_resolving_alias(&mut self, alias: String) { - self.resolving_alias = Some(alias); - } - - pub fn test_for_infinite_recursion(&mut self) -> Result<(), ResolveError> { - self.depth += 1; - // 64 should be more than enough for detecting infinite recursion. - if self.depth > 64 { - return Err(ResolveError::Recursion); - } - Ok(()) - } -} diff --git a/src/error.rs b/src/error.rs deleted file mode 100644 index ff2aaa4f..00000000 --- a/src/error.rs +++ /dev/null @@ -1,160 +0,0 @@ -use std::{io, path::PathBuf, sync::Arc}; -use thiserror::Error; - -/// All resolution errors -/// -/// `thiserror` is used to display meaningful error messages. -#[derive(Debug, Clone, PartialEq, Error)] -pub enum ResolveError { - /// Ignored path - /// - /// Derived from ignored path (false value) from browser field in package.json - /// ```json - /// { - /// "browser": { - /// "./module": false - /// } - /// } - /// ``` - /// See - #[error("Path is ignored {0}")] - Ignored(PathBuf), - - /// Module not found - #[error("Cannot find module '{0}'")] - NotFound(/* specifier */ String), - - /// Tsconfig not found - #[error("Tsconfig not found {0}")] - TsconfigNotFound(PathBuf), - - #[error("{0}")] - IOError(IOError), - - /// Node.js builtin modules - /// - /// This is an error due to not being a Node.js runtime. - /// The `alias` option can be used to resolve a builtin module to a polyfill. - #[error("Builtin module {0}")] - Builtin(String), - - /// All of the aliased extension are not found - #[error("All of the aliased extension are not found")] - ExtensionAlias, - - /// The provided path specifier cannot be parsed - #[error("{0}")] - Specifier(SpecifierError), - - /// JSON parse error - #[error("{0:?}")] - JSON(JSONError), - - /// Restricted by `ResolveOptions::restrictions` - #[error(r#"Path "{0}" restricted by {0}"#)] - Restriction(PathBuf, PathBuf), - - #[error(r#"Invalid module "{0}" specifier is not a valid subpath for the "exports" resolution of {1}"#)] - InvalidModuleSpecifier(String, PathBuf), - - #[error(r#"Invalid "exports" target "{0}" defined for '{1}' in the package config {2}"#)] - InvalidPackageTarget(String, String, PathBuf), - - #[error(r#"Package subpath '{0}' is not defined by "exports" in {1}"#)] - PackagePathNotExported(String, PathBuf), - - #[error(r#"Invalid package config "{0}", "exports" cannot contain some keys starting with '.' and some not. The exports object must either be an object of package subpath keys or an object of main entry condition name keys only."#)] - InvalidPackageConfig(PathBuf), - - #[error(r#"Default condition should be last one in "{0}""#)] - InvalidPackageConfigDefault(PathBuf), - - #[error(r#"Expecting folder to folder mapping. "{0}" should end with "/"#)] - InvalidPackageConfigDirectory(PathBuf), - - #[error(r#"Package import specifier "{0}" is not defined in package {1}"#)] - PackageImportNotDefined(String, PathBuf), - - #[error("{0} is unimplemented")] - Unimplemented(&'static str), - - /// Occurs when alias paths reference each other. - #[error("Recursion in resolving")] - Recursion, -} - -impl ResolveError { - pub fn is_ignore(&self) -> bool { - matches!(self, Self::Ignored(_)) - } - - pub(crate) fn from_serde_json_error(path: PathBuf, error: &serde_json::Error) -> Self { - Self::JSON(JSONError { - path, - message: error.to_string(), - line: error.line(), - column: error.column(), - }) - } -} - -/// Error for [ResolveError::Specifier] -#[derive(Debug, Clone, Eq, PartialEq, Error)] -pub enum SpecifierError { - #[error("The specifiers must be a non-empty string. Received \"{0}\"")] - Empty(String), -} - -/// JSON error from [serde_json::Error] -#[derive(Debug, Clone, Eq, PartialEq)] -pub struct JSONError { - pub path: PathBuf, - pub message: String, - pub line: usize, - pub column: usize, -} - -#[derive(Debug, Clone, Error)] -#[error("{0}")] -pub struct IOError(Arc); - -impl PartialEq for IOError { - fn eq(&self, other: &Self) -> bool { - self.0.kind() == other.0.kind() - } -} - -impl From for io::Error { - fn from(error: IOError) -> Self { - let io_error = error.0.as_ref(); - Self::new(io_error.kind(), io_error.to_string()) - } -} - -impl From for ResolveError { - fn from(err: io::Error) -> Self { - Self::IOError(IOError(Arc::new(err))) - } -} - -#[test] -fn test_into_io_error() { - use std::io::{self, ErrorKind}; - let error_string = "IOError occurred"; - let string_error = io::Error::new(ErrorKind::Interrupted, error_string.to_string()); - let string_error2 = io::Error::new(ErrorKind::Interrupted, error_string.to_string()); - let resolve_io_error: ResolveError = ResolveError::from(string_error2); - - assert_eq!(resolve_io_error, ResolveError::from(string_error)); - assert_eq!(resolve_io_error.clone(), resolve_io_error); - if let ResolveError::IOError(io_error) = resolve_io_error { - // fix for https://github.com/web-infra-dev/rspack/issues/4564 - let std_io_error: io::Error = io_error.into(); - assert_eq!(std_io_error.kind(), ErrorKind::Interrupted); - assert_eq!(std_io_error.to_string(), error_string); - assert_eq!( - format!("{std_io_error:?}"), - r#"Custom { kind: Interrupted, error: "IOError occurred" }"# - ); - } -} diff --git a/src/file_system.rs b/src/file_system.rs deleted file mode 100644 index 04d177de..00000000 --- a/src/file_system.rs +++ /dev/null @@ -1,133 +0,0 @@ -use std::{ - fs, io, - path::{Path, PathBuf}, -}; - -/// File System abstraction used for `ResolverGeneric` -pub trait FileSystem: Send + Sync { - /// See [std::fs::read_to_string] - /// - /// # Errors - /// - /// * See [std::fs::read_to_string] - /// ## Warning - /// Use `&Path` instead of a generic `P: AsRef` here, - /// because object safety requirements, it is especially useful, when - /// you want to store multiple `dyn FileSystem` in a `Vec` or use a `ResolverGeneric` in - /// napi env. - fn read_to_string(&self, path: &Path) -> io::Result; - - /// See [std::fs::metadata] - /// - /// # Errors - /// See [std::fs::metadata] - /// ## Warning - /// Use `&Path` instead of a generic `P: AsRef` here, - /// because object safety requirements, it is especially useful, when - /// you want to store multiple `dyn FileSystem` in a `Vec` or use a `ResolverGeneric` in - /// napi env. - fn metadata(&self, path: &Path) -> io::Result; - - /// See [std::fs::symlink_metadata] - /// - /// # Errors - /// - /// See [std::fs::symlink_metadata] - /// ## Warning - /// Use `&Path` instead of a generic `P: AsRef` here, - /// because object safety requirements, it is especially useful, when - /// you want to store multiple `dyn FileSystem` in a `Vec` or use a `ResolverGeneric` in - /// napi env. - fn symlink_metadata(&self, path: &Path) -> io::Result; - - /// See [std::fs::canonicalize] - /// - /// # Errors - /// - /// See [std::fs::read_link] - /// ## Warning - /// Use `&Path` instead of a generic `P: AsRef` here, - /// because object safety requirements, it is especially useful, when - /// you want to store multiple `dyn FileSystem` in a `Vec` or use a `ResolverGeneric` in - /// napi env. - fn canonicalize(&self, path: &Path) -> io::Result; -} - -/// Metadata information about a file -#[derive(Debug, Clone, Copy)] -pub struct FileMetadata { - pub(crate) is_file: bool, - pub(crate) is_dir: bool, - pub(crate) is_symlink: bool, -} - -impl FileMetadata { - pub fn new(is_file: bool, is_dir: bool, is_symlink: bool) -> Self { - Self { is_file, is_dir, is_symlink } - } -} - -impl From for FileMetadata { - fn from(metadata: fs::Metadata) -> Self { - Self::new(metadata.is_file(), metadata.is_dir(), metadata.is_symlink()) - } -} - -/// Operating System -#[derive(Default)] -pub struct FileSystemOs; - -impl FileSystem for FileSystemOs { - fn read_to_string(&self, path: &Path) -> io::Result { - fs::read_to_string(path) - } - - fn metadata(&self, path: &Path) -> io::Result { - fs::metadata(path).map(FileMetadata::from) - } - - fn symlink_metadata(&self, path: &Path) -> io::Result { - fs::symlink_metadata(path).map(FileMetadata::from) - } - - fn canonicalize(&self, path: &Path) -> io::Result { - #[cfg(not(target_os = "wasi"))] - { - dunce::canonicalize(path) - } - #[cfg(target_os = "wasi")] - { - let meta = fs::symlink_metadata(path)?; - if meta.file_type().is_symlink() { - let link = fs::read_link(path)?; - let mut path_buf = path.to_path_buf(); - path_buf.pop(); - for segment in link.iter() { - match segment.to_str() { - Some("..") => { - path_buf.pop(); - } - Some(".") | None => {} - Some(seg) => { - // Need to trim the extra \0 introduces by rust std rust-lang/rust#123727 - path_buf.push(seg.trim_end_matches('\0')); - } - } - } - Ok(path_buf) - } else { - Ok(path.to_path_buf()) - } - } - } -} - -#[test] -fn metadata() { - let meta = FileMetadata { is_file: true, is_dir: true, is_symlink: true }; - assert_eq!( - format!("{meta:?}"), - "FileMetadata { is_file: true, is_dir: true, is_symlink: true }" - ); - let _ = meta; -} diff --git a/src/lib.rs b/src/lib.rs deleted file mode 100644 index 8ec2ad8a..00000000 --- a/src/lib.rs +++ /dev/null @@ -1,1670 +0,0 @@ -//! # Oxc Resolver -//! -//! Node.js [CommonJS][cjs] and [ECMAScript][esm] Module Resolution. -//! -//! A module resolution is the process of finding the file referenced by a module specifier in -//! `import "specifier"` or `require("specifier")`. -//! -//! All [configuration options](ResolveOptions) are aligned with webpack's [enhanced-resolve]. -//! -//! ## Terminology -//! -//! ### Specifier -//! -//! For [CommonJS modules][cjs], -//! the specifier is the string passed to the `require` function. e.g. `"id"` in `require("id")`. -//! -//! For [ECMAScript modules][esm], -//! the specifier of an `import` statement is the string after the `from` keyword, -//! e.g. `'specifier'` in `import 'specifier'` or `import { sep } from 'specifier'`. -//! Specifiers are also used in export from statements, and as the argument to an `import()` expression. -//! -//! This is also named "request" in some places. -//! -//! ## References: -//! -//! * Algorithm adapted from Node.js [CommonJS Module Resolution Algorithm] and [ECMAScript Module Resolution Algorithm]. -//! * Tests are ported from [enhanced-resolve]. -//! * Some code is adapted from [parcel-resolver]. -//! * The documentation is copied from [webpack's resolve configuration](https://webpack.js.org/configuration/resolve). -//! -//! [enhanced-resolve]: https://github.com/webpack/enhanced-resolve -//! [CommonJS Module Resolution Algorithm]: https://nodejs.org/api/modules.html#all-together -//! [ECMAScript Module Resolution Algorithm]: https://nodejs.org/api/esm.html#resolution-algorithm-specification -//! [parcel-resolver]: https://github.com/parcel-bundler/parcel/blob/v2/packages/utils/node-resolver-rs -//! [cjs]: https://nodejs.org/api/modules.html -//! [esm]: https://nodejs.org/api/esm.html -//! -//! ## Feature flags -#![cfg_attr(feature = "document-features", doc = document_features::document_features!())] -#![cfg_attr(docsrs, feature(doc_auto_cfg))] -//! -//! ## Example -//! -//! ```rust,ignore -#![doc = include_str!("../examples/resolver.rs")] -//! ``` - -mod builtins; -mod cache; -mod context; -mod error; -mod file_system; -mod options; -mod package_json; -mod path; -mod resolution; -mod specifier; -mod tsconfig; - -#[cfg(test)] -mod tests; - -use std::{ - borrow::Cow, - cmp::Ordering, - ffi::OsStr, - fmt, - path::{Component, Path, PathBuf}, - sync::Arc, -}; - -use rustc_hash::FxHashSet; -use serde_json::Value as JSONValue; -use typescript_tsconfig_json::ExtendsField; - -pub use crate::{ - builtins::NODEJS_BUILTINS, - error::{JSONError, ResolveError, SpecifierError}, - file_system::{FileMetadata, FileSystem}, - options::{ - Alias, AliasValue, EnforceExtension, ResolveOptions, Restriction, TsconfigOptions, - TsconfigReferences, - }, - package_json::PackageJson, - resolution::Resolution, -}; -use crate::{ - cache::{Cache, CachedPath}, - context::ResolveContext as Ctx, - file_system::FileSystemOs, - package_json::JSONMap, - path::{PathUtil, SLASH_START}, - specifier::Specifier, - tsconfig::{ProjectReference, TsConfig}, -}; - -type ResolveResult = Result, ResolveError>; - -/// Context returned from the [Resolver::resolve_with_context] API -#[derive(Debug, Default, Clone)] -pub struct ResolveContext { - /// Files that was found on file system - pub file_dependencies: FxHashSet, - - /// Dependencies that was not found on file system - pub missing_dependencies: FxHashSet, -} - -/// Resolver with the current operating system as the file system -pub type Resolver = ResolverGeneric; - -/// Generic implementation of the resolver, can be configured by the [FileSystem] trait -pub struct ResolverGeneric { - options: ResolveOptions, - cache: Arc>, -} - -impl fmt::Debug for ResolverGeneric { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - self.options.fmt(f) - } -} - -impl Default for ResolverGeneric { - fn default() -> Self { - Self::new(ResolveOptions::default()) - } -} - -impl ResolverGeneric { - pub fn new(options: ResolveOptions) -> Self { - Self { options: options.sanitize(), cache: Arc::new(Cache::new(Fs::default())) } - } -} - -impl ResolverGeneric { - pub fn new_with_file_system(file_system: Fs, options: ResolveOptions) -> Self { - Self { cache: Arc::new(Cache::new(file_system)), options: options.sanitize() } - } - - /// Clone the resolver using the same underlying cache. - #[must_use] - pub fn clone_with_options(&self, options: ResolveOptions) -> Self { - Self { options: options.sanitize(), cache: Arc::clone(&self.cache) } - } - - /// Returns the options. - pub fn options(&self) -> &ResolveOptions { - &self.options - } - - /// Clear the underlying cache. - pub fn clear_cache(&self) { - self.cache.clear(); - } - - /// Resolve `specifier` at an absolute `path`. - /// - /// A specifier is the string passed to require or import, i.e. `require("specifier")` or `import "specifier"`. - /// - /// `path` must be an **absolute** path to a directory where the specifier is resolved against. - /// For CommonJS modules, it is the `__dirname` variable that contains the absolute path to the folder containing current module. - /// For ECMAScript modules, it is the value of `import.meta.url`. - /// - /// # Errors - /// - /// * See [ResolveError] - pub fn resolve>( - &self, - path: P, - specifier: &str, - ) -> Result { - let mut ctx = Ctx::default(); - self.resolve_tracing(path.as_ref(), specifier, &mut ctx) - } - - /// Resolve `specifier` at absolute `path` with [ResolveContext] - /// - /// # Errors - /// - /// * See [ResolveError] - pub fn resolve_with_context>( - &self, - path: P, - specifier: &str, - resolve_context: &mut ResolveContext, - ) -> Result { - let mut ctx = Ctx::default(); - ctx.init_file_dependencies(); - let result = self.resolve_tracing(path.as_ref(), specifier, &mut ctx); - if let Some(deps) = &mut ctx.file_dependencies { - resolve_context.file_dependencies.extend(deps.drain(..)); - } - if let Some(deps) = &mut ctx.missing_dependencies { - resolve_context.missing_dependencies.extend(deps.drain(..)); - } - result - } - - /// Wrap `resolve_impl` with `tracing` information - fn resolve_tracing( - &self, - path: &Path, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - let span = tracing::debug_span!("resolve", path = ?path, specifier = specifier); - let _enter = span.enter(); - let r = self.resolve_impl(path, specifier, ctx); - match &r { - Ok(r) => { - tracing::debug!(options = ?self.options, path = ?path, specifier = specifier, ret = ?r.path); - } - Err(err) => { - tracing::debug!(options = ?self.options, path = ?path, specifier = specifier, err = ?err); - } - }; - r - } - - fn resolve_impl( - &self, - path: &Path, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - ctx.with_fully_specified(self.options.fully_specified); - let cached_path = self.cache.value(path); - let cached_path = self.require(&cached_path, specifier, ctx)?; - let path = self.load_realpath(&cached_path)?; - // enhanced-resolve: restrictions - self.check_restrictions(&path)?; - let package_json = cached_path.find_package_json(&self.cache.fs, &self.options, ctx)?; - if let Some(package_json) = &package_json { - // path must be inside the package. - debug_assert!(path.starts_with(package_json.directory())); - } - Ok(Resolution { - path, - query: ctx.query.take(), - fragment: ctx.fragment.take(), - package_json, - }) - } - - /// require(X) from module at path Y - /// - /// X: specifier - /// Y: path - /// - /// - fn require( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - ctx.test_for_infinite_recursion()?; - - // enhanced-resolve: parse - let (parsed, try_fragment_as_path) = self.load_parse(cached_path, specifier, ctx)?; - if let Some(path) = try_fragment_as_path { - return Ok(path); - } - - self.require_without_parse(cached_path, parsed.path(), ctx) - } - - fn require_without_parse( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - // tsconfig-paths - if let Some(path) = self.load_tsconfig_paths(cached_path, specifier, &mut Ctx::default())? { - return Ok(path); - } - - // enhanced-resolve: try alias - if let Some(path) = self.load_alias(cached_path, specifier, &self.options.alias, ctx)? { - return Ok(path); - } - - let result = match Path::new(specifier).components().next() { - // 2. If X begins with '/' - Some(Component::RootDir | Component::Prefix(_)) => { - self.require_absolute(cached_path, specifier, ctx) - } - // 3. If X begins with './' or '/' or '../' - Some(Component::CurDir | Component::ParentDir) => { - self.require_relative(cached_path, specifier, ctx) - } - // 4. If X begins with '#' - Some(Component::Normal(_)) if specifier.as_bytes()[0] == b'#' => { - self.require_hash(cached_path, specifier, ctx) - } - _ => { - // 1. If X is a core module, - // a. return the core module - // b. STOP - self.require_core(specifier)?; - - // (ESM) 5. Otherwise, - // Note: specifier is now a bare specifier. - // Set resolved the result of PACKAGE_RESOLVE(specifier, parentURL). - self.require_bare(cached_path, specifier, ctx) - } - }; - - result.or_else(|err| { - if err.is_ignore() { - return Err(err); - } - // enhanced-resolve: try fallback - self.load_alias(cached_path, specifier, &self.options.fallback, ctx) - .and_then(|value| value.ok_or(err)) - }) - } - - // PACKAGE_RESOLVE(packageSpecifier, parentURL) - // 3. If packageSpecifier is a Node.js builtin module name, then - // 1. Return the string "node:" concatenated with packageSpecifier. - fn require_core(&self, specifier: &str) -> Result<(), ResolveError> { - if self.options.builtin_modules { - let starts_with_node = specifier.starts_with("node:"); - if starts_with_node || NODEJS_BUILTINS.binary_search(&specifier).is_ok() { - let mut specifier = specifier.to_string(); - if !starts_with_node { - specifier = format!("node:{specifier}"); - } - return Err(ResolveError::Builtin(specifier)); - } - } - Ok(()) - } - - fn require_absolute( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - // Make sure only path prefixes gets called - debug_assert!(Path::new(specifier) - .components() - .next() - .is_some_and(|c| matches!(c, Component::RootDir | Component::Prefix(_)))); - if !self.options.prefer_relative && self.options.prefer_absolute { - if let Ok(path) = self.load_package_self_or_node_modules(cached_path, specifier, ctx) { - return Ok(path); - } - } - if let Some(path) = self.load_roots(specifier, ctx) { - return Ok(path); - } - // 2. If X begins with '/' - // a. set Y to be the file system root - let path = self.cache.value(Path::new(specifier)); - if let Some(path) = self.load_as_file_or_directory(&path, specifier, ctx)? { - return Ok(path); - } - Err(ResolveError::NotFound(specifier.to_string())) - } - - // 3. If X begins with './' or '/' or '../' - fn require_relative( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - // Make sure only relative or normal paths gets called - debug_assert!(Path::new(specifier).components().next().is_some_and(|c| matches!( - c, - Component::CurDir | Component::ParentDir | Component::Normal(_) - ))); - let path = cached_path.path().normalize_with(specifier); - let cached_path = self.cache.value(&path); - // a. LOAD_AS_FILE(Y + X) - // b. LOAD_AS_DIRECTORY(Y + X) - if let Some(path) = self.load_as_file_or_directory(&cached_path, specifier, ctx)? { - return Ok(path); - } - // c. THROW "not found" - Err(ResolveError::NotFound(specifier.to_string())) - } - - fn require_hash( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - debug_assert_eq!(specifier.chars().next(), Some('#')); - // a. LOAD_PACKAGE_IMPORTS(X, dirname(Y)) - if let Some(path) = self.load_package_imports(cached_path, specifier, ctx)? { - return Ok(path); - } - self.load_package_self_or_node_modules(cached_path, specifier, ctx) - } - - fn require_bare( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - // Make sure no other path prefixes gets called - debug_assert!(Path::new(specifier) - .components() - .next() - .is_some_and(|c| matches!(c, Component::Normal(_)))); - if self.options.prefer_relative { - if let Ok(path) = self.require_relative(cached_path, specifier, ctx) { - return Ok(path); - } - } - self.load_package_self_or_node_modules(cached_path, specifier, ctx) - } - - /// enhanced-resolve: ParsePlugin. - /// - /// 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`. - /// - /// - fn load_parse<'s>( - &self, - cached_path: &CachedPath, - specifier: &'s str, - ctx: &mut Ctx, - ) -> Result<(Specifier<'s>, Option), ResolveError> { - let parsed = Specifier::parse(specifier).map_err(ResolveError::Specifier)?; - ctx.with_query_fragment(parsed.query, parsed.fragment); - - // There is an edge-case where a request with # can be a path or a fragment -> try both - if ctx.fragment.is_some() && ctx.query.is_none() { - let specifier = parsed.path(); - let fragment = ctx.fragment.take().unwrap(); - let path = format!("{specifier}{fragment}"); - if let Ok(path) = self.require_without_parse(cached_path, &path, ctx) { - return Ok((parsed, Some(path))); - } - ctx.fragment.replace(fragment); - } - Ok((parsed, None)) - } - - fn load_package_self_or_node_modules( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - let (_, subpath) = Self::parse_package_specifier(specifier); - if subpath.is_empty() { - ctx.with_fully_specified(false); - } - // 5. LOAD_PACKAGE_SELF(X, dirname(Y)) - if let Some(path) = self.load_package_self(cached_path, specifier, ctx)? { - return Ok(path); - } - // 6. LOAD_NODE_MODULES(X, dirname(Y)) - if let Some(path) = self.load_node_modules(cached_path, specifier, ctx)? { - return Ok(path); - } - // 7. THROW "not found" - Err(ResolveError::NotFound(specifier.to_string())) - } - - /// LOAD_PACKAGE_IMPORTS(X, DIR) - fn load_package_imports( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - // 1. Find the closest package scope SCOPE to DIR. - // 2. If no scope was found, return. - let Some(package_json) = - cached_path.find_package_json(&self.cache.fs, &self.options, ctx)? - else { - return Ok(None); - }; - // 3. If the SCOPE/package.json "imports" is null or undefined, return. - // 4. let MATCH = PACKAGE_IMPORTS_RESOLVE(X, pathToFileURL(SCOPE), ["node", "require"]) defined in the ESM resolver. - if let Some(path) = self.package_imports_resolve(specifier, &package_json, ctx)? { - // 5. RESOLVE_ESM_MATCH(MATCH). - return self.resolve_esm_match(specifier, &path, ctx); - } - Ok(None) - } - - fn load_as_file(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - // enhanced-resolve feature: extension_alias - if let Some(path) = self.load_extension_alias(cached_path, ctx)? { - return Ok(Some(path)); - } - if self.options.enforce_extension.is_disabled() { - // 1. If X is a file, load X as its file extension format. STOP - if let Some(path) = self.load_alias_or_file(cached_path, ctx)? { - return Ok(Some(path)); - } - } - // 2. If X.js is a file, load X.js as JavaScript text. STOP - // 3. If X.json is a file, parse X.json to a JavaScript Object. STOP - // 4. If X.node is a file, load X.node as binary addon. STOP - if let Some(path) = - self.load_extensions(cached_path.path(), &self.options.extensions, ctx)? - { - return Ok(Some(path)); - } - Ok(None) - } - - fn load_as_directory(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - // TODO: Only package.json is supported, so warn about having other values - // Checking for empty files is needed for omitting checks on package.json - // 1. If X/package.json is a file, - if !self.options.description_files.is_empty() { - // a. Parse X/package.json, and look for "main" field. - if let Some(package_json) = - cached_path.package_json(&self.cache.fs, &self.options, ctx)? - { - // b. If "main" is a falsy value, GOTO 2. - for main_field in package_json.main_fields(&self.options.main_fields) { - // c. let M = X + (json main field) - let main_field_path = cached_path.path().normalize_with(main_field); - // d. LOAD_AS_FILE(M) - let cached_path = self.cache.value(&main_field_path); - if let Some(path) = self.load_as_file(&cached_path, ctx)? { - return Ok(Some(path)); - } - // e. LOAD_INDEX(M) - if let Some(path) = self.load_index(&cached_path, ctx)? { - return Ok(Some(path)); - } - } - // f. LOAD_INDEX(X) DEPRECATED - // g. THROW "not found" - } - } - // 2. LOAD_INDEX(X) - self.load_index(cached_path, ctx) - } - - fn load_as_file_or_directory( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - if self.options.resolve_to_context { - return Ok(cached_path.is_dir(&self.cache.fs, ctx).then(|| cached_path.clone())); - } - if !specifier.ends_with('/') { - if let Some(path) = self.load_as_file(cached_path, ctx)? { - return Ok(Some(path)); - } - } - if cached_path.is_dir(&self.cache.fs, ctx) { - if let Some(path) = self.load_as_directory(cached_path, ctx)? { - return Ok(Some(path)); - } - } - Ok(None) - } - - fn load_extensions(&self, path: &Path, extensions: &[String], ctx: &mut Ctx) -> ResolveResult { - if ctx.fully_specified { - return Ok(None); - } - let path = path.as_os_str(); - for extension in extensions { - let mut path_with_extension = path.to_os_string(); - path_with_extension.reserve_exact(extension.len()); - path_with_extension.push(extension); - let cached_path = self.cache.value(Path::new(&path_with_extension)); - if let Some(path) = self.load_alias_or_file(&cached_path, ctx)? { - return Ok(Some(path)); - } - } - Ok(None) - } - - fn load_realpath(&self, cached_path: &CachedPath) -> Result { - if self.options.symlinks { - cached_path.realpath(&self.cache.fs).map_err(ResolveError::from) - } else { - Ok(cached_path.to_path_buf()) - } - } - - fn check_restrictions(&self, path: &Path) -> Result<(), ResolveError> { - // https://github.com/webpack/enhanced-resolve/blob/a998c7d218b7a9ec2461fc4fddd1ad5dd7687485/lib/RestrictionsPlugin.js#L19-L24 - fn is_inside(path: &Path, parent: &Path) -> bool { - if !path.starts_with(parent) { - return false; - } - if path.as_os_str().len() == parent.as_os_str().len() { - return true; - } - path.strip_prefix(parent).is_ok_and(|p| p == Path::new("./")) - } - for restriction in &self.options.restrictions { - match restriction { - Restriction::Path(restricted_path) => { - if !is_inside(path, restricted_path) { - return Err(ResolveError::Restriction( - path.to_path_buf(), - restricted_path.clone(), - )); - } - } - Restriction::RegExp(_) => { - return Err(ResolveError::Unimplemented("Restriction with regex")) - } - } - } - Ok(()) - } - - fn load_index(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - for main_file in &self.options.main_files { - let main_path = cached_path.path().normalize_with(main_file); - let cached_path = self.cache.value(&main_path); - if self.options.enforce_extension.is_disabled() { - if let Some(path) = self.load_alias_or_file(&cached_path, ctx)? { - return Ok(Some(path)); - } - } - // 1. If X/index.js is a file, load X/index.js as JavaScript text. STOP - // 2. If X/index.json is a file, parse X/index.json to a JavaScript object. STOP - // 3. If X/index.node is a file, load X/index.node as binary addon. STOP - if let Some(path) = - self.load_extensions(cached_path.path(), &self.options.extensions, ctx)? - { - return Ok(Some(path)); - } - } - Ok(None) - } - - fn load_alias_or_file(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - if let Some(package_json) = - cached_path.find_package_json(&self.cache.fs, &self.options, ctx)? - { - if let Some(path) = self.load_browser_field(cached_path, None, &package_json, ctx)? { - return Ok(Some(path)); - } - } - // enhanced-resolve: try file as alias - let alias_specifier = cached_path.path().to_string_lossy(); - if let Some(path) = - self.load_alias(cached_path, &alias_specifier, &self.options.alias, ctx)? - { - return Ok(Some(path)); - } - if cached_path.is_file(&self.cache.fs, ctx) { - return Ok(Some(cached_path.clone())); - } - Ok(None) - } - - fn load_node_modules( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - let (package_name, subpath) = Self::parse_package_specifier(specifier); - // 1. let DIRS = NODE_MODULES_PATHS(START) - // 2. for each DIR in DIRS: - for module_name in &self.options.modules { - for cached_path in std::iter::successors(Some(cached_path), |p| p.parent()) { - // Skip if /path/to/node_modules does not exist - if !cached_path.is_dir(&self.cache.fs, ctx) { - continue; - } - - let Some(cached_path) = self.get_module_directory(cached_path, module_name, ctx) - else { - continue; - }; - // Optimize node_modules lookup by inspecting whether the package exists - // From LOAD_PACKAGE_EXPORTS(X, DIR) - // 1. Try to interpret X as a combination of NAME and SUBPATH where the name - // may have a @scope/ prefix and the subpath begins with a slash (`/`). - if !package_name.is_empty() { - let package_path = cached_path.path().normalize_with(package_name); - let cached_path = self.cache.value(&package_path); - // Try foo/node_modules/package_name - if cached_path.is_dir(&self.cache.fs, ctx) { - // a. LOAD_PACKAGE_EXPORTS(X, DIR) - if let Some(path) = - self.load_package_exports(specifier, subpath, &cached_path, ctx)? - { - return Ok(Some(path)); - } - } else { - // foo/node_modules/package_name is not a directory, so useless to check inside it - if !subpath.is_empty() { - continue; - } - // Skip if the directory lead to the scope package does not exist - // i.e. `foo/node_modules/@scope` is not a directory for `foo/node_modules/@scope/package` - if package_name.starts_with('@') { - if let Some(path) = cached_path.parent() { - if !path.is_dir(&self.cache.fs, ctx) { - continue; - } - } - } - } - } - - // Try as file or directory for all other cases - // b. LOAD_AS_FILE(DIR/X) - // c. LOAD_AS_DIRECTORY(DIR/X) - let node_module_file = cached_path.path().normalize_with(specifier); - let cached_path = self.cache.value(&node_module_file); - if let Some(path) = self.load_as_file_or_directory(&cached_path, specifier, ctx)? { - return Ok(Some(path)); - } - } - } - Ok(None) - } - - fn get_module_directory( - &self, - cached_path: &CachedPath, - module_name: &str, - ctx: &mut Ctx, - ) -> Option { - if cached_path.path().ends_with(module_name) { - Some(cached_path.clone()) - } else if module_name == "node_modules" { - cached_path.cached_node_modules(&self.cache, ctx) - } else { - cached_path.module_directory(module_name, &self.cache, ctx) - } - } - - fn load_package_exports( - &self, - specifier: &str, - subpath: &str, - cached_path: &CachedPath, - ctx: &mut Ctx, - ) -> ResolveResult { - // 2. If X does not match this pattern or DIR/NAME/package.json is not a file, - // return. - let Some(package_json) = cached_path.package_json(&self.cache.fs, &self.options, ctx)? - else { - return Ok(None); - }; - // 3. Parse DIR/NAME/package.json, and look for "exports" field. - // 4. If "exports" is null or undefined, return. - // 5. let MATCH = PACKAGE_EXPORTS_RESOLVE(pathToFileURL(DIR/NAME), "." + SUBPATH, - // `package.json` "exports", ["node", "require"]) defined in the ESM resolver. - // Note: The subpath is not prepended with a dot on purpose - for exports in package_json.exports_fields(&self.options.exports_fields) { - if let Some(path) = self.package_exports_resolve( - cached_path.path(), - &format!(".{subpath}"), - exports, - ctx, - )? { - // 6. RESOLVE_ESM_MATCH(MATCH) - return self.resolve_esm_match(specifier, &path, ctx); - }; - } - Ok(None) - } - - fn load_package_self( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - // 1. Find the closest package scope SCOPE to DIR. - // 2. If no scope was found, return. - let Some(package_json) = - cached_path.find_package_json(&self.cache.fs, &self.options, ctx)? - else { - return Ok(None); - }; - // 3. If the SCOPE/package.json "exports" is null or undefined, return. - // 4. If the SCOPE/package.json "name" is not the first segment of X, return. - if let Some(subpath) = package_json - .name - .as_ref() - .and_then(|package_name| Self::strip_package_name(specifier, package_name)) - { - // 5. let MATCH = PACKAGE_EXPORTS_RESOLVE(pathToFileURL(SCOPE), - // "." + X.slice("name".length), `package.json` "exports", ["node", "require"]) - // defined in the ESM resolver. - let package_url = package_json.directory(); - // Note: The subpath is not prepended with a dot on purpose - // because `package_exports_resolve` matches subpath without the leading dot. - for exports in package_json.exports_fields(&self.options.exports_fields) { - if let Some(cached_path) = - self.package_exports_resolve(package_url, &format!(".{subpath}"), exports, ctx)? - { - // 6. RESOLVE_ESM_MATCH(MATCH) - return self.resolve_esm_match(specifier, &cached_path, ctx); - } - } - } - self.load_browser_field(cached_path, Some(specifier), &package_json, ctx) - } - - /// RESOLVE_ESM_MATCH(MATCH) - fn resolve_esm_match( - &self, - specifier: &str, - cached_path: &CachedPath, - ctx: &mut Ctx, - ) -> ResolveResult { - // 1. let RESOLVED_PATH = fileURLToPath(MATCH) - // 2. If the file at RESOLVED_PATH exists, load RESOLVED_PATH as its extension format. STOP - // - // Non-compliant ESM can result in a directory, so directory is tried as well. - if let Some(path) = self.load_as_file_or_directory(cached_path, "", ctx)? { - return Ok(Some(path)); - } - // 3. THROW "not found" - Err(ResolveError::NotFound(specifier.to_string())) - } - - /// enhanced-resolve: AliasFieldPlugin for [ResolveOptions::alias_fields] - fn load_browser_field( - &self, - cached_path: &CachedPath, - module_specifier: Option<&str>, - package_json: &PackageJson, - ctx: &mut Ctx, - ) -> ResolveResult { - let path = cached_path.path(); - let Some(new_specifier) = package_json.resolve_browser_field( - path, - module_specifier, - &self.options.alias_fields, - )? - else { - return Ok(None); - }; - // Abort when resolving recursive module - if module_specifier.is_some_and(|s| s == new_specifier) { - return Ok(None); - } - if ctx.resolving_alias.as_ref().is_some_and(|s| s == new_specifier) { - // Complete when resolving to self `{"./a.js": "./a.js"}` - if new_specifier.strip_prefix("./").filter(|s| path.ends_with(Path::new(s))).is_some() { - return if cached_path.is_file(&self.cache.fs, ctx) { - Ok(Some(cached_path.clone())) - } else { - Err(ResolveError::NotFound(new_specifier.to_string())) - }; - } - return Err(ResolveError::Recursion); - } - ctx.with_resolving_alias(new_specifier.to_string()); - ctx.with_fully_specified(false); - let cached_path = self.cache.value(package_json.directory()); - self.require(&cached_path, new_specifier, ctx).map(Some) - } - - /// enhanced-resolve: AliasPlugin for [ResolveOptions::alias] and [ResolveOptions::fallback]. - fn load_alias( - &self, - cached_path: &CachedPath, - specifier: &str, - aliases: &Alias, - ctx: &mut Ctx, - ) -> ResolveResult { - for (alias_key_raw, specifiers) in aliases { - let alias_key = if let Some(alias_key) = alias_key_raw.strip_suffix('$') { - if alias_key != specifier { - continue; - } - alias_key - } else { - let strip_package_name = Self::strip_package_name(specifier, alias_key_raw); - if strip_package_name.is_none() { - continue; - } - alias_key_raw - }; - // It should stop resolving when all of the tried alias values - // failed to resolve. - // - let mut should_stop = false; - for r in specifiers { - match r { - AliasValue::Path(alias_value) => { - if let Some(path) = self.load_alias_value( - cached_path, - alias_key, - alias_value, - specifier, - ctx, - &mut should_stop, - )? { - return Ok(Some(path)); - } - } - AliasValue::Ignore => { - let path = cached_path.path().normalize_with(alias_key); - return Err(ResolveError::Ignored(path)); - } - } - } - if should_stop { - return Err(ResolveError::NotFound(specifier.to_string())); - } - } - Ok(None) - } - - fn load_alias_value( - &self, - cached_path: &CachedPath, - alias_key: &str, - alias_value: &str, - request: &str, - ctx: &mut Ctx, - should_stop: &mut bool, - ) -> ResolveResult { - if request != alias_value - && !request.strip_prefix(alias_value).is_some_and(|prefix| prefix.starts_with('/')) - { - let tail = &request[alias_key.len()..]; - - let new_specifier = if tail.is_empty() { - Cow::Borrowed(alias_value) - } else { - let alias_value = Path::new(alias_value).normalize(); - // Must not append anything to alias_value if it is a file. - let alias_value_cached_path = self.cache.value(&alias_value); - if alias_value_cached_path.is_file(&self.cache.fs, ctx) { - return Ok(None); - } - - // Remove the leading slash so the final path is concatenated. - let tail = tail.trim_start_matches(SLASH_START); - let normalized = alias_value.normalize_with(tail); - Cow::Owned(normalized.to_string_lossy().to_string()) - }; - - *should_stop = true; - ctx.with_fully_specified(false); - return match self.require(cached_path, new_specifier.as_ref(), ctx) { - Err(ResolveError::NotFound(_)) => Ok(None), - Ok(path) => return Ok(Some(path)), - Err(err) => return Err(err), - }; - } - Ok(None) - } - - /// Given an extension alias map `{".js": [".ts", "js"]}`, - /// load the mapping instead of the provided extension - /// - /// This is an enhanced-resolve feature - /// - /// # Errors - /// - /// * [ResolveError::ExtensionAlias]: When all of the aliased extensions are not found - fn load_extension_alias(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - let Some(path_extension) = cached_path.path().extension() else { - return Ok(None); - }; - let Some((_, extensions)) = self - .options - .extension_alias - .iter() - .find(|(ext, _)| OsStr::new(ext.trim_start_matches('.')) == path_extension) - else { - return Ok(None); - }; - let path = cached_path.path().with_extension(""); - ctx.with_fully_specified(false); - if let Some(path) = self.load_extensions(&path, extensions, ctx)? { - return Ok(Some(path)); - } - Err(ResolveError::ExtensionAlias) - } - - /// enhanced-resolve: RootsPlugin - /// - /// A list of directories where requests of server-relative URLs (starting with '/') are resolved, - /// defaults to context configuration option. - /// - /// On non-Windows systems these requests are resolved as an absolute path first. - fn load_roots(&self, specifier: &str, ctx: &mut Ctx) -> Option { - if !self.options.roots.is_empty() { - if let Some(specifier) = specifier.strip_prefix(SLASH_START) { - for root in &self.options.roots { - let cached_path = self.cache.value(root); - if let Ok(path) = self.require_relative(&cached_path, specifier, ctx) { - return Some(path); - } - } - } - } - None - } - - fn load_tsconfig_paths( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - let Some(tsconfig_options) = &self.options.tsconfig else { - return Ok(None); - }; - let tsconfig = self.load_tsconfig( - /* root */ true, - &tsconfig_options.config_file, - &tsconfig_options.references, - )?; - let paths = tsconfig.resolve(cached_path.path(), specifier); - for path in paths { - let cached_path = self.cache.value(&path); - if let Ok(path) = self.require_relative(&cached_path, ".", ctx) { - return Ok(Some(path)); - } - } - Ok(None) - } - - fn load_tsconfig( - &self, - root: bool, - path: &Path, - references: &TsconfigReferences, - ) -> Result, ResolveError> { - self.cache.tsconfig(root, path, |tsconfig| { - let directory = self.cache.value(tsconfig.directory()); - tracing::trace!(tsconfig = ?tsconfig, "load_tsconfig"); - - // Extend tsconfig - if let Some(extends) = &tsconfig.extends { - let extended_tsconfig_paths = match extends { - ExtendsField::Single(s) => { - vec![self.get_extended_tsconfig_path(&directory, tsconfig, s)?] - } - ExtendsField::Multiple(specifiers) => specifiers - .iter() - .map(|s| self.get_extended_tsconfig_path(&directory, tsconfig, s)) - .collect::, ResolveError>>()?, - }; - for extended_tsconfig_path in extended_tsconfig_paths { - let extended_tsconfig = self.load_tsconfig( - /* root */ false, - &extended_tsconfig_path, - &TsconfigReferences::Disabled, - )?; - tsconfig.extend_tsconfig(&extended_tsconfig); - } - } - - // Load project references - match references { - TsconfigReferences::Disabled => { - tsconfig.references.drain(..); - } - TsconfigReferences::Auto => {} - TsconfigReferences::Paths(paths) => { - tsconfig.references = paths - .iter() - .map(|path| ProjectReference { path: path.clone(), tsconfig: None }) - .collect(); - } - } - if !tsconfig.references.is_empty() { - let directory = tsconfig.directory().to_path_buf(); - for reference in &mut tsconfig.references { - let reference_tsconfig_path = directory.normalize_with(&reference.path); - let tsconfig = self.cache.tsconfig( - /* root */ true, - &reference_tsconfig_path, - |_| Ok(()), - )?; - reference.tsconfig.replace(tsconfig); - } - } - Ok(()) - }) - } - - fn get_extended_tsconfig_path( - &self, - directory: &CachedPath, - tsconfig: &TsConfig, - specifier: &str, - ) -> Result { - match specifier.as_bytes().first() { - None => Err(ResolveError::Specifier(SpecifierError::Empty(specifier.to_string()))), - Some(b'/') => Ok(PathBuf::from(specifier)), - Some(b'.') => Ok(tsconfig.directory().normalize_with(specifier)), - _ => self - .clone_with_options(ResolveOptions { - description_files: vec![], - extensions: vec![".json".into()], - main_files: vec!["tsconfig.json".into()], - ..ResolveOptions::default() - }) - .load_package_self_or_node_modules(directory, specifier, &mut Ctx::default()) - .map(|p| p.to_path_buf()) - .map_err(|err| match err { - ResolveError::NotFound(_) => { - ResolveError::TsconfigNotFound(PathBuf::from(specifier)) - } - _ => err, - }), - } - } - - /// PACKAGE_RESOLVE(packageSpecifier, parentURL) - fn package_resolve( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - let (package_name, subpath) = Self::parse_package_specifier(specifier); - - // 3. If packageSpecifier is a Node.js builtin module name, then - // 1. Return the string "node:" concatenated with packageSpecifier. - self.require_core(package_name)?; - - // 11. While parentURL is not the file system root, - for module_name in &self.options.modules { - for cached_path in std::iter::successors(Some(cached_path), |p| p.parent()) { - // 1. Let packageURL be the URL resolution of "node_modules/" concatenated with packageSpecifier, relative to parentURL. - let Some(cached_path) = self.get_module_directory(cached_path, module_name, ctx) - else { - continue; - }; - // 2. Set parentURL to the parent folder URL of parentURL. - let package_path = cached_path.path().normalize_with(package_name); - let cached_path = self.cache.value(&package_path); - // 3. If the folder at packageURL does not exist, then - // 1. Continue the next loop iteration. - if cached_path.is_dir(&self.cache.fs, ctx) { - // 4. Let pjson be the result of READ_PACKAGE_JSON(packageURL). - if let Some(package_json) = - cached_path.package_json(&self.cache.fs, &self.options, ctx)? - { - // 5. If pjson is not null and pjson.exports is not null or undefined, then - // 1. Return the result of PACKAGE_EXPORTS_RESOLVE(packageURL, packageSubpath, pjson.exports, defaultConditions). - for exports in package_json.exports_fields(&self.options.exports_fields) { - if let Some(path) = self.package_exports_resolve( - cached_path.path(), - &format!(".{subpath}"), - exports, - ctx, - )? { - return Ok(Some(path)); - } - } - // 6. Otherwise, if packageSubpath is equal to ".", then - if subpath == "." { - // 1. If pjson.main is a string, then - for main_field in package_json.main_fields(&self.options.main_fields) { - // 1. Return the URL resolution of main in packageURL. - let path = cached_path.path().normalize_with(main_field); - let cached_path = self.cache.value(&path); - if cached_path.is_file(&self.cache.fs, ctx) { - return Ok(Some(cached_path)); - } - } - } - } - let subpath = format!(".{subpath}"); - ctx.with_fully_specified(false); - return self.require(&cached_path, &subpath, ctx).map(Some); - } - } - } - - Err(ResolveError::NotFound(specifier.to_string())) - } - - /// PACKAGE_EXPORTS_RESOLVE(packageURL, subpath, exports, conditions) - fn package_exports_resolve( - &self, - package_url: &Path, - subpath: &str, - exports: &JSONValue, - ctx: &mut Ctx, - ) -> ResolveResult { - let conditions = &self.options.condition_names; - // 1. If exports is an Object with both a key starting with "." and a key not starting with ".", throw an Invalid Package Configuration error. - if let JSONValue::Object(map) = exports { - let mut has_dot = false; - let mut without_dot = false; - for key in map.keys() { - has_dot = has_dot || key.starts_with(|s| s == '.' || s == '#'); - without_dot = without_dot || !key.starts_with(|s| s == '.' || s == '#'); - if has_dot && without_dot { - return Err(ResolveError::InvalidPackageConfig( - package_url.join("package.json"), - )); - } - } - } - // 2. If subpath is equal to ".", then - // Note: subpath is not prepended with a dot when passed in. - if subpath == "." { - // enhanced-resolve appends query and fragment when resolving exports field - // https://github.com/webpack/enhanced-resolve/blob/a998c7d218b7a9ec2461fc4fddd1ad5dd7687485/lib/ExportsFieldPlugin.js#L57-L62 - // This is only need when querying the main export, otherwise ctx is passed through. - if ctx.query.is_some() || ctx.fragment.is_some() { - let query = ctx.query.clone().unwrap_or_default(); - let fragment = ctx.fragment.clone().unwrap_or_default(); - return Err(ResolveError::PackagePathNotExported( - format!("./{}{query}{fragment}", subpath.trim_start_matches('.')), - package_url.join("package.json"), - )); - } - // 1. Let mainExport be undefined. - let main_export = match exports { - // 2. If exports is a String or Array, or an Object containing no keys starting with ".", then - JSONValue::String(_) | JSONValue::Array(_) => { - // 1. Set mainExport to exports. - Some(exports) - } - // 3. Otherwise if exports is an Object containing a "." property, then - JSONValue::Object(map) => { - // 1. Set mainExport to exports["."]. - map.get(".").map_or_else( - || { - if map.keys().any(|key| key.starts_with("./") || key.starts_with('#')) { - None - } else { - Some(exports) - } - }, - Some, - ) - } - _ => None, - }; - // 4. If mainExport is not undefined, then - if let Some(main_export) = main_export { - // 1. Let resolved be the result of PACKAGE_TARGET_RESOLVE( packageURL, mainExport, null, false, conditions). - let resolved = self.package_target_resolve( - package_url, - ".", - main_export, - None, - /* is_imports */ false, - conditions, - ctx, - )?; - // 2. If resolved is not null or undefined, return resolved. - if let Some(path) = resolved { - return Ok(Some(path)); - } - } - } - // 3. Otherwise, if exports is an Object and all keys of exports start with ".", then - if let JSONValue::Object(exports) = exports { - // 1. Let matchKey be the string "./" concatenated with subpath. - // Note: `package_imports_exports_resolve` does not require the leading dot. - let match_key = &subpath; - // 2. Let resolved be the result of PACKAGE_IMPORTS_EXPORTS_RESOLVE( matchKey, exports, packageURL, false, conditions). - if let Some(path) = self.package_imports_exports_resolve( - match_key, - exports, - package_url, - /* is_imports */ false, - conditions, - ctx, - )? { - // 3. If resolved is not null or undefined, return resolved. - return Ok(Some(path)); - } - } - // 4. Throw a Package Path Not Exported error. - Err(ResolveError::PackagePathNotExported( - subpath.to_string(), - package_url.join("package.json"), - )) - } - - /// PACKAGE_IMPORTS_RESOLVE(specifier, parentURL, conditions) - fn package_imports_resolve( - &self, - specifier: &str, - package_json: &PackageJson, - ctx: &mut Ctx, - ) -> Result, ResolveError> { - // 1. Assert: specifier begins with "#". - debug_assert!(specifier.starts_with('#'), "{specifier}"); - // 2. If specifier is exactly equal to "#" or starts with "#/", then - // 1. Throw an Invalid Module Specifier error. - // 3. Let packageURL be the result of LOOKUP_PACKAGE_SCOPE(parentURL). - // 4. If packageURL is not null, then - - // 1. Let pjson be the result of READ_PACKAGE_JSON(packageURL). - // 2. If pjson.imports is a non-null Object, then - - // 1. Let resolved be the result of PACKAGE_IMPORTS_EXPORTS_RESOLVE( specifier, pjson.imports, packageURL, true, conditions). - let mut has_imports = false; - for imports in package_json.imports_fields(&self.options.imports_fields) { - if !has_imports { - has_imports = true; - // TODO: fill in test case for this case - if specifier == "#" || specifier.starts_with("#/") { - return Err(ResolveError::InvalidModuleSpecifier( - specifier.to_string(), - package_json.path.clone(), - )); - } - } - if let Some(path) = self.package_imports_exports_resolve( - specifier, - imports, - package_json.directory(), - /* is_imports */ true, - &self.options.condition_names, - ctx, - )? { - // 2. If resolved is not null or undefined, return resolved. - return Ok(Some(path)); - } - } - - // 5. Throw a Package Import Not Defined error. - if has_imports { - Err(ResolveError::PackageImportNotDefined( - specifier.to_string(), - package_json.path.clone(), - )) - } else { - Ok(None) - } - } - - /// PACKAGE_IMPORTS_EXPORTS_RESOLVE(matchKey, matchObj, packageURL, isImports, conditions) - fn package_imports_exports_resolve( - &self, - match_key: &str, - match_obj: &JSONMap, - package_url: &Path, - is_imports: bool, - conditions: &[String], - ctx: &mut Ctx, - ) -> ResolveResult { - // enhanced-resolve behaves differently, it throws - // Error: CachedPath to directories is not possible with the exports field (specifier was ./dist/) - if match_key.ends_with('/') { - return Ok(None); - } - // 1. If matchKey is a key of matchObj and does not contain "*", then - if !match_key.contains('*') { - // 1. Let target be the value of matchObj[matchKey]. - if let Some(target) = match_obj.get(match_key) { - // 2. Return the result of PACKAGE_TARGET_RESOLVE(packageURL, target, null, isImports, conditions). - return self.package_target_resolve( - package_url, - match_key, - target, - None, - is_imports, - conditions, - ctx, - ); - } - } - - let mut best_target = None; - let mut best_match = ""; - let mut best_key = ""; - // 2. Let expansionKeys be the list of keys of matchObj containing only a single "*", sorted by the sorting function PATTERN_KEY_COMPARE which orders in descending order of specificity. - // 3. For each key expansionKey in expansionKeys, do - for (expansion_key, target) in match_obj { - if expansion_key.starts_with("./") || expansion_key.starts_with('#') { - // 1. Let patternBase be the substring of expansionKey up to but excluding the first "*" character. - if let Some((pattern_base, pattern_trailer)) = expansion_key.split_once('*') { - // 2. If matchKey starts with but is not equal to patternBase, then - if match_key.starts_with(pattern_base) - // 1. Let patternTrailer be the substring of expansionKey from the index after the first "*" character. - && !pattern_trailer.contains('*') - // 2. If patternTrailer has zero length, or if matchKey ends with patternTrailer and the length of matchKey is greater than or equal to the length of expansionKey, then - && (pattern_trailer.is_empty() - || (match_key.len() >= expansion_key.len() - && match_key.ends_with(pattern_trailer))) - && Self::pattern_key_compare(best_key, expansion_key).is_gt() - { - // 1. Let target be the value of matchObj[expansionKey]. - best_target = Some(target); - // 2. Let patternMatch be the substring of matchKey starting at the index of the length of patternBase up to the length of matchKey minus the length of patternTrailer. - best_match = - &match_key[pattern_base.len()..match_key.len() - pattern_trailer.len()]; - best_key = expansion_key; - } - } else if expansion_key.ends_with('/') - && match_key.starts_with(expansion_key) - && Self::pattern_key_compare(best_key, expansion_key).is_gt() - { - // TODO: [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./dist/" in the "exports" field module resolution of the package at xxx/package.json. - best_target = Some(target); - best_match = &match_key[expansion_key.len()..]; - best_key = expansion_key; - } - } - } - if let Some(best_target) = best_target { - // 3. Return the result of PACKAGE_TARGET_RESOLVE(packageURL, target, patternMatch, isImports, conditions). - return self.package_target_resolve( - package_url, - best_key, - best_target, - Some(best_match), - is_imports, - conditions, - ctx, - ); - } - // 4. Return null. - Ok(None) - } - - /// PACKAGE_TARGET_RESOLVE(packageURL, target, patternMatch, isImports, conditions) - #[allow(clippy::too_many_arguments)] - fn package_target_resolve( - &self, - package_url: &Path, - target_key: &str, - target: &JSONValue, - pattern_match: Option<&str>, - is_imports: bool, - conditions: &[String], - ctx: &mut Ctx, - ) -> ResolveResult { - fn normalize_string_target<'a>( - target_key: &'a str, - target: &'a str, - pattern_match: Option<&'a str>, - package_url: &Path, - ) -> Result, ResolveError> { - let target = if let Some(pattern_match) = pattern_match { - if !target_key.contains('*') && !target.contains('*') { - // enhanced-resolve behaviour - // TODO: [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./dist/" in the "exports" field module resolution of the package at xxx/package.json. - if target_key.ends_with('/') && target.ends_with('/') { - Cow::Owned(format!("{target}{pattern_match}")) - } else { - return Err(ResolveError::InvalidPackageConfigDirectory( - package_url.join("package.json"), - )); - } - } else { - Cow::Owned(target.replace('*', pattern_match)) - } - } else { - Cow::Borrowed(target) - }; - Ok(target) - } - - match target { - // 1. If target is a String, then - JSONValue::String(target) => { - // 1. If target does not start with "./", then - if !target.starts_with("./") { - // 1. If isImports is false, or if target starts with "../" or "/", or if target is a valid URL, then - if !is_imports || target.starts_with("../") || target.starts_with('/') { - // 1. Throw an Invalid Package Target error. - return Err(ResolveError::InvalidPackageTarget( - target.to_string(), - target_key.to_string(), - package_url.join("package.json"), - )); - } - // 2. If patternMatch is a String, then - // 1. Return PACKAGE_RESOLVE(target with every instance of "*" replaced by patternMatch, packageURL + "/"). - let target = - normalize_string_target(target_key, target, pattern_match, package_url)?; - let package_url = self.cache.value(package_url); - // // 3. Return PACKAGE_RESOLVE(target, packageURL + "/"). - return self.package_resolve(&package_url, &target, ctx); - } - - // 2. If target split on "/" or "\" contains any "", ".", "..", or "node_modules" segments after the first "." segment, case insensitive and including percent encoded variants, throw an Invalid Package Target error. - // 3. Let resolvedTarget be the URL resolution of the concatenation of packageURL and target. - // 4. Assert: resolvedTarget is contained in packageURL. - // 5. If patternMatch is null, then - let target = - normalize_string_target(target_key, target, pattern_match, package_url)?; - if Path::new(target.as_ref()).is_invalid_exports_target() { - return Err(ResolveError::InvalidPackageTarget( - target.to_string(), - target_key.to_string(), - package_url.join("package.json"), - )); - } - let resolved_target = package_url.normalize_with(target.as_ref()); - // 6. If patternMatch split on "/" or "\" contains any "", ".", "..", or "node_modules" segments, case insensitive and including percent encoded variants, throw an Invalid Module Specifier error. - // 7. Return the URL resolution of resolvedTarget with every instance of "*" replaced with patternMatch. - let value = self.cache.value(&resolved_target); - return Ok(Some(value)); - } - // 2. Otherwise, if target is a non-null Object, then - JSONValue::Object(target) => { - // 1. If exports contains any index property keys, as defined in ECMA-262 6.1.7 Array Index, throw an Invalid Package Configuration error. - // 2. For each property p of target, in object insertion order as, - for (key, target_value) in target { - // 1. If p equals "default" or conditions contains an entry for p, then - if key == "default" || conditions.contains(key) { - // 1. Let targetValue be the value of the p property in target. - // 2. Let resolved be the result of PACKAGE_TARGET_RESOLVE( packageURL, targetValue, patternMatch, isImports, conditions). - let resolved = self.package_target_resolve( - package_url, - target_key, - target_value, - pattern_match, - is_imports, - conditions, - ctx, - ); - // 3. If resolved is equal to undefined, continue the loop. - if let Some(path) = resolved? { - // 4. Return resolved. - return Ok(Some(path)); - } - } - } - // 3. Return undefined. - return Ok(None); - } - // 3. Otherwise, if target is an Array, then - JSONValue::Array(targets) => { - // 1. If _target.length is zero, return null. - if targets.is_empty() { - // Note: return PackagePathNotExported has the same effect as return because there are no matches. - return Err(ResolveError::PackagePathNotExported( - pattern_match.unwrap_or(".").to_string(), - package_url.join("package.json"), - )); - } - // 2. For each item targetValue in target, do - for (i, target_value) in targets.iter().enumerate() { - // 1. Let resolved be the result of PACKAGE_TARGET_RESOLVE( packageURL, targetValue, patternMatch, isImports, conditions), continuing the loop on any Invalid Package Target error. - let resolved = self.package_target_resolve( - package_url, - target_key, - target_value, - pattern_match, - is_imports, - conditions, - ctx, - ); - - if resolved.is_err() && i == targets.len() { - return resolved; - } - - // 2. If resolved is undefined, continue the loop. - if let Ok(Some(path)) = resolved { - // 3. Return resolved. - return Ok(Some(path)); - } - } - // 3. Return or throw the last fallback resolution null return or error. - // Note: see `resolved.is_err() && i == targets.len()` - } - _ => {} - } - // 4. Otherwise, if target is null, return null. - Ok(None) - // 5. Otherwise throw an Invalid Package Target error. - } - - // Returns (module, subpath) - // https://github.com/nodejs/node/blob/8f0f17e1e3b6c4e58ce748e06343c5304062c491/lib/internal/modules/esm/resolve.js#L688 - fn parse_package_specifier(specifier: &str) -> (&str, &str) { - let mut separator_index = specifier.as_bytes().iter().position(|b| *b == b'/'); - // let mut valid_package_name = true; - // let mut is_scoped = false; - if specifier.starts_with('@') { - // is_scoped = true; - if separator_index.is_none() || specifier.is_empty() { - // valid_package_name = false; - } else if let Some(index) = &separator_index { - separator_index = specifier[*index + 1..] - .as_bytes() - .iter() - .position(|b| *b == b'/') - .map(|i| i + *index + 1); - } - } - let package_name = - separator_index.map_or(specifier, |separator_index| &specifier[..separator_index]); - - // TODO: https://github.com/nodejs/node/blob/8f0f17e1e3b6c4e58ce748e06343c5304062c491/lib/internal/modules/esm/resolve.js#L705C1-L714C1 - // Package name cannot have leading . and cannot have percent-encoding or - // \\ separators. - // if (RegExpPrototypeExec(invalidPackageNameRegEx, packageName) !== null) - // validPackageName = false; - - // if (!validPackageName) { - // throw new ERR_INVALID_MODULE_SPECIFIER( - // specifier, 'is not a valid package name', fileURLToPath(base)); - // } - let package_subpath = - separator_index.map_or("", |separator_index| &specifier[separator_index..]); - (package_name, package_subpath) - } - - /// PATTERN_KEY_COMPARE(keyA, keyB) - fn pattern_key_compare(key_a: &str, key_b: &str) -> Ordering { - if key_a.is_empty() { - return Ordering::Greater; - } - // 1. Assert: keyA ends with "/" or contains only a single "*". - debug_assert!(key_a.ends_with('/') || key_a.match_indices('*').count() == 1, "{key_a}"); - // 2. Assert: keyB ends with "/" or contains only a single "*". - debug_assert!(key_b.ends_with('/') || key_b.match_indices('*').count() == 1, "{key_b}"); - // 3. Let baseLengthA be the index of "*" in keyA plus one, if keyA contains "*", or the length of keyA otherwise. - let a_pos = key_a.chars().position(|c| c == '*'); - let base_length_a = a_pos.map_or(key_a.len(), |p| p + 1); - // 4. Let baseLengthB be the index of "*" in keyB plus one, if keyB contains "*", or the length of keyB otherwise. - let b_pos = key_b.chars().position(|c| c == '*'); - let base_length_b = b_pos.map_or(key_b.len(), |p| p + 1); - // 5. If baseLengthA is greater than baseLengthB, return -1. - if base_length_a > base_length_b { - return Ordering::Less; - } - // 6. If baseLengthB is greater than baseLengthA, return 1. - if base_length_b > base_length_a { - return Ordering::Greater; - } - // 7. If keyA does not contain "*", return 1. - if !key_a.contains('*') { - return Ordering::Greater; - } - // 8. If keyB does not contain "*", return -1. - if !key_b.contains('*') { - return Ordering::Less; - } - // 9. If the length of keyA is greater than the length of keyB, return -1. - if key_a.len() > key_b.len() { - return Ordering::Less; - } - // 10. If the length of keyB is greater than the length of keyA, return 1. - if key_b.len() > key_a.len() { - return Ordering::Greater; - } - // 11. Return 0. - Ordering::Equal - } - - fn strip_package_name<'a>(specifier: &'a str, package_name: &'a str) -> Option<&'a str> { - specifier - .strip_prefix(package_name) - .filter(|tail| tail.is_empty() || tail.starts_with(SLASH_START)) - } -} diff --git a/src/options.rs b/src/options.rs deleted file mode 100644 index f473a133..00000000 --- a/src/options.rs +++ /dev/null @@ -1,623 +0,0 @@ -use std::path::Path; -use std::{fmt, path::PathBuf}; - -/// Module Resolution Options -/// -/// Options are directly ported from [enhanced-resolve](https://github.com/webpack/enhanced-resolve#resolver-options). -/// -/// See [webpack resolve](https://webpack.js.org/configuration/resolve/) for information and examples -#[derive(Debug, Clone)] -pub struct ResolveOptions { - /// Path to TypeScript configuration file. - /// - /// Default `None` - pub tsconfig: Option, - - /// Create aliases to import or require certain modules more easily. - /// - /// An alias is used to replace a whole path or part of a path. - /// For example, to alias a commonly used `src/` folders: `vec![("@/src"), vec![AliasValue::Path("/path/to/src")]]` - /// - /// A trailing $ can also be added to the given object's keys to signify an exact match. - /// - /// See [webpack's `resolve.alias` documentation](https://webpack.js.org/configuration/resolve/#resolvealias) for a list of use cases. - pub alias: Alias, - - /// A list of alias fields in description files. - /// - /// Specify a field, such as `browser`, to be parsed according to [this specification](https://github.com/defunctzombie/package-browser-field-spec). - /// Can be a path to json object such as `["path", "to", "exports"]`. - /// - /// Default `[]` - pub alias_fields: Vec>, - - /// Condition names for exports field which defines entry points of a package. - /// - /// The key order in the exports field is significant. During condition matching, earlier entries have higher priority and take precedence over later entries. - /// - /// Default `[]` - pub condition_names: Vec, - - /// The JSON files to use for descriptions. (There was once a `bower.json`.) - /// - /// Default `["package.json"]` - pub description_files: Vec, - - /// Set to [EnforceExtension::Enabled] for [ESM Mandatory file extensions](https://nodejs.org/api/esm.html#mandatory-file-extensions). - /// - /// If `enforce_extension` is set to [EnforceExtension::Enabled], resolution will not allow extension-less files. - /// This means `require('./foo.js')` will resolve, while `require('./foo')` will not. - /// - /// The default value for `enforce_extension` is [EnforceExtension::Auto], which is changed upon initialization. - /// - /// It changes to [EnforceExtension::Enabled] if [ResolveOptions::extensions] contains an empty string; - /// otherwise, this value changes to [EnforceExtension::Disabled]. - /// - /// Explicitly set the value to [EnforceExtension::Disabled] to disable this automatic behavior. - /// - /// For reference, this behavior is aligned with `enhanced-resolve`. See . - pub enforce_extension: EnforceExtension, - - /// A list of exports fields in description files. - /// - /// Can be a path to a JSON object such as `["path", "to", "exports"]`. - /// - /// Default `[["exports"]]`. - pub exports_fields: Vec>, - - /// Fields from `package.json` which are used to provide the internal requests of a package - /// (requests starting with # are considered internal). - /// - /// Can be a path to a JSON object such as `["path", "to", "imports"]`. - /// - /// Default `[["imports"]]`. - pub imports_fields: Vec>, - - /// An object which maps extension to extension aliases. - /// - /// Default `{}` - pub extension_alias: Vec<(String, Vec)>, - - /// Attempt to resolve these extensions in order. - /// - /// If multiple files share the same name but have different extensions, - /// will resolve the one with the extension listed first in the array and skip the rest. - /// - /// All extensions must have a leading dot. - /// - /// Default `[".js", ".json", ".node"]` - pub extensions: Vec, - - /// Redirect module requests when normal resolving fails. - /// - /// Default `[]` - pub fallback: Alias, - - /// 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). - /// - /// See also webpack configuration [resolve.fullySpecified](https://webpack.js.org/configuration/module/#resolvefullyspecified) - /// - /// Default `false` - pub fully_specified: bool, - - /// A list of main fields in description files - /// - /// Default `["main"]`. - pub main_fields: Vec, - - /// The filename to be used while resolving directories. - /// - /// Default `["index"]` - pub main_files: Vec, - - /// A list of directories to resolve modules from, can be absolute path or folder name. - /// - /// Default `["node_modules"]` - pub modules: Vec, - - /// Resolve to a context instead of a file. - /// - /// Default `false` - pub resolve_to_context: bool, - - /// Prefer to resolve module requests as relative requests instead of using modules from node_modules directories. - /// - /// Default `false` - pub prefer_relative: bool, - - /// Prefer to resolve server-relative urls as absolute paths before falling back to resolve in ResolveOptions::roots. - /// - /// Default `false` - pub prefer_absolute: bool, - - /// A list of resolve restrictions to restrict the paths that a request can be resolved on. - /// - /// Default `[]` - pub restrictions: Vec, - - /// A list of directories where requests of server-relative URLs (starting with '/') are resolved. - /// On non-Windows systems these requests are resolved as an absolute path first. - /// - /// Default `[]` - pub roots: Vec, - - /// Whether to resolve symlinks to their symlinked location. - /// When enabled, symlinked resources are resolved to their real path, not their symlinked location. - /// Note that this may cause module resolution to fail when using tools that symlink packages (like npm link). - /// - /// Default `true` - pub symlinks: bool, - - /// Whether to parse [module.builtinModules](https://nodejs.org/api/module.html#modulebuiltinmodules) or not. - /// For example, "zlib" will throw [crate::ResolveError::Builtin] when set to true. - /// - /// Default `false` - pub builtin_modules: bool, -} - -impl ResolveOptions { - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// - /// let options = ResolveOptions::default().with_condition_names(&["bar"]); - /// assert_eq!(options.condition_names, vec!["bar".to_string()]) - /// ``` - #[must_use] - pub fn with_condition_names(mut self, names: &[&str]) -> Self { - self.condition_names = names.iter().map(ToString::to_string).collect::>(); - self - } - - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// - /// let options = ResolveOptions::default().with_builtin_modules(false); - /// assert_eq!(options.builtin_modules, false) - /// ``` - #[must_use] - pub fn with_builtin_modules(mut self, flag: bool) -> Self { - self.builtin_modules = flag; - self - } - - /// Adds a single root to the options - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_root("foo"); - /// assert_eq!(options.roots, vec![PathBuf::from("foo")]) - /// ``` - #[must_use] - pub fn with_root>(mut self, root: P) -> Self { - self.roots.push(root.as_ref().to_path_buf()); - self - } - - /// Adds a single extension to the list of extensions - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_extension("jsonc"); - /// assert!(options.extensions.contains(&"jsonc".to_string())); - /// ``` - #[must_use] - pub fn with_extension>(mut self, extension: S) -> Self { - self.extensions.push(extension.into()); - self - } - - /// Adds a single main field to the list of fields - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_main_field("something"); - /// assert!(options.main_fields.contains(&"something".to_string())); - /// ``` - #[must_use] - pub fn with_main_field>(mut self, field: S) -> Self { - self.main_fields.push(field.into()); - self - } - - /// Changes how the extension should be treated - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions, EnforceExtension}; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_force_extension(EnforceExtension::Enabled); - /// assert_eq!(options.enforce_extension, EnforceExtension::Enabled); - /// ``` - #[must_use] - pub fn with_force_extension(mut self, enforce_extension: EnforceExtension) -> Self { - self.enforce_extension = enforce_extension; - self - } - - /// Sets the value for [ResolveOptions::fully_specified] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_fully_specified(true); - /// assert_eq!(options.fully_specified, true); - /// ``` - #[must_use] - pub fn with_fully_specified(mut self, fully_specified: bool) -> Self { - self.fully_specified = fully_specified; - self - } - /// Sets the value for [ResolveOptions::prefer_relative] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_prefer_relative(true); - /// assert_eq!(options.prefer_relative, true); - /// ``` - #[must_use] - pub fn with_prefer_relative(mut self, flag: bool) -> Self { - self.prefer_relative = flag; - self - } - /// Sets the value for [ResolveOptions::prefer_absolute] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_prefer_absolute(true); - /// assert_eq!(options.prefer_absolute, true); - /// ``` - #[must_use] - pub fn with_prefer_absolute(mut self, flag: bool) -> Self { - self.prefer_absolute = flag; - self - } - - /// Changes the value of [ResolveOptions::symlinks] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// - /// let options = ResolveOptions::default().with_symbolic_link(false); - /// assert_eq!(options.symlinks, false); - /// ``` - #[must_use] - pub fn with_symbolic_link(mut self, flag: bool) -> Self { - self.symlinks = flag; - self - } - - /// Adds a module to [ResolveOptions::modules] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// - /// let options = ResolveOptions::default().with_module("module"); - /// assert!(options.modules.contains(&"module".to_string())); - /// ``` - #[must_use] - pub fn with_module>(mut self, module: M) -> Self { - self.modules.push(module.into()); - self - } - - /// Adds a main file to [ResolveOptions::main_files] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// - /// let options = ResolveOptions::default().with_main_file("foo"); - /// assert!(options.main_files.contains(&"foo".to_string())); - /// ``` - #[must_use] - pub fn with_main_file>(mut self, module: M) -> Self { - self.main_files.push(module.into()); - self - } - - pub(crate) fn sanitize(mut self) -> Self { - debug_assert!( - self.extensions.iter().filter(|e| !e.is_empty()).all(|e| e.starts_with('.')), - "All extensions must start with a leading dot" - ); - // Set `enforceExtension` to `true` when [ResolveOptions::extensions] contains an empty string. - // See - if self.enforce_extension == EnforceExtension::Auto { - if !self.extensions.is_empty() && self.extensions.iter().any(String::is_empty) { - self.enforce_extension = EnforceExtension::Enabled; - } else { - self.enforce_extension = EnforceExtension::Disabled; - } - } - self - } -} - -/// Value for [ResolveOptions::enforce_extension] -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -pub enum EnforceExtension { - Auto, - Enabled, - Disabled, -} - -impl EnforceExtension { - pub const fn is_auto(&self) -> bool { - matches!(self, Self::Auto) - } - - pub const fn is_enabled(&self) -> bool { - matches!(self, Self::Enabled) - } - - pub const fn is_disabled(&self) -> bool { - matches!(self, Self::Disabled) - } -} - -/// Alias for [ResolveOptions::alias] and [ResolveOptions::fallback] -pub type Alias = Vec<(String, Vec)>; - -/// Alias Value for [ResolveOptions::alias] and [ResolveOptions::fallback] -#[derive(Debug, Clone, Hash, PartialEq, Eq)] -pub enum AliasValue { - /// The path value - Path(String), - - /// The `false` value - Ignore, -} - -impl From for AliasValue -where - S: Into, -{ - fn from(value: S) -> Self { - Self::Path(value.into()) - } -} - -/// Value for [ResolveOptions::restrictions] -#[derive(Debug, Clone)] -pub enum Restriction { - Path(PathBuf), - RegExp(String), -} - -/// Tsconfig Options for [ResolveOptions::tsconfig] -/// -/// Derived from [tsconfig-paths-webpack-plugin](https://github.com/dividab/tsconfig-paths-webpack-plugin#options) -#[derive(Debug, Clone)] -pub struct TsconfigOptions { - /// Allows you to specify where to find the TypeScript configuration file. - /// You may provide - /// * a relative path to the configuration file. It will be resolved relative to cwd. - /// * an absolute path to the configuration file. - pub config_file: PathBuf, - - /// Support for Typescript Project References. - pub references: TsconfigReferences, -} - -/// Configuration for [TsconfigOptions::references] -#[derive(Debug, Clone)] -pub enum TsconfigReferences { - Disabled, - /// Use the `references` field from tsconfig of `config_file`. - Auto, - /// Manually provided relative or absolute path. - Paths(Vec), -} - -impl Default for ResolveOptions { - fn default() -> Self { - Self { - tsconfig: None, - alias: vec![], - alias_fields: vec![], - condition_names: vec![], - description_files: vec!["package.json".into()], - enforce_extension: EnforceExtension::Auto, - extension_alias: vec![], - exports_fields: vec![vec!["exports".into()]], - imports_fields: vec![vec!["imports".into()]], - extensions: vec![".js".into(), ".json".into(), ".node".into()], - fallback: vec![], - fully_specified: false, - main_fields: vec!["main".into()], - main_files: vec!["index".into()], - modules: vec!["node_modules".into()], - resolve_to_context: false, - prefer_relative: false, - prefer_absolute: false, - restrictions: vec![], - roots: vec![], - symlinks: true, - builtin_modules: false, - } - } -} - -// For tracing -impl fmt::Display for ResolveOptions { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - if let Some(tsconfig) = &self.tsconfig { - write!(f, "tsconfig:{tsconfig:?},")?; - } - if !self.alias.is_empty() { - write!(f, "alias:{:?},", self.alias)?; - } - if !self.alias_fields.is_empty() { - write!(f, "alias_fields:{:?},", self.alias_fields)?; - } - if !self.condition_names.is_empty() { - write!(f, "condition_names:{:?},", self.condition_names)?; - } - if self.enforce_extension.is_enabled() { - write!(f, "enforce_extension:{:?},", self.enforce_extension)?; - } - if !self.exports_fields.is_empty() { - write!(f, "exports_fields:{:?},", self.exports_fields)?; - } - if !self.imports_fields.is_empty() { - write!(f, "imports_fields:{:?},", self.imports_fields)?; - } - if !self.extension_alias.is_empty() { - write!(f, "extension_alias:{:?},", self.extension_alias)?; - } - if !self.extensions.is_empty() { - write!(f, "extensions:{:?},", self.extensions)?; - } - if !self.fallback.is_empty() { - write!(f, "fallback:{:?},", self.fallback)?; - } - if self.fully_specified { - write!(f, "fully_specified:{:?},", self.fully_specified)?; - } - if !self.main_fields.is_empty() { - write!(f, "main_fields:{:?},", self.main_fields)?; - } - if !self.main_files.is_empty() { - write!(f, "main_files:{:?},", self.main_files)?; - } - if !self.modules.is_empty() { - write!(f, "modules:{:?},", self.modules)?; - } - if self.resolve_to_context { - write!(f, "resolve_to_context:{:?},", self.resolve_to_context)?; - } - if self.prefer_relative { - write!(f, "prefer_relative:{:?},", self.prefer_relative)?; - } - if self.prefer_absolute { - write!(f, "prefer_absolute:{:?},", self.prefer_absolute)?; - } - if !self.restrictions.is_empty() { - write!(f, "restrictions:{:?},", self.restrictions)?; - } - if !self.roots.is_empty() { - write!(f, "roots:{:?},", self.roots)?; - } - if self.symlinks { - write!(f, "symlinks:{:?},", self.symlinks)?; - } - if self.builtin_modules { - write!(f, "builtin_modules:{:?},", self.builtin_modules)?; - } - Ok(()) - } -} - -#[cfg(test)] -mod test { - use super::{ - AliasValue, EnforceExtension, ResolveOptions, Restriction, TsconfigOptions, - TsconfigReferences, - }; - use std::path::PathBuf; - - #[test] - fn enforce_extension() { - assert!(EnforceExtension::Auto.is_auto()); - assert!(!EnforceExtension::Enabled.is_auto()); - assert!(!EnforceExtension::Disabled.is_auto()); - - assert!(!EnforceExtension::Auto.is_enabled()); - assert!(EnforceExtension::Enabled.is_enabled()); - assert!(!EnforceExtension::Disabled.is_enabled()); - - assert!(!EnforceExtension::Auto.is_disabled()); - assert!(!EnforceExtension::Enabled.is_disabled()); - assert!(EnforceExtension::Disabled.is_disabled()); - } - - #[test] - fn display() { - let options = ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: PathBuf::from("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - alias: vec![("a".into(), vec![AliasValue::Ignore])], - alias_fields: vec![vec!["browser".into()]], - condition_names: vec!["require".into()], - enforce_extension: EnforceExtension::Enabled, - extension_alias: vec![(".js".into(), vec![".ts".into()])], - exports_fields: vec![vec!["exports".into()]], - imports_fields: vec![vec!["imports".into()]], - fallback: vec![("fallback".into(), vec![AliasValue::Ignore])], - fully_specified: true, - resolve_to_context: true, - prefer_relative: true, - prefer_absolute: true, - restrictions: vec![Restriction::Path(PathBuf::from("restrictions"))], - roots: vec![PathBuf::from("roots")], - builtin_modules: true, - ..ResolveOptions::default() - }; - - let expected = r#"tsconfig:TsconfigOptions { config_file: "tsconfig.json", references: Auto },alias:[("a", [Ignore])],alias_fields:[["browser"]],condition_names:["require"],enforce_extension:Enabled,exports_fields:[["exports"]],imports_fields:[["imports"]],extension_alias:[(".js", [".ts"])],extensions:[".js", ".json", ".node"],fallback:[("fallback", [Ignore])],fully_specified:true,main_fields:["main"],main_files:["index"],modules:["node_modules"],resolve_to_context:true,prefer_relative:true,prefer_absolute:true,restrictions:[Path("restrictions")],roots:["roots"],symlinks:true,builtin_modules:true,"#; - assert_eq!(format!("{options}"), expected); - - let options = ResolveOptions { - alias: vec![], - alias_fields: vec![], - builtin_modules: false, - condition_names: vec![], - description_files: vec![], - enforce_extension: EnforceExtension::Disabled, - exports_fields: vec![], - extension_alias: vec![], - extensions: vec![], - fallback: vec![], - fully_specified: false, - imports_fields: vec![], - main_fields: vec![], - main_files: vec![], - modules: vec![], - prefer_absolute: false, - prefer_relative: false, - resolve_to_context: false, - restrictions: vec![], - roots: vec![], - symlinks: false, - tsconfig: None, - }; - - assert_eq!(format!("{options}"), ""); - } -} diff --git a/src/package_json.rs b/src/package_json.rs deleted file mode 100644 index 73901faa..00000000 --- a/src/package_json.rs +++ /dev/null @@ -1,207 +0,0 @@ -//! package.json definitions -//! -//! Code related to export field are copied from [Parcel's resolver](https://github.com/parcel-bundler/parcel/blob/v2/packages/utils/node-resolver-rs/src/package_json.rs) -use std::path::{Path, PathBuf}; - -use serde_json::Value as JSONValue; - -use crate::{path::PathUtil, ResolveError}; - -pub type JSONMap = serde_json::Map; - -/// Deserialized package.json -#[derive(Debug, Default)] -pub struct PackageJson { - /// Path to `package.json`. Contains the `package.json` filename. - pub path: PathBuf, - - /// Realpath to `package.json`. Contains the `package.json` filename. - pub realpath: PathBuf, - - /// The "name" field defines your package's name. - /// The "name" field can be used in addition to the "exports" field to self-reference a package using its name. - /// - /// - pub name: Option, - - raw_json: std::sync::Arc, -} - -impl PackageJson { - /// # Panics - /// # Errors - pub(crate) fn parse( - path: PathBuf, - realpath: PathBuf, - json: &str, - ) -> Result { - let mut raw_json: JSONValue = serde_json::from_str(json)?; - let mut package_json = Self::default(); - - if let Some(json_object) = raw_json.as_object_mut() { - // Remove large fields that are useless for pragmatic use. - #[cfg(feature = "package_json_raw_json_api")] - { - json_object.remove("description"); - json_object.remove("keywords"); - json_object.remove("scripts"); - json_object.remove("dependencies"); - json_object.remove("devDependencies"); - json_object.remove("peerDependencies"); - json_object.remove("optionalDependencies"); - } - - // Add name. - package_json.name = - json_object.get("name").and_then(|field| field.as_str()).map(ToString::to_string); - } - - package_json.path = path; - package_json.realpath = realpath; - package_json.raw_json = std::sync::Arc::new(raw_json); - Ok(package_json) - } - - fn get_value_by_path<'a>( - fields: &'a serde_json::Map, - path: &[String], - ) -> Option<&'a JSONValue> { - if path.is_empty() { - return None; - } - let mut value = fields.get(&path[0])?; - for key in path.iter().skip(1) { - if let Some(inner_value) = value.as_object().and_then(|o| o.get(key)) { - value = inner_value; - } else { - return None; - } - } - Some(value) - } - - /// Raw serde json value of `package.json`. - /// - /// This is currently used in Rspack for: - /// * getting the `sideEffects` field - /// * query in - search on GitHub indicates query on the `type` field. - /// - /// To reduce overall memory consumption, large fields that useless for pragmatic use are removed. - /// They are: `description`, `keywords`, `scripts`, - /// `dependencies` and `devDependencies`, `peerDependencies`, `optionalDependencies`. - #[cfg(feature = "package_json_raw_json_api")] - pub fn raw_json(&self) -> &std::sync::Arc { - &self.raw_json - } - - /// Directory to `package.json` - /// - /// # Panics - /// - /// * When the package.json path is misconfigured. - pub fn directory(&self) -> &Path { - debug_assert!(self.realpath.file_name().is_some_and(|x| x == "package.json")); - self.realpath.parent().unwrap() - } - - /// The "main" field defines the entry point of a package when imported by name via a node_modules lookup. Its value is a path. - /// - /// When a package has an "exports" field, this will take precedence over the "main" field when importing the package by name. - /// - /// Values are dynamically retrieved from [ResolveOptions::main_fields]. - /// - /// - pub(crate) fn main_fields<'a>( - &'a self, - main_fields: &'a [String], - ) -> impl Iterator + '_ { - main_fields - .iter() - .filter_map(|main_field| self.raw_json.get(main_field)) - .filter_map(|value| value.as_str()) - } - - /// The "exports" field allows defining the entry points of a package when imported by name loaded either via a node_modules lookup or a self-reference to its own name. - /// - /// - pub(crate) fn exports_fields<'a>( - &'a self, - exports_fields: &'a [Vec], - ) -> impl Iterator + '_ { - exports_fields.iter().filter_map(|object_path| { - self.raw_json - .as_object() - .and_then(|json_object| Self::get_value_by_path(json_object, object_path)) - }) - } - - /// In addition to the "exports" field, there is a package "imports" field to create private mappings that only apply to import specifiers from within the package itself. - /// - /// - pub(crate) fn imports_fields<'a>( - &'a self, - imports_fields: &'a [Vec], - ) -> impl Iterator + '_ { - imports_fields.iter().filter_map(|object_path| { - self.raw_json - .as_object() - .and_then(|json_object| Self::get_value_by_path(json_object, object_path)) - .and_then(|value| value.as_object()) - }) - } - - /// The "browser" field is provided by a module author as a hint to javascript bundlers or component tools when packaging modules for client side use. - /// Multiple values are configured by [ResolveOptions::alias_fields]. - /// - /// - fn browser_fields<'a>( - &'a self, - alias_fields: &'a [Vec], - ) -> impl Iterator + '_ { - alias_fields.iter().filter_map(|object_path| { - self.raw_json - .as_object() - .and_then(|json_object| Self::get_value_by_path(json_object, object_path)) - // Only object is valid, all other types are invalid - // https://github.com/webpack/enhanced-resolve/blob/3a28f47788de794d9da4d1702a3a583d8422cd48/lib/AliasFieldPlugin.js#L44-L52 - .and_then(|value| value.as_object()) - }) - } - - /// Resolve the request string for this package.json by looking at the `browser` field. - /// - /// # Errors - /// - /// * Returns [ResolveError::Ignored] for `"path": false` in `browser` field. - pub(crate) fn resolve_browser_field<'a>( - &'a self, - path: &Path, - request: Option<&str>, - alias_fields: &'a [Vec], - ) -> Result, ResolveError> { - for object in self.browser_fields(alias_fields) { - if let Some(request) = request { - if let Some(value) = object.get(request) { - return Self::alias_value(path, value); - } - } else { - let dir = self.path.parent().unwrap(); - for (key, value) in object { - let joined = dir.normalize_with(key); - if joined == path { - return Self::alias_value(path, value); - } - } - } - } - Ok(None) - } - - fn alias_value<'a>(key: &Path, value: &'a JSONValue) -> Result, ResolveError> { - match value { - JSONValue::String(value) => Ok(Some(value.as_str())), - JSONValue::Bool(b) if !b => Err(ResolveError::Ignored(key.to_path_buf())), - _ => Ok(None), - } - } -} diff --git a/src/path.rs b/src/path.rs deleted file mode 100644 index f66fdd76..00000000 --- a/src/path.rs +++ /dev/null @@ -1,132 +0,0 @@ -//! Path Utilities -//! -//! Code adapted from the following libraries -//! * [path-absolutize](https://docs.rs/path-absolutize) -//! * [normalize_path](https://docs.rs/normalize-path) -use std::path::{Component, Path, PathBuf}; - -pub const SLASH_START: &[char; 2] = &['/', '\\']; - -/// Extension trait to add path normalization to std's [`Path`]. -pub trait PathUtil { - /// Normalize this path without performing I/O. - /// - /// All redundant separator and up-level references are collapsed. - /// - /// However, this does not resolve links. - fn normalize(&self) -> PathBuf; - - /// Normalize with subpath assuming this path is normalized without performing I/O. - /// - /// All redundant separator and up-level references are collapsed. - /// - /// However, this does not resolve links. - fn normalize_with>(&self, subpath: P) -> PathBuf; - - /// Defined in ESM PACKAGE_TARGET_RESOLVE - /// If target split on "/" or "\" contains any "", ".", "..", or "node_modules" segments after the first "." segment, case insensitive and including percent encoded variants - fn is_invalid_exports_target(&self) -> bool; -} - -impl PathUtil for Path { - // https://github.com/parcel-bundler/parcel/blob/e0b99c2a42e9109a9ecbd6f537844a1b33e7faf5/packages/utils/node-resolver-rs/src/path.rs#L7 - fn normalize(&self) -> PathBuf { - let mut components = self.components().peekable(); - let mut ret = if let Some(c @ Component::Prefix(..)) = components.peek() { - let buf = PathBuf::from(c.as_os_str()); - components.next(); - buf - } else { - PathBuf::new() - }; - - for component in components { - match component { - Component::Prefix(..) => unreachable!("Path {:?}", self), - Component::RootDir => { - ret.push(component.as_os_str()); - } - Component::CurDir => {} - Component::ParentDir => { - ret.pop(); - } - Component::Normal(c) => { - ret.push(c); - } - } - } - - ret - } - - // https://github.com/parcel-bundler/parcel/blob/e0b99c2a42e9109a9ecbd6f537844a1b33e7faf5/packages/utils/node-resolver-rs/src/path.rs#L37 - fn normalize_with>(&self, subpath: B) -> PathBuf { - let subpath = subpath.as_ref(); - - let mut components = subpath.components(); - - let Some(head) = components.next() else { return subpath.to_path_buf() }; - - if matches!(head, Component::Prefix(..) | Component::RootDir) { - return subpath.to_path_buf(); - } - - let mut ret = self.to_path_buf(); - for component in std::iter::once(head).chain(components) { - match component { - Component::CurDir => {} - Component::ParentDir => { - ret.pop(); - } - Component::Normal(c) => { - ret.push(c); - } - Component::Prefix(..) | Component::RootDir => { - unreachable!("Path {:?} Subpath {:?}", self, subpath) - } - } - } - - ret - } - - fn is_invalid_exports_target(&self) -> bool { - self.components().enumerate().any(|(index, c)| match c { - Component::ParentDir => true, - Component::CurDir => index > 0, - Component::Normal(c) => c.eq_ignore_ascii_case("node_modules"), - _ => false, - }) - } -} - -// https://github.com/webpack/enhanced-resolve/blob/main/test/path.test.js -#[test] -fn is_invalid_exports_target() { - let test_cases = [ - "../a.js", - "../", - "./a/b/../../../c.js", - "./a/b/../../../", - "./../../c.js", - "./../../", - "./a/../b/../../c.js", - "./a/../b/../../", - "./././../", - ]; - - for case in test_cases { - assert!(Path::new(case).is_invalid_exports_target(), "{case}"); - } - - assert!(!Path::new("C:").is_invalid_exports_target()); - assert!(!Path::new("/").is_invalid_exports_target()); -} - -#[test] -fn normalize() { - assert_eq!(Path::new("/foo/.././foo/").normalize(), Path::new("/foo")); - assert_eq!(Path::new("C://").normalize(), Path::new("C://")); - assert_eq!(Path::new("C:").normalize(), Path::new("C:")); - assert_eq!(Path::new(r"\\server\share").normalize(), Path::new(r"\\server\share")); -} diff --git a/src/resolution.rs b/src/resolution.rs deleted file mode 100644 index a3aaa2e7..00000000 --- a/src/resolution.rs +++ /dev/null @@ -1,92 +0,0 @@ -use crate::package_json::PackageJson; -use std::{ - fmt, - path::{Path, PathBuf}, - sync::Arc, -}; - -/// The final path resolution with optional `?query` and `#fragment` -#[derive(Clone)] -pub struct Resolution { - pub(crate) path: PathBuf, - - /// path query `?query`, contains `?`. - pub(crate) query: Option, - - /// path fragment `#query`, contains `#`. - pub(crate) fragment: Option, - - pub(crate) package_json: Option>, -} - -impl fmt::Debug for Resolution { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - f.debug_struct("Resolution") - .field("path", &self.path) - .field("query", &self.query) - .field("fragment", &self.fragment) - .field("package_json", &self.package_json.as_ref().map(|p| &p.path)) - .finish() - } -} - -impl PartialEq for Resolution { - fn eq(&self, other: &Self) -> bool { - self.path == other.path && self.query == other.query && self.fragment == other.fragment - } -} -impl Eq for Resolution {} - -impl Resolution { - /// Returns the path without query and fragment - pub fn path(&self) -> &Path { - &self.path - } - - /// Returns the path without query and fragment - pub fn into_path_buf(self) -> PathBuf { - self.path - } - - /// Returns the path query `?query`, contains the leading `?` - pub fn query(&self) -> Option<&str> { - self.query.as_deref() - } - - /// Returns the path fragment `#fragment`, contains the leading `#` - pub fn fragment(&self) -> Option<&str> { - self.fragment.as_deref() - } - - /// Returns serialized package_json - pub fn package_json(&self) -> Option<&Arc> { - self.package_json.as_ref() - } - - /// Returns the full path with query and fragment - pub fn full_path(&self) -> PathBuf { - let mut path = self.path.clone().into_os_string(); - if let Some(query) = &self.query { - path.push(query); - } - if let Some(fragment) = &self.fragment { - path.push(fragment); - } - PathBuf::from(path) - } -} - -#[test] -fn test() { - let resolution = Resolution { - path: PathBuf::from("foo"), - query: Some("?query".to_string()), - fragment: Some("#fragment".to_string()), - package_json: None, - }; - assert_eq!(resolution.path(), Path::new("foo")); - assert_eq!(resolution.query(), Some("?query")); - assert_eq!(resolution.fragment(), Some("#fragment")); - assert_eq!(resolution.full_path(), PathBuf::from("foo?query#fragment")); - assert_eq!(resolution.into_path_buf(), PathBuf::from("foo")); -} diff --git a/src/specifier.rs b/src/specifier.rs deleted file mode 100644 index 3d35eafc..00000000 --- a/src/specifier.rs +++ /dev/null @@ -1,230 +0,0 @@ -use crate::error::SpecifierError; -use std::borrow::Cow; - -#[derive(Debug)] -pub struct Specifier<'a> { - path: Cow<'a, str>, - pub query: Option<&'a str>, - pub fragment: Option<&'a str>, -} - -impl<'a> Specifier<'a> { - pub fn path(&'a self) -> &'a str { - self.path.as_ref() - } - - pub fn parse(specifier: &'a str) -> Result, SpecifierError> { - if specifier.is_empty() { - return Err(SpecifierError::Empty(specifier.to_string())); - } - let offset = match specifier.as_bytes()[0] { - b'/' | b'.' | b'#' => 1, - _ => 0, - }; - let (path, query, fragment) = Self::parse_query_framgment(specifier, offset); - if path.is_empty() { - return Err(SpecifierError::Empty(specifier.to_string())); - } - Ok(Self { path, query, fragment }) - } - - fn parse_query_framgment( - specifier: &'a str, - skip: usize, - ) -> (Cow<'a, str>, Option<&str>, Option<&str>) { - let mut query_start: Option = None; - let mut fragment_start: Option = None; - - let mut prev = specifier.chars().next().unwrap(); - let mut escaped_indexes = vec![]; - for (i, c) in specifier.char_indices().skip(skip) { - if c == '?' && query_start.is_none() { - query_start = Some(i); - } - if c == '#' { - if prev == '\0' { - escaped_indexes.push(i - 1); - } else { - fragment_start = Some(i); - break; - } - } - prev = c; - } - - let (path, query, fragment) = match (query_start, fragment_start) { - (Some(i), Some(j)) => { - debug_assert!(i < j); - (&specifier[..i], Some(&specifier[i..j]), Some(&specifier[j..])) - } - (Some(i), None) => (&specifier[..i], Some(&specifier[i..]), None), - (None, Some(j)) => (&specifier[..j], None, Some(&specifier[j..])), - _ => (specifier, None, None), - }; - - let path = if escaped_indexes.is_empty() { - Cow::Borrowed(path) - } else { - // Remove the `\0` characters for a legal path. - Cow::Owned( - path.chars() - .enumerate() - .filter_map(|(i, c)| (!escaped_indexes.contains(&i)).then_some(c)) - .collect::(), - ) - }; - - (path, query, fragment) - } -} - -#[cfg(test)] -mod tests { - use super::{Specifier, SpecifierError}; - - #[test] - fn debug() { - let specifier = Specifier::parse("/").unwrap(); - assert_eq!( - format!("{specifier:?}"), - r#"Specifier { path: "/", query: None, fragment: None }"# - ); - } - - #[test] - fn empty() { - let specifiers = ["", "?"]; - for specifier in specifiers { - let error = Specifier::parse(specifier).unwrap_err(); - assert_eq!(error, SpecifierError::Empty(specifier.to_string())); - } - } - - #[test] - fn absolute() -> Result<(), SpecifierError> { - let specifier = "/test?#"; - let parsed = Specifier::parse(specifier)?; - assert_eq!(parsed.path, "/test"); - assert_eq!(parsed.query, Some("?")); - assert_eq!(parsed.fragment, Some("#")); - Ok(()) - } - - #[test] - fn relative() -> Result<(), SpecifierError> { - let specifiers = ["./test", "../test", "../../test"]; - for specifier in specifiers { - let mut r = specifier.to_string(); - r.push_str("?#"); - let parsed = Specifier::parse(&r)?; - assert_eq!(parsed.path, specifier); - assert_eq!(parsed.query, Some("?")); - assert_eq!(parsed.fragment, Some("#")); - } - Ok(()) - } - - #[test] - fn hash() -> Result<(), SpecifierError> { - let specifiers = ["#", "#path"]; - for specifier in specifiers { - let mut r = specifier.to_string(); - r.push_str("?#"); - let parsed = Specifier::parse(&r)?; - assert_eq!(parsed.path, specifier); - assert_eq!(parsed.query, Some("?")); - assert_eq!(parsed.fragment, Some("#")); - } - Ok(()) - } - - #[test] - fn module() -> Result<(), SpecifierError> { - let specifiers = ["module"]; - for specifier in specifiers { - let mut r = specifier.to_string(); - r.push_str("?#"); - let parsed = Specifier::parse(&r)?; - assert_eq!(parsed.path, specifier); - assert_eq!(parsed.query, Some("?")); - assert_eq!(parsed.fragment, Some("#")); - } - Ok(()) - } - - #[test] - fn query_fragment() -> Result<(), SpecifierError> { - let data = [ - ("a?", Some("?"), None), - ("a?query", Some("?query"), None), - ("a?query1?query2", Some("?query1?query2"), None), - ("a?query1?query2?query3", Some("?query1?query2?query3"), None), - ("a#", None, Some("#")), - ("a#b#c", None, Some("#b#c")), - ("a#fragment", None, Some("#fragment")), - ("a?#", Some("?"), Some("#")), - ("a?#fragment", Some("?"), Some("#fragment")), - ("a?query#", Some("?query"), Some("#")), - ("a?query#fragment", Some("?query"), Some("#fragment")), - ("a#fragment?", None, Some("#fragment?")), - ("a#fragment?query", None, Some("#fragment?query")), - ]; - - for (specifier_str, query, fragment) in data { - let specifier = Specifier::parse(specifier_str)?; - assert_eq!(specifier.path, "a", "{specifier_str}"); - assert_eq!(specifier.query, query, "{specifier_str}"); - assert_eq!(specifier.fragment, fragment, "{specifier_str}"); - } - - Ok(()) - } - - #[test] - // https://github.com/webpack/enhanced-resolve/blob/main/test/identifier.test.js - fn enhanced_resolve_edge_cases() -> Result<(), SpecifierError> { - let data = [ - ("path/#", "path/", "", "#"), - ("path/as/?", "path/as/", "?", ""), - ("path/#/?", "path/", "", "#/?"), - ("path/#repo#hash", "path/", "", "#repo#hash"), - ("path/#r#hash", "path/", "", "#r#hash"), - ("path/#repo/#repo2#hash", "path/", "", "#repo/#repo2#hash"), - ("path/#r/#r#hash", "path/", "", "#r/#r#hash"), - ("path/#/not/a/hash?not-a-query", "path/", "", "#/not/a/hash?not-a-query"), - ]; - - for (specifier_str, path, query, fragment) in data { - let specifier = Specifier::parse(specifier_str)?; - assert_eq!(specifier.path, path, "{specifier_str}"); - assert_eq!(specifier.query.unwrap_or(""), query, "{specifier_str}"); - assert_eq!(specifier.fragment.unwrap_or(""), fragment, "{specifier_str}"); - } - - Ok(()) - } - - // https://github.com/webpack/enhanced-resolve/blob/main/test/identifier.test.js - #[test] - fn enhanced_resolve_windows_like() -> Result<(), SpecifierError> { - let data = [ - ("path\\#", "path\\", "", "#"), - ("path\\as\\?", "path\\as\\", "?", ""), - ("path\\#\\?", "path\\", "", "#\\?"), - ("path\\#repo#hash", "path\\", "", "#repo#hash"), - ("path\\#r#hash", "path\\", "", "#r#hash"), - ("path\\#repo\\#repo2#hash", "path\\", "", "#repo\\#repo2#hash"), - ("path\\#r\\#r#hash", "path\\", "", "#r\\#r#hash"), - ("path\\#/not/a/hash?not-a-query", "path\\", "", "#/not/a/hash?not-a-query"), - ]; - - for (specifier_str, path, query, fragment) in data { - let specifier = Specifier::parse(specifier_str)?; - assert_eq!(specifier.path, path, "{specifier_str}"); - assert_eq!(specifier.query.unwrap_or(""), query, "{specifier_str}"); - assert_eq!(specifier.fragment.unwrap_or(""), fragment, "{specifier_str}"); - } - - Ok(()) - } -} diff --git a/src/tests/alias.rs b/src/tests/alias.rs deleted file mode 100644 index 07c615f4..00000000 --- a/src/tests/alias.rs +++ /dev/null @@ -1,280 +0,0 @@ -//! - -use normalize_path::NormalizePath; -use std::path::Path; - -use crate::{AliasValue, Resolution, ResolveContext, ResolveError, ResolveOptions, Resolver}; - -#[test] -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -fn alias() { - use super::memory_fs::MemoryFS; - use crate::ResolverGeneric; - use std::path::{Path, PathBuf}; - - let f = Path::new("/"); - - let file_system = MemoryFS::new(&[ - ("/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", ""), - ("/dashed-name", ""), - ]); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - alias: vec![ - ("aliasA".into(), vec![AliasValue::from("a")]), - ("b$".into(), vec![AliasValue::from("a/index")]), - ("c$".into(), vec![AliasValue::from("/a/index")]), - ( - "multiAlias".into(), - vec![ - AliasValue::from("b"), - AliasValue::from("c"), - AliasValue::from("d"), - AliasValue::from("e"), - AliasValue::from("a"), - ], - ), - ("recursive".into(), vec![AliasValue::from("recursive/dir")]), - ("/d/dir".into(), vec![AliasValue::from("/c/dir")]), - ("/d/index.js".into(), vec![AliasValue::from("/c/index")]), - ("#".into(), vec![AliasValue::from("/c/dir")]), - ("@".into(), vec![AliasValue::from("/c/dir")]), - ("ignored".into(), vec![AliasValue::Ignore]), - // not part of enhanced-resolve, added to make sure query in alias value works - ("alias_query".into(), vec![AliasValue::from("a?query_after")]), - ("alias_fragment".into(), vec![AliasValue::from("a#fragment_after")]), - ("dash".into(), vec![AliasValue::Ignore]), - ("@scope/package-name/file$".into(), vec![AliasValue::from("/c/dir")]), - ], - modules: vec!["/".into()], - ..ResolveOptions::default() - }, - ); - - #[rustfmt::skip] - let pass = [ - ("should resolve a not aliased module 1", "a", "/a/index"), - ("should resolve a not aliased module 2", "a/index", "/a/index"), - ("should resolve a not aliased module 3", "a/dir", "/a/dir/index"), - ("should resolve a not aliased module 4", "a/dir/index", "/a/dir/index"), - ("should resolve an aliased module 1", "aliasA", "/a/index"), - ("should resolve an aliased module 2", "aliasA/index", "/a/index"), - ("should resolve an aliased module 3", "aliasA/dir", "/a/dir/index"), - ("should resolve an aliased module 4", "aliasA/dir/index", "/a/dir/index"), - ("should resolve '#' alias 1", "#", "/c/dir/index"), - ("should resolve '#' alias 2", "#/index", "/c/dir/index"), - ("should resolve '@' alias 1", "@", "/c/dir/index"), - ("should resolve '@' alias 2", "@/index", "/c/dir/index"), - ("should resolve a recursive aliased module 1", "recursive", "/recursive/dir/index"), - ("should resolve a recursive aliased module 2", "recursive/index", "/recursive/dir/index"), - ("should resolve a recursive aliased module 3", "recursive/dir", "/recursive/dir/index"), - ("should resolve a recursive aliased module 4", "recursive/dir/index", "/recursive/dir/index"), - ("should resolve a file aliased module 1", "b", "/a/index"), - ("should resolve a file aliased module 2", "c", "/a/index"), - ("should resolve a file aliased module with a query 1", "b?query", "/a/index?query"), - ("should resolve a file aliased module with a query 2", "c?query", "/a/index?query"), - ("should resolve a path in a file aliased module 1", "b/index", "/b/index"), - ("should resolve a path in a file aliased module 2", "b/dir", "/b/dir/index"), - ("should resolve a path in a file aliased module 3", "b/dir/index", "/b/dir/index"), - ("should resolve a path in a file aliased module 4", "c/index", "/c/index"), - ("should resolve a path in a file aliased module 5", "c/dir", "/c/dir/index"), - ("should resolve a path in a file aliased module 6", "c/dir/index", "/c/dir/index"), - ("should resolve a file aliased file 1", "d", "/c/index"), - ("should resolve a file aliased file 2", "d/dir/index", "/c/dir/index"), - ("should resolve a file in multiple aliased dirs 1", "multiAlias/dir/file", "/e/dir/file"), - ("should resolve a file in multiple aliased dirs 2", "multiAlias/anotherDir", "/e/anotherDir/index"), - // not part of enhanced-resolve, added to make sure query in alias value works - ("should resolve query in alias value", "alias_query?query_before", "/a/index?query_after"), - ("should resolve query in alias value", "alias_fragment#fragment_before", "/a/index#fragment_after"), - ("should resolve dashed name", "dashed-name", "/dashed-name"), - ("should resolve scoped package name with sub dir", "@scope/package-name/file", "/c/dir/index"), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - - #[rustfmt::skip] - let ignore = [ - ("should resolve an ignore module", "ignored", ResolveError::Ignored(f.join("ignored"))) - ]; - - for (comment, request, expected) in ignore { - let resolution = resolver.resolve(f, request); - assert_eq!(resolution, Err(expected), "{comment} {request}"); - } -} - -// Not part of enhanced-resolve -#[test] -fn infinite_recursion() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![ - ("./a".into(), vec![AliasValue::from("./b")]), - ("./b".into(), vec![AliasValue::from("./a")]), - ], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(f, "./a"); - assert_eq!(resolution, Err(ResolveError::Recursion)); -} - -fn check_slash(path: &Path) { - let s = path.to_string_lossy().to_string(); - #[cfg(target_os = "windows")] - { - assert!(!s.contains('/'), "{s}"); - assert!(s.contains('\\'), "{s}"); - } - #[cfg(not(target_os = "windows"))] - { - assert!(s.contains('/'), "{s}"); - assert!(!s.contains('\\'), "{s}"); - } -} - -#[test] -fn absolute_path() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![(f.join("foo").to_str().unwrap().to_string(), vec![AliasValue::Ignore])], - modules: vec![f.clone().to_str().unwrap().to_string()], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(&f, "foo/index"); - assert_eq!(resolution, Err(ResolveError::Ignored(f.join("foo")))); -} - -#[test] -fn system_path() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![("@app".into(), vec![AliasValue::from(f.join("alias").to_string_lossy())])], - ..ResolveOptions::default() - }); - - let specifiers = ["@app/files/a", "@app/files/a.js"]; - - for specifier in specifiers { - let path = resolver.resolve(&f, specifier).map(Resolution::into_path_buf).unwrap(); - assert_eq!(path, f.join("alias/files/a.js")); - check_slash(&path); - } -} - -#[test] -fn alias_is_full_path() { - let f = super::fixture(); - let dir = f.join("foo"); - let dir_str = dir.to_string_lossy().to_string(); - - let resolver = Resolver::new(ResolveOptions { - alias: vec![("@".into(), vec![AliasValue::Path(dir_str.clone())])], - ..ResolveOptions::default() - }); - - let mut ctx = ResolveContext::default(); - - let specifiers = [ - "@/index".to_string(), - "@/index.js".to_string(), - // specifier has multiple `/` for reasons we'll never know - "@////index".to_string(), - // specifier is a full path - dir_str, - ]; - - for specifier in specifiers { - let resolution = resolver.resolve_with_context(&f, &specifier, &mut ctx); - assert_eq!(resolution.map(|r| r.full_path()), Ok(dir.join("index.js"))); - } - - for path in ctx.file_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - check_slash(&path); - } - - for path in ctx.missing_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - check_slash(&path); - if let Some(path) = path.parent() { - assert!(!path.is_file(), "{path:?} must not be a file"); - } - } -} - -// For the `should_stop` variable in `load_alias` -#[test] -fn all_alias_values_are_not_found() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![( - "m1".to_string(), - vec![AliasValue::Path(f.join("node_modules").join("m2").to_string_lossy().to_string())], - )], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(&f, "m1/a.js"); - assert_eq!(resolution, Err(ResolveError::NotFound("m1/a.js".to_string()))); -} - -#[test] -fn alias_fragment() { - let f = super::fixture(); - - let data = [ - // enhanced-resolve has `#` prepended with a `\0`, they are removed from the - // following 3 expected test results. - // See https://github.com/webpack/enhanced-resolve#escaping - ( - "handle fragment edge case (no fragment)", - "./no#fragment/#/#", - f.join("no#fragment/#/#.js"), - ), - ("handle fragment edge case (fragment)", "./no#fragment/#/", f.join("no.js#fragment/#/")), - ( - "handle fragment escaping", - "./no\0#fragment/\0#/\0##fragment", - f.join("no#fragment/#/#.js#fragment"), - ), - ]; - - for (comment, request, expected) in data { - let resolver = Resolver::new(ResolveOptions { - alias: vec![("foo".to_string(), vec![AliasValue::Path(request.to_string())])], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f, "foo").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } -} - -#[test] -fn alias_try_fragment_as_path() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![( - "#".to_string(), - vec![AliasValue::Path(f.join("#").to_string_lossy().to_string())], - )], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(&f, "#/a").map(|r| r.full_path()); - assert_eq!(resolution, Ok(f.join("#").join("a.js"))); -} diff --git a/src/tests/browser_field.rs b/src/tests/browser_field.rs deleted file mode 100644 index 171ee099..00000000 --- a/src/tests/browser_field.rs +++ /dev/null @@ -1,189 +0,0 @@ -//! - -use crate::{AliasValue, ResolveError, ResolveOptions, Resolver}; - -#[test] -fn ignore() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![ - vec!["browser".into()], - vec!["innerBrowser1".into()], - vec!["innerBrowser2".into()], - vec![], - ], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - (f.clone(), "./lib/ignore", f.join("lib/ignore.js")), - (f.clone(), "./lib/ignore.js", f.join("lib/ignore.js")), - (f.join("lib"), "./ignore", f.join("lib/ignore.js")), - (f.join("lib"), "./ignore.js", f.join("lib/ignore.js")), - ]; - - for (path, request, expected) in data { - let resolution = resolver.resolve(&path, request); - let expected = ResolveError::Ignored(expected); - assert_eq!(resolution, Err(expected), "{path:?} {request}"); - } -} - -#[test] -fn shared_resolvers() { - let f = super::fixture().join("browser-module"); - - let resolver1 = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["innerBrowser1".into(), "field".into(), "browser".into()]], - ..ResolveOptions::default() - }); - let resolved_path = resolver1.resolve(&f, "./lib/main1.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("lib/main.js"))); - - let resolver2 = resolver1.clone_with_options(ResolveOptions { - alias_fields: vec![vec!["innerBrowser2".into(), "browser".into()]], - ..ResolveOptions::default() - }); - let resolved_path = resolver2.resolve(&f, "./lib/main2.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("./lib/replaced.js"))); -} - -#[test] -fn replace_file() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![ - vec!["browser".into()], - vec!["innerBrowser1".into(), "field2".into(), "browser".into()], // not presented - vec!["innerBrowser1".into(), "field".into(), "browser".into()], - vec!["innerBrowser2".into(), "browser".into()], - ], - // Not part of enhanced-resolve. Added to make sure no interaction between these two fields. - main_fields: vec!["browser".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - ("should replace a file 1", f.clone(), "./lib/replaced", f.join("lib/browser.js")), - ("should replace a file 2", f.clone(), "./lib/replaced.js", f.join("lib/browser.js")), - ("should replace a file 3", f.join("lib"), "./replaced", f.join("lib/browser.js")), - ("should replace a file 4", f.join("lib"), "./replaced.js", f.join("lib/browser.js")), - ("should replace a module with a file 1", f.clone(), "module-a", f.join("browser/module-a.js")), - ("should replace a module with a file 2", f.join("lib"), "module-a", f.join("browser/module-a.js")), - ("should replace a module with a module 1", f.clone(), "module-b", f.join("node_modules/module-c.js")), - ("should replace a module with a module 2", f.join("lib"), "module-b", f.join("node_modules/module-c.js")), - ("should resolve in nested property 1", f.clone(), "./lib/main1.js", f.join("lib/main.js")), - ("should resolve in nested property 2", f.clone(), "./lib/main2.js", f.join("lib/browser.js")), - ("should check only alias field properties", f.clone(), "./toString", f.join("lib/toString.js")), - // not part of enhanced-resolve - ("recursion", f.clone(), "module-c", f.join("node_modules/module-c.js")), - ("resolve self 1", f.clone(), "./lib/main.js", f.join("lib/main.js")), - ("resolve self 2", f.clone(), "./main.js", f.join("lib/main.js")), - ]; - - for (comment, path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn recurse_fail() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - ("recurse non existent", f.clone(), "./lib/non-existent.js", ResolveError::NotFound("./lib/non-existent.js".into())), - ("path partial match 1", f.clone(), "./xyz.js", ResolveError::NotFound("./xyz.js".into())), - ("path partial match 2", f, "./lib/xyz.js", ResolveError::NotFound("./lib/xyz.js".into())), - ]; - - for (comment, path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Err(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn broken() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - // The browser field string value should be ignored - (f.clone(), "browser-module-broken", Ok(f.join("node_modules/browser-module-broken/main.js"))), - (f.join("browser-module"), "./number", Err(ResolveError::NotFound("./number".into()))), - ]; - - for (path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, expected, "{path:?} {request}"); - } -} - -#[test] -fn crypto_js() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - fallback: vec![( - "crypto".into(), - vec![AliasValue::from(f.join("lib.js").to_string_lossy())], - )], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(f.join("crypto-js"), "crypto").map(|r| r.full_path()); - assert_eq!(resolved_path, Err(ResolveError::Ignored(f.join("crypto-js")))); -} - -// https://github.com/webpack/webpack/blob/87660921808566ef3b8796f8df61bd79fc026108/test/cases/resolving/browser-field/index.js#L40-L43 -#[test] -fn recursive() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - let data = [ - ("should handle recursive file 1", f.clone(), "recursive-file/a"), - ("should handle recursive file 2", f.clone(), "recursive-file/b"), - ("should handle recursive file 3", f.clone(), "recursive-file/c"), - ("should handle recursive file 4", f, "recursive-file/d"), - ]; - - for (comment, path, request) in data { - let resolved_path = resolver.resolve(&path, request); - assert_eq!(resolved_path, Err(ResolveError::Recursion), "{comment} {path:?} {request}"); - } -} - -#[test] -fn with_query() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "./foo").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("lib").join("browser.js?query"))); -} diff --git a/src/tests/builtins.rs b/src/tests/builtins.rs deleted file mode 100644 index 5d6d14d9..00000000 --- a/src/tests/builtins.rs +++ /dev/null @@ -1,121 +0,0 @@ -use std::path::Path; - -use crate::{ResolveError, ResolveOptions, Resolver}; - -#[test] -fn builtins_off() { - let f = Path::new("/"); - let resolver = Resolver::default(); - let resolved_path = resolver.resolve(f, "zlib").map(|r| r.full_path()); - assert_eq!(resolved_path, Err(ResolveError::NotFound("zlib".into()))); -} - -#[test] -fn builtins() { - let f = Path::new("/"); - - let resolver = Resolver::new(ResolveOptions::default().with_builtin_modules(true)); - - let pass = [ - "_http_agent", - "_http_client", - "_http_common", - "_http_incoming", - "_http_outgoing", - "_http_server", - "_stream_duplex", - "_stream_passthrough", - "_stream_readable", - "_stream_transform", - "_stream_wrap", - "_stream_writable", - "_tls_common", - "_tls_wrap", - "assert", - "assert/strict", - "async_hooks", - "buffer", - "child_process", - "cluster", - "console", - "constants", - "crypto", - "dgram", - "diagnostics_channel", - "dns", - "dns/promises", - "domain", - "events", - "fs", - "fs/promises", - "http", - "http2", - "https", - "inspector", - "module", - "net", - "os", - "path", - "path/posix", - "path/win32", - "perf_hooks", - "process", - "punycode", - "querystring", - "readline", - "repl", - "stream", - "stream/consumers", - "stream/promises", - "stream/web", - "string_decoder", - "sys", - "timers", - "timers/promises", - "tls", - "trace_events", - "tty", - "url", - "util", - "util/types", - "v8", - "vm", - "worker_threads", - "zlib", - ]; - - for request in pass { - let prefixed_request = format!("node:{request}"); - for request in [prefixed_request.clone(), request.to_string()] { - let resolved_path = resolver.resolve(f, &request).map(|r| r.full_path()); - let err = ResolveError::Builtin(prefixed_request.clone()); - assert_eq!(resolved_path, Err(err), "{request}"); - } - } -} - -#[test] -fn fail() { - let f = Path::new("/"); - let resolver = Resolver::new(ResolveOptions::default().with_builtin_modules(true)); - let request = "xxx"; - let resolved_path = resolver.resolve(f, request); - let err = ResolveError::NotFound(request.to_string()); - assert_eq!(resolved_path, Err(err), "{request}"); -} - -#[test] -fn imports() { - let f = super::fixture().join("builtins"); - let resolver = Resolver::new(ResolveOptions { - builtin_modules: true, - condition_names: vec!["node".into()], - ..ResolveOptions::default() - }); - - for request in ["#fs", "#http"] { - let resolved_path = resolver.resolve(f.clone(), request).map(|r| r.full_path()); - let err = ResolveError::Builtin(format!("node:{}", request.trim_start_matches('#'))); - assert_eq!(resolved_path, Err(err)); - } -} diff --git a/src/tests/dependencies.rs b/src/tests/dependencies.rs deleted file mode 100644 index bcc2355b..00000000 --- a/src/tests/dependencies.rs +++ /dev/null @@ -1,110 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/dependencies.test.js - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows { - use rustc_hash::FxHashSet; - use std::path::PathBuf; - - use crate::{ResolveContext, ResolveOptions, ResolverGeneric}; - - use super::super::memory_fs::MemoryFS; - - fn file_system() -> MemoryFS { - MemoryFS::new(&[ - ("/a/b/node_modules/some-module/index.js", ""), - ("/a/node_modules/module/package.json", r#"{"main":"entry.js"}"#), - ("/a/node_modules/module/file.js", r#"{"main":"entry.js"}"#), - ("/modules/other-module/file.js", ""), - ]) - } - - #[test] - fn test() { - let file_system = file_system(); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - extensions: vec![".json".into(), ".js".into()], - modules: vec!["/modules".into(), "node_modules".into()], - ..ResolveOptions::default() - }, - ); - - let data = [ - ( - "middle module request", - "/a/b/c", - "module/file", - "/a/node_modules/module/file.js", - // These dependencies are different from enhanced-resolve due to different code path to - // querying the file system - vec![ - // 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", - // "/", - ], - vec![ - // missing package.jsons - // "/a/b/c/package.json", - "/a/b/package.json", - "/a/package.json", - "/package.json", - // missing modules directories - "/a/b/c", - // "/a/b/c/node_modules", - // missing single file modules - "/modules/module", - "/a/b/node_modules/module", - // missing files with alternative extensions - "/a/node_modules/module/file", - "/a/node_modules/module/file.json", - ], - ), - ( - "fast found module", - "/a/b/c", - "other-module/file.js", - "/modules/other-module/file.js", - // These dependencies are different from enhanced-resolve due to different code path to - // querying the file system - vec![ - // symlink checks - "/modules/other-module/file.js", - // "/modules/other-module", - // "/modules", - // "/", - ], - vec![ - // missing package.jsons - // "/a/b/c/package.json", - "/a/b/c", - "/a/b/package.json", - "/a/package.json", - "/package.json", - "/modules/other-module/package.json", - "/modules/package.json", - ], - ), - ]; - - for (name, context, request, result, file_dependencies, missing_dependencies) in data { - let mut ctx = ResolveContext::default(); - let path = PathBuf::from(context); - let resolved = - resolver.resolve_with_context(path, request, &mut ctx).map(|r| r.full_path()); - assert_eq!(resolved, Ok(PathBuf::from(result))); - let file_dependencies = - FxHashSet::from_iter(file_dependencies.iter().map(PathBuf::from)); - let missing_dependencies = - FxHashSet::from_iter(missing_dependencies.iter().map(PathBuf::from)); - assert_eq!(ctx.file_dependencies, file_dependencies, "{name}"); - assert_eq!(ctx.missing_dependencies, missing_dependencies, "{name}"); - } - } -} diff --git a/src/tests/exports_field.rs b/src/tests/exports_field.rs deleted file mode 100644 index fd68c1f7..00000000 --- a/src/tests/exports_field.rs +++ /dev/null @@ -1,2546 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/exportsField.test.js -//! -//! The huge exports field test cases are at the bottom of this file. - -use crate::{Ctx, PathUtil, ResolveError, ResolveOptions, Resolver}; -use serde_json::json; -use std::path::Path; - -#[test] -fn test_simple() { - let f = super::fixture().join("exports-field"); - let f2 = super::fixture().join("exports-field2"); - let f4 = super::fixture().join("exports-field-error"); - let f5 = super::fixture().join("imports-exports-wildcard"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - fully_specified: true, - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("resolve root using exports field, not a main field", f.clone(), "exports-field", f.join("node_modules/exports-field/x.js")), - ("resolver should respect condition names", f.clone(), "exports-field/dist/main.js", f.join("node_modules/exports-field/lib/lib2/main.js")), - // enhanced_resolve behaves differently to node.js. enhanced_resolve fallbacks when an - // array item is unresolved, where as node.js fallbacks when an array has an - // InvalidPackageTarget error. - // ("resolver should respect fallback", f2.clone(), "exports-field/dist/browser.js", f2.join("node_modules/exports-field/lib/browser.js")), - // The following two tests require fallback from array values, the path is changed here to - // only test query and fragment. - ("resolver should respect query parameters #1", f2.clone(), "exports-field/dist/main.js?foo", f2.join("node_modules/exports-field/lib/lib2/main.js?foo")), - ("resolver should respect fragment parameters #1", f2.clone(), "exports-field/dist/main.js#foo", f2.join("node_modules/exports-field/lib/lib2/main.js#foo")), - ("relative path should work, if relative path as request is used", f.clone(), "./node_modules/exports-field/lib/main.js", f.join("node_modules/exports-field/lib/main.js")), - ("self-resolving root", f.clone(), "@exports-field/core", f.join("a.js")), - ("should resolve with wildcard pattern #1", f5.clone(), "m/features/f.js", f5.join("node_modules/m/src/features/f.js")), - ("should resolve with wildcard pattern #2", f5.clone(), "m/features/y/y.js", f5.join("node_modules/m/src/features/y/y.js")), - ("should resolve with wildcard pattern #3", f5.clone(), "m/features-no-ext/y/y.js", f5.join("node_modules/m/src/features/y/y.js")), - ("should resolve with wildcard pattern #4", f5.clone(), "m/middle/nested/f.js", f5.join("node_modules/m/src/middle/nested/f.js")), - ("should resolve with wildcard pattern #5", f5.clone(), "m/middle-1/nested/f.js", f5.join("node_modules/m/src/middle-1/nested/f.js")), - ("should resolve with wildcard pattern #6", f5.clone(), "m/middle-2/nested/f.js", f5.join("node_modules/m/src/middle-2/nested/f.js")), - ("should resolve with wildcard pattern #7", f5.clone(), "m/middle-3/nested/f", f5.join("node_modules/m/src/middle-3/nested/f/nested/f.js")), - ("should resolve with wildcard pattern #8", f5.clone(), "m/middle-4/f/nested", f5.join("node_modules/m/src/middle-4/f/f.js")), - ("should resolve with wildcard pattern #9", f5.clone(), "m/middle-5/f$/$", f5.join("node_modules/m/src/middle-5/f$/$.js")), - ]; - - // Not needed or snapshot: - // * should log the correct info - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } - - let p = f.join("node_modules/exports-field/package.json"); - let p2 = f2.join("node_modules/exports-field/package.json"); - let p4 = f4.join("node_modules/exports-field/package.json"); - let p5 = f5.join("node_modules/m/package.json"); - - #[rustfmt::skip] - let fail = [ - // ("throw error if extension not provided", f2.clone(), "exports-field/dist/main", ResolveError::NotFound(f2.join("node_modules/exports-field/lib/lib2/main"))), - ("resolver should respect query parameters #2. Direct matching", f2.clone(), "exports-field?foo", ResolveError::PackagePathNotExported("./?foo".into(), p2.clone())), - ("resolver should respect fragment parameters #2. Direct matching", f2, "exports-field#foo", ResolveError::PackagePathNotExported("./#foo".into(), p2)), - ("relative path should not work with exports field", f.clone(), "./node_modules/exports-field/dist/main.js", ResolveError::NotFound("./node_modules/exports-field/dist/main.js".into())), - ("backtracking should not work for request", f.clone(), "exports-field/dist/../../../a.js", ResolveError::InvalidPackageTarget("./lib/../../../a.js".to_string(), "./dist/".to_string(), p.clone())), - ("backtracking should not work for exports field target", f.clone(), "exports-field/dist/a.js", ResolveError::InvalidPackageTarget("./../../a.js".to_string(), "./dist/a.js".to_string(), p.clone())), - ("not exported error", f.clone(), "exports-field/anything/else", ResolveError::PackagePathNotExported("./anything/else".to_string(), p.clone())), - ("request ending with slash #1", f.clone(), "exports-field/", ResolveError::PackagePathNotExported("./".to_string(), p.clone())), - ("request ending with slash #2", f.clone(), "exports-field/dist/", ResolveError::PackagePathNotExported("./dist/".to_string(), p.clone())), - ("request ending with slash #3", f.clone(), "exports-field/lib/", ResolveError::PackagePathNotExported("./lib/".to_string(), p)), - ("should throw error if target is invalid", f4, "exports-field", ResolveError::InvalidPackageTarget("./a/../b/../../pack1/index.js".to_string(), ".".to_string(), p4)), - ("throw error if exports field is invalid", f.clone(), "invalid-exports-field", ResolveError::InvalidPackageConfig(f.join("node_modules/invalid-exports-field/package.json"))), - ("should throw error if target is 'null'", f5, "m/features/internal/file.js", ResolveError::PackagePathNotExported("./features/internal/file.js".to_string(), p5)), - ]; - - for (comment, path, request, error) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!(resolution, Err(error), "{comment} {path:?} {request}"); - } -} - -// resolve using exports field, not a browser field #1 -#[test] -fn exports_not_browser_field1() { - let f = super::fixture().join("exports-field"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - condition_names: vec!["webpack".into()], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "exports-field/dist/main.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("node_modules/exports-field/lib/lib2/main.js"))); -} - -// resolve using exports field and a browser alias field #2 -#[test] -fn exports_not_browser_field2() { - let f2 = super::fixture().join("exports-field2"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - extensions: vec![".js".into()], - condition_names: vec!["node".into()], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f2, "exports-field/dist/main.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f2.join("node_modules/exports-field/lib/browser.js"))); -} - -// should resolve extension without fullySpecified -#[test] -fn extension_without_fully_specified() { - let f2 = super::fixture().join("exports-field2"); - - let commonjs_resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - let resolved_path = - commonjs_resolver.resolve(&f2, "exports-field/dist/main").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f2.join("node_modules/exports-field/lib/lib2/main.js"))); -} - -#[test] -fn field_name_path() { - let f2 = super::fixture().join("exports-field2"); - let f3 = super::fixture().join("exports-field3"); - - // field name path #1 #2 #3 - let exports_fields = [ - vec![vec!["exportsField".into(), "exports".into()]], - vec![vec!["exportsField".into(), "exports".into()], vec!["exports".into()]], - vec![vec!["exports".into()], vec!["exportsField".into(), "exports".into()]], - ]; - - for exports_fields in exports_fields { - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - exports_fields, - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/main.js"))); - } - - // field name path #4 - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - exports_fields: vec![vec!["exports".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f2, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f2.join("node_modules/exports-field/index.js"))); - - // field name path #5 - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - exports_fields: vec![vec!["ex".into()], vec!["exports_field".into(), "exports".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/index"))); - - // non-compliant export targeting a directory - let resolver = Resolver::new(ResolveOptions { - exports_fields: vec![vec!["broken".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/src/index.js"))); -} - -#[test] -fn shared_resolvers() { - let f3 = super::fixture().join("exports-field3"); - - let resolver1 = Resolver::new(ResolveOptions { - exports_fields: vec![vec!["exportsField".into(), "exports".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver1.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/main.js"))); - - let resolver2 = resolver1.clone_with_options(ResolveOptions { - exports_fields: vec![vec!["ex".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver2.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/index"))); -} - -#[test] -fn extension_alias_1_2() { - let f = super::fixture().join("exports-field-and-extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - extension_alias: vec![(".js".into(), vec![".ts".into(), ".js".into()])], - fully_specified: true, - condition_names: vec!["webpack".into(), "default".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve with the `extensionAlias` option", f.clone(), "@org/pkg/string.js", f.join("node_modules/@org/pkg/dist/string.js")), - ("should resolve with the `extensionAlias` option #2", f.clone(), "pkg/string.js", f.join("node_modules/pkg/dist/string.js")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn extension_alias_3() { - let f = super::fixture().join("exports-field-and-extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - extension_alias: vec![( - ".js".into(), - vec![".foo".into(), ".baz".into(), ".baz".into(), ".ts".into(), ".js".into()], - )], - fully_specified: true, - condition_names: vec!["webpack".into(), "default".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve with the `extensionAlias` option #3", f.clone(), "pkg/string.js", f.join("node_modules/pkg/dist/string.js")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn extension_alias_throw_error() { - let f = super::fixture().join("exports-field-and-extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - extension_alias: vec![(".js".into(), vec![".ts".into()])], - fully_specified: true, - condition_names: vec!["webpack".into(), "default".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let fail = [ - // enhanced-resolve has two test cases that are exactly the same here - // https://github.com/webpack/enhanced-resolve/blob/a998c7d218b7a9ec2461fc4fddd1ad5dd7687485/test/exportsField.test.js#L2976-L3024 - ("should throw error with the `extensionAlias` option", f, "pkg/string.js", ResolveError::ExtensionAlias), - // TODO: The error is PackagePathNotExported in enhanced-resolve - // ("should throw error with the `extensionAlias` option", f.clone(), "pkg/string.js", ResolveError::PackagePathNotExported("node_modules/pkg/dist/string.ts".to_string())), - ]; - - for (comment, path, request, error) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!(resolution, Err(error), "{comment} {path:?} {request}"); - } -} - -// Small script for generating the test cases from enhanced-resolve -// for (c of testCases) { -// console.log("TestCase {") -// console.log(`name: ${JSON.stringify(c.name)},`) -// if (c.expect instanceof Error) { -// console.log(`expect: None,`) -// } else { -// console.log(`expect: Some(vec!${JSON.stringify(c.expect)}),`) -// } -// console.log(`exports_field: exports_field(json!(${JSON.stringify(c.suite[0], null, 2)})),`) -// console.log(`request: "${c.suite[1]}",`) -// console.log(`condition_names: vec!${JSON.stringify(c.suite[2])},`) -// console.log("},") -//} -struct TestCase { - name: &'static str, - expect: Option>, - exports_field: serde_json::Value, - request: &'static str, - condition_names: Vec<&'static str>, -} - -#[allow(clippy::needless_pass_by_value)] -fn exports_field(value: serde_json::Value) -> serde_json::Value { - value -} - -#[test] -fn test_cases() { - let test_cases = [ - TestCase { - name: "sample #1", - expect: Some(vec!["./dist/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/": { - "import": [ - "./dist/", - "./src/" - ], - "webpack": "./wp/" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "sample #1", - expect: Some(vec!["./src/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/": { - "import": [ - "./src/" - ], - "webpack": "./wp/" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - TestCase { - name: "sample #1 (wildcard)", - expect: Some(vec!["./dist/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/*": { - "import": [ - "./dist/*", - "./src/*" - ], - "webpack": "./wp/*" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "sample #1 (wildcard)", - expect: Some(vec!["./src/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/*": { - "import": [ - "./src/*" - ], - "webpack": "./wp/*" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - TestCase { - name: "sample #2", - expect: Some(vec!["./data/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./timezones/": "./data/timezones/" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #2 (wildcard)", - expect: Some(vec!["./data/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./timezones/*": "./data/timezones/*" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #3", - expect: Some(vec!["./data/timezones/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./": "./data/timezones/" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #3 (wildcard)", - expect: Some(vec!["./data/timezones/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./*": "./data/timezones/*.mjs" - })), - request: "./timezones/pdt", - condition_names: vec![], - }, - TestCase { - name: "sample #4", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./lib/": { - "browser": [ - "./browser/" - ] - }, - "./dist/index.js": { - "node": "./index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #4 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "node": "./index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #5", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/": { - "browser": [ - "./browser/" - ] - }, - "./dist/index.js": { - "node": "./index.js", - "default": "./browser/index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #5 (wildcard)", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "node": "./index.js", - "default": "./browser/index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./dist/a": "./dist/index.js" - })), - request: "./dist/aaa", - condition_names: vec![], - }, - TestCase { - name: "sample #7", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./dist/a/a/": "./dist/index.js" - })), - request: "./dist/a/a", - condition_names: vec![], - }, - TestCase { - name: "sample #7 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./dist/a/a/*": "./dist/index.js" - })), - request: "./dist/a/a", - condition_names: vec![], - }, - TestCase { - name: "sample #8", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": "./index.js" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #9", - expect: Some(vec!["./main.js"]), - exports_field: exports_field(json!({ - "./index.js": "./main.js" - })), - request: "./index.js", - condition_names: vec![], - }, - TestCase { - name: "sample #10", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #11", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./bar#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #12", - expect: Some(vec!["./ok.js#abc"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/ok.js#abc", - condition_names: vec![], - }, - TestCase { - name: "sample #12", - expect: Some(vec!["./ok.js#abc"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/ok.js#abc", - condition_names: vec![], - }, - TestCase { - name: "sample #13", - expect: Some(vec!["./ok.js?abc"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/ok.js?abc", - condition_names: vec![], - }, - TestCase { - name: "sample #14", - expect: Some(vec!["./🎉.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/🎉.js", - condition_names: vec![], - }, - TestCase { - name: "sample #15", - expect: Some(vec!["./%F0%9F%8E%89.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/%F0%9F%8E%89.js", - condition_names: vec![], - }, - TestCase { - name: "sample #16", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./🎉", - condition_names: vec![], - }, - TestCase { - name: "sample #17", - expect: Some(vec!["./other.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./%F0%9F%8E%89", - condition_names: vec![], - }, - TestCase { - name: "sample #18", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./module", - condition_names: vec![], - }, - TestCase { - name: "sample #19", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./module#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #20", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./module?foo", - condition_names: vec![], - }, - TestCase { - name: "sample #21", - expect: Some(vec!["./zizizi"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./z*z*z*" - })), - request: "./#zippi", - condition_names: vec![], - }, - TestCase { - name: "sample #22", - expect: Some(vec!["./d?e?f"]), - exports_field: exports_field(json!({ - "./a?b?c/": "./" - })), - request: "./a?b?c/d?e?f", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #1", - expect: Some(vec!["./dist/index.js"]), - exports_field: exports_field(json!({ - ".": "./dist/index.js" - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #2", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./": "./", - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #3", - expect: Some(vec!["./dist/a.js"]), - exports_field: exports_field(json!({ - "./dist/": "./dist/", - "./dist/*": "./dist/*", - "./dist*": "./dist*", - "./dist/index.js": "./dist/a.js" - })), - request: "./dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #4", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./": { - "browser": [ - "./browser/" - ] - }, - "./*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "browser": "./index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #5", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./": { - "browser": [ - "./browser/" - ] - }, - "./*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "node": "./node.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #6", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - ".": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #7", - expect: Some(vec!["./src/index.js"]), // `enhanced_resolve` is `None` - exports_field: exports_field(json!({ - ".": { - "default": "./src/index.js", - "browser": "./index.js", - "node": "./src/node/index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #8", - expect: Some(vec!["./src/index.js"]), - exports_field: exports_field(json!({ - ".": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #9", - expect: Some(vec!["./index"]), - exports_field: exports_field(json!({ - ".": "./index" - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #10", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./index": "./index.js" - })), - request: "./index", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #11", - expect: Some(vec!["./foo.js"]), - exports_field: exports_field(json!({ - "./": "./", - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #12", - expect: Some(vec!["./foo/bar/baz.js"]), - exports_field: exports_field(json!({ - "./": "./", - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo/bar/baz.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #13", - expect: Some(vec!["./foo/bar/baz.js"]), - exports_field: exports_field(json!({ - "./": "./", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo/bar/baz.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #14", - expect: Some(vec!["./foo/bar/baz.js"]), - exports_field: exports_field(json!({ - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo/bar/baz.js", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #1", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "require": "./require.js" - }, { - "import": "./import.mjs" - }] - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #2", - expect: Some(vec!["./import.mjs"]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "require": "./require.js" - }, { - "import": "./import.mjs" - }] - })), - request: ".", - condition_names: vec!["import"], - }, - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./require.js"]), - exports_field: exports_field(json!({ - ".": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./import.mjs"]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "import": "./import.mjs" - }] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./require.js"]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "require": [ - "./require.js" - ] - }, { - "import": [ - "./import.mjs", - "./import.js" - ] - }] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./import.mjs"]), - exports_field: exports_field(json!({ - ".": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "./import.mjs", - "./import.js" - ] - } - ] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./import.js"]), - exports_field: exports_field(json!({ - ".": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "./import.js" - ] - } - ] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "mapping to a folder root #1", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./timezones": "./data/timezones/" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #2", - expect: None, - exports_field: exports_field(json!({ - "./timezones/": "./data/timezones" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #3", - expect: Some(vec!["./data/timezones/pdt/index.mjs"]), - exports_field: exports_field(json!({ - "./timezones/pdt/": "./data/timezones/pdt/" - })), - request: "./timezones/pdt/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #3 (wildcard)", - expect: Some(vec!["./data/timezones/pdt/index.mjs"]), - exports_field: exports_field(json!({ - "./timezones/pdt/*": "./data/timezones/pdt/*" - })), - request: "./timezones/pdt/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #4", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./": "./timezones/" - })), - request: "./pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #4 (wildcard)", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./*": "./timezones/*" - })), - request: "./pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #5", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./": "./" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #5 (wildcard)", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./*": "./*" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #6", - expect: None, - exports_field: exports_field(json!({ - "./": "." - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #6 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "./*": "." - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #7", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": "./" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #7 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": "./*" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #1", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./": "./", - "./dist/": "./lib/" - })), - request: "./dist/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #1 (wildcard)", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./*": "./*", - "./dist/*": "./lib/*" - })), - request: "./dist/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #2", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/": "./dist/utils/", - "./dist/": "./lib/" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #2 (wildcard)", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/*": "./dist/utils/*", - "./dist/*": "./lib/*" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #3", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/index.js": "./dist/utils/index.js", - "./dist/utils/": "./dist/utils/index.mjs", - "./dist/": "./lib/" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #3 (wildcard)", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/index.js": "./dist/utils/index.js", - "./dist/utils/*": "./dist/utils/index.mjs", - "./dist/*": "./lib/*" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #4", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./": { - "browser": "./browser/" - }, - "./dist/": "./lib/" - })), - request: "./dist/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "the longest matching path prefix is prioritized #4 (wildcard)", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./*": { - "browser": "./browser/*" - }, - "./dist/*": "./lib/*" - })), - request: "./dist/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #1", - // `lodash/` does not start with './' so fallbacks to util - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "conditional mapping folder #1", - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": [ - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #1 (wildcard)", - // `lodash/` does not start with './' so fallbacks to util - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": [ - "lodash/*", - "./utils/*" - ], - "node": [ - "./utils-node/*" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "conditional mapping folder #1 (wildcard)", - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": [ - "./utils/*" - ], - "node": [ - "./utils-node/*" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #2", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./node/" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "conditional mapping folder #2 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "webpack": "./wpk/*", - "browser": [ - "lodash/*", - "./utils/*" - ], - "node": [ - "./node/*" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "conditional mapping folder #3", - expect: Some(vec!["./wpk/index.mjs"]), - exports_field: exports_field(json!({ - "./utils/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils/" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "conditional mapping folder #3 (wildcard)", - expect: Some(vec!["./wpk/index.mjs"]), - exports_field: exports_field(json!({ - "./utils/*": { - "webpack": "./wpk/*", - "browser": [ - "lodash/*", - "./utils/*" - ], - "node": [ - "./utils/*" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "incorrect exports field #1", - expect: None, - exports_field: exports_field(json!({ - "/utils/": "./a/" - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #2", - expect: None, - exports_field: exports_field(json!({ - "./utils/": "/a/" - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #3", - expect: None, - exports_field: exports_field(json!({ - "/utils/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #4", - expect: None, - exports_field: exports_field(json!({ - "./utils/": { - "browser": "/a/", - "default": "/b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #4 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "/a/", - "default": "/b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #5", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index": "./a/index.js" - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index.mjs": "./a/index.js" - })), - request: "./utils/index", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #7", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #8", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index.mjs": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - // Requests that are not `./` does not apply to `package_exports_resolve` - // TestCase { - // name: "incorrect request #1", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": "./a/" - // })), - // request: "/utils/index.mjs", - // condition_names: vec![], - // }, - // TestCase { - // name: "incorrect request #2", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": { - // "browser": "./a/", - // "default": "./b/" - // } - // })), - // request: "/utils/index.mjs", - // condition_names: vec!["browser"], - // }, - // TestCase { - // name: "incorrect request #3", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": { - // "browser": "./a/", - // "default": "./b/" - // } - // })), - // request: "../utils/index.mjs", - // condition_names: vec!["browser"], - // }, - // TestCase { - // name: "incorrect request #4", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": { - // "browser": "./a/", - // "default": "./b/" - // } - // })), - // request: "/utils/index.mjs/", - // condition_names: vec!["browser"], - // }, - TestCase { - name: "backtracking package base #1", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./../../utils/": "./dist/" - })), - request: "./../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #1 (wildcard)", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./../../utils/*": "./dist/*" - })), - request: "./../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #2", - expect: None, - exports_field: exports_field(json!({ - "../../utils/": "./dist/" - })), - request: "../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #2 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "../../utils/*": "./dist/*" - })), - request: "../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #3", - expect: None, - exports_field: exports_field(json!({ - "./utils/": "../src/" - })), - request: "./utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #3 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "./utils/*": "../src/*" - })), - request: "./utils/index", - condition_names: vec![], - }, - // enhanced-resolve does not handle backtracking here - // TestCase { - // name: "backtracking package base #4", - // expect: Some(vec!["./../src/index"]), - // exports_field: exports_field(json!({ - // "./utils/": "./../src/" - // })), - // request: "./utils/index", - // condition_names: vec![], - // }, - // TestCase { - // name: "backtracking package base #4 (wildcard)", - // expect: Some(vec!["./../src/index"]), - // exports_field: exports_field(json!({ - // "./utils/*": "./../src/*" - // })), - // request: "./utils/index", - // condition_names: vec![], - // }, - // TestCase { - // name: "backtracking package base #5", - // expect: Some(vec!["./src/../index.js"]), - // exports_field: exports_field(json!({ - // "./utils/index": "./src/../index.js" - // })), - // request: "./utils/index", - // condition_names: vec![], - // }, - TestCase { - name: "backtracking package base #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/../utils/index": "./src/../index.js" - })), - request: "./utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #7", - expect: None, - exports_field: exports_field(json!({ - "./utils/": { - "browser": "../this/" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #7", - expect: None, - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "../this/*" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #8", - // We throw "InvalidPackageTarget" - // expect: Some(vec!["./utils/../index"]), - expect: None, - exports_field: exports_field(json!({ - "./utils/": { - "browser": "./utils/../" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #8 (wildcard)", - // We throw "InvalidPackageTarget" - // expect: Some(vec!["./utils/../index"]), - expect: None, - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "./utils/../*" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #9", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./": "./src/../../", - "./dist/": "./dist/" - })), - request: "./dist/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #9 (wildcard)", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./*": "./src/../../*", - "./dist/*": "./dist/*" - })), - request: "./dist/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking target folder #1", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../../index"]), - exports_field: exports_field(json!({ - "./utils/": "./dist/" - })), - request: "./utils/timezone/../../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #1 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../../index"]), - exports_field: exports_field(json!({ - "./utils/*": "./dist/*" - })), - request: "./utils/timezone/../../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #2", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../index"]), - exports_field: exports_field(json!({ - "./utils/": "./dist/" - })), - request: "./utils/timezone/../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #2 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../index"]), - exports_field: exports_field(json!({ - "./utils/*": "./dist/*" - })), - request: "./utils/timezone/../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #3", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/target/../../index"]), - exports_field: exports_field(json!({ - "./utils/": "./dist/target/" - })), - request: "./utils/../../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #3 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/target/../../index"]), - exports_field: exports_field(json!({ - "./utils/*": "./dist/target/*" - })), - request: "./utils/../../index", - condition_names: vec![], - }, - // enhanced-resolve does not handle `node_modules` in target - TestCase { - name: "nested node_modules path #1", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": "./node_modules/" - } - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #1 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "./node_modules/*" - } - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #2", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./utils/../node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/": "./utils/../node_modules/" - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "nested node_modules path #2 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./utils/../node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": "./utils/../node_modules/*" - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "nested mapping #1", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": "./", - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested mapping #1 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": "./*", - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "nested mapping #2 (wildcard)", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #2 (wildcard)", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "nested mapping #3", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["webpack"], - }, - TestCase { - name: "nested mapping #3 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["webpack"], - }, - TestCase { - name: "nested mapping #4", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["node", "browser"], - }, - TestCase { - name: "nested mapping #4 (wildcard)", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["node", "browser"], - }, - TestCase { - name: "nested mapping #5", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node"], - }, - TestCase { - name: "nested mapping #5 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": { - "webpack": [ - "./wpck/*" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node"], - }, - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - TestCase { - name: "nested mapping #6 (wildcard)", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": { - "webpack": [ - "./wpck/*" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #6 (wildcard)", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./node/*" - ], - "default": { - "node": { - "webpack": [ - "./wpck/*" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - TestCase { - name: "nested mapping #7", - expect: Some(vec!["./y.js"]), - exports_field: exports_field(json!({ - "./a.js": { - "abc": { - "def": "./x.js" - }, - "ghi": "./y.js" - } - })), - request: "./a.js", - condition_names: vec!["abc", "ghi"], - }, - TestCase { - name: "nested mapping #8", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./a.js": { - "abc": { - "def": "./x.js", - "default": [] - }, - "ghi": "./y.js" - } - })), - request: "./a.js", - condition_names: vec!["abc", "ghi"], - }, - TestCase { - name: "syntax sugar #1", - expect: Some(vec!["./main.js"]), - exports_field: exports_field(json!("./main.js")), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #2", - expect: Some(vec![]), - exports_field: exports_field(json!("./main.js")), - request: "./lib.js", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #3", - expect: Some(vec!["./a.js"]), - exports_field: exports_field(json!(["./a.js", "./b.js"])), - request: ".", - condition_names: vec![], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "syntax sugar #3", - expect: Some(vec!["./b.js"]), - exports_field: exports_field(json!(["./b.js"])), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #4", - expect: Some(vec![]), - exports_field: exports_field(json!(["./a.js", "./b.js"])), - request: "./lib.js", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #5", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "browser": { - "default": "./index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "syntax sugar #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "browser": { - "default": "./index.js" - } - })), - request: "./lib.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "syntax sugar #7", - expect: None, - exports_field: exports_field(json!({ - "./node": "./node.js", - "browser": { - "default": "./index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "syntax sugar #8", - expect: None, - exports_field: exports_field(json!({ - "browser": { - "default": "./index.js" - }, - "./node": "./node.js" - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #1", - expect: Some(vec!["./abc/d"]), - exports_field: exports_field(json!({ - "./ab*": "./ab/*", - "./abc*": "./abc/*", - "./a*": "./a/*" - })), - request: "./abcd", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #2", - expect: Some(vec!["./abc/d/e"]), - exports_field: exports_field(json!({ - "./ab*": "./ab/*", - "./abc*": "./abc/*", - "./a*": "./a/*" - })), - request: "./abcd/e", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #3", - expect: Some(vec!["./abc/d"]), - exports_field: exports_field(json!({ - "./x/ab*": "./ab/*", - "./x/abc*": "./abc/*", - "./x/a*": "./a/*" - })), - request: "./x/abcd", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #4", - expect: Some(vec!["./abc/d/e"]), - exports_field: exports_field(json!({ - "./x/ab*": "./ab/*", - "./x/abc*": "./abc/*", - "./x/a*": "./a/*" - })), - request: "./x/abcd/e", - condition_names: vec!["browser"], - }, - TestCase { - name: "path tree edge case #1", - expect: Some(vec!["./A/b/d.js"]), - exports_field: exports_field(json!({ - "./a/": "./A/", - "./a/b/c": "./c.js" - })), - request: "./a/b/d.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #1 (wildcard)", - expect: Some(vec!["./A/b/d.js"]), - exports_field: exports_field(json!({ - "./a/*": "./A/*", - "./a/b/c": "./c.js" - })), - request: "./a/b/d.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #2", - expect: Some(vec!["./A/c.js"]), - exports_field: exports_field(json!({ - "./a/": "./A/", - "./a/b": "./b.js" - })), - request: "./a/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #2 (wildcard)", - expect: Some(vec!["./A/c.js"]), - exports_field: exports_field(json!({ - "./a/*": "./A/*", - "./a/b": "./b.js" - })), - request: "./a/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #3", - expect: Some(vec!["./A/b/d/c.js"]), - exports_field: exports_field(json!({ - "./a/": "./A/", - "./a/b/c/d": "./c.js" - })), - request: "./a/b/d/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #3 (wildcard)", - expect: Some(vec!["./A/b/d/c.js"]), - exports_field: exports_field(json!({ - "./a/*": "./A/*", - "./a/b/c/d": "./c.js" - })), - request: "./a/b/d/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #1", - expect: Some(vec!["./A/b.js"]), - exports_field: exports_field(json!({ - "./a/*.js": "./A/*.js" - })), - request: "./a/b.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #2", - expect: Some(vec!["./A/b/c.js"]), - exports_field: exports_field(json!({ - "./a/*.js": "./A/*.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #3", - expect: Some(vec!["./A/b/c.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": "./A/*/c.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #4", - expect: Some(vec!["./A/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": "./A/*/*.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #5", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/*.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #5", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/*.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./lib/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #6", - expect: Some(vec!["./browser/foo/bar.js"]), - exports_field: exports_field(json!({ - "./lib/*/bar.js": { - "browser": [ - "./browser/*/bar.js" - ] - }, - "./dist/*/bar.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./lib/foo/bar.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #6", - expect: Some(vec!["./browser/foo.js"]), - exports_field: exports_field(json!({ - "./lib/*/bar.js": { - "browser": [ - "./browser/*/bar.js" - ] - }, - "./dist/*/bar.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./dist/foo/bar.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #7", - expect: Some(vec!["./browser/foo/default.js"]), - exports_field: exports_field(json!({ - "./lib/*/bar.js": { - "browser": [ - "./browser/*/bar.js" - ] - }, - "./dist/*/bar.js": { - "node": "./*.js", - "default": "./browser/*/default.js" - } - })), - request: "./dist/foo/bar.js", - condition_names: vec!["default"], - }, - TestCase { - name: "wildcard pattern #8", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": "./A/*/*/*.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #9", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": [ - "./A/*/*/*.js", - "./B/*/*/*.js" - ] - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "wildcard pattern #9", - expect: Some(vec!["./B/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": [ - "./B/*/*/*.js" - ] - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #10", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/foo-*/c.js": "./A/*/*/*.js" - })), - request: "./a/foo-b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #11", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*-foo/c.js": "./A/*/*/*.js" - })), - request: "./a/b-foo/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #12", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/foo-*-foo/c.js": "./A/*/*/*.js" - })), - request: "./a/foo-b-foo/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #13", - expect: Some(vec!["./A/b/c/d.js"]), - exports_field: exports_field(json!({ - "./a/foo-*-foo/c.js": "./A/b/c/d.js" - })), - request: "./a/foo-b-foo/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #14", - expect: Some(vec!["./A/b/c/*.js"]), - exports_field: exports_field(json!({ - "./a/foo-foo/c.js": "./A/b/c/*.js" - })), - request: "./a/foo-foo/c.js", - condition_names: vec![], - }, - ]; - - for case in test_cases { - let resolved = Resolver::new(ResolveOptions { - condition_names: case - .condition_names - .iter() - .map(ToString::to_string) - .collect::>(), - ..ResolveOptions::default() - }) - .package_exports_resolve( - Path::new(""), - case.request, - &case.exports_field, - &mut Ctx::default(), - ) - .map(|p| p.map(|p| p.to_path_buf())); - if let Some(expect) = case.expect { - if expect.is_empty() { - assert!( - matches!(resolved, Err(ResolveError::PackagePathNotExported(_, _))), - "{} {:?}", - &case.name, - &resolved - ); - } else { - for expect in expect { - assert_eq!(resolved, Ok(Some(Path::new(expect).normalize())), "{}", &case.name); - } - } - } else { - assert!(resolved.is_err(), "{} {resolved:?}", &case.name); - } - } -} diff --git a/src/tests/extension_alias.rs b/src/tests/extension_alias.rs deleted file mode 100644 index 86afab73..00000000 --- a/src/tests/extension_alias.rs +++ /dev/null @@ -1,66 +0,0 @@ -//! - -use crate::{ResolveError, ResolveOptions, Resolver}; - -#[test] -fn extension_alias() { - let f = super::fixture().join("extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - extension_alias: vec![ - (".js".into(), vec![".ts".into(), ".js".into()]), - (".mjs".into(), vec![".mts".into()]), - ], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should alias fully specified file", f.clone(), "./index.js", f.join("index.ts")), - ("should alias fully specified file when there are two alternatives", f.clone(), "./dir/index.js", f.join("dir/index.ts")), - ("should also allow the second alternative", f.clone(), "./dir2/index.js", f.join("dir2/index.js")), - ("should support alias option without an array", f.clone(), "./dir2/index.mjs", f.join("dir2/index.mts")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } - - #[rustfmt::skip] - let fail = [ - ("should not allow to fallback to the original extension or add extensions", f, "./index.mjs"), - ]; - - for (comment, path, request) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!(resolution, Err(ResolveError::ExtensionAlias), "{comment} {path:?} {request}"); - } -} - -// should not apply extension alias to extensions or mainFiles field -#[test] -fn not_apply_to_extension_nor_main_files() { - let f = super::fixture().join("extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - extension_alias: vec![(".js".into(), vec![])], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("directory", f.clone(), "./dir2", "dir2/index.js"), - ("file", f.clone(), "./dir2/index", "dir2/index.js"), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - let expected = f.join(expected); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} diff --git a/src/tests/extensions.rs b/src/tests/extensions.rs deleted file mode 100644 index 1ebd86f4..00000000 --- a/src/tests/extensions.rs +++ /dev/null @@ -1,125 +0,0 @@ -//! - -use crate::{EnforceExtension, Resolution, ResolveContext, ResolveError, ResolveOptions, Resolver}; -use rustc_hash::FxHashSet; - -#[test] -fn extensions() { - let f = super::fixture().join("extensions"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".ts".into(), ".js".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve according to order of provided extensions", "./foo", "foo.ts"), - ("should resolve according to order of provided extensions (dir index)", "./dir", "dir/index.ts"), - ("should resolve according to main field in module root", ".", "index.js"), - // This is a core module - // ("should resolve single file module before directory", "module", "node_modules/module.js"), - ("should resolve trailing slash directory before single file", "module/", "node_modules/module/index.ts"), - ]; - - for (comment, request, expected_path) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - let expected = f.join(expected_path); - assert_eq!(resolved_path, Ok(expected), "{comment} {request} {expected_path}"); - } - - #[rustfmt::skip] - let fail = [ - ("not resolve to file when request has a trailing slash (relative)", "./foo.js/", "./foo.js/".into()) - ]; - - for (comment, request, expected_error) in fail { - let resolution = resolver.resolve(&f, request); - let error = ResolveError::NotFound(expected_error); - assert_eq!(resolution, Err(error), "{comment} {request} {resolution:?}"); - } -} - -// should default enforceExtension to true when extensions includes an empty string -#[test] -fn default_enforce_extension() { - let f = super::fixture().join("extensions"); - - let mut ctx = ResolveContext::default(); - let resolved = Resolver::new(ResolveOptions { - extensions: vec![".ts".into(), String::new(), ".js".into()], - ..ResolveOptions::default() - }) - .resolve_with_context(&f, "./foo", &mut ctx); - - assert_eq!(resolved.map(Resolution::into_path_buf), Ok(f.join("foo.ts"))); - assert_eq!( - ctx.file_dependencies, - FxHashSet::from_iter([f.join("foo.ts"), f.join("package.json")]) - ); - assert!(ctx.missing_dependencies.is_empty()); -} - -// should respect enforceExtension when extensions includes an empty string -#[test] -fn respect_enforce_extension() { - let f = super::fixture().join("extensions"); - - let mut ctx = ResolveContext::default(); - let resolved = Resolver::new(ResolveOptions { - enforce_extension: EnforceExtension::Disabled, - extensions: vec![".ts".into(), String::new(), ".js".into()], - ..ResolveOptions::default() - }) - .resolve_with_context(&f, "./foo", &mut ctx); - - assert_eq!(resolved.map(Resolution::into_path_buf), Ok(f.join("foo.ts"))); - assert_eq!( - ctx.file_dependencies, - FxHashSet::from_iter([f.join("foo.ts"), f.join("package.json")]) - ); - assert_eq!(ctx.missing_dependencies, FxHashSet::from_iter([f.join("foo")])); -} - -#[test] -fn multi_dot_extension() { - let f = super::fixture().join("extensions"); - - let resolver = Resolver::new(ResolveOptions { - // Test for `.d.ts`, not part of enhanced-resolve. - extensions: vec![".a.b.c".into(), ".d.ts".into(), ".ts".into(), ".js".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve according to order of provided extensions", "./foo", "foo.ts"), - ("should resolve file with extension", "./app.module", "app.module.js") - ]; - - for (comment, request, expected_path) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - let expected = f.join(expected_path); - assert_eq!(resolved_path, Ok(expected), "{comment} {request} {expected_path}"); - } - - #[rustfmt::skip] - let fail = [ - ("not resolve to file", "./index.", "./index.".into()) - ]; - - for (comment, request, expected_error) in fail { - let resolution = resolver.resolve(&f, request); - let error = ResolveError::NotFound(expected_error); - assert_eq!(resolution, Err(error), "{comment} {request} {resolution:?}"); - } -} - -#[test] -#[should_panic = "All extensions must start with a leading dot"] -fn without_leading_dot() { - Resolver::new(ResolveOptions { - extensions: vec!["ts".into(), "js".into()], - ..ResolveOptions::default() - }); -} diff --git a/src/tests/fallback.rs b/src/tests/fallback.rs deleted file mode 100644 index 3da2d767..00000000 --- a/src/tests/fallback.rs +++ /dev/null @@ -1,100 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/fallback.test.js - -#[test] -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -fn fallback() { - use super::memory_fs::MemoryFS; - use crate::{AliasValue, ResolveError, ResolveOptions, ResolverGeneric}; - use std::path::{Path, PathBuf}; - - let f = Path::new("/"); - - let file_system = MemoryFS::new(&[ - ("/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", ""), - ]); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - fallback: vec![ - ("aliasA".into(), vec![AliasValue::Path("a".into())]), - ("b$".into(), vec![AliasValue::Path("a/index".into())]), - ("c$".into(), vec![AliasValue::Path("/a/index".into())]), - ( - "multiAlias".into(), - vec![ - AliasValue::Path("b".into()), - AliasValue::Path("c".into()), - AliasValue::Path("d".into()), - AliasValue::Path("e".into()), - AliasValue::Path("a".into()), - ], - ), - ("recursive".into(), vec![AliasValue::Path("recursive/dir".into())]), - ("/d/dir".into(), vec![AliasValue::Path("/c/dir".into())]), - ("/d/index.js".into(), vec![AliasValue::Path("/c/index".into())]), - ("ignored".into(), vec![AliasValue::Ignore]), - ("node:path".into(), vec![AliasValue::Ignore]), - ], - modules: vec!["/".into()], - ..ResolveOptions::default() - }, - ); - - #[rustfmt::skip] - let pass = [ - ("should resolve a not aliased module 1", "a", "/a/index"), - ("should resolve a not aliased module 2", "a/index", "/a/index"), - ("should resolve a not aliased module 3", "a/dir", "/a/dir/index"), - ("should resolve a not aliased module 4", "a/dir/index", "/a/dir/index"), - ("should resolve an fallback module 1", "aliasA", "/a/index"), - ("should resolve an fallback module 2", "aliasA/index", "/a/index"), - ("should resolve an fallback module 3", "aliasA/dir", "/a/dir/index"), - ("should resolve an fallback module 4", "aliasA/dir/index", "/a/dir/index"), - ("should resolve a recursive aliased module 1", "recursive", "/recursive/index"), - ("should resolve a recursive aliased module 2", "recursive/index", "/recursive/index"), - ("should resolve a recursive aliased module 3", "recursive/dir", "/recursive/dir/index"), - ("should resolve a recursive aliased module 4", "recursive/dir/index", "/recursive/dir/index"), - ("should resolve a recursive aliased module 5", "recursive/file", "/recursive/dir/file"), - ("should resolve a file aliased module with a query 1", "b?query", "/b/index?query"), - ("should resolve a file aliased module with a query 2", "c?query", "/c/index?query"), - ("should resolve a path in a file aliased module 1", "b/index", "/b/index"), - ("should resolve a path in a file aliased module 2", "b/dir", "/b/dir/index"), - ("should resolve a path in a file aliased module 3", "b/dir/index", "/b/dir/index"), - ("should resolve a path in a file aliased module 4", "c/index", "/c/index"), - ("should resolve a path in a file aliased module 5", "c/dir", "/c/dir/index"), - ("should resolve a path in a file aliased module 6", "c/dir/index", "/c/dir/index"), - ("should resolve a file in multiple aliased dirs 1", "multiAlias/dir/file", "/e/dir/file"), - ("should resolve a file in multiple aliased dirs 2", "multiAlias/anotherDir", "/e/anotherDir/index"), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - - #[rustfmt::skip] - let ignore = [ - ("should resolve an ignore module", "ignored", ResolveError::Ignored(f.join("ignored"))), - ("should resolve node: builtin module", "node:path", ResolveError::Ignored(PathBuf::from("/node:path"))), - ]; - - for (comment, request, expected) in ignore { - let resolution = resolver.resolve(f, request); - assert_eq!(resolution, Err(expected), "{comment} {request}"); - } -} diff --git a/src/tests/full_specified.rs b/src/tests/full_specified.rs deleted file mode 100644 index a70c0191..00000000 --- a/src/tests/full_specified.rs +++ /dev/null @@ -1,113 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/fullSpecified.test.js - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows { - use std::path::PathBuf; - - use crate::{AliasValue, ResolveOptions, ResolverGeneric}; - - use super::super::memory_fs::MemoryFS; - - fn file_system() -> MemoryFS { - MemoryFS::new(&[ - ("/a/node_modules/package1/index.js", ""), - ("/a/node_modules/package1/file.js", ""), - ("/a/node_modules/package2/package.json", r#"{"main":"a"}"#), - ("/a/node_modules/package2/a.js", ""), - ("/a/node_modules/package3/package.json", r#"{"main":"dir"}"#), - ("/a/node_modules/package3/dir/index.js", ""), - ("/a/node_modules/package4/package.json", r#"{"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", ""), - ]) - } - - #[test] - fn test() { - let file_system = file_system(); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - alias: vec![ - ("alias1".into(), vec![AliasValue::from("/a/abc")]), - ("alias2".into(), vec![AliasValue::from("/a")]), - ], - alias_fields: vec![vec!["browser".into()]], - fully_specified: true, - ..ResolveOptions::default() - }, - ); - - let failing_resolves = [ - ("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"), - ]; - - for (comment, request) in failing_resolves { - let resolution = resolver.resolve("/a", request); - assert!(resolution.is_err(), "{comment} {request}"); - } - - let successful_resolves = [ - ("fully relative", "./abc.js", "/a/abc.js"), - ("fully absolute", "/a/abc.js", "/a/abc.js"), - ("fully relative in package", "package1/file.js", "/a/node_modules/package1/file.js"), - ("extensions in mainFiles", "package1", "/a/node_modules/package1/index.js"), - ("extensions in mainFields", "package2", "/a/node_modules/package2/a.js"), - ("extensions in alias", "alias1", "/a/abc.js"), - ("directories in alias", "alias2", "/a/index.js"), - ("directories in packages", "package3", "/a/node_modules/package3/dir/index.js"), - ("extensions in aliasFields", "package4/a.js", "/a/node_modules/package4/b.js"), - ]; - - for (comment, request, expected) in successful_resolves { - let resolution = resolver.resolve("/a", request).map(|r| r.full_path()); - assert_eq!(resolution, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - } - - #[test] - #[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. - fn resolve_to_context() { - let file_system = file_system(); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - alias: vec![ - ("alias1".into(), vec![AliasValue::from("/a/abc")]), - ("alias2".into(), vec![AliasValue::from("/a")]), - ], - alias_fields: vec![vec!["browser".into()]], - fully_specified: true, - resolve_to_context: true, - ..ResolveOptions::default() - }, - ); - - let successful_resolves = [ - ("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", "/a/node_modules/package3/dir"), - ]; - - for (comment, request, expected) in successful_resolves { - let resolution = resolver.resolve("/a", request).map(|r| r.full_path()); - assert_eq!(resolution, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - } -} diff --git a/src/tests/imports_field.rs b/src/tests/imports_field.rs deleted file mode 100644 index c928627a..00000000 --- a/src/tests/imports_field.rs +++ /dev/null @@ -1,1320 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/importsField.test.js -//! -//! The huge imports field test cases are at the bottom of this file. - -use serde_json::json; - -use crate::{Ctx, JSONMap, PathUtil, ResolveError, ResolveOptions, Resolver}; -use std::path::Path; - -#[test] -fn test_simple() { - let f = super::fixture().join("imports-field"); - let f2 = super::fixture().join("imports-exports-wildcard/node_modules/m/"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve using imports field instead of self-referencing", f.clone(), "#imports-field", f.join("b.js")), - ("should resolve using imports field instead of self-referencing for a subpath", f.join("dir"), "#imports-field", f.join("b.js")), - ("should resolve package #1", f.clone(), "#a/dist/main.js", f.join("node_modules/a/lib/lib2/main.js")), - ("should resolve package #3", f.clone(), "#ccc/index.js", f.join("node_modules/c/index.js")), - ("should resolve package #4", f.clone(), "#c", f.join("node_modules/c/index.js")), - ("should resolve with wildcard pattern", f2.clone(), "#internal/i.js", f2.join("src/internal/i.js")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } - - // Note added: - // * should resolve absolute path as an imports field target - // * should log the correct info - - #[rustfmt::skip] - let fail = [ - ("should disallow resolve out of package scope", f.clone(), "#b", ResolveError::InvalidPackageTarget("../b.js".to_string(), "#b".to_string(), f.join("package.json"))), - ("should resolve package #2", f.clone(), "#a", ResolveError::PackageImportNotDefined("#a".to_string(), f.join("package.json"))), - ]; - - for (comment, path, request, error) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!(resolution, Err(error), "{comment} {path:?} {request}"); - } -} - -#[test] -fn shared_resolvers() { - let f = super::fixture().join("imports-field"); - - // field name #1 - let resolver1 = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - imports_fields: vec![vec!["imports".into()]], - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - let resolved_path = resolver1.resolve(&f, "#imports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("b.js"))); - - // field name #2 - let resolver2 = resolver1.clone_with_options(ResolveOptions { - imports_fields: vec![vec!["other".into(), "imports".into()]], - ..ResolveOptions::default() - }); - - let resolved_path = resolver2.resolve(&f, "#b").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("a.js"))); -} - -// Small script for generating the test cases from enhanced_resolve -// for (c of testCases) { -// console.log("TestCase {") -// console.log(`name: ${JSON.stringify(c.name)},`) -// if (c.expect instanceof Error) { -// console.log(`expect: None,`) -// } else { -// console.log(`expect: Some(vec!${JSON.stringify(c.expect)}),`) -// } -// console.log(`imports_field: imports_field(json!(${JSON.stringify(c.suite[0], null, 2)})),`) -// console.log(`request: "${c.suite[1]}",`) -// console.log(`condition_names: vec!${JSON.stringify(c.suite[2])},`) -// console.log("},") -// } - -struct TestCase { - name: &'static str, - expect: Option>, - imports_field: JSONMap, - request: &'static str, - condition_names: Vec<&'static str>, -} - -#[allow(clippy::needless_pass_by_value)] -fn imports_field(value: serde_json::Value) -> JSONMap { - let s = serde_json::to_string(&value).unwrap(); - serde_json::from_str(&s).unwrap() -} - -#[test] -fn test_cases() { - let test_cases = [ - TestCase { - name: "sample #1", - expect: Some(vec!["./dist/test/file.js"]), - imports_field: imports_field(json!({ - "#abc/": { - "import": [ - "./dist/", - "./src/" - ], - "webpack": "./wp/" - }, - "#abc": "./main.js" - })), - request: "#abc/test/file.js", - condition_names: vec!["import", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "sample #1", - expect: Some(vec!["./src/test/file.js"]), - imports_field: imports_field(json!({ - "#abc/": { - "import": [ - "./src/" - ], - "webpack": "./wp/" - }, - "#abc": "./main.js" - })), - request: "#abc/test/file.js", - condition_names: vec!["import", "webpack"], - }, - TestCase { - name: "sample #2", - expect: Some(vec!["./data/timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#1/timezones/": "./data/timezones/" - })), - request: "#1/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #3", - expect: Some(vec!["./data/timezones/timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#aaa/": "./data/timezones/", - "#a/": "./data/timezones/" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #4", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/lib/": { - "browser": [ - "./browser/" - ] - }, - "#a/dist/index.js": { - "node": "./index.js" - } - })), - request: "#a/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #5", - expect: Some(vec!["./browser/index.js"]), - imports_field: imports_field(json!({ - "#a/lib/": { - "browser": [ - "./browser/" - ] - }, - "#a/dist/index.js": { - "node": "./index.js", - "default": "./browser/index.js" - } - })), - request: "#a/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #6", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/dist/a": "./dist/index.js" - })), - request: "#a/dist/aaa", - condition_names: vec![], - }, - TestCase { - name: "sample #7", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/a/a/": "./dist/index.js" - })), - request: "#a/a/a", - condition_names: vec![], - }, - TestCase { - name: "sample #8", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": "./index.js" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #9", - expect: Some(vec!["./main.js"]), - imports_field: imports_field(json!({ - "#a/index.js": "./main.js" - })), - request: "#a/index.js", - condition_names: vec![], - }, - TestCase { - name: "sample #10", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #11", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/bar#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #12", - expect: Some(vec!["./ok.js#abc"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/ok.js#abc", - condition_names: vec![], - }, - TestCase { - name: "sample #13", - expect: Some(vec!["./ok.js?abc"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/ok.js?abc", - condition_names: vec![], - }, - TestCase { - name: "sample #14", - expect: Some(vec!["./🎉.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/🎉.js", - condition_names: vec![], - }, - TestCase { - name: "sample #15", - expect: Some(vec!["./%F0%9F%8E%89.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/%F0%9F%8E%89.js", - condition_names: vec![], - }, - TestCase { - name: "sample #16", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/🎉", - condition_names: vec![], - }, - TestCase { - name: "sample #17", - expect: Some(vec!["./other.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/%F0%9F%8E%89", - condition_names: vec![], - }, - TestCase { - name: "sample #18", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/module", - condition_names: vec![], - }, - TestCase { - name: "sample #19", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/module#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #20", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/module?foo", - condition_names: vec![], - }, - TestCase { - name: "sample #21", - expect: Some(vec!["./d?e?f"]), - imports_field: imports_field(json!({ - "#a/a?b?c/": "./" - })), - request: "#a/a?b?c/d?e?f", - condition_names: vec![], - }, - TestCase { - name: "sample #22", - // We throw InvalidPackageTarget - expect: None, - // expect: Some(vec!["/user/a/index"]), - imports_field: imports_field(json!({ - "#a/": "/user/a/" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #1", - expect: Some(vec!["./A/b/d.js"]), - imports_field: imports_field(json!({ - "#a/": "./A/", - "#a/b/c": "./c.js" - })), - request: "#a/b/d.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #2", - expect: Some(vec!["./A/c.js"]), - imports_field: imports_field(json!({ - "#a/": "./A/", - "#a/b": "./b.js" - })), - request: "#a/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #3", - expect: Some(vec!["./A/b/c/d.js"]), - imports_field: imports_field(json!({ - "#a/": "./A/", - "#a/b/c/d": "./c.js" - })), - request: "#a/b/c/d.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #1", - expect: Some(vec!["./dist/index.js"]), - imports_field: imports_field(json!({ - "#a": "./dist/index.js" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #2", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": "./" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #3", - expect: Some(vec!["./dist/a.js"]), - imports_field: imports_field(json!({ - "#a/": "./dist/", - "#a/index.js": "./dist/a.js" - })), - request: "#a/index.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #4", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "./browser/" - ] - }, - "#a/index.js": { - "browser": "./index.js" - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #5", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "./browser/" - ] - }, - "#a/index.js": { - "node": "./node.js" - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #6", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: "#a", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #7", - expect: Some(vec!["./src/index.js"]), // `enhanced_resolve` is `None` - imports_field: imports_field(json!({ - "#a": { - "default": "./src/index.js", - "browser": "./index.js", - "node": "./src/node/index.js" - } - })), - request: "#a", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #8", - expect: Some(vec!["./src/index.js"]), - imports_field: imports_field(json!({ - "#a": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #9", - expect: Some(vec!["./index"]), - imports_field: imports_field(json!({ - "#a": "./index" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #10", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/index": "./index.js" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #11", - // We throw InvalidPackageTarget - // expect: Some(vec!["b"]), - expect: None, - imports_field: imports_field(json!({ - "#a": "b" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #12", - // We throw InvalidPackageTarget - // expect: Some(vec!["b/index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "b/" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #13", - // We throw InvalidPackageTarget - // expect: Some(vec!["b#anotherhashishere"]), - expect: None, - imports_field: imports_field(json!({ - "#a?q=a#hashishere": "b#anotherhashishere" - })), - request: "#a?q=a#hashishere", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #1", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #2", - expect: Some(vec!["./import.mjs"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec!["import"], - }, - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./require.js"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./import.mjs"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./require.js"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": [ - "./require.js" - ] - }, - { - "import": [ - "./import.mjs", - "#b/import.js" - ] - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./import.mjs"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "./import.mjs", - "#b/import.js" - ] - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "#b/import.js" - ] - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "mapping to a folder root #1", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#timezones": "./data/timezones/" - })), - request: "#timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #2", - expect: None, - imports_field: imports_field(json!({ - "#timezones/": "./data/timezones" - })), - request: "#timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #3", - expect: Some(vec!["./data/timezones/pdt/index.mjs"]), - imports_field: imports_field(json!({ - "#timezones/pdt/": "./data/timezones/pdt/" - })), - request: "#timezones/pdt/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #4", - expect: Some(vec!["./timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#a/": "./timezones/" - })), - request: "#a/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #5", - expect: Some(vec!["./timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#a/": "./" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #6", - expect: None, - imports_field: imports_field(json!({ - "#a/": "." - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #7", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": "./" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #1", - expect: Some(vec!["./lib/index.mjs"]), - imports_field: imports_field(json!({ - "#a/": "./", - "#a/dist/": "./lib/" - })), - request: "#a/dist/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #2", - expect: Some(vec!["./dist/utils/index.js"]), - imports_field: imports_field(json!({ - "#a/dist/utils/": "./dist/utils/", - "#a/dist/": "./lib/" - })), - request: "#a/dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #3", - expect: Some(vec!["./dist/utils/index.js"]), - imports_field: imports_field(json!({ - "#a/dist/utils/index.js": "./dist/utils/index.js", - "#a/dist/utils/": "./dist/utils/index.mjs", - "#a/dist/": "./lib/" - })), - request: "#a/dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #4", - expect: Some(vec!["./lib/index.mjs"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./browser/" - }, - "#a/dist/": "./lib/" - })), - request: "#a/dist/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #1", - // This behaves differently from enhanced_resolve, because `lodash/` is an an InvalidPackageConfig - // expect: Some(vec!["lodash/index.js"]), - expect: Some(vec!["./utils/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "conditional mapping folder #1", - expect: Some(vec!["./utils/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #2", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./node/" - ] - } - })), - request: "#a/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "conditional mapping folder #3", - expect: Some(vec!["./wpk/index.mjs"]), - imports_field: imports_field(json!({ - "#a/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils/" - ] - } - })), - request: "#a/index.mjs", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "incorrect exports field #1", - // We throw `PackageImportNotDefined` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "/utils/": "./a/" - })), - request: "#a/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #2", - // We throw `PackageImportNotDefined` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "/utils/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#a/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #3", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index": "./a/index.js" - })), - request: "#a/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #4", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index.mjs": "./a/index.js" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #5", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "#a/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #6", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index.mjs": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "#a/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #1", - // We don't throw in `package_imports_exports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": "./a/" - })), - request: "/utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect request #2", - // We don't throw in `package_imports_exports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #3", - // We don't throw in `package_imports_exports_resolve`, it's thrown in `package_imports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #4", - // We don't throw in `package_imports_exports_resolve`, it's thrown in `package_imports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#/", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #5", - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#a/", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #1", - // expect: Some(vec!["./dist/index"]), - expect: Some(vec!["dist/index"]), - imports_field: imports_field(json!({ - "#a/../../utils/": "./dist/" - })), - request: "#a/../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #2", - // We throw InvalidPackageTarget - // expect: Some(vec!["./dist/../../utils/index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "./dist/" - })), - request: "#a/../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #3", - // We throw InvalidPackageTarget - // expect: Some(vec!["../src/index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "../src/" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #4", - // We throw InvalidPackageTarget - // expect: Some(vec!["./utils/../../../index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": { - "browser": "./utils/../../../" - } - })), - request: "#a/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #1", - // expect: Some(vec!["moment/node_modules/lodash/dist/index.js"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": { - "browser": "moment/node_modules/" - } - })), - request: "#a/lodash/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #2", - // We throw InvalidPackageTarget - // expect: Some(vec!["../node_modules/lodash/dist/index.js"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "../node_modules/" - })), - request: "#a/lodash/dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "nested mapping #1", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": "./", - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./node/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "nested mapping #3", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["webpack"], - }, - TestCase { - name: "nested mapping #4", - // We throw NotFound - // expect: Some(vec!["moment/node/index.js"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "moment/node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["node", "browser"], - }, - TestCase { - name: "nested mapping #5", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "node"], - }, - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./node/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - TestCase { - name: "nested mapping #7", - expect: Some(vec!["./y.js"]), - imports_field: imports_field(json!({ - "#a": { - "abc": { - "def": "./x.js" - }, - "ghi": "./y.js" - } - })), - request: "#a", - condition_names: vec!["abc", "ghi"], - }, - TestCase { - name: "nested mapping #8", - // We throw PackageImportNotDefined - // expect: Some(vec![]), - expect: None, - imports_field: imports_field(json!({ - "#a": { - "abc": { - "def": "./x.js", - "default": [] - }, - "ghi": "./y.js" - } - })), - request: "#a", - condition_names: vec!["abc", "ghi"], - }, - ]; - - for case in test_cases { - let resolved = Resolver::default() - .package_imports_exports_resolve( - case.request, - &case.imports_field, - Path::new(""), - true, - &case.condition_names.iter().map(ToString::to_string).collect::>(), - &mut Ctx::default(), - ) - .map(|p| p.map(|p| p.to_path_buf())); - if let Some(expect) = case.expect { - if expect.is_empty() { - assert!(matches!(resolved, Ok(None)), "{} {:?}", &case.name, &resolved); - } else { - for expect in expect { - assert_eq!(resolved, Ok(Some(Path::new(expect).normalize())), "{}", &case.name); - } - } - } else { - assert!(resolved.is_err(), "{} {resolved:?}", &case.name); - } - } -} diff --git a/src/tests/incorrect_description_file.rs b/src/tests/incorrect_description_file.rs deleted file mode 100644 index a5c81796..00000000 --- a/src/tests/incorrect_description_file.rs +++ /dev/null @@ -1,62 +0,0 @@ -//! - -use rustc_hash::FxHashSet; - -use crate::{JSONError, Resolution, ResolveContext, ResolveError, ResolveOptions, Resolver}; - -// should not resolve main in incorrect description file #1 -#[test] -fn incorrect_description_file_1() { - let f = super::fixture().join("incorrect-package"); - let mut ctx = ResolveContext::default(); - let resolution = Resolver::default().resolve_with_context(f.join("pack1"), ".", &mut ctx); - let error = ResolveError::JSON(JSONError { - path: f.join("pack1/package.json"), - message: String::from("EOF while parsing a value at line 3 column 0"), - line: 3, - column: 0, - }); - assert_eq!(resolution, Err(error)); - assert_eq!(ctx.file_dependencies, FxHashSet::from_iter([f.join("pack1/package.json")])); - assert!(ctx.missing_dependencies.is_empty()); -} - -// should not resolve main in incorrect description file #2 -#[test] -fn incorrect_description_file_2() { - let f = super::fixture().join("incorrect-package"); - let resolution = Resolver::default().resolve(f.join("pack2"), "."); - let error = ResolveError::JSON(JSONError { - path: f.join("pack2/package.json"), - message: String::from("EOF while parsing a value at line 1 column 0"), - line: 1, - column: 0, - }); - assert_eq!(resolution, Err(error)); -} - -// should not resolve main in incorrect description file #3 -#[test] -fn incorrect_description_file_3() { - let f = super::fixture().join("incorrect-package"); - let resolution = Resolver::default().resolve(f.join("pack2"), "."); - assert!(resolution.is_err()); -} - -// `enhanced_resolve` does not have this test case -#[test] -fn no_description_file() { - let f = super::fixture_root().join("enhanced_resolve"); - - // has description file - let resolver = Resolver::default(); - assert_eq!( - resolver.resolve(&f, ".").map(Resolution::into_path_buf), - Ok(f.join("lib/index.js")) - ); - - // without description file - let resolver = - Resolver::new(ResolveOptions { description_files: vec![], ..ResolveOptions::default() }); - assert_eq!(resolver.resolve(&f, "."), Err(ResolveError::NotFound(".".into()))); -} diff --git a/src/tests/main_field.rs b/src/tests/main_field.rs deleted file mode 100644 index 3cadc8ce..00000000 --- a/src/tests/main_field.rs +++ /dev/null @@ -1,24 +0,0 @@ -//! Not part of enhanced_resolve's test suite - -use crate::{ResolveOptions, Resolver}; - -#[test] -fn test() { - let f = super::fixture().join("restrictions"); - - let resolver1 = Resolver::new(ResolveOptions { - main_fields: vec!["style".into()], - ..ResolveOptions::default() - }); - - let resolution = resolver1.resolve(&f, "pck2").map(|r| r.full_path()); - assert_eq!(resolution, Ok(f.join("node_modules/pck2/index.css"))); - - let resolver2 = resolver1.clone_with_options(ResolveOptions { - main_fields: vec!["module".into(), "main".into()], - ..ResolveOptions::default() - }); - - let resolution = resolver2.resolve(&f, "pck2").map(|r| r.full_path()); - assert_eq!(resolution, Ok(f.join("node_modules/pck2/module.js"))); -} diff --git a/src/tests/memory_fs.rs b/src/tests/memory_fs.rs deleted file mode 100644 index e4116609..00000000 --- a/src/tests/memory_fs.rs +++ /dev/null @@ -1,74 +0,0 @@ -use std::{ - io, - path::{Path, PathBuf}, -}; - -use crate::{FileMetadata, FileSystem}; - -#[derive(Default)] -pub struct MemoryFS { - fs: vfs::MemoryFS, -} - -impl MemoryFS { - /// # Panics - /// - /// * Fails to create directory - /// * Fails to write file - #[allow(dead_code)] - pub fn new(data: &[(&'static str, &'static str)]) -> Self { - let mut fs = Self { fs: vfs::MemoryFS::default() }; - for (path, content) in data { - fs.add_file(Path::new(path), content); - } - fs - } - - #[allow(dead_code)] - pub fn add_file(&mut self, path: &Path, content: &str) { - use vfs::FileSystem; - let fs = &mut self.fs; - // Create all parent directories - for path in path.ancestors().collect::>().iter().rev() { - let path = path.to_string_lossy(); - if !fs.exists(path.as_ref()).unwrap() { - fs.create_dir(path.as_ref()).unwrap(); - } - } - // Create file - let mut file = fs.create_file(path.to_string_lossy().as_ref()).unwrap(); - file.write_all(content.as_bytes()).unwrap(); - } -} - -impl FileSystem for MemoryFS { - fn read_to_string(&self, path: &Path) -> io::Result { - use vfs::FileSystem; - let mut file = self - .fs - .open_file(path.to_string_lossy().as_ref()) - .map_err(|err| io::Error::new(io::ErrorKind::NotFound, err))?; - let mut buffer = String::new(); - file.read_to_string(&mut buffer).unwrap(); - Ok(buffer) - } - - fn metadata(&self, path: &Path) -> io::Result { - use vfs::FileSystem; - let metadata = self - .fs - .metadata(path.to_string_lossy().as_ref()) - .map_err(|err| io::Error::new(io::ErrorKind::NotFound, err))?; - let is_file = metadata.file_type == vfs::VfsFileType::File; - let is_dir = metadata.file_type == vfs::VfsFileType::Directory; - Ok(FileMetadata::new(is_file, is_dir, false)) - } - - fn symlink_metadata(&self, path: &Path) -> io::Result { - self.metadata(path) - } - - fn canonicalize(&self, _path: &Path) -> io::Result { - Err(io::Error::new(io::ErrorKind::NotFound, "not a symlink")) - } -} diff --git a/src/tests/missing.rs b/src/tests/missing.rs deleted file mode 100644 index 4bf611ef..00000000 --- a/src/tests/missing.rs +++ /dev/null @@ -1,106 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/missing.test.js - -use normalize_path::NormalizePath; - -use crate::{AliasValue, ResolveContext, ResolveOptions, Resolver}; - -#[test] -fn test() { - let f = super::fixture(); - - let data = [ - ( - "./missing-file", - vec![f.join("missing-file"), f.join("missing-file.js"), f.join("missing-file.node")], - ), - ( - "missing-module", - vec![ - f.join("node_modules/missing-module"), - f.parent().unwrap().join("node_modules"), // enhanced-resolve is "node_modules/missing-module" - ], - ), - ( - "missing-module/missing-file", - vec![ - f.join("node_modules/missing-module"), - // f.parent().unwrap().join("node_modules/missing-module"), // we don't report this - ], - ), - ( - "m1/missing-file", - vec![ - f.join("node_modules/m1/missing-file"), - f.join("node_modules/m1/missing-file.js"), - f.join("node_modules/m1/missing-file.node"), - // f.parent().unwrap().join("node_modules/m1"), // we don't report this - ], - ), - ( - "m1/", - vec![ - f.join("node_modules/m1/index"), - f.join("node_modules/m1/index.js"), - f.join("node_modules/m1/index.json"), - f.join("node_modules/m1/index.node"), - ], - ), - ("m1/a", vec![f.join("node_modules/m1/a")]), - ]; - - let resolver = Resolver::default(); - - for (specifier, missing_dependencies) in data { - let mut ctx = ResolveContext::default(); - let _ = resolver.resolve_with_context(&f, specifier, &mut ctx); - - for path in ctx.file_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - } - - for path in missing_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - assert!( - ctx.missing_dependencies.contains(&path), - "{specifier}: {path:?} not in {:?}", - &ctx.missing_dependencies - ); - } - } -} - -#[test] -fn alias_and_extensions() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias: vec![ - ( - "@scope-js/package-name/dir$".into(), - vec![AliasValue::Path(f.join("foo/index.js").to_string_lossy().to_string())], - ), - ( - "react-dom".into(), - vec![AliasValue::Path(f.join("foo/index.js").to_string_lossy().to_string())], - ), - ], - extensions: vec![".server.ts".into()], - - ..ResolveOptions::default() - }); - - let mut ctx = ResolveContext::default(); - let _ = resolver.resolve_with_context(&f, "@scope-js/package-name/dir/router", &mut ctx); - let _ = resolver.resolve_with_context(&f, "react-dom/client", &mut ctx); - - for path in ctx.file_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - } - - for path in ctx.missing_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - if let Some(path) = path.parent() { - assert!(!path.is_file(), "{path:?} must not be a file"); - } - } -} diff --git a/src/tests/mod.rs b/src/tests/mod.rs deleted file mode 100644 index 94e6bd86..00000000 --- a/src/tests/mod.rs +++ /dev/null @@ -1,49 +0,0 @@ -mod alias; -mod browser_field; -mod builtins; -mod dependencies; -mod exports_field; -mod extension_alias; -mod extensions; -mod fallback; -mod full_specified; -mod imports_field; -mod incorrect_description_file; -mod main_field; -mod memory_fs; -mod missing; -mod resolve; -mod restrictions; -mod roots; -mod scoped_packages; -mod simple; -mod symlink; -mod tsconfig_paths; -mod tsconfig_project_references; - -use crate::Resolver; -use std::{env, path::PathBuf, sync::Arc, thread}; - -pub fn fixture_root() -> PathBuf { - env::current_dir().unwrap().join("fixtures") -} - -pub fn fixture() -> PathBuf { - fixture_root().join("enhanced_resolve").join("test").join("fixtures") -} - -#[test] -fn threaded_environment() { - let cwd = env::current_dir().unwrap(); - let resolver = Arc::new(Resolver::default()); - for _ in 0..2 { - _ = thread::spawn({ - let cwd = cwd.clone(); - let resolver = Arc::clone(&resolver); - move || { - _ = resolver.resolve(cwd, "."); - } - }) - .join(); - } -} diff --git a/src/tests/resolve.rs b/src/tests/resolve.rs deleted file mode 100644 index f2dbb88e..00000000 --- a/src/tests/resolve.rs +++ /dev/null @@ -1,119 +0,0 @@ -//! - -use crate::{ResolveError, ResolveOptions, Resolver}; - -#[test] -fn resolve() { - let f = super::fixture(); - - let resolver = Resolver::default(); - - let main1_js_path = f.join("main1.js").to_string_lossy().to_string(); - - #[rustfmt::skip] - let pass = [ - ("absolute path", f.clone(), main1_js_path.as_str(), f.join("main1.js")), - ("file with .js", f.clone(), "./main1.js", f.join("main1.js")), - ("file without extension", f.clone(), "./main1", f.join("main1.js")), - ("another file with .js", f.clone(), "./a.js", f.join("a.js")), - ("another file without extension", f.clone(), "./a", f.join("a.js")), - ("file in module with .js", f.clone(), "m1/a.js", f.join("node_modules/m1/a.js")), - ("file in module without extension", f.clone(), "m1/a", f.join("node_modules/m1/a.js")), - ("another file in module without extension", f.clone(), "complexm/step1", f.join("node_modules/complexm/step1.js")), - ("from submodule to file in sibling module", f.join("node_modules/complexm"), "m2/b.js", f.join("node_modules/m2/b.js")), - ("from nested directory to overwritten file in module", f.join("multiple_modules"), "m1/a.js", f.join("multiple_modules/node_modules/m1/a.js")), - ("from nested directory to not overwritten file in module", f.join("multiple_modules"), "m1/b.js", f.join("node_modules/m1/b.js")), - ("file with query", f.clone(), "./main1.js?query", f.join("main1.js?query")), - ("file with fragment", f.clone(), "./main1.js#fragment", f.join("main1.js#fragment")), - ("file with fragment and query", f.clone(), "./main1.js#fragment?query", f.join("main1.js#fragment?query")), - ("file with query and fragment", f.clone(), "./main1.js?#fragment", f.join("main1.js?#fragment")), - - ("file with query (unicode)", f.clone(), "./测试.js?query", f.join("测试.js?query")), - ("file with fragment (unicode)", f.clone(), "./测试.js#fragment", f.join("测试.js#fragment")), - ("file with fragment and query (unicode)", f.clone(), "./测试.js#fragment?query", f.join("测试.js#fragment?query")), - ("file with query and fragment (unicode)", f.clone(), "./测试.js?#fragment", f.join("测试.js?#fragment")), - - ("file in module with query", f.clone(), "m1/a?query", f.join("node_modules/m1/a.js?query")), - ("file in module with fragment", f.clone(), "m1/a#fragment", f.join("node_modules/m1/a.js#fragment")), - ("file in module with fragment and query", f.clone(), "m1/a#fragment?query", f.join("node_modules/m1/a.js#fragment?query")), - ("file in module with query and fragment", f.clone(), "m1/a?#fragment", f.join("node_modules/m1/a.js?#fragment")), - ("file in module with query and fragment", f.clone(), "m1/a?#fragment", f.join("node_modules/m1/a.js?#fragment")), - ("differ between directory and file, resolve file", f.clone(), "./dirOrFile", f.join("dirOrFile.js")), - ("differ between directory and file, resolve directory", f.clone(), "./dirOrFile/", f.join("dirOrFile/index.js")), - ("find node_modules outside of node_modules", f.join("browser-module/node_modules"), "m1/a", f.join("node_modules/m1/a.js")), - ("don't crash on main field pointing to self", f.clone(), "./main-field-self", f.join("./main-field-self/index.js")), - ("don't crash on main field pointing to self (2)", f.clone(), "./main-field-self2", f.join("./main-field-self2/index.js")), - // enhanced-resolve has `#` prepended with a `\0`, they are removed from the - // following 3 expected test results. - // See https://github.com/webpack/enhanced-resolve#escaping - ("handle fragment edge case (no fragment)", f.clone(), "./no#fragment/#/#", f.join("no#fragment/#/#.js")), - ("handle fragment edge case (fragment)", f.clone(), "./no#fragment/#/", f.join("no.js#fragment/#/")), - ("handle fragment escaping", f.clone(), "./no\0#fragment/\0#/\0##fragment", f.join("no#fragment/#/#.js#fragment")), - - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn issue238_resolve() { - let f = super::fixture().join("issue-238"); - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into(), ".jsx".into(), ".ts".into(), ".tsx".into()], - modules: vec!["src/a".into(), "src/b".into(), "src/common".into(), "node_modules".into()], - ..ResolveOptions::default() - }); - let resolved_path = - resolver.resolve(f.join("src/common"), "config/myObjectFile").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("src/common/config/myObjectFile.js")),); -} - -#[test] -fn prefer_relative() { - let f = super::fixture(); - - let resolver = - Resolver::new(ResolveOptions { prefer_relative: true, ..ResolveOptions::default() }); - - #[rustfmt::skip] - let pass = [ - ("should correctly resolve with preferRelative 1", "main1.js", f.join("main1.js")), - ("should correctly resolve with preferRelative 2", "m1/a.js", f.join("node_modules/m1/a.js")), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } -} - -#[test] -fn resolve_to_context() { - let f = super::fixture(); - let resolver = - Resolver::new(ResolveOptions { resolve_to_context: true, ..ResolveOptions::default() }); - - #[rustfmt::skip] - let data = [ - ("context for fixtures", f.clone(), "./", f.clone()), - ("context for fixtures/lib", f.clone(), "./lib", f.join("lib")), - ("context for fixtures with ..", f.clone(), "./lib/../../fixtures/./lib/..", f.clone()), - ("context for fixtures with query", f.clone(), "./?query", f.clone().with_file_name("fixtures?query")), - ]; - - for (comment, path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn resolve_hash_as_module() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions::default()); - let resolution = resolver.resolve(f, "#a"); - assert_eq!(resolution, Err(ResolveError::NotFound("#a".into()))); -} diff --git a/src/tests/restrictions.rs b/src/tests/restrictions.rs deleted file mode 100644 index 5ba56596..00000000 --- a/src/tests/restrictions.rs +++ /dev/null @@ -1,25 +0,0 @@ -//! - -use crate::{ResolveError, ResolveOptions, Resolver, Restriction}; - -// TODO: regex -// * should respect RegExp restriction -// * should try to find alternative #1 -// * should try to find alternative #2 -// * should try to find alternative #3 - -// should respect string restriction -#[test] -fn restriction1() { - let fixture = super::fixture(); - let f = fixture.join("restrictions"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - restrictions: vec![Restriction::Path(f.clone())], - ..ResolveOptions::default() - }); - - let resolution = resolver.resolve(&f, "pck2"); - assert_eq!(resolution, Err(ResolveError::Restriction(fixture.join("c.js"), f))); -} diff --git a/src/tests/roots.rs b/src/tests/roots.rs deleted file mode 100644 index b50e2a07..00000000 --- a/src/tests/roots.rs +++ /dev/null @@ -1,92 +0,0 @@ -//! - -use std::path::PathBuf; - -use crate::{AliasValue, ResolveError, ResolveOptions, Resolver}; - -fn dirname() -> PathBuf { - super::fixture_root().join("enhanced_resolve").join("test") -} - -#[test] -fn roots() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - alias: vec![("foo".into(), vec![AliasValue::from("/fixtures")])], - roots: vec![dirname(), f.clone()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should respect roots option", "/fixtures/b.js", f.join("b.js")), - ("should try another root option, if it exists", "/b.js", f.join("b.js")), - ("should respect extension", "/fixtures/b", f.join("b.js")), - ("should resolve in directory", "/fixtures/extensions/dir", f.join("extensions/dir/index.js")), - ("should respect aliases", "foo/b", f.join("b.js")), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } - - #[rustfmt::skip] - let fail = [ - ("should not work with relative path", "fixtures/b.js", ResolveError::NotFound("fixtures/b.js".into())) - ]; - - for (comment, request, expected) in fail { - let resolution = resolver.resolve(&f, request); - assert_eq!(resolution, Err(expected), "{comment} {request}"); - } -} - -#[test] -fn resolve_to_context() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - roots: vec![dirname(), f.clone()], - resolve_to_context: true, - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f, "/fixtures/lib").map(|r| r.full_path()); - let expected = f.join("lib"); - assert_eq!(resolved_path, Ok(expected)); -} - -#[test] -fn prefer_absolute() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - alias: vec![("foo".into(), vec![AliasValue::from("/fixtures")])], - roots: vec![dirname(), f.clone()], - prefer_absolute: true, - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve an absolute path (prefer absolute)", f.join("b.js").to_string_lossy().to_string(), f.join("b.js")), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(&f, &request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } -} - -#[test] -fn roots_fall_through() { - let f = super::fixture(); - let absolute_path = f.join("roots_fall_through/index.js"); - let specifier = absolute_path.to_string_lossy(); - let resolution = Resolver::new(ResolveOptions::default().with_root(&f)).resolve(&f, &specifier); - assert_eq!( - resolution.map(super::super::resolution::Resolution::into_path_buf), - Ok(absolute_path) - ); -} diff --git a/src/tests/scoped_packages.rs b/src/tests/scoped_packages.rs deleted file mode 100644 index 8258f00f..00000000 --- a/src/tests/scoped_packages.rs +++ /dev/null @@ -1,25 +0,0 @@ -//! - -use crate::{ResolveOptions, Resolver}; - -#[test] -fn scoped_packages() { - let f = super::fixture().join("scoped"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("main field should work", f.clone(), "@scope/pack1", f.join("./node_modules/@scope/pack1/main.js")), - ("browser field should work", f.clone(), "@scope/pack2", f.join("./node_modules/@scope/pack2/main.js")), - ("folder request should work", f.clone(), "@scope/pack2/lib", f.join("./node_modules/@scope/pack2/lib/index.js")) - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} diff --git a/src/tests/simple.rs b/src/tests/simple.rs deleted file mode 100644 index 08e1238a..00000000 --- a/src/tests/simple.rs +++ /dev/null @@ -1,68 +0,0 @@ -//! - -use std::env; - -use crate::Resolver; - -#[test] -fn simple() { - // mimic `enhanced-resolve/test/simple.test.js` - let dirname = env::current_dir().unwrap().join("fixtures"); - let f = dirname.join("enhanced_resolve/test"); - - let resolver = Resolver::default(); - - let data = [ - ("direct", f.clone(), "../lib/index"), - ("as directory", f, ".."), - ("as module", dirname.clone(), "./enhanced_resolve"), - ]; - - for (comment, path, request) in data { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - let expected = dirname.join("enhanced_resolve/lib/index.js"); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn dashed_name() { - let f = super::fixture(); - - let resolver = Resolver::default(); - - let data = [ - (f.clone(), "dash", f.join("node_modules/dash/index.js")), - (f.clone(), "dash-name", f.join("node_modules/dash-name/index.js")), - (f.join("node_modules/dash"), "dash", f.join("node_modules/dash/index.js")), - (f.join("node_modules/dash"), "dash-name", f.join("node_modules/dash-name/index.js")), - (f.join("node_modules/dash-name"), "dash", f.join("node_modules/dash/index.js")), - (f.join("node_modules/dash-name"), "dash-name", f.join("node_modules/dash-name/index.js")), - ]; - - for (path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{path:?} {request}"); - } -} - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows { - use super::super::memory_fs::MemoryFS; - - use crate::ResolveOptions; - - #[test] - fn no_package() { - use crate::ResolverGeneric; - use std::path::Path; - let f = Path::new("/"); - let file_system = MemoryFS::new(&[]); - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions::default(), - ); - let resolved_path = resolver.resolve(f, "package"); - assert!(resolved_path.is_err()); - } -} diff --git a/src/tests/symlink.rs b/src/tests/symlink.rs deleted file mode 100644 index 7589b560..00000000 --- a/src/tests/symlink.rs +++ /dev/null @@ -1,121 +0,0 @@ -use std::{fs, io, path::Path}; - -use crate::{ResolveOptions, Resolver}; - -#[derive(Debug, Clone, Copy)] -enum FileType { - File, - Dir, -} - -#[allow(unused_variables)] -fn symlink, Q: AsRef>( - original: P, - link: Q, - file_type: FileType, -) -> io::Result<()> { - #[cfg(target_family = "unix")] - { - std::os::unix::fs::symlink(original, link) - } - - #[cfg(target_family = "windows")] - match file_type { - FileType::File => std::os::windows::fs::symlink_file(original, link), - FileType::Dir => std::os::windows::fs::symlink_dir(original, link), - } -} - -fn init(dirname: &Path, temp_path: &Path) -> io::Result<()> { - if temp_path.exists() { - _ = fs::remove_dir_all(temp_path); - } - fs::create_dir(temp_path)?; - symlink(dirname.join("../lib/index.js"), temp_path.join("test"), FileType::File)?; - symlink(dirname.join("../lib"), temp_path.join("test2"), FileType::Dir)?; - fs::remove_file(temp_path.join("test"))?; - fs::remove_file(temp_path.join("test2"))?; - fs::remove_dir(temp_path) -} - -fn create_symlinks(dirname: &Path, temp_path: &Path) -> io::Result<()> { - fs::create_dir(temp_path).unwrap(); - symlink( - dirname.join("../lib/index.js").canonicalize().unwrap(), - temp_path.join("index.js"), - FileType::File, - )?; - symlink(dirname.join("../lib").canonicalize().unwrap(), temp_path.join("lib"), FileType::Dir)?; - symlink(dirname.join("..").canonicalize().unwrap(), temp_path.join("this"), FileType::Dir)?; - symlink(temp_path.join("this"), temp_path.join("that"), FileType::Dir)?; - symlink(Path::new("../../lib/index.js"), temp_path.join("node.relative.js"), FileType::File)?; - symlink( - Path::new("./node.relative.js"), - temp_path.join("node.relative.sym.js"), - FileType::File, - )?; - Ok(()) -} - -fn cleanup_symlinks(temp_path: &Path) { - _ = fs::remove_dir_all(temp_path); -} - -#[test] -fn test() -> io::Result<()> { - let root = super::fixture_root().join("enhanced_resolve"); - let dirname = root.join("test"); - let temp_path = dirname.join("temp"); - if !temp_path.exists() { - let is_admin = init(&dirname, &temp_path).is_ok(); - if !is_admin { - return Ok(()); - } - if let Err(err) = create_symlinks(&dirname, &temp_path) { - cleanup_symlinks(&temp_path); - return Err(err); - } - } - - let resolver_without_symlinks = - Resolver::new(ResolveOptions { symlinks: false, ..ResolveOptions::default() }); - let resolver_with_symlinks = Resolver::default(); - - #[rustfmt::skip] - let pass = [ - ("with a symlink to a file", temp_path.clone(), "./index.js"), - ("with a relative symlink to a file", temp_path.clone(), "./node.relative.js"), - ("with a relative symlink to a symlink to a file", temp_path.clone(), "./node.relative.sym.js"), - ("with a symlink to a directory 1", temp_path.clone(), "./lib/index.js"), - ("with a symlink to a directory 2", temp_path.clone(), "./this/lib/index.js"), - ("with multiple symlinks in the path 1", temp_path.clone(), "./this/test/temp/index.js"), - ("with multiple symlinks in the path 2", temp_path.clone(), "./this/test/temp/lib/index.js"), - ("with multiple symlinks in the path 3", temp_path.clone(), "./this/test/temp/this/lib/index.js"), - ("with a symlink to a directory 2 (chained)", temp_path.clone(), "./that/lib/index.js"), - ("with multiple symlinks in the path 1 (chained)", temp_path.clone(), "./that/test/temp/index.js"), - ("with multiple symlinks in the path 2 (chained)", temp_path.clone(), "./that/test/temp/lib/index.js"), - ("with multiple symlinks in the path 3 (chained)", temp_path.clone(), "./that/test/temp/that/lib/index.js"), - ("with symlinked directory as context 1", temp_path.join( "lib"), "./index.js"), - ("with symlinked directory as context 2", temp_path.join( "this"), "./lib/index.js"), - ("with symlinked directory as context and in path", temp_path.join( "this"), "./test/temp/lib/index.js"), - ("with symlinked directory in context path", temp_path.join( "this/lib"), "./index.js"), - ("with symlinked directory in context path and symlinked file", temp_path.join( "this/test"), "./temp/index.js"), - ("with symlinked directory in context path and symlinked directory", temp_path.join( "this/test"), "./temp/lib/index.js"), - ("with symlinked directory as context 2 (chained)", temp_path.join( "that"), "./lib/index.js"), - ("with symlinked directory as context and in path (chained)", temp_path.join( "that"), "./test/temp/lib/index.js"), - ("with symlinked directory in context path (chained)", temp_path.join( "that/lib"), "./index.js"), - ("with symlinked directory in context path and symlinked file (chained)", temp_path.join( "that/test"), "./temp/index.js"), - ("with symlinked directory in context path and symlinked directory (chained)", temp_path.join( "that/test"), "./temp/lib/index.js") - ]; - - for (comment, path, request) in pass { - let filename = resolver_with_symlinks.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(filename, Ok(root.join("lib/index.js")), "{comment:?}"); - - let resolved_path = - resolver_without_symlinks.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(path.join(request))); - } - - Ok(()) -} diff --git a/src/tests/tsconfig_paths.rs b/src/tests/tsconfig_paths.rs deleted file mode 100644 index 26935b5c..00000000 --- a/src/tests/tsconfig_paths.rs +++ /dev/null @@ -1,507 +0,0 @@ -//! tests for tsconfig-paths -//! -//! Fixtures copied from . - -use std::path::{Path, PathBuf}; - -use crate::{ - ResolveError, ResolveOptions, Resolver, TsConfig, TsconfigOptions, TsconfigReferences, -}; - -// -#[test] -fn tsconfig() { - let f = super::fixture_root().join("tsconfig"); - - #[rustfmt::skip] - let pass = [ - (f.clone(), None, "ts-path", f.join("foo.js")), - (f.join("nested"), None, "ts-path", f.join("nested/test.js")), - (f.join("cases/index"), None, "foo", f.join("node_modules/tsconfig-index/foo.js")), - // This requires reading package.json.tsconfig field - // (f.join("cases/field"), "foo", f.join("node_modules/tsconfig-field/foo.js")) - (f.join("cases/exports"), None, "foo", f.join("node_modules/tsconfig-exports/foo.js")), - (f.join("cases/extends-extension"), None, "foo", f.join("cases/extends-extension/foo.js")), - (f.join("cases/extends-extensionless"), None, "foo", f.join("node_modules/tsconfig-field/foo.js")), - (f.join("cases/extends-paths"), Some("src"), "@/index", f.join("cases/extends-paths/src/index.js")), - (f.join("cases/extends-multiple"), None, "foo", f.join("cases/extends-multiple/foo.js")), - ]; - - for (dir, subdir, request, expected) in pass { - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: dir.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - let path = subdir.map_or(dir.clone(), |subdir| dir.join(subdir)); - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{request} {path:?}"); - } - - #[rustfmt::skip] - let data = [ - (f.join("node_modules/tsconfig-not-used"), "ts-path", Ok(f.join("foo.js"))), - ]; - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - for (path, request, expected) in data { - let resolution = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolution, expected, "{path:?} {request}"); - } -} - -#[test] -fn tsconfig_fallthrough() { - let f = super::fixture_root().join("tsconfig"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "/"); - assert_eq!(resolved_path, Err(ResolveError::NotFound("/".into()))); -} - -#[test] -fn json_with_comments() { - let f = super::fixture_root().join("tsconfig/cases/trailing-comma"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "foo").map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(f.join("bar.js"))); -} - -// -#[test] -fn test_paths() { - let path = Path::new("/foo/tsconfig.json"); - let mut tsconfig_json = serde_json::json!({ - "compilerOptions": { - "paths": { - "jquery": ["node_modules/jquery/dist/jquery"], - "*": ["generated/*"], - "bar/*": ["test/*"], - "bar/baz/*": ["baz/*", "yo/*"], - "@/components/*": ["components/*"], - "url": ["node_modules/my-url"], - } - } - }) - .to_string(); - let tsconfig = TsConfig::parse(true, path, &mut tsconfig_json).unwrap(); - - let data = [ - ("jquery", vec!["/foo/node_modules/jquery/dist/jquery"]), - ("test", vec!["/foo/generated/test"]), - ("test/hello", vec!["/foo/generated/test/hello"]), - ("bar/hi", vec!["/foo/test/hi"]), - ("bar/baz/hi", vec!["/foo/baz/hi", "/foo/yo/hi"]), - ("@/components/button", vec!["/foo/components/button"]), - ("./jquery", vec![]), - ("url", vec!["/foo/node_modules/my-url"]), - ]; - - for (specifier, expected) in data { - let paths = tsconfig.resolve_path_alias(specifier); - let expected = expected.into_iter().map(PathBuf::from).collect::>(); - assert_eq!(paths, expected, "{specifier}"); - } -} - -// -#[test] -fn test_base_url() { - let path = Path::new("/foo/tsconfig.json"); - let mut tsconfig_json = serde_json::json!({ - "compilerOptions": { - "baseUrl": "./src" - } - }) - .to_string(); - let tsconfig = TsConfig::parse(true, path, &mut tsconfig_json).unwrap(); - - let data = [ - ("foo", vec!["/foo/src/foo"]), - ("components/button", vec!["/foo/src/components/button"]), - ("./jquery", vec![]), - ]; - - for (specifier, expected) in data { - let paths = tsconfig.resolve_path_alias(specifier); - let expected = expected.into_iter().map(PathBuf::from).collect::>(); - assert_eq!(paths, expected, "{specifier}"); - } -} - -// -#[test] -fn test_paths_and_base_url() { - let path = Path::new("/foo/tsconfig.json"); - let mut tsconfig_json = serde_json::json!({ - "compilerOptions": { - "baseUrl": "./src", - "paths": { - "*": ["generated/*"], - "bar/*": ["test/*"], - "bar/baz/*": ["baz/*", "yo/*"], - "@/components/*": ["components/*"] - } - } - }) - .to_string(); - let tsconfig = TsConfig::parse(true, path, &mut tsconfig_json).unwrap(); - - let data = [ - ("test", vec!["/foo/src/generated/test", "/foo/src/test"]), - ("test/hello", vec!["/foo/src/generated/test/hello", "/foo/src/test/hello"]), - ("bar/hi", vec!["/foo/src/test/hi", "/foo/src/bar/hi"]), - ("bar/baz/hi", vec!["/foo/src/baz/hi", "/foo/src/yo/hi", "/foo/src/bar/baz/hi"]), - ("@/components/button", vec!["/foo/src/components/button", "/foo/src/@/components/button"]), - ("./jquery", vec![]), - ]; - - for (specifier, expected) in data { - let paths = tsconfig.resolve_path_alias(specifier); - let expected = expected.into_iter().map(PathBuf::from).collect::>(); - assert_eq!(paths, expected, "{specifier}"); - } -} - -// Template variable ${configDir} for substitution of config files directory path -// https://github.com/microsoft/TypeScript/pull/58042 -#[test] -fn test_template_variable() { - let f = super::fixture_root().join("tsconfig"); - let f2 = f.join("cases").join("paths_template_variable"); - - #[rustfmt::skip] - let pass = [ - (f2.clone(), "tsconfig1.json", "foo", f2.join("foo.js")), - (f2.clone(), "tsconfig2.json", "foo", f2.join("foo.js")), - (f.clone(), "tsconfig_template_variable.json", "foo", f.join("foo.js")), - ]; - - for (dir, tsconfig, request, expected) in pass { - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: dir.join(tsconfig), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&dir, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{request} {tsconfig} {dir:?}"); - } -} - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows_test { - use std::path::{Path, PathBuf}; - - use crate::{ - ResolveError, ResolveOptions, ResolverGeneric, TsconfigOptions, TsconfigReferences, - }; - - use super::super::memory_fs::MemoryFS; - - struct OneTest { - name: &'static str, - tsconfig: String, - package_json: Option<(PathBuf, String)>, - main_fields: Option>, - existing_files: Vec<&'static str>, - requested_module: &'static str, - expected_path: &'static str, - extensions: Vec, - } - - impl Default for OneTest { - fn default() -> Self { - Self { - name: "", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/*": ["location/*"] - } - } - }) - .to_string(), - package_json: None, - main_fields: None, - existing_files: vec![], - requested_module: "", - expected_path: "", - extensions: vec![ - ".js".into(), - ".json".into(), - ".node".into(), - ".ts".into(), - ".tsx".into(), - ], - } - } - } - - impl OneTest { - fn resolver(&self, root: &Path) -> ResolverGeneric { - let mut file_system = MemoryFS::default(); - - file_system.add_file(&root.join("tsconfig.json"), &self.tsconfig); - if let Some((path, package_json)) = &self.package_json { - file_system.add_file(&root.join(path).join("package.json"), package_json); - } - for path in &self.existing_files { - file_system.add_file(Path::new(path), ""); - } - - let mut options = ResolveOptions { - extensions: self.extensions.clone(), - tsconfig: Some(TsconfigOptions { - config_file: root.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }; - if let Some(main_fields) = &self.main_fields { - options.main_fields.clone_from(main_fields); - } - - ResolverGeneric::::new_with_file_system(file_system, options) - } - } - - // Path matching tests from tsconfig-paths - // * - // * - #[test] - fn match_path() { - let pass = [ - OneTest { - name: "should locate path that matches with star and exists", - existing_files: vec!["/root/location/mylib/index.ts"], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve to correct path when many are specified", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/*": ["foo1/*", "foo2/*", "location/*", "foo3/*"], - } - } - }) - .to_string(), - existing_files: vec!["/root/location/mylib/index.ts"], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should locate path that matches with star and prioritize pattern with longest prefix", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "*": ["location/*"], - "lib/*": ["location/*"], - } - } - }) - .to_string(), - existing_files: vec![ - "/root/location/lib/mylib/index.ts", - "/root/location/mylib/index.ts", - ], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should locate path that matches with star and exists with extension", - existing_files: vec![ - "/root/location/mylib.myext", - ], - requested_module: "lib/mylib", - extensions: vec![".js".into(), ".myext".into()], - expected_path: "/root/location/mylib.myext", - ..OneTest::default() - }, - OneTest { - name: "should resolve request with extension specified", - existing_files: vec![ - "/root/location/test.jpg", - ], - requested_module: "lib/test.jpg", - expected_path: "/root/location/test.jpg", - ..OneTest::default() - }, - OneTest { - name: "should locate path that matches without star and exists", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/foo": ["location/foo"] - } - } - }) - .to_string(), - existing_files: vec![ - "/root/location/foo.ts", - ], - requested_module: "lib/foo", - expected_path: "/root/location/foo.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve to parent folder when filename is in subfolder", - existing_files: vec![ - "/root/location/mylib/index.ts", - ], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve from main field in package.json", - package_json: Some((PathBuf::from("/root/location/mylib"), serde_json::json!({ - "main": "./kalle.ts" - }).to_string())), - existing_files: vec![ - "/root/location/mylib/kalle.ts", - ], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/kalle.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve from main field in package.json (js)", - package_json: Some((PathBuf::from("/root/location/mylib.js"), serde_json::json!({ - "main": "./kalle.js" - }).to_string())), - existing_files: vec![ - "/root/location/mylib.js/kalle.js", - ], - extensions: vec![".ts".into(), ".js".into()], - requested_module: "lib/mylib.js", - expected_path: "/root/location/mylib.js/kalle.js", - ..OneTest::default() - }, - OneTest { - name: "should resolve from list of fields by priority in package.json", - main_fields: Some(vec!["missing".into(), "browser".into(), "main".into()]), - package_json: Some((PathBuf::from("/root/location/mylibjs"), serde_json::json!({ - "main": "./main.js", - "browser": "./browser.js" - }).to_string())), - existing_files: vec![ - "/root/location/mylibjs/main.js", - "/root/location/mylibjs/browser.js", - ], - extensions: vec![".ts".into(), ".js".into()], - requested_module: "lib/mylibjs", - expected_path: "/root/location/mylibjs/browser.js", - ..OneTest::default() - }, -OneTest { - name: "should ignore field mappings to missing files in package.json", - main_fields: Some(vec!["browser".into(), "main".into()]), - package_json: Some((PathBuf::from("/root/location/mylibjs"), serde_json::json!({ - "main": "./kalle.js", - "browser": "./nope.js" - }).to_string())), - existing_files: vec![ - "/root/location/mylibjs/kalle.js", - ], - extensions: vec![".ts".into(), ".js".into()], - requested_module: "lib/mylibjs", - expected_path: "/root/location/mylibjs/kalle.js", - ..OneTest::default() - }, - // Tests that are not applicable: - // name: "should resolve nested main fields" - // name: "should ignore advanced field mappings in package.json" - // name: "should resolve to with the help of baseUrl when not explicitly set" - // name: "should not resolve with the help of baseUrl when asked not to" - // name: "should resolve main file with cjs file extension" - OneTest { - name: "should resolve .ts from .js alias", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "@/*": ["src/*"] - } - } - }).to_string(), - existing_files: vec![ - "/root/src/foo.ts", - ], - requested_module: "@/foo", // original data was "@/foo.ts" but I don't get why it is the case? - expected_path: "/root/src/foo.ts", // original data was "/root/src/foo" - ..OneTest::default() - }, - ]; - - let root = PathBuf::from("/root"); - - for test in pass { - let resolved_path = - test.resolver(&root).resolve(&root, test.requested_module).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(PathBuf::from(test.expected_path)), "{}", test.name); - } - - let fail = [ - OneTest { - name: "should not locate path that does not match", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/*": ["location/*"] - } - } - }) - .to_string(), - existing_files: vec!["/root/location/mylib"], - requested_module: "lib/mylibjs", - ..OneTest::default() - }, - OneTest { - name: "should not resolve typings file (index.d.ts)", - existing_files: vec!["/root/location/mylib/index.d.ts"], - requested_module: "lib/mylib", - ..OneTest::default() - }, - ]; - - for test in fail { - let resolved_path = - test.resolver(&root).resolve(&root, test.requested_module).map(|f| f.full_path()); - assert_eq!( - resolved_path, - Err(ResolveError::NotFound(test.requested_module.into())), - "{}", - test.name - ); - } - } -} diff --git a/src/tests/tsconfig_project_references.rs b/src/tests/tsconfig_project_references.rs deleted file mode 100644 index b552fefe..00000000 --- a/src/tests/tsconfig_project_references.rs +++ /dev/null @@ -1,101 +0,0 @@ -//! Tests for tsconfig project references - -use crate::{ResolveError, ResolveOptions, Resolver, TsconfigOptions, TsconfigReferences}; - -#[test] -fn auto() { - let f = super::fixture_root().join("tsconfig/cases/project_references"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("app"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - // Test normal paths alias - (f.join("app"), "@/index.ts", f.join("app/aliased/index.ts")), - (f.join("app"), "@/../index.ts", f.join("app/index.ts")), - // Test project reference - (f.join("project_a"), "@/index.ts", f.join("project_a/aliased/index.ts")), - (f.join("project_b/src"), "@/index.ts", f.join("project_b/src/aliased/index.ts")), - // Does not have paths alias - (f.join("project_a"), "./index.ts", f.join("project_a/index.ts")), - (f.join("project_c"), "./index.ts", f.join("project_c/index.ts")), - // Template variable - { - let dir = f.parent().unwrap().join("paths_template_variable"); - (dir.clone(), "foo", dir.join("foo.js")) - } - ]; - - for (path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{request} {path:?}"); - } -} - -#[test] -fn disabled() { - let f = super::fixture_root().join("tsconfig/cases/project_references"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("app"), - references: TsconfigReferences::Disabled, - }), - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - // Test normal paths alias - (f.join("app"), "@/index.ts", Ok(f.join("app/aliased/index.ts"))), - (f.join("app"), "@/../index.ts", Ok(f.join("app/index.ts"))), - // Test project reference - (f.join("project_a"), "@/index.ts", Err(ResolveError::NotFound("@/index.ts".into()))), - (f.join("project_b/src"), "@/index.ts", Err(ResolveError::NotFound("@/index.ts".into()))), - // Does not have paths alias - (f.join("project_a"), "./index.ts", Ok(f.join("project_a/index.ts"))), - (f.join("project_c"), "./index.ts", Ok(f.join("project_c/index.ts"))), - ]; - - for (path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, expected, "{request} {path:?}"); - } -} - -#[test] -fn manual() { - let f = super::fixture_root().join("tsconfig/cases/project_references"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("app"), - references: TsconfigReferences::Paths(vec!["../project_a/conf.json".into()]), - }), - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - // Test normal paths alias - (f.join("app"), "@/index.ts", Ok(f.join("app/aliased/index.ts"))), - (f.join("app"), "@/../index.ts", Ok(f.join("app/index.ts"))), - // Test project reference - (f.join("project_a"), "@/index.ts", Ok(f.join("project_a/aliased/index.ts"))), - (f.join("project_b/src"), "@/index.ts", Err(ResolveError::NotFound("@/index.ts".into()))), - // Does not have paths alias - (f.join("project_a"), "./index.ts", Ok(f.join("project_a/index.ts"))), - (f.join("project_c"), "./index.ts", Ok(f.join("project_c/index.ts"))), - ]; - - for (path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, expected, "{request} {path:?}"); - } -} diff --git a/src/tsconfig.rs b/src/tsconfig.rs deleted file mode 100644 index aa00f6e4..00000000 --- a/src/tsconfig.rs +++ /dev/null @@ -1,212 +0,0 @@ -use std::{ - path::{Path, PathBuf}, - sync::Arc, -}; - -use serde::Deserialize; -use typescript_tsconfig_json::{CompilerOptionsPathsMap, ExtendsField}; - -use crate::PathUtil; - -#[derive(Debug, Deserialize)] -#[serde(rename_all = "camelCase")] -pub struct TsConfig { - /// Whether this is the caller tsconfig. - /// Used for final template variable substitution when all configs are extended and merged. - #[serde(skip)] - root: bool, - - /// Path to `tsconfig.json`. Contains the `tsconfig.json` filename. - #[serde(skip)] - path: PathBuf, - - #[serde(default)] - pub extends: Option, - - #[serde(default)] - pub compiler_options: CompilerOptions, - - /// Bubbled up project references with a reference to their tsconfig. - #[serde(default)] - pub references: Vec, -} - -/// Compiler Options -/// -/// -#[derive(Debug, Default, Deserialize)] -#[serde(rename_all = "camelCase")] -pub struct CompilerOptions { - base_url: Option, - - /// Path aliases - paths: Option, - - /// The actual base for where path aliases are resolved from. - #[serde(skip)] - paths_base: PathBuf, -} - -/// Project Reference -/// -/// -#[derive(Debug, Deserialize)] -pub struct ProjectReference { - /// The path property of each reference can point to a directory containing a tsconfig.json file, - /// or to the config file itself (which may have any name). - pub path: PathBuf, - - /// Reference to the resolved tsconfig - #[serde(skip)] - pub tsconfig: Option>, -} - -impl TsConfig { - pub fn parse(root: bool, path: &Path, json: &mut str) -> Result { - _ = json_strip_comments::strip(json); - let mut tsconfig: Self = serde_json::from_str(json)?; - tsconfig.root = root; - tsconfig.path = path.to_path_buf(); - let directory = tsconfig.directory().to_path_buf(); - if let Some(base_url) = tsconfig.compiler_options.base_url { - tsconfig.compiler_options.base_url = Some(directory.normalize_with(base_url)); - } - if tsconfig.compiler_options.paths.is_some() { - tsconfig.compiler_options.paths_base = - tsconfig.compiler_options.base_url.as_ref().map_or(directory, Clone::clone); - } - Ok(tsconfig) - } - - pub fn build(mut self) -> Self { - if self.root { - let dir = self.directory().to_path_buf(); - // Substitute template variable in `tsconfig.compilerOptions.paths` - if let Some(paths) = &mut self.compiler_options.paths { - for paths in paths.values_mut() { - for path in paths { - Self::substitute_template_variable(&dir, path); - } - } - } - } - self - } - - /// Directory to `tsconfig.json` - /// - /// # Panics - /// - /// * When the `tsconfig.json` path is misconfigured. - pub fn directory(&self) -> &Path { - debug_assert!(self.path.file_name().is_some()); - self.path.parent().unwrap() - } - - pub fn extend_tsconfig(&mut self, tsconfig: &Self) { - let compiler_options = &mut self.compiler_options; - if compiler_options.paths.is_none() { - compiler_options.paths_base = compiler_options - .base_url - .as_ref() - .map_or_else(|| tsconfig.compiler_options.paths_base.clone(), Clone::clone); - compiler_options.paths.clone_from(&tsconfig.compiler_options.paths); - } - if compiler_options.base_url.is_none() { - compiler_options.base_url.clone_from(&tsconfig.compiler_options.base_url); - } - } - - pub fn resolve(&self, path: &Path, specifier: &str) -> Vec { - if path.starts_with(self.base_path()) { - let paths = self.resolve_path_alias(specifier); - if !paths.is_empty() { - return paths; - } - } - for tsconfig in self.references.iter().filter_map(|reference| reference.tsconfig.as_ref()) { - if path.starts_with(tsconfig.base_path()) { - return tsconfig.resolve_path_alias(specifier); - } - } - vec![] - } - - // Copied from parcel - // - pub fn resolve_path_alias(&self, specifier: &str) -> Vec { - if specifier.starts_with(|s| s == '/' || s == '.') { - return vec![]; - } - - let base_url_iter = self - .compiler_options - .base_url - .as_ref() - .map_or_else(Vec::new, |base_url| vec![base_url.normalize_with(specifier)]); - - let Some(paths_map) = &self.compiler_options.paths else { - return base_url_iter; - }; - - let paths = paths_map.get(specifier).map_or_else( - || { - let mut longest_prefix_length = 0; - let mut longest_suffix_length = 0; - let mut best_key: Option<&String> = None; - - for key in paths_map.keys() { - if let Some((prefix, suffix)) = key.split_once('*') { - if (best_key.is_none() || prefix.len() > longest_prefix_length) - && specifier.starts_with(prefix) - && specifier.ends_with(suffix) - { - longest_prefix_length = prefix.len(); - longest_suffix_length = suffix.len(); - best_key.replace(key); - } - } - } - - best_key.and_then(|key| paths_map.get(key)).map_or_else(Vec::new, |paths| { - paths - .iter() - .map(|path| { - path.replace( - '*', - &specifier[longest_prefix_length - ..specifier.len() - longest_suffix_length], - ) - }) - .collect::>() - }) - }, - Clone::clone, - ); - - paths - .into_iter() - .map(|p| self.compiler_options.paths_base.normalize_with(p)) - .chain(base_url_iter) - .collect() - } - - fn base_path(&self) -> &Path { - self.compiler_options - .base_url - .as_ref() - .map_or_else(|| self.directory(), |path| path.as_ref()) - } - - /// Template variable `${configDir}` for substitution of config files directory path - /// - /// NOTE: All tests cases are just a head replacement of `${configDir}`, so we are constrained as such. - /// - /// See - fn substitute_template_variable(directory: &Path, path: &mut String) { - const TEMPLATE_VARIABLE: &str = "${configDir}/"; - if let Some(stripped_path) = path.strip_prefix(TEMPLATE_VARIABLE) { - *path = directory.join(stripped_path).to_string_lossy().to_string(); - } - } -} diff --git a/tests/integration_test.rs b/tests/integration_test.rs deleted file mode 100644 index d369413f..00000000 --- a/tests/integration_test.rs +++ /dev/null @@ -1,102 +0,0 @@ -//! Test public APIs - -use std::{env, path::PathBuf}; - -use oxc_resolver::{EnforceExtension, Resolution, ResolveContext, ResolveOptions, Resolver}; - -fn dir() -> PathBuf { - env::current_dir().unwrap() -} - -fn resolve(specifier: &str) -> Resolution { - let path = dir(); - Resolver::new(ResolveOptions::default()).resolve(path, specifier).unwrap() -} - -#[test] -fn clone() { - let resolution = resolve("./tests/package.json"); - assert_eq!(resolution.clone(), resolution); -} - -#[test] -fn debug() { - let resolution = resolve("./tests/package.json"); - let s = format!("{resolution:?}"); - assert!(!s.is_empty()); -} - -#[test] -fn eq() { - let resolution = resolve("./tests/package.json"); - assert_eq!(resolution, resolution); -} - -#[test] -fn package_json() { - let resolution = resolve("./tests/package.json"); - assert!(resolution - .package_json() - .is_some_and(|json| json.name.as_ref().is_some_and(|name| name == "name"))); -} - -#[cfg(feature = "package_json_raw_json_api")] -#[test] -fn package_json_raw_json_api() { - let resolution = resolve("./tests/package.json"); - assert!(resolution - .package_json() - .unwrap() - .raw_json() - .get("name") - .is_some_and(|name| name == "name")); -} - -#[test] -fn clear_cache() { - let resolver = Resolver::new(ResolveOptions::default()); - resolver.clear_cache(); // exists -} - -#[test] -fn options() { - let resolver = Resolver::new(ResolveOptions::default()); - let options = resolver.options(); - assert!(!format!("{options:?}").is_empty()); -} - -#[test] -fn debug_resolver() { - let resolver = Resolver::new(ResolveOptions::default()); - assert!(!format!("{resolver:?}").is_empty()); -} - -#[test] -fn dependencies() { - let path = dir(); - let mut ctx = ResolveContext::default(); - let _ = Resolver::new(ResolveOptions::default()).resolve_with_context( - path, - "./tests/package.json", - &mut ctx, - ); - assert!(!ctx.file_dependencies.is_empty()); - assert!(ctx.missing_dependencies.is_empty()); -} - -#[test] -fn options_api() { - _ = ResolveOptions::default() - .with_builtin_modules(true) - .with_condition_names(&[]) - .with_extension(".js") - .with_force_extension(EnforceExtension::Auto) - .with_fully_specified(true) - .with_main_field("asdf") - .with_main_file("main") - .with_module("module") - .with_prefer_absolute(true) - .with_prefer_relative(true) - .with_root(PathBuf::new()) - .with_symbolic_link(true); -} diff --git a/tests/package.json b/tests/package.json deleted file mode 100644 index f099adcf..00000000 --- a/tests/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "name": "name" -} diff --git a/tests/resolve_test.rs b/tests/resolve_test.rs deleted file mode 100644 index 30d1ceff..00000000 --- a/tests/resolve_test.rs +++ /dev/null @@ -1,104 +0,0 @@ -use std::{env, path::PathBuf}; - -use oxc_resolver::{ResolveError, ResolveOptions, Resolver}; - -fn dir() -> PathBuf { - env::current_dir().unwrap() -} - -#[test] -fn chinese() { - let dir = dir(); - let specifier = "./fixtures/misc/中文/中文.js"; - let resolution = Resolver::new(ResolveOptions::default()).resolve(&dir, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(dir.join("fixtures/misc/中文/中文.js")) - ); -} - -#[test] -fn styled_components() { - let dir = dir(); - let path = dir.join("fixtures/pnpm"); - let module_path = dir.join("node_modules/.pnpm/styled-components@6.1.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/styled-components"); - let specifier = "styled-components"; - - // cjs - let options = - ResolveOptions { alias_fields: vec![vec!["browser".into()]], ..ResolveOptions::default() }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/styled-components.browser.cjs.js")) - ); - - // esm - let options = ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - main_fields: vec!["module".into()], - ..ResolveOptions::default() - }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/styled-components.browser.esm.js")) - ); -} - -#[test] -fn axios() { - let dir = dir(); - let path = dir.join("fixtures/pnpm"); - let module_path = dir.join("node_modules/.pnpm/axios@1.6.2/node_modules/axios"); - let specifier = "axios"; - - // default - let options = ResolveOptions::default(); - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("index.js")) - ); - - // browser - let options = ResolveOptions { - condition_names: vec!["browser".into(), "require".into()], - ..ResolveOptions::default() - }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/browser/axios.cjs")) - ); - - // cjs - let options = ResolveOptions { - condition_names: vec!["node".into(), "require".into()], - ..ResolveOptions::default() - }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/node/axios.cjs")) - ); -} - -#[test] -fn postcss() { - let dir = dir(); - let path = dir.join("fixtures/pnpm"); - let module_path = path.join("node_modules/postcss"); - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - // should ignore "path" - let resolution = resolver.resolve(&module_path, "path"); - assert_eq!(resolution, Err(ResolveError::Ignored(module_path.clone()))); - - // should ignore "./lib/terminal-highlight" - let resolution = resolver.resolve(&module_path, "./lib/terminal-highlight"); - assert_eq!(resolution, Err(ResolveError::Ignored(module_path.join("lib/terminal-highlight")))); -} From 8915a86dacc8f7c949d6e874557278eea1562c16 Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Fri, 21 Jun 2024 15:38:08 +0300 Subject: [PATCH 32/82] squash! --- Cargo.lock | 858 ------ fixtures/enhanced_resolve/lib/index.js | 1 - fixtures/enhanced_resolve/package.json | 4 - fixtures/enhanced_resolve/test/.gitignore | 2 - .../enhanced_resolve/test/fixtures/#/a.js | 0 fixtures/enhanced_resolve/test/fixtures/a.js | 3 - .../enhanced_resolve/test/fixtures/abc.txt | 1 - .../test/fixtures/alias/files/a.js | 0 fixtures/enhanced_resolve/test/fixtures/b.js | 3 - .../browser-module/browser/module-a.js | 0 .../fixtures/browser-module/lib/browser.js | 0 .../fixtures/browser-module/lib/ignore.js | 0 .../test/fixtures/browser-module/lib/main.js | 0 .../fixtures/browser-module/lib/replaced.js | 0 .../test/fixtures/browser-module/lib/self.js | 0 .../fixtures/browser-module/lib/toString.js | 0 .../browser-module/node_modules/module-a.js | 0 .../browser-module/node_modules/module-b.js | 0 .../browser-module/node_modules/module-c.js | 0 .../node_modules/recursive-file/a.js | 0 .../node_modules/recursive-file/b.js | 0 .../node_modules/recursive-file/c.js | 0 .../node_modules/recursive-file/d.js | 0 .../node_modules/recursive-file/package.json | 8 - .../test/fixtures/browser-module/package.json | 33 - .../test/fixtures/builtins/package.json | 12 - fixtures/enhanced_resolve/test/fixtures/c.js | 4 - .../enhanced_resolve/test/fixtures/complex.js | 13 - .../test/fixtures/crypto-js/index.js | 0 .../test/fixtures/crypto-js/package.json | 7 - .../test/fixtures/decorated-fs/exists.js | 0 .../test/fixtures/dirOrFile.js | 1 - .../test/fixtures/dirOrFile/index.js | 1 - .../directory-default/directory-default.js | 0 .../node_modules/@org/pkg/dist/string.js | 1 - .../@org/pkg/dist/string.test.d.ts | 1 - .../node_modules/@org/pkg/package.json | 9 - .../node_modules/pkg/dist/string.js | 1 - .../node_modules/pkg/dist/string.test.d.ts | 1 - .../node_modules/pkg/package.json | 9 - .../node_modules/exports-field/package.json | 7 - .../node_modules/pack1/index.js | 0 .../test/fixtures/exports-field/a.js | 1 - .../node_modules/exports-field/lib/browser.js | 1 - .../node_modules/exports-field/lib/index.js | 0 .../exports-field/lib/lib2/main.js | 1 - .../node_modules/exports-field/lib/main.js | 1 - .../node_modules/exports-field/main.js | 1 - .../node_modules/exports-field/package.json | 18 - .../node_modules/exports-field/x.js | 1 - .../invalid-exports-field/index.js | 0 .../invalid-exports-field/package.json | 13 - .../node_modules/invalid-exports-field/umd.js | 0 .../test/fixtures/exports-field/package.json | 5 - .../node_modules/exports-field/index.js | 1 - .../node_modules/exports-field/lib/browser.js | 1 - .../exports-field/lib/lib2/main.js | 1 - .../node_modules/exports-field/lib/main.js | 1 - .../node_modules/exports-field/main.js | 1 - .../node_modules/exports-field/package.json | 17 - .../node_modules/exports-field/index | 0 .../node_modules/exports-field/main.js | 1 - .../node_modules/exports-field/package.json | 10 - .../node_modules/exports-field/src/index.js | 0 .../fixtures/extension-alias/dir/index.js | 0 .../fixtures/extension-alias/dir/index.ts | 0 .../fixtures/extension-alias/dir2/index.js | 0 .../fixtures/extension-alias/dir2/index.mts | 0 .../test/fixtures/extension-alias/index.js | 0 .../test/fixtures/extension-alias/index.mjs | 0 .../fixtures/extension-alias/index.mts.js | 0 .../test/fixtures/extension-alias/index.ts | 0 .../test/fixtures/extensions/app.module.js | 0 .../test/fixtures/extensions/dir/index.js | 0 .../test/fixtures/extensions/dir/index.ts | 0 .../test/fixtures/extensions/foo.js | 0 .../test/fixtures/extensions/foo.ts | 0 .../test/fixtures/extensions/index.js | 0 .../test/fixtures/extensions/index.ts | 0 .../extensions/node_modules/module.js | 0 .../extensions/node_modules/module/index.ts | 0 .../test/fixtures/extensions/package.json | 3 - .../enhanced_resolve/test/fixtures/file.load1 | 0 .../enhanced_resolve/test/fixtures/file.load2 | 0 .../test/fixtures/foo/index.js | 0 .../test/fixtures/foo/package.json | 4 - .../node_modules/m/package.json | 17 - .../node_modules/m/src/features/f.js | 0 .../m/src/features/internal/file.js | 0 .../node_modules/m/src/features/y/y.js | 0 .../node_modules/m/src/internal/i.js | 0 .../node_modules/m/src/middle-1/f.js | 0 .../node_modules/m/src/middle-1/nested/f.js | 0 .../node_modules/m/src/middle-2/nested/f.js | 1 - .../m/src/middle-3/nested/f/nested/f.js | 0 .../node_modules/m/src/middle-4/f/f.js | 0 .../node_modules/m/src/middle-5/f$/$.js | 0 .../node_modules/m/src/middle-5/f/$.js | 0 .../node_modules/m/src/middle/f.js | 0 .../node_modules/m/src/middle/nested/f.js | 0 .../test/fixtures/imports-field/a.js | 1 - .../test/fixtures/imports-field/b.js | 0 .../test/fixtures/imports-field/dir/b.js | 0 .../node_modules/a/lib/browser.js | 1 - .../imports-field/node_modules/a/lib/index.js | 0 .../node_modules/a/lib/lib2/main.js | 1 - .../imports-field/node_modules/a/lib/main.js | 1 - .../imports-field/node_modules/a/main.js | 1 - .../imports-field/node_modules/a/package.json | 18 - .../imports-field/node_modules/a/x.js | 1 - .../imports-field/node_modules/c/index.js | 0 .../test/fixtures/imports-field/package.json | 17 - .../fixtures/incorrect-package/pack1/a.js | 0 .../incorrect-package/pack1/package.json | 2 - .../fixtures/incorrect-package/pack2/a.js | 0 .../incorrect-package/pack2/package.json | 0 .../test/fixtures/issue-238/package.json | 3 - .../test/fixtures/issue-238/src/a/config.js | 0 .../src/common/config/myObjectFile.js | 0 .../enhanced_resolve/test/fixtures/lib.js | 0 .../test/fixtures/lib/complex1.js | 1 - .../test/fixtures/main-field-self/index.js | 0 .../fixtures/main-field-self/package.json | 3 - .../test/fixtures/main-field-self2/index.js | 0 .../fixtures/main-field-self2/package.json | 3 - .../enhanced_resolve/test/fixtures/main1.js | 9 - .../enhanced_resolve/test/fixtures/main2.js | 12 - .../enhanced_resolve/test/fixtures/main3.js | 4 - .../multiple_modules/node_modules/m1/a.js | 3 - .../test/fixtures/no#fragment/#/#.js | 0 fixtures/enhanced_resolve/test/fixtures/no.js | 0 .../browser-module-broken/browser.js | 0 .../browser-module-broken/main.js | 0 .../browser-module-broken/package.json | 4 - .../complexm/node_modules/m1/a.js | 1 - .../complexm/node_modules/m1/index.js | 1 - .../fixtures/node_modules/complexm/step1.js | 1 - .../fixtures/node_modules/complexm/step2.js | 1 - .../fixtures/node_modules/dash-name/index.js | 0 .../node_modules/dash-name/package.json | 4 - .../test/fixtures/node_modules/dash/index.js | 0 .../fixtures/node_modules/dash/package.json | 4 - .../invalidPackageJson/package.json | 0 .../test/fixtures/node_modules/m1/a.js | 3 - .../test/fixtures/node_modules/m1/b.js | 3 - .../test/fixtures/node_modules/m2/b.js | 1 - .../node_modules/recursive-module/file.js | 0 .../node_modules/recursive-module/index.js | 0 .../test/fixtures/pnp-a/m2/a.js | 3 - .../test/fixtures/pnp/pkg/dir/index.js | 0 .../test/fixtures/pnp/pkg/index.js | 0 .../test/fixtures/pnp/pkg/main.js | 0 .../fixtures/pnp/pkg/package-alias/browser.js | 0 .../fixtures/pnp/pkg/package-alias/index.js | 0 .../test/fixtures/pnp/pkg/package.json | 7 - .../test/fixtures/pnp/pkg/typescript/index.ts | 0 .../test/fixtures/pnp/pkg3/a.js | 1 - .../test/fixtures/pnp/pkg3/package.json | 8 - .../prefer-pnp/alternative-modules/m1/b.js | 0 .../restrictions/node_modules/pck1/index.css | 0 .../restrictions/node_modules/pck1/index.js | 0 .../node_modules/pck1/package.json | 3 - .../restrictions/node_modules/pck2/index.css | 0 .../restrictions/node_modules/pck2/module.js | 0 .../node_modules/pck2/package.json | 5 - .../test/fixtures/roots_fall_through/index.js | 0 .../scoped/node_modules/@scope/pack1/main.js | 0 .../node_modules/@scope/pack1/package.json | 5 - .../node_modules/@scope/pack2/lib/index.js | 0 .../scoped/node_modules/@scope/pack2/main.js | 0 .../node_modules/@scope/pack2/package.json | 3 - .../test/fixtures/shortcutdir.js/a.js | 0 .../test/fixtures/yield/a/foo-2/b | 0 .../test/fixtures/yield/a/foo-2/c | 0 .../test/fixtures/yield/a/foo/a | 0 .../test/fixtures/yield/a/foo/b | 0 .../test/fixtures/yield/b/foo/a | 0 .../test/fixtures/yield/c/foo/a | 0 .../test/fixtures/yield/c/foo/package.json | 7 - .../fixtures/\346\265\213\350\257\225.js" | 0 .../\344\270\255\346\226\207.js" | 0 fixtures/pnpm/.gitignore | 1 - fixtures/pnpm/package.json | 10 - fixtures/pnpm/pnpm-lock.yaml | 212 -- fixtures/tsconfig/cases/builtins/thing.js | 0 .../tsconfig/cases/builtins/tsconfig.json | 5 - fixtures/tsconfig/cases/exports/index.js | 0 fixtures/tsconfig/cases/exports/tsconfig.json | 3 - .../extends-extension/base-tsconfig.json | 7 - .../tsconfig/cases/extends-extension/foo.js | 0 .../cases/extends-extension/tsconfig.json | 3 - .../cases/extends-extensionless/foo.js | 0 .../cases/extends-extensionless/tsconfig.json | 3 - .../tsconfig/cases/extends-multiple/foo.js | 0 .../cases/extends-multiple/tsconfig.json | 6 - .../tsconfig/cases/extends-not-found/index.js | 0 .../cases/extends-not-found/tsconfig.json | 3 - .../tsconfig/cases/extends-paths/src/index.js | 0 .../cases/extends-paths/tsconfig.base.json | 7 - .../cases/extends-paths/tsconfig.json | 6 - fixtures/tsconfig/cases/field/index.js | 0 fixtures/tsconfig/cases/field/tsconfig.json | 3 - fixtures/tsconfig/cases/index/index.js | 0 fixtures/tsconfig/cases/index/tsconfig.json | 3 - .../cases/paths_template_variable/foo.js | 0 .../paths_template_variable/tsconfig1.json | 3 - .../paths_template_variable/tsconfig2.json | 8 - .../project_references/app/aliased/index.ts | 0 .../cases/project_references/app/index.ts | 0 .../project_references/app/tsconfig.json | 23 - .../project_a/aliased/index.ts | 0 .../project_references/project_a/conf.json | 8 - .../project_references/project_a/index.ts | 0 .../project_b/src/aliased/index.ts | 0 .../project_b/tsconfig.json | 9 - .../project_references/project_c/index.ts | 0 .../project_c/tsconfig.json | 5 - .../project_references/tsconfig.base.json | 4 - fixtures/tsconfig/cases/suffixes/a.ios.ts | 0 fixtures/tsconfig/cases/suffixes/a.ts | 0 fixtures/tsconfig/cases/suffixes/b.ts | 0 fixtures/tsconfig/cases/suffixes/c-test.ts | 0 fixtures/tsconfig/cases/suffixes/index.ts | 1 - .../tsconfig/cases/suffixes/tsconfig.json | 5 - fixtures/tsconfig/cases/trailing-comma/bar.js | 0 .../tsconfig/cases/trailing-comma/index.js | 0 .../cases/trailing-comma/tsconfig.json | 9 - fixtures/tsconfig/foo.js | 0 fixtures/tsconfig/nested/index.js | 0 fixtures/tsconfig/nested/test.js | 0 fixtures/tsconfig/nested/tsconfig.json | 8 - .../node_modules/tsconfig-exports/conf.json | 7 - .../node_modules/tsconfig-exports/foo.js | 0 .../tsconfig-exports/package.json | 7 - .../node_modules/tsconfig-field/conf.json | 7 - .../node_modules/tsconfig-field/foo.js | 0 .../node_modules/tsconfig-field/package.json | 5 - .../node_modules/tsconfig-index/foo.js | 0 .../node_modules/tsconfig-index/package.json | 4 - .../node_modules/tsconfig-index/tsconfig.json | 7 - .../node_modules/tsconfig-not-used/foo.js | 0 .../tsconfig-not-used/tsconfig.json | 7 - fixtures/tsconfig/package.json | 24 - fixtures/tsconfig/tsconfig.json | 7 - .../tsconfig/tsconfig_template_variable.json | 7 - napi/__test__/resolver.spec.mjs | 260 -- napi/src/lib.rs | 166 - napi/src/options.rs | 261 -- napi/tests/options.test.mjs | 59 - npm/package.json | 67 +- package.json | 53 +- pnpm-lock.yaml | 2690 ----------------- src/builtins.rs | 71 - src/cache.rs | 369 --- src/context.rs | 89 - src/error.rs | 160 - src/file_system.rs | 133 - src/lib.rs | 1670 ---------- src/options.rs | 623 ---- src/package_json.rs | 207 -- src/path.rs | 132 - src/resolution.rs | 92 - src/specifier.rs | 230 -- src/tests/alias.rs | 280 -- src/tests/browser_field.rs | 189 -- src/tests/builtins.rs | 121 - src/tests/dependencies.rs | 110 - src/tests/exports_field.rs | 2546 ---------------- src/tests/extension_alias.rs | 66 - src/tests/extensions.rs | 125 - src/tests/fallback.rs | 100 - src/tests/full_specified.rs | 113 - src/tests/imports_field.rs | 1320 -------- src/tests/incorrect_description_file.rs | 62 - src/tests/main_field.rs | 24 - src/tests/memory_fs.rs | 74 - src/tests/missing.rs | 106 - src/tests/mod.rs | 49 - src/tests/resolve.rs | 119 - src/tests/restrictions.rs | 25 - src/tests/roots.rs | 92 - src/tests/scoped_packages.rs | 25 - src/tests/simple.rs | 68 - src/tests/symlink.rs | 121 - src/tests/tsconfig_paths.rs | 507 ---- src/tests/tsconfig_project_references.rs | 101 - src/tsconfig.rs | 212 -- tests/integration_test.rs | 102 - tests/package.json | 3 - tests/resolve_test.rs | 104 - 290 files changed, 50 insertions(+), 15709 deletions(-) delete mode 100644 Cargo.lock delete mode 100644 fixtures/enhanced_resolve/lib/index.js delete mode 100644 fixtures/enhanced_resolve/package.json delete mode 100644 fixtures/enhanced_resolve/test/.gitignore delete mode 100644 fixtures/enhanced_resolve/test/fixtures/#/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/abc.txt delete mode 100644 fixtures/enhanced_resolve/test/fixtures/alias/files/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/browser/module-a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/ignore.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/replaced.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/self.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/toString.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-c.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/c.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/d.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/builtins/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/c.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/complex.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/crypto-js/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/decorated-fs/exists.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/dirOrFile.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/directory-default/directory-default.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/pack1/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/umd.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/index delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/src/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.mts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mjs delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mts.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/app.module.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/foo.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/foo.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/file.load1 delete mode 100644 fixtures/enhanced_resolve/test/fixtures/file.load2 delete mode 100644 fixtures/enhanced_resolve/test/fixtures/foo/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/foo/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/internal/file.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/y/y.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/internal/i.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-3/nested/f/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-4/f/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f$/$.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f/$.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/dir/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/c/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/issue-238/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/issue-238/src/a/config.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/issue-238/src/common/config/myObjectFile.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/lib.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/lib/complex1.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self2/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main1.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main2.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main3.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/no#fragment/#/#.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/no.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/invalidPackageJson/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/file.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/dir/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/typescript/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/prefer-pnp/alternative-modules/m1/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.css delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/index.css delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/module.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/roots_fall_through/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/lib/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/shortcutdir.js/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/b delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/c delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo/a delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo/b delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/b/foo/a delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/c/foo/a delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json delete mode 100644 "fixtures/enhanced_resolve/test/fixtures/\346\265\213\350\257\225.js" delete mode 100644 "fixtures/misc/\344\270\255\346\226\207/\344\270\255\346\226\207.js" delete mode 100644 fixtures/pnpm/.gitignore delete mode 100644 fixtures/pnpm/package.json delete mode 100644 fixtures/pnpm/pnpm-lock.yaml delete mode 100644 fixtures/tsconfig/cases/builtins/thing.js delete mode 100644 fixtures/tsconfig/cases/builtins/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/exports/index.js delete mode 100644 fixtures/tsconfig/cases/exports/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-extension/base-tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-extension/foo.js delete mode 100644 fixtures/tsconfig/cases/extends-extension/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-extensionless/foo.js delete mode 100644 fixtures/tsconfig/cases/extends-extensionless/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-multiple/foo.js delete mode 100644 fixtures/tsconfig/cases/extends-multiple/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-not-found/index.js delete mode 100644 fixtures/tsconfig/cases/extends-not-found/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-paths/src/index.js delete mode 100644 fixtures/tsconfig/cases/extends-paths/tsconfig.base.json delete mode 100644 fixtures/tsconfig/cases/extends-paths/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/field/index.js delete mode 100644 fixtures/tsconfig/cases/field/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/index/index.js delete mode 100644 fixtures/tsconfig/cases/index/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/paths_template_variable/foo.js delete mode 100644 fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json delete mode 100644 fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json delete mode 100644 fixtures/tsconfig/cases/project_references/app/aliased/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/app/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/app/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/project_references/project_a/aliased/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_a/conf.json delete mode 100644 fixtures/tsconfig/cases/project_references/project_a/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_b/src/aliased/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_b/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/project_references/project_c/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_c/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/project_references/tsconfig.base.json delete mode 100644 fixtures/tsconfig/cases/suffixes/a.ios.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/a.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/b.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/c-test.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/index.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/trailing-comma/bar.js delete mode 100644 fixtures/tsconfig/cases/trailing-comma/index.js delete mode 100644 fixtures/tsconfig/cases/trailing-comma/tsconfig.json delete mode 100644 fixtures/tsconfig/foo.js delete mode 100644 fixtures/tsconfig/nested/index.js delete mode 100644 fixtures/tsconfig/nested/test.js delete mode 100644 fixtures/tsconfig/nested/tsconfig.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-exports/conf.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-exports/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-exports/package.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-field/conf.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-field/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-field/package.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-index/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-index/package.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-not-used/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json delete mode 100755 fixtures/tsconfig/package.json delete mode 100644 fixtures/tsconfig/tsconfig.json delete mode 100644 fixtures/tsconfig/tsconfig_template_variable.json delete mode 100644 napi/__test__/resolver.spec.mjs delete mode 100644 napi/src/lib.rs delete mode 100644 napi/src/options.rs delete mode 100644 napi/tests/options.test.mjs delete mode 100644 pnpm-lock.yaml delete mode 100644 src/builtins.rs delete mode 100644 src/cache.rs delete mode 100644 src/context.rs delete mode 100644 src/error.rs delete mode 100644 src/file_system.rs delete mode 100644 src/lib.rs delete mode 100644 src/options.rs delete mode 100644 src/package_json.rs delete mode 100644 src/path.rs delete mode 100644 src/resolution.rs delete mode 100644 src/specifier.rs delete mode 100644 src/tests/alias.rs delete mode 100644 src/tests/browser_field.rs delete mode 100644 src/tests/builtins.rs delete mode 100644 src/tests/dependencies.rs delete mode 100644 src/tests/exports_field.rs delete mode 100644 src/tests/extension_alias.rs delete mode 100644 src/tests/extensions.rs delete mode 100644 src/tests/fallback.rs delete mode 100644 src/tests/full_specified.rs delete mode 100644 src/tests/imports_field.rs delete mode 100644 src/tests/incorrect_description_file.rs delete mode 100644 src/tests/main_field.rs delete mode 100644 src/tests/memory_fs.rs delete mode 100644 src/tests/missing.rs delete mode 100644 src/tests/mod.rs delete mode 100644 src/tests/resolve.rs delete mode 100644 src/tests/restrictions.rs delete mode 100644 src/tests/roots.rs delete mode 100644 src/tests/scoped_packages.rs delete mode 100644 src/tests/simple.rs delete mode 100644 src/tests/symlink.rs delete mode 100644 src/tests/tsconfig_paths.rs delete mode 100644 src/tests/tsconfig_project_references.rs delete mode 100644 src/tsconfig.rs delete mode 100644 tests/integration_test.rs delete mode 100644 tests/package.json delete mode 100644 tests/resolve_test.rs diff --git a/Cargo.lock b/Cargo.lock deleted file mode 100644 index c83523b3..00000000 --- a/Cargo.lock +++ /dev/null @@ -1,858 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "aho-corasick" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" -dependencies = [ - "memchr", -] - -[[package]] -name = "anes" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "735d4f398ca57cfa2880225c2bf81c3b9af3be5bb22e44ae70118dad38713e84" - -[[package]] -name = "autocfg" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "bitflags" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" - -[[package]] -name = "bpaf" -version = "0.9.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3280efcf6d66bc77c2cf9b67dc8acee47a217d9be67dd590b3230dffe663724d" - -[[package]] -name = "cast" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "ciborium" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42e69ffd6f0917f5c029256a24d0161db17cea3997d185db0d35926308770f0e" -dependencies = [ - "ciborium-io", - "ciborium-ll", - "serde", -] - -[[package]] -name = "ciborium-io" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05afea1e0a06c9be33d539b876f1ce3692f4afea2cb41f740e7743225ed1c757" - -[[package]] -name = "ciborium-ll" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57663b653d948a338bfb3eeba9bb2fd5fcfaecb9e199e87e1eda4d9e8b240fd9" -dependencies = [ - "ciborium-io", - "half", -] - -[[package]] -name = "clean-path" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aaa6b4b263a5d737e9bf6b7c09b72c41a5480aec4d7219af827f6564e950b6a5" - -[[package]] -name = "codspeed" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a104ac948e0188b921eb3fcbdd55dcf62e542df4c7ab7e660623f6288302089" -dependencies = [ - "colored", - "libc", - "serde_json", -] - -[[package]] -name = "colored" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbf2150cce219b664a8a70df7a1f933836724b503f8a413af9365b4dcc4d90b8" -dependencies = [ - "lazy_static", - "windows-sys 0.48.0", -] - -[[package]] -name = "convert_case" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec182b0ca2f35d8fc196cf3404988fd8b8c739a4d270ff118a398feb0cbec1ca" -dependencies = [ - "unicode-segmentation", -] - -[[package]] -name = "criterion2" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7258985df1aa8b33359ee2392cbc3b7802875242cdacdda91a17a602132c24a9" -dependencies = [ - "anes", - "bpaf", - "cast", - "ciborium", - "codspeed", - "colored", - "num-traits", - "oorandom", - "serde", - "serde_json", - "walkdir", -] - -[[package]] -name = "crossbeam-deque" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" -dependencies = [ - "crossbeam-epoch", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.9.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" -dependencies = [ - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" - -[[package]] -name = "crunchy" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" - -[[package]] -name = "ctor" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edb49164822f3ee45b17acd4a208cfc1251410cf0cad9a833234c9890774dd9f" -dependencies = [ - "quote", - "syn", -] - -[[package]] -name = "dashmap" -version = "5.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" -dependencies = [ - "cfg-if", - "hashbrown", - "lock_api", - "once_cell", - "parking_lot_core", -] - -[[package]] -name = "document-features" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef5282ad69563b5fc40319526ba27e0e7363d552a896f0297d54f767717f9b95" -dependencies = [ - "litrs", -] - -[[package]] -name = "dunce" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b" - -[[package]] -name = "either" -version = "1.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dca9240753cf90908d7e4aac30f630662b02aebaa1b58a3cadabdb23385b58b" - -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "filetime" -version = "0.2.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ee447700ac8aa0b2f2bd7bc4462ad686ba06baa6727ac149a2d6277f0d240fd" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall 0.4.1", - "windows-sys 0.52.0", -] - -[[package]] -name = "half" -version = "2.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dd08c532ae367adf81c312a4580bc67f1d0fe8bc9c460520283f4c0ff277888" -dependencies = [ - "cfg-if", - "crunchy", -] - -[[package]] -name = "hashbrown" -version = "0.14.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" - -[[package]] -name = "indexmap" -version = "2.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" -dependencies = [ - "equivalent", - "hashbrown", - "serde", -] - -[[package]] -name = "itoa" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" - -[[package]] -name = "json-strip-comments" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3d129799327c8f80861e467c59b825ba24c277dba6ad0d71a141dc98f9e04ee" - -[[package]] -name = "lazy_static" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" - -[[package]] -name = "libc" -version = "0.2.155" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" - -[[package]] -name = "libloading" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c2a198fb6b0eada2a8df47933734e6d35d350665a33a3593d7164fa52c75c19" -dependencies = [ - "cfg-if", - "windows-targets 0.52.5", -] - -[[package]] -name = "litrs" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4ce301924b7887e9d637144fdade93f9dfff9b60981d4ac161db09720d39aa5" - -[[package]] -name = "lock_api" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" -dependencies = [ - "autocfg", - "scopeguard", -] - -[[package]] -name = "memchr" -version = "2.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" - -[[package]] -name = "napi" -version = "2.16.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfc300228808a0e6aea5a58115c82889240bcf8dab16fc25ad675b33e454b368" -dependencies = [ - "bitflags 2.5.0", - "ctor", - "napi-derive", - "napi-sys", - "once_cell", - "serde", - "serde_json", -] - -[[package]] -name = "napi-build" -version = "2.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1c0f5d67ee408a4685b61f5ab7e58605c8ae3f2b4189f0127d804ff13d5560a" - -[[package]] -name = "napi-derive" -version = "2.16.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0e034ddf6155192cf83f267ede763fe6c164dfa9971585436b16173718d94c4" -dependencies = [ - "cfg-if", - "convert_case", - "napi-derive-backend", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "napi-derive-backend" -version = "1.0.67" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bff2c00437f3b3266391eb5e6aa25d0029187daf5caf05b8e3271468fb5ae73e" -dependencies = [ - "convert_case", - "once_cell", - "proc-macro2", - "quote", - "regex", - "semver", - "syn", -] - -[[package]] -name = "napi-sys" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "427802e8ec3a734331fec1035594a210ce1ff4dc5bc1950530920ab717964ea3" -dependencies = [ - "libloading", -] - -[[package]] -name = "normalize-path" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5438dd2b2ff4c6df6e1ce22d825ed2fa93ee2922235cc45186991717f0a892d" - -[[package]] -name = "num-traits" -version = "0.2.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" -dependencies = [ - "autocfg", -] - -[[package]] -name = "once_cell" -version = "1.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" - -[[package]] -name = "oorandom" -version = "11.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575" - -[[package]] -name = "oxc_napi_resolver" -version = "0.0.0" -dependencies = [ - "napi", - "napi-build", - "napi-derive", - "oxc_resolver", -] - -[[package]] -name = "oxc_resolver" -version = "1.8.1" -dependencies = [ - "criterion2", - "dashmap", - "document-features", - "dunce", - "json-strip-comments", - "normalize-path", - "once_cell", - "rayon", - "rustc-hash", - "serde", - "serde_json", - "thiserror", - "tracing", - "typescript_tsconfig_json", - "vfs", -] - -[[package]] -name = "parking_lot_core" -version = "0.9.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall 0.5.1", - "smallvec", - "windows-targets 0.52.5", -] - -[[package]] -name = "pin-project-lite" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" - -[[package]] -name = "proc-macro2" -version = "1.0.85" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22244ce15aa966053a896d1accb3a6e68469b97c7f33f284b99f0d576879fc23" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.36" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "rayon" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" -dependencies = [ - "either", - "rayon-core", -] - -[[package]] -name = "rayon-core" -version = "1.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" -dependencies = [ - "crossbeam-deque", - "crossbeam-utils", -] - -[[package]] -name = "redox_syscall" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" -dependencies = [ - "bitflags 1.3.2", -] - -[[package]] -name = "redox_syscall" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "469052894dcb553421e483e4209ee581a45100d31b4018de03e5a7ad86374a7e" -dependencies = [ - "bitflags 2.5.0", -] - -[[package]] -name = "regex" -version = "1.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" -dependencies = [ - "aho-corasick", - "memchr", - "regex-automata", - "regex-syntax", -] - -[[package]] -name = "regex-automata" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", -] - -[[package]] -name = "regex-syntax" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" - -[[package]] -name = "rustc-hash" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" - -[[package]] -name = "ryu" -version = "1.0.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" - -[[package]] -name = "same-file" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "scopeguard" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" - -[[package]] -name = "semver" -version = "1.0.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" - -[[package]] -name = "serde" -version = "1.0.203" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7253ab4de971e72fb7be983802300c30b5a7f0c2e56fab8abfc6a214307c0094" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.203" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "serde_json" -version = "1.0.117" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3" -dependencies = [ - "indexmap", - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "smallvec" -version = "1.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" - -[[package]] -name = "syn" -version = "2.0.66" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c42f3f41a2de00b01c0aaad383c5a45241efc8b2d1eda5661812fda5f3cdcff5" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "thiserror" -version = "1.0.61" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.61" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "tracing" -version = "0.1.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" -dependencies = [ - "pin-project-lite", - "tracing-attributes", - "tracing-core", -] - -[[package]] -name = "tracing-attributes" -version = "0.1.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "tracing-core" -version = "0.1.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" -dependencies = [ - "once_cell", -] - -[[package]] -name = "typescript_tsconfig_json" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7cc416eaf05297012ead9d192226fe9a92e9a20f64f8780efb9085aaae9b590" -dependencies = [ - "clean-path", - "indexmap", - "rustc-hash", - "serde", - "serde_json", -] - -[[package]] -name = "unicode-ident" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" - -[[package]] -name = "unicode-segmentation" -version = "1.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" - -[[package]] -name = "vfs" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "654cd097e182a71dbf899178e6b5662c2157dd0b8afd5975de18008f6fc173d1" -dependencies = [ - "filetime", -] - -[[package]] -name = "walkdir" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" -dependencies = [ - "same-file", - "winapi-util", -] - -[[package]] -name = "winapi-util" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b" -dependencies = [ - "windows-sys 0.52.0", -] - -[[package]] -name = "windows-sys" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" -dependencies = [ - "windows-targets 0.48.5", -] - -[[package]] -name = "windows-sys" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" -dependencies = [ - "windows-targets 0.52.5", -] - -[[package]] -name = "windows-targets" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" -dependencies = [ - "windows_aarch64_gnullvm 0.48.5", - "windows_aarch64_msvc 0.48.5", - "windows_i686_gnu 0.48.5", - "windows_i686_msvc 0.48.5", - "windows_x86_64_gnu 0.48.5", - "windows_x86_64_gnullvm 0.48.5", - "windows_x86_64_msvc 0.48.5", -] - -[[package]] -name = "windows-targets" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" -dependencies = [ - "windows_aarch64_gnullvm 0.52.5", - "windows_aarch64_msvc 0.52.5", - "windows_i686_gnu 0.52.5", - "windows_i686_gnullvm", - "windows_i686_msvc 0.52.5", - "windows_x86_64_gnu 0.52.5", - "windows_x86_64_gnullvm 0.52.5", - "windows_x86_64_msvc 0.52.5", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" - -[[package]] -name = "windows_i686_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" - -[[package]] -name = "windows_i686_gnu" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" - -[[package]] -name = "windows_i686_gnullvm" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" - -[[package]] -name = "windows_i686_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" - -[[package]] -name = "windows_i686_msvc" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" diff --git a/fixtures/enhanced_resolve/lib/index.js b/fixtures/enhanced_resolve/lib/index.js deleted file mode 100644 index 1e872e8f..00000000 --- a/fixtures/enhanced_resolve/lib/index.js +++ /dev/null @@ -1 +0,0 @@ -// mimic enhanced-resolved root directory structure diff --git a/fixtures/enhanced_resolve/package.json b/fixtures/enhanced_resolve/package.json deleted file mode 100644 index d1b845b5..00000000 --- a/fixtures/enhanced_resolve/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "enhanced-resolve", - "main": "lib/index.js" -} diff --git a/fixtures/enhanced_resolve/test/.gitignore b/fixtures/enhanced_resolve/test/.gitignore deleted file mode 100644 index bbbec5f4..00000000 --- a/fixtures/enhanced_resolve/test/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# created by symlink.rs -/temp diff --git a/fixtures/enhanced_resolve/test/fixtures/#/a.js b/fixtures/enhanced_resolve/test/fixtures/#/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/a.js b/fixtures/enhanced_resolve/test/fixtures/a.js deleted file mode 100644 index 896ffc6d..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/abc.txt b/fixtures/enhanced_resolve/test/fixtures/abc.txt deleted file mode 100644 index f2ba8f84..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/abc.txt +++ /dev/null @@ -1 +0,0 @@ -abc \ No newline at end of file diff --git a/fixtures/enhanced_resolve/test/fixtures/alias/files/a.js b/fixtures/enhanced_resolve/test/fixtures/alias/files/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/b.js b/fixtures/enhanced_resolve/test/fixtures/b.js deleted file mode 100644 index 11476340..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/b.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function b() { - return "This is b"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/browser/module-a.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/browser/module-a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/browser.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/ignore.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/ignore.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/replaced.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/replaced.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/self.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/self.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/toString.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/toString.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-a.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-b.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-c.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-c.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/a.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/b.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/c.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/c.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/d.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/d.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json deleted file mode 100644 index c13fe23b..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "browser": { - "a.js": "./a", - "./b.js": "./b", - "c.js": "./d.js", - "./d.js": "./c.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/package.json b/fixtures/enhanced_resolve/test/fixtures/browser-module/package.json deleted file mode 100644 index 19ff7739..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/browser-module/package.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "exports": { - "./lib/index.js": "./lib/index.js" - }, - "browser": { - "./lib/ignore.js": false, - "./lib/replaced.js": "./lib/browser", - "module-a": "./browser/module-a.js", - "module-b": "module-c", - "module-c": "module-c", - "./toString": "./lib/toString.js", - "./lib/main.js": "./lib/main.js", - "./main.js": "./lib/main.js", - "./lib/xyz.js": "./xyz.js", - "./xyz.js": "./lib/xyz.js", - "./lib/non-existent.js": "./lib/non-existent.js", - ".": false, - "./number": 1, - "./foo": "./lib/replaced.js?query" - }, - "innerBrowser1": { - "field": { - "browser": { - "./lib/main1.js": "./lib/main.js" - } - } - }, - "innerBrowser2": { - "browser": { - "./lib/main2.js": "./lib/replaced.js" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/builtins/package.json b/fixtures/enhanced_resolve/test/fixtures/builtins/package.json deleted file mode 100644 index 4a54ea96..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/builtins/package.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "name": "builtins", - "private": true, - "imports": { - "#fs": { - "default": "fs" - }, - "#http": { - "node": "node:http" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/c.js b/fixtures/enhanced_resolve/test/fixtures/c.js deleted file mode 100644 index e3aca8aa..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/c.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = function b() { - require("./a"); - return "This is c"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/complex.js b/fixtures/enhanced_resolve/test/fixtures/complex.js deleted file mode 100644 index 1f62db84..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/complex.js +++ /dev/null @@ -1,13 +0,0 @@ -var 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); diff --git a/fixtures/enhanced_resolve/test/fixtures/crypto-js/index.js b/fixtures/enhanced_resolve/test/fixtures/crypto-js/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json b/fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json deleted file mode 100644 index 1d31aa8b..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "crypto-js", - "main": "index.js", - "browser": { - "crypto": false - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/decorated-fs/exists.js b/fixtures/enhanced_resolve/test/fixtures/decorated-fs/exists.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/dirOrFile.js b/fixtures/enhanced_resolve/test/fixtures/dirOrFile.js deleted file mode 100644 index c3cb885f..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/dirOrFile.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "file"; diff --git a/fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js b/fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js deleted file mode 100644 index 85e01cd4..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "dir"; diff --git a/fixtures/enhanced_resolve/test/fixtures/directory-default/directory-default.js b/fixtures/enhanced_resolve/test/fixtures/directory-default/directory-default.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js deleted file mode 100644 index d1007aae..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js +++ /dev/null @@ -1 +0,0 @@ -export default "string"; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts deleted file mode 100644 index cb0ff5c3..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json deleted file mode 100644 index b523a1e9..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "@org/pkg", - "exports": { - "./*.js": { - "types": "./dist/*.d.ts", - "default": "./dist/*.js" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js deleted file mode 100644 index d1007aae..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js +++ /dev/null @@ -1 +0,0 @@ -export default "string"; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts deleted file mode 100644 index cb0ff5c3..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json deleted file mode 100644 index 8e55fb46..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "@raviqqe/hidash", - "exports": { - "./*.js": { - "types": "./dist/*.d.ts", - "default": "./dist/*.js" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json deleted file mode 100644 index f0edf449..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "exports-field", - "version": "1.0.0", - "exports": { - ".": "./a/../b/../../pack1/index.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/pack1/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/pack1/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/a.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/a.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json deleted file mode 100644 index 6b105c08..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "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/": { - "webpack": ["./lib/lib2/", "./lib/"], - "node": "./lib/", - "default": "./lib/" - }, - "./dist/a.js": "./../../a.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json deleted file mode 100644 index 0012a3de..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "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" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/umd.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/umd.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field/package.json deleted file mode 100644 index 5fa72bb5..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "@exports-field/core", - "version": "1.0.0", - "exports": "./a.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json deleted file mode 100644 index e6f12074..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "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/lib2/", "./lib/"], - "node": "./lib/", - "default": "./lib/" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/index b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/index deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json deleted file mode 100644 index 1a838f49..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "name": "exports-field", - "exportsField": { - "exports": "./main.js" - }, - "ex": "./index", - "broken": { - ".": "./src" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/src/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/src/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.ts b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.mts b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.mts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mjs b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mjs deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mts.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mts.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.ts b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/app.module.js b/fixtures/enhanced_resolve/test/fixtures/extensions/app.module.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.js b/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/foo.js b/fixtures/enhanced_resolve/test/fixtures/extensions/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/foo.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/foo.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/index.js b/fixtures/enhanced_resolve/test/fixtures/extensions/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/index.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module.js b/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module/index.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/package.json b/fixtures/enhanced_resolve/test/fixtures/extensions/package.json deleted file mode 100644 index 5e55a1e8..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/extensions/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "./index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/file.load1 b/fixtures/enhanced_resolve/test/fixtures/file.load1 deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/file.load2 b/fixtures/enhanced_resolve/test/fixtures/file.load2 deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/foo/index.js b/fixtures/enhanced_resolve/test/fixtures/foo/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/foo/package.json b/fixtures/enhanced_resolve/test/fixtures/foo/package.json deleted file mode 100644 index da86787a..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/foo/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "foo", - "version": "1.0.0" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json deleted file mode 100644 index aa2be496..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "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" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/internal/file.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/internal/file.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/y/y.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/y/y.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/internal/i.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/internal/i.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/nested/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js deleted file mode 100644 index e5b70a86..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = { nested: "nested" } diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-3/nested/f/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-3/nested/f/nested/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-4/f/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-4/f/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f$/$.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f$/$.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f/$.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f/$.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/nested/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/a.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/a.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/b.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/dir/b.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/dir/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/index.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json deleted file mode 100644 index 8d8d3a46..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "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/lib2/", "./lib/"], - "node": "./lib/", - "default": "./lib/" - }, - "./dist/a.js": "./../../a.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/c/index.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/c/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/imports-field/package.json deleted file mode 100644 index 248351a9..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "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" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/a.js b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json deleted file mode 100644 index ded7faa2..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json +++ /dev/null @@ -1,2 +0,0 @@ -{ - "main": "./a.js", diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/a.js b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/package.json b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/package.json deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/issue-238/package.json b/fixtures/enhanced_resolve/test/fixtures/issue-238/package.json deleted file mode 100644 index 352055cd..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/issue-238/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "private": true -} diff --git a/fixtures/enhanced_resolve/test/fixtures/issue-238/src/a/config.js b/fixtures/enhanced_resolve/test/fixtures/issue-238/src/a/config.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/issue-238/src/common/config/myObjectFile.js b/fixtures/enhanced_resolve/test/fixtures/issue-238/src/common/config/myObjectFile.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/lib.js b/fixtures/enhanced_resolve/test/fixtures/lib.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/lib/complex1.js b/fixtures/enhanced_resolve/test/fixtures/lib/complex1.js deleted file mode 100644 index b3de3d70..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/lib/complex1.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "lib complex1"; diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self/index.js b/fixtures/enhanced_resolve/test/fixtures/main-field-self/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json b/fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json deleted file mode 100644 index a2b6f341..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "./" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self2/index.js b/fixtures/enhanced_resolve/test/fixtures/main-field-self2/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json b/fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json deleted file mode 100644 index 4fa6f730..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "." -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main1.js b/fixtures/enhanced_resolve/test/fixtures/main1.js deleted file mode 100644 index 168f2a1e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main1.js +++ /dev/null @@ -1,9 +0,0 @@ -var a = require("./a"); -if (x) { - for (var i = 0; i < 100; i++) { - while (true) require("./b"); - do { - i++; - } while (require("m1/a")()); - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main2.js b/fixtures/enhanced_resolve/test/fixtures/main2.js deleted file mode 100644 index 39f062b1..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main2.js +++ /dev/null @@ -1,12 +0,0 @@ -var 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"); - }); - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main3.js b/fixtures/enhanced_resolve/test/fixtures/main3.js deleted file mode 100644 index 1c180166..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main3.js +++ /dev/null @@ -1,4 +0,0 @@ -var a = require("./a"); -require.ensure([], function(require) { - require("./c.js"); -}); diff --git a/fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js b/fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js deleted file mode 100644 index 997c1051..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is nested m1/a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/no#fragment/#/#.js b/fixtures/enhanced_resolve/test/fixtures/no#fragment/#/#.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/no.js b/fixtures/enhanced_resolve/test/fixtures/no.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/browser.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/browser.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/main.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json deleted file mode 100644 index c469e1fd..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "main": "./main.js", - "browser": "./browser.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js deleted file mode 100644 index 549620a5..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "the correct a.js"; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js deleted file mode 100644 index 5db6632e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = " :) " + require("m2/b.js"); diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js deleted file mode 100644 index d308569d..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require("m1/a") + require("m1"); diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js deleted file mode 100644 index cb8127e8..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "Step2"; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json deleted file mode 100644 index 8d6dfa56..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "dash-name", - "exports": "./index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json deleted file mode 100644 index 4fd8706e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "dash", - "exports": "./index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/invalidPackageJson/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/invalidPackageJson/package.json deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js deleted file mode 100644 index 46fc8e6c..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is m1/a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js deleted file mode 100644 index 8565c244..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is m1/b"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js deleted file mode 100644 index 34faaaf5..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "This is m2/b"; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/file.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/file.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js b/fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js deleted file mode 100644 index 997c1051..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is nested m1/a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/dir/index.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/dir/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/index.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/main.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/browser.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/browser.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/index.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json deleted file mode 100644 index e20ceaeb..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "main": "main.js", - "browser": { - "./package-alias/index.js": "./package-alias/browser.js", - "module": "pkg/dir/index" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/typescript/index.ts b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/typescript/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json deleted file mode 100644 index 4a1f838e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "@exports-field/core", - "version": "1.0.0", - "exports": { - ".": "./a.js", - "./x": "./a.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/prefer-pnp/alternative-modules/m1/b.js b/fixtures/enhanced_resolve/test/fixtures/prefer-pnp/alternative-modules/m1/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.css b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.css deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.js b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json deleted file mode 100644 index 14ab704d..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/index.css b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/index.css deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/module.js b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/module.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json deleted file mode 100644 index ee0eb71b..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "main": "../../../c.js", - "module": "module.js", - "style": "index.css" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/roots_fall_through/index.js b/fixtures/enhanced_resolve/test/fixtures/roots_fall_through/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/main.js b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json deleted file mode 100644 index 70a0f20f..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "browser": { - "./index.js": "./main.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/lib/index.js b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/lib/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/main.js b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json deleted file mode 100644 index 2af9e0d1..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "./main.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/shortcutdir.js/a.js b/fixtures/enhanced_resolve/test/fixtures/shortcutdir.js/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/b b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/b deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/c b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/c deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/a b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/a deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/b b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/b deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/b/foo/a b/fixtures/enhanced_resolve/test/fixtures/yield/b/foo/a deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/a b/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/a deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json b/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json deleted file mode 100644 index 0acc4b4c..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "foo", - "version": "1.0.0", - "browser": { - "./a": false - } -} diff --git "a/fixtures/enhanced_resolve/test/fixtures/\346\265\213\350\257\225.js" "b/fixtures/enhanced_resolve/test/fixtures/\346\265\213\350\257\225.js" deleted file mode 100644 index e69de29b..00000000 diff --git "a/fixtures/misc/\344\270\255\346\226\207/\344\270\255\346\226\207.js" "b/fixtures/misc/\344\270\255\346\226\207/\344\270\255\346\226\207.js" deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/pnpm/.gitignore b/fixtures/pnpm/.gitignore deleted file mode 100644 index 3c3629e6..00000000 --- a/fixtures/pnpm/.gitignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/fixtures/pnpm/package.json b/fixtures/pnpm/package.json deleted file mode 100644 index 78712e2b..00000000 --- a/fixtures/pnpm/package.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "name": "pnpm", - "version": "1.0.0", - "private": true, - "devDependencies": { - "axios": "1.6.2", - "styled-components": "6.1.1", - "postcss": "8.4.33" - } -} diff --git a/fixtures/pnpm/pnpm-lock.yaml b/fixtures/pnpm/pnpm-lock.yaml deleted file mode 100644 index e51dfd6a..00000000 --- a/fixtures/pnpm/pnpm-lock.yaml +++ /dev/null @@ -1,212 +0,0 @@ -lockfileVersion: '6.0' - -settings: - autoInstallPeers: true - excludeLinksFromLockfile: false - -devDependencies: - axios: - specifier: 1.6.2 - version: 1.6.2 - postcss: - specifier: 8.4.33 - version: 8.4.33 - styled-components: - specifier: 6.1.1 - version: 6.1.1(react-dom@18.2.0)(react@18.2.0) - -packages: - - /@emotion/is-prop-valid@1.2.1: - resolution: {integrity: sha512-61Mf7Ufx4aDxx1xlDeOm8aFFigGHE4z+0sKCa+IHCeZKiyP9RLD0Mmx7m8b9/Cf37f7NAvQOOJAbQQGVr5uERw==} - dependencies: - '@emotion/memoize': 0.8.1 - dev: true - - /@emotion/memoize@0.8.1: - resolution: {integrity: sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA==} - dev: true - - /@emotion/unitless@0.8.1: - resolution: {integrity: sha512-KOEGMu6dmJZtpadb476IsZBclKvILjopjUii3V+7MnXIQCYh8W3NgNcgwo21n9LXZX6EDIKvqfjYxXebDwxKmQ==} - dev: true - - /@types/stylis@4.2.4: - resolution: {integrity: sha512-36ZrGJ8fgtBr6nwNnuJ9jXIj+bn/pF6UoqmrQT7+Y99+tFFeHHsoR54+194dHdyhPjgbeoNz3Qru0oRt0l6ASQ==} - dev: true - - /asynckit@0.4.0: - resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} - dev: true - - /axios@1.6.2: - resolution: {integrity: sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A==} - dependencies: - follow-redirects: 1.15.3 - form-data: 4.0.0 - proxy-from-env: 1.1.0 - transitivePeerDependencies: - - debug - dev: true - - /camelize@1.0.1: - resolution: {integrity: sha512-dU+Tx2fsypxTgtLoE36npi3UqcjSSMNYfkqgmoEhtZrraP5VWq0K7FkWVTYa8eMPtnU/G2txVsfdCJTn9uzpuQ==} - dev: true - - /combined-stream@1.0.8: - resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} - engines: {node: '>= 0.8'} - dependencies: - delayed-stream: 1.0.0 - dev: true - - /css-color-keywords@1.0.0: - resolution: {integrity: sha512-FyyrDHZKEjXDpNJYvVsV960FiqQyXc/LlYmsxl2BcdMb2WPx0OGRVgTg55rPSyLSNMqP52R9r8geSp7apN3Ofg==} - engines: {node: '>=4'} - dev: true - - /css-to-react-native@3.2.0: - resolution: {integrity: sha512-e8RKaLXMOFii+02mOlqwjbD00KSEKqblnpO9e++1aXS1fPQOpS1YoqdVHBqPjHNoxeF2mimzVqawm2KCbEdtHQ==} - dependencies: - camelize: 1.0.1 - css-color-keywords: 1.0.0 - postcss-value-parser: 4.2.0 - dev: true - - /csstype@3.1.2: - resolution: {integrity: sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==} - dev: true - - /delayed-stream@1.0.0: - resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} - engines: {node: '>=0.4.0'} - dev: true - - /follow-redirects@1.15.3: - resolution: {integrity: sha512-1VzOtuEM8pC9SFU1E+8KfTjZyMztRsgEfwQl44z8A25uy13jSzTj6dyK2Df52iV0vgHCfBwLhDWevLn95w5v6Q==} - engines: {node: '>=4.0'} - peerDependencies: - debug: '*' - peerDependenciesMeta: - debug: - optional: true - dev: true - - /form-data@4.0.0: - resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==} - engines: {node: '>= 6'} - dependencies: - asynckit: 0.4.0 - combined-stream: 1.0.8 - mime-types: 2.1.35 - dev: true - - /js-tokens@4.0.0: - resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} - dev: true - - /loose-envify@1.4.0: - resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==} - hasBin: true - dependencies: - js-tokens: 4.0.0 - dev: true - - /mime-db@1.52.0: - resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} - engines: {node: '>= 0.6'} - dev: true - - /mime-types@2.1.35: - resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} - engines: {node: '>= 0.6'} - dependencies: - mime-db: 1.52.0 - dev: true - - /nanoid@3.3.7: - resolution: {integrity: sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==} - engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} - hasBin: true - dev: true - - /picocolors@1.0.0: - resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==} - dev: true - - /postcss-value-parser@4.2.0: - resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==} - dev: true - - /postcss@8.4.33: - resolution: {integrity: sha512-Kkpbhhdjw2qQs2O2DGX+8m5OVqEcbB9HRBvuYM9pgrjEFUg30A9LmXNlTAUj4S9kgtGyrMbTzVjH7E+s5Re2yg==} - engines: {node: ^10 || ^12 || >=14} - dependencies: - nanoid: 3.3.7 - picocolors: 1.0.0 - source-map-js: 1.0.2 - dev: true - - /proxy-from-env@1.1.0: - resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==} - dev: true - - /react-dom@18.2.0(react@18.2.0): - resolution: {integrity: sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==} - peerDependencies: - react: ^18.2.0 - dependencies: - loose-envify: 1.4.0 - react: 18.2.0 - scheduler: 0.23.0 - dev: true - - /react@18.2.0: - resolution: {integrity: sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==} - engines: {node: '>=0.10.0'} - dependencies: - loose-envify: 1.4.0 - dev: true - - /scheduler@0.23.0: - resolution: {integrity: sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw==} - dependencies: - loose-envify: 1.4.0 - dev: true - - /shallowequal@1.1.0: - resolution: {integrity: sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ==} - dev: true - - /source-map-js@1.0.2: - resolution: {integrity: sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==} - engines: {node: '>=0.10.0'} - dev: true - - /styled-components@6.1.1(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-cpZZP5RrKRIClBW5Eby4JM1wElLVP4NQrJbJ0h10TidTyJf4SIIwa3zLXOoPb4gJi8MsJ8mjq5mu2IrEhZIAcQ==} - engines: {node: '>= 16'} - peerDependencies: - react: '>= 16.8.0' - react-dom: '>= 16.8.0' - dependencies: - '@emotion/is-prop-valid': 1.2.1 - '@emotion/unitless': 0.8.1 - '@types/stylis': 4.2.4 - css-to-react-native: 3.2.0 - csstype: 3.1.2 - postcss: 8.4.33 - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - shallowequal: 1.1.0 - stylis: 4.3.0 - tslib: 2.6.2 - dev: true - - /stylis@4.3.0: - resolution: {integrity: sha512-E87pIogpwUsUwXw7dNyU4QDjdgVMy52m+XEOPEKUn161cCzWjjhPSQhByfd1CcNvrOLnXQ6OnnZDwnJrz/Z4YQ==} - dev: true - - /tslib@2.6.2: - resolution: {integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==} - dev: true diff --git a/fixtures/tsconfig/cases/builtins/thing.js b/fixtures/tsconfig/cases/builtins/thing.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/builtins/tsconfig.json b/fixtures/tsconfig/cases/builtins/tsconfig.json deleted file mode 100644 index 36aa1a4d..00000000 --- a/fixtures/tsconfig/cases/builtins/tsconfig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compilerOptions": { - "baseUrl": "." - } -} diff --git a/fixtures/tsconfig/cases/exports/index.js b/fixtures/tsconfig/cases/exports/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/exports/tsconfig.json b/fixtures/tsconfig/cases/exports/tsconfig.json deleted file mode 100644 index f0e3159b..00000000 --- a/fixtures/tsconfig/cases/exports/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-exports" -} diff --git a/fixtures/tsconfig/cases/extends-extension/base-tsconfig.json b/fixtures/tsconfig/cases/extends-extension/base-tsconfig.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/cases/extends-extension/base-tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/cases/extends-extension/foo.js b/fixtures/tsconfig/cases/extends-extension/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-extension/tsconfig.json b/fixtures/tsconfig/cases/extends-extension/tsconfig.json deleted file mode 100644 index 0ae4c6a3..00000000 --- a/fixtures/tsconfig/cases/extends-extension/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./base-tsconfig" -} diff --git a/fixtures/tsconfig/cases/extends-extensionless/foo.js b/fixtures/tsconfig/cases/extends-extensionless/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-extensionless/tsconfig.json b/fixtures/tsconfig/cases/extends-extensionless/tsconfig.json deleted file mode 100644 index c36cb7d4..00000000 --- a/fixtures/tsconfig/cases/extends-extensionless/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-field/conf" -} diff --git a/fixtures/tsconfig/cases/extends-multiple/foo.js b/fixtures/tsconfig/cases/extends-multiple/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-multiple/tsconfig.json b/fixtures/tsconfig/cases/extends-multiple/tsconfig.json deleted file mode 100644 index aa2ae783..00000000 --- a/fixtures/tsconfig/cases/extends-multiple/tsconfig.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": ["../extends-extension", "../extends-paths"], - "compilerOptions": { - "baseUrl": ".", - }, -} diff --git a/fixtures/tsconfig/cases/extends-not-found/index.js b/fixtures/tsconfig/cases/extends-not-found/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-not-found/tsconfig.json b/fixtures/tsconfig/cases/extends-not-found/tsconfig.json deleted file mode 100644 index 99df91da..00000000 --- a/fixtures/tsconfig/cases/extends-not-found/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./not-found" -} diff --git a/fixtures/tsconfig/cases/extends-paths/src/index.js b/fixtures/tsconfig/cases/extends-paths/src/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-paths/tsconfig.base.json b/fixtures/tsconfig/cases/extends-paths/tsconfig.base.json deleted file mode 100644 index 5c64b067..00000000 --- a/fixtures/tsconfig/cases/extends-paths/tsconfig.base.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "@/*": ["./*"] - } - } -} diff --git a/fixtures/tsconfig/cases/extends-paths/tsconfig.json b/fixtures/tsconfig/cases/extends-paths/tsconfig.json deleted file mode 100644 index 51086018..00000000 --- a/fixtures/tsconfig/cases/extends-paths/tsconfig.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": "./tsconfig.base.json", - "compilerOptions": { - "baseUrl": "src", - }, -} diff --git a/fixtures/tsconfig/cases/field/index.js b/fixtures/tsconfig/cases/field/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/field/tsconfig.json b/fixtures/tsconfig/cases/field/tsconfig.json deleted file mode 100644 index 9f86c3f4..00000000 --- a/fixtures/tsconfig/cases/field/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-field" -} diff --git a/fixtures/tsconfig/cases/index/index.js b/fixtures/tsconfig/cases/index/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/index/tsconfig.json b/fixtures/tsconfig/cases/index/tsconfig.json deleted file mode 100644 index d20b1774..00000000 --- a/fixtures/tsconfig/cases/index/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-index" -} diff --git a/fixtures/tsconfig/cases/paths_template_variable/foo.js b/fixtures/tsconfig/cases/paths_template_variable/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json b/fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json deleted file mode 100644 index a1a37bb6..00000000 --- a/fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "../../tsconfig_template_variable.json" -} diff --git a/fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json b/fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json deleted file mode 100644 index e7d8e5e5..00000000 --- a/fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "compilerOptions": { - "composite": true, - "paths": { - "foo": ["${configDir}/foo.js"] - } - } -} diff --git a/fixtures/tsconfig/cases/project_references/app/aliased/index.ts b/fixtures/tsconfig/cases/project_references/app/aliased/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/app/index.ts b/fixtures/tsconfig/cases/project_references/app/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/app/tsconfig.json b/fixtures/tsconfig/cases/project_references/app/tsconfig.json deleted file mode 100644 index 7036d2bb..00000000 --- a/fixtures/tsconfig/cases/project_references/app/tsconfig.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "extends": "../tsconfig.base.json", - "compilerOptions": { - "baseUrl": "./", - "paths": { - "@/*": ["./aliased/*"] - } - }, - "references": [ - { - "path": "../project_a/conf.json" - }, - { - "path": "../project_b" - }, - { - "path": "../project_c/tsconfig.json" - }, - { - "path": "../../paths_template_variable/tsconfig2.json" - } - ] -} diff --git a/fixtures/tsconfig/cases/project_references/project_a/aliased/index.ts b/fixtures/tsconfig/cases/project_references/project_a/aliased/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_a/conf.json b/fixtures/tsconfig/cases/project_references/project_a/conf.json deleted file mode 100644 index 4d389d7a..00000000 --- a/fixtures/tsconfig/cases/project_references/project_a/conf.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "compilerOptions": { - "composite": true, - "paths": { - "@/*": ["./aliased/*"] - } - } -} diff --git a/fixtures/tsconfig/cases/project_references/project_a/index.ts b/fixtures/tsconfig/cases/project_references/project_a/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_b/src/aliased/index.ts b/fixtures/tsconfig/cases/project_references/project_b/src/aliased/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_b/tsconfig.json b/fixtures/tsconfig/cases/project_references/project_b/tsconfig.json deleted file mode 100644 index 4ab05cd8..00000000 --- a/fixtures/tsconfig/cases/project_references/project_b/tsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "compilerOptions": { - "composite": true, - "baseUrl": "./src", - "paths": { - "@/*": ["./aliased/*"] - } - } -} diff --git a/fixtures/tsconfig/cases/project_references/project_c/index.ts b/fixtures/tsconfig/cases/project_references/project_c/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_c/tsconfig.json b/fixtures/tsconfig/cases/project_references/project_c/tsconfig.json deleted file mode 100644 index fe520939..00000000 --- a/fixtures/tsconfig/cases/project_references/project_c/tsconfig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compilerOptions": { - "composite": true - } -} diff --git a/fixtures/tsconfig/cases/project_references/tsconfig.base.json b/fixtures/tsconfig/cases/project_references/tsconfig.base.json deleted file mode 100644 index 88ccffe7..00000000 --- a/fixtures/tsconfig/cases/project_references/tsconfig.base.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "compilerOptions": { - } -} diff --git a/fixtures/tsconfig/cases/suffixes/a.ios.ts b/fixtures/tsconfig/cases/suffixes/a.ios.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/a.ts b/fixtures/tsconfig/cases/suffixes/a.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/b.ts b/fixtures/tsconfig/cases/suffixes/b.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/c-test.ts b/fixtures/tsconfig/cases/suffixes/c-test.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/index.ts b/fixtures/tsconfig/cases/suffixes/index.ts deleted file mode 100644 index b09939b9..00000000 --- a/fixtures/tsconfig/cases/suffixes/index.ts +++ /dev/null @@ -1 +0,0 @@ -import './a'; diff --git a/fixtures/tsconfig/cases/suffixes/tsconfig.json b/fixtures/tsconfig/cases/suffixes/tsconfig.json deleted file mode 100644 index 4c2ccc8f..00000000 --- a/fixtures/tsconfig/cases/suffixes/tsconfig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compilerOptions": { - "moduleSuffixes": [".ios", "-test", ""] - } -} diff --git a/fixtures/tsconfig/cases/trailing-comma/bar.js b/fixtures/tsconfig/cases/trailing-comma/bar.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/trailing-comma/index.js b/fixtures/tsconfig/cases/trailing-comma/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/trailing-comma/tsconfig.json b/fixtures/tsconfig/cases/trailing-comma/tsconfig.json deleted file mode 100644 index 6dc20ca5..00000000 --- a/fixtures/tsconfig/cases/trailing-comma/tsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "compilerOptions": { - "paths": { - /* some comment */ - "foo": ["bar.js"], - }, - }, - // another comment -} diff --git a/fixtures/tsconfig/foo.js b/fixtures/tsconfig/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/nested/index.js b/fixtures/tsconfig/nested/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/nested/test.js b/fixtures/tsconfig/nested/test.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/nested/tsconfig.json b/fixtures/tsconfig/nested/tsconfig.json deleted file mode 100644 index 6deb3011..00000000 --- a/fixtures/tsconfig/nested/tsconfig.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "extends": "..", - "compilerOptions": { - "paths": { - "ts-path": ["test.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-exports/conf.json b/fixtures/tsconfig/node_modules/tsconfig-exports/conf.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-exports/conf.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-exports/foo.js b/fixtures/tsconfig/node_modules/tsconfig-exports/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-exports/package.json b/fixtures/tsconfig/node_modules/tsconfig-exports/package.json deleted file mode 100644 index be0ddee6..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-exports/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "tsconfig-exports", - "private": true, - "exports": { - ".": "./conf.json" - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-field/conf.json b/fixtures/tsconfig/node_modules/tsconfig-field/conf.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-field/conf.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-field/foo.js b/fixtures/tsconfig/node_modules/tsconfig-field/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-field/package.json b/fixtures/tsconfig/node_modules/tsconfig-field/package.json deleted file mode 100644 index 7138fdde..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-field/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "tsconfig-field", - "private": true, - "tsconfig": "conf.json" -} \ No newline at end of file diff --git a/fixtures/tsconfig/node_modules/tsconfig-index/foo.js b/fixtures/tsconfig/node_modules/tsconfig-index/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-index/package.json b/fixtures/tsconfig/node_modules/tsconfig-index/package.json deleted file mode 100644 index eb2431e7..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-index/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "tsconfig-index", - "private": true -} \ No newline at end of file diff --git a/fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json b/fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-not-used/foo.js b/fixtures/tsconfig/node_modules/tsconfig-not-used/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json b/fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json deleted file mode 100644 index eb16d127..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "ts-path": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/package.json b/fixtures/tsconfig/package.json deleted file mode 100755 index f48acd1c..00000000 --- a/fixtures/tsconfig/package.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "name": "resolver", - "private": true, - "alias": { - "aliased": "foo", - "aliased-file": "./bar.js", - "something": "./nested/test.js", - "aliasedfolder": "./nested", - "aliasedabsolute": "/nested", - "foo/bar": "./bar.js", - "glob/*/*": "./nested/$2", - "./baz": "./bar.js", - "url": false - }, - "imports": { - "#test": "./bar.js" - }, - "dependencies": { - "foo": "^0.3.4" - }, - "peerDependencies": { - "bar": "*" - } -} diff --git a/fixtures/tsconfig/tsconfig.json b/fixtures/tsconfig/tsconfig.json deleted file mode 100644 index eb16d127..00000000 --- a/fixtures/tsconfig/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "ts-path": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/tsconfig_template_variable.json b/fixtures/tsconfig/tsconfig_template_variable.json deleted file mode 100644 index 6f272344..00000000 --- a/fixtures/tsconfig/tsconfig_template_variable.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["${configDir}/foo.js"] - } - } -} diff --git a/napi/__test__/resolver.spec.mjs b/napi/__test__/resolver.spec.mjs deleted file mode 100644 index ac6ee0ef..00000000 --- a/napi/__test__/resolver.spec.mjs +++ /dev/null @@ -1,260 +0,0 @@ -import { join } from 'node:path' -import { fileURLToPath } from 'node:url' - -import test from 'ava' - -let ResolverFactory - -if (process.env.WASI_TEST) { - const wasi = await import('../resolver.wasi.cjs') - ResolverFactory = wasi.ResolverFactory -} else { - const napi = await import('../index.js') - ResolverFactory = napi.ResolverFactory -} - -const currentDir = join(fileURLToPath(import.meta.url), '..') - -const enhancedResolveRoot = join( - currentDir, - '..', - '..', - 'fixtures', - 'enhanced_resolve', - 'test', - 'fixtures' -) - -// https://github.com/webpack/enhanced-resolve/blob/main/test/resolve.test.js - -for (const [title, context, request, expected] of [ - [ - 'absolute path', - enhancedResolveRoot, - join(enhancedResolveRoot, 'main1.js'), - join(enhancedResolveRoot, 'main1.js'), - ], - [ - 'file with .js', - enhancedResolveRoot, - './main1.js', - join(enhancedResolveRoot, 'main1.js'), - ], - [ - 'file without extension', - enhancedResolveRoot, - './main1', - join(enhancedResolveRoot, 'main1.js'), - ], - [ - 'another file with .js', - enhancedResolveRoot, - './a.js', - join(enhancedResolveRoot, 'a.js'), - ], - [ - 'another file without extension', - enhancedResolveRoot, - './a', - join(enhancedResolveRoot, 'a.js'), - ], - [ - 'file in module with .js', - enhancedResolveRoot, - 'm1/a.js', - join(enhancedResolveRoot, 'node_modules/m1/a.js'), - ], - [ - 'file in module without extension', - enhancedResolveRoot, - 'm1/a', - join(enhancedResolveRoot, 'node_modules/m1/a.js'), - ], - [ - 'another file in module without extension', - enhancedResolveRoot, - 'complexm/step1', - join(enhancedResolveRoot, 'node_modules/complexm/step1.js'), - ], - [ - 'from submodule to file in sibling module', - join(enhancedResolveRoot, 'node_modules/complexm'), - 'm2/b.js', - join(enhancedResolveRoot, 'node_modules/m2/b.js'), - ], - [ - 'from nested directory to overwritten file in module', - join(enhancedResolveRoot, 'multiple_modules'), - 'm1/a.js', - join(enhancedResolveRoot, 'multiple_modules/node_modules/m1/a.js'), - ], - [ - 'from nested directory to not overwritten file in module', - join(enhancedResolveRoot, 'multiple_modules'), - 'm1/b.js', - join(enhancedResolveRoot, 'node_modules/m1/b.js'), - ], - [ - 'file with query', - enhancedResolveRoot, - './main1.js?query', - join(enhancedResolveRoot, 'main1.js?query'), - ], - [ - 'file with fragment', - enhancedResolveRoot, - './main1.js#fragment', - join(enhancedResolveRoot, 'main1.js#fragment'), - ], - [ - 'file with fragment and query', - enhancedResolveRoot, - './main1.js#fragment?query', - join(enhancedResolveRoot, 'main1.js#fragment?query'), - ], - [ - 'file with query and fragment', - enhancedResolveRoot, - './main1.js?#fragment', - join(enhancedResolveRoot, 'main1.js?#fragment'), - ], - - [ - 'file with query (unicode)', - enhancedResolveRoot, - './测试.js?query', - join(enhancedResolveRoot, '测试.js?query'), - ], - [ - 'file with fragment (unicode)', - enhancedResolveRoot, - './测试.js#fragment', - join(enhancedResolveRoot, '测试.js#fragment'), - ], - [ - 'file with fragment and query (unicode)', - enhancedResolveRoot, - './测试.js#fragment?query', - join(enhancedResolveRoot, '测试.js#fragment?query'), - ], - [ - 'file with query and fragment (unicode)', - enhancedResolveRoot, - './测试.js?#fragment', - join(enhancedResolveRoot, '测试.js?#fragment'), - ], - - [ - 'file in module with query', - enhancedResolveRoot, - 'm1/a?query', - join(enhancedResolveRoot, 'node_modules/m1/a.js?query'), - ], - [ - 'file in module with fragment', - enhancedResolveRoot, - 'm1/a#fragment', - join(enhancedResolveRoot, 'node_modules/m1/a.js#fragment'), - ], - [ - 'file in module with fragment and query', - enhancedResolveRoot, - 'm1/a#fragment?query', - join(enhancedResolveRoot, 'node_modules/m1/a.js#fragment?query'), - ], - [ - 'file in module with query and fragment', - enhancedResolveRoot, - 'm1/a?#fragment', - join(enhancedResolveRoot, 'node_modules/m1/a.js?#fragment'), - ], - [ - 'differ between directory and file, resolve file', - enhancedResolveRoot, - './dirOrFile', - join(enhancedResolveRoot, 'dirOrFile.js'), - ], - [ - 'differ between directory and file, resolve directory', - enhancedResolveRoot, - './dirOrFile/', - join(enhancedResolveRoot, 'dirOrFile/index.js'), - ], - [ - 'find node_modules outside of node_modules', - join(enhancedResolveRoot, 'browser-module/node_modules'), - 'm1/a', - join(enhancedResolveRoot, 'node_modules/m1/a.js'), - ], - [ - "don't crash on main field pointing to self", - enhancedResolveRoot, - './main-field-self', - join(enhancedResolveRoot, './main-field-self/index.js'), - ], - [ - "don't crash on main field pointing to self (2)", - enhancedResolveRoot, - './main-field-self2', - join(enhancedResolveRoot, './main-field-self2/index.js'), - ], - // enhanced-resolve has `#` prepended with a `\0`, they are removed from the - // following 3 expected test results. - // See https://github.com/webpack/enhanced-resolve#escaping - [ - 'handle fragment edge case (no fragment)', - enhancedResolveRoot, - './no#fragment/#/#', - join(enhancedResolveRoot, 'no#fragment', '#', '#.js'), - ], - [ - 'handle fragment edge case (fragment)', - enhancedResolveRoot, - './no#fragment/#/', - join(enhancedResolveRoot, 'no.js#fragment') + '/#/', - ], - [ - 'handle fragment escaping', - enhancedResolveRoot, - './no\0#fragment/\0#/\0##fragment', - join(enhancedResolveRoot, 'no#fragment', '#', '#.js#fragment'), - ], -]) { - test(title, (t) => { - const resolver = new ResolverFactory({ - modules: ['src/a', 'src/b', 'src/common', 'node_modules'], - extensions: ['.js', '.jsx', '.ts', '.tsx'], - }) - - t.is(resolver.sync(context, request).path, expected) - }) -} - -test('resolve pnpm package', (t) => { - const rootDir = join(currentDir, '..', '..'); - const pnpmProjectPath = join(rootDir, 'fixtures', 'pnpm') - const resolver = new ResolverFactory({ - aliasFields: ['browser'], - }) - t.deepEqual(resolver.sync(pnpmProjectPath, 'styled-components'), { - path: join( - rootDir, - 'node_modules/.pnpm/styled-components@6.1.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/styled-components/dist/styled-components.browser.cjs.js' - ), - }) - t.deepEqual( - resolver.sync( - join( - rootDir, - 'node_modules/.pnpm/styled-components@6.1.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/styled-components' - ), - 'react' - ), - { - path: join( - rootDir, - 'node_modules/.pnpm/react@18.3.1/node_modules/react/index.js' - ), - } - ) -}) diff --git a/napi/src/lib.rs b/napi/src/lib.rs deleted file mode 100644 index 238f99c4..00000000 --- a/napi/src/lib.rs +++ /dev/null @@ -1,166 +0,0 @@ -extern crate napi; -extern crate napi_derive; -extern crate oxc_resolver; - -use std::path::{Path, PathBuf}; - -use napi_derive::napi; -use oxc_resolver::{ResolveOptions, Resolver}; - -use self::options::{NapiResolveOptions, StrOrStrList}; - -mod options; - -#[napi(object)] -pub struct ResolveResult { - pub path: Option, - pub error: Option, -} - -fn resolve(resolver: &Resolver, path: &Path, request: &str) -> ResolveResult { - match resolver.resolve(path, request) { - Ok(resolution) => ResolveResult { - path: Some(resolution.full_path().to_string_lossy().to_string()), - error: None, - }, - Err(err) => ResolveResult { path: None, error: Some(err.to_string()) }, - } -} - -#[allow(clippy::needless_pass_by_value)] -#[napi] -pub fn sync(path: String, request: String) -> ResolveResult { - let path = PathBuf::from(path); - let resolver = Resolver::new(ResolveOptions::default()); - resolve(&resolver, &path, &request) -} - -#[napi] -pub struct ResolverFactory { - resolver: Resolver, -} - -#[napi] -impl ResolverFactory { - #[napi(constructor)] - pub fn new(options: NapiResolveOptions) -> Self { - Self { resolver: Resolver::new(Self::normalize_options(options)) } - } - - #[napi] - pub fn default() -> Self { - let default_options = ResolveOptions::default(); - Self { resolver: Resolver::new(default_options) } - } - - /// Clone the resolver using the same underlying cache. - #[napi] - pub fn clone_with_options(&self, options: NapiResolveOptions) -> Self { - Self { resolver: self.resolver.clone_with_options(Self::normalize_options(options)) } - } - - /// Clear the underlying cache. - #[napi] - pub fn clear_cache(&self) { - self.resolver.clear_cache(); - } - - #[allow(clippy::needless_pass_by_value)] - #[napi] - pub fn sync(&self, path: String, request: String) -> ResolveResult { - let path = PathBuf::from(path); - resolve(&self.resolver, &path, &request) - } - - fn normalize_options(op: NapiResolveOptions) -> ResolveOptions { - let default = ResolveOptions::default(); - // merging options - ResolveOptions { - tsconfig: op.tsconfig.map(|tsconfig| tsconfig.into()), - alias: op - .alias - .map(|alias| { - alias - .into_iter() - .map(|(k, v)| { - let v = v - .into_iter() - .map(|item| match item { - Some(path) => oxc_resolver::AliasValue::from(path), - None => oxc_resolver::AliasValue::Ignore, - }) - .collect(); - (k, v) - }) - .collect::>() - }) - .unwrap_or(default.alias), - alias_fields: op - .alias_fields - .map(|o| o.into_iter().map(|x| StrOrStrList(x).into()).collect::>()) - .unwrap_or(default.alias_fields), - condition_names: op.condition_names.unwrap_or(default.condition_names), - description_files: op.description_files.unwrap_or(default.description_files), - enforce_extension: op - .enforce_extension - .map(|enforce_extension| enforce_extension.into()) - .unwrap_or(default.enforce_extension), - exports_fields: op - .exports_fields - .map(|o| o.into_iter().map(|x| StrOrStrList(x).into()).collect::>()) - .unwrap_or(default.exports_fields), - imports_fields: op - .imports_fields - .map(|o| o.into_iter().map(|x| StrOrStrList(x).into()).collect::>()) - .unwrap_or(default.imports_fields), - extension_alias: op - .extension_alias - .map(|extension_alias| extension_alias.into_iter().collect::>()) - .unwrap_or(default.extension_alias), - extensions: op.extensions.unwrap_or(default.extensions), - fallback: op - .fallback - .map(|fallback| { - fallback - .into_iter() - .map(|(k, v)| { - let v = v - .into_iter() - .map(|item| match item { - Some(path) => oxc_resolver::AliasValue::from(path), - None => oxc_resolver::AliasValue::Ignore, - }) - .collect(); - (k, v) - }) - .collect::>() - }) - .unwrap_or(default.fallback), - fully_specified: op.fully_specified.unwrap_or(default.fully_specified), - main_fields: op - .main_fields - .map(|o| StrOrStrList(o).into()) - .unwrap_or(default.main_fields), - main_files: op.main_files.unwrap_or(default.main_files), - modules: op.modules.map(|o| StrOrStrList(o).into()).unwrap_or(default.modules), - resolve_to_context: op.resolve_to_context.unwrap_or(default.resolve_to_context), - prefer_relative: op.prefer_relative.unwrap_or(default.prefer_relative), - prefer_absolute: op.prefer_absolute.unwrap_or(default.prefer_absolute), - restrictions: op - .restrictions - .map(|restrictions| { - restrictions - .into_iter() - .map(|restriction| restriction.into()) - .collect::>() - }) - .unwrap_or(default.restrictions), - roots: op - .roots - .map(|roots| roots.into_iter().map(PathBuf::from).collect::>()) - .unwrap_or(default.roots), - symlinks: op.symlinks.unwrap_or(default.symlinks), - builtin_modules: op.builtin_modules.unwrap_or(default.builtin_modules), - } - } -} diff --git a/napi/src/options.rs b/napi/src/options.rs deleted file mode 100644 index ea35672f..00000000 --- a/napi/src/options.rs +++ /dev/null @@ -1,261 +0,0 @@ -use std::path::PathBuf; - -use napi::Either; -use napi_derive::napi; -use std::collections::HashMap; - -/// Module Resolution Options -/// -/// Options are directly ported from [enhanced-resolve](https://github.com/webpack/enhanced-resolve#resolver-options). -/// -/// See [webpack resolve](https://webpack.js.org/configuration/resolve/) for information and examples -#[derive(Debug, Clone)] -#[napi(object)] -pub struct NapiResolveOptions { - /// Path to TypeScript configuration file. - /// - /// Default `None` - pub tsconfig: Option, - - /// Alias for [ResolveOptions::alias] and [ResolveOptions::fallback]. - /// - /// For the second value of the tuple, `None -> AliasValue::Ignore`, Some(String) -> - /// AliasValue::Path(String)` - /// Create aliases to import or require certain modules more easily. - /// A trailing $ can also be added to the given object's keys to signify an exact match. - pub alias: Option>>>, - - /// A list of alias fields in description files. - /// Specify a field, such as `browser`, to be parsed according to [this specification](https://github.com/defunctzombie/package-browser-field-spec). - /// Can be a path to json object such as `["path", "to", "exports"]`. - /// - /// Default `[]` - #[napi(ts_type = "(string | string[])[]")] - pub alias_fields: Option>, - - /// Condition names for exports field which defines entry points of a package. - /// The key order in the exports field is significant. During condition matching, earlier entries have higher priority and take precedence over later entries. - /// - /// Default `[]` - pub condition_names: Option>, - - /// The JSON files to use for descriptions. (There was once a `bower.json`.) - /// - /// Default `["package.json"]` - pub description_files: Option>, - - /// If true, it will not allow extension-less files. - /// So by default `require('./foo')` works if `./foo` has a `.js` extension, - /// but with this enabled only `require('./foo.js')` will work. - /// - /// Default to `true` when [ResolveOptions::extensions] contains an empty string. - /// Use `Some(false)` to disable the behavior. - /// See - /// - /// Default None, which is the same as `Some(false)` when the above empty rule is not applied. - pub enforce_extension: Option, - - /// A list of exports fields in description files. - /// Can be a path to json object such as `["path", "to", "exports"]`. - /// - /// Default `[["exports"]]`. - #[napi(ts_type = "(string | string[])[]")] - pub exports_fields: Option>, - - /// Fields from `package.json` which are used to provide the internal requests of a package - /// (requests starting with # are considered internal). - /// - /// Can be a path to a JSON object such as `["path", "to", "imports"]`. - /// - /// Default `[["imports"]]`. - #[napi(ts_type = "(string | string[])[]")] - pub imports_fields: Option>, - - /// An object which maps extension to extension aliases. - /// - /// Default `{}` - pub extension_alias: Option>>, - - /// Attempt to resolve these extensions in order. - /// If multiple files share the same name but have different extensions, - /// will resolve the one with the extension listed first in the array and skip the rest. - /// - /// Default `[".js", ".json", ".node"]` - pub extensions: Option>, - - /// Redirect module requests when normal resolving fails. - /// - /// Default `[]` - pub fallback: Option>>>, - - /// 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). - /// - /// See also webpack configuration [resolve.fullySpecified](https://webpack.js.org/configuration/module/#resolvefullyspecified) - /// - /// Default `false` - pub fully_specified: Option, - - /// A list of main fields in description files - /// - /// Default `["main"]`. - #[napi(ts_type = "string | string[]")] - pub main_fields: Option, - - /// The filename to be used while resolving directories. - /// - /// Default `["index"]` - pub main_files: Option>, - - /// A list of directories to resolve modules from, can be absolute path or folder name. - /// - /// Default `["node_modules"]` - #[napi(ts_type = "string | string[]")] - pub modules: Option, - - /// Resolve to a context instead of a file. - /// - /// Default `false` - pub resolve_to_context: Option, - - /// Prefer to resolve module requests as relative requests instead of using modules from node_modules directories. - /// - /// Default `false` - pub prefer_relative: Option, - - /// Prefer to resolve server-relative urls as absolute paths before falling back to resolve in ResolveOptions::roots. - /// - /// Default `false` - pub prefer_absolute: Option, - - /// A list of resolve restrictions to restrict the paths that a request can be resolved on. - /// - /// Default `[]` - pub restrictions: Option>, - - /// A list of directories where requests of server-relative URLs (starting with '/') are resolved. - /// On non-Windows systems these requests are resolved as an absolute path first. - /// - /// Default `[]` - pub roots: Option>, - - /// Whether to resolve symlinks to their symlinked location. - /// When enabled, symlinked resources are resolved to their real path, not their symlinked location. - /// Note that this may cause module resolution to fail when using tools that symlink packages (like npm link). - /// - /// Default `true` - pub symlinks: Option, - - /// Whether to parse [module.builtinModules](https://nodejs.org/api/module.html#modulebuiltinmodules) or not. - /// For example, "zlib" will throw [crate::ResolveError::Builtin] when set to true. - /// - /// Default `false` - pub builtin_modules: Option, -} - -#[napi] -#[derive(Debug, PartialEq, Eq)] -pub enum EnforceExtension { - Auto, - Enabled, - Disabled, -} - -impl EnforceExtension { - pub fn is_auto(&self) -> bool { - *self == Self::Auto - } - - pub fn is_enabled(&self) -> bool { - *self == Self::Enabled - } - - pub fn is_disabled(&self) -> bool { - *self == Self::Disabled - } -} - -/// Alias Value for [ResolveOptions::alias] and [ResolveOptions::fallback]. -/// Use struct because napi don't support structured union now -#[napi(object)] -#[derive(Debug, Clone)] -pub struct Restriction { - pub path: Option, - pub regex: Option, -} - -/// Tsconfig Options -/// -/// Derived from [tsconfig-paths-webpack-plugin](https://github.com/dividab/tsconfig-paths-webpack-plugin#options) -#[napi(object)] -#[derive(Debug, Clone)] -pub struct TsconfigOptions { - /// Allows you to specify where to find the TypeScript configuration file. - /// You may provide - /// * a relative path to the configuration file. It will be resolved relative to cwd. - /// * an absolute path to the configuration file. - pub config_file: String, - - /// Support for Typescript Project References. - /// - /// * `'auto'`: use the `references` field from tsconfig of `config_file`. - /// * `string[]`: manually provided relative or absolute path. - #[napi(ts_type = "'auto' | string[]")] - pub references: Option>>, -} - -impl Into for Restriction { - fn into(self) -> oxc_resolver::Restriction { - match (self.path, self.regex) { - (None, None) => { - panic!("Should specify path or regex") - } - (None, Some(regex)) => oxc_resolver::Restriction::RegExp(regex), - (Some(path), None) => oxc_resolver::Restriction::Path(PathBuf::from(path)), - (Some(_), Some(_)) => { - panic!("Restriction can't be path and regex at the same time") - } - } - } -} - -impl Into for EnforceExtension { - fn into(self) -> oxc_resolver::EnforceExtension { - match self { - EnforceExtension::Auto => oxc_resolver::EnforceExtension::Auto, - EnforceExtension::Enabled => oxc_resolver::EnforceExtension::Enabled, - EnforceExtension::Disabled => oxc_resolver::EnforceExtension::Disabled, - } - } -} - -impl Into for TsconfigOptions { - fn into(self) -> oxc_resolver::TsconfigOptions { - oxc_resolver::TsconfigOptions { - config_file: PathBuf::from(self.config_file), - references: match self.references { - Some(Either::A(string)) if string.as_str() == "auto" => { - oxc_resolver::TsconfigReferences::Auto - } - Some(Either::A(opt)) => { - panic!("`{}` is not a valid option for tsconfig references", opt) - } - Some(Either::B(paths)) => oxc_resolver::TsconfigReferences::Paths( - paths.into_iter().map(PathBuf::from).collect::>(), - ), - None => oxc_resolver::TsconfigReferences::Disabled, - }, - } - } -} - -type StrOrStrListType = Either>; -pub struct StrOrStrList(pub StrOrStrListType); - -impl Into> for StrOrStrList { - fn into(self) -> Vec { - match self { - StrOrStrList(Either::A(s)) => Vec::from([s]), - StrOrStrList(Either::B(a)) => a, - } - } -} diff --git a/napi/tests/options.test.mjs b/napi/tests/options.test.mjs deleted file mode 100644 index 4a93efff..00000000 --- a/napi/tests/options.test.mjs +++ /dev/null @@ -1,59 +0,0 @@ -import { describe, it } from "node:test"; -import { ResolverFactory } from "../index.js"; -import * as assert from "node:assert"; -import * as path from "node:path"; - -const fixtureDir = new URL( - "../../fixtures/enhanced_resolve/test/fixtures", - import.meta.url -).pathname; - -describe("option", () => { - describe("aliasFields", () => { - it("should allow field string ", () => { - const resolver = new ResolverFactory({ aliasFields: ["browser"] }); - assert.match( - resolver.sync(fixtureDir, "./browser-module/lib/replaced.js").path, - /browser-module\/lib\/browser\.js$/ - ); - }); - it("should allow json path array", () => { - const resolver = new ResolverFactory({ - aliasFields: [["innerBrowser1", "field", "browser"]], - }); - - assert.match( - resolver.sync(fixtureDir, "./browser-module/lib/main1.js").path, - /browser-module\/lib\/main\.js$/ - ); - }); - }); - - describe("exportsFields", () => { - const createTest = (exportsFields) => { - const resolver = new ResolverFactory({ exportsFields }); - assert.match( - resolver.sync( - path.resolve(fixtureDir, "./exports-field3"), - "exports-field" - ).path, - /\/exports-field\/src\/index\.js$/ - ); - }; - it("should allow string as field item", createTest(["broken"])); - it("should allow json path array as field item", createTest([["broken"]])); - }); - - describe("mainFields", () => { - const createTest = (mainFields) => { - const resolver = new ResolverFactory({ mainFields }); - assert.match( - resolver.sync(fixtureDir, "../..").path, - /\/lib\/index\.js$/ - ); - }; - it("should use `'main'` as default", createTest(undefined)); - it("should allow field string", createTest("main")); - it("should allow field array", createTest(["main"])); - }); -}); diff --git a/npm/package.json b/npm/package.json index 6fa93185..b47e6b07 100644 --- a/npm/package.json +++ b/npm/package.json @@ -1,41 +1,30 @@ { - "name": "oxc-resolver", - "version": "1.8.1", - "description": "Oxc Resolver Node API", - "main": "index.js", - "browser": "browser.js", - "files": [ - "index.d.ts", - "index.js", - "browser.js" - ], - "license": "MIT", - "homepage": "https://oxc-project.github.io", - "repository": { - "type": "git", - "url": "git+https://github.com/oxc-project/oxc-resolver.git" - }, - "publishConfig": { - "registry": "https://registry.npmjs.org/", - "access": "public" - }, - "napi": { - "binaryName": "resolver", - "packageName": "@oxc-resolver/binding", - "targets": [ - "x86_64-pc-windows-msvc", - "aarch64-pc-windows-msvc", - "x86_64-unknown-linux-gnu", - "x86_64-unknown-linux-musl", - "aarch64-unknown-linux-gnu", - "aarch64-unknown-linux-musl", - "armv7-unknown-linux-gnueabihf", - "x86_64-apple-darwin", - "aarch64-apple-darwin", - "wasm32-wasip1-threads" - ] - }, - "funding": { - "url": "https://github.com/sponsors/Boshen" - } + "name": "oxc-resolver", + "description": "Oxc Resolver Node API", + "funding": { + "url": "https://github.com/sponsors/Boshen" + }, + "main": "index.js", + "browser": "browser.js", + "files": [ + "index.d.ts", + "index.js", + "browser.js" + ], + "napi": { + "binaryName": "resolver", + "packageName": "@oxc-resolver/binding", + "targets": [ + "x86_64-pc-windows-msvc", + "aarch64-pc-windows-msvc", + "x86_64-unknown-linux-gnu", + "x86_64-unknown-linux-musl", + "aarch64-unknown-linux-gnu", + "aarch64-unknown-linux-musl", + "armv7-unknown-linux-gnueabihf", + "x86_64-apple-darwin", + "aarch64-apple-darwin", + "wasm32-wasip1-threads" + ] + } } diff --git a/package.json b/package.json index 47300b76..a431e48f 100644 --- a/package.json +++ b/package.json @@ -1,33 +1,24 @@ { - "name": "@oxc-resolver/binding", - "private": true, - "version": "0.0.0", - "scripts": { - "build": "napi build --platform --release --package-json-path npm/package.json --manifest-path napi/Cargo.toml", - "build:debug": "napi build --platform --package-json-path npm/package.json --manifest-path napi/Cargo.toml", - "prepublishOnly": "napi pre-publish -t npm", - "test": "ava" - }, - "devDependencies": { - "@napi-rs/cli": "^3.0.0-alpha.43", - "@napi-rs/wasm-runtime": "^0.2.0", - "@types/node": "^20.10.4", - "ava": "^6.0.1", - "emnapi": "^1.0.0", - "typescript": "^5.3.3" - }, - "ava": { - "files": [ - "napi/__test__/*.spec.mjs" - ], - "cache": false - }, - "packageManager": "pnpm@9.3.0", - "repository": { - "type": "git", - "url": "git+https://github.com/oxc-project/oxc-resolver.git" - }, - "funding": { - "url": "https://github.com/sponsors/Boshen" - } + "name": "@oxc-resolver/binding", + "funding": { + "url": "https://github.com/sponsors/Boshen" + }, + "scripts": { + "build": "napi build --platform --release --package-json-path npm/package.json --manifest-path napi/Cargo.toml", + "build:debug": "napi build --platform --package-json-path npm/package.json --manifest-path napi/Cargo.toml", + "prepublishOnly": "napi pre-publish -t npm" + }, + "ava": { + "cache": false, + "files": [ + "napi/__test__/*.spec.mjs" + ] + }, + "devDependencies": { + "@napi-rs/cli": "^3.0.0-alpha.43", + "@napi-rs/wasm-runtime": "^0.2.0", + "@types/node": "^20.10.4", + "ava": "^6.0.1", + "emnapi": "^1.0.0" + } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml deleted file mode 100644 index 1e8670db..00000000 --- a/pnpm-lock.yaml +++ /dev/null @@ -1,2690 +0,0 @@ -lockfileVersion: '9.0' - -settings: - autoInstallPeers: true - excludeLinksFromLockfile: false - -importers: - - .: - devDependencies: - '@napi-rs/cli': - specifier: ^3.0.0-alpha.43 - version: 3.0.0-alpha.55(@emnapi/runtime@1.2.0)(emnapi@1.2.0) - '@napi-rs/wasm-runtime': - specifier: ^0.2.0 - version: 0.2.4 - '@types/node': - specifier: ^20.10.4 - version: 20.14.2 - ava: - specifier: ^6.0.1 - version: 6.1.3 - emnapi: - specifier: ^1.0.0 - version: 1.2.0 - typescript: - specifier: ^5.3.3 - version: 5.4.5 - - fixtures/pnpm: - devDependencies: - axios: - specifier: 1.6.2 - version: 1.6.2 - postcss: - specifier: 8.4.33 - version: 8.4.33 - styled-components: - specifier: 6.1.1 - version: 6.1.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - - npm: {} - -packages: - - '@emnapi/core@1.2.0': - resolution: {integrity: sha512-E7Vgw78I93we4ZWdYCb4DGAwRROGkMIXk7/y87UmANR+J6qsWusmC3gLt0H+O0KOt5e6O38U8oJamgbudrES/w==} - - '@emnapi/runtime@1.2.0': - resolution: {integrity: sha512-bV21/9LQmcQeCPEg3BDFtvwL6cwiTMksYNWQQ4KOxCZikEGalWtenoZ0wCiukJINlGCIi2KXx01g4FoH/LxpzQ==} - - '@emnapi/wasi-threads@1.0.1': - resolution: {integrity: sha512-iIBu7mwkq4UQGeMEM8bLwNK962nXdhodeScX4slfQnRhEMMzvYivHhutCIk8uojvmASXXPC2WNEjwxFWk72Oqw==} - - '@emotion/is-prop-valid@1.2.2': - resolution: {integrity: sha512-uNsoYd37AFmaCdXlg6EYD1KaPOaRWRByMCYzbKUX4+hhMfrxdVSelShywL4JVaAeM/eHUOSprYBQls+/neX3pw==} - - '@emotion/memoize@0.8.1': - resolution: {integrity: sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA==} - - '@emotion/unitless@0.8.1': - resolution: {integrity: sha512-KOEGMu6dmJZtpadb476IsZBclKvILjopjUii3V+7MnXIQCYh8W3NgNcgwo21n9LXZX6EDIKvqfjYxXebDwxKmQ==} - - '@inquirer/figures@1.0.3': - resolution: {integrity: sha512-ErXXzENMH5pJt5/ssXV0DfWUZqly8nGzf0UcBV9xTnP+KyffE2mqyxIMBrZ8ijQck2nU0TQm40EQB53YreyWHw==} - engines: {node: '>=18'} - - '@ljharb/through@2.3.13': - resolution: {integrity: sha512-/gKJun8NNiWGZJkGzI/Ragc53cOdcLNdzjLaIa+GEjguQs0ulsurx8WN0jijdK9yPqDvziX995sMRLyLt1uZMQ==} - engines: {node: '>= 0.4'} - - '@mapbox/node-pre-gyp@1.0.11': - resolution: {integrity: sha512-Yhlar6v9WQgUp/He7BdgzOz8lqMQ8sU+jkCq7Wx8Myc5YFJLbEe7lgui/V7G1qB1DJykHSGwreceSaD60Y0PUQ==} - hasBin: true - - '@napi-rs/cli@3.0.0-alpha.55': - resolution: {integrity: sha512-6XgBBTX8O28W5gcSzqYkI72UVJV6Y2YcyQNrEqak39JavJRLlXCv09uLF97raynXAOO50KeP6DEXFy5P8MR2sw==} - engines: {node: '>= 16'} - hasBin: true - peerDependencies: - '@emnapi/runtime': ^1.1.0 - emnapi: ^1.1.0 - peerDependenciesMeta: - '@emnapi/runtime': - optional: true - emnapi: - optional: true - - '@napi-rs/cross-toolchain@0.0.16': - resolution: {integrity: sha512-jwdjHT5L0m9MH0CmzDwPp0ckn/UO7afHCsPeo7NugHUvYgvlgS7SWhdMVgIgJW2HHqhcW/2nhaLLGpAU1c7QRQ==} - peerDependencies: - '@napi-rs/cross-toolchain-arm64-target-aarch64': ^0.0.16 - '@napi-rs/cross-toolchain-arm64-target-armv7': ^0.0.16 - '@napi-rs/cross-toolchain-arm64-target-x86_64': ^0.0.16 - '@napi-rs/cross-toolchain-x64-target-aarch64': ^0.0.16 - '@napi-rs/cross-toolchain-x64-target-armv7': ^0.0.16 - '@napi-rs/cross-toolchain-x64-target-x86_64': ^0.0.16 - peerDependenciesMeta: - '@napi-rs/cross-toolchain-arm64-target-aarch64': - optional: true - '@napi-rs/cross-toolchain-arm64-target-armv7': - optional: true - '@napi-rs/cross-toolchain-arm64-target-x86_64': - optional: true - '@napi-rs/cross-toolchain-x64-target-aarch64': - optional: true - '@napi-rs/cross-toolchain-x64-target-armv7': - optional: true - '@napi-rs/cross-toolchain-x64-target-x86_64': - optional: true - - '@napi-rs/lzma-android-arm-eabi@1.3.1': - resolution: {integrity: sha512-mtGOg8jXlc+pTBI86cqohfndS9UmOAkk9d5CChKMb8btVks70yhUN1e7YYS3QFbmoxbPs2Ee+wmuH1Khdc7B2w==} - engines: {node: '>= 10'} - cpu: [arm] - os: [android] - - '@napi-rs/lzma-android-arm64@1.3.1': - resolution: {integrity: sha512-4uGkQgAv9Tnc/i0k2eIgbhZgyzs94+iECWxz4MFZNcZ1fNGvGbRL2j+SITE4OmwrUn3TuFK/uYWfgzooq8E1Qg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [android] - - '@napi-rs/lzma-darwin-arm64@1.3.1': - resolution: {integrity: sha512-MZBg4iwHTS8icjTiCMdzh8kYrMmKBCEglFPa+vjI91R2XDwuuwSzqmpATRpmMH8cWUUWtGPF4fnxKzjgkzhd4Q==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [darwin] - - '@napi-rs/lzma-darwin-x64@1.3.1': - resolution: {integrity: sha512-7vte+1lYV7xgZERKH/pjAeh4T16aQASKOzu4op70pK6VP/64Plr5rrvqxQqQmlAIe4pwyo/RkFl1n4LXDod3xg==} - engines: {node: '>= 10'} - cpu: [x64] - os: [darwin] - - '@napi-rs/lzma-freebsd-x64@1.3.1': - resolution: {integrity: sha512-uBS74fynTqLUC3catIxyezCafn8UDlr2yxVV47vz1T6Vop2PGDz/cMQdV6rnLSjPE08Rv66ihM36mgf/MmOkOg==} - engines: {node: '>= 10'} - cpu: [x64] - os: [freebsd] - - '@napi-rs/lzma-linux-arm-gnueabihf@1.3.1': - resolution: {integrity: sha512-rrVLyqBJeN29gPJCNkPbZ7dAzaseEcERKyhjwM+DfbFrDUvtkEcrYPvo+iwE/NmF+OkZQkzcanrVMGnq/mcJYQ==} - engines: {node: '>= 10'} - cpu: [arm] - os: [linux] - - '@napi-rs/lzma-linux-arm64-gnu@1.3.1': - resolution: {integrity: sha512-vDmVsthRbX2opkgRirJJGKQxUP/spvyVM2Y5CyCWZ7sadSID3hA97r38gf9ISn/sJ8/r93IPWLq+iycudNKi+Q==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/lzma-linux-arm64-musl@1.3.1': - resolution: {integrity: sha512-x4m/J3hRdFd3IoqKc+4aBcSUkcuDEP7hH6vdss8bKNLjPfXmnG/lcHJEQX3hNnNOULPP8xVRxgiY8jeL62cnsw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/lzma-linux-x64-gnu@1.3.1': - resolution: {integrity: sha512-riB+Xg72NfH8Kcpq07omshVu0QsLW0v2bhywBNYxvA+t2dGGWSIEN1U/zazUXys+IEA6pBQKqLVseurWE6Cl8g==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/lzma-linux-x64-musl@1.3.1': - resolution: {integrity: sha512-JXLgJFwoeysxdSg7rdVYP8wrliCQVJlU5JcLYjRVSCL4P0mQTjnYi7R7VdaOkDACw/Fvlji7oIJXt0KiaDTcOw==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/lzma-wasm32-wasi@1.3.1': - resolution: {integrity: sha512-XTA9XTUtj0KPKuzNS2oi3bWN6tJodk00wwMd/TiKoEqx9Fe/zu+OfDGuXAn+xs+P7S3YCDHqjYinuTQMZ0ucJw==} - engines: {node: '>=14.0.0'} - cpu: [wasm32] - - '@napi-rs/lzma-win32-arm64-msvc@1.3.1': - resolution: {integrity: sha512-qLDfs9UEtLPPTN/FdSz3gSdlx86VwFQBuLBrQtaiYQtUTKZCOYV1Z1fXqFt5Zqa1HKV2oyXnwGcTI7RpcyXxtg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [win32] - - '@napi-rs/lzma-win32-ia32-msvc@1.3.1': - resolution: {integrity: sha512-rWNlxLFMIfvxzfdQCfeQ3D/HEnQG3vfladFYrXUx6ePXO6r+BLCGn6/LWSSuKlw4vKkb1iHEWsAVaRLIcJEMIA==} - engines: {node: '>= 10'} - cpu: [ia32] - os: [win32] - - '@napi-rs/lzma-win32-x64-msvc@1.3.1': - resolution: {integrity: sha512-SNfHNqEjabXfTL1+KRi0qiAhwIlZHhQystvfSYX6p1g+2trSC/3WUpUQ4fbbR7KyE31g2AAnwjXivnlQ0af/pg==} - engines: {node: '>= 10'} - cpu: [x64] - os: [win32] - - '@napi-rs/lzma@1.3.1': - resolution: {integrity: sha512-XyZoBlYNMvCulK/RmVK/0nB3j7IdH7HpqcrMMg0U+HqQqKRLOQBwvnKNBocPC1bZQ7iZuKWYTLn1ayZwTyek8w==} - engines: {node: '>= 10'} - - '@napi-rs/tar-android-arm-eabi@0.1.1': - resolution: {integrity: sha512-Ufa0ahZvE5KGrC2WBux5svCe/jvC+e8IgtleiicwqnfgTfbDknYyq/QuqkP1AnMp/IvTmx2iutCZt6OFIG0zAg==} - engines: {node: '>= 10'} - cpu: [arm] - os: [android] - - '@napi-rs/tar-android-arm64@0.1.1': - resolution: {integrity: sha512-KUu5fHIiIObSuZ/crHxUrQ243+LiCRKPwdCVLHwjtftqFjzls+R2Mp6GrpM41XxexDMN00SUta3kazi93Xr19A==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [android] - - '@napi-rs/tar-darwin-arm64@0.1.1': - resolution: {integrity: sha512-jaqgdX20iIga+2gzotQ78eF00Cm8vECocUYeMY62WqyzJNv/jx1dlOfELWEccOjpmawFT9tjWebsS9F1QMvSUg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [darwin] - - '@napi-rs/tar-darwin-x64@0.1.1': - resolution: {integrity: sha512-80sa32IxfRso9x9sGTFpfLSx3BnruyJODpSkUzalOCz9i14n5gOKA8KR/JrnSWwDz0p5l5P9kfQD3pu8Voj7WA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [darwin] - - '@napi-rs/tar-freebsd-x64@0.1.1': - resolution: {integrity: sha512-P7V1zBjjC1dCrTwtUzuzYM4AeZduigeCtd8qQw2IUZowM5AsmhMd77oYuXjdU29cEpKUpyYjJRxjPCzFy+WbAQ==} - engines: {node: '>= 10'} - cpu: [x64] - os: [freebsd] - - '@napi-rs/tar-linux-arm-gnueabihf@0.1.1': - resolution: {integrity: sha512-qpC71ILPkWKt8k1iJCYt5gjwcOkd2VFSQIelTRr12t5CVNKV04rE/TMdwFoCP7kxbtb9Fl2cZzCRISw2BhMCmQ==} - engines: {node: '>= 10'} - cpu: [arm] - os: [linux] - - '@napi-rs/tar-linux-arm64-gnu@0.1.1': - resolution: {integrity: sha512-71QgxcFJCog6O4Tauoge8D0ILkDGJTRk3ru7zG8PUFG1QXJ1kkiRikdT77YmoVxtomc9FUOt+bdEdU5Yn+3QUQ==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/tar-linux-arm64-musl@0.1.1': - resolution: {integrity: sha512-R2e7YEILPKc447N1hUt1zQuyy0st83HX6nhmtFywS1aOj76/3hzxLVrebGiiS6kifyCrO82o66CNTYe7DixMZw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/tar-linux-x64-gnu@0.1.1': - resolution: {integrity: sha512-tmy9q2LXUB2GQ+IgUzJn3+us52leplMu96ORyFq1iHQEelGSqXt4xi5DzU07JhX3obJPqVqkybtcRS4enBfmBA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/tar-linux-x64-musl@0.1.1': - resolution: {integrity: sha512-j5ePbe6vihApl0cGPPDUVTWZbf2mF4NhxngAoG2jp7AeX3cWP2O4pjsvaOraW6QfvWEMFPeER7S0b6eBS7duvA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/tar-wasm32-wasi@0.1.1': - resolution: {integrity: sha512-se0+DlOiIRt7mcz7BeOJDoZtCrROpKLwiAOGmNgrjQ/SZS7TnOPuwm3wy9XN9WLoepttEjCEem6UP8yD5GJuQg==} - engines: {node: '>=14.0.0'} - cpu: [wasm32] - - '@napi-rs/tar-win32-arm64-msvc@0.1.1': - resolution: {integrity: sha512-FDZPi2wC7RwzvodogigLh/pJvhqCTVTUqOYuHlLkPSUbSAGiEkI55wk9RqH3y3EdJQaDuzyqC0QKz5ket2U+GA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [win32] - - '@napi-rs/tar-win32-ia32-msvc@0.1.1': - resolution: {integrity: sha512-OPR9Tou5z5M912G7Kc7gkf1ltinbOQx5dS/OeDIWHvPGOfdFDIxt0YVKhzSLRJi43+zIDp8/+cbeMD/cKXfX8w==} - engines: {node: '>= 10'} - cpu: [ia32] - os: [win32] - - '@napi-rs/tar-win32-x64-msvc@0.1.1': - resolution: {integrity: sha512-hiv5KfhrMSg8tTRC2oQXVckVg1h6ZVjwbd5aF9Esl0V3p2TaNFwwbqgnAN4Gm/PmSnHWNL/IRTHkk3cOzDWihQ==} - engines: {node: '>= 10'} - cpu: [x64] - os: [win32] - - '@napi-rs/tar@0.1.1': - resolution: {integrity: sha512-FOMhwwlvoYjHaDBxP26K3D92ltw1Y/CC4CIjgC6qXdzW4MYNwTlEyI58smCM3k+nCVJH3kpOYyH3sgbK4WZA4A==} - engines: {node: '>= 10'} - - '@napi-rs/wasm-runtime@0.2.4': - resolution: {integrity: sha512-9zESzOO5aDByvhIAsOy9TbpZ0Ur2AJbUI7UT73kcUTS2mxAMHOBaa1st/jAymNoCtvrit99kkzT1FZuXVcgfIQ==} - - '@napi-rs/wasm-tools-android-arm-eabi@0.0.2': - resolution: {integrity: sha512-/b+UU3suXjW4P0DzHRNdrnebQtFKcQf/YMeZJH+xUlKgvwli5kbmWjx8Wqqz0VETVkUTuPqJMBDIVLyc+14FGw==} - engines: {node: '>= 10'} - cpu: [arm] - os: [android] - - '@napi-rs/wasm-tools-android-arm64@0.0.2': - resolution: {integrity: sha512-j57GbDflwJdZtT8pZj5fOV4JAP+LdKN+wzsUYs+QRUoBqpWbbUANudolqfw63bkS9sD4z7fbCuz8iwtJqzxTVA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [android] - - '@napi-rs/wasm-tools-darwin-arm64@0.0.2': - resolution: {integrity: sha512-P2ChgWgVuv9GwmbxN89R84KzIImoTqXINteEixUvmkdnhyFiR+I8deNs89Yed+5w8QLC6MEfrtRqLP9YI+NoQA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [darwin] - - '@napi-rs/wasm-tools-darwin-x64@0.0.2': - resolution: {integrity: sha512-T/kQQ0gt8+wau1Z821PKVAD76QhmwVoLs2CT7Z9tTBs2pJvwSCP0C/kQiQAHcJIMi7A2E9Ab/Mez0BERy50EFA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [darwin] - - '@napi-rs/wasm-tools-freebsd-x64@0.0.2': - resolution: {integrity: sha512-GnnHu+r5sfzuxC/1J5UMF/h3BOZnHb3NQZ5hmbCfZYCKzpzRxrAJhzRunlbRN+v0x8M/49dztVTYR3s7K4ooAw==} - engines: {node: '>= 10'} - cpu: [x64] - os: [freebsd] - - '@napi-rs/wasm-tools-linux-arm64-gnu@0.0.2': - resolution: {integrity: sha512-KnZdLT0OnKb1CG2kdt3/WvM43vr9i+FEwXCvSOVC/6Tsifz7ynhMg7LAVESILd03HubzQJfg9nbRsk0bQ+IOwg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/wasm-tools-linux-arm64-musl@0.0.2': - resolution: {integrity: sha512-HkpZOID2U8P6pWqK3mqZ8bxU5xcuT3iA2fO+jrxn78h006iYgfNmdc5JaVhHnHazMmk32xKhSV4iV0VUh8UWDg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/wasm-tools-linux-x64-gnu@0.0.2': - resolution: {integrity: sha512-YksJWBCyOalB9ogtP9+/dZKP+vR6+h7BmzMXaXMT71WW/GvIsifMVgv+DY/FRSNJQupp5Y+ugjqVAOUOc/G65g==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/wasm-tools-linux-x64-musl@0.0.2': - resolution: {integrity: sha512-sPtRxPMdw05KdTcxgSPMmSXG2+PiK3vJ/l2+g9hvjnnKtvslJN2Hr7j8zgzuoKRAUFPaJVe6+D2xVh5cpdqhww==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/wasm-tools-wasm32-wasi@0.0.2': - resolution: {integrity: sha512-muRvZK7AIuo88G2AxYx3gA59rHMQgoN004saQkBvXnz3K/DVHKfTZ6TtUebss8zI3dURU6xExL8drxFWYxjEbQ==} - engines: {node: '>=14.0.0'} - cpu: [wasm32] - - '@napi-rs/wasm-tools-win32-arm64-msvc@0.0.2': - resolution: {integrity: sha512-Cn13WQ+tpFqdVwx0DIWKbsI9auFyzVZV4F5UNOUeDt6GgOL+NndgJul0Pc9bSU6fi03AylMPfF/nTCaDWO2Wgw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [win32] - - '@napi-rs/wasm-tools-win32-ia32-msvc@0.0.2': - resolution: {integrity: sha512-xsg5DkIQi82a8rcx6246Y3XC8TIqHamY+/C6sIlPLaZEuHctDkMECAw0AANwRf5vN//D2oo2oljOuoYtB1GOKw==} - engines: {node: '>= 10'} - cpu: [ia32] - os: [win32] - - '@napi-rs/wasm-tools-win32-x64-msvc@0.0.2': - resolution: {integrity: sha512-yHigltEt33eq8bappvKsIliz4MxfMPn1M+NWbIFRWN+IS1Z57mhmc1osuk+IRXrSlq0Tom0R6MYN1jpkZKz81Q==} - engines: {node: '>= 10'} - cpu: [x64] - os: [win32] - - '@napi-rs/wasm-tools@0.0.2': - resolution: {integrity: sha512-kBvDQCP5BLw2TxTENXLp3Of7vVEx0uyIye824JHE4dduzzOHVgSoOFVhVqAT3Fx/hLV445RVWfEqQbXMg4w/Mw==} - engines: {node: '>= 10'} - - '@nodelib/fs.scandir@2.1.5': - resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} - engines: {node: '>= 8'} - - '@nodelib/fs.stat@2.0.5': - resolution: {integrity: sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==} - engines: {node: '>= 8'} - - '@nodelib/fs.walk@1.2.8': - resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} - engines: {node: '>= 8'} - - '@octokit/auth-token@4.0.0': - resolution: {integrity: sha512-tY/msAuJo6ARbK6SPIxZrPBms3xPbfwBrulZe0Wtr/DIY9lje2HeV1uoebShn6mx7SjCHif6EjMvoREj+gZ+SA==} - engines: {node: '>= 18'} - - '@octokit/core@5.2.0': - resolution: {integrity: sha512-1LFfa/qnMQvEOAdzlQymH0ulepxbxnCYAKJZfMci/5XJyIHWgEYnDmgnKakbTh7CH2tFQ5O60oYDvns4i9RAIg==} - engines: {node: '>= 18'} - - '@octokit/endpoint@9.0.5': - resolution: {integrity: sha512-ekqR4/+PCLkEBF6qgj8WqJfvDq65RH85OAgrtnVp1mSxaXF03u2xW/hUdweGS5654IlC0wkNYC18Z50tSYTAFw==} - engines: {node: '>= 18'} - - '@octokit/graphql@7.1.0': - resolution: {integrity: sha512-r+oZUH7aMFui1ypZnAvZmn0KSqAUgE1/tUXIWaqUCa1758ts/Jio84GZuzsvUkme98kv0WFY8//n0J1Z+vsIsQ==} - engines: {node: '>= 18'} - - '@octokit/openapi-types@22.2.0': - resolution: {integrity: sha512-QBhVjcUa9W7Wwhm6DBFu6ZZ+1/t/oYxqc2tp81Pi41YNuJinbFRx8B133qVOrAaBbF7D/m0Et6f9/pZt9Rc+tg==} - - '@octokit/plugin-paginate-rest@11.3.1': - resolution: {integrity: sha512-ryqobs26cLtM1kQxqeZui4v8FeznirUsksiA+RYemMPJ7Micju0WSkv50dBksTuZks9O5cg4wp+t8fZ/cLY56g==} - engines: {node: '>= 18'} - peerDependencies: - '@octokit/core': '5' - - '@octokit/plugin-request-log@4.0.1': - resolution: {integrity: sha512-GihNqNpGHorUrO7Qa9JbAl0dbLnqJVrV8OXe2Zm5/Y4wFkZQDfTreBzVmiRfJVfE4mClXdihHnbpyyO9FSX4HA==} - engines: {node: '>= 18'} - peerDependencies: - '@octokit/core': '5' - - '@octokit/plugin-rest-endpoint-methods@13.2.2': - resolution: {integrity: sha512-EI7kXWidkt3Xlok5uN43suK99VWqc8OaIMktY9d9+RNKl69juoTyxmLoWPIZgJYzi41qj/9zU7G/ljnNOJ5AFA==} - engines: {node: '>= 18'} - peerDependencies: - '@octokit/core': ^5 - - '@octokit/request-error@5.1.0': - resolution: {integrity: sha512-GETXfE05J0+7H2STzekpKObFe765O5dlAKUTLNGeH+x47z7JjXHfsHKo5z21D/o/IOZTUEI6nyWyR+bZVP/n5Q==} - engines: {node: '>= 18'} - - '@octokit/request@8.4.0': - resolution: {integrity: sha512-9Bb014e+m2TgBeEJGEbdplMVWwPmL1FPtggHQRkV+WVsMggPtEkLKPlcVYm/o8xKLkpJ7B+6N8WfQMtDLX2Dpw==} - engines: {node: '>= 18'} - - '@octokit/rest@20.1.1': - resolution: {integrity: sha512-MB4AYDsM5jhIHro/dq4ix1iWTLGToIGk6cWF5L6vanFaMble5jTX/UBQyiv05HsWnwUtY8JrfHy2LWfKwihqMw==} - engines: {node: '>= 18'} - - '@octokit/types@13.5.0': - resolution: {integrity: sha512-HdqWTf5Z3qwDVlzCrP8UJquMwunpDiMPt5er+QjGzL4hqr/vBVY/MauQgS1xWxCDT1oMx1EULyqxncdCY/NVSQ==} - - '@rollup/pluginutils@4.2.1': - resolution: {integrity: sha512-iKnFXr7NkdZAIHiIWE+BX5ULi/ucVFYWD6TbAV+rZctiRTY2PL6tsIKhoIOaoskiWAkgu+VsbXgUVDNLHf+InQ==} - engines: {node: '>= 8.0.0'} - - '@sindresorhus/merge-streams@2.3.0': - resolution: {integrity: sha512-LtoMMhxAlorcGhmFYI+LhPgbPZCkgP6ra1YL604EeF6U98pLlQ3iWIGMdWSC+vWmPBWBNgmDBAhnAobLROJmwg==} - engines: {node: '>=18'} - - '@tybys/wasm-util@0.9.0': - resolution: {integrity: sha512-6+7nlbMVX/PVDCwaIQ8nTOPveOcFLSt8GcXdx8hD0bt39uWxYT88uXzqTd4fTvqta7oeUJqudepapKNt2DYJFw==} - - '@types/node@20.14.2': - resolution: {integrity: sha512-xyu6WAMVwv6AKFLB+e/7ySZVr/0zLCzOa7rSpq6jNwpqOrUbcACDWC+53d4n2QHOnDou0fbIsg8wZu/sxrnI4Q==} - - '@types/stylis@4.2.6': - resolution: {integrity: sha512-4nebF2ZJGzQk0ka0O6+FZUWceyFv4vWq/0dXBMmrSeAwzOuOd/GxE5Pa64d/ndeNLG73dXoBsRzvtsVsYUv6Uw==} - - '@vercel/nft@0.26.5': - resolution: {integrity: sha512-NHxohEqad6Ra/r4lGknO52uc/GrWILXAMs1BB4401GTqww0fw1bAqzpG1XHuDO+dprg4GvsD9ZLLSsdo78p9hQ==} - engines: {node: '>=16'} - hasBin: true - - abbrev@1.1.1: - resolution: {integrity: sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==} - - acorn-import-attributes@1.9.5: - resolution: {integrity: sha512-n02Vykv5uA3eHGM/Z2dQrcD56kL8TyDb2p1+0P83PClMnC/nc+anbQRhIOWnSq4Ke/KvDPrY3C9hDtC/A3eHnQ==} - peerDependencies: - acorn: ^8 - - acorn-walk@8.3.3: - resolution: {integrity: sha512-MxXdReSRhGO7VlFe1bRG/oI7/mdLV9B9JJT0N8vZOhF7gFRR5l3M8W9G8JxmKV+JC5mGqJ0QvqfSOLsCPa4nUw==} - engines: {node: '>=0.4.0'} - - acorn@8.12.0: - resolution: {integrity: sha512-RTvkC4w+KNXrM39/lWCUaG0IbRkWdCv7W/IOW9oU6SawyxulvkQy5HQPVTKxEjczcUvapcrw3cFx/60VN/NRNw==} - engines: {node: '>=0.4.0'} - hasBin: true - - agent-base@6.0.2: - resolution: {integrity: sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==} - engines: {node: '>= 6.0.0'} - - ansi-escapes@4.3.2: - resolution: {integrity: sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==} - engines: {node: '>=8'} - - ansi-regex@5.0.1: - resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} - engines: {node: '>=8'} - - ansi-regex@6.0.1: - resolution: {integrity: sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==} - engines: {node: '>=12'} - - ansi-styles@4.3.0: - resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} - engines: {node: '>=8'} - - ansi-styles@6.2.1: - resolution: {integrity: sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==} - engines: {node: '>=12'} - - aproba@2.0.0: - resolution: {integrity: sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==} - - are-we-there-yet@2.0.0: - resolution: {integrity: sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw==} - engines: {node: '>=10'} - deprecated: This package is no longer supported. - - argparse@1.0.10: - resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==} - - argparse@2.0.1: - resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} - - array-find-index@1.0.2: - resolution: {integrity: sha512-M1HQyIXcBGtVywBt8WVdim+lrNaK7VHp99Qt5pSNziXznKHViIBbXWtfRTpEFpF/c4FdfxNAsCCwPp5phBYJtw==} - engines: {node: '>=0.10.0'} - - arrgv@1.0.2: - resolution: {integrity: sha512-a4eg4yhp7mmruZDQFqVMlxNRFGi/i1r87pt8SDHy0/I8PqSXoUTlWZRdAZo0VXgvEARcujbtTk8kiZRi1uDGRw==} - engines: {node: '>=8.0.0'} - - arrify@3.0.0: - resolution: {integrity: sha512-tLkvA81vQG/XqE2mjDkGQHoOINtMHtysSnemrmoGe6PydDPMRbVugqyk4A6V/WDWEfm3l+0d8anA9r8cv/5Jaw==} - engines: {node: '>=12'} - - async-sema@3.1.1: - resolution: {integrity: sha512-tLRNUXati5MFePdAk8dw7Qt7DpxPB60ofAgn8WRhW6a2rcimZnYBP9oxHiv0OHy+Wz7kPMG+t4LGdt31+4EmGg==} - - asynckit@0.4.0: - resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} - - ava@6.1.3: - resolution: {integrity: sha512-tkKbpF1pIiC+q09wNU9OfyTDYZa8yuWvU2up3+lFJ3lr1RmnYh2GBpPwzYUEB0wvTPIUysGjcZLNZr7STDviRA==} - engines: {node: ^18.18 || ^20.8 || ^21 || ^22} - hasBin: true - peerDependencies: - '@ava/typescript': '*' - peerDependenciesMeta: - '@ava/typescript': - optional: true - - axios@1.6.2: - resolution: {integrity: sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A==} - - balanced-match@1.0.2: - resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} - - base64-js@1.5.1: - resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==} - - before-after-hook@2.2.3: - resolution: {integrity: sha512-NzUnlZexiaH/46WDhANlyR2bXRopNg4F/zuSA3OpZnllCUgRaOF2znDioDWrmbNVsuZk6l9pMquQB38cfBZwkQ==} - - bindings@1.5.0: - resolution: {integrity: sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==} - - bl@4.1.0: - resolution: {integrity: sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==} - - blueimp-md5@2.19.0: - resolution: {integrity: sha512-DRQrD6gJyy8FbiE4s+bDoXS9hiW3Vbx5uCdwvcCf3zLHL+Iv7LtGHLpr+GZV8rHG8tK766FGYBwRbu8pELTt+w==} - - brace-expansion@1.1.11: - resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} - - braces@3.0.3: - resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==} - engines: {node: '>=8'} - - buffer@5.7.1: - resolution: {integrity: sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==} - - call-bind@1.0.7: - resolution: {integrity: sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==} - engines: {node: '>= 0.4'} - - callsites@4.1.0: - resolution: {integrity: sha512-aBMbD1Xxay75ViYezwT40aQONfr+pSXTHwNKvIXhXD6+LY3F1dLIcceoC5OZKBVHbXcysz1hL9D2w0JJIMXpUw==} - engines: {node: '>=12.20'} - - camelize@1.0.1: - resolution: {integrity: sha512-dU+Tx2fsypxTgtLoE36npi3UqcjSSMNYfkqgmoEhtZrraP5VWq0K7FkWVTYa8eMPtnU/G2txVsfdCJTn9uzpuQ==} - - cbor@9.0.2: - resolution: {integrity: sha512-JPypkxsB10s9QOWwa6zwPzqE1Md3vqpPc+cai4sAecuCsRyAtAl/pMyhPlMbT/xtPnm2dznJZYRLui57qiRhaQ==} - engines: {node: '>=16'} - - chalk@4.1.2: - resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} - engines: {node: '>=10'} - - chalk@5.3.0: - resolution: {integrity: sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==} - engines: {node: ^12.17.0 || ^14.13 || >=16.0.0} - - chardet@0.7.0: - resolution: {integrity: sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==} - - chownr@2.0.0: - resolution: {integrity: sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==} - engines: {node: '>=10'} - - chunkd@2.0.1: - resolution: {integrity: sha512-7d58XsFmOq0j6el67Ug9mHf9ELUXsQXYJBkyxhH/k+6Ke0qXRnv0kbemx+Twc6fRJ07C49lcbdgm9FL1Ei/6SQ==} - - ci-info@4.0.0: - resolution: {integrity: sha512-TdHqgGf9odd8SXNuxtUBVx8Nv+qZOejE6qyqiy5NtbYYQOeFa6zmHkxlPzmaLxWWHsU6nJmB7AETdVPi+2NBUg==} - engines: {node: '>=8'} - - ci-parallel-vars@1.0.1: - resolution: {integrity: sha512-uvzpYrpmidaoxvIQHM+rKSrigjOe9feHYbw4uOI2gdfe1C3xIlxO+kVXq83WQWNniTf8bAxVpy+cQeFQsMERKg==} - - cli-cursor@3.1.0: - resolution: {integrity: sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==} - engines: {node: '>=8'} - - cli-spinners@2.9.2: - resolution: {integrity: sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==} - engines: {node: '>=6'} - - cli-truncate@4.0.0: - resolution: {integrity: sha512-nPdaFdQ0h/GEigbPClz11D0v/ZJEwxmeVZGeMo3Z5StPtUTkA9o1lD6QwoirYiSDzbcwn2XcjwmCp68W1IS4TA==} - engines: {node: '>=18'} - - cli-width@4.1.0: - resolution: {integrity: sha512-ouuZd4/dm2Sw5Gmqy6bGyNNNe1qt9RpmxveLSO7KcgsTnU7RXfsw+/bukWGo1abgBiMAic068rclZsO4IWmmxQ==} - engines: {node: '>= 12'} - - clipanion@3.2.1: - resolution: {integrity: sha512-dYFdjLb7y1ajfxQopN05mylEpK9ZX0sO1/RfMXdfmwjlIsPkbh4p7A682x++zFPLDCo1x3p82dtljHf5cW2LKA==} - peerDependencies: - typanion: '*' - - cliui@8.0.1: - resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==} - engines: {node: '>=12'} - - clone@1.0.4: - resolution: {integrity: sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==} - engines: {node: '>=0.8'} - - code-excerpt@4.0.0: - resolution: {integrity: sha512-xxodCmBen3iy2i0WtAK8FlFNrRzjUqjRsMfho58xT/wvZU1YTM3fCnRjcy1gJPMepaRlgm/0e6w8SpWHpn3/cA==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - color-convert@2.0.1: - resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} - engines: {node: '>=7.0.0'} - - color-name@1.1.4: - resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} - - color-support@1.1.3: - resolution: {integrity: sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==} - hasBin: true - - colorette@2.0.20: - resolution: {integrity: sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==} - - combined-stream@1.0.8: - resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} - engines: {node: '>= 0.8'} - - common-path-prefix@3.0.0: - resolution: {integrity: sha512-QE33hToZseCH3jS0qN96O/bSh3kaw/h+Tq7ngyY9eWDUnTlTNUyqfqvCXioLe5Na5jFsL78ra/wuBU4iuEgd4w==} - - concat-map@0.0.1: - resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} - - concordance@5.0.4: - resolution: {integrity: sha512-OAcsnTEYu1ARJqWVGwf4zh4JDfHZEaSNlNccFmt8YjB2l/n19/PF2viLINHc57vO4FKIAFl2FWASIGZZWZ2Kxw==} - engines: {node: '>=10.18.0 <11 || >=12.14.0 <13 || >=14'} - - console-control-strings@1.1.0: - resolution: {integrity: sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==} - - convert-to-spaces@2.0.1: - resolution: {integrity: sha512-rcQ1bsQO9799wq24uE5AM2tAILy4gXGIK/njFWcVQkGNZ96edlpY+A7bjwvzjYvLDyzmG1MmMLZhpcsb+klNMQ==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - css-color-keywords@1.0.0: - resolution: {integrity: sha512-FyyrDHZKEjXDpNJYvVsV960FiqQyXc/LlYmsxl2BcdMb2WPx0OGRVgTg55rPSyLSNMqP52R9r8geSp7apN3Ofg==} - engines: {node: '>=4'} - - css-to-react-native@3.2.0: - resolution: {integrity: sha512-e8RKaLXMOFii+02mOlqwjbD00KSEKqblnpO9e++1aXS1fPQOpS1YoqdVHBqPjHNoxeF2mimzVqawm2KCbEdtHQ==} - - csstype@3.1.3: - resolution: {integrity: sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==} - - currently-unhandled@0.4.1: - resolution: {integrity: sha512-/fITjgjGU50vjQ4FH6eUoYu+iUoUKIXws2hL15JJpIR+BbTxaXQsMuuyjtNh2WqsSBS5nsaZHFsFecyw5CCAng==} - engines: {node: '>=0.10.0'} - - date-time@3.1.0: - resolution: {integrity: sha512-uqCUKXE5q1PNBXjPqvwhwJf9SwMoAHBgWJ6DcrnS5o+W2JOiIILl0JEdVD8SGujrNS02GGxgwAg2PN2zONgtjg==} - engines: {node: '>=6'} - - debug@4.3.5: - resolution: {integrity: sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg==} - engines: {node: '>=6.0'} - peerDependencies: - supports-color: '*' - peerDependenciesMeta: - supports-color: - optional: true - - defaults@1.0.4: - resolution: {integrity: sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A==} - - define-data-property@1.1.4: - resolution: {integrity: sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==} - engines: {node: '>= 0.4'} - - delayed-stream@1.0.0: - resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} - engines: {node: '>=0.4.0'} - - delegates@1.0.0: - resolution: {integrity: sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==} - - deprecation@2.3.1: - resolution: {integrity: sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==} - - detect-libc@2.0.3: - resolution: {integrity: sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw==} - engines: {node: '>=8'} - - emittery@1.0.3: - resolution: {integrity: sha512-tJdCJitoy2lrC2ldJcqN4vkqJ00lT+tOWNT1hBJjO/3FDMJa5TTIiYGCKGkn/WfCyOzUMObeohbVTj00fhiLiA==} - engines: {node: '>=14.16'} - - emnapi@1.2.0: - resolution: {integrity: sha512-rcq+dJCcfr08I0XM/57LPRqaUokGfni/+SvhO7NaJthTTjRdohhIy0FQwyC5rR1enAsjkldQg83th8J5hURv0Q==} - peerDependencies: - node-addon-api: '>= 6.1.0' - peerDependenciesMeta: - node-addon-api: - optional: true - - emoji-regex@10.3.0: - resolution: {integrity: sha512-QpLs9D9v9kArv4lfDEgg1X/gN5XLnf/A6l9cs8SPZLRZR3ZkY9+kwIQTxm+fsSej5UMYGE8fdoaZVIBlqG0XTw==} - - emoji-regex@8.0.0: - resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} - - es-define-property@1.0.0: - resolution: {integrity: sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==} - engines: {node: '>= 0.4'} - - es-errors@1.3.0: - resolution: {integrity: sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==} - engines: {node: '>= 0.4'} - - escalade@3.1.2: - resolution: {integrity: sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==} - engines: {node: '>=6'} - - escape-string-regexp@2.0.0: - resolution: {integrity: sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==} - engines: {node: '>=8'} - - escape-string-regexp@5.0.0: - resolution: {integrity: sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==} - engines: {node: '>=12'} - - esprima@4.0.1: - resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==} - engines: {node: '>=4'} - hasBin: true - - estree-walker@2.0.2: - resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==} - - esutils@2.0.3: - resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} - engines: {node: '>=0.10.0'} - - external-editor@3.1.0: - resolution: {integrity: sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==} - engines: {node: '>=4'} - - fast-diff@1.3.0: - resolution: {integrity: sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==} - - fast-glob@3.3.2: - resolution: {integrity: sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==} - engines: {node: '>=8.6.0'} - - fastq@1.17.1: - resolution: {integrity: sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==} - - figures@6.1.0: - resolution: {integrity: sha512-d+l3qxjSesT4V7v2fh+QnmFnUWv9lSpjarhShNTgBOfA0ttejbQUAlHLitbjkoRiDulW0OPoQPYIGhIC8ohejg==} - engines: {node: '>=18'} - - file-uri-to-path@1.0.0: - resolution: {integrity: sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==} - - fill-range@7.1.1: - resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==} - engines: {node: '>=8'} - - find-up-simple@1.0.0: - resolution: {integrity: sha512-q7Us7kcjj2VMePAa02hDAF6d+MzsdsAWEwYyOpwUtlerRBkOEPBCRZrAV4XfcSN8fHAgaD0hP7miwoay6DCprw==} - engines: {node: '>=18'} - - follow-redirects@1.15.6: - resolution: {integrity: sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==} - engines: {node: '>=4.0'} - peerDependencies: - debug: '*' - peerDependenciesMeta: - debug: - optional: true - - form-data@4.0.0: - resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==} - engines: {node: '>= 6'} - - fs-minipass@2.1.0: - resolution: {integrity: sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==} - engines: {node: '>= 8'} - - fs.realpath@1.0.0: - resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} - - function-bind@1.1.2: - resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==} - - gauge@3.0.2: - resolution: {integrity: sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q==} - engines: {node: '>=10'} - deprecated: This package is no longer supported. - - get-caller-file@2.0.5: - resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} - engines: {node: 6.* || 8.* || >= 10.*} - - get-east-asian-width@1.2.0: - resolution: {integrity: sha512-2nk+7SIVb14QrgXFHcm84tD4bKQz0RxPuMT8Ag5KPOq7J5fEmAg0UbXdTOSHqNuHSU28k55qnceesxXRZGzKWA==} - engines: {node: '>=18'} - - get-intrinsic@1.2.4: - resolution: {integrity: sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==} - engines: {node: '>= 0.4'} - - glob-parent@5.1.2: - resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} - engines: {node: '>= 6'} - - glob@7.2.3: - resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} - deprecated: Glob versions prior to v9 are no longer supported - - globby@14.0.1: - resolution: {integrity: sha512-jOMLD2Z7MAhyG8aJpNOpmziMOP4rPLcc95oQPKXBazW82z+CEgPFBQvEpRUa1KeIMUJo4Wsm+q6uzO/Q/4BksQ==} - engines: {node: '>=18'} - - gopd@1.0.1: - resolution: {integrity: sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==} - - graceful-fs@4.2.11: - resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} - - has-flag@4.0.0: - resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} - engines: {node: '>=8'} - - has-property-descriptors@1.0.2: - resolution: {integrity: sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==} - - has-proto@1.0.3: - resolution: {integrity: sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==} - engines: {node: '>= 0.4'} - - has-symbols@1.0.3: - resolution: {integrity: sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==} - engines: {node: '>= 0.4'} - - has-unicode@2.0.1: - resolution: {integrity: sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==} - - hasown@2.0.2: - resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==} - engines: {node: '>= 0.4'} - - https-proxy-agent@5.0.1: - resolution: {integrity: sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==} - engines: {node: '>= 6'} - - iconv-lite@0.4.24: - resolution: {integrity: sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==} - engines: {node: '>=0.10.0'} - - ieee754@1.2.1: - resolution: {integrity: sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==} - - ignore-by-default@2.1.0: - resolution: {integrity: sha512-yiWd4GVmJp0Q6ghmM2B/V3oZGRmjrKLXvHR3TE1nfoXsmoggllfZUQe74EN0fJdPFZu2NIvNdrMMLm3OsV7Ohw==} - engines: {node: '>=10 <11 || >=12 <13 || >=14'} - - ignore@5.3.1: - resolution: {integrity: sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==} - engines: {node: '>= 4'} - - imurmurhash@0.1.4: - resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} - engines: {node: '>=0.8.19'} - - indent-string@5.0.0: - resolution: {integrity: sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==} - engines: {node: '>=12'} - - inflight@1.0.6: - resolution: {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. - - inherits@2.0.4: - resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} - - inquirer@9.2.23: - resolution: {integrity: sha512-kod5s+FBPIDM2xiy9fu+6wdU/SkK5le5GS9lh4FEBjBHqiMgD9lLFbCbuqFNAjNL2ZOy9Wd9F694IOzN9pZHBA==} - engines: {node: '>=18'} - - irregular-plurals@3.5.0: - resolution: {integrity: sha512-1ANGLZ+Nkv1ptFb2pa8oG8Lem4krflKuX/gINiHJHjJUKaJHk/SXk5x6K3J+39/p0h1RQ2saROclJJ+QLvETCQ==} - engines: {node: '>=8'} - - is-extglob@2.1.1: - resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} - engines: {node: '>=0.10.0'} - - is-fullwidth-code-point@3.0.0: - resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} - engines: {node: '>=8'} - - is-fullwidth-code-point@4.0.0: - resolution: {integrity: sha512-O4L094N2/dZ7xqVdrXhh9r1KODPJpFms8B5sGdJLPy664AgvXsreZUyCQQNItZRDlYug4xStLjNp/sz3HvBowQ==} - engines: {node: '>=12'} - - is-glob@4.0.3: - resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} - engines: {node: '>=0.10.0'} - - is-interactive@1.0.0: - resolution: {integrity: sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w==} - engines: {node: '>=8'} - - is-number@7.0.0: - resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} - engines: {node: '>=0.12.0'} - - is-plain-object@5.0.0: - resolution: {integrity: sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==} - engines: {node: '>=0.10.0'} - - is-promise@4.0.0: - resolution: {integrity: sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==} - - is-unicode-supported@0.1.0: - resolution: {integrity: sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==} - engines: {node: '>=10'} - - is-unicode-supported@2.0.0: - resolution: {integrity: sha512-FRdAyx5lusK1iHG0TWpVtk9+1i+GjrzRffhDg4ovQ7mcidMQ6mj+MhKPmvh7Xwyv5gIS06ns49CA7Sqg7lC22Q==} - engines: {node: '>=18'} - - js-string-escape@1.0.1: - resolution: {integrity: sha512-Smw4xcfIQ5LVjAOuJCvN/zIodzA/BBSsluuoSykP+lUvScIi4U6RJLfwHet5cxFnCswUjISV8oAXaqaJDY3chg==} - engines: {node: '>= 0.8'} - - js-tokens@4.0.0: - resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} - - js-yaml@3.14.1: - resolution: {integrity: sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==} - hasBin: true - - js-yaml@4.1.0: - resolution: {integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==} - hasBin: true - - load-json-file@7.0.1: - resolution: {integrity: sha512-Gnxj3ev3mB5TkVBGad0JM6dmLiQL+o0t23JPBZ9sd+yvSLk05mFoqKBw5N8gbbkU4TNXyqCgIrl/VM17OgUIgQ==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - lodash-es@4.17.21: - resolution: {integrity: sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==} - - lodash@4.17.21: - resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} - - log-symbols@4.1.0: - resolution: {integrity: sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==} - engines: {node: '>=10'} - - loose-envify@1.4.0: - resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==} - hasBin: true - - make-dir@3.1.0: - resolution: {integrity: sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==} - engines: {node: '>=8'} - - matcher@5.0.0: - resolution: {integrity: sha512-s2EMBOWtXFc8dgqvoAzKJXxNHibcdJMV0gwqKUaw9E2JBJuGUK7DrNKrA6g/i+v72TT16+6sVm5mS3thaMLQUw==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - md5-hex@3.0.1: - resolution: {integrity: sha512-BUiRtTtV39LIJwinWBjqVsU9xhdnz7/i889V859IBFpuqGAj6LuOvHv5XLbgZ2R7ptJoJaEcxkv88/h25T7Ciw==} - engines: {node: '>=8'} - - memoize@10.0.0: - resolution: {integrity: sha512-H6cBLgsi6vMWOcCpvVCdFFnl3kerEXbrYh9q+lY6VXvQSmM6CkmV08VOwT+WE2tzIEqRPFfAq3fm4v/UIW6mSA==} - engines: {node: '>=18'} - - merge2@1.4.1: - resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} - engines: {node: '>= 8'} - - micromatch@4.0.7: - resolution: {integrity: sha512-LPP/3KorzCwBxfeUuZmaR6bG2kdeHSbe0P2tY3FLRU4vYrjYz5hI4QZwV0njUx3jeuKe67YukQ1LSPZBKDqO/Q==} - engines: {node: '>=8.6'} - - mime-db@1.52.0: - resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} - engines: {node: '>= 0.6'} - - mime-types@2.1.35: - resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} - engines: {node: '>= 0.6'} - - mimic-fn@2.1.0: - resolution: {integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==} - engines: {node: '>=6'} - - mimic-function@5.0.1: - resolution: {integrity: sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==} - engines: {node: '>=18'} - - minimatch@3.1.2: - resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} - - minipass@3.3.6: - resolution: {integrity: sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==} - engines: {node: '>=8'} - - minipass@5.0.0: - resolution: {integrity: sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==} - engines: {node: '>=8'} - - minizlib@2.1.2: - resolution: {integrity: sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==} - engines: {node: '>= 8'} - - mkdirp@1.0.4: - resolution: {integrity: sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==} - engines: {node: '>=10'} - hasBin: true - - ms@2.1.2: - resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} - - ms@2.1.3: - resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} - - mute-stream@1.0.0: - resolution: {integrity: sha512-avsJQhyd+680gKXyG/sQc0nXaC6rBkPOfyHYcFb9+hdkqQkR9bdnkJ0AMZhke0oesPqIO+mFFJ+IdBc7mst4IA==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - - nanoid@3.3.7: - resolution: {integrity: sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==} - engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} - hasBin: true - - node-fetch@2.7.0: - resolution: {integrity: sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==} - engines: {node: 4.x || >=6.0.0} - peerDependencies: - encoding: ^0.1.0 - peerDependenciesMeta: - encoding: - optional: true - - node-gyp-build@4.8.1: - resolution: {integrity: sha512-OSs33Z9yWr148JZcbZd5WiAXhh/n9z8TxQcdMhIOlpN9AhWpLfvVFO73+m77bBABQMaY9XSvIa+qk0jlI7Gcaw==} - hasBin: true - - nofilter@3.1.0: - resolution: {integrity: sha512-l2NNj07e9afPnhAhvgVrCD/oy2Ai1yfLpuo3EpiO1jFTsB4sFz6oIfAfSZyQzVpkZQ9xS8ZS5g1jCBgq4Hwo0g==} - engines: {node: '>=12.19'} - - nopt@5.0.0: - resolution: {integrity: sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==} - engines: {node: '>=6'} - hasBin: true - - npmlog@5.0.1: - resolution: {integrity: sha512-AqZtDUWOMKs1G/8lwylVjrdYgqA4d9nu8hc+0gzRxlDb1I10+FHBGMXs6aiQHFdCUUlqH99MUMuLfzWDNDtfxw==} - deprecated: This package is no longer supported. - - object-assign@4.1.1: - resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} - engines: {node: '>=0.10.0'} - - once@1.4.0: - resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} - - onetime@5.1.2: - resolution: {integrity: sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==} - engines: {node: '>=6'} - - ora@5.4.1: - resolution: {integrity: sha512-5b6Y85tPxZZ7QytO+BQzysW31HJku27cRIlkbAXaNx+BdcVi+LlRFmVXzeF6a7JCwJpyw5c4b+YSVImQIrBpuQ==} - engines: {node: '>=10'} - - os-tmpdir@1.0.2: - resolution: {integrity: sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==} - engines: {node: '>=0.10.0'} - - p-map@7.0.2: - resolution: {integrity: sha512-z4cYYMMdKHzw4O5UkWJImbZynVIo0lSGTXc7bzB1e/rrDqkgGUNysK/o4bTr+0+xKvvLoTyGqYC4Fgljy9qe1Q==} - engines: {node: '>=18'} - - package-config@5.0.0: - resolution: {integrity: sha512-GYTTew2slBcYdvRHqjhwaaydVMvn/qrGC323+nKclYioNSLTDUM/lGgtGTgyHVtYcozb+XkE8CNhwcraOmZ9Mg==} - engines: {node: '>=18'} - - parse-ms@4.0.0: - resolution: {integrity: sha512-TXfryirbmq34y8QBwgqCVLi+8oA3oWx2eAnSn62ITyEhEYaWRlVZ2DvMM9eZbMs/RfxPu/PK/aBLyGj4IrqMHw==} - engines: {node: '>=18'} - - path-is-absolute@1.0.1: - resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==} - engines: {node: '>=0.10.0'} - - path-type@5.0.0: - resolution: {integrity: sha512-5HviZNaZcfqP95rwpv+1HDgUamezbqdSYTyzjTvwtJSnIH+3vnbmWsItli8OFEndS984VT55M3jduxZbX351gg==} - engines: {node: '>=12'} - - picocolors@1.0.1: - resolution: {integrity: sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==} - - picomatch@2.3.1: - resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} - engines: {node: '>=8.6'} - - picomatch@3.0.1: - resolution: {integrity: sha512-I3EurrIQMlRc9IaAZnqRR044Phh2DXY+55o7uJ0V+hYZAcQYSuFWsc9q5PvyDHUSCe1Qxn/iBz+78s86zWnGag==} - engines: {node: '>=10'} - - plur@5.1.0: - resolution: {integrity: sha512-VP/72JeXqak2KiOzjgKtQen5y3IZHn+9GOuLDafPv0eXa47xq0At93XahYBs26MsifCQ4enGKwbjBTKgb9QJXg==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - postcss-value-parser@4.2.0: - resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==} - - postcss@8.4.33: - resolution: {integrity: sha512-Kkpbhhdjw2qQs2O2DGX+8m5OVqEcbB9HRBvuYM9pgrjEFUg30A9LmXNlTAUj4S9kgtGyrMbTzVjH7E+s5Re2yg==} - engines: {node: ^10 || ^12 || >=14} - - pretty-ms@9.0.0: - resolution: {integrity: sha512-E9e9HJ9R9NasGOgPaPE8VMeiPKAyWR5jcFpNnwIejslIhWqdqOrb2wShBsncMPUb+BcCd2OPYfh7p2W6oemTng==} - engines: {node: '>=18'} - - proxy-from-env@1.1.0: - resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==} - - queue-microtask@1.2.3: - resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} - - react-dom@18.3.1: - resolution: {integrity: sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==} - peerDependencies: - react: ^18.3.1 - - react@18.3.1: - resolution: {integrity: sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==} - engines: {node: '>=0.10.0'} - - readable-stream@3.6.2: - resolution: {integrity: sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==} - engines: {node: '>= 6'} - - require-directory@2.1.1: - resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} - engines: {node: '>=0.10.0'} - - resolve-cwd@3.0.0: - resolution: {integrity: sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==} - engines: {node: '>=8'} - - resolve-from@5.0.0: - resolution: {integrity: sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==} - engines: {node: '>=8'} - - restore-cursor@3.1.0: - resolution: {integrity: sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==} - engines: {node: '>=8'} - - reusify@1.0.4: - resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==} - engines: {iojs: '>=1.0.0', node: '>=0.10.0'} - - rimraf@3.0.2: - resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==} - deprecated: Rimraf versions prior to v4 are no longer supported - hasBin: true - - run-async@3.0.0: - resolution: {integrity: sha512-540WwVDOMxA6dN6We19EcT9sc3hkXPw5mzRNGM3FkdN/vtE9NFvj5lFAPNwUDmJjXidm3v7TC1cTE7t17Ulm1Q==} - engines: {node: '>=0.12.0'} - - run-parallel@1.2.0: - resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} - - rxjs@7.8.1: - resolution: {integrity: sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==} - - safe-buffer@5.2.1: - resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} - - safer-buffer@2.1.2: - resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} - - scheduler@0.23.2: - resolution: {integrity: sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ==} - - semver@6.3.1: - resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} - hasBin: true - - semver@7.6.2: - resolution: {integrity: sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==} - engines: {node: '>=10'} - hasBin: true - - serialize-error@7.0.1: - resolution: {integrity: sha512-8I8TjW5KMOKsZQTvoxjuSIa7foAwPWGOts+6o7sgjz41/qMD9VQHEDxi6PBvK2l0MXUmqZyNpUK+T2tQaaElvw==} - engines: {node: '>=10'} - - set-blocking@2.0.0: - resolution: {integrity: sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==} - - set-function-length@1.2.2: - resolution: {integrity: sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==} - engines: {node: '>= 0.4'} - - shallowequal@1.1.0: - resolution: {integrity: sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ==} - - signal-exit@3.0.7: - resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} - - signal-exit@4.1.0: - resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} - engines: {node: '>=14'} - - slash@5.1.0: - resolution: {integrity: sha512-ZA6oR3T/pEyuqwMgAKT0/hAv8oAXckzbkmR0UkUosQ+Mc4RxGoJkRmwHgHufaenlyAgE1Mxgpdcrf75y6XcnDg==} - engines: {node: '>=14.16'} - - slice-ansi@5.0.0: - resolution: {integrity: sha512-FC+lgizVPfie0kkhqUScwRu1O/lF6NOgJmlCgK+/LYxDCTk8sGelYaHDhFcDN+Sn3Cv+3VSa4Byeo+IMCzpMgQ==} - engines: {node: '>=12'} - - source-map-js@1.2.0: - resolution: {integrity: sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==} - engines: {node: '>=0.10.0'} - - sprintf-js@1.0.3: - resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==} - - stack-utils@2.0.6: - resolution: {integrity: sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==} - engines: {node: '>=10'} - - string-width@4.2.3: - resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} - engines: {node: '>=8'} - - string-width@7.1.0: - resolution: {integrity: sha512-SEIJCWiX7Kg4c129n48aDRwLbFb2LJmXXFrWBG4NGaRtMQ3myKPKbwrD1BKqQn74oCoNMBVrfDEr5M9YxCsrkw==} - engines: {node: '>=18'} - - string_decoder@1.3.0: - resolution: {integrity: sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==} - - strip-ansi@6.0.1: - resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} - engines: {node: '>=8'} - - strip-ansi@7.1.0: - resolution: {integrity: sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==} - engines: {node: '>=12'} - - styled-components@6.1.1: - resolution: {integrity: sha512-cpZZP5RrKRIClBW5Eby4JM1wElLVP4NQrJbJ0h10TidTyJf4SIIwa3zLXOoPb4gJi8MsJ8mjq5mu2IrEhZIAcQ==} - engines: {node: '>= 16'} - peerDependencies: - react: '>= 16.8.0' - react-dom: '>= 16.8.0' - - stylis@4.3.2: - resolution: {integrity: sha512-bhtUjWd/z6ltJiQwg0dUfxEJ+W+jdqQd8TbWLWyeIJHlnsqmGLRFFd8e5mA0AZi/zx90smXRlN66YMTcaSFifg==} - - supertap@3.0.1: - resolution: {integrity: sha512-u1ZpIBCawJnO+0QePsEiOknOfCRq0yERxiAchT0i4li0WHNUJbf0evXXSXOcCAR4M8iMDoajXYmstm/qO81Isw==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - supports-color@7.2.0: - resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} - engines: {node: '>=8'} - - tar@6.2.1: - resolution: {integrity: sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==} - engines: {node: '>=10'} - - temp-dir@3.0.0: - resolution: {integrity: sha512-nHc6S/bwIilKHNRgK/3jlhDoIHcp45YgyiwcAk46Tr0LfEqGBVpmiAyuiuxeVE44m3mXnEeVhaipLOEWmH+Njw==} - engines: {node: '>=14.16'} - - time-zone@1.0.0: - resolution: {integrity: sha512-TIsDdtKo6+XrPtiTm1ssmMngN1sAhyKnTO2kunQWqNPWIVvCm15Wmw4SWInwTVgJ5u/Tr04+8Ei9TNcw4x4ONA==} - engines: {node: '>=4'} - - tmp@0.0.33: - resolution: {integrity: sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==} - engines: {node: '>=0.6.0'} - - to-regex-range@5.0.1: - resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} - engines: {node: '>=8.0'} - - toml@3.0.0: - resolution: {integrity: sha512-y/mWCZinnvxjTKYhJ+pYxwD0mRLVvOtdS2Awbgxln6iEnt4rk0yBxeSBHkGJcPucRiG0e55mwWp+g/05rsrd6w==} - - tr46@0.0.3: - resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==} - - tslib@2.6.3: - resolution: {integrity: sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ==} - - typanion@3.14.0: - resolution: {integrity: sha512-ZW/lVMRabETuYCd9O9ZvMhAh8GslSqaUjxmK/JLPCh6l73CvLBiuXswj/+7LdnWOgYsQ130FqLzFz5aGT4I3Ug==} - - type-fest@0.13.1: - resolution: {integrity: sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==} - engines: {node: '>=10'} - - type-fest@0.21.3: - resolution: {integrity: sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==} - engines: {node: '>=10'} - - typescript@5.4.5: - resolution: {integrity: sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==} - engines: {node: '>=14.17'} - hasBin: true - - undici-types@5.26.5: - resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==} - - unicorn-magic@0.1.0: - resolution: {integrity: sha512-lRfVq8fE8gz6QMBuDM6a+LO3IAzTi05H6gCVaUpir2E1Rwpo4ZUog45KpNXKC/Mn3Yb9UDuHumeFTo9iV/D9FQ==} - engines: {node: '>=18'} - - universal-user-agent@6.0.1: - resolution: {integrity: sha512-yCzhz6FN2wU1NiiQRogkTQszlQSlpWaw8SvVegAc+bDxbzHgh1vX8uIe8OYyMH6DwH+sdTJsgMl36+mSMdRJIQ==} - - util-deprecate@1.0.2: - resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} - - wasm-sjlj@1.0.5: - resolution: {integrity: sha512-Z/MHJeOkAvJJVWnGX3/YZGYldGaawZbYHX4ldYG9kLhcdB8H31F5x66M7Zc4BP/7pg0aLsusQj1629m2B3Rilg==} - - wcwidth@1.0.1: - resolution: {integrity: sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==} - - webidl-conversions@3.0.1: - resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==} - - well-known-symbols@2.0.0: - resolution: {integrity: sha512-ZMjC3ho+KXo0BfJb7JgtQ5IBuvnShdlACNkKkdsqBmYw3bPAaJfPeYUo6tLUaT5tG/Gkh7xkpBhKRQ9e7pyg9Q==} - engines: {node: '>=6'} - - whatwg-url@5.0.0: - resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==} - - wide-align@1.1.5: - resolution: {integrity: sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==} - - wrap-ansi@6.2.0: - resolution: {integrity: sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==} - engines: {node: '>=8'} - - wrap-ansi@7.0.0: - resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==} - engines: {node: '>=10'} - - wrappy@1.0.2: - resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} - - write-file-atomic@5.0.1: - resolution: {integrity: sha512-+QU2zd6OTD8XWIJCbffaiQeH9U73qIqafo1x6V1snCWYGJf6cVE0cDR4D8xRzcEnfI21IFrUPzPGtcPf8AC+Rw==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - - y18n@5.0.8: - resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==} - engines: {node: '>=10'} - - yallist@4.0.0: - resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==} - - yargs-parser@21.1.1: - resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} - engines: {node: '>=12'} - - yargs@17.7.2: - resolution: {integrity: sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==} - engines: {node: '>=12'} - -snapshots: - - '@emnapi/core@1.2.0': - dependencies: - '@emnapi/wasi-threads': 1.0.1 - tslib: 2.6.3 - - '@emnapi/runtime@1.2.0': - dependencies: - tslib: 2.6.3 - - '@emnapi/wasi-threads@1.0.1': - dependencies: - tslib: 2.6.3 - - '@emotion/is-prop-valid@1.2.2': - dependencies: - '@emotion/memoize': 0.8.1 - - '@emotion/memoize@0.8.1': {} - - '@emotion/unitless@0.8.1': {} - - '@inquirer/figures@1.0.3': {} - - '@ljharb/through@2.3.13': - dependencies: - call-bind: 1.0.7 - - '@mapbox/node-pre-gyp@1.0.11': - dependencies: - detect-libc: 2.0.3 - https-proxy-agent: 5.0.1 - make-dir: 3.1.0 - node-fetch: 2.7.0 - nopt: 5.0.0 - npmlog: 5.0.1 - rimraf: 3.0.2 - semver: 7.6.2 - tar: 6.2.1 - transitivePeerDependencies: - - encoding - - supports-color - - '@napi-rs/cli@3.0.0-alpha.55(@emnapi/runtime@1.2.0)(emnapi@1.2.0)': - dependencies: - '@napi-rs/cross-toolchain': 0.0.16 - '@napi-rs/wasm-tools': 0.0.2 - '@octokit/rest': 20.1.1 - clipanion: 3.2.1(typanion@3.14.0) - colorette: 2.0.20 - debug: 4.3.5 - inquirer: 9.2.23 - js-yaml: 4.1.0 - lodash-es: 4.17.21 - semver: 7.6.2 - toml: 3.0.0 - typanion: 3.14.0 - wasm-sjlj: 1.0.5 - optionalDependencies: - '@emnapi/runtime': 1.2.0 - emnapi: 1.2.0 - transitivePeerDependencies: - - '@napi-rs/cross-toolchain-arm64-target-aarch64' - - '@napi-rs/cross-toolchain-arm64-target-armv7' - - '@napi-rs/cross-toolchain-arm64-target-x86_64' - - '@napi-rs/cross-toolchain-x64-target-aarch64' - - '@napi-rs/cross-toolchain-x64-target-armv7' - - '@napi-rs/cross-toolchain-x64-target-x86_64' - - supports-color - - '@napi-rs/cross-toolchain@0.0.16': - dependencies: - '@napi-rs/lzma': 1.3.1 - '@napi-rs/tar': 0.1.1 - debug: 4.3.5 - transitivePeerDependencies: - - supports-color - - '@napi-rs/lzma-android-arm-eabi@1.3.1': - optional: true - - '@napi-rs/lzma-android-arm64@1.3.1': - optional: true - - '@napi-rs/lzma-darwin-arm64@1.3.1': - optional: true - - '@napi-rs/lzma-darwin-x64@1.3.1': - optional: true - - '@napi-rs/lzma-freebsd-x64@1.3.1': - optional: true - - '@napi-rs/lzma-linux-arm-gnueabihf@1.3.1': - optional: true - - '@napi-rs/lzma-linux-arm64-gnu@1.3.1': - optional: true - - '@napi-rs/lzma-linux-arm64-musl@1.3.1': - optional: true - - '@napi-rs/lzma-linux-x64-gnu@1.3.1': - optional: true - - '@napi-rs/lzma-linux-x64-musl@1.3.1': - optional: true - - '@napi-rs/lzma-wasm32-wasi@1.3.1': - dependencies: - '@napi-rs/wasm-runtime': 0.2.4 - optional: true - - '@napi-rs/lzma-win32-arm64-msvc@1.3.1': - optional: true - - '@napi-rs/lzma-win32-ia32-msvc@1.3.1': - optional: true - - '@napi-rs/lzma-win32-x64-msvc@1.3.1': - optional: true - - '@napi-rs/lzma@1.3.1': - optionalDependencies: - '@napi-rs/lzma-android-arm-eabi': 1.3.1 - '@napi-rs/lzma-android-arm64': 1.3.1 - '@napi-rs/lzma-darwin-arm64': 1.3.1 - '@napi-rs/lzma-darwin-x64': 1.3.1 - '@napi-rs/lzma-freebsd-x64': 1.3.1 - '@napi-rs/lzma-linux-arm-gnueabihf': 1.3.1 - '@napi-rs/lzma-linux-arm64-gnu': 1.3.1 - '@napi-rs/lzma-linux-arm64-musl': 1.3.1 - '@napi-rs/lzma-linux-x64-gnu': 1.3.1 - '@napi-rs/lzma-linux-x64-musl': 1.3.1 - '@napi-rs/lzma-wasm32-wasi': 1.3.1 - '@napi-rs/lzma-win32-arm64-msvc': 1.3.1 - '@napi-rs/lzma-win32-ia32-msvc': 1.3.1 - '@napi-rs/lzma-win32-x64-msvc': 1.3.1 - - '@napi-rs/tar-android-arm-eabi@0.1.1': - optional: true - - '@napi-rs/tar-android-arm64@0.1.1': - optional: true - - '@napi-rs/tar-darwin-arm64@0.1.1': - optional: true - - '@napi-rs/tar-darwin-x64@0.1.1': - optional: true - - '@napi-rs/tar-freebsd-x64@0.1.1': - optional: true - - '@napi-rs/tar-linux-arm-gnueabihf@0.1.1': - optional: true - - '@napi-rs/tar-linux-arm64-gnu@0.1.1': - optional: true - - '@napi-rs/tar-linux-arm64-musl@0.1.1': - optional: true - - '@napi-rs/tar-linux-x64-gnu@0.1.1': - optional: true - - '@napi-rs/tar-linux-x64-musl@0.1.1': - optional: true - - '@napi-rs/tar-wasm32-wasi@0.1.1': - dependencies: - '@napi-rs/wasm-runtime': 0.2.4 - optional: true - - '@napi-rs/tar-win32-arm64-msvc@0.1.1': - optional: true - - '@napi-rs/tar-win32-ia32-msvc@0.1.1': - optional: true - - '@napi-rs/tar-win32-x64-msvc@0.1.1': - optional: true - - '@napi-rs/tar@0.1.1': - optionalDependencies: - '@napi-rs/tar-android-arm-eabi': 0.1.1 - '@napi-rs/tar-android-arm64': 0.1.1 - '@napi-rs/tar-darwin-arm64': 0.1.1 - '@napi-rs/tar-darwin-x64': 0.1.1 - '@napi-rs/tar-freebsd-x64': 0.1.1 - '@napi-rs/tar-linux-arm-gnueabihf': 0.1.1 - '@napi-rs/tar-linux-arm64-gnu': 0.1.1 - '@napi-rs/tar-linux-arm64-musl': 0.1.1 - '@napi-rs/tar-linux-x64-gnu': 0.1.1 - '@napi-rs/tar-linux-x64-musl': 0.1.1 - '@napi-rs/tar-wasm32-wasi': 0.1.1 - '@napi-rs/tar-win32-arm64-msvc': 0.1.1 - '@napi-rs/tar-win32-ia32-msvc': 0.1.1 - '@napi-rs/tar-win32-x64-msvc': 0.1.1 - - '@napi-rs/wasm-runtime@0.2.4': - dependencies: - '@emnapi/core': 1.2.0 - '@emnapi/runtime': 1.2.0 - '@tybys/wasm-util': 0.9.0 - - '@napi-rs/wasm-tools-android-arm-eabi@0.0.2': - optional: true - - '@napi-rs/wasm-tools-android-arm64@0.0.2': - optional: true - - '@napi-rs/wasm-tools-darwin-arm64@0.0.2': - optional: true - - '@napi-rs/wasm-tools-darwin-x64@0.0.2': - optional: true - - '@napi-rs/wasm-tools-freebsd-x64@0.0.2': - optional: true - - '@napi-rs/wasm-tools-linux-arm64-gnu@0.0.2': - optional: true - - '@napi-rs/wasm-tools-linux-arm64-musl@0.0.2': - optional: true - - '@napi-rs/wasm-tools-linux-x64-gnu@0.0.2': - optional: true - - '@napi-rs/wasm-tools-linux-x64-musl@0.0.2': - optional: true - - '@napi-rs/wasm-tools-wasm32-wasi@0.0.2': - dependencies: - '@napi-rs/wasm-runtime': 0.2.4 - optional: true - - '@napi-rs/wasm-tools-win32-arm64-msvc@0.0.2': - optional: true - - '@napi-rs/wasm-tools-win32-ia32-msvc@0.0.2': - optional: true - - '@napi-rs/wasm-tools-win32-x64-msvc@0.0.2': - optional: true - - '@napi-rs/wasm-tools@0.0.2': - optionalDependencies: - '@napi-rs/wasm-tools-android-arm-eabi': 0.0.2 - '@napi-rs/wasm-tools-android-arm64': 0.0.2 - '@napi-rs/wasm-tools-darwin-arm64': 0.0.2 - '@napi-rs/wasm-tools-darwin-x64': 0.0.2 - '@napi-rs/wasm-tools-freebsd-x64': 0.0.2 - '@napi-rs/wasm-tools-linux-arm64-gnu': 0.0.2 - '@napi-rs/wasm-tools-linux-arm64-musl': 0.0.2 - '@napi-rs/wasm-tools-linux-x64-gnu': 0.0.2 - '@napi-rs/wasm-tools-linux-x64-musl': 0.0.2 - '@napi-rs/wasm-tools-wasm32-wasi': 0.0.2 - '@napi-rs/wasm-tools-win32-arm64-msvc': 0.0.2 - '@napi-rs/wasm-tools-win32-ia32-msvc': 0.0.2 - '@napi-rs/wasm-tools-win32-x64-msvc': 0.0.2 - - '@nodelib/fs.scandir@2.1.5': - dependencies: - '@nodelib/fs.stat': 2.0.5 - run-parallel: 1.2.0 - - '@nodelib/fs.stat@2.0.5': {} - - '@nodelib/fs.walk@1.2.8': - dependencies: - '@nodelib/fs.scandir': 2.1.5 - fastq: 1.17.1 - - '@octokit/auth-token@4.0.0': {} - - '@octokit/core@5.2.0': - dependencies: - '@octokit/auth-token': 4.0.0 - '@octokit/graphql': 7.1.0 - '@octokit/request': 8.4.0 - '@octokit/request-error': 5.1.0 - '@octokit/types': 13.5.0 - before-after-hook: 2.2.3 - universal-user-agent: 6.0.1 - - '@octokit/endpoint@9.0.5': - dependencies: - '@octokit/types': 13.5.0 - universal-user-agent: 6.0.1 - - '@octokit/graphql@7.1.0': - dependencies: - '@octokit/request': 8.4.0 - '@octokit/types': 13.5.0 - universal-user-agent: 6.0.1 - - '@octokit/openapi-types@22.2.0': {} - - '@octokit/plugin-paginate-rest@11.3.1(@octokit/core@5.2.0)': - dependencies: - '@octokit/core': 5.2.0 - '@octokit/types': 13.5.0 - - '@octokit/plugin-request-log@4.0.1(@octokit/core@5.2.0)': - dependencies: - '@octokit/core': 5.2.0 - - '@octokit/plugin-rest-endpoint-methods@13.2.2(@octokit/core@5.2.0)': - dependencies: - '@octokit/core': 5.2.0 - '@octokit/types': 13.5.0 - - '@octokit/request-error@5.1.0': - dependencies: - '@octokit/types': 13.5.0 - deprecation: 2.3.1 - once: 1.4.0 - - '@octokit/request@8.4.0': - dependencies: - '@octokit/endpoint': 9.0.5 - '@octokit/request-error': 5.1.0 - '@octokit/types': 13.5.0 - universal-user-agent: 6.0.1 - - '@octokit/rest@20.1.1': - dependencies: - '@octokit/core': 5.2.0 - '@octokit/plugin-paginate-rest': 11.3.1(@octokit/core@5.2.0) - '@octokit/plugin-request-log': 4.0.1(@octokit/core@5.2.0) - '@octokit/plugin-rest-endpoint-methods': 13.2.2(@octokit/core@5.2.0) - - '@octokit/types@13.5.0': - dependencies: - '@octokit/openapi-types': 22.2.0 - - '@rollup/pluginutils@4.2.1': - dependencies: - estree-walker: 2.0.2 - picomatch: 2.3.1 - - '@sindresorhus/merge-streams@2.3.0': {} - - '@tybys/wasm-util@0.9.0': - dependencies: - tslib: 2.6.3 - - '@types/node@20.14.2': - dependencies: - undici-types: 5.26.5 - - '@types/stylis@4.2.6': {} - - '@vercel/nft@0.26.5': - dependencies: - '@mapbox/node-pre-gyp': 1.0.11 - '@rollup/pluginutils': 4.2.1 - acorn: 8.12.0 - acorn-import-attributes: 1.9.5(acorn@8.12.0) - async-sema: 3.1.1 - bindings: 1.5.0 - estree-walker: 2.0.2 - glob: 7.2.3 - graceful-fs: 4.2.11 - micromatch: 4.0.7 - node-gyp-build: 4.8.1 - resolve-from: 5.0.0 - transitivePeerDependencies: - - encoding - - supports-color - - abbrev@1.1.1: {} - - acorn-import-attributes@1.9.5(acorn@8.12.0): - dependencies: - acorn: 8.12.0 - - acorn-walk@8.3.3: - dependencies: - acorn: 8.12.0 - - acorn@8.12.0: {} - - agent-base@6.0.2: - dependencies: - debug: 4.3.5 - transitivePeerDependencies: - - supports-color - - ansi-escapes@4.3.2: - dependencies: - type-fest: 0.21.3 - - ansi-regex@5.0.1: {} - - ansi-regex@6.0.1: {} - - ansi-styles@4.3.0: - dependencies: - color-convert: 2.0.1 - - ansi-styles@6.2.1: {} - - aproba@2.0.0: {} - - are-we-there-yet@2.0.0: - dependencies: - delegates: 1.0.0 - readable-stream: 3.6.2 - - argparse@1.0.10: - dependencies: - sprintf-js: 1.0.3 - - argparse@2.0.1: {} - - array-find-index@1.0.2: {} - - arrgv@1.0.2: {} - - arrify@3.0.0: {} - - async-sema@3.1.1: {} - - asynckit@0.4.0: {} - - ava@6.1.3: - dependencies: - '@vercel/nft': 0.26.5 - acorn: 8.12.0 - acorn-walk: 8.3.3 - ansi-styles: 6.2.1 - arrgv: 1.0.2 - arrify: 3.0.0 - callsites: 4.1.0 - cbor: 9.0.2 - chalk: 5.3.0 - chunkd: 2.0.1 - ci-info: 4.0.0 - ci-parallel-vars: 1.0.1 - cli-truncate: 4.0.0 - code-excerpt: 4.0.0 - common-path-prefix: 3.0.0 - concordance: 5.0.4 - currently-unhandled: 0.4.1 - debug: 4.3.5 - emittery: 1.0.3 - figures: 6.1.0 - globby: 14.0.1 - ignore-by-default: 2.1.0 - indent-string: 5.0.0 - is-plain-object: 5.0.0 - is-promise: 4.0.0 - matcher: 5.0.0 - memoize: 10.0.0 - ms: 2.1.3 - p-map: 7.0.2 - package-config: 5.0.0 - picomatch: 3.0.1 - plur: 5.1.0 - pretty-ms: 9.0.0 - resolve-cwd: 3.0.0 - stack-utils: 2.0.6 - strip-ansi: 7.1.0 - supertap: 3.0.1 - temp-dir: 3.0.0 - write-file-atomic: 5.0.1 - yargs: 17.7.2 - transitivePeerDependencies: - - encoding - - supports-color - - axios@1.6.2: - dependencies: - follow-redirects: 1.15.6 - form-data: 4.0.0 - proxy-from-env: 1.1.0 - transitivePeerDependencies: - - debug - - balanced-match@1.0.2: {} - - base64-js@1.5.1: {} - - before-after-hook@2.2.3: {} - - bindings@1.5.0: - dependencies: - file-uri-to-path: 1.0.0 - - bl@4.1.0: - dependencies: - buffer: 5.7.1 - inherits: 2.0.4 - readable-stream: 3.6.2 - - blueimp-md5@2.19.0: {} - - brace-expansion@1.1.11: - dependencies: - balanced-match: 1.0.2 - concat-map: 0.0.1 - - braces@3.0.3: - dependencies: - fill-range: 7.1.1 - - buffer@5.7.1: - dependencies: - base64-js: 1.5.1 - ieee754: 1.2.1 - - call-bind@1.0.7: - dependencies: - es-define-property: 1.0.0 - es-errors: 1.3.0 - function-bind: 1.1.2 - get-intrinsic: 1.2.4 - set-function-length: 1.2.2 - - callsites@4.1.0: {} - - camelize@1.0.1: {} - - cbor@9.0.2: - dependencies: - nofilter: 3.1.0 - - chalk@4.1.2: - dependencies: - ansi-styles: 4.3.0 - supports-color: 7.2.0 - - chalk@5.3.0: {} - - chardet@0.7.0: {} - - chownr@2.0.0: {} - - chunkd@2.0.1: {} - - ci-info@4.0.0: {} - - ci-parallel-vars@1.0.1: {} - - cli-cursor@3.1.0: - dependencies: - restore-cursor: 3.1.0 - - cli-spinners@2.9.2: {} - - cli-truncate@4.0.0: - dependencies: - slice-ansi: 5.0.0 - string-width: 7.1.0 - - cli-width@4.1.0: {} - - clipanion@3.2.1(typanion@3.14.0): - dependencies: - typanion: 3.14.0 - - cliui@8.0.1: - dependencies: - string-width: 4.2.3 - strip-ansi: 6.0.1 - wrap-ansi: 7.0.0 - - clone@1.0.4: {} - - code-excerpt@4.0.0: - dependencies: - convert-to-spaces: 2.0.1 - - color-convert@2.0.1: - dependencies: - color-name: 1.1.4 - - color-name@1.1.4: {} - - color-support@1.1.3: {} - - colorette@2.0.20: {} - - combined-stream@1.0.8: - dependencies: - delayed-stream: 1.0.0 - - common-path-prefix@3.0.0: {} - - concat-map@0.0.1: {} - - concordance@5.0.4: - dependencies: - date-time: 3.1.0 - esutils: 2.0.3 - fast-diff: 1.3.0 - js-string-escape: 1.0.1 - lodash: 4.17.21 - md5-hex: 3.0.1 - semver: 7.6.2 - well-known-symbols: 2.0.0 - - console-control-strings@1.1.0: {} - - convert-to-spaces@2.0.1: {} - - css-color-keywords@1.0.0: {} - - css-to-react-native@3.2.0: - dependencies: - camelize: 1.0.1 - css-color-keywords: 1.0.0 - postcss-value-parser: 4.2.0 - - csstype@3.1.3: {} - - currently-unhandled@0.4.1: - dependencies: - array-find-index: 1.0.2 - - date-time@3.1.0: - dependencies: - time-zone: 1.0.0 - - debug@4.3.5: - dependencies: - ms: 2.1.2 - - defaults@1.0.4: - dependencies: - clone: 1.0.4 - - define-data-property@1.1.4: - dependencies: - es-define-property: 1.0.0 - es-errors: 1.3.0 - gopd: 1.0.1 - - delayed-stream@1.0.0: {} - - delegates@1.0.0: {} - - deprecation@2.3.1: {} - - detect-libc@2.0.3: {} - - emittery@1.0.3: {} - - emnapi@1.2.0: {} - - emoji-regex@10.3.0: {} - - emoji-regex@8.0.0: {} - - es-define-property@1.0.0: - dependencies: - get-intrinsic: 1.2.4 - - es-errors@1.3.0: {} - - escalade@3.1.2: {} - - escape-string-regexp@2.0.0: {} - - escape-string-regexp@5.0.0: {} - - esprima@4.0.1: {} - - estree-walker@2.0.2: {} - - esutils@2.0.3: {} - - external-editor@3.1.0: - dependencies: - chardet: 0.7.0 - iconv-lite: 0.4.24 - tmp: 0.0.33 - - fast-diff@1.3.0: {} - - fast-glob@3.3.2: - dependencies: - '@nodelib/fs.stat': 2.0.5 - '@nodelib/fs.walk': 1.2.8 - glob-parent: 5.1.2 - merge2: 1.4.1 - micromatch: 4.0.7 - - fastq@1.17.1: - dependencies: - reusify: 1.0.4 - - figures@6.1.0: - dependencies: - is-unicode-supported: 2.0.0 - - file-uri-to-path@1.0.0: {} - - fill-range@7.1.1: - dependencies: - to-regex-range: 5.0.1 - - find-up-simple@1.0.0: {} - - follow-redirects@1.15.6: {} - - form-data@4.0.0: - dependencies: - asynckit: 0.4.0 - combined-stream: 1.0.8 - mime-types: 2.1.35 - - fs-minipass@2.1.0: - dependencies: - minipass: 3.3.6 - - fs.realpath@1.0.0: {} - - function-bind@1.1.2: {} - - gauge@3.0.2: - dependencies: - aproba: 2.0.0 - color-support: 1.1.3 - console-control-strings: 1.1.0 - has-unicode: 2.0.1 - object-assign: 4.1.1 - signal-exit: 3.0.7 - string-width: 4.2.3 - strip-ansi: 6.0.1 - wide-align: 1.1.5 - - get-caller-file@2.0.5: {} - - get-east-asian-width@1.2.0: {} - - get-intrinsic@1.2.4: - dependencies: - es-errors: 1.3.0 - function-bind: 1.1.2 - has-proto: 1.0.3 - has-symbols: 1.0.3 - hasown: 2.0.2 - - glob-parent@5.1.2: - dependencies: - is-glob: 4.0.3 - - glob@7.2.3: - dependencies: - fs.realpath: 1.0.0 - inflight: 1.0.6 - inherits: 2.0.4 - minimatch: 3.1.2 - once: 1.4.0 - path-is-absolute: 1.0.1 - - globby@14.0.1: - dependencies: - '@sindresorhus/merge-streams': 2.3.0 - fast-glob: 3.3.2 - ignore: 5.3.1 - path-type: 5.0.0 - slash: 5.1.0 - unicorn-magic: 0.1.0 - - gopd@1.0.1: - dependencies: - get-intrinsic: 1.2.4 - - graceful-fs@4.2.11: {} - - has-flag@4.0.0: {} - - has-property-descriptors@1.0.2: - dependencies: - es-define-property: 1.0.0 - - has-proto@1.0.3: {} - - has-symbols@1.0.3: {} - - has-unicode@2.0.1: {} - - hasown@2.0.2: - dependencies: - function-bind: 1.1.2 - - https-proxy-agent@5.0.1: - dependencies: - agent-base: 6.0.2 - debug: 4.3.5 - transitivePeerDependencies: - - supports-color - - iconv-lite@0.4.24: - dependencies: - safer-buffer: 2.1.2 - - ieee754@1.2.1: {} - - ignore-by-default@2.1.0: {} - - ignore@5.3.1: {} - - imurmurhash@0.1.4: {} - - indent-string@5.0.0: {} - - inflight@1.0.6: - dependencies: - once: 1.4.0 - wrappy: 1.0.2 - - inherits@2.0.4: {} - - inquirer@9.2.23: - dependencies: - '@inquirer/figures': 1.0.3 - '@ljharb/through': 2.3.13 - ansi-escapes: 4.3.2 - chalk: 5.3.0 - cli-cursor: 3.1.0 - cli-width: 4.1.0 - external-editor: 3.1.0 - lodash: 4.17.21 - mute-stream: 1.0.0 - ora: 5.4.1 - run-async: 3.0.0 - rxjs: 7.8.1 - string-width: 4.2.3 - strip-ansi: 6.0.1 - wrap-ansi: 6.2.0 - - irregular-plurals@3.5.0: {} - - is-extglob@2.1.1: {} - - is-fullwidth-code-point@3.0.0: {} - - is-fullwidth-code-point@4.0.0: {} - - is-glob@4.0.3: - dependencies: - is-extglob: 2.1.1 - - is-interactive@1.0.0: {} - - is-number@7.0.0: {} - - is-plain-object@5.0.0: {} - - is-promise@4.0.0: {} - - is-unicode-supported@0.1.0: {} - - is-unicode-supported@2.0.0: {} - - js-string-escape@1.0.1: {} - - js-tokens@4.0.0: {} - - js-yaml@3.14.1: - dependencies: - argparse: 1.0.10 - esprima: 4.0.1 - - js-yaml@4.1.0: - dependencies: - argparse: 2.0.1 - - load-json-file@7.0.1: {} - - lodash-es@4.17.21: {} - - lodash@4.17.21: {} - - log-symbols@4.1.0: - dependencies: - chalk: 4.1.2 - is-unicode-supported: 0.1.0 - - loose-envify@1.4.0: - dependencies: - js-tokens: 4.0.0 - - make-dir@3.1.0: - dependencies: - semver: 6.3.1 - - matcher@5.0.0: - dependencies: - escape-string-regexp: 5.0.0 - - md5-hex@3.0.1: - dependencies: - blueimp-md5: 2.19.0 - - memoize@10.0.0: - dependencies: - mimic-function: 5.0.1 - - merge2@1.4.1: {} - - micromatch@4.0.7: - dependencies: - braces: 3.0.3 - picomatch: 2.3.1 - - mime-db@1.52.0: {} - - mime-types@2.1.35: - dependencies: - mime-db: 1.52.0 - - mimic-fn@2.1.0: {} - - mimic-function@5.0.1: {} - - minimatch@3.1.2: - dependencies: - brace-expansion: 1.1.11 - - minipass@3.3.6: - dependencies: - yallist: 4.0.0 - - minipass@5.0.0: {} - - minizlib@2.1.2: - dependencies: - minipass: 3.3.6 - yallist: 4.0.0 - - mkdirp@1.0.4: {} - - ms@2.1.2: {} - - ms@2.1.3: {} - - mute-stream@1.0.0: {} - - nanoid@3.3.7: {} - - node-fetch@2.7.0: - dependencies: - whatwg-url: 5.0.0 - - node-gyp-build@4.8.1: {} - - nofilter@3.1.0: {} - - nopt@5.0.0: - dependencies: - abbrev: 1.1.1 - - npmlog@5.0.1: - dependencies: - are-we-there-yet: 2.0.0 - console-control-strings: 1.1.0 - gauge: 3.0.2 - set-blocking: 2.0.0 - - object-assign@4.1.1: {} - - once@1.4.0: - dependencies: - wrappy: 1.0.2 - - onetime@5.1.2: - dependencies: - mimic-fn: 2.1.0 - - ora@5.4.1: - dependencies: - bl: 4.1.0 - chalk: 4.1.2 - cli-cursor: 3.1.0 - cli-spinners: 2.9.2 - is-interactive: 1.0.0 - is-unicode-supported: 0.1.0 - log-symbols: 4.1.0 - strip-ansi: 6.0.1 - wcwidth: 1.0.1 - - os-tmpdir@1.0.2: {} - - p-map@7.0.2: {} - - package-config@5.0.0: - dependencies: - find-up-simple: 1.0.0 - load-json-file: 7.0.1 - - parse-ms@4.0.0: {} - - path-is-absolute@1.0.1: {} - - path-type@5.0.0: {} - - picocolors@1.0.1: {} - - picomatch@2.3.1: {} - - picomatch@3.0.1: {} - - plur@5.1.0: - dependencies: - irregular-plurals: 3.5.0 - - postcss-value-parser@4.2.0: {} - - postcss@8.4.33: - dependencies: - nanoid: 3.3.7 - picocolors: 1.0.1 - source-map-js: 1.2.0 - - pretty-ms@9.0.0: - dependencies: - parse-ms: 4.0.0 - - proxy-from-env@1.1.0: {} - - queue-microtask@1.2.3: {} - - react-dom@18.3.1(react@18.3.1): - dependencies: - loose-envify: 1.4.0 - react: 18.3.1 - scheduler: 0.23.2 - - react@18.3.1: - dependencies: - loose-envify: 1.4.0 - - readable-stream@3.6.2: - dependencies: - inherits: 2.0.4 - string_decoder: 1.3.0 - util-deprecate: 1.0.2 - - require-directory@2.1.1: {} - - resolve-cwd@3.0.0: - dependencies: - resolve-from: 5.0.0 - - resolve-from@5.0.0: {} - - restore-cursor@3.1.0: - dependencies: - onetime: 5.1.2 - signal-exit: 3.0.7 - - reusify@1.0.4: {} - - rimraf@3.0.2: - dependencies: - glob: 7.2.3 - - run-async@3.0.0: {} - - run-parallel@1.2.0: - dependencies: - queue-microtask: 1.2.3 - - rxjs@7.8.1: - dependencies: - tslib: 2.6.3 - - safe-buffer@5.2.1: {} - - safer-buffer@2.1.2: {} - - scheduler@0.23.2: - dependencies: - loose-envify: 1.4.0 - - semver@6.3.1: {} - - semver@7.6.2: {} - - serialize-error@7.0.1: - dependencies: - type-fest: 0.13.1 - - set-blocking@2.0.0: {} - - set-function-length@1.2.2: - 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 - - shallowequal@1.1.0: {} - - signal-exit@3.0.7: {} - - signal-exit@4.1.0: {} - - slash@5.1.0: {} - - slice-ansi@5.0.0: - dependencies: - ansi-styles: 6.2.1 - is-fullwidth-code-point: 4.0.0 - - source-map-js@1.2.0: {} - - sprintf-js@1.0.3: {} - - stack-utils@2.0.6: - dependencies: - escape-string-regexp: 2.0.0 - - string-width@4.2.3: - dependencies: - emoji-regex: 8.0.0 - is-fullwidth-code-point: 3.0.0 - strip-ansi: 6.0.1 - - string-width@7.1.0: - dependencies: - emoji-regex: 10.3.0 - get-east-asian-width: 1.2.0 - strip-ansi: 7.1.0 - - string_decoder@1.3.0: - dependencies: - safe-buffer: 5.2.1 - - strip-ansi@6.0.1: - dependencies: - ansi-regex: 5.0.1 - - strip-ansi@7.1.0: - dependencies: - ansi-regex: 6.0.1 - - styled-components@6.1.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1): - dependencies: - '@emotion/is-prop-valid': 1.2.2 - '@emotion/unitless': 0.8.1 - '@types/stylis': 4.2.6 - css-to-react-native: 3.2.0 - csstype: 3.1.3 - postcss: 8.4.33 - react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) - shallowequal: 1.1.0 - stylis: 4.3.2 - tslib: 2.6.3 - - stylis@4.3.2: {} - - supertap@3.0.1: - dependencies: - indent-string: 5.0.0 - js-yaml: 3.14.1 - serialize-error: 7.0.1 - strip-ansi: 7.1.0 - - supports-color@7.2.0: - dependencies: - has-flag: 4.0.0 - - tar@6.2.1: - dependencies: - chownr: 2.0.0 - fs-minipass: 2.1.0 - minipass: 5.0.0 - minizlib: 2.1.2 - mkdirp: 1.0.4 - yallist: 4.0.0 - - temp-dir@3.0.0: {} - - time-zone@1.0.0: {} - - tmp@0.0.33: - dependencies: - os-tmpdir: 1.0.2 - - to-regex-range@5.0.1: - dependencies: - is-number: 7.0.0 - - toml@3.0.0: {} - - tr46@0.0.3: {} - - tslib@2.6.3: {} - - typanion@3.14.0: {} - - type-fest@0.13.1: {} - - type-fest@0.21.3: {} - - typescript@5.4.5: {} - - undici-types@5.26.5: {} - - unicorn-magic@0.1.0: {} - - universal-user-agent@6.0.1: {} - - util-deprecate@1.0.2: {} - - wasm-sjlj@1.0.5: {} - - wcwidth@1.0.1: - dependencies: - defaults: 1.0.4 - - webidl-conversions@3.0.1: {} - - well-known-symbols@2.0.0: {} - - whatwg-url@5.0.0: - dependencies: - tr46: 0.0.3 - webidl-conversions: 3.0.1 - - wide-align@1.1.5: - dependencies: - string-width: 4.2.3 - - wrap-ansi@6.2.0: - dependencies: - ansi-styles: 4.3.0 - string-width: 4.2.3 - strip-ansi: 6.0.1 - - wrap-ansi@7.0.0: - dependencies: - ansi-styles: 4.3.0 - string-width: 4.2.3 - strip-ansi: 6.0.1 - - wrappy@1.0.2: {} - - write-file-atomic@5.0.1: - dependencies: - imurmurhash: 0.1.4 - signal-exit: 4.1.0 - - y18n@5.0.8: {} - - yallist@4.0.0: {} - - yargs-parser@21.1.1: {} - - yargs@17.7.2: - dependencies: - cliui: 8.0.1 - escalade: 3.1.2 - get-caller-file: 2.0.5 - require-directory: 2.1.1 - string-width: 4.2.3 - y18n: 5.0.8 - yargs-parser: 21.1.1 diff --git a/src/builtins.rs b/src/builtins.rs deleted file mode 100644 index 45a25117..00000000 --- a/src/builtins.rs +++ /dev/null @@ -1,71 +0,0 @@ -/// Node.js built-in modules -/// -/// `node -p "[...require('module').builtinModules].map(b => JSON.stringify(b)).join(',\n')"` -/// -pub const NODEJS_BUILTINS: &[&str] = &[ - "_http_agent", - "_http_client", - "_http_common", - "_http_incoming", - "_http_outgoing", - "_http_server", - "_stream_duplex", - "_stream_passthrough", - "_stream_readable", - "_stream_transform", - "_stream_wrap", - "_stream_writable", - "_tls_common", - "_tls_wrap", - "assert", - "assert/strict", - "async_hooks", - "buffer", - "child_process", - "cluster", - "console", - "constants", - "crypto", - "dgram", - "diagnostics_channel", - "dns", - "dns/promises", - "domain", - "events", - "fs", - "fs/promises", - "http", - "http2", - "https", - "inspector", - "module", - "net", - "os", - "path", - "path/posix", - "path/win32", - "perf_hooks", - "process", - "punycode", - "querystring", - "readline", - "repl", - "stream", - "stream/consumers", - "stream/promises", - "stream/web", - "string_decoder", - "sys", - "timers", - "timers/promises", - "tls", - "trace_events", - "tty", - "url", - "util", - "util/types", - "v8", - "vm", - "worker_threads", - "zlib", -]; diff --git a/src/cache.rs b/src/cache.rs deleted file mode 100644 index a1bde36c..00000000 --- a/src/cache.rs +++ /dev/null @@ -1,369 +0,0 @@ -use once_cell::sync::OnceCell as OnceLock; -use std::{ - borrow::{Borrow, Cow}, - convert::AsRef, - hash::{BuildHasherDefault, Hash, Hasher}, - io, - ops::Deref, - path::{Path, PathBuf}, - sync::Arc, -}; - -use dashmap::{DashMap, DashSet}; -use rustc_hash::FxHasher; - -use crate::{ - context::ResolveContext as Ctx, package_json::PackageJson, path::PathUtil, FileMetadata, - FileSystem, ResolveError, ResolveOptions, TsConfig, -}; - -#[derive(Default)] -pub struct Cache { - pub(crate) fs: Fs, - paths: DashSet>, - tsconfigs: DashMap, BuildHasherDefault>, -} - -impl Cache { - pub fn new(fs: Fs) -> Self { - Self { fs, paths: DashSet::default(), tsconfigs: DashMap::default() } - } - - pub fn clear(&self) { - self.paths.clear(); - self.tsconfigs.clear(); - } - - pub fn value(&self, path: &Path) -> CachedPath { - let hash = { - let mut hasher = FxHasher::default(); - path.hash(&mut hasher); - hasher.finish() - }; - if let Some(cache_entry) = self.paths.get((hash, path).borrow() as &dyn CacheKey) { - return cache_entry.clone(); - } - let parent = path.parent().map(|p| self.value(p)); - let data = CachedPath(Arc::new(CachedPathImpl::new( - hash, - path.to_path_buf().into_boxed_path(), - parent, - ))); - self.paths.insert(data.clone()); - data - } - - pub fn tsconfig Result<(), ResolveError>>( - &self, - root: bool, - path: &Path, - callback: F, // callback for modifying tsconfig with `extends` - ) -> Result, ResolveError> { - if let Some(tsconfig_ref) = self.tsconfigs.get(path) { - return Ok(Arc::clone(tsconfig_ref.value())); - } - let meta = self.fs.metadata(path).ok(); - let tsconfig_path = if meta.is_some_and(|m| m.is_file) { - Cow::Borrowed(path) - } else if meta.is_some_and(|m| m.is_dir) { - Cow::Owned(path.join("tsconfig.json")) - } else { - let mut os_string = path.to_path_buf().into_os_string(); - os_string.push(".json"); - Cow::Owned(PathBuf::from(os_string)) - }; - let mut tsconfig_string = self - .fs - .read_to_string(&tsconfig_path) - .map_err(|_| ResolveError::TsconfigNotFound(path.to_path_buf()))?; - let mut tsconfig = - TsConfig::parse(root, &tsconfig_path, &mut tsconfig_string).map_err(|error| { - ResolveError::from_serde_json_error(tsconfig_path.to_path_buf(), &error) - })?; - callback(&mut tsconfig)?; - let tsconfig = Arc::new(tsconfig.build()); - self.tsconfigs.insert(path.to_path_buf(), Arc::clone(&tsconfig)); - Ok(tsconfig) - } -} - -#[derive(Clone)] -pub struct CachedPath(Arc); - -impl Hash for CachedPath { - fn hash(&self, state: &mut H) { - self.0.hash.hash(state); - } -} - -impl PartialEq for CachedPath { - fn eq(&self, other: &Self) -> bool { - self.0.path == other.0.path - } -} -impl Eq for CachedPath {} - -impl Deref for CachedPath { - type Target = CachedPathImpl; - - fn deref(&self) -> &Self::Target { - self.0.as_ref() - } -} - -impl<'a> Borrow for CachedPath { - fn borrow(&self) -> &(dyn CacheKey + 'a) { - self - } -} - -impl AsRef for CachedPath { - fn as_ref(&self) -> &CachedPathImpl { - self.0.as_ref() - } -} - -impl CacheKey for CachedPath { - fn tuple(&self) -> (u64, &Path) { - (self.hash, &self.path) - } -} - -pub struct CachedPathImpl { - hash: u64, - path: Box, - parent: Option, - meta: OnceLock>, - symlink: OnceLock>, - canonicalized: OnceLock>, - node_modules: OnceLock>, - package_json: OnceLock>>, -} - -impl CachedPathImpl { - fn new(hash: u64, path: Box, parent: Option) -> Self { - Self { - hash, - path, - parent, - meta: OnceLock::new(), - symlink: OnceLock::new(), - canonicalized: OnceLock::new(), - node_modules: OnceLock::new(), - package_json: OnceLock::new(), - } - } - - pub fn path(&self) -> &Path { - &self.path - } - - pub fn to_path_buf(&self) -> PathBuf { - self.path.to_path_buf() - } - - pub fn parent(&self) -> Option<&CachedPath> { - self.parent.as_ref() - } - - fn meta(&self, fs: &Fs) -> Option { - *self.meta.get_or_init(|| fs.metadata(&self.path).ok()) - } - - pub fn is_file(&self, fs: &Fs, ctx: &mut Ctx) -> bool { - if let Some(meta) = self.meta(fs) { - ctx.add_file_dependency(self.path()); - meta.is_file - } else { - ctx.add_missing_dependency(self.path()); - false - } - } - - pub fn is_dir(&self, fs: &Fs, ctx: &mut Ctx) -> bool { - self.meta(fs).map_or_else( - || { - ctx.add_missing_dependency(self.path()); - false - }, - |meta| meta.is_dir, - ) - } - - fn symlink(&self, fs: &Fs) -> io::Result> { - self.symlink - .get_or_try_init(|| { - if let Ok(symlink_metadata) = fs.symlink_metadata(&self.path) { - if symlink_metadata.is_symlink { - return fs.canonicalize(self.path()).map(Some); - } - } - Ok(None) - }) - .cloned() - } - - pub fn realpath(&self, fs: &Fs) -> io::Result { - self.canonicalized - .get_or_try_init(|| { - if let Some(link) = self.symlink(fs)? { - return Ok(Some(link)); - } - if let Some(parent) = self.parent() { - let parent_path = parent.realpath(fs)?; - return Ok(Some( - parent_path.normalize_with(self.path.strip_prefix(&parent.path).unwrap()), - )); - }; - Ok(None) - }) - .cloned() - .map(|r| r.unwrap_or_else(|| self.path.clone().to_path_buf())) - } - - pub fn module_directory( - &self, - module_name: &str, - cache: &Cache, - ctx: &mut Ctx, - ) -> Option { - let cached_path = cache.value(&self.path.join(module_name)); - cached_path.is_dir(&cache.fs, ctx).then_some(cached_path) - } - - pub fn cached_node_modules( - &self, - cache: &Cache, - ctx: &mut Ctx, - ) -> Option { - self.node_modules.get_or_init(|| self.module_directory("node_modules", cache, ctx)).clone() - } - - /// Find package.json of a path by traversing parent directories. - /// - /// # Errors - /// - /// * [ResolveError::JSON] - pub fn find_package_json( - &self, - fs: &Fs, - options: &ResolveOptions, - ctx: &mut Ctx, - ) -> Result>, ResolveError> { - let mut cache_value = self; - // Go up directories when the querying path is not a directory - while !cache_value.is_dir(fs, ctx) { - if let Some(cv) = &cache_value.parent { - cache_value = cv.as_ref(); - } else { - break; - } - } - let mut cache_value = Some(cache_value); - while let Some(cv) = cache_value { - if let Some(package_json) = cv.package_json(fs, options, ctx)? { - return Ok(Some(Arc::clone(&package_json))); - } - cache_value = cv.parent.as_deref(); - } - Ok(None) - } - - /// Get package.json of the given path. - /// - /// # Errors - /// - /// * [ResolveError::JSON] - pub fn package_json( - &self, - fs: &Fs, - options: &ResolveOptions, - ctx: &mut Ctx, - ) -> Result>, ResolveError> { - // Change to `std::sync::OnceLock::get_or_try_init` when it is stable. - let result = self - .package_json - .get_or_try_init(|| { - let package_json_path = self.path.join("package.json"); - let Ok(package_json_string) = fs.read_to_string(&package_json_path) else { - return Ok(None); - }; - let real_path = if options.symlinks { - self.realpath(fs)?.join("package.json") - } else { - package_json_path.clone() - }; - PackageJson::parse(package_json_path.clone(), real_path, &package_json_string) - .map(Arc::new) - .map(Some) - .map_err(|error| ResolveError::from_serde_json_error(package_json_path, &error)) - }) - .cloned(); - // https://github.com/webpack/enhanced-resolve/blob/58464fc7cb56673c9aa849e68e6300239601e615/lib/DescriptionFileUtils.js#L68-L82 - match &result { - Ok(Some(package_json)) => { - ctx.add_file_dependency(&package_json.path); - } - Ok(None) => { - // Avoid an allocation by making this lazy - if let Some(deps) = &mut ctx.missing_dependencies { - deps.push(self.path.join("package.json")); - } - } - Err(_) => { - if let Some(deps) = &mut ctx.file_dependencies { - deps.push(self.path.join("package.json")); - } - } - } - result - } -} - -/// Memoized cache key, code adapted from . -trait CacheKey { - fn tuple(&self) -> (u64, &Path); -} - -impl Hash for dyn CacheKey + '_ { - fn hash(&self, state: &mut H) { - self.tuple().0.hash(state); - } -} - -impl PartialEq for dyn CacheKey + '_ { - fn eq(&self, other: &Self) -> bool { - self.tuple().1 == other.tuple().1 - } -} - -impl Eq for dyn CacheKey + '_ {} - -impl<'a> CacheKey for (u64, &'a Path) { - fn tuple(&self) -> (u64, &Path) { - (self.0, self.1) - } -} - -impl<'a> Borrow for (u64, &'a Path) { - fn borrow(&self) -> &(dyn CacheKey + 'a) { - self - } -} - -/// Since the cache key is memoized, use an identity hasher -/// to avoid double cache. -#[derive(Default)] -struct IdentityHasher(u64); - -impl Hasher for IdentityHasher { - fn write(&mut self, _: &[u8]) { - unreachable!("Invalid use of IdentityHasher") - } - fn write_u64(&mut self, n: u64) { - self.0 = n; - } - fn finish(&self) -> u64 { - self.0 - } -} diff --git a/src/context.rs b/src/context.rs deleted file mode 100644 index 9349de30..00000000 --- a/src/context.rs +++ /dev/null @@ -1,89 +0,0 @@ -use std::{ - ops::{Deref, DerefMut}, - path::{Path, PathBuf}, -}; - -use crate::error::ResolveError; - -#[derive(Debug, Default, Clone)] -pub struct ResolveContext(ResolveContextImpl); - -#[derive(Debug, Default, Clone)] -pub struct ResolveContextImpl { - pub fully_specified: bool, - - pub query: Option, - - pub fragment: Option, - - /// Files that was found on file system - pub file_dependencies: Option>, - - /// Files that was found on file system - pub missing_dependencies: Option>, - - /// The current resolving alias for bailing recursion alias. - pub resolving_alias: Option, - - /// For avoiding infinite recursion, which will cause stack overflow. - depth: u8, -} - -impl Deref for ResolveContext { - type Target = ResolveContextImpl; - - fn deref(&self) -> &Self::Target { - &self.0 - } -} - -impl DerefMut for ResolveContext { - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} - -impl ResolveContext { - pub fn with_fully_specified(&mut self, yes: bool) { - self.fully_specified = yes; - } - - pub fn with_query_fragment(&mut self, query: Option<&str>, fragment: Option<&str>) { - if let Some(query) = query { - self.query.replace(query.to_string()); - } - if let Some(fragment) = fragment { - self.fragment.replace(fragment.to_string()); - } - } - - pub fn init_file_dependencies(&mut self) { - self.file_dependencies.replace(vec![]); - self.missing_dependencies.replace(vec![]); - } - - pub fn add_file_dependency(&mut self, dep: &Path) { - if let Some(deps) = &mut self.file_dependencies { - deps.push(dep.to_path_buf()); - } - } - - pub fn add_missing_dependency(&mut self, dep: &Path) { - if let Some(deps) = &mut self.missing_dependencies { - deps.push(dep.to_path_buf()); - } - } - - pub fn with_resolving_alias(&mut self, alias: String) { - self.resolving_alias = Some(alias); - } - - pub fn test_for_infinite_recursion(&mut self) -> Result<(), ResolveError> { - self.depth += 1; - // 64 should be more than enough for detecting infinite recursion. - if self.depth > 64 { - return Err(ResolveError::Recursion); - } - Ok(()) - } -} diff --git a/src/error.rs b/src/error.rs deleted file mode 100644 index ff2aaa4f..00000000 --- a/src/error.rs +++ /dev/null @@ -1,160 +0,0 @@ -use std::{io, path::PathBuf, sync::Arc}; -use thiserror::Error; - -/// All resolution errors -/// -/// `thiserror` is used to display meaningful error messages. -#[derive(Debug, Clone, PartialEq, Error)] -pub enum ResolveError { - /// Ignored path - /// - /// Derived from ignored path (false value) from browser field in package.json - /// ```json - /// { - /// "browser": { - /// "./module": false - /// } - /// } - /// ``` - /// See - #[error("Path is ignored {0}")] - Ignored(PathBuf), - - /// Module not found - #[error("Cannot find module '{0}'")] - NotFound(/* specifier */ String), - - /// Tsconfig not found - #[error("Tsconfig not found {0}")] - TsconfigNotFound(PathBuf), - - #[error("{0}")] - IOError(IOError), - - /// Node.js builtin modules - /// - /// This is an error due to not being a Node.js runtime. - /// The `alias` option can be used to resolve a builtin module to a polyfill. - #[error("Builtin module {0}")] - Builtin(String), - - /// All of the aliased extension are not found - #[error("All of the aliased extension are not found")] - ExtensionAlias, - - /// The provided path specifier cannot be parsed - #[error("{0}")] - Specifier(SpecifierError), - - /// JSON parse error - #[error("{0:?}")] - JSON(JSONError), - - /// Restricted by `ResolveOptions::restrictions` - #[error(r#"Path "{0}" restricted by {0}"#)] - Restriction(PathBuf, PathBuf), - - #[error(r#"Invalid module "{0}" specifier is not a valid subpath for the "exports" resolution of {1}"#)] - InvalidModuleSpecifier(String, PathBuf), - - #[error(r#"Invalid "exports" target "{0}" defined for '{1}' in the package config {2}"#)] - InvalidPackageTarget(String, String, PathBuf), - - #[error(r#"Package subpath '{0}' is not defined by "exports" in {1}"#)] - PackagePathNotExported(String, PathBuf), - - #[error(r#"Invalid package config "{0}", "exports" cannot contain some keys starting with '.' and some not. The exports object must either be an object of package subpath keys or an object of main entry condition name keys only."#)] - InvalidPackageConfig(PathBuf), - - #[error(r#"Default condition should be last one in "{0}""#)] - InvalidPackageConfigDefault(PathBuf), - - #[error(r#"Expecting folder to folder mapping. "{0}" should end with "/"#)] - InvalidPackageConfigDirectory(PathBuf), - - #[error(r#"Package import specifier "{0}" is not defined in package {1}"#)] - PackageImportNotDefined(String, PathBuf), - - #[error("{0} is unimplemented")] - Unimplemented(&'static str), - - /// Occurs when alias paths reference each other. - #[error("Recursion in resolving")] - Recursion, -} - -impl ResolveError { - pub fn is_ignore(&self) -> bool { - matches!(self, Self::Ignored(_)) - } - - pub(crate) fn from_serde_json_error(path: PathBuf, error: &serde_json::Error) -> Self { - Self::JSON(JSONError { - path, - message: error.to_string(), - line: error.line(), - column: error.column(), - }) - } -} - -/// Error for [ResolveError::Specifier] -#[derive(Debug, Clone, Eq, PartialEq, Error)] -pub enum SpecifierError { - #[error("The specifiers must be a non-empty string. Received \"{0}\"")] - Empty(String), -} - -/// JSON error from [serde_json::Error] -#[derive(Debug, Clone, Eq, PartialEq)] -pub struct JSONError { - pub path: PathBuf, - pub message: String, - pub line: usize, - pub column: usize, -} - -#[derive(Debug, Clone, Error)] -#[error("{0}")] -pub struct IOError(Arc); - -impl PartialEq for IOError { - fn eq(&self, other: &Self) -> bool { - self.0.kind() == other.0.kind() - } -} - -impl From for io::Error { - fn from(error: IOError) -> Self { - let io_error = error.0.as_ref(); - Self::new(io_error.kind(), io_error.to_string()) - } -} - -impl From for ResolveError { - fn from(err: io::Error) -> Self { - Self::IOError(IOError(Arc::new(err))) - } -} - -#[test] -fn test_into_io_error() { - use std::io::{self, ErrorKind}; - let error_string = "IOError occurred"; - let string_error = io::Error::new(ErrorKind::Interrupted, error_string.to_string()); - let string_error2 = io::Error::new(ErrorKind::Interrupted, error_string.to_string()); - let resolve_io_error: ResolveError = ResolveError::from(string_error2); - - assert_eq!(resolve_io_error, ResolveError::from(string_error)); - assert_eq!(resolve_io_error.clone(), resolve_io_error); - if let ResolveError::IOError(io_error) = resolve_io_error { - // fix for https://github.com/web-infra-dev/rspack/issues/4564 - let std_io_error: io::Error = io_error.into(); - assert_eq!(std_io_error.kind(), ErrorKind::Interrupted); - assert_eq!(std_io_error.to_string(), error_string); - assert_eq!( - format!("{std_io_error:?}"), - r#"Custom { kind: Interrupted, error: "IOError occurred" }"# - ); - } -} diff --git a/src/file_system.rs b/src/file_system.rs deleted file mode 100644 index 04d177de..00000000 --- a/src/file_system.rs +++ /dev/null @@ -1,133 +0,0 @@ -use std::{ - fs, io, - path::{Path, PathBuf}, -}; - -/// File System abstraction used for `ResolverGeneric` -pub trait FileSystem: Send + Sync { - /// See [std::fs::read_to_string] - /// - /// # Errors - /// - /// * See [std::fs::read_to_string] - /// ## Warning - /// Use `&Path` instead of a generic `P: AsRef` here, - /// because object safety requirements, it is especially useful, when - /// you want to store multiple `dyn FileSystem` in a `Vec` or use a `ResolverGeneric` in - /// napi env. - fn read_to_string(&self, path: &Path) -> io::Result; - - /// See [std::fs::metadata] - /// - /// # Errors - /// See [std::fs::metadata] - /// ## Warning - /// Use `&Path` instead of a generic `P: AsRef` here, - /// because object safety requirements, it is especially useful, when - /// you want to store multiple `dyn FileSystem` in a `Vec` or use a `ResolverGeneric` in - /// napi env. - fn metadata(&self, path: &Path) -> io::Result; - - /// See [std::fs::symlink_metadata] - /// - /// # Errors - /// - /// See [std::fs::symlink_metadata] - /// ## Warning - /// Use `&Path` instead of a generic `P: AsRef` here, - /// because object safety requirements, it is especially useful, when - /// you want to store multiple `dyn FileSystem` in a `Vec` or use a `ResolverGeneric` in - /// napi env. - fn symlink_metadata(&self, path: &Path) -> io::Result; - - /// See [std::fs::canonicalize] - /// - /// # Errors - /// - /// See [std::fs::read_link] - /// ## Warning - /// Use `&Path` instead of a generic `P: AsRef` here, - /// because object safety requirements, it is especially useful, when - /// you want to store multiple `dyn FileSystem` in a `Vec` or use a `ResolverGeneric` in - /// napi env. - fn canonicalize(&self, path: &Path) -> io::Result; -} - -/// Metadata information about a file -#[derive(Debug, Clone, Copy)] -pub struct FileMetadata { - pub(crate) is_file: bool, - pub(crate) is_dir: bool, - pub(crate) is_symlink: bool, -} - -impl FileMetadata { - pub fn new(is_file: bool, is_dir: bool, is_symlink: bool) -> Self { - Self { is_file, is_dir, is_symlink } - } -} - -impl From for FileMetadata { - fn from(metadata: fs::Metadata) -> Self { - Self::new(metadata.is_file(), metadata.is_dir(), metadata.is_symlink()) - } -} - -/// Operating System -#[derive(Default)] -pub struct FileSystemOs; - -impl FileSystem for FileSystemOs { - fn read_to_string(&self, path: &Path) -> io::Result { - fs::read_to_string(path) - } - - fn metadata(&self, path: &Path) -> io::Result { - fs::metadata(path).map(FileMetadata::from) - } - - fn symlink_metadata(&self, path: &Path) -> io::Result { - fs::symlink_metadata(path).map(FileMetadata::from) - } - - fn canonicalize(&self, path: &Path) -> io::Result { - #[cfg(not(target_os = "wasi"))] - { - dunce::canonicalize(path) - } - #[cfg(target_os = "wasi")] - { - let meta = fs::symlink_metadata(path)?; - if meta.file_type().is_symlink() { - let link = fs::read_link(path)?; - let mut path_buf = path.to_path_buf(); - path_buf.pop(); - for segment in link.iter() { - match segment.to_str() { - Some("..") => { - path_buf.pop(); - } - Some(".") | None => {} - Some(seg) => { - // Need to trim the extra \0 introduces by rust std rust-lang/rust#123727 - path_buf.push(seg.trim_end_matches('\0')); - } - } - } - Ok(path_buf) - } else { - Ok(path.to_path_buf()) - } - } - } -} - -#[test] -fn metadata() { - let meta = FileMetadata { is_file: true, is_dir: true, is_symlink: true }; - assert_eq!( - format!("{meta:?}"), - "FileMetadata { is_file: true, is_dir: true, is_symlink: true }" - ); - let _ = meta; -} diff --git a/src/lib.rs b/src/lib.rs deleted file mode 100644 index 8ec2ad8a..00000000 --- a/src/lib.rs +++ /dev/null @@ -1,1670 +0,0 @@ -//! # Oxc Resolver -//! -//! Node.js [CommonJS][cjs] and [ECMAScript][esm] Module Resolution. -//! -//! A module resolution is the process of finding the file referenced by a module specifier in -//! `import "specifier"` or `require("specifier")`. -//! -//! All [configuration options](ResolveOptions) are aligned with webpack's [enhanced-resolve]. -//! -//! ## Terminology -//! -//! ### Specifier -//! -//! For [CommonJS modules][cjs], -//! the specifier is the string passed to the `require` function. e.g. `"id"` in `require("id")`. -//! -//! For [ECMAScript modules][esm], -//! the specifier of an `import` statement is the string after the `from` keyword, -//! e.g. `'specifier'` in `import 'specifier'` or `import { sep } from 'specifier'`. -//! Specifiers are also used in export from statements, and as the argument to an `import()` expression. -//! -//! This is also named "request" in some places. -//! -//! ## References: -//! -//! * Algorithm adapted from Node.js [CommonJS Module Resolution Algorithm] and [ECMAScript Module Resolution Algorithm]. -//! * Tests are ported from [enhanced-resolve]. -//! * Some code is adapted from [parcel-resolver]. -//! * The documentation is copied from [webpack's resolve configuration](https://webpack.js.org/configuration/resolve). -//! -//! [enhanced-resolve]: https://github.com/webpack/enhanced-resolve -//! [CommonJS Module Resolution Algorithm]: https://nodejs.org/api/modules.html#all-together -//! [ECMAScript Module Resolution Algorithm]: https://nodejs.org/api/esm.html#resolution-algorithm-specification -//! [parcel-resolver]: https://github.com/parcel-bundler/parcel/blob/v2/packages/utils/node-resolver-rs -//! [cjs]: https://nodejs.org/api/modules.html -//! [esm]: https://nodejs.org/api/esm.html -//! -//! ## Feature flags -#![cfg_attr(feature = "document-features", doc = document_features::document_features!())] -#![cfg_attr(docsrs, feature(doc_auto_cfg))] -//! -//! ## Example -//! -//! ```rust,ignore -#![doc = include_str!("../examples/resolver.rs")] -//! ``` - -mod builtins; -mod cache; -mod context; -mod error; -mod file_system; -mod options; -mod package_json; -mod path; -mod resolution; -mod specifier; -mod tsconfig; - -#[cfg(test)] -mod tests; - -use std::{ - borrow::Cow, - cmp::Ordering, - ffi::OsStr, - fmt, - path::{Component, Path, PathBuf}, - sync::Arc, -}; - -use rustc_hash::FxHashSet; -use serde_json::Value as JSONValue; -use typescript_tsconfig_json::ExtendsField; - -pub use crate::{ - builtins::NODEJS_BUILTINS, - error::{JSONError, ResolveError, SpecifierError}, - file_system::{FileMetadata, FileSystem}, - options::{ - Alias, AliasValue, EnforceExtension, ResolveOptions, Restriction, TsconfigOptions, - TsconfigReferences, - }, - package_json::PackageJson, - resolution::Resolution, -}; -use crate::{ - cache::{Cache, CachedPath}, - context::ResolveContext as Ctx, - file_system::FileSystemOs, - package_json::JSONMap, - path::{PathUtil, SLASH_START}, - specifier::Specifier, - tsconfig::{ProjectReference, TsConfig}, -}; - -type ResolveResult = Result, ResolveError>; - -/// Context returned from the [Resolver::resolve_with_context] API -#[derive(Debug, Default, Clone)] -pub struct ResolveContext { - /// Files that was found on file system - pub file_dependencies: FxHashSet, - - /// Dependencies that was not found on file system - pub missing_dependencies: FxHashSet, -} - -/// Resolver with the current operating system as the file system -pub type Resolver = ResolverGeneric; - -/// Generic implementation of the resolver, can be configured by the [FileSystem] trait -pub struct ResolverGeneric { - options: ResolveOptions, - cache: Arc>, -} - -impl fmt::Debug for ResolverGeneric { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - self.options.fmt(f) - } -} - -impl Default for ResolverGeneric { - fn default() -> Self { - Self::new(ResolveOptions::default()) - } -} - -impl ResolverGeneric { - pub fn new(options: ResolveOptions) -> Self { - Self { options: options.sanitize(), cache: Arc::new(Cache::new(Fs::default())) } - } -} - -impl ResolverGeneric { - pub fn new_with_file_system(file_system: Fs, options: ResolveOptions) -> Self { - Self { cache: Arc::new(Cache::new(file_system)), options: options.sanitize() } - } - - /// Clone the resolver using the same underlying cache. - #[must_use] - pub fn clone_with_options(&self, options: ResolveOptions) -> Self { - Self { options: options.sanitize(), cache: Arc::clone(&self.cache) } - } - - /// Returns the options. - pub fn options(&self) -> &ResolveOptions { - &self.options - } - - /// Clear the underlying cache. - pub fn clear_cache(&self) { - self.cache.clear(); - } - - /// Resolve `specifier` at an absolute `path`. - /// - /// A specifier is the string passed to require or import, i.e. `require("specifier")` or `import "specifier"`. - /// - /// `path` must be an **absolute** path to a directory where the specifier is resolved against. - /// For CommonJS modules, it is the `__dirname` variable that contains the absolute path to the folder containing current module. - /// For ECMAScript modules, it is the value of `import.meta.url`. - /// - /// # Errors - /// - /// * See [ResolveError] - pub fn resolve>( - &self, - path: P, - specifier: &str, - ) -> Result { - let mut ctx = Ctx::default(); - self.resolve_tracing(path.as_ref(), specifier, &mut ctx) - } - - /// Resolve `specifier` at absolute `path` with [ResolveContext] - /// - /// # Errors - /// - /// * See [ResolveError] - pub fn resolve_with_context>( - &self, - path: P, - specifier: &str, - resolve_context: &mut ResolveContext, - ) -> Result { - let mut ctx = Ctx::default(); - ctx.init_file_dependencies(); - let result = self.resolve_tracing(path.as_ref(), specifier, &mut ctx); - if let Some(deps) = &mut ctx.file_dependencies { - resolve_context.file_dependencies.extend(deps.drain(..)); - } - if let Some(deps) = &mut ctx.missing_dependencies { - resolve_context.missing_dependencies.extend(deps.drain(..)); - } - result - } - - /// Wrap `resolve_impl` with `tracing` information - fn resolve_tracing( - &self, - path: &Path, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - let span = tracing::debug_span!("resolve", path = ?path, specifier = specifier); - let _enter = span.enter(); - let r = self.resolve_impl(path, specifier, ctx); - match &r { - Ok(r) => { - tracing::debug!(options = ?self.options, path = ?path, specifier = specifier, ret = ?r.path); - } - Err(err) => { - tracing::debug!(options = ?self.options, path = ?path, specifier = specifier, err = ?err); - } - }; - r - } - - fn resolve_impl( - &self, - path: &Path, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - ctx.with_fully_specified(self.options.fully_specified); - let cached_path = self.cache.value(path); - let cached_path = self.require(&cached_path, specifier, ctx)?; - let path = self.load_realpath(&cached_path)?; - // enhanced-resolve: restrictions - self.check_restrictions(&path)?; - let package_json = cached_path.find_package_json(&self.cache.fs, &self.options, ctx)?; - if let Some(package_json) = &package_json { - // path must be inside the package. - debug_assert!(path.starts_with(package_json.directory())); - } - Ok(Resolution { - path, - query: ctx.query.take(), - fragment: ctx.fragment.take(), - package_json, - }) - } - - /// require(X) from module at path Y - /// - /// X: specifier - /// Y: path - /// - /// - fn require( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - ctx.test_for_infinite_recursion()?; - - // enhanced-resolve: parse - let (parsed, try_fragment_as_path) = self.load_parse(cached_path, specifier, ctx)?; - if let Some(path) = try_fragment_as_path { - return Ok(path); - } - - self.require_without_parse(cached_path, parsed.path(), ctx) - } - - fn require_without_parse( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - // tsconfig-paths - if let Some(path) = self.load_tsconfig_paths(cached_path, specifier, &mut Ctx::default())? { - return Ok(path); - } - - // enhanced-resolve: try alias - if let Some(path) = self.load_alias(cached_path, specifier, &self.options.alias, ctx)? { - return Ok(path); - } - - let result = match Path::new(specifier).components().next() { - // 2. If X begins with '/' - Some(Component::RootDir | Component::Prefix(_)) => { - self.require_absolute(cached_path, specifier, ctx) - } - // 3. If X begins with './' or '/' or '../' - Some(Component::CurDir | Component::ParentDir) => { - self.require_relative(cached_path, specifier, ctx) - } - // 4. If X begins with '#' - Some(Component::Normal(_)) if specifier.as_bytes()[0] == b'#' => { - self.require_hash(cached_path, specifier, ctx) - } - _ => { - // 1. If X is a core module, - // a. return the core module - // b. STOP - self.require_core(specifier)?; - - // (ESM) 5. Otherwise, - // Note: specifier is now a bare specifier. - // Set resolved the result of PACKAGE_RESOLVE(specifier, parentURL). - self.require_bare(cached_path, specifier, ctx) - } - }; - - result.or_else(|err| { - if err.is_ignore() { - return Err(err); - } - // enhanced-resolve: try fallback - self.load_alias(cached_path, specifier, &self.options.fallback, ctx) - .and_then(|value| value.ok_or(err)) - }) - } - - // PACKAGE_RESOLVE(packageSpecifier, parentURL) - // 3. If packageSpecifier is a Node.js builtin module name, then - // 1. Return the string "node:" concatenated with packageSpecifier. - fn require_core(&self, specifier: &str) -> Result<(), ResolveError> { - if self.options.builtin_modules { - let starts_with_node = specifier.starts_with("node:"); - if starts_with_node || NODEJS_BUILTINS.binary_search(&specifier).is_ok() { - let mut specifier = specifier.to_string(); - if !starts_with_node { - specifier = format!("node:{specifier}"); - } - return Err(ResolveError::Builtin(specifier)); - } - } - Ok(()) - } - - fn require_absolute( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - // Make sure only path prefixes gets called - debug_assert!(Path::new(specifier) - .components() - .next() - .is_some_and(|c| matches!(c, Component::RootDir | Component::Prefix(_)))); - if !self.options.prefer_relative && self.options.prefer_absolute { - if let Ok(path) = self.load_package_self_or_node_modules(cached_path, specifier, ctx) { - return Ok(path); - } - } - if let Some(path) = self.load_roots(specifier, ctx) { - return Ok(path); - } - // 2. If X begins with '/' - // a. set Y to be the file system root - let path = self.cache.value(Path::new(specifier)); - if let Some(path) = self.load_as_file_or_directory(&path, specifier, ctx)? { - return Ok(path); - } - Err(ResolveError::NotFound(specifier.to_string())) - } - - // 3. If X begins with './' or '/' or '../' - fn require_relative( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - // Make sure only relative or normal paths gets called - debug_assert!(Path::new(specifier).components().next().is_some_and(|c| matches!( - c, - Component::CurDir | Component::ParentDir | Component::Normal(_) - ))); - let path = cached_path.path().normalize_with(specifier); - let cached_path = self.cache.value(&path); - // a. LOAD_AS_FILE(Y + X) - // b. LOAD_AS_DIRECTORY(Y + X) - if let Some(path) = self.load_as_file_or_directory(&cached_path, specifier, ctx)? { - return Ok(path); - } - // c. THROW "not found" - Err(ResolveError::NotFound(specifier.to_string())) - } - - fn require_hash( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - debug_assert_eq!(specifier.chars().next(), Some('#')); - // a. LOAD_PACKAGE_IMPORTS(X, dirname(Y)) - if let Some(path) = self.load_package_imports(cached_path, specifier, ctx)? { - return Ok(path); - } - self.load_package_self_or_node_modules(cached_path, specifier, ctx) - } - - fn require_bare( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - // Make sure no other path prefixes gets called - debug_assert!(Path::new(specifier) - .components() - .next() - .is_some_and(|c| matches!(c, Component::Normal(_)))); - if self.options.prefer_relative { - if let Ok(path) = self.require_relative(cached_path, specifier, ctx) { - return Ok(path); - } - } - self.load_package_self_or_node_modules(cached_path, specifier, ctx) - } - - /// enhanced-resolve: ParsePlugin. - /// - /// 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`. - /// - /// - fn load_parse<'s>( - &self, - cached_path: &CachedPath, - specifier: &'s str, - ctx: &mut Ctx, - ) -> Result<(Specifier<'s>, Option), ResolveError> { - let parsed = Specifier::parse(specifier).map_err(ResolveError::Specifier)?; - ctx.with_query_fragment(parsed.query, parsed.fragment); - - // There is an edge-case where a request with # can be a path or a fragment -> try both - if ctx.fragment.is_some() && ctx.query.is_none() { - let specifier = parsed.path(); - let fragment = ctx.fragment.take().unwrap(); - let path = format!("{specifier}{fragment}"); - if let Ok(path) = self.require_without_parse(cached_path, &path, ctx) { - return Ok((parsed, Some(path))); - } - ctx.fragment.replace(fragment); - } - Ok((parsed, None)) - } - - fn load_package_self_or_node_modules( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - let (_, subpath) = Self::parse_package_specifier(specifier); - if subpath.is_empty() { - ctx.with_fully_specified(false); - } - // 5. LOAD_PACKAGE_SELF(X, dirname(Y)) - if let Some(path) = self.load_package_self(cached_path, specifier, ctx)? { - return Ok(path); - } - // 6. LOAD_NODE_MODULES(X, dirname(Y)) - if let Some(path) = self.load_node_modules(cached_path, specifier, ctx)? { - return Ok(path); - } - // 7. THROW "not found" - Err(ResolveError::NotFound(specifier.to_string())) - } - - /// LOAD_PACKAGE_IMPORTS(X, DIR) - fn load_package_imports( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - // 1. Find the closest package scope SCOPE to DIR. - // 2. If no scope was found, return. - let Some(package_json) = - cached_path.find_package_json(&self.cache.fs, &self.options, ctx)? - else { - return Ok(None); - }; - // 3. If the SCOPE/package.json "imports" is null or undefined, return. - // 4. let MATCH = PACKAGE_IMPORTS_RESOLVE(X, pathToFileURL(SCOPE), ["node", "require"]) defined in the ESM resolver. - if let Some(path) = self.package_imports_resolve(specifier, &package_json, ctx)? { - // 5. RESOLVE_ESM_MATCH(MATCH). - return self.resolve_esm_match(specifier, &path, ctx); - } - Ok(None) - } - - fn load_as_file(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - // enhanced-resolve feature: extension_alias - if let Some(path) = self.load_extension_alias(cached_path, ctx)? { - return Ok(Some(path)); - } - if self.options.enforce_extension.is_disabled() { - // 1. If X is a file, load X as its file extension format. STOP - if let Some(path) = self.load_alias_or_file(cached_path, ctx)? { - return Ok(Some(path)); - } - } - // 2. If X.js is a file, load X.js as JavaScript text. STOP - // 3. If X.json is a file, parse X.json to a JavaScript Object. STOP - // 4. If X.node is a file, load X.node as binary addon. STOP - if let Some(path) = - self.load_extensions(cached_path.path(), &self.options.extensions, ctx)? - { - return Ok(Some(path)); - } - Ok(None) - } - - fn load_as_directory(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - // TODO: Only package.json is supported, so warn about having other values - // Checking for empty files is needed for omitting checks on package.json - // 1. If X/package.json is a file, - if !self.options.description_files.is_empty() { - // a. Parse X/package.json, and look for "main" field. - if let Some(package_json) = - cached_path.package_json(&self.cache.fs, &self.options, ctx)? - { - // b. If "main" is a falsy value, GOTO 2. - for main_field in package_json.main_fields(&self.options.main_fields) { - // c. let M = X + (json main field) - let main_field_path = cached_path.path().normalize_with(main_field); - // d. LOAD_AS_FILE(M) - let cached_path = self.cache.value(&main_field_path); - if let Some(path) = self.load_as_file(&cached_path, ctx)? { - return Ok(Some(path)); - } - // e. LOAD_INDEX(M) - if let Some(path) = self.load_index(&cached_path, ctx)? { - return Ok(Some(path)); - } - } - // f. LOAD_INDEX(X) DEPRECATED - // g. THROW "not found" - } - } - // 2. LOAD_INDEX(X) - self.load_index(cached_path, ctx) - } - - fn load_as_file_or_directory( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - if self.options.resolve_to_context { - return Ok(cached_path.is_dir(&self.cache.fs, ctx).then(|| cached_path.clone())); - } - if !specifier.ends_with('/') { - if let Some(path) = self.load_as_file(cached_path, ctx)? { - return Ok(Some(path)); - } - } - if cached_path.is_dir(&self.cache.fs, ctx) { - if let Some(path) = self.load_as_directory(cached_path, ctx)? { - return Ok(Some(path)); - } - } - Ok(None) - } - - fn load_extensions(&self, path: &Path, extensions: &[String], ctx: &mut Ctx) -> ResolveResult { - if ctx.fully_specified { - return Ok(None); - } - let path = path.as_os_str(); - for extension in extensions { - let mut path_with_extension = path.to_os_string(); - path_with_extension.reserve_exact(extension.len()); - path_with_extension.push(extension); - let cached_path = self.cache.value(Path::new(&path_with_extension)); - if let Some(path) = self.load_alias_or_file(&cached_path, ctx)? { - return Ok(Some(path)); - } - } - Ok(None) - } - - fn load_realpath(&self, cached_path: &CachedPath) -> Result { - if self.options.symlinks { - cached_path.realpath(&self.cache.fs).map_err(ResolveError::from) - } else { - Ok(cached_path.to_path_buf()) - } - } - - fn check_restrictions(&self, path: &Path) -> Result<(), ResolveError> { - // https://github.com/webpack/enhanced-resolve/blob/a998c7d218b7a9ec2461fc4fddd1ad5dd7687485/lib/RestrictionsPlugin.js#L19-L24 - fn is_inside(path: &Path, parent: &Path) -> bool { - if !path.starts_with(parent) { - return false; - } - if path.as_os_str().len() == parent.as_os_str().len() { - return true; - } - path.strip_prefix(parent).is_ok_and(|p| p == Path::new("./")) - } - for restriction in &self.options.restrictions { - match restriction { - Restriction::Path(restricted_path) => { - if !is_inside(path, restricted_path) { - return Err(ResolveError::Restriction( - path.to_path_buf(), - restricted_path.clone(), - )); - } - } - Restriction::RegExp(_) => { - return Err(ResolveError::Unimplemented("Restriction with regex")) - } - } - } - Ok(()) - } - - fn load_index(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - for main_file in &self.options.main_files { - let main_path = cached_path.path().normalize_with(main_file); - let cached_path = self.cache.value(&main_path); - if self.options.enforce_extension.is_disabled() { - if let Some(path) = self.load_alias_or_file(&cached_path, ctx)? { - return Ok(Some(path)); - } - } - // 1. If X/index.js is a file, load X/index.js as JavaScript text. STOP - // 2. If X/index.json is a file, parse X/index.json to a JavaScript object. STOP - // 3. If X/index.node is a file, load X/index.node as binary addon. STOP - if let Some(path) = - self.load_extensions(cached_path.path(), &self.options.extensions, ctx)? - { - return Ok(Some(path)); - } - } - Ok(None) - } - - fn load_alias_or_file(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - if let Some(package_json) = - cached_path.find_package_json(&self.cache.fs, &self.options, ctx)? - { - if let Some(path) = self.load_browser_field(cached_path, None, &package_json, ctx)? { - return Ok(Some(path)); - } - } - // enhanced-resolve: try file as alias - let alias_specifier = cached_path.path().to_string_lossy(); - if let Some(path) = - self.load_alias(cached_path, &alias_specifier, &self.options.alias, ctx)? - { - return Ok(Some(path)); - } - if cached_path.is_file(&self.cache.fs, ctx) { - return Ok(Some(cached_path.clone())); - } - Ok(None) - } - - fn load_node_modules( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - let (package_name, subpath) = Self::parse_package_specifier(specifier); - // 1. let DIRS = NODE_MODULES_PATHS(START) - // 2. for each DIR in DIRS: - for module_name in &self.options.modules { - for cached_path in std::iter::successors(Some(cached_path), |p| p.parent()) { - // Skip if /path/to/node_modules does not exist - if !cached_path.is_dir(&self.cache.fs, ctx) { - continue; - } - - let Some(cached_path) = self.get_module_directory(cached_path, module_name, ctx) - else { - continue; - }; - // Optimize node_modules lookup by inspecting whether the package exists - // From LOAD_PACKAGE_EXPORTS(X, DIR) - // 1. Try to interpret X as a combination of NAME and SUBPATH where the name - // may have a @scope/ prefix and the subpath begins with a slash (`/`). - if !package_name.is_empty() { - let package_path = cached_path.path().normalize_with(package_name); - let cached_path = self.cache.value(&package_path); - // Try foo/node_modules/package_name - if cached_path.is_dir(&self.cache.fs, ctx) { - // a. LOAD_PACKAGE_EXPORTS(X, DIR) - if let Some(path) = - self.load_package_exports(specifier, subpath, &cached_path, ctx)? - { - return Ok(Some(path)); - } - } else { - // foo/node_modules/package_name is not a directory, so useless to check inside it - if !subpath.is_empty() { - continue; - } - // Skip if the directory lead to the scope package does not exist - // i.e. `foo/node_modules/@scope` is not a directory for `foo/node_modules/@scope/package` - if package_name.starts_with('@') { - if let Some(path) = cached_path.parent() { - if !path.is_dir(&self.cache.fs, ctx) { - continue; - } - } - } - } - } - - // Try as file or directory for all other cases - // b. LOAD_AS_FILE(DIR/X) - // c. LOAD_AS_DIRECTORY(DIR/X) - let node_module_file = cached_path.path().normalize_with(specifier); - let cached_path = self.cache.value(&node_module_file); - if let Some(path) = self.load_as_file_or_directory(&cached_path, specifier, ctx)? { - return Ok(Some(path)); - } - } - } - Ok(None) - } - - fn get_module_directory( - &self, - cached_path: &CachedPath, - module_name: &str, - ctx: &mut Ctx, - ) -> Option { - if cached_path.path().ends_with(module_name) { - Some(cached_path.clone()) - } else if module_name == "node_modules" { - cached_path.cached_node_modules(&self.cache, ctx) - } else { - cached_path.module_directory(module_name, &self.cache, ctx) - } - } - - fn load_package_exports( - &self, - specifier: &str, - subpath: &str, - cached_path: &CachedPath, - ctx: &mut Ctx, - ) -> ResolveResult { - // 2. If X does not match this pattern or DIR/NAME/package.json is not a file, - // return. - let Some(package_json) = cached_path.package_json(&self.cache.fs, &self.options, ctx)? - else { - return Ok(None); - }; - // 3. Parse DIR/NAME/package.json, and look for "exports" field. - // 4. If "exports" is null or undefined, return. - // 5. let MATCH = PACKAGE_EXPORTS_RESOLVE(pathToFileURL(DIR/NAME), "." + SUBPATH, - // `package.json` "exports", ["node", "require"]) defined in the ESM resolver. - // Note: The subpath is not prepended with a dot on purpose - for exports in package_json.exports_fields(&self.options.exports_fields) { - if let Some(path) = self.package_exports_resolve( - cached_path.path(), - &format!(".{subpath}"), - exports, - ctx, - )? { - // 6. RESOLVE_ESM_MATCH(MATCH) - return self.resolve_esm_match(specifier, &path, ctx); - }; - } - Ok(None) - } - - fn load_package_self( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - // 1. Find the closest package scope SCOPE to DIR. - // 2. If no scope was found, return. - let Some(package_json) = - cached_path.find_package_json(&self.cache.fs, &self.options, ctx)? - else { - return Ok(None); - }; - // 3. If the SCOPE/package.json "exports" is null or undefined, return. - // 4. If the SCOPE/package.json "name" is not the first segment of X, return. - if let Some(subpath) = package_json - .name - .as_ref() - .and_then(|package_name| Self::strip_package_name(specifier, package_name)) - { - // 5. let MATCH = PACKAGE_EXPORTS_RESOLVE(pathToFileURL(SCOPE), - // "." + X.slice("name".length), `package.json` "exports", ["node", "require"]) - // defined in the ESM resolver. - let package_url = package_json.directory(); - // Note: The subpath is not prepended with a dot on purpose - // because `package_exports_resolve` matches subpath without the leading dot. - for exports in package_json.exports_fields(&self.options.exports_fields) { - if let Some(cached_path) = - self.package_exports_resolve(package_url, &format!(".{subpath}"), exports, ctx)? - { - // 6. RESOLVE_ESM_MATCH(MATCH) - return self.resolve_esm_match(specifier, &cached_path, ctx); - } - } - } - self.load_browser_field(cached_path, Some(specifier), &package_json, ctx) - } - - /// RESOLVE_ESM_MATCH(MATCH) - fn resolve_esm_match( - &self, - specifier: &str, - cached_path: &CachedPath, - ctx: &mut Ctx, - ) -> ResolveResult { - // 1. let RESOLVED_PATH = fileURLToPath(MATCH) - // 2. If the file at RESOLVED_PATH exists, load RESOLVED_PATH as its extension format. STOP - // - // Non-compliant ESM can result in a directory, so directory is tried as well. - if let Some(path) = self.load_as_file_or_directory(cached_path, "", ctx)? { - return Ok(Some(path)); - } - // 3. THROW "not found" - Err(ResolveError::NotFound(specifier.to_string())) - } - - /// enhanced-resolve: AliasFieldPlugin for [ResolveOptions::alias_fields] - fn load_browser_field( - &self, - cached_path: &CachedPath, - module_specifier: Option<&str>, - package_json: &PackageJson, - ctx: &mut Ctx, - ) -> ResolveResult { - let path = cached_path.path(); - let Some(new_specifier) = package_json.resolve_browser_field( - path, - module_specifier, - &self.options.alias_fields, - )? - else { - return Ok(None); - }; - // Abort when resolving recursive module - if module_specifier.is_some_and(|s| s == new_specifier) { - return Ok(None); - } - if ctx.resolving_alias.as_ref().is_some_and(|s| s == new_specifier) { - // Complete when resolving to self `{"./a.js": "./a.js"}` - if new_specifier.strip_prefix("./").filter(|s| path.ends_with(Path::new(s))).is_some() { - return if cached_path.is_file(&self.cache.fs, ctx) { - Ok(Some(cached_path.clone())) - } else { - Err(ResolveError::NotFound(new_specifier.to_string())) - }; - } - return Err(ResolveError::Recursion); - } - ctx.with_resolving_alias(new_specifier.to_string()); - ctx.with_fully_specified(false); - let cached_path = self.cache.value(package_json.directory()); - self.require(&cached_path, new_specifier, ctx).map(Some) - } - - /// enhanced-resolve: AliasPlugin for [ResolveOptions::alias] and [ResolveOptions::fallback]. - fn load_alias( - &self, - cached_path: &CachedPath, - specifier: &str, - aliases: &Alias, - ctx: &mut Ctx, - ) -> ResolveResult { - for (alias_key_raw, specifiers) in aliases { - let alias_key = if let Some(alias_key) = alias_key_raw.strip_suffix('$') { - if alias_key != specifier { - continue; - } - alias_key - } else { - let strip_package_name = Self::strip_package_name(specifier, alias_key_raw); - if strip_package_name.is_none() { - continue; - } - alias_key_raw - }; - // It should stop resolving when all of the tried alias values - // failed to resolve. - // - let mut should_stop = false; - for r in specifiers { - match r { - AliasValue::Path(alias_value) => { - if let Some(path) = self.load_alias_value( - cached_path, - alias_key, - alias_value, - specifier, - ctx, - &mut should_stop, - )? { - return Ok(Some(path)); - } - } - AliasValue::Ignore => { - let path = cached_path.path().normalize_with(alias_key); - return Err(ResolveError::Ignored(path)); - } - } - } - if should_stop { - return Err(ResolveError::NotFound(specifier.to_string())); - } - } - Ok(None) - } - - fn load_alias_value( - &self, - cached_path: &CachedPath, - alias_key: &str, - alias_value: &str, - request: &str, - ctx: &mut Ctx, - should_stop: &mut bool, - ) -> ResolveResult { - if request != alias_value - && !request.strip_prefix(alias_value).is_some_and(|prefix| prefix.starts_with('/')) - { - let tail = &request[alias_key.len()..]; - - let new_specifier = if tail.is_empty() { - Cow::Borrowed(alias_value) - } else { - let alias_value = Path::new(alias_value).normalize(); - // Must not append anything to alias_value if it is a file. - let alias_value_cached_path = self.cache.value(&alias_value); - if alias_value_cached_path.is_file(&self.cache.fs, ctx) { - return Ok(None); - } - - // Remove the leading slash so the final path is concatenated. - let tail = tail.trim_start_matches(SLASH_START); - let normalized = alias_value.normalize_with(tail); - Cow::Owned(normalized.to_string_lossy().to_string()) - }; - - *should_stop = true; - ctx.with_fully_specified(false); - return match self.require(cached_path, new_specifier.as_ref(), ctx) { - Err(ResolveError::NotFound(_)) => Ok(None), - Ok(path) => return Ok(Some(path)), - Err(err) => return Err(err), - }; - } - Ok(None) - } - - /// Given an extension alias map `{".js": [".ts", "js"]}`, - /// load the mapping instead of the provided extension - /// - /// This is an enhanced-resolve feature - /// - /// # Errors - /// - /// * [ResolveError::ExtensionAlias]: When all of the aliased extensions are not found - fn load_extension_alias(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - let Some(path_extension) = cached_path.path().extension() else { - return Ok(None); - }; - let Some((_, extensions)) = self - .options - .extension_alias - .iter() - .find(|(ext, _)| OsStr::new(ext.trim_start_matches('.')) == path_extension) - else { - return Ok(None); - }; - let path = cached_path.path().with_extension(""); - ctx.with_fully_specified(false); - if let Some(path) = self.load_extensions(&path, extensions, ctx)? { - return Ok(Some(path)); - } - Err(ResolveError::ExtensionAlias) - } - - /// enhanced-resolve: RootsPlugin - /// - /// A list of directories where requests of server-relative URLs (starting with '/') are resolved, - /// defaults to context configuration option. - /// - /// On non-Windows systems these requests are resolved as an absolute path first. - fn load_roots(&self, specifier: &str, ctx: &mut Ctx) -> Option { - if !self.options.roots.is_empty() { - if let Some(specifier) = specifier.strip_prefix(SLASH_START) { - for root in &self.options.roots { - let cached_path = self.cache.value(root); - if let Ok(path) = self.require_relative(&cached_path, specifier, ctx) { - return Some(path); - } - } - } - } - None - } - - fn load_tsconfig_paths( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - let Some(tsconfig_options) = &self.options.tsconfig else { - return Ok(None); - }; - let tsconfig = self.load_tsconfig( - /* root */ true, - &tsconfig_options.config_file, - &tsconfig_options.references, - )?; - let paths = tsconfig.resolve(cached_path.path(), specifier); - for path in paths { - let cached_path = self.cache.value(&path); - if let Ok(path) = self.require_relative(&cached_path, ".", ctx) { - return Ok(Some(path)); - } - } - Ok(None) - } - - fn load_tsconfig( - &self, - root: bool, - path: &Path, - references: &TsconfigReferences, - ) -> Result, ResolveError> { - self.cache.tsconfig(root, path, |tsconfig| { - let directory = self.cache.value(tsconfig.directory()); - tracing::trace!(tsconfig = ?tsconfig, "load_tsconfig"); - - // Extend tsconfig - if let Some(extends) = &tsconfig.extends { - let extended_tsconfig_paths = match extends { - ExtendsField::Single(s) => { - vec![self.get_extended_tsconfig_path(&directory, tsconfig, s)?] - } - ExtendsField::Multiple(specifiers) => specifiers - .iter() - .map(|s| self.get_extended_tsconfig_path(&directory, tsconfig, s)) - .collect::, ResolveError>>()?, - }; - for extended_tsconfig_path in extended_tsconfig_paths { - let extended_tsconfig = self.load_tsconfig( - /* root */ false, - &extended_tsconfig_path, - &TsconfigReferences::Disabled, - )?; - tsconfig.extend_tsconfig(&extended_tsconfig); - } - } - - // Load project references - match references { - TsconfigReferences::Disabled => { - tsconfig.references.drain(..); - } - TsconfigReferences::Auto => {} - TsconfigReferences::Paths(paths) => { - tsconfig.references = paths - .iter() - .map(|path| ProjectReference { path: path.clone(), tsconfig: None }) - .collect(); - } - } - if !tsconfig.references.is_empty() { - let directory = tsconfig.directory().to_path_buf(); - for reference in &mut tsconfig.references { - let reference_tsconfig_path = directory.normalize_with(&reference.path); - let tsconfig = self.cache.tsconfig( - /* root */ true, - &reference_tsconfig_path, - |_| Ok(()), - )?; - reference.tsconfig.replace(tsconfig); - } - } - Ok(()) - }) - } - - fn get_extended_tsconfig_path( - &self, - directory: &CachedPath, - tsconfig: &TsConfig, - specifier: &str, - ) -> Result { - match specifier.as_bytes().first() { - None => Err(ResolveError::Specifier(SpecifierError::Empty(specifier.to_string()))), - Some(b'/') => Ok(PathBuf::from(specifier)), - Some(b'.') => Ok(tsconfig.directory().normalize_with(specifier)), - _ => self - .clone_with_options(ResolveOptions { - description_files: vec![], - extensions: vec![".json".into()], - main_files: vec!["tsconfig.json".into()], - ..ResolveOptions::default() - }) - .load_package_self_or_node_modules(directory, specifier, &mut Ctx::default()) - .map(|p| p.to_path_buf()) - .map_err(|err| match err { - ResolveError::NotFound(_) => { - ResolveError::TsconfigNotFound(PathBuf::from(specifier)) - } - _ => err, - }), - } - } - - /// PACKAGE_RESOLVE(packageSpecifier, parentURL) - fn package_resolve( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - let (package_name, subpath) = Self::parse_package_specifier(specifier); - - // 3. If packageSpecifier is a Node.js builtin module name, then - // 1. Return the string "node:" concatenated with packageSpecifier. - self.require_core(package_name)?; - - // 11. While parentURL is not the file system root, - for module_name in &self.options.modules { - for cached_path in std::iter::successors(Some(cached_path), |p| p.parent()) { - // 1. Let packageURL be the URL resolution of "node_modules/" concatenated with packageSpecifier, relative to parentURL. - let Some(cached_path) = self.get_module_directory(cached_path, module_name, ctx) - else { - continue; - }; - // 2. Set parentURL to the parent folder URL of parentURL. - let package_path = cached_path.path().normalize_with(package_name); - let cached_path = self.cache.value(&package_path); - // 3. If the folder at packageURL does not exist, then - // 1. Continue the next loop iteration. - if cached_path.is_dir(&self.cache.fs, ctx) { - // 4. Let pjson be the result of READ_PACKAGE_JSON(packageURL). - if let Some(package_json) = - cached_path.package_json(&self.cache.fs, &self.options, ctx)? - { - // 5. If pjson is not null and pjson.exports is not null or undefined, then - // 1. Return the result of PACKAGE_EXPORTS_RESOLVE(packageURL, packageSubpath, pjson.exports, defaultConditions). - for exports in package_json.exports_fields(&self.options.exports_fields) { - if let Some(path) = self.package_exports_resolve( - cached_path.path(), - &format!(".{subpath}"), - exports, - ctx, - )? { - return Ok(Some(path)); - } - } - // 6. Otherwise, if packageSubpath is equal to ".", then - if subpath == "." { - // 1. If pjson.main is a string, then - for main_field in package_json.main_fields(&self.options.main_fields) { - // 1. Return the URL resolution of main in packageURL. - let path = cached_path.path().normalize_with(main_field); - let cached_path = self.cache.value(&path); - if cached_path.is_file(&self.cache.fs, ctx) { - return Ok(Some(cached_path)); - } - } - } - } - let subpath = format!(".{subpath}"); - ctx.with_fully_specified(false); - return self.require(&cached_path, &subpath, ctx).map(Some); - } - } - } - - Err(ResolveError::NotFound(specifier.to_string())) - } - - /// PACKAGE_EXPORTS_RESOLVE(packageURL, subpath, exports, conditions) - fn package_exports_resolve( - &self, - package_url: &Path, - subpath: &str, - exports: &JSONValue, - ctx: &mut Ctx, - ) -> ResolveResult { - let conditions = &self.options.condition_names; - // 1. If exports is an Object with both a key starting with "." and a key not starting with ".", throw an Invalid Package Configuration error. - if let JSONValue::Object(map) = exports { - let mut has_dot = false; - let mut without_dot = false; - for key in map.keys() { - has_dot = has_dot || key.starts_with(|s| s == '.' || s == '#'); - without_dot = without_dot || !key.starts_with(|s| s == '.' || s == '#'); - if has_dot && without_dot { - return Err(ResolveError::InvalidPackageConfig( - package_url.join("package.json"), - )); - } - } - } - // 2. If subpath is equal to ".", then - // Note: subpath is not prepended with a dot when passed in. - if subpath == "." { - // enhanced-resolve appends query and fragment when resolving exports field - // https://github.com/webpack/enhanced-resolve/blob/a998c7d218b7a9ec2461fc4fddd1ad5dd7687485/lib/ExportsFieldPlugin.js#L57-L62 - // This is only need when querying the main export, otherwise ctx is passed through. - if ctx.query.is_some() || ctx.fragment.is_some() { - let query = ctx.query.clone().unwrap_or_default(); - let fragment = ctx.fragment.clone().unwrap_or_default(); - return Err(ResolveError::PackagePathNotExported( - format!("./{}{query}{fragment}", subpath.trim_start_matches('.')), - package_url.join("package.json"), - )); - } - // 1. Let mainExport be undefined. - let main_export = match exports { - // 2. If exports is a String or Array, or an Object containing no keys starting with ".", then - JSONValue::String(_) | JSONValue::Array(_) => { - // 1. Set mainExport to exports. - Some(exports) - } - // 3. Otherwise if exports is an Object containing a "." property, then - JSONValue::Object(map) => { - // 1. Set mainExport to exports["."]. - map.get(".").map_or_else( - || { - if map.keys().any(|key| key.starts_with("./") || key.starts_with('#')) { - None - } else { - Some(exports) - } - }, - Some, - ) - } - _ => None, - }; - // 4. If mainExport is not undefined, then - if let Some(main_export) = main_export { - // 1. Let resolved be the result of PACKAGE_TARGET_RESOLVE( packageURL, mainExport, null, false, conditions). - let resolved = self.package_target_resolve( - package_url, - ".", - main_export, - None, - /* is_imports */ false, - conditions, - ctx, - )?; - // 2. If resolved is not null or undefined, return resolved. - if let Some(path) = resolved { - return Ok(Some(path)); - } - } - } - // 3. Otherwise, if exports is an Object and all keys of exports start with ".", then - if let JSONValue::Object(exports) = exports { - // 1. Let matchKey be the string "./" concatenated with subpath. - // Note: `package_imports_exports_resolve` does not require the leading dot. - let match_key = &subpath; - // 2. Let resolved be the result of PACKAGE_IMPORTS_EXPORTS_RESOLVE( matchKey, exports, packageURL, false, conditions). - if let Some(path) = self.package_imports_exports_resolve( - match_key, - exports, - package_url, - /* is_imports */ false, - conditions, - ctx, - )? { - // 3. If resolved is not null or undefined, return resolved. - return Ok(Some(path)); - } - } - // 4. Throw a Package Path Not Exported error. - Err(ResolveError::PackagePathNotExported( - subpath.to_string(), - package_url.join("package.json"), - )) - } - - /// PACKAGE_IMPORTS_RESOLVE(specifier, parentURL, conditions) - fn package_imports_resolve( - &self, - specifier: &str, - package_json: &PackageJson, - ctx: &mut Ctx, - ) -> Result, ResolveError> { - // 1. Assert: specifier begins with "#". - debug_assert!(specifier.starts_with('#'), "{specifier}"); - // 2. If specifier is exactly equal to "#" or starts with "#/", then - // 1. Throw an Invalid Module Specifier error. - // 3. Let packageURL be the result of LOOKUP_PACKAGE_SCOPE(parentURL). - // 4. If packageURL is not null, then - - // 1. Let pjson be the result of READ_PACKAGE_JSON(packageURL). - // 2. If pjson.imports is a non-null Object, then - - // 1. Let resolved be the result of PACKAGE_IMPORTS_EXPORTS_RESOLVE( specifier, pjson.imports, packageURL, true, conditions). - let mut has_imports = false; - for imports in package_json.imports_fields(&self.options.imports_fields) { - if !has_imports { - has_imports = true; - // TODO: fill in test case for this case - if specifier == "#" || specifier.starts_with("#/") { - return Err(ResolveError::InvalidModuleSpecifier( - specifier.to_string(), - package_json.path.clone(), - )); - } - } - if let Some(path) = self.package_imports_exports_resolve( - specifier, - imports, - package_json.directory(), - /* is_imports */ true, - &self.options.condition_names, - ctx, - )? { - // 2. If resolved is not null or undefined, return resolved. - return Ok(Some(path)); - } - } - - // 5. Throw a Package Import Not Defined error. - if has_imports { - Err(ResolveError::PackageImportNotDefined( - specifier.to_string(), - package_json.path.clone(), - )) - } else { - Ok(None) - } - } - - /// PACKAGE_IMPORTS_EXPORTS_RESOLVE(matchKey, matchObj, packageURL, isImports, conditions) - fn package_imports_exports_resolve( - &self, - match_key: &str, - match_obj: &JSONMap, - package_url: &Path, - is_imports: bool, - conditions: &[String], - ctx: &mut Ctx, - ) -> ResolveResult { - // enhanced-resolve behaves differently, it throws - // Error: CachedPath to directories is not possible with the exports field (specifier was ./dist/) - if match_key.ends_with('/') { - return Ok(None); - } - // 1. If matchKey is a key of matchObj and does not contain "*", then - if !match_key.contains('*') { - // 1. Let target be the value of matchObj[matchKey]. - if let Some(target) = match_obj.get(match_key) { - // 2. Return the result of PACKAGE_TARGET_RESOLVE(packageURL, target, null, isImports, conditions). - return self.package_target_resolve( - package_url, - match_key, - target, - None, - is_imports, - conditions, - ctx, - ); - } - } - - let mut best_target = None; - let mut best_match = ""; - let mut best_key = ""; - // 2. Let expansionKeys be the list of keys of matchObj containing only a single "*", sorted by the sorting function PATTERN_KEY_COMPARE which orders in descending order of specificity. - // 3. For each key expansionKey in expansionKeys, do - for (expansion_key, target) in match_obj { - if expansion_key.starts_with("./") || expansion_key.starts_with('#') { - // 1. Let patternBase be the substring of expansionKey up to but excluding the first "*" character. - if let Some((pattern_base, pattern_trailer)) = expansion_key.split_once('*') { - // 2. If matchKey starts with but is not equal to patternBase, then - if match_key.starts_with(pattern_base) - // 1. Let patternTrailer be the substring of expansionKey from the index after the first "*" character. - && !pattern_trailer.contains('*') - // 2. If patternTrailer has zero length, or if matchKey ends with patternTrailer and the length of matchKey is greater than or equal to the length of expansionKey, then - && (pattern_trailer.is_empty() - || (match_key.len() >= expansion_key.len() - && match_key.ends_with(pattern_trailer))) - && Self::pattern_key_compare(best_key, expansion_key).is_gt() - { - // 1. Let target be the value of matchObj[expansionKey]. - best_target = Some(target); - // 2. Let patternMatch be the substring of matchKey starting at the index of the length of patternBase up to the length of matchKey minus the length of patternTrailer. - best_match = - &match_key[pattern_base.len()..match_key.len() - pattern_trailer.len()]; - best_key = expansion_key; - } - } else if expansion_key.ends_with('/') - && match_key.starts_with(expansion_key) - && Self::pattern_key_compare(best_key, expansion_key).is_gt() - { - // TODO: [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./dist/" in the "exports" field module resolution of the package at xxx/package.json. - best_target = Some(target); - best_match = &match_key[expansion_key.len()..]; - best_key = expansion_key; - } - } - } - if let Some(best_target) = best_target { - // 3. Return the result of PACKAGE_TARGET_RESOLVE(packageURL, target, patternMatch, isImports, conditions). - return self.package_target_resolve( - package_url, - best_key, - best_target, - Some(best_match), - is_imports, - conditions, - ctx, - ); - } - // 4. Return null. - Ok(None) - } - - /// PACKAGE_TARGET_RESOLVE(packageURL, target, patternMatch, isImports, conditions) - #[allow(clippy::too_many_arguments)] - fn package_target_resolve( - &self, - package_url: &Path, - target_key: &str, - target: &JSONValue, - pattern_match: Option<&str>, - is_imports: bool, - conditions: &[String], - ctx: &mut Ctx, - ) -> ResolveResult { - fn normalize_string_target<'a>( - target_key: &'a str, - target: &'a str, - pattern_match: Option<&'a str>, - package_url: &Path, - ) -> Result, ResolveError> { - let target = if let Some(pattern_match) = pattern_match { - if !target_key.contains('*') && !target.contains('*') { - // enhanced-resolve behaviour - // TODO: [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./dist/" in the "exports" field module resolution of the package at xxx/package.json. - if target_key.ends_with('/') && target.ends_with('/') { - Cow::Owned(format!("{target}{pattern_match}")) - } else { - return Err(ResolveError::InvalidPackageConfigDirectory( - package_url.join("package.json"), - )); - } - } else { - Cow::Owned(target.replace('*', pattern_match)) - } - } else { - Cow::Borrowed(target) - }; - Ok(target) - } - - match target { - // 1. If target is a String, then - JSONValue::String(target) => { - // 1. If target does not start with "./", then - if !target.starts_with("./") { - // 1. If isImports is false, or if target starts with "../" or "/", or if target is a valid URL, then - if !is_imports || target.starts_with("../") || target.starts_with('/') { - // 1. Throw an Invalid Package Target error. - return Err(ResolveError::InvalidPackageTarget( - target.to_string(), - target_key.to_string(), - package_url.join("package.json"), - )); - } - // 2. If patternMatch is a String, then - // 1. Return PACKAGE_RESOLVE(target with every instance of "*" replaced by patternMatch, packageURL + "/"). - let target = - normalize_string_target(target_key, target, pattern_match, package_url)?; - let package_url = self.cache.value(package_url); - // // 3. Return PACKAGE_RESOLVE(target, packageURL + "/"). - return self.package_resolve(&package_url, &target, ctx); - } - - // 2. If target split on "/" or "\" contains any "", ".", "..", or "node_modules" segments after the first "." segment, case insensitive and including percent encoded variants, throw an Invalid Package Target error. - // 3. Let resolvedTarget be the URL resolution of the concatenation of packageURL and target. - // 4. Assert: resolvedTarget is contained in packageURL. - // 5. If patternMatch is null, then - let target = - normalize_string_target(target_key, target, pattern_match, package_url)?; - if Path::new(target.as_ref()).is_invalid_exports_target() { - return Err(ResolveError::InvalidPackageTarget( - target.to_string(), - target_key.to_string(), - package_url.join("package.json"), - )); - } - let resolved_target = package_url.normalize_with(target.as_ref()); - // 6. If patternMatch split on "/" or "\" contains any "", ".", "..", or "node_modules" segments, case insensitive and including percent encoded variants, throw an Invalid Module Specifier error. - // 7. Return the URL resolution of resolvedTarget with every instance of "*" replaced with patternMatch. - let value = self.cache.value(&resolved_target); - return Ok(Some(value)); - } - // 2. Otherwise, if target is a non-null Object, then - JSONValue::Object(target) => { - // 1. If exports contains any index property keys, as defined in ECMA-262 6.1.7 Array Index, throw an Invalid Package Configuration error. - // 2. For each property p of target, in object insertion order as, - for (key, target_value) in target { - // 1. If p equals "default" or conditions contains an entry for p, then - if key == "default" || conditions.contains(key) { - // 1. Let targetValue be the value of the p property in target. - // 2. Let resolved be the result of PACKAGE_TARGET_RESOLVE( packageURL, targetValue, patternMatch, isImports, conditions). - let resolved = self.package_target_resolve( - package_url, - target_key, - target_value, - pattern_match, - is_imports, - conditions, - ctx, - ); - // 3. If resolved is equal to undefined, continue the loop. - if let Some(path) = resolved? { - // 4. Return resolved. - return Ok(Some(path)); - } - } - } - // 3. Return undefined. - return Ok(None); - } - // 3. Otherwise, if target is an Array, then - JSONValue::Array(targets) => { - // 1. If _target.length is zero, return null. - if targets.is_empty() { - // Note: return PackagePathNotExported has the same effect as return because there are no matches. - return Err(ResolveError::PackagePathNotExported( - pattern_match.unwrap_or(".").to_string(), - package_url.join("package.json"), - )); - } - // 2. For each item targetValue in target, do - for (i, target_value) in targets.iter().enumerate() { - // 1. Let resolved be the result of PACKAGE_TARGET_RESOLVE( packageURL, targetValue, patternMatch, isImports, conditions), continuing the loop on any Invalid Package Target error. - let resolved = self.package_target_resolve( - package_url, - target_key, - target_value, - pattern_match, - is_imports, - conditions, - ctx, - ); - - if resolved.is_err() && i == targets.len() { - return resolved; - } - - // 2. If resolved is undefined, continue the loop. - if let Ok(Some(path)) = resolved { - // 3. Return resolved. - return Ok(Some(path)); - } - } - // 3. Return or throw the last fallback resolution null return or error. - // Note: see `resolved.is_err() && i == targets.len()` - } - _ => {} - } - // 4. Otherwise, if target is null, return null. - Ok(None) - // 5. Otherwise throw an Invalid Package Target error. - } - - // Returns (module, subpath) - // https://github.com/nodejs/node/blob/8f0f17e1e3b6c4e58ce748e06343c5304062c491/lib/internal/modules/esm/resolve.js#L688 - fn parse_package_specifier(specifier: &str) -> (&str, &str) { - let mut separator_index = specifier.as_bytes().iter().position(|b| *b == b'/'); - // let mut valid_package_name = true; - // let mut is_scoped = false; - if specifier.starts_with('@') { - // is_scoped = true; - if separator_index.is_none() || specifier.is_empty() { - // valid_package_name = false; - } else if let Some(index) = &separator_index { - separator_index = specifier[*index + 1..] - .as_bytes() - .iter() - .position(|b| *b == b'/') - .map(|i| i + *index + 1); - } - } - let package_name = - separator_index.map_or(specifier, |separator_index| &specifier[..separator_index]); - - // TODO: https://github.com/nodejs/node/blob/8f0f17e1e3b6c4e58ce748e06343c5304062c491/lib/internal/modules/esm/resolve.js#L705C1-L714C1 - // Package name cannot have leading . and cannot have percent-encoding or - // \\ separators. - // if (RegExpPrototypeExec(invalidPackageNameRegEx, packageName) !== null) - // validPackageName = false; - - // if (!validPackageName) { - // throw new ERR_INVALID_MODULE_SPECIFIER( - // specifier, 'is not a valid package name', fileURLToPath(base)); - // } - let package_subpath = - separator_index.map_or("", |separator_index| &specifier[separator_index..]); - (package_name, package_subpath) - } - - /// PATTERN_KEY_COMPARE(keyA, keyB) - fn pattern_key_compare(key_a: &str, key_b: &str) -> Ordering { - if key_a.is_empty() { - return Ordering::Greater; - } - // 1. Assert: keyA ends with "/" or contains only a single "*". - debug_assert!(key_a.ends_with('/') || key_a.match_indices('*').count() == 1, "{key_a}"); - // 2. Assert: keyB ends with "/" or contains only a single "*". - debug_assert!(key_b.ends_with('/') || key_b.match_indices('*').count() == 1, "{key_b}"); - // 3. Let baseLengthA be the index of "*" in keyA plus one, if keyA contains "*", or the length of keyA otherwise. - let a_pos = key_a.chars().position(|c| c == '*'); - let base_length_a = a_pos.map_or(key_a.len(), |p| p + 1); - // 4. Let baseLengthB be the index of "*" in keyB plus one, if keyB contains "*", or the length of keyB otherwise. - let b_pos = key_b.chars().position(|c| c == '*'); - let base_length_b = b_pos.map_or(key_b.len(), |p| p + 1); - // 5. If baseLengthA is greater than baseLengthB, return -1. - if base_length_a > base_length_b { - return Ordering::Less; - } - // 6. If baseLengthB is greater than baseLengthA, return 1. - if base_length_b > base_length_a { - return Ordering::Greater; - } - // 7. If keyA does not contain "*", return 1. - if !key_a.contains('*') { - return Ordering::Greater; - } - // 8. If keyB does not contain "*", return -1. - if !key_b.contains('*') { - return Ordering::Less; - } - // 9. If the length of keyA is greater than the length of keyB, return -1. - if key_a.len() > key_b.len() { - return Ordering::Less; - } - // 10. If the length of keyB is greater than the length of keyA, return 1. - if key_b.len() > key_a.len() { - return Ordering::Greater; - } - // 11. Return 0. - Ordering::Equal - } - - fn strip_package_name<'a>(specifier: &'a str, package_name: &'a str) -> Option<&'a str> { - specifier - .strip_prefix(package_name) - .filter(|tail| tail.is_empty() || tail.starts_with(SLASH_START)) - } -} diff --git a/src/options.rs b/src/options.rs deleted file mode 100644 index f473a133..00000000 --- a/src/options.rs +++ /dev/null @@ -1,623 +0,0 @@ -use std::path::Path; -use std::{fmt, path::PathBuf}; - -/// Module Resolution Options -/// -/// Options are directly ported from [enhanced-resolve](https://github.com/webpack/enhanced-resolve#resolver-options). -/// -/// See [webpack resolve](https://webpack.js.org/configuration/resolve/) for information and examples -#[derive(Debug, Clone)] -pub struct ResolveOptions { - /// Path to TypeScript configuration file. - /// - /// Default `None` - pub tsconfig: Option, - - /// Create aliases to import or require certain modules more easily. - /// - /// An alias is used to replace a whole path or part of a path. - /// For example, to alias a commonly used `src/` folders: `vec![("@/src"), vec![AliasValue::Path("/path/to/src")]]` - /// - /// A trailing $ can also be added to the given object's keys to signify an exact match. - /// - /// See [webpack's `resolve.alias` documentation](https://webpack.js.org/configuration/resolve/#resolvealias) for a list of use cases. - pub alias: Alias, - - /// A list of alias fields in description files. - /// - /// Specify a field, such as `browser`, to be parsed according to [this specification](https://github.com/defunctzombie/package-browser-field-spec). - /// Can be a path to json object such as `["path", "to", "exports"]`. - /// - /// Default `[]` - pub alias_fields: Vec>, - - /// Condition names for exports field which defines entry points of a package. - /// - /// The key order in the exports field is significant. During condition matching, earlier entries have higher priority and take precedence over later entries. - /// - /// Default `[]` - pub condition_names: Vec, - - /// The JSON files to use for descriptions. (There was once a `bower.json`.) - /// - /// Default `["package.json"]` - pub description_files: Vec, - - /// Set to [EnforceExtension::Enabled] for [ESM Mandatory file extensions](https://nodejs.org/api/esm.html#mandatory-file-extensions). - /// - /// If `enforce_extension` is set to [EnforceExtension::Enabled], resolution will not allow extension-less files. - /// This means `require('./foo.js')` will resolve, while `require('./foo')` will not. - /// - /// The default value for `enforce_extension` is [EnforceExtension::Auto], which is changed upon initialization. - /// - /// It changes to [EnforceExtension::Enabled] if [ResolveOptions::extensions] contains an empty string; - /// otherwise, this value changes to [EnforceExtension::Disabled]. - /// - /// Explicitly set the value to [EnforceExtension::Disabled] to disable this automatic behavior. - /// - /// For reference, this behavior is aligned with `enhanced-resolve`. See . - pub enforce_extension: EnforceExtension, - - /// A list of exports fields in description files. - /// - /// Can be a path to a JSON object such as `["path", "to", "exports"]`. - /// - /// Default `[["exports"]]`. - pub exports_fields: Vec>, - - /// Fields from `package.json` which are used to provide the internal requests of a package - /// (requests starting with # are considered internal). - /// - /// Can be a path to a JSON object such as `["path", "to", "imports"]`. - /// - /// Default `[["imports"]]`. - pub imports_fields: Vec>, - - /// An object which maps extension to extension aliases. - /// - /// Default `{}` - pub extension_alias: Vec<(String, Vec)>, - - /// Attempt to resolve these extensions in order. - /// - /// If multiple files share the same name but have different extensions, - /// will resolve the one with the extension listed first in the array and skip the rest. - /// - /// All extensions must have a leading dot. - /// - /// Default `[".js", ".json", ".node"]` - pub extensions: Vec, - - /// Redirect module requests when normal resolving fails. - /// - /// Default `[]` - pub fallback: Alias, - - /// 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). - /// - /// See also webpack configuration [resolve.fullySpecified](https://webpack.js.org/configuration/module/#resolvefullyspecified) - /// - /// Default `false` - pub fully_specified: bool, - - /// A list of main fields in description files - /// - /// Default `["main"]`. - pub main_fields: Vec, - - /// The filename to be used while resolving directories. - /// - /// Default `["index"]` - pub main_files: Vec, - - /// A list of directories to resolve modules from, can be absolute path or folder name. - /// - /// Default `["node_modules"]` - pub modules: Vec, - - /// Resolve to a context instead of a file. - /// - /// Default `false` - pub resolve_to_context: bool, - - /// Prefer to resolve module requests as relative requests instead of using modules from node_modules directories. - /// - /// Default `false` - pub prefer_relative: bool, - - /// Prefer to resolve server-relative urls as absolute paths before falling back to resolve in ResolveOptions::roots. - /// - /// Default `false` - pub prefer_absolute: bool, - - /// A list of resolve restrictions to restrict the paths that a request can be resolved on. - /// - /// Default `[]` - pub restrictions: Vec, - - /// A list of directories where requests of server-relative URLs (starting with '/') are resolved. - /// On non-Windows systems these requests are resolved as an absolute path first. - /// - /// Default `[]` - pub roots: Vec, - - /// Whether to resolve symlinks to their symlinked location. - /// When enabled, symlinked resources are resolved to their real path, not their symlinked location. - /// Note that this may cause module resolution to fail when using tools that symlink packages (like npm link). - /// - /// Default `true` - pub symlinks: bool, - - /// Whether to parse [module.builtinModules](https://nodejs.org/api/module.html#modulebuiltinmodules) or not. - /// For example, "zlib" will throw [crate::ResolveError::Builtin] when set to true. - /// - /// Default `false` - pub builtin_modules: bool, -} - -impl ResolveOptions { - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// - /// let options = ResolveOptions::default().with_condition_names(&["bar"]); - /// assert_eq!(options.condition_names, vec!["bar".to_string()]) - /// ``` - #[must_use] - pub fn with_condition_names(mut self, names: &[&str]) -> Self { - self.condition_names = names.iter().map(ToString::to_string).collect::>(); - self - } - - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// - /// let options = ResolveOptions::default().with_builtin_modules(false); - /// assert_eq!(options.builtin_modules, false) - /// ``` - #[must_use] - pub fn with_builtin_modules(mut self, flag: bool) -> Self { - self.builtin_modules = flag; - self - } - - /// Adds a single root to the options - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_root("foo"); - /// assert_eq!(options.roots, vec![PathBuf::from("foo")]) - /// ``` - #[must_use] - pub fn with_root>(mut self, root: P) -> Self { - self.roots.push(root.as_ref().to_path_buf()); - self - } - - /// Adds a single extension to the list of extensions - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_extension("jsonc"); - /// assert!(options.extensions.contains(&"jsonc".to_string())); - /// ``` - #[must_use] - pub fn with_extension>(mut self, extension: S) -> Self { - self.extensions.push(extension.into()); - self - } - - /// Adds a single main field to the list of fields - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_main_field("something"); - /// assert!(options.main_fields.contains(&"something".to_string())); - /// ``` - #[must_use] - pub fn with_main_field>(mut self, field: S) -> Self { - self.main_fields.push(field.into()); - self - } - - /// Changes how the extension should be treated - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions, EnforceExtension}; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_force_extension(EnforceExtension::Enabled); - /// assert_eq!(options.enforce_extension, EnforceExtension::Enabled); - /// ``` - #[must_use] - pub fn with_force_extension(mut self, enforce_extension: EnforceExtension) -> Self { - self.enforce_extension = enforce_extension; - self - } - - /// Sets the value for [ResolveOptions::fully_specified] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_fully_specified(true); - /// assert_eq!(options.fully_specified, true); - /// ``` - #[must_use] - pub fn with_fully_specified(mut self, fully_specified: bool) -> Self { - self.fully_specified = fully_specified; - self - } - /// Sets the value for [ResolveOptions::prefer_relative] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_prefer_relative(true); - /// assert_eq!(options.prefer_relative, true); - /// ``` - #[must_use] - pub fn with_prefer_relative(mut self, flag: bool) -> Self { - self.prefer_relative = flag; - self - } - /// Sets the value for [ResolveOptions::prefer_absolute] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_prefer_absolute(true); - /// assert_eq!(options.prefer_absolute, true); - /// ``` - #[must_use] - pub fn with_prefer_absolute(mut self, flag: bool) -> Self { - self.prefer_absolute = flag; - self - } - - /// Changes the value of [ResolveOptions::symlinks] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// - /// let options = ResolveOptions::default().with_symbolic_link(false); - /// assert_eq!(options.symlinks, false); - /// ``` - #[must_use] - pub fn with_symbolic_link(mut self, flag: bool) -> Self { - self.symlinks = flag; - self - } - - /// Adds a module to [ResolveOptions::modules] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// - /// let options = ResolveOptions::default().with_module("module"); - /// assert!(options.modules.contains(&"module".to_string())); - /// ``` - #[must_use] - pub fn with_module>(mut self, module: M) -> Self { - self.modules.push(module.into()); - self - } - - /// Adds a main file to [ResolveOptions::main_files] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// - /// let options = ResolveOptions::default().with_main_file("foo"); - /// assert!(options.main_files.contains(&"foo".to_string())); - /// ``` - #[must_use] - pub fn with_main_file>(mut self, module: M) -> Self { - self.main_files.push(module.into()); - self - } - - pub(crate) fn sanitize(mut self) -> Self { - debug_assert!( - self.extensions.iter().filter(|e| !e.is_empty()).all(|e| e.starts_with('.')), - "All extensions must start with a leading dot" - ); - // Set `enforceExtension` to `true` when [ResolveOptions::extensions] contains an empty string. - // See - if self.enforce_extension == EnforceExtension::Auto { - if !self.extensions.is_empty() && self.extensions.iter().any(String::is_empty) { - self.enforce_extension = EnforceExtension::Enabled; - } else { - self.enforce_extension = EnforceExtension::Disabled; - } - } - self - } -} - -/// Value for [ResolveOptions::enforce_extension] -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -pub enum EnforceExtension { - Auto, - Enabled, - Disabled, -} - -impl EnforceExtension { - pub const fn is_auto(&self) -> bool { - matches!(self, Self::Auto) - } - - pub const fn is_enabled(&self) -> bool { - matches!(self, Self::Enabled) - } - - pub const fn is_disabled(&self) -> bool { - matches!(self, Self::Disabled) - } -} - -/// Alias for [ResolveOptions::alias] and [ResolveOptions::fallback] -pub type Alias = Vec<(String, Vec)>; - -/// Alias Value for [ResolveOptions::alias] and [ResolveOptions::fallback] -#[derive(Debug, Clone, Hash, PartialEq, Eq)] -pub enum AliasValue { - /// The path value - Path(String), - - /// The `false` value - Ignore, -} - -impl From for AliasValue -where - S: Into, -{ - fn from(value: S) -> Self { - Self::Path(value.into()) - } -} - -/// Value for [ResolveOptions::restrictions] -#[derive(Debug, Clone)] -pub enum Restriction { - Path(PathBuf), - RegExp(String), -} - -/// Tsconfig Options for [ResolveOptions::tsconfig] -/// -/// Derived from [tsconfig-paths-webpack-plugin](https://github.com/dividab/tsconfig-paths-webpack-plugin#options) -#[derive(Debug, Clone)] -pub struct TsconfigOptions { - /// Allows you to specify where to find the TypeScript configuration file. - /// You may provide - /// * a relative path to the configuration file. It will be resolved relative to cwd. - /// * an absolute path to the configuration file. - pub config_file: PathBuf, - - /// Support for Typescript Project References. - pub references: TsconfigReferences, -} - -/// Configuration for [TsconfigOptions::references] -#[derive(Debug, Clone)] -pub enum TsconfigReferences { - Disabled, - /// Use the `references` field from tsconfig of `config_file`. - Auto, - /// Manually provided relative or absolute path. - Paths(Vec), -} - -impl Default for ResolveOptions { - fn default() -> Self { - Self { - tsconfig: None, - alias: vec![], - alias_fields: vec![], - condition_names: vec![], - description_files: vec!["package.json".into()], - enforce_extension: EnforceExtension::Auto, - extension_alias: vec![], - exports_fields: vec![vec!["exports".into()]], - imports_fields: vec![vec!["imports".into()]], - extensions: vec![".js".into(), ".json".into(), ".node".into()], - fallback: vec![], - fully_specified: false, - main_fields: vec!["main".into()], - main_files: vec!["index".into()], - modules: vec!["node_modules".into()], - resolve_to_context: false, - prefer_relative: false, - prefer_absolute: false, - restrictions: vec![], - roots: vec![], - symlinks: true, - builtin_modules: false, - } - } -} - -// For tracing -impl fmt::Display for ResolveOptions { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - if let Some(tsconfig) = &self.tsconfig { - write!(f, "tsconfig:{tsconfig:?},")?; - } - if !self.alias.is_empty() { - write!(f, "alias:{:?},", self.alias)?; - } - if !self.alias_fields.is_empty() { - write!(f, "alias_fields:{:?},", self.alias_fields)?; - } - if !self.condition_names.is_empty() { - write!(f, "condition_names:{:?},", self.condition_names)?; - } - if self.enforce_extension.is_enabled() { - write!(f, "enforce_extension:{:?},", self.enforce_extension)?; - } - if !self.exports_fields.is_empty() { - write!(f, "exports_fields:{:?},", self.exports_fields)?; - } - if !self.imports_fields.is_empty() { - write!(f, "imports_fields:{:?},", self.imports_fields)?; - } - if !self.extension_alias.is_empty() { - write!(f, "extension_alias:{:?},", self.extension_alias)?; - } - if !self.extensions.is_empty() { - write!(f, "extensions:{:?},", self.extensions)?; - } - if !self.fallback.is_empty() { - write!(f, "fallback:{:?},", self.fallback)?; - } - if self.fully_specified { - write!(f, "fully_specified:{:?},", self.fully_specified)?; - } - if !self.main_fields.is_empty() { - write!(f, "main_fields:{:?},", self.main_fields)?; - } - if !self.main_files.is_empty() { - write!(f, "main_files:{:?},", self.main_files)?; - } - if !self.modules.is_empty() { - write!(f, "modules:{:?},", self.modules)?; - } - if self.resolve_to_context { - write!(f, "resolve_to_context:{:?},", self.resolve_to_context)?; - } - if self.prefer_relative { - write!(f, "prefer_relative:{:?},", self.prefer_relative)?; - } - if self.prefer_absolute { - write!(f, "prefer_absolute:{:?},", self.prefer_absolute)?; - } - if !self.restrictions.is_empty() { - write!(f, "restrictions:{:?},", self.restrictions)?; - } - if !self.roots.is_empty() { - write!(f, "roots:{:?},", self.roots)?; - } - if self.symlinks { - write!(f, "symlinks:{:?},", self.symlinks)?; - } - if self.builtin_modules { - write!(f, "builtin_modules:{:?},", self.builtin_modules)?; - } - Ok(()) - } -} - -#[cfg(test)] -mod test { - use super::{ - AliasValue, EnforceExtension, ResolveOptions, Restriction, TsconfigOptions, - TsconfigReferences, - }; - use std::path::PathBuf; - - #[test] - fn enforce_extension() { - assert!(EnforceExtension::Auto.is_auto()); - assert!(!EnforceExtension::Enabled.is_auto()); - assert!(!EnforceExtension::Disabled.is_auto()); - - assert!(!EnforceExtension::Auto.is_enabled()); - assert!(EnforceExtension::Enabled.is_enabled()); - assert!(!EnforceExtension::Disabled.is_enabled()); - - assert!(!EnforceExtension::Auto.is_disabled()); - assert!(!EnforceExtension::Enabled.is_disabled()); - assert!(EnforceExtension::Disabled.is_disabled()); - } - - #[test] - fn display() { - let options = ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: PathBuf::from("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - alias: vec![("a".into(), vec![AliasValue::Ignore])], - alias_fields: vec![vec!["browser".into()]], - condition_names: vec!["require".into()], - enforce_extension: EnforceExtension::Enabled, - extension_alias: vec![(".js".into(), vec![".ts".into()])], - exports_fields: vec![vec!["exports".into()]], - imports_fields: vec![vec!["imports".into()]], - fallback: vec![("fallback".into(), vec![AliasValue::Ignore])], - fully_specified: true, - resolve_to_context: true, - prefer_relative: true, - prefer_absolute: true, - restrictions: vec![Restriction::Path(PathBuf::from("restrictions"))], - roots: vec![PathBuf::from("roots")], - builtin_modules: true, - ..ResolveOptions::default() - }; - - let expected = r#"tsconfig:TsconfigOptions { config_file: "tsconfig.json", references: Auto },alias:[("a", [Ignore])],alias_fields:[["browser"]],condition_names:["require"],enforce_extension:Enabled,exports_fields:[["exports"]],imports_fields:[["imports"]],extension_alias:[(".js", [".ts"])],extensions:[".js", ".json", ".node"],fallback:[("fallback", [Ignore])],fully_specified:true,main_fields:["main"],main_files:["index"],modules:["node_modules"],resolve_to_context:true,prefer_relative:true,prefer_absolute:true,restrictions:[Path("restrictions")],roots:["roots"],symlinks:true,builtin_modules:true,"#; - assert_eq!(format!("{options}"), expected); - - let options = ResolveOptions { - alias: vec![], - alias_fields: vec![], - builtin_modules: false, - condition_names: vec![], - description_files: vec![], - enforce_extension: EnforceExtension::Disabled, - exports_fields: vec![], - extension_alias: vec![], - extensions: vec![], - fallback: vec![], - fully_specified: false, - imports_fields: vec![], - main_fields: vec![], - main_files: vec![], - modules: vec![], - prefer_absolute: false, - prefer_relative: false, - resolve_to_context: false, - restrictions: vec![], - roots: vec![], - symlinks: false, - tsconfig: None, - }; - - assert_eq!(format!("{options}"), ""); - } -} diff --git a/src/package_json.rs b/src/package_json.rs deleted file mode 100644 index 73901faa..00000000 --- a/src/package_json.rs +++ /dev/null @@ -1,207 +0,0 @@ -//! package.json definitions -//! -//! Code related to export field are copied from [Parcel's resolver](https://github.com/parcel-bundler/parcel/blob/v2/packages/utils/node-resolver-rs/src/package_json.rs) -use std::path::{Path, PathBuf}; - -use serde_json::Value as JSONValue; - -use crate::{path::PathUtil, ResolveError}; - -pub type JSONMap = serde_json::Map; - -/// Deserialized package.json -#[derive(Debug, Default)] -pub struct PackageJson { - /// Path to `package.json`. Contains the `package.json` filename. - pub path: PathBuf, - - /// Realpath to `package.json`. Contains the `package.json` filename. - pub realpath: PathBuf, - - /// The "name" field defines your package's name. - /// The "name" field can be used in addition to the "exports" field to self-reference a package using its name. - /// - /// - pub name: Option, - - raw_json: std::sync::Arc, -} - -impl PackageJson { - /// # Panics - /// # Errors - pub(crate) fn parse( - path: PathBuf, - realpath: PathBuf, - json: &str, - ) -> Result { - let mut raw_json: JSONValue = serde_json::from_str(json)?; - let mut package_json = Self::default(); - - if let Some(json_object) = raw_json.as_object_mut() { - // Remove large fields that are useless for pragmatic use. - #[cfg(feature = "package_json_raw_json_api")] - { - json_object.remove("description"); - json_object.remove("keywords"); - json_object.remove("scripts"); - json_object.remove("dependencies"); - json_object.remove("devDependencies"); - json_object.remove("peerDependencies"); - json_object.remove("optionalDependencies"); - } - - // Add name. - package_json.name = - json_object.get("name").and_then(|field| field.as_str()).map(ToString::to_string); - } - - package_json.path = path; - package_json.realpath = realpath; - package_json.raw_json = std::sync::Arc::new(raw_json); - Ok(package_json) - } - - fn get_value_by_path<'a>( - fields: &'a serde_json::Map, - path: &[String], - ) -> Option<&'a JSONValue> { - if path.is_empty() { - return None; - } - let mut value = fields.get(&path[0])?; - for key in path.iter().skip(1) { - if let Some(inner_value) = value.as_object().and_then(|o| o.get(key)) { - value = inner_value; - } else { - return None; - } - } - Some(value) - } - - /// Raw serde json value of `package.json`. - /// - /// This is currently used in Rspack for: - /// * getting the `sideEffects` field - /// * query in - search on GitHub indicates query on the `type` field. - /// - /// To reduce overall memory consumption, large fields that useless for pragmatic use are removed. - /// They are: `description`, `keywords`, `scripts`, - /// `dependencies` and `devDependencies`, `peerDependencies`, `optionalDependencies`. - #[cfg(feature = "package_json_raw_json_api")] - pub fn raw_json(&self) -> &std::sync::Arc { - &self.raw_json - } - - /// Directory to `package.json` - /// - /// # Panics - /// - /// * When the package.json path is misconfigured. - pub fn directory(&self) -> &Path { - debug_assert!(self.realpath.file_name().is_some_and(|x| x == "package.json")); - self.realpath.parent().unwrap() - } - - /// The "main" field defines the entry point of a package when imported by name via a node_modules lookup. Its value is a path. - /// - /// When a package has an "exports" field, this will take precedence over the "main" field when importing the package by name. - /// - /// Values are dynamically retrieved from [ResolveOptions::main_fields]. - /// - /// - pub(crate) fn main_fields<'a>( - &'a self, - main_fields: &'a [String], - ) -> impl Iterator + '_ { - main_fields - .iter() - .filter_map(|main_field| self.raw_json.get(main_field)) - .filter_map(|value| value.as_str()) - } - - /// The "exports" field allows defining the entry points of a package when imported by name loaded either via a node_modules lookup or a self-reference to its own name. - /// - /// - pub(crate) fn exports_fields<'a>( - &'a self, - exports_fields: &'a [Vec], - ) -> impl Iterator + '_ { - exports_fields.iter().filter_map(|object_path| { - self.raw_json - .as_object() - .and_then(|json_object| Self::get_value_by_path(json_object, object_path)) - }) - } - - /// In addition to the "exports" field, there is a package "imports" field to create private mappings that only apply to import specifiers from within the package itself. - /// - /// - pub(crate) fn imports_fields<'a>( - &'a self, - imports_fields: &'a [Vec], - ) -> impl Iterator + '_ { - imports_fields.iter().filter_map(|object_path| { - self.raw_json - .as_object() - .and_then(|json_object| Self::get_value_by_path(json_object, object_path)) - .and_then(|value| value.as_object()) - }) - } - - /// The "browser" field is provided by a module author as a hint to javascript bundlers or component tools when packaging modules for client side use. - /// Multiple values are configured by [ResolveOptions::alias_fields]. - /// - /// - fn browser_fields<'a>( - &'a self, - alias_fields: &'a [Vec], - ) -> impl Iterator + '_ { - alias_fields.iter().filter_map(|object_path| { - self.raw_json - .as_object() - .and_then(|json_object| Self::get_value_by_path(json_object, object_path)) - // Only object is valid, all other types are invalid - // https://github.com/webpack/enhanced-resolve/blob/3a28f47788de794d9da4d1702a3a583d8422cd48/lib/AliasFieldPlugin.js#L44-L52 - .and_then(|value| value.as_object()) - }) - } - - /// Resolve the request string for this package.json by looking at the `browser` field. - /// - /// # Errors - /// - /// * Returns [ResolveError::Ignored] for `"path": false` in `browser` field. - pub(crate) fn resolve_browser_field<'a>( - &'a self, - path: &Path, - request: Option<&str>, - alias_fields: &'a [Vec], - ) -> Result, ResolveError> { - for object in self.browser_fields(alias_fields) { - if let Some(request) = request { - if let Some(value) = object.get(request) { - return Self::alias_value(path, value); - } - } else { - let dir = self.path.parent().unwrap(); - for (key, value) in object { - let joined = dir.normalize_with(key); - if joined == path { - return Self::alias_value(path, value); - } - } - } - } - Ok(None) - } - - fn alias_value<'a>(key: &Path, value: &'a JSONValue) -> Result, ResolveError> { - match value { - JSONValue::String(value) => Ok(Some(value.as_str())), - JSONValue::Bool(b) if !b => Err(ResolveError::Ignored(key.to_path_buf())), - _ => Ok(None), - } - } -} diff --git a/src/path.rs b/src/path.rs deleted file mode 100644 index f66fdd76..00000000 --- a/src/path.rs +++ /dev/null @@ -1,132 +0,0 @@ -//! Path Utilities -//! -//! Code adapted from the following libraries -//! * [path-absolutize](https://docs.rs/path-absolutize) -//! * [normalize_path](https://docs.rs/normalize-path) -use std::path::{Component, Path, PathBuf}; - -pub const SLASH_START: &[char; 2] = &['/', '\\']; - -/// Extension trait to add path normalization to std's [`Path`]. -pub trait PathUtil { - /// Normalize this path without performing I/O. - /// - /// All redundant separator and up-level references are collapsed. - /// - /// However, this does not resolve links. - fn normalize(&self) -> PathBuf; - - /// Normalize with subpath assuming this path is normalized without performing I/O. - /// - /// All redundant separator and up-level references are collapsed. - /// - /// However, this does not resolve links. - fn normalize_with>(&self, subpath: P) -> PathBuf; - - /// Defined in ESM PACKAGE_TARGET_RESOLVE - /// If target split on "/" or "\" contains any "", ".", "..", or "node_modules" segments after the first "." segment, case insensitive and including percent encoded variants - fn is_invalid_exports_target(&self) -> bool; -} - -impl PathUtil for Path { - // https://github.com/parcel-bundler/parcel/blob/e0b99c2a42e9109a9ecbd6f537844a1b33e7faf5/packages/utils/node-resolver-rs/src/path.rs#L7 - fn normalize(&self) -> PathBuf { - let mut components = self.components().peekable(); - let mut ret = if let Some(c @ Component::Prefix(..)) = components.peek() { - let buf = PathBuf::from(c.as_os_str()); - components.next(); - buf - } else { - PathBuf::new() - }; - - for component in components { - match component { - Component::Prefix(..) => unreachable!("Path {:?}", self), - Component::RootDir => { - ret.push(component.as_os_str()); - } - Component::CurDir => {} - Component::ParentDir => { - ret.pop(); - } - Component::Normal(c) => { - ret.push(c); - } - } - } - - ret - } - - // https://github.com/parcel-bundler/parcel/blob/e0b99c2a42e9109a9ecbd6f537844a1b33e7faf5/packages/utils/node-resolver-rs/src/path.rs#L37 - fn normalize_with>(&self, subpath: B) -> PathBuf { - let subpath = subpath.as_ref(); - - let mut components = subpath.components(); - - let Some(head) = components.next() else { return subpath.to_path_buf() }; - - if matches!(head, Component::Prefix(..) | Component::RootDir) { - return subpath.to_path_buf(); - } - - let mut ret = self.to_path_buf(); - for component in std::iter::once(head).chain(components) { - match component { - Component::CurDir => {} - Component::ParentDir => { - ret.pop(); - } - Component::Normal(c) => { - ret.push(c); - } - Component::Prefix(..) | Component::RootDir => { - unreachable!("Path {:?} Subpath {:?}", self, subpath) - } - } - } - - ret - } - - fn is_invalid_exports_target(&self) -> bool { - self.components().enumerate().any(|(index, c)| match c { - Component::ParentDir => true, - Component::CurDir => index > 0, - Component::Normal(c) => c.eq_ignore_ascii_case("node_modules"), - _ => false, - }) - } -} - -// https://github.com/webpack/enhanced-resolve/blob/main/test/path.test.js -#[test] -fn is_invalid_exports_target() { - let test_cases = [ - "../a.js", - "../", - "./a/b/../../../c.js", - "./a/b/../../../", - "./../../c.js", - "./../../", - "./a/../b/../../c.js", - "./a/../b/../../", - "./././../", - ]; - - for case in test_cases { - assert!(Path::new(case).is_invalid_exports_target(), "{case}"); - } - - assert!(!Path::new("C:").is_invalid_exports_target()); - assert!(!Path::new("/").is_invalid_exports_target()); -} - -#[test] -fn normalize() { - assert_eq!(Path::new("/foo/.././foo/").normalize(), Path::new("/foo")); - assert_eq!(Path::new("C://").normalize(), Path::new("C://")); - assert_eq!(Path::new("C:").normalize(), Path::new("C:")); - assert_eq!(Path::new(r"\\server\share").normalize(), Path::new(r"\\server\share")); -} diff --git a/src/resolution.rs b/src/resolution.rs deleted file mode 100644 index a3aaa2e7..00000000 --- a/src/resolution.rs +++ /dev/null @@ -1,92 +0,0 @@ -use crate::package_json::PackageJson; -use std::{ - fmt, - path::{Path, PathBuf}, - sync::Arc, -}; - -/// The final path resolution with optional `?query` and `#fragment` -#[derive(Clone)] -pub struct Resolution { - pub(crate) path: PathBuf, - - /// path query `?query`, contains `?`. - pub(crate) query: Option, - - /// path fragment `#query`, contains `#`. - pub(crate) fragment: Option, - - pub(crate) package_json: Option>, -} - -impl fmt::Debug for Resolution { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - f.debug_struct("Resolution") - .field("path", &self.path) - .field("query", &self.query) - .field("fragment", &self.fragment) - .field("package_json", &self.package_json.as_ref().map(|p| &p.path)) - .finish() - } -} - -impl PartialEq for Resolution { - fn eq(&self, other: &Self) -> bool { - self.path == other.path && self.query == other.query && self.fragment == other.fragment - } -} -impl Eq for Resolution {} - -impl Resolution { - /// Returns the path without query and fragment - pub fn path(&self) -> &Path { - &self.path - } - - /// Returns the path without query and fragment - pub fn into_path_buf(self) -> PathBuf { - self.path - } - - /// Returns the path query `?query`, contains the leading `?` - pub fn query(&self) -> Option<&str> { - self.query.as_deref() - } - - /// Returns the path fragment `#fragment`, contains the leading `#` - pub fn fragment(&self) -> Option<&str> { - self.fragment.as_deref() - } - - /// Returns serialized package_json - pub fn package_json(&self) -> Option<&Arc> { - self.package_json.as_ref() - } - - /// Returns the full path with query and fragment - pub fn full_path(&self) -> PathBuf { - let mut path = self.path.clone().into_os_string(); - if let Some(query) = &self.query { - path.push(query); - } - if let Some(fragment) = &self.fragment { - path.push(fragment); - } - PathBuf::from(path) - } -} - -#[test] -fn test() { - let resolution = Resolution { - path: PathBuf::from("foo"), - query: Some("?query".to_string()), - fragment: Some("#fragment".to_string()), - package_json: None, - }; - assert_eq!(resolution.path(), Path::new("foo")); - assert_eq!(resolution.query(), Some("?query")); - assert_eq!(resolution.fragment(), Some("#fragment")); - assert_eq!(resolution.full_path(), PathBuf::from("foo?query#fragment")); - assert_eq!(resolution.into_path_buf(), PathBuf::from("foo")); -} diff --git a/src/specifier.rs b/src/specifier.rs deleted file mode 100644 index 3d35eafc..00000000 --- a/src/specifier.rs +++ /dev/null @@ -1,230 +0,0 @@ -use crate::error::SpecifierError; -use std::borrow::Cow; - -#[derive(Debug)] -pub struct Specifier<'a> { - path: Cow<'a, str>, - pub query: Option<&'a str>, - pub fragment: Option<&'a str>, -} - -impl<'a> Specifier<'a> { - pub fn path(&'a self) -> &'a str { - self.path.as_ref() - } - - pub fn parse(specifier: &'a str) -> Result, SpecifierError> { - if specifier.is_empty() { - return Err(SpecifierError::Empty(specifier.to_string())); - } - let offset = match specifier.as_bytes()[0] { - b'/' | b'.' | b'#' => 1, - _ => 0, - }; - let (path, query, fragment) = Self::parse_query_framgment(specifier, offset); - if path.is_empty() { - return Err(SpecifierError::Empty(specifier.to_string())); - } - Ok(Self { path, query, fragment }) - } - - fn parse_query_framgment( - specifier: &'a str, - skip: usize, - ) -> (Cow<'a, str>, Option<&str>, Option<&str>) { - let mut query_start: Option = None; - let mut fragment_start: Option = None; - - let mut prev = specifier.chars().next().unwrap(); - let mut escaped_indexes = vec![]; - for (i, c) in specifier.char_indices().skip(skip) { - if c == '?' && query_start.is_none() { - query_start = Some(i); - } - if c == '#' { - if prev == '\0' { - escaped_indexes.push(i - 1); - } else { - fragment_start = Some(i); - break; - } - } - prev = c; - } - - let (path, query, fragment) = match (query_start, fragment_start) { - (Some(i), Some(j)) => { - debug_assert!(i < j); - (&specifier[..i], Some(&specifier[i..j]), Some(&specifier[j..])) - } - (Some(i), None) => (&specifier[..i], Some(&specifier[i..]), None), - (None, Some(j)) => (&specifier[..j], None, Some(&specifier[j..])), - _ => (specifier, None, None), - }; - - let path = if escaped_indexes.is_empty() { - Cow::Borrowed(path) - } else { - // Remove the `\0` characters for a legal path. - Cow::Owned( - path.chars() - .enumerate() - .filter_map(|(i, c)| (!escaped_indexes.contains(&i)).then_some(c)) - .collect::(), - ) - }; - - (path, query, fragment) - } -} - -#[cfg(test)] -mod tests { - use super::{Specifier, SpecifierError}; - - #[test] - fn debug() { - let specifier = Specifier::parse("/").unwrap(); - assert_eq!( - format!("{specifier:?}"), - r#"Specifier { path: "/", query: None, fragment: None }"# - ); - } - - #[test] - fn empty() { - let specifiers = ["", "?"]; - for specifier in specifiers { - let error = Specifier::parse(specifier).unwrap_err(); - assert_eq!(error, SpecifierError::Empty(specifier.to_string())); - } - } - - #[test] - fn absolute() -> Result<(), SpecifierError> { - let specifier = "/test?#"; - let parsed = Specifier::parse(specifier)?; - assert_eq!(parsed.path, "/test"); - assert_eq!(parsed.query, Some("?")); - assert_eq!(parsed.fragment, Some("#")); - Ok(()) - } - - #[test] - fn relative() -> Result<(), SpecifierError> { - let specifiers = ["./test", "../test", "../../test"]; - for specifier in specifiers { - let mut r = specifier.to_string(); - r.push_str("?#"); - let parsed = Specifier::parse(&r)?; - assert_eq!(parsed.path, specifier); - assert_eq!(parsed.query, Some("?")); - assert_eq!(parsed.fragment, Some("#")); - } - Ok(()) - } - - #[test] - fn hash() -> Result<(), SpecifierError> { - let specifiers = ["#", "#path"]; - for specifier in specifiers { - let mut r = specifier.to_string(); - r.push_str("?#"); - let parsed = Specifier::parse(&r)?; - assert_eq!(parsed.path, specifier); - assert_eq!(parsed.query, Some("?")); - assert_eq!(parsed.fragment, Some("#")); - } - Ok(()) - } - - #[test] - fn module() -> Result<(), SpecifierError> { - let specifiers = ["module"]; - for specifier in specifiers { - let mut r = specifier.to_string(); - r.push_str("?#"); - let parsed = Specifier::parse(&r)?; - assert_eq!(parsed.path, specifier); - assert_eq!(parsed.query, Some("?")); - assert_eq!(parsed.fragment, Some("#")); - } - Ok(()) - } - - #[test] - fn query_fragment() -> Result<(), SpecifierError> { - let data = [ - ("a?", Some("?"), None), - ("a?query", Some("?query"), None), - ("a?query1?query2", Some("?query1?query2"), None), - ("a?query1?query2?query3", Some("?query1?query2?query3"), None), - ("a#", None, Some("#")), - ("a#b#c", None, Some("#b#c")), - ("a#fragment", None, Some("#fragment")), - ("a?#", Some("?"), Some("#")), - ("a?#fragment", Some("?"), Some("#fragment")), - ("a?query#", Some("?query"), Some("#")), - ("a?query#fragment", Some("?query"), Some("#fragment")), - ("a#fragment?", None, Some("#fragment?")), - ("a#fragment?query", None, Some("#fragment?query")), - ]; - - for (specifier_str, query, fragment) in data { - let specifier = Specifier::parse(specifier_str)?; - assert_eq!(specifier.path, "a", "{specifier_str}"); - assert_eq!(specifier.query, query, "{specifier_str}"); - assert_eq!(specifier.fragment, fragment, "{specifier_str}"); - } - - Ok(()) - } - - #[test] - // https://github.com/webpack/enhanced-resolve/blob/main/test/identifier.test.js - fn enhanced_resolve_edge_cases() -> Result<(), SpecifierError> { - let data = [ - ("path/#", "path/", "", "#"), - ("path/as/?", "path/as/", "?", ""), - ("path/#/?", "path/", "", "#/?"), - ("path/#repo#hash", "path/", "", "#repo#hash"), - ("path/#r#hash", "path/", "", "#r#hash"), - ("path/#repo/#repo2#hash", "path/", "", "#repo/#repo2#hash"), - ("path/#r/#r#hash", "path/", "", "#r/#r#hash"), - ("path/#/not/a/hash?not-a-query", "path/", "", "#/not/a/hash?not-a-query"), - ]; - - for (specifier_str, path, query, fragment) in data { - let specifier = Specifier::parse(specifier_str)?; - assert_eq!(specifier.path, path, "{specifier_str}"); - assert_eq!(specifier.query.unwrap_or(""), query, "{specifier_str}"); - assert_eq!(specifier.fragment.unwrap_or(""), fragment, "{specifier_str}"); - } - - Ok(()) - } - - // https://github.com/webpack/enhanced-resolve/blob/main/test/identifier.test.js - #[test] - fn enhanced_resolve_windows_like() -> Result<(), SpecifierError> { - let data = [ - ("path\\#", "path\\", "", "#"), - ("path\\as\\?", "path\\as\\", "?", ""), - ("path\\#\\?", "path\\", "", "#\\?"), - ("path\\#repo#hash", "path\\", "", "#repo#hash"), - ("path\\#r#hash", "path\\", "", "#r#hash"), - ("path\\#repo\\#repo2#hash", "path\\", "", "#repo\\#repo2#hash"), - ("path\\#r\\#r#hash", "path\\", "", "#r\\#r#hash"), - ("path\\#/not/a/hash?not-a-query", "path\\", "", "#/not/a/hash?not-a-query"), - ]; - - for (specifier_str, path, query, fragment) in data { - let specifier = Specifier::parse(specifier_str)?; - assert_eq!(specifier.path, path, "{specifier_str}"); - assert_eq!(specifier.query.unwrap_or(""), query, "{specifier_str}"); - assert_eq!(specifier.fragment.unwrap_or(""), fragment, "{specifier_str}"); - } - - Ok(()) - } -} diff --git a/src/tests/alias.rs b/src/tests/alias.rs deleted file mode 100644 index 07c615f4..00000000 --- a/src/tests/alias.rs +++ /dev/null @@ -1,280 +0,0 @@ -//! - -use normalize_path::NormalizePath; -use std::path::Path; - -use crate::{AliasValue, Resolution, ResolveContext, ResolveError, ResolveOptions, Resolver}; - -#[test] -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -fn alias() { - use super::memory_fs::MemoryFS; - use crate::ResolverGeneric; - use std::path::{Path, PathBuf}; - - let f = Path::new("/"); - - let file_system = MemoryFS::new(&[ - ("/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", ""), - ("/dashed-name", ""), - ]); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - alias: vec![ - ("aliasA".into(), vec![AliasValue::from("a")]), - ("b$".into(), vec![AliasValue::from("a/index")]), - ("c$".into(), vec![AliasValue::from("/a/index")]), - ( - "multiAlias".into(), - vec![ - AliasValue::from("b"), - AliasValue::from("c"), - AliasValue::from("d"), - AliasValue::from("e"), - AliasValue::from("a"), - ], - ), - ("recursive".into(), vec![AliasValue::from("recursive/dir")]), - ("/d/dir".into(), vec![AliasValue::from("/c/dir")]), - ("/d/index.js".into(), vec![AliasValue::from("/c/index")]), - ("#".into(), vec![AliasValue::from("/c/dir")]), - ("@".into(), vec![AliasValue::from("/c/dir")]), - ("ignored".into(), vec![AliasValue::Ignore]), - // not part of enhanced-resolve, added to make sure query in alias value works - ("alias_query".into(), vec![AliasValue::from("a?query_after")]), - ("alias_fragment".into(), vec![AliasValue::from("a#fragment_after")]), - ("dash".into(), vec![AliasValue::Ignore]), - ("@scope/package-name/file$".into(), vec![AliasValue::from("/c/dir")]), - ], - modules: vec!["/".into()], - ..ResolveOptions::default() - }, - ); - - #[rustfmt::skip] - let pass = [ - ("should resolve a not aliased module 1", "a", "/a/index"), - ("should resolve a not aliased module 2", "a/index", "/a/index"), - ("should resolve a not aliased module 3", "a/dir", "/a/dir/index"), - ("should resolve a not aliased module 4", "a/dir/index", "/a/dir/index"), - ("should resolve an aliased module 1", "aliasA", "/a/index"), - ("should resolve an aliased module 2", "aliasA/index", "/a/index"), - ("should resolve an aliased module 3", "aliasA/dir", "/a/dir/index"), - ("should resolve an aliased module 4", "aliasA/dir/index", "/a/dir/index"), - ("should resolve '#' alias 1", "#", "/c/dir/index"), - ("should resolve '#' alias 2", "#/index", "/c/dir/index"), - ("should resolve '@' alias 1", "@", "/c/dir/index"), - ("should resolve '@' alias 2", "@/index", "/c/dir/index"), - ("should resolve a recursive aliased module 1", "recursive", "/recursive/dir/index"), - ("should resolve a recursive aliased module 2", "recursive/index", "/recursive/dir/index"), - ("should resolve a recursive aliased module 3", "recursive/dir", "/recursive/dir/index"), - ("should resolve a recursive aliased module 4", "recursive/dir/index", "/recursive/dir/index"), - ("should resolve a file aliased module 1", "b", "/a/index"), - ("should resolve a file aliased module 2", "c", "/a/index"), - ("should resolve a file aliased module with a query 1", "b?query", "/a/index?query"), - ("should resolve a file aliased module with a query 2", "c?query", "/a/index?query"), - ("should resolve a path in a file aliased module 1", "b/index", "/b/index"), - ("should resolve a path in a file aliased module 2", "b/dir", "/b/dir/index"), - ("should resolve a path in a file aliased module 3", "b/dir/index", "/b/dir/index"), - ("should resolve a path in a file aliased module 4", "c/index", "/c/index"), - ("should resolve a path in a file aliased module 5", "c/dir", "/c/dir/index"), - ("should resolve a path in a file aliased module 6", "c/dir/index", "/c/dir/index"), - ("should resolve a file aliased file 1", "d", "/c/index"), - ("should resolve a file aliased file 2", "d/dir/index", "/c/dir/index"), - ("should resolve a file in multiple aliased dirs 1", "multiAlias/dir/file", "/e/dir/file"), - ("should resolve a file in multiple aliased dirs 2", "multiAlias/anotherDir", "/e/anotherDir/index"), - // not part of enhanced-resolve, added to make sure query in alias value works - ("should resolve query in alias value", "alias_query?query_before", "/a/index?query_after"), - ("should resolve query in alias value", "alias_fragment#fragment_before", "/a/index#fragment_after"), - ("should resolve dashed name", "dashed-name", "/dashed-name"), - ("should resolve scoped package name with sub dir", "@scope/package-name/file", "/c/dir/index"), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - - #[rustfmt::skip] - let ignore = [ - ("should resolve an ignore module", "ignored", ResolveError::Ignored(f.join("ignored"))) - ]; - - for (comment, request, expected) in ignore { - let resolution = resolver.resolve(f, request); - assert_eq!(resolution, Err(expected), "{comment} {request}"); - } -} - -// Not part of enhanced-resolve -#[test] -fn infinite_recursion() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![ - ("./a".into(), vec![AliasValue::from("./b")]), - ("./b".into(), vec![AliasValue::from("./a")]), - ], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(f, "./a"); - assert_eq!(resolution, Err(ResolveError::Recursion)); -} - -fn check_slash(path: &Path) { - let s = path.to_string_lossy().to_string(); - #[cfg(target_os = "windows")] - { - assert!(!s.contains('/'), "{s}"); - assert!(s.contains('\\'), "{s}"); - } - #[cfg(not(target_os = "windows"))] - { - assert!(s.contains('/'), "{s}"); - assert!(!s.contains('\\'), "{s}"); - } -} - -#[test] -fn absolute_path() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![(f.join("foo").to_str().unwrap().to_string(), vec![AliasValue::Ignore])], - modules: vec![f.clone().to_str().unwrap().to_string()], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(&f, "foo/index"); - assert_eq!(resolution, Err(ResolveError::Ignored(f.join("foo")))); -} - -#[test] -fn system_path() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![("@app".into(), vec![AliasValue::from(f.join("alias").to_string_lossy())])], - ..ResolveOptions::default() - }); - - let specifiers = ["@app/files/a", "@app/files/a.js"]; - - for specifier in specifiers { - let path = resolver.resolve(&f, specifier).map(Resolution::into_path_buf).unwrap(); - assert_eq!(path, f.join("alias/files/a.js")); - check_slash(&path); - } -} - -#[test] -fn alias_is_full_path() { - let f = super::fixture(); - let dir = f.join("foo"); - let dir_str = dir.to_string_lossy().to_string(); - - let resolver = Resolver::new(ResolveOptions { - alias: vec![("@".into(), vec![AliasValue::Path(dir_str.clone())])], - ..ResolveOptions::default() - }); - - let mut ctx = ResolveContext::default(); - - let specifiers = [ - "@/index".to_string(), - "@/index.js".to_string(), - // specifier has multiple `/` for reasons we'll never know - "@////index".to_string(), - // specifier is a full path - dir_str, - ]; - - for specifier in specifiers { - let resolution = resolver.resolve_with_context(&f, &specifier, &mut ctx); - assert_eq!(resolution.map(|r| r.full_path()), Ok(dir.join("index.js"))); - } - - for path in ctx.file_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - check_slash(&path); - } - - for path in ctx.missing_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - check_slash(&path); - if let Some(path) = path.parent() { - assert!(!path.is_file(), "{path:?} must not be a file"); - } - } -} - -// For the `should_stop` variable in `load_alias` -#[test] -fn all_alias_values_are_not_found() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![( - "m1".to_string(), - vec![AliasValue::Path(f.join("node_modules").join("m2").to_string_lossy().to_string())], - )], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(&f, "m1/a.js"); - assert_eq!(resolution, Err(ResolveError::NotFound("m1/a.js".to_string()))); -} - -#[test] -fn alias_fragment() { - let f = super::fixture(); - - let data = [ - // enhanced-resolve has `#` prepended with a `\0`, they are removed from the - // following 3 expected test results. - // See https://github.com/webpack/enhanced-resolve#escaping - ( - "handle fragment edge case (no fragment)", - "./no#fragment/#/#", - f.join("no#fragment/#/#.js"), - ), - ("handle fragment edge case (fragment)", "./no#fragment/#/", f.join("no.js#fragment/#/")), - ( - "handle fragment escaping", - "./no\0#fragment/\0#/\0##fragment", - f.join("no#fragment/#/#.js#fragment"), - ), - ]; - - for (comment, request, expected) in data { - let resolver = Resolver::new(ResolveOptions { - alias: vec![("foo".to_string(), vec![AliasValue::Path(request.to_string())])], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f, "foo").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } -} - -#[test] -fn alias_try_fragment_as_path() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![( - "#".to_string(), - vec![AliasValue::Path(f.join("#").to_string_lossy().to_string())], - )], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(&f, "#/a").map(|r| r.full_path()); - assert_eq!(resolution, Ok(f.join("#").join("a.js"))); -} diff --git a/src/tests/browser_field.rs b/src/tests/browser_field.rs deleted file mode 100644 index 171ee099..00000000 --- a/src/tests/browser_field.rs +++ /dev/null @@ -1,189 +0,0 @@ -//! - -use crate::{AliasValue, ResolveError, ResolveOptions, Resolver}; - -#[test] -fn ignore() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![ - vec!["browser".into()], - vec!["innerBrowser1".into()], - vec!["innerBrowser2".into()], - vec![], - ], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - (f.clone(), "./lib/ignore", f.join("lib/ignore.js")), - (f.clone(), "./lib/ignore.js", f.join("lib/ignore.js")), - (f.join("lib"), "./ignore", f.join("lib/ignore.js")), - (f.join("lib"), "./ignore.js", f.join("lib/ignore.js")), - ]; - - for (path, request, expected) in data { - let resolution = resolver.resolve(&path, request); - let expected = ResolveError::Ignored(expected); - assert_eq!(resolution, Err(expected), "{path:?} {request}"); - } -} - -#[test] -fn shared_resolvers() { - let f = super::fixture().join("browser-module"); - - let resolver1 = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["innerBrowser1".into(), "field".into(), "browser".into()]], - ..ResolveOptions::default() - }); - let resolved_path = resolver1.resolve(&f, "./lib/main1.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("lib/main.js"))); - - let resolver2 = resolver1.clone_with_options(ResolveOptions { - alias_fields: vec![vec!["innerBrowser2".into(), "browser".into()]], - ..ResolveOptions::default() - }); - let resolved_path = resolver2.resolve(&f, "./lib/main2.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("./lib/replaced.js"))); -} - -#[test] -fn replace_file() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![ - vec!["browser".into()], - vec!["innerBrowser1".into(), "field2".into(), "browser".into()], // not presented - vec!["innerBrowser1".into(), "field".into(), "browser".into()], - vec!["innerBrowser2".into(), "browser".into()], - ], - // Not part of enhanced-resolve. Added to make sure no interaction between these two fields. - main_fields: vec!["browser".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - ("should replace a file 1", f.clone(), "./lib/replaced", f.join("lib/browser.js")), - ("should replace a file 2", f.clone(), "./lib/replaced.js", f.join("lib/browser.js")), - ("should replace a file 3", f.join("lib"), "./replaced", f.join("lib/browser.js")), - ("should replace a file 4", f.join("lib"), "./replaced.js", f.join("lib/browser.js")), - ("should replace a module with a file 1", f.clone(), "module-a", f.join("browser/module-a.js")), - ("should replace a module with a file 2", f.join("lib"), "module-a", f.join("browser/module-a.js")), - ("should replace a module with a module 1", f.clone(), "module-b", f.join("node_modules/module-c.js")), - ("should replace a module with a module 2", f.join("lib"), "module-b", f.join("node_modules/module-c.js")), - ("should resolve in nested property 1", f.clone(), "./lib/main1.js", f.join("lib/main.js")), - ("should resolve in nested property 2", f.clone(), "./lib/main2.js", f.join("lib/browser.js")), - ("should check only alias field properties", f.clone(), "./toString", f.join("lib/toString.js")), - // not part of enhanced-resolve - ("recursion", f.clone(), "module-c", f.join("node_modules/module-c.js")), - ("resolve self 1", f.clone(), "./lib/main.js", f.join("lib/main.js")), - ("resolve self 2", f.clone(), "./main.js", f.join("lib/main.js")), - ]; - - for (comment, path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn recurse_fail() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - ("recurse non existent", f.clone(), "./lib/non-existent.js", ResolveError::NotFound("./lib/non-existent.js".into())), - ("path partial match 1", f.clone(), "./xyz.js", ResolveError::NotFound("./xyz.js".into())), - ("path partial match 2", f, "./lib/xyz.js", ResolveError::NotFound("./lib/xyz.js".into())), - ]; - - for (comment, path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Err(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn broken() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - // The browser field string value should be ignored - (f.clone(), "browser-module-broken", Ok(f.join("node_modules/browser-module-broken/main.js"))), - (f.join("browser-module"), "./number", Err(ResolveError::NotFound("./number".into()))), - ]; - - for (path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, expected, "{path:?} {request}"); - } -} - -#[test] -fn crypto_js() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - fallback: vec![( - "crypto".into(), - vec![AliasValue::from(f.join("lib.js").to_string_lossy())], - )], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(f.join("crypto-js"), "crypto").map(|r| r.full_path()); - assert_eq!(resolved_path, Err(ResolveError::Ignored(f.join("crypto-js")))); -} - -// https://github.com/webpack/webpack/blob/87660921808566ef3b8796f8df61bd79fc026108/test/cases/resolving/browser-field/index.js#L40-L43 -#[test] -fn recursive() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - let data = [ - ("should handle recursive file 1", f.clone(), "recursive-file/a"), - ("should handle recursive file 2", f.clone(), "recursive-file/b"), - ("should handle recursive file 3", f.clone(), "recursive-file/c"), - ("should handle recursive file 4", f, "recursive-file/d"), - ]; - - for (comment, path, request) in data { - let resolved_path = resolver.resolve(&path, request); - assert_eq!(resolved_path, Err(ResolveError::Recursion), "{comment} {path:?} {request}"); - } -} - -#[test] -fn with_query() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "./foo").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("lib").join("browser.js?query"))); -} diff --git a/src/tests/builtins.rs b/src/tests/builtins.rs deleted file mode 100644 index 5d6d14d9..00000000 --- a/src/tests/builtins.rs +++ /dev/null @@ -1,121 +0,0 @@ -use std::path::Path; - -use crate::{ResolveError, ResolveOptions, Resolver}; - -#[test] -fn builtins_off() { - let f = Path::new("/"); - let resolver = Resolver::default(); - let resolved_path = resolver.resolve(f, "zlib").map(|r| r.full_path()); - assert_eq!(resolved_path, Err(ResolveError::NotFound("zlib".into()))); -} - -#[test] -fn builtins() { - let f = Path::new("/"); - - let resolver = Resolver::new(ResolveOptions::default().with_builtin_modules(true)); - - let pass = [ - "_http_agent", - "_http_client", - "_http_common", - "_http_incoming", - "_http_outgoing", - "_http_server", - "_stream_duplex", - "_stream_passthrough", - "_stream_readable", - "_stream_transform", - "_stream_wrap", - "_stream_writable", - "_tls_common", - "_tls_wrap", - "assert", - "assert/strict", - "async_hooks", - "buffer", - "child_process", - "cluster", - "console", - "constants", - "crypto", - "dgram", - "diagnostics_channel", - "dns", - "dns/promises", - "domain", - "events", - "fs", - "fs/promises", - "http", - "http2", - "https", - "inspector", - "module", - "net", - "os", - "path", - "path/posix", - "path/win32", - "perf_hooks", - "process", - "punycode", - "querystring", - "readline", - "repl", - "stream", - "stream/consumers", - "stream/promises", - "stream/web", - "string_decoder", - "sys", - "timers", - "timers/promises", - "tls", - "trace_events", - "tty", - "url", - "util", - "util/types", - "v8", - "vm", - "worker_threads", - "zlib", - ]; - - for request in pass { - let prefixed_request = format!("node:{request}"); - for request in [prefixed_request.clone(), request.to_string()] { - let resolved_path = resolver.resolve(f, &request).map(|r| r.full_path()); - let err = ResolveError::Builtin(prefixed_request.clone()); - assert_eq!(resolved_path, Err(err), "{request}"); - } - } -} - -#[test] -fn fail() { - let f = Path::new("/"); - let resolver = Resolver::new(ResolveOptions::default().with_builtin_modules(true)); - let request = "xxx"; - let resolved_path = resolver.resolve(f, request); - let err = ResolveError::NotFound(request.to_string()); - assert_eq!(resolved_path, Err(err), "{request}"); -} - -#[test] -fn imports() { - let f = super::fixture().join("builtins"); - let resolver = Resolver::new(ResolveOptions { - builtin_modules: true, - condition_names: vec!["node".into()], - ..ResolveOptions::default() - }); - - for request in ["#fs", "#http"] { - let resolved_path = resolver.resolve(f.clone(), request).map(|r| r.full_path()); - let err = ResolveError::Builtin(format!("node:{}", request.trim_start_matches('#'))); - assert_eq!(resolved_path, Err(err)); - } -} diff --git a/src/tests/dependencies.rs b/src/tests/dependencies.rs deleted file mode 100644 index bcc2355b..00000000 --- a/src/tests/dependencies.rs +++ /dev/null @@ -1,110 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/dependencies.test.js - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows { - use rustc_hash::FxHashSet; - use std::path::PathBuf; - - use crate::{ResolveContext, ResolveOptions, ResolverGeneric}; - - use super::super::memory_fs::MemoryFS; - - fn file_system() -> MemoryFS { - MemoryFS::new(&[ - ("/a/b/node_modules/some-module/index.js", ""), - ("/a/node_modules/module/package.json", r#"{"main":"entry.js"}"#), - ("/a/node_modules/module/file.js", r#"{"main":"entry.js"}"#), - ("/modules/other-module/file.js", ""), - ]) - } - - #[test] - fn test() { - let file_system = file_system(); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - extensions: vec![".json".into(), ".js".into()], - modules: vec!["/modules".into(), "node_modules".into()], - ..ResolveOptions::default() - }, - ); - - let data = [ - ( - "middle module request", - "/a/b/c", - "module/file", - "/a/node_modules/module/file.js", - // These dependencies are different from enhanced-resolve due to different code path to - // querying the file system - vec![ - // 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", - // "/", - ], - vec![ - // missing package.jsons - // "/a/b/c/package.json", - "/a/b/package.json", - "/a/package.json", - "/package.json", - // missing modules directories - "/a/b/c", - // "/a/b/c/node_modules", - // missing single file modules - "/modules/module", - "/a/b/node_modules/module", - // missing files with alternative extensions - "/a/node_modules/module/file", - "/a/node_modules/module/file.json", - ], - ), - ( - "fast found module", - "/a/b/c", - "other-module/file.js", - "/modules/other-module/file.js", - // These dependencies are different from enhanced-resolve due to different code path to - // querying the file system - vec![ - // symlink checks - "/modules/other-module/file.js", - // "/modules/other-module", - // "/modules", - // "/", - ], - vec![ - // missing package.jsons - // "/a/b/c/package.json", - "/a/b/c", - "/a/b/package.json", - "/a/package.json", - "/package.json", - "/modules/other-module/package.json", - "/modules/package.json", - ], - ), - ]; - - for (name, context, request, result, file_dependencies, missing_dependencies) in data { - let mut ctx = ResolveContext::default(); - let path = PathBuf::from(context); - let resolved = - resolver.resolve_with_context(path, request, &mut ctx).map(|r| r.full_path()); - assert_eq!(resolved, Ok(PathBuf::from(result))); - let file_dependencies = - FxHashSet::from_iter(file_dependencies.iter().map(PathBuf::from)); - let missing_dependencies = - FxHashSet::from_iter(missing_dependencies.iter().map(PathBuf::from)); - assert_eq!(ctx.file_dependencies, file_dependencies, "{name}"); - assert_eq!(ctx.missing_dependencies, missing_dependencies, "{name}"); - } - } -} diff --git a/src/tests/exports_field.rs b/src/tests/exports_field.rs deleted file mode 100644 index fd68c1f7..00000000 --- a/src/tests/exports_field.rs +++ /dev/null @@ -1,2546 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/exportsField.test.js -//! -//! The huge exports field test cases are at the bottom of this file. - -use crate::{Ctx, PathUtil, ResolveError, ResolveOptions, Resolver}; -use serde_json::json; -use std::path::Path; - -#[test] -fn test_simple() { - let f = super::fixture().join("exports-field"); - let f2 = super::fixture().join("exports-field2"); - let f4 = super::fixture().join("exports-field-error"); - let f5 = super::fixture().join("imports-exports-wildcard"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - fully_specified: true, - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("resolve root using exports field, not a main field", f.clone(), "exports-field", f.join("node_modules/exports-field/x.js")), - ("resolver should respect condition names", f.clone(), "exports-field/dist/main.js", f.join("node_modules/exports-field/lib/lib2/main.js")), - // enhanced_resolve behaves differently to node.js. enhanced_resolve fallbacks when an - // array item is unresolved, where as node.js fallbacks when an array has an - // InvalidPackageTarget error. - // ("resolver should respect fallback", f2.clone(), "exports-field/dist/browser.js", f2.join("node_modules/exports-field/lib/browser.js")), - // The following two tests require fallback from array values, the path is changed here to - // only test query and fragment. - ("resolver should respect query parameters #1", f2.clone(), "exports-field/dist/main.js?foo", f2.join("node_modules/exports-field/lib/lib2/main.js?foo")), - ("resolver should respect fragment parameters #1", f2.clone(), "exports-field/dist/main.js#foo", f2.join("node_modules/exports-field/lib/lib2/main.js#foo")), - ("relative path should work, if relative path as request is used", f.clone(), "./node_modules/exports-field/lib/main.js", f.join("node_modules/exports-field/lib/main.js")), - ("self-resolving root", f.clone(), "@exports-field/core", f.join("a.js")), - ("should resolve with wildcard pattern #1", f5.clone(), "m/features/f.js", f5.join("node_modules/m/src/features/f.js")), - ("should resolve with wildcard pattern #2", f5.clone(), "m/features/y/y.js", f5.join("node_modules/m/src/features/y/y.js")), - ("should resolve with wildcard pattern #3", f5.clone(), "m/features-no-ext/y/y.js", f5.join("node_modules/m/src/features/y/y.js")), - ("should resolve with wildcard pattern #4", f5.clone(), "m/middle/nested/f.js", f5.join("node_modules/m/src/middle/nested/f.js")), - ("should resolve with wildcard pattern #5", f5.clone(), "m/middle-1/nested/f.js", f5.join("node_modules/m/src/middle-1/nested/f.js")), - ("should resolve with wildcard pattern #6", f5.clone(), "m/middle-2/nested/f.js", f5.join("node_modules/m/src/middle-2/nested/f.js")), - ("should resolve with wildcard pattern #7", f5.clone(), "m/middle-3/nested/f", f5.join("node_modules/m/src/middle-3/nested/f/nested/f.js")), - ("should resolve with wildcard pattern #8", f5.clone(), "m/middle-4/f/nested", f5.join("node_modules/m/src/middle-4/f/f.js")), - ("should resolve with wildcard pattern #9", f5.clone(), "m/middle-5/f$/$", f5.join("node_modules/m/src/middle-5/f$/$.js")), - ]; - - // Not needed or snapshot: - // * should log the correct info - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } - - let p = f.join("node_modules/exports-field/package.json"); - let p2 = f2.join("node_modules/exports-field/package.json"); - let p4 = f4.join("node_modules/exports-field/package.json"); - let p5 = f5.join("node_modules/m/package.json"); - - #[rustfmt::skip] - let fail = [ - // ("throw error if extension not provided", f2.clone(), "exports-field/dist/main", ResolveError::NotFound(f2.join("node_modules/exports-field/lib/lib2/main"))), - ("resolver should respect query parameters #2. Direct matching", f2.clone(), "exports-field?foo", ResolveError::PackagePathNotExported("./?foo".into(), p2.clone())), - ("resolver should respect fragment parameters #2. Direct matching", f2, "exports-field#foo", ResolveError::PackagePathNotExported("./#foo".into(), p2)), - ("relative path should not work with exports field", f.clone(), "./node_modules/exports-field/dist/main.js", ResolveError::NotFound("./node_modules/exports-field/dist/main.js".into())), - ("backtracking should not work for request", f.clone(), "exports-field/dist/../../../a.js", ResolveError::InvalidPackageTarget("./lib/../../../a.js".to_string(), "./dist/".to_string(), p.clone())), - ("backtracking should not work for exports field target", f.clone(), "exports-field/dist/a.js", ResolveError::InvalidPackageTarget("./../../a.js".to_string(), "./dist/a.js".to_string(), p.clone())), - ("not exported error", f.clone(), "exports-field/anything/else", ResolveError::PackagePathNotExported("./anything/else".to_string(), p.clone())), - ("request ending with slash #1", f.clone(), "exports-field/", ResolveError::PackagePathNotExported("./".to_string(), p.clone())), - ("request ending with slash #2", f.clone(), "exports-field/dist/", ResolveError::PackagePathNotExported("./dist/".to_string(), p.clone())), - ("request ending with slash #3", f.clone(), "exports-field/lib/", ResolveError::PackagePathNotExported("./lib/".to_string(), p)), - ("should throw error if target is invalid", f4, "exports-field", ResolveError::InvalidPackageTarget("./a/../b/../../pack1/index.js".to_string(), ".".to_string(), p4)), - ("throw error if exports field is invalid", f.clone(), "invalid-exports-field", ResolveError::InvalidPackageConfig(f.join("node_modules/invalid-exports-field/package.json"))), - ("should throw error if target is 'null'", f5, "m/features/internal/file.js", ResolveError::PackagePathNotExported("./features/internal/file.js".to_string(), p5)), - ]; - - for (comment, path, request, error) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!(resolution, Err(error), "{comment} {path:?} {request}"); - } -} - -// resolve using exports field, not a browser field #1 -#[test] -fn exports_not_browser_field1() { - let f = super::fixture().join("exports-field"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - condition_names: vec!["webpack".into()], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "exports-field/dist/main.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("node_modules/exports-field/lib/lib2/main.js"))); -} - -// resolve using exports field and a browser alias field #2 -#[test] -fn exports_not_browser_field2() { - let f2 = super::fixture().join("exports-field2"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - extensions: vec![".js".into()], - condition_names: vec!["node".into()], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f2, "exports-field/dist/main.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f2.join("node_modules/exports-field/lib/browser.js"))); -} - -// should resolve extension without fullySpecified -#[test] -fn extension_without_fully_specified() { - let f2 = super::fixture().join("exports-field2"); - - let commonjs_resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - let resolved_path = - commonjs_resolver.resolve(&f2, "exports-field/dist/main").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f2.join("node_modules/exports-field/lib/lib2/main.js"))); -} - -#[test] -fn field_name_path() { - let f2 = super::fixture().join("exports-field2"); - let f3 = super::fixture().join("exports-field3"); - - // field name path #1 #2 #3 - let exports_fields = [ - vec![vec!["exportsField".into(), "exports".into()]], - vec![vec!["exportsField".into(), "exports".into()], vec!["exports".into()]], - vec![vec!["exports".into()], vec!["exportsField".into(), "exports".into()]], - ]; - - for exports_fields in exports_fields { - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - exports_fields, - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/main.js"))); - } - - // field name path #4 - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - exports_fields: vec![vec!["exports".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f2, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f2.join("node_modules/exports-field/index.js"))); - - // field name path #5 - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - exports_fields: vec![vec!["ex".into()], vec!["exports_field".into(), "exports".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/index"))); - - // non-compliant export targeting a directory - let resolver = Resolver::new(ResolveOptions { - exports_fields: vec![vec!["broken".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/src/index.js"))); -} - -#[test] -fn shared_resolvers() { - let f3 = super::fixture().join("exports-field3"); - - let resolver1 = Resolver::new(ResolveOptions { - exports_fields: vec![vec!["exportsField".into(), "exports".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver1.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/main.js"))); - - let resolver2 = resolver1.clone_with_options(ResolveOptions { - exports_fields: vec![vec!["ex".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver2.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/index"))); -} - -#[test] -fn extension_alias_1_2() { - let f = super::fixture().join("exports-field-and-extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - extension_alias: vec![(".js".into(), vec![".ts".into(), ".js".into()])], - fully_specified: true, - condition_names: vec!["webpack".into(), "default".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve with the `extensionAlias` option", f.clone(), "@org/pkg/string.js", f.join("node_modules/@org/pkg/dist/string.js")), - ("should resolve with the `extensionAlias` option #2", f.clone(), "pkg/string.js", f.join("node_modules/pkg/dist/string.js")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn extension_alias_3() { - let f = super::fixture().join("exports-field-and-extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - extension_alias: vec![( - ".js".into(), - vec![".foo".into(), ".baz".into(), ".baz".into(), ".ts".into(), ".js".into()], - )], - fully_specified: true, - condition_names: vec!["webpack".into(), "default".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve with the `extensionAlias` option #3", f.clone(), "pkg/string.js", f.join("node_modules/pkg/dist/string.js")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn extension_alias_throw_error() { - let f = super::fixture().join("exports-field-and-extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - extension_alias: vec![(".js".into(), vec![".ts".into()])], - fully_specified: true, - condition_names: vec!["webpack".into(), "default".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let fail = [ - // enhanced-resolve has two test cases that are exactly the same here - // https://github.com/webpack/enhanced-resolve/blob/a998c7d218b7a9ec2461fc4fddd1ad5dd7687485/test/exportsField.test.js#L2976-L3024 - ("should throw error with the `extensionAlias` option", f, "pkg/string.js", ResolveError::ExtensionAlias), - // TODO: The error is PackagePathNotExported in enhanced-resolve - // ("should throw error with the `extensionAlias` option", f.clone(), "pkg/string.js", ResolveError::PackagePathNotExported("node_modules/pkg/dist/string.ts".to_string())), - ]; - - for (comment, path, request, error) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!(resolution, Err(error), "{comment} {path:?} {request}"); - } -} - -// Small script for generating the test cases from enhanced-resolve -// for (c of testCases) { -// console.log("TestCase {") -// console.log(`name: ${JSON.stringify(c.name)},`) -// if (c.expect instanceof Error) { -// console.log(`expect: None,`) -// } else { -// console.log(`expect: Some(vec!${JSON.stringify(c.expect)}),`) -// } -// console.log(`exports_field: exports_field(json!(${JSON.stringify(c.suite[0], null, 2)})),`) -// console.log(`request: "${c.suite[1]}",`) -// console.log(`condition_names: vec!${JSON.stringify(c.suite[2])},`) -// console.log("},") -//} -struct TestCase { - name: &'static str, - expect: Option>, - exports_field: serde_json::Value, - request: &'static str, - condition_names: Vec<&'static str>, -} - -#[allow(clippy::needless_pass_by_value)] -fn exports_field(value: serde_json::Value) -> serde_json::Value { - value -} - -#[test] -fn test_cases() { - let test_cases = [ - TestCase { - name: "sample #1", - expect: Some(vec!["./dist/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/": { - "import": [ - "./dist/", - "./src/" - ], - "webpack": "./wp/" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "sample #1", - expect: Some(vec!["./src/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/": { - "import": [ - "./src/" - ], - "webpack": "./wp/" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - TestCase { - name: "sample #1 (wildcard)", - expect: Some(vec!["./dist/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/*": { - "import": [ - "./dist/*", - "./src/*" - ], - "webpack": "./wp/*" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "sample #1 (wildcard)", - expect: Some(vec!["./src/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/*": { - "import": [ - "./src/*" - ], - "webpack": "./wp/*" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - TestCase { - name: "sample #2", - expect: Some(vec!["./data/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./timezones/": "./data/timezones/" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #2 (wildcard)", - expect: Some(vec!["./data/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./timezones/*": "./data/timezones/*" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #3", - expect: Some(vec!["./data/timezones/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./": "./data/timezones/" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #3 (wildcard)", - expect: Some(vec!["./data/timezones/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./*": "./data/timezones/*.mjs" - })), - request: "./timezones/pdt", - condition_names: vec![], - }, - TestCase { - name: "sample #4", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./lib/": { - "browser": [ - "./browser/" - ] - }, - "./dist/index.js": { - "node": "./index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #4 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "node": "./index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #5", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/": { - "browser": [ - "./browser/" - ] - }, - "./dist/index.js": { - "node": "./index.js", - "default": "./browser/index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #5 (wildcard)", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "node": "./index.js", - "default": "./browser/index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./dist/a": "./dist/index.js" - })), - request: "./dist/aaa", - condition_names: vec![], - }, - TestCase { - name: "sample #7", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./dist/a/a/": "./dist/index.js" - })), - request: "./dist/a/a", - condition_names: vec![], - }, - TestCase { - name: "sample #7 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./dist/a/a/*": "./dist/index.js" - })), - request: "./dist/a/a", - condition_names: vec![], - }, - TestCase { - name: "sample #8", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": "./index.js" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #9", - expect: Some(vec!["./main.js"]), - exports_field: exports_field(json!({ - "./index.js": "./main.js" - })), - request: "./index.js", - condition_names: vec![], - }, - TestCase { - name: "sample #10", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #11", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./bar#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #12", - expect: Some(vec!["./ok.js#abc"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/ok.js#abc", - condition_names: vec![], - }, - TestCase { - name: "sample #12", - expect: Some(vec!["./ok.js#abc"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/ok.js#abc", - condition_names: vec![], - }, - TestCase { - name: "sample #13", - expect: Some(vec!["./ok.js?abc"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/ok.js?abc", - condition_names: vec![], - }, - TestCase { - name: "sample #14", - expect: Some(vec!["./🎉.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/🎉.js", - condition_names: vec![], - }, - TestCase { - name: "sample #15", - expect: Some(vec!["./%F0%9F%8E%89.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/%F0%9F%8E%89.js", - condition_names: vec![], - }, - TestCase { - name: "sample #16", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./🎉", - condition_names: vec![], - }, - TestCase { - name: "sample #17", - expect: Some(vec!["./other.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./%F0%9F%8E%89", - condition_names: vec![], - }, - TestCase { - name: "sample #18", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./module", - condition_names: vec![], - }, - TestCase { - name: "sample #19", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./module#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #20", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./module?foo", - condition_names: vec![], - }, - TestCase { - name: "sample #21", - expect: Some(vec!["./zizizi"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./z*z*z*" - })), - request: "./#zippi", - condition_names: vec![], - }, - TestCase { - name: "sample #22", - expect: Some(vec!["./d?e?f"]), - exports_field: exports_field(json!({ - "./a?b?c/": "./" - })), - request: "./a?b?c/d?e?f", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #1", - expect: Some(vec!["./dist/index.js"]), - exports_field: exports_field(json!({ - ".": "./dist/index.js" - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #2", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./": "./", - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #3", - expect: Some(vec!["./dist/a.js"]), - exports_field: exports_field(json!({ - "./dist/": "./dist/", - "./dist/*": "./dist/*", - "./dist*": "./dist*", - "./dist/index.js": "./dist/a.js" - })), - request: "./dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #4", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./": { - "browser": [ - "./browser/" - ] - }, - "./*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "browser": "./index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #5", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./": { - "browser": [ - "./browser/" - ] - }, - "./*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "node": "./node.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #6", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - ".": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #7", - expect: Some(vec!["./src/index.js"]), // `enhanced_resolve` is `None` - exports_field: exports_field(json!({ - ".": { - "default": "./src/index.js", - "browser": "./index.js", - "node": "./src/node/index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #8", - expect: Some(vec!["./src/index.js"]), - exports_field: exports_field(json!({ - ".": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #9", - expect: Some(vec!["./index"]), - exports_field: exports_field(json!({ - ".": "./index" - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #10", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./index": "./index.js" - })), - request: "./index", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #11", - expect: Some(vec!["./foo.js"]), - exports_field: exports_field(json!({ - "./": "./", - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #12", - expect: Some(vec!["./foo/bar/baz.js"]), - exports_field: exports_field(json!({ - "./": "./", - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo/bar/baz.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #13", - expect: Some(vec!["./foo/bar/baz.js"]), - exports_field: exports_field(json!({ - "./": "./", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo/bar/baz.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #14", - expect: Some(vec!["./foo/bar/baz.js"]), - exports_field: exports_field(json!({ - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo/bar/baz.js", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #1", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "require": "./require.js" - }, { - "import": "./import.mjs" - }] - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #2", - expect: Some(vec!["./import.mjs"]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "require": "./require.js" - }, { - "import": "./import.mjs" - }] - })), - request: ".", - condition_names: vec!["import"], - }, - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./require.js"]), - exports_field: exports_field(json!({ - ".": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./import.mjs"]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "import": "./import.mjs" - }] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./require.js"]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "require": [ - "./require.js" - ] - }, { - "import": [ - "./import.mjs", - "./import.js" - ] - }] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./import.mjs"]), - exports_field: exports_field(json!({ - ".": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "./import.mjs", - "./import.js" - ] - } - ] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./import.js"]), - exports_field: exports_field(json!({ - ".": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "./import.js" - ] - } - ] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "mapping to a folder root #1", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./timezones": "./data/timezones/" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #2", - expect: None, - exports_field: exports_field(json!({ - "./timezones/": "./data/timezones" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #3", - expect: Some(vec!["./data/timezones/pdt/index.mjs"]), - exports_field: exports_field(json!({ - "./timezones/pdt/": "./data/timezones/pdt/" - })), - request: "./timezones/pdt/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #3 (wildcard)", - expect: Some(vec!["./data/timezones/pdt/index.mjs"]), - exports_field: exports_field(json!({ - "./timezones/pdt/*": "./data/timezones/pdt/*" - })), - request: "./timezones/pdt/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #4", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./": "./timezones/" - })), - request: "./pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #4 (wildcard)", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./*": "./timezones/*" - })), - request: "./pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #5", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./": "./" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #5 (wildcard)", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./*": "./*" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #6", - expect: None, - exports_field: exports_field(json!({ - "./": "." - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #6 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "./*": "." - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #7", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": "./" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #7 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": "./*" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #1", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./": "./", - "./dist/": "./lib/" - })), - request: "./dist/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #1 (wildcard)", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./*": "./*", - "./dist/*": "./lib/*" - })), - request: "./dist/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #2", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/": "./dist/utils/", - "./dist/": "./lib/" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #2 (wildcard)", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/*": "./dist/utils/*", - "./dist/*": "./lib/*" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #3", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/index.js": "./dist/utils/index.js", - "./dist/utils/": "./dist/utils/index.mjs", - "./dist/": "./lib/" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #3 (wildcard)", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/index.js": "./dist/utils/index.js", - "./dist/utils/*": "./dist/utils/index.mjs", - "./dist/*": "./lib/*" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #4", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./": { - "browser": "./browser/" - }, - "./dist/": "./lib/" - })), - request: "./dist/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "the longest matching path prefix is prioritized #4 (wildcard)", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./*": { - "browser": "./browser/*" - }, - "./dist/*": "./lib/*" - })), - request: "./dist/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #1", - // `lodash/` does not start with './' so fallbacks to util - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "conditional mapping folder #1", - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": [ - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #1 (wildcard)", - // `lodash/` does not start with './' so fallbacks to util - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": [ - "lodash/*", - "./utils/*" - ], - "node": [ - "./utils-node/*" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "conditional mapping folder #1 (wildcard)", - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": [ - "./utils/*" - ], - "node": [ - "./utils-node/*" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #2", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./node/" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "conditional mapping folder #2 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "webpack": "./wpk/*", - "browser": [ - "lodash/*", - "./utils/*" - ], - "node": [ - "./node/*" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "conditional mapping folder #3", - expect: Some(vec!["./wpk/index.mjs"]), - exports_field: exports_field(json!({ - "./utils/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils/" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "conditional mapping folder #3 (wildcard)", - expect: Some(vec!["./wpk/index.mjs"]), - exports_field: exports_field(json!({ - "./utils/*": { - "webpack": "./wpk/*", - "browser": [ - "lodash/*", - "./utils/*" - ], - "node": [ - "./utils/*" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "incorrect exports field #1", - expect: None, - exports_field: exports_field(json!({ - "/utils/": "./a/" - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #2", - expect: None, - exports_field: exports_field(json!({ - "./utils/": "/a/" - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #3", - expect: None, - exports_field: exports_field(json!({ - "/utils/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #4", - expect: None, - exports_field: exports_field(json!({ - "./utils/": { - "browser": "/a/", - "default": "/b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #4 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "/a/", - "default": "/b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #5", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index": "./a/index.js" - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index.mjs": "./a/index.js" - })), - request: "./utils/index", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #7", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #8", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index.mjs": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - // Requests that are not `./` does not apply to `package_exports_resolve` - // TestCase { - // name: "incorrect request #1", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": "./a/" - // })), - // request: "/utils/index.mjs", - // condition_names: vec![], - // }, - // TestCase { - // name: "incorrect request #2", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": { - // "browser": "./a/", - // "default": "./b/" - // } - // })), - // request: "/utils/index.mjs", - // condition_names: vec!["browser"], - // }, - // TestCase { - // name: "incorrect request #3", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": { - // "browser": "./a/", - // "default": "./b/" - // } - // })), - // request: "../utils/index.mjs", - // condition_names: vec!["browser"], - // }, - // TestCase { - // name: "incorrect request #4", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": { - // "browser": "./a/", - // "default": "./b/" - // } - // })), - // request: "/utils/index.mjs/", - // condition_names: vec!["browser"], - // }, - TestCase { - name: "backtracking package base #1", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./../../utils/": "./dist/" - })), - request: "./../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #1 (wildcard)", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./../../utils/*": "./dist/*" - })), - request: "./../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #2", - expect: None, - exports_field: exports_field(json!({ - "../../utils/": "./dist/" - })), - request: "../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #2 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "../../utils/*": "./dist/*" - })), - request: "../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #3", - expect: None, - exports_field: exports_field(json!({ - "./utils/": "../src/" - })), - request: "./utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #3 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "./utils/*": "../src/*" - })), - request: "./utils/index", - condition_names: vec![], - }, - // enhanced-resolve does not handle backtracking here - // TestCase { - // name: "backtracking package base #4", - // expect: Some(vec!["./../src/index"]), - // exports_field: exports_field(json!({ - // "./utils/": "./../src/" - // })), - // request: "./utils/index", - // condition_names: vec![], - // }, - // TestCase { - // name: "backtracking package base #4 (wildcard)", - // expect: Some(vec!["./../src/index"]), - // exports_field: exports_field(json!({ - // "./utils/*": "./../src/*" - // })), - // request: "./utils/index", - // condition_names: vec![], - // }, - // TestCase { - // name: "backtracking package base #5", - // expect: Some(vec!["./src/../index.js"]), - // exports_field: exports_field(json!({ - // "./utils/index": "./src/../index.js" - // })), - // request: "./utils/index", - // condition_names: vec![], - // }, - TestCase { - name: "backtracking package base #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/../utils/index": "./src/../index.js" - })), - request: "./utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #7", - expect: None, - exports_field: exports_field(json!({ - "./utils/": { - "browser": "../this/" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #7", - expect: None, - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "../this/*" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #8", - // We throw "InvalidPackageTarget" - // expect: Some(vec!["./utils/../index"]), - expect: None, - exports_field: exports_field(json!({ - "./utils/": { - "browser": "./utils/../" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #8 (wildcard)", - // We throw "InvalidPackageTarget" - // expect: Some(vec!["./utils/../index"]), - expect: None, - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "./utils/../*" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #9", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./": "./src/../../", - "./dist/": "./dist/" - })), - request: "./dist/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #9 (wildcard)", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./*": "./src/../../*", - "./dist/*": "./dist/*" - })), - request: "./dist/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking target folder #1", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../../index"]), - exports_field: exports_field(json!({ - "./utils/": "./dist/" - })), - request: "./utils/timezone/../../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #1 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../../index"]), - exports_field: exports_field(json!({ - "./utils/*": "./dist/*" - })), - request: "./utils/timezone/../../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #2", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../index"]), - exports_field: exports_field(json!({ - "./utils/": "./dist/" - })), - request: "./utils/timezone/../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #2 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../index"]), - exports_field: exports_field(json!({ - "./utils/*": "./dist/*" - })), - request: "./utils/timezone/../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #3", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/target/../../index"]), - exports_field: exports_field(json!({ - "./utils/": "./dist/target/" - })), - request: "./utils/../../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #3 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/target/../../index"]), - exports_field: exports_field(json!({ - "./utils/*": "./dist/target/*" - })), - request: "./utils/../../index", - condition_names: vec![], - }, - // enhanced-resolve does not handle `node_modules` in target - TestCase { - name: "nested node_modules path #1", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": "./node_modules/" - } - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #1 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "./node_modules/*" - } - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #2", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./utils/../node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/": "./utils/../node_modules/" - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "nested node_modules path #2 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./utils/../node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": "./utils/../node_modules/*" - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "nested mapping #1", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": "./", - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested mapping #1 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": "./*", - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "nested mapping #2 (wildcard)", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #2 (wildcard)", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "nested mapping #3", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["webpack"], - }, - TestCase { - name: "nested mapping #3 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["webpack"], - }, - TestCase { - name: "nested mapping #4", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["node", "browser"], - }, - TestCase { - name: "nested mapping #4 (wildcard)", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["node", "browser"], - }, - TestCase { - name: "nested mapping #5", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node"], - }, - TestCase { - name: "nested mapping #5 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": { - "webpack": [ - "./wpck/*" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node"], - }, - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - TestCase { - name: "nested mapping #6 (wildcard)", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": { - "webpack": [ - "./wpck/*" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #6 (wildcard)", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./node/*" - ], - "default": { - "node": { - "webpack": [ - "./wpck/*" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - TestCase { - name: "nested mapping #7", - expect: Some(vec!["./y.js"]), - exports_field: exports_field(json!({ - "./a.js": { - "abc": { - "def": "./x.js" - }, - "ghi": "./y.js" - } - })), - request: "./a.js", - condition_names: vec!["abc", "ghi"], - }, - TestCase { - name: "nested mapping #8", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./a.js": { - "abc": { - "def": "./x.js", - "default": [] - }, - "ghi": "./y.js" - } - })), - request: "./a.js", - condition_names: vec!["abc", "ghi"], - }, - TestCase { - name: "syntax sugar #1", - expect: Some(vec!["./main.js"]), - exports_field: exports_field(json!("./main.js")), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #2", - expect: Some(vec![]), - exports_field: exports_field(json!("./main.js")), - request: "./lib.js", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #3", - expect: Some(vec!["./a.js"]), - exports_field: exports_field(json!(["./a.js", "./b.js"])), - request: ".", - condition_names: vec![], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "syntax sugar #3", - expect: Some(vec!["./b.js"]), - exports_field: exports_field(json!(["./b.js"])), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #4", - expect: Some(vec![]), - exports_field: exports_field(json!(["./a.js", "./b.js"])), - request: "./lib.js", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #5", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "browser": { - "default": "./index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "syntax sugar #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "browser": { - "default": "./index.js" - } - })), - request: "./lib.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "syntax sugar #7", - expect: None, - exports_field: exports_field(json!({ - "./node": "./node.js", - "browser": { - "default": "./index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "syntax sugar #8", - expect: None, - exports_field: exports_field(json!({ - "browser": { - "default": "./index.js" - }, - "./node": "./node.js" - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #1", - expect: Some(vec!["./abc/d"]), - exports_field: exports_field(json!({ - "./ab*": "./ab/*", - "./abc*": "./abc/*", - "./a*": "./a/*" - })), - request: "./abcd", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #2", - expect: Some(vec!["./abc/d/e"]), - exports_field: exports_field(json!({ - "./ab*": "./ab/*", - "./abc*": "./abc/*", - "./a*": "./a/*" - })), - request: "./abcd/e", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #3", - expect: Some(vec!["./abc/d"]), - exports_field: exports_field(json!({ - "./x/ab*": "./ab/*", - "./x/abc*": "./abc/*", - "./x/a*": "./a/*" - })), - request: "./x/abcd", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #4", - expect: Some(vec!["./abc/d/e"]), - exports_field: exports_field(json!({ - "./x/ab*": "./ab/*", - "./x/abc*": "./abc/*", - "./x/a*": "./a/*" - })), - request: "./x/abcd/e", - condition_names: vec!["browser"], - }, - TestCase { - name: "path tree edge case #1", - expect: Some(vec!["./A/b/d.js"]), - exports_field: exports_field(json!({ - "./a/": "./A/", - "./a/b/c": "./c.js" - })), - request: "./a/b/d.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #1 (wildcard)", - expect: Some(vec!["./A/b/d.js"]), - exports_field: exports_field(json!({ - "./a/*": "./A/*", - "./a/b/c": "./c.js" - })), - request: "./a/b/d.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #2", - expect: Some(vec!["./A/c.js"]), - exports_field: exports_field(json!({ - "./a/": "./A/", - "./a/b": "./b.js" - })), - request: "./a/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #2 (wildcard)", - expect: Some(vec!["./A/c.js"]), - exports_field: exports_field(json!({ - "./a/*": "./A/*", - "./a/b": "./b.js" - })), - request: "./a/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #3", - expect: Some(vec!["./A/b/d/c.js"]), - exports_field: exports_field(json!({ - "./a/": "./A/", - "./a/b/c/d": "./c.js" - })), - request: "./a/b/d/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #3 (wildcard)", - expect: Some(vec!["./A/b/d/c.js"]), - exports_field: exports_field(json!({ - "./a/*": "./A/*", - "./a/b/c/d": "./c.js" - })), - request: "./a/b/d/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #1", - expect: Some(vec!["./A/b.js"]), - exports_field: exports_field(json!({ - "./a/*.js": "./A/*.js" - })), - request: "./a/b.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #2", - expect: Some(vec!["./A/b/c.js"]), - exports_field: exports_field(json!({ - "./a/*.js": "./A/*.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #3", - expect: Some(vec!["./A/b/c.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": "./A/*/c.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #4", - expect: Some(vec!["./A/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": "./A/*/*.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #5", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/*.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #5", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/*.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./lib/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #6", - expect: Some(vec!["./browser/foo/bar.js"]), - exports_field: exports_field(json!({ - "./lib/*/bar.js": { - "browser": [ - "./browser/*/bar.js" - ] - }, - "./dist/*/bar.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./lib/foo/bar.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #6", - expect: Some(vec!["./browser/foo.js"]), - exports_field: exports_field(json!({ - "./lib/*/bar.js": { - "browser": [ - "./browser/*/bar.js" - ] - }, - "./dist/*/bar.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./dist/foo/bar.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #7", - expect: Some(vec!["./browser/foo/default.js"]), - exports_field: exports_field(json!({ - "./lib/*/bar.js": { - "browser": [ - "./browser/*/bar.js" - ] - }, - "./dist/*/bar.js": { - "node": "./*.js", - "default": "./browser/*/default.js" - } - })), - request: "./dist/foo/bar.js", - condition_names: vec!["default"], - }, - TestCase { - name: "wildcard pattern #8", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": "./A/*/*/*.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #9", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": [ - "./A/*/*/*.js", - "./B/*/*/*.js" - ] - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "wildcard pattern #9", - expect: Some(vec!["./B/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": [ - "./B/*/*/*.js" - ] - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #10", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/foo-*/c.js": "./A/*/*/*.js" - })), - request: "./a/foo-b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #11", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*-foo/c.js": "./A/*/*/*.js" - })), - request: "./a/b-foo/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #12", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/foo-*-foo/c.js": "./A/*/*/*.js" - })), - request: "./a/foo-b-foo/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #13", - expect: Some(vec!["./A/b/c/d.js"]), - exports_field: exports_field(json!({ - "./a/foo-*-foo/c.js": "./A/b/c/d.js" - })), - request: "./a/foo-b-foo/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #14", - expect: Some(vec!["./A/b/c/*.js"]), - exports_field: exports_field(json!({ - "./a/foo-foo/c.js": "./A/b/c/*.js" - })), - request: "./a/foo-foo/c.js", - condition_names: vec![], - }, - ]; - - for case in test_cases { - let resolved = Resolver::new(ResolveOptions { - condition_names: case - .condition_names - .iter() - .map(ToString::to_string) - .collect::>(), - ..ResolveOptions::default() - }) - .package_exports_resolve( - Path::new(""), - case.request, - &case.exports_field, - &mut Ctx::default(), - ) - .map(|p| p.map(|p| p.to_path_buf())); - if let Some(expect) = case.expect { - if expect.is_empty() { - assert!( - matches!(resolved, Err(ResolveError::PackagePathNotExported(_, _))), - "{} {:?}", - &case.name, - &resolved - ); - } else { - for expect in expect { - assert_eq!(resolved, Ok(Some(Path::new(expect).normalize())), "{}", &case.name); - } - } - } else { - assert!(resolved.is_err(), "{} {resolved:?}", &case.name); - } - } -} diff --git a/src/tests/extension_alias.rs b/src/tests/extension_alias.rs deleted file mode 100644 index 86afab73..00000000 --- a/src/tests/extension_alias.rs +++ /dev/null @@ -1,66 +0,0 @@ -//! - -use crate::{ResolveError, ResolveOptions, Resolver}; - -#[test] -fn extension_alias() { - let f = super::fixture().join("extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - extension_alias: vec![ - (".js".into(), vec![".ts".into(), ".js".into()]), - (".mjs".into(), vec![".mts".into()]), - ], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should alias fully specified file", f.clone(), "./index.js", f.join("index.ts")), - ("should alias fully specified file when there are two alternatives", f.clone(), "./dir/index.js", f.join("dir/index.ts")), - ("should also allow the second alternative", f.clone(), "./dir2/index.js", f.join("dir2/index.js")), - ("should support alias option without an array", f.clone(), "./dir2/index.mjs", f.join("dir2/index.mts")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } - - #[rustfmt::skip] - let fail = [ - ("should not allow to fallback to the original extension or add extensions", f, "./index.mjs"), - ]; - - for (comment, path, request) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!(resolution, Err(ResolveError::ExtensionAlias), "{comment} {path:?} {request}"); - } -} - -// should not apply extension alias to extensions or mainFiles field -#[test] -fn not_apply_to_extension_nor_main_files() { - let f = super::fixture().join("extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - extension_alias: vec![(".js".into(), vec![])], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("directory", f.clone(), "./dir2", "dir2/index.js"), - ("file", f.clone(), "./dir2/index", "dir2/index.js"), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - let expected = f.join(expected); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} diff --git a/src/tests/extensions.rs b/src/tests/extensions.rs deleted file mode 100644 index 1ebd86f4..00000000 --- a/src/tests/extensions.rs +++ /dev/null @@ -1,125 +0,0 @@ -//! - -use crate::{EnforceExtension, Resolution, ResolveContext, ResolveError, ResolveOptions, Resolver}; -use rustc_hash::FxHashSet; - -#[test] -fn extensions() { - let f = super::fixture().join("extensions"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".ts".into(), ".js".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve according to order of provided extensions", "./foo", "foo.ts"), - ("should resolve according to order of provided extensions (dir index)", "./dir", "dir/index.ts"), - ("should resolve according to main field in module root", ".", "index.js"), - // This is a core module - // ("should resolve single file module before directory", "module", "node_modules/module.js"), - ("should resolve trailing slash directory before single file", "module/", "node_modules/module/index.ts"), - ]; - - for (comment, request, expected_path) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - let expected = f.join(expected_path); - assert_eq!(resolved_path, Ok(expected), "{comment} {request} {expected_path}"); - } - - #[rustfmt::skip] - let fail = [ - ("not resolve to file when request has a trailing slash (relative)", "./foo.js/", "./foo.js/".into()) - ]; - - for (comment, request, expected_error) in fail { - let resolution = resolver.resolve(&f, request); - let error = ResolveError::NotFound(expected_error); - assert_eq!(resolution, Err(error), "{comment} {request} {resolution:?}"); - } -} - -// should default enforceExtension to true when extensions includes an empty string -#[test] -fn default_enforce_extension() { - let f = super::fixture().join("extensions"); - - let mut ctx = ResolveContext::default(); - let resolved = Resolver::new(ResolveOptions { - extensions: vec![".ts".into(), String::new(), ".js".into()], - ..ResolveOptions::default() - }) - .resolve_with_context(&f, "./foo", &mut ctx); - - assert_eq!(resolved.map(Resolution::into_path_buf), Ok(f.join("foo.ts"))); - assert_eq!( - ctx.file_dependencies, - FxHashSet::from_iter([f.join("foo.ts"), f.join("package.json")]) - ); - assert!(ctx.missing_dependencies.is_empty()); -} - -// should respect enforceExtension when extensions includes an empty string -#[test] -fn respect_enforce_extension() { - let f = super::fixture().join("extensions"); - - let mut ctx = ResolveContext::default(); - let resolved = Resolver::new(ResolveOptions { - enforce_extension: EnforceExtension::Disabled, - extensions: vec![".ts".into(), String::new(), ".js".into()], - ..ResolveOptions::default() - }) - .resolve_with_context(&f, "./foo", &mut ctx); - - assert_eq!(resolved.map(Resolution::into_path_buf), Ok(f.join("foo.ts"))); - assert_eq!( - ctx.file_dependencies, - FxHashSet::from_iter([f.join("foo.ts"), f.join("package.json")]) - ); - assert_eq!(ctx.missing_dependencies, FxHashSet::from_iter([f.join("foo")])); -} - -#[test] -fn multi_dot_extension() { - let f = super::fixture().join("extensions"); - - let resolver = Resolver::new(ResolveOptions { - // Test for `.d.ts`, not part of enhanced-resolve. - extensions: vec![".a.b.c".into(), ".d.ts".into(), ".ts".into(), ".js".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve according to order of provided extensions", "./foo", "foo.ts"), - ("should resolve file with extension", "./app.module", "app.module.js") - ]; - - for (comment, request, expected_path) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - let expected = f.join(expected_path); - assert_eq!(resolved_path, Ok(expected), "{comment} {request} {expected_path}"); - } - - #[rustfmt::skip] - let fail = [ - ("not resolve to file", "./index.", "./index.".into()) - ]; - - for (comment, request, expected_error) in fail { - let resolution = resolver.resolve(&f, request); - let error = ResolveError::NotFound(expected_error); - assert_eq!(resolution, Err(error), "{comment} {request} {resolution:?}"); - } -} - -#[test] -#[should_panic = "All extensions must start with a leading dot"] -fn without_leading_dot() { - Resolver::new(ResolveOptions { - extensions: vec!["ts".into(), "js".into()], - ..ResolveOptions::default() - }); -} diff --git a/src/tests/fallback.rs b/src/tests/fallback.rs deleted file mode 100644 index 3da2d767..00000000 --- a/src/tests/fallback.rs +++ /dev/null @@ -1,100 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/fallback.test.js - -#[test] -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -fn fallback() { - use super::memory_fs::MemoryFS; - use crate::{AliasValue, ResolveError, ResolveOptions, ResolverGeneric}; - use std::path::{Path, PathBuf}; - - let f = Path::new("/"); - - let file_system = MemoryFS::new(&[ - ("/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", ""), - ]); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - fallback: vec![ - ("aliasA".into(), vec![AliasValue::Path("a".into())]), - ("b$".into(), vec![AliasValue::Path("a/index".into())]), - ("c$".into(), vec![AliasValue::Path("/a/index".into())]), - ( - "multiAlias".into(), - vec![ - AliasValue::Path("b".into()), - AliasValue::Path("c".into()), - AliasValue::Path("d".into()), - AliasValue::Path("e".into()), - AliasValue::Path("a".into()), - ], - ), - ("recursive".into(), vec![AliasValue::Path("recursive/dir".into())]), - ("/d/dir".into(), vec![AliasValue::Path("/c/dir".into())]), - ("/d/index.js".into(), vec![AliasValue::Path("/c/index".into())]), - ("ignored".into(), vec![AliasValue::Ignore]), - ("node:path".into(), vec![AliasValue::Ignore]), - ], - modules: vec!["/".into()], - ..ResolveOptions::default() - }, - ); - - #[rustfmt::skip] - let pass = [ - ("should resolve a not aliased module 1", "a", "/a/index"), - ("should resolve a not aliased module 2", "a/index", "/a/index"), - ("should resolve a not aliased module 3", "a/dir", "/a/dir/index"), - ("should resolve a not aliased module 4", "a/dir/index", "/a/dir/index"), - ("should resolve an fallback module 1", "aliasA", "/a/index"), - ("should resolve an fallback module 2", "aliasA/index", "/a/index"), - ("should resolve an fallback module 3", "aliasA/dir", "/a/dir/index"), - ("should resolve an fallback module 4", "aliasA/dir/index", "/a/dir/index"), - ("should resolve a recursive aliased module 1", "recursive", "/recursive/index"), - ("should resolve a recursive aliased module 2", "recursive/index", "/recursive/index"), - ("should resolve a recursive aliased module 3", "recursive/dir", "/recursive/dir/index"), - ("should resolve a recursive aliased module 4", "recursive/dir/index", "/recursive/dir/index"), - ("should resolve a recursive aliased module 5", "recursive/file", "/recursive/dir/file"), - ("should resolve a file aliased module with a query 1", "b?query", "/b/index?query"), - ("should resolve a file aliased module with a query 2", "c?query", "/c/index?query"), - ("should resolve a path in a file aliased module 1", "b/index", "/b/index"), - ("should resolve a path in a file aliased module 2", "b/dir", "/b/dir/index"), - ("should resolve a path in a file aliased module 3", "b/dir/index", "/b/dir/index"), - ("should resolve a path in a file aliased module 4", "c/index", "/c/index"), - ("should resolve a path in a file aliased module 5", "c/dir", "/c/dir/index"), - ("should resolve a path in a file aliased module 6", "c/dir/index", "/c/dir/index"), - ("should resolve a file in multiple aliased dirs 1", "multiAlias/dir/file", "/e/dir/file"), - ("should resolve a file in multiple aliased dirs 2", "multiAlias/anotherDir", "/e/anotherDir/index"), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - - #[rustfmt::skip] - let ignore = [ - ("should resolve an ignore module", "ignored", ResolveError::Ignored(f.join("ignored"))), - ("should resolve node: builtin module", "node:path", ResolveError::Ignored(PathBuf::from("/node:path"))), - ]; - - for (comment, request, expected) in ignore { - let resolution = resolver.resolve(f, request); - assert_eq!(resolution, Err(expected), "{comment} {request}"); - } -} diff --git a/src/tests/full_specified.rs b/src/tests/full_specified.rs deleted file mode 100644 index a70c0191..00000000 --- a/src/tests/full_specified.rs +++ /dev/null @@ -1,113 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/fullSpecified.test.js - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows { - use std::path::PathBuf; - - use crate::{AliasValue, ResolveOptions, ResolverGeneric}; - - use super::super::memory_fs::MemoryFS; - - fn file_system() -> MemoryFS { - MemoryFS::new(&[ - ("/a/node_modules/package1/index.js", ""), - ("/a/node_modules/package1/file.js", ""), - ("/a/node_modules/package2/package.json", r#"{"main":"a"}"#), - ("/a/node_modules/package2/a.js", ""), - ("/a/node_modules/package3/package.json", r#"{"main":"dir"}"#), - ("/a/node_modules/package3/dir/index.js", ""), - ("/a/node_modules/package4/package.json", r#"{"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", ""), - ]) - } - - #[test] - fn test() { - let file_system = file_system(); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - alias: vec![ - ("alias1".into(), vec![AliasValue::from("/a/abc")]), - ("alias2".into(), vec![AliasValue::from("/a")]), - ], - alias_fields: vec![vec!["browser".into()]], - fully_specified: true, - ..ResolveOptions::default() - }, - ); - - let failing_resolves = [ - ("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"), - ]; - - for (comment, request) in failing_resolves { - let resolution = resolver.resolve("/a", request); - assert!(resolution.is_err(), "{comment} {request}"); - } - - let successful_resolves = [ - ("fully relative", "./abc.js", "/a/abc.js"), - ("fully absolute", "/a/abc.js", "/a/abc.js"), - ("fully relative in package", "package1/file.js", "/a/node_modules/package1/file.js"), - ("extensions in mainFiles", "package1", "/a/node_modules/package1/index.js"), - ("extensions in mainFields", "package2", "/a/node_modules/package2/a.js"), - ("extensions in alias", "alias1", "/a/abc.js"), - ("directories in alias", "alias2", "/a/index.js"), - ("directories in packages", "package3", "/a/node_modules/package3/dir/index.js"), - ("extensions in aliasFields", "package4/a.js", "/a/node_modules/package4/b.js"), - ]; - - for (comment, request, expected) in successful_resolves { - let resolution = resolver.resolve("/a", request).map(|r| r.full_path()); - assert_eq!(resolution, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - } - - #[test] - #[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. - fn resolve_to_context() { - let file_system = file_system(); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - alias: vec![ - ("alias1".into(), vec![AliasValue::from("/a/abc")]), - ("alias2".into(), vec![AliasValue::from("/a")]), - ], - alias_fields: vec![vec!["browser".into()]], - fully_specified: true, - resolve_to_context: true, - ..ResolveOptions::default() - }, - ); - - let successful_resolves = [ - ("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", "/a/node_modules/package3/dir"), - ]; - - for (comment, request, expected) in successful_resolves { - let resolution = resolver.resolve("/a", request).map(|r| r.full_path()); - assert_eq!(resolution, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - } -} diff --git a/src/tests/imports_field.rs b/src/tests/imports_field.rs deleted file mode 100644 index c928627a..00000000 --- a/src/tests/imports_field.rs +++ /dev/null @@ -1,1320 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/importsField.test.js -//! -//! The huge imports field test cases are at the bottom of this file. - -use serde_json::json; - -use crate::{Ctx, JSONMap, PathUtil, ResolveError, ResolveOptions, Resolver}; -use std::path::Path; - -#[test] -fn test_simple() { - let f = super::fixture().join("imports-field"); - let f2 = super::fixture().join("imports-exports-wildcard/node_modules/m/"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve using imports field instead of self-referencing", f.clone(), "#imports-field", f.join("b.js")), - ("should resolve using imports field instead of self-referencing for a subpath", f.join("dir"), "#imports-field", f.join("b.js")), - ("should resolve package #1", f.clone(), "#a/dist/main.js", f.join("node_modules/a/lib/lib2/main.js")), - ("should resolve package #3", f.clone(), "#ccc/index.js", f.join("node_modules/c/index.js")), - ("should resolve package #4", f.clone(), "#c", f.join("node_modules/c/index.js")), - ("should resolve with wildcard pattern", f2.clone(), "#internal/i.js", f2.join("src/internal/i.js")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } - - // Note added: - // * should resolve absolute path as an imports field target - // * should log the correct info - - #[rustfmt::skip] - let fail = [ - ("should disallow resolve out of package scope", f.clone(), "#b", ResolveError::InvalidPackageTarget("../b.js".to_string(), "#b".to_string(), f.join("package.json"))), - ("should resolve package #2", f.clone(), "#a", ResolveError::PackageImportNotDefined("#a".to_string(), f.join("package.json"))), - ]; - - for (comment, path, request, error) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!(resolution, Err(error), "{comment} {path:?} {request}"); - } -} - -#[test] -fn shared_resolvers() { - let f = super::fixture().join("imports-field"); - - // field name #1 - let resolver1 = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - imports_fields: vec![vec!["imports".into()]], - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - let resolved_path = resolver1.resolve(&f, "#imports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("b.js"))); - - // field name #2 - let resolver2 = resolver1.clone_with_options(ResolveOptions { - imports_fields: vec![vec!["other".into(), "imports".into()]], - ..ResolveOptions::default() - }); - - let resolved_path = resolver2.resolve(&f, "#b").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("a.js"))); -} - -// Small script for generating the test cases from enhanced_resolve -// for (c of testCases) { -// console.log("TestCase {") -// console.log(`name: ${JSON.stringify(c.name)},`) -// if (c.expect instanceof Error) { -// console.log(`expect: None,`) -// } else { -// console.log(`expect: Some(vec!${JSON.stringify(c.expect)}),`) -// } -// console.log(`imports_field: imports_field(json!(${JSON.stringify(c.suite[0], null, 2)})),`) -// console.log(`request: "${c.suite[1]}",`) -// console.log(`condition_names: vec!${JSON.stringify(c.suite[2])},`) -// console.log("},") -// } - -struct TestCase { - name: &'static str, - expect: Option>, - imports_field: JSONMap, - request: &'static str, - condition_names: Vec<&'static str>, -} - -#[allow(clippy::needless_pass_by_value)] -fn imports_field(value: serde_json::Value) -> JSONMap { - let s = serde_json::to_string(&value).unwrap(); - serde_json::from_str(&s).unwrap() -} - -#[test] -fn test_cases() { - let test_cases = [ - TestCase { - name: "sample #1", - expect: Some(vec!["./dist/test/file.js"]), - imports_field: imports_field(json!({ - "#abc/": { - "import": [ - "./dist/", - "./src/" - ], - "webpack": "./wp/" - }, - "#abc": "./main.js" - })), - request: "#abc/test/file.js", - condition_names: vec!["import", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "sample #1", - expect: Some(vec!["./src/test/file.js"]), - imports_field: imports_field(json!({ - "#abc/": { - "import": [ - "./src/" - ], - "webpack": "./wp/" - }, - "#abc": "./main.js" - })), - request: "#abc/test/file.js", - condition_names: vec!["import", "webpack"], - }, - TestCase { - name: "sample #2", - expect: Some(vec!["./data/timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#1/timezones/": "./data/timezones/" - })), - request: "#1/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #3", - expect: Some(vec!["./data/timezones/timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#aaa/": "./data/timezones/", - "#a/": "./data/timezones/" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #4", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/lib/": { - "browser": [ - "./browser/" - ] - }, - "#a/dist/index.js": { - "node": "./index.js" - } - })), - request: "#a/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #5", - expect: Some(vec!["./browser/index.js"]), - imports_field: imports_field(json!({ - "#a/lib/": { - "browser": [ - "./browser/" - ] - }, - "#a/dist/index.js": { - "node": "./index.js", - "default": "./browser/index.js" - } - })), - request: "#a/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #6", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/dist/a": "./dist/index.js" - })), - request: "#a/dist/aaa", - condition_names: vec![], - }, - TestCase { - name: "sample #7", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/a/a/": "./dist/index.js" - })), - request: "#a/a/a", - condition_names: vec![], - }, - TestCase { - name: "sample #8", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": "./index.js" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #9", - expect: Some(vec!["./main.js"]), - imports_field: imports_field(json!({ - "#a/index.js": "./main.js" - })), - request: "#a/index.js", - condition_names: vec![], - }, - TestCase { - name: "sample #10", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #11", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/bar#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #12", - expect: Some(vec!["./ok.js#abc"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/ok.js#abc", - condition_names: vec![], - }, - TestCase { - name: "sample #13", - expect: Some(vec!["./ok.js?abc"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/ok.js?abc", - condition_names: vec![], - }, - TestCase { - name: "sample #14", - expect: Some(vec!["./🎉.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/🎉.js", - condition_names: vec![], - }, - TestCase { - name: "sample #15", - expect: Some(vec!["./%F0%9F%8E%89.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/%F0%9F%8E%89.js", - condition_names: vec![], - }, - TestCase { - name: "sample #16", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/🎉", - condition_names: vec![], - }, - TestCase { - name: "sample #17", - expect: Some(vec!["./other.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/%F0%9F%8E%89", - condition_names: vec![], - }, - TestCase { - name: "sample #18", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/module", - condition_names: vec![], - }, - TestCase { - name: "sample #19", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/module#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #20", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/module?foo", - condition_names: vec![], - }, - TestCase { - name: "sample #21", - expect: Some(vec!["./d?e?f"]), - imports_field: imports_field(json!({ - "#a/a?b?c/": "./" - })), - request: "#a/a?b?c/d?e?f", - condition_names: vec![], - }, - TestCase { - name: "sample #22", - // We throw InvalidPackageTarget - expect: None, - // expect: Some(vec!["/user/a/index"]), - imports_field: imports_field(json!({ - "#a/": "/user/a/" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #1", - expect: Some(vec!["./A/b/d.js"]), - imports_field: imports_field(json!({ - "#a/": "./A/", - "#a/b/c": "./c.js" - })), - request: "#a/b/d.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #2", - expect: Some(vec!["./A/c.js"]), - imports_field: imports_field(json!({ - "#a/": "./A/", - "#a/b": "./b.js" - })), - request: "#a/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #3", - expect: Some(vec!["./A/b/c/d.js"]), - imports_field: imports_field(json!({ - "#a/": "./A/", - "#a/b/c/d": "./c.js" - })), - request: "#a/b/c/d.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #1", - expect: Some(vec!["./dist/index.js"]), - imports_field: imports_field(json!({ - "#a": "./dist/index.js" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #2", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": "./" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #3", - expect: Some(vec!["./dist/a.js"]), - imports_field: imports_field(json!({ - "#a/": "./dist/", - "#a/index.js": "./dist/a.js" - })), - request: "#a/index.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #4", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "./browser/" - ] - }, - "#a/index.js": { - "browser": "./index.js" - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #5", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "./browser/" - ] - }, - "#a/index.js": { - "node": "./node.js" - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #6", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: "#a", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #7", - expect: Some(vec!["./src/index.js"]), // `enhanced_resolve` is `None` - imports_field: imports_field(json!({ - "#a": { - "default": "./src/index.js", - "browser": "./index.js", - "node": "./src/node/index.js" - } - })), - request: "#a", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #8", - expect: Some(vec!["./src/index.js"]), - imports_field: imports_field(json!({ - "#a": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #9", - expect: Some(vec!["./index"]), - imports_field: imports_field(json!({ - "#a": "./index" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #10", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/index": "./index.js" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #11", - // We throw InvalidPackageTarget - // expect: Some(vec!["b"]), - expect: None, - imports_field: imports_field(json!({ - "#a": "b" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #12", - // We throw InvalidPackageTarget - // expect: Some(vec!["b/index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "b/" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #13", - // We throw InvalidPackageTarget - // expect: Some(vec!["b#anotherhashishere"]), - expect: None, - imports_field: imports_field(json!({ - "#a?q=a#hashishere": "b#anotherhashishere" - })), - request: "#a?q=a#hashishere", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #1", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #2", - expect: Some(vec!["./import.mjs"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec!["import"], - }, - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./require.js"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./import.mjs"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./require.js"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": [ - "./require.js" - ] - }, - { - "import": [ - "./import.mjs", - "#b/import.js" - ] - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./import.mjs"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "./import.mjs", - "#b/import.js" - ] - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "#b/import.js" - ] - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "mapping to a folder root #1", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#timezones": "./data/timezones/" - })), - request: "#timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #2", - expect: None, - imports_field: imports_field(json!({ - "#timezones/": "./data/timezones" - })), - request: "#timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #3", - expect: Some(vec!["./data/timezones/pdt/index.mjs"]), - imports_field: imports_field(json!({ - "#timezones/pdt/": "./data/timezones/pdt/" - })), - request: "#timezones/pdt/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #4", - expect: Some(vec!["./timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#a/": "./timezones/" - })), - request: "#a/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #5", - expect: Some(vec!["./timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#a/": "./" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #6", - expect: None, - imports_field: imports_field(json!({ - "#a/": "." - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #7", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": "./" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #1", - expect: Some(vec!["./lib/index.mjs"]), - imports_field: imports_field(json!({ - "#a/": "./", - "#a/dist/": "./lib/" - })), - request: "#a/dist/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #2", - expect: Some(vec!["./dist/utils/index.js"]), - imports_field: imports_field(json!({ - "#a/dist/utils/": "./dist/utils/", - "#a/dist/": "./lib/" - })), - request: "#a/dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #3", - expect: Some(vec!["./dist/utils/index.js"]), - imports_field: imports_field(json!({ - "#a/dist/utils/index.js": "./dist/utils/index.js", - "#a/dist/utils/": "./dist/utils/index.mjs", - "#a/dist/": "./lib/" - })), - request: "#a/dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #4", - expect: Some(vec!["./lib/index.mjs"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./browser/" - }, - "#a/dist/": "./lib/" - })), - request: "#a/dist/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #1", - // This behaves differently from enhanced_resolve, because `lodash/` is an an InvalidPackageConfig - // expect: Some(vec!["lodash/index.js"]), - expect: Some(vec!["./utils/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "conditional mapping folder #1", - expect: Some(vec!["./utils/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #2", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./node/" - ] - } - })), - request: "#a/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "conditional mapping folder #3", - expect: Some(vec!["./wpk/index.mjs"]), - imports_field: imports_field(json!({ - "#a/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils/" - ] - } - })), - request: "#a/index.mjs", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "incorrect exports field #1", - // We throw `PackageImportNotDefined` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "/utils/": "./a/" - })), - request: "#a/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #2", - // We throw `PackageImportNotDefined` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "/utils/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#a/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #3", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index": "./a/index.js" - })), - request: "#a/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #4", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index.mjs": "./a/index.js" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #5", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "#a/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #6", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index.mjs": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "#a/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #1", - // We don't throw in `package_imports_exports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": "./a/" - })), - request: "/utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect request #2", - // We don't throw in `package_imports_exports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #3", - // We don't throw in `package_imports_exports_resolve`, it's thrown in `package_imports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #4", - // We don't throw in `package_imports_exports_resolve`, it's thrown in `package_imports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#/", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #5", - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#a/", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #1", - // expect: Some(vec!["./dist/index"]), - expect: Some(vec!["dist/index"]), - imports_field: imports_field(json!({ - "#a/../../utils/": "./dist/" - })), - request: "#a/../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #2", - // We throw InvalidPackageTarget - // expect: Some(vec!["./dist/../../utils/index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "./dist/" - })), - request: "#a/../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #3", - // We throw InvalidPackageTarget - // expect: Some(vec!["../src/index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "../src/" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #4", - // We throw InvalidPackageTarget - // expect: Some(vec!["./utils/../../../index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": { - "browser": "./utils/../../../" - } - })), - request: "#a/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #1", - // expect: Some(vec!["moment/node_modules/lodash/dist/index.js"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": { - "browser": "moment/node_modules/" - } - })), - request: "#a/lodash/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #2", - // We throw InvalidPackageTarget - // expect: Some(vec!["../node_modules/lodash/dist/index.js"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "../node_modules/" - })), - request: "#a/lodash/dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "nested mapping #1", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": "./", - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./node/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "nested mapping #3", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["webpack"], - }, - TestCase { - name: "nested mapping #4", - // We throw NotFound - // expect: Some(vec!["moment/node/index.js"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "moment/node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["node", "browser"], - }, - TestCase { - name: "nested mapping #5", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "node"], - }, - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./node/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - TestCase { - name: "nested mapping #7", - expect: Some(vec!["./y.js"]), - imports_field: imports_field(json!({ - "#a": { - "abc": { - "def": "./x.js" - }, - "ghi": "./y.js" - } - })), - request: "#a", - condition_names: vec!["abc", "ghi"], - }, - TestCase { - name: "nested mapping #8", - // We throw PackageImportNotDefined - // expect: Some(vec![]), - expect: None, - imports_field: imports_field(json!({ - "#a": { - "abc": { - "def": "./x.js", - "default": [] - }, - "ghi": "./y.js" - } - })), - request: "#a", - condition_names: vec!["abc", "ghi"], - }, - ]; - - for case in test_cases { - let resolved = Resolver::default() - .package_imports_exports_resolve( - case.request, - &case.imports_field, - Path::new(""), - true, - &case.condition_names.iter().map(ToString::to_string).collect::>(), - &mut Ctx::default(), - ) - .map(|p| p.map(|p| p.to_path_buf())); - if let Some(expect) = case.expect { - if expect.is_empty() { - assert!(matches!(resolved, Ok(None)), "{} {:?}", &case.name, &resolved); - } else { - for expect in expect { - assert_eq!(resolved, Ok(Some(Path::new(expect).normalize())), "{}", &case.name); - } - } - } else { - assert!(resolved.is_err(), "{} {resolved:?}", &case.name); - } - } -} diff --git a/src/tests/incorrect_description_file.rs b/src/tests/incorrect_description_file.rs deleted file mode 100644 index a5c81796..00000000 --- a/src/tests/incorrect_description_file.rs +++ /dev/null @@ -1,62 +0,0 @@ -//! - -use rustc_hash::FxHashSet; - -use crate::{JSONError, Resolution, ResolveContext, ResolveError, ResolveOptions, Resolver}; - -// should not resolve main in incorrect description file #1 -#[test] -fn incorrect_description_file_1() { - let f = super::fixture().join("incorrect-package"); - let mut ctx = ResolveContext::default(); - let resolution = Resolver::default().resolve_with_context(f.join("pack1"), ".", &mut ctx); - let error = ResolveError::JSON(JSONError { - path: f.join("pack1/package.json"), - message: String::from("EOF while parsing a value at line 3 column 0"), - line: 3, - column: 0, - }); - assert_eq!(resolution, Err(error)); - assert_eq!(ctx.file_dependencies, FxHashSet::from_iter([f.join("pack1/package.json")])); - assert!(ctx.missing_dependencies.is_empty()); -} - -// should not resolve main in incorrect description file #2 -#[test] -fn incorrect_description_file_2() { - let f = super::fixture().join("incorrect-package"); - let resolution = Resolver::default().resolve(f.join("pack2"), "."); - let error = ResolveError::JSON(JSONError { - path: f.join("pack2/package.json"), - message: String::from("EOF while parsing a value at line 1 column 0"), - line: 1, - column: 0, - }); - assert_eq!(resolution, Err(error)); -} - -// should not resolve main in incorrect description file #3 -#[test] -fn incorrect_description_file_3() { - let f = super::fixture().join("incorrect-package"); - let resolution = Resolver::default().resolve(f.join("pack2"), "."); - assert!(resolution.is_err()); -} - -// `enhanced_resolve` does not have this test case -#[test] -fn no_description_file() { - let f = super::fixture_root().join("enhanced_resolve"); - - // has description file - let resolver = Resolver::default(); - assert_eq!( - resolver.resolve(&f, ".").map(Resolution::into_path_buf), - Ok(f.join("lib/index.js")) - ); - - // without description file - let resolver = - Resolver::new(ResolveOptions { description_files: vec![], ..ResolveOptions::default() }); - assert_eq!(resolver.resolve(&f, "."), Err(ResolveError::NotFound(".".into()))); -} diff --git a/src/tests/main_field.rs b/src/tests/main_field.rs deleted file mode 100644 index 3cadc8ce..00000000 --- a/src/tests/main_field.rs +++ /dev/null @@ -1,24 +0,0 @@ -//! Not part of enhanced_resolve's test suite - -use crate::{ResolveOptions, Resolver}; - -#[test] -fn test() { - let f = super::fixture().join("restrictions"); - - let resolver1 = Resolver::new(ResolveOptions { - main_fields: vec!["style".into()], - ..ResolveOptions::default() - }); - - let resolution = resolver1.resolve(&f, "pck2").map(|r| r.full_path()); - assert_eq!(resolution, Ok(f.join("node_modules/pck2/index.css"))); - - let resolver2 = resolver1.clone_with_options(ResolveOptions { - main_fields: vec!["module".into(), "main".into()], - ..ResolveOptions::default() - }); - - let resolution = resolver2.resolve(&f, "pck2").map(|r| r.full_path()); - assert_eq!(resolution, Ok(f.join("node_modules/pck2/module.js"))); -} diff --git a/src/tests/memory_fs.rs b/src/tests/memory_fs.rs deleted file mode 100644 index e4116609..00000000 --- a/src/tests/memory_fs.rs +++ /dev/null @@ -1,74 +0,0 @@ -use std::{ - io, - path::{Path, PathBuf}, -}; - -use crate::{FileMetadata, FileSystem}; - -#[derive(Default)] -pub struct MemoryFS { - fs: vfs::MemoryFS, -} - -impl MemoryFS { - /// # Panics - /// - /// * Fails to create directory - /// * Fails to write file - #[allow(dead_code)] - pub fn new(data: &[(&'static str, &'static str)]) -> Self { - let mut fs = Self { fs: vfs::MemoryFS::default() }; - for (path, content) in data { - fs.add_file(Path::new(path), content); - } - fs - } - - #[allow(dead_code)] - pub fn add_file(&mut self, path: &Path, content: &str) { - use vfs::FileSystem; - let fs = &mut self.fs; - // Create all parent directories - for path in path.ancestors().collect::>().iter().rev() { - let path = path.to_string_lossy(); - if !fs.exists(path.as_ref()).unwrap() { - fs.create_dir(path.as_ref()).unwrap(); - } - } - // Create file - let mut file = fs.create_file(path.to_string_lossy().as_ref()).unwrap(); - file.write_all(content.as_bytes()).unwrap(); - } -} - -impl FileSystem for MemoryFS { - fn read_to_string(&self, path: &Path) -> io::Result { - use vfs::FileSystem; - let mut file = self - .fs - .open_file(path.to_string_lossy().as_ref()) - .map_err(|err| io::Error::new(io::ErrorKind::NotFound, err))?; - let mut buffer = String::new(); - file.read_to_string(&mut buffer).unwrap(); - Ok(buffer) - } - - fn metadata(&self, path: &Path) -> io::Result { - use vfs::FileSystem; - let metadata = self - .fs - .metadata(path.to_string_lossy().as_ref()) - .map_err(|err| io::Error::new(io::ErrorKind::NotFound, err))?; - let is_file = metadata.file_type == vfs::VfsFileType::File; - let is_dir = metadata.file_type == vfs::VfsFileType::Directory; - Ok(FileMetadata::new(is_file, is_dir, false)) - } - - fn symlink_metadata(&self, path: &Path) -> io::Result { - self.metadata(path) - } - - fn canonicalize(&self, _path: &Path) -> io::Result { - Err(io::Error::new(io::ErrorKind::NotFound, "not a symlink")) - } -} diff --git a/src/tests/missing.rs b/src/tests/missing.rs deleted file mode 100644 index 4bf611ef..00000000 --- a/src/tests/missing.rs +++ /dev/null @@ -1,106 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/missing.test.js - -use normalize_path::NormalizePath; - -use crate::{AliasValue, ResolveContext, ResolveOptions, Resolver}; - -#[test] -fn test() { - let f = super::fixture(); - - let data = [ - ( - "./missing-file", - vec![f.join("missing-file"), f.join("missing-file.js"), f.join("missing-file.node")], - ), - ( - "missing-module", - vec![ - f.join("node_modules/missing-module"), - f.parent().unwrap().join("node_modules"), // enhanced-resolve is "node_modules/missing-module" - ], - ), - ( - "missing-module/missing-file", - vec![ - f.join("node_modules/missing-module"), - // f.parent().unwrap().join("node_modules/missing-module"), // we don't report this - ], - ), - ( - "m1/missing-file", - vec![ - f.join("node_modules/m1/missing-file"), - f.join("node_modules/m1/missing-file.js"), - f.join("node_modules/m1/missing-file.node"), - // f.parent().unwrap().join("node_modules/m1"), // we don't report this - ], - ), - ( - "m1/", - vec![ - f.join("node_modules/m1/index"), - f.join("node_modules/m1/index.js"), - f.join("node_modules/m1/index.json"), - f.join("node_modules/m1/index.node"), - ], - ), - ("m1/a", vec![f.join("node_modules/m1/a")]), - ]; - - let resolver = Resolver::default(); - - for (specifier, missing_dependencies) in data { - let mut ctx = ResolveContext::default(); - let _ = resolver.resolve_with_context(&f, specifier, &mut ctx); - - for path in ctx.file_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - } - - for path in missing_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - assert!( - ctx.missing_dependencies.contains(&path), - "{specifier}: {path:?} not in {:?}", - &ctx.missing_dependencies - ); - } - } -} - -#[test] -fn alias_and_extensions() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias: vec![ - ( - "@scope-js/package-name/dir$".into(), - vec![AliasValue::Path(f.join("foo/index.js").to_string_lossy().to_string())], - ), - ( - "react-dom".into(), - vec![AliasValue::Path(f.join("foo/index.js").to_string_lossy().to_string())], - ), - ], - extensions: vec![".server.ts".into()], - - ..ResolveOptions::default() - }); - - let mut ctx = ResolveContext::default(); - let _ = resolver.resolve_with_context(&f, "@scope-js/package-name/dir/router", &mut ctx); - let _ = resolver.resolve_with_context(&f, "react-dom/client", &mut ctx); - - for path in ctx.file_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - } - - for path in ctx.missing_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - if let Some(path) = path.parent() { - assert!(!path.is_file(), "{path:?} must not be a file"); - } - } -} diff --git a/src/tests/mod.rs b/src/tests/mod.rs deleted file mode 100644 index 94e6bd86..00000000 --- a/src/tests/mod.rs +++ /dev/null @@ -1,49 +0,0 @@ -mod alias; -mod browser_field; -mod builtins; -mod dependencies; -mod exports_field; -mod extension_alias; -mod extensions; -mod fallback; -mod full_specified; -mod imports_field; -mod incorrect_description_file; -mod main_field; -mod memory_fs; -mod missing; -mod resolve; -mod restrictions; -mod roots; -mod scoped_packages; -mod simple; -mod symlink; -mod tsconfig_paths; -mod tsconfig_project_references; - -use crate::Resolver; -use std::{env, path::PathBuf, sync::Arc, thread}; - -pub fn fixture_root() -> PathBuf { - env::current_dir().unwrap().join("fixtures") -} - -pub fn fixture() -> PathBuf { - fixture_root().join("enhanced_resolve").join("test").join("fixtures") -} - -#[test] -fn threaded_environment() { - let cwd = env::current_dir().unwrap(); - let resolver = Arc::new(Resolver::default()); - for _ in 0..2 { - _ = thread::spawn({ - let cwd = cwd.clone(); - let resolver = Arc::clone(&resolver); - move || { - _ = resolver.resolve(cwd, "."); - } - }) - .join(); - } -} diff --git a/src/tests/resolve.rs b/src/tests/resolve.rs deleted file mode 100644 index f2dbb88e..00000000 --- a/src/tests/resolve.rs +++ /dev/null @@ -1,119 +0,0 @@ -//! - -use crate::{ResolveError, ResolveOptions, Resolver}; - -#[test] -fn resolve() { - let f = super::fixture(); - - let resolver = Resolver::default(); - - let main1_js_path = f.join("main1.js").to_string_lossy().to_string(); - - #[rustfmt::skip] - let pass = [ - ("absolute path", f.clone(), main1_js_path.as_str(), f.join("main1.js")), - ("file with .js", f.clone(), "./main1.js", f.join("main1.js")), - ("file without extension", f.clone(), "./main1", f.join("main1.js")), - ("another file with .js", f.clone(), "./a.js", f.join("a.js")), - ("another file without extension", f.clone(), "./a", f.join("a.js")), - ("file in module with .js", f.clone(), "m1/a.js", f.join("node_modules/m1/a.js")), - ("file in module without extension", f.clone(), "m1/a", f.join("node_modules/m1/a.js")), - ("another file in module without extension", f.clone(), "complexm/step1", f.join("node_modules/complexm/step1.js")), - ("from submodule to file in sibling module", f.join("node_modules/complexm"), "m2/b.js", f.join("node_modules/m2/b.js")), - ("from nested directory to overwritten file in module", f.join("multiple_modules"), "m1/a.js", f.join("multiple_modules/node_modules/m1/a.js")), - ("from nested directory to not overwritten file in module", f.join("multiple_modules"), "m1/b.js", f.join("node_modules/m1/b.js")), - ("file with query", f.clone(), "./main1.js?query", f.join("main1.js?query")), - ("file with fragment", f.clone(), "./main1.js#fragment", f.join("main1.js#fragment")), - ("file with fragment and query", f.clone(), "./main1.js#fragment?query", f.join("main1.js#fragment?query")), - ("file with query and fragment", f.clone(), "./main1.js?#fragment", f.join("main1.js?#fragment")), - - ("file with query (unicode)", f.clone(), "./测试.js?query", f.join("测试.js?query")), - ("file with fragment (unicode)", f.clone(), "./测试.js#fragment", f.join("测试.js#fragment")), - ("file with fragment and query (unicode)", f.clone(), "./测试.js#fragment?query", f.join("测试.js#fragment?query")), - ("file with query and fragment (unicode)", f.clone(), "./测试.js?#fragment", f.join("测试.js?#fragment")), - - ("file in module with query", f.clone(), "m1/a?query", f.join("node_modules/m1/a.js?query")), - ("file in module with fragment", f.clone(), "m1/a#fragment", f.join("node_modules/m1/a.js#fragment")), - ("file in module with fragment and query", f.clone(), "m1/a#fragment?query", f.join("node_modules/m1/a.js#fragment?query")), - ("file in module with query and fragment", f.clone(), "m1/a?#fragment", f.join("node_modules/m1/a.js?#fragment")), - ("file in module with query and fragment", f.clone(), "m1/a?#fragment", f.join("node_modules/m1/a.js?#fragment")), - ("differ between directory and file, resolve file", f.clone(), "./dirOrFile", f.join("dirOrFile.js")), - ("differ between directory and file, resolve directory", f.clone(), "./dirOrFile/", f.join("dirOrFile/index.js")), - ("find node_modules outside of node_modules", f.join("browser-module/node_modules"), "m1/a", f.join("node_modules/m1/a.js")), - ("don't crash on main field pointing to self", f.clone(), "./main-field-self", f.join("./main-field-self/index.js")), - ("don't crash on main field pointing to self (2)", f.clone(), "./main-field-self2", f.join("./main-field-self2/index.js")), - // enhanced-resolve has `#` prepended with a `\0`, they are removed from the - // following 3 expected test results. - // See https://github.com/webpack/enhanced-resolve#escaping - ("handle fragment edge case (no fragment)", f.clone(), "./no#fragment/#/#", f.join("no#fragment/#/#.js")), - ("handle fragment edge case (fragment)", f.clone(), "./no#fragment/#/", f.join("no.js#fragment/#/")), - ("handle fragment escaping", f.clone(), "./no\0#fragment/\0#/\0##fragment", f.join("no#fragment/#/#.js#fragment")), - - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn issue238_resolve() { - let f = super::fixture().join("issue-238"); - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into(), ".jsx".into(), ".ts".into(), ".tsx".into()], - modules: vec!["src/a".into(), "src/b".into(), "src/common".into(), "node_modules".into()], - ..ResolveOptions::default() - }); - let resolved_path = - resolver.resolve(f.join("src/common"), "config/myObjectFile").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("src/common/config/myObjectFile.js")),); -} - -#[test] -fn prefer_relative() { - let f = super::fixture(); - - let resolver = - Resolver::new(ResolveOptions { prefer_relative: true, ..ResolveOptions::default() }); - - #[rustfmt::skip] - let pass = [ - ("should correctly resolve with preferRelative 1", "main1.js", f.join("main1.js")), - ("should correctly resolve with preferRelative 2", "m1/a.js", f.join("node_modules/m1/a.js")), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } -} - -#[test] -fn resolve_to_context() { - let f = super::fixture(); - let resolver = - Resolver::new(ResolveOptions { resolve_to_context: true, ..ResolveOptions::default() }); - - #[rustfmt::skip] - let data = [ - ("context for fixtures", f.clone(), "./", f.clone()), - ("context for fixtures/lib", f.clone(), "./lib", f.join("lib")), - ("context for fixtures with ..", f.clone(), "./lib/../../fixtures/./lib/..", f.clone()), - ("context for fixtures with query", f.clone(), "./?query", f.clone().with_file_name("fixtures?query")), - ]; - - for (comment, path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn resolve_hash_as_module() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions::default()); - let resolution = resolver.resolve(f, "#a"); - assert_eq!(resolution, Err(ResolveError::NotFound("#a".into()))); -} diff --git a/src/tests/restrictions.rs b/src/tests/restrictions.rs deleted file mode 100644 index 5ba56596..00000000 --- a/src/tests/restrictions.rs +++ /dev/null @@ -1,25 +0,0 @@ -//! - -use crate::{ResolveError, ResolveOptions, Resolver, Restriction}; - -// TODO: regex -// * should respect RegExp restriction -// * should try to find alternative #1 -// * should try to find alternative #2 -// * should try to find alternative #3 - -// should respect string restriction -#[test] -fn restriction1() { - let fixture = super::fixture(); - let f = fixture.join("restrictions"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - restrictions: vec![Restriction::Path(f.clone())], - ..ResolveOptions::default() - }); - - let resolution = resolver.resolve(&f, "pck2"); - assert_eq!(resolution, Err(ResolveError::Restriction(fixture.join("c.js"), f))); -} diff --git a/src/tests/roots.rs b/src/tests/roots.rs deleted file mode 100644 index b50e2a07..00000000 --- a/src/tests/roots.rs +++ /dev/null @@ -1,92 +0,0 @@ -//! - -use std::path::PathBuf; - -use crate::{AliasValue, ResolveError, ResolveOptions, Resolver}; - -fn dirname() -> PathBuf { - super::fixture_root().join("enhanced_resolve").join("test") -} - -#[test] -fn roots() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - alias: vec![("foo".into(), vec![AliasValue::from("/fixtures")])], - roots: vec![dirname(), f.clone()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should respect roots option", "/fixtures/b.js", f.join("b.js")), - ("should try another root option, if it exists", "/b.js", f.join("b.js")), - ("should respect extension", "/fixtures/b", f.join("b.js")), - ("should resolve in directory", "/fixtures/extensions/dir", f.join("extensions/dir/index.js")), - ("should respect aliases", "foo/b", f.join("b.js")), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } - - #[rustfmt::skip] - let fail = [ - ("should not work with relative path", "fixtures/b.js", ResolveError::NotFound("fixtures/b.js".into())) - ]; - - for (comment, request, expected) in fail { - let resolution = resolver.resolve(&f, request); - assert_eq!(resolution, Err(expected), "{comment} {request}"); - } -} - -#[test] -fn resolve_to_context() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - roots: vec![dirname(), f.clone()], - resolve_to_context: true, - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f, "/fixtures/lib").map(|r| r.full_path()); - let expected = f.join("lib"); - assert_eq!(resolved_path, Ok(expected)); -} - -#[test] -fn prefer_absolute() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - alias: vec![("foo".into(), vec![AliasValue::from("/fixtures")])], - roots: vec![dirname(), f.clone()], - prefer_absolute: true, - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve an absolute path (prefer absolute)", f.join("b.js").to_string_lossy().to_string(), f.join("b.js")), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(&f, &request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } -} - -#[test] -fn roots_fall_through() { - let f = super::fixture(); - let absolute_path = f.join("roots_fall_through/index.js"); - let specifier = absolute_path.to_string_lossy(); - let resolution = Resolver::new(ResolveOptions::default().with_root(&f)).resolve(&f, &specifier); - assert_eq!( - resolution.map(super::super::resolution::Resolution::into_path_buf), - Ok(absolute_path) - ); -} diff --git a/src/tests/scoped_packages.rs b/src/tests/scoped_packages.rs deleted file mode 100644 index 8258f00f..00000000 --- a/src/tests/scoped_packages.rs +++ /dev/null @@ -1,25 +0,0 @@ -//! - -use crate::{ResolveOptions, Resolver}; - -#[test] -fn scoped_packages() { - let f = super::fixture().join("scoped"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("main field should work", f.clone(), "@scope/pack1", f.join("./node_modules/@scope/pack1/main.js")), - ("browser field should work", f.clone(), "@scope/pack2", f.join("./node_modules/@scope/pack2/main.js")), - ("folder request should work", f.clone(), "@scope/pack2/lib", f.join("./node_modules/@scope/pack2/lib/index.js")) - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} diff --git a/src/tests/simple.rs b/src/tests/simple.rs deleted file mode 100644 index 08e1238a..00000000 --- a/src/tests/simple.rs +++ /dev/null @@ -1,68 +0,0 @@ -//! - -use std::env; - -use crate::Resolver; - -#[test] -fn simple() { - // mimic `enhanced-resolve/test/simple.test.js` - let dirname = env::current_dir().unwrap().join("fixtures"); - let f = dirname.join("enhanced_resolve/test"); - - let resolver = Resolver::default(); - - let data = [ - ("direct", f.clone(), "../lib/index"), - ("as directory", f, ".."), - ("as module", dirname.clone(), "./enhanced_resolve"), - ]; - - for (comment, path, request) in data { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - let expected = dirname.join("enhanced_resolve/lib/index.js"); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn dashed_name() { - let f = super::fixture(); - - let resolver = Resolver::default(); - - let data = [ - (f.clone(), "dash", f.join("node_modules/dash/index.js")), - (f.clone(), "dash-name", f.join("node_modules/dash-name/index.js")), - (f.join("node_modules/dash"), "dash", f.join("node_modules/dash/index.js")), - (f.join("node_modules/dash"), "dash-name", f.join("node_modules/dash-name/index.js")), - (f.join("node_modules/dash-name"), "dash", f.join("node_modules/dash/index.js")), - (f.join("node_modules/dash-name"), "dash-name", f.join("node_modules/dash-name/index.js")), - ]; - - for (path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{path:?} {request}"); - } -} - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows { - use super::super::memory_fs::MemoryFS; - - use crate::ResolveOptions; - - #[test] - fn no_package() { - use crate::ResolverGeneric; - use std::path::Path; - let f = Path::new("/"); - let file_system = MemoryFS::new(&[]); - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions::default(), - ); - let resolved_path = resolver.resolve(f, "package"); - assert!(resolved_path.is_err()); - } -} diff --git a/src/tests/symlink.rs b/src/tests/symlink.rs deleted file mode 100644 index 7589b560..00000000 --- a/src/tests/symlink.rs +++ /dev/null @@ -1,121 +0,0 @@ -use std::{fs, io, path::Path}; - -use crate::{ResolveOptions, Resolver}; - -#[derive(Debug, Clone, Copy)] -enum FileType { - File, - Dir, -} - -#[allow(unused_variables)] -fn symlink, Q: AsRef>( - original: P, - link: Q, - file_type: FileType, -) -> io::Result<()> { - #[cfg(target_family = "unix")] - { - std::os::unix::fs::symlink(original, link) - } - - #[cfg(target_family = "windows")] - match file_type { - FileType::File => std::os::windows::fs::symlink_file(original, link), - FileType::Dir => std::os::windows::fs::symlink_dir(original, link), - } -} - -fn init(dirname: &Path, temp_path: &Path) -> io::Result<()> { - if temp_path.exists() { - _ = fs::remove_dir_all(temp_path); - } - fs::create_dir(temp_path)?; - symlink(dirname.join("../lib/index.js"), temp_path.join("test"), FileType::File)?; - symlink(dirname.join("../lib"), temp_path.join("test2"), FileType::Dir)?; - fs::remove_file(temp_path.join("test"))?; - fs::remove_file(temp_path.join("test2"))?; - fs::remove_dir(temp_path) -} - -fn create_symlinks(dirname: &Path, temp_path: &Path) -> io::Result<()> { - fs::create_dir(temp_path).unwrap(); - symlink( - dirname.join("../lib/index.js").canonicalize().unwrap(), - temp_path.join("index.js"), - FileType::File, - )?; - symlink(dirname.join("../lib").canonicalize().unwrap(), temp_path.join("lib"), FileType::Dir)?; - symlink(dirname.join("..").canonicalize().unwrap(), temp_path.join("this"), FileType::Dir)?; - symlink(temp_path.join("this"), temp_path.join("that"), FileType::Dir)?; - symlink(Path::new("../../lib/index.js"), temp_path.join("node.relative.js"), FileType::File)?; - symlink( - Path::new("./node.relative.js"), - temp_path.join("node.relative.sym.js"), - FileType::File, - )?; - Ok(()) -} - -fn cleanup_symlinks(temp_path: &Path) { - _ = fs::remove_dir_all(temp_path); -} - -#[test] -fn test() -> io::Result<()> { - let root = super::fixture_root().join("enhanced_resolve"); - let dirname = root.join("test"); - let temp_path = dirname.join("temp"); - if !temp_path.exists() { - let is_admin = init(&dirname, &temp_path).is_ok(); - if !is_admin { - return Ok(()); - } - if let Err(err) = create_symlinks(&dirname, &temp_path) { - cleanup_symlinks(&temp_path); - return Err(err); - } - } - - let resolver_without_symlinks = - Resolver::new(ResolveOptions { symlinks: false, ..ResolveOptions::default() }); - let resolver_with_symlinks = Resolver::default(); - - #[rustfmt::skip] - let pass = [ - ("with a symlink to a file", temp_path.clone(), "./index.js"), - ("with a relative symlink to a file", temp_path.clone(), "./node.relative.js"), - ("with a relative symlink to a symlink to a file", temp_path.clone(), "./node.relative.sym.js"), - ("with a symlink to a directory 1", temp_path.clone(), "./lib/index.js"), - ("with a symlink to a directory 2", temp_path.clone(), "./this/lib/index.js"), - ("with multiple symlinks in the path 1", temp_path.clone(), "./this/test/temp/index.js"), - ("with multiple symlinks in the path 2", temp_path.clone(), "./this/test/temp/lib/index.js"), - ("with multiple symlinks in the path 3", temp_path.clone(), "./this/test/temp/this/lib/index.js"), - ("with a symlink to a directory 2 (chained)", temp_path.clone(), "./that/lib/index.js"), - ("with multiple symlinks in the path 1 (chained)", temp_path.clone(), "./that/test/temp/index.js"), - ("with multiple symlinks in the path 2 (chained)", temp_path.clone(), "./that/test/temp/lib/index.js"), - ("with multiple symlinks in the path 3 (chained)", temp_path.clone(), "./that/test/temp/that/lib/index.js"), - ("with symlinked directory as context 1", temp_path.join( "lib"), "./index.js"), - ("with symlinked directory as context 2", temp_path.join( "this"), "./lib/index.js"), - ("with symlinked directory as context and in path", temp_path.join( "this"), "./test/temp/lib/index.js"), - ("with symlinked directory in context path", temp_path.join( "this/lib"), "./index.js"), - ("with symlinked directory in context path and symlinked file", temp_path.join( "this/test"), "./temp/index.js"), - ("with symlinked directory in context path and symlinked directory", temp_path.join( "this/test"), "./temp/lib/index.js"), - ("with symlinked directory as context 2 (chained)", temp_path.join( "that"), "./lib/index.js"), - ("with symlinked directory as context and in path (chained)", temp_path.join( "that"), "./test/temp/lib/index.js"), - ("with symlinked directory in context path (chained)", temp_path.join( "that/lib"), "./index.js"), - ("with symlinked directory in context path and symlinked file (chained)", temp_path.join( "that/test"), "./temp/index.js"), - ("with symlinked directory in context path and symlinked directory (chained)", temp_path.join( "that/test"), "./temp/lib/index.js") - ]; - - for (comment, path, request) in pass { - let filename = resolver_with_symlinks.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(filename, Ok(root.join("lib/index.js")), "{comment:?}"); - - let resolved_path = - resolver_without_symlinks.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(path.join(request))); - } - - Ok(()) -} diff --git a/src/tests/tsconfig_paths.rs b/src/tests/tsconfig_paths.rs deleted file mode 100644 index 26935b5c..00000000 --- a/src/tests/tsconfig_paths.rs +++ /dev/null @@ -1,507 +0,0 @@ -//! tests for tsconfig-paths -//! -//! Fixtures copied from . - -use std::path::{Path, PathBuf}; - -use crate::{ - ResolveError, ResolveOptions, Resolver, TsConfig, TsconfigOptions, TsconfigReferences, -}; - -// -#[test] -fn tsconfig() { - let f = super::fixture_root().join("tsconfig"); - - #[rustfmt::skip] - let pass = [ - (f.clone(), None, "ts-path", f.join("foo.js")), - (f.join("nested"), None, "ts-path", f.join("nested/test.js")), - (f.join("cases/index"), None, "foo", f.join("node_modules/tsconfig-index/foo.js")), - // This requires reading package.json.tsconfig field - // (f.join("cases/field"), "foo", f.join("node_modules/tsconfig-field/foo.js")) - (f.join("cases/exports"), None, "foo", f.join("node_modules/tsconfig-exports/foo.js")), - (f.join("cases/extends-extension"), None, "foo", f.join("cases/extends-extension/foo.js")), - (f.join("cases/extends-extensionless"), None, "foo", f.join("node_modules/tsconfig-field/foo.js")), - (f.join("cases/extends-paths"), Some("src"), "@/index", f.join("cases/extends-paths/src/index.js")), - (f.join("cases/extends-multiple"), None, "foo", f.join("cases/extends-multiple/foo.js")), - ]; - - for (dir, subdir, request, expected) in pass { - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: dir.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - let path = subdir.map_or(dir.clone(), |subdir| dir.join(subdir)); - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{request} {path:?}"); - } - - #[rustfmt::skip] - let data = [ - (f.join("node_modules/tsconfig-not-used"), "ts-path", Ok(f.join("foo.js"))), - ]; - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - for (path, request, expected) in data { - let resolution = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolution, expected, "{path:?} {request}"); - } -} - -#[test] -fn tsconfig_fallthrough() { - let f = super::fixture_root().join("tsconfig"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "/"); - assert_eq!(resolved_path, Err(ResolveError::NotFound("/".into()))); -} - -#[test] -fn json_with_comments() { - let f = super::fixture_root().join("tsconfig/cases/trailing-comma"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "foo").map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(f.join("bar.js"))); -} - -// -#[test] -fn test_paths() { - let path = Path::new("/foo/tsconfig.json"); - let mut tsconfig_json = serde_json::json!({ - "compilerOptions": { - "paths": { - "jquery": ["node_modules/jquery/dist/jquery"], - "*": ["generated/*"], - "bar/*": ["test/*"], - "bar/baz/*": ["baz/*", "yo/*"], - "@/components/*": ["components/*"], - "url": ["node_modules/my-url"], - } - } - }) - .to_string(); - let tsconfig = TsConfig::parse(true, path, &mut tsconfig_json).unwrap(); - - let data = [ - ("jquery", vec!["/foo/node_modules/jquery/dist/jquery"]), - ("test", vec!["/foo/generated/test"]), - ("test/hello", vec!["/foo/generated/test/hello"]), - ("bar/hi", vec!["/foo/test/hi"]), - ("bar/baz/hi", vec!["/foo/baz/hi", "/foo/yo/hi"]), - ("@/components/button", vec!["/foo/components/button"]), - ("./jquery", vec![]), - ("url", vec!["/foo/node_modules/my-url"]), - ]; - - for (specifier, expected) in data { - let paths = tsconfig.resolve_path_alias(specifier); - let expected = expected.into_iter().map(PathBuf::from).collect::>(); - assert_eq!(paths, expected, "{specifier}"); - } -} - -// -#[test] -fn test_base_url() { - let path = Path::new("/foo/tsconfig.json"); - let mut tsconfig_json = serde_json::json!({ - "compilerOptions": { - "baseUrl": "./src" - } - }) - .to_string(); - let tsconfig = TsConfig::parse(true, path, &mut tsconfig_json).unwrap(); - - let data = [ - ("foo", vec!["/foo/src/foo"]), - ("components/button", vec!["/foo/src/components/button"]), - ("./jquery", vec![]), - ]; - - for (specifier, expected) in data { - let paths = tsconfig.resolve_path_alias(specifier); - let expected = expected.into_iter().map(PathBuf::from).collect::>(); - assert_eq!(paths, expected, "{specifier}"); - } -} - -// -#[test] -fn test_paths_and_base_url() { - let path = Path::new("/foo/tsconfig.json"); - let mut tsconfig_json = serde_json::json!({ - "compilerOptions": { - "baseUrl": "./src", - "paths": { - "*": ["generated/*"], - "bar/*": ["test/*"], - "bar/baz/*": ["baz/*", "yo/*"], - "@/components/*": ["components/*"] - } - } - }) - .to_string(); - let tsconfig = TsConfig::parse(true, path, &mut tsconfig_json).unwrap(); - - let data = [ - ("test", vec!["/foo/src/generated/test", "/foo/src/test"]), - ("test/hello", vec!["/foo/src/generated/test/hello", "/foo/src/test/hello"]), - ("bar/hi", vec!["/foo/src/test/hi", "/foo/src/bar/hi"]), - ("bar/baz/hi", vec!["/foo/src/baz/hi", "/foo/src/yo/hi", "/foo/src/bar/baz/hi"]), - ("@/components/button", vec!["/foo/src/components/button", "/foo/src/@/components/button"]), - ("./jquery", vec![]), - ]; - - for (specifier, expected) in data { - let paths = tsconfig.resolve_path_alias(specifier); - let expected = expected.into_iter().map(PathBuf::from).collect::>(); - assert_eq!(paths, expected, "{specifier}"); - } -} - -// Template variable ${configDir} for substitution of config files directory path -// https://github.com/microsoft/TypeScript/pull/58042 -#[test] -fn test_template_variable() { - let f = super::fixture_root().join("tsconfig"); - let f2 = f.join("cases").join("paths_template_variable"); - - #[rustfmt::skip] - let pass = [ - (f2.clone(), "tsconfig1.json", "foo", f2.join("foo.js")), - (f2.clone(), "tsconfig2.json", "foo", f2.join("foo.js")), - (f.clone(), "tsconfig_template_variable.json", "foo", f.join("foo.js")), - ]; - - for (dir, tsconfig, request, expected) in pass { - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: dir.join(tsconfig), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&dir, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{request} {tsconfig} {dir:?}"); - } -} - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows_test { - use std::path::{Path, PathBuf}; - - use crate::{ - ResolveError, ResolveOptions, ResolverGeneric, TsconfigOptions, TsconfigReferences, - }; - - use super::super::memory_fs::MemoryFS; - - struct OneTest { - name: &'static str, - tsconfig: String, - package_json: Option<(PathBuf, String)>, - main_fields: Option>, - existing_files: Vec<&'static str>, - requested_module: &'static str, - expected_path: &'static str, - extensions: Vec, - } - - impl Default for OneTest { - fn default() -> Self { - Self { - name: "", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/*": ["location/*"] - } - } - }) - .to_string(), - package_json: None, - main_fields: None, - existing_files: vec![], - requested_module: "", - expected_path: "", - extensions: vec![ - ".js".into(), - ".json".into(), - ".node".into(), - ".ts".into(), - ".tsx".into(), - ], - } - } - } - - impl OneTest { - fn resolver(&self, root: &Path) -> ResolverGeneric { - let mut file_system = MemoryFS::default(); - - file_system.add_file(&root.join("tsconfig.json"), &self.tsconfig); - if let Some((path, package_json)) = &self.package_json { - file_system.add_file(&root.join(path).join("package.json"), package_json); - } - for path in &self.existing_files { - file_system.add_file(Path::new(path), ""); - } - - let mut options = ResolveOptions { - extensions: self.extensions.clone(), - tsconfig: Some(TsconfigOptions { - config_file: root.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }; - if let Some(main_fields) = &self.main_fields { - options.main_fields.clone_from(main_fields); - } - - ResolverGeneric::::new_with_file_system(file_system, options) - } - } - - // Path matching tests from tsconfig-paths - // * - // * - #[test] - fn match_path() { - let pass = [ - OneTest { - name: "should locate path that matches with star and exists", - existing_files: vec!["/root/location/mylib/index.ts"], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve to correct path when many are specified", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/*": ["foo1/*", "foo2/*", "location/*", "foo3/*"], - } - } - }) - .to_string(), - existing_files: vec!["/root/location/mylib/index.ts"], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should locate path that matches with star and prioritize pattern with longest prefix", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "*": ["location/*"], - "lib/*": ["location/*"], - } - } - }) - .to_string(), - existing_files: vec![ - "/root/location/lib/mylib/index.ts", - "/root/location/mylib/index.ts", - ], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should locate path that matches with star and exists with extension", - existing_files: vec![ - "/root/location/mylib.myext", - ], - requested_module: "lib/mylib", - extensions: vec![".js".into(), ".myext".into()], - expected_path: "/root/location/mylib.myext", - ..OneTest::default() - }, - OneTest { - name: "should resolve request with extension specified", - existing_files: vec![ - "/root/location/test.jpg", - ], - requested_module: "lib/test.jpg", - expected_path: "/root/location/test.jpg", - ..OneTest::default() - }, - OneTest { - name: "should locate path that matches without star and exists", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/foo": ["location/foo"] - } - } - }) - .to_string(), - existing_files: vec![ - "/root/location/foo.ts", - ], - requested_module: "lib/foo", - expected_path: "/root/location/foo.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve to parent folder when filename is in subfolder", - existing_files: vec![ - "/root/location/mylib/index.ts", - ], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve from main field in package.json", - package_json: Some((PathBuf::from("/root/location/mylib"), serde_json::json!({ - "main": "./kalle.ts" - }).to_string())), - existing_files: vec![ - "/root/location/mylib/kalle.ts", - ], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/kalle.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve from main field in package.json (js)", - package_json: Some((PathBuf::from("/root/location/mylib.js"), serde_json::json!({ - "main": "./kalle.js" - }).to_string())), - existing_files: vec![ - "/root/location/mylib.js/kalle.js", - ], - extensions: vec![".ts".into(), ".js".into()], - requested_module: "lib/mylib.js", - expected_path: "/root/location/mylib.js/kalle.js", - ..OneTest::default() - }, - OneTest { - name: "should resolve from list of fields by priority in package.json", - main_fields: Some(vec!["missing".into(), "browser".into(), "main".into()]), - package_json: Some((PathBuf::from("/root/location/mylibjs"), serde_json::json!({ - "main": "./main.js", - "browser": "./browser.js" - }).to_string())), - existing_files: vec![ - "/root/location/mylibjs/main.js", - "/root/location/mylibjs/browser.js", - ], - extensions: vec![".ts".into(), ".js".into()], - requested_module: "lib/mylibjs", - expected_path: "/root/location/mylibjs/browser.js", - ..OneTest::default() - }, -OneTest { - name: "should ignore field mappings to missing files in package.json", - main_fields: Some(vec!["browser".into(), "main".into()]), - package_json: Some((PathBuf::from("/root/location/mylibjs"), serde_json::json!({ - "main": "./kalle.js", - "browser": "./nope.js" - }).to_string())), - existing_files: vec![ - "/root/location/mylibjs/kalle.js", - ], - extensions: vec![".ts".into(), ".js".into()], - requested_module: "lib/mylibjs", - expected_path: "/root/location/mylibjs/kalle.js", - ..OneTest::default() - }, - // Tests that are not applicable: - // name: "should resolve nested main fields" - // name: "should ignore advanced field mappings in package.json" - // name: "should resolve to with the help of baseUrl when not explicitly set" - // name: "should not resolve with the help of baseUrl when asked not to" - // name: "should resolve main file with cjs file extension" - OneTest { - name: "should resolve .ts from .js alias", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "@/*": ["src/*"] - } - } - }).to_string(), - existing_files: vec![ - "/root/src/foo.ts", - ], - requested_module: "@/foo", // original data was "@/foo.ts" but I don't get why it is the case? - expected_path: "/root/src/foo.ts", // original data was "/root/src/foo" - ..OneTest::default() - }, - ]; - - let root = PathBuf::from("/root"); - - for test in pass { - let resolved_path = - test.resolver(&root).resolve(&root, test.requested_module).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(PathBuf::from(test.expected_path)), "{}", test.name); - } - - let fail = [ - OneTest { - name: "should not locate path that does not match", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/*": ["location/*"] - } - } - }) - .to_string(), - existing_files: vec!["/root/location/mylib"], - requested_module: "lib/mylibjs", - ..OneTest::default() - }, - OneTest { - name: "should not resolve typings file (index.d.ts)", - existing_files: vec!["/root/location/mylib/index.d.ts"], - requested_module: "lib/mylib", - ..OneTest::default() - }, - ]; - - for test in fail { - let resolved_path = - test.resolver(&root).resolve(&root, test.requested_module).map(|f| f.full_path()); - assert_eq!( - resolved_path, - Err(ResolveError::NotFound(test.requested_module.into())), - "{}", - test.name - ); - } - } -} diff --git a/src/tests/tsconfig_project_references.rs b/src/tests/tsconfig_project_references.rs deleted file mode 100644 index b552fefe..00000000 --- a/src/tests/tsconfig_project_references.rs +++ /dev/null @@ -1,101 +0,0 @@ -//! Tests for tsconfig project references - -use crate::{ResolveError, ResolveOptions, Resolver, TsconfigOptions, TsconfigReferences}; - -#[test] -fn auto() { - let f = super::fixture_root().join("tsconfig/cases/project_references"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("app"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - // Test normal paths alias - (f.join("app"), "@/index.ts", f.join("app/aliased/index.ts")), - (f.join("app"), "@/../index.ts", f.join("app/index.ts")), - // Test project reference - (f.join("project_a"), "@/index.ts", f.join("project_a/aliased/index.ts")), - (f.join("project_b/src"), "@/index.ts", f.join("project_b/src/aliased/index.ts")), - // Does not have paths alias - (f.join("project_a"), "./index.ts", f.join("project_a/index.ts")), - (f.join("project_c"), "./index.ts", f.join("project_c/index.ts")), - // Template variable - { - let dir = f.parent().unwrap().join("paths_template_variable"); - (dir.clone(), "foo", dir.join("foo.js")) - } - ]; - - for (path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{request} {path:?}"); - } -} - -#[test] -fn disabled() { - let f = super::fixture_root().join("tsconfig/cases/project_references"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("app"), - references: TsconfigReferences::Disabled, - }), - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - // Test normal paths alias - (f.join("app"), "@/index.ts", Ok(f.join("app/aliased/index.ts"))), - (f.join("app"), "@/../index.ts", Ok(f.join("app/index.ts"))), - // Test project reference - (f.join("project_a"), "@/index.ts", Err(ResolveError::NotFound("@/index.ts".into()))), - (f.join("project_b/src"), "@/index.ts", Err(ResolveError::NotFound("@/index.ts".into()))), - // Does not have paths alias - (f.join("project_a"), "./index.ts", Ok(f.join("project_a/index.ts"))), - (f.join("project_c"), "./index.ts", Ok(f.join("project_c/index.ts"))), - ]; - - for (path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, expected, "{request} {path:?}"); - } -} - -#[test] -fn manual() { - let f = super::fixture_root().join("tsconfig/cases/project_references"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("app"), - references: TsconfigReferences::Paths(vec!["../project_a/conf.json".into()]), - }), - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - // Test normal paths alias - (f.join("app"), "@/index.ts", Ok(f.join("app/aliased/index.ts"))), - (f.join("app"), "@/../index.ts", Ok(f.join("app/index.ts"))), - // Test project reference - (f.join("project_a"), "@/index.ts", Ok(f.join("project_a/aliased/index.ts"))), - (f.join("project_b/src"), "@/index.ts", Err(ResolveError::NotFound("@/index.ts".into()))), - // Does not have paths alias - (f.join("project_a"), "./index.ts", Ok(f.join("project_a/index.ts"))), - (f.join("project_c"), "./index.ts", Ok(f.join("project_c/index.ts"))), - ]; - - for (path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, expected, "{request} {path:?}"); - } -} diff --git a/src/tsconfig.rs b/src/tsconfig.rs deleted file mode 100644 index aa00f6e4..00000000 --- a/src/tsconfig.rs +++ /dev/null @@ -1,212 +0,0 @@ -use std::{ - path::{Path, PathBuf}, - sync::Arc, -}; - -use serde::Deserialize; -use typescript_tsconfig_json::{CompilerOptionsPathsMap, ExtendsField}; - -use crate::PathUtil; - -#[derive(Debug, Deserialize)] -#[serde(rename_all = "camelCase")] -pub struct TsConfig { - /// Whether this is the caller tsconfig. - /// Used for final template variable substitution when all configs are extended and merged. - #[serde(skip)] - root: bool, - - /// Path to `tsconfig.json`. Contains the `tsconfig.json` filename. - #[serde(skip)] - path: PathBuf, - - #[serde(default)] - pub extends: Option, - - #[serde(default)] - pub compiler_options: CompilerOptions, - - /// Bubbled up project references with a reference to their tsconfig. - #[serde(default)] - pub references: Vec, -} - -/// Compiler Options -/// -/// -#[derive(Debug, Default, Deserialize)] -#[serde(rename_all = "camelCase")] -pub struct CompilerOptions { - base_url: Option, - - /// Path aliases - paths: Option, - - /// The actual base for where path aliases are resolved from. - #[serde(skip)] - paths_base: PathBuf, -} - -/// Project Reference -/// -/// -#[derive(Debug, Deserialize)] -pub struct ProjectReference { - /// The path property of each reference can point to a directory containing a tsconfig.json file, - /// or to the config file itself (which may have any name). - pub path: PathBuf, - - /// Reference to the resolved tsconfig - #[serde(skip)] - pub tsconfig: Option>, -} - -impl TsConfig { - pub fn parse(root: bool, path: &Path, json: &mut str) -> Result { - _ = json_strip_comments::strip(json); - let mut tsconfig: Self = serde_json::from_str(json)?; - tsconfig.root = root; - tsconfig.path = path.to_path_buf(); - let directory = tsconfig.directory().to_path_buf(); - if let Some(base_url) = tsconfig.compiler_options.base_url { - tsconfig.compiler_options.base_url = Some(directory.normalize_with(base_url)); - } - if tsconfig.compiler_options.paths.is_some() { - tsconfig.compiler_options.paths_base = - tsconfig.compiler_options.base_url.as_ref().map_or(directory, Clone::clone); - } - Ok(tsconfig) - } - - pub fn build(mut self) -> Self { - if self.root { - let dir = self.directory().to_path_buf(); - // Substitute template variable in `tsconfig.compilerOptions.paths` - if let Some(paths) = &mut self.compiler_options.paths { - for paths in paths.values_mut() { - for path in paths { - Self::substitute_template_variable(&dir, path); - } - } - } - } - self - } - - /// Directory to `tsconfig.json` - /// - /// # Panics - /// - /// * When the `tsconfig.json` path is misconfigured. - pub fn directory(&self) -> &Path { - debug_assert!(self.path.file_name().is_some()); - self.path.parent().unwrap() - } - - pub fn extend_tsconfig(&mut self, tsconfig: &Self) { - let compiler_options = &mut self.compiler_options; - if compiler_options.paths.is_none() { - compiler_options.paths_base = compiler_options - .base_url - .as_ref() - .map_or_else(|| tsconfig.compiler_options.paths_base.clone(), Clone::clone); - compiler_options.paths.clone_from(&tsconfig.compiler_options.paths); - } - if compiler_options.base_url.is_none() { - compiler_options.base_url.clone_from(&tsconfig.compiler_options.base_url); - } - } - - pub fn resolve(&self, path: &Path, specifier: &str) -> Vec { - if path.starts_with(self.base_path()) { - let paths = self.resolve_path_alias(specifier); - if !paths.is_empty() { - return paths; - } - } - for tsconfig in self.references.iter().filter_map(|reference| reference.tsconfig.as_ref()) { - if path.starts_with(tsconfig.base_path()) { - return tsconfig.resolve_path_alias(specifier); - } - } - vec![] - } - - // Copied from parcel - // - pub fn resolve_path_alias(&self, specifier: &str) -> Vec { - if specifier.starts_with(|s| s == '/' || s == '.') { - return vec![]; - } - - let base_url_iter = self - .compiler_options - .base_url - .as_ref() - .map_or_else(Vec::new, |base_url| vec![base_url.normalize_with(specifier)]); - - let Some(paths_map) = &self.compiler_options.paths else { - return base_url_iter; - }; - - let paths = paths_map.get(specifier).map_or_else( - || { - let mut longest_prefix_length = 0; - let mut longest_suffix_length = 0; - let mut best_key: Option<&String> = None; - - for key in paths_map.keys() { - if let Some((prefix, suffix)) = key.split_once('*') { - if (best_key.is_none() || prefix.len() > longest_prefix_length) - && specifier.starts_with(prefix) - && specifier.ends_with(suffix) - { - longest_prefix_length = prefix.len(); - longest_suffix_length = suffix.len(); - best_key.replace(key); - } - } - } - - best_key.and_then(|key| paths_map.get(key)).map_or_else(Vec::new, |paths| { - paths - .iter() - .map(|path| { - path.replace( - '*', - &specifier[longest_prefix_length - ..specifier.len() - longest_suffix_length], - ) - }) - .collect::>() - }) - }, - Clone::clone, - ); - - paths - .into_iter() - .map(|p| self.compiler_options.paths_base.normalize_with(p)) - .chain(base_url_iter) - .collect() - } - - fn base_path(&self) -> &Path { - self.compiler_options - .base_url - .as_ref() - .map_or_else(|| self.directory(), |path| path.as_ref()) - } - - /// Template variable `${configDir}` for substitution of config files directory path - /// - /// NOTE: All tests cases are just a head replacement of `${configDir}`, so we are constrained as such. - /// - /// See - fn substitute_template_variable(directory: &Path, path: &mut String) { - const TEMPLATE_VARIABLE: &str = "${configDir}/"; - if let Some(stripped_path) = path.strip_prefix(TEMPLATE_VARIABLE) { - *path = directory.join(stripped_path).to_string_lossy().to_string(); - } - } -} diff --git a/tests/integration_test.rs b/tests/integration_test.rs deleted file mode 100644 index d369413f..00000000 --- a/tests/integration_test.rs +++ /dev/null @@ -1,102 +0,0 @@ -//! Test public APIs - -use std::{env, path::PathBuf}; - -use oxc_resolver::{EnforceExtension, Resolution, ResolveContext, ResolveOptions, Resolver}; - -fn dir() -> PathBuf { - env::current_dir().unwrap() -} - -fn resolve(specifier: &str) -> Resolution { - let path = dir(); - Resolver::new(ResolveOptions::default()).resolve(path, specifier).unwrap() -} - -#[test] -fn clone() { - let resolution = resolve("./tests/package.json"); - assert_eq!(resolution.clone(), resolution); -} - -#[test] -fn debug() { - let resolution = resolve("./tests/package.json"); - let s = format!("{resolution:?}"); - assert!(!s.is_empty()); -} - -#[test] -fn eq() { - let resolution = resolve("./tests/package.json"); - assert_eq!(resolution, resolution); -} - -#[test] -fn package_json() { - let resolution = resolve("./tests/package.json"); - assert!(resolution - .package_json() - .is_some_and(|json| json.name.as_ref().is_some_and(|name| name == "name"))); -} - -#[cfg(feature = "package_json_raw_json_api")] -#[test] -fn package_json_raw_json_api() { - let resolution = resolve("./tests/package.json"); - assert!(resolution - .package_json() - .unwrap() - .raw_json() - .get("name") - .is_some_and(|name| name == "name")); -} - -#[test] -fn clear_cache() { - let resolver = Resolver::new(ResolveOptions::default()); - resolver.clear_cache(); // exists -} - -#[test] -fn options() { - let resolver = Resolver::new(ResolveOptions::default()); - let options = resolver.options(); - assert!(!format!("{options:?}").is_empty()); -} - -#[test] -fn debug_resolver() { - let resolver = Resolver::new(ResolveOptions::default()); - assert!(!format!("{resolver:?}").is_empty()); -} - -#[test] -fn dependencies() { - let path = dir(); - let mut ctx = ResolveContext::default(); - let _ = Resolver::new(ResolveOptions::default()).resolve_with_context( - path, - "./tests/package.json", - &mut ctx, - ); - assert!(!ctx.file_dependencies.is_empty()); - assert!(ctx.missing_dependencies.is_empty()); -} - -#[test] -fn options_api() { - _ = ResolveOptions::default() - .with_builtin_modules(true) - .with_condition_names(&[]) - .with_extension(".js") - .with_force_extension(EnforceExtension::Auto) - .with_fully_specified(true) - .with_main_field("asdf") - .with_main_file("main") - .with_module("module") - .with_prefer_absolute(true) - .with_prefer_relative(true) - .with_root(PathBuf::new()) - .with_symbolic_link(true); -} diff --git a/tests/package.json b/tests/package.json deleted file mode 100644 index f099adcf..00000000 --- a/tests/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "name": "name" -} diff --git a/tests/resolve_test.rs b/tests/resolve_test.rs deleted file mode 100644 index 30d1ceff..00000000 --- a/tests/resolve_test.rs +++ /dev/null @@ -1,104 +0,0 @@ -use std::{env, path::PathBuf}; - -use oxc_resolver::{ResolveError, ResolveOptions, Resolver}; - -fn dir() -> PathBuf { - env::current_dir().unwrap() -} - -#[test] -fn chinese() { - let dir = dir(); - let specifier = "./fixtures/misc/中文/中文.js"; - let resolution = Resolver::new(ResolveOptions::default()).resolve(&dir, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(dir.join("fixtures/misc/中文/中文.js")) - ); -} - -#[test] -fn styled_components() { - let dir = dir(); - let path = dir.join("fixtures/pnpm"); - let module_path = dir.join("node_modules/.pnpm/styled-components@6.1.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/styled-components"); - let specifier = "styled-components"; - - // cjs - let options = - ResolveOptions { alias_fields: vec![vec!["browser".into()]], ..ResolveOptions::default() }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/styled-components.browser.cjs.js")) - ); - - // esm - let options = ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - main_fields: vec!["module".into()], - ..ResolveOptions::default() - }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/styled-components.browser.esm.js")) - ); -} - -#[test] -fn axios() { - let dir = dir(); - let path = dir.join("fixtures/pnpm"); - let module_path = dir.join("node_modules/.pnpm/axios@1.6.2/node_modules/axios"); - let specifier = "axios"; - - // default - let options = ResolveOptions::default(); - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("index.js")) - ); - - // browser - let options = ResolveOptions { - condition_names: vec!["browser".into(), "require".into()], - ..ResolveOptions::default() - }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/browser/axios.cjs")) - ); - - // cjs - let options = ResolveOptions { - condition_names: vec!["node".into(), "require".into()], - ..ResolveOptions::default() - }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/node/axios.cjs")) - ); -} - -#[test] -fn postcss() { - let dir = dir(); - let path = dir.join("fixtures/pnpm"); - let module_path = path.join("node_modules/postcss"); - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - // should ignore "path" - let resolution = resolver.resolve(&module_path, "path"); - assert_eq!(resolution, Err(ResolveError::Ignored(module_path.clone()))); - - // should ignore "./lib/terminal-highlight" - let resolution = resolver.resolve(&module_path, "./lib/terminal-highlight"); - assert_eq!(resolution, Err(ResolveError::Ignored(module_path.join("lib/terminal-highlight")))); -} From 47bc5087cf54c56ec40defb9e3828e6183235adf Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Sat, 22 Jun 2024 17:07:26 +0300 Subject: [PATCH 33/82] squash! --- Cargo.lock | 858 ------ fixtures/enhanced_resolve/lib/index.js | 1 - fixtures/enhanced_resolve/package.json | 4 - fixtures/enhanced_resolve/test/.gitignore | 2 - .../enhanced_resolve/test/fixtures/#/a.js | 0 fixtures/enhanced_resolve/test/fixtures/a.js | 3 - .../enhanced_resolve/test/fixtures/abc.txt | 1 - .../test/fixtures/alias/files/a.js | 0 fixtures/enhanced_resolve/test/fixtures/b.js | 3 - .../browser-module/browser/module-a.js | 0 .../fixtures/browser-module/lib/browser.js | 0 .../fixtures/browser-module/lib/ignore.js | 0 .../test/fixtures/browser-module/lib/main.js | 0 .../fixtures/browser-module/lib/replaced.js | 0 .../test/fixtures/browser-module/lib/self.js | 0 .../fixtures/browser-module/lib/toString.js | 0 .../browser-module/node_modules/module-a.js | 0 .../browser-module/node_modules/module-b.js | 0 .../browser-module/node_modules/module-c.js | 0 .../node_modules/recursive-file/a.js | 0 .../node_modules/recursive-file/b.js | 0 .../node_modules/recursive-file/c.js | 0 .../node_modules/recursive-file/d.js | 0 .../node_modules/recursive-file/package.json | 8 - .../test/fixtures/browser-module/package.json | 33 - .../test/fixtures/builtins/package.json | 12 - fixtures/enhanced_resolve/test/fixtures/c.js | 4 - .../enhanced_resolve/test/fixtures/complex.js | 13 - .../test/fixtures/crypto-js/index.js | 0 .../test/fixtures/crypto-js/package.json | 7 - .../test/fixtures/decorated-fs/exists.js | 0 .../test/fixtures/dirOrFile.js | 1 - .../test/fixtures/dirOrFile/index.js | 1 - .../directory-default/directory-default.js | 0 .../node_modules/@org/pkg/dist/string.js | 1 - .../@org/pkg/dist/string.test.d.ts | 1 - .../node_modules/@org/pkg/package.json | 9 - .../node_modules/pkg/dist/string.js | 1 - .../node_modules/pkg/dist/string.test.d.ts | 1 - .../node_modules/pkg/package.json | 9 - .../node_modules/exports-field/package.json | 7 - .../node_modules/pack1/index.js | 0 .../test/fixtures/exports-field/a.js | 1 - .../node_modules/exports-field/lib/browser.js | 1 - .../node_modules/exports-field/lib/index.js | 0 .../exports-field/lib/lib2/main.js | 1 - .../node_modules/exports-field/lib/main.js | 1 - .../node_modules/exports-field/main.js | 1 - .../node_modules/exports-field/package.json | 18 - .../node_modules/exports-field/x.js | 1 - .../invalid-exports-field/index.js | 0 .../invalid-exports-field/package.json | 13 - .../node_modules/invalid-exports-field/umd.js | 0 .../test/fixtures/exports-field/package.json | 5 - .../node_modules/exports-field/index.js | 1 - .../node_modules/exports-field/lib/browser.js | 1 - .../exports-field/lib/lib2/main.js | 1 - .../node_modules/exports-field/lib/main.js | 1 - .../node_modules/exports-field/main.js | 1 - .../node_modules/exports-field/package.json | 17 - .../node_modules/exports-field/index | 0 .../node_modules/exports-field/main.js | 1 - .../node_modules/exports-field/package.json | 10 - .../node_modules/exports-field/src/index.js | 0 .../fixtures/extension-alias/dir/index.js | 0 .../fixtures/extension-alias/dir/index.ts | 0 .../fixtures/extension-alias/dir2/index.js | 0 .../fixtures/extension-alias/dir2/index.mts | 0 .../test/fixtures/extension-alias/index.js | 0 .../test/fixtures/extension-alias/index.mjs | 0 .../fixtures/extension-alias/index.mts.js | 0 .../test/fixtures/extension-alias/index.ts | 0 .../test/fixtures/extensions/app.module.js | 0 .../test/fixtures/extensions/dir/index.js | 0 .../test/fixtures/extensions/dir/index.ts | 0 .../test/fixtures/extensions/foo.js | 0 .../test/fixtures/extensions/foo.ts | 0 .../test/fixtures/extensions/index.js | 0 .../test/fixtures/extensions/index.ts | 0 .../extensions/node_modules/module.js | 0 .../extensions/node_modules/module/index.ts | 0 .../test/fixtures/extensions/package.json | 3 - .../enhanced_resolve/test/fixtures/file.load1 | 0 .../enhanced_resolve/test/fixtures/file.load2 | 0 .../test/fixtures/foo/index.js | 0 .../test/fixtures/foo/package.json | 4 - .../node_modules/m/package.json | 17 - .../node_modules/m/src/features/f.js | 0 .../m/src/features/internal/file.js | 0 .../node_modules/m/src/features/y/y.js | 0 .../node_modules/m/src/internal/i.js | 0 .../node_modules/m/src/middle-1/f.js | 0 .../node_modules/m/src/middle-1/nested/f.js | 0 .../node_modules/m/src/middle-2/nested/f.js | 1 - .../m/src/middle-3/nested/f/nested/f.js | 0 .../node_modules/m/src/middle-4/f/f.js | 0 .../node_modules/m/src/middle-5/f$/$.js | 0 .../node_modules/m/src/middle-5/f/$.js | 0 .../node_modules/m/src/middle/f.js | 0 .../node_modules/m/src/middle/nested/f.js | 0 .../test/fixtures/imports-field/a.js | 1 - .../test/fixtures/imports-field/b.js | 0 .../test/fixtures/imports-field/dir/b.js | 0 .../node_modules/a/lib/browser.js | 1 - .../imports-field/node_modules/a/lib/index.js | 0 .../node_modules/a/lib/lib2/main.js | 1 - .../imports-field/node_modules/a/lib/main.js | 1 - .../imports-field/node_modules/a/main.js | 1 - .../imports-field/node_modules/a/package.json | 18 - .../imports-field/node_modules/a/x.js | 1 - .../imports-field/node_modules/c/index.js | 0 .../test/fixtures/imports-field/package.json | 17 - .../fixtures/incorrect-package/pack1/a.js | 0 .../incorrect-package/pack1/package.json | 2 - .../fixtures/incorrect-package/pack2/a.js | 0 .../incorrect-package/pack2/package.json | 0 .../test/fixtures/issue-238/package.json | 3 - .../test/fixtures/issue-238/src/a/config.js | 0 .../src/common/config/myObjectFile.js | 0 .../enhanced_resolve/test/fixtures/lib.js | 0 .../test/fixtures/lib/complex1.js | 1 - .../test/fixtures/main-field-self/index.js | 0 .../fixtures/main-field-self/package.json | 3 - .../test/fixtures/main-field-self2/index.js | 0 .../fixtures/main-field-self2/package.json | 3 - .../enhanced_resolve/test/fixtures/main1.js | 9 - .../enhanced_resolve/test/fixtures/main2.js | 12 - .../enhanced_resolve/test/fixtures/main3.js | 4 - .../multiple_modules/node_modules/m1/a.js | 3 - .../test/fixtures/no#fragment/#/#.js | 0 fixtures/enhanced_resolve/test/fixtures/no.js | 0 .../browser-module-broken/browser.js | 0 .../browser-module-broken/main.js | 0 .../browser-module-broken/package.json | 4 - .../complexm/node_modules/m1/a.js | 1 - .../complexm/node_modules/m1/index.js | 1 - .../fixtures/node_modules/complexm/step1.js | 1 - .../fixtures/node_modules/complexm/step2.js | 1 - .../fixtures/node_modules/dash-name/index.js | 0 .../node_modules/dash-name/package.json | 4 - .../test/fixtures/node_modules/dash/index.js | 0 .../fixtures/node_modules/dash/package.json | 4 - .../invalidPackageJson/package.json | 0 .../test/fixtures/node_modules/m1/a.js | 3 - .../test/fixtures/node_modules/m1/b.js | 3 - .../test/fixtures/node_modules/m2/b.js | 1 - .../node_modules/recursive-module/file.js | 0 .../node_modules/recursive-module/index.js | 0 .../test/fixtures/pnp-a/m2/a.js | 3 - .../test/fixtures/pnp/pkg/dir/index.js | 0 .../test/fixtures/pnp/pkg/index.js | 0 .../test/fixtures/pnp/pkg/main.js | 0 .../fixtures/pnp/pkg/package-alias/browser.js | 0 .../fixtures/pnp/pkg/package-alias/index.js | 0 .../test/fixtures/pnp/pkg/package.json | 7 - .../test/fixtures/pnp/pkg/typescript/index.ts | 0 .../test/fixtures/pnp/pkg3/a.js | 1 - .../test/fixtures/pnp/pkg3/package.json | 8 - .../prefer-pnp/alternative-modules/m1/b.js | 0 .../restrictions/node_modules/pck1/index.css | 0 .../restrictions/node_modules/pck1/index.js | 0 .../node_modules/pck1/package.json | 3 - .../restrictions/node_modules/pck2/index.css | 0 .../restrictions/node_modules/pck2/module.js | 0 .../node_modules/pck2/package.json | 5 - .../test/fixtures/roots_fall_through/index.js | 0 .../scoped/node_modules/@scope/pack1/main.js | 0 .../node_modules/@scope/pack1/package.json | 5 - .../node_modules/@scope/pack2/lib/index.js | 0 .../scoped/node_modules/@scope/pack2/main.js | 0 .../node_modules/@scope/pack2/package.json | 3 - .../test/fixtures/shortcutdir.js/a.js | 0 .../test/fixtures/yield/a/foo-2/b | 0 .../test/fixtures/yield/a/foo-2/c | 0 .../test/fixtures/yield/a/foo/a | 0 .../test/fixtures/yield/a/foo/b | 0 .../test/fixtures/yield/b/foo/a | 0 .../test/fixtures/yield/c/foo/a | 0 .../test/fixtures/yield/c/foo/package.json | 7 - .../fixtures/\346\265\213\350\257\225.js" | 0 .../\344\270\255\346\226\207.js" | 0 fixtures/pnpm/.gitignore | 1 - fixtures/pnpm/package.json | 10 - fixtures/pnpm/pnpm-lock.yaml | 212 -- fixtures/tsconfig/cases/builtins/thing.js | 0 .../tsconfig/cases/builtins/tsconfig.json | 5 - fixtures/tsconfig/cases/exports/index.js | 0 fixtures/tsconfig/cases/exports/tsconfig.json | 3 - .../extends-extension/base-tsconfig.json | 7 - .../tsconfig/cases/extends-extension/foo.js | 0 .../cases/extends-extension/tsconfig.json | 3 - .../cases/extends-extensionless/foo.js | 0 .../cases/extends-extensionless/tsconfig.json | 3 - .../tsconfig/cases/extends-multiple/foo.js | 0 .../cases/extends-multiple/tsconfig.json | 6 - .../tsconfig/cases/extends-not-found/index.js | 0 .../cases/extends-not-found/tsconfig.json | 3 - .../tsconfig/cases/extends-paths/src/index.js | 0 .../cases/extends-paths/tsconfig.base.json | 7 - .../cases/extends-paths/tsconfig.json | 6 - fixtures/tsconfig/cases/field/index.js | 0 fixtures/tsconfig/cases/field/tsconfig.json | 3 - fixtures/tsconfig/cases/index/index.js | 0 fixtures/tsconfig/cases/index/tsconfig.json | 3 - .../cases/paths_template_variable/foo.js | 0 .../paths_template_variable/tsconfig1.json | 3 - .../paths_template_variable/tsconfig2.json | 8 - .../project_references/app/aliased/index.ts | 0 .../cases/project_references/app/index.ts | 0 .../project_references/app/tsconfig.json | 23 - .../project_a/aliased/index.ts | 0 .../project_references/project_a/conf.json | 8 - .../project_references/project_a/index.ts | 0 .../project_b/src/aliased/index.ts | 0 .../project_b/tsconfig.json | 9 - .../project_references/project_c/index.ts | 0 .../project_c/tsconfig.json | 5 - .../project_references/tsconfig.base.json | 4 - fixtures/tsconfig/cases/suffixes/a.ios.ts | 0 fixtures/tsconfig/cases/suffixes/a.ts | 0 fixtures/tsconfig/cases/suffixes/b.ts | 0 fixtures/tsconfig/cases/suffixes/c-test.ts | 0 fixtures/tsconfig/cases/suffixes/index.ts | 1 - .../tsconfig/cases/suffixes/tsconfig.json | 5 - fixtures/tsconfig/cases/trailing-comma/bar.js | 0 .../tsconfig/cases/trailing-comma/index.js | 0 .../cases/trailing-comma/tsconfig.json | 9 - fixtures/tsconfig/foo.js | 0 fixtures/tsconfig/nested/index.js | 0 fixtures/tsconfig/nested/test.js | 0 fixtures/tsconfig/nested/tsconfig.json | 8 - .../node_modules/tsconfig-exports/conf.json | 7 - .../node_modules/tsconfig-exports/foo.js | 0 .../tsconfig-exports/package.json | 7 - .../node_modules/tsconfig-field/conf.json | 7 - .../node_modules/tsconfig-field/foo.js | 0 .../node_modules/tsconfig-field/package.json | 5 - .../node_modules/tsconfig-index/foo.js | 0 .../node_modules/tsconfig-index/package.json | 4 - .../node_modules/tsconfig-index/tsconfig.json | 7 - .../node_modules/tsconfig-not-used/foo.js | 0 .../tsconfig-not-used/tsconfig.json | 7 - fixtures/tsconfig/package.json | 24 - fixtures/tsconfig/tsconfig.json | 7 - .../tsconfig/tsconfig_template_variable.json | 7 - napi/__test__/resolver.spec.mjs | 260 -- napi/src/lib.rs | 166 - napi/src/options.rs | 261 -- napi/tests/options.test.mjs | 59 - npm/package.json | 67 +- package.json | 53 +- pnpm-lock.yaml | 2690 ----------------- src/builtins.rs | 71 - src/cache.rs | 369 --- src/context.rs | 89 - src/error.rs | 160 - src/file_system.rs | 133 - src/lib.rs | 1670 ---------- src/options.rs | 623 ---- src/package_json.rs | 207 -- src/path.rs | 132 - src/resolution.rs | 92 - src/specifier.rs | 230 -- src/tests/alias.rs | 280 -- src/tests/browser_field.rs | 189 -- src/tests/builtins.rs | 121 - src/tests/dependencies.rs | 110 - src/tests/exports_field.rs | 2546 ---------------- src/tests/extension_alias.rs | 66 - src/tests/extensions.rs | 125 - src/tests/fallback.rs | 100 - src/tests/full_specified.rs | 113 - src/tests/imports_field.rs | 1320 -------- src/tests/incorrect_description_file.rs | 62 - src/tests/main_field.rs | 24 - src/tests/memory_fs.rs | 74 - src/tests/missing.rs | 106 - src/tests/mod.rs | 49 - src/tests/resolve.rs | 119 - src/tests/restrictions.rs | 25 - src/tests/roots.rs | 92 - src/tests/scoped_packages.rs | 25 - src/tests/simple.rs | 68 - src/tests/symlink.rs | 121 - src/tests/tsconfig_paths.rs | 507 ---- src/tests/tsconfig_project_references.rs | 101 - src/tsconfig.rs | 212 -- tests/integration_test.rs | 102 - tests/package.json | 3 - tests/resolve_test.rs | 104 - 290 files changed, 50 insertions(+), 15709 deletions(-) delete mode 100644 Cargo.lock delete mode 100644 fixtures/enhanced_resolve/lib/index.js delete mode 100644 fixtures/enhanced_resolve/package.json delete mode 100644 fixtures/enhanced_resolve/test/.gitignore delete mode 100644 fixtures/enhanced_resolve/test/fixtures/#/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/abc.txt delete mode 100644 fixtures/enhanced_resolve/test/fixtures/alias/files/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/browser/module-a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/ignore.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/replaced.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/self.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/toString.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-c.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/c.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/d.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/builtins/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/c.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/complex.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/crypto-js/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/decorated-fs/exists.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/dirOrFile.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/directory-default/directory-default.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/pack1/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/umd.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/index delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/src/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.mts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mjs delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mts.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/app.module.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/foo.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/foo.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/file.load1 delete mode 100644 fixtures/enhanced_resolve/test/fixtures/file.load2 delete mode 100644 fixtures/enhanced_resolve/test/fixtures/foo/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/foo/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/internal/file.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/y/y.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/internal/i.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-3/nested/f/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-4/f/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f$/$.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f/$.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/dir/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/c/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/issue-238/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/issue-238/src/a/config.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/issue-238/src/common/config/myObjectFile.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/lib.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/lib/complex1.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self2/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main1.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main2.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main3.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/no#fragment/#/#.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/no.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/invalidPackageJson/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/file.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/dir/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/typescript/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/prefer-pnp/alternative-modules/m1/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.css delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/index.css delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/module.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/roots_fall_through/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/lib/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/shortcutdir.js/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/b delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/c delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo/a delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo/b delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/b/foo/a delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/c/foo/a delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json delete mode 100644 "fixtures/enhanced_resolve/test/fixtures/\346\265\213\350\257\225.js" delete mode 100644 "fixtures/misc/\344\270\255\346\226\207/\344\270\255\346\226\207.js" delete mode 100644 fixtures/pnpm/.gitignore delete mode 100644 fixtures/pnpm/package.json delete mode 100644 fixtures/pnpm/pnpm-lock.yaml delete mode 100644 fixtures/tsconfig/cases/builtins/thing.js delete mode 100644 fixtures/tsconfig/cases/builtins/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/exports/index.js delete mode 100644 fixtures/tsconfig/cases/exports/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-extension/base-tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-extension/foo.js delete mode 100644 fixtures/tsconfig/cases/extends-extension/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-extensionless/foo.js delete mode 100644 fixtures/tsconfig/cases/extends-extensionless/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-multiple/foo.js delete mode 100644 fixtures/tsconfig/cases/extends-multiple/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-not-found/index.js delete mode 100644 fixtures/tsconfig/cases/extends-not-found/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-paths/src/index.js delete mode 100644 fixtures/tsconfig/cases/extends-paths/tsconfig.base.json delete mode 100644 fixtures/tsconfig/cases/extends-paths/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/field/index.js delete mode 100644 fixtures/tsconfig/cases/field/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/index/index.js delete mode 100644 fixtures/tsconfig/cases/index/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/paths_template_variable/foo.js delete mode 100644 fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json delete mode 100644 fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json delete mode 100644 fixtures/tsconfig/cases/project_references/app/aliased/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/app/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/app/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/project_references/project_a/aliased/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_a/conf.json delete mode 100644 fixtures/tsconfig/cases/project_references/project_a/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_b/src/aliased/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_b/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/project_references/project_c/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_c/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/project_references/tsconfig.base.json delete mode 100644 fixtures/tsconfig/cases/suffixes/a.ios.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/a.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/b.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/c-test.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/index.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/trailing-comma/bar.js delete mode 100644 fixtures/tsconfig/cases/trailing-comma/index.js delete mode 100644 fixtures/tsconfig/cases/trailing-comma/tsconfig.json delete mode 100644 fixtures/tsconfig/foo.js delete mode 100644 fixtures/tsconfig/nested/index.js delete mode 100644 fixtures/tsconfig/nested/test.js delete mode 100644 fixtures/tsconfig/nested/tsconfig.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-exports/conf.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-exports/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-exports/package.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-field/conf.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-field/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-field/package.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-index/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-index/package.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-not-used/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json delete mode 100755 fixtures/tsconfig/package.json delete mode 100644 fixtures/tsconfig/tsconfig.json delete mode 100644 fixtures/tsconfig/tsconfig_template_variable.json delete mode 100644 napi/__test__/resolver.spec.mjs delete mode 100644 napi/src/lib.rs delete mode 100644 napi/src/options.rs delete mode 100644 napi/tests/options.test.mjs delete mode 100644 pnpm-lock.yaml delete mode 100644 src/builtins.rs delete mode 100644 src/cache.rs delete mode 100644 src/context.rs delete mode 100644 src/error.rs delete mode 100644 src/file_system.rs delete mode 100644 src/lib.rs delete mode 100644 src/options.rs delete mode 100644 src/package_json.rs delete mode 100644 src/path.rs delete mode 100644 src/resolution.rs delete mode 100644 src/specifier.rs delete mode 100644 src/tests/alias.rs delete mode 100644 src/tests/browser_field.rs delete mode 100644 src/tests/builtins.rs delete mode 100644 src/tests/dependencies.rs delete mode 100644 src/tests/exports_field.rs delete mode 100644 src/tests/extension_alias.rs delete mode 100644 src/tests/extensions.rs delete mode 100644 src/tests/fallback.rs delete mode 100644 src/tests/full_specified.rs delete mode 100644 src/tests/imports_field.rs delete mode 100644 src/tests/incorrect_description_file.rs delete mode 100644 src/tests/main_field.rs delete mode 100644 src/tests/memory_fs.rs delete mode 100644 src/tests/missing.rs delete mode 100644 src/tests/mod.rs delete mode 100644 src/tests/resolve.rs delete mode 100644 src/tests/restrictions.rs delete mode 100644 src/tests/roots.rs delete mode 100644 src/tests/scoped_packages.rs delete mode 100644 src/tests/simple.rs delete mode 100644 src/tests/symlink.rs delete mode 100644 src/tests/tsconfig_paths.rs delete mode 100644 src/tests/tsconfig_project_references.rs delete mode 100644 src/tsconfig.rs delete mode 100644 tests/integration_test.rs delete mode 100644 tests/package.json delete mode 100644 tests/resolve_test.rs diff --git a/Cargo.lock b/Cargo.lock deleted file mode 100644 index c83523b3..00000000 --- a/Cargo.lock +++ /dev/null @@ -1,858 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "aho-corasick" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" -dependencies = [ - "memchr", -] - -[[package]] -name = "anes" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "735d4f398ca57cfa2880225c2bf81c3b9af3be5bb22e44ae70118dad38713e84" - -[[package]] -name = "autocfg" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "bitflags" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" - -[[package]] -name = "bpaf" -version = "0.9.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3280efcf6d66bc77c2cf9b67dc8acee47a217d9be67dd590b3230dffe663724d" - -[[package]] -name = "cast" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "ciborium" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42e69ffd6f0917f5c029256a24d0161db17cea3997d185db0d35926308770f0e" -dependencies = [ - "ciborium-io", - "ciborium-ll", - "serde", -] - -[[package]] -name = "ciborium-io" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05afea1e0a06c9be33d539b876f1ce3692f4afea2cb41f740e7743225ed1c757" - -[[package]] -name = "ciborium-ll" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57663b653d948a338bfb3eeba9bb2fd5fcfaecb9e199e87e1eda4d9e8b240fd9" -dependencies = [ - "ciborium-io", - "half", -] - -[[package]] -name = "clean-path" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aaa6b4b263a5d737e9bf6b7c09b72c41a5480aec4d7219af827f6564e950b6a5" - -[[package]] -name = "codspeed" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a104ac948e0188b921eb3fcbdd55dcf62e542df4c7ab7e660623f6288302089" -dependencies = [ - "colored", - "libc", - "serde_json", -] - -[[package]] -name = "colored" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbf2150cce219b664a8a70df7a1f933836724b503f8a413af9365b4dcc4d90b8" -dependencies = [ - "lazy_static", - "windows-sys 0.48.0", -] - -[[package]] -name = "convert_case" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec182b0ca2f35d8fc196cf3404988fd8b8c739a4d270ff118a398feb0cbec1ca" -dependencies = [ - "unicode-segmentation", -] - -[[package]] -name = "criterion2" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7258985df1aa8b33359ee2392cbc3b7802875242cdacdda91a17a602132c24a9" -dependencies = [ - "anes", - "bpaf", - "cast", - "ciborium", - "codspeed", - "colored", - "num-traits", - "oorandom", - "serde", - "serde_json", - "walkdir", -] - -[[package]] -name = "crossbeam-deque" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" -dependencies = [ - "crossbeam-epoch", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.9.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" -dependencies = [ - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" - -[[package]] -name = "crunchy" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" - -[[package]] -name = "ctor" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edb49164822f3ee45b17acd4a208cfc1251410cf0cad9a833234c9890774dd9f" -dependencies = [ - "quote", - "syn", -] - -[[package]] -name = "dashmap" -version = "5.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" -dependencies = [ - "cfg-if", - "hashbrown", - "lock_api", - "once_cell", - "parking_lot_core", -] - -[[package]] -name = "document-features" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef5282ad69563b5fc40319526ba27e0e7363d552a896f0297d54f767717f9b95" -dependencies = [ - "litrs", -] - -[[package]] -name = "dunce" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b" - -[[package]] -name = "either" -version = "1.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dca9240753cf90908d7e4aac30f630662b02aebaa1b58a3cadabdb23385b58b" - -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "filetime" -version = "0.2.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ee447700ac8aa0b2f2bd7bc4462ad686ba06baa6727ac149a2d6277f0d240fd" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall 0.4.1", - "windows-sys 0.52.0", -] - -[[package]] -name = "half" -version = "2.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dd08c532ae367adf81c312a4580bc67f1d0fe8bc9c460520283f4c0ff277888" -dependencies = [ - "cfg-if", - "crunchy", -] - -[[package]] -name = "hashbrown" -version = "0.14.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" - -[[package]] -name = "indexmap" -version = "2.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" -dependencies = [ - "equivalent", - "hashbrown", - "serde", -] - -[[package]] -name = "itoa" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" - -[[package]] -name = "json-strip-comments" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3d129799327c8f80861e467c59b825ba24c277dba6ad0d71a141dc98f9e04ee" - -[[package]] -name = "lazy_static" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" - -[[package]] -name = "libc" -version = "0.2.155" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" - -[[package]] -name = "libloading" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c2a198fb6b0eada2a8df47933734e6d35d350665a33a3593d7164fa52c75c19" -dependencies = [ - "cfg-if", - "windows-targets 0.52.5", -] - -[[package]] -name = "litrs" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4ce301924b7887e9d637144fdade93f9dfff9b60981d4ac161db09720d39aa5" - -[[package]] -name = "lock_api" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" -dependencies = [ - "autocfg", - "scopeguard", -] - -[[package]] -name = "memchr" -version = "2.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" - -[[package]] -name = "napi" -version = "2.16.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfc300228808a0e6aea5a58115c82889240bcf8dab16fc25ad675b33e454b368" -dependencies = [ - "bitflags 2.5.0", - "ctor", - "napi-derive", - "napi-sys", - "once_cell", - "serde", - "serde_json", -] - -[[package]] -name = "napi-build" -version = "2.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1c0f5d67ee408a4685b61f5ab7e58605c8ae3f2b4189f0127d804ff13d5560a" - -[[package]] -name = "napi-derive" -version = "2.16.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0e034ddf6155192cf83f267ede763fe6c164dfa9971585436b16173718d94c4" -dependencies = [ - "cfg-if", - "convert_case", - "napi-derive-backend", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "napi-derive-backend" -version = "1.0.67" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bff2c00437f3b3266391eb5e6aa25d0029187daf5caf05b8e3271468fb5ae73e" -dependencies = [ - "convert_case", - "once_cell", - "proc-macro2", - "quote", - "regex", - "semver", - "syn", -] - -[[package]] -name = "napi-sys" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "427802e8ec3a734331fec1035594a210ce1ff4dc5bc1950530920ab717964ea3" -dependencies = [ - "libloading", -] - -[[package]] -name = "normalize-path" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5438dd2b2ff4c6df6e1ce22d825ed2fa93ee2922235cc45186991717f0a892d" - -[[package]] -name = "num-traits" -version = "0.2.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" -dependencies = [ - "autocfg", -] - -[[package]] -name = "once_cell" -version = "1.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" - -[[package]] -name = "oorandom" -version = "11.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575" - -[[package]] -name = "oxc_napi_resolver" -version = "0.0.0" -dependencies = [ - "napi", - "napi-build", - "napi-derive", - "oxc_resolver", -] - -[[package]] -name = "oxc_resolver" -version = "1.8.1" -dependencies = [ - "criterion2", - "dashmap", - "document-features", - "dunce", - "json-strip-comments", - "normalize-path", - "once_cell", - "rayon", - "rustc-hash", - "serde", - "serde_json", - "thiserror", - "tracing", - "typescript_tsconfig_json", - "vfs", -] - -[[package]] -name = "parking_lot_core" -version = "0.9.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall 0.5.1", - "smallvec", - "windows-targets 0.52.5", -] - -[[package]] -name = "pin-project-lite" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" - -[[package]] -name = "proc-macro2" -version = "1.0.85" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22244ce15aa966053a896d1accb3a6e68469b97c7f33f284b99f0d576879fc23" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.36" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "rayon" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" -dependencies = [ - "either", - "rayon-core", -] - -[[package]] -name = "rayon-core" -version = "1.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" -dependencies = [ - "crossbeam-deque", - "crossbeam-utils", -] - -[[package]] -name = "redox_syscall" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" -dependencies = [ - "bitflags 1.3.2", -] - -[[package]] -name = "redox_syscall" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "469052894dcb553421e483e4209ee581a45100d31b4018de03e5a7ad86374a7e" -dependencies = [ - "bitflags 2.5.0", -] - -[[package]] -name = "regex" -version = "1.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" -dependencies = [ - "aho-corasick", - "memchr", - "regex-automata", - "regex-syntax", -] - -[[package]] -name = "regex-automata" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", -] - -[[package]] -name = "regex-syntax" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" - -[[package]] -name = "rustc-hash" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" - -[[package]] -name = "ryu" -version = "1.0.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" - -[[package]] -name = "same-file" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "scopeguard" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" - -[[package]] -name = "semver" -version = "1.0.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" - -[[package]] -name = "serde" -version = "1.0.203" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7253ab4de971e72fb7be983802300c30b5a7f0c2e56fab8abfc6a214307c0094" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.203" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "serde_json" -version = "1.0.117" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3" -dependencies = [ - "indexmap", - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "smallvec" -version = "1.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" - -[[package]] -name = "syn" -version = "2.0.66" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c42f3f41a2de00b01c0aaad383c5a45241efc8b2d1eda5661812fda5f3cdcff5" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "thiserror" -version = "1.0.61" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.61" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "tracing" -version = "0.1.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" -dependencies = [ - "pin-project-lite", - "tracing-attributes", - "tracing-core", -] - -[[package]] -name = "tracing-attributes" -version = "0.1.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "tracing-core" -version = "0.1.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" -dependencies = [ - "once_cell", -] - -[[package]] -name = "typescript_tsconfig_json" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7cc416eaf05297012ead9d192226fe9a92e9a20f64f8780efb9085aaae9b590" -dependencies = [ - "clean-path", - "indexmap", - "rustc-hash", - "serde", - "serde_json", -] - -[[package]] -name = "unicode-ident" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" - -[[package]] -name = "unicode-segmentation" -version = "1.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" - -[[package]] -name = "vfs" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "654cd097e182a71dbf899178e6b5662c2157dd0b8afd5975de18008f6fc173d1" -dependencies = [ - "filetime", -] - -[[package]] -name = "walkdir" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" -dependencies = [ - "same-file", - "winapi-util", -] - -[[package]] -name = "winapi-util" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b" -dependencies = [ - "windows-sys 0.52.0", -] - -[[package]] -name = "windows-sys" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" -dependencies = [ - "windows-targets 0.48.5", -] - -[[package]] -name = "windows-sys" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" -dependencies = [ - "windows-targets 0.52.5", -] - -[[package]] -name = "windows-targets" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" -dependencies = [ - "windows_aarch64_gnullvm 0.48.5", - "windows_aarch64_msvc 0.48.5", - "windows_i686_gnu 0.48.5", - "windows_i686_msvc 0.48.5", - "windows_x86_64_gnu 0.48.5", - "windows_x86_64_gnullvm 0.48.5", - "windows_x86_64_msvc 0.48.5", -] - -[[package]] -name = "windows-targets" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" -dependencies = [ - "windows_aarch64_gnullvm 0.52.5", - "windows_aarch64_msvc 0.52.5", - "windows_i686_gnu 0.52.5", - "windows_i686_gnullvm", - "windows_i686_msvc 0.52.5", - "windows_x86_64_gnu 0.52.5", - "windows_x86_64_gnullvm 0.52.5", - "windows_x86_64_msvc 0.52.5", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" - -[[package]] -name = "windows_i686_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" - -[[package]] -name = "windows_i686_gnu" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" - -[[package]] -name = "windows_i686_gnullvm" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" - -[[package]] -name = "windows_i686_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" - -[[package]] -name = "windows_i686_msvc" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" diff --git a/fixtures/enhanced_resolve/lib/index.js b/fixtures/enhanced_resolve/lib/index.js deleted file mode 100644 index 1e872e8f..00000000 --- a/fixtures/enhanced_resolve/lib/index.js +++ /dev/null @@ -1 +0,0 @@ -// mimic enhanced-resolved root directory structure diff --git a/fixtures/enhanced_resolve/package.json b/fixtures/enhanced_resolve/package.json deleted file mode 100644 index d1b845b5..00000000 --- a/fixtures/enhanced_resolve/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "enhanced-resolve", - "main": "lib/index.js" -} diff --git a/fixtures/enhanced_resolve/test/.gitignore b/fixtures/enhanced_resolve/test/.gitignore deleted file mode 100644 index bbbec5f4..00000000 --- a/fixtures/enhanced_resolve/test/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# created by symlink.rs -/temp diff --git a/fixtures/enhanced_resolve/test/fixtures/#/a.js b/fixtures/enhanced_resolve/test/fixtures/#/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/a.js b/fixtures/enhanced_resolve/test/fixtures/a.js deleted file mode 100644 index 896ffc6d..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/abc.txt b/fixtures/enhanced_resolve/test/fixtures/abc.txt deleted file mode 100644 index f2ba8f84..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/abc.txt +++ /dev/null @@ -1 +0,0 @@ -abc \ No newline at end of file diff --git a/fixtures/enhanced_resolve/test/fixtures/alias/files/a.js b/fixtures/enhanced_resolve/test/fixtures/alias/files/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/b.js b/fixtures/enhanced_resolve/test/fixtures/b.js deleted file mode 100644 index 11476340..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/b.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function b() { - return "This is b"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/browser/module-a.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/browser/module-a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/browser.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/ignore.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/ignore.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/replaced.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/replaced.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/self.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/self.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/toString.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/toString.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-a.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-b.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-c.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-c.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/a.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/b.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/c.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/c.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/d.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/d.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json deleted file mode 100644 index c13fe23b..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "browser": { - "a.js": "./a", - "./b.js": "./b", - "c.js": "./d.js", - "./d.js": "./c.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/package.json b/fixtures/enhanced_resolve/test/fixtures/browser-module/package.json deleted file mode 100644 index 19ff7739..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/browser-module/package.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "exports": { - "./lib/index.js": "./lib/index.js" - }, - "browser": { - "./lib/ignore.js": false, - "./lib/replaced.js": "./lib/browser", - "module-a": "./browser/module-a.js", - "module-b": "module-c", - "module-c": "module-c", - "./toString": "./lib/toString.js", - "./lib/main.js": "./lib/main.js", - "./main.js": "./lib/main.js", - "./lib/xyz.js": "./xyz.js", - "./xyz.js": "./lib/xyz.js", - "./lib/non-existent.js": "./lib/non-existent.js", - ".": false, - "./number": 1, - "./foo": "./lib/replaced.js?query" - }, - "innerBrowser1": { - "field": { - "browser": { - "./lib/main1.js": "./lib/main.js" - } - } - }, - "innerBrowser2": { - "browser": { - "./lib/main2.js": "./lib/replaced.js" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/builtins/package.json b/fixtures/enhanced_resolve/test/fixtures/builtins/package.json deleted file mode 100644 index 4a54ea96..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/builtins/package.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "name": "builtins", - "private": true, - "imports": { - "#fs": { - "default": "fs" - }, - "#http": { - "node": "node:http" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/c.js b/fixtures/enhanced_resolve/test/fixtures/c.js deleted file mode 100644 index e3aca8aa..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/c.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = function b() { - require("./a"); - return "This is c"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/complex.js b/fixtures/enhanced_resolve/test/fixtures/complex.js deleted file mode 100644 index 1f62db84..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/complex.js +++ /dev/null @@ -1,13 +0,0 @@ -var 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); diff --git a/fixtures/enhanced_resolve/test/fixtures/crypto-js/index.js b/fixtures/enhanced_resolve/test/fixtures/crypto-js/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json b/fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json deleted file mode 100644 index 1d31aa8b..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "crypto-js", - "main": "index.js", - "browser": { - "crypto": false - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/decorated-fs/exists.js b/fixtures/enhanced_resolve/test/fixtures/decorated-fs/exists.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/dirOrFile.js b/fixtures/enhanced_resolve/test/fixtures/dirOrFile.js deleted file mode 100644 index c3cb885f..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/dirOrFile.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "file"; diff --git a/fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js b/fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js deleted file mode 100644 index 85e01cd4..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "dir"; diff --git a/fixtures/enhanced_resolve/test/fixtures/directory-default/directory-default.js b/fixtures/enhanced_resolve/test/fixtures/directory-default/directory-default.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js deleted file mode 100644 index d1007aae..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js +++ /dev/null @@ -1 +0,0 @@ -export default "string"; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts deleted file mode 100644 index cb0ff5c3..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json deleted file mode 100644 index b523a1e9..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "@org/pkg", - "exports": { - "./*.js": { - "types": "./dist/*.d.ts", - "default": "./dist/*.js" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js deleted file mode 100644 index d1007aae..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js +++ /dev/null @@ -1 +0,0 @@ -export default "string"; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts deleted file mode 100644 index cb0ff5c3..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json deleted file mode 100644 index 8e55fb46..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "@raviqqe/hidash", - "exports": { - "./*.js": { - "types": "./dist/*.d.ts", - "default": "./dist/*.js" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json deleted file mode 100644 index f0edf449..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "exports-field", - "version": "1.0.0", - "exports": { - ".": "./a/../b/../../pack1/index.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/pack1/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/pack1/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/a.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/a.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json deleted file mode 100644 index 6b105c08..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "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/": { - "webpack": ["./lib/lib2/", "./lib/"], - "node": "./lib/", - "default": "./lib/" - }, - "./dist/a.js": "./../../a.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json deleted file mode 100644 index 0012a3de..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "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" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/umd.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/umd.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field/package.json deleted file mode 100644 index 5fa72bb5..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "@exports-field/core", - "version": "1.0.0", - "exports": "./a.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json deleted file mode 100644 index e6f12074..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "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/lib2/", "./lib/"], - "node": "./lib/", - "default": "./lib/" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/index b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/index deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json deleted file mode 100644 index 1a838f49..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "name": "exports-field", - "exportsField": { - "exports": "./main.js" - }, - "ex": "./index", - "broken": { - ".": "./src" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/src/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/src/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.ts b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.mts b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.mts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mjs b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mjs deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mts.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mts.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.ts b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/app.module.js b/fixtures/enhanced_resolve/test/fixtures/extensions/app.module.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.js b/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/foo.js b/fixtures/enhanced_resolve/test/fixtures/extensions/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/foo.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/foo.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/index.js b/fixtures/enhanced_resolve/test/fixtures/extensions/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/index.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module.js b/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module/index.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/package.json b/fixtures/enhanced_resolve/test/fixtures/extensions/package.json deleted file mode 100644 index 5e55a1e8..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/extensions/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "./index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/file.load1 b/fixtures/enhanced_resolve/test/fixtures/file.load1 deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/file.load2 b/fixtures/enhanced_resolve/test/fixtures/file.load2 deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/foo/index.js b/fixtures/enhanced_resolve/test/fixtures/foo/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/foo/package.json b/fixtures/enhanced_resolve/test/fixtures/foo/package.json deleted file mode 100644 index da86787a..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/foo/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "foo", - "version": "1.0.0" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json deleted file mode 100644 index aa2be496..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "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" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/internal/file.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/internal/file.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/y/y.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/y/y.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/internal/i.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/internal/i.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/nested/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js deleted file mode 100644 index e5b70a86..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = { nested: "nested" } diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-3/nested/f/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-3/nested/f/nested/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-4/f/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-4/f/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f$/$.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f$/$.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f/$.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f/$.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/nested/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/a.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/a.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/b.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/dir/b.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/dir/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/index.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json deleted file mode 100644 index 8d8d3a46..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "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/lib2/", "./lib/"], - "node": "./lib/", - "default": "./lib/" - }, - "./dist/a.js": "./../../a.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/c/index.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/c/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/imports-field/package.json deleted file mode 100644 index 248351a9..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "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" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/a.js b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json deleted file mode 100644 index ded7faa2..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json +++ /dev/null @@ -1,2 +0,0 @@ -{ - "main": "./a.js", diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/a.js b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/package.json b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/package.json deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/issue-238/package.json b/fixtures/enhanced_resolve/test/fixtures/issue-238/package.json deleted file mode 100644 index 352055cd..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/issue-238/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "private": true -} diff --git a/fixtures/enhanced_resolve/test/fixtures/issue-238/src/a/config.js b/fixtures/enhanced_resolve/test/fixtures/issue-238/src/a/config.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/issue-238/src/common/config/myObjectFile.js b/fixtures/enhanced_resolve/test/fixtures/issue-238/src/common/config/myObjectFile.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/lib.js b/fixtures/enhanced_resolve/test/fixtures/lib.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/lib/complex1.js b/fixtures/enhanced_resolve/test/fixtures/lib/complex1.js deleted file mode 100644 index b3de3d70..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/lib/complex1.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "lib complex1"; diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self/index.js b/fixtures/enhanced_resolve/test/fixtures/main-field-self/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json b/fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json deleted file mode 100644 index a2b6f341..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "./" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self2/index.js b/fixtures/enhanced_resolve/test/fixtures/main-field-self2/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json b/fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json deleted file mode 100644 index 4fa6f730..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "." -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main1.js b/fixtures/enhanced_resolve/test/fixtures/main1.js deleted file mode 100644 index 168f2a1e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main1.js +++ /dev/null @@ -1,9 +0,0 @@ -var a = require("./a"); -if (x) { - for (var i = 0; i < 100; i++) { - while (true) require("./b"); - do { - i++; - } while (require("m1/a")()); - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main2.js b/fixtures/enhanced_resolve/test/fixtures/main2.js deleted file mode 100644 index 39f062b1..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main2.js +++ /dev/null @@ -1,12 +0,0 @@ -var 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"); - }); - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main3.js b/fixtures/enhanced_resolve/test/fixtures/main3.js deleted file mode 100644 index 1c180166..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main3.js +++ /dev/null @@ -1,4 +0,0 @@ -var a = require("./a"); -require.ensure([], function(require) { - require("./c.js"); -}); diff --git a/fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js b/fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js deleted file mode 100644 index 997c1051..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is nested m1/a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/no#fragment/#/#.js b/fixtures/enhanced_resolve/test/fixtures/no#fragment/#/#.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/no.js b/fixtures/enhanced_resolve/test/fixtures/no.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/browser.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/browser.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/main.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json deleted file mode 100644 index c469e1fd..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "main": "./main.js", - "browser": "./browser.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js deleted file mode 100644 index 549620a5..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "the correct a.js"; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js deleted file mode 100644 index 5db6632e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = " :) " + require("m2/b.js"); diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js deleted file mode 100644 index d308569d..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require("m1/a") + require("m1"); diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js deleted file mode 100644 index cb8127e8..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "Step2"; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json deleted file mode 100644 index 8d6dfa56..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "dash-name", - "exports": "./index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json deleted file mode 100644 index 4fd8706e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "dash", - "exports": "./index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/invalidPackageJson/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/invalidPackageJson/package.json deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js deleted file mode 100644 index 46fc8e6c..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is m1/a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js deleted file mode 100644 index 8565c244..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is m1/b"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js deleted file mode 100644 index 34faaaf5..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "This is m2/b"; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/file.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/file.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js b/fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js deleted file mode 100644 index 997c1051..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is nested m1/a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/dir/index.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/dir/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/index.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/main.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/browser.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/browser.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/index.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json deleted file mode 100644 index e20ceaeb..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "main": "main.js", - "browser": { - "./package-alias/index.js": "./package-alias/browser.js", - "module": "pkg/dir/index" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/typescript/index.ts b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/typescript/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json deleted file mode 100644 index 4a1f838e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "@exports-field/core", - "version": "1.0.0", - "exports": { - ".": "./a.js", - "./x": "./a.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/prefer-pnp/alternative-modules/m1/b.js b/fixtures/enhanced_resolve/test/fixtures/prefer-pnp/alternative-modules/m1/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.css b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.css deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.js b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json deleted file mode 100644 index 14ab704d..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/index.css b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/index.css deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/module.js b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/module.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json deleted file mode 100644 index ee0eb71b..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "main": "../../../c.js", - "module": "module.js", - "style": "index.css" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/roots_fall_through/index.js b/fixtures/enhanced_resolve/test/fixtures/roots_fall_through/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/main.js b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json deleted file mode 100644 index 70a0f20f..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "browser": { - "./index.js": "./main.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/lib/index.js b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/lib/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/main.js b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json deleted file mode 100644 index 2af9e0d1..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "./main.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/shortcutdir.js/a.js b/fixtures/enhanced_resolve/test/fixtures/shortcutdir.js/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/b b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/b deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/c b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/c deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/a b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/a deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/b b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/b deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/b/foo/a b/fixtures/enhanced_resolve/test/fixtures/yield/b/foo/a deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/a b/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/a deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json b/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json deleted file mode 100644 index 0acc4b4c..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "foo", - "version": "1.0.0", - "browser": { - "./a": false - } -} diff --git "a/fixtures/enhanced_resolve/test/fixtures/\346\265\213\350\257\225.js" "b/fixtures/enhanced_resolve/test/fixtures/\346\265\213\350\257\225.js" deleted file mode 100644 index e69de29b..00000000 diff --git "a/fixtures/misc/\344\270\255\346\226\207/\344\270\255\346\226\207.js" "b/fixtures/misc/\344\270\255\346\226\207/\344\270\255\346\226\207.js" deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/pnpm/.gitignore b/fixtures/pnpm/.gitignore deleted file mode 100644 index 3c3629e6..00000000 --- a/fixtures/pnpm/.gitignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/fixtures/pnpm/package.json b/fixtures/pnpm/package.json deleted file mode 100644 index 78712e2b..00000000 --- a/fixtures/pnpm/package.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "name": "pnpm", - "version": "1.0.0", - "private": true, - "devDependencies": { - "axios": "1.6.2", - "styled-components": "6.1.1", - "postcss": "8.4.33" - } -} diff --git a/fixtures/pnpm/pnpm-lock.yaml b/fixtures/pnpm/pnpm-lock.yaml deleted file mode 100644 index e51dfd6a..00000000 --- a/fixtures/pnpm/pnpm-lock.yaml +++ /dev/null @@ -1,212 +0,0 @@ -lockfileVersion: '6.0' - -settings: - autoInstallPeers: true - excludeLinksFromLockfile: false - -devDependencies: - axios: - specifier: 1.6.2 - version: 1.6.2 - postcss: - specifier: 8.4.33 - version: 8.4.33 - styled-components: - specifier: 6.1.1 - version: 6.1.1(react-dom@18.2.0)(react@18.2.0) - -packages: - - /@emotion/is-prop-valid@1.2.1: - resolution: {integrity: sha512-61Mf7Ufx4aDxx1xlDeOm8aFFigGHE4z+0sKCa+IHCeZKiyP9RLD0Mmx7m8b9/Cf37f7NAvQOOJAbQQGVr5uERw==} - dependencies: - '@emotion/memoize': 0.8.1 - dev: true - - /@emotion/memoize@0.8.1: - resolution: {integrity: sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA==} - dev: true - - /@emotion/unitless@0.8.1: - resolution: {integrity: sha512-KOEGMu6dmJZtpadb476IsZBclKvILjopjUii3V+7MnXIQCYh8W3NgNcgwo21n9LXZX6EDIKvqfjYxXebDwxKmQ==} - dev: true - - /@types/stylis@4.2.4: - resolution: {integrity: sha512-36ZrGJ8fgtBr6nwNnuJ9jXIj+bn/pF6UoqmrQT7+Y99+tFFeHHsoR54+194dHdyhPjgbeoNz3Qru0oRt0l6ASQ==} - dev: true - - /asynckit@0.4.0: - resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} - dev: true - - /axios@1.6.2: - resolution: {integrity: sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A==} - dependencies: - follow-redirects: 1.15.3 - form-data: 4.0.0 - proxy-from-env: 1.1.0 - transitivePeerDependencies: - - debug - dev: true - - /camelize@1.0.1: - resolution: {integrity: sha512-dU+Tx2fsypxTgtLoE36npi3UqcjSSMNYfkqgmoEhtZrraP5VWq0K7FkWVTYa8eMPtnU/G2txVsfdCJTn9uzpuQ==} - dev: true - - /combined-stream@1.0.8: - resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} - engines: {node: '>= 0.8'} - dependencies: - delayed-stream: 1.0.0 - dev: true - - /css-color-keywords@1.0.0: - resolution: {integrity: sha512-FyyrDHZKEjXDpNJYvVsV960FiqQyXc/LlYmsxl2BcdMb2WPx0OGRVgTg55rPSyLSNMqP52R9r8geSp7apN3Ofg==} - engines: {node: '>=4'} - dev: true - - /css-to-react-native@3.2.0: - resolution: {integrity: sha512-e8RKaLXMOFii+02mOlqwjbD00KSEKqblnpO9e++1aXS1fPQOpS1YoqdVHBqPjHNoxeF2mimzVqawm2KCbEdtHQ==} - dependencies: - camelize: 1.0.1 - css-color-keywords: 1.0.0 - postcss-value-parser: 4.2.0 - dev: true - - /csstype@3.1.2: - resolution: {integrity: sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==} - dev: true - - /delayed-stream@1.0.0: - resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} - engines: {node: '>=0.4.0'} - dev: true - - /follow-redirects@1.15.3: - resolution: {integrity: sha512-1VzOtuEM8pC9SFU1E+8KfTjZyMztRsgEfwQl44z8A25uy13jSzTj6dyK2Df52iV0vgHCfBwLhDWevLn95w5v6Q==} - engines: {node: '>=4.0'} - peerDependencies: - debug: '*' - peerDependenciesMeta: - debug: - optional: true - dev: true - - /form-data@4.0.0: - resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==} - engines: {node: '>= 6'} - dependencies: - asynckit: 0.4.0 - combined-stream: 1.0.8 - mime-types: 2.1.35 - dev: true - - /js-tokens@4.0.0: - resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} - dev: true - - /loose-envify@1.4.0: - resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==} - hasBin: true - dependencies: - js-tokens: 4.0.0 - dev: true - - /mime-db@1.52.0: - resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} - engines: {node: '>= 0.6'} - dev: true - - /mime-types@2.1.35: - resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} - engines: {node: '>= 0.6'} - dependencies: - mime-db: 1.52.0 - dev: true - - /nanoid@3.3.7: - resolution: {integrity: sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==} - engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} - hasBin: true - dev: true - - /picocolors@1.0.0: - resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==} - dev: true - - /postcss-value-parser@4.2.0: - resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==} - dev: true - - /postcss@8.4.33: - resolution: {integrity: sha512-Kkpbhhdjw2qQs2O2DGX+8m5OVqEcbB9HRBvuYM9pgrjEFUg30A9LmXNlTAUj4S9kgtGyrMbTzVjH7E+s5Re2yg==} - engines: {node: ^10 || ^12 || >=14} - dependencies: - nanoid: 3.3.7 - picocolors: 1.0.0 - source-map-js: 1.0.2 - dev: true - - /proxy-from-env@1.1.0: - resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==} - dev: true - - /react-dom@18.2.0(react@18.2.0): - resolution: {integrity: sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==} - peerDependencies: - react: ^18.2.0 - dependencies: - loose-envify: 1.4.0 - react: 18.2.0 - scheduler: 0.23.0 - dev: true - - /react@18.2.0: - resolution: {integrity: sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==} - engines: {node: '>=0.10.0'} - dependencies: - loose-envify: 1.4.0 - dev: true - - /scheduler@0.23.0: - resolution: {integrity: sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw==} - dependencies: - loose-envify: 1.4.0 - dev: true - - /shallowequal@1.1.0: - resolution: {integrity: sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ==} - dev: true - - /source-map-js@1.0.2: - resolution: {integrity: sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==} - engines: {node: '>=0.10.0'} - dev: true - - /styled-components@6.1.1(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-cpZZP5RrKRIClBW5Eby4JM1wElLVP4NQrJbJ0h10TidTyJf4SIIwa3zLXOoPb4gJi8MsJ8mjq5mu2IrEhZIAcQ==} - engines: {node: '>= 16'} - peerDependencies: - react: '>= 16.8.0' - react-dom: '>= 16.8.0' - dependencies: - '@emotion/is-prop-valid': 1.2.1 - '@emotion/unitless': 0.8.1 - '@types/stylis': 4.2.4 - css-to-react-native: 3.2.0 - csstype: 3.1.2 - postcss: 8.4.33 - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - shallowequal: 1.1.0 - stylis: 4.3.0 - tslib: 2.6.2 - dev: true - - /stylis@4.3.0: - resolution: {integrity: sha512-E87pIogpwUsUwXw7dNyU4QDjdgVMy52m+XEOPEKUn161cCzWjjhPSQhByfd1CcNvrOLnXQ6OnnZDwnJrz/Z4YQ==} - dev: true - - /tslib@2.6.2: - resolution: {integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==} - dev: true diff --git a/fixtures/tsconfig/cases/builtins/thing.js b/fixtures/tsconfig/cases/builtins/thing.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/builtins/tsconfig.json b/fixtures/tsconfig/cases/builtins/tsconfig.json deleted file mode 100644 index 36aa1a4d..00000000 --- a/fixtures/tsconfig/cases/builtins/tsconfig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compilerOptions": { - "baseUrl": "." - } -} diff --git a/fixtures/tsconfig/cases/exports/index.js b/fixtures/tsconfig/cases/exports/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/exports/tsconfig.json b/fixtures/tsconfig/cases/exports/tsconfig.json deleted file mode 100644 index f0e3159b..00000000 --- a/fixtures/tsconfig/cases/exports/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-exports" -} diff --git a/fixtures/tsconfig/cases/extends-extension/base-tsconfig.json b/fixtures/tsconfig/cases/extends-extension/base-tsconfig.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/cases/extends-extension/base-tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/cases/extends-extension/foo.js b/fixtures/tsconfig/cases/extends-extension/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-extension/tsconfig.json b/fixtures/tsconfig/cases/extends-extension/tsconfig.json deleted file mode 100644 index 0ae4c6a3..00000000 --- a/fixtures/tsconfig/cases/extends-extension/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./base-tsconfig" -} diff --git a/fixtures/tsconfig/cases/extends-extensionless/foo.js b/fixtures/tsconfig/cases/extends-extensionless/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-extensionless/tsconfig.json b/fixtures/tsconfig/cases/extends-extensionless/tsconfig.json deleted file mode 100644 index c36cb7d4..00000000 --- a/fixtures/tsconfig/cases/extends-extensionless/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-field/conf" -} diff --git a/fixtures/tsconfig/cases/extends-multiple/foo.js b/fixtures/tsconfig/cases/extends-multiple/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-multiple/tsconfig.json b/fixtures/tsconfig/cases/extends-multiple/tsconfig.json deleted file mode 100644 index aa2ae783..00000000 --- a/fixtures/tsconfig/cases/extends-multiple/tsconfig.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": ["../extends-extension", "../extends-paths"], - "compilerOptions": { - "baseUrl": ".", - }, -} diff --git a/fixtures/tsconfig/cases/extends-not-found/index.js b/fixtures/tsconfig/cases/extends-not-found/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-not-found/tsconfig.json b/fixtures/tsconfig/cases/extends-not-found/tsconfig.json deleted file mode 100644 index 99df91da..00000000 --- a/fixtures/tsconfig/cases/extends-not-found/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./not-found" -} diff --git a/fixtures/tsconfig/cases/extends-paths/src/index.js b/fixtures/tsconfig/cases/extends-paths/src/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-paths/tsconfig.base.json b/fixtures/tsconfig/cases/extends-paths/tsconfig.base.json deleted file mode 100644 index 5c64b067..00000000 --- a/fixtures/tsconfig/cases/extends-paths/tsconfig.base.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "@/*": ["./*"] - } - } -} diff --git a/fixtures/tsconfig/cases/extends-paths/tsconfig.json b/fixtures/tsconfig/cases/extends-paths/tsconfig.json deleted file mode 100644 index 51086018..00000000 --- a/fixtures/tsconfig/cases/extends-paths/tsconfig.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": "./tsconfig.base.json", - "compilerOptions": { - "baseUrl": "src", - }, -} diff --git a/fixtures/tsconfig/cases/field/index.js b/fixtures/tsconfig/cases/field/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/field/tsconfig.json b/fixtures/tsconfig/cases/field/tsconfig.json deleted file mode 100644 index 9f86c3f4..00000000 --- a/fixtures/tsconfig/cases/field/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-field" -} diff --git a/fixtures/tsconfig/cases/index/index.js b/fixtures/tsconfig/cases/index/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/index/tsconfig.json b/fixtures/tsconfig/cases/index/tsconfig.json deleted file mode 100644 index d20b1774..00000000 --- a/fixtures/tsconfig/cases/index/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-index" -} diff --git a/fixtures/tsconfig/cases/paths_template_variable/foo.js b/fixtures/tsconfig/cases/paths_template_variable/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json b/fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json deleted file mode 100644 index a1a37bb6..00000000 --- a/fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "../../tsconfig_template_variable.json" -} diff --git a/fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json b/fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json deleted file mode 100644 index e7d8e5e5..00000000 --- a/fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "compilerOptions": { - "composite": true, - "paths": { - "foo": ["${configDir}/foo.js"] - } - } -} diff --git a/fixtures/tsconfig/cases/project_references/app/aliased/index.ts b/fixtures/tsconfig/cases/project_references/app/aliased/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/app/index.ts b/fixtures/tsconfig/cases/project_references/app/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/app/tsconfig.json b/fixtures/tsconfig/cases/project_references/app/tsconfig.json deleted file mode 100644 index 7036d2bb..00000000 --- a/fixtures/tsconfig/cases/project_references/app/tsconfig.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "extends": "../tsconfig.base.json", - "compilerOptions": { - "baseUrl": "./", - "paths": { - "@/*": ["./aliased/*"] - } - }, - "references": [ - { - "path": "../project_a/conf.json" - }, - { - "path": "../project_b" - }, - { - "path": "../project_c/tsconfig.json" - }, - { - "path": "../../paths_template_variable/tsconfig2.json" - } - ] -} diff --git a/fixtures/tsconfig/cases/project_references/project_a/aliased/index.ts b/fixtures/tsconfig/cases/project_references/project_a/aliased/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_a/conf.json b/fixtures/tsconfig/cases/project_references/project_a/conf.json deleted file mode 100644 index 4d389d7a..00000000 --- a/fixtures/tsconfig/cases/project_references/project_a/conf.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "compilerOptions": { - "composite": true, - "paths": { - "@/*": ["./aliased/*"] - } - } -} diff --git a/fixtures/tsconfig/cases/project_references/project_a/index.ts b/fixtures/tsconfig/cases/project_references/project_a/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_b/src/aliased/index.ts b/fixtures/tsconfig/cases/project_references/project_b/src/aliased/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_b/tsconfig.json b/fixtures/tsconfig/cases/project_references/project_b/tsconfig.json deleted file mode 100644 index 4ab05cd8..00000000 --- a/fixtures/tsconfig/cases/project_references/project_b/tsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "compilerOptions": { - "composite": true, - "baseUrl": "./src", - "paths": { - "@/*": ["./aliased/*"] - } - } -} diff --git a/fixtures/tsconfig/cases/project_references/project_c/index.ts b/fixtures/tsconfig/cases/project_references/project_c/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_c/tsconfig.json b/fixtures/tsconfig/cases/project_references/project_c/tsconfig.json deleted file mode 100644 index fe520939..00000000 --- a/fixtures/tsconfig/cases/project_references/project_c/tsconfig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compilerOptions": { - "composite": true - } -} diff --git a/fixtures/tsconfig/cases/project_references/tsconfig.base.json b/fixtures/tsconfig/cases/project_references/tsconfig.base.json deleted file mode 100644 index 88ccffe7..00000000 --- a/fixtures/tsconfig/cases/project_references/tsconfig.base.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "compilerOptions": { - } -} diff --git a/fixtures/tsconfig/cases/suffixes/a.ios.ts b/fixtures/tsconfig/cases/suffixes/a.ios.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/a.ts b/fixtures/tsconfig/cases/suffixes/a.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/b.ts b/fixtures/tsconfig/cases/suffixes/b.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/c-test.ts b/fixtures/tsconfig/cases/suffixes/c-test.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/index.ts b/fixtures/tsconfig/cases/suffixes/index.ts deleted file mode 100644 index b09939b9..00000000 --- a/fixtures/tsconfig/cases/suffixes/index.ts +++ /dev/null @@ -1 +0,0 @@ -import './a'; diff --git a/fixtures/tsconfig/cases/suffixes/tsconfig.json b/fixtures/tsconfig/cases/suffixes/tsconfig.json deleted file mode 100644 index 4c2ccc8f..00000000 --- a/fixtures/tsconfig/cases/suffixes/tsconfig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compilerOptions": { - "moduleSuffixes": [".ios", "-test", ""] - } -} diff --git a/fixtures/tsconfig/cases/trailing-comma/bar.js b/fixtures/tsconfig/cases/trailing-comma/bar.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/trailing-comma/index.js b/fixtures/tsconfig/cases/trailing-comma/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/trailing-comma/tsconfig.json b/fixtures/tsconfig/cases/trailing-comma/tsconfig.json deleted file mode 100644 index 6dc20ca5..00000000 --- a/fixtures/tsconfig/cases/trailing-comma/tsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "compilerOptions": { - "paths": { - /* some comment */ - "foo": ["bar.js"], - }, - }, - // another comment -} diff --git a/fixtures/tsconfig/foo.js b/fixtures/tsconfig/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/nested/index.js b/fixtures/tsconfig/nested/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/nested/test.js b/fixtures/tsconfig/nested/test.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/nested/tsconfig.json b/fixtures/tsconfig/nested/tsconfig.json deleted file mode 100644 index 6deb3011..00000000 --- a/fixtures/tsconfig/nested/tsconfig.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "extends": "..", - "compilerOptions": { - "paths": { - "ts-path": ["test.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-exports/conf.json b/fixtures/tsconfig/node_modules/tsconfig-exports/conf.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-exports/conf.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-exports/foo.js b/fixtures/tsconfig/node_modules/tsconfig-exports/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-exports/package.json b/fixtures/tsconfig/node_modules/tsconfig-exports/package.json deleted file mode 100644 index be0ddee6..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-exports/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "tsconfig-exports", - "private": true, - "exports": { - ".": "./conf.json" - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-field/conf.json b/fixtures/tsconfig/node_modules/tsconfig-field/conf.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-field/conf.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-field/foo.js b/fixtures/tsconfig/node_modules/tsconfig-field/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-field/package.json b/fixtures/tsconfig/node_modules/tsconfig-field/package.json deleted file mode 100644 index 7138fdde..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-field/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "tsconfig-field", - "private": true, - "tsconfig": "conf.json" -} \ No newline at end of file diff --git a/fixtures/tsconfig/node_modules/tsconfig-index/foo.js b/fixtures/tsconfig/node_modules/tsconfig-index/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-index/package.json b/fixtures/tsconfig/node_modules/tsconfig-index/package.json deleted file mode 100644 index eb2431e7..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-index/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "tsconfig-index", - "private": true -} \ No newline at end of file diff --git a/fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json b/fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-not-used/foo.js b/fixtures/tsconfig/node_modules/tsconfig-not-used/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json b/fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json deleted file mode 100644 index eb16d127..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "ts-path": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/package.json b/fixtures/tsconfig/package.json deleted file mode 100755 index f48acd1c..00000000 --- a/fixtures/tsconfig/package.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "name": "resolver", - "private": true, - "alias": { - "aliased": "foo", - "aliased-file": "./bar.js", - "something": "./nested/test.js", - "aliasedfolder": "./nested", - "aliasedabsolute": "/nested", - "foo/bar": "./bar.js", - "glob/*/*": "./nested/$2", - "./baz": "./bar.js", - "url": false - }, - "imports": { - "#test": "./bar.js" - }, - "dependencies": { - "foo": "^0.3.4" - }, - "peerDependencies": { - "bar": "*" - } -} diff --git a/fixtures/tsconfig/tsconfig.json b/fixtures/tsconfig/tsconfig.json deleted file mode 100644 index eb16d127..00000000 --- a/fixtures/tsconfig/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "ts-path": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/tsconfig_template_variable.json b/fixtures/tsconfig/tsconfig_template_variable.json deleted file mode 100644 index 6f272344..00000000 --- a/fixtures/tsconfig/tsconfig_template_variable.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["${configDir}/foo.js"] - } - } -} diff --git a/napi/__test__/resolver.spec.mjs b/napi/__test__/resolver.spec.mjs deleted file mode 100644 index ac6ee0ef..00000000 --- a/napi/__test__/resolver.spec.mjs +++ /dev/null @@ -1,260 +0,0 @@ -import { join } from 'node:path' -import { fileURLToPath } from 'node:url' - -import test from 'ava' - -let ResolverFactory - -if (process.env.WASI_TEST) { - const wasi = await import('../resolver.wasi.cjs') - ResolverFactory = wasi.ResolverFactory -} else { - const napi = await import('../index.js') - ResolverFactory = napi.ResolverFactory -} - -const currentDir = join(fileURLToPath(import.meta.url), '..') - -const enhancedResolveRoot = join( - currentDir, - '..', - '..', - 'fixtures', - 'enhanced_resolve', - 'test', - 'fixtures' -) - -// https://github.com/webpack/enhanced-resolve/blob/main/test/resolve.test.js - -for (const [title, context, request, expected] of [ - [ - 'absolute path', - enhancedResolveRoot, - join(enhancedResolveRoot, 'main1.js'), - join(enhancedResolveRoot, 'main1.js'), - ], - [ - 'file with .js', - enhancedResolveRoot, - './main1.js', - join(enhancedResolveRoot, 'main1.js'), - ], - [ - 'file without extension', - enhancedResolveRoot, - './main1', - join(enhancedResolveRoot, 'main1.js'), - ], - [ - 'another file with .js', - enhancedResolveRoot, - './a.js', - join(enhancedResolveRoot, 'a.js'), - ], - [ - 'another file without extension', - enhancedResolveRoot, - './a', - join(enhancedResolveRoot, 'a.js'), - ], - [ - 'file in module with .js', - enhancedResolveRoot, - 'm1/a.js', - join(enhancedResolveRoot, 'node_modules/m1/a.js'), - ], - [ - 'file in module without extension', - enhancedResolveRoot, - 'm1/a', - join(enhancedResolveRoot, 'node_modules/m1/a.js'), - ], - [ - 'another file in module without extension', - enhancedResolveRoot, - 'complexm/step1', - join(enhancedResolveRoot, 'node_modules/complexm/step1.js'), - ], - [ - 'from submodule to file in sibling module', - join(enhancedResolveRoot, 'node_modules/complexm'), - 'm2/b.js', - join(enhancedResolveRoot, 'node_modules/m2/b.js'), - ], - [ - 'from nested directory to overwritten file in module', - join(enhancedResolveRoot, 'multiple_modules'), - 'm1/a.js', - join(enhancedResolveRoot, 'multiple_modules/node_modules/m1/a.js'), - ], - [ - 'from nested directory to not overwritten file in module', - join(enhancedResolveRoot, 'multiple_modules'), - 'm1/b.js', - join(enhancedResolveRoot, 'node_modules/m1/b.js'), - ], - [ - 'file with query', - enhancedResolveRoot, - './main1.js?query', - join(enhancedResolveRoot, 'main1.js?query'), - ], - [ - 'file with fragment', - enhancedResolveRoot, - './main1.js#fragment', - join(enhancedResolveRoot, 'main1.js#fragment'), - ], - [ - 'file with fragment and query', - enhancedResolveRoot, - './main1.js#fragment?query', - join(enhancedResolveRoot, 'main1.js#fragment?query'), - ], - [ - 'file with query and fragment', - enhancedResolveRoot, - './main1.js?#fragment', - join(enhancedResolveRoot, 'main1.js?#fragment'), - ], - - [ - 'file with query (unicode)', - enhancedResolveRoot, - './测试.js?query', - join(enhancedResolveRoot, '测试.js?query'), - ], - [ - 'file with fragment (unicode)', - enhancedResolveRoot, - './测试.js#fragment', - join(enhancedResolveRoot, '测试.js#fragment'), - ], - [ - 'file with fragment and query (unicode)', - enhancedResolveRoot, - './测试.js#fragment?query', - join(enhancedResolveRoot, '测试.js#fragment?query'), - ], - [ - 'file with query and fragment (unicode)', - enhancedResolveRoot, - './测试.js?#fragment', - join(enhancedResolveRoot, '测试.js?#fragment'), - ], - - [ - 'file in module with query', - enhancedResolveRoot, - 'm1/a?query', - join(enhancedResolveRoot, 'node_modules/m1/a.js?query'), - ], - [ - 'file in module with fragment', - enhancedResolveRoot, - 'm1/a#fragment', - join(enhancedResolveRoot, 'node_modules/m1/a.js#fragment'), - ], - [ - 'file in module with fragment and query', - enhancedResolveRoot, - 'm1/a#fragment?query', - join(enhancedResolveRoot, 'node_modules/m1/a.js#fragment?query'), - ], - [ - 'file in module with query and fragment', - enhancedResolveRoot, - 'm1/a?#fragment', - join(enhancedResolveRoot, 'node_modules/m1/a.js?#fragment'), - ], - [ - 'differ between directory and file, resolve file', - enhancedResolveRoot, - './dirOrFile', - join(enhancedResolveRoot, 'dirOrFile.js'), - ], - [ - 'differ between directory and file, resolve directory', - enhancedResolveRoot, - './dirOrFile/', - join(enhancedResolveRoot, 'dirOrFile/index.js'), - ], - [ - 'find node_modules outside of node_modules', - join(enhancedResolveRoot, 'browser-module/node_modules'), - 'm1/a', - join(enhancedResolveRoot, 'node_modules/m1/a.js'), - ], - [ - "don't crash on main field pointing to self", - enhancedResolveRoot, - './main-field-self', - join(enhancedResolveRoot, './main-field-self/index.js'), - ], - [ - "don't crash on main field pointing to self (2)", - enhancedResolveRoot, - './main-field-self2', - join(enhancedResolveRoot, './main-field-self2/index.js'), - ], - // enhanced-resolve has `#` prepended with a `\0`, they are removed from the - // following 3 expected test results. - // See https://github.com/webpack/enhanced-resolve#escaping - [ - 'handle fragment edge case (no fragment)', - enhancedResolveRoot, - './no#fragment/#/#', - join(enhancedResolveRoot, 'no#fragment', '#', '#.js'), - ], - [ - 'handle fragment edge case (fragment)', - enhancedResolveRoot, - './no#fragment/#/', - join(enhancedResolveRoot, 'no.js#fragment') + '/#/', - ], - [ - 'handle fragment escaping', - enhancedResolveRoot, - './no\0#fragment/\0#/\0##fragment', - join(enhancedResolveRoot, 'no#fragment', '#', '#.js#fragment'), - ], -]) { - test(title, (t) => { - const resolver = new ResolverFactory({ - modules: ['src/a', 'src/b', 'src/common', 'node_modules'], - extensions: ['.js', '.jsx', '.ts', '.tsx'], - }) - - t.is(resolver.sync(context, request).path, expected) - }) -} - -test('resolve pnpm package', (t) => { - const rootDir = join(currentDir, '..', '..'); - const pnpmProjectPath = join(rootDir, 'fixtures', 'pnpm') - const resolver = new ResolverFactory({ - aliasFields: ['browser'], - }) - t.deepEqual(resolver.sync(pnpmProjectPath, 'styled-components'), { - path: join( - rootDir, - 'node_modules/.pnpm/styled-components@6.1.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/styled-components/dist/styled-components.browser.cjs.js' - ), - }) - t.deepEqual( - resolver.sync( - join( - rootDir, - 'node_modules/.pnpm/styled-components@6.1.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/styled-components' - ), - 'react' - ), - { - path: join( - rootDir, - 'node_modules/.pnpm/react@18.3.1/node_modules/react/index.js' - ), - } - ) -}) diff --git a/napi/src/lib.rs b/napi/src/lib.rs deleted file mode 100644 index 238f99c4..00000000 --- a/napi/src/lib.rs +++ /dev/null @@ -1,166 +0,0 @@ -extern crate napi; -extern crate napi_derive; -extern crate oxc_resolver; - -use std::path::{Path, PathBuf}; - -use napi_derive::napi; -use oxc_resolver::{ResolveOptions, Resolver}; - -use self::options::{NapiResolveOptions, StrOrStrList}; - -mod options; - -#[napi(object)] -pub struct ResolveResult { - pub path: Option, - pub error: Option, -} - -fn resolve(resolver: &Resolver, path: &Path, request: &str) -> ResolveResult { - match resolver.resolve(path, request) { - Ok(resolution) => ResolveResult { - path: Some(resolution.full_path().to_string_lossy().to_string()), - error: None, - }, - Err(err) => ResolveResult { path: None, error: Some(err.to_string()) }, - } -} - -#[allow(clippy::needless_pass_by_value)] -#[napi] -pub fn sync(path: String, request: String) -> ResolveResult { - let path = PathBuf::from(path); - let resolver = Resolver::new(ResolveOptions::default()); - resolve(&resolver, &path, &request) -} - -#[napi] -pub struct ResolverFactory { - resolver: Resolver, -} - -#[napi] -impl ResolverFactory { - #[napi(constructor)] - pub fn new(options: NapiResolveOptions) -> Self { - Self { resolver: Resolver::new(Self::normalize_options(options)) } - } - - #[napi] - pub fn default() -> Self { - let default_options = ResolveOptions::default(); - Self { resolver: Resolver::new(default_options) } - } - - /// Clone the resolver using the same underlying cache. - #[napi] - pub fn clone_with_options(&self, options: NapiResolveOptions) -> Self { - Self { resolver: self.resolver.clone_with_options(Self::normalize_options(options)) } - } - - /// Clear the underlying cache. - #[napi] - pub fn clear_cache(&self) { - self.resolver.clear_cache(); - } - - #[allow(clippy::needless_pass_by_value)] - #[napi] - pub fn sync(&self, path: String, request: String) -> ResolveResult { - let path = PathBuf::from(path); - resolve(&self.resolver, &path, &request) - } - - fn normalize_options(op: NapiResolveOptions) -> ResolveOptions { - let default = ResolveOptions::default(); - // merging options - ResolveOptions { - tsconfig: op.tsconfig.map(|tsconfig| tsconfig.into()), - alias: op - .alias - .map(|alias| { - alias - .into_iter() - .map(|(k, v)| { - let v = v - .into_iter() - .map(|item| match item { - Some(path) => oxc_resolver::AliasValue::from(path), - None => oxc_resolver::AliasValue::Ignore, - }) - .collect(); - (k, v) - }) - .collect::>() - }) - .unwrap_or(default.alias), - alias_fields: op - .alias_fields - .map(|o| o.into_iter().map(|x| StrOrStrList(x).into()).collect::>()) - .unwrap_or(default.alias_fields), - condition_names: op.condition_names.unwrap_or(default.condition_names), - description_files: op.description_files.unwrap_or(default.description_files), - enforce_extension: op - .enforce_extension - .map(|enforce_extension| enforce_extension.into()) - .unwrap_or(default.enforce_extension), - exports_fields: op - .exports_fields - .map(|o| o.into_iter().map(|x| StrOrStrList(x).into()).collect::>()) - .unwrap_or(default.exports_fields), - imports_fields: op - .imports_fields - .map(|o| o.into_iter().map(|x| StrOrStrList(x).into()).collect::>()) - .unwrap_or(default.imports_fields), - extension_alias: op - .extension_alias - .map(|extension_alias| extension_alias.into_iter().collect::>()) - .unwrap_or(default.extension_alias), - extensions: op.extensions.unwrap_or(default.extensions), - fallback: op - .fallback - .map(|fallback| { - fallback - .into_iter() - .map(|(k, v)| { - let v = v - .into_iter() - .map(|item| match item { - Some(path) => oxc_resolver::AliasValue::from(path), - None => oxc_resolver::AliasValue::Ignore, - }) - .collect(); - (k, v) - }) - .collect::>() - }) - .unwrap_or(default.fallback), - fully_specified: op.fully_specified.unwrap_or(default.fully_specified), - main_fields: op - .main_fields - .map(|o| StrOrStrList(o).into()) - .unwrap_or(default.main_fields), - main_files: op.main_files.unwrap_or(default.main_files), - modules: op.modules.map(|o| StrOrStrList(o).into()).unwrap_or(default.modules), - resolve_to_context: op.resolve_to_context.unwrap_or(default.resolve_to_context), - prefer_relative: op.prefer_relative.unwrap_or(default.prefer_relative), - prefer_absolute: op.prefer_absolute.unwrap_or(default.prefer_absolute), - restrictions: op - .restrictions - .map(|restrictions| { - restrictions - .into_iter() - .map(|restriction| restriction.into()) - .collect::>() - }) - .unwrap_or(default.restrictions), - roots: op - .roots - .map(|roots| roots.into_iter().map(PathBuf::from).collect::>()) - .unwrap_or(default.roots), - symlinks: op.symlinks.unwrap_or(default.symlinks), - builtin_modules: op.builtin_modules.unwrap_or(default.builtin_modules), - } - } -} diff --git a/napi/src/options.rs b/napi/src/options.rs deleted file mode 100644 index ea35672f..00000000 --- a/napi/src/options.rs +++ /dev/null @@ -1,261 +0,0 @@ -use std::path::PathBuf; - -use napi::Either; -use napi_derive::napi; -use std::collections::HashMap; - -/// Module Resolution Options -/// -/// Options are directly ported from [enhanced-resolve](https://github.com/webpack/enhanced-resolve#resolver-options). -/// -/// See [webpack resolve](https://webpack.js.org/configuration/resolve/) for information and examples -#[derive(Debug, Clone)] -#[napi(object)] -pub struct NapiResolveOptions { - /// Path to TypeScript configuration file. - /// - /// Default `None` - pub tsconfig: Option, - - /// Alias for [ResolveOptions::alias] and [ResolveOptions::fallback]. - /// - /// For the second value of the tuple, `None -> AliasValue::Ignore`, Some(String) -> - /// AliasValue::Path(String)` - /// Create aliases to import or require certain modules more easily. - /// A trailing $ can also be added to the given object's keys to signify an exact match. - pub alias: Option>>>, - - /// A list of alias fields in description files. - /// Specify a field, such as `browser`, to be parsed according to [this specification](https://github.com/defunctzombie/package-browser-field-spec). - /// Can be a path to json object such as `["path", "to", "exports"]`. - /// - /// Default `[]` - #[napi(ts_type = "(string | string[])[]")] - pub alias_fields: Option>, - - /// Condition names for exports field which defines entry points of a package. - /// The key order in the exports field is significant. During condition matching, earlier entries have higher priority and take precedence over later entries. - /// - /// Default `[]` - pub condition_names: Option>, - - /// The JSON files to use for descriptions. (There was once a `bower.json`.) - /// - /// Default `["package.json"]` - pub description_files: Option>, - - /// If true, it will not allow extension-less files. - /// So by default `require('./foo')` works if `./foo` has a `.js` extension, - /// but with this enabled only `require('./foo.js')` will work. - /// - /// Default to `true` when [ResolveOptions::extensions] contains an empty string. - /// Use `Some(false)` to disable the behavior. - /// See - /// - /// Default None, which is the same as `Some(false)` when the above empty rule is not applied. - pub enforce_extension: Option, - - /// A list of exports fields in description files. - /// Can be a path to json object such as `["path", "to", "exports"]`. - /// - /// Default `[["exports"]]`. - #[napi(ts_type = "(string | string[])[]")] - pub exports_fields: Option>, - - /// Fields from `package.json` which are used to provide the internal requests of a package - /// (requests starting with # are considered internal). - /// - /// Can be a path to a JSON object such as `["path", "to", "imports"]`. - /// - /// Default `[["imports"]]`. - #[napi(ts_type = "(string | string[])[]")] - pub imports_fields: Option>, - - /// An object which maps extension to extension aliases. - /// - /// Default `{}` - pub extension_alias: Option>>, - - /// Attempt to resolve these extensions in order. - /// If multiple files share the same name but have different extensions, - /// will resolve the one with the extension listed first in the array and skip the rest. - /// - /// Default `[".js", ".json", ".node"]` - pub extensions: Option>, - - /// Redirect module requests when normal resolving fails. - /// - /// Default `[]` - pub fallback: Option>>>, - - /// 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). - /// - /// See also webpack configuration [resolve.fullySpecified](https://webpack.js.org/configuration/module/#resolvefullyspecified) - /// - /// Default `false` - pub fully_specified: Option, - - /// A list of main fields in description files - /// - /// Default `["main"]`. - #[napi(ts_type = "string | string[]")] - pub main_fields: Option, - - /// The filename to be used while resolving directories. - /// - /// Default `["index"]` - pub main_files: Option>, - - /// A list of directories to resolve modules from, can be absolute path or folder name. - /// - /// Default `["node_modules"]` - #[napi(ts_type = "string | string[]")] - pub modules: Option, - - /// Resolve to a context instead of a file. - /// - /// Default `false` - pub resolve_to_context: Option, - - /// Prefer to resolve module requests as relative requests instead of using modules from node_modules directories. - /// - /// Default `false` - pub prefer_relative: Option, - - /// Prefer to resolve server-relative urls as absolute paths before falling back to resolve in ResolveOptions::roots. - /// - /// Default `false` - pub prefer_absolute: Option, - - /// A list of resolve restrictions to restrict the paths that a request can be resolved on. - /// - /// Default `[]` - pub restrictions: Option>, - - /// A list of directories where requests of server-relative URLs (starting with '/') are resolved. - /// On non-Windows systems these requests are resolved as an absolute path first. - /// - /// Default `[]` - pub roots: Option>, - - /// Whether to resolve symlinks to their symlinked location. - /// When enabled, symlinked resources are resolved to their real path, not their symlinked location. - /// Note that this may cause module resolution to fail when using tools that symlink packages (like npm link). - /// - /// Default `true` - pub symlinks: Option, - - /// Whether to parse [module.builtinModules](https://nodejs.org/api/module.html#modulebuiltinmodules) or not. - /// For example, "zlib" will throw [crate::ResolveError::Builtin] when set to true. - /// - /// Default `false` - pub builtin_modules: Option, -} - -#[napi] -#[derive(Debug, PartialEq, Eq)] -pub enum EnforceExtension { - Auto, - Enabled, - Disabled, -} - -impl EnforceExtension { - pub fn is_auto(&self) -> bool { - *self == Self::Auto - } - - pub fn is_enabled(&self) -> bool { - *self == Self::Enabled - } - - pub fn is_disabled(&self) -> bool { - *self == Self::Disabled - } -} - -/// Alias Value for [ResolveOptions::alias] and [ResolveOptions::fallback]. -/// Use struct because napi don't support structured union now -#[napi(object)] -#[derive(Debug, Clone)] -pub struct Restriction { - pub path: Option, - pub regex: Option, -} - -/// Tsconfig Options -/// -/// Derived from [tsconfig-paths-webpack-plugin](https://github.com/dividab/tsconfig-paths-webpack-plugin#options) -#[napi(object)] -#[derive(Debug, Clone)] -pub struct TsconfigOptions { - /// Allows you to specify where to find the TypeScript configuration file. - /// You may provide - /// * a relative path to the configuration file. It will be resolved relative to cwd. - /// * an absolute path to the configuration file. - pub config_file: String, - - /// Support for Typescript Project References. - /// - /// * `'auto'`: use the `references` field from tsconfig of `config_file`. - /// * `string[]`: manually provided relative or absolute path. - #[napi(ts_type = "'auto' | string[]")] - pub references: Option>>, -} - -impl Into for Restriction { - fn into(self) -> oxc_resolver::Restriction { - match (self.path, self.regex) { - (None, None) => { - panic!("Should specify path or regex") - } - (None, Some(regex)) => oxc_resolver::Restriction::RegExp(regex), - (Some(path), None) => oxc_resolver::Restriction::Path(PathBuf::from(path)), - (Some(_), Some(_)) => { - panic!("Restriction can't be path and regex at the same time") - } - } - } -} - -impl Into for EnforceExtension { - fn into(self) -> oxc_resolver::EnforceExtension { - match self { - EnforceExtension::Auto => oxc_resolver::EnforceExtension::Auto, - EnforceExtension::Enabled => oxc_resolver::EnforceExtension::Enabled, - EnforceExtension::Disabled => oxc_resolver::EnforceExtension::Disabled, - } - } -} - -impl Into for TsconfigOptions { - fn into(self) -> oxc_resolver::TsconfigOptions { - oxc_resolver::TsconfigOptions { - config_file: PathBuf::from(self.config_file), - references: match self.references { - Some(Either::A(string)) if string.as_str() == "auto" => { - oxc_resolver::TsconfigReferences::Auto - } - Some(Either::A(opt)) => { - panic!("`{}` is not a valid option for tsconfig references", opt) - } - Some(Either::B(paths)) => oxc_resolver::TsconfigReferences::Paths( - paths.into_iter().map(PathBuf::from).collect::>(), - ), - None => oxc_resolver::TsconfigReferences::Disabled, - }, - } - } -} - -type StrOrStrListType = Either>; -pub struct StrOrStrList(pub StrOrStrListType); - -impl Into> for StrOrStrList { - fn into(self) -> Vec { - match self { - StrOrStrList(Either::A(s)) => Vec::from([s]), - StrOrStrList(Either::B(a)) => a, - } - } -} diff --git a/napi/tests/options.test.mjs b/napi/tests/options.test.mjs deleted file mode 100644 index 4a93efff..00000000 --- a/napi/tests/options.test.mjs +++ /dev/null @@ -1,59 +0,0 @@ -import { describe, it } from "node:test"; -import { ResolverFactory } from "../index.js"; -import * as assert from "node:assert"; -import * as path from "node:path"; - -const fixtureDir = new URL( - "../../fixtures/enhanced_resolve/test/fixtures", - import.meta.url -).pathname; - -describe("option", () => { - describe("aliasFields", () => { - it("should allow field string ", () => { - const resolver = new ResolverFactory({ aliasFields: ["browser"] }); - assert.match( - resolver.sync(fixtureDir, "./browser-module/lib/replaced.js").path, - /browser-module\/lib\/browser\.js$/ - ); - }); - it("should allow json path array", () => { - const resolver = new ResolverFactory({ - aliasFields: [["innerBrowser1", "field", "browser"]], - }); - - assert.match( - resolver.sync(fixtureDir, "./browser-module/lib/main1.js").path, - /browser-module\/lib\/main\.js$/ - ); - }); - }); - - describe("exportsFields", () => { - const createTest = (exportsFields) => { - const resolver = new ResolverFactory({ exportsFields }); - assert.match( - resolver.sync( - path.resolve(fixtureDir, "./exports-field3"), - "exports-field" - ).path, - /\/exports-field\/src\/index\.js$/ - ); - }; - it("should allow string as field item", createTest(["broken"])); - it("should allow json path array as field item", createTest([["broken"]])); - }); - - describe("mainFields", () => { - const createTest = (mainFields) => { - const resolver = new ResolverFactory({ mainFields }); - assert.match( - resolver.sync(fixtureDir, "../..").path, - /\/lib\/index\.js$/ - ); - }; - it("should use `'main'` as default", createTest(undefined)); - it("should allow field string", createTest("main")); - it("should allow field array", createTest(["main"])); - }); -}); diff --git a/npm/package.json b/npm/package.json index 6fa93185..b47e6b07 100644 --- a/npm/package.json +++ b/npm/package.json @@ -1,41 +1,30 @@ { - "name": "oxc-resolver", - "version": "1.8.1", - "description": "Oxc Resolver Node API", - "main": "index.js", - "browser": "browser.js", - "files": [ - "index.d.ts", - "index.js", - "browser.js" - ], - "license": "MIT", - "homepage": "https://oxc-project.github.io", - "repository": { - "type": "git", - "url": "git+https://github.com/oxc-project/oxc-resolver.git" - }, - "publishConfig": { - "registry": "https://registry.npmjs.org/", - "access": "public" - }, - "napi": { - "binaryName": "resolver", - "packageName": "@oxc-resolver/binding", - "targets": [ - "x86_64-pc-windows-msvc", - "aarch64-pc-windows-msvc", - "x86_64-unknown-linux-gnu", - "x86_64-unknown-linux-musl", - "aarch64-unknown-linux-gnu", - "aarch64-unknown-linux-musl", - "armv7-unknown-linux-gnueabihf", - "x86_64-apple-darwin", - "aarch64-apple-darwin", - "wasm32-wasip1-threads" - ] - }, - "funding": { - "url": "https://github.com/sponsors/Boshen" - } + "name": "oxc-resolver", + "description": "Oxc Resolver Node API", + "funding": { + "url": "https://github.com/sponsors/Boshen" + }, + "main": "index.js", + "browser": "browser.js", + "files": [ + "index.d.ts", + "index.js", + "browser.js" + ], + "napi": { + "binaryName": "resolver", + "packageName": "@oxc-resolver/binding", + "targets": [ + "x86_64-pc-windows-msvc", + "aarch64-pc-windows-msvc", + "x86_64-unknown-linux-gnu", + "x86_64-unknown-linux-musl", + "aarch64-unknown-linux-gnu", + "aarch64-unknown-linux-musl", + "armv7-unknown-linux-gnueabihf", + "x86_64-apple-darwin", + "aarch64-apple-darwin", + "wasm32-wasip1-threads" + ] + } } diff --git a/package.json b/package.json index 47300b76..a431e48f 100644 --- a/package.json +++ b/package.json @@ -1,33 +1,24 @@ { - "name": "@oxc-resolver/binding", - "private": true, - "version": "0.0.0", - "scripts": { - "build": "napi build --platform --release --package-json-path npm/package.json --manifest-path napi/Cargo.toml", - "build:debug": "napi build --platform --package-json-path npm/package.json --manifest-path napi/Cargo.toml", - "prepublishOnly": "napi pre-publish -t npm", - "test": "ava" - }, - "devDependencies": { - "@napi-rs/cli": "^3.0.0-alpha.43", - "@napi-rs/wasm-runtime": "^0.2.0", - "@types/node": "^20.10.4", - "ava": "^6.0.1", - "emnapi": "^1.0.0", - "typescript": "^5.3.3" - }, - "ava": { - "files": [ - "napi/__test__/*.spec.mjs" - ], - "cache": false - }, - "packageManager": "pnpm@9.3.0", - "repository": { - "type": "git", - "url": "git+https://github.com/oxc-project/oxc-resolver.git" - }, - "funding": { - "url": "https://github.com/sponsors/Boshen" - } + "name": "@oxc-resolver/binding", + "funding": { + "url": "https://github.com/sponsors/Boshen" + }, + "scripts": { + "build": "napi build --platform --release --package-json-path npm/package.json --manifest-path napi/Cargo.toml", + "build:debug": "napi build --platform --package-json-path npm/package.json --manifest-path napi/Cargo.toml", + "prepublishOnly": "napi pre-publish -t npm" + }, + "ava": { + "cache": false, + "files": [ + "napi/__test__/*.spec.mjs" + ] + }, + "devDependencies": { + "@napi-rs/cli": "^3.0.0-alpha.43", + "@napi-rs/wasm-runtime": "^0.2.0", + "@types/node": "^20.10.4", + "ava": "^6.0.1", + "emnapi": "^1.0.0" + } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml deleted file mode 100644 index 1e8670db..00000000 --- a/pnpm-lock.yaml +++ /dev/null @@ -1,2690 +0,0 @@ -lockfileVersion: '9.0' - -settings: - autoInstallPeers: true - excludeLinksFromLockfile: false - -importers: - - .: - devDependencies: - '@napi-rs/cli': - specifier: ^3.0.0-alpha.43 - version: 3.0.0-alpha.55(@emnapi/runtime@1.2.0)(emnapi@1.2.0) - '@napi-rs/wasm-runtime': - specifier: ^0.2.0 - version: 0.2.4 - '@types/node': - specifier: ^20.10.4 - version: 20.14.2 - ava: - specifier: ^6.0.1 - version: 6.1.3 - emnapi: - specifier: ^1.0.0 - version: 1.2.0 - typescript: - specifier: ^5.3.3 - version: 5.4.5 - - fixtures/pnpm: - devDependencies: - axios: - specifier: 1.6.2 - version: 1.6.2 - postcss: - specifier: 8.4.33 - version: 8.4.33 - styled-components: - specifier: 6.1.1 - version: 6.1.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - - npm: {} - -packages: - - '@emnapi/core@1.2.0': - resolution: {integrity: sha512-E7Vgw78I93we4ZWdYCb4DGAwRROGkMIXk7/y87UmANR+J6qsWusmC3gLt0H+O0KOt5e6O38U8oJamgbudrES/w==} - - '@emnapi/runtime@1.2.0': - resolution: {integrity: sha512-bV21/9LQmcQeCPEg3BDFtvwL6cwiTMksYNWQQ4KOxCZikEGalWtenoZ0wCiukJINlGCIi2KXx01g4FoH/LxpzQ==} - - '@emnapi/wasi-threads@1.0.1': - resolution: {integrity: sha512-iIBu7mwkq4UQGeMEM8bLwNK962nXdhodeScX4slfQnRhEMMzvYivHhutCIk8uojvmASXXPC2WNEjwxFWk72Oqw==} - - '@emotion/is-prop-valid@1.2.2': - resolution: {integrity: sha512-uNsoYd37AFmaCdXlg6EYD1KaPOaRWRByMCYzbKUX4+hhMfrxdVSelShywL4JVaAeM/eHUOSprYBQls+/neX3pw==} - - '@emotion/memoize@0.8.1': - resolution: {integrity: sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA==} - - '@emotion/unitless@0.8.1': - resolution: {integrity: sha512-KOEGMu6dmJZtpadb476IsZBclKvILjopjUii3V+7MnXIQCYh8W3NgNcgwo21n9LXZX6EDIKvqfjYxXebDwxKmQ==} - - '@inquirer/figures@1.0.3': - resolution: {integrity: sha512-ErXXzENMH5pJt5/ssXV0DfWUZqly8nGzf0UcBV9xTnP+KyffE2mqyxIMBrZ8ijQck2nU0TQm40EQB53YreyWHw==} - engines: {node: '>=18'} - - '@ljharb/through@2.3.13': - resolution: {integrity: sha512-/gKJun8NNiWGZJkGzI/Ragc53cOdcLNdzjLaIa+GEjguQs0ulsurx8WN0jijdK9yPqDvziX995sMRLyLt1uZMQ==} - engines: {node: '>= 0.4'} - - '@mapbox/node-pre-gyp@1.0.11': - resolution: {integrity: sha512-Yhlar6v9WQgUp/He7BdgzOz8lqMQ8sU+jkCq7Wx8Myc5YFJLbEe7lgui/V7G1qB1DJykHSGwreceSaD60Y0PUQ==} - hasBin: true - - '@napi-rs/cli@3.0.0-alpha.55': - resolution: {integrity: sha512-6XgBBTX8O28W5gcSzqYkI72UVJV6Y2YcyQNrEqak39JavJRLlXCv09uLF97raynXAOO50KeP6DEXFy5P8MR2sw==} - engines: {node: '>= 16'} - hasBin: true - peerDependencies: - '@emnapi/runtime': ^1.1.0 - emnapi: ^1.1.0 - peerDependenciesMeta: - '@emnapi/runtime': - optional: true - emnapi: - optional: true - - '@napi-rs/cross-toolchain@0.0.16': - resolution: {integrity: sha512-jwdjHT5L0m9MH0CmzDwPp0ckn/UO7afHCsPeo7NugHUvYgvlgS7SWhdMVgIgJW2HHqhcW/2nhaLLGpAU1c7QRQ==} - peerDependencies: - '@napi-rs/cross-toolchain-arm64-target-aarch64': ^0.0.16 - '@napi-rs/cross-toolchain-arm64-target-armv7': ^0.0.16 - '@napi-rs/cross-toolchain-arm64-target-x86_64': ^0.0.16 - '@napi-rs/cross-toolchain-x64-target-aarch64': ^0.0.16 - '@napi-rs/cross-toolchain-x64-target-armv7': ^0.0.16 - '@napi-rs/cross-toolchain-x64-target-x86_64': ^0.0.16 - peerDependenciesMeta: - '@napi-rs/cross-toolchain-arm64-target-aarch64': - optional: true - '@napi-rs/cross-toolchain-arm64-target-armv7': - optional: true - '@napi-rs/cross-toolchain-arm64-target-x86_64': - optional: true - '@napi-rs/cross-toolchain-x64-target-aarch64': - optional: true - '@napi-rs/cross-toolchain-x64-target-armv7': - optional: true - '@napi-rs/cross-toolchain-x64-target-x86_64': - optional: true - - '@napi-rs/lzma-android-arm-eabi@1.3.1': - resolution: {integrity: sha512-mtGOg8jXlc+pTBI86cqohfndS9UmOAkk9d5CChKMb8btVks70yhUN1e7YYS3QFbmoxbPs2Ee+wmuH1Khdc7B2w==} - engines: {node: '>= 10'} - cpu: [arm] - os: [android] - - '@napi-rs/lzma-android-arm64@1.3.1': - resolution: {integrity: sha512-4uGkQgAv9Tnc/i0k2eIgbhZgyzs94+iECWxz4MFZNcZ1fNGvGbRL2j+SITE4OmwrUn3TuFK/uYWfgzooq8E1Qg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [android] - - '@napi-rs/lzma-darwin-arm64@1.3.1': - resolution: {integrity: sha512-MZBg4iwHTS8icjTiCMdzh8kYrMmKBCEglFPa+vjI91R2XDwuuwSzqmpATRpmMH8cWUUWtGPF4fnxKzjgkzhd4Q==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [darwin] - - '@napi-rs/lzma-darwin-x64@1.3.1': - resolution: {integrity: sha512-7vte+1lYV7xgZERKH/pjAeh4T16aQASKOzu4op70pK6VP/64Plr5rrvqxQqQmlAIe4pwyo/RkFl1n4LXDod3xg==} - engines: {node: '>= 10'} - cpu: [x64] - os: [darwin] - - '@napi-rs/lzma-freebsd-x64@1.3.1': - resolution: {integrity: sha512-uBS74fynTqLUC3catIxyezCafn8UDlr2yxVV47vz1T6Vop2PGDz/cMQdV6rnLSjPE08Rv66ihM36mgf/MmOkOg==} - engines: {node: '>= 10'} - cpu: [x64] - os: [freebsd] - - '@napi-rs/lzma-linux-arm-gnueabihf@1.3.1': - resolution: {integrity: sha512-rrVLyqBJeN29gPJCNkPbZ7dAzaseEcERKyhjwM+DfbFrDUvtkEcrYPvo+iwE/NmF+OkZQkzcanrVMGnq/mcJYQ==} - engines: {node: '>= 10'} - cpu: [arm] - os: [linux] - - '@napi-rs/lzma-linux-arm64-gnu@1.3.1': - resolution: {integrity: sha512-vDmVsthRbX2opkgRirJJGKQxUP/spvyVM2Y5CyCWZ7sadSID3hA97r38gf9ISn/sJ8/r93IPWLq+iycudNKi+Q==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/lzma-linux-arm64-musl@1.3.1': - resolution: {integrity: sha512-x4m/J3hRdFd3IoqKc+4aBcSUkcuDEP7hH6vdss8bKNLjPfXmnG/lcHJEQX3hNnNOULPP8xVRxgiY8jeL62cnsw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/lzma-linux-x64-gnu@1.3.1': - resolution: {integrity: sha512-riB+Xg72NfH8Kcpq07omshVu0QsLW0v2bhywBNYxvA+t2dGGWSIEN1U/zazUXys+IEA6pBQKqLVseurWE6Cl8g==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/lzma-linux-x64-musl@1.3.1': - resolution: {integrity: sha512-JXLgJFwoeysxdSg7rdVYP8wrliCQVJlU5JcLYjRVSCL4P0mQTjnYi7R7VdaOkDACw/Fvlji7oIJXt0KiaDTcOw==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/lzma-wasm32-wasi@1.3.1': - resolution: {integrity: sha512-XTA9XTUtj0KPKuzNS2oi3bWN6tJodk00wwMd/TiKoEqx9Fe/zu+OfDGuXAn+xs+P7S3YCDHqjYinuTQMZ0ucJw==} - engines: {node: '>=14.0.0'} - cpu: [wasm32] - - '@napi-rs/lzma-win32-arm64-msvc@1.3.1': - resolution: {integrity: sha512-qLDfs9UEtLPPTN/FdSz3gSdlx86VwFQBuLBrQtaiYQtUTKZCOYV1Z1fXqFt5Zqa1HKV2oyXnwGcTI7RpcyXxtg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [win32] - - '@napi-rs/lzma-win32-ia32-msvc@1.3.1': - resolution: {integrity: sha512-rWNlxLFMIfvxzfdQCfeQ3D/HEnQG3vfladFYrXUx6ePXO6r+BLCGn6/LWSSuKlw4vKkb1iHEWsAVaRLIcJEMIA==} - engines: {node: '>= 10'} - cpu: [ia32] - os: [win32] - - '@napi-rs/lzma-win32-x64-msvc@1.3.1': - resolution: {integrity: sha512-SNfHNqEjabXfTL1+KRi0qiAhwIlZHhQystvfSYX6p1g+2trSC/3WUpUQ4fbbR7KyE31g2AAnwjXivnlQ0af/pg==} - engines: {node: '>= 10'} - cpu: [x64] - os: [win32] - - '@napi-rs/lzma@1.3.1': - resolution: {integrity: sha512-XyZoBlYNMvCulK/RmVK/0nB3j7IdH7HpqcrMMg0U+HqQqKRLOQBwvnKNBocPC1bZQ7iZuKWYTLn1ayZwTyek8w==} - engines: {node: '>= 10'} - - '@napi-rs/tar-android-arm-eabi@0.1.1': - resolution: {integrity: sha512-Ufa0ahZvE5KGrC2WBux5svCe/jvC+e8IgtleiicwqnfgTfbDknYyq/QuqkP1AnMp/IvTmx2iutCZt6OFIG0zAg==} - engines: {node: '>= 10'} - cpu: [arm] - os: [android] - - '@napi-rs/tar-android-arm64@0.1.1': - resolution: {integrity: sha512-KUu5fHIiIObSuZ/crHxUrQ243+LiCRKPwdCVLHwjtftqFjzls+R2Mp6GrpM41XxexDMN00SUta3kazi93Xr19A==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [android] - - '@napi-rs/tar-darwin-arm64@0.1.1': - resolution: {integrity: sha512-jaqgdX20iIga+2gzotQ78eF00Cm8vECocUYeMY62WqyzJNv/jx1dlOfELWEccOjpmawFT9tjWebsS9F1QMvSUg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [darwin] - - '@napi-rs/tar-darwin-x64@0.1.1': - resolution: {integrity: sha512-80sa32IxfRso9x9sGTFpfLSx3BnruyJODpSkUzalOCz9i14n5gOKA8KR/JrnSWwDz0p5l5P9kfQD3pu8Voj7WA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [darwin] - - '@napi-rs/tar-freebsd-x64@0.1.1': - resolution: {integrity: sha512-P7V1zBjjC1dCrTwtUzuzYM4AeZduigeCtd8qQw2IUZowM5AsmhMd77oYuXjdU29cEpKUpyYjJRxjPCzFy+WbAQ==} - engines: {node: '>= 10'} - cpu: [x64] - os: [freebsd] - - '@napi-rs/tar-linux-arm-gnueabihf@0.1.1': - resolution: {integrity: sha512-qpC71ILPkWKt8k1iJCYt5gjwcOkd2VFSQIelTRr12t5CVNKV04rE/TMdwFoCP7kxbtb9Fl2cZzCRISw2BhMCmQ==} - engines: {node: '>= 10'} - cpu: [arm] - os: [linux] - - '@napi-rs/tar-linux-arm64-gnu@0.1.1': - resolution: {integrity: sha512-71QgxcFJCog6O4Tauoge8D0ILkDGJTRk3ru7zG8PUFG1QXJ1kkiRikdT77YmoVxtomc9FUOt+bdEdU5Yn+3QUQ==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/tar-linux-arm64-musl@0.1.1': - resolution: {integrity: sha512-R2e7YEILPKc447N1hUt1zQuyy0st83HX6nhmtFywS1aOj76/3hzxLVrebGiiS6kifyCrO82o66CNTYe7DixMZw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/tar-linux-x64-gnu@0.1.1': - resolution: {integrity: sha512-tmy9q2LXUB2GQ+IgUzJn3+us52leplMu96ORyFq1iHQEelGSqXt4xi5DzU07JhX3obJPqVqkybtcRS4enBfmBA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/tar-linux-x64-musl@0.1.1': - resolution: {integrity: sha512-j5ePbe6vihApl0cGPPDUVTWZbf2mF4NhxngAoG2jp7AeX3cWP2O4pjsvaOraW6QfvWEMFPeER7S0b6eBS7duvA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/tar-wasm32-wasi@0.1.1': - resolution: {integrity: sha512-se0+DlOiIRt7mcz7BeOJDoZtCrROpKLwiAOGmNgrjQ/SZS7TnOPuwm3wy9XN9WLoepttEjCEem6UP8yD5GJuQg==} - engines: {node: '>=14.0.0'} - cpu: [wasm32] - - '@napi-rs/tar-win32-arm64-msvc@0.1.1': - resolution: {integrity: sha512-FDZPi2wC7RwzvodogigLh/pJvhqCTVTUqOYuHlLkPSUbSAGiEkI55wk9RqH3y3EdJQaDuzyqC0QKz5ket2U+GA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [win32] - - '@napi-rs/tar-win32-ia32-msvc@0.1.1': - resolution: {integrity: sha512-OPR9Tou5z5M912G7Kc7gkf1ltinbOQx5dS/OeDIWHvPGOfdFDIxt0YVKhzSLRJi43+zIDp8/+cbeMD/cKXfX8w==} - engines: {node: '>= 10'} - cpu: [ia32] - os: [win32] - - '@napi-rs/tar-win32-x64-msvc@0.1.1': - resolution: {integrity: sha512-hiv5KfhrMSg8tTRC2oQXVckVg1h6ZVjwbd5aF9Esl0V3p2TaNFwwbqgnAN4Gm/PmSnHWNL/IRTHkk3cOzDWihQ==} - engines: {node: '>= 10'} - cpu: [x64] - os: [win32] - - '@napi-rs/tar@0.1.1': - resolution: {integrity: sha512-FOMhwwlvoYjHaDBxP26K3D92ltw1Y/CC4CIjgC6qXdzW4MYNwTlEyI58smCM3k+nCVJH3kpOYyH3sgbK4WZA4A==} - engines: {node: '>= 10'} - - '@napi-rs/wasm-runtime@0.2.4': - resolution: {integrity: sha512-9zESzOO5aDByvhIAsOy9TbpZ0Ur2AJbUI7UT73kcUTS2mxAMHOBaa1st/jAymNoCtvrit99kkzT1FZuXVcgfIQ==} - - '@napi-rs/wasm-tools-android-arm-eabi@0.0.2': - resolution: {integrity: sha512-/b+UU3suXjW4P0DzHRNdrnebQtFKcQf/YMeZJH+xUlKgvwli5kbmWjx8Wqqz0VETVkUTuPqJMBDIVLyc+14FGw==} - engines: {node: '>= 10'} - cpu: [arm] - os: [android] - - '@napi-rs/wasm-tools-android-arm64@0.0.2': - resolution: {integrity: sha512-j57GbDflwJdZtT8pZj5fOV4JAP+LdKN+wzsUYs+QRUoBqpWbbUANudolqfw63bkS9sD4z7fbCuz8iwtJqzxTVA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [android] - - '@napi-rs/wasm-tools-darwin-arm64@0.0.2': - resolution: {integrity: sha512-P2ChgWgVuv9GwmbxN89R84KzIImoTqXINteEixUvmkdnhyFiR+I8deNs89Yed+5w8QLC6MEfrtRqLP9YI+NoQA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [darwin] - - '@napi-rs/wasm-tools-darwin-x64@0.0.2': - resolution: {integrity: sha512-T/kQQ0gt8+wau1Z821PKVAD76QhmwVoLs2CT7Z9tTBs2pJvwSCP0C/kQiQAHcJIMi7A2E9Ab/Mez0BERy50EFA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [darwin] - - '@napi-rs/wasm-tools-freebsd-x64@0.0.2': - resolution: {integrity: sha512-GnnHu+r5sfzuxC/1J5UMF/h3BOZnHb3NQZ5hmbCfZYCKzpzRxrAJhzRunlbRN+v0x8M/49dztVTYR3s7K4ooAw==} - engines: {node: '>= 10'} - cpu: [x64] - os: [freebsd] - - '@napi-rs/wasm-tools-linux-arm64-gnu@0.0.2': - resolution: {integrity: sha512-KnZdLT0OnKb1CG2kdt3/WvM43vr9i+FEwXCvSOVC/6Tsifz7ynhMg7LAVESILd03HubzQJfg9nbRsk0bQ+IOwg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/wasm-tools-linux-arm64-musl@0.0.2': - resolution: {integrity: sha512-HkpZOID2U8P6pWqK3mqZ8bxU5xcuT3iA2fO+jrxn78h006iYgfNmdc5JaVhHnHazMmk32xKhSV4iV0VUh8UWDg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/wasm-tools-linux-x64-gnu@0.0.2': - resolution: {integrity: sha512-YksJWBCyOalB9ogtP9+/dZKP+vR6+h7BmzMXaXMT71WW/GvIsifMVgv+DY/FRSNJQupp5Y+ugjqVAOUOc/G65g==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/wasm-tools-linux-x64-musl@0.0.2': - resolution: {integrity: sha512-sPtRxPMdw05KdTcxgSPMmSXG2+PiK3vJ/l2+g9hvjnnKtvslJN2Hr7j8zgzuoKRAUFPaJVe6+D2xVh5cpdqhww==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/wasm-tools-wasm32-wasi@0.0.2': - resolution: {integrity: sha512-muRvZK7AIuo88G2AxYx3gA59rHMQgoN004saQkBvXnz3K/DVHKfTZ6TtUebss8zI3dURU6xExL8drxFWYxjEbQ==} - engines: {node: '>=14.0.0'} - cpu: [wasm32] - - '@napi-rs/wasm-tools-win32-arm64-msvc@0.0.2': - resolution: {integrity: sha512-Cn13WQ+tpFqdVwx0DIWKbsI9auFyzVZV4F5UNOUeDt6GgOL+NndgJul0Pc9bSU6fi03AylMPfF/nTCaDWO2Wgw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [win32] - - '@napi-rs/wasm-tools-win32-ia32-msvc@0.0.2': - resolution: {integrity: sha512-xsg5DkIQi82a8rcx6246Y3XC8TIqHamY+/C6sIlPLaZEuHctDkMECAw0AANwRf5vN//D2oo2oljOuoYtB1GOKw==} - engines: {node: '>= 10'} - cpu: [ia32] - os: [win32] - - '@napi-rs/wasm-tools-win32-x64-msvc@0.0.2': - resolution: {integrity: sha512-yHigltEt33eq8bappvKsIliz4MxfMPn1M+NWbIFRWN+IS1Z57mhmc1osuk+IRXrSlq0Tom0R6MYN1jpkZKz81Q==} - engines: {node: '>= 10'} - cpu: [x64] - os: [win32] - - '@napi-rs/wasm-tools@0.0.2': - resolution: {integrity: sha512-kBvDQCP5BLw2TxTENXLp3Of7vVEx0uyIye824JHE4dduzzOHVgSoOFVhVqAT3Fx/hLV445RVWfEqQbXMg4w/Mw==} - engines: {node: '>= 10'} - - '@nodelib/fs.scandir@2.1.5': - resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} - engines: {node: '>= 8'} - - '@nodelib/fs.stat@2.0.5': - resolution: {integrity: sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==} - engines: {node: '>= 8'} - - '@nodelib/fs.walk@1.2.8': - resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} - engines: {node: '>= 8'} - - '@octokit/auth-token@4.0.0': - resolution: {integrity: sha512-tY/msAuJo6ARbK6SPIxZrPBms3xPbfwBrulZe0Wtr/DIY9lje2HeV1uoebShn6mx7SjCHif6EjMvoREj+gZ+SA==} - engines: {node: '>= 18'} - - '@octokit/core@5.2.0': - resolution: {integrity: sha512-1LFfa/qnMQvEOAdzlQymH0ulepxbxnCYAKJZfMci/5XJyIHWgEYnDmgnKakbTh7CH2tFQ5O60oYDvns4i9RAIg==} - engines: {node: '>= 18'} - - '@octokit/endpoint@9.0.5': - resolution: {integrity: sha512-ekqR4/+PCLkEBF6qgj8WqJfvDq65RH85OAgrtnVp1mSxaXF03u2xW/hUdweGS5654IlC0wkNYC18Z50tSYTAFw==} - engines: {node: '>= 18'} - - '@octokit/graphql@7.1.0': - resolution: {integrity: sha512-r+oZUH7aMFui1ypZnAvZmn0KSqAUgE1/tUXIWaqUCa1758ts/Jio84GZuzsvUkme98kv0WFY8//n0J1Z+vsIsQ==} - engines: {node: '>= 18'} - - '@octokit/openapi-types@22.2.0': - resolution: {integrity: sha512-QBhVjcUa9W7Wwhm6DBFu6ZZ+1/t/oYxqc2tp81Pi41YNuJinbFRx8B133qVOrAaBbF7D/m0Et6f9/pZt9Rc+tg==} - - '@octokit/plugin-paginate-rest@11.3.1': - resolution: {integrity: sha512-ryqobs26cLtM1kQxqeZui4v8FeznirUsksiA+RYemMPJ7Micju0WSkv50dBksTuZks9O5cg4wp+t8fZ/cLY56g==} - engines: {node: '>= 18'} - peerDependencies: - '@octokit/core': '5' - - '@octokit/plugin-request-log@4.0.1': - resolution: {integrity: sha512-GihNqNpGHorUrO7Qa9JbAl0dbLnqJVrV8OXe2Zm5/Y4wFkZQDfTreBzVmiRfJVfE4mClXdihHnbpyyO9FSX4HA==} - engines: {node: '>= 18'} - peerDependencies: - '@octokit/core': '5' - - '@octokit/plugin-rest-endpoint-methods@13.2.2': - resolution: {integrity: sha512-EI7kXWidkt3Xlok5uN43suK99VWqc8OaIMktY9d9+RNKl69juoTyxmLoWPIZgJYzi41qj/9zU7G/ljnNOJ5AFA==} - engines: {node: '>= 18'} - peerDependencies: - '@octokit/core': ^5 - - '@octokit/request-error@5.1.0': - resolution: {integrity: sha512-GETXfE05J0+7H2STzekpKObFe765O5dlAKUTLNGeH+x47z7JjXHfsHKo5z21D/o/IOZTUEI6nyWyR+bZVP/n5Q==} - engines: {node: '>= 18'} - - '@octokit/request@8.4.0': - resolution: {integrity: sha512-9Bb014e+m2TgBeEJGEbdplMVWwPmL1FPtggHQRkV+WVsMggPtEkLKPlcVYm/o8xKLkpJ7B+6N8WfQMtDLX2Dpw==} - engines: {node: '>= 18'} - - '@octokit/rest@20.1.1': - resolution: {integrity: sha512-MB4AYDsM5jhIHro/dq4ix1iWTLGToIGk6cWF5L6vanFaMble5jTX/UBQyiv05HsWnwUtY8JrfHy2LWfKwihqMw==} - engines: {node: '>= 18'} - - '@octokit/types@13.5.0': - resolution: {integrity: sha512-HdqWTf5Z3qwDVlzCrP8UJquMwunpDiMPt5er+QjGzL4hqr/vBVY/MauQgS1xWxCDT1oMx1EULyqxncdCY/NVSQ==} - - '@rollup/pluginutils@4.2.1': - resolution: {integrity: sha512-iKnFXr7NkdZAIHiIWE+BX5ULi/ucVFYWD6TbAV+rZctiRTY2PL6tsIKhoIOaoskiWAkgu+VsbXgUVDNLHf+InQ==} - engines: {node: '>= 8.0.0'} - - '@sindresorhus/merge-streams@2.3.0': - resolution: {integrity: sha512-LtoMMhxAlorcGhmFYI+LhPgbPZCkgP6ra1YL604EeF6U98pLlQ3iWIGMdWSC+vWmPBWBNgmDBAhnAobLROJmwg==} - engines: {node: '>=18'} - - '@tybys/wasm-util@0.9.0': - resolution: {integrity: sha512-6+7nlbMVX/PVDCwaIQ8nTOPveOcFLSt8GcXdx8hD0bt39uWxYT88uXzqTd4fTvqta7oeUJqudepapKNt2DYJFw==} - - '@types/node@20.14.2': - resolution: {integrity: sha512-xyu6WAMVwv6AKFLB+e/7ySZVr/0zLCzOa7rSpq6jNwpqOrUbcACDWC+53d4n2QHOnDou0fbIsg8wZu/sxrnI4Q==} - - '@types/stylis@4.2.6': - resolution: {integrity: sha512-4nebF2ZJGzQk0ka0O6+FZUWceyFv4vWq/0dXBMmrSeAwzOuOd/GxE5Pa64d/ndeNLG73dXoBsRzvtsVsYUv6Uw==} - - '@vercel/nft@0.26.5': - resolution: {integrity: sha512-NHxohEqad6Ra/r4lGknO52uc/GrWILXAMs1BB4401GTqww0fw1bAqzpG1XHuDO+dprg4GvsD9ZLLSsdo78p9hQ==} - engines: {node: '>=16'} - hasBin: true - - abbrev@1.1.1: - resolution: {integrity: sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==} - - acorn-import-attributes@1.9.5: - resolution: {integrity: sha512-n02Vykv5uA3eHGM/Z2dQrcD56kL8TyDb2p1+0P83PClMnC/nc+anbQRhIOWnSq4Ke/KvDPrY3C9hDtC/A3eHnQ==} - peerDependencies: - acorn: ^8 - - acorn-walk@8.3.3: - resolution: {integrity: sha512-MxXdReSRhGO7VlFe1bRG/oI7/mdLV9B9JJT0N8vZOhF7gFRR5l3M8W9G8JxmKV+JC5mGqJ0QvqfSOLsCPa4nUw==} - engines: {node: '>=0.4.0'} - - acorn@8.12.0: - resolution: {integrity: sha512-RTvkC4w+KNXrM39/lWCUaG0IbRkWdCv7W/IOW9oU6SawyxulvkQy5HQPVTKxEjczcUvapcrw3cFx/60VN/NRNw==} - engines: {node: '>=0.4.0'} - hasBin: true - - agent-base@6.0.2: - resolution: {integrity: sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==} - engines: {node: '>= 6.0.0'} - - ansi-escapes@4.3.2: - resolution: {integrity: sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==} - engines: {node: '>=8'} - - ansi-regex@5.0.1: - resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} - engines: {node: '>=8'} - - ansi-regex@6.0.1: - resolution: {integrity: sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==} - engines: {node: '>=12'} - - ansi-styles@4.3.0: - resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} - engines: {node: '>=8'} - - ansi-styles@6.2.1: - resolution: {integrity: sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==} - engines: {node: '>=12'} - - aproba@2.0.0: - resolution: {integrity: sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==} - - are-we-there-yet@2.0.0: - resolution: {integrity: sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw==} - engines: {node: '>=10'} - deprecated: This package is no longer supported. - - argparse@1.0.10: - resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==} - - argparse@2.0.1: - resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} - - array-find-index@1.0.2: - resolution: {integrity: sha512-M1HQyIXcBGtVywBt8WVdim+lrNaK7VHp99Qt5pSNziXznKHViIBbXWtfRTpEFpF/c4FdfxNAsCCwPp5phBYJtw==} - engines: {node: '>=0.10.0'} - - arrgv@1.0.2: - resolution: {integrity: sha512-a4eg4yhp7mmruZDQFqVMlxNRFGi/i1r87pt8SDHy0/I8PqSXoUTlWZRdAZo0VXgvEARcujbtTk8kiZRi1uDGRw==} - engines: {node: '>=8.0.0'} - - arrify@3.0.0: - resolution: {integrity: sha512-tLkvA81vQG/XqE2mjDkGQHoOINtMHtysSnemrmoGe6PydDPMRbVugqyk4A6V/WDWEfm3l+0d8anA9r8cv/5Jaw==} - engines: {node: '>=12'} - - async-sema@3.1.1: - resolution: {integrity: sha512-tLRNUXati5MFePdAk8dw7Qt7DpxPB60ofAgn8WRhW6a2rcimZnYBP9oxHiv0OHy+Wz7kPMG+t4LGdt31+4EmGg==} - - asynckit@0.4.0: - resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} - - ava@6.1.3: - resolution: {integrity: sha512-tkKbpF1pIiC+q09wNU9OfyTDYZa8yuWvU2up3+lFJ3lr1RmnYh2GBpPwzYUEB0wvTPIUysGjcZLNZr7STDviRA==} - engines: {node: ^18.18 || ^20.8 || ^21 || ^22} - hasBin: true - peerDependencies: - '@ava/typescript': '*' - peerDependenciesMeta: - '@ava/typescript': - optional: true - - axios@1.6.2: - resolution: {integrity: sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A==} - - balanced-match@1.0.2: - resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} - - base64-js@1.5.1: - resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==} - - before-after-hook@2.2.3: - resolution: {integrity: sha512-NzUnlZexiaH/46WDhANlyR2bXRopNg4F/zuSA3OpZnllCUgRaOF2znDioDWrmbNVsuZk6l9pMquQB38cfBZwkQ==} - - bindings@1.5.0: - resolution: {integrity: sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==} - - bl@4.1.0: - resolution: {integrity: sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==} - - blueimp-md5@2.19.0: - resolution: {integrity: sha512-DRQrD6gJyy8FbiE4s+bDoXS9hiW3Vbx5uCdwvcCf3zLHL+Iv7LtGHLpr+GZV8rHG8tK766FGYBwRbu8pELTt+w==} - - brace-expansion@1.1.11: - resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} - - braces@3.0.3: - resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==} - engines: {node: '>=8'} - - buffer@5.7.1: - resolution: {integrity: sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==} - - call-bind@1.0.7: - resolution: {integrity: sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==} - engines: {node: '>= 0.4'} - - callsites@4.1.0: - resolution: {integrity: sha512-aBMbD1Xxay75ViYezwT40aQONfr+pSXTHwNKvIXhXD6+LY3F1dLIcceoC5OZKBVHbXcysz1hL9D2w0JJIMXpUw==} - engines: {node: '>=12.20'} - - camelize@1.0.1: - resolution: {integrity: sha512-dU+Tx2fsypxTgtLoE36npi3UqcjSSMNYfkqgmoEhtZrraP5VWq0K7FkWVTYa8eMPtnU/G2txVsfdCJTn9uzpuQ==} - - cbor@9.0.2: - resolution: {integrity: sha512-JPypkxsB10s9QOWwa6zwPzqE1Md3vqpPc+cai4sAecuCsRyAtAl/pMyhPlMbT/xtPnm2dznJZYRLui57qiRhaQ==} - engines: {node: '>=16'} - - chalk@4.1.2: - resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} - engines: {node: '>=10'} - - chalk@5.3.0: - resolution: {integrity: sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==} - engines: {node: ^12.17.0 || ^14.13 || >=16.0.0} - - chardet@0.7.0: - resolution: {integrity: sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==} - - chownr@2.0.0: - resolution: {integrity: sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==} - engines: {node: '>=10'} - - chunkd@2.0.1: - resolution: {integrity: sha512-7d58XsFmOq0j6el67Ug9mHf9ELUXsQXYJBkyxhH/k+6Ke0qXRnv0kbemx+Twc6fRJ07C49lcbdgm9FL1Ei/6SQ==} - - ci-info@4.0.0: - resolution: {integrity: sha512-TdHqgGf9odd8SXNuxtUBVx8Nv+qZOejE6qyqiy5NtbYYQOeFa6zmHkxlPzmaLxWWHsU6nJmB7AETdVPi+2NBUg==} - engines: {node: '>=8'} - - ci-parallel-vars@1.0.1: - resolution: {integrity: sha512-uvzpYrpmidaoxvIQHM+rKSrigjOe9feHYbw4uOI2gdfe1C3xIlxO+kVXq83WQWNniTf8bAxVpy+cQeFQsMERKg==} - - cli-cursor@3.1.0: - resolution: {integrity: sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==} - engines: {node: '>=8'} - - cli-spinners@2.9.2: - resolution: {integrity: sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==} - engines: {node: '>=6'} - - cli-truncate@4.0.0: - resolution: {integrity: sha512-nPdaFdQ0h/GEigbPClz11D0v/ZJEwxmeVZGeMo3Z5StPtUTkA9o1lD6QwoirYiSDzbcwn2XcjwmCp68W1IS4TA==} - engines: {node: '>=18'} - - cli-width@4.1.0: - resolution: {integrity: sha512-ouuZd4/dm2Sw5Gmqy6bGyNNNe1qt9RpmxveLSO7KcgsTnU7RXfsw+/bukWGo1abgBiMAic068rclZsO4IWmmxQ==} - engines: {node: '>= 12'} - - clipanion@3.2.1: - resolution: {integrity: sha512-dYFdjLb7y1ajfxQopN05mylEpK9ZX0sO1/RfMXdfmwjlIsPkbh4p7A682x++zFPLDCo1x3p82dtljHf5cW2LKA==} - peerDependencies: - typanion: '*' - - cliui@8.0.1: - resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==} - engines: {node: '>=12'} - - clone@1.0.4: - resolution: {integrity: sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==} - engines: {node: '>=0.8'} - - code-excerpt@4.0.0: - resolution: {integrity: sha512-xxodCmBen3iy2i0WtAK8FlFNrRzjUqjRsMfho58xT/wvZU1YTM3fCnRjcy1gJPMepaRlgm/0e6w8SpWHpn3/cA==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - color-convert@2.0.1: - resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} - engines: {node: '>=7.0.0'} - - color-name@1.1.4: - resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} - - color-support@1.1.3: - resolution: {integrity: sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==} - hasBin: true - - colorette@2.0.20: - resolution: {integrity: sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==} - - combined-stream@1.0.8: - resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} - engines: {node: '>= 0.8'} - - common-path-prefix@3.0.0: - resolution: {integrity: sha512-QE33hToZseCH3jS0qN96O/bSh3kaw/h+Tq7ngyY9eWDUnTlTNUyqfqvCXioLe5Na5jFsL78ra/wuBU4iuEgd4w==} - - concat-map@0.0.1: - resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} - - concordance@5.0.4: - resolution: {integrity: sha512-OAcsnTEYu1ARJqWVGwf4zh4JDfHZEaSNlNccFmt8YjB2l/n19/PF2viLINHc57vO4FKIAFl2FWASIGZZWZ2Kxw==} - engines: {node: '>=10.18.0 <11 || >=12.14.0 <13 || >=14'} - - console-control-strings@1.1.0: - resolution: {integrity: sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==} - - convert-to-spaces@2.0.1: - resolution: {integrity: sha512-rcQ1bsQO9799wq24uE5AM2tAILy4gXGIK/njFWcVQkGNZ96edlpY+A7bjwvzjYvLDyzmG1MmMLZhpcsb+klNMQ==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - css-color-keywords@1.0.0: - resolution: {integrity: sha512-FyyrDHZKEjXDpNJYvVsV960FiqQyXc/LlYmsxl2BcdMb2WPx0OGRVgTg55rPSyLSNMqP52R9r8geSp7apN3Ofg==} - engines: {node: '>=4'} - - css-to-react-native@3.2.0: - resolution: {integrity: sha512-e8RKaLXMOFii+02mOlqwjbD00KSEKqblnpO9e++1aXS1fPQOpS1YoqdVHBqPjHNoxeF2mimzVqawm2KCbEdtHQ==} - - csstype@3.1.3: - resolution: {integrity: sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==} - - currently-unhandled@0.4.1: - resolution: {integrity: sha512-/fITjgjGU50vjQ4FH6eUoYu+iUoUKIXws2hL15JJpIR+BbTxaXQsMuuyjtNh2WqsSBS5nsaZHFsFecyw5CCAng==} - engines: {node: '>=0.10.0'} - - date-time@3.1.0: - resolution: {integrity: sha512-uqCUKXE5q1PNBXjPqvwhwJf9SwMoAHBgWJ6DcrnS5o+W2JOiIILl0JEdVD8SGujrNS02GGxgwAg2PN2zONgtjg==} - engines: {node: '>=6'} - - debug@4.3.5: - resolution: {integrity: sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg==} - engines: {node: '>=6.0'} - peerDependencies: - supports-color: '*' - peerDependenciesMeta: - supports-color: - optional: true - - defaults@1.0.4: - resolution: {integrity: sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A==} - - define-data-property@1.1.4: - resolution: {integrity: sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==} - engines: {node: '>= 0.4'} - - delayed-stream@1.0.0: - resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} - engines: {node: '>=0.4.0'} - - delegates@1.0.0: - resolution: {integrity: sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==} - - deprecation@2.3.1: - resolution: {integrity: sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==} - - detect-libc@2.0.3: - resolution: {integrity: sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw==} - engines: {node: '>=8'} - - emittery@1.0.3: - resolution: {integrity: sha512-tJdCJitoy2lrC2ldJcqN4vkqJ00lT+tOWNT1hBJjO/3FDMJa5TTIiYGCKGkn/WfCyOzUMObeohbVTj00fhiLiA==} - engines: {node: '>=14.16'} - - emnapi@1.2.0: - resolution: {integrity: sha512-rcq+dJCcfr08I0XM/57LPRqaUokGfni/+SvhO7NaJthTTjRdohhIy0FQwyC5rR1enAsjkldQg83th8J5hURv0Q==} - peerDependencies: - node-addon-api: '>= 6.1.0' - peerDependenciesMeta: - node-addon-api: - optional: true - - emoji-regex@10.3.0: - resolution: {integrity: sha512-QpLs9D9v9kArv4lfDEgg1X/gN5XLnf/A6l9cs8SPZLRZR3ZkY9+kwIQTxm+fsSej5UMYGE8fdoaZVIBlqG0XTw==} - - emoji-regex@8.0.0: - resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} - - es-define-property@1.0.0: - resolution: {integrity: sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==} - engines: {node: '>= 0.4'} - - es-errors@1.3.0: - resolution: {integrity: sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==} - engines: {node: '>= 0.4'} - - escalade@3.1.2: - resolution: {integrity: sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==} - engines: {node: '>=6'} - - escape-string-regexp@2.0.0: - resolution: {integrity: sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==} - engines: {node: '>=8'} - - escape-string-regexp@5.0.0: - resolution: {integrity: sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==} - engines: {node: '>=12'} - - esprima@4.0.1: - resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==} - engines: {node: '>=4'} - hasBin: true - - estree-walker@2.0.2: - resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==} - - esutils@2.0.3: - resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} - engines: {node: '>=0.10.0'} - - external-editor@3.1.0: - resolution: {integrity: sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==} - engines: {node: '>=4'} - - fast-diff@1.3.0: - resolution: {integrity: sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==} - - fast-glob@3.3.2: - resolution: {integrity: sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==} - engines: {node: '>=8.6.0'} - - fastq@1.17.1: - resolution: {integrity: sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==} - - figures@6.1.0: - resolution: {integrity: sha512-d+l3qxjSesT4V7v2fh+QnmFnUWv9lSpjarhShNTgBOfA0ttejbQUAlHLitbjkoRiDulW0OPoQPYIGhIC8ohejg==} - engines: {node: '>=18'} - - file-uri-to-path@1.0.0: - resolution: {integrity: sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==} - - fill-range@7.1.1: - resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==} - engines: {node: '>=8'} - - find-up-simple@1.0.0: - resolution: {integrity: sha512-q7Us7kcjj2VMePAa02hDAF6d+MzsdsAWEwYyOpwUtlerRBkOEPBCRZrAV4XfcSN8fHAgaD0hP7miwoay6DCprw==} - engines: {node: '>=18'} - - follow-redirects@1.15.6: - resolution: {integrity: sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==} - engines: {node: '>=4.0'} - peerDependencies: - debug: '*' - peerDependenciesMeta: - debug: - optional: true - - form-data@4.0.0: - resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==} - engines: {node: '>= 6'} - - fs-minipass@2.1.0: - resolution: {integrity: sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==} - engines: {node: '>= 8'} - - fs.realpath@1.0.0: - resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} - - function-bind@1.1.2: - resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==} - - gauge@3.0.2: - resolution: {integrity: sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q==} - engines: {node: '>=10'} - deprecated: This package is no longer supported. - - get-caller-file@2.0.5: - resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} - engines: {node: 6.* || 8.* || >= 10.*} - - get-east-asian-width@1.2.0: - resolution: {integrity: sha512-2nk+7SIVb14QrgXFHcm84tD4bKQz0RxPuMT8Ag5KPOq7J5fEmAg0UbXdTOSHqNuHSU28k55qnceesxXRZGzKWA==} - engines: {node: '>=18'} - - get-intrinsic@1.2.4: - resolution: {integrity: sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==} - engines: {node: '>= 0.4'} - - glob-parent@5.1.2: - resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} - engines: {node: '>= 6'} - - glob@7.2.3: - resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} - deprecated: Glob versions prior to v9 are no longer supported - - globby@14.0.1: - resolution: {integrity: sha512-jOMLD2Z7MAhyG8aJpNOpmziMOP4rPLcc95oQPKXBazW82z+CEgPFBQvEpRUa1KeIMUJo4Wsm+q6uzO/Q/4BksQ==} - engines: {node: '>=18'} - - gopd@1.0.1: - resolution: {integrity: sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==} - - graceful-fs@4.2.11: - resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} - - has-flag@4.0.0: - resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} - engines: {node: '>=8'} - - has-property-descriptors@1.0.2: - resolution: {integrity: sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==} - - has-proto@1.0.3: - resolution: {integrity: sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==} - engines: {node: '>= 0.4'} - - has-symbols@1.0.3: - resolution: {integrity: sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==} - engines: {node: '>= 0.4'} - - has-unicode@2.0.1: - resolution: {integrity: sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==} - - hasown@2.0.2: - resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==} - engines: {node: '>= 0.4'} - - https-proxy-agent@5.0.1: - resolution: {integrity: sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==} - engines: {node: '>= 6'} - - iconv-lite@0.4.24: - resolution: {integrity: sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==} - engines: {node: '>=0.10.0'} - - ieee754@1.2.1: - resolution: {integrity: sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==} - - ignore-by-default@2.1.0: - resolution: {integrity: sha512-yiWd4GVmJp0Q6ghmM2B/V3oZGRmjrKLXvHR3TE1nfoXsmoggllfZUQe74EN0fJdPFZu2NIvNdrMMLm3OsV7Ohw==} - engines: {node: '>=10 <11 || >=12 <13 || >=14'} - - ignore@5.3.1: - resolution: {integrity: sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==} - engines: {node: '>= 4'} - - imurmurhash@0.1.4: - resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} - engines: {node: '>=0.8.19'} - - indent-string@5.0.0: - resolution: {integrity: sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==} - engines: {node: '>=12'} - - inflight@1.0.6: - resolution: {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. - - inherits@2.0.4: - resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} - - inquirer@9.2.23: - resolution: {integrity: sha512-kod5s+FBPIDM2xiy9fu+6wdU/SkK5le5GS9lh4FEBjBHqiMgD9lLFbCbuqFNAjNL2ZOy9Wd9F694IOzN9pZHBA==} - engines: {node: '>=18'} - - irregular-plurals@3.5.0: - resolution: {integrity: sha512-1ANGLZ+Nkv1ptFb2pa8oG8Lem4krflKuX/gINiHJHjJUKaJHk/SXk5x6K3J+39/p0h1RQ2saROclJJ+QLvETCQ==} - engines: {node: '>=8'} - - is-extglob@2.1.1: - resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} - engines: {node: '>=0.10.0'} - - is-fullwidth-code-point@3.0.0: - resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} - engines: {node: '>=8'} - - is-fullwidth-code-point@4.0.0: - resolution: {integrity: sha512-O4L094N2/dZ7xqVdrXhh9r1KODPJpFms8B5sGdJLPy664AgvXsreZUyCQQNItZRDlYug4xStLjNp/sz3HvBowQ==} - engines: {node: '>=12'} - - is-glob@4.0.3: - resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} - engines: {node: '>=0.10.0'} - - is-interactive@1.0.0: - resolution: {integrity: sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w==} - engines: {node: '>=8'} - - is-number@7.0.0: - resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} - engines: {node: '>=0.12.0'} - - is-plain-object@5.0.0: - resolution: {integrity: sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==} - engines: {node: '>=0.10.0'} - - is-promise@4.0.0: - resolution: {integrity: sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==} - - is-unicode-supported@0.1.0: - resolution: {integrity: sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==} - engines: {node: '>=10'} - - is-unicode-supported@2.0.0: - resolution: {integrity: sha512-FRdAyx5lusK1iHG0TWpVtk9+1i+GjrzRffhDg4ovQ7mcidMQ6mj+MhKPmvh7Xwyv5gIS06ns49CA7Sqg7lC22Q==} - engines: {node: '>=18'} - - js-string-escape@1.0.1: - resolution: {integrity: sha512-Smw4xcfIQ5LVjAOuJCvN/zIodzA/BBSsluuoSykP+lUvScIi4U6RJLfwHet5cxFnCswUjISV8oAXaqaJDY3chg==} - engines: {node: '>= 0.8'} - - js-tokens@4.0.0: - resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} - - js-yaml@3.14.1: - resolution: {integrity: sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==} - hasBin: true - - js-yaml@4.1.0: - resolution: {integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==} - hasBin: true - - load-json-file@7.0.1: - resolution: {integrity: sha512-Gnxj3ev3mB5TkVBGad0JM6dmLiQL+o0t23JPBZ9sd+yvSLk05mFoqKBw5N8gbbkU4TNXyqCgIrl/VM17OgUIgQ==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - lodash-es@4.17.21: - resolution: {integrity: sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==} - - lodash@4.17.21: - resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} - - log-symbols@4.1.0: - resolution: {integrity: sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==} - engines: {node: '>=10'} - - loose-envify@1.4.0: - resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==} - hasBin: true - - make-dir@3.1.0: - resolution: {integrity: sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==} - engines: {node: '>=8'} - - matcher@5.0.0: - resolution: {integrity: sha512-s2EMBOWtXFc8dgqvoAzKJXxNHibcdJMV0gwqKUaw9E2JBJuGUK7DrNKrA6g/i+v72TT16+6sVm5mS3thaMLQUw==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - md5-hex@3.0.1: - resolution: {integrity: sha512-BUiRtTtV39LIJwinWBjqVsU9xhdnz7/i889V859IBFpuqGAj6LuOvHv5XLbgZ2R7ptJoJaEcxkv88/h25T7Ciw==} - engines: {node: '>=8'} - - memoize@10.0.0: - resolution: {integrity: sha512-H6cBLgsi6vMWOcCpvVCdFFnl3kerEXbrYh9q+lY6VXvQSmM6CkmV08VOwT+WE2tzIEqRPFfAq3fm4v/UIW6mSA==} - engines: {node: '>=18'} - - merge2@1.4.1: - resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} - engines: {node: '>= 8'} - - micromatch@4.0.7: - resolution: {integrity: sha512-LPP/3KorzCwBxfeUuZmaR6bG2kdeHSbe0P2tY3FLRU4vYrjYz5hI4QZwV0njUx3jeuKe67YukQ1LSPZBKDqO/Q==} - engines: {node: '>=8.6'} - - mime-db@1.52.0: - resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} - engines: {node: '>= 0.6'} - - mime-types@2.1.35: - resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} - engines: {node: '>= 0.6'} - - mimic-fn@2.1.0: - resolution: {integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==} - engines: {node: '>=6'} - - mimic-function@5.0.1: - resolution: {integrity: sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==} - engines: {node: '>=18'} - - minimatch@3.1.2: - resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} - - minipass@3.3.6: - resolution: {integrity: sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==} - engines: {node: '>=8'} - - minipass@5.0.0: - resolution: {integrity: sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==} - engines: {node: '>=8'} - - minizlib@2.1.2: - resolution: {integrity: sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==} - engines: {node: '>= 8'} - - mkdirp@1.0.4: - resolution: {integrity: sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==} - engines: {node: '>=10'} - hasBin: true - - ms@2.1.2: - resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} - - ms@2.1.3: - resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} - - mute-stream@1.0.0: - resolution: {integrity: sha512-avsJQhyd+680gKXyG/sQc0nXaC6rBkPOfyHYcFb9+hdkqQkR9bdnkJ0AMZhke0oesPqIO+mFFJ+IdBc7mst4IA==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - - nanoid@3.3.7: - resolution: {integrity: sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==} - engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} - hasBin: true - - node-fetch@2.7.0: - resolution: {integrity: sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==} - engines: {node: 4.x || >=6.0.0} - peerDependencies: - encoding: ^0.1.0 - peerDependenciesMeta: - encoding: - optional: true - - node-gyp-build@4.8.1: - resolution: {integrity: sha512-OSs33Z9yWr148JZcbZd5WiAXhh/n9z8TxQcdMhIOlpN9AhWpLfvVFO73+m77bBABQMaY9XSvIa+qk0jlI7Gcaw==} - hasBin: true - - nofilter@3.1.0: - resolution: {integrity: sha512-l2NNj07e9afPnhAhvgVrCD/oy2Ai1yfLpuo3EpiO1jFTsB4sFz6oIfAfSZyQzVpkZQ9xS8ZS5g1jCBgq4Hwo0g==} - engines: {node: '>=12.19'} - - nopt@5.0.0: - resolution: {integrity: sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==} - engines: {node: '>=6'} - hasBin: true - - npmlog@5.0.1: - resolution: {integrity: sha512-AqZtDUWOMKs1G/8lwylVjrdYgqA4d9nu8hc+0gzRxlDb1I10+FHBGMXs6aiQHFdCUUlqH99MUMuLfzWDNDtfxw==} - deprecated: This package is no longer supported. - - object-assign@4.1.1: - resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} - engines: {node: '>=0.10.0'} - - once@1.4.0: - resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} - - onetime@5.1.2: - resolution: {integrity: sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==} - engines: {node: '>=6'} - - ora@5.4.1: - resolution: {integrity: sha512-5b6Y85tPxZZ7QytO+BQzysW31HJku27cRIlkbAXaNx+BdcVi+LlRFmVXzeF6a7JCwJpyw5c4b+YSVImQIrBpuQ==} - engines: {node: '>=10'} - - os-tmpdir@1.0.2: - resolution: {integrity: sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==} - engines: {node: '>=0.10.0'} - - p-map@7.0.2: - resolution: {integrity: sha512-z4cYYMMdKHzw4O5UkWJImbZynVIo0lSGTXc7bzB1e/rrDqkgGUNysK/o4bTr+0+xKvvLoTyGqYC4Fgljy9qe1Q==} - engines: {node: '>=18'} - - package-config@5.0.0: - resolution: {integrity: sha512-GYTTew2slBcYdvRHqjhwaaydVMvn/qrGC323+nKclYioNSLTDUM/lGgtGTgyHVtYcozb+XkE8CNhwcraOmZ9Mg==} - engines: {node: '>=18'} - - parse-ms@4.0.0: - resolution: {integrity: sha512-TXfryirbmq34y8QBwgqCVLi+8oA3oWx2eAnSn62ITyEhEYaWRlVZ2DvMM9eZbMs/RfxPu/PK/aBLyGj4IrqMHw==} - engines: {node: '>=18'} - - path-is-absolute@1.0.1: - resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==} - engines: {node: '>=0.10.0'} - - path-type@5.0.0: - resolution: {integrity: sha512-5HviZNaZcfqP95rwpv+1HDgUamezbqdSYTyzjTvwtJSnIH+3vnbmWsItli8OFEndS984VT55M3jduxZbX351gg==} - engines: {node: '>=12'} - - picocolors@1.0.1: - resolution: {integrity: sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==} - - picomatch@2.3.1: - resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} - engines: {node: '>=8.6'} - - picomatch@3.0.1: - resolution: {integrity: sha512-I3EurrIQMlRc9IaAZnqRR044Phh2DXY+55o7uJ0V+hYZAcQYSuFWsc9q5PvyDHUSCe1Qxn/iBz+78s86zWnGag==} - engines: {node: '>=10'} - - plur@5.1.0: - resolution: {integrity: sha512-VP/72JeXqak2KiOzjgKtQen5y3IZHn+9GOuLDafPv0eXa47xq0At93XahYBs26MsifCQ4enGKwbjBTKgb9QJXg==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - postcss-value-parser@4.2.0: - resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==} - - postcss@8.4.33: - resolution: {integrity: sha512-Kkpbhhdjw2qQs2O2DGX+8m5OVqEcbB9HRBvuYM9pgrjEFUg30A9LmXNlTAUj4S9kgtGyrMbTzVjH7E+s5Re2yg==} - engines: {node: ^10 || ^12 || >=14} - - pretty-ms@9.0.0: - resolution: {integrity: sha512-E9e9HJ9R9NasGOgPaPE8VMeiPKAyWR5jcFpNnwIejslIhWqdqOrb2wShBsncMPUb+BcCd2OPYfh7p2W6oemTng==} - engines: {node: '>=18'} - - proxy-from-env@1.1.0: - resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==} - - queue-microtask@1.2.3: - resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} - - react-dom@18.3.1: - resolution: {integrity: sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==} - peerDependencies: - react: ^18.3.1 - - react@18.3.1: - resolution: {integrity: sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==} - engines: {node: '>=0.10.0'} - - readable-stream@3.6.2: - resolution: {integrity: sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==} - engines: {node: '>= 6'} - - require-directory@2.1.1: - resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} - engines: {node: '>=0.10.0'} - - resolve-cwd@3.0.0: - resolution: {integrity: sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==} - engines: {node: '>=8'} - - resolve-from@5.0.0: - resolution: {integrity: sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==} - engines: {node: '>=8'} - - restore-cursor@3.1.0: - resolution: {integrity: sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==} - engines: {node: '>=8'} - - reusify@1.0.4: - resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==} - engines: {iojs: '>=1.0.0', node: '>=0.10.0'} - - rimraf@3.0.2: - resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==} - deprecated: Rimraf versions prior to v4 are no longer supported - hasBin: true - - run-async@3.0.0: - resolution: {integrity: sha512-540WwVDOMxA6dN6We19EcT9sc3hkXPw5mzRNGM3FkdN/vtE9NFvj5lFAPNwUDmJjXidm3v7TC1cTE7t17Ulm1Q==} - engines: {node: '>=0.12.0'} - - run-parallel@1.2.0: - resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} - - rxjs@7.8.1: - resolution: {integrity: sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==} - - safe-buffer@5.2.1: - resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} - - safer-buffer@2.1.2: - resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} - - scheduler@0.23.2: - resolution: {integrity: sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ==} - - semver@6.3.1: - resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} - hasBin: true - - semver@7.6.2: - resolution: {integrity: sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==} - engines: {node: '>=10'} - hasBin: true - - serialize-error@7.0.1: - resolution: {integrity: sha512-8I8TjW5KMOKsZQTvoxjuSIa7foAwPWGOts+6o7sgjz41/qMD9VQHEDxi6PBvK2l0MXUmqZyNpUK+T2tQaaElvw==} - engines: {node: '>=10'} - - set-blocking@2.0.0: - resolution: {integrity: sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==} - - set-function-length@1.2.2: - resolution: {integrity: sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==} - engines: {node: '>= 0.4'} - - shallowequal@1.1.0: - resolution: {integrity: sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ==} - - signal-exit@3.0.7: - resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} - - signal-exit@4.1.0: - resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} - engines: {node: '>=14'} - - slash@5.1.0: - resolution: {integrity: sha512-ZA6oR3T/pEyuqwMgAKT0/hAv8oAXckzbkmR0UkUosQ+Mc4RxGoJkRmwHgHufaenlyAgE1Mxgpdcrf75y6XcnDg==} - engines: {node: '>=14.16'} - - slice-ansi@5.0.0: - resolution: {integrity: sha512-FC+lgizVPfie0kkhqUScwRu1O/lF6NOgJmlCgK+/LYxDCTk8sGelYaHDhFcDN+Sn3Cv+3VSa4Byeo+IMCzpMgQ==} - engines: {node: '>=12'} - - source-map-js@1.2.0: - resolution: {integrity: sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==} - engines: {node: '>=0.10.0'} - - sprintf-js@1.0.3: - resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==} - - stack-utils@2.0.6: - resolution: {integrity: sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==} - engines: {node: '>=10'} - - string-width@4.2.3: - resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} - engines: {node: '>=8'} - - string-width@7.1.0: - resolution: {integrity: sha512-SEIJCWiX7Kg4c129n48aDRwLbFb2LJmXXFrWBG4NGaRtMQ3myKPKbwrD1BKqQn74oCoNMBVrfDEr5M9YxCsrkw==} - engines: {node: '>=18'} - - string_decoder@1.3.0: - resolution: {integrity: sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==} - - strip-ansi@6.0.1: - resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} - engines: {node: '>=8'} - - strip-ansi@7.1.0: - resolution: {integrity: sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==} - engines: {node: '>=12'} - - styled-components@6.1.1: - resolution: {integrity: sha512-cpZZP5RrKRIClBW5Eby4JM1wElLVP4NQrJbJ0h10TidTyJf4SIIwa3zLXOoPb4gJi8MsJ8mjq5mu2IrEhZIAcQ==} - engines: {node: '>= 16'} - peerDependencies: - react: '>= 16.8.0' - react-dom: '>= 16.8.0' - - stylis@4.3.2: - resolution: {integrity: sha512-bhtUjWd/z6ltJiQwg0dUfxEJ+W+jdqQd8TbWLWyeIJHlnsqmGLRFFd8e5mA0AZi/zx90smXRlN66YMTcaSFifg==} - - supertap@3.0.1: - resolution: {integrity: sha512-u1ZpIBCawJnO+0QePsEiOknOfCRq0yERxiAchT0i4li0WHNUJbf0evXXSXOcCAR4M8iMDoajXYmstm/qO81Isw==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - supports-color@7.2.0: - resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} - engines: {node: '>=8'} - - tar@6.2.1: - resolution: {integrity: sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==} - engines: {node: '>=10'} - - temp-dir@3.0.0: - resolution: {integrity: sha512-nHc6S/bwIilKHNRgK/3jlhDoIHcp45YgyiwcAk46Tr0LfEqGBVpmiAyuiuxeVE44m3mXnEeVhaipLOEWmH+Njw==} - engines: {node: '>=14.16'} - - time-zone@1.0.0: - resolution: {integrity: sha512-TIsDdtKo6+XrPtiTm1ssmMngN1sAhyKnTO2kunQWqNPWIVvCm15Wmw4SWInwTVgJ5u/Tr04+8Ei9TNcw4x4ONA==} - engines: {node: '>=4'} - - tmp@0.0.33: - resolution: {integrity: sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==} - engines: {node: '>=0.6.0'} - - to-regex-range@5.0.1: - resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} - engines: {node: '>=8.0'} - - toml@3.0.0: - resolution: {integrity: sha512-y/mWCZinnvxjTKYhJ+pYxwD0mRLVvOtdS2Awbgxln6iEnt4rk0yBxeSBHkGJcPucRiG0e55mwWp+g/05rsrd6w==} - - tr46@0.0.3: - resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==} - - tslib@2.6.3: - resolution: {integrity: sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ==} - - typanion@3.14.0: - resolution: {integrity: sha512-ZW/lVMRabETuYCd9O9ZvMhAh8GslSqaUjxmK/JLPCh6l73CvLBiuXswj/+7LdnWOgYsQ130FqLzFz5aGT4I3Ug==} - - type-fest@0.13.1: - resolution: {integrity: sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==} - engines: {node: '>=10'} - - type-fest@0.21.3: - resolution: {integrity: sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==} - engines: {node: '>=10'} - - typescript@5.4.5: - resolution: {integrity: sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==} - engines: {node: '>=14.17'} - hasBin: true - - undici-types@5.26.5: - resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==} - - unicorn-magic@0.1.0: - resolution: {integrity: sha512-lRfVq8fE8gz6QMBuDM6a+LO3IAzTi05H6gCVaUpir2E1Rwpo4ZUog45KpNXKC/Mn3Yb9UDuHumeFTo9iV/D9FQ==} - engines: {node: '>=18'} - - universal-user-agent@6.0.1: - resolution: {integrity: sha512-yCzhz6FN2wU1NiiQRogkTQszlQSlpWaw8SvVegAc+bDxbzHgh1vX8uIe8OYyMH6DwH+sdTJsgMl36+mSMdRJIQ==} - - util-deprecate@1.0.2: - resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} - - wasm-sjlj@1.0.5: - resolution: {integrity: sha512-Z/MHJeOkAvJJVWnGX3/YZGYldGaawZbYHX4ldYG9kLhcdB8H31F5x66M7Zc4BP/7pg0aLsusQj1629m2B3Rilg==} - - wcwidth@1.0.1: - resolution: {integrity: sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==} - - webidl-conversions@3.0.1: - resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==} - - well-known-symbols@2.0.0: - resolution: {integrity: sha512-ZMjC3ho+KXo0BfJb7JgtQ5IBuvnShdlACNkKkdsqBmYw3bPAaJfPeYUo6tLUaT5tG/Gkh7xkpBhKRQ9e7pyg9Q==} - engines: {node: '>=6'} - - whatwg-url@5.0.0: - resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==} - - wide-align@1.1.5: - resolution: {integrity: sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==} - - wrap-ansi@6.2.0: - resolution: {integrity: sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==} - engines: {node: '>=8'} - - wrap-ansi@7.0.0: - resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==} - engines: {node: '>=10'} - - wrappy@1.0.2: - resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} - - write-file-atomic@5.0.1: - resolution: {integrity: sha512-+QU2zd6OTD8XWIJCbffaiQeH9U73qIqafo1x6V1snCWYGJf6cVE0cDR4D8xRzcEnfI21IFrUPzPGtcPf8AC+Rw==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - - y18n@5.0.8: - resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==} - engines: {node: '>=10'} - - yallist@4.0.0: - resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==} - - yargs-parser@21.1.1: - resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} - engines: {node: '>=12'} - - yargs@17.7.2: - resolution: {integrity: sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==} - engines: {node: '>=12'} - -snapshots: - - '@emnapi/core@1.2.0': - dependencies: - '@emnapi/wasi-threads': 1.0.1 - tslib: 2.6.3 - - '@emnapi/runtime@1.2.0': - dependencies: - tslib: 2.6.3 - - '@emnapi/wasi-threads@1.0.1': - dependencies: - tslib: 2.6.3 - - '@emotion/is-prop-valid@1.2.2': - dependencies: - '@emotion/memoize': 0.8.1 - - '@emotion/memoize@0.8.1': {} - - '@emotion/unitless@0.8.1': {} - - '@inquirer/figures@1.0.3': {} - - '@ljharb/through@2.3.13': - dependencies: - call-bind: 1.0.7 - - '@mapbox/node-pre-gyp@1.0.11': - dependencies: - detect-libc: 2.0.3 - https-proxy-agent: 5.0.1 - make-dir: 3.1.0 - node-fetch: 2.7.0 - nopt: 5.0.0 - npmlog: 5.0.1 - rimraf: 3.0.2 - semver: 7.6.2 - tar: 6.2.1 - transitivePeerDependencies: - - encoding - - supports-color - - '@napi-rs/cli@3.0.0-alpha.55(@emnapi/runtime@1.2.0)(emnapi@1.2.0)': - dependencies: - '@napi-rs/cross-toolchain': 0.0.16 - '@napi-rs/wasm-tools': 0.0.2 - '@octokit/rest': 20.1.1 - clipanion: 3.2.1(typanion@3.14.0) - colorette: 2.0.20 - debug: 4.3.5 - inquirer: 9.2.23 - js-yaml: 4.1.0 - lodash-es: 4.17.21 - semver: 7.6.2 - toml: 3.0.0 - typanion: 3.14.0 - wasm-sjlj: 1.0.5 - optionalDependencies: - '@emnapi/runtime': 1.2.0 - emnapi: 1.2.0 - transitivePeerDependencies: - - '@napi-rs/cross-toolchain-arm64-target-aarch64' - - '@napi-rs/cross-toolchain-arm64-target-armv7' - - '@napi-rs/cross-toolchain-arm64-target-x86_64' - - '@napi-rs/cross-toolchain-x64-target-aarch64' - - '@napi-rs/cross-toolchain-x64-target-armv7' - - '@napi-rs/cross-toolchain-x64-target-x86_64' - - supports-color - - '@napi-rs/cross-toolchain@0.0.16': - dependencies: - '@napi-rs/lzma': 1.3.1 - '@napi-rs/tar': 0.1.1 - debug: 4.3.5 - transitivePeerDependencies: - - supports-color - - '@napi-rs/lzma-android-arm-eabi@1.3.1': - optional: true - - '@napi-rs/lzma-android-arm64@1.3.1': - optional: true - - '@napi-rs/lzma-darwin-arm64@1.3.1': - optional: true - - '@napi-rs/lzma-darwin-x64@1.3.1': - optional: true - - '@napi-rs/lzma-freebsd-x64@1.3.1': - optional: true - - '@napi-rs/lzma-linux-arm-gnueabihf@1.3.1': - optional: true - - '@napi-rs/lzma-linux-arm64-gnu@1.3.1': - optional: true - - '@napi-rs/lzma-linux-arm64-musl@1.3.1': - optional: true - - '@napi-rs/lzma-linux-x64-gnu@1.3.1': - optional: true - - '@napi-rs/lzma-linux-x64-musl@1.3.1': - optional: true - - '@napi-rs/lzma-wasm32-wasi@1.3.1': - dependencies: - '@napi-rs/wasm-runtime': 0.2.4 - optional: true - - '@napi-rs/lzma-win32-arm64-msvc@1.3.1': - optional: true - - '@napi-rs/lzma-win32-ia32-msvc@1.3.1': - optional: true - - '@napi-rs/lzma-win32-x64-msvc@1.3.1': - optional: true - - '@napi-rs/lzma@1.3.1': - optionalDependencies: - '@napi-rs/lzma-android-arm-eabi': 1.3.1 - '@napi-rs/lzma-android-arm64': 1.3.1 - '@napi-rs/lzma-darwin-arm64': 1.3.1 - '@napi-rs/lzma-darwin-x64': 1.3.1 - '@napi-rs/lzma-freebsd-x64': 1.3.1 - '@napi-rs/lzma-linux-arm-gnueabihf': 1.3.1 - '@napi-rs/lzma-linux-arm64-gnu': 1.3.1 - '@napi-rs/lzma-linux-arm64-musl': 1.3.1 - '@napi-rs/lzma-linux-x64-gnu': 1.3.1 - '@napi-rs/lzma-linux-x64-musl': 1.3.1 - '@napi-rs/lzma-wasm32-wasi': 1.3.1 - '@napi-rs/lzma-win32-arm64-msvc': 1.3.1 - '@napi-rs/lzma-win32-ia32-msvc': 1.3.1 - '@napi-rs/lzma-win32-x64-msvc': 1.3.1 - - '@napi-rs/tar-android-arm-eabi@0.1.1': - optional: true - - '@napi-rs/tar-android-arm64@0.1.1': - optional: true - - '@napi-rs/tar-darwin-arm64@0.1.1': - optional: true - - '@napi-rs/tar-darwin-x64@0.1.1': - optional: true - - '@napi-rs/tar-freebsd-x64@0.1.1': - optional: true - - '@napi-rs/tar-linux-arm-gnueabihf@0.1.1': - optional: true - - '@napi-rs/tar-linux-arm64-gnu@0.1.1': - optional: true - - '@napi-rs/tar-linux-arm64-musl@0.1.1': - optional: true - - '@napi-rs/tar-linux-x64-gnu@0.1.1': - optional: true - - '@napi-rs/tar-linux-x64-musl@0.1.1': - optional: true - - '@napi-rs/tar-wasm32-wasi@0.1.1': - dependencies: - '@napi-rs/wasm-runtime': 0.2.4 - optional: true - - '@napi-rs/tar-win32-arm64-msvc@0.1.1': - optional: true - - '@napi-rs/tar-win32-ia32-msvc@0.1.1': - optional: true - - '@napi-rs/tar-win32-x64-msvc@0.1.1': - optional: true - - '@napi-rs/tar@0.1.1': - optionalDependencies: - '@napi-rs/tar-android-arm-eabi': 0.1.1 - '@napi-rs/tar-android-arm64': 0.1.1 - '@napi-rs/tar-darwin-arm64': 0.1.1 - '@napi-rs/tar-darwin-x64': 0.1.1 - '@napi-rs/tar-freebsd-x64': 0.1.1 - '@napi-rs/tar-linux-arm-gnueabihf': 0.1.1 - '@napi-rs/tar-linux-arm64-gnu': 0.1.1 - '@napi-rs/tar-linux-arm64-musl': 0.1.1 - '@napi-rs/tar-linux-x64-gnu': 0.1.1 - '@napi-rs/tar-linux-x64-musl': 0.1.1 - '@napi-rs/tar-wasm32-wasi': 0.1.1 - '@napi-rs/tar-win32-arm64-msvc': 0.1.1 - '@napi-rs/tar-win32-ia32-msvc': 0.1.1 - '@napi-rs/tar-win32-x64-msvc': 0.1.1 - - '@napi-rs/wasm-runtime@0.2.4': - dependencies: - '@emnapi/core': 1.2.0 - '@emnapi/runtime': 1.2.0 - '@tybys/wasm-util': 0.9.0 - - '@napi-rs/wasm-tools-android-arm-eabi@0.0.2': - optional: true - - '@napi-rs/wasm-tools-android-arm64@0.0.2': - optional: true - - '@napi-rs/wasm-tools-darwin-arm64@0.0.2': - optional: true - - '@napi-rs/wasm-tools-darwin-x64@0.0.2': - optional: true - - '@napi-rs/wasm-tools-freebsd-x64@0.0.2': - optional: true - - '@napi-rs/wasm-tools-linux-arm64-gnu@0.0.2': - optional: true - - '@napi-rs/wasm-tools-linux-arm64-musl@0.0.2': - optional: true - - '@napi-rs/wasm-tools-linux-x64-gnu@0.0.2': - optional: true - - '@napi-rs/wasm-tools-linux-x64-musl@0.0.2': - optional: true - - '@napi-rs/wasm-tools-wasm32-wasi@0.0.2': - dependencies: - '@napi-rs/wasm-runtime': 0.2.4 - optional: true - - '@napi-rs/wasm-tools-win32-arm64-msvc@0.0.2': - optional: true - - '@napi-rs/wasm-tools-win32-ia32-msvc@0.0.2': - optional: true - - '@napi-rs/wasm-tools-win32-x64-msvc@0.0.2': - optional: true - - '@napi-rs/wasm-tools@0.0.2': - optionalDependencies: - '@napi-rs/wasm-tools-android-arm-eabi': 0.0.2 - '@napi-rs/wasm-tools-android-arm64': 0.0.2 - '@napi-rs/wasm-tools-darwin-arm64': 0.0.2 - '@napi-rs/wasm-tools-darwin-x64': 0.0.2 - '@napi-rs/wasm-tools-freebsd-x64': 0.0.2 - '@napi-rs/wasm-tools-linux-arm64-gnu': 0.0.2 - '@napi-rs/wasm-tools-linux-arm64-musl': 0.0.2 - '@napi-rs/wasm-tools-linux-x64-gnu': 0.0.2 - '@napi-rs/wasm-tools-linux-x64-musl': 0.0.2 - '@napi-rs/wasm-tools-wasm32-wasi': 0.0.2 - '@napi-rs/wasm-tools-win32-arm64-msvc': 0.0.2 - '@napi-rs/wasm-tools-win32-ia32-msvc': 0.0.2 - '@napi-rs/wasm-tools-win32-x64-msvc': 0.0.2 - - '@nodelib/fs.scandir@2.1.5': - dependencies: - '@nodelib/fs.stat': 2.0.5 - run-parallel: 1.2.0 - - '@nodelib/fs.stat@2.0.5': {} - - '@nodelib/fs.walk@1.2.8': - dependencies: - '@nodelib/fs.scandir': 2.1.5 - fastq: 1.17.1 - - '@octokit/auth-token@4.0.0': {} - - '@octokit/core@5.2.0': - dependencies: - '@octokit/auth-token': 4.0.0 - '@octokit/graphql': 7.1.0 - '@octokit/request': 8.4.0 - '@octokit/request-error': 5.1.0 - '@octokit/types': 13.5.0 - before-after-hook: 2.2.3 - universal-user-agent: 6.0.1 - - '@octokit/endpoint@9.0.5': - dependencies: - '@octokit/types': 13.5.0 - universal-user-agent: 6.0.1 - - '@octokit/graphql@7.1.0': - dependencies: - '@octokit/request': 8.4.0 - '@octokit/types': 13.5.0 - universal-user-agent: 6.0.1 - - '@octokit/openapi-types@22.2.0': {} - - '@octokit/plugin-paginate-rest@11.3.1(@octokit/core@5.2.0)': - dependencies: - '@octokit/core': 5.2.0 - '@octokit/types': 13.5.0 - - '@octokit/plugin-request-log@4.0.1(@octokit/core@5.2.0)': - dependencies: - '@octokit/core': 5.2.0 - - '@octokit/plugin-rest-endpoint-methods@13.2.2(@octokit/core@5.2.0)': - dependencies: - '@octokit/core': 5.2.0 - '@octokit/types': 13.5.0 - - '@octokit/request-error@5.1.0': - dependencies: - '@octokit/types': 13.5.0 - deprecation: 2.3.1 - once: 1.4.0 - - '@octokit/request@8.4.0': - dependencies: - '@octokit/endpoint': 9.0.5 - '@octokit/request-error': 5.1.0 - '@octokit/types': 13.5.0 - universal-user-agent: 6.0.1 - - '@octokit/rest@20.1.1': - dependencies: - '@octokit/core': 5.2.0 - '@octokit/plugin-paginate-rest': 11.3.1(@octokit/core@5.2.0) - '@octokit/plugin-request-log': 4.0.1(@octokit/core@5.2.0) - '@octokit/plugin-rest-endpoint-methods': 13.2.2(@octokit/core@5.2.0) - - '@octokit/types@13.5.0': - dependencies: - '@octokit/openapi-types': 22.2.0 - - '@rollup/pluginutils@4.2.1': - dependencies: - estree-walker: 2.0.2 - picomatch: 2.3.1 - - '@sindresorhus/merge-streams@2.3.0': {} - - '@tybys/wasm-util@0.9.0': - dependencies: - tslib: 2.6.3 - - '@types/node@20.14.2': - dependencies: - undici-types: 5.26.5 - - '@types/stylis@4.2.6': {} - - '@vercel/nft@0.26.5': - dependencies: - '@mapbox/node-pre-gyp': 1.0.11 - '@rollup/pluginutils': 4.2.1 - acorn: 8.12.0 - acorn-import-attributes: 1.9.5(acorn@8.12.0) - async-sema: 3.1.1 - bindings: 1.5.0 - estree-walker: 2.0.2 - glob: 7.2.3 - graceful-fs: 4.2.11 - micromatch: 4.0.7 - node-gyp-build: 4.8.1 - resolve-from: 5.0.0 - transitivePeerDependencies: - - encoding - - supports-color - - abbrev@1.1.1: {} - - acorn-import-attributes@1.9.5(acorn@8.12.0): - dependencies: - acorn: 8.12.0 - - acorn-walk@8.3.3: - dependencies: - acorn: 8.12.0 - - acorn@8.12.0: {} - - agent-base@6.0.2: - dependencies: - debug: 4.3.5 - transitivePeerDependencies: - - supports-color - - ansi-escapes@4.3.2: - dependencies: - type-fest: 0.21.3 - - ansi-regex@5.0.1: {} - - ansi-regex@6.0.1: {} - - ansi-styles@4.3.0: - dependencies: - color-convert: 2.0.1 - - ansi-styles@6.2.1: {} - - aproba@2.0.0: {} - - are-we-there-yet@2.0.0: - dependencies: - delegates: 1.0.0 - readable-stream: 3.6.2 - - argparse@1.0.10: - dependencies: - sprintf-js: 1.0.3 - - argparse@2.0.1: {} - - array-find-index@1.0.2: {} - - arrgv@1.0.2: {} - - arrify@3.0.0: {} - - async-sema@3.1.1: {} - - asynckit@0.4.0: {} - - ava@6.1.3: - dependencies: - '@vercel/nft': 0.26.5 - acorn: 8.12.0 - acorn-walk: 8.3.3 - ansi-styles: 6.2.1 - arrgv: 1.0.2 - arrify: 3.0.0 - callsites: 4.1.0 - cbor: 9.0.2 - chalk: 5.3.0 - chunkd: 2.0.1 - ci-info: 4.0.0 - ci-parallel-vars: 1.0.1 - cli-truncate: 4.0.0 - code-excerpt: 4.0.0 - common-path-prefix: 3.0.0 - concordance: 5.0.4 - currently-unhandled: 0.4.1 - debug: 4.3.5 - emittery: 1.0.3 - figures: 6.1.0 - globby: 14.0.1 - ignore-by-default: 2.1.0 - indent-string: 5.0.0 - is-plain-object: 5.0.0 - is-promise: 4.0.0 - matcher: 5.0.0 - memoize: 10.0.0 - ms: 2.1.3 - p-map: 7.0.2 - package-config: 5.0.0 - picomatch: 3.0.1 - plur: 5.1.0 - pretty-ms: 9.0.0 - resolve-cwd: 3.0.0 - stack-utils: 2.0.6 - strip-ansi: 7.1.0 - supertap: 3.0.1 - temp-dir: 3.0.0 - write-file-atomic: 5.0.1 - yargs: 17.7.2 - transitivePeerDependencies: - - encoding - - supports-color - - axios@1.6.2: - dependencies: - follow-redirects: 1.15.6 - form-data: 4.0.0 - proxy-from-env: 1.1.0 - transitivePeerDependencies: - - debug - - balanced-match@1.0.2: {} - - base64-js@1.5.1: {} - - before-after-hook@2.2.3: {} - - bindings@1.5.0: - dependencies: - file-uri-to-path: 1.0.0 - - bl@4.1.0: - dependencies: - buffer: 5.7.1 - inherits: 2.0.4 - readable-stream: 3.6.2 - - blueimp-md5@2.19.0: {} - - brace-expansion@1.1.11: - dependencies: - balanced-match: 1.0.2 - concat-map: 0.0.1 - - braces@3.0.3: - dependencies: - fill-range: 7.1.1 - - buffer@5.7.1: - dependencies: - base64-js: 1.5.1 - ieee754: 1.2.1 - - call-bind@1.0.7: - dependencies: - es-define-property: 1.0.0 - es-errors: 1.3.0 - function-bind: 1.1.2 - get-intrinsic: 1.2.4 - set-function-length: 1.2.2 - - callsites@4.1.0: {} - - camelize@1.0.1: {} - - cbor@9.0.2: - dependencies: - nofilter: 3.1.0 - - chalk@4.1.2: - dependencies: - ansi-styles: 4.3.0 - supports-color: 7.2.0 - - chalk@5.3.0: {} - - chardet@0.7.0: {} - - chownr@2.0.0: {} - - chunkd@2.0.1: {} - - ci-info@4.0.0: {} - - ci-parallel-vars@1.0.1: {} - - cli-cursor@3.1.0: - dependencies: - restore-cursor: 3.1.0 - - cli-spinners@2.9.2: {} - - cli-truncate@4.0.0: - dependencies: - slice-ansi: 5.0.0 - string-width: 7.1.0 - - cli-width@4.1.0: {} - - clipanion@3.2.1(typanion@3.14.0): - dependencies: - typanion: 3.14.0 - - cliui@8.0.1: - dependencies: - string-width: 4.2.3 - strip-ansi: 6.0.1 - wrap-ansi: 7.0.0 - - clone@1.0.4: {} - - code-excerpt@4.0.0: - dependencies: - convert-to-spaces: 2.0.1 - - color-convert@2.0.1: - dependencies: - color-name: 1.1.4 - - color-name@1.1.4: {} - - color-support@1.1.3: {} - - colorette@2.0.20: {} - - combined-stream@1.0.8: - dependencies: - delayed-stream: 1.0.0 - - common-path-prefix@3.0.0: {} - - concat-map@0.0.1: {} - - concordance@5.0.4: - dependencies: - date-time: 3.1.0 - esutils: 2.0.3 - fast-diff: 1.3.0 - js-string-escape: 1.0.1 - lodash: 4.17.21 - md5-hex: 3.0.1 - semver: 7.6.2 - well-known-symbols: 2.0.0 - - console-control-strings@1.1.0: {} - - convert-to-spaces@2.0.1: {} - - css-color-keywords@1.0.0: {} - - css-to-react-native@3.2.0: - dependencies: - camelize: 1.0.1 - css-color-keywords: 1.0.0 - postcss-value-parser: 4.2.0 - - csstype@3.1.3: {} - - currently-unhandled@0.4.1: - dependencies: - array-find-index: 1.0.2 - - date-time@3.1.0: - dependencies: - time-zone: 1.0.0 - - debug@4.3.5: - dependencies: - ms: 2.1.2 - - defaults@1.0.4: - dependencies: - clone: 1.0.4 - - define-data-property@1.1.4: - dependencies: - es-define-property: 1.0.0 - es-errors: 1.3.0 - gopd: 1.0.1 - - delayed-stream@1.0.0: {} - - delegates@1.0.0: {} - - deprecation@2.3.1: {} - - detect-libc@2.0.3: {} - - emittery@1.0.3: {} - - emnapi@1.2.0: {} - - emoji-regex@10.3.0: {} - - emoji-regex@8.0.0: {} - - es-define-property@1.0.0: - dependencies: - get-intrinsic: 1.2.4 - - es-errors@1.3.0: {} - - escalade@3.1.2: {} - - escape-string-regexp@2.0.0: {} - - escape-string-regexp@5.0.0: {} - - esprima@4.0.1: {} - - estree-walker@2.0.2: {} - - esutils@2.0.3: {} - - external-editor@3.1.0: - dependencies: - chardet: 0.7.0 - iconv-lite: 0.4.24 - tmp: 0.0.33 - - fast-diff@1.3.0: {} - - fast-glob@3.3.2: - dependencies: - '@nodelib/fs.stat': 2.0.5 - '@nodelib/fs.walk': 1.2.8 - glob-parent: 5.1.2 - merge2: 1.4.1 - micromatch: 4.0.7 - - fastq@1.17.1: - dependencies: - reusify: 1.0.4 - - figures@6.1.0: - dependencies: - is-unicode-supported: 2.0.0 - - file-uri-to-path@1.0.0: {} - - fill-range@7.1.1: - dependencies: - to-regex-range: 5.0.1 - - find-up-simple@1.0.0: {} - - follow-redirects@1.15.6: {} - - form-data@4.0.0: - dependencies: - asynckit: 0.4.0 - combined-stream: 1.0.8 - mime-types: 2.1.35 - - fs-minipass@2.1.0: - dependencies: - minipass: 3.3.6 - - fs.realpath@1.0.0: {} - - function-bind@1.1.2: {} - - gauge@3.0.2: - dependencies: - aproba: 2.0.0 - color-support: 1.1.3 - console-control-strings: 1.1.0 - has-unicode: 2.0.1 - object-assign: 4.1.1 - signal-exit: 3.0.7 - string-width: 4.2.3 - strip-ansi: 6.0.1 - wide-align: 1.1.5 - - get-caller-file@2.0.5: {} - - get-east-asian-width@1.2.0: {} - - get-intrinsic@1.2.4: - dependencies: - es-errors: 1.3.0 - function-bind: 1.1.2 - has-proto: 1.0.3 - has-symbols: 1.0.3 - hasown: 2.0.2 - - glob-parent@5.1.2: - dependencies: - is-glob: 4.0.3 - - glob@7.2.3: - dependencies: - fs.realpath: 1.0.0 - inflight: 1.0.6 - inherits: 2.0.4 - minimatch: 3.1.2 - once: 1.4.0 - path-is-absolute: 1.0.1 - - globby@14.0.1: - dependencies: - '@sindresorhus/merge-streams': 2.3.0 - fast-glob: 3.3.2 - ignore: 5.3.1 - path-type: 5.0.0 - slash: 5.1.0 - unicorn-magic: 0.1.0 - - gopd@1.0.1: - dependencies: - get-intrinsic: 1.2.4 - - graceful-fs@4.2.11: {} - - has-flag@4.0.0: {} - - has-property-descriptors@1.0.2: - dependencies: - es-define-property: 1.0.0 - - has-proto@1.0.3: {} - - has-symbols@1.0.3: {} - - has-unicode@2.0.1: {} - - hasown@2.0.2: - dependencies: - function-bind: 1.1.2 - - https-proxy-agent@5.0.1: - dependencies: - agent-base: 6.0.2 - debug: 4.3.5 - transitivePeerDependencies: - - supports-color - - iconv-lite@0.4.24: - dependencies: - safer-buffer: 2.1.2 - - ieee754@1.2.1: {} - - ignore-by-default@2.1.0: {} - - ignore@5.3.1: {} - - imurmurhash@0.1.4: {} - - indent-string@5.0.0: {} - - inflight@1.0.6: - dependencies: - once: 1.4.0 - wrappy: 1.0.2 - - inherits@2.0.4: {} - - inquirer@9.2.23: - dependencies: - '@inquirer/figures': 1.0.3 - '@ljharb/through': 2.3.13 - ansi-escapes: 4.3.2 - chalk: 5.3.0 - cli-cursor: 3.1.0 - cli-width: 4.1.0 - external-editor: 3.1.0 - lodash: 4.17.21 - mute-stream: 1.0.0 - ora: 5.4.1 - run-async: 3.0.0 - rxjs: 7.8.1 - string-width: 4.2.3 - strip-ansi: 6.0.1 - wrap-ansi: 6.2.0 - - irregular-plurals@3.5.0: {} - - is-extglob@2.1.1: {} - - is-fullwidth-code-point@3.0.0: {} - - is-fullwidth-code-point@4.0.0: {} - - is-glob@4.0.3: - dependencies: - is-extglob: 2.1.1 - - is-interactive@1.0.0: {} - - is-number@7.0.0: {} - - is-plain-object@5.0.0: {} - - is-promise@4.0.0: {} - - is-unicode-supported@0.1.0: {} - - is-unicode-supported@2.0.0: {} - - js-string-escape@1.0.1: {} - - js-tokens@4.0.0: {} - - js-yaml@3.14.1: - dependencies: - argparse: 1.0.10 - esprima: 4.0.1 - - js-yaml@4.1.0: - dependencies: - argparse: 2.0.1 - - load-json-file@7.0.1: {} - - lodash-es@4.17.21: {} - - lodash@4.17.21: {} - - log-symbols@4.1.0: - dependencies: - chalk: 4.1.2 - is-unicode-supported: 0.1.0 - - loose-envify@1.4.0: - dependencies: - js-tokens: 4.0.0 - - make-dir@3.1.0: - dependencies: - semver: 6.3.1 - - matcher@5.0.0: - dependencies: - escape-string-regexp: 5.0.0 - - md5-hex@3.0.1: - dependencies: - blueimp-md5: 2.19.0 - - memoize@10.0.0: - dependencies: - mimic-function: 5.0.1 - - merge2@1.4.1: {} - - micromatch@4.0.7: - dependencies: - braces: 3.0.3 - picomatch: 2.3.1 - - mime-db@1.52.0: {} - - mime-types@2.1.35: - dependencies: - mime-db: 1.52.0 - - mimic-fn@2.1.0: {} - - mimic-function@5.0.1: {} - - minimatch@3.1.2: - dependencies: - brace-expansion: 1.1.11 - - minipass@3.3.6: - dependencies: - yallist: 4.0.0 - - minipass@5.0.0: {} - - minizlib@2.1.2: - dependencies: - minipass: 3.3.6 - yallist: 4.0.0 - - mkdirp@1.0.4: {} - - ms@2.1.2: {} - - ms@2.1.3: {} - - mute-stream@1.0.0: {} - - nanoid@3.3.7: {} - - node-fetch@2.7.0: - dependencies: - whatwg-url: 5.0.0 - - node-gyp-build@4.8.1: {} - - nofilter@3.1.0: {} - - nopt@5.0.0: - dependencies: - abbrev: 1.1.1 - - npmlog@5.0.1: - dependencies: - are-we-there-yet: 2.0.0 - console-control-strings: 1.1.0 - gauge: 3.0.2 - set-blocking: 2.0.0 - - object-assign@4.1.1: {} - - once@1.4.0: - dependencies: - wrappy: 1.0.2 - - onetime@5.1.2: - dependencies: - mimic-fn: 2.1.0 - - ora@5.4.1: - dependencies: - bl: 4.1.0 - chalk: 4.1.2 - cli-cursor: 3.1.0 - cli-spinners: 2.9.2 - is-interactive: 1.0.0 - is-unicode-supported: 0.1.0 - log-symbols: 4.1.0 - strip-ansi: 6.0.1 - wcwidth: 1.0.1 - - os-tmpdir@1.0.2: {} - - p-map@7.0.2: {} - - package-config@5.0.0: - dependencies: - find-up-simple: 1.0.0 - load-json-file: 7.0.1 - - parse-ms@4.0.0: {} - - path-is-absolute@1.0.1: {} - - path-type@5.0.0: {} - - picocolors@1.0.1: {} - - picomatch@2.3.1: {} - - picomatch@3.0.1: {} - - plur@5.1.0: - dependencies: - irregular-plurals: 3.5.0 - - postcss-value-parser@4.2.0: {} - - postcss@8.4.33: - dependencies: - nanoid: 3.3.7 - picocolors: 1.0.1 - source-map-js: 1.2.0 - - pretty-ms@9.0.0: - dependencies: - parse-ms: 4.0.0 - - proxy-from-env@1.1.0: {} - - queue-microtask@1.2.3: {} - - react-dom@18.3.1(react@18.3.1): - dependencies: - loose-envify: 1.4.0 - react: 18.3.1 - scheduler: 0.23.2 - - react@18.3.1: - dependencies: - loose-envify: 1.4.0 - - readable-stream@3.6.2: - dependencies: - inherits: 2.0.4 - string_decoder: 1.3.0 - util-deprecate: 1.0.2 - - require-directory@2.1.1: {} - - resolve-cwd@3.0.0: - dependencies: - resolve-from: 5.0.0 - - resolve-from@5.0.0: {} - - restore-cursor@3.1.0: - dependencies: - onetime: 5.1.2 - signal-exit: 3.0.7 - - reusify@1.0.4: {} - - rimraf@3.0.2: - dependencies: - glob: 7.2.3 - - run-async@3.0.0: {} - - run-parallel@1.2.0: - dependencies: - queue-microtask: 1.2.3 - - rxjs@7.8.1: - dependencies: - tslib: 2.6.3 - - safe-buffer@5.2.1: {} - - safer-buffer@2.1.2: {} - - scheduler@0.23.2: - dependencies: - loose-envify: 1.4.0 - - semver@6.3.1: {} - - semver@7.6.2: {} - - serialize-error@7.0.1: - dependencies: - type-fest: 0.13.1 - - set-blocking@2.0.0: {} - - set-function-length@1.2.2: - 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 - - shallowequal@1.1.0: {} - - signal-exit@3.0.7: {} - - signal-exit@4.1.0: {} - - slash@5.1.0: {} - - slice-ansi@5.0.0: - dependencies: - ansi-styles: 6.2.1 - is-fullwidth-code-point: 4.0.0 - - source-map-js@1.2.0: {} - - sprintf-js@1.0.3: {} - - stack-utils@2.0.6: - dependencies: - escape-string-regexp: 2.0.0 - - string-width@4.2.3: - dependencies: - emoji-regex: 8.0.0 - is-fullwidth-code-point: 3.0.0 - strip-ansi: 6.0.1 - - string-width@7.1.0: - dependencies: - emoji-regex: 10.3.0 - get-east-asian-width: 1.2.0 - strip-ansi: 7.1.0 - - string_decoder@1.3.0: - dependencies: - safe-buffer: 5.2.1 - - strip-ansi@6.0.1: - dependencies: - ansi-regex: 5.0.1 - - strip-ansi@7.1.0: - dependencies: - ansi-regex: 6.0.1 - - styled-components@6.1.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1): - dependencies: - '@emotion/is-prop-valid': 1.2.2 - '@emotion/unitless': 0.8.1 - '@types/stylis': 4.2.6 - css-to-react-native: 3.2.0 - csstype: 3.1.3 - postcss: 8.4.33 - react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) - shallowequal: 1.1.0 - stylis: 4.3.2 - tslib: 2.6.3 - - stylis@4.3.2: {} - - supertap@3.0.1: - dependencies: - indent-string: 5.0.0 - js-yaml: 3.14.1 - serialize-error: 7.0.1 - strip-ansi: 7.1.0 - - supports-color@7.2.0: - dependencies: - has-flag: 4.0.0 - - tar@6.2.1: - dependencies: - chownr: 2.0.0 - fs-minipass: 2.1.0 - minipass: 5.0.0 - minizlib: 2.1.2 - mkdirp: 1.0.4 - yallist: 4.0.0 - - temp-dir@3.0.0: {} - - time-zone@1.0.0: {} - - tmp@0.0.33: - dependencies: - os-tmpdir: 1.0.2 - - to-regex-range@5.0.1: - dependencies: - is-number: 7.0.0 - - toml@3.0.0: {} - - tr46@0.0.3: {} - - tslib@2.6.3: {} - - typanion@3.14.0: {} - - type-fest@0.13.1: {} - - type-fest@0.21.3: {} - - typescript@5.4.5: {} - - undici-types@5.26.5: {} - - unicorn-magic@0.1.0: {} - - universal-user-agent@6.0.1: {} - - util-deprecate@1.0.2: {} - - wasm-sjlj@1.0.5: {} - - wcwidth@1.0.1: - dependencies: - defaults: 1.0.4 - - webidl-conversions@3.0.1: {} - - well-known-symbols@2.0.0: {} - - whatwg-url@5.0.0: - dependencies: - tr46: 0.0.3 - webidl-conversions: 3.0.1 - - wide-align@1.1.5: - dependencies: - string-width: 4.2.3 - - wrap-ansi@6.2.0: - dependencies: - ansi-styles: 4.3.0 - string-width: 4.2.3 - strip-ansi: 6.0.1 - - wrap-ansi@7.0.0: - dependencies: - ansi-styles: 4.3.0 - string-width: 4.2.3 - strip-ansi: 6.0.1 - - wrappy@1.0.2: {} - - write-file-atomic@5.0.1: - dependencies: - imurmurhash: 0.1.4 - signal-exit: 4.1.0 - - y18n@5.0.8: {} - - yallist@4.0.0: {} - - yargs-parser@21.1.1: {} - - yargs@17.7.2: - dependencies: - cliui: 8.0.1 - escalade: 3.1.2 - get-caller-file: 2.0.5 - require-directory: 2.1.1 - string-width: 4.2.3 - y18n: 5.0.8 - yargs-parser: 21.1.1 diff --git a/src/builtins.rs b/src/builtins.rs deleted file mode 100644 index 45a25117..00000000 --- a/src/builtins.rs +++ /dev/null @@ -1,71 +0,0 @@ -/// Node.js built-in modules -/// -/// `node -p "[...require('module').builtinModules].map(b => JSON.stringify(b)).join(',\n')"` -/// -pub const NODEJS_BUILTINS: &[&str] = &[ - "_http_agent", - "_http_client", - "_http_common", - "_http_incoming", - "_http_outgoing", - "_http_server", - "_stream_duplex", - "_stream_passthrough", - "_stream_readable", - "_stream_transform", - "_stream_wrap", - "_stream_writable", - "_tls_common", - "_tls_wrap", - "assert", - "assert/strict", - "async_hooks", - "buffer", - "child_process", - "cluster", - "console", - "constants", - "crypto", - "dgram", - "diagnostics_channel", - "dns", - "dns/promises", - "domain", - "events", - "fs", - "fs/promises", - "http", - "http2", - "https", - "inspector", - "module", - "net", - "os", - "path", - "path/posix", - "path/win32", - "perf_hooks", - "process", - "punycode", - "querystring", - "readline", - "repl", - "stream", - "stream/consumers", - "stream/promises", - "stream/web", - "string_decoder", - "sys", - "timers", - "timers/promises", - "tls", - "trace_events", - "tty", - "url", - "util", - "util/types", - "v8", - "vm", - "worker_threads", - "zlib", -]; diff --git a/src/cache.rs b/src/cache.rs deleted file mode 100644 index a1bde36c..00000000 --- a/src/cache.rs +++ /dev/null @@ -1,369 +0,0 @@ -use once_cell::sync::OnceCell as OnceLock; -use std::{ - borrow::{Borrow, Cow}, - convert::AsRef, - hash::{BuildHasherDefault, Hash, Hasher}, - io, - ops::Deref, - path::{Path, PathBuf}, - sync::Arc, -}; - -use dashmap::{DashMap, DashSet}; -use rustc_hash::FxHasher; - -use crate::{ - context::ResolveContext as Ctx, package_json::PackageJson, path::PathUtil, FileMetadata, - FileSystem, ResolveError, ResolveOptions, TsConfig, -}; - -#[derive(Default)] -pub struct Cache { - pub(crate) fs: Fs, - paths: DashSet>, - tsconfigs: DashMap, BuildHasherDefault>, -} - -impl Cache { - pub fn new(fs: Fs) -> Self { - Self { fs, paths: DashSet::default(), tsconfigs: DashMap::default() } - } - - pub fn clear(&self) { - self.paths.clear(); - self.tsconfigs.clear(); - } - - pub fn value(&self, path: &Path) -> CachedPath { - let hash = { - let mut hasher = FxHasher::default(); - path.hash(&mut hasher); - hasher.finish() - }; - if let Some(cache_entry) = self.paths.get((hash, path).borrow() as &dyn CacheKey) { - return cache_entry.clone(); - } - let parent = path.parent().map(|p| self.value(p)); - let data = CachedPath(Arc::new(CachedPathImpl::new( - hash, - path.to_path_buf().into_boxed_path(), - parent, - ))); - self.paths.insert(data.clone()); - data - } - - pub fn tsconfig Result<(), ResolveError>>( - &self, - root: bool, - path: &Path, - callback: F, // callback for modifying tsconfig with `extends` - ) -> Result, ResolveError> { - if let Some(tsconfig_ref) = self.tsconfigs.get(path) { - return Ok(Arc::clone(tsconfig_ref.value())); - } - let meta = self.fs.metadata(path).ok(); - let tsconfig_path = if meta.is_some_and(|m| m.is_file) { - Cow::Borrowed(path) - } else if meta.is_some_and(|m| m.is_dir) { - Cow::Owned(path.join("tsconfig.json")) - } else { - let mut os_string = path.to_path_buf().into_os_string(); - os_string.push(".json"); - Cow::Owned(PathBuf::from(os_string)) - }; - let mut tsconfig_string = self - .fs - .read_to_string(&tsconfig_path) - .map_err(|_| ResolveError::TsconfigNotFound(path.to_path_buf()))?; - let mut tsconfig = - TsConfig::parse(root, &tsconfig_path, &mut tsconfig_string).map_err(|error| { - ResolveError::from_serde_json_error(tsconfig_path.to_path_buf(), &error) - })?; - callback(&mut tsconfig)?; - let tsconfig = Arc::new(tsconfig.build()); - self.tsconfigs.insert(path.to_path_buf(), Arc::clone(&tsconfig)); - Ok(tsconfig) - } -} - -#[derive(Clone)] -pub struct CachedPath(Arc); - -impl Hash for CachedPath { - fn hash(&self, state: &mut H) { - self.0.hash.hash(state); - } -} - -impl PartialEq for CachedPath { - fn eq(&self, other: &Self) -> bool { - self.0.path == other.0.path - } -} -impl Eq for CachedPath {} - -impl Deref for CachedPath { - type Target = CachedPathImpl; - - fn deref(&self) -> &Self::Target { - self.0.as_ref() - } -} - -impl<'a> Borrow for CachedPath { - fn borrow(&self) -> &(dyn CacheKey + 'a) { - self - } -} - -impl AsRef for CachedPath { - fn as_ref(&self) -> &CachedPathImpl { - self.0.as_ref() - } -} - -impl CacheKey for CachedPath { - fn tuple(&self) -> (u64, &Path) { - (self.hash, &self.path) - } -} - -pub struct CachedPathImpl { - hash: u64, - path: Box, - parent: Option, - meta: OnceLock>, - symlink: OnceLock>, - canonicalized: OnceLock>, - node_modules: OnceLock>, - package_json: OnceLock>>, -} - -impl CachedPathImpl { - fn new(hash: u64, path: Box, parent: Option) -> Self { - Self { - hash, - path, - parent, - meta: OnceLock::new(), - symlink: OnceLock::new(), - canonicalized: OnceLock::new(), - node_modules: OnceLock::new(), - package_json: OnceLock::new(), - } - } - - pub fn path(&self) -> &Path { - &self.path - } - - pub fn to_path_buf(&self) -> PathBuf { - self.path.to_path_buf() - } - - pub fn parent(&self) -> Option<&CachedPath> { - self.parent.as_ref() - } - - fn meta(&self, fs: &Fs) -> Option { - *self.meta.get_or_init(|| fs.metadata(&self.path).ok()) - } - - pub fn is_file(&self, fs: &Fs, ctx: &mut Ctx) -> bool { - if let Some(meta) = self.meta(fs) { - ctx.add_file_dependency(self.path()); - meta.is_file - } else { - ctx.add_missing_dependency(self.path()); - false - } - } - - pub fn is_dir(&self, fs: &Fs, ctx: &mut Ctx) -> bool { - self.meta(fs).map_or_else( - || { - ctx.add_missing_dependency(self.path()); - false - }, - |meta| meta.is_dir, - ) - } - - fn symlink(&self, fs: &Fs) -> io::Result> { - self.symlink - .get_or_try_init(|| { - if let Ok(symlink_metadata) = fs.symlink_metadata(&self.path) { - if symlink_metadata.is_symlink { - return fs.canonicalize(self.path()).map(Some); - } - } - Ok(None) - }) - .cloned() - } - - pub fn realpath(&self, fs: &Fs) -> io::Result { - self.canonicalized - .get_or_try_init(|| { - if let Some(link) = self.symlink(fs)? { - return Ok(Some(link)); - } - if let Some(parent) = self.parent() { - let parent_path = parent.realpath(fs)?; - return Ok(Some( - parent_path.normalize_with(self.path.strip_prefix(&parent.path).unwrap()), - )); - }; - Ok(None) - }) - .cloned() - .map(|r| r.unwrap_or_else(|| self.path.clone().to_path_buf())) - } - - pub fn module_directory( - &self, - module_name: &str, - cache: &Cache, - ctx: &mut Ctx, - ) -> Option { - let cached_path = cache.value(&self.path.join(module_name)); - cached_path.is_dir(&cache.fs, ctx).then_some(cached_path) - } - - pub fn cached_node_modules( - &self, - cache: &Cache, - ctx: &mut Ctx, - ) -> Option { - self.node_modules.get_or_init(|| self.module_directory("node_modules", cache, ctx)).clone() - } - - /// Find package.json of a path by traversing parent directories. - /// - /// # Errors - /// - /// * [ResolveError::JSON] - pub fn find_package_json( - &self, - fs: &Fs, - options: &ResolveOptions, - ctx: &mut Ctx, - ) -> Result>, ResolveError> { - let mut cache_value = self; - // Go up directories when the querying path is not a directory - while !cache_value.is_dir(fs, ctx) { - if let Some(cv) = &cache_value.parent { - cache_value = cv.as_ref(); - } else { - break; - } - } - let mut cache_value = Some(cache_value); - while let Some(cv) = cache_value { - if let Some(package_json) = cv.package_json(fs, options, ctx)? { - return Ok(Some(Arc::clone(&package_json))); - } - cache_value = cv.parent.as_deref(); - } - Ok(None) - } - - /// Get package.json of the given path. - /// - /// # Errors - /// - /// * [ResolveError::JSON] - pub fn package_json( - &self, - fs: &Fs, - options: &ResolveOptions, - ctx: &mut Ctx, - ) -> Result>, ResolveError> { - // Change to `std::sync::OnceLock::get_or_try_init` when it is stable. - let result = self - .package_json - .get_or_try_init(|| { - let package_json_path = self.path.join("package.json"); - let Ok(package_json_string) = fs.read_to_string(&package_json_path) else { - return Ok(None); - }; - let real_path = if options.symlinks { - self.realpath(fs)?.join("package.json") - } else { - package_json_path.clone() - }; - PackageJson::parse(package_json_path.clone(), real_path, &package_json_string) - .map(Arc::new) - .map(Some) - .map_err(|error| ResolveError::from_serde_json_error(package_json_path, &error)) - }) - .cloned(); - // https://github.com/webpack/enhanced-resolve/blob/58464fc7cb56673c9aa849e68e6300239601e615/lib/DescriptionFileUtils.js#L68-L82 - match &result { - Ok(Some(package_json)) => { - ctx.add_file_dependency(&package_json.path); - } - Ok(None) => { - // Avoid an allocation by making this lazy - if let Some(deps) = &mut ctx.missing_dependencies { - deps.push(self.path.join("package.json")); - } - } - Err(_) => { - if let Some(deps) = &mut ctx.file_dependencies { - deps.push(self.path.join("package.json")); - } - } - } - result - } -} - -/// Memoized cache key, code adapted from . -trait CacheKey { - fn tuple(&self) -> (u64, &Path); -} - -impl Hash for dyn CacheKey + '_ { - fn hash(&self, state: &mut H) { - self.tuple().0.hash(state); - } -} - -impl PartialEq for dyn CacheKey + '_ { - fn eq(&self, other: &Self) -> bool { - self.tuple().1 == other.tuple().1 - } -} - -impl Eq for dyn CacheKey + '_ {} - -impl<'a> CacheKey for (u64, &'a Path) { - fn tuple(&self) -> (u64, &Path) { - (self.0, self.1) - } -} - -impl<'a> Borrow for (u64, &'a Path) { - fn borrow(&self) -> &(dyn CacheKey + 'a) { - self - } -} - -/// Since the cache key is memoized, use an identity hasher -/// to avoid double cache. -#[derive(Default)] -struct IdentityHasher(u64); - -impl Hasher for IdentityHasher { - fn write(&mut self, _: &[u8]) { - unreachable!("Invalid use of IdentityHasher") - } - fn write_u64(&mut self, n: u64) { - self.0 = n; - } - fn finish(&self) -> u64 { - self.0 - } -} diff --git a/src/context.rs b/src/context.rs deleted file mode 100644 index 9349de30..00000000 --- a/src/context.rs +++ /dev/null @@ -1,89 +0,0 @@ -use std::{ - ops::{Deref, DerefMut}, - path::{Path, PathBuf}, -}; - -use crate::error::ResolveError; - -#[derive(Debug, Default, Clone)] -pub struct ResolveContext(ResolveContextImpl); - -#[derive(Debug, Default, Clone)] -pub struct ResolveContextImpl { - pub fully_specified: bool, - - pub query: Option, - - pub fragment: Option, - - /// Files that was found on file system - pub file_dependencies: Option>, - - /// Files that was found on file system - pub missing_dependencies: Option>, - - /// The current resolving alias for bailing recursion alias. - pub resolving_alias: Option, - - /// For avoiding infinite recursion, which will cause stack overflow. - depth: u8, -} - -impl Deref for ResolveContext { - type Target = ResolveContextImpl; - - fn deref(&self) -> &Self::Target { - &self.0 - } -} - -impl DerefMut for ResolveContext { - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} - -impl ResolveContext { - pub fn with_fully_specified(&mut self, yes: bool) { - self.fully_specified = yes; - } - - pub fn with_query_fragment(&mut self, query: Option<&str>, fragment: Option<&str>) { - if let Some(query) = query { - self.query.replace(query.to_string()); - } - if let Some(fragment) = fragment { - self.fragment.replace(fragment.to_string()); - } - } - - pub fn init_file_dependencies(&mut self) { - self.file_dependencies.replace(vec![]); - self.missing_dependencies.replace(vec![]); - } - - pub fn add_file_dependency(&mut self, dep: &Path) { - if let Some(deps) = &mut self.file_dependencies { - deps.push(dep.to_path_buf()); - } - } - - pub fn add_missing_dependency(&mut self, dep: &Path) { - if let Some(deps) = &mut self.missing_dependencies { - deps.push(dep.to_path_buf()); - } - } - - pub fn with_resolving_alias(&mut self, alias: String) { - self.resolving_alias = Some(alias); - } - - pub fn test_for_infinite_recursion(&mut self) -> Result<(), ResolveError> { - self.depth += 1; - // 64 should be more than enough for detecting infinite recursion. - if self.depth > 64 { - return Err(ResolveError::Recursion); - } - Ok(()) - } -} diff --git a/src/error.rs b/src/error.rs deleted file mode 100644 index ff2aaa4f..00000000 --- a/src/error.rs +++ /dev/null @@ -1,160 +0,0 @@ -use std::{io, path::PathBuf, sync::Arc}; -use thiserror::Error; - -/// All resolution errors -/// -/// `thiserror` is used to display meaningful error messages. -#[derive(Debug, Clone, PartialEq, Error)] -pub enum ResolveError { - /// Ignored path - /// - /// Derived from ignored path (false value) from browser field in package.json - /// ```json - /// { - /// "browser": { - /// "./module": false - /// } - /// } - /// ``` - /// See - #[error("Path is ignored {0}")] - Ignored(PathBuf), - - /// Module not found - #[error("Cannot find module '{0}'")] - NotFound(/* specifier */ String), - - /// Tsconfig not found - #[error("Tsconfig not found {0}")] - TsconfigNotFound(PathBuf), - - #[error("{0}")] - IOError(IOError), - - /// Node.js builtin modules - /// - /// This is an error due to not being a Node.js runtime. - /// The `alias` option can be used to resolve a builtin module to a polyfill. - #[error("Builtin module {0}")] - Builtin(String), - - /// All of the aliased extension are not found - #[error("All of the aliased extension are not found")] - ExtensionAlias, - - /// The provided path specifier cannot be parsed - #[error("{0}")] - Specifier(SpecifierError), - - /// JSON parse error - #[error("{0:?}")] - JSON(JSONError), - - /// Restricted by `ResolveOptions::restrictions` - #[error(r#"Path "{0}" restricted by {0}"#)] - Restriction(PathBuf, PathBuf), - - #[error(r#"Invalid module "{0}" specifier is not a valid subpath for the "exports" resolution of {1}"#)] - InvalidModuleSpecifier(String, PathBuf), - - #[error(r#"Invalid "exports" target "{0}" defined for '{1}' in the package config {2}"#)] - InvalidPackageTarget(String, String, PathBuf), - - #[error(r#"Package subpath '{0}' is not defined by "exports" in {1}"#)] - PackagePathNotExported(String, PathBuf), - - #[error(r#"Invalid package config "{0}", "exports" cannot contain some keys starting with '.' and some not. The exports object must either be an object of package subpath keys or an object of main entry condition name keys only."#)] - InvalidPackageConfig(PathBuf), - - #[error(r#"Default condition should be last one in "{0}""#)] - InvalidPackageConfigDefault(PathBuf), - - #[error(r#"Expecting folder to folder mapping. "{0}" should end with "/"#)] - InvalidPackageConfigDirectory(PathBuf), - - #[error(r#"Package import specifier "{0}" is not defined in package {1}"#)] - PackageImportNotDefined(String, PathBuf), - - #[error("{0} is unimplemented")] - Unimplemented(&'static str), - - /// Occurs when alias paths reference each other. - #[error("Recursion in resolving")] - Recursion, -} - -impl ResolveError { - pub fn is_ignore(&self) -> bool { - matches!(self, Self::Ignored(_)) - } - - pub(crate) fn from_serde_json_error(path: PathBuf, error: &serde_json::Error) -> Self { - Self::JSON(JSONError { - path, - message: error.to_string(), - line: error.line(), - column: error.column(), - }) - } -} - -/// Error for [ResolveError::Specifier] -#[derive(Debug, Clone, Eq, PartialEq, Error)] -pub enum SpecifierError { - #[error("The specifiers must be a non-empty string. Received \"{0}\"")] - Empty(String), -} - -/// JSON error from [serde_json::Error] -#[derive(Debug, Clone, Eq, PartialEq)] -pub struct JSONError { - pub path: PathBuf, - pub message: String, - pub line: usize, - pub column: usize, -} - -#[derive(Debug, Clone, Error)] -#[error("{0}")] -pub struct IOError(Arc); - -impl PartialEq for IOError { - fn eq(&self, other: &Self) -> bool { - self.0.kind() == other.0.kind() - } -} - -impl From for io::Error { - fn from(error: IOError) -> Self { - let io_error = error.0.as_ref(); - Self::new(io_error.kind(), io_error.to_string()) - } -} - -impl From for ResolveError { - fn from(err: io::Error) -> Self { - Self::IOError(IOError(Arc::new(err))) - } -} - -#[test] -fn test_into_io_error() { - use std::io::{self, ErrorKind}; - let error_string = "IOError occurred"; - let string_error = io::Error::new(ErrorKind::Interrupted, error_string.to_string()); - let string_error2 = io::Error::new(ErrorKind::Interrupted, error_string.to_string()); - let resolve_io_error: ResolveError = ResolveError::from(string_error2); - - assert_eq!(resolve_io_error, ResolveError::from(string_error)); - assert_eq!(resolve_io_error.clone(), resolve_io_error); - if let ResolveError::IOError(io_error) = resolve_io_error { - // fix for https://github.com/web-infra-dev/rspack/issues/4564 - let std_io_error: io::Error = io_error.into(); - assert_eq!(std_io_error.kind(), ErrorKind::Interrupted); - assert_eq!(std_io_error.to_string(), error_string); - assert_eq!( - format!("{std_io_error:?}"), - r#"Custom { kind: Interrupted, error: "IOError occurred" }"# - ); - } -} diff --git a/src/file_system.rs b/src/file_system.rs deleted file mode 100644 index 04d177de..00000000 --- a/src/file_system.rs +++ /dev/null @@ -1,133 +0,0 @@ -use std::{ - fs, io, - path::{Path, PathBuf}, -}; - -/// File System abstraction used for `ResolverGeneric` -pub trait FileSystem: Send + Sync { - /// See [std::fs::read_to_string] - /// - /// # Errors - /// - /// * See [std::fs::read_to_string] - /// ## Warning - /// Use `&Path` instead of a generic `P: AsRef` here, - /// because object safety requirements, it is especially useful, when - /// you want to store multiple `dyn FileSystem` in a `Vec` or use a `ResolverGeneric` in - /// napi env. - fn read_to_string(&self, path: &Path) -> io::Result; - - /// See [std::fs::metadata] - /// - /// # Errors - /// See [std::fs::metadata] - /// ## Warning - /// Use `&Path` instead of a generic `P: AsRef` here, - /// because object safety requirements, it is especially useful, when - /// you want to store multiple `dyn FileSystem` in a `Vec` or use a `ResolverGeneric` in - /// napi env. - fn metadata(&self, path: &Path) -> io::Result; - - /// See [std::fs::symlink_metadata] - /// - /// # Errors - /// - /// See [std::fs::symlink_metadata] - /// ## Warning - /// Use `&Path` instead of a generic `P: AsRef` here, - /// because object safety requirements, it is especially useful, when - /// you want to store multiple `dyn FileSystem` in a `Vec` or use a `ResolverGeneric` in - /// napi env. - fn symlink_metadata(&self, path: &Path) -> io::Result; - - /// See [std::fs::canonicalize] - /// - /// # Errors - /// - /// See [std::fs::read_link] - /// ## Warning - /// Use `&Path` instead of a generic `P: AsRef` here, - /// because object safety requirements, it is especially useful, when - /// you want to store multiple `dyn FileSystem` in a `Vec` or use a `ResolverGeneric` in - /// napi env. - fn canonicalize(&self, path: &Path) -> io::Result; -} - -/// Metadata information about a file -#[derive(Debug, Clone, Copy)] -pub struct FileMetadata { - pub(crate) is_file: bool, - pub(crate) is_dir: bool, - pub(crate) is_symlink: bool, -} - -impl FileMetadata { - pub fn new(is_file: bool, is_dir: bool, is_symlink: bool) -> Self { - Self { is_file, is_dir, is_symlink } - } -} - -impl From for FileMetadata { - fn from(metadata: fs::Metadata) -> Self { - Self::new(metadata.is_file(), metadata.is_dir(), metadata.is_symlink()) - } -} - -/// Operating System -#[derive(Default)] -pub struct FileSystemOs; - -impl FileSystem for FileSystemOs { - fn read_to_string(&self, path: &Path) -> io::Result { - fs::read_to_string(path) - } - - fn metadata(&self, path: &Path) -> io::Result { - fs::metadata(path).map(FileMetadata::from) - } - - fn symlink_metadata(&self, path: &Path) -> io::Result { - fs::symlink_metadata(path).map(FileMetadata::from) - } - - fn canonicalize(&self, path: &Path) -> io::Result { - #[cfg(not(target_os = "wasi"))] - { - dunce::canonicalize(path) - } - #[cfg(target_os = "wasi")] - { - let meta = fs::symlink_metadata(path)?; - if meta.file_type().is_symlink() { - let link = fs::read_link(path)?; - let mut path_buf = path.to_path_buf(); - path_buf.pop(); - for segment in link.iter() { - match segment.to_str() { - Some("..") => { - path_buf.pop(); - } - Some(".") | None => {} - Some(seg) => { - // Need to trim the extra \0 introduces by rust std rust-lang/rust#123727 - path_buf.push(seg.trim_end_matches('\0')); - } - } - } - Ok(path_buf) - } else { - Ok(path.to_path_buf()) - } - } - } -} - -#[test] -fn metadata() { - let meta = FileMetadata { is_file: true, is_dir: true, is_symlink: true }; - assert_eq!( - format!("{meta:?}"), - "FileMetadata { is_file: true, is_dir: true, is_symlink: true }" - ); - let _ = meta; -} diff --git a/src/lib.rs b/src/lib.rs deleted file mode 100644 index 8ec2ad8a..00000000 --- a/src/lib.rs +++ /dev/null @@ -1,1670 +0,0 @@ -//! # Oxc Resolver -//! -//! Node.js [CommonJS][cjs] and [ECMAScript][esm] Module Resolution. -//! -//! A module resolution is the process of finding the file referenced by a module specifier in -//! `import "specifier"` or `require("specifier")`. -//! -//! All [configuration options](ResolveOptions) are aligned with webpack's [enhanced-resolve]. -//! -//! ## Terminology -//! -//! ### Specifier -//! -//! For [CommonJS modules][cjs], -//! the specifier is the string passed to the `require` function. e.g. `"id"` in `require("id")`. -//! -//! For [ECMAScript modules][esm], -//! the specifier of an `import` statement is the string after the `from` keyword, -//! e.g. `'specifier'` in `import 'specifier'` or `import { sep } from 'specifier'`. -//! Specifiers are also used in export from statements, and as the argument to an `import()` expression. -//! -//! This is also named "request" in some places. -//! -//! ## References: -//! -//! * Algorithm adapted from Node.js [CommonJS Module Resolution Algorithm] and [ECMAScript Module Resolution Algorithm]. -//! * Tests are ported from [enhanced-resolve]. -//! * Some code is adapted from [parcel-resolver]. -//! * The documentation is copied from [webpack's resolve configuration](https://webpack.js.org/configuration/resolve). -//! -//! [enhanced-resolve]: https://github.com/webpack/enhanced-resolve -//! [CommonJS Module Resolution Algorithm]: https://nodejs.org/api/modules.html#all-together -//! [ECMAScript Module Resolution Algorithm]: https://nodejs.org/api/esm.html#resolution-algorithm-specification -//! [parcel-resolver]: https://github.com/parcel-bundler/parcel/blob/v2/packages/utils/node-resolver-rs -//! [cjs]: https://nodejs.org/api/modules.html -//! [esm]: https://nodejs.org/api/esm.html -//! -//! ## Feature flags -#![cfg_attr(feature = "document-features", doc = document_features::document_features!())] -#![cfg_attr(docsrs, feature(doc_auto_cfg))] -//! -//! ## Example -//! -//! ```rust,ignore -#![doc = include_str!("../examples/resolver.rs")] -//! ``` - -mod builtins; -mod cache; -mod context; -mod error; -mod file_system; -mod options; -mod package_json; -mod path; -mod resolution; -mod specifier; -mod tsconfig; - -#[cfg(test)] -mod tests; - -use std::{ - borrow::Cow, - cmp::Ordering, - ffi::OsStr, - fmt, - path::{Component, Path, PathBuf}, - sync::Arc, -}; - -use rustc_hash::FxHashSet; -use serde_json::Value as JSONValue; -use typescript_tsconfig_json::ExtendsField; - -pub use crate::{ - builtins::NODEJS_BUILTINS, - error::{JSONError, ResolveError, SpecifierError}, - file_system::{FileMetadata, FileSystem}, - options::{ - Alias, AliasValue, EnforceExtension, ResolveOptions, Restriction, TsconfigOptions, - TsconfigReferences, - }, - package_json::PackageJson, - resolution::Resolution, -}; -use crate::{ - cache::{Cache, CachedPath}, - context::ResolveContext as Ctx, - file_system::FileSystemOs, - package_json::JSONMap, - path::{PathUtil, SLASH_START}, - specifier::Specifier, - tsconfig::{ProjectReference, TsConfig}, -}; - -type ResolveResult = Result, ResolveError>; - -/// Context returned from the [Resolver::resolve_with_context] API -#[derive(Debug, Default, Clone)] -pub struct ResolveContext { - /// Files that was found on file system - pub file_dependencies: FxHashSet, - - /// Dependencies that was not found on file system - pub missing_dependencies: FxHashSet, -} - -/// Resolver with the current operating system as the file system -pub type Resolver = ResolverGeneric; - -/// Generic implementation of the resolver, can be configured by the [FileSystem] trait -pub struct ResolverGeneric { - options: ResolveOptions, - cache: Arc>, -} - -impl fmt::Debug for ResolverGeneric { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - self.options.fmt(f) - } -} - -impl Default for ResolverGeneric { - fn default() -> Self { - Self::new(ResolveOptions::default()) - } -} - -impl ResolverGeneric { - pub fn new(options: ResolveOptions) -> Self { - Self { options: options.sanitize(), cache: Arc::new(Cache::new(Fs::default())) } - } -} - -impl ResolverGeneric { - pub fn new_with_file_system(file_system: Fs, options: ResolveOptions) -> Self { - Self { cache: Arc::new(Cache::new(file_system)), options: options.sanitize() } - } - - /// Clone the resolver using the same underlying cache. - #[must_use] - pub fn clone_with_options(&self, options: ResolveOptions) -> Self { - Self { options: options.sanitize(), cache: Arc::clone(&self.cache) } - } - - /// Returns the options. - pub fn options(&self) -> &ResolveOptions { - &self.options - } - - /// Clear the underlying cache. - pub fn clear_cache(&self) { - self.cache.clear(); - } - - /// Resolve `specifier` at an absolute `path`. - /// - /// A specifier is the string passed to require or import, i.e. `require("specifier")` or `import "specifier"`. - /// - /// `path` must be an **absolute** path to a directory where the specifier is resolved against. - /// For CommonJS modules, it is the `__dirname` variable that contains the absolute path to the folder containing current module. - /// For ECMAScript modules, it is the value of `import.meta.url`. - /// - /// # Errors - /// - /// * See [ResolveError] - pub fn resolve>( - &self, - path: P, - specifier: &str, - ) -> Result { - let mut ctx = Ctx::default(); - self.resolve_tracing(path.as_ref(), specifier, &mut ctx) - } - - /// Resolve `specifier` at absolute `path` with [ResolveContext] - /// - /// # Errors - /// - /// * See [ResolveError] - pub fn resolve_with_context>( - &self, - path: P, - specifier: &str, - resolve_context: &mut ResolveContext, - ) -> Result { - let mut ctx = Ctx::default(); - ctx.init_file_dependencies(); - let result = self.resolve_tracing(path.as_ref(), specifier, &mut ctx); - if let Some(deps) = &mut ctx.file_dependencies { - resolve_context.file_dependencies.extend(deps.drain(..)); - } - if let Some(deps) = &mut ctx.missing_dependencies { - resolve_context.missing_dependencies.extend(deps.drain(..)); - } - result - } - - /// Wrap `resolve_impl` with `tracing` information - fn resolve_tracing( - &self, - path: &Path, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - let span = tracing::debug_span!("resolve", path = ?path, specifier = specifier); - let _enter = span.enter(); - let r = self.resolve_impl(path, specifier, ctx); - match &r { - Ok(r) => { - tracing::debug!(options = ?self.options, path = ?path, specifier = specifier, ret = ?r.path); - } - Err(err) => { - tracing::debug!(options = ?self.options, path = ?path, specifier = specifier, err = ?err); - } - }; - r - } - - fn resolve_impl( - &self, - path: &Path, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - ctx.with_fully_specified(self.options.fully_specified); - let cached_path = self.cache.value(path); - let cached_path = self.require(&cached_path, specifier, ctx)?; - let path = self.load_realpath(&cached_path)?; - // enhanced-resolve: restrictions - self.check_restrictions(&path)?; - let package_json = cached_path.find_package_json(&self.cache.fs, &self.options, ctx)?; - if let Some(package_json) = &package_json { - // path must be inside the package. - debug_assert!(path.starts_with(package_json.directory())); - } - Ok(Resolution { - path, - query: ctx.query.take(), - fragment: ctx.fragment.take(), - package_json, - }) - } - - /// require(X) from module at path Y - /// - /// X: specifier - /// Y: path - /// - /// - fn require( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - ctx.test_for_infinite_recursion()?; - - // enhanced-resolve: parse - let (parsed, try_fragment_as_path) = self.load_parse(cached_path, specifier, ctx)?; - if let Some(path) = try_fragment_as_path { - return Ok(path); - } - - self.require_without_parse(cached_path, parsed.path(), ctx) - } - - fn require_without_parse( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - // tsconfig-paths - if let Some(path) = self.load_tsconfig_paths(cached_path, specifier, &mut Ctx::default())? { - return Ok(path); - } - - // enhanced-resolve: try alias - if let Some(path) = self.load_alias(cached_path, specifier, &self.options.alias, ctx)? { - return Ok(path); - } - - let result = match Path::new(specifier).components().next() { - // 2. If X begins with '/' - Some(Component::RootDir | Component::Prefix(_)) => { - self.require_absolute(cached_path, specifier, ctx) - } - // 3. If X begins with './' or '/' or '../' - Some(Component::CurDir | Component::ParentDir) => { - self.require_relative(cached_path, specifier, ctx) - } - // 4. If X begins with '#' - Some(Component::Normal(_)) if specifier.as_bytes()[0] == b'#' => { - self.require_hash(cached_path, specifier, ctx) - } - _ => { - // 1. If X is a core module, - // a. return the core module - // b. STOP - self.require_core(specifier)?; - - // (ESM) 5. Otherwise, - // Note: specifier is now a bare specifier. - // Set resolved the result of PACKAGE_RESOLVE(specifier, parentURL). - self.require_bare(cached_path, specifier, ctx) - } - }; - - result.or_else(|err| { - if err.is_ignore() { - return Err(err); - } - // enhanced-resolve: try fallback - self.load_alias(cached_path, specifier, &self.options.fallback, ctx) - .and_then(|value| value.ok_or(err)) - }) - } - - // PACKAGE_RESOLVE(packageSpecifier, parentURL) - // 3. If packageSpecifier is a Node.js builtin module name, then - // 1. Return the string "node:" concatenated with packageSpecifier. - fn require_core(&self, specifier: &str) -> Result<(), ResolveError> { - if self.options.builtin_modules { - let starts_with_node = specifier.starts_with("node:"); - if starts_with_node || NODEJS_BUILTINS.binary_search(&specifier).is_ok() { - let mut specifier = specifier.to_string(); - if !starts_with_node { - specifier = format!("node:{specifier}"); - } - return Err(ResolveError::Builtin(specifier)); - } - } - Ok(()) - } - - fn require_absolute( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - // Make sure only path prefixes gets called - debug_assert!(Path::new(specifier) - .components() - .next() - .is_some_and(|c| matches!(c, Component::RootDir | Component::Prefix(_)))); - if !self.options.prefer_relative && self.options.prefer_absolute { - if let Ok(path) = self.load_package_self_or_node_modules(cached_path, specifier, ctx) { - return Ok(path); - } - } - if let Some(path) = self.load_roots(specifier, ctx) { - return Ok(path); - } - // 2. If X begins with '/' - // a. set Y to be the file system root - let path = self.cache.value(Path::new(specifier)); - if let Some(path) = self.load_as_file_or_directory(&path, specifier, ctx)? { - return Ok(path); - } - Err(ResolveError::NotFound(specifier.to_string())) - } - - // 3. If X begins with './' or '/' or '../' - fn require_relative( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - // Make sure only relative or normal paths gets called - debug_assert!(Path::new(specifier).components().next().is_some_and(|c| matches!( - c, - Component::CurDir | Component::ParentDir | Component::Normal(_) - ))); - let path = cached_path.path().normalize_with(specifier); - let cached_path = self.cache.value(&path); - // a. LOAD_AS_FILE(Y + X) - // b. LOAD_AS_DIRECTORY(Y + X) - if let Some(path) = self.load_as_file_or_directory(&cached_path, specifier, ctx)? { - return Ok(path); - } - // c. THROW "not found" - Err(ResolveError::NotFound(specifier.to_string())) - } - - fn require_hash( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - debug_assert_eq!(specifier.chars().next(), Some('#')); - // a. LOAD_PACKAGE_IMPORTS(X, dirname(Y)) - if let Some(path) = self.load_package_imports(cached_path, specifier, ctx)? { - return Ok(path); - } - self.load_package_self_or_node_modules(cached_path, specifier, ctx) - } - - fn require_bare( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - // Make sure no other path prefixes gets called - debug_assert!(Path::new(specifier) - .components() - .next() - .is_some_and(|c| matches!(c, Component::Normal(_)))); - if self.options.prefer_relative { - if let Ok(path) = self.require_relative(cached_path, specifier, ctx) { - return Ok(path); - } - } - self.load_package_self_or_node_modules(cached_path, specifier, ctx) - } - - /// enhanced-resolve: ParsePlugin. - /// - /// 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`. - /// - /// - fn load_parse<'s>( - &self, - cached_path: &CachedPath, - specifier: &'s str, - ctx: &mut Ctx, - ) -> Result<(Specifier<'s>, Option), ResolveError> { - let parsed = Specifier::parse(specifier).map_err(ResolveError::Specifier)?; - ctx.with_query_fragment(parsed.query, parsed.fragment); - - // There is an edge-case where a request with # can be a path or a fragment -> try both - if ctx.fragment.is_some() && ctx.query.is_none() { - let specifier = parsed.path(); - let fragment = ctx.fragment.take().unwrap(); - let path = format!("{specifier}{fragment}"); - if let Ok(path) = self.require_without_parse(cached_path, &path, ctx) { - return Ok((parsed, Some(path))); - } - ctx.fragment.replace(fragment); - } - Ok((parsed, None)) - } - - fn load_package_self_or_node_modules( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - let (_, subpath) = Self::parse_package_specifier(specifier); - if subpath.is_empty() { - ctx.with_fully_specified(false); - } - // 5. LOAD_PACKAGE_SELF(X, dirname(Y)) - if let Some(path) = self.load_package_self(cached_path, specifier, ctx)? { - return Ok(path); - } - // 6. LOAD_NODE_MODULES(X, dirname(Y)) - if let Some(path) = self.load_node_modules(cached_path, specifier, ctx)? { - return Ok(path); - } - // 7. THROW "not found" - Err(ResolveError::NotFound(specifier.to_string())) - } - - /// LOAD_PACKAGE_IMPORTS(X, DIR) - fn load_package_imports( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - // 1. Find the closest package scope SCOPE to DIR. - // 2. If no scope was found, return. - let Some(package_json) = - cached_path.find_package_json(&self.cache.fs, &self.options, ctx)? - else { - return Ok(None); - }; - // 3. If the SCOPE/package.json "imports" is null or undefined, return. - // 4. let MATCH = PACKAGE_IMPORTS_RESOLVE(X, pathToFileURL(SCOPE), ["node", "require"]) defined in the ESM resolver. - if let Some(path) = self.package_imports_resolve(specifier, &package_json, ctx)? { - // 5. RESOLVE_ESM_MATCH(MATCH). - return self.resolve_esm_match(specifier, &path, ctx); - } - Ok(None) - } - - fn load_as_file(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - // enhanced-resolve feature: extension_alias - if let Some(path) = self.load_extension_alias(cached_path, ctx)? { - return Ok(Some(path)); - } - if self.options.enforce_extension.is_disabled() { - // 1. If X is a file, load X as its file extension format. STOP - if let Some(path) = self.load_alias_or_file(cached_path, ctx)? { - return Ok(Some(path)); - } - } - // 2. If X.js is a file, load X.js as JavaScript text. STOP - // 3. If X.json is a file, parse X.json to a JavaScript Object. STOP - // 4. If X.node is a file, load X.node as binary addon. STOP - if let Some(path) = - self.load_extensions(cached_path.path(), &self.options.extensions, ctx)? - { - return Ok(Some(path)); - } - Ok(None) - } - - fn load_as_directory(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - // TODO: Only package.json is supported, so warn about having other values - // Checking for empty files is needed for omitting checks on package.json - // 1. If X/package.json is a file, - if !self.options.description_files.is_empty() { - // a. Parse X/package.json, and look for "main" field. - if let Some(package_json) = - cached_path.package_json(&self.cache.fs, &self.options, ctx)? - { - // b. If "main" is a falsy value, GOTO 2. - for main_field in package_json.main_fields(&self.options.main_fields) { - // c. let M = X + (json main field) - let main_field_path = cached_path.path().normalize_with(main_field); - // d. LOAD_AS_FILE(M) - let cached_path = self.cache.value(&main_field_path); - if let Some(path) = self.load_as_file(&cached_path, ctx)? { - return Ok(Some(path)); - } - // e. LOAD_INDEX(M) - if let Some(path) = self.load_index(&cached_path, ctx)? { - return Ok(Some(path)); - } - } - // f. LOAD_INDEX(X) DEPRECATED - // g. THROW "not found" - } - } - // 2. LOAD_INDEX(X) - self.load_index(cached_path, ctx) - } - - fn load_as_file_or_directory( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - if self.options.resolve_to_context { - return Ok(cached_path.is_dir(&self.cache.fs, ctx).then(|| cached_path.clone())); - } - if !specifier.ends_with('/') { - if let Some(path) = self.load_as_file(cached_path, ctx)? { - return Ok(Some(path)); - } - } - if cached_path.is_dir(&self.cache.fs, ctx) { - if let Some(path) = self.load_as_directory(cached_path, ctx)? { - return Ok(Some(path)); - } - } - Ok(None) - } - - fn load_extensions(&self, path: &Path, extensions: &[String], ctx: &mut Ctx) -> ResolveResult { - if ctx.fully_specified { - return Ok(None); - } - let path = path.as_os_str(); - for extension in extensions { - let mut path_with_extension = path.to_os_string(); - path_with_extension.reserve_exact(extension.len()); - path_with_extension.push(extension); - let cached_path = self.cache.value(Path::new(&path_with_extension)); - if let Some(path) = self.load_alias_or_file(&cached_path, ctx)? { - return Ok(Some(path)); - } - } - Ok(None) - } - - fn load_realpath(&self, cached_path: &CachedPath) -> Result { - if self.options.symlinks { - cached_path.realpath(&self.cache.fs).map_err(ResolveError::from) - } else { - Ok(cached_path.to_path_buf()) - } - } - - fn check_restrictions(&self, path: &Path) -> Result<(), ResolveError> { - // https://github.com/webpack/enhanced-resolve/blob/a998c7d218b7a9ec2461fc4fddd1ad5dd7687485/lib/RestrictionsPlugin.js#L19-L24 - fn is_inside(path: &Path, parent: &Path) -> bool { - if !path.starts_with(parent) { - return false; - } - if path.as_os_str().len() == parent.as_os_str().len() { - return true; - } - path.strip_prefix(parent).is_ok_and(|p| p == Path::new("./")) - } - for restriction in &self.options.restrictions { - match restriction { - Restriction::Path(restricted_path) => { - if !is_inside(path, restricted_path) { - return Err(ResolveError::Restriction( - path.to_path_buf(), - restricted_path.clone(), - )); - } - } - Restriction::RegExp(_) => { - return Err(ResolveError::Unimplemented("Restriction with regex")) - } - } - } - Ok(()) - } - - fn load_index(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - for main_file in &self.options.main_files { - let main_path = cached_path.path().normalize_with(main_file); - let cached_path = self.cache.value(&main_path); - if self.options.enforce_extension.is_disabled() { - if let Some(path) = self.load_alias_or_file(&cached_path, ctx)? { - return Ok(Some(path)); - } - } - // 1. If X/index.js is a file, load X/index.js as JavaScript text. STOP - // 2. If X/index.json is a file, parse X/index.json to a JavaScript object. STOP - // 3. If X/index.node is a file, load X/index.node as binary addon. STOP - if let Some(path) = - self.load_extensions(cached_path.path(), &self.options.extensions, ctx)? - { - return Ok(Some(path)); - } - } - Ok(None) - } - - fn load_alias_or_file(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - if let Some(package_json) = - cached_path.find_package_json(&self.cache.fs, &self.options, ctx)? - { - if let Some(path) = self.load_browser_field(cached_path, None, &package_json, ctx)? { - return Ok(Some(path)); - } - } - // enhanced-resolve: try file as alias - let alias_specifier = cached_path.path().to_string_lossy(); - if let Some(path) = - self.load_alias(cached_path, &alias_specifier, &self.options.alias, ctx)? - { - return Ok(Some(path)); - } - if cached_path.is_file(&self.cache.fs, ctx) { - return Ok(Some(cached_path.clone())); - } - Ok(None) - } - - fn load_node_modules( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - let (package_name, subpath) = Self::parse_package_specifier(specifier); - // 1. let DIRS = NODE_MODULES_PATHS(START) - // 2. for each DIR in DIRS: - for module_name in &self.options.modules { - for cached_path in std::iter::successors(Some(cached_path), |p| p.parent()) { - // Skip if /path/to/node_modules does not exist - if !cached_path.is_dir(&self.cache.fs, ctx) { - continue; - } - - let Some(cached_path) = self.get_module_directory(cached_path, module_name, ctx) - else { - continue; - }; - // Optimize node_modules lookup by inspecting whether the package exists - // From LOAD_PACKAGE_EXPORTS(X, DIR) - // 1. Try to interpret X as a combination of NAME and SUBPATH where the name - // may have a @scope/ prefix and the subpath begins with a slash (`/`). - if !package_name.is_empty() { - let package_path = cached_path.path().normalize_with(package_name); - let cached_path = self.cache.value(&package_path); - // Try foo/node_modules/package_name - if cached_path.is_dir(&self.cache.fs, ctx) { - // a. LOAD_PACKAGE_EXPORTS(X, DIR) - if let Some(path) = - self.load_package_exports(specifier, subpath, &cached_path, ctx)? - { - return Ok(Some(path)); - } - } else { - // foo/node_modules/package_name is not a directory, so useless to check inside it - if !subpath.is_empty() { - continue; - } - // Skip if the directory lead to the scope package does not exist - // i.e. `foo/node_modules/@scope` is not a directory for `foo/node_modules/@scope/package` - if package_name.starts_with('@') { - if let Some(path) = cached_path.parent() { - if !path.is_dir(&self.cache.fs, ctx) { - continue; - } - } - } - } - } - - // Try as file or directory for all other cases - // b. LOAD_AS_FILE(DIR/X) - // c. LOAD_AS_DIRECTORY(DIR/X) - let node_module_file = cached_path.path().normalize_with(specifier); - let cached_path = self.cache.value(&node_module_file); - if let Some(path) = self.load_as_file_or_directory(&cached_path, specifier, ctx)? { - return Ok(Some(path)); - } - } - } - Ok(None) - } - - fn get_module_directory( - &self, - cached_path: &CachedPath, - module_name: &str, - ctx: &mut Ctx, - ) -> Option { - if cached_path.path().ends_with(module_name) { - Some(cached_path.clone()) - } else if module_name == "node_modules" { - cached_path.cached_node_modules(&self.cache, ctx) - } else { - cached_path.module_directory(module_name, &self.cache, ctx) - } - } - - fn load_package_exports( - &self, - specifier: &str, - subpath: &str, - cached_path: &CachedPath, - ctx: &mut Ctx, - ) -> ResolveResult { - // 2. If X does not match this pattern or DIR/NAME/package.json is not a file, - // return. - let Some(package_json) = cached_path.package_json(&self.cache.fs, &self.options, ctx)? - else { - return Ok(None); - }; - // 3. Parse DIR/NAME/package.json, and look for "exports" field. - // 4. If "exports" is null or undefined, return. - // 5. let MATCH = PACKAGE_EXPORTS_RESOLVE(pathToFileURL(DIR/NAME), "." + SUBPATH, - // `package.json` "exports", ["node", "require"]) defined in the ESM resolver. - // Note: The subpath is not prepended with a dot on purpose - for exports in package_json.exports_fields(&self.options.exports_fields) { - if let Some(path) = self.package_exports_resolve( - cached_path.path(), - &format!(".{subpath}"), - exports, - ctx, - )? { - // 6. RESOLVE_ESM_MATCH(MATCH) - return self.resolve_esm_match(specifier, &path, ctx); - }; - } - Ok(None) - } - - fn load_package_self( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - // 1. Find the closest package scope SCOPE to DIR. - // 2. If no scope was found, return. - let Some(package_json) = - cached_path.find_package_json(&self.cache.fs, &self.options, ctx)? - else { - return Ok(None); - }; - // 3. If the SCOPE/package.json "exports" is null or undefined, return. - // 4. If the SCOPE/package.json "name" is not the first segment of X, return. - if let Some(subpath) = package_json - .name - .as_ref() - .and_then(|package_name| Self::strip_package_name(specifier, package_name)) - { - // 5. let MATCH = PACKAGE_EXPORTS_RESOLVE(pathToFileURL(SCOPE), - // "." + X.slice("name".length), `package.json` "exports", ["node", "require"]) - // defined in the ESM resolver. - let package_url = package_json.directory(); - // Note: The subpath is not prepended with a dot on purpose - // because `package_exports_resolve` matches subpath without the leading dot. - for exports in package_json.exports_fields(&self.options.exports_fields) { - if let Some(cached_path) = - self.package_exports_resolve(package_url, &format!(".{subpath}"), exports, ctx)? - { - // 6. RESOLVE_ESM_MATCH(MATCH) - return self.resolve_esm_match(specifier, &cached_path, ctx); - } - } - } - self.load_browser_field(cached_path, Some(specifier), &package_json, ctx) - } - - /// RESOLVE_ESM_MATCH(MATCH) - fn resolve_esm_match( - &self, - specifier: &str, - cached_path: &CachedPath, - ctx: &mut Ctx, - ) -> ResolveResult { - // 1. let RESOLVED_PATH = fileURLToPath(MATCH) - // 2. If the file at RESOLVED_PATH exists, load RESOLVED_PATH as its extension format. STOP - // - // Non-compliant ESM can result in a directory, so directory is tried as well. - if let Some(path) = self.load_as_file_or_directory(cached_path, "", ctx)? { - return Ok(Some(path)); - } - // 3. THROW "not found" - Err(ResolveError::NotFound(specifier.to_string())) - } - - /// enhanced-resolve: AliasFieldPlugin for [ResolveOptions::alias_fields] - fn load_browser_field( - &self, - cached_path: &CachedPath, - module_specifier: Option<&str>, - package_json: &PackageJson, - ctx: &mut Ctx, - ) -> ResolveResult { - let path = cached_path.path(); - let Some(new_specifier) = package_json.resolve_browser_field( - path, - module_specifier, - &self.options.alias_fields, - )? - else { - return Ok(None); - }; - // Abort when resolving recursive module - if module_specifier.is_some_and(|s| s == new_specifier) { - return Ok(None); - } - if ctx.resolving_alias.as_ref().is_some_and(|s| s == new_specifier) { - // Complete when resolving to self `{"./a.js": "./a.js"}` - if new_specifier.strip_prefix("./").filter(|s| path.ends_with(Path::new(s))).is_some() { - return if cached_path.is_file(&self.cache.fs, ctx) { - Ok(Some(cached_path.clone())) - } else { - Err(ResolveError::NotFound(new_specifier.to_string())) - }; - } - return Err(ResolveError::Recursion); - } - ctx.with_resolving_alias(new_specifier.to_string()); - ctx.with_fully_specified(false); - let cached_path = self.cache.value(package_json.directory()); - self.require(&cached_path, new_specifier, ctx).map(Some) - } - - /// enhanced-resolve: AliasPlugin for [ResolveOptions::alias] and [ResolveOptions::fallback]. - fn load_alias( - &self, - cached_path: &CachedPath, - specifier: &str, - aliases: &Alias, - ctx: &mut Ctx, - ) -> ResolveResult { - for (alias_key_raw, specifiers) in aliases { - let alias_key = if let Some(alias_key) = alias_key_raw.strip_suffix('$') { - if alias_key != specifier { - continue; - } - alias_key - } else { - let strip_package_name = Self::strip_package_name(specifier, alias_key_raw); - if strip_package_name.is_none() { - continue; - } - alias_key_raw - }; - // It should stop resolving when all of the tried alias values - // failed to resolve. - // - let mut should_stop = false; - for r in specifiers { - match r { - AliasValue::Path(alias_value) => { - if let Some(path) = self.load_alias_value( - cached_path, - alias_key, - alias_value, - specifier, - ctx, - &mut should_stop, - )? { - return Ok(Some(path)); - } - } - AliasValue::Ignore => { - let path = cached_path.path().normalize_with(alias_key); - return Err(ResolveError::Ignored(path)); - } - } - } - if should_stop { - return Err(ResolveError::NotFound(specifier.to_string())); - } - } - Ok(None) - } - - fn load_alias_value( - &self, - cached_path: &CachedPath, - alias_key: &str, - alias_value: &str, - request: &str, - ctx: &mut Ctx, - should_stop: &mut bool, - ) -> ResolveResult { - if request != alias_value - && !request.strip_prefix(alias_value).is_some_and(|prefix| prefix.starts_with('/')) - { - let tail = &request[alias_key.len()..]; - - let new_specifier = if tail.is_empty() { - Cow::Borrowed(alias_value) - } else { - let alias_value = Path::new(alias_value).normalize(); - // Must not append anything to alias_value if it is a file. - let alias_value_cached_path = self.cache.value(&alias_value); - if alias_value_cached_path.is_file(&self.cache.fs, ctx) { - return Ok(None); - } - - // Remove the leading slash so the final path is concatenated. - let tail = tail.trim_start_matches(SLASH_START); - let normalized = alias_value.normalize_with(tail); - Cow::Owned(normalized.to_string_lossy().to_string()) - }; - - *should_stop = true; - ctx.with_fully_specified(false); - return match self.require(cached_path, new_specifier.as_ref(), ctx) { - Err(ResolveError::NotFound(_)) => Ok(None), - Ok(path) => return Ok(Some(path)), - Err(err) => return Err(err), - }; - } - Ok(None) - } - - /// Given an extension alias map `{".js": [".ts", "js"]}`, - /// load the mapping instead of the provided extension - /// - /// This is an enhanced-resolve feature - /// - /// # Errors - /// - /// * [ResolveError::ExtensionAlias]: When all of the aliased extensions are not found - fn load_extension_alias(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - let Some(path_extension) = cached_path.path().extension() else { - return Ok(None); - }; - let Some((_, extensions)) = self - .options - .extension_alias - .iter() - .find(|(ext, _)| OsStr::new(ext.trim_start_matches('.')) == path_extension) - else { - return Ok(None); - }; - let path = cached_path.path().with_extension(""); - ctx.with_fully_specified(false); - if let Some(path) = self.load_extensions(&path, extensions, ctx)? { - return Ok(Some(path)); - } - Err(ResolveError::ExtensionAlias) - } - - /// enhanced-resolve: RootsPlugin - /// - /// A list of directories where requests of server-relative URLs (starting with '/') are resolved, - /// defaults to context configuration option. - /// - /// On non-Windows systems these requests are resolved as an absolute path first. - fn load_roots(&self, specifier: &str, ctx: &mut Ctx) -> Option { - if !self.options.roots.is_empty() { - if let Some(specifier) = specifier.strip_prefix(SLASH_START) { - for root in &self.options.roots { - let cached_path = self.cache.value(root); - if let Ok(path) = self.require_relative(&cached_path, specifier, ctx) { - return Some(path); - } - } - } - } - None - } - - fn load_tsconfig_paths( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - let Some(tsconfig_options) = &self.options.tsconfig else { - return Ok(None); - }; - let tsconfig = self.load_tsconfig( - /* root */ true, - &tsconfig_options.config_file, - &tsconfig_options.references, - )?; - let paths = tsconfig.resolve(cached_path.path(), specifier); - for path in paths { - let cached_path = self.cache.value(&path); - if let Ok(path) = self.require_relative(&cached_path, ".", ctx) { - return Ok(Some(path)); - } - } - Ok(None) - } - - fn load_tsconfig( - &self, - root: bool, - path: &Path, - references: &TsconfigReferences, - ) -> Result, ResolveError> { - self.cache.tsconfig(root, path, |tsconfig| { - let directory = self.cache.value(tsconfig.directory()); - tracing::trace!(tsconfig = ?tsconfig, "load_tsconfig"); - - // Extend tsconfig - if let Some(extends) = &tsconfig.extends { - let extended_tsconfig_paths = match extends { - ExtendsField::Single(s) => { - vec![self.get_extended_tsconfig_path(&directory, tsconfig, s)?] - } - ExtendsField::Multiple(specifiers) => specifiers - .iter() - .map(|s| self.get_extended_tsconfig_path(&directory, tsconfig, s)) - .collect::, ResolveError>>()?, - }; - for extended_tsconfig_path in extended_tsconfig_paths { - let extended_tsconfig = self.load_tsconfig( - /* root */ false, - &extended_tsconfig_path, - &TsconfigReferences::Disabled, - )?; - tsconfig.extend_tsconfig(&extended_tsconfig); - } - } - - // Load project references - match references { - TsconfigReferences::Disabled => { - tsconfig.references.drain(..); - } - TsconfigReferences::Auto => {} - TsconfigReferences::Paths(paths) => { - tsconfig.references = paths - .iter() - .map(|path| ProjectReference { path: path.clone(), tsconfig: None }) - .collect(); - } - } - if !tsconfig.references.is_empty() { - let directory = tsconfig.directory().to_path_buf(); - for reference in &mut tsconfig.references { - let reference_tsconfig_path = directory.normalize_with(&reference.path); - let tsconfig = self.cache.tsconfig( - /* root */ true, - &reference_tsconfig_path, - |_| Ok(()), - )?; - reference.tsconfig.replace(tsconfig); - } - } - Ok(()) - }) - } - - fn get_extended_tsconfig_path( - &self, - directory: &CachedPath, - tsconfig: &TsConfig, - specifier: &str, - ) -> Result { - match specifier.as_bytes().first() { - None => Err(ResolveError::Specifier(SpecifierError::Empty(specifier.to_string()))), - Some(b'/') => Ok(PathBuf::from(specifier)), - Some(b'.') => Ok(tsconfig.directory().normalize_with(specifier)), - _ => self - .clone_with_options(ResolveOptions { - description_files: vec![], - extensions: vec![".json".into()], - main_files: vec!["tsconfig.json".into()], - ..ResolveOptions::default() - }) - .load_package_self_or_node_modules(directory, specifier, &mut Ctx::default()) - .map(|p| p.to_path_buf()) - .map_err(|err| match err { - ResolveError::NotFound(_) => { - ResolveError::TsconfigNotFound(PathBuf::from(specifier)) - } - _ => err, - }), - } - } - - /// PACKAGE_RESOLVE(packageSpecifier, parentURL) - fn package_resolve( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - let (package_name, subpath) = Self::parse_package_specifier(specifier); - - // 3. If packageSpecifier is a Node.js builtin module name, then - // 1. Return the string "node:" concatenated with packageSpecifier. - self.require_core(package_name)?; - - // 11. While parentURL is not the file system root, - for module_name in &self.options.modules { - for cached_path in std::iter::successors(Some(cached_path), |p| p.parent()) { - // 1. Let packageURL be the URL resolution of "node_modules/" concatenated with packageSpecifier, relative to parentURL. - let Some(cached_path) = self.get_module_directory(cached_path, module_name, ctx) - else { - continue; - }; - // 2. Set parentURL to the parent folder URL of parentURL. - let package_path = cached_path.path().normalize_with(package_name); - let cached_path = self.cache.value(&package_path); - // 3. If the folder at packageURL does not exist, then - // 1. Continue the next loop iteration. - if cached_path.is_dir(&self.cache.fs, ctx) { - // 4. Let pjson be the result of READ_PACKAGE_JSON(packageURL). - if let Some(package_json) = - cached_path.package_json(&self.cache.fs, &self.options, ctx)? - { - // 5. If pjson is not null and pjson.exports is not null or undefined, then - // 1. Return the result of PACKAGE_EXPORTS_RESOLVE(packageURL, packageSubpath, pjson.exports, defaultConditions). - for exports in package_json.exports_fields(&self.options.exports_fields) { - if let Some(path) = self.package_exports_resolve( - cached_path.path(), - &format!(".{subpath}"), - exports, - ctx, - )? { - return Ok(Some(path)); - } - } - // 6. Otherwise, if packageSubpath is equal to ".", then - if subpath == "." { - // 1. If pjson.main is a string, then - for main_field in package_json.main_fields(&self.options.main_fields) { - // 1. Return the URL resolution of main in packageURL. - let path = cached_path.path().normalize_with(main_field); - let cached_path = self.cache.value(&path); - if cached_path.is_file(&self.cache.fs, ctx) { - return Ok(Some(cached_path)); - } - } - } - } - let subpath = format!(".{subpath}"); - ctx.with_fully_specified(false); - return self.require(&cached_path, &subpath, ctx).map(Some); - } - } - } - - Err(ResolveError::NotFound(specifier.to_string())) - } - - /// PACKAGE_EXPORTS_RESOLVE(packageURL, subpath, exports, conditions) - fn package_exports_resolve( - &self, - package_url: &Path, - subpath: &str, - exports: &JSONValue, - ctx: &mut Ctx, - ) -> ResolveResult { - let conditions = &self.options.condition_names; - // 1. If exports is an Object with both a key starting with "." and a key not starting with ".", throw an Invalid Package Configuration error. - if let JSONValue::Object(map) = exports { - let mut has_dot = false; - let mut without_dot = false; - for key in map.keys() { - has_dot = has_dot || key.starts_with(|s| s == '.' || s == '#'); - without_dot = without_dot || !key.starts_with(|s| s == '.' || s == '#'); - if has_dot && without_dot { - return Err(ResolveError::InvalidPackageConfig( - package_url.join("package.json"), - )); - } - } - } - // 2. If subpath is equal to ".", then - // Note: subpath is not prepended with a dot when passed in. - if subpath == "." { - // enhanced-resolve appends query and fragment when resolving exports field - // https://github.com/webpack/enhanced-resolve/blob/a998c7d218b7a9ec2461fc4fddd1ad5dd7687485/lib/ExportsFieldPlugin.js#L57-L62 - // This is only need when querying the main export, otherwise ctx is passed through. - if ctx.query.is_some() || ctx.fragment.is_some() { - let query = ctx.query.clone().unwrap_or_default(); - let fragment = ctx.fragment.clone().unwrap_or_default(); - return Err(ResolveError::PackagePathNotExported( - format!("./{}{query}{fragment}", subpath.trim_start_matches('.')), - package_url.join("package.json"), - )); - } - // 1. Let mainExport be undefined. - let main_export = match exports { - // 2. If exports is a String or Array, or an Object containing no keys starting with ".", then - JSONValue::String(_) | JSONValue::Array(_) => { - // 1. Set mainExport to exports. - Some(exports) - } - // 3. Otherwise if exports is an Object containing a "." property, then - JSONValue::Object(map) => { - // 1. Set mainExport to exports["."]. - map.get(".").map_or_else( - || { - if map.keys().any(|key| key.starts_with("./") || key.starts_with('#')) { - None - } else { - Some(exports) - } - }, - Some, - ) - } - _ => None, - }; - // 4. If mainExport is not undefined, then - if let Some(main_export) = main_export { - // 1. Let resolved be the result of PACKAGE_TARGET_RESOLVE( packageURL, mainExport, null, false, conditions). - let resolved = self.package_target_resolve( - package_url, - ".", - main_export, - None, - /* is_imports */ false, - conditions, - ctx, - )?; - // 2. If resolved is not null or undefined, return resolved. - if let Some(path) = resolved { - return Ok(Some(path)); - } - } - } - // 3. Otherwise, if exports is an Object and all keys of exports start with ".", then - if let JSONValue::Object(exports) = exports { - // 1. Let matchKey be the string "./" concatenated with subpath. - // Note: `package_imports_exports_resolve` does not require the leading dot. - let match_key = &subpath; - // 2. Let resolved be the result of PACKAGE_IMPORTS_EXPORTS_RESOLVE( matchKey, exports, packageURL, false, conditions). - if let Some(path) = self.package_imports_exports_resolve( - match_key, - exports, - package_url, - /* is_imports */ false, - conditions, - ctx, - )? { - // 3. If resolved is not null or undefined, return resolved. - return Ok(Some(path)); - } - } - // 4. Throw a Package Path Not Exported error. - Err(ResolveError::PackagePathNotExported( - subpath.to_string(), - package_url.join("package.json"), - )) - } - - /// PACKAGE_IMPORTS_RESOLVE(specifier, parentURL, conditions) - fn package_imports_resolve( - &self, - specifier: &str, - package_json: &PackageJson, - ctx: &mut Ctx, - ) -> Result, ResolveError> { - // 1. Assert: specifier begins with "#". - debug_assert!(specifier.starts_with('#'), "{specifier}"); - // 2. If specifier is exactly equal to "#" or starts with "#/", then - // 1. Throw an Invalid Module Specifier error. - // 3. Let packageURL be the result of LOOKUP_PACKAGE_SCOPE(parentURL). - // 4. If packageURL is not null, then - - // 1. Let pjson be the result of READ_PACKAGE_JSON(packageURL). - // 2. If pjson.imports is a non-null Object, then - - // 1. Let resolved be the result of PACKAGE_IMPORTS_EXPORTS_RESOLVE( specifier, pjson.imports, packageURL, true, conditions). - let mut has_imports = false; - for imports in package_json.imports_fields(&self.options.imports_fields) { - if !has_imports { - has_imports = true; - // TODO: fill in test case for this case - if specifier == "#" || specifier.starts_with("#/") { - return Err(ResolveError::InvalidModuleSpecifier( - specifier.to_string(), - package_json.path.clone(), - )); - } - } - if let Some(path) = self.package_imports_exports_resolve( - specifier, - imports, - package_json.directory(), - /* is_imports */ true, - &self.options.condition_names, - ctx, - )? { - // 2. If resolved is not null or undefined, return resolved. - return Ok(Some(path)); - } - } - - // 5. Throw a Package Import Not Defined error. - if has_imports { - Err(ResolveError::PackageImportNotDefined( - specifier.to_string(), - package_json.path.clone(), - )) - } else { - Ok(None) - } - } - - /// PACKAGE_IMPORTS_EXPORTS_RESOLVE(matchKey, matchObj, packageURL, isImports, conditions) - fn package_imports_exports_resolve( - &self, - match_key: &str, - match_obj: &JSONMap, - package_url: &Path, - is_imports: bool, - conditions: &[String], - ctx: &mut Ctx, - ) -> ResolveResult { - // enhanced-resolve behaves differently, it throws - // Error: CachedPath to directories is not possible with the exports field (specifier was ./dist/) - if match_key.ends_with('/') { - return Ok(None); - } - // 1. If matchKey is a key of matchObj and does not contain "*", then - if !match_key.contains('*') { - // 1. Let target be the value of matchObj[matchKey]. - if let Some(target) = match_obj.get(match_key) { - // 2. Return the result of PACKAGE_TARGET_RESOLVE(packageURL, target, null, isImports, conditions). - return self.package_target_resolve( - package_url, - match_key, - target, - None, - is_imports, - conditions, - ctx, - ); - } - } - - let mut best_target = None; - let mut best_match = ""; - let mut best_key = ""; - // 2. Let expansionKeys be the list of keys of matchObj containing only a single "*", sorted by the sorting function PATTERN_KEY_COMPARE which orders in descending order of specificity. - // 3. For each key expansionKey in expansionKeys, do - for (expansion_key, target) in match_obj { - if expansion_key.starts_with("./") || expansion_key.starts_with('#') { - // 1. Let patternBase be the substring of expansionKey up to but excluding the first "*" character. - if let Some((pattern_base, pattern_trailer)) = expansion_key.split_once('*') { - // 2. If matchKey starts with but is not equal to patternBase, then - if match_key.starts_with(pattern_base) - // 1. Let patternTrailer be the substring of expansionKey from the index after the first "*" character. - && !pattern_trailer.contains('*') - // 2. If patternTrailer has zero length, or if matchKey ends with patternTrailer and the length of matchKey is greater than or equal to the length of expansionKey, then - && (pattern_trailer.is_empty() - || (match_key.len() >= expansion_key.len() - && match_key.ends_with(pattern_trailer))) - && Self::pattern_key_compare(best_key, expansion_key).is_gt() - { - // 1. Let target be the value of matchObj[expansionKey]. - best_target = Some(target); - // 2. Let patternMatch be the substring of matchKey starting at the index of the length of patternBase up to the length of matchKey minus the length of patternTrailer. - best_match = - &match_key[pattern_base.len()..match_key.len() - pattern_trailer.len()]; - best_key = expansion_key; - } - } else if expansion_key.ends_with('/') - && match_key.starts_with(expansion_key) - && Self::pattern_key_compare(best_key, expansion_key).is_gt() - { - // TODO: [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./dist/" in the "exports" field module resolution of the package at xxx/package.json. - best_target = Some(target); - best_match = &match_key[expansion_key.len()..]; - best_key = expansion_key; - } - } - } - if let Some(best_target) = best_target { - // 3. Return the result of PACKAGE_TARGET_RESOLVE(packageURL, target, patternMatch, isImports, conditions). - return self.package_target_resolve( - package_url, - best_key, - best_target, - Some(best_match), - is_imports, - conditions, - ctx, - ); - } - // 4. Return null. - Ok(None) - } - - /// PACKAGE_TARGET_RESOLVE(packageURL, target, patternMatch, isImports, conditions) - #[allow(clippy::too_many_arguments)] - fn package_target_resolve( - &self, - package_url: &Path, - target_key: &str, - target: &JSONValue, - pattern_match: Option<&str>, - is_imports: bool, - conditions: &[String], - ctx: &mut Ctx, - ) -> ResolveResult { - fn normalize_string_target<'a>( - target_key: &'a str, - target: &'a str, - pattern_match: Option<&'a str>, - package_url: &Path, - ) -> Result, ResolveError> { - let target = if let Some(pattern_match) = pattern_match { - if !target_key.contains('*') && !target.contains('*') { - // enhanced-resolve behaviour - // TODO: [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./dist/" in the "exports" field module resolution of the package at xxx/package.json. - if target_key.ends_with('/') && target.ends_with('/') { - Cow::Owned(format!("{target}{pattern_match}")) - } else { - return Err(ResolveError::InvalidPackageConfigDirectory( - package_url.join("package.json"), - )); - } - } else { - Cow::Owned(target.replace('*', pattern_match)) - } - } else { - Cow::Borrowed(target) - }; - Ok(target) - } - - match target { - // 1. If target is a String, then - JSONValue::String(target) => { - // 1. If target does not start with "./", then - if !target.starts_with("./") { - // 1. If isImports is false, or if target starts with "../" or "/", or if target is a valid URL, then - if !is_imports || target.starts_with("../") || target.starts_with('/') { - // 1. Throw an Invalid Package Target error. - return Err(ResolveError::InvalidPackageTarget( - target.to_string(), - target_key.to_string(), - package_url.join("package.json"), - )); - } - // 2. If patternMatch is a String, then - // 1. Return PACKAGE_RESOLVE(target with every instance of "*" replaced by patternMatch, packageURL + "/"). - let target = - normalize_string_target(target_key, target, pattern_match, package_url)?; - let package_url = self.cache.value(package_url); - // // 3. Return PACKAGE_RESOLVE(target, packageURL + "/"). - return self.package_resolve(&package_url, &target, ctx); - } - - // 2. If target split on "/" or "\" contains any "", ".", "..", or "node_modules" segments after the first "." segment, case insensitive and including percent encoded variants, throw an Invalid Package Target error. - // 3. Let resolvedTarget be the URL resolution of the concatenation of packageURL and target. - // 4. Assert: resolvedTarget is contained in packageURL. - // 5. If patternMatch is null, then - let target = - normalize_string_target(target_key, target, pattern_match, package_url)?; - if Path::new(target.as_ref()).is_invalid_exports_target() { - return Err(ResolveError::InvalidPackageTarget( - target.to_string(), - target_key.to_string(), - package_url.join("package.json"), - )); - } - let resolved_target = package_url.normalize_with(target.as_ref()); - // 6. If patternMatch split on "/" or "\" contains any "", ".", "..", or "node_modules" segments, case insensitive and including percent encoded variants, throw an Invalid Module Specifier error. - // 7. Return the URL resolution of resolvedTarget with every instance of "*" replaced with patternMatch. - let value = self.cache.value(&resolved_target); - return Ok(Some(value)); - } - // 2. Otherwise, if target is a non-null Object, then - JSONValue::Object(target) => { - // 1. If exports contains any index property keys, as defined in ECMA-262 6.1.7 Array Index, throw an Invalid Package Configuration error. - // 2. For each property p of target, in object insertion order as, - for (key, target_value) in target { - // 1. If p equals "default" or conditions contains an entry for p, then - if key == "default" || conditions.contains(key) { - // 1. Let targetValue be the value of the p property in target. - // 2. Let resolved be the result of PACKAGE_TARGET_RESOLVE( packageURL, targetValue, patternMatch, isImports, conditions). - let resolved = self.package_target_resolve( - package_url, - target_key, - target_value, - pattern_match, - is_imports, - conditions, - ctx, - ); - // 3. If resolved is equal to undefined, continue the loop. - if let Some(path) = resolved? { - // 4. Return resolved. - return Ok(Some(path)); - } - } - } - // 3. Return undefined. - return Ok(None); - } - // 3. Otherwise, if target is an Array, then - JSONValue::Array(targets) => { - // 1. If _target.length is zero, return null. - if targets.is_empty() { - // Note: return PackagePathNotExported has the same effect as return because there are no matches. - return Err(ResolveError::PackagePathNotExported( - pattern_match.unwrap_or(".").to_string(), - package_url.join("package.json"), - )); - } - // 2. For each item targetValue in target, do - for (i, target_value) in targets.iter().enumerate() { - // 1. Let resolved be the result of PACKAGE_TARGET_RESOLVE( packageURL, targetValue, patternMatch, isImports, conditions), continuing the loop on any Invalid Package Target error. - let resolved = self.package_target_resolve( - package_url, - target_key, - target_value, - pattern_match, - is_imports, - conditions, - ctx, - ); - - if resolved.is_err() && i == targets.len() { - return resolved; - } - - // 2. If resolved is undefined, continue the loop. - if let Ok(Some(path)) = resolved { - // 3. Return resolved. - return Ok(Some(path)); - } - } - // 3. Return or throw the last fallback resolution null return or error. - // Note: see `resolved.is_err() && i == targets.len()` - } - _ => {} - } - // 4. Otherwise, if target is null, return null. - Ok(None) - // 5. Otherwise throw an Invalid Package Target error. - } - - // Returns (module, subpath) - // https://github.com/nodejs/node/blob/8f0f17e1e3b6c4e58ce748e06343c5304062c491/lib/internal/modules/esm/resolve.js#L688 - fn parse_package_specifier(specifier: &str) -> (&str, &str) { - let mut separator_index = specifier.as_bytes().iter().position(|b| *b == b'/'); - // let mut valid_package_name = true; - // let mut is_scoped = false; - if specifier.starts_with('@') { - // is_scoped = true; - if separator_index.is_none() || specifier.is_empty() { - // valid_package_name = false; - } else if let Some(index) = &separator_index { - separator_index = specifier[*index + 1..] - .as_bytes() - .iter() - .position(|b| *b == b'/') - .map(|i| i + *index + 1); - } - } - let package_name = - separator_index.map_or(specifier, |separator_index| &specifier[..separator_index]); - - // TODO: https://github.com/nodejs/node/blob/8f0f17e1e3b6c4e58ce748e06343c5304062c491/lib/internal/modules/esm/resolve.js#L705C1-L714C1 - // Package name cannot have leading . and cannot have percent-encoding or - // \\ separators. - // if (RegExpPrototypeExec(invalidPackageNameRegEx, packageName) !== null) - // validPackageName = false; - - // if (!validPackageName) { - // throw new ERR_INVALID_MODULE_SPECIFIER( - // specifier, 'is not a valid package name', fileURLToPath(base)); - // } - let package_subpath = - separator_index.map_or("", |separator_index| &specifier[separator_index..]); - (package_name, package_subpath) - } - - /// PATTERN_KEY_COMPARE(keyA, keyB) - fn pattern_key_compare(key_a: &str, key_b: &str) -> Ordering { - if key_a.is_empty() { - return Ordering::Greater; - } - // 1. Assert: keyA ends with "/" or contains only a single "*". - debug_assert!(key_a.ends_with('/') || key_a.match_indices('*').count() == 1, "{key_a}"); - // 2. Assert: keyB ends with "/" or contains only a single "*". - debug_assert!(key_b.ends_with('/') || key_b.match_indices('*').count() == 1, "{key_b}"); - // 3. Let baseLengthA be the index of "*" in keyA plus one, if keyA contains "*", or the length of keyA otherwise. - let a_pos = key_a.chars().position(|c| c == '*'); - let base_length_a = a_pos.map_or(key_a.len(), |p| p + 1); - // 4. Let baseLengthB be the index of "*" in keyB plus one, if keyB contains "*", or the length of keyB otherwise. - let b_pos = key_b.chars().position(|c| c == '*'); - let base_length_b = b_pos.map_or(key_b.len(), |p| p + 1); - // 5. If baseLengthA is greater than baseLengthB, return -1. - if base_length_a > base_length_b { - return Ordering::Less; - } - // 6. If baseLengthB is greater than baseLengthA, return 1. - if base_length_b > base_length_a { - return Ordering::Greater; - } - // 7. If keyA does not contain "*", return 1. - if !key_a.contains('*') { - return Ordering::Greater; - } - // 8. If keyB does not contain "*", return -1. - if !key_b.contains('*') { - return Ordering::Less; - } - // 9. If the length of keyA is greater than the length of keyB, return -1. - if key_a.len() > key_b.len() { - return Ordering::Less; - } - // 10. If the length of keyB is greater than the length of keyA, return 1. - if key_b.len() > key_a.len() { - return Ordering::Greater; - } - // 11. Return 0. - Ordering::Equal - } - - fn strip_package_name<'a>(specifier: &'a str, package_name: &'a str) -> Option<&'a str> { - specifier - .strip_prefix(package_name) - .filter(|tail| tail.is_empty() || tail.starts_with(SLASH_START)) - } -} diff --git a/src/options.rs b/src/options.rs deleted file mode 100644 index f473a133..00000000 --- a/src/options.rs +++ /dev/null @@ -1,623 +0,0 @@ -use std::path::Path; -use std::{fmt, path::PathBuf}; - -/// Module Resolution Options -/// -/// Options are directly ported from [enhanced-resolve](https://github.com/webpack/enhanced-resolve#resolver-options). -/// -/// See [webpack resolve](https://webpack.js.org/configuration/resolve/) for information and examples -#[derive(Debug, Clone)] -pub struct ResolveOptions { - /// Path to TypeScript configuration file. - /// - /// Default `None` - pub tsconfig: Option, - - /// Create aliases to import or require certain modules more easily. - /// - /// An alias is used to replace a whole path or part of a path. - /// For example, to alias a commonly used `src/` folders: `vec![("@/src"), vec![AliasValue::Path("/path/to/src")]]` - /// - /// A trailing $ can also be added to the given object's keys to signify an exact match. - /// - /// See [webpack's `resolve.alias` documentation](https://webpack.js.org/configuration/resolve/#resolvealias) for a list of use cases. - pub alias: Alias, - - /// A list of alias fields in description files. - /// - /// Specify a field, such as `browser`, to be parsed according to [this specification](https://github.com/defunctzombie/package-browser-field-spec). - /// Can be a path to json object such as `["path", "to", "exports"]`. - /// - /// Default `[]` - pub alias_fields: Vec>, - - /// Condition names for exports field which defines entry points of a package. - /// - /// The key order in the exports field is significant. During condition matching, earlier entries have higher priority and take precedence over later entries. - /// - /// Default `[]` - pub condition_names: Vec, - - /// The JSON files to use for descriptions. (There was once a `bower.json`.) - /// - /// Default `["package.json"]` - pub description_files: Vec, - - /// Set to [EnforceExtension::Enabled] for [ESM Mandatory file extensions](https://nodejs.org/api/esm.html#mandatory-file-extensions). - /// - /// If `enforce_extension` is set to [EnforceExtension::Enabled], resolution will not allow extension-less files. - /// This means `require('./foo.js')` will resolve, while `require('./foo')` will not. - /// - /// The default value for `enforce_extension` is [EnforceExtension::Auto], which is changed upon initialization. - /// - /// It changes to [EnforceExtension::Enabled] if [ResolveOptions::extensions] contains an empty string; - /// otherwise, this value changes to [EnforceExtension::Disabled]. - /// - /// Explicitly set the value to [EnforceExtension::Disabled] to disable this automatic behavior. - /// - /// For reference, this behavior is aligned with `enhanced-resolve`. See . - pub enforce_extension: EnforceExtension, - - /// A list of exports fields in description files. - /// - /// Can be a path to a JSON object such as `["path", "to", "exports"]`. - /// - /// Default `[["exports"]]`. - pub exports_fields: Vec>, - - /// Fields from `package.json` which are used to provide the internal requests of a package - /// (requests starting with # are considered internal). - /// - /// Can be a path to a JSON object such as `["path", "to", "imports"]`. - /// - /// Default `[["imports"]]`. - pub imports_fields: Vec>, - - /// An object which maps extension to extension aliases. - /// - /// Default `{}` - pub extension_alias: Vec<(String, Vec)>, - - /// Attempt to resolve these extensions in order. - /// - /// If multiple files share the same name but have different extensions, - /// will resolve the one with the extension listed first in the array and skip the rest. - /// - /// All extensions must have a leading dot. - /// - /// Default `[".js", ".json", ".node"]` - pub extensions: Vec, - - /// Redirect module requests when normal resolving fails. - /// - /// Default `[]` - pub fallback: Alias, - - /// 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). - /// - /// See also webpack configuration [resolve.fullySpecified](https://webpack.js.org/configuration/module/#resolvefullyspecified) - /// - /// Default `false` - pub fully_specified: bool, - - /// A list of main fields in description files - /// - /// Default `["main"]`. - pub main_fields: Vec, - - /// The filename to be used while resolving directories. - /// - /// Default `["index"]` - pub main_files: Vec, - - /// A list of directories to resolve modules from, can be absolute path or folder name. - /// - /// Default `["node_modules"]` - pub modules: Vec, - - /// Resolve to a context instead of a file. - /// - /// Default `false` - pub resolve_to_context: bool, - - /// Prefer to resolve module requests as relative requests instead of using modules from node_modules directories. - /// - /// Default `false` - pub prefer_relative: bool, - - /// Prefer to resolve server-relative urls as absolute paths before falling back to resolve in ResolveOptions::roots. - /// - /// Default `false` - pub prefer_absolute: bool, - - /// A list of resolve restrictions to restrict the paths that a request can be resolved on. - /// - /// Default `[]` - pub restrictions: Vec, - - /// A list of directories where requests of server-relative URLs (starting with '/') are resolved. - /// On non-Windows systems these requests are resolved as an absolute path first. - /// - /// Default `[]` - pub roots: Vec, - - /// Whether to resolve symlinks to their symlinked location. - /// When enabled, symlinked resources are resolved to their real path, not their symlinked location. - /// Note that this may cause module resolution to fail when using tools that symlink packages (like npm link). - /// - /// Default `true` - pub symlinks: bool, - - /// Whether to parse [module.builtinModules](https://nodejs.org/api/module.html#modulebuiltinmodules) or not. - /// For example, "zlib" will throw [crate::ResolveError::Builtin] when set to true. - /// - /// Default `false` - pub builtin_modules: bool, -} - -impl ResolveOptions { - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// - /// let options = ResolveOptions::default().with_condition_names(&["bar"]); - /// assert_eq!(options.condition_names, vec!["bar".to_string()]) - /// ``` - #[must_use] - pub fn with_condition_names(mut self, names: &[&str]) -> Self { - self.condition_names = names.iter().map(ToString::to_string).collect::>(); - self - } - - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// - /// let options = ResolveOptions::default().with_builtin_modules(false); - /// assert_eq!(options.builtin_modules, false) - /// ``` - #[must_use] - pub fn with_builtin_modules(mut self, flag: bool) -> Self { - self.builtin_modules = flag; - self - } - - /// Adds a single root to the options - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_root("foo"); - /// assert_eq!(options.roots, vec![PathBuf::from("foo")]) - /// ``` - #[must_use] - pub fn with_root>(mut self, root: P) -> Self { - self.roots.push(root.as_ref().to_path_buf()); - self - } - - /// Adds a single extension to the list of extensions - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_extension("jsonc"); - /// assert!(options.extensions.contains(&"jsonc".to_string())); - /// ``` - #[must_use] - pub fn with_extension>(mut self, extension: S) -> Self { - self.extensions.push(extension.into()); - self - } - - /// Adds a single main field to the list of fields - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_main_field("something"); - /// assert!(options.main_fields.contains(&"something".to_string())); - /// ``` - #[must_use] - pub fn with_main_field>(mut self, field: S) -> Self { - self.main_fields.push(field.into()); - self - } - - /// Changes how the extension should be treated - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions, EnforceExtension}; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_force_extension(EnforceExtension::Enabled); - /// assert_eq!(options.enforce_extension, EnforceExtension::Enabled); - /// ``` - #[must_use] - pub fn with_force_extension(mut self, enforce_extension: EnforceExtension) -> Self { - self.enforce_extension = enforce_extension; - self - } - - /// Sets the value for [ResolveOptions::fully_specified] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_fully_specified(true); - /// assert_eq!(options.fully_specified, true); - /// ``` - #[must_use] - pub fn with_fully_specified(mut self, fully_specified: bool) -> Self { - self.fully_specified = fully_specified; - self - } - /// Sets the value for [ResolveOptions::prefer_relative] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_prefer_relative(true); - /// assert_eq!(options.prefer_relative, true); - /// ``` - #[must_use] - pub fn with_prefer_relative(mut self, flag: bool) -> Self { - self.prefer_relative = flag; - self - } - /// Sets the value for [ResolveOptions::prefer_absolute] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_prefer_absolute(true); - /// assert_eq!(options.prefer_absolute, true); - /// ``` - #[must_use] - pub fn with_prefer_absolute(mut self, flag: bool) -> Self { - self.prefer_absolute = flag; - self - } - - /// Changes the value of [ResolveOptions::symlinks] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// - /// let options = ResolveOptions::default().with_symbolic_link(false); - /// assert_eq!(options.symlinks, false); - /// ``` - #[must_use] - pub fn with_symbolic_link(mut self, flag: bool) -> Self { - self.symlinks = flag; - self - } - - /// Adds a module to [ResolveOptions::modules] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// - /// let options = ResolveOptions::default().with_module("module"); - /// assert!(options.modules.contains(&"module".to_string())); - /// ``` - #[must_use] - pub fn with_module>(mut self, module: M) -> Self { - self.modules.push(module.into()); - self - } - - /// Adds a main file to [ResolveOptions::main_files] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// - /// let options = ResolveOptions::default().with_main_file("foo"); - /// assert!(options.main_files.contains(&"foo".to_string())); - /// ``` - #[must_use] - pub fn with_main_file>(mut self, module: M) -> Self { - self.main_files.push(module.into()); - self - } - - pub(crate) fn sanitize(mut self) -> Self { - debug_assert!( - self.extensions.iter().filter(|e| !e.is_empty()).all(|e| e.starts_with('.')), - "All extensions must start with a leading dot" - ); - // Set `enforceExtension` to `true` when [ResolveOptions::extensions] contains an empty string. - // See - if self.enforce_extension == EnforceExtension::Auto { - if !self.extensions.is_empty() && self.extensions.iter().any(String::is_empty) { - self.enforce_extension = EnforceExtension::Enabled; - } else { - self.enforce_extension = EnforceExtension::Disabled; - } - } - self - } -} - -/// Value for [ResolveOptions::enforce_extension] -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -pub enum EnforceExtension { - Auto, - Enabled, - Disabled, -} - -impl EnforceExtension { - pub const fn is_auto(&self) -> bool { - matches!(self, Self::Auto) - } - - pub const fn is_enabled(&self) -> bool { - matches!(self, Self::Enabled) - } - - pub const fn is_disabled(&self) -> bool { - matches!(self, Self::Disabled) - } -} - -/// Alias for [ResolveOptions::alias] and [ResolveOptions::fallback] -pub type Alias = Vec<(String, Vec)>; - -/// Alias Value for [ResolveOptions::alias] and [ResolveOptions::fallback] -#[derive(Debug, Clone, Hash, PartialEq, Eq)] -pub enum AliasValue { - /// The path value - Path(String), - - /// The `false` value - Ignore, -} - -impl From for AliasValue -where - S: Into, -{ - fn from(value: S) -> Self { - Self::Path(value.into()) - } -} - -/// Value for [ResolveOptions::restrictions] -#[derive(Debug, Clone)] -pub enum Restriction { - Path(PathBuf), - RegExp(String), -} - -/// Tsconfig Options for [ResolveOptions::tsconfig] -/// -/// Derived from [tsconfig-paths-webpack-plugin](https://github.com/dividab/tsconfig-paths-webpack-plugin#options) -#[derive(Debug, Clone)] -pub struct TsconfigOptions { - /// Allows you to specify where to find the TypeScript configuration file. - /// You may provide - /// * a relative path to the configuration file. It will be resolved relative to cwd. - /// * an absolute path to the configuration file. - pub config_file: PathBuf, - - /// Support for Typescript Project References. - pub references: TsconfigReferences, -} - -/// Configuration for [TsconfigOptions::references] -#[derive(Debug, Clone)] -pub enum TsconfigReferences { - Disabled, - /// Use the `references` field from tsconfig of `config_file`. - Auto, - /// Manually provided relative or absolute path. - Paths(Vec), -} - -impl Default for ResolveOptions { - fn default() -> Self { - Self { - tsconfig: None, - alias: vec![], - alias_fields: vec![], - condition_names: vec![], - description_files: vec!["package.json".into()], - enforce_extension: EnforceExtension::Auto, - extension_alias: vec![], - exports_fields: vec![vec!["exports".into()]], - imports_fields: vec![vec!["imports".into()]], - extensions: vec![".js".into(), ".json".into(), ".node".into()], - fallback: vec![], - fully_specified: false, - main_fields: vec!["main".into()], - main_files: vec!["index".into()], - modules: vec!["node_modules".into()], - resolve_to_context: false, - prefer_relative: false, - prefer_absolute: false, - restrictions: vec![], - roots: vec![], - symlinks: true, - builtin_modules: false, - } - } -} - -// For tracing -impl fmt::Display for ResolveOptions { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - if let Some(tsconfig) = &self.tsconfig { - write!(f, "tsconfig:{tsconfig:?},")?; - } - if !self.alias.is_empty() { - write!(f, "alias:{:?},", self.alias)?; - } - if !self.alias_fields.is_empty() { - write!(f, "alias_fields:{:?},", self.alias_fields)?; - } - if !self.condition_names.is_empty() { - write!(f, "condition_names:{:?},", self.condition_names)?; - } - if self.enforce_extension.is_enabled() { - write!(f, "enforce_extension:{:?},", self.enforce_extension)?; - } - if !self.exports_fields.is_empty() { - write!(f, "exports_fields:{:?},", self.exports_fields)?; - } - if !self.imports_fields.is_empty() { - write!(f, "imports_fields:{:?},", self.imports_fields)?; - } - if !self.extension_alias.is_empty() { - write!(f, "extension_alias:{:?},", self.extension_alias)?; - } - if !self.extensions.is_empty() { - write!(f, "extensions:{:?},", self.extensions)?; - } - if !self.fallback.is_empty() { - write!(f, "fallback:{:?},", self.fallback)?; - } - if self.fully_specified { - write!(f, "fully_specified:{:?},", self.fully_specified)?; - } - if !self.main_fields.is_empty() { - write!(f, "main_fields:{:?},", self.main_fields)?; - } - if !self.main_files.is_empty() { - write!(f, "main_files:{:?},", self.main_files)?; - } - if !self.modules.is_empty() { - write!(f, "modules:{:?},", self.modules)?; - } - if self.resolve_to_context { - write!(f, "resolve_to_context:{:?},", self.resolve_to_context)?; - } - if self.prefer_relative { - write!(f, "prefer_relative:{:?},", self.prefer_relative)?; - } - if self.prefer_absolute { - write!(f, "prefer_absolute:{:?},", self.prefer_absolute)?; - } - if !self.restrictions.is_empty() { - write!(f, "restrictions:{:?},", self.restrictions)?; - } - if !self.roots.is_empty() { - write!(f, "roots:{:?},", self.roots)?; - } - if self.symlinks { - write!(f, "symlinks:{:?},", self.symlinks)?; - } - if self.builtin_modules { - write!(f, "builtin_modules:{:?},", self.builtin_modules)?; - } - Ok(()) - } -} - -#[cfg(test)] -mod test { - use super::{ - AliasValue, EnforceExtension, ResolveOptions, Restriction, TsconfigOptions, - TsconfigReferences, - }; - use std::path::PathBuf; - - #[test] - fn enforce_extension() { - assert!(EnforceExtension::Auto.is_auto()); - assert!(!EnforceExtension::Enabled.is_auto()); - assert!(!EnforceExtension::Disabled.is_auto()); - - assert!(!EnforceExtension::Auto.is_enabled()); - assert!(EnforceExtension::Enabled.is_enabled()); - assert!(!EnforceExtension::Disabled.is_enabled()); - - assert!(!EnforceExtension::Auto.is_disabled()); - assert!(!EnforceExtension::Enabled.is_disabled()); - assert!(EnforceExtension::Disabled.is_disabled()); - } - - #[test] - fn display() { - let options = ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: PathBuf::from("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - alias: vec![("a".into(), vec![AliasValue::Ignore])], - alias_fields: vec![vec!["browser".into()]], - condition_names: vec!["require".into()], - enforce_extension: EnforceExtension::Enabled, - extension_alias: vec![(".js".into(), vec![".ts".into()])], - exports_fields: vec![vec!["exports".into()]], - imports_fields: vec![vec!["imports".into()]], - fallback: vec![("fallback".into(), vec![AliasValue::Ignore])], - fully_specified: true, - resolve_to_context: true, - prefer_relative: true, - prefer_absolute: true, - restrictions: vec![Restriction::Path(PathBuf::from("restrictions"))], - roots: vec![PathBuf::from("roots")], - builtin_modules: true, - ..ResolveOptions::default() - }; - - let expected = r#"tsconfig:TsconfigOptions { config_file: "tsconfig.json", references: Auto },alias:[("a", [Ignore])],alias_fields:[["browser"]],condition_names:["require"],enforce_extension:Enabled,exports_fields:[["exports"]],imports_fields:[["imports"]],extension_alias:[(".js", [".ts"])],extensions:[".js", ".json", ".node"],fallback:[("fallback", [Ignore])],fully_specified:true,main_fields:["main"],main_files:["index"],modules:["node_modules"],resolve_to_context:true,prefer_relative:true,prefer_absolute:true,restrictions:[Path("restrictions")],roots:["roots"],symlinks:true,builtin_modules:true,"#; - assert_eq!(format!("{options}"), expected); - - let options = ResolveOptions { - alias: vec![], - alias_fields: vec![], - builtin_modules: false, - condition_names: vec![], - description_files: vec![], - enforce_extension: EnforceExtension::Disabled, - exports_fields: vec![], - extension_alias: vec![], - extensions: vec![], - fallback: vec![], - fully_specified: false, - imports_fields: vec![], - main_fields: vec![], - main_files: vec![], - modules: vec![], - prefer_absolute: false, - prefer_relative: false, - resolve_to_context: false, - restrictions: vec![], - roots: vec![], - symlinks: false, - tsconfig: None, - }; - - assert_eq!(format!("{options}"), ""); - } -} diff --git a/src/package_json.rs b/src/package_json.rs deleted file mode 100644 index 73901faa..00000000 --- a/src/package_json.rs +++ /dev/null @@ -1,207 +0,0 @@ -//! package.json definitions -//! -//! Code related to export field are copied from [Parcel's resolver](https://github.com/parcel-bundler/parcel/blob/v2/packages/utils/node-resolver-rs/src/package_json.rs) -use std::path::{Path, PathBuf}; - -use serde_json::Value as JSONValue; - -use crate::{path::PathUtil, ResolveError}; - -pub type JSONMap = serde_json::Map; - -/// Deserialized package.json -#[derive(Debug, Default)] -pub struct PackageJson { - /// Path to `package.json`. Contains the `package.json` filename. - pub path: PathBuf, - - /// Realpath to `package.json`. Contains the `package.json` filename. - pub realpath: PathBuf, - - /// The "name" field defines your package's name. - /// The "name" field can be used in addition to the "exports" field to self-reference a package using its name. - /// - /// - pub name: Option, - - raw_json: std::sync::Arc, -} - -impl PackageJson { - /// # Panics - /// # Errors - pub(crate) fn parse( - path: PathBuf, - realpath: PathBuf, - json: &str, - ) -> Result { - let mut raw_json: JSONValue = serde_json::from_str(json)?; - let mut package_json = Self::default(); - - if let Some(json_object) = raw_json.as_object_mut() { - // Remove large fields that are useless for pragmatic use. - #[cfg(feature = "package_json_raw_json_api")] - { - json_object.remove("description"); - json_object.remove("keywords"); - json_object.remove("scripts"); - json_object.remove("dependencies"); - json_object.remove("devDependencies"); - json_object.remove("peerDependencies"); - json_object.remove("optionalDependencies"); - } - - // Add name. - package_json.name = - json_object.get("name").and_then(|field| field.as_str()).map(ToString::to_string); - } - - package_json.path = path; - package_json.realpath = realpath; - package_json.raw_json = std::sync::Arc::new(raw_json); - Ok(package_json) - } - - fn get_value_by_path<'a>( - fields: &'a serde_json::Map, - path: &[String], - ) -> Option<&'a JSONValue> { - if path.is_empty() { - return None; - } - let mut value = fields.get(&path[0])?; - for key in path.iter().skip(1) { - if let Some(inner_value) = value.as_object().and_then(|o| o.get(key)) { - value = inner_value; - } else { - return None; - } - } - Some(value) - } - - /// Raw serde json value of `package.json`. - /// - /// This is currently used in Rspack for: - /// * getting the `sideEffects` field - /// * query in - search on GitHub indicates query on the `type` field. - /// - /// To reduce overall memory consumption, large fields that useless for pragmatic use are removed. - /// They are: `description`, `keywords`, `scripts`, - /// `dependencies` and `devDependencies`, `peerDependencies`, `optionalDependencies`. - #[cfg(feature = "package_json_raw_json_api")] - pub fn raw_json(&self) -> &std::sync::Arc { - &self.raw_json - } - - /// Directory to `package.json` - /// - /// # Panics - /// - /// * When the package.json path is misconfigured. - pub fn directory(&self) -> &Path { - debug_assert!(self.realpath.file_name().is_some_and(|x| x == "package.json")); - self.realpath.parent().unwrap() - } - - /// The "main" field defines the entry point of a package when imported by name via a node_modules lookup. Its value is a path. - /// - /// When a package has an "exports" field, this will take precedence over the "main" field when importing the package by name. - /// - /// Values are dynamically retrieved from [ResolveOptions::main_fields]. - /// - /// - pub(crate) fn main_fields<'a>( - &'a self, - main_fields: &'a [String], - ) -> impl Iterator + '_ { - main_fields - .iter() - .filter_map(|main_field| self.raw_json.get(main_field)) - .filter_map(|value| value.as_str()) - } - - /// The "exports" field allows defining the entry points of a package when imported by name loaded either via a node_modules lookup or a self-reference to its own name. - /// - /// - pub(crate) fn exports_fields<'a>( - &'a self, - exports_fields: &'a [Vec], - ) -> impl Iterator + '_ { - exports_fields.iter().filter_map(|object_path| { - self.raw_json - .as_object() - .and_then(|json_object| Self::get_value_by_path(json_object, object_path)) - }) - } - - /// In addition to the "exports" field, there is a package "imports" field to create private mappings that only apply to import specifiers from within the package itself. - /// - /// - pub(crate) fn imports_fields<'a>( - &'a self, - imports_fields: &'a [Vec], - ) -> impl Iterator + '_ { - imports_fields.iter().filter_map(|object_path| { - self.raw_json - .as_object() - .and_then(|json_object| Self::get_value_by_path(json_object, object_path)) - .and_then(|value| value.as_object()) - }) - } - - /// The "browser" field is provided by a module author as a hint to javascript bundlers or component tools when packaging modules for client side use. - /// Multiple values are configured by [ResolveOptions::alias_fields]. - /// - /// - fn browser_fields<'a>( - &'a self, - alias_fields: &'a [Vec], - ) -> impl Iterator + '_ { - alias_fields.iter().filter_map(|object_path| { - self.raw_json - .as_object() - .and_then(|json_object| Self::get_value_by_path(json_object, object_path)) - // Only object is valid, all other types are invalid - // https://github.com/webpack/enhanced-resolve/blob/3a28f47788de794d9da4d1702a3a583d8422cd48/lib/AliasFieldPlugin.js#L44-L52 - .and_then(|value| value.as_object()) - }) - } - - /// Resolve the request string for this package.json by looking at the `browser` field. - /// - /// # Errors - /// - /// * Returns [ResolveError::Ignored] for `"path": false` in `browser` field. - pub(crate) fn resolve_browser_field<'a>( - &'a self, - path: &Path, - request: Option<&str>, - alias_fields: &'a [Vec], - ) -> Result, ResolveError> { - for object in self.browser_fields(alias_fields) { - if let Some(request) = request { - if let Some(value) = object.get(request) { - return Self::alias_value(path, value); - } - } else { - let dir = self.path.parent().unwrap(); - for (key, value) in object { - let joined = dir.normalize_with(key); - if joined == path { - return Self::alias_value(path, value); - } - } - } - } - Ok(None) - } - - fn alias_value<'a>(key: &Path, value: &'a JSONValue) -> Result, ResolveError> { - match value { - JSONValue::String(value) => Ok(Some(value.as_str())), - JSONValue::Bool(b) if !b => Err(ResolveError::Ignored(key.to_path_buf())), - _ => Ok(None), - } - } -} diff --git a/src/path.rs b/src/path.rs deleted file mode 100644 index f66fdd76..00000000 --- a/src/path.rs +++ /dev/null @@ -1,132 +0,0 @@ -//! Path Utilities -//! -//! Code adapted from the following libraries -//! * [path-absolutize](https://docs.rs/path-absolutize) -//! * [normalize_path](https://docs.rs/normalize-path) -use std::path::{Component, Path, PathBuf}; - -pub const SLASH_START: &[char; 2] = &['/', '\\']; - -/// Extension trait to add path normalization to std's [`Path`]. -pub trait PathUtil { - /// Normalize this path without performing I/O. - /// - /// All redundant separator and up-level references are collapsed. - /// - /// However, this does not resolve links. - fn normalize(&self) -> PathBuf; - - /// Normalize with subpath assuming this path is normalized without performing I/O. - /// - /// All redundant separator and up-level references are collapsed. - /// - /// However, this does not resolve links. - fn normalize_with>(&self, subpath: P) -> PathBuf; - - /// Defined in ESM PACKAGE_TARGET_RESOLVE - /// If target split on "/" or "\" contains any "", ".", "..", or "node_modules" segments after the first "." segment, case insensitive and including percent encoded variants - fn is_invalid_exports_target(&self) -> bool; -} - -impl PathUtil for Path { - // https://github.com/parcel-bundler/parcel/blob/e0b99c2a42e9109a9ecbd6f537844a1b33e7faf5/packages/utils/node-resolver-rs/src/path.rs#L7 - fn normalize(&self) -> PathBuf { - let mut components = self.components().peekable(); - let mut ret = if let Some(c @ Component::Prefix(..)) = components.peek() { - let buf = PathBuf::from(c.as_os_str()); - components.next(); - buf - } else { - PathBuf::new() - }; - - for component in components { - match component { - Component::Prefix(..) => unreachable!("Path {:?}", self), - Component::RootDir => { - ret.push(component.as_os_str()); - } - Component::CurDir => {} - Component::ParentDir => { - ret.pop(); - } - Component::Normal(c) => { - ret.push(c); - } - } - } - - ret - } - - // https://github.com/parcel-bundler/parcel/blob/e0b99c2a42e9109a9ecbd6f537844a1b33e7faf5/packages/utils/node-resolver-rs/src/path.rs#L37 - fn normalize_with>(&self, subpath: B) -> PathBuf { - let subpath = subpath.as_ref(); - - let mut components = subpath.components(); - - let Some(head) = components.next() else { return subpath.to_path_buf() }; - - if matches!(head, Component::Prefix(..) | Component::RootDir) { - return subpath.to_path_buf(); - } - - let mut ret = self.to_path_buf(); - for component in std::iter::once(head).chain(components) { - match component { - Component::CurDir => {} - Component::ParentDir => { - ret.pop(); - } - Component::Normal(c) => { - ret.push(c); - } - Component::Prefix(..) | Component::RootDir => { - unreachable!("Path {:?} Subpath {:?}", self, subpath) - } - } - } - - ret - } - - fn is_invalid_exports_target(&self) -> bool { - self.components().enumerate().any(|(index, c)| match c { - Component::ParentDir => true, - Component::CurDir => index > 0, - Component::Normal(c) => c.eq_ignore_ascii_case("node_modules"), - _ => false, - }) - } -} - -// https://github.com/webpack/enhanced-resolve/blob/main/test/path.test.js -#[test] -fn is_invalid_exports_target() { - let test_cases = [ - "../a.js", - "../", - "./a/b/../../../c.js", - "./a/b/../../../", - "./../../c.js", - "./../../", - "./a/../b/../../c.js", - "./a/../b/../../", - "./././../", - ]; - - for case in test_cases { - assert!(Path::new(case).is_invalid_exports_target(), "{case}"); - } - - assert!(!Path::new("C:").is_invalid_exports_target()); - assert!(!Path::new("/").is_invalid_exports_target()); -} - -#[test] -fn normalize() { - assert_eq!(Path::new("/foo/.././foo/").normalize(), Path::new("/foo")); - assert_eq!(Path::new("C://").normalize(), Path::new("C://")); - assert_eq!(Path::new("C:").normalize(), Path::new("C:")); - assert_eq!(Path::new(r"\\server\share").normalize(), Path::new(r"\\server\share")); -} diff --git a/src/resolution.rs b/src/resolution.rs deleted file mode 100644 index a3aaa2e7..00000000 --- a/src/resolution.rs +++ /dev/null @@ -1,92 +0,0 @@ -use crate::package_json::PackageJson; -use std::{ - fmt, - path::{Path, PathBuf}, - sync::Arc, -}; - -/// The final path resolution with optional `?query` and `#fragment` -#[derive(Clone)] -pub struct Resolution { - pub(crate) path: PathBuf, - - /// path query `?query`, contains `?`. - pub(crate) query: Option, - - /// path fragment `#query`, contains `#`. - pub(crate) fragment: Option, - - pub(crate) package_json: Option>, -} - -impl fmt::Debug for Resolution { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - f.debug_struct("Resolution") - .field("path", &self.path) - .field("query", &self.query) - .field("fragment", &self.fragment) - .field("package_json", &self.package_json.as_ref().map(|p| &p.path)) - .finish() - } -} - -impl PartialEq for Resolution { - fn eq(&self, other: &Self) -> bool { - self.path == other.path && self.query == other.query && self.fragment == other.fragment - } -} -impl Eq for Resolution {} - -impl Resolution { - /// Returns the path without query and fragment - pub fn path(&self) -> &Path { - &self.path - } - - /// Returns the path without query and fragment - pub fn into_path_buf(self) -> PathBuf { - self.path - } - - /// Returns the path query `?query`, contains the leading `?` - pub fn query(&self) -> Option<&str> { - self.query.as_deref() - } - - /// Returns the path fragment `#fragment`, contains the leading `#` - pub fn fragment(&self) -> Option<&str> { - self.fragment.as_deref() - } - - /// Returns serialized package_json - pub fn package_json(&self) -> Option<&Arc> { - self.package_json.as_ref() - } - - /// Returns the full path with query and fragment - pub fn full_path(&self) -> PathBuf { - let mut path = self.path.clone().into_os_string(); - if let Some(query) = &self.query { - path.push(query); - } - if let Some(fragment) = &self.fragment { - path.push(fragment); - } - PathBuf::from(path) - } -} - -#[test] -fn test() { - let resolution = Resolution { - path: PathBuf::from("foo"), - query: Some("?query".to_string()), - fragment: Some("#fragment".to_string()), - package_json: None, - }; - assert_eq!(resolution.path(), Path::new("foo")); - assert_eq!(resolution.query(), Some("?query")); - assert_eq!(resolution.fragment(), Some("#fragment")); - assert_eq!(resolution.full_path(), PathBuf::from("foo?query#fragment")); - assert_eq!(resolution.into_path_buf(), PathBuf::from("foo")); -} diff --git a/src/specifier.rs b/src/specifier.rs deleted file mode 100644 index 3d35eafc..00000000 --- a/src/specifier.rs +++ /dev/null @@ -1,230 +0,0 @@ -use crate::error::SpecifierError; -use std::borrow::Cow; - -#[derive(Debug)] -pub struct Specifier<'a> { - path: Cow<'a, str>, - pub query: Option<&'a str>, - pub fragment: Option<&'a str>, -} - -impl<'a> Specifier<'a> { - pub fn path(&'a self) -> &'a str { - self.path.as_ref() - } - - pub fn parse(specifier: &'a str) -> Result, SpecifierError> { - if specifier.is_empty() { - return Err(SpecifierError::Empty(specifier.to_string())); - } - let offset = match specifier.as_bytes()[0] { - b'/' | b'.' | b'#' => 1, - _ => 0, - }; - let (path, query, fragment) = Self::parse_query_framgment(specifier, offset); - if path.is_empty() { - return Err(SpecifierError::Empty(specifier.to_string())); - } - Ok(Self { path, query, fragment }) - } - - fn parse_query_framgment( - specifier: &'a str, - skip: usize, - ) -> (Cow<'a, str>, Option<&str>, Option<&str>) { - let mut query_start: Option = None; - let mut fragment_start: Option = None; - - let mut prev = specifier.chars().next().unwrap(); - let mut escaped_indexes = vec![]; - for (i, c) in specifier.char_indices().skip(skip) { - if c == '?' && query_start.is_none() { - query_start = Some(i); - } - if c == '#' { - if prev == '\0' { - escaped_indexes.push(i - 1); - } else { - fragment_start = Some(i); - break; - } - } - prev = c; - } - - let (path, query, fragment) = match (query_start, fragment_start) { - (Some(i), Some(j)) => { - debug_assert!(i < j); - (&specifier[..i], Some(&specifier[i..j]), Some(&specifier[j..])) - } - (Some(i), None) => (&specifier[..i], Some(&specifier[i..]), None), - (None, Some(j)) => (&specifier[..j], None, Some(&specifier[j..])), - _ => (specifier, None, None), - }; - - let path = if escaped_indexes.is_empty() { - Cow::Borrowed(path) - } else { - // Remove the `\0` characters for a legal path. - Cow::Owned( - path.chars() - .enumerate() - .filter_map(|(i, c)| (!escaped_indexes.contains(&i)).then_some(c)) - .collect::(), - ) - }; - - (path, query, fragment) - } -} - -#[cfg(test)] -mod tests { - use super::{Specifier, SpecifierError}; - - #[test] - fn debug() { - let specifier = Specifier::parse("/").unwrap(); - assert_eq!( - format!("{specifier:?}"), - r#"Specifier { path: "/", query: None, fragment: None }"# - ); - } - - #[test] - fn empty() { - let specifiers = ["", "?"]; - for specifier in specifiers { - let error = Specifier::parse(specifier).unwrap_err(); - assert_eq!(error, SpecifierError::Empty(specifier.to_string())); - } - } - - #[test] - fn absolute() -> Result<(), SpecifierError> { - let specifier = "/test?#"; - let parsed = Specifier::parse(specifier)?; - assert_eq!(parsed.path, "/test"); - assert_eq!(parsed.query, Some("?")); - assert_eq!(parsed.fragment, Some("#")); - Ok(()) - } - - #[test] - fn relative() -> Result<(), SpecifierError> { - let specifiers = ["./test", "../test", "../../test"]; - for specifier in specifiers { - let mut r = specifier.to_string(); - r.push_str("?#"); - let parsed = Specifier::parse(&r)?; - assert_eq!(parsed.path, specifier); - assert_eq!(parsed.query, Some("?")); - assert_eq!(parsed.fragment, Some("#")); - } - Ok(()) - } - - #[test] - fn hash() -> Result<(), SpecifierError> { - let specifiers = ["#", "#path"]; - for specifier in specifiers { - let mut r = specifier.to_string(); - r.push_str("?#"); - let parsed = Specifier::parse(&r)?; - assert_eq!(parsed.path, specifier); - assert_eq!(parsed.query, Some("?")); - assert_eq!(parsed.fragment, Some("#")); - } - Ok(()) - } - - #[test] - fn module() -> Result<(), SpecifierError> { - let specifiers = ["module"]; - for specifier in specifiers { - let mut r = specifier.to_string(); - r.push_str("?#"); - let parsed = Specifier::parse(&r)?; - assert_eq!(parsed.path, specifier); - assert_eq!(parsed.query, Some("?")); - assert_eq!(parsed.fragment, Some("#")); - } - Ok(()) - } - - #[test] - fn query_fragment() -> Result<(), SpecifierError> { - let data = [ - ("a?", Some("?"), None), - ("a?query", Some("?query"), None), - ("a?query1?query2", Some("?query1?query2"), None), - ("a?query1?query2?query3", Some("?query1?query2?query3"), None), - ("a#", None, Some("#")), - ("a#b#c", None, Some("#b#c")), - ("a#fragment", None, Some("#fragment")), - ("a?#", Some("?"), Some("#")), - ("a?#fragment", Some("?"), Some("#fragment")), - ("a?query#", Some("?query"), Some("#")), - ("a?query#fragment", Some("?query"), Some("#fragment")), - ("a#fragment?", None, Some("#fragment?")), - ("a#fragment?query", None, Some("#fragment?query")), - ]; - - for (specifier_str, query, fragment) in data { - let specifier = Specifier::parse(specifier_str)?; - assert_eq!(specifier.path, "a", "{specifier_str}"); - assert_eq!(specifier.query, query, "{specifier_str}"); - assert_eq!(specifier.fragment, fragment, "{specifier_str}"); - } - - Ok(()) - } - - #[test] - // https://github.com/webpack/enhanced-resolve/blob/main/test/identifier.test.js - fn enhanced_resolve_edge_cases() -> Result<(), SpecifierError> { - let data = [ - ("path/#", "path/", "", "#"), - ("path/as/?", "path/as/", "?", ""), - ("path/#/?", "path/", "", "#/?"), - ("path/#repo#hash", "path/", "", "#repo#hash"), - ("path/#r#hash", "path/", "", "#r#hash"), - ("path/#repo/#repo2#hash", "path/", "", "#repo/#repo2#hash"), - ("path/#r/#r#hash", "path/", "", "#r/#r#hash"), - ("path/#/not/a/hash?not-a-query", "path/", "", "#/not/a/hash?not-a-query"), - ]; - - for (specifier_str, path, query, fragment) in data { - let specifier = Specifier::parse(specifier_str)?; - assert_eq!(specifier.path, path, "{specifier_str}"); - assert_eq!(specifier.query.unwrap_or(""), query, "{specifier_str}"); - assert_eq!(specifier.fragment.unwrap_or(""), fragment, "{specifier_str}"); - } - - Ok(()) - } - - // https://github.com/webpack/enhanced-resolve/blob/main/test/identifier.test.js - #[test] - fn enhanced_resolve_windows_like() -> Result<(), SpecifierError> { - let data = [ - ("path\\#", "path\\", "", "#"), - ("path\\as\\?", "path\\as\\", "?", ""), - ("path\\#\\?", "path\\", "", "#\\?"), - ("path\\#repo#hash", "path\\", "", "#repo#hash"), - ("path\\#r#hash", "path\\", "", "#r#hash"), - ("path\\#repo\\#repo2#hash", "path\\", "", "#repo\\#repo2#hash"), - ("path\\#r\\#r#hash", "path\\", "", "#r\\#r#hash"), - ("path\\#/not/a/hash?not-a-query", "path\\", "", "#/not/a/hash?not-a-query"), - ]; - - for (specifier_str, path, query, fragment) in data { - let specifier = Specifier::parse(specifier_str)?; - assert_eq!(specifier.path, path, "{specifier_str}"); - assert_eq!(specifier.query.unwrap_or(""), query, "{specifier_str}"); - assert_eq!(specifier.fragment.unwrap_or(""), fragment, "{specifier_str}"); - } - - Ok(()) - } -} diff --git a/src/tests/alias.rs b/src/tests/alias.rs deleted file mode 100644 index 07c615f4..00000000 --- a/src/tests/alias.rs +++ /dev/null @@ -1,280 +0,0 @@ -//! - -use normalize_path::NormalizePath; -use std::path::Path; - -use crate::{AliasValue, Resolution, ResolveContext, ResolveError, ResolveOptions, Resolver}; - -#[test] -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -fn alias() { - use super::memory_fs::MemoryFS; - use crate::ResolverGeneric; - use std::path::{Path, PathBuf}; - - let f = Path::new("/"); - - let file_system = MemoryFS::new(&[ - ("/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", ""), - ("/dashed-name", ""), - ]); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - alias: vec![ - ("aliasA".into(), vec![AliasValue::from("a")]), - ("b$".into(), vec![AliasValue::from("a/index")]), - ("c$".into(), vec![AliasValue::from("/a/index")]), - ( - "multiAlias".into(), - vec![ - AliasValue::from("b"), - AliasValue::from("c"), - AliasValue::from("d"), - AliasValue::from("e"), - AliasValue::from("a"), - ], - ), - ("recursive".into(), vec![AliasValue::from("recursive/dir")]), - ("/d/dir".into(), vec![AliasValue::from("/c/dir")]), - ("/d/index.js".into(), vec![AliasValue::from("/c/index")]), - ("#".into(), vec![AliasValue::from("/c/dir")]), - ("@".into(), vec![AliasValue::from("/c/dir")]), - ("ignored".into(), vec![AliasValue::Ignore]), - // not part of enhanced-resolve, added to make sure query in alias value works - ("alias_query".into(), vec![AliasValue::from("a?query_after")]), - ("alias_fragment".into(), vec![AliasValue::from("a#fragment_after")]), - ("dash".into(), vec![AliasValue::Ignore]), - ("@scope/package-name/file$".into(), vec![AliasValue::from("/c/dir")]), - ], - modules: vec!["/".into()], - ..ResolveOptions::default() - }, - ); - - #[rustfmt::skip] - let pass = [ - ("should resolve a not aliased module 1", "a", "/a/index"), - ("should resolve a not aliased module 2", "a/index", "/a/index"), - ("should resolve a not aliased module 3", "a/dir", "/a/dir/index"), - ("should resolve a not aliased module 4", "a/dir/index", "/a/dir/index"), - ("should resolve an aliased module 1", "aliasA", "/a/index"), - ("should resolve an aliased module 2", "aliasA/index", "/a/index"), - ("should resolve an aliased module 3", "aliasA/dir", "/a/dir/index"), - ("should resolve an aliased module 4", "aliasA/dir/index", "/a/dir/index"), - ("should resolve '#' alias 1", "#", "/c/dir/index"), - ("should resolve '#' alias 2", "#/index", "/c/dir/index"), - ("should resolve '@' alias 1", "@", "/c/dir/index"), - ("should resolve '@' alias 2", "@/index", "/c/dir/index"), - ("should resolve a recursive aliased module 1", "recursive", "/recursive/dir/index"), - ("should resolve a recursive aliased module 2", "recursive/index", "/recursive/dir/index"), - ("should resolve a recursive aliased module 3", "recursive/dir", "/recursive/dir/index"), - ("should resolve a recursive aliased module 4", "recursive/dir/index", "/recursive/dir/index"), - ("should resolve a file aliased module 1", "b", "/a/index"), - ("should resolve a file aliased module 2", "c", "/a/index"), - ("should resolve a file aliased module with a query 1", "b?query", "/a/index?query"), - ("should resolve a file aliased module with a query 2", "c?query", "/a/index?query"), - ("should resolve a path in a file aliased module 1", "b/index", "/b/index"), - ("should resolve a path in a file aliased module 2", "b/dir", "/b/dir/index"), - ("should resolve a path in a file aliased module 3", "b/dir/index", "/b/dir/index"), - ("should resolve a path in a file aliased module 4", "c/index", "/c/index"), - ("should resolve a path in a file aliased module 5", "c/dir", "/c/dir/index"), - ("should resolve a path in a file aliased module 6", "c/dir/index", "/c/dir/index"), - ("should resolve a file aliased file 1", "d", "/c/index"), - ("should resolve a file aliased file 2", "d/dir/index", "/c/dir/index"), - ("should resolve a file in multiple aliased dirs 1", "multiAlias/dir/file", "/e/dir/file"), - ("should resolve a file in multiple aliased dirs 2", "multiAlias/anotherDir", "/e/anotherDir/index"), - // not part of enhanced-resolve, added to make sure query in alias value works - ("should resolve query in alias value", "alias_query?query_before", "/a/index?query_after"), - ("should resolve query in alias value", "alias_fragment#fragment_before", "/a/index#fragment_after"), - ("should resolve dashed name", "dashed-name", "/dashed-name"), - ("should resolve scoped package name with sub dir", "@scope/package-name/file", "/c/dir/index"), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - - #[rustfmt::skip] - let ignore = [ - ("should resolve an ignore module", "ignored", ResolveError::Ignored(f.join("ignored"))) - ]; - - for (comment, request, expected) in ignore { - let resolution = resolver.resolve(f, request); - assert_eq!(resolution, Err(expected), "{comment} {request}"); - } -} - -// Not part of enhanced-resolve -#[test] -fn infinite_recursion() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![ - ("./a".into(), vec![AliasValue::from("./b")]), - ("./b".into(), vec![AliasValue::from("./a")]), - ], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(f, "./a"); - assert_eq!(resolution, Err(ResolveError::Recursion)); -} - -fn check_slash(path: &Path) { - let s = path.to_string_lossy().to_string(); - #[cfg(target_os = "windows")] - { - assert!(!s.contains('/'), "{s}"); - assert!(s.contains('\\'), "{s}"); - } - #[cfg(not(target_os = "windows"))] - { - assert!(s.contains('/'), "{s}"); - assert!(!s.contains('\\'), "{s}"); - } -} - -#[test] -fn absolute_path() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![(f.join("foo").to_str().unwrap().to_string(), vec![AliasValue::Ignore])], - modules: vec![f.clone().to_str().unwrap().to_string()], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(&f, "foo/index"); - assert_eq!(resolution, Err(ResolveError::Ignored(f.join("foo")))); -} - -#[test] -fn system_path() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![("@app".into(), vec![AliasValue::from(f.join("alias").to_string_lossy())])], - ..ResolveOptions::default() - }); - - let specifiers = ["@app/files/a", "@app/files/a.js"]; - - for specifier in specifiers { - let path = resolver.resolve(&f, specifier).map(Resolution::into_path_buf).unwrap(); - assert_eq!(path, f.join("alias/files/a.js")); - check_slash(&path); - } -} - -#[test] -fn alias_is_full_path() { - let f = super::fixture(); - let dir = f.join("foo"); - let dir_str = dir.to_string_lossy().to_string(); - - let resolver = Resolver::new(ResolveOptions { - alias: vec![("@".into(), vec![AliasValue::Path(dir_str.clone())])], - ..ResolveOptions::default() - }); - - let mut ctx = ResolveContext::default(); - - let specifiers = [ - "@/index".to_string(), - "@/index.js".to_string(), - // specifier has multiple `/` for reasons we'll never know - "@////index".to_string(), - // specifier is a full path - dir_str, - ]; - - for specifier in specifiers { - let resolution = resolver.resolve_with_context(&f, &specifier, &mut ctx); - assert_eq!(resolution.map(|r| r.full_path()), Ok(dir.join("index.js"))); - } - - for path in ctx.file_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - check_slash(&path); - } - - for path in ctx.missing_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - check_slash(&path); - if let Some(path) = path.parent() { - assert!(!path.is_file(), "{path:?} must not be a file"); - } - } -} - -// For the `should_stop` variable in `load_alias` -#[test] -fn all_alias_values_are_not_found() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![( - "m1".to_string(), - vec![AliasValue::Path(f.join("node_modules").join("m2").to_string_lossy().to_string())], - )], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(&f, "m1/a.js"); - assert_eq!(resolution, Err(ResolveError::NotFound("m1/a.js".to_string()))); -} - -#[test] -fn alias_fragment() { - let f = super::fixture(); - - let data = [ - // enhanced-resolve has `#` prepended with a `\0`, they are removed from the - // following 3 expected test results. - // See https://github.com/webpack/enhanced-resolve#escaping - ( - "handle fragment edge case (no fragment)", - "./no#fragment/#/#", - f.join("no#fragment/#/#.js"), - ), - ("handle fragment edge case (fragment)", "./no#fragment/#/", f.join("no.js#fragment/#/")), - ( - "handle fragment escaping", - "./no\0#fragment/\0#/\0##fragment", - f.join("no#fragment/#/#.js#fragment"), - ), - ]; - - for (comment, request, expected) in data { - let resolver = Resolver::new(ResolveOptions { - alias: vec![("foo".to_string(), vec![AliasValue::Path(request.to_string())])], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f, "foo").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } -} - -#[test] -fn alias_try_fragment_as_path() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![( - "#".to_string(), - vec![AliasValue::Path(f.join("#").to_string_lossy().to_string())], - )], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(&f, "#/a").map(|r| r.full_path()); - assert_eq!(resolution, Ok(f.join("#").join("a.js"))); -} diff --git a/src/tests/browser_field.rs b/src/tests/browser_field.rs deleted file mode 100644 index 171ee099..00000000 --- a/src/tests/browser_field.rs +++ /dev/null @@ -1,189 +0,0 @@ -//! - -use crate::{AliasValue, ResolveError, ResolveOptions, Resolver}; - -#[test] -fn ignore() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![ - vec!["browser".into()], - vec!["innerBrowser1".into()], - vec!["innerBrowser2".into()], - vec![], - ], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - (f.clone(), "./lib/ignore", f.join("lib/ignore.js")), - (f.clone(), "./lib/ignore.js", f.join("lib/ignore.js")), - (f.join("lib"), "./ignore", f.join("lib/ignore.js")), - (f.join("lib"), "./ignore.js", f.join("lib/ignore.js")), - ]; - - for (path, request, expected) in data { - let resolution = resolver.resolve(&path, request); - let expected = ResolveError::Ignored(expected); - assert_eq!(resolution, Err(expected), "{path:?} {request}"); - } -} - -#[test] -fn shared_resolvers() { - let f = super::fixture().join("browser-module"); - - let resolver1 = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["innerBrowser1".into(), "field".into(), "browser".into()]], - ..ResolveOptions::default() - }); - let resolved_path = resolver1.resolve(&f, "./lib/main1.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("lib/main.js"))); - - let resolver2 = resolver1.clone_with_options(ResolveOptions { - alias_fields: vec![vec!["innerBrowser2".into(), "browser".into()]], - ..ResolveOptions::default() - }); - let resolved_path = resolver2.resolve(&f, "./lib/main2.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("./lib/replaced.js"))); -} - -#[test] -fn replace_file() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![ - vec!["browser".into()], - vec!["innerBrowser1".into(), "field2".into(), "browser".into()], // not presented - vec!["innerBrowser1".into(), "field".into(), "browser".into()], - vec!["innerBrowser2".into(), "browser".into()], - ], - // Not part of enhanced-resolve. Added to make sure no interaction between these two fields. - main_fields: vec!["browser".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - ("should replace a file 1", f.clone(), "./lib/replaced", f.join("lib/browser.js")), - ("should replace a file 2", f.clone(), "./lib/replaced.js", f.join("lib/browser.js")), - ("should replace a file 3", f.join("lib"), "./replaced", f.join("lib/browser.js")), - ("should replace a file 4", f.join("lib"), "./replaced.js", f.join("lib/browser.js")), - ("should replace a module with a file 1", f.clone(), "module-a", f.join("browser/module-a.js")), - ("should replace a module with a file 2", f.join("lib"), "module-a", f.join("browser/module-a.js")), - ("should replace a module with a module 1", f.clone(), "module-b", f.join("node_modules/module-c.js")), - ("should replace a module with a module 2", f.join("lib"), "module-b", f.join("node_modules/module-c.js")), - ("should resolve in nested property 1", f.clone(), "./lib/main1.js", f.join("lib/main.js")), - ("should resolve in nested property 2", f.clone(), "./lib/main2.js", f.join("lib/browser.js")), - ("should check only alias field properties", f.clone(), "./toString", f.join("lib/toString.js")), - // not part of enhanced-resolve - ("recursion", f.clone(), "module-c", f.join("node_modules/module-c.js")), - ("resolve self 1", f.clone(), "./lib/main.js", f.join("lib/main.js")), - ("resolve self 2", f.clone(), "./main.js", f.join("lib/main.js")), - ]; - - for (comment, path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn recurse_fail() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - ("recurse non existent", f.clone(), "./lib/non-existent.js", ResolveError::NotFound("./lib/non-existent.js".into())), - ("path partial match 1", f.clone(), "./xyz.js", ResolveError::NotFound("./xyz.js".into())), - ("path partial match 2", f, "./lib/xyz.js", ResolveError::NotFound("./lib/xyz.js".into())), - ]; - - for (comment, path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Err(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn broken() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - // The browser field string value should be ignored - (f.clone(), "browser-module-broken", Ok(f.join("node_modules/browser-module-broken/main.js"))), - (f.join("browser-module"), "./number", Err(ResolveError::NotFound("./number".into()))), - ]; - - for (path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, expected, "{path:?} {request}"); - } -} - -#[test] -fn crypto_js() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - fallback: vec![( - "crypto".into(), - vec![AliasValue::from(f.join("lib.js").to_string_lossy())], - )], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(f.join("crypto-js"), "crypto").map(|r| r.full_path()); - assert_eq!(resolved_path, Err(ResolveError::Ignored(f.join("crypto-js")))); -} - -// https://github.com/webpack/webpack/blob/87660921808566ef3b8796f8df61bd79fc026108/test/cases/resolving/browser-field/index.js#L40-L43 -#[test] -fn recursive() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - let data = [ - ("should handle recursive file 1", f.clone(), "recursive-file/a"), - ("should handle recursive file 2", f.clone(), "recursive-file/b"), - ("should handle recursive file 3", f.clone(), "recursive-file/c"), - ("should handle recursive file 4", f, "recursive-file/d"), - ]; - - for (comment, path, request) in data { - let resolved_path = resolver.resolve(&path, request); - assert_eq!(resolved_path, Err(ResolveError::Recursion), "{comment} {path:?} {request}"); - } -} - -#[test] -fn with_query() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "./foo").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("lib").join("browser.js?query"))); -} diff --git a/src/tests/builtins.rs b/src/tests/builtins.rs deleted file mode 100644 index 5d6d14d9..00000000 --- a/src/tests/builtins.rs +++ /dev/null @@ -1,121 +0,0 @@ -use std::path::Path; - -use crate::{ResolveError, ResolveOptions, Resolver}; - -#[test] -fn builtins_off() { - let f = Path::new("/"); - let resolver = Resolver::default(); - let resolved_path = resolver.resolve(f, "zlib").map(|r| r.full_path()); - assert_eq!(resolved_path, Err(ResolveError::NotFound("zlib".into()))); -} - -#[test] -fn builtins() { - let f = Path::new("/"); - - let resolver = Resolver::new(ResolveOptions::default().with_builtin_modules(true)); - - let pass = [ - "_http_agent", - "_http_client", - "_http_common", - "_http_incoming", - "_http_outgoing", - "_http_server", - "_stream_duplex", - "_stream_passthrough", - "_stream_readable", - "_stream_transform", - "_stream_wrap", - "_stream_writable", - "_tls_common", - "_tls_wrap", - "assert", - "assert/strict", - "async_hooks", - "buffer", - "child_process", - "cluster", - "console", - "constants", - "crypto", - "dgram", - "diagnostics_channel", - "dns", - "dns/promises", - "domain", - "events", - "fs", - "fs/promises", - "http", - "http2", - "https", - "inspector", - "module", - "net", - "os", - "path", - "path/posix", - "path/win32", - "perf_hooks", - "process", - "punycode", - "querystring", - "readline", - "repl", - "stream", - "stream/consumers", - "stream/promises", - "stream/web", - "string_decoder", - "sys", - "timers", - "timers/promises", - "tls", - "trace_events", - "tty", - "url", - "util", - "util/types", - "v8", - "vm", - "worker_threads", - "zlib", - ]; - - for request in pass { - let prefixed_request = format!("node:{request}"); - for request in [prefixed_request.clone(), request.to_string()] { - let resolved_path = resolver.resolve(f, &request).map(|r| r.full_path()); - let err = ResolveError::Builtin(prefixed_request.clone()); - assert_eq!(resolved_path, Err(err), "{request}"); - } - } -} - -#[test] -fn fail() { - let f = Path::new("/"); - let resolver = Resolver::new(ResolveOptions::default().with_builtin_modules(true)); - let request = "xxx"; - let resolved_path = resolver.resolve(f, request); - let err = ResolveError::NotFound(request.to_string()); - assert_eq!(resolved_path, Err(err), "{request}"); -} - -#[test] -fn imports() { - let f = super::fixture().join("builtins"); - let resolver = Resolver::new(ResolveOptions { - builtin_modules: true, - condition_names: vec!["node".into()], - ..ResolveOptions::default() - }); - - for request in ["#fs", "#http"] { - let resolved_path = resolver.resolve(f.clone(), request).map(|r| r.full_path()); - let err = ResolveError::Builtin(format!("node:{}", request.trim_start_matches('#'))); - assert_eq!(resolved_path, Err(err)); - } -} diff --git a/src/tests/dependencies.rs b/src/tests/dependencies.rs deleted file mode 100644 index bcc2355b..00000000 --- a/src/tests/dependencies.rs +++ /dev/null @@ -1,110 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/dependencies.test.js - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows { - use rustc_hash::FxHashSet; - use std::path::PathBuf; - - use crate::{ResolveContext, ResolveOptions, ResolverGeneric}; - - use super::super::memory_fs::MemoryFS; - - fn file_system() -> MemoryFS { - MemoryFS::new(&[ - ("/a/b/node_modules/some-module/index.js", ""), - ("/a/node_modules/module/package.json", r#"{"main":"entry.js"}"#), - ("/a/node_modules/module/file.js", r#"{"main":"entry.js"}"#), - ("/modules/other-module/file.js", ""), - ]) - } - - #[test] - fn test() { - let file_system = file_system(); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - extensions: vec![".json".into(), ".js".into()], - modules: vec!["/modules".into(), "node_modules".into()], - ..ResolveOptions::default() - }, - ); - - let data = [ - ( - "middle module request", - "/a/b/c", - "module/file", - "/a/node_modules/module/file.js", - // These dependencies are different from enhanced-resolve due to different code path to - // querying the file system - vec![ - // 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", - // "/", - ], - vec![ - // missing package.jsons - // "/a/b/c/package.json", - "/a/b/package.json", - "/a/package.json", - "/package.json", - // missing modules directories - "/a/b/c", - // "/a/b/c/node_modules", - // missing single file modules - "/modules/module", - "/a/b/node_modules/module", - // missing files with alternative extensions - "/a/node_modules/module/file", - "/a/node_modules/module/file.json", - ], - ), - ( - "fast found module", - "/a/b/c", - "other-module/file.js", - "/modules/other-module/file.js", - // These dependencies are different from enhanced-resolve due to different code path to - // querying the file system - vec![ - // symlink checks - "/modules/other-module/file.js", - // "/modules/other-module", - // "/modules", - // "/", - ], - vec![ - // missing package.jsons - // "/a/b/c/package.json", - "/a/b/c", - "/a/b/package.json", - "/a/package.json", - "/package.json", - "/modules/other-module/package.json", - "/modules/package.json", - ], - ), - ]; - - for (name, context, request, result, file_dependencies, missing_dependencies) in data { - let mut ctx = ResolveContext::default(); - let path = PathBuf::from(context); - let resolved = - resolver.resolve_with_context(path, request, &mut ctx).map(|r| r.full_path()); - assert_eq!(resolved, Ok(PathBuf::from(result))); - let file_dependencies = - FxHashSet::from_iter(file_dependencies.iter().map(PathBuf::from)); - let missing_dependencies = - FxHashSet::from_iter(missing_dependencies.iter().map(PathBuf::from)); - assert_eq!(ctx.file_dependencies, file_dependencies, "{name}"); - assert_eq!(ctx.missing_dependencies, missing_dependencies, "{name}"); - } - } -} diff --git a/src/tests/exports_field.rs b/src/tests/exports_field.rs deleted file mode 100644 index fd68c1f7..00000000 --- a/src/tests/exports_field.rs +++ /dev/null @@ -1,2546 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/exportsField.test.js -//! -//! The huge exports field test cases are at the bottom of this file. - -use crate::{Ctx, PathUtil, ResolveError, ResolveOptions, Resolver}; -use serde_json::json; -use std::path::Path; - -#[test] -fn test_simple() { - let f = super::fixture().join("exports-field"); - let f2 = super::fixture().join("exports-field2"); - let f4 = super::fixture().join("exports-field-error"); - let f5 = super::fixture().join("imports-exports-wildcard"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - fully_specified: true, - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("resolve root using exports field, not a main field", f.clone(), "exports-field", f.join("node_modules/exports-field/x.js")), - ("resolver should respect condition names", f.clone(), "exports-field/dist/main.js", f.join("node_modules/exports-field/lib/lib2/main.js")), - // enhanced_resolve behaves differently to node.js. enhanced_resolve fallbacks when an - // array item is unresolved, where as node.js fallbacks when an array has an - // InvalidPackageTarget error. - // ("resolver should respect fallback", f2.clone(), "exports-field/dist/browser.js", f2.join("node_modules/exports-field/lib/browser.js")), - // The following two tests require fallback from array values, the path is changed here to - // only test query and fragment. - ("resolver should respect query parameters #1", f2.clone(), "exports-field/dist/main.js?foo", f2.join("node_modules/exports-field/lib/lib2/main.js?foo")), - ("resolver should respect fragment parameters #1", f2.clone(), "exports-field/dist/main.js#foo", f2.join("node_modules/exports-field/lib/lib2/main.js#foo")), - ("relative path should work, if relative path as request is used", f.clone(), "./node_modules/exports-field/lib/main.js", f.join("node_modules/exports-field/lib/main.js")), - ("self-resolving root", f.clone(), "@exports-field/core", f.join("a.js")), - ("should resolve with wildcard pattern #1", f5.clone(), "m/features/f.js", f5.join("node_modules/m/src/features/f.js")), - ("should resolve with wildcard pattern #2", f5.clone(), "m/features/y/y.js", f5.join("node_modules/m/src/features/y/y.js")), - ("should resolve with wildcard pattern #3", f5.clone(), "m/features-no-ext/y/y.js", f5.join("node_modules/m/src/features/y/y.js")), - ("should resolve with wildcard pattern #4", f5.clone(), "m/middle/nested/f.js", f5.join("node_modules/m/src/middle/nested/f.js")), - ("should resolve with wildcard pattern #5", f5.clone(), "m/middle-1/nested/f.js", f5.join("node_modules/m/src/middle-1/nested/f.js")), - ("should resolve with wildcard pattern #6", f5.clone(), "m/middle-2/nested/f.js", f5.join("node_modules/m/src/middle-2/nested/f.js")), - ("should resolve with wildcard pattern #7", f5.clone(), "m/middle-3/nested/f", f5.join("node_modules/m/src/middle-3/nested/f/nested/f.js")), - ("should resolve with wildcard pattern #8", f5.clone(), "m/middle-4/f/nested", f5.join("node_modules/m/src/middle-4/f/f.js")), - ("should resolve with wildcard pattern #9", f5.clone(), "m/middle-5/f$/$", f5.join("node_modules/m/src/middle-5/f$/$.js")), - ]; - - // Not needed or snapshot: - // * should log the correct info - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } - - let p = f.join("node_modules/exports-field/package.json"); - let p2 = f2.join("node_modules/exports-field/package.json"); - let p4 = f4.join("node_modules/exports-field/package.json"); - let p5 = f5.join("node_modules/m/package.json"); - - #[rustfmt::skip] - let fail = [ - // ("throw error if extension not provided", f2.clone(), "exports-field/dist/main", ResolveError::NotFound(f2.join("node_modules/exports-field/lib/lib2/main"))), - ("resolver should respect query parameters #2. Direct matching", f2.clone(), "exports-field?foo", ResolveError::PackagePathNotExported("./?foo".into(), p2.clone())), - ("resolver should respect fragment parameters #2. Direct matching", f2, "exports-field#foo", ResolveError::PackagePathNotExported("./#foo".into(), p2)), - ("relative path should not work with exports field", f.clone(), "./node_modules/exports-field/dist/main.js", ResolveError::NotFound("./node_modules/exports-field/dist/main.js".into())), - ("backtracking should not work for request", f.clone(), "exports-field/dist/../../../a.js", ResolveError::InvalidPackageTarget("./lib/../../../a.js".to_string(), "./dist/".to_string(), p.clone())), - ("backtracking should not work for exports field target", f.clone(), "exports-field/dist/a.js", ResolveError::InvalidPackageTarget("./../../a.js".to_string(), "./dist/a.js".to_string(), p.clone())), - ("not exported error", f.clone(), "exports-field/anything/else", ResolveError::PackagePathNotExported("./anything/else".to_string(), p.clone())), - ("request ending with slash #1", f.clone(), "exports-field/", ResolveError::PackagePathNotExported("./".to_string(), p.clone())), - ("request ending with slash #2", f.clone(), "exports-field/dist/", ResolveError::PackagePathNotExported("./dist/".to_string(), p.clone())), - ("request ending with slash #3", f.clone(), "exports-field/lib/", ResolveError::PackagePathNotExported("./lib/".to_string(), p)), - ("should throw error if target is invalid", f4, "exports-field", ResolveError::InvalidPackageTarget("./a/../b/../../pack1/index.js".to_string(), ".".to_string(), p4)), - ("throw error if exports field is invalid", f.clone(), "invalid-exports-field", ResolveError::InvalidPackageConfig(f.join("node_modules/invalid-exports-field/package.json"))), - ("should throw error if target is 'null'", f5, "m/features/internal/file.js", ResolveError::PackagePathNotExported("./features/internal/file.js".to_string(), p5)), - ]; - - for (comment, path, request, error) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!(resolution, Err(error), "{comment} {path:?} {request}"); - } -} - -// resolve using exports field, not a browser field #1 -#[test] -fn exports_not_browser_field1() { - let f = super::fixture().join("exports-field"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - condition_names: vec!["webpack".into()], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "exports-field/dist/main.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("node_modules/exports-field/lib/lib2/main.js"))); -} - -// resolve using exports field and a browser alias field #2 -#[test] -fn exports_not_browser_field2() { - let f2 = super::fixture().join("exports-field2"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - extensions: vec![".js".into()], - condition_names: vec!["node".into()], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f2, "exports-field/dist/main.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f2.join("node_modules/exports-field/lib/browser.js"))); -} - -// should resolve extension without fullySpecified -#[test] -fn extension_without_fully_specified() { - let f2 = super::fixture().join("exports-field2"); - - let commonjs_resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - let resolved_path = - commonjs_resolver.resolve(&f2, "exports-field/dist/main").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f2.join("node_modules/exports-field/lib/lib2/main.js"))); -} - -#[test] -fn field_name_path() { - let f2 = super::fixture().join("exports-field2"); - let f3 = super::fixture().join("exports-field3"); - - // field name path #1 #2 #3 - let exports_fields = [ - vec![vec!["exportsField".into(), "exports".into()]], - vec![vec!["exportsField".into(), "exports".into()], vec!["exports".into()]], - vec![vec!["exports".into()], vec!["exportsField".into(), "exports".into()]], - ]; - - for exports_fields in exports_fields { - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - exports_fields, - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/main.js"))); - } - - // field name path #4 - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - exports_fields: vec![vec!["exports".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f2, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f2.join("node_modules/exports-field/index.js"))); - - // field name path #5 - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - exports_fields: vec![vec!["ex".into()], vec!["exports_field".into(), "exports".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/index"))); - - // non-compliant export targeting a directory - let resolver = Resolver::new(ResolveOptions { - exports_fields: vec![vec!["broken".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/src/index.js"))); -} - -#[test] -fn shared_resolvers() { - let f3 = super::fixture().join("exports-field3"); - - let resolver1 = Resolver::new(ResolveOptions { - exports_fields: vec![vec!["exportsField".into(), "exports".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver1.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/main.js"))); - - let resolver2 = resolver1.clone_with_options(ResolveOptions { - exports_fields: vec![vec!["ex".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver2.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/index"))); -} - -#[test] -fn extension_alias_1_2() { - let f = super::fixture().join("exports-field-and-extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - extension_alias: vec![(".js".into(), vec![".ts".into(), ".js".into()])], - fully_specified: true, - condition_names: vec!["webpack".into(), "default".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve with the `extensionAlias` option", f.clone(), "@org/pkg/string.js", f.join("node_modules/@org/pkg/dist/string.js")), - ("should resolve with the `extensionAlias` option #2", f.clone(), "pkg/string.js", f.join("node_modules/pkg/dist/string.js")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn extension_alias_3() { - let f = super::fixture().join("exports-field-and-extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - extension_alias: vec![( - ".js".into(), - vec![".foo".into(), ".baz".into(), ".baz".into(), ".ts".into(), ".js".into()], - )], - fully_specified: true, - condition_names: vec!["webpack".into(), "default".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve with the `extensionAlias` option #3", f.clone(), "pkg/string.js", f.join("node_modules/pkg/dist/string.js")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn extension_alias_throw_error() { - let f = super::fixture().join("exports-field-and-extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - extension_alias: vec![(".js".into(), vec![".ts".into()])], - fully_specified: true, - condition_names: vec!["webpack".into(), "default".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let fail = [ - // enhanced-resolve has two test cases that are exactly the same here - // https://github.com/webpack/enhanced-resolve/blob/a998c7d218b7a9ec2461fc4fddd1ad5dd7687485/test/exportsField.test.js#L2976-L3024 - ("should throw error with the `extensionAlias` option", f, "pkg/string.js", ResolveError::ExtensionAlias), - // TODO: The error is PackagePathNotExported in enhanced-resolve - // ("should throw error with the `extensionAlias` option", f.clone(), "pkg/string.js", ResolveError::PackagePathNotExported("node_modules/pkg/dist/string.ts".to_string())), - ]; - - for (comment, path, request, error) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!(resolution, Err(error), "{comment} {path:?} {request}"); - } -} - -// Small script for generating the test cases from enhanced-resolve -// for (c of testCases) { -// console.log("TestCase {") -// console.log(`name: ${JSON.stringify(c.name)},`) -// if (c.expect instanceof Error) { -// console.log(`expect: None,`) -// } else { -// console.log(`expect: Some(vec!${JSON.stringify(c.expect)}),`) -// } -// console.log(`exports_field: exports_field(json!(${JSON.stringify(c.suite[0], null, 2)})),`) -// console.log(`request: "${c.suite[1]}",`) -// console.log(`condition_names: vec!${JSON.stringify(c.suite[2])},`) -// console.log("},") -//} -struct TestCase { - name: &'static str, - expect: Option>, - exports_field: serde_json::Value, - request: &'static str, - condition_names: Vec<&'static str>, -} - -#[allow(clippy::needless_pass_by_value)] -fn exports_field(value: serde_json::Value) -> serde_json::Value { - value -} - -#[test] -fn test_cases() { - let test_cases = [ - TestCase { - name: "sample #1", - expect: Some(vec!["./dist/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/": { - "import": [ - "./dist/", - "./src/" - ], - "webpack": "./wp/" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "sample #1", - expect: Some(vec!["./src/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/": { - "import": [ - "./src/" - ], - "webpack": "./wp/" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - TestCase { - name: "sample #1 (wildcard)", - expect: Some(vec!["./dist/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/*": { - "import": [ - "./dist/*", - "./src/*" - ], - "webpack": "./wp/*" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "sample #1 (wildcard)", - expect: Some(vec!["./src/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/*": { - "import": [ - "./src/*" - ], - "webpack": "./wp/*" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - TestCase { - name: "sample #2", - expect: Some(vec!["./data/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./timezones/": "./data/timezones/" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #2 (wildcard)", - expect: Some(vec!["./data/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./timezones/*": "./data/timezones/*" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #3", - expect: Some(vec!["./data/timezones/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./": "./data/timezones/" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #3 (wildcard)", - expect: Some(vec!["./data/timezones/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./*": "./data/timezones/*.mjs" - })), - request: "./timezones/pdt", - condition_names: vec![], - }, - TestCase { - name: "sample #4", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./lib/": { - "browser": [ - "./browser/" - ] - }, - "./dist/index.js": { - "node": "./index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #4 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "node": "./index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #5", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/": { - "browser": [ - "./browser/" - ] - }, - "./dist/index.js": { - "node": "./index.js", - "default": "./browser/index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #5 (wildcard)", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "node": "./index.js", - "default": "./browser/index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./dist/a": "./dist/index.js" - })), - request: "./dist/aaa", - condition_names: vec![], - }, - TestCase { - name: "sample #7", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./dist/a/a/": "./dist/index.js" - })), - request: "./dist/a/a", - condition_names: vec![], - }, - TestCase { - name: "sample #7 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./dist/a/a/*": "./dist/index.js" - })), - request: "./dist/a/a", - condition_names: vec![], - }, - TestCase { - name: "sample #8", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": "./index.js" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #9", - expect: Some(vec!["./main.js"]), - exports_field: exports_field(json!({ - "./index.js": "./main.js" - })), - request: "./index.js", - condition_names: vec![], - }, - TestCase { - name: "sample #10", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #11", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./bar#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #12", - expect: Some(vec!["./ok.js#abc"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/ok.js#abc", - condition_names: vec![], - }, - TestCase { - name: "sample #12", - expect: Some(vec!["./ok.js#abc"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/ok.js#abc", - condition_names: vec![], - }, - TestCase { - name: "sample #13", - expect: Some(vec!["./ok.js?abc"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/ok.js?abc", - condition_names: vec![], - }, - TestCase { - name: "sample #14", - expect: Some(vec!["./🎉.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/🎉.js", - condition_names: vec![], - }, - TestCase { - name: "sample #15", - expect: Some(vec!["./%F0%9F%8E%89.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/%F0%9F%8E%89.js", - condition_names: vec![], - }, - TestCase { - name: "sample #16", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./🎉", - condition_names: vec![], - }, - TestCase { - name: "sample #17", - expect: Some(vec!["./other.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./%F0%9F%8E%89", - condition_names: vec![], - }, - TestCase { - name: "sample #18", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./module", - condition_names: vec![], - }, - TestCase { - name: "sample #19", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./module#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #20", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./module?foo", - condition_names: vec![], - }, - TestCase { - name: "sample #21", - expect: Some(vec!["./zizizi"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./z*z*z*" - })), - request: "./#zippi", - condition_names: vec![], - }, - TestCase { - name: "sample #22", - expect: Some(vec!["./d?e?f"]), - exports_field: exports_field(json!({ - "./a?b?c/": "./" - })), - request: "./a?b?c/d?e?f", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #1", - expect: Some(vec!["./dist/index.js"]), - exports_field: exports_field(json!({ - ".": "./dist/index.js" - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #2", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./": "./", - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #3", - expect: Some(vec!["./dist/a.js"]), - exports_field: exports_field(json!({ - "./dist/": "./dist/", - "./dist/*": "./dist/*", - "./dist*": "./dist*", - "./dist/index.js": "./dist/a.js" - })), - request: "./dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #4", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./": { - "browser": [ - "./browser/" - ] - }, - "./*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "browser": "./index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #5", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./": { - "browser": [ - "./browser/" - ] - }, - "./*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "node": "./node.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #6", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - ".": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #7", - expect: Some(vec!["./src/index.js"]), // `enhanced_resolve` is `None` - exports_field: exports_field(json!({ - ".": { - "default": "./src/index.js", - "browser": "./index.js", - "node": "./src/node/index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #8", - expect: Some(vec!["./src/index.js"]), - exports_field: exports_field(json!({ - ".": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #9", - expect: Some(vec!["./index"]), - exports_field: exports_field(json!({ - ".": "./index" - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #10", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./index": "./index.js" - })), - request: "./index", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #11", - expect: Some(vec!["./foo.js"]), - exports_field: exports_field(json!({ - "./": "./", - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #12", - expect: Some(vec!["./foo/bar/baz.js"]), - exports_field: exports_field(json!({ - "./": "./", - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo/bar/baz.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #13", - expect: Some(vec!["./foo/bar/baz.js"]), - exports_field: exports_field(json!({ - "./": "./", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo/bar/baz.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #14", - expect: Some(vec!["./foo/bar/baz.js"]), - exports_field: exports_field(json!({ - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo/bar/baz.js", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #1", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "require": "./require.js" - }, { - "import": "./import.mjs" - }] - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #2", - expect: Some(vec!["./import.mjs"]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "require": "./require.js" - }, { - "import": "./import.mjs" - }] - })), - request: ".", - condition_names: vec!["import"], - }, - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./require.js"]), - exports_field: exports_field(json!({ - ".": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./import.mjs"]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "import": "./import.mjs" - }] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./require.js"]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "require": [ - "./require.js" - ] - }, { - "import": [ - "./import.mjs", - "./import.js" - ] - }] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./import.mjs"]), - exports_field: exports_field(json!({ - ".": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "./import.mjs", - "./import.js" - ] - } - ] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./import.js"]), - exports_field: exports_field(json!({ - ".": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "./import.js" - ] - } - ] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "mapping to a folder root #1", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./timezones": "./data/timezones/" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #2", - expect: None, - exports_field: exports_field(json!({ - "./timezones/": "./data/timezones" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #3", - expect: Some(vec!["./data/timezones/pdt/index.mjs"]), - exports_field: exports_field(json!({ - "./timezones/pdt/": "./data/timezones/pdt/" - })), - request: "./timezones/pdt/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #3 (wildcard)", - expect: Some(vec!["./data/timezones/pdt/index.mjs"]), - exports_field: exports_field(json!({ - "./timezones/pdt/*": "./data/timezones/pdt/*" - })), - request: "./timezones/pdt/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #4", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./": "./timezones/" - })), - request: "./pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #4 (wildcard)", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./*": "./timezones/*" - })), - request: "./pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #5", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./": "./" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #5 (wildcard)", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./*": "./*" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #6", - expect: None, - exports_field: exports_field(json!({ - "./": "." - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #6 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "./*": "." - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #7", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": "./" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #7 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": "./*" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #1", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./": "./", - "./dist/": "./lib/" - })), - request: "./dist/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #1 (wildcard)", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./*": "./*", - "./dist/*": "./lib/*" - })), - request: "./dist/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #2", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/": "./dist/utils/", - "./dist/": "./lib/" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #2 (wildcard)", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/*": "./dist/utils/*", - "./dist/*": "./lib/*" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #3", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/index.js": "./dist/utils/index.js", - "./dist/utils/": "./dist/utils/index.mjs", - "./dist/": "./lib/" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #3 (wildcard)", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/index.js": "./dist/utils/index.js", - "./dist/utils/*": "./dist/utils/index.mjs", - "./dist/*": "./lib/*" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #4", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./": { - "browser": "./browser/" - }, - "./dist/": "./lib/" - })), - request: "./dist/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "the longest matching path prefix is prioritized #4 (wildcard)", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./*": { - "browser": "./browser/*" - }, - "./dist/*": "./lib/*" - })), - request: "./dist/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #1", - // `lodash/` does not start with './' so fallbacks to util - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "conditional mapping folder #1", - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": [ - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #1 (wildcard)", - // `lodash/` does not start with './' so fallbacks to util - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": [ - "lodash/*", - "./utils/*" - ], - "node": [ - "./utils-node/*" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "conditional mapping folder #1 (wildcard)", - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": [ - "./utils/*" - ], - "node": [ - "./utils-node/*" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #2", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./node/" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "conditional mapping folder #2 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "webpack": "./wpk/*", - "browser": [ - "lodash/*", - "./utils/*" - ], - "node": [ - "./node/*" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "conditional mapping folder #3", - expect: Some(vec!["./wpk/index.mjs"]), - exports_field: exports_field(json!({ - "./utils/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils/" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "conditional mapping folder #3 (wildcard)", - expect: Some(vec!["./wpk/index.mjs"]), - exports_field: exports_field(json!({ - "./utils/*": { - "webpack": "./wpk/*", - "browser": [ - "lodash/*", - "./utils/*" - ], - "node": [ - "./utils/*" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "incorrect exports field #1", - expect: None, - exports_field: exports_field(json!({ - "/utils/": "./a/" - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #2", - expect: None, - exports_field: exports_field(json!({ - "./utils/": "/a/" - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #3", - expect: None, - exports_field: exports_field(json!({ - "/utils/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #4", - expect: None, - exports_field: exports_field(json!({ - "./utils/": { - "browser": "/a/", - "default": "/b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #4 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "/a/", - "default": "/b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #5", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index": "./a/index.js" - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index.mjs": "./a/index.js" - })), - request: "./utils/index", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #7", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #8", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index.mjs": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - // Requests that are not `./` does not apply to `package_exports_resolve` - // TestCase { - // name: "incorrect request #1", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": "./a/" - // })), - // request: "/utils/index.mjs", - // condition_names: vec![], - // }, - // TestCase { - // name: "incorrect request #2", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": { - // "browser": "./a/", - // "default": "./b/" - // } - // })), - // request: "/utils/index.mjs", - // condition_names: vec!["browser"], - // }, - // TestCase { - // name: "incorrect request #3", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": { - // "browser": "./a/", - // "default": "./b/" - // } - // })), - // request: "../utils/index.mjs", - // condition_names: vec!["browser"], - // }, - // TestCase { - // name: "incorrect request #4", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": { - // "browser": "./a/", - // "default": "./b/" - // } - // })), - // request: "/utils/index.mjs/", - // condition_names: vec!["browser"], - // }, - TestCase { - name: "backtracking package base #1", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./../../utils/": "./dist/" - })), - request: "./../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #1 (wildcard)", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./../../utils/*": "./dist/*" - })), - request: "./../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #2", - expect: None, - exports_field: exports_field(json!({ - "../../utils/": "./dist/" - })), - request: "../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #2 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "../../utils/*": "./dist/*" - })), - request: "../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #3", - expect: None, - exports_field: exports_field(json!({ - "./utils/": "../src/" - })), - request: "./utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #3 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "./utils/*": "../src/*" - })), - request: "./utils/index", - condition_names: vec![], - }, - // enhanced-resolve does not handle backtracking here - // TestCase { - // name: "backtracking package base #4", - // expect: Some(vec!["./../src/index"]), - // exports_field: exports_field(json!({ - // "./utils/": "./../src/" - // })), - // request: "./utils/index", - // condition_names: vec![], - // }, - // TestCase { - // name: "backtracking package base #4 (wildcard)", - // expect: Some(vec!["./../src/index"]), - // exports_field: exports_field(json!({ - // "./utils/*": "./../src/*" - // })), - // request: "./utils/index", - // condition_names: vec![], - // }, - // TestCase { - // name: "backtracking package base #5", - // expect: Some(vec!["./src/../index.js"]), - // exports_field: exports_field(json!({ - // "./utils/index": "./src/../index.js" - // })), - // request: "./utils/index", - // condition_names: vec![], - // }, - TestCase { - name: "backtracking package base #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/../utils/index": "./src/../index.js" - })), - request: "./utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #7", - expect: None, - exports_field: exports_field(json!({ - "./utils/": { - "browser": "../this/" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #7", - expect: None, - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "../this/*" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #8", - // We throw "InvalidPackageTarget" - // expect: Some(vec!["./utils/../index"]), - expect: None, - exports_field: exports_field(json!({ - "./utils/": { - "browser": "./utils/../" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #8 (wildcard)", - // We throw "InvalidPackageTarget" - // expect: Some(vec!["./utils/../index"]), - expect: None, - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "./utils/../*" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #9", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./": "./src/../../", - "./dist/": "./dist/" - })), - request: "./dist/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #9 (wildcard)", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./*": "./src/../../*", - "./dist/*": "./dist/*" - })), - request: "./dist/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking target folder #1", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../../index"]), - exports_field: exports_field(json!({ - "./utils/": "./dist/" - })), - request: "./utils/timezone/../../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #1 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../../index"]), - exports_field: exports_field(json!({ - "./utils/*": "./dist/*" - })), - request: "./utils/timezone/../../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #2", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../index"]), - exports_field: exports_field(json!({ - "./utils/": "./dist/" - })), - request: "./utils/timezone/../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #2 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../index"]), - exports_field: exports_field(json!({ - "./utils/*": "./dist/*" - })), - request: "./utils/timezone/../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #3", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/target/../../index"]), - exports_field: exports_field(json!({ - "./utils/": "./dist/target/" - })), - request: "./utils/../../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #3 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/target/../../index"]), - exports_field: exports_field(json!({ - "./utils/*": "./dist/target/*" - })), - request: "./utils/../../index", - condition_names: vec![], - }, - // enhanced-resolve does not handle `node_modules` in target - TestCase { - name: "nested node_modules path #1", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": "./node_modules/" - } - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #1 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "./node_modules/*" - } - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #2", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./utils/../node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/": "./utils/../node_modules/" - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "nested node_modules path #2 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./utils/../node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": "./utils/../node_modules/*" - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "nested mapping #1", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": "./", - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested mapping #1 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": "./*", - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "nested mapping #2 (wildcard)", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #2 (wildcard)", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "nested mapping #3", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["webpack"], - }, - TestCase { - name: "nested mapping #3 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["webpack"], - }, - TestCase { - name: "nested mapping #4", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["node", "browser"], - }, - TestCase { - name: "nested mapping #4 (wildcard)", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["node", "browser"], - }, - TestCase { - name: "nested mapping #5", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node"], - }, - TestCase { - name: "nested mapping #5 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": { - "webpack": [ - "./wpck/*" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node"], - }, - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - TestCase { - name: "nested mapping #6 (wildcard)", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": { - "webpack": [ - "./wpck/*" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #6 (wildcard)", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./node/*" - ], - "default": { - "node": { - "webpack": [ - "./wpck/*" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - TestCase { - name: "nested mapping #7", - expect: Some(vec!["./y.js"]), - exports_field: exports_field(json!({ - "./a.js": { - "abc": { - "def": "./x.js" - }, - "ghi": "./y.js" - } - })), - request: "./a.js", - condition_names: vec!["abc", "ghi"], - }, - TestCase { - name: "nested mapping #8", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./a.js": { - "abc": { - "def": "./x.js", - "default": [] - }, - "ghi": "./y.js" - } - })), - request: "./a.js", - condition_names: vec!["abc", "ghi"], - }, - TestCase { - name: "syntax sugar #1", - expect: Some(vec!["./main.js"]), - exports_field: exports_field(json!("./main.js")), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #2", - expect: Some(vec![]), - exports_field: exports_field(json!("./main.js")), - request: "./lib.js", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #3", - expect: Some(vec!["./a.js"]), - exports_field: exports_field(json!(["./a.js", "./b.js"])), - request: ".", - condition_names: vec![], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "syntax sugar #3", - expect: Some(vec!["./b.js"]), - exports_field: exports_field(json!(["./b.js"])), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #4", - expect: Some(vec![]), - exports_field: exports_field(json!(["./a.js", "./b.js"])), - request: "./lib.js", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #5", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "browser": { - "default": "./index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "syntax sugar #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "browser": { - "default": "./index.js" - } - })), - request: "./lib.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "syntax sugar #7", - expect: None, - exports_field: exports_field(json!({ - "./node": "./node.js", - "browser": { - "default": "./index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "syntax sugar #8", - expect: None, - exports_field: exports_field(json!({ - "browser": { - "default": "./index.js" - }, - "./node": "./node.js" - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #1", - expect: Some(vec!["./abc/d"]), - exports_field: exports_field(json!({ - "./ab*": "./ab/*", - "./abc*": "./abc/*", - "./a*": "./a/*" - })), - request: "./abcd", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #2", - expect: Some(vec!["./abc/d/e"]), - exports_field: exports_field(json!({ - "./ab*": "./ab/*", - "./abc*": "./abc/*", - "./a*": "./a/*" - })), - request: "./abcd/e", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #3", - expect: Some(vec!["./abc/d"]), - exports_field: exports_field(json!({ - "./x/ab*": "./ab/*", - "./x/abc*": "./abc/*", - "./x/a*": "./a/*" - })), - request: "./x/abcd", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #4", - expect: Some(vec!["./abc/d/e"]), - exports_field: exports_field(json!({ - "./x/ab*": "./ab/*", - "./x/abc*": "./abc/*", - "./x/a*": "./a/*" - })), - request: "./x/abcd/e", - condition_names: vec!["browser"], - }, - TestCase { - name: "path tree edge case #1", - expect: Some(vec!["./A/b/d.js"]), - exports_field: exports_field(json!({ - "./a/": "./A/", - "./a/b/c": "./c.js" - })), - request: "./a/b/d.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #1 (wildcard)", - expect: Some(vec!["./A/b/d.js"]), - exports_field: exports_field(json!({ - "./a/*": "./A/*", - "./a/b/c": "./c.js" - })), - request: "./a/b/d.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #2", - expect: Some(vec!["./A/c.js"]), - exports_field: exports_field(json!({ - "./a/": "./A/", - "./a/b": "./b.js" - })), - request: "./a/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #2 (wildcard)", - expect: Some(vec!["./A/c.js"]), - exports_field: exports_field(json!({ - "./a/*": "./A/*", - "./a/b": "./b.js" - })), - request: "./a/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #3", - expect: Some(vec!["./A/b/d/c.js"]), - exports_field: exports_field(json!({ - "./a/": "./A/", - "./a/b/c/d": "./c.js" - })), - request: "./a/b/d/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #3 (wildcard)", - expect: Some(vec!["./A/b/d/c.js"]), - exports_field: exports_field(json!({ - "./a/*": "./A/*", - "./a/b/c/d": "./c.js" - })), - request: "./a/b/d/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #1", - expect: Some(vec!["./A/b.js"]), - exports_field: exports_field(json!({ - "./a/*.js": "./A/*.js" - })), - request: "./a/b.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #2", - expect: Some(vec!["./A/b/c.js"]), - exports_field: exports_field(json!({ - "./a/*.js": "./A/*.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #3", - expect: Some(vec!["./A/b/c.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": "./A/*/c.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #4", - expect: Some(vec!["./A/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": "./A/*/*.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #5", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/*.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #5", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/*.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./lib/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #6", - expect: Some(vec!["./browser/foo/bar.js"]), - exports_field: exports_field(json!({ - "./lib/*/bar.js": { - "browser": [ - "./browser/*/bar.js" - ] - }, - "./dist/*/bar.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./lib/foo/bar.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #6", - expect: Some(vec!["./browser/foo.js"]), - exports_field: exports_field(json!({ - "./lib/*/bar.js": { - "browser": [ - "./browser/*/bar.js" - ] - }, - "./dist/*/bar.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./dist/foo/bar.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #7", - expect: Some(vec!["./browser/foo/default.js"]), - exports_field: exports_field(json!({ - "./lib/*/bar.js": { - "browser": [ - "./browser/*/bar.js" - ] - }, - "./dist/*/bar.js": { - "node": "./*.js", - "default": "./browser/*/default.js" - } - })), - request: "./dist/foo/bar.js", - condition_names: vec!["default"], - }, - TestCase { - name: "wildcard pattern #8", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": "./A/*/*/*.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #9", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": [ - "./A/*/*/*.js", - "./B/*/*/*.js" - ] - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "wildcard pattern #9", - expect: Some(vec!["./B/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": [ - "./B/*/*/*.js" - ] - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #10", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/foo-*/c.js": "./A/*/*/*.js" - })), - request: "./a/foo-b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #11", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*-foo/c.js": "./A/*/*/*.js" - })), - request: "./a/b-foo/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #12", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/foo-*-foo/c.js": "./A/*/*/*.js" - })), - request: "./a/foo-b-foo/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #13", - expect: Some(vec!["./A/b/c/d.js"]), - exports_field: exports_field(json!({ - "./a/foo-*-foo/c.js": "./A/b/c/d.js" - })), - request: "./a/foo-b-foo/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #14", - expect: Some(vec!["./A/b/c/*.js"]), - exports_field: exports_field(json!({ - "./a/foo-foo/c.js": "./A/b/c/*.js" - })), - request: "./a/foo-foo/c.js", - condition_names: vec![], - }, - ]; - - for case in test_cases { - let resolved = Resolver::new(ResolveOptions { - condition_names: case - .condition_names - .iter() - .map(ToString::to_string) - .collect::>(), - ..ResolveOptions::default() - }) - .package_exports_resolve( - Path::new(""), - case.request, - &case.exports_field, - &mut Ctx::default(), - ) - .map(|p| p.map(|p| p.to_path_buf())); - if let Some(expect) = case.expect { - if expect.is_empty() { - assert!( - matches!(resolved, Err(ResolveError::PackagePathNotExported(_, _))), - "{} {:?}", - &case.name, - &resolved - ); - } else { - for expect in expect { - assert_eq!(resolved, Ok(Some(Path::new(expect).normalize())), "{}", &case.name); - } - } - } else { - assert!(resolved.is_err(), "{} {resolved:?}", &case.name); - } - } -} diff --git a/src/tests/extension_alias.rs b/src/tests/extension_alias.rs deleted file mode 100644 index 86afab73..00000000 --- a/src/tests/extension_alias.rs +++ /dev/null @@ -1,66 +0,0 @@ -//! - -use crate::{ResolveError, ResolveOptions, Resolver}; - -#[test] -fn extension_alias() { - let f = super::fixture().join("extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - extension_alias: vec![ - (".js".into(), vec![".ts".into(), ".js".into()]), - (".mjs".into(), vec![".mts".into()]), - ], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should alias fully specified file", f.clone(), "./index.js", f.join("index.ts")), - ("should alias fully specified file when there are two alternatives", f.clone(), "./dir/index.js", f.join("dir/index.ts")), - ("should also allow the second alternative", f.clone(), "./dir2/index.js", f.join("dir2/index.js")), - ("should support alias option without an array", f.clone(), "./dir2/index.mjs", f.join("dir2/index.mts")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } - - #[rustfmt::skip] - let fail = [ - ("should not allow to fallback to the original extension or add extensions", f, "./index.mjs"), - ]; - - for (comment, path, request) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!(resolution, Err(ResolveError::ExtensionAlias), "{comment} {path:?} {request}"); - } -} - -// should not apply extension alias to extensions or mainFiles field -#[test] -fn not_apply_to_extension_nor_main_files() { - let f = super::fixture().join("extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - extension_alias: vec![(".js".into(), vec![])], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("directory", f.clone(), "./dir2", "dir2/index.js"), - ("file", f.clone(), "./dir2/index", "dir2/index.js"), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - let expected = f.join(expected); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} diff --git a/src/tests/extensions.rs b/src/tests/extensions.rs deleted file mode 100644 index 1ebd86f4..00000000 --- a/src/tests/extensions.rs +++ /dev/null @@ -1,125 +0,0 @@ -//! - -use crate::{EnforceExtension, Resolution, ResolveContext, ResolveError, ResolveOptions, Resolver}; -use rustc_hash::FxHashSet; - -#[test] -fn extensions() { - let f = super::fixture().join("extensions"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".ts".into(), ".js".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve according to order of provided extensions", "./foo", "foo.ts"), - ("should resolve according to order of provided extensions (dir index)", "./dir", "dir/index.ts"), - ("should resolve according to main field in module root", ".", "index.js"), - // This is a core module - // ("should resolve single file module before directory", "module", "node_modules/module.js"), - ("should resolve trailing slash directory before single file", "module/", "node_modules/module/index.ts"), - ]; - - for (comment, request, expected_path) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - let expected = f.join(expected_path); - assert_eq!(resolved_path, Ok(expected), "{comment} {request} {expected_path}"); - } - - #[rustfmt::skip] - let fail = [ - ("not resolve to file when request has a trailing slash (relative)", "./foo.js/", "./foo.js/".into()) - ]; - - for (comment, request, expected_error) in fail { - let resolution = resolver.resolve(&f, request); - let error = ResolveError::NotFound(expected_error); - assert_eq!(resolution, Err(error), "{comment} {request} {resolution:?}"); - } -} - -// should default enforceExtension to true when extensions includes an empty string -#[test] -fn default_enforce_extension() { - let f = super::fixture().join("extensions"); - - let mut ctx = ResolveContext::default(); - let resolved = Resolver::new(ResolveOptions { - extensions: vec![".ts".into(), String::new(), ".js".into()], - ..ResolveOptions::default() - }) - .resolve_with_context(&f, "./foo", &mut ctx); - - assert_eq!(resolved.map(Resolution::into_path_buf), Ok(f.join("foo.ts"))); - assert_eq!( - ctx.file_dependencies, - FxHashSet::from_iter([f.join("foo.ts"), f.join("package.json")]) - ); - assert!(ctx.missing_dependencies.is_empty()); -} - -// should respect enforceExtension when extensions includes an empty string -#[test] -fn respect_enforce_extension() { - let f = super::fixture().join("extensions"); - - let mut ctx = ResolveContext::default(); - let resolved = Resolver::new(ResolveOptions { - enforce_extension: EnforceExtension::Disabled, - extensions: vec![".ts".into(), String::new(), ".js".into()], - ..ResolveOptions::default() - }) - .resolve_with_context(&f, "./foo", &mut ctx); - - assert_eq!(resolved.map(Resolution::into_path_buf), Ok(f.join("foo.ts"))); - assert_eq!( - ctx.file_dependencies, - FxHashSet::from_iter([f.join("foo.ts"), f.join("package.json")]) - ); - assert_eq!(ctx.missing_dependencies, FxHashSet::from_iter([f.join("foo")])); -} - -#[test] -fn multi_dot_extension() { - let f = super::fixture().join("extensions"); - - let resolver = Resolver::new(ResolveOptions { - // Test for `.d.ts`, not part of enhanced-resolve. - extensions: vec![".a.b.c".into(), ".d.ts".into(), ".ts".into(), ".js".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve according to order of provided extensions", "./foo", "foo.ts"), - ("should resolve file with extension", "./app.module", "app.module.js") - ]; - - for (comment, request, expected_path) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - let expected = f.join(expected_path); - assert_eq!(resolved_path, Ok(expected), "{comment} {request} {expected_path}"); - } - - #[rustfmt::skip] - let fail = [ - ("not resolve to file", "./index.", "./index.".into()) - ]; - - for (comment, request, expected_error) in fail { - let resolution = resolver.resolve(&f, request); - let error = ResolveError::NotFound(expected_error); - assert_eq!(resolution, Err(error), "{comment} {request} {resolution:?}"); - } -} - -#[test] -#[should_panic = "All extensions must start with a leading dot"] -fn without_leading_dot() { - Resolver::new(ResolveOptions { - extensions: vec!["ts".into(), "js".into()], - ..ResolveOptions::default() - }); -} diff --git a/src/tests/fallback.rs b/src/tests/fallback.rs deleted file mode 100644 index 3da2d767..00000000 --- a/src/tests/fallback.rs +++ /dev/null @@ -1,100 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/fallback.test.js - -#[test] -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -fn fallback() { - use super::memory_fs::MemoryFS; - use crate::{AliasValue, ResolveError, ResolveOptions, ResolverGeneric}; - use std::path::{Path, PathBuf}; - - let f = Path::new("/"); - - let file_system = MemoryFS::new(&[ - ("/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", ""), - ]); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - fallback: vec![ - ("aliasA".into(), vec![AliasValue::Path("a".into())]), - ("b$".into(), vec![AliasValue::Path("a/index".into())]), - ("c$".into(), vec![AliasValue::Path("/a/index".into())]), - ( - "multiAlias".into(), - vec![ - AliasValue::Path("b".into()), - AliasValue::Path("c".into()), - AliasValue::Path("d".into()), - AliasValue::Path("e".into()), - AliasValue::Path("a".into()), - ], - ), - ("recursive".into(), vec![AliasValue::Path("recursive/dir".into())]), - ("/d/dir".into(), vec![AliasValue::Path("/c/dir".into())]), - ("/d/index.js".into(), vec![AliasValue::Path("/c/index".into())]), - ("ignored".into(), vec![AliasValue::Ignore]), - ("node:path".into(), vec![AliasValue::Ignore]), - ], - modules: vec!["/".into()], - ..ResolveOptions::default() - }, - ); - - #[rustfmt::skip] - let pass = [ - ("should resolve a not aliased module 1", "a", "/a/index"), - ("should resolve a not aliased module 2", "a/index", "/a/index"), - ("should resolve a not aliased module 3", "a/dir", "/a/dir/index"), - ("should resolve a not aliased module 4", "a/dir/index", "/a/dir/index"), - ("should resolve an fallback module 1", "aliasA", "/a/index"), - ("should resolve an fallback module 2", "aliasA/index", "/a/index"), - ("should resolve an fallback module 3", "aliasA/dir", "/a/dir/index"), - ("should resolve an fallback module 4", "aliasA/dir/index", "/a/dir/index"), - ("should resolve a recursive aliased module 1", "recursive", "/recursive/index"), - ("should resolve a recursive aliased module 2", "recursive/index", "/recursive/index"), - ("should resolve a recursive aliased module 3", "recursive/dir", "/recursive/dir/index"), - ("should resolve a recursive aliased module 4", "recursive/dir/index", "/recursive/dir/index"), - ("should resolve a recursive aliased module 5", "recursive/file", "/recursive/dir/file"), - ("should resolve a file aliased module with a query 1", "b?query", "/b/index?query"), - ("should resolve a file aliased module with a query 2", "c?query", "/c/index?query"), - ("should resolve a path in a file aliased module 1", "b/index", "/b/index"), - ("should resolve a path in a file aliased module 2", "b/dir", "/b/dir/index"), - ("should resolve a path in a file aliased module 3", "b/dir/index", "/b/dir/index"), - ("should resolve a path in a file aliased module 4", "c/index", "/c/index"), - ("should resolve a path in a file aliased module 5", "c/dir", "/c/dir/index"), - ("should resolve a path in a file aliased module 6", "c/dir/index", "/c/dir/index"), - ("should resolve a file in multiple aliased dirs 1", "multiAlias/dir/file", "/e/dir/file"), - ("should resolve a file in multiple aliased dirs 2", "multiAlias/anotherDir", "/e/anotherDir/index"), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - - #[rustfmt::skip] - let ignore = [ - ("should resolve an ignore module", "ignored", ResolveError::Ignored(f.join("ignored"))), - ("should resolve node: builtin module", "node:path", ResolveError::Ignored(PathBuf::from("/node:path"))), - ]; - - for (comment, request, expected) in ignore { - let resolution = resolver.resolve(f, request); - assert_eq!(resolution, Err(expected), "{comment} {request}"); - } -} diff --git a/src/tests/full_specified.rs b/src/tests/full_specified.rs deleted file mode 100644 index a70c0191..00000000 --- a/src/tests/full_specified.rs +++ /dev/null @@ -1,113 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/fullSpecified.test.js - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows { - use std::path::PathBuf; - - use crate::{AliasValue, ResolveOptions, ResolverGeneric}; - - use super::super::memory_fs::MemoryFS; - - fn file_system() -> MemoryFS { - MemoryFS::new(&[ - ("/a/node_modules/package1/index.js", ""), - ("/a/node_modules/package1/file.js", ""), - ("/a/node_modules/package2/package.json", r#"{"main":"a"}"#), - ("/a/node_modules/package2/a.js", ""), - ("/a/node_modules/package3/package.json", r#"{"main":"dir"}"#), - ("/a/node_modules/package3/dir/index.js", ""), - ("/a/node_modules/package4/package.json", r#"{"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", ""), - ]) - } - - #[test] - fn test() { - let file_system = file_system(); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - alias: vec![ - ("alias1".into(), vec![AliasValue::from("/a/abc")]), - ("alias2".into(), vec![AliasValue::from("/a")]), - ], - alias_fields: vec![vec!["browser".into()]], - fully_specified: true, - ..ResolveOptions::default() - }, - ); - - let failing_resolves = [ - ("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"), - ]; - - for (comment, request) in failing_resolves { - let resolution = resolver.resolve("/a", request); - assert!(resolution.is_err(), "{comment} {request}"); - } - - let successful_resolves = [ - ("fully relative", "./abc.js", "/a/abc.js"), - ("fully absolute", "/a/abc.js", "/a/abc.js"), - ("fully relative in package", "package1/file.js", "/a/node_modules/package1/file.js"), - ("extensions in mainFiles", "package1", "/a/node_modules/package1/index.js"), - ("extensions in mainFields", "package2", "/a/node_modules/package2/a.js"), - ("extensions in alias", "alias1", "/a/abc.js"), - ("directories in alias", "alias2", "/a/index.js"), - ("directories in packages", "package3", "/a/node_modules/package3/dir/index.js"), - ("extensions in aliasFields", "package4/a.js", "/a/node_modules/package4/b.js"), - ]; - - for (comment, request, expected) in successful_resolves { - let resolution = resolver.resolve("/a", request).map(|r| r.full_path()); - assert_eq!(resolution, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - } - - #[test] - #[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. - fn resolve_to_context() { - let file_system = file_system(); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - alias: vec![ - ("alias1".into(), vec![AliasValue::from("/a/abc")]), - ("alias2".into(), vec![AliasValue::from("/a")]), - ], - alias_fields: vec![vec!["browser".into()]], - fully_specified: true, - resolve_to_context: true, - ..ResolveOptions::default() - }, - ); - - let successful_resolves = [ - ("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", "/a/node_modules/package3/dir"), - ]; - - for (comment, request, expected) in successful_resolves { - let resolution = resolver.resolve("/a", request).map(|r| r.full_path()); - assert_eq!(resolution, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - } -} diff --git a/src/tests/imports_field.rs b/src/tests/imports_field.rs deleted file mode 100644 index c928627a..00000000 --- a/src/tests/imports_field.rs +++ /dev/null @@ -1,1320 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/importsField.test.js -//! -//! The huge imports field test cases are at the bottom of this file. - -use serde_json::json; - -use crate::{Ctx, JSONMap, PathUtil, ResolveError, ResolveOptions, Resolver}; -use std::path::Path; - -#[test] -fn test_simple() { - let f = super::fixture().join("imports-field"); - let f2 = super::fixture().join("imports-exports-wildcard/node_modules/m/"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve using imports field instead of self-referencing", f.clone(), "#imports-field", f.join("b.js")), - ("should resolve using imports field instead of self-referencing for a subpath", f.join("dir"), "#imports-field", f.join("b.js")), - ("should resolve package #1", f.clone(), "#a/dist/main.js", f.join("node_modules/a/lib/lib2/main.js")), - ("should resolve package #3", f.clone(), "#ccc/index.js", f.join("node_modules/c/index.js")), - ("should resolve package #4", f.clone(), "#c", f.join("node_modules/c/index.js")), - ("should resolve with wildcard pattern", f2.clone(), "#internal/i.js", f2.join("src/internal/i.js")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } - - // Note added: - // * should resolve absolute path as an imports field target - // * should log the correct info - - #[rustfmt::skip] - let fail = [ - ("should disallow resolve out of package scope", f.clone(), "#b", ResolveError::InvalidPackageTarget("../b.js".to_string(), "#b".to_string(), f.join("package.json"))), - ("should resolve package #2", f.clone(), "#a", ResolveError::PackageImportNotDefined("#a".to_string(), f.join("package.json"))), - ]; - - for (comment, path, request, error) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!(resolution, Err(error), "{comment} {path:?} {request}"); - } -} - -#[test] -fn shared_resolvers() { - let f = super::fixture().join("imports-field"); - - // field name #1 - let resolver1 = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - imports_fields: vec![vec!["imports".into()]], - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - let resolved_path = resolver1.resolve(&f, "#imports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("b.js"))); - - // field name #2 - let resolver2 = resolver1.clone_with_options(ResolveOptions { - imports_fields: vec![vec!["other".into(), "imports".into()]], - ..ResolveOptions::default() - }); - - let resolved_path = resolver2.resolve(&f, "#b").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("a.js"))); -} - -// Small script for generating the test cases from enhanced_resolve -// for (c of testCases) { -// console.log("TestCase {") -// console.log(`name: ${JSON.stringify(c.name)},`) -// if (c.expect instanceof Error) { -// console.log(`expect: None,`) -// } else { -// console.log(`expect: Some(vec!${JSON.stringify(c.expect)}),`) -// } -// console.log(`imports_field: imports_field(json!(${JSON.stringify(c.suite[0], null, 2)})),`) -// console.log(`request: "${c.suite[1]}",`) -// console.log(`condition_names: vec!${JSON.stringify(c.suite[2])},`) -// console.log("},") -// } - -struct TestCase { - name: &'static str, - expect: Option>, - imports_field: JSONMap, - request: &'static str, - condition_names: Vec<&'static str>, -} - -#[allow(clippy::needless_pass_by_value)] -fn imports_field(value: serde_json::Value) -> JSONMap { - let s = serde_json::to_string(&value).unwrap(); - serde_json::from_str(&s).unwrap() -} - -#[test] -fn test_cases() { - let test_cases = [ - TestCase { - name: "sample #1", - expect: Some(vec!["./dist/test/file.js"]), - imports_field: imports_field(json!({ - "#abc/": { - "import": [ - "./dist/", - "./src/" - ], - "webpack": "./wp/" - }, - "#abc": "./main.js" - })), - request: "#abc/test/file.js", - condition_names: vec!["import", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "sample #1", - expect: Some(vec!["./src/test/file.js"]), - imports_field: imports_field(json!({ - "#abc/": { - "import": [ - "./src/" - ], - "webpack": "./wp/" - }, - "#abc": "./main.js" - })), - request: "#abc/test/file.js", - condition_names: vec!["import", "webpack"], - }, - TestCase { - name: "sample #2", - expect: Some(vec!["./data/timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#1/timezones/": "./data/timezones/" - })), - request: "#1/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #3", - expect: Some(vec!["./data/timezones/timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#aaa/": "./data/timezones/", - "#a/": "./data/timezones/" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #4", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/lib/": { - "browser": [ - "./browser/" - ] - }, - "#a/dist/index.js": { - "node": "./index.js" - } - })), - request: "#a/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #5", - expect: Some(vec!["./browser/index.js"]), - imports_field: imports_field(json!({ - "#a/lib/": { - "browser": [ - "./browser/" - ] - }, - "#a/dist/index.js": { - "node": "./index.js", - "default": "./browser/index.js" - } - })), - request: "#a/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #6", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/dist/a": "./dist/index.js" - })), - request: "#a/dist/aaa", - condition_names: vec![], - }, - TestCase { - name: "sample #7", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/a/a/": "./dist/index.js" - })), - request: "#a/a/a", - condition_names: vec![], - }, - TestCase { - name: "sample #8", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": "./index.js" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #9", - expect: Some(vec!["./main.js"]), - imports_field: imports_field(json!({ - "#a/index.js": "./main.js" - })), - request: "#a/index.js", - condition_names: vec![], - }, - TestCase { - name: "sample #10", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #11", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/bar#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #12", - expect: Some(vec!["./ok.js#abc"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/ok.js#abc", - condition_names: vec![], - }, - TestCase { - name: "sample #13", - expect: Some(vec!["./ok.js?abc"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/ok.js?abc", - condition_names: vec![], - }, - TestCase { - name: "sample #14", - expect: Some(vec!["./🎉.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/🎉.js", - condition_names: vec![], - }, - TestCase { - name: "sample #15", - expect: Some(vec!["./%F0%9F%8E%89.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/%F0%9F%8E%89.js", - condition_names: vec![], - }, - TestCase { - name: "sample #16", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/🎉", - condition_names: vec![], - }, - TestCase { - name: "sample #17", - expect: Some(vec!["./other.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/%F0%9F%8E%89", - condition_names: vec![], - }, - TestCase { - name: "sample #18", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/module", - condition_names: vec![], - }, - TestCase { - name: "sample #19", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/module#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #20", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/module?foo", - condition_names: vec![], - }, - TestCase { - name: "sample #21", - expect: Some(vec!["./d?e?f"]), - imports_field: imports_field(json!({ - "#a/a?b?c/": "./" - })), - request: "#a/a?b?c/d?e?f", - condition_names: vec![], - }, - TestCase { - name: "sample #22", - // We throw InvalidPackageTarget - expect: None, - // expect: Some(vec!["/user/a/index"]), - imports_field: imports_field(json!({ - "#a/": "/user/a/" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #1", - expect: Some(vec!["./A/b/d.js"]), - imports_field: imports_field(json!({ - "#a/": "./A/", - "#a/b/c": "./c.js" - })), - request: "#a/b/d.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #2", - expect: Some(vec!["./A/c.js"]), - imports_field: imports_field(json!({ - "#a/": "./A/", - "#a/b": "./b.js" - })), - request: "#a/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #3", - expect: Some(vec!["./A/b/c/d.js"]), - imports_field: imports_field(json!({ - "#a/": "./A/", - "#a/b/c/d": "./c.js" - })), - request: "#a/b/c/d.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #1", - expect: Some(vec!["./dist/index.js"]), - imports_field: imports_field(json!({ - "#a": "./dist/index.js" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #2", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": "./" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #3", - expect: Some(vec!["./dist/a.js"]), - imports_field: imports_field(json!({ - "#a/": "./dist/", - "#a/index.js": "./dist/a.js" - })), - request: "#a/index.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #4", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "./browser/" - ] - }, - "#a/index.js": { - "browser": "./index.js" - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #5", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "./browser/" - ] - }, - "#a/index.js": { - "node": "./node.js" - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #6", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: "#a", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #7", - expect: Some(vec!["./src/index.js"]), // `enhanced_resolve` is `None` - imports_field: imports_field(json!({ - "#a": { - "default": "./src/index.js", - "browser": "./index.js", - "node": "./src/node/index.js" - } - })), - request: "#a", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #8", - expect: Some(vec!["./src/index.js"]), - imports_field: imports_field(json!({ - "#a": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #9", - expect: Some(vec!["./index"]), - imports_field: imports_field(json!({ - "#a": "./index" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #10", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/index": "./index.js" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #11", - // We throw InvalidPackageTarget - // expect: Some(vec!["b"]), - expect: None, - imports_field: imports_field(json!({ - "#a": "b" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #12", - // We throw InvalidPackageTarget - // expect: Some(vec!["b/index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "b/" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #13", - // We throw InvalidPackageTarget - // expect: Some(vec!["b#anotherhashishere"]), - expect: None, - imports_field: imports_field(json!({ - "#a?q=a#hashishere": "b#anotherhashishere" - })), - request: "#a?q=a#hashishere", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #1", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #2", - expect: Some(vec!["./import.mjs"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec!["import"], - }, - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./require.js"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./import.mjs"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./require.js"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": [ - "./require.js" - ] - }, - { - "import": [ - "./import.mjs", - "#b/import.js" - ] - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./import.mjs"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "./import.mjs", - "#b/import.js" - ] - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "#b/import.js" - ] - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "mapping to a folder root #1", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#timezones": "./data/timezones/" - })), - request: "#timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #2", - expect: None, - imports_field: imports_field(json!({ - "#timezones/": "./data/timezones" - })), - request: "#timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #3", - expect: Some(vec!["./data/timezones/pdt/index.mjs"]), - imports_field: imports_field(json!({ - "#timezones/pdt/": "./data/timezones/pdt/" - })), - request: "#timezones/pdt/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #4", - expect: Some(vec!["./timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#a/": "./timezones/" - })), - request: "#a/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #5", - expect: Some(vec!["./timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#a/": "./" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #6", - expect: None, - imports_field: imports_field(json!({ - "#a/": "." - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #7", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": "./" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #1", - expect: Some(vec!["./lib/index.mjs"]), - imports_field: imports_field(json!({ - "#a/": "./", - "#a/dist/": "./lib/" - })), - request: "#a/dist/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #2", - expect: Some(vec!["./dist/utils/index.js"]), - imports_field: imports_field(json!({ - "#a/dist/utils/": "./dist/utils/", - "#a/dist/": "./lib/" - })), - request: "#a/dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #3", - expect: Some(vec!["./dist/utils/index.js"]), - imports_field: imports_field(json!({ - "#a/dist/utils/index.js": "./dist/utils/index.js", - "#a/dist/utils/": "./dist/utils/index.mjs", - "#a/dist/": "./lib/" - })), - request: "#a/dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #4", - expect: Some(vec!["./lib/index.mjs"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./browser/" - }, - "#a/dist/": "./lib/" - })), - request: "#a/dist/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #1", - // This behaves differently from enhanced_resolve, because `lodash/` is an an InvalidPackageConfig - // expect: Some(vec!["lodash/index.js"]), - expect: Some(vec!["./utils/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "conditional mapping folder #1", - expect: Some(vec!["./utils/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #2", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./node/" - ] - } - })), - request: "#a/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "conditional mapping folder #3", - expect: Some(vec!["./wpk/index.mjs"]), - imports_field: imports_field(json!({ - "#a/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils/" - ] - } - })), - request: "#a/index.mjs", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "incorrect exports field #1", - // We throw `PackageImportNotDefined` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "/utils/": "./a/" - })), - request: "#a/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #2", - // We throw `PackageImportNotDefined` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "/utils/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#a/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #3", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index": "./a/index.js" - })), - request: "#a/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #4", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index.mjs": "./a/index.js" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #5", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "#a/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #6", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index.mjs": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "#a/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #1", - // We don't throw in `package_imports_exports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": "./a/" - })), - request: "/utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect request #2", - // We don't throw in `package_imports_exports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #3", - // We don't throw in `package_imports_exports_resolve`, it's thrown in `package_imports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #4", - // We don't throw in `package_imports_exports_resolve`, it's thrown in `package_imports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#/", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #5", - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#a/", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #1", - // expect: Some(vec!["./dist/index"]), - expect: Some(vec!["dist/index"]), - imports_field: imports_field(json!({ - "#a/../../utils/": "./dist/" - })), - request: "#a/../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #2", - // We throw InvalidPackageTarget - // expect: Some(vec!["./dist/../../utils/index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "./dist/" - })), - request: "#a/../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #3", - // We throw InvalidPackageTarget - // expect: Some(vec!["../src/index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "../src/" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #4", - // We throw InvalidPackageTarget - // expect: Some(vec!["./utils/../../../index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": { - "browser": "./utils/../../../" - } - })), - request: "#a/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #1", - // expect: Some(vec!["moment/node_modules/lodash/dist/index.js"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": { - "browser": "moment/node_modules/" - } - })), - request: "#a/lodash/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #2", - // We throw InvalidPackageTarget - // expect: Some(vec!["../node_modules/lodash/dist/index.js"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "../node_modules/" - })), - request: "#a/lodash/dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "nested mapping #1", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": "./", - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./node/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "nested mapping #3", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["webpack"], - }, - TestCase { - name: "nested mapping #4", - // We throw NotFound - // expect: Some(vec!["moment/node/index.js"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "moment/node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["node", "browser"], - }, - TestCase { - name: "nested mapping #5", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "node"], - }, - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./node/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - TestCase { - name: "nested mapping #7", - expect: Some(vec!["./y.js"]), - imports_field: imports_field(json!({ - "#a": { - "abc": { - "def": "./x.js" - }, - "ghi": "./y.js" - } - })), - request: "#a", - condition_names: vec!["abc", "ghi"], - }, - TestCase { - name: "nested mapping #8", - // We throw PackageImportNotDefined - // expect: Some(vec![]), - expect: None, - imports_field: imports_field(json!({ - "#a": { - "abc": { - "def": "./x.js", - "default": [] - }, - "ghi": "./y.js" - } - })), - request: "#a", - condition_names: vec!["abc", "ghi"], - }, - ]; - - for case in test_cases { - let resolved = Resolver::default() - .package_imports_exports_resolve( - case.request, - &case.imports_field, - Path::new(""), - true, - &case.condition_names.iter().map(ToString::to_string).collect::>(), - &mut Ctx::default(), - ) - .map(|p| p.map(|p| p.to_path_buf())); - if let Some(expect) = case.expect { - if expect.is_empty() { - assert!(matches!(resolved, Ok(None)), "{} {:?}", &case.name, &resolved); - } else { - for expect in expect { - assert_eq!(resolved, Ok(Some(Path::new(expect).normalize())), "{}", &case.name); - } - } - } else { - assert!(resolved.is_err(), "{} {resolved:?}", &case.name); - } - } -} diff --git a/src/tests/incorrect_description_file.rs b/src/tests/incorrect_description_file.rs deleted file mode 100644 index a5c81796..00000000 --- a/src/tests/incorrect_description_file.rs +++ /dev/null @@ -1,62 +0,0 @@ -//! - -use rustc_hash::FxHashSet; - -use crate::{JSONError, Resolution, ResolveContext, ResolveError, ResolveOptions, Resolver}; - -// should not resolve main in incorrect description file #1 -#[test] -fn incorrect_description_file_1() { - let f = super::fixture().join("incorrect-package"); - let mut ctx = ResolveContext::default(); - let resolution = Resolver::default().resolve_with_context(f.join("pack1"), ".", &mut ctx); - let error = ResolveError::JSON(JSONError { - path: f.join("pack1/package.json"), - message: String::from("EOF while parsing a value at line 3 column 0"), - line: 3, - column: 0, - }); - assert_eq!(resolution, Err(error)); - assert_eq!(ctx.file_dependencies, FxHashSet::from_iter([f.join("pack1/package.json")])); - assert!(ctx.missing_dependencies.is_empty()); -} - -// should not resolve main in incorrect description file #2 -#[test] -fn incorrect_description_file_2() { - let f = super::fixture().join("incorrect-package"); - let resolution = Resolver::default().resolve(f.join("pack2"), "."); - let error = ResolveError::JSON(JSONError { - path: f.join("pack2/package.json"), - message: String::from("EOF while parsing a value at line 1 column 0"), - line: 1, - column: 0, - }); - assert_eq!(resolution, Err(error)); -} - -// should not resolve main in incorrect description file #3 -#[test] -fn incorrect_description_file_3() { - let f = super::fixture().join("incorrect-package"); - let resolution = Resolver::default().resolve(f.join("pack2"), "."); - assert!(resolution.is_err()); -} - -// `enhanced_resolve` does not have this test case -#[test] -fn no_description_file() { - let f = super::fixture_root().join("enhanced_resolve"); - - // has description file - let resolver = Resolver::default(); - assert_eq!( - resolver.resolve(&f, ".").map(Resolution::into_path_buf), - Ok(f.join("lib/index.js")) - ); - - // without description file - let resolver = - Resolver::new(ResolveOptions { description_files: vec![], ..ResolveOptions::default() }); - assert_eq!(resolver.resolve(&f, "."), Err(ResolveError::NotFound(".".into()))); -} diff --git a/src/tests/main_field.rs b/src/tests/main_field.rs deleted file mode 100644 index 3cadc8ce..00000000 --- a/src/tests/main_field.rs +++ /dev/null @@ -1,24 +0,0 @@ -//! Not part of enhanced_resolve's test suite - -use crate::{ResolveOptions, Resolver}; - -#[test] -fn test() { - let f = super::fixture().join("restrictions"); - - let resolver1 = Resolver::new(ResolveOptions { - main_fields: vec!["style".into()], - ..ResolveOptions::default() - }); - - let resolution = resolver1.resolve(&f, "pck2").map(|r| r.full_path()); - assert_eq!(resolution, Ok(f.join("node_modules/pck2/index.css"))); - - let resolver2 = resolver1.clone_with_options(ResolveOptions { - main_fields: vec!["module".into(), "main".into()], - ..ResolveOptions::default() - }); - - let resolution = resolver2.resolve(&f, "pck2").map(|r| r.full_path()); - assert_eq!(resolution, Ok(f.join("node_modules/pck2/module.js"))); -} diff --git a/src/tests/memory_fs.rs b/src/tests/memory_fs.rs deleted file mode 100644 index e4116609..00000000 --- a/src/tests/memory_fs.rs +++ /dev/null @@ -1,74 +0,0 @@ -use std::{ - io, - path::{Path, PathBuf}, -}; - -use crate::{FileMetadata, FileSystem}; - -#[derive(Default)] -pub struct MemoryFS { - fs: vfs::MemoryFS, -} - -impl MemoryFS { - /// # Panics - /// - /// * Fails to create directory - /// * Fails to write file - #[allow(dead_code)] - pub fn new(data: &[(&'static str, &'static str)]) -> Self { - let mut fs = Self { fs: vfs::MemoryFS::default() }; - for (path, content) in data { - fs.add_file(Path::new(path), content); - } - fs - } - - #[allow(dead_code)] - pub fn add_file(&mut self, path: &Path, content: &str) { - use vfs::FileSystem; - let fs = &mut self.fs; - // Create all parent directories - for path in path.ancestors().collect::>().iter().rev() { - let path = path.to_string_lossy(); - if !fs.exists(path.as_ref()).unwrap() { - fs.create_dir(path.as_ref()).unwrap(); - } - } - // Create file - let mut file = fs.create_file(path.to_string_lossy().as_ref()).unwrap(); - file.write_all(content.as_bytes()).unwrap(); - } -} - -impl FileSystem for MemoryFS { - fn read_to_string(&self, path: &Path) -> io::Result { - use vfs::FileSystem; - let mut file = self - .fs - .open_file(path.to_string_lossy().as_ref()) - .map_err(|err| io::Error::new(io::ErrorKind::NotFound, err))?; - let mut buffer = String::new(); - file.read_to_string(&mut buffer).unwrap(); - Ok(buffer) - } - - fn metadata(&self, path: &Path) -> io::Result { - use vfs::FileSystem; - let metadata = self - .fs - .metadata(path.to_string_lossy().as_ref()) - .map_err(|err| io::Error::new(io::ErrorKind::NotFound, err))?; - let is_file = metadata.file_type == vfs::VfsFileType::File; - let is_dir = metadata.file_type == vfs::VfsFileType::Directory; - Ok(FileMetadata::new(is_file, is_dir, false)) - } - - fn symlink_metadata(&self, path: &Path) -> io::Result { - self.metadata(path) - } - - fn canonicalize(&self, _path: &Path) -> io::Result { - Err(io::Error::new(io::ErrorKind::NotFound, "not a symlink")) - } -} diff --git a/src/tests/missing.rs b/src/tests/missing.rs deleted file mode 100644 index 4bf611ef..00000000 --- a/src/tests/missing.rs +++ /dev/null @@ -1,106 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/missing.test.js - -use normalize_path::NormalizePath; - -use crate::{AliasValue, ResolveContext, ResolveOptions, Resolver}; - -#[test] -fn test() { - let f = super::fixture(); - - let data = [ - ( - "./missing-file", - vec![f.join("missing-file"), f.join("missing-file.js"), f.join("missing-file.node")], - ), - ( - "missing-module", - vec![ - f.join("node_modules/missing-module"), - f.parent().unwrap().join("node_modules"), // enhanced-resolve is "node_modules/missing-module" - ], - ), - ( - "missing-module/missing-file", - vec![ - f.join("node_modules/missing-module"), - // f.parent().unwrap().join("node_modules/missing-module"), // we don't report this - ], - ), - ( - "m1/missing-file", - vec![ - f.join("node_modules/m1/missing-file"), - f.join("node_modules/m1/missing-file.js"), - f.join("node_modules/m1/missing-file.node"), - // f.parent().unwrap().join("node_modules/m1"), // we don't report this - ], - ), - ( - "m1/", - vec![ - f.join("node_modules/m1/index"), - f.join("node_modules/m1/index.js"), - f.join("node_modules/m1/index.json"), - f.join("node_modules/m1/index.node"), - ], - ), - ("m1/a", vec![f.join("node_modules/m1/a")]), - ]; - - let resolver = Resolver::default(); - - for (specifier, missing_dependencies) in data { - let mut ctx = ResolveContext::default(); - let _ = resolver.resolve_with_context(&f, specifier, &mut ctx); - - for path in ctx.file_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - } - - for path in missing_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - assert!( - ctx.missing_dependencies.contains(&path), - "{specifier}: {path:?} not in {:?}", - &ctx.missing_dependencies - ); - } - } -} - -#[test] -fn alias_and_extensions() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias: vec![ - ( - "@scope-js/package-name/dir$".into(), - vec![AliasValue::Path(f.join("foo/index.js").to_string_lossy().to_string())], - ), - ( - "react-dom".into(), - vec![AliasValue::Path(f.join("foo/index.js").to_string_lossy().to_string())], - ), - ], - extensions: vec![".server.ts".into()], - - ..ResolveOptions::default() - }); - - let mut ctx = ResolveContext::default(); - let _ = resolver.resolve_with_context(&f, "@scope-js/package-name/dir/router", &mut ctx); - let _ = resolver.resolve_with_context(&f, "react-dom/client", &mut ctx); - - for path in ctx.file_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - } - - for path in ctx.missing_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - if let Some(path) = path.parent() { - assert!(!path.is_file(), "{path:?} must not be a file"); - } - } -} diff --git a/src/tests/mod.rs b/src/tests/mod.rs deleted file mode 100644 index 94e6bd86..00000000 --- a/src/tests/mod.rs +++ /dev/null @@ -1,49 +0,0 @@ -mod alias; -mod browser_field; -mod builtins; -mod dependencies; -mod exports_field; -mod extension_alias; -mod extensions; -mod fallback; -mod full_specified; -mod imports_field; -mod incorrect_description_file; -mod main_field; -mod memory_fs; -mod missing; -mod resolve; -mod restrictions; -mod roots; -mod scoped_packages; -mod simple; -mod symlink; -mod tsconfig_paths; -mod tsconfig_project_references; - -use crate::Resolver; -use std::{env, path::PathBuf, sync::Arc, thread}; - -pub fn fixture_root() -> PathBuf { - env::current_dir().unwrap().join("fixtures") -} - -pub fn fixture() -> PathBuf { - fixture_root().join("enhanced_resolve").join("test").join("fixtures") -} - -#[test] -fn threaded_environment() { - let cwd = env::current_dir().unwrap(); - let resolver = Arc::new(Resolver::default()); - for _ in 0..2 { - _ = thread::spawn({ - let cwd = cwd.clone(); - let resolver = Arc::clone(&resolver); - move || { - _ = resolver.resolve(cwd, "."); - } - }) - .join(); - } -} diff --git a/src/tests/resolve.rs b/src/tests/resolve.rs deleted file mode 100644 index f2dbb88e..00000000 --- a/src/tests/resolve.rs +++ /dev/null @@ -1,119 +0,0 @@ -//! - -use crate::{ResolveError, ResolveOptions, Resolver}; - -#[test] -fn resolve() { - let f = super::fixture(); - - let resolver = Resolver::default(); - - let main1_js_path = f.join("main1.js").to_string_lossy().to_string(); - - #[rustfmt::skip] - let pass = [ - ("absolute path", f.clone(), main1_js_path.as_str(), f.join("main1.js")), - ("file with .js", f.clone(), "./main1.js", f.join("main1.js")), - ("file without extension", f.clone(), "./main1", f.join("main1.js")), - ("another file with .js", f.clone(), "./a.js", f.join("a.js")), - ("another file without extension", f.clone(), "./a", f.join("a.js")), - ("file in module with .js", f.clone(), "m1/a.js", f.join("node_modules/m1/a.js")), - ("file in module without extension", f.clone(), "m1/a", f.join("node_modules/m1/a.js")), - ("another file in module without extension", f.clone(), "complexm/step1", f.join("node_modules/complexm/step1.js")), - ("from submodule to file in sibling module", f.join("node_modules/complexm"), "m2/b.js", f.join("node_modules/m2/b.js")), - ("from nested directory to overwritten file in module", f.join("multiple_modules"), "m1/a.js", f.join("multiple_modules/node_modules/m1/a.js")), - ("from nested directory to not overwritten file in module", f.join("multiple_modules"), "m1/b.js", f.join("node_modules/m1/b.js")), - ("file with query", f.clone(), "./main1.js?query", f.join("main1.js?query")), - ("file with fragment", f.clone(), "./main1.js#fragment", f.join("main1.js#fragment")), - ("file with fragment and query", f.clone(), "./main1.js#fragment?query", f.join("main1.js#fragment?query")), - ("file with query and fragment", f.clone(), "./main1.js?#fragment", f.join("main1.js?#fragment")), - - ("file with query (unicode)", f.clone(), "./测试.js?query", f.join("测试.js?query")), - ("file with fragment (unicode)", f.clone(), "./测试.js#fragment", f.join("测试.js#fragment")), - ("file with fragment and query (unicode)", f.clone(), "./测试.js#fragment?query", f.join("测试.js#fragment?query")), - ("file with query and fragment (unicode)", f.clone(), "./测试.js?#fragment", f.join("测试.js?#fragment")), - - ("file in module with query", f.clone(), "m1/a?query", f.join("node_modules/m1/a.js?query")), - ("file in module with fragment", f.clone(), "m1/a#fragment", f.join("node_modules/m1/a.js#fragment")), - ("file in module with fragment and query", f.clone(), "m1/a#fragment?query", f.join("node_modules/m1/a.js#fragment?query")), - ("file in module with query and fragment", f.clone(), "m1/a?#fragment", f.join("node_modules/m1/a.js?#fragment")), - ("file in module with query and fragment", f.clone(), "m1/a?#fragment", f.join("node_modules/m1/a.js?#fragment")), - ("differ between directory and file, resolve file", f.clone(), "./dirOrFile", f.join("dirOrFile.js")), - ("differ between directory and file, resolve directory", f.clone(), "./dirOrFile/", f.join("dirOrFile/index.js")), - ("find node_modules outside of node_modules", f.join("browser-module/node_modules"), "m1/a", f.join("node_modules/m1/a.js")), - ("don't crash on main field pointing to self", f.clone(), "./main-field-self", f.join("./main-field-self/index.js")), - ("don't crash on main field pointing to self (2)", f.clone(), "./main-field-self2", f.join("./main-field-self2/index.js")), - // enhanced-resolve has `#` prepended with a `\0`, they are removed from the - // following 3 expected test results. - // See https://github.com/webpack/enhanced-resolve#escaping - ("handle fragment edge case (no fragment)", f.clone(), "./no#fragment/#/#", f.join("no#fragment/#/#.js")), - ("handle fragment edge case (fragment)", f.clone(), "./no#fragment/#/", f.join("no.js#fragment/#/")), - ("handle fragment escaping", f.clone(), "./no\0#fragment/\0#/\0##fragment", f.join("no#fragment/#/#.js#fragment")), - - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn issue238_resolve() { - let f = super::fixture().join("issue-238"); - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into(), ".jsx".into(), ".ts".into(), ".tsx".into()], - modules: vec!["src/a".into(), "src/b".into(), "src/common".into(), "node_modules".into()], - ..ResolveOptions::default() - }); - let resolved_path = - resolver.resolve(f.join("src/common"), "config/myObjectFile").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("src/common/config/myObjectFile.js")),); -} - -#[test] -fn prefer_relative() { - let f = super::fixture(); - - let resolver = - Resolver::new(ResolveOptions { prefer_relative: true, ..ResolveOptions::default() }); - - #[rustfmt::skip] - let pass = [ - ("should correctly resolve with preferRelative 1", "main1.js", f.join("main1.js")), - ("should correctly resolve with preferRelative 2", "m1/a.js", f.join("node_modules/m1/a.js")), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } -} - -#[test] -fn resolve_to_context() { - let f = super::fixture(); - let resolver = - Resolver::new(ResolveOptions { resolve_to_context: true, ..ResolveOptions::default() }); - - #[rustfmt::skip] - let data = [ - ("context for fixtures", f.clone(), "./", f.clone()), - ("context for fixtures/lib", f.clone(), "./lib", f.join("lib")), - ("context for fixtures with ..", f.clone(), "./lib/../../fixtures/./lib/..", f.clone()), - ("context for fixtures with query", f.clone(), "./?query", f.clone().with_file_name("fixtures?query")), - ]; - - for (comment, path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn resolve_hash_as_module() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions::default()); - let resolution = resolver.resolve(f, "#a"); - assert_eq!(resolution, Err(ResolveError::NotFound("#a".into()))); -} diff --git a/src/tests/restrictions.rs b/src/tests/restrictions.rs deleted file mode 100644 index 5ba56596..00000000 --- a/src/tests/restrictions.rs +++ /dev/null @@ -1,25 +0,0 @@ -//! - -use crate::{ResolveError, ResolveOptions, Resolver, Restriction}; - -// TODO: regex -// * should respect RegExp restriction -// * should try to find alternative #1 -// * should try to find alternative #2 -// * should try to find alternative #3 - -// should respect string restriction -#[test] -fn restriction1() { - let fixture = super::fixture(); - let f = fixture.join("restrictions"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - restrictions: vec![Restriction::Path(f.clone())], - ..ResolveOptions::default() - }); - - let resolution = resolver.resolve(&f, "pck2"); - assert_eq!(resolution, Err(ResolveError::Restriction(fixture.join("c.js"), f))); -} diff --git a/src/tests/roots.rs b/src/tests/roots.rs deleted file mode 100644 index b50e2a07..00000000 --- a/src/tests/roots.rs +++ /dev/null @@ -1,92 +0,0 @@ -//! - -use std::path::PathBuf; - -use crate::{AliasValue, ResolveError, ResolveOptions, Resolver}; - -fn dirname() -> PathBuf { - super::fixture_root().join("enhanced_resolve").join("test") -} - -#[test] -fn roots() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - alias: vec![("foo".into(), vec![AliasValue::from("/fixtures")])], - roots: vec![dirname(), f.clone()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should respect roots option", "/fixtures/b.js", f.join("b.js")), - ("should try another root option, if it exists", "/b.js", f.join("b.js")), - ("should respect extension", "/fixtures/b", f.join("b.js")), - ("should resolve in directory", "/fixtures/extensions/dir", f.join("extensions/dir/index.js")), - ("should respect aliases", "foo/b", f.join("b.js")), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } - - #[rustfmt::skip] - let fail = [ - ("should not work with relative path", "fixtures/b.js", ResolveError::NotFound("fixtures/b.js".into())) - ]; - - for (comment, request, expected) in fail { - let resolution = resolver.resolve(&f, request); - assert_eq!(resolution, Err(expected), "{comment} {request}"); - } -} - -#[test] -fn resolve_to_context() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - roots: vec![dirname(), f.clone()], - resolve_to_context: true, - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f, "/fixtures/lib").map(|r| r.full_path()); - let expected = f.join("lib"); - assert_eq!(resolved_path, Ok(expected)); -} - -#[test] -fn prefer_absolute() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - alias: vec![("foo".into(), vec![AliasValue::from("/fixtures")])], - roots: vec![dirname(), f.clone()], - prefer_absolute: true, - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve an absolute path (prefer absolute)", f.join("b.js").to_string_lossy().to_string(), f.join("b.js")), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(&f, &request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } -} - -#[test] -fn roots_fall_through() { - let f = super::fixture(); - let absolute_path = f.join("roots_fall_through/index.js"); - let specifier = absolute_path.to_string_lossy(); - let resolution = Resolver::new(ResolveOptions::default().with_root(&f)).resolve(&f, &specifier); - assert_eq!( - resolution.map(super::super::resolution::Resolution::into_path_buf), - Ok(absolute_path) - ); -} diff --git a/src/tests/scoped_packages.rs b/src/tests/scoped_packages.rs deleted file mode 100644 index 8258f00f..00000000 --- a/src/tests/scoped_packages.rs +++ /dev/null @@ -1,25 +0,0 @@ -//! - -use crate::{ResolveOptions, Resolver}; - -#[test] -fn scoped_packages() { - let f = super::fixture().join("scoped"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("main field should work", f.clone(), "@scope/pack1", f.join("./node_modules/@scope/pack1/main.js")), - ("browser field should work", f.clone(), "@scope/pack2", f.join("./node_modules/@scope/pack2/main.js")), - ("folder request should work", f.clone(), "@scope/pack2/lib", f.join("./node_modules/@scope/pack2/lib/index.js")) - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} diff --git a/src/tests/simple.rs b/src/tests/simple.rs deleted file mode 100644 index 08e1238a..00000000 --- a/src/tests/simple.rs +++ /dev/null @@ -1,68 +0,0 @@ -//! - -use std::env; - -use crate::Resolver; - -#[test] -fn simple() { - // mimic `enhanced-resolve/test/simple.test.js` - let dirname = env::current_dir().unwrap().join("fixtures"); - let f = dirname.join("enhanced_resolve/test"); - - let resolver = Resolver::default(); - - let data = [ - ("direct", f.clone(), "../lib/index"), - ("as directory", f, ".."), - ("as module", dirname.clone(), "./enhanced_resolve"), - ]; - - for (comment, path, request) in data { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - let expected = dirname.join("enhanced_resolve/lib/index.js"); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn dashed_name() { - let f = super::fixture(); - - let resolver = Resolver::default(); - - let data = [ - (f.clone(), "dash", f.join("node_modules/dash/index.js")), - (f.clone(), "dash-name", f.join("node_modules/dash-name/index.js")), - (f.join("node_modules/dash"), "dash", f.join("node_modules/dash/index.js")), - (f.join("node_modules/dash"), "dash-name", f.join("node_modules/dash-name/index.js")), - (f.join("node_modules/dash-name"), "dash", f.join("node_modules/dash/index.js")), - (f.join("node_modules/dash-name"), "dash-name", f.join("node_modules/dash-name/index.js")), - ]; - - for (path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{path:?} {request}"); - } -} - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows { - use super::super::memory_fs::MemoryFS; - - use crate::ResolveOptions; - - #[test] - fn no_package() { - use crate::ResolverGeneric; - use std::path::Path; - let f = Path::new("/"); - let file_system = MemoryFS::new(&[]); - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions::default(), - ); - let resolved_path = resolver.resolve(f, "package"); - assert!(resolved_path.is_err()); - } -} diff --git a/src/tests/symlink.rs b/src/tests/symlink.rs deleted file mode 100644 index 7589b560..00000000 --- a/src/tests/symlink.rs +++ /dev/null @@ -1,121 +0,0 @@ -use std::{fs, io, path::Path}; - -use crate::{ResolveOptions, Resolver}; - -#[derive(Debug, Clone, Copy)] -enum FileType { - File, - Dir, -} - -#[allow(unused_variables)] -fn symlink, Q: AsRef>( - original: P, - link: Q, - file_type: FileType, -) -> io::Result<()> { - #[cfg(target_family = "unix")] - { - std::os::unix::fs::symlink(original, link) - } - - #[cfg(target_family = "windows")] - match file_type { - FileType::File => std::os::windows::fs::symlink_file(original, link), - FileType::Dir => std::os::windows::fs::symlink_dir(original, link), - } -} - -fn init(dirname: &Path, temp_path: &Path) -> io::Result<()> { - if temp_path.exists() { - _ = fs::remove_dir_all(temp_path); - } - fs::create_dir(temp_path)?; - symlink(dirname.join("../lib/index.js"), temp_path.join("test"), FileType::File)?; - symlink(dirname.join("../lib"), temp_path.join("test2"), FileType::Dir)?; - fs::remove_file(temp_path.join("test"))?; - fs::remove_file(temp_path.join("test2"))?; - fs::remove_dir(temp_path) -} - -fn create_symlinks(dirname: &Path, temp_path: &Path) -> io::Result<()> { - fs::create_dir(temp_path).unwrap(); - symlink( - dirname.join("../lib/index.js").canonicalize().unwrap(), - temp_path.join("index.js"), - FileType::File, - )?; - symlink(dirname.join("../lib").canonicalize().unwrap(), temp_path.join("lib"), FileType::Dir)?; - symlink(dirname.join("..").canonicalize().unwrap(), temp_path.join("this"), FileType::Dir)?; - symlink(temp_path.join("this"), temp_path.join("that"), FileType::Dir)?; - symlink(Path::new("../../lib/index.js"), temp_path.join("node.relative.js"), FileType::File)?; - symlink( - Path::new("./node.relative.js"), - temp_path.join("node.relative.sym.js"), - FileType::File, - )?; - Ok(()) -} - -fn cleanup_symlinks(temp_path: &Path) { - _ = fs::remove_dir_all(temp_path); -} - -#[test] -fn test() -> io::Result<()> { - let root = super::fixture_root().join("enhanced_resolve"); - let dirname = root.join("test"); - let temp_path = dirname.join("temp"); - if !temp_path.exists() { - let is_admin = init(&dirname, &temp_path).is_ok(); - if !is_admin { - return Ok(()); - } - if let Err(err) = create_symlinks(&dirname, &temp_path) { - cleanup_symlinks(&temp_path); - return Err(err); - } - } - - let resolver_without_symlinks = - Resolver::new(ResolveOptions { symlinks: false, ..ResolveOptions::default() }); - let resolver_with_symlinks = Resolver::default(); - - #[rustfmt::skip] - let pass = [ - ("with a symlink to a file", temp_path.clone(), "./index.js"), - ("with a relative symlink to a file", temp_path.clone(), "./node.relative.js"), - ("with a relative symlink to a symlink to a file", temp_path.clone(), "./node.relative.sym.js"), - ("with a symlink to a directory 1", temp_path.clone(), "./lib/index.js"), - ("with a symlink to a directory 2", temp_path.clone(), "./this/lib/index.js"), - ("with multiple symlinks in the path 1", temp_path.clone(), "./this/test/temp/index.js"), - ("with multiple symlinks in the path 2", temp_path.clone(), "./this/test/temp/lib/index.js"), - ("with multiple symlinks in the path 3", temp_path.clone(), "./this/test/temp/this/lib/index.js"), - ("with a symlink to a directory 2 (chained)", temp_path.clone(), "./that/lib/index.js"), - ("with multiple symlinks in the path 1 (chained)", temp_path.clone(), "./that/test/temp/index.js"), - ("with multiple symlinks in the path 2 (chained)", temp_path.clone(), "./that/test/temp/lib/index.js"), - ("with multiple symlinks in the path 3 (chained)", temp_path.clone(), "./that/test/temp/that/lib/index.js"), - ("with symlinked directory as context 1", temp_path.join( "lib"), "./index.js"), - ("with symlinked directory as context 2", temp_path.join( "this"), "./lib/index.js"), - ("with symlinked directory as context and in path", temp_path.join( "this"), "./test/temp/lib/index.js"), - ("with symlinked directory in context path", temp_path.join( "this/lib"), "./index.js"), - ("with symlinked directory in context path and symlinked file", temp_path.join( "this/test"), "./temp/index.js"), - ("with symlinked directory in context path and symlinked directory", temp_path.join( "this/test"), "./temp/lib/index.js"), - ("with symlinked directory as context 2 (chained)", temp_path.join( "that"), "./lib/index.js"), - ("with symlinked directory as context and in path (chained)", temp_path.join( "that"), "./test/temp/lib/index.js"), - ("with symlinked directory in context path (chained)", temp_path.join( "that/lib"), "./index.js"), - ("with symlinked directory in context path and symlinked file (chained)", temp_path.join( "that/test"), "./temp/index.js"), - ("with symlinked directory in context path and symlinked directory (chained)", temp_path.join( "that/test"), "./temp/lib/index.js") - ]; - - for (comment, path, request) in pass { - let filename = resolver_with_symlinks.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(filename, Ok(root.join("lib/index.js")), "{comment:?}"); - - let resolved_path = - resolver_without_symlinks.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(path.join(request))); - } - - Ok(()) -} diff --git a/src/tests/tsconfig_paths.rs b/src/tests/tsconfig_paths.rs deleted file mode 100644 index 26935b5c..00000000 --- a/src/tests/tsconfig_paths.rs +++ /dev/null @@ -1,507 +0,0 @@ -//! tests for tsconfig-paths -//! -//! Fixtures copied from . - -use std::path::{Path, PathBuf}; - -use crate::{ - ResolveError, ResolveOptions, Resolver, TsConfig, TsconfigOptions, TsconfigReferences, -}; - -// -#[test] -fn tsconfig() { - let f = super::fixture_root().join("tsconfig"); - - #[rustfmt::skip] - let pass = [ - (f.clone(), None, "ts-path", f.join("foo.js")), - (f.join("nested"), None, "ts-path", f.join("nested/test.js")), - (f.join("cases/index"), None, "foo", f.join("node_modules/tsconfig-index/foo.js")), - // This requires reading package.json.tsconfig field - // (f.join("cases/field"), "foo", f.join("node_modules/tsconfig-field/foo.js")) - (f.join("cases/exports"), None, "foo", f.join("node_modules/tsconfig-exports/foo.js")), - (f.join("cases/extends-extension"), None, "foo", f.join("cases/extends-extension/foo.js")), - (f.join("cases/extends-extensionless"), None, "foo", f.join("node_modules/tsconfig-field/foo.js")), - (f.join("cases/extends-paths"), Some("src"), "@/index", f.join("cases/extends-paths/src/index.js")), - (f.join("cases/extends-multiple"), None, "foo", f.join("cases/extends-multiple/foo.js")), - ]; - - for (dir, subdir, request, expected) in pass { - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: dir.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - let path = subdir.map_or(dir.clone(), |subdir| dir.join(subdir)); - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{request} {path:?}"); - } - - #[rustfmt::skip] - let data = [ - (f.join("node_modules/tsconfig-not-used"), "ts-path", Ok(f.join("foo.js"))), - ]; - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - for (path, request, expected) in data { - let resolution = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolution, expected, "{path:?} {request}"); - } -} - -#[test] -fn tsconfig_fallthrough() { - let f = super::fixture_root().join("tsconfig"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "/"); - assert_eq!(resolved_path, Err(ResolveError::NotFound("/".into()))); -} - -#[test] -fn json_with_comments() { - let f = super::fixture_root().join("tsconfig/cases/trailing-comma"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "foo").map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(f.join("bar.js"))); -} - -// -#[test] -fn test_paths() { - let path = Path::new("/foo/tsconfig.json"); - let mut tsconfig_json = serde_json::json!({ - "compilerOptions": { - "paths": { - "jquery": ["node_modules/jquery/dist/jquery"], - "*": ["generated/*"], - "bar/*": ["test/*"], - "bar/baz/*": ["baz/*", "yo/*"], - "@/components/*": ["components/*"], - "url": ["node_modules/my-url"], - } - } - }) - .to_string(); - let tsconfig = TsConfig::parse(true, path, &mut tsconfig_json).unwrap(); - - let data = [ - ("jquery", vec!["/foo/node_modules/jquery/dist/jquery"]), - ("test", vec!["/foo/generated/test"]), - ("test/hello", vec!["/foo/generated/test/hello"]), - ("bar/hi", vec!["/foo/test/hi"]), - ("bar/baz/hi", vec!["/foo/baz/hi", "/foo/yo/hi"]), - ("@/components/button", vec!["/foo/components/button"]), - ("./jquery", vec![]), - ("url", vec!["/foo/node_modules/my-url"]), - ]; - - for (specifier, expected) in data { - let paths = tsconfig.resolve_path_alias(specifier); - let expected = expected.into_iter().map(PathBuf::from).collect::>(); - assert_eq!(paths, expected, "{specifier}"); - } -} - -// -#[test] -fn test_base_url() { - let path = Path::new("/foo/tsconfig.json"); - let mut tsconfig_json = serde_json::json!({ - "compilerOptions": { - "baseUrl": "./src" - } - }) - .to_string(); - let tsconfig = TsConfig::parse(true, path, &mut tsconfig_json).unwrap(); - - let data = [ - ("foo", vec!["/foo/src/foo"]), - ("components/button", vec!["/foo/src/components/button"]), - ("./jquery", vec![]), - ]; - - for (specifier, expected) in data { - let paths = tsconfig.resolve_path_alias(specifier); - let expected = expected.into_iter().map(PathBuf::from).collect::>(); - assert_eq!(paths, expected, "{specifier}"); - } -} - -// -#[test] -fn test_paths_and_base_url() { - let path = Path::new("/foo/tsconfig.json"); - let mut tsconfig_json = serde_json::json!({ - "compilerOptions": { - "baseUrl": "./src", - "paths": { - "*": ["generated/*"], - "bar/*": ["test/*"], - "bar/baz/*": ["baz/*", "yo/*"], - "@/components/*": ["components/*"] - } - } - }) - .to_string(); - let tsconfig = TsConfig::parse(true, path, &mut tsconfig_json).unwrap(); - - let data = [ - ("test", vec!["/foo/src/generated/test", "/foo/src/test"]), - ("test/hello", vec!["/foo/src/generated/test/hello", "/foo/src/test/hello"]), - ("bar/hi", vec!["/foo/src/test/hi", "/foo/src/bar/hi"]), - ("bar/baz/hi", vec!["/foo/src/baz/hi", "/foo/src/yo/hi", "/foo/src/bar/baz/hi"]), - ("@/components/button", vec!["/foo/src/components/button", "/foo/src/@/components/button"]), - ("./jquery", vec![]), - ]; - - for (specifier, expected) in data { - let paths = tsconfig.resolve_path_alias(specifier); - let expected = expected.into_iter().map(PathBuf::from).collect::>(); - assert_eq!(paths, expected, "{specifier}"); - } -} - -// Template variable ${configDir} for substitution of config files directory path -// https://github.com/microsoft/TypeScript/pull/58042 -#[test] -fn test_template_variable() { - let f = super::fixture_root().join("tsconfig"); - let f2 = f.join("cases").join("paths_template_variable"); - - #[rustfmt::skip] - let pass = [ - (f2.clone(), "tsconfig1.json", "foo", f2.join("foo.js")), - (f2.clone(), "tsconfig2.json", "foo", f2.join("foo.js")), - (f.clone(), "tsconfig_template_variable.json", "foo", f.join("foo.js")), - ]; - - for (dir, tsconfig, request, expected) in pass { - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: dir.join(tsconfig), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&dir, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{request} {tsconfig} {dir:?}"); - } -} - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows_test { - use std::path::{Path, PathBuf}; - - use crate::{ - ResolveError, ResolveOptions, ResolverGeneric, TsconfigOptions, TsconfigReferences, - }; - - use super::super::memory_fs::MemoryFS; - - struct OneTest { - name: &'static str, - tsconfig: String, - package_json: Option<(PathBuf, String)>, - main_fields: Option>, - existing_files: Vec<&'static str>, - requested_module: &'static str, - expected_path: &'static str, - extensions: Vec, - } - - impl Default for OneTest { - fn default() -> Self { - Self { - name: "", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/*": ["location/*"] - } - } - }) - .to_string(), - package_json: None, - main_fields: None, - existing_files: vec![], - requested_module: "", - expected_path: "", - extensions: vec![ - ".js".into(), - ".json".into(), - ".node".into(), - ".ts".into(), - ".tsx".into(), - ], - } - } - } - - impl OneTest { - fn resolver(&self, root: &Path) -> ResolverGeneric { - let mut file_system = MemoryFS::default(); - - file_system.add_file(&root.join("tsconfig.json"), &self.tsconfig); - if let Some((path, package_json)) = &self.package_json { - file_system.add_file(&root.join(path).join("package.json"), package_json); - } - for path in &self.existing_files { - file_system.add_file(Path::new(path), ""); - } - - let mut options = ResolveOptions { - extensions: self.extensions.clone(), - tsconfig: Some(TsconfigOptions { - config_file: root.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }; - if let Some(main_fields) = &self.main_fields { - options.main_fields.clone_from(main_fields); - } - - ResolverGeneric::::new_with_file_system(file_system, options) - } - } - - // Path matching tests from tsconfig-paths - // * - // * - #[test] - fn match_path() { - let pass = [ - OneTest { - name: "should locate path that matches with star and exists", - existing_files: vec!["/root/location/mylib/index.ts"], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve to correct path when many are specified", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/*": ["foo1/*", "foo2/*", "location/*", "foo3/*"], - } - } - }) - .to_string(), - existing_files: vec!["/root/location/mylib/index.ts"], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should locate path that matches with star and prioritize pattern with longest prefix", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "*": ["location/*"], - "lib/*": ["location/*"], - } - } - }) - .to_string(), - existing_files: vec![ - "/root/location/lib/mylib/index.ts", - "/root/location/mylib/index.ts", - ], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should locate path that matches with star and exists with extension", - existing_files: vec![ - "/root/location/mylib.myext", - ], - requested_module: "lib/mylib", - extensions: vec![".js".into(), ".myext".into()], - expected_path: "/root/location/mylib.myext", - ..OneTest::default() - }, - OneTest { - name: "should resolve request with extension specified", - existing_files: vec![ - "/root/location/test.jpg", - ], - requested_module: "lib/test.jpg", - expected_path: "/root/location/test.jpg", - ..OneTest::default() - }, - OneTest { - name: "should locate path that matches without star and exists", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/foo": ["location/foo"] - } - } - }) - .to_string(), - existing_files: vec![ - "/root/location/foo.ts", - ], - requested_module: "lib/foo", - expected_path: "/root/location/foo.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve to parent folder when filename is in subfolder", - existing_files: vec![ - "/root/location/mylib/index.ts", - ], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve from main field in package.json", - package_json: Some((PathBuf::from("/root/location/mylib"), serde_json::json!({ - "main": "./kalle.ts" - }).to_string())), - existing_files: vec![ - "/root/location/mylib/kalle.ts", - ], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/kalle.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve from main field in package.json (js)", - package_json: Some((PathBuf::from("/root/location/mylib.js"), serde_json::json!({ - "main": "./kalle.js" - }).to_string())), - existing_files: vec![ - "/root/location/mylib.js/kalle.js", - ], - extensions: vec![".ts".into(), ".js".into()], - requested_module: "lib/mylib.js", - expected_path: "/root/location/mylib.js/kalle.js", - ..OneTest::default() - }, - OneTest { - name: "should resolve from list of fields by priority in package.json", - main_fields: Some(vec!["missing".into(), "browser".into(), "main".into()]), - package_json: Some((PathBuf::from("/root/location/mylibjs"), serde_json::json!({ - "main": "./main.js", - "browser": "./browser.js" - }).to_string())), - existing_files: vec![ - "/root/location/mylibjs/main.js", - "/root/location/mylibjs/browser.js", - ], - extensions: vec![".ts".into(), ".js".into()], - requested_module: "lib/mylibjs", - expected_path: "/root/location/mylibjs/browser.js", - ..OneTest::default() - }, -OneTest { - name: "should ignore field mappings to missing files in package.json", - main_fields: Some(vec!["browser".into(), "main".into()]), - package_json: Some((PathBuf::from("/root/location/mylibjs"), serde_json::json!({ - "main": "./kalle.js", - "browser": "./nope.js" - }).to_string())), - existing_files: vec![ - "/root/location/mylibjs/kalle.js", - ], - extensions: vec![".ts".into(), ".js".into()], - requested_module: "lib/mylibjs", - expected_path: "/root/location/mylibjs/kalle.js", - ..OneTest::default() - }, - // Tests that are not applicable: - // name: "should resolve nested main fields" - // name: "should ignore advanced field mappings in package.json" - // name: "should resolve to with the help of baseUrl when not explicitly set" - // name: "should not resolve with the help of baseUrl when asked not to" - // name: "should resolve main file with cjs file extension" - OneTest { - name: "should resolve .ts from .js alias", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "@/*": ["src/*"] - } - } - }).to_string(), - existing_files: vec![ - "/root/src/foo.ts", - ], - requested_module: "@/foo", // original data was "@/foo.ts" but I don't get why it is the case? - expected_path: "/root/src/foo.ts", // original data was "/root/src/foo" - ..OneTest::default() - }, - ]; - - let root = PathBuf::from("/root"); - - for test in pass { - let resolved_path = - test.resolver(&root).resolve(&root, test.requested_module).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(PathBuf::from(test.expected_path)), "{}", test.name); - } - - let fail = [ - OneTest { - name: "should not locate path that does not match", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/*": ["location/*"] - } - } - }) - .to_string(), - existing_files: vec!["/root/location/mylib"], - requested_module: "lib/mylibjs", - ..OneTest::default() - }, - OneTest { - name: "should not resolve typings file (index.d.ts)", - existing_files: vec!["/root/location/mylib/index.d.ts"], - requested_module: "lib/mylib", - ..OneTest::default() - }, - ]; - - for test in fail { - let resolved_path = - test.resolver(&root).resolve(&root, test.requested_module).map(|f| f.full_path()); - assert_eq!( - resolved_path, - Err(ResolveError::NotFound(test.requested_module.into())), - "{}", - test.name - ); - } - } -} diff --git a/src/tests/tsconfig_project_references.rs b/src/tests/tsconfig_project_references.rs deleted file mode 100644 index b552fefe..00000000 --- a/src/tests/tsconfig_project_references.rs +++ /dev/null @@ -1,101 +0,0 @@ -//! Tests for tsconfig project references - -use crate::{ResolveError, ResolveOptions, Resolver, TsconfigOptions, TsconfigReferences}; - -#[test] -fn auto() { - let f = super::fixture_root().join("tsconfig/cases/project_references"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("app"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - // Test normal paths alias - (f.join("app"), "@/index.ts", f.join("app/aliased/index.ts")), - (f.join("app"), "@/../index.ts", f.join("app/index.ts")), - // Test project reference - (f.join("project_a"), "@/index.ts", f.join("project_a/aliased/index.ts")), - (f.join("project_b/src"), "@/index.ts", f.join("project_b/src/aliased/index.ts")), - // Does not have paths alias - (f.join("project_a"), "./index.ts", f.join("project_a/index.ts")), - (f.join("project_c"), "./index.ts", f.join("project_c/index.ts")), - // Template variable - { - let dir = f.parent().unwrap().join("paths_template_variable"); - (dir.clone(), "foo", dir.join("foo.js")) - } - ]; - - for (path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{request} {path:?}"); - } -} - -#[test] -fn disabled() { - let f = super::fixture_root().join("tsconfig/cases/project_references"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("app"), - references: TsconfigReferences::Disabled, - }), - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - // Test normal paths alias - (f.join("app"), "@/index.ts", Ok(f.join("app/aliased/index.ts"))), - (f.join("app"), "@/../index.ts", Ok(f.join("app/index.ts"))), - // Test project reference - (f.join("project_a"), "@/index.ts", Err(ResolveError::NotFound("@/index.ts".into()))), - (f.join("project_b/src"), "@/index.ts", Err(ResolveError::NotFound("@/index.ts".into()))), - // Does not have paths alias - (f.join("project_a"), "./index.ts", Ok(f.join("project_a/index.ts"))), - (f.join("project_c"), "./index.ts", Ok(f.join("project_c/index.ts"))), - ]; - - for (path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, expected, "{request} {path:?}"); - } -} - -#[test] -fn manual() { - let f = super::fixture_root().join("tsconfig/cases/project_references"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("app"), - references: TsconfigReferences::Paths(vec!["../project_a/conf.json".into()]), - }), - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - // Test normal paths alias - (f.join("app"), "@/index.ts", Ok(f.join("app/aliased/index.ts"))), - (f.join("app"), "@/../index.ts", Ok(f.join("app/index.ts"))), - // Test project reference - (f.join("project_a"), "@/index.ts", Ok(f.join("project_a/aliased/index.ts"))), - (f.join("project_b/src"), "@/index.ts", Err(ResolveError::NotFound("@/index.ts".into()))), - // Does not have paths alias - (f.join("project_a"), "./index.ts", Ok(f.join("project_a/index.ts"))), - (f.join("project_c"), "./index.ts", Ok(f.join("project_c/index.ts"))), - ]; - - for (path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, expected, "{request} {path:?}"); - } -} diff --git a/src/tsconfig.rs b/src/tsconfig.rs deleted file mode 100644 index aa00f6e4..00000000 --- a/src/tsconfig.rs +++ /dev/null @@ -1,212 +0,0 @@ -use std::{ - path::{Path, PathBuf}, - sync::Arc, -}; - -use serde::Deserialize; -use typescript_tsconfig_json::{CompilerOptionsPathsMap, ExtendsField}; - -use crate::PathUtil; - -#[derive(Debug, Deserialize)] -#[serde(rename_all = "camelCase")] -pub struct TsConfig { - /// Whether this is the caller tsconfig. - /// Used for final template variable substitution when all configs are extended and merged. - #[serde(skip)] - root: bool, - - /// Path to `tsconfig.json`. Contains the `tsconfig.json` filename. - #[serde(skip)] - path: PathBuf, - - #[serde(default)] - pub extends: Option, - - #[serde(default)] - pub compiler_options: CompilerOptions, - - /// Bubbled up project references with a reference to their tsconfig. - #[serde(default)] - pub references: Vec, -} - -/// Compiler Options -/// -/// -#[derive(Debug, Default, Deserialize)] -#[serde(rename_all = "camelCase")] -pub struct CompilerOptions { - base_url: Option, - - /// Path aliases - paths: Option, - - /// The actual base for where path aliases are resolved from. - #[serde(skip)] - paths_base: PathBuf, -} - -/// Project Reference -/// -/// -#[derive(Debug, Deserialize)] -pub struct ProjectReference { - /// The path property of each reference can point to a directory containing a tsconfig.json file, - /// or to the config file itself (which may have any name). - pub path: PathBuf, - - /// Reference to the resolved tsconfig - #[serde(skip)] - pub tsconfig: Option>, -} - -impl TsConfig { - pub fn parse(root: bool, path: &Path, json: &mut str) -> Result { - _ = json_strip_comments::strip(json); - let mut tsconfig: Self = serde_json::from_str(json)?; - tsconfig.root = root; - tsconfig.path = path.to_path_buf(); - let directory = tsconfig.directory().to_path_buf(); - if let Some(base_url) = tsconfig.compiler_options.base_url { - tsconfig.compiler_options.base_url = Some(directory.normalize_with(base_url)); - } - if tsconfig.compiler_options.paths.is_some() { - tsconfig.compiler_options.paths_base = - tsconfig.compiler_options.base_url.as_ref().map_or(directory, Clone::clone); - } - Ok(tsconfig) - } - - pub fn build(mut self) -> Self { - if self.root { - let dir = self.directory().to_path_buf(); - // Substitute template variable in `tsconfig.compilerOptions.paths` - if let Some(paths) = &mut self.compiler_options.paths { - for paths in paths.values_mut() { - for path in paths { - Self::substitute_template_variable(&dir, path); - } - } - } - } - self - } - - /// Directory to `tsconfig.json` - /// - /// # Panics - /// - /// * When the `tsconfig.json` path is misconfigured. - pub fn directory(&self) -> &Path { - debug_assert!(self.path.file_name().is_some()); - self.path.parent().unwrap() - } - - pub fn extend_tsconfig(&mut self, tsconfig: &Self) { - let compiler_options = &mut self.compiler_options; - if compiler_options.paths.is_none() { - compiler_options.paths_base = compiler_options - .base_url - .as_ref() - .map_or_else(|| tsconfig.compiler_options.paths_base.clone(), Clone::clone); - compiler_options.paths.clone_from(&tsconfig.compiler_options.paths); - } - if compiler_options.base_url.is_none() { - compiler_options.base_url.clone_from(&tsconfig.compiler_options.base_url); - } - } - - pub fn resolve(&self, path: &Path, specifier: &str) -> Vec { - if path.starts_with(self.base_path()) { - let paths = self.resolve_path_alias(specifier); - if !paths.is_empty() { - return paths; - } - } - for tsconfig in self.references.iter().filter_map(|reference| reference.tsconfig.as_ref()) { - if path.starts_with(tsconfig.base_path()) { - return tsconfig.resolve_path_alias(specifier); - } - } - vec![] - } - - // Copied from parcel - // - pub fn resolve_path_alias(&self, specifier: &str) -> Vec { - if specifier.starts_with(|s| s == '/' || s == '.') { - return vec![]; - } - - let base_url_iter = self - .compiler_options - .base_url - .as_ref() - .map_or_else(Vec::new, |base_url| vec![base_url.normalize_with(specifier)]); - - let Some(paths_map) = &self.compiler_options.paths else { - return base_url_iter; - }; - - let paths = paths_map.get(specifier).map_or_else( - || { - let mut longest_prefix_length = 0; - let mut longest_suffix_length = 0; - let mut best_key: Option<&String> = None; - - for key in paths_map.keys() { - if let Some((prefix, suffix)) = key.split_once('*') { - if (best_key.is_none() || prefix.len() > longest_prefix_length) - && specifier.starts_with(prefix) - && specifier.ends_with(suffix) - { - longest_prefix_length = prefix.len(); - longest_suffix_length = suffix.len(); - best_key.replace(key); - } - } - } - - best_key.and_then(|key| paths_map.get(key)).map_or_else(Vec::new, |paths| { - paths - .iter() - .map(|path| { - path.replace( - '*', - &specifier[longest_prefix_length - ..specifier.len() - longest_suffix_length], - ) - }) - .collect::>() - }) - }, - Clone::clone, - ); - - paths - .into_iter() - .map(|p| self.compiler_options.paths_base.normalize_with(p)) - .chain(base_url_iter) - .collect() - } - - fn base_path(&self) -> &Path { - self.compiler_options - .base_url - .as_ref() - .map_or_else(|| self.directory(), |path| path.as_ref()) - } - - /// Template variable `${configDir}` for substitution of config files directory path - /// - /// NOTE: All tests cases are just a head replacement of `${configDir}`, so we are constrained as such. - /// - /// See - fn substitute_template_variable(directory: &Path, path: &mut String) { - const TEMPLATE_VARIABLE: &str = "${configDir}/"; - if let Some(stripped_path) = path.strip_prefix(TEMPLATE_VARIABLE) { - *path = directory.join(stripped_path).to_string_lossy().to_string(); - } - } -} diff --git a/tests/integration_test.rs b/tests/integration_test.rs deleted file mode 100644 index d369413f..00000000 --- a/tests/integration_test.rs +++ /dev/null @@ -1,102 +0,0 @@ -//! Test public APIs - -use std::{env, path::PathBuf}; - -use oxc_resolver::{EnforceExtension, Resolution, ResolveContext, ResolveOptions, Resolver}; - -fn dir() -> PathBuf { - env::current_dir().unwrap() -} - -fn resolve(specifier: &str) -> Resolution { - let path = dir(); - Resolver::new(ResolveOptions::default()).resolve(path, specifier).unwrap() -} - -#[test] -fn clone() { - let resolution = resolve("./tests/package.json"); - assert_eq!(resolution.clone(), resolution); -} - -#[test] -fn debug() { - let resolution = resolve("./tests/package.json"); - let s = format!("{resolution:?}"); - assert!(!s.is_empty()); -} - -#[test] -fn eq() { - let resolution = resolve("./tests/package.json"); - assert_eq!(resolution, resolution); -} - -#[test] -fn package_json() { - let resolution = resolve("./tests/package.json"); - assert!(resolution - .package_json() - .is_some_and(|json| json.name.as_ref().is_some_and(|name| name == "name"))); -} - -#[cfg(feature = "package_json_raw_json_api")] -#[test] -fn package_json_raw_json_api() { - let resolution = resolve("./tests/package.json"); - assert!(resolution - .package_json() - .unwrap() - .raw_json() - .get("name") - .is_some_and(|name| name == "name")); -} - -#[test] -fn clear_cache() { - let resolver = Resolver::new(ResolveOptions::default()); - resolver.clear_cache(); // exists -} - -#[test] -fn options() { - let resolver = Resolver::new(ResolveOptions::default()); - let options = resolver.options(); - assert!(!format!("{options:?}").is_empty()); -} - -#[test] -fn debug_resolver() { - let resolver = Resolver::new(ResolveOptions::default()); - assert!(!format!("{resolver:?}").is_empty()); -} - -#[test] -fn dependencies() { - let path = dir(); - let mut ctx = ResolveContext::default(); - let _ = Resolver::new(ResolveOptions::default()).resolve_with_context( - path, - "./tests/package.json", - &mut ctx, - ); - assert!(!ctx.file_dependencies.is_empty()); - assert!(ctx.missing_dependencies.is_empty()); -} - -#[test] -fn options_api() { - _ = ResolveOptions::default() - .with_builtin_modules(true) - .with_condition_names(&[]) - .with_extension(".js") - .with_force_extension(EnforceExtension::Auto) - .with_fully_specified(true) - .with_main_field("asdf") - .with_main_file("main") - .with_module("module") - .with_prefer_absolute(true) - .with_prefer_relative(true) - .with_root(PathBuf::new()) - .with_symbolic_link(true); -} diff --git a/tests/package.json b/tests/package.json deleted file mode 100644 index f099adcf..00000000 --- a/tests/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "name": "name" -} diff --git a/tests/resolve_test.rs b/tests/resolve_test.rs deleted file mode 100644 index 30d1ceff..00000000 --- a/tests/resolve_test.rs +++ /dev/null @@ -1,104 +0,0 @@ -use std::{env, path::PathBuf}; - -use oxc_resolver::{ResolveError, ResolveOptions, Resolver}; - -fn dir() -> PathBuf { - env::current_dir().unwrap() -} - -#[test] -fn chinese() { - let dir = dir(); - let specifier = "./fixtures/misc/中文/中文.js"; - let resolution = Resolver::new(ResolveOptions::default()).resolve(&dir, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(dir.join("fixtures/misc/中文/中文.js")) - ); -} - -#[test] -fn styled_components() { - let dir = dir(); - let path = dir.join("fixtures/pnpm"); - let module_path = dir.join("node_modules/.pnpm/styled-components@6.1.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/styled-components"); - let specifier = "styled-components"; - - // cjs - let options = - ResolveOptions { alias_fields: vec![vec!["browser".into()]], ..ResolveOptions::default() }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/styled-components.browser.cjs.js")) - ); - - // esm - let options = ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - main_fields: vec!["module".into()], - ..ResolveOptions::default() - }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/styled-components.browser.esm.js")) - ); -} - -#[test] -fn axios() { - let dir = dir(); - let path = dir.join("fixtures/pnpm"); - let module_path = dir.join("node_modules/.pnpm/axios@1.6.2/node_modules/axios"); - let specifier = "axios"; - - // default - let options = ResolveOptions::default(); - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("index.js")) - ); - - // browser - let options = ResolveOptions { - condition_names: vec!["browser".into(), "require".into()], - ..ResolveOptions::default() - }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/browser/axios.cjs")) - ); - - // cjs - let options = ResolveOptions { - condition_names: vec!["node".into(), "require".into()], - ..ResolveOptions::default() - }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/node/axios.cjs")) - ); -} - -#[test] -fn postcss() { - let dir = dir(); - let path = dir.join("fixtures/pnpm"); - let module_path = path.join("node_modules/postcss"); - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - // should ignore "path" - let resolution = resolver.resolve(&module_path, "path"); - assert_eq!(resolution, Err(ResolveError::Ignored(module_path.clone()))); - - // should ignore "./lib/terminal-highlight" - let resolution = resolver.resolve(&module_path, "./lib/terminal-highlight"); - assert_eq!(resolution, Err(ResolveError::Ignored(module_path.join("lib/terminal-highlight")))); -} From ab2b1726231c0f4ec9ca07144cad0ff4c02860e2 Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Sat, 22 Jun 2024 21:09:20 +0300 Subject: [PATCH 34/82] squash! --- Cargo.lock | 858 ------ fixtures/enhanced_resolve/lib/index.js | 1 - fixtures/enhanced_resolve/package.json | 4 - fixtures/enhanced_resolve/test/.gitignore | 2 - .../enhanced_resolve/test/fixtures/#/a.js | 0 fixtures/enhanced_resolve/test/fixtures/a.js | 3 - .../enhanced_resolve/test/fixtures/abc.txt | 1 - .../test/fixtures/alias/files/a.js | 0 fixtures/enhanced_resolve/test/fixtures/b.js | 3 - .../browser-module/browser/module-a.js | 0 .../fixtures/browser-module/lib/browser.js | 0 .../fixtures/browser-module/lib/ignore.js | 0 .../test/fixtures/browser-module/lib/main.js | 0 .../fixtures/browser-module/lib/replaced.js | 0 .../test/fixtures/browser-module/lib/self.js | 0 .../fixtures/browser-module/lib/toString.js | 0 .../browser-module/node_modules/module-a.js | 0 .../browser-module/node_modules/module-b.js | 0 .../browser-module/node_modules/module-c.js | 0 .../node_modules/recursive-file/a.js | 0 .../node_modules/recursive-file/b.js | 0 .../node_modules/recursive-file/c.js | 0 .../node_modules/recursive-file/d.js | 0 .../node_modules/recursive-file/package.json | 8 - .../test/fixtures/browser-module/package.json | 33 - .../test/fixtures/builtins/package.json | 12 - fixtures/enhanced_resolve/test/fixtures/c.js | 4 - .../enhanced_resolve/test/fixtures/complex.js | 13 - .../test/fixtures/crypto-js/index.js | 0 .../test/fixtures/crypto-js/package.json | 7 - .../test/fixtures/decorated-fs/exists.js | 0 .../test/fixtures/dirOrFile.js | 1 - .../test/fixtures/dirOrFile/index.js | 1 - .../directory-default/directory-default.js | 0 .../node_modules/@org/pkg/dist/string.js | 1 - .../@org/pkg/dist/string.test.d.ts | 1 - .../node_modules/@org/pkg/package.json | 9 - .../node_modules/pkg/dist/string.js | 1 - .../node_modules/pkg/dist/string.test.d.ts | 1 - .../node_modules/pkg/package.json | 9 - .../node_modules/exports-field/package.json | 7 - .../node_modules/pack1/index.js | 0 .../test/fixtures/exports-field/a.js | 1 - .../node_modules/exports-field/lib/browser.js | 1 - .../node_modules/exports-field/lib/index.js | 0 .../exports-field/lib/lib2/main.js | 1 - .../node_modules/exports-field/lib/main.js | 1 - .../node_modules/exports-field/main.js | 1 - .../node_modules/exports-field/package.json | 18 - .../node_modules/exports-field/x.js | 1 - .../invalid-exports-field/index.js | 0 .../invalid-exports-field/package.json | 13 - .../node_modules/invalid-exports-field/umd.js | 0 .../test/fixtures/exports-field/package.json | 5 - .../node_modules/exports-field/index.js | 1 - .../node_modules/exports-field/lib/browser.js | 1 - .../exports-field/lib/lib2/main.js | 1 - .../node_modules/exports-field/lib/main.js | 1 - .../node_modules/exports-field/main.js | 1 - .../node_modules/exports-field/package.json | 17 - .../node_modules/exports-field/index | 0 .../node_modules/exports-field/main.js | 1 - .../node_modules/exports-field/package.json | 10 - .../node_modules/exports-field/src/index.js | 0 .../fixtures/extension-alias/dir/index.js | 0 .../fixtures/extension-alias/dir/index.ts | 0 .../fixtures/extension-alias/dir2/index.js | 0 .../fixtures/extension-alias/dir2/index.mts | 0 .../test/fixtures/extension-alias/index.js | 0 .../test/fixtures/extension-alias/index.mjs | 0 .../fixtures/extension-alias/index.mts.js | 0 .../test/fixtures/extension-alias/index.ts | 0 .../test/fixtures/extensions/app.module.js | 0 .../test/fixtures/extensions/dir/index.js | 0 .../test/fixtures/extensions/dir/index.ts | 0 .../test/fixtures/extensions/foo.js | 0 .../test/fixtures/extensions/foo.ts | 0 .../test/fixtures/extensions/index.js | 0 .../test/fixtures/extensions/index.ts | 0 .../extensions/node_modules/module.js | 0 .../extensions/node_modules/module/index.ts | 0 .../test/fixtures/extensions/package.json | 3 - .../enhanced_resolve/test/fixtures/file.load1 | 0 .../enhanced_resolve/test/fixtures/file.load2 | 0 .../test/fixtures/foo/index.js | 0 .../test/fixtures/foo/package.json | 4 - .../node_modules/m/package.json | 17 - .../node_modules/m/src/features/f.js | 0 .../m/src/features/internal/file.js | 0 .../node_modules/m/src/features/y/y.js | 0 .../node_modules/m/src/internal/i.js | 0 .../node_modules/m/src/middle-1/f.js | 0 .../node_modules/m/src/middle-1/nested/f.js | 0 .../node_modules/m/src/middle-2/nested/f.js | 1 - .../m/src/middle-3/nested/f/nested/f.js | 0 .../node_modules/m/src/middle-4/f/f.js | 0 .../node_modules/m/src/middle-5/f$/$.js | 0 .../node_modules/m/src/middle-5/f/$.js | 0 .../node_modules/m/src/middle/f.js | 0 .../node_modules/m/src/middle/nested/f.js | 0 .../test/fixtures/imports-field/a.js | 1 - .../test/fixtures/imports-field/b.js | 0 .../test/fixtures/imports-field/dir/b.js | 0 .../node_modules/a/lib/browser.js | 1 - .../imports-field/node_modules/a/lib/index.js | 0 .../node_modules/a/lib/lib2/main.js | 1 - .../imports-field/node_modules/a/lib/main.js | 1 - .../imports-field/node_modules/a/main.js | 1 - .../imports-field/node_modules/a/package.json | 18 - .../imports-field/node_modules/a/x.js | 1 - .../imports-field/node_modules/c/index.js | 0 .../test/fixtures/imports-field/package.json | 17 - .../fixtures/incorrect-package/pack1/a.js | 0 .../incorrect-package/pack1/package.json | 2 - .../fixtures/incorrect-package/pack2/a.js | 0 .../incorrect-package/pack2/package.json | 0 .../test/fixtures/issue-238/package.json | 3 - .../test/fixtures/issue-238/src/a/config.js | 0 .../src/common/config/myObjectFile.js | 0 .../enhanced_resolve/test/fixtures/lib.js | 0 .../test/fixtures/lib/complex1.js | 1 - .../test/fixtures/main-field-self/index.js | 0 .../fixtures/main-field-self/package.json | 3 - .../test/fixtures/main-field-self2/index.js | 0 .../fixtures/main-field-self2/package.json | 3 - .../enhanced_resolve/test/fixtures/main1.js | 9 - .../enhanced_resolve/test/fixtures/main2.js | 12 - .../enhanced_resolve/test/fixtures/main3.js | 4 - .../multiple_modules/node_modules/m1/a.js | 3 - .../test/fixtures/no#fragment/#/#.js | 0 fixtures/enhanced_resolve/test/fixtures/no.js | 0 .../browser-module-broken/browser.js | 0 .../browser-module-broken/main.js | 0 .../browser-module-broken/package.json | 4 - .../complexm/node_modules/m1/a.js | 1 - .../complexm/node_modules/m1/index.js | 1 - .../fixtures/node_modules/complexm/step1.js | 1 - .../fixtures/node_modules/complexm/step2.js | 1 - .../fixtures/node_modules/dash-name/index.js | 0 .../node_modules/dash-name/package.json | 4 - .../test/fixtures/node_modules/dash/index.js | 0 .../fixtures/node_modules/dash/package.json | 4 - .../invalidPackageJson/package.json | 0 .../test/fixtures/node_modules/m1/a.js | 3 - .../test/fixtures/node_modules/m1/b.js | 3 - .../test/fixtures/node_modules/m2/b.js | 1 - .../node_modules/recursive-module/file.js | 0 .../node_modules/recursive-module/index.js | 0 .../test/fixtures/pnp-a/m2/a.js | 3 - .../test/fixtures/pnp/pkg/dir/index.js | 0 .../test/fixtures/pnp/pkg/index.js | 0 .../test/fixtures/pnp/pkg/main.js | 0 .../fixtures/pnp/pkg/package-alias/browser.js | 0 .../fixtures/pnp/pkg/package-alias/index.js | 0 .../test/fixtures/pnp/pkg/package.json | 7 - .../test/fixtures/pnp/pkg/typescript/index.ts | 0 .../test/fixtures/pnp/pkg3/a.js | 1 - .../test/fixtures/pnp/pkg3/package.json | 8 - .../prefer-pnp/alternative-modules/m1/b.js | 0 .../restrictions/node_modules/pck1/index.css | 0 .../restrictions/node_modules/pck1/index.js | 0 .../node_modules/pck1/package.json | 3 - .../restrictions/node_modules/pck2/index.css | 0 .../restrictions/node_modules/pck2/module.js | 0 .../node_modules/pck2/package.json | 5 - .../test/fixtures/roots_fall_through/index.js | 0 .../scoped/node_modules/@scope/pack1/main.js | 0 .../node_modules/@scope/pack1/package.json | 5 - .../node_modules/@scope/pack2/lib/index.js | 0 .../scoped/node_modules/@scope/pack2/main.js | 0 .../node_modules/@scope/pack2/package.json | 3 - .../test/fixtures/shortcutdir.js/a.js | 0 .../test/fixtures/yield/a/foo-2/b | 0 .../test/fixtures/yield/a/foo-2/c | 0 .../test/fixtures/yield/a/foo/a | 0 .../test/fixtures/yield/a/foo/b | 0 .../test/fixtures/yield/b/foo/a | 0 .../test/fixtures/yield/c/foo/a | 0 .../test/fixtures/yield/c/foo/package.json | 7 - .../fixtures/\346\265\213\350\257\225.js" | 0 .../\344\270\255\346\226\207.js" | 0 fixtures/pnpm/.gitignore | 1 - fixtures/pnpm/package.json | 10 - fixtures/pnpm/pnpm-lock.yaml | 212 -- fixtures/tsconfig/cases/builtins/thing.js | 0 .../tsconfig/cases/builtins/tsconfig.json | 5 - fixtures/tsconfig/cases/exports/index.js | 0 fixtures/tsconfig/cases/exports/tsconfig.json | 3 - .../extends-extension/base-tsconfig.json | 7 - .../tsconfig/cases/extends-extension/foo.js | 0 .../cases/extends-extension/tsconfig.json | 3 - .../cases/extends-extensionless/foo.js | 0 .../cases/extends-extensionless/tsconfig.json | 3 - .../tsconfig/cases/extends-multiple/foo.js | 0 .../cases/extends-multiple/tsconfig.json | 6 - .../tsconfig/cases/extends-not-found/index.js | 0 .../cases/extends-not-found/tsconfig.json | 3 - .../tsconfig/cases/extends-paths/src/index.js | 0 .../cases/extends-paths/tsconfig.base.json | 7 - .../cases/extends-paths/tsconfig.json | 6 - fixtures/tsconfig/cases/field/index.js | 0 fixtures/tsconfig/cases/field/tsconfig.json | 3 - fixtures/tsconfig/cases/index/index.js | 0 fixtures/tsconfig/cases/index/tsconfig.json | 3 - .../cases/paths_template_variable/foo.js | 0 .../paths_template_variable/tsconfig1.json | 3 - .../paths_template_variable/tsconfig2.json | 8 - .../project_references/app/aliased/index.ts | 0 .../cases/project_references/app/index.ts | 0 .../project_references/app/tsconfig.json | 23 - .../project_a/aliased/index.ts | 0 .../project_references/project_a/conf.json | 8 - .../project_references/project_a/index.ts | 0 .../project_b/src/aliased/index.ts | 0 .../project_b/tsconfig.json | 9 - .../project_references/project_c/index.ts | 0 .../project_c/tsconfig.json | 5 - .../project_references/tsconfig.base.json | 4 - fixtures/tsconfig/cases/suffixes/a.ios.ts | 0 fixtures/tsconfig/cases/suffixes/a.ts | 0 fixtures/tsconfig/cases/suffixes/b.ts | 0 fixtures/tsconfig/cases/suffixes/c-test.ts | 0 fixtures/tsconfig/cases/suffixes/index.ts | 1 - .../tsconfig/cases/suffixes/tsconfig.json | 5 - fixtures/tsconfig/cases/trailing-comma/bar.js | 0 .../tsconfig/cases/trailing-comma/index.js | 0 .../cases/trailing-comma/tsconfig.json | 9 - fixtures/tsconfig/foo.js | 0 fixtures/tsconfig/nested/index.js | 0 fixtures/tsconfig/nested/test.js | 0 fixtures/tsconfig/nested/tsconfig.json | 8 - .../node_modules/tsconfig-exports/conf.json | 7 - .../node_modules/tsconfig-exports/foo.js | 0 .../tsconfig-exports/package.json | 7 - .../node_modules/tsconfig-field/conf.json | 7 - .../node_modules/tsconfig-field/foo.js | 0 .../node_modules/tsconfig-field/package.json | 5 - .../node_modules/tsconfig-index/foo.js | 0 .../node_modules/tsconfig-index/package.json | 4 - .../node_modules/tsconfig-index/tsconfig.json | 7 - .../node_modules/tsconfig-not-used/foo.js | 0 .../tsconfig-not-used/tsconfig.json | 7 - fixtures/tsconfig/package.json | 24 - fixtures/tsconfig/tsconfig.json | 7 - .../tsconfig/tsconfig_template_variable.json | 7 - napi/__test__/resolver.spec.mjs | 260 -- napi/src/lib.rs | 166 - napi/src/options.rs | 261 -- napi/tests/options.test.mjs | 59 - npm/package.json | 67 +- package.json | 53 +- pnpm-lock.yaml | 2690 ----------------- src/builtins.rs | 71 - src/cache.rs | 369 --- src/context.rs | 89 - src/error.rs | 160 - src/file_system.rs | 133 - src/lib.rs | 1670 ---------- src/options.rs | 623 ---- src/package_json.rs | 207 -- src/path.rs | 132 - src/resolution.rs | 92 - src/specifier.rs | 230 -- src/tests/alias.rs | 280 -- src/tests/browser_field.rs | 189 -- src/tests/builtins.rs | 121 - src/tests/dependencies.rs | 110 - src/tests/exports_field.rs | 2546 ---------------- src/tests/extension_alias.rs | 66 - src/tests/extensions.rs | 125 - src/tests/fallback.rs | 100 - src/tests/full_specified.rs | 113 - src/tests/imports_field.rs | 1320 -------- src/tests/incorrect_description_file.rs | 62 - src/tests/main_field.rs | 24 - src/tests/memory_fs.rs | 74 - src/tests/missing.rs | 106 - src/tests/mod.rs | 49 - src/tests/resolve.rs | 119 - src/tests/restrictions.rs | 25 - src/tests/roots.rs | 92 - src/tests/scoped_packages.rs | 25 - src/tests/simple.rs | 68 - src/tests/symlink.rs | 121 - src/tests/tsconfig_paths.rs | 507 ---- src/tests/tsconfig_project_references.rs | 101 - src/tsconfig.rs | 212 -- tests/integration_test.rs | 102 - tests/package.json | 3 - tests/resolve_test.rs | 104 - 290 files changed, 50 insertions(+), 15709 deletions(-) delete mode 100644 Cargo.lock delete mode 100644 fixtures/enhanced_resolve/lib/index.js delete mode 100644 fixtures/enhanced_resolve/package.json delete mode 100644 fixtures/enhanced_resolve/test/.gitignore delete mode 100644 fixtures/enhanced_resolve/test/fixtures/#/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/abc.txt delete mode 100644 fixtures/enhanced_resolve/test/fixtures/alias/files/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/browser/module-a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/ignore.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/replaced.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/self.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/toString.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-c.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/c.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/d.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/builtins/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/c.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/complex.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/crypto-js/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/decorated-fs/exists.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/dirOrFile.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/directory-default/directory-default.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/pack1/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/umd.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/index delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/src/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.mts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mjs delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mts.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/app.module.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/foo.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/foo.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/file.load1 delete mode 100644 fixtures/enhanced_resolve/test/fixtures/file.load2 delete mode 100644 fixtures/enhanced_resolve/test/fixtures/foo/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/foo/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/internal/file.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/y/y.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/internal/i.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-3/nested/f/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-4/f/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f$/$.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f/$.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/dir/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/c/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/issue-238/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/issue-238/src/a/config.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/issue-238/src/common/config/myObjectFile.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/lib.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/lib/complex1.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self2/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main1.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main2.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main3.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/no#fragment/#/#.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/no.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/invalidPackageJson/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/file.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/dir/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/typescript/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/prefer-pnp/alternative-modules/m1/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.css delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/index.css delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/module.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/roots_fall_through/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/lib/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/shortcutdir.js/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/b delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/c delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo/a delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo/b delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/b/foo/a delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/c/foo/a delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json delete mode 100644 "fixtures/enhanced_resolve/test/fixtures/\346\265\213\350\257\225.js" delete mode 100644 "fixtures/misc/\344\270\255\346\226\207/\344\270\255\346\226\207.js" delete mode 100644 fixtures/pnpm/.gitignore delete mode 100644 fixtures/pnpm/package.json delete mode 100644 fixtures/pnpm/pnpm-lock.yaml delete mode 100644 fixtures/tsconfig/cases/builtins/thing.js delete mode 100644 fixtures/tsconfig/cases/builtins/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/exports/index.js delete mode 100644 fixtures/tsconfig/cases/exports/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-extension/base-tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-extension/foo.js delete mode 100644 fixtures/tsconfig/cases/extends-extension/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-extensionless/foo.js delete mode 100644 fixtures/tsconfig/cases/extends-extensionless/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-multiple/foo.js delete mode 100644 fixtures/tsconfig/cases/extends-multiple/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-not-found/index.js delete mode 100644 fixtures/tsconfig/cases/extends-not-found/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-paths/src/index.js delete mode 100644 fixtures/tsconfig/cases/extends-paths/tsconfig.base.json delete mode 100644 fixtures/tsconfig/cases/extends-paths/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/field/index.js delete mode 100644 fixtures/tsconfig/cases/field/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/index/index.js delete mode 100644 fixtures/tsconfig/cases/index/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/paths_template_variable/foo.js delete mode 100644 fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json delete mode 100644 fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json delete mode 100644 fixtures/tsconfig/cases/project_references/app/aliased/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/app/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/app/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/project_references/project_a/aliased/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_a/conf.json delete mode 100644 fixtures/tsconfig/cases/project_references/project_a/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_b/src/aliased/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_b/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/project_references/project_c/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_c/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/project_references/tsconfig.base.json delete mode 100644 fixtures/tsconfig/cases/suffixes/a.ios.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/a.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/b.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/c-test.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/index.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/trailing-comma/bar.js delete mode 100644 fixtures/tsconfig/cases/trailing-comma/index.js delete mode 100644 fixtures/tsconfig/cases/trailing-comma/tsconfig.json delete mode 100644 fixtures/tsconfig/foo.js delete mode 100644 fixtures/tsconfig/nested/index.js delete mode 100644 fixtures/tsconfig/nested/test.js delete mode 100644 fixtures/tsconfig/nested/tsconfig.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-exports/conf.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-exports/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-exports/package.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-field/conf.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-field/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-field/package.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-index/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-index/package.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-not-used/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json delete mode 100755 fixtures/tsconfig/package.json delete mode 100644 fixtures/tsconfig/tsconfig.json delete mode 100644 fixtures/tsconfig/tsconfig_template_variable.json delete mode 100644 napi/__test__/resolver.spec.mjs delete mode 100644 napi/src/lib.rs delete mode 100644 napi/src/options.rs delete mode 100644 napi/tests/options.test.mjs delete mode 100644 pnpm-lock.yaml delete mode 100644 src/builtins.rs delete mode 100644 src/cache.rs delete mode 100644 src/context.rs delete mode 100644 src/error.rs delete mode 100644 src/file_system.rs delete mode 100644 src/lib.rs delete mode 100644 src/options.rs delete mode 100644 src/package_json.rs delete mode 100644 src/path.rs delete mode 100644 src/resolution.rs delete mode 100644 src/specifier.rs delete mode 100644 src/tests/alias.rs delete mode 100644 src/tests/browser_field.rs delete mode 100644 src/tests/builtins.rs delete mode 100644 src/tests/dependencies.rs delete mode 100644 src/tests/exports_field.rs delete mode 100644 src/tests/extension_alias.rs delete mode 100644 src/tests/extensions.rs delete mode 100644 src/tests/fallback.rs delete mode 100644 src/tests/full_specified.rs delete mode 100644 src/tests/imports_field.rs delete mode 100644 src/tests/incorrect_description_file.rs delete mode 100644 src/tests/main_field.rs delete mode 100644 src/tests/memory_fs.rs delete mode 100644 src/tests/missing.rs delete mode 100644 src/tests/mod.rs delete mode 100644 src/tests/resolve.rs delete mode 100644 src/tests/restrictions.rs delete mode 100644 src/tests/roots.rs delete mode 100644 src/tests/scoped_packages.rs delete mode 100644 src/tests/simple.rs delete mode 100644 src/tests/symlink.rs delete mode 100644 src/tests/tsconfig_paths.rs delete mode 100644 src/tests/tsconfig_project_references.rs delete mode 100644 src/tsconfig.rs delete mode 100644 tests/integration_test.rs delete mode 100644 tests/package.json delete mode 100644 tests/resolve_test.rs diff --git a/Cargo.lock b/Cargo.lock deleted file mode 100644 index c83523b3..00000000 --- a/Cargo.lock +++ /dev/null @@ -1,858 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "aho-corasick" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" -dependencies = [ - "memchr", -] - -[[package]] -name = "anes" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "735d4f398ca57cfa2880225c2bf81c3b9af3be5bb22e44ae70118dad38713e84" - -[[package]] -name = "autocfg" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "bitflags" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" - -[[package]] -name = "bpaf" -version = "0.9.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3280efcf6d66bc77c2cf9b67dc8acee47a217d9be67dd590b3230dffe663724d" - -[[package]] -name = "cast" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "ciborium" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42e69ffd6f0917f5c029256a24d0161db17cea3997d185db0d35926308770f0e" -dependencies = [ - "ciborium-io", - "ciborium-ll", - "serde", -] - -[[package]] -name = "ciborium-io" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05afea1e0a06c9be33d539b876f1ce3692f4afea2cb41f740e7743225ed1c757" - -[[package]] -name = "ciborium-ll" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57663b653d948a338bfb3eeba9bb2fd5fcfaecb9e199e87e1eda4d9e8b240fd9" -dependencies = [ - "ciborium-io", - "half", -] - -[[package]] -name = "clean-path" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aaa6b4b263a5d737e9bf6b7c09b72c41a5480aec4d7219af827f6564e950b6a5" - -[[package]] -name = "codspeed" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a104ac948e0188b921eb3fcbdd55dcf62e542df4c7ab7e660623f6288302089" -dependencies = [ - "colored", - "libc", - "serde_json", -] - -[[package]] -name = "colored" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbf2150cce219b664a8a70df7a1f933836724b503f8a413af9365b4dcc4d90b8" -dependencies = [ - "lazy_static", - "windows-sys 0.48.0", -] - -[[package]] -name = "convert_case" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec182b0ca2f35d8fc196cf3404988fd8b8c739a4d270ff118a398feb0cbec1ca" -dependencies = [ - "unicode-segmentation", -] - -[[package]] -name = "criterion2" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7258985df1aa8b33359ee2392cbc3b7802875242cdacdda91a17a602132c24a9" -dependencies = [ - "anes", - "bpaf", - "cast", - "ciborium", - "codspeed", - "colored", - "num-traits", - "oorandom", - "serde", - "serde_json", - "walkdir", -] - -[[package]] -name = "crossbeam-deque" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" -dependencies = [ - "crossbeam-epoch", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.9.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" -dependencies = [ - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" - -[[package]] -name = "crunchy" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" - -[[package]] -name = "ctor" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edb49164822f3ee45b17acd4a208cfc1251410cf0cad9a833234c9890774dd9f" -dependencies = [ - "quote", - "syn", -] - -[[package]] -name = "dashmap" -version = "5.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" -dependencies = [ - "cfg-if", - "hashbrown", - "lock_api", - "once_cell", - "parking_lot_core", -] - -[[package]] -name = "document-features" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef5282ad69563b5fc40319526ba27e0e7363d552a896f0297d54f767717f9b95" -dependencies = [ - "litrs", -] - -[[package]] -name = "dunce" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b" - -[[package]] -name = "either" -version = "1.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dca9240753cf90908d7e4aac30f630662b02aebaa1b58a3cadabdb23385b58b" - -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "filetime" -version = "0.2.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ee447700ac8aa0b2f2bd7bc4462ad686ba06baa6727ac149a2d6277f0d240fd" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall 0.4.1", - "windows-sys 0.52.0", -] - -[[package]] -name = "half" -version = "2.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dd08c532ae367adf81c312a4580bc67f1d0fe8bc9c460520283f4c0ff277888" -dependencies = [ - "cfg-if", - "crunchy", -] - -[[package]] -name = "hashbrown" -version = "0.14.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" - -[[package]] -name = "indexmap" -version = "2.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" -dependencies = [ - "equivalent", - "hashbrown", - "serde", -] - -[[package]] -name = "itoa" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" - -[[package]] -name = "json-strip-comments" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3d129799327c8f80861e467c59b825ba24c277dba6ad0d71a141dc98f9e04ee" - -[[package]] -name = "lazy_static" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" - -[[package]] -name = "libc" -version = "0.2.155" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" - -[[package]] -name = "libloading" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c2a198fb6b0eada2a8df47933734e6d35d350665a33a3593d7164fa52c75c19" -dependencies = [ - "cfg-if", - "windows-targets 0.52.5", -] - -[[package]] -name = "litrs" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4ce301924b7887e9d637144fdade93f9dfff9b60981d4ac161db09720d39aa5" - -[[package]] -name = "lock_api" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" -dependencies = [ - "autocfg", - "scopeguard", -] - -[[package]] -name = "memchr" -version = "2.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" - -[[package]] -name = "napi" -version = "2.16.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfc300228808a0e6aea5a58115c82889240bcf8dab16fc25ad675b33e454b368" -dependencies = [ - "bitflags 2.5.0", - "ctor", - "napi-derive", - "napi-sys", - "once_cell", - "serde", - "serde_json", -] - -[[package]] -name = "napi-build" -version = "2.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1c0f5d67ee408a4685b61f5ab7e58605c8ae3f2b4189f0127d804ff13d5560a" - -[[package]] -name = "napi-derive" -version = "2.16.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0e034ddf6155192cf83f267ede763fe6c164dfa9971585436b16173718d94c4" -dependencies = [ - "cfg-if", - "convert_case", - "napi-derive-backend", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "napi-derive-backend" -version = "1.0.67" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bff2c00437f3b3266391eb5e6aa25d0029187daf5caf05b8e3271468fb5ae73e" -dependencies = [ - "convert_case", - "once_cell", - "proc-macro2", - "quote", - "regex", - "semver", - "syn", -] - -[[package]] -name = "napi-sys" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "427802e8ec3a734331fec1035594a210ce1ff4dc5bc1950530920ab717964ea3" -dependencies = [ - "libloading", -] - -[[package]] -name = "normalize-path" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5438dd2b2ff4c6df6e1ce22d825ed2fa93ee2922235cc45186991717f0a892d" - -[[package]] -name = "num-traits" -version = "0.2.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" -dependencies = [ - "autocfg", -] - -[[package]] -name = "once_cell" -version = "1.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" - -[[package]] -name = "oorandom" -version = "11.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575" - -[[package]] -name = "oxc_napi_resolver" -version = "0.0.0" -dependencies = [ - "napi", - "napi-build", - "napi-derive", - "oxc_resolver", -] - -[[package]] -name = "oxc_resolver" -version = "1.8.1" -dependencies = [ - "criterion2", - "dashmap", - "document-features", - "dunce", - "json-strip-comments", - "normalize-path", - "once_cell", - "rayon", - "rustc-hash", - "serde", - "serde_json", - "thiserror", - "tracing", - "typescript_tsconfig_json", - "vfs", -] - -[[package]] -name = "parking_lot_core" -version = "0.9.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall 0.5.1", - "smallvec", - "windows-targets 0.52.5", -] - -[[package]] -name = "pin-project-lite" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" - -[[package]] -name = "proc-macro2" -version = "1.0.85" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22244ce15aa966053a896d1accb3a6e68469b97c7f33f284b99f0d576879fc23" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.36" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "rayon" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" -dependencies = [ - "either", - "rayon-core", -] - -[[package]] -name = "rayon-core" -version = "1.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" -dependencies = [ - "crossbeam-deque", - "crossbeam-utils", -] - -[[package]] -name = "redox_syscall" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" -dependencies = [ - "bitflags 1.3.2", -] - -[[package]] -name = "redox_syscall" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "469052894dcb553421e483e4209ee581a45100d31b4018de03e5a7ad86374a7e" -dependencies = [ - "bitflags 2.5.0", -] - -[[package]] -name = "regex" -version = "1.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" -dependencies = [ - "aho-corasick", - "memchr", - "regex-automata", - "regex-syntax", -] - -[[package]] -name = "regex-automata" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", -] - -[[package]] -name = "regex-syntax" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" - -[[package]] -name = "rustc-hash" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" - -[[package]] -name = "ryu" -version = "1.0.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" - -[[package]] -name = "same-file" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "scopeguard" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" - -[[package]] -name = "semver" -version = "1.0.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" - -[[package]] -name = "serde" -version = "1.0.203" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7253ab4de971e72fb7be983802300c30b5a7f0c2e56fab8abfc6a214307c0094" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.203" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "serde_json" -version = "1.0.117" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3" -dependencies = [ - "indexmap", - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "smallvec" -version = "1.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" - -[[package]] -name = "syn" -version = "2.0.66" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c42f3f41a2de00b01c0aaad383c5a45241efc8b2d1eda5661812fda5f3cdcff5" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "thiserror" -version = "1.0.61" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.61" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "tracing" -version = "0.1.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" -dependencies = [ - "pin-project-lite", - "tracing-attributes", - "tracing-core", -] - -[[package]] -name = "tracing-attributes" -version = "0.1.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "tracing-core" -version = "0.1.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" -dependencies = [ - "once_cell", -] - -[[package]] -name = "typescript_tsconfig_json" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7cc416eaf05297012ead9d192226fe9a92e9a20f64f8780efb9085aaae9b590" -dependencies = [ - "clean-path", - "indexmap", - "rustc-hash", - "serde", - "serde_json", -] - -[[package]] -name = "unicode-ident" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" - -[[package]] -name = "unicode-segmentation" -version = "1.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" - -[[package]] -name = "vfs" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "654cd097e182a71dbf899178e6b5662c2157dd0b8afd5975de18008f6fc173d1" -dependencies = [ - "filetime", -] - -[[package]] -name = "walkdir" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" -dependencies = [ - "same-file", - "winapi-util", -] - -[[package]] -name = "winapi-util" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b" -dependencies = [ - "windows-sys 0.52.0", -] - -[[package]] -name = "windows-sys" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" -dependencies = [ - "windows-targets 0.48.5", -] - -[[package]] -name = "windows-sys" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" -dependencies = [ - "windows-targets 0.52.5", -] - -[[package]] -name = "windows-targets" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" -dependencies = [ - "windows_aarch64_gnullvm 0.48.5", - "windows_aarch64_msvc 0.48.5", - "windows_i686_gnu 0.48.5", - "windows_i686_msvc 0.48.5", - "windows_x86_64_gnu 0.48.5", - "windows_x86_64_gnullvm 0.48.5", - "windows_x86_64_msvc 0.48.5", -] - -[[package]] -name = "windows-targets" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" -dependencies = [ - "windows_aarch64_gnullvm 0.52.5", - "windows_aarch64_msvc 0.52.5", - "windows_i686_gnu 0.52.5", - "windows_i686_gnullvm", - "windows_i686_msvc 0.52.5", - "windows_x86_64_gnu 0.52.5", - "windows_x86_64_gnullvm 0.52.5", - "windows_x86_64_msvc 0.52.5", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" - -[[package]] -name = "windows_i686_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" - -[[package]] -name = "windows_i686_gnu" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" - -[[package]] -name = "windows_i686_gnullvm" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" - -[[package]] -name = "windows_i686_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" - -[[package]] -name = "windows_i686_msvc" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" diff --git a/fixtures/enhanced_resolve/lib/index.js b/fixtures/enhanced_resolve/lib/index.js deleted file mode 100644 index 1e872e8f..00000000 --- a/fixtures/enhanced_resolve/lib/index.js +++ /dev/null @@ -1 +0,0 @@ -// mimic enhanced-resolved root directory structure diff --git a/fixtures/enhanced_resolve/package.json b/fixtures/enhanced_resolve/package.json deleted file mode 100644 index d1b845b5..00000000 --- a/fixtures/enhanced_resolve/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "enhanced-resolve", - "main": "lib/index.js" -} diff --git a/fixtures/enhanced_resolve/test/.gitignore b/fixtures/enhanced_resolve/test/.gitignore deleted file mode 100644 index bbbec5f4..00000000 --- a/fixtures/enhanced_resolve/test/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# created by symlink.rs -/temp diff --git a/fixtures/enhanced_resolve/test/fixtures/#/a.js b/fixtures/enhanced_resolve/test/fixtures/#/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/a.js b/fixtures/enhanced_resolve/test/fixtures/a.js deleted file mode 100644 index 896ffc6d..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/abc.txt b/fixtures/enhanced_resolve/test/fixtures/abc.txt deleted file mode 100644 index f2ba8f84..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/abc.txt +++ /dev/null @@ -1 +0,0 @@ -abc \ No newline at end of file diff --git a/fixtures/enhanced_resolve/test/fixtures/alias/files/a.js b/fixtures/enhanced_resolve/test/fixtures/alias/files/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/b.js b/fixtures/enhanced_resolve/test/fixtures/b.js deleted file mode 100644 index 11476340..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/b.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function b() { - return "This is b"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/browser/module-a.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/browser/module-a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/browser.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/ignore.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/ignore.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/replaced.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/replaced.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/self.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/self.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/toString.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/toString.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-a.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-b.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-c.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-c.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/a.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/b.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/c.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/c.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/d.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/d.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json deleted file mode 100644 index c13fe23b..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "browser": { - "a.js": "./a", - "./b.js": "./b", - "c.js": "./d.js", - "./d.js": "./c.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/package.json b/fixtures/enhanced_resolve/test/fixtures/browser-module/package.json deleted file mode 100644 index 19ff7739..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/browser-module/package.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "exports": { - "./lib/index.js": "./lib/index.js" - }, - "browser": { - "./lib/ignore.js": false, - "./lib/replaced.js": "./lib/browser", - "module-a": "./browser/module-a.js", - "module-b": "module-c", - "module-c": "module-c", - "./toString": "./lib/toString.js", - "./lib/main.js": "./lib/main.js", - "./main.js": "./lib/main.js", - "./lib/xyz.js": "./xyz.js", - "./xyz.js": "./lib/xyz.js", - "./lib/non-existent.js": "./lib/non-existent.js", - ".": false, - "./number": 1, - "./foo": "./lib/replaced.js?query" - }, - "innerBrowser1": { - "field": { - "browser": { - "./lib/main1.js": "./lib/main.js" - } - } - }, - "innerBrowser2": { - "browser": { - "./lib/main2.js": "./lib/replaced.js" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/builtins/package.json b/fixtures/enhanced_resolve/test/fixtures/builtins/package.json deleted file mode 100644 index 4a54ea96..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/builtins/package.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "name": "builtins", - "private": true, - "imports": { - "#fs": { - "default": "fs" - }, - "#http": { - "node": "node:http" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/c.js b/fixtures/enhanced_resolve/test/fixtures/c.js deleted file mode 100644 index e3aca8aa..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/c.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = function b() { - require("./a"); - return "This is c"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/complex.js b/fixtures/enhanced_resolve/test/fixtures/complex.js deleted file mode 100644 index 1f62db84..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/complex.js +++ /dev/null @@ -1,13 +0,0 @@ -var 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); diff --git a/fixtures/enhanced_resolve/test/fixtures/crypto-js/index.js b/fixtures/enhanced_resolve/test/fixtures/crypto-js/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json b/fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json deleted file mode 100644 index 1d31aa8b..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "crypto-js", - "main": "index.js", - "browser": { - "crypto": false - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/decorated-fs/exists.js b/fixtures/enhanced_resolve/test/fixtures/decorated-fs/exists.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/dirOrFile.js b/fixtures/enhanced_resolve/test/fixtures/dirOrFile.js deleted file mode 100644 index c3cb885f..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/dirOrFile.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "file"; diff --git a/fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js b/fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js deleted file mode 100644 index 85e01cd4..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "dir"; diff --git a/fixtures/enhanced_resolve/test/fixtures/directory-default/directory-default.js b/fixtures/enhanced_resolve/test/fixtures/directory-default/directory-default.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js deleted file mode 100644 index d1007aae..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js +++ /dev/null @@ -1 +0,0 @@ -export default "string"; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts deleted file mode 100644 index cb0ff5c3..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json deleted file mode 100644 index b523a1e9..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "@org/pkg", - "exports": { - "./*.js": { - "types": "./dist/*.d.ts", - "default": "./dist/*.js" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js deleted file mode 100644 index d1007aae..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js +++ /dev/null @@ -1 +0,0 @@ -export default "string"; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts deleted file mode 100644 index cb0ff5c3..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json deleted file mode 100644 index 8e55fb46..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "@raviqqe/hidash", - "exports": { - "./*.js": { - "types": "./dist/*.d.ts", - "default": "./dist/*.js" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json deleted file mode 100644 index f0edf449..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "exports-field", - "version": "1.0.0", - "exports": { - ".": "./a/../b/../../pack1/index.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/pack1/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/pack1/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/a.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/a.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json deleted file mode 100644 index 6b105c08..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "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/": { - "webpack": ["./lib/lib2/", "./lib/"], - "node": "./lib/", - "default": "./lib/" - }, - "./dist/a.js": "./../../a.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json deleted file mode 100644 index 0012a3de..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "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" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/umd.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/umd.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field/package.json deleted file mode 100644 index 5fa72bb5..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "@exports-field/core", - "version": "1.0.0", - "exports": "./a.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json deleted file mode 100644 index e6f12074..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "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/lib2/", "./lib/"], - "node": "./lib/", - "default": "./lib/" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/index b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/index deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json deleted file mode 100644 index 1a838f49..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "name": "exports-field", - "exportsField": { - "exports": "./main.js" - }, - "ex": "./index", - "broken": { - ".": "./src" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/src/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/src/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.ts b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.mts b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.mts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mjs b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mjs deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mts.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mts.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.ts b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/app.module.js b/fixtures/enhanced_resolve/test/fixtures/extensions/app.module.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.js b/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/foo.js b/fixtures/enhanced_resolve/test/fixtures/extensions/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/foo.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/foo.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/index.js b/fixtures/enhanced_resolve/test/fixtures/extensions/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/index.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module.js b/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module/index.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/package.json b/fixtures/enhanced_resolve/test/fixtures/extensions/package.json deleted file mode 100644 index 5e55a1e8..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/extensions/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "./index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/file.load1 b/fixtures/enhanced_resolve/test/fixtures/file.load1 deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/file.load2 b/fixtures/enhanced_resolve/test/fixtures/file.load2 deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/foo/index.js b/fixtures/enhanced_resolve/test/fixtures/foo/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/foo/package.json b/fixtures/enhanced_resolve/test/fixtures/foo/package.json deleted file mode 100644 index da86787a..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/foo/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "foo", - "version": "1.0.0" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json deleted file mode 100644 index aa2be496..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "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" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/internal/file.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/internal/file.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/y/y.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/y/y.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/internal/i.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/internal/i.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/nested/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js deleted file mode 100644 index e5b70a86..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = { nested: "nested" } diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-3/nested/f/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-3/nested/f/nested/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-4/f/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-4/f/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f$/$.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f$/$.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f/$.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f/$.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/nested/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/a.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/a.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/b.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/dir/b.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/dir/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/index.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json deleted file mode 100644 index 8d8d3a46..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "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/lib2/", "./lib/"], - "node": "./lib/", - "default": "./lib/" - }, - "./dist/a.js": "./../../a.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/c/index.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/c/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/imports-field/package.json deleted file mode 100644 index 248351a9..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "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" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/a.js b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json deleted file mode 100644 index ded7faa2..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json +++ /dev/null @@ -1,2 +0,0 @@ -{ - "main": "./a.js", diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/a.js b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/package.json b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/package.json deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/issue-238/package.json b/fixtures/enhanced_resolve/test/fixtures/issue-238/package.json deleted file mode 100644 index 352055cd..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/issue-238/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "private": true -} diff --git a/fixtures/enhanced_resolve/test/fixtures/issue-238/src/a/config.js b/fixtures/enhanced_resolve/test/fixtures/issue-238/src/a/config.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/issue-238/src/common/config/myObjectFile.js b/fixtures/enhanced_resolve/test/fixtures/issue-238/src/common/config/myObjectFile.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/lib.js b/fixtures/enhanced_resolve/test/fixtures/lib.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/lib/complex1.js b/fixtures/enhanced_resolve/test/fixtures/lib/complex1.js deleted file mode 100644 index b3de3d70..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/lib/complex1.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "lib complex1"; diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self/index.js b/fixtures/enhanced_resolve/test/fixtures/main-field-self/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json b/fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json deleted file mode 100644 index a2b6f341..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "./" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self2/index.js b/fixtures/enhanced_resolve/test/fixtures/main-field-self2/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json b/fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json deleted file mode 100644 index 4fa6f730..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "." -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main1.js b/fixtures/enhanced_resolve/test/fixtures/main1.js deleted file mode 100644 index 168f2a1e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main1.js +++ /dev/null @@ -1,9 +0,0 @@ -var a = require("./a"); -if (x) { - for (var i = 0; i < 100; i++) { - while (true) require("./b"); - do { - i++; - } while (require("m1/a")()); - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main2.js b/fixtures/enhanced_resolve/test/fixtures/main2.js deleted file mode 100644 index 39f062b1..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main2.js +++ /dev/null @@ -1,12 +0,0 @@ -var 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"); - }); - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main3.js b/fixtures/enhanced_resolve/test/fixtures/main3.js deleted file mode 100644 index 1c180166..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main3.js +++ /dev/null @@ -1,4 +0,0 @@ -var a = require("./a"); -require.ensure([], function(require) { - require("./c.js"); -}); diff --git a/fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js b/fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js deleted file mode 100644 index 997c1051..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is nested m1/a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/no#fragment/#/#.js b/fixtures/enhanced_resolve/test/fixtures/no#fragment/#/#.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/no.js b/fixtures/enhanced_resolve/test/fixtures/no.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/browser.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/browser.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/main.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json deleted file mode 100644 index c469e1fd..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "main": "./main.js", - "browser": "./browser.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js deleted file mode 100644 index 549620a5..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "the correct a.js"; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js deleted file mode 100644 index 5db6632e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = " :) " + require("m2/b.js"); diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js deleted file mode 100644 index d308569d..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require("m1/a") + require("m1"); diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js deleted file mode 100644 index cb8127e8..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "Step2"; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json deleted file mode 100644 index 8d6dfa56..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "dash-name", - "exports": "./index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json deleted file mode 100644 index 4fd8706e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "dash", - "exports": "./index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/invalidPackageJson/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/invalidPackageJson/package.json deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js deleted file mode 100644 index 46fc8e6c..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is m1/a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js deleted file mode 100644 index 8565c244..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is m1/b"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js deleted file mode 100644 index 34faaaf5..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "This is m2/b"; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/file.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/file.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js b/fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js deleted file mode 100644 index 997c1051..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is nested m1/a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/dir/index.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/dir/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/index.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/main.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/browser.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/browser.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/index.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json deleted file mode 100644 index e20ceaeb..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "main": "main.js", - "browser": { - "./package-alias/index.js": "./package-alias/browser.js", - "module": "pkg/dir/index" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/typescript/index.ts b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/typescript/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json deleted file mode 100644 index 4a1f838e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "@exports-field/core", - "version": "1.0.0", - "exports": { - ".": "./a.js", - "./x": "./a.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/prefer-pnp/alternative-modules/m1/b.js b/fixtures/enhanced_resolve/test/fixtures/prefer-pnp/alternative-modules/m1/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.css b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.css deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.js b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json deleted file mode 100644 index 14ab704d..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/index.css b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/index.css deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/module.js b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/module.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json deleted file mode 100644 index ee0eb71b..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "main": "../../../c.js", - "module": "module.js", - "style": "index.css" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/roots_fall_through/index.js b/fixtures/enhanced_resolve/test/fixtures/roots_fall_through/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/main.js b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json deleted file mode 100644 index 70a0f20f..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "browser": { - "./index.js": "./main.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/lib/index.js b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/lib/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/main.js b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json deleted file mode 100644 index 2af9e0d1..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "./main.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/shortcutdir.js/a.js b/fixtures/enhanced_resolve/test/fixtures/shortcutdir.js/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/b b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/b deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/c b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/c deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/a b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/a deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/b b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/b deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/b/foo/a b/fixtures/enhanced_resolve/test/fixtures/yield/b/foo/a deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/a b/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/a deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json b/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json deleted file mode 100644 index 0acc4b4c..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "foo", - "version": "1.0.0", - "browser": { - "./a": false - } -} diff --git "a/fixtures/enhanced_resolve/test/fixtures/\346\265\213\350\257\225.js" "b/fixtures/enhanced_resolve/test/fixtures/\346\265\213\350\257\225.js" deleted file mode 100644 index e69de29b..00000000 diff --git "a/fixtures/misc/\344\270\255\346\226\207/\344\270\255\346\226\207.js" "b/fixtures/misc/\344\270\255\346\226\207/\344\270\255\346\226\207.js" deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/pnpm/.gitignore b/fixtures/pnpm/.gitignore deleted file mode 100644 index 3c3629e6..00000000 --- a/fixtures/pnpm/.gitignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/fixtures/pnpm/package.json b/fixtures/pnpm/package.json deleted file mode 100644 index 78712e2b..00000000 --- a/fixtures/pnpm/package.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "name": "pnpm", - "version": "1.0.0", - "private": true, - "devDependencies": { - "axios": "1.6.2", - "styled-components": "6.1.1", - "postcss": "8.4.33" - } -} diff --git a/fixtures/pnpm/pnpm-lock.yaml b/fixtures/pnpm/pnpm-lock.yaml deleted file mode 100644 index e51dfd6a..00000000 --- a/fixtures/pnpm/pnpm-lock.yaml +++ /dev/null @@ -1,212 +0,0 @@ -lockfileVersion: '6.0' - -settings: - autoInstallPeers: true - excludeLinksFromLockfile: false - -devDependencies: - axios: - specifier: 1.6.2 - version: 1.6.2 - postcss: - specifier: 8.4.33 - version: 8.4.33 - styled-components: - specifier: 6.1.1 - version: 6.1.1(react-dom@18.2.0)(react@18.2.0) - -packages: - - /@emotion/is-prop-valid@1.2.1: - resolution: {integrity: sha512-61Mf7Ufx4aDxx1xlDeOm8aFFigGHE4z+0sKCa+IHCeZKiyP9RLD0Mmx7m8b9/Cf37f7NAvQOOJAbQQGVr5uERw==} - dependencies: - '@emotion/memoize': 0.8.1 - dev: true - - /@emotion/memoize@0.8.1: - resolution: {integrity: sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA==} - dev: true - - /@emotion/unitless@0.8.1: - resolution: {integrity: sha512-KOEGMu6dmJZtpadb476IsZBclKvILjopjUii3V+7MnXIQCYh8W3NgNcgwo21n9LXZX6EDIKvqfjYxXebDwxKmQ==} - dev: true - - /@types/stylis@4.2.4: - resolution: {integrity: sha512-36ZrGJ8fgtBr6nwNnuJ9jXIj+bn/pF6UoqmrQT7+Y99+tFFeHHsoR54+194dHdyhPjgbeoNz3Qru0oRt0l6ASQ==} - dev: true - - /asynckit@0.4.0: - resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} - dev: true - - /axios@1.6.2: - resolution: {integrity: sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A==} - dependencies: - follow-redirects: 1.15.3 - form-data: 4.0.0 - proxy-from-env: 1.1.0 - transitivePeerDependencies: - - debug - dev: true - - /camelize@1.0.1: - resolution: {integrity: sha512-dU+Tx2fsypxTgtLoE36npi3UqcjSSMNYfkqgmoEhtZrraP5VWq0K7FkWVTYa8eMPtnU/G2txVsfdCJTn9uzpuQ==} - dev: true - - /combined-stream@1.0.8: - resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} - engines: {node: '>= 0.8'} - dependencies: - delayed-stream: 1.0.0 - dev: true - - /css-color-keywords@1.0.0: - resolution: {integrity: sha512-FyyrDHZKEjXDpNJYvVsV960FiqQyXc/LlYmsxl2BcdMb2WPx0OGRVgTg55rPSyLSNMqP52R9r8geSp7apN3Ofg==} - engines: {node: '>=4'} - dev: true - - /css-to-react-native@3.2.0: - resolution: {integrity: sha512-e8RKaLXMOFii+02mOlqwjbD00KSEKqblnpO9e++1aXS1fPQOpS1YoqdVHBqPjHNoxeF2mimzVqawm2KCbEdtHQ==} - dependencies: - camelize: 1.0.1 - css-color-keywords: 1.0.0 - postcss-value-parser: 4.2.0 - dev: true - - /csstype@3.1.2: - resolution: {integrity: sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==} - dev: true - - /delayed-stream@1.0.0: - resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} - engines: {node: '>=0.4.0'} - dev: true - - /follow-redirects@1.15.3: - resolution: {integrity: sha512-1VzOtuEM8pC9SFU1E+8KfTjZyMztRsgEfwQl44z8A25uy13jSzTj6dyK2Df52iV0vgHCfBwLhDWevLn95w5v6Q==} - engines: {node: '>=4.0'} - peerDependencies: - debug: '*' - peerDependenciesMeta: - debug: - optional: true - dev: true - - /form-data@4.0.0: - resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==} - engines: {node: '>= 6'} - dependencies: - asynckit: 0.4.0 - combined-stream: 1.0.8 - mime-types: 2.1.35 - dev: true - - /js-tokens@4.0.0: - resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} - dev: true - - /loose-envify@1.4.0: - resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==} - hasBin: true - dependencies: - js-tokens: 4.0.0 - dev: true - - /mime-db@1.52.0: - resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} - engines: {node: '>= 0.6'} - dev: true - - /mime-types@2.1.35: - resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} - engines: {node: '>= 0.6'} - dependencies: - mime-db: 1.52.0 - dev: true - - /nanoid@3.3.7: - resolution: {integrity: sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==} - engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} - hasBin: true - dev: true - - /picocolors@1.0.0: - resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==} - dev: true - - /postcss-value-parser@4.2.0: - resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==} - dev: true - - /postcss@8.4.33: - resolution: {integrity: sha512-Kkpbhhdjw2qQs2O2DGX+8m5OVqEcbB9HRBvuYM9pgrjEFUg30A9LmXNlTAUj4S9kgtGyrMbTzVjH7E+s5Re2yg==} - engines: {node: ^10 || ^12 || >=14} - dependencies: - nanoid: 3.3.7 - picocolors: 1.0.0 - source-map-js: 1.0.2 - dev: true - - /proxy-from-env@1.1.0: - resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==} - dev: true - - /react-dom@18.2.0(react@18.2.0): - resolution: {integrity: sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==} - peerDependencies: - react: ^18.2.0 - dependencies: - loose-envify: 1.4.0 - react: 18.2.0 - scheduler: 0.23.0 - dev: true - - /react@18.2.0: - resolution: {integrity: sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==} - engines: {node: '>=0.10.0'} - dependencies: - loose-envify: 1.4.0 - dev: true - - /scheduler@0.23.0: - resolution: {integrity: sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw==} - dependencies: - loose-envify: 1.4.0 - dev: true - - /shallowequal@1.1.0: - resolution: {integrity: sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ==} - dev: true - - /source-map-js@1.0.2: - resolution: {integrity: sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==} - engines: {node: '>=0.10.0'} - dev: true - - /styled-components@6.1.1(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-cpZZP5RrKRIClBW5Eby4JM1wElLVP4NQrJbJ0h10TidTyJf4SIIwa3zLXOoPb4gJi8MsJ8mjq5mu2IrEhZIAcQ==} - engines: {node: '>= 16'} - peerDependencies: - react: '>= 16.8.0' - react-dom: '>= 16.8.0' - dependencies: - '@emotion/is-prop-valid': 1.2.1 - '@emotion/unitless': 0.8.1 - '@types/stylis': 4.2.4 - css-to-react-native: 3.2.0 - csstype: 3.1.2 - postcss: 8.4.33 - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - shallowequal: 1.1.0 - stylis: 4.3.0 - tslib: 2.6.2 - dev: true - - /stylis@4.3.0: - resolution: {integrity: sha512-E87pIogpwUsUwXw7dNyU4QDjdgVMy52m+XEOPEKUn161cCzWjjhPSQhByfd1CcNvrOLnXQ6OnnZDwnJrz/Z4YQ==} - dev: true - - /tslib@2.6.2: - resolution: {integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==} - dev: true diff --git a/fixtures/tsconfig/cases/builtins/thing.js b/fixtures/tsconfig/cases/builtins/thing.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/builtins/tsconfig.json b/fixtures/tsconfig/cases/builtins/tsconfig.json deleted file mode 100644 index 36aa1a4d..00000000 --- a/fixtures/tsconfig/cases/builtins/tsconfig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compilerOptions": { - "baseUrl": "." - } -} diff --git a/fixtures/tsconfig/cases/exports/index.js b/fixtures/tsconfig/cases/exports/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/exports/tsconfig.json b/fixtures/tsconfig/cases/exports/tsconfig.json deleted file mode 100644 index f0e3159b..00000000 --- a/fixtures/tsconfig/cases/exports/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-exports" -} diff --git a/fixtures/tsconfig/cases/extends-extension/base-tsconfig.json b/fixtures/tsconfig/cases/extends-extension/base-tsconfig.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/cases/extends-extension/base-tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/cases/extends-extension/foo.js b/fixtures/tsconfig/cases/extends-extension/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-extension/tsconfig.json b/fixtures/tsconfig/cases/extends-extension/tsconfig.json deleted file mode 100644 index 0ae4c6a3..00000000 --- a/fixtures/tsconfig/cases/extends-extension/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./base-tsconfig" -} diff --git a/fixtures/tsconfig/cases/extends-extensionless/foo.js b/fixtures/tsconfig/cases/extends-extensionless/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-extensionless/tsconfig.json b/fixtures/tsconfig/cases/extends-extensionless/tsconfig.json deleted file mode 100644 index c36cb7d4..00000000 --- a/fixtures/tsconfig/cases/extends-extensionless/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-field/conf" -} diff --git a/fixtures/tsconfig/cases/extends-multiple/foo.js b/fixtures/tsconfig/cases/extends-multiple/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-multiple/tsconfig.json b/fixtures/tsconfig/cases/extends-multiple/tsconfig.json deleted file mode 100644 index aa2ae783..00000000 --- a/fixtures/tsconfig/cases/extends-multiple/tsconfig.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": ["../extends-extension", "../extends-paths"], - "compilerOptions": { - "baseUrl": ".", - }, -} diff --git a/fixtures/tsconfig/cases/extends-not-found/index.js b/fixtures/tsconfig/cases/extends-not-found/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-not-found/tsconfig.json b/fixtures/tsconfig/cases/extends-not-found/tsconfig.json deleted file mode 100644 index 99df91da..00000000 --- a/fixtures/tsconfig/cases/extends-not-found/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./not-found" -} diff --git a/fixtures/tsconfig/cases/extends-paths/src/index.js b/fixtures/tsconfig/cases/extends-paths/src/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-paths/tsconfig.base.json b/fixtures/tsconfig/cases/extends-paths/tsconfig.base.json deleted file mode 100644 index 5c64b067..00000000 --- a/fixtures/tsconfig/cases/extends-paths/tsconfig.base.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "@/*": ["./*"] - } - } -} diff --git a/fixtures/tsconfig/cases/extends-paths/tsconfig.json b/fixtures/tsconfig/cases/extends-paths/tsconfig.json deleted file mode 100644 index 51086018..00000000 --- a/fixtures/tsconfig/cases/extends-paths/tsconfig.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": "./tsconfig.base.json", - "compilerOptions": { - "baseUrl": "src", - }, -} diff --git a/fixtures/tsconfig/cases/field/index.js b/fixtures/tsconfig/cases/field/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/field/tsconfig.json b/fixtures/tsconfig/cases/field/tsconfig.json deleted file mode 100644 index 9f86c3f4..00000000 --- a/fixtures/tsconfig/cases/field/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-field" -} diff --git a/fixtures/tsconfig/cases/index/index.js b/fixtures/tsconfig/cases/index/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/index/tsconfig.json b/fixtures/tsconfig/cases/index/tsconfig.json deleted file mode 100644 index d20b1774..00000000 --- a/fixtures/tsconfig/cases/index/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-index" -} diff --git a/fixtures/tsconfig/cases/paths_template_variable/foo.js b/fixtures/tsconfig/cases/paths_template_variable/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json b/fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json deleted file mode 100644 index a1a37bb6..00000000 --- a/fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "../../tsconfig_template_variable.json" -} diff --git a/fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json b/fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json deleted file mode 100644 index e7d8e5e5..00000000 --- a/fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "compilerOptions": { - "composite": true, - "paths": { - "foo": ["${configDir}/foo.js"] - } - } -} diff --git a/fixtures/tsconfig/cases/project_references/app/aliased/index.ts b/fixtures/tsconfig/cases/project_references/app/aliased/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/app/index.ts b/fixtures/tsconfig/cases/project_references/app/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/app/tsconfig.json b/fixtures/tsconfig/cases/project_references/app/tsconfig.json deleted file mode 100644 index 7036d2bb..00000000 --- a/fixtures/tsconfig/cases/project_references/app/tsconfig.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "extends": "../tsconfig.base.json", - "compilerOptions": { - "baseUrl": "./", - "paths": { - "@/*": ["./aliased/*"] - } - }, - "references": [ - { - "path": "../project_a/conf.json" - }, - { - "path": "../project_b" - }, - { - "path": "../project_c/tsconfig.json" - }, - { - "path": "../../paths_template_variable/tsconfig2.json" - } - ] -} diff --git a/fixtures/tsconfig/cases/project_references/project_a/aliased/index.ts b/fixtures/tsconfig/cases/project_references/project_a/aliased/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_a/conf.json b/fixtures/tsconfig/cases/project_references/project_a/conf.json deleted file mode 100644 index 4d389d7a..00000000 --- a/fixtures/tsconfig/cases/project_references/project_a/conf.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "compilerOptions": { - "composite": true, - "paths": { - "@/*": ["./aliased/*"] - } - } -} diff --git a/fixtures/tsconfig/cases/project_references/project_a/index.ts b/fixtures/tsconfig/cases/project_references/project_a/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_b/src/aliased/index.ts b/fixtures/tsconfig/cases/project_references/project_b/src/aliased/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_b/tsconfig.json b/fixtures/tsconfig/cases/project_references/project_b/tsconfig.json deleted file mode 100644 index 4ab05cd8..00000000 --- a/fixtures/tsconfig/cases/project_references/project_b/tsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "compilerOptions": { - "composite": true, - "baseUrl": "./src", - "paths": { - "@/*": ["./aliased/*"] - } - } -} diff --git a/fixtures/tsconfig/cases/project_references/project_c/index.ts b/fixtures/tsconfig/cases/project_references/project_c/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_c/tsconfig.json b/fixtures/tsconfig/cases/project_references/project_c/tsconfig.json deleted file mode 100644 index fe520939..00000000 --- a/fixtures/tsconfig/cases/project_references/project_c/tsconfig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compilerOptions": { - "composite": true - } -} diff --git a/fixtures/tsconfig/cases/project_references/tsconfig.base.json b/fixtures/tsconfig/cases/project_references/tsconfig.base.json deleted file mode 100644 index 88ccffe7..00000000 --- a/fixtures/tsconfig/cases/project_references/tsconfig.base.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "compilerOptions": { - } -} diff --git a/fixtures/tsconfig/cases/suffixes/a.ios.ts b/fixtures/tsconfig/cases/suffixes/a.ios.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/a.ts b/fixtures/tsconfig/cases/suffixes/a.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/b.ts b/fixtures/tsconfig/cases/suffixes/b.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/c-test.ts b/fixtures/tsconfig/cases/suffixes/c-test.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/index.ts b/fixtures/tsconfig/cases/suffixes/index.ts deleted file mode 100644 index b09939b9..00000000 --- a/fixtures/tsconfig/cases/suffixes/index.ts +++ /dev/null @@ -1 +0,0 @@ -import './a'; diff --git a/fixtures/tsconfig/cases/suffixes/tsconfig.json b/fixtures/tsconfig/cases/suffixes/tsconfig.json deleted file mode 100644 index 4c2ccc8f..00000000 --- a/fixtures/tsconfig/cases/suffixes/tsconfig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compilerOptions": { - "moduleSuffixes": [".ios", "-test", ""] - } -} diff --git a/fixtures/tsconfig/cases/trailing-comma/bar.js b/fixtures/tsconfig/cases/trailing-comma/bar.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/trailing-comma/index.js b/fixtures/tsconfig/cases/trailing-comma/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/trailing-comma/tsconfig.json b/fixtures/tsconfig/cases/trailing-comma/tsconfig.json deleted file mode 100644 index 6dc20ca5..00000000 --- a/fixtures/tsconfig/cases/trailing-comma/tsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "compilerOptions": { - "paths": { - /* some comment */ - "foo": ["bar.js"], - }, - }, - // another comment -} diff --git a/fixtures/tsconfig/foo.js b/fixtures/tsconfig/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/nested/index.js b/fixtures/tsconfig/nested/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/nested/test.js b/fixtures/tsconfig/nested/test.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/nested/tsconfig.json b/fixtures/tsconfig/nested/tsconfig.json deleted file mode 100644 index 6deb3011..00000000 --- a/fixtures/tsconfig/nested/tsconfig.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "extends": "..", - "compilerOptions": { - "paths": { - "ts-path": ["test.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-exports/conf.json b/fixtures/tsconfig/node_modules/tsconfig-exports/conf.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-exports/conf.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-exports/foo.js b/fixtures/tsconfig/node_modules/tsconfig-exports/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-exports/package.json b/fixtures/tsconfig/node_modules/tsconfig-exports/package.json deleted file mode 100644 index be0ddee6..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-exports/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "tsconfig-exports", - "private": true, - "exports": { - ".": "./conf.json" - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-field/conf.json b/fixtures/tsconfig/node_modules/tsconfig-field/conf.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-field/conf.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-field/foo.js b/fixtures/tsconfig/node_modules/tsconfig-field/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-field/package.json b/fixtures/tsconfig/node_modules/tsconfig-field/package.json deleted file mode 100644 index 7138fdde..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-field/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "tsconfig-field", - "private": true, - "tsconfig": "conf.json" -} \ No newline at end of file diff --git a/fixtures/tsconfig/node_modules/tsconfig-index/foo.js b/fixtures/tsconfig/node_modules/tsconfig-index/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-index/package.json b/fixtures/tsconfig/node_modules/tsconfig-index/package.json deleted file mode 100644 index eb2431e7..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-index/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "tsconfig-index", - "private": true -} \ No newline at end of file diff --git a/fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json b/fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-not-used/foo.js b/fixtures/tsconfig/node_modules/tsconfig-not-used/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json b/fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json deleted file mode 100644 index eb16d127..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "ts-path": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/package.json b/fixtures/tsconfig/package.json deleted file mode 100755 index f48acd1c..00000000 --- a/fixtures/tsconfig/package.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "name": "resolver", - "private": true, - "alias": { - "aliased": "foo", - "aliased-file": "./bar.js", - "something": "./nested/test.js", - "aliasedfolder": "./nested", - "aliasedabsolute": "/nested", - "foo/bar": "./bar.js", - "glob/*/*": "./nested/$2", - "./baz": "./bar.js", - "url": false - }, - "imports": { - "#test": "./bar.js" - }, - "dependencies": { - "foo": "^0.3.4" - }, - "peerDependencies": { - "bar": "*" - } -} diff --git a/fixtures/tsconfig/tsconfig.json b/fixtures/tsconfig/tsconfig.json deleted file mode 100644 index eb16d127..00000000 --- a/fixtures/tsconfig/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "ts-path": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/tsconfig_template_variable.json b/fixtures/tsconfig/tsconfig_template_variable.json deleted file mode 100644 index 6f272344..00000000 --- a/fixtures/tsconfig/tsconfig_template_variable.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["${configDir}/foo.js"] - } - } -} diff --git a/napi/__test__/resolver.spec.mjs b/napi/__test__/resolver.spec.mjs deleted file mode 100644 index ac6ee0ef..00000000 --- a/napi/__test__/resolver.spec.mjs +++ /dev/null @@ -1,260 +0,0 @@ -import { join } from 'node:path' -import { fileURLToPath } from 'node:url' - -import test from 'ava' - -let ResolverFactory - -if (process.env.WASI_TEST) { - const wasi = await import('../resolver.wasi.cjs') - ResolverFactory = wasi.ResolverFactory -} else { - const napi = await import('../index.js') - ResolverFactory = napi.ResolverFactory -} - -const currentDir = join(fileURLToPath(import.meta.url), '..') - -const enhancedResolveRoot = join( - currentDir, - '..', - '..', - 'fixtures', - 'enhanced_resolve', - 'test', - 'fixtures' -) - -// https://github.com/webpack/enhanced-resolve/blob/main/test/resolve.test.js - -for (const [title, context, request, expected] of [ - [ - 'absolute path', - enhancedResolveRoot, - join(enhancedResolveRoot, 'main1.js'), - join(enhancedResolveRoot, 'main1.js'), - ], - [ - 'file with .js', - enhancedResolveRoot, - './main1.js', - join(enhancedResolveRoot, 'main1.js'), - ], - [ - 'file without extension', - enhancedResolveRoot, - './main1', - join(enhancedResolveRoot, 'main1.js'), - ], - [ - 'another file with .js', - enhancedResolveRoot, - './a.js', - join(enhancedResolveRoot, 'a.js'), - ], - [ - 'another file without extension', - enhancedResolveRoot, - './a', - join(enhancedResolveRoot, 'a.js'), - ], - [ - 'file in module with .js', - enhancedResolveRoot, - 'm1/a.js', - join(enhancedResolveRoot, 'node_modules/m1/a.js'), - ], - [ - 'file in module without extension', - enhancedResolveRoot, - 'm1/a', - join(enhancedResolveRoot, 'node_modules/m1/a.js'), - ], - [ - 'another file in module without extension', - enhancedResolveRoot, - 'complexm/step1', - join(enhancedResolveRoot, 'node_modules/complexm/step1.js'), - ], - [ - 'from submodule to file in sibling module', - join(enhancedResolveRoot, 'node_modules/complexm'), - 'm2/b.js', - join(enhancedResolveRoot, 'node_modules/m2/b.js'), - ], - [ - 'from nested directory to overwritten file in module', - join(enhancedResolveRoot, 'multiple_modules'), - 'm1/a.js', - join(enhancedResolveRoot, 'multiple_modules/node_modules/m1/a.js'), - ], - [ - 'from nested directory to not overwritten file in module', - join(enhancedResolveRoot, 'multiple_modules'), - 'm1/b.js', - join(enhancedResolveRoot, 'node_modules/m1/b.js'), - ], - [ - 'file with query', - enhancedResolveRoot, - './main1.js?query', - join(enhancedResolveRoot, 'main1.js?query'), - ], - [ - 'file with fragment', - enhancedResolveRoot, - './main1.js#fragment', - join(enhancedResolveRoot, 'main1.js#fragment'), - ], - [ - 'file with fragment and query', - enhancedResolveRoot, - './main1.js#fragment?query', - join(enhancedResolveRoot, 'main1.js#fragment?query'), - ], - [ - 'file with query and fragment', - enhancedResolveRoot, - './main1.js?#fragment', - join(enhancedResolveRoot, 'main1.js?#fragment'), - ], - - [ - 'file with query (unicode)', - enhancedResolveRoot, - './测试.js?query', - join(enhancedResolveRoot, '测试.js?query'), - ], - [ - 'file with fragment (unicode)', - enhancedResolveRoot, - './测试.js#fragment', - join(enhancedResolveRoot, '测试.js#fragment'), - ], - [ - 'file with fragment and query (unicode)', - enhancedResolveRoot, - './测试.js#fragment?query', - join(enhancedResolveRoot, '测试.js#fragment?query'), - ], - [ - 'file with query and fragment (unicode)', - enhancedResolveRoot, - './测试.js?#fragment', - join(enhancedResolveRoot, '测试.js?#fragment'), - ], - - [ - 'file in module with query', - enhancedResolveRoot, - 'm1/a?query', - join(enhancedResolveRoot, 'node_modules/m1/a.js?query'), - ], - [ - 'file in module with fragment', - enhancedResolveRoot, - 'm1/a#fragment', - join(enhancedResolveRoot, 'node_modules/m1/a.js#fragment'), - ], - [ - 'file in module with fragment and query', - enhancedResolveRoot, - 'm1/a#fragment?query', - join(enhancedResolveRoot, 'node_modules/m1/a.js#fragment?query'), - ], - [ - 'file in module with query and fragment', - enhancedResolveRoot, - 'm1/a?#fragment', - join(enhancedResolveRoot, 'node_modules/m1/a.js?#fragment'), - ], - [ - 'differ between directory and file, resolve file', - enhancedResolveRoot, - './dirOrFile', - join(enhancedResolveRoot, 'dirOrFile.js'), - ], - [ - 'differ between directory and file, resolve directory', - enhancedResolveRoot, - './dirOrFile/', - join(enhancedResolveRoot, 'dirOrFile/index.js'), - ], - [ - 'find node_modules outside of node_modules', - join(enhancedResolveRoot, 'browser-module/node_modules'), - 'm1/a', - join(enhancedResolveRoot, 'node_modules/m1/a.js'), - ], - [ - "don't crash on main field pointing to self", - enhancedResolveRoot, - './main-field-self', - join(enhancedResolveRoot, './main-field-self/index.js'), - ], - [ - "don't crash on main field pointing to self (2)", - enhancedResolveRoot, - './main-field-self2', - join(enhancedResolveRoot, './main-field-self2/index.js'), - ], - // enhanced-resolve has `#` prepended with a `\0`, they are removed from the - // following 3 expected test results. - // See https://github.com/webpack/enhanced-resolve#escaping - [ - 'handle fragment edge case (no fragment)', - enhancedResolveRoot, - './no#fragment/#/#', - join(enhancedResolveRoot, 'no#fragment', '#', '#.js'), - ], - [ - 'handle fragment edge case (fragment)', - enhancedResolveRoot, - './no#fragment/#/', - join(enhancedResolveRoot, 'no.js#fragment') + '/#/', - ], - [ - 'handle fragment escaping', - enhancedResolveRoot, - './no\0#fragment/\0#/\0##fragment', - join(enhancedResolveRoot, 'no#fragment', '#', '#.js#fragment'), - ], -]) { - test(title, (t) => { - const resolver = new ResolverFactory({ - modules: ['src/a', 'src/b', 'src/common', 'node_modules'], - extensions: ['.js', '.jsx', '.ts', '.tsx'], - }) - - t.is(resolver.sync(context, request).path, expected) - }) -} - -test('resolve pnpm package', (t) => { - const rootDir = join(currentDir, '..', '..'); - const pnpmProjectPath = join(rootDir, 'fixtures', 'pnpm') - const resolver = new ResolverFactory({ - aliasFields: ['browser'], - }) - t.deepEqual(resolver.sync(pnpmProjectPath, 'styled-components'), { - path: join( - rootDir, - 'node_modules/.pnpm/styled-components@6.1.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/styled-components/dist/styled-components.browser.cjs.js' - ), - }) - t.deepEqual( - resolver.sync( - join( - rootDir, - 'node_modules/.pnpm/styled-components@6.1.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/styled-components' - ), - 'react' - ), - { - path: join( - rootDir, - 'node_modules/.pnpm/react@18.3.1/node_modules/react/index.js' - ), - } - ) -}) diff --git a/napi/src/lib.rs b/napi/src/lib.rs deleted file mode 100644 index 238f99c4..00000000 --- a/napi/src/lib.rs +++ /dev/null @@ -1,166 +0,0 @@ -extern crate napi; -extern crate napi_derive; -extern crate oxc_resolver; - -use std::path::{Path, PathBuf}; - -use napi_derive::napi; -use oxc_resolver::{ResolveOptions, Resolver}; - -use self::options::{NapiResolveOptions, StrOrStrList}; - -mod options; - -#[napi(object)] -pub struct ResolveResult { - pub path: Option, - pub error: Option, -} - -fn resolve(resolver: &Resolver, path: &Path, request: &str) -> ResolveResult { - match resolver.resolve(path, request) { - Ok(resolution) => ResolveResult { - path: Some(resolution.full_path().to_string_lossy().to_string()), - error: None, - }, - Err(err) => ResolveResult { path: None, error: Some(err.to_string()) }, - } -} - -#[allow(clippy::needless_pass_by_value)] -#[napi] -pub fn sync(path: String, request: String) -> ResolveResult { - let path = PathBuf::from(path); - let resolver = Resolver::new(ResolveOptions::default()); - resolve(&resolver, &path, &request) -} - -#[napi] -pub struct ResolverFactory { - resolver: Resolver, -} - -#[napi] -impl ResolverFactory { - #[napi(constructor)] - pub fn new(options: NapiResolveOptions) -> Self { - Self { resolver: Resolver::new(Self::normalize_options(options)) } - } - - #[napi] - pub fn default() -> Self { - let default_options = ResolveOptions::default(); - Self { resolver: Resolver::new(default_options) } - } - - /// Clone the resolver using the same underlying cache. - #[napi] - pub fn clone_with_options(&self, options: NapiResolveOptions) -> Self { - Self { resolver: self.resolver.clone_with_options(Self::normalize_options(options)) } - } - - /// Clear the underlying cache. - #[napi] - pub fn clear_cache(&self) { - self.resolver.clear_cache(); - } - - #[allow(clippy::needless_pass_by_value)] - #[napi] - pub fn sync(&self, path: String, request: String) -> ResolveResult { - let path = PathBuf::from(path); - resolve(&self.resolver, &path, &request) - } - - fn normalize_options(op: NapiResolveOptions) -> ResolveOptions { - let default = ResolveOptions::default(); - // merging options - ResolveOptions { - tsconfig: op.tsconfig.map(|tsconfig| tsconfig.into()), - alias: op - .alias - .map(|alias| { - alias - .into_iter() - .map(|(k, v)| { - let v = v - .into_iter() - .map(|item| match item { - Some(path) => oxc_resolver::AliasValue::from(path), - None => oxc_resolver::AliasValue::Ignore, - }) - .collect(); - (k, v) - }) - .collect::>() - }) - .unwrap_or(default.alias), - alias_fields: op - .alias_fields - .map(|o| o.into_iter().map(|x| StrOrStrList(x).into()).collect::>()) - .unwrap_or(default.alias_fields), - condition_names: op.condition_names.unwrap_or(default.condition_names), - description_files: op.description_files.unwrap_or(default.description_files), - enforce_extension: op - .enforce_extension - .map(|enforce_extension| enforce_extension.into()) - .unwrap_or(default.enforce_extension), - exports_fields: op - .exports_fields - .map(|o| o.into_iter().map(|x| StrOrStrList(x).into()).collect::>()) - .unwrap_or(default.exports_fields), - imports_fields: op - .imports_fields - .map(|o| o.into_iter().map(|x| StrOrStrList(x).into()).collect::>()) - .unwrap_or(default.imports_fields), - extension_alias: op - .extension_alias - .map(|extension_alias| extension_alias.into_iter().collect::>()) - .unwrap_or(default.extension_alias), - extensions: op.extensions.unwrap_or(default.extensions), - fallback: op - .fallback - .map(|fallback| { - fallback - .into_iter() - .map(|(k, v)| { - let v = v - .into_iter() - .map(|item| match item { - Some(path) => oxc_resolver::AliasValue::from(path), - None => oxc_resolver::AliasValue::Ignore, - }) - .collect(); - (k, v) - }) - .collect::>() - }) - .unwrap_or(default.fallback), - fully_specified: op.fully_specified.unwrap_or(default.fully_specified), - main_fields: op - .main_fields - .map(|o| StrOrStrList(o).into()) - .unwrap_or(default.main_fields), - main_files: op.main_files.unwrap_or(default.main_files), - modules: op.modules.map(|o| StrOrStrList(o).into()).unwrap_or(default.modules), - resolve_to_context: op.resolve_to_context.unwrap_or(default.resolve_to_context), - prefer_relative: op.prefer_relative.unwrap_or(default.prefer_relative), - prefer_absolute: op.prefer_absolute.unwrap_or(default.prefer_absolute), - restrictions: op - .restrictions - .map(|restrictions| { - restrictions - .into_iter() - .map(|restriction| restriction.into()) - .collect::>() - }) - .unwrap_or(default.restrictions), - roots: op - .roots - .map(|roots| roots.into_iter().map(PathBuf::from).collect::>()) - .unwrap_or(default.roots), - symlinks: op.symlinks.unwrap_or(default.symlinks), - builtin_modules: op.builtin_modules.unwrap_or(default.builtin_modules), - } - } -} diff --git a/napi/src/options.rs b/napi/src/options.rs deleted file mode 100644 index ea35672f..00000000 --- a/napi/src/options.rs +++ /dev/null @@ -1,261 +0,0 @@ -use std::path::PathBuf; - -use napi::Either; -use napi_derive::napi; -use std::collections::HashMap; - -/// Module Resolution Options -/// -/// Options are directly ported from [enhanced-resolve](https://github.com/webpack/enhanced-resolve#resolver-options). -/// -/// See [webpack resolve](https://webpack.js.org/configuration/resolve/) for information and examples -#[derive(Debug, Clone)] -#[napi(object)] -pub struct NapiResolveOptions { - /// Path to TypeScript configuration file. - /// - /// Default `None` - pub tsconfig: Option, - - /// Alias for [ResolveOptions::alias] and [ResolveOptions::fallback]. - /// - /// For the second value of the tuple, `None -> AliasValue::Ignore`, Some(String) -> - /// AliasValue::Path(String)` - /// Create aliases to import or require certain modules more easily. - /// A trailing $ can also be added to the given object's keys to signify an exact match. - pub alias: Option>>>, - - /// A list of alias fields in description files. - /// Specify a field, such as `browser`, to be parsed according to [this specification](https://github.com/defunctzombie/package-browser-field-spec). - /// Can be a path to json object such as `["path", "to", "exports"]`. - /// - /// Default `[]` - #[napi(ts_type = "(string | string[])[]")] - pub alias_fields: Option>, - - /// Condition names for exports field which defines entry points of a package. - /// The key order in the exports field is significant. During condition matching, earlier entries have higher priority and take precedence over later entries. - /// - /// Default `[]` - pub condition_names: Option>, - - /// The JSON files to use for descriptions. (There was once a `bower.json`.) - /// - /// Default `["package.json"]` - pub description_files: Option>, - - /// If true, it will not allow extension-less files. - /// So by default `require('./foo')` works if `./foo` has a `.js` extension, - /// but with this enabled only `require('./foo.js')` will work. - /// - /// Default to `true` when [ResolveOptions::extensions] contains an empty string. - /// Use `Some(false)` to disable the behavior. - /// See - /// - /// Default None, which is the same as `Some(false)` when the above empty rule is not applied. - pub enforce_extension: Option, - - /// A list of exports fields in description files. - /// Can be a path to json object such as `["path", "to", "exports"]`. - /// - /// Default `[["exports"]]`. - #[napi(ts_type = "(string | string[])[]")] - pub exports_fields: Option>, - - /// Fields from `package.json` which are used to provide the internal requests of a package - /// (requests starting with # are considered internal). - /// - /// Can be a path to a JSON object such as `["path", "to", "imports"]`. - /// - /// Default `[["imports"]]`. - #[napi(ts_type = "(string | string[])[]")] - pub imports_fields: Option>, - - /// An object which maps extension to extension aliases. - /// - /// Default `{}` - pub extension_alias: Option>>, - - /// Attempt to resolve these extensions in order. - /// If multiple files share the same name but have different extensions, - /// will resolve the one with the extension listed first in the array and skip the rest. - /// - /// Default `[".js", ".json", ".node"]` - pub extensions: Option>, - - /// Redirect module requests when normal resolving fails. - /// - /// Default `[]` - pub fallback: Option>>>, - - /// 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). - /// - /// See also webpack configuration [resolve.fullySpecified](https://webpack.js.org/configuration/module/#resolvefullyspecified) - /// - /// Default `false` - pub fully_specified: Option, - - /// A list of main fields in description files - /// - /// Default `["main"]`. - #[napi(ts_type = "string | string[]")] - pub main_fields: Option, - - /// The filename to be used while resolving directories. - /// - /// Default `["index"]` - pub main_files: Option>, - - /// A list of directories to resolve modules from, can be absolute path or folder name. - /// - /// Default `["node_modules"]` - #[napi(ts_type = "string | string[]")] - pub modules: Option, - - /// Resolve to a context instead of a file. - /// - /// Default `false` - pub resolve_to_context: Option, - - /// Prefer to resolve module requests as relative requests instead of using modules from node_modules directories. - /// - /// Default `false` - pub prefer_relative: Option, - - /// Prefer to resolve server-relative urls as absolute paths before falling back to resolve in ResolveOptions::roots. - /// - /// Default `false` - pub prefer_absolute: Option, - - /// A list of resolve restrictions to restrict the paths that a request can be resolved on. - /// - /// Default `[]` - pub restrictions: Option>, - - /// A list of directories where requests of server-relative URLs (starting with '/') are resolved. - /// On non-Windows systems these requests are resolved as an absolute path first. - /// - /// Default `[]` - pub roots: Option>, - - /// Whether to resolve symlinks to their symlinked location. - /// When enabled, symlinked resources are resolved to their real path, not their symlinked location. - /// Note that this may cause module resolution to fail when using tools that symlink packages (like npm link). - /// - /// Default `true` - pub symlinks: Option, - - /// Whether to parse [module.builtinModules](https://nodejs.org/api/module.html#modulebuiltinmodules) or not. - /// For example, "zlib" will throw [crate::ResolveError::Builtin] when set to true. - /// - /// Default `false` - pub builtin_modules: Option, -} - -#[napi] -#[derive(Debug, PartialEq, Eq)] -pub enum EnforceExtension { - Auto, - Enabled, - Disabled, -} - -impl EnforceExtension { - pub fn is_auto(&self) -> bool { - *self == Self::Auto - } - - pub fn is_enabled(&self) -> bool { - *self == Self::Enabled - } - - pub fn is_disabled(&self) -> bool { - *self == Self::Disabled - } -} - -/// Alias Value for [ResolveOptions::alias] and [ResolveOptions::fallback]. -/// Use struct because napi don't support structured union now -#[napi(object)] -#[derive(Debug, Clone)] -pub struct Restriction { - pub path: Option, - pub regex: Option, -} - -/// Tsconfig Options -/// -/// Derived from [tsconfig-paths-webpack-plugin](https://github.com/dividab/tsconfig-paths-webpack-plugin#options) -#[napi(object)] -#[derive(Debug, Clone)] -pub struct TsconfigOptions { - /// Allows you to specify where to find the TypeScript configuration file. - /// You may provide - /// * a relative path to the configuration file. It will be resolved relative to cwd. - /// * an absolute path to the configuration file. - pub config_file: String, - - /// Support for Typescript Project References. - /// - /// * `'auto'`: use the `references` field from tsconfig of `config_file`. - /// * `string[]`: manually provided relative or absolute path. - #[napi(ts_type = "'auto' | string[]")] - pub references: Option>>, -} - -impl Into for Restriction { - fn into(self) -> oxc_resolver::Restriction { - match (self.path, self.regex) { - (None, None) => { - panic!("Should specify path or regex") - } - (None, Some(regex)) => oxc_resolver::Restriction::RegExp(regex), - (Some(path), None) => oxc_resolver::Restriction::Path(PathBuf::from(path)), - (Some(_), Some(_)) => { - panic!("Restriction can't be path and regex at the same time") - } - } - } -} - -impl Into for EnforceExtension { - fn into(self) -> oxc_resolver::EnforceExtension { - match self { - EnforceExtension::Auto => oxc_resolver::EnforceExtension::Auto, - EnforceExtension::Enabled => oxc_resolver::EnforceExtension::Enabled, - EnforceExtension::Disabled => oxc_resolver::EnforceExtension::Disabled, - } - } -} - -impl Into for TsconfigOptions { - fn into(self) -> oxc_resolver::TsconfigOptions { - oxc_resolver::TsconfigOptions { - config_file: PathBuf::from(self.config_file), - references: match self.references { - Some(Either::A(string)) if string.as_str() == "auto" => { - oxc_resolver::TsconfigReferences::Auto - } - Some(Either::A(opt)) => { - panic!("`{}` is not a valid option for tsconfig references", opt) - } - Some(Either::B(paths)) => oxc_resolver::TsconfigReferences::Paths( - paths.into_iter().map(PathBuf::from).collect::>(), - ), - None => oxc_resolver::TsconfigReferences::Disabled, - }, - } - } -} - -type StrOrStrListType = Either>; -pub struct StrOrStrList(pub StrOrStrListType); - -impl Into> for StrOrStrList { - fn into(self) -> Vec { - match self { - StrOrStrList(Either::A(s)) => Vec::from([s]), - StrOrStrList(Either::B(a)) => a, - } - } -} diff --git a/napi/tests/options.test.mjs b/napi/tests/options.test.mjs deleted file mode 100644 index 4a93efff..00000000 --- a/napi/tests/options.test.mjs +++ /dev/null @@ -1,59 +0,0 @@ -import { describe, it } from "node:test"; -import { ResolverFactory } from "../index.js"; -import * as assert from "node:assert"; -import * as path from "node:path"; - -const fixtureDir = new URL( - "../../fixtures/enhanced_resolve/test/fixtures", - import.meta.url -).pathname; - -describe("option", () => { - describe("aliasFields", () => { - it("should allow field string ", () => { - const resolver = new ResolverFactory({ aliasFields: ["browser"] }); - assert.match( - resolver.sync(fixtureDir, "./browser-module/lib/replaced.js").path, - /browser-module\/lib\/browser\.js$/ - ); - }); - it("should allow json path array", () => { - const resolver = new ResolverFactory({ - aliasFields: [["innerBrowser1", "field", "browser"]], - }); - - assert.match( - resolver.sync(fixtureDir, "./browser-module/lib/main1.js").path, - /browser-module\/lib\/main\.js$/ - ); - }); - }); - - describe("exportsFields", () => { - const createTest = (exportsFields) => { - const resolver = new ResolverFactory({ exportsFields }); - assert.match( - resolver.sync( - path.resolve(fixtureDir, "./exports-field3"), - "exports-field" - ).path, - /\/exports-field\/src\/index\.js$/ - ); - }; - it("should allow string as field item", createTest(["broken"])); - it("should allow json path array as field item", createTest([["broken"]])); - }); - - describe("mainFields", () => { - const createTest = (mainFields) => { - const resolver = new ResolverFactory({ mainFields }); - assert.match( - resolver.sync(fixtureDir, "../..").path, - /\/lib\/index\.js$/ - ); - }; - it("should use `'main'` as default", createTest(undefined)); - it("should allow field string", createTest("main")); - it("should allow field array", createTest(["main"])); - }); -}); diff --git a/npm/package.json b/npm/package.json index 6fa93185..b47e6b07 100644 --- a/npm/package.json +++ b/npm/package.json @@ -1,41 +1,30 @@ { - "name": "oxc-resolver", - "version": "1.8.1", - "description": "Oxc Resolver Node API", - "main": "index.js", - "browser": "browser.js", - "files": [ - "index.d.ts", - "index.js", - "browser.js" - ], - "license": "MIT", - "homepage": "https://oxc-project.github.io", - "repository": { - "type": "git", - "url": "git+https://github.com/oxc-project/oxc-resolver.git" - }, - "publishConfig": { - "registry": "https://registry.npmjs.org/", - "access": "public" - }, - "napi": { - "binaryName": "resolver", - "packageName": "@oxc-resolver/binding", - "targets": [ - "x86_64-pc-windows-msvc", - "aarch64-pc-windows-msvc", - "x86_64-unknown-linux-gnu", - "x86_64-unknown-linux-musl", - "aarch64-unknown-linux-gnu", - "aarch64-unknown-linux-musl", - "armv7-unknown-linux-gnueabihf", - "x86_64-apple-darwin", - "aarch64-apple-darwin", - "wasm32-wasip1-threads" - ] - }, - "funding": { - "url": "https://github.com/sponsors/Boshen" - } + "name": "oxc-resolver", + "description": "Oxc Resolver Node API", + "funding": { + "url": "https://github.com/sponsors/Boshen" + }, + "main": "index.js", + "browser": "browser.js", + "files": [ + "index.d.ts", + "index.js", + "browser.js" + ], + "napi": { + "binaryName": "resolver", + "packageName": "@oxc-resolver/binding", + "targets": [ + "x86_64-pc-windows-msvc", + "aarch64-pc-windows-msvc", + "x86_64-unknown-linux-gnu", + "x86_64-unknown-linux-musl", + "aarch64-unknown-linux-gnu", + "aarch64-unknown-linux-musl", + "armv7-unknown-linux-gnueabihf", + "x86_64-apple-darwin", + "aarch64-apple-darwin", + "wasm32-wasip1-threads" + ] + } } diff --git a/package.json b/package.json index 47300b76..a431e48f 100644 --- a/package.json +++ b/package.json @@ -1,33 +1,24 @@ { - "name": "@oxc-resolver/binding", - "private": true, - "version": "0.0.0", - "scripts": { - "build": "napi build --platform --release --package-json-path npm/package.json --manifest-path napi/Cargo.toml", - "build:debug": "napi build --platform --package-json-path npm/package.json --manifest-path napi/Cargo.toml", - "prepublishOnly": "napi pre-publish -t npm", - "test": "ava" - }, - "devDependencies": { - "@napi-rs/cli": "^3.0.0-alpha.43", - "@napi-rs/wasm-runtime": "^0.2.0", - "@types/node": "^20.10.4", - "ava": "^6.0.1", - "emnapi": "^1.0.0", - "typescript": "^5.3.3" - }, - "ava": { - "files": [ - "napi/__test__/*.spec.mjs" - ], - "cache": false - }, - "packageManager": "pnpm@9.3.0", - "repository": { - "type": "git", - "url": "git+https://github.com/oxc-project/oxc-resolver.git" - }, - "funding": { - "url": "https://github.com/sponsors/Boshen" - } + "name": "@oxc-resolver/binding", + "funding": { + "url": "https://github.com/sponsors/Boshen" + }, + "scripts": { + "build": "napi build --platform --release --package-json-path npm/package.json --manifest-path napi/Cargo.toml", + "build:debug": "napi build --platform --package-json-path npm/package.json --manifest-path napi/Cargo.toml", + "prepublishOnly": "napi pre-publish -t npm" + }, + "ava": { + "cache": false, + "files": [ + "napi/__test__/*.spec.mjs" + ] + }, + "devDependencies": { + "@napi-rs/cli": "^3.0.0-alpha.43", + "@napi-rs/wasm-runtime": "^0.2.0", + "@types/node": "^20.10.4", + "ava": "^6.0.1", + "emnapi": "^1.0.0" + } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml deleted file mode 100644 index 1e8670db..00000000 --- a/pnpm-lock.yaml +++ /dev/null @@ -1,2690 +0,0 @@ -lockfileVersion: '9.0' - -settings: - autoInstallPeers: true - excludeLinksFromLockfile: false - -importers: - - .: - devDependencies: - '@napi-rs/cli': - specifier: ^3.0.0-alpha.43 - version: 3.0.0-alpha.55(@emnapi/runtime@1.2.0)(emnapi@1.2.0) - '@napi-rs/wasm-runtime': - specifier: ^0.2.0 - version: 0.2.4 - '@types/node': - specifier: ^20.10.4 - version: 20.14.2 - ava: - specifier: ^6.0.1 - version: 6.1.3 - emnapi: - specifier: ^1.0.0 - version: 1.2.0 - typescript: - specifier: ^5.3.3 - version: 5.4.5 - - fixtures/pnpm: - devDependencies: - axios: - specifier: 1.6.2 - version: 1.6.2 - postcss: - specifier: 8.4.33 - version: 8.4.33 - styled-components: - specifier: 6.1.1 - version: 6.1.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - - npm: {} - -packages: - - '@emnapi/core@1.2.0': - resolution: {integrity: sha512-E7Vgw78I93we4ZWdYCb4DGAwRROGkMIXk7/y87UmANR+J6qsWusmC3gLt0H+O0KOt5e6O38U8oJamgbudrES/w==} - - '@emnapi/runtime@1.2.0': - resolution: {integrity: sha512-bV21/9LQmcQeCPEg3BDFtvwL6cwiTMksYNWQQ4KOxCZikEGalWtenoZ0wCiukJINlGCIi2KXx01g4FoH/LxpzQ==} - - '@emnapi/wasi-threads@1.0.1': - resolution: {integrity: sha512-iIBu7mwkq4UQGeMEM8bLwNK962nXdhodeScX4slfQnRhEMMzvYivHhutCIk8uojvmASXXPC2WNEjwxFWk72Oqw==} - - '@emotion/is-prop-valid@1.2.2': - resolution: {integrity: sha512-uNsoYd37AFmaCdXlg6EYD1KaPOaRWRByMCYzbKUX4+hhMfrxdVSelShywL4JVaAeM/eHUOSprYBQls+/neX3pw==} - - '@emotion/memoize@0.8.1': - resolution: {integrity: sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA==} - - '@emotion/unitless@0.8.1': - resolution: {integrity: sha512-KOEGMu6dmJZtpadb476IsZBclKvILjopjUii3V+7MnXIQCYh8W3NgNcgwo21n9LXZX6EDIKvqfjYxXebDwxKmQ==} - - '@inquirer/figures@1.0.3': - resolution: {integrity: sha512-ErXXzENMH5pJt5/ssXV0DfWUZqly8nGzf0UcBV9xTnP+KyffE2mqyxIMBrZ8ijQck2nU0TQm40EQB53YreyWHw==} - engines: {node: '>=18'} - - '@ljharb/through@2.3.13': - resolution: {integrity: sha512-/gKJun8NNiWGZJkGzI/Ragc53cOdcLNdzjLaIa+GEjguQs0ulsurx8WN0jijdK9yPqDvziX995sMRLyLt1uZMQ==} - engines: {node: '>= 0.4'} - - '@mapbox/node-pre-gyp@1.0.11': - resolution: {integrity: sha512-Yhlar6v9WQgUp/He7BdgzOz8lqMQ8sU+jkCq7Wx8Myc5YFJLbEe7lgui/V7G1qB1DJykHSGwreceSaD60Y0PUQ==} - hasBin: true - - '@napi-rs/cli@3.0.0-alpha.55': - resolution: {integrity: sha512-6XgBBTX8O28W5gcSzqYkI72UVJV6Y2YcyQNrEqak39JavJRLlXCv09uLF97raynXAOO50KeP6DEXFy5P8MR2sw==} - engines: {node: '>= 16'} - hasBin: true - peerDependencies: - '@emnapi/runtime': ^1.1.0 - emnapi: ^1.1.0 - peerDependenciesMeta: - '@emnapi/runtime': - optional: true - emnapi: - optional: true - - '@napi-rs/cross-toolchain@0.0.16': - resolution: {integrity: sha512-jwdjHT5L0m9MH0CmzDwPp0ckn/UO7afHCsPeo7NugHUvYgvlgS7SWhdMVgIgJW2HHqhcW/2nhaLLGpAU1c7QRQ==} - peerDependencies: - '@napi-rs/cross-toolchain-arm64-target-aarch64': ^0.0.16 - '@napi-rs/cross-toolchain-arm64-target-armv7': ^0.0.16 - '@napi-rs/cross-toolchain-arm64-target-x86_64': ^0.0.16 - '@napi-rs/cross-toolchain-x64-target-aarch64': ^0.0.16 - '@napi-rs/cross-toolchain-x64-target-armv7': ^0.0.16 - '@napi-rs/cross-toolchain-x64-target-x86_64': ^0.0.16 - peerDependenciesMeta: - '@napi-rs/cross-toolchain-arm64-target-aarch64': - optional: true - '@napi-rs/cross-toolchain-arm64-target-armv7': - optional: true - '@napi-rs/cross-toolchain-arm64-target-x86_64': - optional: true - '@napi-rs/cross-toolchain-x64-target-aarch64': - optional: true - '@napi-rs/cross-toolchain-x64-target-armv7': - optional: true - '@napi-rs/cross-toolchain-x64-target-x86_64': - optional: true - - '@napi-rs/lzma-android-arm-eabi@1.3.1': - resolution: {integrity: sha512-mtGOg8jXlc+pTBI86cqohfndS9UmOAkk9d5CChKMb8btVks70yhUN1e7YYS3QFbmoxbPs2Ee+wmuH1Khdc7B2w==} - engines: {node: '>= 10'} - cpu: [arm] - os: [android] - - '@napi-rs/lzma-android-arm64@1.3.1': - resolution: {integrity: sha512-4uGkQgAv9Tnc/i0k2eIgbhZgyzs94+iECWxz4MFZNcZ1fNGvGbRL2j+SITE4OmwrUn3TuFK/uYWfgzooq8E1Qg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [android] - - '@napi-rs/lzma-darwin-arm64@1.3.1': - resolution: {integrity: sha512-MZBg4iwHTS8icjTiCMdzh8kYrMmKBCEglFPa+vjI91R2XDwuuwSzqmpATRpmMH8cWUUWtGPF4fnxKzjgkzhd4Q==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [darwin] - - '@napi-rs/lzma-darwin-x64@1.3.1': - resolution: {integrity: sha512-7vte+1lYV7xgZERKH/pjAeh4T16aQASKOzu4op70pK6VP/64Plr5rrvqxQqQmlAIe4pwyo/RkFl1n4LXDod3xg==} - engines: {node: '>= 10'} - cpu: [x64] - os: [darwin] - - '@napi-rs/lzma-freebsd-x64@1.3.1': - resolution: {integrity: sha512-uBS74fynTqLUC3catIxyezCafn8UDlr2yxVV47vz1T6Vop2PGDz/cMQdV6rnLSjPE08Rv66ihM36mgf/MmOkOg==} - engines: {node: '>= 10'} - cpu: [x64] - os: [freebsd] - - '@napi-rs/lzma-linux-arm-gnueabihf@1.3.1': - resolution: {integrity: sha512-rrVLyqBJeN29gPJCNkPbZ7dAzaseEcERKyhjwM+DfbFrDUvtkEcrYPvo+iwE/NmF+OkZQkzcanrVMGnq/mcJYQ==} - engines: {node: '>= 10'} - cpu: [arm] - os: [linux] - - '@napi-rs/lzma-linux-arm64-gnu@1.3.1': - resolution: {integrity: sha512-vDmVsthRbX2opkgRirJJGKQxUP/spvyVM2Y5CyCWZ7sadSID3hA97r38gf9ISn/sJ8/r93IPWLq+iycudNKi+Q==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/lzma-linux-arm64-musl@1.3.1': - resolution: {integrity: sha512-x4m/J3hRdFd3IoqKc+4aBcSUkcuDEP7hH6vdss8bKNLjPfXmnG/lcHJEQX3hNnNOULPP8xVRxgiY8jeL62cnsw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/lzma-linux-x64-gnu@1.3.1': - resolution: {integrity: sha512-riB+Xg72NfH8Kcpq07omshVu0QsLW0v2bhywBNYxvA+t2dGGWSIEN1U/zazUXys+IEA6pBQKqLVseurWE6Cl8g==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/lzma-linux-x64-musl@1.3.1': - resolution: {integrity: sha512-JXLgJFwoeysxdSg7rdVYP8wrliCQVJlU5JcLYjRVSCL4P0mQTjnYi7R7VdaOkDACw/Fvlji7oIJXt0KiaDTcOw==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/lzma-wasm32-wasi@1.3.1': - resolution: {integrity: sha512-XTA9XTUtj0KPKuzNS2oi3bWN6tJodk00wwMd/TiKoEqx9Fe/zu+OfDGuXAn+xs+P7S3YCDHqjYinuTQMZ0ucJw==} - engines: {node: '>=14.0.0'} - cpu: [wasm32] - - '@napi-rs/lzma-win32-arm64-msvc@1.3.1': - resolution: {integrity: sha512-qLDfs9UEtLPPTN/FdSz3gSdlx86VwFQBuLBrQtaiYQtUTKZCOYV1Z1fXqFt5Zqa1HKV2oyXnwGcTI7RpcyXxtg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [win32] - - '@napi-rs/lzma-win32-ia32-msvc@1.3.1': - resolution: {integrity: sha512-rWNlxLFMIfvxzfdQCfeQ3D/HEnQG3vfladFYrXUx6ePXO6r+BLCGn6/LWSSuKlw4vKkb1iHEWsAVaRLIcJEMIA==} - engines: {node: '>= 10'} - cpu: [ia32] - os: [win32] - - '@napi-rs/lzma-win32-x64-msvc@1.3.1': - resolution: {integrity: sha512-SNfHNqEjabXfTL1+KRi0qiAhwIlZHhQystvfSYX6p1g+2trSC/3WUpUQ4fbbR7KyE31g2AAnwjXivnlQ0af/pg==} - engines: {node: '>= 10'} - cpu: [x64] - os: [win32] - - '@napi-rs/lzma@1.3.1': - resolution: {integrity: sha512-XyZoBlYNMvCulK/RmVK/0nB3j7IdH7HpqcrMMg0U+HqQqKRLOQBwvnKNBocPC1bZQ7iZuKWYTLn1ayZwTyek8w==} - engines: {node: '>= 10'} - - '@napi-rs/tar-android-arm-eabi@0.1.1': - resolution: {integrity: sha512-Ufa0ahZvE5KGrC2WBux5svCe/jvC+e8IgtleiicwqnfgTfbDknYyq/QuqkP1AnMp/IvTmx2iutCZt6OFIG0zAg==} - engines: {node: '>= 10'} - cpu: [arm] - os: [android] - - '@napi-rs/tar-android-arm64@0.1.1': - resolution: {integrity: sha512-KUu5fHIiIObSuZ/crHxUrQ243+LiCRKPwdCVLHwjtftqFjzls+R2Mp6GrpM41XxexDMN00SUta3kazi93Xr19A==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [android] - - '@napi-rs/tar-darwin-arm64@0.1.1': - resolution: {integrity: sha512-jaqgdX20iIga+2gzotQ78eF00Cm8vECocUYeMY62WqyzJNv/jx1dlOfELWEccOjpmawFT9tjWebsS9F1QMvSUg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [darwin] - - '@napi-rs/tar-darwin-x64@0.1.1': - resolution: {integrity: sha512-80sa32IxfRso9x9sGTFpfLSx3BnruyJODpSkUzalOCz9i14n5gOKA8KR/JrnSWwDz0p5l5P9kfQD3pu8Voj7WA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [darwin] - - '@napi-rs/tar-freebsd-x64@0.1.1': - resolution: {integrity: sha512-P7V1zBjjC1dCrTwtUzuzYM4AeZduigeCtd8qQw2IUZowM5AsmhMd77oYuXjdU29cEpKUpyYjJRxjPCzFy+WbAQ==} - engines: {node: '>= 10'} - cpu: [x64] - os: [freebsd] - - '@napi-rs/tar-linux-arm-gnueabihf@0.1.1': - resolution: {integrity: sha512-qpC71ILPkWKt8k1iJCYt5gjwcOkd2VFSQIelTRr12t5CVNKV04rE/TMdwFoCP7kxbtb9Fl2cZzCRISw2BhMCmQ==} - engines: {node: '>= 10'} - cpu: [arm] - os: [linux] - - '@napi-rs/tar-linux-arm64-gnu@0.1.1': - resolution: {integrity: sha512-71QgxcFJCog6O4Tauoge8D0ILkDGJTRk3ru7zG8PUFG1QXJ1kkiRikdT77YmoVxtomc9FUOt+bdEdU5Yn+3QUQ==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/tar-linux-arm64-musl@0.1.1': - resolution: {integrity: sha512-R2e7YEILPKc447N1hUt1zQuyy0st83HX6nhmtFywS1aOj76/3hzxLVrebGiiS6kifyCrO82o66CNTYe7DixMZw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/tar-linux-x64-gnu@0.1.1': - resolution: {integrity: sha512-tmy9q2LXUB2GQ+IgUzJn3+us52leplMu96ORyFq1iHQEelGSqXt4xi5DzU07JhX3obJPqVqkybtcRS4enBfmBA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/tar-linux-x64-musl@0.1.1': - resolution: {integrity: sha512-j5ePbe6vihApl0cGPPDUVTWZbf2mF4NhxngAoG2jp7AeX3cWP2O4pjsvaOraW6QfvWEMFPeER7S0b6eBS7duvA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/tar-wasm32-wasi@0.1.1': - resolution: {integrity: sha512-se0+DlOiIRt7mcz7BeOJDoZtCrROpKLwiAOGmNgrjQ/SZS7TnOPuwm3wy9XN9WLoepttEjCEem6UP8yD5GJuQg==} - engines: {node: '>=14.0.0'} - cpu: [wasm32] - - '@napi-rs/tar-win32-arm64-msvc@0.1.1': - resolution: {integrity: sha512-FDZPi2wC7RwzvodogigLh/pJvhqCTVTUqOYuHlLkPSUbSAGiEkI55wk9RqH3y3EdJQaDuzyqC0QKz5ket2U+GA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [win32] - - '@napi-rs/tar-win32-ia32-msvc@0.1.1': - resolution: {integrity: sha512-OPR9Tou5z5M912G7Kc7gkf1ltinbOQx5dS/OeDIWHvPGOfdFDIxt0YVKhzSLRJi43+zIDp8/+cbeMD/cKXfX8w==} - engines: {node: '>= 10'} - cpu: [ia32] - os: [win32] - - '@napi-rs/tar-win32-x64-msvc@0.1.1': - resolution: {integrity: sha512-hiv5KfhrMSg8tTRC2oQXVckVg1h6ZVjwbd5aF9Esl0V3p2TaNFwwbqgnAN4Gm/PmSnHWNL/IRTHkk3cOzDWihQ==} - engines: {node: '>= 10'} - cpu: [x64] - os: [win32] - - '@napi-rs/tar@0.1.1': - resolution: {integrity: sha512-FOMhwwlvoYjHaDBxP26K3D92ltw1Y/CC4CIjgC6qXdzW4MYNwTlEyI58smCM3k+nCVJH3kpOYyH3sgbK4WZA4A==} - engines: {node: '>= 10'} - - '@napi-rs/wasm-runtime@0.2.4': - resolution: {integrity: sha512-9zESzOO5aDByvhIAsOy9TbpZ0Ur2AJbUI7UT73kcUTS2mxAMHOBaa1st/jAymNoCtvrit99kkzT1FZuXVcgfIQ==} - - '@napi-rs/wasm-tools-android-arm-eabi@0.0.2': - resolution: {integrity: sha512-/b+UU3suXjW4P0DzHRNdrnebQtFKcQf/YMeZJH+xUlKgvwli5kbmWjx8Wqqz0VETVkUTuPqJMBDIVLyc+14FGw==} - engines: {node: '>= 10'} - cpu: [arm] - os: [android] - - '@napi-rs/wasm-tools-android-arm64@0.0.2': - resolution: {integrity: sha512-j57GbDflwJdZtT8pZj5fOV4JAP+LdKN+wzsUYs+QRUoBqpWbbUANudolqfw63bkS9sD4z7fbCuz8iwtJqzxTVA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [android] - - '@napi-rs/wasm-tools-darwin-arm64@0.0.2': - resolution: {integrity: sha512-P2ChgWgVuv9GwmbxN89R84KzIImoTqXINteEixUvmkdnhyFiR+I8deNs89Yed+5w8QLC6MEfrtRqLP9YI+NoQA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [darwin] - - '@napi-rs/wasm-tools-darwin-x64@0.0.2': - resolution: {integrity: sha512-T/kQQ0gt8+wau1Z821PKVAD76QhmwVoLs2CT7Z9tTBs2pJvwSCP0C/kQiQAHcJIMi7A2E9Ab/Mez0BERy50EFA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [darwin] - - '@napi-rs/wasm-tools-freebsd-x64@0.0.2': - resolution: {integrity: sha512-GnnHu+r5sfzuxC/1J5UMF/h3BOZnHb3NQZ5hmbCfZYCKzpzRxrAJhzRunlbRN+v0x8M/49dztVTYR3s7K4ooAw==} - engines: {node: '>= 10'} - cpu: [x64] - os: [freebsd] - - '@napi-rs/wasm-tools-linux-arm64-gnu@0.0.2': - resolution: {integrity: sha512-KnZdLT0OnKb1CG2kdt3/WvM43vr9i+FEwXCvSOVC/6Tsifz7ynhMg7LAVESILd03HubzQJfg9nbRsk0bQ+IOwg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/wasm-tools-linux-arm64-musl@0.0.2': - resolution: {integrity: sha512-HkpZOID2U8P6pWqK3mqZ8bxU5xcuT3iA2fO+jrxn78h006iYgfNmdc5JaVhHnHazMmk32xKhSV4iV0VUh8UWDg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/wasm-tools-linux-x64-gnu@0.0.2': - resolution: {integrity: sha512-YksJWBCyOalB9ogtP9+/dZKP+vR6+h7BmzMXaXMT71WW/GvIsifMVgv+DY/FRSNJQupp5Y+ugjqVAOUOc/G65g==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/wasm-tools-linux-x64-musl@0.0.2': - resolution: {integrity: sha512-sPtRxPMdw05KdTcxgSPMmSXG2+PiK3vJ/l2+g9hvjnnKtvslJN2Hr7j8zgzuoKRAUFPaJVe6+D2xVh5cpdqhww==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/wasm-tools-wasm32-wasi@0.0.2': - resolution: {integrity: sha512-muRvZK7AIuo88G2AxYx3gA59rHMQgoN004saQkBvXnz3K/DVHKfTZ6TtUebss8zI3dURU6xExL8drxFWYxjEbQ==} - engines: {node: '>=14.0.0'} - cpu: [wasm32] - - '@napi-rs/wasm-tools-win32-arm64-msvc@0.0.2': - resolution: {integrity: sha512-Cn13WQ+tpFqdVwx0DIWKbsI9auFyzVZV4F5UNOUeDt6GgOL+NndgJul0Pc9bSU6fi03AylMPfF/nTCaDWO2Wgw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [win32] - - '@napi-rs/wasm-tools-win32-ia32-msvc@0.0.2': - resolution: {integrity: sha512-xsg5DkIQi82a8rcx6246Y3XC8TIqHamY+/C6sIlPLaZEuHctDkMECAw0AANwRf5vN//D2oo2oljOuoYtB1GOKw==} - engines: {node: '>= 10'} - cpu: [ia32] - os: [win32] - - '@napi-rs/wasm-tools-win32-x64-msvc@0.0.2': - resolution: {integrity: sha512-yHigltEt33eq8bappvKsIliz4MxfMPn1M+NWbIFRWN+IS1Z57mhmc1osuk+IRXrSlq0Tom0R6MYN1jpkZKz81Q==} - engines: {node: '>= 10'} - cpu: [x64] - os: [win32] - - '@napi-rs/wasm-tools@0.0.2': - resolution: {integrity: sha512-kBvDQCP5BLw2TxTENXLp3Of7vVEx0uyIye824JHE4dduzzOHVgSoOFVhVqAT3Fx/hLV445RVWfEqQbXMg4w/Mw==} - engines: {node: '>= 10'} - - '@nodelib/fs.scandir@2.1.5': - resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} - engines: {node: '>= 8'} - - '@nodelib/fs.stat@2.0.5': - resolution: {integrity: sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==} - engines: {node: '>= 8'} - - '@nodelib/fs.walk@1.2.8': - resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} - engines: {node: '>= 8'} - - '@octokit/auth-token@4.0.0': - resolution: {integrity: sha512-tY/msAuJo6ARbK6SPIxZrPBms3xPbfwBrulZe0Wtr/DIY9lje2HeV1uoebShn6mx7SjCHif6EjMvoREj+gZ+SA==} - engines: {node: '>= 18'} - - '@octokit/core@5.2.0': - resolution: {integrity: sha512-1LFfa/qnMQvEOAdzlQymH0ulepxbxnCYAKJZfMci/5XJyIHWgEYnDmgnKakbTh7CH2tFQ5O60oYDvns4i9RAIg==} - engines: {node: '>= 18'} - - '@octokit/endpoint@9.0.5': - resolution: {integrity: sha512-ekqR4/+PCLkEBF6qgj8WqJfvDq65RH85OAgrtnVp1mSxaXF03u2xW/hUdweGS5654IlC0wkNYC18Z50tSYTAFw==} - engines: {node: '>= 18'} - - '@octokit/graphql@7.1.0': - resolution: {integrity: sha512-r+oZUH7aMFui1ypZnAvZmn0KSqAUgE1/tUXIWaqUCa1758ts/Jio84GZuzsvUkme98kv0WFY8//n0J1Z+vsIsQ==} - engines: {node: '>= 18'} - - '@octokit/openapi-types@22.2.0': - resolution: {integrity: sha512-QBhVjcUa9W7Wwhm6DBFu6ZZ+1/t/oYxqc2tp81Pi41YNuJinbFRx8B133qVOrAaBbF7D/m0Et6f9/pZt9Rc+tg==} - - '@octokit/plugin-paginate-rest@11.3.1': - resolution: {integrity: sha512-ryqobs26cLtM1kQxqeZui4v8FeznirUsksiA+RYemMPJ7Micju0WSkv50dBksTuZks9O5cg4wp+t8fZ/cLY56g==} - engines: {node: '>= 18'} - peerDependencies: - '@octokit/core': '5' - - '@octokit/plugin-request-log@4.0.1': - resolution: {integrity: sha512-GihNqNpGHorUrO7Qa9JbAl0dbLnqJVrV8OXe2Zm5/Y4wFkZQDfTreBzVmiRfJVfE4mClXdihHnbpyyO9FSX4HA==} - engines: {node: '>= 18'} - peerDependencies: - '@octokit/core': '5' - - '@octokit/plugin-rest-endpoint-methods@13.2.2': - resolution: {integrity: sha512-EI7kXWidkt3Xlok5uN43suK99VWqc8OaIMktY9d9+RNKl69juoTyxmLoWPIZgJYzi41qj/9zU7G/ljnNOJ5AFA==} - engines: {node: '>= 18'} - peerDependencies: - '@octokit/core': ^5 - - '@octokit/request-error@5.1.0': - resolution: {integrity: sha512-GETXfE05J0+7H2STzekpKObFe765O5dlAKUTLNGeH+x47z7JjXHfsHKo5z21D/o/IOZTUEI6nyWyR+bZVP/n5Q==} - engines: {node: '>= 18'} - - '@octokit/request@8.4.0': - resolution: {integrity: sha512-9Bb014e+m2TgBeEJGEbdplMVWwPmL1FPtggHQRkV+WVsMggPtEkLKPlcVYm/o8xKLkpJ7B+6N8WfQMtDLX2Dpw==} - engines: {node: '>= 18'} - - '@octokit/rest@20.1.1': - resolution: {integrity: sha512-MB4AYDsM5jhIHro/dq4ix1iWTLGToIGk6cWF5L6vanFaMble5jTX/UBQyiv05HsWnwUtY8JrfHy2LWfKwihqMw==} - engines: {node: '>= 18'} - - '@octokit/types@13.5.0': - resolution: {integrity: sha512-HdqWTf5Z3qwDVlzCrP8UJquMwunpDiMPt5er+QjGzL4hqr/vBVY/MauQgS1xWxCDT1oMx1EULyqxncdCY/NVSQ==} - - '@rollup/pluginutils@4.2.1': - resolution: {integrity: sha512-iKnFXr7NkdZAIHiIWE+BX5ULi/ucVFYWD6TbAV+rZctiRTY2PL6tsIKhoIOaoskiWAkgu+VsbXgUVDNLHf+InQ==} - engines: {node: '>= 8.0.0'} - - '@sindresorhus/merge-streams@2.3.0': - resolution: {integrity: sha512-LtoMMhxAlorcGhmFYI+LhPgbPZCkgP6ra1YL604EeF6U98pLlQ3iWIGMdWSC+vWmPBWBNgmDBAhnAobLROJmwg==} - engines: {node: '>=18'} - - '@tybys/wasm-util@0.9.0': - resolution: {integrity: sha512-6+7nlbMVX/PVDCwaIQ8nTOPveOcFLSt8GcXdx8hD0bt39uWxYT88uXzqTd4fTvqta7oeUJqudepapKNt2DYJFw==} - - '@types/node@20.14.2': - resolution: {integrity: sha512-xyu6WAMVwv6AKFLB+e/7ySZVr/0zLCzOa7rSpq6jNwpqOrUbcACDWC+53d4n2QHOnDou0fbIsg8wZu/sxrnI4Q==} - - '@types/stylis@4.2.6': - resolution: {integrity: sha512-4nebF2ZJGzQk0ka0O6+FZUWceyFv4vWq/0dXBMmrSeAwzOuOd/GxE5Pa64d/ndeNLG73dXoBsRzvtsVsYUv6Uw==} - - '@vercel/nft@0.26.5': - resolution: {integrity: sha512-NHxohEqad6Ra/r4lGknO52uc/GrWILXAMs1BB4401GTqww0fw1bAqzpG1XHuDO+dprg4GvsD9ZLLSsdo78p9hQ==} - engines: {node: '>=16'} - hasBin: true - - abbrev@1.1.1: - resolution: {integrity: sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==} - - acorn-import-attributes@1.9.5: - resolution: {integrity: sha512-n02Vykv5uA3eHGM/Z2dQrcD56kL8TyDb2p1+0P83PClMnC/nc+anbQRhIOWnSq4Ke/KvDPrY3C9hDtC/A3eHnQ==} - peerDependencies: - acorn: ^8 - - acorn-walk@8.3.3: - resolution: {integrity: sha512-MxXdReSRhGO7VlFe1bRG/oI7/mdLV9B9JJT0N8vZOhF7gFRR5l3M8W9G8JxmKV+JC5mGqJ0QvqfSOLsCPa4nUw==} - engines: {node: '>=0.4.0'} - - acorn@8.12.0: - resolution: {integrity: sha512-RTvkC4w+KNXrM39/lWCUaG0IbRkWdCv7W/IOW9oU6SawyxulvkQy5HQPVTKxEjczcUvapcrw3cFx/60VN/NRNw==} - engines: {node: '>=0.4.0'} - hasBin: true - - agent-base@6.0.2: - resolution: {integrity: sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==} - engines: {node: '>= 6.0.0'} - - ansi-escapes@4.3.2: - resolution: {integrity: sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==} - engines: {node: '>=8'} - - ansi-regex@5.0.1: - resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} - engines: {node: '>=8'} - - ansi-regex@6.0.1: - resolution: {integrity: sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==} - engines: {node: '>=12'} - - ansi-styles@4.3.0: - resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} - engines: {node: '>=8'} - - ansi-styles@6.2.1: - resolution: {integrity: sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==} - engines: {node: '>=12'} - - aproba@2.0.0: - resolution: {integrity: sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==} - - are-we-there-yet@2.0.0: - resolution: {integrity: sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw==} - engines: {node: '>=10'} - deprecated: This package is no longer supported. - - argparse@1.0.10: - resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==} - - argparse@2.0.1: - resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} - - array-find-index@1.0.2: - resolution: {integrity: sha512-M1HQyIXcBGtVywBt8WVdim+lrNaK7VHp99Qt5pSNziXznKHViIBbXWtfRTpEFpF/c4FdfxNAsCCwPp5phBYJtw==} - engines: {node: '>=0.10.0'} - - arrgv@1.0.2: - resolution: {integrity: sha512-a4eg4yhp7mmruZDQFqVMlxNRFGi/i1r87pt8SDHy0/I8PqSXoUTlWZRdAZo0VXgvEARcujbtTk8kiZRi1uDGRw==} - engines: {node: '>=8.0.0'} - - arrify@3.0.0: - resolution: {integrity: sha512-tLkvA81vQG/XqE2mjDkGQHoOINtMHtysSnemrmoGe6PydDPMRbVugqyk4A6V/WDWEfm3l+0d8anA9r8cv/5Jaw==} - engines: {node: '>=12'} - - async-sema@3.1.1: - resolution: {integrity: sha512-tLRNUXati5MFePdAk8dw7Qt7DpxPB60ofAgn8WRhW6a2rcimZnYBP9oxHiv0OHy+Wz7kPMG+t4LGdt31+4EmGg==} - - asynckit@0.4.0: - resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} - - ava@6.1.3: - resolution: {integrity: sha512-tkKbpF1pIiC+q09wNU9OfyTDYZa8yuWvU2up3+lFJ3lr1RmnYh2GBpPwzYUEB0wvTPIUysGjcZLNZr7STDviRA==} - engines: {node: ^18.18 || ^20.8 || ^21 || ^22} - hasBin: true - peerDependencies: - '@ava/typescript': '*' - peerDependenciesMeta: - '@ava/typescript': - optional: true - - axios@1.6.2: - resolution: {integrity: sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A==} - - balanced-match@1.0.2: - resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} - - base64-js@1.5.1: - resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==} - - before-after-hook@2.2.3: - resolution: {integrity: sha512-NzUnlZexiaH/46WDhANlyR2bXRopNg4F/zuSA3OpZnllCUgRaOF2znDioDWrmbNVsuZk6l9pMquQB38cfBZwkQ==} - - bindings@1.5.0: - resolution: {integrity: sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==} - - bl@4.1.0: - resolution: {integrity: sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==} - - blueimp-md5@2.19.0: - resolution: {integrity: sha512-DRQrD6gJyy8FbiE4s+bDoXS9hiW3Vbx5uCdwvcCf3zLHL+Iv7LtGHLpr+GZV8rHG8tK766FGYBwRbu8pELTt+w==} - - brace-expansion@1.1.11: - resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} - - braces@3.0.3: - resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==} - engines: {node: '>=8'} - - buffer@5.7.1: - resolution: {integrity: sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==} - - call-bind@1.0.7: - resolution: {integrity: sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==} - engines: {node: '>= 0.4'} - - callsites@4.1.0: - resolution: {integrity: sha512-aBMbD1Xxay75ViYezwT40aQONfr+pSXTHwNKvIXhXD6+LY3F1dLIcceoC5OZKBVHbXcysz1hL9D2w0JJIMXpUw==} - engines: {node: '>=12.20'} - - camelize@1.0.1: - resolution: {integrity: sha512-dU+Tx2fsypxTgtLoE36npi3UqcjSSMNYfkqgmoEhtZrraP5VWq0K7FkWVTYa8eMPtnU/G2txVsfdCJTn9uzpuQ==} - - cbor@9.0.2: - resolution: {integrity: sha512-JPypkxsB10s9QOWwa6zwPzqE1Md3vqpPc+cai4sAecuCsRyAtAl/pMyhPlMbT/xtPnm2dznJZYRLui57qiRhaQ==} - engines: {node: '>=16'} - - chalk@4.1.2: - resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} - engines: {node: '>=10'} - - chalk@5.3.0: - resolution: {integrity: sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==} - engines: {node: ^12.17.0 || ^14.13 || >=16.0.0} - - chardet@0.7.0: - resolution: {integrity: sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==} - - chownr@2.0.0: - resolution: {integrity: sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==} - engines: {node: '>=10'} - - chunkd@2.0.1: - resolution: {integrity: sha512-7d58XsFmOq0j6el67Ug9mHf9ELUXsQXYJBkyxhH/k+6Ke0qXRnv0kbemx+Twc6fRJ07C49lcbdgm9FL1Ei/6SQ==} - - ci-info@4.0.0: - resolution: {integrity: sha512-TdHqgGf9odd8SXNuxtUBVx8Nv+qZOejE6qyqiy5NtbYYQOeFa6zmHkxlPzmaLxWWHsU6nJmB7AETdVPi+2NBUg==} - engines: {node: '>=8'} - - ci-parallel-vars@1.0.1: - resolution: {integrity: sha512-uvzpYrpmidaoxvIQHM+rKSrigjOe9feHYbw4uOI2gdfe1C3xIlxO+kVXq83WQWNniTf8bAxVpy+cQeFQsMERKg==} - - cli-cursor@3.1.0: - resolution: {integrity: sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==} - engines: {node: '>=8'} - - cli-spinners@2.9.2: - resolution: {integrity: sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==} - engines: {node: '>=6'} - - cli-truncate@4.0.0: - resolution: {integrity: sha512-nPdaFdQ0h/GEigbPClz11D0v/ZJEwxmeVZGeMo3Z5StPtUTkA9o1lD6QwoirYiSDzbcwn2XcjwmCp68W1IS4TA==} - engines: {node: '>=18'} - - cli-width@4.1.0: - resolution: {integrity: sha512-ouuZd4/dm2Sw5Gmqy6bGyNNNe1qt9RpmxveLSO7KcgsTnU7RXfsw+/bukWGo1abgBiMAic068rclZsO4IWmmxQ==} - engines: {node: '>= 12'} - - clipanion@3.2.1: - resolution: {integrity: sha512-dYFdjLb7y1ajfxQopN05mylEpK9ZX0sO1/RfMXdfmwjlIsPkbh4p7A682x++zFPLDCo1x3p82dtljHf5cW2LKA==} - peerDependencies: - typanion: '*' - - cliui@8.0.1: - resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==} - engines: {node: '>=12'} - - clone@1.0.4: - resolution: {integrity: sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==} - engines: {node: '>=0.8'} - - code-excerpt@4.0.0: - resolution: {integrity: sha512-xxodCmBen3iy2i0WtAK8FlFNrRzjUqjRsMfho58xT/wvZU1YTM3fCnRjcy1gJPMepaRlgm/0e6w8SpWHpn3/cA==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - color-convert@2.0.1: - resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} - engines: {node: '>=7.0.0'} - - color-name@1.1.4: - resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} - - color-support@1.1.3: - resolution: {integrity: sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==} - hasBin: true - - colorette@2.0.20: - resolution: {integrity: sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==} - - combined-stream@1.0.8: - resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} - engines: {node: '>= 0.8'} - - common-path-prefix@3.0.0: - resolution: {integrity: sha512-QE33hToZseCH3jS0qN96O/bSh3kaw/h+Tq7ngyY9eWDUnTlTNUyqfqvCXioLe5Na5jFsL78ra/wuBU4iuEgd4w==} - - concat-map@0.0.1: - resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} - - concordance@5.0.4: - resolution: {integrity: sha512-OAcsnTEYu1ARJqWVGwf4zh4JDfHZEaSNlNccFmt8YjB2l/n19/PF2viLINHc57vO4FKIAFl2FWASIGZZWZ2Kxw==} - engines: {node: '>=10.18.0 <11 || >=12.14.0 <13 || >=14'} - - console-control-strings@1.1.0: - resolution: {integrity: sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==} - - convert-to-spaces@2.0.1: - resolution: {integrity: sha512-rcQ1bsQO9799wq24uE5AM2tAILy4gXGIK/njFWcVQkGNZ96edlpY+A7bjwvzjYvLDyzmG1MmMLZhpcsb+klNMQ==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - css-color-keywords@1.0.0: - resolution: {integrity: sha512-FyyrDHZKEjXDpNJYvVsV960FiqQyXc/LlYmsxl2BcdMb2WPx0OGRVgTg55rPSyLSNMqP52R9r8geSp7apN3Ofg==} - engines: {node: '>=4'} - - css-to-react-native@3.2.0: - resolution: {integrity: sha512-e8RKaLXMOFii+02mOlqwjbD00KSEKqblnpO9e++1aXS1fPQOpS1YoqdVHBqPjHNoxeF2mimzVqawm2KCbEdtHQ==} - - csstype@3.1.3: - resolution: {integrity: sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==} - - currently-unhandled@0.4.1: - resolution: {integrity: sha512-/fITjgjGU50vjQ4FH6eUoYu+iUoUKIXws2hL15JJpIR+BbTxaXQsMuuyjtNh2WqsSBS5nsaZHFsFecyw5CCAng==} - engines: {node: '>=0.10.0'} - - date-time@3.1.0: - resolution: {integrity: sha512-uqCUKXE5q1PNBXjPqvwhwJf9SwMoAHBgWJ6DcrnS5o+W2JOiIILl0JEdVD8SGujrNS02GGxgwAg2PN2zONgtjg==} - engines: {node: '>=6'} - - debug@4.3.5: - resolution: {integrity: sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg==} - engines: {node: '>=6.0'} - peerDependencies: - supports-color: '*' - peerDependenciesMeta: - supports-color: - optional: true - - defaults@1.0.4: - resolution: {integrity: sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A==} - - define-data-property@1.1.4: - resolution: {integrity: sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==} - engines: {node: '>= 0.4'} - - delayed-stream@1.0.0: - resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} - engines: {node: '>=0.4.0'} - - delegates@1.0.0: - resolution: {integrity: sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==} - - deprecation@2.3.1: - resolution: {integrity: sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==} - - detect-libc@2.0.3: - resolution: {integrity: sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw==} - engines: {node: '>=8'} - - emittery@1.0.3: - resolution: {integrity: sha512-tJdCJitoy2lrC2ldJcqN4vkqJ00lT+tOWNT1hBJjO/3FDMJa5TTIiYGCKGkn/WfCyOzUMObeohbVTj00fhiLiA==} - engines: {node: '>=14.16'} - - emnapi@1.2.0: - resolution: {integrity: sha512-rcq+dJCcfr08I0XM/57LPRqaUokGfni/+SvhO7NaJthTTjRdohhIy0FQwyC5rR1enAsjkldQg83th8J5hURv0Q==} - peerDependencies: - node-addon-api: '>= 6.1.0' - peerDependenciesMeta: - node-addon-api: - optional: true - - emoji-regex@10.3.0: - resolution: {integrity: sha512-QpLs9D9v9kArv4lfDEgg1X/gN5XLnf/A6l9cs8SPZLRZR3ZkY9+kwIQTxm+fsSej5UMYGE8fdoaZVIBlqG0XTw==} - - emoji-regex@8.0.0: - resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} - - es-define-property@1.0.0: - resolution: {integrity: sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==} - engines: {node: '>= 0.4'} - - es-errors@1.3.0: - resolution: {integrity: sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==} - engines: {node: '>= 0.4'} - - escalade@3.1.2: - resolution: {integrity: sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==} - engines: {node: '>=6'} - - escape-string-regexp@2.0.0: - resolution: {integrity: sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==} - engines: {node: '>=8'} - - escape-string-regexp@5.0.0: - resolution: {integrity: sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==} - engines: {node: '>=12'} - - esprima@4.0.1: - resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==} - engines: {node: '>=4'} - hasBin: true - - estree-walker@2.0.2: - resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==} - - esutils@2.0.3: - resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} - engines: {node: '>=0.10.0'} - - external-editor@3.1.0: - resolution: {integrity: sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==} - engines: {node: '>=4'} - - fast-diff@1.3.0: - resolution: {integrity: sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==} - - fast-glob@3.3.2: - resolution: {integrity: sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==} - engines: {node: '>=8.6.0'} - - fastq@1.17.1: - resolution: {integrity: sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==} - - figures@6.1.0: - resolution: {integrity: sha512-d+l3qxjSesT4V7v2fh+QnmFnUWv9lSpjarhShNTgBOfA0ttejbQUAlHLitbjkoRiDulW0OPoQPYIGhIC8ohejg==} - engines: {node: '>=18'} - - file-uri-to-path@1.0.0: - resolution: {integrity: sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==} - - fill-range@7.1.1: - resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==} - engines: {node: '>=8'} - - find-up-simple@1.0.0: - resolution: {integrity: sha512-q7Us7kcjj2VMePAa02hDAF6d+MzsdsAWEwYyOpwUtlerRBkOEPBCRZrAV4XfcSN8fHAgaD0hP7miwoay6DCprw==} - engines: {node: '>=18'} - - follow-redirects@1.15.6: - resolution: {integrity: sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==} - engines: {node: '>=4.0'} - peerDependencies: - debug: '*' - peerDependenciesMeta: - debug: - optional: true - - form-data@4.0.0: - resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==} - engines: {node: '>= 6'} - - fs-minipass@2.1.0: - resolution: {integrity: sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==} - engines: {node: '>= 8'} - - fs.realpath@1.0.0: - resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} - - function-bind@1.1.2: - resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==} - - gauge@3.0.2: - resolution: {integrity: sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q==} - engines: {node: '>=10'} - deprecated: This package is no longer supported. - - get-caller-file@2.0.5: - resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} - engines: {node: 6.* || 8.* || >= 10.*} - - get-east-asian-width@1.2.0: - resolution: {integrity: sha512-2nk+7SIVb14QrgXFHcm84tD4bKQz0RxPuMT8Ag5KPOq7J5fEmAg0UbXdTOSHqNuHSU28k55qnceesxXRZGzKWA==} - engines: {node: '>=18'} - - get-intrinsic@1.2.4: - resolution: {integrity: sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==} - engines: {node: '>= 0.4'} - - glob-parent@5.1.2: - resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} - engines: {node: '>= 6'} - - glob@7.2.3: - resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} - deprecated: Glob versions prior to v9 are no longer supported - - globby@14.0.1: - resolution: {integrity: sha512-jOMLD2Z7MAhyG8aJpNOpmziMOP4rPLcc95oQPKXBazW82z+CEgPFBQvEpRUa1KeIMUJo4Wsm+q6uzO/Q/4BksQ==} - engines: {node: '>=18'} - - gopd@1.0.1: - resolution: {integrity: sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==} - - graceful-fs@4.2.11: - resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} - - has-flag@4.0.0: - resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} - engines: {node: '>=8'} - - has-property-descriptors@1.0.2: - resolution: {integrity: sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==} - - has-proto@1.0.3: - resolution: {integrity: sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==} - engines: {node: '>= 0.4'} - - has-symbols@1.0.3: - resolution: {integrity: sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==} - engines: {node: '>= 0.4'} - - has-unicode@2.0.1: - resolution: {integrity: sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==} - - hasown@2.0.2: - resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==} - engines: {node: '>= 0.4'} - - https-proxy-agent@5.0.1: - resolution: {integrity: sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==} - engines: {node: '>= 6'} - - iconv-lite@0.4.24: - resolution: {integrity: sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==} - engines: {node: '>=0.10.0'} - - ieee754@1.2.1: - resolution: {integrity: sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==} - - ignore-by-default@2.1.0: - resolution: {integrity: sha512-yiWd4GVmJp0Q6ghmM2B/V3oZGRmjrKLXvHR3TE1nfoXsmoggllfZUQe74EN0fJdPFZu2NIvNdrMMLm3OsV7Ohw==} - engines: {node: '>=10 <11 || >=12 <13 || >=14'} - - ignore@5.3.1: - resolution: {integrity: sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==} - engines: {node: '>= 4'} - - imurmurhash@0.1.4: - resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} - engines: {node: '>=0.8.19'} - - indent-string@5.0.0: - resolution: {integrity: sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==} - engines: {node: '>=12'} - - inflight@1.0.6: - resolution: {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. - - inherits@2.0.4: - resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} - - inquirer@9.2.23: - resolution: {integrity: sha512-kod5s+FBPIDM2xiy9fu+6wdU/SkK5le5GS9lh4FEBjBHqiMgD9lLFbCbuqFNAjNL2ZOy9Wd9F694IOzN9pZHBA==} - engines: {node: '>=18'} - - irregular-plurals@3.5.0: - resolution: {integrity: sha512-1ANGLZ+Nkv1ptFb2pa8oG8Lem4krflKuX/gINiHJHjJUKaJHk/SXk5x6K3J+39/p0h1RQ2saROclJJ+QLvETCQ==} - engines: {node: '>=8'} - - is-extglob@2.1.1: - resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} - engines: {node: '>=0.10.0'} - - is-fullwidth-code-point@3.0.0: - resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} - engines: {node: '>=8'} - - is-fullwidth-code-point@4.0.0: - resolution: {integrity: sha512-O4L094N2/dZ7xqVdrXhh9r1KODPJpFms8B5sGdJLPy664AgvXsreZUyCQQNItZRDlYug4xStLjNp/sz3HvBowQ==} - engines: {node: '>=12'} - - is-glob@4.0.3: - resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} - engines: {node: '>=0.10.0'} - - is-interactive@1.0.0: - resolution: {integrity: sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w==} - engines: {node: '>=8'} - - is-number@7.0.0: - resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} - engines: {node: '>=0.12.0'} - - is-plain-object@5.0.0: - resolution: {integrity: sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==} - engines: {node: '>=0.10.0'} - - is-promise@4.0.0: - resolution: {integrity: sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==} - - is-unicode-supported@0.1.0: - resolution: {integrity: sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==} - engines: {node: '>=10'} - - is-unicode-supported@2.0.0: - resolution: {integrity: sha512-FRdAyx5lusK1iHG0TWpVtk9+1i+GjrzRffhDg4ovQ7mcidMQ6mj+MhKPmvh7Xwyv5gIS06ns49CA7Sqg7lC22Q==} - engines: {node: '>=18'} - - js-string-escape@1.0.1: - resolution: {integrity: sha512-Smw4xcfIQ5LVjAOuJCvN/zIodzA/BBSsluuoSykP+lUvScIi4U6RJLfwHet5cxFnCswUjISV8oAXaqaJDY3chg==} - engines: {node: '>= 0.8'} - - js-tokens@4.0.0: - resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} - - js-yaml@3.14.1: - resolution: {integrity: sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==} - hasBin: true - - js-yaml@4.1.0: - resolution: {integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==} - hasBin: true - - load-json-file@7.0.1: - resolution: {integrity: sha512-Gnxj3ev3mB5TkVBGad0JM6dmLiQL+o0t23JPBZ9sd+yvSLk05mFoqKBw5N8gbbkU4TNXyqCgIrl/VM17OgUIgQ==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - lodash-es@4.17.21: - resolution: {integrity: sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==} - - lodash@4.17.21: - resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} - - log-symbols@4.1.0: - resolution: {integrity: sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==} - engines: {node: '>=10'} - - loose-envify@1.4.0: - resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==} - hasBin: true - - make-dir@3.1.0: - resolution: {integrity: sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==} - engines: {node: '>=8'} - - matcher@5.0.0: - resolution: {integrity: sha512-s2EMBOWtXFc8dgqvoAzKJXxNHibcdJMV0gwqKUaw9E2JBJuGUK7DrNKrA6g/i+v72TT16+6sVm5mS3thaMLQUw==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - md5-hex@3.0.1: - resolution: {integrity: sha512-BUiRtTtV39LIJwinWBjqVsU9xhdnz7/i889V859IBFpuqGAj6LuOvHv5XLbgZ2R7ptJoJaEcxkv88/h25T7Ciw==} - engines: {node: '>=8'} - - memoize@10.0.0: - resolution: {integrity: sha512-H6cBLgsi6vMWOcCpvVCdFFnl3kerEXbrYh9q+lY6VXvQSmM6CkmV08VOwT+WE2tzIEqRPFfAq3fm4v/UIW6mSA==} - engines: {node: '>=18'} - - merge2@1.4.1: - resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} - engines: {node: '>= 8'} - - micromatch@4.0.7: - resolution: {integrity: sha512-LPP/3KorzCwBxfeUuZmaR6bG2kdeHSbe0P2tY3FLRU4vYrjYz5hI4QZwV0njUx3jeuKe67YukQ1LSPZBKDqO/Q==} - engines: {node: '>=8.6'} - - mime-db@1.52.0: - resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} - engines: {node: '>= 0.6'} - - mime-types@2.1.35: - resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} - engines: {node: '>= 0.6'} - - mimic-fn@2.1.0: - resolution: {integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==} - engines: {node: '>=6'} - - mimic-function@5.0.1: - resolution: {integrity: sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==} - engines: {node: '>=18'} - - minimatch@3.1.2: - resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} - - minipass@3.3.6: - resolution: {integrity: sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==} - engines: {node: '>=8'} - - minipass@5.0.0: - resolution: {integrity: sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==} - engines: {node: '>=8'} - - minizlib@2.1.2: - resolution: {integrity: sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==} - engines: {node: '>= 8'} - - mkdirp@1.0.4: - resolution: {integrity: sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==} - engines: {node: '>=10'} - hasBin: true - - ms@2.1.2: - resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} - - ms@2.1.3: - resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} - - mute-stream@1.0.0: - resolution: {integrity: sha512-avsJQhyd+680gKXyG/sQc0nXaC6rBkPOfyHYcFb9+hdkqQkR9bdnkJ0AMZhke0oesPqIO+mFFJ+IdBc7mst4IA==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - - nanoid@3.3.7: - resolution: {integrity: sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==} - engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} - hasBin: true - - node-fetch@2.7.0: - resolution: {integrity: sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==} - engines: {node: 4.x || >=6.0.0} - peerDependencies: - encoding: ^0.1.0 - peerDependenciesMeta: - encoding: - optional: true - - node-gyp-build@4.8.1: - resolution: {integrity: sha512-OSs33Z9yWr148JZcbZd5WiAXhh/n9z8TxQcdMhIOlpN9AhWpLfvVFO73+m77bBABQMaY9XSvIa+qk0jlI7Gcaw==} - hasBin: true - - nofilter@3.1.0: - resolution: {integrity: sha512-l2NNj07e9afPnhAhvgVrCD/oy2Ai1yfLpuo3EpiO1jFTsB4sFz6oIfAfSZyQzVpkZQ9xS8ZS5g1jCBgq4Hwo0g==} - engines: {node: '>=12.19'} - - nopt@5.0.0: - resolution: {integrity: sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==} - engines: {node: '>=6'} - hasBin: true - - npmlog@5.0.1: - resolution: {integrity: sha512-AqZtDUWOMKs1G/8lwylVjrdYgqA4d9nu8hc+0gzRxlDb1I10+FHBGMXs6aiQHFdCUUlqH99MUMuLfzWDNDtfxw==} - deprecated: This package is no longer supported. - - object-assign@4.1.1: - resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} - engines: {node: '>=0.10.0'} - - once@1.4.0: - resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} - - onetime@5.1.2: - resolution: {integrity: sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==} - engines: {node: '>=6'} - - ora@5.4.1: - resolution: {integrity: sha512-5b6Y85tPxZZ7QytO+BQzysW31HJku27cRIlkbAXaNx+BdcVi+LlRFmVXzeF6a7JCwJpyw5c4b+YSVImQIrBpuQ==} - engines: {node: '>=10'} - - os-tmpdir@1.0.2: - resolution: {integrity: sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==} - engines: {node: '>=0.10.0'} - - p-map@7.0.2: - resolution: {integrity: sha512-z4cYYMMdKHzw4O5UkWJImbZynVIo0lSGTXc7bzB1e/rrDqkgGUNysK/o4bTr+0+xKvvLoTyGqYC4Fgljy9qe1Q==} - engines: {node: '>=18'} - - package-config@5.0.0: - resolution: {integrity: sha512-GYTTew2slBcYdvRHqjhwaaydVMvn/qrGC323+nKclYioNSLTDUM/lGgtGTgyHVtYcozb+XkE8CNhwcraOmZ9Mg==} - engines: {node: '>=18'} - - parse-ms@4.0.0: - resolution: {integrity: sha512-TXfryirbmq34y8QBwgqCVLi+8oA3oWx2eAnSn62ITyEhEYaWRlVZ2DvMM9eZbMs/RfxPu/PK/aBLyGj4IrqMHw==} - engines: {node: '>=18'} - - path-is-absolute@1.0.1: - resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==} - engines: {node: '>=0.10.0'} - - path-type@5.0.0: - resolution: {integrity: sha512-5HviZNaZcfqP95rwpv+1HDgUamezbqdSYTyzjTvwtJSnIH+3vnbmWsItli8OFEndS984VT55M3jduxZbX351gg==} - engines: {node: '>=12'} - - picocolors@1.0.1: - resolution: {integrity: sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==} - - picomatch@2.3.1: - resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} - engines: {node: '>=8.6'} - - picomatch@3.0.1: - resolution: {integrity: sha512-I3EurrIQMlRc9IaAZnqRR044Phh2DXY+55o7uJ0V+hYZAcQYSuFWsc9q5PvyDHUSCe1Qxn/iBz+78s86zWnGag==} - engines: {node: '>=10'} - - plur@5.1.0: - resolution: {integrity: sha512-VP/72JeXqak2KiOzjgKtQen5y3IZHn+9GOuLDafPv0eXa47xq0At93XahYBs26MsifCQ4enGKwbjBTKgb9QJXg==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - postcss-value-parser@4.2.0: - resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==} - - postcss@8.4.33: - resolution: {integrity: sha512-Kkpbhhdjw2qQs2O2DGX+8m5OVqEcbB9HRBvuYM9pgrjEFUg30A9LmXNlTAUj4S9kgtGyrMbTzVjH7E+s5Re2yg==} - engines: {node: ^10 || ^12 || >=14} - - pretty-ms@9.0.0: - resolution: {integrity: sha512-E9e9HJ9R9NasGOgPaPE8VMeiPKAyWR5jcFpNnwIejslIhWqdqOrb2wShBsncMPUb+BcCd2OPYfh7p2W6oemTng==} - engines: {node: '>=18'} - - proxy-from-env@1.1.0: - resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==} - - queue-microtask@1.2.3: - resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} - - react-dom@18.3.1: - resolution: {integrity: sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==} - peerDependencies: - react: ^18.3.1 - - react@18.3.1: - resolution: {integrity: sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==} - engines: {node: '>=0.10.0'} - - readable-stream@3.6.2: - resolution: {integrity: sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==} - engines: {node: '>= 6'} - - require-directory@2.1.1: - resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} - engines: {node: '>=0.10.0'} - - resolve-cwd@3.0.0: - resolution: {integrity: sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==} - engines: {node: '>=8'} - - resolve-from@5.0.0: - resolution: {integrity: sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==} - engines: {node: '>=8'} - - restore-cursor@3.1.0: - resolution: {integrity: sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==} - engines: {node: '>=8'} - - reusify@1.0.4: - resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==} - engines: {iojs: '>=1.0.0', node: '>=0.10.0'} - - rimraf@3.0.2: - resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==} - deprecated: Rimraf versions prior to v4 are no longer supported - hasBin: true - - run-async@3.0.0: - resolution: {integrity: sha512-540WwVDOMxA6dN6We19EcT9sc3hkXPw5mzRNGM3FkdN/vtE9NFvj5lFAPNwUDmJjXidm3v7TC1cTE7t17Ulm1Q==} - engines: {node: '>=0.12.0'} - - run-parallel@1.2.0: - resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} - - rxjs@7.8.1: - resolution: {integrity: sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==} - - safe-buffer@5.2.1: - resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} - - safer-buffer@2.1.2: - resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} - - scheduler@0.23.2: - resolution: {integrity: sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ==} - - semver@6.3.1: - resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} - hasBin: true - - semver@7.6.2: - resolution: {integrity: sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==} - engines: {node: '>=10'} - hasBin: true - - serialize-error@7.0.1: - resolution: {integrity: sha512-8I8TjW5KMOKsZQTvoxjuSIa7foAwPWGOts+6o7sgjz41/qMD9VQHEDxi6PBvK2l0MXUmqZyNpUK+T2tQaaElvw==} - engines: {node: '>=10'} - - set-blocking@2.0.0: - resolution: {integrity: sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==} - - set-function-length@1.2.2: - resolution: {integrity: sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==} - engines: {node: '>= 0.4'} - - shallowequal@1.1.0: - resolution: {integrity: sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ==} - - signal-exit@3.0.7: - resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} - - signal-exit@4.1.0: - resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} - engines: {node: '>=14'} - - slash@5.1.0: - resolution: {integrity: sha512-ZA6oR3T/pEyuqwMgAKT0/hAv8oAXckzbkmR0UkUosQ+Mc4RxGoJkRmwHgHufaenlyAgE1Mxgpdcrf75y6XcnDg==} - engines: {node: '>=14.16'} - - slice-ansi@5.0.0: - resolution: {integrity: sha512-FC+lgizVPfie0kkhqUScwRu1O/lF6NOgJmlCgK+/LYxDCTk8sGelYaHDhFcDN+Sn3Cv+3VSa4Byeo+IMCzpMgQ==} - engines: {node: '>=12'} - - source-map-js@1.2.0: - resolution: {integrity: sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==} - engines: {node: '>=0.10.0'} - - sprintf-js@1.0.3: - resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==} - - stack-utils@2.0.6: - resolution: {integrity: sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==} - engines: {node: '>=10'} - - string-width@4.2.3: - resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} - engines: {node: '>=8'} - - string-width@7.1.0: - resolution: {integrity: sha512-SEIJCWiX7Kg4c129n48aDRwLbFb2LJmXXFrWBG4NGaRtMQ3myKPKbwrD1BKqQn74oCoNMBVrfDEr5M9YxCsrkw==} - engines: {node: '>=18'} - - string_decoder@1.3.0: - resolution: {integrity: sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==} - - strip-ansi@6.0.1: - resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} - engines: {node: '>=8'} - - strip-ansi@7.1.0: - resolution: {integrity: sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==} - engines: {node: '>=12'} - - styled-components@6.1.1: - resolution: {integrity: sha512-cpZZP5RrKRIClBW5Eby4JM1wElLVP4NQrJbJ0h10TidTyJf4SIIwa3zLXOoPb4gJi8MsJ8mjq5mu2IrEhZIAcQ==} - engines: {node: '>= 16'} - peerDependencies: - react: '>= 16.8.0' - react-dom: '>= 16.8.0' - - stylis@4.3.2: - resolution: {integrity: sha512-bhtUjWd/z6ltJiQwg0dUfxEJ+W+jdqQd8TbWLWyeIJHlnsqmGLRFFd8e5mA0AZi/zx90smXRlN66YMTcaSFifg==} - - supertap@3.0.1: - resolution: {integrity: sha512-u1ZpIBCawJnO+0QePsEiOknOfCRq0yERxiAchT0i4li0WHNUJbf0evXXSXOcCAR4M8iMDoajXYmstm/qO81Isw==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - supports-color@7.2.0: - resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} - engines: {node: '>=8'} - - tar@6.2.1: - resolution: {integrity: sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==} - engines: {node: '>=10'} - - temp-dir@3.0.0: - resolution: {integrity: sha512-nHc6S/bwIilKHNRgK/3jlhDoIHcp45YgyiwcAk46Tr0LfEqGBVpmiAyuiuxeVE44m3mXnEeVhaipLOEWmH+Njw==} - engines: {node: '>=14.16'} - - time-zone@1.0.0: - resolution: {integrity: sha512-TIsDdtKo6+XrPtiTm1ssmMngN1sAhyKnTO2kunQWqNPWIVvCm15Wmw4SWInwTVgJ5u/Tr04+8Ei9TNcw4x4ONA==} - engines: {node: '>=4'} - - tmp@0.0.33: - resolution: {integrity: sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==} - engines: {node: '>=0.6.0'} - - to-regex-range@5.0.1: - resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} - engines: {node: '>=8.0'} - - toml@3.0.0: - resolution: {integrity: sha512-y/mWCZinnvxjTKYhJ+pYxwD0mRLVvOtdS2Awbgxln6iEnt4rk0yBxeSBHkGJcPucRiG0e55mwWp+g/05rsrd6w==} - - tr46@0.0.3: - resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==} - - tslib@2.6.3: - resolution: {integrity: sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ==} - - typanion@3.14.0: - resolution: {integrity: sha512-ZW/lVMRabETuYCd9O9ZvMhAh8GslSqaUjxmK/JLPCh6l73CvLBiuXswj/+7LdnWOgYsQ130FqLzFz5aGT4I3Ug==} - - type-fest@0.13.1: - resolution: {integrity: sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==} - engines: {node: '>=10'} - - type-fest@0.21.3: - resolution: {integrity: sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==} - engines: {node: '>=10'} - - typescript@5.4.5: - resolution: {integrity: sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==} - engines: {node: '>=14.17'} - hasBin: true - - undici-types@5.26.5: - resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==} - - unicorn-magic@0.1.0: - resolution: {integrity: sha512-lRfVq8fE8gz6QMBuDM6a+LO3IAzTi05H6gCVaUpir2E1Rwpo4ZUog45KpNXKC/Mn3Yb9UDuHumeFTo9iV/D9FQ==} - engines: {node: '>=18'} - - universal-user-agent@6.0.1: - resolution: {integrity: sha512-yCzhz6FN2wU1NiiQRogkTQszlQSlpWaw8SvVegAc+bDxbzHgh1vX8uIe8OYyMH6DwH+sdTJsgMl36+mSMdRJIQ==} - - util-deprecate@1.0.2: - resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} - - wasm-sjlj@1.0.5: - resolution: {integrity: sha512-Z/MHJeOkAvJJVWnGX3/YZGYldGaawZbYHX4ldYG9kLhcdB8H31F5x66M7Zc4BP/7pg0aLsusQj1629m2B3Rilg==} - - wcwidth@1.0.1: - resolution: {integrity: sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==} - - webidl-conversions@3.0.1: - resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==} - - well-known-symbols@2.0.0: - resolution: {integrity: sha512-ZMjC3ho+KXo0BfJb7JgtQ5IBuvnShdlACNkKkdsqBmYw3bPAaJfPeYUo6tLUaT5tG/Gkh7xkpBhKRQ9e7pyg9Q==} - engines: {node: '>=6'} - - whatwg-url@5.0.0: - resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==} - - wide-align@1.1.5: - resolution: {integrity: sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==} - - wrap-ansi@6.2.0: - resolution: {integrity: sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==} - engines: {node: '>=8'} - - wrap-ansi@7.0.0: - resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==} - engines: {node: '>=10'} - - wrappy@1.0.2: - resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} - - write-file-atomic@5.0.1: - resolution: {integrity: sha512-+QU2zd6OTD8XWIJCbffaiQeH9U73qIqafo1x6V1snCWYGJf6cVE0cDR4D8xRzcEnfI21IFrUPzPGtcPf8AC+Rw==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - - y18n@5.0.8: - resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==} - engines: {node: '>=10'} - - yallist@4.0.0: - resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==} - - yargs-parser@21.1.1: - resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} - engines: {node: '>=12'} - - yargs@17.7.2: - resolution: {integrity: sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==} - engines: {node: '>=12'} - -snapshots: - - '@emnapi/core@1.2.0': - dependencies: - '@emnapi/wasi-threads': 1.0.1 - tslib: 2.6.3 - - '@emnapi/runtime@1.2.0': - dependencies: - tslib: 2.6.3 - - '@emnapi/wasi-threads@1.0.1': - dependencies: - tslib: 2.6.3 - - '@emotion/is-prop-valid@1.2.2': - dependencies: - '@emotion/memoize': 0.8.1 - - '@emotion/memoize@0.8.1': {} - - '@emotion/unitless@0.8.1': {} - - '@inquirer/figures@1.0.3': {} - - '@ljharb/through@2.3.13': - dependencies: - call-bind: 1.0.7 - - '@mapbox/node-pre-gyp@1.0.11': - dependencies: - detect-libc: 2.0.3 - https-proxy-agent: 5.0.1 - make-dir: 3.1.0 - node-fetch: 2.7.0 - nopt: 5.0.0 - npmlog: 5.0.1 - rimraf: 3.0.2 - semver: 7.6.2 - tar: 6.2.1 - transitivePeerDependencies: - - encoding - - supports-color - - '@napi-rs/cli@3.0.0-alpha.55(@emnapi/runtime@1.2.0)(emnapi@1.2.0)': - dependencies: - '@napi-rs/cross-toolchain': 0.0.16 - '@napi-rs/wasm-tools': 0.0.2 - '@octokit/rest': 20.1.1 - clipanion: 3.2.1(typanion@3.14.0) - colorette: 2.0.20 - debug: 4.3.5 - inquirer: 9.2.23 - js-yaml: 4.1.0 - lodash-es: 4.17.21 - semver: 7.6.2 - toml: 3.0.0 - typanion: 3.14.0 - wasm-sjlj: 1.0.5 - optionalDependencies: - '@emnapi/runtime': 1.2.0 - emnapi: 1.2.0 - transitivePeerDependencies: - - '@napi-rs/cross-toolchain-arm64-target-aarch64' - - '@napi-rs/cross-toolchain-arm64-target-armv7' - - '@napi-rs/cross-toolchain-arm64-target-x86_64' - - '@napi-rs/cross-toolchain-x64-target-aarch64' - - '@napi-rs/cross-toolchain-x64-target-armv7' - - '@napi-rs/cross-toolchain-x64-target-x86_64' - - supports-color - - '@napi-rs/cross-toolchain@0.0.16': - dependencies: - '@napi-rs/lzma': 1.3.1 - '@napi-rs/tar': 0.1.1 - debug: 4.3.5 - transitivePeerDependencies: - - supports-color - - '@napi-rs/lzma-android-arm-eabi@1.3.1': - optional: true - - '@napi-rs/lzma-android-arm64@1.3.1': - optional: true - - '@napi-rs/lzma-darwin-arm64@1.3.1': - optional: true - - '@napi-rs/lzma-darwin-x64@1.3.1': - optional: true - - '@napi-rs/lzma-freebsd-x64@1.3.1': - optional: true - - '@napi-rs/lzma-linux-arm-gnueabihf@1.3.1': - optional: true - - '@napi-rs/lzma-linux-arm64-gnu@1.3.1': - optional: true - - '@napi-rs/lzma-linux-arm64-musl@1.3.1': - optional: true - - '@napi-rs/lzma-linux-x64-gnu@1.3.1': - optional: true - - '@napi-rs/lzma-linux-x64-musl@1.3.1': - optional: true - - '@napi-rs/lzma-wasm32-wasi@1.3.1': - dependencies: - '@napi-rs/wasm-runtime': 0.2.4 - optional: true - - '@napi-rs/lzma-win32-arm64-msvc@1.3.1': - optional: true - - '@napi-rs/lzma-win32-ia32-msvc@1.3.1': - optional: true - - '@napi-rs/lzma-win32-x64-msvc@1.3.1': - optional: true - - '@napi-rs/lzma@1.3.1': - optionalDependencies: - '@napi-rs/lzma-android-arm-eabi': 1.3.1 - '@napi-rs/lzma-android-arm64': 1.3.1 - '@napi-rs/lzma-darwin-arm64': 1.3.1 - '@napi-rs/lzma-darwin-x64': 1.3.1 - '@napi-rs/lzma-freebsd-x64': 1.3.1 - '@napi-rs/lzma-linux-arm-gnueabihf': 1.3.1 - '@napi-rs/lzma-linux-arm64-gnu': 1.3.1 - '@napi-rs/lzma-linux-arm64-musl': 1.3.1 - '@napi-rs/lzma-linux-x64-gnu': 1.3.1 - '@napi-rs/lzma-linux-x64-musl': 1.3.1 - '@napi-rs/lzma-wasm32-wasi': 1.3.1 - '@napi-rs/lzma-win32-arm64-msvc': 1.3.1 - '@napi-rs/lzma-win32-ia32-msvc': 1.3.1 - '@napi-rs/lzma-win32-x64-msvc': 1.3.1 - - '@napi-rs/tar-android-arm-eabi@0.1.1': - optional: true - - '@napi-rs/tar-android-arm64@0.1.1': - optional: true - - '@napi-rs/tar-darwin-arm64@0.1.1': - optional: true - - '@napi-rs/tar-darwin-x64@0.1.1': - optional: true - - '@napi-rs/tar-freebsd-x64@0.1.1': - optional: true - - '@napi-rs/tar-linux-arm-gnueabihf@0.1.1': - optional: true - - '@napi-rs/tar-linux-arm64-gnu@0.1.1': - optional: true - - '@napi-rs/tar-linux-arm64-musl@0.1.1': - optional: true - - '@napi-rs/tar-linux-x64-gnu@0.1.1': - optional: true - - '@napi-rs/tar-linux-x64-musl@0.1.1': - optional: true - - '@napi-rs/tar-wasm32-wasi@0.1.1': - dependencies: - '@napi-rs/wasm-runtime': 0.2.4 - optional: true - - '@napi-rs/tar-win32-arm64-msvc@0.1.1': - optional: true - - '@napi-rs/tar-win32-ia32-msvc@0.1.1': - optional: true - - '@napi-rs/tar-win32-x64-msvc@0.1.1': - optional: true - - '@napi-rs/tar@0.1.1': - optionalDependencies: - '@napi-rs/tar-android-arm-eabi': 0.1.1 - '@napi-rs/tar-android-arm64': 0.1.1 - '@napi-rs/tar-darwin-arm64': 0.1.1 - '@napi-rs/tar-darwin-x64': 0.1.1 - '@napi-rs/tar-freebsd-x64': 0.1.1 - '@napi-rs/tar-linux-arm-gnueabihf': 0.1.1 - '@napi-rs/tar-linux-arm64-gnu': 0.1.1 - '@napi-rs/tar-linux-arm64-musl': 0.1.1 - '@napi-rs/tar-linux-x64-gnu': 0.1.1 - '@napi-rs/tar-linux-x64-musl': 0.1.1 - '@napi-rs/tar-wasm32-wasi': 0.1.1 - '@napi-rs/tar-win32-arm64-msvc': 0.1.1 - '@napi-rs/tar-win32-ia32-msvc': 0.1.1 - '@napi-rs/tar-win32-x64-msvc': 0.1.1 - - '@napi-rs/wasm-runtime@0.2.4': - dependencies: - '@emnapi/core': 1.2.0 - '@emnapi/runtime': 1.2.0 - '@tybys/wasm-util': 0.9.0 - - '@napi-rs/wasm-tools-android-arm-eabi@0.0.2': - optional: true - - '@napi-rs/wasm-tools-android-arm64@0.0.2': - optional: true - - '@napi-rs/wasm-tools-darwin-arm64@0.0.2': - optional: true - - '@napi-rs/wasm-tools-darwin-x64@0.0.2': - optional: true - - '@napi-rs/wasm-tools-freebsd-x64@0.0.2': - optional: true - - '@napi-rs/wasm-tools-linux-arm64-gnu@0.0.2': - optional: true - - '@napi-rs/wasm-tools-linux-arm64-musl@0.0.2': - optional: true - - '@napi-rs/wasm-tools-linux-x64-gnu@0.0.2': - optional: true - - '@napi-rs/wasm-tools-linux-x64-musl@0.0.2': - optional: true - - '@napi-rs/wasm-tools-wasm32-wasi@0.0.2': - dependencies: - '@napi-rs/wasm-runtime': 0.2.4 - optional: true - - '@napi-rs/wasm-tools-win32-arm64-msvc@0.0.2': - optional: true - - '@napi-rs/wasm-tools-win32-ia32-msvc@0.0.2': - optional: true - - '@napi-rs/wasm-tools-win32-x64-msvc@0.0.2': - optional: true - - '@napi-rs/wasm-tools@0.0.2': - optionalDependencies: - '@napi-rs/wasm-tools-android-arm-eabi': 0.0.2 - '@napi-rs/wasm-tools-android-arm64': 0.0.2 - '@napi-rs/wasm-tools-darwin-arm64': 0.0.2 - '@napi-rs/wasm-tools-darwin-x64': 0.0.2 - '@napi-rs/wasm-tools-freebsd-x64': 0.0.2 - '@napi-rs/wasm-tools-linux-arm64-gnu': 0.0.2 - '@napi-rs/wasm-tools-linux-arm64-musl': 0.0.2 - '@napi-rs/wasm-tools-linux-x64-gnu': 0.0.2 - '@napi-rs/wasm-tools-linux-x64-musl': 0.0.2 - '@napi-rs/wasm-tools-wasm32-wasi': 0.0.2 - '@napi-rs/wasm-tools-win32-arm64-msvc': 0.0.2 - '@napi-rs/wasm-tools-win32-ia32-msvc': 0.0.2 - '@napi-rs/wasm-tools-win32-x64-msvc': 0.0.2 - - '@nodelib/fs.scandir@2.1.5': - dependencies: - '@nodelib/fs.stat': 2.0.5 - run-parallel: 1.2.0 - - '@nodelib/fs.stat@2.0.5': {} - - '@nodelib/fs.walk@1.2.8': - dependencies: - '@nodelib/fs.scandir': 2.1.5 - fastq: 1.17.1 - - '@octokit/auth-token@4.0.0': {} - - '@octokit/core@5.2.0': - dependencies: - '@octokit/auth-token': 4.0.0 - '@octokit/graphql': 7.1.0 - '@octokit/request': 8.4.0 - '@octokit/request-error': 5.1.0 - '@octokit/types': 13.5.0 - before-after-hook: 2.2.3 - universal-user-agent: 6.0.1 - - '@octokit/endpoint@9.0.5': - dependencies: - '@octokit/types': 13.5.0 - universal-user-agent: 6.0.1 - - '@octokit/graphql@7.1.0': - dependencies: - '@octokit/request': 8.4.0 - '@octokit/types': 13.5.0 - universal-user-agent: 6.0.1 - - '@octokit/openapi-types@22.2.0': {} - - '@octokit/plugin-paginate-rest@11.3.1(@octokit/core@5.2.0)': - dependencies: - '@octokit/core': 5.2.0 - '@octokit/types': 13.5.0 - - '@octokit/plugin-request-log@4.0.1(@octokit/core@5.2.0)': - dependencies: - '@octokit/core': 5.2.0 - - '@octokit/plugin-rest-endpoint-methods@13.2.2(@octokit/core@5.2.0)': - dependencies: - '@octokit/core': 5.2.0 - '@octokit/types': 13.5.0 - - '@octokit/request-error@5.1.0': - dependencies: - '@octokit/types': 13.5.0 - deprecation: 2.3.1 - once: 1.4.0 - - '@octokit/request@8.4.0': - dependencies: - '@octokit/endpoint': 9.0.5 - '@octokit/request-error': 5.1.0 - '@octokit/types': 13.5.0 - universal-user-agent: 6.0.1 - - '@octokit/rest@20.1.1': - dependencies: - '@octokit/core': 5.2.0 - '@octokit/plugin-paginate-rest': 11.3.1(@octokit/core@5.2.0) - '@octokit/plugin-request-log': 4.0.1(@octokit/core@5.2.0) - '@octokit/plugin-rest-endpoint-methods': 13.2.2(@octokit/core@5.2.0) - - '@octokit/types@13.5.0': - dependencies: - '@octokit/openapi-types': 22.2.0 - - '@rollup/pluginutils@4.2.1': - dependencies: - estree-walker: 2.0.2 - picomatch: 2.3.1 - - '@sindresorhus/merge-streams@2.3.0': {} - - '@tybys/wasm-util@0.9.0': - dependencies: - tslib: 2.6.3 - - '@types/node@20.14.2': - dependencies: - undici-types: 5.26.5 - - '@types/stylis@4.2.6': {} - - '@vercel/nft@0.26.5': - dependencies: - '@mapbox/node-pre-gyp': 1.0.11 - '@rollup/pluginutils': 4.2.1 - acorn: 8.12.0 - acorn-import-attributes: 1.9.5(acorn@8.12.0) - async-sema: 3.1.1 - bindings: 1.5.0 - estree-walker: 2.0.2 - glob: 7.2.3 - graceful-fs: 4.2.11 - micromatch: 4.0.7 - node-gyp-build: 4.8.1 - resolve-from: 5.0.0 - transitivePeerDependencies: - - encoding - - supports-color - - abbrev@1.1.1: {} - - acorn-import-attributes@1.9.5(acorn@8.12.0): - dependencies: - acorn: 8.12.0 - - acorn-walk@8.3.3: - dependencies: - acorn: 8.12.0 - - acorn@8.12.0: {} - - agent-base@6.0.2: - dependencies: - debug: 4.3.5 - transitivePeerDependencies: - - supports-color - - ansi-escapes@4.3.2: - dependencies: - type-fest: 0.21.3 - - ansi-regex@5.0.1: {} - - ansi-regex@6.0.1: {} - - ansi-styles@4.3.0: - dependencies: - color-convert: 2.0.1 - - ansi-styles@6.2.1: {} - - aproba@2.0.0: {} - - are-we-there-yet@2.0.0: - dependencies: - delegates: 1.0.0 - readable-stream: 3.6.2 - - argparse@1.0.10: - dependencies: - sprintf-js: 1.0.3 - - argparse@2.0.1: {} - - array-find-index@1.0.2: {} - - arrgv@1.0.2: {} - - arrify@3.0.0: {} - - async-sema@3.1.1: {} - - asynckit@0.4.0: {} - - ava@6.1.3: - dependencies: - '@vercel/nft': 0.26.5 - acorn: 8.12.0 - acorn-walk: 8.3.3 - ansi-styles: 6.2.1 - arrgv: 1.0.2 - arrify: 3.0.0 - callsites: 4.1.0 - cbor: 9.0.2 - chalk: 5.3.0 - chunkd: 2.0.1 - ci-info: 4.0.0 - ci-parallel-vars: 1.0.1 - cli-truncate: 4.0.0 - code-excerpt: 4.0.0 - common-path-prefix: 3.0.0 - concordance: 5.0.4 - currently-unhandled: 0.4.1 - debug: 4.3.5 - emittery: 1.0.3 - figures: 6.1.0 - globby: 14.0.1 - ignore-by-default: 2.1.0 - indent-string: 5.0.0 - is-plain-object: 5.0.0 - is-promise: 4.0.0 - matcher: 5.0.0 - memoize: 10.0.0 - ms: 2.1.3 - p-map: 7.0.2 - package-config: 5.0.0 - picomatch: 3.0.1 - plur: 5.1.0 - pretty-ms: 9.0.0 - resolve-cwd: 3.0.0 - stack-utils: 2.0.6 - strip-ansi: 7.1.0 - supertap: 3.0.1 - temp-dir: 3.0.0 - write-file-atomic: 5.0.1 - yargs: 17.7.2 - transitivePeerDependencies: - - encoding - - supports-color - - axios@1.6.2: - dependencies: - follow-redirects: 1.15.6 - form-data: 4.0.0 - proxy-from-env: 1.1.0 - transitivePeerDependencies: - - debug - - balanced-match@1.0.2: {} - - base64-js@1.5.1: {} - - before-after-hook@2.2.3: {} - - bindings@1.5.0: - dependencies: - file-uri-to-path: 1.0.0 - - bl@4.1.0: - dependencies: - buffer: 5.7.1 - inherits: 2.0.4 - readable-stream: 3.6.2 - - blueimp-md5@2.19.0: {} - - brace-expansion@1.1.11: - dependencies: - balanced-match: 1.0.2 - concat-map: 0.0.1 - - braces@3.0.3: - dependencies: - fill-range: 7.1.1 - - buffer@5.7.1: - dependencies: - base64-js: 1.5.1 - ieee754: 1.2.1 - - call-bind@1.0.7: - dependencies: - es-define-property: 1.0.0 - es-errors: 1.3.0 - function-bind: 1.1.2 - get-intrinsic: 1.2.4 - set-function-length: 1.2.2 - - callsites@4.1.0: {} - - camelize@1.0.1: {} - - cbor@9.0.2: - dependencies: - nofilter: 3.1.0 - - chalk@4.1.2: - dependencies: - ansi-styles: 4.3.0 - supports-color: 7.2.0 - - chalk@5.3.0: {} - - chardet@0.7.0: {} - - chownr@2.0.0: {} - - chunkd@2.0.1: {} - - ci-info@4.0.0: {} - - ci-parallel-vars@1.0.1: {} - - cli-cursor@3.1.0: - dependencies: - restore-cursor: 3.1.0 - - cli-spinners@2.9.2: {} - - cli-truncate@4.0.0: - dependencies: - slice-ansi: 5.0.0 - string-width: 7.1.0 - - cli-width@4.1.0: {} - - clipanion@3.2.1(typanion@3.14.0): - dependencies: - typanion: 3.14.0 - - cliui@8.0.1: - dependencies: - string-width: 4.2.3 - strip-ansi: 6.0.1 - wrap-ansi: 7.0.0 - - clone@1.0.4: {} - - code-excerpt@4.0.0: - dependencies: - convert-to-spaces: 2.0.1 - - color-convert@2.0.1: - dependencies: - color-name: 1.1.4 - - color-name@1.1.4: {} - - color-support@1.1.3: {} - - colorette@2.0.20: {} - - combined-stream@1.0.8: - dependencies: - delayed-stream: 1.0.0 - - common-path-prefix@3.0.0: {} - - concat-map@0.0.1: {} - - concordance@5.0.4: - dependencies: - date-time: 3.1.0 - esutils: 2.0.3 - fast-diff: 1.3.0 - js-string-escape: 1.0.1 - lodash: 4.17.21 - md5-hex: 3.0.1 - semver: 7.6.2 - well-known-symbols: 2.0.0 - - console-control-strings@1.1.0: {} - - convert-to-spaces@2.0.1: {} - - css-color-keywords@1.0.0: {} - - css-to-react-native@3.2.0: - dependencies: - camelize: 1.0.1 - css-color-keywords: 1.0.0 - postcss-value-parser: 4.2.0 - - csstype@3.1.3: {} - - currently-unhandled@0.4.1: - dependencies: - array-find-index: 1.0.2 - - date-time@3.1.0: - dependencies: - time-zone: 1.0.0 - - debug@4.3.5: - dependencies: - ms: 2.1.2 - - defaults@1.0.4: - dependencies: - clone: 1.0.4 - - define-data-property@1.1.4: - dependencies: - es-define-property: 1.0.0 - es-errors: 1.3.0 - gopd: 1.0.1 - - delayed-stream@1.0.0: {} - - delegates@1.0.0: {} - - deprecation@2.3.1: {} - - detect-libc@2.0.3: {} - - emittery@1.0.3: {} - - emnapi@1.2.0: {} - - emoji-regex@10.3.0: {} - - emoji-regex@8.0.0: {} - - es-define-property@1.0.0: - dependencies: - get-intrinsic: 1.2.4 - - es-errors@1.3.0: {} - - escalade@3.1.2: {} - - escape-string-regexp@2.0.0: {} - - escape-string-regexp@5.0.0: {} - - esprima@4.0.1: {} - - estree-walker@2.0.2: {} - - esutils@2.0.3: {} - - external-editor@3.1.0: - dependencies: - chardet: 0.7.0 - iconv-lite: 0.4.24 - tmp: 0.0.33 - - fast-diff@1.3.0: {} - - fast-glob@3.3.2: - dependencies: - '@nodelib/fs.stat': 2.0.5 - '@nodelib/fs.walk': 1.2.8 - glob-parent: 5.1.2 - merge2: 1.4.1 - micromatch: 4.0.7 - - fastq@1.17.1: - dependencies: - reusify: 1.0.4 - - figures@6.1.0: - dependencies: - is-unicode-supported: 2.0.0 - - file-uri-to-path@1.0.0: {} - - fill-range@7.1.1: - dependencies: - to-regex-range: 5.0.1 - - find-up-simple@1.0.0: {} - - follow-redirects@1.15.6: {} - - form-data@4.0.0: - dependencies: - asynckit: 0.4.0 - combined-stream: 1.0.8 - mime-types: 2.1.35 - - fs-minipass@2.1.0: - dependencies: - minipass: 3.3.6 - - fs.realpath@1.0.0: {} - - function-bind@1.1.2: {} - - gauge@3.0.2: - dependencies: - aproba: 2.0.0 - color-support: 1.1.3 - console-control-strings: 1.1.0 - has-unicode: 2.0.1 - object-assign: 4.1.1 - signal-exit: 3.0.7 - string-width: 4.2.3 - strip-ansi: 6.0.1 - wide-align: 1.1.5 - - get-caller-file@2.0.5: {} - - get-east-asian-width@1.2.0: {} - - get-intrinsic@1.2.4: - dependencies: - es-errors: 1.3.0 - function-bind: 1.1.2 - has-proto: 1.0.3 - has-symbols: 1.0.3 - hasown: 2.0.2 - - glob-parent@5.1.2: - dependencies: - is-glob: 4.0.3 - - glob@7.2.3: - dependencies: - fs.realpath: 1.0.0 - inflight: 1.0.6 - inherits: 2.0.4 - minimatch: 3.1.2 - once: 1.4.0 - path-is-absolute: 1.0.1 - - globby@14.0.1: - dependencies: - '@sindresorhus/merge-streams': 2.3.0 - fast-glob: 3.3.2 - ignore: 5.3.1 - path-type: 5.0.0 - slash: 5.1.0 - unicorn-magic: 0.1.0 - - gopd@1.0.1: - dependencies: - get-intrinsic: 1.2.4 - - graceful-fs@4.2.11: {} - - has-flag@4.0.0: {} - - has-property-descriptors@1.0.2: - dependencies: - es-define-property: 1.0.0 - - has-proto@1.0.3: {} - - has-symbols@1.0.3: {} - - has-unicode@2.0.1: {} - - hasown@2.0.2: - dependencies: - function-bind: 1.1.2 - - https-proxy-agent@5.0.1: - dependencies: - agent-base: 6.0.2 - debug: 4.3.5 - transitivePeerDependencies: - - supports-color - - iconv-lite@0.4.24: - dependencies: - safer-buffer: 2.1.2 - - ieee754@1.2.1: {} - - ignore-by-default@2.1.0: {} - - ignore@5.3.1: {} - - imurmurhash@0.1.4: {} - - indent-string@5.0.0: {} - - inflight@1.0.6: - dependencies: - once: 1.4.0 - wrappy: 1.0.2 - - inherits@2.0.4: {} - - inquirer@9.2.23: - dependencies: - '@inquirer/figures': 1.0.3 - '@ljharb/through': 2.3.13 - ansi-escapes: 4.3.2 - chalk: 5.3.0 - cli-cursor: 3.1.0 - cli-width: 4.1.0 - external-editor: 3.1.0 - lodash: 4.17.21 - mute-stream: 1.0.0 - ora: 5.4.1 - run-async: 3.0.0 - rxjs: 7.8.1 - string-width: 4.2.3 - strip-ansi: 6.0.1 - wrap-ansi: 6.2.0 - - irregular-plurals@3.5.0: {} - - is-extglob@2.1.1: {} - - is-fullwidth-code-point@3.0.0: {} - - is-fullwidth-code-point@4.0.0: {} - - is-glob@4.0.3: - dependencies: - is-extglob: 2.1.1 - - is-interactive@1.0.0: {} - - is-number@7.0.0: {} - - is-plain-object@5.0.0: {} - - is-promise@4.0.0: {} - - is-unicode-supported@0.1.0: {} - - is-unicode-supported@2.0.0: {} - - js-string-escape@1.0.1: {} - - js-tokens@4.0.0: {} - - js-yaml@3.14.1: - dependencies: - argparse: 1.0.10 - esprima: 4.0.1 - - js-yaml@4.1.0: - dependencies: - argparse: 2.0.1 - - load-json-file@7.0.1: {} - - lodash-es@4.17.21: {} - - lodash@4.17.21: {} - - log-symbols@4.1.0: - dependencies: - chalk: 4.1.2 - is-unicode-supported: 0.1.0 - - loose-envify@1.4.0: - dependencies: - js-tokens: 4.0.0 - - make-dir@3.1.0: - dependencies: - semver: 6.3.1 - - matcher@5.0.0: - dependencies: - escape-string-regexp: 5.0.0 - - md5-hex@3.0.1: - dependencies: - blueimp-md5: 2.19.0 - - memoize@10.0.0: - dependencies: - mimic-function: 5.0.1 - - merge2@1.4.1: {} - - micromatch@4.0.7: - dependencies: - braces: 3.0.3 - picomatch: 2.3.1 - - mime-db@1.52.0: {} - - mime-types@2.1.35: - dependencies: - mime-db: 1.52.0 - - mimic-fn@2.1.0: {} - - mimic-function@5.0.1: {} - - minimatch@3.1.2: - dependencies: - brace-expansion: 1.1.11 - - minipass@3.3.6: - dependencies: - yallist: 4.0.0 - - minipass@5.0.0: {} - - minizlib@2.1.2: - dependencies: - minipass: 3.3.6 - yallist: 4.0.0 - - mkdirp@1.0.4: {} - - ms@2.1.2: {} - - ms@2.1.3: {} - - mute-stream@1.0.0: {} - - nanoid@3.3.7: {} - - node-fetch@2.7.0: - dependencies: - whatwg-url: 5.0.0 - - node-gyp-build@4.8.1: {} - - nofilter@3.1.0: {} - - nopt@5.0.0: - dependencies: - abbrev: 1.1.1 - - npmlog@5.0.1: - dependencies: - are-we-there-yet: 2.0.0 - console-control-strings: 1.1.0 - gauge: 3.0.2 - set-blocking: 2.0.0 - - object-assign@4.1.1: {} - - once@1.4.0: - dependencies: - wrappy: 1.0.2 - - onetime@5.1.2: - dependencies: - mimic-fn: 2.1.0 - - ora@5.4.1: - dependencies: - bl: 4.1.0 - chalk: 4.1.2 - cli-cursor: 3.1.0 - cli-spinners: 2.9.2 - is-interactive: 1.0.0 - is-unicode-supported: 0.1.0 - log-symbols: 4.1.0 - strip-ansi: 6.0.1 - wcwidth: 1.0.1 - - os-tmpdir@1.0.2: {} - - p-map@7.0.2: {} - - package-config@5.0.0: - dependencies: - find-up-simple: 1.0.0 - load-json-file: 7.0.1 - - parse-ms@4.0.0: {} - - path-is-absolute@1.0.1: {} - - path-type@5.0.0: {} - - picocolors@1.0.1: {} - - picomatch@2.3.1: {} - - picomatch@3.0.1: {} - - plur@5.1.0: - dependencies: - irregular-plurals: 3.5.0 - - postcss-value-parser@4.2.0: {} - - postcss@8.4.33: - dependencies: - nanoid: 3.3.7 - picocolors: 1.0.1 - source-map-js: 1.2.0 - - pretty-ms@9.0.0: - dependencies: - parse-ms: 4.0.0 - - proxy-from-env@1.1.0: {} - - queue-microtask@1.2.3: {} - - react-dom@18.3.1(react@18.3.1): - dependencies: - loose-envify: 1.4.0 - react: 18.3.1 - scheduler: 0.23.2 - - react@18.3.1: - dependencies: - loose-envify: 1.4.0 - - readable-stream@3.6.2: - dependencies: - inherits: 2.0.4 - string_decoder: 1.3.0 - util-deprecate: 1.0.2 - - require-directory@2.1.1: {} - - resolve-cwd@3.0.0: - dependencies: - resolve-from: 5.0.0 - - resolve-from@5.0.0: {} - - restore-cursor@3.1.0: - dependencies: - onetime: 5.1.2 - signal-exit: 3.0.7 - - reusify@1.0.4: {} - - rimraf@3.0.2: - dependencies: - glob: 7.2.3 - - run-async@3.0.0: {} - - run-parallel@1.2.0: - dependencies: - queue-microtask: 1.2.3 - - rxjs@7.8.1: - dependencies: - tslib: 2.6.3 - - safe-buffer@5.2.1: {} - - safer-buffer@2.1.2: {} - - scheduler@0.23.2: - dependencies: - loose-envify: 1.4.0 - - semver@6.3.1: {} - - semver@7.6.2: {} - - serialize-error@7.0.1: - dependencies: - type-fest: 0.13.1 - - set-blocking@2.0.0: {} - - set-function-length@1.2.2: - 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 - - shallowequal@1.1.0: {} - - signal-exit@3.0.7: {} - - signal-exit@4.1.0: {} - - slash@5.1.0: {} - - slice-ansi@5.0.0: - dependencies: - ansi-styles: 6.2.1 - is-fullwidth-code-point: 4.0.0 - - source-map-js@1.2.0: {} - - sprintf-js@1.0.3: {} - - stack-utils@2.0.6: - dependencies: - escape-string-regexp: 2.0.0 - - string-width@4.2.3: - dependencies: - emoji-regex: 8.0.0 - is-fullwidth-code-point: 3.0.0 - strip-ansi: 6.0.1 - - string-width@7.1.0: - dependencies: - emoji-regex: 10.3.0 - get-east-asian-width: 1.2.0 - strip-ansi: 7.1.0 - - string_decoder@1.3.0: - dependencies: - safe-buffer: 5.2.1 - - strip-ansi@6.0.1: - dependencies: - ansi-regex: 5.0.1 - - strip-ansi@7.1.0: - dependencies: - ansi-regex: 6.0.1 - - styled-components@6.1.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1): - dependencies: - '@emotion/is-prop-valid': 1.2.2 - '@emotion/unitless': 0.8.1 - '@types/stylis': 4.2.6 - css-to-react-native: 3.2.0 - csstype: 3.1.3 - postcss: 8.4.33 - react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) - shallowequal: 1.1.0 - stylis: 4.3.2 - tslib: 2.6.3 - - stylis@4.3.2: {} - - supertap@3.0.1: - dependencies: - indent-string: 5.0.0 - js-yaml: 3.14.1 - serialize-error: 7.0.1 - strip-ansi: 7.1.0 - - supports-color@7.2.0: - dependencies: - has-flag: 4.0.0 - - tar@6.2.1: - dependencies: - chownr: 2.0.0 - fs-minipass: 2.1.0 - minipass: 5.0.0 - minizlib: 2.1.2 - mkdirp: 1.0.4 - yallist: 4.0.0 - - temp-dir@3.0.0: {} - - time-zone@1.0.0: {} - - tmp@0.0.33: - dependencies: - os-tmpdir: 1.0.2 - - to-regex-range@5.0.1: - dependencies: - is-number: 7.0.0 - - toml@3.0.0: {} - - tr46@0.0.3: {} - - tslib@2.6.3: {} - - typanion@3.14.0: {} - - type-fest@0.13.1: {} - - type-fest@0.21.3: {} - - typescript@5.4.5: {} - - undici-types@5.26.5: {} - - unicorn-magic@0.1.0: {} - - universal-user-agent@6.0.1: {} - - util-deprecate@1.0.2: {} - - wasm-sjlj@1.0.5: {} - - wcwidth@1.0.1: - dependencies: - defaults: 1.0.4 - - webidl-conversions@3.0.1: {} - - well-known-symbols@2.0.0: {} - - whatwg-url@5.0.0: - dependencies: - tr46: 0.0.3 - webidl-conversions: 3.0.1 - - wide-align@1.1.5: - dependencies: - string-width: 4.2.3 - - wrap-ansi@6.2.0: - dependencies: - ansi-styles: 4.3.0 - string-width: 4.2.3 - strip-ansi: 6.0.1 - - wrap-ansi@7.0.0: - dependencies: - ansi-styles: 4.3.0 - string-width: 4.2.3 - strip-ansi: 6.0.1 - - wrappy@1.0.2: {} - - write-file-atomic@5.0.1: - dependencies: - imurmurhash: 0.1.4 - signal-exit: 4.1.0 - - y18n@5.0.8: {} - - yallist@4.0.0: {} - - yargs-parser@21.1.1: {} - - yargs@17.7.2: - dependencies: - cliui: 8.0.1 - escalade: 3.1.2 - get-caller-file: 2.0.5 - require-directory: 2.1.1 - string-width: 4.2.3 - y18n: 5.0.8 - yargs-parser: 21.1.1 diff --git a/src/builtins.rs b/src/builtins.rs deleted file mode 100644 index 45a25117..00000000 --- a/src/builtins.rs +++ /dev/null @@ -1,71 +0,0 @@ -/// Node.js built-in modules -/// -/// `node -p "[...require('module').builtinModules].map(b => JSON.stringify(b)).join(',\n')"` -/// -pub const NODEJS_BUILTINS: &[&str] = &[ - "_http_agent", - "_http_client", - "_http_common", - "_http_incoming", - "_http_outgoing", - "_http_server", - "_stream_duplex", - "_stream_passthrough", - "_stream_readable", - "_stream_transform", - "_stream_wrap", - "_stream_writable", - "_tls_common", - "_tls_wrap", - "assert", - "assert/strict", - "async_hooks", - "buffer", - "child_process", - "cluster", - "console", - "constants", - "crypto", - "dgram", - "diagnostics_channel", - "dns", - "dns/promises", - "domain", - "events", - "fs", - "fs/promises", - "http", - "http2", - "https", - "inspector", - "module", - "net", - "os", - "path", - "path/posix", - "path/win32", - "perf_hooks", - "process", - "punycode", - "querystring", - "readline", - "repl", - "stream", - "stream/consumers", - "stream/promises", - "stream/web", - "string_decoder", - "sys", - "timers", - "timers/promises", - "tls", - "trace_events", - "tty", - "url", - "util", - "util/types", - "v8", - "vm", - "worker_threads", - "zlib", -]; diff --git a/src/cache.rs b/src/cache.rs deleted file mode 100644 index a1bde36c..00000000 --- a/src/cache.rs +++ /dev/null @@ -1,369 +0,0 @@ -use once_cell::sync::OnceCell as OnceLock; -use std::{ - borrow::{Borrow, Cow}, - convert::AsRef, - hash::{BuildHasherDefault, Hash, Hasher}, - io, - ops::Deref, - path::{Path, PathBuf}, - sync::Arc, -}; - -use dashmap::{DashMap, DashSet}; -use rustc_hash::FxHasher; - -use crate::{ - context::ResolveContext as Ctx, package_json::PackageJson, path::PathUtil, FileMetadata, - FileSystem, ResolveError, ResolveOptions, TsConfig, -}; - -#[derive(Default)] -pub struct Cache { - pub(crate) fs: Fs, - paths: DashSet>, - tsconfigs: DashMap, BuildHasherDefault>, -} - -impl Cache { - pub fn new(fs: Fs) -> Self { - Self { fs, paths: DashSet::default(), tsconfigs: DashMap::default() } - } - - pub fn clear(&self) { - self.paths.clear(); - self.tsconfigs.clear(); - } - - pub fn value(&self, path: &Path) -> CachedPath { - let hash = { - let mut hasher = FxHasher::default(); - path.hash(&mut hasher); - hasher.finish() - }; - if let Some(cache_entry) = self.paths.get((hash, path).borrow() as &dyn CacheKey) { - return cache_entry.clone(); - } - let parent = path.parent().map(|p| self.value(p)); - let data = CachedPath(Arc::new(CachedPathImpl::new( - hash, - path.to_path_buf().into_boxed_path(), - parent, - ))); - self.paths.insert(data.clone()); - data - } - - pub fn tsconfig Result<(), ResolveError>>( - &self, - root: bool, - path: &Path, - callback: F, // callback for modifying tsconfig with `extends` - ) -> Result, ResolveError> { - if let Some(tsconfig_ref) = self.tsconfigs.get(path) { - return Ok(Arc::clone(tsconfig_ref.value())); - } - let meta = self.fs.metadata(path).ok(); - let tsconfig_path = if meta.is_some_and(|m| m.is_file) { - Cow::Borrowed(path) - } else if meta.is_some_and(|m| m.is_dir) { - Cow::Owned(path.join("tsconfig.json")) - } else { - let mut os_string = path.to_path_buf().into_os_string(); - os_string.push(".json"); - Cow::Owned(PathBuf::from(os_string)) - }; - let mut tsconfig_string = self - .fs - .read_to_string(&tsconfig_path) - .map_err(|_| ResolveError::TsconfigNotFound(path.to_path_buf()))?; - let mut tsconfig = - TsConfig::parse(root, &tsconfig_path, &mut tsconfig_string).map_err(|error| { - ResolveError::from_serde_json_error(tsconfig_path.to_path_buf(), &error) - })?; - callback(&mut tsconfig)?; - let tsconfig = Arc::new(tsconfig.build()); - self.tsconfigs.insert(path.to_path_buf(), Arc::clone(&tsconfig)); - Ok(tsconfig) - } -} - -#[derive(Clone)] -pub struct CachedPath(Arc); - -impl Hash for CachedPath { - fn hash(&self, state: &mut H) { - self.0.hash.hash(state); - } -} - -impl PartialEq for CachedPath { - fn eq(&self, other: &Self) -> bool { - self.0.path == other.0.path - } -} -impl Eq for CachedPath {} - -impl Deref for CachedPath { - type Target = CachedPathImpl; - - fn deref(&self) -> &Self::Target { - self.0.as_ref() - } -} - -impl<'a> Borrow for CachedPath { - fn borrow(&self) -> &(dyn CacheKey + 'a) { - self - } -} - -impl AsRef for CachedPath { - fn as_ref(&self) -> &CachedPathImpl { - self.0.as_ref() - } -} - -impl CacheKey for CachedPath { - fn tuple(&self) -> (u64, &Path) { - (self.hash, &self.path) - } -} - -pub struct CachedPathImpl { - hash: u64, - path: Box, - parent: Option, - meta: OnceLock>, - symlink: OnceLock>, - canonicalized: OnceLock>, - node_modules: OnceLock>, - package_json: OnceLock>>, -} - -impl CachedPathImpl { - fn new(hash: u64, path: Box, parent: Option) -> Self { - Self { - hash, - path, - parent, - meta: OnceLock::new(), - symlink: OnceLock::new(), - canonicalized: OnceLock::new(), - node_modules: OnceLock::new(), - package_json: OnceLock::new(), - } - } - - pub fn path(&self) -> &Path { - &self.path - } - - pub fn to_path_buf(&self) -> PathBuf { - self.path.to_path_buf() - } - - pub fn parent(&self) -> Option<&CachedPath> { - self.parent.as_ref() - } - - fn meta(&self, fs: &Fs) -> Option { - *self.meta.get_or_init(|| fs.metadata(&self.path).ok()) - } - - pub fn is_file(&self, fs: &Fs, ctx: &mut Ctx) -> bool { - if let Some(meta) = self.meta(fs) { - ctx.add_file_dependency(self.path()); - meta.is_file - } else { - ctx.add_missing_dependency(self.path()); - false - } - } - - pub fn is_dir(&self, fs: &Fs, ctx: &mut Ctx) -> bool { - self.meta(fs).map_or_else( - || { - ctx.add_missing_dependency(self.path()); - false - }, - |meta| meta.is_dir, - ) - } - - fn symlink(&self, fs: &Fs) -> io::Result> { - self.symlink - .get_or_try_init(|| { - if let Ok(symlink_metadata) = fs.symlink_metadata(&self.path) { - if symlink_metadata.is_symlink { - return fs.canonicalize(self.path()).map(Some); - } - } - Ok(None) - }) - .cloned() - } - - pub fn realpath(&self, fs: &Fs) -> io::Result { - self.canonicalized - .get_or_try_init(|| { - if let Some(link) = self.symlink(fs)? { - return Ok(Some(link)); - } - if let Some(parent) = self.parent() { - let parent_path = parent.realpath(fs)?; - return Ok(Some( - parent_path.normalize_with(self.path.strip_prefix(&parent.path).unwrap()), - )); - }; - Ok(None) - }) - .cloned() - .map(|r| r.unwrap_or_else(|| self.path.clone().to_path_buf())) - } - - pub fn module_directory( - &self, - module_name: &str, - cache: &Cache, - ctx: &mut Ctx, - ) -> Option { - let cached_path = cache.value(&self.path.join(module_name)); - cached_path.is_dir(&cache.fs, ctx).then_some(cached_path) - } - - pub fn cached_node_modules( - &self, - cache: &Cache, - ctx: &mut Ctx, - ) -> Option { - self.node_modules.get_or_init(|| self.module_directory("node_modules", cache, ctx)).clone() - } - - /// Find package.json of a path by traversing parent directories. - /// - /// # Errors - /// - /// * [ResolveError::JSON] - pub fn find_package_json( - &self, - fs: &Fs, - options: &ResolveOptions, - ctx: &mut Ctx, - ) -> Result>, ResolveError> { - let mut cache_value = self; - // Go up directories when the querying path is not a directory - while !cache_value.is_dir(fs, ctx) { - if let Some(cv) = &cache_value.parent { - cache_value = cv.as_ref(); - } else { - break; - } - } - let mut cache_value = Some(cache_value); - while let Some(cv) = cache_value { - if let Some(package_json) = cv.package_json(fs, options, ctx)? { - return Ok(Some(Arc::clone(&package_json))); - } - cache_value = cv.parent.as_deref(); - } - Ok(None) - } - - /// Get package.json of the given path. - /// - /// # Errors - /// - /// * [ResolveError::JSON] - pub fn package_json( - &self, - fs: &Fs, - options: &ResolveOptions, - ctx: &mut Ctx, - ) -> Result>, ResolveError> { - // Change to `std::sync::OnceLock::get_or_try_init` when it is stable. - let result = self - .package_json - .get_or_try_init(|| { - let package_json_path = self.path.join("package.json"); - let Ok(package_json_string) = fs.read_to_string(&package_json_path) else { - return Ok(None); - }; - let real_path = if options.symlinks { - self.realpath(fs)?.join("package.json") - } else { - package_json_path.clone() - }; - PackageJson::parse(package_json_path.clone(), real_path, &package_json_string) - .map(Arc::new) - .map(Some) - .map_err(|error| ResolveError::from_serde_json_error(package_json_path, &error)) - }) - .cloned(); - // https://github.com/webpack/enhanced-resolve/blob/58464fc7cb56673c9aa849e68e6300239601e615/lib/DescriptionFileUtils.js#L68-L82 - match &result { - Ok(Some(package_json)) => { - ctx.add_file_dependency(&package_json.path); - } - Ok(None) => { - // Avoid an allocation by making this lazy - if let Some(deps) = &mut ctx.missing_dependencies { - deps.push(self.path.join("package.json")); - } - } - Err(_) => { - if let Some(deps) = &mut ctx.file_dependencies { - deps.push(self.path.join("package.json")); - } - } - } - result - } -} - -/// Memoized cache key, code adapted from . -trait CacheKey { - fn tuple(&self) -> (u64, &Path); -} - -impl Hash for dyn CacheKey + '_ { - fn hash(&self, state: &mut H) { - self.tuple().0.hash(state); - } -} - -impl PartialEq for dyn CacheKey + '_ { - fn eq(&self, other: &Self) -> bool { - self.tuple().1 == other.tuple().1 - } -} - -impl Eq for dyn CacheKey + '_ {} - -impl<'a> CacheKey for (u64, &'a Path) { - fn tuple(&self) -> (u64, &Path) { - (self.0, self.1) - } -} - -impl<'a> Borrow for (u64, &'a Path) { - fn borrow(&self) -> &(dyn CacheKey + 'a) { - self - } -} - -/// Since the cache key is memoized, use an identity hasher -/// to avoid double cache. -#[derive(Default)] -struct IdentityHasher(u64); - -impl Hasher for IdentityHasher { - fn write(&mut self, _: &[u8]) { - unreachable!("Invalid use of IdentityHasher") - } - fn write_u64(&mut self, n: u64) { - self.0 = n; - } - fn finish(&self) -> u64 { - self.0 - } -} diff --git a/src/context.rs b/src/context.rs deleted file mode 100644 index 9349de30..00000000 --- a/src/context.rs +++ /dev/null @@ -1,89 +0,0 @@ -use std::{ - ops::{Deref, DerefMut}, - path::{Path, PathBuf}, -}; - -use crate::error::ResolveError; - -#[derive(Debug, Default, Clone)] -pub struct ResolveContext(ResolveContextImpl); - -#[derive(Debug, Default, Clone)] -pub struct ResolveContextImpl { - pub fully_specified: bool, - - pub query: Option, - - pub fragment: Option, - - /// Files that was found on file system - pub file_dependencies: Option>, - - /// Files that was found on file system - pub missing_dependencies: Option>, - - /// The current resolving alias for bailing recursion alias. - pub resolving_alias: Option, - - /// For avoiding infinite recursion, which will cause stack overflow. - depth: u8, -} - -impl Deref for ResolveContext { - type Target = ResolveContextImpl; - - fn deref(&self) -> &Self::Target { - &self.0 - } -} - -impl DerefMut for ResolveContext { - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} - -impl ResolveContext { - pub fn with_fully_specified(&mut self, yes: bool) { - self.fully_specified = yes; - } - - pub fn with_query_fragment(&mut self, query: Option<&str>, fragment: Option<&str>) { - if let Some(query) = query { - self.query.replace(query.to_string()); - } - if let Some(fragment) = fragment { - self.fragment.replace(fragment.to_string()); - } - } - - pub fn init_file_dependencies(&mut self) { - self.file_dependencies.replace(vec![]); - self.missing_dependencies.replace(vec![]); - } - - pub fn add_file_dependency(&mut self, dep: &Path) { - if let Some(deps) = &mut self.file_dependencies { - deps.push(dep.to_path_buf()); - } - } - - pub fn add_missing_dependency(&mut self, dep: &Path) { - if let Some(deps) = &mut self.missing_dependencies { - deps.push(dep.to_path_buf()); - } - } - - pub fn with_resolving_alias(&mut self, alias: String) { - self.resolving_alias = Some(alias); - } - - pub fn test_for_infinite_recursion(&mut self) -> Result<(), ResolveError> { - self.depth += 1; - // 64 should be more than enough for detecting infinite recursion. - if self.depth > 64 { - return Err(ResolveError::Recursion); - } - Ok(()) - } -} diff --git a/src/error.rs b/src/error.rs deleted file mode 100644 index ff2aaa4f..00000000 --- a/src/error.rs +++ /dev/null @@ -1,160 +0,0 @@ -use std::{io, path::PathBuf, sync::Arc}; -use thiserror::Error; - -/// All resolution errors -/// -/// `thiserror` is used to display meaningful error messages. -#[derive(Debug, Clone, PartialEq, Error)] -pub enum ResolveError { - /// Ignored path - /// - /// Derived from ignored path (false value) from browser field in package.json - /// ```json - /// { - /// "browser": { - /// "./module": false - /// } - /// } - /// ``` - /// See - #[error("Path is ignored {0}")] - Ignored(PathBuf), - - /// Module not found - #[error("Cannot find module '{0}'")] - NotFound(/* specifier */ String), - - /// Tsconfig not found - #[error("Tsconfig not found {0}")] - TsconfigNotFound(PathBuf), - - #[error("{0}")] - IOError(IOError), - - /// Node.js builtin modules - /// - /// This is an error due to not being a Node.js runtime. - /// The `alias` option can be used to resolve a builtin module to a polyfill. - #[error("Builtin module {0}")] - Builtin(String), - - /// All of the aliased extension are not found - #[error("All of the aliased extension are not found")] - ExtensionAlias, - - /// The provided path specifier cannot be parsed - #[error("{0}")] - Specifier(SpecifierError), - - /// JSON parse error - #[error("{0:?}")] - JSON(JSONError), - - /// Restricted by `ResolveOptions::restrictions` - #[error(r#"Path "{0}" restricted by {0}"#)] - Restriction(PathBuf, PathBuf), - - #[error(r#"Invalid module "{0}" specifier is not a valid subpath for the "exports" resolution of {1}"#)] - InvalidModuleSpecifier(String, PathBuf), - - #[error(r#"Invalid "exports" target "{0}" defined for '{1}' in the package config {2}"#)] - InvalidPackageTarget(String, String, PathBuf), - - #[error(r#"Package subpath '{0}' is not defined by "exports" in {1}"#)] - PackagePathNotExported(String, PathBuf), - - #[error(r#"Invalid package config "{0}", "exports" cannot contain some keys starting with '.' and some not. The exports object must either be an object of package subpath keys or an object of main entry condition name keys only."#)] - InvalidPackageConfig(PathBuf), - - #[error(r#"Default condition should be last one in "{0}""#)] - InvalidPackageConfigDefault(PathBuf), - - #[error(r#"Expecting folder to folder mapping. "{0}" should end with "/"#)] - InvalidPackageConfigDirectory(PathBuf), - - #[error(r#"Package import specifier "{0}" is not defined in package {1}"#)] - PackageImportNotDefined(String, PathBuf), - - #[error("{0} is unimplemented")] - Unimplemented(&'static str), - - /// Occurs when alias paths reference each other. - #[error("Recursion in resolving")] - Recursion, -} - -impl ResolveError { - pub fn is_ignore(&self) -> bool { - matches!(self, Self::Ignored(_)) - } - - pub(crate) fn from_serde_json_error(path: PathBuf, error: &serde_json::Error) -> Self { - Self::JSON(JSONError { - path, - message: error.to_string(), - line: error.line(), - column: error.column(), - }) - } -} - -/// Error for [ResolveError::Specifier] -#[derive(Debug, Clone, Eq, PartialEq, Error)] -pub enum SpecifierError { - #[error("The specifiers must be a non-empty string. Received \"{0}\"")] - Empty(String), -} - -/// JSON error from [serde_json::Error] -#[derive(Debug, Clone, Eq, PartialEq)] -pub struct JSONError { - pub path: PathBuf, - pub message: String, - pub line: usize, - pub column: usize, -} - -#[derive(Debug, Clone, Error)] -#[error("{0}")] -pub struct IOError(Arc); - -impl PartialEq for IOError { - fn eq(&self, other: &Self) -> bool { - self.0.kind() == other.0.kind() - } -} - -impl From for io::Error { - fn from(error: IOError) -> Self { - let io_error = error.0.as_ref(); - Self::new(io_error.kind(), io_error.to_string()) - } -} - -impl From for ResolveError { - fn from(err: io::Error) -> Self { - Self::IOError(IOError(Arc::new(err))) - } -} - -#[test] -fn test_into_io_error() { - use std::io::{self, ErrorKind}; - let error_string = "IOError occurred"; - let string_error = io::Error::new(ErrorKind::Interrupted, error_string.to_string()); - let string_error2 = io::Error::new(ErrorKind::Interrupted, error_string.to_string()); - let resolve_io_error: ResolveError = ResolveError::from(string_error2); - - assert_eq!(resolve_io_error, ResolveError::from(string_error)); - assert_eq!(resolve_io_error.clone(), resolve_io_error); - if let ResolveError::IOError(io_error) = resolve_io_error { - // fix for https://github.com/web-infra-dev/rspack/issues/4564 - let std_io_error: io::Error = io_error.into(); - assert_eq!(std_io_error.kind(), ErrorKind::Interrupted); - assert_eq!(std_io_error.to_string(), error_string); - assert_eq!( - format!("{std_io_error:?}"), - r#"Custom { kind: Interrupted, error: "IOError occurred" }"# - ); - } -} diff --git a/src/file_system.rs b/src/file_system.rs deleted file mode 100644 index 04d177de..00000000 --- a/src/file_system.rs +++ /dev/null @@ -1,133 +0,0 @@ -use std::{ - fs, io, - path::{Path, PathBuf}, -}; - -/// File System abstraction used for `ResolverGeneric` -pub trait FileSystem: Send + Sync { - /// See [std::fs::read_to_string] - /// - /// # Errors - /// - /// * See [std::fs::read_to_string] - /// ## Warning - /// Use `&Path` instead of a generic `P: AsRef` here, - /// because object safety requirements, it is especially useful, when - /// you want to store multiple `dyn FileSystem` in a `Vec` or use a `ResolverGeneric` in - /// napi env. - fn read_to_string(&self, path: &Path) -> io::Result; - - /// See [std::fs::metadata] - /// - /// # Errors - /// See [std::fs::metadata] - /// ## Warning - /// Use `&Path` instead of a generic `P: AsRef` here, - /// because object safety requirements, it is especially useful, when - /// you want to store multiple `dyn FileSystem` in a `Vec` or use a `ResolverGeneric` in - /// napi env. - fn metadata(&self, path: &Path) -> io::Result; - - /// See [std::fs::symlink_metadata] - /// - /// # Errors - /// - /// See [std::fs::symlink_metadata] - /// ## Warning - /// Use `&Path` instead of a generic `P: AsRef` here, - /// because object safety requirements, it is especially useful, when - /// you want to store multiple `dyn FileSystem` in a `Vec` or use a `ResolverGeneric` in - /// napi env. - fn symlink_metadata(&self, path: &Path) -> io::Result; - - /// See [std::fs::canonicalize] - /// - /// # Errors - /// - /// See [std::fs::read_link] - /// ## Warning - /// Use `&Path` instead of a generic `P: AsRef` here, - /// because object safety requirements, it is especially useful, when - /// you want to store multiple `dyn FileSystem` in a `Vec` or use a `ResolverGeneric` in - /// napi env. - fn canonicalize(&self, path: &Path) -> io::Result; -} - -/// Metadata information about a file -#[derive(Debug, Clone, Copy)] -pub struct FileMetadata { - pub(crate) is_file: bool, - pub(crate) is_dir: bool, - pub(crate) is_symlink: bool, -} - -impl FileMetadata { - pub fn new(is_file: bool, is_dir: bool, is_symlink: bool) -> Self { - Self { is_file, is_dir, is_symlink } - } -} - -impl From for FileMetadata { - fn from(metadata: fs::Metadata) -> Self { - Self::new(metadata.is_file(), metadata.is_dir(), metadata.is_symlink()) - } -} - -/// Operating System -#[derive(Default)] -pub struct FileSystemOs; - -impl FileSystem for FileSystemOs { - fn read_to_string(&self, path: &Path) -> io::Result { - fs::read_to_string(path) - } - - fn metadata(&self, path: &Path) -> io::Result { - fs::metadata(path).map(FileMetadata::from) - } - - fn symlink_metadata(&self, path: &Path) -> io::Result { - fs::symlink_metadata(path).map(FileMetadata::from) - } - - fn canonicalize(&self, path: &Path) -> io::Result { - #[cfg(not(target_os = "wasi"))] - { - dunce::canonicalize(path) - } - #[cfg(target_os = "wasi")] - { - let meta = fs::symlink_metadata(path)?; - if meta.file_type().is_symlink() { - let link = fs::read_link(path)?; - let mut path_buf = path.to_path_buf(); - path_buf.pop(); - for segment in link.iter() { - match segment.to_str() { - Some("..") => { - path_buf.pop(); - } - Some(".") | None => {} - Some(seg) => { - // Need to trim the extra \0 introduces by rust std rust-lang/rust#123727 - path_buf.push(seg.trim_end_matches('\0')); - } - } - } - Ok(path_buf) - } else { - Ok(path.to_path_buf()) - } - } - } -} - -#[test] -fn metadata() { - let meta = FileMetadata { is_file: true, is_dir: true, is_symlink: true }; - assert_eq!( - format!("{meta:?}"), - "FileMetadata { is_file: true, is_dir: true, is_symlink: true }" - ); - let _ = meta; -} diff --git a/src/lib.rs b/src/lib.rs deleted file mode 100644 index 8ec2ad8a..00000000 --- a/src/lib.rs +++ /dev/null @@ -1,1670 +0,0 @@ -//! # Oxc Resolver -//! -//! Node.js [CommonJS][cjs] and [ECMAScript][esm] Module Resolution. -//! -//! A module resolution is the process of finding the file referenced by a module specifier in -//! `import "specifier"` or `require("specifier")`. -//! -//! All [configuration options](ResolveOptions) are aligned with webpack's [enhanced-resolve]. -//! -//! ## Terminology -//! -//! ### Specifier -//! -//! For [CommonJS modules][cjs], -//! the specifier is the string passed to the `require` function. e.g. `"id"` in `require("id")`. -//! -//! For [ECMAScript modules][esm], -//! the specifier of an `import` statement is the string after the `from` keyword, -//! e.g. `'specifier'` in `import 'specifier'` or `import { sep } from 'specifier'`. -//! Specifiers are also used in export from statements, and as the argument to an `import()` expression. -//! -//! This is also named "request" in some places. -//! -//! ## References: -//! -//! * Algorithm adapted from Node.js [CommonJS Module Resolution Algorithm] and [ECMAScript Module Resolution Algorithm]. -//! * Tests are ported from [enhanced-resolve]. -//! * Some code is adapted from [parcel-resolver]. -//! * The documentation is copied from [webpack's resolve configuration](https://webpack.js.org/configuration/resolve). -//! -//! [enhanced-resolve]: https://github.com/webpack/enhanced-resolve -//! [CommonJS Module Resolution Algorithm]: https://nodejs.org/api/modules.html#all-together -//! [ECMAScript Module Resolution Algorithm]: https://nodejs.org/api/esm.html#resolution-algorithm-specification -//! [parcel-resolver]: https://github.com/parcel-bundler/parcel/blob/v2/packages/utils/node-resolver-rs -//! [cjs]: https://nodejs.org/api/modules.html -//! [esm]: https://nodejs.org/api/esm.html -//! -//! ## Feature flags -#![cfg_attr(feature = "document-features", doc = document_features::document_features!())] -#![cfg_attr(docsrs, feature(doc_auto_cfg))] -//! -//! ## Example -//! -//! ```rust,ignore -#![doc = include_str!("../examples/resolver.rs")] -//! ``` - -mod builtins; -mod cache; -mod context; -mod error; -mod file_system; -mod options; -mod package_json; -mod path; -mod resolution; -mod specifier; -mod tsconfig; - -#[cfg(test)] -mod tests; - -use std::{ - borrow::Cow, - cmp::Ordering, - ffi::OsStr, - fmt, - path::{Component, Path, PathBuf}, - sync::Arc, -}; - -use rustc_hash::FxHashSet; -use serde_json::Value as JSONValue; -use typescript_tsconfig_json::ExtendsField; - -pub use crate::{ - builtins::NODEJS_BUILTINS, - error::{JSONError, ResolveError, SpecifierError}, - file_system::{FileMetadata, FileSystem}, - options::{ - Alias, AliasValue, EnforceExtension, ResolveOptions, Restriction, TsconfigOptions, - TsconfigReferences, - }, - package_json::PackageJson, - resolution::Resolution, -}; -use crate::{ - cache::{Cache, CachedPath}, - context::ResolveContext as Ctx, - file_system::FileSystemOs, - package_json::JSONMap, - path::{PathUtil, SLASH_START}, - specifier::Specifier, - tsconfig::{ProjectReference, TsConfig}, -}; - -type ResolveResult = Result, ResolveError>; - -/// Context returned from the [Resolver::resolve_with_context] API -#[derive(Debug, Default, Clone)] -pub struct ResolveContext { - /// Files that was found on file system - pub file_dependencies: FxHashSet, - - /// Dependencies that was not found on file system - pub missing_dependencies: FxHashSet, -} - -/// Resolver with the current operating system as the file system -pub type Resolver = ResolverGeneric; - -/// Generic implementation of the resolver, can be configured by the [FileSystem] trait -pub struct ResolverGeneric { - options: ResolveOptions, - cache: Arc>, -} - -impl fmt::Debug for ResolverGeneric { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - self.options.fmt(f) - } -} - -impl Default for ResolverGeneric { - fn default() -> Self { - Self::new(ResolveOptions::default()) - } -} - -impl ResolverGeneric { - pub fn new(options: ResolveOptions) -> Self { - Self { options: options.sanitize(), cache: Arc::new(Cache::new(Fs::default())) } - } -} - -impl ResolverGeneric { - pub fn new_with_file_system(file_system: Fs, options: ResolveOptions) -> Self { - Self { cache: Arc::new(Cache::new(file_system)), options: options.sanitize() } - } - - /// Clone the resolver using the same underlying cache. - #[must_use] - pub fn clone_with_options(&self, options: ResolveOptions) -> Self { - Self { options: options.sanitize(), cache: Arc::clone(&self.cache) } - } - - /// Returns the options. - pub fn options(&self) -> &ResolveOptions { - &self.options - } - - /// Clear the underlying cache. - pub fn clear_cache(&self) { - self.cache.clear(); - } - - /// Resolve `specifier` at an absolute `path`. - /// - /// A specifier is the string passed to require or import, i.e. `require("specifier")` or `import "specifier"`. - /// - /// `path` must be an **absolute** path to a directory where the specifier is resolved against. - /// For CommonJS modules, it is the `__dirname` variable that contains the absolute path to the folder containing current module. - /// For ECMAScript modules, it is the value of `import.meta.url`. - /// - /// # Errors - /// - /// * See [ResolveError] - pub fn resolve>( - &self, - path: P, - specifier: &str, - ) -> Result { - let mut ctx = Ctx::default(); - self.resolve_tracing(path.as_ref(), specifier, &mut ctx) - } - - /// Resolve `specifier` at absolute `path` with [ResolveContext] - /// - /// # Errors - /// - /// * See [ResolveError] - pub fn resolve_with_context>( - &self, - path: P, - specifier: &str, - resolve_context: &mut ResolveContext, - ) -> Result { - let mut ctx = Ctx::default(); - ctx.init_file_dependencies(); - let result = self.resolve_tracing(path.as_ref(), specifier, &mut ctx); - if let Some(deps) = &mut ctx.file_dependencies { - resolve_context.file_dependencies.extend(deps.drain(..)); - } - if let Some(deps) = &mut ctx.missing_dependencies { - resolve_context.missing_dependencies.extend(deps.drain(..)); - } - result - } - - /// Wrap `resolve_impl` with `tracing` information - fn resolve_tracing( - &self, - path: &Path, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - let span = tracing::debug_span!("resolve", path = ?path, specifier = specifier); - let _enter = span.enter(); - let r = self.resolve_impl(path, specifier, ctx); - match &r { - Ok(r) => { - tracing::debug!(options = ?self.options, path = ?path, specifier = specifier, ret = ?r.path); - } - Err(err) => { - tracing::debug!(options = ?self.options, path = ?path, specifier = specifier, err = ?err); - } - }; - r - } - - fn resolve_impl( - &self, - path: &Path, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - ctx.with_fully_specified(self.options.fully_specified); - let cached_path = self.cache.value(path); - let cached_path = self.require(&cached_path, specifier, ctx)?; - let path = self.load_realpath(&cached_path)?; - // enhanced-resolve: restrictions - self.check_restrictions(&path)?; - let package_json = cached_path.find_package_json(&self.cache.fs, &self.options, ctx)?; - if let Some(package_json) = &package_json { - // path must be inside the package. - debug_assert!(path.starts_with(package_json.directory())); - } - Ok(Resolution { - path, - query: ctx.query.take(), - fragment: ctx.fragment.take(), - package_json, - }) - } - - /// require(X) from module at path Y - /// - /// X: specifier - /// Y: path - /// - /// - fn require( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - ctx.test_for_infinite_recursion()?; - - // enhanced-resolve: parse - let (parsed, try_fragment_as_path) = self.load_parse(cached_path, specifier, ctx)?; - if let Some(path) = try_fragment_as_path { - return Ok(path); - } - - self.require_without_parse(cached_path, parsed.path(), ctx) - } - - fn require_without_parse( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - // tsconfig-paths - if let Some(path) = self.load_tsconfig_paths(cached_path, specifier, &mut Ctx::default())? { - return Ok(path); - } - - // enhanced-resolve: try alias - if let Some(path) = self.load_alias(cached_path, specifier, &self.options.alias, ctx)? { - return Ok(path); - } - - let result = match Path::new(specifier).components().next() { - // 2. If X begins with '/' - Some(Component::RootDir | Component::Prefix(_)) => { - self.require_absolute(cached_path, specifier, ctx) - } - // 3. If X begins with './' or '/' or '../' - Some(Component::CurDir | Component::ParentDir) => { - self.require_relative(cached_path, specifier, ctx) - } - // 4. If X begins with '#' - Some(Component::Normal(_)) if specifier.as_bytes()[0] == b'#' => { - self.require_hash(cached_path, specifier, ctx) - } - _ => { - // 1. If X is a core module, - // a. return the core module - // b. STOP - self.require_core(specifier)?; - - // (ESM) 5. Otherwise, - // Note: specifier is now a bare specifier. - // Set resolved the result of PACKAGE_RESOLVE(specifier, parentURL). - self.require_bare(cached_path, specifier, ctx) - } - }; - - result.or_else(|err| { - if err.is_ignore() { - return Err(err); - } - // enhanced-resolve: try fallback - self.load_alias(cached_path, specifier, &self.options.fallback, ctx) - .and_then(|value| value.ok_or(err)) - }) - } - - // PACKAGE_RESOLVE(packageSpecifier, parentURL) - // 3. If packageSpecifier is a Node.js builtin module name, then - // 1. Return the string "node:" concatenated with packageSpecifier. - fn require_core(&self, specifier: &str) -> Result<(), ResolveError> { - if self.options.builtin_modules { - let starts_with_node = specifier.starts_with("node:"); - if starts_with_node || NODEJS_BUILTINS.binary_search(&specifier).is_ok() { - let mut specifier = specifier.to_string(); - if !starts_with_node { - specifier = format!("node:{specifier}"); - } - return Err(ResolveError::Builtin(specifier)); - } - } - Ok(()) - } - - fn require_absolute( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - // Make sure only path prefixes gets called - debug_assert!(Path::new(specifier) - .components() - .next() - .is_some_and(|c| matches!(c, Component::RootDir | Component::Prefix(_)))); - if !self.options.prefer_relative && self.options.prefer_absolute { - if let Ok(path) = self.load_package_self_or_node_modules(cached_path, specifier, ctx) { - return Ok(path); - } - } - if let Some(path) = self.load_roots(specifier, ctx) { - return Ok(path); - } - // 2. If X begins with '/' - // a. set Y to be the file system root - let path = self.cache.value(Path::new(specifier)); - if let Some(path) = self.load_as_file_or_directory(&path, specifier, ctx)? { - return Ok(path); - } - Err(ResolveError::NotFound(specifier.to_string())) - } - - // 3. If X begins with './' or '/' or '../' - fn require_relative( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - // Make sure only relative or normal paths gets called - debug_assert!(Path::new(specifier).components().next().is_some_and(|c| matches!( - c, - Component::CurDir | Component::ParentDir | Component::Normal(_) - ))); - let path = cached_path.path().normalize_with(specifier); - let cached_path = self.cache.value(&path); - // a. LOAD_AS_FILE(Y + X) - // b. LOAD_AS_DIRECTORY(Y + X) - if let Some(path) = self.load_as_file_or_directory(&cached_path, specifier, ctx)? { - return Ok(path); - } - // c. THROW "not found" - Err(ResolveError::NotFound(specifier.to_string())) - } - - fn require_hash( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - debug_assert_eq!(specifier.chars().next(), Some('#')); - // a. LOAD_PACKAGE_IMPORTS(X, dirname(Y)) - if let Some(path) = self.load_package_imports(cached_path, specifier, ctx)? { - return Ok(path); - } - self.load_package_self_or_node_modules(cached_path, specifier, ctx) - } - - fn require_bare( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - // Make sure no other path prefixes gets called - debug_assert!(Path::new(specifier) - .components() - .next() - .is_some_and(|c| matches!(c, Component::Normal(_)))); - if self.options.prefer_relative { - if let Ok(path) = self.require_relative(cached_path, specifier, ctx) { - return Ok(path); - } - } - self.load_package_self_or_node_modules(cached_path, specifier, ctx) - } - - /// enhanced-resolve: ParsePlugin. - /// - /// 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`. - /// - /// - fn load_parse<'s>( - &self, - cached_path: &CachedPath, - specifier: &'s str, - ctx: &mut Ctx, - ) -> Result<(Specifier<'s>, Option), ResolveError> { - let parsed = Specifier::parse(specifier).map_err(ResolveError::Specifier)?; - ctx.with_query_fragment(parsed.query, parsed.fragment); - - // There is an edge-case where a request with # can be a path or a fragment -> try both - if ctx.fragment.is_some() && ctx.query.is_none() { - let specifier = parsed.path(); - let fragment = ctx.fragment.take().unwrap(); - let path = format!("{specifier}{fragment}"); - if let Ok(path) = self.require_without_parse(cached_path, &path, ctx) { - return Ok((parsed, Some(path))); - } - ctx.fragment.replace(fragment); - } - Ok((parsed, None)) - } - - fn load_package_self_or_node_modules( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - let (_, subpath) = Self::parse_package_specifier(specifier); - if subpath.is_empty() { - ctx.with_fully_specified(false); - } - // 5. LOAD_PACKAGE_SELF(X, dirname(Y)) - if let Some(path) = self.load_package_self(cached_path, specifier, ctx)? { - return Ok(path); - } - // 6. LOAD_NODE_MODULES(X, dirname(Y)) - if let Some(path) = self.load_node_modules(cached_path, specifier, ctx)? { - return Ok(path); - } - // 7. THROW "not found" - Err(ResolveError::NotFound(specifier.to_string())) - } - - /// LOAD_PACKAGE_IMPORTS(X, DIR) - fn load_package_imports( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - // 1. Find the closest package scope SCOPE to DIR. - // 2. If no scope was found, return. - let Some(package_json) = - cached_path.find_package_json(&self.cache.fs, &self.options, ctx)? - else { - return Ok(None); - }; - // 3. If the SCOPE/package.json "imports" is null or undefined, return. - // 4. let MATCH = PACKAGE_IMPORTS_RESOLVE(X, pathToFileURL(SCOPE), ["node", "require"]) defined in the ESM resolver. - if let Some(path) = self.package_imports_resolve(specifier, &package_json, ctx)? { - // 5. RESOLVE_ESM_MATCH(MATCH). - return self.resolve_esm_match(specifier, &path, ctx); - } - Ok(None) - } - - fn load_as_file(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - // enhanced-resolve feature: extension_alias - if let Some(path) = self.load_extension_alias(cached_path, ctx)? { - return Ok(Some(path)); - } - if self.options.enforce_extension.is_disabled() { - // 1. If X is a file, load X as its file extension format. STOP - if let Some(path) = self.load_alias_or_file(cached_path, ctx)? { - return Ok(Some(path)); - } - } - // 2. If X.js is a file, load X.js as JavaScript text. STOP - // 3. If X.json is a file, parse X.json to a JavaScript Object. STOP - // 4. If X.node is a file, load X.node as binary addon. STOP - if let Some(path) = - self.load_extensions(cached_path.path(), &self.options.extensions, ctx)? - { - return Ok(Some(path)); - } - Ok(None) - } - - fn load_as_directory(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - // TODO: Only package.json is supported, so warn about having other values - // Checking for empty files is needed for omitting checks on package.json - // 1. If X/package.json is a file, - if !self.options.description_files.is_empty() { - // a. Parse X/package.json, and look for "main" field. - if let Some(package_json) = - cached_path.package_json(&self.cache.fs, &self.options, ctx)? - { - // b. If "main" is a falsy value, GOTO 2. - for main_field in package_json.main_fields(&self.options.main_fields) { - // c. let M = X + (json main field) - let main_field_path = cached_path.path().normalize_with(main_field); - // d. LOAD_AS_FILE(M) - let cached_path = self.cache.value(&main_field_path); - if let Some(path) = self.load_as_file(&cached_path, ctx)? { - return Ok(Some(path)); - } - // e. LOAD_INDEX(M) - if let Some(path) = self.load_index(&cached_path, ctx)? { - return Ok(Some(path)); - } - } - // f. LOAD_INDEX(X) DEPRECATED - // g. THROW "not found" - } - } - // 2. LOAD_INDEX(X) - self.load_index(cached_path, ctx) - } - - fn load_as_file_or_directory( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - if self.options.resolve_to_context { - return Ok(cached_path.is_dir(&self.cache.fs, ctx).then(|| cached_path.clone())); - } - if !specifier.ends_with('/') { - if let Some(path) = self.load_as_file(cached_path, ctx)? { - return Ok(Some(path)); - } - } - if cached_path.is_dir(&self.cache.fs, ctx) { - if let Some(path) = self.load_as_directory(cached_path, ctx)? { - return Ok(Some(path)); - } - } - Ok(None) - } - - fn load_extensions(&self, path: &Path, extensions: &[String], ctx: &mut Ctx) -> ResolveResult { - if ctx.fully_specified { - return Ok(None); - } - let path = path.as_os_str(); - for extension in extensions { - let mut path_with_extension = path.to_os_string(); - path_with_extension.reserve_exact(extension.len()); - path_with_extension.push(extension); - let cached_path = self.cache.value(Path::new(&path_with_extension)); - if let Some(path) = self.load_alias_or_file(&cached_path, ctx)? { - return Ok(Some(path)); - } - } - Ok(None) - } - - fn load_realpath(&self, cached_path: &CachedPath) -> Result { - if self.options.symlinks { - cached_path.realpath(&self.cache.fs).map_err(ResolveError::from) - } else { - Ok(cached_path.to_path_buf()) - } - } - - fn check_restrictions(&self, path: &Path) -> Result<(), ResolveError> { - // https://github.com/webpack/enhanced-resolve/blob/a998c7d218b7a9ec2461fc4fddd1ad5dd7687485/lib/RestrictionsPlugin.js#L19-L24 - fn is_inside(path: &Path, parent: &Path) -> bool { - if !path.starts_with(parent) { - return false; - } - if path.as_os_str().len() == parent.as_os_str().len() { - return true; - } - path.strip_prefix(parent).is_ok_and(|p| p == Path::new("./")) - } - for restriction in &self.options.restrictions { - match restriction { - Restriction::Path(restricted_path) => { - if !is_inside(path, restricted_path) { - return Err(ResolveError::Restriction( - path.to_path_buf(), - restricted_path.clone(), - )); - } - } - Restriction::RegExp(_) => { - return Err(ResolveError::Unimplemented("Restriction with regex")) - } - } - } - Ok(()) - } - - fn load_index(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - for main_file in &self.options.main_files { - let main_path = cached_path.path().normalize_with(main_file); - let cached_path = self.cache.value(&main_path); - if self.options.enforce_extension.is_disabled() { - if let Some(path) = self.load_alias_or_file(&cached_path, ctx)? { - return Ok(Some(path)); - } - } - // 1. If X/index.js is a file, load X/index.js as JavaScript text. STOP - // 2. If X/index.json is a file, parse X/index.json to a JavaScript object. STOP - // 3. If X/index.node is a file, load X/index.node as binary addon. STOP - if let Some(path) = - self.load_extensions(cached_path.path(), &self.options.extensions, ctx)? - { - return Ok(Some(path)); - } - } - Ok(None) - } - - fn load_alias_or_file(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - if let Some(package_json) = - cached_path.find_package_json(&self.cache.fs, &self.options, ctx)? - { - if let Some(path) = self.load_browser_field(cached_path, None, &package_json, ctx)? { - return Ok(Some(path)); - } - } - // enhanced-resolve: try file as alias - let alias_specifier = cached_path.path().to_string_lossy(); - if let Some(path) = - self.load_alias(cached_path, &alias_specifier, &self.options.alias, ctx)? - { - return Ok(Some(path)); - } - if cached_path.is_file(&self.cache.fs, ctx) { - return Ok(Some(cached_path.clone())); - } - Ok(None) - } - - fn load_node_modules( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - let (package_name, subpath) = Self::parse_package_specifier(specifier); - // 1. let DIRS = NODE_MODULES_PATHS(START) - // 2. for each DIR in DIRS: - for module_name in &self.options.modules { - for cached_path in std::iter::successors(Some(cached_path), |p| p.parent()) { - // Skip if /path/to/node_modules does not exist - if !cached_path.is_dir(&self.cache.fs, ctx) { - continue; - } - - let Some(cached_path) = self.get_module_directory(cached_path, module_name, ctx) - else { - continue; - }; - // Optimize node_modules lookup by inspecting whether the package exists - // From LOAD_PACKAGE_EXPORTS(X, DIR) - // 1. Try to interpret X as a combination of NAME and SUBPATH where the name - // may have a @scope/ prefix and the subpath begins with a slash (`/`). - if !package_name.is_empty() { - let package_path = cached_path.path().normalize_with(package_name); - let cached_path = self.cache.value(&package_path); - // Try foo/node_modules/package_name - if cached_path.is_dir(&self.cache.fs, ctx) { - // a. LOAD_PACKAGE_EXPORTS(X, DIR) - if let Some(path) = - self.load_package_exports(specifier, subpath, &cached_path, ctx)? - { - return Ok(Some(path)); - } - } else { - // foo/node_modules/package_name is not a directory, so useless to check inside it - if !subpath.is_empty() { - continue; - } - // Skip if the directory lead to the scope package does not exist - // i.e. `foo/node_modules/@scope` is not a directory for `foo/node_modules/@scope/package` - if package_name.starts_with('@') { - if let Some(path) = cached_path.parent() { - if !path.is_dir(&self.cache.fs, ctx) { - continue; - } - } - } - } - } - - // Try as file or directory for all other cases - // b. LOAD_AS_FILE(DIR/X) - // c. LOAD_AS_DIRECTORY(DIR/X) - let node_module_file = cached_path.path().normalize_with(specifier); - let cached_path = self.cache.value(&node_module_file); - if let Some(path) = self.load_as_file_or_directory(&cached_path, specifier, ctx)? { - return Ok(Some(path)); - } - } - } - Ok(None) - } - - fn get_module_directory( - &self, - cached_path: &CachedPath, - module_name: &str, - ctx: &mut Ctx, - ) -> Option { - if cached_path.path().ends_with(module_name) { - Some(cached_path.clone()) - } else if module_name == "node_modules" { - cached_path.cached_node_modules(&self.cache, ctx) - } else { - cached_path.module_directory(module_name, &self.cache, ctx) - } - } - - fn load_package_exports( - &self, - specifier: &str, - subpath: &str, - cached_path: &CachedPath, - ctx: &mut Ctx, - ) -> ResolveResult { - // 2. If X does not match this pattern or DIR/NAME/package.json is not a file, - // return. - let Some(package_json) = cached_path.package_json(&self.cache.fs, &self.options, ctx)? - else { - return Ok(None); - }; - // 3. Parse DIR/NAME/package.json, and look for "exports" field. - // 4. If "exports" is null or undefined, return. - // 5. let MATCH = PACKAGE_EXPORTS_RESOLVE(pathToFileURL(DIR/NAME), "." + SUBPATH, - // `package.json` "exports", ["node", "require"]) defined in the ESM resolver. - // Note: The subpath is not prepended with a dot on purpose - for exports in package_json.exports_fields(&self.options.exports_fields) { - if let Some(path) = self.package_exports_resolve( - cached_path.path(), - &format!(".{subpath}"), - exports, - ctx, - )? { - // 6. RESOLVE_ESM_MATCH(MATCH) - return self.resolve_esm_match(specifier, &path, ctx); - }; - } - Ok(None) - } - - fn load_package_self( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - // 1. Find the closest package scope SCOPE to DIR. - // 2. If no scope was found, return. - let Some(package_json) = - cached_path.find_package_json(&self.cache.fs, &self.options, ctx)? - else { - return Ok(None); - }; - // 3. If the SCOPE/package.json "exports" is null or undefined, return. - // 4. If the SCOPE/package.json "name" is not the first segment of X, return. - if let Some(subpath) = package_json - .name - .as_ref() - .and_then(|package_name| Self::strip_package_name(specifier, package_name)) - { - // 5. let MATCH = PACKAGE_EXPORTS_RESOLVE(pathToFileURL(SCOPE), - // "." + X.slice("name".length), `package.json` "exports", ["node", "require"]) - // defined in the ESM resolver. - let package_url = package_json.directory(); - // Note: The subpath is not prepended with a dot on purpose - // because `package_exports_resolve` matches subpath without the leading dot. - for exports in package_json.exports_fields(&self.options.exports_fields) { - if let Some(cached_path) = - self.package_exports_resolve(package_url, &format!(".{subpath}"), exports, ctx)? - { - // 6. RESOLVE_ESM_MATCH(MATCH) - return self.resolve_esm_match(specifier, &cached_path, ctx); - } - } - } - self.load_browser_field(cached_path, Some(specifier), &package_json, ctx) - } - - /// RESOLVE_ESM_MATCH(MATCH) - fn resolve_esm_match( - &self, - specifier: &str, - cached_path: &CachedPath, - ctx: &mut Ctx, - ) -> ResolveResult { - // 1. let RESOLVED_PATH = fileURLToPath(MATCH) - // 2. If the file at RESOLVED_PATH exists, load RESOLVED_PATH as its extension format. STOP - // - // Non-compliant ESM can result in a directory, so directory is tried as well. - if let Some(path) = self.load_as_file_or_directory(cached_path, "", ctx)? { - return Ok(Some(path)); - } - // 3. THROW "not found" - Err(ResolveError::NotFound(specifier.to_string())) - } - - /// enhanced-resolve: AliasFieldPlugin for [ResolveOptions::alias_fields] - fn load_browser_field( - &self, - cached_path: &CachedPath, - module_specifier: Option<&str>, - package_json: &PackageJson, - ctx: &mut Ctx, - ) -> ResolveResult { - let path = cached_path.path(); - let Some(new_specifier) = package_json.resolve_browser_field( - path, - module_specifier, - &self.options.alias_fields, - )? - else { - return Ok(None); - }; - // Abort when resolving recursive module - if module_specifier.is_some_and(|s| s == new_specifier) { - return Ok(None); - } - if ctx.resolving_alias.as_ref().is_some_and(|s| s == new_specifier) { - // Complete when resolving to self `{"./a.js": "./a.js"}` - if new_specifier.strip_prefix("./").filter(|s| path.ends_with(Path::new(s))).is_some() { - return if cached_path.is_file(&self.cache.fs, ctx) { - Ok(Some(cached_path.clone())) - } else { - Err(ResolveError::NotFound(new_specifier.to_string())) - }; - } - return Err(ResolveError::Recursion); - } - ctx.with_resolving_alias(new_specifier.to_string()); - ctx.with_fully_specified(false); - let cached_path = self.cache.value(package_json.directory()); - self.require(&cached_path, new_specifier, ctx).map(Some) - } - - /// enhanced-resolve: AliasPlugin for [ResolveOptions::alias] and [ResolveOptions::fallback]. - fn load_alias( - &self, - cached_path: &CachedPath, - specifier: &str, - aliases: &Alias, - ctx: &mut Ctx, - ) -> ResolveResult { - for (alias_key_raw, specifiers) in aliases { - let alias_key = if let Some(alias_key) = alias_key_raw.strip_suffix('$') { - if alias_key != specifier { - continue; - } - alias_key - } else { - let strip_package_name = Self::strip_package_name(specifier, alias_key_raw); - if strip_package_name.is_none() { - continue; - } - alias_key_raw - }; - // It should stop resolving when all of the tried alias values - // failed to resolve. - // - let mut should_stop = false; - for r in specifiers { - match r { - AliasValue::Path(alias_value) => { - if let Some(path) = self.load_alias_value( - cached_path, - alias_key, - alias_value, - specifier, - ctx, - &mut should_stop, - )? { - return Ok(Some(path)); - } - } - AliasValue::Ignore => { - let path = cached_path.path().normalize_with(alias_key); - return Err(ResolveError::Ignored(path)); - } - } - } - if should_stop { - return Err(ResolveError::NotFound(specifier.to_string())); - } - } - Ok(None) - } - - fn load_alias_value( - &self, - cached_path: &CachedPath, - alias_key: &str, - alias_value: &str, - request: &str, - ctx: &mut Ctx, - should_stop: &mut bool, - ) -> ResolveResult { - if request != alias_value - && !request.strip_prefix(alias_value).is_some_and(|prefix| prefix.starts_with('/')) - { - let tail = &request[alias_key.len()..]; - - let new_specifier = if tail.is_empty() { - Cow::Borrowed(alias_value) - } else { - let alias_value = Path::new(alias_value).normalize(); - // Must not append anything to alias_value if it is a file. - let alias_value_cached_path = self.cache.value(&alias_value); - if alias_value_cached_path.is_file(&self.cache.fs, ctx) { - return Ok(None); - } - - // Remove the leading slash so the final path is concatenated. - let tail = tail.trim_start_matches(SLASH_START); - let normalized = alias_value.normalize_with(tail); - Cow::Owned(normalized.to_string_lossy().to_string()) - }; - - *should_stop = true; - ctx.with_fully_specified(false); - return match self.require(cached_path, new_specifier.as_ref(), ctx) { - Err(ResolveError::NotFound(_)) => Ok(None), - Ok(path) => return Ok(Some(path)), - Err(err) => return Err(err), - }; - } - Ok(None) - } - - /// Given an extension alias map `{".js": [".ts", "js"]}`, - /// load the mapping instead of the provided extension - /// - /// This is an enhanced-resolve feature - /// - /// # Errors - /// - /// * [ResolveError::ExtensionAlias]: When all of the aliased extensions are not found - fn load_extension_alias(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - let Some(path_extension) = cached_path.path().extension() else { - return Ok(None); - }; - let Some((_, extensions)) = self - .options - .extension_alias - .iter() - .find(|(ext, _)| OsStr::new(ext.trim_start_matches('.')) == path_extension) - else { - return Ok(None); - }; - let path = cached_path.path().with_extension(""); - ctx.with_fully_specified(false); - if let Some(path) = self.load_extensions(&path, extensions, ctx)? { - return Ok(Some(path)); - } - Err(ResolveError::ExtensionAlias) - } - - /// enhanced-resolve: RootsPlugin - /// - /// A list of directories where requests of server-relative URLs (starting with '/') are resolved, - /// defaults to context configuration option. - /// - /// On non-Windows systems these requests are resolved as an absolute path first. - fn load_roots(&self, specifier: &str, ctx: &mut Ctx) -> Option { - if !self.options.roots.is_empty() { - if let Some(specifier) = specifier.strip_prefix(SLASH_START) { - for root in &self.options.roots { - let cached_path = self.cache.value(root); - if let Ok(path) = self.require_relative(&cached_path, specifier, ctx) { - return Some(path); - } - } - } - } - None - } - - fn load_tsconfig_paths( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - let Some(tsconfig_options) = &self.options.tsconfig else { - return Ok(None); - }; - let tsconfig = self.load_tsconfig( - /* root */ true, - &tsconfig_options.config_file, - &tsconfig_options.references, - )?; - let paths = tsconfig.resolve(cached_path.path(), specifier); - for path in paths { - let cached_path = self.cache.value(&path); - if let Ok(path) = self.require_relative(&cached_path, ".", ctx) { - return Ok(Some(path)); - } - } - Ok(None) - } - - fn load_tsconfig( - &self, - root: bool, - path: &Path, - references: &TsconfigReferences, - ) -> Result, ResolveError> { - self.cache.tsconfig(root, path, |tsconfig| { - let directory = self.cache.value(tsconfig.directory()); - tracing::trace!(tsconfig = ?tsconfig, "load_tsconfig"); - - // Extend tsconfig - if let Some(extends) = &tsconfig.extends { - let extended_tsconfig_paths = match extends { - ExtendsField::Single(s) => { - vec![self.get_extended_tsconfig_path(&directory, tsconfig, s)?] - } - ExtendsField::Multiple(specifiers) => specifiers - .iter() - .map(|s| self.get_extended_tsconfig_path(&directory, tsconfig, s)) - .collect::, ResolveError>>()?, - }; - for extended_tsconfig_path in extended_tsconfig_paths { - let extended_tsconfig = self.load_tsconfig( - /* root */ false, - &extended_tsconfig_path, - &TsconfigReferences::Disabled, - )?; - tsconfig.extend_tsconfig(&extended_tsconfig); - } - } - - // Load project references - match references { - TsconfigReferences::Disabled => { - tsconfig.references.drain(..); - } - TsconfigReferences::Auto => {} - TsconfigReferences::Paths(paths) => { - tsconfig.references = paths - .iter() - .map(|path| ProjectReference { path: path.clone(), tsconfig: None }) - .collect(); - } - } - if !tsconfig.references.is_empty() { - let directory = tsconfig.directory().to_path_buf(); - for reference in &mut tsconfig.references { - let reference_tsconfig_path = directory.normalize_with(&reference.path); - let tsconfig = self.cache.tsconfig( - /* root */ true, - &reference_tsconfig_path, - |_| Ok(()), - )?; - reference.tsconfig.replace(tsconfig); - } - } - Ok(()) - }) - } - - fn get_extended_tsconfig_path( - &self, - directory: &CachedPath, - tsconfig: &TsConfig, - specifier: &str, - ) -> Result { - match specifier.as_bytes().first() { - None => Err(ResolveError::Specifier(SpecifierError::Empty(specifier.to_string()))), - Some(b'/') => Ok(PathBuf::from(specifier)), - Some(b'.') => Ok(tsconfig.directory().normalize_with(specifier)), - _ => self - .clone_with_options(ResolveOptions { - description_files: vec![], - extensions: vec![".json".into()], - main_files: vec!["tsconfig.json".into()], - ..ResolveOptions::default() - }) - .load_package_self_or_node_modules(directory, specifier, &mut Ctx::default()) - .map(|p| p.to_path_buf()) - .map_err(|err| match err { - ResolveError::NotFound(_) => { - ResolveError::TsconfigNotFound(PathBuf::from(specifier)) - } - _ => err, - }), - } - } - - /// PACKAGE_RESOLVE(packageSpecifier, parentURL) - fn package_resolve( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - let (package_name, subpath) = Self::parse_package_specifier(specifier); - - // 3. If packageSpecifier is a Node.js builtin module name, then - // 1. Return the string "node:" concatenated with packageSpecifier. - self.require_core(package_name)?; - - // 11. While parentURL is not the file system root, - for module_name in &self.options.modules { - for cached_path in std::iter::successors(Some(cached_path), |p| p.parent()) { - // 1. Let packageURL be the URL resolution of "node_modules/" concatenated with packageSpecifier, relative to parentURL. - let Some(cached_path) = self.get_module_directory(cached_path, module_name, ctx) - else { - continue; - }; - // 2. Set parentURL to the parent folder URL of parentURL. - let package_path = cached_path.path().normalize_with(package_name); - let cached_path = self.cache.value(&package_path); - // 3. If the folder at packageURL does not exist, then - // 1. Continue the next loop iteration. - if cached_path.is_dir(&self.cache.fs, ctx) { - // 4. Let pjson be the result of READ_PACKAGE_JSON(packageURL). - if let Some(package_json) = - cached_path.package_json(&self.cache.fs, &self.options, ctx)? - { - // 5. If pjson is not null and pjson.exports is not null or undefined, then - // 1. Return the result of PACKAGE_EXPORTS_RESOLVE(packageURL, packageSubpath, pjson.exports, defaultConditions). - for exports in package_json.exports_fields(&self.options.exports_fields) { - if let Some(path) = self.package_exports_resolve( - cached_path.path(), - &format!(".{subpath}"), - exports, - ctx, - )? { - return Ok(Some(path)); - } - } - // 6. Otherwise, if packageSubpath is equal to ".", then - if subpath == "." { - // 1. If pjson.main is a string, then - for main_field in package_json.main_fields(&self.options.main_fields) { - // 1. Return the URL resolution of main in packageURL. - let path = cached_path.path().normalize_with(main_field); - let cached_path = self.cache.value(&path); - if cached_path.is_file(&self.cache.fs, ctx) { - return Ok(Some(cached_path)); - } - } - } - } - let subpath = format!(".{subpath}"); - ctx.with_fully_specified(false); - return self.require(&cached_path, &subpath, ctx).map(Some); - } - } - } - - Err(ResolveError::NotFound(specifier.to_string())) - } - - /// PACKAGE_EXPORTS_RESOLVE(packageURL, subpath, exports, conditions) - fn package_exports_resolve( - &self, - package_url: &Path, - subpath: &str, - exports: &JSONValue, - ctx: &mut Ctx, - ) -> ResolveResult { - let conditions = &self.options.condition_names; - // 1. If exports is an Object with both a key starting with "." and a key not starting with ".", throw an Invalid Package Configuration error. - if let JSONValue::Object(map) = exports { - let mut has_dot = false; - let mut without_dot = false; - for key in map.keys() { - has_dot = has_dot || key.starts_with(|s| s == '.' || s == '#'); - without_dot = without_dot || !key.starts_with(|s| s == '.' || s == '#'); - if has_dot && without_dot { - return Err(ResolveError::InvalidPackageConfig( - package_url.join("package.json"), - )); - } - } - } - // 2. If subpath is equal to ".", then - // Note: subpath is not prepended with a dot when passed in. - if subpath == "." { - // enhanced-resolve appends query and fragment when resolving exports field - // https://github.com/webpack/enhanced-resolve/blob/a998c7d218b7a9ec2461fc4fddd1ad5dd7687485/lib/ExportsFieldPlugin.js#L57-L62 - // This is only need when querying the main export, otherwise ctx is passed through. - if ctx.query.is_some() || ctx.fragment.is_some() { - let query = ctx.query.clone().unwrap_or_default(); - let fragment = ctx.fragment.clone().unwrap_or_default(); - return Err(ResolveError::PackagePathNotExported( - format!("./{}{query}{fragment}", subpath.trim_start_matches('.')), - package_url.join("package.json"), - )); - } - // 1. Let mainExport be undefined. - let main_export = match exports { - // 2. If exports is a String or Array, or an Object containing no keys starting with ".", then - JSONValue::String(_) | JSONValue::Array(_) => { - // 1. Set mainExport to exports. - Some(exports) - } - // 3. Otherwise if exports is an Object containing a "." property, then - JSONValue::Object(map) => { - // 1. Set mainExport to exports["."]. - map.get(".").map_or_else( - || { - if map.keys().any(|key| key.starts_with("./") || key.starts_with('#')) { - None - } else { - Some(exports) - } - }, - Some, - ) - } - _ => None, - }; - // 4. If mainExport is not undefined, then - if let Some(main_export) = main_export { - // 1. Let resolved be the result of PACKAGE_TARGET_RESOLVE( packageURL, mainExport, null, false, conditions). - let resolved = self.package_target_resolve( - package_url, - ".", - main_export, - None, - /* is_imports */ false, - conditions, - ctx, - )?; - // 2. If resolved is not null or undefined, return resolved. - if let Some(path) = resolved { - return Ok(Some(path)); - } - } - } - // 3. Otherwise, if exports is an Object and all keys of exports start with ".", then - if let JSONValue::Object(exports) = exports { - // 1. Let matchKey be the string "./" concatenated with subpath. - // Note: `package_imports_exports_resolve` does not require the leading dot. - let match_key = &subpath; - // 2. Let resolved be the result of PACKAGE_IMPORTS_EXPORTS_RESOLVE( matchKey, exports, packageURL, false, conditions). - if let Some(path) = self.package_imports_exports_resolve( - match_key, - exports, - package_url, - /* is_imports */ false, - conditions, - ctx, - )? { - // 3. If resolved is not null or undefined, return resolved. - return Ok(Some(path)); - } - } - // 4. Throw a Package Path Not Exported error. - Err(ResolveError::PackagePathNotExported( - subpath.to_string(), - package_url.join("package.json"), - )) - } - - /// PACKAGE_IMPORTS_RESOLVE(specifier, parentURL, conditions) - fn package_imports_resolve( - &self, - specifier: &str, - package_json: &PackageJson, - ctx: &mut Ctx, - ) -> Result, ResolveError> { - // 1. Assert: specifier begins with "#". - debug_assert!(specifier.starts_with('#'), "{specifier}"); - // 2. If specifier is exactly equal to "#" or starts with "#/", then - // 1. Throw an Invalid Module Specifier error. - // 3. Let packageURL be the result of LOOKUP_PACKAGE_SCOPE(parentURL). - // 4. If packageURL is not null, then - - // 1. Let pjson be the result of READ_PACKAGE_JSON(packageURL). - // 2. If pjson.imports is a non-null Object, then - - // 1. Let resolved be the result of PACKAGE_IMPORTS_EXPORTS_RESOLVE( specifier, pjson.imports, packageURL, true, conditions). - let mut has_imports = false; - for imports in package_json.imports_fields(&self.options.imports_fields) { - if !has_imports { - has_imports = true; - // TODO: fill in test case for this case - if specifier == "#" || specifier.starts_with("#/") { - return Err(ResolveError::InvalidModuleSpecifier( - specifier.to_string(), - package_json.path.clone(), - )); - } - } - if let Some(path) = self.package_imports_exports_resolve( - specifier, - imports, - package_json.directory(), - /* is_imports */ true, - &self.options.condition_names, - ctx, - )? { - // 2. If resolved is not null or undefined, return resolved. - return Ok(Some(path)); - } - } - - // 5. Throw a Package Import Not Defined error. - if has_imports { - Err(ResolveError::PackageImportNotDefined( - specifier.to_string(), - package_json.path.clone(), - )) - } else { - Ok(None) - } - } - - /// PACKAGE_IMPORTS_EXPORTS_RESOLVE(matchKey, matchObj, packageURL, isImports, conditions) - fn package_imports_exports_resolve( - &self, - match_key: &str, - match_obj: &JSONMap, - package_url: &Path, - is_imports: bool, - conditions: &[String], - ctx: &mut Ctx, - ) -> ResolveResult { - // enhanced-resolve behaves differently, it throws - // Error: CachedPath to directories is not possible with the exports field (specifier was ./dist/) - if match_key.ends_with('/') { - return Ok(None); - } - // 1. If matchKey is a key of matchObj and does not contain "*", then - if !match_key.contains('*') { - // 1. Let target be the value of matchObj[matchKey]. - if let Some(target) = match_obj.get(match_key) { - // 2. Return the result of PACKAGE_TARGET_RESOLVE(packageURL, target, null, isImports, conditions). - return self.package_target_resolve( - package_url, - match_key, - target, - None, - is_imports, - conditions, - ctx, - ); - } - } - - let mut best_target = None; - let mut best_match = ""; - let mut best_key = ""; - // 2. Let expansionKeys be the list of keys of matchObj containing only a single "*", sorted by the sorting function PATTERN_KEY_COMPARE which orders in descending order of specificity. - // 3. For each key expansionKey in expansionKeys, do - for (expansion_key, target) in match_obj { - if expansion_key.starts_with("./") || expansion_key.starts_with('#') { - // 1. Let patternBase be the substring of expansionKey up to but excluding the first "*" character. - if let Some((pattern_base, pattern_trailer)) = expansion_key.split_once('*') { - // 2. If matchKey starts with but is not equal to patternBase, then - if match_key.starts_with(pattern_base) - // 1. Let patternTrailer be the substring of expansionKey from the index after the first "*" character. - && !pattern_trailer.contains('*') - // 2. If patternTrailer has zero length, or if matchKey ends with patternTrailer and the length of matchKey is greater than or equal to the length of expansionKey, then - && (pattern_trailer.is_empty() - || (match_key.len() >= expansion_key.len() - && match_key.ends_with(pattern_trailer))) - && Self::pattern_key_compare(best_key, expansion_key).is_gt() - { - // 1. Let target be the value of matchObj[expansionKey]. - best_target = Some(target); - // 2. Let patternMatch be the substring of matchKey starting at the index of the length of patternBase up to the length of matchKey minus the length of patternTrailer. - best_match = - &match_key[pattern_base.len()..match_key.len() - pattern_trailer.len()]; - best_key = expansion_key; - } - } else if expansion_key.ends_with('/') - && match_key.starts_with(expansion_key) - && Self::pattern_key_compare(best_key, expansion_key).is_gt() - { - // TODO: [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./dist/" in the "exports" field module resolution of the package at xxx/package.json. - best_target = Some(target); - best_match = &match_key[expansion_key.len()..]; - best_key = expansion_key; - } - } - } - if let Some(best_target) = best_target { - // 3. Return the result of PACKAGE_TARGET_RESOLVE(packageURL, target, patternMatch, isImports, conditions). - return self.package_target_resolve( - package_url, - best_key, - best_target, - Some(best_match), - is_imports, - conditions, - ctx, - ); - } - // 4. Return null. - Ok(None) - } - - /// PACKAGE_TARGET_RESOLVE(packageURL, target, patternMatch, isImports, conditions) - #[allow(clippy::too_many_arguments)] - fn package_target_resolve( - &self, - package_url: &Path, - target_key: &str, - target: &JSONValue, - pattern_match: Option<&str>, - is_imports: bool, - conditions: &[String], - ctx: &mut Ctx, - ) -> ResolveResult { - fn normalize_string_target<'a>( - target_key: &'a str, - target: &'a str, - pattern_match: Option<&'a str>, - package_url: &Path, - ) -> Result, ResolveError> { - let target = if let Some(pattern_match) = pattern_match { - if !target_key.contains('*') && !target.contains('*') { - // enhanced-resolve behaviour - // TODO: [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./dist/" in the "exports" field module resolution of the package at xxx/package.json. - if target_key.ends_with('/') && target.ends_with('/') { - Cow::Owned(format!("{target}{pattern_match}")) - } else { - return Err(ResolveError::InvalidPackageConfigDirectory( - package_url.join("package.json"), - )); - } - } else { - Cow::Owned(target.replace('*', pattern_match)) - } - } else { - Cow::Borrowed(target) - }; - Ok(target) - } - - match target { - // 1. If target is a String, then - JSONValue::String(target) => { - // 1. If target does not start with "./", then - if !target.starts_with("./") { - // 1. If isImports is false, or if target starts with "../" or "/", or if target is a valid URL, then - if !is_imports || target.starts_with("../") || target.starts_with('/') { - // 1. Throw an Invalid Package Target error. - return Err(ResolveError::InvalidPackageTarget( - target.to_string(), - target_key.to_string(), - package_url.join("package.json"), - )); - } - // 2. If patternMatch is a String, then - // 1. Return PACKAGE_RESOLVE(target with every instance of "*" replaced by patternMatch, packageURL + "/"). - let target = - normalize_string_target(target_key, target, pattern_match, package_url)?; - let package_url = self.cache.value(package_url); - // // 3. Return PACKAGE_RESOLVE(target, packageURL + "/"). - return self.package_resolve(&package_url, &target, ctx); - } - - // 2. If target split on "/" or "\" contains any "", ".", "..", or "node_modules" segments after the first "." segment, case insensitive and including percent encoded variants, throw an Invalid Package Target error. - // 3. Let resolvedTarget be the URL resolution of the concatenation of packageURL and target. - // 4. Assert: resolvedTarget is contained in packageURL. - // 5. If patternMatch is null, then - let target = - normalize_string_target(target_key, target, pattern_match, package_url)?; - if Path::new(target.as_ref()).is_invalid_exports_target() { - return Err(ResolveError::InvalidPackageTarget( - target.to_string(), - target_key.to_string(), - package_url.join("package.json"), - )); - } - let resolved_target = package_url.normalize_with(target.as_ref()); - // 6. If patternMatch split on "/" or "\" contains any "", ".", "..", or "node_modules" segments, case insensitive and including percent encoded variants, throw an Invalid Module Specifier error. - // 7. Return the URL resolution of resolvedTarget with every instance of "*" replaced with patternMatch. - let value = self.cache.value(&resolved_target); - return Ok(Some(value)); - } - // 2. Otherwise, if target is a non-null Object, then - JSONValue::Object(target) => { - // 1. If exports contains any index property keys, as defined in ECMA-262 6.1.7 Array Index, throw an Invalid Package Configuration error. - // 2. For each property p of target, in object insertion order as, - for (key, target_value) in target { - // 1. If p equals "default" or conditions contains an entry for p, then - if key == "default" || conditions.contains(key) { - // 1. Let targetValue be the value of the p property in target. - // 2. Let resolved be the result of PACKAGE_TARGET_RESOLVE( packageURL, targetValue, patternMatch, isImports, conditions). - let resolved = self.package_target_resolve( - package_url, - target_key, - target_value, - pattern_match, - is_imports, - conditions, - ctx, - ); - // 3. If resolved is equal to undefined, continue the loop. - if let Some(path) = resolved? { - // 4. Return resolved. - return Ok(Some(path)); - } - } - } - // 3. Return undefined. - return Ok(None); - } - // 3. Otherwise, if target is an Array, then - JSONValue::Array(targets) => { - // 1. If _target.length is zero, return null. - if targets.is_empty() { - // Note: return PackagePathNotExported has the same effect as return because there are no matches. - return Err(ResolveError::PackagePathNotExported( - pattern_match.unwrap_or(".").to_string(), - package_url.join("package.json"), - )); - } - // 2. For each item targetValue in target, do - for (i, target_value) in targets.iter().enumerate() { - // 1. Let resolved be the result of PACKAGE_TARGET_RESOLVE( packageURL, targetValue, patternMatch, isImports, conditions), continuing the loop on any Invalid Package Target error. - let resolved = self.package_target_resolve( - package_url, - target_key, - target_value, - pattern_match, - is_imports, - conditions, - ctx, - ); - - if resolved.is_err() && i == targets.len() { - return resolved; - } - - // 2. If resolved is undefined, continue the loop. - if let Ok(Some(path)) = resolved { - // 3. Return resolved. - return Ok(Some(path)); - } - } - // 3. Return or throw the last fallback resolution null return or error. - // Note: see `resolved.is_err() && i == targets.len()` - } - _ => {} - } - // 4. Otherwise, if target is null, return null. - Ok(None) - // 5. Otherwise throw an Invalid Package Target error. - } - - // Returns (module, subpath) - // https://github.com/nodejs/node/blob/8f0f17e1e3b6c4e58ce748e06343c5304062c491/lib/internal/modules/esm/resolve.js#L688 - fn parse_package_specifier(specifier: &str) -> (&str, &str) { - let mut separator_index = specifier.as_bytes().iter().position(|b| *b == b'/'); - // let mut valid_package_name = true; - // let mut is_scoped = false; - if specifier.starts_with('@') { - // is_scoped = true; - if separator_index.is_none() || specifier.is_empty() { - // valid_package_name = false; - } else if let Some(index) = &separator_index { - separator_index = specifier[*index + 1..] - .as_bytes() - .iter() - .position(|b| *b == b'/') - .map(|i| i + *index + 1); - } - } - let package_name = - separator_index.map_or(specifier, |separator_index| &specifier[..separator_index]); - - // TODO: https://github.com/nodejs/node/blob/8f0f17e1e3b6c4e58ce748e06343c5304062c491/lib/internal/modules/esm/resolve.js#L705C1-L714C1 - // Package name cannot have leading . and cannot have percent-encoding or - // \\ separators. - // if (RegExpPrototypeExec(invalidPackageNameRegEx, packageName) !== null) - // validPackageName = false; - - // if (!validPackageName) { - // throw new ERR_INVALID_MODULE_SPECIFIER( - // specifier, 'is not a valid package name', fileURLToPath(base)); - // } - let package_subpath = - separator_index.map_or("", |separator_index| &specifier[separator_index..]); - (package_name, package_subpath) - } - - /// PATTERN_KEY_COMPARE(keyA, keyB) - fn pattern_key_compare(key_a: &str, key_b: &str) -> Ordering { - if key_a.is_empty() { - return Ordering::Greater; - } - // 1. Assert: keyA ends with "/" or contains only a single "*". - debug_assert!(key_a.ends_with('/') || key_a.match_indices('*').count() == 1, "{key_a}"); - // 2. Assert: keyB ends with "/" or contains only a single "*". - debug_assert!(key_b.ends_with('/') || key_b.match_indices('*').count() == 1, "{key_b}"); - // 3. Let baseLengthA be the index of "*" in keyA plus one, if keyA contains "*", or the length of keyA otherwise. - let a_pos = key_a.chars().position(|c| c == '*'); - let base_length_a = a_pos.map_or(key_a.len(), |p| p + 1); - // 4. Let baseLengthB be the index of "*" in keyB plus one, if keyB contains "*", or the length of keyB otherwise. - let b_pos = key_b.chars().position(|c| c == '*'); - let base_length_b = b_pos.map_or(key_b.len(), |p| p + 1); - // 5. If baseLengthA is greater than baseLengthB, return -1. - if base_length_a > base_length_b { - return Ordering::Less; - } - // 6. If baseLengthB is greater than baseLengthA, return 1. - if base_length_b > base_length_a { - return Ordering::Greater; - } - // 7. If keyA does not contain "*", return 1. - if !key_a.contains('*') { - return Ordering::Greater; - } - // 8. If keyB does not contain "*", return -1. - if !key_b.contains('*') { - return Ordering::Less; - } - // 9. If the length of keyA is greater than the length of keyB, return -1. - if key_a.len() > key_b.len() { - return Ordering::Less; - } - // 10. If the length of keyB is greater than the length of keyA, return 1. - if key_b.len() > key_a.len() { - return Ordering::Greater; - } - // 11. Return 0. - Ordering::Equal - } - - fn strip_package_name<'a>(specifier: &'a str, package_name: &'a str) -> Option<&'a str> { - specifier - .strip_prefix(package_name) - .filter(|tail| tail.is_empty() || tail.starts_with(SLASH_START)) - } -} diff --git a/src/options.rs b/src/options.rs deleted file mode 100644 index f473a133..00000000 --- a/src/options.rs +++ /dev/null @@ -1,623 +0,0 @@ -use std::path::Path; -use std::{fmt, path::PathBuf}; - -/// Module Resolution Options -/// -/// Options are directly ported from [enhanced-resolve](https://github.com/webpack/enhanced-resolve#resolver-options). -/// -/// See [webpack resolve](https://webpack.js.org/configuration/resolve/) for information and examples -#[derive(Debug, Clone)] -pub struct ResolveOptions { - /// Path to TypeScript configuration file. - /// - /// Default `None` - pub tsconfig: Option, - - /// Create aliases to import or require certain modules more easily. - /// - /// An alias is used to replace a whole path or part of a path. - /// For example, to alias a commonly used `src/` folders: `vec![("@/src"), vec![AliasValue::Path("/path/to/src")]]` - /// - /// A trailing $ can also be added to the given object's keys to signify an exact match. - /// - /// See [webpack's `resolve.alias` documentation](https://webpack.js.org/configuration/resolve/#resolvealias) for a list of use cases. - pub alias: Alias, - - /// A list of alias fields in description files. - /// - /// Specify a field, such as `browser`, to be parsed according to [this specification](https://github.com/defunctzombie/package-browser-field-spec). - /// Can be a path to json object such as `["path", "to", "exports"]`. - /// - /// Default `[]` - pub alias_fields: Vec>, - - /// Condition names for exports field which defines entry points of a package. - /// - /// The key order in the exports field is significant. During condition matching, earlier entries have higher priority and take precedence over later entries. - /// - /// Default `[]` - pub condition_names: Vec, - - /// The JSON files to use for descriptions. (There was once a `bower.json`.) - /// - /// Default `["package.json"]` - pub description_files: Vec, - - /// Set to [EnforceExtension::Enabled] for [ESM Mandatory file extensions](https://nodejs.org/api/esm.html#mandatory-file-extensions). - /// - /// If `enforce_extension` is set to [EnforceExtension::Enabled], resolution will not allow extension-less files. - /// This means `require('./foo.js')` will resolve, while `require('./foo')` will not. - /// - /// The default value for `enforce_extension` is [EnforceExtension::Auto], which is changed upon initialization. - /// - /// It changes to [EnforceExtension::Enabled] if [ResolveOptions::extensions] contains an empty string; - /// otherwise, this value changes to [EnforceExtension::Disabled]. - /// - /// Explicitly set the value to [EnforceExtension::Disabled] to disable this automatic behavior. - /// - /// For reference, this behavior is aligned with `enhanced-resolve`. See . - pub enforce_extension: EnforceExtension, - - /// A list of exports fields in description files. - /// - /// Can be a path to a JSON object such as `["path", "to", "exports"]`. - /// - /// Default `[["exports"]]`. - pub exports_fields: Vec>, - - /// Fields from `package.json` which are used to provide the internal requests of a package - /// (requests starting with # are considered internal). - /// - /// Can be a path to a JSON object such as `["path", "to", "imports"]`. - /// - /// Default `[["imports"]]`. - pub imports_fields: Vec>, - - /// An object which maps extension to extension aliases. - /// - /// Default `{}` - pub extension_alias: Vec<(String, Vec)>, - - /// Attempt to resolve these extensions in order. - /// - /// If multiple files share the same name but have different extensions, - /// will resolve the one with the extension listed first in the array and skip the rest. - /// - /// All extensions must have a leading dot. - /// - /// Default `[".js", ".json", ".node"]` - pub extensions: Vec, - - /// Redirect module requests when normal resolving fails. - /// - /// Default `[]` - pub fallback: Alias, - - /// 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). - /// - /// See also webpack configuration [resolve.fullySpecified](https://webpack.js.org/configuration/module/#resolvefullyspecified) - /// - /// Default `false` - pub fully_specified: bool, - - /// A list of main fields in description files - /// - /// Default `["main"]`. - pub main_fields: Vec, - - /// The filename to be used while resolving directories. - /// - /// Default `["index"]` - pub main_files: Vec, - - /// A list of directories to resolve modules from, can be absolute path or folder name. - /// - /// Default `["node_modules"]` - pub modules: Vec, - - /// Resolve to a context instead of a file. - /// - /// Default `false` - pub resolve_to_context: bool, - - /// Prefer to resolve module requests as relative requests instead of using modules from node_modules directories. - /// - /// Default `false` - pub prefer_relative: bool, - - /// Prefer to resolve server-relative urls as absolute paths before falling back to resolve in ResolveOptions::roots. - /// - /// Default `false` - pub prefer_absolute: bool, - - /// A list of resolve restrictions to restrict the paths that a request can be resolved on. - /// - /// Default `[]` - pub restrictions: Vec, - - /// A list of directories where requests of server-relative URLs (starting with '/') are resolved. - /// On non-Windows systems these requests are resolved as an absolute path first. - /// - /// Default `[]` - pub roots: Vec, - - /// Whether to resolve symlinks to their symlinked location. - /// When enabled, symlinked resources are resolved to their real path, not their symlinked location. - /// Note that this may cause module resolution to fail when using tools that symlink packages (like npm link). - /// - /// Default `true` - pub symlinks: bool, - - /// Whether to parse [module.builtinModules](https://nodejs.org/api/module.html#modulebuiltinmodules) or not. - /// For example, "zlib" will throw [crate::ResolveError::Builtin] when set to true. - /// - /// Default `false` - pub builtin_modules: bool, -} - -impl ResolveOptions { - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// - /// let options = ResolveOptions::default().with_condition_names(&["bar"]); - /// assert_eq!(options.condition_names, vec!["bar".to_string()]) - /// ``` - #[must_use] - pub fn with_condition_names(mut self, names: &[&str]) -> Self { - self.condition_names = names.iter().map(ToString::to_string).collect::>(); - self - } - - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// - /// let options = ResolveOptions::default().with_builtin_modules(false); - /// assert_eq!(options.builtin_modules, false) - /// ``` - #[must_use] - pub fn with_builtin_modules(mut self, flag: bool) -> Self { - self.builtin_modules = flag; - self - } - - /// Adds a single root to the options - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_root("foo"); - /// assert_eq!(options.roots, vec![PathBuf::from("foo")]) - /// ``` - #[must_use] - pub fn with_root>(mut self, root: P) -> Self { - self.roots.push(root.as_ref().to_path_buf()); - self - } - - /// Adds a single extension to the list of extensions - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_extension("jsonc"); - /// assert!(options.extensions.contains(&"jsonc".to_string())); - /// ``` - #[must_use] - pub fn with_extension>(mut self, extension: S) -> Self { - self.extensions.push(extension.into()); - self - } - - /// Adds a single main field to the list of fields - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_main_field("something"); - /// assert!(options.main_fields.contains(&"something".to_string())); - /// ``` - #[must_use] - pub fn with_main_field>(mut self, field: S) -> Self { - self.main_fields.push(field.into()); - self - } - - /// Changes how the extension should be treated - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions, EnforceExtension}; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_force_extension(EnforceExtension::Enabled); - /// assert_eq!(options.enforce_extension, EnforceExtension::Enabled); - /// ``` - #[must_use] - pub fn with_force_extension(mut self, enforce_extension: EnforceExtension) -> Self { - self.enforce_extension = enforce_extension; - self - } - - /// Sets the value for [ResolveOptions::fully_specified] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_fully_specified(true); - /// assert_eq!(options.fully_specified, true); - /// ``` - #[must_use] - pub fn with_fully_specified(mut self, fully_specified: bool) -> Self { - self.fully_specified = fully_specified; - self - } - /// Sets the value for [ResolveOptions::prefer_relative] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_prefer_relative(true); - /// assert_eq!(options.prefer_relative, true); - /// ``` - #[must_use] - pub fn with_prefer_relative(mut self, flag: bool) -> Self { - self.prefer_relative = flag; - self - } - /// Sets the value for [ResolveOptions::prefer_absolute] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_prefer_absolute(true); - /// assert_eq!(options.prefer_absolute, true); - /// ``` - #[must_use] - pub fn with_prefer_absolute(mut self, flag: bool) -> Self { - self.prefer_absolute = flag; - self - } - - /// Changes the value of [ResolveOptions::symlinks] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// - /// let options = ResolveOptions::default().with_symbolic_link(false); - /// assert_eq!(options.symlinks, false); - /// ``` - #[must_use] - pub fn with_symbolic_link(mut self, flag: bool) -> Self { - self.symlinks = flag; - self - } - - /// Adds a module to [ResolveOptions::modules] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// - /// let options = ResolveOptions::default().with_module("module"); - /// assert!(options.modules.contains(&"module".to_string())); - /// ``` - #[must_use] - pub fn with_module>(mut self, module: M) -> Self { - self.modules.push(module.into()); - self - } - - /// Adds a main file to [ResolveOptions::main_files] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// - /// let options = ResolveOptions::default().with_main_file("foo"); - /// assert!(options.main_files.contains(&"foo".to_string())); - /// ``` - #[must_use] - pub fn with_main_file>(mut self, module: M) -> Self { - self.main_files.push(module.into()); - self - } - - pub(crate) fn sanitize(mut self) -> Self { - debug_assert!( - self.extensions.iter().filter(|e| !e.is_empty()).all(|e| e.starts_with('.')), - "All extensions must start with a leading dot" - ); - // Set `enforceExtension` to `true` when [ResolveOptions::extensions] contains an empty string. - // See - if self.enforce_extension == EnforceExtension::Auto { - if !self.extensions.is_empty() && self.extensions.iter().any(String::is_empty) { - self.enforce_extension = EnforceExtension::Enabled; - } else { - self.enforce_extension = EnforceExtension::Disabled; - } - } - self - } -} - -/// Value for [ResolveOptions::enforce_extension] -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -pub enum EnforceExtension { - Auto, - Enabled, - Disabled, -} - -impl EnforceExtension { - pub const fn is_auto(&self) -> bool { - matches!(self, Self::Auto) - } - - pub const fn is_enabled(&self) -> bool { - matches!(self, Self::Enabled) - } - - pub const fn is_disabled(&self) -> bool { - matches!(self, Self::Disabled) - } -} - -/// Alias for [ResolveOptions::alias] and [ResolveOptions::fallback] -pub type Alias = Vec<(String, Vec)>; - -/// Alias Value for [ResolveOptions::alias] and [ResolveOptions::fallback] -#[derive(Debug, Clone, Hash, PartialEq, Eq)] -pub enum AliasValue { - /// The path value - Path(String), - - /// The `false` value - Ignore, -} - -impl From for AliasValue -where - S: Into, -{ - fn from(value: S) -> Self { - Self::Path(value.into()) - } -} - -/// Value for [ResolveOptions::restrictions] -#[derive(Debug, Clone)] -pub enum Restriction { - Path(PathBuf), - RegExp(String), -} - -/// Tsconfig Options for [ResolveOptions::tsconfig] -/// -/// Derived from [tsconfig-paths-webpack-plugin](https://github.com/dividab/tsconfig-paths-webpack-plugin#options) -#[derive(Debug, Clone)] -pub struct TsconfigOptions { - /// Allows you to specify where to find the TypeScript configuration file. - /// You may provide - /// * a relative path to the configuration file. It will be resolved relative to cwd. - /// * an absolute path to the configuration file. - pub config_file: PathBuf, - - /// Support for Typescript Project References. - pub references: TsconfigReferences, -} - -/// Configuration for [TsconfigOptions::references] -#[derive(Debug, Clone)] -pub enum TsconfigReferences { - Disabled, - /// Use the `references` field from tsconfig of `config_file`. - Auto, - /// Manually provided relative or absolute path. - Paths(Vec), -} - -impl Default for ResolveOptions { - fn default() -> Self { - Self { - tsconfig: None, - alias: vec![], - alias_fields: vec![], - condition_names: vec![], - description_files: vec!["package.json".into()], - enforce_extension: EnforceExtension::Auto, - extension_alias: vec![], - exports_fields: vec![vec!["exports".into()]], - imports_fields: vec![vec!["imports".into()]], - extensions: vec![".js".into(), ".json".into(), ".node".into()], - fallback: vec![], - fully_specified: false, - main_fields: vec!["main".into()], - main_files: vec!["index".into()], - modules: vec!["node_modules".into()], - resolve_to_context: false, - prefer_relative: false, - prefer_absolute: false, - restrictions: vec![], - roots: vec![], - symlinks: true, - builtin_modules: false, - } - } -} - -// For tracing -impl fmt::Display for ResolveOptions { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - if let Some(tsconfig) = &self.tsconfig { - write!(f, "tsconfig:{tsconfig:?},")?; - } - if !self.alias.is_empty() { - write!(f, "alias:{:?},", self.alias)?; - } - if !self.alias_fields.is_empty() { - write!(f, "alias_fields:{:?},", self.alias_fields)?; - } - if !self.condition_names.is_empty() { - write!(f, "condition_names:{:?},", self.condition_names)?; - } - if self.enforce_extension.is_enabled() { - write!(f, "enforce_extension:{:?},", self.enforce_extension)?; - } - if !self.exports_fields.is_empty() { - write!(f, "exports_fields:{:?},", self.exports_fields)?; - } - if !self.imports_fields.is_empty() { - write!(f, "imports_fields:{:?},", self.imports_fields)?; - } - if !self.extension_alias.is_empty() { - write!(f, "extension_alias:{:?},", self.extension_alias)?; - } - if !self.extensions.is_empty() { - write!(f, "extensions:{:?},", self.extensions)?; - } - if !self.fallback.is_empty() { - write!(f, "fallback:{:?},", self.fallback)?; - } - if self.fully_specified { - write!(f, "fully_specified:{:?},", self.fully_specified)?; - } - if !self.main_fields.is_empty() { - write!(f, "main_fields:{:?},", self.main_fields)?; - } - if !self.main_files.is_empty() { - write!(f, "main_files:{:?},", self.main_files)?; - } - if !self.modules.is_empty() { - write!(f, "modules:{:?},", self.modules)?; - } - if self.resolve_to_context { - write!(f, "resolve_to_context:{:?},", self.resolve_to_context)?; - } - if self.prefer_relative { - write!(f, "prefer_relative:{:?},", self.prefer_relative)?; - } - if self.prefer_absolute { - write!(f, "prefer_absolute:{:?},", self.prefer_absolute)?; - } - if !self.restrictions.is_empty() { - write!(f, "restrictions:{:?},", self.restrictions)?; - } - if !self.roots.is_empty() { - write!(f, "roots:{:?},", self.roots)?; - } - if self.symlinks { - write!(f, "symlinks:{:?},", self.symlinks)?; - } - if self.builtin_modules { - write!(f, "builtin_modules:{:?},", self.builtin_modules)?; - } - Ok(()) - } -} - -#[cfg(test)] -mod test { - use super::{ - AliasValue, EnforceExtension, ResolveOptions, Restriction, TsconfigOptions, - TsconfigReferences, - }; - use std::path::PathBuf; - - #[test] - fn enforce_extension() { - assert!(EnforceExtension::Auto.is_auto()); - assert!(!EnforceExtension::Enabled.is_auto()); - assert!(!EnforceExtension::Disabled.is_auto()); - - assert!(!EnforceExtension::Auto.is_enabled()); - assert!(EnforceExtension::Enabled.is_enabled()); - assert!(!EnforceExtension::Disabled.is_enabled()); - - assert!(!EnforceExtension::Auto.is_disabled()); - assert!(!EnforceExtension::Enabled.is_disabled()); - assert!(EnforceExtension::Disabled.is_disabled()); - } - - #[test] - fn display() { - let options = ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: PathBuf::from("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - alias: vec![("a".into(), vec![AliasValue::Ignore])], - alias_fields: vec![vec!["browser".into()]], - condition_names: vec!["require".into()], - enforce_extension: EnforceExtension::Enabled, - extension_alias: vec![(".js".into(), vec![".ts".into()])], - exports_fields: vec![vec!["exports".into()]], - imports_fields: vec![vec!["imports".into()]], - fallback: vec![("fallback".into(), vec![AliasValue::Ignore])], - fully_specified: true, - resolve_to_context: true, - prefer_relative: true, - prefer_absolute: true, - restrictions: vec![Restriction::Path(PathBuf::from("restrictions"))], - roots: vec![PathBuf::from("roots")], - builtin_modules: true, - ..ResolveOptions::default() - }; - - let expected = r#"tsconfig:TsconfigOptions { config_file: "tsconfig.json", references: Auto },alias:[("a", [Ignore])],alias_fields:[["browser"]],condition_names:["require"],enforce_extension:Enabled,exports_fields:[["exports"]],imports_fields:[["imports"]],extension_alias:[(".js", [".ts"])],extensions:[".js", ".json", ".node"],fallback:[("fallback", [Ignore])],fully_specified:true,main_fields:["main"],main_files:["index"],modules:["node_modules"],resolve_to_context:true,prefer_relative:true,prefer_absolute:true,restrictions:[Path("restrictions")],roots:["roots"],symlinks:true,builtin_modules:true,"#; - assert_eq!(format!("{options}"), expected); - - let options = ResolveOptions { - alias: vec![], - alias_fields: vec![], - builtin_modules: false, - condition_names: vec![], - description_files: vec![], - enforce_extension: EnforceExtension::Disabled, - exports_fields: vec![], - extension_alias: vec![], - extensions: vec![], - fallback: vec![], - fully_specified: false, - imports_fields: vec![], - main_fields: vec![], - main_files: vec![], - modules: vec![], - prefer_absolute: false, - prefer_relative: false, - resolve_to_context: false, - restrictions: vec![], - roots: vec![], - symlinks: false, - tsconfig: None, - }; - - assert_eq!(format!("{options}"), ""); - } -} diff --git a/src/package_json.rs b/src/package_json.rs deleted file mode 100644 index 73901faa..00000000 --- a/src/package_json.rs +++ /dev/null @@ -1,207 +0,0 @@ -//! package.json definitions -//! -//! Code related to export field are copied from [Parcel's resolver](https://github.com/parcel-bundler/parcel/blob/v2/packages/utils/node-resolver-rs/src/package_json.rs) -use std::path::{Path, PathBuf}; - -use serde_json::Value as JSONValue; - -use crate::{path::PathUtil, ResolveError}; - -pub type JSONMap = serde_json::Map; - -/// Deserialized package.json -#[derive(Debug, Default)] -pub struct PackageJson { - /// Path to `package.json`. Contains the `package.json` filename. - pub path: PathBuf, - - /// Realpath to `package.json`. Contains the `package.json` filename. - pub realpath: PathBuf, - - /// The "name" field defines your package's name. - /// The "name" field can be used in addition to the "exports" field to self-reference a package using its name. - /// - /// - pub name: Option, - - raw_json: std::sync::Arc, -} - -impl PackageJson { - /// # Panics - /// # Errors - pub(crate) fn parse( - path: PathBuf, - realpath: PathBuf, - json: &str, - ) -> Result { - let mut raw_json: JSONValue = serde_json::from_str(json)?; - let mut package_json = Self::default(); - - if let Some(json_object) = raw_json.as_object_mut() { - // Remove large fields that are useless for pragmatic use. - #[cfg(feature = "package_json_raw_json_api")] - { - json_object.remove("description"); - json_object.remove("keywords"); - json_object.remove("scripts"); - json_object.remove("dependencies"); - json_object.remove("devDependencies"); - json_object.remove("peerDependencies"); - json_object.remove("optionalDependencies"); - } - - // Add name. - package_json.name = - json_object.get("name").and_then(|field| field.as_str()).map(ToString::to_string); - } - - package_json.path = path; - package_json.realpath = realpath; - package_json.raw_json = std::sync::Arc::new(raw_json); - Ok(package_json) - } - - fn get_value_by_path<'a>( - fields: &'a serde_json::Map, - path: &[String], - ) -> Option<&'a JSONValue> { - if path.is_empty() { - return None; - } - let mut value = fields.get(&path[0])?; - for key in path.iter().skip(1) { - if let Some(inner_value) = value.as_object().and_then(|o| o.get(key)) { - value = inner_value; - } else { - return None; - } - } - Some(value) - } - - /// Raw serde json value of `package.json`. - /// - /// This is currently used in Rspack for: - /// * getting the `sideEffects` field - /// * query in - search on GitHub indicates query on the `type` field. - /// - /// To reduce overall memory consumption, large fields that useless for pragmatic use are removed. - /// They are: `description`, `keywords`, `scripts`, - /// `dependencies` and `devDependencies`, `peerDependencies`, `optionalDependencies`. - #[cfg(feature = "package_json_raw_json_api")] - pub fn raw_json(&self) -> &std::sync::Arc { - &self.raw_json - } - - /// Directory to `package.json` - /// - /// # Panics - /// - /// * When the package.json path is misconfigured. - pub fn directory(&self) -> &Path { - debug_assert!(self.realpath.file_name().is_some_and(|x| x == "package.json")); - self.realpath.parent().unwrap() - } - - /// The "main" field defines the entry point of a package when imported by name via a node_modules lookup. Its value is a path. - /// - /// When a package has an "exports" field, this will take precedence over the "main" field when importing the package by name. - /// - /// Values are dynamically retrieved from [ResolveOptions::main_fields]. - /// - /// - pub(crate) fn main_fields<'a>( - &'a self, - main_fields: &'a [String], - ) -> impl Iterator + '_ { - main_fields - .iter() - .filter_map(|main_field| self.raw_json.get(main_field)) - .filter_map(|value| value.as_str()) - } - - /// The "exports" field allows defining the entry points of a package when imported by name loaded either via a node_modules lookup or a self-reference to its own name. - /// - /// - pub(crate) fn exports_fields<'a>( - &'a self, - exports_fields: &'a [Vec], - ) -> impl Iterator + '_ { - exports_fields.iter().filter_map(|object_path| { - self.raw_json - .as_object() - .and_then(|json_object| Self::get_value_by_path(json_object, object_path)) - }) - } - - /// In addition to the "exports" field, there is a package "imports" field to create private mappings that only apply to import specifiers from within the package itself. - /// - /// - pub(crate) fn imports_fields<'a>( - &'a self, - imports_fields: &'a [Vec], - ) -> impl Iterator + '_ { - imports_fields.iter().filter_map(|object_path| { - self.raw_json - .as_object() - .and_then(|json_object| Self::get_value_by_path(json_object, object_path)) - .and_then(|value| value.as_object()) - }) - } - - /// The "browser" field is provided by a module author as a hint to javascript bundlers or component tools when packaging modules for client side use. - /// Multiple values are configured by [ResolveOptions::alias_fields]. - /// - /// - fn browser_fields<'a>( - &'a self, - alias_fields: &'a [Vec], - ) -> impl Iterator + '_ { - alias_fields.iter().filter_map(|object_path| { - self.raw_json - .as_object() - .and_then(|json_object| Self::get_value_by_path(json_object, object_path)) - // Only object is valid, all other types are invalid - // https://github.com/webpack/enhanced-resolve/blob/3a28f47788de794d9da4d1702a3a583d8422cd48/lib/AliasFieldPlugin.js#L44-L52 - .and_then(|value| value.as_object()) - }) - } - - /// Resolve the request string for this package.json by looking at the `browser` field. - /// - /// # Errors - /// - /// * Returns [ResolveError::Ignored] for `"path": false` in `browser` field. - pub(crate) fn resolve_browser_field<'a>( - &'a self, - path: &Path, - request: Option<&str>, - alias_fields: &'a [Vec], - ) -> Result, ResolveError> { - for object in self.browser_fields(alias_fields) { - if let Some(request) = request { - if let Some(value) = object.get(request) { - return Self::alias_value(path, value); - } - } else { - let dir = self.path.parent().unwrap(); - for (key, value) in object { - let joined = dir.normalize_with(key); - if joined == path { - return Self::alias_value(path, value); - } - } - } - } - Ok(None) - } - - fn alias_value<'a>(key: &Path, value: &'a JSONValue) -> Result, ResolveError> { - match value { - JSONValue::String(value) => Ok(Some(value.as_str())), - JSONValue::Bool(b) if !b => Err(ResolveError::Ignored(key.to_path_buf())), - _ => Ok(None), - } - } -} diff --git a/src/path.rs b/src/path.rs deleted file mode 100644 index f66fdd76..00000000 --- a/src/path.rs +++ /dev/null @@ -1,132 +0,0 @@ -//! Path Utilities -//! -//! Code adapted from the following libraries -//! * [path-absolutize](https://docs.rs/path-absolutize) -//! * [normalize_path](https://docs.rs/normalize-path) -use std::path::{Component, Path, PathBuf}; - -pub const SLASH_START: &[char; 2] = &['/', '\\']; - -/// Extension trait to add path normalization to std's [`Path`]. -pub trait PathUtil { - /// Normalize this path without performing I/O. - /// - /// All redundant separator and up-level references are collapsed. - /// - /// However, this does not resolve links. - fn normalize(&self) -> PathBuf; - - /// Normalize with subpath assuming this path is normalized without performing I/O. - /// - /// All redundant separator and up-level references are collapsed. - /// - /// However, this does not resolve links. - fn normalize_with>(&self, subpath: P) -> PathBuf; - - /// Defined in ESM PACKAGE_TARGET_RESOLVE - /// If target split on "/" or "\" contains any "", ".", "..", or "node_modules" segments after the first "." segment, case insensitive and including percent encoded variants - fn is_invalid_exports_target(&self) -> bool; -} - -impl PathUtil for Path { - // https://github.com/parcel-bundler/parcel/blob/e0b99c2a42e9109a9ecbd6f537844a1b33e7faf5/packages/utils/node-resolver-rs/src/path.rs#L7 - fn normalize(&self) -> PathBuf { - let mut components = self.components().peekable(); - let mut ret = if let Some(c @ Component::Prefix(..)) = components.peek() { - let buf = PathBuf::from(c.as_os_str()); - components.next(); - buf - } else { - PathBuf::new() - }; - - for component in components { - match component { - Component::Prefix(..) => unreachable!("Path {:?}", self), - Component::RootDir => { - ret.push(component.as_os_str()); - } - Component::CurDir => {} - Component::ParentDir => { - ret.pop(); - } - Component::Normal(c) => { - ret.push(c); - } - } - } - - ret - } - - // https://github.com/parcel-bundler/parcel/blob/e0b99c2a42e9109a9ecbd6f537844a1b33e7faf5/packages/utils/node-resolver-rs/src/path.rs#L37 - fn normalize_with>(&self, subpath: B) -> PathBuf { - let subpath = subpath.as_ref(); - - let mut components = subpath.components(); - - let Some(head) = components.next() else { return subpath.to_path_buf() }; - - if matches!(head, Component::Prefix(..) | Component::RootDir) { - return subpath.to_path_buf(); - } - - let mut ret = self.to_path_buf(); - for component in std::iter::once(head).chain(components) { - match component { - Component::CurDir => {} - Component::ParentDir => { - ret.pop(); - } - Component::Normal(c) => { - ret.push(c); - } - Component::Prefix(..) | Component::RootDir => { - unreachable!("Path {:?} Subpath {:?}", self, subpath) - } - } - } - - ret - } - - fn is_invalid_exports_target(&self) -> bool { - self.components().enumerate().any(|(index, c)| match c { - Component::ParentDir => true, - Component::CurDir => index > 0, - Component::Normal(c) => c.eq_ignore_ascii_case("node_modules"), - _ => false, - }) - } -} - -// https://github.com/webpack/enhanced-resolve/blob/main/test/path.test.js -#[test] -fn is_invalid_exports_target() { - let test_cases = [ - "../a.js", - "../", - "./a/b/../../../c.js", - "./a/b/../../../", - "./../../c.js", - "./../../", - "./a/../b/../../c.js", - "./a/../b/../../", - "./././../", - ]; - - for case in test_cases { - assert!(Path::new(case).is_invalid_exports_target(), "{case}"); - } - - assert!(!Path::new("C:").is_invalid_exports_target()); - assert!(!Path::new("/").is_invalid_exports_target()); -} - -#[test] -fn normalize() { - assert_eq!(Path::new("/foo/.././foo/").normalize(), Path::new("/foo")); - assert_eq!(Path::new("C://").normalize(), Path::new("C://")); - assert_eq!(Path::new("C:").normalize(), Path::new("C:")); - assert_eq!(Path::new(r"\\server\share").normalize(), Path::new(r"\\server\share")); -} diff --git a/src/resolution.rs b/src/resolution.rs deleted file mode 100644 index a3aaa2e7..00000000 --- a/src/resolution.rs +++ /dev/null @@ -1,92 +0,0 @@ -use crate::package_json::PackageJson; -use std::{ - fmt, - path::{Path, PathBuf}, - sync::Arc, -}; - -/// The final path resolution with optional `?query` and `#fragment` -#[derive(Clone)] -pub struct Resolution { - pub(crate) path: PathBuf, - - /// path query `?query`, contains `?`. - pub(crate) query: Option, - - /// path fragment `#query`, contains `#`. - pub(crate) fragment: Option, - - pub(crate) package_json: Option>, -} - -impl fmt::Debug for Resolution { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - f.debug_struct("Resolution") - .field("path", &self.path) - .field("query", &self.query) - .field("fragment", &self.fragment) - .field("package_json", &self.package_json.as_ref().map(|p| &p.path)) - .finish() - } -} - -impl PartialEq for Resolution { - fn eq(&self, other: &Self) -> bool { - self.path == other.path && self.query == other.query && self.fragment == other.fragment - } -} -impl Eq for Resolution {} - -impl Resolution { - /// Returns the path without query and fragment - pub fn path(&self) -> &Path { - &self.path - } - - /// Returns the path without query and fragment - pub fn into_path_buf(self) -> PathBuf { - self.path - } - - /// Returns the path query `?query`, contains the leading `?` - pub fn query(&self) -> Option<&str> { - self.query.as_deref() - } - - /// Returns the path fragment `#fragment`, contains the leading `#` - pub fn fragment(&self) -> Option<&str> { - self.fragment.as_deref() - } - - /// Returns serialized package_json - pub fn package_json(&self) -> Option<&Arc> { - self.package_json.as_ref() - } - - /// Returns the full path with query and fragment - pub fn full_path(&self) -> PathBuf { - let mut path = self.path.clone().into_os_string(); - if let Some(query) = &self.query { - path.push(query); - } - if let Some(fragment) = &self.fragment { - path.push(fragment); - } - PathBuf::from(path) - } -} - -#[test] -fn test() { - let resolution = Resolution { - path: PathBuf::from("foo"), - query: Some("?query".to_string()), - fragment: Some("#fragment".to_string()), - package_json: None, - }; - assert_eq!(resolution.path(), Path::new("foo")); - assert_eq!(resolution.query(), Some("?query")); - assert_eq!(resolution.fragment(), Some("#fragment")); - assert_eq!(resolution.full_path(), PathBuf::from("foo?query#fragment")); - assert_eq!(resolution.into_path_buf(), PathBuf::from("foo")); -} diff --git a/src/specifier.rs b/src/specifier.rs deleted file mode 100644 index 3d35eafc..00000000 --- a/src/specifier.rs +++ /dev/null @@ -1,230 +0,0 @@ -use crate::error::SpecifierError; -use std::borrow::Cow; - -#[derive(Debug)] -pub struct Specifier<'a> { - path: Cow<'a, str>, - pub query: Option<&'a str>, - pub fragment: Option<&'a str>, -} - -impl<'a> Specifier<'a> { - pub fn path(&'a self) -> &'a str { - self.path.as_ref() - } - - pub fn parse(specifier: &'a str) -> Result, SpecifierError> { - if specifier.is_empty() { - return Err(SpecifierError::Empty(specifier.to_string())); - } - let offset = match specifier.as_bytes()[0] { - b'/' | b'.' | b'#' => 1, - _ => 0, - }; - let (path, query, fragment) = Self::parse_query_framgment(specifier, offset); - if path.is_empty() { - return Err(SpecifierError::Empty(specifier.to_string())); - } - Ok(Self { path, query, fragment }) - } - - fn parse_query_framgment( - specifier: &'a str, - skip: usize, - ) -> (Cow<'a, str>, Option<&str>, Option<&str>) { - let mut query_start: Option = None; - let mut fragment_start: Option = None; - - let mut prev = specifier.chars().next().unwrap(); - let mut escaped_indexes = vec![]; - for (i, c) in specifier.char_indices().skip(skip) { - if c == '?' && query_start.is_none() { - query_start = Some(i); - } - if c == '#' { - if prev == '\0' { - escaped_indexes.push(i - 1); - } else { - fragment_start = Some(i); - break; - } - } - prev = c; - } - - let (path, query, fragment) = match (query_start, fragment_start) { - (Some(i), Some(j)) => { - debug_assert!(i < j); - (&specifier[..i], Some(&specifier[i..j]), Some(&specifier[j..])) - } - (Some(i), None) => (&specifier[..i], Some(&specifier[i..]), None), - (None, Some(j)) => (&specifier[..j], None, Some(&specifier[j..])), - _ => (specifier, None, None), - }; - - let path = if escaped_indexes.is_empty() { - Cow::Borrowed(path) - } else { - // Remove the `\0` characters for a legal path. - Cow::Owned( - path.chars() - .enumerate() - .filter_map(|(i, c)| (!escaped_indexes.contains(&i)).then_some(c)) - .collect::(), - ) - }; - - (path, query, fragment) - } -} - -#[cfg(test)] -mod tests { - use super::{Specifier, SpecifierError}; - - #[test] - fn debug() { - let specifier = Specifier::parse("/").unwrap(); - assert_eq!( - format!("{specifier:?}"), - r#"Specifier { path: "/", query: None, fragment: None }"# - ); - } - - #[test] - fn empty() { - let specifiers = ["", "?"]; - for specifier in specifiers { - let error = Specifier::parse(specifier).unwrap_err(); - assert_eq!(error, SpecifierError::Empty(specifier.to_string())); - } - } - - #[test] - fn absolute() -> Result<(), SpecifierError> { - let specifier = "/test?#"; - let parsed = Specifier::parse(specifier)?; - assert_eq!(parsed.path, "/test"); - assert_eq!(parsed.query, Some("?")); - assert_eq!(parsed.fragment, Some("#")); - Ok(()) - } - - #[test] - fn relative() -> Result<(), SpecifierError> { - let specifiers = ["./test", "../test", "../../test"]; - for specifier in specifiers { - let mut r = specifier.to_string(); - r.push_str("?#"); - let parsed = Specifier::parse(&r)?; - assert_eq!(parsed.path, specifier); - assert_eq!(parsed.query, Some("?")); - assert_eq!(parsed.fragment, Some("#")); - } - Ok(()) - } - - #[test] - fn hash() -> Result<(), SpecifierError> { - let specifiers = ["#", "#path"]; - for specifier in specifiers { - let mut r = specifier.to_string(); - r.push_str("?#"); - let parsed = Specifier::parse(&r)?; - assert_eq!(parsed.path, specifier); - assert_eq!(parsed.query, Some("?")); - assert_eq!(parsed.fragment, Some("#")); - } - Ok(()) - } - - #[test] - fn module() -> Result<(), SpecifierError> { - let specifiers = ["module"]; - for specifier in specifiers { - let mut r = specifier.to_string(); - r.push_str("?#"); - let parsed = Specifier::parse(&r)?; - assert_eq!(parsed.path, specifier); - assert_eq!(parsed.query, Some("?")); - assert_eq!(parsed.fragment, Some("#")); - } - Ok(()) - } - - #[test] - fn query_fragment() -> Result<(), SpecifierError> { - let data = [ - ("a?", Some("?"), None), - ("a?query", Some("?query"), None), - ("a?query1?query2", Some("?query1?query2"), None), - ("a?query1?query2?query3", Some("?query1?query2?query3"), None), - ("a#", None, Some("#")), - ("a#b#c", None, Some("#b#c")), - ("a#fragment", None, Some("#fragment")), - ("a?#", Some("?"), Some("#")), - ("a?#fragment", Some("?"), Some("#fragment")), - ("a?query#", Some("?query"), Some("#")), - ("a?query#fragment", Some("?query"), Some("#fragment")), - ("a#fragment?", None, Some("#fragment?")), - ("a#fragment?query", None, Some("#fragment?query")), - ]; - - for (specifier_str, query, fragment) in data { - let specifier = Specifier::parse(specifier_str)?; - assert_eq!(specifier.path, "a", "{specifier_str}"); - assert_eq!(specifier.query, query, "{specifier_str}"); - assert_eq!(specifier.fragment, fragment, "{specifier_str}"); - } - - Ok(()) - } - - #[test] - // https://github.com/webpack/enhanced-resolve/blob/main/test/identifier.test.js - fn enhanced_resolve_edge_cases() -> Result<(), SpecifierError> { - let data = [ - ("path/#", "path/", "", "#"), - ("path/as/?", "path/as/", "?", ""), - ("path/#/?", "path/", "", "#/?"), - ("path/#repo#hash", "path/", "", "#repo#hash"), - ("path/#r#hash", "path/", "", "#r#hash"), - ("path/#repo/#repo2#hash", "path/", "", "#repo/#repo2#hash"), - ("path/#r/#r#hash", "path/", "", "#r/#r#hash"), - ("path/#/not/a/hash?not-a-query", "path/", "", "#/not/a/hash?not-a-query"), - ]; - - for (specifier_str, path, query, fragment) in data { - let specifier = Specifier::parse(specifier_str)?; - assert_eq!(specifier.path, path, "{specifier_str}"); - assert_eq!(specifier.query.unwrap_or(""), query, "{specifier_str}"); - assert_eq!(specifier.fragment.unwrap_or(""), fragment, "{specifier_str}"); - } - - Ok(()) - } - - // https://github.com/webpack/enhanced-resolve/blob/main/test/identifier.test.js - #[test] - fn enhanced_resolve_windows_like() -> Result<(), SpecifierError> { - let data = [ - ("path\\#", "path\\", "", "#"), - ("path\\as\\?", "path\\as\\", "?", ""), - ("path\\#\\?", "path\\", "", "#\\?"), - ("path\\#repo#hash", "path\\", "", "#repo#hash"), - ("path\\#r#hash", "path\\", "", "#r#hash"), - ("path\\#repo\\#repo2#hash", "path\\", "", "#repo\\#repo2#hash"), - ("path\\#r\\#r#hash", "path\\", "", "#r\\#r#hash"), - ("path\\#/not/a/hash?not-a-query", "path\\", "", "#/not/a/hash?not-a-query"), - ]; - - for (specifier_str, path, query, fragment) in data { - let specifier = Specifier::parse(specifier_str)?; - assert_eq!(specifier.path, path, "{specifier_str}"); - assert_eq!(specifier.query.unwrap_or(""), query, "{specifier_str}"); - assert_eq!(specifier.fragment.unwrap_or(""), fragment, "{specifier_str}"); - } - - Ok(()) - } -} diff --git a/src/tests/alias.rs b/src/tests/alias.rs deleted file mode 100644 index 07c615f4..00000000 --- a/src/tests/alias.rs +++ /dev/null @@ -1,280 +0,0 @@ -//! - -use normalize_path::NormalizePath; -use std::path::Path; - -use crate::{AliasValue, Resolution, ResolveContext, ResolveError, ResolveOptions, Resolver}; - -#[test] -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -fn alias() { - use super::memory_fs::MemoryFS; - use crate::ResolverGeneric; - use std::path::{Path, PathBuf}; - - let f = Path::new("/"); - - let file_system = MemoryFS::new(&[ - ("/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", ""), - ("/dashed-name", ""), - ]); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - alias: vec![ - ("aliasA".into(), vec![AliasValue::from("a")]), - ("b$".into(), vec![AliasValue::from("a/index")]), - ("c$".into(), vec![AliasValue::from("/a/index")]), - ( - "multiAlias".into(), - vec![ - AliasValue::from("b"), - AliasValue::from("c"), - AliasValue::from("d"), - AliasValue::from("e"), - AliasValue::from("a"), - ], - ), - ("recursive".into(), vec![AliasValue::from("recursive/dir")]), - ("/d/dir".into(), vec![AliasValue::from("/c/dir")]), - ("/d/index.js".into(), vec![AliasValue::from("/c/index")]), - ("#".into(), vec![AliasValue::from("/c/dir")]), - ("@".into(), vec![AliasValue::from("/c/dir")]), - ("ignored".into(), vec![AliasValue::Ignore]), - // not part of enhanced-resolve, added to make sure query in alias value works - ("alias_query".into(), vec![AliasValue::from("a?query_after")]), - ("alias_fragment".into(), vec![AliasValue::from("a#fragment_after")]), - ("dash".into(), vec![AliasValue::Ignore]), - ("@scope/package-name/file$".into(), vec![AliasValue::from("/c/dir")]), - ], - modules: vec!["/".into()], - ..ResolveOptions::default() - }, - ); - - #[rustfmt::skip] - let pass = [ - ("should resolve a not aliased module 1", "a", "/a/index"), - ("should resolve a not aliased module 2", "a/index", "/a/index"), - ("should resolve a not aliased module 3", "a/dir", "/a/dir/index"), - ("should resolve a not aliased module 4", "a/dir/index", "/a/dir/index"), - ("should resolve an aliased module 1", "aliasA", "/a/index"), - ("should resolve an aliased module 2", "aliasA/index", "/a/index"), - ("should resolve an aliased module 3", "aliasA/dir", "/a/dir/index"), - ("should resolve an aliased module 4", "aliasA/dir/index", "/a/dir/index"), - ("should resolve '#' alias 1", "#", "/c/dir/index"), - ("should resolve '#' alias 2", "#/index", "/c/dir/index"), - ("should resolve '@' alias 1", "@", "/c/dir/index"), - ("should resolve '@' alias 2", "@/index", "/c/dir/index"), - ("should resolve a recursive aliased module 1", "recursive", "/recursive/dir/index"), - ("should resolve a recursive aliased module 2", "recursive/index", "/recursive/dir/index"), - ("should resolve a recursive aliased module 3", "recursive/dir", "/recursive/dir/index"), - ("should resolve a recursive aliased module 4", "recursive/dir/index", "/recursive/dir/index"), - ("should resolve a file aliased module 1", "b", "/a/index"), - ("should resolve a file aliased module 2", "c", "/a/index"), - ("should resolve a file aliased module with a query 1", "b?query", "/a/index?query"), - ("should resolve a file aliased module with a query 2", "c?query", "/a/index?query"), - ("should resolve a path in a file aliased module 1", "b/index", "/b/index"), - ("should resolve a path in a file aliased module 2", "b/dir", "/b/dir/index"), - ("should resolve a path in a file aliased module 3", "b/dir/index", "/b/dir/index"), - ("should resolve a path in a file aliased module 4", "c/index", "/c/index"), - ("should resolve a path in a file aliased module 5", "c/dir", "/c/dir/index"), - ("should resolve a path in a file aliased module 6", "c/dir/index", "/c/dir/index"), - ("should resolve a file aliased file 1", "d", "/c/index"), - ("should resolve a file aliased file 2", "d/dir/index", "/c/dir/index"), - ("should resolve a file in multiple aliased dirs 1", "multiAlias/dir/file", "/e/dir/file"), - ("should resolve a file in multiple aliased dirs 2", "multiAlias/anotherDir", "/e/anotherDir/index"), - // not part of enhanced-resolve, added to make sure query in alias value works - ("should resolve query in alias value", "alias_query?query_before", "/a/index?query_after"), - ("should resolve query in alias value", "alias_fragment#fragment_before", "/a/index#fragment_after"), - ("should resolve dashed name", "dashed-name", "/dashed-name"), - ("should resolve scoped package name with sub dir", "@scope/package-name/file", "/c/dir/index"), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - - #[rustfmt::skip] - let ignore = [ - ("should resolve an ignore module", "ignored", ResolveError::Ignored(f.join("ignored"))) - ]; - - for (comment, request, expected) in ignore { - let resolution = resolver.resolve(f, request); - assert_eq!(resolution, Err(expected), "{comment} {request}"); - } -} - -// Not part of enhanced-resolve -#[test] -fn infinite_recursion() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![ - ("./a".into(), vec![AliasValue::from("./b")]), - ("./b".into(), vec![AliasValue::from("./a")]), - ], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(f, "./a"); - assert_eq!(resolution, Err(ResolveError::Recursion)); -} - -fn check_slash(path: &Path) { - let s = path.to_string_lossy().to_string(); - #[cfg(target_os = "windows")] - { - assert!(!s.contains('/'), "{s}"); - assert!(s.contains('\\'), "{s}"); - } - #[cfg(not(target_os = "windows"))] - { - assert!(s.contains('/'), "{s}"); - assert!(!s.contains('\\'), "{s}"); - } -} - -#[test] -fn absolute_path() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![(f.join("foo").to_str().unwrap().to_string(), vec![AliasValue::Ignore])], - modules: vec![f.clone().to_str().unwrap().to_string()], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(&f, "foo/index"); - assert_eq!(resolution, Err(ResolveError::Ignored(f.join("foo")))); -} - -#[test] -fn system_path() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![("@app".into(), vec![AliasValue::from(f.join("alias").to_string_lossy())])], - ..ResolveOptions::default() - }); - - let specifiers = ["@app/files/a", "@app/files/a.js"]; - - for specifier in specifiers { - let path = resolver.resolve(&f, specifier).map(Resolution::into_path_buf).unwrap(); - assert_eq!(path, f.join("alias/files/a.js")); - check_slash(&path); - } -} - -#[test] -fn alias_is_full_path() { - let f = super::fixture(); - let dir = f.join("foo"); - let dir_str = dir.to_string_lossy().to_string(); - - let resolver = Resolver::new(ResolveOptions { - alias: vec![("@".into(), vec![AliasValue::Path(dir_str.clone())])], - ..ResolveOptions::default() - }); - - let mut ctx = ResolveContext::default(); - - let specifiers = [ - "@/index".to_string(), - "@/index.js".to_string(), - // specifier has multiple `/` for reasons we'll never know - "@////index".to_string(), - // specifier is a full path - dir_str, - ]; - - for specifier in specifiers { - let resolution = resolver.resolve_with_context(&f, &specifier, &mut ctx); - assert_eq!(resolution.map(|r| r.full_path()), Ok(dir.join("index.js"))); - } - - for path in ctx.file_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - check_slash(&path); - } - - for path in ctx.missing_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - check_slash(&path); - if let Some(path) = path.parent() { - assert!(!path.is_file(), "{path:?} must not be a file"); - } - } -} - -// For the `should_stop` variable in `load_alias` -#[test] -fn all_alias_values_are_not_found() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![( - "m1".to_string(), - vec![AliasValue::Path(f.join("node_modules").join("m2").to_string_lossy().to_string())], - )], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(&f, "m1/a.js"); - assert_eq!(resolution, Err(ResolveError::NotFound("m1/a.js".to_string()))); -} - -#[test] -fn alias_fragment() { - let f = super::fixture(); - - let data = [ - // enhanced-resolve has `#` prepended with a `\0`, they are removed from the - // following 3 expected test results. - // See https://github.com/webpack/enhanced-resolve#escaping - ( - "handle fragment edge case (no fragment)", - "./no#fragment/#/#", - f.join("no#fragment/#/#.js"), - ), - ("handle fragment edge case (fragment)", "./no#fragment/#/", f.join("no.js#fragment/#/")), - ( - "handle fragment escaping", - "./no\0#fragment/\0#/\0##fragment", - f.join("no#fragment/#/#.js#fragment"), - ), - ]; - - for (comment, request, expected) in data { - let resolver = Resolver::new(ResolveOptions { - alias: vec![("foo".to_string(), vec![AliasValue::Path(request.to_string())])], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f, "foo").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } -} - -#[test] -fn alias_try_fragment_as_path() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![( - "#".to_string(), - vec![AliasValue::Path(f.join("#").to_string_lossy().to_string())], - )], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(&f, "#/a").map(|r| r.full_path()); - assert_eq!(resolution, Ok(f.join("#").join("a.js"))); -} diff --git a/src/tests/browser_field.rs b/src/tests/browser_field.rs deleted file mode 100644 index 171ee099..00000000 --- a/src/tests/browser_field.rs +++ /dev/null @@ -1,189 +0,0 @@ -//! - -use crate::{AliasValue, ResolveError, ResolveOptions, Resolver}; - -#[test] -fn ignore() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![ - vec!["browser".into()], - vec!["innerBrowser1".into()], - vec!["innerBrowser2".into()], - vec![], - ], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - (f.clone(), "./lib/ignore", f.join("lib/ignore.js")), - (f.clone(), "./lib/ignore.js", f.join("lib/ignore.js")), - (f.join("lib"), "./ignore", f.join("lib/ignore.js")), - (f.join("lib"), "./ignore.js", f.join("lib/ignore.js")), - ]; - - for (path, request, expected) in data { - let resolution = resolver.resolve(&path, request); - let expected = ResolveError::Ignored(expected); - assert_eq!(resolution, Err(expected), "{path:?} {request}"); - } -} - -#[test] -fn shared_resolvers() { - let f = super::fixture().join("browser-module"); - - let resolver1 = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["innerBrowser1".into(), "field".into(), "browser".into()]], - ..ResolveOptions::default() - }); - let resolved_path = resolver1.resolve(&f, "./lib/main1.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("lib/main.js"))); - - let resolver2 = resolver1.clone_with_options(ResolveOptions { - alias_fields: vec![vec!["innerBrowser2".into(), "browser".into()]], - ..ResolveOptions::default() - }); - let resolved_path = resolver2.resolve(&f, "./lib/main2.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("./lib/replaced.js"))); -} - -#[test] -fn replace_file() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![ - vec!["browser".into()], - vec!["innerBrowser1".into(), "field2".into(), "browser".into()], // not presented - vec!["innerBrowser1".into(), "field".into(), "browser".into()], - vec!["innerBrowser2".into(), "browser".into()], - ], - // Not part of enhanced-resolve. Added to make sure no interaction between these two fields. - main_fields: vec!["browser".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - ("should replace a file 1", f.clone(), "./lib/replaced", f.join("lib/browser.js")), - ("should replace a file 2", f.clone(), "./lib/replaced.js", f.join("lib/browser.js")), - ("should replace a file 3", f.join("lib"), "./replaced", f.join("lib/browser.js")), - ("should replace a file 4", f.join("lib"), "./replaced.js", f.join("lib/browser.js")), - ("should replace a module with a file 1", f.clone(), "module-a", f.join("browser/module-a.js")), - ("should replace a module with a file 2", f.join("lib"), "module-a", f.join("browser/module-a.js")), - ("should replace a module with a module 1", f.clone(), "module-b", f.join("node_modules/module-c.js")), - ("should replace a module with a module 2", f.join("lib"), "module-b", f.join("node_modules/module-c.js")), - ("should resolve in nested property 1", f.clone(), "./lib/main1.js", f.join("lib/main.js")), - ("should resolve in nested property 2", f.clone(), "./lib/main2.js", f.join("lib/browser.js")), - ("should check only alias field properties", f.clone(), "./toString", f.join("lib/toString.js")), - // not part of enhanced-resolve - ("recursion", f.clone(), "module-c", f.join("node_modules/module-c.js")), - ("resolve self 1", f.clone(), "./lib/main.js", f.join("lib/main.js")), - ("resolve self 2", f.clone(), "./main.js", f.join("lib/main.js")), - ]; - - for (comment, path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn recurse_fail() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - ("recurse non existent", f.clone(), "./lib/non-existent.js", ResolveError::NotFound("./lib/non-existent.js".into())), - ("path partial match 1", f.clone(), "./xyz.js", ResolveError::NotFound("./xyz.js".into())), - ("path partial match 2", f, "./lib/xyz.js", ResolveError::NotFound("./lib/xyz.js".into())), - ]; - - for (comment, path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Err(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn broken() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - // The browser field string value should be ignored - (f.clone(), "browser-module-broken", Ok(f.join("node_modules/browser-module-broken/main.js"))), - (f.join("browser-module"), "./number", Err(ResolveError::NotFound("./number".into()))), - ]; - - for (path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, expected, "{path:?} {request}"); - } -} - -#[test] -fn crypto_js() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - fallback: vec![( - "crypto".into(), - vec![AliasValue::from(f.join("lib.js").to_string_lossy())], - )], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(f.join("crypto-js"), "crypto").map(|r| r.full_path()); - assert_eq!(resolved_path, Err(ResolveError::Ignored(f.join("crypto-js")))); -} - -// https://github.com/webpack/webpack/blob/87660921808566ef3b8796f8df61bd79fc026108/test/cases/resolving/browser-field/index.js#L40-L43 -#[test] -fn recursive() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - let data = [ - ("should handle recursive file 1", f.clone(), "recursive-file/a"), - ("should handle recursive file 2", f.clone(), "recursive-file/b"), - ("should handle recursive file 3", f.clone(), "recursive-file/c"), - ("should handle recursive file 4", f, "recursive-file/d"), - ]; - - for (comment, path, request) in data { - let resolved_path = resolver.resolve(&path, request); - assert_eq!(resolved_path, Err(ResolveError::Recursion), "{comment} {path:?} {request}"); - } -} - -#[test] -fn with_query() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "./foo").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("lib").join("browser.js?query"))); -} diff --git a/src/tests/builtins.rs b/src/tests/builtins.rs deleted file mode 100644 index 5d6d14d9..00000000 --- a/src/tests/builtins.rs +++ /dev/null @@ -1,121 +0,0 @@ -use std::path::Path; - -use crate::{ResolveError, ResolveOptions, Resolver}; - -#[test] -fn builtins_off() { - let f = Path::new("/"); - let resolver = Resolver::default(); - let resolved_path = resolver.resolve(f, "zlib").map(|r| r.full_path()); - assert_eq!(resolved_path, Err(ResolveError::NotFound("zlib".into()))); -} - -#[test] -fn builtins() { - let f = Path::new("/"); - - let resolver = Resolver::new(ResolveOptions::default().with_builtin_modules(true)); - - let pass = [ - "_http_agent", - "_http_client", - "_http_common", - "_http_incoming", - "_http_outgoing", - "_http_server", - "_stream_duplex", - "_stream_passthrough", - "_stream_readable", - "_stream_transform", - "_stream_wrap", - "_stream_writable", - "_tls_common", - "_tls_wrap", - "assert", - "assert/strict", - "async_hooks", - "buffer", - "child_process", - "cluster", - "console", - "constants", - "crypto", - "dgram", - "diagnostics_channel", - "dns", - "dns/promises", - "domain", - "events", - "fs", - "fs/promises", - "http", - "http2", - "https", - "inspector", - "module", - "net", - "os", - "path", - "path/posix", - "path/win32", - "perf_hooks", - "process", - "punycode", - "querystring", - "readline", - "repl", - "stream", - "stream/consumers", - "stream/promises", - "stream/web", - "string_decoder", - "sys", - "timers", - "timers/promises", - "tls", - "trace_events", - "tty", - "url", - "util", - "util/types", - "v8", - "vm", - "worker_threads", - "zlib", - ]; - - for request in pass { - let prefixed_request = format!("node:{request}"); - for request in [prefixed_request.clone(), request.to_string()] { - let resolved_path = resolver.resolve(f, &request).map(|r| r.full_path()); - let err = ResolveError::Builtin(prefixed_request.clone()); - assert_eq!(resolved_path, Err(err), "{request}"); - } - } -} - -#[test] -fn fail() { - let f = Path::new("/"); - let resolver = Resolver::new(ResolveOptions::default().with_builtin_modules(true)); - let request = "xxx"; - let resolved_path = resolver.resolve(f, request); - let err = ResolveError::NotFound(request.to_string()); - assert_eq!(resolved_path, Err(err), "{request}"); -} - -#[test] -fn imports() { - let f = super::fixture().join("builtins"); - let resolver = Resolver::new(ResolveOptions { - builtin_modules: true, - condition_names: vec!["node".into()], - ..ResolveOptions::default() - }); - - for request in ["#fs", "#http"] { - let resolved_path = resolver.resolve(f.clone(), request).map(|r| r.full_path()); - let err = ResolveError::Builtin(format!("node:{}", request.trim_start_matches('#'))); - assert_eq!(resolved_path, Err(err)); - } -} diff --git a/src/tests/dependencies.rs b/src/tests/dependencies.rs deleted file mode 100644 index bcc2355b..00000000 --- a/src/tests/dependencies.rs +++ /dev/null @@ -1,110 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/dependencies.test.js - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows { - use rustc_hash::FxHashSet; - use std::path::PathBuf; - - use crate::{ResolveContext, ResolveOptions, ResolverGeneric}; - - use super::super::memory_fs::MemoryFS; - - fn file_system() -> MemoryFS { - MemoryFS::new(&[ - ("/a/b/node_modules/some-module/index.js", ""), - ("/a/node_modules/module/package.json", r#"{"main":"entry.js"}"#), - ("/a/node_modules/module/file.js", r#"{"main":"entry.js"}"#), - ("/modules/other-module/file.js", ""), - ]) - } - - #[test] - fn test() { - let file_system = file_system(); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - extensions: vec![".json".into(), ".js".into()], - modules: vec!["/modules".into(), "node_modules".into()], - ..ResolveOptions::default() - }, - ); - - let data = [ - ( - "middle module request", - "/a/b/c", - "module/file", - "/a/node_modules/module/file.js", - // These dependencies are different from enhanced-resolve due to different code path to - // querying the file system - vec![ - // 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", - // "/", - ], - vec![ - // missing package.jsons - // "/a/b/c/package.json", - "/a/b/package.json", - "/a/package.json", - "/package.json", - // missing modules directories - "/a/b/c", - // "/a/b/c/node_modules", - // missing single file modules - "/modules/module", - "/a/b/node_modules/module", - // missing files with alternative extensions - "/a/node_modules/module/file", - "/a/node_modules/module/file.json", - ], - ), - ( - "fast found module", - "/a/b/c", - "other-module/file.js", - "/modules/other-module/file.js", - // These dependencies are different from enhanced-resolve due to different code path to - // querying the file system - vec![ - // symlink checks - "/modules/other-module/file.js", - // "/modules/other-module", - // "/modules", - // "/", - ], - vec![ - // missing package.jsons - // "/a/b/c/package.json", - "/a/b/c", - "/a/b/package.json", - "/a/package.json", - "/package.json", - "/modules/other-module/package.json", - "/modules/package.json", - ], - ), - ]; - - for (name, context, request, result, file_dependencies, missing_dependencies) in data { - let mut ctx = ResolveContext::default(); - let path = PathBuf::from(context); - let resolved = - resolver.resolve_with_context(path, request, &mut ctx).map(|r| r.full_path()); - assert_eq!(resolved, Ok(PathBuf::from(result))); - let file_dependencies = - FxHashSet::from_iter(file_dependencies.iter().map(PathBuf::from)); - let missing_dependencies = - FxHashSet::from_iter(missing_dependencies.iter().map(PathBuf::from)); - assert_eq!(ctx.file_dependencies, file_dependencies, "{name}"); - assert_eq!(ctx.missing_dependencies, missing_dependencies, "{name}"); - } - } -} diff --git a/src/tests/exports_field.rs b/src/tests/exports_field.rs deleted file mode 100644 index fd68c1f7..00000000 --- a/src/tests/exports_field.rs +++ /dev/null @@ -1,2546 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/exportsField.test.js -//! -//! The huge exports field test cases are at the bottom of this file. - -use crate::{Ctx, PathUtil, ResolveError, ResolveOptions, Resolver}; -use serde_json::json; -use std::path::Path; - -#[test] -fn test_simple() { - let f = super::fixture().join("exports-field"); - let f2 = super::fixture().join("exports-field2"); - let f4 = super::fixture().join("exports-field-error"); - let f5 = super::fixture().join("imports-exports-wildcard"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - fully_specified: true, - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("resolve root using exports field, not a main field", f.clone(), "exports-field", f.join("node_modules/exports-field/x.js")), - ("resolver should respect condition names", f.clone(), "exports-field/dist/main.js", f.join("node_modules/exports-field/lib/lib2/main.js")), - // enhanced_resolve behaves differently to node.js. enhanced_resolve fallbacks when an - // array item is unresolved, where as node.js fallbacks when an array has an - // InvalidPackageTarget error. - // ("resolver should respect fallback", f2.clone(), "exports-field/dist/browser.js", f2.join("node_modules/exports-field/lib/browser.js")), - // The following two tests require fallback from array values, the path is changed here to - // only test query and fragment. - ("resolver should respect query parameters #1", f2.clone(), "exports-field/dist/main.js?foo", f2.join("node_modules/exports-field/lib/lib2/main.js?foo")), - ("resolver should respect fragment parameters #1", f2.clone(), "exports-field/dist/main.js#foo", f2.join("node_modules/exports-field/lib/lib2/main.js#foo")), - ("relative path should work, if relative path as request is used", f.clone(), "./node_modules/exports-field/lib/main.js", f.join("node_modules/exports-field/lib/main.js")), - ("self-resolving root", f.clone(), "@exports-field/core", f.join("a.js")), - ("should resolve with wildcard pattern #1", f5.clone(), "m/features/f.js", f5.join("node_modules/m/src/features/f.js")), - ("should resolve with wildcard pattern #2", f5.clone(), "m/features/y/y.js", f5.join("node_modules/m/src/features/y/y.js")), - ("should resolve with wildcard pattern #3", f5.clone(), "m/features-no-ext/y/y.js", f5.join("node_modules/m/src/features/y/y.js")), - ("should resolve with wildcard pattern #4", f5.clone(), "m/middle/nested/f.js", f5.join("node_modules/m/src/middle/nested/f.js")), - ("should resolve with wildcard pattern #5", f5.clone(), "m/middle-1/nested/f.js", f5.join("node_modules/m/src/middle-1/nested/f.js")), - ("should resolve with wildcard pattern #6", f5.clone(), "m/middle-2/nested/f.js", f5.join("node_modules/m/src/middle-2/nested/f.js")), - ("should resolve with wildcard pattern #7", f5.clone(), "m/middle-3/nested/f", f5.join("node_modules/m/src/middle-3/nested/f/nested/f.js")), - ("should resolve with wildcard pattern #8", f5.clone(), "m/middle-4/f/nested", f5.join("node_modules/m/src/middle-4/f/f.js")), - ("should resolve with wildcard pattern #9", f5.clone(), "m/middle-5/f$/$", f5.join("node_modules/m/src/middle-5/f$/$.js")), - ]; - - // Not needed or snapshot: - // * should log the correct info - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } - - let p = f.join("node_modules/exports-field/package.json"); - let p2 = f2.join("node_modules/exports-field/package.json"); - let p4 = f4.join("node_modules/exports-field/package.json"); - let p5 = f5.join("node_modules/m/package.json"); - - #[rustfmt::skip] - let fail = [ - // ("throw error if extension not provided", f2.clone(), "exports-field/dist/main", ResolveError::NotFound(f2.join("node_modules/exports-field/lib/lib2/main"))), - ("resolver should respect query parameters #2. Direct matching", f2.clone(), "exports-field?foo", ResolveError::PackagePathNotExported("./?foo".into(), p2.clone())), - ("resolver should respect fragment parameters #2. Direct matching", f2, "exports-field#foo", ResolveError::PackagePathNotExported("./#foo".into(), p2)), - ("relative path should not work with exports field", f.clone(), "./node_modules/exports-field/dist/main.js", ResolveError::NotFound("./node_modules/exports-field/dist/main.js".into())), - ("backtracking should not work for request", f.clone(), "exports-field/dist/../../../a.js", ResolveError::InvalidPackageTarget("./lib/../../../a.js".to_string(), "./dist/".to_string(), p.clone())), - ("backtracking should not work for exports field target", f.clone(), "exports-field/dist/a.js", ResolveError::InvalidPackageTarget("./../../a.js".to_string(), "./dist/a.js".to_string(), p.clone())), - ("not exported error", f.clone(), "exports-field/anything/else", ResolveError::PackagePathNotExported("./anything/else".to_string(), p.clone())), - ("request ending with slash #1", f.clone(), "exports-field/", ResolveError::PackagePathNotExported("./".to_string(), p.clone())), - ("request ending with slash #2", f.clone(), "exports-field/dist/", ResolveError::PackagePathNotExported("./dist/".to_string(), p.clone())), - ("request ending with slash #3", f.clone(), "exports-field/lib/", ResolveError::PackagePathNotExported("./lib/".to_string(), p)), - ("should throw error if target is invalid", f4, "exports-field", ResolveError::InvalidPackageTarget("./a/../b/../../pack1/index.js".to_string(), ".".to_string(), p4)), - ("throw error if exports field is invalid", f.clone(), "invalid-exports-field", ResolveError::InvalidPackageConfig(f.join("node_modules/invalid-exports-field/package.json"))), - ("should throw error if target is 'null'", f5, "m/features/internal/file.js", ResolveError::PackagePathNotExported("./features/internal/file.js".to_string(), p5)), - ]; - - for (comment, path, request, error) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!(resolution, Err(error), "{comment} {path:?} {request}"); - } -} - -// resolve using exports field, not a browser field #1 -#[test] -fn exports_not_browser_field1() { - let f = super::fixture().join("exports-field"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - condition_names: vec!["webpack".into()], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "exports-field/dist/main.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("node_modules/exports-field/lib/lib2/main.js"))); -} - -// resolve using exports field and a browser alias field #2 -#[test] -fn exports_not_browser_field2() { - let f2 = super::fixture().join("exports-field2"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - extensions: vec![".js".into()], - condition_names: vec!["node".into()], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f2, "exports-field/dist/main.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f2.join("node_modules/exports-field/lib/browser.js"))); -} - -// should resolve extension without fullySpecified -#[test] -fn extension_without_fully_specified() { - let f2 = super::fixture().join("exports-field2"); - - let commonjs_resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - let resolved_path = - commonjs_resolver.resolve(&f2, "exports-field/dist/main").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f2.join("node_modules/exports-field/lib/lib2/main.js"))); -} - -#[test] -fn field_name_path() { - let f2 = super::fixture().join("exports-field2"); - let f3 = super::fixture().join("exports-field3"); - - // field name path #1 #2 #3 - let exports_fields = [ - vec![vec!["exportsField".into(), "exports".into()]], - vec![vec!["exportsField".into(), "exports".into()], vec!["exports".into()]], - vec![vec!["exports".into()], vec!["exportsField".into(), "exports".into()]], - ]; - - for exports_fields in exports_fields { - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - exports_fields, - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/main.js"))); - } - - // field name path #4 - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - exports_fields: vec![vec!["exports".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f2, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f2.join("node_modules/exports-field/index.js"))); - - // field name path #5 - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - exports_fields: vec![vec!["ex".into()], vec!["exports_field".into(), "exports".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/index"))); - - // non-compliant export targeting a directory - let resolver = Resolver::new(ResolveOptions { - exports_fields: vec![vec!["broken".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/src/index.js"))); -} - -#[test] -fn shared_resolvers() { - let f3 = super::fixture().join("exports-field3"); - - let resolver1 = Resolver::new(ResolveOptions { - exports_fields: vec![vec!["exportsField".into(), "exports".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver1.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/main.js"))); - - let resolver2 = resolver1.clone_with_options(ResolveOptions { - exports_fields: vec![vec!["ex".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver2.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/index"))); -} - -#[test] -fn extension_alias_1_2() { - let f = super::fixture().join("exports-field-and-extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - extension_alias: vec![(".js".into(), vec![".ts".into(), ".js".into()])], - fully_specified: true, - condition_names: vec!["webpack".into(), "default".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve with the `extensionAlias` option", f.clone(), "@org/pkg/string.js", f.join("node_modules/@org/pkg/dist/string.js")), - ("should resolve with the `extensionAlias` option #2", f.clone(), "pkg/string.js", f.join("node_modules/pkg/dist/string.js")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn extension_alias_3() { - let f = super::fixture().join("exports-field-and-extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - extension_alias: vec![( - ".js".into(), - vec![".foo".into(), ".baz".into(), ".baz".into(), ".ts".into(), ".js".into()], - )], - fully_specified: true, - condition_names: vec!["webpack".into(), "default".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve with the `extensionAlias` option #3", f.clone(), "pkg/string.js", f.join("node_modules/pkg/dist/string.js")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn extension_alias_throw_error() { - let f = super::fixture().join("exports-field-and-extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - extension_alias: vec![(".js".into(), vec![".ts".into()])], - fully_specified: true, - condition_names: vec!["webpack".into(), "default".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let fail = [ - // enhanced-resolve has two test cases that are exactly the same here - // https://github.com/webpack/enhanced-resolve/blob/a998c7d218b7a9ec2461fc4fddd1ad5dd7687485/test/exportsField.test.js#L2976-L3024 - ("should throw error with the `extensionAlias` option", f, "pkg/string.js", ResolveError::ExtensionAlias), - // TODO: The error is PackagePathNotExported in enhanced-resolve - // ("should throw error with the `extensionAlias` option", f.clone(), "pkg/string.js", ResolveError::PackagePathNotExported("node_modules/pkg/dist/string.ts".to_string())), - ]; - - for (comment, path, request, error) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!(resolution, Err(error), "{comment} {path:?} {request}"); - } -} - -// Small script for generating the test cases from enhanced-resolve -// for (c of testCases) { -// console.log("TestCase {") -// console.log(`name: ${JSON.stringify(c.name)},`) -// if (c.expect instanceof Error) { -// console.log(`expect: None,`) -// } else { -// console.log(`expect: Some(vec!${JSON.stringify(c.expect)}),`) -// } -// console.log(`exports_field: exports_field(json!(${JSON.stringify(c.suite[0], null, 2)})),`) -// console.log(`request: "${c.suite[1]}",`) -// console.log(`condition_names: vec!${JSON.stringify(c.suite[2])},`) -// console.log("},") -//} -struct TestCase { - name: &'static str, - expect: Option>, - exports_field: serde_json::Value, - request: &'static str, - condition_names: Vec<&'static str>, -} - -#[allow(clippy::needless_pass_by_value)] -fn exports_field(value: serde_json::Value) -> serde_json::Value { - value -} - -#[test] -fn test_cases() { - let test_cases = [ - TestCase { - name: "sample #1", - expect: Some(vec!["./dist/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/": { - "import": [ - "./dist/", - "./src/" - ], - "webpack": "./wp/" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "sample #1", - expect: Some(vec!["./src/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/": { - "import": [ - "./src/" - ], - "webpack": "./wp/" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - TestCase { - name: "sample #1 (wildcard)", - expect: Some(vec!["./dist/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/*": { - "import": [ - "./dist/*", - "./src/*" - ], - "webpack": "./wp/*" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "sample #1 (wildcard)", - expect: Some(vec!["./src/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/*": { - "import": [ - "./src/*" - ], - "webpack": "./wp/*" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - TestCase { - name: "sample #2", - expect: Some(vec!["./data/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./timezones/": "./data/timezones/" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #2 (wildcard)", - expect: Some(vec!["./data/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./timezones/*": "./data/timezones/*" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #3", - expect: Some(vec!["./data/timezones/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./": "./data/timezones/" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #3 (wildcard)", - expect: Some(vec!["./data/timezones/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./*": "./data/timezones/*.mjs" - })), - request: "./timezones/pdt", - condition_names: vec![], - }, - TestCase { - name: "sample #4", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./lib/": { - "browser": [ - "./browser/" - ] - }, - "./dist/index.js": { - "node": "./index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #4 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "node": "./index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #5", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/": { - "browser": [ - "./browser/" - ] - }, - "./dist/index.js": { - "node": "./index.js", - "default": "./browser/index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #5 (wildcard)", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "node": "./index.js", - "default": "./browser/index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./dist/a": "./dist/index.js" - })), - request: "./dist/aaa", - condition_names: vec![], - }, - TestCase { - name: "sample #7", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./dist/a/a/": "./dist/index.js" - })), - request: "./dist/a/a", - condition_names: vec![], - }, - TestCase { - name: "sample #7 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./dist/a/a/*": "./dist/index.js" - })), - request: "./dist/a/a", - condition_names: vec![], - }, - TestCase { - name: "sample #8", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": "./index.js" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #9", - expect: Some(vec!["./main.js"]), - exports_field: exports_field(json!({ - "./index.js": "./main.js" - })), - request: "./index.js", - condition_names: vec![], - }, - TestCase { - name: "sample #10", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #11", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./bar#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #12", - expect: Some(vec!["./ok.js#abc"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/ok.js#abc", - condition_names: vec![], - }, - TestCase { - name: "sample #12", - expect: Some(vec!["./ok.js#abc"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/ok.js#abc", - condition_names: vec![], - }, - TestCase { - name: "sample #13", - expect: Some(vec!["./ok.js?abc"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/ok.js?abc", - condition_names: vec![], - }, - TestCase { - name: "sample #14", - expect: Some(vec!["./🎉.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/🎉.js", - condition_names: vec![], - }, - TestCase { - name: "sample #15", - expect: Some(vec!["./%F0%9F%8E%89.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/%F0%9F%8E%89.js", - condition_names: vec![], - }, - TestCase { - name: "sample #16", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./🎉", - condition_names: vec![], - }, - TestCase { - name: "sample #17", - expect: Some(vec!["./other.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./%F0%9F%8E%89", - condition_names: vec![], - }, - TestCase { - name: "sample #18", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./module", - condition_names: vec![], - }, - TestCase { - name: "sample #19", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./module#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #20", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./module?foo", - condition_names: vec![], - }, - TestCase { - name: "sample #21", - expect: Some(vec!["./zizizi"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./z*z*z*" - })), - request: "./#zippi", - condition_names: vec![], - }, - TestCase { - name: "sample #22", - expect: Some(vec!["./d?e?f"]), - exports_field: exports_field(json!({ - "./a?b?c/": "./" - })), - request: "./a?b?c/d?e?f", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #1", - expect: Some(vec!["./dist/index.js"]), - exports_field: exports_field(json!({ - ".": "./dist/index.js" - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #2", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./": "./", - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #3", - expect: Some(vec!["./dist/a.js"]), - exports_field: exports_field(json!({ - "./dist/": "./dist/", - "./dist/*": "./dist/*", - "./dist*": "./dist*", - "./dist/index.js": "./dist/a.js" - })), - request: "./dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #4", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./": { - "browser": [ - "./browser/" - ] - }, - "./*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "browser": "./index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #5", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./": { - "browser": [ - "./browser/" - ] - }, - "./*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "node": "./node.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #6", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - ".": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #7", - expect: Some(vec!["./src/index.js"]), // `enhanced_resolve` is `None` - exports_field: exports_field(json!({ - ".": { - "default": "./src/index.js", - "browser": "./index.js", - "node": "./src/node/index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #8", - expect: Some(vec!["./src/index.js"]), - exports_field: exports_field(json!({ - ".": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #9", - expect: Some(vec!["./index"]), - exports_field: exports_field(json!({ - ".": "./index" - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #10", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./index": "./index.js" - })), - request: "./index", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #11", - expect: Some(vec!["./foo.js"]), - exports_field: exports_field(json!({ - "./": "./", - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #12", - expect: Some(vec!["./foo/bar/baz.js"]), - exports_field: exports_field(json!({ - "./": "./", - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo/bar/baz.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #13", - expect: Some(vec!["./foo/bar/baz.js"]), - exports_field: exports_field(json!({ - "./": "./", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo/bar/baz.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #14", - expect: Some(vec!["./foo/bar/baz.js"]), - exports_field: exports_field(json!({ - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo/bar/baz.js", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #1", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "require": "./require.js" - }, { - "import": "./import.mjs" - }] - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #2", - expect: Some(vec!["./import.mjs"]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "require": "./require.js" - }, { - "import": "./import.mjs" - }] - })), - request: ".", - condition_names: vec!["import"], - }, - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./require.js"]), - exports_field: exports_field(json!({ - ".": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./import.mjs"]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "import": "./import.mjs" - }] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./require.js"]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "require": [ - "./require.js" - ] - }, { - "import": [ - "./import.mjs", - "./import.js" - ] - }] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./import.mjs"]), - exports_field: exports_field(json!({ - ".": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "./import.mjs", - "./import.js" - ] - } - ] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./import.js"]), - exports_field: exports_field(json!({ - ".": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "./import.js" - ] - } - ] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "mapping to a folder root #1", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./timezones": "./data/timezones/" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #2", - expect: None, - exports_field: exports_field(json!({ - "./timezones/": "./data/timezones" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #3", - expect: Some(vec!["./data/timezones/pdt/index.mjs"]), - exports_field: exports_field(json!({ - "./timezones/pdt/": "./data/timezones/pdt/" - })), - request: "./timezones/pdt/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #3 (wildcard)", - expect: Some(vec!["./data/timezones/pdt/index.mjs"]), - exports_field: exports_field(json!({ - "./timezones/pdt/*": "./data/timezones/pdt/*" - })), - request: "./timezones/pdt/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #4", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./": "./timezones/" - })), - request: "./pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #4 (wildcard)", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./*": "./timezones/*" - })), - request: "./pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #5", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./": "./" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #5 (wildcard)", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./*": "./*" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #6", - expect: None, - exports_field: exports_field(json!({ - "./": "." - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #6 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "./*": "." - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #7", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": "./" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #7 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": "./*" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #1", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./": "./", - "./dist/": "./lib/" - })), - request: "./dist/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #1 (wildcard)", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./*": "./*", - "./dist/*": "./lib/*" - })), - request: "./dist/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #2", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/": "./dist/utils/", - "./dist/": "./lib/" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #2 (wildcard)", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/*": "./dist/utils/*", - "./dist/*": "./lib/*" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #3", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/index.js": "./dist/utils/index.js", - "./dist/utils/": "./dist/utils/index.mjs", - "./dist/": "./lib/" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #3 (wildcard)", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/index.js": "./dist/utils/index.js", - "./dist/utils/*": "./dist/utils/index.mjs", - "./dist/*": "./lib/*" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #4", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./": { - "browser": "./browser/" - }, - "./dist/": "./lib/" - })), - request: "./dist/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "the longest matching path prefix is prioritized #4 (wildcard)", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./*": { - "browser": "./browser/*" - }, - "./dist/*": "./lib/*" - })), - request: "./dist/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #1", - // `lodash/` does not start with './' so fallbacks to util - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "conditional mapping folder #1", - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": [ - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #1 (wildcard)", - // `lodash/` does not start with './' so fallbacks to util - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": [ - "lodash/*", - "./utils/*" - ], - "node": [ - "./utils-node/*" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "conditional mapping folder #1 (wildcard)", - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": [ - "./utils/*" - ], - "node": [ - "./utils-node/*" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #2", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./node/" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "conditional mapping folder #2 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "webpack": "./wpk/*", - "browser": [ - "lodash/*", - "./utils/*" - ], - "node": [ - "./node/*" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "conditional mapping folder #3", - expect: Some(vec!["./wpk/index.mjs"]), - exports_field: exports_field(json!({ - "./utils/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils/" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "conditional mapping folder #3 (wildcard)", - expect: Some(vec!["./wpk/index.mjs"]), - exports_field: exports_field(json!({ - "./utils/*": { - "webpack": "./wpk/*", - "browser": [ - "lodash/*", - "./utils/*" - ], - "node": [ - "./utils/*" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "incorrect exports field #1", - expect: None, - exports_field: exports_field(json!({ - "/utils/": "./a/" - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #2", - expect: None, - exports_field: exports_field(json!({ - "./utils/": "/a/" - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #3", - expect: None, - exports_field: exports_field(json!({ - "/utils/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #4", - expect: None, - exports_field: exports_field(json!({ - "./utils/": { - "browser": "/a/", - "default": "/b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #4 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "/a/", - "default": "/b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #5", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index": "./a/index.js" - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index.mjs": "./a/index.js" - })), - request: "./utils/index", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #7", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #8", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index.mjs": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - // Requests that are not `./` does not apply to `package_exports_resolve` - // TestCase { - // name: "incorrect request #1", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": "./a/" - // })), - // request: "/utils/index.mjs", - // condition_names: vec![], - // }, - // TestCase { - // name: "incorrect request #2", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": { - // "browser": "./a/", - // "default": "./b/" - // } - // })), - // request: "/utils/index.mjs", - // condition_names: vec!["browser"], - // }, - // TestCase { - // name: "incorrect request #3", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": { - // "browser": "./a/", - // "default": "./b/" - // } - // })), - // request: "../utils/index.mjs", - // condition_names: vec!["browser"], - // }, - // TestCase { - // name: "incorrect request #4", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": { - // "browser": "./a/", - // "default": "./b/" - // } - // })), - // request: "/utils/index.mjs/", - // condition_names: vec!["browser"], - // }, - TestCase { - name: "backtracking package base #1", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./../../utils/": "./dist/" - })), - request: "./../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #1 (wildcard)", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./../../utils/*": "./dist/*" - })), - request: "./../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #2", - expect: None, - exports_field: exports_field(json!({ - "../../utils/": "./dist/" - })), - request: "../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #2 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "../../utils/*": "./dist/*" - })), - request: "../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #3", - expect: None, - exports_field: exports_field(json!({ - "./utils/": "../src/" - })), - request: "./utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #3 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "./utils/*": "../src/*" - })), - request: "./utils/index", - condition_names: vec![], - }, - // enhanced-resolve does not handle backtracking here - // TestCase { - // name: "backtracking package base #4", - // expect: Some(vec!["./../src/index"]), - // exports_field: exports_field(json!({ - // "./utils/": "./../src/" - // })), - // request: "./utils/index", - // condition_names: vec![], - // }, - // TestCase { - // name: "backtracking package base #4 (wildcard)", - // expect: Some(vec!["./../src/index"]), - // exports_field: exports_field(json!({ - // "./utils/*": "./../src/*" - // })), - // request: "./utils/index", - // condition_names: vec![], - // }, - // TestCase { - // name: "backtracking package base #5", - // expect: Some(vec!["./src/../index.js"]), - // exports_field: exports_field(json!({ - // "./utils/index": "./src/../index.js" - // })), - // request: "./utils/index", - // condition_names: vec![], - // }, - TestCase { - name: "backtracking package base #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/../utils/index": "./src/../index.js" - })), - request: "./utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #7", - expect: None, - exports_field: exports_field(json!({ - "./utils/": { - "browser": "../this/" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #7", - expect: None, - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "../this/*" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #8", - // We throw "InvalidPackageTarget" - // expect: Some(vec!["./utils/../index"]), - expect: None, - exports_field: exports_field(json!({ - "./utils/": { - "browser": "./utils/../" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #8 (wildcard)", - // We throw "InvalidPackageTarget" - // expect: Some(vec!["./utils/../index"]), - expect: None, - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "./utils/../*" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #9", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./": "./src/../../", - "./dist/": "./dist/" - })), - request: "./dist/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #9 (wildcard)", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./*": "./src/../../*", - "./dist/*": "./dist/*" - })), - request: "./dist/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking target folder #1", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../../index"]), - exports_field: exports_field(json!({ - "./utils/": "./dist/" - })), - request: "./utils/timezone/../../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #1 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../../index"]), - exports_field: exports_field(json!({ - "./utils/*": "./dist/*" - })), - request: "./utils/timezone/../../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #2", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../index"]), - exports_field: exports_field(json!({ - "./utils/": "./dist/" - })), - request: "./utils/timezone/../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #2 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../index"]), - exports_field: exports_field(json!({ - "./utils/*": "./dist/*" - })), - request: "./utils/timezone/../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #3", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/target/../../index"]), - exports_field: exports_field(json!({ - "./utils/": "./dist/target/" - })), - request: "./utils/../../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #3 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/target/../../index"]), - exports_field: exports_field(json!({ - "./utils/*": "./dist/target/*" - })), - request: "./utils/../../index", - condition_names: vec![], - }, - // enhanced-resolve does not handle `node_modules` in target - TestCase { - name: "nested node_modules path #1", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": "./node_modules/" - } - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #1 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "./node_modules/*" - } - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #2", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./utils/../node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/": "./utils/../node_modules/" - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "nested node_modules path #2 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./utils/../node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": "./utils/../node_modules/*" - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "nested mapping #1", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": "./", - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested mapping #1 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": "./*", - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "nested mapping #2 (wildcard)", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #2 (wildcard)", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "nested mapping #3", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["webpack"], - }, - TestCase { - name: "nested mapping #3 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["webpack"], - }, - TestCase { - name: "nested mapping #4", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["node", "browser"], - }, - TestCase { - name: "nested mapping #4 (wildcard)", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["node", "browser"], - }, - TestCase { - name: "nested mapping #5", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node"], - }, - TestCase { - name: "nested mapping #5 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": { - "webpack": [ - "./wpck/*" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node"], - }, - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - TestCase { - name: "nested mapping #6 (wildcard)", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": { - "webpack": [ - "./wpck/*" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #6 (wildcard)", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./node/*" - ], - "default": { - "node": { - "webpack": [ - "./wpck/*" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - TestCase { - name: "nested mapping #7", - expect: Some(vec!["./y.js"]), - exports_field: exports_field(json!({ - "./a.js": { - "abc": { - "def": "./x.js" - }, - "ghi": "./y.js" - } - })), - request: "./a.js", - condition_names: vec!["abc", "ghi"], - }, - TestCase { - name: "nested mapping #8", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./a.js": { - "abc": { - "def": "./x.js", - "default": [] - }, - "ghi": "./y.js" - } - })), - request: "./a.js", - condition_names: vec!["abc", "ghi"], - }, - TestCase { - name: "syntax sugar #1", - expect: Some(vec!["./main.js"]), - exports_field: exports_field(json!("./main.js")), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #2", - expect: Some(vec![]), - exports_field: exports_field(json!("./main.js")), - request: "./lib.js", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #3", - expect: Some(vec!["./a.js"]), - exports_field: exports_field(json!(["./a.js", "./b.js"])), - request: ".", - condition_names: vec![], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "syntax sugar #3", - expect: Some(vec!["./b.js"]), - exports_field: exports_field(json!(["./b.js"])), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #4", - expect: Some(vec![]), - exports_field: exports_field(json!(["./a.js", "./b.js"])), - request: "./lib.js", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #5", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "browser": { - "default": "./index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "syntax sugar #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "browser": { - "default": "./index.js" - } - })), - request: "./lib.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "syntax sugar #7", - expect: None, - exports_field: exports_field(json!({ - "./node": "./node.js", - "browser": { - "default": "./index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "syntax sugar #8", - expect: None, - exports_field: exports_field(json!({ - "browser": { - "default": "./index.js" - }, - "./node": "./node.js" - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #1", - expect: Some(vec!["./abc/d"]), - exports_field: exports_field(json!({ - "./ab*": "./ab/*", - "./abc*": "./abc/*", - "./a*": "./a/*" - })), - request: "./abcd", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #2", - expect: Some(vec!["./abc/d/e"]), - exports_field: exports_field(json!({ - "./ab*": "./ab/*", - "./abc*": "./abc/*", - "./a*": "./a/*" - })), - request: "./abcd/e", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #3", - expect: Some(vec!["./abc/d"]), - exports_field: exports_field(json!({ - "./x/ab*": "./ab/*", - "./x/abc*": "./abc/*", - "./x/a*": "./a/*" - })), - request: "./x/abcd", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #4", - expect: Some(vec!["./abc/d/e"]), - exports_field: exports_field(json!({ - "./x/ab*": "./ab/*", - "./x/abc*": "./abc/*", - "./x/a*": "./a/*" - })), - request: "./x/abcd/e", - condition_names: vec!["browser"], - }, - TestCase { - name: "path tree edge case #1", - expect: Some(vec!["./A/b/d.js"]), - exports_field: exports_field(json!({ - "./a/": "./A/", - "./a/b/c": "./c.js" - })), - request: "./a/b/d.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #1 (wildcard)", - expect: Some(vec!["./A/b/d.js"]), - exports_field: exports_field(json!({ - "./a/*": "./A/*", - "./a/b/c": "./c.js" - })), - request: "./a/b/d.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #2", - expect: Some(vec!["./A/c.js"]), - exports_field: exports_field(json!({ - "./a/": "./A/", - "./a/b": "./b.js" - })), - request: "./a/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #2 (wildcard)", - expect: Some(vec!["./A/c.js"]), - exports_field: exports_field(json!({ - "./a/*": "./A/*", - "./a/b": "./b.js" - })), - request: "./a/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #3", - expect: Some(vec!["./A/b/d/c.js"]), - exports_field: exports_field(json!({ - "./a/": "./A/", - "./a/b/c/d": "./c.js" - })), - request: "./a/b/d/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #3 (wildcard)", - expect: Some(vec!["./A/b/d/c.js"]), - exports_field: exports_field(json!({ - "./a/*": "./A/*", - "./a/b/c/d": "./c.js" - })), - request: "./a/b/d/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #1", - expect: Some(vec!["./A/b.js"]), - exports_field: exports_field(json!({ - "./a/*.js": "./A/*.js" - })), - request: "./a/b.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #2", - expect: Some(vec!["./A/b/c.js"]), - exports_field: exports_field(json!({ - "./a/*.js": "./A/*.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #3", - expect: Some(vec!["./A/b/c.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": "./A/*/c.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #4", - expect: Some(vec!["./A/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": "./A/*/*.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #5", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/*.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #5", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/*.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./lib/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #6", - expect: Some(vec!["./browser/foo/bar.js"]), - exports_field: exports_field(json!({ - "./lib/*/bar.js": { - "browser": [ - "./browser/*/bar.js" - ] - }, - "./dist/*/bar.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./lib/foo/bar.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #6", - expect: Some(vec!["./browser/foo.js"]), - exports_field: exports_field(json!({ - "./lib/*/bar.js": { - "browser": [ - "./browser/*/bar.js" - ] - }, - "./dist/*/bar.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./dist/foo/bar.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #7", - expect: Some(vec!["./browser/foo/default.js"]), - exports_field: exports_field(json!({ - "./lib/*/bar.js": { - "browser": [ - "./browser/*/bar.js" - ] - }, - "./dist/*/bar.js": { - "node": "./*.js", - "default": "./browser/*/default.js" - } - })), - request: "./dist/foo/bar.js", - condition_names: vec!["default"], - }, - TestCase { - name: "wildcard pattern #8", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": "./A/*/*/*.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #9", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": [ - "./A/*/*/*.js", - "./B/*/*/*.js" - ] - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "wildcard pattern #9", - expect: Some(vec!["./B/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": [ - "./B/*/*/*.js" - ] - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #10", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/foo-*/c.js": "./A/*/*/*.js" - })), - request: "./a/foo-b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #11", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*-foo/c.js": "./A/*/*/*.js" - })), - request: "./a/b-foo/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #12", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/foo-*-foo/c.js": "./A/*/*/*.js" - })), - request: "./a/foo-b-foo/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #13", - expect: Some(vec!["./A/b/c/d.js"]), - exports_field: exports_field(json!({ - "./a/foo-*-foo/c.js": "./A/b/c/d.js" - })), - request: "./a/foo-b-foo/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #14", - expect: Some(vec!["./A/b/c/*.js"]), - exports_field: exports_field(json!({ - "./a/foo-foo/c.js": "./A/b/c/*.js" - })), - request: "./a/foo-foo/c.js", - condition_names: vec![], - }, - ]; - - for case in test_cases { - let resolved = Resolver::new(ResolveOptions { - condition_names: case - .condition_names - .iter() - .map(ToString::to_string) - .collect::>(), - ..ResolveOptions::default() - }) - .package_exports_resolve( - Path::new(""), - case.request, - &case.exports_field, - &mut Ctx::default(), - ) - .map(|p| p.map(|p| p.to_path_buf())); - if let Some(expect) = case.expect { - if expect.is_empty() { - assert!( - matches!(resolved, Err(ResolveError::PackagePathNotExported(_, _))), - "{} {:?}", - &case.name, - &resolved - ); - } else { - for expect in expect { - assert_eq!(resolved, Ok(Some(Path::new(expect).normalize())), "{}", &case.name); - } - } - } else { - assert!(resolved.is_err(), "{} {resolved:?}", &case.name); - } - } -} diff --git a/src/tests/extension_alias.rs b/src/tests/extension_alias.rs deleted file mode 100644 index 86afab73..00000000 --- a/src/tests/extension_alias.rs +++ /dev/null @@ -1,66 +0,0 @@ -//! - -use crate::{ResolveError, ResolveOptions, Resolver}; - -#[test] -fn extension_alias() { - let f = super::fixture().join("extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - extension_alias: vec![ - (".js".into(), vec![".ts".into(), ".js".into()]), - (".mjs".into(), vec![".mts".into()]), - ], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should alias fully specified file", f.clone(), "./index.js", f.join("index.ts")), - ("should alias fully specified file when there are two alternatives", f.clone(), "./dir/index.js", f.join("dir/index.ts")), - ("should also allow the second alternative", f.clone(), "./dir2/index.js", f.join("dir2/index.js")), - ("should support alias option without an array", f.clone(), "./dir2/index.mjs", f.join("dir2/index.mts")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } - - #[rustfmt::skip] - let fail = [ - ("should not allow to fallback to the original extension or add extensions", f, "./index.mjs"), - ]; - - for (comment, path, request) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!(resolution, Err(ResolveError::ExtensionAlias), "{comment} {path:?} {request}"); - } -} - -// should not apply extension alias to extensions or mainFiles field -#[test] -fn not_apply_to_extension_nor_main_files() { - let f = super::fixture().join("extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - extension_alias: vec![(".js".into(), vec![])], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("directory", f.clone(), "./dir2", "dir2/index.js"), - ("file", f.clone(), "./dir2/index", "dir2/index.js"), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - let expected = f.join(expected); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} diff --git a/src/tests/extensions.rs b/src/tests/extensions.rs deleted file mode 100644 index 1ebd86f4..00000000 --- a/src/tests/extensions.rs +++ /dev/null @@ -1,125 +0,0 @@ -//! - -use crate::{EnforceExtension, Resolution, ResolveContext, ResolveError, ResolveOptions, Resolver}; -use rustc_hash::FxHashSet; - -#[test] -fn extensions() { - let f = super::fixture().join("extensions"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".ts".into(), ".js".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve according to order of provided extensions", "./foo", "foo.ts"), - ("should resolve according to order of provided extensions (dir index)", "./dir", "dir/index.ts"), - ("should resolve according to main field in module root", ".", "index.js"), - // This is a core module - // ("should resolve single file module before directory", "module", "node_modules/module.js"), - ("should resolve trailing slash directory before single file", "module/", "node_modules/module/index.ts"), - ]; - - for (comment, request, expected_path) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - let expected = f.join(expected_path); - assert_eq!(resolved_path, Ok(expected), "{comment} {request} {expected_path}"); - } - - #[rustfmt::skip] - let fail = [ - ("not resolve to file when request has a trailing slash (relative)", "./foo.js/", "./foo.js/".into()) - ]; - - for (comment, request, expected_error) in fail { - let resolution = resolver.resolve(&f, request); - let error = ResolveError::NotFound(expected_error); - assert_eq!(resolution, Err(error), "{comment} {request} {resolution:?}"); - } -} - -// should default enforceExtension to true when extensions includes an empty string -#[test] -fn default_enforce_extension() { - let f = super::fixture().join("extensions"); - - let mut ctx = ResolveContext::default(); - let resolved = Resolver::new(ResolveOptions { - extensions: vec![".ts".into(), String::new(), ".js".into()], - ..ResolveOptions::default() - }) - .resolve_with_context(&f, "./foo", &mut ctx); - - assert_eq!(resolved.map(Resolution::into_path_buf), Ok(f.join("foo.ts"))); - assert_eq!( - ctx.file_dependencies, - FxHashSet::from_iter([f.join("foo.ts"), f.join("package.json")]) - ); - assert!(ctx.missing_dependencies.is_empty()); -} - -// should respect enforceExtension when extensions includes an empty string -#[test] -fn respect_enforce_extension() { - let f = super::fixture().join("extensions"); - - let mut ctx = ResolveContext::default(); - let resolved = Resolver::new(ResolveOptions { - enforce_extension: EnforceExtension::Disabled, - extensions: vec![".ts".into(), String::new(), ".js".into()], - ..ResolveOptions::default() - }) - .resolve_with_context(&f, "./foo", &mut ctx); - - assert_eq!(resolved.map(Resolution::into_path_buf), Ok(f.join("foo.ts"))); - assert_eq!( - ctx.file_dependencies, - FxHashSet::from_iter([f.join("foo.ts"), f.join("package.json")]) - ); - assert_eq!(ctx.missing_dependencies, FxHashSet::from_iter([f.join("foo")])); -} - -#[test] -fn multi_dot_extension() { - let f = super::fixture().join("extensions"); - - let resolver = Resolver::new(ResolveOptions { - // Test for `.d.ts`, not part of enhanced-resolve. - extensions: vec![".a.b.c".into(), ".d.ts".into(), ".ts".into(), ".js".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve according to order of provided extensions", "./foo", "foo.ts"), - ("should resolve file with extension", "./app.module", "app.module.js") - ]; - - for (comment, request, expected_path) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - let expected = f.join(expected_path); - assert_eq!(resolved_path, Ok(expected), "{comment} {request} {expected_path}"); - } - - #[rustfmt::skip] - let fail = [ - ("not resolve to file", "./index.", "./index.".into()) - ]; - - for (comment, request, expected_error) in fail { - let resolution = resolver.resolve(&f, request); - let error = ResolveError::NotFound(expected_error); - assert_eq!(resolution, Err(error), "{comment} {request} {resolution:?}"); - } -} - -#[test] -#[should_panic = "All extensions must start with a leading dot"] -fn without_leading_dot() { - Resolver::new(ResolveOptions { - extensions: vec!["ts".into(), "js".into()], - ..ResolveOptions::default() - }); -} diff --git a/src/tests/fallback.rs b/src/tests/fallback.rs deleted file mode 100644 index 3da2d767..00000000 --- a/src/tests/fallback.rs +++ /dev/null @@ -1,100 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/fallback.test.js - -#[test] -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -fn fallback() { - use super::memory_fs::MemoryFS; - use crate::{AliasValue, ResolveError, ResolveOptions, ResolverGeneric}; - use std::path::{Path, PathBuf}; - - let f = Path::new("/"); - - let file_system = MemoryFS::new(&[ - ("/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", ""), - ]); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - fallback: vec![ - ("aliasA".into(), vec![AliasValue::Path("a".into())]), - ("b$".into(), vec![AliasValue::Path("a/index".into())]), - ("c$".into(), vec![AliasValue::Path("/a/index".into())]), - ( - "multiAlias".into(), - vec![ - AliasValue::Path("b".into()), - AliasValue::Path("c".into()), - AliasValue::Path("d".into()), - AliasValue::Path("e".into()), - AliasValue::Path("a".into()), - ], - ), - ("recursive".into(), vec![AliasValue::Path("recursive/dir".into())]), - ("/d/dir".into(), vec![AliasValue::Path("/c/dir".into())]), - ("/d/index.js".into(), vec![AliasValue::Path("/c/index".into())]), - ("ignored".into(), vec![AliasValue::Ignore]), - ("node:path".into(), vec![AliasValue::Ignore]), - ], - modules: vec!["/".into()], - ..ResolveOptions::default() - }, - ); - - #[rustfmt::skip] - let pass = [ - ("should resolve a not aliased module 1", "a", "/a/index"), - ("should resolve a not aliased module 2", "a/index", "/a/index"), - ("should resolve a not aliased module 3", "a/dir", "/a/dir/index"), - ("should resolve a not aliased module 4", "a/dir/index", "/a/dir/index"), - ("should resolve an fallback module 1", "aliasA", "/a/index"), - ("should resolve an fallback module 2", "aliasA/index", "/a/index"), - ("should resolve an fallback module 3", "aliasA/dir", "/a/dir/index"), - ("should resolve an fallback module 4", "aliasA/dir/index", "/a/dir/index"), - ("should resolve a recursive aliased module 1", "recursive", "/recursive/index"), - ("should resolve a recursive aliased module 2", "recursive/index", "/recursive/index"), - ("should resolve a recursive aliased module 3", "recursive/dir", "/recursive/dir/index"), - ("should resolve a recursive aliased module 4", "recursive/dir/index", "/recursive/dir/index"), - ("should resolve a recursive aliased module 5", "recursive/file", "/recursive/dir/file"), - ("should resolve a file aliased module with a query 1", "b?query", "/b/index?query"), - ("should resolve a file aliased module with a query 2", "c?query", "/c/index?query"), - ("should resolve a path in a file aliased module 1", "b/index", "/b/index"), - ("should resolve a path in a file aliased module 2", "b/dir", "/b/dir/index"), - ("should resolve a path in a file aliased module 3", "b/dir/index", "/b/dir/index"), - ("should resolve a path in a file aliased module 4", "c/index", "/c/index"), - ("should resolve a path in a file aliased module 5", "c/dir", "/c/dir/index"), - ("should resolve a path in a file aliased module 6", "c/dir/index", "/c/dir/index"), - ("should resolve a file in multiple aliased dirs 1", "multiAlias/dir/file", "/e/dir/file"), - ("should resolve a file in multiple aliased dirs 2", "multiAlias/anotherDir", "/e/anotherDir/index"), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - - #[rustfmt::skip] - let ignore = [ - ("should resolve an ignore module", "ignored", ResolveError::Ignored(f.join("ignored"))), - ("should resolve node: builtin module", "node:path", ResolveError::Ignored(PathBuf::from("/node:path"))), - ]; - - for (comment, request, expected) in ignore { - let resolution = resolver.resolve(f, request); - assert_eq!(resolution, Err(expected), "{comment} {request}"); - } -} diff --git a/src/tests/full_specified.rs b/src/tests/full_specified.rs deleted file mode 100644 index a70c0191..00000000 --- a/src/tests/full_specified.rs +++ /dev/null @@ -1,113 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/fullSpecified.test.js - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows { - use std::path::PathBuf; - - use crate::{AliasValue, ResolveOptions, ResolverGeneric}; - - use super::super::memory_fs::MemoryFS; - - fn file_system() -> MemoryFS { - MemoryFS::new(&[ - ("/a/node_modules/package1/index.js", ""), - ("/a/node_modules/package1/file.js", ""), - ("/a/node_modules/package2/package.json", r#"{"main":"a"}"#), - ("/a/node_modules/package2/a.js", ""), - ("/a/node_modules/package3/package.json", r#"{"main":"dir"}"#), - ("/a/node_modules/package3/dir/index.js", ""), - ("/a/node_modules/package4/package.json", r#"{"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", ""), - ]) - } - - #[test] - fn test() { - let file_system = file_system(); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - alias: vec![ - ("alias1".into(), vec![AliasValue::from("/a/abc")]), - ("alias2".into(), vec![AliasValue::from("/a")]), - ], - alias_fields: vec![vec!["browser".into()]], - fully_specified: true, - ..ResolveOptions::default() - }, - ); - - let failing_resolves = [ - ("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"), - ]; - - for (comment, request) in failing_resolves { - let resolution = resolver.resolve("/a", request); - assert!(resolution.is_err(), "{comment} {request}"); - } - - let successful_resolves = [ - ("fully relative", "./abc.js", "/a/abc.js"), - ("fully absolute", "/a/abc.js", "/a/abc.js"), - ("fully relative in package", "package1/file.js", "/a/node_modules/package1/file.js"), - ("extensions in mainFiles", "package1", "/a/node_modules/package1/index.js"), - ("extensions in mainFields", "package2", "/a/node_modules/package2/a.js"), - ("extensions in alias", "alias1", "/a/abc.js"), - ("directories in alias", "alias2", "/a/index.js"), - ("directories in packages", "package3", "/a/node_modules/package3/dir/index.js"), - ("extensions in aliasFields", "package4/a.js", "/a/node_modules/package4/b.js"), - ]; - - for (comment, request, expected) in successful_resolves { - let resolution = resolver.resolve("/a", request).map(|r| r.full_path()); - assert_eq!(resolution, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - } - - #[test] - #[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. - fn resolve_to_context() { - let file_system = file_system(); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - alias: vec![ - ("alias1".into(), vec![AliasValue::from("/a/abc")]), - ("alias2".into(), vec![AliasValue::from("/a")]), - ], - alias_fields: vec![vec!["browser".into()]], - fully_specified: true, - resolve_to_context: true, - ..ResolveOptions::default() - }, - ); - - let successful_resolves = [ - ("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", "/a/node_modules/package3/dir"), - ]; - - for (comment, request, expected) in successful_resolves { - let resolution = resolver.resolve("/a", request).map(|r| r.full_path()); - assert_eq!(resolution, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - } -} diff --git a/src/tests/imports_field.rs b/src/tests/imports_field.rs deleted file mode 100644 index c928627a..00000000 --- a/src/tests/imports_field.rs +++ /dev/null @@ -1,1320 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/importsField.test.js -//! -//! The huge imports field test cases are at the bottom of this file. - -use serde_json::json; - -use crate::{Ctx, JSONMap, PathUtil, ResolveError, ResolveOptions, Resolver}; -use std::path::Path; - -#[test] -fn test_simple() { - let f = super::fixture().join("imports-field"); - let f2 = super::fixture().join("imports-exports-wildcard/node_modules/m/"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve using imports field instead of self-referencing", f.clone(), "#imports-field", f.join("b.js")), - ("should resolve using imports field instead of self-referencing for a subpath", f.join("dir"), "#imports-field", f.join("b.js")), - ("should resolve package #1", f.clone(), "#a/dist/main.js", f.join("node_modules/a/lib/lib2/main.js")), - ("should resolve package #3", f.clone(), "#ccc/index.js", f.join("node_modules/c/index.js")), - ("should resolve package #4", f.clone(), "#c", f.join("node_modules/c/index.js")), - ("should resolve with wildcard pattern", f2.clone(), "#internal/i.js", f2.join("src/internal/i.js")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } - - // Note added: - // * should resolve absolute path as an imports field target - // * should log the correct info - - #[rustfmt::skip] - let fail = [ - ("should disallow resolve out of package scope", f.clone(), "#b", ResolveError::InvalidPackageTarget("../b.js".to_string(), "#b".to_string(), f.join("package.json"))), - ("should resolve package #2", f.clone(), "#a", ResolveError::PackageImportNotDefined("#a".to_string(), f.join("package.json"))), - ]; - - for (comment, path, request, error) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!(resolution, Err(error), "{comment} {path:?} {request}"); - } -} - -#[test] -fn shared_resolvers() { - let f = super::fixture().join("imports-field"); - - // field name #1 - let resolver1 = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - imports_fields: vec![vec!["imports".into()]], - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - let resolved_path = resolver1.resolve(&f, "#imports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("b.js"))); - - // field name #2 - let resolver2 = resolver1.clone_with_options(ResolveOptions { - imports_fields: vec![vec!["other".into(), "imports".into()]], - ..ResolveOptions::default() - }); - - let resolved_path = resolver2.resolve(&f, "#b").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("a.js"))); -} - -// Small script for generating the test cases from enhanced_resolve -// for (c of testCases) { -// console.log("TestCase {") -// console.log(`name: ${JSON.stringify(c.name)},`) -// if (c.expect instanceof Error) { -// console.log(`expect: None,`) -// } else { -// console.log(`expect: Some(vec!${JSON.stringify(c.expect)}),`) -// } -// console.log(`imports_field: imports_field(json!(${JSON.stringify(c.suite[0], null, 2)})),`) -// console.log(`request: "${c.suite[1]}",`) -// console.log(`condition_names: vec!${JSON.stringify(c.suite[2])},`) -// console.log("},") -// } - -struct TestCase { - name: &'static str, - expect: Option>, - imports_field: JSONMap, - request: &'static str, - condition_names: Vec<&'static str>, -} - -#[allow(clippy::needless_pass_by_value)] -fn imports_field(value: serde_json::Value) -> JSONMap { - let s = serde_json::to_string(&value).unwrap(); - serde_json::from_str(&s).unwrap() -} - -#[test] -fn test_cases() { - let test_cases = [ - TestCase { - name: "sample #1", - expect: Some(vec!["./dist/test/file.js"]), - imports_field: imports_field(json!({ - "#abc/": { - "import": [ - "./dist/", - "./src/" - ], - "webpack": "./wp/" - }, - "#abc": "./main.js" - })), - request: "#abc/test/file.js", - condition_names: vec!["import", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "sample #1", - expect: Some(vec!["./src/test/file.js"]), - imports_field: imports_field(json!({ - "#abc/": { - "import": [ - "./src/" - ], - "webpack": "./wp/" - }, - "#abc": "./main.js" - })), - request: "#abc/test/file.js", - condition_names: vec!["import", "webpack"], - }, - TestCase { - name: "sample #2", - expect: Some(vec!["./data/timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#1/timezones/": "./data/timezones/" - })), - request: "#1/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #3", - expect: Some(vec!["./data/timezones/timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#aaa/": "./data/timezones/", - "#a/": "./data/timezones/" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #4", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/lib/": { - "browser": [ - "./browser/" - ] - }, - "#a/dist/index.js": { - "node": "./index.js" - } - })), - request: "#a/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #5", - expect: Some(vec!["./browser/index.js"]), - imports_field: imports_field(json!({ - "#a/lib/": { - "browser": [ - "./browser/" - ] - }, - "#a/dist/index.js": { - "node": "./index.js", - "default": "./browser/index.js" - } - })), - request: "#a/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #6", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/dist/a": "./dist/index.js" - })), - request: "#a/dist/aaa", - condition_names: vec![], - }, - TestCase { - name: "sample #7", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/a/a/": "./dist/index.js" - })), - request: "#a/a/a", - condition_names: vec![], - }, - TestCase { - name: "sample #8", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": "./index.js" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #9", - expect: Some(vec!["./main.js"]), - imports_field: imports_field(json!({ - "#a/index.js": "./main.js" - })), - request: "#a/index.js", - condition_names: vec![], - }, - TestCase { - name: "sample #10", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #11", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/bar#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #12", - expect: Some(vec!["./ok.js#abc"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/ok.js#abc", - condition_names: vec![], - }, - TestCase { - name: "sample #13", - expect: Some(vec!["./ok.js?abc"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/ok.js?abc", - condition_names: vec![], - }, - TestCase { - name: "sample #14", - expect: Some(vec!["./🎉.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/🎉.js", - condition_names: vec![], - }, - TestCase { - name: "sample #15", - expect: Some(vec!["./%F0%9F%8E%89.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/%F0%9F%8E%89.js", - condition_names: vec![], - }, - TestCase { - name: "sample #16", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/🎉", - condition_names: vec![], - }, - TestCase { - name: "sample #17", - expect: Some(vec!["./other.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/%F0%9F%8E%89", - condition_names: vec![], - }, - TestCase { - name: "sample #18", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/module", - condition_names: vec![], - }, - TestCase { - name: "sample #19", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/module#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #20", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/module?foo", - condition_names: vec![], - }, - TestCase { - name: "sample #21", - expect: Some(vec!["./d?e?f"]), - imports_field: imports_field(json!({ - "#a/a?b?c/": "./" - })), - request: "#a/a?b?c/d?e?f", - condition_names: vec![], - }, - TestCase { - name: "sample #22", - // We throw InvalidPackageTarget - expect: None, - // expect: Some(vec!["/user/a/index"]), - imports_field: imports_field(json!({ - "#a/": "/user/a/" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #1", - expect: Some(vec!["./A/b/d.js"]), - imports_field: imports_field(json!({ - "#a/": "./A/", - "#a/b/c": "./c.js" - })), - request: "#a/b/d.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #2", - expect: Some(vec!["./A/c.js"]), - imports_field: imports_field(json!({ - "#a/": "./A/", - "#a/b": "./b.js" - })), - request: "#a/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #3", - expect: Some(vec!["./A/b/c/d.js"]), - imports_field: imports_field(json!({ - "#a/": "./A/", - "#a/b/c/d": "./c.js" - })), - request: "#a/b/c/d.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #1", - expect: Some(vec!["./dist/index.js"]), - imports_field: imports_field(json!({ - "#a": "./dist/index.js" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #2", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": "./" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #3", - expect: Some(vec!["./dist/a.js"]), - imports_field: imports_field(json!({ - "#a/": "./dist/", - "#a/index.js": "./dist/a.js" - })), - request: "#a/index.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #4", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "./browser/" - ] - }, - "#a/index.js": { - "browser": "./index.js" - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #5", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "./browser/" - ] - }, - "#a/index.js": { - "node": "./node.js" - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #6", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: "#a", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #7", - expect: Some(vec!["./src/index.js"]), // `enhanced_resolve` is `None` - imports_field: imports_field(json!({ - "#a": { - "default": "./src/index.js", - "browser": "./index.js", - "node": "./src/node/index.js" - } - })), - request: "#a", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #8", - expect: Some(vec!["./src/index.js"]), - imports_field: imports_field(json!({ - "#a": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #9", - expect: Some(vec!["./index"]), - imports_field: imports_field(json!({ - "#a": "./index" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #10", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/index": "./index.js" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #11", - // We throw InvalidPackageTarget - // expect: Some(vec!["b"]), - expect: None, - imports_field: imports_field(json!({ - "#a": "b" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #12", - // We throw InvalidPackageTarget - // expect: Some(vec!["b/index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "b/" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #13", - // We throw InvalidPackageTarget - // expect: Some(vec!["b#anotherhashishere"]), - expect: None, - imports_field: imports_field(json!({ - "#a?q=a#hashishere": "b#anotherhashishere" - })), - request: "#a?q=a#hashishere", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #1", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #2", - expect: Some(vec!["./import.mjs"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec!["import"], - }, - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./require.js"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./import.mjs"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./require.js"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": [ - "./require.js" - ] - }, - { - "import": [ - "./import.mjs", - "#b/import.js" - ] - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./import.mjs"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "./import.mjs", - "#b/import.js" - ] - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "#b/import.js" - ] - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "mapping to a folder root #1", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#timezones": "./data/timezones/" - })), - request: "#timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #2", - expect: None, - imports_field: imports_field(json!({ - "#timezones/": "./data/timezones" - })), - request: "#timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #3", - expect: Some(vec!["./data/timezones/pdt/index.mjs"]), - imports_field: imports_field(json!({ - "#timezones/pdt/": "./data/timezones/pdt/" - })), - request: "#timezones/pdt/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #4", - expect: Some(vec!["./timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#a/": "./timezones/" - })), - request: "#a/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #5", - expect: Some(vec!["./timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#a/": "./" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #6", - expect: None, - imports_field: imports_field(json!({ - "#a/": "." - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #7", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": "./" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #1", - expect: Some(vec!["./lib/index.mjs"]), - imports_field: imports_field(json!({ - "#a/": "./", - "#a/dist/": "./lib/" - })), - request: "#a/dist/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #2", - expect: Some(vec!["./dist/utils/index.js"]), - imports_field: imports_field(json!({ - "#a/dist/utils/": "./dist/utils/", - "#a/dist/": "./lib/" - })), - request: "#a/dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #3", - expect: Some(vec!["./dist/utils/index.js"]), - imports_field: imports_field(json!({ - "#a/dist/utils/index.js": "./dist/utils/index.js", - "#a/dist/utils/": "./dist/utils/index.mjs", - "#a/dist/": "./lib/" - })), - request: "#a/dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #4", - expect: Some(vec!["./lib/index.mjs"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./browser/" - }, - "#a/dist/": "./lib/" - })), - request: "#a/dist/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #1", - // This behaves differently from enhanced_resolve, because `lodash/` is an an InvalidPackageConfig - // expect: Some(vec!["lodash/index.js"]), - expect: Some(vec!["./utils/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "conditional mapping folder #1", - expect: Some(vec!["./utils/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #2", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./node/" - ] - } - })), - request: "#a/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "conditional mapping folder #3", - expect: Some(vec!["./wpk/index.mjs"]), - imports_field: imports_field(json!({ - "#a/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils/" - ] - } - })), - request: "#a/index.mjs", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "incorrect exports field #1", - // We throw `PackageImportNotDefined` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "/utils/": "./a/" - })), - request: "#a/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #2", - // We throw `PackageImportNotDefined` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "/utils/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#a/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #3", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index": "./a/index.js" - })), - request: "#a/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #4", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index.mjs": "./a/index.js" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #5", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "#a/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #6", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index.mjs": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "#a/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #1", - // We don't throw in `package_imports_exports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": "./a/" - })), - request: "/utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect request #2", - // We don't throw in `package_imports_exports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #3", - // We don't throw in `package_imports_exports_resolve`, it's thrown in `package_imports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #4", - // We don't throw in `package_imports_exports_resolve`, it's thrown in `package_imports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#/", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #5", - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#a/", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #1", - // expect: Some(vec!["./dist/index"]), - expect: Some(vec!["dist/index"]), - imports_field: imports_field(json!({ - "#a/../../utils/": "./dist/" - })), - request: "#a/../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #2", - // We throw InvalidPackageTarget - // expect: Some(vec!["./dist/../../utils/index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "./dist/" - })), - request: "#a/../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #3", - // We throw InvalidPackageTarget - // expect: Some(vec!["../src/index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "../src/" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #4", - // We throw InvalidPackageTarget - // expect: Some(vec!["./utils/../../../index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": { - "browser": "./utils/../../../" - } - })), - request: "#a/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #1", - // expect: Some(vec!["moment/node_modules/lodash/dist/index.js"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": { - "browser": "moment/node_modules/" - } - })), - request: "#a/lodash/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #2", - // We throw InvalidPackageTarget - // expect: Some(vec!["../node_modules/lodash/dist/index.js"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "../node_modules/" - })), - request: "#a/lodash/dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "nested mapping #1", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": "./", - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./node/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "nested mapping #3", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["webpack"], - }, - TestCase { - name: "nested mapping #4", - // We throw NotFound - // expect: Some(vec!["moment/node/index.js"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "moment/node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["node", "browser"], - }, - TestCase { - name: "nested mapping #5", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "node"], - }, - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./node/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - TestCase { - name: "nested mapping #7", - expect: Some(vec!["./y.js"]), - imports_field: imports_field(json!({ - "#a": { - "abc": { - "def": "./x.js" - }, - "ghi": "./y.js" - } - })), - request: "#a", - condition_names: vec!["abc", "ghi"], - }, - TestCase { - name: "nested mapping #8", - // We throw PackageImportNotDefined - // expect: Some(vec![]), - expect: None, - imports_field: imports_field(json!({ - "#a": { - "abc": { - "def": "./x.js", - "default": [] - }, - "ghi": "./y.js" - } - })), - request: "#a", - condition_names: vec!["abc", "ghi"], - }, - ]; - - for case in test_cases { - let resolved = Resolver::default() - .package_imports_exports_resolve( - case.request, - &case.imports_field, - Path::new(""), - true, - &case.condition_names.iter().map(ToString::to_string).collect::>(), - &mut Ctx::default(), - ) - .map(|p| p.map(|p| p.to_path_buf())); - if let Some(expect) = case.expect { - if expect.is_empty() { - assert!(matches!(resolved, Ok(None)), "{} {:?}", &case.name, &resolved); - } else { - for expect in expect { - assert_eq!(resolved, Ok(Some(Path::new(expect).normalize())), "{}", &case.name); - } - } - } else { - assert!(resolved.is_err(), "{} {resolved:?}", &case.name); - } - } -} diff --git a/src/tests/incorrect_description_file.rs b/src/tests/incorrect_description_file.rs deleted file mode 100644 index a5c81796..00000000 --- a/src/tests/incorrect_description_file.rs +++ /dev/null @@ -1,62 +0,0 @@ -//! - -use rustc_hash::FxHashSet; - -use crate::{JSONError, Resolution, ResolveContext, ResolveError, ResolveOptions, Resolver}; - -// should not resolve main in incorrect description file #1 -#[test] -fn incorrect_description_file_1() { - let f = super::fixture().join("incorrect-package"); - let mut ctx = ResolveContext::default(); - let resolution = Resolver::default().resolve_with_context(f.join("pack1"), ".", &mut ctx); - let error = ResolveError::JSON(JSONError { - path: f.join("pack1/package.json"), - message: String::from("EOF while parsing a value at line 3 column 0"), - line: 3, - column: 0, - }); - assert_eq!(resolution, Err(error)); - assert_eq!(ctx.file_dependencies, FxHashSet::from_iter([f.join("pack1/package.json")])); - assert!(ctx.missing_dependencies.is_empty()); -} - -// should not resolve main in incorrect description file #2 -#[test] -fn incorrect_description_file_2() { - let f = super::fixture().join("incorrect-package"); - let resolution = Resolver::default().resolve(f.join("pack2"), "."); - let error = ResolveError::JSON(JSONError { - path: f.join("pack2/package.json"), - message: String::from("EOF while parsing a value at line 1 column 0"), - line: 1, - column: 0, - }); - assert_eq!(resolution, Err(error)); -} - -// should not resolve main in incorrect description file #3 -#[test] -fn incorrect_description_file_3() { - let f = super::fixture().join("incorrect-package"); - let resolution = Resolver::default().resolve(f.join("pack2"), "."); - assert!(resolution.is_err()); -} - -// `enhanced_resolve` does not have this test case -#[test] -fn no_description_file() { - let f = super::fixture_root().join("enhanced_resolve"); - - // has description file - let resolver = Resolver::default(); - assert_eq!( - resolver.resolve(&f, ".").map(Resolution::into_path_buf), - Ok(f.join("lib/index.js")) - ); - - // without description file - let resolver = - Resolver::new(ResolveOptions { description_files: vec![], ..ResolveOptions::default() }); - assert_eq!(resolver.resolve(&f, "."), Err(ResolveError::NotFound(".".into()))); -} diff --git a/src/tests/main_field.rs b/src/tests/main_field.rs deleted file mode 100644 index 3cadc8ce..00000000 --- a/src/tests/main_field.rs +++ /dev/null @@ -1,24 +0,0 @@ -//! Not part of enhanced_resolve's test suite - -use crate::{ResolveOptions, Resolver}; - -#[test] -fn test() { - let f = super::fixture().join("restrictions"); - - let resolver1 = Resolver::new(ResolveOptions { - main_fields: vec!["style".into()], - ..ResolveOptions::default() - }); - - let resolution = resolver1.resolve(&f, "pck2").map(|r| r.full_path()); - assert_eq!(resolution, Ok(f.join("node_modules/pck2/index.css"))); - - let resolver2 = resolver1.clone_with_options(ResolveOptions { - main_fields: vec!["module".into(), "main".into()], - ..ResolveOptions::default() - }); - - let resolution = resolver2.resolve(&f, "pck2").map(|r| r.full_path()); - assert_eq!(resolution, Ok(f.join("node_modules/pck2/module.js"))); -} diff --git a/src/tests/memory_fs.rs b/src/tests/memory_fs.rs deleted file mode 100644 index e4116609..00000000 --- a/src/tests/memory_fs.rs +++ /dev/null @@ -1,74 +0,0 @@ -use std::{ - io, - path::{Path, PathBuf}, -}; - -use crate::{FileMetadata, FileSystem}; - -#[derive(Default)] -pub struct MemoryFS { - fs: vfs::MemoryFS, -} - -impl MemoryFS { - /// # Panics - /// - /// * Fails to create directory - /// * Fails to write file - #[allow(dead_code)] - pub fn new(data: &[(&'static str, &'static str)]) -> Self { - let mut fs = Self { fs: vfs::MemoryFS::default() }; - for (path, content) in data { - fs.add_file(Path::new(path), content); - } - fs - } - - #[allow(dead_code)] - pub fn add_file(&mut self, path: &Path, content: &str) { - use vfs::FileSystem; - let fs = &mut self.fs; - // Create all parent directories - for path in path.ancestors().collect::>().iter().rev() { - let path = path.to_string_lossy(); - if !fs.exists(path.as_ref()).unwrap() { - fs.create_dir(path.as_ref()).unwrap(); - } - } - // Create file - let mut file = fs.create_file(path.to_string_lossy().as_ref()).unwrap(); - file.write_all(content.as_bytes()).unwrap(); - } -} - -impl FileSystem for MemoryFS { - fn read_to_string(&self, path: &Path) -> io::Result { - use vfs::FileSystem; - let mut file = self - .fs - .open_file(path.to_string_lossy().as_ref()) - .map_err(|err| io::Error::new(io::ErrorKind::NotFound, err))?; - let mut buffer = String::new(); - file.read_to_string(&mut buffer).unwrap(); - Ok(buffer) - } - - fn metadata(&self, path: &Path) -> io::Result { - use vfs::FileSystem; - let metadata = self - .fs - .metadata(path.to_string_lossy().as_ref()) - .map_err(|err| io::Error::new(io::ErrorKind::NotFound, err))?; - let is_file = metadata.file_type == vfs::VfsFileType::File; - let is_dir = metadata.file_type == vfs::VfsFileType::Directory; - Ok(FileMetadata::new(is_file, is_dir, false)) - } - - fn symlink_metadata(&self, path: &Path) -> io::Result { - self.metadata(path) - } - - fn canonicalize(&self, _path: &Path) -> io::Result { - Err(io::Error::new(io::ErrorKind::NotFound, "not a symlink")) - } -} diff --git a/src/tests/missing.rs b/src/tests/missing.rs deleted file mode 100644 index 4bf611ef..00000000 --- a/src/tests/missing.rs +++ /dev/null @@ -1,106 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/missing.test.js - -use normalize_path::NormalizePath; - -use crate::{AliasValue, ResolveContext, ResolveOptions, Resolver}; - -#[test] -fn test() { - let f = super::fixture(); - - let data = [ - ( - "./missing-file", - vec![f.join("missing-file"), f.join("missing-file.js"), f.join("missing-file.node")], - ), - ( - "missing-module", - vec![ - f.join("node_modules/missing-module"), - f.parent().unwrap().join("node_modules"), // enhanced-resolve is "node_modules/missing-module" - ], - ), - ( - "missing-module/missing-file", - vec![ - f.join("node_modules/missing-module"), - // f.parent().unwrap().join("node_modules/missing-module"), // we don't report this - ], - ), - ( - "m1/missing-file", - vec![ - f.join("node_modules/m1/missing-file"), - f.join("node_modules/m1/missing-file.js"), - f.join("node_modules/m1/missing-file.node"), - // f.parent().unwrap().join("node_modules/m1"), // we don't report this - ], - ), - ( - "m1/", - vec![ - f.join("node_modules/m1/index"), - f.join("node_modules/m1/index.js"), - f.join("node_modules/m1/index.json"), - f.join("node_modules/m1/index.node"), - ], - ), - ("m1/a", vec![f.join("node_modules/m1/a")]), - ]; - - let resolver = Resolver::default(); - - for (specifier, missing_dependencies) in data { - let mut ctx = ResolveContext::default(); - let _ = resolver.resolve_with_context(&f, specifier, &mut ctx); - - for path in ctx.file_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - } - - for path in missing_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - assert!( - ctx.missing_dependencies.contains(&path), - "{specifier}: {path:?} not in {:?}", - &ctx.missing_dependencies - ); - } - } -} - -#[test] -fn alias_and_extensions() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias: vec![ - ( - "@scope-js/package-name/dir$".into(), - vec![AliasValue::Path(f.join("foo/index.js").to_string_lossy().to_string())], - ), - ( - "react-dom".into(), - vec![AliasValue::Path(f.join("foo/index.js").to_string_lossy().to_string())], - ), - ], - extensions: vec![".server.ts".into()], - - ..ResolveOptions::default() - }); - - let mut ctx = ResolveContext::default(); - let _ = resolver.resolve_with_context(&f, "@scope-js/package-name/dir/router", &mut ctx); - let _ = resolver.resolve_with_context(&f, "react-dom/client", &mut ctx); - - for path in ctx.file_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - } - - for path in ctx.missing_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - if let Some(path) = path.parent() { - assert!(!path.is_file(), "{path:?} must not be a file"); - } - } -} diff --git a/src/tests/mod.rs b/src/tests/mod.rs deleted file mode 100644 index 94e6bd86..00000000 --- a/src/tests/mod.rs +++ /dev/null @@ -1,49 +0,0 @@ -mod alias; -mod browser_field; -mod builtins; -mod dependencies; -mod exports_field; -mod extension_alias; -mod extensions; -mod fallback; -mod full_specified; -mod imports_field; -mod incorrect_description_file; -mod main_field; -mod memory_fs; -mod missing; -mod resolve; -mod restrictions; -mod roots; -mod scoped_packages; -mod simple; -mod symlink; -mod tsconfig_paths; -mod tsconfig_project_references; - -use crate::Resolver; -use std::{env, path::PathBuf, sync::Arc, thread}; - -pub fn fixture_root() -> PathBuf { - env::current_dir().unwrap().join("fixtures") -} - -pub fn fixture() -> PathBuf { - fixture_root().join("enhanced_resolve").join("test").join("fixtures") -} - -#[test] -fn threaded_environment() { - let cwd = env::current_dir().unwrap(); - let resolver = Arc::new(Resolver::default()); - for _ in 0..2 { - _ = thread::spawn({ - let cwd = cwd.clone(); - let resolver = Arc::clone(&resolver); - move || { - _ = resolver.resolve(cwd, "."); - } - }) - .join(); - } -} diff --git a/src/tests/resolve.rs b/src/tests/resolve.rs deleted file mode 100644 index f2dbb88e..00000000 --- a/src/tests/resolve.rs +++ /dev/null @@ -1,119 +0,0 @@ -//! - -use crate::{ResolveError, ResolveOptions, Resolver}; - -#[test] -fn resolve() { - let f = super::fixture(); - - let resolver = Resolver::default(); - - let main1_js_path = f.join("main1.js").to_string_lossy().to_string(); - - #[rustfmt::skip] - let pass = [ - ("absolute path", f.clone(), main1_js_path.as_str(), f.join("main1.js")), - ("file with .js", f.clone(), "./main1.js", f.join("main1.js")), - ("file without extension", f.clone(), "./main1", f.join("main1.js")), - ("another file with .js", f.clone(), "./a.js", f.join("a.js")), - ("another file without extension", f.clone(), "./a", f.join("a.js")), - ("file in module with .js", f.clone(), "m1/a.js", f.join("node_modules/m1/a.js")), - ("file in module without extension", f.clone(), "m1/a", f.join("node_modules/m1/a.js")), - ("another file in module without extension", f.clone(), "complexm/step1", f.join("node_modules/complexm/step1.js")), - ("from submodule to file in sibling module", f.join("node_modules/complexm"), "m2/b.js", f.join("node_modules/m2/b.js")), - ("from nested directory to overwritten file in module", f.join("multiple_modules"), "m1/a.js", f.join("multiple_modules/node_modules/m1/a.js")), - ("from nested directory to not overwritten file in module", f.join("multiple_modules"), "m1/b.js", f.join("node_modules/m1/b.js")), - ("file with query", f.clone(), "./main1.js?query", f.join("main1.js?query")), - ("file with fragment", f.clone(), "./main1.js#fragment", f.join("main1.js#fragment")), - ("file with fragment and query", f.clone(), "./main1.js#fragment?query", f.join("main1.js#fragment?query")), - ("file with query and fragment", f.clone(), "./main1.js?#fragment", f.join("main1.js?#fragment")), - - ("file with query (unicode)", f.clone(), "./测试.js?query", f.join("测试.js?query")), - ("file with fragment (unicode)", f.clone(), "./测试.js#fragment", f.join("测试.js#fragment")), - ("file with fragment and query (unicode)", f.clone(), "./测试.js#fragment?query", f.join("测试.js#fragment?query")), - ("file with query and fragment (unicode)", f.clone(), "./测试.js?#fragment", f.join("测试.js?#fragment")), - - ("file in module with query", f.clone(), "m1/a?query", f.join("node_modules/m1/a.js?query")), - ("file in module with fragment", f.clone(), "m1/a#fragment", f.join("node_modules/m1/a.js#fragment")), - ("file in module with fragment and query", f.clone(), "m1/a#fragment?query", f.join("node_modules/m1/a.js#fragment?query")), - ("file in module with query and fragment", f.clone(), "m1/a?#fragment", f.join("node_modules/m1/a.js?#fragment")), - ("file in module with query and fragment", f.clone(), "m1/a?#fragment", f.join("node_modules/m1/a.js?#fragment")), - ("differ between directory and file, resolve file", f.clone(), "./dirOrFile", f.join("dirOrFile.js")), - ("differ between directory and file, resolve directory", f.clone(), "./dirOrFile/", f.join("dirOrFile/index.js")), - ("find node_modules outside of node_modules", f.join("browser-module/node_modules"), "m1/a", f.join("node_modules/m1/a.js")), - ("don't crash on main field pointing to self", f.clone(), "./main-field-self", f.join("./main-field-self/index.js")), - ("don't crash on main field pointing to self (2)", f.clone(), "./main-field-self2", f.join("./main-field-self2/index.js")), - // enhanced-resolve has `#` prepended with a `\0`, they are removed from the - // following 3 expected test results. - // See https://github.com/webpack/enhanced-resolve#escaping - ("handle fragment edge case (no fragment)", f.clone(), "./no#fragment/#/#", f.join("no#fragment/#/#.js")), - ("handle fragment edge case (fragment)", f.clone(), "./no#fragment/#/", f.join("no.js#fragment/#/")), - ("handle fragment escaping", f.clone(), "./no\0#fragment/\0#/\0##fragment", f.join("no#fragment/#/#.js#fragment")), - - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn issue238_resolve() { - let f = super::fixture().join("issue-238"); - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into(), ".jsx".into(), ".ts".into(), ".tsx".into()], - modules: vec!["src/a".into(), "src/b".into(), "src/common".into(), "node_modules".into()], - ..ResolveOptions::default() - }); - let resolved_path = - resolver.resolve(f.join("src/common"), "config/myObjectFile").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("src/common/config/myObjectFile.js")),); -} - -#[test] -fn prefer_relative() { - let f = super::fixture(); - - let resolver = - Resolver::new(ResolveOptions { prefer_relative: true, ..ResolveOptions::default() }); - - #[rustfmt::skip] - let pass = [ - ("should correctly resolve with preferRelative 1", "main1.js", f.join("main1.js")), - ("should correctly resolve with preferRelative 2", "m1/a.js", f.join("node_modules/m1/a.js")), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } -} - -#[test] -fn resolve_to_context() { - let f = super::fixture(); - let resolver = - Resolver::new(ResolveOptions { resolve_to_context: true, ..ResolveOptions::default() }); - - #[rustfmt::skip] - let data = [ - ("context for fixtures", f.clone(), "./", f.clone()), - ("context for fixtures/lib", f.clone(), "./lib", f.join("lib")), - ("context for fixtures with ..", f.clone(), "./lib/../../fixtures/./lib/..", f.clone()), - ("context for fixtures with query", f.clone(), "./?query", f.clone().with_file_name("fixtures?query")), - ]; - - for (comment, path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn resolve_hash_as_module() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions::default()); - let resolution = resolver.resolve(f, "#a"); - assert_eq!(resolution, Err(ResolveError::NotFound("#a".into()))); -} diff --git a/src/tests/restrictions.rs b/src/tests/restrictions.rs deleted file mode 100644 index 5ba56596..00000000 --- a/src/tests/restrictions.rs +++ /dev/null @@ -1,25 +0,0 @@ -//! - -use crate::{ResolveError, ResolveOptions, Resolver, Restriction}; - -// TODO: regex -// * should respect RegExp restriction -// * should try to find alternative #1 -// * should try to find alternative #2 -// * should try to find alternative #3 - -// should respect string restriction -#[test] -fn restriction1() { - let fixture = super::fixture(); - let f = fixture.join("restrictions"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - restrictions: vec![Restriction::Path(f.clone())], - ..ResolveOptions::default() - }); - - let resolution = resolver.resolve(&f, "pck2"); - assert_eq!(resolution, Err(ResolveError::Restriction(fixture.join("c.js"), f))); -} diff --git a/src/tests/roots.rs b/src/tests/roots.rs deleted file mode 100644 index b50e2a07..00000000 --- a/src/tests/roots.rs +++ /dev/null @@ -1,92 +0,0 @@ -//! - -use std::path::PathBuf; - -use crate::{AliasValue, ResolveError, ResolveOptions, Resolver}; - -fn dirname() -> PathBuf { - super::fixture_root().join("enhanced_resolve").join("test") -} - -#[test] -fn roots() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - alias: vec![("foo".into(), vec![AliasValue::from("/fixtures")])], - roots: vec![dirname(), f.clone()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should respect roots option", "/fixtures/b.js", f.join("b.js")), - ("should try another root option, if it exists", "/b.js", f.join("b.js")), - ("should respect extension", "/fixtures/b", f.join("b.js")), - ("should resolve in directory", "/fixtures/extensions/dir", f.join("extensions/dir/index.js")), - ("should respect aliases", "foo/b", f.join("b.js")), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } - - #[rustfmt::skip] - let fail = [ - ("should not work with relative path", "fixtures/b.js", ResolveError::NotFound("fixtures/b.js".into())) - ]; - - for (comment, request, expected) in fail { - let resolution = resolver.resolve(&f, request); - assert_eq!(resolution, Err(expected), "{comment} {request}"); - } -} - -#[test] -fn resolve_to_context() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - roots: vec![dirname(), f.clone()], - resolve_to_context: true, - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f, "/fixtures/lib").map(|r| r.full_path()); - let expected = f.join("lib"); - assert_eq!(resolved_path, Ok(expected)); -} - -#[test] -fn prefer_absolute() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - alias: vec![("foo".into(), vec![AliasValue::from("/fixtures")])], - roots: vec![dirname(), f.clone()], - prefer_absolute: true, - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve an absolute path (prefer absolute)", f.join("b.js").to_string_lossy().to_string(), f.join("b.js")), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(&f, &request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } -} - -#[test] -fn roots_fall_through() { - let f = super::fixture(); - let absolute_path = f.join("roots_fall_through/index.js"); - let specifier = absolute_path.to_string_lossy(); - let resolution = Resolver::new(ResolveOptions::default().with_root(&f)).resolve(&f, &specifier); - assert_eq!( - resolution.map(super::super::resolution::Resolution::into_path_buf), - Ok(absolute_path) - ); -} diff --git a/src/tests/scoped_packages.rs b/src/tests/scoped_packages.rs deleted file mode 100644 index 8258f00f..00000000 --- a/src/tests/scoped_packages.rs +++ /dev/null @@ -1,25 +0,0 @@ -//! - -use crate::{ResolveOptions, Resolver}; - -#[test] -fn scoped_packages() { - let f = super::fixture().join("scoped"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("main field should work", f.clone(), "@scope/pack1", f.join("./node_modules/@scope/pack1/main.js")), - ("browser field should work", f.clone(), "@scope/pack2", f.join("./node_modules/@scope/pack2/main.js")), - ("folder request should work", f.clone(), "@scope/pack2/lib", f.join("./node_modules/@scope/pack2/lib/index.js")) - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} diff --git a/src/tests/simple.rs b/src/tests/simple.rs deleted file mode 100644 index 08e1238a..00000000 --- a/src/tests/simple.rs +++ /dev/null @@ -1,68 +0,0 @@ -//! - -use std::env; - -use crate::Resolver; - -#[test] -fn simple() { - // mimic `enhanced-resolve/test/simple.test.js` - let dirname = env::current_dir().unwrap().join("fixtures"); - let f = dirname.join("enhanced_resolve/test"); - - let resolver = Resolver::default(); - - let data = [ - ("direct", f.clone(), "../lib/index"), - ("as directory", f, ".."), - ("as module", dirname.clone(), "./enhanced_resolve"), - ]; - - for (comment, path, request) in data { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - let expected = dirname.join("enhanced_resolve/lib/index.js"); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn dashed_name() { - let f = super::fixture(); - - let resolver = Resolver::default(); - - let data = [ - (f.clone(), "dash", f.join("node_modules/dash/index.js")), - (f.clone(), "dash-name", f.join("node_modules/dash-name/index.js")), - (f.join("node_modules/dash"), "dash", f.join("node_modules/dash/index.js")), - (f.join("node_modules/dash"), "dash-name", f.join("node_modules/dash-name/index.js")), - (f.join("node_modules/dash-name"), "dash", f.join("node_modules/dash/index.js")), - (f.join("node_modules/dash-name"), "dash-name", f.join("node_modules/dash-name/index.js")), - ]; - - for (path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{path:?} {request}"); - } -} - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows { - use super::super::memory_fs::MemoryFS; - - use crate::ResolveOptions; - - #[test] - fn no_package() { - use crate::ResolverGeneric; - use std::path::Path; - let f = Path::new("/"); - let file_system = MemoryFS::new(&[]); - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions::default(), - ); - let resolved_path = resolver.resolve(f, "package"); - assert!(resolved_path.is_err()); - } -} diff --git a/src/tests/symlink.rs b/src/tests/symlink.rs deleted file mode 100644 index 7589b560..00000000 --- a/src/tests/symlink.rs +++ /dev/null @@ -1,121 +0,0 @@ -use std::{fs, io, path::Path}; - -use crate::{ResolveOptions, Resolver}; - -#[derive(Debug, Clone, Copy)] -enum FileType { - File, - Dir, -} - -#[allow(unused_variables)] -fn symlink, Q: AsRef>( - original: P, - link: Q, - file_type: FileType, -) -> io::Result<()> { - #[cfg(target_family = "unix")] - { - std::os::unix::fs::symlink(original, link) - } - - #[cfg(target_family = "windows")] - match file_type { - FileType::File => std::os::windows::fs::symlink_file(original, link), - FileType::Dir => std::os::windows::fs::symlink_dir(original, link), - } -} - -fn init(dirname: &Path, temp_path: &Path) -> io::Result<()> { - if temp_path.exists() { - _ = fs::remove_dir_all(temp_path); - } - fs::create_dir(temp_path)?; - symlink(dirname.join("../lib/index.js"), temp_path.join("test"), FileType::File)?; - symlink(dirname.join("../lib"), temp_path.join("test2"), FileType::Dir)?; - fs::remove_file(temp_path.join("test"))?; - fs::remove_file(temp_path.join("test2"))?; - fs::remove_dir(temp_path) -} - -fn create_symlinks(dirname: &Path, temp_path: &Path) -> io::Result<()> { - fs::create_dir(temp_path).unwrap(); - symlink( - dirname.join("../lib/index.js").canonicalize().unwrap(), - temp_path.join("index.js"), - FileType::File, - )?; - symlink(dirname.join("../lib").canonicalize().unwrap(), temp_path.join("lib"), FileType::Dir)?; - symlink(dirname.join("..").canonicalize().unwrap(), temp_path.join("this"), FileType::Dir)?; - symlink(temp_path.join("this"), temp_path.join("that"), FileType::Dir)?; - symlink(Path::new("../../lib/index.js"), temp_path.join("node.relative.js"), FileType::File)?; - symlink( - Path::new("./node.relative.js"), - temp_path.join("node.relative.sym.js"), - FileType::File, - )?; - Ok(()) -} - -fn cleanup_symlinks(temp_path: &Path) { - _ = fs::remove_dir_all(temp_path); -} - -#[test] -fn test() -> io::Result<()> { - let root = super::fixture_root().join("enhanced_resolve"); - let dirname = root.join("test"); - let temp_path = dirname.join("temp"); - if !temp_path.exists() { - let is_admin = init(&dirname, &temp_path).is_ok(); - if !is_admin { - return Ok(()); - } - if let Err(err) = create_symlinks(&dirname, &temp_path) { - cleanup_symlinks(&temp_path); - return Err(err); - } - } - - let resolver_without_symlinks = - Resolver::new(ResolveOptions { symlinks: false, ..ResolveOptions::default() }); - let resolver_with_symlinks = Resolver::default(); - - #[rustfmt::skip] - let pass = [ - ("with a symlink to a file", temp_path.clone(), "./index.js"), - ("with a relative symlink to a file", temp_path.clone(), "./node.relative.js"), - ("with a relative symlink to a symlink to a file", temp_path.clone(), "./node.relative.sym.js"), - ("with a symlink to a directory 1", temp_path.clone(), "./lib/index.js"), - ("with a symlink to a directory 2", temp_path.clone(), "./this/lib/index.js"), - ("with multiple symlinks in the path 1", temp_path.clone(), "./this/test/temp/index.js"), - ("with multiple symlinks in the path 2", temp_path.clone(), "./this/test/temp/lib/index.js"), - ("with multiple symlinks in the path 3", temp_path.clone(), "./this/test/temp/this/lib/index.js"), - ("with a symlink to a directory 2 (chained)", temp_path.clone(), "./that/lib/index.js"), - ("with multiple symlinks in the path 1 (chained)", temp_path.clone(), "./that/test/temp/index.js"), - ("with multiple symlinks in the path 2 (chained)", temp_path.clone(), "./that/test/temp/lib/index.js"), - ("with multiple symlinks in the path 3 (chained)", temp_path.clone(), "./that/test/temp/that/lib/index.js"), - ("with symlinked directory as context 1", temp_path.join( "lib"), "./index.js"), - ("with symlinked directory as context 2", temp_path.join( "this"), "./lib/index.js"), - ("with symlinked directory as context and in path", temp_path.join( "this"), "./test/temp/lib/index.js"), - ("with symlinked directory in context path", temp_path.join( "this/lib"), "./index.js"), - ("with symlinked directory in context path and symlinked file", temp_path.join( "this/test"), "./temp/index.js"), - ("with symlinked directory in context path and symlinked directory", temp_path.join( "this/test"), "./temp/lib/index.js"), - ("with symlinked directory as context 2 (chained)", temp_path.join( "that"), "./lib/index.js"), - ("with symlinked directory as context and in path (chained)", temp_path.join( "that"), "./test/temp/lib/index.js"), - ("with symlinked directory in context path (chained)", temp_path.join( "that/lib"), "./index.js"), - ("with symlinked directory in context path and symlinked file (chained)", temp_path.join( "that/test"), "./temp/index.js"), - ("with symlinked directory in context path and symlinked directory (chained)", temp_path.join( "that/test"), "./temp/lib/index.js") - ]; - - for (comment, path, request) in pass { - let filename = resolver_with_symlinks.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(filename, Ok(root.join("lib/index.js")), "{comment:?}"); - - let resolved_path = - resolver_without_symlinks.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(path.join(request))); - } - - Ok(()) -} diff --git a/src/tests/tsconfig_paths.rs b/src/tests/tsconfig_paths.rs deleted file mode 100644 index 26935b5c..00000000 --- a/src/tests/tsconfig_paths.rs +++ /dev/null @@ -1,507 +0,0 @@ -//! tests for tsconfig-paths -//! -//! Fixtures copied from . - -use std::path::{Path, PathBuf}; - -use crate::{ - ResolveError, ResolveOptions, Resolver, TsConfig, TsconfigOptions, TsconfigReferences, -}; - -// -#[test] -fn tsconfig() { - let f = super::fixture_root().join("tsconfig"); - - #[rustfmt::skip] - let pass = [ - (f.clone(), None, "ts-path", f.join("foo.js")), - (f.join("nested"), None, "ts-path", f.join("nested/test.js")), - (f.join("cases/index"), None, "foo", f.join("node_modules/tsconfig-index/foo.js")), - // This requires reading package.json.tsconfig field - // (f.join("cases/field"), "foo", f.join("node_modules/tsconfig-field/foo.js")) - (f.join("cases/exports"), None, "foo", f.join("node_modules/tsconfig-exports/foo.js")), - (f.join("cases/extends-extension"), None, "foo", f.join("cases/extends-extension/foo.js")), - (f.join("cases/extends-extensionless"), None, "foo", f.join("node_modules/tsconfig-field/foo.js")), - (f.join("cases/extends-paths"), Some("src"), "@/index", f.join("cases/extends-paths/src/index.js")), - (f.join("cases/extends-multiple"), None, "foo", f.join("cases/extends-multiple/foo.js")), - ]; - - for (dir, subdir, request, expected) in pass { - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: dir.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - let path = subdir.map_or(dir.clone(), |subdir| dir.join(subdir)); - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{request} {path:?}"); - } - - #[rustfmt::skip] - let data = [ - (f.join("node_modules/tsconfig-not-used"), "ts-path", Ok(f.join("foo.js"))), - ]; - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - for (path, request, expected) in data { - let resolution = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolution, expected, "{path:?} {request}"); - } -} - -#[test] -fn tsconfig_fallthrough() { - let f = super::fixture_root().join("tsconfig"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "/"); - assert_eq!(resolved_path, Err(ResolveError::NotFound("/".into()))); -} - -#[test] -fn json_with_comments() { - let f = super::fixture_root().join("tsconfig/cases/trailing-comma"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "foo").map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(f.join("bar.js"))); -} - -// -#[test] -fn test_paths() { - let path = Path::new("/foo/tsconfig.json"); - let mut tsconfig_json = serde_json::json!({ - "compilerOptions": { - "paths": { - "jquery": ["node_modules/jquery/dist/jquery"], - "*": ["generated/*"], - "bar/*": ["test/*"], - "bar/baz/*": ["baz/*", "yo/*"], - "@/components/*": ["components/*"], - "url": ["node_modules/my-url"], - } - } - }) - .to_string(); - let tsconfig = TsConfig::parse(true, path, &mut tsconfig_json).unwrap(); - - let data = [ - ("jquery", vec!["/foo/node_modules/jquery/dist/jquery"]), - ("test", vec!["/foo/generated/test"]), - ("test/hello", vec!["/foo/generated/test/hello"]), - ("bar/hi", vec!["/foo/test/hi"]), - ("bar/baz/hi", vec!["/foo/baz/hi", "/foo/yo/hi"]), - ("@/components/button", vec!["/foo/components/button"]), - ("./jquery", vec![]), - ("url", vec!["/foo/node_modules/my-url"]), - ]; - - for (specifier, expected) in data { - let paths = tsconfig.resolve_path_alias(specifier); - let expected = expected.into_iter().map(PathBuf::from).collect::>(); - assert_eq!(paths, expected, "{specifier}"); - } -} - -// -#[test] -fn test_base_url() { - let path = Path::new("/foo/tsconfig.json"); - let mut tsconfig_json = serde_json::json!({ - "compilerOptions": { - "baseUrl": "./src" - } - }) - .to_string(); - let tsconfig = TsConfig::parse(true, path, &mut tsconfig_json).unwrap(); - - let data = [ - ("foo", vec!["/foo/src/foo"]), - ("components/button", vec!["/foo/src/components/button"]), - ("./jquery", vec![]), - ]; - - for (specifier, expected) in data { - let paths = tsconfig.resolve_path_alias(specifier); - let expected = expected.into_iter().map(PathBuf::from).collect::>(); - assert_eq!(paths, expected, "{specifier}"); - } -} - -// -#[test] -fn test_paths_and_base_url() { - let path = Path::new("/foo/tsconfig.json"); - let mut tsconfig_json = serde_json::json!({ - "compilerOptions": { - "baseUrl": "./src", - "paths": { - "*": ["generated/*"], - "bar/*": ["test/*"], - "bar/baz/*": ["baz/*", "yo/*"], - "@/components/*": ["components/*"] - } - } - }) - .to_string(); - let tsconfig = TsConfig::parse(true, path, &mut tsconfig_json).unwrap(); - - let data = [ - ("test", vec!["/foo/src/generated/test", "/foo/src/test"]), - ("test/hello", vec!["/foo/src/generated/test/hello", "/foo/src/test/hello"]), - ("bar/hi", vec!["/foo/src/test/hi", "/foo/src/bar/hi"]), - ("bar/baz/hi", vec!["/foo/src/baz/hi", "/foo/src/yo/hi", "/foo/src/bar/baz/hi"]), - ("@/components/button", vec!["/foo/src/components/button", "/foo/src/@/components/button"]), - ("./jquery", vec![]), - ]; - - for (specifier, expected) in data { - let paths = tsconfig.resolve_path_alias(specifier); - let expected = expected.into_iter().map(PathBuf::from).collect::>(); - assert_eq!(paths, expected, "{specifier}"); - } -} - -// Template variable ${configDir} for substitution of config files directory path -// https://github.com/microsoft/TypeScript/pull/58042 -#[test] -fn test_template_variable() { - let f = super::fixture_root().join("tsconfig"); - let f2 = f.join("cases").join("paths_template_variable"); - - #[rustfmt::skip] - let pass = [ - (f2.clone(), "tsconfig1.json", "foo", f2.join("foo.js")), - (f2.clone(), "tsconfig2.json", "foo", f2.join("foo.js")), - (f.clone(), "tsconfig_template_variable.json", "foo", f.join("foo.js")), - ]; - - for (dir, tsconfig, request, expected) in pass { - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: dir.join(tsconfig), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&dir, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{request} {tsconfig} {dir:?}"); - } -} - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows_test { - use std::path::{Path, PathBuf}; - - use crate::{ - ResolveError, ResolveOptions, ResolverGeneric, TsconfigOptions, TsconfigReferences, - }; - - use super::super::memory_fs::MemoryFS; - - struct OneTest { - name: &'static str, - tsconfig: String, - package_json: Option<(PathBuf, String)>, - main_fields: Option>, - existing_files: Vec<&'static str>, - requested_module: &'static str, - expected_path: &'static str, - extensions: Vec, - } - - impl Default for OneTest { - fn default() -> Self { - Self { - name: "", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/*": ["location/*"] - } - } - }) - .to_string(), - package_json: None, - main_fields: None, - existing_files: vec![], - requested_module: "", - expected_path: "", - extensions: vec![ - ".js".into(), - ".json".into(), - ".node".into(), - ".ts".into(), - ".tsx".into(), - ], - } - } - } - - impl OneTest { - fn resolver(&self, root: &Path) -> ResolverGeneric { - let mut file_system = MemoryFS::default(); - - file_system.add_file(&root.join("tsconfig.json"), &self.tsconfig); - if let Some((path, package_json)) = &self.package_json { - file_system.add_file(&root.join(path).join("package.json"), package_json); - } - for path in &self.existing_files { - file_system.add_file(Path::new(path), ""); - } - - let mut options = ResolveOptions { - extensions: self.extensions.clone(), - tsconfig: Some(TsconfigOptions { - config_file: root.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }; - if let Some(main_fields) = &self.main_fields { - options.main_fields.clone_from(main_fields); - } - - ResolverGeneric::::new_with_file_system(file_system, options) - } - } - - // Path matching tests from tsconfig-paths - // * - // * - #[test] - fn match_path() { - let pass = [ - OneTest { - name: "should locate path that matches with star and exists", - existing_files: vec!["/root/location/mylib/index.ts"], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve to correct path when many are specified", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/*": ["foo1/*", "foo2/*", "location/*", "foo3/*"], - } - } - }) - .to_string(), - existing_files: vec!["/root/location/mylib/index.ts"], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should locate path that matches with star and prioritize pattern with longest prefix", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "*": ["location/*"], - "lib/*": ["location/*"], - } - } - }) - .to_string(), - existing_files: vec![ - "/root/location/lib/mylib/index.ts", - "/root/location/mylib/index.ts", - ], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should locate path that matches with star and exists with extension", - existing_files: vec![ - "/root/location/mylib.myext", - ], - requested_module: "lib/mylib", - extensions: vec![".js".into(), ".myext".into()], - expected_path: "/root/location/mylib.myext", - ..OneTest::default() - }, - OneTest { - name: "should resolve request with extension specified", - existing_files: vec![ - "/root/location/test.jpg", - ], - requested_module: "lib/test.jpg", - expected_path: "/root/location/test.jpg", - ..OneTest::default() - }, - OneTest { - name: "should locate path that matches without star and exists", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/foo": ["location/foo"] - } - } - }) - .to_string(), - existing_files: vec![ - "/root/location/foo.ts", - ], - requested_module: "lib/foo", - expected_path: "/root/location/foo.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve to parent folder when filename is in subfolder", - existing_files: vec![ - "/root/location/mylib/index.ts", - ], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve from main field in package.json", - package_json: Some((PathBuf::from("/root/location/mylib"), serde_json::json!({ - "main": "./kalle.ts" - }).to_string())), - existing_files: vec![ - "/root/location/mylib/kalle.ts", - ], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/kalle.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve from main field in package.json (js)", - package_json: Some((PathBuf::from("/root/location/mylib.js"), serde_json::json!({ - "main": "./kalle.js" - }).to_string())), - existing_files: vec![ - "/root/location/mylib.js/kalle.js", - ], - extensions: vec![".ts".into(), ".js".into()], - requested_module: "lib/mylib.js", - expected_path: "/root/location/mylib.js/kalle.js", - ..OneTest::default() - }, - OneTest { - name: "should resolve from list of fields by priority in package.json", - main_fields: Some(vec!["missing".into(), "browser".into(), "main".into()]), - package_json: Some((PathBuf::from("/root/location/mylibjs"), serde_json::json!({ - "main": "./main.js", - "browser": "./browser.js" - }).to_string())), - existing_files: vec![ - "/root/location/mylibjs/main.js", - "/root/location/mylibjs/browser.js", - ], - extensions: vec![".ts".into(), ".js".into()], - requested_module: "lib/mylibjs", - expected_path: "/root/location/mylibjs/browser.js", - ..OneTest::default() - }, -OneTest { - name: "should ignore field mappings to missing files in package.json", - main_fields: Some(vec!["browser".into(), "main".into()]), - package_json: Some((PathBuf::from("/root/location/mylibjs"), serde_json::json!({ - "main": "./kalle.js", - "browser": "./nope.js" - }).to_string())), - existing_files: vec![ - "/root/location/mylibjs/kalle.js", - ], - extensions: vec![".ts".into(), ".js".into()], - requested_module: "lib/mylibjs", - expected_path: "/root/location/mylibjs/kalle.js", - ..OneTest::default() - }, - // Tests that are not applicable: - // name: "should resolve nested main fields" - // name: "should ignore advanced field mappings in package.json" - // name: "should resolve to with the help of baseUrl when not explicitly set" - // name: "should not resolve with the help of baseUrl when asked not to" - // name: "should resolve main file with cjs file extension" - OneTest { - name: "should resolve .ts from .js alias", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "@/*": ["src/*"] - } - } - }).to_string(), - existing_files: vec![ - "/root/src/foo.ts", - ], - requested_module: "@/foo", // original data was "@/foo.ts" but I don't get why it is the case? - expected_path: "/root/src/foo.ts", // original data was "/root/src/foo" - ..OneTest::default() - }, - ]; - - let root = PathBuf::from("/root"); - - for test in pass { - let resolved_path = - test.resolver(&root).resolve(&root, test.requested_module).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(PathBuf::from(test.expected_path)), "{}", test.name); - } - - let fail = [ - OneTest { - name: "should not locate path that does not match", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/*": ["location/*"] - } - } - }) - .to_string(), - existing_files: vec!["/root/location/mylib"], - requested_module: "lib/mylibjs", - ..OneTest::default() - }, - OneTest { - name: "should not resolve typings file (index.d.ts)", - existing_files: vec!["/root/location/mylib/index.d.ts"], - requested_module: "lib/mylib", - ..OneTest::default() - }, - ]; - - for test in fail { - let resolved_path = - test.resolver(&root).resolve(&root, test.requested_module).map(|f| f.full_path()); - assert_eq!( - resolved_path, - Err(ResolveError::NotFound(test.requested_module.into())), - "{}", - test.name - ); - } - } -} diff --git a/src/tests/tsconfig_project_references.rs b/src/tests/tsconfig_project_references.rs deleted file mode 100644 index b552fefe..00000000 --- a/src/tests/tsconfig_project_references.rs +++ /dev/null @@ -1,101 +0,0 @@ -//! Tests for tsconfig project references - -use crate::{ResolveError, ResolveOptions, Resolver, TsconfigOptions, TsconfigReferences}; - -#[test] -fn auto() { - let f = super::fixture_root().join("tsconfig/cases/project_references"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("app"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - // Test normal paths alias - (f.join("app"), "@/index.ts", f.join("app/aliased/index.ts")), - (f.join("app"), "@/../index.ts", f.join("app/index.ts")), - // Test project reference - (f.join("project_a"), "@/index.ts", f.join("project_a/aliased/index.ts")), - (f.join("project_b/src"), "@/index.ts", f.join("project_b/src/aliased/index.ts")), - // Does not have paths alias - (f.join("project_a"), "./index.ts", f.join("project_a/index.ts")), - (f.join("project_c"), "./index.ts", f.join("project_c/index.ts")), - // Template variable - { - let dir = f.parent().unwrap().join("paths_template_variable"); - (dir.clone(), "foo", dir.join("foo.js")) - } - ]; - - for (path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{request} {path:?}"); - } -} - -#[test] -fn disabled() { - let f = super::fixture_root().join("tsconfig/cases/project_references"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("app"), - references: TsconfigReferences::Disabled, - }), - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - // Test normal paths alias - (f.join("app"), "@/index.ts", Ok(f.join("app/aliased/index.ts"))), - (f.join("app"), "@/../index.ts", Ok(f.join("app/index.ts"))), - // Test project reference - (f.join("project_a"), "@/index.ts", Err(ResolveError::NotFound("@/index.ts".into()))), - (f.join("project_b/src"), "@/index.ts", Err(ResolveError::NotFound("@/index.ts".into()))), - // Does not have paths alias - (f.join("project_a"), "./index.ts", Ok(f.join("project_a/index.ts"))), - (f.join("project_c"), "./index.ts", Ok(f.join("project_c/index.ts"))), - ]; - - for (path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, expected, "{request} {path:?}"); - } -} - -#[test] -fn manual() { - let f = super::fixture_root().join("tsconfig/cases/project_references"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("app"), - references: TsconfigReferences::Paths(vec!["../project_a/conf.json".into()]), - }), - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - // Test normal paths alias - (f.join("app"), "@/index.ts", Ok(f.join("app/aliased/index.ts"))), - (f.join("app"), "@/../index.ts", Ok(f.join("app/index.ts"))), - // Test project reference - (f.join("project_a"), "@/index.ts", Ok(f.join("project_a/aliased/index.ts"))), - (f.join("project_b/src"), "@/index.ts", Err(ResolveError::NotFound("@/index.ts".into()))), - // Does not have paths alias - (f.join("project_a"), "./index.ts", Ok(f.join("project_a/index.ts"))), - (f.join("project_c"), "./index.ts", Ok(f.join("project_c/index.ts"))), - ]; - - for (path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, expected, "{request} {path:?}"); - } -} diff --git a/src/tsconfig.rs b/src/tsconfig.rs deleted file mode 100644 index aa00f6e4..00000000 --- a/src/tsconfig.rs +++ /dev/null @@ -1,212 +0,0 @@ -use std::{ - path::{Path, PathBuf}, - sync::Arc, -}; - -use serde::Deserialize; -use typescript_tsconfig_json::{CompilerOptionsPathsMap, ExtendsField}; - -use crate::PathUtil; - -#[derive(Debug, Deserialize)] -#[serde(rename_all = "camelCase")] -pub struct TsConfig { - /// Whether this is the caller tsconfig. - /// Used for final template variable substitution when all configs are extended and merged. - #[serde(skip)] - root: bool, - - /// Path to `tsconfig.json`. Contains the `tsconfig.json` filename. - #[serde(skip)] - path: PathBuf, - - #[serde(default)] - pub extends: Option, - - #[serde(default)] - pub compiler_options: CompilerOptions, - - /// Bubbled up project references with a reference to their tsconfig. - #[serde(default)] - pub references: Vec, -} - -/// Compiler Options -/// -/// -#[derive(Debug, Default, Deserialize)] -#[serde(rename_all = "camelCase")] -pub struct CompilerOptions { - base_url: Option, - - /// Path aliases - paths: Option, - - /// The actual base for where path aliases are resolved from. - #[serde(skip)] - paths_base: PathBuf, -} - -/// Project Reference -/// -/// -#[derive(Debug, Deserialize)] -pub struct ProjectReference { - /// The path property of each reference can point to a directory containing a tsconfig.json file, - /// or to the config file itself (which may have any name). - pub path: PathBuf, - - /// Reference to the resolved tsconfig - #[serde(skip)] - pub tsconfig: Option>, -} - -impl TsConfig { - pub fn parse(root: bool, path: &Path, json: &mut str) -> Result { - _ = json_strip_comments::strip(json); - let mut tsconfig: Self = serde_json::from_str(json)?; - tsconfig.root = root; - tsconfig.path = path.to_path_buf(); - let directory = tsconfig.directory().to_path_buf(); - if let Some(base_url) = tsconfig.compiler_options.base_url { - tsconfig.compiler_options.base_url = Some(directory.normalize_with(base_url)); - } - if tsconfig.compiler_options.paths.is_some() { - tsconfig.compiler_options.paths_base = - tsconfig.compiler_options.base_url.as_ref().map_or(directory, Clone::clone); - } - Ok(tsconfig) - } - - pub fn build(mut self) -> Self { - if self.root { - let dir = self.directory().to_path_buf(); - // Substitute template variable in `tsconfig.compilerOptions.paths` - if let Some(paths) = &mut self.compiler_options.paths { - for paths in paths.values_mut() { - for path in paths { - Self::substitute_template_variable(&dir, path); - } - } - } - } - self - } - - /// Directory to `tsconfig.json` - /// - /// # Panics - /// - /// * When the `tsconfig.json` path is misconfigured. - pub fn directory(&self) -> &Path { - debug_assert!(self.path.file_name().is_some()); - self.path.parent().unwrap() - } - - pub fn extend_tsconfig(&mut self, tsconfig: &Self) { - let compiler_options = &mut self.compiler_options; - if compiler_options.paths.is_none() { - compiler_options.paths_base = compiler_options - .base_url - .as_ref() - .map_or_else(|| tsconfig.compiler_options.paths_base.clone(), Clone::clone); - compiler_options.paths.clone_from(&tsconfig.compiler_options.paths); - } - if compiler_options.base_url.is_none() { - compiler_options.base_url.clone_from(&tsconfig.compiler_options.base_url); - } - } - - pub fn resolve(&self, path: &Path, specifier: &str) -> Vec { - if path.starts_with(self.base_path()) { - let paths = self.resolve_path_alias(specifier); - if !paths.is_empty() { - return paths; - } - } - for tsconfig in self.references.iter().filter_map(|reference| reference.tsconfig.as_ref()) { - if path.starts_with(tsconfig.base_path()) { - return tsconfig.resolve_path_alias(specifier); - } - } - vec![] - } - - // Copied from parcel - // - pub fn resolve_path_alias(&self, specifier: &str) -> Vec { - if specifier.starts_with(|s| s == '/' || s == '.') { - return vec![]; - } - - let base_url_iter = self - .compiler_options - .base_url - .as_ref() - .map_or_else(Vec::new, |base_url| vec![base_url.normalize_with(specifier)]); - - let Some(paths_map) = &self.compiler_options.paths else { - return base_url_iter; - }; - - let paths = paths_map.get(specifier).map_or_else( - || { - let mut longest_prefix_length = 0; - let mut longest_suffix_length = 0; - let mut best_key: Option<&String> = None; - - for key in paths_map.keys() { - if let Some((prefix, suffix)) = key.split_once('*') { - if (best_key.is_none() || prefix.len() > longest_prefix_length) - && specifier.starts_with(prefix) - && specifier.ends_with(suffix) - { - longest_prefix_length = prefix.len(); - longest_suffix_length = suffix.len(); - best_key.replace(key); - } - } - } - - best_key.and_then(|key| paths_map.get(key)).map_or_else(Vec::new, |paths| { - paths - .iter() - .map(|path| { - path.replace( - '*', - &specifier[longest_prefix_length - ..specifier.len() - longest_suffix_length], - ) - }) - .collect::>() - }) - }, - Clone::clone, - ); - - paths - .into_iter() - .map(|p| self.compiler_options.paths_base.normalize_with(p)) - .chain(base_url_iter) - .collect() - } - - fn base_path(&self) -> &Path { - self.compiler_options - .base_url - .as_ref() - .map_or_else(|| self.directory(), |path| path.as_ref()) - } - - /// Template variable `${configDir}` for substitution of config files directory path - /// - /// NOTE: All tests cases are just a head replacement of `${configDir}`, so we are constrained as such. - /// - /// See - fn substitute_template_variable(directory: &Path, path: &mut String) { - const TEMPLATE_VARIABLE: &str = "${configDir}/"; - if let Some(stripped_path) = path.strip_prefix(TEMPLATE_VARIABLE) { - *path = directory.join(stripped_path).to_string_lossy().to_string(); - } - } -} diff --git a/tests/integration_test.rs b/tests/integration_test.rs deleted file mode 100644 index d369413f..00000000 --- a/tests/integration_test.rs +++ /dev/null @@ -1,102 +0,0 @@ -//! Test public APIs - -use std::{env, path::PathBuf}; - -use oxc_resolver::{EnforceExtension, Resolution, ResolveContext, ResolveOptions, Resolver}; - -fn dir() -> PathBuf { - env::current_dir().unwrap() -} - -fn resolve(specifier: &str) -> Resolution { - let path = dir(); - Resolver::new(ResolveOptions::default()).resolve(path, specifier).unwrap() -} - -#[test] -fn clone() { - let resolution = resolve("./tests/package.json"); - assert_eq!(resolution.clone(), resolution); -} - -#[test] -fn debug() { - let resolution = resolve("./tests/package.json"); - let s = format!("{resolution:?}"); - assert!(!s.is_empty()); -} - -#[test] -fn eq() { - let resolution = resolve("./tests/package.json"); - assert_eq!(resolution, resolution); -} - -#[test] -fn package_json() { - let resolution = resolve("./tests/package.json"); - assert!(resolution - .package_json() - .is_some_and(|json| json.name.as_ref().is_some_and(|name| name == "name"))); -} - -#[cfg(feature = "package_json_raw_json_api")] -#[test] -fn package_json_raw_json_api() { - let resolution = resolve("./tests/package.json"); - assert!(resolution - .package_json() - .unwrap() - .raw_json() - .get("name") - .is_some_and(|name| name == "name")); -} - -#[test] -fn clear_cache() { - let resolver = Resolver::new(ResolveOptions::default()); - resolver.clear_cache(); // exists -} - -#[test] -fn options() { - let resolver = Resolver::new(ResolveOptions::default()); - let options = resolver.options(); - assert!(!format!("{options:?}").is_empty()); -} - -#[test] -fn debug_resolver() { - let resolver = Resolver::new(ResolveOptions::default()); - assert!(!format!("{resolver:?}").is_empty()); -} - -#[test] -fn dependencies() { - let path = dir(); - let mut ctx = ResolveContext::default(); - let _ = Resolver::new(ResolveOptions::default()).resolve_with_context( - path, - "./tests/package.json", - &mut ctx, - ); - assert!(!ctx.file_dependencies.is_empty()); - assert!(ctx.missing_dependencies.is_empty()); -} - -#[test] -fn options_api() { - _ = ResolveOptions::default() - .with_builtin_modules(true) - .with_condition_names(&[]) - .with_extension(".js") - .with_force_extension(EnforceExtension::Auto) - .with_fully_specified(true) - .with_main_field("asdf") - .with_main_file("main") - .with_module("module") - .with_prefer_absolute(true) - .with_prefer_relative(true) - .with_root(PathBuf::new()) - .with_symbolic_link(true); -} diff --git a/tests/package.json b/tests/package.json deleted file mode 100644 index f099adcf..00000000 --- a/tests/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "name": "name" -} diff --git a/tests/resolve_test.rs b/tests/resolve_test.rs deleted file mode 100644 index 30d1ceff..00000000 --- a/tests/resolve_test.rs +++ /dev/null @@ -1,104 +0,0 @@ -use std::{env, path::PathBuf}; - -use oxc_resolver::{ResolveError, ResolveOptions, Resolver}; - -fn dir() -> PathBuf { - env::current_dir().unwrap() -} - -#[test] -fn chinese() { - let dir = dir(); - let specifier = "./fixtures/misc/中文/中文.js"; - let resolution = Resolver::new(ResolveOptions::default()).resolve(&dir, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(dir.join("fixtures/misc/中文/中文.js")) - ); -} - -#[test] -fn styled_components() { - let dir = dir(); - let path = dir.join("fixtures/pnpm"); - let module_path = dir.join("node_modules/.pnpm/styled-components@6.1.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/styled-components"); - let specifier = "styled-components"; - - // cjs - let options = - ResolveOptions { alias_fields: vec![vec!["browser".into()]], ..ResolveOptions::default() }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/styled-components.browser.cjs.js")) - ); - - // esm - let options = ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - main_fields: vec!["module".into()], - ..ResolveOptions::default() - }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/styled-components.browser.esm.js")) - ); -} - -#[test] -fn axios() { - let dir = dir(); - let path = dir.join("fixtures/pnpm"); - let module_path = dir.join("node_modules/.pnpm/axios@1.6.2/node_modules/axios"); - let specifier = "axios"; - - // default - let options = ResolveOptions::default(); - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("index.js")) - ); - - // browser - let options = ResolveOptions { - condition_names: vec!["browser".into(), "require".into()], - ..ResolveOptions::default() - }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/browser/axios.cjs")) - ); - - // cjs - let options = ResolveOptions { - condition_names: vec!["node".into(), "require".into()], - ..ResolveOptions::default() - }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/node/axios.cjs")) - ); -} - -#[test] -fn postcss() { - let dir = dir(); - let path = dir.join("fixtures/pnpm"); - let module_path = path.join("node_modules/postcss"); - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - // should ignore "path" - let resolution = resolver.resolve(&module_path, "path"); - assert_eq!(resolution, Err(ResolveError::Ignored(module_path.clone()))); - - // should ignore "./lib/terminal-highlight" - let resolution = resolver.resolve(&module_path, "./lib/terminal-highlight"); - assert_eq!(resolution, Err(ResolveError::Ignored(module_path.join("lib/terminal-highlight")))); -} From 40f737eb6f55051cb7034d5bdb6e49cde19a32cb Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Mon, 24 Jun 2024 02:18:40 +0300 Subject: [PATCH 35/82] squash! --- Cargo.lock | 858 ------ fixtures/enhanced_resolve/lib/index.js | 1 - fixtures/enhanced_resolve/package.json | 4 - fixtures/enhanced_resolve/test/.gitignore | 2 - .../enhanced_resolve/test/fixtures/#/a.js | 0 fixtures/enhanced_resolve/test/fixtures/a.js | 3 - .../enhanced_resolve/test/fixtures/abc.txt | 1 - .../test/fixtures/alias/files/a.js | 0 fixtures/enhanced_resolve/test/fixtures/b.js | 3 - .../browser-module/browser/module-a.js | 0 .../fixtures/browser-module/lib/browser.js | 0 .../fixtures/browser-module/lib/ignore.js | 0 .../test/fixtures/browser-module/lib/main.js | 0 .../fixtures/browser-module/lib/replaced.js | 0 .../test/fixtures/browser-module/lib/self.js | 0 .../fixtures/browser-module/lib/toString.js | 0 .../browser-module/node_modules/module-a.js | 0 .../browser-module/node_modules/module-b.js | 0 .../browser-module/node_modules/module-c.js | 0 .../node_modules/recursive-file/a.js | 0 .../node_modules/recursive-file/b.js | 0 .../node_modules/recursive-file/c.js | 0 .../node_modules/recursive-file/d.js | 0 .../node_modules/recursive-file/package.json | 8 - .../test/fixtures/browser-module/package.json | 33 - .../test/fixtures/builtins/package.json | 12 - fixtures/enhanced_resolve/test/fixtures/c.js | 4 - .../enhanced_resolve/test/fixtures/complex.js | 13 - .../test/fixtures/crypto-js/index.js | 0 .../test/fixtures/crypto-js/package.json | 7 - .../test/fixtures/decorated-fs/exists.js | 0 .../test/fixtures/dirOrFile.js | 1 - .../test/fixtures/dirOrFile/index.js | 1 - .../directory-default/directory-default.js | 0 .../node_modules/@org/pkg/dist/string.js | 1 - .../@org/pkg/dist/string.test.d.ts | 1 - .../node_modules/@org/pkg/package.json | 9 - .../node_modules/pkg/dist/string.js | 1 - .../node_modules/pkg/dist/string.test.d.ts | 1 - .../node_modules/pkg/package.json | 9 - .../node_modules/exports-field/package.json | 7 - .../node_modules/pack1/index.js | 0 .../test/fixtures/exports-field/a.js | 1 - .../node_modules/exports-field/lib/browser.js | 1 - .../node_modules/exports-field/lib/index.js | 0 .../exports-field/lib/lib2/main.js | 1 - .../node_modules/exports-field/lib/main.js | 1 - .../node_modules/exports-field/main.js | 1 - .../node_modules/exports-field/package.json | 18 - .../node_modules/exports-field/x.js | 1 - .../invalid-exports-field/index.js | 0 .../invalid-exports-field/package.json | 13 - .../node_modules/invalid-exports-field/umd.js | 0 .../test/fixtures/exports-field/package.json | 5 - .../node_modules/exports-field/index.js | 1 - .../node_modules/exports-field/lib/browser.js | 1 - .../exports-field/lib/lib2/main.js | 1 - .../node_modules/exports-field/lib/main.js | 1 - .../node_modules/exports-field/main.js | 1 - .../node_modules/exports-field/package.json | 17 - .../node_modules/exports-field/index | 0 .../node_modules/exports-field/main.js | 1 - .../node_modules/exports-field/package.json | 10 - .../node_modules/exports-field/src/index.js | 0 .../fixtures/extension-alias/dir/index.js | 0 .../fixtures/extension-alias/dir/index.ts | 0 .../fixtures/extension-alias/dir2/index.js | 0 .../fixtures/extension-alias/dir2/index.mts | 0 .../test/fixtures/extension-alias/index.js | 0 .../test/fixtures/extension-alias/index.mjs | 0 .../fixtures/extension-alias/index.mts.js | 0 .../test/fixtures/extension-alias/index.ts | 0 .../test/fixtures/extensions/app.module.js | 0 .../test/fixtures/extensions/dir/index.js | 0 .../test/fixtures/extensions/dir/index.ts | 0 .../test/fixtures/extensions/foo.js | 0 .../test/fixtures/extensions/foo.ts | 0 .../test/fixtures/extensions/index.js | 0 .../test/fixtures/extensions/index.ts | 0 .../extensions/node_modules/module.js | 0 .../extensions/node_modules/module/index.ts | 0 .../test/fixtures/extensions/package.json | 3 - .../enhanced_resolve/test/fixtures/file.load1 | 0 .../enhanced_resolve/test/fixtures/file.load2 | 0 .../test/fixtures/foo/index.js | 0 .../test/fixtures/foo/package.json | 4 - .../node_modules/m/package.json | 17 - .../node_modules/m/src/features/f.js | 0 .../m/src/features/internal/file.js | 0 .../node_modules/m/src/features/y/y.js | 0 .../node_modules/m/src/internal/i.js | 0 .../node_modules/m/src/middle-1/f.js | 0 .../node_modules/m/src/middle-1/nested/f.js | 0 .../node_modules/m/src/middle-2/nested/f.js | 1 - .../m/src/middle-3/nested/f/nested/f.js | 0 .../node_modules/m/src/middle-4/f/f.js | 0 .../node_modules/m/src/middle-5/f$/$.js | 0 .../node_modules/m/src/middle-5/f/$.js | 0 .../node_modules/m/src/middle/f.js | 0 .../node_modules/m/src/middle/nested/f.js | 0 .../test/fixtures/imports-field/a.js | 1 - .../test/fixtures/imports-field/b.js | 0 .../test/fixtures/imports-field/dir/b.js | 0 .../node_modules/a/lib/browser.js | 1 - .../imports-field/node_modules/a/lib/index.js | 0 .../node_modules/a/lib/lib2/main.js | 1 - .../imports-field/node_modules/a/lib/main.js | 1 - .../imports-field/node_modules/a/main.js | 1 - .../imports-field/node_modules/a/package.json | 18 - .../imports-field/node_modules/a/x.js | 1 - .../imports-field/node_modules/c/index.js | 0 .../test/fixtures/imports-field/package.json | 17 - .../fixtures/incorrect-package/pack1/a.js | 0 .../incorrect-package/pack1/package.json | 2 - .../fixtures/incorrect-package/pack2/a.js | 0 .../incorrect-package/pack2/package.json | 0 .../test/fixtures/issue-238/package.json | 3 - .../test/fixtures/issue-238/src/a/config.js | 0 .../src/common/config/myObjectFile.js | 0 .../enhanced_resolve/test/fixtures/lib.js | 0 .../test/fixtures/lib/complex1.js | 1 - .../test/fixtures/main-field-self/index.js | 0 .../fixtures/main-field-self/package.json | 3 - .../test/fixtures/main-field-self2/index.js | 0 .../fixtures/main-field-self2/package.json | 3 - .../enhanced_resolve/test/fixtures/main1.js | 9 - .../enhanced_resolve/test/fixtures/main2.js | 12 - .../enhanced_resolve/test/fixtures/main3.js | 4 - .../multiple_modules/node_modules/m1/a.js | 3 - .../test/fixtures/no#fragment/#/#.js | 0 fixtures/enhanced_resolve/test/fixtures/no.js | 0 .../browser-module-broken/browser.js | 0 .../browser-module-broken/main.js | 0 .../browser-module-broken/package.json | 4 - .../complexm/node_modules/m1/a.js | 1 - .../complexm/node_modules/m1/index.js | 1 - .../fixtures/node_modules/complexm/step1.js | 1 - .../fixtures/node_modules/complexm/step2.js | 1 - .../fixtures/node_modules/dash-name/index.js | 0 .../node_modules/dash-name/package.json | 4 - .../test/fixtures/node_modules/dash/index.js | 0 .../fixtures/node_modules/dash/package.json | 4 - .../invalidPackageJson/package.json | 0 .../test/fixtures/node_modules/m1/a.js | 3 - .../test/fixtures/node_modules/m1/b.js | 3 - .../test/fixtures/node_modules/m2/b.js | 1 - .../node_modules/recursive-module/file.js | 0 .../node_modules/recursive-module/index.js | 0 .../test/fixtures/pnp-a/m2/a.js | 3 - .../test/fixtures/pnp/pkg/dir/index.js | 0 .../test/fixtures/pnp/pkg/index.js | 0 .../test/fixtures/pnp/pkg/main.js | 0 .../fixtures/pnp/pkg/package-alias/browser.js | 0 .../fixtures/pnp/pkg/package-alias/index.js | 0 .../test/fixtures/pnp/pkg/package.json | 7 - .../test/fixtures/pnp/pkg/typescript/index.ts | 0 .../test/fixtures/pnp/pkg3/a.js | 1 - .../test/fixtures/pnp/pkg3/package.json | 8 - .../prefer-pnp/alternative-modules/m1/b.js | 0 .../restrictions/node_modules/pck1/index.css | 0 .../restrictions/node_modules/pck1/index.js | 0 .../node_modules/pck1/package.json | 3 - .../restrictions/node_modules/pck2/index.css | 0 .../restrictions/node_modules/pck2/module.js | 0 .../node_modules/pck2/package.json | 5 - .../test/fixtures/roots_fall_through/index.js | 0 .../scoped/node_modules/@scope/pack1/main.js | 0 .../node_modules/@scope/pack1/package.json | 5 - .../node_modules/@scope/pack2/lib/index.js | 0 .../scoped/node_modules/@scope/pack2/main.js | 0 .../node_modules/@scope/pack2/package.json | 3 - .../test/fixtures/shortcutdir.js/a.js | 0 .../test/fixtures/yield/a/foo-2/b | 0 .../test/fixtures/yield/a/foo-2/c | 0 .../test/fixtures/yield/a/foo/a | 0 .../test/fixtures/yield/a/foo/b | 0 .../test/fixtures/yield/b/foo/a | 0 .../test/fixtures/yield/c/foo/a | 0 .../test/fixtures/yield/c/foo/package.json | 7 - .../fixtures/\346\265\213\350\257\225.js" | 0 .../\344\270\255\346\226\207.js" | 0 fixtures/pnpm/.gitignore | 1 - fixtures/pnpm/package.json | 10 - fixtures/pnpm/pnpm-lock.yaml | 212 -- fixtures/tsconfig/cases/builtins/thing.js | 0 .../tsconfig/cases/builtins/tsconfig.json | 5 - fixtures/tsconfig/cases/exports/index.js | 0 fixtures/tsconfig/cases/exports/tsconfig.json | 3 - .../extends-extension/base-tsconfig.json | 7 - .../tsconfig/cases/extends-extension/foo.js | 0 .../cases/extends-extension/tsconfig.json | 3 - .../cases/extends-extensionless/foo.js | 0 .../cases/extends-extensionless/tsconfig.json | 3 - .../tsconfig/cases/extends-multiple/foo.js | 0 .../cases/extends-multiple/tsconfig.json | 6 - .../tsconfig/cases/extends-not-found/index.js | 0 .../cases/extends-not-found/tsconfig.json | 3 - .../tsconfig/cases/extends-paths/src/index.js | 0 .../cases/extends-paths/tsconfig.base.json | 7 - .../cases/extends-paths/tsconfig.json | 6 - fixtures/tsconfig/cases/field/index.js | 0 fixtures/tsconfig/cases/field/tsconfig.json | 3 - fixtures/tsconfig/cases/index/index.js | 0 fixtures/tsconfig/cases/index/tsconfig.json | 3 - .../cases/paths_template_variable/foo.js | 0 .../paths_template_variable/tsconfig1.json | 3 - .../paths_template_variable/tsconfig2.json | 8 - .../project_references/app/aliased/index.ts | 0 .../cases/project_references/app/index.ts | 0 .../project_references/app/tsconfig.json | 23 - .../project_a/aliased/index.ts | 0 .../project_references/project_a/conf.json | 8 - .../project_references/project_a/index.ts | 0 .../project_b/src/aliased/index.ts | 0 .../project_b/tsconfig.json | 9 - .../project_references/project_c/index.ts | 0 .../project_c/tsconfig.json | 5 - .../project_references/tsconfig.base.json | 4 - fixtures/tsconfig/cases/suffixes/a.ios.ts | 0 fixtures/tsconfig/cases/suffixes/a.ts | 0 fixtures/tsconfig/cases/suffixes/b.ts | 0 fixtures/tsconfig/cases/suffixes/c-test.ts | 0 fixtures/tsconfig/cases/suffixes/index.ts | 1 - .../tsconfig/cases/suffixes/tsconfig.json | 5 - fixtures/tsconfig/cases/trailing-comma/bar.js | 0 .../tsconfig/cases/trailing-comma/index.js | 0 .../cases/trailing-comma/tsconfig.json | 9 - fixtures/tsconfig/foo.js | 0 fixtures/tsconfig/nested/index.js | 0 fixtures/tsconfig/nested/test.js | 0 fixtures/tsconfig/nested/tsconfig.json | 8 - .../node_modules/tsconfig-exports/conf.json | 7 - .../node_modules/tsconfig-exports/foo.js | 0 .../tsconfig-exports/package.json | 7 - .../node_modules/tsconfig-field/conf.json | 7 - .../node_modules/tsconfig-field/foo.js | 0 .../node_modules/tsconfig-field/package.json | 5 - .../node_modules/tsconfig-index/foo.js | 0 .../node_modules/tsconfig-index/package.json | 4 - .../node_modules/tsconfig-index/tsconfig.json | 7 - .../node_modules/tsconfig-not-used/foo.js | 0 .../tsconfig-not-used/tsconfig.json | 7 - fixtures/tsconfig/package.json | 24 - fixtures/tsconfig/tsconfig.json | 7 - .../tsconfig/tsconfig_template_variable.json | 7 - napi/__test__/resolver.spec.mjs | 260 -- napi/src/lib.rs | 166 - napi/src/options.rs | 261 -- napi/tests/options.test.mjs | 59 - npm/package.json | 67 +- package.json | 53 +- pnpm-lock.yaml | 2690 ----------------- src/builtins.rs | 71 - src/cache.rs | 369 --- src/context.rs | 89 - src/error.rs | 160 - src/file_system.rs | 133 - src/lib.rs | 1670 ---------- src/options.rs | 623 ---- src/package_json.rs | 207 -- src/path.rs | 132 - src/resolution.rs | 92 - src/specifier.rs | 230 -- src/tests/alias.rs | 280 -- src/tests/browser_field.rs | 189 -- src/tests/builtins.rs | 121 - src/tests/dependencies.rs | 110 - src/tests/exports_field.rs | 2546 ---------------- src/tests/extension_alias.rs | 66 - src/tests/extensions.rs | 125 - src/tests/fallback.rs | 100 - src/tests/full_specified.rs | 113 - src/tests/imports_field.rs | 1320 -------- src/tests/incorrect_description_file.rs | 62 - src/tests/main_field.rs | 24 - src/tests/memory_fs.rs | 74 - src/tests/missing.rs | 106 - src/tests/mod.rs | 49 - src/tests/resolve.rs | 119 - src/tests/restrictions.rs | 25 - src/tests/roots.rs | 92 - src/tests/scoped_packages.rs | 25 - src/tests/simple.rs | 68 - src/tests/symlink.rs | 121 - src/tests/tsconfig_paths.rs | 507 ---- src/tests/tsconfig_project_references.rs | 101 - src/tsconfig.rs | 212 -- tests/integration_test.rs | 102 - tests/package.json | 3 - tests/resolve_test.rs | 104 - 290 files changed, 50 insertions(+), 15709 deletions(-) delete mode 100644 Cargo.lock delete mode 100644 fixtures/enhanced_resolve/lib/index.js delete mode 100644 fixtures/enhanced_resolve/package.json delete mode 100644 fixtures/enhanced_resolve/test/.gitignore delete mode 100644 fixtures/enhanced_resolve/test/fixtures/#/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/abc.txt delete mode 100644 fixtures/enhanced_resolve/test/fixtures/alias/files/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/browser/module-a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/ignore.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/replaced.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/self.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/toString.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-c.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/c.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/d.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/builtins/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/c.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/complex.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/crypto-js/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/decorated-fs/exists.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/dirOrFile.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/directory-default/directory-default.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/pack1/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/umd.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/index delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/src/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.mts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mjs delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mts.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/app.module.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/foo.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/foo.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/file.load1 delete mode 100644 fixtures/enhanced_resolve/test/fixtures/file.load2 delete mode 100644 fixtures/enhanced_resolve/test/fixtures/foo/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/foo/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/internal/file.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/y/y.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/internal/i.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-3/nested/f/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-4/f/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f$/$.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f/$.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/dir/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/c/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/issue-238/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/issue-238/src/a/config.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/issue-238/src/common/config/myObjectFile.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/lib.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/lib/complex1.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self2/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main1.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main2.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main3.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/no#fragment/#/#.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/no.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/invalidPackageJson/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/file.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/dir/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/typescript/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/prefer-pnp/alternative-modules/m1/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.css delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/index.css delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/module.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/roots_fall_through/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/lib/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/shortcutdir.js/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/b delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/c delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo/a delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo/b delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/b/foo/a delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/c/foo/a delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json delete mode 100644 "fixtures/enhanced_resolve/test/fixtures/\346\265\213\350\257\225.js" delete mode 100644 "fixtures/misc/\344\270\255\346\226\207/\344\270\255\346\226\207.js" delete mode 100644 fixtures/pnpm/.gitignore delete mode 100644 fixtures/pnpm/package.json delete mode 100644 fixtures/pnpm/pnpm-lock.yaml delete mode 100644 fixtures/tsconfig/cases/builtins/thing.js delete mode 100644 fixtures/tsconfig/cases/builtins/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/exports/index.js delete mode 100644 fixtures/tsconfig/cases/exports/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-extension/base-tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-extension/foo.js delete mode 100644 fixtures/tsconfig/cases/extends-extension/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-extensionless/foo.js delete mode 100644 fixtures/tsconfig/cases/extends-extensionless/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-multiple/foo.js delete mode 100644 fixtures/tsconfig/cases/extends-multiple/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-not-found/index.js delete mode 100644 fixtures/tsconfig/cases/extends-not-found/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-paths/src/index.js delete mode 100644 fixtures/tsconfig/cases/extends-paths/tsconfig.base.json delete mode 100644 fixtures/tsconfig/cases/extends-paths/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/field/index.js delete mode 100644 fixtures/tsconfig/cases/field/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/index/index.js delete mode 100644 fixtures/tsconfig/cases/index/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/paths_template_variable/foo.js delete mode 100644 fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json delete mode 100644 fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json delete mode 100644 fixtures/tsconfig/cases/project_references/app/aliased/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/app/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/app/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/project_references/project_a/aliased/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_a/conf.json delete mode 100644 fixtures/tsconfig/cases/project_references/project_a/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_b/src/aliased/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_b/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/project_references/project_c/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_c/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/project_references/tsconfig.base.json delete mode 100644 fixtures/tsconfig/cases/suffixes/a.ios.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/a.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/b.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/c-test.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/index.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/trailing-comma/bar.js delete mode 100644 fixtures/tsconfig/cases/trailing-comma/index.js delete mode 100644 fixtures/tsconfig/cases/trailing-comma/tsconfig.json delete mode 100644 fixtures/tsconfig/foo.js delete mode 100644 fixtures/tsconfig/nested/index.js delete mode 100644 fixtures/tsconfig/nested/test.js delete mode 100644 fixtures/tsconfig/nested/tsconfig.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-exports/conf.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-exports/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-exports/package.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-field/conf.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-field/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-field/package.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-index/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-index/package.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-not-used/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json delete mode 100755 fixtures/tsconfig/package.json delete mode 100644 fixtures/tsconfig/tsconfig.json delete mode 100644 fixtures/tsconfig/tsconfig_template_variable.json delete mode 100644 napi/__test__/resolver.spec.mjs delete mode 100644 napi/src/lib.rs delete mode 100644 napi/src/options.rs delete mode 100644 napi/tests/options.test.mjs delete mode 100644 pnpm-lock.yaml delete mode 100644 src/builtins.rs delete mode 100644 src/cache.rs delete mode 100644 src/context.rs delete mode 100644 src/error.rs delete mode 100644 src/file_system.rs delete mode 100644 src/lib.rs delete mode 100644 src/options.rs delete mode 100644 src/package_json.rs delete mode 100644 src/path.rs delete mode 100644 src/resolution.rs delete mode 100644 src/specifier.rs delete mode 100644 src/tests/alias.rs delete mode 100644 src/tests/browser_field.rs delete mode 100644 src/tests/builtins.rs delete mode 100644 src/tests/dependencies.rs delete mode 100644 src/tests/exports_field.rs delete mode 100644 src/tests/extension_alias.rs delete mode 100644 src/tests/extensions.rs delete mode 100644 src/tests/fallback.rs delete mode 100644 src/tests/full_specified.rs delete mode 100644 src/tests/imports_field.rs delete mode 100644 src/tests/incorrect_description_file.rs delete mode 100644 src/tests/main_field.rs delete mode 100644 src/tests/memory_fs.rs delete mode 100644 src/tests/missing.rs delete mode 100644 src/tests/mod.rs delete mode 100644 src/tests/resolve.rs delete mode 100644 src/tests/restrictions.rs delete mode 100644 src/tests/roots.rs delete mode 100644 src/tests/scoped_packages.rs delete mode 100644 src/tests/simple.rs delete mode 100644 src/tests/symlink.rs delete mode 100644 src/tests/tsconfig_paths.rs delete mode 100644 src/tests/tsconfig_project_references.rs delete mode 100644 src/tsconfig.rs delete mode 100644 tests/integration_test.rs delete mode 100644 tests/package.json delete mode 100644 tests/resolve_test.rs diff --git a/Cargo.lock b/Cargo.lock deleted file mode 100644 index c83523b3..00000000 --- a/Cargo.lock +++ /dev/null @@ -1,858 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "aho-corasick" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" -dependencies = [ - "memchr", -] - -[[package]] -name = "anes" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "735d4f398ca57cfa2880225c2bf81c3b9af3be5bb22e44ae70118dad38713e84" - -[[package]] -name = "autocfg" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "bitflags" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" - -[[package]] -name = "bpaf" -version = "0.9.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3280efcf6d66bc77c2cf9b67dc8acee47a217d9be67dd590b3230dffe663724d" - -[[package]] -name = "cast" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "ciborium" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42e69ffd6f0917f5c029256a24d0161db17cea3997d185db0d35926308770f0e" -dependencies = [ - "ciborium-io", - "ciborium-ll", - "serde", -] - -[[package]] -name = "ciborium-io" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05afea1e0a06c9be33d539b876f1ce3692f4afea2cb41f740e7743225ed1c757" - -[[package]] -name = "ciborium-ll" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57663b653d948a338bfb3eeba9bb2fd5fcfaecb9e199e87e1eda4d9e8b240fd9" -dependencies = [ - "ciborium-io", - "half", -] - -[[package]] -name = "clean-path" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aaa6b4b263a5d737e9bf6b7c09b72c41a5480aec4d7219af827f6564e950b6a5" - -[[package]] -name = "codspeed" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a104ac948e0188b921eb3fcbdd55dcf62e542df4c7ab7e660623f6288302089" -dependencies = [ - "colored", - "libc", - "serde_json", -] - -[[package]] -name = "colored" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbf2150cce219b664a8a70df7a1f933836724b503f8a413af9365b4dcc4d90b8" -dependencies = [ - "lazy_static", - "windows-sys 0.48.0", -] - -[[package]] -name = "convert_case" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec182b0ca2f35d8fc196cf3404988fd8b8c739a4d270ff118a398feb0cbec1ca" -dependencies = [ - "unicode-segmentation", -] - -[[package]] -name = "criterion2" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7258985df1aa8b33359ee2392cbc3b7802875242cdacdda91a17a602132c24a9" -dependencies = [ - "anes", - "bpaf", - "cast", - "ciborium", - "codspeed", - "colored", - "num-traits", - "oorandom", - "serde", - "serde_json", - "walkdir", -] - -[[package]] -name = "crossbeam-deque" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" -dependencies = [ - "crossbeam-epoch", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.9.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" -dependencies = [ - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" - -[[package]] -name = "crunchy" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" - -[[package]] -name = "ctor" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edb49164822f3ee45b17acd4a208cfc1251410cf0cad9a833234c9890774dd9f" -dependencies = [ - "quote", - "syn", -] - -[[package]] -name = "dashmap" -version = "5.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" -dependencies = [ - "cfg-if", - "hashbrown", - "lock_api", - "once_cell", - "parking_lot_core", -] - -[[package]] -name = "document-features" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef5282ad69563b5fc40319526ba27e0e7363d552a896f0297d54f767717f9b95" -dependencies = [ - "litrs", -] - -[[package]] -name = "dunce" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b" - -[[package]] -name = "either" -version = "1.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dca9240753cf90908d7e4aac30f630662b02aebaa1b58a3cadabdb23385b58b" - -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "filetime" -version = "0.2.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ee447700ac8aa0b2f2bd7bc4462ad686ba06baa6727ac149a2d6277f0d240fd" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall 0.4.1", - "windows-sys 0.52.0", -] - -[[package]] -name = "half" -version = "2.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dd08c532ae367adf81c312a4580bc67f1d0fe8bc9c460520283f4c0ff277888" -dependencies = [ - "cfg-if", - "crunchy", -] - -[[package]] -name = "hashbrown" -version = "0.14.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" - -[[package]] -name = "indexmap" -version = "2.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" -dependencies = [ - "equivalent", - "hashbrown", - "serde", -] - -[[package]] -name = "itoa" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" - -[[package]] -name = "json-strip-comments" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3d129799327c8f80861e467c59b825ba24c277dba6ad0d71a141dc98f9e04ee" - -[[package]] -name = "lazy_static" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" - -[[package]] -name = "libc" -version = "0.2.155" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" - -[[package]] -name = "libloading" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c2a198fb6b0eada2a8df47933734e6d35d350665a33a3593d7164fa52c75c19" -dependencies = [ - "cfg-if", - "windows-targets 0.52.5", -] - -[[package]] -name = "litrs" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4ce301924b7887e9d637144fdade93f9dfff9b60981d4ac161db09720d39aa5" - -[[package]] -name = "lock_api" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" -dependencies = [ - "autocfg", - "scopeguard", -] - -[[package]] -name = "memchr" -version = "2.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" - -[[package]] -name = "napi" -version = "2.16.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfc300228808a0e6aea5a58115c82889240bcf8dab16fc25ad675b33e454b368" -dependencies = [ - "bitflags 2.5.0", - "ctor", - "napi-derive", - "napi-sys", - "once_cell", - "serde", - "serde_json", -] - -[[package]] -name = "napi-build" -version = "2.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1c0f5d67ee408a4685b61f5ab7e58605c8ae3f2b4189f0127d804ff13d5560a" - -[[package]] -name = "napi-derive" -version = "2.16.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0e034ddf6155192cf83f267ede763fe6c164dfa9971585436b16173718d94c4" -dependencies = [ - "cfg-if", - "convert_case", - "napi-derive-backend", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "napi-derive-backend" -version = "1.0.67" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bff2c00437f3b3266391eb5e6aa25d0029187daf5caf05b8e3271468fb5ae73e" -dependencies = [ - "convert_case", - "once_cell", - "proc-macro2", - "quote", - "regex", - "semver", - "syn", -] - -[[package]] -name = "napi-sys" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "427802e8ec3a734331fec1035594a210ce1ff4dc5bc1950530920ab717964ea3" -dependencies = [ - "libloading", -] - -[[package]] -name = "normalize-path" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5438dd2b2ff4c6df6e1ce22d825ed2fa93ee2922235cc45186991717f0a892d" - -[[package]] -name = "num-traits" -version = "0.2.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" -dependencies = [ - "autocfg", -] - -[[package]] -name = "once_cell" -version = "1.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" - -[[package]] -name = "oorandom" -version = "11.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575" - -[[package]] -name = "oxc_napi_resolver" -version = "0.0.0" -dependencies = [ - "napi", - "napi-build", - "napi-derive", - "oxc_resolver", -] - -[[package]] -name = "oxc_resolver" -version = "1.8.1" -dependencies = [ - "criterion2", - "dashmap", - "document-features", - "dunce", - "json-strip-comments", - "normalize-path", - "once_cell", - "rayon", - "rustc-hash", - "serde", - "serde_json", - "thiserror", - "tracing", - "typescript_tsconfig_json", - "vfs", -] - -[[package]] -name = "parking_lot_core" -version = "0.9.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall 0.5.1", - "smallvec", - "windows-targets 0.52.5", -] - -[[package]] -name = "pin-project-lite" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" - -[[package]] -name = "proc-macro2" -version = "1.0.85" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22244ce15aa966053a896d1accb3a6e68469b97c7f33f284b99f0d576879fc23" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.36" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "rayon" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" -dependencies = [ - "either", - "rayon-core", -] - -[[package]] -name = "rayon-core" -version = "1.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" -dependencies = [ - "crossbeam-deque", - "crossbeam-utils", -] - -[[package]] -name = "redox_syscall" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" -dependencies = [ - "bitflags 1.3.2", -] - -[[package]] -name = "redox_syscall" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "469052894dcb553421e483e4209ee581a45100d31b4018de03e5a7ad86374a7e" -dependencies = [ - "bitflags 2.5.0", -] - -[[package]] -name = "regex" -version = "1.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" -dependencies = [ - "aho-corasick", - "memchr", - "regex-automata", - "regex-syntax", -] - -[[package]] -name = "regex-automata" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", -] - -[[package]] -name = "regex-syntax" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" - -[[package]] -name = "rustc-hash" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" - -[[package]] -name = "ryu" -version = "1.0.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" - -[[package]] -name = "same-file" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "scopeguard" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" - -[[package]] -name = "semver" -version = "1.0.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" - -[[package]] -name = "serde" -version = "1.0.203" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7253ab4de971e72fb7be983802300c30b5a7f0c2e56fab8abfc6a214307c0094" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.203" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "serde_json" -version = "1.0.117" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3" -dependencies = [ - "indexmap", - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "smallvec" -version = "1.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" - -[[package]] -name = "syn" -version = "2.0.66" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c42f3f41a2de00b01c0aaad383c5a45241efc8b2d1eda5661812fda5f3cdcff5" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "thiserror" -version = "1.0.61" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.61" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "tracing" -version = "0.1.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" -dependencies = [ - "pin-project-lite", - "tracing-attributes", - "tracing-core", -] - -[[package]] -name = "tracing-attributes" -version = "0.1.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "tracing-core" -version = "0.1.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" -dependencies = [ - "once_cell", -] - -[[package]] -name = "typescript_tsconfig_json" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7cc416eaf05297012ead9d192226fe9a92e9a20f64f8780efb9085aaae9b590" -dependencies = [ - "clean-path", - "indexmap", - "rustc-hash", - "serde", - "serde_json", -] - -[[package]] -name = "unicode-ident" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" - -[[package]] -name = "unicode-segmentation" -version = "1.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" - -[[package]] -name = "vfs" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "654cd097e182a71dbf899178e6b5662c2157dd0b8afd5975de18008f6fc173d1" -dependencies = [ - "filetime", -] - -[[package]] -name = "walkdir" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" -dependencies = [ - "same-file", - "winapi-util", -] - -[[package]] -name = "winapi-util" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b" -dependencies = [ - "windows-sys 0.52.0", -] - -[[package]] -name = "windows-sys" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" -dependencies = [ - "windows-targets 0.48.5", -] - -[[package]] -name = "windows-sys" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" -dependencies = [ - "windows-targets 0.52.5", -] - -[[package]] -name = "windows-targets" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" -dependencies = [ - "windows_aarch64_gnullvm 0.48.5", - "windows_aarch64_msvc 0.48.5", - "windows_i686_gnu 0.48.5", - "windows_i686_msvc 0.48.5", - "windows_x86_64_gnu 0.48.5", - "windows_x86_64_gnullvm 0.48.5", - "windows_x86_64_msvc 0.48.5", -] - -[[package]] -name = "windows-targets" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" -dependencies = [ - "windows_aarch64_gnullvm 0.52.5", - "windows_aarch64_msvc 0.52.5", - "windows_i686_gnu 0.52.5", - "windows_i686_gnullvm", - "windows_i686_msvc 0.52.5", - "windows_x86_64_gnu 0.52.5", - "windows_x86_64_gnullvm 0.52.5", - "windows_x86_64_msvc 0.52.5", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" - -[[package]] -name = "windows_i686_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" - -[[package]] -name = "windows_i686_gnu" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" - -[[package]] -name = "windows_i686_gnullvm" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" - -[[package]] -name = "windows_i686_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" - -[[package]] -name = "windows_i686_msvc" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" diff --git a/fixtures/enhanced_resolve/lib/index.js b/fixtures/enhanced_resolve/lib/index.js deleted file mode 100644 index 1e872e8f..00000000 --- a/fixtures/enhanced_resolve/lib/index.js +++ /dev/null @@ -1 +0,0 @@ -// mimic enhanced-resolved root directory structure diff --git a/fixtures/enhanced_resolve/package.json b/fixtures/enhanced_resolve/package.json deleted file mode 100644 index d1b845b5..00000000 --- a/fixtures/enhanced_resolve/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "enhanced-resolve", - "main": "lib/index.js" -} diff --git a/fixtures/enhanced_resolve/test/.gitignore b/fixtures/enhanced_resolve/test/.gitignore deleted file mode 100644 index bbbec5f4..00000000 --- a/fixtures/enhanced_resolve/test/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# created by symlink.rs -/temp diff --git a/fixtures/enhanced_resolve/test/fixtures/#/a.js b/fixtures/enhanced_resolve/test/fixtures/#/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/a.js b/fixtures/enhanced_resolve/test/fixtures/a.js deleted file mode 100644 index 896ffc6d..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/abc.txt b/fixtures/enhanced_resolve/test/fixtures/abc.txt deleted file mode 100644 index f2ba8f84..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/abc.txt +++ /dev/null @@ -1 +0,0 @@ -abc \ No newline at end of file diff --git a/fixtures/enhanced_resolve/test/fixtures/alias/files/a.js b/fixtures/enhanced_resolve/test/fixtures/alias/files/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/b.js b/fixtures/enhanced_resolve/test/fixtures/b.js deleted file mode 100644 index 11476340..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/b.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function b() { - return "This is b"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/browser/module-a.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/browser/module-a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/browser.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/ignore.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/ignore.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/replaced.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/replaced.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/self.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/self.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/toString.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/toString.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-a.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-b.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-c.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-c.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/a.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/b.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/c.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/c.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/d.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/d.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json deleted file mode 100644 index c13fe23b..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "browser": { - "a.js": "./a", - "./b.js": "./b", - "c.js": "./d.js", - "./d.js": "./c.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/package.json b/fixtures/enhanced_resolve/test/fixtures/browser-module/package.json deleted file mode 100644 index 19ff7739..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/browser-module/package.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "exports": { - "./lib/index.js": "./lib/index.js" - }, - "browser": { - "./lib/ignore.js": false, - "./lib/replaced.js": "./lib/browser", - "module-a": "./browser/module-a.js", - "module-b": "module-c", - "module-c": "module-c", - "./toString": "./lib/toString.js", - "./lib/main.js": "./lib/main.js", - "./main.js": "./lib/main.js", - "./lib/xyz.js": "./xyz.js", - "./xyz.js": "./lib/xyz.js", - "./lib/non-existent.js": "./lib/non-existent.js", - ".": false, - "./number": 1, - "./foo": "./lib/replaced.js?query" - }, - "innerBrowser1": { - "field": { - "browser": { - "./lib/main1.js": "./lib/main.js" - } - } - }, - "innerBrowser2": { - "browser": { - "./lib/main2.js": "./lib/replaced.js" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/builtins/package.json b/fixtures/enhanced_resolve/test/fixtures/builtins/package.json deleted file mode 100644 index 4a54ea96..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/builtins/package.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "name": "builtins", - "private": true, - "imports": { - "#fs": { - "default": "fs" - }, - "#http": { - "node": "node:http" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/c.js b/fixtures/enhanced_resolve/test/fixtures/c.js deleted file mode 100644 index e3aca8aa..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/c.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = function b() { - require("./a"); - return "This is c"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/complex.js b/fixtures/enhanced_resolve/test/fixtures/complex.js deleted file mode 100644 index 1f62db84..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/complex.js +++ /dev/null @@ -1,13 +0,0 @@ -var 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); diff --git a/fixtures/enhanced_resolve/test/fixtures/crypto-js/index.js b/fixtures/enhanced_resolve/test/fixtures/crypto-js/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json b/fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json deleted file mode 100644 index 1d31aa8b..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "crypto-js", - "main": "index.js", - "browser": { - "crypto": false - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/decorated-fs/exists.js b/fixtures/enhanced_resolve/test/fixtures/decorated-fs/exists.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/dirOrFile.js b/fixtures/enhanced_resolve/test/fixtures/dirOrFile.js deleted file mode 100644 index c3cb885f..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/dirOrFile.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "file"; diff --git a/fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js b/fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js deleted file mode 100644 index 85e01cd4..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "dir"; diff --git a/fixtures/enhanced_resolve/test/fixtures/directory-default/directory-default.js b/fixtures/enhanced_resolve/test/fixtures/directory-default/directory-default.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js deleted file mode 100644 index d1007aae..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js +++ /dev/null @@ -1 +0,0 @@ -export default "string"; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts deleted file mode 100644 index cb0ff5c3..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json deleted file mode 100644 index b523a1e9..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "@org/pkg", - "exports": { - "./*.js": { - "types": "./dist/*.d.ts", - "default": "./dist/*.js" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js deleted file mode 100644 index d1007aae..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js +++ /dev/null @@ -1 +0,0 @@ -export default "string"; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts deleted file mode 100644 index cb0ff5c3..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json deleted file mode 100644 index 8e55fb46..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "@raviqqe/hidash", - "exports": { - "./*.js": { - "types": "./dist/*.d.ts", - "default": "./dist/*.js" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json deleted file mode 100644 index f0edf449..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "exports-field", - "version": "1.0.0", - "exports": { - ".": "./a/../b/../../pack1/index.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/pack1/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/pack1/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/a.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/a.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json deleted file mode 100644 index 6b105c08..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "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/": { - "webpack": ["./lib/lib2/", "./lib/"], - "node": "./lib/", - "default": "./lib/" - }, - "./dist/a.js": "./../../a.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json deleted file mode 100644 index 0012a3de..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "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" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/umd.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/umd.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field/package.json deleted file mode 100644 index 5fa72bb5..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "@exports-field/core", - "version": "1.0.0", - "exports": "./a.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json deleted file mode 100644 index e6f12074..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "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/lib2/", "./lib/"], - "node": "./lib/", - "default": "./lib/" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/index b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/index deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json deleted file mode 100644 index 1a838f49..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "name": "exports-field", - "exportsField": { - "exports": "./main.js" - }, - "ex": "./index", - "broken": { - ".": "./src" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/src/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/src/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.ts b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.mts b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.mts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mjs b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mjs deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mts.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mts.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.ts b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/app.module.js b/fixtures/enhanced_resolve/test/fixtures/extensions/app.module.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.js b/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/foo.js b/fixtures/enhanced_resolve/test/fixtures/extensions/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/foo.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/foo.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/index.js b/fixtures/enhanced_resolve/test/fixtures/extensions/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/index.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module.js b/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module/index.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/package.json b/fixtures/enhanced_resolve/test/fixtures/extensions/package.json deleted file mode 100644 index 5e55a1e8..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/extensions/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "./index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/file.load1 b/fixtures/enhanced_resolve/test/fixtures/file.load1 deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/file.load2 b/fixtures/enhanced_resolve/test/fixtures/file.load2 deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/foo/index.js b/fixtures/enhanced_resolve/test/fixtures/foo/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/foo/package.json b/fixtures/enhanced_resolve/test/fixtures/foo/package.json deleted file mode 100644 index da86787a..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/foo/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "foo", - "version": "1.0.0" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json deleted file mode 100644 index aa2be496..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "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" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/internal/file.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/internal/file.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/y/y.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/y/y.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/internal/i.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/internal/i.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/nested/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js deleted file mode 100644 index e5b70a86..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = { nested: "nested" } diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-3/nested/f/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-3/nested/f/nested/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-4/f/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-4/f/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f$/$.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f$/$.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f/$.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f/$.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/nested/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/a.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/a.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/b.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/dir/b.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/dir/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/index.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json deleted file mode 100644 index 8d8d3a46..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "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/lib2/", "./lib/"], - "node": "./lib/", - "default": "./lib/" - }, - "./dist/a.js": "./../../a.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/c/index.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/c/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/imports-field/package.json deleted file mode 100644 index 248351a9..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "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" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/a.js b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json deleted file mode 100644 index ded7faa2..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json +++ /dev/null @@ -1,2 +0,0 @@ -{ - "main": "./a.js", diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/a.js b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/package.json b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/package.json deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/issue-238/package.json b/fixtures/enhanced_resolve/test/fixtures/issue-238/package.json deleted file mode 100644 index 352055cd..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/issue-238/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "private": true -} diff --git a/fixtures/enhanced_resolve/test/fixtures/issue-238/src/a/config.js b/fixtures/enhanced_resolve/test/fixtures/issue-238/src/a/config.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/issue-238/src/common/config/myObjectFile.js b/fixtures/enhanced_resolve/test/fixtures/issue-238/src/common/config/myObjectFile.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/lib.js b/fixtures/enhanced_resolve/test/fixtures/lib.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/lib/complex1.js b/fixtures/enhanced_resolve/test/fixtures/lib/complex1.js deleted file mode 100644 index b3de3d70..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/lib/complex1.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "lib complex1"; diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self/index.js b/fixtures/enhanced_resolve/test/fixtures/main-field-self/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json b/fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json deleted file mode 100644 index a2b6f341..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "./" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self2/index.js b/fixtures/enhanced_resolve/test/fixtures/main-field-self2/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json b/fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json deleted file mode 100644 index 4fa6f730..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "." -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main1.js b/fixtures/enhanced_resolve/test/fixtures/main1.js deleted file mode 100644 index 168f2a1e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main1.js +++ /dev/null @@ -1,9 +0,0 @@ -var a = require("./a"); -if (x) { - for (var i = 0; i < 100; i++) { - while (true) require("./b"); - do { - i++; - } while (require("m1/a")()); - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main2.js b/fixtures/enhanced_resolve/test/fixtures/main2.js deleted file mode 100644 index 39f062b1..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main2.js +++ /dev/null @@ -1,12 +0,0 @@ -var 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"); - }); - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main3.js b/fixtures/enhanced_resolve/test/fixtures/main3.js deleted file mode 100644 index 1c180166..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main3.js +++ /dev/null @@ -1,4 +0,0 @@ -var a = require("./a"); -require.ensure([], function(require) { - require("./c.js"); -}); diff --git a/fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js b/fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js deleted file mode 100644 index 997c1051..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is nested m1/a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/no#fragment/#/#.js b/fixtures/enhanced_resolve/test/fixtures/no#fragment/#/#.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/no.js b/fixtures/enhanced_resolve/test/fixtures/no.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/browser.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/browser.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/main.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json deleted file mode 100644 index c469e1fd..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "main": "./main.js", - "browser": "./browser.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js deleted file mode 100644 index 549620a5..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "the correct a.js"; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js deleted file mode 100644 index 5db6632e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = " :) " + require("m2/b.js"); diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js deleted file mode 100644 index d308569d..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require("m1/a") + require("m1"); diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js deleted file mode 100644 index cb8127e8..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "Step2"; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json deleted file mode 100644 index 8d6dfa56..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "dash-name", - "exports": "./index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json deleted file mode 100644 index 4fd8706e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "dash", - "exports": "./index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/invalidPackageJson/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/invalidPackageJson/package.json deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js deleted file mode 100644 index 46fc8e6c..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is m1/a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js deleted file mode 100644 index 8565c244..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is m1/b"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js deleted file mode 100644 index 34faaaf5..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "This is m2/b"; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/file.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/file.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js b/fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js deleted file mode 100644 index 997c1051..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is nested m1/a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/dir/index.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/dir/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/index.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/main.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/browser.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/browser.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/index.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json deleted file mode 100644 index e20ceaeb..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "main": "main.js", - "browser": { - "./package-alias/index.js": "./package-alias/browser.js", - "module": "pkg/dir/index" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/typescript/index.ts b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/typescript/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json deleted file mode 100644 index 4a1f838e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "@exports-field/core", - "version": "1.0.0", - "exports": { - ".": "./a.js", - "./x": "./a.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/prefer-pnp/alternative-modules/m1/b.js b/fixtures/enhanced_resolve/test/fixtures/prefer-pnp/alternative-modules/m1/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.css b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.css deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.js b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json deleted file mode 100644 index 14ab704d..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/index.css b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/index.css deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/module.js b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/module.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json deleted file mode 100644 index ee0eb71b..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "main": "../../../c.js", - "module": "module.js", - "style": "index.css" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/roots_fall_through/index.js b/fixtures/enhanced_resolve/test/fixtures/roots_fall_through/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/main.js b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json deleted file mode 100644 index 70a0f20f..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "browser": { - "./index.js": "./main.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/lib/index.js b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/lib/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/main.js b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json deleted file mode 100644 index 2af9e0d1..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "./main.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/shortcutdir.js/a.js b/fixtures/enhanced_resolve/test/fixtures/shortcutdir.js/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/b b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/b deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/c b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/c deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/a b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/a deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/b b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/b deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/b/foo/a b/fixtures/enhanced_resolve/test/fixtures/yield/b/foo/a deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/a b/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/a deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json b/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json deleted file mode 100644 index 0acc4b4c..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "foo", - "version": "1.0.0", - "browser": { - "./a": false - } -} diff --git "a/fixtures/enhanced_resolve/test/fixtures/\346\265\213\350\257\225.js" "b/fixtures/enhanced_resolve/test/fixtures/\346\265\213\350\257\225.js" deleted file mode 100644 index e69de29b..00000000 diff --git "a/fixtures/misc/\344\270\255\346\226\207/\344\270\255\346\226\207.js" "b/fixtures/misc/\344\270\255\346\226\207/\344\270\255\346\226\207.js" deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/pnpm/.gitignore b/fixtures/pnpm/.gitignore deleted file mode 100644 index 3c3629e6..00000000 --- a/fixtures/pnpm/.gitignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/fixtures/pnpm/package.json b/fixtures/pnpm/package.json deleted file mode 100644 index 78712e2b..00000000 --- a/fixtures/pnpm/package.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "name": "pnpm", - "version": "1.0.0", - "private": true, - "devDependencies": { - "axios": "1.6.2", - "styled-components": "6.1.1", - "postcss": "8.4.33" - } -} diff --git a/fixtures/pnpm/pnpm-lock.yaml b/fixtures/pnpm/pnpm-lock.yaml deleted file mode 100644 index e51dfd6a..00000000 --- a/fixtures/pnpm/pnpm-lock.yaml +++ /dev/null @@ -1,212 +0,0 @@ -lockfileVersion: '6.0' - -settings: - autoInstallPeers: true - excludeLinksFromLockfile: false - -devDependencies: - axios: - specifier: 1.6.2 - version: 1.6.2 - postcss: - specifier: 8.4.33 - version: 8.4.33 - styled-components: - specifier: 6.1.1 - version: 6.1.1(react-dom@18.2.0)(react@18.2.0) - -packages: - - /@emotion/is-prop-valid@1.2.1: - resolution: {integrity: sha512-61Mf7Ufx4aDxx1xlDeOm8aFFigGHE4z+0sKCa+IHCeZKiyP9RLD0Mmx7m8b9/Cf37f7NAvQOOJAbQQGVr5uERw==} - dependencies: - '@emotion/memoize': 0.8.1 - dev: true - - /@emotion/memoize@0.8.1: - resolution: {integrity: sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA==} - dev: true - - /@emotion/unitless@0.8.1: - resolution: {integrity: sha512-KOEGMu6dmJZtpadb476IsZBclKvILjopjUii3V+7MnXIQCYh8W3NgNcgwo21n9LXZX6EDIKvqfjYxXebDwxKmQ==} - dev: true - - /@types/stylis@4.2.4: - resolution: {integrity: sha512-36ZrGJ8fgtBr6nwNnuJ9jXIj+bn/pF6UoqmrQT7+Y99+tFFeHHsoR54+194dHdyhPjgbeoNz3Qru0oRt0l6ASQ==} - dev: true - - /asynckit@0.4.0: - resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} - dev: true - - /axios@1.6.2: - resolution: {integrity: sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A==} - dependencies: - follow-redirects: 1.15.3 - form-data: 4.0.0 - proxy-from-env: 1.1.0 - transitivePeerDependencies: - - debug - dev: true - - /camelize@1.0.1: - resolution: {integrity: sha512-dU+Tx2fsypxTgtLoE36npi3UqcjSSMNYfkqgmoEhtZrraP5VWq0K7FkWVTYa8eMPtnU/G2txVsfdCJTn9uzpuQ==} - dev: true - - /combined-stream@1.0.8: - resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} - engines: {node: '>= 0.8'} - dependencies: - delayed-stream: 1.0.0 - dev: true - - /css-color-keywords@1.0.0: - resolution: {integrity: sha512-FyyrDHZKEjXDpNJYvVsV960FiqQyXc/LlYmsxl2BcdMb2WPx0OGRVgTg55rPSyLSNMqP52R9r8geSp7apN3Ofg==} - engines: {node: '>=4'} - dev: true - - /css-to-react-native@3.2.0: - resolution: {integrity: sha512-e8RKaLXMOFii+02mOlqwjbD00KSEKqblnpO9e++1aXS1fPQOpS1YoqdVHBqPjHNoxeF2mimzVqawm2KCbEdtHQ==} - dependencies: - camelize: 1.0.1 - css-color-keywords: 1.0.0 - postcss-value-parser: 4.2.0 - dev: true - - /csstype@3.1.2: - resolution: {integrity: sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==} - dev: true - - /delayed-stream@1.0.0: - resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} - engines: {node: '>=0.4.0'} - dev: true - - /follow-redirects@1.15.3: - resolution: {integrity: sha512-1VzOtuEM8pC9SFU1E+8KfTjZyMztRsgEfwQl44z8A25uy13jSzTj6dyK2Df52iV0vgHCfBwLhDWevLn95w5v6Q==} - engines: {node: '>=4.0'} - peerDependencies: - debug: '*' - peerDependenciesMeta: - debug: - optional: true - dev: true - - /form-data@4.0.0: - resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==} - engines: {node: '>= 6'} - dependencies: - asynckit: 0.4.0 - combined-stream: 1.0.8 - mime-types: 2.1.35 - dev: true - - /js-tokens@4.0.0: - resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} - dev: true - - /loose-envify@1.4.0: - resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==} - hasBin: true - dependencies: - js-tokens: 4.0.0 - dev: true - - /mime-db@1.52.0: - resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} - engines: {node: '>= 0.6'} - dev: true - - /mime-types@2.1.35: - resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} - engines: {node: '>= 0.6'} - dependencies: - mime-db: 1.52.0 - dev: true - - /nanoid@3.3.7: - resolution: {integrity: sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==} - engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} - hasBin: true - dev: true - - /picocolors@1.0.0: - resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==} - dev: true - - /postcss-value-parser@4.2.0: - resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==} - dev: true - - /postcss@8.4.33: - resolution: {integrity: sha512-Kkpbhhdjw2qQs2O2DGX+8m5OVqEcbB9HRBvuYM9pgrjEFUg30A9LmXNlTAUj4S9kgtGyrMbTzVjH7E+s5Re2yg==} - engines: {node: ^10 || ^12 || >=14} - dependencies: - nanoid: 3.3.7 - picocolors: 1.0.0 - source-map-js: 1.0.2 - dev: true - - /proxy-from-env@1.1.0: - resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==} - dev: true - - /react-dom@18.2.0(react@18.2.0): - resolution: {integrity: sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==} - peerDependencies: - react: ^18.2.0 - dependencies: - loose-envify: 1.4.0 - react: 18.2.0 - scheduler: 0.23.0 - dev: true - - /react@18.2.0: - resolution: {integrity: sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==} - engines: {node: '>=0.10.0'} - dependencies: - loose-envify: 1.4.0 - dev: true - - /scheduler@0.23.0: - resolution: {integrity: sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw==} - dependencies: - loose-envify: 1.4.0 - dev: true - - /shallowequal@1.1.0: - resolution: {integrity: sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ==} - dev: true - - /source-map-js@1.0.2: - resolution: {integrity: sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==} - engines: {node: '>=0.10.0'} - dev: true - - /styled-components@6.1.1(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-cpZZP5RrKRIClBW5Eby4JM1wElLVP4NQrJbJ0h10TidTyJf4SIIwa3zLXOoPb4gJi8MsJ8mjq5mu2IrEhZIAcQ==} - engines: {node: '>= 16'} - peerDependencies: - react: '>= 16.8.0' - react-dom: '>= 16.8.0' - dependencies: - '@emotion/is-prop-valid': 1.2.1 - '@emotion/unitless': 0.8.1 - '@types/stylis': 4.2.4 - css-to-react-native: 3.2.0 - csstype: 3.1.2 - postcss: 8.4.33 - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - shallowequal: 1.1.0 - stylis: 4.3.0 - tslib: 2.6.2 - dev: true - - /stylis@4.3.0: - resolution: {integrity: sha512-E87pIogpwUsUwXw7dNyU4QDjdgVMy52m+XEOPEKUn161cCzWjjhPSQhByfd1CcNvrOLnXQ6OnnZDwnJrz/Z4YQ==} - dev: true - - /tslib@2.6.2: - resolution: {integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==} - dev: true diff --git a/fixtures/tsconfig/cases/builtins/thing.js b/fixtures/tsconfig/cases/builtins/thing.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/builtins/tsconfig.json b/fixtures/tsconfig/cases/builtins/tsconfig.json deleted file mode 100644 index 36aa1a4d..00000000 --- a/fixtures/tsconfig/cases/builtins/tsconfig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compilerOptions": { - "baseUrl": "." - } -} diff --git a/fixtures/tsconfig/cases/exports/index.js b/fixtures/tsconfig/cases/exports/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/exports/tsconfig.json b/fixtures/tsconfig/cases/exports/tsconfig.json deleted file mode 100644 index f0e3159b..00000000 --- a/fixtures/tsconfig/cases/exports/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-exports" -} diff --git a/fixtures/tsconfig/cases/extends-extension/base-tsconfig.json b/fixtures/tsconfig/cases/extends-extension/base-tsconfig.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/cases/extends-extension/base-tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/cases/extends-extension/foo.js b/fixtures/tsconfig/cases/extends-extension/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-extension/tsconfig.json b/fixtures/tsconfig/cases/extends-extension/tsconfig.json deleted file mode 100644 index 0ae4c6a3..00000000 --- a/fixtures/tsconfig/cases/extends-extension/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./base-tsconfig" -} diff --git a/fixtures/tsconfig/cases/extends-extensionless/foo.js b/fixtures/tsconfig/cases/extends-extensionless/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-extensionless/tsconfig.json b/fixtures/tsconfig/cases/extends-extensionless/tsconfig.json deleted file mode 100644 index c36cb7d4..00000000 --- a/fixtures/tsconfig/cases/extends-extensionless/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-field/conf" -} diff --git a/fixtures/tsconfig/cases/extends-multiple/foo.js b/fixtures/tsconfig/cases/extends-multiple/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-multiple/tsconfig.json b/fixtures/tsconfig/cases/extends-multiple/tsconfig.json deleted file mode 100644 index aa2ae783..00000000 --- a/fixtures/tsconfig/cases/extends-multiple/tsconfig.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": ["../extends-extension", "../extends-paths"], - "compilerOptions": { - "baseUrl": ".", - }, -} diff --git a/fixtures/tsconfig/cases/extends-not-found/index.js b/fixtures/tsconfig/cases/extends-not-found/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-not-found/tsconfig.json b/fixtures/tsconfig/cases/extends-not-found/tsconfig.json deleted file mode 100644 index 99df91da..00000000 --- a/fixtures/tsconfig/cases/extends-not-found/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./not-found" -} diff --git a/fixtures/tsconfig/cases/extends-paths/src/index.js b/fixtures/tsconfig/cases/extends-paths/src/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-paths/tsconfig.base.json b/fixtures/tsconfig/cases/extends-paths/tsconfig.base.json deleted file mode 100644 index 5c64b067..00000000 --- a/fixtures/tsconfig/cases/extends-paths/tsconfig.base.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "@/*": ["./*"] - } - } -} diff --git a/fixtures/tsconfig/cases/extends-paths/tsconfig.json b/fixtures/tsconfig/cases/extends-paths/tsconfig.json deleted file mode 100644 index 51086018..00000000 --- a/fixtures/tsconfig/cases/extends-paths/tsconfig.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": "./tsconfig.base.json", - "compilerOptions": { - "baseUrl": "src", - }, -} diff --git a/fixtures/tsconfig/cases/field/index.js b/fixtures/tsconfig/cases/field/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/field/tsconfig.json b/fixtures/tsconfig/cases/field/tsconfig.json deleted file mode 100644 index 9f86c3f4..00000000 --- a/fixtures/tsconfig/cases/field/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-field" -} diff --git a/fixtures/tsconfig/cases/index/index.js b/fixtures/tsconfig/cases/index/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/index/tsconfig.json b/fixtures/tsconfig/cases/index/tsconfig.json deleted file mode 100644 index d20b1774..00000000 --- a/fixtures/tsconfig/cases/index/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-index" -} diff --git a/fixtures/tsconfig/cases/paths_template_variable/foo.js b/fixtures/tsconfig/cases/paths_template_variable/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json b/fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json deleted file mode 100644 index a1a37bb6..00000000 --- a/fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "../../tsconfig_template_variable.json" -} diff --git a/fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json b/fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json deleted file mode 100644 index e7d8e5e5..00000000 --- a/fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "compilerOptions": { - "composite": true, - "paths": { - "foo": ["${configDir}/foo.js"] - } - } -} diff --git a/fixtures/tsconfig/cases/project_references/app/aliased/index.ts b/fixtures/tsconfig/cases/project_references/app/aliased/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/app/index.ts b/fixtures/tsconfig/cases/project_references/app/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/app/tsconfig.json b/fixtures/tsconfig/cases/project_references/app/tsconfig.json deleted file mode 100644 index 7036d2bb..00000000 --- a/fixtures/tsconfig/cases/project_references/app/tsconfig.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "extends": "../tsconfig.base.json", - "compilerOptions": { - "baseUrl": "./", - "paths": { - "@/*": ["./aliased/*"] - } - }, - "references": [ - { - "path": "../project_a/conf.json" - }, - { - "path": "../project_b" - }, - { - "path": "../project_c/tsconfig.json" - }, - { - "path": "../../paths_template_variable/tsconfig2.json" - } - ] -} diff --git a/fixtures/tsconfig/cases/project_references/project_a/aliased/index.ts b/fixtures/tsconfig/cases/project_references/project_a/aliased/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_a/conf.json b/fixtures/tsconfig/cases/project_references/project_a/conf.json deleted file mode 100644 index 4d389d7a..00000000 --- a/fixtures/tsconfig/cases/project_references/project_a/conf.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "compilerOptions": { - "composite": true, - "paths": { - "@/*": ["./aliased/*"] - } - } -} diff --git a/fixtures/tsconfig/cases/project_references/project_a/index.ts b/fixtures/tsconfig/cases/project_references/project_a/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_b/src/aliased/index.ts b/fixtures/tsconfig/cases/project_references/project_b/src/aliased/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_b/tsconfig.json b/fixtures/tsconfig/cases/project_references/project_b/tsconfig.json deleted file mode 100644 index 4ab05cd8..00000000 --- a/fixtures/tsconfig/cases/project_references/project_b/tsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "compilerOptions": { - "composite": true, - "baseUrl": "./src", - "paths": { - "@/*": ["./aliased/*"] - } - } -} diff --git a/fixtures/tsconfig/cases/project_references/project_c/index.ts b/fixtures/tsconfig/cases/project_references/project_c/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_c/tsconfig.json b/fixtures/tsconfig/cases/project_references/project_c/tsconfig.json deleted file mode 100644 index fe520939..00000000 --- a/fixtures/tsconfig/cases/project_references/project_c/tsconfig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compilerOptions": { - "composite": true - } -} diff --git a/fixtures/tsconfig/cases/project_references/tsconfig.base.json b/fixtures/tsconfig/cases/project_references/tsconfig.base.json deleted file mode 100644 index 88ccffe7..00000000 --- a/fixtures/tsconfig/cases/project_references/tsconfig.base.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "compilerOptions": { - } -} diff --git a/fixtures/tsconfig/cases/suffixes/a.ios.ts b/fixtures/tsconfig/cases/suffixes/a.ios.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/a.ts b/fixtures/tsconfig/cases/suffixes/a.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/b.ts b/fixtures/tsconfig/cases/suffixes/b.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/c-test.ts b/fixtures/tsconfig/cases/suffixes/c-test.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/index.ts b/fixtures/tsconfig/cases/suffixes/index.ts deleted file mode 100644 index b09939b9..00000000 --- a/fixtures/tsconfig/cases/suffixes/index.ts +++ /dev/null @@ -1 +0,0 @@ -import './a'; diff --git a/fixtures/tsconfig/cases/suffixes/tsconfig.json b/fixtures/tsconfig/cases/suffixes/tsconfig.json deleted file mode 100644 index 4c2ccc8f..00000000 --- a/fixtures/tsconfig/cases/suffixes/tsconfig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compilerOptions": { - "moduleSuffixes": [".ios", "-test", ""] - } -} diff --git a/fixtures/tsconfig/cases/trailing-comma/bar.js b/fixtures/tsconfig/cases/trailing-comma/bar.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/trailing-comma/index.js b/fixtures/tsconfig/cases/trailing-comma/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/trailing-comma/tsconfig.json b/fixtures/tsconfig/cases/trailing-comma/tsconfig.json deleted file mode 100644 index 6dc20ca5..00000000 --- a/fixtures/tsconfig/cases/trailing-comma/tsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "compilerOptions": { - "paths": { - /* some comment */ - "foo": ["bar.js"], - }, - }, - // another comment -} diff --git a/fixtures/tsconfig/foo.js b/fixtures/tsconfig/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/nested/index.js b/fixtures/tsconfig/nested/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/nested/test.js b/fixtures/tsconfig/nested/test.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/nested/tsconfig.json b/fixtures/tsconfig/nested/tsconfig.json deleted file mode 100644 index 6deb3011..00000000 --- a/fixtures/tsconfig/nested/tsconfig.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "extends": "..", - "compilerOptions": { - "paths": { - "ts-path": ["test.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-exports/conf.json b/fixtures/tsconfig/node_modules/tsconfig-exports/conf.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-exports/conf.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-exports/foo.js b/fixtures/tsconfig/node_modules/tsconfig-exports/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-exports/package.json b/fixtures/tsconfig/node_modules/tsconfig-exports/package.json deleted file mode 100644 index be0ddee6..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-exports/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "tsconfig-exports", - "private": true, - "exports": { - ".": "./conf.json" - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-field/conf.json b/fixtures/tsconfig/node_modules/tsconfig-field/conf.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-field/conf.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-field/foo.js b/fixtures/tsconfig/node_modules/tsconfig-field/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-field/package.json b/fixtures/tsconfig/node_modules/tsconfig-field/package.json deleted file mode 100644 index 7138fdde..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-field/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "tsconfig-field", - "private": true, - "tsconfig": "conf.json" -} \ No newline at end of file diff --git a/fixtures/tsconfig/node_modules/tsconfig-index/foo.js b/fixtures/tsconfig/node_modules/tsconfig-index/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-index/package.json b/fixtures/tsconfig/node_modules/tsconfig-index/package.json deleted file mode 100644 index eb2431e7..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-index/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "tsconfig-index", - "private": true -} \ No newline at end of file diff --git a/fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json b/fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-not-used/foo.js b/fixtures/tsconfig/node_modules/tsconfig-not-used/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json b/fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json deleted file mode 100644 index eb16d127..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "ts-path": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/package.json b/fixtures/tsconfig/package.json deleted file mode 100755 index f48acd1c..00000000 --- a/fixtures/tsconfig/package.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "name": "resolver", - "private": true, - "alias": { - "aliased": "foo", - "aliased-file": "./bar.js", - "something": "./nested/test.js", - "aliasedfolder": "./nested", - "aliasedabsolute": "/nested", - "foo/bar": "./bar.js", - "glob/*/*": "./nested/$2", - "./baz": "./bar.js", - "url": false - }, - "imports": { - "#test": "./bar.js" - }, - "dependencies": { - "foo": "^0.3.4" - }, - "peerDependencies": { - "bar": "*" - } -} diff --git a/fixtures/tsconfig/tsconfig.json b/fixtures/tsconfig/tsconfig.json deleted file mode 100644 index eb16d127..00000000 --- a/fixtures/tsconfig/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "ts-path": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/tsconfig_template_variable.json b/fixtures/tsconfig/tsconfig_template_variable.json deleted file mode 100644 index 6f272344..00000000 --- a/fixtures/tsconfig/tsconfig_template_variable.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["${configDir}/foo.js"] - } - } -} diff --git a/napi/__test__/resolver.spec.mjs b/napi/__test__/resolver.spec.mjs deleted file mode 100644 index ac6ee0ef..00000000 --- a/napi/__test__/resolver.spec.mjs +++ /dev/null @@ -1,260 +0,0 @@ -import { join } from 'node:path' -import { fileURLToPath } from 'node:url' - -import test from 'ava' - -let ResolverFactory - -if (process.env.WASI_TEST) { - const wasi = await import('../resolver.wasi.cjs') - ResolverFactory = wasi.ResolverFactory -} else { - const napi = await import('../index.js') - ResolverFactory = napi.ResolverFactory -} - -const currentDir = join(fileURLToPath(import.meta.url), '..') - -const enhancedResolveRoot = join( - currentDir, - '..', - '..', - 'fixtures', - 'enhanced_resolve', - 'test', - 'fixtures' -) - -// https://github.com/webpack/enhanced-resolve/blob/main/test/resolve.test.js - -for (const [title, context, request, expected] of [ - [ - 'absolute path', - enhancedResolveRoot, - join(enhancedResolveRoot, 'main1.js'), - join(enhancedResolveRoot, 'main1.js'), - ], - [ - 'file with .js', - enhancedResolveRoot, - './main1.js', - join(enhancedResolveRoot, 'main1.js'), - ], - [ - 'file without extension', - enhancedResolveRoot, - './main1', - join(enhancedResolveRoot, 'main1.js'), - ], - [ - 'another file with .js', - enhancedResolveRoot, - './a.js', - join(enhancedResolveRoot, 'a.js'), - ], - [ - 'another file without extension', - enhancedResolveRoot, - './a', - join(enhancedResolveRoot, 'a.js'), - ], - [ - 'file in module with .js', - enhancedResolveRoot, - 'm1/a.js', - join(enhancedResolveRoot, 'node_modules/m1/a.js'), - ], - [ - 'file in module without extension', - enhancedResolveRoot, - 'm1/a', - join(enhancedResolveRoot, 'node_modules/m1/a.js'), - ], - [ - 'another file in module without extension', - enhancedResolveRoot, - 'complexm/step1', - join(enhancedResolveRoot, 'node_modules/complexm/step1.js'), - ], - [ - 'from submodule to file in sibling module', - join(enhancedResolveRoot, 'node_modules/complexm'), - 'm2/b.js', - join(enhancedResolveRoot, 'node_modules/m2/b.js'), - ], - [ - 'from nested directory to overwritten file in module', - join(enhancedResolveRoot, 'multiple_modules'), - 'm1/a.js', - join(enhancedResolveRoot, 'multiple_modules/node_modules/m1/a.js'), - ], - [ - 'from nested directory to not overwritten file in module', - join(enhancedResolveRoot, 'multiple_modules'), - 'm1/b.js', - join(enhancedResolveRoot, 'node_modules/m1/b.js'), - ], - [ - 'file with query', - enhancedResolveRoot, - './main1.js?query', - join(enhancedResolveRoot, 'main1.js?query'), - ], - [ - 'file with fragment', - enhancedResolveRoot, - './main1.js#fragment', - join(enhancedResolveRoot, 'main1.js#fragment'), - ], - [ - 'file with fragment and query', - enhancedResolveRoot, - './main1.js#fragment?query', - join(enhancedResolveRoot, 'main1.js#fragment?query'), - ], - [ - 'file with query and fragment', - enhancedResolveRoot, - './main1.js?#fragment', - join(enhancedResolveRoot, 'main1.js?#fragment'), - ], - - [ - 'file with query (unicode)', - enhancedResolveRoot, - './测试.js?query', - join(enhancedResolveRoot, '测试.js?query'), - ], - [ - 'file with fragment (unicode)', - enhancedResolveRoot, - './测试.js#fragment', - join(enhancedResolveRoot, '测试.js#fragment'), - ], - [ - 'file with fragment and query (unicode)', - enhancedResolveRoot, - './测试.js#fragment?query', - join(enhancedResolveRoot, '测试.js#fragment?query'), - ], - [ - 'file with query and fragment (unicode)', - enhancedResolveRoot, - './测试.js?#fragment', - join(enhancedResolveRoot, '测试.js?#fragment'), - ], - - [ - 'file in module with query', - enhancedResolveRoot, - 'm1/a?query', - join(enhancedResolveRoot, 'node_modules/m1/a.js?query'), - ], - [ - 'file in module with fragment', - enhancedResolveRoot, - 'm1/a#fragment', - join(enhancedResolveRoot, 'node_modules/m1/a.js#fragment'), - ], - [ - 'file in module with fragment and query', - enhancedResolveRoot, - 'm1/a#fragment?query', - join(enhancedResolveRoot, 'node_modules/m1/a.js#fragment?query'), - ], - [ - 'file in module with query and fragment', - enhancedResolveRoot, - 'm1/a?#fragment', - join(enhancedResolveRoot, 'node_modules/m1/a.js?#fragment'), - ], - [ - 'differ between directory and file, resolve file', - enhancedResolveRoot, - './dirOrFile', - join(enhancedResolveRoot, 'dirOrFile.js'), - ], - [ - 'differ between directory and file, resolve directory', - enhancedResolveRoot, - './dirOrFile/', - join(enhancedResolveRoot, 'dirOrFile/index.js'), - ], - [ - 'find node_modules outside of node_modules', - join(enhancedResolveRoot, 'browser-module/node_modules'), - 'm1/a', - join(enhancedResolveRoot, 'node_modules/m1/a.js'), - ], - [ - "don't crash on main field pointing to self", - enhancedResolveRoot, - './main-field-self', - join(enhancedResolveRoot, './main-field-self/index.js'), - ], - [ - "don't crash on main field pointing to self (2)", - enhancedResolveRoot, - './main-field-self2', - join(enhancedResolveRoot, './main-field-self2/index.js'), - ], - // enhanced-resolve has `#` prepended with a `\0`, they are removed from the - // following 3 expected test results. - // See https://github.com/webpack/enhanced-resolve#escaping - [ - 'handle fragment edge case (no fragment)', - enhancedResolveRoot, - './no#fragment/#/#', - join(enhancedResolveRoot, 'no#fragment', '#', '#.js'), - ], - [ - 'handle fragment edge case (fragment)', - enhancedResolveRoot, - './no#fragment/#/', - join(enhancedResolveRoot, 'no.js#fragment') + '/#/', - ], - [ - 'handle fragment escaping', - enhancedResolveRoot, - './no\0#fragment/\0#/\0##fragment', - join(enhancedResolveRoot, 'no#fragment', '#', '#.js#fragment'), - ], -]) { - test(title, (t) => { - const resolver = new ResolverFactory({ - modules: ['src/a', 'src/b', 'src/common', 'node_modules'], - extensions: ['.js', '.jsx', '.ts', '.tsx'], - }) - - t.is(resolver.sync(context, request).path, expected) - }) -} - -test('resolve pnpm package', (t) => { - const rootDir = join(currentDir, '..', '..'); - const pnpmProjectPath = join(rootDir, 'fixtures', 'pnpm') - const resolver = new ResolverFactory({ - aliasFields: ['browser'], - }) - t.deepEqual(resolver.sync(pnpmProjectPath, 'styled-components'), { - path: join( - rootDir, - 'node_modules/.pnpm/styled-components@6.1.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/styled-components/dist/styled-components.browser.cjs.js' - ), - }) - t.deepEqual( - resolver.sync( - join( - rootDir, - 'node_modules/.pnpm/styled-components@6.1.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/styled-components' - ), - 'react' - ), - { - path: join( - rootDir, - 'node_modules/.pnpm/react@18.3.1/node_modules/react/index.js' - ), - } - ) -}) diff --git a/napi/src/lib.rs b/napi/src/lib.rs deleted file mode 100644 index 238f99c4..00000000 --- a/napi/src/lib.rs +++ /dev/null @@ -1,166 +0,0 @@ -extern crate napi; -extern crate napi_derive; -extern crate oxc_resolver; - -use std::path::{Path, PathBuf}; - -use napi_derive::napi; -use oxc_resolver::{ResolveOptions, Resolver}; - -use self::options::{NapiResolveOptions, StrOrStrList}; - -mod options; - -#[napi(object)] -pub struct ResolveResult { - pub path: Option, - pub error: Option, -} - -fn resolve(resolver: &Resolver, path: &Path, request: &str) -> ResolveResult { - match resolver.resolve(path, request) { - Ok(resolution) => ResolveResult { - path: Some(resolution.full_path().to_string_lossy().to_string()), - error: None, - }, - Err(err) => ResolveResult { path: None, error: Some(err.to_string()) }, - } -} - -#[allow(clippy::needless_pass_by_value)] -#[napi] -pub fn sync(path: String, request: String) -> ResolveResult { - let path = PathBuf::from(path); - let resolver = Resolver::new(ResolveOptions::default()); - resolve(&resolver, &path, &request) -} - -#[napi] -pub struct ResolverFactory { - resolver: Resolver, -} - -#[napi] -impl ResolverFactory { - #[napi(constructor)] - pub fn new(options: NapiResolveOptions) -> Self { - Self { resolver: Resolver::new(Self::normalize_options(options)) } - } - - #[napi] - pub fn default() -> Self { - let default_options = ResolveOptions::default(); - Self { resolver: Resolver::new(default_options) } - } - - /// Clone the resolver using the same underlying cache. - #[napi] - pub fn clone_with_options(&self, options: NapiResolveOptions) -> Self { - Self { resolver: self.resolver.clone_with_options(Self::normalize_options(options)) } - } - - /// Clear the underlying cache. - #[napi] - pub fn clear_cache(&self) { - self.resolver.clear_cache(); - } - - #[allow(clippy::needless_pass_by_value)] - #[napi] - pub fn sync(&self, path: String, request: String) -> ResolveResult { - let path = PathBuf::from(path); - resolve(&self.resolver, &path, &request) - } - - fn normalize_options(op: NapiResolveOptions) -> ResolveOptions { - let default = ResolveOptions::default(); - // merging options - ResolveOptions { - tsconfig: op.tsconfig.map(|tsconfig| tsconfig.into()), - alias: op - .alias - .map(|alias| { - alias - .into_iter() - .map(|(k, v)| { - let v = v - .into_iter() - .map(|item| match item { - Some(path) => oxc_resolver::AliasValue::from(path), - None => oxc_resolver::AliasValue::Ignore, - }) - .collect(); - (k, v) - }) - .collect::>() - }) - .unwrap_or(default.alias), - alias_fields: op - .alias_fields - .map(|o| o.into_iter().map(|x| StrOrStrList(x).into()).collect::>()) - .unwrap_or(default.alias_fields), - condition_names: op.condition_names.unwrap_or(default.condition_names), - description_files: op.description_files.unwrap_or(default.description_files), - enforce_extension: op - .enforce_extension - .map(|enforce_extension| enforce_extension.into()) - .unwrap_or(default.enforce_extension), - exports_fields: op - .exports_fields - .map(|o| o.into_iter().map(|x| StrOrStrList(x).into()).collect::>()) - .unwrap_or(default.exports_fields), - imports_fields: op - .imports_fields - .map(|o| o.into_iter().map(|x| StrOrStrList(x).into()).collect::>()) - .unwrap_or(default.imports_fields), - extension_alias: op - .extension_alias - .map(|extension_alias| extension_alias.into_iter().collect::>()) - .unwrap_or(default.extension_alias), - extensions: op.extensions.unwrap_or(default.extensions), - fallback: op - .fallback - .map(|fallback| { - fallback - .into_iter() - .map(|(k, v)| { - let v = v - .into_iter() - .map(|item| match item { - Some(path) => oxc_resolver::AliasValue::from(path), - None => oxc_resolver::AliasValue::Ignore, - }) - .collect(); - (k, v) - }) - .collect::>() - }) - .unwrap_or(default.fallback), - fully_specified: op.fully_specified.unwrap_or(default.fully_specified), - main_fields: op - .main_fields - .map(|o| StrOrStrList(o).into()) - .unwrap_or(default.main_fields), - main_files: op.main_files.unwrap_or(default.main_files), - modules: op.modules.map(|o| StrOrStrList(o).into()).unwrap_or(default.modules), - resolve_to_context: op.resolve_to_context.unwrap_or(default.resolve_to_context), - prefer_relative: op.prefer_relative.unwrap_or(default.prefer_relative), - prefer_absolute: op.prefer_absolute.unwrap_or(default.prefer_absolute), - restrictions: op - .restrictions - .map(|restrictions| { - restrictions - .into_iter() - .map(|restriction| restriction.into()) - .collect::>() - }) - .unwrap_or(default.restrictions), - roots: op - .roots - .map(|roots| roots.into_iter().map(PathBuf::from).collect::>()) - .unwrap_or(default.roots), - symlinks: op.symlinks.unwrap_or(default.symlinks), - builtin_modules: op.builtin_modules.unwrap_or(default.builtin_modules), - } - } -} diff --git a/napi/src/options.rs b/napi/src/options.rs deleted file mode 100644 index ea35672f..00000000 --- a/napi/src/options.rs +++ /dev/null @@ -1,261 +0,0 @@ -use std::path::PathBuf; - -use napi::Either; -use napi_derive::napi; -use std::collections::HashMap; - -/// Module Resolution Options -/// -/// Options are directly ported from [enhanced-resolve](https://github.com/webpack/enhanced-resolve#resolver-options). -/// -/// See [webpack resolve](https://webpack.js.org/configuration/resolve/) for information and examples -#[derive(Debug, Clone)] -#[napi(object)] -pub struct NapiResolveOptions { - /// Path to TypeScript configuration file. - /// - /// Default `None` - pub tsconfig: Option, - - /// Alias for [ResolveOptions::alias] and [ResolveOptions::fallback]. - /// - /// For the second value of the tuple, `None -> AliasValue::Ignore`, Some(String) -> - /// AliasValue::Path(String)` - /// Create aliases to import or require certain modules more easily. - /// A trailing $ can also be added to the given object's keys to signify an exact match. - pub alias: Option>>>, - - /// A list of alias fields in description files. - /// Specify a field, such as `browser`, to be parsed according to [this specification](https://github.com/defunctzombie/package-browser-field-spec). - /// Can be a path to json object such as `["path", "to", "exports"]`. - /// - /// Default `[]` - #[napi(ts_type = "(string | string[])[]")] - pub alias_fields: Option>, - - /// Condition names for exports field which defines entry points of a package. - /// The key order in the exports field is significant. During condition matching, earlier entries have higher priority and take precedence over later entries. - /// - /// Default `[]` - pub condition_names: Option>, - - /// The JSON files to use for descriptions. (There was once a `bower.json`.) - /// - /// Default `["package.json"]` - pub description_files: Option>, - - /// If true, it will not allow extension-less files. - /// So by default `require('./foo')` works if `./foo` has a `.js` extension, - /// but with this enabled only `require('./foo.js')` will work. - /// - /// Default to `true` when [ResolveOptions::extensions] contains an empty string. - /// Use `Some(false)` to disable the behavior. - /// See - /// - /// Default None, which is the same as `Some(false)` when the above empty rule is not applied. - pub enforce_extension: Option, - - /// A list of exports fields in description files. - /// Can be a path to json object such as `["path", "to", "exports"]`. - /// - /// Default `[["exports"]]`. - #[napi(ts_type = "(string | string[])[]")] - pub exports_fields: Option>, - - /// Fields from `package.json` which are used to provide the internal requests of a package - /// (requests starting with # are considered internal). - /// - /// Can be a path to a JSON object such as `["path", "to", "imports"]`. - /// - /// Default `[["imports"]]`. - #[napi(ts_type = "(string | string[])[]")] - pub imports_fields: Option>, - - /// An object which maps extension to extension aliases. - /// - /// Default `{}` - pub extension_alias: Option>>, - - /// Attempt to resolve these extensions in order. - /// If multiple files share the same name but have different extensions, - /// will resolve the one with the extension listed first in the array and skip the rest. - /// - /// Default `[".js", ".json", ".node"]` - pub extensions: Option>, - - /// Redirect module requests when normal resolving fails. - /// - /// Default `[]` - pub fallback: Option>>>, - - /// 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). - /// - /// See also webpack configuration [resolve.fullySpecified](https://webpack.js.org/configuration/module/#resolvefullyspecified) - /// - /// Default `false` - pub fully_specified: Option, - - /// A list of main fields in description files - /// - /// Default `["main"]`. - #[napi(ts_type = "string | string[]")] - pub main_fields: Option, - - /// The filename to be used while resolving directories. - /// - /// Default `["index"]` - pub main_files: Option>, - - /// A list of directories to resolve modules from, can be absolute path or folder name. - /// - /// Default `["node_modules"]` - #[napi(ts_type = "string | string[]")] - pub modules: Option, - - /// Resolve to a context instead of a file. - /// - /// Default `false` - pub resolve_to_context: Option, - - /// Prefer to resolve module requests as relative requests instead of using modules from node_modules directories. - /// - /// Default `false` - pub prefer_relative: Option, - - /// Prefer to resolve server-relative urls as absolute paths before falling back to resolve in ResolveOptions::roots. - /// - /// Default `false` - pub prefer_absolute: Option, - - /// A list of resolve restrictions to restrict the paths that a request can be resolved on. - /// - /// Default `[]` - pub restrictions: Option>, - - /// A list of directories where requests of server-relative URLs (starting with '/') are resolved. - /// On non-Windows systems these requests are resolved as an absolute path first. - /// - /// Default `[]` - pub roots: Option>, - - /// Whether to resolve symlinks to their symlinked location. - /// When enabled, symlinked resources are resolved to their real path, not their symlinked location. - /// Note that this may cause module resolution to fail when using tools that symlink packages (like npm link). - /// - /// Default `true` - pub symlinks: Option, - - /// Whether to parse [module.builtinModules](https://nodejs.org/api/module.html#modulebuiltinmodules) or not. - /// For example, "zlib" will throw [crate::ResolveError::Builtin] when set to true. - /// - /// Default `false` - pub builtin_modules: Option, -} - -#[napi] -#[derive(Debug, PartialEq, Eq)] -pub enum EnforceExtension { - Auto, - Enabled, - Disabled, -} - -impl EnforceExtension { - pub fn is_auto(&self) -> bool { - *self == Self::Auto - } - - pub fn is_enabled(&self) -> bool { - *self == Self::Enabled - } - - pub fn is_disabled(&self) -> bool { - *self == Self::Disabled - } -} - -/// Alias Value for [ResolveOptions::alias] and [ResolveOptions::fallback]. -/// Use struct because napi don't support structured union now -#[napi(object)] -#[derive(Debug, Clone)] -pub struct Restriction { - pub path: Option, - pub regex: Option, -} - -/// Tsconfig Options -/// -/// Derived from [tsconfig-paths-webpack-plugin](https://github.com/dividab/tsconfig-paths-webpack-plugin#options) -#[napi(object)] -#[derive(Debug, Clone)] -pub struct TsconfigOptions { - /// Allows you to specify where to find the TypeScript configuration file. - /// You may provide - /// * a relative path to the configuration file. It will be resolved relative to cwd. - /// * an absolute path to the configuration file. - pub config_file: String, - - /// Support for Typescript Project References. - /// - /// * `'auto'`: use the `references` field from tsconfig of `config_file`. - /// * `string[]`: manually provided relative or absolute path. - #[napi(ts_type = "'auto' | string[]")] - pub references: Option>>, -} - -impl Into for Restriction { - fn into(self) -> oxc_resolver::Restriction { - match (self.path, self.regex) { - (None, None) => { - panic!("Should specify path or regex") - } - (None, Some(regex)) => oxc_resolver::Restriction::RegExp(regex), - (Some(path), None) => oxc_resolver::Restriction::Path(PathBuf::from(path)), - (Some(_), Some(_)) => { - panic!("Restriction can't be path and regex at the same time") - } - } - } -} - -impl Into for EnforceExtension { - fn into(self) -> oxc_resolver::EnforceExtension { - match self { - EnforceExtension::Auto => oxc_resolver::EnforceExtension::Auto, - EnforceExtension::Enabled => oxc_resolver::EnforceExtension::Enabled, - EnforceExtension::Disabled => oxc_resolver::EnforceExtension::Disabled, - } - } -} - -impl Into for TsconfigOptions { - fn into(self) -> oxc_resolver::TsconfigOptions { - oxc_resolver::TsconfigOptions { - config_file: PathBuf::from(self.config_file), - references: match self.references { - Some(Either::A(string)) if string.as_str() == "auto" => { - oxc_resolver::TsconfigReferences::Auto - } - Some(Either::A(opt)) => { - panic!("`{}` is not a valid option for tsconfig references", opt) - } - Some(Either::B(paths)) => oxc_resolver::TsconfigReferences::Paths( - paths.into_iter().map(PathBuf::from).collect::>(), - ), - None => oxc_resolver::TsconfigReferences::Disabled, - }, - } - } -} - -type StrOrStrListType = Either>; -pub struct StrOrStrList(pub StrOrStrListType); - -impl Into> for StrOrStrList { - fn into(self) -> Vec { - match self { - StrOrStrList(Either::A(s)) => Vec::from([s]), - StrOrStrList(Either::B(a)) => a, - } - } -} diff --git a/napi/tests/options.test.mjs b/napi/tests/options.test.mjs deleted file mode 100644 index 4a93efff..00000000 --- a/napi/tests/options.test.mjs +++ /dev/null @@ -1,59 +0,0 @@ -import { describe, it } from "node:test"; -import { ResolverFactory } from "../index.js"; -import * as assert from "node:assert"; -import * as path from "node:path"; - -const fixtureDir = new URL( - "../../fixtures/enhanced_resolve/test/fixtures", - import.meta.url -).pathname; - -describe("option", () => { - describe("aliasFields", () => { - it("should allow field string ", () => { - const resolver = new ResolverFactory({ aliasFields: ["browser"] }); - assert.match( - resolver.sync(fixtureDir, "./browser-module/lib/replaced.js").path, - /browser-module\/lib\/browser\.js$/ - ); - }); - it("should allow json path array", () => { - const resolver = new ResolverFactory({ - aliasFields: [["innerBrowser1", "field", "browser"]], - }); - - assert.match( - resolver.sync(fixtureDir, "./browser-module/lib/main1.js").path, - /browser-module\/lib\/main\.js$/ - ); - }); - }); - - describe("exportsFields", () => { - const createTest = (exportsFields) => { - const resolver = new ResolverFactory({ exportsFields }); - assert.match( - resolver.sync( - path.resolve(fixtureDir, "./exports-field3"), - "exports-field" - ).path, - /\/exports-field\/src\/index\.js$/ - ); - }; - it("should allow string as field item", createTest(["broken"])); - it("should allow json path array as field item", createTest([["broken"]])); - }); - - describe("mainFields", () => { - const createTest = (mainFields) => { - const resolver = new ResolverFactory({ mainFields }); - assert.match( - resolver.sync(fixtureDir, "../..").path, - /\/lib\/index\.js$/ - ); - }; - it("should use `'main'` as default", createTest(undefined)); - it("should allow field string", createTest("main")); - it("should allow field array", createTest(["main"])); - }); -}); diff --git a/npm/package.json b/npm/package.json index 6fa93185..b47e6b07 100644 --- a/npm/package.json +++ b/npm/package.json @@ -1,41 +1,30 @@ { - "name": "oxc-resolver", - "version": "1.8.1", - "description": "Oxc Resolver Node API", - "main": "index.js", - "browser": "browser.js", - "files": [ - "index.d.ts", - "index.js", - "browser.js" - ], - "license": "MIT", - "homepage": "https://oxc-project.github.io", - "repository": { - "type": "git", - "url": "git+https://github.com/oxc-project/oxc-resolver.git" - }, - "publishConfig": { - "registry": "https://registry.npmjs.org/", - "access": "public" - }, - "napi": { - "binaryName": "resolver", - "packageName": "@oxc-resolver/binding", - "targets": [ - "x86_64-pc-windows-msvc", - "aarch64-pc-windows-msvc", - "x86_64-unknown-linux-gnu", - "x86_64-unknown-linux-musl", - "aarch64-unknown-linux-gnu", - "aarch64-unknown-linux-musl", - "armv7-unknown-linux-gnueabihf", - "x86_64-apple-darwin", - "aarch64-apple-darwin", - "wasm32-wasip1-threads" - ] - }, - "funding": { - "url": "https://github.com/sponsors/Boshen" - } + "name": "oxc-resolver", + "description": "Oxc Resolver Node API", + "funding": { + "url": "https://github.com/sponsors/Boshen" + }, + "main": "index.js", + "browser": "browser.js", + "files": [ + "index.d.ts", + "index.js", + "browser.js" + ], + "napi": { + "binaryName": "resolver", + "packageName": "@oxc-resolver/binding", + "targets": [ + "x86_64-pc-windows-msvc", + "aarch64-pc-windows-msvc", + "x86_64-unknown-linux-gnu", + "x86_64-unknown-linux-musl", + "aarch64-unknown-linux-gnu", + "aarch64-unknown-linux-musl", + "armv7-unknown-linux-gnueabihf", + "x86_64-apple-darwin", + "aarch64-apple-darwin", + "wasm32-wasip1-threads" + ] + } } diff --git a/package.json b/package.json index 51cb822a..a431e48f 100644 --- a/package.json +++ b/package.json @@ -1,33 +1,24 @@ { - "name": "@oxc-resolver/binding", - "private": true, - "version": "0.0.0", - "scripts": { - "build": "napi build --platform --release --package-json-path npm/package.json --manifest-path napi/Cargo.toml", - "build:debug": "napi build --platform --package-json-path npm/package.json --manifest-path napi/Cargo.toml", - "prepublishOnly": "napi pre-publish -t npm", - "test": "ava" - }, - "devDependencies": { - "@napi-rs/cli": "^3.0.0-alpha.43", - "@napi-rs/wasm-runtime": "^0.2.0", - "@types/node": "^20.10.4", - "ava": "^6.0.1", - "emnapi": "^1.0.0", - "typescript": "^5.3.3" - }, - "ava": { - "files": [ - "napi/__test__/*.spec.mjs" - ], - "cache": false - }, - "packageManager": "pnpm@9.4.0", - "repository": { - "type": "git", - "url": "git+https://github.com/oxc-project/oxc-resolver.git" - }, - "funding": { - "url": "https://github.com/sponsors/Boshen" - } + "name": "@oxc-resolver/binding", + "funding": { + "url": "https://github.com/sponsors/Boshen" + }, + "scripts": { + "build": "napi build --platform --release --package-json-path npm/package.json --manifest-path napi/Cargo.toml", + "build:debug": "napi build --platform --package-json-path npm/package.json --manifest-path napi/Cargo.toml", + "prepublishOnly": "napi pre-publish -t npm" + }, + "ava": { + "cache": false, + "files": [ + "napi/__test__/*.spec.mjs" + ] + }, + "devDependencies": { + "@napi-rs/cli": "^3.0.0-alpha.43", + "@napi-rs/wasm-runtime": "^0.2.0", + "@types/node": "^20.10.4", + "ava": "^6.0.1", + "emnapi": "^1.0.0" + } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml deleted file mode 100644 index 162a4b3c..00000000 --- a/pnpm-lock.yaml +++ /dev/null @@ -1,2690 +0,0 @@ -lockfileVersion: '9.0' - -settings: - autoInstallPeers: true - excludeLinksFromLockfile: false - -importers: - - .: - devDependencies: - '@napi-rs/cli': - specifier: ^3.0.0-alpha.43 - version: 3.0.0-alpha.55(@emnapi/runtime@1.2.0)(emnapi@1.2.0) - '@napi-rs/wasm-runtime': - specifier: ^0.2.0 - version: 0.2.4 - '@types/node': - specifier: ^20.10.4 - version: 20.14.8 - ava: - specifier: ^6.0.1 - version: 6.1.3 - emnapi: - specifier: ^1.0.0 - version: 1.2.0 - typescript: - specifier: ^5.3.3 - version: 5.5.2 - - fixtures/pnpm: - devDependencies: - axios: - specifier: 1.6.2 - version: 1.6.2 - postcss: - specifier: 8.4.33 - version: 8.4.33 - styled-components: - specifier: 6.1.1 - version: 6.1.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - - npm: {} - -packages: - - '@emnapi/core@1.2.0': - resolution: {integrity: sha512-E7Vgw78I93we4ZWdYCb4DGAwRROGkMIXk7/y87UmANR+J6qsWusmC3gLt0H+O0KOt5e6O38U8oJamgbudrES/w==} - - '@emnapi/runtime@1.2.0': - resolution: {integrity: sha512-bV21/9LQmcQeCPEg3BDFtvwL6cwiTMksYNWQQ4KOxCZikEGalWtenoZ0wCiukJINlGCIi2KXx01g4FoH/LxpzQ==} - - '@emnapi/wasi-threads@1.0.1': - resolution: {integrity: sha512-iIBu7mwkq4UQGeMEM8bLwNK962nXdhodeScX4slfQnRhEMMzvYivHhutCIk8uojvmASXXPC2WNEjwxFWk72Oqw==} - - '@emotion/is-prop-valid@1.2.2': - resolution: {integrity: sha512-uNsoYd37AFmaCdXlg6EYD1KaPOaRWRByMCYzbKUX4+hhMfrxdVSelShywL4JVaAeM/eHUOSprYBQls+/neX3pw==} - - '@emotion/memoize@0.8.1': - resolution: {integrity: sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA==} - - '@emotion/unitless@0.8.1': - resolution: {integrity: sha512-KOEGMu6dmJZtpadb476IsZBclKvILjopjUii3V+7MnXIQCYh8W3NgNcgwo21n9LXZX6EDIKvqfjYxXebDwxKmQ==} - - '@inquirer/figures@1.0.3': - resolution: {integrity: sha512-ErXXzENMH5pJt5/ssXV0DfWUZqly8nGzf0UcBV9xTnP+KyffE2mqyxIMBrZ8ijQck2nU0TQm40EQB53YreyWHw==} - engines: {node: '>=18'} - - '@ljharb/through@2.3.13': - resolution: {integrity: sha512-/gKJun8NNiWGZJkGzI/Ragc53cOdcLNdzjLaIa+GEjguQs0ulsurx8WN0jijdK9yPqDvziX995sMRLyLt1uZMQ==} - engines: {node: '>= 0.4'} - - '@mapbox/node-pre-gyp@1.0.11': - resolution: {integrity: sha512-Yhlar6v9WQgUp/He7BdgzOz8lqMQ8sU+jkCq7Wx8Myc5YFJLbEe7lgui/V7G1qB1DJykHSGwreceSaD60Y0PUQ==} - hasBin: true - - '@napi-rs/cli@3.0.0-alpha.55': - resolution: {integrity: sha512-6XgBBTX8O28W5gcSzqYkI72UVJV6Y2YcyQNrEqak39JavJRLlXCv09uLF97raynXAOO50KeP6DEXFy5P8MR2sw==} - engines: {node: '>= 16'} - hasBin: true - peerDependencies: - '@emnapi/runtime': ^1.1.0 - emnapi: ^1.1.0 - peerDependenciesMeta: - '@emnapi/runtime': - optional: true - emnapi: - optional: true - - '@napi-rs/cross-toolchain@0.0.16': - resolution: {integrity: sha512-jwdjHT5L0m9MH0CmzDwPp0ckn/UO7afHCsPeo7NugHUvYgvlgS7SWhdMVgIgJW2HHqhcW/2nhaLLGpAU1c7QRQ==} - peerDependencies: - '@napi-rs/cross-toolchain-arm64-target-aarch64': ^0.0.16 - '@napi-rs/cross-toolchain-arm64-target-armv7': ^0.0.16 - '@napi-rs/cross-toolchain-arm64-target-x86_64': ^0.0.16 - '@napi-rs/cross-toolchain-x64-target-aarch64': ^0.0.16 - '@napi-rs/cross-toolchain-x64-target-armv7': ^0.0.16 - '@napi-rs/cross-toolchain-x64-target-x86_64': ^0.0.16 - peerDependenciesMeta: - '@napi-rs/cross-toolchain-arm64-target-aarch64': - optional: true - '@napi-rs/cross-toolchain-arm64-target-armv7': - optional: true - '@napi-rs/cross-toolchain-arm64-target-x86_64': - optional: true - '@napi-rs/cross-toolchain-x64-target-aarch64': - optional: true - '@napi-rs/cross-toolchain-x64-target-armv7': - optional: true - '@napi-rs/cross-toolchain-x64-target-x86_64': - optional: true - - '@napi-rs/lzma-android-arm-eabi@1.3.1': - resolution: {integrity: sha512-mtGOg8jXlc+pTBI86cqohfndS9UmOAkk9d5CChKMb8btVks70yhUN1e7YYS3QFbmoxbPs2Ee+wmuH1Khdc7B2w==} - engines: {node: '>= 10'} - cpu: [arm] - os: [android] - - '@napi-rs/lzma-android-arm64@1.3.1': - resolution: {integrity: sha512-4uGkQgAv9Tnc/i0k2eIgbhZgyzs94+iECWxz4MFZNcZ1fNGvGbRL2j+SITE4OmwrUn3TuFK/uYWfgzooq8E1Qg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [android] - - '@napi-rs/lzma-darwin-arm64@1.3.1': - resolution: {integrity: sha512-MZBg4iwHTS8icjTiCMdzh8kYrMmKBCEglFPa+vjI91R2XDwuuwSzqmpATRpmMH8cWUUWtGPF4fnxKzjgkzhd4Q==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [darwin] - - '@napi-rs/lzma-darwin-x64@1.3.1': - resolution: {integrity: sha512-7vte+1lYV7xgZERKH/pjAeh4T16aQASKOzu4op70pK6VP/64Plr5rrvqxQqQmlAIe4pwyo/RkFl1n4LXDod3xg==} - engines: {node: '>= 10'} - cpu: [x64] - os: [darwin] - - '@napi-rs/lzma-freebsd-x64@1.3.1': - resolution: {integrity: sha512-uBS74fynTqLUC3catIxyezCafn8UDlr2yxVV47vz1T6Vop2PGDz/cMQdV6rnLSjPE08Rv66ihM36mgf/MmOkOg==} - engines: {node: '>= 10'} - cpu: [x64] - os: [freebsd] - - '@napi-rs/lzma-linux-arm-gnueabihf@1.3.1': - resolution: {integrity: sha512-rrVLyqBJeN29gPJCNkPbZ7dAzaseEcERKyhjwM+DfbFrDUvtkEcrYPvo+iwE/NmF+OkZQkzcanrVMGnq/mcJYQ==} - engines: {node: '>= 10'} - cpu: [arm] - os: [linux] - - '@napi-rs/lzma-linux-arm64-gnu@1.3.1': - resolution: {integrity: sha512-vDmVsthRbX2opkgRirJJGKQxUP/spvyVM2Y5CyCWZ7sadSID3hA97r38gf9ISn/sJ8/r93IPWLq+iycudNKi+Q==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/lzma-linux-arm64-musl@1.3.1': - resolution: {integrity: sha512-x4m/J3hRdFd3IoqKc+4aBcSUkcuDEP7hH6vdss8bKNLjPfXmnG/lcHJEQX3hNnNOULPP8xVRxgiY8jeL62cnsw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/lzma-linux-x64-gnu@1.3.1': - resolution: {integrity: sha512-riB+Xg72NfH8Kcpq07omshVu0QsLW0v2bhywBNYxvA+t2dGGWSIEN1U/zazUXys+IEA6pBQKqLVseurWE6Cl8g==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/lzma-linux-x64-musl@1.3.1': - resolution: {integrity: sha512-JXLgJFwoeysxdSg7rdVYP8wrliCQVJlU5JcLYjRVSCL4P0mQTjnYi7R7VdaOkDACw/Fvlji7oIJXt0KiaDTcOw==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/lzma-wasm32-wasi@1.3.1': - resolution: {integrity: sha512-XTA9XTUtj0KPKuzNS2oi3bWN6tJodk00wwMd/TiKoEqx9Fe/zu+OfDGuXAn+xs+P7S3YCDHqjYinuTQMZ0ucJw==} - engines: {node: '>=14.0.0'} - cpu: [wasm32] - - '@napi-rs/lzma-win32-arm64-msvc@1.3.1': - resolution: {integrity: sha512-qLDfs9UEtLPPTN/FdSz3gSdlx86VwFQBuLBrQtaiYQtUTKZCOYV1Z1fXqFt5Zqa1HKV2oyXnwGcTI7RpcyXxtg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [win32] - - '@napi-rs/lzma-win32-ia32-msvc@1.3.1': - resolution: {integrity: sha512-rWNlxLFMIfvxzfdQCfeQ3D/HEnQG3vfladFYrXUx6ePXO6r+BLCGn6/LWSSuKlw4vKkb1iHEWsAVaRLIcJEMIA==} - engines: {node: '>= 10'} - cpu: [ia32] - os: [win32] - - '@napi-rs/lzma-win32-x64-msvc@1.3.1': - resolution: {integrity: sha512-SNfHNqEjabXfTL1+KRi0qiAhwIlZHhQystvfSYX6p1g+2trSC/3WUpUQ4fbbR7KyE31g2AAnwjXivnlQ0af/pg==} - engines: {node: '>= 10'} - cpu: [x64] - os: [win32] - - '@napi-rs/lzma@1.3.1': - resolution: {integrity: sha512-XyZoBlYNMvCulK/RmVK/0nB3j7IdH7HpqcrMMg0U+HqQqKRLOQBwvnKNBocPC1bZQ7iZuKWYTLn1ayZwTyek8w==} - engines: {node: '>= 10'} - - '@napi-rs/tar-android-arm-eabi@0.1.1': - resolution: {integrity: sha512-Ufa0ahZvE5KGrC2WBux5svCe/jvC+e8IgtleiicwqnfgTfbDknYyq/QuqkP1AnMp/IvTmx2iutCZt6OFIG0zAg==} - engines: {node: '>= 10'} - cpu: [arm] - os: [android] - - '@napi-rs/tar-android-arm64@0.1.1': - resolution: {integrity: sha512-KUu5fHIiIObSuZ/crHxUrQ243+LiCRKPwdCVLHwjtftqFjzls+R2Mp6GrpM41XxexDMN00SUta3kazi93Xr19A==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [android] - - '@napi-rs/tar-darwin-arm64@0.1.1': - resolution: {integrity: sha512-jaqgdX20iIga+2gzotQ78eF00Cm8vECocUYeMY62WqyzJNv/jx1dlOfELWEccOjpmawFT9tjWebsS9F1QMvSUg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [darwin] - - '@napi-rs/tar-darwin-x64@0.1.1': - resolution: {integrity: sha512-80sa32IxfRso9x9sGTFpfLSx3BnruyJODpSkUzalOCz9i14n5gOKA8KR/JrnSWwDz0p5l5P9kfQD3pu8Voj7WA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [darwin] - - '@napi-rs/tar-freebsd-x64@0.1.1': - resolution: {integrity: sha512-P7V1zBjjC1dCrTwtUzuzYM4AeZduigeCtd8qQw2IUZowM5AsmhMd77oYuXjdU29cEpKUpyYjJRxjPCzFy+WbAQ==} - engines: {node: '>= 10'} - cpu: [x64] - os: [freebsd] - - '@napi-rs/tar-linux-arm-gnueabihf@0.1.1': - resolution: {integrity: sha512-qpC71ILPkWKt8k1iJCYt5gjwcOkd2VFSQIelTRr12t5CVNKV04rE/TMdwFoCP7kxbtb9Fl2cZzCRISw2BhMCmQ==} - engines: {node: '>= 10'} - cpu: [arm] - os: [linux] - - '@napi-rs/tar-linux-arm64-gnu@0.1.1': - resolution: {integrity: sha512-71QgxcFJCog6O4Tauoge8D0ILkDGJTRk3ru7zG8PUFG1QXJ1kkiRikdT77YmoVxtomc9FUOt+bdEdU5Yn+3QUQ==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/tar-linux-arm64-musl@0.1.1': - resolution: {integrity: sha512-R2e7YEILPKc447N1hUt1zQuyy0st83HX6nhmtFywS1aOj76/3hzxLVrebGiiS6kifyCrO82o66CNTYe7DixMZw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/tar-linux-x64-gnu@0.1.1': - resolution: {integrity: sha512-tmy9q2LXUB2GQ+IgUzJn3+us52leplMu96ORyFq1iHQEelGSqXt4xi5DzU07JhX3obJPqVqkybtcRS4enBfmBA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/tar-linux-x64-musl@0.1.1': - resolution: {integrity: sha512-j5ePbe6vihApl0cGPPDUVTWZbf2mF4NhxngAoG2jp7AeX3cWP2O4pjsvaOraW6QfvWEMFPeER7S0b6eBS7duvA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/tar-wasm32-wasi@0.1.1': - resolution: {integrity: sha512-se0+DlOiIRt7mcz7BeOJDoZtCrROpKLwiAOGmNgrjQ/SZS7TnOPuwm3wy9XN9WLoepttEjCEem6UP8yD5GJuQg==} - engines: {node: '>=14.0.0'} - cpu: [wasm32] - - '@napi-rs/tar-win32-arm64-msvc@0.1.1': - resolution: {integrity: sha512-FDZPi2wC7RwzvodogigLh/pJvhqCTVTUqOYuHlLkPSUbSAGiEkI55wk9RqH3y3EdJQaDuzyqC0QKz5ket2U+GA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [win32] - - '@napi-rs/tar-win32-ia32-msvc@0.1.1': - resolution: {integrity: sha512-OPR9Tou5z5M912G7Kc7gkf1ltinbOQx5dS/OeDIWHvPGOfdFDIxt0YVKhzSLRJi43+zIDp8/+cbeMD/cKXfX8w==} - engines: {node: '>= 10'} - cpu: [ia32] - os: [win32] - - '@napi-rs/tar-win32-x64-msvc@0.1.1': - resolution: {integrity: sha512-hiv5KfhrMSg8tTRC2oQXVckVg1h6ZVjwbd5aF9Esl0V3p2TaNFwwbqgnAN4Gm/PmSnHWNL/IRTHkk3cOzDWihQ==} - engines: {node: '>= 10'} - cpu: [x64] - os: [win32] - - '@napi-rs/tar@0.1.1': - resolution: {integrity: sha512-FOMhwwlvoYjHaDBxP26K3D92ltw1Y/CC4CIjgC6qXdzW4MYNwTlEyI58smCM3k+nCVJH3kpOYyH3sgbK4WZA4A==} - engines: {node: '>= 10'} - - '@napi-rs/wasm-runtime@0.2.4': - resolution: {integrity: sha512-9zESzOO5aDByvhIAsOy9TbpZ0Ur2AJbUI7UT73kcUTS2mxAMHOBaa1st/jAymNoCtvrit99kkzT1FZuXVcgfIQ==} - - '@napi-rs/wasm-tools-android-arm-eabi@0.0.2': - resolution: {integrity: sha512-/b+UU3suXjW4P0DzHRNdrnebQtFKcQf/YMeZJH+xUlKgvwli5kbmWjx8Wqqz0VETVkUTuPqJMBDIVLyc+14FGw==} - engines: {node: '>= 10'} - cpu: [arm] - os: [android] - - '@napi-rs/wasm-tools-android-arm64@0.0.2': - resolution: {integrity: sha512-j57GbDflwJdZtT8pZj5fOV4JAP+LdKN+wzsUYs+QRUoBqpWbbUANudolqfw63bkS9sD4z7fbCuz8iwtJqzxTVA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [android] - - '@napi-rs/wasm-tools-darwin-arm64@0.0.2': - resolution: {integrity: sha512-P2ChgWgVuv9GwmbxN89R84KzIImoTqXINteEixUvmkdnhyFiR+I8deNs89Yed+5w8QLC6MEfrtRqLP9YI+NoQA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [darwin] - - '@napi-rs/wasm-tools-darwin-x64@0.0.2': - resolution: {integrity: sha512-T/kQQ0gt8+wau1Z821PKVAD76QhmwVoLs2CT7Z9tTBs2pJvwSCP0C/kQiQAHcJIMi7A2E9Ab/Mez0BERy50EFA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [darwin] - - '@napi-rs/wasm-tools-freebsd-x64@0.0.2': - resolution: {integrity: sha512-GnnHu+r5sfzuxC/1J5UMF/h3BOZnHb3NQZ5hmbCfZYCKzpzRxrAJhzRunlbRN+v0x8M/49dztVTYR3s7K4ooAw==} - engines: {node: '>= 10'} - cpu: [x64] - os: [freebsd] - - '@napi-rs/wasm-tools-linux-arm64-gnu@0.0.2': - resolution: {integrity: sha512-KnZdLT0OnKb1CG2kdt3/WvM43vr9i+FEwXCvSOVC/6Tsifz7ynhMg7LAVESILd03HubzQJfg9nbRsk0bQ+IOwg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/wasm-tools-linux-arm64-musl@0.0.2': - resolution: {integrity: sha512-HkpZOID2U8P6pWqK3mqZ8bxU5xcuT3iA2fO+jrxn78h006iYgfNmdc5JaVhHnHazMmk32xKhSV4iV0VUh8UWDg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/wasm-tools-linux-x64-gnu@0.0.2': - resolution: {integrity: sha512-YksJWBCyOalB9ogtP9+/dZKP+vR6+h7BmzMXaXMT71WW/GvIsifMVgv+DY/FRSNJQupp5Y+ugjqVAOUOc/G65g==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/wasm-tools-linux-x64-musl@0.0.2': - resolution: {integrity: sha512-sPtRxPMdw05KdTcxgSPMmSXG2+PiK3vJ/l2+g9hvjnnKtvslJN2Hr7j8zgzuoKRAUFPaJVe6+D2xVh5cpdqhww==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/wasm-tools-wasm32-wasi@0.0.2': - resolution: {integrity: sha512-muRvZK7AIuo88G2AxYx3gA59rHMQgoN004saQkBvXnz3K/DVHKfTZ6TtUebss8zI3dURU6xExL8drxFWYxjEbQ==} - engines: {node: '>=14.0.0'} - cpu: [wasm32] - - '@napi-rs/wasm-tools-win32-arm64-msvc@0.0.2': - resolution: {integrity: sha512-Cn13WQ+tpFqdVwx0DIWKbsI9auFyzVZV4F5UNOUeDt6GgOL+NndgJul0Pc9bSU6fi03AylMPfF/nTCaDWO2Wgw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [win32] - - '@napi-rs/wasm-tools-win32-ia32-msvc@0.0.2': - resolution: {integrity: sha512-xsg5DkIQi82a8rcx6246Y3XC8TIqHamY+/C6sIlPLaZEuHctDkMECAw0AANwRf5vN//D2oo2oljOuoYtB1GOKw==} - engines: {node: '>= 10'} - cpu: [ia32] - os: [win32] - - '@napi-rs/wasm-tools-win32-x64-msvc@0.0.2': - resolution: {integrity: sha512-yHigltEt33eq8bappvKsIliz4MxfMPn1M+NWbIFRWN+IS1Z57mhmc1osuk+IRXrSlq0Tom0R6MYN1jpkZKz81Q==} - engines: {node: '>= 10'} - cpu: [x64] - os: [win32] - - '@napi-rs/wasm-tools@0.0.2': - resolution: {integrity: sha512-kBvDQCP5BLw2TxTENXLp3Of7vVEx0uyIye824JHE4dduzzOHVgSoOFVhVqAT3Fx/hLV445RVWfEqQbXMg4w/Mw==} - engines: {node: '>= 10'} - - '@nodelib/fs.scandir@2.1.5': - resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} - engines: {node: '>= 8'} - - '@nodelib/fs.stat@2.0.5': - resolution: {integrity: sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==} - engines: {node: '>= 8'} - - '@nodelib/fs.walk@1.2.8': - resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} - engines: {node: '>= 8'} - - '@octokit/auth-token@4.0.0': - resolution: {integrity: sha512-tY/msAuJo6ARbK6SPIxZrPBms3xPbfwBrulZe0Wtr/DIY9lje2HeV1uoebShn6mx7SjCHif6EjMvoREj+gZ+SA==} - engines: {node: '>= 18'} - - '@octokit/core@5.2.0': - resolution: {integrity: sha512-1LFfa/qnMQvEOAdzlQymH0ulepxbxnCYAKJZfMci/5XJyIHWgEYnDmgnKakbTh7CH2tFQ5O60oYDvns4i9RAIg==} - engines: {node: '>= 18'} - - '@octokit/endpoint@9.0.5': - resolution: {integrity: sha512-ekqR4/+PCLkEBF6qgj8WqJfvDq65RH85OAgrtnVp1mSxaXF03u2xW/hUdweGS5654IlC0wkNYC18Z50tSYTAFw==} - engines: {node: '>= 18'} - - '@octokit/graphql@7.1.0': - resolution: {integrity: sha512-r+oZUH7aMFui1ypZnAvZmn0KSqAUgE1/tUXIWaqUCa1758ts/Jio84GZuzsvUkme98kv0WFY8//n0J1Z+vsIsQ==} - engines: {node: '>= 18'} - - '@octokit/openapi-types@22.2.0': - resolution: {integrity: sha512-QBhVjcUa9W7Wwhm6DBFu6ZZ+1/t/oYxqc2tp81Pi41YNuJinbFRx8B133qVOrAaBbF7D/m0Et6f9/pZt9Rc+tg==} - - '@octokit/plugin-paginate-rest@11.3.1': - resolution: {integrity: sha512-ryqobs26cLtM1kQxqeZui4v8FeznirUsksiA+RYemMPJ7Micju0WSkv50dBksTuZks9O5cg4wp+t8fZ/cLY56g==} - engines: {node: '>= 18'} - peerDependencies: - '@octokit/core': '5' - - '@octokit/plugin-request-log@4.0.1': - resolution: {integrity: sha512-GihNqNpGHorUrO7Qa9JbAl0dbLnqJVrV8OXe2Zm5/Y4wFkZQDfTreBzVmiRfJVfE4mClXdihHnbpyyO9FSX4HA==} - engines: {node: '>= 18'} - peerDependencies: - '@octokit/core': '5' - - '@octokit/plugin-rest-endpoint-methods@13.2.2': - resolution: {integrity: sha512-EI7kXWidkt3Xlok5uN43suK99VWqc8OaIMktY9d9+RNKl69juoTyxmLoWPIZgJYzi41qj/9zU7G/ljnNOJ5AFA==} - engines: {node: '>= 18'} - peerDependencies: - '@octokit/core': ^5 - - '@octokit/request-error@5.1.0': - resolution: {integrity: sha512-GETXfE05J0+7H2STzekpKObFe765O5dlAKUTLNGeH+x47z7JjXHfsHKo5z21D/o/IOZTUEI6nyWyR+bZVP/n5Q==} - engines: {node: '>= 18'} - - '@octokit/request@8.4.0': - resolution: {integrity: sha512-9Bb014e+m2TgBeEJGEbdplMVWwPmL1FPtggHQRkV+WVsMggPtEkLKPlcVYm/o8xKLkpJ7B+6N8WfQMtDLX2Dpw==} - engines: {node: '>= 18'} - - '@octokit/rest@20.1.1': - resolution: {integrity: sha512-MB4AYDsM5jhIHro/dq4ix1iWTLGToIGk6cWF5L6vanFaMble5jTX/UBQyiv05HsWnwUtY8JrfHy2LWfKwihqMw==} - engines: {node: '>= 18'} - - '@octokit/types@13.5.0': - resolution: {integrity: sha512-HdqWTf5Z3qwDVlzCrP8UJquMwunpDiMPt5er+QjGzL4hqr/vBVY/MauQgS1xWxCDT1oMx1EULyqxncdCY/NVSQ==} - - '@rollup/pluginutils@4.2.1': - resolution: {integrity: sha512-iKnFXr7NkdZAIHiIWE+BX5ULi/ucVFYWD6TbAV+rZctiRTY2PL6tsIKhoIOaoskiWAkgu+VsbXgUVDNLHf+InQ==} - engines: {node: '>= 8.0.0'} - - '@sindresorhus/merge-streams@2.3.0': - resolution: {integrity: sha512-LtoMMhxAlorcGhmFYI+LhPgbPZCkgP6ra1YL604EeF6U98pLlQ3iWIGMdWSC+vWmPBWBNgmDBAhnAobLROJmwg==} - engines: {node: '>=18'} - - '@tybys/wasm-util@0.9.0': - resolution: {integrity: sha512-6+7nlbMVX/PVDCwaIQ8nTOPveOcFLSt8GcXdx8hD0bt39uWxYT88uXzqTd4fTvqta7oeUJqudepapKNt2DYJFw==} - - '@types/node@20.14.8': - resolution: {integrity: sha512-DO+2/jZinXfROG7j7WKFn/3C6nFwxy2lLpgLjEXJz+0XKphZlTLJ14mo8Vfg8X5BWN6XjyESXq+LcYdT7tR3bA==} - - '@types/stylis@4.2.6': - resolution: {integrity: sha512-4nebF2ZJGzQk0ka0O6+FZUWceyFv4vWq/0dXBMmrSeAwzOuOd/GxE5Pa64d/ndeNLG73dXoBsRzvtsVsYUv6Uw==} - - '@vercel/nft@0.26.5': - resolution: {integrity: sha512-NHxohEqad6Ra/r4lGknO52uc/GrWILXAMs1BB4401GTqww0fw1bAqzpG1XHuDO+dprg4GvsD9ZLLSsdo78p9hQ==} - engines: {node: '>=16'} - hasBin: true - - abbrev@1.1.1: - resolution: {integrity: sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==} - - acorn-import-attributes@1.9.5: - resolution: {integrity: sha512-n02Vykv5uA3eHGM/Z2dQrcD56kL8TyDb2p1+0P83PClMnC/nc+anbQRhIOWnSq4Ke/KvDPrY3C9hDtC/A3eHnQ==} - peerDependencies: - acorn: ^8 - - acorn-walk@8.3.3: - resolution: {integrity: sha512-MxXdReSRhGO7VlFe1bRG/oI7/mdLV9B9JJT0N8vZOhF7gFRR5l3M8W9G8JxmKV+JC5mGqJ0QvqfSOLsCPa4nUw==} - engines: {node: '>=0.4.0'} - - acorn@8.12.0: - resolution: {integrity: sha512-RTvkC4w+KNXrM39/lWCUaG0IbRkWdCv7W/IOW9oU6SawyxulvkQy5HQPVTKxEjczcUvapcrw3cFx/60VN/NRNw==} - engines: {node: '>=0.4.0'} - hasBin: true - - agent-base@6.0.2: - resolution: {integrity: sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==} - engines: {node: '>= 6.0.0'} - - ansi-escapes@4.3.2: - resolution: {integrity: sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==} - engines: {node: '>=8'} - - ansi-regex@5.0.1: - resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} - engines: {node: '>=8'} - - ansi-regex@6.0.1: - resolution: {integrity: sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==} - engines: {node: '>=12'} - - ansi-styles@4.3.0: - resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} - engines: {node: '>=8'} - - ansi-styles@6.2.1: - resolution: {integrity: sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==} - engines: {node: '>=12'} - - aproba@2.0.0: - resolution: {integrity: sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==} - - are-we-there-yet@2.0.0: - resolution: {integrity: sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw==} - engines: {node: '>=10'} - deprecated: This package is no longer supported. - - argparse@1.0.10: - resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==} - - argparse@2.0.1: - resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} - - array-find-index@1.0.2: - resolution: {integrity: sha512-M1HQyIXcBGtVywBt8WVdim+lrNaK7VHp99Qt5pSNziXznKHViIBbXWtfRTpEFpF/c4FdfxNAsCCwPp5phBYJtw==} - engines: {node: '>=0.10.0'} - - arrgv@1.0.2: - resolution: {integrity: sha512-a4eg4yhp7mmruZDQFqVMlxNRFGi/i1r87pt8SDHy0/I8PqSXoUTlWZRdAZo0VXgvEARcujbtTk8kiZRi1uDGRw==} - engines: {node: '>=8.0.0'} - - arrify@3.0.0: - resolution: {integrity: sha512-tLkvA81vQG/XqE2mjDkGQHoOINtMHtysSnemrmoGe6PydDPMRbVugqyk4A6V/WDWEfm3l+0d8anA9r8cv/5Jaw==} - engines: {node: '>=12'} - - async-sema@3.1.1: - resolution: {integrity: sha512-tLRNUXati5MFePdAk8dw7Qt7DpxPB60ofAgn8WRhW6a2rcimZnYBP9oxHiv0OHy+Wz7kPMG+t4LGdt31+4EmGg==} - - asynckit@0.4.0: - resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} - - ava@6.1.3: - resolution: {integrity: sha512-tkKbpF1pIiC+q09wNU9OfyTDYZa8yuWvU2up3+lFJ3lr1RmnYh2GBpPwzYUEB0wvTPIUysGjcZLNZr7STDviRA==} - engines: {node: ^18.18 || ^20.8 || ^21 || ^22} - hasBin: true - peerDependencies: - '@ava/typescript': '*' - peerDependenciesMeta: - '@ava/typescript': - optional: true - - axios@1.6.2: - resolution: {integrity: sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A==} - - balanced-match@1.0.2: - resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} - - base64-js@1.5.1: - resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==} - - before-after-hook@2.2.3: - resolution: {integrity: sha512-NzUnlZexiaH/46WDhANlyR2bXRopNg4F/zuSA3OpZnllCUgRaOF2znDioDWrmbNVsuZk6l9pMquQB38cfBZwkQ==} - - bindings@1.5.0: - resolution: {integrity: sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==} - - bl@4.1.0: - resolution: {integrity: sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==} - - blueimp-md5@2.19.0: - resolution: {integrity: sha512-DRQrD6gJyy8FbiE4s+bDoXS9hiW3Vbx5uCdwvcCf3zLHL+Iv7LtGHLpr+GZV8rHG8tK766FGYBwRbu8pELTt+w==} - - brace-expansion@1.1.11: - resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} - - braces@3.0.3: - resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==} - engines: {node: '>=8'} - - buffer@5.7.1: - resolution: {integrity: sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==} - - call-bind@1.0.7: - resolution: {integrity: sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==} - engines: {node: '>= 0.4'} - - callsites@4.1.0: - resolution: {integrity: sha512-aBMbD1Xxay75ViYezwT40aQONfr+pSXTHwNKvIXhXD6+LY3F1dLIcceoC5OZKBVHbXcysz1hL9D2w0JJIMXpUw==} - engines: {node: '>=12.20'} - - camelize@1.0.1: - resolution: {integrity: sha512-dU+Tx2fsypxTgtLoE36npi3UqcjSSMNYfkqgmoEhtZrraP5VWq0K7FkWVTYa8eMPtnU/G2txVsfdCJTn9uzpuQ==} - - cbor@9.0.2: - resolution: {integrity: sha512-JPypkxsB10s9QOWwa6zwPzqE1Md3vqpPc+cai4sAecuCsRyAtAl/pMyhPlMbT/xtPnm2dznJZYRLui57qiRhaQ==} - engines: {node: '>=16'} - - chalk@4.1.2: - resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} - engines: {node: '>=10'} - - chalk@5.3.0: - resolution: {integrity: sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==} - engines: {node: ^12.17.0 || ^14.13 || >=16.0.0} - - chardet@0.7.0: - resolution: {integrity: sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==} - - chownr@2.0.0: - resolution: {integrity: sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==} - engines: {node: '>=10'} - - chunkd@2.0.1: - resolution: {integrity: sha512-7d58XsFmOq0j6el67Ug9mHf9ELUXsQXYJBkyxhH/k+6Ke0qXRnv0kbemx+Twc6fRJ07C49lcbdgm9FL1Ei/6SQ==} - - ci-info@4.0.0: - resolution: {integrity: sha512-TdHqgGf9odd8SXNuxtUBVx8Nv+qZOejE6qyqiy5NtbYYQOeFa6zmHkxlPzmaLxWWHsU6nJmB7AETdVPi+2NBUg==} - engines: {node: '>=8'} - - ci-parallel-vars@1.0.1: - resolution: {integrity: sha512-uvzpYrpmidaoxvIQHM+rKSrigjOe9feHYbw4uOI2gdfe1C3xIlxO+kVXq83WQWNniTf8bAxVpy+cQeFQsMERKg==} - - cli-cursor@3.1.0: - resolution: {integrity: sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==} - engines: {node: '>=8'} - - cli-spinners@2.9.2: - resolution: {integrity: sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==} - engines: {node: '>=6'} - - cli-truncate@4.0.0: - resolution: {integrity: sha512-nPdaFdQ0h/GEigbPClz11D0v/ZJEwxmeVZGeMo3Z5StPtUTkA9o1lD6QwoirYiSDzbcwn2XcjwmCp68W1IS4TA==} - engines: {node: '>=18'} - - cli-width@4.1.0: - resolution: {integrity: sha512-ouuZd4/dm2Sw5Gmqy6bGyNNNe1qt9RpmxveLSO7KcgsTnU7RXfsw+/bukWGo1abgBiMAic068rclZsO4IWmmxQ==} - engines: {node: '>= 12'} - - clipanion@3.2.1: - resolution: {integrity: sha512-dYFdjLb7y1ajfxQopN05mylEpK9ZX0sO1/RfMXdfmwjlIsPkbh4p7A682x++zFPLDCo1x3p82dtljHf5cW2LKA==} - peerDependencies: - typanion: '*' - - cliui@8.0.1: - resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==} - engines: {node: '>=12'} - - clone@1.0.4: - resolution: {integrity: sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==} - engines: {node: '>=0.8'} - - code-excerpt@4.0.0: - resolution: {integrity: sha512-xxodCmBen3iy2i0WtAK8FlFNrRzjUqjRsMfho58xT/wvZU1YTM3fCnRjcy1gJPMepaRlgm/0e6w8SpWHpn3/cA==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - color-convert@2.0.1: - resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} - engines: {node: '>=7.0.0'} - - color-name@1.1.4: - resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} - - color-support@1.1.3: - resolution: {integrity: sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==} - hasBin: true - - colorette@2.0.20: - resolution: {integrity: sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==} - - combined-stream@1.0.8: - resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} - engines: {node: '>= 0.8'} - - common-path-prefix@3.0.0: - resolution: {integrity: sha512-QE33hToZseCH3jS0qN96O/bSh3kaw/h+Tq7ngyY9eWDUnTlTNUyqfqvCXioLe5Na5jFsL78ra/wuBU4iuEgd4w==} - - concat-map@0.0.1: - resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} - - concordance@5.0.4: - resolution: {integrity: sha512-OAcsnTEYu1ARJqWVGwf4zh4JDfHZEaSNlNccFmt8YjB2l/n19/PF2viLINHc57vO4FKIAFl2FWASIGZZWZ2Kxw==} - engines: {node: '>=10.18.0 <11 || >=12.14.0 <13 || >=14'} - - console-control-strings@1.1.0: - resolution: {integrity: sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==} - - convert-to-spaces@2.0.1: - resolution: {integrity: sha512-rcQ1bsQO9799wq24uE5AM2tAILy4gXGIK/njFWcVQkGNZ96edlpY+A7bjwvzjYvLDyzmG1MmMLZhpcsb+klNMQ==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - css-color-keywords@1.0.0: - resolution: {integrity: sha512-FyyrDHZKEjXDpNJYvVsV960FiqQyXc/LlYmsxl2BcdMb2WPx0OGRVgTg55rPSyLSNMqP52R9r8geSp7apN3Ofg==} - engines: {node: '>=4'} - - css-to-react-native@3.2.0: - resolution: {integrity: sha512-e8RKaLXMOFii+02mOlqwjbD00KSEKqblnpO9e++1aXS1fPQOpS1YoqdVHBqPjHNoxeF2mimzVqawm2KCbEdtHQ==} - - csstype@3.1.3: - resolution: {integrity: sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==} - - currently-unhandled@0.4.1: - resolution: {integrity: sha512-/fITjgjGU50vjQ4FH6eUoYu+iUoUKIXws2hL15JJpIR+BbTxaXQsMuuyjtNh2WqsSBS5nsaZHFsFecyw5CCAng==} - engines: {node: '>=0.10.0'} - - date-time@3.1.0: - resolution: {integrity: sha512-uqCUKXE5q1PNBXjPqvwhwJf9SwMoAHBgWJ6DcrnS5o+W2JOiIILl0JEdVD8SGujrNS02GGxgwAg2PN2zONgtjg==} - engines: {node: '>=6'} - - debug@4.3.5: - resolution: {integrity: sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg==} - engines: {node: '>=6.0'} - peerDependencies: - supports-color: '*' - peerDependenciesMeta: - supports-color: - optional: true - - defaults@1.0.4: - resolution: {integrity: sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A==} - - define-data-property@1.1.4: - resolution: {integrity: sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==} - engines: {node: '>= 0.4'} - - delayed-stream@1.0.0: - resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} - engines: {node: '>=0.4.0'} - - delegates@1.0.0: - resolution: {integrity: sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==} - - deprecation@2.3.1: - resolution: {integrity: sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==} - - detect-libc@2.0.3: - resolution: {integrity: sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw==} - engines: {node: '>=8'} - - emittery@1.0.3: - resolution: {integrity: sha512-tJdCJitoy2lrC2ldJcqN4vkqJ00lT+tOWNT1hBJjO/3FDMJa5TTIiYGCKGkn/WfCyOzUMObeohbVTj00fhiLiA==} - engines: {node: '>=14.16'} - - emnapi@1.2.0: - resolution: {integrity: sha512-rcq+dJCcfr08I0XM/57LPRqaUokGfni/+SvhO7NaJthTTjRdohhIy0FQwyC5rR1enAsjkldQg83th8J5hURv0Q==} - peerDependencies: - node-addon-api: '>= 6.1.0' - peerDependenciesMeta: - node-addon-api: - optional: true - - emoji-regex@10.3.0: - resolution: {integrity: sha512-QpLs9D9v9kArv4lfDEgg1X/gN5XLnf/A6l9cs8SPZLRZR3ZkY9+kwIQTxm+fsSej5UMYGE8fdoaZVIBlqG0XTw==} - - emoji-regex@8.0.0: - resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} - - es-define-property@1.0.0: - resolution: {integrity: sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==} - engines: {node: '>= 0.4'} - - es-errors@1.3.0: - resolution: {integrity: sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==} - engines: {node: '>= 0.4'} - - escalade@3.1.2: - resolution: {integrity: sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==} - engines: {node: '>=6'} - - escape-string-regexp@2.0.0: - resolution: {integrity: sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==} - engines: {node: '>=8'} - - escape-string-regexp@5.0.0: - resolution: {integrity: sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==} - engines: {node: '>=12'} - - esprima@4.0.1: - resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==} - engines: {node: '>=4'} - hasBin: true - - estree-walker@2.0.2: - resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==} - - esutils@2.0.3: - resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} - engines: {node: '>=0.10.0'} - - external-editor@3.1.0: - resolution: {integrity: sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==} - engines: {node: '>=4'} - - fast-diff@1.3.0: - resolution: {integrity: sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==} - - fast-glob@3.3.2: - resolution: {integrity: sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==} - engines: {node: '>=8.6.0'} - - fastq@1.17.1: - resolution: {integrity: sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==} - - figures@6.1.0: - resolution: {integrity: sha512-d+l3qxjSesT4V7v2fh+QnmFnUWv9lSpjarhShNTgBOfA0ttejbQUAlHLitbjkoRiDulW0OPoQPYIGhIC8ohejg==} - engines: {node: '>=18'} - - file-uri-to-path@1.0.0: - resolution: {integrity: sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==} - - fill-range@7.1.1: - resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==} - engines: {node: '>=8'} - - find-up-simple@1.0.0: - resolution: {integrity: sha512-q7Us7kcjj2VMePAa02hDAF6d+MzsdsAWEwYyOpwUtlerRBkOEPBCRZrAV4XfcSN8fHAgaD0hP7miwoay6DCprw==} - engines: {node: '>=18'} - - follow-redirects@1.15.6: - resolution: {integrity: sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==} - engines: {node: '>=4.0'} - peerDependencies: - debug: '*' - peerDependenciesMeta: - debug: - optional: true - - form-data@4.0.0: - resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==} - engines: {node: '>= 6'} - - fs-minipass@2.1.0: - resolution: {integrity: sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==} - engines: {node: '>= 8'} - - fs.realpath@1.0.0: - resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} - - function-bind@1.1.2: - resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==} - - gauge@3.0.2: - resolution: {integrity: sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q==} - engines: {node: '>=10'} - deprecated: This package is no longer supported. - - get-caller-file@2.0.5: - resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} - engines: {node: 6.* || 8.* || >= 10.*} - - get-east-asian-width@1.2.0: - resolution: {integrity: sha512-2nk+7SIVb14QrgXFHcm84tD4bKQz0RxPuMT8Ag5KPOq7J5fEmAg0UbXdTOSHqNuHSU28k55qnceesxXRZGzKWA==} - engines: {node: '>=18'} - - get-intrinsic@1.2.4: - resolution: {integrity: sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==} - engines: {node: '>= 0.4'} - - glob-parent@5.1.2: - resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} - engines: {node: '>= 6'} - - glob@7.2.3: - resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} - deprecated: Glob versions prior to v9 are no longer supported - - globby@14.0.1: - resolution: {integrity: sha512-jOMLD2Z7MAhyG8aJpNOpmziMOP4rPLcc95oQPKXBazW82z+CEgPFBQvEpRUa1KeIMUJo4Wsm+q6uzO/Q/4BksQ==} - engines: {node: '>=18'} - - gopd@1.0.1: - resolution: {integrity: sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==} - - graceful-fs@4.2.11: - resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} - - has-flag@4.0.0: - resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} - engines: {node: '>=8'} - - has-property-descriptors@1.0.2: - resolution: {integrity: sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==} - - has-proto@1.0.3: - resolution: {integrity: sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==} - engines: {node: '>= 0.4'} - - has-symbols@1.0.3: - resolution: {integrity: sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==} - engines: {node: '>= 0.4'} - - has-unicode@2.0.1: - resolution: {integrity: sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==} - - hasown@2.0.2: - resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==} - engines: {node: '>= 0.4'} - - https-proxy-agent@5.0.1: - resolution: {integrity: sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==} - engines: {node: '>= 6'} - - iconv-lite@0.4.24: - resolution: {integrity: sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==} - engines: {node: '>=0.10.0'} - - ieee754@1.2.1: - resolution: {integrity: sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==} - - ignore-by-default@2.1.0: - resolution: {integrity: sha512-yiWd4GVmJp0Q6ghmM2B/V3oZGRmjrKLXvHR3TE1nfoXsmoggllfZUQe74EN0fJdPFZu2NIvNdrMMLm3OsV7Ohw==} - engines: {node: '>=10 <11 || >=12 <13 || >=14'} - - ignore@5.3.1: - resolution: {integrity: sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==} - engines: {node: '>= 4'} - - imurmurhash@0.1.4: - resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} - engines: {node: '>=0.8.19'} - - indent-string@5.0.0: - resolution: {integrity: sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==} - engines: {node: '>=12'} - - inflight@1.0.6: - resolution: {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. - - inherits@2.0.4: - resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} - - inquirer@9.2.23: - resolution: {integrity: sha512-kod5s+FBPIDM2xiy9fu+6wdU/SkK5le5GS9lh4FEBjBHqiMgD9lLFbCbuqFNAjNL2ZOy9Wd9F694IOzN9pZHBA==} - engines: {node: '>=18'} - - irregular-plurals@3.5.0: - resolution: {integrity: sha512-1ANGLZ+Nkv1ptFb2pa8oG8Lem4krflKuX/gINiHJHjJUKaJHk/SXk5x6K3J+39/p0h1RQ2saROclJJ+QLvETCQ==} - engines: {node: '>=8'} - - is-extglob@2.1.1: - resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} - engines: {node: '>=0.10.0'} - - is-fullwidth-code-point@3.0.0: - resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} - engines: {node: '>=8'} - - is-fullwidth-code-point@4.0.0: - resolution: {integrity: sha512-O4L094N2/dZ7xqVdrXhh9r1KODPJpFms8B5sGdJLPy664AgvXsreZUyCQQNItZRDlYug4xStLjNp/sz3HvBowQ==} - engines: {node: '>=12'} - - is-glob@4.0.3: - resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} - engines: {node: '>=0.10.0'} - - is-interactive@1.0.0: - resolution: {integrity: sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w==} - engines: {node: '>=8'} - - is-number@7.0.0: - resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} - engines: {node: '>=0.12.0'} - - is-plain-object@5.0.0: - resolution: {integrity: sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==} - engines: {node: '>=0.10.0'} - - is-promise@4.0.0: - resolution: {integrity: sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==} - - is-unicode-supported@0.1.0: - resolution: {integrity: sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==} - engines: {node: '>=10'} - - is-unicode-supported@2.0.0: - resolution: {integrity: sha512-FRdAyx5lusK1iHG0TWpVtk9+1i+GjrzRffhDg4ovQ7mcidMQ6mj+MhKPmvh7Xwyv5gIS06ns49CA7Sqg7lC22Q==} - engines: {node: '>=18'} - - js-string-escape@1.0.1: - resolution: {integrity: sha512-Smw4xcfIQ5LVjAOuJCvN/zIodzA/BBSsluuoSykP+lUvScIi4U6RJLfwHet5cxFnCswUjISV8oAXaqaJDY3chg==} - engines: {node: '>= 0.8'} - - js-tokens@4.0.0: - resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} - - js-yaml@3.14.1: - resolution: {integrity: sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==} - hasBin: true - - js-yaml@4.1.0: - resolution: {integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==} - hasBin: true - - load-json-file@7.0.1: - resolution: {integrity: sha512-Gnxj3ev3mB5TkVBGad0JM6dmLiQL+o0t23JPBZ9sd+yvSLk05mFoqKBw5N8gbbkU4TNXyqCgIrl/VM17OgUIgQ==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - lodash-es@4.17.21: - resolution: {integrity: sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==} - - lodash@4.17.21: - resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} - - log-symbols@4.1.0: - resolution: {integrity: sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==} - engines: {node: '>=10'} - - loose-envify@1.4.0: - resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==} - hasBin: true - - make-dir@3.1.0: - resolution: {integrity: sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==} - engines: {node: '>=8'} - - matcher@5.0.0: - resolution: {integrity: sha512-s2EMBOWtXFc8dgqvoAzKJXxNHibcdJMV0gwqKUaw9E2JBJuGUK7DrNKrA6g/i+v72TT16+6sVm5mS3thaMLQUw==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - md5-hex@3.0.1: - resolution: {integrity: sha512-BUiRtTtV39LIJwinWBjqVsU9xhdnz7/i889V859IBFpuqGAj6LuOvHv5XLbgZ2R7ptJoJaEcxkv88/h25T7Ciw==} - engines: {node: '>=8'} - - memoize@10.0.0: - resolution: {integrity: sha512-H6cBLgsi6vMWOcCpvVCdFFnl3kerEXbrYh9q+lY6VXvQSmM6CkmV08VOwT+WE2tzIEqRPFfAq3fm4v/UIW6mSA==} - engines: {node: '>=18'} - - merge2@1.4.1: - resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} - engines: {node: '>= 8'} - - micromatch@4.0.7: - resolution: {integrity: sha512-LPP/3KorzCwBxfeUuZmaR6bG2kdeHSbe0P2tY3FLRU4vYrjYz5hI4QZwV0njUx3jeuKe67YukQ1LSPZBKDqO/Q==} - engines: {node: '>=8.6'} - - mime-db@1.52.0: - resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} - engines: {node: '>= 0.6'} - - mime-types@2.1.35: - resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} - engines: {node: '>= 0.6'} - - mimic-fn@2.1.0: - resolution: {integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==} - engines: {node: '>=6'} - - mimic-function@5.0.1: - resolution: {integrity: sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==} - engines: {node: '>=18'} - - minimatch@3.1.2: - resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} - - minipass@3.3.6: - resolution: {integrity: sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==} - engines: {node: '>=8'} - - minipass@5.0.0: - resolution: {integrity: sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==} - engines: {node: '>=8'} - - minizlib@2.1.2: - resolution: {integrity: sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==} - engines: {node: '>= 8'} - - mkdirp@1.0.4: - resolution: {integrity: sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==} - engines: {node: '>=10'} - hasBin: true - - ms@2.1.2: - resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} - - ms@2.1.3: - resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} - - mute-stream@1.0.0: - resolution: {integrity: sha512-avsJQhyd+680gKXyG/sQc0nXaC6rBkPOfyHYcFb9+hdkqQkR9bdnkJ0AMZhke0oesPqIO+mFFJ+IdBc7mst4IA==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - - nanoid@3.3.7: - resolution: {integrity: sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==} - engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} - hasBin: true - - node-fetch@2.7.0: - resolution: {integrity: sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==} - engines: {node: 4.x || >=6.0.0} - peerDependencies: - encoding: ^0.1.0 - peerDependenciesMeta: - encoding: - optional: true - - node-gyp-build@4.8.1: - resolution: {integrity: sha512-OSs33Z9yWr148JZcbZd5WiAXhh/n9z8TxQcdMhIOlpN9AhWpLfvVFO73+m77bBABQMaY9XSvIa+qk0jlI7Gcaw==} - hasBin: true - - nofilter@3.1.0: - resolution: {integrity: sha512-l2NNj07e9afPnhAhvgVrCD/oy2Ai1yfLpuo3EpiO1jFTsB4sFz6oIfAfSZyQzVpkZQ9xS8ZS5g1jCBgq4Hwo0g==} - engines: {node: '>=12.19'} - - nopt@5.0.0: - resolution: {integrity: sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==} - engines: {node: '>=6'} - hasBin: true - - npmlog@5.0.1: - resolution: {integrity: sha512-AqZtDUWOMKs1G/8lwylVjrdYgqA4d9nu8hc+0gzRxlDb1I10+FHBGMXs6aiQHFdCUUlqH99MUMuLfzWDNDtfxw==} - deprecated: This package is no longer supported. - - object-assign@4.1.1: - resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} - engines: {node: '>=0.10.0'} - - once@1.4.0: - resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} - - onetime@5.1.2: - resolution: {integrity: sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==} - engines: {node: '>=6'} - - ora@5.4.1: - resolution: {integrity: sha512-5b6Y85tPxZZ7QytO+BQzysW31HJku27cRIlkbAXaNx+BdcVi+LlRFmVXzeF6a7JCwJpyw5c4b+YSVImQIrBpuQ==} - engines: {node: '>=10'} - - os-tmpdir@1.0.2: - resolution: {integrity: sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==} - engines: {node: '>=0.10.0'} - - p-map@7.0.2: - resolution: {integrity: sha512-z4cYYMMdKHzw4O5UkWJImbZynVIo0lSGTXc7bzB1e/rrDqkgGUNysK/o4bTr+0+xKvvLoTyGqYC4Fgljy9qe1Q==} - engines: {node: '>=18'} - - package-config@5.0.0: - resolution: {integrity: sha512-GYTTew2slBcYdvRHqjhwaaydVMvn/qrGC323+nKclYioNSLTDUM/lGgtGTgyHVtYcozb+XkE8CNhwcraOmZ9Mg==} - engines: {node: '>=18'} - - parse-ms@4.0.0: - resolution: {integrity: sha512-TXfryirbmq34y8QBwgqCVLi+8oA3oWx2eAnSn62ITyEhEYaWRlVZ2DvMM9eZbMs/RfxPu/PK/aBLyGj4IrqMHw==} - engines: {node: '>=18'} - - path-is-absolute@1.0.1: - resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==} - engines: {node: '>=0.10.0'} - - path-type@5.0.0: - resolution: {integrity: sha512-5HviZNaZcfqP95rwpv+1HDgUamezbqdSYTyzjTvwtJSnIH+3vnbmWsItli8OFEndS984VT55M3jduxZbX351gg==} - engines: {node: '>=12'} - - picocolors@1.0.1: - resolution: {integrity: sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==} - - picomatch@2.3.1: - resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} - engines: {node: '>=8.6'} - - picomatch@3.0.1: - resolution: {integrity: sha512-I3EurrIQMlRc9IaAZnqRR044Phh2DXY+55o7uJ0V+hYZAcQYSuFWsc9q5PvyDHUSCe1Qxn/iBz+78s86zWnGag==} - engines: {node: '>=10'} - - plur@5.1.0: - resolution: {integrity: sha512-VP/72JeXqak2KiOzjgKtQen5y3IZHn+9GOuLDafPv0eXa47xq0At93XahYBs26MsifCQ4enGKwbjBTKgb9QJXg==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - postcss-value-parser@4.2.0: - resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==} - - postcss@8.4.33: - resolution: {integrity: sha512-Kkpbhhdjw2qQs2O2DGX+8m5OVqEcbB9HRBvuYM9pgrjEFUg30A9LmXNlTAUj4S9kgtGyrMbTzVjH7E+s5Re2yg==} - engines: {node: ^10 || ^12 || >=14} - - pretty-ms@9.0.0: - resolution: {integrity: sha512-E9e9HJ9R9NasGOgPaPE8VMeiPKAyWR5jcFpNnwIejslIhWqdqOrb2wShBsncMPUb+BcCd2OPYfh7p2W6oemTng==} - engines: {node: '>=18'} - - proxy-from-env@1.1.0: - resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==} - - queue-microtask@1.2.3: - resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} - - react-dom@18.3.1: - resolution: {integrity: sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==} - peerDependencies: - react: ^18.3.1 - - react@18.3.1: - resolution: {integrity: sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==} - engines: {node: '>=0.10.0'} - - readable-stream@3.6.2: - resolution: {integrity: sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==} - engines: {node: '>= 6'} - - require-directory@2.1.1: - resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} - engines: {node: '>=0.10.0'} - - resolve-cwd@3.0.0: - resolution: {integrity: sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==} - engines: {node: '>=8'} - - resolve-from@5.0.0: - resolution: {integrity: sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==} - engines: {node: '>=8'} - - restore-cursor@3.1.0: - resolution: {integrity: sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==} - engines: {node: '>=8'} - - reusify@1.0.4: - resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==} - engines: {iojs: '>=1.0.0', node: '>=0.10.0'} - - rimraf@3.0.2: - resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==} - deprecated: Rimraf versions prior to v4 are no longer supported - hasBin: true - - run-async@3.0.0: - resolution: {integrity: sha512-540WwVDOMxA6dN6We19EcT9sc3hkXPw5mzRNGM3FkdN/vtE9NFvj5lFAPNwUDmJjXidm3v7TC1cTE7t17Ulm1Q==} - engines: {node: '>=0.12.0'} - - run-parallel@1.2.0: - resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} - - rxjs@7.8.1: - resolution: {integrity: sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==} - - safe-buffer@5.2.1: - resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} - - safer-buffer@2.1.2: - resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} - - scheduler@0.23.2: - resolution: {integrity: sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ==} - - semver@6.3.1: - resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} - hasBin: true - - semver@7.6.2: - resolution: {integrity: sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==} - engines: {node: '>=10'} - hasBin: true - - serialize-error@7.0.1: - resolution: {integrity: sha512-8I8TjW5KMOKsZQTvoxjuSIa7foAwPWGOts+6o7sgjz41/qMD9VQHEDxi6PBvK2l0MXUmqZyNpUK+T2tQaaElvw==} - engines: {node: '>=10'} - - set-blocking@2.0.0: - resolution: {integrity: sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==} - - set-function-length@1.2.2: - resolution: {integrity: sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==} - engines: {node: '>= 0.4'} - - shallowequal@1.1.0: - resolution: {integrity: sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ==} - - signal-exit@3.0.7: - resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} - - signal-exit@4.1.0: - resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} - engines: {node: '>=14'} - - slash@5.1.0: - resolution: {integrity: sha512-ZA6oR3T/pEyuqwMgAKT0/hAv8oAXckzbkmR0UkUosQ+Mc4RxGoJkRmwHgHufaenlyAgE1Mxgpdcrf75y6XcnDg==} - engines: {node: '>=14.16'} - - slice-ansi@5.0.0: - resolution: {integrity: sha512-FC+lgizVPfie0kkhqUScwRu1O/lF6NOgJmlCgK+/LYxDCTk8sGelYaHDhFcDN+Sn3Cv+3VSa4Byeo+IMCzpMgQ==} - engines: {node: '>=12'} - - source-map-js@1.2.0: - resolution: {integrity: sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==} - engines: {node: '>=0.10.0'} - - sprintf-js@1.0.3: - resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==} - - stack-utils@2.0.6: - resolution: {integrity: sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==} - engines: {node: '>=10'} - - string-width@4.2.3: - resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} - engines: {node: '>=8'} - - string-width@7.1.0: - resolution: {integrity: sha512-SEIJCWiX7Kg4c129n48aDRwLbFb2LJmXXFrWBG4NGaRtMQ3myKPKbwrD1BKqQn74oCoNMBVrfDEr5M9YxCsrkw==} - engines: {node: '>=18'} - - string_decoder@1.3.0: - resolution: {integrity: sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==} - - strip-ansi@6.0.1: - resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} - engines: {node: '>=8'} - - strip-ansi@7.1.0: - resolution: {integrity: sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==} - engines: {node: '>=12'} - - styled-components@6.1.1: - resolution: {integrity: sha512-cpZZP5RrKRIClBW5Eby4JM1wElLVP4NQrJbJ0h10TidTyJf4SIIwa3zLXOoPb4gJi8MsJ8mjq5mu2IrEhZIAcQ==} - engines: {node: '>= 16'} - peerDependencies: - react: '>= 16.8.0' - react-dom: '>= 16.8.0' - - stylis@4.3.2: - resolution: {integrity: sha512-bhtUjWd/z6ltJiQwg0dUfxEJ+W+jdqQd8TbWLWyeIJHlnsqmGLRFFd8e5mA0AZi/zx90smXRlN66YMTcaSFifg==} - - supertap@3.0.1: - resolution: {integrity: sha512-u1ZpIBCawJnO+0QePsEiOknOfCRq0yERxiAchT0i4li0WHNUJbf0evXXSXOcCAR4M8iMDoajXYmstm/qO81Isw==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - supports-color@7.2.0: - resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} - engines: {node: '>=8'} - - tar@6.2.1: - resolution: {integrity: sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==} - engines: {node: '>=10'} - - temp-dir@3.0.0: - resolution: {integrity: sha512-nHc6S/bwIilKHNRgK/3jlhDoIHcp45YgyiwcAk46Tr0LfEqGBVpmiAyuiuxeVE44m3mXnEeVhaipLOEWmH+Njw==} - engines: {node: '>=14.16'} - - time-zone@1.0.0: - resolution: {integrity: sha512-TIsDdtKo6+XrPtiTm1ssmMngN1sAhyKnTO2kunQWqNPWIVvCm15Wmw4SWInwTVgJ5u/Tr04+8Ei9TNcw4x4ONA==} - engines: {node: '>=4'} - - tmp@0.0.33: - resolution: {integrity: sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==} - engines: {node: '>=0.6.0'} - - to-regex-range@5.0.1: - resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} - engines: {node: '>=8.0'} - - toml@3.0.0: - resolution: {integrity: sha512-y/mWCZinnvxjTKYhJ+pYxwD0mRLVvOtdS2Awbgxln6iEnt4rk0yBxeSBHkGJcPucRiG0e55mwWp+g/05rsrd6w==} - - tr46@0.0.3: - resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==} - - tslib@2.6.3: - resolution: {integrity: sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ==} - - typanion@3.14.0: - resolution: {integrity: sha512-ZW/lVMRabETuYCd9O9ZvMhAh8GslSqaUjxmK/JLPCh6l73CvLBiuXswj/+7LdnWOgYsQ130FqLzFz5aGT4I3Ug==} - - type-fest@0.13.1: - resolution: {integrity: sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==} - engines: {node: '>=10'} - - type-fest@0.21.3: - resolution: {integrity: sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==} - engines: {node: '>=10'} - - typescript@5.5.2: - resolution: {integrity: sha512-NcRtPEOsPFFWjobJEtfihkLCZCXZt/os3zf8nTxjVH3RvTSxjrCamJpbExGvYOF+tFHc3pA65qpdwPbzjohhew==} - engines: {node: '>=14.17'} - hasBin: true - - undici-types@5.26.5: - resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==} - - unicorn-magic@0.1.0: - resolution: {integrity: sha512-lRfVq8fE8gz6QMBuDM6a+LO3IAzTi05H6gCVaUpir2E1Rwpo4ZUog45KpNXKC/Mn3Yb9UDuHumeFTo9iV/D9FQ==} - engines: {node: '>=18'} - - universal-user-agent@6.0.1: - resolution: {integrity: sha512-yCzhz6FN2wU1NiiQRogkTQszlQSlpWaw8SvVegAc+bDxbzHgh1vX8uIe8OYyMH6DwH+sdTJsgMl36+mSMdRJIQ==} - - util-deprecate@1.0.2: - resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} - - wasm-sjlj@1.0.5: - resolution: {integrity: sha512-Z/MHJeOkAvJJVWnGX3/YZGYldGaawZbYHX4ldYG9kLhcdB8H31F5x66M7Zc4BP/7pg0aLsusQj1629m2B3Rilg==} - - wcwidth@1.0.1: - resolution: {integrity: sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==} - - webidl-conversions@3.0.1: - resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==} - - well-known-symbols@2.0.0: - resolution: {integrity: sha512-ZMjC3ho+KXo0BfJb7JgtQ5IBuvnShdlACNkKkdsqBmYw3bPAaJfPeYUo6tLUaT5tG/Gkh7xkpBhKRQ9e7pyg9Q==} - engines: {node: '>=6'} - - whatwg-url@5.0.0: - resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==} - - wide-align@1.1.5: - resolution: {integrity: sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==} - - wrap-ansi@6.2.0: - resolution: {integrity: sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==} - engines: {node: '>=8'} - - wrap-ansi@7.0.0: - resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==} - engines: {node: '>=10'} - - wrappy@1.0.2: - resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} - - write-file-atomic@5.0.1: - resolution: {integrity: sha512-+QU2zd6OTD8XWIJCbffaiQeH9U73qIqafo1x6V1snCWYGJf6cVE0cDR4D8xRzcEnfI21IFrUPzPGtcPf8AC+Rw==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - - y18n@5.0.8: - resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==} - engines: {node: '>=10'} - - yallist@4.0.0: - resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==} - - yargs-parser@21.1.1: - resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} - engines: {node: '>=12'} - - yargs@17.7.2: - resolution: {integrity: sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==} - engines: {node: '>=12'} - -snapshots: - - '@emnapi/core@1.2.0': - dependencies: - '@emnapi/wasi-threads': 1.0.1 - tslib: 2.6.3 - - '@emnapi/runtime@1.2.0': - dependencies: - tslib: 2.6.3 - - '@emnapi/wasi-threads@1.0.1': - dependencies: - tslib: 2.6.3 - - '@emotion/is-prop-valid@1.2.2': - dependencies: - '@emotion/memoize': 0.8.1 - - '@emotion/memoize@0.8.1': {} - - '@emotion/unitless@0.8.1': {} - - '@inquirer/figures@1.0.3': {} - - '@ljharb/through@2.3.13': - dependencies: - call-bind: 1.0.7 - - '@mapbox/node-pre-gyp@1.0.11': - dependencies: - detect-libc: 2.0.3 - https-proxy-agent: 5.0.1 - make-dir: 3.1.0 - node-fetch: 2.7.0 - nopt: 5.0.0 - npmlog: 5.0.1 - rimraf: 3.0.2 - semver: 7.6.2 - tar: 6.2.1 - transitivePeerDependencies: - - encoding - - supports-color - - '@napi-rs/cli@3.0.0-alpha.55(@emnapi/runtime@1.2.0)(emnapi@1.2.0)': - dependencies: - '@napi-rs/cross-toolchain': 0.0.16 - '@napi-rs/wasm-tools': 0.0.2 - '@octokit/rest': 20.1.1 - clipanion: 3.2.1(typanion@3.14.0) - colorette: 2.0.20 - debug: 4.3.5 - inquirer: 9.2.23 - js-yaml: 4.1.0 - lodash-es: 4.17.21 - semver: 7.6.2 - toml: 3.0.0 - typanion: 3.14.0 - wasm-sjlj: 1.0.5 - optionalDependencies: - '@emnapi/runtime': 1.2.0 - emnapi: 1.2.0 - transitivePeerDependencies: - - '@napi-rs/cross-toolchain-arm64-target-aarch64' - - '@napi-rs/cross-toolchain-arm64-target-armv7' - - '@napi-rs/cross-toolchain-arm64-target-x86_64' - - '@napi-rs/cross-toolchain-x64-target-aarch64' - - '@napi-rs/cross-toolchain-x64-target-armv7' - - '@napi-rs/cross-toolchain-x64-target-x86_64' - - supports-color - - '@napi-rs/cross-toolchain@0.0.16': - dependencies: - '@napi-rs/lzma': 1.3.1 - '@napi-rs/tar': 0.1.1 - debug: 4.3.5 - transitivePeerDependencies: - - supports-color - - '@napi-rs/lzma-android-arm-eabi@1.3.1': - optional: true - - '@napi-rs/lzma-android-arm64@1.3.1': - optional: true - - '@napi-rs/lzma-darwin-arm64@1.3.1': - optional: true - - '@napi-rs/lzma-darwin-x64@1.3.1': - optional: true - - '@napi-rs/lzma-freebsd-x64@1.3.1': - optional: true - - '@napi-rs/lzma-linux-arm-gnueabihf@1.3.1': - optional: true - - '@napi-rs/lzma-linux-arm64-gnu@1.3.1': - optional: true - - '@napi-rs/lzma-linux-arm64-musl@1.3.1': - optional: true - - '@napi-rs/lzma-linux-x64-gnu@1.3.1': - optional: true - - '@napi-rs/lzma-linux-x64-musl@1.3.1': - optional: true - - '@napi-rs/lzma-wasm32-wasi@1.3.1': - dependencies: - '@napi-rs/wasm-runtime': 0.2.4 - optional: true - - '@napi-rs/lzma-win32-arm64-msvc@1.3.1': - optional: true - - '@napi-rs/lzma-win32-ia32-msvc@1.3.1': - optional: true - - '@napi-rs/lzma-win32-x64-msvc@1.3.1': - optional: true - - '@napi-rs/lzma@1.3.1': - optionalDependencies: - '@napi-rs/lzma-android-arm-eabi': 1.3.1 - '@napi-rs/lzma-android-arm64': 1.3.1 - '@napi-rs/lzma-darwin-arm64': 1.3.1 - '@napi-rs/lzma-darwin-x64': 1.3.1 - '@napi-rs/lzma-freebsd-x64': 1.3.1 - '@napi-rs/lzma-linux-arm-gnueabihf': 1.3.1 - '@napi-rs/lzma-linux-arm64-gnu': 1.3.1 - '@napi-rs/lzma-linux-arm64-musl': 1.3.1 - '@napi-rs/lzma-linux-x64-gnu': 1.3.1 - '@napi-rs/lzma-linux-x64-musl': 1.3.1 - '@napi-rs/lzma-wasm32-wasi': 1.3.1 - '@napi-rs/lzma-win32-arm64-msvc': 1.3.1 - '@napi-rs/lzma-win32-ia32-msvc': 1.3.1 - '@napi-rs/lzma-win32-x64-msvc': 1.3.1 - - '@napi-rs/tar-android-arm-eabi@0.1.1': - optional: true - - '@napi-rs/tar-android-arm64@0.1.1': - optional: true - - '@napi-rs/tar-darwin-arm64@0.1.1': - optional: true - - '@napi-rs/tar-darwin-x64@0.1.1': - optional: true - - '@napi-rs/tar-freebsd-x64@0.1.1': - optional: true - - '@napi-rs/tar-linux-arm-gnueabihf@0.1.1': - optional: true - - '@napi-rs/tar-linux-arm64-gnu@0.1.1': - optional: true - - '@napi-rs/tar-linux-arm64-musl@0.1.1': - optional: true - - '@napi-rs/tar-linux-x64-gnu@0.1.1': - optional: true - - '@napi-rs/tar-linux-x64-musl@0.1.1': - optional: true - - '@napi-rs/tar-wasm32-wasi@0.1.1': - dependencies: - '@napi-rs/wasm-runtime': 0.2.4 - optional: true - - '@napi-rs/tar-win32-arm64-msvc@0.1.1': - optional: true - - '@napi-rs/tar-win32-ia32-msvc@0.1.1': - optional: true - - '@napi-rs/tar-win32-x64-msvc@0.1.1': - optional: true - - '@napi-rs/tar@0.1.1': - optionalDependencies: - '@napi-rs/tar-android-arm-eabi': 0.1.1 - '@napi-rs/tar-android-arm64': 0.1.1 - '@napi-rs/tar-darwin-arm64': 0.1.1 - '@napi-rs/tar-darwin-x64': 0.1.1 - '@napi-rs/tar-freebsd-x64': 0.1.1 - '@napi-rs/tar-linux-arm-gnueabihf': 0.1.1 - '@napi-rs/tar-linux-arm64-gnu': 0.1.1 - '@napi-rs/tar-linux-arm64-musl': 0.1.1 - '@napi-rs/tar-linux-x64-gnu': 0.1.1 - '@napi-rs/tar-linux-x64-musl': 0.1.1 - '@napi-rs/tar-wasm32-wasi': 0.1.1 - '@napi-rs/tar-win32-arm64-msvc': 0.1.1 - '@napi-rs/tar-win32-ia32-msvc': 0.1.1 - '@napi-rs/tar-win32-x64-msvc': 0.1.1 - - '@napi-rs/wasm-runtime@0.2.4': - dependencies: - '@emnapi/core': 1.2.0 - '@emnapi/runtime': 1.2.0 - '@tybys/wasm-util': 0.9.0 - - '@napi-rs/wasm-tools-android-arm-eabi@0.0.2': - optional: true - - '@napi-rs/wasm-tools-android-arm64@0.0.2': - optional: true - - '@napi-rs/wasm-tools-darwin-arm64@0.0.2': - optional: true - - '@napi-rs/wasm-tools-darwin-x64@0.0.2': - optional: true - - '@napi-rs/wasm-tools-freebsd-x64@0.0.2': - optional: true - - '@napi-rs/wasm-tools-linux-arm64-gnu@0.0.2': - optional: true - - '@napi-rs/wasm-tools-linux-arm64-musl@0.0.2': - optional: true - - '@napi-rs/wasm-tools-linux-x64-gnu@0.0.2': - optional: true - - '@napi-rs/wasm-tools-linux-x64-musl@0.0.2': - optional: true - - '@napi-rs/wasm-tools-wasm32-wasi@0.0.2': - dependencies: - '@napi-rs/wasm-runtime': 0.2.4 - optional: true - - '@napi-rs/wasm-tools-win32-arm64-msvc@0.0.2': - optional: true - - '@napi-rs/wasm-tools-win32-ia32-msvc@0.0.2': - optional: true - - '@napi-rs/wasm-tools-win32-x64-msvc@0.0.2': - optional: true - - '@napi-rs/wasm-tools@0.0.2': - optionalDependencies: - '@napi-rs/wasm-tools-android-arm-eabi': 0.0.2 - '@napi-rs/wasm-tools-android-arm64': 0.0.2 - '@napi-rs/wasm-tools-darwin-arm64': 0.0.2 - '@napi-rs/wasm-tools-darwin-x64': 0.0.2 - '@napi-rs/wasm-tools-freebsd-x64': 0.0.2 - '@napi-rs/wasm-tools-linux-arm64-gnu': 0.0.2 - '@napi-rs/wasm-tools-linux-arm64-musl': 0.0.2 - '@napi-rs/wasm-tools-linux-x64-gnu': 0.0.2 - '@napi-rs/wasm-tools-linux-x64-musl': 0.0.2 - '@napi-rs/wasm-tools-wasm32-wasi': 0.0.2 - '@napi-rs/wasm-tools-win32-arm64-msvc': 0.0.2 - '@napi-rs/wasm-tools-win32-ia32-msvc': 0.0.2 - '@napi-rs/wasm-tools-win32-x64-msvc': 0.0.2 - - '@nodelib/fs.scandir@2.1.5': - dependencies: - '@nodelib/fs.stat': 2.0.5 - run-parallel: 1.2.0 - - '@nodelib/fs.stat@2.0.5': {} - - '@nodelib/fs.walk@1.2.8': - dependencies: - '@nodelib/fs.scandir': 2.1.5 - fastq: 1.17.1 - - '@octokit/auth-token@4.0.0': {} - - '@octokit/core@5.2.0': - dependencies: - '@octokit/auth-token': 4.0.0 - '@octokit/graphql': 7.1.0 - '@octokit/request': 8.4.0 - '@octokit/request-error': 5.1.0 - '@octokit/types': 13.5.0 - before-after-hook: 2.2.3 - universal-user-agent: 6.0.1 - - '@octokit/endpoint@9.0.5': - dependencies: - '@octokit/types': 13.5.0 - universal-user-agent: 6.0.1 - - '@octokit/graphql@7.1.0': - dependencies: - '@octokit/request': 8.4.0 - '@octokit/types': 13.5.0 - universal-user-agent: 6.0.1 - - '@octokit/openapi-types@22.2.0': {} - - '@octokit/plugin-paginate-rest@11.3.1(@octokit/core@5.2.0)': - dependencies: - '@octokit/core': 5.2.0 - '@octokit/types': 13.5.0 - - '@octokit/plugin-request-log@4.0.1(@octokit/core@5.2.0)': - dependencies: - '@octokit/core': 5.2.0 - - '@octokit/plugin-rest-endpoint-methods@13.2.2(@octokit/core@5.2.0)': - dependencies: - '@octokit/core': 5.2.0 - '@octokit/types': 13.5.0 - - '@octokit/request-error@5.1.0': - dependencies: - '@octokit/types': 13.5.0 - deprecation: 2.3.1 - once: 1.4.0 - - '@octokit/request@8.4.0': - dependencies: - '@octokit/endpoint': 9.0.5 - '@octokit/request-error': 5.1.0 - '@octokit/types': 13.5.0 - universal-user-agent: 6.0.1 - - '@octokit/rest@20.1.1': - dependencies: - '@octokit/core': 5.2.0 - '@octokit/plugin-paginate-rest': 11.3.1(@octokit/core@5.2.0) - '@octokit/plugin-request-log': 4.0.1(@octokit/core@5.2.0) - '@octokit/plugin-rest-endpoint-methods': 13.2.2(@octokit/core@5.2.0) - - '@octokit/types@13.5.0': - dependencies: - '@octokit/openapi-types': 22.2.0 - - '@rollup/pluginutils@4.2.1': - dependencies: - estree-walker: 2.0.2 - picomatch: 2.3.1 - - '@sindresorhus/merge-streams@2.3.0': {} - - '@tybys/wasm-util@0.9.0': - dependencies: - tslib: 2.6.3 - - '@types/node@20.14.8': - dependencies: - undici-types: 5.26.5 - - '@types/stylis@4.2.6': {} - - '@vercel/nft@0.26.5': - dependencies: - '@mapbox/node-pre-gyp': 1.0.11 - '@rollup/pluginutils': 4.2.1 - acorn: 8.12.0 - acorn-import-attributes: 1.9.5(acorn@8.12.0) - async-sema: 3.1.1 - bindings: 1.5.0 - estree-walker: 2.0.2 - glob: 7.2.3 - graceful-fs: 4.2.11 - micromatch: 4.0.7 - node-gyp-build: 4.8.1 - resolve-from: 5.0.0 - transitivePeerDependencies: - - encoding - - supports-color - - abbrev@1.1.1: {} - - acorn-import-attributes@1.9.5(acorn@8.12.0): - dependencies: - acorn: 8.12.0 - - acorn-walk@8.3.3: - dependencies: - acorn: 8.12.0 - - acorn@8.12.0: {} - - agent-base@6.0.2: - dependencies: - debug: 4.3.5 - transitivePeerDependencies: - - supports-color - - ansi-escapes@4.3.2: - dependencies: - type-fest: 0.21.3 - - ansi-regex@5.0.1: {} - - ansi-regex@6.0.1: {} - - ansi-styles@4.3.0: - dependencies: - color-convert: 2.0.1 - - ansi-styles@6.2.1: {} - - aproba@2.0.0: {} - - are-we-there-yet@2.0.0: - dependencies: - delegates: 1.0.0 - readable-stream: 3.6.2 - - argparse@1.0.10: - dependencies: - sprintf-js: 1.0.3 - - argparse@2.0.1: {} - - array-find-index@1.0.2: {} - - arrgv@1.0.2: {} - - arrify@3.0.0: {} - - async-sema@3.1.1: {} - - asynckit@0.4.0: {} - - ava@6.1.3: - dependencies: - '@vercel/nft': 0.26.5 - acorn: 8.12.0 - acorn-walk: 8.3.3 - ansi-styles: 6.2.1 - arrgv: 1.0.2 - arrify: 3.0.0 - callsites: 4.1.0 - cbor: 9.0.2 - chalk: 5.3.0 - chunkd: 2.0.1 - ci-info: 4.0.0 - ci-parallel-vars: 1.0.1 - cli-truncate: 4.0.0 - code-excerpt: 4.0.0 - common-path-prefix: 3.0.0 - concordance: 5.0.4 - currently-unhandled: 0.4.1 - debug: 4.3.5 - emittery: 1.0.3 - figures: 6.1.0 - globby: 14.0.1 - ignore-by-default: 2.1.0 - indent-string: 5.0.0 - is-plain-object: 5.0.0 - is-promise: 4.0.0 - matcher: 5.0.0 - memoize: 10.0.0 - ms: 2.1.3 - p-map: 7.0.2 - package-config: 5.0.0 - picomatch: 3.0.1 - plur: 5.1.0 - pretty-ms: 9.0.0 - resolve-cwd: 3.0.0 - stack-utils: 2.0.6 - strip-ansi: 7.1.0 - supertap: 3.0.1 - temp-dir: 3.0.0 - write-file-atomic: 5.0.1 - yargs: 17.7.2 - transitivePeerDependencies: - - encoding - - supports-color - - axios@1.6.2: - dependencies: - follow-redirects: 1.15.6 - form-data: 4.0.0 - proxy-from-env: 1.1.0 - transitivePeerDependencies: - - debug - - balanced-match@1.0.2: {} - - base64-js@1.5.1: {} - - before-after-hook@2.2.3: {} - - bindings@1.5.0: - dependencies: - file-uri-to-path: 1.0.0 - - bl@4.1.0: - dependencies: - buffer: 5.7.1 - inherits: 2.0.4 - readable-stream: 3.6.2 - - blueimp-md5@2.19.0: {} - - brace-expansion@1.1.11: - dependencies: - balanced-match: 1.0.2 - concat-map: 0.0.1 - - braces@3.0.3: - dependencies: - fill-range: 7.1.1 - - buffer@5.7.1: - dependencies: - base64-js: 1.5.1 - ieee754: 1.2.1 - - call-bind@1.0.7: - dependencies: - es-define-property: 1.0.0 - es-errors: 1.3.0 - function-bind: 1.1.2 - get-intrinsic: 1.2.4 - set-function-length: 1.2.2 - - callsites@4.1.0: {} - - camelize@1.0.1: {} - - cbor@9.0.2: - dependencies: - nofilter: 3.1.0 - - chalk@4.1.2: - dependencies: - ansi-styles: 4.3.0 - supports-color: 7.2.0 - - chalk@5.3.0: {} - - chardet@0.7.0: {} - - chownr@2.0.0: {} - - chunkd@2.0.1: {} - - ci-info@4.0.0: {} - - ci-parallel-vars@1.0.1: {} - - cli-cursor@3.1.0: - dependencies: - restore-cursor: 3.1.0 - - cli-spinners@2.9.2: {} - - cli-truncate@4.0.0: - dependencies: - slice-ansi: 5.0.0 - string-width: 7.1.0 - - cli-width@4.1.0: {} - - clipanion@3.2.1(typanion@3.14.0): - dependencies: - typanion: 3.14.0 - - cliui@8.0.1: - dependencies: - string-width: 4.2.3 - strip-ansi: 6.0.1 - wrap-ansi: 7.0.0 - - clone@1.0.4: {} - - code-excerpt@4.0.0: - dependencies: - convert-to-spaces: 2.0.1 - - color-convert@2.0.1: - dependencies: - color-name: 1.1.4 - - color-name@1.1.4: {} - - color-support@1.1.3: {} - - colorette@2.0.20: {} - - combined-stream@1.0.8: - dependencies: - delayed-stream: 1.0.0 - - common-path-prefix@3.0.0: {} - - concat-map@0.0.1: {} - - concordance@5.0.4: - dependencies: - date-time: 3.1.0 - esutils: 2.0.3 - fast-diff: 1.3.0 - js-string-escape: 1.0.1 - lodash: 4.17.21 - md5-hex: 3.0.1 - semver: 7.6.2 - well-known-symbols: 2.0.0 - - console-control-strings@1.1.0: {} - - convert-to-spaces@2.0.1: {} - - css-color-keywords@1.0.0: {} - - css-to-react-native@3.2.0: - dependencies: - camelize: 1.0.1 - css-color-keywords: 1.0.0 - postcss-value-parser: 4.2.0 - - csstype@3.1.3: {} - - currently-unhandled@0.4.1: - dependencies: - array-find-index: 1.0.2 - - date-time@3.1.0: - dependencies: - time-zone: 1.0.0 - - debug@4.3.5: - dependencies: - ms: 2.1.2 - - defaults@1.0.4: - dependencies: - clone: 1.0.4 - - define-data-property@1.1.4: - dependencies: - es-define-property: 1.0.0 - es-errors: 1.3.0 - gopd: 1.0.1 - - delayed-stream@1.0.0: {} - - delegates@1.0.0: {} - - deprecation@2.3.1: {} - - detect-libc@2.0.3: {} - - emittery@1.0.3: {} - - emnapi@1.2.0: {} - - emoji-regex@10.3.0: {} - - emoji-regex@8.0.0: {} - - es-define-property@1.0.0: - dependencies: - get-intrinsic: 1.2.4 - - es-errors@1.3.0: {} - - escalade@3.1.2: {} - - escape-string-regexp@2.0.0: {} - - escape-string-regexp@5.0.0: {} - - esprima@4.0.1: {} - - estree-walker@2.0.2: {} - - esutils@2.0.3: {} - - external-editor@3.1.0: - dependencies: - chardet: 0.7.0 - iconv-lite: 0.4.24 - tmp: 0.0.33 - - fast-diff@1.3.0: {} - - fast-glob@3.3.2: - dependencies: - '@nodelib/fs.stat': 2.0.5 - '@nodelib/fs.walk': 1.2.8 - glob-parent: 5.1.2 - merge2: 1.4.1 - micromatch: 4.0.7 - - fastq@1.17.1: - dependencies: - reusify: 1.0.4 - - figures@6.1.0: - dependencies: - is-unicode-supported: 2.0.0 - - file-uri-to-path@1.0.0: {} - - fill-range@7.1.1: - dependencies: - to-regex-range: 5.0.1 - - find-up-simple@1.0.0: {} - - follow-redirects@1.15.6: {} - - form-data@4.0.0: - dependencies: - asynckit: 0.4.0 - combined-stream: 1.0.8 - mime-types: 2.1.35 - - fs-minipass@2.1.0: - dependencies: - minipass: 3.3.6 - - fs.realpath@1.0.0: {} - - function-bind@1.1.2: {} - - gauge@3.0.2: - dependencies: - aproba: 2.0.0 - color-support: 1.1.3 - console-control-strings: 1.1.0 - has-unicode: 2.0.1 - object-assign: 4.1.1 - signal-exit: 3.0.7 - string-width: 4.2.3 - strip-ansi: 6.0.1 - wide-align: 1.1.5 - - get-caller-file@2.0.5: {} - - get-east-asian-width@1.2.0: {} - - get-intrinsic@1.2.4: - dependencies: - es-errors: 1.3.0 - function-bind: 1.1.2 - has-proto: 1.0.3 - has-symbols: 1.0.3 - hasown: 2.0.2 - - glob-parent@5.1.2: - dependencies: - is-glob: 4.0.3 - - glob@7.2.3: - dependencies: - fs.realpath: 1.0.0 - inflight: 1.0.6 - inherits: 2.0.4 - minimatch: 3.1.2 - once: 1.4.0 - path-is-absolute: 1.0.1 - - globby@14.0.1: - dependencies: - '@sindresorhus/merge-streams': 2.3.0 - fast-glob: 3.3.2 - ignore: 5.3.1 - path-type: 5.0.0 - slash: 5.1.0 - unicorn-magic: 0.1.0 - - gopd@1.0.1: - dependencies: - get-intrinsic: 1.2.4 - - graceful-fs@4.2.11: {} - - has-flag@4.0.0: {} - - has-property-descriptors@1.0.2: - dependencies: - es-define-property: 1.0.0 - - has-proto@1.0.3: {} - - has-symbols@1.0.3: {} - - has-unicode@2.0.1: {} - - hasown@2.0.2: - dependencies: - function-bind: 1.1.2 - - https-proxy-agent@5.0.1: - dependencies: - agent-base: 6.0.2 - debug: 4.3.5 - transitivePeerDependencies: - - supports-color - - iconv-lite@0.4.24: - dependencies: - safer-buffer: 2.1.2 - - ieee754@1.2.1: {} - - ignore-by-default@2.1.0: {} - - ignore@5.3.1: {} - - imurmurhash@0.1.4: {} - - indent-string@5.0.0: {} - - inflight@1.0.6: - dependencies: - once: 1.4.0 - wrappy: 1.0.2 - - inherits@2.0.4: {} - - inquirer@9.2.23: - dependencies: - '@inquirer/figures': 1.0.3 - '@ljharb/through': 2.3.13 - ansi-escapes: 4.3.2 - chalk: 5.3.0 - cli-cursor: 3.1.0 - cli-width: 4.1.0 - external-editor: 3.1.0 - lodash: 4.17.21 - mute-stream: 1.0.0 - ora: 5.4.1 - run-async: 3.0.0 - rxjs: 7.8.1 - string-width: 4.2.3 - strip-ansi: 6.0.1 - wrap-ansi: 6.2.0 - - irregular-plurals@3.5.0: {} - - is-extglob@2.1.1: {} - - is-fullwidth-code-point@3.0.0: {} - - is-fullwidth-code-point@4.0.0: {} - - is-glob@4.0.3: - dependencies: - is-extglob: 2.1.1 - - is-interactive@1.0.0: {} - - is-number@7.0.0: {} - - is-plain-object@5.0.0: {} - - is-promise@4.0.0: {} - - is-unicode-supported@0.1.0: {} - - is-unicode-supported@2.0.0: {} - - js-string-escape@1.0.1: {} - - js-tokens@4.0.0: {} - - js-yaml@3.14.1: - dependencies: - argparse: 1.0.10 - esprima: 4.0.1 - - js-yaml@4.1.0: - dependencies: - argparse: 2.0.1 - - load-json-file@7.0.1: {} - - lodash-es@4.17.21: {} - - lodash@4.17.21: {} - - log-symbols@4.1.0: - dependencies: - chalk: 4.1.2 - is-unicode-supported: 0.1.0 - - loose-envify@1.4.0: - dependencies: - js-tokens: 4.0.0 - - make-dir@3.1.0: - dependencies: - semver: 6.3.1 - - matcher@5.0.0: - dependencies: - escape-string-regexp: 5.0.0 - - md5-hex@3.0.1: - dependencies: - blueimp-md5: 2.19.0 - - memoize@10.0.0: - dependencies: - mimic-function: 5.0.1 - - merge2@1.4.1: {} - - micromatch@4.0.7: - dependencies: - braces: 3.0.3 - picomatch: 2.3.1 - - mime-db@1.52.0: {} - - mime-types@2.1.35: - dependencies: - mime-db: 1.52.0 - - mimic-fn@2.1.0: {} - - mimic-function@5.0.1: {} - - minimatch@3.1.2: - dependencies: - brace-expansion: 1.1.11 - - minipass@3.3.6: - dependencies: - yallist: 4.0.0 - - minipass@5.0.0: {} - - minizlib@2.1.2: - dependencies: - minipass: 3.3.6 - yallist: 4.0.0 - - mkdirp@1.0.4: {} - - ms@2.1.2: {} - - ms@2.1.3: {} - - mute-stream@1.0.0: {} - - nanoid@3.3.7: {} - - node-fetch@2.7.0: - dependencies: - whatwg-url: 5.0.0 - - node-gyp-build@4.8.1: {} - - nofilter@3.1.0: {} - - nopt@5.0.0: - dependencies: - abbrev: 1.1.1 - - npmlog@5.0.1: - dependencies: - are-we-there-yet: 2.0.0 - console-control-strings: 1.1.0 - gauge: 3.0.2 - set-blocking: 2.0.0 - - object-assign@4.1.1: {} - - once@1.4.0: - dependencies: - wrappy: 1.0.2 - - onetime@5.1.2: - dependencies: - mimic-fn: 2.1.0 - - ora@5.4.1: - dependencies: - bl: 4.1.0 - chalk: 4.1.2 - cli-cursor: 3.1.0 - cli-spinners: 2.9.2 - is-interactive: 1.0.0 - is-unicode-supported: 0.1.0 - log-symbols: 4.1.0 - strip-ansi: 6.0.1 - wcwidth: 1.0.1 - - os-tmpdir@1.0.2: {} - - p-map@7.0.2: {} - - package-config@5.0.0: - dependencies: - find-up-simple: 1.0.0 - load-json-file: 7.0.1 - - parse-ms@4.0.0: {} - - path-is-absolute@1.0.1: {} - - path-type@5.0.0: {} - - picocolors@1.0.1: {} - - picomatch@2.3.1: {} - - picomatch@3.0.1: {} - - plur@5.1.0: - dependencies: - irregular-plurals: 3.5.0 - - postcss-value-parser@4.2.0: {} - - postcss@8.4.33: - dependencies: - nanoid: 3.3.7 - picocolors: 1.0.1 - source-map-js: 1.2.0 - - pretty-ms@9.0.0: - dependencies: - parse-ms: 4.0.0 - - proxy-from-env@1.1.0: {} - - queue-microtask@1.2.3: {} - - react-dom@18.3.1(react@18.3.1): - dependencies: - loose-envify: 1.4.0 - react: 18.3.1 - scheduler: 0.23.2 - - react@18.3.1: - dependencies: - loose-envify: 1.4.0 - - readable-stream@3.6.2: - dependencies: - inherits: 2.0.4 - string_decoder: 1.3.0 - util-deprecate: 1.0.2 - - require-directory@2.1.1: {} - - resolve-cwd@3.0.0: - dependencies: - resolve-from: 5.0.0 - - resolve-from@5.0.0: {} - - restore-cursor@3.1.0: - dependencies: - onetime: 5.1.2 - signal-exit: 3.0.7 - - reusify@1.0.4: {} - - rimraf@3.0.2: - dependencies: - glob: 7.2.3 - - run-async@3.0.0: {} - - run-parallel@1.2.0: - dependencies: - queue-microtask: 1.2.3 - - rxjs@7.8.1: - dependencies: - tslib: 2.6.3 - - safe-buffer@5.2.1: {} - - safer-buffer@2.1.2: {} - - scheduler@0.23.2: - dependencies: - loose-envify: 1.4.0 - - semver@6.3.1: {} - - semver@7.6.2: {} - - serialize-error@7.0.1: - dependencies: - type-fest: 0.13.1 - - set-blocking@2.0.0: {} - - set-function-length@1.2.2: - 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 - - shallowequal@1.1.0: {} - - signal-exit@3.0.7: {} - - signal-exit@4.1.0: {} - - slash@5.1.0: {} - - slice-ansi@5.0.0: - dependencies: - ansi-styles: 6.2.1 - is-fullwidth-code-point: 4.0.0 - - source-map-js@1.2.0: {} - - sprintf-js@1.0.3: {} - - stack-utils@2.0.6: - dependencies: - escape-string-regexp: 2.0.0 - - string-width@4.2.3: - dependencies: - emoji-regex: 8.0.0 - is-fullwidth-code-point: 3.0.0 - strip-ansi: 6.0.1 - - string-width@7.1.0: - dependencies: - emoji-regex: 10.3.0 - get-east-asian-width: 1.2.0 - strip-ansi: 7.1.0 - - string_decoder@1.3.0: - dependencies: - safe-buffer: 5.2.1 - - strip-ansi@6.0.1: - dependencies: - ansi-regex: 5.0.1 - - strip-ansi@7.1.0: - dependencies: - ansi-regex: 6.0.1 - - styled-components@6.1.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1): - dependencies: - '@emotion/is-prop-valid': 1.2.2 - '@emotion/unitless': 0.8.1 - '@types/stylis': 4.2.6 - css-to-react-native: 3.2.0 - csstype: 3.1.3 - postcss: 8.4.33 - react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) - shallowequal: 1.1.0 - stylis: 4.3.2 - tslib: 2.6.3 - - stylis@4.3.2: {} - - supertap@3.0.1: - dependencies: - indent-string: 5.0.0 - js-yaml: 3.14.1 - serialize-error: 7.0.1 - strip-ansi: 7.1.0 - - supports-color@7.2.0: - dependencies: - has-flag: 4.0.0 - - tar@6.2.1: - dependencies: - chownr: 2.0.0 - fs-minipass: 2.1.0 - minipass: 5.0.0 - minizlib: 2.1.2 - mkdirp: 1.0.4 - yallist: 4.0.0 - - temp-dir@3.0.0: {} - - time-zone@1.0.0: {} - - tmp@0.0.33: - dependencies: - os-tmpdir: 1.0.2 - - to-regex-range@5.0.1: - dependencies: - is-number: 7.0.0 - - toml@3.0.0: {} - - tr46@0.0.3: {} - - tslib@2.6.3: {} - - typanion@3.14.0: {} - - type-fest@0.13.1: {} - - type-fest@0.21.3: {} - - typescript@5.5.2: {} - - undici-types@5.26.5: {} - - unicorn-magic@0.1.0: {} - - universal-user-agent@6.0.1: {} - - util-deprecate@1.0.2: {} - - wasm-sjlj@1.0.5: {} - - wcwidth@1.0.1: - dependencies: - defaults: 1.0.4 - - webidl-conversions@3.0.1: {} - - well-known-symbols@2.0.0: {} - - whatwg-url@5.0.0: - dependencies: - tr46: 0.0.3 - webidl-conversions: 3.0.1 - - wide-align@1.1.5: - dependencies: - string-width: 4.2.3 - - wrap-ansi@6.2.0: - dependencies: - ansi-styles: 4.3.0 - string-width: 4.2.3 - strip-ansi: 6.0.1 - - wrap-ansi@7.0.0: - dependencies: - ansi-styles: 4.3.0 - string-width: 4.2.3 - strip-ansi: 6.0.1 - - wrappy@1.0.2: {} - - write-file-atomic@5.0.1: - dependencies: - imurmurhash: 0.1.4 - signal-exit: 4.1.0 - - y18n@5.0.8: {} - - yallist@4.0.0: {} - - yargs-parser@21.1.1: {} - - yargs@17.7.2: - dependencies: - cliui: 8.0.1 - escalade: 3.1.2 - get-caller-file: 2.0.5 - require-directory: 2.1.1 - string-width: 4.2.3 - y18n: 5.0.8 - yargs-parser: 21.1.1 diff --git a/src/builtins.rs b/src/builtins.rs deleted file mode 100644 index 45a25117..00000000 --- a/src/builtins.rs +++ /dev/null @@ -1,71 +0,0 @@ -/// Node.js built-in modules -/// -/// `node -p "[...require('module').builtinModules].map(b => JSON.stringify(b)).join(',\n')"` -/// -pub const NODEJS_BUILTINS: &[&str] = &[ - "_http_agent", - "_http_client", - "_http_common", - "_http_incoming", - "_http_outgoing", - "_http_server", - "_stream_duplex", - "_stream_passthrough", - "_stream_readable", - "_stream_transform", - "_stream_wrap", - "_stream_writable", - "_tls_common", - "_tls_wrap", - "assert", - "assert/strict", - "async_hooks", - "buffer", - "child_process", - "cluster", - "console", - "constants", - "crypto", - "dgram", - "diagnostics_channel", - "dns", - "dns/promises", - "domain", - "events", - "fs", - "fs/promises", - "http", - "http2", - "https", - "inspector", - "module", - "net", - "os", - "path", - "path/posix", - "path/win32", - "perf_hooks", - "process", - "punycode", - "querystring", - "readline", - "repl", - "stream", - "stream/consumers", - "stream/promises", - "stream/web", - "string_decoder", - "sys", - "timers", - "timers/promises", - "tls", - "trace_events", - "tty", - "url", - "util", - "util/types", - "v8", - "vm", - "worker_threads", - "zlib", -]; diff --git a/src/cache.rs b/src/cache.rs deleted file mode 100644 index a1bde36c..00000000 --- a/src/cache.rs +++ /dev/null @@ -1,369 +0,0 @@ -use once_cell::sync::OnceCell as OnceLock; -use std::{ - borrow::{Borrow, Cow}, - convert::AsRef, - hash::{BuildHasherDefault, Hash, Hasher}, - io, - ops::Deref, - path::{Path, PathBuf}, - sync::Arc, -}; - -use dashmap::{DashMap, DashSet}; -use rustc_hash::FxHasher; - -use crate::{ - context::ResolveContext as Ctx, package_json::PackageJson, path::PathUtil, FileMetadata, - FileSystem, ResolveError, ResolveOptions, TsConfig, -}; - -#[derive(Default)] -pub struct Cache { - pub(crate) fs: Fs, - paths: DashSet>, - tsconfigs: DashMap, BuildHasherDefault>, -} - -impl Cache { - pub fn new(fs: Fs) -> Self { - Self { fs, paths: DashSet::default(), tsconfigs: DashMap::default() } - } - - pub fn clear(&self) { - self.paths.clear(); - self.tsconfigs.clear(); - } - - pub fn value(&self, path: &Path) -> CachedPath { - let hash = { - let mut hasher = FxHasher::default(); - path.hash(&mut hasher); - hasher.finish() - }; - if let Some(cache_entry) = self.paths.get((hash, path).borrow() as &dyn CacheKey) { - return cache_entry.clone(); - } - let parent = path.parent().map(|p| self.value(p)); - let data = CachedPath(Arc::new(CachedPathImpl::new( - hash, - path.to_path_buf().into_boxed_path(), - parent, - ))); - self.paths.insert(data.clone()); - data - } - - pub fn tsconfig Result<(), ResolveError>>( - &self, - root: bool, - path: &Path, - callback: F, // callback for modifying tsconfig with `extends` - ) -> Result, ResolveError> { - if let Some(tsconfig_ref) = self.tsconfigs.get(path) { - return Ok(Arc::clone(tsconfig_ref.value())); - } - let meta = self.fs.metadata(path).ok(); - let tsconfig_path = if meta.is_some_and(|m| m.is_file) { - Cow::Borrowed(path) - } else if meta.is_some_and(|m| m.is_dir) { - Cow::Owned(path.join("tsconfig.json")) - } else { - let mut os_string = path.to_path_buf().into_os_string(); - os_string.push(".json"); - Cow::Owned(PathBuf::from(os_string)) - }; - let mut tsconfig_string = self - .fs - .read_to_string(&tsconfig_path) - .map_err(|_| ResolveError::TsconfigNotFound(path.to_path_buf()))?; - let mut tsconfig = - TsConfig::parse(root, &tsconfig_path, &mut tsconfig_string).map_err(|error| { - ResolveError::from_serde_json_error(tsconfig_path.to_path_buf(), &error) - })?; - callback(&mut tsconfig)?; - let tsconfig = Arc::new(tsconfig.build()); - self.tsconfigs.insert(path.to_path_buf(), Arc::clone(&tsconfig)); - Ok(tsconfig) - } -} - -#[derive(Clone)] -pub struct CachedPath(Arc); - -impl Hash for CachedPath { - fn hash(&self, state: &mut H) { - self.0.hash.hash(state); - } -} - -impl PartialEq for CachedPath { - fn eq(&self, other: &Self) -> bool { - self.0.path == other.0.path - } -} -impl Eq for CachedPath {} - -impl Deref for CachedPath { - type Target = CachedPathImpl; - - fn deref(&self) -> &Self::Target { - self.0.as_ref() - } -} - -impl<'a> Borrow for CachedPath { - fn borrow(&self) -> &(dyn CacheKey + 'a) { - self - } -} - -impl AsRef for CachedPath { - fn as_ref(&self) -> &CachedPathImpl { - self.0.as_ref() - } -} - -impl CacheKey for CachedPath { - fn tuple(&self) -> (u64, &Path) { - (self.hash, &self.path) - } -} - -pub struct CachedPathImpl { - hash: u64, - path: Box, - parent: Option, - meta: OnceLock>, - symlink: OnceLock>, - canonicalized: OnceLock>, - node_modules: OnceLock>, - package_json: OnceLock>>, -} - -impl CachedPathImpl { - fn new(hash: u64, path: Box, parent: Option) -> Self { - Self { - hash, - path, - parent, - meta: OnceLock::new(), - symlink: OnceLock::new(), - canonicalized: OnceLock::new(), - node_modules: OnceLock::new(), - package_json: OnceLock::new(), - } - } - - pub fn path(&self) -> &Path { - &self.path - } - - pub fn to_path_buf(&self) -> PathBuf { - self.path.to_path_buf() - } - - pub fn parent(&self) -> Option<&CachedPath> { - self.parent.as_ref() - } - - fn meta(&self, fs: &Fs) -> Option { - *self.meta.get_or_init(|| fs.metadata(&self.path).ok()) - } - - pub fn is_file(&self, fs: &Fs, ctx: &mut Ctx) -> bool { - if let Some(meta) = self.meta(fs) { - ctx.add_file_dependency(self.path()); - meta.is_file - } else { - ctx.add_missing_dependency(self.path()); - false - } - } - - pub fn is_dir(&self, fs: &Fs, ctx: &mut Ctx) -> bool { - self.meta(fs).map_or_else( - || { - ctx.add_missing_dependency(self.path()); - false - }, - |meta| meta.is_dir, - ) - } - - fn symlink(&self, fs: &Fs) -> io::Result> { - self.symlink - .get_or_try_init(|| { - if let Ok(symlink_metadata) = fs.symlink_metadata(&self.path) { - if symlink_metadata.is_symlink { - return fs.canonicalize(self.path()).map(Some); - } - } - Ok(None) - }) - .cloned() - } - - pub fn realpath(&self, fs: &Fs) -> io::Result { - self.canonicalized - .get_or_try_init(|| { - if let Some(link) = self.symlink(fs)? { - return Ok(Some(link)); - } - if let Some(parent) = self.parent() { - let parent_path = parent.realpath(fs)?; - return Ok(Some( - parent_path.normalize_with(self.path.strip_prefix(&parent.path).unwrap()), - )); - }; - Ok(None) - }) - .cloned() - .map(|r| r.unwrap_or_else(|| self.path.clone().to_path_buf())) - } - - pub fn module_directory( - &self, - module_name: &str, - cache: &Cache, - ctx: &mut Ctx, - ) -> Option { - let cached_path = cache.value(&self.path.join(module_name)); - cached_path.is_dir(&cache.fs, ctx).then_some(cached_path) - } - - pub fn cached_node_modules( - &self, - cache: &Cache, - ctx: &mut Ctx, - ) -> Option { - self.node_modules.get_or_init(|| self.module_directory("node_modules", cache, ctx)).clone() - } - - /// Find package.json of a path by traversing parent directories. - /// - /// # Errors - /// - /// * [ResolveError::JSON] - pub fn find_package_json( - &self, - fs: &Fs, - options: &ResolveOptions, - ctx: &mut Ctx, - ) -> Result>, ResolveError> { - let mut cache_value = self; - // Go up directories when the querying path is not a directory - while !cache_value.is_dir(fs, ctx) { - if let Some(cv) = &cache_value.parent { - cache_value = cv.as_ref(); - } else { - break; - } - } - let mut cache_value = Some(cache_value); - while let Some(cv) = cache_value { - if let Some(package_json) = cv.package_json(fs, options, ctx)? { - return Ok(Some(Arc::clone(&package_json))); - } - cache_value = cv.parent.as_deref(); - } - Ok(None) - } - - /// Get package.json of the given path. - /// - /// # Errors - /// - /// * [ResolveError::JSON] - pub fn package_json( - &self, - fs: &Fs, - options: &ResolveOptions, - ctx: &mut Ctx, - ) -> Result>, ResolveError> { - // Change to `std::sync::OnceLock::get_or_try_init` when it is stable. - let result = self - .package_json - .get_or_try_init(|| { - let package_json_path = self.path.join("package.json"); - let Ok(package_json_string) = fs.read_to_string(&package_json_path) else { - return Ok(None); - }; - let real_path = if options.symlinks { - self.realpath(fs)?.join("package.json") - } else { - package_json_path.clone() - }; - PackageJson::parse(package_json_path.clone(), real_path, &package_json_string) - .map(Arc::new) - .map(Some) - .map_err(|error| ResolveError::from_serde_json_error(package_json_path, &error)) - }) - .cloned(); - // https://github.com/webpack/enhanced-resolve/blob/58464fc7cb56673c9aa849e68e6300239601e615/lib/DescriptionFileUtils.js#L68-L82 - match &result { - Ok(Some(package_json)) => { - ctx.add_file_dependency(&package_json.path); - } - Ok(None) => { - // Avoid an allocation by making this lazy - if let Some(deps) = &mut ctx.missing_dependencies { - deps.push(self.path.join("package.json")); - } - } - Err(_) => { - if let Some(deps) = &mut ctx.file_dependencies { - deps.push(self.path.join("package.json")); - } - } - } - result - } -} - -/// Memoized cache key, code adapted from . -trait CacheKey { - fn tuple(&self) -> (u64, &Path); -} - -impl Hash for dyn CacheKey + '_ { - fn hash(&self, state: &mut H) { - self.tuple().0.hash(state); - } -} - -impl PartialEq for dyn CacheKey + '_ { - fn eq(&self, other: &Self) -> bool { - self.tuple().1 == other.tuple().1 - } -} - -impl Eq for dyn CacheKey + '_ {} - -impl<'a> CacheKey for (u64, &'a Path) { - fn tuple(&self) -> (u64, &Path) { - (self.0, self.1) - } -} - -impl<'a> Borrow for (u64, &'a Path) { - fn borrow(&self) -> &(dyn CacheKey + 'a) { - self - } -} - -/// Since the cache key is memoized, use an identity hasher -/// to avoid double cache. -#[derive(Default)] -struct IdentityHasher(u64); - -impl Hasher for IdentityHasher { - fn write(&mut self, _: &[u8]) { - unreachable!("Invalid use of IdentityHasher") - } - fn write_u64(&mut self, n: u64) { - self.0 = n; - } - fn finish(&self) -> u64 { - self.0 - } -} diff --git a/src/context.rs b/src/context.rs deleted file mode 100644 index 9349de30..00000000 --- a/src/context.rs +++ /dev/null @@ -1,89 +0,0 @@ -use std::{ - ops::{Deref, DerefMut}, - path::{Path, PathBuf}, -}; - -use crate::error::ResolveError; - -#[derive(Debug, Default, Clone)] -pub struct ResolveContext(ResolveContextImpl); - -#[derive(Debug, Default, Clone)] -pub struct ResolveContextImpl { - pub fully_specified: bool, - - pub query: Option, - - pub fragment: Option, - - /// Files that was found on file system - pub file_dependencies: Option>, - - /// Files that was found on file system - pub missing_dependencies: Option>, - - /// The current resolving alias for bailing recursion alias. - pub resolving_alias: Option, - - /// For avoiding infinite recursion, which will cause stack overflow. - depth: u8, -} - -impl Deref for ResolveContext { - type Target = ResolveContextImpl; - - fn deref(&self) -> &Self::Target { - &self.0 - } -} - -impl DerefMut for ResolveContext { - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} - -impl ResolveContext { - pub fn with_fully_specified(&mut self, yes: bool) { - self.fully_specified = yes; - } - - pub fn with_query_fragment(&mut self, query: Option<&str>, fragment: Option<&str>) { - if let Some(query) = query { - self.query.replace(query.to_string()); - } - if let Some(fragment) = fragment { - self.fragment.replace(fragment.to_string()); - } - } - - pub fn init_file_dependencies(&mut self) { - self.file_dependencies.replace(vec![]); - self.missing_dependencies.replace(vec![]); - } - - pub fn add_file_dependency(&mut self, dep: &Path) { - if let Some(deps) = &mut self.file_dependencies { - deps.push(dep.to_path_buf()); - } - } - - pub fn add_missing_dependency(&mut self, dep: &Path) { - if let Some(deps) = &mut self.missing_dependencies { - deps.push(dep.to_path_buf()); - } - } - - pub fn with_resolving_alias(&mut self, alias: String) { - self.resolving_alias = Some(alias); - } - - pub fn test_for_infinite_recursion(&mut self) -> Result<(), ResolveError> { - self.depth += 1; - // 64 should be more than enough for detecting infinite recursion. - if self.depth > 64 { - return Err(ResolveError::Recursion); - } - Ok(()) - } -} diff --git a/src/error.rs b/src/error.rs deleted file mode 100644 index ff2aaa4f..00000000 --- a/src/error.rs +++ /dev/null @@ -1,160 +0,0 @@ -use std::{io, path::PathBuf, sync::Arc}; -use thiserror::Error; - -/// All resolution errors -/// -/// `thiserror` is used to display meaningful error messages. -#[derive(Debug, Clone, PartialEq, Error)] -pub enum ResolveError { - /// Ignored path - /// - /// Derived from ignored path (false value) from browser field in package.json - /// ```json - /// { - /// "browser": { - /// "./module": false - /// } - /// } - /// ``` - /// See - #[error("Path is ignored {0}")] - Ignored(PathBuf), - - /// Module not found - #[error("Cannot find module '{0}'")] - NotFound(/* specifier */ String), - - /// Tsconfig not found - #[error("Tsconfig not found {0}")] - TsconfigNotFound(PathBuf), - - #[error("{0}")] - IOError(IOError), - - /// Node.js builtin modules - /// - /// This is an error due to not being a Node.js runtime. - /// The `alias` option can be used to resolve a builtin module to a polyfill. - #[error("Builtin module {0}")] - Builtin(String), - - /// All of the aliased extension are not found - #[error("All of the aliased extension are not found")] - ExtensionAlias, - - /// The provided path specifier cannot be parsed - #[error("{0}")] - Specifier(SpecifierError), - - /// JSON parse error - #[error("{0:?}")] - JSON(JSONError), - - /// Restricted by `ResolveOptions::restrictions` - #[error(r#"Path "{0}" restricted by {0}"#)] - Restriction(PathBuf, PathBuf), - - #[error(r#"Invalid module "{0}" specifier is not a valid subpath for the "exports" resolution of {1}"#)] - InvalidModuleSpecifier(String, PathBuf), - - #[error(r#"Invalid "exports" target "{0}" defined for '{1}' in the package config {2}"#)] - InvalidPackageTarget(String, String, PathBuf), - - #[error(r#"Package subpath '{0}' is not defined by "exports" in {1}"#)] - PackagePathNotExported(String, PathBuf), - - #[error(r#"Invalid package config "{0}", "exports" cannot contain some keys starting with '.' and some not. The exports object must either be an object of package subpath keys or an object of main entry condition name keys only."#)] - InvalidPackageConfig(PathBuf), - - #[error(r#"Default condition should be last one in "{0}""#)] - InvalidPackageConfigDefault(PathBuf), - - #[error(r#"Expecting folder to folder mapping. "{0}" should end with "/"#)] - InvalidPackageConfigDirectory(PathBuf), - - #[error(r#"Package import specifier "{0}" is not defined in package {1}"#)] - PackageImportNotDefined(String, PathBuf), - - #[error("{0} is unimplemented")] - Unimplemented(&'static str), - - /// Occurs when alias paths reference each other. - #[error("Recursion in resolving")] - Recursion, -} - -impl ResolveError { - pub fn is_ignore(&self) -> bool { - matches!(self, Self::Ignored(_)) - } - - pub(crate) fn from_serde_json_error(path: PathBuf, error: &serde_json::Error) -> Self { - Self::JSON(JSONError { - path, - message: error.to_string(), - line: error.line(), - column: error.column(), - }) - } -} - -/// Error for [ResolveError::Specifier] -#[derive(Debug, Clone, Eq, PartialEq, Error)] -pub enum SpecifierError { - #[error("The specifiers must be a non-empty string. Received \"{0}\"")] - Empty(String), -} - -/// JSON error from [serde_json::Error] -#[derive(Debug, Clone, Eq, PartialEq)] -pub struct JSONError { - pub path: PathBuf, - pub message: String, - pub line: usize, - pub column: usize, -} - -#[derive(Debug, Clone, Error)] -#[error("{0}")] -pub struct IOError(Arc); - -impl PartialEq for IOError { - fn eq(&self, other: &Self) -> bool { - self.0.kind() == other.0.kind() - } -} - -impl From for io::Error { - fn from(error: IOError) -> Self { - let io_error = error.0.as_ref(); - Self::new(io_error.kind(), io_error.to_string()) - } -} - -impl From for ResolveError { - fn from(err: io::Error) -> Self { - Self::IOError(IOError(Arc::new(err))) - } -} - -#[test] -fn test_into_io_error() { - use std::io::{self, ErrorKind}; - let error_string = "IOError occurred"; - let string_error = io::Error::new(ErrorKind::Interrupted, error_string.to_string()); - let string_error2 = io::Error::new(ErrorKind::Interrupted, error_string.to_string()); - let resolve_io_error: ResolveError = ResolveError::from(string_error2); - - assert_eq!(resolve_io_error, ResolveError::from(string_error)); - assert_eq!(resolve_io_error.clone(), resolve_io_error); - if let ResolveError::IOError(io_error) = resolve_io_error { - // fix for https://github.com/web-infra-dev/rspack/issues/4564 - let std_io_error: io::Error = io_error.into(); - assert_eq!(std_io_error.kind(), ErrorKind::Interrupted); - assert_eq!(std_io_error.to_string(), error_string); - assert_eq!( - format!("{std_io_error:?}"), - r#"Custom { kind: Interrupted, error: "IOError occurred" }"# - ); - } -} diff --git a/src/file_system.rs b/src/file_system.rs deleted file mode 100644 index 04d177de..00000000 --- a/src/file_system.rs +++ /dev/null @@ -1,133 +0,0 @@ -use std::{ - fs, io, - path::{Path, PathBuf}, -}; - -/// File System abstraction used for `ResolverGeneric` -pub trait FileSystem: Send + Sync { - /// See [std::fs::read_to_string] - /// - /// # Errors - /// - /// * See [std::fs::read_to_string] - /// ## Warning - /// Use `&Path` instead of a generic `P: AsRef` here, - /// because object safety requirements, it is especially useful, when - /// you want to store multiple `dyn FileSystem` in a `Vec` or use a `ResolverGeneric` in - /// napi env. - fn read_to_string(&self, path: &Path) -> io::Result; - - /// See [std::fs::metadata] - /// - /// # Errors - /// See [std::fs::metadata] - /// ## Warning - /// Use `&Path` instead of a generic `P: AsRef` here, - /// because object safety requirements, it is especially useful, when - /// you want to store multiple `dyn FileSystem` in a `Vec` or use a `ResolverGeneric` in - /// napi env. - fn metadata(&self, path: &Path) -> io::Result; - - /// See [std::fs::symlink_metadata] - /// - /// # Errors - /// - /// See [std::fs::symlink_metadata] - /// ## Warning - /// Use `&Path` instead of a generic `P: AsRef` here, - /// because object safety requirements, it is especially useful, when - /// you want to store multiple `dyn FileSystem` in a `Vec` or use a `ResolverGeneric` in - /// napi env. - fn symlink_metadata(&self, path: &Path) -> io::Result; - - /// See [std::fs::canonicalize] - /// - /// # Errors - /// - /// See [std::fs::read_link] - /// ## Warning - /// Use `&Path` instead of a generic `P: AsRef` here, - /// because object safety requirements, it is especially useful, when - /// you want to store multiple `dyn FileSystem` in a `Vec` or use a `ResolverGeneric` in - /// napi env. - fn canonicalize(&self, path: &Path) -> io::Result; -} - -/// Metadata information about a file -#[derive(Debug, Clone, Copy)] -pub struct FileMetadata { - pub(crate) is_file: bool, - pub(crate) is_dir: bool, - pub(crate) is_symlink: bool, -} - -impl FileMetadata { - pub fn new(is_file: bool, is_dir: bool, is_symlink: bool) -> Self { - Self { is_file, is_dir, is_symlink } - } -} - -impl From for FileMetadata { - fn from(metadata: fs::Metadata) -> Self { - Self::new(metadata.is_file(), metadata.is_dir(), metadata.is_symlink()) - } -} - -/// Operating System -#[derive(Default)] -pub struct FileSystemOs; - -impl FileSystem for FileSystemOs { - fn read_to_string(&self, path: &Path) -> io::Result { - fs::read_to_string(path) - } - - fn metadata(&self, path: &Path) -> io::Result { - fs::metadata(path).map(FileMetadata::from) - } - - fn symlink_metadata(&self, path: &Path) -> io::Result { - fs::symlink_metadata(path).map(FileMetadata::from) - } - - fn canonicalize(&self, path: &Path) -> io::Result { - #[cfg(not(target_os = "wasi"))] - { - dunce::canonicalize(path) - } - #[cfg(target_os = "wasi")] - { - let meta = fs::symlink_metadata(path)?; - if meta.file_type().is_symlink() { - let link = fs::read_link(path)?; - let mut path_buf = path.to_path_buf(); - path_buf.pop(); - for segment in link.iter() { - match segment.to_str() { - Some("..") => { - path_buf.pop(); - } - Some(".") | None => {} - Some(seg) => { - // Need to trim the extra \0 introduces by rust std rust-lang/rust#123727 - path_buf.push(seg.trim_end_matches('\0')); - } - } - } - Ok(path_buf) - } else { - Ok(path.to_path_buf()) - } - } - } -} - -#[test] -fn metadata() { - let meta = FileMetadata { is_file: true, is_dir: true, is_symlink: true }; - assert_eq!( - format!("{meta:?}"), - "FileMetadata { is_file: true, is_dir: true, is_symlink: true }" - ); - let _ = meta; -} diff --git a/src/lib.rs b/src/lib.rs deleted file mode 100644 index 8ec2ad8a..00000000 --- a/src/lib.rs +++ /dev/null @@ -1,1670 +0,0 @@ -//! # Oxc Resolver -//! -//! Node.js [CommonJS][cjs] and [ECMAScript][esm] Module Resolution. -//! -//! A module resolution is the process of finding the file referenced by a module specifier in -//! `import "specifier"` or `require("specifier")`. -//! -//! All [configuration options](ResolveOptions) are aligned with webpack's [enhanced-resolve]. -//! -//! ## Terminology -//! -//! ### Specifier -//! -//! For [CommonJS modules][cjs], -//! the specifier is the string passed to the `require` function. e.g. `"id"` in `require("id")`. -//! -//! For [ECMAScript modules][esm], -//! the specifier of an `import` statement is the string after the `from` keyword, -//! e.g. `'specifier'` in `import 'specifier'` or `import { sep } from 'specifier'`. -//! Specifiers are also used in export from statements, and as the argument to an `import()` expression. -//! -//! This is also named "request" in some places. -//! -//! ## References: -//! -//! * Algorithm adapted from Node.js [CommonJS Module Resolution Algorithm] and [ECMAScript Module Resolution Algorithm]. -//! * Tests are ported from [enhanced-resolve]. -//! * Some code is adapted from [parcel-resolver]. -//! * The documentation is copied from [webpack's resolve configuration](https://webpack.js.org/configuration/resolve). -//! -//! [enhanced-resolve]: https://github.com/webpack/enhanced-resolve -//! [CommonJS Module Resolution Algorithm]: https://nodejs.org/api/modules.html#all-together -//! [ECMAScript Module Resolution Algorithm]: https://nodejs.org/api/esm.html#resolution-algorithm-specification -//! [parcel-resolver]: https://github.com/parcel-bundler/parcel/blob/v2/packages/utils/node-resolver-rs -//! [cjs]: https://nodejs.org/api/modules.html -//! [esm]: https://nodejs.org/api/esm.html -//! -//! ## Feature flags -#![cfg_attr(feature = "document-features", doc = document_features::document_features!())] -#![cfg_attr(docsrs, feature(doc_auto_cfg))] -//! -//! ## Example -//! -//! ```rust,ignore -#![doc = include_str!("../examples/resolver.rs")] -//! ``` - -mod builtins; -mod cache; -mod context; -mod error; -mod file_system; -mod options; -mod package_json; -mod path; -mod resolution; -mod specifier; -mod tsconfig; - -#[cfg(test)] -mod tests; - -use std::{ - borrow::Cow, - cmp::Ordering, - ffi::OsStr, - fmt, - path::{Component, Path, PathBuf}, - sync::Arc, -}; - -use rustc_hash::FxHashSet; -use serde_json::Value as JSONValue; -use typescript_tsconfig_json::ExtendsField; - -pub use crate::{ - builtins::NODEJS_BUILTINS, - error::{JSONError, ResolveError, SpecifierError}, - file_system::{FileMetadata, FileSystem}, - options::{ - Alias, AliasValue, EnforceExtension, ResolveOptions, Restriction, TsconfigOptions, - TsconfigReferences, - }, - package_json::PackageJson, - resolution::Resolution, -}; -use crate::{ - cache::{Cache, CachedPath}, - context::ResolveContext as Ctx, - file_system::FileSystemOs, - package_json::JSONMap, - path::{PathUtil, SLASH_START}, - specifier::Specifier, - tsconfig::{ProjectReference, TsConfig}, -}; - -type ResolveResult = Result, ResolveError>; - -/// Context returned from the [Resolver::resolve_with_context] API -#[derive(Debug, Default, Clone)] -pub struct ResolveContext { - /// Files that was found on file system - pub file_dependencies: FxHashSet, - - /// Dependencies that was not found on file system - pub missing_dependencies: FxHashSet, -} - -/// Resolver with the current operating system as the file system -pub type Resolver = ResolverGeneric; - -/// Generic implementation of the resolver, can be configured by the [FileSystem] trait -pub struct ResolverGeneric { - options: ResolveOptions, - cache: Arc>, -} - -impl fmt::Debug for ResolverGeneric { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - self.options.fmt(f) - } -} - -impl Default for ResolverGeneric { - fn default() -> Self { - Self::new(ResolveOptions::default()) - } -} - -impl ResolverGeneric { - pub fn new(options: ResolveOptions) -> Self { - Self { options: options.sanitize(), cache: Arc::new(Cache::new(Fs::default())) } - } -} - -impl ResolverGeneric { - pub fn new_with_file_system(file_system: Fs, options: ResolveOptions) -> Self { - Self { cache: Arc::new(Cache::new(file_system)), options: options.sanitize() } - } - - /// Clone the resolver using the same underlying cache. - #[must_use] - pub fn clone_with_options(&self, options: ResolveOptions) -> Self { - Self { options: options.sanitize(), cache: Arc::clone(&self.cache) } - } - - /// Returns the options. - pub fn options(&self) -> &ResolveOptions { - &self.options - } - - /// Clear the underlying cache. - pub fn clear_cache(&self) { - self.cache.clear(); - } - - /// Resolve `specifier` at an absolute `path`. - /// - /// A specifier is the string passed to require or import, i.e. `require("specifier")` or `import "specifier"`. - /// - /// `path` must be an **absolute** path to a directory where the specifier is resolved against. - /// For CommonJS modules, it is the `__dirname` variable that contains the absolute path to the folder containing current module. - /// For ECMAScript modules, it is the value of `import.meta.url`. - /// - /// # Errors - /// - /// * See [ResolveError] - pub fn resolve>( - &self, - path: P, - specifier: &str, - ) -> Result { - let mut ctx = Ctx::default(); - self.resolve_tracing(path.as_ref(), specifier, &mut ctx) - } - - /// Resolve `specifier` at absolute `path` with [ResolveContext] - /// - /// # Errors - /// - /// * See [ResolveError] - pub fn resolve_with_context>( - &self, - path: P, - specifier: &str, - resolve_context: &mut ResolveContext, - ) -> Result { - let mut ctx = Ctx::default(); - ctx.init_file_dependencies(); - let result = self.resolve_tracing(path.as_ref(), specifier, &mut ctx); - if let Some(deps) = &mut ctx.file_dependencies { - resolve_context.file_dependencies.extend(deps.drain(..)); - } - if let Some(deps) = &mut ctx.missing_dependencies { - resolve_context.missing_dependencies.extend(deps.drain(..)); - } - result - } - - /// Wrap `resolve_impl` with `tracing` information - fn resolve_tracing( - &self, - path: &Path, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - let span = tracing::debug_span!("resolve", path = ?path, specifier = specifier); - let _enter = span.enter(); - let r = self.resolve_impl(path, specifier, ctx); - match &r { - Ok(r) => { - tracing::debug!(options = ?self.options, path = ?path, specifier = specifier, ret = ?r.path); - } - Err(err) => { - tracing::debug!(options = ?self.options, path = ?path, specifier = specifier, err = ?err); - } - }; - r - } - - fn resolve_impl( - &self, - path: &Path, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - ctx.with_fully_specified(self.options.fully_specified); - let cached_path = self.cache.value(path); - let cached_path = self.require(&cached_path, specifier, ctx)?; - let path = self.load_realpath(&cached_path)?; - // enhanced-resolve: restrictions - self.check_restrictions(&path)?; - let package_json = cached_path.find_package_json(&self.cache.fs, &self.options, ctx)?; - if let Some(package_json) = &package_json { - // path must be inside the package. - debug_assert!(path.starts_with(package_json.directory())); - } - Ok(Resolution { - path, - query: ctx.query.take(), - fragment: ctx.fragment.take(), - package_json, - }) - } - - /// require(X) from module at path Y - /// - /// X: specifier - /// Y: path - /// - /// - fn require( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - ctx.test_for_infinite_recursion()?; - - // enhanced-resolve: parse - let (parsed, try_fragment_as_path) = self.load_parse(cached_path, specifier, ctx)?; - if let Some(path) = try_fragment_as_path { - return Ok(path); - } - - self.require_without_parse(cached_path, parsed.path(), ctx) - } - - fn require_without_parse( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - // tsconfig-paths - if let Some(path) = self.load_tsconfig_paths(cached_path, specifier, &mut Ctx::default())? { - return Ok(path); - } - - // enhanced-resolve: try alias - if let Some(path) = self.load_alias(cached_path, specifier, &self.options.alias, ctx)? { - return Ok(path); - } - - let result = match Path::new(specifier).components().next() { - // 2. If X begins with '/' - Some(Component::RootDir | Component::Prefix(_)) => { - self.require_absolute(cached_path, specifier, ctx) - } - // 3. If X begins with './' or '/' or '../' - Some(Component::CurDir | Component::ParentDir) => { - self.require_relative(cached_path, specifier, ctx) - } - // 4. If X begins with '#' - Some(Component::Normal(_)) if specifier.as_bytes()[0] == b'#' => { - self.require_hash(cached_path, specifier, ctx) - } - _ => { - // 1. If X is a core module, - // a. return the core module - // b. STOP - self.require_core(specifier)?; - - // (ESM) 5. Otherwise, - // Note: specifier is now a bare specifier. - // Set resolved the result of PACKAGE_RESOLVE(specifier, parentURL). - self.require_bare(cached_path, specifier, ctx) - } - }; - - result.or_else(|err| { - if err.is_ignore() { - return Err(err); - } - // enhanced-resolve: try fallback - self.load_alias(cached_path, specifier, &self.options.fallback, ctx) - .and_then(|value| value.ok_or(err)) - }) - } - - // PACKAGE_RESOLVE(packageSpecifier, parentURL) - // 3. If packageSpecifier is a Node.js builtin module name, then - // 1. Return the string "node:" concatenated with packageSpecifier. - fn require_core(&self, specifier: &str) -> Result<(), ResolveError> { - if self.options.builtin_modules { - let starts_with_node = specifier.starts_with("node:"); - if starts_with_node || NODEJS_BUILTINS.binary_search(&specifier).is_ok() { - let mut specifier = specifier.to_string(); - if !starts_with_node { - specifier = format!("node:{specifier}"); - } - return Err(ResolveError::Builtin(specifier)); - } - } - Ok(()) - } - - fn require_absolute( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - // Make sure only path prefixes gets called - debug_assert!(Path::new(specifier) - .components() - .next() - .is_some_and(|c| matches!(c, Component::RootDir | Component::Prefix(_)))); - if !self.options.prefer_relative && self.options.prefer_absolute { - if let Ok(path) = self.load_package_self_or_node_modules(cached_path, specifier, ctx) { - return Ok(path); - } - } - if let Some(path) = self.load_roots(specifier, ctx) { - return Ok(path); - } - // 2. If X begins with '/' - // a. set Y to be the file system root - let path = self.cache.value(Path::new(specifier)); - if let Some(path) = self.load_as_file_or_directory(&path, specifier, ctx)? { - return Ok(path); - } - Err(ResolveError::NotFound(specifier.to_string())) - } - - // 3. If X begins with './' or '/' or '../' - fn require_relative( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - // Make sure only relative or normal paths gets called - debug_assert!(Path::new(specifier).components().next().is_some_and(|c| matches!( - c, - Component::CurDir | Component::ParentDir | Component::Normal(_) - ))); - let path = cached_path.path().normalize_with(specifier); - let cached_path = self.cache.value(&path); - // a. LOAD_AS_FILE(Y + X) - // b. LOAD_AS_DIRECTORY(Y + X) - if let Some(path) = self.load_as_file_or_directory(&cached_path, specifier, ctx)? { - return Ok(path); - } - // c. THROW "not found" - Err(ResolveError::NotFound(specifier.to_string())) - } - - fn require_hash( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - debug_assert_eq!(specifier.chars().next(), Some('#')); - // a. LOAD_PACKAGE_IMPORTS(X, dirname(Y)) - if let Some(path) = self.load_package_imports(cached_path, specifier, ctx)? { - return Ok(path); - } - self.load_package_self_or_node_modules(cached_path, specifier, ctx) - } - - fn require_bare( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - // Make sure no other path prefixes gets called - debug_assert!(Path::new(specifier) - .components() - .next() - .is_some_and(|c| matches!(c, Component::Normal(_)))); - if self.options.prefer_relative { - if let Ok(path) = self.require_relative(cached_path, specifier, ctx) { - return Ok(path); - } - } - self.load_package_self_or_node_modules(cached_path, specifier, ctx) - } - - /// enhanced-resolve: ParsePlugin. - /// - /// 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`. - /// - /// - fn load_parse<'s>( - &self, - cached_path: &CachedPath, - specifier: &'s str, - ctx: &mut Ctx, - ) -> Result<(Specifier<'s>, Option), ResolveError> { - let parsed = Specifier::parse(specifier).map_err(ResolveError::Specifier)?; - ctx.with_query_fragment(parsed.query, parsed.fragment); - - // There is an edge-case where a request with # can be a path or a fragment -> try both - if ctx.fragment.is_some() && ctx.query.is_none() { - let specifier = parsed.path(); - let fragment = ctx.fragment.take().unwrap(); - let path = format!("{specifier}{fragment}"); - if let Ok(path) = self.require_without_parse(cached_path, &path, ctx) { - return Ok((parsed, Some(path))); - } - ctx.fragment.replace(fragment); - } - Ok((parsed, None)) - } - - fn load_package_self_or_node_modules( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - let (_, subpath) = Self::parse_package_specifier(specifier); - if subpath.is_empty() { - ctx.with_fully_specified(false); - } - // 5. LOAD_PACKAGE_SELF(X, dirname(Y)) - if let Some(path) = self.load_package_self(cached_path, specifier, ctx)? { - return Ok(path); - } - // 6. LOAD_NODE_MODULES(X, dirname(Y)) - if let Some(path) = self.load_node_modules(cached_path, specifier, ctx)? { - return Ok(path); - } - // 7. THROW "not found" - Err(ResolveError::NotFound(specifier.to_string())) - } - - /// LOAD_PACKAGE_IMPORTS(X, DIR) - fn load_package_imports( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - // 1. Find the closest package scope SCOPE to DIR. - // 2. If no scope was found, return. - let Some(package_json) = - cached_path.find_package_json(&self.cache.fs, &self.options, ctx)? - else { - return Ok(None); - }; - // 3. If the SCOPE/package.json "imports" is null or undefined, return. - // 4. let MATCH = PACKAGE_IMPORTS_RESOLVE(X, pathToFileURL(SCOPE), ["node", "require"]) defined in the ESM resolver. - if let Some(path) = self.package_imports_resolve(specifier, &package_json, ctx)? { - // 5. RESOLVE_ESM_MATCH(MATCH). - return self.resolve_esm_match(specifier, &path, ctx); - } - Ok(None) - } - - fn load_as_file(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - // enhanced-resolve feature: extension_alias - if let Some(path) = self.load_extension_alias(cached_path, ctx)? { - return Ok(Some(path)); - } - if self.options.enforce_extension.is_disabled() { - // 1. If X is a file, load X as its file extension format. STOP - if let Some(path) = self.load_alias_or_file(cached_path, ctx)? { - return Ok(Some(path)); - } - } - // 2. If X.js is a file, load X.js as JavaScript text. STOP - // 3. If X.json is a file, parse X.json to a JavaScript Object. STOP - // 4. If X.node is a file, load X.node as binary addon. STOP - if let Some(path) = - self.load_extensions(cached_path.path(), &self.options.extensions, ctx)? - { - return Ok(Some(path)); - } - Ok(None) - } - - fn load_as_directory(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - // TODO: Only package.json is supported, so warn about having other values - // Checking for empty files is needed for omitting checks on package.json - // 1. If X/package.json is a file, - if !self.options.description_files.is_empty() { - // a. Parse X/package.json, and look for "main" field. - if let Some(package_json) = - cached_path.package_json(&self.cache.fs, &self.options, ctx)? - { - // b. If "main" is a falsy value, GOTO 2. - for main_field in package_json.main_fields(&self.options.main_fields) { - // c. let M = X + (json main field) - let main_field_path = cached_path.path().normalize_with(main_field); - // d. LOAD_AS_FILE(M) - let cached_path = self.cache.value(&main_field_path); - if let Some(path) = self.load_as_file(&cached_path, ctx)? { - return Ok(Some(path)); - } - // e. LOAD_INDEX(M) - if let Some(path) = self.load_index(&cached_path, ctx)? { - return Ok(Some(path)); - } - } - // f. LOAD_INDEX(X) DEPRECATED - // g. THROW "not found" - } - } - // 2. LOAD_INDEX(X) - self.load_index(cached_path, ctx) - } - - fn load_as_file_or_directory( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - if self.options.resolve_to_context { - return Ok(cached_path.is_dir(&self.cache.fs, ctx).then(|| cached_path.clone())); - } - if !specifier.ends_with('/') { - if let Some(path) = self.load_as_file(cached_path, ctx)? { - return Ok(Some(path)); - } - } - if cached_path.is_dir(&self.cache.fs, ctx) { - if let Some(path) = self.load_as_directory(cached_path, ctx)? { - return Ok(Some(path)); - } - } - Ok(None) - } - - fn load_extensions(&self, path: &Path, extensions: &[String], ctx: &mut Ctx) -> ResolveResult { - if ctx.fully_specified { - return Ok(None); - } - let path = path.as_os_str(); - for extension in extensions { - let mut path_with_extension = path.to_os_string(); - path_with_extension.reserve_exact(extension.len()); - path_with_extension.push(extension); - let cached_path = self.cache.value(Path::new(&path_with_extension)); - if let Some(path) = self.load_alias_or_file(&cached_path, ctx)? { - return Ok(Some(path)); - } - } - Ok(None) - } - - fn load_realpath(&self, cached_path: &CachedPath) -> Result { - if self.options.symlinks { - cached_path.realpath(&self.cache.fs).map_err(ResolveError::from) - } else { - Ok(cached_path.to_path_buf()) - } - } - - fn check_restrictions(&self, path: &Path) -> Result<(), ResolveError> { - // https://github.com/webpack/enhanced-resolve/blob/a998c7d218b7a9ec2461fc4fddd1ad5dd7687485/lib/RestrictionsPlugin.js#L19-L24 - fn is_inside(path: &Path, parent: &Path) -> bool { - if !path.starts_with(parent) { - return false; - } - if path.as_os_str().len() == parent.as_os_str().len() { - return true; - } - path.strip_prefix(parent).is_ok_and(|p| p == Path::new("./")) - } - for restriction in &self.options.restrictions { - match restriction { - Restriction::Path(restricted_path) => { - if !is_inside(path, restricted_path) { - return Err(ResolveError::Restriction( - path.to_path_buf(), - restricted_path.clone(), - )); - } - } - Restriction::RegExp(_) => { - return Err(ResolveError::Unimplemented("Restriction with regex")) - } - } - } - Ok(()) - } - - fn load_index(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - for main_file in &self.options.main_files { - let main_path = cached_path.path().normalize_with(main_file); - let cached_path = self.cache.value(&main_path); - if self.options.enforce_extension.is_disabled() { - if let Some(path) = self.load_alias_or_file(&cached_path, ctx)? { - return Ok(Some(path)); - } - } - // 1. If X/index.js is a file, load X/index.js as JavaScript text. STOP - // 2. If X/index.json is a file, parse X/index.json to a JavaScript object. STOP - // 3. If X/index.node is a file, load X/index.node as binary addon. STOP - if let Some(path) = - self.load_extensions(cached_path.path(), &self.options.extensions, ctx)? - { - return Ok(Some(path)); - } - } - Ok(None) - } - - fn load_alias_or_file(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - if let Some(package_json) = - cached_path.find_package_json(&self.cache.fs, &self.options, ctx)? - { - if let Some(path) = self.load_browser_field(cached_path, None, &package_json, ctx)? { - return Ok(Some(path)); - } - } - // enhanced-resolve: try file as alias - let alias_specifier = cached_path.path().to_string_lossy(); - if let Some(path) = - self.load_alias(cached_path, &alias_specifier, &self.options.alias, ctx)? - { - return Ok(Some(path)); - } - if cached_path.is_file(&self.cache.fs, ctx) { - return Ok(Some(cached_path.clone())); - } - Ok(None) - } - - fn load_node_modules( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - let (package_name, subpath) = Self::parse_package_specifier(specifier); - // 1. let DIRS = NODE_MODULES_PATHS(START) - // 2. for each DIR in DIRS: - for module_name in &self.options.modules { - for cached_path in std::iter::successors(Some(cached_path), |p| p.parent()) { - // Skip if /path/to/node_modules does not exist - if !cached_path.is_dir(&self.cache.fs, ctx) { - continue; - } - - let Some(cached_path) = self.get_module_directory(cached_path, module_name, ctx) - else { - continue; - }; - // Optimize node_modules lookup by inspecting whether the package exists - // From LOAD_PACKAGE_EXPORTS(X, DIR) - // 1. Try to interpret X as a combination of NAME and SUBPATH where the name - // may have a @scope/ prefix and the subpath begins with a slash (`/`). - if !package_name.is_empty() { - let package_path = cached_path.path().normalize_with(package_name); - let cached_path = self.cache.value(&package_path); - // Try foo/node_modules/package_name - if cached_path.is_dir(&self.cache.fs, ctx) { - // a. LOAD_PACKAGE_EXPORTS(X, DIR) - if let Some(path) = - self.load_package_exports(specifier, subpath, &cached_path, ctx)? - { - return Ok(Some(path)); - } - } else { - // foo/node_modules/package_name is not a directory, so useless to check inside it - if !subpath.is_empty() { - continue; - } - // Skip if the directory lead to the scope package does not exist - // i.e. `foo/node_modules/@scope` is not a directory for `foo/node_modules/@scope/package` - if package_name.starts_with('@') { - if let Some(path) = cached_path.parent() { - if !path.is_dir(&self.cache.fs, ctx) { - continue; - } - } - } - } - } - - // Try as file or directory for all other cases - // b. LOAD_AS_FILE(DIR/X) - // c. LOAD_AS_DIRECTORY(DIR/X) - let node_module_file = cached_path.path().normalize_with(specifier); - let cached_path = self.cache.value(&node_module_file); - if let Some(path) = self.load_as_file_or_directory(&cached_path, specifier, ctx)? { - return Ok(Some(path)); - } - } - } - Ok(None) - } - - fn get_module_directory( - &self, - cached_path: &CachedPath, - module_name: &str, - ctx: &mut Ctx, - ) -> Option { - if cached_path.path().ends_with(module_name) { - Some(cached_path.clone()) - } else if module_name == "node_modules" { - cached_path.cached_node_modules(&self.cache, ctx) - } else { - cached_path.module_directory(module_name, &self.cache, ctx) - } - } - - fn load_package_exports( - &self, - specifier: &str, - subpath: &str, - cached_path: &CachedPath, - ctx: &mut Ctx, - ) -> ResolveResult { - // 2. If X does not match this pattern or DIR/NAME/package.json is not a file, - // return. - let Some(package_json) = cached_path.package_json(&self.cache.fs, &self.options, ctx)? - else { - return Ok(None); - }; - // 3. Parse DIR/NAME/package.json, and look for "exports" field. - // 4. If "exports" is null or undefined, return. - // 5. let MATCH = PACKAGE_EXPORTS_RESOLVE(pathToFileURL(DIR/NAME), "." + SUBPATH, - // `package.json` "exports", ["node", "require"]) defined in the ESM resolver. - // Note: The subpath is not prepended with a dot on purpose - for exports in package_json.exports_fields(&self.options.exports_fields) { - if let Some(path) = self.package_exports_resolve( - cached_path.path(), - &format!(".{subpath}"), - exports, - ctx, - )? { - // 6. RESOLVE_ESM_MATCH(MATCH) - return self.resolve_esm_match(specifier, &path, ctx); - }; - } - Ok(None) - } - - fn load_package_self( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - // 1. Find the closest package scope SCOPE to DIR. - // 2. If no scope was found, return. - let Some(package_json) = - cached_path.find_package_json(&self.cache.fs, &self.options, ctx)? - else { - return Ok(None); - }; - // 3. If the SCOPE/package.json "exports" is null or undefined, return. - // 4. If the SCOPE/package.json "name" is not the first segment of X, return. - if let Some(subpath) = package_json - .name - .as_ref() - .and_then(|package_name| Self::strip_package_name(specifier, package_name)) - { - // 5. let MATCH = PACKAGE_EXPORTS_RESOLVE(pathToFileURL(SCOPE), - // "." + X.slice("name".length), `package.json` "exports", ["node", "require"]) - // defined in the ESM resolver. - let package_url = package_json.directory(); - // Note: The subpath is not prepended with a dot on purpose - // because `package_exports_resolve` matches subpath without the leading dot. - for exports in package_json.exports_fields(&self.options.exports_fields) { - if let Some(cached_path) = - self.package_exports_resolve(package_url, &format!(".{subpath}"), exports, ctx)? - { - // 6. RESOLVE_ESM_MATCH(MATCH) - return self.resolve_esm_match(specifier, &cached_path, ctx); - } - } - } - self.load_browser_field(cached_path, Some(specifier), &package_json, ctx) - } - - /// RESOLVE_ESM_MATCH(MATCH) - fn resolve_esm_match( - &self, - specifier: &str, - cached_path: &CachedPath, - ctx: &mut Ctx, - ) -> ResolveResult { - // 1. let RESOLVED_PATH = fileURLToPath(MATCH) - // 2. If the file at RESOLVED_PATH exists, load RESOLVED_PATH as its extension format. STOP - // - // Non-compliant ESM can result in a directory, so directory is tried as well. - if let Some(path) = self.load_as_file_or_directory(cached_path, "", ctx)? { - return Ok(Some(path)); - } - // 3. THROW "not found" - Err(ResolveError::NotFound(specifier.to_string())) - } - - /// enhanced-resolve: AliasFieldPlugin for [ResolveOptions::alias_fields] - fn load_browser_field( - &self, - cached_path: &CachedPath, - module_specifier: Option<&str>, - package_json: &PackageJson, - ctx: &mut Ctx, - ) -> ResolveResult { - let path = cached_path.path(); - let Some(new_specifier) = package_json.resolve_browser_field( - path, - module_specifier, - &self.options.alias_fields, - )? - else { - return Ok(None); - }; - // Abort when resolving recursive module - if module_specifier.is_some_and(|s| s == new_specifier) { - return Ok(None); - } - if ctx.resolving_alias.as_ref().is_some_and(|s| s == new_specifier) { - // Complete when resolving to self `{"./a.js": "./a.js"}` - if new_specifier.strip_prefix("./").filter(|s| path.ends_with(Path::new(s))).is_some() { - return if cached_path.is_file(&self.cache.fs, ctx) { - Ok(Some(cached_path.clone())) - } else { - Err(ResolveError::NotFound(new_specifier.to_string())) - }; - } - return Err(ResolveError::Recursion); - } - ctx.with_resolving_alias(new_specifier.to_string()); - ctx.with_fully_specified(false); - let cached_path = self.cache.value(package_json.directory()); - self.require(&cached_path, new_specifier, ctx).map(Some) - } - - /// enhanced-resolve: AliasPlugin for [ResolveOptions::alias] and [ResolveOptions::fallback]. - fn load_alias( - &self, - cached_path: &CachedPath, - specifier: &str, - aliases: &Alias, - ctx: &mut Ctx, - ) -> ResolveResult { - for (alias_key_raw, specifiers) in aliases { - let alias_key = if let Some(alias_key) = alias_key_raw.strip_suffix('$') { - if alias_key != specifier { - continue; - } - alias_key - } else { - let strip_package_name = Self::strip_package_name(specifier, alias_key_raw); - if strip_package_name.is_none() { - continue; - } - alias_key_raw - }; - // It should stop resolving when all of the tried alias values - // failed to resolve. - // - let mut should_stop = false; - for r in specifiers { - match r { - AliasValue::Path(alias_value) => { - if let Some(path) = self.load_alias_value( - cached_path, - alias_key, - alias_value, - specifier, - ctx, - &mut should_stop, - )? { - return Ok(Some(path)); - } - } - AliasValue::Ignore => { - let path = cached_path.path().normalize_with(alias_key); - return Err(ResolveError::Ignored(path)); - } - } - } - if should_stop { - return Err(ResolveError::NotFound(specifier.to_string())); - } - } - Ok(None) - } - - fn load_alias_value( - &self, - cached_path: &CachedPath, - alias_key: &str, - alias_value: &str, - request: &str, - ctx: &mut Ctx, - should_stop: &mut bool, - ) -> ResolveResult { - if request != alias_value - && !request.strip_prefix(alias_value).is_some_and(|prefix| prefix.starts_with('/')) - { - let tail = &request[alias_key.len()..]; - - let new_specifier = if tail.is_empty() { - Cow::Borrowed(alias_value) - } else { - let alias_value = Path::new(alias_value).normalize(); - // Must not append anything to alias_value if it is a file. - let alias_value_cached_path = self.cache.value(&alias_value); - if alias_value_cached_path.is_file(&self.cache.fs, ctx) { - return Ok(None); - } - - // Remove the leading slash so the final path is concatenated. - let tail = tail.trim_start_matches(SLASH_START); - let normalized = alias_value.normalize_with(tail); - Cow::Owned(normalized.to_string_lossy().to_string()) - }; - - *should_stop = true; - ctx.with_fully_specified(false); - return match self.require(cached_path, new_specifier.as_ref(), ctx) { - Err(ResolveError::NotFound(_)) => Ok(None), - Ok(path) => return Ok(Some(path)), - Err(err) => return Err(err), - }; - } - Ok(None) - } - - /// Given an extension alias map `{".js": [".ts", "js"]}`, - /// load the mapping instead of the provided extension - /// - /// This is an enhanced-resolve feature - /// - /// # Errors - /// - /// * [ResolveError::ExtensionAlias]: When all of the aliased extensions are not found - fn load_extension_alias(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - let Some(path_extension) = cached_path.path().extension() else { - return Ok(None); - }; - let Some((_, extensions)) = self - .options - .extension_alias - .iter() - .find(|(ext, _)| OsStr::new(ext.trim_start_matches('.')) == path_extension) - else { - return Ok(None); - }; - let path = cached_path.path().with_extension(""); - ctx.with_fully_specified(false); - if let Some(path) = self.load_extensions(&path, extensions, ctx)? { - return Ok(Some(path)); - } - Err(ResolveError::ExtensionAlias) - } - - /// enhanced-resolve: RootsPlugin - /// - /// A list of directories where requests of server-relative URLs (starting with '/') are resolved, - /// defaults to context configuration option. - /// - /// On non-Windows systems these requests are resolved as an absolute path first. - fn load_roots(&self, specifier: &str, ctx: &mut Ctx) -> Option { - if !self.options.roots.is_empty() { - if let Some(specifier) = specifier.strip_prefix(SLASH_START) { - for root in &self.options.roots { - let cached_path = self.cache.value(root); - if let Ok(path) = self.require_relative(&cached_path, specifier, ctx) { - return Some(path); - } - } - } - } - None - } - - fn load_tsconfig_paths( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - let Some(tsconfig_options) = &self.options.tsconfig else { - return Ok(None); - }; - let tsconfig = self.load_tsconfig( - /* root */ true, - &tsconfig_options.config_file, - &tsconfig_options.references, - )?; - let paths = tsconfig.resolve(cached_path.path(), specifier); - for path in paths { - let cached_path = self.cache.value(&path); - if let Ok(path) = self.require_relative(&cached_path, ".", ctx) { - return Ok(Some(path)); - } - } - Ok(None) - } - - fn load_tsconfig( - &self, - root: bool, - path: &Path, - references: &TsconfigReferences, - ) -> Result, ResolveError> { - self.cache.tsconfig(root, path, |tsconfig| { - let directory = self.cache.value(tsconfig.directory()); - tracing::trace!(tsconfig = ?tsconfig, "load_tsconfig"); - - // Extend tsconfig - if let Some(extends) = &tsconfig.extends { - let extended_tsconfig_paths = match extends { - ExtendsField::Single(s) => { - vec![self.get_extended_tsconfig_path(&directory, tsconfig, s)?] - } - ExtendsField::Multiple(specifiers) => specifiers - .iter() - .map(|s| self.get_extended_tsconfig_path(&directory, tsconfig, s)) - .collect::, ResolveError>>()?, - }; - for extended_tsconfig_path in extended_tsconfig_paths { - let extended_tsconfig = self.load_tsconfig( - /* root */ false, - &extended_tsconfig_path, - &TsconfigReferences::Disabled, - )?; - tsconfig.extend_tsconfig(&extended_tsconfig); - } - } - - // Load project references - match references { - TsconfigReferences::Disabled => { - tsconfig.references.drain(..); - } - TsconfigReferences::Auto => {} - TsconfigReferences::Paths(paths) => { - tsconfig.references = paths - .iter() - .map(|path| ProjectReference { path: path.clone(), tsconfig: None }) - .collect(); - } - } - if !tsconfig.references.is_empty() { - let directory = tsconfig.directory().to_path_buf(); - for reference in &mut tsconfig.references { - let reference_tsconfig_path = directory.normalize_with(&reference.path); - let tsconfig = self.cache.tsconfig( - /* root */ true, - &reference_tsconfig_path, - |_| Ok(()), - )?; - reference.tsconfig.replace(tsconfig); - } - } - Ok(()) - }) - } - - fn get_extended_tsconfig_path( - &self, - directory: &CachedPath, - tsconfig: &TsConfig, - specifier: &str, - ) -> Result { - match specifier.as_bytes().first() { - None => Err(ResolveError::Specifier(SpecifierError::Empty(specifier.to_string()))), - Some(b'/') => Ok(PathBuf::from(specifier)), - Some(b'.') => Ok(tsconfig.directory().normalize_with(specifier)), - _ => self - .clone_with_options(ResolveOptions { - description_files: vec![], - extensions: vec![".json".into()], - main_files: vec!["tsconfig.json".into()], - ..ResolveOptions::default() - }) - .load_package_self_or_node_modules(directory, specifier, &mut Ctx::default()) - .map(|p| p.to_path_buf()) - .map_err(|err| match err { - ResolveError::NotFound(_) => { - ResolveError::TsconfigNotFound(PathBuf::from(specifier)) - } - _ => err, - }), - } - } - - /// PACKAGE_RESOLVE(packageSpecifier, parentURL) - fn package_resolve( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - let (package_name, subpath) = Self::parse_package_specifier(specifier); - - // 3. If packageSpecifier is a Node.js builtin module name, then - // 1. Return the string "node:" concatenated with packageSpecifier. - self.require_core(package_name)?; - - // 11. While parentURL is not the file system root, - for module_name in &self.options.modules { - for cached_path in std::iter::successors(Some(cached_path), |p| p.parent()) { - // 1. Let packageURL be the URL resolution of "node_modules/" concatenated with packageSpecifier, relative to parentURL. - let Some(cached_path) = self.get_module_directory(cached_path, module_name, ctx) - else { - continue; - }; - // 2. Set parentURL to the parent folder URL of parentURL. - let package_path = cached_path.path().normalize_with(package_name); - let cached_path = self.cache.value(&package_path); - // 3. If the folder at packageURL does not exist, then - // 1. Continue the next loop iteration. - if cached_path.is_dir(&self.cache.fs, ctx) { - // 4. Let pjson be the result of READ_PACKAGE_JSON(packageURL). - if let Some(package_json) = - cached_path.package_json(&self.cache.fs, &self.options, ctx)? - { - // 5. If pjson is not null and pjson.exports is not null or undefined, then - // 1. Return the result of PACKAGE_EXPORTS_RESOLVE(packageURL, packageSubpath, pjson.exports, defaultConditions). - for exports in package_json.exports_fields(&self.options.exports_fields) { - if let Some(path) = self.package_exports_resolve( - cached_path.path(), - &format!(".{subpath}"), - exports, - ctx, - )? { - return Ok(Some(path)); - } - } - // 6. Otherwise, if packageSubpath is equal to ".", then - if subpath == "." { - // 1. If pjson.main is a string, then - for main_field in package_json.main_fields(&self.options.main_fields) { - // 1. Return the URL resolution of main in packageURL. - let path = cached_path.path().normalize_with(main_field); - let cached_path = self.cache.value(&path); - if cached_path.is_file(&self.cache.fs, ctx) { - return Ok(Some(cached_path)); - } - } - } - } - let subpath = format!(".{subpath}"); - ctx.with_fully_specified(false); - return self.require(&cached_path, &subpath, ctx).map(Some); - } - } - } - - Err(ResolveError::NotFound(specifier.to_string())) - } - - /// PACKAGE_EXPORTS_RESOLVE(packageURL, subpath, exports, conditions) - fn package_exports_resolve( - &self, - package_url: &Path, - subpath: &str, - exports: &JSONValue, - ctx: &mut Ctx, - ) -> ResolveResult { - let conditions = &self.options.condition_names; - // 1. If exports is an Object with both a key starting with "." and a key not starting with ".", throw an Invalid Package Configuration error. - if let JSONValue::Object(map) = exports { - let mut has_dot = false; - let mut without_dot = false; - for key in map.keys() { - has_dot = has_dot || key.starts_with(|s| s == '.' || s == '#'); - without_dot = without_dot || !key.starts_with(|s| s == '.' || s == '#'); - if has_dot && without_dot { - return Err(ResolveError::InvalidPackageConfig( - package_url.join("package.json"), - )); - } - } - } - // 2. If subpath is equal to ".", then - // Note: subpath is not prepended with a dot when passed in. - if subpath == "." { - // enhanced-resolve appends query and fragment when resolving exports field - // https://github.com/webpack/enhanced-resolve/blob/a998c7d218b7a9ec2461fc4fddd1ad5dd7687485/lib/ExportsFieldPlugin.js#L57-L62 - // This is only need when querying the main export, otherwise ctx is passed through. - if ctx.query.is_some() || ctx.fragment.is_some() { - let query = ctx.query.clone().unwrap_or_default(); - let fragment = ctx.fragment.clone().unwrap_or_default(); - return Err(ResolveError::PackagePathNotExported( - format!("./{}{query}{fragment}", subpath.trim_start_matches('.')), - package_url.join("package.json"), - )); - } - // 1. Let mainExport be undefined. - let main_export = match exports { - // 2. If exports is a String or Array, or an Object containing no keys starting with ".", then - JSONValue::String(_) | JSONValue::Array(_) => { - // 1. Set mainExport to exports. - Some(exports) - } - // 3. Otherwise if exports is an Object containing a "." property, then - JSONValue::Object(map) => { - // 1. Set mainExport to exports["."]. - map.get(".").map_or_else( - || { - if map.keys().any(|key| key.starts_with("./") || key.starts_with('#')) { - None - } else { - Some(exports) - } - }, - Some, - ) - } - _ => None, - }; - // 4. If mainExport is not undefined, then - if let Some(main_export) = main_export { - // 1. Let resolved be the result of PACKAGE_TARGET_RESOLVE( packageURL, mainExport, null, false, conditions). - let resolved = self.package_target_resolve( - package_url, - ".", - main_export, - None, - /* is_imports */ false, - conditions, - ctx, - )?; - // 2. If resolved is not null or undefined, return resolved. - if let Some(path) = resolved { - return Ok(Some(path)); - } - } - } - // 3. Otherwise, if exports is an Object and all keys of exports start with ".", then - if let JSONValue::Object(exports) = exports { - // 1. Let matchKey be the string "./" concatenated with subpath. - // Note: `package_imports_exports_resolve` does not require the leading dot. - let match_key = &subpath; - // 2. Let resolved be the result of PACKAGE_IMPORTS_EXPORTS_RESOLVE( matchKey, exports, packageURL, false, conditions). - if let Some(path) = self.package_imports_exports_resolve( - match_key, - exports, - package_url, - /* is_imports */ false, - conditions, - ctx, - )? { - // 3. If resolved is not null or undefined, return resolved. - return Ok(Some(path)); - } - } - // 4. Throw a Package Path Not Exported error. - Err(ResolveError::PackagePathNotExported( - subpath.to_string(), - package_url.join("package.json"), - )) - } - - /// PACKAGE_IMPORTS_RESOLVE(specifier, parentURL, conditions) - fn package_imports_resolve( - &self, - specifier: &str, - package_json: &PackageJson, - ctx: &mut Ctx, - ) -> Result, ResolveError> { - // 1. Assert: specifier begins with "#". - debug_assert!(specifier.starts_with('#'), "{specifier}"); - // 2. If specifier is exactly equal to "#" or starts with "#/", then - // 1. Throw an Invalid Module Specifier error. - // 3. Let packageURL be the result of LOOKUP_PACKAGE_SCOPE(parentURL). - // 4. If packageURL is not null, then - - // 1. Let pjson be the result of READ_PACKAGE_JSON(packageURL). - // 2. If pjson.imports is a non-null Object, then - - // 1. Let resolved be the result of PACKAGE_IMPORTS_EXPORTS_RESOLVE( specifier, pjson.imports, packageURL, true, conditions). - let mut has_imports = false; - for imports in package_json.imports_fields(&self.options.imports_fields) { - if !has_imports { - has_imports = true; - // TODO: fill in test case for this case - if specifier == "#" || specifier.starts_with("#/") { - return Err(ResolveError::InvalidModuleSpecifier( - specifier.to_string(), - package_json.path.clone(), - )); - } - } - if let Some(path) = self.package_imports_exports_resolve( - specifier, - imports, - package_json.directory(), - /* is_imports */ true, - &self.options.condition_names, - ctx, - )? { - // 2. If resolved is not null or undefined, return resolved. - return Ok(Some(path)); - } - } - - // 5. Throw a Package Import Not Defined error. - if has_imports { - Err(ResolveError::PackageImportNotDefined( - specifier.to_string(), - package_json.path.clone(), - )) - } else { - Ok(None) - } - } - - /// PACKAGE_IMPORTS_EXPORTS_RESOLVE(matchKey, matchObj, packageURL, isImports, conditions) - fn package_imports_exports_resolve( - &self, - match_key: &str, - match_obj: &JSONMap, - package_url: &Path, - is_imports: bool, - conditions: &[String], - ctx: &mut Ctx, - ) -> ResolveResult { - // enhanced-resolve behaves differently, it throws - // Error: CachedPath to directories is not possible with the exports field (specifier was ./dist/) - if match_key.ends_with('/') { - return Ok(None); - } - // 1. If matchKey is a key of matchObj and does not contain "*", then - if !match_key.contains('*') { - // 1. Let target be the value of matchObj[matchKey]. - if let Some(target) = match_obj.get(match_key) { - // 2. Return the result of PACKAGE_TARGET_RESOLVE(packageURL, target, null, isImports, conditions). - return self.package_target_resolve( - package_url, - match_key, - target, - None, - is_imports, - conditions, - ctx, - ); - } - } - - let mut best_target = None; - let mut best_match = ""; - let mut best_key = ""; - // 2. Let expansionKeys be the list of keys of matchObj containing only a single "*", sorted by the sorting function PATTERN_KEY_COMPARE which orders in descending order of specificity. - // 3. For each key expansionKey in expansionKeys, do - for (expansion_key, target) in match_obj { - if expansion_key.starts_with("./") || expansion_key.starts_with('#') { - // 1. Let patternBase be the substring of expansionKey up to but excluding the first "*" character. - if let Some((pattern_base, pattern_trailer)) = expansion_key.split_once('*') { - // 2. If matchKey starts with but is not equal to patternBase, then - if match_key.starts_with(pattern_base) - // 1. Let patternTrailer be the substring of expansionKey from the index after the first "*" character. - && !pattern_trailer.contains('*') - // 2. If patternTrailer has zero length, or if matchKey ends with patternTrailer and the length of matchKey is greater than or equal to the length of expansionKey, then - && (pattern_trailer.is_empty() - || (match_key.len() >= expansion_key.len() - && match_key.ends_with(pattern_trailer))) - && Self::pattern_key_compare(best_key, expansion_key).is_gt() - { - // 1. Let target be the value of matchObj[expansionKey]. - best_target = Some(target); - // 2. Let patternMatch be the substring of matchKey starting at the index of the length of patternBase up to the length of matchKey minus the length of patternTrailer. - best_match = - &match_key[pattern_base.len()..match_key.len() - pattern_trailer.len()]; - best_key = expansion_key; - } - } else if expansion_key.ends_with('/') - && match_key.starts_with(expansion_key) - && Self::pattern_key_compare(best_key, expansion_key).is_gt() - { - // TODO: [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./dist/" in the "exports" field module resolution of the package at xxx/package.json. - best_target = Some(target); - best_match = &match_key[expansion_key.len()..]; - best_key = expansion_key; - } - } - } - if let Some(best_target) = best_target { - // 3. Return the result of PACKAGE_TARGET_RESOLVE(packageURL, target, patternMatch, isImports, conditions). - return self.package_target_resolve( - package_url, - best_key, - best_target, - Some(best_match), - is_imports, - conditions, - ctx, - ); - } - // 4. Return null. - Ok(None) - } - - /// PACKAGE_TARGET_RESOLVE(packageURL, target, patternMatch, isImports, conditions) - #[allow(clippy::too_many_arguments)] - fn package_target_resolve( - &self, - package_url: &Path, - target_key: &str, - target: &JSONValue, - pattern_match: Option<&str>, - is_imports: bool, - conditions: &[String], - ctx: &mut Ctx, - ) -> ResolveResult { - fn normalize_string_target<'a>( - target_key: &'a str, - target: &'a str, - pattern_match: Option<&'a str>, - package_url: &Path, - ) -> Result, ResolveError> { - let target = if let Some(pattern_match) = pattern_match { - if !target_key.contains('*') && !target.contains('*') { - // enhanced-resolve behaviour - // TODO: [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./dist/" in the "exports" field module resolution of the package at xxx/package.json. - if target_key.ends_with('/') && target.ends_with('/') { - Cow::Owned(format!("{target}{pattern_match}")) - } else { - return Err(ResolveError::InvalidPackageConfigDirectory( - package_url.join("package.json"), - )); - } - } else { - Cow::Owned(target.replace('*', pattern_match)) - } - } else { - Cow::Borrowed(target) - }; - Ok(target) - } - - match target { - // 1. If target is a String, then - JSONValue::String(target) => { - // 1. If target does not start with "./", then - if !target.starts_with("./") { - // 1. If isImports is false, or if target starts with "../" or "/", or if target is a valid URL, then - if !is_imports || target.starts_with("../") || target.starts_with('/') { - // 1. Throw an Invalid Package Target error. - return Err(ResolveError::InvalidPackageTarget( - target.to_string(), - target_key.to_string(), - package_url.join("package.json"), - )); - } - // 2. If patternMatch is a String, then - // 1. Return PACKAGE_RESOLVE(target with every instance of "*" replaced by patternMatch, packageURL + "/"). - let target = - normalize_string_target(target_key, target, pattern_match, package_url)?; - let package_url = self.cache.value(package_url); - // // 3. Return PACKAGE_RESOLVE(target, packageURL + "/"). - return self.package_resolve(&package_url, &target, ctx); - } - - // 2. If target split on "/" or "\" contains any "", ".", "..", or "node_modules" segments after the first "." segment, case insensitive and including percent encoded variants, throw an Invalid Package Target error. - // 3. Let resolvedTarget be the URL resolution of the concatenation of packageURL and target. - // 4. Assert: resolvedTarget is contained in packageURL. - // 5. If patternMatch is null, then - let target = - normalize_string_target(target_key, target, pattern_match, package_url)?; - if Path::new(target.as_ref()).is_invalid_exports_target() { - return Err(ResolveError::InvalidPackageTarget( - target.to_string(), - target_key.to_string(), - package_url.join("package.json"), - )); - } - let resolved_target = package_url.normalize_with(target.as_ref()); - // 6. If patternMatch split on "/" or "\" contains any "", ".", "..", or "node_modules" segments, case insensitive and including percent encoded variants, throw an Invalid Module Specifier error. - // 7. Return the URL resolution of resolvedTarget with every instance of "*" replaced with patternMatch. - let value = self.cache.value(&resolved_target); - return Ok(Some(value)); - } - // 2. Otherwise, if target is a non-null Object, then - JSONValue::Object(target) => { - // 1. If exports contains any index property keys, as defined in ECMA-262 6.1.7 Array Index, throw an Invalid Package Configuration error. - // 2. For each property p of target, in object insertion order as, - for (key, target_value) in target { - // 1. If p equals "default" or conditions contains an entry for p, then - if key == "default" || conditions.contains(key) { - // 1. Let targetValue be the value of the p property in target. - // 2. Let resolved be the result of PACKAGE_TARGET_RESOLVE( packageURL, targetValue, patternMatch, isImports, conditions). - let resolved = self.package_target_resolve( - package_url, - target_key, - target_value, - pattern_match, - is_imports, - conditions, - ctx, - ); - // 3. If resolved is equal to undefined, continue the loop. - if let Some(path) = resolved? { - // 4. Return resolved. - return Ok(Some(path)); - } - } - } - // 3. Return undefined. - return Ok(None); - } - // 3. Otherwise, if target is an Array, then - JSONValue::Array(targets) => { - // 1. If _target.length is zero, return null. - if targets.is_empty() { - // Note: return PackagePathNotExported has the same effect as return because there are no matches. - return Err(ResolveError::PackagePathNotExported( - pattern_match.unwrap_or(".").to_string(), - package_url.join("package.json"), - )); - } - // 2. For each item targetValue in target, do - for (i, target_value) in targets.iter().enumerate() { - // 1. Let resolved be the result of PACKAGE_TARGET_RESOLVE( packageURL, targetValue, patternMatch, isImports, conditions), continuing the loop on any Invalid Package Target error. - let resolved = self.package_target_resolve( - package_url, - target_key, - target_value, - pattern_match, - is_imports, - conditions, - ctx, - ); - - if resolved.is_err() && i == targets.len() { - return resolved; - } - - // 2. If resolved is undefined, continue the loop. - if let Ok(Some(path)) = resolved { - // 3. Return resolved. - return Ok(Some(path)); - } - } - // 3. Return or throw the last fallback resolution null return or error. - // Note: see `resolved.is_err() && i == targets.len()` - } - _ => {} - } - // 4. Otherwise, if target is null, return null. - Ok(None) - // 5. Otherwise throw an Invalid Package Target error. - } - - // Returns (module, subpath) - // https://github.com/nodejs/node/blob/8f0f17e1e3b6c4e58ce748e06343c5304062c491/lib/internal/modules/esm/resolve.js#L688 - fn parse_package_specifier(specifier: &str) -> (&str, &str) { - let mut separator_index = specifier.as_bytes().iter().position(|b| *b == b'/'); - // let mut valid_package_name = true; - // let mut is_scoped = false; - if specifier.starts_with('@') { - // is_scoped = true; - if separator_index.is_none() || specifier.is_empty() { - // valid_package_name = false; - } else if let Some(index) = &separator_index { - separator_index = specifier[*index + 1..] - .as_bytes() - .iter() - .position(|b| *b == b'/') - .map(|i| i + *index + 1); - } - } - let package_name = - separator_index.map_or(specifier, |separator_index| &specifier[..separator_index]); - - // TODO: https://github.com/nodejs/node/blob/8f0f17e1e3b6c4e58ce748e06343c5304062c491/lib/internal/modules/esm/resolve.js#L705C1-L714C1 - // Package name cannot have leading . and cannot have percent-encoding or - // \\ separators. - // if (RegExpPrototypeExec(invalidPackageNameRegEx, packageName) !== null) - // validPackageName = false; - - // if (!validPackageName) { - // throw new ERR_INVALID_MODULE_SPECIFIER( - // specifier, 'is not a valid package name', fileURLToPath(base)); - // } - let package_subpath = - separator_index.map_or("", |separator_index| &specifier[separator_index..]); - (package_name, package_subpath) - } - - /// PATTERN_KEY_COMPARE(keyA, keyB) - fn pattern_key_compare(key_a: &str, key_b: &str) -> Ordering { - if key_a.is_empty() { - return Ordering::Greater; - } - // 1. Assert: keyA ends with "/" or contains only a single "*". - debug_assert!(key_a.ends_with('/') || key_a.match_indices('*').count() == 1, "{key_a}"); - // 2. Assert: keyB ends with "/" or contains only a single "*". - debug_assert!(key_b.ends_with('/') || key_b.match_indices('*').count() == 1, "{key_b}"); - // 3. Let baseLengthA be the index of "*" in keyA plus one, if keyA contains "*", or the length of keyA otherwise. - let a_pos = key_a.chars().position(|c| c == '*'); - let base_length_a = a_pos.map_or(key_a.len(), |p| p + 1); - // 4. Let baseLengthB be the index of "*" in keyB plus one, if keyB contains "*", or the length of keyB otherwise. - let b_pos = key_b.chars().position(|c| c == '*'); - let base_length_b = b_pos.map_or(key_b.len(), |p| p + 1); - // 5. If baseLengthA is greater than baseLengthB, return -1. - if base_length_a > base_length_b { - return Ordering::Less; - } - // 6. If baseLengthB is greater than baseLengthA, return 1. - if base_length_b > base_length_a { - return Ordering::Greater; - } - // 7. If keyA does not contain "*", return 1. - if !key_a.contains('*') { - return Ordering::Greater; - } - // 8. If keyB does not contain "*", return -1. - if !key_b.contains('*') { - return Ordering::Less; - } - // 9. If the length of keyA is greater than the length of keyB, return -1. - if key_a.len() > key_b.len() { - return Ordering::Less; - } - // 10. If the length of keyB is greater than the length of keyA, return 1. - if key_b.len() > key_a.len() { - return Ordering::Greater; - } - // 11. Return 0. - Ordering::Equal - } - - fn strip_package_name<'a>(specifier: &'a str, package_name: &'a str) -> Option<&'a str> { - specifier - .strip_prefix(package_name) - .filter(|tail| tail.is_empty() || tail.starts_with(SLASH_START)) - } -} diff --git a/src/options.rs b/src/options.rs deleted file mode 100644 index f473a133..00000000 --- a/src/options.rs +++ /dev/null @@ -1,623 +0,0 @@ -use std::path::Path; -use std::{fmt, path::PathBuf}; - -/// Module Resolution Options -/// -/// Options are directly ported from [enhanced-resolve](https://github.com/webpack/enhanced-resolve#resolver-options). -/// -/// See [webpack resolve](https://webpack.js.org/configuration/resolve/) for information and examples -#[derive(Debug, Clone)] -pub struct ResolveOptions { - /// Path to TypeScript configuration file. - /// - /// Default `None` - pub tsconfig: Option, - - /// Create aliases to import or require certain modules more easily. - /// - /// An alias is used to replace a whole path or part of a path. - /// For example, to alias a commonly used `src/` folders: `vec![("@/src"), vec![AliasValue::Path("/path/to/src")]]` - /// - /// A trailing $ can also be added to the given object's keys to signify an exact match. - /// - /// See [webpack's `resolve.alias` documentation](https://webpack.js.org/configuration/resolve/#resolvealias) for a list of use cases. - pub alias: Alias, - - /// A list of alias fields in description files. - /// - /// Specify a field, such as `browser`, to be parsed according to [this specification](https://github.com/defunctzombie/package-browser-field-spec). - /// Can be a path to json object such as `["path", "to", "exports"]`. - /// - /// Default `[]` - pub alias_fields: Vec>, - - /// Condition names for exports field which defines entry points of a package. - /// - /// The key order in the exports field is significant. During condition matching, earlier entries have higher priority and take precedence over later entries. - /// - /// Default `[]` - pub condition_names: Vec, - - /// The JSON files to use for descriptions. (There was once a `bower.json`.) - /// - /// Default `["package.json"]` - pub description_files: Vec, - - /// Set to [EnforceExtension::Enabled] for [ESM Mandatory file extensions](https://nodejs.org/api/esm.html#mandatory-file-extensions). - /// - /// If `enforce_extension` is set to [EnforceExtension::Enabled], resolution will not allow extension-less files. - /// This means `require('./foo.js')` will resolve, while `require('./foo')` will not. - /// - /// The default value for `enforce_extension` is [EnforceExtension::Auto], which is changed upon initialization. - /// - /// It changes to [EnforceExtension::Enabled] if [ResolveOptions::extensions] contains an empty string; - /// otherwise, this value changes to [EnforceExtension::Disabled]. - /// - /// Explicitly set the value to [EnforceExtension::Disabled] to disable this automatic behavior. - /// - /// For reference, this behavior is aligned with `enhanced-resolve`. See . - pub enforce_extension: EnforceExtension, - - /// A list of exports fields in description files. - /// - /// Can be a path to a JSON object such as `["path", "to", "exports"]`. - /// - /// Default `[["exports"]]`. - pub exports_fields: Vec>, - - /// Fields from `package.json` which are used to provide the internal requests of a package - /// (requests starting with # are considered internal). - /// - /// Can be a path to a JSON object such as `["path", "to", "imports"]`. - /// - /// Default `[["imports"]]`. - pub imports_fields: Vec>, - - /// An object which maps extension to extension aliases. - /// - /// Default `{}` - pub extension_alias: Vec<(String, Vec)>, - - /// Attempt to resolve these extensions in order. - /// - /// If multiple files share the same name but have different extensions, - /// will resolve the one with the extension listed first in the array and skip the rest. - /// - /// All extensions must have a leading dot. - /// - /// Default `[".js", ".json", ".node"]` - pub extensions: Vec, - - /// Redirect module requests when normal resolving fails. - /// - /// Default `[]` - pub fallback: Alias, - - /// 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). - /// - /// See also webpack configuration [resolve.fullySpecified](https://webpack.js.org/configuration/module/#resolvefullyspecified) - /// - /// Default `false` - pub fully_specified: bool, - - /// A list of main fields in description files - /// - /// Default `["main"]`. - pub main_fields: Vec, - - /// The filename to be used while resolving directories. - /// - /// Default `["index"]` - pub main_files: Vec, - - /// A list of directories to resolve modules from, can be absolute path or folder name. - /// - /// Default `["node_modules"]` - pub modules: Vec, - - /// Resolve to a context instead of a file. - /// - /// Default `false` - pub resolve_to_context: bool, - - /// Prefer to resolve module requests as relative requests instead of using modules from node_modules directories. - /// - /// Default `false` - pub prefer_relative: bool, - - /// Prefer to resolve server-relative urls as absolute paths before falling back to resolve in ResolveOptions::roots. - /// - /// Default `false` - pub prefer_absolute: bool, - - /// A list of resolve restrictions to restrict the paths that a request can be resolved on. - /// - /// Default `[]` - pub restrictions: Vec, - - /// A list of directories where requests of server-relative URLs (starting with '/') are resolved. - /// On non-Windows systems these requests are resolved as an absolute path first. - /// - /// Default `[]` - pub roots: Vec, - - /// Whether to resolve symlinks to their symlinked location. - /// When enabled, symlinked resources are resolved to their real path, not their symlinked location. - /// Note that this may cause module resolution to fail when using tools that symlink packages (like npm link). - /// - /// Default `true` - pub symlinks: bool, - - /// Whether to parse [module.builtinModules](https://nodejs.org/api/module.html#modulebuiltinmodules) or not. - /// For example, "zlib" will throw [crate::ResolveError::Builtin] when set to true. - /// - /// Default `false` - pub builtin_modules: bool, -} - -impl ResolveOptions { - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// - /// let options = ResolveOptions::default().with_condition_names(&["bar"]); - /// assert_eq!(options.condition_names, vec!["bar".to_string()]) - /// ``` - #[must_use] - pub fn with_condition_names(mut self, names: &[&str]) -> Self { - self.condition_names = names.iter().map(ToString::to_string).collect::>(); - self - } - - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// - /// let options = ResolveOptions::default().with_builtin_modules(false); - /// assert_eq!(options.builtin_modules, false) - /// ``` - #[must_use] - pub fn with_builtin_modules(mut self, flag: bool) -> Self { - self.builtin_modules = flag; - self - } - - /// Adds a single root to the options - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_root("foo"); - /// assert_eq!(options.roots, vec![PathBuf::from("foo")]) - /// ``` - #[must_use] - pub fn with_root>(mut self, root: P) -> Self { - self.roots.push(root.as_ref().to_path_buf()); - self - } - - /// Adds a single extension to the list of extensions - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_extension("jsonc"); - /// assert!(options.extensions.contains(&"jsonc".to_string())); - /// ``` - #[must_use] - pub fn with_extension>(mut self, extension: S) -> Self { - self.extensions.push(extension.into()); - self - } - - /// Adds a single main field to the list of fields - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_main_field("something"); - /// assert!(options.main_fields.contains(&"something".to_string())); - /// ``` - #[must_use] - pub fn with_main_field>(mut self, field: S) -> Self { - self.main_fields.push(field.into()); - self - } - - /// Changes how the extension should be treated - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions, EnforceExtension}; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_force_extension(EnforceExtension::Enabled); - /// assert_eq!(options.enforce_extension, EnforceExtension::Enabled); - /// ``` - #[must_use] - pub fn with_force_extension(mut self, enforce_extension: EnforceExtension) -> Self { - self.enforce_extension = enforce_extension; - self - } - - /// Sets the value for [ResolveOptions::fully_specified] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_fully_specified(true); - /// assert_eq!(options.fully_specified, true); - /// ``` - #[must_use] - pub fn with_fully_specified(mut self, fully_specified: bool) -> Self { - self.fully_specified = fully_specified; - self - } - /// Sets the value for [ResolveOptions::prefer_relative] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_prefer_relative(true); - /// assert_eq!(options.prefer_relative, true); - /// ``` - #[must_use] - pub fn with_prefer_relative(mut self, flag: bool) -> Self { - self.prefer_relative = flag; - self - } - /// Sets the value for [ResolveOptions::prefer_absolute] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_prefer_absolute(true); - /// assert_eq!(options.prefer_absolute, true); - /// ``` - #[must_use] - pub fn with_prefer_absolute(mut self, flag: bool) -> Self { - self.prefer_absolute = flag; - self - } - - /// Changes the value of [ResolveOptions::symlinks] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// - /// let options = ResolveOptions::default().with_symbolic_link(false); - /// assert_eq!(options.symlinks, false); - /// ``` - #[must_use] - pub fn with_symbolic_link(mut self, flag: bool) -> Self { - self.symlinks = flag; - self - } - - /// Adds a module to [ResolveOptions::modules] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// - /// let options = ResolveOptions::default().with_module("module"); - /// assert!(options.modules.contains(&"module".to_string())); - /// ``` - #[must_use] - pub fn with_module>(mut self, module: M) -> Self { - self.modules.push(module.into()); - self - } - - /// Adds a main file to [ResolveOptions::main_files] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// - /// let options = ResolveOptions::default().with_main_file("foo"); - /// assert!(options.main_files.contains(&"foo".to_string())); - /// ``` - #[must_use] - pub fn with_main_file>(mut self, module: M) -> Self { - self.main_files.push(module.into()); - self - } - - pub(crate) fn sanitize(mut self) -> Self { - debug_assert!( - self.extensions.iter().filter(|e| !e.is_empty()).all(|e| e.starts_with('.')), - "All extensions must start with a leading dot" - ); - // Set `enforceExtension` to `true` when [ResolveOptions::extensions] contains an empty string. - // See - if self.enforce_extension == EnforceExtension::Auto { - if !self.extensions.is_empty() && self.extensions.iter().any(String::is_empty) { - self.enforce_extension = EnforceExtension::Enabled; - } else { - self.enforce_extension = EnforceExtension::Disabled; - } - } - self - } -} - -/// Value for [ResolveOptions::enforce_extension] -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -pub enum EnforceExtension { - Auto, - Enabled, - Disabled, -} - -impl EnforceExtension { - pub const fn is_auto(&self) -> bool { - matches!(self, Self::Auto) - } - - pub const fn is_enabled(&self) -> bool { - matches!(self, Self::Enabled) - } - - pub const fn is_disabled(&self) -> bool { - matches!(self, Self::Disabled) - } -} - -/// Alias for [ResolveOptions::alias] and [ResolveOptions::fallback] -pub type Alias = Vec<(String, Vec)>; - -/// Alias Value for [ResolveOptions::alias] and [ResolveOptions::fallback] -#[derive(Debug, Clone, Hash, PartialEq, Eq)] -pub enum AliasValue { - /// The path value - Path(String), - - /// The `false` value - Ignore, -} - -impl From for AliasValue -where - S: Into, -{ - fn from(value: S) -> Self { - Self::Path(value.into()) - } -} - -/// Value for [ResolveOptions::restrictions] -#[derive(Debug, Clone)] -pub enum Restriction { - Path(PathBuf), - RegExp(String), -} - -/// Tsconfig Options for [ResolveOptions::tsconfig] -/// -/// Derived from [tsconfig-paths-webpack-plugin](https://github.com/dividab/tsconfig-paths-webpack-plugin#options) -#[derive(Debug, Clone)] -pub struct TsconfigOptions { - /// Allows you to specify where to find the TypeScript configuration file. - /// You may provide - /// * a relative path to the configuration file. It will be resolved relative to cwd. - /// * an absolute path to the configuration file. - pub config_file: PathBuf, - - /// Support for Typescript Project References. - pub references: TsconfigReferences, -} - -/// Configuration for [TsconfigOptions::references] -#[derive(Debug, Clone)] -pub enum TsconfigReferences { - Disabled, - /// Use the `references` field from tsconfig of `config_file`. - Auto, - /// Manually provided relative or absolute path. - Paths(Vec), -} - -impl Default for ResolveOptions { - fn default() -> Self { - Self { - tsconfig: None, - alias: vec![], - alias_fields: vec![], - condition_names: vec![], - description_files: vec!["package.json".into()], - enforce_extension: EnforceExtension::Auto, - extension_alias: vec![], - exports_fields: vec![vec!["exports".into()]], - imports_fields: vec![vec!["imports".into()]], - extensions: vec![".js".into(), ".json".into(), ".node".into()], - fallback: vec![], - fully_specified: false, - main_fields: vec!["main".into()], - main_files: vec!["index".into()], - modules: vec!["node_modules".into()], - resolve_to_context: false, - prefer_relative: false, - prefer_absolute: false, - restrictions: vec![], - roots: vec![], - symlinks: true, - builtin_modules: false, - } - } -} - -// For tracing -impl fmt::Display for ResolveOptions { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - if let Some(tsconfig) = &self.tsconfig { - write!(f, "tsconfig:{tsconfig:?},")?; - } - if !self.alias.is_empty() { - write!(f, "alias:{:?},", self.alias)?; - } - if !self.alias_fields.is_empty() { - write!(f, "alias_fields:{:?},", self.alias_fields)?; - } - if !self.condition_names.is_empty() { - write!(f, "condition_names:{:?},", self.condition_names)?; - } - if self.enforce_extension.is_enabled() { - write!(f, "enforce_extension:{:?},", self.enforce_extension)?; - } - if !self.exports_fields.is_empty() { - write!(f, "exports_fields:{:?},", self.exports_fields)?; - } - if !self.imports_fields.is_empty() { - write!(f, "imports_fields:{:?},", self.imports_fields)?; - } - if !self.extension_alias.is_empty() { - write!(f, "extension_alias:{:?},", self.extension_alias)?; - } - if !self.extensions.is_empty() { - write!(f, "extensions:{:?},", self.extensions)?; - } - if !self.fallback.is_empty() { - write!(f, "fallback:{:?},", self.fallback)?; - } - if self.fully_specified { - write!(f, "fully_specified:{:?},", self.fully_specified)?; - } - if !self.main_fields.is_empty() { - write!(f, "main_fields:{:?},", self.main_fields)?; - } - if !self.main_files.is_empty() { - write!(f, "main_files:{:?},", self.main_files)?; - } - if !self.modules.is_empty() { - write!(f, "modules:{:?},", self.modules)?; - } - if self.resolve_to_context { - write!(f, "resolve_to_context:{:?},", self.resolve_to_context)?; - } - if self.prefer_relative { - write!(f, "prefer_relative:{:?},", self.prefer_relative)?; - } - if self.prefer_absolute { - write!(f, "prefer_absolute:{:?},", self.prefer_absolute)?; - } - if !self.restrictions.is_empty() { - write!(f, "restrictions:{:?},", self.restrictions)?; - } - if !self.roots.is_empty() { - write!(f, "roots:{:?},", self.roots)?; - } - if self.symlinks { - write!(f, "symlinks:{:?},", self.symlinks)?; - } - if self.builtin_modules { - write!(f, "builtin_modules:{:?},", self.builtin_modules)?; - } - Ok(()) - } -} - -#[cfg(test)] -mod test { - use super::{ - AliasValue, EnforceExtension, ResolveOptions, Restriction, TsconfigOptions, - TsconfigReferences, - }; - use std::path::PathBuf; - - #[test] - fn enforce_extension() { - assert!(EnforceExtension::Auto.is_auto()); - assert!(!EnforceExtension::Enabled.is_auto()); - assert!(!EnforceExtension::Disabled.is_auto()); - - assert!(!EnforceExtension::Auto.is_enabled()); - assert!(EnforceExtension::Enabled.is_enabled()); - assert!(!EnforceExtension::Disabled.is_enabled()); - - assert!(!EnforceExtension::Auto.is_disabled()); - assert!(!EnforceExtension::Enabled.is_disabled()); - assert!(EnforceExtension::Disabled.is_disabled()); - } - - #[test] - fn display() { - let options = ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: PathBuf::from("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - alias: vec![("a".into(), vec![AliasValue::Ignore])], - alias_fields: vec![vec!["browser".into()]], - condition_names: vec!["require".into()], - enforce_extension: EnforceExtension::Enabled, - extension_alias: vec![(".js".into(), vec![".ts".into()])], - exports_fields: vec![vec!["exports".into()]], - imports_fields: vec![vec!["imports".into()]], - fallback: vec![("fallback".into(), vec![AliasValue::Ignore])], - fully_specified: true, - resolve_to_context: true, - prefer_relative: true, - prefer_absolute: true, - restrictions: vec![Restriction::Path(PathBuf::from("restrictions"))], - roots: vec![PathBuf::from("roots")], - builtin_modules: true, - ..ResolveOptions::default() - }; - - let expected = r#"tsconfig:TsconfigOptions { config_file: "tsconfig.json", references: Auto },alias:[("a", [Ignore])],alias_fields:[["browser"]],condition_names:["require"],enforce_extension:Enabled,exports_fields:[["exports"]],imports_fields:[["imports"]],extension_alias:[(".js", [".ts"])],extensions:[".js", ".json", ".node"],fallback:[("fallback", [Ignore])],fully_specified:true,main_fields:["main"],main_files:["index"],modules:["node_modules"],resolve_to_context:true,prefer_relative:true,prefer_absolute:true,restrictions:[Path("restrictions")],roots:["roots"],symlinks:true,builtin_modules:true,"#; - assert_eq!(format!("{options}"), expected); - - let options = ResolveOptions { - alias: vec![], - alias_fields: vec![], - builtin_modules: false, - condition_names: vec![], - description_files: vec![], - enforce_extension: EnforceExtension::Disabled, - exports_fields: vec![], - extension_alias: vec![], - extensions: vec![], - fallback: vec![], - fully_specified: false, - imports_fields: vec![], - main_fields: vec![], - main_files: vec![], - modules: vec![], - prefer_absolute: false, - prefer_relative: false, - resolve_to_context: false, - restrictions: vec![], - roots: vec![], - symlinks: false, - tsconfig: None, - }; - - assert_eq!(format!("{options}"), ""); - } -} diff --git a/src/package_json.rs b/src/package_json.rs deleted file mode 100644 index 73901faa..00000000 --- a/src/package_json.rs +++ /dev/null @@ -1,207 +0,0 @@ -//! package.json definitions -//! -//! Code related to export field are copied from [Parcel's resolver](https://github.com/parcel-bundler/parcel/blob/v2/packages/utils/node-resolver-rs/src/package_json.rs) -use std::path::{Path, PathBuf}; - -use serde_json::Value as JSONValue; - -use crate::{path::PathUtil, ResolveError}; - -pub type JSONMap = serde_json::Map; - -/// Deserialized package.json -#[derive(Debug, Default)] -pub struct PackageJson { - /// Path to `package.json`. Contains the `package.json` filename. - pub path: PathBuf, - - /// Realpath to `package.json`. Contains the `package.json` filename. - pub realpath: PathBuf, - - /// The "name" field defines your package's name. - /// The "name" field can be used in addition to the "exports" field to self-reference a package using its name. - /// - /// - pub name: Option, - - raw_json: std::sync::Arc, -} - -impl PackageJson { - /// # Panics - /// # Errors - pub(crate) fn parse( - path: PathBuf, - realpath: PathBuf, - json: &str, - ) -> Result { - let mut raw_json: JSONValue = serde_json::from_str(json)?; - let mut package_json = Self::default(); - - if let Some(json_object) = raw_json.as_object_mut() { - // Remove large fields that are useless for pragmatic use. - #[cfg(feature = "package_json_raw_json_api")] - { - json_object.remove("description"); - json_object.remove("keywords"); - json_object.remove("scripts"); - json_object.remove("dependencies"); - json_object.remove("devDependencies"); - json_object.remove("peerDependencies"); - json_object.remove("optionalDependencies"); - } - - // Add name. - package_json.name = - json_object.get("name").and_then(|field| field.as_str()).map(ToString::to_string); - } - - package_json.path = path; - package_json.realpath = realpath; - package_json.raw_json = std::sync::Arc::new(raw_json); - Ok(package_json) - } - - fn get_value_by_path<'a>( - fields: &'a serde_json::Map, - path: &[String], - ) -> Option<&'a JSONValue> { - if path.is_empty() { - return None; - } - let mut value = fields.get(&path[0])?; - for key in path.iter().skip(1) { - if let Some(inner_value) = value.as_object().and_then(|o| o.get(key)) { - value = inner_value; - } else { - return None; - } - } - Some(value) - } - - /// Raw serde json value of `package.json`. - /// - /// This is currently used in Rspack for: - /// * getting the `sideEffects` field - /// * query in - search on GitHub indicates query on the `type` field. - /// - /// To reduce overall memory consumption, large fields that useless for pragmatic use are removed. - /// They are: `description`, `keywords`, `scripts`, - /// `dependencies` and `devDependencies`, `peerDependencies`, `optionalDependencies`. - #[cfg(feature = "package_json_raw_json_api")] - pub fn raw_json(&self) -> &std::sync::Arc { - &self.raw_json - } - - /// Directory to `package.json` - /// - /// # Panics - /// - /// * When the package.json path is misconfigured. - pub fn directory(&self) -> &Path { - debug_assert!(self.realpath.file_name().is_some_and(|x| x == "package.json")); - self.realpath.parent().unwrap() - } - - /// The "main" field defines the entry point of a package when imported by name via a node_modules lookup. Its value is a path. - /// - /// When a package has an "exports" field, this will take precedence over the "main" field when importing the package by name. - /// - /// Values are dynamically retrieved from [ResolveOptions::main_fields]. - /// - /// - pub(crate) fn main_fields<'a>( - &'a self, - main_fields: &'a [String], - ) -> impl Iterator + '_ { - main_fields - .iter() - .filter_map(|main_field| self.raw_json.get(main_field)) - .filter_map(|value| value.as_str()) - } - - /// The "exports" field allows defining the entry points of a package when imported by name loaded either via a node_modules lookup or a self-reference to its own name. - /// - /// - pub(crate) fn exports_fields<'a>( - &'a self, - exports_fields: &'a [Vec], - ) -> impl Iterator + '_ { - exports_fields.iter().filter_map(|object_path| { - self.raw_json - .as_object() - .and_then(|json_object| Self::get_value_by_path(json_object, object_path)) - }) - } - - /// In addition to the "exports" field, there is a package "imports" field to create private mappings that only apply to import specifiers from within the package itself. - /// - /// - pub(crate) fn imports_fields<'a>( - &'a self, - imports_fields: &'a [Vec], - ) -> impl Iterator + '_ { - imports_fields.iter().filter_map(|object_path| { - self.raw_json - .as_object() - .and_then(|json_object| Self::get_value_by_path(json_object, object_path)) - .and_then(|value| value.as_object()) - }) - } - - /// The "browser" field is provided by a module author as a hint to javascript bundlers or component tools when packaging modules for client side use. - /// Multiple values are configured by [ResolveOptions::alias_fields]. - /// - /// - fn browser_fields<'a>( - &'a self, - alias_fields: &'a [Vec], - ) -> impl Iterator + '_ { - alias_fields.iter().filter_map(|object_path| { - self.raw_json - .as_object() - .and_then(|json_object| Self::get_value_by_path(json_object, object_path)) - // Only object is valid, all other types are invalid - // https://github.com/webpack/enhanced-resolve/blob/3a28f47788de794d9da4d1702a3a583d8422cd48/lib/AliasFieldPlugin.js#L44-L52 - .and_then(|value| value.as_object()) - }) - } - - /// Resolve the request string for this package.json by looking at the `browser` field. - /// - /// # Errors - /// - /// * Returns [ResolveError::Ignored] for `"path": false` in `browser` field. - pub(crate) fn resolve_browser_field<'a>( - &'a self, - path: &Path, - request: Option<&str>, - alias_fields: &'a [Vec], - ) -> Result, ResolveError> { - for object in self.browser_fields(alias_fields) { - if let Some(request) = request { - if let Some(value) = object.get(request) { - return Self::alias_value(path, value); - } - } else { - let dir = self.path.parent().unwrap(); - for (key, value) in object { - let joined = dir.normalize_with(key); - if joined == path { - return Self::alias_value(path, value); - } - } - } - } - Ok(None) - } - - fn alias_value<'a>(key: &Path, value: &'a JSONValue) -> Result, ResolveError> { - match value { - JSONValue::String(value) => Ok(Some(value.as_str())), - JSONValue::Bool(b) if !b => Err(ResolveError::Ignored(key.to_path_buf())), - _ => Ok(None), - } - } -} diff --git a/src/path.rs b/src/path.rs deleted file mode 100644 index f66fdd76..00000000 --- a/src/path.rs +++ /dev/null @@ -1,132 +0,0 @@ -//! Path Utilities -//! -//! Code adapted from the following libraries -//! * [path-absolutize](https://docs.rs/path-absolutize) -//! * [normalize_path](https://docs.rs/normalize-path) -use std::path::{Component, Path, PathBuf}; - -pub const SLASH_START: &[char; 2] = &['/', '\\']; - -/// Extension trait to add path normalization to std's [`Path`]. -pub trait PathUtil { - /// Normalize this path without performing I/O. - /// - /// All redundant separator and up-level references are collapsed. - /// - /// However, this does not resolve links. - fn normalize(&self) -> PathBuf; - - /// Normalize with subpath assuming this path is normalized without performing I/O. - /// - /// All redundant separator and up-level references are collapsed. - /// - /// However, this does not resolve links. - fn normalize_with>(&self, subpath: P) -> PathBuf; - - /// Defined in ESM PACKAGE_TARGET_RESOLVE - /// If target split on "/" or "\" contains any "", ".", "..", or "node_modules" segments after the first "." segment, case insensitive and including percent encoded variants - fn is_invalid_exports_target(&self) -> bool; -} - -impl PathUtil for Path { - // https://github.com/parcel-bundler/parcel/blob/e0b99c2a42e9109a9ecbd6f537844a1b33e7faf5/packages/utils/node-resolver-rs/src/path.rs#L7 - fn normalize(&self) -> PathBuf { - let mut components = self.components().peekable(); - let mut ret = if let Some(c @ Component::Prefix(..)) = components.peek() { - let buf = PathBuf::from(c.as_os_str()); - components.next(); - buf - } else { - PathBuf::new() - }; - - for component in components { - match component { - Component::Prefix(..) => unreachable!("Path {:?}", self), - Component::RootDir => { - ret.push(component.as_os_str()); - } - Component::CurDir => {} - Component::ParentDir => { - ret.pop(); - } - Component::Normal(c) => { - ret.push(c); - } - } - } - - ret - } - - // https://github.com/parcel-bundler/parcel/blob/e0b99c2a42e9109a9ecbd6f537844a1b33e7faf5/packages/utils/node-resolver-rs/src/path.rs#L37 - fn normalize_with>(&self, subpath: B) -> PathBuf { - let subpath = subpath.as_ref(); - - let mut components = subpath.components(); - - let Some(head) = components.next() else { return subpath.to_path_buf() }; - - if matches!(head, Component::Prefix(..) | Component::RootDir) { - return subpath.to_path_buf(); - } - - let mut ret = self.to_path_buf(); - for component in std::iter::once(head).chain(components) { - match component { - Component::CurDir => {} - Component::ParentDir => { - ret.pop(); - } - Component::Normal(c) => { - ret.push(c); - } - Component::Prefix(..) | Component::RootDir => { - unreachable!("Path {:?} Subpath {:?}", self, subpath) - } - } - } - - ret - } - - fn is_invalid_exports_target(&self) -> bool { - self.components().enumerate().any(|(index, c)| match c { - Component::ParentDir => true, - Component::CurDir => index > 0, - Component::Normal(c) => c.eq_ignore_ascii_case("node_modules"), - _ => false, - }) - } -} - -// https://github.com/webpack/enhanced-resolve/blob/main/test/path.test.js -#[test] -fn is_invalid_exports_target() { - let test_cases = [ - "../a.js", - "../", - "./a/b/../../../c.js", - "./a/b/../../../", - "./../../c.js", - "./../../", - "./a/../b/../../c.js", - "./a/../b/../../", - "./././../", - ]; - - for case in test_cases { - assert!(Path::new(case).is_invalid_exports_target(), "{case}"); - } - - assert!(!Path::new("C:").is_invalid_exports_target()); - assert!(!Path::new("/").is_invalid_exports_target()); -} - -#[test] -fn normalize() { - assert_eq!(Path::new("/foo/.././foo/").normalize(), Path::new("/foo")); - assert_eq!(Path::new("C://").normalize(), Path::new("C://")); - assert_eq!(Path::new("C:").normalize(), Path::new("C:")); - assert_eq!(Path::new(r"\\server\share").normalize(), Path::new(r"\\server\share")); -} diff --git a/src/resolution.rs b/src/resolution.rs deleted file mode 100644 index a3aaa2e7..00000000 --- a/src/resolution.rs +++ /dev/null @@ -1,92 +0,0 @@ -use crate::package_json::PackageJson; -use std::{ - fmt, - path::{Path, PathBuf}, - sync::Arc, -}; - -/// The final path resolution with optional `?query` and `#fragment` -#[derive(Clone)] -pub struct Resolution { - pub(crate) path: PathBuf, - - /// path query `?query`, contains `?`. - pub(crate) query: Option, - - /// path fragment `#query`, contains `#`. - pub(crate) fragment: Option, - - pub(crate) package_json: Option>, -} - -impl fmt::Debug for Resolution { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - f.debug_struct("Resolution") - .field("path", &self.path) - .field("query", &self.query) - .field("fragment", &self.fragment) - .field("package_json", &self.package_json.as_ref().map(|p| &p.path)) - .finish() - } -} - -impl PartialEq for Resolution { - fn eq(&self, other: &Self) -> bool { - self.path == other.path && self.query == other.query && self.fragment == other.fragment - } -} -impl Eq for Resolution {} - -impl Resolution { - /// Returns the path without query and fragment - pub fn path(&self) -> &Path { - &self.path - } - - /// Returns the path without query and fragment - pub fn into_path_buf(self) -> PathBuf { - self.path - } - - /// Returns the path query `?query`, contains the leading `?` - pub fn query(&self) -> Option<&str> { - self.query.as_deref() - } - - /// Returns the path fragment `#fragment`, contains the leading `#` - pub fn fragment(&self) -> Option<&str> { - self.fragment.as_deref() - } - - /// Returns serialized package_json - pub fn package_json(&self) -> Option<&Arc> { - self.package_json.as_ref() - } - - /// Returns the full path with query and fragment - pub fn full_path(&self) -> PathBuf { - let mut path = self.path.clone().into_os_string(); - if let Some(query) = &self.query { - path.push(query); - } - if let Some(fragment) = &self.fragment { - path.push(fragment); - } - PathBuf::from(path) - } -} - -#[test] -fn test() { - let resolution = Resolution { - path: PathBuf::from("foo"), - query: Some("?query".to_string()), - fragment: Some("#fragment".to_string()), - package_json: None, - }; - assert_eq!(resolution.path(), Path::new("foo")); - assert_eq!(resolution.query(), Some("?query")); - assert_eq!(resolution.fragment(), Some("#fragment")); - assert_eq!(resolution.full_path(), PathBuf::from("foo?query#fragment")); - assert_eq!(resolution.into_path_buf(), PathBuf::from("foo")); -} diff --git a/src/specifier.rs b/src/specifier.rs deleted file mode 100644 index 3d35eafc..00000000 --- a/src/specifier.rs +++ /dev/null @@ -1,230 +0,0 @@ -use crate::error::SpecifierError; -use std::borrow::Cow; - -#[derive(Debug)] -pub struct Specifier<'a> { - path: Cow<'a, str>, - pub query: Option<&'a str>, - pub fragment: Option<&'a str>, -} - -impl<'a> Specifier<'a> { - pub fn path(&'a self) -> &'a str { - self.path.as_ref() - } - - pub fn parse(specifier: &'a str) -> Result, SpecifierError> { - if specifier.is_empty() { - return Err(SpecifierError::Empty(specifier.to_string())); - } - let offset = match specifier.as_bytes()[0] { - b'/' | b'.' | b'#' => 1, - _ => 0, - }; - let (path, query, fragment) = Self::parse_query_framgment(specifier, offset); - if path.is_empty() { - return Err(SpecifierError::Empty(specifier.to_string())); - } - Ok(Self { path, query, fragment }) - } - - fn parse_query_framgment( - specifier: &'a str, - skip: usize, - ) -> (Cow<'a, str>, Option<&str>, Option<&str>) { - let mut query_start: Option = None; - let mut fragment_start: Option = None; - - let mut prev = specifier.chars().next().unwrap(); - let mut escaped_indexes = vec![]; - for (i, c) in specifier.char_indices().skip(skip) { - if c == '?' && query_start.is_none() { - query_start = Some(i); - } - if c == '#' { - if prev == '\0' { - escaped_indexes.push(i - 1); - } else { - fragment_start = Some(i); - break; - } - } - prev = c; - } - - let (path, query, fragment) = match (query_start, fragment_start) { - (Some(i), Some(j)) => { - debug_assert!(i < j); - (&specifier[..i], Some(&specifier[i..j]), Some(&specifier[j..])) - } - (Some(i), None) => (&specifier[..i], Some(&specifier[i..]), None), - (None, Some(j)) => (&specifier[..j], None, Some(&specifier[j..])), - _ => (specifier, None, None), - }; - - let path = if escaped_indexes.is_empty() { - Cow::Borrowed(path) - } else { - // Remove the `\0` characters for a legal path. - Cow::Owned( - path.chars() - .enumerate() - .filter_map(|(i, c)| (!escaped_indexes.contains(&i)).then_some(c)) - .collect::(), - ) - }; - - (path, query, fragment) - } -} - -#[cfg(test)] -mod tests { - use super::{Specifier, SpecifierError}; - - #[test] - fn debug() { - let specifier = Specifier::parse("/").unwrap(); - assert_eq!( - format!("{specifier:?}"), - r#"Specifier { path: "/", query: None, fragment: None }"# - ); - } - - #[test] - fn empty() { - let specifiers = ["", "?"]; - for specifier in specifiers { - let error = Specifier::parse(specifier).unwrap_err(); - assert_eq!(error, SpecifierError::Empty(specifier.to_string())); - } - } - - #[test] - fn absolute() -> Result<(), SpecifierError> { - let specifier = "/test?#"; - let parsed = Specifier::parse(specifier)?; - assert_eq!(parsed.path, "/test"); - assert_eq!(parsed.query, Some("?")); - assert_eq!(parsed.fragment, Some("#")); - Ok(()) - } - - #[test] - fn relative() -> Result<(), SpecifierError> { - let specifiers = ["./test", "../test", "../../test"]; - for specifier in specifiers { - let mut r = specifier.to_string(); - r.push_str("?#"); - let parsed = Specifier::parse(&r)?; - assert_eq!(parsed.path, specifier); - assert_eq!(parsed.query, Some("?")); - assert_eq!(parsed.fragment, Some("#")); - } - Ok(()) - } - - #[test] - fn hash() -> Result<(), SpecifierError> { - let specifiers = ["#", "#path"]; - for specifier in specifiers { - let mut r = specifier.to_string(); - r.push_str("?#"); - let parsed = Specifier::parse(&r)?; - assert_eq!(parsed.path, specifier); - assert_eq!(parsed.query, Some("?")); - assert_eq!(parsed.fragment, Some("#")); - } - Ok(()) - } - - #[test] - fn module() -> Result<(), SpecifierError> { - let specifiers = ["module"]; - for specifier in specifiers { - let mut r = specifier.to_string(); - r.push_str("?#"); - let parsed = Specifier::parse(&r)?; - assert_eq!(parsed.path, specifier); - assert_eq!(parsed.query, Some("?")); - assert_eq!(parsed.fragment, Some("#")); - } - Ok(()) - } - - #[test] - fn query_fragment() -> Result<(), SpecifierError> { - let data = [ - ("a?", Some("?"), None), - ("a?query", Some("?query"), None), - ("a?query1?query2", Some("?query1?query2"), None), - ("a?query1?query2?query3", Some("?query1?query2?query3"), None), - ("a#", None, Some("#")), - ("a#b#c", None, Some("#b#c")), - ("a#fragment", None, Some("#fragment")), - ("a?#", Some("?"), Some("#")), - ("a?#fragment", Some("?"), Some("#fragment")), - ("a?query#", Some("?query"), Some("#")), - ("a?query#fragment", Some("?query"), Some("#fragment")), - ("a#fragment?", None, Some("#fragment?")), - ("a#fragment?query", None, Some("#fragment?query")), - ]; - - for (specifier_str, query, fragment) in data { - let specifier = Specifier::parse(specifier_str)?; - assert_eq!(specifier.path, "a", "{specifier_str}"); - assert_eq!(specifier.query, query, "{specifier_str}"); - assert_eq!(specifier.fragment, fragment, "{specifier_str}"); - } - - Ok(()) - } - - #[test] - // https://github.com/webpack/enhanced-resolve/blob/main/test/identifier.test.js - fn enhanced_resolve_edge_cases() -> Result<(), SpecifierError> { - let data = [ - ("path/#", "path/", "", "#"), - ("path/as/?", "path/as/", "?", ""), - ("path/#/?", "path/", "", "#/?"), - ("path/#repo#hash", "path/", "", "#repo#hash"), - ("path/#r#hash", "path/", "", "#r#hash"), - ("path/#repo/#repo2#hash", "path/", "", "#repo/#repo2#hash"), - ("path/#r/#r#hash", "path/", "", "#r/#r#hash"), - ("path/#/not/a/hash?not-a-query", "path/", "", "#/not/a/hash?not-a-query"), - ]; - - for (specifier_str, path, query, fragment) in data { - let specifier = Specifier::parse(specifier_str)?; - assert_eq!(specifier.path, path, "{specifier_str}"); - assert_eq!(specifier.query.unwrap_or(""), query, "{specifier_str}"); - assert_eq!(specifier.fragment.unwrap_or(""), fragment, "{specifier_str}"); - } - - Ok(()) - } - - // https://github.com/webpack/enhanced-resolve/blob/main/test/identifier.test.js - #[test] - fn enhanced_resolve_windows_like() -> Result<(), SpecifierError> { - let data = [ - ("path\\#", "path\\", "", "#"), - ("path\\as\\?", "path\\as\\", "?", ""), - ("path\\#\\?", "path\\", "", "#\\?"), - ("path\\#repo#hash", "path\\", "", "#repo#hash"), - ("path\\#r#hash", "path\\", "", "#r#hash"), - ("path\\#repo\\#repo2#hash", "path\\", "", "#repo\\#repo2#hash"), - ("path\\#r\\#r#hash", "path\\", "", "#r\\#r#hash"), - ("path\\#/not/a/hash?not-a-query", "path\\", "", "#/not/a/hash?not-a-query"), - ]; - - for (specifier_str, path, query, fragment) in data { - let specifier = Specifier::parse(specifier_str)?; - assert_eq!(specifier.path, path, "{specifier_str}"); - assert_eq!(specifier.query.unwrap_or(""), query, "{specifier_str}"); - assert_eq!(specifier.fragment.unwrap_or(""), fragment, "{specifier_str}"); - } - - Ok(()) - } -} diff --git a/src/tests/alias.rs b/src/tests/alias.rs deleted file mode 100644 index 07c615f4..00000000 --- a/src/tests/alias.rs +++ /dev/null @@ -1,280 +0,0 @@ -//! - -use normalize_path::NormalizePath; -use std::path::Path; - -use crate::{AliasValue, Resolution, ResolveContext, ResolveError, ResolveOptions, Resolver}; - -#[test] -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -fn alias() { - use super::memory_fs::MemoryFS; - use crate::ResolverGeneric; - use std::path::{Path, PathBuf}; - - let f = Path::new("/"); - - let file_system = MemoryFS::new(&[ - ("/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", ""), - ("/dashed-name", ""), - ]); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - alias: vec![ - ("aliasA".into(), vec![AliasValue::from("a")]), - ("b$".into(), vec![AliasValue::from("a/index")]), - ("c$".into(), vec![AliasValue::from("/a/index")]), - ( - "multiAlias".into(), - vec![ - AliasValue::from("b"), - AliasValue::from("c"), - AliasValue::from("d"), - AliasValue::from("e"), - AliasValue::from("a"), - ], - ), - ("recursive".into(), vec![AliasValue::from("recursive/dir")]), - ("/d/dir".into(), vec![AliasValue::from("/c/dir")]), - ("/d/index.js".into(), vec![AliasValue::from("/c/index")]), - ("#".into(), vec![AliasValue::from("/c/dir")]), - ("@".into(), vec![AliasValue::from("/c/dir")]), - ("ignored".into(), vec![AliasValue::Ignore]), - // not part of enhanced-resolve, added to make sure query in alias value works - ("alias_query".into(), vec![AliasValue::from("a?query_after")]), - ("alias_fragment".into(), vec![AliasValue::from("a#fragment_after")]), - ("dash".into(), vec![AliasValue::Ignore]), - ("@scope/package-name/file$".into(), vec![AliasValue::from("/c/dir")]), - ], - modules: vec!["/".into()], - ..ResolveOptions::default() - }, - ); - - #[rustfmt::skip] - let pass = [ - ("should resolve a not aliased module 1", "a", "/a/index"), - ("should resolve a not aliased module 2", "a/index", "/a/index"), - ("should resolve a not aliased module 3", "a/dir", "/a/dir/index"), - ("should resolve a not aliased module 4", "a/dir/index", "/a/dir/index"), - ("should resolve an aliased module 1", "aliasA", "/a/index"), - ("should resolve an aliased module 2", "aliasA/index", "/a/index"), - ("should resolve an aliased module 3", "aliasA/dir", "/a/dir/index"), - ("should resolve an aliased module 4", "aliasA/dir/index", "/a/dir/index"), - ("should resolve '#' alias 1", "#", "/c/dir/index"), - ("should resolve '#' alias 2", "#/index", "/c/dir/index"), - ("should resolve '@' alias 1", "@", "/c/dir/index"), - ("should resolve '@' alias 2", "@/index", "/c/dir/index"), - ("should resolve a recursive aliased module 1", "recursive", "/recursive/dir/index"), - ("should resolve a recursive aliased module 2", "recursive/index", "/recursive/dir/index"), - ("should resolve a recursive aliased module 3", "recursive/dir", "/recursive/dir/index"), - ("should resolve a recursive aliased module 4", "recursive/dir/index", "/recursive/dir/index"), - ("should resolve a file aliased module 1", "b", "/a/index"), - ("should resolve a file aliased module 2", "c", "/a/index"), - ("should resolve a file aliased module with a query 1", "b?query", "/a/index?query"), - ("should resolve a file aliased module with a query 2", "c?query", "/a/index?query"), - ("should resolve a path in a file aliased module 1", "b/index", "/b/index"), - ("should resolve a path in a file aliased module 2", "b/dir", "/b/dir/index"), - ("should resolve a path in a file aliased module 3", "b/dir/index", "/b/dir/index"), - ("should resolve a path in a file aliased module 4", "c/index", "/c/index"), - ("should resolve a path in a file aliased module 5", "c/dir", "/c/dir/index"), - ("should resolve a path in a file aliased module 6", "c/dir/index", "/c/dir/index"), - ("should resolve a file aliased file 1", "d", "/c/index"), - ("should resolve a file aliased file 2", "d/dir/index", "/c/dir/index"), - ("should resolve a file in multiple aliased dirs 1", "multiAlias/dir/file", "/e/dir/file"), - ("should resolve a file in multiple aliased dirs 2", "multiAlias/anotherDir", "/e/anotherDir/index"), - // not part of enhanced-resolve, added to make sure query in alias value works - ("should resolve query in alias value", "alias_query?query_before", "/a/index?query_after"), - ("should resolve query in alias value", "alias_fragment#fragment_before", "/a/index#fragment_after"), - ("should resolve dashed name", "dashed-name", "/dashed-name"), - ("should resolve scoped package name with sub dir", "@scope/package-name/file", "/c/dir/index"), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - - #[rustfmt::skip] - let ignore = [ - ("should resolve an ignore module", "ignored", ResolveError::Ignored(f.join("ignored"))) - ]; - - for (comment, request, expected) in ignore { - let resolution = resolver.resolve(f, request); - assert_eq!(resolution, Err(expected), "{comment} {request}"); - } -} - -// Not part of enhanced-resolve -#[test] -fn infinite_recursion() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![ - ("./a".into(), vec![AliasValue::from("./b")]), - ("./b".into(), vec![AliasValue::from("./a")]), - ], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(f, "./a"); - assert_eq!(resolution, Err(ResolveError::Recursion)); -} - -fn check_slash(path: &Path) { - let s = path.to_string_lossy().to_string(); - #[cfg(target_os = "windows")] - { - assert!(!s.contains('/'), "{s}"); - assert!(s.contains('\\'), "{s}"); - } - #[cfg(not(target_os = "windows"))] - { - assert!(s.contains('/'), "{s}"); - assert!(!s.contains('\\'), "{s}"); - } -} - -#[test] -fn absolute_path() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![(f.join("foo").to_str().unwrap().to_string(), vec![AliasValue::Ignore])], - modules: vec![f.clone().to_str().unwrap().to_string()], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(&f, "foo/index"); - assert_eq!(resolution, Err(ResolveError::Ignored(f.join("foo")))); -} - -#[test] -fn system_path() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![("@app".into(), vec![AliasValue::from(f.join("alias").to_string_lossy())])], - ..ResolveOptions::default() - }); - - let specifiers = ["@app/files/a", "@app/files/a.js"]; - - for specifier in specifiers { - let path = resolver.resolve(&f, specifier).map(Resolution::into_path_buf).unwrap(); - assert_eq!(path, f.join("alias/files/a.js")); - check_slash(&path); - } -} - -#[test] -fn alias_is_full_path() { - let f = super::fixture(); - let dir = f.join("foo"); - let dir_str = dir.to_string_lossy().to_string(); - - let resolver = Resolver::new(ResolveOptions { - alias: vec![("@".into(), vec![AliasValue::Path(dir_str.clone())])], - ..ResolveOptions::default() - }); - - let mut ctx = ResolveContext::default(); - - let specifiers = [ - "@/index".to_string(), - "@/index.js".to_string(), - // specifier has multiple `/` for reasons we'll never know - "@////index".to_string(), - // specifier is a full path - dir_str, - ]; - - for specifier in specifiers { - let resolution = resolver.resolve_with_context(&f, &specifier, &mut ctx); - assert_eq!(resolution.map(|r| r.full_path()), Ok(dir.join("index.js"))); - } - - for path in ctx.file_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - check_slash(&path); - } - - for path in ctx.missing_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - check_slash(&path); - if let Some(path) = path.parent() { - assert!(!path.is_file(), "{path:?} must not be a file"); - } - } -} - -// For the `should_stop` variable in `load_alias` -#[test] -fn all_alias_values_are_not_found() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![( - "m1".to_string(), - vec![AliasValue::Path(f.join("node_modules").join("m2").to_string_lossy().to_string())], - )], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(&f, "m1/a.js"); - assert_eq!(resolution, Err(ResolveError::NotFound("m1/a.js".to_string()))); -} - -#[test] -fn alias_fragment() { - let f = super::fixture(); - - let data = [ - // enhanced-resolve has `#` prepended with a `\0`, they are removed from the - // following 3 expected test results. - // See https://github.com/webpack/enhanced-resolve#escaping - ( - "handle fragment edge case (no fragment)", - "./no#fragment/#/#", - f.join("no#fragment/#/#.js"), - ), - ("handle fragment edge case (fragment)", "./no#fragment/#/", f.join("no.js#fragment/#/")), - ( - "handle fragment escaping", - "./no\0#fragment/\0#/\0##fragment", - f.join("no#fragment/#/#.js#fragment"), - ), - ]; - - for (comment, request, expected) in data { - let resolver = Resolver::new(ResolveOptions { - alias: vec![("foo".to_string(), vec![AliasValue::Path(request.to_string())])], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f, "foo").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } -} - -#[test] -fn alias_try_fragment_as_path() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![( - "#".to_string(), - vec![AliasValue::Path(f.join("#").to_string_lossy().to_string())], - )], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(&f, "#/a").map(|r| r.full_path()); - assert_eq!(resolution, Ok(f.join("#").join("a.js"))); -} diff --git a/src/tests/browser_field.rs b/src/tests/browser_field.rs deleted file mode 100644 index 171ee099..00000000 --- a/src/tests/browser_field.rs +++ /dev/null @@ -1,189 +0,0 @@ -//! - -use crate::{AliasValue, ResolveError, ResolveOptions, Resolver}; - -#[test] -fn ignore() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![ - vec!["browser".into()], - vec!["innerBrowser1".into()], - vec!["innerBrowser2".into()], - vec![], - ], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - (f.clone(), "./lib/ignore", f.join("lib/ignore.js")), - (f.clone(), "./lib/ignore.js", f.join("lib/ignore.js")), - (f.join("lib"), "./ignore", f.join("lib/ignore.js")), - (f.join("lib"), "./ignore.js", f.join("lib/ignore.js")), - ]; - - for (path, request, expected) in data { - let resolution = resolver.resolve(&path, request); - let expected = ResolveError::Ignored(expected); - assert_eq!(resolution, Err(expected), "{path:?} {request}"); - } -} - -#[test] -fn shared_resolvers() { - let f = super::fixture().join("browser-module"); - - let resolver1 = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["innerBrowser1".into(), "field".into(), "browser".into()]], - ..ResolveOptions::default() - }); - let resolved_path = resolver1.resolve(&f, "./lib/main1.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("lib/main.js"))); - - let resolver2 = resolver1.clone_with_options(ResolveOptions { - alias_fields: vec![vec!["innerBrowser2".into(), "browser".into()]], - ..ResolveOptions::default() - }); - let resolved_path = resolver2.resolve(&f, "./lib/main2.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("./lib/replaced.js"))); -} - -#[test] -fn replace_file() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![ - vec!["browser".into()], - vec!["innerBrowser1".into(), "field2".into(), "browser".into()], // not presented - vec!["innerBrowser1".into(), "field".into(), "browser".into()], - vec!["innerBrowser2".into(), "browser".into()], - ], - // Not part of enhanced-resolve. Added to make sure no interaction between these two fields. - main_fields: vec!["browser".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - ("should replace a file 1", f.clone(), "./lib/replaced", f.join("lib/browser.js")), - ("should replace a file 2", f.clone(), "./lib/replaced.js", f.join("lib/browser.js")), - ("should replace a file 3", f.join("lib"), "./replaced", f.join("lib/browser.js")), - ("should replace a file 4", f.join("lib"), "./replaced.js", f.join("lib/browser.js")), - ("should replace a module with a file 1", f.clone(), "module-a", f.join("browser/module-a.js")), - ("should replace a module with a file 2", f.join("lib"), "module-a", f.join("browser/module-a.js")), - ("should replace a module with a module 1", f.clone(), "module-b", f.join("node_modules/module-c.js")), - ("should replace a module with a module 2", f.join("lib"), "module-b", f.join("node_modules/module-c.js")), - ("should resolve in nested property 1", f.clone(), "./lib/main1.js", f.join("lib/main.js")), - ("should resolve in nested property 2", f.clone(), "./lib/main2.js", f.join("lib/browser.js")), - ("should check only alias field properties", f.clone(), "./toString", f.join("lib/toString.js")), - // not part of enhanced-resolve - ("recursion", f.clone(), "module-c", f.join("node_modules/module-c.js")), - ("resolve self 1", f.clone(), "./lib/main.js", f.join("lib/main.js")), - ("resolve self 2", f.clone(), "./main.js", f.join("lib/main.js")), - ]; - - for (comment, path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn recurse_fail() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - ("recurse non existent", f.clone(), "./lib/non-existent.js", ResolveError::NotFound("./lib/non-existent.js".into())), - ("path partial match 1", f.clone(), "./xyz.js", ResolveError::NotFound("./xyz.js".into())), - ("path partial match 2", f, "./lib/xyz.js", ResolveError::NotFound("./lib/xyz.js".into())), - ]; - - for (comment, path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Err(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn broken() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - // The browser field string value should be ignored - (f.clone(), "browser-module-broken", Ok(f.join("node_modules/browser-module-broken/main.js"))), - (f.join("browser-module"), "./number", Err(ResolveError::NotFound("./number".into()))), - ]; - - for (path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, expected, "{path:?} {request}"); - } -} - -#[test] -fn crypto_js() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - fallback: vec![( - "crypto".into(), - vec![AliasValue::from(f.join("lib.js").to_string_lossy())], - )], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(f.join("crypto-js"), "crypto").map(|r| r.full_path()); - assert_eq!(resolved_path, Err(ResolveError::Ignored(f.join("crypto-js")))); -} - -// https://github.com/webpack/webpack/blob/87660921808566ef3b8796f8df61bd79fc026108/test/cases/resolving/browser-field/index.js#L40-L43 -#[test] -fn recursive() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - let data = [ - ("should handle recursive file 1", f.clone(), "recursive-file/a"), - ("should handle recursive file 2", f.clone(), "recursive-file/b"), - ("should handle recursive file 3", f.clone(), "recursive-file/c"), - ("should handle recursive file 4", f, "recursive-file/d"), - ]; - - for (comment, path, request) in data { - let resolved_path = resolver.resolve(&path, request); - assert_eq!(resolved_path, Err(ResolveError::Recursion), "{comment} {path:?} {request}"); - } -} - -#[test] -fn with_query() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "./foo").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("lib").join("browser.js?query"))); -} diff --git a/src/tests/builtins.rs b/src/tests/builtins.rs deleted file mode 100644 index 5d6d14d9..00000000 --- a/src/tests/builtins.rs +++ /dev/null @@ -1,121 +0,0 @@ -use std::path::Path; - -use crate::{ResolveError, ResolveOptions, Resolver}; - -#[test] -fn builtins_off() { - let f = Path::new("/"); - let resolver = Resolver::default(); - let resolved_path = resolver.resolve(f, "zlib").map(|r| r.full_path()); - assert_eq!(resolved_path, Err(ResolveError::NotFound("zlib".into()))); -} - -#[test] -fn builtins() { - let f = Path::new("/"); - - let resolver = Resolver::new(ResolveOptions::default().with_builtin_modules(true)); - - let pass = [ - "_http_agent", - "_http_client", - "_http_common", - "_http_incoming", - "_http_outgoing", - "_http_server", - "_stream_duplex", - "_stream_passthrough", - "_stream_readable", - "_stream_transform", - "_stream_wrap", - "_stream_writable", - "_tls_common", - "_tls_wrap", - "assert", - "assert/strict", - "async_hooks", - "buffer", - "child_process", - "cluster", - "console", - "constants", - "crypto", - "dgram", - "diagnostics_channel", - "dns", - "dns/promises", - "domain", - "events", - "fs", - "fs/promises", - "http", - "http2", - "https", - "inspector", - "module", - "net", - "os", - "path", - "path/posix", - "path/win32", - "perf_hooks", - "process", - "punycode", - "querystring", - "readline", - "repl", - "stream", - "stream/consumers", - "stream/promises", - "stream/web", - "string_decoder", - "sys", - "timers", - "timers/promises", - "tls", - "trace_events", - "tty", - "url", - "util", - "util/types", - "v8", - "vm", - "worker_threads", - "zlib", - ]; - - for request in pass { - let prefixed_request = format!("node:{request}"); - for request in [prefixed_request.clone(), request.to_string()] { - let resolved_path = resolver.resolve(f, &request).map(|r| r.full_path()); - let err = ResolveError::Builtin(prefixed_request.clone()); - assert_eq!(resolved_path, Err(err), "{request}"); - } - } -} - -#[test] -fn fail() { - let f = Path::new("/"); - let resolver = Resolver::new(ResolveOptions::default().with_builtin_modules(true)); - let request = "xxx"; - let resolved_path = resolver.resolve(f, request); - let err = ResolveError::NotFound(request.to_string()); - assert_eq!(resolved_path, Err(err), "{request}"); -} - -#[test] -fn imports() { - let f = super::fixture().join("builtins"); - let resolver = Resolver::new(ResolveOptions { - builtin_modules: true, - condition_names: vec!["node".into()], - ..ResolveOptions::default() - }); - - for request in ["#fs", "#http"] { - let resolved_path = resolver.resolve(f.clone(), request).map(|r| r.full_path()); - let err = ResolveError::Builtin(format!("node:{}", request.trim_start_matches('#'))); - assert_eq!(resolved_path, Err(err)); - } -} diff --git a/src/tests/dependencies.rs b/src/tests/dependencies.rs deleted file mode 100644 index bcc2355b..00000000 --- a/src/tests/dependencies.rs +++ /dev/null @@ -1,110 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/dependencies.test.js - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows { - use rustc_hash::FxHashSet; - use std::path::PathBuf; - - use crate::{ResolveContext, ResolveOptions, ResolverGeneric}; - - use super::super::memory_fs::MemoryFS; - - fn file_system() -> MemoryFS { - MemoryFS::new(&[ - ("/a/b/node_modules/some-module/index.js", ""), - ("/a/node_modules/module/package.json", r#"{"main":"entry.js"}"#), - ("/a/node_modules/module/file.js", r#"{"main":"entry.js"}"#), - ("/modules/other-module/file.js", ""), - ]) - } - - #[test] - fn test() { - let file_system = file_system(); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - extensions: vec![".json".into(), ".js".into()], - modules: vec!["/modules".into(), "node_modules".into()], - ..ResolveOptions::default() - }, - ); - - let data = [ - ( - "middle module request", - "/a/b/c", - "module/file", - "/a/node_modules/module/file.js", - // These dependencies are different from enhanced-resolve due to different code path to - // querying the file system - vec![ - // 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", - // "/", - ], - vec![ - // missing package.jsons - // "/a/b/c/package.json", - "/a/b/package.json", - "/a/package.json", - "/package.json", - // missing modules directories - "/a/b/c", - // "/a/b/c/node_modules", - // missing single file modules - "/modules/module", - "/a/b/node_modules/module", - // missing files with alternative extensions - "/a/node_modules/module/file", - "/a/node_modules/module/file.json", - ], - ), - ( - "fast found module", - "/a/b/c", - "other-module/file.js", - "/modules/other-module/file.js", - // These dependencies are different from enhanced-resolve due to different code path to - // querying the file system - vec![ - // symlink checks - "/modules/other-module/file.js", - // "/modules/other-module", - // "/modules", - // "/", - ], - vec![ - // missing package.jsons - // "/a/b/c/package.json", - "/a/b/c", - "/a/b/package.json", - "/a/package.json", - "/package.json", - "/modules/other-module/package.json", - "/modules/package.json", - ], - ), - ]; - - for (name, context, request, result, file_dependencies, missing_dependencies) in data { - let mut ctx = ResolveContext::default(); - let path = PathBuf::from(context); - let resolved = - resolver.resolve_with_context(path, request, &mut ctx).map(|r| r.full_path()); - assert_eq!(resolved, Ok(PathBuf::from(result))); - let file_dependencies = - FxHashSet::from_iter(file_dependencies.iter().map(PathBuf::from)); - let missing_dependencies = - FxHashSet::from_iter(missing_dependencies.iter().map(PathBuf::from)); - assert_eq!(ctx.file_dependencies, file_dependencies, "{name}"); - assert_eq!(ctx.missing_dependencies, missing_dependencies, "{name}"); - } - } -} diff --git a/src/tests/exports_field.rs b/src/tests/exports_field.rs deleted file mode 100644 index fd68c1f7..00000000 --- a/src/tests/exports_field.rs +++ /dev/null @@ -1,2546 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/exportsField.test.js -//! -//! The huge exports field test cases are at the bottom of this file. - -use crate::{Ctx, PathUtil, ResolveError, ResolveOptions, Resolver}; -use serde_json::json; -use std::path::Path; - -#[test] -fn test_simple() { - let f = super::fixture().join("exports-field"); - let f2 = super::fixture().join("exports-field2"); - let f4 = super::fixture().join("exports-field-error"); - let f5 = super::fixture().join("imports-exports-wildcard"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - fully_specified: true, - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("resolve root using exports field, not a main field", f.clone(), "exports-field", f.join("node_modules/exports-field/x.js")), - ("resolver should respect condition names", f.clone(), "exports-field/dist/main.js", f.join("node_modules/exports-field/lib/lib2/main.js")), - // enhanced_resolve behaves differently to node.js. enhanced_resolve fallbacks when an - // array item is unresolved, where as node.js fallbacks when an array has an - // InvalidPackageTarget error. - // ("resolver should respect fallback", f2.clone(), "exports-field/dist/browser.js", f2.join("node_modules/exports-field/lib/browser.js")), - // The following two tests require fallback from array values, the path is changed here to - // only test query and fragment. - ("resolver should respect query parameters #1", f2.clone(), "exports-field/dist/main.js?foo", f2.join("node_modules/exports-field/lib/lib2/main.js?foo")), - ("resolver should respect fragment parameters #1", f2.clone(), "exports-field/dist/main.js#foo", f2.join("node_modules/exports-field/lib/lib2/main.js#foo")), - ("relative path should work, if relative path as request is used", f.clone(), "./node_modules/exports-field/lib/main.js", f.join("node_modules/exports-field/lib/main.js")), - ("self-resolving root", f.clone(), "@exports-field/core", f.join("a.js")), - ("should resolve with wildcard pattern #1", f5.clone(), "m/features/f.js", f5.join("node_modules/m/src/features/f.js")), - ("should resolve with wildcard pattern #2", f5.clone(), "m/features/y/y.js", f5.join("node_modules/m/src/features/y/y.js")), - ("should resolve with wildcard pattern #3", f5.clone(), "m/features-no-ext/y/y.js", f5.join("node_modules/m/src/features/y/y.js")), - ("should resolve with wildcard pattern #4", f5.clone(), "m/middle/nested/f.js", f5.join("node_modules/m/src/middle/nested/f.js")), - ("should resolve with wildcard pattern #5", f5.clone(), "m/middle-1/nested/f.js", f5.join("node_modules/m/src/middle-1/nested/f.js")), - ("should resolve with wildcard pattern #6", f5.clone(), "m/middle-2/nested/f.js", f5.join("node_modules/m/src/middle-2/nested/f.js")), - ("should resolve with wildcard pattern #7", f5.clone(), "m/middle-3/nested/f", f5.join("node_modules/m/src/middle-3/nested/f/nested/f.js")), - ("should resolve with wildcard pattern #8", f5.clone(), "m/middle-4/f/nested", f5.join("node_modules/m/src/middle-4/f/f.js")), - ("should resolve with wildcard pattern #9", f5.clone(), "m/middle-5/f$/$", f5.join("node_modules/m/src/middle-5/f$/$.js")), - ]; - - // Not needed or snapshot: - // * should log the correct info - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } - - let p = f.join("node_modules/exports-field/package.json"); - let p2 = f2.join("node_modules/exports-field/package.json"); - let p4 = f4.join("node_modules/exports-field/package.json"); - let p5 = f5.join("node_modules/m/package.json"); - - #[rustfmt::skip] - let fail = [ - // ("throw error if extension not provided", f2.clone(), "exports-field/dist/main", ResolveError::NotFound(f2.join("node_modules/exports-field/lib/lib2/main"))), - ("resolver should respect query parameters #2. Direct matching", f2.clone(), "exports-field?foo", ResolveError::PackagePathNotExported("./?foo".into(), p2.clone())), - ("resolver should respect fragment parameters #2. Direct matching", f2, "exports-field#foo", ResolveError::PackagePathNotExported("./#foo".into(), p2)), - ("relative path should not work with exports field", f.clone(), "./node_modules/exports-field/dist/main.js", ResolveError::NotFound("./node_modules/exports-field/dist/main.js".into())), - ("backtracking should not work for request", f.clone(), "exports-field/dist/../../../a.js", ResolveError::InvalidPackageTarget("./lib/../../../a.js".to_string(), "./dist/".to_string(), p.clone())), - ("backtracking should not work for exports field target", f.clone(), "exports-field/dist/a.js", ResolveError::InvalidPackageTarget("./../../a.js".to_string(), "./dist/a.js".to_string(), p.clone())), - ("not exported error", f.clone(), "exports-field/anything/else", ResolveError::PackagePathNotExported("./anything/else".to_string(), p.clone())), - ("request ending with slash #1", f.clone(), "exports-field/", ResolveError::PackagePathNotExported("./".to_string(), p.clone())), - ("request ending with slash #2", f.clone(), "exports-field/dist/", ResolveError::PackagePathNotExported("./dist/".to_string(), p.clone())), - ("request ending with slash #3", f.clone(), "exports-field/lib/", ResolveError::PackagePathNotExported("./lib/".to_string(), p)), - ("should throw error if target is invalid", f4, "exports-field", ResolveError::InvalidPackageTarget("./a/../b/../../pack1/index.js".to_string(), ".".to_string(), p4)), - ("throw error if exports field is invalid", f.clone(), "invalid-exports-field", ResolveError::InvalidPackageConfig(f.join("node_modules/invalid-exports-field/package.json"))), - ("should throw error if target is 'null'", f5, "m/features/internal/file.js", ResolveError::PackagePathNotExported("./features/internal/file.js".to_string(), p5)), - ]; - - for (comment, path, request, error) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!(resolution, Err(error), "{comment} {path:?} {request}"); - } -} - -// resolve using exports field, not a browser field #1 -#[test] -fn exports_not_browser_field1() { - let f = super::fixture().join("exports-field"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - condition_names: vec!["webpack".into()], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "exports-field/dist/main.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("node_modules/exports-field/lib/lib2/main.js"))); -} - -// resolve using exports field and a browser alias field #2 -#[test] -fn exports_not_browser_field2() { - let f2 = super::fixture().join("exports-field2"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - extensions: vec![".js".into()], - condition_names: vec!["node".into()], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f2, "exports-field/dist/main.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f2.join("node_modules/exports-field/lib/browser.js"))); -} - -// should resolve extension without fullySpecified -#[test] -fn extension_without_fully_specified() { - let f2 = super::fixture().join("exports-field2"); - - let commonjs_resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - let resolved_path = - commonjs_resolver.resolve(&f2, "exports-field/dist/main").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f2.join("node_modules/exports-field/lib/lib2/main.js"))); -} - -#[test] -fn field_name_path() { - let f2 = super::fixture().join("exports-field2"); - let f3 = super::fixture().join("exports-field3"); - - // field name path #1 #2 #3 - let exports_fields = [ - vec![vec!["exportsField".into(), "exports".into()]], - vec![vec!["exportsField".into(), "exports".into()], vec!["exports".into()]], - vec![vec!["exports".into()], vec!["exportsField".into(), "exports".into()]], - ]; - - for exports_fields in exports_fields { - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - exports_fields, - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/main.js"))); - } - - // field name path #4 - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - exports_fields: vec![vec!["exports".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f2, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f2.join("node_modules/exports-field/index.js"))); - - // field name path #5 - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - exports_fields: vec![vec!["ex".into()], vec!["exports_field".into(), "exports".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/index"))); - - // non-compliant export targeting a directory - let resolver = Resolver::new(ResolveOptions { - exports_fields: vec![vec!["broken".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/src/index.js"))); -} - -#[test] -fn shared_resolvers() { - let f3 = super::fixture().join("exports-field3"); - - let resolver1 = Resolver::new(ResolveOptions { - exports_fields: vec![vec!["exportsField".into(), "exports".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver1.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/main.js"))); - - let resolver2 = resolver1.clone_with_options(ResolveOptions { - exports_fields: vec![vec!["ex".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver2.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/index"))); -} - -#[test] -fn extension_alias_1_2() { - let f = super::fixture().join("exports-field-and-extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - extension_alias: vec![(".js".into(), vec![".ts".into(), ".js".into()])], - fully_specified: true, - condition_names: vec!["webpack".into(), "default".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve with the `extensionAlias` option", f.clone(), "@org/pkg/string.js", f.join("node_modules/@org/pkg/dist/string.js")), - ("should resolve with the `extensionAlias` option #2", f.clone(), "pkg/string.js", f.join("node_modules/pkg/dist/string.js")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn extension_alias_3() { - let f = super::fixture().join("exports-field-and-extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - extension_alias: vec![( - ".js".into(), - vec![".foo".into(), ".baz".into(), ".baz".into(), ".ts".into(), ".js".into()], - )], - fully_specified: true, - condition_names: vec!["webpack".into(), "default".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve with the `extensionAlias` option #3", f.clone(), "pkg/string.js", f.join("node_modules/pkg/dist/string.js")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn extension_alias_throw_error() { - let f = super::fixture().join("exports-field-and-extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - extension_alias: vec![(".js".into(), vec![".ts".into()])], - fully_specified: true, - condition_names: vec!["webpack".into(), "default".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let fail = [ - // enhanced-resolve has two test cases that are exactly the same here - // https://github.com/webpack/enhanced-resolve/blob/a998c7d218b7a9ec2461fc4fddd1ad5dd7687485/test/exportsField.test.js#L2976-L3024 - ("should throw error with the `extensionAlias` option", f, "pkg/string.js", ResolveError::ExtensionAlias), - // TODO: The error is PackagePathNotExported in enhanced-resolve - // ("should throw error with the `extensionAlias` option", f.clone(), "pkg/string.js", ResolveError::PackagePathNotExported("node_modules/pkg/dist/string.ts".to_string())), - ]; - - for (comment, path, request, error) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!(resolution, Err(error), "{comment} {path:?} {request}"); - } -} - -// Small script for generating the test cases from enhanced-resolve -// for (c of testCases) { -// console.log("TestCase {") -// console.log(`name: ${JSON.stringify(c.name)},`) -// if (c.expect instanceof Error) { -// console.log(`expect: None,`) -// } else { -// console.log(`expect: Some(vec!${JSON.stringify(c.expect)}),`) -// } -// console.log(`exports_field: exports_field(json!(${JSON.stringify(c.suite[0], null, 2)})),`) -// console.log(`request: "${c.suite[1]}",`) -// console.log(`condition_names: vec!${JSON.stringify(c.suite[2])},`) -// console.log("},") -//} -struct TestCase { - name: &'static str, - expect: Option>, - exports_field: serde_json::Value, - request: &'static str, - condition_names: Vec<&'static str>, -} - -#[allow(clippy::needless_pass_by_value)] -fn exports_field(value: serde_json::Value) -> serde_json::Value { - value -} - -#[test] -fn test_cases() { - let test_cases = [ - TestCase { - name: "sample #1", - expect: Some(vec!["./dist/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/": { - "import": [ - "./dist/", - "./src/" - ], - "webpack": "./wp/" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "sample #1", - expect: Some(vec!["./src/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/": { - "import": [ - "./src/" - ], - "webpack": "./wp/" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - TestCase { - name: "sample #1 (wildcard)", - expect: Some(vec!["./dist/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/*": { - "import": [ - "./dist/*", - "./src/*" - ], - "webpack": "./wp/*" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "sample #1 (wildcard)", - expect: Some(vec!["./src/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/*": { - "import": [ - "./src/*" - ], - "webpack": "./wp/*" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - TestCase { - name: "sample #2", - expect: Some(vec!["./data/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./timezones/": "./data/timezones/" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #2 (wildcard)", - expect: Some(vec!["./data/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./timezones/*": "./data/timezones/*" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #3", - expect: Some(vec!["./data/timezones/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./": "./data/timezones/" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #3 (wildcard)", - expect: Some(vec!["./data/timezones/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./*": "./data/timezones/*.mjs" - })), - request: "./timezones/pdt", - condition_names: vec![], - }, - TestCase { - name: "sample #4", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./lib/": { - "browser": [ - "./browser/" - ] - }, - "./dist/index.js": { - "node": "./index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #4 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "node": "./index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #5", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/": { - "browser": [ - "./browser/" - ] - }, - "./dist/index.js": { - "node": "./index.js", - "default": "./browser/index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #5 (wildcard)", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "node": "./index.js", - "default": "./browser/index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./dist/a": "./dist/index.js" - })), - request: "./dist/aaa", - condition_names: vec![], - }, - TestCase { - name: "sample #7", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./dist/a/a/": "./dist/index.js" - })), - request: "./dist/a/a", - condition_names: vec![], - }, - TestCase { - name: "sample #7 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./dist/a/a/*": "./dist/index.js" - })), - request: "./dist/a/a", - condition_names: vec![], - }, - TestCase { - name: "sample #8", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": "./index.js" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #9", - expect: Some(vec!["./main.js"]), - exports_field: exports_field(json!({ - "./index.js": "./main.js" - })), - request: "./index.js", - condition_names: vec![], - }, - TestCase { - name: "sample #10", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #11", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./bar#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #12", - expect: Some(vec!["./ok.js#abc"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/ok.js#abc", - condition_names: vec![], - }, - TestCase { - name: "sample #12", - expect: Some(vec!["./ok.js#abc"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/ok.js#abc", - condition_names: vec![], - }, - TestCase { - name: "sample #13", - expect: Some(vec!["./ok.js?abc"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/ok.js?abc", - condition_names: vec![], - }, - TestCase { - name: "sample #14", - expect: Some(vec!["./🎉.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/🎉.js", - condition_names: vec![], - }, - TestCase { - name: "sample #15", - expect: Some(vec!["./%F0%9F%8E%89.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/%F0%9F%8E%89.js", - condition_names: vec![], - }, - TestCase { - name: "sample #16", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./🎉", - condition_names: vec![], - }, - TestCase { - name: "sample #17", - expect: Some(vec!["./other.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./%F0%9F%8E%89", - condition_names: vec![], - }, - TestCase { - name: "sample #18", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./module", - condition_names: vec![], - }, - TestCase { - name: "sample #19", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./module#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #20", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./module?foo", - condition_names: vec![], - }, - TestCase { - name: "sample #21", - expect: Some(vec!["./zizizi"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./z*z*z*" - })), - request: "./#zippi", - condition_names: vec![], - }, - TestCase { - name: "sample #22", - expect: Some(vec!["./d?e?f"]), - exports_field: exports_field(json!({ - "./a?b?c/": "./" - })), - request: "./a?b?c/d?e?f", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #1", - expect: Some(vec!["./dist/index.js"]), - exports_field: exports_field(json!({ - ".": "./dist/index.js" - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #2", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./": "./", - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #3", - expect: Some(vec!["./dist/a.js"]), - exports_field: exports_field(json!({ - "./dist/": "./dist/", - "./dist/*": "./dist/*", - "./dist*": "./dist*", - "./dist/index.js": "./dist/a.js" - })), - request: "./dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #4", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./": { - "browser": [ - "./browser/" - ] - }, - "./*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "browser": "./index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #5", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./": { - "browser": [ - "./browser/" - ] - }, - "./*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "node": "./node.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #6", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - ".": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #7", - expect: Some(vec!["./src/index.js"]), // `enhanced_resolve` is `None` - exports_field: exports_field(json!({ - ".": { - "default": "./src/index.js", - "browser": "./index.js", - "node": "./src/node/index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #8", - expect: Some(vec!["./src/index.js"]), - exports_field: exports_field(json!({ - ".": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #9", - expect: Some(vec!["./index"]), - exports_field: exports_field(json!({ - ".": "./index" - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #10", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./index": "./index.js" - })), - request: "./index", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #11", - expect: Some(vec!["./foo.js"]), - exports_field: exports_field(json!({ - "./": "./", - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #12", - expect: Some(vec!["./foo/bar/baz.js"]), - exports_field: exports_field(json!({ - "./": "./", - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo/bar/baz.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #13", - expect: Some(vec!["./foo/bar/baz.js"]), - exports_field: exports_field(json!({ - "./": "./", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo/bar/baz.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #14", - expect: Some(vec!["./foo/bar/baz.js"]), - exports_field: exports_field(json!({ - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo/bar/baz.js", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #1", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "require": "./require.js" - }, { - "import": "./import.mjs" - }] - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #2", - expect: Some(vec!["./import.mjs"]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "require": "./require.js" - }, { - "import": "./import.mjs" - }] - })), - request: ".", - condition_names: vec!["import"], - }, - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./require.js"]), - exports_field: exports_field(json!({ - ".": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./import.mjs"]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "import": "./import.mjs" - }] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./require.js"]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "require": [ - "./require.js" - ] - }, { - "import": [ - "./import.mjs", - "./import.js" - ] - }] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./import.mjs"]), - exports_field: exports_field(json!({ - ".": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "./import.mjs", - "./import.js" - ] - } - ] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./import.js"]), - exports_field: exports_field(json!({ - ".": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "./import.js" - ] - } - ] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "mapping to a folder root #1", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./timezones": "./data/timezones/" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #2", - expect: None, - exports_field: exports_field(json!({ - "./timezones/": "./data/timezones" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #3", - expect: Some(vec!["./data/timezones/pdt/index.mjs"]), - exports_field: exports_field(json!({ - "./timezones/pdt/": "./data/timezones/pdt/" - })), - request: "./timezones/pdt/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #3 (wildcard)", - expect: Some(vec!["./data/timezones/pdt/index.mjs"]), - exports_field: exports_field(json!({ - "./timezones/pdt/*": "./data/timezones/pdt/*" - })), - request: "./timezones/pdt/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #4", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./": "./timezones/" - })), - request: "./pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #4 (wildcard)", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./*": "./timezones/*" - })), - request: "./pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #5", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./": "./" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #5 (wildcard)", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./*": "./*" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #6", - expect: None, - exports_field: exports_field(json!({ - "./": "." - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #6 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "./*": "." - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #7", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": "./" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #7 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": "./*" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #1", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./": "./", - "./dist/": "./lib/" - })), - request: "./dist/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #1 (wildcard)", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./*": "./*", - "./dist/*": "./lib/*" - })), - request: "./dist/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #2", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/": "./dist/utils/", - "./dist/": "./lib/" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #2 (wildcard)", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/*": "./dist/utils/*", - "./dist/*": "./lib/*" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #3", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/index.js": "./dist/utils/index.js", - "./dist/utils/": "./dist/utils/index.mjs", - "./dist/": "./lib/" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #3 (wildcard)", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/index.js": "./dist/utils/index.js", - "./dist/utils/*": "./dist/utils/index.mjs", - "./dist/*": "./lib/*" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #4", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./": { - "browser": "./browser/" - }, - "./dist/": "./lib/" - })), - request: "./dist/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "the longest matching path prefix is prioritized #4 (wildcard)", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./*": { - "browser": "./browser/*" - }, - "./dist/*": "./lib/*" - })), - request: "./dist/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #1", - // `lodash/` does not start with './' so fallbacks to util - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "conditional mapping folder #1", - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": [ - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #1 (wildcard)", - // `lodash/` does not start with './' so fallbacks to util - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": [ - "lodash/*", - "./utils/*" - ], - "node": [ - "./utils-node/*" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "conditional mapping folder #1 (wildcard)", - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": [ - "./utils/*" - ], - "node": [ - "./utils-node/*" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #2", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./node/" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "conditional mapping folder #2 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "webpack": "./wpk/*", - "browser": [ - "lodash/*", - "./utils/*" - ], - "node": [ - "./node/*" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "conditional mapping folder #3", - expect: Some(vec!["./wpk/index.mjs"]), - exports_field: exports_field(json!({ - "./utils/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils/" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "conditional mapping folder #3 (wildcard)", - expect: Some(vec!["./wpk/index.mjs"]), - exports_field: exports_field(json!({ - "./utils/*": { - "webpack": "./wpk/*", - "browser": [ - "lodash/*", - "./utils/*" - ], - "node": [ - "./utils/*" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "incorrect exports field #1", - expect: None, - exports_field: exports_field(json!({ - "/utils/": "./a/" - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #2", - expect: None, - exports_field: exports_field(json!({ - "./utils/": "/a/" - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #3", - expect: None, - exports_field: exports_field(json!({ - "/utils/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #4", - expect: None, - exports_field: exports_field(json!({ - "./utils/": { - "browser": "/a/", - "default": "/b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #4 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "/a/", - "default": "/b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #5", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index": "./a/index.js" - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index.mjs": "./a/index.js" - })), - request: "./utils/index", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #7", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #8", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index.mjs": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - // Requests that are not `./` does not apply to `package_exports_resolve` - // TestCase { - // name: "incorrect request #1", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": "./a/" - // })), - // request: "/utils/index.mjs", - // condition_names: vec![], - // }, - // TestCase { - // name: "incorrect request #2", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": { - // "browser": "./a/", - // "default": "./b/" - // } - // })), - // request: "/utils/index.mjs", - // condition_names: vec!["browser"], - // }, - // TestCase { - // name: "incorrect request #3", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": { - // "browser": "./a/", - // "default": "./b/" - // } - // })), - // request: "../utils/index.mjs", - // condition_names: vec!["browser"], - // }, - // TestCase { - // name: "incorrect request #4", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": { - // "browser": "./a/", - // "default": "./b/" - // } - // })), - // request: "/utils/index.mjs/", - // condition_names: vec!["browser"], - // }, - TestCase { - name: "backtracking package base #1", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./../../utils/": "./dist/" - })), - request: "./../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #1 (wildcard)", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./../../utils/*": "./dist/*" - })), - request: "./../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #2", - expect: None, - exports_field: exports_field(json!({ - "../../utils/": "./dist/" - })), - request: "../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #2 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "../../utils/*": "./dist/*" - })), - request: "../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #3", - expect: None, - exports_field: exports_field(json!({ - "./utils/": "../src/" - })), - request: "./utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #3 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "./utils/*": "../src/*" - })), - request: "./utils/index", - condition_names: vec![], - }, - // enhanced-resolve does not handle backtracking here - // TestCase { - // name: "backtracking package base #4", - // expect: Some(vec!["./../src/index"]), - // exports_field: exports_field(json!({ - // "./utils/": "./../src/" - // })), - // request: "./utils/index", - // condition_names: vec![], - // }, - // TestCase { - // name: "backtracking package base #4 (wildcard)", - // expect: Some(vec!["./../src/index"]), - // exports_field: exports_field(json!({ - // "./utils/*": "./../src/*" - // })), - // request: "./utils/index", - // condition_names: vec![], - // }, - // TestCase { - // name: "backtracking package base #5", - // expect: Some(vec!["./src/../index.js"]), - // exports_field: exports_field(json!({ - // "./utils/index": "./src/../index.js" - // })), - // request: "./utils/index", - // condition_names: vec![], - // }, - TestCase { - name: "backtracking package base #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/../utils/index": "./src/../index.js" - })), - request: "./utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #7", - expect: None, - exports_field: exports_field(json!({ - "./utils/": { - "browser": "../this/" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #7", - expect: None, - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "../this/*" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #8", - // We throw "InvalidPackageTarget" - // expect: Some(vec!["./utils/../index"]), - expect: None, - exports_field: exports_field(json!({ - "./utils/": { - "browser": "./utils/../" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #8 (wildcard)", - // We throw "InvalidPackageTarget" - // expect: Some(vec!["./utils/../index"]), - expect: None, - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "./utils/../*" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #9", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./": "./src/../../", - "./dist/": "./dist/" - })), - request: "./dist/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #9 (wildcard)", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./*": "./src/../../*", - "./dist/*": "./dist/*" - })), - request: "./dist/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking target folder #1", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../../index"]), - exports_field: exports_field(json!({ - "./utils/": "./dist/" - })), - request: "./utils/timezone/../../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #1 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../../index"]), - exports_field: exports_field(json!({ - "./utils/*": "./dist/*" - })), - request: "./utils/timezone/../../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #2", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../index"]), - exports_field: exports_field(json!({ - "./utils/": "./dist/" - })), - request: "./utils/timezone/../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #2 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../index"]), - exports_field: exports_field(json!({ - "./utils/*": "./dist/*" - })), - request: "./utils/timezone/../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #3", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/target/../../index"]), - exports_field: exports_field(json!({ - "./utils/": "./dist/target/" - })), - request: "./utils/../../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #3 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/target/../../index"]), - exports_field: exports_field(json!({ - "./utils/*": "./dist/target/*" - })), - request: "./utils/../../index", - condition_names: vec![], - }, - // enhanced-resolve does not handle `node_modules` in target - TestCase { - name: "nested node_modules path #1", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": "./node_modules/" - } - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #1 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "./node_modules/*" - } - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #2", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./utils/../node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/": "./utils/../node_modules/" - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "nested node_modules path #2 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./utils/../node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": "./utils/../node_modules/*" - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "nested mapping #1", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": "./", - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested mapping #1 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": "./*", - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "nested mapping #2 (wildcard)", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #2 (wildcard)", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "nested mapping #3", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["webpack"], - }, - TestCase { - name: "nested mapping #3 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["webpack"], - }, - TestCase { - name: "nested mapping #4", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["node", "browser"], - }, - TestCase { - name: "nested mapping #4 (wildcard)", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["node", "browser"], - }, - TestCase { - name: "nested mapping #5", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node"], - }, - TestCase { - name: "nested mapping #5 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": { - "webpack": [ - "./wpck/*" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node"], - }, - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - TestCase { - name: "nested mapping #6 (wildcard)", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": { - "webpack": [ - "./wpck/*" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #6 (wildcard)", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./node/*" - ], - "default": { - "node": { - "webpack": [ - "./wpck/*" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - TestCase { - name: "nested mapping #7", - expect: Some(vec!["./y.js"]), - exports_field: exports_field(json!({ - "./a.js": { - "abc": { - "def": "./x.js" - }, - "ghi": "./y.js" - } - })), - request: "./a.js", - condition_names: vec!["abc", "ghi"], - }, - TestCase { - name: "nested mapping #8", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./a.js": { - "abc": { - "def": "./x.js", - "default": [] - }, - "ghi": "./y.js" - } - })), - request: "./a.js", - condition_names: vec!["abc", "ghi"], - }, - TestCase { - name: "syntax sugar #1", - expect: Some(vec!["./main.js"]), - exports_field: exports_field(json!("./main.js")), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #2", - expect: Some(vec![]), - exports_field: exports_field(json!("./main.js")), - request: "./lib.js", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #3", - expect: Some(vec!["./a.js"]), - exports_field: exports_field(json!(["./a.js", "./b.js"])), - request: ".", - condition_names: vec![], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "syntax sugar #3", - expect: Some(vec!["./b.js"]), - exports_field: exports_field(json!(["./b.js"])), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #4", - expect: Some(vec![]), - exports_field: exports_field(json!(["./a.js", "./b.js"])), - request: "./lib.js", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #5", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "browser": { - "default": "./index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "syntax sugar #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "browser": { - "default": "./index.js" - } - })), - request: "./lib.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "syntax sugar #7", - expect: None, - exports_field: exports_field(json!({ - "./node": "./node.js", - "browser": { - "default": "./index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "syntax sugar #8", - expect: None, - exports_field: exports_field(json!({ - "browser": { - "default": "./index.js" - }, - "./node": "./node.js" - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #1", - expect: Some(vec!["./abc/d"]), - exports_field: exports_field(json!({ - "./ab*": "./ab/*", - "./abc*": "./abc/*", - "./a*": "./a/*" - })), - request: "./abcd", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #2", - expect: Some(vec!["./abc/d/e"]), - exports_field: exports_field(json!({ - "./ab*": "./ab/*", - "./abc*": "./abc/*", - "./a*": "./a/*" - })), - request: "./abcd/e", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #3", - expect: Some(vec!["./abc/d"]), - exports_field: exports_field(json!({ - "./x/ab*": "./ab/*", - "./x/abc*": "./abc/*", - "./x/a*": "./a/*" - })), - request: "./x/abcd", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #4", - expect: Some(vec!["./abc/d/e"]), - exports_field: exports_field(json!({ - "./x/ab*": "./ab/*", - "./x/abc*": "./abc/*", - "./x/a*": "./a/*" - })), - request: "./x/abcd/e", - condition_names: vec!["browser"], - }, - TestCase { - name: "path tree edge case #1", - expect: Some(vec!["./A/b/d.js"]), - exports_field: exports_field(json!({ - "./a/": "./A/", - "./a/b/c": "./c.js" - })), - request: "./a/b/d.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #1 (wildcard)", - expect: Some(vec!["./A/b/d.js"]), - exports_field: exports_field(json!({ - "./a/*": "./A/*", - "./a/b/c": "./c.js" - })), - request: "./a/b/d.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #2", - expect: Some(vec!["./A/c.js"]), - exports_field: exports_field(json!({ - "./a/": "./A/", - "./a/b": "./b.js" - })), - request: "./a/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #2 (wildcard)", - expect: Some(vec!["./A/c.js"]), - exports_field: exports_field(json!({ - "./a/*": "./A/*", - "./a/b": "./b.js" - })), - request: "./a/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #3", - expect: Some(vec!["./A/b/d/c.js"]), - exports_field: exports_field(json!({ - "./a/": "./A/", - "./a/b/c/d": "./c.js" - })), - request: "./a/b/d/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #3 (wildcard)", - expect: Some(vec!["./A/b/d/c.js"]), - exports_field: exports_field(json!({ - "./a/*": "./A/*", - "./a/b/c/d": "./c.js" - })), - request: "./a/b/d/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #1", - expect: Some(vec!["./A/b.js"]), - exports_field: exports_field(json!({ - "./a/*.js": "./A/*.js" - })), - request: "./a/b.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #2", - expect: Some(vec!["./A/b/c.js"]), - exports_field: exports_field(json!({ - "./a/*.js": "./A/*.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #3", - expect: Some(vec!["./A/b/c.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": "./A/*/c.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #4", - expect: Some(vec!["./A/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": "./A/*/*.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #5", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/*.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #5", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/*.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./lib/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #6", - expect: Some(vec!["./browser/foo/bar.js"]), - exports_field: exports_field(json!({ - "./lib/*/bar.js": { - "browser": [ - "./browser/*/bar.js" - ] - }, - "./dist/*/bar.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./lib/foo/bar.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #6", - expect: Some(vec!["./browser/foo.js"]), - exports_field: exports_field(json!({ - "./lib/*/bar.js": { - "browser": [ - "./browser/*/bar.js" - ] - }, - "./dist/*/bar.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./dist/foo/bar.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #7", - expect: Some(vec!["./browser/foo/default.js"]), - exports_field: exports_field(json!({ - "./lib/*/bar.js": { - "browser": [ - "./browser/*/bar.js" - ] - }, - "./dist/*/bar.js": { - "node": "./*.js", - "default": "./browser/*/default.js" - } - })), - request: "./dist/foo/bar.js", - condition_names: vec!["default"], - }, - TestCase { - name: "wildcard pattern #8", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": "./A/*/*/*.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #9", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": [ - "./A/*/*/*.js", - "./B/*/*/*.js" - ] - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "wildcard pattern #9", - expect: Some(vec!["./B/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": [ - "./B/*/*/*.js" - ] - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #10", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/foo-*/c.js": "./A/*/*/*.js" - })), - request: "./a/foo-b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #11", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*-foo/c.js": "./A/*/*/*.js" - })), - request: "./a/b-foo/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #12", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/foo-*-foo/c.js": "./A/*/*/*.js" - })), - request: "./a/foo-b-foo/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #13", - expect: Some(vec!["./A/b/c/d.js"]), - exports_field: exports_field(json!({ - "./a/foo-*-foo/c.js": "./A/b/c/d.js" - })), - request: "./a/foo-b-foo/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #14", - expect: Some(vec!["./A/b/c/*.js"]), - exports_field: exports_field(json!({ - "./a/foo-foo/c.js": "./A/b/c/*.js" - })), - request: "./a/foo-foo/c.js", - condition_names: vec![], - }, - ]; - - for case in test_cases { - let resolved = Resolver::new(ResolveOptions { - condition_names: case - .condition_names - .iter() - .map(ToString::to_string) - .collect::>(), - ..ResolveOptions::default() - }) - .package_exports_resolve( - Path::new(""), - case.request, - &case.exports_field, - &mut Ctx::default(), - ) - .map(|p| p.map(|p| p.to_path_buf())); - if let Some(expect) = case.expect { - if expect.is_empty() { - assert!( - matches!(resolved, Err(ResolveError::PackagePathNotExported(_, _))), - "{} {:?}", - &case.name, - &resolved - ); - } else { - for expect in expect { - assert_eq!(resolved, Ok(Some(Path::new(expect).normalize())), "{}", &case.name); - } - } - } else { - assert!(resolved.is_err(), "{} {resolved:?}", &case.name); - } - } -} diff --git a/src/tests/extension_alias.rs b/src/tests/extension_alias.rs deleted file mode 100644 index 86afab73..00000000 --- a/src/tests/extension_alias.rs +++ /dev/null @@ -1,66 +0,0 @@ -//! - -use crate::{ResolveError, ResolveOptions, Resolver}; - -#[test] -fn extension_alias() { - let f = super::fixture().join("extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - extension_alias: vec![ - (".js".into(), vec![".ts".into(), ".js".into()]), - (".mjs".into(), vec![".mts".into()]), - ], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should alias fully specified file", f.clone(), "./index.js", f.join("index.ts")), - ("should alias fully specified file when there are two alternatives", f.clone(), "./dir/index.js", f.join("dir/index.ts")), - ("should also allow the second alternative", f.clone(), "./dir2/index.js", f.join("dir2/index.js")), - ("should support alias option without an array", f.clone(), "./dir2/index.mjs", f.join("dir2/index.mts")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } - - #[rustfmt::skip] - let fail = [ - ("should not allow to fallback to the original extension or add extensions", f, "./index.mjs"), - ]; - - for (comment, path, request) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!(resolution, Err(ResolveError::ExtensionAlias), "{comment} {path:?} {request}"); - } -} - -// should not apply extension alias to extensions or mainFiles field -#[test] -fn not_apply_to_extension_nor_main_files() { - let f = super::fixture().join("extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - extension_alias: vec![(".js".into(), vec![])], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("directory", f.clone(), "./dir2", "dir2/index.js"), - ("file", f.clone(), "./dir2/index", "dir2/index.js"), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - let expected = f.join(expected); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} diff --git a/src/tests/extensions.rs b/src/tests/extensions.rs deleted file mode 100644 index 1ebd86f4..00000000 --- a/src/tests/extensions.rs +++ /dev/null @@ -1,125 +0,0 @@ -//! - -use crate::{EnforceExtension, Resolution, ResolveContext, ResolveError, ResolveOptions, Resolver}; -use rustc_hash::FxHashSet; - -#[test] -fn extensions() { - let f = super::fixture().join("extensions"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".ts".into(), ".js".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve according to order of provided extensions", "./foo", "foo.ts"), - ("should resolve according to order of provided extensions (dir index)", "./dir", "dir/index.ts"), - ("should resolve according to main field in module root", ".", "index.js"), - // This is a core module - // ("should resolve single file module before directory", "module", "node_modules/module.js"), - ("should resolve trailing slash directory before single file", "module/", "node_modules/module/index.ts"), - ]; - - for (comment, request, expected_path) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - let expected = f.join(expected_path); - assert_eq!(resolved_path, Ok(expected), "{comment} {request} {expected_path}"); - } - - #[rustfmt::skip] - let fail = [ - ("not resolve to file when request has a trailing slash (relative)", "./foo.js/", "./foo.js/".into()) - ]; - - for (comment, request, expected_error) in fail { - let resolution = resolver.resolve(&f, request); - let error = ResolveError::NotFound(expected_error); - assert_eq!(resolution, Err(error), "{comment} {request} {resolution:?}"); - } -} - -// should default enforceExtension to true when extensions includes an empty string -#[test] -fn default_enforce_extension() { - let f = super::fixture().join("extensions"); - - let mut ctx = ResolveContext::default(); - let resolved = Resolver::new(ResolveOptions { - extensions: vec![".ts".into(), String::new(), ".js".into()], - ..ResolveOptions::default() - }) - .resolve_with_context(&f, "./foo", &mut ctx); - - assert_eq!(resolved.map(Resolution::into_path_buf), Ok(f.join("foo.ts"))); - assert_eq!( - ctx.file_dependencies, - FxHashSet::from_iter([f.join("foo.ts"), f.join("package.json")]) - ); - assert!(ctx.missing_dependencies.is_empty()); -} - -// should respect enforceExtension when extensions includes an empty string -#[test] -fn respect_enforce_extension() { - let f = super::fixture().join("extensions"); - - let mut ctx = ResolveContext::default(); - let resolved = Resolver::new(ResolveOptions { - enforce_extension: EnforceExtension::Disabled, - extensions: vec![".ts".into(), String::new(), ".js".into()], - ..ResolveOptions::default() - }) - .resolve_with_context(&f, "./foo", &mut ctx); - - assert_eq!(resolved.map(Resolution::into_path_buf), Ok(f.join("foo.ts"))); - assert_eq!( - ctx.file_dependencies, - FxHashSet::from_iter([f.join("foo.ts"), f.join("package.json")]) - ); - assert_eq!(ctx.missing_dependencies, FxHashSet::from_iter([f.join("foo")])); -} - -#[test] -fn multi_dot_extension() { - let f = super::fixture().join("extensions"); - - let resolver = Resolver::new(ResolveOptions { - // Test for `.d.ts`, not part of enhanced-resolve. - extensions: vec![".a.b.c".into(), ".d.ts".into(), ".ts".into(), ".js".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve according to order of provided extensions", "./foo", "foo.ts"), - ("should resolve file with extension", "./app.module", "app.module.js") - ]; - - for (comment, request, expected_path) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - let expected = f.join(expected_path); - assert_eq!(resolved_path, Ok(expected), "{comment} {request} {expected_path}"); - } - - #[rustfmt::skip] - let fail = [ - ("not resolve to file", "./index.", "./index.".into()) - ]; - - for (comment, request, expected_error) in fail { - let resolution = resolver.resolve(&f, request); - let error = ResolveError::NotFound(expected_error); - assert_eq!(resolution, Err(error), "{comment} {request} {resolution:?}"); - } -} - -#[test] -#[should_panic = "All extensions must start with a leading dot"] -fn without_leading_dot() { - Resolver::new(ResolveOptions { - extensions: vec!["ts".into(), "js".into()], - ..ResolveOptions::default() - }); -} diff --git a/src/tests/fallback.rs b/src/tests/fallback.rs deleted file mode 100644 index 3da2d767..00000000 --- a/src/tests/fallback.rs +++ /dev/null @@ -1,100 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/fallback.test.js - -#[test] -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -fn fallback() { - use super::memory_fs::MemoryFS; - use crate::{AliasValue, ResolveError, ResolveOptions, ResolverGeneric}; - use std::path::{Path, PathBuf}; - - let f = Path::new("/"); - - let file_system = MemoryFS::new(&[ - ("/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", ""), - ]); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - fallback: vec![ - ("aliasA".into(), vec![AliasValue::Path("a".into())]), - ("b$".into(), vec![AliasValue::Path("a/index".into())]), - ("c$".into(), vec![AliasValue::Path("/a/index".into())]), - ( - "multiAlias".into(), - vec![ - AliasValue::Path("b".into()), - AliasValue::Path("c".into()), - AliasValue::Path("d".into()), - AliasValue::Path("e".into()), - AliasValue::Path("a".into()), - ], - ), - ("recursive".into(), vec![AliasValue::Path("recursive/dir".into())]), - ("/d/dir".into(), vec![AliasValue::Path("/c/dir".into())]), - ("/d/index.js".into(), vec![AliasValue::Path("/c/index".into())]), - ("ignored".into(), vec![AliasValue::Ignore]), - ("node:path".into(), vec![AliasValue::Ignore]), - ], - modules: vec!["/".into()], - ..ResolveOptions::default() - }, - ); - - #[rustfmt::skip] - let pass = [ - ("should resolve a not aliased module 1", "a", "/a/index"), - ("should resolve a not aliased module 2", "a/index", "/a/index"), - ("should resolve a not aliased module 3", "a/dir", "/a/dir/index"), - ("should resolve a not aliased module 4", "a/dir/index", "/a/dir/index"), - ("should resolve an fallback module 1", "aliasA", "/a/index"), - ("should resolve an fallback module 2", "aliasA/index", "/a/index"), - ("should resolve an fallback module 3", "aliasA/dir", "/a/dir/index"), - ("should resolve an fallback module 4", "aliasA/dir/index", "/a/dir/index"), - ("should resolve a recursive aliased module 1", "recursive", "/recursive/index"), - ("should resolve a recursive aliased module 2", "recursive/index", "/recursive/index"), - ("should resolve a recursive aliased module 3", "recursive/dir", "/recursive/dir/index"), - ("should resolve a recursive aliased module 4", "recursive/dir/index", "/recursive/dir/index"), - ("should resolve a recursive aliased module 5", "recursive/file", "/recursive/dir/file"), - ("should resolve a file aliased module with a query 1", "b?query", "/b/index?query"), - ("should resolve a file aliased module with a query 2", "c?query", "/c/index?query"), - ("should resolve a path in a file aliased module 1", "b/index", "/b/index"), - ("should resolve a path in a file aliased module 2", "b/dir", "/b/dir/index"), - ("should resolve a path in a file aliased module 3", "b/dir/index", "/b/dir/index"), - ("should resolve a path in a file aliased module 4", "c/index", "/c/index"), - ("should resolve a path in a file aliased module 5", "c/dir", "/c/dir/index"), - ("should resolve a path in a file aliased module 6", "c/dir/index", "/c/dir/index"), - ("should resolve a file in multiple aliased dirs 1", "multiAlias/dir/file", "/e/dir/file"), - ("should resolve a file in multiple aliased dirs 2", "multiAlias/anotherDir", "/e/anotherDir/index"), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - - #[rustfmt::skip] - let ignore = [ - ("should resolve an ignore module", "ignored", ResolveError::Ignored(f.join("ignored"))), - ("should resolve node: builtin module", "node:path", ResolveError::Ignored(PathBuf::from("/node:path"))), - ]; - - for (comment, request, expected) in ignore { - let resolution = resolver.resolve(f, request); - assert_eq!(resolution, Err(expected), "{comment} {request}"); - } -} diff --git a/src/tests/full_specified.rs b/src/tests/full_specified.rs deleted file mode 100644 index a70c0191..00000000 --- a/src/tests/full_specified.rs +++ /dev/null @@ -1,113 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/fullSpecified.test.js - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows { - use std::path::PathBuf; - - use crate::{AliasValue, ResolveOptions, ResolverGeneric}; - - use super::super::memory_fs::MemoryFS; - - fn file_system() -> MemoryFS { - MemoryFS::new(&[ - ("/a/node_modules/package1/index.js", ""), - ("/a/node_modules/package1/file.js", ""), - ("/a/node_modules/package2/package.json", r#"{"main":"a"}"#), - ("/a/node_modules/package2/a.js", ""), - ("/a/node_modules/package3/package.json", r#"{"main":"dir"}"#), - ("/a/node_modules/package3/dir/index.js", ""), - ("/a/node_modules/package4/package.json", r#"{"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", ""), - ]) - } - - #[test] - fn test() { - let file_system = file_system(); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - alias: vec![ - ("alias1".into(), vec![AliasValue::from("/a/abc")]), - ("alias2".into(), vec![AliasValue::from("/a")]), - ], - alias_fields: vec![vec!["browser".into()]], - fully_specified: true, - ..ResolveOptions::default() - }, - ); - - let failing_resolves = [ - ("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"), - ]; - - for (comment, request) in failing_resolves { - let resolution = resolver.resolve("/a", request); - assert!(resolution.is_err(), "{comment} {request}"); - } - - let successful_resolves = [ - ("fully relative", "./abc.js", "/a/abc.js"), - ("fully absolute", "/a/abc.js", "/a/abc.js"), - ("fully relative in package", "package1/file.js", "/a/node_modules/package1/file.js"), - ("extensions in mainFiles", "package1", "/a/node_modules/package1/index.js"), - ("extensions in mainFields", "package2", "/a/node_modules/package2/a.js"), - ("extensions in alias", "alias1", "/a/abc.js"), - ("directories in alias", "alias2", "/a/index.js"), - ("directories in packages", "package3", "/a/node_modules/package3/dir/index.js"), - ("extensions in aliasFields", "package4/a.js", "/a/node_modules/package4/b.js"), - ]; - - for (comment, request, expected) in successful_resolves { - let resolution = resolver.resolve("/a", request).map(|r| r.full_path()); - assert_eq!(resolution, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - } - - #[test] - #[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. - fn resolve_to_context() { - let file_system = file_system(); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - alias: vec![ - ("alias1".into(), vec![AliasValue::from("/a/abc")]), - ("alias2".into(), vec![AliasValue::from("/a")]), - ], - alias_fields: vec![vec!["browser".into()]], - fully_specified: true, - resolve_to_context: true, - ..ResolveOptions::default() - }, - ); - - let successful_resolves = [ - ("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", "/a/node_modules/package3/dir"), - ]; - - for (comment, request, expected) in successful_resolves { - let resolution = resolver.resolve("/a", request).map(|r| r.full_path()); - assert_eq!(resolution, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - } -} diff --git a/src/tests/imports_field.rs b/src/tests/imports_field.rs deleted file mode 100644 index c928627a..00000000 --- a/src/tests/imports_field.rs +++ /dev/null @@ -1,1320 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/importsField.test.js -//! -//! The huge imports field test cases are at the bottom of this file. - -use serde_json::json; - -use crate::{Ctx, JSONMap, PathUtil, ResolveError, ResolveOptions, Resolver}; -use std::path::Path; - -#[test] -fn test_simple() { - let f = super::fixture().join("imports-field"); - let f2 = super::fixture().join("imports-exports-wildcard/node_modules/m/"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve using imports field instead of self-referencing", f.clone(), "#imports-field", f.join("b.js")), - ("should resolve using imports field instead of self-referencing for a subpath", f.join("dir"), "#imports-field", f.join("b.js")), - ("should resolve package #1", f.clone(), "#a/dist/main.js", f.join("node_modules/a/lib/lib2/main.js")), - ("should resolve package #3", f.clone(), "#ccc/index.js", f.join("node_modules/c/index.js")), - ("should resolve package #4", f.clone(), "#c", f.join("node_modules/c/index.js")), - ("should resolve with wildcard pattern", f2.clone(), "#internal/i.js", f2.join("src/internal/i.js")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } - - // Note added: - // * should resolve absolute path as an imports field target - // * should log the correct info - - #[rustfmt::skip] - let fail = [ - ("should disallow resolve out of package scope", f.clone(), "#b", ResolveError::InvalidPackageTarget("../b.js".to_string(), "#b".to_string(), f.join("package.json"))), - ("should resolve package #2", f.clone(), "#a", ResolveError::PackageImportNotDefined("#a".to_string(), f.join("package.json"))), - ]; - - for (comment, path, request, error) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!(resolution, Err(error), "{comment} {path:?} {request}"); - } -} - -#[test] -fn shared_resolvers() { - let f = super::fixture().join("imports-field"); - - // field name #1 - let resolver1 = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - imports_fields: vec![vec!["imports".into()]], - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - let resolved_path = resolver1.resolve(&f, "#imports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("b.js"))); - - // field name #2 - let resolver2 = resolver1.clone_with_options(ResolveOptions { - imports_fields: vec![vec!["other".into(), "imports".into()]], - ..ResolveOptions::default() - }); - - let resolved_path = resolver2.resolve(&f, "#b").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("a.js"))); -} - -// Small script for generating the test cases from enhanced_resolve -// for (c of testCases) { -// console.log("TestCase {") -// console.log(`name: ${JSON.stringify(c.name)},`) -// if (c.expect instanceof Error) { -// console.log(`expect: None,`) -// } else { -// console.log(`expect: Some(vec!${JSON.stringify(c.expect)}),`) -// } -// console.log(`imports_field: imports_field(json!(${JSON.stringify(c.suite[0], null, 2)})),`) -// console.log(`request: "${c.suite[1]}",`) -// console.log(`condition_names: vec!${JSON.stringify(c.suite[2])},`) -// console.log("},") -// } - -struct TestCase { - name: &'static str, - expect: Option>, - imports_field: JSONMap, - request: &'static str, - condition_names: Vec<&'static str>, -} - -#[allow(clippy::needless_pass_by_value)] -fn imports_field(value: serde_json::Value) -> JSONMap { - let s = serde_json::to_string(&value).unwrap(); - serde_json::from_str(&s).unwrap() -} - -#[test] -fn test_cases() { - let test_cases = [ - TestCase { - name: "sample #1", - expect: Some(vec!["./dist/test/file.js"]), - imports_field: imports_field(json!({ - "#abc/": { - "import": [ - "./dist/", - "./src/" - ], - "webpack": "./wp/" - }, - "#abc": "./main.js" - })), - request: "#abc/test/file.js", - condition_names: vec!["import", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "sample #1", - expect: Some(vec!["./src/test/file.js"]), - imports_field: imports_field(json!({ - "#abc/": { - "import": [ - "./src/" - ], - "webpack": "./wp/" - }, - "#abc": "./main.js" - })), - request: "#abc/test/file.js", - condition_names: vec!["import", "webpack"], - }, - TestCase { - name: "sample #2", - expect: Some(vec!["./data/timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#1/timezones/": "./data/timezones/" - })), - request: "#1/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #3", - expect: Some(vec!["./data/timezones/timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#aaa/": "./data/timezones/", - "#a/": "./data/timezones/" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #4", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/lib/": { - "browser": [ - "./browser/" - ] - }, - "#a/dist/index.js": { - "node": "./index.js" - } - })), - request: "#a/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #5", - expect: Some(vec!["./browser/index.js"]), - imports_field: imports_field(json!({ - "#a/lib/": { - "browser": [ - "./browser/" - ] - }, - "#a/dist/index.js": { - "node": "./index.js", - "default": "./browser/index.js" - } - })), - request: "#a/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #6", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/dist/a": "./dist/index.js" - })), - request: "#a/dist/aaa", - condition_names: vec![], - }, - TestCase { - name: "sample #7", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/a/a/": "./dist/index.js" - })), - request: "#a/a/a", - condition_names: vec![], - }, - TestCase { - name: "sample #8", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": "./index.js" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #9", - expect: Some(vec!["./main.js"]), - imports_field: imports_field(json!({ - "#a/index.js": "./main.js" - })), - request: "#a/index.js", - condition_names: vec![], - }, - TestCase { - name: "sample #10", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #11", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/bar#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #12", - expect: Some(vec!["./ok.js#abc"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/ok.js#abc", - condition_names: vec![], - }, - TestCase { - name: "sample #13", - expect: Some(vec!["./ok.js?abc"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/ok.js?abc", - condition_names: vec![], - }, - TestCase { - name: "sample #14", - expect: Some(vec!["./🎉.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/🎉.js", - condition_names: vec![], - }, - TestCase { - name: "sample #15", - expect: Some(vec!["./%F0%9F%8E%89.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/%F0%9F%8E%89.js", - condition_names: vec![], - }, - TestCase { - name: "sample #16", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/🎉", - condition_names: vec![], - }, - TestCase { - name: "sample #17", - expect: Some(vec!["./other.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/%F0%9F%8E%89", - condition_names: vec![], - }, - TestCase { - name: "sample #18", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/module", - condition_names: vec![], - }, - TestCase { - name: "sample #19", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/module#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #20", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/module?foo", - condition_names: vec![], - }, - TestCase { - name: "sample #21", - expect: Some(vec!["./d?e?f"]), - imports_field: imports_field(json!({ - "#a/a?b?c/": "./" - })), - request: "#a/a?b?c/d?e?f", - condition_names: vec![], - }, - TestCase { - name: "sample #22", - // We throw InvalidPackageTarget - expect: None, - // expect: Some(vec!["/user/a/index"]), - imports_field: imports_field(json!({ - "#a/": "/user/a/" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #1", - expect: Some(vec!["./A/b/d.js"]), - imports_field: imports_field(json!({ - "#a/": "./A/", - "#a/b/c": "./c.js" - })), - request: "#a/b/d.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #2", - expect: Some(vec!["./A/c.js"]), - imports_field: imports_field(json!({ - "#a/": "./A/", - "#a/b": "./b.js" - })), - request: "#a/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #3", - expect: Some(vec!["./A/b/c/d.js"]), - imports_field: imports_field(json!({ - "#a/": "./A/", - "#a/b/c/d": "./c.js" - })), - request: "#a/b/c/d.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #1", - expect: Some(vec!["./dist/index.js"]), - imports_field: imports_field(json!({ - "#a": "./dist/index.js" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #2", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": "./" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #3", - expect: Some(vec!["./dist/a.js"]), - imports_field: imports_field(json!({ - "#a/": "./dist/", - "#a/index.js": "./dist/a.js" - })), - request: "#a/index.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #4", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "./browser/" - ] - }, - "#a/index.js": { - "browser": "./index.js" - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #5", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "./browser/" - ] - }, - "#a/index.js": { - "node": "./node.js" - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #6", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: "#a", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #7", - expect: Some(vec!["./src/index.js"]), // `enhanced_resolve` is `None` - imports_field: imports_field(json!({ - "#a": { - "default": "./src/index.js", - "browser": "./index.js", - "node": "./src/node/index.js" - } - })), - request: "#a", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #8", - expect: Some(vec!["./src/index.js"]), - imports_field: imports_field(json!({ - "#a": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #9", - expect: Some(vec!["./index"]), - imports_field: imports_field(json!({ - "#a": "./index" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #10", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/index": "./index.js" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #11", - // We throw InvalidPackageTarget - // expect: Some(vec!["b"]), - expect: None, - imports_field: imports_field(json!({ - "#a": "b" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #12", - // We throw InvalidPackageTarget - // expect: Some(vec!["b/index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "b/" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #13", - // We throw InvalidPackageTarget - // expect: Some(vec!["b#anotherhashishere"]), - expect: None, - imports_field: imports_field(json!({ - "#a?q=a#hashishere": "b#anotherhashishere" - })), - request: "#a?q=a#hashishere", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #1", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #2", - expect: Some(vec!["./import.mjs"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec!["import"], - }, - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./require.js"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./import.mjs"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./require.js"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": [ - "./require.js" - ] - }, - { - "import": [ - "./import.mjs", - "#b/import.js" - ] - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./import.mjs"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "./import.mjs", - "#b/import.js" - ] - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "#b/import.js" - ] - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "mapping to a folder root #1", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#timezones": "./data/timezones/" - })), - request: "#timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #2", - expect: None, - imports_field: imports_field(json!({ - "#timezones/": "./data/timezones" - })), - request: "#timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #3", - expect: Some(vec!["./data/timezones/pdt/index.mjs"]), - imports_field: imports_field(json!({ - "#timezones/pdt/": "./data/timezones/pdt/" - })), - request: "#timezones/pdt/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #4", - expect: Some(vec!["./timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#a/": "./timezones/" - })), - request: "#a/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #5", - expect: Some(vec!["./timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#a/": "./" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #6", - expect: None, - imports_field: imports_field(json!({ - "#a/": "." - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #7", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": "./" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #1", - expect: Some(vec!["./lib/index.mjs"]), - imports_field: imports_field(json!({ - "#a/": "./", - "#a/dist/": "./lib/" - })), - request: "#a/dist/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #2", - expect: Some(vec!["./dist/utils/index.js"]), - imports_field: imports_field(json!({ - "#a/dist/utils/": "./dist/utils/", - "#a/dist/": "./lib/" - })), - request: "#a/dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #3", - expect: Some(vec!["./dist/utils/index.js"]), - imports_field: imports_field(json!({ - "#a/dist/utils/index.js": "./dist/utils/index.js", - "#a/dist/utils/": "./dist/utils/index.mjs", - "#a/dist/": "./lib/" - })), - request: "#a/dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #4", - expect: Some(vec!["./lib/index.mjs"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./browser/" - }, - "#a/dist/": "./lib/" - })), - request: "#a/dist/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #1", - // This behaves differently from enhanced_resolve, because `lodash/` is an an InvalidPackageConfig - // expect: Some(vec!["lodash/index.js"]), - expect: Some(vec!["./utils/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "conditional mapping folder #1", - expect: Some(vec!["./utils/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #2", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./node/" - ] - } - })), - request: "#a/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "conditional mapping folder #3", - expect: Some(vec!["./wpk/index.mjs"]), - imports_field: imports_field(json!({ - "#a/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils/" - ] - } - })), - request: "#a/index.mjs", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "incorrect exports field #1", - // We throw `PackageImportNotDefined` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "/utils/": "./a/" - })), - request: "#a/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #2", - // We throw `PackageImportNotDefined` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "/utils/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#a/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #3", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index": "./a/index.js" - })), - request: "#a/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #4", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index.mjs": "./a/index.js" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #5", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "#a/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #6", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index.mjs": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "#a/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #1", - // We don't throw in `package_imports_exports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": "./a/" - })), - request: "/utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect request #2", - // We don't throw in `package_imports_exports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #3", - // We don't throw in `package_imports_exports_resolve`, it's thrown in `package_imports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #4", - // We don't throw in `package_imports_exports_resolve`, it's thrown in `package_imports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#/", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #5", - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#a/", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #1", - // expect: Some(vec!["./dist/index"]), - expect: Some(vec!["dist/index"]), - imports_field: imports_field(json!({ - "#a/../../utils/": "./dist/" - })), - request: "#a/../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #2", - // We throw InvalidPackageTarget - // expect: Some(vec!["./dist/../../utils/index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "./dist/" - })), - request: "#a/../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #3", - // We throw InvalidPackageTarget - // expect: Some(vec!["../src/index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "../src/" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #4", - // We throw InvalidPackageTarget - // expect: Some(vec!["./utils/../../../index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": { - "browser": "./utils/../../../" - } - })), - request: "#a/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #1", - // expect: Some(vec!["moment/node_modules/lodash/dist/index.js"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": { - "browser": "moment/node_modules/" - } - })), - request: "#a/lodash/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #2", - // We throw InvalidPackageTarget - // expect: Some(vec!["../node_modules/lodash/dist/index.js"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "../node_modules/" - })), - request: "#a/lodash/dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "nested mapping #1", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": "./", - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./node/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "nested mapping #3", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["webpack"], - }, - TestCase { - name: "nested mapping #4", - // We throw NotFound - // expect: Some(vec!["moment/node/index.js"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "moment/node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["node", "browser"], - }, - TestCase { - name: "nested mapping #5", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "node"], - }, - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./node/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - TestCase { - name: "nested mapping #7", - expect: Some(vec!["./y.js"]), - imports_field: imports_field(json!({ - "#a": { - "abc": { - "def": "./x.js" - }, - "ghi": "./y.js" - } - })), - request: "#a", - condition_names: vec!["abc", "ghi"], - }, - TestCase { - name: "nested mapping #8", - // We throw PackageImportNotDefined - // expect: Some(vec![]), - expect: None, - imports_field: imports_field(json!({ - "#a": { - "abc": { - "def": "./x.js", - "default": [] - }, - "ghi": "./y.js" - } - })), - request: "#a", - condition_names: vec!["abc", "ghi"], - }, - ]; - - for case in test_cases { - let resolved = Resolver::default() - .package_imports_exports_resolve( - case.request, - &case.imports_field, - Path::new(""), - true, - &case.condition_names.iter().map(ToString::to_string).collect::>(), - &mut Ctx::default(), - ) - .map(|p| p.map(|p| p.to_path_buf())); - if let Some(expect) = case.expect { - if expect.is_empty() { - assert!(matches!(resolved, Ok(None)), "{} {:?}", &case.name, &resolved); - } else { - for expect in expect { - assert_eq!(resolved, Ok(Some(Path::new(expect).normalize())), "{}", &case.name); - } - } - } else { - assert!(resolved.is_err(), "{} {resolved:?}", &case.name); - } - } -} diff --git a/src/tests/incorrect_description_file.rs b/src/tests/incorrect_description_file.rs deleted file mode 100644 index a5c81796..00000000 --- a/src/tests/incorrect_description_file.rs +++ /dev/null @@ -1,62 +0,0 @@ -//! - -use rustc_hash::FxHashSet; - -use crate::{JSONError, Resolution, ResolveContext, ResolveError, ResolveOptions, Resolver}; - -// should not resolve main in incorrect description file #1 -#[test] -fn incorrect_description_file_1() { - let f = super::fixture().join("incorrect-package"); - let mut ctx = ResolveContext::default(); - let resolution = Resolver::default().resolve_with_context(f.join("pack1"), ".", &mut ctx); - let error = ResolveError::JSON(JSONError { - path: f.join("pack1/package.json"), - message: String::from("EOF while parsing a value at line 3 column 0"), - line: 3, - column: 0, - }); - assert_eq!(resolution, Err(error)); - assert_eq!(ctx.file_dependencies, FxHashSet::from_iter([f.join("pack1/package.json")])); - assert!(ctx.missing_dependencies.is_empty()); -} - -// should not resolve main in incorrect description file #2 -#[test] -fn incorrect_description_file_2() { - let f = super::fixture().join("incorrect-package"); - let resolution = Resolver::default().resolve(f.join("pack2"), "."); - let error = ResolveError::JSON(JSONError { - path: f.join("pack2/package.json"), - message: String::from("EOF while parsing a value at line 1 column 0"), - line: 1, - column: 0, - }); - assert_eq!(resolution, Err(error)); -} - -// should not resolve main in incorrect description file #3 -#[test] -fn incorrect_description_file_3() { - let f = super::fixture().join("incorrect-package"); - let resolution = Resolver::default().resolve(f.join("pack2"), "."); - assert!(resolution.is_err()); -} - -// `enhanced_resolve` does not have this test case -#[test] -fn no_description_file() { - let f = super::fixture_root().join("enhanced_resolve"); - - // has description file - let resolver = Resolver::default(); - assert_eq!( - resolver.resolve(&f, ".").map(Resolution::into_path_buf), - Ok(f.join("lib/index.js")) - ); - - // without description file - let resolver = - Resolver::new(ResolveOptions { description_files: vec![], ..ResolveOptions::default() }); - assert_eq!(resolver.resolve(&f, "."), Err(ResolveError::NotFound(".".into()))); -} diff --git a/src/tests/main_field.rs b/src/tests/main_field.rs deleted file mode 100644 index 3cadc8ce..00000000 --- a/src/tests/main_field.rs +++ /dev/null @@ -1,24 +0,0 @@ -//! Not part of enhanced_resolve's test suite - -use crate::{ResolveOptions, Resolver}; - -#[test] -fn test() { - let f = super::fixture().join("restrictions"); - - let resolver1 = Resolver::new(ResolveOptions { - main_fields: vec!["style".into()], - ..ResolveOptions::default() - }); - - let resolution = resolver1.resolve(&f, "pck2").map(|r| r.full_path()); - assert_eq!(resolution, Ok(f.join("node_modules/pck2/index.css"))); - - let resolver2 = resolver1.clone_with_options(ResolveOptions { - main_fields: vec!["module".into(), "main".into()], - ..ResolveOptions::default() - }); - - let resolution = resolver2.resolve(&f, "pck2").map(|r| r.full_path()); - assert_eq!(resolution, Ok(f.join("node_modules/pck2/module.js"))); -} diff --git a/src/tests/memory_fs.rs b/src/tests/memory_fs.rs deleted file mode 100644 index e4116609..00000000 --- a/src/tests/memory_fs.rs +++ /dev/null @@ -1,74 +0,0 @@ -use std::{ - io, - path::{Path, PathBuf}, -}; - -use crate::{FileMetadata, FileSystem}; - -#[derive(Default)] -pub struct MemoryFS { - fs: vfs::MemoryFS, -} - -impl MemoryFS { - /// # Panics - /// - /// * Fails to create directory - /// * Fails to write file - #[allow(dead_code)] - pub fn new(data: &[(&'static str, &'static str)]) -> Self { - let mut fs = Self { fs: vfs::MemoryFS::default() }; - for (path, content) in data { - fs.add_file(Path::new(path), content); - } - fs - } - - #[allow(dead_code)] - pub fn add_file(&mut self, path: &Path, content: &str) { - use vfs::FileSystem; - let fs = &mut self.fs; - // Create all parent directories - for path in path.ancestors().collect::>().iter().rev() { - let path = path.to_string_lossy(); - if !fs.exists(path.as_ref()).unwrap() { - fs.create_dir(path.as_ref()).unwrap(); - } - } - // Create file - let mut file = fs.create_file(path.to_string_lossy().as_ref()).unwrap(); - file.write_all(content.as_bytes()).unwrap(); - } -} - -impl FileSystem for MemoryFS { - fn read_to_string(&self, path: &Path) -> io::Result { - use vfs::FileSystem; - let mut file = self - .fs - .open_file(path.to_string_lossy().as_ref()) - .map_err(|err| io::Error::new(io::ErrorKind::NotFound, err))?; - let mut buffer = String::new(); - file.read_to_string(&mut buffer).unwrap(); - Ok(buffer) - } - - fn metadata(&self, path: &Path) -> io::Result { - use vfs::FileSystem; - let metadata = self - .fs - .metadata(path.to_string_lossy().as_ref()) - .map_err(|err| io::Error::new(io::ErrorKind::NotFound, err))?; - let is_file = metadata.file_type == vfs::VfsFileType::File; - let is_dir = metadata.file_type == vfs::VfsFileType::Directory; - Ok(FileMetadata::new(is_file, is_dir, false)) - } - - fn symlink_metadata(&self, path: &Path) -> io::Result { - self.metadata(path) - } - - fn canonicalize(&self, _path: &Path) -> io::Result { - Err(io::Error::new(io::ErrorKind::NotFound, "not a symlink")) - } -} diff --git a/src/tests/missing.rs b/src/tests/missing.rs deleted file mode 100644 index 4bf611ef..00000000 --- a/src/tests/missing.rs +++ /dev/null @@ -1,106 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/missing.test.js - -use normalize_path::NormalizePath; - -use crate::{AliasValue, ResolveContext, ResolveOptions, Resolver}; - -#[test] -fn test() { - let f = super::fixture(); - - let data = [ - ( - "./missing-file", - vec![f.join("missing-file"), f.join("missing-file.js"), f.join("missing-file.node")], - ), - ( - "missing-module", - vec![ - f.join("node_modules/missing-module"), - f.parent().unwrap().join("node_modules"), // enhanced-resolve is "node_modules/missing-module" - ], - ), - ( - "missing-module/missing-file", - vec![ - f.join("node_modules/missing-module"), - // f.parent().unwrap().join("node_modules/missing-module"), // we don't report this - ], - ), - ( - "m1/missing-file", - vec![ - f.join("node_modules/m1/missing-file"), - f.join("node_modules/m1/missing-file.js"), - f.join("node_modules/m1/missing-file.node"), - // f.parent().unwrap().join("node_modules/m1"), // we don't report this - ], - ), - ( - "m1/", - vec![ - f.join("node_modules/m1/index"), - f.join("node_modules/m1/index.js"), - f.join("node_modules/m1/index.json"), - f.join("node_modules/m1/index.node"), - ], - ), - ("m1/a", vec![f.join("node_modules/m1/a")]), - ]; - - let resolver = Resolver::default(); - - for (specifier, missing_dependencies) in data { - let mut ctx = ResolveContext::default(); - let _ = resolver.resolve_with_context(&f, specifier, &mut ctx); - - for path in ctx.file_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - } - - for path in missing_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - assert!( - ctx.missing_dependencies.contains(&path), - "{specifier}: {path:?} not in {:?}", - &ctx.missing_dependencies - ); - } - } -} - -#[test] -fn alias_and_extensions() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias: vec![ - ( - "@scope-js/package-name/dir$".into(), - vec![AliasValue::Path(f.join("foo/index.js").to_string_lossy().to_string())], - ), - ( - "react-dom".into(), - vec![AliasValue::Path(f.join("foo/index.js").to_string_lossy().to_string())], - ), - ], - extensions: vec![".server.ts".into()], - - ..ResolveOptions::default() - }); - - let mut ctx = ResolveContext::default(); - let _ = resolver.resolve_with_context(&f, "@scope-js/package-name/dir/router", &mut ctx); - let _ = resolver.resolve_with_context(&f, "react-dom/client", &mut ctx); - - for path in ctx.file_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - } - - for path in ctx.missing_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - if let Some(path) = path.parent() { - assert!(!path.is_file(), "{path:?} must not be a file"); - } - } -} diff --git a/src/tests/mod.rs b/src/tests/mod.rs deleted file mode 100644 index 94e6bd86..00000000 --- a/src/tests/mod.rs +++ /dev/null @@ -1,49 +0,0 @@ -mod alias; -mod browser_field; -mod builtins; -mod dependencies; -mod exports_field; -mod extension_alias; -mod extensions; -mod fallback; -mod full_specified; -mod imports_field; -mod incorrect_description_file; -mod main_field; -mod memory_fs; -mod missing; -mod resolve; -mod restrictions; -mod roots; -mod scoped_packages; -mod simple; -mod symlink; -mod tsconfig_paths; -mod tsconfig_project_references; - -use crate::Resolver; -use std::{env, path::PathBuf, sync::Arc, thread}; - -pub fn fixture_root() -> PathBuf { - env::current_dir().unwrap().join("fixtures") -} - -pub fn fixture() -> PathBuf { - fixture_root().join("enhanced_resolve").join("test").join("fixtures") -} - -#[test] -fn threaded_environment() { - let cwd = env::current_dir().unwrap(); - let resolver = Arc::new(Resolver::default()); - for _ in 0..2 { - _ = thread::spawn({ - let cwd = cwd.clone(); - let resolver = Arc::clone(&resolver); - move || { - _ = resolver.resolve(cwd, "."); - } - }) - .join(); - } -} diff --git a/src/tests/resolve.rs b/src/tests/resolve.rs deleted file mode 100644 index f2dbb88e..00000000 --- a/src/tests/resolve.rs +++ /dev/null @@ -1,119 +0,0 @@ -//! - -use crate::{ResolveError, ResolveOptions, Resolver}; - -#[test] -fn resolve() { - let f = super::fixture(); - - let resolver = Resolver::default(); - - let main1_js_path = f.join("main1.js").to_string_lossy().to_string(); - - #[rustfmt::skip] - let pass = [ - ("absolute path", f.clone(), main1_js_path.as_str(), f.join("main1.js")), - ("file with .js", f.clone(), "./main1.js", f.join("main1.js")), - ("file without extension", f.clone(), "./main1", f.join("main1.js")), - ("another file with .js", f.clone(), "./a.js", f.join("a.js")), - ("another file without extension", f.clone(), "./a", f.join("a.js")), - ("file in module with .js", f.clone(), "m1/a.js", f.join("node_modules/m1/a.js")), - ("file in module without extension", f.clone(), "m1/a", f.join("node_modules/m1/a.js")), - ("another file in module without extension", f.clone(), "complexm/step1", f.join("node_modules/complexm/step1.js")), - ("from submodule to file in sibling module", f.join("node_modules/complexm"), "m2/b.js", f.join("node_modules/m2/b.js")), - ("from nested directory to overwritten file in module", f.join("multiple_modules"), "m1/a.js", f.join("multiple_modules/node_modules/m1/a.js")), - ("from nested directory to not overwritten file in module", f.join("multiple_modules"), "m1/b.js", f.join("node_modules/m1/b.js")), - ("file with query", f.clone(), "./main1.js?query", f.join("main1.js?query")), - ("file with fragment", f.clone(), "./main1.js#fragment", f.join("main1.js#fragment")), - ("file with fragment and query", f.clone(), "./main1.js#fragment?query", f.join("main1.js#fragment?query")), - ("file with query and fragment", f.clone(), "./main1.js?#fragment", f.join("main1.js?#fragment")), - - ("file with query (unicode)", f.clone(), "./测试.js?query", f.join("测试.js?query")), - ("file with fragment (unicode)", f.clone(), "./测试.js#fragment", f.join("测试.js#fragment")), - ("file with fragment and query (unicode)", f.clone(), "./测试.js#fragment?query", f.join("测试.js#fragment?query")), - ("file with query and fragment (unicode)", f.clone(), "./测试.js?#fragment", f.join("测试.js?#fragment")), - - ("file in module with query", f.clone(), "m1/a?query", f.join("node_modules/m1/a.js?query")), - ("file in module with fragment", f.clone(), "m1/a#fragment", f.join("node_modules/m1/a.js#fragment")), - ("file in module with fragment and query", f.clone(), "m1/a#fragment?query", f.join("node_modules/m1/a.js#fragment?query")), - ("file in module with query and fragment", f.clone(), "m1/a?#fragment", f.join("node_modules/m1/a.js?#fragment")), - ("file in module with query and fragment", f.clone(), "m1/a?#fragment", f.join("node_modules/m1/a.js?#fragment")), - ("differ between directory and file, resolve file", f.clone(), "./dirOrFile", f.join("dirOrFile.js")), - ("differ between directory and file, resolve directory", f.clone(), "./dirOrFile/", f.join("dirOrFile/index.js")), - ("find node_modules outside of node_modules", f.join("browser-module/node_modules"), "m1/a", f.join("node_modules/m1/a.js")), - ("don't crash on main field pointing to self", f.clone(), "./main-field-self", f.join("./main-field-self/index.js")), - ("don't crash on main field pointing to self (2)", f.clone(), "./main-field-self2", f.join("./main-field-self2/index.js")), - // enhanced-resolve has `#` prepended with a `\0`, they are removed from the - // following 3 expected test results. - // See https://github.com/webpack/enhanced-resolve#escaping - ("handle fragment edge case (no fragment)", f.clone(), "./no#fragment/#/#", f.join("no#fragment/#/#.js")), - ("handle fragment edge case (fragment)", f.clone(), "./no#fragment/#/", f.join("no.js#fragment/#/")), - ("handle fragment escaping", f.clone(), "./no\0#fragment/\0#/\0##fragment", f.join("no#fragment/#/#.js#fragment")), - - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn issue238_resolve() { - let f = super::fixture().join("issue-238"); - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into(), ".jsx".into(), ".ts".into(), ".tsx".into()], - modules: vec!["src/a".into(), "src/b".into(), "src/common".into(), "node_modules".into()], - ..ResolveOptions::default() - }); - let resolved_path = - resolver.resolve(f.join("src/common"), "config/myObjectFile").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("src/common/config/myObjectFile.js")),); -} - -#[test] -fn prefer_relative() { - let f = super::fixture(); - - let resolver = - Resolver::new(ResolveOptions { prefer_relative: true, ..ResolveOptions::default() }); - - #[rustfmt::skip] - let pass = [ - ("should correctly resolve with preferRelative 1", "main1.js", f.join("main1.js")), - ("should correctly resolve with preferRelative 2", "m1/a.js", f.join("node_modules/m1/a.js")), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } -} - -#[test] -fn resolve_to_context() { - let f = super::fixture(); - let resolver = - Resolver::new(ResolveOptions { resolve_to_context: true, ..ResolveOptions::default() }); - - #[rustfmt::skip] - let data = [ - ("context for fixtures", f.clone(), "./", f.clone()), - ("context for fixtures/lib", f.clone(), "./lib", f.join("lib")), - ("context for fixtures with ..", f.clone(), "./lib/../../fixtures/./lib/..", f.clone()), - ("context for fixtures with query", f.clone(), "./?query", f.clone().with_file_name("fixtures?query")), - ]; - - for (comment, path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn resolve_hash_as_module() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions::default()); - let resolution = resolver.resolve(f, "#a"); - assert_eq!(resolution, Err(ResolveError::NotFound("#a".into()))); -} diff --git a/src/tests/restrictions.rs b/src/tests/restrictions.rs deleted file mode 100644 index 5ba56596..00000000 --- a/src/tests/restrictions.rs +++ /dev/null @@ -1,25 +0,0 @@ -//! - -use crate::{ResolveError, ResolveOptions, Resolver, Restriction}; - -// TODO: regex -// * should respect RegExp restriction -// * should try to find alternative #1 -// * should try to find alternative #2 -// * should try to find alternative #3 - -// should respect string restriction -#[test] -fn restriction1() { - let fixture = super::fixture(); - let f = fixture.join("restrictions"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - restrictions: vec![Restriction::Path(f.clone())], - ..ResolveOptions::default() - }); - - let resolution = resolver.resolve(&f, "pck2"); - assert_eq!(resolution, Err(ResolveError::Restriction(fixture.join("c.js"), f))); -} diff --git a/src/tests/roots.rs b/src/tests/roots.rs deleted file mode 100644 index b50e2a07..00000000 --- a/src/tests/roots.rs +++ /dev/null @@ -1,92 +0,0 @@ -//! - -use std::path::PathBuf; - -use crate::{AliasValue, ResolveError, ResolveOptions, Resolver}; - -fn dirname() -> PathBuf { - super::fixture_root().join("enhanced_resolve").join("test") -} - -#[test] -fn roots() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - alias: vec![("foo".into(), vec![AliasValue::from("/fixtures")])], - roots: vec![dirname(), f.clone()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should respect roots option", "/fixtures/b.js", f.join("b.js")), - ("should try another root option, if it exists", "/b.js", f.join("b.js")), - ("should respect extension", "/fixtures/b", f.join("b.js")), - ("should resolve in directory", "/fixtures/extensions/dir", f.join("extensions/dir/index.js")), - ("should respect aliases", "foo/b", f.join("b.js")), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } - - #[rustfmt::skip] - let fail = [ - ("should not work with relative path", "fixtures/b.js", ResolveError::NotFound("fixtures/b.js".into())) - ]; - - for (comment, request, expected) in fail { - let resolution = resolver.resolve(&f, request); - assert_eq!(resolution, Err(expected), "{comment} {request}"); - } -} - -#[test] -fn resolve_to_context() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - roots: vec![dirname(), f.clone()], - resolve_to_context: true, - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f, "/fixtures/lib").map(|r| r.full_path()); - let expected = f.join("lib"); - assert_eq!(resolved_path, Ok(expected)); -} - -#[test] -fn prefer_absolute() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - alias: vec![("foo".into(), vec![AliasValue::from("/fixtures")])], - roots: vec![dirname(), f.clone()], - prefer_absolute: true, - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve an absolute path (prefer absolute)", f.join("b.js").to_string_lossy().to_string(), f.join("b.js")), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(&f, &request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } -} - -#[test] -fn roots_fall_through() { - let f = super::fixture(); - let absolute_path = f.join("roots_fall_through/index.js"); - let specifier = absolute_path.to_string_lossy(); - let resolution = Resolver::new(ResolveOptions::default().with_root(&f)).resolve(&f, &specifier); - assert_eq!( - resolution.map(super::super::resolution::Resolution::into_path_buf), - Ok(absolute_path) - ); -} diff --git a/src/tests/scoped_packages.rs b/src/tests/scoped_packages.rs deleted file mode 100644 index 8258f00f..00000000 --- a/src/tests/scoped_packages.rs +++ /dev/null @@ -1,25 +0,0 @@ -//! - -use crate::{ResolveOptions, Resolver}; - -#[test] -fn scoped_packages() { - let f = super::fixture().join("scoped"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("main field should work", f.clone(), "@scope/pack1", f.join("./node_modules/@scope/pack1/main.js")), - ("browser field should work", f.clone(), "@scope/pack2", f.join("./node_modules/@scope/pack2/main.js")), - ("folder request should work", f.clone(), "@scope/pack2/lib", f.join("./node_modules/@scope/pack2/lib/index.js")) - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} diff --git a/src/tests/simple.rs b/src/tests/simple.rs deleted file mode 100644 index 08e1238a..00000000 --- a/src/tests/simple.rs +++ /dev/null @@ -1,68 +0,0 @@ -//! - -use std::env; - -use crate::Resolver; - -#[test] -fn simple() { - // mimic `enhanced-resolve/test/simple.test.js` - let dirname = env::current_dir().unwrap().join("fixtures"); - let f = dirname.join("enhanced_resolve/test"); - - let resolver = Resolver::default(); - - let data = [ - ("direct", f.clone(), "../lib/index"), - ("as directory", f, ".."), - ("as module", dirname.clone(), "./enhanced_resolve"), - ]; - - for (comment, path, request) in data { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - let expected = dirname.join("enhanced_resolve/lib/index.js"); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn dashed_name() { - let f = super::fixture(); - - let resolver = Resolver::default(); - - let data = [ - (f.clone(), "dash", f.join("node_modules/dash/index.js")), - (f.clone(), "dash-name", f.join("node_modules/dash-name/index.js")), - (f.join("node_modules/dash"), "dash", f.join("node_modules/dash/index.js")), - (f.join("node_modules/dash"), "dash-name", f.join("node_modules/dash-name/index.js")), - (f.join("node_modules/dash-name"), "dash", f.join("node_modules/dash/index.js")), - (f.join("node_modules/dash-name"), "dash-name", f.join("node_modules/dash-name/index.js")), - ]; - - for (path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{path:?} {request}"); - } -} - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows { - use super::super::memory_fs::MemoryFS; - - use crate::ResolveOptions; - - #[test] - fn no_package() { - use crate::ResolverGeneric; - use std::path::Path; - let f = Path::new("/"); - let file_system = MemoryFS::new(&[]); - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions::default(), - ); - let resolved_path = resolver.resolve(f, "package"); - assert!(resolved_path.is_err()); - } -} diff --git a/src/tests/symlink.rs b/src/tests/symlink.rs deleted file mode 100644 index 7589b560..00000000 --- a/src/tests/symlink.rs +++ /dev/null @@ -1,121 +0,0 @@ -use std::{fs, io, path::Path}; - -use crate::{ResolveOptions, Resolver}; - -#[derive(Debug, Clone, Copy)] -enum FileType { - File, - Dir, -} - -#[allow(unused_variables)] -fn symlink, Q: AsRef>( - original: P, - link: Q, - file_type: FileType, -) -> io::Result<()> { - #[cfg(target_family = "unix")] - { - std::os::unix::fs::symlink(original, link) - } - - #[cfg(target_family = "windows")] - match file_type { - FileType::File => std::os::windows::fs::symlink_file(original, link), - FileType::Dir => std::os::windows::fs::symlink_dir(original, link), - } -} - -fn init(dirname: &Path, temp_path: &Path) -> io::Result<()> { - if temp_path.exists() { - _ = fs::remove_dir_all(temp_path); - } - fs::create_dir(temp_path)?; - symlink(dirname.join("../lib/index.js"), temp_path.join("test"), FileType::File)?; - symlink(dirname.join("../lib"), temp_path.join("test2"), FileType::Dir)?; - fs::remove_file(temp_path.join("test"))?; - fs::remove_file(temp_path.join("test2"))?; - fs::remove_dir(temp_path) -} - -fn create_symlinks(dirname: &Path, temp_path: &Path) -> io::Result<()> { - fs::create_dir(temp_path).unwrap(); - symlink( - dirname.join("../lib/index.js").canonicalize().unwrap(), - temp_path.join("index.js"), - FileType::File, - )?; - symlink(dirname.join("../lib").canonicalize().unwrap(), temp_path.join("lib"), FileType::Dir)?; - symlink(dirname.join("..").canonicalize().unwrap(), temp_path.join("this"), FileType::Dir)?; - symlink(temp_path.join("this"), temp_path.join("that"), FileType::Dir)?; - symlink(Path::new("../../lib/index.js"), temp_path.join("node.relative.js"), FileType::File)?; - symlink( - Path::new("./node.relative.js"), - temp_path.join("node.relative.sym.js"), - FileType::File, - )?; - Ok(()) -} - -fn cleanup_symlinks(temp_path: &Path) { - _ = fs::remove_dir_all(temp_path); -} - -#[test] -fn test() -> io::Result<()> { - let root = super::fixture_root().join("enhanced_resolve"); - let dirname = root.join("test"); - let temp_path = dirname.join("temp"); - if !temp_path.exists() { - let is_admin = init(&dirname, &temp_path).is_ok(); - if !is_admin { - return Ok(()); - } - if let Err(err) = create_symlinks(&dirname, &temp_path) { - cleanup_symlinks(&temp_path); - return Err(err); - } - } - - let resolver_without_symlinks = - Resolver::new(ResolveOptions { symlinks: false, ..ResolveOptions::default() }); - let resolver_with_symlinks = Resolver::default(); - - #[rustfmt::skip] - let pass = [ - ("with a symlink to a file", temp_path.clone(), "./index.js"), - ("with a relative symlink to a file", temp_path.clone(), "./node.relative.js"), - ("with a relative symlink to a symlink to a file", temp_path.clone(), "./node.relative.sym.js"), - ("with a symlink to a directory 1", temp_path.clone(), "./lib/index.js"), - ("with a symlink to a directory 2", temp_path.clone(), "./this/lib/index.js"), - ("with multiple symlinks in the path 1", temp_path.clone(), "./this/test/temp/index.js"), - ("with multiple symlinks in the path 2", temp_path.clone(), "./this/test/temp/lib/index.js"), - ("with multiple symlinks in the path 3", temp_path.clone(), "./this/test/temp/this/lib/index.js"), - ("with a symlink to a directory 2 (chained)", temp_path.clone(), "./that/lib/index.js"), - ("with multiple symlinks in the path 1 (chained)", temp_path.clone(), "./that/test/temp/index.js"), - ("with multiple symlinks in the path 2 (chained)", temp_path.clone(), "./that/test/temp/lib/index.js"), - ("with multiple symlinks in the path 3 (chained)", temp_path.clone(), "./that/test/temp/that/lib/index.js"), - ("with symlinked directory as context 1", temp_path.join( "lib"), "./index.js"), - ("with symlinked directory as context 2", temp_path.join( "this"), "./lib/index.js"), - ("with symlinked directory as context and in path", temp_path.join( "this"), "./test/temp/lib/index.js"), - ("with symlinked directory in context path", temp_path.join( "this/lib"), "./index.js"), - ("with symlinked directory in context path and symlinked file", temp_path.join( "this/test"), "./temp/index.js"), - ("with symlinked directory in context path and symlinked directory", temp_path.join( "this/test"), "./temp/lib/index.js"), - ("with symlinked directory as context 2 (chained)", temp_path.join( "that"), "./lib/index.js"), - ("with symlinked directory as context and in path (chained)", temp_path.join( "that"), "./test/temp/lib/index.js"), - ("with symlinked directory in context path (chained)", temp_path.join( "that/lib"), "./index.js"), - ("with symlinked directory in context path and symlinked file (chained)", temp_path.join( "that/test"), "./temp/index.js"), - ("with symlinked directory in context path and symlinked directory (chained)", temp_path.join( "that/test"), "./temp/lib/index.js") - ]; - - for (comment, path, request) in pass { - let filename = resolver_with_symlinks.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(filename, Ok(root.join("lib/index.js")), "{comment:?}"); - - let resolved_path = - resolver_without_symlinks.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(path.join(request))); - } - - Ok(()) -} diff --git a/src/tests/tsconfig_paths.rs b/src/tests/tsconfig_paths.rs deleted file mode 100644 index 26935b5c..00000000 --- a/src/tests/tsconfig_paths.rs +++ /dev/null @@ -1,507 +0,0 @@ -//! tests for tsconfig-paths -//! -//! Fixtures copied from . - -use std::path::{Path, PathBuf}; - -use crate::{ - ResolveError, ResolveOptions, Resolver, TsConfig, TsconfigOptions, TsconfigReferences, -}; - -// -#[test] -fn tsconfig() { - let f = super::fixture_root().join("tsconfig"); - - #[rustfmt::skip] - let pass = [ - (f.clone(), None, "ts-path", f.join("foo.js")), - (f.join("nested"), None, "ts-path", f.join("nested/test.js")), - (f.join("cases/index"), None, "foo", f.join("node_modules/tsconfig-index/foo.js")), - // This requires reading package.json.tsconfig field - // (f.join("cases/field"), "foo", f.join("node_modules/tsconfig-field/foo.js")) - (f.join("cases/exports"), None, "foo", f.join("node_modules/tsconfig-exports/foo.js")), - (f.join("cases/extends-extension"), None, "foo", f.join("cases/extends-extension/foo.js")), - (f.join("cases/extends-extensionless"), None, "foo", f.join("node_modules/tsconfig-field/foo.js")), - (f.join("cases/extends-paths"), Some("src"), "@/index", f.join("cases/extends-paths/src/index.js")), - (f.join("cases/extends-multiple"), None, "foo", f.join("cases/extends-multiple/foo.js")), - ]; - - for (dir, subdir, request, expected) in pass { - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: dir.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - let path = subdir.map_or(dir.clone(), |subdir| dir.join(subdir)); - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{request} {path:?}"); - } - - #[rustfmt::skip] - let data = [ - (f.join("node_modules/tsconfig-not-used"), "ts-path", Ok(f.join("foo.js"))), - ]; - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - for (path, request, expected) in data { - let resolution = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolution, expected, "{path:?} {request}"); - } -} - -#[test] -fn tsconfig_fallthrough() { - let f = super::fixture_root().join("tsconfig"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "/"); - assert_eq!(resolved_path, Err(ResolveError::NotFound("/".into()))); -} - -#[test] -fn json_with_comments() { - let f = super::fixture_root().join("tsconfig/cases/trailing-comma"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "foo").map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(f.join("bar.js"))); -} - -// -#[test] -fn test_paths() { - let path = Path::new("/foo/tsconfig.json"); - let mut tsconfig_json = serde_json::json!({ - "compilerOptions": { - "paths": { - "jquery": ["node_modules/jquery/dist/jquery"], - "*": ["generated/*"], - "bar/*": ["test/*"], - "bar/baz/*": ["baz/*", "yo/*"], - "@/components/*": ["components/*"], - "url": ["node_modules/my-url"], - } - } - }) - .to_string(); - let tsconfig = TsConfig::parse(true, path, &mut tsconfig_json).unwrap(); - - let data = [ - ("jquery", vec!["/foo/node_modules/jquery/dist/jquery"]), - ("test", vec!["/foo/generated/test"]), - ("test/hello", vec!["/foo/generated/test/hello"]), - ("bar/hi", vec!["/foo/test/hi"]), - ("bar/baz/hi", vec!["/foo/baz/hi", "/foo/yo/hi"]), - ("@/components/button", vec!["/foo/components/button"]), - ("./jquery", vec![]), - ("url", vec!["/foo/node_modules/my-url"]), - ]; - - for (specifier, expected) in data { - let paths = tsconfig.resolve_path_alias(specifier); - let expected = expected.into_iter().map(PathBuf::from).collect::>(); - assert_eq!(paths, expected, "{specifier}"); - } -} - -// -#[test] -fn test_base_url() { - let path = Path::new("/foo/tsconfig.json"); - let mut tsconfig_json = serde_json::json!({ - "compilerOptions": { - "baseUrl": "./src" - } - }) - .to_string(); - let tsconfig = TsConfig::parse(true, path, &mut tsconfig_json).unwrap(); - - let data = [ - ("foo", vec!["/foo/src/foo"]), - ("components/button", vec!["/foo/src/components/button"]), - ("./jquery", vec![]), - ]; - - for (specifier, expected) in data { - let paths = tsconfig.resolve_path_alias(specifier); - let expected = expected.into_iter().map(PathBuf::from).collect::>(); - assert_eq!(paths, expected, "{specifier}"); - } -} - -// -#[test] -fn test_paths_and_base_url() { - let path = Path::new("/foo/tsconfig.json"); - let mut tsconfig_json = serde_json::json!({ - "compilerOptions": { - "baseUrl": "./src", - "paths": { - "*": ["generated/*"], - "bar/*": ["test/*"], - "bar/baz/*": ["baz/*", "yo/*"], - "@/components/*": ["components/*"] - } - } - }) - .to_string(); - let tsconfig = TsConfig::parse(true, path, &mut tsconfig_json).unwrap(); - - let data = [ - ("test", vec!["/foo/src/generated/test", "/foo/src/test"]), - ("test/hello", vec!["/foo/src/generated/test/hello", "/foo/src/test/hello"]), - ("bar/hi", vec!["/foo/src/test/hi", "/foo/src/bar/hi"]), - ("bar/baz/hi", vec!["/foo/src/baz/hi", "/foo/src/yo/hi", "/foo/src/bar/baz/hi"]), - ("@/components/button", vec!["/foo/src/components/button", "/foo/src/@/components/button"]), - ("./jquery", vec![]), - ]; - - for (specifier, expected) in data { - let paths = tsconfig.resolve_path_alias(specifier); - let expected = expected.into_iter().map(PathBuf::from).collect::>(); - assert_eq!(paths, expected, "{specifier}"); - } -} - -// Template variable ${configDir} for substitution of config files directory path -// https://github.com/microsoft/TypeScript/pull/58042 -#[test] -fn test_template_variable() { - let f = super::fixture_root().join("tsconfig"); - let f2 = f.join("cases").join("paths_template_variable"); - - #[rustfmt::skip] - let pass = [ - (f2.clone(), "tsconfig1.json", "foo", f2.join("foo.js")), - (f2.clone(), "tsconfig2.json", "foo", f2.join("foo.js")), - (f.clone(), "tsconfig_template_variable.json", "foo", f.join("foo.js")), - ]; - - for (dir, tsconfig, request, expected) in pass { - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: dir.join(tsconfig), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&dir, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{request} {tsconfig} {dir:?}"); - } -} - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows_test { - use std::path::{Path, PathBuf}; - - use crate::{ - ResolveError, ResolveOptions, ResolverGeneric, TsconfigOptions, TsconfigReferences, - }; - - use super::super::memory_fs::MemoryFS; - - struct OneTest { - name: &'static str, - tsconfig: String, - package_json: Option<(PathBuf, String)>, - main_fields: Option>, - existing_files: Vec<&'static str>, - requested_module: &'static str, - expected_path: &'static str, - extensions: Vec, - } - - impl Default for OneTest { - fn default() -> Self { - Self { - name: "", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/*": ["location/*"] - } - } - }) - .to_string(), - package_json: None, - main_fields: None, - existing_files: vec![], - requested_module: "", - expected_path: "", - extensions: vec![ - ".js".into(), - ".json".into(), - ".node".into(), - ".ts".into(), - ".tsx".into(), - ], - } - } - } - - impl OneTest { - fn resolver(&self, root: &Path) -> ResolverGeneric { - let mut file_system = MemoryFS::default(); - - file_system.add_file(&root.join("tsconfig.json"), &self.tsconfig); - if let Some((path, package_json)) = &self.package_json { - file_system.add_file(&root.join(path).join("package.json"), package_json); - } - for path in &self.existing_files { - file_system.add_file(Path::new(path), ""); - } - - let mut options = ResolveOptions { - extensions: self.extensions.clone(), - tsconfig: Some(TsconfigOptions { - config_file: root.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }; - if let Some(main_fields) = &self.main_fields { - options.main_fields.clone_from(main_fields); - } - - ResolverGeneric::::new_with_file_system(file_system, options) - } - } - - // Path matching tests from tsconfig-paths - // * - // * - #[test] - fn match_path() { - let pass = [ - OneTest { - name: "should locate path that matches with star and exists", - existing_files: vec!["/root/location/mylib/index.ts"], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve to correct path when many are specified", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/*": ["foo1/*", "foo2/*", "location/*", "foo3/*"], - } - } - }) - .to_string(), - existing_files: vec!["/root/location/mylib/index.ts"], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should locate path that matches with star and prioritize pattern with longest prefix", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "*": ["location/*"], - "lib/*": ["location/*"], - } - } - }) - .to_string(), - existing_files: vec![ - "/root/location/lib/mylib/index.ts", - "/root/location/mylib/index.ts", - ], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should locate path that matches with star and exists with extension", - existing_files: vec![ - "/root/location/mylib.myext", - ], - requested_module: "lib/mylib", - extensions: vec![".js".into(), ".myext".into()], - expected_path: "/root/location/mylib.myext", - ..OneTest::default() - }, - OneTest { - name: "should resolve request with extension specified", - existing_files: vec![ - "/root/location/test.jpg", - ], - requested_module: "lib/test.jpg", - expected_path: "/root/location/test.jpg", - ..OneTest::default() - }, - OneTest { - name: "should locate path that matches without star and exists", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/foo": ["location/foo"] - } - } - }) - .to_string(), - existing_files: vec![ - "/root/location/foo.ts", - ], - requested_module: "lib/foo", - expected_path: "/root/location/foo.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve to parent folder when filename is in subfolder", - existing_files: vec![ - "/root/location/mylib/index.ts", - ], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve from main field in package.json", - package_json: Some((PathBuf::from("/root/location/mylib"), serde_json::json!({ - "main": "./kalle.ts" - }).to_string())), - existing_files: vec![ - "/root/location/mylib/kalle.ts", - ], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/kalle.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve from main field in package.json (js)", - package_json: Some((PathBuf::from("/root/location/mylib.js"), serde_json::json!({ - "main": "./kalle.js" - }).to_string())), - existing_files: vec![ - "/root/location/mylib.js/kalle.js", - ], - extensions: vec![".ts".into(), ".js".into()], - requested_module: "lib/mylib.js", - expected_path: "/root/location/mylib.js/kalle.js", - ..OneTest::default() - }, - OneTest { - name: "should resolve from list of fields by priority in package.json", - main_fields: Some(vec!["missing".into(), "browser".into(), "main".into()]), - package_json: Some((PathBuf::from("/root/location/mylibjs"), serde_json::json!({ - "main": "./main.js", - "browser": "./browser.js" - }).to_string())), - existing_files: vec![ - "/root/location/mylibjs/main.js", - "/root/location/mylibjs/browser.js", - ], - extensions: vec![".ts".into(), ".js".into()], - requested_module: "lib/mylibjs", - expected_path: "/root/location/mylibjs/browser.js", - ..OneTest::default() - }, -OneTest { - name: "should ignore field mappings to missing files in package.json", - main_fields: Some(vec!["browser".into(), "main".into()]), - package_json: Some((PathBuf::from("/root/location/mylibjs"), serde_json::json!({ - "main": "./kalle.js", - "browser": "./nope.js" - }).to_string())), - existing_files: vec![ - "/root/location/mylibjs/kalle.js", - ], - extensions: vec![".ts".into(), ".js".into()], - requested_module: "lib/mylibjs", - expected_path: "/root/location/mylibjs/kalle.js", - ..OneTest::default() - }, - // Tests that are not applicable: - // name: "should resolve nested main fields" - // name: "should ignore advanced field mappings in package.json" - // name: "should resolve to with the help of baseUrl when not explicitly set" - // name: "should not resolve with the help of baseUrl when asked not to" - // name: "should resolve main file with cjs file extension" - OneTest { - name: "should resolve .ts from .js alias", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "@/*": ["src/*"] - } - } - }).to_string(), - existing_files: vec![ - "/root/src/foo.ts", - ], - requested_module: "@/foo", // original data was "@/foo.ts" but I don't get why it is the case? - expected_path: "/root/src/foo.ts", // original data was "/root/src/foo" - ..OneTest::default() - }, - ]; - - let root = PathBuf::from("/root"); - - for test in pass { - let resolved_path = - test.resolver(&root).resolve(&root, test.requested_module).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(PathBuf::from(test.expected_path)), "{}", test.name); - } - - let fail = [ - OneTest { - name: "should not locate path that does not match", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/*": ["location/*"] - } - } - }) - .to_string(), - existing_files: vec!["/root/location/mylib"], - requested_module: "lib/mylibjs", - ..OneTest::default() - }, - OneTest { - name: "should not resolve typings file (index.d.ts)", - existing_files: vec!["/root/location/mylib/index.d.ts"], - requested_module: "lib/mylib", - ..OneTest::default() - }, - ]; - - for test in fail { - let resolved_path = - test.resolver(&root).resolve(&root, test.requested_module).map(|f| f.full_path()); - assert_eq!( - resolved_path, - Err(ResolveError::NotFound(test.requested_module.into())), - "{}", - test.name - ); - } - } -} diff --git a/src/tests/tsconfig_project_references.rs b/src/tests/tsconfig_project_references.rs deleted file mode 100644 index b552fefe..00000000 --- a/src/tests/tsconfig_project_references.rs +++ /dev/null @@ -1,101 +0,0 @@ -//! Tests for tsconfig project references - -use crate::{ResolveError, ResolveOptions, Resolver, TsconfigOptions, TsconfigReferences}; - -#[test] -fn auto() { - let f = super::fixture_root().join("tsconfig/cases/project_references"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("app"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - // Test normal paths alias - (f.join("app"), "@/index.ts", f.join("app/aliased/index.ts")), - (f.join("app"), "@/../index.ts", f.join("app/index.ts")), - // Test project reference - (f.join("project_a"), "@/index.ts", f.join("project_a/aliased/index.ts")), - (f.join("project_b/src"), "@/index.ts", f.join("project_b/src/aliased/index.ts")), - // Does not have paths alias - (f.join("project_a"), "./index.ts", f.join("project_a/index.ts")), - (f.join("project_c"), "./index.ts", f.join("project_c/index.ts")), - // Template variable - { - let dir = f.parent().unwrap().join("paths_template_variable"); - (dir.clone(), "foo", dir.join("foo.js")) - } - ]; - - for (path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{request} {path:?}"); - } -} - -#[test] -fn disabled() { - let f = super::fixture_root().join("tsconfig/cases/project_references"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("app"), - references: TsconfigReferences::Disabled, - }), - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - // Test normal paths alias - (f.join("app"), "@/index.ts", Ok(f.join("app/aliased/index.ts"))), - (f.join("app"), "@/../index.ts", Ok(f.join("app/index.ts"))), - // Test project reference - (f.join("project_a"), "@/index.ts", Err(ResolveError::NotFound("@/index.ts".into()))), - (f.join("project_b/src"), "@/index.ts", Err(ResolveError::NotFound("@/index.ts".into()))), - // Does not have paths alias - (f.join("project_a"), "./index.ts", Ok(f.join("project_a/index.ts"))), - (f.join("project_c"), "./index.ts", Ok(f.join("project_c/index.ts"))), - ]; - - for (path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, expected, "{request} {path:?}"); - } -} - -#[test] -fn manual() { - let f = super::fixture_root().join("tsconfig/cases/project_references"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("app"), - references: TsconfigReferences::Paths(vec!["../project_a/conf.json".into()]), - }), - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - // Test normal paths alias - (f.join("app"), "@/index.ts", Ok(f.join("app/aliased/index.ts"))), - (f.join("app"), "@/../index.ts", Ok(f.join("app/index.ts"))), - // Test project reference - (f.join("project_a"), "@/index.ts", Ok(f.join("project_a/aliased/index.ts"))), - (f.join("project_b/src"), "@/index.ts", Err(ResolveError::NotFound("@/index.ts".into()))), - // Does not have paths alias - (f.join("project_a"), "./index.ts", Ok(f.join("project_a/index.ts"))), - (f.join("project_c"), "./index.ts", Ok(f.join("project_c/index.ts"))), - ]; - - for (path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, expected, "{request} {path:?}"); - } -} diff --git a/src/tsconfig.rs b/src/tsconfig.rs deleted file mode 100644 index aa00f6e4..00000000 --- a/src/tsconfig.rs +++ /dev/null @@ -1,212 +0,0 @@ -use std::{ - path::{Path, PathBuf}, - sync::Arc, -}; - -use serde::Deserialize; -use typescript_tsconfig_json::{CompilerOptionsPathsMap, ExtendsField}; - -use crate::PathUtil; - -#[derive(Debug, Deserialize)] -#[serde(rename_all = "camelCase")] -pub struct TsConfig { - /// Whether this is the caller tsconfig. - /// Used for final template variable substitution when all configs are extended and merged. - #[serde(skip)] - root: bool, - - /// Path to `tsconfig.json`. Contains the `tsconfig.json` filename. - #[serde(skip)] - path: PathBuf, - - #[serde(default)] - pub extends: Option, - - #[serde(default)] - pub compiler_options: CompilerOptions, - - /// Bubbled up project references with a reference to their tsconfig. - #[serde(default)] - pub references: Vec, -} - -/// Compiler Options -/// -/// -#[derive(Debug, Default, Deserialize)] -#[serde(rename_all = "camelCase")] -pub struct CompilerOptions { - base_url: Option, - - /// Path aliases - paths: Option, - - /// The actual base for where path aliases are resolved from. - #[serde(skip)] - paths_base: PathBuf, -} - -/// Project Reference -/// -/// -#[derive(Debug, Deserialize)] -pub struct ProjectReference { - /// The path property of each reference can point to a directory containing a tsconfig.json file, - /// or to the config file itself (which may have any name). - pub path: PathBuf, - - /// Reference to the resolved tsconfig - #[serde(skip)] - pub tsconfig: Option>, -} - -impl TsConfig { - pub fn parse(root: bool, path: &Path, json: &mut str) -> Result { - _ = json_strip_comments::strip(json); - let mut tsconfig: Self = serde_json::from_str(json)?; - tsconfig.root = root; - tsconfig.path = path.to_path_buf(); - let directory = tsconfig.directory().to_path_buf(); - if let Some(base_url) = tsconfig.compiler_options.base_url { - tsconfig.compiler_options.base_url = Some(directory.normalize_with(base_url)); - } - if tsconfig.compiler_options.paths.is_some() { - tsconfig.compiler_options.paths_base = - tsconfig.compiler_options.base_url.as_ref().map_or(directory, Clone::clone); - } - Ok(tsconfig) - } - - pub fn build(mut self) -> Self { - if self.root { - let dir = self.directory().to_path_buf(); - // Substitute template variable in `tsconfig.compilerOptions.paths` - if let Some(paths) = &mut self.compiler_options.paths { - for paths in paths.values_mut() { - for path in paths { - Self::substitute_template_variable(&dir, path); - } - } - } - } - self - } - - /// Directory to `tsconfig.json` - /// - /// # Panics - /// - /// * When the `tsconfig.json` path is misconfigured. - pub fn directory(&self) -> &Path { - debug_assert!(self.path.file_name().is_some()); - self.path.parent().unwrap() - } - - pub fn extend_tsconfig(&mut self, tsconfig: &Self) { - let compiler_options = &mut self.compiler_options; - if compiler_options.paths.is_none() { - compiler_options.paths_base = compiler_options - .base_url - .as_ref() - .map_or_else(|| tsconfig.compiler_options.paths_base.clone(), Clone::clone); - compiler_options.paths.clone_from(&tsconfig.compiler_options.paths); - } - if compiler_options.base_url.is_none() { - compiler_options.base_url.clone_from(&tsconfig.compiler_options.base_url); - } - } - - pub fn resolve(&self, path: &Path, specifier: &str) -> Vec { - if path.starts_with(self.base_path()) { - let paths = self.resolve_path_alias(specifier); - if !paths.is_empty() { - return paths; - } - } - for tsconfig in self.references.iter().filter_map(|reference| reference.tsconfig.as_ref()) { - if path.starts_with(tsconfig.base_path()) { - return tsconfig.resolve_path_alias(specifier); - } - } - vec![] - } - - // Copied from parcel - // - pub fn resolve_path_alias(&self, specifier: &str) -> Vec { - if specifier.starts_with(|s| s == '/' || s == '.') { - return vec![]; - } - - let base_url_iter = self - .compiler_options - .base_url - .as_ref() - .map_or_else(Vec::new, |base_url| vec![base_url.normalize_with(specifier)]); - - let Some(paths_map) = &self.compiler_options.paths else { - return base_url_iter; - }; - - let paths = paths_map.get(specifier).map_or_else( - || { - let mut longest_prefix_length = 0; - let mut longest_suffix_length = 0; - let mut best_key: Option<&String> = None; - - for key in paths_map.keys() { - if let Some((prefix, suffix)) = key.split_once('*') { - if (best_key.is_none() || prefix.len() > longest_prefix_length) - && specifier.starts_with(prefix) - && specifier.ends_with(suffix) - { - longest_prefix_length = prefix.len(); - longest_suffix_length = suffix.len(); - best_key.replace(key); - } - } - } - - best_key.and_then(|key| paths_map.get(key)).map_or_else(Vec::new, |paths| { - paths - .iter() - .map(|path| { - path.replace( - '*', - &specifier[longest_prefix_length - ..specifier.len() - longest_suffix_length], - ) - }) - .collect::>() - }) - }, - Clone::clone, - ); - - paths - .into_iter() - .map(|p| self.compiler_options.paths_base.normalize_with(p)) - .chain(base_url_iter) - .collect() - } - - fn base_path(&self) -> &Path { - self.compiler_options - .base_url - .as_ref() - .map_or_else(|| self.directory(), |path| path.as_ref()) - } - - /// Template variable `${configDir}` for substitution of config files directory path - /// - /// NOTE: All tests cases are just a head replacement of `${configDir}`, so we are constrained as such. - /// - /// See - fn substitute_template_variable(directory: &Path, path: &mut String) { - const TEMPLATE_VARIABLE: &str = "${configDir}/"; - if let Some(stripped_path) = path.strip_prefix(TEMPLATE_VARIABLE) { - *path = directory.join(stripped_path).to_string_lossy().to_string(); - } - } -} diff --git a/tests/integration_test.rs b/tests/integration_test.rs deleted file mode 100644 index d369413f..00000000 --- a/tests/integration_test.rs +++ /dev/null @@ -1,102 +0,0 @@ -//! Test public APIs - -use std::{env, path::PathBuf}; - -use oxc_resolver::{EnforceExtension, Resolution, ResolveContext, ResolveOptions, Resolver}; - -fn dir() -> PathBuf { - env::current_dir().unwrap() -} - -fn resolve(specifier: &str) -> Resolution { - let path = dir(); - Resolver::new(ResolveOptions::default()).resolve(path, specifier).unwrap() -} - -#[test] -fn clone() { - let resolution = resolve("./tests/package.json"); - assert_eq!(resolution.clone(), resolution); -} - -#[test] -fn debug() { - let resolution = resolve("./tests/package.json"); - let s = format!("{resolution:?}"); - assert!(!s.is_empty()); -} - -#[test] -fn eq() { - let resolution = resolve("./tests/package.json"); - assert_eq!(resolution, resolution); -} - -#[test] -fn package_json() { - let resolution = resolve("./tests/package.json"); - assert!(resolution - .package_json() - .is_some_and(|json| json.name.as_ref().is_some_and(|name| name == "name"))); -} - -#[cfg(feature = "package_json_raw_json_api")] -#[test] -fn package_json_raw_json_api() { - let resolution = resolve("./tests/package.json"); - assert!(resolution - .package_json() - .unwrap() - .raw_json() - .get("name") - .is_some_and(|name| name == "name")); -} - -#[test] -fn clear_cache() { - let resolver = Resolver::new(ResolveOptions::default()); - resolver.clear_cache(); // exists -} - -#[test] -fn options() { - let resolver = Resolver::new(ResolveOptions::default()); - let options = resolver.options(); - assert!(!format!("{options:?}").is_empty()); -} - -#[test] -fn debug_resolver() { - let resolver = Resolver::new(ResolveOptions::default()); - assert!(!format!("{resolver:?}").is_empty()); -} - -#[test] -fn dependencies() { - let path = dir(); - let mut ctx = ResolveContext::default(); - let _ = Resolver::new(ResolveOptions::default()).resolve_with_context( - path, - "./tests/package.json", - &mut ctx, - ); - assert!(!ctx.file_dependencies.is_empty()); - assert!(ctx.missing_dependencies.is_empty()); -} - -#[test] -fn options_api() { - _ = ResolveOptions::default() - .with_builtin_modules(true) - .with_condition_names(&[]) - .with_extension(".js") - .with_force_extension(EnforceExtension::Auto) - .with_fully_specified(true) - .with_main_field("asdf") - .with_main_file("main") - .with_module("module") - .with_prefer_absolute(true) - .with_prefer_relative(true) - .with_root(PathBuf::new()) - .with_symbolic_link(true); -} diff --git a/tests/package.json b/tests/package.json deleted file mode 100644 index f099adcf..00000000 --- a/tests/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "name": "name" -} diff --git a/tests/resolve_test.rs b/tests/resolve_test.rs deleted file mode 100644 index 30d1ceff..00000000 --- a/tests/resolve_test.rs +++ /dev/null @@ -1,104 +0,0 @@ -use std::{env, path::PathBuf}; - -use oxc_resolver::{ResolveError, ResolveOptions, Resolver}; - -fn dir() -> PathBuf { - env::current_dir().unwrap() -} - -#[test] -fn chinese() { - let dir = dir(); - let specifier = "./fixtures/misc/中文/中文.js"; - let resolution = Resolver::new(ResolveOptions::default()).resolve(&dir, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(dir.join("fixtures/misc/中文/中文.js")) - ); -} - -#[test] -fn styled_components() { - let dir = dir(); - let path = dir.join("fixtures/pnpm"); - let module_path = dir.join("node_modules/.pnpm/styled-components@6.1.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/styled-components"); - let specifier = "styled-components"; - - // cjs - let options = - ResolveOptions { alias_fields: vec![vec!["browser".into()]], ..ResolveOptions::default() }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/styled-components.browser.cjs.js")) - ); - - // esm - let options = ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - main_fields: vec!["module".into()], - ..ResolveOptions::default() - }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/styled-components.browser.esm.js")) - ); -} - -#[test] -fn axios() { - let dir = dir(); - let path = dir.join("fixtures/pnpm"); - let module_path = dir.join("node_modules/.pnpm/axios@1.6.2/node_modules/axios"); - let specifier = "axios"; - - // default - let options = ResolveOptions::default(); - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("index.js")) - ); - - // browser - let options = ResolveOptions { - condition_names: vec!["browser".into(), "require".into()], - ..ResolveOptions::default() - }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/browser/axios.cjs")) - ); - - // cjs - let options = ResolveOptions { - condition_names: vec!["node".into(), "require".into()], - ..ResolveOptions::default() - }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/node/axios.cjs")) - ); -} - -#[test] -fn postcss() { - let dir = dir(); - let path = dir.join("fixtures/pnpm"); - let module_path = path.join("node_modules/postcss"); - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - // should ignore "path" - let resolution = resolver.resolve(&module_path, "path"); - assert_eq!(resolution, Err(ResolveError::Ignored(module_path.clone()))); - - // should ignore "./lib/terminal-highlight" - let resolution = resolver.resolve(&module_path, "./lib/terminal-highlight"); - assert_eq!(resolution, Err(ResolveError::Ignored(module_path.join("lib/terminal-highlight")))); -} From e4d8a1a00cdbe41685977d803a0d4ebf0c43c780 Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Tue, 25 Jun 2024 01:10:15 +0300 Subject: [PATCH 36/82] squash! --- package.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index a431e48f..c9e1c136 100644 --- a/package.json +++ b/package.json @@ -16,9 +16,9 @@ }, "devDependencies": { "@napi-rs/cli": "^3.0.0-alpha.43", - "@napi-rs/wasm-runtime": "^0.2.0", - "@types/node": "^20.10.4", - "ava": "^6.0.1", - "emnapi": "^1.0.0" + "@napi-rs/wasm-runtime": "^0.2.4", + "@types/node": "^20.14.8", + "ava": "^6.1.3", + "emnapi": "^1.2.0" } } From 32133718394764db8280c4fa4e1008c5d733f019 Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Wed, 26 Jun 2024 02:01:41 +0300 Subject: [PATCH 37/82] squash! Signed-off-by: Nikola Hristov --- Cargo.lock | 934 ------ Source/lib.rs | 4 +- Source/specifier.rs | 2 +- Source/tsconfig.rs | 13 +- fixtures/enhanced_resolve/lib/index.js | 1 - fixtures/enhanced_resolve/package.json | 4 - fixtures/enhanced_resolve/test/.gitignore | 2 - .../enhanced_resolve/test/fixtures/#/a.js | 0 fixtures/enhanced_resolve/test/fixtures/a.js | 3 - .../enhanced_resolve/test/fixtures/abc.txt | 1 - .../test/fixtures/alias/files/a.js | 0 fixtures/enhanced_resolve/test/fixtures/b.js | 3 - .../browser-module/browser/module-a.js | 0 .../fixtures/browser-module/lib/browser.js | 0 .../fixtures/browser-module/lib/ignore.js | 0 .../test/fixtures/browser-module/lib/main.js | 0 .../fixtures/browser-module/lib/replaced.js | 0 .../test/fixtures/browser-module/lib/self.js | 0 .../fixtures/browser-module/lib/toString.js | 0 .../browser-module/node_modules/module-a.js | 0 .../browser-module/node_modules/module-b.js | 0 .../browser-module/node_modules/module-c.js | 0 .../node_modules/recursive-file/a.js | 0 .../node_modules/recursive-file/b.js | 0 .../node_modules/recursive-file/c.js | 0 .../node_modules/recursive-file/d.js | 0 .../node_modules/recursive-file/package.json | 8 - .../test/fixtures/browser-module/package.json | 33 - .../test/fixtures/builtins/package.json | 12 - fixtures/enhanced_resolve/test/fixtures/c.js | 4 - .../enhanced_resolve/test/fixtures/complex.js | 13 - .../test/fixtures/crypto-js/index.js | 0 .../test/fixtures/crypto-js/package.json | 7 - .../test/fixtures/decorated-fs/exists.js | 0 .../test/fixtures/dirOrFile.js | 1 - .../test/fixtures/dirOrFile/index.js | 1 - .../directory-default/directory-default.js | 0 .../node_modules/@org/pkg/dist/string.js | 1 - .../@org/pkg/dist/string.test.d.ts | 1 - .../node_modules/@org/pkg/package.json | 9 - .../node_modules/pkg/dist/string.js | 1 - .../node_modules/pkg/dist/string.test.d.ts | 1 - .../node_modules/pkg/package.json | 9 - .../node_modules/exports-field/package.json | 7 - .../node_modules/pack1/index.js | 0 .../test/fixtures/exports-field/a.js | 1 - .../node_modules/exports-field/lib/browser.js | 1 - .../node_modules/exports-field/lib/index.js | 0 .../exports-field/lib/lib2/main.js | 1 - .../node_modules/exports-field/lib/main.js | 1 - .../node_modules/exports-field/main.js | 1 - .../node_modules/exports-field/package.json | 18 - .../node_modules/exports-field/x.js | 1 - .../invalid-exports-field/index.js | 0 .../invalid-exports-field/package.json | 13 - .../node_modules/invalid-exports-field/umd.js | 0 .../test/fixtures/exports-field/package.json | 5 - .../node_modules/exports-field/index.js | 1 - .../node_modules/exports-field/lib/browser.js | 1 - .../exports-field/lib/lib2/main.js | 1 - .../node_modules/exports-field/lib/main.js | 1 - .../node_modules/exports-field/main.js | 1 - .../node_modules/exports-field/package.json | 17 - .../node_modules/exports-field/index | 0 .../node_modules/exports-field/main.js | 1 - .../node_modules/exports-field/package.json | 10 - .../node_modules/exports-field/src/index.js | 0 .../fixtures/extension-alias/dir/index.js | 0 .../fixtures/extension-alias/dir/index.ts | 0 .../fixtures/extension-alias/dir2/index.js | 0 .../fixtures/extension-alias/dir2/index.mts | 0 .../test/fixtures/extension-alias/index.js | 0 .../test/fixtures/extension-alias/index.mjs | 0 .../fixtures/extension-alias/index.mts.js | 0 .../test/fixtures/extension-alias/index.ts | 0 .../test/fixtures/extensions/app.module.js | 0 .../test/fixtures/extensions/dir/index.js | 0 .../test/fixtures/extensions/dir/index.ts | 0 .../test/fixtures/extensions/foo.js | 0 .../test/fixtures/extensions/foo.ts | 0 .../test/fixtures/extensions/index.js | 0 .../test/fixtures/extensions/index.ts | 0 .../extensions/node_modules/module.js | 0 .../extensions/node_modules/module/index.ts | 0 .../test/fixtures/extensions/package.json | 3 - .../enhanced_resolve/test/fixtures/file.load1 | 0 .../enhanced_resolve/test/fixtures/file.load2 | 0 .../test/fixtures/foo/index.js | 0 .../test/fixtures/foo/package.json | 4 - .../node_modules/m/package.json | 17 - .../node_modules/m/src/features/f.js | 0 .../m/src/features/internal/file.js | 0 .../node_modules/m/src/features/y/y.js | 0 .../node_modules/m/src/internal/i.js | 0 .../node_modules/m/src/middle-1/f.js | 0 .../node_modules/m/src/middle-1/nested/f.js | 0 .../node_modules/m/src/middle-2/nested/f.js | 1 - .../m/src/middle-3/nested/f/nested/f.js | 0 .../node_modules/m/src/middle-4/f/f.js | 0 .../node_modules/m/src/middle-5/f$/$.js | 0 .../node_modules/m/src/middle-5/f/$.js | 0 .../node_modules/m/src/middle/f.js | 0 .../node_modules/m/src/middle/nested/f.js | 0 .../test/fixtures/imports-field/a.js | 1 - .../test/fixtures/imports-field/b.js | 0 .../test/fixtures/imports-field/dir/b.js | 0 .../node_modules/a/lib/browser.js | 1 - .../imports-field/node_modules/a/lib/index.js | 0 .../node_modules/a/lib/lib2/main.js | 1 - .../imports-field/node_modules/a/lib/main.js | 1 - .../imports-field/node_modules/a/main.js | 1 - .../imports-field/node_modules/a/package.json | 18 - .../imports-field/node_modules/a/x.js | 1 - .../imports-field/node_modules/c/index.js | 0 .../test/fixtures/imports-field/package.json | 17 - .../fixtures/incorrect-package/pack1/a.js | 0 .../incorrect-package/pack1/package.json | 2 - .../fixtures/incorrect-package/pack2/a.js | 0 .../incorrect-package/pack2/package.json | 0 .../test/fixtures/issue-238/package.json | 3 - .../test/fixtures/issue-238/src/a/config.js | 0 .../src/common/config/myObjectFile.js | 0 .../enhanced_resolve/test/fixtures/lib.js | 0 .../test/fixtures/lib/complex1.js | 1 - .../test/fixtures/main-field-self/index.js | 0 .../fixtures/main-field-self/package.json | 3 - .../test/fixtures/main-field-self2/index.js | 0 .../fixtures/main-field-self2/package.json | 3 - .../enhanced_resolve/test/fixtures/main1.js | 9 - .../enhanced_resolve/test/fixtures/main2.js | 12 - .../enhanced_resolve/test/fixtures/main3.js | 4 - .../multiple_modules/node_modules/m1/a.js | 3 - .../test/fixtures/no#fragment/#/#.js | 0 fixtures/enhanced_resolve/test/fixtures/no.js | 0 .../browser-module-broken/browser.js | 0 .../browser-module-broken/main.js | 0 .../browser-module-broken/package.json | 4 - .../complexm/node_modules/m1/a.js | 1 - .../complexm/node_modules/m1/index.js | 1 - .../fixtures/node_modules/complexm/step1.js | 1 - .../fixtures/node_modules/complexm/step2.js | 1 - .../fixtures/node_modules/dash-name/index.js | 0 .../node_modules/dash-name/package.json | 4 - .../test/fixtures/node_modules/dash/index.js | 0 .../fixtures/node_modules/dash/package.json | 4 - .../invalidPackageJson/package.json | 0 .../test/fixtures/node_modules/m1/a.js | 3 - .../test/fixtures/node_modules/m1/b.js | 3 - .../test/fixtures/node_modules/m2/b.js | 1 - .../node_modules/recursive-module/file.js | 0 .../node_modules/recursive-module/index.js | 0 .../test/fixtures/pnp-a/m2/a.js | 3 - .../test/fixtures/pnp/pkg/dir/index.js | 0 .../test/fixtures/pnp/pkg/index.js | 0 .../test/fixtures/pnp/pkg/main.js | 0 .../fixtures/pnp/pkg/package-alias/browser.js | 0 .../fixtures/pnp/pkg/package-alias/index.js | 0 .../test/fixtures/pnp/pkg/package.json | 7 - .../test/fixtures/pnp/pkg/typescript/index.ts | 0 .../test/fixtures/pnp/pkg3/a.js | 1 - .../test/fixtures/pnp/pkg3/package.json | 8 - .../prefer-pnp/alternative-modules/m1/b.js | 0 .../restrictions/node_modules/pck1/index.css | 0 .../restrictions/node_modules/pck1/index.js | 0 .../node_modules/pck1/package.json | 3 - .../restrictions/node_modules/pck2/index.css | 0 .../restrictions/node_modules/pck2/module.js | 0 .../node_modules/pck2/package.json | 5 - .../test/fixtures/roots_fall_through/index.js | 0 .../scoped/node_modules/@scope/pack1/main.js | 0 .../node_modules/@scope/pack1/package.json | 5 - .../node_modules/@scope/pack2/lib/index.js | 0 .../scoped/node_modules/@scope/pack2/main.js | 0 .../node_modules/@scope/pack2/package.json | 3 - .../test/fixtures/shortcutdir.js/a.js | 0 .../test/fixtures/yield/a/foo-2/b | 0 .../test/fixtures/yield/a/foo-2/c | 0 .../test/fixtures/yield/a/foo/a | 0 .../test/fixtures/yield/a/foo/b | 0 .../test/fixtures/yield/b/foo/a | 0 .../test/fixtures/yield/c/foo/a | 0 .../test/fixtures/yield/c/foo/package.json | 7 - .../fixtures/\346\265\213\350\257\225.js" | 0 .../\344\270\255\346\226\207.js" | 0 fixtures/pnpm/.gitignore | 1 - fixtures/pnpm/package.json | 10 - fixtures/pnpm/pnpm-lock.yaml | 212 -- fixtures/tsconfig/cases/builtins/thing.js | 0 .../tsconfig/cases/builtins/tsconfig.json | 5 - fixtures/tsconfig/cases/exports/index.js | 0 fixtures/tsconfig/cases/exports/tsconfig.json | 3 - .../extends-extension/base-tsconfig.json | 7 - .../tsconfig/cases/extends-extension/foo.js | 0 .../cases/extends-extension/tsconfig.json | 3 - .../cases/extends-extensionless/foo.js | 0 .../cases/extends-extensionless/tsconfig.json | 3 - .../tsconfig/cases/extends-multiple/foo.js | 0 .../cases/extends-multiple/tsconfig.json | 6 - .../tsconfig/cases/extends-not-found/index.js | 0 .../cases/extends-not-found/tsconfig.json | 3 - .../tsconfig/cases/extends-paths/src/index.js | 0 .../cases/extends-paths/tsconfig.base.json | 7 - .../cases/extends-paths/tsconfig.json | 6 - fixtures/tsconfig/cases/field/index.js | 0 fixtures/tsconfig/cases/field/tsconfig.json | 3 - fixtures/tsconfig/cases/index/index.js | 0 fixtures/tsconfig/cases/index/tsconfig.json | 3 - .../cases/paths_template_variable/foo.js | 0 .../paths_template_variable/tsconfig1.json | 3 - .../paths_template_variable/tsconfig2.json | 8 - .../project_references/app/aliased/index.ts | 0 .../cases/project_references/app/index.ts | 0 .../project_references/app/tsconfig.json | 23 - .../project_a/aliased/index.ts | 0 .../project_references/project_a/conf.json | 8 - .../project_references/project_a/index.ts | 0 .../project_b/src/aliased/index.ts | 0 .../project_b/tsconfig.json | 9 - .../project_references/project_c/index.ts | 0 .../project_c/tsconfig.json | 5 - .../project_references/tsconfig.base.json | 4 - fixtures/tsconfig/cases/suffixes/a.ios.ts | 0 fixtures/tsconfig/cases/suffixes/a.ts | 0 fixtures/tsconfig/cases/suffixes/b.ts | 0 fixtures/tsconfig/cases/suffixes/c-test.ts | 0 fixtures/tsconfig/cases/suffixes/index.ts | 1 - .../tsconfig/cases/suffixes/tsconfig.json | 5 - fixtures/tsconfig/cases/trailing-comma/bar.js | 0 .../tsconfig/cases/trailing-comma/index.js | 0 .../cases/trailing-comma/tsconfig.json | 9 - fixtures/tsconfig/foo.js | 0 fixtures/tsconfig/nested/index.js | 0 fixtures/tsconfig/nested/test.js | 0 fixtures/tsconfig/nested/tsconfig.json | 8 - .../node_modules/tsconfig-exports/conf.json | 7 - .../node_modules/tsconfig-exports/foo.js | 0 .../tsconfig-exports/package.json | 7 - .../node_modules/tsconfig-field/conf.json | 7 - .../node_modules/tsconfig-field/foo.js | 0 .../node_modules/tsconfig-field/package.json | 5 - .../node_modules/tsconfig-index/foo.js | 0 .../node_modules/tsconfig-index/package.json | 4 - .../node_modules/tsconfig-index/tsconfig.json | 7 - .../node_modules/tsconfig-not-used/foo.js | 0 .../tsconfig-not-used/tsconfig.json | 7 - fixtures/tsconfig/package.json | 24 - fixtures/tsconfig/tsconfig.json | 7 - .../tsconfig/tsconfig_template_variable.json | 7 - napi/Source/lib.rs | 23 +- napi/__test__/resolver.spec.mjs | 260 -- napi/src/lib.rs | 179 -- napi/src/options.rs | 261 -- napi/tests/options.test.mjs | 59 - npm/package.json | 67 +- package.json | 53 +- pnpm-lock.yaml | 2690 ----------------- src/builtins.rs | 71 - src/cache.rs | 369 --- src/context.rs | 89 - src/error.rs | 160 - src/file_system.rs | 133 - src/lib.rs | 1672 ---------- src/options.rs | 623 ---- src/package_json.rs | 207 -- src/path.rs | 132 - src/resolution.rs | 92 - src/specifier.rs | 230 -- src/tests/alias.rs | 280 -- src/tests/browser_field.rs | 189 -- src/tests/builtins.rs | 121 - src/tests/dependencies.rs | 110 - src/tests/exports_field.rs | 2546 ---------------- src/tests/extension_alias.rs | 66 - src/tests/extensions.rs | 125 - src/tests/fallback.rs | 100 - src/tests/full_specified.rs | 113 - src/tests/imports_field.rs | 1320 -------- src/tests/incorrect_description_file.rs | 62 - src/tests/main_field.rs | 24 - src/tests/memory_fs.rs | 74 - src/tests/missing.rs | 106 - src/tests/mod.rs | 49 - src/tests/resolve.rs | 119 - src/tests/restrictions.rs | 25 - src/tests/roots.rs | 92 - src/tests/scoped_packages.rs | 25 - src/tests/simple.rs | 68 - src/tests/symlink.rs | 121 - src/tests/tsconfig_paths.rs | 507 ---- src/tests/tsconfig_project_references.rs | 101 - src/tsconfig.rs | 223 -- tests/integration_test.rs | 102 - tests/package.json | 3 - tests/resolve_test.rs | 104 - 294 files changed, 84 insertions(+), 15819 deletions(-) delete mode 100644 Cargo.lock delete mode 100644 fixtures/enhanced_resolve/lib/index.js delete mode 100644 fixtures/enhanced_resolve/package.json delete mode 100644 fixtures/enhanced_resolve/test/.gitignore delete mode 100644 fixtures/enhanced_resolve/test/fixtures/#/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/abc.txt delete mode 100644 fixtures/enhanced_resolve/test/fixtures/alias/files/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/browser/module-a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/ignore.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/replaced.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/self.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/toString.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-c.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/c.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/d.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/builtins/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/c.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/complex.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/crypto-js/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/decorated-fs/exists.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/dirOrFile.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/directory-default/directory-default.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/pack1/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/umd.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/index delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/src/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.mts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mjs delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mts.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/app.module.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/foo.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/foo.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/file.load1 delete mode 100644 fixtures/enhanced_resolve/test/fixtures/file.load2 delete mode 100644 fixtures/enhanced_resolve/test/fixtures/foo/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/foo/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/internal/file.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/y/y.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/internal/i.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-3/nested/f/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-4/f/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f$/$.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f/$.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/dir/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/c/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/issue-238/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/issue-238/src/a/config.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/issue-238/src/common/config/myObjectFile.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/lib.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/lib/complex1.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self2/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main1.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main2.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main3.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/no#fragment/#/#.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/no.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/invalidPackageJson/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/file.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/dir/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/typescript/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/prefer-pnp/alternative-modules/m1/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.css delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/index.css delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/module.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/roots_fall_through/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/lib/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/shortcutdir.js/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/b delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/c delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo/a delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo/b delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/b/foo/a delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/c/foo/a delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json delete mode 100644 "fixtures/enhanced_resolve/test/fixtures/\346\265\213\350\257\225.js" delete mode 100644 "fixtures/misc/\344\270\255\346\226\207/\344\270\255\346\226\207.js" delete mode 100644 fixtures/pnpm/.gitignore delete mode 100644 fixtures/pnpm/package.json delete mode 100644 fixtures/pnpm/pnpm-lock.yaml delete mode 100644 fixtures/tsconfig/cases/builtins/thing.js delete mode 100644 fixtures/tsconfig/cases/builtins/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/exports/index.js delete mode 100644 fixtures/tsconfig/cases/exports/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-extension/base-tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-extension/foo.js delete mode 100644 fixtures/tsconfig/cases/extends-extension/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-extensionless/foo.js delete mode 100644 fixtures/tsconfig/cases/extends-extensionless/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-multiple/foo.js delete mode 100644 fixtures/tsconfig/cases/extends-multiple/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-not-found/index.js delete mode 100644 fixtures/tsconfig/cases/extends-not-found/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-paths/src/index.js delete mode 100644 fixtures/tsconfig/cases/extends-paths/tsconfig.base.json delete mode 100644 fixtures/tsconfig/cases/extends-paths/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/field/index.js delete mode 100644 fixtures/tsconfig/cases/field/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/index/index.js delete mode 100644 fixtures/tsconfig/cases/index/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/paths_template_variable/foo.js delete mode 100644 fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json delete mode 100644 fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json delete mode 100644 fixtures/tsconfig/cases/project_references/app/aliased/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/app/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/app/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/project_references/project_a/aliased/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_a/conf.json delete mode 100644 fixtures/tsconfig/cases/project_references/project_a/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_b/src/aliased/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_b/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/project_references/project_c/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_c/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/project_references/tsconfig.base.json delete mode 100644 fixtures/tsconfig/cases/suffixes/a.ios.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/a.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/b.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/c-test.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/index.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/trailing-comma/bar.js delete mode 100644 fixtures/tsconfig/cases/trailing-comma/index.js delete mode 100644 fixtures/tsconfig/cases/trailing-comma/tsconfig.json delete mode 100644 fixtures/tsconfig/foo.js delete mode 100644 fixtures/tsconfig/nested/index.js delete mode 100644 fixtures/tsconfig/nested/test.js delete mode 100644 fixtures/tsconfig/nested/tsconfig.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-exports/conf.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-exports/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-exports/package.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-field/conf.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-field/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-field/package.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-index/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-index/package.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-not-used/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json delete mode 100755 fixtures/tsconfig/package.json delete mode 100644 fixtures/tsconfig/tsconfig.json delete mode 100644 fixtures/tsconfig/tsconfig_template_variable.json delete mode 100644 napi/__test__/resolver.spec.mjs delete mode 100644 napi/src/lib.rs delete mode 100644 napi/src/options.rs delete mode 100644 napi/tests/options.test.mjs delete mode 100644 pnpm-lock.yaml delete mode 100644 src/builtins.rs delete mode 100644 src/cache.rs delete mode 100644 src/context.rs delete mode 100644 src/error.rs delete mode 100644 src/file_system.rs delete mode 100644 src/lib.rs delete mode 100644 src/options.rs delete mode 100644 src/package_json.rs delete mode 100644 src/path.rs delete mode 100644 src/resolution.rs delete mode 100644 src/specifier.rs delete mode 100644 src/tests/alias.rs delete mode 100644 src/tests/browser_field.rs delete mode 100644 src/tests/builtins.rs delete mode 100644 src/tests/dependencies.rs delete mode 100644 src/tests/exports_field.rs delete mode 100644 src/tests/extension_alias.rs delete mode 100644 src/tests/extensions.rs delete mode 100644 src/tests/fallback.rs delete mode 100644 src/tests/full_specified.rs delete mode 100644 src/tests/imports_field.rs delete mode 100644 src/tests/incorrect_description_file.rs delete mode 100644 src/tests/main_field.rs delete mode 100644 src/tests/memory_fs.rs delete mode 100644 src/tests/missing.rs delete mode 100644 src/tests/mod.rs delete mode 100644 src/tests/resolve.rs delete mode 100644 src/tests/restrictions.rs delete mode 100644 src/tests/roots.rs delete mode 100644 src/tests/scoped_packages.rs delete mode 100644 src/tests/simple.rs delete mode 100644 src/tests/symlink.rs delete mode 100644 src/tests/tsconfig_paths.rs delete mode 100644 src/tests/tsconfig_project_references.rs delete mode 100644 src/tsconfig.rs delete mode 100644 tests/integration_test.rs delete mode 100644 tests/package.json delete mode 100644 tests/resolve_test.rs diff --git a/Cargo.lock b/Cargo.lock deleted file mode 100644 index 2a5f4573..00000000 --- a/Cargo.lock +++ /dev/null @@ -1,934 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "addr2line" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678" -dependencies = [ - "gimli", -] - -[[package]] -name = "adler" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" - -[[package]] -name = "aho-corasick" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" -dependencies = [ - "memchr", -] - -[[package]] -name = "anes" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "735d4f398ca57cfa2880225c2bf81c3b9af3be5bb22e44ae70118dad38713e84" - -[[package]] -name = "autocfg" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" - -[[package]] -name = "backtrace" -version = "0.3.73" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cc23269a4f8976d0a4d2e7109211a419fe30e8d88d677cd60b6bc79c5732e0a" -dependencies = [ - "addr2line", - "cc", - "cfg-if", - "libc", - "miniz_oxide", - "object", - "rustc-demangle", -] - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "bitflags" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" - -[[package]] -name = "bpaf" -version = "0.9.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3280efcf6d66bc77c2cf9b67dc8acee47a217d9be67dd590b3230dffe663724d" - -[[package]] -name = "cast" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" - -[[package]] -name = "cc" -version = "1.0.100" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c891175c3fb232128f48de6590095e59198bbeb8620c310be349bfc3afd12c7b" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "ciborium" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42e69ffd6f0917f5c029256a24d0161db17cea3997d185db0d35926308770f0e" -dependencies = [ - "ciborium-io", - "ciborium-ll", - "serde", -] - -[[package]] -name = "ciborium-io" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05afea1e0a06c9be33d539b876f1ce3692f4afea2cb41f740e7743225ed1c757" - -[[package]] -name = "ciborium-ll" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57663b653d948a338bfb3eeba9bb2fd5fcfaecb9e199e87e1eda4d9e8b240fd9" -dependencies = [ - "ciborium-io", - "half", -] - -[[package]] -name = "codspeed" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a104ac948e0188b921eb3fcbdd55dcf62e542df4c7ab7e660623f6288302089" -dependencies = [ - "colored", - "libc", - "serde_json", -] - -[[package]] -name = "colored" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbf2150cce219b664a8a70df7a1f933836724b503f8a413af9365b4dcc4d90b8" -dependencies = [ - "lazy_static", - "windows-sys 0.48.0", -] - -[[package]] -name = "convert_case" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec182b0ca2f35d8fc196cf3404988fd8b8c739a4d270ff118a398feb0cbec1ca" -dependencies = [ - "unicode-segmentation", -] - -[[package]] -name = "criterion2" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7258985df1aa8b33359ee2392cbc3b7802875242cdacdda91a17a602132c24a9" -dependencies = [ - "anes", - "bpaf", - "cast", - "ciborium", - "codspeed", - "colored", - "num-traits", - "oorandom", - "serde", - "serde_json", - "walkdir", -] - -[[package]] -name = "crossbeam-deque" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" -dependencies = [ - "crossbeam-epoch", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.9.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" -dependencies = [ - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" - -[[package]] -name = "crunchy" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" - -[[package]] -name = "ctor" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edb49164822f3ee45b17acd4a208cfc1251410cf0cad9a833234c9890774dd9f" -dependencies = [ - "quote", - "syn", -] - -[[package]] -name = "dashmap" -version = "5.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" -dependencies = [ - "cfg-if", - "hashbrown", - "lock_api", - "once_cell", - "parking_lot_core", -] - -[[package]] -name = "document-features" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef5282ad69563b5fc40319526ba27e0e7363d552a896f0297d54f767717f9b95" -dependencies = [ - "litrs", -] - -[[package]] -name = "dunce" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b" - -[[package]] -name = "either" -version = "1.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dca9240753cf90908d7e4aac30f630662b02aebaa1b58a3cadabdb23385b58b" - -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "filetime" -version = "0.2.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ee447700ac8aa0b2f2bd7bc4462ad686ba06baa6727ac149a2d6277f0d240fd" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall 0.4.1", - "windows-sys 0.52.0", -] - -[[package]] -name = "gimli" -version = "0.29.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" - -[[package]] -name = "half" -version = "2.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dd08c532ae367adf81c312a4580bc67f1d0fe8bc9c460520283f4c0ff277888" -dependencies = [ - "cfg-if", - "crunchy", -] - -[[package]] -name = "hashbrown" -version = "0.14.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" - -[[package]] -name = "hermit-abi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" - -[[package]] -name = "indexmap" -version = "2.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" -dependencies = [ - "equivalent", - "hashbrown", - "serde", -] - -[[package]] -name = "itoa" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" - -[[package]] -name = "json-strip-comments" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3d129799327c8f80861e467c59b825ba24c277dba6ad0d71a141dc98f9e04ee" - -[[package]] -name = "lazy_static" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" - -[[package]] -name = "libc" -version = "0.2.155" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" - -[[package]] -name = "libloading" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c2a198fb6b0eada2a8df47933734e6d35d350665a33a3593d7164fa52c75c19" -dependencies = [ - "cfg-if", - "windows-targets 0.52.5", -] - -[[package]] -name = "litrs" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4ce301924b7887e9d637144fdade93f9dfff9b60981d4ac161db09720d39aa5" - -[[package]] -name = "lock_api" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" -dependencies = [ - "autocfg", - "scopeguard", -] - -[[package]] -name = "memchr" -version = "2.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" - -[[package]] -name = "miniz_oxide" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" -dependencies = [ - "adler", -] - -[[package]] -name = "napi" -version = "2.16.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfc300228808a0e6aea5a58115c82889240bcf8dab16fc25ad675b33e454b368" -dependencies = [ - "bitflags 2.5.0", - "ctor", - "napi-derive", - "napi-sys", - "once_cell", - "serde", - "serde_json", - "tokio", -] - -[[package]] -name = "napi-build" -version = "2.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1c0f5d67ee408a4685b61f5ab7e58605c8ae3f2b4189f0127d804ff13d5560a" - -[[package]] -name = "napi-derive" -version = "2.16.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0e034ddf6155192cf83f267ede763fe6c164dfa9971585436b16173718d94c4" -dependencies = [ - "cfg-if", - "convert_case", - "napi-derive-backend", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "napi-derive-backend" -version = "1.0.67" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bff2c00437f3b3266391eb5e6aa25d0029187daf5caf05b8e3271468fb5ae73e" -dependencies = [ - "convert_case", - "once_cell", - "proc-macro2", - "quote", - "regex", - "semver", - "syn", -] - -[[package]] -name = "napi-sys" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "427802e8ec3a734331fec1035594a210ce1ff4dc5bc1950530920ab717964ea3" -dependencies = [ - "libloading", -] - -[[package]] -name = "normalize-path" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5438dd2b2ff4c6df6e1ce22d825ed2fa93ee2922235cc45186991717f0a892d" - -[[package]] -name = "num-traits" -version = "0.2.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" -dependencies = [ - "autocfg", -] - -[[package]] -name = "num_cpus" -version = "1.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" -dependencies = [ - "hermit-abi", - "libc", -] - -[[package]] -name = "object" -version = "0.36.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "576dfe1fc8f9df304abb159d767a29d0476f7750fbf8aa7ad07816004a207434" -dependencies = [ - "memchr", -] - -[[package]] -name = "once_cell" -version = "1.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" - -[[package]] -name = "oorandom" -version = "11.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575" - -[[package]] -name = "oxc_napi_resolver" -version = "0.0.0" -dependencies = [ - "napi", - "napi-build", - "napi-derive", - "oxc_resolver", - "tokio", -] - -[[package]] -name = "oxc_resolver" -version = "1.8.2" -dependencies = [ - "criterion2", - "dashmap", - "document-features", - "dunce", - "indexmap", - "json-strip-comments", - "normalize-path", - "once_cell", - "rayon", - "rustc-hash", - "serde", - "serde_json", - "thiserror", - "tracing", - "vfs", -] - -[[package]] -name = "parking_lot_core" -version = "0.9.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall 0.5.1", - "smallvec", - "windows-targets 0.52.5", -] - -[[package]] -name = "pin-project-lite" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" - -[[package]] -name = "proc-macro2" -version = "1.0.85" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22244ce15aa966053a896d1accb3a6e68469b97c7f33f284b99f0d576879fc23" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.36" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "rayon" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" -dependencies = [ - "either", - "rayon-core", -] - -[[package]] -name = "rayon-core" -version = "1.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" -dependencies = [ - "crossbeam-deque", - "crossbeam-utils", -] - -[[package]] -name = "redox_syscall" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" -dependencies = [ - "bitflags 1.3.2", -] - -[[package]] -name = "redox_syscall" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "469052894dcb553421e483e4209ee581a45100d31b4018de03e5a7ad86374a7e" -dependencies = [ - "bitflags 2.5.0", -] - -[[package]] -name = "regex" -version = "1.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" -dependencies = [ - "aho-corasick", - "memchr", - "regex-automata", - "regex-syntax", -] - -[[package]] -name = "regex-automata" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", -] - -[[package]] -name = "regex-syntax" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" - -[[package]] -name = "rustc-demangle" -version = "0.1.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" - -[[package]] -name = "rustc-hash" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" - -[[package]] -name = "ryu" -version = "1.0.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" - -[[package]] -name = "same-file" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "scopeguard" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" - -[[package]] -name = "semver" -version = "1.0.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" - -[[package]] -name = "serde" -version = "1.0.203" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7253ab4de971e72fb7be983802300c30b5a7f0c2e56fab8abfc6a214307c0094" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.203" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "serde_json" -version = "1.0.117" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3" -dependencies = [ - "indexmap", - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "smallvec" -version = "1.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" - -[[package]] -name = "syn" -version = "2.0.66" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c42f3f41a2de00b01c0aaad383c5a45241efc8b2d1eda5661812fda5f3cdcff5" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "thiserror" -version = "1.0.61" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.61" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "tokio" -version = "1.38.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba4f4a02a7a80d6f274636f0aa95c7e383b912d41fe721a31f29e29698585a4a" -dependencies = [ - "backtrace", - "num_cpus", - "pin-project-lite", -] - -[[package]] -name = "tracing" -version = "0.1.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" -dependencies = [ - "pin-project-lite", - "tracing-attributes", - "tracing-core", -] - -[[package]] -name = "tracing-attributes" -version = "0.1.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "tracing-core" -version = "0.1.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" -dependencies = [ - "once_cell", -] - -[[package]] -name = "unicode-ident" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" - -[[package]] -name = "unicode-segmentation" -version = "1.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" - -[[package]] -name = "vfs" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "654cd097e182a71dbf899178e6b5662c2157dd0b8afd5975de18008f6fc173d1" -dependencies = [ - "filetime", -] - -[[package]] -name = "walkdir" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" -dependencies = [ - "same-file", - "winapi-util", -] - -[[package]] -name = "winapi-util" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b" -dependencies = [ - "windows-sys 0.52.0", -] - -[[package]] -name = "windows-sys" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" -dependencies = [ - "windows-targets 0.48.5", -] - -[[package]] -name = "windows-sys" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" -dependencies = [ - "windows-targets 0.52.5", -] - -[[package]] -name = "windows-targets" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" -dependencies = [ - "windows_aarch64_gnullvm 0.48.5", - "windows_aarch64_msvc 0.48.5", - "windows_i686_gnu 0.48.5", - "windows_i686_msvc 0.48.5", - "windows_x86_64_gnu 0.48.5", - "windows_x86_64_gnullvm 0.48.5", - "windows_x86_64_msvc 0.48.5", -] - -[[package]] -name = "windows-targets" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" -dependencies = [ - "windows_aarch64_gnullvm 0.52.5", - "windows_aarch64_msvc 0.52.5", - "windows_i686_gnu 0.52.5", - "windows_i686_gnullvm", - "windows_i686_msvc 0.52.5", - "windows_x86_64_gnu 0.52.5", - "windows_x86_64_gnullvm 0.52.5", - "windows_x86_64_msvc 0.52.5", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" - -[[package]] -name = "windows_i686_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" - -[[package]] -name = "windows_i686_gnu" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" - -[[package]] -name = "windows_i686_gnullvm" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" - -[[package]] -name = "windows_i686_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" - -[[package]] -name = "windows_i686_msvc" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" diff --git a/Source/lib.rs b/Source/lib.rs index 8ec2ad8a..40c51359 100644 --- a/Source/lib.rs +++ b/Source/lib.rs @@ -2,6 +2,8 @@ //! //! Node.js [CommonJS][cjs] and [ECMAScript][esm] Module Resolution. //! +//! Released on [crates.io](https://crates.io/crates/oxc_resolver) and [npm](https://www.npmjs.com/package/oxc-resolver). +//! //! A module resolution is the process of finding the file referenced by a module specifier in //! `import "specifier"` or `require("specifier")`. //! @@ -71,7 +73,6 @@ use std::{ use rustc_hash::FxHashSet; use serde_json::Value as JSONValue; -use typescript_tsconfig_json::ExtendsField; pub use crate::{ builtins::NODEJS_BUILTINS, @@ -91,6 +92,7 @@ use crate::{ package_json::JSONMap, path::{PathUtil, SLASH_START}, specifier::Specifier, + tsconfig::ExtendsField, tsconfig::{ProjectReference, TsConfig}, }; diff --git a/Source/specifier.rs b/Source/specifier.rs index 3d35eafc..73ed038c 100644 --- a/Source/specifier.rs +++ b/Source/specifier.rs @@ -13,7 +13,7 @@ impl<'a> Specifier<'a> { self.path.as_ref() } - pub fn parse(specifier: &'a str) -> Result, SpecifierError> { + pub fn parse(specifier: &'a str) -> Result { if specifier.is_empty() { return Err(SpecifierError::Empty(specifier.to_string())); } diff --git a/Source/tsconfig.rs b/Source/tsconfig.rs index aa00f6e4..9ea23c99 100644 --- a/Source/tsconfig.rs +++ b/Source/tsconfig.rs @@ -1,13 +1,24 @@ use std::{ + hash::BuildHasherDefault, path::{Path, PathBuf}, sync::Arc, }; +use indexmap::IndexMap; +use rustc_hash::FxHasher; use serde::Deserialize; -use typescript_tsconfig_json::{CompilerOptionsPathsMap, ExtendsField}; use crate::PathUtil; +pub type CompilerOptionsPathsMap = IndexMap, BuildHasherDefault>; + +#[derive(Debug, Clone, Eq, PartialEq, Deserialize)] +#[serde(untagged)] +pub enum ExtendsField { + Single(String), + Multiple(Vec), +} + #[derive(Debug, Deserialize)] #[serde(rename_all = "camelCase")] pub struct TsConfig { diff --git a/fixtures/enhanced_resolve/lib/index.js b/fixtures/enhanced_resolve/lib/index.js deleted file mode 100644 index 1e872e8f..00000000 --- a/fixtures/enhanced_resolve/lib/index.js +++ /dev/null @@ -1 +0,0 @@ -// mimic enhanced-resolved root directory structure diff --git a/fixtures/enhanced_resolve/package.json b/fixtures/enhanced_resolve/package.json deleted file mode 100644 index d1b845b5..00000000 --- a/fixtures/enhanced_resolve/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "enhanced-resolve", - "main": "lib/index.js" -} diff --git a/fixtures/enhanced_resolve/test/.gitignore b/fixtures/enhanced_resolve/test/.gitignore deleted file mode 100644 index bbbec5f4..00000000 --- a/fixtures/enhanced_resolve/test/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# created by symlink.rs -/temp diff --git a/fixtures/enhanced_resolve/test/fixtures/#/a.js b/fixtures/enhanced_resolve/test/fixtures/#/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/a.js b/fixtures/enhanced_resolve/test/fixtures/a.js deleted file mode 100644 index 896ffc6d..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/abc.txt b/fixtures/enhanced_resolve/test/fixtures/abc.txt deleted file mode 100644 index f2ba8f84..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/abc.txt +++ /dev/null @@ -1 +0,0 @@ -abc \ No newline at end of file diff --git a/fixtures/enhanced_resolve/test/fixtures/alias/files/a.js b/fixtures/enhanced_resolve/test/fixtures/alias/files/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/b.js b/fixtures/enhanced_resolve/test/fixtures/b.js deleted file mode 100644 index 11476340..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/b.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function b() { - return "This is b"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/browser/module-a.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/browser/module-a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/browser.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/ignore.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/ignore.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/replaced.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/replaced.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/self.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/self.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/toString.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/toString.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-a.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-b.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-c.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-c.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/a.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/b.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/c.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/c.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/d.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/d.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json deleted file mode 100644 index c13fe23b..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "browser": { - "a.js": "./a", - "./b.js": "./b", - "c.js": "./d.js", - "./d.js": "./c.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/package.json b/fixtures/enhanced_resolve/test/fixtures/browser-module/package.json deleted file mode 100644 index 19ff7739..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/browser-module/package.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "exports": { - "./lib/index.js": "./lib/index.js" - }, - "browser": { - "./lib/ignore.js": false, - "./lib/replaced.js": "./lib/browser", - "module-a": "./browser/module-a.js", - "module-b": "module-c", - "module-c": "module-c", - "./toString": "./lib/toString.js", - "./lib/main.js": "./lib/main.js", - "./main.js": "./lib/main.js", - "./lib/xyz.js": "./xyz.js", - "./xyz.js": "./lib/xyz.js", - "./lib/non-existent.js": "./lib/non-existent.js", - ".": false, - "./number": 1, - "./foo": "./lib/replaced.js?query" - }, - "innerBrowser1": { - "field": { - "browser": { - "./lib/main1.js": "./lib/main.js" - } - } - }, - "innerBrowser2": { - "browser": { - "./lib/main2.js": "./lib/replaced.js" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/builtins/package.json b/fixtures/enhanced_resolve/test/fixtures/builtins/package.json deleted file mode 100644 index 4a54ea96..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/builtins/package.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "name": "builtins", - "private": true, - "imports": { - "#fs": { - "default": "fs" - }, - "#http": { - "node": "node:http" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/c.js b/fixtures/enhanced_resolve/test/fixtures/c.js deleted file mode 100644 index e3aca8aa..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/c.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = function b() { - require("./a"); - return "This is c"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/complex.js b/fixtures/enhanced_resolve/test/fixtures/complex.js deleted file mode 100644 index 1f62db84..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/complex.js +++ /dev/null @@ -1,13 +0,0 @@ -var 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); diff --git a/fixtures/enhanced_resolve/test/fixtures/crypto-js/index.js b/fixtures/enhanced_resolve/test/fixtures/crypto-js/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json b/fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json deleted file mode 100644 index 1d31aa8b..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "crypto-js", - "main": "index.js", - "browser": { - "crypto": false - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/decorated-fs/exists.js b/fixtures/enhanced_resolve/test/fixtures/decorated-fs/exists.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/dirOrFile.js b/fixtures/enhanced_resolve/test/fixtures/dirOrFile.js deleted file mode 100644 index c3cb885f..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/dirOrFile.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "file"; diff --git a/fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js b/fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js deleted file mode 100644 index 85e01cd4..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "dir"; diff --git a/fixtures/enhanced_resolve/test/fixtures/directory-default/directory-default.js b/fixtures/enhanced_resolve/test/fixtures/directory-default/directory-default.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js deleted file mode 100644 index d1007aae..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js +++ /dev/null @@ -1 +0,0 @@ -export default "string"; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts deleted file mode 100644 index cb0ff5c3..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json deleted file mode 100644 index b523a1e9..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "@org/pkg", - "exports": { - "./*.js": { - "types": "./dist/*.d.ts", - "default": "./dist/*.js" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js deleted file mode 100644 index d1007aae..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js +++ /dev/null @@ -1 +0,0 @@ -export default "string"; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts deleted file mode 100644 index cb0ff5c3..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json deleted file mode 100644 index 8e55fb46..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "@raviqqe/hidash", - "exports": { - "./*.js": { - "types": "./dist/*.d.ts", - "default": "./dist/*.js" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json deleted file mode 100644 index f0edf449..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "exports-field", - "version": "1.0.0", - "exports": { - ".": "./a/../b/../../pack1/index.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/pack1/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/pack1/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/a.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/a.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json deleted file mode 100644 index 6b105c08..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "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/": { - "webpack": ["./lib/lib2/", "./lib/"], - "node": "./lib/", - "default": "./lib/" - }, - "./dist/a.js": "./../../a.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json deleted file mode 100644 index 0012a3de..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "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" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/umd.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/umd.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field/package.json deleted file mode 100644 index 5fa72bb5..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "@exports-field/core", - "version": "1.0.0", - "exports": "./a.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json deleted file mode 100644 index e6f12074..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "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/lib2/", "./lib/"], - "node": "./lib/", - "default": "./lib/" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/index b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/index deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json deleted file mode 100644 index 1a838f49..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "name": "exports-field", - "exportsField": { - "exports": "./main.js" - }, - "ex": "./index", - "broken": { - ".": "./src" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/src/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/src/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.ts b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.mts b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.mts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mjs b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mjs deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mts.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mts.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.ts b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/app.module.js b/fixtures/enhanced_resolve/test/fixtures/extensions/app.module.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.js b/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/foo.js b/fixtures/enhanced_resolve/test/fixtures/extensions/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/foo.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/foo.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/index.js b/fixtures/enhanced_resolve/test/fixtures/extensions/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/index.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module.js b/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module/index.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/package.json b/fixtures/enhanced_resolve/test/fixtures/extensions/package.json deleted file mode 100644 index 5e55a1e8..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/extensions/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "./index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/file.load1 b/fixtures/enhanced_resolve/test/fixtures/file.load1 deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/file.load2 b/fixtures/enhanced_resolve/test/fixtures/file.load2 deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/foo/index.js b/fixtures/enhanced_resolve/test/fixtures/foo/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/foo/package.json b/fixtures/enhanced_resolve/test/fixtures/foo/package.json deleted file mode 100644 index da86787a..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/foo/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "foo", - "version": "1.0.0" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json deleted file mode 100644 index aa2be496..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "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" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/internal/file.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/internal/file.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/y/y.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/y/y.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/internal/i.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/internal/i.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/nested/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js deleted file mode 100644 index e5b70a86..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = { nested: "nested" } diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-3/nested/f/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-3/nested/f/nested/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-4/f/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-4/f/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f$/$.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f$/$.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f/$.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f/$.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/nested/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/a.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/a.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/b.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/dir/b.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/dir/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/index.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json deleted file mode 100644 index 8d8d3a46..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "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/lib2/", "./lib/"], - "node": "./lib/", - "default": "./lib/" - }, - "./dist/a.js": "./../../a.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/c/index.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/c/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/imports-field/package.json deleted file mode 100644 index 248351a9..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "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" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/a.js b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json deleted file mode 100644 index ded7faa2..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json +++ /dev/null @@ -1,2 +0,0 @@ -{ - "main": "./a.js", diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/a.js b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/package.json b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/package.json deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/issue-238/package.json b/fixtures/enhanced_resolve/test/fixtures/issue-238/package.json deleted file mode 100644 index 352055cd..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/issue-238/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "private": true -} diff --git a/fixtures/enhanced_resolve/test/fixtures/issue-238/src/a/config.js b/fixtures/enhanced_resolve/test/fixtures/issue-238/src/a/config.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/issue-238/src/common/config/myObjectFile.js b/fixtures/enhanced_resolve/test/fixtures/issue-238/src/common/config/myObjectFile.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/lib.js b/fixtures/enhanced_resolve/test/fixtures/lib.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/lib/complex1.js b/fixtures/enhanced_resolve/test/fixtures/lib/complex1.js deleted file mode 100644 index b3de3d70..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/lib/complex1.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "lib complex1"; diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self/index.js b/fixtures/enhanced_resolve/test/fixtures/main-field-self/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json b/fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json deleted file mode 100644 index a2b6f341..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "./" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self2/index.js b/fixtures/enhanced_resolve/test/fixtures/main-field-self2/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json b/fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json deleted file mode 100644 index 4fa6f730..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "." -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main1.js b/fixtures/enhanced_resolve/test/fixtures/main1.js deleted file mode 100644 index 168f2a1e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main1.js +++ /dev/null @@ -1,9 +0,0 @@ -var a = require("./a"); -if (x) { - for (var i = 0; i < 100; i++) { - while (true) require("./b"); - do { - i++; - } while (require("m1/a")()); - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main2.js b/fixtures/enhanced_resolve/test/fixtures/main2.js deleted file mode 100644 index 39f062b1..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main2.js +++ /dev/null @@ -1,12 +0,0 @@ -var 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"); - }); - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main3.js b/fixtures/enhanced_resolve/test/fixtures/main3.js deleted file mode 100644 index 1c180166..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main3.js +++ /dev/null @@ -1,4 +0,0 @@ -var a = require("./a"); -require.ensure([], function(require) { - require("./c.js"); -}); diff --git a/fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js b/fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js deleted file mode 100644 index 997c1051..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is nested m1/a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/no#fragment/#/#.js b/fixtures/enhanced_resolve/test/fixtures/no#fragment/#/#.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/no.js b/fixtures/enhanced_resolve/test/fixtures/no.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/browser.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/browser.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/main.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json deleted file mode 100644 index c469e1fd..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "main": "./main.js", - "browser": "./browser.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js deleted file mode 100644 index 549620a5..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "the correct a.js"; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js deleted file mode 100644 index 5db6632e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = " :) " + require("m2/b.js"); diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js deleted file mode 100644 index d308569d..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require("m1/a") + require("m1"); diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js deleted file mode 100644 index cb8127e8..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "Step2"; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json deleted file mode 100644 index 8d6dfa56..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "dash-name", - "exports": "./index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json deleted file mode 100644 index 4fd8706e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "dash", - "exports": "./index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/invalidPackageJson/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/invalidPackageJson/package.json deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js deleted file mode 100644 index 46fc8e6c..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is m1/a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js deleted file mode 100644 index 8565c244..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is m1/b"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js deleted file mode 100644 index 34faaaf5..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "This is m2/b"; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/file.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/file.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js b/fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js deleted file mode 100644 index 997c1051..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is nested m1/a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/dir/index.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/dir/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/index.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/main.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/browser.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/browser.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/index.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json deleted file mode 100644 index e20ceaeb..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "main": "main.js", - "browser": { - "./package-alias/index.js": "./package-alias/browser.js", - "module": "pkg/dir/index" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/typescript/index.ts b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/typescript/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json deleted file mode 100644 index 4a1f838e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "@exports-field/core", - "version": "1.0.0", - "exports": { - ".": "./a.js", - "./x": "./a.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/prefer-pnp/alternative-modules/m1/b.js b/fixtures/enhanced_resolve/test/fixtures/prefer-pnp/alternative-modules/m1/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.css b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.css deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.js b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json deleted file mode 100644 index 14ab704d..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/index.css b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/index.css deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/module.js b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/module.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json deleted file mode 100644 index ee0eb71b..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "main": "../../../c.js", - "module": "module.js", - "style": "index.css" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/roots_fall_through/index.js b/fixtures/enhanced_resolve/test/fixtures/roots_fall_through/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/main.js b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json deleted file mode 100644 index 70a0f20f..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "browser": { - "./index.js": "./main.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/lib/index.js b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/lib/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/main.js b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json deleted file mode 100644 index 2af9e0d1..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "./main.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/shortcutdir.js/a.js b/fixtures/enhanced_resolve/test/fixtures/shortcutdir.js/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/b b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/b deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/c b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/c deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/a b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/a deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/b b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/b deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/b/foo/a b/fixtures/enhanced_resolve/test/fixtures/yield/b/foo/a deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/a b/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/a deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json b/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json deleted file mode 100644 index 0acc4b4c..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "foo", - "version": "1.0.0", - "browser": { - "./a": false - } -} diff --git "a/fixtures/enhanced_resolve/test/fixtures/\346\265\213\350\257\225.js" "b/fixtures/enhanced_resolve/test/fixtures/\346\265\213\350\257\225.js" deleted file mode 100644 index e69de29b..00000000 diff --git "a/fixtures/misc/\344\270\255\346\226\207/\344\270\255\346\226\207.js" "b/fixtures/misc/\344\270\255\346\226\207/\344\270\255\346\226\207.js" deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/pnpm/.gitignore b/fixtures/pnpm/.gitignore deleted file mode 100644 index 3c3629e6..00000000 --- a/fixtures/pnpm/.gitignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/fixtures/pnpm/package.json b/fixtures/pnpm/package.json deleted file mode 100644 index 78712e2b..00000000 --- a/fixtures/pnpm/package.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "name": "pnpm", - "version": "1.0.0", - "private": true, - "devDependencies": { - "axios": "1.6.2", - "styled-components": "6.1.1", - "postcss": "8.4.33" - } -} diff --git a/fixtures/pnpm/pnpm-lock.yaml b/fixtures/pnpm/pnpm-lock.yaml deleted file mode 100644 index e51dfd6a..00000000 --- a/fixtures/pnpm/pnpm-lock.yaml +++ /dev/null @@ -1,212 +0,0 @@ -lockfileVersion: '6.0' - -settings: - autoInstallPeers: true - excludeLinksFromLockfile: false - -devDependencies: - axios: - specifier: 1.6.2 - version: 1.6.2 - postcss: - specifier: 8.4.33 - version: 8.4.33 - styled-components: - specifier: 6.1.1 - version: 6.1.1(react-dom@18.2.0)(react@18.2.0) - -packages: - - /@emotion/is-prop-valid@1.2.1: - resolution: {integrity: sha512-61Mf7Ufx4aDxx1xlDeOm8aFFigGHE4z+0sKCa+IHCeZKiyP9RLD0Mmx7m8b9/Cf37f7NAvQOOJAbQQGVr5uERw==} - dependencies: - '@emotion/memoize': 0.8.1 - dev: true - - /@emotion/memoize@0.8.1: - resolution: {integrity: sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA==} - dev: true - - /@emotion/unitless@0.8.1: - resolution: {integrity: sha512-KOEGMu6dmJZtpadb476IsZBclKvILjopjUii3V+7MnXIQCYh8W3NgNcgwo21n9LXZX6EDIKvqfjYxXebDwxKmQ==} - dev: true - - /@types/stylis@4.2.4: - resolution: {integrity: sha512-36ZrGJ8fgtBr6nwNnuJ9jXIj+bn/pF6UoqmrQT7+Y99+tFFeHHsoR54+194dHdyhPjgbeoNz3Qru0oRt0l6ASQ==} - dev: true - - /asynckit@0.4.0: - resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} - dev: true - - /axios@1.6.2: - resolution: {integrity: sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A==} - dependencies: - follow-redirects: 1.15.3 - form-data: 4.0.0 - proxy-from-env: 1.1.0 - transitivePeerDependencies: - - debug - dev: true - - /camelize@1.0.1: - resolution: {integrity: sha512-dU+Tx2fsypxTgtLoE36npi3UqcjSSMNYfkqgmoEhtZrraP5VWq0K7FkWVTYa8eMPtnU/G2txVsfdCJTn9uzpuQ==} - dev: true - - /combined-stream@1.0.8: - resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} - engines: {node: '>= 0.8'} - dependencies: - delayed-stream: 1.0.0 - dev: true - - /css-color-keywords@1.0.0: - resolution: {integrity: sha512-FyyrDHZKEjXDpNJYvVsV960FiqQyXc/LlYmsxl2BcdMb2WPx0OGRVgTg55rPSyLSNMqP52R9r8geSp7apN3Ofg==} - engines: {node: '>=4'} - dev: true - - /css-to-react-native@3.2.0: - resolution: {integrity: sha512-e8RKaLXMOFii+02mOlqwjbD00KSEKqblnpO9e++1aXS1fPQOpS1YoqdVHBqPjHNoxeF2mimzVqawm2KCbEdtHQ==} - dependencies: - camelize: 1.0.1 - css-color-keywords: 1.0.0 - postcss-value-parser: 4.2.0 - dev: true - - /csstype@3.1.2: - resolution: {integrity: sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==} - dev: true - - /delayed-stream@1.0.0: - resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} - engines: {node: '>=0.4.0'} - dev: true - - /follow-redirects@1.15.3: - resolution: {integrity: sha512-1VzOtuEM8pC9SFU1E+8KfTjZyMztRsgEfwQl44z8A25uy13jSzTj6dyK2Df52iV0vgHCfBwLhDWevLn95w5v6Q==} - engines: {node: '>=4.0'} - peerDependencies: - debug: '*' - peerDependenciesMeta: - debug: - optional: true - dev: true - - /form-data@4.0.0: - resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==} - engines: {node: '>= 6'} - dependencies: - asynckit: 0.4.0 - combined-stream: 1.0.8 - mime-types: 2.1.35 - dev: true - - /js-tokens@4.0.0: - resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} - dev: true - - /loose-envify@1.4.0: - resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==} - hasBin: true - dependencies: - js-tokens: 4.0.0 - dev: true - - /mime-db@1.52.0: - resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} - engines: {node: '>= 0.6'} - dev: true - - /mime-types@2.1.35: - resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} - engines: {node: '>= 0.6'} - dependencies: - mime-db: 1.52.0 - dev: true - - /nanoid@3.3.7: - resolution: {integrity: sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==} - engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} - hasBin: true - dev: true - - /picocolors@1.0.0: - resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==} - dev: true - - /postcss-value-parser@4.2.0: - resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==} - dev: true - - /postcss@8.4.33: - resolution: {integrity: sha512-Kkpbhhdjw2qQs2O2DGX+8m5OVqEcbB9HRBvuYM9pgrjEFUg30A9LmXNlTAUj4S9kgtGyrMbTzVjH7E+s5Re2yg==} - engines: {node: ^10 || ^12 || >=14} - dependencies: - nanoid: 3.3.7 - picocolors: 1.0.0 - source-map-js: 1.0.2 - dev: true - - /proxy-from-env@1.1.0: - resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==} - dev: true - - /react-dom@18.2.0(react@18.2.0): - resolution: {integrity: sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==} - peerDependencies: - react: ^18.2.0 - dependencies: - loose-envify: 1.4.0 - react: 18.2.0 - scheduler: 0.23.0 - dev: true - - /react@18.2.0: - resolution: {integrity: sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==} - engines: {node: '>=0.10.0'} - dependencies: - loose-envify: 1.4.0 - dev: true - - /scheduler@0.23.0: - resolution: {integrity: sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw==} - dependencies: - loose-envify: 1.4.0 - dev: true - - /shallowequal@1.1.0: - resolution: {integrity: sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ==} - dev: true - - /source-map-js@1.0.2: - resolution: {integrity: sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==} - engines: {node: '>=0.10.0'} - dev: true - - /styled-components@6.1.1(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-cpZZP5RrKRIClBW5Eby4JM1wElLVP4NQrJbJ0h10TidTyJf4SIIwa3zLXOoPb4gJi8MsJ8mjq5mu2IrEhZIAcQ==} - engines: {node: '>= 16'} - peerDependencies: - react: '>= 16.8.0' - react-dom: '>= 16.8.0' - dependencies: - '@emotion/is-prop-valid': 1.2.1 - '@emotion/unitless': 0.8.1 - '@types/stylis': 4.2.4 - css-to-react-native: 3.2.0 - csstype: 3.1.2 - postcss: 8.4.33 - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - shallowequal: 1.1.0 - stylis: 4.3.0 - tslib: 2.6.2 - dev: true - - /stylis@4.3.0: - resolution: {integrity: sha512-E87pIogpwUsUwXw7dNyU4QDjdgVMy52m+XEOPEKUn161cCzWjjhPSQhByfd1CcNvrOLnXQ6OnnZDwnJrz/Z4YQ==} - dev: true - - /tslib@2.6.2: - resolution: {integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==} - dev: true diff --git a/fixtures/tsconfig/cases/builtins/thing.js b/fixtures/tsconfig/cases/builtins/thing.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/builtins/tsconfig.json b/fixtures/tsconfig/cases/builtins/tsconfig.json deleted file mode 100644 index 36aa1a4d..00000000 --- a/fixtures/tsconfig/cases/builtins/tsconfig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compilerOptions": { - "baseUrl": "." - } -} diff --git a/fixtures/tsconfig/cases/exports/index.js b/fixtures/tsconfig/cases/exports/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/exports/tsconfig.json b/fixtures/tsconfig/cases/exports/tsconfig.json deleted file mode 100644 index f0e3159b..00000000 --- a/fixtures/tsconfig/cases/exports/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-exports" -} diff --git a/fixtures/tsconfig/cases/extends-extension/base-tsconfig.json b/fixtures/tsconfig/cases/extends-extension/base-tsconfig.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/cases/extends-extension/base-tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/cases/extends-extension/foo.js b/fixtures/tsconfig/cases/extends-extension/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-extension/tsconfig.json b/fixtures/tsconfig/cases/extends-extension/tsconfig.json deleted file mode 100644 index 0ae4c6a3..00000000 --- a/fixtures/tsconfig/cases/extends-extension/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./base-tsconfig" -} diff --git a/fixtures/tsconfig/cases/extends-extensionless/foo.js b/fixtures/tsconfig/cases/extends-extensionless/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-extensionless/tsconfig.json b/fixtures/tsconfig/cases/extends-extensionless/tsconfig.json deleted file mode 100644 index c36cb7d4..00000000 --- a/fixtures/tsconfig/cases/extends-extensionless/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-field/conf" -} diff --git a/fixtures/tsconfig/cases/extends-multiple/foo.js b/fixtures/tsconfig/cases/extends-multiple/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-multiple/tsconfig.json b/fixtures/tsconfig/cases/extends-multiple/tsconfig.json deleted file mode 100644 index aa2ae783..00000000 --- a/fixtures/tsconfig/cases/extends-multiple/tsconfig.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": ["../extends-extension", "../extends-paths"], - "compilerOptions": { - "baseUrl": ".", - }, -} diff --git a/fixtures/tsconfig/cases/extends-not-found/index.js b/fixtures/tsconfig/cases/extends-not-found/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-not-found/tsconfig.json b/fixtures/tsconfig/cases/extends-not-found/tsconfig.json deleted file mode 100644 index 99df91da..00000000 --- a/fixtures/tsconfig/cases/extends-not-found/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./not-found" -} diff --git a/fixtures/tsconfig/cases/extends-paths/src/index.js b/fixtures/tsconfig/cases/extends-paths/src/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-paths/tsconfig.base.json b/fixtures/tsconfig/cases/extends-paths/tsconfig.base.json deleted file mode 100644 index 5c64b067..00000000 --- a/fixtures/tsconfig/cases/extends-paths/tsconfig.base.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "@/*": ["./*"] - } - } -} diff --git a/fixtures/tsconfig/cases/extends-paths/tsconfig.json b/fixtures/tsconfig/cases/extends-paths/tsconfig.json deleted file mode 100644 index 51086018..00000000 --- a/fixtures/tsconfig/cases/extends-paths/tsconfig.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": "./tsconfig.base.json", - "compilerOptions": { - "baseUrl": "src", - }, -} diff --git a/fixtures/tsconfig/cases/field/index.js b/fixtures/tsconfig/cases/field/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/field/tsconfig.json b/fixtures/tsconfig/cases/field/tsconfig.json deleted file mode 100644 index 9f86c3f4..00000000 --- a/fixtures/tsconfig/cases/field/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-field" -} diff --git a/fixtures/tsconfig/cases/index/index.js b/fixtures/tsconfig/cases/index/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/index/tsconfig.json b/fixtures/tsconfig/cases/index/tsconfig.json deleted file mode 100644 index d20b1774..00000000 --- a/fixtures/tsconfig/cases/index/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-index" -} diff --git a/fixtures/tsconfig/cases/paths_template_variable/foo.js b/fixtures/tsconfig/cases/paths_template_variable/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json b/fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json deleted file mode 100644 index a1a37bb6..00000000 --- a/fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "../../tsconfig_template_variable.json" -} diff --git a/fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json b/fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json deleted file mode 100644 index e7d8e5e5..00000000 --- a/fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "compilerOptions": { - "composite": true, - "paths": { - "foo": ["${configDir}/foo.js"] - } - } -} diff --git a/fixtures/tsconfig/cases/project_references/app/aliased/index.ts b/fixtures/tsconfig/cases/project_references/app/aliased/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/app/index.ts b/fixtures/tsconfig/cases/project_references/app/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/app/tsconfig.json b/fixtures/tsconfig/cases/project_references/app/tsconfig.json deleted file mode 100644 index 7036d2bb..00000000 --- a/fixtures/tsconfig/cases/project_references/app/tsconfig.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "extends": "../tsconfig.base.json", - "compilerOptions": { - "baseUrl": "./", - "paths": { - "@/*": ["./aliased/*"] - } - }, - "references": [ - { - "path": "../project_a/conf.json" - }, - { - "path": "../project_b" - }, - { - "path": "../project_c/tsconfig.json" - }, - { - "path": "../../paths_template_variable/tsconfig2.json" - } - ] -} diff --git a/fixtures/tsconfig/cases/project_references/project_a/aliased/index.ts b/fixtures/tsconfig/cases/project_references/project_a/aliased/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_a/conf.json b/fixtures/tsconfig/cases/project_references/project_a/conf.json deleted file mode 100644 index 4d389d7a..00000000 --- a/fixtures/tsconfig/cases/project_references/project_a/conf.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "compilerOptions": { - "composite": true, - "paths": { - "@/*": ["./aliased/*"] - } - } -} diff --git a/fixtures/tsconfig/cases/project_references/project_a/index.ts b/fixtures/tsconfig/cases/project_references/project_a/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_b/src/aliased/index.ts b/fixtures/tsconfig/cases/project_references/project_b/src/aliased/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_b/tsconfig.json b/fixtures/tsconfig/cases/project_references/project_b/tsconfig.json deleted file mode 100644 index 4ab05cd8..00000000 --- a/fixtures/tsconfig/cases/project_references/project_b/tsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "compilerOptions": { - "composite": true, - "baseUrl": "./src", - "paths": { - "@/*": ["./aliased/*"] - } - } -} diff --git a/fixtures/tsconfig/cases/project_references/project_c/index.ts b/fixtures/tsconfig/cases/project_references/project_c/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_c/tsconfig.json b/fixtures/tsconfig/cases/project_references/project_c/tsconfig.json deleted file mode 100644 index fe520939..00000000 --- a/fixtures/tsconfig/cases/project_references/project_c/tsconfig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compilerOptions": { - "composite": true - } -} diff --git a/fixtures/tsconfig/cases/project_references/tsconfig.base.json b/fixtures/tsconfig/cases/project_references/tsconfig.base.json deleted file mode 100644 index 88ccffe7..00000000 --- a/fixtures/tsconfig/cases/project_references/tsconfig.base.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "compilerOptions": { - } -} diff --git a/fixtures/tsconfig/cases/suffixes/a.ios.ts b/fixtures/tsconfig/cases/suffixes/a.ios.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/a.ts b/fixtures/tsconfig/cases/suffixes/a.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/b.ts b/fixtures/tsconfig/cases/suffixes/b.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/c-test.ts b/fixtures/tsconfig/cases/suffixes/c-test.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/index.ts b/fixtures/tsconfig/cases/suffixes/index.ts deleted file mode 100644 index b09939b9..00000000 --- a/fixtures/tsconfig/cases/suffixes/index.ts +++ /dev/null @@ -1 +0,0 @@ -import './a'; diff --git a/fixtures/tsconfig/cases/suffixes/tsconfig.json b/fixtures/tsconfig/cases/suffixes/tsconfig.json deleted file mode 100644 index 4c2ccc8f..00000000 --- a/fixtures/tsconfig/cases/suffixes/tsconfig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compilerOptions": { - "moduleSuffixes": [".ios", "-test", ""] - } -} diff --git a/fixtures/tsconfig/cases/trailing-comma/bar.js b/fixtures/tsconfig/cases/trailing-comma/bar.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/trailing-comma/index.js b/fixtures/tsconfig/cases/trailing-comma/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/trailing-comma/tsconfig.json b/fixtures/tsconfig/cases/trailing-comma/tsconfig.json deleted file mode 100644 index 6dc20ca5..00000000 --- a/fixtures/tsconfig/cases/trailing-comma/tsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "compilerOptions": { - "paths": { - /* some comment */ - "foo": ["bar.js"], - }, - }, - // another comment -} diff --git a/fixtures/tsconfig/foo.js b/fixtures/tsconfig/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/nested/index.js b/fixtures/tsconfig/nested/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/nested/test.js b/fixtures/tsconfig/nested/test.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/nested/tsconfig.json b/fixtures/tsconfig/nested/tsconfig.json deleted file mode 100644 index 6deb3011..00000000 --- a/fixtures/tsconfig/nested/tsconfig.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "extends": "..", - "compilerOptions": { - "paths": { - "ts-path": ["test.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-exports/conf.json b/fixtures/tsconfig/node_modules/tsconfig-exports/conf.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-exports/conf.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-exports/foo.js b/fixtures/tsconfig/node_modules/tsconfig-exports/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-exports/package.json b/fixtures/tsconfig/node_modules/tsconfig-exports/package.json deleted file mode 100644 index be0ddee6..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-exports/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "tsconfig-exports", - "private": true, - "exports": { - ".": "./conf.json" - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-field/conf.json b/fixtures/tsconfig/node_modules/tsconfig-field/conf.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-field/conf.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-field/foo.js b/fixtures/tsconfig/node_modules/tsconfig-field/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-field/package.json b/fixtures/tsconfig/node_modules/tsconfig-field/package.json deleted file mode 100644 index 7138fdde..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-field/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "tsconfig-field", - "private": true, - "tsconfig": "conf.json" -} \ No newline at end of file diff --git a/fixtures/tsconfig/node_modules/tsconfig-index/foo.js b/fixtures/tsconfig/node_modules/tsconfig-index/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-index/package.json b/fixtures/tsconfig/node_modules/tsconfig-index/package.json deleted file mode 100644 index eb2431e7..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-index/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "tsconfig-index", - "private": true -} \ No newline at end of file diff --git a/fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json b/fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-not-used/foo.js b/fixtures/tsconfig/node_modules/tsconfig-not-used/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json b/fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json deleted file mode 100644 index eb16d127..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "ts-path": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/package.json b/fixtures/tsconfig/package.json deleted file mode 100755 index f48acd1c..00000000 --- a/fixtures/tsconfig/package.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "name": "resolver", - "private": true, - "alias": { - "aliased": "foo", - "aliased-file": "./bar.js", - "something": "./nested/test.js", - "aliasedfolder": "./nested", - "aliasedabsolute": "/nested", - "foo/bar": "./bar.js", - "glob/*/*": "./nested/$2", - "./baz": "./bar.js", - "url": false - }, - "imports": { - "#test": "./bar.js" - }, - "dependencies": { - "foo": "^0.3.4" - }, - "peerDependencies": { - "bar": "*" - } -} diff --git a/fixtures/tsconfig/tsconfig.json b/fixtures/tsconfig/tsconfig.json deleted file mode 100644 index eb16d127..00000000 --- a/fixtures/tsconfig/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "ts-path": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/tsconfig_template_variable.json b/fixtures/tsconfig/tsconfig_template_variable.json deleted file mode 100644 index 6f272344..00000000 --- a/fixtures/tsconfig/tsconfig_template_variable.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["${configDir}/foo.js"] - } - } -} diff --git a/napi/Source/lib.rs b/napi/Source/lib.rs index 238f99c4..96287041 100644 --- a/napi/Source/lib.rs +++ b/napi/Source/lib.rs @@ -2,7 +2,10 @@ extern crate napi; extern crate napi_derive; extern crate oxc_resolver; -use std::path::{Path, PathBuf}; +use std::{ + path::{Path, PathBuf}, + sync::Arc, +}; use napi_derive::napi; use oxc_resolver::{ResolveOptions, Resolver}; @@ -37,26 +40,28 @@ pub fn sync(path: String, request: String) -> ResolveResult { #[napi] pub struct ResolverFactory { - resolver: Resolver, + resolver: Arc, } #[napi] impl ResolverFactory { #[napi(constructor)] pub fn new(options: NapiResolveOptions) -> Self { - Self { resolver: Resolver::new(Self::normalize_options(options)) } + Self { resolver: Arc::new(Resolver::new(Self::normalize_options(options))) } } #[napi] pub fn default() -> Self { let default_options = ResolveOptions::default(); - Self { resolver: Resolver::new(default_options) } + Self { resolver: Arc::new(Resolver::new(default_options)) } } /// Clone the resolver using the same underlying cache. #[napi] pub fn clone_with_options(&self, options: NapiResolveOptions) -> Self { - Self { resolver: self.resolver.clone_with_options(Self::normalize_options(options)) } + Self { + resolver: Arc::new(self.resolver.clone_with_options(Self::normalize_options(options))), + } } /// Clear the underlying cache. @@ -72,6 +77,14 @@ impl ResolverFactory { resolve(&self.resolver, &path, &request) } + #[allow(clippy::needless_pass_by_value)] + #[napi(js_name = "async")] + pub async fn resolve_async(&self, path: String, request: String) -> ResolveResult { + let path = PathBuf::from(path); + let resolver = self.resolver.clone(); + tokio::spawn(async move { resolve(&resolver, &path, &request) }).await.unwrap() + } + fn normalize_options(op: NapiResolveOptions) -> ResolveOptions { let default = ResolveOptions::default(); // merging options diff --git a/napi/__test__/resolver.spec.mjs b/napi/__test__/resolver.spec.mjs deleted file mode 100644 index ac6ee0ef..00000000 --- a/napi/__test__/resolver.spec.mjs +++ /dev/null @@ -1,260 +0,0 @@ -import { join } from 'node:path' -import { fileURLToPath } from 'node:url' - -import test from 'ava' - -let ResolverFactory - -if (process.env.WASI_TEST) { - const wasi = await import('../resolver.wasi.cjs') - ResolverFactory = wasi.ResolverFactory -} else { - const napi = await import('../index.js') - ResolverFactory = napi.ResolverFactory -} - -const currentDir = join(fileURLToPath(import.meta.url), '..') - -const enhancedResolveRoot = join( - currentDir, - '..', - '..', - 'fixtures', - 'enhanced_resolve', - 'test', - 'fixtures' -) - -// https://github.com/webpack/enhanced-resolve/blob/main/test/resolve.test.js - -for (const [title, context, request, expected] of [ - [ - 'absolute path', - enhancedResolveRoot, - join(enhancedResolveRoot, 'main1.js'), - join(enhancedResolveRoot, 'main1.js'), - ], - [ - 'file with .js', - enhancedResolveRoot, - './main1.js', - join(enhancedResolveRoot, 'main1.js'), - ], - [ - 'file without extension', - enhancedResolveRoot, - './main1', - join(enhancedResolveRoot, 'main1.js'), - ], - [ - 'another file with .js', - enhancedResolveRoot, - './a.js', - join(enhancedResolveRoot, 'a.js'), - ], - [ - 'another file without extension', - enhancedResolveRoot, - './a', - join(enhancedResolveRoot, 'a.js'), - ], - [ - 'file in module with .js', - enhancedResolveRoot, - 'm1/a.js', - join(enhancedResolveRoot, 'node_modules/m1/a.js'), - ], - [ - 'file in module without extension', - enhancedResolveRoot, - 'm1/a', - join(enhancedResolveRoot, 'node_modules/m1/a.js'), - ], - [ - 'another file in module without extension', - enhancedResolveRoot, - 'complexm/step1', - join(enhancedResolveRoot, 'node_modules/complexm/step1.js'), - ], - [ - 'from submodule to file in sibling module', - join(enhancedResolveRoot, 'node_modules/complexm'), - 'm2/b.js', - join(enhancedResolveRoot, 'node_modules/m2/b.js'), - ], - [ - 'from nested directory to overwritten file in module', - join(enhancedResolveRoot, 'multiple_modules'), - 'm1/a.js', - join(enhancedResolveRoot, 'multiple_modules/node_modules/m1/a.js'), - ], - [ - 'from nested directory to not overwritten file in module', - join(enhancedResolveRoot, 'multiple_modules'), - 'm1/b.js', - join(enhancedResolveRoot, 'node_modules/m1/b.js'), - ], - [ - 'file with query', - enhancedResolveRoot, - './main1.js?query', - join(enhancedResolveRoot, 'main1.js?query'), - ], - [ - 'file with fragment', - enhancedResolveRoot, - './main1.js#fragment', - join(enhancedResolveRoot, 'main1.js#fragment'), - ], - [ - 'file with fragment and query', - enhancedResolveRoot, - './main1.js#fragment?query', - join(enhancedResolveRoot, 'main1.js#fragment?query'), - ], - [ - 'file with query and fragment', - enhancedResolveRoot, - './main1.js?#fragment', - join(enhancedResolveRoot, 'main1.js?#fragment'), - ], - - [ - 'file with query (unicode)', - enhancedResolveRoot, - './测试.js?query', - join(enhancedResolveRoot, '测试.js?query'), - ], - [ - 'file with fragment (unicode)', - enhancedResolveRoot, - './测试.js#fragment', - join(enhancedResolveRoot, '测试.js#fragment'), - ], - [ - 'file with fragment and query (unicode)', - enhancedResolveRoot, - './测试.js#fragment?query', - join(enhancedResolveRoot, '测试.js#fragment?query'), - ], - [ - 'file with query and fragment (unicode)', - enhancedResolveRoot, - './测试.js?#fragment', - join(enhancedResolveRoot, '测试.js?#fragment'), - ], - - [ - 'file in module with query', - enhancedResolveRoot, - 'm1/a?query', - join(enhancedResolveRoot, 'node_modules/m1/a.js?query'), - ], - [ - 'file in module with fragment', - enhancedResolveRoot, - 'm1/a#fragment', - join(enhancedResolveRoot, 'node_modules/m1/a.js#fragment'), - ], - [ - 'file in module with fragment and query', - enhancedResolveRoot, - 'm1/a#fragment?query', - join(enhancedResolveRoot, 'node_modules/m1/a.js#fragment?query'), - ], - [ - 'file in module with query and fragment', - enhancedResolveRoot, - 'm1/a?#fragment', - join(enhancedResolveRoot, 'node_modules/m1/a.js?#fragment'), - ], - [ - 'differ between directory and file, resolve file', - enhancedResolveRoot, - './dirOrFile', - join(enhancedResolveRoot, 'dirOrFile.js'), - ], - [ - 'differ between directory and file, resolve directory', - enhancedResolveRoot, - './dirOrFile/', - join(enhancedResolveRoot, 'dirOrFile/index.js'), - ], - [ - 'find node_modules outside of node_modules', - join(enhancedResolveRoot, 'browser-module/node_modules'), - 'm1/a', - join(enhancedResolveRoot, 'node_modules/m1/a.js'), - ], - [ - "don't crash on main field pointing to self", - enhancedResolveRoot, - './main-field-self', - join(enhancedResolveRoot, './main-field-self/index.js'), - ], - [ - "don't crash on main field pointing to self (2)", - enhancedResolveRoot, - './main-field-self2', - join(enhancedResolveRoot, './main-field-self2/index.js'), - ], - // enhanced-resolve has `#` prepended with a `\0`, they are removed from the - // following 3 expected test results. - // See https://github.com/webpack/enhanced-resolve#escaping - [ - 'handle fragment edge case (no fragment)', - enhancedResolveRoot, - './no#fragment/#/#', - join(enhancedResolveRoot, 'no#fragment', '#', '#.js'), - ], - [ - 'handle fragment edge case (fragment)', - enhancedResolveRoot, - './no#fragment/#/', - join(enhancedResolveRoot, 'no.js#fragment') + '/#/', - ], - [ - 'handle fragment escaping', - enhancedResolveRoot, - './no\0#fragment/\0#/\0##fragment', - join(enhancedResolveRoot, 'no#fragment', '#', '#.js#fragment'), - ], -]) { - test(title, (t) => { - const resolver = new ResolverFactory({ - modules: ['src/a', 'src/b', 'src/common', 'node_modules'], - extensions: ['.js', '.jsx', '.ts', '.tsx'], - }) - - t.is(resolver.sync(context, request).path, expected) - }) -} - -test('resolve pnpm package', (t) => { - const rootDir = join(currentDir, '..', '..'); - const pnpmProjectPath = join(rootDir, 'fixtures', 'pnpm') - const resolver = new ResolverFactory({ - aliasFields: ['browser'], - }) - t.deepEqual(resolver.sync(pnpmProjectPath, 'styled-components'), { - path: join( - rootDir, - 'node_modules/.pnpm/styled-components@6.1.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/styled-components/dist/styled-components.browser.cjs.js' - ), - }) - t.deepEqual( - resolver.sync( - join( - rootDir, - 'node_modules/.pnpm/styled-components@6.1.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/styled-components' - ), - 'react' - ), - { - path: join( - rootDir, - 'node_modules/.pnpm/react@18.3.1/node_modules/react/index.js' - ), - } - ) -}) diff --git a/napi/src/lib.rs b/napi/src/lib.rs deleted file mode 100644 index 96287041..00000000 --- a/napi/src/lib.rs +++ /dev/null @@ -1,179 +0,0 @@ -extern crate napi; -extern crate napi_derive; -extern crate oxc_resolver; - -use std::{ - path::{Path, PathBuf}, - sync::Arc, -}; - -use napi_derive::napi; -use oxc_resolver::{ResolveOptions, Resolver}; - -use self::options::{NapiResolveOptions, StrOrStrList}; - -mod options; - -#[napi(object)] -pub struct ResolveResult { - pub path: Option, - pub error: Option, -} - -fn resolve(resolver: &Resolver, path: &Path, request: &str) -> ResolveResult { - match resolver.resolve(path, request) { - Ok(resolution) => ResolveResult { - path: Some(resolution.full_path().to_string_lossy().to_string()), - error: None, - }, - Err(err) => ResolveResult { path: None, error: Some(err.to_string()) }, - } -} - -#[allow(clippy::needless_pass_by_value)] -#[napi] -pub fn sync(path: String, request: String) -> ResolveResult { - let path = PathBuf::from(path); - let resolver = Resolver::new(ResolveOptions::default()); - resolve(&resolver, &path, &request) -} - -#[napi] -pub struct ResolverFactory { - resolver: Arc, -} - -#[napi] -impl ResolverFactory { - #[napi(constructor)] - pub fn new(options: NapiResolveOptions) -> Self { - Self { resolver: Arc::new(Resolver::new(Self::normalize_options(options))) } - } - - #[napi] - pub fn default() -> Self { - let default_options = ResolveOptions::default(); - Self { resolver: Arc::new(Resolver::new(default_options)) } - } - - /// Clone the resolver using the same underlying cache. - #[napi] - pub fn clone_with_options(&self, options: NapiResolveOptions) -> Self { - Self { - resolver: Arc::new(self.resolver.clone_with_options(Self::normalize_options(options))), - } - } - - /// Clear the underlying cache. - #[napi] - pub fn clear_cache(&self) { - self.resolver.clear_cache(); - } - - #[allow(clippy::needless_pass_by_value)] - #[napi] - pub fn sync(&self, path: String, request: String) -> ResolveResult { - let path = PathBuf::from(path); - resolve(&self.resolver, &path, &request) - } - - #[allow(clippy::needless_pass_by_value)] - #[napi(js_name = "async")] - pub async fn resolve_async(&self, path: String, request: String) -> ResolveResult { - let path = PathBuf::from(path); - let resolver = self.resolver.clone(); - tokio::spawn(async move { resolve(&resolver, &path, &request) }).await.unwrap() - } - - fn normalize_options(op: NapiResolveOptions) -> ResolveOptions { - let default = ResolveOptions::default(); - // merging options - ResolveOptions { - tsconfig: op.tsconfig.map(|tsconfig| tsconfig.into()), - alias: op - .alias - .map(|alias| { - alias - .into_iter() - .map(|(k, v)| { - let v = v - .into_iter() - .map(|item| match item { - Some(path) => oxc_resolver::AliasValue::from(path), - None => oxc_resolver::AliasValue::Ignore, - }) - .collect(); - (k, v) - }) - .collect::>() - }) - .unwrap_or(default.alias), - alias_fields: op - .alias_fields - .map(|o| o.into_iter().map(|x| StrOrStrList(x).into()).collect::>()) - .unwrap_or(default.alias_fields), - condition_names: op.condition_names.unwrap_or(default.condition_names), - description_files: op.description_files.unwrap_or(default.description_files), - enforce_extension: op - .enforce_extension - .map(|enforce_extension| enforce_extension.into()) - .unwrap_or(default.enforce_extension), - exports_fields: op - .exports_fields - .map(|o| o.into_iter().map(|x| StrOrStrList(x).into()).collect::>()) - .unwrap_or(default.exports_fields), - imports_fields: op - .imports_fields - .map(|o| o.into_iter().map(|x| StrOrStrList(x).into()).collect::>()) - .unwrap_or(default.imports_fields), - extension_alias: op - .extension_alias - .map(|extension_alias| extension_alias.into_iter().collect::>()) - .unwrap_or(default.extension_alias), - extensions: op.extensions.unwrap_or(default.extensions), - fallback: op - .fallback - .map(|fallback| { - fallback - .into_iter() - .map(|(k, v)| { - let v = v - .into_iter() - .map(|item| match item { - Some(path) => oxc_resolver::AliasValue::from(path), - None => oxc_resolver::AliasValue::Ignore, - }) - .collect(); - (k, v) - }) - .collect::>() - }) - .unwrap_or(default.fallback), - fully_specified: op.fully_specified.unwrap_or(default.fully_specified), - main_fields: op - .main_fields - .map(|o| StrOrStrList(o).into()) - .unwrap_or(default.main_fields), - main_files: op.main_files.unwrap_or(default.main_files), - modules: op.modules.map(|o| StrOrStrList(o).into()).unwrap_or(default.modules), - resolve_to_context: op.resolve_to_context.unwrap_or(default.resolve_to_context), - prefer_relative: op.prefer_relative.unwrap_or(default.prefer_relative), - prefer_absolute: op.prefer_absolute.unwrap_or(default.prefer_absolute), - restrictions: op - .restrictions - .map(|restrictions| { - restrictions - .into_iter() - .map(|restriction| restriction.into()) - .collect::>() - }) - .unwrap_or(default.restrictions), - roots: op - .roots - .map(|roots| roots.into_iter().map(PathBuf::from).collect::>()) - .unwrap_or(default.roots), - symlinks: op.symlinks.unwrap_or(default.symlinks), - builtin_modules: op.builtin_modules.unwrap_or(default.builtin_modules), - } - } -} diff --git a/napi/src/options.rs b/napi/src/options.rs deleted file mode 100644 index ea35672f..00000000 --- a/napi/src/options.rs +++ /dev/null @@ -1,261 +0,0 @@ -use std::path::PathBuf; - -use napi::Either; -use napi_derive::napi; -use std::collections::HashMap; - -/// Module Resolution Options -/// -/// Options are directly ported from [enhanced-resolve](https://github.com/webpack/enhanced-resolve#resolver-options). -/// -/// See [webpack resolve](https://webpack.js.org/configuration/resolve/) for information and examples -#[derive(Debug, Clone)] -#[napi(object)] -pub struct NapiResolveOptions { - /// Path to TypeScript configuration file. - /// - /// Default `None` - pub tsconfig: Option, - - /// Alias for [ResolveOptions::alias] and [ResolveOptions::fallback]. - /// - /// For the second value of the tuple, `None -> AliasValue::Ignore`, Some(String) -> - /// AliasValue::Path(String)` - /// Create aliases to import or require certain modules more easily. - /// A trailing $ can also be added to the given object's keys to signify an exact match. - pub alias: Option>>>, - - /// A list of alias fields in description files. - /// Specify a field, such as `browser`, to be parsed according to [this specification](https://github.com/defunctzombie/package-browser-field-spec). - /// Can be a path to json object such as `["path", "to", "exports"]`. - /// - /// Default `[]` - #[napi(ts_type = "(string | string[])[]")] - pub alias_fields: Option>, - - /// Condition names for exports field which defines entry points of a package. - /// The key order in the exports field is significant. During condition matching, earlier entries have higher priority and take precedence over later entries. - /// - /// Default `[]` - pub condition_names: Option>, - - /// The JSON files to use for descriptions. (There was once a `bower.json`.) - /// - /// Default `["package.json"]` - pub description_files: Option>, - - /// If true, it will not allow extension-less files. - /// So by default `require('./foo')` works if `./foo` has a `.js` extension, - /// but with this enabled only `require('./foo.js')` will work. - /// - /// Default to `true` when [ResolveOptions::extensions] contains an empty string. - /// Use `Some(false)` to disable the behavior. - /// See - /// - /// Default None, which is the same as `Some(false)` when the above empty rule is not applied. - pub enforce_extension: Option, - - /// A list of exports fields in description files. - /// Can be a path to json object such as `["path", "to", "exports"]`. - /// - /// Default `[["exports"]]`. - #[napi(ts_type = "(string | string[])[]")] - pub exports_fields: Option>, - - /// Fields from `package.json` which are used to provide the internal requests of a package - /// (requests starting with # are considered internal). - /// - /// Can be a path to a JSON object such as `["path", "to", "imports"]`. - /// - /// Default `[["imports"]]`. - #[napi(ts_type = "(string | string[])[]")] - pub imports_fields: Option>, - - /// An object which maps extension to extension aliases. - /// - /// Default `{}` - pub extension_alias: Option>>, - - /// Attempt to resolve these extensions in order. - /// If multiple files share the same name but have different extensions, - /// will resolve the one with the extension listed first in the array and skip the rest. - /// - /// Default `[".js", ".json", ".node"]` - pub extensions: Option>, - - /// Redirect module requests when normal resolving fails. - /// - /// Default `[]` - pub fallback: Option>>>, - - /// 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). - /// - /// See also webpack configuration [resolve.fullySpecified](https://webpack.js.org/configuration/module/#resolvefullyspecified) - /// - /// Default `false` - pub fully_specified: Option, - - /// A list of main fields in description files - /// - /// Default `["main"]`. - #[napi(ts_type = "string | string[]")] - pub main_fields: Option, - - /// The filename to be used while resolving directories. - /// - /// Default `["index"]` - pub main_files: Option>, - - /// A list of directories to resolve modules from, can be absolute path or folder name. - /// - /// Default `["node_modules"]` - #[napi(ts_type = "string | string[]")] - pub modules: Option, - - /// Resolve to a context instead of a file. - /// - /// Default `false` - pub resolve_to_context: Option, - - /// Prefer to resolve module requests as relative requests instead of using modules from node_modules directories. - /// - /// Default `false` - pub prefer_relative: Option, - - /// Prefer to resolve server-relative urls as absolute paths before falling back to resolve in ResolveOptions::roots. - /// - /// Default `false` - pub prefer_absolute: Option, - - /// A list of resolve restrictions to restrict the paths that a request can be resolved on. - /// - /// Default `[]` - pub restrictions: Option>, - - /// A list of directories where requests of server-relative URLs (starting with '/') are resolved. - /// On non-Windows systems these requests are resolved as an absolute path first. - /// - /// Default `[]` - pub roots: Option>, - - /// Whether to resolve symlinks to their symlinked location. - /// When enabled, symlinked resources are resolved to their real path, not their symlinked location. - /// Note that this may cause module resolution to fail when using tools that symlink packages (like npm link). - /// - /// Default `true` - pub symlinks: Option, - - /// Whether to parse [module.builtinModules](https://nodejs.org/api/module.html#modulebuiltinmodules) or not. - /// For example, "zlib" will throw [crate::ResolveError::Builtin] when set to true. - /// - /// Default `false` - pub builtin_modules: Option, -} - -#[napi] -#[derive(Debug, PartialEq, Eq)] -pub enum EnforceExtension { - Auto, - Enabled, - Disabled, -} - -impl EnforceExtension { - pub fn is_auto(&self) -> bool { - *self == Self::Auto - } - - pub fn is_enabled(&self) -> bool { - *self == Self::Enabled - } - - pub fn is_disabled(&self) -> bool { - *self == Self::Disabled - } -} - -/// Alias Value for [ResolveOptions::alias] and [ResolveOptions::fallback]. -/// Use struct because napi don't support structured union now -#[napi(object)] -#[derive(Debug, Clone)] -pub struct Restriction { - pub path: Option, - pub regex: Option, -} - -/// Tsconfig Options -/// -/// Derived from [tsconfig-paths-webpack-plugin](https://github.com/dividab/tsconfig-paths-webpack-plugin#options) -#[napi(object)] -#[derive(Debug, Clone)] -pub struct TsconfigOptions { - /// Allows you to specify where to find the TypeScript configuration file. - /// You may provide - /// * a relative path to the configuration file. It will be resolved relative to cwd. - /// * an absolute path to the configuration file. - pub config_file: String, - - /// Support for Typescript Project References. - /// - /// * `'auto'`: use the `references` field from tsconfig of `config_file`. - /// * `string[]`: manually provided relative or absolute path. - #[napi(ts_type = "'auto' | string[]")] - pub references: Option>>, -} - -impl Into for Restriction { - fn into(self) -> oxc_resolver::Restriction { - match (self.path, self.regex) { - (None, None) => { - panic!("Should specify path or regex") - } - (None, Some(regex)) => oxc_resolver::Restriction::RegExp(regex), - (Some(path), None) => oxc_resolver::Restriction::Path(PathBuf::from(path)), - (Some(_), Some(_)) => { - panic!("Restriction can't be path and regex at the same time") - } - } - } -} - -impl Into for EnforceExtension { - fn into(self) -> oxc_resolver::EnforceExtension { - match self { - EnforceExtension::Auto => oxc_resolver::EnforceExtension::Auto, - EnforceExtension::Enabled => oxc_resolver::EnforceExtension::Enabled, - EnforceExtension::Disabled => oxc_resolver::EnforceExtension::Disabled, - } - } -} - -impl Into for TsconfigOptions { - fn into(self) -> oxc_resolver::TsconfigOptions { - oxc_resolver::TsconfigOptions { - config_file: PathBuf::from(self.config_file), - references: match self.references { - Some(Either::A(string)) if string.as_str() == "auto" => { - oxc_resolver::TsconfigReferences::Auto - } - Some(Either::A(opt)) => { - panic!("`{}` is not a valid option for tsconfig references", opt) - } - Some(Either::B(paths)) => oxc_resolver::TsconfigReferences::Paths( - paths.into_iter().map(PathBuf::from).collect::>(), - ), - None => oxc_resolver::TsconfigReferences::Disabled, - }, - } - } -} - -type StrOrStrListType = Either>; -pub struct StrOrStrList(pub StrOrStrListType); - -impl Into> for StrOrStrList { - fn into(self) -> Vec { - match self { - StrOrStrList(Either::A(s)) => Vec::from([s]), - StrOrStrList(Either::B(a)) => a, - } - } -} diff --git a/napi/tests/options.test.mjs b/napi/tests/options.test.mjs deleted file mode 100644 index 4a93efff..00000000 --- a/napi/tests/options.test.mjs +++ /dev/null @@ -1,59 +0,0 @@ -import { describe, it } from "node:test"; -import { ResolverFactory } from "../index.js"; -import * as assert from "node:assert"; -import * as path from "node:path"; - -const fixtureDir = new URL( - "../../fixtures/enhanced_resolve/test/fixtures", - import.meta.url -).pathname; - -describe("option", () => { - describe("aliasFields", () => { - it("should allow field string ", () => { - const resolver = new ResolverFactory({ aliasFields: ["browser"] }); - assert.match( - resolver.sync(fixtureDir, "./browser-module/lib/replaced.js").path, - /browser-module\/lib\/browser\.js$/ - ); - }); - it("should allow json path array", () => { - const resolver = new ResolverFactory({ - aliasFields: [["innerBrowser1", "field", "browser"]], - }); - - assert.match( - resolver.sync(fixtureDir, "./browser-module/lib/main1.js").path, - /browser-module\/lib\/main\.js$/ - ); - }); - }); - - describe("exportsFields", () => { - const createTest = (exportsFields) => { - const resolver = new ResolverFactory({ exportsFields }); - assert.match( - resolver.sync( - path.resolve(fixtureDir, "./exports-field3"), - "exports-field" - ).path, - /\/exports-field\/src\/index\.js$/ - ); - }; - it("should allow string as field item", createTest(["broken"])); - it("should allow json path array as field item", createTest([["broken"]])); - }); - - describe("mainFields", () => { - const createTest = (mainFields) => { - const resolver = new ResolverFactory({ mainFields }); - assert.match( - resolver.sync(fixtureDir, "../..").path, - /\/lib\/index\.js$/ - ); - }; - it("should use `'main'` as default", createTest(undefined)); - it("should allow field string", createTest("main")); - it("should allow field array", createTest(["main"])); - }); -}); diff --git a/npm/package.json b/npm/package.json index cd8be367..b47e6b07 100644 --- a/npm/package.json +++ b/npm/package.json @@ -1,41 +1,30 @@ { - "name": "oxc-resolver", - "version": "1.8.2", - "description": "Oxc Resolver Node API", - "main": "index.js", - "browser": "browser.js", - "files": [ - "index.d.ts", - "index.js", - "browser.js" - ], - "license": "MIT", - "homepage": "https://oxc.rs", - "repository": { - "type": "git", - "url": "git+https://github.com/oxc-project/oxc-resolver.git" - }, - "publishConfig": { - "registry": "https://registry.npmjs.org/", - "access": "public" - }, - "napi": { - "binaryName": "resolver", - "packageName": "@oxc-resolver/binding", - "targets": [ - "x86_64-pc-windows-msvc", - "aarch64-pc-windows-msvc", - "x86_64-unknown-linux-gnu", - "x86_64-unknown-linux-musl", - "aarch64-unknown-linux-gnu", - "aarch64-unknown-linux-musl", - "armv7-unknown-linux-gnueabihf", - "x86_64-apple-darwin", - "aarch64-apple-darwin", - "wasm32-wasip1-threads" - ] - }, - "funding": { - "url": "https://github.com/sponsors/Boshen" - } + "name": "oxc-resolver", + "description": "Oxc Resolver Node API", + "funding": { + "url": "https://github.com/sponsors/Boshen" + }, + "main": "index.js", + "browser": "browser.js", + "files": [ + "index.d.ts", + "index.js", + "browser.js" + ], + "napi": { + "binaryName": "resolver", + "packageName": "@oxc-resolver/binding", + "targets": [ + "x86_64-pc-windows-msvc", + "aarch64-pc-windows-msvc", + "x86_64-unknown-linux-gnu", + "x86_64-unknown-linux-musl", + "aarch64-unknown-linux-gnu", + "aarch64-unknown-linux-musl", + "armv7-unknown-linux-gnueabihf", + "x86_64-apple-darwin", + "aarch64-apple-darwin", + "wasm32-wasip1-threads" + ] + } } diff --git a/package.json b/package.json index 51cb822a..a431e48f 100644 --- a/package.json +++ b/package.json @@ -1,33 +1,24 @@ { - "name": "@oxc-resolver/binding", - "private": true, - "version": "0.0.0", - "scripts": { - "build": "napi build --platform --release --package-json-path npm/package.json --manifest-path napi/Cargo.toml", - "build:debug": "napi build --platform --package-json-path npm/package.json --manifest-path napi/Cargo.toml", - "prepublishOnly": "napi pre-publish -t npm", - "test": "ava" - }, - "devDependencies": { - "@napi-rs/cli": "^3.0.0-alpha.43", - "@napi-rs/wasm-runtime": "^0.2.0", - "@types/node": "^20.10.4", - "ava": "^6.0.1", - "emnapi": "^1.0.0", - "typescript": "^5.3.3" - }, - "ava": { - "files": [ - "napi/__test__/*.spec.mjs" - ], - "cache": false - }, - "packageManager": "pnpm@9.4.0", - "repository": { - "type": "git", - "url": "git+https://github.com/oxc-project/oxc-resolver.git" - }, - "funding": { - "url": "https://github.com/sponsors/Boshen" - } + "name": "@oxc-resolver/binding", + "funding": { + "url": "https://github.com/sponsors/Boshen" + }, + "scripts": { + "build": "napi build --platform --release --package-json-path npm/package.json --manifest-path napi/Cargo.toml", + "build:debug": "napi build --platform --package-json-path npm/package.json --manifest-path napi/Cargo.toml", + "prepublishOnly": "napi pre-publish -t npm" + }, + "ava": { + "cache": false, + "files": [ + "napi/__test__/*.spec.mjs" + ] + }, + "devDependencies": { + "@napi-rs/cli": "^3.0.0-alpha.43", + "@napi-rs/wasm-runtime": "^0.2.0", + "@types/node": "^20.10.4", + "ava": "^6.0.1", + "emnapi": "^1.0.0" + } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml deleted file mode 100644 index 162a4b3c..00000000 --- a/pnpm-lock.yaml +++ /dev/null @@ -1,2690 +0,0 @@ -lockfileVersion: '9.0' - -settings: - autoInstallPeers: true - excludeLinksFromLockfile: false - -importers: - - .: - devDependencies: - '@napi-rs/cli': - specifier: ^3.0.0-alpha.43 - version: 3.0.0-alpha.55(@emnapi/runtime@1.2.0)(emnapi@1.2.0) - '@napi-rs/wasm-runtime': - specifier: ^0.2.0 - version: 0.2.4 - '@types/node': - specifier: ^20.10.4 - version: 20.14.8 - ava: - specifier: ^6.0.1 - version: 6.1.3 - emnapi: - specifier: ^1.0.0 - version: 1.2.0 - typescript: - specifier: ^5.3.3 - version: 5.5.2 - - fixtures/pnpm: - devDependencies: - axios: - specifier: 1.6.2 - version: 1.6.2 - postcss: - specifier: 8.4.33 - version: 8.4.33 - styled-components: - specifier: 6.1.1 - version: 6.1.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - - npm: {} - -packages: - - '@emnapi/core@1.2.0': - resolution: {integrity: sha512-E7Vgw78I93we4ZWdYCb4DGAwRROGkMIXk7/y87UmANR+J6qsWusmC3gLt0H+O0KOt5e6O38U8oJamgbudrES/w==} - - '@emnapi/runtime@1.2.0': - resolution: {integrity: sha512-bV21/9LQmcQeCPEg3BDFtvwL6cwiTMksYNWQQ4KOxCZikEGalWtenoZ0wCiukJINlGCIi2KXx01g4FoH/LxpzQ==} - - '@emnapi/wasi-threads@1.0.1': - resolution: {integrity: sha512-iIBu7mwkq4UQGeMEM8bLwNK962nXdhodeScX4slfQnRhEMMzvYivHhutCIk8uojvmASXXPC2WNEjwxFWk72Oqw==} - - '@emotion/is-prop-valid@1.2.2': - resolution: {integrity: sha512-uNsoYd37AFmaCdXlg6EYD1KaPOaRWRByMCYzbKUX4+hhMfrxdVSelShywL4JVaAeM/eHUOSprYBQls+/neX3pw==} - - '@emotion/memoize@0.8.1': - resolution: {integrity: sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA==} - - '@emotion/unitless@0.8.1': - resolution: {integrity: sha512-KOEGMu6dmJZtpadb476IsZBclKvILjopjUii3V+7MnXIQCYh8W3NgNcgwo21n9LXZX6EDIKvqfjYxXebDwxKmQ==} - - '@inquirer/figures@1.0.3': - resolution: {integrity: sha512-ErXXzENMH5pJt5/ssXV0DfWUZqly8nGzf0UcBV9xTnP+KyffE2mqyxIMBrZ8ijQck2nU0TQm40EQB53YreyWHw==} - engines: {node: '>=18'} - - '@ljharb/through@2.3.13': - resolution: {integrity: sha512-/gKJun8NNiWGZJkGzI/Ragc53cOdcLNdzjLaIa+GEjguQs0ulsurx8WN0jijdK9yPqDvziX995sMRLyLt1uZMQ==} - engines: {node: '>= 0.4'} - - '@mapbox/node-pre-gyp@1.0.11': - resolution: {integrity: sha512-Yhlar6v9WQgUp/He7BdgzOz8lqMQ8sU+jkCq7Wx8Myc5YFJLbEe7lgui/V7G1qB1DJykHSGwreceSaD60Y0PUQ==} - hasBin: true - - '@napi-rs/cli@3.0.0-alpha.55': - resolution: {integrity: sha512-6XgBBTX8O28W5gcSzqYkI72UVJV6Y2YcyQNrEqak39JavJRLlXCv09uLF97raynXAOO50KeP6DEXFy5P8MR2sw==} - engines: {node: '>= 16'} - hasBin: true - peerDependencies: - '@emnapi/runtime': ^1.1.0 - emnapi: ^1.1.0 - peerDependenciesMeta: - '@emnapi/runtime': - optional: true - emnapi: - optional: true - - '@napi-rs/cross-toolchain@0.0.16': - resolution: {integrity: sha512-jwdjHT5L0m9MH0CmzDwPp0ckn/UO7afHCsPeo7NugHUvYgvlgS7SWhdMVgIgJW2HHqhcW/2nhaLLGpAU1c7QRQ==} - peerDependencies: - '@napi-rs/cross-toolchain-arm64-target-aarch64': ^0.0.16 - '@napi-rs/cross-toolchain-arm64-target-armv7': ^0.0.16 - '@napi-rs/cross-toolchain-arm64-target-x86_64': ^0.0.16 - '@napi-rs/cross-toolchain-x64-target-aarch64': ^0.0.16 - '@napi-rs/cross-toolchain-x64-target-armv7': ^0.0.16 - '@napi-rs/cross-toolchain-x64-target-x86_64': ^0.0.16 - peerDependenciesMeta: - '@napi-rs/cross-toolchain-arm64-target-aarch64': - optional: true - '@napi-rs/cross-toolchain-arm64-target-armv7': - optional: true - '@napi-rs/cross-toolchain-arm64-target-x86_64': - optional: true - '@napi-rs/cross-toolchain-x64-target-aarch64': - optional: true - '@napi-rs/cross-toolchain-x64-target-armv7': - optional: true - '@napi-rs/cross-toolchain-x64-target-x86_64': - optional: true - - '@napi-rs/lzma-android-arm-eabi@1.3.1': - resolution: {integrity: sha512-mtGOg8jXlc+pTBI86cqohfndS9UmOAkk9d5CChKMb8btVks70yhUN1e7YYS3QFbmoxbPs2Ee+wmuH1Khdc7B2w==} - engines: {node: '>= 10'} - cpu: [arm] - os: [android] - - '@napi-rs/lzma-android-arm64@1.3.1': - resolution: {integrity: sha512-4uGkQgAv9Tnc/i0k2eIgbhZgyzs94+iECWxz4MFZNcZ1fNGvGbRL2j+SITE4OmwrUn3TuFK/uYWfgzooq8E1Qg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [android] - - '@napi-rs/lzma-darwin-arm64@1.3.1': - resolution: {integrity: sha512-MZBg4iwHTS8icjTiCMdzh8kYrMmKBCEglFPa+vjI91R2XDwuuwSzqmpATRpmMH8cWUUWtGPF4fnxKzjgkzhd4Q==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [darwin] - - '@napi-rs/lzma-darwin-x64@1.3.1': - resolution: {integrity: sha512-7vte+1lYV7xgZERKH/pjAeh4T16aQASKOzu4op70pK6VP/64Plr5rrvqxQqQmlAIe4pwyo/RkFl1n4LXDod3xg==} - engines: {node: '>= 10'} - cpu: [x64] - os: [darwin] - - '@napi-rs/lzma-freebsd-x64@1.3.1': - resolution: {integrity: sha512-uBS74fynTqLUC3catIxyezCafn8UDlr2yxVV47vz1T6Vop2PGDz/cMQdV6rnLSjPE08Rv66ihM36mgf/MmOkOg==} - engines: {node: '>= 10'} - cpu: [x64] - os: [freebsd] - - '@napi-rs/lzma-linux-arm-gnueabihf@1.3.1': - resolution: {integrity: sha512-rrVLyqBJeN29gPJCNkPbZ7dAzaseEcERKyhjwM+DfbFrDUvtkEcrYPvo+iwE/NmF+OkZQkzcanrVMGnq/mcJYQ==} - engines: {node: '>= 10'} - cpu: [arm] - os: [linux] - - '@napi-rs/lzma-linux-arm64-gnu@1.3.1': - resolution: {integrity: sha512-vDmVsthRbX2opkgRirJJGKQxUP/spvyVM2Y5CyCWZ7sadSID3hA97r38gf9ISn/sJ8/r93IPWLq+iycudNKi+Q==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/lzma-linux-arm64-musl@1.3.1': - resolution: {integrity: sha512-x4m/J3hRdFd3IoqKc+4aBcSUkcuDEP7hH6vdss8bKNLjPfXmnG/lcHJEQX3hNnNOULPP8xVRxgiY8jeL62cnsw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/lzma-linux-x64-gnu@1.3.1': - resolution: {integrity: sha512-riB+Xg72NfH8Kcpq07omshVu0QsLW0v2bhywBNYxvA+t2dGGWSIEN1U/zazUXys+IEA6pBQKqLVseurWE6Cl8g==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/lzma-linux-x64-musl@1.3.1': - resolution: {integrity: sha512-JXLgJFwoeysxdSg7rdVYP8wrliCQVJlU5JcLYjRVSCL4P0mQTjnYi7R7VdaOkDACw/Fvlji7oIJXt0KiaDTcOw==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/lzma-wasm32-wasi@1.3.1': - resolution: {integrity: sha512-XTA9XTUtj0KPKuzNS2oi3bWN6tJodk00wwMd/TiKoEqx9Fe/zu+OfDGuXAn+xs+P7S3YCDHqjYinuTQMZ0ucJw==} - engines: {node: '>=14.0.0'} - cpu: [wasm32] - - '@napi-rs/lzma-win32-arm64-msvc@1.3.1': - resolution: {integrity: sha512-qLDfs9UEtLPPTN/FdSz3gSdlx86VwFQBuLBrQtaiYQtUTKZCOYV1Z1fXqFt5Zqa1HKV2oyXnwGcTI7RpcyXxtg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [win32] - - '@napi-rs/lzma-win32-ia32-msvc@1.3.1': - resolution: {integrity: sha512-rWNlxLFMIfvxzfdQCfeQ3D/HEnQG3vfladFYrXUx6ePXO6r+BLCGn6/LWSSuKlw4vKkb1iHEWsAVaRLIcJEMIA==} - engines: {node: '>= 10'} - cpu: [ia32] - os: [win32] - - '@napi-rs/lzma-win32-x64-msvc@1.3.1': - resolution: {integrity: sha512-SNfHNqEjabXfTL1+KRi0qiAhwIlZHhQystvfSYX6p1g+2trSC/3WUpUQ4fbbR7KyE31g2AAnwjXivnlQ0af/pg==} - engines: {node: '>= 10'} - cpu: [x64] - os: [win32] - - '@napi-rs/lzma@1.3.1': - resolution: {integrity: sha512-XyZoBlYNMvCulK/RmVK/0nB3j7IdH7HpqcrMMg0U+HqQqKRLOQBwvnKNBocPC1bZQ7iZuKWYTLn1ayZwTyek8w==} - engines: {node: '>= 10'} - - '@napi-rs/tar-android-arm-eabi@0.1.1': - resolution: {integrity: sha512-Ufa0ahZvE5KGrC2WBux5svCe/jvC+e8IgtleiicwqnfgTfbDknYyq/QuqkP1AnMp/IvTmx2iutCZt6OFIG0zAg==} - engines: {node: '>= 10'} - cpu: [arm] - os: [android] - - '@napi-rs/tar-android-arm64@0.1.1': - resolution: {integrity: sha512-KUu5fHIiIObSuZ/crHxUrQ243+LiCRKPwdCVLHwjtftqFjzls+R2Mp6GrpM41XxexDMN00SUta3kazi93Xr19A==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [android] - - '@napi-rs/tar-darwin-arm64@0.1.1': - resolution: {integrity: sha512-jaqgdX20iIga+2gzotQ78eF00Cm8vECocUYeMY62WqyzJNv/jx1dlOfELWEccOjpmawFT9tjWebsS9F1QMvSUg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [darwin] - - '@napi-rs/tar-darwin-x64@0.1.1': - resolution: {integrity: sha512-80sa32IxfRso9x9sGTFpfLSx3BnruyJODpSkUzalOCz9i14n5gOKA8KR/JrnSWwDz0p5l5P9kfQD3pu8Voj7WA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [darwin] - - '@napi-rs/tar-freebsd-x64@0.1.1': - resolution: {integrity: sha512-P7V1zBjjC1dCrTwtUzuzYM4AeZduigeCtd8qQw2IUZowM5AsmhMd77oYuXjdU29cEpKUpyYjJRxjPCzFy+WbAQ==} - engines: {node: '>= 10'} - cpu: [x64] - os: [freebsd] - - '@napi-rs/tar-linux-arm-gnueabihf@0.1.1': - resolution: {integrity: sha512-qpC71ILPkWKt8k1iJCYt5gjwcOkd2VFSQIelTRr12t5CVNKV04rE/TMdwFoCP7kxbtb9Fl2cZzCRISw2BhMCmQ==} - engines: {node: '>= 10'} - cpu: [arm] - os: [linux] - - '@napi-rs/tar-linux-arm64-gnu@0.1.1': - resolution: {integrity: sha512-71QgxcFJCog6O4Tauoge8D0ILkDGJTRk3ru7zG8PUFG1QXJ1kkiRikdT77YmoVxtomc9FUOt+bdEdU5Yn+3QUQ==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/tar-linux-arm64-musl@0.1.1': - resolution: {integrity: sha512-R2e7YEILPKc447N1hUt1zQuyy0st83HX6nhmtFywS1aOj76/3hzxLVrebGiiS6kifyCrO82o66CNTYe7DixMZw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/tar-linux-x64-gnu@0.1.1': - resolution: {integrity: sha512-tmy9q2LXUB2GQ+IgUzJn3+us52leplMu96ORyFq1iHQEelGSqXt4xi5DzU07JhX3obJPqVqkybtcRS4enBfmBA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/tar-linux-x64-musl@0.1.1': - resolution: {integrity: sha512-j5ePbe6vihApl0cGPPDUVTWZbf2mF4NhxngAoG2jp7AeX3cWP2O4pjsvaOraW6QfvWEMFPeER7S0b6eBS7duvA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/tar-wasm32-wasi@0.1.1': - resolution: {integrity: sha512-se0+DlOiIRt7mcz7BeOJDoZtCrROpKLwiAOGmNgrjQ/SZS7TnOPuwm3wy9XN9WLoepttEjCEem6UP8yD5GJuQg==} - engines: {node: '>=14.0.0'} - cpu: [wasm32] - - '@napi-rs/tar-win32-arm64-msvc@0.1.1': - resolution: {integrity: sha512-FDZPi2wC7RwzvodogigLh/pJvhqCTVTUqOYuHlLkPSUbSAGiEkI55wk9RqH3y3EdJQaDuzyqC0QKz5ket2U+GA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [win32] - - '@napi-rs/tar-win32-ia32-msvc@0.1.1': - resolution: {integrity: sha512-OPR9Tou5z5M912G7Kc7gkf1ltinbOQx5dS/OeDIWHvPGOfdFDIxt0YVKhzSLRJi43+zIDp8/+cbeMD/cKXfX8w==} - engines: {node: '>= 10'} - cpu: [ia32] - os: [win32] - - '@napi-rs/tar-win32-x64-msvc@0.1.1': - resolution: {integrity: sha512-hiv5KfhrMSg8tTRC2oQXVckVg1h6ZVjwbd5aF9Esl0V3p2TaNFwwbqgnAN4Gm/PmSnHWNL/IRTHkk3cOzDWihQ==} - engines: {node: '>= 10'} - cpu: [x64] - os: [win32] - - '@napi-rs/tar@0.1.1': - resolution: {integrity: sha512-FOMhwwlvoYjHaDBxP26K3D92ltw1Y/CC4CIjgC6qXdzW4MYNwTlEyI58smCM3k+nCVJH3kpOYyH3sgbK4WZA4A==} - engines: {node: '>= 10'} - - '@napi-rs/wasm-runtime@0.2.4': - resolution: {integrity: sha512-9zESzOO5aDByvhIAsOy9TbpZ0Ur2AJbUI7UT73kcUTS2mxAMHOBaa1st/jAymNoCtvrit99kkzT1FZuXVcgfIQ==} - - '@napi-rs/wasm-tools-android-arm-eabi@0.0.2': - resolution: {integrity: sha512-/b+UU3suXjW4P0DzHRNdrnebQtFKcQf/YMeZJH+xUlKgvwli5kbmWjx8Wqqz0VETVkUTuPqJMBDIVLyc+14FGw==} - engines: {node: '>= 10'} - cpu: [arm] - os: [android] - - '@napi-rs/wasm-tools-android-arm64@0.0.2': - resolution: {integrity: sha512-j57GbDflwJdZtT8pZj5fOV4JAP+LdKN+wzsUYs+QRUoBqpWbbUANudolqfw63bkS9sD4z7fbCuz8iwtJqzxTVA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [android] - - '@napi-rs/wasm-tools-darwin-arm64@0.0.2': - resolution: {integrity: sha512-P2ChgWgVuv9GwmbxN89R84KzIImoTqXINteEixUvmkdnhyFiR+I8deNs89Yed+5w8QLC6MEfrtRqLP9YI+NoQA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [darwin] - - '@napi-rs/wasm-tools-darwin-x64@0.0.2': - resolution: {integrity: sha512-T/kQQ0gt8+wau1Z821PKVAD76QhmwVoLs2CT7Z9tTBs2pJvwSCP0C/kQiQAHcJIMi7A2E9Ab/Mez0BERy50EFA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [darwin] - - '@napi-rs/wasm-tools-freebsd-x64@0.0.2': - resolution: {integrity: sha512-GnnHu+r5sfzuxC/1J5UMF/h3BOZnHb3NQZ5hmbCfZYCKzpzRxrAJhzRunlbRN+v0x8M/49dztVTYR3s7K4ooAw==} - engines: {node: '>= 10'} - cpu: [x64] - os: [freebsd] - - '@napi-rs/wasm-tools-linux-arm64-gnu@0.0.2': - resolution: {integrity: sha512-KnZdLT0OnKb1CG2kdt3/WvM43vr9i+FEwXCvSOVC/6Tsifz7ynhMg7LAVESILd03HubzQJfg9nbRsk0bQ+IOwg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/wasm-tools-linux-arm64-musl@0.0.2': - resolution: {integrity: sha512-HkpZOID2U8P6pWqK3mqZ8bxU5xcuT3iA2fO+jrxn78h006iYgfNmdc5JaVhHnHazMmk32xKhSV4iV0VUh8UWDg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/wasm-tools-linux-x64-gnu@0.0.2': - resolution: {integrity: sha512-YksJWBCyOalB9ogtP9+/dZKP+vR6+h7BmzMXaXMT71WW/GvIsifMVgv+DY/FRSNJQupp5Y+ugjqVAOUOc/G65g==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/wasm-tools-linux-x64-musl@0.0.2': - resolution: {integrity: sha512-sPtRxPMdw05KdTcxgSPMmSXG2+PiK3vJ/l2+g9hvjnnKtvslJN2Hr7j8zgzuoKRAUFPaJVe6+D2xVh5cpdqhww==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/wasm-tools-wasm32-wasi@0.0.2': - resolution: {integrity: sha512-muRvZK7AIuo88G2AxYx3gA59rHMQgoN004saQkBvXnz3K/DVHKfTZ6TtUebss8zI3dURU6xExL8drxFWYxjEbQ==} - engines: {node: '>=14.0.0'} - cpu: [wasm32] - - '@napi-rs/wasm-tools-win32-arm64-msvc@0.0.2': - resolution: {integrity: sha512-Cn13WQ+tpFqdVwx0DIWKbsI9auFyzVZV4F5UNOUeDt6GgOL+NndgJul0Pc9bSU6fi03AylMPfF/nTCaDWO2Wgw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [win32] - - '@napi-rs/wasm-tools-win32-ia32-msvc@0.0.2': - resolution: {integrity: sha512-xsg5DkIQi82a8rcx6246Y3XC8TIqHamY+/C6sIlPLaZEuHctDkMECAw0AANwRf5vN//D2oo2oljOuoYtB1GOKw==} - engines: {node: '>= 10'} - cpu: [ia32] - os: [win32] - - '@napi-rs/wasm-tools-win32-x64-msvc@0.0.2': - resolution: {integrity: sha512-yHigltEt33eq8bappvKsIliz4MxfMPn1M+NWbIFRWN+IS1Z57mhmc1osuk+IRXrSlq0Tom0R6MYN1jpkZKz81Q==} - engines: {node: '>= 10'} - cpu: [x64] - os: [win32] - - '@napi-rs/wasm-tools@0.0.2': - resolution: {integrity: sha512-kBvDQCP5BLw2TxTENXLp3Of7vVEx0uyIye824JHE4dduzzOHVgSoOFVhVqAT3Fx/hLV445RVWfEqQbXMg4w/Mw==} - engines: {node: '>= 10'} - - '@nodelib/fs.scandir@2.1.5': - resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} - engines: {node: '>= 8'} - - '@nodelib/fs.stat@2.0.5': - resolution: {integrity: sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==} - engines: {node: '>= 8'} - - '@nodelib/fs.walk@1.2.8': - resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} - engines: {node: '>= 8'} - - '@octokit/auth-token@4.0.0': - resolution: {integrity: sha512-tY/msAuJo6ARbK6SPIxZrPBms3xPbfwBrulZe0Wtr/DIY9lje2HeV1uoebShn6mx7SjCHif6EjMvoREj+gZ+SA==} - engines: {node: '>= 18'} - - '@octokit/core@5.2.0': - resolution: {integrity: sha512-1LFfa/qnMQvEOAdzlQymH0ulepxbxnCYAKJZfMci/5XJyIHWgEYnDmgnKakbTh7CH2tFQ5O60oYDvns4i9RAIg==} - engines: {node: '>= 18'} - - '@octokit/endpoint@9.0.5': - resolution: {integrity: sha512-ekqR4/+PCLkEBF6qgj8WqJfvDq65RH85OAgrtnVp1mSxaXF03u2xW/hUdweGS5654IlC0wkNYC18Z50tSYTAFw==} - engines: {node: '>= 18'} - - '@octokit/graphql@7.1.0': - resolution: {integrity: sha512-r+oZUH7aMFui1ypZnAvZmn0KSqAUgE1/tUXIWaqUCa1758ts/Jio84GZuzsvUkme98kv0WFY8//n0J1Z+vsIsQ==} - engines: {node: '>= 18'} - - '@octokit/openapi-types@22.2.0': - resolution: {integrity: sha512-QBhVjcUa9W7Wwhm6DBFu6ZZ+1/t/oYxqc2tp81Pi41YNuJinbFRx8B133qVOrAaBbF7D/m0Et6f9/pZt9Rc+tg==} - - '@octokit/plugin-paginate-rest@11.3.1': - resolution: {integrity: sha512-ryqobs26cLtM1kQxqeZui4v8FeznirUsksiA+RYemMPJ7Micju0WSkv50dBksTuZks9O5cg4wp+t8fZ/cLY56g==} - engines: {node: '>= 18'} - peerDependencies: - '@octokit/core': '5' - - '@octokit/plugin-request-log@4.0.1': - resolution: {integrity: sha512-GihNqNpGHorUrO7Qa9JbAl0dbLnqJVrV8OXe2Zm5/Y4wFkZQDfTreBzVmiRfJVfE4mClXdihHnbpyyO9FSX4HA==} - engines: {node: '>= 18'} - peerDependencies: - '@octokit/core': '5' - - '@octokit/plugin-rest-endpoint-methods@13.2.2': - resolution: {integrity: sha512-EI7kXWidkt3Xlok5uN43suK99VWqc8OaIMktY9d9+RNKl69juoTyxmLoWPIZgJYzi41qj/9zU7G/ljnNOJ5AFA==} - engines: {node: '>= 18'} - peerDependencies: - '@octokit/core': ^5 - - '@octokit/request-error@5.1.0': - resolution: {integrity: sha512-GETXfE05J0+7H2STzekpKObFe765O5dlAKUTLNGeH+x47z7JjXHfsHKo5z21D/o/IOZTUEI6nyWyR+bZVP/n5Q==} - engines: {node: '>= 18'} - - '@octokit/request@8.4.0': - resolution: {integrity: sha512-9Bb014e+m2TgBeEJGEbdplMVWwPmL1FPtggHQRkV+WVsMggPtEkLKPlcVYm/o8xKLkpJ7B+6N8WfQMtDLX2Dpw==} - engines: {node: '>= 18'} - - '@octokit/rest@20.1.1': - resolution: {integrity: sha512-MB4AYDsM5jhIHro/dq4ix1iWTLGToIGk6cWF5L6vanFaMble5jTX/UBQyiv05HsWnwUtY8JrfHy2LWfKwihqMw==} - engines: {node: '>= 18'} - - '@octokit/types@13.5.0': - resolution: {integrity: sha512-HdqWTf5Z3qwDVlzCrP8UJquMwunpDiMPt5er+QjGzL4hqr/vBVY/MauQgS1xWxCDT1oMx1EULyqxncdCY/NVSQ==} - - '@rollup/pluginutils@4.2.1': - resolution: {integrity: sha512-iKnFXr7NkdZAIHiIWE+BX5ULi/ucVFYWD6TbAV+rZctiRTY2PL6tsIKhoIOaoskiWAkgu+VsbXgUVDNLHf+InQ==} - engines: {node: '>= 8.0.0'} - - '@sindresorhus/merge-streams@2.3.0': - resolution: {integrity: sha512-LtoMMhxAlorcGhmFYI+LhPgbPZCkgP6ra1YL604EeF6U98pLlQ3iWIGMdWSC+vWmPBWBNgmDBAhnAobLROJmwg==} - engines: {node: '>=18'} - - '@tybys/wasm-util@0.9.0': - resolution: {integrity: sha512-6+7nlbMVX/PVDCwaIQ8nTOPveOcFLSt8GcXdx8hD0bt39uWxYT88uXzqTd4fTvqta7oeUJqudepapKNt2DYJFw==} - - '@types/node@20.14.8': - resolution: {integrity: sha512-DO+2/jZinXfROG7j7WKFn/3C6nFwxy2lLpgLjEXJz+0XKphZlTLJ14mo8Vfg8X5BWN6XjyESXq+LcYdT7tR3bA==} - - '@types/stylis@4.2.6': - resolution: {integrity: sha512-4nebF2ZJGzQk0ka0O6+FZUWceyFv4vWq/0dXBMmrSeAwzOuOd/GxE5Pa64d/ndeNLG73dXoBsRzvtsVsYUv6Uw==} - - '@vercel/nft@0.26.5': - resolution: {integrity: sha512-NHxohEqad6Ra/r4lGknO52uc/GrWILXAMs1BB4401GTqww0fw1bAqzpG1XHuDO+dprg4GvsD9ZLLSsdo78p9hQ==} - engines: {node: '>=16'} - hasBin: true - - abbrev@1.1.1: - resolution: {integrity: sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==} - - acorn-import-attributes@1.9.5: - resolution: {integrity: sha512-n02Vykv5uA3eHGM/Z2dQrcD56kL8TyDb2p1+0P83PClMnC/nc+anbQRhIOWnSq4Ke/KvDPrY3C9hDtC/A3eHnQ==} - peerDependencies: - acorn: ^8 - - acorn-walk@8.3.3: - resolution: {integrity: sha512-MxXdReSRhGO7VlFe1bRG/oI7/mdLV9B9JJT0N8vZOhF7gFRR5l3M8W9G8JxmKV+JC5mGqJ0QvqfSOLsCPa4nUw==} - engines: {node: '>=0.4.0'} - - acorn@8.12.0: - resolution: {integrity: sha512-RTvkC4w+KNXrM39/lWCUaG0IbRkWdCv7W/IOW9oU6SawyxulvkQy5HQPVTKxEjczcUvapcrw3cFx/60VN/NRNw==} - engines: {node: '>=0.4.0'} - hasBin: true - - agent-base@6.0.2: - resolution: {integrity: sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==} - engines: {node: '>= 6.0.0'} - - ansi-escapes@4.3.2: - resolution: {integrity: sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==} - engines: {node: '>=8'} - - ansi-regex@5.0.1: - resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} - engines: {node: '>=8'} - - ansi-regex@6.0.1: - resolution: {integrity: sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==} - engines: {node: '>=12'} - - ansi-styles@4.3.0: - resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} - engines: {node: '>=8'} - - ansi-styles@6.2.1: - resolution: {integrity: sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==} - engines: {node: '>=12'} - - aproba@2.0.0: - resolution: {integrity: sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==} - - are-we-there-yet@2.0.0: - resolution: {integrity: sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw==} - engines: {node: '>=10'} - deprecated: This package is no longer supported. - - argparse@1.0.10: - resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==} - - argparse@2.0.1: - resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} - - array-find-index@1.0.2: - resolution: {integrity: sha512-M1HQyIXcBGtVywBt8WVdim+lrNaK7VHp99Qt5pSNziXznKHViIBbXWtfRTpEFpF/c4FdfxNAsCCwPp5phBYJtw==} - engines: {node: '>=0.10.0'} - - arrgv@1.0.2: - resolution: {integrity: sha512-a4eg4yhp7mmruZDQFqVMlxNRFGi/i1r87pt8SDHy0/I8PqSXoUTlWZRdAZo0VXgvEARcujbtTk8kiZRi1uDGRw==} - engines: {node: '>=8.0.0'} - - arrify@3.0.0: - resolution: {integrity: sha512-tLkvA81vQG/XqE2mjDkGQHoOINtMHtysSnemrmoGe6PydDPMRbVugqyk4A6V/WDWEfm3l+0d8anA9r8cv/5Jaw==} - engines: {node: '>=12'} - - async-sema@3.1.1: - resolution: {integrity: sha512-tLRNUXati5MFePdAk8dw7Qt7DpxPB60ofAgn8WRhW6a2rcimZnYBP9oxHiv0OHy+Wz7kPMG+t4LGdt31+4EmGg==} - - asynckit@0.4.0: - resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} - - ava@6.1.3: - resolution: {integrity: sha512-tkKbpF1pIiC+q09wNU9OfyTDYZa8yuWvU2up3+lFJ3lr1RmnYh2GBpPwzYUEB0wvTPIUysGjcZLNZr7STDviRA==} - engines: {node: ^18.18 || ^20.8 || ^21 || ^22} - hasBin: true - peerDependencies: - '@ava/typescript': '*' - peerDependenciesMeta: - '@ava/typescript': - optional: true - - axios@1.6.2: - resolution: {integrity: sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A==} - - balanced-match@1.0.2: - resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} - - base64-js@1.5.1: - resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==} - - before-after-hook@2.2.3: - resolution: {integrity: sha512-NzUnlZexiaH/46WDhANlyR2bXRopNg4F/zuSA3OpZnllCUgRaOF2znDioDWrmbNVsuZk6l9pMquQB38cfBZwkQ==} - - bindings@1.5.0: - resolution: {integrity: sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==} - - bl@4.1.0: - resolution: {integrity: sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==} - - blueimp-md5@2.19.0: - resolution: {integrity: sha512-DRQrD6gJyy8FbiE4s+bDoXS9hiW3Vbx5uCdwvcCf3zLHL+Iv7LtGHLpr+GZV8rHG8tK766FGYBwRbu8pELTt+w==} - - brace-expansion@1.1.11: - resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} - - braces@3.0.3: - resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==} - engines: {node: '>=8'} - - buffer@5.7.1: - resolution: {integrity: sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==} - - call-bind@1.0.7: - resolution: {integrity: sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==} - engines: {node: '>= 0.4'} - - callsites@4.1.0: - resolution: {integrity: sha512-aBMbD1Xxay75ViYezwT40aQONfr+pSXTHwNKvIXhXD6+LY3F1dLIcceoC5OZKBVHbXcysz1hL9D2w0JJIMXpUw==} - engines: {node: '>=12.20'} - - camelize@1.0.1: - resolution: {integrity: sha512-dU+Tx2fsypxTgtLoE36npi3UqcjSSMNYfkqgmoEhtZrraP5VWq0K7FkWVTYa8eMPtnU/G2txVsfdCJTn9uzpuQ==} - - cbor@9.0.2: - resolution: {integrity: sha512-JPypkxsB10s9QOWwa6zwPzqE1Md3vqpPc+cai4sAecuCsRyAtAl/pMyhPlMbT/xtPnm2dznJZYRLui57qiRhaQ==} - engines: {node: '>=16'} - - chalk@4.1.2: - resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} - engines: {node: '>=10'} - - chalk@5.3.0: - resolution: {integrity: sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==} - engines: {node: ^12.17.0 || ^14.13 || >=16.0.0} - - chardet@0.7.0: - resolution: {integrity: sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==} - - chownr@2.0.0: - resolution: {integrity: sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==} - engines: {node: '>=10'} - - chunkd@2.0.1: - resolution: {integrity: sha512-7d58XsFmOq0j6el67Ug9mHf9ELUXsQXYJBkyxhH/k+6Ke0qXRnv0kbemx+Twc6fRJ07C49lcbdgm9FL1Ei/6SQ==} - - ci-info@4.0.0: - resolution: {integrity: sha512-TdHqgGf9odd8SXNuxtUBVx8Nv+qZOejE6qyqiy5NtbYYQOeFa6zmHkxlPzmaLxWWHsU6nJmB7AETdVPi+2NBUg==} - engines: {node: '>=8'} - - ci-parallel-vars@1.0.1: - resolution: {integrity: sha512-uvzpYrpmidaoxvIQHM+rKSrigjOe9feHYbw4uOI2gdfe1C3xIlxO+kVXq83WQWNniTf8bAxVpy+cQeFQsMERKg==} - - cli-cursor@3.1.0: - resolution: {integrity: sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==} - engines: {node: '>=8'} - - cli-spinners@2.9.2: - resolution: {integrity: sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==} - engines: {node: '>=6'} - - cli-truncate@4.0.0: - resolution: {integrity: sha512-nPdaFdQ0h/GEigbPClz11D0v/ZJEwxmeVZGeMo3Z5StPtUTkA9o1lD6QwoirYiSDzbcwn2XcjwmCp68W1IS4TA==} - engines: {node: '>=18'} - - cli-width@4.1.0: - resolution: {integrity: sha512-ouuZd4/dm2Sw5Gmqy6bGyNNNe1qt9RpmxveLSO7KcgsTnU7RXfsw+/bukWGo1abgBiMAic068rclZsO4IWmmxQ==} - engines: {node: '>= 12'} - - clipanion@3.2.1: - resolution: {integrity: sha512-dYFdjLb7y1ajfxQopN05mylEpK9ZX0sO1/RfMXdfmwjlIsPkbh4p7A682x++zFPLDCo1x3p82dtljHf5cW2LKA==} - peerDependencies: - typanion: '*' - - cliui@8.0.1: - resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==} - engines: {node: '>=12'} - - clone@1.0.4: - resolution: {integrity: sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==} - engines: {node: '>=0.8'} - - code-excerpt@4.0.0: - resolution: {integrity: sha512-xxodCmBen3iy2i0WtAK8FlFNrRzjUqjRsMfho58xT/wvZU1YTM3fCnRjcy1gJPMepaRlgm/0e6w8SpWHpn3/cA==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - color-convert@2.0.1: - resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} - engines: {node: '>=7.0.0'} - - color-name@1.1.4: - resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} - - color-support@1.1.3: - resolution: {integrity: sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==} - hasBin: true - - colorette@2.0.20: - resolution: {integrity: sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==} - - combined-stream@1.0.8: - resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} - engines: {node: '>= 0.8'} - - common-path-prefix@3.0.0: - resolution: {integrity: sha512-QE33hToZseCH3jS0qN96O/bSh3kaw/h+Tq7ngyY9eWDUnTlTNUyqfqvCXioLe5Na5jFsL78ra/wuBU4iuEgd4w==} - - concat-map@0.0.1: - resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} - - concordance@5.0.4: - resolution: {integrity: sha512-OAcsnTEYu1ARJqWVGwf4zh4JDfHZEaSNlNccFmt8YjB2l/n19/PF2viLINHc57vO4FKIAFl2FWASIGZZWZ2Kxw==} - engines: {node: '>=10.18.0 <11 || >=12.14.0 <13 || >=14'} - - console-control-strings@1.1.0: - resolution: {integrity: sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==} - - convert-to-spaces@2.0.1: - resolution: {integrity: sha512-rcQ1bsQO9799wq24uE5AM2tAILy4gXGIK/njFWcVQkGNZ96edlpY+A7bjwvzjYvLDyzmG1MmMLZhpcsb+klNMQ==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - css-color-keywords@1.0.0: - resolution: {integrity: sha512-FyyrDHZKEjXDpNJYvVsV960FiqQyXc/LlYmsxl2BcdMb2WPx0OGRVgTg55rPSyLSNMqP52R9r8geSp7apN3Ofg==} - engines: {node: '>=4'} - - css-to-react-native@3.2.0: - resolution: {integrity: sha512-e8RKaLXMOFii+02mOlqwjbD00KSEKqblnpO9e++1aXS1fPQOpS1YoqdVHBqPjHNoxeF2mimzVqawm2KCbEdtHQ==} - - csstype@3.1.3: - resolution: {integrity: sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==} - - currently-unhandled@0.4.1: - resolution: {integrity: sha512-/fITjgjGU50vjQ4FH6eUoYu+iUoUKIXws2hL15JJpIR+BbTxaXQsMuuyjtNh2WqsSBS5nsaZHFsFecyw5CCAng==} - engines: {node: '>=0.10.0'} - - date-time@3.1.0: - resolution: {integrity: sha512-uqCUKXE5q1PNBXjPqvwhwJf9SwMoAHBgWJ6DcrnS5o+W2JOiIILl0JEdVD8SGujrNS02GGxgwAg2PN2zONgtjg==} - engines: {node: '>=6'} - - debug@4.3.5: - resolution: {integrity: sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg==} - engines: {node: '>=6.0'} - peerDependencies: - supports-color: '*' - peerDependenciesMeta: - supports-color: - optional: true - - defaults@1.0.4: - resolution: {integrity: sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A==} - - define-data-property@1.1.4: - resolution: {integrity: sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==} - engines: {node: '>= 0.4'} - - delayed-stream@1.0.0: - resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} - engines: {node: '>=0.4.0'} - - delegates@1.0.0: - resolution: {integrity: sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==} - - deprecation@2.3.1: - resolution: {integrity: sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==} - - detect-libc@2.0.3: - resolution: {integrity: sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw==} - engines: {node: '>=8'} - - emittery@1.0.3: - resolution: {integrity: sha512-tJdCJitoy2lrC2ldJcqN4vkqJ00lT+tOWNT1hBJjO/3FDMJa5TTIiYGCKGkn/WfCyOzUMObeohbVTj00fhiLiA==} - engines: {node: '>=14.16'} - - emnapi@1.2.0: - resolution: {integrity: sha512-rcq+dJCcfr08I0XM/57LPRqaUokGfni/+SvhO7NaJthTTjRdohhIy0FQwyC5rR1enAsjkldQg83th8J5hURv0Q==} - peerDependencies: - node-addon-api: '>= 6.1.0' - peerDependenciesMeta: - node-addon-api: - optional: true - - emoji-regex@10.3.0: - resolution: {integrity: sha512-QpLs9D9v9kArv4lfDEgg1X/gN5XLnf/A6l9cs8SPZLRZR3ZkY9+kwIQTxm+fsSej5UMYGE8fdoaZVIBlqG0XTw==} - - emoji-regex@8.0.0: - resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} - - es-define-property@1.0.0: - resolution: {integrity: sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==} - engines: {node: '>= 0.4'} - - es-errors@1.3.0: - resolution: {integrity: sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==} - engines: {node: '>= 0.4'} - - escalade@3.1.2: - resolution: {integrity: sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==} - engines: {node: '>=6'} - - escape-string-regexp@2.0.0: - resolution: {integrity: sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==} - engines: {node: '>=8'} - - escape-string-regexp@5.0.0: - resolution: {integrity: sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==} - engines: {node: '>=12'} - - esprima@4.0.1: - resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==} - engines: {node: '>=4'} - hasBin: true - - estree-walker@2.0.2: - resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==} - - esutils@2.0.3: - resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} - engines: {node: '>=0.10.0'} - - external-editor@3.1.0: - resolution: {integrity: sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==} - engines: {node: '>=4'} - - fast-diff@1.3.0: - resolution: {integrity: sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==} - - fast-glob@3.3.2: - resolution: {integrity: sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==} - engines: {node: '>=8.6.0'} - - fastq@1.17.1: - resolution: {integrity: sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==} - - figures@6.1.0: - resolution: {integrity: sha512-d+l3qxjSesT4V7v2fh+QnmFnUWv9lSpjarhShNTgBOfA0ttejbQUAlHLitbjkoRiDulW0OPoQPYIGhIC8ohejg==} - engines: {node: '>=18'} - - file-uri-to-path@1.0.0: - resolution: {integrity: sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==} - - fill-range@7.1.1: - resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==} - engines: {node: '>=8'} - - find-up-simple@1.0.0: - resolution: {integrity: sha512-q7Us7kcjj2VMePAa02hDAF6d+MzsdsAWEwYyOpwUtlerRBkOEPBCRZrAV4XfcSN8fHAgaD0hP7miwoay6DCprw==} - engines: {node: '>=18'} - - follow-redirects@1.15.6: - resolution: {integrity: sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==} - engines: {node: '>=4.0'} - peerDependencies: - debug: '*' - peerDependenciesMeta: - debug: - optional: true - - form-data@4.0.0: - resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==} - engines: {node: '>= 6'} - - fs-minipass@2.1.0: - resolution: {integrity: sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==} - engines: {node: '>= 8'} - - fs.realpath@1.0.0: - resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} - - function-bind@1.1.2: - resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==} - - gauge@3.0.2: - resolution: {integrity: sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q==} - engines: {node: '>=10'} - deprecated: This package is no longer supported. - - get-caller-file@2.0.5: - resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} - engines: {node: 6.* || 8.* || >= 10.*} - - get-east-asian-width@1.2.0: - resolution: {integrity: sha512-2nk+7SIVb14QrgXFHcm84tD4bKQz0RxPuMT8Ag5KPOq7J5fEmAg0UbXdTOSHqNuHSU28k55qnceesxXRZGzKWA==} - engines: {node: '>=18'} - - get-intrinsic@1.2.4: - resolution: {integrity: sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==} - engines: {node: '>= 0.4'} - - glob-parent@5.1.2: - resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} - engines: {node: '>= 6'} - - glob@7.2.3: - resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} - deprecated: Glob versions prior to v9 are no longer supported - - globby@14.0.1: - resolution: {integrity: sha512-jOMLD2Z7MAhyG8aJpNOpmziMOP4rPLcc95oQPKXBazW82z+CEgPFBQvEpRUa1KeIMUJo4Wsm+q6uzO/Q/4BksQ==} - engines: {node: '>=18'} - - gopd@1.0.1: - resolution: {integrity: sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==} - - graceful-fs@4.2.11: - resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} - - has-flag@4.0.0: - resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} - engines: {node: '>=8'} - - has-property-descriptors@1.0.2: - resolution: {integrity: sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==} - - has-proto@1.0.3: - resolution: {integrity: sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==} - engines: {node: '>= 0.4'} - - has-symbols@1.0.3: - resolution: {integrity: sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==} - engines: {node: '>= 0.4'} - - has-unicode@2.0.1: - resolution: {integrity: sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==} - - hasown@2.0.2: - resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==} - engines: {node: '>= 0.4'} - - https-proxy-agent@5.0.1: - resolution: {integrity: sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==} - engines: {node: '>= 6'} - - iconv-lite@0.4.24: - resolution: {integrity: sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==} - engines: {node: '>=0.10.0'} - - ieee754@1.2.1: - resolution: {integrity: sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==} - - ignore-by-default@2.1.0: - resolution: {integrity: sha512-yiWd4GVmJp0Q6ghmM2B/V3oZGRmjrKLXvHR3TE1nfoXsmoggllfZUQe74EN0fJdPFZu2NIvNdrMMLm3OsV7Ohw==} - engines: {node: '>=10 <11 || >=12 <13 || >=14'} - - ignore@5.3.1: - resolution: {integrity: sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==} - engines: {node: '>= 4'} - - imurmurhash@0.1.4: - resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} - engines: {node: '>=0.8.19'} - - indent-string@5.0.0: - resolution: {integrity: sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==} - engines: {node: '>=12'} - - inflight@1.0.6: - resolution: {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. - - inherits@2.0.4: - resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} - - inquirer@9.2.23: - resolution: {integrity: sha512-kod5s+FBPIDM2xiy9fu+6wdU/SkK5le5GS9lh4FEBjBHqiMgD9lLFbCbuqFNAjNL2ZOy9Wd9F694IOzN9pZHBA==} - engines: {node: '>=18'} - - irregular-plurals@3.5.0: - resolution: {integrity: sha512-1ANGLZ+Nkv1ptFb2pa8oG8Lem4krflKuX/gINiHJHjJUKaJHk/SXk5x6K3J+39/p0h1RQ2saROclJJ+QLvETCQ==} - engines: {node: '>=8'} - - is-extglob@2.1.1: - resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} - engines: {node: '>=0.10.0'} - - is-fullwidth-code-point@3.0.0: - resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} - engines: {node: '>=8'} - - is-fullwidth-code-point@4.0.0: - resolution: {integrity: sha512-O4L094N2/dZ7xqVdrXhh9r1KODPJpFms8B5sGdJLPy664AgvXsreZUyCQQNItZRDlYug4xStLjNp/sz3HvBowQ==} - engines: {node: '>=12'} - - is-glob@4.0.3: - resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} - engines: {node: '>=0.10.0'} - - is-interactive@1.0.0: - resolution: {integrity: sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w==} - engines: {node: '>=8'} - - is-number@7.0.0: - resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} - engines: {node: '>=0.12.0'} - - is-plain-object@5.0.0: - resolution: {integrity: sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==} - engines: {node: '>=0.10.0'} - - is-promise@4.0.0: - resolution: {integrity: sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==} - - is-unicode-supported@0.1.0: - resolution: {integrity: sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==} - engines: {node: '>=10'} - - is-unicode-supported@2.0.0: - resolution: {integrity: sha512-FRdAyx5lusK1iHG0TWpVtk9+1i+GjrzRffhDg4ovQ7mcidMQ6mj+MhKPmvh7Xwyv5gIS06ns49CA7Sqg7lC22Q==} - engines: {node: '>=18'} - - js-string-escape@1.0.1: - resolution: {integrity: sha512-Smw4xcfIQ5LVjAOuJCvN/zIodzA/BBSsluuoSykP+lUvScIi4U6RJLfwHet5cxFnCswUjISV8oAXaqaJDY3chg==} - engines: {node: '>= 0.8'} - - js-tokens@4.0.0: - resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} - - js-yaml@3.14.1: - resolution: {integrity: sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==} - hasBin: true - - js-yaml@4.1.0: - resolution: {integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==} - hasBin: true - - load-json-file@7.0.1: - resolution: {integrity: sha512-Gnxj3ev3mB5TkVBGad0JM6dmLiQL+o0t23JPBZ9sd+yvSLk05mFoqKBw5N8gbbkU4TNXyqCgIrl/VM17OgUIgQ==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - lodash-es@4.17.21: - resolution: {integrity: sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==} - - lodash@4.17.21: - resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} - - log-symbols@4.1.0: - resolution: {integrity: sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==} - engines: {node: '>=10'} - - loose-envify@1.4.0: - resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==} - hasBin: true - - make-dir@3.1.0: - resolution: {integrity: sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==} - engines: {node: '>=8'} - - matcher@5.0.0: - resolution: {integrity: sha512-s2EMBOWtXFc8dgqvoAzKJXxNHibcdJMV0gwqKUaw9E2JBJuGUK7DrNKrA6g/i+v72TT16+6sVm5mS3thaMLQUw==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - md5-hex@3.0.1: - resolution: {integrity: sha512-BUiRtTtV39LIJwinWBjqVsU9xhdnz7/i889V859IBFpuqGAj6LuOvHv5XLbgZ2R7ptJoJaEcxkv88/h25T7Ciw==} - engines: {node: '>=8'} - - memoize@10.0.0: - resolution: {integrity: sha512-H6cBLgsi6vMWOcCpvVCdFFnl3kerEXbrYh9q+lY6VXvQSmM6CkmV08VOwT+WE2tzIEqRPFfAq3fm4v/UIW6mSA==} - engines: {node: '>=18'} - - merge2@1.4.1: - resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} - engines: {node: '>= 8'} - - micromatch@4.0.7: - resolution: {integrity: sha512-LPP/3KorzCwBxfeUuZmaR6bG2kdeHSbe0P2tY3FLRU4vYrjYz5hI4QZwV0njUx3jeuKe67YukQ1LSPZBKDqO/Q==} - engines: {node: '>=8.6'} - - mime-db@1.52.0: - resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} - engines: {node: '>= 0.6'} - - mime-types@2.1.35: - resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} - engines: {node: '>= 0.6'} - - mimic-fn@2.1.0: - resolution: {integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==} - engines: {node: '>=6'} - - mimic-function@5.0.1: - resolution: {integrity: sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==} - engines: {node: '>=18'} - - minimatch@3.1.2: - resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} - - minipass@3.3.6: - resolution: {integrity: sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==} - engines: {node: '>=8'} - - minipass@5.0.0: - resolution: {integrity: sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==} - engines: {node: '>=8'} - - minizlib@2.1.2: - resolution: {integrity: sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==} - engines: {node: '>= 8'} - - mkdirp@1.0.4: - resolution: {integrity: sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==} - engines: {node: '>=10'} - hasBin: true - - ms@2.1.2: - resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} - - ms@2.1.3: - resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} - - mute-stream@1.0.0: - resolution: {integrity: sha512-avsJQhyd+680gKXyG/sQc0nXaC6rBkPOfyHYcFb9+hdkqQkR9bdnkJ0AMZhke0oesPqIO+mFFJ+IdBc7mst4IA==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - - nanoid@3.3.7: - resolution: {integrity: sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==} - engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} - hasBin: true - - node-fetch@2.7.0: - resolution: {integrity: sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==} - engines: {node: 4.x || >=6.0.0} - peerDependencies: - encoding: ^0.1.0 - peerDependenciesMeta: - encoding: - optional: true - - node-gyp-build@4.8.1: - resolution: {integrity: sha512-OSs33Z9yWr148JZcbZd5WiAXhh/n9z8TxQcdMhIOlpN9AhWpLfvVFO73+m77bBABQMaY9XSvIa+qk0jlI7Gcaw==} - hasBin: true - - nofilter@3.1.0: - resolution: {integrity: sha512-l2NNj07e9afPnhAhvgVrCD/oy2Ai1yfLpuo3EpiO1jFTsB4sFz6oIfAfSZyQzVpkZQ9xS8ZS5g1jCBgq4Hwo0g==} - engines: {node: '>=12.19'} - - nopt@5.0.0: - resolution: {integrity: sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==} - engines: {node: '>=6'} - hasBin: true - - npmlog@5.0.1: - resolution: {integrity: sha512-AqZtDUWOMKs1G/8lwylVjrdYgqA4d9nu8hc+0gzRxlDb1I10+FHBGMXs6aiQHFdCUUlqH99MUMuLfzWDNDtfxw==} - deprecated: This package is no longer supported. - - object-assign@4.1.1: - resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} - engines: {node: '>=0.10.0'} - - once@1.4.0: - resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} - - onetime@5.1.2: - resolution: {integrity: sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==} - engines: {node: '>=6'} - - ora@5.4.1: - resolution: {integrity: sha512-5b6Y85tPxZZ7QytO+BQzysW31HJku27cRIlkbAXaNx+BdcVi+LlRFmVXzeF6a7JCwJpyw5c4b+YSVImQIrBpuQ==} - engines: {node: '>=10'} - - os-tmpdir@1.0.2: - resolution: {integrity: sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==} - engines: {node: '>=0.10.0'} - - p-map@7.0.2: - resolution: {integrity: sha512-z4cYYMMdKHzw4O5UkWJImbZynVIo0lSGTXc7bzB1e/rrDqkgGUNysK/o4bTr+0+xKvvLoTyGqYC4Fgljy9qe1Q==} - engines: {node: '>=18'} - - package-config@5.0.0: - resolution: {integrity: sha512-GYTTew2slBcYdvRHqjhwaaydVMvn/qrGC323+nKclYioNSLTDUM/lGgtGTgyHVtYcozb+XkE8CNhwcraOmZ9Mg==} - engines: {node: '>=18'} - - parse-ms@4.0.0: - resolution: {integrity: sha512-TXfryirbmq34y8QBwgqCVLi+8oA3oWx2eAnSn62ITyEhEYaWRlVZ2DvMM9eZbMs/RfxPu/PK/aBLyGj4IrqMHw==} - engines: {node: '>=18'} - - path-is-absolute@1.0.1: - resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==} - engines: {node: '>=0.10.0'} - - path-type@5.0.0: - resolution: {integrity: sha512-5HviZNaZcfqP95rwpv+1HDgUamezbqdSYTyzjTvwtJSnIH+3vnbmWsItli8OFEndS984VT55M3jduxZbX351gg==} - engines: {node: '>=12'} - - picocolors@1.0.1: - resolution: {integrity: sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==} - - picomatch@2.3.1: - resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} - engines: {node: '>=8.6'} - - picomatch@3.0.1: - resolution: {integrity: sha512-I3EurrIQMlRc9IaAZnqRR044Phh2DXY+55o7uJ0V+hYZAcQYSuFWsc9q5PvyDHUSCe1Qxn/iBz+78s86zWnGag==} - engines: {node: '>=10'} - - plur@5.1.0: - resolution: {integrity: sha512-VP/72JeXqak2KiOzjgKtQen5y3IZHn+9GOuLDafPv0eXa47xq0At93XahYBs26MsifCQ4enGKwbjBTKgb9QJXg==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - postcss-value-parser@4.2.0: - resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==} - - postcss@8.4.33: - resolution: {integrity: sha512-Kkpbhhdjw2qQs2O2DGX+8m5OVqEcbB9HRBvuYM9pgrjEFUg30A9LmXNlTAUj4S9kgtGyrMbTzVjH7E+s5Re2yg==} - engines: {node: ^10 || ^12 || >=14} - - pretty-ms@9.0.0: - resolution: {integrity: sha512-E9e9HJ9R9NasGOgPaPE8VMeiPKAyWR5jcFpNnwIejslIhWqdqOrb2wShBsncMPUb+BcCd2OPYfh7p2W6oemTng==} - engines: {node: '>=18'} - - proxy-from-env@1.1.0: - resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==} - - queue-microtask@1.2.3: - resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} - - react-dom@18.3.1: - resolution: {integrity: sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==} - peerDependencies: - react: ^18.3.1 - - react@18.3.1: - resolution: {integrity: sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==} - engines: {node: '>=0.10.0'} - - readable-stream@3.6.2: - resolution: {integrity: sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==} - engines: {node: '>= 6'} - - require-directory@2.1.1: - resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} - engines: {node: '>=0.10.0'} - - resolve-cwd@3.0.0: - resolution: {integrity: sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==} - engines: {node: '>=8'} - - resolve-from@5.0.0: - resolution: {integrity: sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==} - engines: {node: '>=8'} - - restore-cursor@3.1.0: - resolution: {integrity: sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==} - engines: {node: '>=8'} - - reusify@1.0.4: - resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==} - engines: {iojs: '>=1.0.0', node: '>=0.10.0'} - - rimraf@3.0.2: - resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==} - deprecated: Rimraf versions prior to v4 are no longer supported - hasBin: true - - run-async@3.0.0: - resolution: {integrity: sha512-540WwVDOMxA6dN6We19EcT9sc3hkXPw5mzRNGM3FkdN/vtE9NFvj5lFAPNwUDmJjXidm3v7TC1cTE7t17Ulm1Q==} - engines: {node: '>=0.12.0'} - - run-parallel@1.2.0: - resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} - - rxjs@7.8.1: - resolution: {integrity: sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==} - - safe-buffer@5.2.1: - resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} - - safer-buffer@2.1.2: - resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} - - scheduler@0.23.2: - resolution: {integrity: sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ==} - - semver@6.3.1: - resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} - hasBin: true - - semver@7.6.2: - resolution: {integrity: sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==} - engines: {node: '>=10'} - hasBin: true - - serialize-error@7.0.1: - resolution: {integrity: sha512-8I8TjW5KMOKsZQTvoxjuSIa7foAwPWGOts+6o7sgjz41/qMD9VQHEDxi6PBvK2l0MXUmqZyNpUK+T2tQaaElvw==} - engines: {node: '>=10'} - - set-blocking@2.0.0: - resolution: {integrity: sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==} - - set-function-length@1.2.2: - resolution: {integrity: sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==} - engines: {node: '>= 0.4'} - - shallowequal@1.1.0: - resolution: {integrity: sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ==} - - signal-exit@3.0.7: - resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} - - signal-exit@4.1.0: - resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} - engines: {node: '>=14'} - - slash@5.1.0: - resolution: {integrity: sha512-ZA6oR3T/pEyuqwMgAKT0/hAv8oAXckzbkmR0UkUosQ+Mc4RxGoJkRmwHgHufaenlyAgE1Mxgpdcrf75y6XcnDg==} - engines: {node: '>=14.16'} - - slice-ansi@5.0.0: - resolution: {integrity: sha512-FC+lgizVPfie0kkhqUScwRu1O/lF6NOgJmlCgK+/LYxDCTk8sGelYaHDhFcDN+Sn3Cv+3VSa4Byeo+IMCzpMgQ==} - engines: {node: '>=12'} - - source-map-js@1.2.0: - resolution: {integrity: sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==} - engines: {node: '>=0.10.0'} - - sprintf-js@1.0.3: - resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==} - - stack-utils@2.0.6: - resolution: {integrity: sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==} - engines: {node: '>=10'} - - string-width@4.2.3: - resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} - engines: {node: '>=8'} - - string-width@7.1.0: - resolution: {integrity: sha512-SEIJCWiX7Kg4c129n48aDRwLbFb2LJmXXFrWBG4NGaRtMQ3myKPKbwrD1BKqQn74oCoNMBVrfDEr5M9YxCsrkw==} - engines: {node: '>=18'} - - string_decoder@1.3.0: - resolution: {integrity: sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==} - - strip-ansi@6.0.1: - resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} - engines: {node: '>=8'} - - strip-ansi@7.1.0: - resolution: {integrity: sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==} - engines: {node: '>=12'} - - styled-components@6.1.1: - resolution: {integrity: sha512-cpZZP5RrKRIClBW5Eby4JM1wElLVP4NQrJbJ0h10TidTyJf4SIIwa3zLXOoPb4gJi8MsJ8mjq5mu2IrEhZIAcQ==} - engines: {node: '>= 16'} - peerDependencies: - react: '>= 16.8.0' - react-dom: '>= 16.8.0' - - stylis@4.3.2: - resolution: {integrity: sha512-bhtUjWd/z6ltJiQwg0dUfxEJ+W+jdqQd8TbWLWyeIJHlnsqmGLRFFd8e5mA0AZi/zx90smXRlN66YMTcaSFifg==} - - supertap@3.0.1: - resolution: {integrity: sha512-u1ZpIBCawJnO+0QePsEiOknOfCRq0yERxiAchT0i4li0WHNUJbf0evXXSXOcCAR4M8iMDoajXYmstm/qO81Isw==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - supports-color@7.2.0: - resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} - engines: {node: '>=8'} - - tar@6.2.1: - resolution: {integrity: sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==} - engines: {node: '>=10'} - - temp-dir@3.0.0: - resolution: {integrity: sha512-nHc6S/bwIilKHNRgK/3jlhDoIHcp45YgyiwcAk46Tr0LfEqGBVpmiAyuiuxeVE44m3mXnEeVhaipLOEWmH+Njw==} - engines: {node: '>=14.16'} - - time-zone@1.0.0: - resolution: {integrity: sha512-TIsDdtKo6+XrPtiTm1ssmMngN1sAhyKnTO2kunQWqNPWIVvCm15Wmw4SWInwTVgJ5u/Tr04+8Ei9TNcw4x4ONA==} - engines: {node: '>=4'} - - tmp@0.0.33: - resolution: {integrity: sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==} - engines: {node: '>=0.6.0'} - - to-regex-range@5.0.1: - resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} - engines: {node: '>=8.0'} - - toml@3.0.0: - resolution: {integrity: sha512-y/mWCZinnvxjTKYhJ+pYxwD0mRLVvOtdS2Awbgxln6iEnt4rk0yBxeSBHkGJcPucRiG0e55mwWp+g/05rsrd6w==} - - tr46@0.0.3: - resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==} - - tslib@2.6.3: - resolution: {integrity: sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ==} - - typanion@3.14.0: - resolution: {integrity: sha512-ZW/lVMRabETuYCd9O9ZvMhAh8GslSqaUjxmK/JLPCh6l73CvLBiuXswj/+7LdnWOgYsQ130FqLzFz5aGT4I3Ug==} - - type-fest@0.13.1: - resolution: {integrity: sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==} - engines: {node: '>=10'} - - type-fest@0.21.3: - resolution: {integrity: sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==} - engines: {node: '>=10'} - - typescript@5.5.2: - resolution: {integrity: sha512-NcRtPEOsPFFWjobJEtfihkLCZCXZt/os3zf8nTxjVH3RvTSxjrCamJpbExGvYOF+tFHc3pA65qpdwPbzjohhew==} - engines: {node: '>=14.17'} - hasBin: true - - undici-types@5.26.5: - resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==} - - unicorn-magic@0.1.0: - resolution: {integrity: sha512-lRfVq8fE8gz6QMBuDM6a+LO3IAzTi05H6gCVaUpir2E1Rwpo4ZUog45KpNXKC/Mn3Yb9UDuHumeFTo9iV/D9FQ==} - engines: {node: '>=18'} - - universal-user-agent@6.0.1: - resolution: {integrity: sha512-yCzhz6FN2wU1NiiQRogkTQszlQSlpWaw8SvVegAc+bDxbzHgh1vX8uIe8OYyMH6DwH+sdTJsgMl36+mSMdRJIQ==} - - util-deprecate@1.0.2: - resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} - - wasm-sjlj@1.0.5: - resolution: {integrity: sha512-Z/MHJeOkAvJJVWnGX3/YZGYldGaawZbYHX4ldYG9kLhcdB8H31F5x66M7Zc4BP/7pg0aLsusQj1629m2B3Rilg==} - - wcwidth@1.0.1: - resolution: {integrity: sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==} - - webidl-conversions@3.0.1: - resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==} - - well-known-symbols@2.0.0: - resolution: {integrity: sha512-ZMjC3ho+KXo0BfJb7JgtQ5IBuvnShdlACNkKkdsqBmYw3bPAaJfPeYUo6tLUaT5tG/Gkh7xkpBhKRQ9e7pyg9Q==} - engines: {node: '>=6'} - - whatwg-url@5.0.0: - resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==} - - wide-align@1.1.5: - resolution: {integrity: sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==} - - wrap-ansi@6.2.0: - resolution: {integrity: sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==} - engines: {node: '>=8'} - - wrap-ansi@7.0.0: - resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==} - engines: {node: '>=10'} - - wrappy@1.0.2: - resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} - - write-file-atomic@5.0.1: - resolution: {integrity: sha512-+QU2zd6OTD8XWIJCbffaiQeH9U73qIqafo1x6V1snCWYGJf6cVE0cDR4D8xRzcEnfI21IFrUPzPGtcPf8AC+Rw==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - - y18n@5.0.8: - resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==} - engines: {node: '>=10'} - - yallist@4.0.0: - resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==} - - yargs-parser@21.1.1: - resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} - engines: {node: '>=12'} - - yargs@17.7.2: - resolution: {integrity: sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==} - engines: {node: '>=12'} - -snapshots: - - '@emnapi/core@1.2.0': - dependencies: - '@emnapi/wasi-threads': 1.0.1 - tslib: 2.6.3 - - '@emnapi/runtime@1.2.0': - dependencies: - tslib: 2.6.3 - - '@emnapi/wasi-threads@1.0.1': - dependencies: - tslib: 2.6.3 - - '@emotion/is-prop-valid@1.2.2': - dependencies: - '@emotion/memoize': 0.8.1 - - '@emotion/memoize@0.8.1': {} - - '@emotion/unitless@0.8.1': {} - - '@inquirer/figures@1.0.3': {} - - '@ljharb/through@2.3.13': - dependencies: - call-bind: 1.0.7 - - '@mapbox/node-pre-gyp@1.0.11': - dependencies: - detect-libc: 2.0.3 - https-proxy-agent: 5.0.1 - make-dir: 3.1.0 - node-fetch: 2.7.0 - nopt: 5.0.0 - npmlog: 5.0.1 - rimraf: 3.0.2 - semver: 7.6.2 - tar: 6.2.1 - transitivePeerDependencies: - - encoding - - supports-color - - '@napi-rs/cli@3.0.0-alpha.55(@emnapi/runtime@1.2.0)(emnapi@1.2.0)': - dependencies: - '@napi-rs/cross-toolchain': 0.0.16 - '@napi-rs/wasm-tools': 0.0.2 - '@octokit/rest': 20.1.1 - clipanion: 3.2.1(typanion@3.14.0) - colorette: 2.0.20 - debug: 4.3.5 - inquirer: 9.2.23 - js-yaml: 4.1.0 - lodash-es: 4.17.21 - semver: 7.6.2 - toml: 3.0.0 - typanion: 3.14.0 - wasm-sjlj: 1.0.5 - optionalDependencies: - '@emnapi/runtime': 1.2.0 - emnapi: 1.2.0 - transitivePeerDependencies: - - '@napi-rs/cross-toolchain-arm64-target-aarch64' - - '@napi-rs/cross-toolchain-arm64-target-armv7' - - '@napi-rs/cross-toolchain-arm64-target-x86_64' - - '@napi-rs/cross-toolchain-x64-target-aarch64' - - '@napi-rs/cross-toolchain-x64-target-armv7' - - '@napi-rs/cross-toolchain-x64-target-x86_64' - - supports-color - - '@napi-rs/cross-toolchain@0.0.16': - dependencies: - '@napi-rs/lzma': 1.3.1 - '@napi-rs/tar': 0.1.1 - debug: 4.3.5 - transitivePeerDependencies: - - supports-color - - '@napi-rs/lzma-android-arm-eabi@1.3.1': - optional: true - - '@napi-rs/lzma-android-arm64@1.3.1': - optional: true - - '@napi-rs/lzma-darwin-arm64@1.3.1': - optional: true - - '@napi-rs/lzma-darwin-x64@1.3.1': - optional: true - - '@napi-rs/lzma-freebsd-x64@1.3.1': - optional: true - - '@napi-rs/lzma-linux-arm-gnueabihf@1.3.1': - optional: true - - '@napi-rs/lzma-linux-arm64-gnu@1.3.1': - optional: true - - '@napi-rs/lzma-linux-arm64-musl@1.3.1': - optional: true - - '@napi-rs/lzma-linux-x64-gnu@1.3.1': - optional: true - - '@napi-rs/lzma-linux-x64-musl@1.3.1': - optional: true - - '@napi-rs/lzma-wasm32-wasi@1.3.1': - dependencies: - '@napi-rs/wasm-runtime': 0.2.4 - optional: true - - '@napi-rs/lzma-win32-arm64-msvc@1.3.1': - optional: true - - '@napi-rs/lzma-win32-ia32-msvc@1.3.1': - optional: true - - '@napi-rs/lzma-win32-x64-msvc@1.3.1': - optional: true - - '@napi-rs/lzma@1.3.1': - optionalDependencies: - '@napi-rs/lzma-android-arm-eabi': 1.3.1 - '@napi-rs/lzma-android-arm64': 1.3.1 - '@napi-rs/lzma-darwin-arm64': 1.3.1 - '@napi-rs/lzma-darwin-x64': 1.3.1 - '@napi-rs/lzma-freebsd-x64': 1.3.1 - '@napi-rs/lzma-linux-arm-gnueabihf': 1.3.1 - '@napi-rs/lzma-linux-arm64-gnu': 1.3.1 - '@napi-rs/lzma-linux-arm64-musl': 1.3.1 - '@napi-rs/lzma-linux-x64-gnu': 1.3.1 - '@napi-rs/lzma-linux-x64-musl': 1.3.1 - '@napi-rs/lzma-wasm32-wasi': 1.3.1 - '@napi-rs/lzma-win32-arm64-msvc': 1.3.1 - '@napi-rs/lzma-win32-ia32-msvc': 1.3.1 - '@napi-rs/lzma-win32-x64-msvc': 1.3.1 - - '@napi-rs/tar-android-arm-eabi@0.1.1': - optional: true - - '@napi-rs/tar-android-arm64@0.1.1': - optional: true - - '@napi-rs/tar-darwin-arm64@0.1.1': - optional: true - - '@napi-rs/tar-darwin-x64@0.1.1': - optional: true - - '@napi-rs/tar-freebsd-x64@0.1.1': - optional: true - - '@napi-rs/tar-linux-arm-gnueabihf@0.1.1': - optional: true - - '@napi-rs/tar-linux-arm64-gnu@0.1.1': - optional: true - - '@napi-rs/tar-linux-arm64-musl@0.1.1': - optional: true - - '@napi-rs/tar-linux-x64-gnu@0.1.1': - optional: true - - '@napi-rs/tar-linux-x64-musl@0.1.1': - optional: true - - '@napi-rs/tar-wasm32-wasi@0.1.1': - dependencies: - '@napi-rs/wasm-runtime': 0.2.4 - optional: true - - '@napi-rs/tar-win32-arm64-msvc@0.1.1': - optional: true - - '@napi-rs/tar-win32-ia32-msvc@0.1.1': - optional: true - - '@napi-rs/tar-win32-x64-msvc@0.1.1': - optional: true - - '@napi-rs/tar@0.1.1': - optionalDependencies: - '@napi-rs/tar-android-arm-eabi': 0.1.1 - '@napi-rs/tar-android-arm64': 0.1.1 - '@napi-rs/tar-darwin-arm64': 0.1.1 - '@napi-rs/tar-darwin-x64': 0.1.1 - '@napi-rs/tar-freebsd-x64': 0.1.1 - '@napi-rs/tar-linux-arm-gnueabihf': 0.1.1 - '@napi-rs/tar-linux-arm64-gnu': 0.1.1 - '@napi-rs/tar-linux-arm64-musl': 0.1.1 - '@napi-rs/tar-linux-x64-gnu': 0.1.1 - '@napi-rs/tar-linux-x64-musl': 0.1.1 - '@napi-rs/tar-wasm32-wasi': 0.1.1 - '@napi-rs/tar-win32-arm64-msvc': 0.1.1 - '@napi-rs/tar-win32-ia32-msvc': 0.1.1 - '@napi-rs/tar-win32-x64-msvc': 0.1.1 - - '@napi-rs/wasm-runtime@0.2.4': - dependencies: - '@emnapi/core': 1.2.0 - '@emnapi/runtime': 1.2.0 - '@tybys/wasm-util': 0.9.0 - - '@napi-rs/wasm-tools-android-arm-eabi@0.0.2': - optional: true - - '@napi-rs/wasm-tools-android-arm64@0.0.2': - optional: true - - '@napi-rs/wasm-tools-darwin-arm64@0.0.2': - optional: true - - '@napi-rs/wasm-tools-darwin-x64@0.0.2': - optional: true - - '@napi-rs/wasm-tools-freebsd-x64@0.0.2': - optional: true - - '@napi-rs/wasm-tools-linux-arm64-gnu@0.0.2': - optional: true - - '@napi-rs/wasm-tools-linux-arm64-musl@0.0.2': - optional: true - - '@napi-rs/wasm-tools-linux-x64-gnu@0.0.2': - optional: true - - '@napi-rs/wasm-tools-linux-x64-musl@0.0.2': - optional: true - - '@napi-rs/wasm-tools-wasm32-wasi@0.0.2': - dependencies: - '@napi-rs/wasm-runtime': 0.2.4 - optional: true - - '@napi-rs/wasm-tools-win32-arm64-msvc@0.0.2': - optional: true - - '@napi-rs/wasm-tools-win32-ia32-msvc@0.0.2': - optional: true - - '@napi-rs/wasm-tools-win32-x64-msvc@0.0.2': - optional: true - - '@napi-rs/wasm-tools@0.0.2': - optionalDependencies: - '@napi-rs/wasm-tools-android-arm-eabi': 0.0.2 - '@napi-rs/wasm-tools-android-arm64': 0.0.2 - '@napi-rs/wasm-tools-darwin-arm64': 0.0.2 - '@napi-rs/wasm-tools-darwin-x64': 0.0.2 - '@napi-rs/wasm-tools-freebsd-x64': 0.0.2 - '@napi-rs/wasm-tools-linux-arm64-gnu': 0.0.2 - '@napi-rs/wasm-tools-linux-arm64-musl': 0.0.2 - '@napi-rs/wasm-tools-linux-x64-gnu': 0.0.2 - '@napi-rs/wasm-tools-linux-x64-musl': 0.0.2 - '@napi-rs/wasm-tools-wasm32-wasi': 0.0.2 - '@napi-rs/wasm-tools-win32-arm64-msvc': 0.0.2 - '@napi-rs/wasm-tools-win32-ia32-msvc': 0.0.2 - '@napi-rs/wasm-tools-win32-x64-msvc': 0.0.2 - - '@nodelib/fs.scandir@2.1.5': - dependencies: - '@nodelib/fs.stat': 2.0.5 - run-parallel: 1.2.0 - - '@nodelib/fs.stat@2.0.5': {} - - '@nodelib/fs.walk@1.2.8': - dependencies: - '@nodelib/fs.scandir': 2.1.5 - fastq: 1.17.1 - - '@octokit/auth-token@4.0.0': {} - - '@octokit/core@5.2.0': - dependencies: - '@octokit/auth-token': 4.0.0 - '@octokit/graphql': 7.1.0 - '@octokit/request': 8.4.0 - '@octokit/request-error': 5.1.0 - '@octokit/types': 13.5.0 - before-after-hook: 2.2.3 - universal-user-agent: 6.0.1 - - '@octokit/endpoint@9.0.5': - dependencies: - '@octokit/types': 13.5.0 - universal-user-agent: 6.0.1 - - '@octokit/graphql@7.1.0': - dependencies: - '@octokit/request': 8.4.0 - '@octokit/types': 13.5.0 - universal-user-agent: 6.0.1 - - '@octokit/openapi-types@22.2.0': {} - - '@octokit/plugin-paginate-rest@11.3.1(@octokit/core@5.2.0)': - dependencies: - '@octokit/core': 5.2.0 - '@octokit/types': 13.5.0 - - '@octokit/plugin-request-log@4.0.1(@octokit/core@5.2.0)': - dependencies: - '@octokit/core': 5.2.0 - - '@octokit/plugin-rest-endpoint-methods@13.2.2(@octokit/core@5.2.0)': - dependencies: - '@octokit/core': 5.2.0 - '@octokit/types': 13.5.0 - - '@octokit/request-error@5.1.0': - dependencies: - '@octokit/types': 13.5.0 - deprecation: 2.3.1 - once: 1.4.0 - - '@octokit/request@8.4.0': - dependencies: - '@octokit/endpoint': 9.0.5 - '@octokit/request-error': 5.1.0 - '@octokit/types': 13.5.0 - universal-user-agent: 6.0.1 - - '@octokit/rest@20.1.1': - dependencies: - '@octokit/core': 5.2.0 - '@octokit/plugin-paginate-rest': 11.3.1(@octokit/core@5.2.0) - '@octokit/plugin-request-log': 4.0.1(@octokit/core@5.2.0) - '@octokit/plugin-rest-endpoint-methods': 13.2.2(@octokit/core@5.2.0) - - '@octokit/types@13.5.0': - dependencies: - '@octokit/openapi-types': 22.2.0 - - '@rollup/pluginutils@4.2.1': - dependencies: - estree-walker: 2.0.2 - picomatch: 2.3.1 - - '@sindresorhus/merge-streams@2.3.0': {} - - '@tybys/wasm-util@0.9.0': - dependencies: - tslib: 2.6.3 - - '@types/node@20.14.8': - dependencies: - undici-types: 5.26.5 - - '@types/stylis@4.2.6': {} - - '@vercel/nft@0.26.5': - dependencies: - '@mapbox/node-pre-gyp': 1.0.11 - '@rollup/pluginutils': 4.2.1 - acorn: 8.12.0 - acorn-import-attributes: 1.9.5(acorn@8.12.0) - async-sema: 3.1.1 - bindings: 1.5.0 - estree-walker: 2.0.2 - glob: 7.2.3 - graceful-fs: 4.2.11 - micromatch: 4.0.7 - node-gyp-build: 4.8.1 - resolve-from: 5.0.0 - transitivePeerDependencies: - - encoding - - supports-color - - abbrev@1.1.1: {} - - acorn-import-attributes@1.9.5(acorn@8.12.0): - dependencies: - acorn: 8.12.0 - - acorn-walk@8.3.3: - dependencies: - acorn: 8.12.0 - - acorn@8.12.0: {} - - agent-base@6.0.2: - dependencies: - debug: 4.3.5 - transitivePeerDependencies: - - supports-color - - ansi-escapes@4.3.2: - dependencies: - type-fest: 0.21.3 - - ansi-regex@5.0.1: {} - - ansi-regex@6.0.1: {} - - ansi-styles@4.3.0: - dependencies: - color-convert: 2.0.1 - - ansi-styles@6.2.1: {} - - aproba@2.0.0: {} - - are-we-there-yet@2.0.0: - dependencies: - delegates: 1.0.0 - readable-stream: 3.6.2 - - argparse@1.0.10: - dependencies: - sprintf-js: 1.0.3 - - argparse@2.0.1: {} - - array-find-index@1.0.2: {} - - arrgv@1.0.2: {} - - arrify@3.0.0: {} - - async-sema@3.1.1: {} - - asynckit@0.4.0: {} - - ava@6.1.3: - dependencies: - '@vercel/nft': 0.26.5 - acorn: 8.12.0 - acorn-walk: 8.3.3 - ansi-styles: 6.2.1 - arrgv: 1.0.2 - arrify: 3.0.0 - callsites: 4.1.0 - cbor: 9.0.2 - chalk: 5.3.0 - chunkd: 2.0.1 - ci-info: 4.0.0 - ci-parallel-vars: 1.0.1 - cli-truncate: 4.0.0 - code-excerpt: 4.0.0 - common-path-prefix: 3.0.0 - concordance: 5.0.4 - currently-unhandled: 0.4.1 - debug: 4.3.5 - emittery: 1.0.3 - figures: 6.1.0 - globby: 14.0.1 - ignore-by-default: 2.1.0 - indent-string: 5.0.0 - is-plain-object: 5.0.0 - is-promise: 4.0.0 - matcher: 5.0.0 - memoize: 10.0.0 - ms: 2.1.3 - p-map: 7.0.2 - package-config: 5.0.0 - picomatch: 3.0.1 - plur: 5.1.0 - pretty-ms: 9.0.0 - resolve-cwd: 3.0.0 - stack-utils: 2.0.6 - strip-ansi: 7.1.0 - supertap: 3.0.1 - temp-dir: 3.0.0 - write-file-atomic: 5.0.1 - yargs: 17.7.2 - transitivePeerDependencies: - - encoding - - supports-color - - axios@1.6.2: - dependencies: - follow-redirects: 1.15.6 - form-data: 4.0.0 - proxy-from-env: 1.1.0 - transitivePeerDependencies: - - debug - - balanced-match@1.0.2: {} - - base64-js@1.5.1: {} - - before-after-hook@2.2.3: {} - - bindings@1.5.0: - dependencies: - file-uri-to-path: 1.0.0 - - bl@4.1.0: - dependencies: - buffer: 5.7.1 - inherits: 2.0.4 - readable-stream: 3.6.2 - - blueimp-md5@2.19.0: {} - - brace-expansion@1.1.11: - dependencies: - balanced-match: 1.0.2 - concat-map: 0.0.1 - - braces@3.0.3: - dependencies: - fill-range: 7.1.1 - - buffer@5.7.1: - dependencies: - base64-js: 1.5.1 - ieee754: 1.2.1 - - call-bind@1.0.7: - dependencies: - es-define-property: 1.0.0 - es-errors: 1.3.0 - function-bind: 1.1.2 - get-intrinsic: 1.2.4 - set-function-length: 1.2.2 - - callsites@4.1.0: {} - - camelize@1.0.1: {} - - cbor@9.0.2: - dependencies: - nofilter: 3.1.0 - - chalk@4.1.2: - dependencies: - ansi-styles: 4.3.0 - supports-color: 7.2.0 - - chalk@5.3.0: {} - - chardet@0.7.0: {} - - chownr@2.0.0: {} - - chunkd@2.0.1: {} - - ci-info@4.0.0: {} - - ci-parallel-vars@1.0.1: {} - - cli-cursor@3.1.0: - dependencies: - restore-cursor: 3.1.0 - - cli-spinners@2.9.2: {} - - cli-truncate@4.0.0: - dependencies: - slice-ansi: 5.0.0 - string-width: 7.1.0 - - cli-width@4.1.0: {} - - clipanion@3.2.1(typanion@3.14.0): - dependencies: - typanion: 3.14.0 - - cliui@8.0.1: - dependencies: - string-width: 4.2.3 - strip-ansi: 6.0.1 - wrap-ansi: 7.0.0 - - clone@1.0.4: {} - - code-excerpt@4.0.0: - dependencies: - convert-to-spaces: 2.0.1 - - color-convert@2.0.1: - dependencies: - color-name: 1.1.4 - - color-name@1.1.4: {} - - color-support@1.1.3: {} - - colorette@2.0.20: {} - - combined-stream@1.0.8: - dependencies: - delayed-stream: 1.0.0 - - common-path-prefix@3.0.0: {} - - concat-map@0.0.1: {} - - concordance@5.0.4: - dependencies: - date-time: 3.1.0 - esutils: 2.0.3 - fast-diff: 1.3.0 - js-string-escape: 1.0.1 - lodash: 4.17.21 - md5-hex: 3.0.1 - semver: 7.6.2 - well-known-symbols: 2.0.0 - - console-control-strings@1.1.0: {} - - convert-to-spaces@2.0.1: {} - - css-color-keywords@1.0.0: {} - - css-to-react-native@3.2.0: - dependencies: - camelize: 1.0.1 - css-color-keywords: 1.0.0 - postcss-value-parser: 4.2.0 - - csstype@3.1.3: {} - - currently-unhandled@0.4.1: - dependencies: - array-find-index: 1.0.2 - - date-time@3.1.0: - dependencies: - time-zone: 1.0.0 - - debug@4.3.5: - dependencies: - ms: 2.1.2 - - defaults@1.0.4: - dependencies: - clone: 1.0.4 - - define-data-property@1.1.4: - dependencies: - es-define-property: 1.0.0 - es-errors: 1.3.0 - gopd: 1.0.1 - - delayed-stream@1.0.0: {} - - delegates@1.0.0: {} - - deprecation@2.3.1: {} - - detect-libc@2.0.3: {} - - emittery@1.0.3: {} - - emnapi@1.2.0: {} - - emoji-regex@10.3.0: {} - - emoji-regex@8.0.0: {} - - es-define-property@1.0.0: - dependencies: - get-intrinsic: 1.2.4 - - es-errors@1.3.0: {} - - escalade@3.1.2: {} - - escape-string-regexp@2.0.0: {} - - escape-string-regexp@5.0.0: {} - - esprima@4.0.1: {} - - estree-walker@2.0.2: {} - - esutils@2.0.3: {} - - external-editor@3.1.0: - dependencies: - chardet: 0.7.0 - iconv-lite: 0.4.24 - tmp: 0.0.33 - - fast-diff@1.3.0: {} - - fast-glob@3.3.2: - dependencies: - '@nodelib/fs.stat': 2.0.5 - '@nodelib/fs.walk': 1.2.8 - glob-parent: 5.1.2 - merge2: 1.4.1 - micromatch: 4.0.7 - - fastq@1.17.1: - dependencies: - reusify: 1.0.4 - - figures@6.1.0: - dependencies: - is-unicode-supported: 2.0.0 - - file-uri-to-path@1.0.0: {} - - fill-range@7.1.1: - dependencies: - to-regex-range: 5.0.1 - - find-up-simple@1.0.0: {} - - follow-redirects@1.15.6: {} - - form-data@4.0.0: - dependencies: - asynckit: 0.4.0 - combined-stream: 1.0.8 - mime-types: 2.1.35 - - fs-minipass@2.1.0: - dependencies: - minipass: 3.3.6 - - fs.realpath@1.0.0: {} - - function-bind@1.1.2: {} - - gauge@3.0.2: - dependencies: - aproba: 2.0.0 - color-support: 1.1.3 - console-control-strings: 1.1.0 - has-unicode: 2.0.1 - object-assign: 4.1.1 - signal-exit: 3.0.7 - string-width: 4.2.3 - strip-ansi: 6.0.1 - wide-align: 1.1.5 - - get-caller-file@2.0.5: {} - - get-east-asian-width@1.2.0: {} - - get-intrinsic@1.2.4: - dependencies: - es-errors: 1.3.0 - function-bind: 1.1.2 - has-proto: 1.0.3 - has-symbols: 1.0.3 - hasown: 2.0.2 - - glob-parent@5.1.2: - dependencies: - is-glob: 4.0.3 - - glob@7.2.3: - dependencies: - fs.realpath: 1.0.0 - inflight: 1.0.6 - inherits: 2.0.4 - minimatch: 3.1.2 - once: 1.4.0 - path-is-absolute: 1.0.1 - - globby@14.0.1: - dependencies: - '@sindresorhus/merge-streams': 2.3.0 - fast-glob: 3.3.2 - ignore: 5.3.1 - path-type: 5.0.0 - slash: 5.1.0 - unicorn-magic: 0.1.0 - - gopd@1.0.1: - dependencies: - get-intrinsic: 1.2.4 - - graceful-fs@4.2.11: {} - - has-flag@4.0.0: {} - - has-property-descriptors@1.0.2: - dependencies: - es-define-property: 1.0.0 - - has-proto@1.0.3: {} - - has-symbols@1.0.3: {} - - has-unicode@2.0.1: {} - - hasown@2.0.2: - dependencies: - function-bind: 1.1.2 - - https-proxy-agent@5.0.1: - dependencies: - agent-base: 6.0.2 - debug: 4.3.5 - transitivePeerDependencies: - - supports-color - - iconv-lite@0.4.24: - dependencies: - safer-buffer: 2.1.2 - - ieee754@1.2.1: {} - - ignore-by-default@2.1.0: {} - - ignore@5.3.1: {} - - imurmurhash@0.1.4: {} - - indent-string@5.0.0: {} - - inflight@1.0.6: - dependencies: - once: 1.4.0 - wrappy: 1.0.2 - - inherits@2.0.4: {} - - inquirer@9.2.23: - dependencies: - '@inquirer/figures': 1.0.3 - '@ljharb/through': 2.3.13 - ansi-escapes: 4.3.2 - chalk: 5.3.0 - cli-cursor: 3.1.0 - cli-width: 4.1.0 - external-editor: 3.1.0 - lodash: 4.17.21 - mute-stream: 1.0.0 - ora: 5.4.1 - run-async: 3.0.0 - rxjs: 7.8.1 - string-width: 4.2.3 - strip-ansi: 6.0.1 - wrap-ansi: 6.2.0 - - irregular-plurals@3.5.0: {} - - is-extglob@2.1.1: {} - - is-fullwidth-code-point@3.0.0: {} - - is-fullwidth-code-point@4.0.0: {} - - is-glob@4.0.3: - dependencies: - is-extglob: 2.1.1 - - is-interactive@1.0.0: {} - - is-number@7.0.0: {} - - is-plain-object@5.0.0: {} - - is-promise@4.0.0: {} - - is-unicode-supported@0.1.0: {} - - is-unicode-supported@2.0.0: {} - - js-string-escape@1.0.1: {} - - js-tokens@4.0.0: {} - - js-yaml@3.14.1: - dependencies: - argparse: 1.0.10 - esprima: 4.0.1 - - js-yaml@4.1.0: - dependencies: - argparse: 2.0.1 - - load-json-file@7.0.1: {} - - lodash-es@4.17.21: {} - - lodash@4.17.21: {} - - log-symbols@4.1.0: - dependencies: - chalk: 4.1.2 - is-unicode-supported: 0.1.0 - - loose-envify@1.4.0: - dependencies: - js-tokens: 4.0.0 - - make-dir@3.1.0: - dependencies: - semver: 6.3.1 - - matcher@5.0.0: - dependencies: - escape-string-regexp: 5.0.0 - - md5-hex@3.0.1: - dependencies: - blueimp-md5: 2.19.0 - - memoize@10.0.0: - dependencies: - mimic-function: 5.0.1 - - merge2@1.4.1: {} - - micromatch@4.0.7: - dependencies: - braces: 3.0.3 - picomatch: 2.3.1 - - mime-db@1.52.0: {} - - mime-types@2.1.35: - dependencies: - mime-db: 1.52.0 - - mimic-fn@2.1.0: {} - - mimic-function@5.0.1: {} - - minimatch@3.1.2: - dependencies: - brace-expansion: 1.1.11 - - minipass@3.3.6: - dependencies: - yallist: 4.0.0 - - minipass@5.0.0: {} - - minizlib@2.1.2: - dependencies: - minipass: 3.3.6 - yallist: 4.0.0 - - mkdirp@1.0.4: {} - - ms@2.1.2: {} - - ms@2.1.3: {} - - mute-stream@1.0.0: {} - - nanoid@3.3.7: {} - - node-fetch@2.7.0: - dependencies: - whatwg-url: 5.0.0 - - node-gyp-build@4.8.1: {} - - nofilter@3.1.0: {} - - nopt@5.0.0: - dependencies: - abbrev: 1.1.1 - - npmlog@5.0.1: - dependencies: - are-we-there-yet: 2.0.0 - console-control-strings: 1.1.0 - gauge: 3.0.2 - set-blocking: 2.0.0 - - object-assign@4.1.1: {} - - once@1.4.0: - dependencies: - wrappy: 1.0.2 - - onetime@5.1.2: - dependencies: - mimic-fn: 2.1.0 - - ora@5.4.1: - dependencies: - bl: 4.1.0 - chalk: 4.1.2 - cli-cursor: 3.1.0 - cli-spinners: 2.9.2 - is-interactive: 1.0.0 - is-unicode-supported: 0.1.0 - log-symbols: 4.1.0 - strip-ansi: 6.0.1 - wcwidth: 1.0.1 - - os-tmpdir@1.0.2: {} - - p-map@7.0.2: {} - - package-config@5.0.0: - dependencies: - find-up-simple: 1.0.0 - load-json-file: 7.0.1 - - parse-ms@4.0.0: {} - - path-is-absolute@1.0.1: {} - - path-type@5.0.0: {} - - picocolors@1.0.1: {} - - picomatch@2.3.1: {} - - picomatch@3.0.1: {} - - plur@5.1.0: - dependencies: - irregular-plurals: 3.5.0 - - postcss-value-parser@4.2.0: {} - - postcss@8.4.33: - dependencies: - nanoid: 3.3.7 - picocolors: 1.0.1 - source-map-js: 1.2.0 - - pretty-ms@9.0.0: - dependencies: - parse-ms: 4.0.0 - - proxy-from-env@1.1.0: {} - - queue-microtask@1.2.3: {} - - react-dom@18.3.1(react@18.3.1): - dependencies: - loose-envify: 1.4.0 - react: 18.3.1 - scheduler: 0.23.2 - - react@18.3.1: - dependencies: - loose-envify: 1.4.0 - - readable-stream@3.6.2: - dependencies: - inherits: 2.0.4 - string_decoder: 1.3.0 - util-deprecate: 1.0.2 - - require-directory@2.1.1: {} - - resolve-cwd@3.0.0: - dependencies: - resolve-from: 5.0.0 - - resolve-from@5.0.0: {} - - restore-cursor@3.1.0: - dependencies: - onetime: 5.1.2 - signal-exit: 3.0.7 - - reusify@1.0.4: {} - - rimraf@3.0.2: - dependencies: - glob: 7.2.3 - - run-async@3.0.0: {} - - run-parallel@1.2.0: - dependencies: - queue-microtask: 1.2.3 - - rxjs@7.8.1: - dependencies: - tslib: 2.6.3 - - safe-buffer@5.2.1: {} - - safer-buffer@2.1.2: {} - - scheduler@0.23.2: - dependencies: - loose-envify: 1.4.0 - - semver@6.3.1: {} - - semver@7.6.2: {} - - serialize-error@7.0.1: - dependencies: - type-fest: 0.13.1 - - set-blocking@2.0.0: {} - - set-function-length@1.2.2: - 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 - - shallowequal@1.1.0: {} - - signal-exit@3.0.7: {} - - signal-exit@4.1.0: {} - - slash@5.1.0: {} - - slice-ansi@5.0.0: - dependencies: - ansi-styles: 6.2.1 - is-fullwidth-code-point: 4.0.0 - - source-map-js@1.2.0: {} - - sprintf-js@1.0.3: {} - - stack-utils@2.0.6: - dependencies: - escape-string-regexp: 2.0.0 - - string-width@4.2.3: - dependencies: - emoji-regex: 8.0.0 - is-fullwidth-code-point: 3.0.0 - strip-ansi: 6.0.1 - - string-width@7.1.0: - dependencies: - emoji-regex: 10.3.0 - get-east-asian-width: 1.2.0 - strip-ansi: 7.1.0 - - string_decoder@1.3.0: - dependencies: - safe-buffer: 5.2.1 - - strip-ansi@6.0.1: - dependencies: - ansi-regex: 5.0.1 - - strip-ansi@7.1.0: - dependencies: - ansi-regex: 6.0.1 - - styled-components@6.1.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1): - dependencies: - '@emotion/is-prop-valid': 1.2.2 - '@emotion/unitless': 0.8.1 - '@types/stylis': 4.2.6 - css-to-react-native: 3.2.0 - csstype: 3.1.3 - postcss: 8.4.33 - react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) - shallowequal: 1.1.0 - stylis: 4.3.2 - tslib: 2.6.3 - - stylis@4.3.2: {} - - supertap@3.0.1: - dependencies: - indent-string: 5.0.0 - js-yaml: 3.14.1 - serialize-error: 7.0.1 - strip-ansi: 7.1.0 - - supports-color@7.2.0: - dependencies: - has-flag: 4.0.0 - - tar@6.2.1: - dependencies: - chownr: 2.0.0 - fs-minipass: 2.1.0 - minipass: 5.0.0 - minizlib: 2.1.2 - mkdirp: 1.0.4 - yallist: 4.0.0 - - temp-dir@3.0.0: {} - - time-zone@1.0.0: {} - - tmp@0.0.33: - dependencies: - os-tmpdir: 1.0.2 - - to-regex-range@5.0.1: - dependencies: - is-number: 7.0.0 - - toml@3.0.0: {} - - tr46@0.0.3: {} - - tslib@2.6.3: {} - - typanion@3.14.0: {} - - type-fest@0.13.1: {} - - type-fest@0.21.3: {} - - typescript@5.5.2: {} - - undici-types@5.26.5: {} - - unicorn-magic@0.1.0: {} - - universal-user-agent@6.0.1: {} - - util-deprecate@1.0.2: {} - - wasm-sjlj@1.0.5: {} - - wcwidth@1.0.1: - dependencies: - defaults: 1.0.4 - - webidl-conversions@3.0.1: {} - - well-known-symbols@2.0.0: {} - - whatwg-url@5.0.0: - dependencies: - tr46: 0.0.3 - webidl-conversions: 3.0.1 - - wide-align@1.1.5: - dependencies: - string-width: 4.2.3 - - wrap-ansi@6.2.0: - dependencies: - ansi-styles: 4.3.0 - string-width: 4.2.3 - strip-ansi: 6.0.1 - - wrap-ansi@7.0.0: - dependencies: - ansi-styles: 4.3.0 - string-width: 4.2.3 - strip-ansi: 6.0.1 - - wrappy@1.0.2: {} - - write-file-atomic@5.0.1: - dependencies: - imurmurhash: 0.1.4 - signal-exit: 4.1.0 - - y18n@5.0.8: {} - - yallist@4.0.0: {} - - yargs-parser@21.1.1: {} - - yargs@17.7.2: - dependencies: - cliui: 8.0.1 - escalade: 3.1.2 - get-caller-file: 2.0.5 - require-directory: 2.1.1 - string-width: 4.2.3 - y18n: 5.0.8 - yargs-parser: 21.1.1 diff --git a/src/builtins.rs b/src/builtins.rs deleted file mode 100644 index 45a25117..00000000 --- a/src/builtins.rs +++ /dev/null @@ -1,71 +0,0 @@ -/// Node.js built-in modules -/// -/// `node -p "[...require('module').builtinModules].map(b => JSON.stringify(b)).join(',\n')"` -/// -pub const NODEJS_BUILTINS: &[&str] = &[ - "_http_agent", - "_http_client", - "_http_common", - "_http_incoming", - "_http_outgoing", - "_http_server", - "_stream_duplex", - "_stream_passthrough", - "_stream_readable", - "_stream_transform", - "_stream_wrap", - "_stream_writable", - "_tls_common", - "_tls_wrap", - "assert", - "assert/strict", - "async_hooks", - "buffer", - "child_process", - "cluster", - "console", - "constants", - "crypto", - "dgram", - "diagnostics_channel", - "dns", - "dns/promises", - "domain", - "events", - "fs", - "fs/promises", - "http", - "http2", - "https", - "inspector", - "module", - "net", - "os", - "path", - "path/posix", - "path/win32", - "perf_hooks", - "process", - "punycode", - "querystring", - "readline", - "repl", - "stream", - "stream/consumers", - "stream/promises", - "stream/web", - "string_decoder", - "sys", - "timers", - "timers/promises", - "tls", - "trace_events", - "tty", - "url", - "util", - "util/types", - "v8", - "vm", - "worker_threads", - "zlib", -]; diff --git a/src/cache.rs b/src/cache.rs deleted file mode 100644 index a1bde36c..00000000 --- a/src/cache.rs +++ /dev/null @@ -1,369 +0,0 @@ -use once_cell::sync::OnceCell as OnceLock; -use std::{ - borrow::{Borrow, Cow}, - convert::AsRef, - hash::{BuildHasherDefault, Hash, Hasher}, - io, - ops::Deref, - path::{Path, PathBuf}, - sync::Arc, -}; - -use dashmap::{DashMap, DashSet}; -use rustc_hash::FxHasher; - -use crate::{ - context::ResolveContext as Ctx, package_json::PackageJson, path::PathUtil, FileMetadata, - FileSystem, ResolveError, ResolveOptions, TsConfig, -}; - -#[derive(Default)] -pub struct Cache { - pub(crate) fs: Fs, - paths: DashSet>, - tsconfigs: DashMap, BuildHasherDefault>, -} - -impl Cache { - pub fn new(fs: Fs) -> Self { - Self { fs, paths: DashSet::default(), tsconfigs: DashMap::default() } - } - - pub fn clear(&self) { - self.paths.clear(); - self.tsconfigs.clear(); - } - - pub fn value(&self, path: &Path) -> CachedPath { - let hash = { - let mut hasher = FxHasher::default(); - path.hash(&mut hasher); - hasher.finish() - }; - if let Some(cache_entry) = self.paths.get((hash, path).borrow() as &dyn CacheKey) { - return cache_entry.clone(); - } - let parent = path.parent().map(|p| self.value(p)); - let data = CachedPath(Arc::new(CachedPathImpl::new( - hash, - path.to_path_buf().into_boxed_path(), - parent, - ))); - self.paths.insert(data.clone()); - data - } - - pub fn tsconfig Result<(), ResolveError>>( - &self, - root: bool, - path: &Path, - callback: F, // callback for modifying tsconfig with `extends` - ) -> Result, ResolveError> { - if let Some(tsconfig_ref) = self.tsconfigs.get(path) { - return Ok(Arc::clone(tsconfig_ref.value())); - } - let meta = self.fs.metadata(path).ok(); - let tsconfig_path = if meta.is_some_and(|m| m.is_file) { - Cow::Borrowed(path) - } else if meta.is_some_and(|m| m.is_dir) { - Cow::Owned(path.join("tsconfig.json")) - } else { - let mut os_string = path.to_path_buf().into_os_string(); - os_string.push(".json"); - Cow::Owned(PathBuf::from(os_string)) - }; - let mut tsconfig_string = self - .fs - .read_to_string(&tsconfig_path) - .map_err(|_| ResolveError::TsconfigNotFound(path.to_path_buf()))?; - let mut tsconfig = - TsConfig::parse(root, &tsconfig_path, &mut tsconfig_string).map_err(|error| { - ResolveError::from_serde_json_error(tsconfig_path.to_path_buf(), &error) - })?; - callback(&mut tsconfig)?; - let tsconfig = Arc::new(tsconfig.build()); - self.tsconfigs.insert(path.to_path_buf(), Arc::clone(&tsconfig)); - Ok(tsconfig) - } -} - -#[derive(Clone)] -pub struct CachedPath(Arc); - -impl Hash for CachedPath { - fn hash(&self, state: &mut H) { - self.0.hash.hash(state); - } -} - -impl PartialEq for CachedPath { - fn eq(&self, other: &Self) -> bool { - self.0.path == other.0.path - } -} -impl Eq for CachedPath {} - -impl Deref for CachedPath { - type Target = CachedPathImpl; - - fn deref(&self) -> &Self::Target { - self.0.as_ref() - } -} - -impl<'a> Borrow for CachedPath { - fn borrow(&self) -> &(dyn CacheKey + 'a) { - self - } -} - -impl AsRef for CachedPath { - fn as_ref(&self) -> &CachedPathImpl { - self.0.as_ref() - } -} - -impl CacheKey for CachedPath { - fn tuple(&self) -> (u64, &Path) { - (self.hash, &self.path) - } -} - -pub struct CachedPathImpl { - hash: u64, - path: Box, - parent: Option, - meta: OnceLock>, - symlink: OnceLock>, - canonicalized: OnceLock>, - node_modules: OnceLock>, - package_json: OnceLock>>, -} - -impl CachedPathImpl { - fn new(hash: u64, path: Box, parent: Option) -> Self { - Self { - hash, - path, - parent, - meta: OnceLock::new(), - symlink: OnceLock::new(), - canonicalized: OnceLock::new(), - node_modules: OnceLock::new(), - package_json: OnceLock::new(), - } - } - - pub fn path(&self) -> &Path { - &self.path - } - - pub fn to_path_buf(&self) -> PathBuf { - self.path.to_path_buf() - } - - pub fn parent(&self) -> Option<&CachedPath> { - self.parent.as_ref() - } - - fn meta(&self, fs: &Fs) -> Option { - *self.meta.get_or_init(|| fs.metadata(&self.path).ok()) - } - - pub fn is_file(&self, fs: &Fs, ctx: &mut Ctx) -> bool { - if let Some(meta) = self.meta(fs) { - ctx.add_file_dependency(self.path()); - meta.is_file - } else { - ctx.add_missing_dependency(self.path()); - false - } - } - - pub fn is_dir(&self, fs: &Fs, ctx: &mut Ctx) -> bool { - self.meta(fs).map_or_else( - || { - ctx.add_missing_dependency(self.path()); - false - }, - |meta| meta.is_dir, - ) - } - - fn symlink(&self, fs: &Fs) -> io::Result> { - self.symlink - .get_or_try_init(|| { - if let Ok(symlink_metadata) = fs.symlink_metadata(&self.path) { - if symlink_metadata.is_symlink { - return fs.canonicalize(self.path()).map(Some); - } - } - Ok(None) - }) - .cloned() - } - - pub fn realpath(&self, fs: &Fs) -> io::Result { - self.canonicalized - .get_or_try_init(|| { - if let Some(link) = self.symlink(fs)? { - return Ok(Some(link)); - } - if let Some(parent) = self.parent() { - let parent_path = parent.realpath(fs)?; - return Ok(Some( - parent_path.normalize_with(self.path.strip_prefix(&parent.path).unwrap()), - )); - }; - Ok(None) - }) - .cloned() - .map(|r| r.unwrap_or_else(|| self.path.clone().to_path_buf())) - } - - pub fn module_directory( - &self, - module_name: &str, - cache: &Cache, - ctx: &mut Ctx, - ) -> Option { - let cached_path = cache.value(&self.path.join(module_name)); - cached_path.is_dir(&cache.fs, ctx).then_some(cached_path) - } - - pub fn cached_node_modules( - &self, - cache: &Cache, - ctx: &mut Ctx, - ) -> Option { - self.node_modules.get_or_init(|| self.module_directory("node_modules", cache, ctx)).clone() - } - - /// Find package.json of a path by traversing parent directories. - /// - /// # Errors - /// - /// * [ResolveError::JSON] - pub fn find_package_json( - &self, - fs: &Fs, - options: &ResolveOptions, - ctx: &mut Ctx, - ) -> Result>, ResolveError> { - let mut cache_value = self; - // Go up directories when the querying path is not a directory - while !cache_value.is_dir(fs, ctx) { - if let Some(cv) = &cache_value.parent { - cache_value = cv.as_ref(); - } else { - break; - } - } - let mut cache_value = Some(cache_value); - while let Some(cv) = cache_value { - if let Some(package_json) = cv.package_json(fs, options, ctx)? { - return Ok(Some(Arc::clone(&package_json))); - } - cache_value = cv.parent.as_deref(); - } - Ok(None) - } - - /// Get package.json of the given path. - /// - /// # Errors - /// - /// * [ResolveError::JSON] - pub fn package_json( - &self, - fs: &Fs, - options: &ResolveOptions, - ctx: &mut Ctx, - ) -> Result>, ResolveError> { - // Change to `std::sync::OnceLock::get_or_try_init` when it is stable. - let result = self - .package_json - .get_or_try_init(|| { - let package_json_path = self.path.join("package.json"); - let Ok(package_json_string) = fs.read_to_string(&package_json_path) else { - return Ok(None); - }; - let real_path = if options.symlinks { - self.realpath(fs)?.join("package.json") - } else { - package_json_path.clone() - }; - PackageJson::parse(package_json_path.clone(), real_path, &package_json_string) - .map(Arc::new) - .map(Some) - .map_err(|error| ResolveError::from_serde_json_error(package_json_path, &error)) - }) - .cloned(); - // https://github.com/webpack/enhanced-resolve/blob/58464fc7cb56673c9aa849e68e6300239601e615/lib/DescriptionFileUtils.js#L68-L82 - match &result { - Ok(Some(package_json)) => { - ctx.add_file_dependency(&package_json.path); - } - Ok(None) => { - // Avoid an allocation by making this lazy - if let Some(deps) = &mut ctx.missing_dependencies { - deps.push(self.path.join("package.json")); - } - } - Err(_) => { - if let Some(deps) = &mut ctx.file_dependencies { - deps.push(self.path.join("package.json")); - } - } - } - result - } -} - -/// Memoized cache key, code adapted from . -trait CacheKey { - fn tuple(&self) -> (u64, &Path); -} - -impl Hash for dyn CacheKey + '_ { - fn hash(&self, state: &mut H) { - self.tuple().0.hash(state); - } -} - -impl PartialEq for dyn CacheKey + '_ { - fn eq(&self, other: &Self) -> bool { - self.tuple().1 == other.tuple().1 - } -} - -impl Eq for dyn CacheKey + '_ {} - -impl<'a> CacheKey for (u64, &'a Path) { - fn tuple(&self) -> (u64, &Path) { - (self.0, self.1) - } -} - -impl<'a> Borrow for (u64, &'a Path) { - fn borrow(&self) -> &(dyn CacheKey + 'a) { - self - } -} - -/// Since the cache key is memoized, use an identity hasher -/// to avoid double cache. -#[derive(Default)] -struct IdentityHasher(u64); - -impl Hasher for IdentityHasher { - fn write(&mut self, _: &[u8]) { - unreachable!("Invalid use of IdentityHasher") - } - fn write_u64(&mut self, n: u64) { - self.0 = n; - } - fn finish(&self) -> u64 { - self.0 - } -} diff --git a/src/context.rs b/src/context.rs deleted file mode 100644 index 9349de30..00000000 --- a/src/context.rs +++ /dev/null @@ -1,89 +0,0 @@ -use std::{ - ops::{Deref, DerefMut}, - path::{Path, PathBuf}, -}; - -use crate::error::ResolveError; - -#[derive(Debug, Default, Clone)] -pub struct ResolveContext(ResolveContextImpl); - -#[derive(Debug, Default, Clone)] -pub struct ResolveContextImpl { - pub fully_specified: bool, - - pub query: Option, - - pub fragment: Option, - - /// Files that was found on file system - pub file_dependencies: Option>, - - /// Files that was found on file system - pub missing_dependencies: Option>, - - /// The current resolving alias for bailing recursion alias. - pub resolving_alias: Option, - - /// For avoiding infinite recursion, which will cause stack overflow. - depth: u8, -} - -impl Deref for ResolveContext { - type Target = ResolveContextImpl; - - fn deref(&self) -> &Self::Target { - &self.0 - } -} - -impl DerefMut for ResolveContext { - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} - -impl ResolveContext { - pub fn with_fully_specified(&mut self, yes: bool) { - self.fully_specified = yes; - } - - pub fn with_query_fragment(&mut self, query: Option<&str>, fragment: Option<&str>) { - if let Some(query) = query { - self.query.replace(query.to_string()); - } - if let Some(fragment) = fragment { - self.fragment.replace(fragment.to_string()); - } - } - - pub fn init_file_dependencies(&mut self) { - self.file_dependencies.replace(vec![]); - self.missing_dependencies.replace(vec![]); - } - - pub fn add_file_dependency(&mut self, dep: &Path) { - if let Some(deps) = &mut self.file_dependencies { - deps.push(dep.to_path_buf()); - } - } - - pub fn add_missing_dependency(&mut self, dep: &Path) { - if let Some(deps) = &mut self.missing_dependencies { - deps.push(dep.to_path_buf()); - } - } - - pub fn with_resolving_alias(&mut self, alias: String) { - self.resolving_alias = Some(alias); - } - - pub fn test_for_infinite_recursion(&mut self) -> Result<(), ResolveError> { - self.depth += 1; - // 64 should be more than enough for detecting infinite recursion. - if self.depth > 64 { - return Err(ResolveError::Recursion); - } - Ok(()) - } -} diff --git a/src/error.rs b/src/error.rs deleted file mode 100644 index ff2aaa4f..00000000 --- a/src/error.rs +++ /dev/null @@ -1,160 +0,0 @@ -use std::{io, path::PathBuf, sync::Arc}; -use thiserror::Error; - -/// All resolution errors -/// -/// `thiserror` is used to display meaningful error messages. -#[derive(Debug, Clone, PartialEq, Error)] -pub enum ResolveError { - /// Ignored path - /// - /// Derived from ignored path (false value) from browser field in package.json - /// ```json - /// { - /// "browser": { - /// "./module": false - /// } - /// } - /// ``` - /// See - #[error("Path is ignored {0}")] - Ignored(PathBuf), - - /// Module not found - #[error("Cannot find module '{0}'")] - NotFound(/* specifier */ String), - - /// Tsconfig not found - #[error("Tsconfig not found {0}")] - TsconfigNotFound(PathBuf), - - #[error("{0}")] - IOError(IOError), - - /// Node.js builtin modules - /// - /// This is an error due to not being a Node.js runtime. - /// The `alias` option can be used to resolve a builtin module to a polyfill. - #[error("Builtin module {0}")] - Builtin(String), - - /// All of the aliased extension are not found - #[error("All of the aliased extension are not found")] - ExtensionAlias, - - /// The provided path specifier cannot be parsed - #[error("{0}")] - Specifier(SpecifierError), - - /// JSON parse error - #[error("{0:?}")] - JSON(JSONError), - - /// Restricted by `ResolveOptions::restrictions` - #[error(r#"Path "{0}" restricted by {0}"#)] - Restriction(PathBuf, PathBuf), - - #[error(r#"Invalid module "{0}" specifier is not a valid subpath for the "exports" resolution of {1}"#)] - InvalidModuleSpecifier(String, PathBuf), - - #[error(r#"Invalid "exports" target "{0}" defined for '{1}' in the package config {2}"#)] - InvalidPackageTarget(String, String, PathBuf), - - #[error(r#"Package subpath '{0}' is not defined by "exports" in {1}"#)] - PackagePathNotExported(String, PathBuf), - - #[error(r#"Invalid package config "{0}", "exports" cannot contain some keys starting with '.' and some not. The exports object must either be an object of package subpath keys or an object of main entry condition name keys only."#)] - InvalidPackageConfig(PathBuf), - - #[error(r#"Default condition should be last one in "{0}""#)] - InvalidPackageConfigDefault(PathBuf), - - #[error(r#"Expecting folder to folder mapping. "{0}" should end with "/"#)] - InvalidPackageConfigDirectory(PathBuf), - - #[error(r#"Package import specifier "{0}" is not defined in package {1}"#)] - PackageImportNotDefined(String, PathBuf), - - #[error("{0} is unimplemented")] - Unimplemented(&'static str), - - /// Occurs when alias paths reference each other. - #[error("Recursion in resolving")] - Recursion, -} - -impl ResolveError { - pub fn is_ignore(&self) -> bool { - matches!(self, Self::Ignored(_)) - } - - pub(crate) fn from_serde_json_error(path: PathBuf, error: &serde_json::Error) -> Self { - Self::JSON(JSONError { - path, - message: error.to_string(), - line: error.line(), - column: error.column(), - }) - } -} - -/// Error for [ResolveError::Specifier] -#[derive(Debug, Clone, Eq, PartialEq, Error)] -pub enum SpecifierError { - #[error("The specifiers must be a non-empty string. Received \"{0}\"")] - Empty(String), -} - -/// JSON error from [serde_json::Error] -#[derive(Debug, Clone, Eq, PartialEq)] -pub struct JSONError { - pub path: PathBuf, - pub message: String, - pub line: usize, - pub column: usize, -} - -#[derive(Debug, Clone, Error)] -#[error("{0}")] -pub struct IOError(Arc); - -impl PartialEq for IOError { - fn eq(&self, other: &Self) -> bool { - self.0.kind() == other.0.kind() - } -} - -impl From for io::Error { - fn from(error: IOError) -> Self { - let io_error = error.0.as_ref(); - Self::new(io_error.kind(), io_error.to_string()) - } -} - -impl From for ResolveError { - fn from(err: io::Error) -> Self { - Self::IOError(IOError(Arc::new(err))) - } -} - -#[test] -fn test_into_io_error() { - use std::io::{self, ErrorKind}; - let error_string = "IOError occurred"; - let string_error = io::Error::new(ErrorKind::Interrupted, error_string.to_string()); - let string_error2 = io::Error::new(ErrorKind::Interrupted, error_string.to_string()); - let resolve_io_error: ResolveError = ResolveError::from(string_error2); - - assert_eq!(resolve_io_error, ResolveError::from(string_error)); - assert_eq!(resolve_io_error.clone(), resolve_io_error); - if let ResolveError::IOError(io_error) = resolve_io_error { - // fix for https://github.com/web-infra-dev/rspack/issues/4564 - let std_io_error: io::Error = io_error.into(); - assert_eq!(std_io_error.kind(), ErrorKind::Interrupted); - assert_eq!(std_io_error.to_string(), error_string); - assert_eq!( - format!("{std_io_error:?}"), - r#"Custom { kind: Interrupted, error: "IOError occurred" }"# - ); - } -} diff --git a/src/file_system.rs b/src/file_system.rs deleted file mode 100644 index 04d177de..00000000 --- a/src/file_system.rs +++ /dev/null @@ -1,133 +0,0 @@ -use std::{ - fs, io, - path::{Path, PathBuf}, -}; - -/// File System abstraction used for `ResolverGeneric` -pub trait FileSystem: Send + Sync { - /// See [std::fs::read_to_string] - /// - /// # Errors - /// - /// * See [std::fs::read_to_string] - /// ## Warning - /// Use `&Path` instead of a generic `P: AsRef` here, - /// because object safety requirements, it is especially useful, when - /// you want to store multiple `dyn FileSystem` in a `Vec` or use a `ResolverGeneric` in - /// napi env. - fn read_to_string(&self, path: &Path) -> io::Result; - - /// See [std::fs::metadata] - /// - /// # Errors - /// See [std::fs::metadata] - /// ## Warning - /// Use `&Path` instead of a generic `P: AsRef` here, - /// because object safety requirements, it is especially useful, when - /// you want to store multiple `dyn FileSystem` in a `Vec` or use a `ResolverGeneric` in - /// napi env. - fn metadata(&self, path: &Path) -> io::Result; - - /// See [std::fs::symlink_metadata] - /// - /// # Errors - /// - /// See [std::fs::symlink_metadata] - /// ## Warning - /// Use `&Path` instead of a generic `P: AsRef` here, - /// because object safety requirements, it is especially useful, when - /// you want to store multiple `dyn FileSystem` in a `Vec` or use a `ResolverGeneric` in - /// napi env. - fn symlink_metadata(&self, path: &Path) -> io::Result; - - /// See [std::fs::canonicalize] - /// - /// # Errors - /// - /// See [std::fs::read_link] - /// ## Warning - /// Use `&Path` instead of a generic `P: AsRef` here, - /// because object safety requirements, it is especially useful, when - /// you want to store multiple `dyn FileSystem` in a `Vec` or use a `ResolverGeneric` in - /// napi env. - fn canonicalize(&self, path: &Path) -> io::Result; -} - -/// Metadata information about a file -#[derive(Debug, Clone, Copy)] -pub struct FileMetadata { - pub(crate) is_file: bool, - pub(crate) is_dir: bool, - pub(crate) is_symlink: bool, -} - -impl FileMetadata { - pub fn new(is_file: bool, is_dir: bool, is_symlink: bool) -> Self { - Self { is_file, is_dir, is_symlink } - } -} - -impl From for FileMetadata { - fn from(metadata: fs::Metadata) -> Self { - Self::new(metadata.is_file(), metadata.is_dir(), metadata.is_symlink()) - } -} - -/// Operating System -#[derive(Default)] -pub struct FileSystemOs; - -impl FileSystem for FileSystemOs { - fn read_to_string(&self, path: &Path) -> io::Result { - fs::read_to_string(path) - } - - fn metadata(&self, path: &Path) -> io::Result { - fs::metadata(path).map(FileMetadata::from) - } - - fn symlink_metadata(&self, path: &Path) -> io::Result { - fs::symlink_metadata(path).map(FileMetadata::from) - } - - fn canonicalize(&self, path: &Path) -> io::Result { - #[cfg(not(target_os = "wasi"))] - { - dunce::canonicalize(path) - } - #[cfg(target_os = "wasi")] - { - let meta = fs::symlink_metadata(path)?; - if meta.file_type().is_symlink() { - let link = fs::read_link(path)?; - let mut path_buf = path.to_path_buf(); - path_buf.pop(); - for segment in link.iter() { - match segment.to_str() { - Some("..") => { - path_buf.pop(); - } - Some(".") | None => {} - Some(seg) => { - // Need to trim the extra \0 introduces by rust std rust-lang/rust#123727 - path_buf.push(seg.trim_end_matches('\0')); - } - } - } - Ok(path_buf) - } else { - Ok(path.to_path_buf()) - } - } - } -} - -#[test] -fn metadata() { - let meta = FileMetadata { is_file: true, is_dir: true, is_symlink: true }; - assert_eq!( - format!("{meta:?}"), - "FileMetadata { is_file: true, is_dir: true, is_symlink: true }" - ); - let _ = meta; -} diff --git a/src/lib.rs b/src/lib.rs deleted file mode 100644 index 40c51359..00000000 --- a/src/lib.rs +++ /dev/null @@ -1,1672 +0,0 @@ -//! # Oxc Resolver -//! -//! Node.js [CommonJS][cjs] and [ECMAScript][esm] Module Resolution. -//! -//! Released on [crates.io](https://crates.io/crates/oxc_resolver) and [npm](https://www.npmjs.com/package/oxc-resolver). -//! -//! A module resolution is the process of finding the file referenced by a module specifier in -//! `import "specifier"` or `require("specifier")`. -//! -//! All [configuration options](ResolveOptions) are aligned with webpack's [enhanced-resolve]. -//! -//! ## Terminology -//! -//! ### Specifier -//! -//! For [CommonJS modules][cjs], -//! the specifier is the string passed to the `require` function. e.g. `"id"` in `require("id")`. -//! -//! For [ECMAScript modules][esm], -//! the specifier of an `import` statement is the string after the `from` keyword, -//! e.g. `'specifier'` in `import 'specifier'` or `import { sep } from 'specifier'`. -//! Specifiers are also used in export from statements, and as the argument to an `import()` expression. -//! -//! This is also named "request" in some places. -//! -//! ## References: -//! -//! * Algorithm adapted from Node.js [CommonJS Module Resolution Algorithm] and [ECMAScript Module Resolution Algorithm]. -//! * Tests are ported from [enhanced-resolve]. -//! * Some code is adapted from [parcel-resolver]. -//! * The documentation is copied from [webpack's resolve configuration](https://webpack.js.org/configuration/resolve). -//! -//! [enhanced-resolve]: https://github.com/webpack/enhanced-resolve -//! [CommonJS Module Resolution Algorithm]: https://nodejs.org/api/modules.html#all-together -//! [ECMAScript Module Resolution Algorithm]: https://nodejs.org/api/esm.html#resolution-algorithm-specification -//! [parcel-resolver]: https://github.com/parcel-bundler/parcel/blob/v2/packages/utils/node-resolver-rs -//! [cjs]: https://nodejs.org/api/modules.html -//! [esm]: https://nodejs.org/api/esm.html -//! -//! ## Feature flags -#![cfg_attr(feature = "document-features", doc = document_features::document_features!())] -#![cfg_attr(docsrs, feature(doc_auto_cfg))] -//! -//! ## Example -//! -//! ```rust,ignore -#![doc = include_str!("../examples/resolver.rs")] -//! ``` - -mod builtins; -mod cache; -mod context; -mod error; -mod file_system; -mod options; -mod package_json; -mod path; -mod resolution; -mod specifier; -mod tsconfig; - -#[cfg(test)] -mod tests; - -use std::{ - borrow::Cow, - cmp::Ordering, - ffi::OsStr, - fmt, - path::{Component, Path, PathBuf}, - sync::Arc, -}; - -use rustc_hash::FxHashSet; -use serde_json::Value as JSONValue; - -pub use crate::{ - builtins::NODEJS_BUILTINS, - error::{JSONError, ResolveError, SpecifierError}, - file_system::{FileMetadata, FileSystem}, - options::{ - Alias, AliasValue, EnforceExtension, ResolveOptions, Restriction, TsconfigOptions, - TsconfigReferences, - }, - package_json::PackageJson, - resolution::Resolution, -}; -use crate::{ - cache::{Cache, CachedPath}, - context::ResolveContext as Ctx, - file_system::FileSystemOs, - package_json::JSONMap, - path::{PathUtil, SLASH_START}, - specifier::Specifier, - tsconfig::ExtendsField, - tsconfig::{ProjectReference, TsConfig}, -}; - -type ResolveResult = Result, ResolveError>; - -/// Context returned from the [Resolver::resolve_with_context] API -#[derive(Debug, Default, Clone)] -pub struct ResolveContext { - /// Files that was found on file system - pub file_dependencies: FxHashSet, - - /// Dependencies that was not found on file system - pub missing_dependencies: FxHashSet, -} - -/// Resolver with the current operating system as the file system -pub type Resolver = ResolverGeneric; - -/// Generic implementation of the resolver, can be configured by the [FileSystem] trait -pub struct ResolverGeneric { - options: ResolveOptions, - cache: Arc>, -} - -impl fmt::Debug for ResolverGeneric { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - self.options.fmt(f) - } -} - -impl Default for ResolverGeneric { - fn default() -> Self { - Self::new(ResolveOptions::default()) - } -} - -impl ResolverGeneric { - pub fn new(options: ResolveOptions) -> Self { - Self { options: options.sanitize(), cache: Arc::new(Cache::new(Fs::default())) } - } -} - -impl ResolverGeneric { - pub fn new_with_file_system(file_system: Fs, options: ResolveOptions) -> Self { - Self { cache: Arc::new(Cache::new(file_system)), options: options.sanitize() } - } - - /// Clone the resolver using the same underlying cache. - #[must_use] - pub fn clone_with_options(&self, options: ResolveOptions) -> Self { - Self { options: options.sanitize(), cache: Arc::clone(&self.cache) } - } - - /// Returns the options. - pub fn options(&self) -> &ResolveOptions { - &self.options - } - - /// Clear the underlying cache. - pub fn clear_cache(&self) { - self.cache.clear(); - } - - /// Resolve `specifier` at an absolute `path`. - /// - /// A specifier is the string passed to require or import, i.e. `require("specifier")` or `import "specifier"`. - /// - /// `path` must be an **absolute** path to a directory where the specifier is resolved against. - /// For CommonJS modules, it is the `__dirname` variable that contains the absolute path to the folder containing current module. - /// For ECMAScript modules, it is the value of `import.meta.url`. - /// - /// # Errors - /// - /// * See [ResolveError] - pub fn resolve>( - &self, - path: P, - specifier: &str, - ) -> Result { - let mut ctx = Ctx::default(); - self.resolve_tracing(path.as_ref(), specifier, &mut ctx) - } - - /// Resolve `specifier` at absolute `path` with [ResolveContext] - /// - /// # Errors - /// - /// * See [ResolveError] - pub fn resolve_with_context>( - &self, - path: P, - specifier: &str, - resolve_context: &mut ResolveContext, - ) -> Result { - let mut ctx = Ctx::default(); - ctx.init_file_dependencies(); - let result = self.resolve_tracing(path.as_ref(), specifier, &mut ctx); - if let Some(deps) = &mut ctx.file_dependencies { - resolve_context.file_dependencies.extend(deps.drain(..)); - } - if let Some(deps) = &mut ctx.missing_dependencies { - resolve_context.missing_dependencies.extend(deps.drain(..)); - } - result - } - - /// Wrap `resolve_impl` with `tracing` information - fn resolve_tracing( - &self, - path: &Path, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - let span = tracing::debug_span!("resolve", path = ?path, specifier = specifier); - let _enter = span.enter(); - let r = self.resolve_impl(path, specifier, ctx); - match &r { - Ok(r) => { - tracing::debug!(options = ?self.options, path = ?path, specifier = specifier, ret = ?r.path); - } - Err(err) => { - tracing::debug!(options = ?self.options, path = ?path, specifier = specifier, err = ?err); - } - }; - r - } - - fn resolve_impl( - &self, - path: &Path, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - ctx.with_fully_specified(self.options.fully_specified); - let cached_path = self.cache.value(path); - let cached_path = self.require(&cached_path, specifier, ctx)?; - let path = self.load_realpath(&cached_path)?; - // enhanced-resolve: restrictions - self.check_restrictions(&path)?; - let package_json = cached_path.find_package_json(&self.cache.fs, &self.options, ctx)?; - if let Some(package_json) = &package_json { - // path must be inside the package. - debug_assert!(path.starts_with(package_json.directory())); - } - Ok(Resolution { - path, - query: ctx.query.take(), - fragment: ctx.fragment.take(), - package_json, - }) - } - - /// require(X) from module at path Y - /// - /// X: specifier - /// Y: path - /// - /// - fn require( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - ctx.test_for_infinite_recursion()?; - - // enhanced-resolve: parse - let (parsed, try_fragment_as_path) = self.load_parse(cached_path, specifier, ctx)?; - if let Some(path) = try_fragment_as_path { - return Ok(path); - } - - self.require_without_parse(cached_path, parsed.path(), ctx) - } - - fn require_without_parse( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - // tsconfig-paths - if let Some(path) = self.load_tsconfig_paths(cached_path, specifier, &mut Ctx::default())? { - return Ok(path); - } - - // enhanced-resolve: try alias - if let Some(path) = self.load_alias(cached_path, specifier, &self.options.alias, ctx)? { - return Ok(path); - } - - let result = match Path::new(specifier).components().next() { - // 2. If X begins with '/' - Some(Component::RootDir | Component::Prefix(_)) => { - self.require_absolute(cached_path, specifier, ctx) - } - // 3. If X begins with './' or '/' or '../' - Some(Component::CurDir | Component::ParentDir) => { - self.require_relative(cached_path, specifier, ctx) - } - // 4. If X begins with '#' - Some(Component::Normal(_)) if specifier.as_bytes()[0] == b'#' => { - self.require_hash(cached_path, specifier, ctx) - } - _ => { - // 1. If X is a core module, - // a. return the core module - // b. STOP - self.require_core(specifier)?; - - // (ESM) 5. Otherwise, - // Note: specifier is now a bare specifier. - // Set resolved the result of PACKAGE_RESOLVE(specifier, parentURL). - self.require_bare(cached_path, specifier, ctx) - } - }; - - result.or_else(|err| { - if err.is_ignore() { - return Err(err); - } - // enhanced-resolve: try fallback - self.load_alias(cached_path, specifier, &self.options.fallback, ctx) - .and_then(|value| value.ok_or(err)) - }) - } - - // PACKAGE_RESOLVE(packageSpecifier, parentURL) - // 3. If packageSpecifier is a Node.js builtin module name, then - // 1. Return the string "node:" concatenated with packageSpecifier. - fn require_core(&self, specifier: &str) -> Result<(), ResolveError> { - if self.options.builtin_modules { - let starts_with_node = specifier.starts_with("node:"); - if starts_with_node || NODEJS_BUILTINS.binary_search(&specifier).is_ok() { - let mut specifier = specifier.to_string(); - if !starts_with_node { - specifier = format!("node:{specifier}"); - } - return Err(ResolveError::Builtin(specifier)); - } - } - Ok(()) - } - - fn require_absolute( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - // Make sure only path prefixes gets called - debug_assert!(Path::new(specifier) - .components() - .next() - .is_some_and(|c| matches!(c, Component::RootDir | Component::Prefix(_)))); - if !self.options.prefer_relative && self.options.prefer_absolute { - if let Ok(path) = self.load_package_self_or_node_modules(cached_path, specifier, ctx) { - return Ok(path); - } - } - if let Some(path) = self.load_roots(specifier, ctx) { - return Ok(path); - } - // 2. If X begins with '/' - // a. set Y to be the file system root - let path = self.cache.value(Path::new(specifier)); - if let Some(path) = self.load_as_file_or_directory(&path, specifier, ctx)? { - return Ok(path); - } - Err(ResolveError::NotFound(specifier.to_string())) - } - - // 3. If X begins with './' or '/' or '../' - fn require_relative( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - // Make sure only relative or normal paths gets called - debug_assert!(Path::new(specifier).components().next().is_some_and(|c| matches!( - c, - Component::CurDir | Component::ParentDir | Component::Normal(_) - ))); - let path = cached_path.path().normalize_with(specifier); - let cached_path = self.cache.value(&path); - // a. LOAD_AS_FILE(Y + X) - // b. LOAD_AS_DIRECTORY(Y + X) - if let Some(path) = self.load_as_file_or_directory(&cached_path, specifier, ctx)? { - return Ok(path); - } - // c. THROW "not found" - Err(ResolveError::NotFound(specifier.to_string())) - } - - fn require_hash( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - debug_assert_eq!(specifier.chars().next(), Some('#')); - // a. LOAD_PACKAGE_IMPORTS(X, dirname(Y)) - if let Some(path) = self.load_package_imports(cached_path, specifier, ctx)? { - return Ok(path); - } - self.load_package_self_or_node_modules(cached_path, specifier, ctx) - } - - fn require_bare( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - // Make sure no other path prefixes gets called - debug_assert!(Path::new(specifier) - .components() - .next() - .is_some_and(|c| matches!(c, Component::Normal(_)))); - if self.options.prefer_relative { - if let Ok(path) = self.require_relative(cached_path, specifier, ctx) { - return Ok(path); - } - } - self.load_package_self_or_node_modules(cached_path, specifier, ctx) - } - - /// enhanced-resolve: ParsePlugin. - /// - /// 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`. - /// - /// - fn load_parse<'s>( - &self, - cached_path: &CachedPath, - specifier: &'s str, - ctx: &mut Ctx, - ) -> Result<(Specifier<'s>, Option), ResolveError> { - let parsed = Specifier::parse(specifier).map_err(ResolveError::Specifier)?; - ctx.with_query_fragment(parsed.query, parsed.fragment); - - // There is an edge-case where a request with # can be a path or a fragment -> try both - if ctx.fragment.is_some() && ctx.query.is_none() { - let specifier = parsed.path(); - let fragment = ctx.fragment.take().unwrap(); - let path = format!("{specifier}{fragment}"); - if let Ok(path) = self.require_without_parse(cached_path, &path, ctx) { - return Ok((parsed, Some(path))); - } - ctx.fragment.replace(fragment); - } - Ok((parsed, None)) - } - - fn load_package_self_or_node_modules( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - let (_, subpath) = Self::parse_package_specifier(specifier); - if subpath.is_empty() { - ctx.with_fully_specified(false); - } - // 5. LOAD_PACKAGE_SELF(X, dirname(Y)) - if let Some(path) = self.load_package_self(cached_path, specifier, ctx)? { - return Ok(path); - } - // 6. LOAD_NODE_MODULES(X, dirname(Y)) - if let Some(path) = self.load_node_modules(cached_path, specifier, ctx)? { - return Ok(path); - } - // 7. THROW "not found" - Err(ResolveError::NotFound(specifier.to_string())) - } - - /// LOAD_PACKAGE_IMPORTS(X, DIR) - fn load_package_imports( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - // 1. Find the closest package scope SCOPE to DIR. - // 2. If no scope was found, return. - let Some(package_json) = - cached_path.find_package_json(&self.cache.fs, &self.options, ctx)? - else { - return Ok(None); - }; - // 3. If the SCOPE/package.json "imports" is null or undefined, return. - // 4. let MATCH = PACKAGE_IMPORTS_RESOLVE(X, pathToFileURL(SCOPE), ["node", "require"]) defined in the ESM resolver. - if let Some(path) = self.package_imports_resolve(specifier, &package_json, ctx)? { - // 5. RESOLVE_ESM_MATCH(MATCH). - return self.resolve_esm_match(specifier, &path, ctx); - } - Ok(None) - } - - fn load_as_file(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - // enhanced-resolve feature: extension_alias - if let Some(path) = self.load_extension_alias(cached_path, ctx)? { - return Ok(Some(path)); - } - if self.options.enforce_extension.is_disabled() { - // 1. If X is a file, load X as its file extension format. STOP - if let Some(path) = self.load_alias_or_file(cached_path, ctx)? { - return Ok(Some(path)); - } - } - // 2. If X.js is a file, load X.js as JavaScript text. STOP - // 3. If X.json is a file, parse X.json to a JavaScript Object. STOP - // 4. If X.node is a file, load X.node as binary addon. STOP - if let Some(path) = - self.load_extensions(cached_path.path(), &self.options.extensions, ctx)? - { - return Ok(Some(path)); - } - Ok(None) - } - - fn load_as_directory(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - // TODO: Only package.json is supported, so warn about having other values - // Checking for empty files is needed for omitting checks on package.json - // 1. If X/package.json is a file, - if !self.options.description_files.is_empty() { - // a. Parse X/package.json, and look for "main" field. - if let Some(package_json) = - cached_path.package_json(&self.cache.fs, &self.options, ctx)? - { - // b. If "main" is a falsy value, GOTO 2. - for main_field in package_json.main_fields(&self.options.main_fields) { - // c. let M = X + (json main field) - let main_field_path = cached_path.path().normalize_with(main_field); - // d. LOAD_AS_FILE(M) - let cached_path = self.cache.value(&main_field_path); - if let Some(path) = self.load_as_file(&cached_path, ctx)? { - return Ok(Some(path)); - } - // e. LOAD_INDEX(M) - if let Some(path) = self.load_index(&cached_path, ctx)? { - return Ok(Some(path)); - } - } - // f. LOAD_INDEX(X) DEPRECATED - // g. THROW "not found" - } - } - // 2. LOAD_INDEX(X) - self.load_index(cached_path, ctx) - } - - fn load_as_file_or_directory( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - if self.options.resolve_to_context { - return Ok(cached_path.is_dir(&self.cache.fs, ctx).then(|| cached_path.clone())); - } - if !specifier.ends_with('/') { - if let Some(path) = self.load_as_file(cached_path, ctx)? { - return Ok(Some(path)); - } - } - if cached_path.is_dir(&self.cache.fs, ctx) { - if let Some(path) = self.load_as_directory(cached_path, ctx)? { - return Ok(Some(path)); - } - } - Ok(None) - } - - fn load_extensions(&self, path: &Path, extensions: &[String], ctx: &mut Ctx) -> ResolveResult { - if ctx.fully_specified { - return Ok(None); - } - let path = path.as_os_str(); - for extension in extensions { - let mut path_with_extension = path.to_os_string(); - path_with_extension.reserve_exact(extension.len()); - path_with_extension.push(extension); - let cached_path = self.cache.value(Path::new(&path_with_extension)); - if let Some(path) = self.load_alias_or_file(&cached_path, ctx)? { - return Ok(Some(path)); - } - } - Ok(None) - } - - fn load_realpath(&self, cached_path: &CachedPath) -> Result { - if self.options.symlinks { - cached_path.realpath(&self.cache.fs).map_err(ResolveError::from) - } else { - Ok(cached_path.to_path_buf()) - } - } - - fn check_restrictions(&self, path: &Path) -> Result<(), ResolveError> { - // https://github.com/webpack/enhanced-resolve/blob/a998c7d218b7a9ec2461fc4fddd1ad5dd7687485/lib/RestrictionsPlugin.js#L19-L24 - fn is_inside(path: &Path, parent: &Path) -> bool { - if !path.starts_with(parent) { - return false; - } - if path.as_os_str().len() == parent.as_os_str().len() { - return true; - } - path.strip_prefix(parent).is_ok_and(|p| p == Path::new("./")) - } - for restriction in &self.options.restrictions { - match restriction { - Restriction::Path(restricted_path) => { - if !is_inside(path, restricted_path) { - return Err(ResolveError::Restriction( - path.to_path_buf(), - restricted_path.clone(), - )); - } - } - Restriction::RegExp(_) => { - return Err(ResolveError::Unimplemented("Restriction with regex")) - } - } - } - Ok(()) - } - - fn load_index(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - for main_file in &self.options.main_files { - let main_path = cached_path.path().normalize_with(main_file); - let cached_path = self.cache.value(&main_path); - if self.options.enforce_extension.is_disabled() { - if let Some(path) = self.load_alias_or_file(&cached_path, ctx)? { - return Ok(Some(path)); - } - } - // 1. If X/index.js is a file, load X/index.js as JavaScript text. STOP - // 2. If X/index.json is a file, parse X/index.json to a JavaScript object. STOP - // 3. If X/index.node is a file, load X/index.node as binary addon. STOP - if let Some(path) = - self.load_extensions(cached_path.path(), &self.options.extensions, ctx)? - { - return Ok(Some(path)); - } - } - Ok(None) - } - - fn load_alias_or_file(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - if let Some(package_json) = - cached_path.find_package_json(&self.cache.fs, &self.options, ctx)? - { - if let Some(path) = self.load_browser_field(cached_path, None, &package_json, ctx)? { - return Ok(Some(path)); - } - } - // enhanced-resolve: try file as alias - let alias_specifier = cached_path.path().to_string_lossy(); - if let Some(path) = - self.load_alias(cached_path, &alias_specifier, &self.options.alias, ctx)? - { - return Ok(Some(path)); - } - if cached_path.is_file(&self.cache.fs, ctx) { - return Ok(Some(cached_path.clone())); - } - Ok(None) - } - - fn load_node_modules( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - let (package_name, subpath) = Self::parse_package_specifier(specifier); - // 1. let DIRS = NODE_MODULES_PATHS(START) - // 2. for each DIR in DIRS: - for module_name in &self.options.modules { - for cached_path in std::iter::successors(Some(cached_path), |p| p.parent()) { - // Skip if /path/to/node_modules does not exist - if !cached_path.is_dir(&self.cache.fs, ctx) { - continue; - } - - let Some(cached_path) = self.get_module_directory(cached_path, module_name, ctx) - else { - continue; - }; - // Optimize node_modules lookup by inspecting whether the package exists - // From LOAD_PACKAGE_EXPORTS(X, DIR) - // 1. Try to interpret X as a combination of NAME and SUBPATH where the name - // may have a @scope/ prefix and the subpath begins with a slash (`/`). - if !package_name.is_empty() { - let package_path = cached_path.path().normalize_with(package_name); - let cached_path = self.cache.value(&package_path); - // Try foo/node_modules/package_name - if cached_path.is_dir(&self.cache.fs, ctx) { - // a. LOAD_PACKAGE_EXPORTS(X, DIR) - if let Some(path) = - self.load_package_exports(specifier, subpath, &cached_path, ctx)? - { - return Ok(Some(path)); - } - } else { - // foo/node_modules/package_name is not a directory, so useless to check inside it - if !subpath.is_empty() { - continue; - } - // Skip if the directory lead to the scope package does not exist - // i.e. `foo/node_modules/@scope` is not a directory for `foo/node_modules/@scope/package` - if package_name.starts_with('@') { - if let Some(path) = cached_path.parent() { - if !path.is_dir(&self.cache.fs, ctx) { - continue; - } - } - } - } - } - - // Try as file or directory for all other cases - // b. LOAD_AS_FILE(DIR/X) - // c. LOAD_AS_DIRECTORY(DIR/X) - let node_module_file = cached_path.path().normalize_with(specifier); - let cached_path = self.cache.value(&node_module_file); - if let Some(path) = self.load_as_file_or_directory(&cached_path, specifier, ctx)? { - return Ok(Some(path)); - } - } - } - Ok(None) - } - - fn get_module_directory( - &self, - cached_path: &CachedPath, - module_name: &str, - ctx: &mut Ctx, - ) -> Option { - if cached_path.path().ends_with(module_name) { - Some(cached_path.clone()) - } else if module_name == "node_modules" { - cached_path.cached_node_modules(&self.cache, ctx) - } else { - cached_path.module_directory(module_name, &self.cache, ctx) - } - } - - fn load_package_exports( - &self, - specifier: &str, - subpath: &str, - cached_path: &CachedPath, - ctx: &mut Ctx, - ) -> ResolveResult { - // 2. If X does not match this pattern or DIR/NAME/package.json is not a file, - // return. - let Some(package_json) = cached_path.package_json(&self.cache.fs, &self.options, ctx)? - else { - return Ok(None); - }; - // 3. Parse DIR/NAME/package.json, and look for "exports" field. - // 4. If "exports" is null or undefined, return. - // 5. let MATCH = PACKAGE_EXPORTS_RESOLVE(pathToFileURL(DIR/NAME), "." + SUBPATH, - // `package.json` "exports", ["node", "require"]) defined in the ESM resolver. - // Note: The subpath is not prepended with a dot on purpose - for exports in package_json.exports_fields(&self.options.exports_fields) { - if let Some(path) = self.package_exports_resolve( - cached_path.path(), - &format!(".{subpath}"), - exports, - ctx, - )? { - // 6. RESOLVE_ESM_MATCH(MATCH) - return self.resolve_esm_match(specifier, &path, ctx); - }; - } - Ok(None) - } - - fn load_package_self( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - // 1. Find the closest package scope SCOPE to DIR. - // 2. If no scope was found, return. - let Some(package_json) = - cached_path.find_package_json(&self.cache.fs, &self.options, ctx)? - else { - return Ok(None); - }; - // 3. If the SCOPE/package.json "exports" is null or undefined, return. - // 4. If the SCOPE/package.json "name" is not the first segment of X, return. - if let Some(subpath) = package_json - .name - .as_ref() - .and_then(|package_name| Self::strip_package_name(specifier, package_name)) - { - // 5. let MATCH = PACKAGE_EXPORTS_RESOLVE(pathToFileURL(SCOPE), - // "." + X.slice("name".length), `package.json` "exports", ["node", "require"]) - // defined in the ESM resolver. - let package_url = package_json.directory(); - // Note: The subpath is not prepended with a dot on purpose - // because `package_exports_resolve` matches subpath without the leading dot. - for exports in package_json.exports_fields(&self.options.exports_fields) { - if let Some(cached_path) = - self.package_exports_resolve(package_url, &format!(".{subpath}"), exports, ctx)? - { - // 6. RESOLVE_ESM_MATCH(MATCH) - return self.resolve_esm_match(specifier, &cached_path, ctx); - } - } - } - self.load_browser_field(cached_path, Some(specifier), &package_json, ctx) - } - - /// RESOLVE_ESM_MATCH(MATCH) - fn resolve_esm_match( - &self, - specifier: &str, - cached_path: &CachedPath, - ctx: &mut Ctx, - ) -> ResolveResult { - // 1. let RESOLVED_PATH = fileURLToPath(MATCH) - // 2. If the file at RESOLVED_PATH exists, load RESOLVED_PATH as its extension format. STOP - // - // Non-compliant ESM can result in a directory, so directory is tried as well. - if let Some(path) = self.load_as_file_or_directory(cached_path, "", ctx)? { - return Ok(Some(path)); - } - // 3. THROW "not found" - Err(ResolveError::NotFound(specifier.to_string())) - } - - /// enhanced-resolve: AliasFieldPlugin for [ResolveOptions::alias_fields] - fn load_browser_field( - &self, - cached_path: &CachedPath, - module_specifier: Option<&str>, - package_json: &PackageJson, - ctx: &mut Ctx, - ) -> ResolveResult { - let path = cached_path.path(); - let Some(new_specifier) = package_json.resolve_browser_field( - path, - module_specifier, - &self.options.alias_fields, - )? - else { - return Ok(None); - }; - // Abort when resolving recursive module - if module_specifier.is_some_and(|s| s == new_specifier) { - return Ok(None); - } - if ctx.resolving_alias.as_ref().is_some_and(|s| s == new_specifier) { - // Complete when resolving to self `{"./a.js": "./a.js"}` - if new_specifier.strip_prefix("./").filter(|s| path.ends_with(Path::new(s))).is_some() { - return if cached_path.is_file(&self.cache.fs, ctx) { - Ok(Some(cached_path.clone())) - } else { - Err(ResolveError::NotFound(new_specifier.to_string())) - }; - } - return Err(ResolveError::Recursion); - } - ctx.with_resolving_alias(new_specifier.to_string()); - ctx.with_fully_specified(false); - let cached_path = self.cache.value(package_json.directory()); - self.require(&cached_path, new_specifier, ctx).map(Some) - } - - /// enhanced-resolve: AliasPlugin for [ResolveOptions::alias] and [ResolveOptions::fallback]. - fn load_alias( - &self, - cached_path: &CachedPath, - specifier: &str, - aliases: &Alias, - ctx: &mut Ctx, - ) -> ResolveResult { - for (alias_key_raw, specifiers) in aliases { - let alias_key = if let Some(alias_key) = alias_key_raw.strip_suffix('$') { - if alias_key != specifier { - continue; - } - alias_key - } else { - let strip_package_name = Self::strip_package_name(specifier, alias_key_raw); - if strip_package_name.is_none() { - continue; - } - alias_key_raw - }; - // It should stop resolving when all of the tried alias values - // failed to resolve. - // - let mut should_stop = false; - for r in specifiers { - match r { - AliasValue::Path(alias_value) => { - if let Some(path) = self.load_alias_value( - cached_path, - alias_key, - alias_value, - specifier, - ctx, - &mut should_stop, - )? { - return Ok(Some(path)); - } - } - AliasValue::Ignore => { - let path = cached_path.path().normalize_with(alias_key); - return Err(ResolveError::Ignored(path)); - } - } - } - if should_stop { - return Err(ResolveError::NotFound(specifier.to_string())); - } - } - Ok(None) - } - - fn load_alias_value( - &self, - cached_path: &CachedPath, - alias_key: &str, - alias_value: &str, - request: &str, - ctx: &mut Ctx, - should_stop: &mut bool, - ) -> ResolveResult { - if request != alias_value - && !request.strip_prefix(alias_value).is_some_and(|prefix| prefix.starts_with('/')) - { - let tail = &request[alias_key.len()..]; - - let new_specifier = if tail.is_empty() { - Cow::Borrowed(alias_value) - } else { - let alias_value = Path::new(alias_value).normalize(); - // Must not append anything to alias_value if it is a file. - let alias_value_cached_path = self.cache.value(&alias_value); - if alias_value_cached_path.is_file(&self.cache.fs, ctx) { - return Ok(None); - } - - // Remove the leading slash so the final path is concatenated. - let tail = tail.trim_start_matches(SLASH_START); - let normalized = alias_value.normalize_with(tail); - Cow::Owned(normalized.to_string_lossy().to_string()) - }; - - *should_stop = true; - ctx.with_fully_specified(false); - return match self.require(cached_path, new_specifier.as_ref(), ctx) { - Err(ResolveError::NotFound(_)) => Ok(None), - Ok(path) => return Ok(Some(path)), - Err(err) => return Err(err), - }; - } - Ok(None) - } - - /// Given an extension alias map `{".js": [".ts", "js"]}`, - /// load the mapping instead of the provided extension - /// - /// This is an enhanced-resolve feature - /// - /// # Errors - /// - /// * [ResolveError::ExtensionAlias]: When all of the aliased extensions are not found - fn load_extension_alias(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - let Some(path_extension) = cached_path.path().extension() else { - return Ok(None); - }; - let Some((_, extensions)) = self - .options - .extension_alias - .iter() - .find(|(ext, _)| OsStr::new(ext.trim_start_matches('.')) == path_extension) - else { - return Ok(None); - }; - let path = cached_path.path().with_extension(""); - ctx.with_fully_specified(false); - if let Some(path) = self.load_extensions(&path, extensions, ctx)? { - return Ok(Some(path)); - } - Err(ResolveError::ExtensionAlias) - } - - /// enhanced-resolve: RootsPlugin - /// - /// A list of directories where requests of server-relative URLs (starting with '/') are resolved, - /// defaults to context configuration option. - /// - /// On non-Windows systems these requests are resolved as an absolute path first. - fn load_roots(&self, specifier: &str, ctx: &mut Ctx) -> Option { - if !self.options.roots.is_empty() { - if let Some(specifier) = specifier.strip_prefix(SLASH_START) { - for root in &self.options.roots { - let cached_path = self.cache.value(root); - if let Ok(path) = self.require_relative(&cached_path, specifier, ctx) { - return Some(path); - } - } - } - } - None - } - - fn load_tsconfig_paths( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - let Some(tsconfig_options) = &self.options.tsconfig else { - return Ok(None); - }; - let tsconfig = self.load_tsconfig( - /* root */ true, - &tsconfig_options.config_file, - &tsconfig_options.references, - )?; - let paths = tsconfig.resolve(cached_path.path(), specifier); - for path in paths { - let cached_path = self.cache.value(&path); - if let Ok(path) = self.require_relative(&cached_path, ".", ctx) { - return Ok(Some(path)); - } - } - Ok(None) - } - - fn load_tsconfig( - &self, - root: bool, - path: &Path, - references: &TsconfigReferences, - ) -> Result, ResolveError> { - self.cache.tsconfig(root, path, |tsconfig| { - let directory = self.cache.value(tsconfig.directory()); - tracing::trace!(tsconfig = ?tsconfig, "load_tsconfig"); - - // Extend tsconfig - if let Some(extends) = &tsconfig.extends { - let extended_tsconfig_paths = match extends { - ExtendsField::Single(s) => { - vec![self.get_extended_tsconfig_path(&directory, tsconfig, s)?] - } - ExtendsField::Multiple(specifiers) => specifiers - .iter() - .map(|s| self.get_extended_tsconfig_path(&directory, tsconfig, s)) - .collect::, ResolveError>>()?, - }; - for extended_tsconfig_path in extended_tsconfig_paths { - let extended_tsconfig = self.load_tsconfig( - /* root */ false, - &extended_tsconfig_path, - &TsconfigReferences::Disabled, - )?; - tsconfig.extend_tsconfig(&extended_tsconfig); - } - } - - // Load project references - match references { - TsconfigReferences::Disabled => { - tsconfig.references.drain(..); - } - TsconfigReferences::Auto => {} - TsconfigReferences::Paths(paths) => { - tsconfig.references = paths - .iter() - .map(|path| ProjectReference { path: path.clone(), tsconfig: None }) - .collect(); - } - } - if !tsconfig.references.is_empty() { - let directory = tsconfig.directory().to_path_buf(); - for reference in &mut tsconfig.references { - let reference_tsconfig_path = directory.normalize_with(&reference.path); - let tsconfig = self.cache.tsconfig( - /* root */ true, - &reference_tsconfig_path, - |_| Ok(()), - )?; - reference.tsconfig.replace(tsconfig); - } - } - Ok(()) - }) - } - - fn get_extended_tsconfig_path( - &self, - directory: &CachedPath, - tsconfig: &TsConfig, - specifier: &str, - ) -> Result { - match specifier.as_bytes().first() { - None => Err(ResolveError::Specifier(SpecifierError::Empty(specifier.to_string()))), - Some(b'/') => Ok(PathBuf::from(specifier)), - Some(b'.') => Ok(tsconfig.directory().normalize_with(specifier)), - _ => self - .clone_with_options(ResolveOptions { - description_files: vec![], - extensions: vec![".json".into()], - main_files: vec!["tsconfig.json".into()], - ..ResolveOptions::default() - }) - .load_package_self_or_node_modules(directory, specifier, &mut Ctx::default()) - .map(|p| p.to_path_buf()) - .map_err(|err| match err { - ResolveError::NotFound(_) => { - ResolveError::TsconfigNotFound(PathBuf::from(specifier)) - } - _ => err, - }), - } - } - - /// PACKAGE_RESOLVE(packageSpecifier, parentURL) - fn package_resolve( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - let (package_name, subpath) = Self::parse_package_specifier(specifier); - - // 3. If packageSpecifier is a Node.js builtin module name, then - // 1. Return the string "node:" concatenated with packageSpecifier. - self.require_core(package_name)?; - - // 11. While parentURL is not the file system root, - for module_name in &self.options.modules { - for cached_path in std::iter::successors(Some(cached_path), |p| p.parent()) { - // 1. Let packageURL be the URL resolution of "node_modules/" concatenated with packageSpecifier, relative to parentURL. - let Some(cached_path) = self.get_module_directory(cached_path, module_name, ctx) - else { - continue; - }; - // 2. Set parentURL to the parent folder URL of parentURL. - let package_path = cached_path.path().normalize_with(package_name); - let cached_path = self.cache.value(&package_path); - // 3. If the folder at packageURL does not exist, then - // 1. Continue the next loop iteration. - if cached_path.is_dir(&self.cache.fs, ctx) { - // 4. Let pjson be the result of READ_PACKAGE_JSON(packageURL). - if let Some(package_json) = - cached_path.package_json(&self.cache.fs, &self.options, ctx)? - { - // 5. If pjson is not null and pjson.exports is not null or undefined, then - // 1. Return the result of PACKAGE_EXPORTS_RESOLVE(packageURL, packageSubpath, pjson.exports, defaultConditions). - for exports in package_json.exports_fields(&self.options.exports_fields) { - if let Some(path) = self.package_exports_resolve( - cached_path.path(), - &format!(".{subpath}"), - exports, - ctx, - )? { - return Ok(Some(path)); - } - } - // 6. Otherwise, if packageSubpath is equal to ".", then - if subpath == "." { - // 1. If pjson.main is a string, then - for main_field in package_json.main_fields(&self.options.main_fields) { - // 1. Return the URL resolution of main in packageURL. - let path = cached_path.path().normalize_with(main_field); - let cached_path = self.cache.value(&path); - if cached_path.is_file(&self.cache.fs, ctx) { - return Ok(Some(cached_path)); - } - } - } - } - let subpath = format!(".{subpath}"); - ctx.with_fully_specified(false); - return self.require(&cached_path, &subpath, ctx).map(Some); - } - } - } - - Err(ResolveError::NotFound(specifier.to_string())) - } - - /// PACKAGE_EXPORTS_RESOLVE(packageURL, subpath, exports, conditions) - fn package_exports_resolve( - &self, - package_url: &Path, - subpath: &str, - exports: &JSONValue, - ctx: &mut Ctx, - ) -> ResolveResult { - let conditions = &self.options.condition_names; - // 1. If exports is an Object with both a key starting with "." and a key not starting with ".", throw an Invalid Package Configuration error. - if let JSONValue::Object(map) = exports { - let mut has_dot = false; - let mut without_dot = false; - for key in map.keys() { - has_dot = has_dot || key.starts_with(|s| s == '.' || s == '#'); - without_dot = without_dot || !key.starts_with(|s| s == '.' || s == '#'); - if has_dot && without_dot { - return Err(ResolveError::InvalidPackageConfig( - package_url.join("package.json"), - )); - } - } - } - // 2. If subpath is equal to ".", then - // Note: subpath is not prepended with a dot when passed in. - if subpath == "." { - // enhanced-resolve appends query and fragment when resolving exports field - // https://github.com/webpack/enhanced-resolve/blob/a998c7d218b7a9ec2461fc4fddd1ad5dd7687485/lib/ExportsFieldPlugin.js#L57-L62 - // This is only need when querying the main export, otherwise ctx is passed through. - if ctx.query.is_some() || ctx.fragment.is_some() { - let query = ctx.query.clone().unwrap_or_default(); - let fragment = ctx.fragment.clone().unwrap_or_default(); - return Err(ResolveError::PackagePathNotExported( - format!("./{}{query}{fragment}", subpath.trim_start_matches('.')), - package_url.join("package.json"), - )); - } - // 1. Let mainExport be undefined. - let main_export = match exports { - // 2. If exports is a String or Array, or an Object containing no keys starting with ".", then - JSONValue::String(_) | JSONValue::Array(_) => { - // 1. Set mainExport to exports. - Some(exports) - } - // 3. Otherwise if exports is an Object containing a "." property, then - JSONValue::Object(map) => { - // 1. Set mainExport to exports["."]. - map.get(".").map_or_else( - || { - if map.keys().any(|key| key.starts_with("./") || key.starts_with('#')) { - None - } else { - Some(exports) - } - }, - Some, - ) - } - _ => None, - }; - // 4. If mainExport is not undefined, then - if let Some(main_export) = main_export { - // 1. Let resolved be the result of PACKAGE_TARGET_RESOLVE( packageURL, mainExport, null, false, conditions). - let resolved = self.package_target_resolve( - package_url, - ".", - main_export, - None, - /* is_imports */ false, - conditions, - ctx, - )?; - // 2. If resolved is not null or undefined, return resolved. - if let Some(path) = resolved { - return Ok(Some(path)); - } - } - } - // 3. Otherwise, if exports is an Object and all keys of exports start with ".", then - if let JSONValue::Object(exports) = exports { - // 1. Let matchKey be the string "./" concatenated with subpath. - // Note: `package_imports_exports_resolve` does not require the leading dot. - let match_key = &subpath; - // 2. Let resolved be the result of PACKAGE_IMPORTS_EXPORTS_RESOLVE( matchKey, exports, packageURL, false, conditions). - if let Some(path) = self.package_imports_exports_resolve( - match_key, - exports, - package_url, - /* is_imports */ false, - conditions, - ctx, - )? { - // 3. If resolved is not null or undefined, return resolved. - return Ok(Some(path)); - } - } - // 4. Throw a Package Path Not Exported error. - Err(ResolveError::PackagePathNotExported( - subpath.to_string(), - package_url.join("package.json"), - )) - } - - /// PACKAGE_IMPORTS_RESOLVE(specifier, parentURL, conditions) - fn package_imports_resolve( - &self, - specifier: &str, - package_json: &PackageJson, - ctx: &mut Ctx, - ) -> Result, ResolveError> { - // 1. Assert: specifier begins with "#". - debug_assert!(specifier.starts_with('#'), "{specifier}"); - // 2. If specifier is exactly equal to "#" or starts with "#/", then - // 1. Throw an Invalid Module Specifier error. - // 3. Let packageURL be the result of LOOKUP_PACKAGE_SCOPE(parentURL). - // 4. If packageURL is not null, then - - // 1. Let pjson be the result of READ_PACKAGE_JSON(packageURL). - // 2. If pjson.imports is a non-null Object, then - - // 1. Let resolved be the result of PACKAGE_IMPORTS_EXPORTS_RESOLVE( specifier, pjson.imports, packageURL, true, conditions). - let mut has_imports = false; - for imports in package_json.imports_fields(&self.options.imports_fields) { - if !has_imports { - has_imports = true; - // TODO: fill in test case for this case - if specifier == "#" || specifier.starts_with("#/") { - return Err(ResolveError::InvalidModuleSpecifier( - specifier.to_string(), - package_json.path.clone(), - )); - } - } - if let Some(path) = self.package_imports_exports_resolve( - specifier, - imports, - package_json.directory(), - /* is_imports */ true, - &self.options.condition_names, - ctx, - )? { - // 2. If resolved is not null or undefined, return resolved. - return Ok(Some(path)); - } - } - - // 5. Throw a Package Import Not Defined error. - if has_imports { - Err(ResolveError::PackageImportNotDefined( - specifier.to_string(), - package_json.path.clone(), - )) - } else { - Ok(None) - } - } - - /// PACKAGE_IMPORTS_EXPORTS_RESOLVE(matchKey, matchObj, packageURL, isImports, conditions) - fn package_imports_exports_resolve( - &self, - match_key: &str, - match_obj: &JSONMap, - package_url: &Path, - is_imports: bool, - conditions: &[String], - ctx: &mut Ctx, - ) -> ResolveResult { - // enhanced-resolve behaves differently, it throws - // Error: CachedPath to directories is not possible with the exports field (specifier was ./dist/) - if match_key.ends_with('/') { - return Ok(None); - } - // 1. If matchKey is a key of matchObj and does not contain "*", then - if !match_key.contains('*') { - // 1. Let target be the value of matchObj[matchKey]. - if let Some(target) = match_obj.get(match_key) { - // 2. Return the result of PACKAGE_TARGET_RESOLVE(packageURL, target, null, isImports, conditions). - return self.package_target_resolve( - package_url, - match_key, - target, - None, - is_imports, - conditions, - ctx, - ); - } - } - - let mut best_target = None; - let mut best_match = ""; - let mut best_key = ""; - // 2. Let expansionKeys be the list of keys of matchObj containing only a single "*", sorted by the sorting function PATTERN_KEY_COMPARE which orders in descending order of specificity. - // 3. For each key expansionKey in expansionKeys, do - for (expansion_key, target) in match_obj { - if expansion_key.starts_with("./") || expansion_key.starts_with('#') { - // 1. Let patternBase be the substring of expansionKey up to but excluding the first "*" character. - if let Some((pattern_base, pattern_trailer)) = expansion_key.split_once('*') { - // 2. If matchKey starts with but is not equal to patternBase, then - if match_key.starts_with(pattern_base) - // 1. Let patternTrailer be the substring of expansionKey from the index after the first "*" character. - && !pattern_trailer.contains('*') - // 2. If patternTrailer has zero length, or if matchKey ends with patternTrailer and the length of matchKey is greater than or equal to the length of expansionKey, then - && (pattern_trailer.is_empty() - || (match_key.len() >= expansion_key.len() - && match_key.ends_with(pattern_trailer))) - && Self::pattern_key_compare(best_key, expansion_key).is_gt() - { - // 1. Let target be the value of matchObj[expansionKey]. - best_target = Some(target); - // 2. Let patternMatch be the substring of matchKey starting at the index of the length of patternBase up to the length of matchKey minus the length of patternTrailer. - best_match = - &match_key[pattern_base.len()..match_key.len() - pattern_trailer.len()]; - best_key = expansion_key; - } - } else if expansion_key.ends_with('/') - && match_key.starts_with(expansion_key) - && Self::pattern_key_compare(best_key, expansion_key).is_gt() - { - // TODO: [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./dist/" in the "exports" field module resolution of the package at xxx/package.json. - best_target = Some(target); - best_match = &match_key[expansion_key.len()..]; - best_key = expansion_key; - } - } - } - if let Some(best_target) = best_target { - // 3. Return the result of PACKAGE_TARGET_RESOLVE(packageURL, target, patternMatch, isImports, conditions). - return self.package_target_resolve( - package_url, - best_key, - best_target, - Some(best_match), - is_imports, - conditions, - ctx, - ); - } - // 4. Return null. - Ok(None) - } - - /// PACKAGE_TARGET_RESOLVE(packageURL, target, patternMatch, isImports, conditions) - #[allow(clippy::too_many_arguments)] - fn package_target_resolve( - &self, - package_url: &Path, - target_key: &str, - target: &JSONValue, - pattern_match: Option<&str>, - is_imports: bool, - conditions: &[String], - ctx: &mut Ctx, - ) -> ResolveResult { - fn normalize_string_target<'a>( - target_key: &'a str, - target: &'a str, - pattern_match: Option<&'a str>, - package_url: &Path, - ) -> Result, ResolveError> { - let target = if let Some(pattern_match) = pattern_match { - if !target_key.contains('*') && !target.contains('*') { - // enhanced-resolve behaviour - // TODO: [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./dist/" in the "exports" field module resolution of the package at xxx/package.json. - if target_key.ends_with('/') && target.ends_with('/') { - Cow::Owned(format!("{target}{pattern_match}")) - } else { - return Err(ResolveError::InvalidPackageConfigDirectory( - package_url.join("package.json"), - )); - } - } else { - Cow::Owned(target.replace('*', pattern_match)) - } - } else { - Cow::Borrowed(target) - }; - Ok(target) - } - - match target { - // 1. If target is a String, then - JSONValue::String(target) => { - // 1. If target does not start with "./", then - if !target.starts_with("./") { - // 1. If isImports is false, or if target starts with "../" or "/", or if target is a valid URL, then - if !is_imports || target.starts_with("../") || target.starts_with('/') { - // 1. Throw an Invalid Package Target error. - return Err(ResolveError::InvalidPackageTarget( - target.to_string(), - target_key.to_string(), - package_url.join("package.json"), - )); - } - // 2. If patternMatch is a String, then - // 1. Return PACKAGE_RESOLVE(target with every instance of "*" replaced by patternMatch, packageURL + "/"). - let target = - normalize_string_target(target_key, target, pattern_match, package_url)?; - let package_url = self.cache.value(package_url); - // // 3. Return PACKAGE_RESOLVE(target, packageURL + "/"). - return self.package_resolve(&package_url, &target, ctx); - } - - // 2. If target split on "/" or "\" contains any "", ".", "..", or "node_modules" segments after the first "." segment, case insensitive and including percent encoded variants, throw an Invalid Package Target error. - // 3. Let resolvedTarget be the URL resolution of the concatenation of packageURL and target. - // 4. Assert: resolvedTarget is contained in packageURL. - // 5. If patternMatch is null, then - let target = - normalize_string_target(target_key, target, pattern_match, package_url)?; - if Path::new(target.as_ref()).is_invalid_exports_target() { - return Err(ResolveError::InvalidPackageTarget( - target.to_string(), - target_key.to_string(), - package_url.join("package.json"), - )); - } - let resolved_target = package_url.normalize_with(target.as_ref()); - // 6. If patternMatch split on "/" or "\" contains any "", ".", "..", or "node_modules" segments, case insensitive and including percent encoded variants, throw an Invalid Module Specifier error. - // 7. Return the URL resolution of resolvedTarget with every instance of "*" replaced with patternMatch. - let value = self.cache.value(&resolved_target); - return Ok(Some(value)); - } - // 2. Otherwise, if target is a non-null Object, then - JSONValue::Object(target) => { - // 1. If exports contains any index property keys, as defined in ECMA-262 6.1.7 Array Index, throw an Invalid Package Configuration error. - // 2. For each property p of target, in object insertion order as, - for (key, target_value) in target { - // 1. If p equals "default" or conditions contains an entry for p, then - if key == "default" || conditions.contains(key) { - // 1. Let targetValue be the value of the p property in target. - // 2. Let resolved be the result of PACKAGE_TARGET_RESOLVE( packageURL, targetValue, patternMatch, isImports, conditions). - let resolved = self.package_target_resolve( - package_url, - target_key, - target_value, - pattern_match, - is_imports, - conditions, - ctx, - ); - // 3. If resolved is equal to undefined, continue the loop. - if let Some(path) = resolved? { - // 4. Return resolved. - return Ok(Some(path)); - } - } - } - // 3. Return undefined. - return Ok(None); - } - // 3. Otherwise, if target is an Array, then - JSONValue::Array(targets) => { - // 1. If _target.length is zero, return null. - if targets.is_empty() { - // Note: return PackagePathNotExported has the same effect as return because there are no matches. - return Err(ResolveError::PackagePathNotExported( - pattern_match.unwrap_or(".").to_string(), - package_url.join("package.json"), - )); - } - // 2. For each item targetValue in target, do - for (i, target_value) in targets.iter().enumerate() { - // 1. Let resolved be the result of PACKAGE_TARGET_RESOLVE( packageURL, targetValue, patternMatch, isImports, conditions), continuing the loop on any Invalid Package Target error. - let resolved = self.package_target_resolve( - package_url, - target_key, - target_value, - pattern_match, - is_imports, - conditions, - ctx, - ); - - if resolved.is_err() && i == targets.len() { - return resolved; - } - - // 2. If resolved is undefined, continue the loop. - if let Ok(Some(path)) = resolved { - // 3. Return resolved. - return Ok(Some(path)); - } - } - // 3. Return or throw the last fallback resolution null return or error. - // Note: see `resolved.is_err() && i == targets.len()` - } - _ => {} - } - // 4. Otherwise, if target is null, return null. - Ok(None) - // 5. Otherwise throw an Invalid Package Target error. - } - - // Returns (module, subpath) - // https://github.com/nodejs/node/blob/8f0f17e1e3b6c4e58ce748e06343c5304062c491/lib/internal/modules/esm/resolve.js#L688 - fn parse_package_specifier(specifier: &str) -> (&str, &str) { - let mut separator_index = specifier.as_bytes().iter().position(|b| *b == b'/'); - // let mut valid_package_name = true; - // let mut is_scoped = false; - if specifier.starts_with('@') { - // is_scoped = true; - if separator_index.is_none() || specifier.is_empty() { - // valid_package_name = false; - } else if let Some(index) = &separator_index { - separator_index = specifier[*index + 1..] - .as_bytes() - .iter() - .position(|b| *b == b'/') - .map(|i| i + *index + 1); - } - } - let package_name = - separator_index.map_or(specifier, |separator_index| &specifier[..separator_index]); - - // TODO: https://github.com/nodejs/node/blob/8f0f17e1e3b6c4e58ce748e06343c5304062c491/lib/internal/modules/esm/resolve.js#L705C1-L714C1 - // Package name cannot have leading . and cannot have percent-encoding or - // \\ separators. - // if (RegExpPrototypeExec(invalidPackageNameRegEx, packageName) !== null) - // validPackageName = false; - - // if (!validPackageName) { - // throw new ERR_INVALID_MODULE_SPECIFIER( - // specifier, 'is not a valid package name', fileURLToPath(base)); - // } - let package_subpath = - separator_index.map_or("", |separator_index| &specifier[separator_index..]); - (package_name, package_subpath) - } - - /// PATTERN_KEY_COMPARE(keyA, keyB) - fn pattern_key_compare(key_a: &str, key_b: &str) -> Ordering { - if key_a.is_empty() { - return Ordering::Greater; - } - // 1. Assert: keyA ends with "/" or contains only a single "*". - debug_assert!(key_a.ends_with('/') || key_a.match_indices('*').count() == 1, "{key_a}"); - // 2. Assert: keyB ends with "/" or contains only a single "*". - debug_assert!(key_b.ends_with('/') || key_b.match_indices('*').count() == 1, "{key_b}"); - // 3. Let baseLengthA be the index of "*" in keyA plus one, if keyA contains "*", or the length of keyA otherwise. - let a_pos = key_a.chars().position(|c| c == '*'); - let base_length_a = a_pos.map_or(key_a.len(), |p| p + 1); - // 4. Let baseLengthB be the index of "*" in keyB plus one, if keyB contains "*", or the length of keyB otherwise. - let b_pos = key_b.chars().position(|c| c == '*'); - let base_length_b = b_pos.map_or(key_b.len(), |p| p + 1); - // 5. If baseLengthA is greater than baseLengthB, return -1. - if base_length_a > base_length_b { - return Ordering::Less; - } - // 6. If baseLengthB is greater than baseLengthA, return 1. - if base_length_b > base_length_a { - return Ordering::Greater; - } - // 7. If keyA does not contain "*", return 1. - if !key_a.contains('*') { - return Ordering::Greater; - } - // 8. If keyB does not contain "*", return -1. - if !key_b.contains('*') { - return Ordering::Less; - } - // 9. If the length of keyA is greater than the length of keyB, return -1. - if key_a.len() > key_b.len() { - return Ordering::Less; - } - // 10. If the length of keyB is greater than the length of keyA, return 1. - if key_b.len() > key_a.len() { - return Ordering::Greater; - } - // 11. Return 0. - Ordering::Equal - } - - fn strip_package_name<'a>(specifier: &'a str, package_name: &'a str) -> Option<&'a str> { - specifier - .strip_prefix(package_name) - .filter(|tail| tail.is_empty() || tail.starts_with(SLASH_START)) - } -} diff --git a/src/options.rs b/src/options.rs deleted file mode 100644 index f473a133..00000000 --- a/src/options.rs +++ /dev/null @@ -1,623 +0,0 @@ -use std::path::Path; -use std::{fmt, path::PathBuf}; - -/// Module Resolution Options -/// -/// Options are directly ported from [enhanced-resolve](https://github.com/webpack/enhanced-resolve#resolver-options). -/// -/// See [webpack resolve](https://webpack.js.org/configuration/resolve/) for information and examples -#[derive(Debug, Clone)] -pub struct ResolveOptions { - /// Path to TypeScript configuration file. - /// - /// Default `None` - pub tsconfig: Option, - - /// Create aliases to import or require certain modules more easily. - /// - /// An alias is used to replace a whole path or part of a path. - /// For example, to alias a commonly used `src/` folders: `vec![("@/src"), vec![AliasValue::Path("/path/to/src")]]` - /// - /// A trailing $ can also be added to the given object's keys to signify an exact match. - /// - /// See [webpack's `resolve.alias` documentation](https://webpack.js.org/configuration/resolve/#resolvealias) for a list of use cases. - pub alias: Alias, - - /// A list of alias fields in description files. - /// - /// Specify a field, such as `browser`, to be parsed according to [this specification](https://github.com/defunctzombie/package-browser-field-spec). - /// Can be a path to json object such as `["path", "to", "exports"]`. - /// - /// Default `[]` - pub alias_fields: Vec>, - - /// Condition names for exports field which defines entry points of a package. - /// - /// The key order in the exports field is significant. During condition matching, earlier entries have higher priority and take precedence over later entries. - /// - /// Default `[]` - pub condition_names: Vec, - - /// The JSON files to use for descriptions. (There was once a `bower.json`.) - /// - /// Default `["package.json"]` - pub description_files: Vec, - - /// Set to [EnforceExtension::Enabled] for [ESM Mandatory file extensions](https://nodejs.org/api/esm.html#mandatory-file-extensions). - /// - /// If `enforce_extension` is set to [EnforceExtension::Enabled], resolution will not allow extension-less files. - /// This means `require('./foo.js')` will resolve, while `require('./foo')` will not. - /// - /// The default value for `enforce_extension` is [EnforceExtension::Auto], which is changed upon initialization. - /// - /// It changes to [EnforceExtension::Enabled] if [ResolveOptions::extensions] contains an empty string; - /// otherwise, this value changes to [EnforceExtension::Disabled]. - /// - /// Explicitly set the value to [EnforceExtension::Disabled] to disable this automatic behavior. - /// - /// For reference, this behavior is aligned with `enhanced-resolve`. See . - pub enforce_extension: EnforceExtension, - - /// A list of exports fields in description files. - /// - /// Can be a path to a JSON object such as `["path", "to", "exports"]`. - /// - /// Default `[["exports"]]`. - pub exports_fields: Vec>, - - /// Fields from `package.json` which are used to provide the internal requests of a package - /// (requests starting with # are considered internal). - /// - /// Can be a path to a JSON object such as `["path", "to", "imports"]`. - /// - /// Default `[["imports"]]`. - pub imports_fields: Vec>, - - /// An object which maps extension to extension aliases. - /// - /// Default `{}` - pub extension_alias: Vec<(String, Vec)>, - - /// Attempt to resolve these extensions in order. - /// - /// If multiple files share the same name but have different extensions, - /// will resolve the one with the extension listed first in the array and skip the rest. - /// - /// All extensions must have a leading dot. - /// - /// Default `[".js", ".json", ".node"]` - pub extensions: Vec, - - /// Redirect module requests when normal resolving fails. - /// - /// Default `[]` - pub fallback: Alias, - - /// 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). - /// - /// See also webpack configuration [resolve.fullySpecified](https://webpack.js.org/configuration/module/#resolvefullyspecified) - /// - /// Default `false` - pub fully_specified: bool, - - /// A list of main fields in description files - /// - /// Default `["main"]`. - pub main_fields: Vec, - - /// The filename to be used while resolving directories. - /// - /// Default `["index"]` - pub main_files: Vec, - - /// A list of directories to resolve modules from, can be absolute path or folder name. - /// - /// Default `["node_modules"]` - pub modules: Vec, - - /// Resolve to a context instead of a file. - /// - /// Default `false` - pub resolve_to_context: bool, - - /// Prefer to resolve module requests as relative requests instead of using modules from node_modules directories. - /// - /// Default `false` - pub prefer_relative: bool, - - /// Prefer to resolve server-relative urls as absolute paths before falling back to resolve in ResolveOptions::roots. - /// - /// Default `false` - pub prefer_absolute: bool, - - /// A list of resolve restrictions to restrict the paths that a request can be resolved on. - /// - /// Default `[]` - pub restrictions: Vec, - - /// A list of directories where requests of server-relative URLs (starting with '/') are resolved. - /// On non-Windows systems these requests are resolved as an absolute path first. - /// - /// Default `[]` - pub roots: Vec, - - /// Whether to resolve symlinks to their symlinked location. - /// When enabled, symlinked resources are resolved to their real path, not their symlinked location. - /// Note that this may cause module resolution to fail when using tools that symlink packages (like npm link). - /// - /// Default `true` - pub symlinks: bool, - - /// Whether to parse [module.builtinModules](https://nodejs.org/api/module.html#modulebuiltinmodules) or not. - /// For example, "zlib" will throw [crate::ResolveError::Builtin] when set to true. - /// - /// Default `false` - pub builtin_modules: bool, -} - -impl ResolveOptions { - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// - /// let options = ResolveOptions::default().with_condition_names(&["bar"]); - /// assert_eq!(options.condition_names, vec!["bar".to_string()]) - /// ``` - #[must_use] - pub fn with_condition_names(mut self, names: &[&str]) -> Self { - self.condition_names = names.iter().map(ToString::to_string).collect::>(); - self - } - - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// - /// let options = ResolveOptions::default().with_builtin_modules(false); - /// assert_eq!(options.builtin_modules, false) - /// ``` - #[must_use] - pub fn with_builtin_modules(mut self, flag: bool) -> Self { - self.builtin_modules = flag; - self - } - - /// Adds a single root to the options - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_root("foo"); - /// assert_eq!(options.roots, vec![PathBuf::from("foo")]) - /// ``` - #[must_use] - pub fn with_root>(mut self, root: P) -> Self { - self.roots.push(root.as_ref().to_path_buf()); - self - } - - /// Adds a single extension to the list of extensions - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_extension("jsonc"); - /// assert!(options.extensions.contains(&"jsonc".to_string())); - /// ``` - #[must_use] - pub fn with_extension>(mut self, extension: S) -> Self { - self.extensions.push(extension.into()); - self - } - - /// Adds a single main field to the list of fields - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_main_field("something"); - /// assert!(options.main_fields.contains(&"something".to_string())); - /// ``` - #[must_use] - pub fn with_main_field>(mut self, field: S) -> Self { - self.main_fields.push(field.into()); - self - } - - /// Changes how the extension should be treated - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions, EnforceExtension}; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_force_extension(EnforceExtension::Enabled); - /// assert_eq!(options.enforce_extension, EnforceExtension::Enabled); - /// ``` - #[must_use] - pub fn with_force_extension(mut self, enforce_extension: EnforceExtension) -> Self { - self.enforce_extension = enforce_extension; - self - } - - /// Sets the value for [ResolveOptions::fully_specified] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_fully_specified(true); - /// assert_eq!(options.fully_specified, true); - /// ``` - #[must_use] - pub fn with_fully_specified(mut self, fully_specified: bool) -> Self { - self.fully_specified = fully_specified; - self - } - /// Sets the value for [ResolveOptions::prefer_relative] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_prefer_relative(true); - /// assert_eq!(options.prefer_relative, true); - /// ``` - #[must_use] - pub fn with_prefer_relative(mut self, flag: bool) -> Self { - self.prefer_relative = flag; - self - } - /// Sets the value for [ResolveOptions::prefer_absolute] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_prefer_absolute(true); - /// assert_eq!(options.prefer_absolute, true); - /// ``` - #[must_use] - pub fn with_prefer_absolute(mut self, flag: bool) -> Self { - self.prefer_absolute = flag; - self - } - - /// Changes the value of [ResolveOptions::symlinks] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// - /// let options = ResolveOptions::default().with_symbolic_link(false); - /// assert_eq!(options.symlinks, false); - /// ``` - #[must_use] - pub fn with_symbolic_link(mut self, flag: bool) -> Self { - self.symlinks = flag; - self - } - - /// Adds a module to [ResolveOptions::modules] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// - /// let options = ResolveOptions::default().with_module("module"); - /// assert!(options.modules.contains(&"module".to_string())); - /// ``` - #[must_use] - pub fn with_module>(mut self, module: M) -> Self { - self.modules.push(module.into()); - self - } - - /// Adds a main file to [ResolveOptions::main_files] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// - /// let options = ResolveOptions::default().with_main_file("foo"); - /// assert!(options.main_files.contains(&"foo".to_string())); - /// ``` - #[must_use] - pub fn with_main_file>(mut self, module: M) -> Self { - self.main_files.push(module.into()); - self - } - - pub(crate) fn sanitize(mut self) -> Self { - debug_assert!( - self.extensions.iter().filter(|e| !e.is_empty()).all(|e| e.starts_with('.')), - "All extensions must start with a leading dot" - ); - // Set `enforceExtension` to `true` when [ResolveOptions::extensions] contains an empty string. - // See - if self.enforce_extension == EnforceExtension::Auto { - if !self.extensions.is_empty() && self.extensions.iter().any(String::is_empty) { - self.enforce_extension = EnforceExtension::Enabled; - } else { - self.enforce_extension = EnforceExtension::Disabled; - } - } - self - } -} - -/// Value for [ResolveOptions::enforce_extension] -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -pub enum EnforceExtension { - Auto, - Enabled, - Disabled, -} - -impl EnforceExtension { - pub const fn is_auto(&self) -> bool { - matches!(self, Self::Auto) - } - - pub const fn is_enabled(&self) -> bool { - matches!(self, Self::Enabled) - } - - pub const fn is_disabled(&self) -> bool { - matches!(self, Self::Disabled) - } -} - -/// Alias for [ResolveOptions::alias] and [ResolveOptions::fallback] -pub type Alias = Vec<(String, Vec)>; - -/// Alias Value for [ResolveOptions::alias] and [ResolveOptions::fallback] -#[derive(Debug, Clone, Hash, PartialEq, Eq)] -pub enum AliasValue { - /// The path value - Path(String), - - /// The `false` value - Ignore, -} - -impl From for AliasValue -where - S: Into, -{ - fn from(value: S) -> Self { - Self::Path(value.into()) - } -} - -/// Value for [ResolveOptions::restrictions] -#[derive(Debug, Clone)] -pub enum Restriction { - Path(PathBuf), - RegExp(String), -} - -/// Tsconfig Options for [ResolveOptions::tsconfig] -/// -/// Derived from [tsconfig-paths-webpack-plugin](https://github.com/dividab/tsconfig-paths-webpack-plugin#options) -#[derive(Debug, Clone)] -pub struct TsconfigOptions { - /// Allows you to specify where to find the TypeScript configuration file. - /// You may provide - /// * a relative path to the configuration file. It will be resolved relative to cwd. - /// * an absolute path to the configuration file. - pub config_file: PathBuf, - - /// Support for Typescript Project References. - pub references: TsconfigReferences, -} - -/// Configuration for [TsconfigOptions::references] -#[derive(Debug, Clone)] -pub enum TsconfigReferences { - Disabled, - /// Use the `references` field from tsconfig of `config_file`. - Auto, - /// Manually provided relative or absolute path. - Paths(Vec), -} - -impl Default for ResolveOptions { - fn default() -> Self { - Self { - tsconfig: None, - alias: vec![], - alias_fields: vec![], - condition_names: vec![], - description_files: vec!["package.json".into()], - enforce_extension: EnforceExtension::Auto, - extension_alias: vec![], - exports_fields: vec![vec!["exports".into()]], - imports_fields: vec![vec!["imports".into()]], - extensions: vec![".js".into(), ".json".into(), ".node".into()], - fallback: vec![], - fully_specified: false, - main_fields: vec!["main".into()], - main_files: vec!["index".into()], - modules: vec!["node_modules".into()], - resolve_to_context: false, - prefer_relative: false, - prefer_absolute: false, - restrictions: vec![], - roots: vec![], - symlinks: true, - builtin_modules: false, - } - } -} - -// For tracing -impl fmt::Display for ResolveOptions { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - if let Some(tsconfig) = &self.tsconfig { - write!(f, "tsconfig:{tsconfig:?},")?; - } - if !self.alias.is_empty() { - write!(f, "alias:{:?},", self.alias)?; - } - if !self.alias_fields.is_empty() { - write!(f, "alias_fields:{:?},", self.alias_fields)?; - } - if !self.condition_names.is_empty() { - write!(f, "condition_names:{:?},", self.condition_names)?; - } - if self.enforce_extension.is_enabled() { - write!(f, "enforce_extension:{:?},", self.enforce_extension)?; - } - if !self.exports_fields.is_empty() { - write!(f, "exports_fields:{:?},", self.exports_fields)?; - } - if !self.imports_fields.is_empty() { - write!(f, "imports_fields:{:?},", self.imports_fields)?; - } - if !self.extension_alias.is_empty() { - write!(f, "extension_alias:{:?},", self.extension_alias)?; - } - if !self.extensions.is_empty() { - write!(f, "extensions:{:?},", self.extensions)?; - } - if !self.fallback.is_empty() { - write!(f, "fallback:{:?},", self.fallback)?; - } - if self.fully_specified { - write!(f, "fully_specified:{:?},", self.fully_specified)?; - } - if !self.main_fields.is_empty() { - write!(f, "main_fields:{:?},", self.main_fields)?; - } - if !self.main_files.is_empty() { - write!(f, "main_files:{:?},", self.main_files)?; - } - if !self.modules.is_empty() { - write!(f, "modules:{:?},", self.modules)?; - } - if self.resolve_to_context { - write!(f, "resolve_to_context:{:?},", self.resolve_to_context)?; - } - if self.prefer_relative { - write!(f, "prefer_relative:{:?},", self.prefer_relative)?; - } - if self.prefer_absolute { - write!(f, "prefer_absolute:{:?},", self.prefer_absolute)?; - } - if !self.restrictions.is_empty() { - write!(f, "restrictions:{:?},", self.restrictions)?; - } - if !self.roots.is_empty() { - write!(f, "roots:{:?},", self.roots)?; - } - if self.symlinks { - write!(f, "symlinks:{:?},", self.symlinks)?; - } - if self.builtin_modules { - write!(f, "builtin_modules:{:?},", self.builtin_modules)?; - } - Ok(()) - } -} - -#[cfg(test)] -mod test { - use super::{ - AliasValue, EnforceExtension, ResolveOptions, Restriction, TsconfigOptions, - TsconfigReferences, - }; - use std::path::PathBuf; - - #[test] - fn enforce_extension() { - assert!(EnforceExtension::Auto.is_auto()); - assert!(!EnforceExtension::Enabled.is_auto()); - assert!(!EnforceExtension::Disabled.is_auto()); - - assert!(!EnforceExtension::Auto.is_enabled()); - assert!(EnforceExtension::Enabled.is_enabled()); - assert!(!EnforceExtension::Disabled.is_enabled()); - - assert!(!EnforceExtension::Auto.is_disabled()); - assert!(!EnforceExtension::Enabled.is_disabled()); - assert!(EnforceExtension::Disabled.is_disabled()); - } - - #[test] - fn display() { - let options = ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: PathBuf::from("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - alias: vec![("a".into(), vec![AliasValue::Ignore])], - alias_fields: vec![vec!["browser".into()]], - condition_names: vec!["require".into()], - enforce_extension: EnforceExtension::Enabled, - extension_alias: vec![(".js".into(), vec![".ts".into()])], - exports_fields: vec![vec!["exports".into()]], - imports_fields: vec![vec!["imports".into()]], - fallback: vec![("fallback".into(), vec![AliasValue::Ignore])], - fully_specified: true, - resolve_to_context: true, - prefer_relative: true, - prefer_absolute: true, - restrictions: vec![Restriction::Path(PathBuf::from("restrictions"))], - roots: vec![PathBuf::from("roots")], - builtin_modules: true, - ..ResolveOptions::default() - }; - - let expected = r#"tsconfig:TsconfigOptions { config_file: "tsconfig.json", references: Auto },alias:[("a", [Ignore])],alias_fields:[["browser"]],condition_names:["require"],enforce_extension:Enabled,exports_fields:[["exports"]],imports_fields:[["imports"]],extension_alias:[(".js", [".ts"])],extensions:[".js", ".json", ".node"],fallback:[("fallback", [Ignore])],fully_specified:true,main_fields:["main"],main_files:["index"],modules:["node_modules"],resolve_to_context:true,prefer_relative:true,prefer_absolute:true,restrictions:[Path("restrictions")],roots:["roots"],symlinks:true,builtin_modules:true,"#; - assert_eq!(format!("{options}"), expected); - - let options = ResolveOptions { - alias: vec![], - alias_fields: vec![], - builtin_modules: false, - condition_names: vec![], - description_files: vec![], - enforce_extension: EnforceExtension::Disabled, - exports_fields: vec![], - extension_alias: vec![], - extensions: vec![], - fallback: vec![], - fully_specified: false, - imports_fields: vec![], - main_fields: vec![], - main_files: vec![], - modules: vec![], - prefer_absolute: false, - prefer_relative: false, - resolve_to_context: false, - restrictions: vec![], - roots: vec![], - symlinks: false, - tsconfig: None, - }; - - assert_eq!(format!("{options}"), ""); - } -} diff --git a/src/package_json.rs b/src/package_json.rs deleted file mode 100644 index 73901faa..00000000 --- a/src/package_json.rs +++ /dev/null @@ -1,207 +0,0 @@ -//! package.json definitions -//! -//! Code related to export field are copied from [Parcel's resolver](https://github.com/parcel-bundler/parcel/blob/v2/packages/utils/node-resolver-rs/src/package_json.rs) -use std::path::{Path, PathBuf}; - -use serde_json::Value as JSONValue; - -use crate::{path::PathUtil, ResolveError}; - -pub type JSONMap = serde_json::Map; - -/// Deserialized package.json -#[derive(Debug, Default)] -pub struct PackageJson { - /// Path to `package.json`. Contains the `package.json` filename. - pub path: PathBuf, - - /// Realpath to `package.json`. Contains the `package.json` filename. - pub realpath: PathBuf, - - /// The "name" field defines your package's name. - /// The "name" field can be used in addition to the "exports" field to self-reference a package using its name. - /// - /// - pub name: Option, - - raw_json: std::sync::Arc, -} - -impl PackageJson { - /// # Panics - /// # Errors - pub(crate) fn parse( - path: PathBuf, - realpath: PathBuf, - json: &str, - ) -> Result { - let mut raw_json: JSONValue = serde_json::from_str(json)?; - let mut package_json = Self::default(); - - if let Some(json_object) = raw_json.as_object_mut() { - // Remove large fields that are useless for pragmatic use. - #[cfg(feature = "package_json_raw_json_api")] - { - json_object.remove("description"); - json_object.remove("keywords"); - json_object.remove("scripts"); - json_object.remove("dependencies"); - json_object.remove("devDependencies"); - json_object.remove("peerDependencies"); - json_object.remove("optionalDependencies"); - } - - // Add name. - package_json.name = - json_object.get("name").and_then(|field| field.as_str()).map(ToString::to_string); - } - - package_json.path = path; - package_json.realpath = realpath; - package_json.raw_json = std::sync::Arc::new(raw_json); - Ok(package_json) - } - - fn get_value_by_path<'a>( - fields: &'a serde_json::Map, - path: &[String], - ) -> Option<&'a JSONValue> { - if path.is_empty() { - return None; - } - let mut value = fields.get(&path[0])?; - for key in path.iter().skip(1) { - if let Some(inner_value) = value.as_object().and_then(|o| o.get(key)) { - value = inner_value; - } else { - return None; - } - } - Some(value) - } - - /// Raw serde json value of `package.json`. - /// - /// This is currently used in Rspack for: - /// * getting the `sideEffects` field - /// * query in - search on GitHub indicates query on the `type` field. - /// - /// To reduce overall memory consumption, large fields that useless for pragmatic use are removed. - /// They are: `description`, `keywords`, `scripts`, - /// `dependencies` and `devDependencies`, `peerDependencies`, `optionalDependencies`. - #[cfg(feature = "package_json_raw_json_api")] - pub fn raw_json(&self) -> &std::sync::Arc { - &self.raw_json - } - - /// Directory to `package.json` - /// - /// # Panics - /// - /// * When the package.json path is misconfigured. - pub fn directory(&self) -> &Path { - debug_assert!(self.realpath.file_name().is_some_and(|x| x == "package.json")); - self.realpath.parent().unwrap() - } - - /// The "main" field defines the entry point of a package when imported by name via a node_modules lookup. Its value is a path. - /// - /// When a package has an "exports" field, this will take precedence over the "main" field when importing the package by name. - /// - /// Values are dynamically retrieved from [ResolveOptions::main_fields]. - /// - /// - pub(crate) fn main_fields<'a>( - &'a self, - main_fields: &'a [String], - ) -> impl Iterator + '_ { - main_fields - .iter() - .filter_map(|main_field| self.raw_json.get(main_field)) - .filter_map(|value| value.as_str()) - } - - /// The "exports" field allows defining the entry points of a package when imported by name loaded either via a node_modules lookup or a self-reference to its own name. - /// - /// - pub(crate) fn exports_fields<'a>( - &'a self, - exports_fields: &'a [Vec], - ) -> impl Iterator + '_ { - exports_fields.iter().filter_map(|object_path| { - self.raw_json - .as_object() - .and_then(|json_object| Self::get_value_by_path(json_object, object_path)) - }) - } - - /// In addition to the "exports" field, there is a package "imports" field to create private mappings that only apply to import specifiers from within the package itself. - /// - /// - pub(crate) fn imports_fields<'a>( - &'a self, - imports_fields: &'a [Vec], - ) -> impl Iterator + '_ { - imports_fields.iter().filter_map(|object_path| { - self.raw_json - .as_object() - .and_then(|json_object| Self::get_value_by_path(json_object, object_path)) - .and_then(|value| value.as_object()) - }) - } - - /// The "browser" field is provided by a module author as a hint to javascript bundlers or component tools when packaging modules for client side use. - /// Multiple values are configured by [ResolveOptions::alias_fields]. - /// - /// - fn browser_fields<'a>( - &'a self, - alias_fields: &'a [Vec], - ) -> impl Iterator + '_ { - alias_fields.iter().filter_map(|object_path| { - self.raw_json - .as_object() - .and_then(|json_object| Self::get_value_by_path(json_object, object_path)) - // Only object is valid, all other types are invalid - // https://github.com/webpack/enhanced-resolve/blob/3a28f47788de794d9da4d1702a3a583d8422cd48/lib/AliasFieldPlugin.js#L44-L52 - .and_then(|value| value.as_object()) - }) - } - - /// Resolve the request string for this package.json by looking at the `browser` field. - /// - /// # Errors - /// - /// * Returns [ResolveError::Ignored] for `"path": false` in `browser` field. - pub(crate) fn resolve_browser_field<'a>( - &'a self, - path: &Path, - request: Option<&str>, - alias_fields: &'a [Vec], - ) -> Result, ResolveError> { - for object in self.browser_fields(alias_fields) { - if let Some(request) = request { - if let Some(value) = object.get(request) { - return Self::alias_value(path, value); - } - } else { - let dir = self.path.parent().unwrap(); - for (key, value) in object { - let joined = dir.normalize_with(key); - if joined == path { - return Self::alias_value(path, value); - } - } - } - } - Ok(None) - } - - fn alias_value<'a>(key: &Path, value: &'a JSONValue) -> Result, ResolveError> { - match value { - JSONValue::String(value) => Ok(Some(value.as_str())), - JSONValue::Bool(b) if !b => Err(ResolveError::Ignored(key.to_path_buf())), - _ => Ok(None), - } - } -} diff --git a/src/path.rs b/src/path.rs deleted file mode 100644 index f66fdd76..00000000 --- a/src/path.rs +++ /dev/null @@ -1,132 +0,0 @@ -//! Path Utilities -//! -//! Code adapted from the following libraries -//! * [path-absolutize](https://docs.rs/path-absolutize) -//! * [normalize_path](https://docs.rs/normalize-path) -use std::path::{Component, Path, PathBuf}; - -pub const SLASH_START: &[char; 2] = &['/', '\\']; - -/// Extension trait to add path normalization to std's [`Path`]. -pub trait PathUtil { - /// Normalize this path without performing I/O. - /// - /// All redundant separator and up-level references are collapsed. - /// - /// However, this does not resolve links. - fn normalize(&self) -> PathBuf; - - /// Normalize with subpath assuming this path is normalized without performing I/O. - /// - /// All redundant separator and up-level references are collapsed. - /// - /// However, this does not resolve links. - fn normalize_with>(&self, subpath: P) -> PathBuf; - - /// Defined in ESM PACKAGE_TARGET_RESOLVE - /// If target split on "/" or "\" contains any "", ".", "..", or "node_modules" segments after the first "." segment, case insensitive and including percent encoded variants - fn is_invalid_exports_target(&self) -> bool; -} - -impl PathUtil for Path { - // https://github.com/parcel-bundler/parcel/blob/e0b99c2a42e9109a9ecbd6f537844a1b33e7faf5/packages/utils/node-resolver-rs/src/path.rs#L7 - fn normalize(&self) -> PathBuf { - let mut components = self.components().peekable(); - let mut ret = if let Some(c @ Component::Prefix(..)) = components.peek() { - let buf = PathBuf::from(c.as_os_str()); - components.next(); - buf - } else { - PathBuf::new() - }; - - for component in components { - match component { - Component::Prefix(..) => unreachable!("Path {:?}", self), - Component::RootDir => { - ret.push(component.as_os_str()); - } - Component::CurDir => {} - Component::ParentDir => { - ret.pop(); - } - Component::Normal(c) => { - ret.push(c); - } - } - } - - ret - } - - // https://github.com/parcel-bundler/parcel/blob/e0b99c2a42e9109a9ecbd6f537844a1b33e7faf5/packages/utils/node-resolver-rs/src/path.rs#L37 - fn normalize_with>(&self, subpath: B) -> PathBuf { - let subpath = subpath.as_ref(); - - let mut components = subpath.components(); - - let Some(head) = components.next() else { return subpath.to_path_buf() }; - - if matches!(head, Component::Prefix(..) | Component::RootDir) { - return subpath.to_path_buf(); - } - - let mut ret = self.to_path_buf(); - for component in std::iter::once(head).chain(components) { - match component { - Component::CurDir => {} - Component::ParentDir => { - ret.pop(); - } - Component::Normal(c) => { - ret.push(c); - } - Component::Prefix(..) | Component::RootDir => { - unreachable!("Path {:?} Subpath {:?}", self, subpath) - } - } - } - - ret - } - - fn is_invalid_exports_target(&self) -> bool { - self.components().enumerate().any(|(index, c)| match c { - Component::ParentDir => true, - Component::CurDir => index > 0, - Component::Normal(c) => c.eq_ignore_ascii_case("node_modules"), - _ => false, - }) - } -} - -// https://github.com/webpack/enhanced-resolve/blob/main/test/path.test.js -#[test] -fn is_invalid_exports_target() { - let test_cases = [ - "../a.js", - "../", - "./a/b/../../../c.js", - "./a/b/../../../", - "./../../c.js", - "./../../", - "./a/../b/../../c.js", - "./a/../b/../../", - "./././../", - ]; - - for case in test_cases { - assert!(Path::new(case).is_invalid_exports_target(), "{case}"); - } - - assert!(!Path::new("C:").is_invalid_exports_target()); - assert!(!Path::new("/").is_invalid_exports_target()); -} - -#[test] -fn normalize() { - assert_eq!(Path::new("/foo/.././foo/").normalize(), Path::new("/foo")); - assert_eq!(Path::new("C://").normalize(), Path::new("C://")); - assert_eq!(Path::new("C:").normalize(), Path::new("C:")); - assert_eq!(Path::new(r"\\server\share").normalize(), Path::new(r"\\server\share")); -} diff --git a/src/resolution.rs b/src/resolution.rs deleted file mode 100644 index a3aaa2e7..00000000 --- a/src/resolution.rs +++ /dev/null @@ -1,92 +0,0 @@ -use crate::package_json::PackageJson; -use std::{ - fmt, - path::{Path, PathBuf}, - sync::Arc, -}; - -/// The final path resolution with optional `?query` and `#fragment` -#[derive(Clone)] -pub struct Resolution { - pub(crate) path: PathBuf, - - /// path query `?query`, contains `?`. - pub(crate) query: Option, - - /// path fragment `#query`, contains `#`. - pub(crate) fragment: Option, - - pub(crate) package_json: Option>, -} - -impl fmt::Debug for Resolution { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - f.debug_struct("Resolution") - .field("path", &self.path) - .field("query", &self.query) - .field("fragment", &self.fragment) - .field("package_json", &self.package_json.as_ref().map(|p| &p.path)) - .finish() - } -} - -impl PartialEq for Resolution { - fn eq(&self, other: &Self) -> bool { - self.path == other.path && self.query == other.query && self.fragment == other.fragment - } -} -impl Eq for Resolution {} - -impl Resolution { - /// Returns the path without query and fragment - pub fn path(&self) -> &Path { - &self.path - } - - /// Returns the path without query and fragment - pub fn into_path_buf(self) -> PathBuf { - self.path - } - - /// Returns the path query `?query`, contains the leading `?` - pub fn query(&self) -> Option<&str> { - self.query.as_deref() - } - - /// Returns the path fragment `#fragment`, contains the leading `#` - pub fn fragment(&self) -> Option<&str> { - self.fragment.as_deref() - } - - /// Returns serialized package_json - pub fn package_json(&self) -> Option<&Arc> { - self.package_json.as_ref() - } - - /// Returns the full path with query and fragment - pub fn full_path(&self) -> PathBuf { - let mut path = self.path.clone().into_os_string(); - if let Some(query) = &self.query { - path.push(query); - } - if let Some(fragment) = &self.fragment { - path.push(fragment); - } - PathBuf::from(path) - } -} - -#[test] -fn test() { - let resolution = Resolution { - path: PathBuf::from("foo"), - query: Some("?query".to_string()), - fragment: Some("#fragment".to_string()), - package_json: None, - }; - assert_eq!(resolution.path(), Path::new("foo")); - assert_eq!(resolution.query(), Some("?query")); - assert_eq!(resolution.fragment(), Some("#fragment")); - assert_eq!(resolution.full_path(), PathBuf::from("foo?query#fragment")); - assert_eq!(resolution.into_path_buf(), PathBuf::from("foo")); -} diff --git a/src/specifier.rs b/src/specifier.rs deleted file mode 100644 index 73ed038c..00000000 --- a/src/specifier.rs +++ /dev/null @@ -1,230 +0,0 @@ -use crate::error::SpecifierError; -use std::borrow::Cow; - -#[derive(Debug)] -pub struct Specifier<'a> { - path: Cow<'a, str>, - pub query: Option<&'a str>, - pub fragment: Option<&'a str>, -} - -impl<'a> Specifier<'a> { - pub fn path(&'a self) -> &'a str { - self.path.as_ref() - } - - pub fn parse(specifier: &'a str) -> Result { - if specifier.is_empty() { - return Err(SpecifierError::Empty(specifier.to_string())); - } - let offset = match specifier.as_bytes()[0] { - b'/' | b'.' | b'#' => 1, - _ => 0, - }; - let (path, query, fragment) = Self::parse_query_framgment(specifier, offset); - if path.is_empty() { - return Err(SpecifierError::Empty(specifier.to_string())); - } - Ok(Self { path, query, fragment }) - } - - fn parse_query_framgment( - specifier: &'a str, - skip: usize, - ) -> (Cow<'a, str>, Option<&str>, Option<&str>) { - let mut query_start: Option = None; - let mut fragment_start: Option = None; - - let mut prev = specifier.chars().next().unwrap(); - let mut escaped_indexes = vec![]; - for (i, c) in specifier.char_indices().skip(skip) { - if c == '?' && query_start.is_none() { - query_start = Some(i); - } - if c == '#' { - if prev == '\0' { - escaped_indexes.push(i - 1); - } else { - fragment_start = Some(i); - break; - } - } - prev = c; - } - - let (path, query, fragment) = match (query_start, fragment_start) { - (Some(i), Some(j)) => { - debug_assert!(i < j); - (&specifier[..i], Some(&specifier[i..j]), Some(&specifier[j..])) - } - (Some(i), None) => (&specifier[..i], Some(&specifier[i..]), None), - (None, Some(j)) => (&specifier[..j], None, Some(&specifier[j..])), - _ => (specifier, None, None), - }; - - let path = if escaped_indexes.is_empty() { - Cow::Borrowed(path) - } else { - // Remove the `\0` characters for a legal path. - Cow::Owned( - path.chars() - .enumerate() - .filter_map(|(i, c)| (!escaped_indexes.contains(&i)).then_some(c)) - .collect::(), - ) - }; - - (path, query, fragment) - } -} - -#[cfg(test)] -mod tests { - use super::{Specifier, SpecifierError}; - - #[test] - fn debug() { - let specifier = Specifier::parse("/").unwrap(); - assert_eq!( - format!("{specifier:?}"), - r#"Specifier { path: "/", query: None, fragment: None }"# - ); - } - - #[test] - fn empty() { - let specifiers = ["", "?"]; - for specifier in specifiers { - let error = Specifier::parse(specifier).unwrap_err(); - assert_eq!(error, SpecifierError::Empty(specifier.to_string())); - } - } - - #[test] - fn absolute() -> Result<(), SpecifierError> { - let specifier = "/test?#"; - let parsed = Specifier::parse(specifier)?; - assert_eq!(parsed.path, "/test"); - assert_eq!(parsed.query, Some("?")); - assert_eq!(parsed.fragment, Some("#")); - Ok(()) - } - - #[test] - fn relative() -> Result<(), SpecifierError> { - let specifiers = ["./test", "../test", "../../test"]; - for specifier in specifiers { - let mut r = specifier.to_string(); - r.push_str("?#"); - let parsed = Specifier::parse(&r)?; - assert_eq!(parsed.path, specifier); - assert_eq!(parsed.query, Some("?")); - assert_eq!(parsed.fragment, Some("#")); - } - Ok(()) - } - - #[test] - fn hash() -> Result<(), SpecifierError> { - let specifiers = ["#", "#path"]; - for specifier in specifiers { - let mut r = specifier.to_string(); - r.push_str("?#"); - let parsed = Specifier::parse(&r)?; - assert_eq!(parsed.path, specifier); - assert_eq!(parsed.query, Some("?")); - assert_eq!(parsed.fragment, Some("#")); - } - Ok(()) - } - - #[test] - fn module() -> Result<(), SpecifierError> { - let specifiers = ["module"]; - for specifier in specifiers { - let mut r = specifier.to_string(); - r.push_str("?#"); - let parsed = Specifier::parse(&r)?; - assert_eq!(parsed.path, specifier); - assert_eq!(parsed.query, Some("?")); - assert_eq!(parsed.fragment, Some("#")); - } - Ok(()) - } - - #[test] - fn query_fragment() -> Result<(), SpecifierError> { - let data = [ - ("a?", Some("?"), None), - ("a?query", Some("?query"), None), - ("a?query1?query2", Some("?query1?query2"), None), - ("a?query1?query2?query3", Some("?query1?query2?query3"), None), - ("a#", None, Some("#")), - ("a#b#c", None, Some("#b#c")), - ("a#fragment", None, Some("#fragment")), - ("a?#", Some("?"), Some("#")), - ("a?#fragment", Some("?"), Some("#fragment")), - ("a?query#", Some("?query"), Some("#")), - ("a?query#fragment", Some("?query"), Some("#fragment")), - ("a#fragment?", None, Some("#fragment?")), - ("a#fragment?query", None, Some("#fragment?query")), - ]; - - for (specifier_str, query, fragment) in data { - let specifier = Specifier::parse(specifier_str)?; - assert_eq!(specifier.path, "a", "{specifier_str}"); - assert_eq!(specifier.query, query, "{specifier_str}"); - assert_eq!(specifier.fragment, fragment, "{specifier_str}"); - } - - Ok(()) - } - - #[test] - // https://github.com/webpack/enhanced-resolve/blob/main/test/identifier.test.js - fn enhanced_resolve_edge_cases() -> Result<(), SpecifierError> { - let data = [ - ("path/#", "path/", "", "#"), - ("path/as/?", "path/as/", "?", ""), - ("path/#/?", "path/", "", "#/?"), - ("path/#repo#hash", "path/", "", "#repo#hash"), - ("path/#r#hash", "path/", "", "#r#hash"), - ("path/#repo/#repo2#hash", "path/", "", "#repo/#repo2#hash"), - ("path/#r/#r#hash", "path/", "", "#r/#r#hash"), - ("path/#/not/a/hash?not-a-query", "path/", "", "#/not/a/hash?not-a-query"), - ]; - - for (specifier_str, path, query, fragment) in data { - let specifier = Specifier::parse(specifier_str)?; - assert_eq!(specifier.path, path, "{specifier_str}"); - assert_eq!(specifier.query.unwrap_or(""), query, "{specifier_str}"); - assert_eq!(specifier.fragment.unwrap_or(""), fragment, "{specifier_str}"); - } - - Ok(()) - } - - // https://github.com/webpack/enhanced-resolve/blob/main/test/identifier.test.js - #[test] - fn enhanced_resolve_windows_like() -> Result<(), SpecifierError> { - let data = [ - ("path\\#", "path\\", "", "#"), - ("path\\as\\?", "path\\as\\", "?", ""), - ("path\\#\\?", "path\\", "", "#\\?"), - ("path\\#repo#hash", "path\\", "", "#repo#hash"), - ("path\\#r#hash", "path\\", "", "#r#hash"), - ("path\\#repo\\#repo2#hash", "path\\", "", "#repo\\#repo2#hash"), - ("path\\#r\\#r#hash", "path\\", "", "#r\\#r#hash"), - ("path\\#/not/a/hash?not-a-query", "path\\", "", "#/not/a/hash?not-a-query"), - ]; - - for (specifier_str, path, query, fragment) in data { - let specifier = Specifier::parse(specifier_str)?; - assert_eq!(specifier.path, path, "{specifier_str}"); - assert_eq!(specifier.query.unwrap_or(""), query, "{specifier_str}"); - assert_eq!(specifier.fragment.unwrap_or(""), fragment, "{specifier_str}"); - } - - Ok(()) - } -} diff --git a/src/tests/alias.rs b/src/tests/alias.rs deleted file mode 100644 index 07c615f4..00000000 --- a/src/tests/alias.rs +++ /dev/null @@ -1,280 +0,0 @@ -//! - -use normalize_path::NormalizePath; -use std::path::Path; - -use crate::{AliasValue, Resolution, ResolveContext, ResolveError, ResolveOptions, Resolver}; - -#[test] -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -fn alias() { - use super::memory_fs::MemoryFS; - use crate::ResolverGeneric; - use std::path::{Path, PathBuf}; - - let f = Path::new("/"); - - let file_system = MemoryFS::new(&[ - ("/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", ""), - ("/dashed-name", ""), - ]); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - alias: vec![ - ("aliasA".into(), vec![AliasValue::from("a")]), - ("b$".into(), vec![AliasValue::from("a/index")]), - ("c$".into(), vec![AliasValue::from("/a/index")]), - ( - "multiAlias".into(), - vec![ - AliasValue::from("b"), - AliasValue::from("c"), - AliasValue::from("d"), - AliasValue::from("e"), - AliasValue::from("a"), - ], - ), - ("recursive".into(), vec![AliasValue::from("recursive/dir")]), - ("/d/dir".into(), vec![AliasValue::from("/c/dir")]), - ("/d/index.js".into(), vec![AliasValue::from("/c/index")]), - ("#".into(), vec![AliasValue::from("/c/dir")]), - ("@".into(), vec![AliasValue::from("/c/dir")]), - ("ignored".into(), vec![AliasValue::Ignore]), - // not part of enhanced-resolve, added to make sure query in alias value works - ("alias_query".into(), vec![AliasValue::from("a?query_after")]), - ("alias_fragment".into(), vec![AliasValue::from("a#fragment_after")]), - ("dash".into(), vec![AliasValue::Ignore]), - ("@scope/package-name/file$".into(), vec![AliasValue::from("/c/dir")]), - ], - modules: vec!["/".into()], - ..ResolveOptions::default() - }, - ); - - #[rustfmt::skip] - let pass = [ - ("should resolve a not aliased module 1", "a", "/a/index"), - ("should resolve a not aliased module 2", "a/index", "/a/index"), - ("should resolve a not aliased module 3", "a/dir", "/a/dir/index"), - ("should resolve a not aliased module 4", "a/dir/index", "/a/dir/index"), - ("should resolve an aliased module 1", "aliasA", "/a/index"), - ("should resolve an aliased module 2", "aliasA/index", "/a/index"), - ("should resolve an aliased module 3", "aliasA/dir", "/a/dir/index"), - ("should resolve an aliased module 4", "aliasA/dir/index", "/a/dir/index"), - ("should resolve '#' alias 1", "#", "/c/dir/index"), - ("should resolve '#' alias 2", "#/index", "/c/dir/index"), - ("should resolve '@' alias 1", "@", "/c/dir/index"), - ("should resolve '@' alias 2", "@/index", "/c/dir/index"), - ("should resolve a recursive aliased module 1", "recursive", "/recursive/dir/index"), - ("should resolve a recursive aliased module 2", "recursive/index", "/recursive/dir/index"), - ("should resolve a recursive aliased module 3", "recursive/dir", "/recursive/dir/index"), - ("should resolve a recursive aliased module 4", "recursive/dir/index", "/recursive/dir/index"), - ("should resolve a file aliased module 1", "b", "/a/index"), - ("should resolve a file aliased module 2", "c", "/a/index"), - ("should resolve a file aliased module with a query 1", "b?query", "/a/index?query"), - ("should resolve a file aliased module with a query 2", "c?query", "/a/index?query"), - ("should resolve a path in a file aliased module 1", "b/index", "/b/index"), - ("should resolve a path in a file aliased module 2", "b/dir", "/b/dir/index"), - ("should resolve a path in a file aliased module 3", "b/dir/index", "/b/dir/index"), - ("should resolve a path in a file aliased module 4", "c/index", "/c/index"), - ("should resolve a path in a file aliased module 5", "c/dir", "/c/dir/index"), - ("should resolve a path in a file aliased module 6", "c/dir/index", "/c/dir/index"), - ("should resolve a file aliased file 1", "d", "/c/index"), - ("should resolve a file aliased file 2", "d/dir/index", "/c/dir/index"), - ("should resolve a file in multiple aliased dirs 1", "multiAlias/dir/file", "/e/dir/file"), - ("should resolve a file in multiple aliased dirs 2", "multiAlias/anotherDir", "/e/anotherDir/index"), - // not part of enhanced-resolve, added to make sure query in alias value works - ("should resolve query in alias value", "alias_query?query_before", "/a/index?query_after"), - ("should resolve query in alias value", "alias_fragment#fragment_before", "/a/index#fragment_after"), - ("should resolve dashed name", "dashed-name", "/dashed-name"), - ("should resolve scoped package name with sub dir", "@scope/package-name/file", "/c/dir/index"), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - - #[rustfmt::skip] - let ignore = [ - ("should resolve an ignore module", "ignored", ResolveError::Ignored(f.join("ignored"))) - ]; - - for (comment, request, expected) in ignore { - let resolution = resolver.resolve(f, request); - assert_eq!(resolution, Err(expected), "{comment} {request}"); - } -} - -// Not part of enhanced-resolve -#[test] -fn infinite_recursion() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![ - ("./a".into(), vec![AliasValue::from("./b")]), - ("./b".into(), vec![AliasValue::from("./a")]), - ], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(f, "./a"); - assert_eq!(resolution, Err(ResolveError::Recursion)); -} - -fn check_slash(path: &Path) { - let s = path.to_string_lossy().to_string(); - #[cfg(target_os = "windows")] - { - assert!(!s.contains('/'), "{s}"); - assert!(s.contains('\\'), "{s}"); - } - #[cfg(not(target_os = "windows"))] - { - assert!(s.contains('/'), "{s}"); - assert!(!s.contains('\\'), "{s}"); - } -} - -#[test] -fn absolute_path() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![(f.join("foo").to_str().unwrap().to_string(), vec![AliasValue::Ignore])], - modules: vec![f.clone().to_str().unwrap().to_string()], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(&f, "foo/index"); - assert_eq!(resolution, Err(ResolveError::Ignored(f.join("foo")))); -} - -#[test] -fn system_path() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![("@app".into(), vec![AliasValue::from(f.join("alias").to_string_lossy())])], - ..ResolveOptions::default() - }); - - let specifiers = ["@app/files/a", "@app/files/a.js"]; - - for specifier in specifiers { - let path = resolver.resolve(&f, specifier).map(Resolution::into_path_buf).unwrap(); - assert_eq!(path, f.join("alias/files/a.js")); - check_slash(&path); - } -} - -#[test] -fn alias_is_full_path() { - let f = super::fixture(); - let dir = f.join("foo"); - let dir_str = dir.to_string_lossy().to_string(); - - let resolver = Resolver::new(ResolveOptions { - alias: vec![("@".into(), vec![AliasValue::Path(dir_str.clone())])], - ..ResolveOptions::default() - }); - - let mut ctx = ResolveContext::default(); - - let specifiers = [ - "@/index".to_string(), - "@/index.js".to_string(), - // specifier has multiple `/` for reasons we'll never know - "@////index".to_string(), - // specifier is a full path - dir_str, - ]; - - for specifier in specifiers { - let resolution = resolver.resolve_with_context(&f, &specifier, &mut ctx); - assert_eq!(resolution.map(|r| r.full_path()), Ok(dir.join("index.js"))); - } - - for path in ctx.file_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - check_slash(&path); - } - - for path in ctx.missing_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - check_slash(&path); - if let Some(path) = path.parent() { - assert!(!path.is_file(), "{path:?} must not be a file"); - } - } -} - -// For the `should_stop` variable in `load_alias` -#[test] -fn all_alias_values_are_not_found() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![( - "m1".to_string(), - vec![AliasValue::Path(f.join("node_modules").join("m2").to_string_lossy().to_string())], - )], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(&f, "m1/a.js"); - assert_eq!(resolution, Err(ResolveError::NotFound("m1/a.js".to_string()))); -} - -#[test] -fn alias_fragment() { - let f = super::fixture(); - - let data = [ - // enhanced-resolve has `#` prepended with a `\0`, they are removed from the - // following 3 expected test results. - // See https://github.com/webpack/enhanced-resolve#escaping - ( - "handle fragment edge case (no fragment)", - "./no#fragment/#/#", - f.join("no#fragment/#/#.js"), - ), - ("handle fragment edge case (fragment)", "./no#fragment/#/", f.join("no.js#fragment/#/")), - ( - "handle fragment escaping", - "./no\0#fragment/\0#/\0##fragment", - f.join("no#fragment/#/#.js#fragment"), - ), - ]; - - for (comment, request, expected) in data { - let resolver = Resolver::new(ResolveOptions { - alias: vec![("foo".to_string(), vec![AliasValue::Path(request.to_string())])], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f, "foo").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } -} - -#[test] -fn alias_try_fragment_as_path() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![( - "#".to_string(), - vec![AliasValue::Path(f.join("#").to_string_lossy().to_string())], - )], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(&f, "#/a").map(|r| r.full_path()); - assert_eq!(resolution, Ok(f.join("#").join("a.js"))); -} diff --git a/src/tests/browser_field.rs b/src/tests/browser_field.rs deleted file mode 100644 index 171ee099..00000000 --- a/src/tests/browser_field.rs +++ /dev/null @@ -1,189 +0,0 @@ -//! - -use crate::{AliasValue, ResolveError, ResolveOptions, Resolver}; - -#[test] -fn ignore() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![ - vec!["browser".into()], - vec!["innerBrowser1".into()], - vec!["innerBrowser2".into()], - vec![], - ], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - (f.clone(), "./lib/ignore", f.join("lib/ignore.js")), - (f.clone(), "./lib/ignore.js", f.join("lib/ignore.js")), - (f.join("lib"), "./ignore", f.join("lib/ignore.js")), - (f.join("lib"), "./ignore.js", f.join("lib/ignore.js")), - ]; - - for (path, request, expected) in data { - let resolution = resolver.resolve(&path, request); - let expected = ResolveError::Ignored(expected); - assert_eq!(resolution, Err(expected), "{path:?} {request}"); - } -} - -#[test] -fn shared_resolvers() { - let f = super::fixture().join("browser-module"); - - let resolver1 = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["innerBrowser1".into(), "field".into(), "browser".into()]], - ..ResolveOptions::default() - }); - let resolved_path = resolver1.resolve(&f, "./lib/main1.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("lib/main.js"))); - - let resolver2 = resolver1.clone_with_options(ResolveOptions { - alias_fields: vec![vec!["innerBrowser2".into(), "browser".into()]], - ..ResolveOptions::default() - }); - let resolved_path = resolver2.resolve(&f, "./lib/main2.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("./lib/replaced.js"))); -} - -#[test] -fn replace_file() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![ - vec!["browser".into()], - vec!["innerBrowser1".into(), "field2".into(), "browser".into()], // not presented - vec!["innerBrowser1".into(), "field".into(), "browser".into()], - vec!["innerBrowser2".into(), "browser".into()], - ], - // Not part of enhanced-resolve. Added to make sure no interaction between these two fields. - main_fields: vec!["browser".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - ("should replace a file 1", f.clone(), "./lib/replaced", f.join("lib/browser.js")), - ("should replace a file 2", f.clone(), "./lib/replaced.js", f.join("lib/browser.js")), - ("should replace a file 3", f.join("lib"), "./replaced", f.join("lib/browser.js")), - ("should replace a file 4", f.join("lib"), "./replaced.js", f.join("lib/browser.js")), - ("should replace a module with a file 1", f.clone(), "module-a", f.join("browser/module-a.js")), - ("should replace a module with a file 2", f.join("lib"), "module-a", f.join("browser/module-a.js")), - ("should replace a module with a module 1", f.clone(), "module-b", f.join("node_modules/module-c.js")), - ("should replace a module with a module 2", f.join("lib"), "module-b", f.join("node_modules/module-c.js")), - ("should resolve in nested property 1", f.clone(), "./lib/main1.js", f.join("lib/main.js")), - ("should resolve in nested property 2", f.clone(), "./lib/main2.js", f.join("lib/browser.js")), - ("should check only alias field properties", f.clone(), "./toString", f.join("lib/toString.js")), - // not part of enhanced-resolve - ("recursion", f.clone(), "module-c", f.join("node_modules/module-c.js")), - ("resolve self 1", f.clone(), "./lib/main.js", f.join("lib/main.js")), - ("resolve self 2", f.clone(), "./main.js", f.join("lib/main.js")), - ]; - - for (comment, path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn recurse_fail() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - ("recurse non existent", f.clone(), "./lib/non-existent.js", ResolveError::NotFound("./lib/non-existent.js".into())), - ("path partial match 1", f.clone(), "./xyz.js", ResolveError::NotFound("./xyz.js".into())), - ("path partial match 2", f, "./lib/xyz.js", ResolveError::NotFound("./lib/xyz.js".into())), - ]; - - for (comment, path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Err(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn broken() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - // The browser field string value should be ignored - (f.clone(), "browser-module-broken", Ok(f.join("node_modules/browser-module-broken/main.js"))), - (f.join("browser-module"), "./number", Err(ResolveError::NotFound("./number".into()))), - ]; - - for (path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, expected, "{path:?} {request}"); - } -} - -#[test] -fn crypto_js() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - fallback: vec![( - "crypto".into(), - vec![AliasValue::from(f.join("lib.js").to_string_lossy())], - )], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(f.join("crypto-js"), "crypto").map(|r| r.full_path()); - assert_eq!(resolved_path, Err(ResolveError::Ignored(f.join("crypto-js")))); -} - -// https://github.com/webpack/webpack/blob/87660921808566ef3b8796f8df61bd79fc026108/test/cases/resolving/browser-field/index.js#L40-L43 -#[test] -fn recursive() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - let data = [ - ("should handle recursive file 1", f.clone(), "recursive-file/a"), - ("should handle recursive file 2", f.clone(), "recursive-file/b"), - ("should handle recursive file 3", f.clone(), "recursive-file/c"), - ("should handle recursive file 4", f, "recursive-file/d"), - ]; - - for (comment, path, request) in data { - let resolved_path = resolver.resolve(&path, request); - assert_eq!(resolved_path, Err(ResolveError::Recursion), "{comment} {path:?} {request}"); - } -} - -#[test] -fn with_query() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "./foo").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("lib").join("browser.js?query"))); -} diff --git a/src/tests/builtins.rs b/src/tests/builtins.rs deleted file mode 100644 index 5d6d14d9..00000000 --- a/src/tests/builtins.rs +++ /dev/null @@ -1,121 +0,0 @@ -use std::path::Path; - -use crate::{ResolveError, ResolveOptions, Resolver}; - -#[test] -fn builtins_off() { - let f = Path::new("/"); - let resolver = Resolver::default(); - let resolved_path = resolver.resolve(f, "zlib").map(|r| r.full_path()); - assert_eq!(resolved_path, Err(ResolveError::NotFound("zlib".into()))); -} - -#[test] -fn builtins() { - let f = Path::new("/"); - - let resolver = Resolver::new(ResolveOptions::default().with_builtin_modules(true)); - - let pass = [ - "_http_agent", - "_http_client", - "_http_common", - "_http_incoming", - "_http_outgoing", - "_http_server", - "_stream_duplex", - "_stream_passthrough", - "_stream_readable", - "_stream_transform", - "_stream_wrap", - "_stream_writable", - "_tls_common", - "_tls_wrap", - "assert", - "assert/strict", - "async_hooks", - "buffer", - "child_process", - "cluster", - "console", - "constants", - "crypto", - "dgram", - "diagnostics_channel", - "dns", - "dns/promises", - "domain", - "events", - "fs", - "fs/promises", - "http", - "http2", - "https", - "inspector", - "module", - "net", - "os", - "path", - "path/posix", - "path/win32", - "perf_hooks", - "process", - "punycode", - "querystring", - "readline", - "repl", - "stream", - "stream/consumers", - "stream/promises", - "stream/web", - "string_decoder", - "sys", - "timers", - "timers/promises", - "tls", - "trace_events", - "tty", - "url", - "util", - "util/types", - "v8", - "vm", - "worker_threads", - "zlib", - ]; - - for request in pass { - let prefixed_request = format!("node:{request}"); - for request in [prefixed_request.clone(), request.to_string()] { - let resolved_path = resolver.resolve(f, &request).map(|r| r.full_path()); - let err = ResolveError::Builtin(prefixed_request.clone()); - assert_eq!(resolved_path, Err(err), "{request}"); - } - } -} - -#[test] -fn fail() { - let f = Path::new("/"); - let resolver = Resolver::new(ResolveOptions::default().with_builtin_modules(true)); - let request = "xxx"; - let resolved_path = resolver.resolve(f, request); - let err = ResolveError::NotFound(request.to_string()); - assert_eq!(resolved_path, Err(err), "{request}"); -} - -#[test] -fn imports() { - let f = super::fixture().join("builtins"); - let resolver = Resolver::new(ResolveOptions { - builtin_modules: true, - condition_names: vec!["node".into()], - ..ResolveOptions::default() - }); - - for request in ["#fs", "#http"] { - let resolved_path = resolver.resolve(f.clone(), request).map(|r| r.full_path()); - let err = ResolveError::Builtin(format!("node:{}", request.trim_start_matches('#'))); - assert_eq!(resolved_path, Err(err)); - } -} diff --git a/src/tests/dependencies.rs b/src/tests/dependencies.rs deleted file mode 100644 index bcc2355b..00000000 --- a/src/tests/dependencies.rs +++ /dev/null @@ -1,110 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/dependencies.test.js - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows { - use rustc_hash::FxHashSet; - use std::path::PathBuf; - - use crate::{ResolveContext, ResolveOptions, ResolverGeneric}; - - use super::super::memory_fs::MemoryFS; - - fn file_system() -> MemoryFS { - MemoryFS::new(&[ - ("/a/b/node_modules/some-module/index.js", ""), - ("/a/node_modules/module/package.json", r#"{"main":"entry.js"}"#), - ("/a/node_modules/module/file.js", r#"{"main":"entry.js"}"#), - ("/modules/other-module/file.js", ""), - ]) - } - - #[test] - fn test() { - let file_system = file_system(); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - extensions: vec![".json".into(), ".js".into()], - modules: vec!["/modules".into(), "node_modules".into()], - ..ResolveOptions::default() - }, - ); - - let data = [ - ( - "middle module request", - "/a/b/c", - "module/file", - "/a/node_modules/module/file.js", - // These dependencies are different from enhanced-resolve due to different code path to - // querying the file system - vec![ - // 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", - // "/", - ], - vec![ - // missing package.jsons - // "/a/b/c/package.json", - "/a/b/package.json", - "/a/package.json", - "/package.json", - // missing modules directories - "/a/b/c", - // "/a/b/c/node_modules", - // missing single file modules - "/modules/module", - "/a/b/node_modules/module", - // missing files with alternative extensions - "/a/node_modules/module/file", - "/a/node_modules/module/file.json", - ], - ), - ( - "fast found module", - "/a/b/c", - "other-module/file.js", - "/modules/other-module/file.js", - // These dependencies are different from enhanced-resolve due to different code path to - // querying the file system - vec![ - // symlink checks - "/modules/other-module/file.js", - // "/modules/other-module", - // "/modules", - // "/", - ], - vec![ - // missing package.jsons - // "/a/b/c/package.json", - "/a/b/c", - "/a/b/package.json", - "/a/package.json", - "/package.json", - "/modules/other-module/package.json", - "/modules/package.json", - ], - ), - ]; - - for (name, context, request, result, file_dependencies, missing_dependencies) in data { - let mut ctx = ResolveContext::default(); - let path = PathBuf::from(context); - let resolved = - resolver.resolve_with_context(path, request, &mut ctx).map(|r| r.full_path()); - assert_eq!(resolved, Ok(PathBuf::from(result))); - let file_dependencies = - FxHashSet::from_iter(file_dependencies.iter().map(PathBuf::from)); - let missing_dependencies = - FxHashSet::from_iter(missing_dependencies.iter().map(PathBuf::from)); - assert_eq!(ctx.file_dependencies, file_dependencies, "{name}"); - assert_eq!(ctx.missing_dependencies, missing_dependencies, "{name}"); - } - } -} diff --git a/src/tests/exports_field.rs b/src/tests/exports_field.rs deleted file mode 100644 index fd68c1f7..00000000 --- a/src/tests/exports_field.rs +++ /dev/null @@ -1,2546 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/exportsField.test.js -//! -//! The huge exports field test cases are at the bottom of this file. - -use crate::{Ctx, PathUtil, ResolveError, ResolveOptions, Resolver}; -use serde_json::json; -use std::path::Path; - -#[test] -fn test_simple() { - let f = super::fixture().join("exports-field"); - let f2 = super::fixture().join("exports-field2"); - let f4 = super::fixture().join("exports-field-error"); - let f5 = super::fixture().join("imports-exports-wildcard"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - fully_specified: true, - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("resolve root using exports field, not a main field", f.clone(), "exports-field", f.join("node_modules/exports-field/x.js")), - ("resolver should respect condition names", f.clone(), "exports-field/dist/main.js", f.join("node_modules/exports-field/lib/lib2/main.js")), - // enhanced_resolve behaves differently to node.js. enhanced_resolve fallbacks when an - // array item is unresolved, where as node.js fallbacks when an array has an - // InvalidPackageTarget error. - // ("resolver should respect fallback", f2.clone(), "exports-field/dist/browser.js", f2.join("node_modules/exports-field/lib/browser.js")), - // The following two tests require fallback from array values, the path is changed here to - // only test query and fragment. - ("resolver should respect query parameters #1", f2.clone(), "exports-field/dist/main.js?foo", f2.join("node_modules/exports-field/lib/lib2/main.js?foo")), - ("resolver should respect fragment parameters #1", f2.clone(), "exports-field/dist/main.js#foo", f2.join("node_modules/exports-field/lib/lib2/main.js#foo")), - ("relative path should work, if relative path as request is used", f.clone(), "./node_modules/exports-field/lib/main.js", f.join("node_modules/exports-field/lib/main.js")), - ("self-resolving root", f.clone(), "@exports-field/core", f.join("a.js")), - ("should resolve with wildcard pattern #1", f5.clone(), "m/features/f.js", f5.join("node_modules/m/src/features/f.js")), - ("should resolve with wildcard pattern #2", f5.clone(), "m/features/y/y.js", f5.join("node_modules/m/src/features/y/y.js")), - ("should resolve with wildcard pattern #3", f5.clone(), "m/features-no-ext/y/y.js", f5.join("node_modules/m/src/features/y/y.js")), - ("should resolve with wildcard pattern #4", f5.clone(), "m/middle/nested/f.js", f5.join("node_modules/m/src/middle/nested/f.js")), - ("should resolve with wildcard pattern #5", f5.clone(), "m/middle-1/nested/f.js", f5.join("node_modules/m/src/middle-1/nested/f.js")), - ("should resolve with wildcard pattern #6", f5.clone(), "m/middle-2/nested/f.js", f5.join("node_modules/m/src/middle-2/nested/f.js")), - ("should resolve with wildcard pattern #7", f5.clone(), "m/middle-3/nested/f", f5.join("node_modules/m/src/middle-3/nested/f/nested/f.js")), - ("should resolve with wildcard pattern #8", f5.clone(), "m/middle-4/f/nested", f5.join("node_modules/m/src/middle-4/f/f.js")), - ("should resolve with wildcard pattern #9", f5.clone(), "m/middle-5/f$/$", f5.join("node_modules/m/src/middle-5/f$/$.js")), - ]; - - // Not needed or snapshot: - // * should log the correct info - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } - - let p = f.join("node_modules/exports-field/package.json"); - let p2 = f2.join("node_modules/exports-field/package.json"); - let p4 = f4.join("node_modules/exports-field/package.json"); - let p5 = f5.join("node_modules/m/package.json"); - - #[rustfmt::skip] - let fail = [ - // ("throw error if extension not provided", f2.clone(), "exports-field/dist/main", ResolveError::NotFound(f2.join("node_modules/exports-field/lib/lib2/main"))), - ("resolver should respect query parameters #2. Direct matching", f2.clone(), "exports-field?foo", ResolveError::PackagePathNotExported("./?foo".into(), p2.clone())), - ("resolver should respect fragment parameters #2. Direct matching", f2, "exports-field#foo", ResolveError::PackagePathNotExported("./#foo".into(), p2)), - ("relative path should not work with exports field", f.clone(), "./node_modules/exports-field/dist/main.js", ResolveError::NotFound("./node_modules/exports-field/dist/main.js".into())), - ("backtracking should not work for request", f.clone(), "exports-field/dist/../../../a.js", ResolveError::InvalidPackageTarget("./lib/../../../a.js".to_string(), "./dist/".to_string(), p.clone())), - ("backtracking should not work for exports field target", f.clone(), "exports-field/dist/a.js", ResolveError::InvalidPackageTarget("./../../a.js".to_string(), "./dist/a.js".to_string(), p.clone())), - ("not exported error", f.clone(), "exports-field/anything/else", ResolveError::PackagePathNotExported("./anything/else".to_string(), p.clone())), - ("request ending with slash #1", f.clone(), "exports-field/", ResolveError::PackagePathNotExported("./".to_string(), p.clone())), - ("request ending with slash #2", f.clone(), "exports-field/dist/", ResolveError::PackagePathNotExported("./dist/".to_string(), p.clone())), - ("request ending with slash #3", f.clone(), "exports-field/lib/", ResolveError::PackagePathNotExported("./lib/".to_string(), p)), - ("should throw error if target is invalid", f4, "exports-field", ResolveError::InvalidPackageTarget("./a/../b/../../pack1/index.js".to_string(), ".".to_string(), p4)), - ("throw error if exports field is invalid", f.clone(), "invalid-exports-field", ResolveError::InvalidPackageConfig(f.join("node_modules/invalid-exports-field/package.json"))), - ("should throw error if target is 'null'", f5, "m/features/internal/file.js", ResolveError::PackagePathNotExported("./features/internal/file.js".to_string(), p5)), - ]; - - for (comment, path, request, error) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!(resolution, Err(error), "{comment} {path:?} {request}"); - } -} - -// resolve using exports field, not a browser field #1 -#[test] -fn exports_not_browser_field1() { - let f = super::fixture().join("exports-field"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - condition_names: vec!["webpack".into()], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "exports-field/dist/main.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("node_modules/exports-field/lib/lib2/main.js"))); -} - -// resolve using exports field and a browser alias field #2 -#[test] -fn exports_not_browser_field2() { - let f2 = super::fixture().join("exports-field2"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - extensions: vec![".js".into()], - condition_names: vec!["node".into()], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f2, "exports-field/dist/main.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f2.join("node_modules/exports-field/lib/browser.js"))); -} - -// should resolve extension without fullySpecified -#[test] -fn extension_without_fully_specified() { - let f2 = super::fixture().join("exports-field2"); - - let commonjs_resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - let resolved_path = - commonjs_resolver.resolve(&f2, "exports-field/dist/main").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f2.join("node_modules/exports-field/lib/lib2/main.js"))); -} - -#[test] -fn field_name_path() { - let f2 = super::fixture().join("exports-field2"); - let f3 = super::fixture().join("exports-field3"); - - // field name path #1 #2 #3 - let exports_fields = [ - vec![vec!["exportsField".into(), "exports".into()]], - vec![vec!["exportsField".into(), "exports".into()], vec!["exports".into()]], - vec![vec!["exports".into()], vec!["exportsField".into(), "exports".into()]], - ]; - - for exports_fields in exports_fields { - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - exports_fields, - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/main.js"))); - } - - // field name path #4 - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - exports_fields: vec![vec!["exports".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f2, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f2.join("node_modules/exports-field/index.js"))); - - // field name path #5 - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - exports_fields: vec![vec!["ex".into()], vec!["exports_field".into(), "exports".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/index"))); - - // non-compliant export targeting a directory - let resolver = Resolver::new(ResolveOptions { - exports_fields: vec![vec!["broken".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/src/index.js"))); -} - -#[test] -fn shared_resolvers() { - let f3 = super::fixture().join("exports-field3"); - - let resolver1 = Resolver::new(ResolveOptions { - exports_fields: vec![vec!["exportsField".into(), "exports".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver1.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/main.js"))); - - let resolver2 = resolver1.clone_with_options(ResolveOptions { - exports_fields: vec![vec!["ex".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver2.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/index"))); -} - -#[test] -fn extension_alias_1_2() { - let f = super::fixture().join("exports-field-and-extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - extension_alias: vec![(".js".into(), vec![".ts".into(), ".js".into()])], - fully_specified: true, - condition_names: vec!["webpack".into(), "default".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve with the `extensionAlias` option", f.clone(), "@org/pkg/string.js", f.join("node_modules/@org/pkg/dist/string.js")), - ("should resolve with the `extensionAlias` option #2", f.clone(), "pkg/string.js", f.join("node_modules/pkg/dist/string.js")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn extension_alias_3() { - let f = super::fixture().join("exports-field-and-extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - extension_alias: vec![( - ".js".into(), - vec![".foo".into(), ".baz".into(), ".baz".into(), ".ts".into(), ".js".into()], - )], - fully_specified: true, - condition_names: vec!["webpack".into(), "default".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve with the `extensionAlias` option #3", f.clone(), "pkg/string.js", f.join("node_modules/pkg/dist/string.js")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn extension_alias_throw_error() { - let f = super::fixture().join("exports-field-and-extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - extension_alias: vec![(".js".into(), vec![".ts".into()])], - fully_specified: true, - condition_names: vec!["webpack".into(), "default".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let fail = [ - // enhanced-resolve has two test cases that are exactly the same here - // https://github.com/webpack/enhanced-resolve/blob/a998c7d218b7a9ec2461fc4fddd1ad5dd7687485/test/exportsField.test.js#L2976-L3024 - ("should throw error with the `extensionAlias` option", f, "pkg/string.js", ResolveError::ExtensionAlias), - // TODO: The error is PackagePathNotExported in enhanced-resolve - // ("should throw error with the `extensionAlias` option", f.clone(), "pkg/string.js", ResolveError::PackagePathNotExported("node_modules/pkg/dist/string.ts".to_string())), - ]; - - for (comment, path, request, error) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!(resolution, Err(error), "{comment} {path:?} {request}"); - } -} - -// Small script for generating the test cases from enhanced-resolve -// for (c of testCases) { -// console.log("TestCase {") -// console.log(`name: ${JSON.stringify(c.name)},`) -// if (c.expect instanceof Error) { -// console.log(`expect: None,`) -// } else { -// console.log(`expect: Some(vec!${JSON.stringify(c.expect)}),`) -// } -// console.log(`exports_field: exports_field(json!(${JSON.stringify(c.suite[0], null, 2)})),`) -// console.log(`request: "${c.suite[1]}",`) -// console.log(`condition_names: vec!${JSON.stringify(c.suite[2])},`) -// console.log("},") -//} -struct TestCase { - name: &'static str, - expect: Option>, - exports_field: serde_json::Value, - request: &'static str, - condition_names: Vec<&'static str>, -} - -#[allow(clippy::needless_pass_by_value)] -fn exports_field(value: serde_json::Value) -> serde_json::Value { - value -} - -#[test] -fn test_cases() { - let test_cases = [ - TestCase { - name: "sample #1", - expect: Some(vec!["./dist/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/": { - "import": [ - "./dist/", - "./src/" - ], - "webpack": "./wp/" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "sample #1", - expect: Some(vec!["./src/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/": { - "import": [ - "./src/" - ], - "webpack": "./wp/" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - TestCase { - name: "sample #1 (wildcard)", - expect: Some(vec!["./dist/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/*": { - "import": [ - "./dist/*", - "./src/*" - ], - "webpack": "./wp/*" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "sample #1 (wildcard)", - expect: Some(vec!["./src/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/*": { - "import": [ - "./src/*" - ], - "webpack": "./wp/*" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - TestCase { - name: "sample #2", - expect: Some(vec!["./data/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./timezones/": "./data/timezones/" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #2 (wildcard)", - expect: Some(vec!["./data/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./timezones/*": "./data/timezones/*" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #3", - expect: Some(vec!["./data/timezones/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./": "./data/timezones/" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #3 (wildcard)", - expect: Some(vec!["./data/timezones/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./*": "./data/timezones/*.mjs" - })), - request: "./timezones/pdt", - condition_names: vec![], - }, - TestCase { - name: "sample #4", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./lib/": { - "browser": [ - "./browser/" - ] - }, - "./dist/index.js": { - "node": "./index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #4 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "node": "./index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #5", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/": { - "browser": [ - "./browser/" - ] - }, - "./dist/index.js": { - "node": "./index.js", - "default": "./browser/index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #5 (wildcard)", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "node": "./index.js", - "default": "./browser/index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./dist/a": "./dist/index.js" - })), - request: "./dist/aaa", - condition_names: vec![], - }, - TestCase { - name: "sample #7", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./dist/a/a/": "./dist/index.js" - })), - request: "./dist/a/a", - condition_names: vec![], - }, - TestCase { - name: "sample #7 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./dist/a/a/*": "./dist/index.js" - })), - request: "./dist/a/a", - condition_names: vec![], - }, - TestCase { - name: "sample #8", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": "./index.js" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #9", - expect: Some(vec!["./main.js"]), - exports_field: exports_field(json!({ - "./index.js": "./main.js" - })), - request: "./index.js", - condition_names: vec![], - }, - TestCase { - name: "sample #10", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #11", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./bar#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #12", - expect: Some(vec!["./ok.js#abc"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/ok.js#abc", - condition_names: vec![], - }, - TestCase { - name: "sample #12", - expect: Some(vec!["./ok.js#abc"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/ok.js#abc", - condition_names: vec![], - }, - TestCase { - name: "sample #13", - expect: Some(vec!["./ok.js?abc"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/ok.js?abc", - condition_names: vec![], - }, - TestCase { - name: "sample #14", - expect: Some(vec!["./🎉.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/🎉.js", - condition_names: vec![], - }, - TestCase { - name: "sample #15", - expect: Some(vec!["./%F0%9F%8E%89.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/%F0%9F%8E%89.js", - condition_names: vec![], - }, - TestCase { - name: "sample #16", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./🎉", - condition_names: vec![], - }, - TestCase { - name: "sample #17", - expect: Some(vec!["./other.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./%F0%9F%8E%89", - condition_names: vec![], - }, - TestCase { - name: "sample #18", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./module", - condition_names: vec![], - }, - TestCase { - name: "sample #19", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./module#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #20", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./module?foo", - condition_names: vec![], - }, - TestCase { - name: "sample #21", - expect: Some(vec!["./zizizi"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./z*z*z*" - })), - request: "./#zippi", - condition_names: vec![], - }, - TestCase { - name: "sample #22", - expect: Some(vec!["./d?e?f"]), - exports_field: exports_field(json!({ - "./a?b?c/": "./" - })), - request: "./a?b?c/d?e?f", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #1", - expect: Some(vec!["./dist/index.js"]), - exports_field: exports_field(json!({ - ".": "./dist/index.js" - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #2", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./": "./", - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #3", - expect: Some(vec!["./dist/a.js"]), - exports_field: exports_field(json!({ - "./dist/": "./dist/", - "./dist/*": "./dist/*", - "./dist*": "./dist*", - "./dist/index.js": "./dist/a.js" - })), - request: "./dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #4", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./": { - "browser": [ - "./browser/" - ] - }, - "./*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "browser": "./index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #5", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./": { - "browser": [ - "./browser/" - ] - }, - "./*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "node": "./node.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #6", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - ".": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #7", - expect: Some(vec!["./src/index.js"]), // `enhanced_resolve` is `None` - exports_field: exports_field(json!({ - ".": { - "default": "./src/index.js", - "browser": "./index.js", - "node": "./src/node/index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #8", - expect: Some(vec!["./src/index.js"]), - exports_field: exports_field(json!({ - ".": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #9", - expect: Some(vec!["./index"]), - exports_field: exports_field(json!({ - ".": "./index" - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #10", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./index": "./index.js" - })), - request: "./index", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #11", - expect: Some(vec!["./foo.js"]), - exports_field: exports_field(json!({ - "./": "./", - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #12", - expect: Some(vec!["./foo/bar/baz.js"]), - exports_field: exports_field(json!({ - "./": "./", - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo/bar/baz.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #13", - expect: Some(vec!["./foo/bar/baz.js"]), - exports_field: exports_field(json!({ - "./": "./", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo/bar/baz.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #14", - expect: Some(vec!["./foo/bar/baz.js"]), - exports_field: exports_field(json!({ - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo/bar/baz.js", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #1", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "require": "./require.js" - }, { - "import": "./import.mjs" - }] - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #2", - expect: Some(vec!["./import.mjs"]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "require": "./require.js" - }, { - "import": "./import.mjs" - }] - })), - request: ".", - condition_names: vec!["import"], - }, - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./require.js"]), - exports_field: exports_field(json!({ - ".": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./import.mjs"]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "import": "./import.mjs" - }] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./require.js"]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "require": [ - "./require.js" - ] - }, { - "import": [ - "./import.mjs", - "./import.js" - ] - }] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./import.mjs"]), - exports_field: exports_field(json!({ - ".": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "./import.mjs", - "./import.js" - ] - } - ] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./import.js"]), - exports_field: exports_field(json!({ - ".": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "./import.js" - ] - } - ] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "mapping to a folder root #1", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./timezones": "./data/timezones/" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #2", - expect: None, - exports_field: exports_field(json!({ - "./timezones/": "./data/timezones" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #3", - expect: Some(vec!["./data/timezones/pdt/index.mjs"]), - exports_field: exports_field(json!({ - "./timezones/pdt/": "./data/timezones/pdt/" - })), - request: "./timezones/pdt/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #3 (wildcard)", - expect: Some(vec!["./data/timezones/pdt/index.mjs"]), - exports_field: exports_field(json!({ - "./timezones/pdt/*": "./data/timezones/pdt/*" - })), - request: "./timezones/pdt/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #4", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./": "./timezones/" - })), - request: "./pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #4 (wildcard)", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./*": "./timezones/*" - })), - request: "./pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #5", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./": "./" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #5 (wildcard)", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./*": "./*" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #6", - expect: None, - exports_field: exports_field(json!({ - "./": "." - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #6 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "./*": "." - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #7", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": "./" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #7 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": "./*" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #1", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./": "./", - "./dist/": "./lib/" - })), - request: "./dist/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #1 (wildcard)", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./*": "./*", - "./dist/*": "./lib/*" - })), - request: "./dist/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #2", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/": "./dist/utils/", - "./dist/": "./lib/" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #2 (wildcard)", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/*": "./dist/utils/*", - "./dist/*": "./lib/*" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #3", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/index.js": "./dist/utils/index.js", - "./dist/utils/": "./dist/utils/index.mjs", - "./dist/": "./lib/" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #3 (wildcard)", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/index.js": "./dist/utils/index.js", - "./dist/utils/*": "./dist/utils/index.mjs", - "./dist/*": "./lib/*" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #4", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./": { - "browser": "./browser/" - }, - "./dist/": "./lib/" - })), - request: "./dist/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "the longest matching path prefix is prioritized #4 (wildcard)", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./*": { - "browser": "./browser/*" - }, - "./dist/*": "./lib/*" - })), - request: "./dist/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #1", - // `lodash/` does not start with './' so fallbacks to util - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "conditional mapping folder #1", - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": [ - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #1 (wildcard)", - // `lodash/` does not start with './' so fallbacks to util - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": [ - "lodash/*", - "./utils/*" - ], - "node": [ - "./utils-node/*" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "conditional mapping folder #1 (wildcard)", - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": [ - "./utils/*" - ], - "node": [ - "./utils-node/*" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #2", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./node/" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "conditional mapping folder #2 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "webpack": "./wpk/*", - "browser": [ - "lodash/*", - "./utils/*" - ], - "node": [ - "./node/*" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "conditional mapping folder #3", - expect: Some(vec!["./wpk/index.mjs"]), - exports_field: exports_field(json!({ - "./utils/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils/" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "conditional mapping folder #3 (wildcard)", - expect: Some(vec!["./wpk/index.mjs"]), - exports_field: exports_field(json!({ - "./utils/*": { - "webpack": "./wpk/*", - "browser": [ - "lodash/*", - "./utils/*" - ], - "node": [ - "./utils/*" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "incorrect exports field #1", - expect: None, - exports_field: exports_field(json!({ - "/utils/": "./a/" - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #2", - expect: None, - exports_field: exports_field(json!({ - "./utils/": "/a/" - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #3", - expect: None, - exports_field: exports_field(json!({ - "/utils/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #4", - expect: None, - exports_field: exports_field(json!({ - "./utils/": { - "browser": "/a/", - "default": "/b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #4 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "/a/", - "default": "/b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #5", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index": "./a/index.js" - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index.mjs": "./a/index.js" - })), - request: "./utils/index", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #7", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #8", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index.mjs": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - // Requests that are not `./` does not apply to `package_exports_resolve` - // TestCase { - // name: "incorrect request #1", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": "./a/" - // })), - // request: "/utils/index.mjs", - // condition_names: vec![], - // }, - // TestCase { - // name: "incorrect request #2", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": { - // "browser": "./a/", - // "default": "./b/" - // } - // })), - // request: "/utils/index.mjs", - // condition_names: vec!["browser"], - // }, - // TestCase { - // name: "incorrect request #3", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": { - // "browser": "./a/", - // "default": "./b/" - // } - // })), - // request: "../utils/index.mjs", - // condition_names: vec!["browser"], - // }, - // TestCase { - // name: "incorrect request #4", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": { - // "browser": "./a/", - // "default": "./b/" - // } - // })), - // request: "/utils/index.mjs/", - // condition_names: vec!["browser"], - // }, - TestCase { - name: "backtracking package base #1", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./../../utils/": "./dist/" - })), - request: "./../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #1 (wildcard)", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./../../utils/*": "./dist/*" - })), - request: "./../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #2", - expect: None, - exports_field: exports_field(json!({ - "../../utils/": "./dist/" - })), - request: "../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #2 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "../../utils/*": "./dist/*" - })), - request: "../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #3", - expect: None, - exports_field: exports_field(json!({ - "./utils/": "../src/" - })), - request: "./utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #3 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "./utils/*": "../src/*" - })), - request: "./utils/index", - condition_names: vec![], - }, - // enhanced-resolve does not handle backtracking here - // TestCase { - // name: "backtracking package base #4", - // expect: Some(vec!["./../src/index"]), - // exports_field: exports_field(json!({ - // "./utils/": "./../src/" - // })), - // request: "./utils/index", - // condition_names: vec![], - // }, - // TestCase { - // name: "backtracking package base #4 (wildcard)", - // expect: Some(vec!["./../src/index"]), - // exports_field: exports_field(json!({ - // "./utils/*": "./../src/*" - // })), - // request: "./utils/index", - // condition_names: vec![], - // }, - // TestCase { - // name: "backtracking package base #5", - // expect: Some(vec!["./src/../index.js"]), - // exports_field: exports_field(json!({ - // "./utils/index": "./src/../index.js" - // })), - // request: "./utils/index", - // condition_names: vec![], - // }, - TestCase { - name: "backtracking package base #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/../utils/index": "./src/../index.js" - })), - request: "./utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #7", - expect: None, - exports_field: exports_field(json!({ - "./utils/": { - "browser": "../this/" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #7", - expect: None, - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "../this/*" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #8", - // We throw "InvalidPackageTarget" - // expect: Some(vec!["./utils/../index"]), - expect: None, - exports_field: exports_field(json!({ - "./utils/": { - "browser": "./utils/../" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #8 (wildcard)", - // We throw "InvalidPackageTarget" - // expect: Some(vec!["./utils/../index"]), - expect: None, - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "./utils/../*" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #9", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./": "./src/../../", - "./dist/": "./dist/" - })), - request: "./dist/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #9 (wildcard)", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./*": "./src/../../*", - "./dist/*": "./dist/*" - })), - request: "./dist/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking target folder #1", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../../index"]), - exports_field: exports_field(json!({ - "./utils/": "./dist/" - })), - request: "./utils/timezone/../../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #1 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../../index"]), - exports_field: exports_field(json!({ - "./utils/*": "./dist/*" - })), - request: "./utils/timezone/../../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #2", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../index"]), - exports_field: exports_field(json!({ - "./utils/": "./dist/" - })), - request: "./utils/timezone/../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #2 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../index"]), - exports_field: exports_field(json!({ - "./utils/*": "./dist/*" - })), - request: "./utils/timezone/../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #3", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/target/../../index"]), - exports_field: exports_field(json!({ - "./utils/": "./dist/target/" - })), - request: "./utils/../../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #3 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/target/../../index"]), - exports_field: exports_field(json!({ - "./utils/*": "./dist/target/*" - })), - request: "./utils/../../index", - condition_names: vec![], - }, - // enhanced-resolve does not handle `node_modules` in target - TestCase { - name: "nested node_modules path #1", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": "./node_modules/" - } - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #1 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "./node_modules/*" - } - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #2", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./utils/../node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/": "./utils/../node_modules/" - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "nested node_modules path #2 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./utils/../node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": "./utils/../node_modules/*" - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "nested mapping #1", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": "./", - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested mapping #1 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": "./*", - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "nested mapping #2 (wildcard)", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #2 (wildcard)", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "nested mapping #3", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["webpack"], - }, - TestCase { - name: "nested mapping #3 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["webpack"], - }, - TestCase { - name: "nested mapping #4", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["node", "browser"], - }, - TestCase { - name: "nested mapping #4 (wildcard)", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["node", "browser"], - }, - TestCase { - name: "nested mapping #5", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node"], - }, - TestCase { - name: "nested mapping #5 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": { - "webpack": [ - "./wpck/*" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node"], - }, - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - TestCase { - name: "nested mapping #6 (wildcard)", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": { - "webpack": [ - "./wpck/*" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #6 (wildcard)", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./node/*" - ], - "default": { - "node": { - "webpack": [ - "./wpck/*" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - TestCase { - name: "nested mapping #7", - expect: Some(vec!["./y.js"]), - exports_field: exports_field(json!({ - "./a.js": { - "abc": { - "def": "./x.js" - }, - "ghi": "./y.js" - } - })), - request: "./a.js", - condition_names: vec!["abc", "ghi"], - }, - TestCase { - name: "nested mapping #8", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./a.js": { - "abc": { - "def": "./x.js", - "default": [] - }, - "ghi": "./y.js" - } - })), - request: "./a.js", - condition_names: vec!["abc", "ghi"], - }, - TestCase { - name: "syntax sugar #1", - expect: Some(vec!["./main.js"]), - exports_field: exports_field(json!("./main.js")), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #2", - expect: Some(vec![]), - exports_field: exports_field(json!("./main.js")), - request: "./lib.js", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #3", - expect: Some(vec!["./a.js"]), - exports_field: exports_field(json!(["./a.js", "./b.js"])), - request: ".", - condition_names: vec![], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "syntax sugar #3", - expect: Some(vec!["./b.js"]), - exports_field: exports_field(json!(["./b.js"])), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #4", - expect: Some(vec![]), - exports_field: exports_field(json!(["./a.js", "./b.js"])), - request: "./lib.js", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #5", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "browser": { - "default": "./index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "syntax sugar #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "browser": { - "default": "./index.js" - } - })), - request: "./lib.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "syntax sugar #7", - expect: None, - exports_field: exports_field(json!({ - "./node": "./node.js", - "browser": { - "default": "./index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "syntax sugar #8", - expect: None, - exports_field: exports_field(json!({ - "browser": { - "default": "./index.js" - }, - "./node": "./node.js" - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #1", - expect: Some(vec!["./abc/d"]), - exports_field: exports_field(json!({ - "./ab*": "./ab/*", - "./abc*": "./abc/*", - "./a*": "./a/*" - })), - request: "./abcd", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #2", - expect: Some(vec!["./abc/d/e"]), - exports_field: exports_field(json!({ - "./ab*": "./ab/*", - "./abc*": "./abc/*", - "./a*": "./a/*" - })), - request: "./abcd/e", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #3", - expect: Some(vec!["./abc/d"]), - exports_field: exports_field(json!({ - "./x/ab*": "./ab/*", - "./x/abc*": "./abc/*", - "./x/a*": "./a/*" - })), - request: "./x/abcd", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #4", - expect: Some(vec!["./abc/d/e"]), - exports_field: exports_field(json!({ - "./x/ab*": "./ab/*", - "./x/abc*": "./abc/*", - "./x/a*": "./a/*" - })), - request: "./x/abcd/e", - condition_names: vec!["browser"], - }, - TestCase { - name: "path tree edge case #1", - expect: Some(vec!["./A/b/d.js"]), - exports_field: exports_field(json!({ - "./a/": "./A/", - "./a/b/c": "./c.js" - })), - request: "./a/b/d.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #1 (wildcard)", - expect: Some(vec!["./A/b/d.js"]), - exports_field: exports_field(json!({ - "./a/*": "./A/*", - "./a/b/c": "./c.js" - })), - request: "./a/b/d.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #2", - expect: Some(vec!["./A/c.js"]), - exports_field: exports_field(json!({ - "./a/": "./A/", - "./a/b": "./b.js" - })), - request: "./a/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #2 (wildcard)", - expect: Some(vec!["./A/c.js"]), - exports_field: exports_field(json!({ - "./a/*": "./A/*", - "./a/b": "./b.js" - })), - request: "./a/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #3", - expect: Some(vec!["./A/b/d/c.js"]), - exports_field: exports_field(json!({ - "./a/": "./A/", - "./a/b/c/d": "./c.js" - })), - request: "./a/b/d/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #3 (wildcard)", - expect: Some(vec!["./A/b/d/c.js"]), - exports_field: exports_field(json!({ - "./a/*": "./A/*", - "./a/b/c/d": "./c.js" - })), - request: "./a/b/d/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #1", - expect: Some(vec!["./A/b.js"]), - exports_field: exports_field(json!({ - "./a/*.js": "./A/*.js" - })), - request: "./a/b.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #2", - expect: Some(vec!["./A/b/c.js"]), - exports_field: exports_field(json!({ - "./a/*.js": "./A/*.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #3", - expect: Some(vec!["./A/b/c.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": "./A/*/c.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #4", - expect: Some(vec!["./A/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": "./A/*/*.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #5", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/*.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #5", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/*.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./lib/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #6", - expect: Some(vec!["./browser/foo/bar.js"]), - exports_field: exports_field(json!({ - "./lib/*/bar.js": { - "browser": [ - "./browser/*/bar.js" - ] - }, - "./dist/*/bar.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./lib/foo/bar.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #6", - expect: Some(vec!["./browser/foo.js"]), - exports_field: exports_field(json!({ - "./lib/*/bar.js": { - "browser": [ - "./browser/*/bar.js" - ] - }, - "./dist/*/bar.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./dist/foo/bar.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #7", - expect: Some(vec!["./browser/foo/default.js"]), - exports_field: exports_field(json!({ - "./lib/*/bar.js": { - "browser": [ - "./browser/*/bar.js" - ] - }, - "./dist/*/bar.js": { - "node": "./*.js", - "default": "./browser/*/default.js" - } - })), - request: "./dist/foo/bar.js", - condition_names: vec!["default"], - }, - TestCase { - name: "wildcard pattern #8", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": "./A/*/*/*.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #9", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": [ - "./A/*/*/*.js", - "./B/*/*/*.js" - ] - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "wildcard pattern #9", - expect: Some(vec!["./B/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": [ - "./B/*/*/*.js" - ] - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #10", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/foo-*/c.js": "./A/*/*/*.js" - })), - request: "./a/foo-b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #11", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*-foo/c.js": "./A/*/*/*.js" - })), - request: "./a/b-foo/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #12", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/foo-*-foo/c.js": "./A/*/*/*.js" - })), - request: "./a/foo-b-foo/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #13", - expect: Some(vec!["./A/b/c/d.js"]), - exports_field: exports_field(json!({ - "./a/foo-*-foo/c.js": "./A/b/c/d.js" - })), - request: "./a/foo-b-foo/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #14", - expect: Some(vec!["./A/b/c/*.js"]), - exports_field: exports_field(json!({ - "./a/foo-foo/c.js": "./A/b/c/*.js" - })), - request: "./a/foo-foo/c.js", - condition_names: vec![], - }, - ]; - - for case in test_cases { - let resolved = Resolver::new(ResolveOptions { - condition_names: case - .condition_names - .iter() - .map(ToString::to_string) - .collect::>(), - ..ResolveOptions::default() - }) - .package_exports_resolve( - Path::new(""), - case.request, - &case.exports_field, - &mut Ctx::default(), - ) - .map(|p| p.map(|p| p.to_path_buf())); - if let Some(expect) = case.expect { - if expect.is_empty() { - assert!( - matches!(resolved, Err(ResolveError::PackagePathNotExported(_, _))), - "{} {:?}", - &case.name, - &resolved - ); - } else { - for expect in expect { - assert_eq!(resolved, Ok(Some(Path::new(expect).normalize())), "{}", &case.name); - } - } - } else { - assert!(resolved.is_err(), "{} {resolved:?}", &case.name); - } - } -} diff --git a/src/tests/extension_alias.rs b/src/tests/extension_alias.rs deleted file mode 100644 index 86afab73..00000000 --- a/src/tests/extension_alias.rs +++ /dev/null @@ -1,66 +0,0 @@ -//! - -use crate::{ResolveError, ResolveOptions, Resolver}; - -#[test] -fn extension_alias() { - let f = super::fixture().join("extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - extension_alias: vec![ - (".js".into(), vec![".ts".into(), ".js".into()]), - (".mjs".into(), vec![".mts".into()]), - ], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should alias fully specified file", f.clone(), "./index.js", f.join("index.ts")), - ("should alias fully specified file when there are two alternatives", f.clone(), "./dir/index.js", f.join("dir/index.ts")), - ("should also allow the second alternative", f.clone(), "./dir2/index.js", f.join("dir2/index.js")), - ("should support alias option without an array", f.clone(), "./dir2/index.mjs", f.join("dir2/index.mts")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } - - #[rustfmt::skip] - let fail = [ - ("should not allow to fallback to the original extension or add extensions", f, "./index.mjs"), - ]; - - for (comment, path, request) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!(resolution, Err(ResolveError::ExtensionAlias), "{comment} {path:?} {request}"); - } -} - -// should not apply extension alias to extensions or mainFiles field -#[test] -fn not_apply_to_extension_nor_main_files() { - let f = super::fixture().join("extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - extension_alias: vec![(".js".into(), vec![])], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("directory", f.clone(), "./dir2", "dir2/index.js"), - ("file", f.clone(), "./dir2/index", "dir2/index.js"), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - let expected = f.join(expected); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} diff --git a/src/tests/extensions.rs b/src/tests/extensions.rs deleted file mode 100644 index 1ebd86f4..00000000 --- a/src/tests/extensions.rs +++ /dev/null @@ -1,125 +0,0 @@ -//! - -use crate::{EnforceExtension, Resolution, ResolveContext, ResolveError, ResolveOptions, Resolver}; -use rustc_hash::FxHashSet; - -#[test] -fn extensions() { - let f = super::fixture().join("extensions"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".ts".into(), ".js".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve according to order of provided extensions", "./foo", "foo.ts"), - ("should resolve according to order of provided extensions (dir index)", "./dir", "dir/index.ts"), - ("should resolve according to main field in module root", ".", "index.js"), - // This is a core module - // ("should resolve single file module before directory", "module", "node_modules/module.js"), - ("should resolve trailing slash directory before single file", "module/", "node_modules/module/index.ts"), - ]; - - for (comment, request, expected_path) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - let expected = f.join(expected_path); - assert_eq!(resolved_path, Ok(expected), "{comment} {request} {expected_path}"); - } - - #[rustfmt::skip] - let fail = [ - ("not resolve to file when request has a trailing slash (relative)", "./foo.js/", "./foo.js/".into()) - ]; - - for (comment, request, expected_error) in fail { - let resolution = resolver.resolve(&f, request); - let error = ResolveError::NotFound(expected_error); - assert_eq!(resolution, Err(error), "{comment} {request} {resolution:?}"); - } -} - -// should default enforceExtension to true when extensions includes an empty string -#[test] -fn default_enforce_extension() { - let f = super::fixture().join("extensions"); - - let mut ctx = ResolveContext::default(); - let resolved = Resolver::new(ResolveOptions { - extensions: vec![".ts".into(), String::new(), ".js".into()], - ..ResolveOptions::default() - }) - .resolve_with_context(&f, "./foo", &mut ctx); - - assert_eq!(resolved.map(Resolution::into_path_buf), Ok(f.join("foo.ts"))); - assert_eq!( - ctx.file_dependencies, - FxHashSet::from_iter([f.join("foo.ts"), f.join("package.json")]) - ); - assert!(ctx.missing_dependencies.is_empty()); -} - -// should respect enforceExtension when extensions includes an empty string -#[test] -fn respect_enforce_extension() { - let f = super::fixture().join("extensions"); - - let mut ctx = ResolveContext::default(); - let resolved = Resolver::new(ResolveOptions { - enforce_extension: EnforceExtension::Disabled, - extensions: vec![".ts".into(), String::new(), ".js".into()], - ..ResolveOptions::default() - }) - .resolve_with_context(&f, "./foo", &mut ctx); - - assert_eq!(resolved.map(Resolution::into_path_buf), Ok(f.join("foo.ts"))); - assert_eq!( - ctx.file_dependencies, - FxHashSet::from_iter([f.join("foo.ts"), f.join("package.json")]) - ); - assert_eq!(ctx.missing_dependencies, FxHashSet::from_iter([f.join("foo")])); -} - -#[test] -fn multi_dot_extension() { - let f = super::fixture().join("extensions"); - - let resolver = Resolver::new(ResolveOptions { - // Test for `.d.ts`, not part of enhanced-resolve. - extensions: vec![".a.b.c".into(), ".d.ts".into(), ".ts".into(), ".js".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve according to order of provided extensions", "./foo", "foo.ts"), - ("should resolve file with extension", "./app.module", "app.module.js") - ]; - - for (comment, request, expected_path) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - let expected = f.join(expected_path); - assert_eq!(resolved_path, Ok(expected), "{comment} {request} {expected_path}"); - } - - #[rustfmt::skip] - let fail = [ - ("not resolve to file", "./index.", "./index.".into()) - ]; - - for (comment, request, expected_error) in fail { - let resolution = resolver.resolve(&f, request); - let error = ResolveError::NotFound(expected_error); - assert_eq!(resolution, Err(error), "{comment} {request} {resolution:?}"); - } -} - -#[test] -#[should_panic = "All extensions must start with a leading dot"] -fn without_leading_dot() { - Resolver::new(ResolveOptions { - extensions: vec!["ts".into(), "js".into()], - ..ResolveOptions::default() - }); -} diff --git a/src/tests/fallback.rs b/src/tests/fallback.rs deleted file mode 100644 index 3da2d767..00000000 --- a/src/tests/fallback.rs +++ /dev/null @@ -1,100 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/fallback.test.js - -#[test] -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -fn fallback() { - use super::memory_fs::MemoryFS; - use crate::{AliasValue, ResolveError, ResolveOptions, ResolverGeneric}; - use std::path::{Path, PathBuf}; - - let f = Path::new("/"); - - let file_system = MemoryFS::new(&[ - ("/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", ""), - ]); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - fallback: vec![ - ("aliasA".into(), vec![AliasValue::Path("a".into())]), - ("b$".into(), vec![AliasValue::Path("a/index".into())]), - ("c$".into(), vec![AliasValue::Path("/a/index".into())]), - ( - "multiAlias".into(), - vec![ - AliasValue::Path("b".into()), - AliasValue::Path("c".into()), - AliasValue::Path("d".into()), - AliasValue::Path("e".into()), - AliasValue::Path("a".into()), - ], - ), - ("recursive".into(), vec![AliasValue::Path("recursive/dir".into())]), - ("/d/dir".into(), vec![AliasValue::Path("/c/dir".into())]), - ("/d/index.js".into(), vec![AliasValue::Path("/c/index".into())]), - ("ignored".into(), vec![AliasValue::Ignore]), - ("node:path".into(), vec![AliasValue::Ignore]), - ], - modules: vec!["/".into()], - ..ResolveOptions::default() - }, - ); - - #[rustfmt::skip] - let pass = [ - ("should resolve a not aliased module 1", "a", "/a/index"), - ("should resolve a not aliased module 2", "a/index", "/a/index"), - ("should resolve a not aliased module 3", "a/dir", "/a/dir/index"), - ("should resolve a not aliased module 4", "a/dir/index", "/a/dir/index"), - ("should resolve an fallback module 1", "aliasA", "/a/index"), - ("should resolve an fallback module 2", "aliasA/index", "/a/index"), - ("should resolve an fallback module 3", "aliasA/dir", "/a/dir/index"), - ("should resolve an fallback module 4", "aliasA/dir/index", "/a/dir/index"), - ("should resolve a recursive aliased module 1", "recursive", "/recursive/index"), - ("should resolve a recursive aliased module 2", "recursive/index", "/recursive/index"), - ("should resolve a recursive aliased module 3", "recursive/dir", "/recursive/dir/index"), - ("should resolve a recursive aliased module 4", "recursive/dir/index", "/recursive/dir/index"), - ("should resolve a recursive aliased module 5", "recursive/file", "/recursive/dir/file"), - ("should resolve a file aliased module with a query 1", "b?query", "/b/index?query"), - ("should resolve a file aliased module with a query 2", "c?query", "/c/index?query"), - ("should resolve a path in a file aliased module 1", "b/index", "/b/index"), - ("should resolve a path in a file aliased module 2", "b/dir", "/b/dir/index"), - ("should resolve a path in a file aliased module 3", "b/dir/index", "/b/dir/index"), - ("should resolve a path in a file aliased module 4", "c/index", "/c/index"), - ("should resolve a path in a file aliased module 5", "c/dir", "/c/dir/index"), - ("should resolve a path in a file aliased module 6", "c/dir/index", "/c/dir/index"), - ("should resolve a file in multiple aliased dirs 1", "multiAlias/dir/file", "/e/dir/file"), - ("should resolve a file in multiple aliased dirs 2", "multiAlias/anotherDir", "/e/anotherDir/index"), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - - #[rustfmt::skip] - let ignore = [ - ("should resolve an ignore module", "ignored", ResolveError::Ignored(f.join("ignored"))), - ("should resolve node: builtin module", "node:path", ResolveError::Ignored(PathBuf::from("/node:path"))), - ]; - - for (comment, request, expected) in ignore { - let resolution = resolver.resolve(f, request); - assert_eq!(resolution, Err(expected), "{comment} {request}"); - } -} diff --git a/src/tests/full_specified.rs b/src/tests/full_specified.rs deleted file mode 100644 index a70c0191..00000000 --- a/src/tests/full_specified.rs +++ /dev/null @@ -1,113 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/fullSpecified.test.js - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows { - use std::path::PathBuf; - - use crate::{AliasValue, ResolveOptions, ResolverGeneric}; - - use super::super::memory_fs::MemoryFS; - - fn file_system() -> MemoryFS { - MemoryFS::new(&[ - ("/a/node_modules/package1/index.js", ""), - ("/a/node_modules/package1/file.js", ""), - ("/a/node_modules/package2/package.json", r#"{"main":"a"}"#), - ("/a/node_modules/package2/a.js", ""), - ("/a/node_modules/package3/package.json", r#"{"main":"dir"}"#), - ("/a/node_modules/package3/dir/index.js", ""), - ("/a/node_modules/package4/package.json", r#"{"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", ""), - ]) - } - - #[test] - fn test() { - let file_system = file_system(); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - alias: vec![ - ("alias1".into(), vec![AliasValue::from("/a/abc")]), - ("alias2".into(), vec![AliasValue::from("/a")]), - ], - alias_fields: vec![vec!["browser".into()]], - fully_specified: true, - ..ResolveOptions::default() - }, - ); - - let failing_resolves = [ - ("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"), - ]; - - for (comment, request) in failing_resolves { - let resolution = resolver.resolve("/a", request); - assert!(resolution.is_err(), "{comment} {request}"); - } - - let successful_resolves = [ - ("fully relative", "./abc.js", "/a/abc.js"), - ("fully absolute", "/a/abc.js", "/a/abc.js"), - ("fully relative in package", "package1/file.js", "/a/node_modules/package1/file.js"), - ("extensions in mainFiles", "package1", "/a/node_modules/package1/index.js"), - ("extensions in mainFields", "package2", "/a/node_modules/package2/a.js"), - ("extensions in alias", "alias1", "/a/abc.js"), - ("directories in alias", "alias2", "/a/index.js"), - ("directories in packages", "package3", "/a/node_modules/package3/dir/index.js"), - ("extensions in aliasFields", "package4/a.js", "/a/node_modules/package4/b.js"), - ]; - - for (comment, request, expected) in successful_resolves { - let resolution = resolver.resolve("/a", request).map(|r| r.full_path()); - assert_eq!(resolution, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - } - - #[test] - #[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. - fn resolve_to_context() { - let file_system = file_system(); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - alias: vec![ - ("alias1".into(), vec![AliasValue::from("/a/abc")]), - ("alias2".into(), vec![AliasValue::from("/a")]), - ], - alias_fields: vec![vec!["browser".into()]], - fully_specified: true, - resolve_to_context: true, - ..ResolveOptions::default() - }, - ); - - let successful_resolves = [ - ("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", "/a/node_modules/package3/dir"), - ]; - - for (comment, request, expected) in successful_resolves { - let resolution = resolver.resolve("/a", request).map(|r| r.full_path()); - assert_eq!(resolution, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - } -} diff --git a/src/tests/imports_field.rs b/src/tests/imports_field.rs deleted file mode 100644 index c928627a..00000000 --- a/src/tests/imports_field.rs +++ /dev/null @@ -1,1320 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/importsField.test.js -//! -//! The huge imports field test cases are at the bottom of this file. - -use serde_json::json; - -use crate::{Ctx, JSONMap, PathUtil, ResolveError, ResolveOptions, Resolver}; -use std::path::Path; - -#[test] -fn test_simple() { - let f = super::fixture().join("imports-field"); - let f2 = super::fixture().join("imports-exports-wildcard/node_modules/m/"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve using imports field instead of self-referencing", f.clone(), "#imports-field", f.join("b.js")), - ("should resolve using imports field instead of self-referencing for a subpath", f.join("dir"), "#imports-field", f.join("b.js")), - ("should resolve package #1", f.clone(), "#a/dist/main.js", f.join("node_modules/a/lib/lib2/main.js")), - ("should resolve package #3", f.clone(), "#ccc/index.js", f.join("node_modules/c/index.js")), - ("should resolve package #4", f.clone(), "#c", f.join("node_modules/c/index.js")), - ("should resolve with wildcard pattern", f2.clone(), "#internal/i.js", f2.join("src/internal/i.js")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } - - // Note added: - // * should resolve absolute path as an imports field target - // * should log the correct info - - #[rustfmt::skip] - let fail = [ - ("should disallow resolve out of package scope", f.clone(), "#b", ResolveError::InvalidPackageTarget("../b.js".to_string(), "#b".to_string(), f.join("package.json"))), - ("should resolve package #2", f.clone(), "#a", ResolveError::PackageImportNotDefined("#a".to_string(), f.join("package.json"))), - ]; - - for (comment, path, request, error) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!(resolution, Err(error), "{comment} {path:?} {request}"); - } -} - -#[test] -fn shared_resolvers() { - let f = super::fixture().join("imports-field"); - - // field name #1 - let resolver1 = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - imports_fields: vec![vec!["imports".into()]], - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - let resolved_path = resolver1.resolve(&f, "#imports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("b.js"))); - - // field name #2 - let resolver2 = resolver1.clone_with_options(ResolveOptions { - imports_fields: vec![vec!["other".into(), "imports".into()]], - ..ResolveOptions::default() - }); - - let resolved_path = resolver2.resolve(&f, "#b").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("a.js"))); -} - -// Small script for generating the test cases from enhanced_resolve -// for (c of testCases) { -// console.log("TestCase {") -// console.log(`name: ${JSON.stringify(c.name)},`) -// if (c.expect instanceof Error) { -// console.log(`expect: None,`) -// } else { -// console.log(`expect: Some(vec!${JSON.stringify(c.expect)}),`) -// } -// console.log(`imports_field: imports_field(json!(${JSON.stringify(c.suite[0], null, 2)})),`) -// console.log(`request: "${c.suite[1]}",`) -// console.log(`condition_names: vec!${JSON.stringify(c.suite[2])},`) -// console.log("},") -// } - -struct TestCase { - name: &'static str, - expect: Option>, - imports_field: JSONMap, - request: &'static str, - condition_names: Vec<&'static str>, -} - -#[allow(clippy::needless_pass_by_value)] -fn imports_field(value: serde_json::Value) -> JSONMap { - let s = serde_json::to_string(&value).unwrap(); - serde_json::from_str(&s).unwrap() -} - -#[test] -fn test_cases() { - let test_cases = [ - TestCase { - name: "sample #1", - expect: Some(vec!["./dist/test/file.js"]), - imports_field: imports_field(json!({ - "#abc/": { - "import": [ - "./dist/", - "./src/" - ], - "webpack": "./wp/" - }, - "#abc": "./main.js" - })), - request: "#abc/test/file.js", - condition_names: vec!["import", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "sample #1", - expect: Some(vec!["./src/test/file.js"]), - imports_field: imports_field(json!({ - "#abc/": { - "import": [ - "./src/" - ], - "webpack": "./wp/" - }, - "#abc": "./main.js" - })), - request: "#abc/test/file.js", - condition_names: vec!["import", "webpack"], - }, - TestCase { - name: "sample #2", - expect: Some(vec!["./data/timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#1/timezones/": "./data/timezones/" - })), - request: "#1/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #3", - expect: Some(vec!["./data/timezones/timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#aaa/": "./data/timezones/", - "#a/": "./data/timezones/" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #4", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/lib/": { - "browser": [ - "./browser/" - ] - }, - "#a/dist/index.js": { - "node": "./index.js" - } - })), - request: "#a/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #5", - expect: Some(vec!["./browser/index.js"]), - imports_field: imports_field(json!({ - "#a/lib/": { - "browser": [ - "./browser/" - ] - }, - "#a/dist/index.js": { - "node": "./index.js", - "default": "./browser/index.js" - } - })), - request: "#a/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #6", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/dist/a": "./dist/index.js" - })), - request: "#a/dist/aaa", - condition_names: vec![], - }, - TestCase { - name: "sample #7", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/a/a/": "./dist/index.js" - })), - request: "#a/a/a", - condition_names: vec![], - }, - TestCase { - name: "sample #8", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": "./index.js" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #9", - expect: Some(vec!["./main.js"]), - imports_field: imports_field(json!({ - "#a/index.js": "./main.js" - })), - request: "#a/index.js", - condition_names: vec![], - }, - TestCase { - name: "sample #10", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #11", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/bar#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #12", - expect: Some(vec!["./ok.js#abc"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/ok.js#abc", - condition_names: vec![], - }, - TestCase { - name: "sample #13", - expect: Some(vec!["./ok.js?abc"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/ok.js?abc", - condition_names: vec![], - }, - TestCase { - name: "sample #14", - expect: Some(vec!["./🎉.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/🎉.js", - condition_names: vec![], - }, - TestCase { - name: "sample #15", - expect: Some(vec!["./%F0%9F%8E%89.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/%F0%9F%8E%89.js", - condition_names: vec![], - }, - TestCase { - name: "sample #16", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/🎉", - condition_names: vec![], - }, - TestCase { - name: "sample #17", - expect: Some(vec!["./other.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/%F0%9F%8E%89", - condition_names: vec![], - }, - TestCase { - name: "sample #18", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/module", - condition_names: vec![], - }, - TestCase { - name: "sample #19", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/module#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #20", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/module?foo", - condition_names: vec![], - }, - TestCase { - name: "sample #21", - expect: Some(vec!["./d?e?f"]), - imports_field: imports_field(json!({ - "#a/a?b?c/": "./" - })), - request: "#a/a?b?c/d?e?f", - condition_names: vec![], - }, - TestCase { - name: "sample #22", - // We throw InvalidPackageTarget - expect: None, - // expect: Some(vec!["/user/a/index"]), - imports_field: imports_field(json!({ - "#a/": "/user/a/" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #1", - expect: Some(vec!["./A/b/d.js"]), - imports_field: imports_field(json!({ - "#a/": "./A/", - "#a/b/c": "./c.js" - })), - request: "#a/b/d.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #2", - expect: Some(vec!["./A/c.js"]), - imports_field: imports_field(json!({ - "#a/": "./A/", - "#a/b": "./b.js" - })), - request: "#a/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #3", - expect: Some(vec!["./A/b/c/d.js"]), - imports_field: imports_field(json!({ - "#a/": "./A/", - "#a/b/c/d": "./c.js" - })), - request: "#a/b/c/d.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #1", - expect: Some(vec!["./dist/index.js"]), - imports_field: imports_field(json!({ - "#a": "./dist/index.js" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #2", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": "./" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #3", - expect: Some(vec!["./dist/a.js"]), - imports_field: imports_field(json!({ - "#a/": "./dist/", - "#a/index.js": "./dist/a.js" - })), - request: "#a/index.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #4", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "./browser/" - ] - }, - "#a/index.js": { - "browser": "./index.js" - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #5", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "./browser/" - ] - }, - "#a/index.js": { - "node": "./node.js" - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #6", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: "#a", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #7", - expect: Some(vec!["./src/index.js"]), // `enhanced_resolve` is `None` - imports_field: imports_field(json!({ - "#a": { - "default": "./src/index.js", - "browser": "./index.js", - "node": "./src/node/index.js" - } - })), - request: "#a", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #8", - expect: Some(vec!["./src/index.js"]), - imports_field: imports_field(json!({ - "#a": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #9", - expect: Some(vec!["./index"]), - imports_field: imports_field(json!({ - "#a": "./index" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #10", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/index": "./index.js" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #11", - // We throw InvalidPackageTarget - // expect: Some(vec!["b"]), - expect: None, - imports_field: imports_field(json!({ - "#a": "b" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #12", - // We throw InvalidPackageTarget - // expect: Some(vec!["b/index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "b/" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #13", - // We throw InvalidPackageTarget - // expect: Some(vec!["b#anotherhashishere"]), - expect: None, - imports_field: imports_field(json!({ - "#a?q=a#hashishere": "b#anotherhashishere" - })), - request: "#a?q=a#hashishere", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #1", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #2", - expect: Some(vec!["./import.mjs"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec!["import"], - }, - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./require.js"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./import.mjs"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./require.js"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": [ - "./require.js" - ] - }, - { - "import": [ - "./import.mjs", - "#b/import.js" - ] - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./import.mjs"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "./import.mjs", - "#b/import.js" - ] - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "#b/import.js" - ] - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "mapping to a folder root #1", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#timezones": "./data/timezones/" - })), - request: "#timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #2", - expect: None, - imports_field: imports_field(json!({ - "#timezones/": "./data/timezones" - })), - request: "#timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #3", - expect: Some(vec!["./data/timezones/pdt/index.mjs"]), - imports_field: imports_field(json!({ - "#timezones/pdt/": "./data/timezones/pdt/" - })), - request: "#timezones/pdt/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #4", - expect: Some(vec!["./timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#a/": "./timezones/" - })), - request: "#a/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #5", - expect: Some(vec!["./timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#a/": "./" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #6", - expect: None, - imports_field: imports_field(json!({ - "#a/": "." - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #7", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": "./" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #1", - expect: Some(vec!["./lib/index.mjs"]), - imports_field: imports_field(json!({ - "#a/": "./", - "#a/dist/": "./lib/" - })), - request: "#a/dist/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #2", - expect: Some(vec!["./dist/utils/index.js"]), - imports_field: imports_field(json!({ - "#a/dist/utils/": "./dist/utils/", - "#a/dist/": "./lib/" - })), - request: "#a/dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #3", - expect: Some(vec!["./dist/utils/index.js"]), - imports_field: imports_field(json!({ - "#a/dist/utils/index.js": "./dist/utils/index.js", - "#a/dist/utils/": "./dist/utils/index.mjs", - "#a/dist/": "./lib/" - })), - request: "#a/dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #4", - expect: Some(vec!["./lib/index.mjs"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./browser/" - }, - "#a/dist/": "./lib/" - })), - request: "#a/dist/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #1", - // This behaves differently from enhanced_resolve, because `lodash/` is an an InvalidPackageConfig - // expect: Some(vec!["lodash/index.js"]), - expect: Some(vec!["./utils/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "conditional mapping folder #1", - expect: Some(vec!["./utils/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #2", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./node/" - ] - } - })), - request: "#a/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "conditional mapping folder #3", - expect: Some(vec!["./wpk/index.mjs"]), - imports_field: imports_field(json!({ - "#a/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils/" - ] - } - })), - request: "#a/index.mjs", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "incorrect exports field #1", - // We throw `PackageImportNotDefined` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "/utils/": "./a/" - })), - request: "#a/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #2", - // We throw `PackageImportNotDefined` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "/utils/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#a/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #3", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index": "./a/index.js" - })), - request: "#a/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #4", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index.mjs": "./a/index.js" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #5", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "#a/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #6", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index.mjs": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "#a/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #1", - // We don't throw in `package_imports_exports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": "./a/" - })), - request: "/utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect request #2", - // We don't throw in `package_imports_exports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #3", - // We don't throw in `package_imports_exports_resolve`, it's thrown in `package_imports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #4", - // We don't throw in `package_imports_exports_resolve`, it's thrown in `package_imports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#/", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #5", - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#a/", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #1", - // expect: Some(vec!["./dist/index"]), - expect: Some(vec!["dist/index"]), - imports_field: imports_field(json!({ - "#a/../../utils/": "./dist/" - })), - request: "#a/../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #2", - // We throw InvalidPackageTarget - // expect: Some(vec!["./dist/../../utils/index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "./dist/" - })), - request: "#a/../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #3", - // We throw InvalidPackageTarget - // expect: Some(vec!["../src/index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "../src/" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #4", - // We throw InvalidPackageTarget - // expect: Some(vec!["./utils/../../../index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": { - "browser": "./utils/../../../" - } - })), - request: "#a/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #1", - // expect: Some(vec!["moment/node_modules/lodash/dist/index.js"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": { - "browser": "moment/node_modules/" - } - })), - request: "#a/lodash/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #2", - // We throw InvalidPackageTarget - // expect: Some(vec!["../node_modules/lodash/dist/index.js"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "../node_modules/" - })), - request: "#a/lodash/dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "nested mapping #1", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": "./", - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./node/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "nested mapping #3", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["webpack"], - }, - TestCase { - name: "nested mapping #4", - // We throw NotFound - // expect: Some(vec!["moment/node/index.js"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "moment/node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["node", "browser"], - }, - TestCase { - name: "nested mapping #5", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "node"], - }, - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./node/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - TestCase { - name: "nested mapping #7", - expect: Some(vec!["./y.js"]), - imports_field: imports_field(json!({ - "#a": { - "abc": { - "def": "./x.js" - }, - "ghi": "./y.js" - } - })), - request: "#a", - condition_names: vec!["abc", "ghi"], - }, - TestCase { - name: "nested mapping #8", - // We throw PackageImportNotDefined - // expect: Some(vec![]), - expect: None, - imports_field: imports_field(json!({ - "#a": { - "abc": { - "def": "./x.js", - "default": [] - }, - "ghi": "./y.js" - } - })), - request: "#a", - condition_names: vec!["abc", "ghi"], - }, - ]; - - for case in test_cases { - let resolved = Resolver::default() - .package_imports_exports_resolve( - case.request, - &case.imports_field, - Path::new(""), - true, - &case.condition_names.iter().map(ToString::to_string).collect::>(), - &mut Ctx::default(), - ) - .map(|p| p.map(|p| p.to_path_buf())); - if let Some(expect) = case.expect { - if expect.is_empty() { - assert!(matches!(resolved, Ok(None)), "{} {:?}", &case.name, &resolved); - } else { - for expect in expect { - assert_eq!(resolved, Ok(Some(Path::new(expect).normalize())), "{}", &case.name); - } - } - } else { - assert!(resolved.is_err(), "{} {resolved:?}", &case.name); - } - } -} diff --git a/src/tests/incorrect_description_file.rs b/src/tests/incorrect_description_file.rs deleted file mode 100644 index a5c81796..00000000 --- a/src/tests/incorrect_description_file.rs +++ /dev/null @@ -1,62 +0,0 @@ -//! - -use rustc_hash::FxHashSet; - -use crate::{JSONError, Resolution, ResolveContext, ResolveError, ResolveOptions, Resolver}; - -// should not resolve main in incorrect description file #1 -#[test] -fn incorrect_description_file_1() { - let f = super::fixture().join("incorrect-package"); - let mut ctx = ResolveContext::default(); - let resolution = Resolver::default().resolve_with_context(f.join("pack1"), ".", &mut ctx); - let error = ResolveError::JSON(JSONError { - path: f.join("pack1/package.json"), - message: String::from("EOF while parsing a value at line 3 column 0"), - line: 3, - column: 0, - }); - assert_eq!(resolution, Err(error)); - assert_eq!(ctx.file_dependencies, FxHashSet::from_iter([f.join("pack1/package.json")])); - assert!(ctx.missing_dependencies.is_empty()); -} - -// should not resolve main in incorrect description file #2 -#[test] -fn incorrect_description_file_2() { - let f = super::fixture().join("incorrect-package"); - let resolution = Resolver::default().resolve(f.join("pack2"), "."); - let error = ResolveError::JSON(JSONError { - path: f.join("pack2/package.json"), - message: String::from("EOF while parsing a value at line 1 column 0"), - line: 1, - column: 0, - }); - assert_eq!(resolution, Err(error)); -} - -// should not resolve main in incorrect description file #3 -#[test] -fn incorrect_description_file_3() { - let f = super::fixture().join("incorrect-package"); - let resolution = Resolver::default().resolve(f.join("pack2"), "."); - assert!(resolution.is_err()); -} - -// `enhanced_resolve` does not have this test case -#[test] -fn no_description_file() { - let f = super::fixture_root().join("enhanced_resolve"); - - // has description file - let resolver = Resolver::default(); - assert_eq!( - resolver.resolve(&f, ".").map(Resolution::into_path_buf), - Ok(f.join("lib/index.js")) - ); - - // without description file - let resolver = - Resolver::new(ResolveOptions { description_files: vec![], ..ResolveOptions::default() }); - assert_eq!(resolver.resolve(&f, "."), Err(ResolveError::NotFound(".".into()))); -} diff --git a/src/tests/main_field.rs b/src/tests/main_field.rs deleted file mode 100644 index 3cadc8ce..00000000 --- a/src/tests/main_field.rs +++ /dev/null @@ -1,24 +0,0 @@ -//! Not part of enhanced_resolve's test suite - -use crate::{ResolveOptions, Resolver}; - -#[test] -fn test() { - let f = super::fixture().join("restrictions"); - - let resolver1 = Resolver::new(ResolveOptions { - main_fields: vec!["style".into()], - ..ResolveOptions::default() - }); - - let resolution = resolver1.resolve(&f, "pck2").map(|r| r.full_path()); - assert_eq!(resolution, Ok(f.join("node_modules/pck2/index.css"))); - - let resolver2 = resolver1.clone_with_options(ResolveOptions { - main_fields: vec!["module".into(), "main".into()], - ..ResolveOptions::default() - }); - - let resolution = resolver2.resolve(&f, "pck2").map(|r| r.full_path()); - assert_eq!(resolution, Ok(f.join("node_modules/pck2/module.js"))); -} diff --git a/src/tests/memory_fs.rs b/src/tests/memory_fs.rs deleted file mode 100644 index e4116609..00000000 --- a/src/tests/memory_fs.rs +++ /dev/null @@ -1,74 +0,0 @@ -use std::{ - io, - path::{Path, PathBuf}, -}; - -use crate::{FileMetadata, FileSystem}; - -#[derive(Default)] -pub struct MemoryFS { - fs: vfs::MemoryFS, -} - -impl MemoryFS { - /// # Panics - /// - /// * Fails to create directory - /// * Fails to write file - #[allow(dead_code)] - pub fn new(data: &[(&'static str, &'static str)]) -> Self { - let mut fs = Self { fs: vfs::MemoryFS::default() }; - for (path, content) in data { - fs.add_file(Path::new(path), content); - } - fs - } - - #[allow(dead_code)] - pub fn add_file(&mut self, path: &Path, content: &str) { - use vfs::FileSystem; - let fs = &mut self.fs; - // Create all parent directories - for path in path.ancestors().collect::>().iter().rev() { - let path = path.to_string_lossy(); - if !fs.exists(path.as_ref()).unwrap() { - fs.create_dir(path.as_ref()).unwrap(); - } - } - // Create file - let mut file = fs.create_file(path.to_string_lossy().as_ref()).unwrap(); - file.write_all(content.as_bytes()).unwrap(); - } -} - -impl FileSystem for MemoryFS { - fn read_to_string(&self, path: &Path) -> io::Result { - use vfs::FileSystem; - let mut file = self - .fs - .open_file(path.to_string_lossy().as_ref()) - .map_err(|err| io::Error::new(io::ErrorKind::NotFound, err))?; - let mut buffer = String::new(); - file.read_to_string(&mut buffer).unwrap(); - Ok(buffer) - } - - fn metadata(&self, path: &Path) -> io::Result { - use vfs::FileSystem; - let metadata = self - .fs - .metadata(path.to_string_lossy().as_ref()) - .map_err(|err| io::Error::new(io::ErrorKind::NotFound, err))?; - let is_file = metadata.file_type == vfs::VfsFileType::File; - let is_dir = metadata.file_type == vfs::VfsFileType::Directory; - Ok(FileMetadata::new(is_file, is_dir, false)) - } - - fn symlink_metadata(&self, path: &Path) -> io::Result { - self.metadata(path) - } - - fn canonicalize(&self, _path: &Path) -> io::Result { - Err(io::Error::new(io::ErrorKind::NotFound, "not a symlink")) - } -} diff --git a/src/tests/missing.rs b/src/tests/missing.rs deleted file mode 100644 index 4bf611ef..00000000 --- a/src/tests/missing.rs +++ /dev/null @@ -1,106 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/missing.test.js - -use normalize_path::NormalizePath; - -use crate::{AliasValue, ResolveContext, ResolveOptions, Resolver}; - -#[test] -fn test() { - let f = super::fixture(); - - let data = [ - ( - "./missing-file", - vec![f.join("missing-file"), f.join("missing-file.js"), f.join("missing-file.node")], - ), - ( - "missing-module", - vec![ - f.join("node_modules/missing-module"), - f.parent().unwrap().join("node_modules"), // enhanced-resolve is "node_modules/missing-module" - ], - ), - ( - "missing-module/missing-file", - vec![ - f.join("node_modules/missing-module"), - // f.parent().unwrap().join("node_modules/missing-module"), // we don't report this - ], - ), - ( - "m1/missing-file", - vec![ - f.join("node_modules/m1/missing-file"), - f.join("node_modules/m1/missing-file.js"), - f.join("node_modules/m1/missing-file.node"), - // f.parent().unwrap().join("node_modules/m1"), // we don't report this - ], - ), - ( - "m1/", - vec![ - f.join("node_modules/m1/index"), - f.join("node_modules/m1/index.js"), - f.join("node_modules/m1/index.json"), - f.join("node_modules/m1/index.node"), - ], - ), - ("m1/a", vec![f.join("node_modules/m1/a")]), - ]; - - let resolver = Resolver::default(); - - for (specifier, missing_dependencies) in data { - let mut ctx = ResolveContext::default(); - let _ = resolver.resolve_with_context(&f, specifier, &mut ctx); - - for path in ctx.file_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - } - - for path in missing_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - assert!( - ctx.missing_dependencies.contains(&path), - "{specifier}: {path:?} not in {:?}", - &ctx.missing_dependencies - ); - } - } -} - -#[test] -fn alias_and_extensions() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias: vec![ - ( - "@scope-js/package-name/dir$".into(), - vec![AliasValue::Path(f.join("foo/index.js").to_string_lossy().to_string())], - ), - ( - "react-dom".into(), - vec![AliasValue::Path(f.join("foo/index.js").to_string_lossy().to_string())], - ), - ], - extensions: vec![".server.ts".into()], - - ..ResolveOptions::default() - }); - - let mut ctx = ResolveContext::default(); - let _ = resolver.resolve_with_context(&f, "@scope-js/package-name/dir/router", &mut ctx); - let _ = resolver.resolve_with_context(&f, "react-dom/client", &mut ctx); - - for path in ctx.file_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - } - - for path in ctx.missing_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - if let Some(path) = path.parent() { - assert!(!path.is_file(), "{path:?} must not be a file"); - } - } -} diff --git a/src/tests/mod.rs b/src/tests/mod.rs deleted file mode 100644 index 94e6bd86..00000000 --- a/src/tests/mod.rs +++ /dev/null @@ -1,49 +0,0 @@ -mod alias; -mod browser_field; -mod builtins; -mod dependencies; -mod exports_field; -mod extension_alias; -mod extensions; -mod fallback; -mod full_specified; -mod imports_field; -mod incorrect_description_file; -mod main_field; -mod memory_fs; -mod missing; -mod resolve; -mod restrictions; -mod roots; -mod scoped_packages; -mod simple; -mod symlink; -mod tsconfig_paths; -mod tsconfig_project_references; - -use crate::Resolver; -use std::{env, path::PathBuf, sync::Arc, thread}; - -pub fn fixture_root() -> PathBuf { - env::current_dir().unwrap().join("fixtures") -} - -pub fn fixture() -> PathBuf { - fixture_root().join("enhanced_resolve").join("test").join("fixtures") -} - -#[test] -fn threaded_environment() { - let cwd = env::current_dir().unwrap(); - let resolver = Arc::new(Resolver::default()); - for _ in 0..2 { - _ = thread::spawn({ - let cwd = cwd.clone(); - let resolver = Arc::clone(&resolver); - move || { - _ = resolver.resolve(cwd, "."); - } - }) - .join(); - } -} diff --git a/src/tests/resolve.rs b/src/tests/resolve.rs deleted file mode 100644 index f2dbb88e..00000000 --- a/src/tests/resolve.rs +++ /dev/null @@ -1,119 +0,0 @@ -//! - -use crate::{ResolveError, ResolveOptions, Resolver}; - -#[test] -fn resolve() { - let f = super::fixture(); - - let resolver = Resolver::default(); - - let main1_js_path = f.join("main1.js").to_string_lossy().to_string(); - - #[rustfmt::skip] - let pass = [ - ("absolute path", f.clone(), main1_js_path.as_str(), f.join("main1.js")), - ("file with .js", f.clone(), "./main1.js", f.join("main1.js")), - ("file without extension", f.clone(), "./main1", f.join("main1.js")), - ("another file with .js", f.clone(), "./a.js", f.join("a.js")), - ("another file without extension", f.clone(), "./a", f.join("a.js")), - ("file in module with .js", f.clone(), "m1/a.js", f.join("node_modules/m1/a.js")), - ("file in module without extension", f.clone(), "m1/a", f.join("node_modules/m1/a.js")), - ("another file in module without extension", f.clone(), "complexm/step1", f.join("node_modules/complexm/step1.js")), - ("from submodule to file in sibling module", f.join("node_modules/complexm"), "m2/b.js", f.join("node_modules/m2/b.js")), - ("from nested directory to overwritten file in module", f.join("multiple_modules"), "m1/a.js", f.join("multiple_modules/node_modules/m1/a.js")), - ("from nested directory to not overwritten file in module", f.join("multiple_modules"), "m1/b.js", f.join("node_modules/m1/b.js")), - ("file with query", f.clone(), "./main1.js?query", f.join("main1.js?query")), - ("file with fragment", f.clone(), "./main1.js#fragment", f.join("main1.js#fragment")), - ("file with fragment and query", f.clone(), "./main1.js#fragment?query", f.join("main1.js#fragment?query")), - ("file with query and fragment", f.clone(), "./main1.js?#fragment", f.join("main1.js?#fragment")), - - ("file with query (unicode)", f.clone(), "./测试.js?query", f.join("测试.js?query")), - ("file with fragment (unicode)", f.clone(), "./测试.js#fragment", f.join("测试.js#fragment")), - ("file with fragment and query (unicode)", f.clone(), "./测试.js#fragment?query", f.join("测试.js#fragment?query")), - ("file with query and fragment (unicode)", f.clone(), "./测试.js?#fragment", f.join("测试.js?#fragment")), - - ("file in module with query", f.clone(), "m1/a?query", f.join("node_modules/m1/a.js?query")), - ("file in module with fragment", f.clone(), "m1/a#fragment", f.join("node_modules/m1/a.js#fragment")), - ("file in module with fragment and query", f.clone(), "m1/a#fragment?query", f.join("node_modules/m1/a.js#fragment?query")), - ("file in module with query and fragment", f.clone(), "m1/a?#fragment", f.join("node_modules/m1/a.js?#fragment")), - ("file in module with query and fragment", f.clone(), "m1/a?#fragment", f.join("node_modules/m1/a.js?#fragment")), - ("differ between directory and file, resolve file", f.clone(), "./dirOrFile", f.join("dirOrFile.js")), - ("differ between directory and file, resolve directory", f.clone(), "./dirOrFile/", f.join("dirOrFile/index.js")), - ("find node_modules outside of node_modules", f.join("browser-module/node_modules"), "m1/a", f.join("node_modules/m1/a.js")), - ("don't crash on main field pointing to self", f.clone(), "./main-field-self", f.join("./main-field-self/index.js")), - ("don't crash on main field pointing to self (2)", f.clone(), "./main-field-self2", f.join("./main-field-self2/index.js")), - // enhanced-resolve has `#` prepended with a `\0`, they are removed from the - // following 3 expected test results. - // See https://github.com/webpack/enhanced-resolve#escaping - ("handle fragment edge case (no fragment)", f.clone(), "./no#fragment/#/#", f.join("no#fragment/#/#.js")), - ("handle fragment edge case (fragment)", f.clone(), "./no#fragment/#/", f.join("no.js#fragment/#/")), - ("handle fragment escaping", f.clone(), "./no\0#fragment/\0#/\0##fragment", f.join("no#fragment/#/#.js#fragment")), - - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn issue238_resolve() { - let f = super::fixture().join("issue-238"); - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into(), ".jsx".into(), ".ts".into(), ".tsx".into()], - modules: vec!["src/a".into(), "src/b".into(), "src/common".into(), "node_modules".into()], - ..ResolveOptions::default() - }); - let resolved_path = - resolver.resolve(f.join("src/common"), "config/myObjectFile").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("src/common/config/myObjectFile.js")),); -} - -#[test] -fn prefer_relative() { - let f = super::fixture(); - - let resolver = - Resolver::new(ResolveOptions { prefer_relative: true, ..ResolveOptions::default() }); - - #[rustfmt::skip] - let pass = [ - ("should correctly resolve with preferRelative 1", "main1.js", f.join("main1.js")), - ("should correctly resolve with preferRelative 2", "m1/a.js", f.join("node_modules/m1/a.js")), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } -} - -#[test] -fn resolve_to_context() { - let f = super::fixture(); - let resolver = - Resolver::new(ResolveOptions { resolve_to_context: true, ..ResolveOptions::default() }); - - #[rustfmt::skip] - let data = [ - ("context for fixtures", f.clone(), "./", f.clone()), - ("context for fixtures/lib", f.clone(), "./lib", f.join("lib")), - ("context for fixtures with ..", f.clone(), "./lib/../../fixtures/./lib/..", f.clone()), - ("context for fixtures with query", f.clone(), "./?query", f.clone().with_file_name("fixtures?query")), - ]; - - for (comment, path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn resolve_hash_as_module() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions::default()); - let resolution = resolver.resolve(f, "#a"); - assert_eq!(resolution, Err(ResolveError::NotFound("#a".into()))); -} diff --git a/src/tests/restrictions.rs b/src/tests/restrictions.rs deleted file mode 100644 index 5ba56596..00000000 --- a/src/tests/restrictions.rs +++ /dev/null @@ -1,25 +0,0 @@ -//! - -use crate::{ResolveError, ResolveOptions, Resolver, Restriction}; - -// TODO: regex -// * should respect RegExp restriction -// * should try to find alternative #1 -// * should try to find alternative #2 -// * should try to find alternative #3 - -// should respect string restriction -#[test] -fn restriction1() { - let fixture = super::fixture(); - let f = fixture.join("restrictions"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - restrictions: vec![Restriction::Path(f.clone())], - ..ResolveOptions::default() - }); - - let resolution = resolver.resolve(&f, "pck2"); - assert_eq!(resolution, Err(ResolveError::Restriction(fixture.join("c.js"), f))); -} diff --git a/src/tests/roots.rs b/src/tests/roots.rs deleted file mode 100644 index b50e2a07..00000000 --- a/src/tests/roots.rs +++ /dev/null @@ -1,92 +0,0 @@ -//! - -use std::path::PathBuf; - -use crate::{AliasValue, ResolveError, ResolveOptions, Resolver}; - -fn dirname() -> PathBuf { - super::fixture_root().join("enhanced_resolve").join("test") -} - -#[test] -fn roots() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - alias: vec![("foo".into(), vec![AliasValue::from("/fixtures")])], - roots: vec![dirname(), f.clone()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should respect roots option", "/fixtures/b.js", f.join("b.js")), - ("should try another root option, if it exists", "/b.js", f.join("b.js")), - ("should respect extension", "/fixtures/b", f.join("b.js")), - ("should resolve in directory", "/fixtures/extensions/dir", f.join("extensions/dir/index.js")), - ("should respect aliases", "foo/b", f.join("b.js")), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } - - #[rustfmt::skip] - let fail = [ - ("should not work with relative path", "fixtures/b.js", ResolveError::NotFound("fixtures/b.js".into())) - ]; - - for (comment, request, expected) in fail { - let resolution = resolver.resolve(&f, request); - assert_eq!(resolution, Err(expected), "{comment} {request}"); - } -} - -#[test] -fn resolve_to_context() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - roots: vec![dirname(), f.clone()], - resolve_to_context: true, - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f, "/fixtures/lib").map(|r| r.full_path()); - let expected = f.join("lib"); - assert_eq!(resolved_path, Ok(expected)); -} - -#[test] -fn prefer_absolute() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - alias: vec![("foo".into(), vec![AliasValue::from("/fixtures")])], - roots: vec![dirname(), f.clone()], - prefer_absolute: true, - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve an absolute path (prefer absolute)", f.join("b.js").to_string_lossy().to_string(), f.join("b.js")), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(&f, &request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } -} - -#[test] -fn roots_fall_through() { - let f = super::fixture(); - let absolute_path = f.join("roots_fall_through/index.js"); - let specifier = absolute_path.to_string_lossy(); - let resolution = Resolver::new(ResolveOptions::default().with_root(&f)).resolve(&f, &specifier); - assert_eq!( - resolution.map(super::super::resolution::Resolution::into_path_buf), - Ok(absolute_path) - ); -} diff --git a/src/tests/scoped_packages.rs b/src/tests/scoped_packages.rs deleted file mode 100644 index 8258f00f..00000000 --- a/src/tests/scoped_packages.rs +++ /dev/null @@ -1,25 +0,0 @@ -//! - -use crate::{ResolveOptions, Resolver}; - -#[test] -fn scoped_packages() { - let f = super::fixture().join("scoped"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("main field should work", f.clone(), "@scope/pack1", f.join("./node_modules/@scope/pack1/main.js")), - ("browser field should work", f.clone(), "@scope/pack2", f.join("./node_modules/@scope/pack2/main.js")), - ("folder request should work", f.clone(), "@scope/pack2/lib", f.join("./node_modules/@scope/pack2/lib/index.js")) - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} diff --git a/src/tests/simple.rs b/src/tests/simple.rs deleted file mode 100644 index 08e1238a..00000000 --- a/src/tests/simple.rs +++ /dev/null @@ -1,68 +0,0 @@ -//! - -use std::env; - -use crate::Resolver; - -#[test] -fn simple() { - // mimic `enhanced-resolve/test/simple.test.js` - let dirname = env::current_dir().unwrap().join("fixtures"); - let f = dirname.join("enhanced_resolve/test"); - - let resolver = Resolver::default(); - - let data = [ - ("direct", f.clone(), "../lib/index"), - ("as directory", f, ".."), - ("as module", dirname.clone(), "./enhanced_resolve"), - ]; - - for (comment, path, request) in data { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - let expected = dirname.join("enhanced_resolve/lib/index.js"); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn dashed_name() { - let f = super::fixture(); - - let resolver = Resolver::default(); - - let data = [ - (f.clone(), "dash", f.join("node_modules/dash/index.js")), - (f.clone(), "dash-name", f.join("node_modules/dash-name/index.js")), - (f.join("node_modules/dash"), "dash", f.join("node_modules/dash/index.js")), - (f.join("node_modules/dash"), "dash-name", f.join("node_modules/dash-name/index.js")), - (f.join("node_modules/dash-name"), "dash", f.join("node_modules/dash/index.js")), - (f.join("node_modules/dash-name"), "dash-name", f.join("node_modules/dash-name/index.js")), - ]; - - for (path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{path:?} {request}"); - } -} - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows { - use super::super::memory_fs::MemoryFS; - - use crate::ResolveOptions; - - #[test] - fn no_package() { - use crate::ResolverGeneric; - use std::path::Path; - let f = Path::new("/"); - let file_system = MemoryFS::new(&[]); - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions::default(), - ); - let resolved_path = resolver.resolve(f, "package"); - assert!(resolved_path.is_err()); - } -} diff --git a/src/tests/symlink.rs b/src/tests/symlink.rs deleted file mode 100644 index 7589b560..00000000 --- a/src/tests/symlink.rs +++ /dev/null @@ -1,121 +0,0 @@ -use std::{fs, io, path::Path}; - -use crate::{ResolveOptions, Resolver}; - -#[derive(Debug, Clone, Copy)] -enum FileType { - File, - Dir, -} - -#[allow(unused_variables)] -fn symlink, Q: AsRef>( - original: P, - link: Q, - file_type: FileType, -) -> io::Result<()> { - #[cfg(target_family = "unix")] - { - std::os::unix::fs::symlink(original, link) - } - - #[cfg(target_family = "windows")] - match file_type { - FileType::File => std::os::windows::fs::symlink_file(original, link), - FileType::Dir => std::os::windows::fs::symlink_dir(original, link), - } -} - -fn init(dirname: &Path, temp_path: &Path) -> io::Result<()> { - if temp_path.exists() { - _ = fs::remove_dir_all(temp_path); - } - fs::create_dir(temp_path)?; - symlink(dirname.join("../lib/index.js"), temp_path.join("test"), FileType::File)?; - symlink(dirname.join("../lib"), temp_path.join("test2"), FileType::Dir)?; - fs::remove_file(temp_path.join("test"))?; - fs::remove_file(temp_path.join("test2"))?; - fs::remove_dir(temp_path) -} - -fn create_symlinks(dirname: &Path, temp_path: &Path) -> io::Result<()> { - fs::create_dir(temp_path).unwrap(); - symlink( - dirname.join("../lib/index.js").canonicalize().unwrap(), - temp_path.join("index.js"), - FileType::File, - )?; - symlink(dirname.join("../lib").canonicalize().unwrap(), temp_path.join("lib"), FileType::Dir)?; - symlink(dirname.join("..").canonicalize().unwrap(), temp_path.join("this"), FileType::Dir)?; - symlink(temp_path.join("this"), temp_path.join("that"), FileType::Dir)?; - symlink(Path::new("../../lib/index.js"), temp_path.join("node.relative.js"), FileType::File)?; - symlink( - Path::new("./node.relative.js"), - temp_path.join("node.relative.sym.js"), - FileType::File, - )?; - Ok(()) -} - -fn cleanup_symlinks(temp_path: &Path) { - _ = fs::remove_dir_all(temp_path); -} - -#[test] -fn test() -> io::Result<()> { - let root = super::fixture_root().join("enhanced_resolve"); - let dirname = root.join("test"); - let temp_path = dirname.join("temp"); - if !temp_path.exists() { - let is_admin = init(&dirname, &temp_path).is_ok(); - if !is_admin { - return Ok(()); - } - if let Err(err) = create_symlinks(&dirname, &temp_path) { - cleanup_symlinks(&temp_path); - return Err(err); - } - } - - let resolver_without_symlinks = - Resolver::new(ResolveOptions { symlinks: false, ..ResolveOptions::default() }); - let resolver_with_symlinks = Resolver::default(); - - #[rustfmt::skip] - let pass = [ - ("with a symlink to a file", temp_path.clone(), "./index.js"), - ("with a relative symlink to a file", temp_path.clone(), "./node.relative.js"), - ("with a relative symlink to a symlink to a file", temp_path.clone(), "./node.relative.sym.js"), - ("with a symlink to a directory 1", temp_path.clone(), "./lib/index.js"), - ("with a symlink to a directory 2", temp_path.clone(), "./this/lib/index.js"), - ("with multiple symlinks in the path 1", temp_path.clone(), "./this/test/temp/index.js"), - ("with multiple symlinks in the path 2", temp_path.clone(), "./this/test/temp/lib/index.js"), - ("with multiple symlinks in the path 3", temp_path.clone(), "./this/test/temp/this/lib/index.js"), - ("with a symlink to a directory 2 (chained)", temp_path.clone(), "./that/lib/index.js"), - ("with multiple symlinks in the path 1 (chained)", temp_path.clone(), "./that/test/temp/index.js"), - ("with multiple symlinks in the path 2 (chained)", temp_path.clone(), "./that/test/temp/lib/index.js"), - ("with multiple symlinks in the path 3 (chained)", temp_path.clone(), "./that/test/temp/that/lib/index.js"), - ("with symlinked directory as context 1", temp_path.join( "lib"), "./index.js"), - ("with symlinked directory as context 2", temp_path.join( "this"), "./lib/index.js"), - ("with symlinked directory as context and in path", temp_path.join( "this"), "./test/temp/lib/index.js"), - ("with symlinked directory in context path", temp_path.join( "this/lib"), "./index.js"), - ("with symlinked directory in context path and symlinked file", temp_path.join( "this/test"), "./temp/index.js"), - ("with symlinked directory in context path and symlinked directory", temp_path.join( "this/test"), "./temp/lib/index.js"), - ("with symlinked directory as context 2 (chained)", temp_path.join( "that"), "./lib/index.js"), - ("with symlinked directory as context and in path (chained)", temp_path.join( "that"), "./test/temp/lib/index.js"), - ("with symlinked directory in context path (chained)", temp_path.join( "that/lib"), "./index.js"), - ("with symlinked directory in context path and symlinked file (chained)", temp_path.join( "that/test"), "./temp/index.js"), - ("with symlinked directory in context path and symlinked directory (chained)", temp_path.join( "that/test"), "./temp/lib/index.js") - ]; - - for (comment, path, request) in pass { - let filename = resolver_with_symlinks.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(filename, Ok(root.join("lib/index.js")), "{comment:?}"); - - let resolved_path = - resolver_without_symlinks.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(path.join(request))); - } - - Ok(()) -} diff --git a/src/tests/tsconfig_paths.rs b/src/tests/tsconfig_paths.rs deleted file mode 100644 index 26935b5c..00000000 --- a/src/tests/tsconfig_paths.rs +++ /dev/null @@ -1,507 +0,0 @@ -//! tests for tsconfig-paths -//! -//! Fixtures copied from . - -use std::path::{Path, PathBuf}; - -use crate::{ - ResolveError, ResolveOptions, Resolver, TsConfig, TsconfigOptions, TsconfigReferences, -}; - -// -#[test] -fn tsconfig() { - let f = super::fixture_root().join("tsconfig"); - - #[rustfmt::skip] - let pass = [ - (f.clone(), None, "ts-path", f.join("foo.js")), - (f.join("nested"), None, "ts-path", f.join("nested/test.js")), - (f.join("cases/index"), None, "foo", f.join("node_modules/tsconfig-index/foo.js")), - // This requires reading package.json.tsconfig field - // (f.join("cases/field"), "foo", f.join("node_modules/tsconfig-field/foo.js")) - (f.join("cases/exports"), None, "foo", f.join("node_modules/tsconfig-exports/foo.js")), - (f.join("cases/extends-extension"), None, "foo", f.join("cases/extends-extension/foo.js")), - (f.join("cases/extends-extensionless"), None, "foo", f.join("node_modules/tsconfig-field/foo.js")), - (f.join("cases/extends-paths"), Some("src"), "@/index", f.join("cases/extends-paths/src/index.js")), - (f.join("cases/extends-multiple"), None, "foo", f.join("cases/extends-multiple/foo.js")), - ]; - - for (dir, subdir, request, expected) in pass { - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: dir.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - let path = subdir.map_or(dir.clone(), |subdir| dir.join(subdir)); - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{request} {path:?}"); - } - - #[rustfmt::skip] - let data = [ - (f.join("node_modules/tsconfig-not-used"), "ts-path", Ok(f.join("foo.js"))), - ]; - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - for (path, request, expected) in data { - let resolution = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolution, expected, "{path:?} {request}"); - } -} - -#[test] -fn tsconfig_fallthrough() { - let f = super::fixture_root().join("tsconfig"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "/"); - assert_eq!(resolved_path, Err(ResolveError::NotFound("/".into()))); -} - -#[test] -fn json_with_comments() { - let f = super::fixture_root().join("tsconfig/cases/trailing-comma"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "foo").map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(f.join("bar.js"))); -} - -// -#[test] -fn test_paths() { - let path = Path::new("/foo/tsconfig.json"); - let mut tsconfig_json = serde_json::json!({ - "compilerOptions": { - "paths": { - "jquery": ["node_modules/jquery/dist/jquery"], - "*": ["generated/*"], - "bar/*": ["test/*"], - "bar/baz/*": ["baz/*", "yo/*"], - "@/components/*": ["components/*"], - "url": ["node_modules/my-url"], - } - } - }) - .to_string(); - let tsconfig = TsConfig::parse(true, path, &mut tsconfig_json).unwrap(); - - let data = [ - ("jquery", vec!["/foo/node_modules/jquery/dist/jquery"]), - ("test", vec!["/foo/generated/test"]), - ("test/hello", vec!["/foo/generated/test/hello"]), - ("bar/hi", vec!["/foo/test/hi"]), - ("bar/baz/hi", vec!["/foo/baz/hi", "/foo/yo/hi"]), - ("@/components/button", vec!["/foo/components/button"]), - ("./jquery", vec![]), - ("url", vec!["/foo/node_modules/my-url"]), - ]; - - for (specifier, expected) in data { - let paths = tsconfig.resolve_path_alias(specifier); - let expected = expected.into_iter().map(PathBuf::from).collect::>(); - assert_eq!(paths, expected, "{specifier}"); - } -} - -// -#[test] -fn test_base_url() { - let path = Path::new("/foo/tsconfig.json"); - let mut tsconfig_json = serde_json::json!({ - "compilerOptions": { - "baseUrl": "./src" - } - }) - .to_string(); - let tsconfig = TsConfig::parse(true, path, &mut tsconfig_json).unwrap(); - - let data = [ - ("foo", vec!["/foo/src/foo"]), - ("components/button", vec!["/foo/src/components/button"]), - ("./jquery", vec![]), - ]; - - for (specifier, expected) in data { - let paths = tsconfig.resolve_path_alias(specifier); - let expected = expected.into_iter().map(PathBuf::from).collect::>(); - assert_eq!(paths, expected, "{specifier}"); - } -} - -// -#[test] -fn test_paths_and_base_url() { - let path = Path::new("/foo/tsconfig.json"); - let mut tsconfig_json = serde_json::json!({ - "compilerOptions": { - "baseUrl": "./src", - "paths": { - "*": ["generated/*"], - "bar/*": ["test/*"], - "bar/baz/*": ["baz/*", "yo/*"], - "@/components/*": ["components/*"] - } - } - }) - .to_string(); - let tsconfig = TsConfig::parse(true, path, &mut tsconfig_json).unwrap(); - - let data = [ - ("test", vec!["/foo/src/generated/test", "/foo/src/test"]), - ("test/hello", vec!["/foo/src/generated/test/hello", "/foo/src/test/hello"]), - ("bar/hi", vec!["/foo/src/test/hi", "/foo/src/bar/hi"]), - ("bar/baz/hi", vec!["/foo/src/baz/hi", "/foo/src/yo/hi", "/foo/src/bar/baz/hi"]), - ("@/components/button", vec!["/foo/src/components/button", "/foo/src/@/components/button"]), - ("./jquery", vec![]), - ]; - - for (specifier, expected) in data { - let paths = tsconfig.resolve_path_alias(specifier); - let expected = expected.into_iter().map(PathBuf::from).collect::>(); - assert_eq!(paths, expected, "{specifier}"); - } -} - -// Template variable ${configDir} for substitution of config files directory path -// https://github.com/microsoft/TypeScript/pull/58042 -#[test] -fn test_template_variable() { - let f = super::fixture_root().join("tsconfig"); - let f2 = f.join("cases").join("paths_template_variable"); - - #[rustfmt::skip] - let pass = [ - (f2.clone(), "tsconfig1.json", "foo", f2.join("foo.js")), - (f2.clone(), "tsconfig2.json", "foo", f2.join("foo.js")), - (f.clone(), "tsconfig_template_variable.json", "foo", f.join("foo.js")), - ]; - - for (dir, tsconfig, request, expected) in pass { - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: dir.join(tsconfig), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&dir, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{request} {tsconfig} {dir:?}"); - } -} - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows_test { - use std::path::{Path, PathBuf}; - - use crate::{ - ResolveError, ResolveOptions, ResolverGeneric, TsconfigOptions, TsconfigReferences, - }; - - use super::super::memory_fs::MemoryFS; - - struct OneTest { - name: &'static str, - tsconfig: String, - package_json: Option<(PathBuf, String)>, - main_fields: Option>, - existing_files: Vec<&'static str>, - requested_module: &'static str, - expected_path: &'static str, - extensions: Vec, - } - - impl Default for OneTest { - fn default() -> Self { - Self { - name: "", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/*": ["location/*"] - } - } - }) - .to_string(), - package_json: None, - main_fields: None, - existing_files: vec![], - requested_module: "", - expected_path: "", - extensions: vec![ - ".js".into(), - ".json".into(), - ".node".into(), - ".ts".into(), - ".tsx".into(), - ], - } - } - } - - impl OneTest { - fn resolver(&self, root: &Path) -> ResolverGeneric { - let mut file_system = MemoryFS::default(); - - file_system.add_file(&root.join("tsconfig.json"), &self.tsconfig); - if let Some((path, package_json)) = &self.package_json { - file_system.add_file(&root.join(path).join("package.json"), package_json); - } - for path in &self.existing_files { - file_system.add_file(Path::new(path), ""); - } - - let mut options = ResolveOptions { - extensions: self.extensions.clone(), - tsconfig: Some(TsconfigOptions { - config_file: root.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }; - if let Some(main_fields) = &self.main_fields { - options.main_fields.clone_from(main_fields); - } - - ResolverGeneric::::new_with_file_system(file_system, options) - } - } - - // Path matching tests from tsconfig-paths - // * - // * - #[test] - fn match_path() { - let pass = [ - OneTest { - name: "should locate path that matches with star and exists", - existing_files: vec!["/root/location/mylib/index.ts"], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve to correct path when many are specified", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/*": ["foo1/*", "foo2/*", "location/*", "foo3/*"], - } - } - }) - .to_string(), - existing_files: vec!["/root/location/mylib/index.ts"], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should locate path that matches with star and prioritize pattern with longest prefix", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "*": ["location/*"], - "lib/*": ["location/*"], - } - } - }) - .to_string(), - existing_files: vec![ - "/root/location/lib/mylib/index.ts", - "/root/location/mylib/index.ts", - ], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should locate path that matches with star and exists with extension", - existing_files: vec![ - "/root/location/mylib.myext", - ], - requested_module: "lib/mylib", - extensions: vec![".js".into(), ".myext".into()], - expected_path: "/root/location/mylib.myext", - ..OneTest::default() - }, - OneTest { - name: "should resolve request with extension specified", - existing_files: vec![ - "/root/location/test.jpg", - ], - requested_module: "lib/test.jpg", - expected_path: "/root/location/test.jpg", - ..OneTest::default() - }, - OneTest { - name: "should locate path that matches without star and exists", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/foo": ["location/foo"] - } - } - }) - .to_string(), - existing_files: vec![ - "/root/location/foo.ts", - ], - requested_module: "lib/foo", - expected_path: "/root/location/foo.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve to parent folder when filename is in subfolder", - existing_files: vec![ - "/root/location/mylib/index.ts", - ], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve from main field in package.json", - package_json: Some((PathBuf::from("/root/location/mylib"), serde_json::json!({ - "main": "./kalle.ts" - }).to_string())), - existing_files: vec![ - "/root/location/mylib/kalle.ts", - ], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/kalle.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve from main field in package.json (js)", - package_json: Some((PathBuf::from("/root/location/mylib.js"), serde_json::json!({ - "main": "./kalle.js" - }).to_string())), - existing_files: vec![ - "/root/location/mylib.js/kalle.js", - ], - extensions: vec![".ts".into(), ".js".into()], - requested_module: "lib/mylib.js", - expected_path: "/root/location/mylib.js/kalle.js", - ..OneTest::default() - }, - OneTest { - name: "should resolve from list of fields by priority in package.json", - main_fields: Some(vec!["missing".into(), "browser".into(), "main".into()]), - package_json: Some((PathBuf::from("/root/location/mylibjs"), serde_json::json!({ - "main": "./main.js", - "browser": "./browser.js" - }).to_string())), - existing_files: vec![ - "/root/location/mylibjs/main.js", - "/root/location/mylibjs/browser.js", - ], - extensions: vec![".ts".into(), ".js".into()], - requested_module: "lib/mylibjs", - expected_path: "/root/location/mylibjs/browser.js", - ..OneTest::default() - }, -OneTest { - name: "should ignore field mappings to missing files in package.json", - main_fields: Some(vec!["browser".into(), "main".into()]), - package_json: Some((PathBuf::from("/root/location/mylibjs"), serde_json::json!({ - "main": "./kalle.js", - "browser": "./nope.js" - }).to_string())), - existing_files: vec![ - "/root/location/mylibjs/kalle.js", - ], - extensions: vec![".ts".into(), ".js".into()], - requested_module: "lib/mylibjs", - expected_path: "/root/location/mylibjs/kalle.js", - ..OneTest::default() - }, - // Tests that are not applicable: - // name: "should resolve nested main fields" - // name: "should ignore advanced field mappings in package.json" - // name: "should resolve to with the help of baseUrl when not explicitly set" - // name: "should not resolve with the help of baseUrl when asked not to" - // name: "should resolve main file with cjs file extension" - OneTest { - name: "should resolve .ts from .js alias", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "@/*": ["src/*"] - } - } - }).to_string(), - existing_files: vec![ - "/root/src/foo.ts", - ], - requested_module: "@/foo", // original data was "@/foo.ts" but I don't get why it is the case? - expected_path: "/root/src/foo.ts", // original data was "/root/src/foo" - ..OneTest::default() - }, - ]; - - let root = PathBuf::from("/root"); - - for test in pass { - let resolved_path = - test.resolver(&root).resolve(&root, test.requested_module).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(PathBuf::from(test.expected_path)), "{}", test.name); - } - - let fail = [ - OneTest { - name: "should not locate path that does not match", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/*": ["location/*"] - } - } - }) - .to_string(), - existing_files: vec!["/root/location/mylib"], - requested_module: "lib/mylibjs", - ..OneTest::default() - }, - OneTest { - name: "should not resolve typings file (index.d.ts)", - existing_files: vec!["/root/location/mylib/index.d.ts"], - requested_module: "lib/mylib", - ..OneTest::default() - }, - ]; - - for test in fail { - let resolved_path = - test.resolver(&root).resolve(&root, test.requested_module).map(|f| f.full_path()); - assert_eq!( - resolved_path, - Err(ResolveError::NotFound(test.requested_module.into())), - "{}", - test.name - ); - } - } -} diff --git a/src/tests/tsconfig_project_references.rs b/src/tests/tsconfig_project_references.rs deleted file mode 100644 index b552fefe..00000000 --- a/src/tests/tsconfig_project_references.rs +++ /dev/null @@ -1,101 +0,0 @@ -//! Tests for tsconfig project references - -use crate::{ResolveError, ResolveOptions, Resolver, TsconfigOptions, TsconfigReferences}; - -#[test] -fn auto() { - let f = super::fixture_root().join("tsconfig/cases/project_references"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("app"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - // Test normal paths alias - (f.join("app"), "@/index.ts", f.join("app/aliased/index.ts")), - (f.join("app"), "@/../index.ts", f.join("app/index.ts")), - // Test project reference - (f.join("project_a"), "@/index.ts", f.join("project_a/aliased/index.ts")), - (f.join("project_b/src"), "@/index.ts", f.join("project_b/src/aliased/index.ts")), - // Does not have paths alias - (f.join("project_a"), "./index.ts", f.join("project_a/index.ts")), - (f.join("project_c"), "./index.ts", f.join("project_c/index.ts")), - // Template variable - { - let dir = f.parent().unwrap().join("paths_template_variable"); - (dir.clone(), "foo", dir.join("foo.js")) - } - ]; - - for (path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{request} {path:?}"); - } -} - -#[test] -fn disabled() { - let f = super::fixture_root().join("tsconfig/cases/project_references"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("app"), - references: TsconfigReferences::Disabled, - }), - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - // Test normal paths alias - (f.join("app"), "@/index.ts", Ok(f.join("app/aliased/index.ts"))), - (f.join("app"), "@/../index.ts", Ok(f.join("app/index.ts"))), - // Test project reference - (f.join("project_a"), "@/index.ts", Err(ResolveError::NotFound("@/index.ts".into()))), - (f.join("project_b/src"), "@/index.ts", Err(ResolveError::NotFound("@/index.ts".into()))), - // Does not have paths alias - (f.join("project_a"), "./index.ts", Ok(f.join("project_a/index.ts"))), - (f.join("project_c"), "./index.ts", Ok(f.join("project_c/index.ts"))), - ]; - - for (path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, expected, "{request} {path:?}"); - } -} - -#[test] -fn manual() { - let f = super::fixture_root().join("tsconfig/cases/project_references"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("app"), - references: TsconfigReferences::Paths(vec!["../project_a/conf.json".into()]), - }), - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - // Test normal paths alias - (f.join("app"), "@/index.ts", Ok(f.join("app/aliased/index.ts"))), - (f.join("app"), "@/../index.ts", Ok(f.join("app/index.ts"))), - // Test project reference - (f.join("project_a"), "@/index.ts", Ok(f.join("project_a/aliased/index.ts"))), - (f.join("project_b/src"), "@/index.ts", Err(ResolveError::NotFound("@/index.ts".into()))), - // Does not have paths alias - (f.join("project_a"), "./index.ts", Ok(f.join("project_a/index.ts"))), - (f.join("project_c"), "./index.ts", Ok(f.join("project_c/index.ts"))), - ]; - - for (path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, expected, "{request} {path:?}"); - } -} diff --git a/src/tsconfig.rs b/src/tsconfig.rs deleted file mode 100644 index 9ea23c99..00000000 --- a/src/tsconfig.rs +++ /dev/null @@ -1,223 +0,0 @@ -use std::{ - hash::BuildHasherDefault, - path::{Path, PathBuf}, - sync::Arc, -}; - -use indexmap::IndexMap; -use rustc_hash::FxHasher; -use serde::Deserialize; - -use crate::PathUtil; - -pub type CompilerOptionsPathsMap = IndexMap, BuildHasherDefault>; - -#[derive(Debug, Clone, Eq, PartialEq, Deserialize)] -#[serde(untagged)] -pub enum ExtendsField { - Single(String), - Multiple(Vec), -} - -#[derive(Debug, Deserialize)] -#[serde(rename_all = "camelCase")] -pub struct TsConfig { - /// Whether this is the caller tsconfig. - /// Used for final template variable substitution when all configs are extended and merged. - #[serde(skip)] - root: bool, - - /// Path to `tsconfig.json`. Contains the `tsconfig.json` filename. - #[serde(skip)] - path: PathBuf, - - #[serde(default)] - pub extends: Option, - - #[serde(default)] - pub compiler_options: CompilerOptions, - - /// Bubbled up project references with a reference to their tsconfig. - #[serde(default)] - pub references: Vec, -} - -/// Compiler Options -/// -/// -#[derive(Debug, Default, Deserialize)] -#[serde(rename_all = "camelCase")] -pub struct CompilerOptions { - base_url: Option, - - /// Path aliases - paths: Option, - - /// The actual base for where path aliases are resolved from. - #[serde(skip)] - paths_base: PathBuf, -} - -/// Project Reference -/// -/// -#[derive(Debug, Deserialize)] -pub struct ProjectReference { - /// The path property of each reference can point to a directory containing a tsconfig.json file, - /// or to the config file itself (which may have any name). - pub path: PathBuf, - - /// Reference to the resolved tsconfig - #[serde(skip)] - pub tsconfig: Option>, -} - -impl TsConfig { - pub fn parse(root: bool, path: &Path, json: &mut str) -> Result { - _ = json_strip_comments::strip(json); - let mut tsconfig: Self = serde_json::from_str(json)?; - tsconfig.root = root; - tsconfig.path = path.to_path_buf(); - let directory = tsconfig.directory().to_path_buf(); - if let Some(base_url) = tsconfig.compiler_options.base_url { - tsconfig.compiler_options.base_url = Some(directory.normalize_with(base_url)); - } - if tsconfig.compiler_options.paths.is_some() { - tsconfig.compiler_options.paths_base = - tsconfig.compiler_options.base_url.as_ref().map_or(directory, Clone::clone); - } - Ok(tsconfig) - } - - pub fn build(mut self) -> Self { - if self.root { - let dir = self.directory().to_path_buf(); - // Substitute template variable in `tsconfig.compilerOptions.paths` - if let Some(paths) = &mut self.compiler_options.paths { - for paths in paths.values_mut() { - for path in paths { - Self::substitute_template_variable(&dir, path); - } - } - } - } - self - } - - /// Directory to `tsconfig.json` - /// - /// # Panics - /// - /// * When the `tsconfig.json` path is misconfigured. - pub fn directory(&self) -> &Path { - debug_assert!(self.path.file_name().is_some()); - self.path.parent().unwrap() - } - - pub fn extend_tsconfig(&mut self, tsconfig: &Self) { - let compiler_options = &mut self.compiler_options; - if compiler_options.paths.is_none() { - compiler_options.paths_base = compiler_options - .base_url - .as_ref() - .map_or_else(|| tsconfig.compiler_options.paths_base.clone(), Clone::clone); - compiler_options.paths.clone_from(&tsconfig.compiler_options.paths); - } - if compiler_options.base_url.is_none() { - compiler_options.base_url.clone_from(&tsconfig.compiler_options.base_url); - } - } - - pub fn resolve(&self, path: &Path, specifier: &str) -> Vec { - if path.starts_with(self.base_path()) { - let paths = self.resolve_path_alias(specifier); - if !paths.is_empty() { - return paths; - } - } - for tsconfig in self.references.iter().filter_map(|reference| reference.tsconfig.as_ref()) { - if path.starts_with(tsconfig.base_path()) { - return tsconfig.resolve_path_alias(specifier); - } - } - vec![] - } - - // Copied from parcel - // - pub fn resolve_path_alias(&self, specifier: &str) -> Vec { - if specifier.starts_with(|s| s == '/' || s == '.') { - return vec![]; - } - - let base_url_iter = self - .compiler_options - .base_url - .as_ref() - .map_or_else(Vec::new, |base_url| vec![base_url.normalize_with(specifier)]); - - let Some(paths_map) = &self.compiler_options.paths else { - return base_url_iter; - }; - - let paths = paths_map.get(specifier).map_or_else( - || { - let mut longest_prefix_length = 0; - let mut longest_suffix_length = 0; - let mut best_key: Option<&String> = None; - - for key in paths_map.keys() { - if let Some((prefix, suffix)) = key.split_once('*') { - if (best_key.is_none() || prefix.len() > longest_prefix_length) - && specifier.starts_with(prefix) - && specifier.ends_with(suffix) - { - longest_prefix_length = prefix.len(); - longest_suffix_length = suffix.len(); - best_key.replace(key); - } - } - } - - best_key.and_then(|key| paths_map.get(key)).map_or_else(Vec::new, |paths| { - paths - .iter() - .map(|path| { - path.replace( - '*', - &specifier[longest_prefix_length - ..specifier.len() - longest_suffix_length], - ) - }) - .collect::>() - }) - }, - Clone::clone, - ); - - paths - .into_iter() - .map(|p| self.compiler_options.paths_base.normalize_with(p)) - .chain(base_url_iter) - .collect() - } - - fn base_path(&self) -> &Path { - self.compiler_options - .base_url - .as_ref() - .map_or_else(|| self.directory(), |path| path.as_ref()) - } - - /// Template variable `${configDir}` for substitution of config files directory path - /// - /// NOTE: All tests cases are just a head replacement of `${configDir}`, so we are constrained as such. - /// - /// See - fn substitute_template_variable(directory: &Path, path: &mut String) { - const TEMPLATE_VARIABLE: &str = "${configDir}/"; - if let Some(stripped_path) = path.strip_prefix(TEMPLATE_VARIABLE) { - *path = directory.join(stripped_path).to_string_lossy().to_string(); - } - } -} diff --git a/tests/integration_test.rs b/tests/integration_test.rs deleted file mode 100644 index d369413f..00000000 --- a/tests/integration_test.rs +++ /dev/null @@ -1,102 +0,0 @@ -//! Test public APIs - -use std::{env, path::PathBuf}; - -use oxc_resolver::{EnforceExtension, Resolution, ResolveContext, ResolveOptions, Resolver}; - -fn dir() -> PathBuf { - env::current_dir().unwrap() -} - -fn resolve(specifier: &str) -> Resolution { - let path = dir(); - Resolver::new(ResolveOptions::default()).resolve(path, specifier).unwrap() -} - -#[test] -fn clone() { - let resolution = resolve("./tests/package.json"); - assert_eq!(resolution.clone(), resolution); -} - -#[test] -fn debug() { - let resolution = resolve("./tests/package.json"); - let s = format!("{resolution:?}"); - assert!(!s.is_empty()); -} - -#[test] -fn eq() { - let resolution = resolve("./tests/package.json"); - assert_eq!(resolution, resolution); -} - -#[test] -fn package_json() { - let resolution = resolve("./tests/package.json"); - assert!(resolution - .package_json() - .is_some_and(|json| json.name.as_ref().is_some_and(|name| name == "name"))); -} - -#[cfg(feature = "package_json_raw_json_api")] -#[test] -fn package_json_raw_json_api() { - let resolution = resolve("./tests/package.json"); - assert!(resolution - .package_json() - .unwrap() - .raw_json() - .get("name") - .is_some_and(|name| name == "name")); -} - -#[test] -fn clear_cache() { - let resolver = Resolver::new(ResolveOptions::default()); - resolver.clear_cache(); // exists -} - -#[test] -fn options() { - let resolver = Resolver::new(ResolveOptions::default()); - let options = resolver.options(); - assert!(!format!("{options:?}").is_empty()); -} - -#[test] -fn debug_resolver() { - let resolver = Resolver::new(ResolveOptions::default()); - assert!(!format!("{resolver:?}").is_empty()); -} - -#[test] -fn dependencies() { - let path = dir(); - let mut ctx = ResolveContext::default(); - let _ = Resolver::new(ResolveOptions::default()).resolve_with_context( - path, - "./tests/package.json", - &mut ctx, - ); - assert!(!ctx.file_dependencies.is_empty()); - assert!(ctx.missing_dependencies.is_empty()); -} - -#[test] -fn options_api() { - _ = ResolveOptions::default() - .with_builtin_modules(true) - .with_condition_names(&[]) - .with_extension(".js") - .with_force_extension(EnforceExtension::Auto) - .with_fully_specified(true) - .with_main_field("asdf") - .with_main_file("main") - .with_module("module") - .with_prefer_absolute(true) - .with_prefer_relative(true) - .with_root(PathBuf::new()) - .with_symbolic_link(true); -} diff --git a/tests/package.json b/tests/package.json deleted file mode 100644 index f099adcf..00000000 --- a/tests/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "name": "name" -} diff --git a/tests/resolve_test.rs b/tests/resolve_test.rs deleted file mode 100644 index 30d1ceff..00000000 --- a/tests/resolve_test.rs +++ /dev/null @@ -1,104 +0,0 @@ -use std::{env, path::PathBuf}; - -use oxc_resolver::{ResolveError, ResolveOptions, Resolver}; - -fn dir() -> PathBuf { - env::current_dir().unwrap() -} - -#[test] -fn chinese() { - let dir = dir(); - let specifier = "./fixtures/misc/中文/中文.js"; - let resolution = Resolver::new(ResolveOptions::default()).resolve(&dir, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(dir.join("fixtures/misc/中文/中文.js")) - ); -} - -#[test] -fn styled_components() { - let dir = dir(); - let path = dir.join("fixtures/pnpm"); - let module_path = dir.join("node_modules/.pnpm/styled-components@6.1.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/styled-components"); - let specifier = "styled-components"; - - // cjs - let options = - ResolveOptions { alias_fields: vec![vec!["browser".into()]], ..ResolveOptions::default() }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/styled-components.browser.cjs.js")) - ); - - // esm - let options = ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - main_fields: vec!["module".into()], - ..ResolveOptions::default() - }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/styled-components.browser.esm.js")) - ); -} - -#[test] -fn axios() { - let dir = dir(); - let path = dir.join("fixtures/pnpm"); - let module_path = dir.join("node_modules/.pnpm/axios@1.6.2/node_modules/axios"); - let specifier = "axios"; - - // default - let options = ResolveOptions::default(); - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("index.js")) - ); - - // browser - let options = ResolveOptions { - condition_names: vec!["browser".into(), "require".into()], - ..ResolveOptions::default() - }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/browser/axios.cjs")) - ); - - // cjs - let options = ResolveOptions { - condition_names: vec!["node".into(), "require".into()], - ..ResolveOptions::default() - }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/node/axios.cjs")) - ); -} - -#[test] -fn postcss() { - let dir = dir(); - let path = dir.join("fixtures/pnpm"); - let module_path = path.join("node_modules/postcss"); - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - // should ignore "path" - let resolution = resolver.resolve(&module_path, "path"); - assert_eq!(resolution, Err(ResolveError::Ignored(module_path.clone()))); - - // should ignore "./lib/terminal-highlight" - let resolution = resolver.resolve(&module_path, "./lib/terminal-highlight"); - assert_eq!(resolution, Err(ResolveError::Ignored(module_path.join("lib/terminal-highlight")))); -} From 0e82827432d07d74b42c46fe354dd9dd8fd61741 Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Wed, 26 Jun 2024 11:29:29 +0300 Subject: [PATCH 38/82] squash! --- Cargo.lock | 934 ------ fixtures/enhanced_resolve/lib/index.js | 1 - fixtures/enhanced_resolve/package.json | 4 - fixtures/enhanced_resolve/test/.gitignore | 2 - .../enhanced_resolve/test/fixtures/#/a.js | 0 fixtures/enhanced_resolve/test/fixtures/a.js | 3 - .../enhanced_resolve/test/fixtures/abc.txt | 1 - .../test/fixtures/alias/files/a.js | 0 fixtures/enhanced_resolve/test/fixtures/b.js | 3 - .../browser-module/browser/module-a.js | 0 .../fixtures/browser-module/lib/browser.js | 0 .../fixtures/browser-module/lib/ignore.js | 0 .../test/fixtures/browser-module/lib/main.js | 0 .../fixtures/browser-module/lib/replaced.js | 0 .../test/fixtures/browser-module/lib/self.js | 0 .../fixtures/browser-module/lib/toString.js | 0 .../browser-module/node_modules/module-a.js | 0 .../browser-module/node_modules/module-b.js | 0 .../browser-module/node_modules/module-c.js | 0 .../node_modules/recursive-file/a.js | 0 .../node_modules/recursive-file/b.js | 0 .../node_modules/recursive-file/c.js | 0 .../node_modules/recursive-file/d.js | 0 .../node_modules/recursive-file/package.json | 8 - .../test/fixtures/browser-module/package.json | 33 - .../test/fixtures/builtins/package.json | 12 - fixtures/enhanced_resolve/test/fixtures/c.js | 4 - .../enhanced_resolve/test/fixtures/complex.js | 13 - .../test/fixtures/crypto-js/index.js | 0 .../test/fixtures/crypto-js/package.json | 7 - .../test/fixtures/decorated-fs/exists.js | 0 .../test/fixtures/dirOrFile.js | 1 - .../test/fixtures/dirOrFile/index.js | 1 - .../directory-default/directory-default.js | 0 .../node_modules/@org/pkg/dist/string.js | 1 - .../@org/pkg/dist/string.test.d.ts | 1 - .../node_modules/@org/pkg/package.json | 9 - .../node_modules/pkg/dist/string.js | 1 - .../node_modules/pkg/dist/string.test.d.ts | 1 - .../node_modules/pkg/package.json | 9 - .../node_modules/exports-field/package.json | 7 - .../node_modules/pack1/index.js | 0 .../test/fixtures/exports-field/a.js | 1 - .../node_modules/exports-field/lib/browser.js | 1 - .../node_modules/exports-field/lib/index.js | 0 .../exports-field/lib/lib2/main.js | 1 - .../node_modules/exports-field/lib/main.js | 1 - .../node_modules/exports-field/main.js | 1 - .../node_modules/exports-field/package.json | 18 - .../node_modules/exports-field/x.js | 1 - .../invalid-exports-field/index.js | 0 .../invalid-exports-field/package.json | 13 - .../node_modules/invalid-exports-field/umd.js | 0 .../test/fixtures/exports-field/package.json | 5 - .../node_modules/exports-field/index.js | 1 - .../node_modules/exports-field/lib/browser.js | 1 - .../exports-field/lib/lib2/main.js | 1 - .../node_modules/exports-field/lib/main.js | 1 - .../node_modules/exports-field/main.js | 1 - .../node_modules/exports-field/package.json | 17 - .../node_modules/exports-field/index | 0 .../node_modules/exports-field/main.js | 1 - .../node_modules/exports-field/package.json | 10 - .../node_modules/exports-field/src/index.js | 0 .../fixtures/extension-alias/dir/index.js | 0 .../fixtures/extension-alias/dir/index.ts | 0 .../fixtures/extension-alias/dir2/index.js | 0 .../fixtures/extension-alias/dir2/index.mts | 0 .../test/fixtures/extension-alias/index.js | 0 .../test/fixtures/extension-alias/index.mjs | 0 .../fixtures/extension-alias/index.mts.js | 0 .../test/fixtures/extension-alias/index.ts | 0 .../test/fixtures/extensions/app.module.js | 0 .../test/fixtures/extensions/dir/index.js | 0 .../test/fixtures/extensions/dir/index.ts | 0 .../test/fixtures/extensions/foo.js | 0 .../test/fixtures/extensions/foo.ts | 0 .../test/fixtures/extensions/index.js | 0 .../test/fixtures/extensions/index.ts | 0 .../extensions/node_modules/module.js | 0 .../extensions/node_modules/module/index.ts | 0 .../test/fixtures/extensions/package.json | 3 - .../enhanced_resolve/test/fixtures/file.load1 | 0 .../enhanced_resolve/test/fixtures/file.load2 | 0 .../test/fixtures/foo/index.js | 0 .../test/fixtures/foo/package.json | 4 - .../node_modules/m/package.json | 17 - .../node_modules/m/src/features/f.js | 0 .../m/src/features/internal/file.js | 0 .../node_modules/m/src/features/y/y.js | 0 .../node_modules/m/src/internal/i.js | 0 .../node_modules/m/src/middle-1/f.js | 0 .../node_modules/m/src/middle-1/nested/f.js | 0 .../node_modules/m/src/middle-2/nested/f.js | 1 - .../m/src/middle-3/nested/f/nested/f.js | 0 .../node_modules/m/src/middle-4/f/f.js | 0 .../node_modules/m/src/middle-5/f$/$.js | 0 .../node_modules/m/src/middle-5/f/$.js | 0 .../node_modules/m/src/middle/f.js | 0 .../node_modules/m/src/middle/nested/f.js | 0 .../test/fixtures/imports-field/a.js | 1 - .../test/fixtures/imports-field/b.js | 0 .../test/fixtures/imports-field/dir/b.js | 0 .../node_modules/a/lib/browser.js | 1 - .../imports-field/node_modules/a/lib/index.js | 0 .../node_modules/a/lib/lib2/main.js | 1 - .../imports-field/node_modules/a/lib/main.js | 1 - .../imports-field/node_modules/a/main.js | 1 - .../imports-field/node_modules/a/package.json | 18 - .../imports-field/node_modules/a/x.js | 1 - .../imports-field/node_modules/c/index.js | 0 .../test/fixtures/imports-field/package.json | 17 - .../fixtures/incorrect-package/pack1/a.js | 0 .../incorrect-package/pack1/package.json | 2 - .../fixtures/incorrect-package/pack2/a.js | 0 .../incorrect-package/pack2/package.json | 0 .../test/fixtures/issue-238/package.json | 3 - .../test/fixtures/issue-238/src/a/config.js | 0 .../src/common/config/myObjectFile.js | 0 .../enhanced_resolve/test/fixtures/lib.js | 0 .../test/fixtures/lib/complex1.js | 1 - .../test/fixtures/main-field-self/index.js | 0 .../fixtures/main-field-self/package.json | 3 - .../test/fixtures/main-field-self2/index.js | 0 .../fixtures/main-field-self2/package.json | 3 - .../enhanced_resolve/test/fixtures/main1.js | 9 - .../enhanced_resolve/test/fixtures/main2.js | 12 - .../enhanced_resolve/test/fixtures/main3.js | 4 - .../multiple_modules/node_modules/m1/a.js | 3 - .../test/fixtures/no#fragment/#/#.js | 0 fixtures/enhanced_resolve/test/fixtures/no.js | 0 .../browser-module-broken/browser.js | 0 .../browser-module-broken/main.js | 0 .../browser-module-broken/package.json | 4 - .../complexm/node_modules/m1/a.js | 1 - .../complexm/node_modules/m1/index.js | 1 - .../fixtures/node_modules/complexm/step1.js | 1 - .../fixtures/node_modules/complexm/step2.js | 1 - .../fixtures/node_modules/dash-name/index.js | 0 .../node_modules/dash-name/package.json | 4 - .../test/fixtures/node_modules/dash/index.js | 0 .../fixtures/node_modules/dash/package.json | 4 - .../invalidPackageJson/package.json | 0 .../test/fixtures/node_modules/m1/a.js | 3 - .../test/fixtures/node_modules/m1/b.js | 3 - .../test/fixtures/node_modules/m2/b.js | 1 - .../node_modules/recursive-module/file.js | 0 .../node_modules/recursive-module/index.js | 0 .../test/fixtures/pnp-a/m2/a.js | 3 - .../test/fixtures/pnp/pkg/dir/index.js | 0 .../test/fixtures/pnp/pkg/index.js | 0 .../test/fixtures/pnp/pkg/main.js | 0 .../fixtures/pnp/pkg/package-alias/browser.js | 0 .../fixtures/pnp/pkg/package-alias/index.js | 0 .../test/fixtures/pnp/pkg/package.json | 7 - .../test/fixtures/pnp/pkg/typescript/index.ts | 0 .../test/fixtures/pnp/pkg3/a.js | 1 - .../test/fixtures/pnp/pkg3/package.json | 8 - .../prefer-pnp/alternative-modules/m1/b.js | 0 .../restrictions/node_modules/pck1/index.css | 0 .../restrictions/node_modules/pck1/index.js | 0 .../node_modules/pck1/package.json | 3 - .../restrictions/node_modules/pck2/index.css | 0 .../restrictions/node_modules/pck2/module.js | 0 .../node_modules/pck2/package.json | 5 - .../test/fixtures/roots_fall_through/index.js | 0 .../scoped/node_modules/@scope/pack1/main.js | 0 .../node_modules/@scope/pack1/package.json | 5 - .../node_modules/@scope/pack2/lib/index.js | 0 .../scoped/node_modules/@scope/pack2/main.js | 0 .../node_modules/@scope/pack2/package.json | 3 - .../test/fixtures/shortcutdir.js/a.js | 0 .../test/fixtures/yield/a/foo-2/b | 0 .../test/fixtures/yield/a/foo-2/c | 0 .../test/fixtures/yield/a/foo/a | 0 .../test/fixtures/yield/a/foo/b | 0 .../test/fixtures/yield/b/foo/a | 0 .../test/fixtures/yield/c/foo/a | 0 .../test/fixtures/yield/c/foo/package.json | 7 - .../fixtures/\346\265\213\350\257\225.js" | 0 .../\344\270\255\346\226\207.js" | 0 fixtures/pnpm/.gitignore | 1 - fixtures/pnpm/package.json | 10 - fixtures/pnpm/pnpm-lock.yaml | 212 -- fixtures/tsconfig/cases/builtins/thing.js | 0 .../tsconfig/cases/builtins/tsconfig.json | 5 - fixtures/tsconfig/cases/exports/index.js | 0 fixtures/tsconfig/cases/exports/tsconfig.json | 3 - .../extends-extension/base-tsconfig.json | 7 - .../tsconfig/cases/extends-extension/foo.js | 0 .../cases/extends-extension/tsconfig.json | 3 - .../cases/extends-extensionless/foo.js | 0 .../cases/extends-extensionless/tsconfig.json | 3 - .../tsconfig/cases/extends-multiple/foo.js | 0 .../cases/extends-multiple/tsconfig.json | 6 - .../tsconfig/cases/extends-not-found/index.js | 0 .../cases/extends-not-found/tsconfig.json | 3 - .../tsconfig/cases/extends-paths/src/index.js | 0 .../cases/extends-paths/tsconfig.base.json | 7 - .../cases/extends-paths/tsconfig.json | 6 - fixtures/tsconfig/cases/field/index.js | 0 fixtures/tsconfig/cases/field/tsconfig.json | 3 - fixtures/tsconfig/cases/index/index.js | 0 fixtures/tsconfig/cases/index/tsconfig.json | 3 - .../cases/paths_template_variable/foo.js | 0 .../paths_template_variable/tsconfig1.json | 3 - .../paths_template_variable/tsconfig2.json | 8 - .../project_references/app/aliased/index.ts | 0 .../cases/project_references/app/index.ts | 0 .../project_references/app/tsconfig.json | 23 - .../project_a/aliased/index.ts | 0 .../project_references/project_a/conf.json | 8 - .../project_references/project_a/index.ts | 0 .../project_b/src/aliased/index.ts | 0 .../project_b/tsconfig.json | 9 - .../project_references/project_c/index.ts | 0 .../project_c/tsconfig.json | 5 - .../project_references/tsconfig.base.json | 4 - fixtures/tsconfig/cases/suffixes/a.ios.ts | 0 fixtures/tsconfig/cases/suffixes/a.ts | 0 fixtures/tsconfig/cases/suffixes/b.ts | 0 fixtures/tsconfig/cases/suffixes/c-test.ts | 0 fixtures/tsconfig/cases/suffixes/index.ts | 1 - .../tsconfig/cases/suffixes/tsconfig.json | 5 - fixtures/tsconfig/cases/trailing-comma/bar.js | 0 .../tsconfig/cases/trailing-comma/index.js | 0 .../cases/trailing-comma/tsconfig.json | 9 - fixtures/tsconfig/foo.js | 0 fixtures/tsconfig/nested/index.js | 0 fixtures/tsconfig/nested/test.js | 0 fixtures/tsconfig/nested/tsconfig.json | 8 - .../node_modules/tsconfig-exports/conf.json | 7 - .../node_modules/tsconfig-exports/foo.js | 0 .../tsconfig-exports/package.json | 7 - .../node_modules/tsconfig-field/conf.json | 7 - .../node_modules/tsconfig-field/foo.js | 0 .../node_modules/tsconfig-field/package.json | 5 - .../node_modules/tsconfig-index/foo.js | 0 .../node_modules/tsconfig-index/package.json | 4 - .../node_modules/tsconfig-index/tsconfig.json | 7 - .../node_modules/tsconfig-not-used/foo.js | 0 .../tsconfig-not-used/tsconfig.json | 7 - fixtures/tsconfig/package.json | 24 - fixtures/tsconfig/tsconfig.json | 7 - .../tsconfig/tsconfig_template_variable.json | 7 - napi/__test__/resolver.spec.mjs | 260 -- napi/src/lib.rs | 179 -- napi/src/options.rs | 261 -- napi/tests/options.test.mjs | 59 - npm/package.json | 77 +- package.json | 53 +- pnpm-lock.yaml | 2690 ----------------- src/builtins.rs | 71 - src/cache.rs | 369 --- src/context.rs | 89 - src/error.rs | 160 - src/file_system.rs | 133 - src/lib.rs | 1672 ---------- src/options.rs | 623 ---- src/package_json.rs | 207 -- src/path.rs | 132 - src/resolution.rs | 92 - src/specifier.rs | 230 -- src/tests/alias.rs | 280 -- src/tests/browser_field.rs | 189 -- src/tests/builtins.rs | 121 - src/tests/dependencies.rs | 110 - src/tests/exports_field.rs | 2546 ---------------- src/tests/extension_alias.rs | 66 - src/tests/extensions.rs | 125 - src/tests/fallback.rs | 100 - src/tests/full_specified.rs | 113 - src/tests/imports_field.rs | 1320 -------- src/tests/incorrect_description_file.rs | 62 - src/tests/main_field.rs | 24 - src/tests/memory_fs.rs | 74 - src/tests/missing.rs | 106 - src/tests/mod.rs | 49 - src/tests/resolve.rs | 119 - src/tests/restrictions.rs | 25 - src/tests/roots.rs | 92 - src/tests/scoped_packages.rs | 25 - src/tests/simple.rs | 68 - src/tests/symlink.rs | 121 - src/tests/tsconfig_paths.rs | 507 ---- src/tests/tsconfig_project_references.rs | 101 - src/tsconfig.rs | 223 -- tests/integration_test.rs | 102 - tests/package.json | 3 - tests/resolve_test.rs | 104 - 290 files changed, 55 insertions(+), 15816 deletions(-) delete mode 100644 Cargo.lock delete mode 100644 fixtures/enhanced_resolve/lib/index.js delete mode 100644 fixtures/enhanced_resolve/package.json delete mode 100644 fixtures/enhanced_resolve/test/.gitignore delete mode 100644 fixtures/enhanced_resolve/test/fixtures/#/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/abc.txt delete mode 100644 fixtures/enhanced_resolve/test/fixtures/alias/files/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/browser/module-a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/ignore.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/replaced.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/self.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/toString.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-c.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/c.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/d.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/builtins/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/c.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/complex.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/crypto-js/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/decorated-fs/exists.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/dirOrFile.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/directory-default/directory-default.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/pack1/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/umd.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/index delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/src/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.mts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mjs delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mts.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/app.module.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/foo.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/foo.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/file.load1 delete mode 100644 fixtures/enhanced_resolve/test/fixtures/file.load2 delete mode 100644 fixtures/enhanced_resolve/test/fixtures/foo/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/foo/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/internal/file.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/y/y.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/internal/i.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-3/nested/f/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-4/f/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f$/$.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f/$.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/dir/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/c/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/issue-238/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/issue-238/src/a/config.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/issue-238/src/common/config/myObjectFile.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/lib.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/lib/complex1.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self2/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main1.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main2.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main3.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/no#fragment/#/#.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/no.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/invalidPackageJson/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/file.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/dir/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/typescript/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/prefer-pnp/alternative-modules/m1/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.css delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/index.css delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/module.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/roots_fall_through/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/lib/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/shortcutdir.js/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/b delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/c delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo/a delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo/b delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/b/foo/a delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/c/foo/a delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json delete mode 100644 "fixtures/enhanced_resolve/test/fixtures/\346\265\213\350\257\225.js" delete mode 100644 "fixtures/misc/\344\270\255\346\226\207/\344\270\255\346\226\207.js" delete mode 100644 fixtures/pnpm/.gitignore delete mode 100644 fixtures/pnpm/package.json delete mode 100644 fixtures/pnpm/pnpm-lock.yaml delete mode 100644 fixtures/tsconfig/cases/builtins/thing.js delete mode 100644 fixtures/tsconfig/cases/builtins/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/exports/index.js delete mode 100644 fixtures/tsconfig/cases/exports/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-extension/base-tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-extension/foo.js delete mode 100644 fixtures/tsconfig/cases/extends-extension/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-extensionless/foo.js delete mode 100644 fixtures/tsconfig/cases/extends-extensionless/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-multiple/foo.js delete mode 100644 fixtures/tsconfig/cases/extends-multiple/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-not-found/index.js delete mode 100644 fixtures/tsconfig/cases/extends-not-found/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-paths/src/index.js delete mode 100644 fixtures/tsconfig/cases/extends-paths/tsconfig.base.json delete mode 100644 fixtures/tsconfig/cases/extends-paths/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/field/index.js delete mode 100644 fixtures/tsconfig/cases/field/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/index/index.js delete mode 100644 fixtures/tsconfig/cases/index/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/paths_template_variable/foo.js delete mode 100644 fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json delete mode 100644 fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json delete mode 100644 fixtures/tsconfig/cases/project_references/app/aliased/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/app/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/app/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/project_references/project_a/aliased/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_a/conf.json delete mode 100644 fixtures/tsconfig/cases/project_references/project_a/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_b/src/aliased/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_b/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/project_references/project_c/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_c/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/project_references/tsconfig.base.json delete mode 100644 fixtures/tsconfig/cases/suffixes/a.ios.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/a.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/b.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/c-test.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/index.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/trailing-comma/bar.js delete mode 100644 fixtures/tsconfig/cases/trailing-comma/index.js delete mode 100644 fixtures/tsconfig/cases/trailing-comma/tsconfig.json delete mode 100644 fixtures/tsconfig/foo.js delete mode 100644 fixtures/tsconfig/nested/index.js delete mode 100644 fixtures/tsconfig/nested/test.js delete mode 100644 fixtures/tsconfig/nested/tsconfig.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-exports/conf.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-exports/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-exports/package.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-field/conf.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-field/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-field/package.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-index/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-index/package.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-not-used/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json delete mode 100755 fixtures/tsconfig/package.json delete mode 100644 fixtures/tsconfig/tsconfig.json delete mode 100644 fixtures/tsconfig/tsconfig_template_variable.json delete mode 100644 napi/__test__/resolver.spec.mjs delete mode 100644 napi/src/lib.rs delete mode 100644 napi/src/options.rs delete mode 100644 napi/tests/options.test.mjs delete mode 100644 pnpm-lock.yaml delete mode 100644 src/builtins.rs delete mode 100644 src/cache.rs delete mode 100644 src/context.rs delete mode 100644 src/error.rs delete mode 100644 src/file_system.rs delete mode 100644 src/lib.rs delete mode 100644 src/options.rs delete mode 100644 src/package_json.rs delete mode 100644 src/path.rs delete mode 100644 src/resolution.rs delete mode 100644 src/specifier.rs delete mode 100644 src/tests/alias.rs delete mode 100644 src/tests/browser_field.rs delete mode 100644 src/tests/builtins.rs delete mode 100644 src/tests/dependencies.rs delete mode 100644 src/tests/exports_field.rs delete mode 100644 src/tests/extension_alias.rs delete mode 100644 src/tests/extensions.rs delete mode 100644 src/tests/fallback.rs delete mode 100644 src/tests/full_specified.rs delete mode 100644 src/tests/imports_field.rs delete mode 100644 src/tests/incorrect_description_file.rs delete mode 100644 src/tests/main_field.rs delete mode 100644 src/tests/memory_fs.rs delete mode 100644 src/tests/missing.rs delete mode 100644 src/tests/mod.rs delete mode 100644 src/tests/resolve.rs delete mode 100644 src/tests/restrictions.rs delete mode 100644 src/tests/roots.rs delete mode 100644 src/tests/scoped_packages.rs delete mode 100644 src/tests/simple.rs delete mode 100644 src/tests/symlink.rs delete mode 100644 src/tests/tsconfig_paths.rs delete mode 100644 src/tests/tsconfig_project_references.rs delete mode 100644 src/tsconfig.rs delete mode 100644 tests/integration_test.rs delete mode 100644 tests/package.json delete mode 100644 tests/resolve_test.rs diff --git a/Cargo.lock b/Cargo.lock deleted file mode 100644 index 24737185..00000000 --- a/Cargo.lock +++ /dev/null @@ -1,934 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "addr2line" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678" -dependencies = [ - "gimli", -] - -[[package]] -name = "adler" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" - -[[package]] -name = "aho-corasick" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" -dependencies = [ - "memchr", -] - -[[package]] -name = "anes" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "735d4f398ca57cfa2880225c2bf81c3b9af3be5bb22e44ae70118dad38713e84" - -[[package]] -name = "autocfg" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" - -[[package]] -name = "backtrace" -version = "0.3.73" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cc23269a4f8976d0a4d2e7109211a419fe30e8d88d677cd60b6bc79c5732e0a" -dependencies = [ - "addr2line", - "cc", - "cfg-if", - "libc", - "miniz_oxide", - "object", - "rustc-demangle", -] - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "bitflags" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" - -[[package]] -name = "bpaf" -version = "0.9.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3280efcf6d66bc77c2cf9b67dc8acee47a217d9be67dd590b3230dffe663724d" - -[[package]] -name = "cast" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" - -[[package]] -name = "cc" -version = "1.0.100" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c891175c3fb232128f48de6590095e59198bbeb8620c310be349bfc3afd12c7b" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "ciborium" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42e69ffd6f0917f5c029256a24d0161db17cea3997d185db0d35926308770f0e" -dependencies = [ - "ciborium-io", - "ciborium-ll", - "serde", -] - -[[package]] -name = "ciborium-io" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05afea1e0a06c9be33d539b876f1ce3692f4afea2cb41f740e7743225ed1c757" - -[[package]] -name = "ciborium-ll" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57663b653d948a338bfb3eeba9bb2fd5fcfaecb9e199e87e1eda4d9e8b240fd9" -dependencies = [ - "ciborium-io", - "half", -] - -[[package]] -name = "codspeed" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a104ac948e0188b921eb3fcbdd55dcf62e542df4c7ab7e660623f6288302089" -dependencies = [ - "colored", - "libc", - "serde_json", -] - -[[package]] -name = "colored" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbf2150cce219b664a8a70df7a1f933836724b503f8a413af9365b4dcc4d90b8" -dependencies = [ - "lazy_static", - "windows-sys 0.48.0", -] - -[[package]] -name = "convert_case" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec182b0ca2f35d8fc196cf3404988fd8b8c739a4d270ff118a398feb0cbec1ca" -dependencies = [ - "unicode-segmentation", -] - -[[package]] -name = "criterion2" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7258985df1aa8b33359ee2392cbc3b7802875242cdacdda91a17a602132c24a9" -dependencies = [ - "anes", - "bpaf", - "cast", - "ciborium", - "codspeed", - "colored", - "num-traits", - "oorandom", - "serde", - "serde_json", - "walkdir", -] - -[[package]] -name = "crossbeam-deque" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" -dependencies = [ - "crossbeam-epoch", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.9.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" -dependencies = [ - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" - -[[package]] -name = "crunchy" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" - -[[package]] -name = "ctor" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edb49164822f3ee45b17acd4a208cfc1251410cf0cad9a833234c9890774dd9f" -dependencies = [ - "quote", - "syn", -] - -[[package]] -name = "dashmap" -version = "5.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" -dependencies = [ - "cfg-if", - "hashbrown", - "lock_api", - "once_cell", - "parking_lot_core", -] - -[[package]] -name = "document-features" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef5282ad69563b5fc40319526ba27e0e7363d552a896f0297d54f767717f9b95" -dependencies = [ - "litrs", -] - -[[package]] -name = "dunce" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b" - -[[package]] -name = "either" -version = "1.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dca9240753cf90908d7e4aac30f630662b02aebaa1b58a3cadabdb23385b58b" - -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "filetime" -version = "0.2.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ee447700ac8aa0b2f2bd7bc4462ad686ba06baa6727ac149a2d6277f0d240fd" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall 0.4.1", - "windows-sys 0.52.0", -] - -[[package]] -name = "gimli" -version = "0.29.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" - -[[package]] -name = "half" -version = "2.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dd08c532ae367adf81c312a4580bc67f1d0fe8bc9c460520283f4c0ff277888" -dependencies = [ - "cfg-if", - "crunchy", -] - -[[package]] -name = "hashbrown" -version = "0.14.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" - -[[package]] -name = "hermit-abi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" - -[[package]] -name = "indexmap" -version = "2.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" -dependencies = [ - "equivalent", - "hashbrown", - "serde", -] - -[[package]] -name = "itoa" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" - -[[package]] -name = "json-strip-comments" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3d129799327c8f80861e467c59b825ba24c277dba6ad0d71a141dc98f9e04ee" - -[[package]] -name = "lazy_static" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" - -[[package]] -name = "libc" -version = "0.2.155" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" - -[[package]] -name = "libloading" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c2a198fb6b0eada2a8df47933734e6d35d350665a33a3593d7164fa52c75c19" -dependencies = [ - "cfg-if", - "windows-targets 0.48.5", -] - -[[package]] -name = "litrs" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4ce301924b7887e9d637144fdade93f9dfff9b60981d4ac161db09720d39aa5" - -[[package]] -name = "lock_api" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" -dependencies = [ - "autocfg", - "scopeguard", -] - -[[package]] -name = "memchr" -version = "2.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" - -[[package]] -name = "miniz_oxide" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" -dependencies = [ - "adler", -] - -[[package]] -name = "napi" -version = "2.16.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "633e41b2b983cf7983134f0c50986ca524d0caf38a2c6fc893ea3fa2e26abb0c" -dependencies = [ - "bitflags 2.5.0", - "ctor", - "napi-derive", - "napi-sys", - "once_cell", - "serde", - "serde_json", - "tokio", -] - -[[package]] -name = "napi-build" -version = "2.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1c0f5d67ee408a4685b61f5ab7e58605c8ae3f2b4189f0127d804ff13d5560a" - -[[package]] -name = "napi-derive" -version = "2.16.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70a8a778fd367b13c64232e58632514b795514ece491ce136d96e976d34a3eb8" -dependencies = [ - "cfg-if", - "convert_case", - "napi-derive-backend", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "napi-derive-backend" -version = "1.0.68" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35849e64596ecd467e1ac897153364a1ffd09b1d79b32ebad94ef8980ac73311" -dependencies = [ - "convert_case", - "once_cell", - "proc-macro2", - "quote", - "regex", - "semver", - "syn", -] - -[[package]] -name = "napi-sys" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "427802e8ec3a734331fec1035594a210ce1ff4dc5bc1950530920ab717964ea3" -dependencies = [ - "libloading", -] - -[[package]] -name = "normalize-path" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5438dd2b2ff4c6df6e1ce22d825ed2fa93ee2922235cc45186991717f0a892d" - -[[package]] -name = "num-traits" -version = "0.2.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" -dependencies = [ - "autocfg", -] - -[[package]] -name = "num_cpus" -version = "1.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" -dependencies = [ - "hermit-abi", - "libc", -] - -[[package]] -name = "object" -version = "0.36.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "576dfe1fc8f9df304abb159d767a29d0476f7750fbf8aa7ad07816004a207434" -dependencies = [ - "memchr", -] - -[[package]] -name = "once_cell" -version = "1.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" - -[[package]] -name = "oorandom" -version = "11.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575" - -[[package]] -name = "oxc_napi_resolver" -version = "0.0.0" -dependencies = [ - "napi", - "napi-build", - "napi-derive", - "oxc_resolver", - "tokio", -] - -[[package]] -name = "oxc_resolver" -version = "1.8.2" -dependencies = [ - "criterion2", - "dashmap", - "document-features", - "dunce", - "indexmap", - "json-strip-comments", - "normalize-path", - "once_cell", - "rayon", - "rustc-hash", - "serde", - "serde_json", - "thiserror", - "tracing", - "vfs", -] - -[[package]] -name = "parking_lot_core" -version = "0.9.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall 0.5.1", - "smallvec", - "windows-targets 0.52.5", -] - -[[package]] -name = "pin-project-lite" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" - -[[package]] -name = "proc-macro2" -version = "1.0.85" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22244ce15aa966053a896d1accb3a6e68469b97c7f33f284b99f0d576879fc23" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.36" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "rayon" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" -dependencies = [ - "either", - "rayon-core", -] - -[[package]] -name = "rayon-core" -version = "1.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" -dependencies = [ - "crossbeam-deque", - "crossbeam-utils", -] - -[[package]] -name = "redox_syscall" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" -dependencies = [ - "bitflags 1.3.2", -] - -[[package]] -name = "redox_syscall" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "469052894dcb553421e483e4209ee581a45100d31b4018de03e5a7ad86374a7e" -dependencies = [ - "bitflags 2.5.0", -] - -[[package]] -name = "regex" -version = "1.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" -dependencies = [ - "aho-corasick", - "memchr", - "regex-automata", - "regex-syntax", -] - -[[package]] -name = "regex-automata" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", -] - -[[package]] -name = "regex-syntax" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" - -[[package]] -name = "rustc-demangle" -version = "0.1.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" - -[[package]] -name = "rustc-hash" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" - -[[package]] -name = "ryu" -version = "1.0.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" - -[[package]] -name = "same-file" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "scopeguard" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" - -[[package]] -name = "semver" -version = "1.0.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" - -[[package]] -name = "serde" -version = "1.0.203" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7253ab4de971e72fb7be983802300c30b5a7f0c2e56fab8abfc6a214307c0094" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.203" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "serde_json" -version = "1.0.117" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3" -dependencies = [ - "indexmap", - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "smallvec" -version = "1.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" - -[[package]] -name = "syn" -version = "2.0.66" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c42f3f41a2de00b01c0aaad383c5a45241efc8b2d1eda5661812fda5f3cdcff5" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "thiserror" -version = "1.0.61" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.61" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "tokio" -version = "1.38.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba4f4a02a7a80d6f274636f0aa95c7e383b912d41fe721a31f29e29698585a4a" -dependencies = [ - "backtrace", - "num_cpus", - "pin-project-lite", -] - -[[package]] -name = "tracing" -version = "0.1.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" -dependencies = [ - "pin-project-lite", - "tracing-attributes", - "tracing-core", -] - -[[package]] -name = "tracing-attributes" -version = "0.1.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "tracing-core" -version = "0.1.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" -dependencies = [ - "once_cell", -] - -[[package]] -name = "unicode-ident" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" - -[[package]] -name = "unicode-segmentation" -version = "1.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" - -[[package]] -name = "vfs" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "654cd097e182a71dbf899178e6b5662c2157dd0b8afd5975de18008f6fc173d1" -dependencies = [ - "filetime", -] - -[[package]] -name = "walkdir" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" -dependencies = [ - "same-file", - "winapi-util", -] - -[[package]] -name = "winapi-util" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b" -dependencies = [ - "windows-sys 0.52.0", -] - -[[package]] -name = "windows-sys" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" -dependencies = [ - "windows-targets 0.48.5", -] - -[[package]] -name = "windows-sys" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" -dependencies = [ - "windows-targets 0.52.5", -] - -[[package]] -name = "windows-targets" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" -dependencies = [ - "windows_aarch64_gnullvm 0.48.5", - "windows_aarch64_msvc 0.48.5", - "windows_i686_gnu 0.48.5", - "windows_i686_msvc 0.48.5", - "windows_x86_64_gnu 0.48.5", - "windows_x86_64_gnullvm 0.48.5", - "windows_x86_64_msvc 0.48.5", -] - -[[package]] -name = "windows-targets" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" -dependencies = [ - "windows_aarch64_gnullvm 0.52.5", - "windows_aarch64_msvc 0.52.5", - "windows_i686_gnu 0.52.5", - "windows_i686_gnullvm", - "windows_i686_msvc 0.52.5", - "windows_x86_64_gnu 0.52.5", - "windows_x86_64_gnullvm 0.52.5", - "windows_x86_64_msvc 0.52.5", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" - -[[package]] -name = "windows_i686_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" - -[[package]] -name = "windows_i686_gnu" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" - -[[package]] -name = "windows_i686_gnullvm" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" - -[[package]] -name = "windows_i686_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" - -[[package]] -name = "windows_i686_msvc" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" diff --git a/fixtures/enhanced_resolve/lib/index.js b/fixtures/enhanced_resolve/lib/index.js deleted file mode 100644 index 1e872e8f..00000000 --- a/fixtures/enhanced_resolve/lib/index.js +++ /dev/null @@ -1 +0,0 @@ -// mimic enhanced-resolved root directory structure diff --git a/fixtures/enhanced_resolve/package.json b/fixtures/enhanced_resolve/package.json deleted file mode 100644 index d1b845b5..00000000 --- a/fixtures/enhanced_resolve/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "enhanced-resolve", - "main": "lib/index.js" -} diff --git a/fixtures/enhanced_resolve/test/.gitignore b/fixtures/enhanced_resolve/test/.gitignore deleted file mode 100644 index bbbec5f4..00000000 --- a/fixtures/enhanced_resolve/test/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# created by symlink.rs -/temp diff --git a/fixtures/enhanced_resolve/test/fixtures/#/a.js b/fixtures/enhanced_resolve/test/fixtures/#/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/a.js b/fixtures/enhanced_resolve/test/fixtures/a.js deleted file mode 100644 index 896ffc6d..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/abc.txt b/fixtures/enhanced_resolve/test/fixtures/abc.txt deleted file mode 100644 index f2ba8f84..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/abc.txt +++ /dev/null @@ -1 +0,0 @@ -abc \ No newline at end of file diff --git a/fixtures/enhanced_resolve/test/fixtures/alias/files/a.js b/fixtures/enhanced_resolve/test/fixtures/alias/files/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/b.js b/fixtures/enhanced_resolve/test/fixtures/b.js deleted file mode 100644 index 11476340..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/b.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function b() { - return "This is b"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/browser/module-a.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/browser/module-a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/browser.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/ignore.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/ignore.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/replaced.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/replaced.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/self.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/self.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/toString.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/toString.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-a.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-b.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-c.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-c.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/a.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/b.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/c.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/c.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/d.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/d.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json deleted file mode 100644 index c13fe23b..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "browser": { - "a.js": "./a", - "./b.js": "./b", - "c.js": "./d.js", - "./d.js": "./c.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/package.json b/fixtures/enhanced_resolve/test/fixtures/browser-module/package.json deleted file mode 100644 index 19ff7739..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/browser-module/package.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "exports": { - "./lib/index.js": "./lib/index.js" - }, - "browser": { - "./lib/ignore.js": false, - "./lib/replaced.js": "./lib/browser", - "module-a": "./browser/module-a.js", - "module-b": "module-c", - "module-c": "module-c", - "./toString": "./lib/toString.js", - "./lib/main.js": "./lib/main.js", - "./main.js": "./lib/main.js", - "./lib/xyz.js": "./xyz.js", - "./xyz.js": "./lib/xyz.js", - "./lib/non-existent.js": "./lib/non-existent.js", - ".": false, - "./number": 1, - "./foo": "./lib/replaced.js?query" - }, - "innerBrowser1": { - "field": { - "browser": { - "./lib/main1.js": "./lib/main.js" - } - } - }, - "innerBrowser2": { - "browser": { - "./lib/main2.js": "./lib/replaced.js" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/builtins/package.json b/fixtures/enhanced_resolve/test/fixtures/builtins/package.json deleted file mode 100644 index 4a54ea96..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/builtins/package.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "name": "builtins", - "private": true, - "imports": { - "#fs": { - "default": "fs" - }, - "#http": { - "node": "node:http" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/c.js b/fixtures/enhanced_resolve/test/fixtures/c.js deleted file mode 100644 index e3aca8aa..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/c.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = function b() { - require("./a"); - return "This is c"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/complex.js b/fixtures/enhanced_resolve/test/fixtures/complex.js deleted file mode 100644 index 1f62db84..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/complex.js +++ /dev/null @@ -1,13 +0,0 @@ -var 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); diff --git a/fixtures/enhanced_resolve/test/fixtures/crypto-js/index.js b/fixtures/enhanced_resolve/test/fixtures/crypto-js/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json b/fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json deleted file mode 100644 index 1d31aa8b..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "crypto-js", - "main": "index.js", - "browser": { - "crypto": false - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/decorated-fs/exists.js b/fixtures/enhanced_resolve/test/fixtures/decorated-fs/exists.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/dirOrFile.js b/fixtures/enhanced_resolve/test/fixtures/dirOrFile.js deleted file mode 100644 index c3cb885f..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/dirOrFile.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "file"; diff --git a/fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js b/fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js deleted file mode 100644 index 85e01cd4..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "dir"; diff --git a/fixtures/enhanced_resolve/test/fixtures/directory-default/directory-default.js b/fixtures/enhanced_resolve/test/fixtures/directory-default/directory-default.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js deleted file mode 100644 index d1007aae..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js +++ /dev/null @@ -1 +0,0 @@ -export default "string"; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts deleted file mode 100644 index cb0ff5c3..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json deleted file mode 100644 index b523a1e9..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "@org/pkg", - "exports": { - "./*.js": { - "types": "./dist/*.d.ts", - "default": "./dist/*.js" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js deleted file mode 100644 index d1007aae..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js +++ /dev/null @@ -1 +0,0 @@ -export default "string"; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts deleted file mode 100644 index cb0ff5c3..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json deleted file mode 100644 index 8e55fb46..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "@raviqqe/hidash", - "exports": { - "./*.js": { - "types": "./dist/*.d.ts", - "default": "./dist/*.js" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json deleted file mode 100644 index f0edf449..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "exports-field", - "version": "1.0.0", - "exports": { - ".": "./a/../b/../../pack1/index.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/pack1/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/pack1/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/a.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/a.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json deleted file mode 100644 index 6b105c08..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "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/": { - "webpack": ["./lib/lib2/", "./lib/"], - "node": "./lib/", - "default": "./lib/" - }, - "./dist/a.js": "./../../a.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json deleted file mode 100644 index 0012a3de..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "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" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/umd.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/umd.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field/package.json deleted file mode 100644 index 5fa72bb5..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "@exports-field/core", - "version": "1.0.0", - "exports": "./a.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json deleted file mode 100644 index e6f12074..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "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/lib2/", "./lib/"], - "node": "./lib/", - "default": "./lib/" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/index b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/index deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json deleted file mode 100644 index 1a838f49..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "name": "exports-field", - "exportsField": { - "exports": "./main.js" - }, - "ex": "./index", - "broken": { - ".": "./src" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/src/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/src/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.ts b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.mts b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.mts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mjs b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mjs deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mts.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mts.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.ts b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/app.module.js b/fixtures/enhanced_resolve/test/fixtures/extensions/app.module.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.js b/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/foo.js b/fixtures/enhanced_resolve/test/fixtures/extensions/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/foo.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/foo.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/index.js b/fixtures/enhanced_resolve/test/fixtures/extensions/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/index.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module.js b/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module/index.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/package.json b/fixtures/enhanced_resolve/test/fixtures/extensions/package.json deleted file mode 100644 index 5e55a1e8..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/extensions/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "./index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/file.load1 b/fixtures/enhanced_resolve/test/fixtures/file.load1 deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/file.load2 b/fixtures/enhanced_resolve/test/fixtures/file.load2 deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/foo/index.js b/fixtures/enhanced_resolve/test/fixtures/foo/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/foo/package.json b/fixtures/enhanced_resolve/test/fixtures/foo/package.json deleted file mode 100644 index da86787a..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/foo/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "foo", - "version": "1.0.0" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json deleted file mode 100644 index aa2be496..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "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" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/internal/file.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/internal/file.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/y/y.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/y/y.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/internal/i.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/internal/i.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/nested/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js deleted file mode 100644 index e5b70a86..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = { nested: "nested" } diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-3/nested/f/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-3/nested/f/nested/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-4/f/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-4/f/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f$/$.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f$/$.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f/$.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f/$.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/nested/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/a.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/a.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/b.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/dir/b.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/dir/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/index.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json deleted file mode 100644 index 8d8d3a46..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "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/lib2/", "./lib/"], - "node": "./lib/", - "default": "./lib/" - }, - "./dist/a.js": "./../../a.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/c/index.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/c/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/imports-field/package.json deleted file mode 100644 index 248351a9..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "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" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/a.js b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json deleted file mode 100644 index ded7faa2..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json +++ /dev/null @@ -1,2 +0,0 @@ -{ - "main": "./a.js", diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/a.js b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/package.json b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/package.json deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/issue-238/package.json b/fixtures/enhanced_resolve/test/fixtures/issue-238/package.json deleted file mode 100644 index 352055cd..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/issue-238/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "private": true -} diff --git a/fixtures/enhanced_resolve/test/fixtures/issue-238/src/a/config.js b/fixtures/enhanced_resolve/test/fixtures/issue-238/src/a/config.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/issue-238/src/common/config/myObjectFile.js b/fixtures/enhanced_resolve/test/fixtures/issue-238/src/common/config/myObjectFile.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/lib.js b/fixtures/enhanced_resolve/test/fixtures/lib.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/lib/complex1.js b/fixtures/enhanced_resolve/test/fixtures/lib/complex1.js deleted file mode 100644 index b3de3d70..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/lib/complex1.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "lib complex1"; diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self/index.js b/fixtures/enhanced_resolve/test/fixtures/main-field-self/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json b/fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json deleted file mode 100644 index a2b6f341..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "./" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self2/index.js b/fixtures/enhanced_resolve/test/fixtures/main-field-self2/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json b/fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json deleted file mode 100644 index 4fa6f730..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "." -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main1.js b/fixtures/enhanced_resolve/test/fixtures/main1.js deleted file mode 100644 index 168f2a1e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main1.js +++ /dev/null @@ -1,9 +0,0 @@ -var a = require("./a"); -if (x) { - for (var i = 0; i < 100; i++) { - while (true) require("./b"); - do { - i++; - } while (require("m1/a")()); - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main2.js b/fixtures/enhanced_resolve/test/fixtures/main2.js deleted file mode 100644 index 39f062b1..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main2.js +++ /dev/null @@ -1,12 +0,0 @@ -var 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"); - }); - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main3.js b/fixtures/enhanced_resolve/test/fixtures/main3.js deleted file mode 100644 index 1c180166..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main3.js +++ /dev/null @@ -1,4 +0,0 @@ -var a = require("./a"); -require.ensure([], function(require) { - require("./c.js"); -}); diff --git a/fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js b/fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js deleted file mode 100644 index 997c1051..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is nested m1/a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/no#fragment/#/#.js b/fixtures/enhanced_resolve/test/fixtures/no#fragment/#/#.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/no.js b/fixtures/enhanced_resolve/test/fixtures/no.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/browser.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/browser.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/main.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json deleted file mode 100644 index c469e1fd..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "main": "./main.js", - "browser": "./browser.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js deleted file mode 100644 index 549620a5..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "the correct a.js"; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js deleted file mode 100644 index 5db6632e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = " :) " + require("m2/b.js"); diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js deleted file mode 100644 index d308569d..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require("m1/a") + require("m1"); diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js deleted file mode 100644 index cb8127e8..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "Step2"; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json deleted file mode 100644 index 8d6dfa56..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "dash-name", - "exports": "./index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json deleted file mode 100644 index 4fd8706e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "dash", - "exports": "./index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/invalidPackageJson/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/invalidPackageJson/package.json deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js deleted file mode 100644 index 46fc8e6c..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is m1/a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js deleted file mode 100644 index 8565c244..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is m1/b"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js deleted file mode 100644 index 34faaaf5..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "This is m2/b"; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/file.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/file.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js b/fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js deleted file mode 100644 index 997c1051..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is nested m1/a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/dir/index.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/dir/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/index.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/main.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/browser.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/browser.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/index.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json deleted file mode 100644 index e20ceaeb..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "main": "main.js", - "browser": { - "./package-alias/index.js": "./package-alias/browser.js", - "module": "pkg/dir/index" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/typescript/index.ts b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/typescript/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json deleted file mode 100644 index 4a1f838e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "@exports-field/core", - "version": "1.0.0", - "exports": { - ".": "./a.js", - "./x": "./a.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/prefer-pnp/alternative-modules/m1/b.js b/fixtures/enhanced_resolve/test/fixtures/prefer-pnp/alternative-modules/m1/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.css b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.css deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.js b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json deleted file mode 100644 index 14ab704d..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/index.css b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/index.css deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/module.js b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/module.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json deleted file mode 100644 index ee0eb71b..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "main": "../../../c.js", - "module": "module.js", - "style": "index.css" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/roots_fall_through/index.js b/fixtures/enhanced_resolve/test/fixtures/roots_fall_through/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/main.js b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json deleted file mode 100644 index 70a0f20f..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "browser": { - "./index.js": "./main.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/lib/index.js b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/lib/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/main.js b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json deleted file mode 100644 index 2af9e0d1..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "./main.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/shortcutdir.js/a.js b/fixtures/enhanced_resolve/test/fixtures/shortcutdir.js/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/b b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/b deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/c b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/c deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/a b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/a deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/b b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/b deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/b/foo/a b/fixtures/enhanced_resolve/test/fixtures/yield/b/foo/a deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/a b/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/a deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json b/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json deleted file mode 100644 index 0acc4b4c..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "foo", - "version": "1.0.0", - "browser": { - "./a": false - } -} diff --git "a/fixtures/enhanced_resolve/test/fixtures/\346\265\213\350\257\225.js" "b/fixtures/enhanced_resolve/test/fixtures/\346\265\213\350\257\225.js" deleted file mode 100644 index e69de29b..00000000 diff --git "a/fixtures/misc/\344\270\255\346\226\207/\344\270\255\346\226\207.js" "b/fixtures/misc/\344\270\255\346\226\207/\344\270\255\346\226\207.js" deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/pnpm/.gitignore b/fixtures/pnpm/.gitignore deleted file mode 100644 index 3c3629e6..00000000 --- a/fixtures/pnpm/.gitignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/fixtures/pnpm/package.json b/fixtures/pnpm/package.json deleted file mode 100644 index 78712e2b..00000000 --- a/fixtures/pnpm/package.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "name": "pnpm", - "version": "1.0.0", - "private": true, - "devDependencies": { - "axios": "1.6.2", - "styled-components": "6.1.1", - "postcss": "8.4.33" - } -} diff --git a/fixtures/pnpm/pnpm-lock.yaml b/fixtures/pnpm/pnpm-lock.yaml deleted file mode 100644 index e51dfd6a..00000000 --- a/fixtures/pnpm/pnpm-lock.yaml +++ /dev/null @@ -1,212 +0,0 @@ -lockfileVersion: '6.0' - -settings: - autoInstallPeers: true - excludeLinksFromLockfile: false - -devDependencies: - axios: - specifier: 1.6.2 - version: 1.6.2 - postcss: - specifier: 8.4.33 - version: 8.4.33 - styled-components: - specifier: 6.1.1 - version: 6.1.1(react-dom@18.2.0)(react@18.2.0) - -packages: - - /@emotion/is-prop-valid@1.2.1: - resolution: {integrity: sha512-61Mf7Ufx4aDxx1xlDeOm8aFFigGHE4z+0sKCa+IHCeZKiyP9RLD0Mmx7m8b9/Cf37f7NAvQOOJAbQQGVr5uERw==} - dependencies: - '@emotion/memoize': 0.8.1 - dev: true - - /@emotion/memoize@0.8.1: - resolution: {integrity: sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA==} - dev: true - - /@emotion/unitless@0.8.1: - resolution: {integrity: sha512-KOEGMu6dmJZtpadb476IsZBclKvILjopjUii3V+7MnXIQCYh8W3NgNcgwo21n9LXZX6EDIKvqfjYxXebDwxKmQ==} - dev: true - - /@types/stylis@4.2.4: - resolution: {integrity: sha512-36ZrGJ8fgtBr6nwNnuJ9jXIj+bn/pF6UoqmrQT7+Y99+tFFeHHsoR54+194dHdyhPjgbeoNz3Qru0oRt0l6ASQ==} - dev: true - - /asynckit@0.4.0: - resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} - dev: true - - /axios@1.6.2: - resolution: {integrity: sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A==} - dependencies: - follow-redirects: 1.15.3 - form-data: 4.0.0 - proxy-from-env: 1.1.0 - transitivePeerDependencies: - - debug - dev: true - - /camelize@1.0.1: - resolution: {integrity: sha512-dU+Tx2fsypxTgtLoE36npi3UqcjSSMNYfkqgmoEhtZrraP5VWq0K7FkWVTYa8eMPtnU/G2txVsfdCJTn9uzpuQ==} - dev: true - - /combined-stream@1.0.8: - resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} - engines: {node: '>= 0.8'} - dependencies: - delayed-stream: 1.0.0 - dev: true - - /css-color-keywords@1.0.0: - resolution: {integrity: sha512-FyyrDHZKEjXDpNJYvVsV960FiqQyXc/LlYmsxl2BcdMb2WPx0OGRVgTg55rPSyLSNMqP52R9r8geSp7apN3Ofg==} - engines: {node: '>=4'} - dev: true - - /css-to-react-native@3.2.0: - resolution: {integrity: sha512-e8RKaLXMOFii+02mOlqwjbD00KSEKqblnpO9e++1aXS1fPQOpS1YoqdVHBqPjHNoxeF2mimzVqawm2KCbEdtHQ==} - dependencies: - camelize: 1.0.1 - css-color-keywords: 1.0.0 - postcss-value-parser: 4.2.0 - dev: true - - /csstype@3.1.2: - resolution: {integrity: sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==} - dev: true - - /delayed-stream@1.0.0: - resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} - engines: {node: '>=0.4.0'} - dev: true - - /follow-redirects@1.15.3: - resolution: {integrity: sha512-1VzOtuEM8pC9SFU1E+8KfTjZyMztRsgEfwQl44z8A25uy13jSzTj6dyK2Df52iV0vgHCfBwLhDWevLn95w5v6Q==} - engines: {node: '>=4.0'} - peerDependencies: - debug: '*' - peerDependenciesMeta: - debug: - optional: true - dev: true - - /form-data@4.0.0: - resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==} - engines: {node: '>= 6'} - dependencies: - asynckit: 0.4.0 - combined-stream: 1.0.8 - mime-types: 2.1.35 - dev: true - - /js-tokens@4.0.0: - resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} - dev: true - - /loose-envify@1.4.0: - resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==} - hasBin: true - dependencies: - js-tokens: 4.0.0 - dev: true - - /mime-db@1.52.0: - resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} - engines: {node: '>= 0.6'} - dev: true - - /mime-types@2.1.35: - resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} - engines: {node: '>= 0.6'} - dependencies: - mime-db: 1.52.0 - dev: true - - /nanoid@3.3.7: - resolution: {integrity: sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==} - engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} - hasBin: true - dev: true - - /picocolors@1.0.0: - resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==} - dev: true - - /postcss-value-parser@4.2.0: - resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==} - dev: true - - /postcss@8.4.33: - resolution: {integrity: sha512-Kkpbhhdjw2qQs2O2DGX+8m5OVqEcbB9HRBvuYM9pgrjEFUg30A9LmXNlTAUj4S9kgtGyrMbTzVjH7E+s5Re2yg==} - engines: {node: ^10 || ^12 || >=14} - dependencies: - nanoid: 3.3.7 - picocolors: 1.0.0 - source-map-js: 1.0.2 - dev: true - - /proxy-from-env@1.1.0: - resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==} - dev: true - - /react-dom@18.2.0(react@18.2.0): - resolution: {integrity: sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==} - peerDependencies: - react: ^18.2.0 - dependencies: - loose-envify: 1.4.0 - react: 18.2.0 - scheduler: 0.23.0 - dev: true - - /react@18.2.0: - resolution: {integrity: sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==} - engines: {node: '>=0.10.0'} - dependencies: - loose-envify: 1.4.0 - dev: true - - /scheduler@0.23.0: - resolution: {integrity: sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw==} - dependencies: - loose-envify: 1.4.0 - dev: true - - /shallowequal@1.1.0: - resolution: {integrity: sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ==} - dev: true - - /source-map-js@1.0.2: - resolution: {integrity: sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==} - engines: {node: '>=0.10.0'} - dev: true - - /styled-components@6.1.1(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-cpZZP5RrKRIClBW5Eby4JM1wElLVP4NQrJbJ0h10TidTyJf4SIIwa3zLXOoPb4gJi8MsJ8mjq5mu2IrEhZIAcQ==} - engines: {node: '>= 16'} - peerDependencies: - react: '>= 16.8.0' - react-dom: '>= 16.8.0' - dependencies: - '@emotion/is-prop-valid': 1.2.1 - '@emotion/unitless': 0.8.1 - '@types/stylis': 4.2.4 - css-to-react-native: 3.2.0 - csstype: 3.1.2 - postcss: 8.4.33 - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - shallowequal: 1.1.0 - stylis: 4.3.0 - tslib: 2.6.2 - dev: true - - /stylis@4.3.0: - resolution: {integrity: sha512-E87pIogpwUsUwXw7dNyU4QDjdgVMy52m+XEOPEKUn161cCzWjjhPSQhByfd1CcNvrOLnXQ6OnnZDwnJrz/Z4YQ==} - dev: true - - /tslib@2.6.2: - resolution: {integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==} - dev: true diff --git a/fixtures/tsconfig/cases/builtins/thing.js b/fixtures/tsconfig/cases/builtins/thing.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/builtins/tsconfig.json b/fixtures/tsconfig/cases/builtins/tsconfig.json deleted file mode 100644 index 36aa1a4d..00000000 --- a/fixtures/tsconfig/cases/builtins/tsconfig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compilerOptions": { - "baseUrl": "." - } -} diff --git a/fixtures/tsconfig/cases/exports/index.js b/fixtures/tsconfig/cases/exports/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/exports/tsconfig.json b/fixtures/tsconfig/cases/exports/tsconfig.json deleted file mode 100644 index f0e3159b..00000000 --- a/fixtures/tsconfig/cases/exports/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-exports" -} diff --git a/fixtures/tsconfig/cases/extends-extension/base-tsconfig.json b/fixtures/tsconfig/cases/extends-extension/base-tsconfig.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/cases/extends-extension/base-tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/cases/extends-extension/foo.js b/fixtures/tsconfig/cases/extends-extension/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-extension/tsconfig.json b/fixtures/tsconfig/cases/extends-extension/tsconfig.json deleted file mode 100644 index 0ae4c6a3..00000000 --- a/fixtures/tsconfig/cases/extends-extension/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./base-tsconfig" -} diff --git a/fixtures/tsconfig/cases/extends-extensionless/foo.js b/fixtures/tsconfig/cases/extends-extensionless/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-extensionless/tsconfig.json b/fixtures/tsconfig/cases/extends-extensionless/tsconfig.json deleted file mode 100644 index c36cb7d4..00000000 --- a/fixtures/tsconfig/cases/extends-extensionless/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-field/conf" -} diff --git a/fixtures/tsconfig/cases/extends-multiple/foo.js b/fixtures/tsconfig/cases/extends-multiple/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-multiple/tsconfig.json b/fixtures/tsconfig/cases/extends-multiple/tsconfig.json deleted file mode 100644 index aa2ae783..00000000 --- a/fixtures/tsconfig/cases/extends-multiple/tsconfig.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": ["../extends-extension", "../extends-paths"], - "compilerOptions": { - "baseUrl": ".", - }, -} diff --git a/fixtures/tsconfig/cases/extends-not-found/index.js b/fixtures/tsconfig/cases/extends-not-found/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-not-found/tsconfig.json b/fixtures/tsconfig/cases/extends-not-found/tsconfig.json deleted file mode 100644 index 99df91da..00000000 --- a/fixtures/tsconfig/cases/extends-not-found/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./not-found" -} diff --git a/fixtures/tsconfig/cases/extends-paths/src/index.js b/fixtures/tsconfig/cases/extends-paths/src/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-paths/tsconfig.base.json b/fixtures/tsconfig/cases/extends-paths/tsconfig.base.json deleted file mode 100644 index 5c64b067..00000000 --- a/fixtures/tsconfig/cases/extends-paths/tsconfig.base.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "@/*": ["./*"] - } - } -} diff --git a/fixtures/tsconfig/cases/extends-paths/tsconfig.json b/fixtures/tsconfig/cases/extends-paths/tsconfig.json deleted file mode 100644 index 51086018..00000000 --- a/fixtures/tsconfig/cases/extends-paths/tsconfig.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": "./tsconfig.base.json", - "compilerOptions": { - "baseUrl": "src", - }, -} diff --git a/fixtures/tsconfig/cases/field/index.js b/fixtures/tsconfig/cases/field/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/field/tsconfig.json b/fixtures/tsconfig/cases/field/tsconfig.json deleted file mode 100644 index 9f86c3f4..00000000 --- a/fixtures/tsconfig/cases/field/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-field" -} diff --git a/fixtures/tsconfig/cases/index/index.js b/fixtures/tsconfig/cases/index/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/index/tsconfig.json b/fixtures/tsconfig/cases/index/tsconfig.json deleted file mode 100644 index d20b1774..00000000 --- a/fixtures/tsconfig/cases/index/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-index" -} diff --git a/fixtures/tsconfig/cases/paths_template_variable/foo.js b/fixtures/tsconfig/cases/paths_template_variable/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json b/fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json deleted file mode 100644 index a1a37bb6..00000000 --- a/fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "../../tsconfig_template_variable.json" -} diff --git a/fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json b/fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json deleted file mode 100644 index e7d8e5e5..00000000 --- a/fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "compilerOptions": { - "composite": true, - "paths": { - "foo": ["${configDir}/foo.js"] - } - } -} diff --git a/fixtures/tsconfig/cases/project_references/app/aliased/index.ts b/fixtures/tsconfig/cases/project_references/app/aliased/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/app/index.ts b/fixtures/tsconfig/cases/project_references/app/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/app/tsconfig.json b/fixtures/tsconfig/cases/project_references/app/tsconfig.json deleted file mode 100644 index 7036d2bb..00000000 --- a/fixtures/tsconfig/cases/project_references/app/tsconfig.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "extends": "../tsconfig.base.json", - "compilerOptions": { - "baseUrl": "./", - "paths": { - "@/*": ["./aliased/*"] - } - }, - "references": [ - { - "path": "../project_a/conf.json" - }, - { - "path": "../project_b" - }, - { - "path": "../project_c/tsconfig.json" - }, - { - "path": "../../paths_template_variable/tsconfig2.json" - } - ] -} diff --git a/fixtures/tsconfig/cases/project_references/project_a/aliased/index.ts b/fixtures/tsconfig/cases/project_references/project_a/aliased/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_a/conf.json b/fixtures/tsconfig/cases/project_references/project_a/conf.json deleted file mode 100644 index 4d389d7a..00000000 --- a/fixtures/tsconfig/cases/project_references/project_a/conf.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "compilerOptions": { - "composite": true, - "paths": { - "@/*": ["./aliased/*"] - } - } -} diff --git a/fixtures/tsconfig/cases/project_references/project_a/index.ts b/fixtures/tsconfig/cases/project_references/project_a/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_b/src/aliased/index.ts b/fixtures/tsconfig/cases/project_references/project_b/src/aliased/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_b/tsconfig.json b/fixtures/tsconfig/cases/project_references/project_b/tsconfig.json deleted file mode 100644 index 4ab05cd8..00000000 --- a/fixtures/tsconfig/cases/project_references/project_b/tsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "compilerOptions": { - "composite": true, - "baseUrl": "./src", - "paths": { - "@/*": ["./aliased/*"] - } - } -} diff --git a/fixtures/tsconfig/cases/project_references/project_c/index.ts b/fixtures/tsconfig/cases/project_references/project_c/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_c/tsconfig.json b/fixtures/tsconfig/cases/project_references/project_c/tsconfig.json deleted file mode 100644 index fe520939..00000000 --- a/fixtures/tsconfig/cases/project_references/project_c/tsconfig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compilerOptions": { - "composite": true - } -} diff --git a/fixtures/tsconfig/cases/project_references/tsconfig.base.json b/fixtures/tsconfig/cases/project_references/tsconfig.base.json deleted file mode 100644 index 88ccffe7..00000000 --- a/fixtures/tsconfig/cases/project_references/tsconfig.base.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "compilerOptions": { - } -} diff --git a/fixtures/tsconfig/cases/suffixes/a.ios.ts b/fixtures/tsconfig/cases/suffixes/a.ios.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/a.ts b/fixtures/tsconfig/cases/suffixes/a.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/b.ts b/fixtures/tsconfig/cases/suffixes/b.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/c-test.ts b/fixtures/tsconfig/cases/suffixes/c-test.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/index.ts b/fixtures/tsconfig/cases/suffixes/index.ts deleted file mode 100644 index b09939b9..00000000 --- a/fixtures/tsconfig/cases/suffixes/index.ts +++ /dev/null @@ -1 +0,0 @@ -import './a'; diff --git a/fixtures/tsconfig/cases/suffixes/tsconfig.json b/fixtures/tsconfig/cases/suffixes/tsconfig.json deleted file mode 100644 index 4c2ccc8f..00000000 --- a/fixtures/tsconfig/cases/suffixes/tsconfig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compilerOptions": { - "moduleSuffixes": [".ios", "-test", ""] - } -} diff --git a/fixtures/tsconfig/cases/trailing-comma/bar.js b/fixtures/tsconfig/cases/trailing-comma/bar.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/trailing-comma/index.js b/fixtures/tsconfig/cases/trailing-comma/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/trailing-comma/tsconfig.json b/fixtures/tsconfig/cases/trailing-comma/tsconfig.json deleted file mode 100644 index 6dc20ca5..00000000 --- a/fixtures/tsconfig/cases/trailing-comma/tsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "compilerOptions": { - "paths": { - /* some comment */ - "foo": ["bar.js"], - }, - }, - // another comment -} diff --git a/fixtures/tsconfig/foo.js b/fixtures/tsconfig/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/nested/index.js b/fixtures/tsconfig/nested/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/nested/test.js b/fixtures/tsconfig/nested/test.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/nested/tsconfig.json b/fixtures/tsconfig/nested/tsconfig.json deleted file mode 100644 index 6deb3011..00000000 --- a/fixtures/tsconfig/nested/tsconfig.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "extends": "..", - "compilerOptions": { - "paths": { - "ts-path": ["test.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-exports/conf.json b/fixtures/tsconfig/node_modules/tsconfig-exports/conf.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-exports/conf.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-exports/foo.js b/fixtures/tsconfig/node_modules/tsconfig-exports/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-exports/package.json b/fixtures/tsconfig/node_modules/tsconfig-exports/package.json deleted file mode 100644 index be0ddee6..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-exports/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "tsconfig-exports", - "private": true, - "exports": { - ".": "./conf.json" - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-field/conf.json b/fixtures/tsconfig/node_modules/tsconfig-field/conf.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-field/conf.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-field/foo.js b/fixtures/tsconfig/node_modules/tsconfig-field/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-field/package.json b/fixtures/tsconfig/node_modules/tsconfig-field/package.json deleted file mode 100644 index 7138fdde..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-field/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "tsconfig-field", - "private": true, - "tsconfig": "conf.json" -} \ No newline at end of file diff --git a/fixtures/tsconfig/node_modules/tsconfig-index/foo.js b/fixtures/tsconfig/node_modules/tsconfig-index/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-index/package.json b/fixtures/tsconfig/node_modules/tsconfig-index/package.json deleted file mode 100644 index eb2431e7..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-index/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "tsconfig-index", - "private": true -} \ No newline at end of file diff --git a/fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json b/fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-not-used/foo.js b/fixtures/tsconfig/node_modules/tsconfig-not-used/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json b/fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json deleted file mode 100644 index eb16d127..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "ts-path": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/package.json b/fixtures/tsconfig/package.json deleted file mode 100755 index f48acd1c..00000000 --- a/fixtures/tsconfig/package.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "name": "resolver", - "private": true, - "alias": { - "aliased": "foo", - "aliased-file": "./bar.js", - "something": "./nested/test.js", - "aliasedfolder": "./nested", - "aliasedabsolute": "/nested", - "foo/bar": "./bar.js", - "glob/*/*": "./nested/$2", - "./baz": "./bar.js", - "url": false - }, - "imports": { - "#test": "./bar.js" - }, - "dependencies": { - "foo": "^0.3.4" - }, - "peerDependencies": { - "bar": "*" - } -} diff --git a/fixtures/tsconfig/tsconfig.json b/fixtures/tsconfig/tsconfig.json deleted file mode 100644 index eb16d127..00000000 --- a/fixtures/tsconfig/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "ts-path": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/tsconfig_template_variable.json b/fixtures/tsconfig/tsconfig_template_variable.json deleted file mode 100644 index 6f272344..00000000 --- a/fixtures/tsconfig/tsconfig_template_variable.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["${configDir}/foo.js"] - } - } -} diff --git a/napi/__test__/resolver.spec.mjs b/napi/__test__/resolver.spec.mjs deleted file mode 100644 index ac6ee0ef..00000000 --- a/napi/__test__/resolver.spec.mjs +++ /dev/null @@ -1,260 +0,0 @@ -import { join } from 'node:path' -import { fileURLToPath } from 'node:url' - -import test from 'ava' - -let ResolverFactory - -if (process.env.WASI_TEST) { - const wasi = await import('../resolver.wasi.cjs') - ResolverFactory = wasi.ResolverFactory -} else { - const napi = await import('../index.js') - ResolverFactory = napi.ResolverFactory -} - -const currentDir = join(fileURLToPath(import.meta.url), '..') - -const enhancedResolveRoot = join( - currentDir, - '..', - '..', - 'fixtures', - 'enhanced_resolve', - 'test', - 'fixtures' -) - -// https://github.com/webpack/enhanced-resolve/blob/main/test/resolve.test.js - -for (const [title, context, request, expected] of [ - [ - 'absolute path', - enhancedResolveRoot, - join(enhancedResolveRoot, 'main1.js'), - join(enhancedResolveRoot, 'main1.js'), - ], - [ - 'file with .js', - enhancedResolveRoot, - './main1.js', - join(enhancedResolveRoot, 'main1.js'), - ], - [ - 'file without extension', - enhancedResolveRoot, - './main1', - join(enhancedResolveRoot, 'main1.js'), - ], - [ - 'another file with .js', - enhancedResolveRoot, - './a.js', - join(enhancedResolveRoot, 'a.js'), - ], - [ - 'another file without extension', - enhancedResolveRoot, - './a', - join(enhancedResolveRoot, 'a.js'), - ], - [ - 'file in module with .js', - enhancedResolveRoot, - 'm1/a.js', - join(enhancedResolveRoot, 'node_modules/m1/a.js'), - ], - [ - 'file in module without extension', - enhancedResolveRoot, - 'm1/a', - join(enhancedResolveRoot, 'node_modules/m1/a.js'), - ], - [ - 'another file in module without extension', - enhancedResolveRoot, - 'complexm/step1', - join(enhancedResolveRoot, 'node_modules/complexm/step1.js'), - ], - [ - 'from submodule to file in sibling module', - join(enhancedResolveRoot, 'node_modules/complexm'), - 'm2/b.js', - join(enhancedResolveRoot, 'node_modules/m2/b.js'), - ], - [ - 'from nested directory to overwritten file in module', - join(enhancedResolveRoot, 'multiple_modules'), - 'm1/a.js', - join(enhancedResolveRoot, 'multiple_modules/node_modules/m1/a.js'), - ], - [ - 'from nested directory to not overwritten file in module', - join(enhancedResolveRoot, 'multiple_modules'), - 'm1/b.js', - join(enhancedResolveRoot, 'node_modules/m1/b.js'), - ], - [ - 'file with query', - enhancedResolveRoot, - './main1.js?query', - join(enhancedResolveRoot, 'main1.js?query'), - ], - [ - 'file with fragment', - enhancedResolveRoot, - './main1.js#fragment', - join(enhancedResolveRoot, 'main1.js#fragment'), - ], - [ - 'file with fragment and query', - enhancedResolveRoot, - './main1.js#fragment?query', - join(enhancedResolveRoot, 'main1.js#fragment?query'), - ], - [ - 'file with query and fragment', - enhancedResolveRoot, - './main1.js?#fragment', - join(enhancedResolveRoot, 'main1.js?#fragment'), - ], - - [ - 'file with query (unicode)', - enhancedResolveRoot, - './测试.js?query', - join(enhancedResolveRoot, '测试.js?query'), - ], - [ - 'file with fragment (unicode)', - enhancedResolveRoot, - './测试.js#fragment', - join(enhancedResolveRoot, '测试.js#fragment'), - ], - [ - 'file with fragment and query (unicode)', - enhancedResolveRoot, - './测试.js#fragment?query', - join(enhancedResolveRoot, '测试.js#fragment?query'), - ], - [ - 'file with query and fragment (unicode)', - enhancedResolveRoot, - './测试.js?#fragment', - join(enhancedResolveRoot, '测试.js?#fragment'), - ], - - [ - 'file in module with query', - enhancedResolveRoot, - 'm1/a?query', - join(enhancedResolveRoot, 'node_modules/m1/a.js?query'), - ], - [ - 'file in module with fragment', - enhancedResolveRoot, - 'm1/a#fragment', - join(enhancedResolveRoot, 'node_modules/m1/a.js#fragment'), - ], - [ - 'file in module with fragment and query', - enhancedResolveRoot, - 'm1/a#fragment?query', - join(enhancedResolveRoot, 'node_modules/m1/a.js#fragment?query'), - ], - [ - 'file in module with query and fragment', - enhancedResolveRoot, - 'm1/a?#fragment', - join(enhancedResolveRoot, 'node_modules/m1/a.js?#fragment'), - ], - [ - 'differ between directory and file, resolve file', - enhancedResolveRoot, - './dirOrFile', - join(enhancedResolveRoot, 'dirOrFile.js'), - ], - [ - 'differ between directory and file, resolve directory', - enhancedResolveRoot, - './dirOrFile/', - join(enhancedResolveRoot, 'dirOrFile/index.js'), - ], - [ - 'find node_modules outside of node_modules', - join(enhancedResolveRoot, 'browser-module/node_modules'), - 'm1/a', - join(enhancedResolveRoot, 'node_modules/m1/a.js'), - ], - [ - "don't crash on main field pointing to self", - enhancedResolveRoot, - './main-field-self', - join(enhancedResolveRoot, './main-field-self/index.js'), - ], - [ - "don't crash on main field pointing to self (2)", - enhancedResolveRoot, - './main-field-self2', - join(enhancedResolveRoot, './main-field-self2/index.js'), - ], - // enhanced-resolve has `#` prepended with a `\0`, they are removed from the - // following 3 expected test results. - // See https://github.com/webpack/enhanced-resolve#escaping - [ - 'handle fragment edge case (no fragment)', - enhancedResolveRoot, - './no#fragment/#/#', - join(enhancedResolveRoot, 'no#fragment', '#', '#.js'), - ], - [ - 'handle fragment edge case (fragment)', - enhancedResolveRoot, - './no#fragment/#/', - join(enhancedResolveRoot, 'no.js#fragment') + '/#/', - ], - [ - 'handle fragment escaping', - enhancedResolveRoot, - './no\0#fragment/\0#/\0##fragment', - join(enhancedResolveRoot, 'no#fragment', '#', '#.js#fragment'), - ], -]) { - test(title, (t) => { - const resolver = new ResolverFactory({ - modules: ['src/a', 'src/b', 'src/common', 'node_modules'], - extensions: ['.js', '.jsx', '.ts', '.tsx'], - }) - - t.is(resolver.sync(context, request).path, expected) - }) -} - -test('resolve pnpm package', (t) => { - const rootDir = join(currentDir, '..', '..'); - const pnpmProjectPath = join(rootDir, 'fixtures', 'pnpm') - const resolver = new ResolverFactory({ - aliasFields: ['browser'], - }) - t.deepEqual(resolver.sync(pnpmProjectPath, 'styled-components'), { - path: join( - rootDir, - 'node_modules/.pnpm/styled-components@6.1.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/styled-components/dist/styled-components.browser.cjs.js' - ), - }) - t.deepEqual( - resolver.sync( - join( - rootDir, - 'node_modules/.pnpm/styled-components@6.1.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/styled-components' - ), - 'react' - ), - { - path: join( - rootDir, - 'node_modules/.pnpm/react@18.3.1/node_modules/react/index.js' - ), - } - ) -}) diff --git a/napi/src/lib.rs b/napi/src/lib.rs deleted file mode 100644 index 96287041..00000000 --- a/napi/src/lib.rs +++ /dev/null @@ -1,179 +0,0 @@ -extern crate napi; -extern crate napi_derive; -extern crate oxc_resolver; - -use std::{ - path::{Path, PathBuf}, - sync::Arc, -}; - -use napi_derive::napi; -use oxc_resolver::{ResolveOptions, Resolver}; - -use self::options::{NapiResolveOptions, StrOrStrList}; - -mod options; - -#[napi(object)] -pub struct ResolveResult { - pub path: Option, - pub error: Option, -} - -fn resolve(resolver: &Resolver, path: &Path, request: &str) -> ResolveResult { - match resolver.resolve(path, request) { - Ok(resolution) => ResolveResult { - path: Some(resolution.full_path().to_string_lossy().to_string()), - error: None, - }, - Err(err) => ResolveResult { path: None, error: Some(err.to_string()) }, - } -} - -#[allow(clippy::needless_pass_by_value)] -#[napi] -pub fn sync(path: String, request: String) -> ResolveResult { - let path = PathBuf::from(path); - let resolver = Resolver::new(ResolveOptions::default()); - resolve(&resolver, &path, &request) -} - -#[napi] -pub struct ResolverFactory { - resolver: Arc, -} - -#[napi] -impl ResolverFactory { - #[napi(constructor)] - pub fn new(options: NapiResolveOptions) -> Self { - Self { resolver: Arc::new(Resolver::new(Self::normalize_options(options))) } - } - - #[napi] - pub fn default() -> Self { - let default_options = ResolveOptions::default(); - Self { resolver: Arc::new(Resolver::new(default_options)) } - } - - /// Clone the resolver using the same underlying cache. - #[napi] - pub fn clone_with_options(&self, options: NapiResolveOptions) -> Self { - Self { - resolver: Arc::new(self.resolver.clone_with_options(Self::normalize_options(options))), - } - } - - /// Clear the underlying cache. - #[napi] - pub fn clear_cache(&self) { - self.resolver.clear_cache(); - } - - #[allow(clippy::needless_pass_by_value)] - #[napi] - pub fn sync(&self, path: String, request: String) -> ResolveResult { - let path = PathBuf::from(path); - resolve(&self.resolver, &path, &request) - } - - #[allow(clippy::needless_pass_by_value)] - #[napi(js_name = "async")] - pub async fn resolve_async(&self, path: String, request: String) -> ResolveResult { - let path = PathBuf::from(path); - let resolver = self.resolver.clone(); - tokio::spawn(async move { resolve(&resolver, &path, &request) }).await.unwrap() - } - - fn normalize_options(op: NapiResolveOptions) -> ResolveOptions { - let default = ResolveOptions::default(); - // merging options - ResolveOptions { - tsconfig: op.tsconfig.map(|tsconfig| tsconfig.into()), - alias: op - .alias - .map(|alias| { - alias - .into_iter() - .map(|(k, v)| { - let v = v - .into_iter() - .map(|item| match item { - Some(path) => oxc_resolver::AliasValue::from(path), - None => oxc_resolver::AliasValue::Ignore, - }) - .collect(); - (k, v) - }) - .collect::>() - }) - .unwrap_or(default.alias), - alias_fields: op - .alias_fields - .map(|o| o.into_iter().map(|x| StrOrStrList(x).into()).collect::>()) - .unwrap_or(default.alias_fields), - condition_names: op.condition_names.unwrap_or(default.condition_names), - description_files: op.description_files.unwrap_or(default.description_files), - enforce_extension: op - .enforce_extension - .map(|enforce_extension| enforce_extension.into()) - .unwrap_or(default.enforce_extension), - exports_fields: op - .exports_fields - .map(|o| o.into_iter().map(|x| StrOrStrList(x).into()).collect::>()) - .unwrap_or(default.exports_fields), - imports_fields: op - .imports_fields - .map(|o| o.into_iter().map(|x| StrOrStrList(x).into()).collect::>()) - .unwrap_or(default.imports_fields), - extension_alias: op - .extension_alias - .map(|extension_alias| extension_alias.into_iter().collect::>()) - .unwrap_or(default.extension_alias), - extensions: op.extensions.unwrap_or(default.extensions), - fallback: op - .fallback - .map(|fallback| { - fallback - .into_iter() - .map(|(k, v)| { - let v = v - .into_iter() - .map(|item| match item { - Some(path) => oxc_resolver::AliasValue::from(path), - None => oxc_resolver::AliasValue::Ignore, - }) - .collect(); - (k, v) - }) - .collect::>() - }) - .unwrap_or(default.fallback), - fully_specified: op.fully_specified.unwrap_or(default.fully_specified), - main_fields: op - .main_fields - .map(|o| StrOrStrList(o).into()) - .unwrap_or(default.main_fields), - main_files: op.main_files.unwrap_or(default.main_files), - modules: op.modules.map(|o| StrOrStrList(o).into()).unwrap_or(default.modules), - resolve_to_context: op.resolve_to_context.unwrap_or(default.resolve_to_context), - prefer_relative: op.prefer_relative.unwrap_or(default.prefer_relative), - prefer_absolute: op.prefer_absolute.unwrap_or(default.prefer_absolute), - restrictions: op - .restrictions - .map(|restrictions| { - restrictions - .into_iter() - .map(|restriction| restriction.into()) - .collect::>() - }) - .unwrap_or(default.restrictions), - roots: op - .roots - .map(|roots| roots.into_iter().map(PathBuf::from).collect::>()) - .unwrap_or(default.roots), - symlinks: op.symlinks.unwrap_or(default.symlinks), - builtin_modules: op.builtin_modules.unwrap_or(default.builtin_modules), - } - } -} diff --git a/napi/src/options.rs b/napi/src/options.rs deleted file mode 100644 index ea35672f..00000000 --- a/napi/src/options.rs +++ /dev/null @@ -1,261 +0,0 @@ -use std::path::PathBuf; - -use napi::Either; -use napi_derive::napi; -use std::collections::HashMap; - -/// Module Resolution Options -/// -/// Options are directly ported from [enhanced-resolve](https://github.com/webpack/enhanced-resolve#resolver-options). -/// -/// See [webpack resolve](https://webpack.js.org/configuration/resolve/) for information and examples -#[derive(Debug, Clone)] -#[napi(object)] -pub struct NapiResolveOptions { - /// Path to TypeScript configuration file. - /// - /// Default `None` - pub tsconfig: Option, - - /// Alias for [ResolveOptions::alias] and [ResolveOptions::fallback]. - /// - /// For the second value of the tuple, `None -> AliasValue::Ignore`, Some(String) -> - /// AliasValue::Path(String)` - /// Create aliases to import or require certain modules more easily. - /// A trailing $ can also be added to the given object's keys to signify an exact match. - pub alias: Option>>>, - - /// A list of alias fields in description files. - /// Specify a field, such as `browser`, to be parsed according to [this specification](https://github.com/defunctzombie/package-browser-field-spec). - /// Can be a path to json object such as `["path", "to", "exports"]`. - /// - /// Default `[]` - #[napi(ts_type = "(string | string[])[]")] - pub alias_fields: Option>, - - /// Condition names for exports field which defines entry points of a package. - /// The key order in the exports field is significant. During condition matching, earlier entries have higher priority and take precedence over later entries. - /// - /// Default `[]` - pub condition_names: Option>, - - /// The JSON files to use for descriptions. (There was once a `bower.json`.) - /// - /// Default `["package.json"]` - pub description_files: Option>, - - /// If true, it will not allow extension-less files. - /// So by default `require('./foo')` works if `./foo` has a `.js` extension, - /// but with this enabled only `require('./foo.js')` will work. - /// - /// Default to `true` when [ResolveOptions::extensions] contains an empty string. - /// Use `Some(false)` to disable the behavior. - /// See - /// - /// Default None, which is the same as `Some(false)` when the above empty rule is not applied. - pub enforce_extension: Option, - - /// A list of exports fields in description files. - /// Can be a path to json object such as `["path", "to", "exports"]`. - /// - /// Default `[["exports"]]`. - #[napi(ts_type = "(string | string[])[]")] - pub exports_fields: Option>, - - /// Fields from `package.json` which are used to provide the internal requests of a package - /// (requests starting with # are considered internal). - /// - /// Can be a path to a JSON object such as `["path", "to", "imports"]`. - /// - /// Default `[["imports"]]`. - #[napi(ts_type = "(string | string[])[]")] - pub imports_fields: Option>, - - /// An object which maps extension to extension aliases. - /// - /// Default `{}` - pub extension_alias: Option>>, - - /// Attempt to resolve these extensions in order. - /// If multiple files share the same name but have different extensions, - /// will resolve the one with the extension listed first in the array and skip the rest. - /// - /// Default `[".js", ".json", ".node"]` - pub extensions: Option>, - - /// Redirect module requests when normal resolving fails. - /// - /// Default `[]` - pub fallback: Option>>>, - - /// 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). - /// - /// See also webpack configuration [resolve.fullySpecified](https://webpack.js.org/configuration/module/#resolvefullyspecified) - /// - /// Default `false` - pub fully_specified: Option, - - /// A list of main fields in description files - /// - /// Default `["main"]`. - #[napi(ts_type = "string | string[]")] - pub main_fields: Option, - - /// The filename to be used while resolving directories. - /// - /// Default `["index"]` - pub main_files: Option>, - - /// A list of directories to resolve modules from, can be absolute path or folder name. - /// - /// Default `["node_modules"]` - #[napi(ts_type = "string | string[]")] - pub modules: Option, - - /// Resolve to a context instead of a file. - /// - /// Default `false` - pub resolve_to_context: Option, - - /// Prefer to resolve module requests as relative requests instead of using modules from node_modules directories. - /// - /// Default `false` - pub prefer_relative: Option, - - /// Prefer to resolve server-relative urls as absolute paths before falling back to resolve in ResolveOptions::roots. - /// - /// Default `false` - pub prefer_absolute: Option, - - /// A list of resolve restrictions to restrict the paths that a request can be resolved on. - /// - /// Default `[]` - pub restrictions: Option>, - - /// A list of directories where requests of server-relative URLs (starting with '/') are resolved. - /// On non-Windows systems these requests are resolved as an absolute path first. - /// - /// Default `[]` - pub roots: Option>, - - /// Whether to resolve symlinks to their symlinked location. - /// When enabled, symlinked resources are resolved to their real path, not their symlinked location. - /// Note that this may cause module resolution to fail when using tools that symlink packages (like npm link). - /// - /// Default `true` - pub symlinks: Option, - - /// Whether to parse [module.builtinModules](https://nodejs.org/api/module.html#modulebuiltinmodules) or not. - /// For example, "zlib" will throw [crate::ResolveError::Builtin] when set to true. - /// - /// Default `false` - pub builtin_modules: Option, -} - -#[napi] -#[derive(Debug, PartialEq, Eq)] -pub enum EnforceExtension { - Auto, - Enabled, - Disabled, -} - -impl EnforceExtension { - pub fn is_auto(&self) -> bool { - *self == Self::Auto - } - - pub fn is_enabled(&self) -> bool { - *self == Self::Enabled - } - - pub fn is_disabled(&self) -> bool { - *self == Self::Disabled - } -} - -/// Alias Value for [ResolveOptions::alias] and [ResolveOptions::fallback]. -/// Use struct because napi don't support structured union now -#[napi(object)] -#[derive(Debug, Clone)] -pub struct Restriction { - pub path: Option, - pub regex: Option, -} - -/// Tsconfig Options -/// -/// Derived from [tsconfig-paths-webpack-plugin](https://github.com/dividab/tsconfig-paths-webpack-plugin#options) -#[napi(object)] -#[derive(Debug, Clone)] -pub struct TsconfigOptions { - /// Allows you to specify where to find the TypeScript configuration file. - /// You may provide - /// * a relative path to the configuration file. It will be resolved relative to cwd. - /// * an absolute path to the configuration file. - pub config_file: String, - - /// Support for Typescript Project References. - /// - /// * `'auto'`: use the `references` field from tsconfig of `config_file`. - /// * `string[]`: manually provided relative or absolute path. - #[napi(ts_type = "'auto' | string[]")] - pub references: Option>>, -} - -impl Into for Restriction { - fn into(self) -> oxc_resolver::Restriction { - match (self.path, self.regex) { - (None, None) => { - panic!("Should specify path or regex") - } - (None, Some(regex)) => oxc_resolver::Restriction::RegExp(regex), - (Some(path), None) => oxc_resolver::Restriction::Path(PathBuf::from(path)), - (Some(_), Some(_)) => { - panic!("Restriction can't be path and regex at the same time") - } - } - } -} - -impl Into for EnforceExtension { - fn into(self) -> oxc_resolver::EnforceExtension { - match self { - EnforceExtension::Auto => oxc_resolver::EnforceExtension::Auto, - EnforceExtension::Enabled => oxc_resolver::EnforceExtension::Enabled, - EnforceExtension::Disabled => oxc_resolver::EnforceExtension::Disabled, - } - } -} - -impl Into for TsconfigOptions { - fn into(self) -> oxc_resolver::TsconfigOptions { - oxc_resolver::TsconfigOptions { - config_file: PathBuf::from(self.config_file), - references: match self.references { - Some(Either::A(string)) if string.as_str() == "auto" => { - oxc_resolver::TsconfigReferences::Auto - } - Some(Either::A(opt)) => { - panic!("`{}` is not a valid option for tsconfig references", opt) - } - Some(Either::B(paths)) => oxc_resolver::TsconfigReferences::Paths( - paths.into_iter().map(PathBuf::from).collect::>(), - ), - None => oxc_resolver::TsconfigReferences::Disabled, - }, - } - } -} - -type StrOrStrListType = Either>; -pub struct StrOrStrList(pub StrOrStrListType); - -impl Into> for StrOrStrList { - fn into(self) -> Vec { - match self { - StrOrStrList(Either::A(s)) => Vec::from([s]), - StrOrStrList(Either::B(a)) => a, - } - } -} diff --git a/napi/tests/options.test.mjs b/napi/tests/options.test.mjs deleted file mode 100644 index 4a93efff..00000000 --- a/napi/tests/options.test.mjs +++ /dev/null @@ -1,59 +0,0 @@ -import { describe, it } from "node:test"; -import { ResolverFactory } from "../index.js"; -import * as assert from "node:assert"; -import * as path from "node:path"; - -const fixtureDir = new URL( - "../../fixtures/enhanced_resolve/test/fixtures", - import.meta.url -).pathname; - -describe("option", () => { - describe("aliasFields", () => { - it("should allow field string ", () => { - const resolver = new ResolverFactory({ aliasFields: ["browser"] }); - assert.match( - resolver.sync(fixtureDir, "./browser-module/lib/replaced.js").path, - /browser-module\/lib\/browser\.js$/ - ); - }); - it("should allow json path array", () => { - const resolver = new ResolverFactory({ - aliasFields: [["innerBrowser1", "field", "browser"]], - }); - - assert.match( - resolver.sync(fixtureDir, "./browser-module/lib/main1.js").path, - /browser-module\/lib\/main\.js$/ - ); - }); - }); - - describe("exportsFields", () => { - const createTest = (exportsFields) => { - const resolver = new ResolverFactory({ exportsFields }); - assert.match( - resolver.sync( - path.resolve(fixtureDir, "./exports-field3"), - "exports-field" - ).path, - /\/exports-field\/src\/index\.js$/ - ); - }; - it("should allow string as field item", createTest(["broken"])); - it("should allow json path array as field item", createTest([["broken"]])); - }); - - describe("mainFields", () => { - const createTest = (mainFields) => { - const resolver = new ResolverFactory({ mainFields }); - assert.match( - resolver.sync(fixtureDir, "../..").path, - /\/lib\/index\.js$/ - ); - }; - it("should use `'main'` as default", createTest(undefined)); - it("should allow field string", createTest("main")); - it("should allow field array", createTest(["main"])); - }); -}); diff --git a/npm/package.json b/npm/package.json index f8e1f352..8e711b3a 100644 --- a/npm/package.json +++ b/npm/package.json @@ -1,46 +1,35 @@ { - "name": "oxc-resolver", - "version": "1.8.2", - "description": "Oxc Resolver Node API", - "main": "index.js", - "browser": "browser.js", - "files": [ - "index.d.ts", - "index.js", - "browser.js" - ], - "license": "MIT", - "homepage": "https://oxc.rs", - "repository": { - "type": "git", - "url": "git+https://github.com/oxc-project/oxc-resolver.git" - }, - "publishConfig": { - "registry": "https://registry.npmjs.org/", - "access": "public" - }, - "napi": { - "binaryName": "resolver", - "packageName": "@oxc-resolver/binding", - "wasm": { - "browser": { - "fs": true - } - }, - "targets": [ - "x86_64-pc-windows-msvc", - "aarch64-pc-windows-msvc", - "x86_64-unknown-linux-gnu", - "x86_64-unknown-linux-musl", - "aarch64-unknown-linux-gnu", - "aarch64-unknown-linux-musl", - "armv7-unknown-linux-gnueabihf", - "x86_64-apple-darwin", - "aarch64-apple-darwin", - "wasm32-wasip1-threads" - ] - }, - "funding": { - "url": "https://github.com/sponsors/Boshen" - } + "name": "oxc-resolver", + "description": "Oxc Resolver Node API", + "funding": { + "url": "https://github.com/sponsors/Boshen" + }, + "main": "index.js", + "browser": "browser.js", + "files": [ + "index.d.ts", + "index.js", + "browser.js" + ], + "napi": { + "binaryName": "resolver", + "packageName": "@oxc-resolver/binding", + "targets": [ + "x86_64-pc-windows-msvc", + "aarch64-pc-windows-msvc", + "x86_64-unknown-linux-gnu", + "x86_64-unknown-linux-musl", + "aarch64-unknown-linux-gnu", + "aarch64-unknown-linux-musl", + "armv7-unknown-linux-gnueabihf", + "x86_64-apple-darwin", + "aarch64-apple-darwin", + "wasm32-wasip1-threads" + ], + "wasm": { + "browser": { + "fs": true + } + } + } } diff --git a/package.json b/package.json index 51cb822a..a431e48f 100644 --- a/package.json +++ b/package.json @@ -1,33 +1,24 @@ { - "name": "@oxc-resolver/binding", - "private": true, - "version": "0.0.0", - "scripts": { - "build": "napi build --platform --release --package-json-path npm/package.json --manifest-path napi/Cargo.toml", - "build:debug": "napi build --platform --package-json-path npm/package.json --manifest-path napi/Cargo.toml", - "prepublishOnly": "napi pre-publish -t npm", - "test": "ava" - }, - "devDependencies": { - "@napi-rs/cli": "^3.0.0-alpha.43", - "@napi-rs/wasm-runtime": "^0.2.0", - "@types/node": "^20.10.4", - "ava": "^6.0.1", - "emnapi": "^1.0.0", - "typescript": "^5.3.3" - }, - "ava": { - "files": [ - "napi/__test__/*.spec.mjs" - ], - "cache": false - }, - "packageManager": "pnpm@9.4.0", - "repository": { - "type": "git", - "url": "git+https://github.com/oxc-project/oxc-resolver.git" - }, - "funding": { - "url": "https://github.com/sponsors/Boshen" - } + "name": "@oxc-resolver/binding", + "funding": { + "url": "https://github.com/sponsors/Boshen" + }, + "scripts": { + "build": "napi build --platform --release --package-json-path npm/package.json --manifest-path napi/Cargo.toml", + "build:debug": "napi build --platform --package-json-path npm/package.json --manifest-path napi/Cargo.toml", + "prepublishOnly": "napi pre-publish -t npm" + }, + "ava": { + "cache": false, + "files": [ + "napi/__test__/*.spec.mjs" + ] + }, + "devDependencies": { + "@napi-rs/cli": "^3.0.0-alpha.43", + "@napi-rs/wasm-runtime": "^0.2.0", + "@types/node": "^20.10.4", + "ava": "^6.0.1", + "emnapi": "^1.0.0" + } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml deleted file mode 100644 index 162a4b3c..00000000 --- a/pnpm-lock.yaml +++ /dev/null @@ -1,2690 +0,0 @@ -lockfileVersion: '9.0' - -settings: - autoInstallPeers: true - excludeLinksFromLockfile: false - -importers: - - .: - devDependencies: - '@napi-rs/cli': - specifier: ^3.0.0-alpha.43 - version: 3.0.0-alpha.55(@emnapi/runtime@1.2.0)(emnapi@1.2.0) - '@napi-rs/wasm-runtime': - specifier: ^0.2.0 - version: 0.2.4 - '@types/node': - specifier: ^20.10.4 - version: 20.14.8 - ava: - specifier: ^6.0.1 - version: 6.1.3 - emnapi: - specifier: ^1.0.0 - version: 1.2.0 - typescript: - specifier: ^5.3.3 - version: 5.5.2 - - fixtures/pnpm: - devDependencies: - axios: - specifier: 1.6.2 - version: 1.6.2 - postcss: - specifier: 8.4.33 - version: 8.4.33 - styled-components: - specifier: 6.1.1 - version: 6.1.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - - npm: {} - -packages: - - '@emnapi/core@1.2.0': - resolution: {integrity: sha512-E7Vgw78I93we4ZWdYCb4DGAwRROGkMIXk7/y87UmANR+J6qsWusmC3gLt0H+O0KOt5e6O38U8oJamgbudrES/w==} - - '@emnapi/runtime@1.2.0': - resolution: {integrity: sha512-bV21/9LQmcQeCPEg3BDFtvwL6cwiTMksYNWQQ4KOxCZikEGalWtenoZ0wCiukJINlGCIi2KXx01g4FoH/LxpzQ==} - - '@emnapi/wasi-threads@1.0.1': - resolution: {integrity: sha512-iIBu7mwkq4UQGeMEM8bLwNK962nXdhodeScX4slfQnRhEMMzvYivHhutCIk8uojvmASXXPC2WNEjwxFWk72Oqw==} - - '@emotion/is-prop-valid@1.2.2': - resolution: {integrity: sha512-uNsoYd37AFmaCdXlg6EYD1KaPOaRWRByMCYzbKUX4+hhMfrxdVSelShywL4JVaAeM/eHUOSprYBQls+/neX3pw==} - - '@emotion/memoize@0.8.1': - resolution: {integrity: sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA==} - - '@emotion/unitless@0.8.1': - resolution: {integrity: sha512-KOEGMu6dmJZtpadb476IsZBclKvILjopjUii3V+7MnXIQCYh8W3NgNcgwo21n9LXZX6EDIKvqfjYxXebDwxKmQ==} - - '@inquirer/figures@1.0.3': - resolution: {integrity: sha512-ErXXzENMH5pJt5/ssXV0DfWUZqly8nGzf0UcBV9xTnP+KyffE2mqyxIMBrZ8ijQck2nU0TQm40EQB53YreyWHw==} - engines: {node: '>=18'} - - '@ljharb/through@2.3.13': - resolution: {integrity: sha512-/gKJun8NNiWGZJkGzI/Ragc53cOdcLNdzjLaIa+GEjguQs0ulsurx8WN0jijdK9yPqDvziX995sMRLyLt1uZMQ==} - engines: {node: '>= 0.4'} - - '@mapbox/node-pre-gyp@1.0.11': - resolution: {integrity: sha512-Yhlar6v9WQgUp/He7BdgzOz8lqMQ8sU+jkCq7Wx8Myc5YFJLbEe7lgui/V7G1qB1DJykHSGwreceSaD60Y0PUQ==} - hasBin: true - - '@napi-rs/cli@3.0.0-alpha.55': - resolution: {integrity: sha512-6XgBBTX8O28W5gcSzqYkI72UVJV6Y2YcyQNrEqak39JavJRLlXCv09uLF97raynXAOO50KeP6DEXFy5P8MR2sw==} - engines: {node: '>= 16'} - hasBin: true - peerDependencies: - '@emnapi/runtime': ^1.1.0 - emnapi: ^1.1.0 - peerDependenciesMeta: - '@emnapi/runtime': - optional: true - emnapi: - optional: true - - '@napi-rs/cross-toolchain@0.0.16': - resolution: {integrity: sha512-jwdjHT5L0m9MH0CmzDwPp0ckn/UO7afHCsPeo7NugHUvYgvlgS7SWhdMVgIgJW2HHqhcW/2nhaLLGpAU1c7QRQ==} - peerDependencies: - '@napi-rs/cross-toolchain-arm64-target-aarch64': ^0.0.16 - '@napi-rs/cross-toolchain-arm64-target-armv7': ^0.0.16 - '@napi-rs/cross-toolchain-arm64-target-x86_64': ^0.0.16 - '@napi-rs/cross-toolchain-x64-target-aarch64': ^0.0.16 - '@napi-rs/cross-toolchain-x64-target-armv7': ^0.0.16 - '@napi-rs/cross-toolchain-x64-target-x86_64': ^0.0.16 - peerDependenciesMeta: - '@napi-rs/cross-toolchain-arm64-target-aarch64': - optional: true - '@napi-rs/cross-toolchain-arm64-target-armv7': - optional: true - '@napi-rs/cross-toolchain-arm64-target-x86_64': - optional: true - '@napi-rs/cross-toolchain-x64-target-aarch64': - optional: true - '@napi-rs/cross-toolchain-x64-target-armv7': - optional: true - '@napi-rs/cross-toolchain-x64-target-x86_64': - optional: true - - '@napi-rs/lzma-android-arm-eabi@1.3.1': - resolution: {integrity: sha512-mtGOg8jXlc+pTBI86cqohfndS9UmOAkk9d5CChKMb8btVks70yhUN1e7YYS3QFbmoxbPs2Ee+wmuH1Khdc7B2w==} - engines: {node: '>= 10'} - cpu: [arm] - os: [android] - - '@napi-rs/lzma-android-arm64@1.3.1': - resolution: {integrity: sha512-4uGkQgAv9Tnc/i0k2eIgbhZgyzs94+iECWxz4MFZNcZ1fNGvGbRL2j+SITE4OmwrUn3TuFK/uYWfgzooq8E1Qg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [android] - - '@napi-rs/lzma-darwin-arm64@1.3.1': - resolution: {integrity: sha512-MZBg4iwHTS8icjTiCMdzh8kYrMmKBCEglFPa+vjI91R2XDwuuwSzqmpATRpmMH8cWUUWtGPF4fnxKzjgkzhd4Q==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [darwin] - - '@napi-rs/lzma-darwin-x64@1.3.1': - resolution: {integrity: sha512-7vte+1lYV7xgZERKH/pjAeh4T16aQASKOzu4op70pK6VP/64Plr5rrvqxQqQmlAIe4pwyo/RkFl1n4LXDod3xg==} - engines: {node: '>= 10'} - cpu: [x64] - os: [darwin] - - '@napi-rs/lzma-freebsd-x64@1.3.1': - resolution: {integrity: sha512-uBS74fynTqLUC3catIxyezCafn8UDlr2yxVV47vz1T6Vop2PGDz/cMQdV6rnLSjPE08Rv66ihM36mgf/MmOkOg==} - engines: {node: '>= 10'} - cpu: [x64] - os: [freebsd] - - '@napi-rs/lzma-linux-arm-gnueabihf@1.3.1': - resolution: {integrity: sha512-rrVLyqBJeN29gPJCNkPbZ7dAzaseEcERKyhjwM+DfbFrDUvtkEcrYPvo+iwE/NmF+OkZQkzcanrVMGnq/mcJYQ==} - engines: {node: '>= 10'} - cpu: [arm] - os: [linux] - - '@napi-rs/lzma-linux-arm64-gnu@1.3.1': - resolution: {integrity: sha512-vDmVsthRbX2opkgRirJJGKQxUP/spvyVM2Y5CyCWZ7sadSID3hA97r38gf9ISn/sJ8/r93IPWLq+iycudNKi+Q==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/lzma-linux-arm64-musl@1.3.1': - resolution: {integrity: sha512-x4m/J3hRdFd3IoqKc+4aBcSUkcuDEP7hH6vdss8bKNLjPfXmnG/lcHJEQX3hNnNOULPP8xVRxgiY8jeL62cnsw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/lzma-linux-x64-gnu@1.3.1': - resolution: {integrity: sha512-riB+Xg72NfH8Kcpq07omshVu0QsLW0v2bhywBNYxvA+t2dGGWSIEN1U/zazUXys+IEA6pBQKqLVseurWE6Cl8g==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/lzma-linux-x64-musl@1.3.1': - resolution: {integrity: sha512-JXLgJFwoeysxdSg7rdVYP8wrliCQVJlU5JcLYjRVSCL4P0mQTjnYi7R7VdaOkDACw/Fvlji7oIJXt0KiaDTcOw==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/lzma-wasm32-wasi@1.3.1': - resolution: {integrity: sha512-XTA9XTUtj0KPKuzNS2oi3bWN6tJodk00wwMd/TiKoEqx9Fe/zu+OfDGuXAn+xs+P7S3YCDHqjYinuTQMZ0ucJw==} - engines: {node: '>=14.0.0'} - cpu: [wasm32] - - '@napi-rs/lzma-win32-arm64-msvc@1.3.1': - resolution: {integrity: sha512-qLDfs9UEtLPPTN/FdSz3gSdlx86VwFQBuLBrQtaiYQtUTKZCOYV1Z1fXqFt5Zqa1HKV2oyXnwGcTI7RpcyXxtg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [win32] - - '@napi-rs/lzma-win32-ia32-msvc@1.3.1': - resolution: {integrity: sha512-rWNlxLFMIfvxzfdQCfeQ3D/HEnQG3vfladFYrXUx6ePXO6r+BLCGn6/LWSSuKlw4vKkb1iHEWsAVaRLIcJEMIA==} - engines: {node: '>= 10'} - cpu: [ia32] - os: [win32] - - '@napi-rs/lzma-win32-x64-msvc@1.3.1': - resolution: {integrity: sha512-SNfHNqEjabXfTL1+KRi0qiAhwIlZHhQystvfSYX6p1g+2trSC/3WUpUQ4fbbR7KyE31g2AAnwjXivnlQ0af/pg==} - engines: {node: '>= 10'} - cpu: [x64] - os: [win32] - - '@napi-rs/lzma@1.3.1': - resolution: {integrity: sha512-XyZoBlYNMvCulK/RmVK/0nB3j7IdH7HpqcrMMg0U+HqQqKRLOQBwvnKNBocPC1bZQ7iZuKWYTLn1ayZwTyek8w==} - engines: {node: '>= 10'} - - '@napi-rs/tar-android-arm-eabi@0.1.1': - resolution: {integrity: sha512-Ufa0ahZvE5KGrC2WBux5svCe/jvC+e8IgtleiicwqnfgTfbDknYyq/QuqkP1AnMp/IvTmx2iutCZt6OFIG0zAg==} - engines: {node: '>= 10'} - cpu: [arm] - os: [android] - - '@napi-rs/tar-android-arm64@0.1.1': - resolution: {integrity: sha512-KUu5fHIiIObSuZ/crHxUrQ243+LiCRKPwdCVLHwjtftqFjzls+R2Mp6GrpM41XxexDMN00SUta3kazi93Xr19A==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [android] - - '@napi-rs/tar-darwin-arm64@0.1.1': - resolution: {integrity: sha512-jaqgdX20iIga+2gzotQ78eF00Cm8vECocUYeMY62WqyzJNv/jx1dlOfELWEccOjpmawFT9tjWebsS9F1QMvSUg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [darwin] - - '@napi-rs/tar-darwin-x64@0.1.1': - resolution: {integrity: sha512-80sa32IxfRso9x9sGTFpfLSx3BnruyJODpSkUzalOCz9i14n5gOKA8KR/JrnSWwDz0p5l5P9kfQD3pu8Voj7WA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [darwin] - - '@napi-rs/tar-freebsd-x64@0.1.1': - resolution: {integrity: sha512-P7V1zBjjC1dCrTwtUzuzYM4AeZduigeCtd8qQw2IUZowM5AsmhMd77oYuXjdU29cEpKUpyYjJRxjPCzFy+WbAQ==} - engines: {node: '>= 10'} - cpu: [x64] - os: [freebsd] - - '@napi-rs/tar-linux-arm-gnueabihf@0.1.1': - resolution: {integrity: sha512-qpC71ILPkWKt8k1iJCYt5gjwcOkd2VFSQIelTRr12t5CVNKV04rE/TMdwFoCP7kxbtb9Fl2cZzCRISw2BhMCmQ==} - engines: {node: '>= 10'} - cpu: [arm] - os: [linux] - - '@napi-rs/tar-linux-arm64-gnu@0.1.1': - resolution: {integrity: sha512-71QgxcFJCog6O4Tauoge8D0ILkDGJTRk3ru7zG8PUFG1QXJ1kkiRikdT77YmoVxtomc9FUOt+bdEdU5Yn+3QUQ==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/tar-linux-arm64-musl@0.1.1': - resolution: {integrity: sha512-R2e7YEILPKc447N1hUt1zQuyy0st83HX6nhmtFywS1aOj76/3hzxLVrebGiiS6kifyCrO82o66CNTYe7DixMZw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/tar-linux-x64-gnu@0.1.1': - resolution: {integrity: sha512-tmy9q2LXUB2GQ+IgUzJn3+us52leplMu96ORyFq1iHQEelGSqXt4xi5DzU07JhX3obJPqVqkybtcRS4enBfmBA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/tar-linux-x64-musl@0.1.1': - resolution: {integrity: sha512-j5ePbe6vihApl0cGPPDUVTWZbf2mF4NhxngAoG2jp7AeX3cWP2O4pjsvaOraW6QfvWEMFPeER7S0b6eBS7duvA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/tar-wasm32-wasi@0.1.1': - resolution: {integrity: sha512-se0+DlOiIRt7mcz7BeOJDoZtCrROpKLwiAOGmNgrjQ/SZS7TnOPuwm3wy9XN9WLoepttEjCEem6UP8yD5GJuQg==} - engines: {node: '>=14.0.0'} - cpu: [wasm32] - - '@napi-rs/tar-win32-arm64-msvc@0.1.1': - resolution: {integrity: sha512-FDZPi2wC7RwzvodogigLh/pJvhqCTVTUqOYuHlLkPSUbSAGiEkI55wk9RqH3y3EdJQaDuzyqC0QKz5ket2U+GA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [win32] - - '@napi-rs/tar-win32-ia32-msvc@0.1.1': - resolution: {integrity: sha512-OPR9Tou5z5M912G7Kc7gkf1ltinbOQx5dS/OeDIWHvPGOfdFDIxt0YVKhzSLRJi43+zIDp8/+cbeMD/cKXfX8w==} - engines: {node: '>= 10'} - cpu: [ia32] - os: [win32] - - '@napi-rs/tar-win32-x64-msvc@0.1.1': - resolution: {integrity: sha512-hiv5KfhrMSg8tTRC2oQXVckVg1h6ZVjwbd5aF9Esl0V3p2TaNFwwbqgnAN4Gm/PmSnHWNL/IRTHkk3cOzDWihQ==} - engines: {node: '>= 10'} - cpu: [x64] - os: [win32] - - '@napi-rs/tar@0.1.1': - resolution: {integrity: sha512-FOMhwwlvoYjHaDBxP26K3D92ltw1Y/CC4CIjgC6qXdzW4MYNwTlEyI58smCM3k+nCVJH3kpOYyH3sgbK4WZA4A==} - engines: {node: '>= 10'} - - '@napi-rs/wasm-runtime@0.2.4': - resolution: {integrity: sha512-9zESzOO5aDByvhIAsOy9TbpZ0Ur2AJbUI7UT73kcUTS2mxAMHOBaa1st/jAymNoCtvrit99kkzT1FZuXVcgfIQ==} - - '@napi-rs/wasm-tools-android-arm-eabi@0.0.2': - resolution: {integrity: sha512-/b+UU3suXjW4P0DzHRNdrnebQtFKcQf/YMeZJH+xUlKgvwli5kbmWjx8Wqqz0VETVkUTuPqJMBDIVLyc+14FGw==} - engines: {node: '>= 10'} - cpu: [arm] - os: [android] - - '@napi-rs/wasm-tools-android-arm64@0.0.2': - resolution: {integrity: sha512-j57GbDflwJdZtT8pZj5fOV4JAP+LdKN+wzsUYs+QRUoBqpWbbUANudolqfw63bkS9sD4z7fbCuz8iwtJqzxTVA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [android] - - '@napi-rs/wasm-tools-darwin-arm64@0.0.2': - resolution: {integrity: sha512-P2ChgWgVuv9GwmbxN89R84KzIImoTqXINteEixUvmkdnhyFiR+I8deNs89Yed+5w8QLC6MEfrtRqLP9YI+NoQA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [darwin] - - '@napi-rs/wasm-tools-darwin-x64@0.0.2': - resolution: {integrity: sha512-T/kQQ0gt8+wau1Z821PKVAD76QhmwVoLs2CT7Z9tTBs2pJvwSCP0C/kQiQAHcJIMi7A2E9Ab/Mez0BERy50EFA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [darwin] - - '@napi-rs/wasm-tools-freebsd-x64@0.0.2': - resolution: {integrity: sha512-GnnHu+r5sfzuxC/1J5UMF/h3BOZnHb3NQZ5hmbCfZYCKzpzRxrAJhzRunlbRN+v0x8M/49dztVTYR3s7K4ooAw==} - engines: {node: '>= 10'} - cpu: [x64] - os: [freebsd] - - '@napi-rs/wasm-tools-linux-arm64-gnu@0.0.2': - resolution: {integrity: sha512-KnZdLT0OnKb1CG2kdt3/WvM43vr9i+FEwXCvSOVC/6Tsifz7ynhMg7LAVESILd03HubzQJfg9nbRsk0bQ+IOwg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/wasm-tools-linux-arm64-musl@0.0.2': - resolution: {integrity: sha512-HkpZOID2U8P6pWqK3mqZ8bxU5xcuT3iA2fO+jrxn78h006iYgfNmdc5JaVhHnHazMmk32xKhSV4iV0VUh8UWDg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/wasm-tools-linux-x64-gnu@0.0.2': - resolution: {integrity: sha512-YksJWBCyOalB9ogtP9+/dZKP+vR6+h7BmzMXaXMT71WW/GvIsifMVgv+DY/FRSNJQupp5Y+ugjqVAOUOc/G65g==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/wasm-tools-linux-x64-musl@0.0.2': - resolution: {integrity: sha512-sPtRxPMdw05KdTcxgSPMmSXG2+PiK3vJ/l2+g9hvjnnKtvslJN2Hr7j8zgzuoKRAUFPaJVe6+D2xVh5cpdqhww==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/wasm-tools-wasm32-wasi@0.0.2': - resolution: {integrity: sha512-muRvZK7AIuo88G2AxYx3gA59rHMQgoN004saQkBvXnz3K/DVHKfTZ6TtUebss8zI3dURU6xExL8drxFWYxjEbQ==} - engines: {node: '>=14.0.0'} - cpu: [wasm32] - - '@napi-rs/wasm-tools-win32-arm64-msvc@0.0.2': - resolution: {integrity: sha512-Cn13WQ+tpFqdVwx0DIWKbsI9auFyzVZV4F5UNOUeDt6GgOL+NndgJul0Pc9bSU6fi03AylMPfF/nTCaDWO2Wgw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [win32] - - '@napi-rs/wasm-tools-win32-ia32-msvc@0.0.2': - resolution: {integrity: sha512-xsg5DkIQi82a8rcx6246Y3XC8TIqHamY+/C6sIlPLaZEuHctDkMECAw0AANwRf5vN//D2oo2oljOuoYtB1GOKw==} - engines: {node: '>= 10'} - cpu: [ia32] - os: [win32] - - '@napi-rs/wasm-tools-win32-x64-msvc@0.0.2': - resolution: {integrity: sha512-yHigltEt33eq8bappvKsIliz4MxfMPn1M+NWbIFRWN+IS1Z57mhmc1osuk+IRXrSlq0Tom0R6MYN1jpkZKz81Q==} - engines: {node: '>= 10'} - cpu: [x64] - os: [win32] - - '@napi-rs/wasm-tools@0.0.2': - resolution: {integrity: sha512-kBvDQCP5BLw2TxTENXLp3Of7vVEx0uyIye824JHE4dduzzOHVgSoOFVhVqAT3Fx/hLV445RVWfEqQbXMg4w/Mw==} - engines: {node: '>= 10'} - - '@nodelib/fs.scandir@2.1.5': - resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} - engines: {node: '>= 8'} - - '@nodelib/fs.stat@2.0.5': - resolution: {integrity: sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==} - engines: {node: '>= 8'} - - '@nodelib/fs.walk@1.2.8': - resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} - engines: {node: '>= 8'} - - '@octokit/auth-token@4.0.0': - resolution: {integrity: sha512-tY/msAuJo6ARbK6SPIxZrPBms3xPbfwBrulZe0Wtr/DIY9lje2HeV1uoebShn6mx7SjCHif6EjMvoREj+gZ+SA==} - engines: {node: '>= 18'} - - '@octokit/core@5.2.0': - resolution: {integrity: sha512-1LFfa/qnMQvEOAdzlQymH0ulepxbxnCYAKJZfMci/5XJyIHWgEYnDmgnKakbTh7CH2tFQ5O60oYDvns4i9RAIg==} - engines: {node: '>= 18'} - - '@octokit/endpoint@9.0.5': - resolution: {integrity: sha512-ekqR4/+PCLkEBF6qgj8WqJfvDq65RH85OAgrtnVp1mSxaXF03u2xW/hUdweGS5654IlC0wkNYC18Z50tSYTAFw==} - engines: {node: '>= 18'} - - '@octokit/graphql@7.1.0': - resolution: {integrity: sha512-r+oZUH7aMFui1ypZnAvZmn0KSqAUgE1/tUXIWaqUCa1758ts/Jio84GZuzsvUkme98kv0WFY8//n0J1Z+vsIsQ==} - engines: {node: '>= 18'} - - '@octokit/openapi-types@22.2.0': - resolution: {integrity: sha512-QBhVjcUa9W7Wwhm6DBFu6ZZ+1/t/oYxqc2tp81Pi41YNuJinbFRx8B133qVOrAaBbF7D/m0Et6f9/pZt9Rc+tg==} - - '@octokit/plugin-paginate-rest@11.3.1': - resolution: {integrity: sha512-ryqobs26cLtM1kQxqeZui4v8FeznirUsksiA+RYemMPJ7Micju0WSkv50dBksTuZks9O5cg4wp+t8fZ/cLY56g==} - engines: {node: '>= 18'} - peerDependencies: - '@octokit/core': '5' - - '@octokit/plugin-request-log@4.0.1': - resolution: {integrity: sha512-GihNqNpGHorUrO7Qa9JbAl0dbLnqJVrV8OXe2Zm5/Y4wFkZQDfTreBzVmiRfJVfE4mClXdihHnbpyyO9FSX4HA==} - engines: {node: '>= 18'} - peerDependencies: - '@octokit/core': '5' - - '@octokit/plugin-rest-endpoint-methods@13.2.2': - resolution: {integrity: sha512-EI7kXWidkt3Xlok5uN43suK99VWqc8OaIMktY9d9+RNKl69juoTyxmLoWPIZgJYzi41qj/9zU7G/ljnNOJ5AFA==} - engines: {node: '>= 18'} - peerDependencies: - '@octokit/core': ^5 - - '@octokit/request-error@5.1.0': - resolution: {integrity: sha512-GETXfE05J0+7H2STzekpKObFe765O5dlAKUTLNGeH+x47z7JjXHfsHKo5z21D/o/IOZTUEI6nyWyR+bZVP/n5Q==} - engines: {node: '>= 18'} - - '@octokit/request@8.4.0': - resolution: {integrity: sha512-9Bb014e+m2TgBeEJGEbdplMVWwPmL1FPtggHQRkV+WVsMggPtEkLKPlcVYm/o8xKLkpJ7B+6N8WfQMtDLX2Dpw==} - engines: {node: '>= 18'} - - '@octokit/rest@20.1.1': - resolution: {integrity: sha512-MB4AYDsM5jhIHro/dq4ix1iWTLGToIGk6cWF5L6vanFaMble5jTX/UBQyiv05HsWnwUtY8JrfHy2LWfKwihqMw==} - engines: {node: '>= 18'} - - '@octokit/types@13.5.0': - resolution: {integrity: sha512-HdqWTf5Z3qwDVlzCrP8UJquMwunpDiMPt5er+QjGzL4hqr/vBVY/MauQgS1xWxCDT1oMx1EULyqxncdCY/NVSQ==} - - '@rollup/pluginutils@4.2.1': - resolution: {integrity: sha512-iKnFXr7NkdZAIHiIWE+BX5ULi/ucVFYWD6TbAV+rZctiRTY2PL6tsIKhoIOaoskiWAkgu+VsbXgUVDNLHf+InQ==} - engines: {node: '>= 8.0.0'} - - '@sindresorhus/merge-streams@2.3.0': - resolution: {integrity: sha512-LtoMMhxAlorcGhmFYI+LhPgbPZCkgP6ra1YL604EeF6U98pLlQ3iWIGMdWSC+vWmPBWBNgmDBAhnAobLROJmwg==} - engines: {node: '>=18'} - - '@tybys/wasm-util@0.9.0': - resolution: {integrity: sha512-6+7nlbMVX/PVDCwaIQ8nTOPveOcFLSt8GcXdx8hD0bt39uWxYT88uXzqTd4fTvqta7oeUJqudepapKNt2DYJFw==} - - '@types/node@20.14.8': - resolution: {integrity: sha512-DO+2/jZinXfROG7j7WKFn/3C6nFwxy2lLpgLjEXJz+0XKphZlTLJ14mo8Vfg8X5BWN6XjyESXq+LcYdT7tR3bA==} - - '@types/stylis@4.2.6': - resolution: {integrity: sha512-4nebF2ZJGzQk0ka0O6+FZUWceyFv4vWq/0dXBMmrSeAwzOuOd/GxE5Pa64d/ndeNLG73dXoBsRzvtsVsYUv6Uw==} - - '@vercel/nft@0.26.5': - resolution: {integrity: sha512-NHxohEqad6Ra/r4lGknO52uc/GrWILXAMs1BB4401GTqww0fw1bAqzpG1XHuDO+dprg4GvsD9ZLLSsdo78p9hQ==} - engines: {node: '>=16'} - hasBin: true - - abbrev@1.1.1: - resolution: {integrity: sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==} - - acorn-import-attributes@1.9.5: - resolution: {integrity: sha512-n02Vykv5uA3eHGM/Z2dQrcD56kL8TyDb2p1+0P83PClMnC/nc+anbQRhIOWnSq4Ke/KvDPrY3C9hDtC/A3eHnQ==} - peerDependencies: - acorn: ^8 - - acorn-walk@8.3.3: - resolution: {integrity: sha512-MxXdReSRhGO7VlFe1bRG/oI7/mdLV9B9JJT0N8vZOhF7gFRR5l3M8W9G8JxmKV+JC5mGqJ0QvqfSOLsCPa4nUw==} - engines: {node: '>=0.4.0'} - - acorn@8.12.0: - resolution: {integrity: sha512-RTvkC4w+KNXrM39/lWCUaG0IbRkWdCv7W/IOW9oU6SawyxulvkQy5HQPVTKxEjczcUvapcrw3cFx/60VN/NRNw==} - engines: {node: '>=0.4.0'} - hasBin: true - - agent-base@6.0.2: - resolution: {integrity: sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==} - engines: {node: '>= 6.0.0'} - - ansi-escapes@4.3.2: - resolution: {integrity: sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==} - engines: {node: '>=8'} - - ansi-regex@5.0.1: - resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} - engines: {node: '>=8'} - - ansi-regex@6.0.1: - resolution: {integrity: sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==} - engines: {node: '>=12'} - - ansi-styles@4.3.0: - resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} - engines: {node: '>=8'} - - ansi-styles@6.2.1: - resolution: {integrity: sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==} - engines: {node: '>=12'} - - aproba@2.0.0: - resolution: {integrity: sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==} - - are-we-there-yet@2.0.0: - resolution: {integrity: sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw==} - engines: {node: '>=10'} - deprecated: This package is no longer supported. - - argparse@1.0.10: - resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==} - - argparse@2.0.1: - resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} - - array-find-index@1.0.2: - resolution: {integrity: sha512-M1HQyIXcBGtVywBt8WVdim+lrNaK7VHp99Qt5pSNziXznKHViIBbXWtfRTpEFpF/c4FdfxNAsCCwPp5phBYJtw==} - engines: {node: '>=0.10.0'} - - arrgv@1.0.2: - resolution: {integrity: sha512-a4eg4yhp7mmruZDQFqVMlxNRFGi/i1r87pt8SDHy0/I8PqSXoUTlWZRdAZo0VXgvEARcujbtTk8kiZRi1uDGRw==} - engines: {node: '>=8.0.0'} - - arrify@3.0.0: - resolution: {integrity: sha512-tLkvA81vQG/XqE2mjDkGQHoOINtMHtysSnemrmoGe6PydDPMRbVugqyk4A6V/WDWEfm3l+0d8anA9r8cv/5Jaw==} - engines: {node: '>=12'} - - async-sema@3.1.1: - resolution: {integrity: sha512-tLRNUXati5MFePdAk8dw7Qt7DpxPB60ofAgn8WRhW6a2rcimZnYBP9oxHiv0OHy+Wz7kPMG+t4LGdt31+4EmGg==} - - asynckit@0.4.0: - resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} - - ava@6.1.3: - resolution: {integrity: sha512-tkKbpF1pIiC+q09wNU9OfyTDYZa8yuWvU2up3+lFJ3lr1RmnYh2GBpPwzYUEB0wvTPIUysGjcZLNZr7STDviRA==} - engines: {node: ^18.18 || ^20.8 || ^21 || ^22} - hasBin: true - peerDependencies: - '@ava/typescript': '*' - peerDependenciesMeta: - '@ava/typescript': - optional: true - - axios@1.6.2: - resolution: {integrity: sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A==} - - balanced-match@1.0.2: - resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} - - base64-js@1.5.1: - resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==} - - before-after-hook@2.2.3: - resolution: {integrity: sha512-NzUnlZexiaH/46WDhANlyR2bXRopNg4F/zuSA3OpZnllCUgRaOF2znDioDWrmbNVsuZk6l9pMquQB38cfBZwkQ==} - - bindings@1.5.0: - resolution: {integrity: sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==} - - bl@4.1.0: - resolution: {integrity: sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==} - - blueimp-md5@2.19.0: - resolution: {integrity: sha512-DRQrD6gJyy8FbiE4s+bDoXS9hiW3Vbx5uCdwvcCf3zLHL+Iv7LtGHLpr+GZV8rHG8tK766FGYBwRbu8pELTt+w==} - - brace-expansion@1.1.11: - resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} - - braces@3.0.3: - resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==} - engines: {node: '>=8'} - - buffer@5.7.1: - resolution: {integrity: sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==} - - call-bind@1.0.7: - resolution: {integrity: sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==} - engines: {node: '>= 0.4'} - - callsites@4.1.0: - resolution: {integrity: sha512-aBMbD1Xxay75ViYezwT40aQONfr+pSXTHwNKvIXhXD6+LY3F1dLIcceoC5OZKBVHbXcysz1hL9D2w0JJIMXpUw==} - engines: {node: '>=12.20'} - - camelize@1.0.1: - resolution: {integrity: sha512-dU+Tx2fsypxTgtLoE36npi3UqcjSSMNYfkqgmoEhtZrraP5VWq0K7FkWVTYa8eMPtnU/G2txVsfdCJTn9uzpuQ==} - - cbor@9.0.2: - resolution: {integrity: sha512-JPypkxsB10s9QOWwa6zwPzqE1Md3vqpPc+cai4sAecuCsRyAtAl/pMyhPlMbT/xtPnm2dznJZYRLui57qiRhaQ==} - engines: {node: '>=16'} - - chalk@4.1.2: - resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} - engines: {node: '>=10'} - - chalk@5.3.0: - resolution: {integrity: sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==} - engines: {node: ^12.17.0 || ^14.13 || >=16.0.0} - - chardet@0.7.0: - resolution: {integrity: sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==} - - chownr@2.0.0: - resolution: {integrity: sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==} - engines: {node: '>=10'} - - chunkd@2.0.1: - resolution: {integrity: sha512-7d58XsFmOq0j6el67Ug9mHf9ELUXsQXYJBkyxhH/k+6Ke0qXRnv0kbemx+Twc6fRJ07C49lcbdgm9FL1Ei/6SQ==} - - ci-info@4.0.0: - resolution: {integrity: sha512-TdHqgGf9odd8SXNuxtUBVx8Nv+qZOejE6qyqiy5NtbYYQOeFa6zmHkxlPzmaLxWWHsU6nJmB7AETdVPi+2NBUg==} - engines: {node: '>=8'} - - ci-parallel-vars@1.0.1: - resolution: {integrity: sha512-uvzpYrpmidaoxvIQHM+rKSrigjOe9feHYbw4uOI2gdfe1C3xIlxO+kVXq83WQWNniTf8bAxVpy+cQeFQsMERKg==} - - cli-cursor@3.1.0: - resolution: {integrity: sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==} - engines: {node: '>=8'} - - cli-spinners@2.9.2: - resolution: {integrity: sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==} - engines: {node: '>=6'} - - cli-truncate@4.0.0: - resolution: {integrity: sha512-nPdaFdQ0h/GEigbPClz11D0v/ZJEwxmeVZGeMo3Z5StPtUTkA9o1lD6QwoirYiSDzbcwn2XcjwmCp68W1IS4TA==} - engines: {node: '>=18'} - - cli-width@4.1.0: - resolution: {integrity: sha512-ouuZd4/dm2Sw5Gmqy6bGyNNNe1qt9RpmxveLSO7KcgsTnU7RXfsw+/bukWGo1abgBiMAic068rclZsO4IWmmxQ==} - engines: {node: '>= 12'} - - clipanion@3.2.1: - resolution: {integrity: sha512-dYFdjLb7y1ajfxQopN05mylEpK9ZX0sO1/RfMXdfmwjlIsPkbh4p7A682x++zFPLDCo1x3p82dtljHf5cW2LKA==} - peerDependencies: - typanion: '*' - - cliui@8.0.1: - resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==} - engines: {node: '>=12'} - - clone@1.0.4: - resolution: {integrity: sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==} - engines: {node: '>=0.8'} - - code-excerpt@4.0.0: - resolution: {integrity: sha512-xxodCmBen3iy2i0WtAK8FlFNrRzjUqjRsMfho58xT/wvZU1YTM3fCnRjcy1gJPMepaRlgm/0e6w8SpWHpn3/cA==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - color-convert@2.0.1: - resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} - engines: {node: '>=7.0.0'} - - color-name@1.1.4: - resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} - - color-support@1.1.3: - resolution: {integrity: sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==} - hasBin: true - - colorette@2.0.20: - resolution: {integrity: sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==} - - combined-stream@1.0.8: - resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} - engines: {node: '>= 0.8'} - - common-path-prefix@3.0.0: - resolution: {integrity: sha512-QE33hToZseCH3jS0qN96O/bSh3kaw/h+Tq7ngyY9eWDUnTlTNUyqfqvCXioLe5Na5jFsL78ra/wuBU4iuEgd4w==} - - concat-map@0.0.1: - resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} - - concordance@5.0.4: - resolution: {integrity: sha512-OAcsnTEYu1ARJqWVGwf4zh4JDfHZEaSNlNccFmt8YjB2l/n19/PF2viLINHc57vO4FKIAFl2FWASIGZZWZ2Kxw==} - engines: {node: '>=10.18.0 <11 || >=12.14.0 <13 || >=14'} - - console-control-strings@1.1.0: - resolution: {integrity: sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==} - - convert-to-spaces@2.0.1: - resolution: {integrity: sha512-rcQ1bsQO9799wq24uE5AM2tAILy4gXGIK/njFWcVQkGNZ96edlpY+A7bjwvzjYvLDyzmG1MmMLZhpcsb+klNMQ==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - css-color-keywords@1.0.0: - resolution: {integrity: sha512-FyyrDHZKEjXDpNJYvVsV960FiqQyXc/LlYmsxl2BcdMb2WPx0OGRVgTg55rPSyLSNMqP52R9r8geSp7apN3Ofg==} - engines: {node: '>=4'} - - css-to-react-native@3.2.0: - resolution: {integrity: sha512-e8RKaLXMOFii+02mOlqwjbD00KSEKqblnpO9e++1aXS1fPQOpS1YoqdVHBqPjHNoxeF2mimzVqawm2KCbEdtHQ==} - - csstype@3.1.3: - resolution: {integrity: sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==} - - currently-unhandled@0.4.1: - resolution: {integrity: sha512-/fITjgjGU50vjQ4FH6eUoYu+iUoUKIXws2hL15JJpIR+BbTxaXQsMuuyjtNh2WqsSBS5nsaZHFsFecyw5CCAng==} - engines: {node: '>=0.10.0'} - - date-time@3.1.0: - resolution: {integrity: sha512-uqCUKXE5q1PNBXjPqvwhwJf9SwMoAHBgWJ6DcrnS5o+W2JOiIILl0JEdVD8SGujrNS02GGxgwAg2PN2zONgtjg==} - engines: {node: '>=6'} - - debug@4.3.5: - resolution: {integrity: sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg==} - engines: {node: '>=6.0'} - peerDependencies: - supports-color: '*' - peerDependenciesMeta: - supports-color: - optional: true - - defaults@1.0.4: - resolution: {integrity: sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A==} - - define-data-property@1.1.4: - resolution: {integrity: sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==} - engines: {node: '>= 0.4'} - - delayed-stream@1.0.0: - resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} - engines: {node: '>=0.4.0'} - - delegates@1.0.0: - resolution: {integrity: sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==} - - deprecation@2.3.1: - resolution: {integrity: sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==} - - detect-libc@2.0.3: - resolution: {integrity: sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw==} - engines: {node: '>=8'} - - emittery@1.0.3: - resolution: {integrity: sha512-tJdCJitoy2lrC2ldJcqN4vkqJ00lT+tOWNT1hBJjO/3FDMJa5TTIiYGCKGkn/WfCyOzUMObeohbVTj00fhiLiA==} - engines: {node: '>=14.16'} - - emnapi@1.2.0: - resolution: {integrity: sha512-rcq+dJCcfr08I0XM/57LPRqaUokGfni/+SvhO7NaJthTTjRdohhIy0FQwyC5rR1enAsjkldQg83th8J5hURv0Q==} - peerDependencies: - node-addon-api: '>= 6.1.0' - peerDependenciesMeta: - node-addon-api: - optional: true - - emoji-regex@10.3.0: - resolution: {integrity: sha512-QpLs9D9v9kArv4lfDEgg1X/gN5XLnf/A6l9cs8SPZLRZR3ZkY9+kwIQTxm+fsSej5UMYGE8fdoaZVIBlqG0XTw==} - - emoji-regex@8.0.0: - resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} - - es-define-property@1.0.0: - resolution: {integrity: sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==} - engines: {node: '>= 0.4'} - - es-errors@1.3.0: - resolution: {integrity: sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==} - engines: {node: '>= 0.4'} - - escalade@3.1.2: - resolution: {integrity: sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==} - engines: {node: '>=6'} - - escape-string-regexp@2.0.0: - resolution: {integrity: sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==} - engines: {node: '>=8'} - - escape-string-regexp@5.0.0: - resolution: {integrity: sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==} - engines: {node: '>=12'} - - esprima@4.0.1: - resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==} - engines: {node: '>=4'} - hasBin: true - - estree-walker@2.0.2: - resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==} - - esutils@2.0.3: - resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} - engines: {node: '>=0.10.0'} - - external-editor@3.1.0: - resolution: {integrity: sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==} - engines: {node: '>=4'} - - fast-diff@1.3.0: - resolution: {integrity: sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==} - - fast-glob@3.3.2: - resolution: {integrity: sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==} - engines: {node: '>=8.6.0'} - - fastq@1.17.1: - resolution: {integrity: sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==} - - figures@6.1.0: - resolution: {integrity: sha512-d+l3qxjSesT4V7v2fh+QnmFnUWv9lSpjarhShNTgBOfA0ttejbQUAlHLitbjkoRiDulW0OPoQPYIGhIC8ohejg==} - engines: {node: '>=18'} - - file-uri-to-path@1.0.0: - resolution: {integrity: sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==} - - fill-range@7.1.1: - resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==} - engines: {node: '>=8'} - - find-up-simple@1.0.0: - resolution: {integrity: sha512-q7Us7kcjj2VMePAa02hDAF6d+MzsdsAWEwYyOpwUtlerRBkOEPBCRZrAV4XfcSN8fHAgaD0hP7miwoay6DCprw==} - engines: {node: '>=18'} - - follow-redirects@1.15.6: - resolution: {integrity: sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==} - engines: {node: '>=4.0'} - peerDependencies: - debug: '*' - peerDependenciesMeta: - debug: - optional: true - - form-data@4.0.0: - resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==} - engines: {node: '>= 6'} - - fs-minipass@2.1.0: - resolution: {integrity: sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==} - engines: {node: '>= 8'} - - fs.realpath@1.0.0: - resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} - - function-bind@1.1.2: - resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==} - - gauge@3.0.2: - resolution: {integrity: sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q==} - engines: {node: '>=10'} - deprecated: This package is no longer supported. - - get-caller-file@2.0.5: - resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} - engines: {node: 6.* || 8.* || >= 10.*} - - get-east-asian-width@1.2.0: - resolution: {integrity: sha512-2nk+7SIVb14QrgXFHcm84tD4bKQz0RxPuMT8Ag5KPOq7J5fEmAg0UbXdTOSHqNuHSU28k55qnceesxXRZGzKWA==} - engines: {node: '>=18'} - - get-intrinsic@1.2.4: - resolution: {integrity: sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==} - engines: {node: '>= 0.4'} - - glob-parent@5.1.2: - resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} - engines: {node: '>= 6'} - - glob@7.2.3: - resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} - deprecated: Glob versions prior to v9 are no longer supported - - globby@14.0.1: - resolution: {integrity: sha512-jOMLD2Z7MAhyG8aJpNOpmziMOP4rPLcc95oQPKXBazW82z+CEgPFBQvEpRUa1KeIMUJo4Wsm+q6uzO/Q/4BksQ==} - engines: {node: '>=18'} - - gopd@1.0.1: - resolution: {integrity: sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==} - - graceful-fs@4.2.11: - resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} - - has-flag@4.0.0: - resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} - engines: {node: '>=8'} - - has-property-descriptors@1.0.2: - resolution: {integrity: sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==} - - has-proto@1.0.3: - resolution: {integrity: sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==} - engines: {node: '>= 0.4'} - - has-symbols@1.0.3: - resolution: {integrity: sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==} - engines: {node: '>= 0.4'} - - has-unicode@2.0.1: - resolution: {integrity: sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==} - - hasown@2.0.2: - resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==} - engines: {node: '>= 0.4'} - - https-proxy-agent@5.0.1: - resolution: {integrity: sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==} - engines: {node: '>= 6'} - - iconv-lite@0.4.24: - resolution: {integrity: sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==} - engines: {node: '>=0.10.0'} - - ieee754@1.2.1: - resolution: {integrity: sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==} - - ignore-by-default@2.1.0: - resolution: {integrity: sha512-yiWd4GVmJp0Q6ghmM2B/V3oZGRmjrKLXvHR3TE1nfoXsmoggllfZUQe74EN0fJdPFZu2NIvNdrMMLm3OsV7Ohw==} - engines: {node: '>=10 <11 || >=12 <13 || >=14'} - - ignore@5.3.1: - resolution: {integrity: sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==} - engines: {node: '>= 4'} - - imurmurhash@0.1.4: - resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} - engines: {node: '>=0.8.19'} - - indent-string@5.0.0: - resolution: {integrity: sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==} - engines: {node: '>=12'} - - inflight@1.0.6: - resolution: {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. - - inherits@2.0.4: - resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} - - inquirer@9.2.23: - resolution: {integrity: sha512-kod5s+FBPIDM2xiy9fu+6wdU/SkK5le5GS9lh4FEBjBHqiMgD9lLFbCbuqFNAjNL2ZOy9Wd9F694IOzN9pZHBA==} - engines: {node: '>=18'} - - irregular-plurals@3.5.0: - resolution: {integrity: sha512-1ANGLZ+Nkv1ptFb2pa8oG8Lem4krflKuX/gINiHJHjJUKaJHk/SXk5x6K3J+39/p0h1RQ2saROclJJ+QLvETCQ==} - engines: {node: '>=8'} - - is-extglob@2.1.1: - resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} - engines: {node: '>=0.10.0'} - - is-fullwidth-code-point@3.0.0: - resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} - engines: {node: '>=8'} - - is-fullwidth-code-point@4.0.0: - resolution: {integrity: sha512-O4L094N2/dZ7xqVdrXhh9r1KODPJpFms8B5sGdJLPy664AgvXsreZUyCQQNItZRDlYug4xStLjNp/sz3HvBowQ==} - engines: {node: '>=12'} - - is-glob@4.0.3: - resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} - engines: {node: '>=0.10.0'} - - is-interactive@1.0.0: - resolution: {integrity: sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w==} - engines: {node: '>=8'} - - is-number@7.0.0: - resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} - engines: {node: '>=0.12.0'} - - is-plain-object@5.0.0: - resolution: {integrity: sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==} - engines: {node: '>=0.10.0'} - - is-promise@4.0.0: - resolution: {integrity: sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==} - - is-unicode-supported@0.1.0: - resolution: {integrity: sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==} - engines: {node: '>=10'} - - is-unicode-supported@2.0.0: - resolution: {integrity: sha512-FRdAyx5lusK1iHG0TWpVtk9+1i+GjrzRffhDg4ovQ7mcidMQ6mj+MhKPmvh7Xwyv5gIS06ns49CA7Sqg7lC22Q==} - engines: {node: '>=18'} - - js-string-escape@1.0.1: - resolution: {integrity: sha512-Smw4xcfIQ5LVjAOuJCvN/zIodzA/BBSsluuoSykP+lUvScIi4U6RJLfwHet5cxFnCswUjISV8oAXaqaJDY3chg==} - engines: {node: '>= 0.8'} - - js-tokens@4.0.0: - resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} - - js-yaml@3.14.1: - resolution: {integrity: sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==} - hasBin: true - - js-yaml@4.1.0: - resolution: {integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==} - hasBin: true - - load-json-file@7.0.1: - resolution: {integrity: sha512-Gnxj3ev3mB5TkVBGad0JM6dmLiQL+o0t23JPBZ9sd+yvSLk05mFoqKBw5N8gbbkU4TNXyqCgIrl/VM17OgUIgQ==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - lodash-es@4.17.21: - resolution: {integrity: sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==} - - lodash@4.17.21: - resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} - - log-symbols@4.1.0: - resolution: {integrity: sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==} - engines: {node: '>=10'} - - loose-envify@1.4.0: - resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==} - hasBin: true - - make-dir@3.1.0: - resolution: {integrity: sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==} - engines: {node: '>=8'} - - matcher@5.0.0: - resolution: {integrity: sha512-s2EMBOWtXFc8dgqvoAzKJXxNHibcdJMV0gwqKUaw9E2JBJuGUK7DrNKrA6g/i+v72TT16+6sVm5mS3thaMLQUw==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - md5-hex@3.0.1: - resolution: {integrity: sha512-BUiRtTtV39LIJwinWBjqVsU9xhdnz7/i889V859IBFpuqGAj6LuOvHv5XLbgZ2R7ptJoJaEcxkv88/h25T7Ciw==} - engines: {node: '>=8'} - - memoize@10.0.0: - resolution: {integrity: sha512-H6cBLgsi6vMWOcCpvVCdFFnl3kerEXbrYh9q+lY6VXvQSmM6CkmV08VOwT+WE2tzIEqRPFfAq3fm4v/UIW6mSA==} - engines: {node: '>=18'} - - merge2@1.4.1: - resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} - engines: {node: '>= 8'} - - micromatch@4.0.7: - resolution: {integrity: sha512-LPP/3KorzCwBxfeUuZmaR6bG2kdeHSbe0P2tY3FLRU4vYrjYz5hI4QZwV0njUx3jeuKe67YukQ1LSPZBKDqO/Q==} - engines: {node: '>=8.6'} - - mime-db@1.52.0: - resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} - engines: {node: '>= 0.6'} - - mime-types@2.1.35: - resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} - engines: {node: '>= 0.6'} - - mimic-fn@2.1.0: - resolution: {integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==} - engines: {node: '>=6'} - - mimic-function@5.0.1: - resolution: {integrity: sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==} - engines: {node: '>=18'} - - minimatch@3.1.2: - resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} - - minipass@3.3.6: - resolution: {integrity: sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==} - engines: {node: '>=8'} - - minipass@5.0.0: - resolution: {integrity: sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==} - engines: {node: '>=8'} - - minizlib@2.1.2: - resolution: {integrity: sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==} - engines: {node: '>= 8'} - - mkdirp@1.0.4: - resolution: {integrity: sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==} - engines: {node: '>=10'} - hasBin: true - - ms@2.1.2: - resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} - - ms@2.1.3: - resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} - - mute-stream@1.0.0: - resolution: {integrity: sha512-avsJQhyd+680gKXyG/sQc0nXaC6rBkPOfyHYcFb9+hdkqQkR9bdnkJ0AMZhke0oesPqIO+mFFJ+IdBc7mst4IA==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - - nanoid@3.3.7: - resolution: {integrity: sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==} - engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} - hasBin: true - - node-fetch@2.7.0: - resolution: {integrity: sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==} - engines: {node: 4.x || >=6.0.0} - peerDependencies: - encoding: ^0.1.0 - peerDependenciesMeta: - encoding: - optional: true - - node-gyp-build@4.8.1: - resolution: {integrity: sha512-OSs33Z9yWr148JZcbZd5WiAXhh/n9z8TxQcdMhIOlpN9AhWpLfvVFO73+m77bBABQMaY9XSvIa+qk0jlI7Gcaw==} - hasBin: true - - nofilter@3.1.0: - resolution: {integrity: sha512-l2NNj07e9afPnhAhvgVrCD/oy2Ai1yfLpuo3EpiO1jFTsB4sFz6oIfAfSZyQzVpkZQ9xS8ZS5g1jCBgq4Hwo0g==} - engines: {node: '>=12.19'} - - nopt@5.0.0: - resolution: {integrity: sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==} - engines: {node: '>=6'} - hasBin: true - - npmlog@5.0.1: - resolution: {integrity: sha512-AqZtDUWOMKs1G/8lwylVjrdYgqA4d9nu8hc+0gzRxlDb1I10+FHBGMXs6aiQHFdCUUlqH99MUMuLfzWDNDtfxw==} - deprecated: This package is no longer supported. - - object-assign@4.1.1: - resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} - engines: {node: '>=0.10.0'} - - once@1.4.0: - resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} - - onetime@5.1.2: - resolution: {integrity: sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==} - engines: {node: '>=6'} - - ora@5.4.1: - resolution: {integrity: sha512-5b6Y85tPxZZ7QytO+BQzysW31HJku27cRIlkbAXaNx+BdcVi+LlRFmVXzeF6a7JCwJpyw5c4b+YSVImQIrBpuQ==} - engines: {node: '>=10'} - - os-tmpdir@1.0.2: - resolution: {integrity: sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==} - engines: {node: '>=0.10.0'} - - p-map@7.0.2: - resolution: {integrity: sha512-z4cYYMMdKHzw4O5UkWJImbZynVIo0lSGTXc7bzB1e/rrDqkgGUNysK/o4bTr+0+xKvvLoTyGqYC4Fgljy9qe1Q==} - engines: {node: '>=18'} - - package-config@5.0.0: - resolution: {integrity: sha512-GYTTew2slBcYdvRHqjhwaaydVMvn/qrGC323+nKclYioNSLTDUM/lGgtGTgyHVtYcozb+XkE8CNhwcraOmZ9Mg==} - engines: {node: '>=18'} - - parse-ms@4.0.0: - resolution: {integrity: sha512-TXfryirbmq34y8QBwgqCVLi+8oA3oWx2eAnSn62ITyEhEYaWRlVZ2DvMM9eZbMs/RfxPu/PK/aBLyGj4IrqMHw==} - engines: {node: '>=18'} - - path-is-absolute@1.0.1: - resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==} - engines: {node: '>=0.10.0'} - - path-type@5.0.0: - resolution: {integrity: sha512-5HviZNaZcfqP95rwpv+1HDgUamezbqdSYTyzjTvwtJSnIH+3vnbmWsItli8OFEndS984VT55M3jduxZbX351gg==} - engines: {node: '>=12'} - - picocolors@1.0.1: - resolution: {integrity: sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==} - - picomatch@2.3.1: - resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} - engines: {node: '>=8.6'} - - picomatch@3.0.1: - resolution: {integrity: sha512-I3EurrIQMlRc9IaAZnqRR044Phh2DXY+55o7uJ0V+hYZAcQYSuFWsc9q5PvyDHUSCe1Qxn/iBz+78s86zWnGag==} - engines: {node: '>=10'} - - plur@5.1.0: - resolution: {integrity: sha512-VP/72JeXqak2KiOzjgKtQen5y3IZHn+9GOuLDafPv0eXa47xq0At93XahYBs26MsifCQ4enGKwbjBTKgb9QJXg==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - postcss-value-parser@4.2.0: - resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==} - - postcss@8.4.33: - resolution: {integrity: sha512-Kkpbhhdjw2qQs2O2DGX+8m5OVqEcbB9HRBvuYM9pgrjEFUg30A9LmXNlTAUj4S9kgtGyrMbTzVjH7E+s5Re2yg==} - engines: {node: ^10 || ^12 || >=14} - - pretty-ms@9.0.0: - resolution: {integrity: sha512-E9e9HJ9R9NasGOgPaPE8VMeiPKAyWR5jcFpNnwIejslIhWqdqOrb2wShBsncMPUb+BcCd2OPYfh7p2W6oemTng==} - engines: {node: '>=18'} - - proxy-from-env@1.1.0: - resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==} - - queue-microtask@1.2.3: - resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} - - react-dom@18.3.1: - resolution: {integrity: sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==} - peerDependencies: - react: ^18.3.1 - - react@18.3.1: - resolution: {integrity: sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==} - engines: {node: '>=0.10.0'} - - readable-stream@3.6.2: - resolution: {integrity: sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==} - engines: {node: '>= 6'} - - require-directory@2.1.1: - resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} - engines: {node: '>=0.10.0'} - - resolve-cwd@3.0.0: - resolution: {integrity: sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==} - engines: {node: '>=8'} - - resolve-from@5.0.0: - resolution: {integrity: sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==} - engines: {node: '>=8'} - - restore-cursor@3.1.0: - resolution: {integrity: sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==} - engines: {node: '>=8'} - - reusify@1.0.4: - resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==} - engines: {iojs: '>=1.0.0', node: '>=0.10.0'} - - rimraf@3.0.2: - resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==} - deprecated: Rimraf versions prior to v4 are no longer supported - hasBin: true - - run-async@3.0.0: - resolution: {integrity: sha512-540WwVDOMxA6dN6We19EcT9sc3hkXPw5mzRNGM3FkdN/vtE9NFvj5lFAPNwUDmJjXidm3v7TC1cTE7t17Ulm1Q==} - engines: {node: '>=0.12.0'} - - run-parallel@1.2.0: - resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} - - rxjs@7.8.1: - resolution: {integrity: sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==} - - safe-buffer@5.2.1: - resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} - - safer-buffer@2.1.2: - resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} - - scheduler@0.23.2: - resolution: {integrity: sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ==} - - semver@6.3.1: - resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} - hasBin: true - - semver@7.6.2: - resolution: {integrity: sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==} - engines: {node: '>=10'} - hasBin: true - - serialize-error@7.0.1: - resolution: {integrity: sha512-8I8TjW5KMOKsZQTvoxjuSIa7foAwPWGOts+6o7sgjz41/qMD9VQHEDxi6PBvK2l0MXUmqZyNpUK+T2tQaaElvw==} - engines: {node: '>=10'} - - set-blocking@2.0.0: - resolution: {integrity: sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==} - - set-function-length@1.2.2: - resolution: {integrity: sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==} - engines: {node: '>= 0.4'} - - shallowequal@1.1.0: - resolution: {integrity: sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ==} - - signal-exit@3.0.7: - resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} - - signal-exit@4.1.0: - resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} - engines: {node: '>=14'} - - slash@5.1.0: - resolution: {integrity: sha512-ZA6oR3T/pEyuqwMgAKT0/hAv8oAXckzbkmR0UkUosQ+Mc4RxGoJkRmwHgHufaenlyAgE1Mxgpdcrf75y6XcnDg==} - engines: {node: '>=14.16'} - - slice-ansi@5.0.0: - resolution: {integrity: sha512-FC+lgizVPfie0kkhqUScwRu1O/lF6NOgJmlCgK+/LYxDCTk8sGelYaHDhFcDN+Sn3Cv+3VSa4Byeo+IMCzpMgQ==} - engines: {node: '>=12'} - - source-map-js@1.2.0: - resolution: {integrity: sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==} - engines: {node: '>=0.10.0'} - - sprintf-js@1.0.3: - resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==} - - stack-utils@2.0.6: - resolution: {integrity: sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==} - engines: {node: '>=10'} - - string-width@4.2.3: - resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} - engines: {node: '>=8'} - - string-width@7.1.0: - resolution: {integrity: sha512-SEIJCWiX7Kg4c129n48aDRwLbFb2LJmXXFrWBG4NGaRtMQ3myKPKbwrD1BKqQn74oCoNMBVrfDEr5M9YxCsrkw==} - engines: {node: '>=18'} - - string_decoder@1.3.0: - resolution: {integrity: sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==} - - strip-ansi@6.0.1: - resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} - engines: {node: '>=8'} - - strip-ansi@7.1.0: - resolution: {integrity: sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==} - engines: {node: '>=12'} - - styled-components@6.1.1: - resolution: {integrity: sha512-cpZZP5RrKRIClBW5Eby4JM1wElLVP4NQrJbJ0h10TidTyJf4SIIwa3zLXOoPb4gJi8MsJ8mjq5mu2IrEhZIAcQ==} - engines: {node: '>= 16'} - peerDependencies: - react: '>= 16.8.0' - react-dom: '>= 16.8.0' - - stylis@4.3.2: - resolution: {integrity: sha512-bhtUjWd/z6ltJiQwg0dUfxEJ+W+jdqQd8TbWLWyeIJHlnsqmGLRFFd8e5mA0AZi/zx90smXRlN66YMTcaSFifg==} - - supertap@3.0.1: - resolution: {integrity: sha512-u1ZpIBCawJnO+0QePsEiOknOfCRq0yERxiAchT0i4li0WHNUJbf0evXXSXOcCAR4M8iMDoajXYmstm/qO81Isw==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - supports-color@7.2.0: - resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} - engines: {node: '>=8'} - - tar@6.2.1: - resolution: {integrity: sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==} - engines: {node: '>=10'} - - temp-dir@3.0.0: - resolution: {integrity: sha512-nHc6S/bwIilKHNRgK/3jlhDoIHcp45YgyiwcAk46Tr0LfEqGBVpmiAyuiuxeVE44m3mXnEeVhaipLOEWmH+Njw==} - engines: {node: '>=14.16'} - - time-zone@1.0.0: - resolution: {integrity: sha512-TIsDdtKo6+XrPtiTm1ssmMngN1sAhyKnTO2kunQWqNPWIVvCm15Wmw4SWInwTVgJ5u/Tr04+8Ei9TNcw4x4ONA==} - engines: {node: '>=4'} - - tmp@0.0.33: - resolution: {integrity: sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==} - engines: {node: '>=0.6.0'} - - to-regex-range@5.0.1: - resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} - engines: {node: '>=8.0'} - - toml@3.0.0: - resolution: {integrity: sha512-y/mWCZinnvxjTKYhJ+pYxwD0mRLVvOtdS2Awbgxln6iEnt4rk0yBxeSBHkGJcPucRiG0e55mwWp+g/05rsrd6w==} - - tr46@0.0.3: - resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==} - - tslib@2.6.3: - resolution: {integrity: sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ==} - - typanion@3.14.0: - resolution: {integrity: sha512-ZW/lVMRabETuYCd9O9ZvMhAh8GslSqaUjxmK/JLPCh6l73CvLBiuXswj/+7LdnWOgYsQ130FqLzFz5aGT4I3Ug==} - - type-fest@0.13.1: - resolution: {integrity: sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==} - engines: {node: '>=10'} - - type-fest@0.21.3: - resolution: {integrity: sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==} - engines: {node: '>=10'} - - typescript@5.5.2: - resolution: {integrity: sha512-NcRtPEOsPFFWjobJEtfihkLCZCXZt/os3zf8nTxjVH3RvTSxjrCamJpbExGvYOF+tFHc3pA65qpdwPbzjohhew==} - engines: {node: '>=14.17'} - hasBin: true - - undici-types@5.26.5: - resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==} - - unicorn-magic@0.1.0: - resolution: {integrity: sha512-lRfVq8fE8gz6QMBuDM6a+LO3IAzTi05H6gCVaUpir2E1Rwpo4ZUog45KpNXKC/Mn3Yb9UDuHumeFTo9iV/D9FQ==} - engines: {node: '>=18'} - - universal-user-agent@6.0.1: - resolution: {integrity: sha512-yCzhz6FN2wU1NiiQRogkTQszlQSlpWaw8SvVegAc+bDxbzHgh1vX8uIe8OYyMH6DwH+sdTJsgMl36+mSMdRJIQ==} - - util-deprecate@1.0.2: - resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} - - wasm-sjlj@1.0.5: - resolution: {integrity: sha512-Z/MHJeOkAvJJVWnGX3/YZGYldGaawZbYHX4ldYG9kLhcdB8H31F5x66M7Zc4BP/7pg0aLsusQj1629m2B3Rilg==} - - wcwidth@1.0.1: - resolution: {integrity: sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==} - - webidl-conversions@3.0.1: - resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==} - - well-known-symbols@2.0.0: - resolution: {integrity: sha512-ZMjC3ho+KXo0BfJb7JgtQ5IBuvnShdlACNkKkdsqBmYw3bPAaJfPeYUo6tLUaT5tG/Gkh7xkpBhKRQ9e7pyg9Q==} - engines: {node: '>=6'} - - whatwg-url@5.0.0: - resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==} - - wide-align@1.1.5: - resolution: {integrity: sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==} - - wrap-ansi@6.2.0: - resolution: {integrity: sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==} - engines: {node: '>=8'} - - wrap-ansi@7.0.0: - resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==} - engines: {node: '>=10'} - - wrappy@1.0.2: - resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} - - write-file-atomic@5.0.1: - resolution: {integrity: sha512-+QU2zd6OTD8XWIJCbffaiQeH9U73qIqafo1x6V1snCWYGJf6cVE0cDR4D8xRzcEnfI21IFrUPzPGtcPf8AC+Rw==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - - y18n@5.0.8: - resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==} - engines: {node: '>=10'} - - yallist@4.0.0: - resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==} - - yargs-parser@21.1.1: - resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} - engines: {node: '>=12'} - - yargs@17.7.2: - resolution: {integrity: sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==} - engines: {node: '>=12'} - -snapshots: - - '@emnapi/core@1.2.0': - dependencies: - '@emnapi/wasi-threads': 1.0.1 - tslib: 2.6.3 - - '@emnapi/runtime@1.2.0': - dependencies: - tslib: 2.6.3 - - '@emnapi/wasi-threads@1.0.1': - dependencies: - tslib: 2.6.3 - - '@emotion/is-prop-valid@1.2.2': - dependencies: - '@emotion/memoize': 0.8.1 - - '@emotion/memoize@0.8.1': {} - - '@emotion/unitless@0.8.1': {} - - '@inquirer/figures@1.0.3': {} - - '@ljharb/through@2.3.13': - dependencies: - call-bind: 1.0.7 - - '@mapbox/node-pre-gyp@1.0.11': - dependencies: - detect-libc: 2.0.3 - https-proxy-agent: 5.0.1 - make-dir: 3.1.0 - node-fetch: 2.7.0 - nopt: 5.0.0 - npmlog: 5.0.1 - rimraf: 3.0.2 - semver: 7.6.2 - tar: 6.2.1 - transitivePeerDependencies: - - encoding - - supports-color - - '@napi-rs/cli@3.0.0-alpha.55(@emnapi/runtime@1.2.0)(emnapi@1.2.0)': - dependencies: - '@napi-rs/cross-toolchain': 0.0.16 - '@napi-rs/wasm-tools': 0.0.2 - '@octokit/rest': 20.1.1 - clipanion: 3.2.1(typanion@3.14.0) - colorette: 2.0.20 - debug: 4.3.5 - inquirer: 9.2.23 - js-yaml: 4.1.0 - lodash-es: 4.17.21 - semver: 7.6.2 - toml: 3.0.0 - typanion: 3.14.0 - wasm-sjlj: 1.0.5 - optionalDependencies: - '@emnapi/runtime': 1.2.0 - emnapi: 1.2.0 - transitivePeerDependencies: - - '@napi-rs/cross-toolchain-arm64-target-aarch64' - - '@napi-rs/cross-toolchain-arm64-target-armv7' - - '@napi-rs/cross-toolchain-arm64-target-x86_64' - - '@napi-rs/cross-toolchain-x64-target-aarch64' - - '@napi-rs/cross-toolchain-x64-target-armv7' - - '@napi-rs/cross-toolchain-x64-target-x86_64' - - supports-color - - '@napi-rs/cross-toolchain@0.0.16': - dependencies: - '@napi-rs/lzma': 1.3.1 - '@napi-rs/tar': 0.1.1 - debug: 4.3.5 - transitivePeerDependencies: - - supports-color - - '@napi-rs/lzma-android-arm-eabi@1.3.1': - optional: true - - '@napi-rs/lzma-android-arm64@1.3.1': - optional: true - - '@napi-rs/lzma-darwin-arm64@1.3.1': - optional: true - - '@napi-rs/lzma-darwin-x64@1.3.1': - optional: true - - '@napi-rs/lzma-freebsd-x64@1.3.1': - optional: true - - '@napi-rs/lzma-linux-arm-gnueabihf@1.3.1': - optional: true - - '@napi-rs/lzma-linux-arm64-gnu@1.3.1': - optional: true - - '@napi-rs/lzma-linux-arm64-musl@1.3.1': - optional: true - - '@napi-rs/lzma-linux-x64-gnu@1.3.1': - optional: true - - '@napi-rs/lzma-linux-x64-musl@1.3.1': - optional: true - - '@napi-rs/lzma-wasm32-wasi@1.3.1': - dependencies: - '@napi-rs/wasm-runtime': 0.2.4 - optional: true - - '@napi-rs/lzma-win32-arm64-msvc@1.3.1': - optional: true - - '@napi-rs/lzma-win32-ia32-msvc@1.3.1': - optional: true - - '@napi-rs/lzma-win32-x64-msvc@1.3.1': - optional: true - - '@napi-rs/lzma@1.3.1': - optionalDependencies: - '@napi-rs/lzma-android-arm-eabi': 1.3.1 - '@napi-rs/lzma-android-arm64': 1.3.1 - '@napi-rs/lzma-darwin-arm64': 1.3.1 - '@napi-rs/lzma-darwin-x64': 1.3.1 - '@napi-rs/lzma-freebsd-x64': 1.3.1 - '@napi-rs/lzma-linux-arm-gnueabihf': 1.3.1 - '@napi-rs/lzma-linux-arm64-gnu': 1.3.1 - '@napi-rs/lzma-linux-arm64-musl': 1.3.1 - '@napi-rs/lzma-linux-x64-gnu': 1.3.1 - '@napi-rs/lzma-linux-x64-musl': 1.3.1 - '@napi-rs/lzma-wasm32-wasi': 1.3.1 - '@napi-rs/lzma-win32-arm64-msvc': 1.3.1 - '@napi-rs/lzma-win32-ia32-msvc': 1.3.1 - '@napi-rs/lzma-win32-x64-msvc': 1.3.1 - - '@napi-rs/tar-android-arm-eabi@0.1.1': - optional: true - - '@napi-rs/tar-android-arm64@0.1.1': - optional: true - - '@napi-rs/tar-darwin-arm64@0.1.1': - optional: true - - '@napi-rs/tar-darwin-x64@0.1.1': - optional: true - - '@napi-rs/tar-freebsd-x64@0.1.1': - optional: true - - '@napi-rs/tar-linux-arm-gnueabihf@0.1.1': - optional: true - - '@napi-rs/tar-linux-arm64-gnu@0.1.1': - optional: true - - '@napi-rs/tar-linux-arm64-musl@0.1.1': - optional: true - - '@napi-rs/tar-linux-x64-gnu@0.1.1': - optional: true - - '@napi-rs/tar-linux-x64-musl@0.1.1': - optional: true - - '@napi-rs/tar-wasm32-wasi@0.1.1': - dependencies: - '@napi-rs/wasm-runtime': 0.2.4 - optional: true - - '@napi-rs/tar-win32-arm64-msvc@0.1.1': - optional: true - - '@napi-rs/tar-win32-ia32-msvc@0.1.1': - optional: true - - '@napi-rs/tar-win32-x64-msvc@0.1.1': - optional: true - - '@napi-rs/tar@0.1.1': - optionalDependencies: - '@napi-rs/tar-android-arm-eabi': 0.1.1 - '@napi-rs/tar-android-arm64': 0.1.1 - '@napi-rs/tar-darwin-arm64': 0.1.1 - '@napi-rs/tar-darwin-x64': 0.1.1 - '@napi-rs/tar-freebsd-x64': 0.1.1 - '@napi-rs/tar-linux-arm-gnueabihf': 0.1.1 - '@napi-rs/tar-linux-arm64-gnu': 0.1.1 - '@napi-rs/tar-linux-arm64-musl': 0.1.1 - '@napi-rs/tar-linux-x64-gnu': 0.1.1 - '@napi-rs/tar-linux-x64-musl': 0.1.1 - '@napi-rs/tar-wasm32-wasi': 0.1.1 - '@napi-rs/tar-win32-arm64-msvc': 0.1.1 - '@napi-rs/tar-win32-ia32-msvc': 0.1.1 - '@napi-rs/tar-win32-x64-msvc': 0.1.1 - - '@napi-rs/wasm-runtime@0.2.4': - dependencies: - '@emnapi/core': 1.2.0 - '@emnapi/runtime': 1.2.0 - '@tybys/wasm-util': 0.9.0 - - '@napi-rs/wasm-tools-android-arm-eabi@0.0.2': - optional: true - - '@napi-rs/wasm-tools-android-arm64@0.0.2': - optional: true - - '@napi-rs/wasm-tools-darwin-arm64@0.0.2': - optional: true - - '@napi-rs/wasm-tools-darwin-x64@0.0.2': - optional: true - - '@napi-rs/wasm-tools-freebsd-x64@0.0.2': - optional: true - - '@napi-rs/wasm-tools-linux-arm64-gnu@0.0.2': - optional: true - - '@napi-rs/wasm-tools-linux-arm64-musl@0.0.2': - optional: true - - '@napi-rs/wasm-tools-linux-x64-gnu@0.0.2': - optional: true - - '@napi-rs/wasm-tools-linux-x64-musl@0.0.2': - optional: true - - '@napi-rs/wasm-tools-wasm32-wasi@0.0.2': - dependencies: - '@napi-rs/wasm-runtime': 0.2.4 - optional: true - - '@napi-rs/wasm-tools-win32-arm64-msvc@0.0.2': - optional: true - - '@napi-rs/wasm-tools-win32-ia32-msvc@0.0.2': - optional: true - - '@napi-rs/wasm-tools-win32-x64-msvc@0.0.2': - optional: true - - '@napi-rs/wasm-tools@0.0.2': - optionalDependencies: - '@napi-rs/wasm-tools-android-arm-eabi': 0.0.2 - '@napi-rs/wasm-tools-android-arm64': 0.0.2 - '@napi-rs/wasm-tools-darwin-arm64': 0.0.2 - '@napi-rs/wasm-tools-darwin-x64': 0.0.2 - '@napi-rs/wasm-tools-freebsd-x64': 0.0.2 - '@napi-rs/wasm-tools-linux-arm64-gnu': 0.0.2 - '@napi-rs/wasm-tools-linux-arm64-musl': 0.0.2 - '@napi-rs/wasm-tools-linux-x64-gnu': 0.0.2 - '@napi-rs/wasm-tools-linux-x64-musl': 0.0.2 - '@napi-rs/wasm-tools-wasm32-wasi': 0.0.2 - '@napi-rs/wasm-tools-win32-arm64-msvc': 0.0.2 - '@napi-rs/wasm-tools-win32-ia32-msvc': 0.0.2 - '@napi-rs/wasm-tools-win32-x64-msvc': 0.0.2 - - '@nodelib/fs.scandir@2.1.5': - dependencies: - '@nodelib/fs.stat': 2.0.5 - run-parallel: 1.2.0 - - '@nodelib/fs.stat@2.0.5': {} - - '@nodelib/fs.walk@1.2.8': - dependencies: - '@nodelib/fs.scandir': 2.1.5 - fastq: 1.17.1 - - '@octokit/auth-token@4.0.0': {} - - '@octokit/core@5.2.0': - dependencies: - '@octokit/auth-token': 4.0.0 - '@octokit/graphql': 7.1.0 - '@octokit/request': 8.4.0 - '@octokit/request-error': 5.1.0 - '@octokit/types': 13.5.0 - before-after-hook: 2.2.3 - universal-user-agent: 6.0.1 - - '@octokit/endpoint@9.0.5': - dependencies: - '@octokit/types': 13.5.0 - universal-user-agent: 6.0.1 - - '@octokit/graphql@7.1.0': - dependencies: - '@octokit/request': 8.4.0 - '@octokit/types': 13.5.0 - universal-user-agent: 6.0.1 - - '@octokit/openapi-types@22.2.0': {} - - '@octokit/plugin-paginate-rest@11.3.1(@octokit/core@5.2.0)': - dependencies: - '@octokit/core': 5.2.0 - '@octokit/types': 13.5.0 - - '@octokit/plugin-request-log@4.0.1(@octokit/core@5.2.0)': - dependencies: - '@octokit/core': 5.2.0 - - '@octokit/plugin-rest-endpoint-methods@13.2.2(@octokit/core@5.2.0)': - dependencies: - '@octokit/core': 5.2.0 - '@octokit/types': 13.5.0 - - '@octokit/request-error@5.1.0': - dependencies: - '@octokit/types': 13.5.0 - deprecation: 2.3.1 - once: 1.4.0 - - '@octokit/request@8.4.0': - dependencies: - '@octokit/endpoint': 9.0.5 - '@octokit/request-error': 5.1.0 - '@octokit/types': 13.5.0 - universal-user-agent: 6.0.1 - - '@octokit/rest@20.1.1': - dependencies: - '@octokit/core': 5.2.0 - '@octokit/plugin-paginate-rest': 11.3.1(@octokit/core@5.2.0) - '@octokit/plugin-request-log': 4.0.1(@octokit/core@5.2.0) - '@octokit/plugin-rest-endpoint-methods': 13.2.2(@octokit/core@5.2.0) - - '@octokit/types@13.5.0': - dependencies: - '@octokit/openapi-types': 22.2.0 - - '@rollup/pluginutils@4.2.1': - dependencies: - estree-walker: 2.0.2 - picomatch: 2.3.1 - - '@sindresorhus/merge-streams@2.3.0': {} - - '@tybys/wasm-util@0.9.0': - dependencies: - tslib: 2.6.3 - - '@types/node@20.14.8': - dependencies: - undici-types: 5.26.5 - - '@types/stylis@4.2.6': {} - - '@vercel/nft@0.26.5': - dependencies: - '@mapbox/node-pre-gyp': 1.0.11 - '@rollup/pluginutils': 4.2.1 - acorn: 8.12.0 - acorn-import-attributes: 1.9.5(acorn@8.12.0) - async-sema: 3.1.1 - bindings: 1.5.0 - estree-walker: 2.0.2 - glob: 7.2.3 - graceful-fs: 4.2.11 - micromatch: 4.0.7 - node-gyp-build: 4.8.1 - resolve-from: 5.0.0 - transitivePeerDependencies: - - encoding - - supports-color - - abbrev@1.1.1: {} - - acorn-import-attributes@1.9.5(acorn@8.12.0): - dependencies: - acorn: 8.12.0 - - acorn-walk@8.3.3: - dependencies: - acorn: 8.12.0 - - acorn@8.12.0: {} - - agent-base@6.0.2: - dependencies: - debug: 4.3.5 - transitivePeerDependencies: - - supports-color - - ansi-escapes@4.3.2: - dependencies: - type-fest: 0.21.3 - - ansi-regex@5.0.1: {} - - ansi-regex@6.0.1: {} - - ansi-styles@4.3.0: - dependencies: - color-convert: 2.0.1 - - ansi-styles@6.2.1: {} - - aproba@2.0.0: {} - - are-we-there-yet@2.0.0: - dependencies: - delegates: 1.0.0 - readable-stream: 3.6.2 - - argparse@1.0.10: - dependencies: - sprintf-js: 1.0.3 - - argparse@2.0.1: {} - - array-find-index@1.0.2: {} - - arrgv@1.0.2: {} - - arrify@3.0.0: {} - - async-sema@3.1.1: {} - - asynckit@0.4.0: {} - - ava@6.1.3: - dependencies: - '@vercel/nft': 0.26.5 - acorn: 8.12.0 - acorn-walk: 8.3.3 - ansi-styles: 6.2.1 - arrgv: 1.0.2 - arrify: 3.0.0 - callsites: 4.1.0 - cbor: 9.0.2 - chalk: 5.3.0 - chunkd: 2.0.1 - ci-info: 4.0.0 - ci-parallel-vars: 1.0.1 - cli-truncate: 4.0.0 - code-excerpt: 4.0.0 - common-path-prefix: 3.0.0 - concordance: 5.0.4 - currently-unhandled: 0.4.1 - debug: 4.3.5 - emittery: 1.0.3 - figures: 6.1.0 - globby: 14.0.1 - ignore-by-default: 2.1.0 - indent-string: 5.0.0 - is-plain-object: 5.0.0 - is-promise: 4.0.0 - matcher: 5.0.0 - memoize: 10.0.0 - ms: 2.1.3 - p-map: 7.0.2 - package-config: 5.0.0 - picomatch: 3.0.1 - plur: 5.1.0 - pretty-ms: 9.0.0 - resolve-cwd: 3.0.0 - stack-utils: 2.0.6 - strip-ansi: 7.1.0 - supertap: 3.0.1 - temp-dir: 3.0.0 - write-file-atomic: 5.0.1 - yargs: 17.7.2 - transitivePeerDependencies: - - encoding - - supports-color - - axios@1.6.2: - dependencies: - follow-redirects: 1.15.6 - form-data: 4.0.0 - proxy-from-env: 1.1.0 - transitivePeerDependencies: - - debug - - balanced-match@1.0.2: {} - - base64-js@1.5.1: {} - - before-after-hook@2.2.3: {} - - bindings@1.5.0: - dependencies: - file-uri-to-path: 1.0.0 - - bl@4.1.0: - dependencies: - buffer: 5.7.1 - inherits: 2.0.4 - readable-stream: 3.6.2 - - blueimp-md5@2.19.0: {} - - brace-expansion@1.1.11: - dependencies: - balanced-match: 1.0.2 - concat-map: 0.0.1 - - braces@3.0.3: - dependencies: - fill-range: 7.1.1 - - buffer@5.7.1: - dependencies: - base64-js: 1.5.1 - ieee754: 1.2.1 - - call-bind@1.0.7: - dependencies: - es-define-property: 1.0.0 - es-errors: 1.3.0 - function-bind: 1.1.2 - get-intrinsic: 1.2.4 - set-function-length: 1.2.2 - - callsites@4.1.0: {} - - camelize@1.0.1: {} - - cbor@9.0.2: - dependencies: - nofilter: 3.1.0 - - chalk@4.1.2: - dependencies: - ansi-styles: 4.3.0 - supports-color: 7.2.0 - - chalk@5.3.0: {} - - chardet@0.7.0: {} - - chownr@2.0.0: {} - - chunkd@2.0.1: {} - - ci-info@4.0.0: {} - - ci-parallel-vars@1.0.1: {} - - cli-cursor@3.1.0: - dependencies: - restore-cursor: 3.1.0 - - cli-spinners@2.9.2: {} - - cli-truncate@4.0.0: - dependencies: - slice-ansi: 5.0.0 - string-width: 7.1.0 - - cli-width@4.1.0: {} - - clipanion@3.2.1(typanion@3.14.0): - dependencies: - typanion: 3.14.0 - - cliui@8.0.1: - dependencies: - string-width: 4.2.3 - strip-ansi: 6.0.1 - wrap-ansi: 7.0.0 - - clone@1.0.4: {} - - code-excerpt@4.0.0: - dependencies: - convert-to-spaces: 2.0.1 - - color-convert@2.0.1: - dependencies: - color-name: 1.1.4 - - color-name@1.1.4: {} - - color-support@1.1.3: {} - - colorette@2.0.20: {} - - combined-stream@1.0.8: - dependencies: - delayed-stream: 1.0.0 - - common-path-prefix@3.0.0: {} - - concat-map@0.0.1: {} - - concordance@5.0.4: - dependencies: - date-time: 3.1.0 - esutils: 2.0.3 - fast-diff: 1.3.0 - js-string-escape: 1.0.1 - lodash: 4.17.21 - md5-hex: 3.0.1 - semver: 7.6.2 - well-known-symbols: 2.0.0 - - console-control-strings@1.1.0: {} - - convert-to-spaces@2.0.1: {} - - css-color-keywords@1.0.0: {} - - css-to-react-native@3.2.0: - dependencies: - camelize: 1.0.1 - css-color-keywords: 1.0.0 - postcss-value-parser: 4.2.0 - - csstype@3.1.3: {} - - currently-unhandled@0.4.1: - dependencies: - array-find-index: 1.0.2 - - date-time@3.1.0: - dependencies: - time-zone: 1.0.0 - - debug@4.3.5: - dependencies: - ms: 2.1.2 - - defaults@1.0.4: - dependencies: - clone: 1.0.4 - - define-data-property@1.1.4: - dependencies: - es-define-property: 1.0.0 - es-errors: 1.3.0 - gopd: 1.0.1 - - delayed-stream@1.0.0: {} - - delegates@1.0.0: {} - - deprecation@2.3.1: {} - - detect-libc@2.0.3: {} - - emittery@1.0.3: {} - - emnapi@1.2.0: {} - - emoji-regex@10.3.0: {} - - emoji-regex@8.0.0: {} - - es-define-property@1.0.0: - dependencies: - get-intrinsic: 1.2.4 - - es-errors@1.3.0: {} - - escalade@3.1.2: {} - - escape-string-regexp@2.0.0: {} - - escape-string-regexp@5.0.0: {} - - esprima@4.0.1: {} - - estree-walker@2.0.2: {} - - esutils@2.0.3: {} - - external-editor@3.1.0: - dependencies: - chardet: 0.7.0 - iconv-lite: 0.4.24 - tmp: 0.0.33 - - fast-diff@1.3.0: {} - - fast-glob@3.3.2: - dependencies: - '@nodelib/fs.stat': 2.0.5 - '@nodelib/fs.walk': 1.2.8 - glob-parent: 5.1.2 - merge2: 1.4.1 - micromatch: 4.0.7 - - fastq@1.17.1: - dependencies: - reusify: 1.0.4 - - figures@6.1.0: - dependencies: - is-unicode-supported: 2.0.0 - - file-uri-to-path@1.0.0: {} - - fill-range@7.1.1: - dependencies: - to-regex-range: 5.0.1 - - find-up-simple@1.0.0: {} - - follow-redirects@1.15.6: {} - - form-data@4.0.0: - dependencies: - asynckit: 0.4.0 - combined-stream: 1.0.8 - mime-types: 2.1.35 - - fs-minipass@2.1.0: - dependencies: - minipass: 3.3.6 - - fs.realpath@1.0.0: {} - - function-bind@1.1.2: {} - - gauge@3.0.2: - dependencies: - aproba: 2.0.0 - color-support: 1.1.3 - console-control-strings: 1.1.0 - has-unicode: 2.0.1 - object-assign: 4.1.1 - signal-exit: 3.0.7 - string-width: 4.2.3 - strip-ansi: 6.0.1 - wide-align: 1.1.5 - - get-caller-file@2.0.5: {} - - get-east-asian-width@1.2.0: {} - - get-intrinsic@1.2.4: - dependencies: - es-errors: 1.3.0 - function-bind: 1.1.2 - has-proto: 1.0.3 - has-symbols: 1.0.3 - hasown: 2.0.2 - - glob-parent@5.1.2: - dependencies: - is-glob: 4.0.3 - - glob@7.2.3: - dependencies: - fs.realpath: 1.0.0 - inflight: 1.0.6 - inherits: 2.0.4 - minimatch: 3.1.2 - once: 1.4.0 - path-is-absolute: 1.0.1 - - globby@14.0.1: - dependencies: - '@sindresorhus/merge-streams': 2.3.0 - fast-glob: 3.3.2 - ignore: 5.3.1 - path-type: 5.0.0 - slash: 5.1.0 - unicorn-magic: 0.1.0 - - gopd@1.0.1: - dependencies: - get-intrinsic: 1.2.4 - - graceful-fs@4.2.11: {} - - has-flag@4.0.0: {} - - has-property-descriptors@1.0.2: - dependencies: - es-define-property: 1.0.0 - - has-proto@1.0.3: {} - - has-symbols@1.0.3: {} - - has-unicode@2.0.1: {} - - hasown@2.0.2: - dependencies: - function-bind: 1.1.2 - - https-proxy-agent@5.0.1: - dependencies: - agent-base: 6.0.2 - debug: 4.3.5 - transitivePeerDependencies: - - supports-color - - iconv-lite@0.4.24: - dependencies: - safer-buffer: 2.1.2 - - ieee754@1.2.1: {} - - ignore-by-default@2.1.0: {} - - ignore@5.3.1: {} - - imurmurhash@0.1.4: {} - - indent-string@5.0.0: {} - - inflight@1.0.6: - dependencies: - once: 1.4.0 - wrappy: 1.0.2 - - inherits@2.0.4: {} - - inquirer@9.2.23: - dependencies: - '@inquirer/figures': 1.0.3 - '@ljharb/through': 2.3.13 - ansi-escapes: 4.3.2 - chalk: 5.3.0 - cli-cursor: 3.1.0 - cli-width: 4.1.0 - external-editor: 3.1.0 - lodash: 4.17.21 - mute-stream: 1.0.0 - ora: 5.4.1 - run-async: 3.0.0 - rxjs: 7.8.1 - string-width: 4.2.3 - strip-ansi: 6.0.1 - wrap-ansi: 6.2.0 - - irregular-plurals@3.5.0: {} - - is-extglob@2.1.1: {} - - is-fullwidth-code-point@3.0.0: {} - - is-fullwidth-code-point@4.0.0: {} - - is-glob@4.0.3: - dependencies: - is-extglob: 2.1.1 - - is-interactive@1.0.0: {} - - is-number@7.0.0: {} - - is-plain-object@5.0.0: {} - - is-promise@4.0.0: {} - - is-unicode-supported@0.1.0: {} - - is-unicode-supported@2.0.0: {} - - js-string-escape@1.0.1: {} - - js-tokens@4.0.0: {} - - js-yaml@3.14.1: - dependencies: - argparse: 1.0.10 - esprima: 4.0.1 - - js-yaml@4.1.0: - dependencies: - argparse: 2.0.1 - - load-json-file@7.0.1: {} - - lodash-es@4.17.21: {} - - lodash@4.17.21: {} - - log-symbols@4.1.0: - dependencies: - chalk: 4.1.2 - is-unicode-supported: 0.1.0 - - loose-envify@1.4.0: - dependencies: - js-tokens: 4.0.0 - - make-dir@3.1.0: - dependencies: - semver: 6.3.1 - - matcher@5.0.0: - dependencies: - escape-string-regexp: 5.0.0 - - md5-hex@3.0.1: - dependencies: - blueimp-md5: 2.19.0 - - memoize@10.0.0: - dependencies: - mimic-function: 5.0.1 - - merge2@1.4.1: {} - - micromatch@4.0.7: - dependencies: - braces: 3.0.3 - picomatch: 2.3.1 - - mime-db@1.52.0: {} - - mime-types@2.1.35: - dependencies: - mime-db: 1.52.0 - - mimic-fn@2.1.0: {} - - mimic-function@5.0.1: {} - - minimatch@3.1.2: - dependencies: - brace-expansion: 1.1.11 - - minipass@3.3.6: - dependencies: - yallist: 4.0.0 - - minipass@5.0.0: {} - - minizlib@2.1.2: - dependencies: - minipass: 3.3.6 - yallist: 4.0.0 - - mkdirp@1.0.4: {} - - ms@2.1.2: {} - - ms@2.1.3: {} - - mute-stream@1.0.0: {} - - nanoid@3.3.7: {} - - node-fetch@2.7.0: - dependencies: - whatwg-url: 5.0.0 - - node-gyp-build@4.8.1: {} - - nofilter@3.1.0: {} - - nopt@5.0.0: - dependencies: - abbrev: 1.1.1 - - npmlog@5.0.1: - dependencies: - are-we-there-yet: 2.0.0 - console-control-strings: 1.1.0 - gauge: 3.0.2 - set-blocking: 2.0.0 - - object-assign@4.1.1: {} - - once@1.4.0: - dependencies: - wrappy: 1.0.2 - - onetime@5.1.2: - dependencies: - mimic-fn: 2.1.0 - - ora@5.4.1: - dependencies: - bl: 4.1.0 - chalk: 4.1.2 - cli-cursor: 3.1.0 - cli-spinners: 2.9.2 - is-interactive: 1.0.0 - is-unicode-supported: 0.1.0 - log-symbols: 4.1.0 - strip-ansi: 6.0.1 - wcwidth: 1.0.1 - - os-tmpdir@1.0.2: {} - - p-map@7.0.2: {} - - package-config@5.0.0: - dependencies: - find-up-simple: 1.0.0 - load-json-file: 7.0.1 - - parse-ms@4.0.0: {} - - path-is-absolute@1.0.1: {} - - path-type@5.0.0: {} - - picocolors@1.0.1: {} - - picomatch@2.3.1: {} - - picomatch@3.0.1: {} - - plur@5.1.0: - dependencies: - irregular-plurals: 3.5.0 - - postcss-value-parser@4.2.0: {} - - postcss@8.4.33: - dependencies: - nanoid: 3.3.7 - picocolors: 1.0.1 - source-map-js: 1.2.0 - - pretty-ms@9.0.0: - dependencies: - parse-ms: 4.0.0 - - proxy-from-env@1.1.0: {} - - queue-microtask@1.2.3: {} - - react-dom@18.3.1(react@18.3.1): - dependencies: - loose-envify: 1.4.0 - react: 18.3.1 - scheduler: 0.23.2 - - react@18.3.1: - dependencies: - loose-envify: 1.4.0 - - readable-stream@3.6.2: - dependencies: - inherits: 2.0.4 - string_decoder: 1.3.0 - util-deprecate: 1.0.2 - - require-directory@2.1.1: {} - - resolve-cwd@3.0.0: - dependencies: - resolve-from: 5.0.0 - - resolve-from@5.0.0: {} - - restore-cursor@3.1.0: - dependencies: - onetime: 5.1.2 - signal-exit: 3.0.7 - - reusify@1.0.4: {} - - rimraf@3.0.2: - dependencies: - glob: 7.2.3 - - run-async@3.0.0: {} - - run-parallel@1.2.0: - dependencies: - queue-microtask: 1.2.3 - - rxjs@7.8.1: - dependencies: - tslib: 2.6.3 - - safe-buffer@5.2.1: {} - - safer-buffer@2.1.2: {} - - scheduler@0.23.2: - dependencies: - loose-envify: 1.4.0 - - semver@6.3.1: {} - - semver@7.6.2: {} - - serialize-error@7.0.1: - dependencies: - type-fest: 0.13.1 - - set-blocking@2.0.0: {} - - set-function-length@1.2.2: - 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 - - shallowequal@1.1.0: {} - - signal-exit@3.0.7: {} - - signal-exit@4.1.0: {} - - slash@5.1.0: {} - - slice-ansi@5.0.0: - dependencies: - ansi-styles: 6.2.1 - is-fullwidth-code-point: 4.0.0 - - source-map-js@1.2.0: {} - - sprintf-js@1.0.3: {} - - stack-utils@2.0.6: - dependencies: - escape-string-regexp: 2.0.0 - - string-width@4.2.3: - dependencies: - emoji-regex: 8.0.0 - is-fullwidth-code-point: 3.0.0 - strip-ansi: 6.0.1 - - string-width@7.1.0: - dependencies: - emoji-regex: 10.3.0 - get-east-asian-width: 1.2.0 - strip-ansi: 7.1.0 - - string_decoder@1.3.0: - dependencies: - safe-buffer: 5.2.1 - - strip-ansi@6.0.1: - dependencies: - ansi-regex: 5.0.1 - - strip-ansi@7.1.0: - dependencies: - ansi-regex: 6.0.1 - - styled-components@6.1.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1): - dependencies: - '@emotion/is-prop-valid': 1.2.2 - '@emotion/unitless': 0.8.1 - '@types/stylis': 4.2.6 - css-to-react-native: 3.2.0 - csstype: 3.1.3 - postcss: 8.4.33 - react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) - shallowequal: 1.1.0 - stylis: 4.3.2 - tslib: 2.6.3 - - stylis@4.3.2: {} - - supertap@3.0.1: - dependencies: - indent-string: 5.0.0 - js-yaml: 3.14.1 - serialize-error: 7.0.1 - strip-ansi: 7.1.0 - - supports-color@7.2.0: - dependencies: - has-flag: 4.0.0 - - tar@6.2.1: - dependencies: - chownr: 2.0.0 - fs-minipass: 2.1.0 - minipass: 5.0.0 - minizlib: 2.1.2 - mkdirp: 1.0.4 - yallist: 4.0.0 - - temp-dir@3.0.0: {} - - time-zone@1.0.0: {} - - tmp@0.0.33: - dependencies: - os-tmpdir: 1.0.2 - - to-regex-range@5.0.1: - dependencies: - is-number: 7.0.0 - - toml@3.0.0: {} - - tr46@0.0.3: {} - - tslib@2.6.3: {} - - typanion@3.14.0: {} - - type-fest@0.13.1: {} - - type-fest@0.21.3: {} - - typescript@5.5.2: {} - - undici-types@5.26.5: {} - - unicorn-magic@0.1.0: {} - - universal-user-agent@6.0.1: {} - - util-deprecate@1.0.2: {} - - wasm-sjlj@1.0.5: {} - - wcwidth@1.0.1: - dependencies: - defaults: 1.0.4 - - webidl-conversions@3.0.1: {} - - well-known-symbols@2.0.0: {} - - whatwg-url@5.0.0: - dependencies: - tr46: 0.0.3 - webidl-conversions: 3.0.1 - - wide-align@1.1.5: - dependencies: - string-width: 4.2.3 - - wrap-ansi@6.2.0: - dependencies: - ansi-styles: 4.3.0 - string-width: 4.2.3 - strip-ansi: 6.0.1 - - wrap-ansi@7.0.0: - dependencies: - ansi-styles: 4.3.0 - string-width: 4.2.3 - strip-ansi: 6.0.1 - - wrappy@1.0.2: {} - - write-file-atomic@5.0.1: - dependencies: - imurmurhash: 0.1.4 - signal-exit: 4.1.0 - - y18n@5.0.8: {} - - yallist@4.0.0: {} - - yargs-parser@21.1.1: {} - - yargs@17.7.2: - dependencies: - cliui: 8.0.1 - escalade: 3.1.2 - get-caller-file: 2.0.5 - require-directory: 2.1.1 - string-width: 4.2.3 - y18n: 5.0.8 - yargs-parser: 21.1.1 diff --git a/src/builtins.rs b/src/builtins.rs deleted file mode 100644 index 45a25117..00000000 --- a/src/builtins.rs +++ /dev/null @@ -1,71 +0,0 @@ -/// Node.js built-in modules -/// -/// `node -p "[...require('module').builtinModules].map(b => JSON.stringify(b)).join(',\n')"` -/// -pub const NODEJS_BUILTINS: &[&str] = &[ - "_http_agent", - "_http_client", - "_http_common", - "_http_incoming", - "_http_outgoing", - "_http_server", - "_stream_duplex", - "_stream_passthrough", - "_stream_readable", - "_stream_transform", - "_stream_wrap", - "_stream_writable", - "_tls_common", - "_tls_wrap", - "assert", - "assert/strict", - "async_hooks", - "buffer", - "child_process", - "cluster", - "console", - "constants", - "crypto", - "dgram", - "diagnostics_channel", - "dns", - "dns/promises", - "domain", - "events", - "fs", - "fs/promises", - "http", - "http2", - "https", - "inspector", - "module", - "net", - "os", - "path", - "path/posix", - "path/win32", - "perf_hooks", - "process", - "punycode", - "querystring", - "readline", - "repl", - "stream", - "stream/consumers", - "stream/promises", - "stream/web", - "string_decoder", - "sys", - "timers", - "timers/promises", - "tls", - "trace_events", - "tty", - "url", - "util", - "util/types", - "v8", - "vm", - "worker_threads", - "zlib", -]; diff --git a/src/cache.rs b/src/cache.rs deleted file mode 100644 index a1bde36c..00000000 --- a/src/cache.rs +++ /dev/null @@ -1,369 +0,0 @@ -use once_cell::sync::OnceCell as OnceLock; -use std::{ - borrow::{Borrow, Cow}, - convert::AsRef, - hash::{BuildHasherDefault, Hash, Hasher}, - io, - ops::Deref, - path::{Path, PathBuf}, - sync::Arc, -}; - -use dashmap::{DashMap, DashSet}; -use rustc_hash::FxHasher; - -use crate::{ - context::ResolveContext as Ctx, package_json::PackageJson, path::PathUtil, FileMetadata, - FileSystem, ResolveError, ResolveOptions, TsConfig, -}; - -#[derive(Default)] -pub struct Cache { - pub(crate) fs: Fs, - paths: DashSet>, - tsconfigs: DashMap, BuildHasherDefault>, -} - -impl Cache { - pub fn new(fs: Fs) -> Self { - Self { fs, paths: DashSet::default(), tsconfigs: DashMap::default() } - } - - pub fn clear(&self) { - self.paths.clear(); - self.tsconfigs.clear(); - } - - pub fn value(&self, path: &Path) -> CachedPath { - let hash = { - let mut hasher = FxHasher::default(); - path.hash(&mut hasher); - hasher.finish() - }; - if let Some(cache_entry) = self.paths.get((hash, path).borrow() as &dyn CacheKey) { - return cache_entry.clone(); - } - let parent = path.parent().map(|p| self.value(p)); - let data = CachedPath(Arc::new(CachedPathImpl::new( - hash, - path.to_path_buf().into_boxed_path(), - parent, - ))); - self.paths.insert(data.clone()); - data - } - - pub fn tsconfig Result<(), ResolveError>>( - &self, - root: bool, - path: &Path, - callback: F, // callback for modifying tsconfig with `extends` - ) -> Result, ResolveError> { - if let Some(tsconfig_ref) = self.tsconfigs.get(path) { - return Ok(Arc::clone(tsconfig_ref.value())); - } - let meta = self.fs.metadata(path).ok(); - let tsconfig_path = if meta.is_some_and(|m| m.is_file) { - Cow::Borrowed(path) - } else if meta.is_some_and(|m| m.is_dir) { - Cow::Owned(path.join("tsconfig.json")) - } else { - let mut os_string = path.to_path_buf().into_os_string(); - os_string.push(".json"); - Cow::Owned(PathBuf::from(os_string)) - }; - let mut tsconfig_string = self - .fs - .read_to_string(&tsconfig_path) - .map_err(|_| ResolveError::TsconfigNotFound(path.to_path_buf()))?; - let mut tsconfig = - TsConfig::parse(root, &tsconfig_path, &mut tsconfig_string).map_err(|error| { - ResolveError::from_serde_json_error(tsconfig_path.to_path_buf(), &error) - })?; - callback(&mut tsconfig)?; - let tsconfig = Arc::new(tsconfig.build()); - self.tsconfigs.insert(path.to_path_buf(), Arc::clone(&tsconfig)); - Ok(tsconfig) - } -} - -#[derive(Clone)] -pub struct CachedPath(Arc); - -impl Hash for CachedPath { - fn hash(&self, state: &mut H) { - self.0.hash.hash(state); - } -} - -impl PartialEq for CachedPath { - fn eq(&self, other: &Self) -> bool { - self.0.path == other.0.path - } -} -impl Eq for CachedPath {} - -impl Deref for CachedPath { - type Target = CachedPathImpl; - - fn deref(&self) -> &Self::Target { - self.0.as_ref() - } -} - -impl<'a> Borrow for CachedPath { - fn borrow(&self) -> &(dyn CacheKey + 'a) { - self - } -} - -impl AsRef for CachedPath { - fn as_ref(&self) -> &CachedPathImpl { - self.0.as_ref() - } -} - -impl CacheKey for CachedPath { - fn tuple(&self) -> (u64, &Path) { - (self.hash, &self.path) - } -} - -pub struct CachedPathImpl { - hash: u64, - path: Box, - parent: Option, - meta: OnceLock>, - symlink: OnceLock>, - canonicalized: OnceLock>, - node_modules: OnceLock>, - package_json: OnceLock>>, -} - -impl CachedPathImpl { - fn new(hash: u64, path: Box, parent: Option) -> Self { - Self { - hash, - path, - parent, - meta: OnceLock::new(), - symlink: OnceLock::new(), - canonicalized: OnceLock::new(), - node_modules: OnceLock::new(), - package_json: OnceLock::new(), - } - } - - pub fn path(&self) -> &Path { - &self.path - } - - pub fn to_path_buf(&self) -> PathBuf { - self.path.to_path_buf() - } - - pub fn parent(&self) -> Option<&CachedPath> { - self.parent.as_ref() - } - - fn meta(&self, fs: &Fs) -> Option { - *self.meta.get_or_init(|| fs.metadata(&self.path).ok()) - } - - pub fn is_file(&self, fs: &Fs, ctx: &mut Ctx) -> bool { - if let Some(meta) = self.meta(fs) { - ctx.add_file_dependency(self.path()); - meta.is_file - } else { - ctx.add_missing_dependency(self.path()); - false - } - } - - pub fn is_dir(&self, fs: &Fs, ctx: &mut Ctx) -> bool { - self.meta(fs).map_or_else( - || { - ctx.add_missing_dependency(self.path()); - false - }, - |meta| meta.is_dir, - ) - } - - fn symlink(&self, fs: &Fs) -> io::Result> { - self.symlink - .get_or_try_init(|| { - if let Ok(symlink_metadata) = fs.symlink_metadata(&self.path) { - if symlink_metadata.is_symlink { - return fs.canonicalize(self.path()).map(Some); - } - } - Ok(None) - }) - .cloned() - } - - pub fn realpath(&self, fs: &Fs) -> io::Result { - self.canonicalized - .get_or_try_init(|| { - if let Some(link) = self.symlink(fs)? { - return Ok(Some(link)); - } - if let Some(parent) = self.parent() { - let parent_path = parent.realpath(fs)?; - return Ok(Some( - parent_path.normalize_with(self.path.strip_prefix(&parent.path).unwrap()), - )); - }; - Ok(None) - }) - .cloned() - .map(|r| r.unwrap_or_else(|| self.path.clone().to_path_buf())) - } - - pub fn module_directory( - &self, - module_name: &str, - cache: &Cache, - ctx: &mut Ctx, - ) -> Option { - let cached_path = cache.value(&self.path.join(module_name)); - cached_path.is_dir(&cache.fs, ctx).then_some(cached_path) - } - - pub fn cached_node_modules( - &self, - cache: &Cache, - ctx: &mut Ctx, - ) -> Option { - self.node_modules.get_or_init(|| self.module_directory("node_modules", cache, ctx)).clone() - } - - /// Find package.json of a path by traversing parent directories. - /// - /// # Errors - /// - /// * [ResolveError::JSON] - pub fn find_package_json( - &self, - fs: &Fs, - options: &ResolveOptions, - ctx: &mut Ctx, - ) -> Result>, ResolveError> { - let mut cache_value = self; - // Go up directories when the querying path is not a directory - while !cache_value.is_dir(fs, ctx) { - if let Some(cv) = &cache_value.parent { - cache_value = cv.as_ref(); - } else { - break; - } - } - let mut cache_value = Some(cache_value); - while let Some(cv) = cache_value { - if let Some(package_json) = cv.package_json(fs, options, ctx)? { - return Ok(Some(Arc::clone(&package_json))); - } - cache_value = cv.parent.as_deref(); - } - Ok(None) - } - - /// Get package.json of the given path. - /// - /// # Errors - /// - /// * [ResolveError::JSON] - pub fn package_json( - &self, - fs: &Fs, - options: &ResolveOptions, - ctx: &mut Ctx, - ) -> Result>, ResolveError> { - // Change to `std::sync::OnceLock::get_or_try_init` when it is stable. - let result = self - .package_json - .get_or_try_init(|| { - let package_json_path = self.path.join("package.json"); - let Ok(package_json_string) = fs.read_to_string(&package_json_path) else { - return Ok(None); - }; - let real_path = if options.symlinks { - self.realpath(fs)?.join("package.json") - } else { - package_json_path.clone() - }; - PackageJson::parse(package_json_path.clone(), real_path, &package_json_string) - .map(Arc::new) - .map(Some) - .map_err(|error| ResolveError::from_serde_json_error(package_json_path, &error)) - }) - .cloned(); - // https://github.com/webpack/enhanced-resolve/blob/58464fc7cb56673c9aa849e68e6300239601e615/lib/DescriptionFileUtils.js#L68-L82 - match &result { - Ok(Some(package_json)) => { - ctx.add_file_dependency(&package_json.path); - } - Ok(None) => { - // Avoid an allocation by making this lazy - if let Some(deps) = &mut ctx.missing_dependencies { - deps.push(self.path.join("package.json")); - } - } - Err(_) => { - if let Some(deps) = &mut ctx.file_dependencies { - deps.push(self.path.join("package.json")); - } - } - } - result - } -} - -/// Memoized cache key, code adapted from . -trait CacheKey { - fn tuple(&self) -> (u64, &Path); -} - -impl Hash for dyn CacheKey + '_ { - fn hash(&self, state: &mut H) { - self.tuple().0.hash(state); - } -} - -impl PartialEq for dyn CacheKey + '_ { - fn eq(&self, other: &Self) -> bool { - self.tuple().1 == other.tuple().1 - } -} - -impl Eq for dyn CacheKey + '_ {} - -impl<'a> CacheKey for (u64, &'a Path) { - fn tuple(&self) -> (u64, &Path) { - (self.0, self.1) - } -} - -impl<'a> Borrow for (u64, &'a Path) { - fn borrow(&self) -> &(dyn CacheKey + 'a) { - self - } -} - -/// Since the cache key is memoized, use an identity hasher -/// to avoid double cache. -#[derive(Default)] -struct IdentityHasher(u64); - -impl Hasher for IdentityHasher { - fn write(&mut self, _: &[u8]) { - unreachable!("Invalid use of IdentityHasher") - } - fn write_u64(&mut self, n: u64) { - self.0 = n; - } - fn finish(&self) -> u64 { - self.0 - } -} diff --git a/src/context.rs b/src/context.rs deleted file mode 100644 index 9349de30..00000000 --- a/src/context.rs +++ /dev/null @@ -1,89 +0,0 @@ -use std::{ - ops::{Deref, DerefMut}, - path::{Path, PathBuf}, -}; - -use crate::error::ResolveError; - -#[derive(Debug, Default, Clone)] -pub struct ResolveContext(ResolveContextImpl); - -#[derive(Debug, Default, Clone)] -pub struct ResolveContextImpl { - pub fully_specified: bool, - - pub query: Option, - - pub fragment: Option, - - /// Files that was found on file system - pub file_dependencies: Option>, - - /// Files that was found on file system - pub missing_dependencies: Option>, - - /// The current resolving alias for bailing recursion alias. - pub resolving_alias: Option, - - /// For avoiding infinite recursion, which will cause stack overflow. - depth: u8, -} - -impl Deref for ResolveContext { - type Target = ResolveContextImpl; - - fn deref(&self) -> &Self::Target { - &self.0 - } -} - -impl DerefMut for ResolveContext { - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} - -impl ResolveContext { - pub fn with_fully_specified(&mut self, yes: bool) { - self.fully_specified = yes; - } - - pub fn with_query_fragment(&mut self, query: Option<&str>, fragment: Option<&str>) { - if let Some(query) = query { - self.query.replace(query.to_string()); - } - if let Some(fragment) = fragment { - self.fragment.replace(fragment.to_string()); - } - } - - pub fn init_file_dependencies(&mut self) { - self.file_dependencies.replace(vec![]); - self.missing_dependencies.replace(vec![]); - } - - pub fn add_file_dependency(&mut self, dep: &Path) { - if let Some(deps) = &mut self.file_dependencies { - deps.push(dep.to_path_buf()); - } - } - - pub fn add_missing_dependency(&mut self, dep: &Path) { - if let Some(deps) = &mut self.missing_dependencies { - deps.push(dep.to_path_buf()); - } - } - - pub fn with_resolving_alias(&mut self, alias: String) { - self.resolving_alias = Some(alias); - } - - pub fn test_for_infinite_recursion(&mut self) -> Result<(), ResolveError> { - self.depth += 1; - // 64 should be more than enough for detecting infinite recursion. - if self.depth > 64 { - return Err(ResolveError::Recursion); - } - Ok(()) - } -} diff --git a/src/error.rs b/src/error.rs deleted file mode 100644 index ff2aaa4f..00000000 --- a/src/error.rs +++ /dev/null @@ -1,160 +0,0 @@ -use std::{io, path::PathBuf, sync::Arc}; -use thiserror::Error; - -/// All resolution errors -/// -/// `thiserror` is used to display meaningful error messages. -#[derive(Debug, Clone, PartialEq, Error)] -pub enum ResolveError { - /// Ignored path - /// - /// Derived from ignored path (false value) from browser field in package.json - /// ```json - /// { - /// "browser": { - /// "./module": false - /// } - /// } - /// ``` - /// See - #[error("Path is ignored {0}")] - Ignored(PathBuf), - - /// Module not found - #[error("Cannot find module '{0}'")] - NotFound(/* specifier */ String), - - /// Tsconfig not found - #[error("Tsconfig not found {0}")] - TsconfigNotFound(PathBuf), - - #[error("{0}")] - IOError(IOError), - - /// Node.js builtin modules - /// - /// This is an error due to not being a Node.js runtime. - /// The `alias` option can be used to resolve a builtin module to a polyfill. - #[error("Builtin module {0}")] - Builtin(String), - - /// All of the aliased extension are not found - #[error("All of the aliased extension are not found")] - ExtensionAlias, - - /// The provided path specifier cannot be parsed - #[error("{0}")] - Specifier(SpecifierError), - - /// JSON parse error - #[error("{0:?}")] - JSON(JSONError), - - /// Restricted by `ResolveOptions::restrictions` - #[error(r#"Path "{0}" restricted by {0}"#)] - Restriction(PathBuf, PathBuf), - - #[error(r#"Invalid module "{0}" specifier is not a valid subpath for the "exports" resolution of {1}"#)] - InvalidModuleSpecifier(String, PathBuf), - - #[error(r#"Invalid "exports" target "{0}" defined for '{1}' in the package config {2}"#)] - InvalidPackageTarget(String, String, PathBuf), - - #[error(r#"Package subpath '{0}' is not defined by "exports" in {1}"#)] - PackagePathNotExported(String, PathBuf), - - #[error(r#"Invalid package config "{0}", "exports" cannot contain some keys starting with '.' and some not. The exports object must either be an object of package subpath keys or an object of main entry condition name keys only."#)] - InvalidPackageConfig(PathBuf), - - #[error(r#"Default condition should be last one in "{0}""#)] - InvalidPackageConfigDefault(PathBuf), - - #[error(r#"Expecting folder to folder mapping. "{0}" should end with "/"#)] - InvalidPackageConfigDirectory(PathBuf), - - #[error(r#"Package import specifier "{0}" is not defined in package {1}"#)] - PackageImportNotDefined(String, PathBuf), - - #[error("{0} is unimplemented")] - Unimplemented(&'static str), - - /// Occurs when alias paths reference each other. - #[error("Recursion in resolving")] - Recursion, -} - -impl ResolveError { - pub fn is_ignore(&self) -> bool { - matches!(self, Self::Ignored(_)) - } - - pub(crate) fn from_serde_json_error(path: PathBuf, error: &serde_json::Error) -> Self { - Self::JSON(JSONError { - path, - message: error.to_string(), - line: error.line(), - column: error.column(), - }) - } -} - -/// Error for [ResolveError::Specifier] -#[derive(Debug, Clone, Eq, PartialEq, Error)] -pub enum SpecifierError { - #[error("The specifiers must be a non-empty string. Received \"{0}\"")] - Empty(String), -} - -/// JSON error from [serde_json::Error] -#[derive(Debug, Clone, Eq, PartialEq)] -pub struct JSONError { - pub path: PathBuf, - pub message: String, - pub line: usize, - pub column: usize, -} - -#[derive(Debug, Clone, Error)] -#[error("{0}")] -pub struct IOError(Arc); - -impl PartialEq for IOError { - fn eq(&self, other: &Self) -> bool { - self.0.kind() == other.0.kind() - } -} - -impl From for io::Error { - fn from(error: IOError) -> Self { - let io_error = error.0.as_ref(); - Self::new(io_error.kind(), io_error.to_string()) - } -} - -impl From for ResolveError { - fn from(err: io::Error) -> Self { - Self::IOError(IOError(Arc::new(err))) - } -} - -#[test] -fn test_into_io_error() { - use std::io::{self, ErrorKind}; - let error_string = "IOError occurred"; - let string_error = io::Error::new(ErrorKind::Interrupted, error_string.to_string()); - let string_error2 = io::Error::new(ErrorKind::Interrupted, error_string.to_string()); - let resolve_io_error: ResolveError = ResolveError::from(string_error2); - - assert_eq!(resolve_io_error, ResolveError::from(string_error)); - assert_eq!(resolve_io_error.clone(), resolve_io_error); - if let ResolveError::IOError(io_error) = resolve_io_error { - // fix for https://github.com/web-infra-dev/rspack/issues/4564 - let std_io_error: io::Error = io_error.into(); - assert_eq!(std_io_error.kind(), ErrorKind::Interrupted); - assert_eq!(std_io_error.to_string(), error_string); - assert_eq!( - format!("{std_io_error:?}"), - r#"Custom { kind: Interrupted, error: "IOError occurred" }"# - ); - } -} diff --git a/src/file_system.rs b/src/file_system.rs deleted file mode 100644 index 04d177de..00000000 --- a/src/file_system.rs +++ /dev/null @@ -1,133 +0,0 @@ -use std::{ - fs, io, - path::{Path, PathBuf}, -}; - -/// File System abstraction used for `ResolverGeneric` -pub trait FileSystem: Send + Sync { - /// See [std::fs::read_to_string] - /// - /// # Errors - /// - /// * See [std::fs::read_to_string] - /// ## Warning - /// Use `&Path` instead of a generic `P: AsRef` here, - /// because object safety requirements, it is especially useful, when - /// you want to store multiple `dyn FileSystem` in a `Vec` or use a `ResolverGeneric` in - /// napi env. - fn read_to_string(&self, path: &Path) -> io::Result; - - /// See [std::fs::metadata] - /// - /// # Errors - /// See [std::fs::metadata] - /// ## Warning - /// Use `&Path` instead of a generic `P: AsRef` here, - /// because object safety requirements, it is especially useful, when - /// you want to store multiple `dyn FileSystem` in a `Vec` or use a `ResolverGeneric` in - /// napi env. - fn metadata(&self, path: &Path) -> io::Result; - - /// See [std::fs::symlink_metadata] - /// - /// # Errors - /// - /// See [std::fs::symlink_metadata] - /// ## Warning - /// Use `&Path` instead of a generic `P: AsRef` here, - /// because object safety requirements, it is especially useful, when - /// you want to store multiple `dyn FileSystem` in a `Vec` or use a `ResolverGeneric` in - /// napi env. - fn symlink_metadata(&self, path: &Path) -> io::Result; - - /// See [std::fs::canonicalize] - /// - /// # Errors - /// - /// See [std::fs::read_link] - /// ## Warning - /// Use `&Path` instead of a generic `P: AsRef` here, - /// because object safety requirements, it is especially useful, when - /// you want to store multiple `dyn FileSystem` in a `Vec` or use a `ResolverGeneric` in - /// napi env. - fn canonicalize(&self, path: &Path) -> io::Result; -} - -/// Metadata information about a file -#[derive(Debug, Clone, Copy)] -pub struct FileMetadata { - pub(crate) is_file: bool, - pub(crate) is_dir: bool, - pub(crate) is_symlink: bool, -} - -impl FileMetadata { - pub fn new(is_file: bool, is_dir: bool, is_symlink: bool) -> Self { - Self { is_file, is_dir, is_symlink } - } -} - -impl From for FileMetadata { - fn from(metadata: fs::Metadata) -> Self { - Self::new(metadata.is_file(), metadata.is_dir(), metadata.is_symlink()) - } -} - -/// Operating System -#[derive(Default)] -pub struct FileSystemOs; - -impl FileSystem for FileSystemOs { - fn read_to_string(&self, path: &Path) -> io::Result { - fs::read_to_string(path) - } - - fn metadata(&self, path: &Path) -> io::Result { - fs::metadata(path).map(FileMetadata::from) - } - - fn symlink_metadata(&self, path: &Path) -> io::Result { - fs::symlink_metadata(path).map(FileMetadata::from) - } - - fn canonicalize(&self, path: &Path) -> io::Result { - #[cfg(not(target_os = "wasi"))] - { - dunce::canonicalize(path) - } - #[cfg(target_os = "wasi")] - { - let meta = fs::symlink_metadata(path)?; - if meta.file_type().is_symlink() { - let link = fs::read_link(path)?; - let mut path_buf = path.to_path_buf(); - path_buf.pop(); - for segment in link.iter() { - match segment.to_str() { - Some("..") => { - path_buf.pop(); - } - Some(".") | None => {} - Some(seg) => { - // Need to trim the extra \0 introduces by rust std rust-lang/rust#123727 - path_buf.push(seg.trim_end_matches('\0')); - } - } - } - Ok(path_buf) - } else { - Ok(path.to_path_buf()) - } - } - } -} - -#[test] -fn metadata() { - let meta = FileMetadata { is_file: true, is_dir: true, is_symlink: true }; - assert_eq!( - format!("{meta:?}"), - "FileMetadata { is_file: true, is_dir: true, is_symlink: true }" - ); - let _ = meta; -} diff --git a/src/lib.rs b/src/lib.rs deleted file mode 100644 index 40c51359..00000000 --- a/src/lib.rs +++ /dev/null @@ -1,1672 +0,0 @@ -//! # Oxc Resolver -//! -//! Node.js [CommonJS][cjs] and [ECMAScript][esm] Module Resolution. -//! -//! Released on [crates.io](https://crates.io/crates/oxc_resolver) and [npm](https://www.npmjs.com/package/oxc-resolver). -//! -//! A module resolution is the process of finding the file referenced by a module specifier in -//! `import "specifier"` or `require("specifier")`. -//! -//! All [configuration options](ResolveOptions) are aligned with webpack's [enhanced-resolve]. -//! -//! ## Terminology -//! -//! ### Specifier -//! -//! For [CommonJS modules][cjs], -//! the specifier is the string passed to the `require` function. e.g. `"id"` in `require("id")`. -//! -//! For [ECMAScript modules][esm], -//! the specifier of an `import` statement is the string after the `from` keyword, -//! e.g. `'specifier'` in `import 'specifier'` or `import { sep } from 'specifier'`. -//! Specifiers are also used in export from statements, and as the argument to an `import()` expression. -//! -//! This is also named "request" in some places. -//! -//! ## References: -//! -//! * Algorithm adapted from Node.js [CommonJS Module Resolution Algorithm] and [ECMAScript Module Resolution Algorithm]. -//! * Tests are ported from [enhanced-resolve]. -//! * Some code is adapted from [parcel-resolver]. -//! * The documentation is copied from [webpack's resolve configuration](https://webpack.js.org/configuration/resolve). -//! -//! [enhanced-resolve]: https://github.com/webpack/enhanced-resolve -//! [CommonJS Module Resolution Algorithm]: https://nodejs.org/api/modules.html#all-together -//! [ECMAScript Module Resolution Algorithm]: https://nodejs.org/api/esm.html#resolution-algorithm-specification -//! [parcel-resolver]: https://github.com/parcel-bundler/parcel/blob/v2/packages/utils/node-resolver-rs -//! [cjs]: https://nodejs.org/api/modules.html -//! [esm]: https://nodejs.org/api/esm.html -//! -//! ## Feature flags -#![cfg_attr(feature = "document-features", doc = document_features::document_features!())] -#![cfg_attr(docsrs, feature(doc_auto_cfg))] -//! -//! ## Example -//! -//! ```rust,ignore -#![doc = include_str!("../examples/resolver.rs")] -//! ``` - -mod builtins; -mod cache; -mod context; -mod error; -mod file_system; -mod options; -mod package_json; -mod path; -mod resolution; -mod specifier; -mod tsconfig; - -#[cfg(test)] -mod tests; - -use std::{ - borrow::Cow, - cmp::Ordering, - ffi::OsStr, - fmt, - path::{Component, Path, PathBuf}, - sync::Arc, -}; - -use rustc_hash::FxHashSet; -use serde_json::Value as JSONValue; - -pub use crate::{ - builtins::NODEJS_BUILTINS, - error::{JSONError, ResolveError, SpecifierError}, - file_system::{FileMetadata, FileSystem}, - options::{ - Alias, AliasValue, EnforceExtension, ResolveOptions, Restriction, TsconfigOptions, - TsconfigReferences, - }, - package_json::PackageJson, - resolution::Resolution, -}; -use crate::{ - cache::{Cache, CachedPath}, - context::ResolveContext as Ctx, - file_system::FileSystemOs, - package_json::JSONMap, - path::{PathUtil, SLASH_START}, - specifier::Specifier, - tsconfig::ExtendsField, - tsconfig::{ProjectReference, TsConfig}, -}; - -type ResolveResult = Result, ResolveError>; - -/// Context returned from the [Resolver::resolve_with_context] API -#[derive(Debug, Default, Clone)] -pub struct ResolveContext { - /// Files that was found on file system - pub file_dependencies: FxHashSet, - - /// Dependencies that was not found on file system - pub missing_dependencies: FxHashSet, -} - -/// Resolver with the current operating system as the file system -pub type Resolver = ResolverGeneric; - -/// Generic implementation of the resolver, can be configured by the [FileSystem] trait -pub struct ResolverGeneric { - options: ResolveOptions, - cache: Arc>, -} - -impl fmt::Debug for ResolverGeneric { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - self.options.fmt(f) - } -} - -impl Default for ResolverGeneric { - fn default() -> Self { - Self::new(ResolveOptions::default()) - } -} - -impl ResolverGeneric { - pub fn new(options: ResolveOptions) -> Self { - Self { options: options.sanitize(), cache: Arc::new(Cache::new(Fs::default())) } - } -} - -impl ResolverGeneric { - pub fn new_with_file_system(file_system: Fs, options: ResolveOptions) -> Self { - Self { cache: Arc::new(Cache::new(file_system)), options: options.sanitize() } - } - - /// Clone the resolver using the same underlying cache. - #[must_use] - pub fn clone_with_options(&self, options: ResolveOptions) -> Self { - Self { options: options.sanitize(), cache: Arc::clone(&self.cache) } - } - - /// Returns the options. - pub fn options(&self) -> &ResolveOptions { - &self.options - } - - /// Clear the underlying cache. - pub fn clear_cache(&self) { - self.cache.clear(); - } - - /// Resolve `specifier` at an absolute `path`. - /// - /// A specifier is the string passed to require or import, i.e. `require("specifier")` or `import "specifier"`. - /// - /// `path` must be an **absolute** path to a directory where the specifier is resolved against. - /// For CommonJS modules, it is the `__dirname` variable that contains the absolute path to the folder containing current module. - /// For ECMAScript modules, it is the value of `import.meta.url`. - /// - /// # Errors - /// - /// * See [ResolveError] - pub fn resolve>( - &self, - path: P, - specifier: &str, - ) -> Result { - let mut ctx = Ctx::default(); - self.resolve_tracing(path.as_ref(), specifier, &mut ctx) - } - - /// Resolve `specifier` at absolute `path` with [ResolveContext] - /// - /// # Errors - /// - /// * See [ResolveError] - pub fn resolve_with_context>( - &self, - path: P, - specifier: &str, - resolve_context: &mut ResolveContext, - ) -> Result { - let mut ctx = Ctx::default(); - ctx.init_file_dependencies(); - let result = self.resolve_tracing(path.as_ref(), specifier, &mut ctx); - if let Some(deps) = &mut ctx.file_dependencies { - resolve_context.file_dependencies.extend(deps.drain(..)); - } - if let Some(deps) = &mut ctx.missing_dependencies { - resolve_context.missing_dependencies.extend(deps.drain(..)); - } - result - } - - /// Wrap `resolve_impl` with `tracing` information - fn resolve_tracing( - &self, - path: &Path, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - let span = tracing::debug_span!("resolve", path = ?path, specifier = specifier); - let _enter = span.enter(); - let r = self.resolve_impl(path, specifier, ctx); - match &r { - Ok(r) => { - tracing::debug!(options = ?self.options, path = ?path, specifier = specifier, ret = ?r.path); - } - Err(err) => { - tracing::debug!(options = ?self.options, path = ?path, specifier = specifier, err = ?err); - } - }; - r - } - - fn resolve_impl( - &self, - path: &Path, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - ctx.with_fully_specified(self.options.fully_specified); - let cached_path = self.cache.value(path); - let cached_path = self.require(&cached_path, specifier, ctx)?; - let path = self.load_realpath(&cached_path)?; - // enhanced-resolve: restrictions - self.check_restrictions(&path)?; - let package_json = cached_path.find_package_json(&self.cache.fs, &self.options, ctx)?; - if let Some(package_json) = &package_json { - // path must be inside the package. - debug_assert!(path.starts_with(package_json.directory())); - } - Ok(Resolution { - path, - query: ctx.query.take(), - fragment: ctx.fragment.take(), - package_json, - }) - } - - /// require(X) from module at path Y - /// - /// X: specifier - /// Y: path - /// - /// - fn require( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - ctx.test_for_infinite_recursion()?; - - // enhanced-resolve: parse - let (parsed, try_fragment_as_path) = self.load_parse(cached_path, specifier, ctx)?; - if let Some(path) = try_fragment_as_path { - return Ok(path); - } - - self.require_without_parse(cached_path, parsed.path(), ctx) - } - - fn require_without_parse( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - // tsconfig-paths - if let Some(path) = self.load_tsconfig_paths(cached_path, specifier, &mut Ctx::default())? { - return Ok(path); - } - - // enhanced-resolve: try alias - if let Some(path) = self.load_alias(cached_path, specifier, &self.options.alias, ctx)? { - return Ok(path); - } - - let result = match Path::new(specifier).components().next() { - // 2. If X begins with '/' - Some(Component::RootDir | Component::Prefix(_)) => { - self.require_absolute(cached_path, specifier, ctx) - } - // 3. If X begins with './' or '/' or '../' - Some(Component::CurDir | Component::ParentDir) => { - self.require_relative(cached_path, specifier, ctx) - } - // 4. If X begins with '#' - Some(Component::Normal(_)) if specifier.as_bytes()[0] == b'#' => { - self.require_hash(cached_path, specifier, ctx) - } - _ => { - // 1. If X is a core module, - // a. return the core module - // b. STOP - self.require_core(specifier)?; - - // (ESM) 5. Otherwise, - // Note: specifier is now a bare specifier. - // Set resolved the result of PACKAGE_RESOLVE(specifier, parentURL). - self.require_bare(cached_path, specifier, ctx) - } - }; - - result.or_else(|err| { - if err.is_ignore() { - return Err(err); - } - // enhanced-resolve: try fallback - self.load_alias(cached_path, specifier, &self.options.fallback, ctx) - .and_then(|value| value.ok_or(err)) - }) - } - - // PACKAGE_RESOLVE(packageSpecifier, parentURL) - // 3. If packageSpecifier is a Node.js builtin module name, then - // 1. Return the string "node:" concatenated with packageSpecifier. - fn require_core(&self, specifier: &str) -> Result<(), ResolveError> { - if self.options.builtin_modules { - let starts_with_node = specifier.starts_with("node:"); - if starts_with_node || NODEJS_BUILTINS.binary_search(&specifier).is_ok() { - let mut specifier = specifier.to_string(); - if !starts_with_node { - specifier = format!("node:{specifier}"); - } - return Err(ResolveError::Builtin(specifier)); - } - } - Ok(()) - } - - fn require_absolute( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - // Make sure only path prefixes gets called - debug_assert!(Path::new(specifier) - .components() - .next() - .is_some_and(|c| matches!(c, Component::RootDir | Component::Prefix(_)))); - if !self.options.prefer_relative && self.options.prefer_absolute { - if let Ok(path) = self.load_package_self_or_node_modules(cached_path, specifier, ctx) { - return Ok(path); - } - } - if let Some(path) = self.load_roots(specifier, ctx) { - return Ok(path); - } - // 2. If X begins with '/' - // a. set Y to be the file system root - let path = self.cache.value(Path::new(specifier)); - if let Some(path) = self.load_as_file_or_directory(&path, specifier, ctx)? { - return Ok(path); - } - Err(ResolveError::NotFound(specifier.to_string())) - } - - // 3. If X begins with './' or '/' or '../' - fn require_relative( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - // Make sure only relative or normal paths gets called - debug_assert!(Path::new(specifier).components().next().is_some_and(|c| matches!( - c, - Component::CurDir | Component::ParentDir | Component::Normal(_) - ))); - let path = cached_path.path().normalize_with(specifier); - let cached_path = self.cache.value(&path); - // a. LOAD_AS_FILE(Y + X) - // b. LOAD_AS_DIRECTORY(Y + X) - if let Some(path) = self.load_as_file_or_directory(&cached_path, specifier, ctx)? { - return Ok(path); - } - // c. THROW "not found" - Err(ResolveError::NotFound(specifier.to_string())) - } - - fn require_hash( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - debug_assert_eq!(specifier.chars().next(), Some('#')); - // a. LOAD_PACKAGE_IMPORTS(X, dirname(Y)) - if let Some(path) = self.load_package_imports(cached_path, specifier, ctx)? { - return Ok(path); - } - self.load_package_self_or_node_modules(cached_path, specifier, ctx) - } - - fn require_bare( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - // Make sure no other path prefixes gets called - debug_assert!(Path::new(specifier) - .components() - .next() - .is_some_and(|c| matches!(c, Component::Normal(_)))); - if self.options.prefer_relative { - if let Ok(path) = self.require_relative(cached_path, specifier, ctx) { - return Ok(path); - } - } - self.load_package_self_or_node_modules(cached_path, specifier, ctx) - } - - /// enhanced-resolve: ParsePlugin. - /// - /// 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`. - /// - /// - fn load_parse<'s>( - &self, - cached_path: &CachedPath, - specifier: &'s str, - ctx: &mut Ctx, - ) -> Result<(Specifier<'s>, Option), ResolveError> { - let parsed = Specifier::parse(specifier).map_err(ResolveError::Specifier)?; - ctx.with_query_fragment(parsed.query, parsed.fragment); - - // There is an edge-case where a request with # can be a path or a fragment -> try both - if ctx.fragment.is_some() && ctx.query.is_none() { - let specifier = parsed.path(); - let fragment = ctx.fragment.take().unwrap(); - let path = format!("{specifier}{fragment}"); - if let Ok(path) = self.require_without_parse(cached_path, &path, ctx) { - return Ok((parsed, Some(path))); - } - ctx.fragment.replace(fragment); - } - Ok((parsed, None)) - } - - fn load_package_self_or_node_modules( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - let (_, subpath) = Self::parse_package_specifier(specifier); - if subpath.is_empty() { - ctx.with_fully_specified(false); - } - // 5. LOAD_PACKAGE_SELF(X, dirname(Y)) - if let Some(path) = self.load_package_self(cached_path, specifier, ctx)? { - return Ok(path); - } - // 6. LOAD_NODE_MODULES(X, dirname(Y)) - if let Some(path) = self.load_node_modules(cached_path, specifier, ctx)? { - return Ok(path); - } - // 7. THROW "not found" - Err(ResolveError::NotFound(specifier.to_string())) - } - - /// LOAD_PACKAGE_IMPORTS(X, DIR) - fn load_package_imports( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - // 1. Find the closest package scope SCOPE to DIR. - // 2. If no scope was found, return. - let Some(package_json) = - cached_path.find_package_json(&self.cache.fs, &self.options, ctx)? - else { - return Ok(None); - }; - // 3. If the SCOPE/package.json "imports" is null or undefined, return. - // 4. let MATCH = PACKAGE_IMPORTS_RESOLVE(X, pathToFileURL(SCOPE), ["node", "require"]) defined in the ESM resolver. - if let Some(path) = self.package_imports_resolve(specifier, &package_json, ctx)? { - // 5. RESOLVE_ESM_MATCH(MATCH). - return self.resolve_esm_match(specifier, &path, ctx); - } - Ok(None) - } - - fn load_as_file(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - // enhanced-resolve feature: extension_alias - if let Some(path) = self.load_extension_alias(cached_path, ctx)? { - return Ok(Some(path)); - } - if self.options.enforce_extension.is_disabled() { - // 1. If X is a file, load X as its file extension format. STOP - if let Some(path) = self.load_alias_or_file(cached_path, ctx)? { - return Ok(Some(path)); - } - } - // 2. If X.js is a file, load X.js as JavaScript text. STOP - // 3. If X.json is a file, parse X.json to a JavaScript Object. STOP - // 4. If X.node is a file, load X.node as binary addon. STOP - if let Some(path) = - self.load_extensions(cached_path.path(), &self.options.extensions, ctx)? - { - return Ok(Some(path)); - } - Ok(None) - } - - fn load_as_directory(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - // TODO: Only package.json is supported, so warn about having other values - // Checking for empty files is needed for omitting checks on package.json - // 1. If X/package.json is a file, - if !self.options.description_files.is_empty() { - // a. Parse X/package.json, and look for "main" field. - if let Some(package_json) = - cached_path.package_json(&self.cache.fs, &self.options, ctx)? - { - // b. If "main" is a falsy value, GOTO 2. - for main_field in package_json.main_fields(&self.options.main_fields) { - // c. let M = X + (json main field) - let main_field_path = cached_path.path().normalize_with(main_field); - // d. LOAD_AS_FILE(M) - let cached_path = self.cache.value(&main_field_path); - if let Some(path) = self.load_as_file(&cached_path, ctx)? { - return Ok(Some(path)); - } - // e. LOAD_INDEX(M) - if let Some(path) = self.load_index(&cached_path, ctx)? { - return Ok(Some(path)); - } - } - // f. LOAD_INDEX(X) DEPRECATED - // g. THROW "not found" - } - } - // 2. LOAD_INDEX(X) - self.load_index(cached_path, ctx) - } - - fn load_as_file_or_directory( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - if self.options.resolve_to_context { - return Ok(cached_path.is_dir(&self.cache.fs, ctx).then(|| cached_path.clone())); - } - if !specifier.ends_with('/') { - if let Some(path) = self.load_as_file(cached_path, ctx)? { - return Ok(Some(path)); - } - } - if cached_path.is_dir(&self.cache.fs, ctx) { - if let Some(path) = self.load_as_directory(cached_path, ctx)? { - return Ok(Some(path)); - } - } - Ok(None) - } - - fn load_extensions(&self, path: &Path, extensions: &[String], ctx: &mut Ctx) -> ResolveResult { - if ctx.fully_specified { - return Ok(None); - } - let path = path.as_os_str(); - for extension in extensions { - let mut path_with_extension = path.to_os_string(); - path_with_extension.reserve_exact(extension.len()); - path_with_extension.push(extension); - let cached_path = self.cache.value(Path::new(&path_with_extension)); - if let Some(path) = self.load_alias_or_file(&cached_path, ctx)? { - return Ok(Some(path)); - } - } - Ok(None) - } - - fn load_realpath(&self, cached_path: &CachedPath) -> Result { - if self.options.symlinks { - cached_path.realpath(&self.cache.fs).map_err(ResolveError::from) - } else { - Ok(cached_path.to_path_buf()) - } - } - - fn check_restrictions(&self, path: &Path) -> Result<(), ResolveError> { - // https://github.com/webpack/enhanced-resolve/blob/a998c7d218b7a9ec2461fc4fddd1ad5dd7687485/lib/RestrictionsPlugin.js#L19-L24 - fn is_inside(path: &Path, parent: &Path) -> bool { - if !path.starts_with(parent) { - return false; - } - if path.as_os_str().len() == parent.as_os_str().len() { - return true; - } - path.strip_prefix(parent).is_ok_and(|p| p == Path::new("./")) - } - for restriction in &self.options.restrictions { - match restriction { - Restriction::Path(restricted_path) => { - if !is_inside(path, restricted_path) { - return Err(ResolveError::Restriction( - path.to_path_buf(), - restricted_path.clone(), - )); - } - } - Restriction::RegExp(_) => { - return Err(ResolveError::Unimplemented("Restriction with regex")) - } - } - } - Ok(()) - } - - fn load_index(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - for main_file in &self.options.main_files { - let main_path = cached_path.path().normalize_with(main_file); - let cached_path = self.cache.value(&main_path); - if self.options.enforce_extension.is_disabled() { - if let Some(path) = self.load_alias_or_file(&cached_path, ctx)? { - return Ok(Some(path)); - } - } - // 1. If X/index.js is a file, load X/index.js as JavaScript text. STOP - // 2. If X/index.json is a file, parse X/index.json to a JavaScript object. STOP - // 3. If X/index.node is a file, load X/index.node as binary addon. STOP - if let Some(path) = - self.load_extensions(cached_path.path(), &self.options.extensions, ctx)? - { - return Ok(Some(path)); - } - } - Ok(None) - } - - fn load_alias_or_file(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - if let Some(package_json) = - cached_path.find_package_json(&self.cache.fs, &self.options, ctx)? - { - if let Some(path) = self.load_browser_field(cached_path, None, &package_json, ctx)? { - return Ok(Some(path)); - } - } - // enhanced-resolve: try file as alias - let alias_specifier = cached_path.path().to_string_lossy(); - if let Some(path) = - self.load_alias(cached_path, &alias_specifier, &self.options.alias, ctx)? - { - return Ok(Some(path)); - } - if cached_path.is_file(&self.cache.fs, ctx) { - return Ok(Some(cached_path.clone())); - } - Ok(None) - } - - fn load_node_modules( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - let (package_name, subpath) = Self::parse_package_specifier(specifier); - // 1. let DIRS = NODE_MODULES_PATHS(START) - // 2. for each DIR in DIRS: - for module_name in &self.options.modules { - for cached_path in std::iter::successors(Some(cached_path), |p| p.parent()) { - // Skip if /path/to/node_modules does not exist - if !cached_path.is_dir(&self.cache.fs, ctx) { - continue; - } - - let Some(cached_path) = self.get_module_directory(cached_path, module_name, ctx) - else { - continue; - }; - // Optimize node_modules lookup by inspecting whether the package exists - // From LOAD_PACKAGE_EXPORTS(X, DIR) - // 1. Try to interpret X as a combination of NAME and SUBPATH where the name - // may have a @scope/ prefix and the subpath begins with a slash (`/`). - if !package_name.is_empty() { - let package_path = cached_path.path().normalize_with(package_name); - let cached_path = self.cache.value(&package_path); - // Try foo/node_modules/package_name - if cached_path.is_dir(&self.cache.fs, ctx) { - // a. LOAD_PACKAGE_EXPORTS(X, DIR) - if let Some(path) = - self.load_package_exports(specifier, subpath, &cached_path, ctx)? - { - return Ok(Some(path)); - } - } else { - // foo/node_modules/package_name is not a directory, so useless to check inside it - if !subpath.is_empty() { - continue; - } - // Skip if the directory lead to the scope package does not exist - // i.e. `foo/node_modules/@scope` is not a directory for `foo/node_modules/@scope/package` - if package_name.starts_with('@') { - if let Some(path) = cached_path.parent() { - if !path.is_dir(&self.cache.fs, ctx) { - continue; - } - } - } - } - } - - // Try as file or directory for all other cases - // b. LOAD_AS_FILE(DIR/X) - // c. LOAD_AS_DIRECTORY(DIR/X) - let node_module_file = cached_path.path().normalize_with(specifier); - let cached_path = self.cache.value(&node_module_file); - if let Some(path) = self.load_as_file_or_directory(&cached_path, specifier, ctx)? { - return Ok(Some(path)); - } - } - } - Ok(None) - } - - fn get_module_directory( - &self, - cached_path: &CachedPath, - module_name: &str, - ctx: &mut Ctx, - ) -> Option { - if cached_path.path().ends_with(module_name) { - Some(cached_path.clone()) - } else if module_name == "node_modules" { - cached_path.cached_node_modules(&self.cache, ctx) - } else { - cached_path.module_directory(module_name, &self.cache, ctx) - } - } - - fn load_package_exports( - &self, - specifier: &str, - subpath: &str, - cached_path: &CachedPath, - ctx: &mut Ctx, - ) -> ResolveResult { - // 2. If X does not match this pattern or DIR/NAME/package.json is not a file, - // return. - let Some(package_json) = cached_path.package_json(&self.cache.fs, &self.options, ctx)? - else { - return Ok(None); - }; - // 3. Parse DIR/NAME/package.json, and look for "exports" field. - // 4. If "exports" is null or undefined, return. - // 5. let MATCH = PACKAGE_EXPORTS_RESOLVE(pathToFileURL(DIR/NAME), "." + SUBPATH, - // `package.json` "exports", ["node", "require"]) defined in the ESM resolver. - // Note: The subpath is not prepended with a dot on purpose - for exports in package_json.exports_fields(&self.options.exports_fields) { - if let Some(path) = self.package_exports_resolve( - cached_path.path(), - &format!(".{subpath}"), - exports, - ctx, - )? { - // 6. RESOLVE_ESM_MATCH(MATCH) - return self.resolve_esm_match(specifier, &path, ctx); - }; - } - Ok(None) - } - - fn load_package_self( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - // 1. Find the closest package scope SCOPE to DIR. - // 2. If no scope was found, return. - let Some(package_json) = - cached_path.find_package_json(&self.cache.fs, &self.options, ctx)? - else { - return Ok(None); - }; - // 3. If the SCOPE/package.json "exports" is null or undefined, return. - // 4. If the SCOPE/package.json "name" is not the first segment of X, return. - if let Some(subpath) = package_json - .name - .as_ref() - .and_then(|package_name| Self::strip_package_name(specifier, package_name)) - { - // 5. let MATCH = PACKAGE_EXPORTS_RESOLVE(pathToFileURL(SCOPE), - // "." + X.slice("name".length), `package.json` "exports", ["node", "require"]) - // defined in the ESM resolver. - let package_url = package_json.directory(); - // Note: The subpath is not prepended with a dot on purpose - // because `package_exports_resolve` matches subpath without the leading dot. - for exports in package_json.exports_fields(&self.options.exports_fields) { - if let Some(cached_path) = - self.package_exports_resolve(package_url, &format!(".{subpath}"), exports, ctx)? - { - // 6. RESOLVE_ESM_MATCH(MATCH) - return self.resolve_esm_match(specifier, &cached_path, ctx); - } - } - } - self.load_browser_field(cached_path, Some(specifier), &package_json, ctx) - } - - /// RESOLVE_ESM_MATCH(MATCH) - fn resolve_esm_match( - &self, - specifier: &str, - cached_path: &CachedPath, - ctx: &mut Ctx, - ) -> ResolveResult { - // 1. let RESOLVED_PATH = fileURLToPath(MATCH) - // 2. If the file at RESOLVED_PATH exists, load RESOLVED_PATH as its extension format. STOP - // - // Non-compliant ESM can result in a directory, so directory is tried as well. - if let Some(path) = self.load_as_file_or_directory(cached_path, "", ctx)? { - return Ok(Some(path)); - } - // 3. THROW "not found" - Err(ResolveError::NotFound(specifier.to_string())) - } - - /// enhanced-resolve: AliasFieldPlugin for [ResolveOptions::alias_fields] - fn load_browser_field( - &self, - cached_path: &CachedPath, - module_specifier: Option<&str>, - package_json: &PackageJson, - ctx: &mut Ctx, - ) -> ResolveResult { - let path = cached_path.path(); - let Some(new_specifier) = package_json.resolve_browser_field( - path, - module_specifier, - &self.options.alias_fields, - )? - else { - return Ok(None); - }; - // Abort when resolving recursive module - if module_specifier.is_some_and(|s| s == new_specifier) { - return Ok(None); - } - if ctx.resolving_alias.as_ref().is_some_and(|s| s == new_specifier) { - // Complete when resolving to self `{"./a.js": "./a.js"}` - if new_specifier.strip_prefix("./").filter(|s| path.ends_with(Path::new(s))).is_some() { - return if cached_path.is_file(&self.cache.fs, ctx) { - Ok(Some(cached_path.clone())) - } else { - Err(ResolveError::NotFound(new_specifier.to_string())) - }; - } - return Err(ResolveError::Recursion); - } - ctx.with_resolving_alias(new_specifier.to_string()); - ctx.with_fully_specified(false); - let cached_path = self.cache.value(package_json.directory()); - self.require(&cached_path, new_specifier, ctx).map(Some) - } - - /// enhanced-resolve: AliasPlugin for [ResolveOptions::alias] and [ResolveOptions::fallback]. - fn load_alias( - &self, - cached_path: &CachedPath, - specifier: &str, - aliases: &Alias, - ctx: &mut Ctx, - ) -> ResolveResult { - for (alias_key_raw, specifiers) in aliases { - let alias_key = if let Some(alias_key) = alias_key_raw.strip_suffix('$') { - if alias_key != specifier { - continue; - } - alias_key - } else { - let strip_package_name = Self::strip_package_name(specifier, alias_key_raw); - if strip_package_name.is_none() { - continue; - } - alias_key_raw - }; - // It should stop resolving when all of the tried alias values - // failed to resolve. - // - let mut should_stop = false; - for r in specifiers { - match r { - AliasValue::Path(alias_value) => { - if let Some(path) = self.load_alias_value( - cached_path, - alias_key, - alias_value, - specifier, - ctx, - &mut should_stop, - )? { - return Ok(Some(path)); - } - } - AliasValue::Ignore => { - let path = cached_path.path().normalize_with(alias_key); - return Err(ResolveError::Ignored(path)); - } - } - } - if should_stop { - return Err(ResolveError::NotFound(specifier.to_string())); - } - } - Ok(None) - } - - fn load_alias_value( - &self, - cached_path: &CachedPath, - alias_key: &str, - alias_value: &str, - request: &str, - ctx: &mut Ctx, - should_stop: &mut bool, - ) -> ResolveResult { - if request != alias_value - && !request.strip_prefix(alias_value).is_some_and(|prefix| prefix.starts_with('/')) - { - let tail = &request[alias_key.len()..]; - - let new_specifier = if tail.is_empty() { - Cow::Borrowed(alias_value) - } else { - let alias_value = Path::new(alias_value).normalize(); - // Must not append anything to alias_value if it is a file. - let alias_value_cached_path = self.cache.value(&alias_value); - if alias_value_cached_path.is_file(&self.cache.fs, ctx) { - return Ok(None); - } - - // Remove the leading slash so the final path is concatenated. - let tail = tail.trim_start_matches(SLASH_START); - let normalized = alias_value.normalize_with(tail); - Cow::Owned(normalized.to_string_lossy().to_string()) - }; - - *should_stop = true; - ctx.with_fully_specified(false); - return match self.require(cached_path, new_specifier.as_ref(), ctx) { - Err(ResolveError::NotFound(_)) => Ok(None), - Ok(path) => return Ok(Some(path)), - Err(err) => return Err(err), - }; - } - Ok(None) - } - - /// Given an extension alias map `{".js": [".ts", "js"]}`, - /// load the mapping instead of the provided extension - /// - /// This is an enhanced-resolve feature - /// - /// # Errors - /// - /// * [ResolveError::ExtensionAlias]: When all of the aliased extensions are not found - fn load_extension_alias(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - let Some(path_extension) = cached_path.path().extension() else { - return Ok(None); - }; - let Some((_, extensions)) = self - .options - .extension_alias - .iter() - .find(|(ext, _)| OsStr::new(ext.trim_start_matches('.')) == path_extension) - else { - return Ok(None); - }; - let path = cached_path.path().with_extension(""); - ctx.with_fully_specified(false); - if let Some(path) = self.load_extensions(&path, extensions, ctx)? { - return Ok(Some(path)); - } - Err(ResolveError::ExtensionAlias) - } - - /// enhanced-resolve: RootsPlugin - /// - /// A list of directories where requests of server-relative URLs (starting with '/') are resolved, - /// defaults to context configuration option. - /// - /// On non-Windows systems these requests are resolved as an absolute path first. - fn load_roots(&self, specifier: &str, ctx: &mut Ctx) -> Option { - if !self.options.roots.is_empty() { - if let Some(specifier) = specifier.strip_prefix(SLASH_START) { - for root in &self.options.roots { - let cached_path = self.cache.value(root); - if let Ok(path) = self.require_relative(&cached_path, specifier, ctx) { - return Some(path); - } - } - } - } - None - } - - fn load_tsconfig_paths( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - let Some(tsconfig_options) = &self.options.tsconfig else { - return Ok(None); - }; - let tsconfig = self.load_tsconfig( - /* root */ true, - &tsconfig_options.config_file, - &tsconfig_options.references, - )?; - let paths = tsconfig.resolve(cached_path.path(), specifier); - for path in paths { - let cached_path = self.cache.value(&path); - if let Ok(path) = self.require_relative(&cached_path, ".", ctx) { - return Ok(Some(path)); - } - } - Ok(None) - } - - fn load_tsconfig( - &self, - root: bool, - path: &Path, - references: &TsconfigReferences, - ) -> Result, ResolveError> { - self.cache.tsconfig(root, path, |tsconfig| { - let directory = self.cache.value(tsconfig.directory()); - tracing::trace!(tsconfig = ?tsconfig, "load_tsconfig"); - - // Extend tsconfig - if let Some(extends) = &tsconfig.extends { - let extended_tsconfig_paths = match extends { - ExtendsField::Single(s) => { - vec![self.get_extended_tsconfig_path(&directory, tsconfig, s)?] - } - ExtendsField::Multiple(specifiers) => specifiers - .iter() - .map(|s| self.get_extended_tsconfig_path(&directory, tsconfig, s)) - .collect::, ResolveError>>()?, - }; - for extended_tsconfig_path in extended_tsconfig_paths { - let extended_tsconfig = self.load_tsconfig( - /* root */ false, - &extended_tsconfig_path, - &TsconfigReferences::Disabled, - )?; - tsconfig.extend_tsconfig(&extended_tsconfig); - } - } - - // Load project references - match references { - TsconfigReferences::Disabled => { - tsconfig.references.drain(..); - } - TsconfigReferences::Auto => {} - TsconfigReferences::Paths(paths) => { - tsconfig.references = paths - .iter() - .map(|path| ProjectReference { path: path.clone(), tsconfig: None }) - .collect(); - } - } - if !tsconfig.references.is_empty() { - let directory = tsconfig.directory().to_path_buf(); - for reference in &mut tsconfig.references { - let reference_tsconfig_path = directory.normalize_with(&reference.path); - let tsconfig = self.cache.tsconfig( - /* root */ true, - &reference_tsconfig_path, - |_| Ok(()), - )?; - reference.tsconfig.replace(tsconfig); - } - } - Ok(()) - }) - } - - fn get_extended_tsconfig_path( - &self, - directory: &CachedPath, - tsconfig: &TsConfig, - specifier: &str, - ) -> Result { - match specifier.as_bytes().first() { - None => Err(ResolveError::Specifier(SpecifierError::Empty(specifier.to_string()))), - Some(b'/') => Ok(PathBuf::from(specifier)), - Some(b'.') => Ok(tsconfig.directory().normalize_with(specifier)), - _ => self - .clone_with_options(ResolveOptions { - description_files: vec![], - extensions: vec![".json".into()], - main_files: vec!["tsconfig.json".into()], - ..ResolveOptions::default() - }) - .load_package_self_or_node_modules(directory, specifier, &mut Ctx::default()) - .map(|p| p.to_path_buf()) - .map_err(|err| match err { - ResolveError::NotFound(_) => { - ResolveError::TsconfigNotFound(PathBuf::from(specifier)) - } - _ => err, - }), - } - } - - /// PACKAGE_RESOLVE(packageSpecifier, parentURL) - fn package_resolve( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - let (package_name, subpath) = Self::parse_package_specifier(specifier); - - // 3. If packageSpecifier is a Node.js builtin module name, then - // 1. Return the string "node:" concatenated with packageSpecifier. - self.require_core(package_name)?; - - // 11. While parentURL is not the file system root, - for module_name in &self.options.modules { - for cached_path in std::iter::successors(Some(cached_path), |p| p.parent()) { - // 1. Let packageURL be the URL resolution of "node_modules/" concatenated with packageSpecifier, relative to parentURL. - let Some(cached_path) = self.get_module_directory(cached_path, module_name, ctx) - else { - continue; - }; - // 2. Set parentURL to the parent folder URL of parentURL. - let package_path = cached_path.path().normalize_with(package_name); - let cached_path = self.cache.value(&package_path); - // 3. If the folder at packageURL does not exist, then - // 1. Continue the next loop iteration. - if cached_path.is_dir(&self.cache.fs, ctx) { - // 4. Let pjson be the result of READ_PACKAGE_JSON(packageURL). - if let Some(package_json) = - cached_path.package_json(&self.cache.fs, &self.options, ctx)? - { - // 5. If pjson is not null and pjson.exports is not null or undefined, then - // 1. Return the result of PACKAGE_EXPORTS_RESOLVE(packageURL, packageSubpath, pjson.exports, defaultConditions). - for exports in package_json.exports_fields(&self.options.exports_fields) { - if let Some(path) = self.package_exports_resolve( - cached_path.path(), - &format!(".{subpath}"), - exports, - ctx, - )? { - return Ok(Some(path)); - } - } - // 6. Otherwise, if packageSubpath is equal to ".", then - if subpath == "." { - // 1. If pjson.main is a string, then - for main_field in package_json.main_fields(&self.options.main_fields) { - // 1. Return the URL resolution of main in packageURL. - let path = cached_path.path().normalize_with(main_field); - let cached_path = self.cache.value(&path); - if cached_path.is_file(&self.cache.fs, ctx) { - return Ok(Some(cached_path)); - } - } - } - } - let subpath = format!(".{subpath}"); - ctx.with_fully_specified(false); - return self.require(&cached_path, &subpath, ctx).map(Some); - } - } - } - - Err(ResolveError::NotFound(specifier.to_string())) - } - - /// PACKAGE_EXPORTS_RESOLVE(packageURL, subpath, exports, conditions) - fn package_exports_resolve( - &self, - package_url: &Path, - subpath: &str, - exports: &JSONValue, - ctx: &mut Ctx, - ) -> ResolveResult { - let conditions = &self.options.condition_names; - // 1. If exports is an Object with both a key starting with "." and a key not starting with ".", throw an Invalid Package Configuration error. - if let JSONValue::Object(map) = exports { - let mut has_dot = false; - let mut without_dot = false; - for key in map.keys() { - has_dot = has_dot || key.starts_with(|s| s == '.' || s == '#'); - without_dot = without_dot || !key.starts_with(|s| s == '.' || s == '#'); - if has_dot && without_dot { - return Err(ResolveError::InvalidPackageConfig( - package_url.join("package.json"), - )); - } - } - } - // 2. If subpath is equal to ".", then - // Note: subpath is not prepended with a dot when passed in. - if subpath == "." { - // enhanced-resolve appends query and fragment when resolving exports field - // https://github.com/webpack/enhanced-resolve/blob/a998c7d218b7a9ec2461fc4fddd1ad5dd7687485/lib/ExportsFieldPlugin.js#L57-L62 - // This is only need when querying the main export, otherwise ctx is passed through. - if ctx.query.is_some() || ctx.fragment.is_some() { - let query = ctx.query.clone().unwrap_or_default(); - let fragment = ctx.fragment.clone().unwrap_or_default(); - return Err(ResolveError::PackagePathNotExported( - format!("./{}{query}{fragment}", subpath.trim_start_matches('.')), - package_url.join("package.json"), - )); - } - // 1. Let mainExport be undefined. - let main_export = match exports { - // 2. If exports is a String or Array, or an Object containing no keys starting with ".", then - JSONValue::String(_) | JSONValue::Array(_) => { - // 1. Set mainExport to exports. - Some(exports) - } - // 3. Otherwise if exports is an Object containing a "." property, then - JSONValue::Object(map) => { - // 1. Set mainExport to exports["."]. - map.get(".").map_or_else( - || { - if map.keys().any(|key| key.starts_with("./") || key.starts_with('#')) { - None - } else { - Some(exports) - } - }, - Some, - ) - } - _ => None, - }; - // 4. If mainExport is not undefined, then - if let Some(main_export) = main_export { - // 1. Let resolved be the result of PACKAGE_TARGET_RESOLVE( packageURL, mainExport, null, false, conditions). - let resolved = self.package_target_resolve( - package_url, - ".", - main_export, - None, - /* is_imports */ false, - conditions, - ctx, - )?; - // 2. If resolved is not null or undefined, return resolved. - if let Some(path) = resolved { - return Ok(Some(path)); - } - } - } - // 3. Otherwise, if exports is an Object and all keys of exports start with ".", then - if let JSONValue::Object(exports) = exports { - // 1. Let matchKey be the string "./" concatenated with subpath. - // Note: `package_imports_exports_resolve` does not require the leading dot. - let match_key = &subpath; - // 2. Let resolved be the result of PACKAGE_IMPORTS_EXPORTS_RESOLVE( matchKey, exports, packageURL, false, conditions). - if let Some(path) = self.package_imports_exports_resolve( - match_key, - exports, - package_url, - /* is_imports */ false, - conditions, - ctx, - )? { - // 3. If resolved is not null or undefined, return resolved. - return Ok(Some(path)); - } - } - // 4. Throw a Package Path Not Exported error. - Err(ResolveError::PackagePathNotExported( - subpath.to_string(), - package_url.join("package.json"), - )) - } - - /// PACKAGE_IMPORTS_RESOLVE(specifier, parentURL, conditions) - fn package_imports_resolve( - &self, - specifier: &str, - package_json: &PackageJson, - ctx: &mut Ctx, - ) -> Result, ResolveError> { - // 1. Assert: specifier begins with "#". - debug_assert!(specifier.starts_with('#'), "{specifier}"); - // 2. If specifier is exactly equal to "#" or starts with "#/", then - // 1. Throw an Invalid Module Specifier error. - // 3. Let packageURL be the result of LOOKUP_PACKAGE_SCOPE(parentURL). - // 4. If packageURL is not null, then - - // 1. Let pjson be the result of READ_PACKAGE_JSON(packageURL). - // 2. If pjson.imports is a non-null Object, then - - // 1. Let resolved be the result of PACKAGE_IMPORTS_EXPORTS_RESOLVE( specifier, pjson.imports, packageURL, true, conditions). - let mut has_imports = false; - for imports in package_json.imports_fields(&self.options.imports_fields) { - if !has_imports { - has_imports = true; - // TODO: fill in test case for this case - if specifier == "#" || specifier.starts_with("#/") { - return Err(ResolveError::InvalidModuleSpecifier( - specifier.to_string(), - package_json.path.clone(), - )); - } - } - if let Some(path) = self.package_imports_exports_resolve( - specifier, - imports, - package_json.directory(), - /* is_imports */ true, - &self.options.condition_names, - ctx, - )? { - // 2. If resolved is not null or undefined, return resolved. - return Ok(Some(path)); - } - } - - // 5. Throw a Package Import Not Defined error. - if has_imports { - Err(ResolveError::PackageImportNotDefined( - specifier.to_string(), - package_json.path.clone(), - )) - } else { - Ok(None) - } - } - - /// PACKAGE_IMPORTS_EXPORTS_RESOLVE(matchKey, matchObj, packageURL, isImports, conditions) - fn package_imports_exports_resolve( - &self, - match_key: &str, - match_obj: &JSONMap, - package_url: &Path, - is_imports: bool, - conditions: &[String], - ctx: &mut Ctx, - ) -> ResolveResult { - // enhanced-resolve behaves differently, it throws - // Error: CachedPath to directories is not possible with the exports field (specifier was ./dist/) - if match_key.ends_with('/') { - return Ok(None); - } - // 1. If matchKey is a key of matchObj and does not contain "*", then - if !match_key.contains('*') { - // 1. Let target be the value of matchObj[matchKey]. - if let Some(target) = match_obj.get(match_key) { - // 2. Return the result of PACKAGE_TARGET_RESOLVE(packageURL, target, null, isImports, conditions). - return self.package_target_resolve( - package_url, - match_key, - target, - None, - is_imports, - conditions, - ctx, - ); - } - } - - let mut best_target = None; - let mut best_match = ""; - let mut best_key = ""; - // 2. Let expansionKeys be the list of keys of matchObj containing only a single "*", sorted by the sorting function PATTERN_KEY_COMPARE which orders in descending order of specificity. - // 3. For each key expansionKey in expansionKeys, do - for (expansion_key, target) in match_obj { - if expansion_key.starts_with("./") || expansion_key.starts_with('#') { - // 1. Let patternBase be the substring of expansionKey up to but excluding the first "*" character. - if let Some((pattern_base, pattern_trailer)) = expansion_key.split_once('*') { - // 2. If matchKey starts with but is not equal to patternBase, then - if match_key.starts_with(pattern_base) - // 1. Let patternTrailer be the substring of expansionKey from the index after the first "*" character. - && !pattern_trailer.contains('*') - // 2. If patternTrailer has zero length, or if matchKey ends with patternTrailer and the length of matchKey is greater than or equal to the length of expansionKey, then - && (pattern_trailer.is_empty() - || (match_key.len() >= expansion_key.len() - && match_key.ends_with(pattern_trailer))) - && Self::pattern_key_compare(best_key, expansion_key).is_gt() - { - // 1. Let target be the value of matchObj[expansionKey]. - best_target = Some(target); - // 2. Let patternMatch be the substring of matchKey starting at the index of the length of patternBase up to the length of matchKey minus the length of patternTrailer. - best_match = - &match_key[pattern_base.len()..match_key.len() - pattern_trailer.len()]; - best_key = expansion_key; - } - } else if expansion_key.ends_with('/') - && match_key.starts_with(expansion_key) - && Self::pattern_key_compare(best_key, expansion_key).is_gt() - { - // TODO: [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./dist/" in the "exports" field module resolution of the package at xxx/package.json. - best_target = Some(target); - best_match = &match_key[expansion_key.len()..]; - best_key = expansion_key; - } - } - } - if let Some(best_target) = best_target { - // 3. Return the result of PACKAGE_TARGET_RESOLVE(packageURL, target, patternMatch, isImports, conditions). - return self.package_target_resolve( - package_url, - best_key, - best_target, - Some(best_match), - is_imports, - conditions, - ctx, - ); - } - // 4. Return null. - Ok(None) - } - - /// PACKAGE_TARGET_RESOLVE(packageURL, target, patternMatch, isImports, conditions) - #[allow(clippy::too_many_arguments)] - fn package_target_resolve( - &self, - package_url: &Path, - target_key: &str, - target: &JSONValue, - pattern_match: Option<&str>, - is_imports: bool, - conditions: &[String], - ctx: &mut Ctx, - ) -> ResolveResult { - fn normalize_string_target<'a>( - target_key: &'a str, - target: &'a str, - pattern_match: Option<&'a str>, - package_url: &Path, - ) -> Result, ResolveError> { - let target = if let Some(pattern_match) = pattern_match { - if !target_key.contains('*') && !target.contains('*') { - // enhanced-resolve behaviour - // TODO: [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./dist/" in the "exports" field module resolution of the package at xxx/package.json. - if target_key.ends_with('/') && target.ends_with('/') { - Cow::Owned(format!("{target}{pattern_match}")) - } else { - return Err(ResolveError::InvalidPackageConfigDirectory( - package_url.join("package.json"), - )); - } - } else { - Cow::Owned(target.replace('*', pattern_match)) - } - } else { - Cow::Borrowed(target) - }; - Ok(target) - } - - match target { - // 1. If target is a String, then - JSONValue::String(target) => { - // 1. If target does not start with "./", then - if !target.starts_with("./") { - // 1. If isImports is false, or if target starts with "../" or "/", or if target is a valid URL, then - if !is_imports || target.starts_with("../") || target.starts_with('/') { - // 1. Throw an Invalid Package Target error. - return Err(ResolveError::InvalidPackageTarget( - target.to_string(), - target_key.to_string(), - package_url.join("package.json"), - )); - } - // 2. If patternMatch is a String, then - // 1. Return PACKAGE_RESOLVE(target with every instance of "*" replaced by patternMatch, packageURL + "/"). - let target = - normalize_string_target(target_key, target, pattern_match, package_url)?; - let package_url = self.cache.value(package_url); - // // 3. Return PACKAGE_RESOLVE(target, packageURL + "/"). - return self.package_resolve(&package_url, &target, ctx); - } - - // 2. If target split on "/" or "\" contains any "", ".", "..", or "node_modules" segments after the first "." segment, case insensitive and including percent encoded variants, throw an Invalid Package Target error. - // 3. Let resolvedTarget be the URL resolution of the concatenation of packageURL and target. - // 4. Assert: resolvedTarget is contained in packageURL. - // 5. If patternMatch is null, then - let target = - normalize_string_target(target_key, target, pattern_match, package_url)?; - if Path::new(target.as_ref()).is_invalid_exports_target() { - return Err(ResolveError::InvalidPackageTarget( - target.to_string(), - target_key.to_string(), - package_url.join("package.json"), - )); - } - let resolved_target = package_url.normalize_with(target.as_ref()); - // 6. If patternMatch split on "/" or "\" contains any "", ".", "..", or "node_modules" segments, case insensitive and including percent encoded variants, throw an Invalid Module Specifier error. - // 7. Return the URL resolution of resolvedTarget with every instance of "*" replaced with patternMatch. - let value = self.cache.value(&resolved_target); - return Ok(Some(value)); - } - // 2. Otherwise, if target is a non-null Object, then - JSONValue::Object(target) => { - // 1. If exports contains any index property keys, as defined in ECMA-262 6.1.7 Array Index, throw an Invalid Package Configuration error. - // 2. For each property p of target, in object insertion order as, - for (key, target_value) in target { - // 1. If p equals "default" or conditions contains an entry for p, then - if key == "default" || conditions.contains(key) { - // 1. Let targetValue be the value of the p property in target. - // 2. Let resolved be the result of PACKAGE_TARGET_RESOLVE( packageURL, targetValue, patternMatch, isImports, conditions). - let resolved = self.package_target_resolve( - package_url, - target_key, - target_value, - pattern_match, - is_imports, - conditions, - ctx, - ); - // 3. If resolved is equal to undefined, continue the loop. - if let Some(path) = resolved? { - // 4. Return resolved. - return Ok(Some(path)); - } - } - } - // 3. Return undefined. - return Ok(None); - } - // 3. Otherwise, if target is an Array, then - JSONValue::Array(targets) => { - // 1. If _target.length is zero, return null. - if targets.is_empty() { - // Note: return PackagePathNotExported has the same effect as return because there are no matches. - return Err(ResolveError::PackagePathNotExported( - pattern_match.unwrap_or(".").to_string(), - package_url.join("package.json"), - )); - } - // 2. For each item targetValue in target, do - for (i, target_value) in targets.iter().enumerate() { - // 1. Let resolved be the result of PACKAGE_TARGET_RESOLVE( packageURL, targetValue, patternMatch, isImports, conditions), continuing the loop on any Invalid Package Target error. - let resolved = self.package_target_resolve( - package_url, - target_key, - target_value, - pattern_match, - is_imports, - conditions, - ctx, - ); - - if resolved.is_err() && i == targets.len() { - return resolved; - } - - // 2. If resolved is undefined, continue the loop. - if let Ok(Some(path)) = resolved { - // 3. Return resolved. - return Ok(Some(path)); - } - } - // 3. Return or throw the last fallback resolution null return or error. - // Note: see `resolved.is_err() && i == targets.len()` - } - _ => {} - } - // 4. Otherwise, if target is null, return null. - Ok(None) - // 5. Otherwise throw an Invalid Package Target error. - } - - // Returns (module, subpath) - // https://github.com/nodejs/node/blob/8f0f17e1e3b6c4e58ce748e06343c5304062c491/lib/internal/modules/esm/resolve.js#L688 - fn parse_package_specifier(specifier: &str) -> (&str, &str) { - let mut separator_index = specifier.as_bytes().iter().position(|b| *b == b'/'); - // let mut valid_package_name = true; - // let mut is_scoped = false; - if specifier.starts_with('@') { - // is_scoped = true; - if separator_index.is_none() || specifier.is_empty() { - // valid_package_name = false; - } else if let Some(index) = &separator_index { - separator_index = specifier[*index + 1..] - .as_bytes() - .iter() - .position(|b| *b == b'/') - .map(|i| i + *index + 1); - } - } - let package_name = - separator_index.map_or(specifier, |separator_index| &specifier[..separator_index]); - - // TODO: https://github.com/nodejs/node/blob/8f0f17e1e3b6c4e58ce748e06343c5304062c491/lib/internal/modules/esm/resolve.js#L705C1-L714C1 - // Package name cannot have leading . and cannot have percent-encoding or - // \\ separators. - // if (RegExpPrototypeExec(invalidPackageNameRegEx, packageName) !== null) - // validPackageName = false; - - // if (!validPackageName) { - // throw new ERR_INVALID_MODULE_SPECIFIER( - // specifier, 'is not a valid package name', fileURLToPath(base)); - // } - let package_subpath = - separator_index.map_or("", |separator_index| &specifier[separator_index..]); - (package_name, package_subpath) - } - - /// PATTERN_KEY_COMPARE(keyA, keyB) - fn pattern_key_compare(key_a: &str, key_b: &str) -> Ordering { - if key_a.is_empty() { - return Ordering::Greater; - } - // 1. Assert: keyA ends with "/" or contains only a single "*". - debug_assert!(key_a.ends_with('/') || key_a.match_indices('*').count() == 1, "{key_a}"); - // 2. Assert: keyB ends with "/" or contains only a single "*". - debug_assert!(key_b.ends_with('/') || key_b.match_indices('*').count() == 1, "{key_b}"); - // 3. Let baseLengthA be the index of "*" in keyA plus one, if keyA contains "*", or the length of keyA otherwise. - let a_pos = key_a.chars().position(|c| c == '*'); - let base_length_a = a_pos.map_or(key_a.len(), |p| p + 1); - // 4. Let baseLengthB be the index of "*" in keyB plus one, if keyB contains "*", or the length of keyB otherwise. - let b_pos = key_b.chars().position(|c| c == '*'); - let base_length_b = b_pos.map_or(key_b.len(), |p| p + 1); - // 5. If baseLengthA is greater than baseLengthB, return -1. - if base_length_a > base_length_b { - return Ordering::Less; - } - // 6. If baseLengthB is greater than baseLengthA, return 1. - if base_length_b > base_length_a { - return Ordering::Greater; - } - // 7. If keyA does not contain "*", return 1. - if !key_a.contains('*') { - return Ordering::Greater; - } - // 8. If keyB does not contain "*", return -1. - if !key_b.contains('*') { - return Ordering::Less; - } - // 9. If the length of keyA is greater than the length of keyB, return -1. - if key_a.len() > key_b.len() { - return Ordering::Less; - } - // 10. If the length of keyB is greater than the length of keyA, return 1. - if key_b.len() > key_a.len() { - return Ordering::Greater; - } - // 11. Return 0. - Ordering::Equal - } - - fn strip_package_name<'a>(specifier: &'a str, package_name: &'a str) -> Option<&'a str> { - specifier - .strip_prefix(package_name) - .filter(|tail| tail.is_empty() || tail.starts_with(SLASH_START)) - } -} diff --git a/src/options.rs b/src/options.rs deleted file mode 100644 index f473a133..00000000 --- a/src/options.rs +++ /dev/null @@ -1,623 +0,0 @@ -use std::path::Path; -use std::{fmt, path::PathBuf}; - -/// Module Resolution Options -/// -/// Options are directly ported from [enhanced-resolve](https://github.com/webpack/enhanced-resolve#resolver-options). -/// -/// See [webpack resolve](https://webpack.js.org/configuration/resolve/) for information and examples -#[derive(Debug, Clone)] -pub struct ResolveOptions { - /// Path to TypeScript configuration file. - /// - /// Default `None` - pub tsconfig: Option, - - /// Create aliases to import or require certain modules more easily. - /// - /// An alias is used to replace a whole path or part of a path. - /// For example, to alias a commonly used `src/` folders: `vec![("@/src"), vec![AliasValue::Path("/path/to/src")]]` - /// - /// A trailing $ can also be added to the given object's keys to signify an exact match. - /// - /// See [webpack's `resolve.alias` documentation](https://webpack.js.org/configuration/resolve/#resolvealias) for a list of use cases. - pub alias: Alias, - - /// A list of alias fields in description files. - /// - /// Specify a field, such as `browser`, to be parsed according to [this specification](https://github.com/defunctzombie/package-browser-field-spec). - /// Can be a path to json object such as `["path", "to", "exports"]`. - /// - /// Default `[]` - pub alias_fields: Vec>, - - /// Condition names for exports field which defines entry points of a package. - /// - /// The key order in the exports field is significant. During condition matching, earlier entries have higher priority and take precedence over later entries. - /// - /// Default `[]` - pub condition_names: Vec, - - /// The JSON files to use for descriptions. (There was once a `bower.json`.) - /// - /// Default `["package.json"]` - pub description_files: Vec, - - /// Set to [EnforceExtension::Enabled] for [ESM Mandatory file extensions](https://nodejs.org/api/esm.html#mandatory-file-extensions). - /// - /// If `enforce_extension` is set to [EnforceExtension::Enabled], resolution will not allow extension-less files. - /// This means `require('./foo.js')` will resolve, while `require('./foo')` will not. - /// - /// The default value for `enforce_extension` is [EnforceExtension::Auto], which is changed upon initialization. - /// - /// It changes to [EnforceExtension::Enabled] if [ResolveOptions::extensions] contains an empty string; - /// otherwise, this value changes to [EnforceExtension::Disabled]. - /// - /// Explicitly set the value to [EnforceExtension::Disabled] to disable this automatic behavior. - /// - /// For reference, this behavior is aligned with `enhanced-resolve`. See . - pub enforce_extension: EnforceExtension, - - /// A list of exports fields in description files. - /// - /// Can be a path to a JSON object such as `["path", "to", "exports"]`. - /// - /// Default `[["exports"]]`. - pub exports_fields: Vec>, - - /// Fields from `package.json` which are used to provide the internal requests of a package - /// (requests starting with # are considered internal). - /// - /// Can be a path to a JSON object such as `["path", "to", "imports"]`. - /// - /// Default `[["imports"]]`. - pub imports_fields: Vec>, - - /// An object which maps extension to extension aliases. - /// - /// Default `{}` - pub extension_alias: Vec<(String, Vec)>, - - /// Attempt to resolve these extensions in order. - /// - /// If multiple files share the same name but have different extensions, - /// will resolve the one with the extension listed first in the array and skip the rest. - /// - /// All extensions must have a leading dot. - /// - /// Default `[".js", ".json", ".node"]` - pub extensions: Vec, - - /// Redirect module requests when normal resolving fails. - /// - /// Default `[]` - pub fallback: Alias, - - /// 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). - /// - /// See also webpack configuration [resolve.fullySpecified](https://webpack.js.org/configuration/module/#resolvefullyspecified) - /// - /// Default `false` - pub fully_specified: bool, - - /// A list of main fields in description files - /// - /// Default `["main"]`. - pub main_fields: Vec, - - /// The filename to be used while resolving directories. - /// - /// Default `["index"]` - pub main_files: Vec, - - /// A list of directories to resolve modules from, can be absolute path or folder name. - /// - /// Default `["node_modules"]` - pub modules: Vec, - - /// Resolve to a context instead of a file. - /// - /// Default `false` - pub resolve_to_context: bool, - - /// Prefer to resolve module requests as relative requests instead of using modules from node_modules directories. - /// - /// Default `false` - pub prefer_relative: bool, - - /// Prefer to resolve server-relative urls as absolute paths before falling back to resolve in ResolveOptions::roots. - /// - /// Default `false` - pub prefer_absolute: bool, - - /// A list of resolve restrictions to restrict the paths that a request can be resolved on. - /// - /// Default `[]` - pub restrictions: Vec, - - /// A list of directories where requests of server-relative URLs (starting with '/') are resolved. - /// On non-Windows systems these requests are resolved as an absolute path first. - /// - /// Default `[]` - pub roots: Vec, - - /// Whether to resolve symlinks to their symlinked location. - /// When enabled, symlinked resources are resolved to their real path, not their symlinked location. - /// Note that this may cause module resolution to fail when using tools that symlink packages (like npm link). - /// - /// Default `true` - pub symlinks: bool, - - /// Whether to parse [module.builtinModules](https://nodejs.org/api/module.html#modulebuiltinmodules) or not. - /// For example, "zlib" will throw [crate::ResolveError::Builtin] when set to true. - /// - /// Default `false` - pub builtin_modules: bool, -} - -impl ResolveOptions { - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// - /// let options = ResolveOptions::default().with_condition_names(&["bar"]); - /// assert_eq!(options.condition_names, vec!["bar".to_string()]) - /// ``` - #[must_use] - pub fn with_condition_names(mut self, names: &[&str]) -> Self { - self.condition_names = names.iter().map(ToString::to_string).collect::>(); - self - } - - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// - /// let options = ResolveOptions::default().with_builtin_modules(false); - /// assert_eq!(options.builtin_modules, false) - /// ``` - #[must_use] - pub fn with_builtin_modules(mut self, flag: bool) -> Self { - self.builtin_modules = flag; - self - } - - /// Adds a single root to the options - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_root("foo"); - /// assert_eq!(options.roots, vec![PathBuf::from("foo")]) - /// ``` - #[must_use] - pub fn with_root>(mut self, root: P) -> Self { - self.roots.push(root.as_ref().to_path_buf()); - self - } - - /// Adds a single extension to the list of extensions - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_extension("jsonc"); - /// assert!(options.extensions.contains(&"jsonc".to_string())); - /// ``` - #[must_use] - pub fn with_extension>(mut self, extension: S) -> Self { - self.extensions.push(extension.into()); - self - } - - /// Adds a single main field to the list of fields - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_main_field("something"); - /// assert!(options.main_fields.contains(&"something".to_string())); - /// ``` - #[must_use] - pub fn with_main_field>(mut self, field: S) -> Self { - self.main_fields.push(field.into()); - self - } - - /// Changes how the extension should be treated - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions, EnforceExtension}; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_force_extension(EnforceExtension::Enabled); - /// assert_eq!(options.enforce_extension, EnforceExtension::Enabled); - /// ``` - #[must_use] - pub fn with_force_extension(mut self, enforce_extension: EnforceExtension) -> Self { - self.enforce_extension = enforce_extension; - self - } - - /// Sets the value for [ResolveOptions::fully_specified] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_fully_specified(true); - /// assert_eq!(options.fully_specified, true); - /// ``` - #[must_use] - pub fn with_fully_specified(mut self, fully_specified: bool) -> Self { - self.fully_specified = fully_specified; - self - } - /// Sets the value for [ResolveOptions::prefer_relative] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_prefer_relative(true); - /// assert_eq!(options.prefer_relative, true); - /// ``` - #[must_use] - pub fn with_prefer_relative(mut self, flag: bool) -> Self { - self.prefer_relative = flag; - self - } - /// Sets the value for [ResolveOptions::prefer_absolute] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_prefer_absolute(true); - /// assert_eq!(options.prefer_absolute, true); - /// ``` - #[must_use] - pub fn with_prefer_absolute(mut self, flag: bool) -> Self { - self.prefer_absolute = flag; - self - } - - /// Changes the value of [ResolveOptions::symlinks] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// - /// let options = ResolveOptions::default().with_symbolic_link(false); - /// assert_eq!(options.symlinks, false); - /// ``` - #[must_use] - pub fn with_symbolic_link(mut self, flag: bool) -> Self { - self.symlinks = flag; - self - } - - /// Adds a module to [ResolveOptions::modules] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// - /// let options = ResolveOptions::default().with_module("module"); - /// assert!(options.modules.contains(&"module".to_string())); - /// ``` - #[must_use] - pub fn with_module>(mut self, module: M) -> Self { - self.modules.push(module.into()); - self - } - - /// Adds a main file to [ResolveOptions::main_files] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// - /// let options = ResolveOptions::default().with_main_file("foo"); - /// assert!(options.main_files.contains(&"foo".to_string())); - /// ``` - #[must_use] - pub fn with_main_file>(mut self, module: M) -> Self { - self.main_files.push(module.into()); - self - } - - pub(crate) fn sanitize(mut self) -> Self { - debug_assert!( - self.extensions.iter().filter(|e| !e.is_empty()).all(|e| e.starts_with('.')), - "All extensions must start with a leading dot" - ); - // Set `enforceExtension` to `true` when [ResolveOptions::extensions] contains an empty string. - // See - if self.enforce_extension == EnforceExtension::Auto { - if !self.extensions.is_empty() && self.extensions.iter().any(String::is_empty) { - self.enforce_extension = EnforceExtension::Enabled; - } else { - self.enforce_extension = EnforceExtension::Disabled; - } - } - self - } -} - -/// Value for [ResolveOptions::enforce_extension] -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -pub enum EnforceExtension { - Auto, - Enabled, - Disabled, -} - -impl EnforceExtension { - pub const fn is_auto(&self) -> bool { - matches!(self, Self::Auto) - } - - pub const fn is_enabled(&self) -> bool { - matches!(self, Self::Enabled) - } - - pub const fn is_disabled(&self) -> bool { - matches!(self, Self::Disabled) - } -} - -/// Alias for [ResolveOptions::alias] and [ResolveOptions::fallback] -pub type Alias = Vec<(String, Vec)>; - -/// Alias Value for [ResolveOptions::alias] and [ResolveOptions::fallback] -#[derive(Debug, Clone, Hash, PartialEq, Eq)] -pub enum AliasValue { - /// The path value - Path(String), - - /// The `false` value - Ignore, -} - -impl From for AliasValue -where - S: Into, -{ - fn from(value: S) -> Self { - Self::Path(value.into()) - } -} - -/// Value for [ResolveOptions::restrictions] -#[derive(Debug, Clone)] -pub enum Restriction { - Path(PathBuf), - RegExp(String), -} - -/// Tsconfig Options for [ResolveOptions::tsconfig] -/// -/// Derived from [tsconfig-paths-webpack-plugin](https://github.com/dividab/tsconfig-paths-webpack-plugin#options) -#[derive(Debug, Clone)] -pub struct TsconfigOptions { - /// Allows you to specify where to find the TypeScript configuration file. - /// You may provide - /// * a relative path to the configuration file. It will be resolved relative to cwd. - /// * an absolute path to the configuration file. - pub config_file: PathBuf, - - /// Support for Typescript Project References. - pub references: TsconfigReferences, -} - -/// Configuration for [TsconfigOptions::references] -#[derive(Debug, Clone)] -pub enum TsconfigReferences { - Disabled, - /// Use the `references` field from tsconfig of `config_file`. - Auto, - /// Manually provided relative or absolute path. - Paths(Vec), -} - -impl Default for ResolveOptions { - fn default() -> Self { - Self { - tsconfig: None, - alias: vec![], - alias_fields: vec![], - condition_names: vec![], - description_files: vec!["package.json".into()], - enforce_extension: EnforceExtension::Auto, - extension_alias: vec![], - exports_fields: vec![vec!["exports".into()]], - imports_fields: vec![vec!["imports".into()]], - extensions: vec![".js".into(), ".json".into(), ".node".into()], - fallback: vec![], - fully_specified: false, - main_fields: vec!["main".into()], - main_files: vec!["index".into()], - modules: vec!["node_modules".into()], - resolve_to_context: false, - prefer_relative: false, - prefer_absolute: false, - restrictions: vec![], - roots: vec![], - symlinks: true, - builtin_modules: false, - } - } -} - -// For tracing -impl fmt::Display for ResolveOptions { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - if let Some(tsconfig) = &self.tsconfig { - write!(f, "tsconfig:{tsconfig:?},")?; - } - if !self.alias.is_empty() { - write!(f, "alias:{:?},", self.alias)?; - } - if !self.alias_fields.is_empty() { - write!(f, "alias_fields:{:?},", self.alias_fields)?; - } - if !self.condition_names.is_empty() { - write!(f, "condition_names:{:?},", self.condition_names)?; - } - if self.enforce_extension.is_enabled() { - write!(f, "enforce_extension:{:?},", self.enforce_extension)?; - } - if !self.exports_fields.is_empty() { - write!(f, "exports_fields:{:?},", self.exports_fields)?; - } - if !self.imports_fields.is_empty() { - write!(f, "imports_fields:{:?},", self.imports_fields)?; - } - if !self.extension_alias.is_empty() { - write!(f, "extension_alias:{:?},", self.extension_alias)?; - } - if !self.extensions.is_empty() { - write!(f, "extensions:{:?},", self.extensions)?; - } - if !self.fallback.is_empty() { - write!(f, "fallback:{:?},", self.fallback)?; - } - if self.fully_specified { - write!(f, "fully_specified:{:?},", self.fully_specified)?; - } - if !self.main_fields.is_empty() { - write!(f, "main_fields:{:?},", self.main_fields)?; - } - if !self.main_files.is_empty() { - write!(f, "main_files:{:?},", self.main_files)?; - } - if !self.modules.is_empty() { - write!(f, "modules:{:?},", self.modules)?; - } - if self.resolve_to_context { - write!(f, "resolve_to_context:{:?},", self.resolve_to_context)?; - } - if self.prefer_relative { - write!(f, "prefer_relative:{:?},", self.prefer_relative)?; - } - if self.prefer_absolute { - write!(f, "prefer_absolute:{:?},", self.prefer_absolute)?; - } - if !self.restrictions.is_empty() { - write!(f, "restrictions:{:?},", self.restrictions)?; - } - if !self.roots.is_empty() { - write!(f, "roots:{:?},", self.roots)?; - } - if self.symlinks { - write!(f, "symlinks:{:?},", self.symlinks)?; - } - if self.builtin_modules { - write!(f, "builtin_modules:{:?},", self.builtin_modules)?; - } - Ok(()) - } -} - -#[cfg(test)] -mod test { - use super::{ - AliasValue, EnforceExtension, ResolveOptions, Restriction, TsconfigOptions, - TsconfigReferences, - }; - use std::path::PathBuf; - - #[test] - fn enforce_extension() { - assert!(EnforceExtension::Auto.is_auto()); - assert!(!EnforceExtension::Enabled.is_auto()); - assert!(!EnforceExtension::Disabled.is_auto()); - - assert!(!EnforceExtension::Auto.is_enabled()); - assert!(EnforceExtension::Enabled.is_enabled()); - assert!(!EnforceExtension::Disabled.is_enabled()); - - assert!(!EnforceExtension::Auto.is_disabled()); - assert!(!EnforceExtension::Enabled.is_disabled()); - assert!(EnforceExtension::Disabled.is_disabled()); - } - - #[test] - fn display() { - let options = ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: PathBuf::from("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - alias: vec![("a".into(), vec![AliasValue::Ignore])], - alias_fields: vec![vec!["browser".into()]], - condition_names: vec!["require".into()], - enforce_extension: EnforceExtension::Enabled, - extension_alias: vec![(".js".into(), vec![".ts".into()])], - exports_fields: vec![vec!["exports".into()]], - imports_fields: vec![vec!["imports".into()]], - fallback: vec![("fallback".into(), vec![AliasValue::Ignore])], - fully_specified: true, - resolve_to_context: true, - prefer_relative: true, - prefer_absolute: true, - restrictions: vec![Restriction::Path(PathBuf::from("restrictions"))], - roots: vec![PathBuf::from("roots")], - builtin_modules: true, - ..ResolveOptions::default() - }; - - let expected = r#"tsconfig:TsconfigOptions { config_file: "tsconfig.json", references: Auto },alias:[("a", [Ignore])],alias_fields:[["browser"]],condition_names:["require"],enforce_extension:Enabled,exports_fields:[["exports"]],imports_fields:[["imports"]],extension_alias:[(".js", [".ts"])],extensions:[".js", ".json", ".node"],fallback:[("fallback", [Ignore])],fully_specified:true,main_fields:["main"],main_files:["index"],modules:["node_modules"],resolve_to_context:true,prefer_relative:true,prefer_absolute:true,restrictions:[Path("restrictions")],roots:["roots"],symlinks:true,builtin_modules:true,"#; - assert_eq!(format!("{options}"), expected); - - let options = ResolveOptions { - alias: vec![], - alias_fields: vec![], - builtin_modules: false, - condition_names: vec![], - description_files: vec![], - enforce_extension: EnforceExtension::Disabled, - exports_fields: vec![], - extension_alias: vec![], - extensions: vec![], - fallback: vec![], - fully_specified: false, - imports_fields: vec![], - main_fields: vec![], - main_files: vec![], - modules: vec![], - prefer_absolute: false, - prefer_relative: false, - resolve_to_context: false, - restrictions: vec![], - roots: vec![], - symlinks: false, - tsconfig: None, - }; - - assert_eq!(format!("{options}"), ""); - } -} diff --git a/src/package_json.rs b/src/package_json.rs deleted file mode 100644 index 73901faa..00000000 --- a/src/package_json.rs +++ /dev/null @@ -1,207 +0,0 @@ -//! package.json definitions -//! -//! Code related to export field are copied from [Parcel's resolver](https://github.com/parcel-bundler/parcel/blob/v2/packages/utils/node-resolver-rs/src/package_json.rs) -use std::path::{Path, PathBuf}; - -use serde_json::Value as JSONValue; - -use crate::{path::PathUtil, ResolveError}; - -pub type JSONMap = serde_json::Map; - -/// Deserialized package.json -#[derive(Debug, Default)] -pub struct PackageJson { - /// Path to `package.json`. Contains the `package.json` filename. - pub path: PathBuf, - - /// Realpath to `package.json`. Contains the `package.json` filename. - pub realpath: PathBuf, - - /// The "name" field defines your package's name. - /// The "name" field can be used in addition to the "exports" field to self-reference a package using its name. - /// - /// - pub name: Option, - - raw_json: std::sync::Arc, -} - -impl PackageJson { - /// # Panics - /// # Errors - pub(crate) fn parse( - path: PathBuf, - realpath: PathBuf, - json: &str, - ) -> Result { - let mut raw_json: JSONValue = serde_json::from_str(json)?; - let mut package_json = Self::default(); - - if let Some(json_object) = raw_json.as_object_mut() { - // Remove large fields that are useless for pragmatic use. - #[cfg(feature = "package_json_raw_json_api")] - { - json_object.remove("description"); - json_object.remove("keywords"); - json_object.remove("scripts"); - json_object.remove("dependencies"); - json_object.remove("devDependencies"); - json_object.remove("peerDependencies"); - json_object.remove("optionalDependencies"); - } - - // Add name. - package_json.name = - json_object.get("name").and_then(|field| field.as_str()).map(ToString::to_string); - } - - package_json.path = path; - package_json.realpath = realpath; - package_json.raw_json = std::sync::Arc::new(raw_json); - Ok(package_json) - } - - fn get_value_by_path<'a>( - fields: &'a serde_json::Map, - path: &[String], - ) -> Option<&'a JSONValue> { - if path.is_empty() { - return None; - } - let mut value = fields.get(&path[0])?; - for key in path.iter().skip(1) { - if let Some(inner_value) = value.as_object().and_then(|o| o.get(key)) { - value = inner_value; - } else { - return None; - } - } - Some(value) - } - - /// Raw serde json value of `package.json`. - /// - /// This is currently used in Rspack for: - /// * getting the `sideEffects` field - /// * query in - search on GitHub indicates query on the `type` field. - /// - /// To reduce overall memory consumption, large fields that useless for pragmatic use are removed. - /// They are: `description`, `keywords`, `scripts`, - /// `dependencies` and `devDependencies`, `peerDependencies`, `optionalDependencies`. - #[cfg(feature = "package_json_raw_json_api")] - pub fn raw_json(&self) -> &std::sync::Arc { - &self.raw_json - } - - /// Directory to `package.json` - /// - /// # Panics - /// - /// * When the package.json path is misconfigured. - pub fn directory(&self) -> &Path { - debug_assert!(self.realpath.file_name().is_some_and(|x| x == "package.json")); - self.realpath.parent().unwrap() - } - - /// The "main" field defines the entry point of a package when imported by name via a node_modules lookup. Its value is a path. - /// - /// When a package has an "exports" field, this will take precedence over the "main" field when importing the package by name. - /// - /// Values are dynamically retrieved from [ResolveOptions::main_fields]. - /// - /// - pub(crate) fn main_fields<'a>( - &'a self, - main_fields: &'a [String], - ) -> impl Iterator + '_ { - main_fields - .iter() - .filter_map(|main_field| self.raw_json.get(main_field)) - .filter_map(|value| value.as_str()) - } - - /// The "exports" field allows defining the entry points of a package when imported by name loaded either via a node_modules lookup or a self-reference to its own name. - /// - /// - pub(crate) fn exports_fields<'a>( - &'a self, - exports_fields: &'a [Vec], - ) -> impl Iterator + '_ { - exports_fields.iter().filter_map(|object_path| { - self.raw_json - .as_object() - .and_then(|json_object| Self::get_value_by_path(json_object, object_path)) - }) - } - - /// In addition to the "exports" field, there is a package "imports" field to create private mappings that only apply to import specifiers from within the package itself. - /// - /// - pub(crate) fn imports_fields<'a>( - &'a self, - imports_fields: &'a [Vec], - ) -> impl Iterator + '_ { - imports_fields.iter().filter_map(|object_path| { - self.raw_json - .as_object() - .and_then(|json_object| Self::get_value_by_path(json_object, object_path)) - .and_then(|value| value.as_object()) - }) - } - - /// The "browser" field is provided by a module author as a hint to javascript bundlers or component tools when packaging modules for client side use. - /// Multiple values are configured by [ResolveOptions::alias_fields]. - /// - /// - fn browser_fields<'a>( - &'a self, - alias_fields: &'a [Vec], - ) -> impl Iterator + '_ { - alias_fields.iter().filter_map(|object_path| { - self.raw_json - .as_object() - .and_then(|json_object| Self::get_value_by_path(json_object, object_path)) - // Only object is valid, all other types are invalid - // https://github.com/webpack/enhanced-resolve/blob/3a28f47788de794d9da4d1702a3a583d8422cd48/lib/AliasFieldPlugin.js#L44-L52 - .and_then(|value| value.as_object()) - }) - } - - /// Resolve the request string for this package.json by looking at the `browser` field. - /// - /// # Errors - /// - /// * Returns [ResolveError::Ignored] for `"path": false` in `browser` field. - pub(crate) fn resolve_browser_field<'a>( - &'a self, - path: &Path, - request: Option<&str>, - alias_fields: &'a [Vec], - ) -> Result, ResolveError> { - for object in self.browser_fields(alias_fields) { - if let Some(request) = request { - if let Some(value) = object.get(request) { - return Self::alias_value(path, value); - } - } else { - let dir = self.path.parent().unwrap(); - for (key, value) in object { - let joined = dir.normalize_with(key); - if joined == path { - return Self::alias_value(path, value); - } - } - } - } - Ok(None) - } - - fn alias_value<'a>(key: &Path, value: &'a JSONValue) -> Result, ResolveError> { - match value { - JSONValue::String(value) => Ok(Some(value.as_str())), - JSONValue::Bool(b) if !b => Err(ResolveError::Ignored(key.to_path_buf())), - _ => Ok(None), - } - } -} diff --git a/src/path.rs b/src/path.rs deleted file mode 100644 index f66fdd76..00000000 --- a/src/path.rs +++ /dev/null @@ -1,132 +0,0 @@ -//! Path Utilities -//! -//! Code adapted from the following libraries -//! * [path-absolutize](https://docs.rs/path-absolutize) -//! * [normalize_path](https://docs.rs/normalize-path) -use std::path::{Component, Path, PathBuf}; - -pub const SLASH_START: &[char; 2] = &['/', '\\']; - -/// Extension trait to add path normalization to std's [`Path`]. -pub trait PathUtil { - /// Normalize this path without performing I/O. - /// - /// All redundant separator and up-level references are collapsed. - /// - /// However, this does not resolve links. - fn normalize(&self) -> PathBuf; - - /// Normalize with subpath assuming this path is normalized without performing I/O. - /// - /// All redundant separator and up-level references are collapsed. - /// - /// However, this does not resolve links. - fn normalize_with>(&self, subpath: P) -> PathBuf; - - /// Defined in ESM PACKAGE_TARGET_RESOLVE - /// If target split on "/" or "\" contains any "", ".", "..", or "node_modules" segments after the first "." segment, case insensitive and including percent encoded variants - fn is_invalid_exports_target(&self) -> bool; -} - -impl PathUtil for Path { - // https://github.com/parcel-bundler/parcel/blob/e0b99c2a42e9109a9ecbd6f537844a1b33e7faf5/packages/utils/node-resolver-rs/src/path.rs#L7 - fn normalize(&self) -> PathBuf { - let mut components = self.components().peekable(); - let mut ret = if let Some(c @ Component::Prefix(..)) = components.peek() { - let buf = PathBuf::from(c.as_os_str()); - components.next(); - buf - } else { - PathBuf::new() - }; - - for component in components { - match component { - Component::Prefix(..) => unreachable!("Path {:?}", self), - Component::RootDir => { - ret.push(component.as_os_str()); - } - Component::CurDir => {} - Component::ParentDir => { - ret.pop(); - } - Component::Normal(c) => { - ret.push(c); - } - } - } - - ret - } - - // https://github.com/parcel-bundler/parcel/blob/e0b99c2a42e9109a9ecbd6f537844a1b33e7faf5/packages/utils/node-resolver-rs/src/path.rs#L37 - fn normalize_with>(&self, subpath: B) -> PathBuf { - let subpath = subpath.as_ref(); - - let mut components = subpath.components(); - - let Some(head) = components.next() else { return subpath.to_path_buf() }; - - if matches!(head, Component::Prefix(..) | Component::RootDir) { - return subpath.to_path_buf(); - } - - let mut ret = self.to_path_buf(); - for component in std::iter::once(head).chain(components) { - match component { - Component::CurDir => {} - Component::ParentDir => { - ret.pop(); - } - Component::Normal(c) => { - ret.push(c); - } - Component::Prefix(..) | Component::RootDir => { - unreachable!("Path {:?} Subpath {:?}", self, subpath) - } - } - } - - ret - } - - fn is_invalid_exports_target(&self) -> bool { - self.components().enumerate().any(|(index, c)| match c { - Component::ParentDir => true, - Component::CurDir => index > 0, - Component::Normal(c) => c.eq_ignore_ascii_case("node_modules"), - _ => false, - }) - } -} - -// https://github.com/webpack/enhanced-resolve/blob/main/test/path.test.js -#[test] -fn is_invalid_exports_target() { - let test_cases = [ - "../a.js", - "../", - "./a/b/../../../c.js", - "./a/b/../../../", - "./../../c.js", - "./../../", - "./a/../b/../../c.js", - "./a/../b/../../", - "./././../", - ]; - - for case in test_cases { - assert!(Path::new(case).is_invalid_exports_target(), "{case}"); - } - - assert!(!Path::new("C:").is_invalid_exports_target()); - assert!(!Path::new("/").is_invalid_exports_target()); -} - -#[test] -fn normalize() { - assert_eq!(Path::new("/foo/.././foo/").normalize(), Path::new("/foo")); - assert_eq!(Path::new("C://").normalize(), Path::new("C://")); - assert_eq!(Path::new("C:").normalize(), Path::new("C:")); - assert_eq!(Path::new(r"\\server\share").normalize(), Path::new(r"\\server\share")); -} diff --git a/src/resolution.rs b/src/resolution.rs deleted file mode 100644 index a3aaa2e7..00000000 --- a/src/resolution.rs +++ /dev/null @@ -1,92 +0,0 @@ -use crate::package_json::PackageJson; -use std::{ - fmt, - path::{Path, PathBuf}, - sync::Arc, -}; - -/// The final path resolution with optional `?query` and `#fragment` -#[derive(Clone)] -pub struct Resolution { - pub(crate) path: PathBuf, - - /// path query `?query`, contains `?`. - pub(crate) query: Option, - - /// path fragment `#query`, contains `#`. - pub(crate) fragment: Option, - - pub(crate) package_json: Option>, -} - -impl fmt::Debug for Resolution { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - f.debug_struct("Resolution") - .field("path", &self.path) - .field("query", &self.query) - .field("fragment", &self.fragment) - .field("package_json", &self.package_json.as_ref().map(|p| &p.path)) - .finish() - } -} - -impl PartialEq for Resolution { - fn eq(&self, other: &Self) -> bool { - self.path == other.path && self.query == other.query && self.fragment == other.fragment - } -} -impl Eq for Resolution {} - -impl Resolution { - /// Returns the path without query and fragment - pub fn path(&self) -> &Path { - &self.path - } - - /// Returns the path without query and fragment - pub fn into_path_buf(self) -> PathBuf { - self.path - } - - /// Returns the path query `?query`, contains the leading `?` - pub fn query(&self) -> Option<&str> { - self.query.as_deref() - } - - /// Returns the path fragment `#fragment`, contains the leading `#` - pub fn fragment(&self) -> Option<&str> { - self.fragment.as_deref() - } - - /// Returns serialized package_json - pub fn package_json(&self) -> Option<&Arc> { - self.package_json.as_ref() - } - - /// Returns the full path with query and fragment - pub fn full_path(&self) -> PathBuf { - let mut path = self.path.clone().into_os_string(); - if let Some(query) = &self.query { - path.push(query); - } - if let Some(fragment) = &self.fragment { - path.push(fragment); - } - PathBuf::from(path) - } -} - -#[test] -fn test() { - let resolution = Resolution { - path: PathBuf::from("foo"), - query: Some("?query".to_string()), - fragment: Some("#fragment".to_string()), - package_json: None, - }; - assert_eq!(resolution.path(), Path::new("foo")); - assert_eq!(resolution.query(), Some("?query")); - assert_eq!(resolution.fragment(), Some("#fragment")); - assert_eq!(resolution.full_path(), PathBuf::from("foo?query#fragment")); - assert_eq!(resolution.into_path_buf(), PathBuf::from("foo")); -} diff --git a/src/specifier.rs b/src/specifier.rs deleted file mode 100644 index 73ed038c..00000000 --- a/src/specifier.rs +++ /dev/null @@ -1,230 +0,0 @@ -use crate::error::SpecifierError; -use std::borrow::Cow; - -#[derive(Debug)] -pub struct Specifier<'a> { - path: Cow<'a, str>, - pub query: Option<&'a str>, - pub fragment: Option<&'a str>, -} - -impl<'a> Specifier<'a> { - pub fn path(&'a self) -> &'a str { - self.path.as_ref() - } - - pub fn parse(specifier: &'a str) -> Result { - if specifier.is_empty() { - return Err(SpecifierError::Empty(specifier.to_string())); - } - let offset = match specifier.as_bytes()[0] { - b'/' | b'.' | b'#' => 1, - _ => 0, - }; - let (path, query, fragment) = Self::parse_query_framgment(specifier, offset); - if path.is_empty() { - return Err(SpecifierError::Empty(specifier.to_string())); - } - Ok(Self { path, query, fragment }) - } - - fn parse_query_framgment( - specifier: &'a str, - skip: usize, - ) -> (Cow<'a, str>, Option<&str>, Option<&str>) { - let mut query_start: Option = None; - let mut fragment_start: Option = None; - - let mut prev = specifier.chars().next().unwrap(); - let mut escaped_indexes = vec![]; - for (i, c) in specifier.char_indices().skip(skip) { - if c == '?' && query_start.is_none() { - query_start = Some(i); - } - if c == '#' { - if prev == '\0' { - escaped_indexes.push(i - 1); - } else { - fragment_start = Some(i); - break; - } - } - prev = c; - } - - let (path, query, fragment) = match (query_start, fragment_start) { - (Some(i), Some(j)) => { - debug_assert!(i < j); - (&specifier[..i], Some(&specifier[i..j]), Some(&specifier[j..])) - } - (Some(i), None) => (&specifier[..i], Some(&specifier[i..]), None), - (None, Some(j)) => (&specifier[..j], None, Some(&specifier[j..])), - _ => (specifier, None, None), - }; - - let path = if escaped_indexes.is_empty() { - Cow::Borrowed(path) - } else { - // Remove the `\0` characters for a legal path. - Cow::Owned( - path.chars() - .enumerate() - .filter_map(|(i, c)| (!escaped_indexes.contains(&i)).then_some(c)) - .collect::(), - ) - }; - - (path, query, fragment) - } -} - -#[cfg(test)] -mod tests { - use super::{Specifier, SpecifierError}; - - #[test] - fn debug() { - let specifier = Specifier::parse("/").unwrap(); - assert_eq!( - format!("{specifier:?}"), - r#"Specifier { path: "/", query: None, fragment: None }"# - ); - } - - #[test] - fn empty() { - let specifiers = ["", "?"]; - for specifier in specifiers { - let error = Specifier::parse(specifier).unwrap_err(); - assert_eq!(error, SpecifierError::Empty(specifier.to_string())); - } - } - - #[test] - fn absolute() -> Result<(), SpecifierError> { - let specifier = "/test?#"; - let parsed = Specifier::parse(specifier)?; - assert_eq!(parsed.path, "/test"); - assert_eq!(parsed.query, Some("?")); - assert_eq!(parsed.fragment, Some("#")); - Ok(()) - } - - #[test] - fn relative() -> Result<(), SpecifierError> { - let specifiers = ["./test", "../test", "../../test"]; - for specifier in specifiers { - let mut r = specifier.to_string(); - r.push_str("?#"); - let parsed = Specifier::parse(&r)?; - assert_eq!(parsed.path, specifier); - assert_eq!(parsed.query, Some("?")); - assert_eq!(parsed.fragment, Some("#")); - } - Ok(()) - } - - #[test] - fn hash() -> Result<(), SpecifierError> { - let specifiers = ["#", "#path"]; - for specifier in specifiers { - let mut r = specifier.to_string(); - r.push_str("?#"); - let parsed = Specifier::parse(&r)?; - assert_eq!(parsed.path, specifier); - assert_eq!(parsed.query, Some("?")); - assert_eq!(parsed.fragment, Some("#")); - } - Ok(()) - } - - #[test] - fn module() -> Result<(), SpecifierError> { - let specifiers = ["module"]; - for specifier in specifiers { - let mut r = specifier.to_string(); - r.push_str("?#"); - let parsed = Specifier::parse(&r)?; - assert_eq!(parsed.path, specifier); - assert_eq!(parsed.query, Some("?")); - assert_eq!(parsed.fragment, Some("#")); - } - Ok(()) - } - - #[test] - fn query_fragment() -> Result<(), SpecifierError> { - let data = [ - ("a?", Some("?"), None), - ("a?query", Some("?query"), None), - ("a?query1?query2", Some("?query1?query2"), None), - ("a?query1?query2?query3", Some("?query1?query2?query3"), None), - ("a#", None, Some("#")), - ("a#b#c", None, Some("#b#c")), - ("a#fragment", None, Some("#fragment")), - ("a?#", Some("?"), Some("#")), - ("a?#fragment", Some("?"), Some("#fragment")), - ("a?query#", Some("?query"), Some("#")), - ("a?query#fragment", Some("?query"), Some("#fragment")), - ("a#fragment?", None, Some("#fragment?")), - ("a#fragment?query", None, Some("#fragment?query")), - ]; - - for (specifier_str, query, fragment) in data { - let specifier = Specifier::parse(specifier_str)?; - assert_eq!(specifier.path, "a", "{specifier_str}"); - assert_eq!(specifier.query, query, "{specifier_str}"); - assert_eq!(specifier.fragment, fragment, "{specifier_str}"); - } - - Ok(()) - } - - #[test] - // https://github.com/webpack/enhanced-resolve/blob/main/test/identifier.test.js - fn enhanced_resolve_edge_cases() -> Result<(), SpecifierError> { - let data = [ - ("path/#", "path/", "", "#"), - ("path/as/?", "path/as/", "?", ""), - ("path/#/?", "path/", "", "#/?"), - ("path/#repo#hash", "path/", "", "#repo#hash"), - ("path/#r#hash", "path/", "", "#r#hash"), - ("path/#repo/#repo2#hash", "path/", "", "#repo/#repo2#hash"), - ("path/#r/#r#hash", "path/", "", "#r/#r#hash"), - ("path/#/not/a/hash?not-a-query", "path/", "", "#/not/a/hash?not-a-query"), - ]; - - for (specifier_str, path, query, fragment) in data { - let specifier = Specifier::parse(specifier_str)?; - assert_eq!(specifier.path, path, "{specifier_str}"); - assert_eq!(specifier.query.unwrap_or(""), query, "{specifier_str}"); - assert_eq!(specifier.fragment.unwrap_or(""), fragment, "{specifier_str}"); - } - - Ok(()) - } - - // https://github.com/webpack/enhanced-resolve/blob/main/test/identifier.test.js - #[test] - fn enhanced_resolve_windows_like() -> Result<(), SpecifierError> { - let data = [ - ("path\\#", "path\\", "", "#"), - ("path\\as\\?", "path\\as\\", "?", ""), - ("path\\#\\?", "path\\", "", "#\\?"), - ("path\\#repo#hash", "path\\", "", "#repo#hash"), - ("path\\#r#hash", "path\\", "", "#r#hash"), - ("path\\#repo\\#repo2#hash", "path\\", "", "#repo\\#repo2#hash"), - ("path\\#r\\#r#hash", "path\\", "", "#r\\#r#hash"), - ("path\\#/not/a/hash?not-a-query", "path\\", "", "#/not/a/hash?not-a-query"), - ]; - - for (specifier_str, path, query, fragment) in data { - let specifier = Specifier::parse(specifier_str)?; - assert_eq!(specifier.path, path, "{specifier_str}"); - assert_eq!(specifier.query.unwrap_or(""), query, "{specifier_str}"); - assert_eq!(specifier.fragment.unwrap_or(""), fragment, "{specifier_str}"); - } - - Ok(()) - } -} diff --git a/src/tests/alias.rs b/src/tests/alias.rs deleted file mode 100644 index 07c615f4..00000000 --- a/src/tests/alias.rs +++ /dev/null @@ -1,280 +0,0 @@ -//! - -use normalize_path::NormalizePath; -use std::path::Path; - -use crate::{AliasValue, Resolution, ResolveContext, ResolveError, ResolveOptions, Resolver}; - -#[test] -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -fn alias() { - use super::memory_fs::MemoryFS; - use crate::ResolverGeneric; - use std::path::{Path, PathBuf}; - - let f = Path::new("/"); - - let file_system = MemoryFS::new(&[ - ("/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", ""), - ("/dashed-name", ""), - ]); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - alias: vec![ - ("aliasA".into(), vec![AliasValue::from("a")]), - ("b$".into(), vec![AliasValue::from("a/index")]), - ("c$".into(), vec![AliasValue::from("/a/index")]), - ( - "multiAlias".into(), - vec![ - AliasValue::from("b"), - AliasValue::from("c"), - AliasValue::from("d"), - AliasValue::from("e"), - AliasValue::from("a"), - ], - ), - ("recursive".into(), vec![AliasValue::from("recursive/dir")]), - ("/d/dir".into(), vec![AliasValue::from("/c/dir")]), - ("/d/index.js".into(), vec![AliasValue::from("/c/index")]), - ("#".into(), vec![AliasValue::from("/c/dir")]), - ("@".into(), vec![AliasValue::from("/c/dir")]), - ("ignored".into(), vec![AliasValue::Ignore]), - // not part of enhanced-resolve, added to make sure query in alias value works - ("alias_query".into(), vec![AliasValue::from("a?query_after")]), - ("alias_fragment".into(), vec![AliasValue::from("a#fragment_after")]), - ("dash".into(), vec![AliasValue::Ignore]), - ("@scope/package-name/file$".into(), vec![AliasValue::from("/c/dir")]), - ], - modules: vec!["/".into()], - ..ResolveOptions::default() - }, - ); - - #[rustfmt::skip] - let pass = [ - ("should resolve a not aliased module 1", "a", "/a/index"), - ("should resolve a not aliased module 2", "a/index", "/a/index"), - ("should resolve a not aliased module 3", "a/dir", "/a/dir/index"), - ("should resolve a not aliased module 4", "a/dir/index", "/a/dir/index"), - ("should resolve an aliased module 1", "aliasA", "/a/index"), - ("should resolve an aliased module 2", "aliasA/index", "/a/index"), - ("should resolve an aliased module 3", "aliasA/dir", "/a/dir/index"), - ("should resolve an aliased module 4", "aliasA/dir/index", "/a/dir/index"), - ("should resolve '#' alias 1", "#", "/c/dir/index"), - ("should resolve '#' alias 2", "#/index", "/c/dir/index"), - ("should resolve '@' alias 1", "@", "/c/dir/index"), - ("should resolve '@' alias 2", "@/index", "/c/dir/index"), - ("should resolve a recursive aliased module 1", "recursive", "/recursive/dir/index"), - ("should resolve a recursive aliased module 2", "recursive/index", "/recursive/dir/index"), - ("should resolve a recursive aliased module 3", "recursive/dir", "/recursive/dir/index"), - ("should resolve a recursive aliased module 4", "recursive/dir/index", "/recursive/dir/index"), - ("should resolve a file aliased module 1", "b", "/a/index"), - ("should resolve a file aliased module 2", "c", "/a/index"), - ("should resolve a file aliased module with a query 1", "b?query", "/a/index?query"), - ("should resolve a file aliased module with a query 2", "c?query", "/a/index?query"), - ("should resolve a path in a file aliased module 1", "b/index", "/b/index"), - ("should resolve a path in a file aliased module 2", "b/dir", "/b/dir/index"), - ("should resolve a path in a file aliased module 3", "b/dir/index", "/b/dir/index"), - ("should resolve a path in a file aliased module 4", "c/index", "/c/index"), - ("should resolve a path in a file aliased module 5", "c/dir", "/c/dir/index"), - ("should resolve a path in a file aliased module 6", "c/dir/index", "/c/dir/index"), - ("should resolve a file aliased file 1", "d", "/c/index"), - ("should resolve a file aliased file 2", "d/dir/index", "/c/dir/index"), - ("should resolve a file in multiple aliased dirs 1", "multiAlias/dir/file", "/e/dir/file"), - ("should resolve a file in multiple aliased dirs 2", "multiAlias/anotherDir", "/e/anotherDir/index"), - // not part of enhanced-resolve, added to make sure query in alias value works - ("should resolve query in alias value", "alias_query?query_before", "/a/index?query_after"), - ("should resolve query in alias value", "alias_fragment#fragment_before", "/a/index#fragment_after"), - ("should resolve dashed name", "dashed-name", "/dashed-name"), - ("should resolve scoped package name with sub dir", "@scope/package-name/file", "/c/dir/index"), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - - #[rustfmt::skip] - let ignore = [ - ("should resolve an ignore module", "ignored", ResolveError::Ignored(f.join("ignored"))) - ]; - - for (comment, request, expected) in ignore { - let resolution = resolver.resolve(f, request); - assert_eq!(resolution, Err(expected), "{comment} {request}"); - } -} - -// Not part of enhanced-resolve -#[test] -fn infinite_recursion() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![ - ("./a".into(), vec![AliasValue::from("./b")]), - ("./b".into(), vec![AliasValue::from("./a")]), - ], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(f, "./a"); - assert_eq!(resolution, Err(ResolveError::Recursion)); -} - -fn check_slash(path: &Path) { - let s = path.to_string_lossy().to_string(); - #[cfg(target_os = "windows")] - { - assert!(!s.contains('/'), "{s}"); - assert!(s.contains('\\'), "{s}"); - } - #[cfg(not(target_os = "windows"))] - { - assert!(s.contains('/'), "{s}"); - assert!(!s.contains('\\'), "{s}"); - } -} - -#[test] -fn absolute_path() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![(f.join("foo").to_str().unwrap().to_string(), vec![AliasValue::Ignore])], - modules: vec![f.clone().to_str().unwrap().to_string()], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(&f, "foo/index"); - assert_eq!(resolution, Err(ResolveError::Ignored(f.join("foo")))); -} - -#[test] -fn system_path() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![("@app".into(), vec![AliasValue::from(f.join("alias").to_string_lossy())])], - ..ResolveOptions::default() - }); - - let specifiers = ["@app/files/a", "@app/files/a.js"]; - - for specifier in specifiers { - let path = resolver.resolve(&f, specifier).map(Resolution::into_path_buf).unwrap(); - assert_eq!(path, f.join("alias/files/a.js")); - check_slash(&path); - } -} - -#[test] -fn alias_is_full_path() { - let f = super::fixture(); - let dir = f.join("foo"); - let dir_str = dir.to_string_lossy().to_string(); - - let resolver = Resolver::new(ResolveOptions { - alias: vec![("@".into(), vec![AliasValue::Path(dir_str.clone())])], - ..ResolveOptions::default() - }); - - let mut ctx = ResolveContext::default(); - - let specifiers = [ - "@/index".to_string(), - "@/index.js".to_string(), - // specifier has multiple `/` for reasons we'll never know - "@////index".to_string(), - // specifier is a full path - dir_str, - ]; - - for specifier in specifiers { - let resolution = resolver.resolve_with_context(&f, &specifier, &mut ctx); - assert_eq!(resolution.map(|r| r.full_path()), Ok(dir.join("index.js"))); - } - - for path in ctx.file_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - check_slash(&path); - } - - for path in ctx.missing_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - check_slash(&path); - if let Some(path) = path.parent() { - assert!(!path.is_file(), "{path:?} must not be a file"); - } - } -} - -// For the `should_stop` variable in `load_alias` -#[test] -fn all_alias_values_are_not_found() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![( - "m1".to_string(), - vec![AliasValue::Path(f.join("node_modules").join("m2").to_string_lossy().to_string())], - )], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(&f, "m1/a.js"); - assert_eq!(resolution, Err(ResolveError::NotFound("m1/a.js".to_string()))); -} - -#[test] -fn alias_fragment() { - let f = super::fixture(); - - let data = [ - // enhanced-resolve has `#` prepended with a `\0`, they are removed from the - // following 3 expected test results. - // See https://github.com/webpack/enhanced-resolve#escaping - ( - "handle fragment edge case (no fragment)", - "./no#fragment/#/#", - f.join("no#fragment/#/#.js"), - ), - ("handle fragment edge case (fragment)", "./no#fragment/#/", f.join("no.js#fragment/#/")), - ( - "handle fragment escaping", - "./no\0#fragment/\0#/\0##fragment", - f.join("no#fragment/#/#.js#fragment"), - ), - ]; - - for (comment, request, expected) in data { - let resolver = Resolver::new(ResolveOptions { - alias: vec![("foo".to_string(), vec![AliasValue::Path(request.to_string())])], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f, "foo").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } -} - -#[test] -fn alias_try_fragment_as_path() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![( - "#".to_string(), - vec![AliasValue::Path(f.join("#").to_string_lossy().to_string())], - )], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(&f, "#/a").map(|r| r.full_path()); - assert_eq!(resolution, Ok(f.join("#").join("a.js"))); -} diff --git a/src/tests/browser_field.rs b/src/tests/browser_field.rs deleted file mode 100644 index 171ee099..00000000 --- a/src/tests/browser_field.rs +++ /dev/null @@ -1,189 +0,0 @@ -//! - -use crate::{AliasValue, ResolveError, ResolveOptions, Resolver}; - -#[test] -fn ignore() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![ - vec!["browser".into()], - vec!["innerBrowser1".into()], - vec!["innerBrowser2".into()], - vec![], - ], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - (f.clone(), "./lib/ignore", f.join("lib/ignore.js")), - (f.clone(), "./lib/ignore.js", f.join("lib/ignore.js")), - (f.join("lib"), "./ignore", f.join("lib/ignore.js")), - (f.join("lib"), "./ignore.js", f.join("lib/ignore.js")), - ]; - - for (path, request, expected) in data { - let resolution = resolver.resolve(&path, request); - let expected = ResolveError::Ignored(expected); - assert_eq!(resolution, Err(expected), "{path:?} {request}"); - } -} - -#[test] -fn shared_resolvers() { - let f = super::fixture().join("browser-module"); - - let resolver1 = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["innerBrowser1".into(), "field".into(), "browser".into()]], - ..ResolveOptions::default() - }); - let resolved_path = resolver1.resolve(&f, "./lib/main1.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("lib/main.js"))); - - let resolver2 = resolver1.clone_with_options(ResolveOptions { - alias_fields: vec![vec!["innerBrowser2".into(), "browser".into()]], - ..ResolveOptions::default() - }); - let resolved_path = resolver2.resolve(&f, "./lib/main2.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("./lib/replaced.js"))); -} - -#[test] -fn replace_file() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![ - vec!["browser".into()], - vec!["innerBrowser1".into(), "field2".into(), "browser".into()], // not presented - vec!["innerBrowser1".into(), "field".into(), "browser".into()], - vec!["innerBrowser2".into(), "browser".into()], - ], - // Not part of enhanced-resolve. Added to make sure no interaction between these two fields. - main_fields: vec!["browser".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - ("should replace a file 1", f.clone(), "./lib/replaced", f.join("lib/browser.js")), - ("should replace a file 2", f.clone(), "./lib/replaced.js", f.join("lib/browser.js")), - ("should replace a file 3", f.join("lib"), "./replaced", f.join("lib/browser.js")), - ("should replace a file 4", f.join("lib"), "./replaced.js", f.join("lib/browser.js")), - ("should replace a module with a file 1", f.clone(), "module-a", f.join("browser/module-a.js")), - ("should replace a module with a file 2", f.join("lib"), "module-a", f.join("browser/module-a.js")), - ("should replace a module with a module 1", f.clone(), "module-b", f.join("node_modules/module-c.js")), - ("should replace a module with a module 2", f.join("lib"), "module-b", f.join("node_modules/module-c.js")), - ("should resolve in nested property 1", f.clone(), "./lib/main1.js", f.join("lib/main.js")), - ("should resolve in nested property 2", f.clone(), "./lib/main2.js", f.join("lib/browser.js")), - ("should check only alias field properties", f.clone(), "./toString", f.join("lib/toString.js")), - // not part of enhanced-resolve - ("recursion", f.clone(), "module-c", f.join("node_modules/module-c.js")), - ("resolve self 1", f.clone(), "./lib/main.js", f.join("lib/main.js")), - ("resolve self 2", f.clone(), "./main.js", f.join("lib/main.js")), - ]; - - for (comment, path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn recurse_fail() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - ("recurse non existent", f.clone(), "./lib/non-existent.js", ResolveError::NotFound("./lib/non-existent.js".into())), - ("path partial match 1", f.clone(), "./xyz.js", ResolveError::NotFound("./xyz.js".into())), - ("path partial match 2", f, "./lib/xyz.js", ResolveError::NotFound("./lib/xyz.js".into())), - ]; - - for (comment, path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Err(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn broken() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - // The browser field string value should be ignored - (f.clone(), "browser-module-broken", Ok(f.join("node_modules/browser-module-broken/main.js"))), - (f.join("browser-module"), "./number", Err(ResolveError::NotFound("./number".into()))), - ]; - - for (path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, expected, "{path:?} {request}"); - } -} - -#[test] -fn crypto_js() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - fallback: vec![( - "crypto".into(), - vec![AliasValue::from(f.join("lib.js").to_string_lossy())], - )], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(f.join("crypto-js"), "crypto").map(|r| r.full_path()); - assert_eq!(resolved_path, Err(ResolveError::Ignored(f.join("crypto-js")))); -} - -// https://github.com/webpack/webpack/blob/87660921808566ef3b8796f8df61bd79fc026108/test/cases/resolving/browser-field/index.js#L40-L43 -#[test] -fn recursive() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - let data = [ - ("should handle recursive file 1", f.clone(), "recursive-file/a"), - ("should handle recursive file 2", f.clone(), "recursive-file/b"), - ("should handle recursive file 3", f.clone(), "recursive-file/c"), - ("should handle recursive file 4", f, "recursive-file/d"), - ]; - - for (comment, path, request) in data { - let resolved_path = resolver.resolve(&path, request); - assert_eq!(resolved_path, Err(ResolveError::Recursion), "{comment} {path:?} {request}"); - } -} - -#[test] -fn with_query() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "./foo").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("lib").join("browser.js?query"))); -} diff --git a/src/tests/builtins.rs b/src/tests/builtins.rs deleted file mode 100644 index 5d6d14d9..00000000 --- a/src/tests/builtins.rs +++ /dev/null @@ -1,121 +0,0 @@ -use std::path::Path; - -use crate::{ResolveError, ResolveOptions, Resolver}; - -#[test] -fn builtins_off() { - let f = Path::new("/"); - let resolver = Resolver::default(); - let resolved_path = resolver.resolve(f, "zlib").map(|r| r.full_path()); - assert_eq!(resolved_path, Err(ResolveError::NotFound("zlib".into()))); -} - -#[test] -fn builtins() { - let f = Path::new("/"); - - let resolver = Resolver::new(ResolveOptions::default().with_builtin_modules(true)); - - let pass = [ - "_http_agent", - "_http_client", - "_http_common", - "_http_incoming", - "_http_outgoing", - "_http_server", - "_stream_duplex", - "_stream_passthrough", - "_stream_readable", - "_stream_transform", - "_stream_wrap", - "_stream_writable", - "_tls_common", - "_tls_wrap", - "assert", - "assert/strict", - "async_hooks", - "buffer", - "child_process", - "cluster", - "console", - "constants", - "crypto", - "dgram", - "diagnostics_channel", - "dns", - "dns/promises", - "domain", - "events", - "fs", - "fs/promises", - "http", - "http2", - "https", - "inspector", - "module", - "net", - "os", - "path", - "path/posix", - "path/win32", - "perf_hooks", - "process", - "punycode", - "querystring", - "readline", - "repl", - "stream", - "stream/consumers", - "stream/promises", - "stream/web", - "string_decoder", - "sys", - "timers", - "timers/promises", - "tls", - "trace_events", - "tty", - "url", - "util", - "util/types", - "v8", - "vm", - "worker_threads", - "zlib", - ]; - - for request in pass { - let prefixed_request = format!("node:{request}"); - for request in [prefixed_request.clone(), request.to_string()] { - let resolved_path = resolver.resolve(f, &request).map(|r| r.full_path()); - let err = ResolveError::Builtin(prefixed_request.clone()); - assert_eq!(resolved_path, Err(err), "{request}"); - } - } -} - -#[test] -fn fail() { - let f = Path::new("/"); - let resolver = Resolver::new(ResolveOptions::default().with_builtin_modules(true)); - let request = "xxx"; - let resolved_path = resolver.resolve(f, request); - let err = ResolveError::NotFound(request.to_string()); - assert_eq!(resolved_path, Err(err), "{request}"); -} - -#[test] -fn imports() { - let f = super::fixture().join("builtins"); - let resolver = Resolver::new(ResolveOptions { - builtin_modules: true, - condition_names: vec!["node".into()], - ..ResolveOptions::default() - }); - - for request in ["#fs", "#http"] { - let resolved_path = resolver.resolve(f.clone(), request).map(|r| r.full_path()); - let err = ResolveError::Builtin(format!("node:{}", request.trim_start_matches('#'))); - assert_eq!(resolved_path, Err(err)); - } -} diff --git a/src/tests/dependencies.rs b/src/tests/dependencies.rs deleted file mode 100644 index bcc2355b..00000000 --- a/src/tests/dependencies.rs +++ /dev/null @@ -1,110 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/dependencies.test.js - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows { - use rustc_hash::FxHashSet; - use std::path::PathBuf; - - use crate::{ResolveContext, ResolveOptions, ResolverGeneric}; - - use super::super::memory_fs::MemoryFS; - - fn file_system() -> MemoryFS { - MemoryFS::new(&[ - ("/a/b/node_modules/some-module/index.js", ""), - ("/a/node_modules/module/package.json", r#"{"main":"entry.js"}"#), - ("/a/node_modules/module/file.js", r#"{"main":"entry.js"}"#), - ("/modules/other-module/file.js", ""), - ]) - } - - #[test] - fn test() { - let file_system = file_system(); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - extensions: vec![".json".into(), ".js".into()], - modules: vec!["/modules".into(), "node_modules".into()], - ..ResolveOptions::default() - }, - ); - - let data = [ - ( - "middle module request", - "/a/b/c", - "module/file", - "/a/node_modules/module/file.js", - // These dependencies are different from enhanced-resolve due to different code path to - // querying the file system - vec![ - // 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", - // "/", - ], - vec![ - // missing package.jsons - // "/a/b/c/package.json", - "/a/b/package.json", - "/a/package.json", - "/package.json", - // missing modules directories - "/a/b/c", - // "/a/b/c/node_modules", - // missing single file modules - "/modules/module", - "/a/b/node_modules/module", - // missing files with alternative extensions - "/a/node_modules/module/file", - "/a/node_modules/module/file.json", - ], - ), - ( - "fast found module", - "/a/b/c", - "other-module/file.js", - "/modules/other-module/file.js", - // These dependencies are different from enhanced-resolve due to different code path to - // querying the file system - vec![ - // symlink checks - "/modules/other-module/file.js", - // "/modules/other-module", - // "/modules", - // "/", - ], - vec![ - // missing package.jsons - // "/a/b/c/package.json", - "/a/b/c", - "/a/b/package.json", - "/a/package.json", - "/package.json", - "/modules/other-module/package.json", - "/modules/package.json", - ], - ), - ]; - - for (name, context, request, result, file_dependencies, missing_dependencies) in data { - let mut ctx = ResolveContext::default(); - let path = PathBuf::from(context); - let resolved = - resolver.resolve_with_context(path, request, &mut ctx).map(|r| r.full_path()); - assert_eq!(resolved, Ok(PathBuf::from(result))); - let file_dependencies = - FxHashSet::from_iter(file_dependencies.iter().map(PathBuf::from)); - let missing_dependencies = - FxHashSet::from_iter(missing_dependencies.iter().map(PathBuf::from)); - assert_eq!(ctx.file_dependencies, file_dependencies, "{name}"); - assert_eq!(ctx.missing_dependencies, missing_dependencies, "{name}"); - } - } -} diff --git a/src/tests/exports_field.rs b/src/tests/exports_field.rs deleted file mode 100644 index fd68c1f7..00000000 --- a/src/tests/exports_field.rs +++ /dev/null @@ -1,2546 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/exportsField.test.js -//! -//! The huge exports field test cases are at the bottom of this file. - -use crate::{Ctx, PathUtil, ResolveError, ResolveOptions, Resolver}; -use serde_json::json; -use std::path::Path; - -#[test] -fn test_simple() { - let f = super::fixture().join("exports-field"); - let f2 = super::fixture().join("exports-field2"); - let f4 = super::fixture().join("exports-field-error"); - let f5 = super::fixture().join("imports-exports-wildcard"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - fully_specified: true, - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("resolve root using exports field, not a main field", f.clone(), "exports-field", f.join("node_modules/exports-field/x.js")), - ("resolver should respect condition names", f.clone(), "exports-field/dist/main.js", f.join("node_modules/exports-field/lib/lib2/main.js")), - // enhanced_resolve behaves differently to node.js. enhanced_resolve fallbacks when an - // array item is unresolved, where as node.js fallbacks when an array has an - // InvalidPackageTarget error. - // ("resolver should respect fallback", f2.clone(), "exports-field/dist/browser.js", f2.join("node_modules/exports-field/lib/browser.js")), - // The following two tests require fallback from array values, the path is changed here to - // only test query and fragment. - ("resolver should respect query parameters #1", f2.clone(), "exports-field/dist/main.js?foo", f2.join("node_modules/exports-field/lib/lib2/main.js?foo")), - ("resolver should respect fragment parameters #1", f2.clone(), "exports-field/dist/main.js#foo", f2.join("node_modules/exports-field/lib/lib2/main.js#foo")), - ("relative path should work, if relative path as request is used", f.clone(), "./node_modules/exports-field/lib/main.js", f.join("node_modules/exports-field/lib/main.js")), - ("self-resolving root", f.clone(), "@exports-field/core", f.join("a.js")), - ("should resolve with wildcard pattern #1", f5.clone(), "m/features/f.js", f5.join("node_modules/m/src/features/f.js")), - ("should resolve with wildcard pattern #2", f5.clone(), "m/features/y/y.js", f5.join("node_modules/m/src/features/y/y.js")), - ("should resolve with wildcard pattern #3", f5.clone(), "m/features-no-ext/y/y.js", f5.join("node_modules/m/src/features/y/y.js")), - ("should resolve with wildcard pattern #4", f5.clone(), "m/middle/nested/f.js", f5.join("node_modules/m/src/middle/nested/f.js")), - ("should resolve with wildcard pattern #5", f5.clone(), "m/middle-1/nested/f.js", f5.join("node_modules/m/src/middle-1/nested/f.js")), - ("should resolve with wildcard pattern #6", f5.clone(), "m/middle-2/nested/f.js", f5.join("node_modules/m/src/middle-2/nested/f.js")), - ("should resolve with wildcard pattern #7", f5.clone(), "m/middle-3/nested/f", f5.join("node_modules/m/src/middle-3/nested/f/nested/f.js")), - ("should resolve with wildcard pattern #8", f5.clone(), "m/middle-4/f/nested", f5.join("node_modules/m/src/middle-4/f/f.js")), - ("should resolve with wildcard pattern #9", f5.clone(), "m/middle-5/f$/$", f5.join("node_modules/m/src/middle-5/f$/$.js")), - ]; - - // Not needed or snapshot: - // * should log the correct info - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } - - let p = f.join("node_modules/exports-field/package.json"); - let p2 = f2.join("node_modules/exports-field/package.json"); - let p4 = f4.join("node_modules/exports-field/package.json"); - let p5 = f5.join("node_modules/m/package.json"); - - #[rustfmt::skip] - let fail = [ - // ("throw error if extension not provided", f2.clone(), "exports-field/dist/main", ResolveError::NotFound(f2.join("node_modules/exports-field/lib/lib2/main"))), - ("resolver should respect query parameters #2. Direct matching", f2.clone(), "exports-field?foo", ResolveError::PackagePathNotExported("./?foo".into(), p2.clone())), - ("resolver should respect fragment parameters #2. Direct matching", f2, "exports-field#foo", ResolveError::PackagePathNotExported("./#foo".into(), p2)), - ("relative path should not work with exports field", f.clone(), "./node_modules/exports-field/dist/main.js", ResolveError::NotFound("./node_modules/exports-field/dist/main.js".into())), - ("backtracking should not work for request", f.clone(), "exports-field/dist/../../../a.js", ResolveError::InvalidPackageTarget("./lib/../../../a.js".to_string(), "./dist/".to_string(), p.clone())), - ("backtracking should not work for exports field target", f.clone(), "exports-field/dist/a.js", ResolveError::InvalidPackageTarget("./../../a.js".to_string(), "./dist/a.js".to_string(), p.clone())), - ("not exported error", f.clone(), "exports-field/anything/else", ResolveError::PackagePathNotExported("./anything/else".to_string(), p.clone())), - ("request ending with slash #1", f.clone(), "exports-field/", ResolveError::PackagePathNotExported("./".to_string(), p.clone())), - ("request ending with slash #2", f.clone(), "exports-field/dist/", ResolveError::PackagePathNotExported("./dist/".to_string(), p.clone())), - ("request ending with slash #3", f.clone(), "exports-field/lib/", ResolveError::PackagePathNotExported("./lib/".to_string(), p)), - ("should throw error if target is invalid", f4, "exports-field", ResolveError::InvalidPackageTarget("./a/../b/../../pack1/index.js".to_string(), ".".to_string(), p4)), - ("throw error if exports field is invalid", f.clone(), "invalid-exports-field", ResolveError::InvalidPackageConfig(f.join("node_modules/invalid-exports-field/package.json"))), - ("should throw error if target is 'null'", f5, "m/features/internal/file.js", ResolveError::PackagePathNotExported("./features/internal/file.js".to_string(), p5)), - ]; - - for (comment, path, request, error) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!(resolution, Err(error), "{comment} {path:?} {request}"); - } -} - -// resolve using exports field, not a browser field #1 -#[test] -fn exports_not_browser_field1() { - let f = super::fixture().join("exports-field"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - condition_names: vec!["webpack".into()], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "exports-field/dist/main.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("node_modules/exports-field/lib/lib2/main.js"))); -} - -// resolve using exports field and a browser alias field #2 -#[test] -fn exports_not_browser_field2() { - let f2 = super::fixture().join("exports-field2"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - extensions: vec![".js".into()], - condition_names: vec!["node".into()], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f2, "exports-field/dist/main.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f2.join("node_modules/exports-field/lib/browser.js"))); -} - -// should resolve extension without fullySpecified -#[test] -fn extension_without_fully_specified() { - let f2 = super::fixture().join("exports-field2"); - - let commonjs_resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - let resolved_path = - commonjs_resolver.resolve(&f2, "exports-field/dist/main").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f2.join("node_modules/exports-field/lib/lib2/main.js"))); -} - -#[test] -fn field_name_path() { - let f2 = super::fixture().join("exports-field2"); - let f3 = super::fixture().join("exports-field3"); - - // field name path #1 #2 #3 - let exports_fields = [ - vec![vec!["exportsField".into(), "exports".into()]], - vec![vec!["exportsField".into(), "exports".into()], vec!["exports".into()]], - vec![vec!["exports".into()], vec!["exportsField".into(), "exports".into()]], - ]; - - for exports_fields in exports_fields { - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - exports_fields, - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/main.js"))); - } - - // field name path #4 - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - exports_fields: vec![vec!["exports".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f2, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f2.join("node_modules/exports-field/index.js"))); - - // field name path #5 - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - exports_fields: vec![vec!["ex".into()], vec!["exports_field".into(), "exports".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/index"))); - - // non-compliant export targeting a directory - let resolver = Resolver::new(ResolveOptions { - exports_fields: vec![vec!["broken".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/src/index.js"))); -} - -#[test] -fn shared_resolvers() { - let f3 = super::fixture().join("exports-field3"); - - let resolver1 = Resolver::new(ResolveOptions { - exports_fields: vec![vec!["exportsField".into(), "exports".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver1.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/main.js"))); - - let resolver2 = resolver1.clone_with_options(ResolveOptions { - exports_fields: vec![vec!["ex".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver2.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/index"))); -} - -#[test] -fn extension_alias_1_2() { - let f = super::fixture().join("exports-field-and-extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - extension_alias: vec![(".js".into(), vec![".ts".into(), ".js".into()])], - fully_specified: true, - condition_names: vec!["webpack".into(), "default".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve with the `extensionAlias` option", f.clone(), "@org/pkg/string.js", f.join("node_modules/@org/pkg/dist/string.js")), - ("should resolve with the `extensionAlias` option #2", f.clone(), "pkg/string.js", f.join("node_modules/pkg/dist/string.js")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn extension_alias_3() { - let f = super::fixture().join("exports-field-and-extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - extension_alias: vec![( - ".js".into(), - vec![".foo".into(), ".baz".into(), ".baz".into(), ".ts".into(), ".js".into()], - )], - fully_specified: true, - condition_names: vec!["webpack".into(), "default".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve with the `extensionAlias` option #3", f.clone(), "pkg/string.js", f.join("node_modules/pkg/dist/string.js")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn extension_alias_throw_error() { - let f = super::fixture().join("exports-field-and-extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - extension_alias: vec![(".js".into(), vec![".ts".into()])], - fully_specified: true, - condition_names: vec!["webpack".into(), "default".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let fail = [ - // enhanced-resolve has two test cases that are exactly the same here - // https://github.com/webpack/enhanced-resolve/blob/a998c7d218b7a9ec2461fc4fddd1ad5dd7687485/test/exportsField.test.js#L2976-L3024 - ("should throw error with the `extensionAlias` option", f, "pkg/string.js", ResolveError::ExtensionAlias), - // TODO: The error is PackagePathNotExported in enhanced-resolve - // ("should throw error with the `extensionAlias` option", f.clone(), "pkg/string.js", ResolveError::PackagePathNotExported("node_modules/pkg/dist/string.ts".to_string())), - ]; - - for (comment, path, request, error) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!(resolution, Err(error), "{comment} {path:?} {request}"); - } -} - -// Small script for generating the test cases from enhanced-resolve -// for (c of testCases) { -// console.log("TestCase {") -// console.log(`name: ${JSON.stringify(c.name)},`) -// if (c.expect instanceof Error) { -// console.log(`expect: None,`) -// } else { -// console.log(`expect: Some(vec!${JSON.stringify(c.expect)}),`) -// } -// console.log(`exports_field: exports_field(json!(${JSON.stringify(c.suite[0], null, 2)})),`) -// console.log(`request: "${c.suite[1]}",`) -// console.log(`condition_names: vec!${JSON.stringify(c.suite[2])},`) -// console.log("},") -//} -struct TestCase { - name: &'static str, - expect: Option>, - exports_field: serde_json::Value, - request: &'static str, - condition_names: Vec<&'static str>, -} - -#[allow(clippy::needless_pass_by_value)] -fn exports_field(value: serde_json::Value) -> serde_json::Value { - value -} - -#[test] -fn test_cases() { - let test_cases = [ - TestCase { - name: "sample #1", - expect: Some(vec!["./dist/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/": { - "import": [ - "./dist/", - "./src/" - ], - "webpack": "./wp/" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "sample #1", - expect: Some(vec!["./src/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/": { - "import": [ - "./src/" - ], - "webpack": "./wp/" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - TestCase { - name: "sample #1 (wildcard)", - expect: Some(vec!["./dist/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/*": { - "import": [ - "./dist/*", - "./src/*" - ], - "webpack": "./wp/*" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "sample #1 (wildcard)", - expect: Some(vec!["./src/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/*": { - "import": [ - "./src/*" - ], - "webpack": "./wp/*" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - TestCase { - name: "sample #2", - expect: Some(vec!["./data/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./timezones/": "./data/timezones/" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #2 (wildcard)", - expect: Some(vec!["./data/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./timezones/*": "./data/timezones/*" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #3", - expect: Some(vec!["./data/timezones/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./": "./data/timezones/" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #3 (wildcard)", - expect: Some(vec!["./data/timezones/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./*": "./data/timezones/*.mjs" - })), - request: "./timezones/pdt", - condition_names: vec![], - }, - TestCase { - name: "sample #4", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./lib/": { - "browser": [ - "./browser/" - ] - }, - "./dist/index.js": { - "node": "./index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #4 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "node": "./index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #5", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/": { - "browser": [ - "./browser/" - ] - }, - "./dist/index.js": { - "node": "./index.js", - "default": "./browser/index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #5 (wildcard)", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "node": "./index.js", - "default": "./browser/index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./dist/a": "./dist/index.js" - })), - request: "./dist/aaa", - condition_names: vec![], - }, - TestCase { - name: "sample #7", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./dist/a/a/": "./dist/index.js" - })), - request: "./dist/a/a", - condition_names: vec![], - }, - TestCase { - name: "sample #7 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./dist/a/a/*": "./dist/index.js" - })), - request: "./dist/a/a", - condition_names: vec![], - }, - TestCase { - name: "sample #8", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": "./index.js" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #9", - expect: Some(vec!["./main.js"]), - exports_field: exports_field(json!({ - "./index.js": "./main.js" - })), - request: "./index.js", - condition_names: vec![], - }, - TestCase { - name: "sample #10", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #11", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./bar#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #12", - expect: Some(vec!["./ok.js#abc"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/ok.js#abc", - condition_names: vec![], - }, - TestCase { - name: "sample #12", - expect: Some(vec!["./ok.js#abc"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/ok.js#abc", - condition_names: vec![], - }, - TestCase { - name: "sample #13", - expect: Some(vec!["./ok.js?abc"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/ok.js?abc", - condition_names: vec![], - }, - TestCase { - name: "sample #14", - expect: Some(vec!["./🎉.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/🎉.js", - condition_names: vec![], - }, - TestCase { - name: "sample #15", - expect: Some(vec!["./%F0%9F%8E%89.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/%F0%9F%8E%89.js", - condition_names: vec![], - }, - TestCase { - name: "sample #16", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./🎉", - condition_names: vec![], - }, - TestCase { - name: "sample #17", - expect: Some(vec!["./other.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./%F0%9F%8E%89", - condition_names: vec![], - }, - TestCase { - name: "sample #18", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./module", - condition_names: vec![], - }, - TestCase { - name: "sample #19", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./module#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #20", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./module?foo", - condition_names: vec![], - }, - TestCase { - name: "sample #21", - expect: Some(vec!["./zizizi"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./z*z*z*" - })), - request: "./#zippi", - condition_names: vec![], - }, - TestCase { - name: "sample #22", - expect: Some(vec!["./d?e?f"]), - exports_field: exports_field(json!({ - "./a?b?c/": "./" - })), - request: "./a?b?c/d?e?f", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #1", - expect: Some(vec!["./dist/index.js"]), - exports_field: exports_field(json!({ - ".": "./dist/index.js" - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #2", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./": "./", - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #3", - expect: Some(vec!["./dist/a.js"]), - exports_field: exports_field(json!({ - "./dist/": "./dist/", - "./dist/*": "./dist/*", - "./dist*": "./dist*", - "./dist/index.js": "./dist/a.js" - })), - request: "./dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #4", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./": { - "browser": [ - "./browser/" - ] - }, - "./*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "browser": "./index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #5", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./": { - "browser": [ - "./browser/" - ] - }, - "./*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "node": "./node.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #6", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - ".": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #7", - expect: Some(vec!["./src/index.js"]), // `enhanced_resolve` is `None` - exports_field: exports_field(json!({ - ".": { - "default": "./src/index.js", - "browser": "./index.js", - "node": "./src/node/index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #8", - expect: Some(vec!["./src/index.js"]), - exports_field: exports_field(json!({ - ".": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #9", - expect: Some(vec!["./index"]), - exports_field: exports_field(json!({ - ".": "./index" - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #10", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./index": "./index.js" - })), - request: "./index", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #11", - expect: Some(vec!["./foo.js"]), - exports_field: exports_field(json!({ - "./": "./", - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #12", - expect: Some(vec!["./foo/bar/baz.js"]), - exports_field: exports_field(json!({ - "./": "./", - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo/bar/baz.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #13", - expect: Some(vec!["./foo/bar/baz.js"]), - exports_field: exports_field(json!({ - "./": "./", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo/bar/baz.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #14", - expect: Some(vec!["./foo/bar/baz.js"]), - exports_field: exports_field(json!({ - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo/bar/baz.js", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #1", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "require": "./require.js" - }, { - "import": "./import.mjs" - }] - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #2", - expect: Some(vec!["./import.mjs"]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "require": "./require.js" - }, { - "import": "./import.mjs" - }] - })), - request: ".", - condition_names: vec!["import"], - }, - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./require.js"]), - exports_field: exports_field(json!({ - ".": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./import.mjs"]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "import": "./import.mjs" - }] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./require.js"]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "require": [ - "./require.js" - ] - }, { - "import": [ - "./import.mjs", - "./import.js" - ] - }] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./import.mjs"]), - exports_field: exports_field(json!({ - ".": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "./import.mjs", - "./import.js" - ] - } - ] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./import.js"]), - exports_field: exports_field(json!({ - ".": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "./import.js" - ] - } - ] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "mapping to a folder root #1", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./timezones": "./data/timezones/" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #2", - expect: None, - exports_field: exports_field(json!({ - "./timezones/": "./data/timezones" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #3", - expect: Some(vec!["./data/timezones/pdt/index.mjs"]), - exports_field: exports_field(json!({ - "./timezones/pdt/": "./data/timezones/pdt/" - })), - request: "./timezones/pdt/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #3 (wildcard)", - expect: Some(vec!["./data/timezones/pdt/index.mjs"]), - exports_field: exports_field(json!({ - "./timezones/pdt/*": "./data/timezones/pdt/*" - })), - request: "./timezones/pdt/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #4", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./": "./timezones/" - })), - request: "./pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #4 (wildcard)", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./*": "./timezones/*" - })), - request: "./pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #5", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./": "./" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #5 (wildcard)", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./*": "./*" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #6", - expect: None, - exports_field: exports_field(json!({ - "./": "." - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #6 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "./*": "." - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #7", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": "./" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #7 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": "./*" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #1", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./": "./", - "./dist/": "./lib/" - })), - request: "./dist/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #1 (wildcard)", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./*": "./*", - "./dist/*": "./lib/*" - })), - request: "./dist/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #2", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/": "./dist/utils/", - "./dist/": "./lib/" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #2 (wildcard)", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/*": "./dist/utils/*", - "./dist/*": "./lib/*" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #3", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/index.js": "./dist/utils/index.js", - "./dist/utils/": "./dist/utils/index.mjs", - "./dist/": "./lib/" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #3 (wildcard)", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/index.js": "./dist/utils/index.js", - "./dist/utils/*": "./dist/utils/index.mjs", - "./dist/*": "./lib/*" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #4", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./": { - "browser": "./browser/" - }, - "./dist/": "./lib/" - })), - request: "./dist/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "the longest matching path prefix is prioritized #4 (wildcard)", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./*": { - "browser": "./browser/*" - }, - "./dist/*": "./lib/*" - })), - request: "./dist/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #1", - // `lodash/` does not start with './' so fallbacks to util - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "conditional mapping folder #1", - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": [ - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #1 (wildcard)", - // `lodash/` does not start with './' so fallbacks to util - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": [ - "lodash/*", - "./utils/*" - ], - "node": [ - "./utils-node/*" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "conditional mapping folder #1 (wildcard)", - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": [ - "./utils/*" - ], - "node": [ - "./utils-node/*" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #2", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./node/" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "conditional mapping folder #2 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "webpack": "./wpk/*", - "browser": [ - "lodash/*", - "./utils/*" - ], - "node": [ - "./node/*" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "conditional mapping folder #3", - expect: Some(vec!["./wpk/index.mjs"]), - exports_field: exports_field(json!({ - "./utils/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils/" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "conditional mapping folder #3 (wildcard)", - expect: Some(vec!["./wpk/index.mjs"]), - exports_field: exports_field(json!({ - "./utils/*": { - "webpack": "./wpk/*", - "browser": [ - "lodash/*", - "./utils/*" - ], - "node": [ - "./utils/*" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "incorrect exports field #1", - expect: None, - exports_field: exports_field(json!({ - "/utils/": "./a/" - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #2", - expect: None, - exports_field: exports_field(json!({ - "./utils/": "/a/" - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #3", - expect: None, - exports_field: exports_field(json!({ - "/utils/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #4", - expect: None, - exports_field: exports_field(json!({ - "./utils/": { - "browser": "/a/", - "default": "/b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #4 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "/a/", - "default": "/b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #5", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index": "./a/index.js" - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index.mjs": "./a/index.js" - })), - request: "./utils/index", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #7", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #8", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index.mjs": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - // Requests that are not `./` does not apply to `package_exports_resolve` - // TestCase { - // name: "incorrect request #1", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": "./a/" - // })), - // request: "/utils/index.mjs", - // condition_names: vec![], - // }, - // TestCase { - // name: "incorrect request #2", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": { - // "browser": "./a/", - // "default": "./b/" - // } - // })), - // request: "/utils/index.mjs", - // condition_names: vec!["browser"], - // }, - // TestCase { - // name: "incorrect request #3", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": { - // "browser": "./a/", - // "default": "./b/" - // } - // })), - // request: "../utils/index.mjs", - // condition_names: vec!["browser"], - // }, - // TestCase { - // name: "incorrect request #4", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": { - // "browser": "./a/", - // "default": "./b/" - // } - // })), - // request: "/utils/index.mjs/", - // condition_names: vec!["browser"], - // }, - TestCase { - name: "backtracking package base #1", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./../../utils/": "./dist/" - })), - request: "./../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #1 (wildcard)", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./../../utils/*": "./dist/*" - })), - request: "./../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #2", - expect: None, - exports_field: exports_field(json!({ - "../../utils/": "./dist/" - })), - request: "../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #2 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "../../utils/*": "./dist/*" - })), - request: "../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #3", - expect: None, - exports_field: exports_field(json!({ - "./utils/": "../src/" - })), - request: "./utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #3 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "./utils/*": "../src/*" - })), - request: "./utils/index", - condition_names: vec![], - }, - // enhanced-resolve does not handle backtracking here - // TestCase { - // name: "backtracking package base #4", - // expect: Some(vec!["./../src/index"]), - // exports_field: exports_field(json!({ - // "./utils/": "./../src/" - // })), - // request: "./utils/index", - // condition_names: vec![], - // }, - // TestCase { - // name: "backtracking package base #4 (wildcard)", - // expect: Some(vec!["./../src/index"]), - // exports_field: exports_field(json!({ - // "./utils/*": "./../src/*" - // })), - // request: "./utils/index", - // condition_names: vec![], - // }, - // TestCase { - // name: "backtracking package base #5", - // expect: Some(vec!["./src/../index.js"]), - // exports_field: exports_field(json!({ - // "./utils/index": "./src/../index.js" - // })), - // request: "./utils/index", - // condition_names: vec![], - // }, - TestCase { - name: "backtracking package base #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/../utils/index": "./src/../index.js" - })), - request: "./utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #7", - expect: None, - exports_field: exports_field(json!({ - "./utils/": { - "browser": "../this/" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #7", - expect: None, - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "../this/*" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #8", - // We throw "InvalidPackageTarget" - // expect: Some(vec!["./utils/../index"]), - expect: None, - exports_field: exports_field(json!({ - "./utils/": { - "browser": "./utils/../" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #8 (wildcard)", - // We throw "InvalidPackageTarget" - // expect: Some(vec!["./utils/../index"]), - expect: None, - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "./utils/../*" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #9", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./": "./src/../../", - "./dist/": "./dist/" - })), - request: "./dist/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #9 (wildcard)", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./*": "./src/../../*", - "./dist/*": "./dist/*" - })), - request: "./dist/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking target folder #1", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../../index"]), - exports_field: exports_field(json!({ - "./utils/": "./dist/" - })), - request: "./utils/timezone/../../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #1 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../../index"]), - exports_field: exports_field(json!({ - "./utils/*": "./dist/*" - })), - request: "./utils/timezone/../../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #2", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../index"]), - exports_field: exports_field(json!({ - "./utils/": "./dist/" - })), - request: "./utils/timezone/../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #2 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../index"]), - exports_field: exports_field(json!({ - "./utils/*": "./dist/*" - })), - request: "./utils/timezone/../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #3", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/target/../../index"]), - exports_field: exports_field(json!({ - "./utils/": "./dist/target/" - })), - request: "./utils/../../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #3 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/target/../../index"]), - exports_field: exports_field(json!({ - "./utils/*": "./dist/target/*" - })), - request: "./utils/../../index", - condition_names: vec![], - }, - // enhanced-resolve does not handle `node_modules` in target - TestCase { - name: "nested node_modules path #1", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": "./node_modules/" - } - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #1 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "./node_modules/*" - } - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #2", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./utils/../node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/": "./utils/../node_modules/" - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "nested node_modules path #2 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./utils/../node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": "./utils/../node_modules/*" - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "nested mapping #1", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": "./", - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested mapping #1 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": "./*", - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "nested mapping #2 (wildcard)", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #2 (wildcard)", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "nested mapping #3", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["webpack"], - }, - TestCase { - name: "nested mapping #3 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["webpack"], - }, - TestCase { - name: "nested mapping #4", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["node", "browser"], - }, - TestCase { - name: "nested mapping #4 (wildcard)", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["node", "browser"], - }, - TestCase { - name: "nested mapping #5", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node"], - }, - TestCase { - name: "nested mapping #5 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": { - "webpack": [ - "./wpck/*" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node"], - }, - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - TestCase { - name: "nested mapping #6 (wildcard)", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": { - "webpack": [ - "./wpck/*" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #6 (wildcard)", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./node/*" - ], - "default": { - "node": { - "webpack": [ - "./wpck/*" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - TestCase { - name: "nested mapping #7", - expect: Some(vec!["./y.js"]), - exports_field: exports_field(json!({ - "./a.js": { - "abc": { - "def": "./x.js" - }, - "ghi": "./y.js" - } - })), - request: "./a.js", - condition_names: vec!["abc", "ghi"], - }, - TestCase { - name: "nested mapping #8", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./a.js": { - "abc": { - "def": "./x.js", - "default": [] - }, - "ghi": "./y.js" - } - })), - request: "./a.js", - condition_names: vec!["abc", "ghi"], - }, - TestCase { - name: "syntax sugar #1", - expect: Some(vec!["./main.js"]), - exports_field: exports_field(json!("./main.js")), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #2", - expect: Some(vec![]), - exports_field: exports_field(json!("./main.js")), - request: "./lib.js", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #3", - expect: Some(vec!["./a.js"]), - exports_field: exports_field(json!(["./a.js", "./b.js"])), - request: ".", - condition_names: vec![], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "syntax sugar #3", - expect: Some(vec!["./b.js"]), - exports_field: exports_field(json!(["./b.js"])), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #4", - expect: Some(vec![]), - exports_field: exports_field(json!(["./a.js", "./b.js"])), - request: "./lib.js", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #5", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "browser": { - "default": "./index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "syntax sugar #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "browser": { - "default": "./index.js" - } - })), - request: "./lib.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "syntax sugar #7", - expect: None, - exports_field: exports_field(json!({ - "./node": "./node.js", - "browser": { - "default": "./index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "syntax sugar #8", - expect: None, - exports_field: exports_field(json!({ - "browser": { - "default": "./index.js" - }, - "./node": "./node.js" - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #1", - expect: Some(vec!["./abc/d"]), - exports_field: exports_field(json!({ - "./ab*": "./ab/*", - "./abc*": "./abc/*", - "./a*": "./a/*" - })), - request: "./abcd", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #2", - expect: Some(vec!["./abc/d/e"]), - exports_field: exports_field(json!({ - "./ab*": "./ab/*", - "./abc*": "./abc/*", - "./a*": "./a/*" - })), - request: "./abcd/e", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #3", - expect: Some(vec!["./abc/d"]), - exports_field: exports_field(json!({ - "./x/ab*": "./ab/*", - "./x/abc*": "./abc/*", - "./x/a*": "./a/*" - })), - request: "./x/abcd", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #4", - expect: Some(vec!["./abc/d/e"]), - exports_field: exports_field(json!({ - "./x/ab*": "./ab/*", - "./x/abc*": "./abc/*", - "./x/a*": "./a/*" - })), - request: "./x/abcd/e", - condition_names: vec!["browser"], - }, - TestCase { - name: "path tree edge case #1", - expect: Some(vec!["./A/b/d.js"]), - exports_field: exports_field(json!({ - "./a/": "./A/", - "./a/b/c": "./c.js" - })), - request: "./a/b/d.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #1 (wildcard)", - expect: Some(vec!["./A/b/d.js"]), - exports_field: exports_field(json!({ - "./a/*": "./A/*", - "./a/b/c": "./c.js" - })), - request: "./a/b/d.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #2", - expect: Some(vec!["./A/c.js"]), - exports_field: exports_field(json!({ - "./a/": "./A/", - "./a/b": "./b.js" - })), - request: "./a/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #2 (wildcard)", - expect: Some(vec!["./A/c.js"]), - exports_field: exports_field(json!({ - "./a/*": "./A/*", - "./a/b": "./b.js" - })), - request: "./a/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #3", - expect: Some(vec!["./A/b/d/c.js"]), - exports_field: exports_field(json!({ - "./a/": "./A/", - "./a/b/c/d": "./c.js" - })), - request: "./a/b/d/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #3 (wildcard)", - expect: Some(vec!["./A/b/d/c.js"]), - exports_field: exports_field(json!({ - "./a/*": "./A/*", - "./a/b/c/d": "./c.js" - })), - request: "./a/b/d/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #1", - expect: Some(vec!["./A/b.js"]), - exports_field: exports_field(json!({ - "./a/*.js": "./A/*.js" - })), - request: "./a/b.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #2", - expect: Some(vec!["./A/b/c.js"]), - exports_field: exports_field(json!({ - "./a/*.js": "./A/*.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #3", - expect: Some(vec!["./A/b/c.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": "./A/*/c.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #4", - expect: Some(vec!["./A/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": "./A/*/*.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #5", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/*.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #5", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/*.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./lib/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #6", - expect: Some(vec!["./browser/foo/bar.js"]), - exports_field: exports_field(json!({ - "./lib/*/bar.js": { - "browser": [ - "./browser/*/bar.js" - ] - }, - "./dist/*/bar.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./lib/foo/bar.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #6", - expect: Some(vec!["./browser/foo.js"]), - exports_field: exports_field(json!({ - "./lib/*/bar.js": { - "browser": [ - "./browser/*/bar.js" - ] - }, - "./dist/*/bar.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./dist/foo/bar.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #7", - expect: Some(vec!["./browser/foo/default.js"]), - exports_field: exports_field(json!({ - "./lib/*/bar.js": { - "browser": [ - "./browser/*/bar.js" - ] - }, - "./dist/*/bar.js": { - "node": "./*.js", - "default": "./browser/*/default.js" - } - })), - request: "./dist/foo/bar.js", - condition_names: vec!["default"], - }, - TestCase { - name: "wildcard pattern #8", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": "./A/*/*/*.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #9", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": [ - "./A/*/*/*.js", - "./B/*/*/*.js" - ] - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "wildcard pattern #9", - expect: Some(vec!["./B/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": [ - "./B/*/*/*.js" - ] - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #10", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/foo-*/c.js": "./A/*/*/*.js" - })), - request: "./a/foo-b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #11", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*-foo/c.js": "./A/*/*/*.js" - })), - request: "./a/b-foo/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #12", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/foo-*-foo/c.js": "./A/*/*/*.js" - })), - request: "./a/foo-b-foo/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #13", - expect: Some(vec!["./A/b/c/d.js"]), - exports_field: exports_field(json!({ - "./a/foo-*-foo/c.js": "./A/b/c/d.js" - })), - request: "./a/foo-b-foo/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #14", - expect: Some(vec!["./A/b/c/*.js"]), - exports_field: exports_field(json!({ - "./a/foo-foo/c.js": "./A/b/c/*.js" - })), - request: "./a/foo-foo/c.js", - condition_names: vec![], - }, - ]; - - for case in test_cases { - let resolved = Resolver::new(ResolveOptions { - condition_names: case - .condition_names - .iter() - .map(ToString::to_string) - .collect::>(), - ..ResolveOptions::default() - }) - .package_exports_resolve( - Path::new(""), - case.request, - &case.exports_field, - &mut Ctx::default(), - ) - .map(|p| p.map(|p| p.to_path_buf())); - if let Some(expect) = case.expect { - if expect.is_empty() { - assert!( - matches!(resolved, Err(ResolveError::PackagePathNotExported(_, _))), - "{} {:?}", - &case.name, - &resolved - ); - } else { - for expect in expect { - assert_eq!(resolved, Ok(Some(Path::new(expect).normalize())), "{}", &case.name); - } - } - } else { - assert!(resolved.is_err(), "{} {resolved:?}", &case.name); - } - } -} diff --git a/src/tests/extension_alias.rs b/src/tests/extension_alias.rs deleted file mode 100644 index 86afab73..00000000 --- a/src/tests/extension_alias.rs +++ /dev/null @@ -1,66 +0,0 @@ -//! - -use crate::{ResolveError, ResolveOptions, Resolver}; - -#[test] -fn extension_alias() { - let f = super::fixture().join("extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - extension_alias: vec![ - (".js".into(), vec![".ts".into(), ".js".into()]), - (".mjs".into(), vec![".mts".into()]), - ], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should alias fully specified file", f.clone(), "./index.js", f.join("index.ts")), - ("should alias fully specified file when there are two alternatives", f.clone(), "./dir/index.js", f.join("dir/index.ts")), - ("should also allow the second alternative", f.clone(), "./dir2/index.js", f.join("dir2/index.js")), - ("should support alias option without an array", f.clone(), "./dir2/index.mjs", f.join("dir2/index.mts")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } - - #[rustfmt::skip] - let fail = [ - ("should not allow to fallback to the original extension or add extensions", f, "./index.mjs"), - ]; - - for (comment, path, request) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!(resolution, Err(ResolveError::ExtensionAlias), "{comment} {path:?} {request}"); - } -} - -// should not apply extension alias to extensions or mainFiles field -#[test] -fn not_apply_to_extension_nor_main_files() { - let f = super::fixture().join("extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - extension_alias: vec![(".js".into(), vec![])], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("directory", f.clone(), "./dir2", "dir2/index.js"), - ("file", f.clone(), "./dir2/index", "dir2/index.js"), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - let expected = f.join(expected); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} diff --git a/src/tests/extensions.rs b/src/tests/extensions.rs deleted file mode 100644 index 1ebd86f4..00000000 --- a/src/tests/extensions.rs +++ /dev/null @@ -1,125 +0,0 @@ -//! - -use crate::{EnforceExtension, Resolution, ResolveContext, ResolveError, ResolveOptions, Resolver}; -use rustc_hash::FxHashSet; - -#[test] -fn extensions() { - let f = super::fixture().join("extensions"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".ts".into(), ".js".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve according to order of provided extensions", "./foo", "foo.ts"), - ("should resolve according to order of provided extensions (dir index)", "./dir", "dir/index.ts"), - ("should resolve according to main field in module root", ".", "index.js"), - // This is a core module - // ("should resolve single file module before directory", "module", "node_modules/module.js"), - ("should resolve trailing slash directory before single file", "module/", "node_modules/module/index.ts"), - ]; - - for (comment, request, expected_path) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - let expected = f.join(expected_path); - assert_eq!(resolved_path, Ok(expected), "{comment} {request} {expected_path}"); - } - - #[rustfmt::skip] - let fail = [ - ("not resolve to file when request has a trailing slash (relative)", "./foo.js/", "./foo.js/".into()) - ]; - - for (comment, request, expected_error) in fail { - let resolution = resolver.resolve(&f, request); - let error = ResolveError::NotFound(expected_error); - assert_eq!(resolution, Err(error), "{comment} {request} {resolution:?}"); - } -} - -// should default enforceExtension to true when extensions includes an empty string -#[test] -fn default_enforce_extension() { - let f = super::fixture().join("extensions"); - - let mut ctx = ResolveContext::default(); - let resolved = Resolver::new(ResolveOptions { - extensions: vec![".ts".into(), String::new(), ".js".into()], - ..ResolveOptions::default() - }) - .resolve_with_context(&f, "./foo", &mut ctx); - - assert_eq!(resolved.map(Resolution::into_path_buf), Ok(f.join("foo.ts"))); - assert_eq!( - ctx.file_dependencies, - FxHashSet::from_iter([f.join("foo.ts"), f.join("package.json")]) - ); - assert!(ctx.missing_dependencies.is_empty()); -} - -// should respect enforceExtension when extensions includes an empty string -#[test] -fn respect_enforce_extension() { - let f = super::fixture().join("extensions"); - - let mut ctx = ResolveContext::default(); - let resolved = Resolver::new(ResolveOptions { - enforce_extension: EnforceExtension::Disabled, - extensions: vec![".ts".into(), String::new(), ".js".into()], - ..ResolveOptions::default() - }) - .resolve_with_context(&f, "./foo", &mut ctx); - - assert_eq!(resolved.map(Resolution::into_path_buf), Ok(f.join("foo.ts"))); - assert_eq!( - ctx.file_dependencies, - FxHashSet::from_iter([f.join("foo.ts"), f.join("package.json")]) - ); - assert_eq!(ctx.missing_dependencies, FxHashSet::from_iter([f.join("foo")])); -} - -#[test] -fn multi_dot_extension() { - let f = super::fixture().join("extensions"); - - let resolver = Resolver::new(ResolveOptions { - // Test for `.d.ts`, not part of enhanced-resolve. - extensions: vec![".a.b.c".into(), ".d.ts".into(), ".ts".into(), ".js".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve according to order of provided extensions", "./foo", "foo.ts"), - ("should resolve file with extension", "./app.module", "app.module.js") - ]; - - for (comment, request, expected_path) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - let expected = f.join(expected_path); - assert_eq!(resolved_path, Ok(expected), "{comment} {request} {expected_path}"); - } - - #[rustfmt::skip] - let fail = [ - ("not resolve to file", "./index.", "./index.".into()) - ]; - - for (comment, request, expected_error) in fail { - let resolution = resolver.resolve(&f, request); - let error = ResolveError::NotFound(expected_error); - assert_eq!(resolution, Err(error), "{comment} {request} {resolution:?}"); - } -} - -#[test] -#[should_panic = "All extensions must start with a leading dot"] -fn without_leading_dot() { - Resolver::new(ResolveOptions { - extensions: vec!["ts".into(), "js".into()], - ..ResolveOptions::default() - }); -} diff --git a/src/tests/fallback.rs b/src/tests/fallback.rs deleted file mode 100644 index 3da2d767..00000000 --- a/src/tests/fallback.rs +++ /dev/null @@ -1,100 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/fallback.test.js - -#[test] -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -fn fallback() { - use super::memory_fs::MemoryFS; - use crate::{AliasValue, ResolveError, ResolveOptions, ResolverGeneric}; - use std::path::{Path, PathBuf}; - - let f = Path::new("/"); - - let file_system = MemoryFS::new(&[ - ("/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", ""), - ]); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - fallback: vec![ - ("aliasA".into(), vec![AliasValue::Path("a".into())]), - ("b$".into(), vec![AliasValue::Path("a/index".into())]), - ("c$".into(), vec![AliasValue::Path("/a/index".into())]), - ( - "multiAlias".into(), - vec![ - AliasValue::Path("b".into()), - AliasValue::Path("c".into()), - AliasValue::Path("d".into()), - AliasValue::Path("e".into()), - AliasValue::Path("a".into()), - ], - ), - ("recursive".into(), vec![AliasValue::Path("recursive/dir".into())]), - ("/d/dir".into(), vec![AliasValue::Path("/c/dir".into())]), - ("/d/index.js".into(), vec![AliasValue::Path("/c/index".into())]), - ("ignored".into(), vec![AliasValue::Ignore]), - ("node:path".into(), vec![AliasValue::Ignore]), - ], - modules: vec!["/".into()], - ..ResolveOptions::default() - }, - ); - - #[rustfmt::skip] - let pass = [ - ("should resolve a not aliased module 1", "a", "/a/index"), - ("should resolve a not aliased module 2", "a/index", "/a/index"), - ("should resolve a not aliased module 3", "a/dir", "/a/dir/index"), - ("should resolve a not aliased module 4", "a/dir/index", "/a/dir/index"), - ("should resolve an fallback module 1", "aliasA", "/a/index"), - ("should resolve an fallback module 2", "aliasA/index", "/a/index"), - ("should resolve an fallback module 3", "aliasA/dir", "/a/dir/index"), - ("should resolve an fallback module 4", "aliasA/dir/index", "/a/dir/index"), - ("should resolve a recursive aliased module 1", "recursive", "/recursive/index"), - ("should resolve a recursive aliased module 2", "recursive/index", "/recursive/index"), - ("should resolve a recursive aliased module 3", "recursive/dir", "/recursive/dir/index"), - ("should resolve a recursive aliased module 4", "recursive/dir/index", "/recursive/dir/index"), - ("should resolve a recursive aliased module 5", "recursive/file", "/recursive/dir/file"), - ("should resolve a file aliased module with a query 1", "b?query", "/b/index?query"), - ("should resolve a file aliased module with a query 2", "c?query", "/c/index?query"), - ("should resolve a path in a file aliased module 1", "b/index", "/b/index"), - ("should resolve a path in a file aliased module 2", "b/dir", "/b/dir/index"), - ("should resolve a path in a file aliased module 3", "b/dir/index", "/b/dir/index"), - ("should resolve a path in a file aliased module 4", "c/index", "/c/index"), - ("should resolve a path in a file aliased module 5", "c/dir", "/c/dir/index"), - ("should resolve a path in a file aliased module 6", "c/dir/index", "/c/dir/index"), - ("should resolve a file in multiple aliased dirs 1", "multiAlias/dir/file", "/e/dir/file"), - ("should resolve a file in multiple aliased dirs 2", "multiAlias/anotherDir", "/e/anotherDir/index"), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - - #[rustfmt::skip] - let ignore = [ - ("should resolve an ignore module", "ignored", ResolveError::Ignored(f.join("ignored"))), - ("should resolve node: builtin module", "node:path", ResolveError::Ignored(PathBuf::from("/node:path"))), - ]; - - for (comment, request, expected) in ignore { - let resolution = resolver.resolve(f, request); - assert_eq!(resolution, Err(expected), "{comment} {request}"); - } -} diff --git a/src/tests/full_specified.rs b/src/tests/full_specified.rs deleted file mode 100644 index a70c0191..00000000 --- a/src/tests/full_specified.rs +++ /dev/null @@ -1,113 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/fullSpecified.test.js - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows { - use std::path::PathBuf; - - use crate::{AliasValue, ResolveOptions, ResolverGeneric}; - - use super::super::memory_fs::MemoryFS; - - fn file_system() -> MemoryFS { - MemoryFS::new(&[ - ("/a/node_modules/package1/index.js", ""), - ("/a/node_modules/package1/file.js", ""), - ("/a/node_modules/package2/package.json", r#"{"main":"a"}"#), - ("/a/node_modules/package2/a.js", ""), - ("/a/node_modules/package3/package.json", r#"{"main":"dir"}"#), - ("/a/node_modules/package3/dir/index.js", ""), - ("/a/node_modules/package4/package.json", r#"{"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", ""), - ]) - } - - #[test] - fn test() { - let file_system = file_system(); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - alias: vec![ - ("alias1".into(), vec![AliasValue::from("/a/abc")]), - ("alias2".into(), vec![AliasValue::from("/a")]), - ], - alias_fields: vec![vec!["browser".into()]], - fully_specified: true, - ..ResolveOptions::default() - }, - ); - - let failing_resolves = [ - ("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"), - ]; - - for (comment, request) in failing_resolves { - let resolution = resolver.resolve("/a", request); - assert!(resolution.is_err(), "{comment} {request}"); - } - - let successful_resolves = [ - ("fully relative", "./abc.js", "/a/abc.js"), - ("fully absolute", "/a/abc.js", "/a/abc.js"), - ("fully relative in package", "package1/file.js", "/a/node_modules/package1/file.js"), - ("extensions in mainFiles", "package1", "/a/node_modules/package1/index.js"), - ("extensions in mainFields", "package2", "/a/node_modules/package2/a.js"), - ("extensions in alias", "alias1", "/a/abc.js"), - ("directories in alias", "alias2", "/a/index.js"), - ("directories in packages", "package3", "/a/node_modules/package3/dir/index.js"), - ("extensions in aliasFields", "package4/a.js", "/a/node_modules/package4/b.js"), - ]; - - for (comment, request, expected) in successful_resolves { - let resolution = resolver.resolve("/a", request).map(|r| r.full_path()); - assert_eq!(resolution, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - } - - #[test] - #[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. - fn resolve_to_context() { - let file_system = file_system(); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - alias: vec![ - ("alias1".into(), vec![AliasValue::from("/a/abc")]), - ("alias2".into(), vec![AliasValue::from("/a")]), - ], - alias_fields: vec![vec!["browser".into()]], - fully_specified: true, - resolve_to_context: true, - ..ResolveOptions::default() - }, - ); - - let successful_resolves = [ - ("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", "/a/node_modules/package3/dir"), - ]; - - for (comment, request, expected) in successful_resolves { - let resolution = resolver.resolve("/a", request).map(|r| r.full_path()); - assert_eq!(resolution, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - } -} diff --git a/src/tests/imports_field.rs b/src/tests/imports_field.rs deleted file mode 100644 index c928627a..00000000 --- a/src/tests/imports_field.rs +++ /dev/null @@ -1,1320 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/importsField.test.js -//! -//! The huge imports field test cases are at the bottom of this file. - -use serde_json::json; - -use crate::{Ctx, JSONMap, PathUtil, ResolveError, ResolveOptions, Resolver}; -use std::path::Path; - -#[test] -fn test_simple() { - let f = super::fixture().join("imports-field"); - let f2 = super::fixture().join("imports-exports-wildcard/node_modules/m/"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve using imports field instead of self-referencing", f.clone(), "#imports-field", f.join("b.js")), - ("should resolve using imports field instead of self-referencing for a subpath", f.join("dir"), "#imports-field", f.join("b.js")), - ("should resolve package #1", f.clone(), "#a/dist/main.js", f.join("node_modules/a/lib/lib2/main.js")), - ("should resolve package #3", f.clone(), "#ccc/index.js", f.join("node_modules/c/index.js")), - ("should resolve package #4", f.clone(), "#c", f.join("node_modules/c/index.js")), - ("should resolve with wildcard pattern", f2.clone(), "#internal/i.js", f2.join("src/internal/i.js")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } - - // Note added: - // * should resolve absolute path as an imports field target - // * should log the correct info - - #[rustfmt::skip] - let fail = [ - ("should disallow resolve out of package scope", f.clone(), "#b", ResolveError::InvalidPackageTarget("../b.js".to_string(), "#b".to_string(), f.join("package.json"))), - ("should resolve package #2", f.clone(), "#a", ResolveError::PackageImportNotDefined("#a".to_string(), f.join("package.json"))), - ]; - - for (comment, path, request, error) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!(resolution, Err(error), "{comment} {path:?} {request}"); - } -} - -#[test] -fn shared_resolvers() { - let f = super::fixture().join("imports-field"); - - // field name #1 - let resolver1 = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - imports_fields: vec![vec!["imports".into()]], - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - let resolved_path = resolver1.resolve(&f, "#imports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("b.js"))); - - // field name #2 - let resolver2 = resolver1.clone_with_options(ResolveOptions { - imports_fields: vec![vec!["other".into(), "imports".into()]], - ..ResolveOptions::default() - }); - - let resolved_path = resolver2.resolve(&f, "#b").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("a.js"))); -} - -// Small script for generating the test cases from enhanced_resolve -// for (c of testCases) { -// console.log("TestCase {") -// console.log(`name: ${JSON.stringify(c.name)},`) -// if (c.expect instanceof Error) { -// console.log(`expect: None,`) -// } else { -// console.log(`expect: Some(vec!${JSON.stringify(c.expect)}),`) -// } -// console.log(`imports_field: imports_field(json!(${JSON.stringify(c.suite[0], null, 2)})),`) -// console.log(`request: "${c.suite[1]}",`) -// console.log(`condition_names: vec!${JSON.stringify(c.suite[2])},`) -// console.log("},") -// } - -struct TestCase { - name: &'static str, - expect: Option>, - imports_field: JSONMap, - request: &'static str, - condition_names: Vec<&'static str>, -} - -#[allow(clippy::needless_pass_by_value)] -fn imports_field(value: serde_json::Value) -> JSONMap { - let s = serde_json::to_string(&value).unwrap(); - serde_json::from_str(&s).unwrap() -} - -#[test] -fn test_cases() { - let test_cases = [ - TestCase { - name: "sample #1", - expect: Some(vec!["./dist/test/file.js"]), - imports_field: imports_field(json!({ - "#abc/": { - "import": [ - "./dist/", - "./src/" - ], - "webpack": "./wp/" - }, - "#abc": "./main.js" - })), - request: "#abc/test/file.js", - condition_names: vec!["import", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "sample #1", - expect: Some(vec!["./src/test/file.js"]), - imports_field: imports_field(json!({ - "#abc/": { - "import": [ - "./src/" - ], - "webpack": "./wp/" - }, - "#abc": "./main.js" - })), - request: "#abc/test/file.js", - condition_names: vec!["import", "webpack"], - }, - TestCase { - name: "sample #2", - expect: Some(vec!["./data/timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#1/timezones/": "./data/timezones/" - })), - request: "#1/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #3", - expect: Some(vec!["./data/timezones/timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#aaa/": "./data/timezones/", - "#a/": "./data/timezones/" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #4", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/lib/": { - "browser": [ - "./browser/" - ] - }, - "#a/dist/index.js": { - "node": "./index.js" - } - })), - request: "#a/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #5", - expect: Some(vec!["./browser/index.js"]), - imports_field: imports_field(json!({ - "#a/lib/": { - "browser": [ - "./browser/" - ] - }, - "#a/dist/index.js": { - "node": "./index.js", - "default": "./browser/index.js" - } - })), - request: "#a/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #6", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/dist/a": "./dist/index.js" - })), - request: "#a/dist/aaa", - condition_names: vec![], - }, - TestCase { - name: "sample #7", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/a/a/": "./dist/index.js" - })), - request: "#a/a/a", - condition_names: vec![], - }, - TestCase { - name: "sample #8", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": "./index.js" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #9", - expect: Some(vec!["./main.js"]), - imports_field: imports_field(json!({ - "#a/index.js": "./main.js" - })), - request: "#a/index.js", - condition_names: vec![], - }, - TestCase { - name: "sample #10", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #11", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/bar#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #12", - expect: Some(vec!["./ok.js#abc"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/ok.js#abc", - condition_names: vec![], - }, - TestCase { - name: "sample #13", - expect: Some(vec!["./ok.js?abc"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/ok.js?abc", - condition_names: vec![], - }, - TestCase { - name: "sample #14", - expect: Some(vec!["./🎉.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/🎉.js", - condition_names: vec![], - }, - TestCase { - name: "sample #15", - expect: Some(vec!["./%F0%9F%8E%89.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/%F0%9F%8E%89.js", - condition_names: vec![], - }, - TestCase { - name: "sample #16", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/🎉", - condition_names: vec![], - }, - TestCase { - name: "sample #17", - expect: Some(vec!["./other.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/%F0%9F%8E%89", - condition_names: vec![], - }, - TestCase { - name: "sample #18", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/module", - condition_names: vec![], - }, - TestCase { - name: "sample #19", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/module#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #20", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/module?foo", - condition_names: vec![], - }, - TestCase { - name: "sample #21", - expect: Some(vec!["./d?e?f"]), - imports_field: imports_field(json!({ - "#a/a?b?c/": "./" - })), - request: "#a/a?b?c/d?e?f", - condition_names: vec![], - }, - TestCase { - name: "sample #22", - // We throw InvalidPackageTarget - expect: None, - // expect: Some(vec!["/user/a/index"]), - imports_field: imports_field(json!({ - "#a/": "/user/a/" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #1", - expect: Some(vec!["./A/b/d.js"]), - imports_field: imports_field(json!({ - "#a/": "./A/", - "#a/b/c": "./c.js" - })), - request: "#a/b/d.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #2", - expect: Some(vec!["./A/c.js"]), - imports_field: imports_field(json!({ - "#a/": "./A/", - "#a/b": "./b.js" - })), - request: "#a/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #3", - expect: Some(vec!["./A/b/c/d.js"]), - imports_field: imports_field(json!({ - "#a/": "./A/", - "#a/b/c/d": "./c.js" - })), - request: "#a/b/c/d.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #1", - expect: Some(vec!["./dist/index.js"]), - imports_field: imports_field(json!({ - "#a": "./dist/index.js" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #2", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": "./" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #3", - expect: Some(vec!["./dist/a.js"]), - imports_field: imports_field(json!({ - "#a/": "./dist/", - "#a/index.js": "./dist/a.js" - })), - request: "#a/index.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #4", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "./browser/" - ] - }, - "#a/index.js": { - "browser": "./index.js" - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #5", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "./browser/" - ] - }, - "#a/index.js": { - "node": "./node.js" - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #6", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: "#a", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #7", - expect: Some(vec!["./src/index.js"]), // `enhanced_resolve` is `None` - imports_field: imports_field(json!({ - "#a": { - "default": "./src/index.js", - "browser": "./index.js", - "node": "./src/node/index.js" - } - })), - request: "#a", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #8", - expect: Some(vec!["./src/index.js"]), - imports_field: imports_field(json!({ - "#a": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #9", - expect: Some(vec!["./index"]), - imports_field: imports_field(json!({ - "#a": "./index" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #10", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/index": "./index.js" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #11", - // We throw InvalidPackageTarget - // expect: Some(vec!["b"]), - expect: None, - imports_field: imports_field(json!({ - "#a": "b" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #12", - // We throw InvalidPackageTarget - // expect: Some(vec!["b/index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "b/" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #13", - // We throw InvalidPackageTarget - // expect: Some(vec!["b#anotherhashishere"]), - expect: None, - imports_field: imports_field(json!({ - "#a?q=a#hashishere": "b#anotherhashishere" - })), - request: "#a?q=a#hashishere", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #1", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #2", - expect: Some(vec!["./import.mjs"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec!["import"], - }, - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./require.js"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./import.mjs"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./require.js"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": [ - "./require.js" - ] - }, - { - "import": [ - "./import.mjs", - "#b/import.js" - ] - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./import.mjs"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "./import.mjs", - "#b/import.js" - ] - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "#b/import.js" - ] - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "mapping to a folder root #1", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#timezones": "./data/timezones/" - })), - request: "#timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #2", - expect: None, - imports_field: imports_field(json!({ - "#timezones/": "./data/timezones" - })), - request: "#timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #3", - expect: Some(vec!["./data/timezones/pdt/index.mjs"]), - imports_field: imports_field(json!({ - "#timezones/pdt/": "./data/timezones/pdt/" - })), - request: "#timezones/pdt/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #4", - expect: Some(vec!["./timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#a/": "./timezones/" - })), - request: "#a/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #5", - expect: Some(vec!["./timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#a/": "./" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #6", - expect: None, - imports_field: imports_field(json!({ - "#a/": "." - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #7", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": "./" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #1", - expect: Some(vec!["./lib/index.mjs"]), - imports_field: imports_field(json!({ - "#a/": "./", - "#a/dist/": "./lib/" - })), - request: "#a/dist/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #2", - expect: Some(vec!["./dist/utils/index.js"]), - imports_field: imports_field(json!({ - "#a/dist/utils/": "./dist/utils/", - "#a/dist/": "./lib/" - })), - request: "#a/dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #3", - expect: Some(vec!["./dist/utils/index.js"]), - imports_field: imports_field(json!({ - "#a/dist/utils/index.js": "./dist/utils/index.js", - "#a/dist/utils/": "./dist/utils/index.mjs", - "#a/dist/": "./lib/" - })), - request: "#a/dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #4", - expect: Some(vec!["./lib/index.mjs"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./browser/" - }, - "#a/dist/": "./lib/" - })), - request: "#a/dist/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #1", - // This behaves differently from enhanced_resolve, because `lodash/` is an an InvalidPackageConfig - // expect: Some(vec!["lodash/index.js"]), - expect: Some(vec!["./utils/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "conditional mapping folder #1", - expect: Some(vec!["./utils/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #2", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./node/" - ] - } - })), - request: "#a/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "conditional mapping folder #3", - expect: Some(vec!["./wpk/index.mjs"]), - imports_field: imports_field(json!({ - "#a/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils/" - ] - } - })), - request: "#a/index.mjs", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "incorrect exports field #1", - // We throw `PackageImportNotDefined` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "/utils/": "./a/" - })), - request: "#a/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #2", - // We throw `PackageImportNotDefined` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "/utils/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#a/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #3", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index": "./a/index.js" - })), - request: "#a/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #4", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index.mjs": "./a/index.js" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #5", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "#a/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #6", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index.mjs": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "#a/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #1", - // We don't throw in `package_imports_exports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": "./a/" - })), - request: "/utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect request #2", - // We don't throw in `package_imports_exports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #3", - // We don't throw in `package_imports_exports_resolve`, it's thrown in `package_imports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #4", - // We don't throw in `package_imports_exports_resolve`, it's thrown in `package_imports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#/", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #5", - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#a/", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #1", - // expect: Some(vec!["./dist/index"]), - expect: Some(vec!["dist/index"]), - imports_field: imports_field(json!({ - "#a/../../utils/": "./dist/" - })), - request: "#a/../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #2", - // We throw InvalidPackageTarget - // expect: Some(vec!["./dist/../../utils/index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "./dist/" - })), - request: "#a/../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #3", - // We throw InvalidPackageTarget - // expect: Some(vec!["../src/index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "../src/" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #4", - // We throw InvalidPackageTarget - // expect: Some(vec!["./utils/../../../index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": { - "browser": "./utils/../../../" - } - })), - request: "#a/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #1", - // expect: Some(vec!["moment/node_modules/lodash/dist/index.js"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": { - "browser": "moment/node_modules/" - } - })), - request: "#a/lodash/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #2", - // We throw InvalidPackageTarget - // expect: Some(vec!["../node_modules/lodash/dist/index.js"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "../node_modules/" - })), - request: "#a/lodash/dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "nested mapping #1", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": "./", - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./node/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "nested mapping #3", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["webpack"], - }, - TestCase { - name: "nested mapping #4", - // We throw NotFound - // expect: Some(vec!["moment/node/index.js"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "moment/node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["node", "browser"], - }, - TestCase { - name: "nested mapping #5", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "node"], - }, - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./node/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - TestCase { - name: "nested mapping #7", - expect: Some(vec!["./y.js"]), - imports_field: imports_field(json!({ - "#a": { - "abc": { - "def": "./x.js" - }, - "ghi": "./y.js" - } - })), - request: "#a", - condition_names: vec!["abc", "ghi"], - }, - TestCase { - name: "nested mapping #8", - // We throw PackageImportNotDefined - // expect: Some(vec![]), - expect: None, - imports_field: imports_field(json!({ - "#a": { - "abc": { - "def": "./x.js", - "default": [] - }, - "ghi": "./y.js" - } - })), - request: "#a", - condition_names: vec!["abc", "ghi"], - }, - ]; - - for case in test_cases { - let resolved = Resolver::default() - .package_imports_exports_resolve( - case.request, - &case.imports_field, - Path::new(""), - true, - &case.condition_names.iter().map(ToString::to_string).collect::>(), - &mut Ctx::default(), - ) - .map(|p| p.map(|p| p.to_path_buf())); - if let Some(expect) = case.expect { - if expect.is_empty() { - assert!(matches!(resolved, Ok(None)), "{} {:?}", &case.name, &resolved); - } else { - for expect in expect { - assert_eq!(resolved, Ok(Some(Path::new(expect).normalize())), "{}", &case.name); - } - } - } else { - assert!(resolved.is_err(), "{} {resolved:?}", &case.name); - } - } -} diff --git a/src/tests/incorrect_description_file.rs b/src/tests/incorrect_description_file.rs deleted file mode 100644 index a5c81796..00000000 --- a/src/tests/incorrect_description_file.rs +++ /dev/null @@ -1,62 +0,0 @@ -//! - -use rustc_hash::FxHashSet; - -use crate::{JSONError, Resolution, ResolveContext, ResolveError, ResolveOptions, Resolver}; - -// should not resolve main in incorrect description file #1 -#[test] -fn incorrect_description_file_1() { - let f = super::fixture().join("incorrect-package"); - let mut ctx = ResolveContext::default(); - let resolution = Resolver::default().resolve_with_context(f.join("pack1"), ".", &mut ctx); - let error = ResolveError::JSON(JSONError { - path: f.join("pack1/package.json"), - message: String::from("EOF while parsing a value at line 3 column 0"), - line: 3, - column: 0, - }); - assert_eq!(resolution, Err(error)); - assert_eq!(ctx.file_dependencies, FxHashSet::from_iter([f.join("pack1/package.json")])); - assert!(ctx.missing_dependencies.is_empty()); -} - -// should not resolve main in incorrect description file #2 -#[test] -fn incorrect_description_file_2() { - let f = super::fixture().join("incorrect-package"); - let resolution = Resolver::default().resolve(f.join("pack2"), "."); - let error = ResolveError::JSON(JSONError { - path: f.join("pack2/package.json"), - message: String::from("EOF while parsing a value at line 1 column 0"), - line: 1, - column: 0, - }); - assert_eq!(resolution, Err(error)); -} - -// should not resolve main in incorrect description file #3 -#[test] -fn incorrect_description_file_3() { - let f = super::fixture().join("incorrect-package"); - let resolution = Resolver::default().resolve(f.join("pack2"), "."); - assert!(resolution.is_err()); -} - -// `enhanced_resolve` does not have this test case -#[test] -fn no_description_file() { - let f = super::fixture_root().join("enhanced_resolve"); - - // has description file - let resolver = Resolver::default(); - assert_eq!( - resolver.resolve(&f, ".").map(Resolution::into_path_buf), - Ok(f.join("lib/index.js")) - ); - - // without description file - let resolver = - Resolver::new(ResolveOptions { description_files: vec![], ..ResolveOptions::default() }); - assert_eq!(resolver.resolve(&f, "."), Err(ResolveError::NotFound(".".into()))); -} diff --git a/src/tests/main_field.rs b/src/tests/main_field.rs deleted file mode 100644 index 3cadc8ce..00000000 --- a/src/tests/main_field.rs +++ /dev/null @@ -1,24 +0,0 @@ -//! Not part of enhanced_resolve's test suite - -use crate::{ResolveOptions, Resolver}; - -#[test] -fn test() { - let f = super::fixture().join("restrictions"); - - let resolver1 = Resolver::new(ResolveOptions { - main_fields: vec!["style".into()], - ..ResolveOptions::default() - }); - - let resolution = resolver1.resolve(&f, "pck2").map(|r| r.full_path()); - assert_eq!(resolution, Ok(f.join("node_modules/pck2/index.css"))); - - let resolver2 = resolver1.clone_with_options(ResolveOptions { - main_fields: vec!["module".into(), "main".into()], - ..ResolveOptions::default() - }); - - let resolution = resolver2.resolve(&f, "pck2").map(|r| r.full_path()); - assert_eq!(resolution, Ok(f.join("node_modules/pck2/module.js"))); -} diff --git a/src/tests/memory_fs.rs b/src/tests/memory_fs.rs deleted file mode 100644 index e4116609..00000000 --- a/src/tests/memory_fs.rs +++ /dev/null @@ -1,74 +0,0 @@ -use std::{ - io, - path::{Path, PathBuf}, -}; - -use crate::{FileMetadata, FileSystem}; - -#[derive(Default)] -pub struct MemoryFS { - fs: vfs::MemoryFS, -} - -impl MemoryFS { - /// # Panics - /// - /// * Fails to create directory - /// * Fails to write file - #[allow(dead_code)] - pub fn new(data: &[(&'static str, &'static str)]) -> Self { - let mut fs = Self { fs: vfs::MemoryFS::default() }; - for (path, content) in data { - fs.add_file(Path::new(path), content); - } - fs - } - - #[allow(dead_code)] - pub fn add_file(&mut self, path: &Path, content: &str) { - use vfs::FileSystem; - let fs = &mut self.fs; - // Create all parent directories - for path in path.ancestors().collect::>().iter().rev() { - let path = path.to_string_lossy(); - if !fs.exists(path.as_ref()).unwrap() { - fs.create_dir(path.as_ref()).unwrap(); - } - } - // Create file - let mut file = fs.create_file(path.to_string_lossy().as_ref()).unwrap(); - file.write_all(content.as_bytes()).unwrap(); - } -} - -impl FileSystem for MemoryFS { - fn read_to_string(&self, path: &Path) -> io::Result { - use vfs::FileSystem; - let mut file = self - .fs - .open_file(path.to_string_lossy().as_ref()) - .map_err(|err| io::Error::new(io::ErrorKind::NotFound, err))?; - let mut buffer = String::new(); - file.read_to_string(&mut buffer).unwrap(); - Ok(buffer) - } - - fn metadata(&self, path: &Path) -> io::Result { - use vfs::FileSystem; - let metadata = self - .fs - .metadata(path.to_string_lossy().as_ref()) - .map_err(|err| io::Error::new(io::ErrorKind::NotFound, err))?; - let is_file = metadata.file_type == vfs::VfsFileType::File; - let is_dir = metadata.file_type == vfs::VfsFileType::Directory; - Ok(FileMetadata::new(is_file, is_dir, false)) - } - - fn symlink_metadata(&self, path: &Path) -> io::Result { - self.metadata(path) - } - - fn canonicalize(&self, _path: &Path) -> io::Result { - Err(io::Error::new(io::ErrorKind::NotFound, "not a symlink")) - } -} diff --git a/src/tests/missing.rs b/src/tests/missing.rs deleted file mode 100644 index 4bf611ef..00000000 --- a/src/tests/missing.rs +++ /dev/null @@ -1,106 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/missing.test.js - -use normalize_path::NormalizePath; - -use crate::{AliasValue, ResolveContext, ResolveOptions, Resolver}; - -#[test] -fn test() { - let f = super::fixture(); - - let data = [ - ( - "./missing-file", - vec![f.join("missing-file"), f.join("missing-file.js"), f.join("missing-file.node")], - ), - ( - "missing-module", - vec![ - f.join("node_modules/missing-module"), - f.parent().unwrap().join("node_modules"), // enhanced-resolve is "node_modules/missing-module" - ], - ), - ( - "missing-module/missing-file", - vec![ - f.join("node_modules/missing-module"), - // f.parent().unwrap().join("node_modules/missing-module"), // we don't report this - ], - ), - ( - "m1/missing-file", - vec![ - f.join("node_modules/m1/missing-file"), - f.join("node_modules/m1/missing-file.js"), - f.join("node_modules/m1/missing-file.node"), - // f.parent().unwrap().join("node_modules/m1"), // we don't report this - ], - ), - ( - "m1/", - vec![ - f.join("node_modules/m1/index"), - f.join("node_modules/m1/index.js"), - f.join("node_modules/m1/index.json"), - f.join("node_modules/m1/index.node"), - ], - ), - ("m1/a", vec![f.join("node_modules/m1/a")]), - ]; - - let resolver = Resolver::default(); - - for (specifier, missing_dependencies) in data { - let mut ctx = ResolveContext::default(); - let _ = resolver.resolve_with_context(&f, specifier, &mut ctx); - - for path in ctx.file_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - } - - for path in missing_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - assert!( - ctx.missing_dependencies.contains(&path), - "{specifier}: {path:?} not in {:?}", - &ctx.missing_dependencies - ); - } - } -} - -#[test] -fn alias_and_extensions() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias: vec![ - ( - "@scope-js/package-name/dir$".into(), - vec![AliasValue::Path(f.join("foo/index.js").to_string_lossy().to_string())], - ), - ( - "react-dom".into(), - vec![AliasValue::Path(f.join("foo/index.js").to_string_lossy().to_string())], - ), - ], - extensions: vec![".server.ts".into()], - - ..ResolveOptions::default() - }); - - let mut ctx = ResolveContext::default(); - let _ = resolver.resolve_with_context(&f, "@scope-js/package-name/dir/router", &mut ctx); - let _ = resolver.resolve_with_context(&f, "react-dom/client", &mut ctx); - - for path in ctx.file_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - } - - for path in ctx.missing_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - if let Some(path) = path.parent() { - assert!(!path.is_file(), "{path:?} must not be a file"); - } - } -} diff --git a/src/tests/mod.rs b/src/tests/mod.rs deleted file mode 100644 index 94e6bd86..00000000 --- a/src/tests/mod.rs +++ /dev/null @@ -1,49 +0,0 @@ -mod alias; -mod browser_field; -mod builtins; -mod dependencies; -mod exports_field; -mod extension_alias; -mod extensions; -mod fallback; -mod full_specified; -mod imports_field; -mod incorrect_description_file; -mod main_field; -mod memory_fs; -mod missing; -mod resolve; -mod restrictions; -mod roots; -mod scoped_packages; -mod simple; -mod symlink; -mod tsconfig_paths; -mod tsconfig_project_references; - -use crate::Resolver; -use std::{env, path::PathBuf, sync::Arc, thread}; - -pub fn fixture_root() -> PathBuf { - env::current_dir().unwrap().join("fixtures") -} - -pub fn fixture() -> PathBuf { - fixture_root().join("enhanced_resolve").join("test").join("fixtures") -} - -#[test] -fn threaded_environment() { - let cwd = env::current_dir().unwrap(); - let resolver = Arc::new(Resolver::default()); - for _ in 0..2 { - _ = thread::spawn({ - let cwd = cwd.clone(); - let resolver = Arc::clone(&resolver); - move || { - _ = resolver.resolve(cwd, "."); - } - }) - .join(); - } -} diff --git a/src/tests/resolve.rs b/src/tests/resolve.rs deleted file mode 100644 index f2dbb88e..00000000 --- a/src/tests/resolve.rs +++ /dev/null @@ -1,119 +0,0 @@ -//! - -use crate::{ResolveError, ResolveOptions, Resolver}; - -#[test] -fn resolve() { - let f = super::fixture(); - - let resolver = Resolver::default(); - - let main1_js_path = f.join("main1.js").to_string_lossy().to_string(); - - #[rustfmt::skip] - let pass = [ - ("absolute path", f.clone(), main1_js_path.as_str(), f.join("main1.js")), - ("file with .js", f.clone(), "./main1.js", f.join("main1.js")), - ("file without extension", f.clone(), "./main1", f.join("main1.js")), - ("another file with .js", f.clone(), "./a.js", f.join("a.js")), - ("another file without extension", f.clone(), "./a", f.join("a.js")), - ("file in module with .js", f.clone(), "m1/a.js", f.join("node_modules/m1/a.js")), - ("file in module without extension", f.clone(), "m1/a", f.join("node_modules/m1/a.js")), - ("another file in module without extension", f.clone(), "complexm/step1", f.join("node_modules/complexm/step1.js")), - ("from submodule to file in sibling module", f.join("node_modules/complexm"), "m2/b.js", f.join("node_modules/m2/b.js")), - ("from nested directory to overwritten file in module", f.join("multiple_modules"), "m1/a.js", f.join("multiple_modules/node_modules/m1/a.js")), - ("from nested directory to not overwritten file in module", f.join("multiple_modules"), "m1/b.js", f.join("node_modules/m1/b.js")), - ("file with query", f.clone(), "./main1.js?query", f.join("main1.js?query")), - ("file with fragment", f.clone(), "./main1.js#fragment", f.join("main1.js#fragment")), - ("file with fragment and query", f.clone(), "./main1.js#fragment?query", f.join("main1.js#fragment?query")), - ("file with query and fragment", f.clone(), "./main1.js?#fragment", f.join("main1.js?#fragment")), - - ("file with query (unicode)", f.clone(), "./测试.js?query", f.join("测试.js?query")), - ("file with fragment (unicode)", f.clone(), "./测试.js#fragment", f.join("测试.js#fragment")), - ("file with fragment and query (unicode)", f.clone(), "./测试.js#fragment?query", f.join("测试.js#fragment?query")), - ("file with query and fragment (unicode)", f.clone(), "./测试.js?#fragment", f.join("测试.js?#fragment")), - - ("file in module with query", f.clone(), "m1/a?query", f.join("node_modules/m1/a.js?query")), - ("file in module with fragment", f.clone(), "m1/a#fragment", f.join("node_modules/m1/a.js#fragment")), - ("file in module with fragment and query", f.clone(), "m1/a#fragment?query", f.join("node_modules/m1/a.js#fragment?query")), - ("file in module with query and fragment", f.clone(), "m1/a?#fragment", f.join("node_modules/m1/a.js?#fragment")), - ("file in module with query and fragment", f.clone(), "m1/a?#fragment", f.join("node_modules/m1/a.js?#fragment")), - ("differ between directory and file, resolve file", f.clone(), "./dirOrFile", f.join("dirOrFile.js")), - ("differ between directory and file, resolve directory", f.clone(), "./dirOrFile/", f.join("dirOrFile/index.js")), - ("find node_modules outside of node_modules", f.join("browser-module/node_modules"), "m1/a", f.join("node_modules/m1/a.js")), - ("don't crash on main field pointing to self", f.clone(), "./main-field-self", f.join("./main-field-self/index.js")), - ("don't crash on main field pointing to self (2)", f.clone(), "./main-field-self2", f.join("./main-field-self2/index.js")), - // enhanced-resolve has `#` prepended with a `\0`, they are removed from the - // following 3 expected test results. - // See https://github.com/webpack/enhanced-resolve#escaping - ("handle fragment edge case (no fragment)", f.clone(), "./no#fragment/#/#", f.join("no#fragment/#/#.js")), - ("handle fragment edge case (fragment)", f.clone(), "./no#fragment/#/", f.join("no.js#fragment/#/")), - ("handle fragment escaping", f.clone(), "./no\0#fragment/\0#/\0##fragment", f.join("no#fragment/#/#.js#fragment")), - - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn issue238_resolve() { - let f = super::fixture().join("issue-238"); - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into(), ".jsx".into(), ".ts".into(), ".tsx".into()], - modules: vec!["src/a".into(), "src/b".into(), "src/common".into(), "node_modules".into()], - ..ResolveOptions::default() - }); - let resolved_path = - resolver.resolve(f.join("src/common"), "config/myObjectFile").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("src/common/config/myObjectFile.js")),); -} - -#[test] -fn prefer_relative() { - let f = super::fixture(); - - let resolver = - Resolver::new(ResolveOptions { prefer_relative: true, ..ResolveOptions::default() }); - - #[rustfmt::skip] - let pass = [ - ("should correctly resolve with preferRelative 1", "main1.js", f.join("main1.js")), - ("should correctly resolve with preferRelative 2", "m1/a.js", f.join("node_modules/m1/a.js")), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } -} - -#[test] -fn resolve_to_context() { - let f = super::fixture(); - let resolver = - Resolver::new(ResolveOptions { resolve_to_context: true, ..ResolveOptions::default() }); - - #[rustfmt::skip] - let data = [ - ("context for fixtures", f.clone(), "./", f.clone()), - ("context for fixtures/lib", f.clone(), "./lib", f.join("lib")), - ("context for fixtures with ..", f.clone(), "./lib/../../fixtures/./lib/..", f.clone()), - ("context for fixtures with query", f.clone(), "./?query", f.clone().with_file_name("fixtures?query")), - ]; - - for (comment, path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn resolve_hash_as_module() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions::default()); - let resolution = resolver.resolve(f, "#a"); - assert_eq!(resolution, Err(ResolveError::NotFound("#a".into()))); -} diff --git a/src/tests/restrictions.rs b/src/tests/restrictions.rs deleted file mode 100644 index 5ba56596..00000000 --- a/src/tests/restrictions.rs +++ /dev/null @@ -1,25 +0,0 @@ -//! - -use crate::{ResolveError, ResolveOptions, Resolver, Restriction}; - -// TODO: regex -// * should respect RegExp restriction -// * should try to find alternative #1 -// * should try to find alternative #2 -// * should try to find alternative #3 - -// should respect string restriction -#[test] -fn restriction1() { - let fixture = super::fixture(); - let f = fixture.join("restrictions"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - restrictions: vec![Restriction::Path(f.clone())], - ..ResolveOptions::default() - }); - - let resolution = resolver.resolve(&f, "pck2"); - assert_eq!(resolution, Err(ResolveError::Restriction(fixture.join("c.js"), f))); -} diff --git a/src/tests/roots.rs b/src/tests/roots.rs deleted file mode 100644 index b50e2a07..00000000 --- a/src/tests/roots.rs +++ /dev/null @@ -1,92 +0,0 @@ -//! - -use std::path::PathBuf; - -use crate::{AliasValue, ResolveError, ResolveOptions, Resolver}; - -fn dirname() -> PathBuf { - super::fixture_root().join("enhanced_resolve").join("test") -} - -#[test] -fn roots() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - alias: vec![("foo".into(), vec![AliasValue::from("/fixtures")])], - roots: vec![dirname(), f.clone()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should respect roots option", "/fixtures/b.js", f.join("b.js")), - ("should try another root option, if it exists", "/b.js", f.join("b.js")), - ("should respect extension", "/fixtures/b", f.join("b.js")), - ("should resolve in directory", "/fixtures/extensions/dir", f.join("extensions/dir/index.js")), - ("should respect aliases", "foo/b", f.join("b.js")), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } - - #[rustfmt::skip] - let fail = [ - ("should not work with relative path", "fixtures/b.js", ResolveError::NotFound("fixtures/b.js".into())) - ]; - - for (comment, request, expected) in fail { - let resolution = resolver.resolve(&f, request); - assert_eq!(resolution, Err(expected), "{comment} {request}"); - } -} - -#[test] -fn resolve_to_context() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - roots: vec![dirname(), f.clone()], - resolve_to_context: true, - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f, "/fixtures/lib").map(|r| r.full_path()); - let expected = f.join("lib"); - assert_eq!(resolved_path, Ok(expected)); -} - -#[test] -fn prefer_absolute() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - alias: vec![("foo".into(), vec![AliasValue::from("/fixtures")])], - roots: vec![dirname(), f.clone()], - prefer_absolute: true, - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve an absolute path (prefer absolute)", f.join("b.js").to_string_lossy().to_string(), f.join("b.js")), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(&f, &request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } -} - -#[test] -fn roots_fall_through() { - let f = super::fixture(); - let absolute_path = f.join("roots_fall_through/index.js"); - let specifier = absolute_path.to_string_lossy(); - let resolution = Resolver::new(ResolveOptions::default().with_root(&f)).resolve(&f, &specifier); - assert_eq!( - resolution.map(super::super::resolution::Resolution::into_path_buf), - Ok(absolute_path) - ); -} diff --git a/src/tests/scoped_packages.rs b/src/tests/scoped_packages.rs deleted file mode 100644 index 8258f00f..00000000 --- a/src/tests/scoped_packages.rs +++ /dev/null @@ -1,25 +0,0 @@ -//! - -use crate::{ResolveOptions, Resolver}; - -#[test] -fn scoped_packages() { - let f = super::fixture().join("scoped"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("main field should work", f.clone(), "@scope/pack1", f.join("./node_modules/@scope/pack1/main.js")), - ("browser field should work", f.clone(), "@scope/pack2", f.join("./node_modules/@scope/pack2/main.js")), - ("folder request should work", f.clone(), "@scope/pack2/lib", f.join("./node_modules/@scope/pack2/lib/index.js")) - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} diff --git a/src/tests/simple.rs b/src/tests/simple.rs deleted file mode 100644 index 08e1238a..00000000 --- a/src/tests/simple.rs +++ /dev/null @@ -1,68 +0,0 @@ -//! - -use std::env; - -use crate::Resolver; - -#[test] -fn simple() { - // mimic `enhanced-resolve/test/simple.test.js` - let dirname = env::current_dir().unwrap().join("fixtures"); - let f = dirname.join("enhanced_resolve/test"); - - let resolver = Resolver::default(); - - let data = [ - ("direct", f.clone(), "../lib/index"), - ("as directory", f, ".."), - ("as module", dirname.clone(), "./enhanced_resolve"), - ]; - - for (comment, path, request) in data { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - let expected = dirname.join("enhanced_resolve/lib/index.js"); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn dashed_name() { - let f = super::fixture(); - - let resolver = Resolver::default(); - - let data = [ - (f.clone(), "dash", f.join("node_modules/dash/index.js")), - (f.clone(), "dash-name", f.join("node_modules/dash-name/index.js")), - (f.join("node_modules/dash"), "dash", f.join("node_modules/dash/index.js")), - (f.join("node_modules/dash"), "dash-name", f.join("node_modules/dash-name/index.js")), - (f.join("node_modules/dash-name"), "dash", f.join("node_modules/dash/index.js")), - (f.join("node_modules/dash-name"), "dash-name", f.join("node_modules/dash-name/index.js")), - ]; - - for (path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{path:?} {request}"); - } -} - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows { - use super::super::memory_fs::MemoryFS; - - use crate::ResolveOptions; - - #[test] - fn no_package() { - use crate::ResolverGeneric; - use std::path::Path; - let f = Path::new("/"); - let file_system = MemoryFS::new(&[]); - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions::default(), - ); - let resolved_path = resolver.resolve(f, "package"); - assert!(resolved_path.is_err()); - } -} diff --git a/src/tests/symlink.rs b/src/tests/symlink.rs deleted file mode 100644 index 7589b560..00000000 --- a/src/tests/symlink.rs +++ /dev/null @@ -1,121 +0,0 @@ -use std::{fs, io, path::Path}; - -use crate::{ResolveOptions, Resolver}; - -#[derive(Debug, Clone, Copy)] -enum FileType { - File, - Dir, -} - -#[allow(unused_variables)] -fn symlink, Q: AsRef>( - original: P, - link: Q, - file_type: FileType, -) -> io::Result<()> { - #[cfg(target_family = "unix")] - { - std::os::unix::fs::symlink(original, link) - } - - #[cfg(target_family = "windows")] - match file_type { - FileType::File => std::os::windows::fs::symlink_file(original, link), - FileType::Dir => std::os::windows::fs::symlink_dir(original, link), - } -} - -fn init(dirname: &Path, temp_path: &Path) -> io::Result<()> { - if temp_path.exists() { - _ = fs::remove_dir_all(temp_path); - } - fs::create_dir(temp_path)?; - symlink(dirname.join("../lib/index.js"), temp_path.join("test"), FileType::File)?; - symlink(dirname.join("../lib"), temp_path.join("test2"), FileType::Dir)?; - fs::remove_file(temp_path.join("test"))?; - fs::remove_file(temp_path.join("test2"))?; - fs::remove_dir(temp_path) -} - -fn create_symlinks(dirname: &Path, temp_path: &Path) -> io::Result<()> { - fs::create_dir(temp_path).unwrap(); - symlink( - dirname.join("../lib/index.js").canonicalize().unwrap(), - temp_path.join("index.js"), - FileType::File, - )?; - symlink(dirname.join("../lib").canonicalize().unwrap(), temp_path.join("lib"), FileType::Dir)?; - symlink(dirname.join("..").canonicalize().unwrap(), temp_path.join("this"), FileType::Dir)?; - symlink(temp_path.join("this"), temp_path.join("that"), FileType::Dir)?; - symlink(Path::new("../../lib/index.js"), temp_path.join("node.relative.js"), FileType::File)?; - symlink( - Path::new("./node.relative.js"), - temp_path.join("node.relative.sym.js"), - FileType::File, - )?; - Ok(()) -} - -fn cleanup_symlinks(temp_path: &Path) { - _ = fs::remove_dir_all(temp_path); -} - -#[test] -fn test() -> io::Result<()> { - let root = super::fixture_root().join("enhanced_resolve"); - let dirname = root.join("test"); - let temp_path = dirname.join("temp"); - if !temp_path.exists() { - let is_admin = init(&dirname, &temp_path).is_ok(); - if !is_admin { - return Ok(()); - } - if let Err(err) = create_symlinks(&dirname, &temp_path) { - cleanup_symlinks(&temp_path); - return Err(err); - } - } - - let resolver_without_symlinks = - Resolver::new(ResolveOptions { symlinks: false, ..ResolveOptions::default() }); - let resolver_with_symlinks = Resolver::default(); - - #[rustfmt::skip] - let pass = [ - ("with a symlink to a file", temp_path.clone(), "./index.js"), - ("with a relative symlink to a file", temp_path.clone(), "./node.relative.js"), - ("with a relative symlink to a symlink to a file", temp_path.clone(), "./node.relative.sym.js"), - ("with a symlink to a directory 1", temp_path.clone(), "./lib/index.js"), - ("with a symlink to a directory 2", temp_path.clone(), "./this/lib/index.js"), - ("with multiple symlinks in the path 1", temp_path.clone(), "./this/test/temp/index.js"), - ("with multiple symlinks in the path 2", temp_path.clone(), "./this/test/temp/lib/index.js"), - ("with multiple symlinks in the path 3", temp_path.clone(), "./this/test/temp/this/lib/index.js"), - ("with a symlink to a directory 2 (chained)", temp_path.clone(), "./that/lib/index.js"), - ("with multiple symlinks in the path 1 (chained)", temp_path.clone(), "./that/test/temp/index.js"), - ("with multiple symlinks in the path 2 (chained)", temp_path.clone(), "./that/test/temp/lib/index.js"), - ("with multiple symlinks in the path 3 (chained)", temp_path.clone(), "./that/test/temp/that/lib/index.js"), - ("with symlinked directory as context 1", temp_path.join( "lib"), "./index.js"), - ("with symlinked directory as context 2", temp_path.join( "this"), "./lib/index.js"), - ("with symlinked directory as context and in path", temp_path.join( "this"), "./test/temp/lib/index.js"), - ("with symlinked directory in context path", temp_path.join( "this/lib"), "./index.js"), - ("with symlinked directory in context path and symlinked file", temp_path.join( "this/test"), "./temp/index.js"), - ("with symlinked directory in context path and symlinked directory", temp_path.join( "this/test"), "./temp/lib/index.js"), - ("with symlinked directory as context 2 (chained)", temp_path.join( "that"), "./lib/index.js"), - ("with symlinked directory as context and in path (chained)", temp_path.join( "that"), "./test/temp/lib/index.js"), - ("with symlinked directory in context path (chained)", temp_path.join( "that/lib"), "./index.js"), - ("with symlinked directory in context path and symlinked file (chained)", temp_path.join( "that/test"), "./temp/index.js"), - ("with symlinked directory in context path and symlinked directory (chained)", temp_path.join( "that/test"), "./temp/lib/index.js") - ]; - - for (comment, path, request) in pass { - let filename = resolver_with_symlinks.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(filename, Ok(root.join("lib/index.js")), "{comment:?}"); - - let resolved_path = - resolver_without_symlinks.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(path.join(request))); - } - - Ok(()) -} diff --git a/src/tests/tsconfig_paths.rs b/src/tests/tsconfig_paths.rs deleted file mode 100644 index 26935b5c..00000000 --- a/src/tests/tsconfig_paths.rs +++ /dev/null @@ -1,507 +0,0 @@ -//! tests for tsconfig-paths -//! -//! Fixtures copied from . - -use std::path::{Path, PathBuf}; - -use crate::{ - ResolveError, ResolveOptions, Resolver, TsConfig, TsconfigOptions, TsconfigReferences, -}; - -// -#[test] -fn tsconfig() { - let f = super::fixture_root().join("tsconfig"); - - #[rustfmt::skip] - let pass = [ - (f.clone(), None, "ts-path", f.join("foo.js")), - (f.join("nested"), None, "ts-path", f.join("nested/test.js")), - (f.join("cases/index"), None, "foo", f.join("node_modules/tsconfig-index/foo.js")), - // This requires reading package.json.tsconfig field - // (f.join("cases/field"), "foo", f.join("node_modules/tsconfig-field/foo.js")) - (f.join("cases/exports"), None, "foo", f.join("node_modules/tsconfig-exports/foo.js")), - (f.join("cases/extends-extension"), None, "foo", f.join("cases/extends-extension/foo.js")), - (f.join("cases/extends-extensionless"), None, "foo", f.join("node_modules/tsconfig-field/foo.js")), - (f.join("cases/extends-paths"), Some("src"), "@/index", f.join("cases/extends-paths/src/index.js")), - (f.join("cases/extends-multiple"), None, "foo", f.join("cases/extends-multiple/foo.js")), - ]; - - for (dir, subdir, request, expected) in pass { - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: dir.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - let path = subdir.map_or(dir.clone(), |subdir| dir.join(subdir)); - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{request} {path:?}"); - } - - #[rustfmt::skip] - let data = [ - (f.join("node_modules/tsconfig-not-used"), "ts-path", Ok(f.join("foo.js"))), - ]; - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - for (path, request, expected) in data { - let resolution = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolution, expected, "{path:?} {request}"); - } -} - -#[test] -fn tsconfig_fallthrough() { - let f = super::fixture_root().join("tsconfig"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "/"); - assert_eq!(resolved_path, Err(ResolveError::NotFound("/".into()))); -} - -#[test] -fn json_with_comments() { - let f = super::fixture_root().join("tsconfig/cases/trailing-comma"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "foo").map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(f.join("bar.js"))); -} - -// -#[test] -fn test_paths() { - let path = Path::new("/foo/tsconfig.json"); - let mut tsconfig_json = serde_json::json!({ - "compilerOptions": { - "paths": { - "jquery": ["node_modules/jquery/dist/jquery"], - "*": ["generated/*"], - "bar/*": ["test/*"], - "bar/baz/*": ["baz/*", "yo/*"], - "@/components/*": ["components/*"], - "url": ["node_modules/my-url"], - } - } - }) - .to_string(); - let tsconfig = TsConfig::parse(true, path, &mut tsconfig_json).unwrap(); - - let data = [ - ("jquery", vec!["/foo/node_modules/jquery/dist/jquery"]), - ("test", vec!["/foo/generated/test"]), - ("test/hello", vec!["/foo/generated/test/hello"]), - ("bar/hi", vec!["/foo/test/hi"]), - ("bar/baz/hi", vec!["/foo/baz/hi", "/foo/yo/hi"]), - ("@/components/button", vec!["/foo/components/button"]), - ("./jquery", vec![]), - ("url", vec!["/foo/node_modules/my-url"]), - ]; - - for (specifier, expected) in data { - let paths = tsconfig.resolve_path_alias(specifier); - let expected = expected.into_iter().map(PathBuf::from).collect::>(); - assert_eq!(paths, expected, "{specifier}"); - } -} - -// -#[test] -fn test_base_url() { - let path = Path::new("/foo/tsconfig.json"); - let mut tsconfig_json = serde_json::json!({ - "compilerOptions": { - "baseUrl": "./src" - } - }) - .to_string(); - let tsconfig = TsConfig::parse(true, path, &mut tsconfig_json).unwrap(); - - let data = [ - ("foo", vec!["/foo/src/foo"]), - ("components/button", vec!["/foo/src/components/button"]), - ("./jquery", vec![]), - ]; - - for (specifier, expected) in data { - let paths = tsconfig.resolve_path_alias(specifier); - let expected = expected.into_iter().map(PathBuf::from).collect::>(); - assert_eq!(paths, expected, "{specifier}"); - } -} - -// -#[test] -fn test_paths_and_base_url() { - let path = Path::new("/foo/tsconfig.json"); - let mut tsconfig_json = serde_json::json!({ - "compilerOptions": { - "baseUrl": "./src", - "paths": { - "*": ["generated/*"], - "bar/*": ["test/*"], - "bar/baz/*": ["baz/*", "yo/*"], - "@/components/*": ["components/*"] - } - } - }) - .to_string(); - let tsconfig = TsConfig::parse(true, path, &mut tsconfig_json).unwrap(); - - let data = [ - ("test", vec!["/foo/src/generated/test", "/foo/src/test"]), - ("test/hello", vec!["/foo/src/generated/test/hello", "/foo/src/test/hello"]), - ("bar/hi", vec!["/foo/src/test/hi", "/foo/src/bar/hi"]), - ("bar/baz/hi", vec!["/foo/src/baz/hi", "/foo/src/yo/hi", "/foo/src/bar/baz/hi"]), - ("@/components/button", vec!["/foo/src/components/button", "/foo/src/@/components/button"]), - ("./jquery", vec![]), - ]; - - for (specifier, expected) in data { - let paths = tsconfig.resolve_path_alias(specifier); - let expected = expected.into_iter().map(PathBuf::from).collect::>(); - assert_eq!(paths, expected, "{specifier}"); - } -} - -// Template variable ${configDir} for substitution of config files directory path -// https://github.com/microsoft/TypeScript/pull/58042 -#[test] -fn test_template_variable() { - let f = super::fixture_root().join("tsconfig"); - let f2 = f.join("cases").join("paths_template_variable"); - - #[rustfmt::skip] - let pass = [ - (f2.clone(), "tsconfig1.json", "foo", f2.join("foo.js")), - (f2.clone(), "tsconfig2.json", "foo", f2.join("foo.js")), - (f.clone(), "tsconfig_template_variable.json", "foo", f.join("foo.js")), - ]; - - for (dir, tsconfig, request, expected) in pass { - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: dir.join(tsconfig), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&dir, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{request} {tsconfig} {dir:?}"); - } -} - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows_test { - use std::path::{Path, PathBuf}; - - use crate::{ - ResolveError, ResolveOptions, ResolverGeneric, TsconfigOptions, TsconfigReferences, - }; - - use super::super::memory_fs::MemoryFS; - - struct OneTest { - name: &'static str, - tsconfig: String, - package_json: Option<(PathBuf, String)>, - main_fields: Option>, - existing_files: Vec<&'static str>, - requested_module: &'static str, - expected_path: &'static str, - extensions: Vec, - } - - impl Default for OneTest { - fn default() -> Self { - Self { - name: "", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/*": ["location/*"] - } - } - }) - .to_string(), - package_json: None, - main_fields: None, - existing_files: vec![], - requested_module: "", - expected_path: "", - extensions: vec![ - ".js".into(), - ".json".into(), - ".node".into(), - ".ts".into(), - ".tsx".into(), - ], - } - } - } - - impl OneTest { - fn resolver(&self, root: &Path) -> ResolverGeneric { - let mut file_system = MemoryFS::default(); - - file_system.add_file(&root.join("tsconfig.json"), &self.tsconfig); - if let Some((path, package_json)) = &self.package_json { - file_system.add_file(&root.join(path).join("package.json"), package_json); - } - for path in &self.existing_files { - file_system.add_file(Path::new(path), ""); - } - - let mut options = ResolveOptions { - extensions: self.extensions.clone(), - tsconfig: Some(TsconfigOptions { - config_file: root.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }; - if let Some(main_fields) = &self.main_fields { - options.main_fields.clone_from(main_fields); - } - - ResolverGeneric::::new_with_file_system(file_system, options) - } - } - - // Path matching tests from tsconfig-paths - // * - // * - #[test] - fn match_path() { - let pass = [ - OneTest { - name: "should locate path that matches with star and exists", - existing_files: vec!["/root/location/mylib/index.ts"], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve to correct path when many are specified", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/*": ["foo1/*", "foo2/*", "location/*", "foo3/*"], - } - } - }) - .to_string(), - existing_files: vec!["/root/location/mylib/index.ts"], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should locate path that matches with star and prioritize pattern with longest prefix", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "*": ["location/*"], - "lib/*": ["location/*"], - } - } - }) - .to_string(), - existing_files: vec![ - "/root/location/lib/mylib/index.ts", - "/root/location/mylib/index.ts", - ], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should locate path that matches with star and exists with extension", - existing_files: vec![ - "/root/location/mylib.myext", - ], - requested_module: "lib/mylib", - extensions: vec![".js".into(), ".myext".into()], - expected_path: "/root/location/mylib.myext", - ..OneTest::default() - }, - OneTest { - name: "should resolve request with extension specified", - existing_files: vec![ - "/root/location/test.jpg", - ], - requested_module: "lib/test.jpg", - expected_path: "/root/location/test.jpg", - ..OneTest::default() - }, - OneTest { - name: "should locate path that matches without star and exists", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/foo": ["location/foo"] - } - } - }) - .to_string(), - existing_files: vec![ - "/root/location/foo.ts", - ], - requested_module: "lib/foo", - expected_path: "/root/location/foo.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve to parent folder when filename is in subfolder", - existing_files: vec![ - "/root/location/mylib/index.ts", - ], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve from main field in package.json", - package_json: Some((PathBuf::from("/root/location/mylib"), serde_json::json!({ - "main": "./kalle.ts" - }).to_string())), - existing_files: vec![ - "/root/location/mylib/kalle.ts", - ], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/kalle.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve from main field in package.json (js)", - package_json: Some((PathBuf::from("/root/location/mylib.js"), serde_json::json!({ - "main": "./kalle.js" - }).to_string())), - existing_files: vec![ - "/root/location/mylib.js/kalle.js", - ], - extensions: vec![".ts".into(), ".js".into()], - requested_module: "lib/mylib.js", - expected_path: "/root/location/mylib.js/kalle.js", - ..OneTest::default() - }, - OneTest { - name: "should resolve from list of fields by priority in package.json", - main_fields: Some(vec!["missing".into(), "browser".into(), "main".into()]), - package_json: Some((PathBuf::from("/root/location/mylibjs"), serde_json::json!({ - "main": "./main.js", - "browser": "./browser.js" - }).to_string())), - existing_files: vec![ - "/root/location/mylibjs/main.js", - "/root/location/mylibjs/browser.js", - ], - extensions: vec![".ts".into(), ".js".into()], - requested_module: "lib/mylibjs", - expected_path: "/root/location/mylibjs/browser.js", - ..OneTest::default() - }, -OneTest { - name: "should ignore field mappings to missing files in package.json", - main_fields: Some(vec!["browser".into(), "main".into()]), - package_json: Some((PathBuf::from("/root/location/mylibjs"), serde_json::json!({ - "main": "./kalle.js", - "browser": "./nope.js" - }).to_string())), - existing_files: vec![ - "/root/location/mylibjs/kalle.js", - ], - extensions: vec![".ts".into(), ".js".into()], - requested_module: "lib/mylibjs", - expected_path: "/root/location/mylibjs/kalle.js", - ..OneTest::default() - }, - // Tests that are not applicable: - // name: "should resolve nested main fields" - // name: "should ignore advanced field mappings in package.json" - // name: "should resolve to with the help of baseUrl when not explicitly set" - // name: "should not resolve with the help of baseUrl when asked not to" - // name: "should resolve main file with cjs file extension" - OneTest { - name: "should resolve .ts from .js alias", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "@/*": ["src/*"] - } - } - }).to_string(), - existing_files: vec![ - "/root/src/foo.ts", - ], - requested_module: "@/foo", // original data was "@/foo.ts" but I don't get why it is the case? - expected_path: "/root/src/foo.ts", // original data was "/root/src/foo" - ..OneTest::default() - }, - ]; - - let root = PathBuf::from("/root"); - - for test in pass { - let resolved_path = - test.resolver(&root).resolve(&root, test.requested_module).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(PathBuf::from(test.expected_path)), "{}", test.name); - } - - let fail = [ - OneTest { - name: "should not locate path that does not match", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/*": ["location/*"] - } - } - }) - .to_string(), - existing_files: vec!["/root/location/mylib"], - requested_module: "lib/mylibjs", - ..OneTest::default() - }, - OneTest { - name: "should not resolve typings file (index.d.ts)", - existing_files: vec!["/root/location/mylib/index.d.ts"], - requested_module: "lib/mylib", - ..OneTest::default() - }, - ]; - - for test in fail { - let resolved_path = - test.resolver(&root).resolve(&root, test.requested_module).map(|f| f.full_path()); - assert_eq!( - resolved_path, - Err(ResolveError::NotFound(test.requested_module.into())), - "{}", - test.name - ); - } - } -} diff --git a/src/tests/tsconfig_project_references.rs b/src/tests/tsconfig_project_references.rs deleted file mode 100644 index b552fefe..00000000 --- a/src/tests/tsconfig_project_references.rs +++ /dev/null @@ -1,101 +0,0 @@ -//! Tests for tsconfig project references - -use crate::{ResolveError, ResolveOptions, Resolver, TsconfigOptions, TsconfigReferences}; - -#[test] -fn auto() { - let f = super::fixture_root().join("tsconfig/cases/project_references"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("app"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - // Test normal paths alias - (f.join("app"), "@/index.ts", f.join("app/aliased/index.ts")), - (f.join("app"), "@/../index.ts", f.join("app/index.ts")), - // Test project reference - (f.join("project_a"), "@/index.ts", f.join("project_a/aliased/index.ts")), - (f.join("project_b/src"), "@/index.ts", f.join("project_b/src/aliased/index.ts")), - // Does not have paths alias - (f.join("project_a"), "./index.ts", f.join("project_a/index.ts")), - (f.join("project_c"), "./index.ts", f.join("project_c/index.ts")), - // Template variable - { - let dir = f.parent().unwrap().join("paths_template_variable"); - (dir.clone(), "foo", dir.join("foo.js")) - } - ]; - - for (path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{request} {path:?}"); - } -} - -#[test] -fn disabled() { - let f = super::fixture_root().join("tsconfig/cases/project_references"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("app"), - references: TsconfigReferences::Disabled, - }), - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - // Test normal paths alias - (f.join("app"), "@/index.ts", Ok(f.join("app/aliased/index.ts"))), - (f.join("app"), "@/../index.ts", Ok(f.join("app/index.ts"))), - // Test project reference - (f.join("project_a"), "@/index.ts", Err(ResolveError::NotFound("@/index.ts".into()))), - (f.join("project_b/src"), "@/index.ts", Err(ResolveError::NotFound("@/index.ts".into()))), - // Does not have paths alias - (f.join("project_a"), "./index.ts", Ok(f.join("project_a/index.ts"))), - (f.join("project_c"), "./index.ts", Ok(f.join("project_c/index.ts"))), - ]; - - for (path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, expected, "{request} {path:?}"); - } -} - -#[test] -fn manual() { - let f = super::fixture_root().join("tsconfig/cases/project_references"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("app"), - references: TsconfigReferences::Paths(vec!["../project_a/conf.json".into()]), - }), - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - // Test normal paths alias - (f.join("app"), "@/index.ts", Ok(f.join("app/aliased/index.ts"))), - (f.join("app"), "@/../index.ts", Ok(f.join("app/index.ts"))), - // Test project reference - (f.join("project_a"), "@/index.ts", Ok(f.join("project_a/aliased/index.ts"))), - (f.join("project_b/src"), "@/index.ts", Err(ResolveError::NotFound("@/index.ts".into()))), - // Does not have paths alias - (f.join("project_a"), "./index.ts", Ok(f.join("project_a/index.ts"))), - (f.join("project_c"), "./index.ts", Ok(f.join("project_c/index.ts"))), - ]; - - for (path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, expected, "{request} {path:?}"); - } -} diff --git a/src/tsconfig.rs b/src/tsconfig.rs deleted file mode 100644 index 9ea23c99..00000000 --- a/src/tsconfig.rs +++ /dev/null @@ -1,223 +0,0 @@ -use std::{ - hash::BuildHasherDefault, - path::{Path, PathBuf}, - sync::Arc, -}; - -use indexmap::IndexMap; -use rustc_hash::FxHasher; -use serde::Deserialize; - -use crate::PathUtil; - -pub type CompilerOptionsPathsMap = IndexMap, BuildHasherDefault>; - -#[derive(Debug, Clone, Eq, PartialEq, Deserialize)] -#[serde(untagged)] -pub enum ExtendsField { - Single(String), - Multiple(Vec), -} - -#[derive(Debug, Deserialize)] -#[serde(rename_all = "camelCase")] -pub struct TsConfig { - /// Whether this is the caller tsconfig. - /// Used for final template variable substitution when all configs are extended and merged. - #[serde(skip)] - root: bool, - - /// Path to `tsconfig.json`. Contains the `tsconfig.json` filename. - #[serde(skip)] - path: PathBuf, - - #[serde(default)] - pub extends: Option, - - #[serde(default)] - pub compiler_options: CompilerOptions, - - /// Bubbled up project references with a reference to their tsconfig. - #[serde(default)] - pub references: Vec, -} - -/// Compiler Options -/// -/// -#[derive(Debug, Default, Deserialize)] -#[serde(rename_all = "camelCase")] -pub struct CompilerOptions { - base_url: Option, - - /// Path aliases - paths: Option, - - /// The actual base for where path aliases are resolved from. - #[serde(skip)] - paths_base: PathBuf, -} - -/// Project Reference -/// -/// -#[derive(Debug, Deserialize)] -pub struct ProjectReference { - /// The path property of each reference can point to a directory containing a tsconfig.json file, - /// or to the config file itself (which may have any name). - pub path: PathBuf, - - /// Reference to the resolved tsconfig - #[serde(skip)] - pub tsconfig: Option>, -} - -impl TsConfig { - pub fn parse(root: bool, path: &Path, json: &mut str) -> Result { - _ = json_strip_comments::strip(json); - let mut tsconfig: Self = serde_json::from_str(json)?; - tsconfig.root = root; - tsconfig.path = path.to_path_buf(); - let directory = tsconfig.directory().to_path_buf(); - if let Some(base_url) = tsconfig.compiler_options.base_url { - tsconfig.compiler_options.base_url = Some(directory.normalize_with(base_url)); - } - if tsconfig.compiler_options.paths.is_some() { - tsconfig.compiler_options.paths_base = - tsconfig.compiler_options.base_url.as_ref().map_or(directory, Clone::clone); - } - Ok(tsconfig) - } - - pub fn build(mut self) -> Self { - if self.root { - let dir = self.directory().to_path_buf(); - // Substitute template variable in `tsconfig.compilerOptions.paths` - if let Some(paths) = &mut self.compiler_options.paths { - for paths in paths.values_mut() { - for path in paths { - Self::substitute_template_variable(&dir, path); - } - } - } - } - self - } - - /// Directory to `tsconfig.json` - /// - /// # Panics - /// - /// * When the `tsconfig.json` path is misconfigured. - pub fn directory(&self) -> &Path { - debug_assert!(self.path.file_name().is_some()); - self.path.parent().unwrap() - } - - pub fn extend_tsconfig(&mut self, tsconfig: &Self) { - let compiler_options = &mut self.compiler_options; - if compiler_options.paths.is_none() { - compiler_options.paths_base = compiler_options - .base_url - .as_ref() - .map_or_else(|| tsconfig.compiler_options.paths_base.clone(), Clone::clone); - compiler_options.paths.clone_from(&tsconfig.compiler_options.paths); - } - if compiler_options.base_url.is_none() { - compiler_options.base_url.clone_from(&tsconfig.compiler_options.base_url); - } - } - - pub fn resolve(&self, path: &Path, specifier: &str) -> Vec { - if path.starts_with(self.base_path()) { - let paths = self.resolve_path_alias(specifier); - if !paths.is_empty() { - return paths; - } - } - for tsconfig in self.references.iter().filter_map(|reference| reference.tsconfig.as_ref()) { - if path.starts_with(tsconfig.base_path()) { - return tsconfig.resolve_path_alias(specifier); - } - } - vec![] - } - - // Copied from parcel - // - pub fn resolve_path_alias(&self, specifier: &str) -> Vec { - if specifier.starts_with(|s| s == '/' || s == '.') { - return vec![]; - } - - let base_url_iter = self - .compiler_options - .base_url - .as_ref() - .map_or_else(Vec::new, |base_url| vec![base_url.normalize_with(specifier)]); - - let Some(paths_map) = &self.compiler_options.paths else { - return base_url_iter; - }; - - let paths = paths_map.get(specifier).map_or_else( - || { - let mut longest_prefix_length = 0; - let mut longest_suffix_length = 0; - let mut best_key: Option<&String> = None; - - for key in paths_map.keys() { - if let Some((prefix, suffix)) = key.split_once('*') { - if (best_key.is_none() || prefix.len() > longest_prefix_length) - && specifier.starts_with(prefix) - && specifier.ends_with(suffix) - { - longest_prefix_length = prefix.len(); - longest_suffix_length = suffix.len(); - best_key.replace(key); - } - } - } - - best_key.and_then(|key| paths_map.get(key)).map_or_else(Vec::new, |paths| { - paths - .iter() - .map(|path| { - path.replace( - '*', - &specifier[longest_prefix_length - ..specifier.len() - longest_suffix_length], - ) - }) - .collect::>() - }) - }, - Clone::clone, - ); - - paths - .into_iter() - .map(|p| self.compiler_options.paths_base.normalize_with(p)) - .chain(base_url_iter) - .collect() - } - - fn base_path(&self) -> &Path { - self.compiler_options - .base_url - .as_ref() - .map_or_else(|| self.directory(), |path| path.as_ref()) - } - - /// Template variable `${configDir}` for substitution of config files directory path - /// - /// NOTE: All tests cases are just a head replacement of `${configDir}`, so we are constrained as such. - /// - /// See - fn substitute_template_variable(directory: &Path, path: &mut String) { - const TEMPLATE_VARIABLE: &str = "${configDir}/"; - if let Some(stripped_path) = path.strip_prefix(TEMPLATE_VARIABLE) { - *path = directory.join(stripped_path).to_string_lossy().to_string(); - } - } -} diff --git a/tests/integration_test.rs b/tests/integration_test.rs deleted file mode 100644 index d369413f..00000000 --- a/tests/integration_test.rs +++ /dev/null @@ -1,102 +0,0 @@ -//! Test public APIs - -use std::{env, path::PathBuf}; - -use oxc_resolver::{EnforceExtension, Resolution, ResolveContext, ResolveOptions, Resolver}; - -fn dir() -> PathBuf { - env::current_dir().unwrap() -} - -fn resolve(specifier: &str) -> Resolution { - let path = dir(); - Resolver::new(ResolveOptions::default()).resolve(path, specifier).unwrap() -} - -#[test] -fn clone() { - let resolution = resolve("./tests/package.json"); - assert_eq!(resolution.clone(), resolution); -} - -#[test] -fn debug() { - let resolution = resolve("./tests/package.json"); - let s = format!("{resolution:?}"); - assert!(!s.is_empty()); -} - -#[test] -fn eq() { - let resolution = resolve("./tests/package.json"); - assert_eq!(resolution, resolution); -} - -#[test] -fn package_json() { - let resolution = resolve("./tests/package.json"); - assert!(resolution - .package_json() - .is_some_and(|json| json.name.as_ref().is_some_and(|name| name == "name"))); -} - -#[cfg(feature = "package_json_raw_json_api")] -#[test] -fn package_json_raw_json_api() { - let resolution = resolve("./tests/package.json"); - assert!(resolution - .package_json() - .unwrap() - .raw_json() - .get("name") - .is_some_and(|name| name == "name")); -} - -#[test] -fn clear_cache() { - let resolver = Resolver::new(ResolveOptions::default()); - resolver.clear_cache(); // exists -} - -#[test] -fn options() { - let resolver = Resolver::new(ResolveOptions::default()); - let options = resolver.options(); - assert!(!format!("{options:?}").is_empty()); -} - -#[test] -fn debug_resolver() { - let resolver = Resolver::new(ResolveOptions::default()); - assert!(!format!("{resolver:?}").is_empty()); -} - -#[test] -fn dependencies() { - let path = dir(); - let mut ctx = ResolveContext::default(); - let _ = Resolver::new(ResolveOptions::default()).resolve_with_context( - path, - "./tests/package.json", - &mut ctx, - ); - assert!(!ctx.file_dependencies.is_empty()); - assert!(ctx.missing_dependencies.is_empty()); -} - -#[test] -fn options_api() { - _ = ResolveOptions::default() - .with_builtin_modules(true) - .with_condition_names(&[]) - .with_extension(".js") - .with_force_extension(EnforceExtension::Auto) - .with_fully_specified(true) - .with_main_field("asdf") - .with_main_file("main") - .with_module("module") - .with_prefer_absolute(true) - .with_prefer_relative(true) - .with_root(PathBuf::new()) - .with_symbolic_link(true); -} diff --git a/tests/package.json b/tests/package.json deleted file mode 100644 index f099adcf..00000000 --- a/tests/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "name": "name" -} diff --git a/tests/resolve_test.rs b/tests/resolve_test.rs deleted file mode 100644 index 30d1ceff..00000000 --- a/tests/resolve_test.rs +++ /dev/null @@ -1,104 +0,0 @@ -use std::{env, path::PathBuf}; - -use oxc_resolver::{ResolveError, ResolveOptions, Resolver}; - -fn dir() -> PathBuf { - env::current_dir().unwrap() -} - -#[test] -fn chinese() { - let dir = dir(); - let specifier = "./fixtures/misc/中文/中文.js"; - let resolution = Resolver::new(ResolveOptions::default()).resolve(&dir, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(dir.join("fixtures/misc/中文/中文.js")) - ); -} - -#[test] -fn styled_components() { - let dir = dir(); - let path = dir.join("fixtures/pnpm"); - let module_path = dir.join("node_modules/.pnpm/styled-components@6.1.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/styled-components"); - let specifier = "styled-components"; - - // cjs - let options = - ResolveOptions { alias_fields: vec![vec!["browser".into()]], ..ResolveOptions::default() }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/styled-components.browser.cjs.js")) - ); - - // esm - let options = ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - main_fields: vec!["module".into()], - ..ResolveOptions::default() - }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/styled-components.browser.esm.js")) - ); -} - -#[test] -fn axios() { - let dir = dir(); - let path = dir.join("fixtures/pnpm"); - let module_path = dir.join("node_modules/.pnpm/axios@1.6.2/node_modules/axios"); - let specifier = "axios"; - - // default - let options = ResolveOptions::default(); - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("index.js")) - ); - - // browser - let options = ResolveOptions { - condition_names: vec!["browser".into(), "require".into()], - ..ResolveOptions::default() - }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/browser/axios.cjs")) - ); - - // cjs - let options = ResolveOptions { - condition_names: vec!["node".into(), "require".into()], - ..ResolveOptions::default() - }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/node/axios.cjs")) - ); -} - -#[test] -fn postcss() { - let dir = dir(); - let path = dir.join("fixtures/pnpm"); - let module_path = path.join("node_modules/postcss"); - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - // should ignore "path" - let resolution = resolver.resolve(&module_path, "path"); - assert_eq!(resolution, Err(ResolveError::Ignored(module_path.clone()))); - - // should ignore "./lib/terminal-highlight" - let resolution = resolver.resolve(&module_path, "./lib/terminal-highlight"); - assert_eq!(resolution, Err(ResolveError::Ignored(module_path.join("lib/terminal-highlight")))); -} From e0b540f2541c9f23b39cdd3f8b4a85119898aa2b Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Thu, 27 Jun 2024 09:25:59 +0300 Subject: [PATCH 39/82] squash! --- package.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index a431e48f..85024638 100644 --- a/package.json +++ b/package.json @@ -15,10 +15,10 @@ ] }, "devDependencies": { - "@napi-rs/cli": "^3.0.0-alpha.43", - "@napi-rs/wasm-runtime": "^0.2.0", - "@types/node": "^20.10.4", - "ava": "^6.0.1", - "emnapi": "^1.0.0" + "@napi-rs/cli": "3.0.0-alpha.43", + "@napi-rs/wasm-runtime": "0.2.0", + "@types/node": "20.10.4", + "ava": "6.0.1", + "emnapi": "1.0.0" } } From 204b8d879a1cd9f624cce90d230a4fb2af578461 Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Fri, 28 Jun 2024 01:34:41 +0300 Subject: [PATCH 40/82] squash! --- package.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 85024638..42daa7cd 100644 --- a/package.json +++ b/package.json @@ -16,9 +16,9 @@ }, "devDependencies": { "@napi-rs/cli": "3.0.0-alpha.43", - "@napi-rs/wasm-runtime": "0.2.0", - "@types/node": "20.10.4", - "ava": "6.0.1", - "emnapi": "1.0.0" + "@napi-rs/wasm-runtime": "0.2.4", + "@types/node": "20.14.9", + "ava": "6.1.3", + "emnapi": "1.2.0" } } From 49e6597059ae673f18f44e9717e14ee03eb13317 Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Sun, 30 Jun 2024 07:16:39 +0300 Subject: [PATCH 41/82] squash! Signed-off-by: Nikola Hristov --- Cargo.lock | 934 ------ Source/lib.rs | 22 +- Source/package_json.rs | 14 +- fixtures/enhanced_resolve/lib/index.js | 1 - fixtures/enhanced_resolve/package.json | 4 - fixtures/enhanced_resolve/test/.gitignore | 2 - .../enhanced_resolve/test/fixtures/#/a.js | 0 fixtures/enhanced_resolve/test/fixtures/a.js | 3 - .../enhanced_resolve/test/fixtures/abc.txt | 1 - .../test/fixtures/alias/files/a.js | 0 fixtures/enhanced_resolve/test/fixtures/b.js | 3 - .../browser-module/browser/module-a.js | 0 .../fixtures/browser-module/lib/browser.js | 0 .../fixtures/browser-module/lib/ignore.js | 0 .../test/fixtures/browser-module/lib/main.js | 0 .../fixtures/browser-module/lib/replaced.js | 0 .../test/fixtures/browser-module/lib/self.js | 0 .../fixtures/browser-module/lib/toString.js | 0 .../browser-module/node_modules/module-a.js | 0 .../browser-module/node_modules/module-b.js | 0 .../browser-module/node_modules/module-c.js | 0 .../node_modules/recursive-file/a.js | 0 .../node_modules/recursive-file/b.js | 0 .../node_modules/recursive-file/c.js | 0 .../node_modules/recursive-file/d.js | 0 .../node_modules/recursive-file/package.json | 8 - .../test/fixtures/browser-module/package.json | 33 - .../test/fixtures/builtins/package.json | 12 - fixtures/enhanced_resolve/test/fixtures/c.js | 4 - .../enhanced_resolve/test/fixtures/complex.js | 13 - .../test/fixtures/crypto-js/index.js | 0 .../test/fixtures/crypto-js/package.json | 7 - .../test/fixtures/decorated-fs/exists.js | 0 .../test/fixtures/dirOrFile.js | 1 - .../test/fixtures/dirOrFile/index.js | 1 - .../directory-default/directory-default.js | 0 .../node_modules/@org/pkg/dist/string.js | 1 - .../@org/pkg/dist/string.test.d.ts | 1 - .../node_modules/@org/pkg/package.json | 9 - .../node_modules/pkg/dist/string.js | 1 - .../node_modules/pkg/dist/string.test.d.ts | 1 - .../node_modules/pkg/package.json | 9 - .../node_modules/exports-field/package.json | 7 - .../node_modules/pack1/index.js | 0 .../test/fixtures/exports-field/a.js | 1 - .../node_modules/exports-field/lib/browser.js | 1 - .../node_modules/exports-field/lib/index.js | 0 .../exports-field/lib/lib2/main.js | 1 - .../node_modules/exports-field/lib/main.js | 1 - .../node_modules/exports-field/main.js | 1 - .../node_modules/exports-field/package.json | 18 - .../node_modules/exports-field/x.js | 1 - .../invalid-exports-field/index.js | 0 .../invalid-exports-field/package.json | 13 - .../node_modules/invalid-exports-field/umd.js | 0 .../test/fixtures/exports-field/package.json | 5 - .../node_modules/exports-field/index.js | 1 - .../node_modules/exports-field/lib/browser.js | 1 - .../exports-field/lib/lib2/main.js | 1 - .../node_modules/exports-field/lib/main.js | 1 - .../node_modules/exports-field/main.js | 1 - .../node_modules/exports-field/package.json | 17 - .../node_modules/exports-field/index | 0 .../node_modules/exports-field/main.js | 1 - .../node_modules/exports-field/package.json | 10 - .../node_modules/exports-field/src/index.js | 0 .../fixtures/extension-alias/dir/index.js | 0 .../fixtures/extension-alias/dir/index.ts | 0 .../fixtures/extension-alias/dir2/index.js | 0 .../fixtures/extension-alias/dir2/index.mts | 0 .../test/fixtures/extension-alias/index.js | 0 .../test/fixtures/extension-alias/index.mjs | 0 .../fixtures/extension-alias/index.mts.js | 0 .../test/fixtures/extension-alias/index.ts | 0 .../test/fixtures/extensions/app.module.js | 0 .../test/fixtures/extensions/dir/index.js | 0 .../test/fixtures/extensions/dir/index.ts | 0 .../test/fixtures/extensions/foo.js | 0 .../test/fixtures/extensions/foo.ts | 0 .../test/fixtures/extensions/index.js | 0 .../test/fixtures/extensions/index.ts | 0 .../extensions/node_modules/module.js | 0 .../extensions/node_modules/module/index.ts | 0 .../test/fixtures/extensions/package.json | 3 - .../enhanced_resolve/test/fixtures/file.load1 | 0 .../enhanced_resolve/test/fixtures/file.load2 | 0 .../test/fixtures/foo/index.js | 0 .../test/fixtures/foo/package.json | 4 - .../node_modules/m/package.json | 17 - .../node_modules/m/src/features/f.js | 0 .../m/src/features/internal/file.js | 0 .../node_modules/m/src/features/y/y.js | 0 .../node_modules/m/src/internal/i.js | 0 .../node_modules/m/src/middle-1/f.js | 0 .../node_modules/m/src/middle-1/nested/f.js | 0 .../node_modules/m/src/middle-2/nested/f.js | 1 - .../m/src/middle-3/nested/f/nested/f.js | 0 .../node_modules/m/src/middle-4/f/f.js | 0 .../node_modules/m/src/middle-5/f$/$.js | 0 .../node_modules/m/src/middle-5/f/$.js | 0 .../node_modules/m/src/middle/f.js | 0 .../node_modules/m/src/middle/nested/f.js | 0 .../test/fixtures/imports-field/a.js | 1 - .../test/fixtures/imports-field/b.js | 0 .../test/fixtures/imports-field/dir/b.js | 0 .../node_modules/a/lib/browser.js | 1 - .../imports-field/node_modules/a/lib/index.js | 0 .../node_modules/a/lib/lib2/main.js | 1 - .../imports-field/node_modules/a/lib/main.js | 1 - .../imports-field/node_modules/a/main.js | 1 - .../imports-field/node_modules/a/package.json | 18 - .../imports-field/node_modules/a/x.js | 1 - .../imports-field/node_modules/c/index.js | 0 .../test/fixtures/imports-field/package.json | 17 - .../fixtures/incorrect-package/pack1/a.js | 0 .../incorrect-package/pack1/package.json | 2 - .../fixtures/incorrect-package/pack2/a.js | 0 .../incorrect-package/pack2/package.json | 0 .../test/fixtures/issue-238/package.json | 3 - .../test/fixtures/issue-238/src/a/config.js | 0 .../src/common/config/myObjectFile.js | 0 .../enhanced_resolve/test/fixtures/lib.js | 0 .../test/fixtures/lib/complex1.js | 1 - .../test/fixtures/main-field-self/index.js | 0 .../fixtures/main-field-self/package.json | 3 - .../test/fixtures/main-field-self2/index.js | 0 .../fixtures/main-field-self2/package.json | 3 - .../enhanced_resolve/test/fixtures/main1.js | 9 - .../enhanced_resolve/test/fixtures/main2.js | 12 - .../enhanced_resolve/test/fixtures/main3.js | 4 - .../multiple_modules/node_modules/m1/a.js | 3 - .../test/fixtures/no#fragment/#/#.js | 0 fixtures/enhanced_resolve/test/fixtures/no.js | 0 .../browser-module-broken/browser.js | 0 .../browser-module-broken/main.js | 0 .../browser-module-broken/package.json | 4 - .../complexm/node_modules/m1/a.js | 1 - .../complexm/node_modules/m1/index.js | 1 - .../fixtures/node_modules/complexm/step1.js | 1 - .../fixtures/node_modules/complexm/step2.js | 1 - .../fixtures/node_modules/dash-name/index.js | 0 .../node_modules/dash-name/package.json | 4 - .../test/fixtures/node_modules/dash/index.js | 0 .../fixtures/node_modules/dash/package.json | 4 - .../invalidPackageJson/package.json | 0 .../test/fixtures/node_modules/m1/a.js | 3 - .../test/fixtures/node_modules/m1/b.js | 3 - .../test/fixtures/node_modules/m2/b.js | 1 - .../node_modules/recursive-module/file.js | 0 .../node_modules/recursive-module/index.js | 0 .../test/fixtures/pnp-a/m2/a.js | 3 - .../test/fixtures/pnp/pkg/dir/index.js | 0 .../test/fixtures/pnp/pkg/index.js | 0 .../test/fixtures/pnp/pkg/main.js | 0 .../fixtures/pnp/pkg/package-alias/browser.js | 0 .../fixtures/pnp/pkg/package-alias/index.js | 0 .../test/fixtures/pnp/pkg/package.json | 7 - .../test/fixtures/pnp/pkg/typescript/index.ts | 0 .../test/fixtures/pnp/pkg3/a.js | 1 - .../test/fixtures/pnp/pkg3/package.json | 8 - .../prefer-pnp/alternative-modules/m1/b.js | 0 .../restrictions/node_modules/pck1/index.css | 0 .../restrictions/node_modules/pck1/index.js | 0 .../node_modules/pck1/package.json | 3 - .../restrictions/node_modules/pck2/index.css | 0 .../restrictions/node_modules/pck2/module.js | 0 .../node_modules/pck2/package.json | 5 - .../test/fixtures/roots_fall_through/index.js | 0 .../scoped/node_modules/@scope/pack1/main.js | 0 .../node_modules/@scope/pack1/package.json | 5 - .../node_modules/@scope/pack2/lib/index.js | 0 .../scoped/node_modules/@scope/pack2/main.js | 0 .../node_modules/@scope/pack2/package.json | 3 - .../test/fixtures/shortcutdir.js/a.js | 0 .../test/fixtures/yield/a/foo-2/b | 0 .../test/fixtures/yield/a/foo-2/c | 0 .../test/fixtures/yield/a/foo/a | 0 .../test/fixtures/yield/a/foo/b | 0 .../test/fixtures/yield/b/foo/a | 0 .../test/fixtures/yield/c/foo/a | 0 .../test/fixtures/yield/c/foo/package.json | 7 - .../fixtures/\346\265\213\350\257\225.js" | 0 .../\344\270\255\346\226\207.js" | 0 fixtures/pnpm/.gitignore | 1 - fixtures/pnpm/package.json | 10 - fixtures/pnpm/pnpm-lock.yaml | 212 -- fixtures/tsconfig/cases/builtins/thing.js | 0 .../tsconfig/cases/builtins/tsconfig.json | 5 - fixtures/tsconfig/cases/exports/index.js | 0 fixtures/tsconfig/cases/exports/tsconfig.json | 3 - .../extends-extension/base-tsconfig.json | 7 - .../tsconfig/cases/extends-extension/foo.js | 0 .../cases/extends-extension/tsconfig.json | 3 - .../cases/extends-extensionless/foo.js | 0 .../cases/extends-extensionless/tsconfig.json | 3 - .../tsconfig/cases/extends-multiple/foo.js | 0 .../cases/extends-multiple/tsconfig.json | 6 - .../tsconfig/cases/extends-not-found/index.js | 0 .../cases/extends-not-found/tsconfig.json | 3 - .../tsconfig/cases/extends-paths/src/index.js | 0 .../cases/extends-paths/tsconfig.base.json | 7 - .../cases/extends-paths/tsconfig.json | 6 - fixtures/tsconfig/cases/field/index.js | 0 fixtures/tsconfig/cases/field/tsconfig.json | 3 - fixtures/tsconfig/cases/index/index.js | 0 fixtures/tsconfig/cases/index/tsconfig.json | 3 - .../cases/paths_template_variable/foo.js | 0 .../paths_template_variable/tsconfig1.json | 3 - .../paths_template_variable/tsconfig2.json | 8 - .../project_references/app/aliased/index.ts | 0 .../cases/project_references/app/index.ts | 0 .../project_references/app/tsconfig.json | 23 - .../project_a/aliased/index.ts | 0 .../project_references/project_a/conf.json | 8 - .../project_references/project_a/index.ts | 0 .../project_b/src/aliased/index.ts | 0 .../project_b/tsconfig.json | 9 - .../project_references/project_c/index.ts | 0 .../project_c/tsconfig.json | 5 - .../project_references/tsconfig.base.json | 4 - fixtures/tsconfig/cases/suffixes/a.ios.ts | 0 fixtures/tsconfig/cases/suffixes/a.ts | 0 fixtures/tsconfig/cases/suffixes/b.ts | 0 fixtures/tsconfig/cases/suffixes/c-test.ts | 0 fixtures/tsconfig/cases/suffixes/index.ts | 1 - .../tsconfig/cases/suffixes/tsconfig.json | 5 - fixtures/tsconfig/cases/trailing-comma/bar.js | 0 .../tsconfig/cases/trailing-comma/index.js | 0 .../cases/trailing-comma/tsconfig.json | 9 - fixtures/tsconfig/foo.js | 0 fixtures/tsconfig/nested/index.js | 0 fixtures/tsconfig/nested/test.js | 0 fixtures/tsconfig/nested/tsconfig.json | 8 - .../node_modules/tsconfig-exports/conf.json | 7 - .../node_modules/tsconfig-exports/foo.js | 0 .../tsconfig-exports/package.json | 7 - .../node_modules/tsconfig-field/conf.json | 7 - .../node_modules/tsconfig-field/foo.js | 0 .../node_modules/tsconfig-field/package.json | 5 - .../node_modules/tsconfig-index/foo.js | 0 .../node_modules/tsconfig-index/package.json | 4 - .../node_modules/tsconfig-index/tsconfig.json | 7 - .../node_modules/tsconfig-not-used/foo.js | 0 .../tsconfig-not-used/tsconfig.json | 7 - fixtures/tsconfig/package.json | 24 - fixtures/tsconfig/tsconfig.json | 7 - .../tsconfig/tsconfig_template_variable.json | 7 - napi/__test__/resolver.spec.mjs | 260 -- napi/src/lib.rs | 179 -- napi/src/options.rs | 261 -- napi/tests/options.test.mjs | 59 - npm/package.json | 77 +- package.json | 53 +- pnpm-lock.yaml | 2690 ----------------- src/builtins.rs | 71 - src/cache.rs | 369 --- src/context.rs | 89 - src/error.rs | 160 - src/file_system.rs | 133 - src/lib.rs | 1678 ---------- src/options.rs | 623 ---- src/package_json.rs | 219 -- src/path.rs | 132 - src/resolution.rs | 92 - src/specifier.rs | 230 -- src/tests/alias.rs | 280 -- src/tests/browser_field.rs | 189 -- src/tests/builtins.rs | 121 - src/tests/dependencies.rs | 110 - src/tests/exports_field.rs | 2546 ---------------- src/tests/extension_alias.rs | 66 - src/tests/extensions.rs | 125 - src/tests/fallback.rs | 100 - src/tests/full_specified.rs | 113 - src/tests/imports_field.rs | 1320 -------- src/tests/incorrect_description_file.rs | 65 - src/tests/main_field.rs | 24 - src/tests/memory_fs.rs | 74 - src/tests/missing.rs | 106 - src/tests/mod.rs | 49 - src/tests/resolve.rs | 119 - src/tests/restrictions.rs | 25 - src/tests/roots.rs | 92 - src/tests/scoped_packages.rs | 25 - src/tests/simple.rs | 68 - src/tests/symlink.rs | 121 - src/tests/tsconfig_paths.rs | 507 ---- src/tests/tsconfig_project_references.rs | 101 - src/tsconfig.rs | 223 -- tests/integration_test.rs | 103 - tests/package.json | 5 - tests/resolve_test.rs | 104 - 292 files changed, 82 insertions(+), 15849 deletions(-) delete mode 100644 Cargo.lock delete mode 100644 fixtures/enhanced_resolve/lib/index.js delete mode 100644 fixtures/enhanced_resolve/package.json delete mode 100644 fixtures/enhanced_resolve/test/.gitignore delete mode 100644 fixtures/enhanced_resolve/test/fixtures/#/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/abc.txt delete mode 100644 fixtures/enhanced_resolve/test/fixtures/alias/files/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/browser/module-a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/ignore.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/replaced.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/self.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/toString.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-c.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/c.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/d.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/builtins/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/c.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/complex.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/crypto-js/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/decorated-fs/exists.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/dirOrFile.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/directory-default/directory-default.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/pack1/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/umd.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/index delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/src/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.mts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mjs delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mts.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/app.module.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/foo.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/foo.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/file.load1 delete mode 100644 fixtures/enhanced_resolve/test/fixtures/file.load2 delete mode 100644 fixtures/enhanced_resolve/test/fixtures/foo/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/foo/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/internal/file.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/y/y.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/internal/i.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-3/nested/f/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-4/f/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f$/$.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f/$.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/dir/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/c/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/issue-238/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/issue-238/src/a/config.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/issue-238/src/common/config/myObjectFile.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/lib.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/lib/complex1.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self2/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main1.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main2.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main3.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/no#fragment/#/#.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/no.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/invalidPackageJson/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/file.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/dir/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/typescript/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/prefer-pnp/alternative-modules/m1/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.css delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/index.css delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/module.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/roots_fall_through/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/lib/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/shortcutdir.js/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/b delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/c delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo/a delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo/b delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/b/foo/a delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/c/foo/a delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json delete mode 100644 "fixtures/enhanced_resolve/test/fixtures/\346\265\213\350\257\225.js" delete mode 100644 "fixtures/misc/\344\270\255\346\226\207/\344\270\255\346\226\207.js" delete mode 100644 fixtures/pnpm/.gitignore delete mode 100644 fixtures/pnpm/package.json delete mode 100644 fixtures/pnpm/pnpm-lock.yaml delete mode 100644 fixtures/tsconfig/cases/builtins/thing.js delete mode 100644 fixtures/tsconfig/cases/builtins/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/exports/index.js delete mode 100644 fixtures/tsconfig/cases/exports/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-extension/base-tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-extension/foo.js delete mode 100644 fixtures/tsconfig/cases/extends-extension/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-extensionless/foo.js delete mode 100644 fixtures/tsconfig/cases/extends-extensionless/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-multiple/foo.js delete mode 100644 fixtures/tsconfig/cases/extends-multiple/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-not-found/index.js delete mode 100644 fixtures/tsconfig/cases/extends-not-found/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-paths/src/index.js delete mode 100644 fixtures/tsconfig/cases/extends-paths/tsconfig.base.json delete mode 100644 fixtures/tsconfig/cases/extends-paths/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/field/index.js delete mode 100644 fixtures/tsconfig/cases/field/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/index/index.js delete mode 100644 fixtures/tsconfig/cases/index/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/paths_template_variable/foo.js delete mode 100644 fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json delete mode 100644 fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json delete mode 100644 fixtures/tsconfig/cases/project_references/app/aliased/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/app/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/app/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/project_references/project_a/aliased/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_a/conf.json delete mode 100644 fixtures/tsconfig/cases/project_references/project_a/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_b/src/aliased/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_b/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/project_references/project_c/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_c/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/project_references/tsconfig.base.json delete mode 100644 fixtures/tsconfig/cases/suffixes/a.ios.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/a.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/b.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/c-test.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/index.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/trailing-comma/bar.js delete mode 100644 fixtures/tsconfig/cases/trailing-comma/index.js delete mode 100644 fixtures/tsconfig/cases/trailing-comma/tsconfig.json delete mode 100644 fixtures/tsconfig/foo.js delete mode 100644 fixtures/tsconfig/nested/index.js delete mode 100644 fixtures/tsconfig/nested/test.js delete mode 100644 fixtures/tsconfig/nested/tsconfig.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-exports/conf.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-exports/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-exports/package.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-field/conf.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-field/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-field/package.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-index/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-index/package.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-not-used/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json delete mode 100755 fixtures/tsconfig/package.json delete mode 100644 fixtures/tsconfig/tsconfig.json delete mode 100644 fixtures/tsconfig/tsconfig_template_variable.json delete mode 100644 napi/__test__/resolver.spec.mjs delete mode 100644 napi/src/lib.rs delete mode 100644 napi/src/options.rs delete mode 100644 napi/tests/options.test.mjs delete mode 100644 pnpm-lock.yaml delete mode 100644 src/builtins.rs delete mode 100644 src/cache.rs delete mode 100644 src/context.rs delete mode 100644 src/error.rs delete mode 100644 src/file_system.rs delete mode 100644 src/lib.rs delete mode 100644 src/options.rs delete mode 100644 src/package_json.rs delete mode 100644 src/path.rs delete mode 100644 src/resolution.rs delete mode 100644 src/specifier.rs delete mode 100644 src/tests/alias.rs delete mode 100644 src/tests/browser_field.rs delete mode 100644 src/tests/builtins.rs delete mode 100644 src/tests/dependencies.rs delete mode 100644 src/tests/exports_field.rs delete mode 100644 src/tests/extension_alias.rs delete mode 100644 src/tests/extensions.rs delete mode 100644 src/tests/fallback.rs delete mode 100644 src/tests/full_specified.rs delete mode 100644 src/tests/imports_field.rs delete mode 100644 src/tests/incorrect_description_file.rs delete mode 100644 src/tests/main_field.rs delete mode 100644 src/tests/memory_fs.rs delete mode 100644 src/tests/missing.rs delete mode 100644 src/tests/mod.rs delete mode 100644 src/tests/resolve.rs delete mode 100644 src/tests/restrictions.rs delete mode 100644 src/tests/roots.rs delete mode 100644 src/tests/scoped_packages.rs delete mode 100644 src/tests/simple.rs delete mode 100644 src/tests/symlink.rs delete mode 100644 src/tests/tsconfig_paths.rs delete mode 100644 src/tests/tsconfig_project_references.rs delete mode 100644 src/tsconfig.rs delete mode 100644 tests/integration_test.rs delete mode 100644 tests/package.json delete mode 100644 tests/resolve_test.rs diff --git a/Cargo.lock b/Cargo.lock deleted file mode 100644 index 414e8bfc..00000000 --- a/Cargo.lock +++ /dev/null @@ -1,934 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "addr2line" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678" -dependencies = [ - "gimli", -] - -[[package]] -name = "adler" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" - -[[package]] -name = "aho-corasick" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" -dependencies = [ - "memchr", -] - -[[package]] -name = "anes" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "735d4f398ca57cfa2880225c2bf81c3b9af3be5bb22e44ae70118dad38713e84" - -[[package]] -name = "autocfg" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" - -[[package]] -name = "backtrace" -version = "0.3.73" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cc23269a4f8976d0a4d2e7109211a419fe30e8d88d677cd60b6bc79c5732e0a" -dependencies = [ - "addr2line", - "cc", - "cfg-if", - "libc", - "miniz_oxide", - "object", - "rustc-demangle", -] - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "bitflags" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" - -[[package]] -name = "bpaf" -version = "0.9.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3280efcf6d66bc77c2cf9b67dc8acee47a217d9be67dd590b3230dffe663724d" - -[[package]] -name = "cast" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" - -[[package]] -name = "cc" -version = "1.0.100" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c891175c3fb232128f48de6590095e59198bbeb8620c310be349bfc3afd12c7b" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "ciborium" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42e69ffd6f0917f5c029256a24d0161db17cea3997d185db0d35926308770f0e" -dependencies = [ - "ciborium-io", - "ciborium-ll", - "serde", -] - -[[package]] -name = "ciborium-io" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05afea1e0a06c9be33d539b876f1ce3692f4afea2cb41f740e7743225ed1c757" - -[[package]] -name = "ciborium-ll" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57663b653d948a338bfb3eeba9bb2fd5fcfaecb9e199e87e1eda4d9e8b240fd9" -dependencies = [ - "ciborium-io", - "half", -] - -[[package]] -name = "codspeed" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a104ac948e0188b921eb3fcbdd55dcf62e542df4c7ab7e660623f6288302089" -dependencies = [ - "colored", - "libc", - "serde_json", -] - -[[package]] -name = "colored" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbf2150cce219b664a8a70df7a1f933836724b503f8a413af9365b4dcc4d90b8" -dependencies = [ - "lazy_static", - "windows-sys 0.48.0", -] - -[[package]] -name = "convert_case" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec182b0ca2f35d8fc196cf3404988fd8b8c739a4d270ff118a398feb0cbec1ca" -dependencies = [ - "unicode-segmentation", -] - -[[package]] -name = "criterion2" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7258985df1aa8b33359ee2392cbc3b7802875242cdacdda91a17a602132c24a9" -dependencies = [ - "anes", - "bpaf", - "cast", - "ciborium", - "codspeed", - "colored", - "num-traits", - "oorandom", - "serde", - "serde_json", - "walkdir", -] - -[[package]] -name = "crossbeam-deque" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" -dependencies = [ - "crossbeam-epoch", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.9.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" -dependencies = [ - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" - -[[package]] -name = "crunchy" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" - -[[package]] -name = "ctor" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edb49164822f3ee45b17acd4a208cfc1251410cf0cad9a833234c9890774dd9f" -dependencies = [ - "quote", - "syn", -] - -[[package]] -name = "dashmap" -version = "5.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" -dependencies = [ - "cfg-if", - "hashbrown", - "lock_api", - "once_cell", - "parking_lot_core", -] - -[[package]] -name = "document-features" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef5282ad69563b5fc40319526ba27e0e7363d552a896f0297d54f767717f9b95" -dependencies = [ - "litrs", -] - -[[package]] -name = "dunce" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b" - -[[package]] -name = "either" -version = "1.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dca9240753cf90908d7e4aac30f630662b02aebaa1b58a3cadabdb23385b58b" - -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "filetime" -version = "0.2.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ee447700ac8aa0b2f2bd7bc4462ad686ba06baa6727ac149a2d6277f0d240fd" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall 0.4.1", - "windows-sys 0.52.0", -] - -[[package]] -name = "gimli" -version = "0.29.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" - -[[package]] -name = "half" -version = "2.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dd08c532ae367adf81c312a4580bc67f1d0fe8bc9c460520283f4c0ff277888" -dependencies = [ - "cfg-if", - "crunchy", -] - -[[package]] -name = "hashbrown" -version = "0.14.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" - -[[package]] -name = "hermit-abi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" - -[[package]] -name = "indexmap" -version = "2.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" -dependencies = [ - "equivalent", - "hashbrown", - "serde", -] - -[[package]] -name = "itoa" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" - -[[package]] -name = "json-strip-comments" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3d129799327c8f80861e467c59b825ba24c277dba6ad0d71a141dc98f9e04ee" - -[[package]] -name = "lazy_static" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" - -[[package]] -name = "libc" -version = "0.2.155" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" - -[[package]] -name = "libloading" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c2a198fb6b0eada2a8df47933734e6d35d350665a33a3593d7164fa52c75c19" -dependencies = [ - "cfg-if", - "windows-targets 0.48.5", -] - -[[package]] -name = "litrs" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4ce301924b7887e9d637144fdade93f9dfff9b60981d4ac161db09720d39aa5" - -[[package]] -name = "lock_api" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" -dependencies = [ - "autocfg", - "scopeguard", -] - -[[package]] -name = "memchr" -version = "2.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" - -[[package]] -name = "miniz_oxide" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" -dependencies = [ - "adler", -] - -[[package]] -name = "napi" -version = "2.16.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "633e41b2b983cf7983134f0c50986ca524d0caf38a2c6fc893ea3fa2e26abb0c" -dependencies = [ - "bitflags 2.5.0", - "ctor", - "napi-derive", - "napi-sys", - "once_cell", - "serde", - "serde_json", - "tokio", -] - -[[package]] -name = "napi-build" -version = "2.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1c0f5d67ee408a4685b61f5ab7e58605c8ae3f2b4189f0127d804ff13d5560a" - -[[package]] -name = "napi-derive" -version = "2.16.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70a8a778fd367b13c64232e58632514b795514ece491ce136d96e976d34a3eb8" -dependencies = [ - "cfg-if", - "convert_case", - "napi-derive-backend", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "napi-derive-backend" -version = "1.0.68" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35849e64596ecd467e1ac897153364a1ffd09b1d79b32ebad94ef8980ac73311" -dependencies = [ - "convert_case", - "once_cell", - "proc-macro2", - "quote", - "regex", - "semver", - "syn", -] - -[[package]] -name = "napi-sys" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "427802e8ec3a734331fec1035594a210ce1ff4dc5bc1950530920ab717964ea3" -dependencies = [ - "libloading", -] - -[[package]] -name = "normalize-path" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5438dd2b2ff4c6df6e1ce22d825ed2fa93ee2922235cc45186991717f0a892d" - -[[package]] -name = "num-traits" -version = "0.2.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" -dependencies = [ - "autocfg", -] - -[[package]] -name = "num_cpus" -version = "1.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" -dependencies = [ - "hermit-abi", - "libc", -] - -[[package]] -name = "object" -version = "0.36.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "576dfe1fc8f9df304abb159d767a29d0476f7750fbf8aa7ad07816004a207434" -dependencies = [ - "memchr", -] - -[[package]] -name = "once_cell" -version = "1.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" - -[[package]] -name = "oorandom" -version = "11.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575" - -[[package]] -name = "oxc_napi_resolver" -version = "0.0.0" -dependencies = [ - "napi", - "napi-build", - "napi-derive", - "oxc_resolver", - "tokio", -] - -[[package]] -name = "oxc_resolver" -version = "1.9.1" -dependencies = [ - "criterion2", - "dashmap", - "document-features", - "dunce", - "indexmap", - "json-strip-comments", - "normalize-path", - "once_cell", - "rayon", - "rustc-hash", - "serde", - "serde_json", - "thiserror", - "tracing", - "vfs", -] - -[[package]] -name = "parking_lot_core" -version = "0.9.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall 0.5.1", - "smallvec", - "windows-targets 0.52.5", -] - -[[package]] -name = "pin-project-lite" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" - -[[package]] -name = "proc-macro2" -version = "1.0.85" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22244ce15aa966053a896d1accb3a6e68469b97c7f33f284b99f0d576879fc23" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.36" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "rayon" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" -dependencies = [ - "either", - "rayon-core", -] - -[[package]] -name = "rayon-core" -version = "1.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" -dependencies = [ - "crossbeam-deque", - "crossbeam-utils", -] - -[[package]] -name = "redox_syscall" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" -dependencies = [ - "bitflags 1.3.2", -] - -[[package]] -name = "redox_syscall" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "469052894dcb553421e483e4209ee581a45100d31b4018de03e5a7ad86374a7e" -dependencies = [ - "bitflags 2.5.0", -] - -[[package]] -name = "regex" -version = "1.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" -dependencies = [ - "aho-corasick", - "memchr", - "regex-automata", - "regex-syntax", -] - -[[package]] -name = "regex-automata" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", -] - -[[package]] -name = "regex-syntax" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" - -[[package]] -name = "rustc-demangle" -version = "0.1.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" - -[[package]] -name = "rustc-hash" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" - -[[package]] -name = "ryu" -version = "1.0.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" - -[[package]] -name = "same-file" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "scopeguard" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" - -[[package]] -name = "semver" -version = "1.0.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" - -[[package]] -name = "serde" -version = "1.0.203" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7253ab4de971e72fb7be983802300c30b5a7f0c2e56fab8abfc6a214307c0094" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.203" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "serde_json" -version = "1.0.117" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3" -dependencies = [ - "indexmap", - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "smallvec" -version = "1.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" - -[[package]] -name = "syn" -version = "2.0.66" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c42f3f41a2de00b01c0aaad383c5a45241efc8b2d1eda5661812fda5f3cdcff5" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "thiserror" -version = "1.0.61" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.61" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "tokio" -version = "1.38.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba4f4a02a7a80d6f274636f0aa95c7e383b912d41fe721a31f29e29698585a4a" -dependencies = [ - "backtrace", - "num_cpus", - "pin-project-lite", -] - -[[package]] -name = "tracing" -version = "0.1.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" -dependencies = [ - "pin-project-lite", - "tracing-attributes", - "tracing-core", -] - -[[package]] -name = "tracing-attributes" -version = "0.1.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "tracing-core" -version = "0.1.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" -dependencies = [ - "once_cell", -] - -[[package]] -name = "unicode-ident" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" - -[[package]] -name = "unicode-segmentation" -version = "1.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" - -[[package]] -name = "vfs" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "654cd097e182a71dbf899178e6b5662c2157dd0b8afd5975de18008f6fc173d1" -dependencies = [ - "filetime", -] - -[[package]] -name = "walkdir" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" -dependencies = [ - "same-file", - "winapi-util", -] - -[[package]] -name = "winapi-util" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b" -dependencies = [ - "windows-sys 0.52.0", -] - -[[package]] -name = "windows-sys" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" -dependencies = [ - "windows-targets 0.48.5", -] - -[[package]] -name = "windows-sys" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" -dependencies = [ - "windows-targets 0.52.5", -] - -[[package]] -name = "windows-targets" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" -dependencies = [ - "windows_aarch64_gnullvm 0.48.5", - "windows_aarch64_msvc 0.48.5", - "windows_i686_gnu 0.48.5", - "windows_i686_msvc 0.48.5", - "windows_x86_64_gnu 0.48.5", - "windows_x86_64_gnullvm 0.48.5", - "windows_x86_64_msvc 0.48.5", -] - -[[package]] -name = "windows-targets" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" -dependencies = [ - "windows_aarch64_gnullvm 0.52.5", - "windows_aarch64_msvc 0.52.5", - "windows_i686_gnu 0.52.5", - "windows_i686_gnullvm", - "windows_i686_msvc 0.52.5", - "windows_x86_64_gnu 0.52.5", - "windows_x86_64_gnullvm 0.52.5", - "windows_x86_64_msvc 0.52.5", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" - -[[package]] -name = "windows_i686_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" - -[[package]] -name = "windows_i686_gnu" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" - -[[package]] -name = "windows_i686_gnullvm" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" - -[[package]] -name = "windows_i686_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" - -[[package]] -name = "windows_i686_msvc" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" diff --git a/Source/lib.rs b/Source/lib.rs index 40c51359..70c36b1c 100644 --- a/Source/lib.rs +++ b/Source/lib.rs @@ -647,11 +647,15 @@ impl ResolverGeneric { } fn load_alias_or_file(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - if let Some(package_json) = - cached_path.find_package_json(&self.cache.fs, &self.options, ctx)? - { - if let Some(path) = self.load_browser_field(cached_path, None, &package_json, ctx)? { - return Ok(Some(path)); + if !self.options.alias_fields.is_empty() { + if let Some(package_json) = + cached_path.find_package_json(&self.cache.fs, &self.options, ctx)? + { + if let Some(path) = + self.load_browser_field(cached_path, None, &package_json, ctx)? + { + return Ok(Some(path)); + } } } // enhanced-resolve: try file as alias @@ -738,10 +742,12 @@ impl ResolverGeneric { module_name: &str, ctx: &mut Ctx, ) -> Option { - if cached_path.path().ends_with(module_name) { - Some(cached_path.clone()) - } else if module_name == "node_modules" { + if module_name == "node_modules" { cached_path.cached_node_modules(&self.cache, ctx) + } else if cached_path.path().components().next_back() + == Some(Component::Normal(OsStr::new(module_name))) + { + Some(cached_path.clone()) } else { cached_path.module_directory(module_name, &self.cache, ctx) } diff --git a/Source/package_json.rs b/Source/package_json.rs index 73901faa..7e05d202 100644 --- a/Source/package_json.rs +++ b/Source/package_json.rs @@ -24,6 +24,16 @@ pub struct PackageJson { /// pub name: Option, + /// The "type" field. + /// + /// + pub r#type: Option, + + /// The "sideEffects" field. + /// + /// + pub side_effects: Option, + raw_json: std::sync::Arc, } @@ -51,9 +61,11 @@ impl PackageJson { json_object.remove("optionalDependencies"); } - // Add name. + // Add name, type and sideEffects. package_json.name = json_object.get("name").and_then(|field| field.as_str()).map(ToString::to_string); + package_json.r#type = json_object.get("type").cloned(); + package_json.side_effects = json_object.get("sideEffects").cloned(); } package_json.path = path; diff --git a/fixtures/enhanced_resolve/lib/index.js b/fixtures/enhanced_resolve/lib/index.js deleted file mode 100644 index 1e872e8f..00000000 --- a/fixtures/enhanced_resolve/lib/index.js +++ /dev/null @@ -1 +0,0 @@ -// mimic enhanced-resolved root directory structure diff --git a/fixtures/enhanced_resolve/package.json b/fixtures/enhanced_resolve/package.json deleted file mode 100644 index d1b845b5..00000000 --- a/fixtures/enhanced_resolve/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "enhanced-resolve", - "main": "lib/index.js" -} diff --git a/fixtures/enhanced_resolve/test/.gitignore b/fixtures/enhanced_resolve/test/.gitignore deleted file mode 100644 index bbbec5f4..00000000 --- a/fixtures/enhanced_resolve/test/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# created by symlink.rs -/temp diff --git a/fixtures/enhanced_resolve/test/fixtures/#/a.js b/fixtures/enhanced_resolve/test/fixtures/#/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/a.js b/fixtures/enhanced_resolve/test/fixtures/a.js deleted file mode 100644 index 896ffc6d..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/abc.txt b/fixtures/enhanced_resolve/test/fixtures/abc.txt deleted file mode 100644 index f2ba8f84..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/abc.txt +++ /dev/null @@ -1 +0,0 @@ -abc \ No newline at end of file diff --git a/fixtures/enhanced_resolve/test/fixtures/alias/files/a.js b/fixtures/enhanced_resolve/test/fixtures/alias/files/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/b.js b/fixtures/enhanced_resolve/test/fixtures/b.js deleted file mode 100644 index 11476340..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/b.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function b() { - return "This is b"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/browser/module-a.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/browser/module-a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/browser.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/ignore.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/ignore.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/replaced.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/replaced.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/self.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/self.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/toString.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/toString.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-a.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-b.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-c.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-c.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/a.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/b.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/c.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/c.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/d.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/d.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json deleted file mode 100644 index c13fe23b..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "browser": { - "a.js": "./a", - "./b.js": "./b", - "c.js": "./d.js", - "./d.js": "./c.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/package.json b/fixtures/enhanced_resolve/test/fixtures/browser-module/package.json deleted file mode 100644 index 19ff7739..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/browser-module/package.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "exports": { - "./lib/index.js": "./lib/index.js" - }, - "browser": { - "./lib/ignore.js": false, - "./lib/replaced.js": "./lib/browser", - "module-a": "./browser/module-a.js", - "module-b": "module-c", - "module-c": "module-c", - "./toString": "./lib/toString.js", - "./lib/main.js": "./lib/main.js", - "./main.js": "./lib/main.js", - "./lib/xyz.js": "./xyz.js", - "./xyz.js": "./lib/xyz.js", - "./lib/non-existent.js": "./lib/non-existent.js", - ".": false, - "./number": 1, - "./foo": "./lib/replaced.js?query" - }, - "innerBrowser1": { - "field": { - "browser": { - "./lib/main1.js": "./lib/main.js" - } - } - }, - "innerBrowser2": { - "browser": { - "./lib/main2.js": "./lib/replaced.js" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/builtins/package.json b/fixtures/enhanced_resolve/test/fixtures/builtins/package.json deleted file mode 100644 index 4a54ea96..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/builtins/package.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "name": "builtins", - "private": true, - "imports": { - "#fs": { - "default": "fs" - }, - "#http": { - "node": "node:http" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/c.js b/fixtures/enhanced_resolve/test/fixtures/c.js deleted file mode 100644 index e3aca8aa..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/c.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = function b() { - require("./a"); - return "This is c"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/complex.js b/fixtures/enhanced_resolve/test/fixtures/complex.js deleted file mode 100644 index 1f62db84..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/complex.js +++ /dev/null @@ -1,13 +0,0 @@ -var 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); diff --git a/fixtures/enhanced_resolve/test/fixtures/crypto-js/index.js b/fixtures/enhanced_resolve/test/fixtures/crypto-js/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json b/fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json deleted file mode 100644 index 1d31aa8b..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "crypto-js", - "main": "index.js", - "browser": { - "crypto": false - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/decorated-fs/exists.js b/fixtures/enhanced_resolve/test/fixtures/decorated-fs/exists.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/dirOrFile.js b/fixtures/enhanced_resolve/test/fixtures/dirOrFile.js deleted file mode 100644 index c3cb885f..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/dirOrFile.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "file"; diff --git a/fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js b/fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js deleted file mode 100644 index 85e01cd4..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "dir"; diff --git a/fixtures/enhanced_resolve/test/fixtures/directory-default/directory-default.js b/fixtures/enhanced_resolve/test/fixtures/directory-default/directory-default.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js deleted file mode 100644 index d1007aae..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js +++ /dev/null @@ -1 +0,0 @@ -export default "string"; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts deleted file mode 100644 index cb0ff5c3..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json deleted file mode 100644 index b523a1e9..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "@org/pkg", - "exports": { - "./*.js": { - "types": "./dist/*.d.ts", - "default": "./dist/*.js" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js deleted file mode 100644 index d1007aae..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js +++ /dev/null @@ -1 +0,0 @@ -export default "string"; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts deleted file mode 100644 index cb0ff5c3..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json deleted file mode 100644 index 8e55fb46..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "@raviqqe/hidash", - "exports": { - "./*.js": { - "types": "./dist/*.d.ts", - "default": "./dist/*.js" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json deleted file mode 100644 index f0edf449..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "exports-field", - "version": "1.0.0", - "exports": { - ".": "./a/../b/../../pack1/index.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/pack1/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/pack1/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/a.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/a.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json deleted file mode 100644 index 6b105c08..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "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/": { - "webpack": ["./lib/lib2/", "./lib/"], - "node": "./lib/", - "default": "./lib/" - }, - "./dist/a.js": "./../../a.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json deleted file mode 100644 index 0012a3de..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "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" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/umd.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/umd.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field/package.json deleted file mode 100644 index 5fa72bb5..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "@exports-field/core", - "version": "1.0.0", - "exports": "./a.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json deleted file mode 100644 index e6f12074..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "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/lib2/", "./lib/"], - "node": "./lib/", - "default": "./lib/" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/index b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/index deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json deleted file mode 100644 index 1a838f49..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "name": "exports-field", - "exportsField": { - "exports": "./main.js" - }, - "ex": "./index", - "broken": { - ".": "./src" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/src/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/src/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.ts b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.mts b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.mts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mjs b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mjs deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mts.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mts.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.ts b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/app.module.js b/fixtures/enhanced_resolve/test/fixtures/extensions/app.module.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.js b/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/foo.js b/fixtures/enhanced_resolve/test/fixtures/extensions/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/foo.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/foo.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/index.js b/fixtures/enhanced_resolve/test/fixtures/extensions/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/index.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module.js b/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module/index.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/package.json b/fixtures/enhanced_resolve/test/fixtures/extensions/package.json deleted file mode 100644 index 5e55a1e8..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/extensions/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "./index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/file.load1 b/fixtures/enhanced_resolve/test/fixtures/file.load1 deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/file.load2 b/fixtures/enhanced_resolve/test/fixtures/file.load2 deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/foo/index.js b/fixtures/enhanced_resolve/test/fixtures/foo/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/foo/package.json b/fixtures/enhanced_resolve/test/fixtures/foo/package.json deleted file mode 100644 index da86787a..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/foo/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "foo", - "version": "1.0.0" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json deleted file mode 100644 index aa2be496..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "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" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/internal/file.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/internal/file.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/y/y.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/y/y.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/internal/i.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/internal/i.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/nested/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js deleted file mode 100644 index e5b70a86..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = { nested: "nested" } diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-3/nested/f/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-3/nested/f/nested/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-4/f/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-4/f/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f$/$.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f$/$.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f/$.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f/$.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/nested/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/a.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/a.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/b.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/dir/b.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/dir/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/index.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json deleted file mode 100644 index 8d8d3a46..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "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/lib2/", "./lib/"], - "node": "./lib/", - "default": "./lib/" - }, - "./dist/a.js": "./../../a.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/c/index.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/c/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/imports-field/package.json deleted file mode 100644 index 248351a9..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "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" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/a.js b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json deleted file mode 100644 index ded7faa2..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json +++ /dev/null @@ -1,2 +0,0 @@ -{ - "main": "./a.js", diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/a.js b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/package.json b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/package.json deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/issue-238/package.json b/fixtures/enhanced_resolve/test/fixtures/issue-238/package.json deleted file mode 100644 index 352055cd..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/issue-238/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "private": true -} diff --git a/fixtures/enhanced_resolve/test/fixtures/issue-238/src/a/config.js b/fixtures/enhanced_resolve/test/fixtures/issue-238/src/a/config.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/issue-238/src/common/config/myObjectFile.js b/fixtures/enhanced_resolve/test/fixtures/issue-238/src/common/config/myObjectFile.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/lib.js b/fixtures/enhanced_resolve/test/fixtures/lib.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/lib/complex1.js b/fixtures/enhanced_resolve/test/fixtures/lib/complex1.js deleted file mode 100644 index b3de3d70..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/lib/complex1.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "lib complex1"; diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self/index.js b/fixtures/enhanced_resolve/test/fixtures/main-field-self/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json b/fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json deleted file mode 100644 index a2b6f341..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "./" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self2/index.js b/fixtures/enhanced_resolve/test/fixtures/main-field-self2/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json b/fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json deleted file mode 100644 index 4fa6f730..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "." -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main1.js b/fixtures/enhanced_resolve/test/fixtures/main1.js deleted file mode 100644 index 168f2a1e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main1.js +++ /dev/null @@ -1,9 +0,0 @@ -var a = require("./a"); -if (x) { - for (var i = 0; i < 100; i++) { - while (true) require("./b"); - do { - i++; - } while (require("m1/a")()); - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main2.js b/fixtures/enhanced_resolve/test/fixtures/main2.js deleted file mode 100644 index 39f062b1..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main2.js +++ /dev/null @@ -1,12 +0,0 @@ -var 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"); - }); - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main3.js b/fixtures/enhanced_resolve/test/fixtures/main3.js deleted file mode 100644 index 1c180166..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main3.js +++ /dev/null @@ -1,4 +0,0 @@ -var a = require("./a"); -require.ensure([], function(require) { - require("./c.js"); -}); diff --git a/fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js b/fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js deleted file mode 100644 index 997c1051..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is nested m1/a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/no#fragment/#/#.js b/fixtures/enhanced_resolve/test/fixtures/no#fragment/#/#.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/no.js b/fixtures/enhanced_resolve/test/fixtures/no.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/browser.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/browser.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/main.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json deleted file mode 100644 index c469e1fd..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "main": "./main.js", - "browser": "./browser.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js deleted file mode 100644 index 549620a5..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "the correct a.js"; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js deleted file mode 100644 index 5db6632e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = " :) " + require("m2/b.js"); diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js deleted file mode 100644 index d308569d..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require("m1/a") + require("m1"); diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js deleted file mode 100644 index cb8127e8..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "Step2"; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json deleted file mode 100644 index 8d6dfa56..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "dash-name", - "exports": "./index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json deleted file mode 100644 index 4fd8706e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "dash", - "exports": "./index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/invalidPackageJson/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/invalidPackageJson/package.json deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js deleted file mode 100644 index 46fc8e6c..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is m1/a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js deleted file mode 100644 index 8565c244..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is m1/b"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js deleted file mode 100644 index 34faaaf5..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "This is m2/b"; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/file.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/file.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js b/fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js deleted file mode 100644 index 997c1051..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is nested m1/a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/dir/index.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/dir/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/index.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/main.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/browser.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/browser.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/index.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json deleted file mode 100644 index e20ceaeb..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "main": "main.js", - "browser": { - "./package-alias/index.js": "./package-alias/browser.js", - "module": "pkg/dir/index" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/typescript/index.ts b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/typescript/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json deleted file mode 100644 index 4a1f838e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "@exports-field/core", - "version": "1.0.0", - "exports": { - ".": "./a.js", - "./x": "./a.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/prefer-pnp/alternative-modules/m1/b.js b/fixtures/enhanced_resolve/test/fixtures/prefer-pnp/alternative-modules/m1/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.css b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.css deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.js b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json deleted file mode 100644 index 14ab704d..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/index.css b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/index.css deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/module.js b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/module.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json deleted file mode 100644 index ee0eb71b..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "main": "../../../c.js", - "module": "module.js", - "style": "index.css" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/roots_fall_through/index.js b/fixtures/enhanced_resolve/test/fixtures/roots_fall_through/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/main.js b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json deleted file mode 100644 index 70a0f20f..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "browser": { - "./index.js": "./main.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/lib/index.js b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/lib/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/main.js b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json deleted file mode 100644 index 2af9e0d1..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "./main.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/shortcutdir.js/a.js b/fixtures/enhanced_resolve/test/fixtures/shortcutdir.js/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/b b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/b deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/c b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/c deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/a b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/a deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/b b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/b deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/b/foo/a b/fixtures/enhanced_resolve/test/fixtures/yield/b/foo/a deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/a b/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/a deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json b/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json deleted file mode 100644 index 0acc4b4c..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "foo", - "version": "1.0.0", - "browser": { - "./a": false - } -} diff --git "a/fixtures/enhanced_resolve/test/fixtures/\346\265\213\350\257\225.js" "b/fixtures/enhanced_resolve/test/fixtures/\346\265\213\350\257\225.js" deleted file mode 100644 index e69de29b..00000000 diff --git "a/fixtures/misc/\344\270\255\346\226\207/\344\270\255\346\226\207.js" "b/fixtures/misc/\344\270\255\346\226\207/\344\270\255\346\226\207.js" deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/pnpm/.gitignore b/fixtures/pnpm/.gitignore deleted file mode 100644 index 3c3629e6..00000000 --- a/fixtures/pnpm/.gitignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/fixtures/pnpm/package.json b/fixtures/pnpm/package.json deleted file mode 100644 index 78712e2b..00000000 --- a/fixtures/pnpm/package.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "name": "pnpm", - "version": "1.0.0", - "private": true, - "devDependencies": { - "axios": "1.6.2", - "styled-components": "6.1.1", - "postcss": "8.4.33" - } -} diff --git a/fixtures/pnpm/pnpm-lock.yaml b/fixtures/pnpm/pnpm-lock.yaml deleted file mode 100644 index e51dfd6a..00000000 --- a/fixtures/pnpm/pnpm-lock.yaml +++ /dev/null @@ -1,212 +0,0 @@ -lockfileVersion: '6.0' - -settings: - autoInstallPeers: true - excludeLinksFromLockfile: false - -devDependencies: - axios: - specifier: 1.6.2 - version: 1.6.2 - postcss: - specifier: 8.4.33 - version: 8.4.33 - styled-components: - specifier: 6.1.1 - version: 6.1.1(react-dom@18.2.0)(react@18.2.0) - -packages: - - /@emotion/is-prop-valid@1.2.1: - resolution: {integrity: sha512-61Mf7Ufx4aDxx1xlDeOm8aFFigGHE4z+0sKCa+IHCeZKiyP9RLD0Mmx7m8b9/Cf37f7NAvQOOJAbQQGVr5uERw==} - dependencies: - '@emotion/memoize': 0.8.1 - dev: true - - /@emotion/memoize@0.8.1: - resolution: {integrity: sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA==} - dev: true - - /@emotion/unitless@0.8.1: - resolution: {integrity: sha512-KOEGMu6dmJZtpadb476IsZBclKvILjopjUii3V+7MnXIQCYh8W3NgNcgwo21n9LXZX6EDIKvqfjYxXebDwxKmQ==} - dev: true - - /@types/stylis@4.2.4: - resolution: {integrity: sha512-36ZrGJ8fgtBr6nwNnuJ9jXIj+bn/pF6UoqmrQT7+Y99+tFFeHHsoR54+194dHdyhPjgbeoNz3Qru0oRt0l6ASQ==} - dev: true - - /asynckit@0.4.0: - resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} - dev: true - - /axios@1.6.2: - resolution: {integrity: sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A==} - dependencies: - follow-redirects: 1.15.3 - form-data: 4.0.0 - proxy-from-env: 1.1.0 - transitivePeerDependencies: - - debug - dev: true - - /camelize@1.0.1: - resolution: {integrity: sha512-dU+Tx2fsypxTgtLoE36npi3UqcjSSMNYfkqgmoEhtZrraP5VWq0K7FkWVTYa8eMPtnU/G2txVsfdCJTn9uzpuQ==} - dev: true - - /combined-stream@1.0.8: - resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} - engines: {node: '>= 0.8'} - dependencies: - delayed-stream: 1.0.0 - dev: true - - /css-color-keywords@1.0.0: - resolution: {integrity: sha512-FyyrDHZKEjXDpNJYvVsV960FiqQyXc/LlYmsxl2BcdMb2WPx0OGRVgTg55rPSyLSNMqP52R9r8geSp7apN3Ofg==} - engines: {node: '>=4'} - dev: true - - /css-to-react-native@3.2.0: - resolution: {integrity: sha512-e8RKaLXMOFii+02mOlqwjbD00KSEKqblnpO9e++1aXS1fPQOpS1YoqdVHBqPjHNoxeF2mimzVqawm2KCbEdtHQ==} - dependencies: - camelize: 1.0.1 - css-color-keywords: 1.0.0 - postcss-value-parser: 4.2.0 - dev: true - - /csstype@3.1.2: - resolution: {integrity: sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==} - dev: true - - /delayed-stream@1.0.0: - resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} - engines: {node: '>=0.4.0'} - dev: true - - /follow-redirects@1.15.3: - resolution: {integrity: sha512-1VzOtuEM8pC9SFU1E+8KfTjZyMztRsgEfwQl44z8A25uy13jSzTj6dyK2Df52iV0vgHCfBwLhDWevLn95w5v6Q==} - engines: {node: '>=4.0'} - peerDependencies: - debug: '*' - peerDependenciesMeta: - debug: - optional: true - dev: true - - /form-data@4.0.0: - resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==} - engines: {node: '>= 6'} - dependencies: - asynckit: 0.4.0 - combined-stream: 1.0.8 - mime-types: 2.1.35 - dev: true - - /js-tokens@4.0.0: - resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} - dev: true - - /loose-envify@1.4.0: - resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==} - hasBin: true - dependencies: - js-tokens: 4.0.0 - dev: true - - /mime-db@1.52.0: - resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} - engines: {node: '>= 0.6'} - dev: true - - /mime-types@2.1.35: - resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} - engines: {node: '>= 0.6'} - dependencies: - mime-db: 1.52.0 - dev: true - - /nanoid@3.3.7: - resolution: {integrity: sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==} - engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} - hasBin: true - dev: true - - /picocolors@1.0.0: - resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==} - dev: true - - /postcss-value-parser@4.2.0: - resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==} - dev: true - - /postcss@8.4.33: - resolution: {integrity: sha512-Kkpbhhdjw2qQs2O2DGX+8m5OVqEcbB9HRBvuYM9pgrjEFUg30A9LmXNlTAUj4S9kgtGyrMbTzVjH7E+s5Re2yg==} - engines: {node: ^10 || ^12 || >=14} - dependencies: - nanoid: 3.3.7 - picocolors: 1.0.0 - source-map-js: 1.0.2 - dev: true - - /proxy-from-env@1.1.0: - resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==} - dev: true - - /react-dom@18.2.0(react@18.2.0): - resolution: {integrity: sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==} - peerDependencies: - react: ^18.2.0 - dependencies: - loose-envify: 1.4.0 - react: 18.2.0 - scheduler: 0.23.0 - dev: true - - /react@18.2.0: - resolution: {integrity: sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==} - engines: {node: '>=0.10.0'} - dependencies: - loose-envify: 1.4.0 - dev: true - - /scheduler@0.23.0: - resolution: {integrity: sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw==} - dependencies: - loose-envify: 1.4.0 - dev: true - - /shallowequal@1.1.0: - resolution: {integrity: sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ==} - dev: true - - /source-map-js@1.0.2: - resolution: {integrity: sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==} - engines: {node: '>=0.10.0'} - dev: true - - /styled-components@6.1.1(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-cpZZP5RrKRIClBW5Eby4JM1wElLVP4NQrJbJ0h10TidTyJf4SIIwa3zLXOoPb4gJi8MsJ8mjq5mu2IrEhZIAcQ==} - engines: {node: '>= 16'} - peerDependencies: - react: '>= 16.8.0' - react-dom: '>= 16.8.0' - dependencies: - '@emotion/is-prop-valid': 1.2.1 - '@emotion/unitless': 0.8.1 - '@types/stylis': 4.2.4 - css-to-react-native: 3.2.0 - csstype: 3.1.2 - postcss: 8.4.33 - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - shallowequal: 1.1.0 - stylis: 4.3.0 - tslib: 2.6.2 - dev: true - - /stylis@4.3.0: - resolution: {integrity: sha512-E87pIogpwUsUwXw7dNyU4QDjdgVMy52m+XEOPEKUn161cCzWjjhPSQhByfd1CcNvrOLnXQ6OnnZDwnJrz/Z4YQ==} - dev: true - - /tslib@2.6.2: - resolution: {integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==} - dev: true diff --git a/fixtures/tsconfig/cases/builtins/thing.js b/fixtures/tsconfig/cases/builtins/thing.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/builtins/tsconfig.json b/fixtures/tsconfig/cases/builtins/tsconfig.json deleted file mode 100644 index 36aa1a4d..00000000 --- a/fixtures/tsconfig/cases/builtins/tsconfig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compilerOptions": { - "baseUrl": "." - } -} diff --git a/fixtures/tsconfig/cases/exports/index.js b/fixtures/tsconfig/cases/exports/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/exports/tsconfig.json b/fixtures/tsconfig/cases/exports/tsconfig.json deleted file mode 100644 index f0e3159b..00000000 --- a/fixtures/tsconfig/cases/exports/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-exports" -} diff --git a/fixtures/tsconfig/cases/extends-extension/base-tsconfig.json b/fixtures/tsconfig/cases/extends-extension/base-tsconfig.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/cases/extends-extension/base-tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/cases/extends-extension/foo.js b/fixtures/tsconfig/cases/extends-extension/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-extension/tsconfig.json b/fixtures/tsconfig/cases/extends-extension/tsconfig.json deleted file mode 100644 index 0ae4c6a3..00000000 --- a/fixtures/tsconfig/cases/extends-extension/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./base-tsconfig" -} diff --git a/fixtures/tsconfig/cases/extends-extensionless/foo.js b/fixtures/tsconfig/cases/extends-extensionless/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-extensionless/tsconfig.json b/fixtures/tsconfig/cases/extends-extensionless/tsconfig.json deleted file mode 100644 index c36cb7d4..00000000 --- a/fixtures/tsconfig/cases/extends-extensionless/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-field/conf" -} diff --git a/fixtures/tsconfig/cases/extends-multiple/foo.js b/fixtures/tsconfig/cases/extends-multiple/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-multiple/tsconfig.json b/fixtures/tsconfig/cases/extends-multiple/tsconfig.json deleted file mode 100644 index aa2ae783..00000000 --- a/fixtures/tsconfig/cases/extends-multiple/tsconfig.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": ["../extends-extension", "../extends-paths"], - "compilerOptions": { - "baseUrl": ".", - }, -} diff --git a/fixtures/tsconfig/cases/extends-not-found/index.js b/fixtures/tsconfig/cases/extends-not-found/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-not-found/tsconfig.json b/fixtures/tsconfig/cases/extends-not-found/tsconfig.json deleted file mode 100644 index 99df91da..00000000 --- a/fixtures/tsconfig/cases/extends-not-found/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./not-found" -} diff --git a/fixtures/tsconfig/cases/extends-paths/src/index.js b/fixtures/tsconfig/cases/extends-paths/src/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-paths/tsconfig.base.json b/fixtures/tsconfig/cases/extends-paths/tsconfig.base.json deleted file mode 100644 index 5c64b067..00000000 --- a/fixtures/tsconfig/cases/extends-paths/tsconfig.base.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "@/*": ["./*"] - } - } -} diff --git a/fixtures/tsconfig/cases/extends-paths/tsconfig.json b/fixtures/tsconfig/cases/extends-paths/tsconfig.json deleted file mode 100644 index 51086018..00000000 --- a/fixtures/tsconfig/cases/extends-paths/tsconfig.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": "./tsconfig.base.json", - "compilerOptions": { - "baseUrl": "src", - }, -} diff --git a/fixtures/tsconfig/cases/field/index.js b/fixtures/tsconfig/cases/field/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/field/tsconfig.json b/fixtures/tsconfig/cases/field/tsconfig.json deleted file mode 100644 index 9f86c3f4..00000000 --- a/fixtures/tsconfig/cases/field/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-field" -} diff --git a/fixtures/tsconfig/cases/index/index.js b/fixtures/tsconfig/cases/index/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/index/tsconfig.json b/fixtures/tsconfig/cases/index/tsconfig.json deleted file mode 100644 index d20b1774..00000000 --- a/fixtures/tsconfig/cases/index/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-index" -} diff --git a/fixtures/tsconfig/cases/paths_template_variable/foo.js b/fixtures/tsconfig/cases/paths_template_variable/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json b/fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json deleted file mode 100644 index a1a37bb6..00000000 --- a/fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "../../tsconfig_template_variable.json" -} diff --git a/fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json b/fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json deleted file mode 100644 index e7d8e5e5..00000000 --- a/fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "compilerOptions": { - "composite": true, - "paths": { - "foo": ["${configDir}/foo.js"] - } - } -} diff --git a/fixtures/tsconfig/cases/project_references/app/aliased/index.ts b/fixtures/tsconfig/cases/project_references/app/aliased/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/app/index.ts b/fixtures/tsconfig/cases/project_references/app/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/app/tsconfig.json b/fixtures/tsconfig/cases/project_references/app/tsconfig.json deleted file mode 100644 index 7036d2bb..00000000 --- a/fixtures/tsconfig/cases/project_references/app/tsconfig.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "extends": "../tsconfig.base.json", - "compilerOptions": { - "baseUrl": "./", - "paths": { - "@/*": ["./aliased/*"] - } - }, - "references": [ - { - "path": "../project_a/conf.json" - }, - { - "path": "../project_b" - }, - { - "path": "../project_c/tsconfig.json" - }, - { - "path": "../../paths_template_variable/tsconfig2.json" - } - ] -} diff --git a/fixtures/tsconfig/cases/project_references/project_a/aliased/index.ts b/fixtures/tsconfig/cases/project_references/project_a/aliased/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_a/conf.json b/fixtures/tsconfig/cases/project_references/project_a/conf.json deleted file mode 100644 index 4d389d7a..00000000 --- a/fixtures/tsconfig/cases/project_references/project_a/conf.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "compilerOptions": { - "composite": true, - "paths": { - "@/*": ["./aliased/*"] - } - } -} diff --git a/fixtures/tsconfig/cases/project_references/project_a/index.ts b/fixtures/tsconfig/cases/project_references/project_a/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_b/src/aliased/index.ts b/fixtures/tsconfig/cases/project_references/project_b/src/aliased/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_b/tsconfig.json b/fixtures/tsconfig/cases/project_references/project_b/tsconfig.json deleted file mode 100644 index 4ab05cd8..00000000 --- a/fixtures/tsconfig/cases/project_references/project_b/tsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "compilerOptions": { - "composite": true, - "baseUrl": "./src", - "paths": { - "@/*": ["./aliased/*"] - } - } -} diff --git a/fixtures/tsconfig/cases/project_references/project_c/index.ts b/fixtures/tsconfig/cases/project_references/project_c/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_c/tsconfig.json b/fixtures/tsconfig/cases/project_references/project_c/tsconfig.json deleted file mode 100644 index fe520939..00000000 --- a/fixtures/tsconfig/cases/project_references/project_c/tsconfig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compilerOptions": { - "composite": true - } -} diff --git a/fixtures/tsconfig/cases/project_references/tsconfig.base.json b/fixtures/tsconfig/cases/project_references/tsconfig.base.json deleted file mode 100644 index 88ccffe7..00000000 --- a/fixtures/tsconfig/cases/project_references/tsconfig.base.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "compilerOptions": { - } -} diff --git a/fixtures/tsconfig/cases/suffixes/a.ios.ts b/fixtures/tsconfig/cases/suffixes/a.ios.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/a.ts b/fixtures/tsconfig/cases/suffixes/a.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/b.ts b/fixtures/tsconfig/cases/suffixes/b.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/c-test.ts b/fixtures/tsconfig/cases/suffixes/c-test.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/index.ts b/fixtures/tsconfig/cases/suffixes/index.ts deleted file mode 100644 index b09939b9..00000000 --- a/fixtures/tsconfig/cases/suffixes/index.ts +++ /dev/null @@ -1 +0,0 @@ -import './a'; diff --git a/fixtures/tsconfig/cases/suffixes/tsconfig.json b/fixtures/tsconfig/cases/suffixes/tsconfig.json deleted file mode 100644 index 4c2ccc8f..00000000 --- a/fixtures/tsconfig/cases/suffixes/tsconfig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compilerOptions": { - "moduleSuffixes": [".ios", "-test", ""] - } -} diff --git a/fixtures/tsconfig/cases/trailing-comma/bar.js b/fixtures/tsconfig/cases/trailing-comma/bar.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/trailing-comma/index.js b/fixtures/tsconfig/cases/trailing-comma/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/trailing-comma/tsconfig.json b/fixtures/tsconfig/cases/trailing-comma/tsconfig.json deleted file mode 100644 index 6dc20ca5..00000000 --- a/fixtures/tsconfig/cases/trailing-comma/tsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "compilerOptions": { - "paths": { - /* some comment */ - "foo": ["bar.js"], - }, - }, - // another comment -} diff --git a/fixtures/tsconfig/foo.js b/fixtures/tsconfig/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/nested/index.js b/fixtures/tsconfig/nested/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/nested/test.js b/fixtures/tsconfig/nested/test.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/nested/tsconfig.json b/fixtures/tsconfig/nested/tsconfig.json deleted file mode 100644 index 6deb3011..00000000 --- a/fixtures/tsconfig/nested/tsconfig.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "extends": "..", - "compilerOptions": { - "paths": { - "ts-path": ["test.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-exports/conf.json b/fixtures/tsconfig/node_modules/tsconfig-exports/conf.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-exports/conf.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-exports/foo.js b/fixtures/tsconfig/node_modules/tsconfig-exports/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-exports/package.json b/fixtures/tsconfig/node_modules/tsconfig-exports/package.json deleted file mode 100644 index be0ddee6..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-exports/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "tsconfig-exports", - "private": true, - "exports": { - ".": "./conf.json" - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-field/conf.json b/fixtures/tsconfig/node_modules/tsconfig-field/conf.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-field/conf.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-field/foo.js b/fixtures/tsconfig/node_modules/tsconfig-field/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-field/package.json b/fixtures/tsconfig/node_modules/tsconfig-field/package.json deleted file mode 100644 index 7138fdde..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-field/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "tsconfig-field", - "private": true, - "tsconfig": "conf.json" -} \ No newline at end of file diff --git a/fixtures/tsconfig/node_modules/tsconfig-index/foo.js b/fixtures/tsconfig/node_modules/tsconfig-index/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-index/package.json b/fixtures/tsconfig/node_modules/tsconfig-index/package.json deleted file mode 100644 index eb2431e7..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-index/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "tsconfig-index", - "private": true -} \ No newline at end of file diff --git a/fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json b/fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-not-used/foo.js b/fixtures/tsconfig/node_modules/tsconfig-not-used/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json b/fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json deleted file mode 100644 index eb16d127..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "ts-path": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/package.json b/fixtures/tsconfig/package.json deleted file mode 100755 index f48acd1c..00000000 --- a/fixtures/tsconfig/package.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "name": "resolver", - "private": true, - "alias": { - "aliased": "foo", - "aliased-file": "./bar.js", - "something": "./nested/test.js", - "aliasedfolder": "./nested", - "aliasedabsolute": "/nested", - "foo/bar": "./bar.js", - "glob/*/*": "./nested/$2", - "./baz": "./bar.js", - "url": false - }, - "imports": { - "#test": "./bar.js" - }, - "dependencies": { - "foo": "^0.3.4" - }, - "peerDependencies": { - "bar": "*" - } -} diff --git a/fixtures/tsconfig/tsconfig.json b/fixtures/tsconfig/tsconfig.json deleted file mode 100644 index eb16d127..00000000 --- a/fixtures/tsconfig/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "ts-path": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/tsconfig_template_variable.json b/fixtures/tsconfig/tsconfig_template_variable.json deleted file mode 100644 index 6f272344..00000000 --- a/fixtures/tsconfig/tsconfig_template_variable.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["${configDir}/foo.js"] - } - } -} diff --git a/napi/__test__/resolver.spec.mjs b/napi/__test__/resolver.spec.mjs deleted file mode 100644 index ac6ee0ef..00000000 --- a/napi/__test__/resolver.spec.mjs +++ /dev/null @@ -1,260 +0,0 @@ -import { join } from 'node:path' -import { fileURLToPath } from 'node:url' - -import test from 'ava' - -let ResolverFactory - -if (process.env.WASI_TEST) { - const wasi = await import('../resolver.wasi.cjs') - ResolverFactory = wasi.ResolverFactory -} else { - const napi = await import('../index.js') - ResolverFactory = napi.ResolverFactory -} - -const currentDir = join(fileURLToPath(import.meta.url), '..') - -const enhancedResolveRoot = join( - currentDir, - '..', - '..', - 'fixtures', - 'enhanced_resolve', - 'test', - 'fixtures' -) - -// https://github.com/webpack/enhanced-resolve/blob/main/test/resolve.test.js - -for (const [title, context, request, expected] of [ - [ - 'absolute path', - enhancedResolveRoot, - join(enhancedResolveRoot, 'main1.js'), - join(enhancedResolveRoot, 'main1.js'), - ], - [ - 'file with .js', - enhancedResolveRoot, - './main1.js', - join(enhancedResolveRoot, 'main1.js'), - ], - [ - 'file without extension', - enhancedResolveRoot, - './main1', - join(enhancedResolveRoot, 'main1.js'), - ], - [ - 'another file with .js', - enhancedResolveRoot, - './a.js', - join(enhancedResolveRoot, 'a.js'), - ], - [ - 'another file without extension', - enhancedResolveRoot, - './a', - join(enhancedResolveRoot, 'a.js'), - ], - [ - 'file in module with .js', - enhancedResolveRoot, - 'm1/a.js', - join(enhancedResolveRoot, 'node_modules/m1/a.js'), - ], - [ - 'file in module without extension', - enhancedResolveRoot, - 'm1/a', - join(enhancedResolveRoot, 'node_modules/m1/a.js'), - ], - [ - 'another file in module without extension', - enhancedResolveRoot, - 'complexm/step1', - join(enhancedResolveRoot, 'node_modules/complexm/step1.js'), - ], - [ - 'from submodule to file in sibling module', - join(enhancedResolveRoot, 'node_modules/complexm'), - 'm2/b.js', - join(enhancedResolveRoot, 'node_modules/m2/b.js'), - ], - [ - 'from nested directory to overwritten file in module', - join(enhancedResolveRoot, 'multiple_modules'), - 'm1/a.js', - join(enhancedResolveRoot, 'multiple_modules/node_modules/m1/a.js'), - ], - [ - 'from nested directory to not overwritten file in module', - join(enhancedResolveRoot, 'multiple_modules'), - 'm1/b.js', - join(enhancedResolveRoot, 'node_modules/m1/b.js'), - ], - [ - 'file with query', - enhancedResolveRoot, - './main1.js?query', - join(enhancedResolveRoot, 'main1.js?query'), - ], - [ - 'file with fragment', - enhancedResolveRoot, - './main1.js#fragment', - join(enhancedResolveRoot, 'main1.js#fragment'), - ], - [ - 'file with fragment and query', - enhancedResolveRoot, - './main1.js#fragment?query', - join(enhancedResolveRoot, 'main1.js#fragment?query'), - ], - [ - 'file with query and fragment', - enhancedResolveRoot, - './main1.js?#fragment', - join(enhancedResolveRoot, 'main1.js?#fragment'), - ], - - [ - 'file with query (unicode)', - enhancedResolveRoot, - './测试.js?query', - join(enhancedResolveRoot, '测试.js?query'), - ], - [ - 'file with fragment (unicode)', - enhancedResolveRoot, - './测试.js#fragment', - join(enhancedResolveRoot, '测试.js#fragment'), - ], - [ - 'file with fragment and query (unicode)', - enhancedResolveRoot, - './测试.js#fragment?query', - join(enhancedResolveRoot, '测试.js#fragment?query'), - ], - [ - 'file with query and fragment (unicode)', - enhancedResolveRoot, - './测试.js?#fragment', - join(enhancedResolveRoot, '测试.js?#fragment'), - ], - - [ - 'file in module with query', - enhancedResolveRoot, - 'm1/a?query', - join(enhancedResolveRoot, 'node_modules/m1/a.js?query'), - ], - [ - 'file in module with fragment', - enhancedResolveRoot, - 'm1/a#fragment', - join(enhancedResolveRoot, 'node_modules/m1/a.js#fragment'), - ], - [ - 'file in module with fragment and query', - enhancedResolveRoot, - 'm1/a#fragment?query', - join(enhancedResolveRoot, 'node_modules/m1/a.js#fragment?query'), - ], - [ - 'file in module with query and fragment', - enhancedResolveRoot, - 'm1/a?#fragment', - join(enhancedResolveRoot, 'node_modules/m1/a.js?#fragment'), - ], - [ - 'differ between directory and file, resolve file', - enhancedResolveRoot, - './dirOrFile', - join(enhancedResolveRoot, 'dirOrFile.js'), - ], - [ - 'differ between directory and file, resolve directory', - enhancedResolveRoot, - './dirOrFile/', - join(enhancedResolveRoot, 'dirOrFile/index.js'), - ], - [ - 'find node_modules outside of node_modules', - join(enhancedResolveRoot, 'browser-module/node_modules'), - 'm1/a', - join(enhancedResolveRoot, 'node_modules/m1/a.js'), - ], - [ - "don't crash on main field pointing to self", - enhancedResolveRoot, - './main-field-self', - join(enhancedResolveRoot, './main-field-self/index.js'), - ], - [ - "don't crash on main field pointing to self (2)", - enhancedResolveRoot, - './main-field-self2', - join(enhancedResolveRoot, './main-field-self2/index.js'), - ], - // enhanced-resolve has `#` prepended with a `\0`, they are removed from the - // following 3 expected test results. - // See https://github.com/webpack/enhanced-resolve#escaping - [ - 'handle fragment edge case (no fragment)', - enhancedResolveRoot, - './no#fragment/#/#', - join(enhancedResolveRoot, 'no#fragment', '#', '#.js'), - ], - [ - 'handle fragment edge case (fragment)', - enhancedResolveRoot, - './no#fragment/#/', - join(enhancedResolveRoot, 'no.js#fragment') + '/#/', - ], - [ - 'handle fragment escaping', - enhancedResolveRoot, - './no\0#fragment/\0#/\0##fragment', - join(enhancedResolveRoot, 'no#fragment', '#', '#.js#fragment'), - ], -]) { - test(title, (t) => { - const resolver = new ResolverFactory({ - modules: ['src/a', 'src/b', 'src/common', 'node_modules'], - extensions: ['.js', '.jsx', '.ts', '.tsx'], - }) - - t.is(resolver.sync(context, request).path, expected) - }) -} - -test('resolve pnpm package', (t) => { - const rootDir = join(currentDir, '..', '..'); - const pnpmProjectPath = join(rootDir, 'fixtures', 'pnpm') - const resolver = new ResolverFactory({ - aliasFields: ['browser'], - }) - t.deepEqual(resolver.sync(pnpmProjectPath, 'styled-components'), { - path: join( - rootDir, - 'node_modules/.pnpm/styled-components@6.1.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/styled-components/dist/styled-components.browser.cjs.js' - ), - }) - t.deepEqual( - resolver.sync( - join( - rootDir, - 'node_modules/.pnpm/styled-components@6.1.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/styled-components' - ), - 'react' - ), - { - path: join( - rootDir, - 'node_modules/.pnpm/react@18.3.1/node_modules/react/index.js' - ), - } - ) -}) diff --git a/napi/src/lib.rs b/napi/src/lib.rs deleted file mode 100644 index 96287041..00000000 --- a/napi/src/lib.rs +++ /dev/null @@ -1,179 +0,0 @@ -extern crate napi; -extern crate napi_derive; -extern crate oxc_resolver; - -use std::{ - path::{Path, PathBuf}, - sync::Arc, -}; - -use napi_derive::napi; -use oxc_resolver::{ResolveOptions, Resolver}; - -use self::options::{NapiResolveOptions, StrOrStrList}; - -mod options; - -#[napi(object)] -pub struct ResolveResult { - pub path: Option, - pub error: Option, -} - -fn resolve(resolver: &Resolver, path: &Path, request: &str) -> ResolveResult { - match resolver.resolve(path, request) { - Ok(resolution) => ResolveResult { - path: Some(resolution.full_path().to_string_lossy().to_string()), - error: None, - }, - Err(err) => ResolveResult { path: None, error: Some(err.to_string()) }, - } -} - -#[allow(clippy::needless_pass_by_value)] -#[napi] -pub fn sync(path: String, request: String) -> ResolveResult { - let path = PathBuf::from(path); - let resolver = Resolver::new(ResolveOptions::default()); - resolve(&resolver, &path, &request) -} - -#[napi] -pub struct ResolverFactory { - resolver: Arc, -} - -#[napi] -impl ResolverFactory { - #[napi(constructor)] - pub fn new(options: NapiResolveOptions) -> Self { - Self { resolver: Arc::new(Resolver::new(Self::normalize_options(options))) } - } - - #[napi] - pub fn default() -> Self { - let default_options = ResolveOptions::default(); - Self { resolver: Arc::new(Resolver::new(default_options)) } - } - - /// Clone the resolver using the same underlying cache. - #[napi] - pub fn clone_with_options(&self, options: NapiResolveOptions) -> Self { - Self { - resolver: Arc::new(self.resolver.clone_with_options(Self::normalize_options(options))), - } - } - - /// Clear the underlying cache. - #[napi] - pub fn clear_cache(&self) { - self.resolver.clear_cache(); - } - - #[allow(clippy::needless_pass_by_value)] - #[napi] - pub fn sync(&self, path: String, request: String) -> ResolveResult { - let path = PathBuf::from(path); - resolve(&self.resolver, &path, &request) - } - - #[allow(clippy::needless_pass_by_value)] - #[napi(js_name = "async")] - pub async fn resolve_async(&self, path: String, request: String) -> ResolveResult { - let path = PathBuf::from(path); - let resolver = self.resolver.clone(); - tokio::spawn(async move { resolve(&resolver, &path, &request) }).await.unwrap() - } - - fn normalize_options(op: NapiResolveOptions) -> ResolveOptions { - let default = ResolveOptions::default(); - // merging options - ResolveOptions { - tsconfig: op.tsconfig.map(|tsconfig| tsconfig.into()), - alias: op - .alias - .map(|alias| { - alias - .into_iter() - .map(|(k, v)| { - let v = v - .into_iter() - .map(|item| match item { - Some(path) => oxc_resolver::AliasValue::from(path), - None => oxc_resolver::AliasValue::Ignore, - }) - .collect(); - (k, v) - }) - .collect::>() - }) - .unwrap_or(default.alias), - alias_fields: op - .alias_fields - .map(|o| o.into_iter().map(|x| StrOrStrList(x).into()).collect::>()) - .unwrap_or(default.alias_fields), - condition_names: op.condition_names.unwrap_or(default.condition_names), - description_files: op.description_files.unwrap_or(default.description_files), - enforce_extension: op - .enforce_extension - .map(|enforce_extension| enforce_extension.into()) - .unwrap_or(default.enforce_extension), - exports_fields: op - .exports_fields - .map(|o| o.into_iter().map(|x| StrOrStrList(x).into()).collect::>()) - .unwrap_or(default.exports_fields), - imports_fields: op - .imports_fields - .map(|o| o.into_iter().map(|x| StrOrStrList(x).into()).collect::>()) - .unwrap_or(default.imports_fields), - extension_alias: op - .extension_alias - .map(|extension_alias| extension_alias.into_iter().collect::>()) - .unwrap_or(default.extension_alias), - extensions: op.extensions.unwrap_or(default.extensions), - fallback: op - .fallback - .map(|fallback| { - fallback - .into_iter() - .map(|(k, v)| { - let v = v - .into_iter() - .map(|item| match item { - Some(path) => oxc_resolver::AliasValue::from(path), - None => oxc_resolver::AliasValue::Ignore, - }) - .collect(); - (k, v) - }) - .collect::>() - }) - .unwrap_or(default.fallback), - fully_specified: op.fully_specified.unwrap_or(default.fully_specified), - main_fields: op - .main_fields - .map(|o| StrOrStrList(o).into()) - .unwrap_or(default.main_fields), - main_files: op.main_files.unwrap_or(default.main_files), - modules: op.modules.map(|o| StrOrStrList(o).into()).unwrap_or(default.modules), - resolve_to_context: op.resolve_to_context.unwrap_or(default.resolve_to_context), - prefer_relative: op.prefer_relative.unwrap_or(default.prefer_relative), - prefer_absolute: op.prefer_absolute.unwrap_or(default.prefer_absolute), - restrictions: op - .restrictions - .map(|restrictions| { - restrictions - .into_iter() - .map(|restriction| restriction.into()) - .collect::>() - }) - .unwrap_or(default.restrictions), - roots: op - .roots - .map(|roots| roots.into_iter().map(PathBuf::from).collect::>()) - .unwrap_or(default.roots), - symlinks: op.symlinks.unwrap_or(default.symlinks), - builtin_modules: op.builtin_modules.unwrap_or(default.builtin_modules), - } - } -} diff --git a/napi/src/options.rs b/napi/src/options.rs deleted file mode 100644 index ea35672f..00000000 --- a/napi/src/options.rs +++ /dev/null @@ -1,261 +0,0 @@ -use std::path::PathBuf; - -use napi::Either; -use napi_derive::napi; -use std::collections::HashMap; - -/// Module Resolution Options -/// -/// Options are directly ported from [enhanced-resolve](https://github.com/webpack/enhanced-resolve#resolver-options). -/// -/// See [webpack resolve](https://webpack.js.org/configuration/resolve/) for information and examples -#[derive(Debug, Clone)] -#[napi(object)] -pub struct NapiResolveOptions { - /// Path to TypeScript configuration file. - /// - /// Default `None` - pub tsconfig: Option, - - /// Alias for [ResolveOptions::alias] and [ResolveOptions::fallback]. - /// - /// For the second value of the tuple, `None -> AliasValue::Ignore`, Some(String) -> - /// AliasValue::Path(String)` - /// Create aliases to import or require certain modules more easily. - /// A trailing $ can also be added to the given object's keys to signify an exact match. - pub alias: Option>>>, - - /// A list of alias fields in description files. - /// Specify a field, such as `browser`, to be parsed according to [this specification](https://github.com/defunctzombie/package-browser-field-spec). - /// Can be a path to json object such as `["path", "to", "exports"]`. - /// - /// Default `[]` - #[napi(ts_type = "(string | string[])[]")] - pub alias_fields: Option>, - - /// Condition names for exports field which defines entry points of a package. - /// The key order in the exports field is significant. During condition matching, earlier entries have higher priority and take precedence over later entries. - /// - /// Default `[]` - pub condition_names: Option>, - - /// The JSON files to use for descriptions. (There was once a `bower.json`.) - /// - /// Default `["package.json"]` - pub description_files: Option>, - - /// If true, it will not allow extension-less files. - /// So by default `require('./foo')` works if `./foo` has a `.js` extension, - /// but with this enabled only `require('./foo.js')` will work. - /// - /// Default to `true` when [ResolveOptions::extensions] contains an empty string. - /// Use `Some(false)` to disable the behavior. - /// See - /// - /// Default None, which is the same as `Some(false)` when the above empty rule is not applied. - pub enforce_extension: Option, - - /// A list of exports fields in description files. - /// Can be a path to json object such as `["path", "to", "exports"]`. - /// - /// Default `[["exports"]]`. - #[napi(ts_type = "(string | string[])[]")] - pub exports_fields: Option>, - - /// Fields from `package.json` which are used to provide the internal requests of a package - /// (requests starting with # are considered internal). - /// - /// Can be a path to a JSON object such as `["path", "to", "imports"]`. - /// - /// Default `[["imports"]]`. - #[napi(ts_type = "(string | string[])[]")] - pub imports_fields: Option>, - - /// An object which maps extension to extension aliases. - /// - /// Default `{}` - pub extension_alias: Option>>, - - /// Attempt to resolve these extensions in order. - /// If multiple files share the same name but have different extensions, - /// will resolve the one with the extension listed first in the array and skip the rest. - /// - /// Default `[".js", ".json", ".node"]` - pub extensions: Option>, - - /// Redirect module requests when normal resolving fails. - /// - /// Default `[]` - pub fallback: Option>>>, - - /// 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). - /// - /// See also webpack configuration [resolve.fullySpecified](https://webpack.js.org/configuration/module/#resolvefullyspecified) - /// - /// Default `false` - pub fully_specified: Option, - - /// A list of main fields in description files - /// - /// Default `["main"]`. - #[napi(ts_type = "string | string[]")] - pub main_fields: Option, - - /// The filename to be used while resolving directories. - /// - /// Default `["index"]` - pub main_files: Option>, - - /// A list of directories to resolve modules from, can be absolute path or folder name. - /// - /// Default `["node_modules"]` - #[napi(ts_type = "string | string[]")] - pub modules: Option, - - /// Resolve to a context instead of a file. - /// - /// Default `false` - pub resolve_to_context: Option, - - /// Prefer to resolve module requests as relative requests instead of using modules from node_modules directories. - /// - /// Default `false` - pub prefer_relative: Option, - - /// Prefer to resolve server-relative urls as absolute paths before falling back to resolve in ResolveOptions::roots. - /// - /// Default `false` - pub prefer_absolute: Option, - - /// A list of resolve restrictions to restrict the paths that a request can be resolved on. - /// - /// Default `[]` - pub restrictions: Option>, - - /// A list of directories where requests of server-relative URLs (starting with '/') are resolved. - /// On non-Windows systems these requests are resolved as an absolute path first. - /// - /// Default `[]` - pub roots: Option>, - - /// Whether to resolve symlinks to their symlinked location. - /// When enabled, symlinked resources are resolved to their real path, not their symlinked location. - /// Note that this may cause module resolution to fail when using tools that symlink packages (like npm link). - /// - /// Default `true` - pub symlinks: Option, - - /// Whether to parse [module.builtinModules](https://nodejs.org/api/module.html#modulebuiltinmodules) or not. - /// For example, "zlib" will throw [crate::ResolveError::Builtin] when set to true. - /// - /// Default `false` - pub builtin_modules: Option, -} - -#[napi] -#[derive(Debug, PartialEq, Eq)] -pub enum EnforceExtension { - Auto, - Enabled, - Disabled, -} - -impl EnforceExtension { - pub fn is_auto(&self) -> bool { - *self == Self::Auto - } - - pub fn is_enabled(&self) -> bool { - *self == Self::Enabled - } - - pub fn is_disabled(&self) -> bool { - *self == Self::Disabled - } -} - -/// Alias Value for [ResolveOptions::alias] and [ResolveOptions::fallback]. -/// Use struct because napi don't support structured union now -#[napi(object)] -#[derive(Debug, Clone)] -pub struct Restriction { - pub path: Option, - pub regex: Option, -} - -/// Tsconfig Options -/// -/// Derived from [tsconfig-paths-webpack-plugin](https://github.com/dividab/tsconfig-paths-webpack-plugin#options) -#[napi(object)] -#[derive(Debug, Clone)] -pub struct TsconfigOptions { - /// Allows you to specify where to find the TypeScript configuration file. - /// You may provide - /// * a relative path to the configuration file. It will be resolved relative to cwd. - /// * an absolute path to the configuration file. - pub config_file: String, - - /// Support for Typescript Project References. - /// - /// * `'auto'`: use the `references` field from tsconfig of `config_file`. - /// * `string[]`: manually provided relative or absolute path. - #[napi(ts_type = "'auto' | string[]")] - pub references: Option>>, -} - -impl Into for Restriction { - fn into(self) -> oxc_resolver::Restriction { - match (self.path, self.regex) { - (None, None) => { - panic!("Should specify path or regex") - } - (None, Some(regex)) => oxc_resolver::Restriction::RegExp(regex), - (Some(path), None) => oxc_resolver::Restriction::Path(PathBuf::from(path)), - (Some(_), Some(_)) => { - panic!("Restriction can't be path and regex at the same time") - } - } - } -} - -impl Into for EnforceExtension { - fn into(self) -> oxc_resolver::EnforceExtension { - match self { - EnforceExtension::Auto => oxc_resolver::EnforceExtension::Auto, - EnforceExtension::Enabled => oxc_resolver::EnforceExtension::Enabled, - EnforceExtension::Disabled => oxc_resolver::EnforceExtension::Disabled, - } - } -} - -impl Into for TsconfigOptions { - fn into(self) -> oxc_resolver::TsconfigOptions { - oxc_resolver::TsconfigOptions { - config_file: PathBuf::from(self.config_file), - references: match self.references { - Some(Either::A(string)) if string.as_str() == "auto" => { - oxc_resolver::TsconfigReferences::Auto - } - Some(Either::A(opt)) => { - panic!("`{}` is not a valid option for tsconfig references", opt) - } - Some(Either::B(paths)) => oxc_resolver::TsconfigReferences::Paths( - paths.into_iter().map(PathBuf::from).collect::>(), - ), - None => oxc_resolver::TsconfigReferences::Disabled, - }, - } - } -} - -type StrOrStrListType = Either>; -pub struct StrOrStrList(pub StrOrStrListType); - -impl Into> for StrOrStrList { - fn into(self) -> Vec { - match self { - StrOrStrList(Either::A(s)) => Vec::from([s]), - StrOrStrList(Either::B(a)) => a, - } - } -} diff --git a/napi/tests/options.test.mjs b/napi/tests/options.test.mjs deleted file mode 100644 index 4a93efff..00000000 --- a/napi/tests/options.test.mjs +++ /dev/null @@ -1,59 +0,0 @@ -import { describe, it } from "node:test"; -import { ResolverFactory } from "../index.js"; -import * as assert from "node:assert"; -import * as path from "node:path"; - -const fixtureDir = new URL( - "../../fixtures/enhanced_resolve/test/fixtures", - import.meta.url -).pathname; - -describe("option", () => { - describe("aliasFields", () => { - it("should allow field string ", () => { - const resolver = new ResolverFactory({ aliasFields: ["browser"] }); - assert.match( - resolver.sync(fixtureDir, "./browser-module/lib/replaced.js").path, - /browser-module\/lib\/browser\.js$/ - ); - }); - it("should allow json path array", () => { - const resolver = new ResolverFactory({ - aliasFields: [["innerBrowser1", "field", "browser"]], - }); - - assert.match( - resolver.sync(fixtureDir, "./browser-module/lib/main1.js").path, - /browser-module\/lib\/main\.js$/ - ); - }); - }); - - describe("exportsFields", () => { - const createTest = (exportsFields) => { - const resolver = new ResolverFactory({ exportsFields }); - assert.match( - resolver.sync( - path.resolve(fixtureDir, "./exports-field3"), - "exports-field" - ).path, - /\/exports-field\/src\/index\.js$/ - ); - }; - it("should allow string as field item", createTest(["broken"])); - it("should allow json path array as field item", createTest([["broken"]])); - }); - - describe("mainFields", () => { - const createTest = (mainFields) => { - const resolver = new ResolverFactory({ mainFields }); - assert.match( - resolver.sync(fixtureDir, "../..").path, - /\/lib\/index\.js$/ - ); - }; - it("should use `'main'` as default", createTest(undefined)); - it("should allow field string", createTest("main")); - it("should allow field array", createTest(["main"])); - }); -}); diff --git a/npm/package.json b/npm/package.json index c04401ac..8e711b3a 100644 --- a/npm/package.json +++ b/npm/package.json @@ -1,46 +1,35 @@ { - "name": "oxc-resolver", - "version": "1.9.1", - "description": "Oxc Resolver Node API", - "main": "index.js", - "browser": "browser.js", - "files": [ - "index.d.ts", - "index.js", - "browser.js" - ], - "license": "MIT", - "homepage": "https://oxc.rs", - "repository": { - "type": "git", - "url": "git+https://github.com/oxc-project/oxc-resolver.git" - }, - "publishConfig": { - "registry": "https://registry.npmjs.org/", - "access": "public" - }, - "napi": { - "binaryName": "resolver", - "packageName": "@oxc-resolver/binding", - "wasm": { - "browser": { - "fs": true - } - }, - "targets": [ - "x86_64-pc-windows-msvc", - "aarch64-pc-windows-msvc", - "x86_64-unknown-linux-gnu", - "x86_64-unknown-linux-musl", - "aarch64-unknown-linux-gnu", - "aarch64-unknown-linux-musl", - "armv7-unknown-linux-gnueabihf", - "x86_64-apple-darwin", - "aarch64-apple-darwin", - "wasm32-wasip1-threads" - ] - }, - "funding": { - "url": "https://github.com/sponsors/Boshen" - } + "name": "oxc-resolver", + "description": "Oxc Resolver Node API", + "funding": { + "url": "https://github.com/sponsors/Boshen" + }, + "main": "index.js", + "browser": "browser.js", + "files": [ + "index.d.ts", + "index.js", + "browser.js" + ], + "napi": { + "binaryName": "resolver", + "packageName": "@oxc-resolver/binding", + "targets": [ + "x86_64-pc-windows-msvc", + "aarch64-pc-windows-msvc", + "x86_64-unknown-linux-gnu", + "x86_64-unknown-linux-musl", + "aarch64-unknown-linux-gnu", + "aarch64-unknown-linux-musl", + "armv7-unknown-linux-gnueabihf", + "x86_64-apple-darwin", + "aarch64-apple-darwin", + "wasm32-wasip1-threads" + ], + "wasm": { + "browser": { + "fs": true + } + } + } } diff --git a/package.json b/package.json index 51cb822a..a431e48f 100644 --- a/package.json +++ b/package.json @@ -1,33 +1,24 @@ { - "name": "@oxc-resolver/binding", - "private": true, - "version": "0.0.0", - "scripts": { - "build": "napi build --platform --release --package-json-path npm/package.json --manifest-path napi/Cargo.toml", - "build:debug": "napi build --platform --package-json-path npm/package.json --manifest-path napi/Cargo.toml", - "prepublishOnly": "napi pre-publish -t npm", - "test": "ava" - }, - "devDependencies": { - "@napi-rs/cli": "^3.0.0-alpha.43", - "@napi-rs/wasm-runtime": "^0.2.0", - "@types/node": "^20.10.4", - "ava": "^6.0.1", - "emnapi": "^1.0.0", - "typescript": "^5.3.3" - }, - "ava": { - "files": [ - "napi/__test__/*.spec.mjs" - ], - "cache": false - }, - "packageManager": "pnpm@9.4.0", - "repository": { - "type": "git", - "url": "git+https://github.com/oxc-project/oxc-resolver.git" - }, - "funding": { - "url": "https://github.com/sponsors/Boshen" - } + "name": "@oxc-resolver/binding", + "funding": { + "url": "https://github.com/sponsors/Boshen" + }, + "scripts": { + "build": "napi build --platform --release --package-json-path npm/package.json --manifest-path napi/Cargo.toml", + "build:debug": "napi build --platform --package-json-path npm/package.json --manifest-path napi/Cargo.toml", + "prepublishOnly": "napi pre-publish -t npm" + }, + "ava": { + "cache": false, + "files": [ + "napi/__test__/*.spec.mjs" + ] + }, + "devDependencies": { + "@napi-rs/cli": "^3.0.0-alpha.43", + "@napi-rs/wasm-runtime": "^0.2.0", + "@types/node": "^20.10.4", + "ava": "^6.0.1", + "emnapi": "^1.0.0" + } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml deleted file mode 100644 index 162a4b3c..00000000 --- a/pnpm-lock.yaml +++ /dev/null @@ -1,2690 +0,0 @@ -lockfileVersion: '9.0' - -settings: - autoInstallPeers: true - excludeLinksFromLockfile: false - -importers: - - .: - devDependencies: - '@napi-rs/cli': - specifier: ^3.0.0-alpha.43 - version: 3.0.0-alpha.55(@emnapi/runtime@1.2.0)(emnapi@1.2.0) - '@napi-rs/wasm-runtime': - specifier: ^0.2.0 - version: 0.2.4 - '@types/node': - specifier: ^20.10.4 - version: 20.14.8 - ava: - specifier: ^6.0.1 - version: 6.1.3 - emnapi: - specifier: ^1.0.0 - version: 1.2.0 - typescript: - specifier: ^5.3.3 - version: 5.5.2 - - fixtures/pnpm: - devDependencies: - axios: - specifier: 1.6.2 - version: 1.6.2 - postcss: - specifier: 8.4.33 - version: 8.4.33 - styled-components: - specifier: 6.1.1 - version: 6.1.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - - npm: {} - -packages: - - '@emnapi/core@1.2.0': - resolution: {integrity: sha512-E7Vgw78I93we4ZWdYCb4DGAwRROGkMIXk7/y87UmANR+J6qsWusmC3gLt0H+O0KOt5e6O38U8oJamgbudrES/w==} - - '@emnapi/runtime@1.2.0': - resolution: {integrity: sha512-bV21/9LQmcQeCPEg3BDFtvwL6cwiTMksYNWQQ4KOxCZikEGalWtenoZ0wCiukJINlGCIi2KXx01g4FoH/LxpzQ==} - - '@emnapi/wasi-threads@1.0.1': - resolution: {integrity: sha512-iIBu7mwkq4UQGeMEM8bLwNK962nXdhodeScX4slfQnRhEMMzvYivHhutCIk8uojvmASXXPC2WNEjwxFWk72Oqw==} - - '@emotion/is-prop-valid@1.2.2': - resolution: {integrity: sha512-uNsoYd37AFmaCdXlg6EYD1KaPOaRWRByMCYzbKUX4+hhMfrxdVSelShywL4JVaAeM/eHUOSprYBQls+/neX3pw==} - - '@emotion/memoize@0.8.1': - resolution: {integrity: sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA==} - - '@emotion/unitless@0.8.1': - resolution: {integrity: sha512-KOEGMu6dmJZtpadb476IsZBclKvILjopjUii3V+7MnXIQCYh8W3NgNcgwo21n9LXZX6EDIKvqfjYxXebDwxKmQ==} - - '@inquirer/figures@1.0.3': - resolution: {integrity: sha512-ErXXzENMH5pJt5/ssXV0DfWUZqly8nGzf0UcBV9xTnP+KyffE2mqyxIMBrZ8ijQck2nU0TQm40EQB53YreyWHw==} - engines: {node: '>=18'} - - '@ljharb/through@2.3.13': - resolution: {integrity: sha512-/gKJun8NNiWGZJkGzI/Ragc53cOdcLNdzjLaIa+GEjguQs0ulsurx8WN0jijdK9yPqDvziX995sMRLyLt1uZMQ==} - engines: {node: '>= 0.4'} - - '@mapbox/node-pre-gyp@1.0.11': - resolution: {integrity: sha512-Yhlar6v9WQgUp/He7BdgzOz8lqMQ8sU+jkCq7Wx8Myc5YFJLbEe7lgui/V7G1qB1DJykHSGwreceSaD60Y0PUQ==} - hasBin: true - - '@napi-rs/cli@3.0.0-alpha.55': - resolution: {integrity: sha512-6XgBBTX8O28W5gcSzqYkI72UVJV6Y2YcyQNrEqak39JavJRLlXCv09uLF97raynXAOO50KeP6DEXFy5P8MR2sw==} - engines: {node: '>= 16'} - hasBin: true - peerDependencies: - '@emnapi/runtime': ^1.1.0 - emnapi: ^1.1.0 - peerDependenciesMeta: - '@emnapi/runtime': - optional: true - emnapi: - optional: true - - '@napi-rs/cross-toolchain@0.0.16': - resolution: {integrity: sha512-jwdjHT5L0m9MH0CmzDwPp0ckn/UO7afHCsPeo7NugHUvYgvlgS7SWhdMVgIgJW2HHqhcW/2nhaLLGpAU1c7QRQ==} - peerDependencies: - '@napi-rs/cross-toolchain-arm64-target-aarch64': ^0.0.16 - '@napi-rs/cross-toolchain-arm64-target-armv7': ^0.0.16 - '@napi-rs/cross-toolchain-arm64-target-x86_64': ^0.0.16 - '@napi-rs/cross-toolchain-x64-target-aarch64': ^0.0.16 - '@napi-rs/cross-toolchain-x64-target-armv7': ^0.0.16 - '@napi-rs/cross-toolchain-x64-target-x86_64': ^0.0.16 - peerDependenciesMeta: - '@napi-rs/cross-toolchain-arm64-target-aarch64': - optional: true - '@napi-rs/cross-toolchain-arm64-target-armv7': - optional: true - '@napi-rs/cross-toolchain-arm64-target-x86_64': - optional: true - '@napi-rs/cross-toolchain-x64-target-aarch64': - optional: true - '@napi-rs/cross-toolchain-x64-target-armv7': - optional: true - '@napi-rs/cross-toolchain-x64-target-x86_64': - optional: true - - '@napi-rs/lzma-android-arm-eabi@1.3.1': - resolution: {integrity: sha512-mtGOg8jXlc+pTBI86cqohfndS9UmOAkk9d5CChKMb8btVks70yhUN1e7YYS3QFbmoxbPs2Ee+wmuH1Khdc7B2w==} - engines: {node: '>= 10'} - cpu: [arm] - os: [android] - - '@napi-rs/lzma-android-arm64@1.3.1': - resolution: {integrity: sha512-4uGkQgAv9Tnc/i0k2eIgbhZgyzs94+iECWxz4MFZNcZ1fNGvGbRL2j+SITE4OmwrUn3TuFK/uYWfgzooq8E1Qg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [android] - - '@napi-rs/lzma-darwin-arm64@1.3.1': - resolution: {integrity: sha512-MZBg4iwHTS8icjTiCMdzh8kYrMmKBCEglFPa+vjI91R2XDwuuwSzqmpATRpmMH8cWUUWtGPF4fnxKzjgkzhd4Q==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [darwin] - - '@napi-rs/lzma-darwin-x64@1.3.1': - resolution: {integrity: sha512-7vte+1lYV7xgZERKH/pjAeh4T16aQASKOzu4op70pK6VP/64Plr5rrvqxQqQmlAIe4pwyo/RkFl1n4LXDod3xg==} - engines: {node: '>= 10'} - cpu: [x64] - os: [darwin] - - '@napi-rs/lzma-freebsd-x64@1.3.1': - resolution: {integrity: sha512-uBS74fynTqLUC3catIxyezCafn8UDlr2yxVV47vz1T6Vop2PGDz/cMQdV6rnLSjPE08Rv66ihM36mgf/MmOkOg==} - engines: {node: '>= 10'} - cpu: [x64] - os: [freebsd] - - '@napi-rs/lzma-linux-arm-gnueabihf@1.3.1': - resolution: {integrity: sha512-rrVLyqBJeN29gPJCNkPbZ7dAzaseEcERKyhjwM+DfbFrDUvtkEcrYPvo+iwE/NmF+OkZQkzcanrVMGnq/mcJYQ==} - engines: {node: '>= 10'} - cpu: [arm] - os: [linux] - - '@napi-rs/lzma-linux-arm64-gnu@1.3.1': - resolution: {integrity: sha512-vDmVsthRbX2opkgRirJJGKQxUP/spvyVM2Y5CyCWZ7sadSID3hA97r38gf9ISn/sJ8/r93IPWLq+iycudNKi+Q==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/lzma-linux-arm64-musl@1.3.1': - resolution: {integrity: sha512-x4m/J3hRdFd3IoqKc+4aBcSUkcuDEP7hH6vdss8bKNLjPfXmnG/lcHJEQX3hNnNOULPP8xVRxgiY8jeL62cnsw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/lzma-linux-x64-gnu@1.3.1': - resolution: {integrity: sha512-riB+Xg72NfH8Kcpq07omshVu0QsLW0v2bhywBNYxvA+t2dGGWSIEN1U/zazUXys+IEA6pBQKqLVseurWE6Cl8g==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/lzma-linux-x64-musl@1.3.1': - resolution: {integrity: sha512-JXLgJFwoeysxdSg7rdVYP8wrliCQVJlU5JcLYjRVSCL4P0mQTjnYi7R7VdaOkDACw/Fvlji7oIJXt0KiaDTcOw==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/lzma-wasm32-wasi@1.3.1': - resolution: {integrity: sha512-XTA9XTUtj0KPKuzNS2oi3bWN6tJodk00wwMd/TiKoEqx9Fe/zu+OfDGuXAn+xs+P7S3YCDHqjYinuTQMZ0ucJw==} - engines: {node: '>=14.0.0'} - cpu: [wasm32] - - '@napi-rs/lzma-win32-arm64-msvc@1.3.1': - resolution: {integrity: sha512-qLDfs9UEtLPPTN/FdSz3gSdlx86VwFQBuLBrQtaiYQtUTKZCOYV1Z1fXqFt5Zqa1HKV2oyXnwGcTI7RpcyXxtg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [win32] - - '@napi-rs/lzma-win32-ia32-msvc@1.3.1': - resolution: {integrity: sha512-rWNlxLFMIfvxzfdQCfeQ3D/HEnQG3vfladFYrXUx6ePXO6r+BLCGn6/LWSSuKlw4vKkb1iHEWsAVaRLIcJEMIA==} - engines: {node: '>= 10'} - cpu: [ia32] - os: [win32] - - '@napi-rs/lzma-win32-x64-msvc@1.3.1': - resolution: {integrity: sha512-SNfHNqEjabXfTL1+KRi0qiAhwIlZHhQystvfSYX6p1g+2trSC/3WUpUQ4fbbR7KyE31g2AAnwjXivnlQ0af/pg==} - engines: {node: '>= 10'} - cpu: [x64] - os: [win32] - - '@napi-rs/lzma@1.3.1': - resolution: {integrity: sha512-XyZoBlYNMvCulK/RmVK/0nB3j7IdH7HpqcrMMg0U+HqQqKRLOQBwvnKNBocPC1bZQ7iZuKWYTLn1ayZwTyek8w==} - engines: {node: '>= 10'} - - '@napi-rs/tar-android-arm-eabi@0.1.1': - resolution: {integrity: sha512-Ufa0ahZvE5KGrC2WBux5svCe/jvC+e8IgtleiicwqnfgTfbDknYyq/QuqkP1AnMp/IvTmx2iutCZt6OFIG0zAg==} - engines: {node: '>= 10'} - cpu: [arm] - os: [android] - - '@napi-rs/tar-android-arm64@0.1.1': - resolution: {integrity: sha512-KUu5fHIiIObSuZ/crHxUrQ243+LiCRKPwdCVLHwjtftqFjzls+R2Mp6GrpM41XxexDMN00SUta3kazi93Xr19A==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [android] - - '@napi-rs/tar-darwin-arm64@0.1.1': - resolution: {integrity: sha512-jaqgdX20iIga+2gzotQ78eF00Cm8vECocUYeMY62WqyzJNv/jx1dlOfELWEccOjpmawFT9tjWebsS9F1QMvSUg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [darwin] - - '@napi-rs/tar-darwin-x64@0.1.1': - resolution: {integrity: sha512-80sa32IxfRso9x9sGTFpfLSx3BnruyJODpSkUzalOCz9i14n5gOKA8KR/JrnSWwDz0p5l5P9kfQD3pu8Voj7WA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [darwin] - - '@napi-rs/tar-freebsd-x64@0.1.1': - resolution: {integrity: sha512-P7V1zBjjC1dCrTwtUzuzYM4AeZduigeCtd8qQw2IUZowM5AsmhMd77oYuXjdU29cEpKUpyYjJRxjPCzFy+WbAQ==} - engines: {node: '>= 10'} - cpu: [x64] - os: [freebsd] - - '@napi-rs/tar-linux-arm-gnueabihf@0.1.1': - resolution: {integrity: sha512-qpC71ILPkWKt8k1iJCYt5gjwcOkd2VFSQIelTRr12t5CVNKV04rE/TMdwFoCP7kxbtb9Fl2cZzCRISw2BhMCmQ==} - engines: {node: '>= 10'} - cpu: [arm] - os: [linux] - - '@napi-rs/tar-linux-arm64-gnu@0.1.1': - resolution: {integrity: sha512-71QgxcFJCog6O4Tauoge8D0ILkDGJTRk3ru7zG8PUFG1QXJ1kkiRikdT77YmoVxtomc9FUOt+bdEdU5Yn+3QUQ==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/tar-linux-arm64-musl@0.1.1': - resolution: {integrity: sha512-R2e7YEILPKc447N1hUt1zQuyy0st83HX6nhmtFywS1aOj76/3hzxLVrebGiiS6kifyCrO82o66CNTYe7DixMZw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/tar-linux-x64-gnu@0.1.1': - resolution: {integrity: sha512-tmy9q2LXUB2GQ+IgUzJn3+us52leplMu96ORyFq1iHQEelGSqXt4xi5DzU07JhX3obJPqVqkybtcRS4enBfmBA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/tar-linux-x64-musl@0.1.1': - resolution: {integrity: sha512-j5ePbe6vihApl0cGPPDUVTWZbf2mF4NhxngAoG2jp7AeX3cWP2O4pjsvaOraW6QfvWEMFPeER7S0b6eBS7duvA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/tar-wasm32-wasi@0.1.1': - resolution: {integrity: sha512-se0+DlOiIRt7mcz7BeOJDoZtCrROpKLwiAOGmNgrjQ/SZS7TnOPuwm3wy9XN9WLoepttEjCEem6UP8yD5GJuQg==} - engines: {node: '>=14.0.0'} - cpu: [wasm32] - - '@napi-rs/tar-win32-arm64-msvc@0.1.1': - resolution: {integrity: sha512-FDZPi2wC7RwzvodogigLh/pJvhqCTVTUqOYuHlLkPSUbSAGiEkI55wk9RqH3y3EdJQaDuzyqC0QKz5ket2U+GA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [win32] - - '@napi-rs/tar-win32-ia32-msvc@0.1.1': - resolution: {integrity: sha512-OPR9Tou5z5M912G7Kc7gkf1ltinbOQx5dS/OeDIWHvPGOfdFDIxt0YVKhzSLRJi43+zIDp8/+cbeMD/cKXfX8w==} - engines: {node: '>= 10'} - cpu: [ia32] - os: [win32] - - '@napi-rs/tar-win32-x64-msvc@0.1.1': - resolution: {integrity: sha512-hiv5KfhrMSg8tTRC2oQXVckVg1h6ZVjwbd5aF9Esl0V3p2TaNFwwbqgnAN4Gm/PmSnHWNL/IRTHkk3cOzDWihQ==} - engines: {node: '>= 10'} - cpu: [x64] - os: [win32] - - '@napi-rs/tar@0.1.1': - resolution: {integrity: sha512-FOMhwwlvoYjHaDBxP26K3D92ltw1Y/CC4CIjgC6qXdzW4MYNwTlEyI58smCM3k+nCVJH3kpOYyH3sgbK4WZA4A==} - engines: {node: '>= 10'} - - '@napi-rs/wasm-runtime@0.2.4': - resolution: {integrity: sha512-9zESzOO5aDByvhIAsOy9TbpZ0Ur2AJbUI7UT73kcUTS2mxAMHOBaa1st/jAymNoCtvrit99kkzT1FZuXVcgfIQ==} - - '@napi-rs/wasm-tools-android-arm-eabi@0.0.2': - resolution: {integrity: sha512-/b+UU3suXjW4P0DzHRNdrnebQtFKcQf/YMeZJH+xUlKgvwli5kbmWjx8Wqqz0VETVkUTuPqJMBDIVLyc+14FGw==} - engines: {node: '>= 10'} - cpu: [arm] - os: [android] - - '@napi-rs/wasm-tools-android-arm64@0.0.2': - resolution: {integrity: sha512-j57GbDflwJdZtT8pZj5fOV4JAP+LdKN+wzsUYs+QRUoBqpWbbUANudolqfw63bkS9sD4z7fbCuz8iwtJqzxTVA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [android] - - '@napi-rs/wasm-tools-darwin-arm64@0.0.2': - resolution: {integrity: sha512-P2ChgWgVuv9GwmbxN89R84KzIImoTqXINteEixUvmkdnhyFiR+I8deNs89Yed+5w8QLC6MEfrtRqLP9YI+NoQA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [darwin] - - '@napi-rs/wasm-tools-darwin-x64@0.0.2': - resolution: {integrity: sha512-T/kQQ0gt8+wau1Z821PKVAD76QhmwVoLs2CT7Z9tTBs2pJvwSCP0C/kQiQAHcJIMi7A2E9Ab/Mez0BERy50EFA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [darwin] - - '@napi-rs/wasm-tools-freebsd-x64@0.0.2': - resolution: {integrity: sha512-GnnHu+r5sfzuxC/1J5UMF/h3BOZnHb3NQZ5hmbCfZYCKzpzRxrAJhzRunlbRN+v0x8M/49dztVTYR3s7K4ooAw==} - engines: {node: '>= 10'} - cpu: [x64] - os: [freebsd] - - '@napi-rs/wasm-tools-linux-arm64-gnu@0.0.2': - resolution: {integrity: sha512-KnZdLT0OnKb1CG2kdt3/WvM43vr9i+FEwXCvSOVC/6Tsifz7ynhMg7LAVESILd03HubzQJfg9nbRsk0bQ+IOwg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/wasm-tools-linux-arm64-musl@0.0.2': - resolution: {integrity: sha512-HkpZOID2U8P6pWqK3mqZ8bxU5xcuT3iA2fO+jrxn78h006iYgfNmdc5JaVhHnHazMmk32xKhSV4iV0VUh8UWDg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/wasm-tools-linux-x64-gnu@0.0.2': - resolution: {integrity: sha512-YksJWBCyOalB9ogtP9+/dZKP+vR6+h7BmzMXaXMT71WW/GvIsifMVgv+DY/FRSNJQupp5Y+ugjqVAOUOc/G65g==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/wasm-tools-linux-x64-musl@0.0.2': - resolution: {integrity: sha512-sPtRxPMdw05KdTcxgSPMmSXG2+PiK3vJ/l2+g9hvjnnKtvslJN2Hr7j8zgzuoKRAUFPaJVe6+D2xVh5cpdqhww==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/wasm-tools-wasm32-wasi@0.0.2': - resolution: {integrity: sha512-muRvZK7AIuo88G2AxYx3gA59rHMQgoN004saQkBvXnz3K/DVHKfTZ6TtUebss8zI3dURU6xExL8drxFWYxjEbQ==} - engines: {node: '>=14.0.0'} - cpu: [wasm32] - - '@napi-rs/wasm-tools-win32-arm64-msvc@0.0.2': - resolution: {integrity: sha512-Cn13WQ+tpFqdVwx0DIWKbsI9auFyzVZV4F5UNOUeDt6GgOL+NndgJul0Pc9bSU6fi03AylMPfF/nTCaDWO2Wgw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [win32] - - '@napi-rs/wasm-tools-win32-ia32-msvc@0.0.2': - resolution: {integrity: sha512-xsg5DkIQi82a8rcx6246Y3XC8TIqHamY+/C6sIlPLaZEuHctDkMECAw0AANwRf5vN//D2oo2oljOuoYtB1GOKw==} - engines: {node: '>= 10'} - cpu: [ia32] - os: [win32] - - '@napi-rs/wasm-tools-win32-x64-msvc@0.0.2': - resolution: {integrity: sha512-yHigltEt33eq8bappvKsIliz4MxfMPn1M+NWbIFRWN+IS1Z57mhmc1osuk+IRXrSlq0Tom0R6MYN1jpkZKz81Q==} - engines: {node: '>= 10'} - cpu: [x64] - os: [win32] - - '@napi-rs/wasm-tools@0.0.2': - resolution: {integrity: sha512-kBvDQCP5BLw2TxTENXLp3Of7vVEx0uyIye824JHE4dduzzOHVgSoOFVhVqAT3Fx/hLV445RVWfEqQbXMg4w/Mw==} - engines: {node: '>= 10'} - - '@nodelib/fs.scandir@2.1.5': - resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} - engines: {node: '>= 8'} - - '@nodelib/fs.stat@2.0.5': - resolution: {integrity: sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==} - engines: {node: '>= 8'} - - '@nodelib/fs.walk@1.2.8': - resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} - engines: {node: '>= 8'} - - '@octokit/auth-token@4.0.0': - resolution: {integrity: sha512-tY/msAuJo6ARbK6SPIxZrPBms3xPbfwBrulZe0Wtr/DIY9lje2HeV1uoebShn6mx7SjCHif6EjMvoREj+gZ+SA==} - engines: {node: '>= 18'} - - '@octokit/core@5.2.0': - resolution: {integrity: sha512-1LFfa/qnMQvEOAdzlQymH0ulepxbxnCYAKJZfMci/5XJyIHWgEYnDmgnKakbTh7CH2tFQ5O60oYDvns4i9RAIg==} - engines: {node: '>= 18'} - - '@octokit/endpoint@9.0.5': - resolution: {integrity: sha512-ekqR4/+PCLkEBF6qgj8WqJfvDq65RH85OAgrtnVp1mSxaXF03u2xW/hUdweGS5654IlC0wkNYC18Z50tSYTAFw==} - engines: {node: '>= 18'} - - '@octokit/graphql@7.1.0': - resolution: {integrity: sha512-r+oZUH7aMFui1ypZnAvZmn0KSqAUgE1/tUXIWaqUCa1758ts/Jio84GZuzsvUkme98kv0WFY8//n0J1Z+vsIsQ==} - engines: {node: '>= 18'} - - '@octokit/openapi-types@22.2.0': - resolution: {integrity: sha512-QBhVjcUa9W7Wwhm6DBFu6ZZ+1/t/oYxqc2tp81Pi41YNuJinbFRx8B133qVOrAaBbF7D/m0Et6f9/pZt9Rc+tg==} - - '@octokit/plugin-paginate-rest@11.3.1': - resolution: {integrity: sha512-ryqobs26cLtM1kQxqeZui4v8FeznirUsksiA+RYemMPJ7Micju0WSkv50dBksTuZks9O5cg4wp+t8fZ/cLY56g==} - engines: {node: '>= 18'} - peerDependencies: - '@octokit/core': '5' - - '@octokit/plugin-request-log@4.0.1': - resolution: {integrity: sha512-GihNqNpGHorUrO7Qa9JbAl0dbLnqJVrV8OXe2Zm5/Y4wFkZQDfTreBzVmiRfJVfE4mClXdihHnbpyyO9FSX4HA==} - engines: {node: '>= 18'} - peerDependencies: - '@octokit/core': '5' - - '@octokit/plugin-rest-endpoint-methods@13.2.2': - resolution: {integrity: sha512-EI7kXWidkt3Xlok5uN43suK99VWqc8OaIMktY9d9+RNKl69juoTyxmLoWPIZgJYzi41qj/9zU7G/ljnNOJ5AFA==} - engines: {node: '>= 18'} - peerDependencies: - '@octokit/core': ^5 - - '@octokit/request-error@5.1.0': - resolution: {integrity: sha512-GETXfE05J0+7H2STzekpKObFe765O5dlAKUTLNGeH+x47z7JjXHfsHKo5z21D/o/IOZTUEI6nyWyR+bZVP/n5Q==} - engines: {node: '>= 18'} - - '@octokit/request@8.4.0': - resolution: {integrity: sha512-9Bb014e+m2TgBeEJGEbdplMVWwPmL1FPtggHQRkV+WVsMggPtEkLKPlcVYm/o8xKLkpJ7B+6N8WfQMtDLX2Dpw==} - engines: {node: '>= 18'} - - '@octokit/rest@20.1.1': - resolution: {integrity: sha512-MB4AYDsM5jhIHro/dq4ix1iWTLGToIGk6cWF5L6vanFaMble5jTX/UBQyiv05HsWnwUtY8JrfHy2LWfKwihqMw==} - engines: {node: '>= 18'} - - '@octokit/types@13.5.0': - resolution: {integrity: sha512-HdqWTf5Z3qwDVlzCrP8UJquMwunpDiMPt5er+QjGzL4hqr/vBVY/MauQgS1xWxCDT1oMx1EULyqxncdCY/NVSQ==} - - '@rollup/pluginutils@4.2.1': - resolution: {integrity: sha512-iKnFXr7NkdZAIHiIWE+BX5ULi/ucVFYWD6TbAV+rZctiRTY2PL6tsIKhoIOaoskiWAkgu+VsbXgUVDNLHf+InQ==} - engines: {node: '>= 8.0.0'} - - '@sindresorhus/merge-streams@2.3.0': - resolution: {integrity: sha512-LtoMMhxAlorcGhmFYI+LhPgbPZCkgP6ra1YL604EeF6U98pLlQ3iWIGMdWSC+vWmPBWBNgmDBAhnAobLROJmwg==} - engines: {node: '>=18'} - - '@tybys/wasm-util@0.9.0': - resolution: {integrity: sha512-6+7nlbMVX/PVDCwaIQ8nTOPveOcFLSt8GcXdx8hD0bt39uWxYT88uXzqTd4fTvqta7oeUJqudepapKNt2DYJFw==} - - '@types/node@20.14.8': - resolution: {integrity: sha512-DO+2/jZinXfROG7j7WKFn/3C6nFwxy2lLpgLjEXJz+0XKphZlTLJ14mo8Vfg8X5BWN6XjyESXq+LcYdT7tR3bA==} - - '@types/stylis@4.2.6': - resolution: {integrity: sha512-4nebF2ZJGzQk0ka0O6+FZUWceyFv4vWq/0dXBMmrSeAwzOuOd/GxE5Pa64d/ndeNLG73dXoBsRzvtsVsYUv6Uw==} - - '@vercel/nft@0.26.5': - resolution: {integrity: sha512-NHxohEqad6Ra/r4lGknO52uc/GrWILXAMs1BB4401GTqww0fw1bAqzpG1XHuDO+dprg4GvsD9ZLLSsdo78p9hQ==} - engines: {node: '>=16'} - hasBin: true - - abbrev@1.1.1: - resolution: {integrity: sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==} - - acorn-import-attributes@1.9.5: - resolution: {integrity: sha512-n02Vykv5uA3eHGM/Z2dQrcD56kL8TyDb2p1+0P83PClMnC/nc+anbQRhIOWnSq4Ke/KvDPrY3C9hDtC/A3eHnQ==} - peerDependencies: - acorn: ^8 - - acorn-walk@8.3.3: - resolution: {integrity: sha512-MxXdReSRhGO7VlFe1bRG/oI7/mdLV9B9JJT0N8vZOhF7gFRR5l3M8W9G8JxmKV+JC5mGqJ0QvqfSOLsCPa4nUw==} - engines: {node: '>=0.4.0'} - - acorn@8.12.0: - resolution: {integrity: sha512-RTvkC4w+KNXrM39/lWCUaG0IbRkWdCv7W/IOW9oU6SawyxulvkQy5HQPVTKxEjczcUvapcrw3cFx/60VN/NRNw==} - engines: {node: '>=0.4.0'} - hasBin: true - - agent-base@6.0.2: - resolution: {integrity: sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==} - engines: {node: '>= 6.0.0'} - - ansi-escapes@4.3.2: - resolution: {integrity: sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==} - engines: {node: '>=8'} - - ansi-regex@5.0.1: - resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} - engines: {node: '>=8'} - - ansi-regex@6.0.1: - resolution: {integrity: sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==} - engines: {node: '>=12'} - - ansi-styles@4.3.0: - resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} - engines: {node: '>=8'} - - ansi-styles@6.2.1: - resolution: {integrity: sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==} - engines: {node: '>=12'} - - aproba@2.0.0: - resolution: {integrity: sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==} - - are-we-there-yet@2.0.0: - resolution: {integrity: sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw==} - engines: {node: '>=10'} - deprecated: This package is no longer supported. - - argparse@1.0.10: - resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==} - - argparse@2.0.1: - resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} - - array-find-index@1.0.2: - resolution: {integrity: sha512-M1HQyIXcBGtVywBt8WVdim+lrNaK7VHp99Qt5pSNziXznKHViIBbXWtfRTpEFpF/c4FdfxNAsCCwPp5phBYJtw==} - engines: {node: '>=0.10.0'} - - arrgv@1.0.2: - resolution: {integrity: sha512-a4eg4yhp7mmruZDQFqVMlxNRFGi/i1r87pt8SDHy0/I8PqSXoUTlWZRdAZo0VXgvEARcujbtTk8kiZRi1uDGRw==} - engines: {node: '>=8.0.0'} - - arrify@3.0.0: - resolution: {integrity: sha512-tLkvA81vQG/XqE2mjDkGQHoOINtMHtysSnemrmoGe6PydDPMRbVugqyk4A6V/WDWEfm3l+0d8anA9r8cv/5Jaw==} - engines: {node: '>=12'} - - async-sema@3.1.1: - resolution: {integrity: sha512-tLRNUXati5MFePdAk8dw7Qt7DpxPB60ofAgn8WRhW6a2rcimZnYBP9oxHiv0OHy+Wz7kPMG+t4LGdt31+4EmGg==} - - asynckit@0.4.0: - resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} - - ava@6.1.3: - resolution: {integrity: sha512-tkKbpF1pIiC+q09wNU9OfyTDYZa8yuWvU2up3+lFJ3lr1RmnYh2GBpPwzYUEB0wvTPIUysGjcZLNZr7STDviRA==} - engines: {node: ^18.18 || ^20.8 || ^21 || ^22} - hasBin: true - peerDependencies: - '@ava/typescript': '*' - peerDependenciesMeta: - '@ava/typescript': - optional: true - - axios@1.6.2: - resolution: {integrity: sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A==} - - balanced-match@1.0.2: - resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} - - base64-js@1.5.1: - resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==} - - before-after-hook@2.2.3: - resolution: {integrity: sha512-NzUnlZexiaH/46WDhANlyR2bXRopNg4F/zuSA3OpZnllCUgRaOF2znDioDWrmbNVsuZk6l9pMquQB38cfBZwkQ==} - - bindings@1.5.0: - resolution: {integrity: sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==} - - bl@4.1.0: - resolution: {integrity: sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==} - - blueimp-md5@2.19.0: - resolution: {integrity: sha512-DRQrD6gJyy8FbiE4s+bDoXS9hiW3Vbx5uCdwvcCf3zLHL+Iv7LtGHLpr+GZV8rHG8tK766FGYBwRbu8pELTt+w==} - - brace-expansion@1.1.11: - resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} - - braces@3.0.3: - resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==} - engines: {node: '>=8'} - - buffer@5.7.1: - resolution: {integrity: sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==} - - call-bind@1.0.7: - resolution: {integrity: sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==} - engines: {node: '>= 0.4'} - - callsites@4.1.0: - resolution: {integrity: sha512-aBMbD1Xxay75ViYezwT40aQONfr+pSXTHwNKvIXhXD6+LY3F1dLIcceoC5OZKBVHbXcysz1hL9D2w0JJIMXpUw==} - engines: {node: '>=12.20'} - - camelize@1.0.1: - resolution: {integrity: sha512-dU+Tx2fsypxTgtLoE36npi3UqcjSSMNYfkqgmoEhtZrraP5VWq0K7FkWVTYa8eMPtnU/G2txVsfdCJTn9uzpuQ==} - - cbor@9.0.2: - resolution: {integrity: sha512-JPypkxsB10s9QOWwa6zwPzqE1Md3vqpPc+cai4sAecuCsRyAtAl/pMyhPlMbT/xtPnm2dznJZYRLui57qiRhaQ==} - engines: {node: '>=16'} - - chalk@4.1.2: - resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} - engines: {node: '>=10'} - - chalk@5.3.0: - resolution: {integrity: sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==} - engines: {node: ^12.17.0 || ^14.13 || >=16.0.0} - - chardet@0.7.0: - resolution: {integrity: sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==} - - chownr@2.0.0: - resolution: {integrity: sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==} - engines: {node: '>=10'} - - chunkd@2.0.1: - resolution: {integrity: sha512-7d58XsFmOq0j6el67Ug9mHf9ELUXsQXYJBkyxhH/k+6Ke0qXRnv0kbemx+Twc6fRJ07C49lcbdgm9FL1Ei/6SQ==} - - ci-info@4.0.0: - resolution: {integrity: sha512-TdHqgGf9odd8SXNuxtUBVx8Nv+qZOejE6qyqiy5NtbYYQOeFa6zmHkxlPzmaLxWWHsU6nJmB7AETdVPi+2NBUg==} - engines: {node: '>=8'} - - ci-parallel-vars@1.0.1: - resolution: {integrity: sha512-uvzpYrpmidaoxvIQHM+rKSrigjOe9feHYbw4uOI2gdfe1C3xIlxO+kVXq83WQWNniTf8bAxVpy+cQeFQsMERKg==} - - cli-cursor@3.1.0: - resolution: {integrity: sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==} - engines: {node: '>=8'} - - cli-spinners@2.9.2: - resolution: {integrity: sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==} - engines: {node: '>=6'} - - cli-truncate@4.0.0: - resolution: {integrity: sha512-nPdaFdQ0h/GEigbPClz11D0v/ZJEwxmeVZGeMo3Z5StPtUTkA9o1lD6QwoirYiSDzbcwn2XcjwmCp68W1IS4TA==} - engines: {node: '>=18'} - - cli-width@4.1.0: - resolution: {integrity: sha512-ouuZd4/dm2Sw5Gmqy6bGyNNNe1qt9RpmxveLSO7KcgsTnU7RXfsw+/bukWGo1abgBiMAic068rclZsO4IWmmxQ==} - engines: {node: '>= 12'} - - clipanion@3.2.1: - resolution: {integrity: sha512-dYFdjLb7y1ajfxQopN05mylEpK9ZX0sO1/RfMXdfmwjlIsPkbh4p7A682x++zFPLDCo1x3p82dtljHf5cW2LKA==} - peerDependencies: - typanion: '*' - - cliui@8.0.1: - resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==} - engines: {node: '>=12'} - - clone@1.0.4: - resolution: {integrity: sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==} - engines: {node: '>=0.8'} - - code-excerpt@4.0.0: - resolution: {integrity: sha512-xxodCmBen3iy2i0WtAK8FlFNrRzjUqjRsMfho58xT/wvZU1YTM3fCnRjcy1gJPMepaRlgm/0e6w8SpWHpn3/cA==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - color-convert@2.0.1: - resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} - engines: {node: '>=7.0.0'} - - color-name@1.1.4: - resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} - - color-support@1.1.3: - resolution: {integrity: sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==} - hasBin: true - - colorette@2.0.20: - resolution: {integrity: sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==} - - combined-stream@1.0.8: - resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} - engines: {node: '>= 0.8'} - - common-path-prefix@3.0.0: - resolution: {integrity: sha512-QE33hToZseCH3jS0qN96O/bSh3kaw/h+Tq7ngyY9eWDUnTlTNUyqfqvCXioLe5Na5jFsL78ra/wuBU4iuEgd4w==} - - concat-map@0.0.1: - resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} - - concordance@5.0.4: - resolution: {integrity: sha512-OAcsnTEYu1ARJqWVGwf4zh4JDfHZEaSNlNccFmt8YjB2l/n19/PF2viLINHc57vO4FKIAFl2FWASIGZZWZ2Kxw==} - engines: {node: '>=10.18.0 <11 || >=12.14.0 <13 || >=14'} - - console-control-strings@1.1.0: - resolution: {integrity: sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==} - - convert-to-spaces@2.0.1: - resolution: {integrity: sha512-rcQ1bsQO9799wq24uE5AM2tAILy4gXGIK/njFWcVQkGNZ96edlpY+A7bjwvzjYvLDyzmG1MmMLZhpcsb+klNMQ==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - css-color-keywords@1.0.0: - resolution: {integrity: sha512-FyyrDHZKEjXDpNJYvVsV960FiqQyXc/LlYmsxl2BcdMb2WPx0OGRVgTg55rPSyLSNMqP52R9r8geSp7apN3Ofg==} - engines: {node: '>=4'} - - css-to-react-native@3.2.0: - resolution: {integrity: sha512-e8RKaLXMOFii+02mOlqwjbD00KSEKqblnpO9e++1aXS1fPQOpS1YoqdVHBqPjHNoxeF2mimzVqawm2KCbEdtHQ==} - - csstype@3.1.3: - resolution: {integrity: sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==} - - currently-unhandled@0.4.1: - resolution: {integrity: sha512-/fITjgjGU50vjQ4FH6eUoYu+iUoUKIXws2hL15JJpIR+BbTxaXQsMuuyjtNh2WqsSBS5nsaZHFsFecyw5CCAng==} - engines: {node: '>=0.10.0'} - - date-time@3.1.0: - resolution: {integrity: sha512-uqCUKXE5q1PNBXjPqvwhwJf9SwMoAHBgWJ6DcrnS5o+W2JOiIILl0JEdVD8SGujrNS02GGxgwAg2PN2zONgtjg==} - engines: {node: '>=6'} - - debug@4.3.5: - resolution: {integrity: sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg==} - engines: {node: '>=6.0'} - peerDependencies: - supports-color: '*' - peerDependenciesMeta: - supports-color: - optional: true - - defaults@1.0.4: - resolution: {integrity: sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A==} - - define-data-property@1.1.4: - resolution: {integrity: sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==} - engines: {node: '>= 0.4'} - - delayed-stream@1.0.0: - resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} - engines: {node: '>=0.4.0'} - - delegates@1.0.0: - resolution: {integrity: sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==} - - deprecation@2.3.1: - resolution: {integrity: sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==} - - detect-libc@2.0.3: - resolution: {integrity: sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw==} - engines: {node: '>=8'} - - emittery@1.0.3: - resolution: {integrity: sha512-tJdCJitoy2lrC2ldJcqN4vkqJ00lT+tOWNT1hBJjO/3FDMJa5TTIiYGCKGkn/WfCyOzUMObeohbVTj00fhiLiA==} - engines: {node: '>=14.16'} - - emnapi@1.2.0: - resolution: {integrity: sha512-rcq+dJCcfr08I0XM/57LPRqaUokGfni/+SvhO7NaJthTTjRdohhIy0FQwyC5rR1enAsjkldQg83th8J5hURv0Q==} - peerDependencies: - node-addon-api: '>= 6.1.0' - peerDependenciesMeta: - node-addon-api: - optional: true - - emoji-regex@10.3.0: - resolution: {integrity: sha512-QpLs9D9v9kArv4lfDEgg1X/gN5XLnf/A6l9cs8SPZLRZR3ZkY9+kwIQTxm+fsSej5UMYGE8fdoaZVIBlqG0XTw==} - - emoji-regex@8.0.0: - resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} - - es-define-property@1.0.0: - resolution: {integrity: sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==} - engines: {node: '>= 0.4'} - - es-errors@1.3.0: - resolution: {integrity: sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==} - engines: {node: '>= 0.4'} - - escalade@3.1.2: - resolution: {integrity: sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==} - engines: {node: '>=6'} - - escape-string-regexp@2.0.0: - resolution: {integrity: sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==} - engines: {node: '>=8'} - - escape-string-regexp@5.0.0: - resolution: {integrity: sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==} - engines: {node: '>=12'} - - esprima@4.0.1: - resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==} - engines: {node: '>=4'} - hasBin: true - - estree-walker@2.0.2: - resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==} - - esutils@2.0.3: - resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} - engines: {node: '>=0.10.0'} - - external-editor@3.1.0: - resolution: {integrity: sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==} - engines: {node: '>=4'} - - fast-diff@1.3.0: - resolution: {integrity: sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==} - - fast-glob@3.3.2: - resolution: {integrity: sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==} - engines: {node: '>=8.6.0'} - - fastq@1.17.1: - resolution: {integrity: sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==} - - figures@6.1.0: - resolution: {integrity: sha512-d+l3qxjSesT4V7v2fh+QnmFnUWv9lSpjarhShNTgBOfA0ttejbQUAlHLitbjkoRiDulW0OPoQPYIGhIC8ohejg==} - engines: {node: '>=18'} - - file-uri-to-path@1.0.0: - resolution: {integrity: sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==} - - fill-range@7.1.1: - resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==} - engines: {node: '>=8'} - - find-up-simple@1.0.0: - resolution: {integrity: sha512-q7Us7kcjj2VMePAa02hDAF6d+MzsdsAWEwYyOpwUtlerRBkOEPBCRZrAV4XfcSN8fHAgaD0hP7miwoay6DCprw==} - engines: {node: '>=18'} - - follow-redirects@1.15.6: - resolution: {integrity: sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==} - engines: {node: '>=4.0'} - peerDependencies: - debug: '*' - peerDependenciesMeta: - debug: - optional: true - - form-data@4.0.0: - resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==} - engines: {node: '>= 6'} - - fs-minipass@2.1.0: - resolution: {integrity: sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==} - engines: {node: '>= 8'} - - fs.realpath@1.0.0: - resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} - - function-bind@1.1.2: - resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==} - - gauge@3.0.2: - resolution: {integrity: sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q==} - engines: {node: '>=10'} - deprecated: This package is no longer supported. - - get-caller-file@2.0.5: - resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} - engines: {node: 6.* || 8.* || >= 10.*} - - get-east-asian-width@1.2.0: - resolution: {integrity: sha512-2nk+7SIVb14QrgXFHcm84tD4bKQz0RxPuMT8Ag5KPOq7J5fEmAg0UbXdTOSHqNuHSU28k55qnceesxXRZGzKWA==} - engines: {node: '>=18'} - - get-intrinsic@1.2.4: - resolution: {integrity: sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==} - engines: {node: '>= 0.4'} - - glob-parent@5.1.2: - resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} - engines: {node: '>= 6'} - - glob@7.2.3: - resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} - deprecated: Glob versions prior to v9 are no longer supported - - globby@14.0.1: - resolution: {integrity: sha512-jOMLD2Z7MAhyG8aJpNOpmziMOP4rPLcc95oQPKXBazW82z+CEgPFBQvEpRUa1KeIMUJo4Wsm+q6uzO/Q/4BksQ==} - engines: {node: '>=18'} - - gopd@1.0.1: - resolution: {integrity: sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==} - - graceful-fs@4.2.11: - resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} - - has-flag@4.0.0: - resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} - engines: {node: '>=8'} - - has-property-descriptors@1.0.2: - resolution: {integrity: sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==} - - has-proto@1.0.3: - resolution: {integrity: sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==} - engines: {node: '>= 0.4'} - - has-symbols@1.0.3: - resolution: {integrity: sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==} - engines: {node: '>= 0.4'} - - has-unicode@2.0.1: - resolution: {integrity: sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==} - - hasown@2.0.2: - resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==} - engines: {node: '>= 0.4'} - - https-proxy-agent@5.0.1: - resolution: {integrity: sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==} - engines: {node: '>= 6'} - - iconv-lite@0.4.24: - resolution: {integrity: sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==} - engines: {node: '>=0.10.0'} - - ieee754@1.2.1: - resolution: {integrity: sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==} - - ignore-by-default@2.1.0: - resolution: {integrity: sha512-yiWd4GVmJp0Q6ghmM2B/V3oZGRmjrKLXvHR3TE1nfoXsmoggllfZUQe74EN0fJdPFZu2NIvNdrMMLm3OsV7Ohw==} - engines: {node: '>=10 <11 || >=12 <13 || >=14'} - - ignore@5.3.1: - resolution: {integrity: sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==} - engines: {node: '>= 4'} - - imurmurhash@0.1.4: - resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} - engines: {node: '>=0.8.19'} - - indent-string@5.0.0: - resolution: {integrity: sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==} - engines: {node: '>=12'} - - inflight@1.0.6: - resolution: {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. - - inherits@2.0.4: - resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} - - inquirer@9.2.23: - resolution: {integrity: sha512-kod5s+FBPIDM2xiy9fu+6wdU/SkK5le5GS9lh4FEBjBHqiMgD9lLFbCbuqFNAjNL2ZOy9Wd9F694IOzN9pZHBA==} - engines: {node: '>=18'} - - irregular-plurals@3.5.0: - resolution: {integrity: sha512-1ANGLZ+Nkv1ptFb2pa8oG8Lem4krflKuX/gINiHJHjJUKaJHk/SXk5x6K3J+39/p0h1RQ2saROclJJ+QLvETCQ==} - engines: {node: '>=8'} - - is-extglob@2.1.1: - resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} - engines: {node: '>=0.10.0'} - - is-fullwidth-code-point@3.0.0: - resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} - engines: {node: '>=8'} - - is-fullwidth-code-point@4.0.0: - resolution: {integrity: sha512-O4L094N2/dZ7xqVdrXhh9r1KODPJpFms8B5sGdJLPy664AgvXsreZUyCQQNItZRDlYug4xStLjNp/sz3HvBowQ==} - engines: {node: '>=12'} - - is-glob@4.0.3: - resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} - engines: {node: '>=0.10.0'} - - is-interactive@1.0.0: - resolution: {integrity: sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w==} - engines: {node: '>=8'} - - is-number@7.0.0: - resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} - engines: {node: '>=0.12.0'} - - is-plain-object@5.0.0: - resolution: {integrity: sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==} - engines: {node: '>=0.10.0'} - - is-promise@4.0.0: - resolution: {integrity: sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==} - - is-unicode-supported@0.1.0: - resolution: {integrity: sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==} - engines: {node: '>=10'} - - is-unicode-supported@2.0.0: - resolution: {integrity: sha512-FRdAyx5lusK1iHG0TWpVtk9+1i+GjrzRffhDg4ovQ7mcidMQ6mj+MhKPmvh7Xwyv5gIS06ns49CA7Sqg7lC22Q==} - engines: {node: '>=18'} - - js-string-escape@1.0.1: - resolution: {integrity: sha512-Smw4xcfIQ5LVjAOuJCvN/zIodzA/BBSsluuoSykP+lUvScIi4U6RJLfwHet5cxFnCswUjISV8oAXaqaJDY3chg==} - engines: {node: '>= 0.8'} - - js-tokens@4.0.0: - resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} - - js-yaml@3.14.1: - resolution: {integrity: sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==} - hasBin: true - - js-yaml@4.1.0: - resolution: {integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==} - hasBin: true - - load-json-file@7.0.1: - resolution: {integrity: sha512-Gnxj3ev3mB5TkVBGad0JM6dmLiQL+o0t23JPBZ9sd+yvSLk05mFoqKBw5N8gbbkU4TNXyqCgIrl/VM17OgUIgQ==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - lodash-es@4.17.21: - resolution: {integrity: sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==} - - lodash@4.17.21: - resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} - - log-symbols@4.1.0: - resolution: {integrity: sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==} - engines: {node: '>=10'} - - loose-envify@1.4.0: - resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==} - hasBin: true - - make-dir@3.1.0: - resolution: {integrity: sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==} - engines: {node: '>=8'} - - matcher@5.0.0: - resolution: {integrity: sha512-s2EMBOWtXFc8dgqvoAzKJXxNHibcdJMV0gwqKUaw9E2JBJuGUK7DrNKrA6g/i+v72TT16+6sVm5mS3thaMLQUw==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - md5-hex@3.0.1: - resolution: {integrity: sha512-BUiRtTtV39LIJwinWBjqVsU9xhdnz7/i889V859IBFpuqGAj6LuOvHv5XLbgZ2R7ptJoJaEcxkv88/h25T7Ciw==} - engines: {node: '>=8'} - - memoize@10.0.0: - resolution: {integrity: sha512-H6cBLgsi6vMWOcCpvVCdFFnl3kerEXbrYh9q+lY6VXvQSmM6CkmV08VOwT+WE2tzIEqRPFfAq3fm4v/UIW6mSA==} - engines: {node: '>=18'} - - merge2@1.4.1: - resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} - engines: {node: '>= 8'} - - micromatch@4.0.7: - resolution: {integrity: sha512-LPP/3KorzCwBxfeUuZmaR6bG2kdeHSbe0P2tY3FLRU4vYrjYz5hI4QZwV0njUx3jeuKe67YukQ1LSPZBKDqO/Q==} - engines: {node: '>=8.6'} - - mime-db@1.52.0: - resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} - engines: {node: '>= 0.6'} - - mime-types@2.1.35: - resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} - engines: {node: '>= 0.6'} - - mimic-fn@2.1.0: - resolution: {integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==} - engines: {node: '>=6'} - - mimic-function@5.0.1: - resolution: {integrity: sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==} - engines: {node: '>=18'} - - minimatch@3.1.2: - resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} - - minipass@3.3.6: - resolution: {integrity: sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==} - engines: {node: '>=8'} - - minipass@5.0.0: - resolution: {integrity: sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==} - engines: {node: '>=8'} - - minizlib@2.1.2: - resolution: {integrity: sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==} - engines: {node: '>= 8'} - - mkdirp@1.0.4: - resolution: {integrity: sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==} - engines: {node: '>=10'} - hasBin: true - - ms@2.1.2: - resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} - - ms@2.1.3: - resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} - - mute-stream@1.0.0: - resolution: {integrity: sha512-avsJQhyd+680gKXyG/sQc0nXaC6rBkPOfyHYcFb9+hdkqQkR9bdnkJ0AMZhke0oesPqIO+mFFJ+IdBc7mst4IA==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - - nanoid@3.3.7: - resolution: {integrity: sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==} - engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} - hasBin: true - - node-fetch@2.7.0: - resolution: {integrity: sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==} - engines: {node: 4.x || >=6.0.0} - peerDependencies: - encoding: ^0.1.0 - peerDependenciesMeta: - encoding: - optional: true - - node-gyp-build@4.8.1: - resolution: {integrity: sha512-OSs33Z9yWr148JZcbZd5WiAXhh/n9z8TxQcdMhIOlpN9AhWpLfvVFO73+m77bBABQMaY9XSvIa+qk0jlI7Gcaw==} - hasBin: true - - nofilter@3.1.0: - resolution: {integrity: sha512-l2NNj07e9afPnhAhvgVrCD/oy2Ai1yfLpuo3EpiO1jFTsB4sFz6oIfAfSZyQzVpkZQ9xS8ZS5g1jCBgq4Hwo0g==} - engines: {node: '>=12.19'} - - nopt@5.0.0: - resolution: {integrity: sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==} - engines: {node: '>=6'} - hasBin: true - - npmlog@5.0.1: - resolution: {integrity: sha512-AqZtDUWOMKs1G/8lwylVjrdYgqA4d9nu8hc+0gzRxlDb1I10+FHBGMXs6aiQHFdCUUlqH99MUMuLfzWDNDtfxw==} - deprecated: This package is no longer supported. - - object-assign@4.1.1: - resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} - engines: {node: '>=0.10.0'} - - once@1.4.0: - resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} - - onetime@5.1.2: - resolution: {integrity: sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==} - engines: {node: '>=6'} - - ora@5.4.1: - resolution: {integrity: sha512-5b6Y85tPxZZ7QytO+BQzysW31HJku27cRIlkbAXaNx+BdcVi+LlRFmVXzeF6a7JCwJpyw5c4b+YSVImQIrBpuQ==} - engines: {node: '>=10'} - - os-tmpdir@1.0.2: - resolution: {integrity: sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==} - engines: {node: '>=0.10.0'} - - p-map@7.0.2: - resolution: {integrity: sha512-z4cYYMMdKHzw4O5UkWJImbZynVIo0lSGTXc7bzB1e/rrDqkgGUNysK/o4bTr+0+xKvvLoTyGqYC4Fgljy9qe1Q==} - engines: {node: '>=18'} - - package-config@5.0.0: - resolution: {integrity: sha512-GYTTew2slBcYdvRHqjhwaaydVMvn/qrGC323+nKclYioNSLTDUM/lGgtGTgyHVtYcozb+XkE8CNhwcraOmZ9Mg==} - engines: {node: '>=18'} - - parse-ms@4.0.0: - resolution: {integrity: sha512-TXfryirbmq34y8QBwgqCVLi+8oA3oWx2eAnSn62ITyEhEYaWRlVZ2DvMM9eZbMs/RfxPu/PK/aBLyGj4IrqMHw==} - engines: {node: '>=18'} - - path-is-absolute@1.0.1: - resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==} - engines: {node: '>=0.10.0'} - - path-type@5.0.0: - resolution: {integrity: sha512-5HviZNaZcfqP95rwpv+1HDgUamezbqdSYTyzjTvwtJSnIH+3vnbmWsItli8OFEndS984VT55M3jduxZbX351gg==} - engines: {node: '>=12'} - - picocolors@1.0.1: - resolution: {integrity: sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==} - - picomatch@2.3.1: - resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} - engines: {node: '>=8.6'} - - picomatch@3.0.1: - resolution: {integrity: sha512-I3EurrIQMlRc9IaAZnqRR044Phh2DXY+55o7uJ0V+hYZAcQYSuFWsc9q5PvyDHUSCe1Qxn/iBz+78s86zWnGag==} - engines: {node: '>=10'} - - plur@5.1.0: - resolution: {integrity: sha512-VP/72JeXqak2KiOzjgKtQen5y3IZHn+9GOuLDafPv0eXa47xq0At93XahYBs26MsifCQ4enGKwbjBTKgb9QJXg==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - postcss-value-parser@4.2.0: - resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==} - - postcss@8.4.33: - resolution: {integrity: sha512-Kkpbhhdjw2qQs2O2DGX+8m5OVqEcbB9HRBvuYM9pgrjEFUg30A9LmXNlTAUj4S9kgtGyrMbTzVjH7E+s5Re2yg==} - engines: {node: ^10 || ^12 || >=14} - - pretty-ms@9.0.0: - resolution: {integrity: sha512-E9e9HJ9R9NasGOgPaPE8VMeiPKAyWR5jcFpNnwIejslIhWqdqOrb2wShBsncMPUb+BcCd2OPYfh7p2W6oemTng==} - engines: {node: '>=18'} - - proxy-from-env@1.1.0: - resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==} - - queue-microtask@1.2.3: - resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} - - react-dom@18.3.1: - resolution: {integrity: sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==} - peerDependencies: - react: ^18.3.1 - - react@18.3.1: - resolution: {integrity: sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==} - engines: {node: '>=0.10.0'} - - readable-stream@3.6.2: - resolution: {integrity: sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==} - engines: {node: '>= 6'} - - require-directory@2.1.1: - resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} - engines: {node: '>=0.10.0'} - - resolve-cwd@3.0.0: - resolution: {integrity: sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==} - engines: {node: '>=8'} - - resolve-from@5.0.0: - resolution: {integrity: sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==} - engines: {node: '>=8'} - - restore-cursor@3.1.0: - resolution: {integrity: sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==} - engines: {node: '>=8'} - - reusify@1.0.4: - resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==} - engines: {iojs: '>=1.0.0', node: '>=0.10.0'} - - rimraf@3.0.2: - resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==} - deprecated: Rimraf versions prior to v4 are no longer supported - hasBin: true - - run-async@3.0.0: - resolution: {integrity: sha512-540WwVDOMxA6dN6We19EcT9sc3hkXPw5mzRNGM3FkdN/vtE9NFvj5lFAPNwUDmJjXidm3v7TC1cTE7t17Ulm1Q==} - engines: {node: '>=0.12.0'} - - run-parallel@1.2.0: - resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} - - rxjs@7.8.1: - resolution: {integrity: sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==} - - safe-buffer@5.2.1: - resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} - - safer-buffer@2.1.2: - resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} - - scheduler@0.23.2: - resolution: {integrity: sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ==} - - semver@6.3.1: - resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} - hasBin: true - - semver@7.6.2: - resolution: {integrity: sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==} - engines: {node: '>=10'} - hasBin: true - - serialize-error@7.0.1: - resolution: {integrity: sha512-8I8TjW5KMOKsZQTvoxjuSIa7foAwPWGOts+6o7sgjz41/qMD9VQHEDxi6PBvK2l0MXUmqZyNpUK+T2tQaaElvw==} - engines: {node: '>=10'} - - set-blocking@2.0.0: - resolution: {integrity: sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==} - - set-function-length@1.2.2: - resolution: {integrity: sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==} - engines: {node: '>= 0.4'} - - shallowequal@1.1.0: - resolution: {integrity: sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ==} - - signal-exit@3.0.7: - resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} - - signal-exit@4.1.0: - resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} - engines: {node: '>=14'} - - slash@5.1.0: - resolution: {integrity: sha512-ZA6oR3T/pEyuqwMgAKT0/hAv8oAXckzbkmR0UkUosQ+Mc4RxGoJkRmwHgHufaenlyAgE1Mxgpdcrf75y6XcnDg==} - engines: {node: '>=14.16'} - - slice-ansi@5.0.0: - resolution: {integrity: sha512-FC+lgizVPfie0kkhqUScwRu1O/lF6NOgJmlCgK+/LYxDCTk8sGelYaHDhFcDN+Sn3Cv+3VSa4Byeo+IMCzpMgQ==} - engines: {node: '>=12'} - - source-map-js@1.2.0: - resolution: {integrity: sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==} - engines: {node: '>=0.10.0'} - - sprintf-js@1.0.3: - resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==} - - stack-utils@2.0.6: - resolution: {integrity: sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==} - engines: {node: '>=10'} - - string-width@4.2.3: - resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} - engines: {node: '>=8'} - - string-width@7.1.0: - resolution: {integrity: sha512-SEIJCWiX7Kg4c129n48aDRwLbFb2LJmXXFrWBG4NGaRtMQ3myKPKbwrD1BKqQn74oCoNMBVrfDEr5M9YxCsrkw==} - engines: {node: '>=18'} - - string_decoder@1.3.0: - resolution: {integrity: sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==} - - strip-ansi@6.0.1: - resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} - engines: {node: '>=8'} - - strip-ansi@7.1.0: - resolution: {integrity: sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==} - engines: {node: '>=12'} - - styled-components@6.1.1: - resolution: {integrity: sha512-cpZZP5RrKRIClBW5Eby4JM1wElLVP4NQrJbJ0h10TidTyJf4SIIwa3zLXOoPb4gJi8MsJ8mjq5mu2IrEhZIAcQ==} - engines: {node: '>= 16'} - peerDependencies: - react: '>= 16.8.0' - react-dom: '>= 16.8.0' - - stylis@4.3.2: - resolution: {integrity: sha512-bhtUjWd/z6ltJiQwg0dUfxEJ+W+jdqQd8TbWLWyeIJHlnsqmGLRFFd8e5mA0AZi/zx90smXRlN66YMTcaSFifg==} - - supertap@3.0.1: - resolution: {integrity: sha512-u1ZpIBCawJnO+0QePsEiOknOfCRq0yERxiAchT0i4li0WHNUJbf0evXXSXOcCAR4M8iMDoajXYmstm/qO81Isw==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - supports-color@7.2.0: - resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} - engines: {node: '>=8'} - - tar@6.2.1: - resolution: {integrity: sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==} - engines: {node: '>=10'} - - temp-dir@3.0.0: - resolution: {integrity: sha512-nHc6S/bwIilKHNRgK/3jlhDoIHcp45YgyiwcAk46Tr0LfEqGBVpmiAyuiuxeVE44m3mXnEeVhaipLOEWmH+Njw==} - engines: {node: '>=14.16'} - - time-zone@1.0.0: - resolution: {integrity: sha512-TIsDdtKo6+XrPtiTm1ssmMngN1sAhyKnTO2kunQWqNPWIVvCm15Wmw4SWInwTVgJ5u/Tr04+8Ei9TNcw4x4ONA==} - engines: {node: '>=4'} - - tmp@0.0.33: - resolution: {integrity: sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==} - engines: {node: '>=0.6.0'} - - to-regex-range@5.0.1: - resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} - engines: {node: '>=8.0'} - - toml@3.0.0: - resolution: {integrity: sha512-y/mWCZinnvxjTKYhJ+pYxwD0mRLVvOtdS2Awbgxln6iEnt4rk0yBxeSBHkGJcPucRiG0e55mwWp+g/05rsrd6w==} - - tr46@0.0.3: - resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==} - - tslib@2.6.3: - resolution: {integrity: sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ==} - - typanion@3.14.0: - resolution: {integrity: sha512-ZW/lVMRabETuYCd9O9ZvMhAh8GslSqaUjxmK/JLPCh6l73CvLBiuXswj/+7LdnWOgYsQ130FqLzFz5aGT4I3Ug==} - - type-fest@0.13.1: - resolution: {integrity: sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==} - engines: {node: '>=10'} - - type-fest@0.21.3: - resolution: {integrity: sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==} - engines: {node: '>=10'} - - typescript@5.5.2: - resolution: {integrity: sha512-NcRtPEOsPFFWjobJEtfihkLCZCXZt/os3zf8nTxjVH3RvTSxjrCamJpbExGvYOF+tFHc3pA65qpdwPbzjohhew==} - engines: {node: '>=14.17'} - hasBin: true - - undici-types@5.26.5: - resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==} - - unicorn-magic@0.1.0: - resolution: {integrity: sha512-lRfVq8fE8gz6QMBuDM6a+LO3IAzTi05H6gCVaUpir2E1Rwpo4ZUog45KpNXKC/Mn3Yb9UDuHumeFTo9iV/D9FQ==} - engines: {node: '>=18'} - - universal-user-agent@6.0.1: - resolution: {integrity: sha512-yCzhz6FN2wU1NiiQRogkTQszlQSlpWaw8SvVegAc+bDxbzHgh1vX8uIe8OYyMH6DwH+sdTJsgMl36+mSMdRJIQ==} - - util-deprecate@1.0.2: - resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} - - wasm-sjlj@1.0.5: - resolution: {integrity: sha512-Z/MHJeOkAvJJVWnGX3/YZGYldGaawZbYHX4ldYG9kLhcdB8H31F5x66M7Zc4BP/7pg0aLsusQj1629m2B3Rilg==} - - wcwidth@1.0.1: - resolution: {integrity: sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==} - - webidl-conversions@3.0.1: - resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==} - - well-known-symbols@2.0.0: - resolution: {integrity: sha512-ZMjC3ho+KXo0BfJb7JgtQ5IBuvnShdlACNkKkdsqBmYw3bPAaJfPeYUo6tLUaT5tG/Gkh7xkpBhKRQ9e7pyg9Q==} - engines: {node: '>=6'} - - whatwg-url@5.0.0: - resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==} - - wide-align@1.1.5: - resolution: {integrity: sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==} - - wrap-ansi@6.2.0: - resolution: {integrity: sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==} - engines: {node: '>=8'} - - wrap-ansi@7.0.0: - resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==} - engines: {node: '>=10'} - - wrappy@1.0.2: - resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} - - write-file-atomic@5.0.1: - resolution: {integrity: sha512-+QU2zd6OTD8XWIJCbffaiQeH9U73qIqafo1x6V1snCWYGJf6cVE0cDR4D8xRzcEnfI21IFrUPzPGtcPf8AC+Rw==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - - y18n@5.0.8: - resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==} - engines: {node: '>=10'} - - yallist@4.0.0: - resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==} - - yargs-parser@21.1.1: - resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} - engines: {node: '>=12'} - - yargs@17.7.2: - resolution: {integrity: sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==} - engines: {node: '>=12'} - -snapshots: - - '@emnapi/core@1.2.0': - dependencies: - '@emnapi/wasi-threads': 1.0.1 - tslib: 2.6.3 - - '@emnapi/runtime@1.2.0': - dependencies: - tslib: 2.6.3 - - '@emnapi/wasi-threads@1.0.1': - dependencies: - tslib: 2.6.3 - - '@emotion/is-prop-valid@1.2.2': - dependencies: - '@emotion/memoize': 0.8.1 - - '@emotion/memoize@0.8.1': {} - - '@emotion/unitless@0.8.1': {} - - '@inquirer/figures@1.0.3': {} - - '@ljharb/through@2.3.13': - dependencies: - call-bind: 1.0.7 - - '@mapbox/node-pre-gyp@1.0.11': - dependencies: - detect-libc: 2.0.3 - https-proxy-agent: 5.0.1 - make-dir: 3.1.0 - node-fetch: 2.7.0 - nopt: 5.0.0 - npmlog: 5.0.1 - rimraf: 3.0.2 - semver: 7.6.2 - tar: 6.2.1 - transitivePeerDependencies: - - encoding - - supports-color - - '@napi-rs/cli@3.0.0-alpha.55(@emnapi/runtime@1.2.0)(emnapi@1.2.0)': - dependencies: - '@napi-rs/cross-toolchain': 0.0.16 - '@napi-rs/wasm-tools': 0.0.2 - '@octokit/rest': 20.1.1 - clipanion: 3.2.1(typanion@3.14.0) - colorette: 2.0.20 - debug: 4.3.5 - inquirer: 9.2.23 - js-yaml: 4.1.0 - lodash-es: 4.17.21 - semver: 7.6.2 - toml: 3.0.0 - typanion: 3.14.0 - wasm-sjlj: 1.0.5 - optionalDependencies: - '@emnapi/runtime': 1.2.0 - emnapi: 1.2.0 - transitivePeerDependencies: - - '@napi-rs/cross-toolchain-arm64-target-aarch64' - - '@napi-rs/cross-toolchain-arm64-target-armv7' - - '@napi-rs/cross-toolchain-arm64-target-x86_64' - - '@napi-rs/cross-toolchain-x64-target-aarch64' - - '@napi-rs/cross-toolchain-x64-target-armv7' - - '@napi-rs/cross-toolchain-x64-target-x86_64' - - supports-color - - '@napi-rs/cross-toolchain@0.0.16': - dependencies: - '@napi-rs/lzma': 1.3.1 - '@napi-rs/tar': 0.1.1 - debug: 4.3.5 - transitivePeerDependencies: - - supports-color - - '@napi-rs/lzma-android-arm-eabi@1.3.1': - optional: true - - '@napi-rs/lzma-android-arm64@1.3.1': - optional: true - - '@napi-rs/lzma-darwin-arm64@1.3.1': - optional: true - - '@napi-rs/lzma-darwin-x64@1.3.1': - optional: true - - '@napi-rs/lzma-freebsd-x64@1.3.1': - optional: true - - '@napi-rs/lzma-linux-arm-gnueabihf@1.3.1': - optional: true - - '@napi-rs/lzma-linux-arm64-gnu@1.3.1': - optional: true - - '@napi-rs/lzma-linux-arm64-musl@1.3.1': - optional: true - - '@napi-rs/lzma-linux-x64-gnu@1.3.1': - optional: true - - '@napi-rs/lzma-linux-x64-musl@1.3.1': - optional: true - - '@napi-rs/lzma-wasm32-wasi@1.3.1': - dependencies: - '@napi-rs/wasm-runtime': 0.2.4 - optional: true - - '@napi-rs/lzma-win32-arm64-msvc@1.3.1': - optional: true - - '@napi-rs/lzma-win32-ia32-msvc@1.3.1': - optional: true - - '@napi-rs/lzma-win32-x64-msvc@1.3.1': - optional: true - - '@napi-rs/lzma@1.3.1': - optionalDependencies: - '@napi-rs/lzma-android-arm-eabi': 1.3.1 - '@napi-rs/lzma-android-arm64': 1.3.1 - '@napi-rs/lzma-darwin-arm64': 1.3.1 - '@napi-rs/lzma-darwin-x64': 1.3.1 - '@napi-rs/lzma-freebsd-x64': 1.3.1 - '@napi-rs/lzma-linux-arm-gnueabihf': 1.3.1 - '@napi-rs/lzma-linux-arm64-gnu': 1.3.1 - '@napi-rs/lzma-linux-arm64-musl': 1.3.1 - '@napi-rs/lzma-linux-x64-gnu': 1.3.1 - '@napi-rs/lzma-linux-x64-musl': 1.3.1 - '@napi-rs/lzma-wasm32-wasi': 1.3.1 - '@napi-rs/lzma-win32-arm64-msvc': 1.3.1 - '@napi-rs/lzma-win32-ia32-msvc': 1.3.1 - '@napi-rs/lzma-win32-x64-msvc': 1.3.1 - - '@napi-rs/tar-android-arm-eabi@0.1.1': - optional: true - - '@napi-rs/tar-android-arm64@0.1.1': - optional: true - - '@napi-rs/tar-darwin-arm64@0.1.1': - optional: true - - '@napi-rs/tar-darwin-x64@0.1.1': - optional: true - - '@napi-rs/tar-freebsd-x64@0.1.1': - optional: true - - '@napi-rs/tar-linux-arm-gnueabihf@0.1.1': - optional: true - - '@napi-rs/tar-linux-arm64-gnu@0.1.1': - optional: true - - '@napi-rs/tar-linux-arm64-musl@0.1.1': - optional: true - - '@napi-rs/tar-linux-x64-gnu@0.1.1': - optional: true - - '@napi-rs/tar-linux-x64-musl@0.1.1': - optional: true - - '@napi-rs/tar-wasm32-wasi@0.1.1': - dependencies: - '@napi-rs/wasm-runtime': 0.2.4 - optional: true - - '@napi-rs/tar-win32-arm64-msvc@0.1.1': - optional: true - - '@napi-rs/tar-win32-ia32-msvc@0.1.1': - optional: true - - '@napi-rs/tar-win32-x64-msvc@0.1.1': - optional: true - - '@napi-rs/tar@0.1.1': - optionalDependencies: - '@napi-rs/tar-android-arm-eabi': 0.1.1 - '@napi-rs/tar-android-arm64': 0.1.1 - '@napi-rs/tar-darwin-arm64': 0.1.1 - '@napi-rs/tar-darwin-x64': 0.1.1 - '@napi-rs/tar-freebsd-x64': 0.1.1 - '@napi-rs/tar-linux-arm-gnueabihf': 0.1.1 - '@napi-rs/tar-linux-arm64-gnu': 0.1.1 - '@napi-rs/tar-linux-arm64-musl': 0.1.1 - '@napi-rs/tar-linux-x64-gnu': 0.1.1 - '@napi-rs/tar-linux-x64-musl': 0.1.1 - '@napi-rs/tar-wasm32-wasi': 0.1.1 - '@napi-rs/tar-win32-arm64-msvc': 0.1.1 - '@napi-rs/tar-win32-ia32-msvc': 0.1.1 - '@napi-rs/tar-win32-x64-msvc': 0.1.1 - - '@napi-rs/wasm-runtime@0.2.4': - dependencies: - '@emnapi/core': 1.2.0 - '@emnapi/runtime': 1.2.0 - '@tybys/wasm-util': 0.9.0 - - '@napi-rs/wasm-tools-android-arm-eabi@0.0.2': - optional: true - - '@napi-rs/wasm-tools-android-arm64@0.0.2': - optional: true - - '@napi-rs/wasm-tools-darwin-arm64@0.0.2': - optional: true - - '@napi-rs/wasm-tools-darwin-x64@0.0.2': - optional: true - - '@napi-rs/wasm-tools-freebsd-x64@0.0.2': - optional: true - - '@napi-rs/wasm-tools-linux-arm64-gnu@0.0.2': - optional: true - - '@napi-rs/wasm-tools-linux-arm64-musl@0.0.2': - optional: true - - '@napi-rs/wasm-tools-linux-x64-gnu@0.0.2': - optional: true - - '@napi-rs/wasm-tools-linux-x64-musl@0.0.2': - optional: true - - '@napi-rs/wasm-tools-wasm32-wasi@0.0.2': - dependencies: - '@napi-rs/wasm-runtime': 0.2.4 - optional: true - - '@napi-rs/wasm-tools-win32-arm64-msvc@0.0.2': - optional: true - - '@napi-rs/wasm-tools-win32-ia32-msvc@0.0.2': - optional: true - - '@napi-rs/wasm-tools-win32-x64-msvc@0.0.2': - optional: true - - '@napi-rs/wasm-tools@0.0.2': - optionalDependencies: - '@napi-rs/wasm-tools-android-arm-eabi': 0.0.2 - '@napi-rs/wasm-tools-android-arm64': 0.0.2 - '@napi-rs/wasm-tools-darwin-arm64': 0.0.2 - '@napi-rs/wasm-tools-darwin-x64': 0.0.2 - '@napi-rs/wasm-tools-freebsd-x64': 0.0.2 - '@napi-rs/wasm-tools-linux-arm64-gnu': 0.0.2 - '@napi-rs/wasm-tools-linux-arm64-musl': 0.0.2 - '@napi-rs/wasm-tools-linux-x64-gnu': 0.0.2 - '@napi-rs/wasm-tools-linux-x64-musl': 0.0.2 - '@napi-rs/wasm-tools-wasm32-wasi': 0.0.2 - '@napi-rs/wasm-tools-win32-arm64-msvc': 0.0.2 - '@napi-rs/wasm-tools-win32-ia32-msvc': 0.0.2 - '@napi-rs/wasm-tools-win32-x64-msvc': 0.0.2 - - '@nodelib/fs.scandir@2.1.5': - dependencies: - '@nodelib/fs.stat': 2.0.5 - run-parallel: 1.2.0 - - '@nodelib/fs.stat@2.0.5': {} - - '@nodelib/fs.walk@1.2.8': - dependencies: - '@nodelib/fs.scandir': 2.1.5 - fastq: 1.17.1 - - '@octokit/auth-token@4.0.0': {} - - '@octokit/core@5.2.0': - dependencies: - '@octokit/auth-token': 4.0.0 - '@octokit/graphql': 7.1.0 - '@octokit/request': 8.4.0 - '@octokit/request-error': 5.1.0 - '@octokit/types': 13.5.0 - before-after-hook: 2.2.3 - universal-user-agent: 6.0.1 - - '@octokit/endpoint@9.0.5': - dependencies: - '@octokit/types': 13.5.0 - universal-user-agent: 6.0.1 - - '@octokit/graphql@7.1.0': - dependencies: - '@octokit/request': 8.4.0 - '@octokit/types': 13.5.0 - universal-user-agent: 6.0.1 - - '@octokit/openapi-types@22.2.0': {} - - '@octokit/plugin-paginate-rest@11.3.1(@octokit/core@5.2.0)': - dependencies: - '@octokit/core': 5.2.0 - '@octokit/types': 13.5.0 - - '@octokit/plugin-request-log@4.0.1(@octokit/core@5.2.0)': - dependencies: - '@octokit/core': 5.2.0 - - '@octokit/plugin-rest-endpoint-methods@13.2.2(@octokit/core@5.2.0)': - dependencies: - '@octokit/core': 5.2.0 - '@octokit/types': 13.5.0 - - '@octokit/request-error@5.1.0': - dependencies: - '@octokit/types': 13.5.0 - deprecation: 2.3.1 - once: 1.4.0 - - '@octokit/request@8.4.0': - dependencies: - '@octokit/endpoint': 9.0.5 - '@octokit/request-error': 5.1.0 - '@octokit/types': 13.5.0 - universal-user-agent: 6.0.1 - - '@octokit/rest@20.1.1': - dependencies: - '@octokit/core': 5.2.0 - '@octokit/plugin-paginate-rest': 11.3.1(@octokit/core@5.2.0) - '@octokit/plugin-request-log': 4.0.1(@octokit/core@5.2.0) - '@octokit/plugin-rest-endpoint-methods': 13.2.2(@octokit/core@5.2.0) - - '@octokit/types@13.5.0': - dependencies: - '@octokit/openapi-types': 22.2.0 - - '@rollup/pluginutils@4.2.1': - dependencies: - estree-walker: 2.0.2 - picomatch: 2.3.1 - - '@sindresorhus/merge-streams@2.3.0': {} - - '@tybys/wasm-util@0.9.0': - dependencies: - tslib: 2.6.3 - - '@types/node@20.14.8': - dependencies: - undici-types: 5.26.5 - - '@types/stylis@4.2.6': {} - - '@vercel/nft@0.26.5': - dependencies: - '@mapbox/node-pre-gyp': 1.0.11 - '@rollup/pluginutils': 4.2.1 - acorn: 8.12.0 - acorn-import-attributes: 1.9.5(acorn@8.12.0) - async-sema: 3.1.1 - bindings: 1.5.0 - estree-walker: 2.0.2 - glob: 7.2.3 - graceful-fs: 4.2.11 - micromatch: 4.0.7 - node-gyp-build: 4.8.1 - resolve-from: 5.0.0 - transitivePeerDependencies: - - encoding - - supports-color - - abbrev@1.1.1: {} - - acorn-import-attributes@1.9.5(acorn@8.12.0): - dependencies: - acorn: 8.12.0 - - acorn-walk@8.3.3: - dependencies: - acorn: 8.12.0 - - acorn@8.12.0: {} - - agent-base@6.0.2: - dependencies: - debug: 4.3.5 - transitivePeerDependencies: - - supports-color - - ansi-escapes@4.3.2: - dependencies: - type-fest: 0.21.3 - - ansi-regex@5.0.1: {} - - ansi-regex@6.0.1: {} - - ansi-styles@4.3.0: - dependencies: - color-convert: 2.0.1 - - ansi-styles@6.2.1: {} - - aproba@2.0.0: {} - - are-we-there-yet@2.0.0: - dependencies: - delegates: 1.0.0 - readable-stream: 3.6.2 - - argparse@1.0.10: - dependencies: - sprintf-js: 1.0.3 - - argparse@2.0.1: {} - - array-find-index@1.0.2: {} - - arrgv@1.0.2: {} - - arrify@3.0.0: {} - - async-sema@3.1.1: {} - - asynckit@0.4.0: {} - - ava@6.1.3: - dependencies: - '@vercel/nft': 0.26.5 - acorn: 8.12.0 - acorn-walk: 8.3.3 - ansi-styles: 6.2.1 - arrgv: 1.0.2 - arrify: 3.0.0 - callsites: 4.1.0 - cbor: 9.0.2 - chalk: 5.3.0 - chunkd: 2.0.1 - ci-info: 4.0.0 - ci-parallel-vars: 1.0.1 - cli-truncate: 4.0.0 - code-excerpt: 4.0.0 - common-path-prefix: 3.0.0 - concordance: 5.0.4 - currently-unhandled: 0.4.1 - debug: 4.3.5 - emittery: 1.0.3 - figures: 6.1.0 - globby: 14.0.1 - ignore-by-default: 2.1.0 - indent-string: 5.0.0 - is-plain-object: 5.0.0 - is-promise: 4.0.0 - matcher: 5.0.0 - memoize: 10.0.0 - ms: 2.1.3 - p-map: 7.0.2 - package-config: 5.0.0 - picomatch: 3.0.1 - plur: 5.1.0 - pretty-ms: 9.0.0 - resolve-cwd: 3.0.0 - stack-utils: 2.0.6 - strip-ansi: 7.1.0 - supertap: 3.0.1 - temp-dir: 3.0.0 - write-file-atomic: 5.0.1 - yargs: 17.7.2 - transitivePeerDependencies: - - encoding - - supports-color - - axios@1.6.2: - dependencies: - follow-redirects: 1.15.6 - form-data: 4.0.0 - proxy-from-env: 1.1.0 - transitivePeerDependencies: - - debug - - balanced-match@1.0.2: {} - - base64-js@1.5.1: {} - - before-after-hook@2.2.3: {} - - bindings@1.5.0: - dependencies: - file-uri-to-path: 1.0.0 - - bl@4.1.0: - dependencies: - buffer: 5.7.1 - inherits: 2.0.4 - readable-stream: 3.6.2 - - blueimp-md5@2.19.0: {} - - brace-expansion@1.1.11: - dependencies: - balanced-match: 1.0.2 - concat-map: 0.0.1 - - braces@3.0.3: - dependencies: - fill-range: 7.1.1 - - buffer@5.7.1: - dependencies: - base64-js: 1.5.1 - ieee754: 1.2.1 - - call-bind@1.0.7: - dependencies: - es-define-property: 1.0.0 - es-errors: 1.3.0 - function-bind: 1.1.2 - get-intrinsic: 1.2.4 - set-function-length: 1.2.2 - - callsites@4.1.0: {} - - camelize@1.0.1: {} - - cbor@9.0.2: - dependencies: - nofilter: 3.1.0 - - chalk@4.1.2: - dependencies: - ansi-styles: 4.3.0 - supports-color: 7.2.0 - - chalk@5.3.0: {} - - chardet@0.7.0: {} - - chownr@2.0.0: {} - - chunkd@2.0.1: {} - - ci-info@4.0.0: {} - - ci-parallel-vars@1.0.1: {} - - cli-cursor@3.1.0: - dependencies: - restore-cursor: 3.1.0 - - cli-spinners@2.9.2: {} - - cli-truncate@4.0.0: - dependencies: - slice-ansi: 5.0.0 - string-width: 7.1.0 - - cli-width@4.1.0: {} - - clipanion@3.2.1(typanion@3.14.0): - dependencies: - typanion: 3.14.0 - - cliui@8.0.1: - dependencies: - string-width: 4.2.3 - strip-ansi: 6.0.1 - wrap-ansi: 7.0.0 - - clone@1.0.4: {} - - code-excerpt@4.0.0: - dependencies: - convert-to-spaces: 2.0.1 - - color-convert@2.0.1: - dependencies: - color-name: 1.1.4 - - color-name@1.1.4: {} - - color-support@1.1.3: {} - - colorette@2.0.20: {} - - combined-stream@1.0.8: - dependencies: - delayed-stream: 1.0.0 - - common-path-prefix@3.0.0: {} - - concat-map@0.0.1: {} - - concordance@5.0.4: - dependencies: - date-time: 3.1.0 - esutils: 2.0.3 - fast-diff: 1.3.0 - js-string-escape: 1.0.1 - lodash: 4.17.21 - md5-hex: 3.0.1 - semver: 7.6.2 - well-known-symbols: 2.0.0 - - console-control-strings@1.1.0: {} - - convert-to-spaces@2.0.1: {} - - css-color-keywords@1.0.0: {} - - css-to-react-native@3.2.0: - dependencies: - camelize: 1.0.1 - css-color-keywords: 1.0.0 - postcss-value-parser: 4.2.0 - - csstype@3.1.3: {} - - currently-unhandled@0.4.1: - dependencies: - array-find-index: 1.0.2 - - date-time@3.1.0: - dependencies: - time-zone: 1.0.0 - - debug@4.3.5: - dependencies: - ms: 2.1.2 - - defaults@1.0.4: - dependencies: - clone: 1.0.4 - - define-data-property@1.1.4: - dependencies: - es-define-property: 1.0.0 - es-errors: 1.3.0 - gopd: 1.0.1 - - delayed-stream@1.0.0: {} - - delegates@1.0.0: {} - - deprecation@2.3.1: {} - - detect-libc@2.0.3: {} - - emittery@1.0.3: {} - - emnapi@1.2.0: {} - - emoji-regex@10.3.0: {} - - emoji-regex@8.0.0: {} - - es-define-property@1.0.0: - dependencies: - get-intrinsic: 1.2.4 - - es-errors@1.3.0: {} - - escalade@3.1.2: {} - - escape-string-regexp@2.0.0: {} - - escape-string-regexp@5.0.0: {} - - esprima@4.0.1: {} - - estree-walker@2.0.2: {} - - esutils@2.0.3: {} - - external-editor@3.1.0: - dependencies: - chardet: 0.7.0 - iconv-lite: 0.4.24 - tmp: 0.0.33 - - fast-diff@1.3.0: {} - - fast-glob@3.3.2: - dependencies: - '@nodelib/fs.stat': 2.0.5 - '@nodelib/fs.walk': 1.2.8 - glob-parent: 5.1.2 - merge2: 1.4.1 - micromatch: 4.0.7 - - fastq@1.17.1: - dependencies: - reusify: 1.0.4 - - figures@6.1.0: - dependencies: - is-unicode-supported: 2.0.0 - - file-uri-to-path@1.0.0: {} - - fill-range@7.1.1: - dependencies: - to-regex-range: 5.0.1 - - find-up-simple@1.0.0: {} - - follow-redirects@1.15.6: {} - - form-data@4.0.0: - dependencies: - asynckit: 0.4.0 - combined-stream: 1.0.8 - mime-types: 2.1.35 - - fs-minipass@2.1.0: - dependencies: - minipass: 3.3.6 - - fs.realpath@1.0.0: {} - - function-bind@1.1.2: {} - - gauge@3.0.2: - dependencies: - aproba: 2.0.0 - color-support: 1.1.3 - console-control-strings: 1.1.0 - has-unicode: 2.0.1 - object-assign: 4.1.1 - signal-exit: 3.0.7 - string-width: 4.2.3 - strip-ansi: 6.0.1 - wide-align: 1.1.5 - - get-caller-file@2.0.5: {} - - get-east-asian-width@1.2.0: {} - - get-intrinsic@1.2.4: - dependencies: - es-errors: 1.3.0 - function-bind: 1.1.2 - has-proto: 1.0.3 - has-symbols: 1.0.3 - hasown: 2.0.2 - - glob-parent@5.1.2: - dependencies: - is-glob: 4.0.3 - - glob@7.2.3: - dependencies: - fs.realpath: 1.0.0 - inflight: 1.0.6 - inherits: 2.0.4 - minimatch: 3.1.2 - once: 1.4.0 - path-is-absolute: 1.0.1 - - globby@14.0.1: - dependencies: - '@sindresorhus/merge-streams': 2.3.0 - fast-glob: 3.3.2 - ignore: 5.3.1 - path-type: 5.0.0 - slash: 5.1.0 - unicorn-magic: 0.1.0 - - gopd@1.0.1: - dependencies: - get-intrinsic: 1.2.4 - - graceful-fs@4.2.11: {} - - has-flag@4.0.0: {} - - has-property-descriptors@1.0.2: - dependencies: - es-define-property: 1.0.0 - - has-proto@1.0.3: {} - - has-symbols@1.0.3: {} - - has-unicode@2.0.1: {} - - hasown@2.0.2: - dependencies: - function-bind: 1.1.2 - - https-proxy-agent@5.0.1: - dependencies: - agent-base: 6.0.2 - debug: 4.3.5 - transitivePeerDependencies: - - supports-color - - iconv-lite@0.4.24: - dependencies: - safer-buffer: 2.1.2 - - ieee754@1.2.1: {} - - ignore-by-default@2.1.0: {} - - ignore@5.3.1: {} - - imurmurhash@0.1.4: {} - - indent-string@5.0.0: {} - - inflight@1.0.6: - dependencies: - once: 1.4.0 - wrappy: 1.0.2 - - inherits@2.0.4: {} - - inquirer@9.2.23: - dependencies: - '@inquirer/figures': 1.0.3 - '@ljharb/through': 2.3.13 - ansi-escapes: 4.3.2 - chalk: 5.3.0 - cli-cursor: 3.1.0 - cli-width: 4.1.0 - external-editor: 3.1.0 - lodash: 4.17.21 - mute-stream: 1.0.0 - ora: 5.4.1 - run-async: 3.0.0 - rxjs: 7.8.1 - string-width: 4.2.3 - strip-ansi: 6.0.1 - wrap-ansi: 6.2.0 - - irregular-plurals@3.5.0: {} - - is-extglob@2.1.1: {} - - is-fullwidth-code-point@3.0.0: {} - - is-fullwidth-code-point@4.0.0: {} - - is-glob@4.0.3: - dependencies: - is-extglob: 2.1.1 - - is-interactive@1.0.0: {} - - is-number@7.0.0: {} - - is-plain-object@5.0.0: {} - - is-promise@4.0.0: {} - - is-unicode-supported@0.1.0: {} - - is-unicode-supported@2.0.0: {} - - js-string-escape@1.0.1: {} - - js-tokens@4.0.0: {} - - js-yaml@3.14.1: - dependencies: - argparse: 1.0.10 - esprima: 4.0.1 - - js-yaml@4.1.0: - dependencies: - argparse: 2.0.1 - - load-json-file@7.0.1: {} - - lodash-es@4.17.21: {} - - lodash@4.17.21: {} - - log-symbols@4.1.0: - dependencies: - chalk: 4.1.2 - is-unicode-supported: 0.1.0 - - loose-envify@1.4.0: - dependencies: - js-tokens: 4.0.0 - - make-dir@3.1.0: - dependencies: - semver: 6.3.1 - - matcher@5.0.0: - dependencies: - escape-string-regexp: 5.0.0 - - md5-hex@3.0.1: - dependencies: - blueimp-md5: 2.19.0 - - memoize@10.0.0: - dependencies: - mimic-function: 5.0.1 - - merge2@1.4.1: {} - - micromatch@4.0.7: - dependencies: - braces: 3.0.3 - picomatch: 2.3.1 - - mime-db@1.52.0: {} - - mime-types@2.1.35: - dependencies: - mime-db: 1.52.0 - - mimic-fn@2.1.0: {} - - mimic-function@5.0.1: {} - - minimatch@3.1.2: - dependencies: - brace-expansion: 1.1.11 - - minipass@3.3.6: - dependencies: - yallist: 4.0.0 - - minipass@5.0.0: {} - - minizlib@2.1.2: - dependencies: - minipass: 3.3.6 - yallist: 4.0.0 - - mkdirp@1.0.4: {} - - ms@2.1.2: {} - - ms@2.1.3: {} - - mute-stream@1.0.0: {} - - nanoid@3.3.7: {} - - node-fetch@2.7.0: - dependencies: - whatwg-url: 5.0.0 - - node-gyp-build@4.8.1: {} - - nofilter@3.1.0: {} - - nopt@5.0.0: - dependencies: - abbrev: 1.1.1 - - npmlog@5.0.1: - dependencies: - are-we-there-yet: 2.0.0 - console-control-strings: 1.1.0 - gauge: 3.0.2 - set-blocking: 2.0.0 - - object-assign@4.1.1: {} - - once@1.4.0: - dependencies: - wrappy: 1.0.2 - - onetime@5.1.2: - dependencies: - mimic-fn: 2.1.0 - - ora@5.4.1: - dependencies: - bl: 4.1.0 - chalk: 4.1.2 - cli-cursor: 3.1.0 - cli-spinners: 2.9.2 - is-interactive: 1.0.0 - is-unicode-supported: 0.1.0 - log-symbols: 4.1.0 - strip-ansi: 6.0.1 - wcwidth: 1.0.1 - - os-tmpdir@1.0.2: {} - - p-map@7.0.2: {} - - package-config@5.0.0: - dependencies: - find-up-simple: 1.0.0 - load-json-file: 7.0.1 - - parse-ms@4.0.0: {} - - path-is-absolute@1.0.1: {} - - path-type@5.0.0: {} - - picocolors@1.0.1: {} - - picomatch@2.3.1: {} - - picomatch@3.0.1: {} - - plur@5.1.0: - dependencies: - irregular-plurals: 3.5.0 - - postcss-value-parser@4.2.0: {} - - postcss@8.4.33: - dependencies: - nanoid: 3.3.7 - picocolors: 1.0.1 - source-map-js: 1.2.0 - - pretty-ms@9.0.0: - dependencies: - parse-ms: 4.0.0 - - proxy-from-env@1.1.0: {} - - queue-microtask@1.2.3: {} - - react-dom@18.3.1(react@18.3.1): - dependencies: - loose-envify: 1.4.0 - react: 18.3.1 - scheduler: 0.23.2 - - react@18.3.1: - dependencies: - loose-envify: 1.4.0 - - readable-stream@3.6.2: - dependencies: - inherits: 2.0.4 - string_decoder: 1.3.0 - util-deprecate: 1.0.2 - - require-directory@2.1.1: {} - - resolve-cwd@3.0.0: - dependencies: - resolve-from: 5.0.0 - - resolve-from@5.0.0: {} - - restore-cursor@3.1.0: - dependencies: - onetime: 5.1.2 - signal-exit: 3.0.7 - - reusify@1.0.4: {} - - rimraf@3.0.2: - dependencies: - glob: 7.2.3 - - run-async@3.0.0: {} - - run-parallel@1.2.0: - dependencies: - queue-microtask: 1.2.3 - - rxjs@7.8.1: - dependencies: - tslib: 2.6.3 - - safe-buffer@5.2.1: {} - - safer-buffer@2.1.2: {} - - scheduler@0.23.2: - dependencies: - loose-envify: 1.4.0 - - semver@6.3.1: {} - - semver@7.6.2: {} - - serialize-error@7.0.1: - dependencies: - type-fest: 0.13.1 - - set-blocking@2.0.0: {} - - set-function-length@1.2.2: - 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 - - shallowequal@1.1.0: {} - - signal-exit@3.0.7: {} - - signal-exit@4.1.0: {} - - slash@5.1.0: {} - - slice-ansi@5.0.0: - dependencies: - ansi-styles: 6.2.1 - is-fullwidth-code-point: 4.0.0 - - source-map-js@1.2.0: {} - - sprintf-js@1.0.3: {} - - stack-utils@2.0.6: - dependencies: - escape-string-regexp: 2.0.0 - - string-width@4.2.3: - dependencies: - emoji-regex: 8.0.0 - is-fullwidth-code-point: 3.0.0 - strip-ansi: 6.0.1 - - string-width@7.1.0: - dependencies: - emoji-regex: 10.3.0 - get-east-asian-width: 1.2.0 - strip-ansi: 7.1.0 - - string_decoder@1.3.0: - dependencies: - safe-buffer: 5.2.1 - - strip-ansi@6.0.1: - dependencies: - ansi-regex: 5.0.1 - - strip-ansi@7.1.0: - dependencies: - ansi-regex: 6.0.1 - - styled-components@6.1.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1): - dependencies: - '@emotion/is-prop-valid': 1.2.2 - '@emotion/unitless': 0.8.1 - '@types/stylis': 4.2.6 - css-to-react-native: 3.2.0 - csstype: 3.1.3 - postcss: 8.4.33 - react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) - shallowequal: 1.1.0 - stylis: 4.3.2 - tslib: 2.6.3 - - stylis@4.3.2: {} - - supertap@3.0.1: - dependencies: - indent-string: 5.0.0 - js-yaml: 3.14.1 - serialize-error: 7.0.1 - strip-ansi: 7.1.0 - - supports-color@7.2.0: - dependencies: - has-flag: 4.0.0 - - tar@6.2.1: - dependencies: - chownr: 2.0.0 - fs-minipass: 2.1.0 - minipass: 5.0.0 - minizlib: 2.1.2 - mkdirp: 1.0.4 - yallist: 4.0.0 - - temp-dir@3.0.0: {} - - time-zone@1.0.0: {} - - tmp@0.0.33: - dependencies: - os-tmpdir: 1.0.2 - - to-regex-range@5.0.1: - dependencies: - is-number: 7.0.0 - - toml@3.0.0: {} - - tr46@0.0.3: {} - - tslib@2.6.3: {} - - typanion@3.14.0: {} - - type-fest@0.13.1: {} - - type-fest@0.21.3: {} - - typescript@5.5.2: {} - - undici-types@5.26.5: {} - - unicorn-magic@0.1.0: {} - - universal-user-agent@6.0.1: {} - - util-deprecate@1.0.2: {} - - wasm-sjlj@1.0.5: {} - - wcwidth@1.0.1: - dependencies: - defaults: 1.0.4 - - webidl-conversions@3.0.1: {} - - well-known-symbols@2.0.0: {} - - whatwg-url@5.0.0: - dependencies: - tr46: 0.0.3 - webidl-conversions: 3.0.1 - - wide-align@1.1.5: - dependencies: - string-width: 4.2.3 - - wrap-ansi@6.2.0: - dependencies: - ansi-styles: 4.3.0 - string-width: 4.2.3 - strip-ansi: 6.0.1 - - wrap-ansi@7.0.0: - dependencies: - ansi-styles: 4.3.0 - string-width: 4.2.3 - strip-ansi: 6.0.1 - - wrappy@1.0.2: {} - - write-file-atomic@5.0.1: - dependencies: - imurmurhash: 0.1.4 - signal-exit: 4.1.0 - - y18n@5.0.8: {} - - yallist@4.0.0: {} - - yargs-parser@21.1.1: {} - - yargs@17.7.2: - dependencies: - cliui: 8.0.1 - escalade: 3.1.2 - get-caller-file: 2.0.5 - require-directory: 2.1.1 - string-width: 4.2.3 - y18n: 5.0.8 - yargs-parser: 21.1.1 diff --git a/src/builtins.rs b/src/builtins.rs deleted file mode 100644 index 45a25117..00000000 --- a/src/builtins.rs +++ /dev/null @@ -1,71 +0,0 @@ -/// Node.js built-in modules -/// -/// `node -p "[...require('module').builtinModules].map(b => JSON.stringify(b)).join(',\n')"` -/// -pub const NODEJS_BUILTINS: &[&str] = &[ - "_http_agent", - "_http_client", - "_http_common", - "_http_incoming", - "_http_outgoing", - "_http_server", - "_stream_duplex", - "_stream_passthrough", - "_stream_readable", - "_stream_transform", - "_stream_wrap", - "_stream_writable", - "_tls_common", - "_tls_wrap", - "assert", - "assert/strict", - "async_hooks", - "buffer", - "child_process", - "cluster", - "console", - "constants", - "crypto", - "dgram", - "diagnostics_channel", - "dns", - "dns/promises", - "domain", - "events", - "fs", - "fs/promises", - "http", - "http2", - "https", - "inspector", - "module", - "net", - "os", - "path", - "path/posix", - "path/win32", - "perf_hooks", - "process", - "punycode", - "querystring", - "readline", - "repl", - "stream", - "stream/consumers", - "stream/promises", - "stream/web", - "string_decoder", - "sys", - "timers", - "timers/promises", - "tls", - "trace_events", - "tty", - "url", - "util", - "util/types", - "v8", - "vm", - "worker_threads", - "zlib", -]; diff --git a/src/cache.rs b/src/cache.rs deleted file mode 100644 index a1bde36c..00000000 --- a/src/cache.rs +++ /dev/null @@ -1,369 +0,0 @@ -use once_cell::sync::OnceCell as OnceLock; -use std::{ - borrow::{Borrow, Cow}, - convert::AsRef, - hash::{BuildHasherDefault, Hash, Hasher}, - io, - ops::Deref, - path::{Path, PathBuf}, - sync::Arc, -}; - -use dashmap::{DashMap, DashSet}; -use rustc_hash::FxHasher; - -use crate::{ - context::ResolveContext as Ctx, package_json::PackageJson, path::PathUtil, FileMetadata, - FileSystem, ResolveError, ResolveOptions, TsConfig, -}; - -#[derive(Default)] -pub struct Cache { - pub(crate) fs: Fs, - paths: DashSet>, - tsconfigs: DashMap, BuildHasherDefault>, -} - -impl Cache { - pub fn new(fs: Fs) -> Self { - Self { fs, paths: DashSet::default(), tsconfigs: DashMap::default() } - } - - pub fn clear(&self) { - self.paths.clear(); - self.tsconfigs.clear(); - } - - pub fn value(&self, path: &Path) -> CachedPath { - let hash = { - let mut hasher = FxHasher::default(); - path.hash(&mut hasher); - hasher.finish() - }; - if let Some(cache_entry) = self.paths.get((hash, path).borrow() as &dyn CacheKey) { - return cache_entry.clone(); - } - let parent = path.parent().map(|p| self.value(p)); - let data = CachedPath(Arc::new(CachedPathImpl::new( - hash, - path.to_path_buf().into_boxed_path(), - parent, - ))); - self.paths.insert(data.clone()); - data - } - - pub fn tsconfig Result<(), ResolveError>>( - &self, - root: bool, - path: &Path, - callback: F, // callback for modifying tsconfig with `extends` - ) -> Result, ResolveError> { - if let Some(tsconfig_ref) = self.tsconfigs.get(path) { - return Ok(Arc::clone(tsconfig_ref.value())); - } - let meta = self.fs.metadata(path).ok(); - let tsconfig_path = if meta.is_some_and(|m| m.is_file) { - Cow::Borrowed(path) - } else if meta.is_some_and(|m| m.is_dir) { - Cow::Owned(path.join("tsconfig.json")) - } else { - let mut os_string = path.to_path_buf().into_os_string(); - os_string.push(".json"); - Cow::Owned(PathBuf::from(os_string)) - }; - let mut tsconfig_string = self - .fs - .read_to_string(&tsconfig_path) - .map_err(|_| ResolveError::TsconfigNotFound(path.to_path_buf()))?; - let mut tsconfig = - TsConfig::parse(root, &tsconfig_path, &mut tsconfig_string).map_err(|error| { - ResolveError::from_serde_json_error(tsconfig_path.to_path_buf(), &error) - })?; - callback(&mut tsconfig)?; - let tsconfig = Arc::new(tsconfig.build()); - self.tsconfigs.insert(path.to_path_buf(), Arc::clone(&tsconfig)); - Ok(tsconfig) - } -} - -#[derive(Clone)] -pub struct CachedPath(Arc); - -impl Hash for CachedPath { - fn hash(&self, state: &mut H) { - self.0.hash.hash(state); - } -} - -impl PartialEq for CachedPath { - fn eq(&self, other: &Self) -> bool { - self.0.path == other.0.path - } -} -impl Eq for CachedPath {} - -impl Deref for CachedPath { - type Target = CachedPathImpl; - - fn deref(&self) -> &Self::Target { - self.0.as_ref() - } -} - -impl<'a> Borrow for CachedPath { - fn borrow(&self) -> &(dyn CacheKey + 'a) { - self - } -} - -impl AsRef for CachedPath { - fn as_ref(&self) -> &CachedPathImpl { - self.0.as_ref() - } -} - -impl CacheKey for CachedPath { - fn tuple(&self) -> (u64, &Path) { - (self.hash, &self.path) - } -} - -pub struct CachedPathImpl { - hash: u64, - path: Box, - parent: Option, - meta: OnceLock>, - symlink: OnceLock>, - canonicalized: OnceLock>, - node_modules: OnceLock>, - package_json: OnceLock>>, -} - -impl CachedPathImpl { - fn new(hash: u64, path: Box, parent: Option) -> Self { - Self { - hash, - path, - parent, - meta: OnceLock::new(), - symlink: OnceLock::new(), - canonicalized: OnceLock::new(), - node_modules: OnceLock::new(), - package_json: OnceLock::new(), - } - } - - pub fn path(&self) -> &Path { - &self.path - } - - pub fn to_path_buf(&self) -> PathBuf { - self.path.to_path_buf() - } - - pub fn parent(&self) -> Option<&CachedPath> { - self.parent.as_ref() - } - - fn meta(&self, fs: &Fs) -> Option { - *self.meta.get_or_init(|| fs.metadata(&self.path).ok()) - } - - pub fn is_file(&self, fs: &Fs, ctx: &mut Ctx) -> bool { - if let Some(meta) = self.meta(fs) { - ctx.add_file_dependency(self.path()); - meta.is_file - } else { - ctx.add_missing_dependency(self.path()); - false - } - } - - pub fn is_dir(&self, fs: &Fs, ctx: &mut Ctx) -> bool { - self.meta(fs).map_or_else( - || { - ctx.add_missing_dependency(self.path()); - false - }, - |meta| meta.is_dir, - ) - } - - fn symlink(&self, fs: &Fs) -> io::Result> { - self.symlink - .get_or_try_init(|| { - if let Ok(symlink_metadata) = fs.symlink_metadata(&self.path) { - if symlink_metadata.is_symlink { - return fs.canonicalize(self.path()).map(Some); - } - } - Ok(None) - }) - .cloned() - } - - pub fn realpath(&self, fs: &Fs) -> io::Result { - self.canonicalized - .get_or_try_init(|| { - if let Some(link) = self.symlink(fs)? { - return Ok(Some(link)); - } - if let Some(parent) = self.parent() { - let parent_path = parent.realpath(fs)?; - return Ok(Some( - parent_path.normalize_with(self.path.strip_prefix(&parent.path).unwrap()), - )); - }; - Ok(None) - }) - .cloned() - .map(|r| r.unwrap_or_else(|| self.path.clone().to_path_buf())) - } - - pub fn module_directory( - &self, - module_name: &str, - cache: &Cache, - ctx: &mut Ctx, - ) -> Option { - let cached_path = cache.value(&self.path.join(module_name)); - cached_path.is_dir(&cache.fs, ctx).then_some(cached_path) - } - - pub fn cached_node_modules( - &self, - cache: &Cache, - ctx: &mut Ctx, - ) -> Option { - self.node_modules.get_or_init(|| self.module_directory("node_modules", cache, ctx)).clone() - } - - /// Find package.json of a path by traversing parent directories. - /// - /// # Errors - /// - /// * [ResolveError::JSON] - pub fn find_package_json( - &self, - fs: &Fs, - options: &ResolveOptions, - ctx: &mut Ctx, - ) -> Result>, ResolveError> { - let mut cache_value = self; - // Go up directories when the querying path is not a directory - while !cache_value.is_dir(fs, ctx) { - if let Some(cv) = &cache_value.parent { - cache_value = cv.as_ref(); - } else { - break; - } - } - let mut cache_value = Some(cache_value); - while let Some(cv) = cache_value { - if let Some(package_json) = cv.package_json(fs, options, ctx)? { - return Ok(Some(Arc::clone(&package_json))); - } - cache_value = cv.parent.as_deref(); - } - Ok(None) - } - - /// Get package.json of the given path. - /// - /// # Errors - /// - /// * [ResolveError::JSON] - pub fn package_json( - &self, - fs: &Fs, - options: &ResolveOptions, - ctx: &mut Ctx, - ) -> Result>, ResolveError> { - // Change to `std::sync::OnceLock::get_or_try_init` when it is stable. - let result = self - .package_json - .get_or_try_init(|| { - let package_json_path = self.path.join("package.json"); - let Ok(package_json_string) = fs.read_to_string(&package_json_path) else { - return Ok(None); - }; - let real_path = if options.symlinks { - self.realpath(fs)?.join("package.json") - } else { - package_json_path.clone() - }; - PackageJson::parse(package_json_path.clone(), real_path, &package_json_string) - .map(Arc::new) - .map(Some) - .map_err(|error| ResolveError::from_serde_json_error(package_json_path, &error)) - }) - .cloned(); - // https://github.com/webpack/enhanced-resolve/blob/58464fc7cb56673c9aa849e68e6300239601e615/lib/DescriptionFileUtils.js#L68-L82 - match &result { - Ok(Some(package_json)) => { - ctx.add_file_dependency(&package_json.path); - } - Ok(None) => { - // Avoid an allocation by making this lazy - if let Some(deps) = &mut ctx.missing_dependencies { - deps.push(self.path.join("package.json")); - } - } - Err(_) => { - if let Some(deps) = &mut ctx.file_dependencies { - deps.push(self.path.join("package.json")); - } - } - } - result - } -} - -/// Memoized cache key, code adapted from . -trait CacheKey { - fn tuple(&self) -> (u64, &Path); -} - -impl Hash for dyn CacheKey + '_ { - fn hash(&self, state: &mut H) { - self.tuple().0.hash(state); - } -} - -impl PartialEq for dyn CacheKey + '_ { - fn eq(&self, other: &Self) -> bool { - self.tuple().1 == other.tuple().1 - } -} - -impl Eq for dyn CacheKey + '_ {} - -impl<'a> CacheKey for (u64, &'a Path) { - fn tuple(&self) -> (u64, &Path) { - (self.0, self.1) - } -} - -impl<'a> Borrow for (u64, &'a Path) { - fn borrow(&self) -> &(dyn CacheKey + 'a) { - self - } -} - -/// Since the cache key is memoized, use an identity hasher -/// to avoid double cache. -#[derive(Default)] -struct IdentityHasher(u64); - -impl Hasher for IdentityHasher { - fn write(&mut self, _: &[u8]) { - unreachable!("Invalid use of IdentityHasher") - } - fn write_u64(&mut self, n: u64) { - self.0 = n; - } - fn finish(&self) -> u64 { - self.0 - } -} diff --git a/src/context.rs b/src/context.rs deleted file mode 100644 index 9349de30..00000000 --- a/src/context.rs +++ /dev/null @@ -1,89 +0,0 @@ -use std::{ - ops::{Deref, DerefMut}, - path::{Path, PathBuf}, -}; - -use crate::error::ResolveError; - -#[derive(Debug, Default, Clone)] -pub struct ResolveContext(ResolveContextImpl); - -#[derive(Debug, Default, Clone)] -pub struct ResolveContextImpl { - pub fully_specified: bool, - - pub query: Option, - - pub fragment: Option, - - /// Files that was found on file system - pub file_dependencies: Option>, - - /// Files that was found on file system - pub missing_dependencies: Option>, - - /// The current resolving alias for bailing recursion alias. - pub resolving_alias: Option, - - /// For avoiding infinite recursion, which will cause stack overflow. - depth: u8, -} - -impl Deref for ResolveContext { - type Target = ResolveContextImpl; - - fn deref(&self) -> &Self::Target { - &self.0 - } -} - -impl DerefMut for ResolveContext { - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} - -impl ResolveContext { - pub fn with_fully_specified(&mut self, yes: bool) { - self.fully_specified = yes; - } - - pub fn with_query_fragment(&mut self, query: Option<&str>, fragment: Option<&str>) { - if let Some(query) = query { - self.query.replace(query.to_string()); - } - if let Some(fragment) = fragment { - self.fragment.replace(fragment.to_string()); - } - } - - pub fn init_file_dependencies(&mut self) { - self.file_dependencies.replace(vec![]); - self.missing_dependencies.replace(vec![]); - } - - pub fn add_file_dependency(&mut self, dep: &Path) { - if let Some(deps) = &mut self.file_dependencies { - deps.push(dep.to_path_buf()); - } - } - - pub fn add_missing_dependency(&mut self, dep: &Path) { - if let Some(deps) = &mut self.missing_dependencies { - deps.push(dep.to_path_buf()); - } - } - - pub fn with_resolving_alias(&mut self, alias: String) { - self.resolving_alias = Some(alias); - } - - pub fn test_for_infinite_recursion(&mut self) -> Result<(), ResolveError> { - self.depth += 1; - // 64 should be more than enough for detecting infinite recursion. - if self.depth > 64 { - return Err(ResolveError::Recursion); - } - Ok(()) - } -} diff --git a/src/error.rs b/src/error.rs deleted file mode 100644 index ff2aaa4f..00000000 --- a/src/error.rs +++ /dev/null @@ -1,160 +0,0 @@ -use std::{io, path::PathBuf, sync::Arc}; -use thiserror::Error; - -/// All resolution errors -/// -/// `thiserror` is used to display meaningful error messages. -#[derive(Debug, Clone, PartialEq, Error)] -pub enum ResolveError { - /// Ignored path - /// - /// Derived from ignored path (false value) from browser field in package.json - /// ```json - /// { - /// "browser": { - /// "./module": false - /// } - /// } - /// ``` - /// See - #[error("Path is ignored {0}")] - Ignored(PathBuf), - - /// Module not found - #[error("Cannot find module '{0}'")] - NotFound(/* specifier */ String), - - /// Tsconfig not found - #[error("Tsconfig not found {0}")] - TsconfigNotFound(PathBuf), - - #[error("{0}")] - IOError(IOError), - - /// Node.js builtin modules - /// - /// This is an error due to not being a Node.js runtime. - /// The `alias` option can be used to resolve a builtin module to a polyfill. - #[error("Builtin module {0}")] - Builtin(String), - - /// All of the aliased extension are not found - #[error("All of the aliased extension are not found")] - ExtensionAlias, - - /// The provided path specifier cannot be parsed - #[error("{0}")] - Specifier(SpecifierError), - - /// JSON parse error - #[error("{0:?}")] - JSON(JSONError), - - /// Restricted by `ResolveOptions::restrictions` - #[error(r#"Path "{0}" restricted by {0}"#)] - Restriction(PathBuf, PathBuf), - - #[error(r#"Invalid module "{0}" specifier is not a valid subpath for the "exports" resolution of {1}"#)] - InvalidModuleSpecifier(String, PathBuf), - - #[error(r#"Invalid "exports" target "{0}" defined for '{1}' in the package config {2}"#)] - InvalidPackageTarget(String, String, PathBuf), - - #[error(r#"Package subpath '{0}' is not defined by "exports" in {1}"#)] - PackagePathNotExported(String, PathBuf), - - #[error(r#"Invalid package config "{0}", "exports" cannot contain some keys starting with '.' and some not. The exports object must either be an object of package subpath keys or an object of main entry condition name keys only."#)] - InvalidPackageConfig(PathBuf), - - #[error(r#"Default condition should be last one in "{0}""#)] - InvalidPackageConfigDefault(PathBuf), - - #[error(r#"Expecting folder to folder mapping. "{0}" should end with "/"#)] - InvalidPackageConfigDirectory(PathBuf), - - #[error(r#"Package import specifier "{0}" is not defined in package {1}"#)] - PackageImportNotDefined(String, PathBuf), - - #[error("{0} is unimplemented")] - Unimplemented(&'static str), - - /// Occurs when alias paths reference each other. - #[error("Recursion in resolving")] - Recursion, -} - -impl ResolveError { - pub fn is_ignore(&self) -> bool { - matches!(self, Self::Ignored(_)) - } - - pub(crate) fn from_serde_json_error(path: PathBuf, error: &serde_json::Error) -> Self { - Self::JSON(JSONError { - path, - message: error.to_string(), - line: error.line(), - column: error.column(), - }) - } -} - -/// Error for [ResolveError::Specifier] -#[derive(Debug, Clone, Eq, PartialEq, Error)] -pub enum SpecifierError { - #[error("The specifiers must be a non-empty string. Received \"{0}\"")] - Empty(String), -} - -/// JSON error from [serde_json::Error] -#[derive(Debug, Clone, Eq, PartialEq)] -pub struct JSONError { - pub path: PathBuf, - pub message: String, - pub line: usize, - pub column: usize, -} - -#[derive(Debug, Clone, Error)] -#[error("{0}")] -pub struct IOError(Arc); - -impl PartialEq for IOError { - fn eq(&self, other: &Self) -> bool { - self.0.kind() == other.0.kind() - } -} - -impl From for io::Error { - fn from(error: IOError) -> Self { - let io_error = error.0.as_ref(); - Self::new(io_error.kind(), io_error.to_string()) - } -} - -impl From for ResolveError { - fn from(err: io::Error) -> Self { - Self::IOError(IOError(Arc::new(err))) - } -} - -#[test] -fn test_into_io_error() { - use std::io::{self, ErrorKind}; - let error_string = "IOError occurred"; - let string_error = io::Error::new(ErrorKind::Interrupted, error_string.to_string()); - let string_error2 = io::Error::new(ErrorKind::Interrupted, error_string.to_string()); - let resolve_io_error: ResolveError = ResolveError::from(string_error2); - - assert_eq!(resolve_io_error, ResolveError::from(string_error)); - assert_eq!(resolve_io_error.clone(), resolve_io_error); - if let ResolveError::IOError(io_error) = resolve_io_error { - // fix for https://github.com/web-infra-dev/rspack/issues/4564 - let std_io_error: io::Error = io_error.into(); - assert_eq!(std_io_error.kind(), ErrorKind::Interrupted); - assert_eq!(std_io_error.to_string(), error_string); - assert_eq!( - format!("{std_io_error:?}"), - r#"Custom { kind: Interrupted, error: "IOError occurred" }"# - ); - } -} diff --git a/src/file_system.rs b/src/file_system.rs deleted file mode 100644 index 04d177de..00000000 --- a/src/file_system.rs +++ /dev/null @@ -1,133 +0,0 @@ -use std::{ - fs, io, - path::{Path, PathBuf}, -}; - -/// File System abstraction used for `ResolverGeneric` -pub trait FileSystem: Send + Sync { - /// See [std::fs::read_to_string] - /// - /// # Errors - /// - /// * See [std::fs::read_to_string] - /// ## Warning - /// Use `&Path` instead of a generic `P: AsRef` here, - /// because object safety requirements, it is especially useful, when - /// you want to store multiple `dyn FileSystem` in a `Vec` or use a `ResolverGeneric` in - /// napi env. - fn read_to_string(&self, path: &Path) -> io::Result; - - /// See [std::fs::metadata] - /// - /// # Errors - /// See [std::fs::metadata] - /// ## Warning - /// Use `&Path` instead of a generic `P: AsRef` here, - /// because object safety requirements, it is especially useful, when - /// you want to store multiple `dyn FileSystem` in a `Vec` or use a `ResolverGeneric` in - /// napi env. - fn metadata(&self, path: &Path) -> io::Result; - - /// See [std::fs::symlink_metadata] - /// - /// # Errors - /// - /// See [std::fs::symlink_metadata] - /// ## Warning - /// Use `&Path` instead of a generic `P: AsRef` here, - /// because object safety requirements, it is especially useful, when - /// you want to store multiple `dyn FileSystem` in a `Vec` or use a `ResolverGeneric` in - /// napi env. - fn symlink_metadata(&self, path: &Path) -> io::Result; - - /// See [std::fs::canonicalize] - /// - /// # Errors - /// - /// See [std::fs::read_link] - /// ## Warning - /// Use `&Path` instead of a generic `P: AsRef` here, - /// because object safety requirements, it is especially useful, when - /// you want to store multiple `dyn FileSystem` in a `Vec` or use a `ResolverGeneric` in - /// napi env. - fn canonicalize(&self, path: &Path) -> io::Result; -} - -/// Metadata information about a file -#[derive(Debug, Clone, Copy)] -pub struct FileMetadata { - pub(crate) is_file: bool, - pub(crate) is_dir: bool, - pub(crate) is_symlink: bool, -} - -impl FileMetadata { - pub fn new(is_file: bool, is_dir: bool, is_symlink: bool) -> Self { - Self { is_file, is_dir, is_symlink } - } -} - -impl From for FileMetadata { - fn from(metadata: fs::Metadata) -> Self { - Self::new(metadata.is_file(), metadata.is_dir(), metadata.is_symlink()) - } -} - -/// Operating System -#[derive(Default)] -pub struct FileSystemOs; - -impl FileSystem for FileSystemOs { - fn read_to_string(&self, path: &Path) -> io::Result { - fs::read_to_string(path) - } - - fn metadata(&self, path: &Path) -> io::Result { - fs::metadata(path).map(FileMetadata::from) - } - - fn symlink_metadata(&self, path: &Path) -> io::Result { - fs::symlink_metadata(path).map(FileMetadata::from) - } - - fn canonicalize(&self, path: &Path) -> io::Result { - #[cfg(not(target_os = "wasi"))] - { - dunce::canonicalize(path) - } - #[cfg(target_os = "wasi")] - { - let meta = fs::symlink_metadata(path)?; - if meta.file_type().is_symlink() { - let link = fs::read_link(path)?; - let mut path_buf = path.to_path_buf(); - path_buf.pop(); - for segment in link.iter() { - match segment.to_str() { - Some("..") => { - path_buf.pop(); - } - Some(".") | None => {} - Some(seg) => { - // Need to trim the extra \0 introduces by rust std rust-lang/rust#123727 - path_buf.push(seg.trim_end_matches('\0')); - } - } - } - Ok(path_buf) - } else { - Ok(path.to_path_buf()) - } - } - } -} - -#[test] -fn metadata() { - let meta = FileMetadata { is_file: true, is_dir: true, is_symlink: true }; - assert_eq!( - format!("{meta:?}"), - "FileMetadata { is_file: true, is_dir: true, is_symlink: true }" - ); - let _ = meta; -} diff --git a/src/lib.rs b/src/lib.rs deleted file mode 100644 index 70c36b1c..00000000 --- a/src/lib.rs +++ /dev/null @@ -1,1678 +0,0 @@ -//! # Oxc Resolver -//! -//! Node.js [CommonJS][cjs] and [ECMAScript][esm] Module Resolution. -//! -//! Released on [crates.io](https://crates.io/crates/oxc_resolver) and [npm](https://www.npmjs.com/package/oxc-resolver). -//! -//! A module resolution is the process of finding the file referenced by a module specifier in -//! `import "specifier"` or `require("specifier")`. -//! -//! All [configuration options](ResolveOptions) are aligned with webpack's [enhanced-resolve]. -//! -//! ## Terminology -//! -//! ### Specifier -//! -//! For [CommonJS modules][cjs], -//! the specifier is the string passed to the `require` function. e.g. `"id"` in `require("id")`. -//! -//! For [ECMAScript modules][esm], -//! the specifier of an `import` statement is the string after the `from` keyword, -//! e.g. `'specifier'` in `import 'specifier'` or `import { sep } from 'specifier'`. -//! Specifiers are also used in export from statements, and as the argument to an `import()` expression. -//! -//! This is also named "request" in some places. -//! -//! ## References: -//! -//! * Algorithm adapted from Node.js [CommonJS Module Resolution Algorithm] and [ECMAScript Module Resolution Algorithm]. -//! * Tests are ported from [enhanced-resolve]. -//! * Some code is adapted from [parcel-resolver]. -//! * The documentation is copied from [webpack's resolve configuration](https://webpack.js.org/configuration/resolve). -//! -//! [enhanced-resolve]: https://github.com/webpack/enhanced-resolve -//! [CommonJS Module Resolution Algorithm]: https://nodejs.org/api/modules.html#all-together -//! [ECMAScript Module Resolution Algorithm]: https://nodejs.org/api/esm.html#resolution-algorithm-specification -//! [parcel-resolver]: https://github.com/parcel-bundler/parcel/blob/v2/packages/utils/node-resolver-rs -//! [cjs]: https://nodejs.org/api/modules.html -//! [esm]: https://nodejs.org/api/esm.html -//! -//! ## Feature flags -#![cfg_attr(feature = "document-features", doc = document_features::document_features!())] -#![cfg_attr(docsrs, feature(doc_auto_cfg))] -//! -//! ## Example -//! -//! ```rust,ignore -#![doc = include_str!("../examples/resolver.rs")] -//! ``` - -mod builtins; -mod cache; -mod context; -mod error; -mod file_system; -mod options; -mod package_json; -mod path; -mod resolution; -mod specifier; -mod tsconfig; - -#[cfg(test)] -mod tests; - -use std::{ - borrow::Cow, - cmp::Ordering, - ffi::OsStr, - fmt, - path::{Component, Path, PathBuf}, - sync::Arc, -}; - -use rustc_hash::FxHashSet; -use serde_json::Value as JSONValue; - -pub use crate::{ - builtins::NODEJS_BUILTINS, - error::{JSONError, ResolveError, SpecifierError}, - file_system::{FileMetadata, FileSystem}, - options::{ - Alias, AliasValue, EnforceExtension, ResolveOptions, Restriction, TsconfigOptions, - TsconfigReferences, - }, - package_json::PackageJson, - resolution::Resolution, -}; -use crate::{ - cache::{Cache, CachedPath}, - context::ResolveContext as Ctx, - file_system::FileSystemOs, - package_json::JSONMap, - path::{PathUtil, SLASH_START}, - specifier::Specifier, - tsconfig::ExtendsField, - tsconfig::{ProjectReference, TsConfig}, -}; - -type ResolveResult = Result, ResolveError>; - -/// Context returned from the [Resolver::resolve_with_context] API -#[derive(Debug, Default, Clone)] -pub struct ResolveContext { - /// Files that was found on file system - pub file_dependencies: FxHashSet, - - /// Dependencies that was not found on file system - pub missing_dependencies: FxHashSet, -} - -/// Resolver with the current operating system as the file system -pub type Resolver = ResolverGeneric; - -/// Generic implementation of the resolver, can be configured by the [FileSystem] trait -pub struct ResolverGeneric { - options: ResolveOptions, - cache: Arc>, -} - -impl fmt::Debug for ResolverGeneric { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - self.options.fmt(f) - } -} - -impl Default for ResolverGeneric { - fn default() -> Self { - Self::new(ResolveOptions::default()) - } -} - -impl ResolverGeneric { - pub fn new(options: ResolveOptions) -> Self { - Self { options: options.sanitize(), cache: Arc::new(Cache::new(Fs::default())) } - } -} - -impl ResolverGeneric { - pub fn new_with_file_system(file_system: Fs, options: ResolveOptions) -> Self { - Self { cache: Arc::new(Cache::new(file_system)), options: options.sanitize() } - } - - /// Clone the resolver using the same underlying cache. - #[must_use] - pub fn clone_with_options(&self, options: ResolveOptions) -> Self { - Self { options: options.sanitize(), cache: Arc::clone(&self.cache) } - } - - /// Returns the options. - pub fn options(&self) -> &ResolveOptions { - &self.options - } - - /// Clear the underlying cache. - pub fn clear_cache(&self) { - self.cache.clear(); - } - - /// Resolve `specifier` at an absolute `path`. - /// - /// A specifier is the string passed to require or import, i.e. `require("specifier")` or `import "specifier"`. - /// - /// `path` must be an **absolute** path to a directory where the specifier is resolved against. - /// For CommonJS modules, it is the `__dirname` variable that contains the absolute path to the folder containing current module. - /// For ECMAScript modules, it is the value of `import.meta.url`. - /// - /// # Errors - /// - /// * See [ResolveError] - pub fn resolve>( - &self, - path: P, - specifier: &str, - ) -> Result { - let mut ctx = Ctx::default(); - self.resolve_tracing(path.as_ref(), specifier, &mut ctx) - } - - /// Resolve `specifier` at absolute `path` with [ResolveContext] - /// - /// # Errors - /// - /// * See [ResolveError] - pub fn resolve_with_context>( - &self, - path: P, - specifier: &str, - resolve_context: &mut ResolveContext, - ) -> Result { - let mut ctx = Ctx::default(); - ctx.init_file_dependencies(); - let result = self.resolve_tracing(path.as_ref(), specifier, &mut ctx); - if let Some(deps) = &mut ctx.file_dependencies { - resolve_context.file_dependencies.extend(deps.drain(..)); - } - if let Some(deps) = &mut ctx.missing_dependencies { - resolve_context.missing_dependencies.extend(deps.drain(..)); - } - result - } - - /// Wrap `resolve_impl` with `tracing` information - fn resolve_tracing( - &self, - path: &Path, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - let span = tracing::debug_span!("resolve", path = ?path, specifier = specifier); - let _enter = span.enter(); - let r = self.resolve_impl(path, specifier, ctx); - match &r { - Ok(r) => { - tracing::debug!(options = ?self.options, path = ?path, specifier = specifier, ret = ?r.path); - } - Err(err) => { - tracing::debug!(options = ?self.options, path = ?path, specifier = specifier, err = ?err); - } - }; - r - } - - fn resolve_impl( - &self, - path: &Path, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - ctx.with_fully_specified(self.options.fully_specified); - let cached_path = self.cache.value(path); - let cached_path = self.require(&cached_path, specifier, ctx)?; - let path = self.load_realpath(&cached_path)?; - // enhanced-resolve: restrictions - self.check_restrictions(&path)?; - let package_json = cached_path.find_package_json(&self.cache.fs, &self.options, ctx)?; - if let Some(package_json) = &package_json { - // path must be inside the package. - debug_assert!(path.starts_with(package_json.directory())); - } - Ok(Resolution { - path, - query: ctx.query.take(), - fragment: ctx.fragment.take(), - package_json, - }) - } - - /// require(X) from module at path Y - /// - /// X: specifier - /// Y: path - /// - /// - fn require( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - ctx.test_for_infinite_recursion()?; - - // enhanced-resolve: parse - let (parsed, try_fragment_as_path) = self.load_parse(cached_path, specifier, ctx)?; - if let Some(path) = try_fragment_as_path { - return Ok(path); - } - - self.require_without_parse(cached_path, parsed.path(), ctx) - } - - fn require_without_parse( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - // tsconfig-paths - if let Some(path) = self.load_tsconfig_paths(cached_path, specifier, &mut Ctx::default())? { - return Ok(path); - } - - // enhanced-resolve: try alias - if let Some(path) = self.load_alias(cached_path, specifier, &self.options.alias, ctx)? { - return Ok(path); - } - - let result = match Path::new(specifier).components().next() { - // 2. If X begins with '/' - Some(Component::RootDir | Component::Prefix(_)) => { - self.require_absolute(cached_path, specifier, ctx) - } - // 3. If X begins with './' or '/' or '../' - Some(Component::CurDir | Component::ParentDir) => { - self.require_relative(cached_path, specifier, ctx) - } - // 4. If X begins with '#' - Some(Component::Normal(_)) if specifier.as_bytes()[0] == b'#' => { - self.require_hash(cached_path, specifier, ctx) - } - _ => { - // 1. If X is a core module, - // a. return the core module - // b. STOP - self.require_core(specifier)?; - - // (ESM) 5. Otherwise, - // Note: specifier is now a bare specifier. - // Set resolved the result of PACKAGE_RESOLVE(specifier, parentURL). - self.require_bare(cached_path, specifier, ctx) - } - }; - - result.or_else(|err| { - if err.is_ignore() { - return Err(err); - } - // enhanced-resolve: try fallback - self.load_alias(cached_path, specifier, &self.options.fallback, ctx) - .and_then(|value| value.ok_or(err)) - }) - } - - // PACKAGE_RESOLVE(packageSpecifier, parentURL) - // 3. If packageSpecifier is a Node.js builtin module name, then - // 1. Return the string "node:" concatenated with packageSpecifier. - fn require_core(&self, specifier: &str) -> Result<(), ResolveError> { - if self.options.builtin_modules { - let starts_with_node = specifier.starts_with("node:"); - if starts_with_node || NODEJS_BUILTINS.binary_search(&specifier).is_ok() { - let mut specifier = specifier.to_string(); - if !starts_with_node { - specifier = format!("node:{specifier}"); - } - return Err(ResolveError::Builtin(specifier)); - } - } - Ok(()) - } - - fn require_absolute( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - // Make sure only path prefixes gets called - debug_assert!(Path::new(specifier) - .components() - .next() - .is_some_and(|c| matches!(c, Component::RootDir | Component::Prefix(_)))); - if !self.options.prefer_relative && self.options.prefer_absolute { - if let Ok(path) = self.load_package_self_or_node_modules(cached_path, specifier, ctx) { - return Ok(path); - } - } - if let Some(path) = self.load_roots(specifier, ctx) { - return Ok(path); - } - // 2. If X begins with '/' - // a. set Y to be the file system root - let path = self.cache.value(Path::new(specifier)); - if let Some(path) = self.load_as_file_or_directory(&path, specifier, ctx)? { - return Ok(path); - } - Err(ResolveError::NotFound(specifier.to_string())) - } - - // 3. If X begins with './' or '/' or '../' - fn require_relative( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - // Make sure only relative or normal paths gets called - debug_assert!(Path::new(specifier).components().next().is_some_and(|c| matches!( - c, - Component::CurDir | Component::ParentDir | Component::Normal(_) - ))); - let path = cached_path.path().normalize_with(specifier); - let cached_path = self.cache.value(&path); - // a. LOAD_AS_FILE(Y + X) - // b. LOAD_AS_DIRECTORY(Y + X) - if let Some(path) = self.load_as_file_or_directory(&cached_path, specifier, ctx)? { - return Ok(path); - } - // c. THROW "not found" - Err(ResolveError::NotFound(specifier.to_string())) - } - - fn require_hash( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - debug_assert_eq!(specifier.chars().next(), Some('#')); - // a. LOAD_PACKAGE_IMPORTS(X, dirname(Y)) - if let Some(path) = self.load_package_imports(cached_path, specifier, ctx)? { - return Ok(path); - } - self.load_package_self_or_node_modules(cached_path, specifier, ctx) - } - - fn require_bare( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - // Make sure no other path prefixes gets called - debug_assert!(Path::new(specifier) - .components() - .next() - .is_some_and(|c| matches!(c, Component::Normal(_)))); - if self.options.prefer_relative { - if let Ok(path) = self.require_relative(cached_path, specifier, ctx) { - return Ok(path); - } - } - self.load_package_self_or_node_modules(cached_path, specifier, ctx) - } - - /// enhanced-resolve: ParsePlugin. - /// - /// 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`. - /// - /// - fn load_parse<'s>( - &self, - cached_path: &CachedPath, - specifier: &'s str, - ctx: &mut Ctx, - ) -> Result<(Specifier<'s>, Option), ResolveError> { - let parsed = Specifier::parse(specifier).map_err(ResolveError::Specifier)?; - ctx.with_query_fragment(parsed.query, parsed.fragment); - - // There is an edge-case where a request with # can be a path or a fragment -> try both - if ctx.fragment.is_some() && ctx.query.is_none() { - let specifier = parsed.path(); - let fragment = ctx.fragment.take().unwrap(); - let path = format!("{specifier}{fragment}"); - if let Ok(path) = self.require_without_parse(cached_path, &path, ctx) { - return Ok((parsed, Some(path))); - } - ctx.fragment.replace(fragment); - } - Ok((parsed, None)) - } - - fn load_package_self_or_node_modules( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - let (_, subpath) = Self::parse_package_specifier(specifier); - if subpath.is_empty() { - ctx.with_fully_specified(false); - } - // 5. LOAD_PACKAGE_SELF(X, dirname(Y)) - if let Some(path) = self.load_package_self(cached_path, specifier, ctx)? { - return Ok(path); - } - // 6. LOAD_NODE_MODULES(X, dirname(Y)) - if let Some(path) = self.load_node_modules(cached_path, specifier, ctx)? { - return Ok(path); - } - // 7. THROW "not found" - Err(ResolveError::NotFound(specifier.to_string())) - } - - /// LOAD_PACKAGE_IMPORTS(X, DIR) - fn load_package_imports( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - // 1. Find the closest package scope SCOPE to DIR. - // 2. If no scope was found, return. - let Some(package_json) = - cached_path.find_package_json(&self.cache.fs, &self.options, ctx)? - else { - return Ok(None); - }; - // 3. If the SCOPE/package.json "imports" is null or undefined, return. - // 4. let MATCH = PACKAGE_IMPORTS_RESOLVE(X, pathToFileURL(SCOPE), ["node", "require"]) defined in the ESM resolver. - if let Some(path) = self.package_imports_resolve(specifier, &package_json, ctx)? { - // 5. RESOLVE_ESM_MATCH(MATCH). - return self.resolve_esm_match(specifier, &path, ctx); - } - Ok(None) - } - - fn load_as_file(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - // enhanced-resolve feature: extension_alias - if let Some(path) = self.load_extension_alias(cached_path, ctx)? { - return Ok(Some(path)); - } - if self.options.enforce_extension.is_disabled() { - // 1. If X is a file, load X as its file extension format. STOP - if let Some(path) = self.load_alias_or_file(cached_path, ctx)? { - return Ok(Some(path)); - } - } - // 2. If X.js is a file, load X.js as JavaScript text. STOP - // 3. If X.json is a file, parse X.json to a JavaScript Object. STOP - // 4. If X.node is a file, load X.node as binary addon. STOP - if let Some(path) = - self.load_extensions(cached_path.path(), &self.options.extensions, ctx)? - { - return Ok(Some(path)); - } - Ok(None) - } - - fn load_as_directory(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - // TODO: Only package.json is supported, so warn about having other values - // Checking for empty files is needed for omitting checks on package.json - // 1. If X/package.json is a file, - if !self.options.description_files.is_empty() { - // a. Parse X/package.json, and look for "main" field. - if let Some(package_json) = - cached_path.package_json(&self.cache.fs, &self.options, ctx)? - { - // b. If "main" is a falsy value, GOTO 2. - for main_field in package_json.main_fields(&self.options.main_fields) { - // c. let M = X + (json main field) - let main_field_path = cached_path.path().normalize_with(main_field); - // d. LOAD_AS_FILE(M) - let cached_path = self.cache.value(&main_field_path); - if let Some(path) = self.load_as_file(&cached_path, ctx)? { - return Ok(Some(path)); - } - // e. LOAD_INDEX(M) - if let Some(path) = self.load_index(&cached_path, ctx)? { - return Ok(Some(path)); - } - } - // f. LOAD_INDEX(X) DEPRECATED - // g. THROW "not found" - } - } - // 2. LOAD_INDEX(X) - self.load_index(cached_path, ctx) - } - - fn load_as_file_or_directory( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - if self.options.resolve_to_context { - return Ok(cached_path.is_dir(&self.cache.fs, ctx).then(|| cached_path.clone())); - } - if !specifier.ends_with('/') { - if let Some(path) = self.load_as_file(cached_path, ctx)? { - return Ok(Some(path)); - } - } - if cached_path.is_dir(&self.cache.fs, ctx) { - if let Some(path) = self.load_as_directory(cached_path, ctx)? { - return Ok(Some(path)); - } - } - Ok(None) - } - - fn load_extensions(&self, path: &Path, extensions: &[String], ctx: &mut Ctx) -> ResolveResult { - if ctx.fully_specified { - return Ok(None); - } - let path = path.as_os_str(); - for extension in extensions { - let mut path_with_extension = path.to_os_string(); - path_with_extension.reserve_exact(extension.len()); - path_with_extension.push(extension); - let cached_path = self.cache.value(Path::new(&path_with_extension)); - if let Some(path) = self.load_alias_or_file(&cached_path, ctx)? { - return Ok(Some(path)); - } - } - Ok(None) - } - - fn load_realpath(&self, cached_path: &CachedPath) -> Result { - if self.options.symlinks { - cached_path.realpath(&self.cache.fs).map_err(ResolveError::from) - } else { - Ok(cached_path.to_path_buf()) - } - } - - fn check_restrictions(&self, path: &Path) -> Result<(), ResolveError> { - // https://github.com/webpack/enhanced-resolve/blob/a998c7d218b7a9ec2461fc4fddd1ad5dd7687485/lib/RestrictionsPlugin.js#L19-L24 - fn is_inside(path: &Path, parent: &Path) -> bool { - if !path.starts_with(parent) { - return false; - } - if path.as_os_str().len() == parent.as_os_str().len() { - return true; - } - path.strip_prefix(parent).is_ok_and(|p| p == Path::new("./")) - } - for restriction in &self.options.restrictions { - match restriction { - Restriction::Path(restricted_path) => { - if !is_inside(path, restricted_path) { - return Err(ResolveError::Restriction( - path.to_path_buf(), - restricted_path.clone(), - )); - } - } - Restriction::RegExp(_) => { - return Err(ResolveError::Unimplemented("Restriction with regex")) - } - } - } - Ok(()) - } - - fn load_index(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - for main_file in &self.options.main_files { - let main_path = cached_path.path().normalize_with(main_file); - let cached_path = self.cache.value(&main_path); - if self.options.enforce_extension.is_disabled() { - if let Some(path) = self.load_alias_or_file(&cached_path, ctx)? { - return Ok(Some(path)); - } - } - // 1. If X/index.js is a file, load X/index.js as JavaScript text. STOP - // 2. If X/index.json is a file, parse X/index.json to a JavaScript object. STOP - // 3. If X/index.node is a file, load X/index.node as binary addon. STOP - if let Some(path) = - self.load_extensions(cached_path.path(), &self.options.extensions, ctx)? - { - return Ok(Some(path)); - } - } - Ok(None) - } - - fn load_alias_or_file(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - if !self.options.alias_fields.is_empty() { - if let Some(package_json) = - cached_path.find_package_json(&self.cache.fs, &self.options, ctx)? - { - if let Some(path) = - self.load_browser_field(cached_path, None, &package_json, ctx)? - { - return Ok(Some(path)); - } - } - } - // enhanced-resolve: try file as alias - let alias_specifier = cached_path.path().to_string_lossy(); - if let Some(path) = - self.load_alias(cached_path, &alias_specifier, &self.options.alias, ctx)? - { - return Ok(Some(path)); - } - if cached_path.is_file(&self.cache.fs, ctx) { - return Ok(Some(cached_path.clone())); - } - Ok(None) - } - - fn load_node_modules( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - let (package_name, subpath) = Self::parse_package_specifier(specifier); - // 1. let DIRS = NODE_MODULES_PATHS(START) - // 2. for each DIR in DIRS: - for module_name in &self.options.modules { - for cached_path in std::iter::successors(Some(cached_path), |p| p.parent()) { - // Skip if /path/to/node_modules does not exist - if !cached_path.is_dir(&self.cache.fs, ctx) { - continue; - } - - let Some(cached_path) = self.get_module_directory(cached_path, module_name, ctx) - else { - continue; - }; - // Optimize node_modules lookup by inspecting whether the package exists - // From LOAD_PACKAGE_EXPORTS(X, DIR) - // 1. Try to interpret X as a combination of NAME and SUBPATH where the name - // may have a @scope/ prefix and the subpath begins with a slash (`/`). - if !package_name.is_empty() { - let package_path = cached_path.path().normalize_with(package_name); - let cached_path = self.cache.value(&package_path); - // Try foo/node_modules/package_name - if cached_path.is_dir(&self.cache.fs, ctx) { - // a. LOAD_PACKAGE_EXPORTS(X, DIR) - if let Some(path) = - self.load_package_exports(specifier, subpath, &cached_path, ctx)? - { - return Ok(Some(path)); - } - } else { - // foo/node_modules/package_name is not a directory, so useless to check inside it - if !subpath.is_empty() { - continue; - } - // Skip if the directory lead to the scope package does not exist - // i.e. `foo/node_modules/@scope` is not a directory for `foo/node_modules/@scope/package` - if package_name.starts_with('@') { - if let Some(path) = cached_path.parent() { - if !path.is_dir(&self.cache.fs, ctx) { - continue; - } - } - } - } - } - - // Try as file or directory for all other cases - // b. LOAD_AS_FILE(DIR/X) - // c. LOAD_AS_DIRECTORY(DIR/X) - let node_module_file = cached_path.path().normalize_with(specifier); - let cached_path = self.cache.value(&node_module_file); - if let Some(path) = self.load_as_file_or_directory(&cached_path, specifier, ctx)? { - return Ok(Some(path)); - } - } - } - Ok(None) - } - - fn get_module_directory( - &self, - cached_path: &CachedPath, - module_name: &str, - ctx: &mut Ctx, - ) -> Option { - if module_name == "node_modules" { - cached_path.cached_node_modules(&self.cache, ctx) - } else if cached_path.path().components().next_back() - == Some(Component::Normal(OsStr::new(module_name))) - { - Some(cached_path.clone()) - } else { - cached_path.module_directory(module_name, &self.cache, ctx) - } - } - - fn load_package_exports( - &self, - specifier: &str, - subpath: &str, - cached_path: &CachedPath, - ctx: &mut Ctx, - ) -> ResolveResult { - // 2. If X does not match this pattern or DIR/NAME/package.json is not a file, - // return. - let Some(package_json) = cached_path.package_json(&self.cache.fs, &self.options, ctx)? - else { - return Ok(None); - }; - // 3. Parse DIR/NAME/package.json, and look for "exports" field. - // 4. If "exports" is null or undefined, return. - // 5. let MATCH = PACKAGE_EXPORTS_RESOLVE(pathToFileURL(DIR/NAME), "." + SUBPATH, - // `package.json` "exports", ["node", "require"]) defined in the ESM resolver. - // Note: The subpath is not prepended with a dot on purpose - for exports in package_json.exports_fields(&self.options.exports_fields) { - if let Some(path) = self.package_exports_resolve( - cached_path.path(), - &format!(".{subpath}"), - exports, - ctx, - )? { - // 6. RESOLVE_ESM_MATCH(MATCH) - return self.resolve_esm_match(specifier, &path, ctx); - }; - } - Ok(None) - } - - fn load_package_self( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - // 1. Find the closest package scope SCOPE to DIR. - // 2. If no scope was found, return. - let Some(package_json) = - cached_path.find_package_json(&self.cache.fs, &self.options, ctx)? - else { - return Ok(None); - }; - // 3. If the SCOPE/package.json "exports" is null or undefined, return. - // 4. If the SCOPE/package.json "name" is not the first segment of X, return. - if let Some(subpath) = package_json - .name - .as_ref() - .and_then(|package_name| Self::strip_package_name(specifier, package_name)) - { - // 5. let MATCH = PACKAGE_EXPORTS_RESOLVE(pathToFileURL(SCOPE), - // "." + X.slice("name".length), `package.json` "exports", ["node", "require"]) - // defined in the ESM resolver. - let package_url = package_json.directory(); - // Note: The subpath is not prepended with a dot on purpose - // because `package_exports_resolve` matches subpath without the leading dot. - for exports in package_json.exports_fields(&self.options.exports_fields) { - if let Some(cached_path) = - self.package_exports_resolve(package_url, &format!(".{subpath}"), exports, ctx)? - { - // 6. RESOLVE_ESM_MATCH(MATCH) - return self.resolve_esm_match(specifier, &cached_path, ctx); - } - } - } - self.load_browser_field(cached_path, Some(specifier), &package_json, ctx) - } - - /// RESOLVE_ESM_MATCH(MATCH) - fn resolve_esm_match( - &self, - specifier: &str, - cached_path: &CachedPath, - ctx: &mut Ctx, - ) -> ResolveResult { - // 1. let RESOLVED_PATH = fileURLToPath(MATCH) - // 2. If the file at RESOLVED_PATH exists, load RESOLVED_PATH as its extension format. STOP - // - // Non-compliant ESM can result in a directory, so directory is tried as well. - if let Some(path) = self.load_as_file_or_directory(cached_path, "", ctx)? { - return Ok(Some(path)); - } - // 3. THROW "not found" - Err(ResolveError::NotFound(specifier.to_string())) - } - - /// enhanced-resolve: AliasFieldPlugin for [ResolveOptions::alias_fields] - fn load_browser_field( - &self, - cached_path: &CachedPath, - module_specifier: Option<&str>, - package_json: &PackageJson, - ctx: &mut Ctx, - ) -> ResolveResult { - let path = cached_path.path(); - let Some(new_specifier) = package_json.resolve_browser_field( - path, - module_specifier, - &self.options.alias_fields, - )? - else { - return Ok(None); - }; - // Abort when resolving recursive module - if module_specifier.is_some_and(|s| s == new_specifier) { - return Ok(None); - } - if ctx.resolving_alias.as_ref().is_some_and(|s| s == new_specifier) { - // Complete when resolving to self `{"./a.js": "./a.js"}` - if new_specifier.strip_prefix("./").filter(|s| path.ends_with(Path::new(s))).is_some() { - return if cached_path.is_file(&self.cache.fs, ctx) { - Ok(Some(cached_path.clone())) - } else { - Err(ResolveError::NotFound(new_specifier.to_string())) - }; - } - return Err(ResolveError::Recursion); - } - ctx.with_resolving_alias(new_specifier.to_string()); - ctx.with_fully_specified(false); - let cached_path = self.cache.value(package_json.directory()); - self.require(&cached_path, new_specifier, ctx).map(Some) - } - - /// enhanced-resolve: AliasPlugin for [ResolveOptions::alias] and [ResolveOptions::fallback]. - fn load_alias( - &self, - cached_path: &CachedPath, - specifier: &str, - aliases: &Alias, - ctx: &mut Ctx, - ) -> ResolveResult { - for (alias_key_raw, specifiers) in aliases { - let alias_key = if let Some(alias_key) = alias_key_raw.strip_suffix('$') { - if alias_key != specifier { - continue; - } - alias_key - } else { - let strip_package_name = Self::strip_package_name(specifier, alias_key_raw); - if strip_package_name.is_none() { - continue; - } - alias_key_raw - }; - // It should stop resolving when all of the tried alias values - // failed to resolve. - // - let mut should_stop = false; - for r in specifiers { - match r { - AliasValue::Path(alias_value) => { - if let Some(path) = self.load_alias_value( - cached_path, - alias_key, - alias_value, - specifier, - ctx, - &mut should_stop, - )? { - return Ok(Some(path)); - } - } - AliasValue::Ignore => { - let path = cached_path.path().normalize_with(alias_key); - return Err(ResolveError::Ignored(path)); - } - } - } - if should_stop { - return Err(ResolveError::NotFound(specifier.to_string())); - } - } - Ok(None) - } - - fn load_alias_value( - &self, - cached_path: &CachedPath, - alias_key: &str, - alias_value: &str, - request: &str, - ctx: &mut Ctx, - should_stop: &mut bool, - ) -> ResolveResult { - if request != alias_value - && !request.strip_prefix(alias_value).is_some_and(|prefix| prefix.starts_with('/')) - { - let tail = &request[alias_key.len()..]; - - let new_specifier = if tail.is_empty() { - Cow::Borrowed(alias_value) - } else { - let alias_value = Path::new(alias_value).normalize(); - // Must not append anything to alias_value if it is a file. - let alias_value_cached_path = self.cache.value(&alias_value); - if alias_value_cached_path.is_file(&self.cache.fs, ctx) { - return Ok(None); - } - - // Remove the leading slash so the final path is concatenated. - let tail = tail.trim_start_matches(SLASH_START); - let normalized = alias_value.normalize_with(tail); - Cow::Owned(normalized.to_string_lossy().to_string()) - }; - - *should_stop = true; - ctx.with_fully_specified(false); - return match self.require(cached_path, new_specifier.as_ref(), ctx) { - Err(ResolveError::NotFound(_)) => Ok(None), - Ok(path) => return Ok(Some(path)), - Err(err) => return Err(err), - }; - } - Ok(None) - } - - /// Given an extension alias map `{".js": [".ts", "js"]}`, - /// load the mapping instead of the provided extension - /// - /// This is an enhanced-resolve feature - /// - /// # Errors - /// - /// * [ResolveError::ExtensionAlias]: When all of the aliased extensions are not found - fn load_extension_alias(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - let Some(path_extension) = cached_path.path().extension() else { - return Ok(None); - }; - let Some((_, extensions)) = self - .options - .extension_alias - .iter() - .find(|(ext, _)| OsStr::new(ext.trim_start_matches('.')) == path_extension) - else { - return Ok(None); - }; - let path = cached_path.path().with_extension(""); - ctx.with_fully_specified(false); - if let Some(path) = self.load_extensions(&path, extensions, ctx)? { - return Ok(Some(path)); - } - Err(ResolveError::ExtensionAlias) - } - - /// enhanced-resolve: RootsPlugin - /// - /// A list of directories where requests of server-relative URLs (starting with '/') are resolved, - /// defaults to context configuration option. - /// - /// On non-Windows systems these requests are resolved as an absolute path first. - fn load_roots(&self, specifier: &str, ctx: &mut Ctx) -> Option { - if !self.options.roots.is_empty() { - if let Some(specifier) = specifier.strip_prefix(SLASH_START) { - for root in &self.options.roots { - let cached_path = self.cache.value(root); - if let Ok(path) = self.require_relative(&cached_path, specifier, ctx) { - return Some(path); - } - } - } - } - None - } - - fn load_tsconfig_paths( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - let Some(tsconfig_options) = &self.options.tsconfig else { - return Ok(None); - }; - let tsconfig = self.load_tsconfig( - /* root */ true, - &tsconfig_options.config_file, - &tsconfig_options.references, - )?; - let paths = tsconfig.resolve(cached_path.path(), specifier); - for path in paths { - let cached_path = self.cache.value(&path); - if let Ok(path) = self.require_relative(&cached_path, ".", ctx) { - return Ok(Some(path)); - } - } - Ok(None) - } - - fn load_tsconfig( - &self, - root: bool, - path: &Path, - references: &TsconfigReferences, - ) -> Result, ResolveError> { - self.cache.tsconfig(root, path, |tsconfig| { - let directory = self.cache.value(tsconfig.directory()); - tracing::trace!(tsconfig = ?tsconfig, "load_tsconfig"); - - // Extend tsconfig - if let Some(extends) = &tsconfig.extends { - let extended_tsconfig_paths = match extends { - ExtendsField::Single(s) => { - vec![self.get_extended_tsconfig_path(&directory, tsconfig, s)?] - } - ExtendsField::Multiple(specifiers) => specifiers - .iter() - .map(|s| self.get_extended_tsconfig_path(&directory, tsconfig, s)) - .collect::, ResolveError>>()?, - }; - for extended_tsconfig_path in extended_tsconfig_paths { - let extended_tsconfig = self.load_tsconfig( - /* root */ false, - &extended_tsconfig_path, - &TsconfigReferences::Disabled, - )?; - tsconfig.extend_tsconfig(&extended_tsconfig); - } - } - - // Load project references - match references { - TsconfigReferences::Disabled => { - tsconfig.references.drain(..); - } - TsconfigReferences::Auto => {} - TsconfigReferences::Paths(paths) => { - tsconfig.references = paths - .iter() - .map(|path| ProjectReference { path: path.clone(), tsconfig: None }) - .collect(); - } - } - if !tsconfig.references.is_empty() { - let directory = tsconfig.directory().to_path_buf(); - for reference in &mut tsconfig.references { - let reference_tsconfig_path = directory.normalize_with(&reference.path); - let tsconfig = self.cache.tsconfig( - /* root */ true, - &reference_tsconfig_path, - |_| Ok(()), - )?; - reference.tsconfig.replace(tsconfig); - } - } - Ok(()) - }) - } - - fn get_extended_tsconfig_path( - &self, - directory: &CachedPath, - tsconfig: &TsConfig, - specifier: &str, - ) -> Result { - match specifier.as_bytes().first() { - None => Err(ResolveError::Specifier(SpecifierError::Empty(specifier.to_string()))), - Some(b'/') => Ok(PathBuf::from(specifier)), - Some(b'.') => Ok(tsconfig.directory().normalize_with(specifier)), - _ => self - .clone_with_options(ResolveOptions { - description_files: vec![], - extensions: vec![".json".into()], - main_files: vec!["tsconfig.json".into()], - ..ResolveOptions::default() - }) - .load_package_self_or_node_modules(directory, specifier, &mut Ctx::default()) - .map(|p| p.to_path_buf()) - .map_err(|err| match err { - ResolveError::NotFound(_) => { - ResolveError::TsconfigNotFound(PathBuf::from(specifier)) - } - _ => err, - }), - } - } - - /// PACKAGE_RESOLVE(packageSpecifier, parentURL) - fn package_resolve( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - let (package_name, subpath) = Self::parse_package_specifier(specifier); - - // 3. If packageSpecifier is a Node.js builtin module name, then - // 1. Return the string "node:" concatenated with packageSpecifier. - self.require_core(package_name)?; - - // 11. While parentURL is not the file system root, - for module_name in &self.options.modules { - for cached_path in std::iter::successors(Some(cached_path), |p| p.parent()) { - // 1. Let packageURL be the URL resolution of "node_modules/" concatenated with packageSpecifier, relative to parentURL. - let Some(cached_path) = self.get_module_directory(cached_path, module_name, ctx) - else { - continue; - }; - // 2. Set parentURL to the parent folder URL of parentURL. - let package_path = cached_path.path().normalize_with(package_name); - let cached_path = self.cache.value(&package_path); - // 3. If the folder at packageURL does not exist, then - // 1. Continue the next loop iteration. - if cached_path.is_dir(&self.cache.fs, ctx) { - // 4. Let pjson be the result of READ_PACKAGE_JSON(packageURL). - if let Some(package_json) = - cached_path.package_json(&self.cache.fs, &self.options, ctx)? - { - // 5. If pjson is not null and pjson.exports is not null or undefined, then - // 1. Return the result of PACKAGE_EXPORTS_RESOLVE(packageURL, packageSubpath, pjson.exports, defaultConditions). - for exports in package_json.exports_fields(&self.options.exports_fields) { - if let Some(path) = self.package_exports_resolve( - cached_path.path(), - &format!(".{subpath}"), - exports, - ctx, - )? { - return Ok(Some(path)); - } - } - // 6. Otherwise, if packageSubpath is equal to ".", then - if subpath == "." { - // 1. If pjson.main is a string, then - for main_field in package_json.main_fields(&self.options.main_fields) { - // 1. Return the URL resolution of main in packageURL. - let path = cached_path.path().normalize_with(main_field); - let cached_path = self.cache.value(&path); - if cached_path.is_file(&self.cache.fs, ctx) { - return Ok(Some(cached_path)); - } - } - } - } - let subpath = format!(".{subpath}"); - ctx.with_fully_specified(false); - return self.require(&cached_path, &subpath, ctx).map(Some); - } - } - } - - Err(ResolveError::NotFound(specifier.to_string())) - } - - /// PACKAGE_EXPORTS_RESOLVE(packageURL, subpath, exports, conditions) - fn package_exports_resolve( - &self, - package_url: &Path, - subpath: &str, - exports: &JSONValue, - ctx: &mut Ctx, - ) -> ResolveResult { - let conditions = &self.options.condition_names; - // 1. If exports is an Object with both a key starting with "." and a key not starting with ".", throw an Invalid Package Configuration error. - if let JSONValue::Object(map) = exports { - let mut has_dot = false; - let mut without_dot = false; - for key in map.keys() { - has_dot = has_dot || key.starts_with(|s| s == '.' || s == '#'); - without_dot = without_dot || !key.starts_with(|s| s == '.' || s == '#'); - if has_dot && without_dot { - return Err(ResolveError::InvalidPackageConfig( - package_url.join("package.json"), - )); - } - } - } - // 2. If subpath is equal to ".", then - // Note: subpath is not prepended with a dot when passed in. - if subpath == "." { - // enhanced-resolve appends query and fragment when resolving exports field - // https://github.com/webpack/enhanced-resolve/blob/a998c7d218b7a9ec2461fc4fddd1ad5dd7687485/lib/ExportsFieldPlugin.js#L57-L62 - // This is only need when querying the main export, otherwise ctx is passed through. - if ctx.query.is_some() || ctx.fragment.is_some() { - let query = ctx.query.clone().unwrap_or_default(); - let fragment = ctx.fragment.clone().unwrap_or_default(); - return Err(ResolveError::PackagePathNotExported( - format!("./{}{query}{fragment}", subpath.trim_start_matches('.')), - package_url.join("package.json"), - )); - } - // 1. Let mainExport be undefined. - let main_export = match exports { - // 2. If exports is a String or Array, or an Object containing no keys starting with ".", then - JSONValue::String(_) | JSONValue::Array(_) => { - // 1. Set mainExport to exports. - Some(exports) - } - // 3. Otherwise if exports is an Object containing a "." property, then - JSONValue::Object(map) => { - // 1. Set mainExport to exports["."]. - map.get(".").map_or_else( - || { - if map.keys().any(|key| key.starts_with("./") || key.starts_with('#')) { - None - } else { - Some(exports) - } - }, - Some, - ) - } - _ => None, - }; - // 4. If mainExport is not undefined, then - if let Some(main_export) = main_export { - // 1. Let resolved be the result of PACKAGE_TARGET_RESOLVE( packageURL, mainExport, null, false, conditions). - let resolved = self.package_target_resolve( - package_url, - ".", - main_export, - None, - /* is_imports */ false, - conditions, - ctx, - )?; - // 2. If resolved is not null or undefined, return resolved. - if let Some(path) = resolved { - return Ok(Some(path)); - } - } - } - // 3. Otherwise, if exports is an Object and all keys of exports start with ".", then - if let JSONValue::Object(exports) = exports { - // 1. Let matchKey be the string "./" concatenated with subpath. - // Note: `package_imports_exports_resolve` does not require the leading dot. - let match_key = &subpath; - // 2. Let resolved be the result of PACKAGE_IMPORTS_EXPORTS_RESOLVE( matchKey, exports, packageURL, false, conditions). - if let Some(path) = self.package_imports_exports_resolve( - match_key, - exports, - package_url, - /* is_imports */ false, - conditions, - ctx, - )? { - // 3. If resolved is not null or undefined, return resolved. - return Ok(Some(path)); - } - } - // 4. Throw a Package Path Not Exported error. - Err(ResolveError::PackagePathNotExported( - subpath.to_string(), - package_url.join("package.json"), - )) - } - - /// PACKAGE_IMPORTS_RESOLVE(specifier, parentURL, conditions) - fn package_imports_resolve( - &self, - specifier: &str, - package_json: &PackageJson, - ctx: &mut Ctx, - ) -> Result, ResolveError> { - // 1. Assert: specifier begins with "#". - debug_assert!(specifier.starts_with('#'), "{specifier}"); - // 2. If specifier is exactly equal to "#" or starts with "#/", then - // 1. Throw an Invalid Module Specifier error. - // 3. Let packageURL be the result of LOOKUP_PACKAGE_SCOPE(parentURL). - // 4. If packageURL is not null, then - - // 1. Let pjson be the result of READ_PACKAGE_JSON(packageURL). - // 2. If pjson.imports is a non-null Object, then - - // 1. Let resolved be the result of PACKAGE_IMPORTS_EXPORTS_RESOLVE( specifier, pjson.imports, packageURL, true, conditions). - let mut has_imports = false; - for imports in package_json.imports_fields(&self.options.imports_fields) { - if !has_imports { - has_imports = true; - // TODO: fill in test case for this case - if specifier == "#" || specifier.starts_with("#/") { - return Err(ResolveError::InvalidModuleSpecifier( - specifier.to_string(), - package_json.path.clone(), - )); - } - } - if let Some(path) = self.package_imports_exports_resolve( - specifier, - imports, - package_json.directory(), - /* is_imports */ true, - &self.options.condition_names, - ctx, - )? { - // 2. If resolved is not null or undefined, return resolved. - return Ok(Some(path)); - } - } - - // 5. Throw a Package Import Not Defined error. - if has_imports { - Err(ResolveError::PackageImportNotDefined( - specifier.to_string(), - package_json.path.clone(), - )) - } else { - Ok(None) - } - } - - /// PACKAGE_IMPORTS_EXPORTS_RESOLVE(matchKey, matchObj, packageURL, isImports, conditions) - fn package_imports_exports_resolve( - &self, - match_key: &str, - match_obj: &JSONMap, - package_url: &Path, - is_imports: bool, - conditions: &[String], - ctx: &mut Ctx, - ) -> ResolveResult { - // enhanced-resolve behaves differently, it throws - // Error: CachedPath to directories is not possible with the exports field (specifier was ./dist/) - if match_key.ends_with('/') { - return Ok(None); - } - // 1. If matchKey is a key of matchObj and does not contain "*", then - if !match_key.contains('*') { - // 1. Let target be the value of matchObj[matchKey]. - if let Some(target) = match_obj.get(match_key) { - // 2. Return the result of PACKAGE_TARGET_RESOLVE(packageURL, target, null, isImports, conditions). - return self.package_target_resolve( - package_url, - match_key, - target, - None, - is_imports, - conditions, - ctx, - ); - } - } - - let mut best_target = None; - let mut best_match = ""; - let mut best_key = ""; - // 2. Let expansionKeys be the list of keys of matchObj containing only a single "*", sorted by the sorting function PATTERN_KEY_COMPARE which orders in descending order of specificity. - // 3. For each key expansionKey in expansionKeys, do - for (expansion_key, target) in match_obj { - if expansion_key.starts_with("./") || expansion_key.starts_with('#') { - // 1. Let patternBase be the substring of expansionKey up to but excluding the first "*" character. - if let Some((pattern_base, pattern_trailer)) = expansion_key.split_once('*') { - // 2. If matchKey starts with but is not equal to patternBase, then - if match_key.starts_with(pattern_base) - // 1. Let patternTrailer be the substring of expansionKey from the index after the first "*" character. - && !pattern_trailer.contains('*') - // 2. If patternTrailer has zero length, or if matchKey ends with patternTrailer and the length of matchKey is greater than or equal to the length of expansionKey, then - && (pattern_trailer.is_empty() - || (match_key.len() >= expansion_key.len() - && match_key.ends_with(pattern_trailer))) - && Self::pattern_key_compare(best_key, expansion_key).is_gt() - { - // 1. Let target be the value of matchObj[expansionKey]. - best_target = Some(target); - // 2. Let patternMatch be the substring of matchKey starting at the index of the length of patternBase up to the length of matchKey minus the length of patternTrailer. - best_match = - &match_key[pattern_base.len()..match_key.len() - pattern_trailer.len()]; - best_key = expansion_key; - } - } else if expansion_key.ends_with('/') - && match_key.starts_with(expansion_key) - && Self::pattern_key_compare(best_key, expansion_key).is_gt() - { - // TODO: [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./dist/" in the "exports" field module resolution of the package at xxx/package.json. - best_target = Some(target); - best_match = &match_key[expansion_key.len()..]; - best_key = expansion_key; - } - } - } - if let Some(best_target) = best_target { - // 3. Return the result of PACKAGE_TARGET_RESOLVE(packageURL, target, patternMatch, isImports, conditions). - return self.package_target_resolve( - package_url, - best_key, - best_target, - Some(best_match), - is_imports, - conditions, - ctx, - ); - } - // 4. Return null. - Ok(None) - } - - /// PACKAGE_TARGET_RESOLVE(packageURL, target, patternMatch, isImports, conditions) - #[allow(clippy::too_many_arguments)] - fn package_target_resolve( - &self, - package_url: &Path, - target_key: &str, - target: &JSONValue, - pattern_match: Option<&str>, - is_imports: bool, - conditions: &[String], - ctx: &mut Ctx, - ) -> ResolveResult { - fn normalize_string_target<'a>( - target_key: &'a str, - target: &'a str, - pattern_match: Option<&'a str>, - package_url: &Path, - ) -> Result, ResolveError> { - let target = if let Some(pattern_match) = pattern_match { - if !target_key.contains('*') && !target.contains('*') { - // enhanced-resolve behaviour - // TODO: [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./dist/" in the "exports" field module resolution of the package at xxx/package.json. - if target_key.ends_with('/') && target.ends_with('/') { - Cow::Owned(format!("{target}{pattern_match}")) - } else { - return Err(ResolveError::InvalidPackageConfigDirectory( - package_url.join("package.json"), - )); - } - } else { - Cow::Owned(target.replace('*', pattern_match)) - } - } else { - Cow::Borrowed(target) - }; - Ok(target) - } - - match target { - // 1. If target is a String, then - JSONValue::String(target) => { - // 1. If target does not start with "./", then - if !target.starts_with("./") { - // 1. If isImports is false, or if target starts with "../" or "/", or if target is a valid URL, then - if !is_imports || target.starts_with("../") || target.starts_with('/') { - // 1. Throw an Invalid Package Target error. - return Err(ResolveError::InvalidPackageTarget( - target.to_string(), - target_key.to_string(), - package_url.join("package.json"), - )); - } - // 2. If patternMatch is a String, then - // 1. Return PACKAGE_RESOLVE(target with every instance of "*" replaced by patternMatch, packageURL + "/"). - let target = - normalize_string_target(target_key, target, pattern_match, package_url)?; - let package_url = self.cache.value(package_url); - // // 3. Return PACKAGE_RESOLVE(target, packageURL + "/"). - return self.package_resolve(&package_url, &target, ctx); - } - - // 2. If target split on "/" or "\" contains any "", ".", "..", or "node_modules" segments after the first "." segment, case insensitive and including percent encoded variants, throw an Invalid Package Target error. - // 3. Let resolvedTarget be the URL resolution of the concatenation of packageURL and target. - // 4. Assert: resolvedTarget is contained in packageURL. - // 5. If patternMatch is null, then - let target = - normalize_string_target(target_key, target, pattern_match, package_url)?; - if Path::new(target.as_ref()).is_invalid_exports_target() { - return Err(ResolveError::InvalidPackageTarget( - target.to_string(), - target_key.to_string(), - package_url.join("package.json"), - )); - } - let resolved_target = package_url.normalize_with(target.as_ref()); - // 6. If patternMatch split on "/" or "\" contains any "", ".", "..", or "node_modules" segments, case insensitive and including percent encoded variants, throw an Invalid Module Specifier error. - // 7. Return the URL resolution of resolvedTarget with every instance of "*" replaced with patternMatch. - let value = self.cache.value(&resolved_target); - return Ok(Some(value)); - } - // 2. Otherwise, if target is a non-null Object, then - JSONValue::Object(target) => { - // 1. If exports contains any index property keys, as defined in ECMA-262 6.1.7 Array Index, throw an Invalid Package Configuration error. - // 2. For each property p of target, in object insertion order as, - for (key, target_value) in target { - // 1. If p equals "default" or conditions contains an entry for p, then - if key == "default" || conditions.contains(key) { - // 1. Let targetValue be the value of the p property in target. - // 2. Let resolved be the result of PACKAGE_TARGET_RESOLVE( packageURL, targetValue, patternMatch, isImports, conditions). - let resolved = self.package_target_resolve( - package_url, - target_key, - target_value, - pattern_match, - is_imports, - conditions, - ctx, - ); - // 3. If resolved is equal to undefined, continue the loop. - if let Some(path) = resolved? { - // 4. Return resolved. - return Ok(Some(path)); - } - } - } - // 3. Return undefined. - return Ok(None); - } - // 3. Otherwise, if target is an Array, then - JSONValue::Array(targets) => { - // 1. If _target.length is zero, return null. - if targets.is_empty() { - // Note: return PackagePathNotExported has the same effect as return because there are no matches. - return Err(ResolveError::PackagePathNotExported( - pattern_match.unwrap_or(".").to_string(), - package_url.join("package.json"), - )); - } - // 2. For each item targetValue in target, do - for (i, target_value) in targets.iter().enumerate() { - // 1. Let resolved be the result of PACKAGE_TARGET_RESOLVE( packageURL, targetValue, patternMatch, isImports, conditions), continuing the loop on any Invalid Package Target error. - let resolved = self.package_target_resolve( - package_url, - target_key, - target_value, - pattern_match, - is_imports, - conditions, - ctx, - ); - - if resolved.is_err() && i == targets.len() { - return resolved; - } - - // 2. If resolved is undefined, continue the loop. - if let Ok(Some(path)) = resolved { - // 3. Return resolved. - return Ok(Some(path)); - } - } - // 3. Return or throw the last fallback resolution null return or error. - // Note: see `resolved.is_err() && i == targets.len()` - } - _ => {} - } - // 4. Otherwise, if target is null, return null. - Ok(None) - // 5. Otherwise throw an Invalid Package Target error. - } - - // Returns (module, subpath) - // https://github.com/nodejs/node/blob/8f0f17e1e3b6c4e58ce748e06343c5304062c491/lib/internal/modules/esm/resolve.js#L688 - fn parse_package_specifier(specifier: &str) -> (&str, &str) { - let mut separator_index = specifier.as_bytes().iter().position(|b| *b == b'/'); - // let mut valid_package_name = true; - // let mut is_scoped = false; - if specifier.starts_with('@') { - // is_scoped = true; - if separator_index.is_none() || specifier.is_empty() { - // valid_package_name = false; - } else if let Some(index) = &separator_index { - separator_index = specifier[*index + 1..] - .as_bytes() - .iter() - .position(|b| *b == b'/') - .map(|i| i + *index + 1); - } - } - let package_name = - separator_index.map_or(specifier, |separator_index| &specifier[..separator_index]); - - // TODO: https://github.com/nodejs/node/blob/8f0f17e1e3b6c4e58ce748e06343c5304062c491/lib/internal/modules/esm/resolve.js#L705C1-L714C1 - // Package name cannot have leading . and cannot have percent-encoding or - // \\ separators. - // if (RegExpPrototypeExec(invalidPackageNameRegEx, packageName) !== null) - // validPackageName = false; - - // if (!validPackageName) { - // throw new ERR_INVALID_MODULE_SPECIFIER( - // specifier, 'is not a valid package name', fileURLToPath(base)); - // } - let package_subpath = - separator_index.map_or("", |separator_index| &specifier[separator_index..]); - (package_name, package_subpath) - } - - /// PATTERN_KEY_COMPARE(keyA, keyB) - fn pattern_key_compare(key_a: &str, key_b: &str) -> Ordering { - if key_a.is_empty() { - return Ordering::Greater; - } - // 1. Assert: keyA ends with "/" or contains only a single "*". - debug_assert!(key_a.ends_with('/') || key_a.match_indices('*').count() == 1, "{key_a}"); - // 2. Assert: keyB ends with "/" or contains only a single "*". - debug_assert!(key_b.ends_with('/') || key_b.match_indices('*').count() == 1, "{key_b}"); - // 3. Let baseLengthA be the index of "*" in keyA plus one, if keyA contains "*", or the length of keyA otherwise. - let a_pos = key_a.chars().position(|c| c == '*'); - let base_length_a = a_pos.map_or(key_a.len(), |p| p + 1); - // 4. Let baseLengthB be the index of "*" in keyB plus one, if keyB contains "*", or the length of keyB otherwise. - let b_pos = key_b.chars().position(|c| c == '*'); - let base_length_b = b_pos.map_or(key_b.len(), |p| p + 1); - // 5. If baseLengthA is greater than baseLengthB, return -1. - if base_length_a > base_length_b { - return Ordering::Less; - } - // 6. If baseLengthB is greater than baseLengthA, return 1. - if base_length_b > base_length_a { - return Ordering::Greater; - } - // 7. If keyA does not contain "*", return 1. - if !key_a.contains('*') { - return Ordering::Greater; - } - // 8. If keyB does not contain "*", return -1. - if !key_b.contains('*') { - return Ordering::Less; - } - // 9. If the length of keyA is greater than the length of keyB, return -1. - if key_a.len() > key_b.len() { - return Ordering::Less; - } - // 10. If the length of keyB is greater than the length of keyA, return 1. - if key_b.len() > key_a.len() { - return Ordering::Greater; - } - // 11. Return 0. - Ordering::Equal - } - - fn strip_package_name<'a>(specifier: &'a str, package_name: &'a str) -> Option<&'a str> { - specifier - .strip_prefix(package_name) - .filter(|tail| tail.is_empty() || tail.starts_with(SLASH_START)) - } -} diff --git a/src/options.rs b/src/options.rs deleted file mode 100644 index f473a133..00000000 --- a/src/options.rs +++ /dev/null @@ -1,623 +0,0 @@ -use std::path::Path; -use std::{fmt, path::PathBuf}; - -/// Module Resolution Options -/// -/// Options are directly ported from [enhanced-resolve](https://github.com/webpack/enhanced-resolve#resolver-options). -/// -/// See [webpack resolve](https://webpack.js.org/configuration/resolve/) for information and examples -#[derive(Debug, Clone)] -pub struct ResolveOptions { - /// Path to TypeScript configuration file. - /// - /// Default `None` - pub tsconfig: Option, - - /// Create aliases to import or require certain modules more easily. - /// - /// An alias is used to replace a whole path or part of a path. - /// For example, to alias a commonly used `src/` folders: `vec![("@/src"), vec![AliasValue::Path("/path/to/src")]]` - /// - /// A trailing $ can also be added to the given object's keys to signify an exact match. - /// - /// See [webpack's `resolve.alias` documentation](https://webpack.js.org/configuration/resolve/#resolvealias) for a list of use cases. - pub alias: Alias, - - /// A list of alias fields in description files. - /// - /// Specify a field, such as `browser`, to be parsed according to [this specification](https://github.com/defunctzombie/package-browser-field-spec). - /// Can be a path to json object such as `["path", "to", "exports"]`. - /// - /// Default `[]` - pub alias_fields: Vec>, - - /// Condition names for exports field which defines entry points of a package. - /// - /// The key order in the exports field is significant. During condition matching, earlier entries have higher priority and take precedence over later entries. - /// - /// Default `[]` - pub condition_names: Vec, - - /// The JSON files to use for descriptions. (There was once a `bower.json`.) - /// - /// Default `["package.json"]` - pub description_files: Vec, - - /// Set to [EnforceExtension::Enabled] for [ESM Mandatory file extensions](https://nodejs.org/api/esm.html#mandatory-file-extensions). - /// - /// If `enforce_extension` is set to [EnforceExtension::Enabled], resolution will not allow extension-less files. - /// This means `require('./foo.js')` will resolve, while `require('./foo')` will not. - /// - /// The default value for `enforce_extension` is [EnforceExtension::Auto], which is changed upon initialization. - /// - /// It changes to [EnforceExtension::Enabled] if [ResolveOptions::extensions] contains an empty string; - /// otherwise, this value changes to [EnforceExtension::Disabled]. - /// - /// Explicitly set the value to [EnforceExtension::Disabled] to disable this automatic behavior. - /// - /// For reference, this behavior is aligned with `enhanced-resolve`. See . - pub enforce_extension: EnforceExtension, - - /// A list of exports fields in description files. - /// - /// Can be a path to a JSON object such as `["path", "to", "exports"]`. - /// - /// Default `[["exports"]]`. - pub exports_fields: Vec>, - - /// Fields from `package.json` which are used to provide the internal requests of a package - /// (requests starting with # are considered internal). - /// - /// Can be a path to a JSON object such as `["path", "to", "imports"]`. - /// - /// Default `[["imports"]]`. - pub imports_fields: Vec>, - - /// An object which maps extension to extension aliases. - /// - /// Default `{}` - pub extension_alias: Vec<(String, Vec)>, - - /// Attempt to resolve these extensions in order. - /// - /// If multiple files share the same name but have different extensions, - /// will resolve the one with the extension listed first in the array and skip the rest. - /// - /// All extensions must have a leading dot. - /// - /// Default `[".js", ".json", ".node"]` - pub extensions: Vec, - - /// Redirect module requests when normal resolving fails. - /// - /// Default `[]` - pub fallback: Alias, - - /// 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). - /// - /// See also webpack configuration [resolve.fullySpecified](https://webpack.js.org/configuration/module/#resolvefullyspecified) - /// - /// Default `false` - pub fully_specified: bool, - - /// A list of main fields in description files - /// - /// Default `["main"]`. - pub main_fields: Vec, - - /// The filename to be used while resolving directories. - /// - /// Default `["index"]` - pub main_files: Vec, - - /// A list of directories to resolve modules from, can be absolute path or folder name. - /// - /// Default `["node_modules"]` - pub modules: Vec, - - /// Resolve to a context instead of a file. - /// - /// Default `false` - pub resolve_to_context: bool, - - /// Prefer to resolve module requests as relative requests instead of using modules from node_modules directories. - /// - /// Default `false` - pub prefer_relative: bool, - - /// Prefer to resolve server-relative urls as absolute paths before falling back to resolve in ResolveOptions::roots. - /// - /// Default `false` - pub prefer_absolute: bool, - - /// A list of resolve restrictions to restrict the paths that a request can be resolved on. - /// - /// Default `[]` - pub restrictions: Vec, - - /// A list of directories where requests of server-relative URLs (starting with '/') are resolved. - /// On non-Windows systems these requests are resolved as an absolute path first. - /// - /// Default `[]` - pub roots: Vec, - - /// Whether to resolve symlinks to their symlinked location. - /// When enabled, symlinked resources are resolved to their real path, not their symlinked location. - /// Note that this may cause module resolution to fail when using tools that symlink packages (like npm link). - /// - /// Default `true` - pub symlinks: bool, - - /// Whether to parse [module.builtinModules](https://nodejs.org/api/module.html#modulebuiltinmodules) or not. - /// For example, "zlib" will throw [crate::ResolveError::Builtin] when set to true. - /// - /// Default `false` - pub builtin_modules: bool, -} - -impl ResolveOptions { - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// - /// let options = ResolveOptions::default().with_condition_names(&["bar"]); - /// assert_eq!(options.condition_names, vec!["bar".to_string()]) - /// ``` - #[must_use] - pub fn with_condition_names(mut self, names: &[&str]) -> Self { - self.condition_names = names.iter().map(ToString::to_string).collect::>(); - self - } - - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// - /// let options = ResolveOptions::default().with_builtin_modules(false); - /// assert_eq!(options.builtin_modules, false) - /// ``` - #[must_use] - pub fn with_builtin_modules(mut self, flag: bool) -> Self { - self.builtin_modules = flag; - self - } - - /// Adds a single root to the options - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_root("foo"); - /// assert_eq!(options.roots, vec![PathBuf::from("foo")]) - /// ``` - #[must_use] - pub fn with_root>(mut self, root: P) -> Self { - self.roots.push(root.as_ref().to_path_buf()); - self - } - - /// Adds a single extension to the list of extensions - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_extension("jsonc"); - /// assert!(options.extensions.contains(&"jsonc".to_string())); - /// ``` - #[must_use] - pub fn with_extension>(mut self, extension: S) -> Self { - self.extensions.push(extension.into()); - self - } - - /// Adds a single main field to the list of fields - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_main_field("something"); - /// assert!(options.main_fields.contains(&"something".to_string())); - /// ``` - #[must_use] - pub fn with_main_field>(mut self, field: S) -> Self { - self.main_fields.push(field.into()); - self - } - - /// Changes how the extension should be treated - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions, EnforceExtension}; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_force_extension(EnforceExtension::Enabled); - /// assert_eq!(options.enforce_extension, EnforceExtension::Enabled); - /// ``` - #[must_use] - pub fn with_force_extension(mut self, enforce_extension: EnforceExtension) -> Self { - self.enforce_extension = enforce_extension; - self - } - - /// Sets the value for [ResolveOptions::fully_specified] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_fully_specified(true); - /// assert_eq!(options.fully_specified, true); - /// ``` - #[must_use] - pub fn with_fully_specified(mut self, fully_specified: bool) -> Self { - self.fully_specified = fully_specified; - self - } - /// Sets the value for [ResolveOptions::prefer_relative] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_prefer_relative(true); - /// assert_eq!(options.prefer_relative, true); - /// ``` - #[must_use] - pub fn with_prefer_relative(mut self, flag: bool) -> Self { - self.prefer_relative = flag; - self - } - /// Sets the value for [ResolveOptions::prefer_absolute] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_prefer_absolute(true); - /// assert_eq!(options.prefer_absolute, true); - /// ``` - #[must_use] - pub fn with_prefer_absolute(mut self, flag: bool) -> Self { - self.prefer_absolute = flag; - self - } - - /// Changes the value of [ResolveOptions::symlinks] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// - /// let options = ResolveOptions::default().with_symbolic_link(false); - /// assert_eq!(options.symlinks, false); - /// ``` - #[must_use] - pub fn with_symbolic_link(mut self, flag: bool) -> Self { - self.symlinks = flag; - self - } - - /// Adds a module to [ResolveOptions::modules] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// - /// let options = ResolveOptions::default().with_module("module"); - /// assert!(options.modules.contains(&"module".to_string())); - /// ``` - #[must_use] - pub fn with_module>(mut self, module: M) -> Self { - self.modules.push(module.into()); - self - } - - /// Adds a main file to [ResolveOptions::main_files] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// - /// let options = ResolveOptions::default().with_main_file("foo"); - /// assert!(options.main_files.contains(&"foo".to_string())); - /// ``` - #[must_use] - pub fn with_main_file>(mut self, module: M) -> Self { - self.main_files.push(module.into()); - self - } - - pub(crate) fn sanitize(mut self) -> Self { - debug_assert!( - self.extensions.iter().filter(|e| !e.is_empty()).all(|e| e.starts_with('.')), - "All extensions must start with a leading dot" - ); - // Set `enforceExtension` to `true` when [ResolveOptions::extensions] contains an empty string. - // See - if self.enforce_extension == EnforceExtension::Auto { - if !self.extensions.is_empty() && self.extensions.iter().any(String::is_empty) { - self.enforce_extension = EnforceExtension::Enabled; - } else { - self.enforce_extension = EnforceExtension::Disabled; - } - } - self - } -} - -/// Value for [ResolveOptions::enforce_extension] -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -pub enum EnforceExtension { - Auto, - Enabled, - Disabled, -} - -impl EnforceExtension { - pub const fn is_auto(&self) -> bool { - matches!(self, Self::Auto) - } - - pub const fn is_enabled(&self) -> bool { - matches!(self, Self::Enabled) - } - - pub const fn is_disabled(&self) -> bool { - matches!(self, Self::Disabled) - } -} - -/// Alias for [ResolveOptions::alias] and [ResolveOptions::fallback] -pub type Alias = Vec<(String, Vec)>; - -/// Alias Value for [ResolveOptions::alias] and [ResolveOptions::fallback] -#[derive(Debug, Clone, Hash, PartialEq, Eq)] -pub enum AliasValue { - /// The path value - Path(String), - - /// The `false` value - Ignore, -} - -impl From for AliasValue -where - S: Into, -{ - fn from(value: S) -> Self { - Self::Path(value.into()) - } -} - -/// Value for [ResolveOptions::restrictions] -#[derive(Debug, Clone)] -pub enum Restriction { - Path(PathBuf), - RegExp(String), -} - -/// Tsconfig Options for [ResolveOptions::tsconfig] -/// -/// Derived from [tsconfig-paths-webpack-plugin](https://github.com/dividab/tsconfig-paths-webpack-plugin#options) -#[derive(Debug, Clone)] -pub struct TsconfigOptions { - /// Allows you to specify where to find the TypeScript configuration file. - /// You may provide - /// * a relative path to the configuration file. It will be resolved relative to cwd. - /// * an absolute path to the configuration file. - pub config_file: PathBuf, - - /// Support for Typescript Project References. - pub references: TsconfigReferences, -} - -/// Configuration for [TsconfigOptions::references] -#[derive(Debug, Clone)] -pub enum TsconfigReferences { - Disabled, - /// Use the `references` field from tsconfig of `config_file`. - Auto, - /// Manually provided relative or absolute path. - Paths(Vec), -} - -impl Default for ResolveOptions { - fn default() -> Self { - Self { - tsconfig: None, - alias: vec![], - alias_fields: vec![], - condition_names: vec![], - description_files: vec!["package.json".into()], - enforce_extension: EnforceExtension::Auto, - extension_alias: vec![], - exports_fields: vec![vec!["exports".into()]], - imports_fields: vec![vec!["imports".into()]], - extensions: vec![".js".into(), ".json".into(), ".node".into()], - fallback: vec![], - fully_specified: false, - main_fields: vec!["main".into()], - main_files: vec!["index".into()], - modules: vec!["node_modules".into()], - resolve_to_context: false, - prefer_relative: false, - prefer_absolute: false, - restrictions: vec![], - roots: vec![], - symlinks: true, - builtin_modules: false, - } - } -} - -// For tracing -impl fmt::Display for ResolveOptions { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - if let Some(tsconfig) = &self.tsconfig { - write!(f, "tsconfig:{tsconfig:?},")?; - } - if !self.alias.is_empty() { - write!(f, "alias:{:?},", self.alias)?; - } - if !self.alias_fields.is_empty() { - write!(f, "alias_fields:{:?},", self.alias_fields)?; - } - if !self.condition_names.is_empty() { - write!(f, "condition_names:{:?},", self.condition_names)?; - } - if self.enforce_extension.is_enabled() { - write!(f, "enforce_extension:{:?},", self.enforce_extension)?; - } - if !self.exports_fields.is_empty() { - write!(f, "exports_fields:{:?},", self.exports_fields)?; - } - if !self.imports_fields.is_empty() { - write!(f, "imports_fields:{:?},", self.imports_fields)?; - } - if !self.extension_alias.is_empty() { - write!(f, "extension_alias:{:?},", self.extension_alias)?; - } - if !self.extensions.is_empty() { - write!(f, "extensions:{:?},", self.extensions)?; - } - if !self.fallback.is_empty() { - write!(f, "fallback:{:?},", self.fallback)?; - } - if self.fully_specified { - write!(f, "fully_specified:{:?},", self.fully_specified)?; - } - if !self.main_fields.is_empty() { - write!(f, "main_fields:{:?},", self.main_fields)?; - } - if !self.main_files.is_empty() { - write!(f, "main_files:{:?},", self.main_files)?; - } - if !self.modules.is_empty() { - write!(f, "modules:{:?},", self.modules)?; - } - if self.resolve_to_context { - write!(f, "resolve_to_context:{:?},", self.resolve_to_context)?; - } - if self.prefer_relative { - write!(f, "prefer_relative:{:?},", self.prefer_relative)?; - } - if self.prefer_absolute { - write!(f, "prefer_absolute:{:?},", self.prefer_absolute)?; - } - if !self.restrictions.is_empty() { - write!(f, "restrictions:{:?},", self.restrictions)?; - } - if !self.roots.is_empty() { - write!(f, "roots:{:?},", self.roots)?; - } - if self.symlinks { - write!(f, "symlinks:{:?},", self.symlinks)?; - } - if self.builtin_modules { - write!(f, "builtin_modules:{:?},", self.builtin_modules)?; - } - Ok(()) - } -} - -#[cfg(test)] -mod test { - use super::{ - AliasValue, EnforceExtension, ResolveOptions, Restriction, TsconfigOptions, - TsconfigReferences, - }; - use std::path::PathBuf; - - #[test] - fn enforce_extension() { - assert!(EnforceExtension::Auto.is_auto()); - assert!(!EnforceExtension::Enabled.is_auto()); - assert!(!EnforceExtension::Disabled.is_auto()); - - assert!(!EnforceExtension::Auto.is_enabled()); - assert!(EnforceExtension::Enabled.is_enabled()); - assert!(!EnforceExtension::Disabled.is_enabled()); - - assert!(!EnforceExtension::Auto.is_disabled()); - assert!(!EnforceExtension::Enabled.is_disabled()); - assert!(EnforceExtension::Disabled.is_disabled()); - } - - #[test] - fn display() { - let options = ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: PathBuf::from("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - alias: vec![("a".into(), vec![AliasValue::Ignore])], - alias_fields: vec![vec!["browser".into()]], - condition_names: vec!["require".into()], - enforce_extension: EnforceExtension::Enabled, - extension_alias: vec![(".js".into(), vec![".ts".into()])], - exports_fields: vec![vec!["exports".into()]], - imports_fields: vec![vec!["imports".into()]], - fallback: vec![("fallback".into(), vec![AliasValue::Ignore])], - fully_specified: true, - resolve_to_context: true, - prefer_relative: true, - prefer_absolute: true, - restrictions: vec![Restriction::Path(PathBuf::from("restrictions"))], - roots: vec![PathBuf::from("roots")], - builtin_modules: true, - ..ResolveOptions::default() - }; - - let expected = r#"tsconfig:TsconfigOptions { config_file: "tsconfig.json", references: Auto },alias:[("a", [Ignore])],alias_fields:[["browser"]],condition_names:["require"],enforce_extension:Enabled,exports_fields:[["exports"]],imports_fields:[["imports"]],extension_alias:[(".js", [".ts"])],extensions:[".js", ".json", ".node"],fallback:[("fallback", [Ignore])],fully_specified:true,main_fields:["main"],main_files:["index"],modules:["node_modules"],resolve_to_context:true,prefer_relative:true,prefer_absolute:true,restrictions:[Path("restrictions")],roots:["roots"],symlinks:true,builtin_modules:true,"#; - assert_eq!(format!("{options}"), expected); - - let options = ResolveOptions { - alias: vec![], - alias_fields: vec![], - builtin_modules: false, - condition_names: vec![], - description_files: vec![], - enforce_extension: EnforceExtension::Disabled, - exports_fields: vec![], - extension_alias: vec![], - extensions: vec![], - fallback: vec![], - fully_specified: false, - imports_fields: vec![], - main_fields: vec![], - main_files: vec![], - modules: vec![], - prefer_absolute: false, - prefer_relative: false, - resolve_to_context: false, - restrictions: vec![], - roots: vec![], - symlinks: false, - tsconfig: None, - }; - - assert_eq!(format!("{options}"), ""); - } -} diff --git a/src/package_json.rs b/src/package_json.rs deleted file mode 100644 index 7e05d202..00000000 --- a/src/package_json.rs +++ /dev/null @@ -1,219 +0,0 @@ -//! package.json definitions -//! -//! Code related to export field are copied from [Parcel's resolver](https://github.com/parcel-bundler/parcel/blob/v2/packages/utils/node-resolver-rs/src/package_json.rs) -use std::path::{Path, PathBuf}; - -use serde_json::Value as JSONValue; - -use crate::{path::PathUtil, ResolveError}; - -pub type JSONMap = serde_json::Map; - -/// Deserialized package.json -#[derive(Debug, Default)] -pub struct PackageJson { - /// Path to `package.json`. Contains the `package.json` filename. - pub path: PathBuf, - - /// Realpath to `package.json`. Contains the `package.json` filename. - pub realpath: PathBuf, - - /// The "name" field defines your package's name. - /// The "name" field can be used in addition to the "exports" field to self-reference a package using its name. - /// - /// - pub name: Option, - - /// The "type" field. - /// - /// - pub r#type: Option, - - /// The "sideEffects" field. - /// - /// - pub side_effects: Option, - - raw_json: std::sync::Arc, -} - -impl PackageJson { - /// # Panics - /// # Errors - pub(crate) fn parse( - path: PathBuf, - realpath: PathBuf, - json: &str, - ) -> Result { - let mut raw_json: JSONValue = serde_json::from_str(json)?; - let mut package_json = Self::default(); - - if let Some(json_object) = raw_json.as_object_mut() { - // Remove large fields that are useless for pragmatic use. - #[cfg(feature = "package_json_raw_json_api")] - { - json_object.remove("description"); - json_object.remove("keywords"); - json_object.remove("scripts"); - json_object.remove("dependencies"); - json_object.remove("devDependencies"); - json_object.remove("peerDependencies"); - json_object.remove("optionalDependencies"); - } - - // Add name, type and sideEffects. - package_json.name = - json_object.get("name").and_then(|field| field.as_str()).map(ToString::to_string); - package_json.r#type = json_object.get("type").cloned(); - package_json.side_effects = json_object.get("sideEffects").cloned(); - } - - package_json.path = path; - package_json.realpath = realpath; - package_json.raw_json = std::sync::Arc::new(raw_json); - Ok(package_json) - } - - fn get_value_by_path<'a>( - fields: &'a serde_json::Map, - path: &[String], - ) -> Option<&'a JSONValue> { - if path.is_empty() { - return None; - } - let mut value = fields.get(&path[0])?; - for key in path.iter().skip(1) { - if let Some(inner_value) = value.as_object().and_then(|o| o.get(key)) { - value = inner_value; - } else { - return None; - } - } - Some(value) - } - - /// Raw serde json value of `package.json`. - /// - /// This is currently used in Rspack for: - /// * getting the `sideEffects` field - /// * query in - search on GitHub indicates query on the `type` field. - /// - /// To reduce overall memory consumption, large fields that useless for pragmatic use are removed. - /// They are: `description`, `keywords`, `scripts`, - /// `dependencies` and `devDependencies`, `peerDependencies`, `optionalDependencies`. - #[cfg(feature = "package_json_raw_json_api")] - pub fn raw_json(&self) -> &std::sync::Arc { - &self.raw_json - } - - /// Directory to `package.json` - /// - /// # Panics - /// - /// * When the package.json path is misconfigured. - pub fn directory(&self) -> &Path { - debug_assert!(self.realpath.file_name().is_some_and(|x| x == "package.json")); - self.realpath.parent().unwrap() - } - - /// The "main" field defines the entry point of a package when imported by name via a node_modules lookup. Its value is a path. - /// - /// When a package has an "exports" field, this will take precedence over the "main" field when importing the package by name. - /// - /// Values are dynamically retrieved from [ResolveOptions::main_fields]. - /// - /// - pub(crate) fn main_fields<'a>( - &'a self, - main_fields: &'a [String], - ) -> impl Iterator + '_ { - main_fields - .iter() - .filter_map(|main_field| self.raw_json.get(main_field)) - .filter_map(|value| value.as_str()) - } - - /// The "exports" field allows defining the entry points of a package when imported by name loaded either via a node_modules lookup or a self-reference to its own name. - /// - /// - pub(crate) fn exports_fields<'a>( - &'a self, - exports_fields: &'a [Vec], - ) -> impl Iterator + '_ { - exports_fields.iter().filter_map(|object_path| { - self.raw_json - .as_object() - .and_then(|json_object| Self::get_value_by_path(json_object, object_path)) - }) - } - - /// In addition to the "exports" field, there is a package "imports" field to create private mappings that only apply to import specifiers from within the package itself. - /// - /// - pub(crate) fn imports_fields<'a>( - &'a self, - imports_fields: &'a [Vec], - ) -> impl Iterator + '_ { - imports_fields.iter().filter_map(|object_path| { - self.raw_json - .as_object() - .and_then(|json_object| Self::get_value_by_path(json_object, object_path)) - .and_then(|value| value.as_object()) - }) - } - - /// The "browser" field is provided by a module author as a hint to javascript bundlers or component tools when packaging modules for client side use. - /// Multiple values are configured by [ResolveOptions::alias_fields]. - /// - /// - fn browser_fields<'a>( - &'a self, - alias_fields: &'a [Vec], - ) -> impl Iterator + '_ { - alias_fields.iter().filter_map(|object_path| { - self.raw_json - .as_object() - .and_then(|json_object| Self::get_value_by_path(json_object, object_path)) - // Only object is valid, all other types are invalid - // https://github.com/webpack/enhanced-resolve/blob/3a28f47788de794d9da4d1702a3a583d8422cd48/lib/AliasFieldPlugin.js#L44-L52 - .and_then(|value| value.as_object()) - }) - } - - /// Resolve the request string for this package.json by looking at the `browser` field. - /// - /// # Errors - /// - /// * Returns [ResolveError::Ignored] for `"path": false` in `browser` field. - pub(crate) fn resolve_browser_field<'a>( - &'a self, - path: &Path, - request: Option<&str>, - alias_fields: &'a [Vec], - ) -> Result, ResolveError> { - for object in self.browser_fields(alias_fields) { - if let Some(request) = request { - if let Some(value) = object.get(request) { - return Self::alias_value(path, value); - } - } else { - let dir = self.path.parent().unwrap(); - for (key, value) in object { - let joined = dir.normalize_with(key); - if joined == path { - return Self::alias_value(path, value); - } - } - } - } - Ok(None) - } - - fn alias_value<'a>(key: &Path, value: &'a JSONValue) -> Result, ResolveError> { - match value { - JSONValue::String(value) => Ok(Some(value.as_str())), - JSONValue::Bool(b) if !b => Err(ResolveError::Ignored(key.to_path_buf())), - _ => Ok(None), - } - } -} diff --git a/src/path.rs b/src/path.rs deleted file mode 100644 index f66fdd76..00000000 --- a/src/path.rs +++ /dev/null @@ -1,132 +0,0 @@ -//! Path Utilities -//! -//! Code adapted from the following libraries -//! * [path-absolutize](https://docs.rs/path-absolutize) -//! * [normalize_path](https://docs.rs/normalize-path) -use std::path::{Component, Path, PathBuf}; - -pub const SLASH_START: &[char; 2] = &['/', '\\']; - -/// Extension trait to add path normalization to std's [`Path`]. -pub trait PathUtil { - /// Normalize this path without performing I/O. - /// - /// All redundant separator and up-level references are collapsed. - /// - /// However, this does not resolve links. - fn normalize(&self) -> PathBuf; - - /// Normalize with subpath assuming this path is normalized without performing I/O. - /// - /// All redundant separator and up-level references are collapsed. - /// - /// However, this does not resolve links. - fn normalize_with>(&self, subpath: P) -> PathBuf; - - /// Defined in ESM PACKAGE_TARGET_RESOLVE - /// If target split on "/" or "\" contains any "", ".", "..", or "node_modules" segments after the first "." segment, case insensitive and including percent encoded variants - fn is_invalid_exports_target(&self) -> bool; -} - -impl PathUtil for Path { - // https://github.com/parcel-bundler/parcel/blob/e0b99c2a42e9109a9ecbd6f537844a1b33e7faf5/packages/utils/node-resolver-rs/src/path.rs#L7 - fn normalize(&self) -> PathBuf { - let mut components = self.components().peekable(); - let mut ret = if let Some(c @ Component::Prefix(..)) = components.peek() { - let buf = PathBuf::from(c.as_os_str()); - components.next(); - buf - } else { - PathBuf::new() - }; - - for component in components { - match component { - Component::Prefix(..) => unreachable!("Path {:?}", self), - Component::RootDir => { - ret.push(component.as_os_str()); - } - Component::CurDir => {} - Component::ParentDir => { - ret.pop(); - } - Component::Normal(c) => { - ret.push(c); - } - } - } - - ret - } - - // https://github.com/parcel-bundler/parcel/blob/e0b99c2a42e9109a9ecbd6f537844a1b33e7faf5/packages/utils/node-resolver-rs/src/path.rs#L37 - fn normalize_with>(&self, subpath: B) -> PathBuf { - let subpath = subpath.as_ref(); - - let mut components = subpath.components(); - - let Some(head) = components.next() else { return subpath.to_path_buf() }; - - if matches!(head, Component::Prefix(..) | Component::RootDir) { - return subpath.to_path_buf(); - } - - let mut ret = self.to_path_buf(); - for component in std::iter::once(head).chain(components) { - match component { - Component::CurDir => {} - Component::ParentDir => { - ret.pop(); - } - Component::Normal(c) => { - ret.push(c); - } - Component::Prefix(..) | Component::RootDir => { - unreachable!("Path {:?} Subpath {:?}", self, subpath) - } - } - } - - ret - } - - fn is_invalid_exports_target(&self) -> bool { - self.components().enumerate().any(|(index, c)| match c { - Component::ParentDir => true, - Component::CurDir => index > 0, - Component::Normal(c) => c.eq_ignore_ascii_case("node_modules"), - _ => false, - }) - } -} - -// https://github.com/webpack/enhanced-resolve/blob/main/test/path.test.js -#[test] -fn is_invalid_exports_target() { - let test_cases = [ - "../a.js", - "../", - "./a/b/../../../c.js", - "./a/b/../../../", - "./../../c.js", - "./../../", - "./a/../b/../../c.js", - "./a/../b/../../", - "./././../", - ]; - - for case in test_cases { - assert!(Path::new(case).is_invalid_exports_target(), "{case}"); - } - - assert!(!Path::new("C:").is_invalid_exports_target()); - assert!(!Path::new("/").is_invalid_exports_target()); -} - -#[test] -fn normalize() { - assert_eq!(Path::new("/foo/.././foo/").normalize(), Path::new("/foo")); - assert_eq!(Path::new("C://").normalize(), Path::new("C://")); - assert_eq!(Path::new("C:").normalize(), Path::new("C:")); - assert_eq!(Path::new(r"\\server\share").normalize(), Path::new(r"\\server\share")); -} diff --git a/src/resolution.rs b/src/resolution.rs deleted file mode 100644 index a3aaa2e7..00000000 --- a/src/resolution.rs +++ /dev/null @@ -1,92 +0,0 @@ -use crate::package_json::PackageJson; -use std::{ - fmt, - path::{Path, PathBuf}, - sync::Arc, -}; - -/// The final path resolution with optional `?query` and `#fragment` -#[derive(Clone)] -pub struct Resolution { - pub(crate) path: PathBuf, - - /// path query `?query`, contains `?`. - pub(crate) query: Option, - - /// path fragment `#query`, contains `#`. - pub(crate) fragment: Option, - - pub(crate) package_json: Option>, -} - -impl fmt::Debug for Resolution { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - f.debug_struct("Resolution") - .field("path", &self.path) - .field("query", &self.query) - .field("fragment", &self.fragment) - .field("package_json", &self.package_json.as_ref().map(|p| &p.path)) - .finish() - } -} - -impl PartialEq for Resolution { - fn eq(&self, other: &Self) -> bool { - self.path == other.path && self.query == other.query && self.fragment == other.fragment - } -} -impl Eq for Resolution {} - -impl Resolution { - /// Returns the path without query and fragment - pub fn path(&self) -> &Path { - &self.path - } - - /// Returns the path without query and fragment - pub fn into_path_buf(self) -> PathBuf { - self.path - } - - /// Returns the path query `?query`, contains the leading `?` - pub fn query(&self) -> Option<&str> { - self.query.as_deref() - } - - /// Returns the path fragment `#fragment`, contains the leading `#` - pub fn fragment(&self) -> Option<&str> { - self.fragment.as_deref() - } - - /// Returns serialized package_json - pub fn package_json(&self) -> Option<&Arc> { - self.package_json.as_ref() - } - - /// Returns the full path with query and fragment - pub fn full_path(&self) -> PathBuf { - let mut path = self.path.clone().into_os_string(); - if let Some(query) = &self.query { - path.push(query); - } - if let Some(fragment) = &self.fragment { - path.push(fragment); - } - PathBuf::from(path) - } -} - -#[test] -fn test() { - let resolution = Resolution { - path: PathBuf::from("foo"), - query: Some("?query".to_string()), - fragment: Some("#fragment".to_string()), - package_json: None, - }; - assert_eq!(resolution.path(), Path::new("foo")); - assert_eq!(resolution.query(), Some("?query")); - assert_eq!(resolution.fragment(), Some("#fragment")); - assert_eq!(resolution.full_path(), PathBuf::from("foo?query#fragment")); - assert_eq!(resolution.into_path_buf(), PathBuf::from("foo")); -} diff --git a/src/specifier.rs b/src/specifier.rs deleted file mode 100644 index 73ed038c..00000000 --- a/src/specifier.rs +++ /dev/null @@ -1,230 +0,0 @@ -use crate::error::SpecifierError; -use std::borrow::Cow; - -#[derive(Debug)] -pub struct Specifier<'a> { - path: Cow<'a, str>, - pub query: Option<&'a str>, - pub fragment: Option<&'a str>, -} - -impl<'a> Specifier<'a> { - pub fn path(&'a self) -> &'a str { - self.path.as_ref() - } - - pub fn parse(specifier: &'a str) -> Result { - if specifier.is_empty() { - return Err(SpecifierError::Empty(specifier.to_string())); - } - let offset = match specifier.as_bytes()[0] { - b'/' | b'.' | b'#' => 1, - _ => 0, - }; - let (path, query, fragment) = Self::parse_query_framgment(specifier, offset); - if path.is_empty() { - return Err(SpecifierError::Empty(specifier.to_string())); - } - Ok(Self { path, query, fragment }) - } - - fn parse_query_framgment( - specifier: &'a str, - skip: usize, - ) -> (Cow<'a, str>, Option<&str>, Option<&str>) { - let mut query_start: Option = None; - let mut fragment_start: Option = None; - - let mut prev = specifier.chars().next().unwrap(); - let mut escaped_indexes = vec![]; - for (i, c) in specifier.char_indices().skip(skip) { - if c == '?' && query_start.is_none() { - query_start = Some(i); - } - if c == '#' { - if prev == '\0' { - escaped_indexes.push(i - 1); - } else { - fragment_start = Some(i); - break; - } - } - prev = c; - } - - let (path, query, fragment) = match (query_start, fragment_start) { - (Some(i), Some(j)) => { - debug_assert!(i < j); - (&specifier[..i], Some(&specifier[i..j]), Some(&specifier[j..])) - } - (Some(i), None) => (&specifier[..i], Some(&specifier[i..]), None), - (None, Some(j)) => (&specifier[..j], None, Some(&specifier[j..])), - _ => (specifier, None, None), - }; - - let path = if escaped_indexes.is_empty() { - Cow::Borrowed(path) - } else { - // Remove the `\0` characters for a legal path. - Cow::Owned( - path.chars() - .enumerate() - .filter_map(|(i, c)| (!escaped_indexes.contains(&i)).then_some(c)) - .collect::(), - ) - }; - - (path, query, fragment) - } -} - -#[cfg(test)] -mod tests { - use super::{Specifier, SpecifierError}; - - #[test] - fn debug() { - let specifier = Specifier::parse("/").unwrap(); - assert_eq!( - format!("{specifier:?}"), - r#"Specifier { path: "/", query: None, fragment: None }"# - ); - } - - #[test] - fn empty() { - let specifiers = ["", "?"]; - for specifier in specifiers { - let error = Specifier::parse(specifier).unwrap_err(); - assert_eq!(error, SpecifierError::Empty(specifier.to_string())); - } - } - - #[test] - fn absolute() -> Result<(), SpecifierError> { - let specifier = "/test?#"; - let parsed = Specifier::parse(specifier)?; - assert_eq!(parsed.path, "/test"); - assert_eq!(parsed.query, Some("?")); - assert_eq!(parsed.fragment, Some("#")); - Ok(()) - } - - #[test] - fn relative() -> Result<(), SpecifierError> { - let specifiers = ["./test", "../test", "../../test"]; - for specifier in specifiers { - let mut r = specifier.to_string(); - r.push_str("?#"); - let parsed = Specifier::parse(&r)?; - assert_eq!(parsed.path, specifier); - assert_eq!(parsed.query, Some("?")); - assert_eq!(parsed.fragment, Some("#")); - } - Ok(()) - } - - #[test] - fn hash() -> Result<(), SpecifierError> { - let specifiers = ["#", "#path"]; - for specifier in specifiers { - let mut r = specifier.to_string(); - r.push_str("?#"); - let parsed = Specifier::parse(&r)?; - assert_eq!(parsed.path, specifier); - assert_eq!(parsed.query, Some("?")); - assert_eq!(parsed.fragment, Some("#")); - } - Ok(()) - } - - #[test] - fn module() -> Result<(), SpecifierError> { - let specifiers = ["module"]; - for specifier in specifiers { - let mut r = specifier.to_string(); - r.push_str("?#"); - let parsed = Specifier::parse(&r)?; - assert_eq!(parsed.path, specifier); - assert_eq!(parsed.query, Some("?")); - assert_eq!(parsed.fragment, Some("#")); - } - Ok(()) - } - - #[test] - fn query_fragment() -> Result<(), SpecifierError> { - let data = [ - ("a?", Some("?"), None), - ("a?query", Some("?query"), None), - ("a?query1?query2", Some("?query1?query2"), None), - ("a?query1?query2?query3", Some("?query1?query2?query3"), None), - ("a#", None, Some("#")), - ("a#b#c", None, Some("#b#c")), - ("a#fragment", None, Some("#fragment")), - ("a?#", Some("?"), Some("#")), - ("a?#fragment", Some("?"), Some("#fragment")), - ("a?query#", Some("?query"), Some("#")), - ("a?query#fragment", Some("?query"), Some("#fragment")), - ("a#fragment?", None, Some("#fragment?")), - ("a#fragment?query", None, Some("#fragment?query")), - ]; - - for (specifier_str, query, fragment) in data { - let specifier = Specifier::parse(specifier_str)?; - assert_eq!(specifier.path, "a", "{specifier_str}"); - assert_eq!(specifier.query, query, "{specifier_str}"); - assert_eq!(specifier.fragment, fragment, "{specifier_str}"); - } - - Ok(()) - } - - #[test] - // https://github.com/webpack/enhanced-resolve/blob/main/test/identifier.test.js - fn enhanced_resolve_edge_cases() -> Result<(), SpecifierError> { - let data = [ - ("path/#", "path/", "", "#"), - ("path/as/?", "path/as/", "?", ""), - ("path/#/?", "path/", "", "#/?"), - ("path/#repo#hash", "path/", "", "#repo#hash"), - ("path/#r#hash", "path/", "", "#r#hash"), - ("path/#repo/#repo2#hash", "path/", "", "#repo/#repo2#hash"), - ("path/#r/#r#hash", "path/", "", "#r/#r#hash"), - ("path/#/not/a/hash?not-a-query", "path/", "", "#/not/a/hash?not-a-query"), - ]; - - for (specifier_str, path, query, fragment) in data { - let specifier = Specifier::parse(specifier_str)?; - assert_eq!(specifier.path, path, "{specifier_str}"); - assert_eq!(specifier.query.unwrap_or(""), query, "{specifier_str}"); - assert_eq!(specifier.fragment.unwrap_or(""), fragment, "{specifier_str}"); - } - - Ok(()) - } - - // https://github.com/webpack/enhanced-resolve/blob/main/test/identifier.test.js - #[test] - fn enhanced_resolve_windows_like() -> Result<(), SpecifierError> { - let data = [ - ("path\\#", "path\\", "", "#"), - ("path\\as\\?", "path\\as\\", "?", ""), - ("path\\#\\?", "path\\", "", "#\\?"), - ("path\\#repo#hash", "path\\", "", "#repo#hash"), - ("path\\#r#hash", "path\\", "", "#r#hash"), - ("path\\#repo\\#repo2#hash", "path\\", "", "#repo\\#repo2#hash"), - ("path\\#r\\#r#hash", "path\\", "", "#r\\#r#hash"), - ("path\\#/not/a/hash?not-a-query", "path\\", "", "#/not/a/hash?not-a-query"), - ]; - - for (specifier_str, path, query, fragment) in data { - let specifier = Specifier::parse(specifier_str)?; - assert_eq!(specifier.path, path, "{specifier_str}"); - assert_eq!(specifier.query.unwrap_or(""), query, "{specifier_str}"); - assert_eq!(specifier.fragment.unwrap_or(""), fragment, "{specifier_str}"); - } - - Ok(()) - } -} diff --git a/src/tests/alias.rs b/src/tests/alias.rs deleted file mode 100644 index 07c615f4..00000000 --- a/src/tests/alias.rs +++ /dev/null @@ -1,280 +0,0 @@ -//! - -use normalize_path::NormalizePath; -use std::path::Path; - -use crate::{AliasValue, Resolution, ResolveContext, ResolveError, ResolveOptions, Resolver}; - -#[test] -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -fn alias() { - use super::memory_fs::MemoryFS; - use crate::ResolverGeneric; - use std::path::{Path, PathBuf}; - - let f = Path::new("/"); - - let file_system = MemoryFS::new(&[ - ("/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", ""), - ("/dashed-name", ""), - ]); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - alias: vec![ - ("aliasA".into(), vec![AliasValue::from("a")]), - ("b$".into(), vec![AliasValue::from("a/index")]), - ("c$".into(), vec![AliasValue::from("/a/index")]), - ( - "multiAlias".into(), - vec![ - AliasValue::from("b"), - AliasValue::from("c"), - AliasValue::from("d"), - AliasValue::from("e"), - AliasValue::from("a"), - ], - ), - ("recursive".into(), vec![AliasValue::from("recursive/dir")]), - ("/d/dir".into(), vec![AliasValue::from("/c/dir")]), - ("/d/index.js".into(), vec![AliasValue::from("/c/index")]), - ("#".into(), vec![AliasValue::from("/c/dir")]), - ("@".into(), vec![AliasValue::from("/c/dir")]), - ("ignored".into(), vec![AliasValue::Ignore]), - // not part of enhanced-resolve, added to make sure query in alias value works - ("alias_query".into(), vec![AliasValue::from("a?query_after")]), - ("alias_fragment".into(), vec![AliasValue::from("a#fragment_after")]), - ("dash".into(), vec![AliasValue::Ignore]), - ("@scope/package-name/file$".into(), vec![AliasValue::from("/c/dir")]), - ], - modules: vec!["/".into()], - ..ResolveOptions::default() - }, - ); - - #[rustfmt::skip] - let pass = [ - ("should resolve a not aliased module 1", "a", "/a/index"), - ("should resolve a not aliased module 2", "a/index", "/a/index"), - ("should resolve a not aliased module 3", "a/dir", "/a/dir/index"), - ("should resolve a not aliased module 4", "a/dir/index", "/a/dir/index"), - ("should resolve an aliased module 1", "aliasA", "/a/index"), - ("should resolve an aliased module 2", "aliasA/index", "/a/index"), - ("should resolve an aliased module 3", "aliasA/dir", "/a/dir/index"), - ("should resolve an aliased module 4", "aliasA/dir/index", "/a/dir/index"), - ("should resolve '#' alias 1", "#", "/c/dir/index"), - ("should resolve '#' alias 2", "#/index", "/c/dir/index"), - ("should resolve '@' alias 1", "@", "/c/dir/index"), - ("should resolve '@' alias 2", "@/index", "/c/dir/index"), - ("should resolve a recursive aliased module 1", "recursive", "/recursive/dir/index"), - ("should resolve a recursive aliased module 2", "recursive/index", "/recursive/dir/index"), - ("should resolve a recursive aliased module 3", "recursive/dir", "/recursive/dir/index"), - ("should resolve a recursive aliased module 4", "recursive/dir/index", "/recursive/dir/index"), - ("should resolve a file aliased module 1", "b", "/a/index"), - ("should resolve a file aliased module 2", "c", "/a/index"), - ("should resolve a file aliased module with a query 1", "b?query", "/a/index?query"), - ("should resolve a file aliased module with a query 2", "c?query", "/a/index?query"), - ("should resolve a path in a file aliased module 1", "b/index", "/b/index"), - ("should resolve a path in a file aliased module 2", "b/dir", "/b/dir/index"), - ("should resolve a path in a file aliased module 3", "b/dir/index", "/b/dir/index"), - ("should resolve a path in a file aliased module 4", "c/index", "/c/index"), - ("should resolve a path in a file aliased module 5", "c/dir", "/c/dir/index"), - ("should resolve a path in a file aliased module 6", "c/dir/index", "/c/dir/index"), - ("should resolve a file aliased file 1", "d", "/c/index"), - ("should resolve a file aliased file 2", "d/dir/index", "/c/dir/index"), - ("should resolve a file in multiple aliased dirs 1", "multiAlias/dir/file", "/e/dir/file"), - ("should resolve a file in multiple aliased dirs 2", "multiAlias/anotherDir", "/e/anotherDir/index"), - // not part of enhanced-resolve, added to make sure query in alias value works - ("should resolve query in alias value", "alias_query?query_before", "/a/index?query_after"), - ("should resolve query in alias value", "alias_fragment#fragment_before", "/a/index#fragment_after"), - ("should resolve dashed name", "dashed-name", "/dashed-name"), - ("should resolve scoped package name with sub dir", "@scope/package-name/file", "/c/dir/index"), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - - #[rustfmt::skip] - let ignore = [ - ("should resolve an ignore module", "ignored", ResolveError::Ignored(f.join("ignored"))) - ]; - - for (comment, request, expected) in ignore { - let resolution = resolver.resolve(f, request); - assert_eq!(resolution, Err(expected), "{comment} {request}"); - } -} - -// Not part of enhanced-resolve -#[test] -fn infinite_recursion() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![ - ("./a".into(), vec![AliasValue::from("./b")]), - ("./b".into(), vec![AliasValue::from("./a")]), - ], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(f, "./a"); - assert_eq!(resolution, Err(ResolveError::Recursion)); -} - -fn check_slash(path: &Path) { - let s = path.to_string_lossy().to_string(); - #[cfg(target_os = "windows")] - { - assert!(!s.contains('/'), "{s}"); - assert!(s.contains('\\'), "{s}"); - } - #[cfg(not(target_os = "windows"))] - { - assert!(s.contains('/'), "{s}"); - assert!(!s.contains('\\'), "{s}"); - } -} - -#[test] -fn absolute_path() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![(f.join("foo").to_str().unwrap().to_string(), vec![AliasValue::Ignore])], - modules: vec![f.clone().to_str().unwrap().to_string()], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(&f, "foo/index"); - assert_eq!(resolution, Err(ResolveError::Ignored(f.join("foo")))); -} - -#[test] -fn system_path() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![("@app".into(), vec![AliasValue::from(f.join("alias").to_string_lossy())])], - ..ResolveOptions::default() - }); - - let specifiers = ["@app/files/a", "@app/files/a.js"]; - - for specifier in specifiers { - let path = resolver.resolve(&f, specifier).map(Resolution::into_path_buf).unwrap(); - assert_eq!(path, f.join("alias/files/a.js")); - check_slash(&path); - } -} - -#[test] -fn alias_is_full_path() { - let f = super::fixture(); - let dir = f.join("foo"); - let dir_str = dir.to_string_lossy().to_string(); - - let resolver = Resolver::new(ResolveOptions { - alias: vec![("@".into(), vec![AliasValue::Path(dir_str.clone())])], - ..ResolveOptions::default() - }); - - let mut ctx = ResolveContext::default(); - - let specifiers = [ - "@/index".to_string(), - "@/index.js".to_string(), - // specifier has multiple `/` for reasons we'll never know - "@////index".to_string(), - // specifier is a full path - dir_str, - ]; - - for specifier in specifiers { - let resolution = resolver.resolve_with_context(&f, &specifier, &mut ctx); - assert_eq!(resolution.map(|r| r.full_path()), Ok(dir.join("index.js"))); - } - - for path in ctx.file_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - check_slash(&path); - } - - for path in ctx.missing_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - check_slash(&path); - if let Some(path) = path.parent() { - assert!(!path.is_file(), "{path:?} must not be a file"); - } - } -} - -// For the `should_stop` variable in `load_alias` -#[test] -fn all_alias_values_are_not_found() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![( - "m1".to_string(), - vec![AliasValue::Path(f.join("node_modules").join("m2").to_string_lossy().to_string())], - )], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(&f, "m1/a.js"); - assert_eq!(resolution, Err(ResolveError::NotFound("m1/a.js".to_string()))); -} - -#[test] -fn alias_fragment() { - let f = super::fixture(); - - let data = [ - // enhanced-resolve has `#` prepended with a `\0`, they are removed from the - // following 3 expected test results. - // See https://github.com/webpack/enhanced-resolve#escaping - ( - "handle fragment edge case (no fragment)", - "./no#fragment/#/#", - f.join("no#fragment/#/#.js"), - ), - ("handle fragment edge case (fragment)", "./no#fragment/#/", f.join("no.js#fragment/#/")), - ( - "handle fragment escaping", - "./no\0#fragment/\0#/\0##fragment", - f.join("no#fragment/#/#.js#fragment"), - ), - ]; - - for (comment, request, expected) in data { - let resolver = Resolver::new(ResolveOptions { - alias: vec![("foo".to_string(), vec![AliasValue::Path(request.to_string())])], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f, "foo").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } -} - -#[test] -fn alias_try_fragment_as_path() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![( - "#".to_string(), - vec![AliasValue::Path(f.join("#").to_string_lossy().to_string())], - )], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(&f, "#/a").map(|r| r.full_path()); - assert_eq!(resolution, Ok(f.join("#").join("a.js"))); -} diff --git a/src/tests/browser_field.rs b/src/tests/browser_field.rs deleted file mode 100644 index 171ee099..00000000 --- a/src/tests/browser_field.rs +++ /dev/null @@ -1,189 +0,0 @@ -//! - -use crate::{AliasValue, ResolveError, ResolveOptions, Resolver}; - -#[test] -fn ignore() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![ - vec!["browser".into()], - vec!["innerBrowser1".into()], - vec!["innerBrowser2".into()], - vec![], - ], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - (f.clone(), "./lib/ignore", f.join("lib/ignore.js")), - (f.clone(), "./lib/ignore.js", f.join("lib/ignore.js")), - (f.join("lib"), "./ignore", f.join("lib/ignore.js")), - (f.join("lib"), "./ignore.js", f.join("lib/ignore.js")), - ]; - - for (path, request, expected) in data { - let resolution = resolver.resolve(&path, request); - let expected = ResolveError::Ignored(expected); - assert_eq!(resolution, Err(expected), "{path:?} {request}"); - } -} - -#[test] -fn shared_resolvers() { - let f = super::fixture().join("browser-module"); - - let resolver1 = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["innerBrowser1".into(), "field".into(), "browser".into()]], - ..ResolveOptions::default() - }); - let resolved_path = resolver1.resolve(&f, "./lib/main1.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("lib/main.js"))); - - let resolver2 = resolver1.clone_with_options(ResolveOptions { - alias_fields: vec![vec!["innerBrowser2".into(), "browser".into()]], - ..ResolveOptions::default() - }); - let resolved_path = resolver2.resolve(&f, "./lib/main2.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("./lib/replaced.js"))); -} - -#[test] -fn replace_file() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![ - vec!["browser".into()], - vec!["innerBrowser1".into(), "field2".into(), "browser".into()], // not presented - vec!["innerBrowser1".into(), "field".into(), "browser".into()], - vec!["innerBrowser2".into(), "browser".into()], - ], - // Not part of enhanced-resolve. Added to make sure no interaction between these two fields. - main_fields: vec!["browser".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - ("should replace a file 1", f.clone(), "./lib/replaced", f.join("lib/browser.js")), - ("should replace a file 2", f.clone(), "./lib/replaced.js", f.join("lib/browser.js")), - ("should replace a file 3", f.join("lib"), "./replaced", f.join("lib/browser.js")), - ("should replace a file 4", f.join("lib"), "./replaced.js", f.join("lib/browser.js")), - ("should replace a module with a file 1", f.clone(), "module-a", f.join("browser/module-a.js")), - ("should replace a module with a file 2", f.join("lib"), "module-a", f.join("browser/module-a.js")), - ("should replace a module with a module 1", f.clone(), "module-b", f.join("node_modules/module-c.js")), - ("should replace a module with a module 2", f.join("lib"), "module-b", f.join("node_modules/module-c.js")), - ("should resolve in nested property 1", f.clone(), "./lib/main1.js", f.join("lib/main.js")), - ("should resolve in nested property 2", f.clone(), "./lib/main2.js", f.join("lib/browser.js")), - ("should check only alias field properties", f.clone(), "./toString", f.join("lib/toString.js")), - // not part of enhanced-resolve - ("recursion", f.clone(), "module-c", f.join("node_modules/module-c.js")), - ("resolve self 1", f.clone(), "./lib/main.js", f.join("lib/main.js")), - ("resolve self 2", f.clone(), "./main.js", f.join("lib/main.js")), - ]; - - for (comment, path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn recurse_fail() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - ("recurse non existent", f.clone(), "./lib/non-existent.js", ResolveError::NotFound("./lib/non-existent.js".into())), - ("path partial match 1", f.clone(), "./xyz.js", ResolveError::NotFound("./xyz.js".into())), - ("path partial match 2", f, "./lib/xyz.js", ResolveError::NotFound("./lib/xyz.js".into())), - ]; - - for (comment, path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Err(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn broken() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - // The browser field string value should be ignored - (f.clone(), "browser-module-broken", Ok(f.join("node_modules/browser-module-broken/main.js"))), - (f.join("browser-module"), "./number", Err(ResolveError::NotFound("./number".into()))), - ]; - - for (path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, expected, "{path:?} {request}"); - } -} - -#[test] -fn crypto_js() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - fallback: vec![( - "crypto".into(), - vec![AliasValue::from(f.join("lib.js").to_string_lossy())], - )], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(f.join("crypto-js"), "crypto").map(|r| r.full_path()); - assert_eq!(resolved_path, Err(ResolveError::Ignored(f.join("crypto-js")))); -} - -// https://github.com/webpack/webpack/blob/87660921808566ef3b8796f8df61bd79fc026108/test/cases/resolving/browser-field/index.js#L40-L43 -#[test] -fn recursive() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - let data = [ - ("should handle recursive file 1", f.clone(), "recursive-file/a"), - ("should handle recursive file 2", f.clone(), "recursive-file/b"), - ("should handle recursive file 3", f.clone(), "recursive-file/c"), - ("should handle recursive file 4", f, "recursive-file/d"), - ]; - - for (comment, path, request) in data { - let resolved_path = resolver.resolve(&path, request); - assert_eq!(resolved_path, Err(ResolveError::Recursion), "{comment} {path:?} {request}"); - } -} - -#[test] -fn with_query() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "./foo").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("lib").join("browser.js?query"))); -} diff --git a/src/tests/builtins.rs b/src/tests/builtins.rs deleted file mode 100644 index 5d6d14d9..00000000 --- a/src/tests/builtins.rs +++ /dev/null @@ -1,121 +0,0 @@ -use std::path::Path; - -use crate::{ResolveError, ResolveOptions, Resolver}; - -#[test] -fn builtins_off() { - let f = Path::new("/"); - let resolver = Resolver::default(); - let resolved_path = resolver.resolve(f, "zlib").map(|r| r.full_path()); - assert_eq!(resolved_path, Err(ResolveError::NotFound("zlib".into()))); -} - -#[test] -fn builtins() { - let f = Path::new("/"); - - let resolver = Resolver::new(ResolveOptions::default().with_builtin_modules(true)); - - let pass = [ - "_http_agent", - "_http_client", - "_http_common", - "_http_incoming", - "_http_outgoing", - "_http_server", - "_stream_duplex", - "_stream_passthrough", - "_stream_readable", - "_stream_transform", - "_stream_wrap", - "_stream_writable", - "_tls_common", - "_tls_wrap", - "assert", - "assert/strict", - "async_hooks", - "buffer", - "child_process", - "cluster", - "console", - "constants", - "crypto", - "dgram", - "diagnostics_channel", - "dns", - "dns/promises", - "domain", - "events", - "fs", - "fs/promises", - "http", - "http2", - "https", - "inspector", - "module", - "net", - "os", - "path", - "path/posix", - "path/win32", - "perf_hooks", - "process", - "punycode", - "querystring", - "readline", - "repl", - "stream", - "stream/consumers", - "stream/promises", - "stream/web", - "string_decoder", - "sys", - "timers", - "timers/promises", - "tls", - "trace_events", - "tty", - "url", - "util", - "util/types", - "v8", - "vm", - "worker_threads", - "zlib", - ]; - - for request in pass { - let prefixed_request = format!("node:{request}"); - for request in [prefixed_request.clone(), request.to_string()] { - let resolved_path = resolver.resolve(f, &request).map(|r| r.full_path()); - let err = ResolveError::Builtin(prefixed_request.clone()); - assert_eq!(resolved_path, Err(err), "{request}"); - } - } -} - -#[test] -fn fail() { - let f = Path::new("/"); - let resolver = Resolver::new(ResolveOptions::default().with_builtin_modules(true)); - let request = "xxx"; - let resolved_path = resolver.resolve(f, request); - let err = ResolveError::NotFound(request.to_string()); - assert_eq!(resolved_path, Err(err), "{request}"); -} - -#[test] -fn imports() { - let f = super::fixture().join("builtins"); - let resolver = Resolver::new(ResolveOptions { - builtin_modules: true, - condition_names: vec!["node".into()], - ..ResolveOptions::default() - }); - - for request in ["#fs", "#http"] { - let resolved_path = resolver.resolve(f.clone(), request).map(|r| r.full_path()); - let err = ResolveError::Builtin(format!("node:{}", request.trim_start_matches('#'))); - assert_eq!(resolved_path, Err(err)); - } -} diff --git a/src/tests/dependencies.rs b/src/tests/dependencies.rs deleted file mode 100644 index bcc2355b..00000000 --- a/src/tests/dependencies.rs +++ /dev/null @@ -1,110 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/dependencies.test.js - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows { - use rustc_hash::FxHashSet; - use std::path::PathBuf; - - use crate::{ResolveContext, ResolveOptions, ResolverGeneric}; - - use super::super::memory_fs::MemoryFS; - - fn file_system() -> MemoryFS { - MemoryFS::new(&[ - ("/a/b/node_modules/some-module/index.js", ""), - ("/a/node_modules/module/package.json", r#"{"main":"entry.js"}"#), - ("/a/node_modules/module/file.js", r#"{"main":"entry.js"}"#), - ("/modules/other-module/file.js", ""), - ]) - } - - #[test] - fn test() { - let file_system = file_system(); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - extensions: vec![".json".into(), ".js".into()], - modules: vec!["/modules".into(), "node_modules".into()], - ..ResolveOptions::default() - }, - ); - - let data = [ - ( - "middle module request", - "/a/b/c", - "module/file", - "/a/node_modules/module/file.js", - // These dependencies are different from enhanced-resolve due to different code path to - // querying the file system - vec![ - // 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", - // "/", - ], - vec![ - // missing package.jsons - // "/a/b/c/package.json", - "/a/b/package.json", - "/a/package.json", - "/package.json", - // missing modules directories - "/a/b/c", - // "/a/b/c/node_modules", - // missing single file modules - "/modules/module", - "/a/b/node_modules/module", - // missing files with alternative extensions - "/a/node_modules/module/file", - "/a/node_modules/module/file.json", - ], - ), - ( - "fast found module", - "/a/b/c", - "other-module/file.js", - "/modules/other-module/file.js", - // These dependencies are different from enhanced-resolve due to different code path to - // querying the file system - vec![ - // symlink checks - "/modules/other-module/file.js", - // "/modules/other-module", - // "/modules", - // "/", - ], - vec![ - // missing package.jsons - // "/a/b/c/package.json", - "/a/b/c", - "/a/b/package.json", - "/a/package.json", - "/package.json", - "/modules/other-module/package.json", - "/modules/package.json", - ], - ), - ]; - - for (name, context, request, result, file_dependencies, missing_dependencies) in data { - let mut ctx = ResolveContext::default(); - let path = PathBuf::from(context); - let resolved = - resolver.resolve_with_context(path, request, &mut ctx).map(|r| r.full_path()); - assert_eq!(resolved, Ok(PathBuf::from(result))); - let file_dependencies = - FxHashSet::from_iter(file_dependencies.iter().map(PathBuf::from)); - let missing_dependencies = - FxHashSet::from_iter(missing_dependencies.iter().map(PathBuf::from)); - assert_eq!(ctx.file_dependencies, file_dependencies, "{name}"); - assert_eq!(ctx.missing_dependencies, missing_dependencies, "{name}"); - } - } -} diff --git a/src/tests/exports_field.rs b/src/tests/exports_field.rs deleted file mode 100644 index fd68c1f7..00000000 --- a/src/tests/exports_field.rs +++ /dev/null @@ -1,2546 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/exportsField.test.js -//! -//! The huge exports field test cases are at the bottom of this file. - -use crate::{Ctx, PathUtil, ResolveError, ResolveOptions, Resolver}; -use serde_json::json; -use std::path::Path; - -#[test] -fn test_simple() { - let f = super::fixture().join("exports-field"); - let f2 = super::fixture().join("exports-field2"); - let f4 = super::fixture().join("exports-field-error"); - let f5 = super::fixture().join("imports-exports-wildcard"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - fully_specified: true, - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("resolve root using exports field, not a main field", f.clone(), "exports-field", f.join("node_modules/exports-field/x.js")), - ("resolver should respect condition names", f.clone(), "exports-field/dist/main.js", f.join("node_modules/exports-field/lib/lib2/main.js")), - // enhanced_resolve behaves differently to node.js. enhanced_resolve fallbacks when an - // array item is unresolved, where as node.js fallbacks when an array has an - // InvalidPackageTarget error. - // ("resolver should respect fallback", f2.clone(), "exports-field/dist/browser.js", f2.join("node_modules/exports-field/lib/browser.js")), - // The following two tests require fallback from array values, the path is changed here to - // only test query and fragment. - ("resolver should respect query parameters #1", f2.clone(), "exports-field/dist/main.js?foo", f2.join("node_modules/exports-field/lib/lib2/main.js?foo")), - ("resolver should respect fragment parameters #1", f2.clone(), "exports-field/dist/main.js#foo", f2.join("node_modules/exports-field/lib/lib2/main.js#foo")), - ("relative path should work, if relative path as request is used", f.clone(), "./node_modules/exports-field/lib/main.js", f.join("node_modules/exports-field/lib/main.js")), - ("self-resolving root", f.clone(), "@exports-field/core", f.join("a.js")), - ("should resolve with wildcard pattern #1", f5.clone(), "m/features/f.js", f5.join("node_modules/m/src/features/f.js")), - ("should resolve with wildcard pattern #2", f5.clone(), "m/features/y/y.js", f5.join("node_modules/m/src/features/y/y.js")), - ("should resolve with wildcard pattern #3", f5.clone(), "m/features-no-ext/y/y.js", f5.join("node_modules/m/src/features/y/y.js")), - ("should resolve with wildcard pattern #4", f5.clone(), "m/middle/nested/f.js", f5.join("node_modules/m/src/middle/nested/f.js")), - ("should resolve with wildcard pattern #5", f5.clone(), "m/middle-1/nested/f.js", f5.join("node_modules/m/src/middle-1/nested/f.js")), - ("should resolve with wildcard pattern #6", f5.clone(), "m/middle-2/nested/f.js", f5.join("node_modules/m/src/middle-2/nested/f.js")), - ("should resolve with wildcard pattern #7", f5.clone(), "m/middle-3/nested/f", f5.join("node_modules/m/src/middle-3/nested/f/nested/f.js")), - ("should resolve with wildcard pattern #8", f5.clone(), "m/middle-4/f/nested", f5.join("node_modules/m/src/middle-4/f/f.js")), - ("should resolve with wildcard pattern #9", f5.clone(), "m/middle-5/f$/$", f5.join("node_modules/m/src/middle-5/f$/$.js")), - ]; - - // Not needed or snapshot: - // * should log the correct info - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } - - let p = f.join("node_modules/exports-field/package.json"); - let p2 = f2.join("node_modules/exports-field/package.json"); - let p4 = f4.join("node_modules/exports-field/package.json"); - let p5 = f5.join("node_modules/m/package.json"); - - #[rustfmt::skip] - let fail = [ - // ("throw error if extension not provided", f2.clone(), "exports-field/dist/main", ResolveError::NotFound(f2.join("node_modules/exports-field/lib/lib2/main"))), - ("resolver should respect query parameters #2. Direct matching", f2.clone(), "exports-field?foo", ResolveError::PackagePathNotExported("./?foo".into(), p2.clone())), - ("resolver should respect fragment parameters #2. Direct matching", f2, "exports-field#foo", ResolveError::PackagePathNotExported("./#foo".into(), p2)), - ("relative path should not work with exports field", f.clone(), "./node_modules/exports-field/dist/main.js", ResolveError::NotFound("./node_modules/exports-field/dist/main.js".into())), - ("backtracking should not work for request", f.clone(), "exports-field/dist/../../../a.js", ResolveError::InvalidPackageTarget("./lib/../../../a.js".to_string(), "./dist/".to_string(), p.clone())), - ("backtracking should not work for exports field target", f.clone(), "exports-field/dist/a.js", ResolveError::InvalidPackageTarget("./../../a.js".to_string(), "./dist/a.js".to_string(), p.clone())), - ("not exported error", f.clone(), "exports-field/anything/else", ResolveError::PackagePathNotExported("./anything/else".to_string(), p.clone())), - ("request ending with slash #1", f.clone(), "exports-field/", ResolveError::PackagePathNotExported("./".to_string(), p.clone())), - ("request ending with slash #2", f.clone(), "exports-field/dist/", ResolveError::PackagePathNotExported("./dist/".to_string(), p.clone())), - ("request ending with slash #3", f.clone(), "exports-field/lib/", ResolveError::PackagePathNotExported("./lib/".to_string(), p)), - ("should throw error if target is invalid", f4, "exports-field", ResolveError::InvalidPackageTarget("./a/../b/../../pack1/index.js".to_string(), ".".to_string(), p4)), - ("throw error if exports field is invalid", f.clone(), "invalid-exports-field", ResolveError::InvalidPackageConfig(f.join("node_modules/invalid-exports-field/package.json"))), - ("should throw error if target is 'null'", f5, "m/features/internal/file.js", ResolveError::PackagePathNotExported("./features/internal/file.js".to_string(), p5)), - ]; - - for (comment, path, request, error) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!(resolution, Err(error), "{comment} {path:?} {request}"); - } -} - -// resolve using exports field, not a browser field #1 -#[test] -fn exports_not_browser_field1() { - let f = super::fixture().join("exports-field"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - condition_names: vec!["webpack".into()], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "exports-field/dist/main.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("node_modules/exports-field/lib/lib2/main.js"))); -} - -// resolve using exports field and a browser alias field #2 -#[test] -fn exports_not_browser_field2() { - let f2 = super::fixture().join("exports-field2"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - extensions: vec![".js".into()], - condition_names: vec!["node".into()], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f2, "exports-field/dist/main.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f2.join("node_modules/exports-field/lib/browser.js"))); -} - -// should resolve extension without fullySpecified -#[test] -fn extension_without_fully_specified() { - let f2 = super::fixture().join("exports-field2"); - - let commonjs_resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - let resolved_path = - commonjs_resolver.resolve(&f2, "exports-field/dist/main").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f2.join("node_modules/exports-field/lib/lib2/main.js"))); -} - -#[test] -fn field_name_path() { - let f2 = super::fixture().join("exports-field2"); - let f3 = super::fixture().join("exports-field3"); - - // field name path #1 #2 #3 - let exports_fields = [ - vec![vec!["exportsField".into(), "exports".into()]], - vec![vec!["exportsField".into(), "exports".into()], vec!["exports".into()]], - vec![vec!["exports".into()], vec!["exportsField".into(), "exports".into()]], - ]; - - for exports_fields in exports_fields { - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - exports_fields, - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/main.js"))); - } - - // field name path #4 - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - exports_fields: vec![vec!["exports".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f2, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f2.join("node_modules/exports-field/index.js"))); - - // field name path #5 - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - exports_fields: vec![vec!["ex".into()], vec!["exports_field".into(), "exports".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/index"))); - - // non-compliant export targeting a directory - let resolver = Resolver::new(ResolveOptions { - exports_fields: vec![vec!["broken".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/src/index.js"))); -} - -#[test] -fn shared_resolvers() { - let f3 = super::fixture().join("exports-field3"); - - let resolver1 = Resolver::new(ResolveOptions { - exports_fields: vec![vec!["exportsField".into(), "exports".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver1.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/main.js"))); - - let resolver2 = resolver1.clone_with_options(ResolveOptions { - exports_fields: vec![vec!["ex".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver2.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/index"))); -} - -#[test] -fn extension_alias_1_2() { - let f = super::fixture().join("exports-field-and-extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - extension_alias: vec![(".js".into(), vec![".ts".into(), ".js".into()])], - fully_specified: true, - condition_names: vec!["webpack".into(), "default".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve with the `extensionAlias` option", f.clone(), "@org/pkg/string.js", f.join("node_modules/@org/pkg/dist/string.js")), - ("should resolve with the `extensionAlias` option #2", f.clone(), "pkg/string.js", f.join("node_modules/pkg/dist/string.js")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn extension_alias_3() { - let f = super::fixture().join("exports-field-and-extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - extension_alias: vec![( - ".js".into(), - vec![".foo".into(), ".baz".into(), ".baz".into(), ".ts".into(), ".js".into()], - )], - fully_specified: true, - condition_names: vec!["webpack".into(), "default".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve with the `extensionAlias` option #3", f.clone(), "pkg/string.js", f.join("node_modules/pkg/dist/string.js")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn extension_alias_throw_error() { - let f = super::fixture().join("exports-field-and-extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - extension_alias: vec![(".js".into(), vec![".ts".into()])], - fully_specified: true, - condition_names: vec!["webpack".into(), "default".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let fail = [ - // enhanced-resolve has two test cases that are exactly the same here - // https://github.com/webpack/enhanced-resolve/blob/a998c7d218b7a9ec2461fc4fddd1ad5dd7687485/test/exportsField.test.js#L2976-L3024 - ("should throw error with the `extensionAlias` option", f, "pkg/string.js", ResolveError::ExtensionAlias), - // TODO: The error is PackagePathNotExported in enhanced-resolve - // ("should throw error with the `extensionAlias` option", f.clone(), "pkg/string.js", ResolveError::PackagePathNotExported("node_modules/pkg/dist/string.ts".to_string())), - ]; - - for (comment, path, request, error) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!(resolution, Err(error), "{comment} {path:?} {request}"); - } -} - -// Small script for generating the test cases from enhanced-resolve -// for (c of testCases) { -// console.log("TestCase {") -// console.log(`name: ${JSON.stringify(c.name)},`) -// if (c.expect instanceof Error) { -// console.log(`expect: None,`) -// } else { -// console.log(`expect: Some(vec!${JSON.stringify(c.expect)}),`) -// } -// console.log(`exports_field: exports_field(json!(${JSON.stringify(c.suite[0], null, 2)})),`) -// console.log(`request: "${c.suite[1]}",`) -// console.log(`condition_names: vec!${JSON.stringify(c.suite[2])},`) -// console.log("},") -//} -struct TestCase { - name: &'static str, - expect: Option>, - exports_field: serde_json::Value, - request: &'static str, - condition_names: Vec<&'static str>, -} - -#[allow(clippy::needless_pass_by_value)] -fn exports_field(value: serde_json::Value) -> serde_json::Value { - value -} - -#[test] -fn test_cases() { - let test_cases = [ - TestCase { - name: "sample #1", - expect: Some(vec!["./dist/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/": { - "import": [ - "./dist/", - "./src/" - ], - "webpack": "./wp/" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "sample #1", - expect: Some(vec!["./src/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/": { - "import": [ - "./src/" - ], - "webpack": "./wp/" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - TestCase { - name: "sample #1 (wildcard)", - expect: Some(vec!["./dist/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/*": { - "import": [ - "./dist/*", - "./src/*" - ], - "webpack": "./wp/*" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "sample #1 (wildcard)", - expect: Some(vec!["./src/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/*": { - "import": [ - "./src/*" - ], - "webpack": "./wp/*" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - TestCase { - name: "sample #2", - expect: Some(vec!["./data/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./timezones/": "./data/timezones/" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #2 (wildcard)", - expect: Some(vec!["./data/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./timezones/*": "./data/timezones/*" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #3", - expect: Some(vec!["./data/timezones/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./": "./data/timezones/" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #3 (wildcard)", - expect: Some(vec!["./data/timezones/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./*": "./data/timezones/*.mjs" - })), - request: "./timezones/pdt", - condition_names: vec![], - }, - TestCase { - name: "sample #4", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./lib/": { - "browser": [ - "./browser/" - ] - }, - "./dist/index.js": { - "node": "./index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #4 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "node": "./index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #5", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/": { - "browser": [ - "./browser/" - ] - }, - "./dist/index.js": { - "node": "./index.js", - "default": "./browser/index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #5 (wildcard)", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "node": "./index.js", - "default": "./browser/index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./dist/a": "./dist/index.js" - })), - request: "./dist/aaa", - condition_names: vec![], - }, - TestCase { - name: "sample #7", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./dist/a/a/": "./dist/index.js" - })), - request: "./dist/a/a", - condition_names: vec![], - }, - TestCase { - name: "sample #7 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./dist/a/a/*": "./dist/index.js" - })), - request: "./dist/a/a", - condition_names: vec![], - }, - TestCase { - name: "sample #8", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": "./index.js" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #9", - expect: Some(vec!["./main.js"]), - exports_field: exports_field(json!({ - "./index.js": "./main.js" - })), - request: "./index.js", - condition_names: vec![], - }, - TestCase { - name: "sample #10", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #11", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./bar#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #12", - expect: Some(vec!["./ok.js#abc"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/ok.js#abc", - condition_names: vec![], - }, - TestCase { - name: "sample #12", - expect: Some(vec!["./ok.js#abc"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/ok.js#abc", - condition_names: vec![], - }, - TestCase { - name: "sample #13", - expect: Some(vec!["./ok.js?abc"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/ok.js?abc", - condition_names: vec![], - }, - TestCase { - name: "sample #14", - expect: Some(vec!["./🎉.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/🎉.js", - condition_names: vec![], - }, - TestCase { - name: "sample #15", - expect: Some(vec!["./%F0%9F%8E%89.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/%F0%9F%8E%89.js", - condition_names: vec![], - }, - TestCase { - name: "sample #16", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./🎉", - condition_names: vec![], - }, - TestCase { - name: "sample #17", - expect: Some(vec!["./other.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./%F0%9F%8E%89", - condition_names: vec![], - }, - TestCase { - name: "sample #18", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./module", - condition_names: vec![], - }, - TestCase { - name: "sample #19", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./module#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #20", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./module?foo", - condition_names: vec![], - }, - TestCase { - name: "sample #21", - expect: Some(vec!["./zizizi"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./z*z*z*" - })), - request: "./#zippi", - condition_names: vec![], - }, - TestCase { - name: "sample #22", - expect: Some(vec!["./d?e?f"]), - exports_field: exports_field(json!({ - "./a?b?c/": "./" - })), - request: "./a?b?c/d?e?f", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #1", - expect: Some(vec!["./dist/index.js"]), - exports_field: exports_field(json!({ - ".": "./dist/index.js" - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #2", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./": "./", - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #3", - expect: Some(vec!["./dist/a.js"]), - exports_field: exports_field(json!({ - "./dist/": "./dist/", - "./dist/*": "./dist/*", - "./dist*": "./dist*", - "./dist/index.js": "./dist/a.js" - })), - request: "./dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #4", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./": { - "browser": [ - "./browser/" - ] - }, - "./*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "browser": "./index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #5", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./": { - "browser": [ - "./browser/" - ] - }, - "./*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "node": "./node.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #6", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - ".": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #7", - expect: Some(vec!["./src/index.js"]), // `enhanced_resolve` is `None` - exports_field: exports_field(json!({ - ".": { - "default": "./src/index.js", - "browser": "./index.js", - "node": "./src/node/index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #8", - expect: Some(vec!["./src/index.js"]), - exports_field: exports_field(json!({ - ".": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #9", - expect: Some(vec!["./index"]), - exports_field: exports_field(json!({ - ".": "./index" - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #10", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./index": "./index.js" - })), - request: "./index", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #11", - expect: Some(vec!["./foo.js"]), - exports_field: exports_field(json!({ - "./": "./", - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #12", - expect: Some(vec!["./foo/bar/baz.js"]), - exports_field: exports_field(json!({ - "./": "./", - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo/bar/baz.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #13", - expect: Some(vec!["./foo/bar/baz.js"]), - exports_field: exports_field(json!({ - "./": "./", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo/bar/baz.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #14", - expect: Some(vec!["./foo/bar/baz.js"]), - exports_field: exports_field(json!({ - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo/bar/baz.js", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #1", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "require": "./require.js" - }, { - "import": "./import.mjs" - }] - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #2", - expect: Some(vec!["./import.mjs"]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "require": "./require.js" - }, { - "import": "./import.mjs" - }] - })), - request: ".", - condition_names: vec!["import"], - }, - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./require.js"]), - exports_field: exports_field(json!({ - ".": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./import.mjs"]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "import": "./import.mjs" - }] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./require.js"]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "require": [ - "./require.js" - ] - }, { - "import": [ - "./import.mjs", - "./import.js" - ] - }] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./import.mjs"]), - exports_field: exports_field(json!({ - ".": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "./import.mjs", - "./import.js" - ] - } - ] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./import.js"]), - exports_field: exports_field(json!({ - ".": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "./import.js" - ] - } - ] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "mapping to a folder root #1", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./timezones": "./data/timezones/" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #2", - expect: None, - exports_field: exports_field(json!({ - "./timezones/": "./data/timezones" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #3", - expect: Some(vec!["./data/timezones/pdt/index.mjs"]), - exports_field: exports_field(json!({ - "./timezones/pdt/": "./data/timezones/pdt/" - })), - request: "./timezones/pdt/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #3 (wildcard)", - expect: Some(vec!["./data/timezones/pdt/index.mjs"]), - exports_field: exports_field(json!({ - "./timezones/pdt/*": "./data/timezones/pdt/*" - })), - request: "./timezones/pdt/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #4", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./": "./timezones/" - })), - request: "./pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #4 (wildcard)", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./*": "./timezones/*" - })), - request: "./pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #5", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./": "./" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #5 (wildcard)", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./*": "./*" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #6", - expect: None, - exports_field: exports_field(json!({ - "./": "." - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #6 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "./*": "." - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #7", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": "./" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #7 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": "./*" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #1", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./": "./", - "./dist/": "./lib/" - })), - request: "./dist/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #1 (wildcard)", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./*": "./*", - "./dist/*": "./lib/*" - })), - request: "./dist/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #2", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/": "./dist/utils/", - "./dist/": "./lib/" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #2 (wildcard)", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/*": "./dist/utils/*", - "./dist/*": "./lib/*" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #3", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/index.js": "./dist/utils/index.js", - "./dist/utils/": "./dist/utils/index.mjs", - "./dist/": "./lib/" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #3 (wildcard)", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/index.js": "./dist/utils/index.js", - "./dist/utils/*": "./dist/utils/index.mjs", - "./dist/*": "./lib/*" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #4", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./": { - "browser": "./browser/" - }, - "./dist/": "./lib/" - })), - request: "./dist/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "the longest matching path prefix is prioritized #4 (wildcard)", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./*": { - "browser": "./browser/*" - }, - "./dist/*": "./lib/*" - })), - request: "./dist/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #1", - // `lodash/` does not start with './' so fallbacks to util - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "conditional mapping folder #1", - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": [ - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #1 (wildcard)", - // `lodash/` does not start with './' so fallbacks to util - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": [ - "lodash/*", - "./utils/*" - ], - "node": [ - "./utils-node/*" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "conditional mapping folder #1 (wildcard)", - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": [ - "./utils/*" - ], - "node": [ - "./utils-node/*" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #2", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./node/" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "conditional mapping folder #2 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "webpack": "./wpk/*", - "browser": [ - "lodash/*", - "./utils/*" - ], - "node": [ - "./node/*" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "conditional mapping folder #3", - expect: Some(vec!["./wpk/index.mjs"]), - exports_field: exports_field(json!({ - "./utils/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils/" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "conditional mapping folder #3 (wildcard)", - expect: Some(vec!["./wpk/index.mjs"]), - exports_field: exports_field(json!({ - "./utils/*": { - "webpack": "./wpk/*", - "browser": [ - "lodash/*", - "./utils/*" - ], - "node": [ - "./utils/*" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "incorrect exports field #1", - expect: None, - exports_field: exports_field(json!({ - "/utils/": "./a/" - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #2", - expect: None, - exports_field: exports_field(json!({ - "./utils/": "/a/" - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #3", - expect: None, - exports_field: exports_field(json!({ - "/utils/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #4", - expect: None, - exports_field: exports_field(json!({ - "./utils/": { - "browser": "/a/", - "default": "/b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #4 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "/a/", - "default": "/b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #5", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index": "./a/index.js" - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index.mjs": "./a/index.js" - })), - request: "./utils/index", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #7", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #8", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index.mjs": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - // Requests that are not `./` does not apply to `package_exports_resolve` - // TestCase { - // name: "incorrect request #1", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": "./a/" - // })), - // request: "/utils/index.mjs", - // condition_names: vec![], - // }, - // TestCase { - // name: "incorrect request #2", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": { - // "browser": "./a/", - // "default": "./b/" - // } - // })), - // request: "/utils/index.mjs", - // condition_names: vec!["browser"], - // }, - // TestCase { - // name: "incorrect request #3", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": { - // "browser": "./a/", - // "default": "./b/" - // } - // })), - // request: "../utils/index.mjs", - // condition_names: vec!["browser"], - // }, - // TestCase { - // name: "incorrect request #4", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": { - // "browser": "./a/", - // "default": "./b/" - // } - // })), - // request: "/utils/index.mjs/", - // condition_names: vec!["browser"], - // }, - TestCase { - name: "backtracking package base #1", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./../../utils/": "./dist/" - })), - request: "./../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #1 (wildcard)", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./../../utils/*": "./dist/*" - })), - request: "./../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #2", - expect: None, - exports_field: exports_field(json!({ - "../../utils/": "./dist/" - })), - request: "../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #2 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "../../utils/*": "./dist/*" - })), - request: "../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #3", - expect: None, - exports_field: exports_field(json!({ - "./utils/": "../src/" - })), - request: "./utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #3 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "./utils/*": "../src/*" - })), - request: "./utils/index", - condition_names: vec![], - }, - // enhanced-resolve does not handle backtracking here - // TestCase { - // name: "backtracking package base #4", - // expect: Some(vec!["./../src/index"]), - // exports_field: exports_field(json!({ - // "./utils/": "./../src/" - // })), - // request: "./utils/index", - // condition_names: vec![], - // }, - // TestCase { - // name: "backtracking package base #4 (wildcard)", - // expect: Some(vec!["./../src/index"]), - // exports_field: exports_field(json!({ - // "./utils/*": "./../src/*" - // })), - // request: "./utils/index", - // condition_names: vec![], - // }, - // TestCase { - // name: "backtracking package base #5", - // expect: Some(vec!["./src/../index.js"]), - // exports_field: exports_field(json!({ - // "./utils/index": "./src/../index.js" - // })), - // request: "./utils/index", - // condition_names: vec![], - // }, - TestCase { - name: "backtracking package base #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/../utils/index": "./src/../index.js" - })), - request: "./utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #7", - expect: None, - exports_field: exports_field(json!({ - "./utils/": { - "browser": "../this/" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #7", - expect: None, - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "../this/*" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #8", - // We throw "InvalidPackageTarget" - // expect: Some(vec!["./utils/../index"]), - expect: None, - exports_field: exports_field(json!({ - "./utils/": { - "browser": "./utils/../" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #8 (wildcard)", - // We throw "InvalidPackageTarget" - // expect: Some(vec!["./utils/../index"]), - expect: None, - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "./utils/../*" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #9", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./": "./src/../../", - "./dist/": "./dist/" - })), - request: "./dist/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #9 (wildcard)", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./*": "./src/../../*", - "./dist/*": "./dist/*" - })), - request: "./dist/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking target folder #1", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../../index"]), - exports_field: exports_field(json!({ - "./utils/": "./dist/" - })), - request: "./utils/timezone/../../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #1 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../../index"]), - exports_field: exports_field(json!({ - "./utils/*": "./dist/*" - })), - request: "./utils/timezone/../../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #2", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../index"]), - exports_field: exports_field(json!({ - "./utils/": "./dist/" - })), - request: "./utils/timezone/../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #2 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../index"]), - exports_field: exports_field(json!({ - "./utils/*": "./dist/*" - })), - request: "./utils/timezone/../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #3", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/target/../../index"]), - exports_field: exports_field(json!({ - "./utils/": "./dist/target/" - })), - request: "./utils/../../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #3 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/target/../../index"]), - exports_field: exports_field(json!({ - "./utils/*": "./dist/target/*" - })), - request: "./utils/../../index", - condition_names: vec![], - }, - // enhanced-resolve does not handle `node_modules` in target - TestCase { - name: "nested node_modules path #1", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": "./node_modules/" - } - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #1 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "./node_modules/*" - } - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #2", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./utils/../node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/": "./utils/../node_modules/" - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "nested node_modules path #2 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./utils/../node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": "./utils/../node_modules/*" - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "nested mapping #1", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": "./", - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested mapping #1 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": "./*", - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "nested mapping #2 (wildcard)", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #2 (wildcard)", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "nested mapping #3", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["webpack"], - }, - TestCase { - name: "nested mapping #3 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["webpack"], - }, - TestCase { - name: "nested mapping #4", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["node", "browser"], - }, - TestCase { - name: "nested mapping #4 (wildcard)", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["node", "browser"], - }, - TestCase { - name: "nested mapping #5", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node"], - }, - TestCase { - name: "nested mapping #5 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": { - "webpack": [ - "./wpck/*" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node"], - }, - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - TestCase { - name: "nested mapping #6 (wildcard)", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": { - "webpack": [ - "./wpck/*" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #6 (wildcard)", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./node/*" - ], - "default": { - "node": { - "webpack": [ - "./wpck/*" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - TestCase { - name: "nested mapping #7", - expect: Some(vec!["./y.js"]), - exports_field: exports_field(json!({ - "./a.js": { - "abc": { - "def": "./x.js" - }, - "ghi": "./y.js" - } - })), - request: "./a.js", - condition_names: vec!["abc", "ghi"], - }, - TestCase { - name: "nested mapping #8", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./a.js": { - "abc": { - "def": "./x.js", - "default": [] - }, - "ghi": "./y.js" - } - })), - request: "./a.js", - condition_names: vec!["abc", "ghi"], - }, - TestCase { - name: "syntax sugar #1", - expect: Some(vec!["./main.js"]), - exports_field: exports_field(json!("./main.js")), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #2", - expect: Some(vec![]), - exports_field: exports_field(json!("./main.js")), - request: "./lib.js", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #3", - expect: Some(vec!["./a.js"]), - exports_field: exports_field(json!(["./a.js", "./b.js"])), - request: ".", - condition_names: vec![], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "syntax sugar #3", - expect: Some(vec!["./b.js"]), - exports_field: exports_field(json!(["./b.js"])), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #4", - expect: Some(vec![]), - exports_field: exports_field(json!(["./a.js", "./b.js"])), - request: "./lib.js", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #5", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "browser": { - "default": "./index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "syntax sugar #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "browser": { - "default": "./index.js" - } - })), - request: "./lib.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "syntax sugar #7", - expect: None, - exports_field: exports_field(json!({ - "./node": "./node.js", - "browser": { - "default": "./index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "syntax sugar #8", - expect: None, - exports_field: exports_field(json!({ - "browser": { - "default": "./index.js" - }, - "./node": "./node.js" - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #1", - expect: Some(vec!["./abc/d"]), - exports_field: exports_field(json!({ - "./ab*": "./ab/*", - "./abc*": "./abc/*", - "./a*": "./a/*" - })), - request: "./abcd", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #2", - expect: Some(vec!["./abc/d/e"]), - exports_field: exports_field(json!({ - "./ab*": "./ab/*", - "./abc*": "./abc/*", - "./a*": "./a/*" - })), - request: "./abcd/e", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #3", - expect: Some(vec!["./abc/d"]), - exports_field: exports_field(json!({ - "./x/ab*": "./ab/*", - "./x/abc*": "./abc/*", - "./x/a*": "./a/*" - })), - request: "./x/abcd", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #4", - expect: Some(vec!["./abc/d/e"]), - exports_field: exports_field(json!({ - "./x/ab*": "./ab/*", - "./x/abc*": "./abc/*", - "./x/a*": "./a/*" - })), - request: "./x/abcd/e", - condition_names: vec!["browser"], - }, - TestCase { - name: "path tree edge case #1", - expect: Some(vec!["./A/b/d.js"]), - exports_field: exports_field(json!({ - "./a/": "./A/", - "./a/b/c": "./c.js" - })), - request: "./a/b/d.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #1 (wildcard)", - expect: Some(vec!["./A/b/d.js"]), - exports_field: exports_field(json!({ - "./a/*": "./A/*", - "./a/b/c": "./c.js" - })), - request: "./a/b/d.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #2", - expect: Some(vec!["./A/c.js"]), - exports_field: exports_field(json!({ - "./a/": "./A/", - "./a/b": "./b.js" - })), - request: "./a/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #2 (wildcard)", - expect: Some(vec!["./A/c.js"]), - exports_field: exports_field(json!({ - "./a/*": "./A/*", - "./a/b": "./b.js" - })), - request: "./a/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #3", - expect: Some(vec!["./A/b/d/c.js"]), - exports_field: exports_field(json!({ - "./a/": "./A/", - "./a/b/c/d": "./c.js" - })), - request: "./a/b/d/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #3 (wildcard)", - expect: Some(vec!["./A/b/d/c.js"]), - exports_field: exports_field(json!({ - "./a/*": "./A/*", - "./a/b/c/d": "./c.js" - })), - request: "./a/b/d/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #1", - expect: Some(vec!["./A/b.js"]), - exports_field: exports_field(json!({ - "./a/*.js": "./A/*.js" - })), - request: "./a/b.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #2", - expect: Some(vec!["./A/b/c.js"]), - exports_field: exports_field(json!({ - "./a/*.js": "./A/*.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #3", - expect: Some(vec!["./A/b/c.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": "./A/*/c.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #4", - expect: Some(vec!["./A/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": "./A/*/*.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #5", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/*.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #5", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/*.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./lib/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #6", - expect: Some(vec!["./browser/foo/bar.js"]), - exports_field: exports_field(json!({ - "./lib/*/bar.js": { - "browser": [ - "./browser/*/bar.js" - ] - }, - "./dist/*/bar.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./lib/foo/bar.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #6", - expect: Some(vec!["./browser/foo.js"]), - exports_field: exports_field(json!({ - "./lib/*/bar.js": { - "browser": [ - "./browser/*/bar.js" - ] - }, - "./dist/*/bar.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./dist/foo/bar.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #7", - expect: Some(vec!["./browser/foo/default.js"]), - exports_field: exports_field(json!({ - "./lib/*/bar.js": { - "browser": [ - "./browser/*/bar.js" - ] - }, - "./dist/*/bar.js": { - "node": "./*.js", - "default": "./browser/*/default.js" - } - })), - request: "./dist/foo/bar.js", - condition_names: vec!["default"], - }, - TestCase { - name: "wildcard pattern #8", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": "./A/*/*/*.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #9", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": [ - "./A/*/*/*.js", - "./B/*/*/*.js" - ] - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "wildcard pattern #9", - expect: Some(vec!["./B/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": [ - "./B/*/*/*.js" - ] - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #10", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/foo-*/c.js": "./A/*/*/*.js" - })), - request: "./a/foo-b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #11", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*-foo/c.js": "./A/*/*/*.js" - })), - request: "./a/b-foo/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #12", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/foo-*-foo/c.js": "./A/*/*/*.js" - })), - request: "./a/foo-b-foo/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #13", - expect: Some(vec!["./A/b/c/d.js"]), - exports_field: exports_field(json!({ - "./a/foo-*-foo/c.js": "./A/b/c/d.js" - })), - request: "./a/foo-b-foo/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #14", - expect: Some(vec!["./A/b/c/*.js"]), - exports_field: exports_field(json!({ - "./a/foo-foo/c.js": "./A/b/c/*.js" - })), - request: "./a/foo-foo/c.js", - condition_names: vec![], - }, - ]; - - for case in test_cases { - let resolved = Resolver::new(ResolveOptions { - condition_names: case - .condition_names - .iter() - .map(ToString::to_string) - .collect::>(), - ..ResolveOptions::default() - }) - .package_exports_resolve( - Path::new(""), - case.request, - &case.exports_field, - &mut Ctx::default(), - ) - .map(|p| p.map(|p| p.to_path_buf())); - if let Some(expect) = case.expect { - if expect.is_empty() { - assert!( - matches!(resolved, Err(ResolveError::PackagePathNotExported(_, _))), - "{} {:?}", - &case.name, - &resolved - ); - } else { - for expect in expect { - assert_eq!(resolved, Ok(Some(Path::new(expect).normalize())), "{}", &case.name); - } - } - } else { - assert!(resolved.is_err(), "{} {resolved:?}", &case.name); - } - } -} diff --git a/src/tests/extension_alias.rs b/src/tests/extension_alias.rs deleted file mode 100644 index 86afab73..00000000 --- a/src/tests/extension_alias.rs +++ /dev/null @@ -1,66 +0,0 @@ -//! - -use crate::{ResolveError, ResolveOptions, Resolver}; - -#[test] -fn extension_alias() { - let f = super::fixture().join("extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - extension_alias: vec![ - (".js".into(), vec![".ts".into(), ".js".into()]), - (".mjs".into(), vec![".mts".into()]), - ], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should alias fully specified file", f.clone(), "./index.js", f.join("index.ts")), - ("should alias fully specified file when there are two alternatives", f.clone(), "./dir/index.js", f.join("dir/index.ts")), - ("should also allow the second alternative", f.clone(), "./dir2/index.js", f.join("dir2/index.js")), - ("should support alias option without an array", f.clone(), "./dir2/index.mjs", f.join("dir2/index.mts")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } - - #[rustfmt::skip] - let fail = [ - ("should not allow to fallback to the original extension or add extensions", f, "./index.mjs"), - ]; - - for (comment, path, request) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!(resolution, Err(ResolveError::ExtensionAlias), "{comment} {path:?} {request}"); - } -} - -// should not apply extension alias to extensions or mainFiles field -#[test] -fn not_apply_to_extension_nor_main_files() { - let f = super::fixture().join("extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - extension_alias: vec![(".js".into(), vec![])], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("directory", f.clone(), "./dir2", "dir2/index.js"), - ("file", f.clone(), "./dir2/index", "dir2/index.js"), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - let expected = f.join(expected); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} diff --git a/src/tests/extensions.rs b/src/tests/extensions.rs deleted file mode 100644 index 1ebd86f4..00000000 --- a/src/tests/extensions.rs +++ /dev/null @@ -1,125 +0,0 @@ -//! - -use crate::{EnforceExtension, Resolution, ResolveContext, ResolveError, ResolveOptions, Resolver}; -use rustc_hash::FxHashSet; - -#[test] -fn extensions() { - let f = super::fixture().join("extensions"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".ts".into(), ".js".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve according to order of provided extensions", "./foo", "foo.ts"), - ("should resolve according to order of provided extensions (dir index)", "./dir", "dir/index.ts"), - ("should resolve according to main field in module root", ".", "index.js"), - // This is a core module - // ("should resolve single file module before directory", "module", "node_modules/module.js"), - ("should resolve trailing slash directory before single file", "module/", "node_modules/module/index.ts"), - ]; - - for (comment, request, expected_path) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - let expected = f.join(expected_path); - assert_eq!(resolved_path, Ok(expected), "{comment} {request} {expected_path}"); - } - - #[rustfmt::skip] - let fail = [ - ("not resolve to file when request has a trailing slash (relative)", "./foo.js/", "./foo.js/".into()) - ]; - - for (comment, request, expected_error) in fail { - let resolution = resolver.resolve(&f, request); - let error = ResolveError::NotFound(expected_error); - assert_eq!(resolution, Err(error), "{comment} {request} {resolution:?}"); - } -} - -// should default enforceExtension to true when extensions includes an empty string -#[test] -fn default_enforce_extension() { - let f = super::fixture().join("extensions"); - - let mut ctx = ResolveContext::default(); - let resolved = Resolver::new(ResolveOptions { - extensions: vec![".ts".into(), String::new(), ".js".into()], - ..ResolveOptions::default() - }) - .resolve_with_context(&f, "./foo", &mut ctx); - - assert_eq!(resolved.map(Resolution::into_path_buf), Ok(f.join("foo.ts"))); - assert_eq!( - ctx.file_dependencies, - FxHashSet::from_iter([f.join("foo.ts"), f.join("package.json")]) - ); - assert!(ctx.missing_dependencies.is_empty()); -} - -// should respect enforceExtension when extensions includes an empty string -#[test] -fn respect_enforce_extension() { - let f = super::fixture().join("extensions"); - - let mut ctx = ResolveContext::default(); - let resolved = Resolver::new(ResolveOptions { - enforce_extension: EnforceExtension::Disabled, - extensions: vec![".ts".into(), String::new(), ".js".into()], - ..ResolveOptions::default() - }) - .resolve_with_context(&f, "./foo", &mut ctx); - - assert_eq!(resolved.map(Resolution::into_path_buf), Ok(f.join("foo.ts"))); - assert_eq!( - ctx.file_dependencies, - FxHashSet::from_iter([f.join("foo.ts"), f.join("package.json")]) - ); - assert_eq!(ctx.missing_dependencies, FxHashSet::from_iter([f.join("foo")])); -} - -#[test] -fn multi_dot_extension() { - let f = super::fixture().join("extensions"); - - let resolver = Resolver::new(ResolveOptions { - // Test for `.d.ts`, not part of enhanced-resolve. - extensions: vec![".a.b.c".into(), ".d.ts".into(), ".ts".into(), ".js".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve according to order of provided extensions", "./foo", "foo.ts"), - ("should resolve file with extension", "./app.module", "app.module.js") - ]; - - for (comment, request, expected_path) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - let expected = f.join(expected_path); - assert_eq!(resolved_path, Ok(expected), "{comment} {request} {expected_path}"); - } - - #[rustfmt::skip] - let fail = [ - ("not resolve to file", "./index.", "./index.".into()) - ]; - - for (comment, request, expected_error) in fail { - let resolution = resolver.resolve(&f, request); - let error = ResolveError::NotFound(expected_error); - assert_eq!(resolution, Err(error), "{comment} {request} {resolution:?}"); - } -} - -#[test] -#[should_panic = "All extensions must start with a leading dot"] -fn without_leading_dot() { - Resolver::new(ResolveOptions { - extensions: vec!["ts".into(), "js".into()], - ..ResolveOptions::default() - }); -} diff --git a/src/tests/fallback.rs b/src/tests/fallback.rs deleted file mode 100644 index 3da2d767..00000000 --- a/src/tests/fallback.rs +++ /dev/null @@ -1,100 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/fallback.test.js - -#[test] -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -fn fallback() { - use super::memory_fs::MemoryFS; - use crate::{AliasValue, ResolveError, ResolveOptions, ResolverGeneric}; - use std::path::{Path, PathBuf}; - - let f = Path::new("/"); - - let file_system = MemoryFS::new(&[ - ("/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", ""), - ]); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - fallback: vec![ - ("aliasA".into(), vec![AliasValue::Path("a".into())]), - ("b$".into(), vec![AliasValue::Path("a/index".into())]), - ("c$".into(), vec![AliasValue::Path("/a/index".into())]), - ( - "multiAlias".into(), - vec![ - AliasValue::Path("b".into()), - AliasValue::Path("c".into()), - AliasValue::Path("d".into()), - AliasValue::Path("e".into()), - AliasValue::Path("a".into()), - ], - ), - ("recursive".into(), vec![AliasValue::Path("recursive/dir".into())]), - ("/d/dir".into(), vec![AliasValue::Path("/c/dir".into())]), - ("/d/index.js".into(), vec![AliasValue::Path("/c/index".into())]), - ("ignored".into(), vec![AliasValue::Ignore]), - ("node:path".into(), vec![AliasValue::Ignore]), - ], - modules: vec!["/".into()], - ..ResolveOptions::default() - }, - ); - - #[rustfmt::skip] - let pass = [ - ("should resolve a not aliased module 1", "a", "/a/index"), - ("should resolve a not aliased module 2", "a/index", "/a/index"), - ("should resolve a not aliased module 3", "a/dir", "/a/dir/index"), - ("should resolve a not aliased module 4", "a/dir/index", "/a/dir/index"), - ("should resolve an fallback module 1", "aliasA", "/a/index"), - ("should resolve an fallback module 2", "aliasA/index", "/a/index"), - ("should resolve an fallback module 3", "aliasA/dir", "/a/dir/index"), - ("should resolve an fallback module 4", "aliasA/dir/index", "/a/dir/index"), - ("should resolve a recursive aliased module 1", "recursive", "/recursive/index"), - ("should resolve a recursive aliased module 2", "recursive/index", "/recursive/index"), - ("should resolve a recursive aliased module 3", "recursive/dir", "/recursive/dir/index"), - ("should resolve a recursive aliased module 4", "recursive/dir/index", "/recursive/dir/index"), - ("should resolve a recursive aliased module 5", "recursive/file", "/recursive/dir/file"), - ("should resolve a file aliased module with a query 1", "b?query", "/b/index?query"), - ("should resolve a file aliased module with a query 2", "c?query", "/c/index?query"), - ("should resolve a path in a file aliased module 1", "b/index", "/b/index"), - ("should resolve a path in a file aliased module 2", "b/dir", "/b/dir/index"), - ("should resolve a path in a file aliased module 3", "b/dir/index", "/b/dir/index"), - ("should resolve a path in a file aliased module 4", "c/index", "/c/index"), - ("should resolve a path in a file aliased module 5", "c/dir", "/c/dir/index"), - ("should resolve a path in a file aliased module 6", "c/dir/index", "/c/dir/index"), - ("should resolve a file in multiple aliased dirs 1", "multiAlias/dir/file", "/e/dir/file"), - ("should resolve a file in multiple aliased dirs 2", "multiAlias/anotherDir", "/e/anotherDir/index"), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - - #[rustfmt::skip] - let ignore = [ - ("should resolve an ignore module", "ignored", ResolveError::Ignored(f.join("ignored"))), - ("should resolve node: builtin module", "node:path", ResolveError::Ignored(PathBuf::from("/node:path"))), - ]; - - for (comment, request, expected) in ignore { - let resolution = resolver.resolve(f, request); - assert_eq!(resolution, Err(expected), "{comment} {request}"); - } -} diff --git a/src/tests/full_specified.rs b/src/tests/full_specified.rs deleted file mode 100644 index a70c0191..00000000 --- a/src/tests/full_specified.rs +++ /dev/null @@ -1,113 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/fullSpecified.test.js - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows { - use std::path::PathBuf; - - use crate::{AliasValue, ResolveOptions, ResolverGeneric}; - - use super::super::memory_fs::MemoryFS; - - fn file_system() -> MemoryFS { - MemoryFS::new(&[ - ("/a/node_modules/package1/index.js", ""), - ("/a/node_modules/package1/file.js", ""), - ("/a/node_modules/package2/package.json", r#"{"main":"a"}"#), - ("/a/node_modules/package2/a.js", ""), - ("/a/node_modules/package3/package.json", r#"{"main":"dir"}"#), - ("/a/node_modules/package3/dir/index.js", ""), - ("/a/node_modules/package4/package.json", r#"{"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", ""), - ]) - } - - #[test] - fn test() { - let file_system = file_system(); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - alias: vec![ - ("alias1".into(), vec![AliasValue::from("/a/abc")]), - ("alias2".into(), vec![AliasValue::from("/a")]), - ], - alias_fields: vec![vec!["browser".into()]], - fully_specified: true, - ..ResolveOptions::default() - }, - ); - - let failing_resolves = [ - ("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"), - ]; - - for (comment, request) in failing_resolves { - let resolution = resolver.resolve("/a", request); - assert!(resolution.is_err(), "{comment} {request}"); - } - - let successful_resolves = [ - ("fully relative", "./abc.js", "/a/abc.js"), - ("fully absolute", "/a/abc.js", "/a/abc.js"), - ("fully relative in package", "package1/file.js", "/a/node_modules/package1/file.js"), - ("extensions in mainFiles", "package1", "/a/node_modules/package1/index.js"), - ("extensions in mainFields", "package2", "/a/node_modules/package2/a.js"), - ("extensions in alias", "alias1", "/a/abc.js"), - ("directories in alias", "alias2", "/a/index.js"), - ("directories in packages", "package3", "/a/node_modules/package3/dir/index.js"), - ("extensions in aliasFields", "package4/a.js", "/a/node_modules/package4/b.js"), - ]; - - for (comment, request, expected) in successful_resolves { - let resolution = resolver.resolve("/a", request).map(|r| r.full_path()); - assert_eq!(resolution, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - } - - #[test] - #[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. - fn resolve_to_context() { - let file_system = file_system(); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - alias: vec![ - ("alias1".into(), vec![AliasValue::from("/a/abc")]), - ("alias2".into(), vec![AliasValue::from("/a")]), - ], - alias_fields: vec![vec!["browser".into()]], - fully_specified: true, - resolve_to_context: true, - ..ResolveOptions::default() - }, - ); - - let successful_resolves = [ - ("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", "/a/node_modules/package3/dir"), - ]; - - for (comment, request, expected) in successful_resolves { - let resolution = resolver.resolve("/a", request).map(|r| r.full_path()); - assert_eq!(resolution, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - } -} diff --git a/src/tests/imports_field.rs b/src/tests/imports_field.rs deleted file mode 100644 index c928627a..00000000 --- a/src/tests/imports_field.rs +++ /dev/null @@ -1,1320 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/importsField.test.js -//! -//! The huge imports field test cases are at the bottom of this file. - -use serde_json::json; - -use crate::{Ctx, JSONMap, PathUtil, ResolveError, ResolveOptions, Resolver}; -use std::path::Path; - -#[test] -fn test_simple() { - let f = super::fixture().join("imports-field"); - let f2 = super::fixture().join("imports-exports-wildcard/node_modules/m/"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve using imports field instead of self-referencing", f.clone(), "#imports-field", f.join("b.js")), - ("should resolve using imports field instead of self-referencing for a subpath", f.join("dir"), "#imports-field", f.join("b.js")), - ("should resolve package #1", f.clone(), "#a/dist/main.js", f.join("node_modules/a/lib/lib2/main.js")), - ("should resolve package #3", f.clone(), "#ccc/index.js", f.join("node_modules/c/index.js")), - ("should resolve package #4", f.clone(), "#c", f.join("node_modules/c/index.js")), - ("should resolve with wildcard pattern", f2.clone(), "#internal/i.js", f2.join("src/internal/i.js")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } - - // Note added: - // * should resolve absolute path as an imports field target - // * should log the correct info - - #[rustfmt::skip] - let fail = [ - ("should disallow resolve out of package scope", f.clone(), "#b", ResolveError::InvalidPackageTarget("../b.js".to_string(), "#b".to_string(), f.join("package.json"))), - ("should resolve package #2", f.clone(), "#a", ResolveError::PackageImportNotDefined("#a".to_string(), f.join("package.json"))), - ]; - - for (comment, path, request, error) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!(resolution, Err(error), "{comment} {path:?} {request}"); - } -} - -#[test] -fn shared_resolvers() { - let f = super::fixture().join("imports-field"); - - // field name #1 - let resolver1 = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - imports_fields: vec![vec!["imports".into()]], - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - let resolved_path = resolver1.resolve(&f, "#imports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("b.js"))); - - // field name #2 - let resolver2 = resolver1.clone_with_options(ResolveOptions { - imports_fields: vec![vec!["other".into(), "imports".into()]], - ..ResolveOptions::default() - }); - - let resolved_path = resolver2.resolve(&f, "#b").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("a.js"))); -} - -// Small script for generating the test cases from enhanced_resolve -// for (c of testCases) { -// console.log("TestCase {") -// console.log(`name: ${JSON.stringify(c.name)},`) -// if (c.expect instanceof Error) { -// console.log(`expect: None,`) -// } else { -// console.log(`expect: Some(vec!${JSON.stringify(c.expect)}),`) -// } -// console.log(`imports_field: imports_field(json!(${JSON.stringify(c.suite[0], null, 2)})),`) -// console.log(`request: "${c.suite[1]}",`) -// console.log(`condition_names: vec!${JSON.stringify(c.suite[2])},`) -// console.log("},") -// } - -struct TestCase { - name: &'static str, - expect: Option>, - imports_field: JSONMap, - request: &'static str, - condition_names: Vec<&'static str>, -} - -#[allow(clippy::needless_pass_by_value)] -fn imports_field(value: serde_json::Value) -> JSONMap { - let s = serde_json::to_string(&value).unwrap(); - serde_json::from_str(&s).unwrap() -} - -#[test] -fn test_cases() { - let test_cases = [ - TestCase { - name: "sample #1", - expect: Some(vec!["./dist/test/file.js"]), - imports_field: imports_field(json!({ - "#abc/": { - "import": [ - "./dist/", - "./src/" - ], - "webpack": "./wp/" - }, - "#abc": "./main.js" - })), - request: "#abc/test/file.js", - condition_names: vec!["import", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "sample #1", - expect: Some(vec!["./src/test/file.js"]), - imports_field: imports_field(json!({ - "#abc/": { - "import": [ - "./src/" - ], - "webpack": "./wp/" - }, - "#abc": "./main.js" - })), - request: "#abc/test/file.js", - condition_names: vec!["import", "webpack"], - }, - TestCase { - name: "sample #2", - expect: Some(vec!["./data/timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#1/timezones/": "./data/timezones/" - })), - request: "#1/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #3", - expect: Some(vec!["./data/timezones/timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#aaa/": "./data/timezones/", - "#a/": "./data/timezones/" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #4", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/lib/": { - "browser": [ - "./browser/" - ] - }, - "#a/dist/index.js": { - "node": "./index.js" - } - })), - request: "#a/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #5", - expect: Some(vec!["./browser/index.js"]), - imports_field: imports_field(json!({ - "#a/lib/": { - "browser": [ - "./browser/" - ] - }, - "#a/dist/index.js": { - "node": "./index.js", - "default": "./browser/index.js" - } - })), - request: "#a/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #6", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/dist/a": "./dist/index.js" - })), - request: "#a/dist/aaa", - condition_names: vec![], - }, - TestCase { - name: "sample #7", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/a/a/": "./dist/index.js" - })), - request: "#a/a/a", - condition_names: vec![], - }, - TestCase { - name: "sample #8", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": "./index.js" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #9", - expect: Some(vec!["./main.js"]), - imports_field: imports_field(json!({ - "#a/index.js": "./main.js" - })), - request: "#a/index.js", - condition_names: vec![], - }, - TestCase { - name: "sample #10", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #11", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/bar#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #12", - expect: Some(vec!["./ok.js#abc"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/ok.js#abc", - condition_names: vec![], - }, - TestCase { - name: "sample #13", - expect: Some(vec!["./ok.js?abc"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/ok.js?abc", - condition_names: vec![], - }, - TestCase { - name: "sample #14", - expect: Some(vec!["./🎉.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/🎉.js", - condition_names: vec![], - }, - TestCase { - name: "sample #15", - expect: Some(vec!["./%F0%9F%8E%89.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/%F0%9F%8E%89.js", - condition_names: vec![], - }, - TestCase { - name: "sample #16", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/🎉", - condition_names: vec![], - }, - TestCase { - name: "sample #17", - expect: Some(vec!["./other.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/%F0%9F%8E%89", - condition_names: vec![], - }, - TestCase { - name: "sample #18", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/module", - condition_names: vec![], - }, - TestCase { - name: "sample #19", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/module#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #20", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/module?foo", - condition_names: vec![], - }, - TestCase { - name: "sample #21", - expect: Some(vec!["./d?e?f"]), - imports_field: imports_field(json!({ - "#a/a?b?c/": "./" - })), - request: "#a/a?b?c/d?e?f", - condition_names: vec![], - }, - TestCase { - name: "sample #22", - // We throw InvalidPackageTarget - expect: None, - // expect: Some(vec!["/user/a/index"]), - imports_field: imports_field(json!({ - "#a/": "/user/a/" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #1", - expect: Some(vec!["./A/b/d.js"]), - imports_field: imports_field(json!({ - "#a/": "./A/", - "#a/b/c": "./c.js" - })), - request: "#a/b/d.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #2", - expect: Some(vec!["./A/c.js"]), - imports_field: imports_field(json!({ - "#a/": "./A/", - "#a/b": "./b.js" - })), - request: "#a/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #3", - expect: Some(vec!["./A/b/c/d.js"]), - imports_field: imports_field(json!({ - "#a/": "./A/", - "#a/b/c/d": "./c.js" - })), - request: "#a/b/c/d.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #1", - expect: Some(vec!["./dist/index.js"]), - imports_field: imports_field(json!({ - "#a": "./dist/index.js" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #2", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": "./" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #3", - expect: Some(vec!["./dist/a.js"]), - imports_field: imports_field(json!({ - "#a/": "./dist/", - "#a/index.js": "./dist/a.js" - })), - request: "#a/index.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #4", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "./browser/" - ] - }, - "#a/index.js": { - "browser": "./index.js" - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #5", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "./browser/" - ] - }, - "#a/index.js": { - "node": "./node.js" - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #6", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: "#a", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #7", - expect: Some(vec!["./src/index.js"]), // `enhanced_resolve` is `None` - imports_field: imports_field(json!({ - "#a": { - "default": "./src/index.js", - "browser": "./index.js", - "node": "./src/node/index.js" - } - })), - request: "#a", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #8", - expect: Some(vec!["./src/index.js"]), - imports_field: imports_field(json!({ - "#a": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #9", - expect: Some(vec!["./index"]), - imports_field: imports_field(json!({ - "#a": "./index" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #10", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/index": "./index.js" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #11", - // We throw InvalidPackageTarget - // expect: Some(vec!["b"]), - expect: None, - imports_field: imports_field(json!({ - "#a": "b" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #12", - // We throw InvalidPackageTarget - // expect: Some(vec!["b/index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "b/" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #13", - // We throw InvalidPackageTarget - // expect: Some(vec!["b#anotherhashishere"]), - expect: None, - imports_field: imports_field(json!({ - "#a?q=a#hashishere": "b#anotherhashishere" - })), - request: "#a?q=a#hashishere", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #1", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #2", - expect: Some(vec!["./import.mjs"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec!["import"], - }, - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./require.js"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./import.mjs"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./require.js"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": [ - "./require.js" - ] - }, - { - "import": [ - "./import.mjs", - "#b/import.js" - ] - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./import.mjs"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "./import.mjs", - "#b/import.js" - ] - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "#b/import.js" - ] - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "mapping to a folder root #1", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#timezones": "./data/timezones/" - })), - request: "#timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #2", - expect: None, - imports_field: imports_field(json!({ - "#timezones/": "./data/timezones" - })), - request: "#timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #3", - expect: Some(vec!["./data/timezones/pdt/index.mjs"]), - imports_field: imports_field(json!({ - "#timezones/pdt/": "./data/timezones/pdt/" - })), - request: "#timezones/pdt/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #4", - expect: Some(vec!["./timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#a/": "./timezones/" - })), - request: "#a/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #5", - expect: Some(vec!["./timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#a/": "./" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #6", - expect: None, - imports_field: imports_field(json!({ - "#a/": "." - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #7", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": "./" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #1", - expect: Some(vec!["./lib/index.mjs"]), - imports_field: imports_field(json!({ - "#a/": "./", - "#a/dist/": "./lib/" - })), - request: "#a/dist/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #2", - expect: Some(vec!["./dist/utils/index.js"]), - imports_field: imports_field(json!({ - "#a/dist/utils/": "./dist/utils/", - "#a/dist/": "./lib/" - })), - request: "#a/dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #3", - expect: Some(vec!["./dist/utils/index.js"]), - imports_field: imports_field(json!({ - "#a/dist/utils/index.js": "./dist/utils/index.js", - "#a/dist/utils/": "./dist/utils/index.mjs", - "#a/dist/": "./lib/" - })), - request: "#a/dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #4", - expect: Some(vec!["./lib/index.mjs"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./browser/" - }, - "#a/dist/": "./lib/" - })), - request: "#a/dist/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #1", - // This behaves differently from enhanced_resolve, because `lodash/` is an an InvalidPackageConfig - // expect: Some(vec!["lodash/index.js"]), - expect: Some(vec!["./utils/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "conditional mapping folder #1", - expect: Some(vec!["./utils/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #2", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./node/" - ] - } - })), - request: "#a/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "conditional mapping folder #3", - expect: Some(vec!["./wpk/index.mjs"]), - imports_field: imports_field(json!({ - "#a/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils/" - ] - } - })), - request: "#a/index.mjs", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "incorrect exports field #1", - // We throw `PackageImportNotDefined` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "/utils/": "./a/" - })), - request: "#a/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #2", - // We throw `PackageImportNotDefined` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "/utils/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#a/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #3", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index": "./a/index.js" - })), - request: "#a/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #4", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index.mjs": "./a/index.js" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #5", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "#a/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #6", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index.mjs": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "#a/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #1", - // We don't throw in `package_imports_exports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": "./a/" - })), - request: "/utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect request #2", - // We don't throw in `package_imports_exports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #3", - // We don't throw in `package_imports_exports_resolve`, it's thrown in `package_imports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #4", - // We don't throw in `package_imports_exports_resolve`, it's thrown in `package_imports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#/", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #5", - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#a/", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #1", - // expect: Some(vec!["./dist/index"]), - expect: Some(vec!["dist/index"]), - imports_field: imports_field(json!({ - "#a/../../utils/": "./dist/" - })), - request: "#a/../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #2", - // We throw InvalidPackageTarget - // expect: Some(vec!["./dist/../../utils/index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "./dist/" - })), - request: "#a/../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #3", - // We throw InvalidPackageTarget - // expect: Some(vec!["../src/index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "../src/" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #4", - // We throw InvalidPackageTarget - // expect: Some(vec!["./utils/../../../index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": { - "browser": "./utils/../../../" - } - })), - request: "#a/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #1", - // expect: Some(vec!["moment/node_modules/lodash/dist/index.js"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": { - "browser": "moment/node_modules/" - } - })), - request: "#a/lodash/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #2", - // We throw InvalidPackageTarget - // expect: Some(vec!["../node_modules/lodash/dist/index.js"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "../node_modules/" - })), - request: "#a/lodash/dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "nested mapping #1", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": "./", - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./node/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "nested mapping #3", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["webpack"], - }, - TestCase { - name: "nested mapping #4", - // We throw NotFound - // expect: Some(vec!["moment/node/index.js"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "moment/node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["node", "browser"], - }, - TestCase { - name: "nested mapping #5", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "node"], - }, - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./node/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - TestCase { - name: "nested mapping #7", - expect: Some(vec!["./y.js"]), - imports_field: imports_field(json!({ - "#a": { - "abc": { - "def": "./x.js" - }, - "ghi": "./y.js" - } - })), - request: "#a", - condition_names: vec!["abc", "ghi"], - }, - TestCase { - name: "nested mapping #8", - // We throw PackageImportNotDefined - // expect: Some(vec![]), - expect: None, - imports_field: imports_field(json!({ - "#a": { - "abc": { - "def": "./x.js", - "default": [] - }, - "ghi": "./y.js" - } - })), - request: "#a", - condition_names: vec!["abc", "ghi"], - }, - ]; - - for case in test_cases { - let resolved = Resolver::default() - .package_imports_exports_resolve( - case.request, - &case.imports_field, - Path::new(""), - true, - &case.condition_names.iter().map(ToString::to_string).collect::>(), - &mut Ctx::default(), - ) - .map(|p| p.map(|p| p.to_path_buf())); - if let Some(expect) = case.expect { - if expect.is_empty() { - assert!(matches!(resolved, Ok(None)), "{} {:?}", &case.name, &resolved); - } else { - for expect in expect { - assert_eq!(resolved, Ok(Some(Path::new(expect).normalize())), "{}", &case.name); - } - } - } else { - assert!(resolved.is_err(), "{} {resolved:?}", &case.name); - } - } -} diff --git a/src/tests/incorrect_description_file.rs b/src/tests/incorrect_description_file.rs deleted file mode 100644 index e2caecbb..00000000 --- a/src/tests/incorrect_description_file.rs +++ /dev/null @@ -1,65 +0,0 @@ -//! - -use rustc_hash::FxHashSet; - -use crate::{JSONError, Resolution, ResolveContext, ResolveError, ResolveOptions, Resolver}; - -// should not resolve main in incorrect description file #1 -#[test] -fn incorrect_description_file_1() { - let f = super::fixture().join("incorrect-package"); - let mut ctx = ResolveContext::default(); - let resolution = Resolver::default().resolve_with_context(f.join("pack1"), ".", &mut ctx); - let error = ResolveError::JSON(JSONError { - path: f.join("pack1/package.json"), - message: String::from("EOF while parsing a value at line 3 column 0"), - line: 3, - column: 0, - }); - assert_eq!(resolution, Err(error)); - assert_eq!( - ctx.file_dependencies, - FxHashSet::from_iter([f.join("pack1"), f.join("pack1/package.json")]) - ); - assert!(!ctx.missing_dependencies.is_empty()); -} - -// should not resolve main in incorrect description file #2 -#[test] -fn incorrect_description_file_2() { - let f = super::fixture().join("incorrect-package"); - let resolution = Resolver::default().resolve(f.join("pack2"), "."); - let error = ResolveError::JSON(JSONError { - path: f.join("pack2/package.json"), - message: String::from("EOF while parsing a value at line 1 column 0"), - line: 1, - column: 0, - }); - assert_eq!(resolution, Err(error)); -} - -// should not resolve main in incorrect description file #3 -#[test] -fn incorrect_description_file_3() { - let f = super::fixture().join("incorrect-package"); - let resolution = Resolver::default().resolve(f.join("pack2"), "."); - assert!(resolution.is_err()); -} - -// `enhanced_resolve` does not have this test case -#[test] -fn no_description_file() { - let f = super::fixture_root().join("enhanced_resolve"); - - // has description file - let resolver = Resolver::default(); - assert_eq!( - resolver.resolve(&f, ".").map(Resolution::into_path_buf), - Ok(f.join("lib/index.js")) - ); - - // without description file - let resolver = - Resolver::new(ResolveOptions { description_files: vec![], ..ResolveOptions::default() }); - assert_eq!(resolver.resolve(&f, "."), Err(ResolveError::NotFound(".".into()))); -} diff --git a/src/tests/main_field.rs b/src/tests/main_field.rs deleted file mode 100644 index 3cadc8ce..00000000 --- a/src/tests/main_field.rs +++ /dev/null @@ -1,24 +0,0 @@ -//! Not part of enhanced_resolve's test suite - -use crate::{ResolveOptions, Resolver}; - -#[test] -fn test() { - let f = super::fixture().join("restrictions"); - - let resolver1 = Resolver::new(ResolveOptions { - main_fields: vec!["style".into()], - ..ResolveOptions::default() - }); - - let resolution = resolver1.resolve(&f, "pck2").map(|r| r.full_path()); - assert_eq!(resolution, Ok(f.join("node_modules/pck2/index.css"))); - - let resolver2 = resolver1.clone_with_options(ResolveOptions { - main_fields: vec!["module".into(), "main".into()], - ..ResolveOptions::default() - }); - - let resolution = resolver2.resolve(&f, "pck2").map(|r| r.full_path()); - assert_eq!(resolution, Ok(f.join("node_modules/pck2/module.js"))); -} diff --git a/src/tests/memory_fs.rs b/src/tests/memory_fs.rs deleted file mode 100644 index e4116609..00000000 --- a/src/tests/memory_fs.rs +++ /dev/null @@ -1,74 +0,0 @@ -use std::{ - io, - path::{Path, PathBuf}, -}; - -use crate::{FileMetadata, FileSystem}; - -#[derive(Default)] -pub struct MemoryFS { - fs: vfs::MemoryFS, -} - -impl MemoryFS { - /// # Panics - /// - /// * Fails to create directory - /// * Fails to write file - #[allow(dead_code)] - pub fn new(data: &[(&'static str, &'static str)]) -> Self { - let mut fs = Self { fs: vfs::MemoryFS::default() }; - for (path, content) in data { - fs.add_file(Path::new(path), content); - } - fs - } - - #[allow(dead_code)] - pub fn add_file(&mut self, path: &Path, content: &str) { - use vfs::FileSystem; - let fs = &mut self.fs; - // Create all parent directories - for path in path.ancestors().collect::>().iter().rev() { - let path = path.to_string_lossy(); - if !fs.exists(path.as_ref()).unwrap() { - fs.create_dir(path.as_ref()).unwrap(); - } - } - // Create file - let mut file = fs.create_file(path.to_string_lossy().as_ref()).unwrap(); - file.write_all(content.as_bytes()).unwrap(); - } -} - -impl FileSystem for MemoryFS { - fn read_to_string(&self, path: &Path) -> io::Result { - use vfs::FileSystem; - let mut file = self - .fs - .open_file(path.to_string_lossy().as_ref()) - .map_err(|err| io::Error::new(io::ErrorKind::NotFound, err))?; - let mut buffer = String::new(); - file.read_to_string(&mut buffer).unwrap(); - Ok(buffer) - } - - fn metadata(&self, path: &Path) -> io::Result { - use vfs::FileSystem; - let metadata = self - .fs - .metadata(path.to_string_lossy().as_ref()) - .map_err(|err| io::Error::new(io::ErrorKind::NotFound, err))?; - let is_file = metadata.file_type == vfs::VfsFileType::File; - let is_dir = metadata.file_type == vfs::VfsFileType::Directory; - Ok(FileMetadata::new(is_file, is_dir, false)) - } - - fn symlink_metadata(&self, path: &Path) -> io::Result { - self.metadata(path) - } - - fn canonicalize(&self, _path: &Path) -> io::Result { - Err(io::Error::new(io::ErrorKind::NotFound, "not a symlink")) - } -} diff --git a/src/tests/missing.rs b/src/tests/missing.rs deleted file mode 100644 index 4bf611ef..00000000 --- a/src/tests/missing.rs +++ /dev/null @@ -1,106 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/missing.test.js - -use normalize_path::NormalizePath; - -use crate::{AliasValue, ResolveContext, ResolveOptions, Resolver}; - -#[test] -fn test() { - let f = super::fixture(); - - let data = [ - ( - "./missing-file", - vec![f.join("missing-file"), f.join("missing-file.js"), f.join("missing-file.node")], - ), - ( - "missing-module", - vec![ - f.join("node_modules/missing-module"), - f.parent().unwrap().join("node_modules"), // enhanced-resolve is "node_modules/missing-module" - ], - ), - ( - "missing-module/missing-file", - vec![ - f.join("node_modules/missing-module"), - // f.parent().unwrap().join("node_modules/missing-module"), // we don't report this - ], - ), - ( - "m1/missing-file", - vec![ - f.join("node_modules/m1/missing-file"), - f.join("node_modules/m1/missing-file.js"), - f.join("node_modules/m1/missing-file.node"), - // f.parent().unwrap().join("node_modules/m1"), // we don't report this - ], - ), - ( - "m1/", - vec![ - f.join("node_modules/m1/index"), - f.join("node_modules/m1/index.js"), - f.join("node_modules/m1/index.json"), - f.join("node_modules/m1/index.node"), - ], - ), - ("m1/a", vec![f.join("node_modules/m1/a")]), - ]; - - let resolver = Resolver::default(); - - for (specifier, missing_dependencies) in data { - let mut ctx = ResolveContext::default(); - let _ = resolver.resolve_with_context(&f, specifier, &mut ctx); - - for path in ctx.file_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - } - - for path in missing_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - assert!( - ctx.missing_dependencies.contains(&path), - "{specifier}: {path:?} not in {:?}", - &ctx.missing_dependencies - ); - } - } -} - -#[test] -fn alias_and_extensions() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias: vec![ - ( - "@scope-js/package-name/dir$".into(), - vec![AliasValue::Path(f.join("foo/index.js").to_string_lossy().to_string())], - ), - ( - "react-dom".into(), - vec![AliasValue::Path(f.join("foo/index.js").to_string_lossy().to_string())], - ), - ], - extensions: vec![".server.ts".into()], - - ..ResolveOptions::default() - }); - - let mut ctx = ResolveContext::default(); - let _ = resolver.resolve_with_context(&f, "@scope-js/package-name/dir/router", &mut ctx); - let _ = resolver.resolve_with_context(&f, "react-dom/client", &mut ctx); - - for path in ctx.file_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - } - - for path in ctx.missing_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - if let Some(path) = path.parent() { - assert!(!path.is_file(), "{path:?} must not be a file"); - } - } -} diff --git a/src/tests/mod.rs b/src/tests/mod.rs deleted file mode 100644 index 94e6bd86..00000000 --- a/src/tests/mod.rs +++ /dev/null @@ -1,49 +0,0 @@ -mod alias; -mod browser_field; -mod builtins; -mod dependencies; -mod exports_field; -mod extension_alias; -mod extensions; -mod fallback; -mod full_specified; -mod imports_field; -mod incorrect_description_file; -mod main_field; -mod memory_fs; -mod missing; -mod resolve; -mod restrictions; -mod roots; -mod scoped_packages; -mod simple; -mod symlink; -mod tsconfig_paths; -mod tsconfig_project_references; - -use crate::Resolver; -use std::{env, path::PathBuf, sync::Arc, thread}; - -pub fn fixture_root() -> PathBuf { - env::current_dir().unwrap().join("fixtures") -} - -pub fn fixture() -> PathBuf { - fixture_root().join("enhanced_resolve").join("test").join("fixtures") -} - -#[test] -fn threaded_environment() { - let cwd = env::current_dir().unwrap(); - let resolver = Arc::new(Resolver::default()); - for _ in 0..2 { - _ = thread::spawn({ - let cwd = cwd.clone(); - let resolver = Arc::clone(&resolver); - move || { - _ = resolver.resolve(cwd, "."); - } - }) - .join(); - } -} diff --git a/src/tests/resolve.rs b/src/tests/resolve.rs deleted file mode 100644 index f2dbb88e..00000000 --- a/src/tests/resolve.rs +++ /dev/null @@ -1,119 +0,0 @@ -//! - -use crate::{ResolveError, ResolveOptions, Resolver}; - -#[test] -fn resolve() { - let f = super::fixture(); - - let resolver = Resolver::default(); - - let main1_js_path = f.join("main1.js").to_string_lossy().to_string(); - - #[rustfmt::skip] - let pass = [ - ("absolute path", f.clone(), main1_js_path.as_str(), f.join("main1.js")), - ("file with .js", f.clone(), "./main1.js", f.join("main1.js")), - ("file without extension", f.clone(), "./main1", f.join("main1.js")), - ("another file with .js", f.clone(), "./a.js", f.join("a.js")), - ("another file without extension", f.clone(), "./a", f.join("a.js")), - ("file in module with .js", f.clone(), "m1/a.js", f.join("node_modules/m1/a.js")), - ("file in module without extension", f.clone(), "m1/a", f.join("node_modules/m1/a.js")), - ("another file in module without extension", f.clone(), "complexm/step1", f.join("node_modules/complexm/step1.js")), - ("from submodule to file in sibling module", f.join("node_modules/complexm"), "m2/b.js", f.join("node_modules/m2/b.js")), - ("from nested directory to overwritten file in module", f.join("multiple_modules"), "m1/a.js", f.join("multiple_modules/node_modules/m1/a.js")), - ("from nested directory to not overwritten file in module", f.join("multiple_modules"), "m1/b.js", f.join("node_modules/m1/b.js")), - ("file with query", f.clone(), "./main1.js?query", f.join("main1.js?query")), - ("file with fragment", f.clone(), "./main1.js#fragment", f.join("main1.js#fragment")), - ("file with fragment and query", f.clone(), "./main1.js#fragment?query", f.join("main1.js#fragment?query")), - ("file with query and fragment", f.clone(), "./main1.js?#fragment", f.join("main1.js?#fragment")), - - ("file with query (unicode)", f.clone(), "./测试.js?query", f.join("测试.js?query")), - ("file with fragment (unicode)", f.clone(), "./测试.js#fragment", f.join("测试.js#fragment")), - ("file with fragment and query (unicode)", f.clone(), "./测试.js#fragment?query", f.join("测试.js#fragment?query")), - ("file with query and fragment (unicode)", f.clone(), "./测试.js?#fragment", f.join("测试.js?#fragment")), - - ("file in module with query", f.clone(), "m1/a?query", f.join("node_modules/m1/a.js?query")), - ("file in module with fragment", f.clone(), "m1/a#fragment", f.join("node_modules/m1/a.js#fragment")), - ("file in module with fragment and query", f.clone(), "m1/a#fragment?query", f.join("node_modules/m1/a.js#fragment?query")), - ("file in module with query and fragment", f.clone(), "m1/a?#fragment", f.join("node_modules/m1/a.js?#fragment")), - ("file in module with query and fragment", f.clone(), "m1/a?#fragment", f.join("node_modules/m1/a.js?#fragment")), - ("differ between directory and file, resolve file", f.clone(), "./dirOrFile", f.join("dirOrFile.js")), - ("differ between directory and file, resolve directory", f.clone(), "./dirOrFile/", f.join("dirOrFile/index.js")), - ("find node_modules outside of node_modules", f.join("browser-module/node_modules"), "m1/a", f.join("node_modules/m1/a.js")), - ("don't crash on main field pointing to self", f.clone(), "./main-field-self", f.join("./main-field-self/index.js")), - ("don't crash on main field pointing to self (2)", f.clone(), "./main-field-self2", f.join("./main-field-self2/index.js")), - // enhanced-resolve has `#` prepended with a `\0`, they are removed from the - // following 3 expected test results. - // See https://github.com/webpack/enhanced-resolve#escaping - ("handle fragment edge case (no fragment)", f.clone(), "./no#fragment/#/#", f.join("no#fragment/#/#.js")), - ("handle fragment edge case (fragment)", f.clone(), "./no#fragment/#/", f.join("no.js#fragment/#/")), - ("handle fragment escaping", f.clone(), "./no\0#fragment/\0#/\0##fragment", f.join("no#fragment/#/#.js#fragment")), - - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn issue238_resolve() { - let f = super::fixture().join("issue-238"); - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into(), ".jsx".into(), ".ts".into(), ".tsx".into()], - modules: vec!["src/a".into(), "src/b".into(), "src/common".into(), "node_modules".into()], - ..ResolveOptions::default() - }); - let resolved_path = - resolver.resolve(f.join("src/common"), "config/myObjectFile").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("src/common/config/myObjectFile.js")),); -} - -#[test] -fn prefer_relative() { - let f = super::fixture(); - - let resolver = - Resolver::new(ResolveOptions { prefer_relative: true, ..ResolveOptions::default() }); - - #[rustfmt::skip] - let pass = [ - ("should correctly resolve with preferRelative 1", "main1.js", f.join("main1.js")), - ("should correctly resolve with preferRelative 2", "m1/a.js", f.join("node_modules/m1/a.js")), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } -} - -#[test] -fn resolve_to_context() { - let f = super::fixture(); - let resolver = - Resolver::new(ResolveOptions { resolve_to_context: true, ..ResolveOptions::default() }); - - #[rustfmt::skip] - let data = [ - ("context for fixtures", f.clone(), "./", f.clone()), - ("context for fixtures/lib", f.clone(), "./lib", f.join("lib")), - ("context for fixtures with ..", f.clone(), "./lib/../../fixtures/./lib/..", f.clone()), - ("context for fixtures with query", f.clone(), "./?query", f.clone().with_file_name("fixtures?query")), - ]; - - for (comment, path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn resolve_hash_as_module() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions::default()); - let resolution = resolver.resolve(f, "#a"); - assert_eq!(resolution, Err(ResolveError::NotFound("#a".into()))); -} diff --git a/src/tests/restrictions.rs b/src/tests/restrictions.rs deleted file mode 100644 index 5ba56596..00000000 --- a/src/tests/restrictions.rs +++ /dev/null @@ -1,25 +0,0 @@ -//! - -use crate::{ResolveError, ResolveOptions, Resolver, Restriction}; - -// TODO: regex -// * should respect RegExp restriction -// * should try to find alternative #1 -// * should try to find alternative #2 -// * should try to find alternative #3 - -// should respect string restriction -#[test] -fn restriction1() { - let fixture = super::fixture(); - let f = fixture.join("restrictions"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - restrictions: vec![Restriction::Path(f.clone())], - ..ResolveOptions::default() - }); - - let resolution = resolver.resolve(&f, "pck2"); - assert_eq!(resolution, Err(ResolveError::Restriction(fixture.join("c.js"), f))); -} diff --git a/src/tests/roots.rs b/src/tests/roots.rs deleted file mode 100644 index b50e2a07..00000000 --- a/src/tests/roots.rs +++ /dev/null @@ -1,92 +0,0 @@ -//! - -use std::path::PathBuf; - -use crate::{AliasValue, ResolveError, ResolveOptions, Resolver}; - -fn dirname() -> PathBuf { - super::fixture_root().join("enhanced_resolve").join("test") -} - -#[test] -fn roots() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - alias: vec![("foo".into(), vec![AliasValue::from("/fixtures")])], - roots: vec![dirname(), f.clone()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should respect roots option", "/fixtures/b.js", f.join("b.js")), - ("should try another root option, if it exists", "/b.js", f.join("b.js")), - ("should respect extension", "/fixtures/b", f.join("b.js")), - ("should resolve in directory", "/fixtures/extensions/dir", f.join("extensions/dir/index.js")), - ("should respect aliases", "foo/b", f.join("b.js")), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } - - #[rustfmt::skip] - let fail = [ - ("should not work with relative path", "fixtures/b.js", ResolveError::NotFound("fixtures/b.js".into())) - ]; - - for (comment, request, expected) in fail { - let resolution = resolver.resolve(&f, request); - assert_eq!(resolution, Err(expected), "{comment} {request}"); - } -} - -#[test] -fn resolve_to_context() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - roots: vec![dirname(), f.clone()], - resolve_to_context: true, - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f, "/fixtures/lib").map(|r| r.full_path()); - let expected = f.join("lib"); - assert_eq!(resolved_path, Ok(expected)); -} - -#[test] -fn prefer_absolute() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - alias: vec![("foo".into(), vec![AliasValue::from("/fixtures")])], - roots: vec![dirname(), f.clone()], - prefer_absolute: true, - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve an absolute path (prefer absolute)", f.join("b.js").to_string_lossy().to_string(), f.join("b.js")), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(&f, &request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } -} - -#[test] -fn roots_fall_through() { - let f = super::fixture(); - let absolute_path = f.join("roots_fall_through/index.js"); - let specifier = absolute_path.to_string_lossy(); - let resolution = Resolver::new(ResolveOptions::default().with_root(&f)).resolve(&f, &specifier); - assert_eq!( - resolution.map(super::super::resolution::Resolution::into_path_buf), - Ok(absolute_path) - ); -} diff --git a/src/tests/scoped_packages.rs b/src/tests/scoped_packages.rs deleted file mode 100644 index 8258f00f..00000000 --- a/src/tests/scoped_packages.rs +++ /dev/null @@ -1,25 +0,0 @@ -//! - -use crate::{ResolveOptions, Resolver}; - -#[test] -fn scoped_packages() { - let f = super::fixture().join("scoped"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("main field should work", f.clone(), "@scope/pack1", f.join("./node_modules/@scope/pack1/main.js")), - ("browser field should work", f.clone(), "@scope/pack2", f.join("./node_modules/@scope/pack2/main.js")), - ("folder request should work", f.clone(), "@scope/pack2/lib", f.join("./node_modules/@scope/pack2/lib/index.js")) - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} diff --git a/src/tests/simple.rs b/src/tests/simple.rs deleted file mode 100644 index 08e1238a..00000000 --- a/src/tests/simple.rs +++ /dev/null @@ -1,68 +0,0 @@ -//! - -use std::env; - -use crate::Resolver; - -#[test] -fn simple() { - // mimic `enhanced-resolve/test/simple.test.js` - let dirname = env::current_dir().unwrap().join("fixtures"); - let f = dirname.join("enhanced_resolve/test"); - - let resolver = Resolver::default(); - - let data = [ - ("direct", f.clone(), "../lib/index"), - ("as directory", f, ".."), - ("as module", dirname.clone(), "./enhanced_resolve"), - ]; - - for (comment, path, request) in data { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - let expected = dirname.join("enhanced_resolve/lib/index.js"); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn dashed_name() { - let f = super::fixture(); - - let resolver = Resolver::default(); - - let data = [ - (f.clone(), "dash", f.join("node_modules/dash/index.js")), - (f.clone(), "dash-name", f.join("node_modules/dash-name/index.js")), - (f.join("node_modules/dash"), "dash", f.join("node_modules/dash/index.js")), - (f.join("node_modules/dash"), "dash-name", f.join("node_modules/dash-name/index.js")), - (f.join("node_modules/dash-name"), "dash", f.join("node_modules/dash/index.js")), - (f.join("node_modules/dash-name"), "dash-name", f.join("node_modules/dash-name/index.js")), - ]; - - for (path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{path:?} {request}"); - } -} - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows { - use super::super::memory_fs::MemoryFS; - - use crate::ResolveOptions; - - #[test] - fn no_package() { - use crate::ResolverGeneric; - use std::path::Path; - let f = Path::new("/"); - let file_system = MemoryFS::new(&[]); - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions::default(), - ); - let resolved_path = resolver.resolve(f, "package"); - assert!(resolved_path.is_err()); - } -} diff --git a/src/tests/symlink.rs b/src/tests/symlink.rs deleted file mode 100644 index 7589b560..00000000 --- a/src/tests/symlink.rs +++ /dev/null @@ -1,121 +0,0 @@ -use std::{fs, io, path::Path}; - -use crate::{ResolveOptions, Resolver}; - -#[derive(Debug, Clone, Copy)] -enum FileType { - File, - Dir, -} - -#[allow(unused_variables)] -fn symlink, Q: AsRef>( - original: P, - link: Q, - file_type: FileType, -) -> io::Result<()> { - #[cfg(target_family = "unix")] - { - std::os::unix::fs::symlink(original, link) - } - - #[cfg(target_family = "windows")] - match file_type { - FileType::File => std::os::windows::fs::symlink_file(original, link), - FileType::Dir => std::os::windows::fs::symlink_dir(original, link), - } -} - -fn init(dirname: &Path, temp_path: &Path) -> io::Result<()> { - if temp_path.exists() { - _ = fs::remove_dir_all(temp_path); - } - fs::create_dir(temp_path)?; - symlink(dirname.join("../lib/index.js"), temp_path.join("test"), FileType::File)?; - symlink(dirname.join("../lib"), temp_path.join("test2"), FileType::Dir)?; - fs::remove_file(temp_path.join("test"))?; - fs::remove_file(temp_path.join("test2"))?; - fs::remove_dir(temp_path) -} - -fn create_symlinks(dirname: &Path, temp_path: &Path) -> io::Result<()> { - fs::create_dir(temp_path).unwrap(); - symlink( - dirname.join("../lib/index.js").canonicalize().unwrap(), - temp_path.join("index.js"), - FileType::File, - )?; - symlink(dirname.join("../lib").canonicalize().unwrap(), temp_path.join("lib"), FileType::Dir)?; - symlink(dirname.join("..").canonicalize().unwrap(), temp_path.join("this"), FileType::Dir)?; - symlink(temp_path.join("this"), temp_path.join("that"), FileType::Dir)?; - symlink(Path::new("../../lib/index.js"), temp_path.join("node.relative.js"), FileType::File)?; - symlink( - Path::new("./node.relative.js"), - temp_path.join("node.relative.sym.js"), - FileType::File, - )?; - Ok(()) -} - -fn cleanup_symlinks(temp_path: &Path) { - _ = fs::remove_dir_all(temp_path); -} - -#[test] -fn test() -> io::Result<()> { - let root = super::fixture_root().join("enhanced_resolve"); - let dirname = root.join("test"); - let temp_path = dirname.join("temp"); - if !temp_path.exists() { - let is_admin = init(&dirname, &temp_path).is_ok(); - if !is_admin { - return Ok(()); - } - if let Err(err) = create_symlinks(&dirname, &temp_path) { - cleanup_symlinks(&temp_path); - return Err(err); - } - } - - let resolver_without_symlinks = - Resolver::new(ResolveOptions { symlinks: false, ..ResolveOptions::default() }); - let resolver_with_symlinks = Resolver::default(); - - #[rustfmt::skip] - let pass = [ - ("with a symlink to a file", temp_path.clone(), "./index.js"), - ("with a relative symlink to a file", temp_path.clone(), "./node.relative.js"), - ("with a relative symlink to a symlink to a file", temp_path.clone(), "./node.relative.sym.js"), - ("with a symlink to a directory 1", temp_path.clone(), "./lib/index.js"), - ("with a symlink to a directory 2", temp_path.clone(), "./this/lib/index.js"), - ("with multiple symlinks in the path 1", temp_path.clone(), "./this/test/temp/index.js"), - ("with multiple symlinks in the path 2", temp_path.clone(), "./this/test/temp/lib/index.js"), - ("with multiple symlinks in the path 3", temp_path.clone(), "./this/test/temp/this/lib/index.js"), - ("with a symlink to a directory 2 (chained)", temp_path.clone(), "./that/lib/index.js"), - ("with multiple symlinks in the path 1 (chained)", temp_path.clone(), "./that/test/temp/index.js"), - ("with multiple symlinks in the path 2 (chained)", temp_path.clone(), "./that/test/temp/lib/index.js"), - ("with multiple symlinks in the path 3 (chained)", temp_path.clone(), "./that/test/temp/that/lib/index.js"), - ("with symlinked directory as context 1", temp_path.join( "lib"), "./index.js"), - ("with symlinked directory as context 2", temp_path.join( "this"), "./lib/index.js"), - ("with symlinked directory as context and in path", temp_path.join( "this"), "./test/temp/lib/index.js"), - ("with symlinked directory in context path", temp_path.join( "this/lib"), "./index.js"), - ("with symlinked directory in context path and symlinked file", temp_path.join( "this/test"), "./temp/index.js"), - ("with symlinked directory in context path and symlinked directory", temp_path.join( "this/test"), "./temp/lib/index.js"), - ("with symlinked directory as context 2 (chained)", temp_path.join( "that"), "./lib/index.js"), - ("with symlinked directory as context and in path (chained)", temp_path.join( "that"), "./test/temp/lib/index.js"), - ("with symlinked directory in context path (chained)", temp_path.join( "that/lib"), "./index.js"), - ("with symlinked directory in context path and symlinked file (chained)", temp_path.join( "that/test"), "./temp/index.js"), - ("with symlinked directory in context path and symlinked directory (chained)", temp_path.join( "that/test"), "./temp/lib/index.js") - ]; - - for (comment, path, request) in pass { - let filename = resolver_with_symlinks.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(filename, Ok(root.join("lib/index.js")), "{comment:?}"); - - let resolved_path = - resolver_without_symlinks.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(path.join(request))); - } - - Ok(()) -} diff --git a/src/tests/tsconfig_paths.rs b/src/tests/tsconfig_paths.rs deleted file mode 100644 index 26935b5c..00000000 --- a/src/tests/tsconfig_paths.rs +++ /dev/null @@ -1,507 +0,0 @@ -//! tests for tsconfig-paths -//! -//! Fixtures copied from . - -use std::path::{Path, PathBuf}; - -use crate::{ - ResolveError, ResolveOptions, Resolver, TsConfig, TsconfigOptions, TsconfigReferences, -}; - -// -#[test] -fn tsconfig() { - let f = super::fixture_root().join("tsconfig"); - - #[rustfmt::skip] - let pass = [ - (f.clone(), None, "ts-path", f.join("foo.js")), - (f.join("nested"), None, "ts-path", f.join("nested/test.js")), - (f.join("cases/index"), None, "foo", f.join("node_modules/tsconfig-index/foo.js")), - // This requires reading package.json.tsconfig field - // (f.join("cases/field"), "foo", f.join("node_modules/tsconfig-field/foo.js")) - (f.join("cases/exports"), None, "foo", f.join("node_modules/tsconfig-exports/foo.js")), - (f.join("cases/extends-extension"), None, "foo", f.join("cases/extends-extension/foo.js")), - (f.join("cases/extends-extensionless"), None, "foo", f.join("node_modules/tsconfig-field/foo.js")), - (f.join("cases/extends-paths"), Some("src"), "@/index", f.join("cases/extends-paths/src/index.js")), - (f.join("cases/extends-multiple"), None, "foo", f.join("cases/extends-multiple/foo.js")), - ]; - - for (dir, subdir, request, expected) in pass { - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: dir.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - let path = subdir.map_or(dir.clone(), |subdir| dir.join(subdir)); - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{request} {path:?}"); - } - - #[rustfmt::skip] - let data = [ - (f.join("node_modules/tsconfig-not-used"), "ts-path", Ok(f.join("foo.js"))), - ]; - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - for (path, request, expected) in data { - let resolution = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolution, expected, "{path:?} {request}"); - } -} - -#[test] -fn tsconfig_fallthrough() { - let f = super::fixture_root().join("tsconfig"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "/"); - assert_eq!(resolved_path, Err(ResolveError::NotFound("/".into()))); -} - -#[test] -fn json_with_comments() { - let f = super::fixture_root().join("tsconfig/cases/trailing-comma"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "foo").map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(f.join("bar.js"))); -} - -// -#[test] -fn test_paths() { - let path = Path::new("/foo/tsconfig.json"); - let mut tsconfig_json = serde_json::json!({ - "compilerOptions": { - "paths": { - "jquery": ["node_modules/jquery/dist/jquery"], - "*": ["generated/*"], - "bar/*": ["test/*"], - "bar/baz/*": ["baz/*", "yo/*"], - "@/components/*": ["components/*"], - "url": ["node_modules/my-url"], - } - } - }) - .to_string(); - let tsconfig = TsConfig::parse(true, path, &mut tsconfig_json).unwrap(); - - let data = [ - ("jquery", vec!["/foo/node_modules/jquery/dist/jquery"]), - ("test", vec!["/foo/generated/test"]), - ("test/hello", vec!["/foo/generated/test/hello"]), - ("bar/hi", vec!["/foo/test/hi"]), - ("bar/baz/hi", vec!["/foo/baz/hi", "/foo/yo/hi"]), - ("@/components/button", vec!["/foo/components/button"]), - ("./jquery", vec![]), - ("url", vec!["/foo/node_modules/my-url"]), - ]; - - for (specifier, expected) in data { - let paths = tsconfig.resolve_path_alias(specifier); - let expected = expected.into_iter().map(PathBuf::from).collect::>(); - assert_eq!(paths, expected, "{specifier}"); - } -} - -// -#[test] -fn test_base_url() { - let path = Path::new("/foo/tsconfig.json"); - let mut tsconfig_json = serde_json::json!({ - "compilerOptions": { - "baseUrl": "./src" - } - }) - .to_string(); - let tsconfig = TsConfig::parse(true, path, &mut tsconfig_json).unwrap(); - - let data = [ - ("foo", vec!["/foo/src/foo"]), - ("components/button", vec!["/foo/src/components/button"]), - ("./jquery", vec![]), - ]; - - for (specifier, expected) in data { - let paths = tsconfig.resolve_path_alias(specifier); - let expected = expected.into_iter().map(PathBuf::from).collect::>(); - assert_eq!(paths, expected, "{specifier}"); - } -} - -// -#[test] -fn test_paths_and_base_url() { - let path = Path::new("/foo/tsconfig.json"); - let mut tsconfig_json = serde_json::json!({ - "compilerOptions": { - "baseUrl": "./src", - "paths": { - "*": ["generated/*"], - "bar/*": ["test/*"], - "bar/baz/*": ["baz/*", "yo/*"], - "@/components/*": ["components/*"] - } - } - }) - .to_string(); - let tsconfig = TsConfig::parse(true, path, &mut tsconfig_json).unwrap(); - - let data = [ - ("test", vec!["/foo/src/generated/test", "/foo/src/test"]), - ("test/hello", vec!["/foo/src/generated/test/hello", "/foo/src/test/hello"]), - ("bar/hi", vec!["/foo/src/test/hi", "/foo/src/bar/hi"]), - ("bar/baz/hi", vec!["/foo/src/baz/hi", "/foo/src/yo/hi", "/foo/src/bar/baz/hi"]), - ("@/components/button", vec!["/foo/src/components/button", "/foo/src/@/components/button"]), - ("./jquery", vec![]), - ]; - - for (specifier, expected) in data { - let paths = tsconfig.resolve_path_alias(specifier); - let expected = expected.into_iter().map(PathBuf::from).collect::>(); - assert_eq!(paths, expected, "{specifier}"); - } -} - -// Template variable ${configDir} for substitution of config files directory path -// https://github.com/microsoft/TypeScript/pull/58042 -#[test] -fn test_template_variable() { - let f = super::fixture_root().join("tsconfig"); - let f2 = f.join("cases").join("paths_template_variable"); - - #[rustfmt::skip] - let pass = [ - (f2.clone(), "tsconfig1.json", "foo", f2.join("foo.js")), - (f2.clone(), "tsconfig2.json", "foo", f2.join("foo.js")), - (f.clone(), "tsconfig_template_variable.json", "foo", f.join("foo.js")), - ]; - - for (dir, tsconfig, request, expected) in pass { - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: dir.join(tsconfig), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&dir, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{request} {tsconfig} {dir:?}"); - } -} - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows_test { - use std::path::{Path, PathBuf}; - - use crate::{ - ResolveError, ResolveOptions, ResolverGeneric, TsconfigOptions, TsconfigReferences, - }; - - use super::super::memory_fs::MemoryFS; - - struct OneTest { - name: &'static str, - tsconfig: String, - package_json: Option<(PathBuf, String)>, - main_fields: Option>, - existing_files: Vec<&'static str>, - requested_module: &'static str, - expected_path: &'static str, - extensions: Vec, - } - - impl Default for OneTest { - fn default() -> Self { - Self { - name: "", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/*": ["location/*"] - } - } - }) - .to_string(), - package_json: None, - main_fields: None, - existing_files: vec![], - requested_module: "", - expected_path: "", - extensions: vec![ - ".js".into(), - ".json".into(), - ".node".into(), - ".ts".into(), - ".tsx".into(), - ], - } - } - } - - impl OneTest { - fn resolver(&self, root: &Path) -> ResolverGeneric { - let mut file_system = MemoryFS::default(); - - file_system.add_file(&root.join("tsconfig.json"), &self.tsconfig); - if let Some((path, package_json)) = &self.package_json { - file_system.add_file(&root.join(path).join("package.json"), package_json); - } - for path in &self.existing_files { - file_system.add_file(Path::new(path), ""); - } - - let mut options = ResolveOptions { - extensions: self.extensions.clone(), - tsconfig: Some(TsconfigOptions { - config_file: root.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }; - if let Some(main_fields) = &self.main_fields { - options.main_fields.clone_from(main_fields); - } - - ResolverGeneric::::new_with_file_system(file_system, options) - } - } - - // Path matching tests from tsconfig-paths - // * - // * - #[test] - fn match_path() { - let pass = [ - OneTest { - name: "should locate path that matches with star and exists", - existing_files: vec!["/root/location/mylib/index.ts"], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve to correct path when many are specified", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/*": ["foo1/*", "foo2/*", "location/*", "foo3/*"], - } - } - }) - .to_string(), - existing_files: vec!["/root/location/mylib/index.ts"], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should locate path that matches with star and prioritize pattern with longest prefix", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "*": ["location/*"], - "lib/*": ["location/*"], - } - } - }) - .to_string(), - existing_files: vec![ - "/root/location/lib/mylib/index.ts", - "/root/location/mylib/index.ts", - ], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should locate path that matches with star and exists with extension", - existing_files: vec![ - "/root/location/mylib.myext", - ], - requested_module: "lib/mylib", - extensions: vec![".js".into(), ".myext".into()], - expected_path: "/root/location/mylib.myext", - ..OneTest::default() - }, - OneTest { - name: "should resolve request with extension specified", - existing_files: vec![ - "/root/location/test.jpg", - ], - requested_module: "lib/test.jpg", - expected_path: "/root/location/test.jpg", - ..OneTest::default() - }, - OneTest { - name: "should locate path that matches without star and exists", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/foo": ["location/foo"] - } - } - }) - .to_string(), - existing_files: vec![ - "/root/location/foo.ts", - ], - requested_module: "lib/foo", - expected_path: "/root/location/foo.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve to parent folder when filename is in subfolder", - existing_files: vec![ - "/root/location/mylib/index.ts", - ], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve from main field in package.json", - package_json: Some((PathBuf::from("/root/location/mylib"), serde_json::json!({ - "main": "./kalle.ts" - }).to_string())), - existing_files: vec![ - "/root/location/mylib/kalle.ts", - ], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/kalle.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve from main field in package.json (js)", - package_json: Some((PathBuf::from("/root/location/mylib.js"), serde_json::json!({ - "main": "./kalle.js" - }).to_string())), - existing_files: vec![ - "/root/location/mylib.js/kalle.js", - ], - extensions: vec![".ts".into(), ".js".into()], - requested_module: "lib/mylib.js", - expected_path: "/root/location/mylib.js/kalle.js", - ..OneTest::default() - }, - OneTest { - name: "should resolve from list of fields by priority in package.json", - main_fields: Some(vec!["missing".into(), "browser".into(), "main".into()]), - package_json: Some((PathBuf::from("/root/location/mylibjs"), serde_json::json!({ - "main": "./main.js", - "browser": "./browser.js" - }).to_string())), - existing_files: vec![ - "/root/location/mylibjs/main.js", - "/root/location/mylibjs/browser.js", - ], - extensions: vec![".ts".into(), ".js".into()], - requested_module: "lib/mylibjs", - expected_path: "/root/location/mylibjs/browser.js", - ..OneTest::default() - }, -OneTest { - name: "should ignore field mappings to missing files in package.json", - main_fields: Some(vec!["browser".into(), "main".into()]), - package_json: Some((PathBuf::from("/root/location/mylibjs"), serde_json::json!({ - "main": "./kalle.js", - "browser": "./nope.js" - }).to_string())), - existing_files: vec![ - "/root/location/mylibjs/kalle.js", - ], - extensions: vec![".ts".into(), ".js".into()], - requested_module: "lib/mylibjs", - expected_path: "/root/location/mylibjs/kalle.js", - ..OneTest::default() - }, - // Tests that are not applicable: - // name: "should resolve nested main fields" - // name: "should ignore advanced field mappings in package.json" - // name: "should resolve to with the help of baseUrl when not explicitly set" - // name: "should not resolve with the help of baseUrl when asked not to" - // name: "should resolve main file with cjs file extension" - OneTest { - name: "should resolve .ts from .js alias", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "@/*": ["src/*"] - } - } - }).to_string(), - existing_files: vec![ - "/root/src/foo.ts", - ], - requested_module: "@/foo", // original data was "@/foo.ts" but I don't get why it is the case? - expected_path: "/root/src/foo.ts", // original data was "/root/src/foo" - ..OneTest::default() - }, - ]; - - let root = PathBuf::from("/root"); - - for test in pass { - let resolved_path = - test.resolver(&root).resolve(&root, test.requested_module).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(PathBuf::from(test.expected_path)), "{}", test.name); - } - - let fail = [ - OneTest { - name: "should not locate path that does not match", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/*": ["location/*"] - } - } - }) - .to_string(), - existing_files: vec!["/root/location/mylib"], - requested_module: "lib/mylibjs", - ..OneTest::default() - }, - OneTest { - name: "should not resolve typings file (index.d.ts)", - existing_files: vec!["/root/location/mylib/index.d.ts"], - requested_module: "lib/mylib", - ..OneTest::default() - }, - ]; - - for test in fail { - let resolved_path = - test.resolver(&root).resolve(&root, test.requested_module).map(|f| f.full_path()); - assert_eq!( - resolved_path, - Err(ResolveError::NotFound(test.requested_module.into())), - "{}", - test.name - ); - } - } -} diff --git a/src/tests/tsconfig_project_references.rs b/src/tests/tsconfig_project_references.rs deleted file mode 100644 index b552fefe..00000000 --- a/src/tests/tsconfig_project_references.rs +++ /dev/null @@ -1,101 +0,0 @@ -//! Tests for tsconfig project references - -use crate::{ResolveError, ResolveOptions, Resolver, TsconfigOptions, TsconfigReferences}; - -#[test] -fn auto() { - let f = super::fixture_root().join("tsconfig/cases/project_references"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("app"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - // Test normal paths alias - (f.join("app"), "@/index.ts", f.join("app/aliased/index.ts")), - (f.join("app"), "@/../index.ts", f.join("app/index.ts")), - // Test project reference - (f.join("project_a"), "@/index.ts", f.join("project_a/aliased/index.ts")), - (f.join("project_b/src"), "@/index.ts", f.join("project_b/src/aliased/index.ts")), - // Does not have paths alias - (f.join("project_a"), "./index.ts", f.join("project_a/index.ts")), - (f.join("project_c"), "./index.ts", f.join("project_c/index.ts")), - // Template variable - { - let dir = f.parent().unwrap().join("paths_template_variable"); - (dir.clone(), "foo", dir.join("foo.js")) - } - ]; - - for (path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{request} {path:?}"); - } -} - -#[test] -fn disabled() { - let f = super::fixture_root().join("tsconfig/cases/project_references"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("app"), - references: TsconfigReferences::Disabled, - }), - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - // Test normal paths alias - (f.join("app"), "@/index.ts", Ok(f.join("app/aliased/index.ts"))), - (f.join("app"), "@/../index.ts", Ok(f.join("app/index.ts"))), - // Test project reference - (f.join("project_a"), "@/index.ts", Err(ResolveError::NotFound("@/index.ts".into()))), - (f.join("project_b/src"), "@/index.ts", Err(ResolveError::NotFound("@/index.ts".into()))), - // Does not have paths alias - (f.join("project_a"), "./index.ts", Ok(f.join("project_a/index.ts"))), - (f.join("project_c"), "./index.ts", Ok(f.join("project_c/index.ts"))), - ]; - - for (path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, expected, "{request} {path:?}"); - } -} - -#[test] -fn manual() { - let f = super::fixture_root().join("tsconfig/cases/project_references"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("app"), - references: TsconfigReferences::Paths(vec!["../project_a/conf.json".into()]), - }), - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - // Test normal paths alias - (f.join("app"), "@/index.ts", Ok(f.join("app/aliased/index.ts"))), - (f.join("app"), "@/../index.ts", Ok(f.join("app/index.ts"))), - // Test project reference - (f.join("project_a"), "@/index.ts", Ok(f.join("project_a/aliased/index.ts"))), - (f.join("project_b/src"), "@/index.ts", Err(ResolveError::NotFound("@/index.ts".into()))), - // Does not have paths alias - (f.join("project_a"), "./index.ts", Ok(f.join("project_a/index.ts"))), - (f.join("project_c"), "./index.ts", Ok(f.join("project_c/index.ts"))), - ]; - - for (path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, expected, "{request} {path:?}"); - } -} diff --git a/src/tsconfig.rs b/src/tsconfig.rs deleted file mode 100644 index 9ea23c99..00000000 --- a/src/tsconfig.rs +++ /dev/null @@ -1,223 +0,0 @@ -use std::{ - hash::BuildHasherDefault, - path::{Path, PathBuf}, - sync::Arc, -}; - -use indexmap::IndexMap; -use rustc_hash::FxHasher; -use serde::Deserialize; - -use crate::PathUtil; - -pub type CompilerOptionsPathsMap = IndexMap, BuildHasherDefault>; - -#[derive(Debug, Clone, Eq, PartialEq, Deserialize)] -#[serde(untagged)] -pub enum ExtendsField { - Single(String), - Multiple(Vec), -} - -#[derive(Debug, Deserialize)] -#[serde(rename_all = "camelCase")] -pub struct TsConfig { - /// Whether this is the caller tsconfig. - /// Used for final template variable substitution when all configs are extended and merged. - #[serde(skip)] - root: bool, - - /// Path to `tsconfig.json`. Contains the `tsconfig.json` filename. - #[serde(skip)] - path: PathBuf, - - #[serde(default)] - pub extends: Option, - - #[serde(default)] - pub compiler_options: CompilerOptions, - - /// Bubbled up project references with a reference to their tsconfig. - #[serde(default)] - pub references: Vec, -} - -/// Compiler Options -/// -/// -#[derive(Debug, Default, Deserialize)] -#[serde(rename_all = "camelCase")] -pub struct CompilerOptions { - base_url: Option, - - /// Path aliases - paths: Option, - - /// The actual base for where path aliases are resolved from. - #[serde(skip)] - paths_base: PathBuf, -} - -/// Project Reference -/// -/// -#[derive(Debug, Deserialize)] -pub struct ProjectReference { - /// The path property of each reference can point to a directory containing a tsconfig.json file, - /// or to the config file itself (which may have any name). - pub path: PathBuf, - - /// Reference to the resolved tsconfig - #[serde(skip)] - pub tsconfig: Option>, -} - -impl TsConfig { - pub fn parse(root: bool, path: &Path, json: &mut str) -> Result { - _ = json_strip_comments::strip(json); - let mut tsconfig: Self = serde_json::from_str(json)?; - tsconfig.root = root; - tsconfig.path = path.to_path_buf(); - let directory = tsconfig.directory().to_path_buf(); - if let Some(base_url) = tsconfig.compiler_options.base_url { - tsconfig.compiler_options.base_url = Some(directory.normalize_with(base_url)); - } - if tsconfig.compiler_options.paths.is_some() { - tsconfig.compiler_options.paths_base = - tsconfig.compiler_options.base_url.as_ref().map_or(directory, Clone::clone); - } - Ok(tsconfig) - } - - pub fn build(mut self) -> Self { - if self.root { - let dir = self.directory().to_path_buf(); - // Substitute template variable in `tsconfig.compilerOptions.paths` - if let Some(paths) = &mut self.compiler_options.paths { - for paths in paths.values_mut() { - for path in paths { - Self::substitute_template_variable(&dir, path); - } - } - } - } - self - } - - /// Directory to `tsconfig.json` - /// - /// # Panics - /// - /// * When the `tsconfig.json` path is misconfigured. - pub fn directory(&self) -> &Path { - debug_assert!(self.path.file_name().is_some()); - self.path.parent().unwrap() - } - - pub fn extend_tsconfig(&mut self, tsconfig: &Self) { - let compiler_options = &mut self.compiler_options; - if compiler_options.paths.is_none() { - compiler_options.paths_base = compiler_options - .base_url - .as_ref() - .map_or_else(|| tsconfig.compiler_options.paths_base.clone(), Clone::clone); - compiler_options.paths.clone_from(&tsconfig.compiler_options.paths); - } - if compiler_options.base_url.is_none() { - compiler_options.base_url.clone_from(&tsconfig.compiler_options.base_url); - } - } - - pub fn resolve(&self, path: &Path, specifier: &str) -> Vec { - if path.starts_with(self.base_path()) { - let paths = self.resolve_path_alias(specifier); - if !paths.is_empty() { - return paths; - } - } - for tsconfig in self.references.iter().filter_map(|reference| reference.tsconfig.as_ref()) { - if path.starts_with(tsconfig.base_path()) { - return tsconfig.resolve_path_alias(specifier); - } - } - vec![] - } - - // Copied from parcel - // - pub fn resolve_path_alias(&self, specifier: &str) -> Vec { - if specifier.starts_with(|s| s == '/' || s == '.') { - return vec![]; - } - - let base_url_iter = self - .compiler_options - .base_url - .as_ref() - .map_or_else(Vec::new, |base_url| vec![base_url.normalize_with(specifier)]); - - let Some(paths_map) = &self.compiler_options.paths else { - return base_url_iter; - }; - - let paths = paths_map.get(specifier).map_or_else( - || { - let mut longest_prefix_length = 0; - let mut longest_suffix_length = 0; - let mut best_key: Option<&String> = None; - - for key in paths_map.keys() { - if let Some((prefix, suffix)) = key.split_once('*') { - if (best_key.is_none() || prefix.len() > longest_prefix_length) - && specifier.starts_with(prefix) - && specifier.ends_with(suffix) - { - longest_prefix_length = prefix.len(); - longest_suffix_length = suffix.len(); - best_key.replace(key); - } - } - } - - best_key.and_then(|key| paths_map.get(key)).map_or_else(Vec::new, |paths| { - paths - .iter() - .map(|path| { - path.replace( - '*', - &specifier[longest_prefix_length - ..specifier.len() - longest_suffix_length], - ) - }) - .collect::>() - }) - }, - Clone::clone, - ); - - paths - .into_iter() - .map(|p| self.compiler_options.paths_base.normalize_with(p)) - .chain(base_url_iter) - .collect() - } - - fn base_path(&self) -> &Path { - self.compiler_options - .base_url - .as_ref() - .map_or_else(|| self.directory(), |path| path.as_ref()) - } - - /// Template variable `${configDir}` for substitution of config files directory path - /// - /// NOTE: All tests cases are just a head replacement of `${configDir}`, so we are constrained as such. - /// - /// See - fn substitute_template_variable(directory: &Path, path: &mut String) { - const TEMPLATE_VARIABLE: &str = "${configDir}/"; - if let Some(stripped_path) = path.strip_prefix(TEMPLATE_VARIABLE) { - *path = directory.join(stripped_path).to_string_lossy().to_string(); - } - } -} diff --git a/tests/integration_test.rs b/tests/integration_test.rs deleted file mode 100644 index 0fc52887..00000000 --- a/tests/integration_test.rs +++ /dev/null @@ -1,103 +0,0 @@ -//! Test public APIs - -use std::{env, path::PathBuf}; - -use oxc_resolver::{EnforceExtension, Resolution, ResolveContext, ResolveOptions, Resolver}; - -fn dir() -> PathBuf { - env::current_dir().unwrap() -} - -fn resolve(specifier: &str) -> Resolution { - let path = dir(); - Resolver::new(ResolveOptions::default()).resolve(path, specifier).unwrap() -} - -#[test] -fn clone() { - let resolution = resolve("./tests/package.json"); - assert_eq!(resolution.clone(), resolution); -} - -#[test] -fn debug() { - let resolution = resolve("./tests/package.json"); - let s = format!("{resolution:?}"); - assert!(!s.is_empty()); -} - -#[test] -fn eq() { - let resolution = resolve("./tests/package.json"); - assert_eq!(resolution, resolution); -} - -#[test] -fn package_json() { - let resolution = resolve("./tests/package.json"); - let package_json = resolution.package_json().unwrap(); - assert_eq!(package_json.name.as_ref().unwrap(), "name"); - assert_eq!(package_json.r#type.as_ref().unwrap().as_str(), "module".into()); - assert!(package_json.side_effects.as_ref().unwrap().is_object()); -} - -#[cfg(feature = "package_json_raw_json_api")] -#[test] -fn package_json_raw_json_api() { - let resolution = resolve("./tests/package.json"); - assert!(resolution - .package_json() - .unwrap() - .raw_json() - .get("name") - .is_some_and(|name| name == "name")); -} - -#[test] -fn clear_cache() { - let resolver = Resolver::new(ResolveOptions::default()); - resolver.clear_cache(); // exists -} - -#[test] -fn options() { - let resolver = Resolver::new(ResolveOptions::default()); - let options = resolver.options(); - assert!(!format!("{options:?}").is_empty()); -} - -#[test] -fn debug_resolver() { - let resolver = Resolver::new(ResolveOptions::default()); - assert!(!format!("{resolver:?}").is_empty()); -} - -#[test] -fn dependencies() { - let path = dir(); - let mut ctx = ResolveContext::default(); - let _ = Resolver::new(ResolveOptions::default()).resolve_with_context( - path, - "./tests/package.json", - &mut ctx, - ); - assert!(!ctx.file_dependencies.is_empty()); - assert!(ctx.missing_dependencies.is_empty()); -} - -#[test] -fn options_api() { - _ = ResolveOptions::default() - .with_builtin_modules(true) - .with_condition_names(&[]) - .with_extension(".js") - .with_force_extension(EnforceExtension::Auto) - .with_fully_specified(true) - .with_main_field("asdf") - .with_main_file("main") - .with_module("module") - .with_prefer_absolute(true) - .with_prefer_relative(true) - .with_root(PathBuf::new()) - .with_symbolic_link(true); -} diff --git a/tests/package.json b/tests/package.json deleted file mode 100644 index 54f58b8c..00000000 --- a/tests/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "name", - "type": "module", - "sideEffects": {} -} diff --git a/tests/resolve_test.rs b/tests/resolve_test.rs deleted file mode 100644 index 30d1ceff..00000000 --- a/tests/resolve_test.rs +++ /dev/null @@ -1,104 +0,0 @@ -use std::{env, path::PathBuf}; - -use oxc_resolver::{ResolveError, ResolveOptions, Resolver}; - -fn dir() -> PathBuf { - env::current_dir().unwrap() -} - -#[test] -fn chinese() { - let dir = dir(); - let specifier = "./fixtures/misc/中文/中文.js"; - let resolution = Resolver::new(ResolveOptions::default()).resolve(&dir, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(dir.join("fixtures/misc/中文/中文.js")) - ); -} - -#[test] -fn styled_components() { - let dir = dir(); - let path = dir.join("fixtures/pnpm"); - let module_path = dir.join("node_modules/.pnpm/styled-components@6.1.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/styled-components"); - let specifier = "styled-components"; - - // cjs - let options = - ResolveOptions { alias_fields: vec![vec!["browser".into()]], ..ResolveOptions::default() }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/styled-components.browser.cjs.js")) - ); - - // esm - let options = ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - main_fields: vec!["module".into()], - ..ResolveOptions::default() - }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/styled-components.browser.esm.js")) - ); -} - -#[test] -fn axios() { - let dir = dir(); - let path = dir.join("fixtures/pnpm"); - let module_path = dir.join("node_modules/.pnpm/axios@1.6.2/node_modules/axios"); - let specifier = "axios"; - - // default - let options = ResolveOptions::default(); - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("index.js")) - ); - - // browser - let options = ResolveOptions { - condition_names: vec!["browser".into(), "require".into()], - ..ResolveOptions::default() - }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/browser/axios.cjs")) - ); - - // cjs - let options = ResolveOptions { - condition_names: vec!["node".into(), "require".into()], - ..ResolveOptions::default() - }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/node/axios.cjs")) - ); -} - -#[test] -fn postcss() { - let dir = dir(); - let path = dir.join("fixtures/pnpm"); - let module_path = path.join("node_modules/postcss"); - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - // should ignore "path" - let resolution = resolver.resolve(&module_path, "path"); - assert_eq!(resolution, Err(ResolveError::Ignored(module_path.clone()))); - - // should ignore "./lib/terminal-highlight" - let resolution = resolver.resolve(&module_path, "./lib/terminal-highlight"); - assert_eq!(resolution, Err(ResolveError::Ignored(module_path.join("lib/terminal-highlight")))); -} From 737347aeba772cc14363002dd9ce39882efd60c9 Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Sun, 30 Jun 2024 14:14:16 +0300 Subject: [PATCH 42/82] squash! --- package.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index a431e48f..85024638 100644 --- a/package.json +++ b/package.json @@ -15,10 +15,10 @@ ] }, "devDependencies": { - "@napi-rs/cli": "^3.0.0-alpha.43", - "@napi-rs/wasm-runtime": "^0.2.0", - "@types/node": "^20.10.4", - "ava": "^6.0.1", - "emnapi": "^1.0.0" + "@napi-rs/cli": "3.0.0-alpha.43", + "@napi-rs/wasm-runtime": "0.2.0", + "@types/node": "20.10.4", + "ava": "6.0.1", + "emnapi": "1.0.0" } } From 5bd977770410003374038881992cab283888d5f1 Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Mon, 1 Jul 2024 07:46:29 +0300 Subject: [PATCH 43/82] squash! --- package.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 85024638..42daa7cd 100644 --- a/package.json +++ b/package.json @@ -16,9 +16,9 @@ }, "devDependencies": { "@napi-rs/cli": "3.0.0-alpha.43", - "@napi-rs/wasm-runtime": "0.2.0", - "@types/node": "20.10.4", - "ava": "6.0.1", - "emnapi": "1.0.0" + "@napi-rs/wasm-runtime": "0.2.4", + "@types/node": "20.14.9", + "ava": "6.1.3", + "emnapi": "1.2.0" } } From 88f160af8dd9868b53cd8bd78c0002eb30389462 Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Tue, 2 Jul 2024 10:32:40 +0300 Subject: [PATCH 44/82] squash! --- Cargo.lock | 1031 ------- Source/error.rs | 34 +- Source/lib.rs | 40 +- fixtures/enhanced_resolve/lib/index.js | 1 - fixtures/enhanced_resolve/package.json | 4 - fixtures/enhanced_resolve/test/.gitignore | 2 - .../enhanced_resolve/test/fixtures/#/a.js | 0 fixtures/enhanced_resolve/test/fixtures/a.js | 3 - .../enhanced_resolve/test/fixtures/abc.txt | 1 - .../test/fixtures/alias/files/a.js | 0 fixtures/enhanced_resolve/test/fixtures/b.js | 3 - .../browser-module/browser/module-a.js | 0 .../fixtures/browser-module/lib/browser.js | 0 .../fixtures/browser-module/lib/ignore.js | 0 .../test/fixtures/browser-module/lib/main.js | 0 .../fixtures/browser-module/lib/replaced.js | 0 .../test/fixtures/browser-module/lib/self.js | 0 .../fixtures/browser-module/lib/toString.js | 0 .../browser-module/node_modules/module-a.js | 0 .../browser-module/node_modules/module-b.js | 0 .../browser-module/node_modules/module-c.js | 0 .../node_modules/recursive-file/a.js | 0 .../node_modules/recursive-file/b.js | 0 .../node_modules/recursive-file/c.js | 0 .../node_modules/recursive-file/d.js | 0 .../node_modules/recursive-file/package.json | 8 - .../test/fixtures/browser-module/package.json | 33 - .../test/fixtures/builtins/package.json | 12 - fixtures/enhanced_resolve/test/fixtures/c.js | 4 - .../enhanced_resolve/test/fixtures/complex.js | 13 - .../test/fixtures/crypto-js/index.js | 0 .../test/fixtures/crypto-js/package.json | 7 - .../test/fixtures/decorated-fs/exists.js | 0 .../test/fixtures/dirOrFile.js | 1 - .../test/fixtures/dirOrFile/index.js | 1 - .../directory-default/directory-default.js | 0 .../node_modules/@org/pkg/dist/string.js | 1 - .../@org/pkg/dist/string.test.d.ts | 1 - .../node_modules/@org/pkg/package.json | 9 - .../node_modules/pkg/dist/string.js | 1 - .../node_modules/pkg/dist/string.test.d.ts | 1 - .../node_modules/pkg/package.json | 9 - .../node_modules/exports-field/package.json | 7 - .../node_modules/pack1/index.js | 0 .../test/fixtures/exports-field/a.js | 1 - .../node_modules/exports-field/lib/browser.js | 1 - .../node_modules/exports-field/lib/index.js | 0 .../exports-field/lib/lib2/main.js | 1 - .../node_modules/exports-field/lib/main.js | 1 - .../node_modules/exports-field/main.js | 1 - .../node_modules/exports-field/package.json | 18 - .../node_modules/exports-field/x.js | 1 - .../invalid-exports-field/index.js | 0 .../invalid-exports-field/package.json | 13 - .../node_modules/invalid-exports-field/umd.js | 0 .../test/fixtures/exports-field/package.json | 5 - .../node_modules/exports-field/index.js | 1 - .../node_modules/exports-field/lib/browser.js | 1 - .../exports-field/lib/lib2/main.js | 1 - .../node_modules/exports-field/lib/main.js | 1 - .../node_modules/exports-field/main.js | 1 - .../node_modules/exports-field/package.json | 17 - .../node_modules/exports-field/index | 0 .../node_modules/exports-field/main.js | 1 - .../node_modules/exports-field/package.json | 10 - .../node_modules/exports-field/src/index.js | 0 .../fixtures/extension-alias/dir/index.js | 0 .../fixtures/extension-alias/dir/index.ts | 0 .../fixtures/extension-alias/dir2/index.js | 0 .../fixtures/extension-alias/dir2/index.mts | 0 .../test/fixtures/extension-alias/index.js | 0 .../test/fixtures/extension-alias/index.mjs | 0 .../fixtures/extension-alias/index.mts.js | 0 .../test/fixtures/extension-alias/index.ts | 0 .../test/fixtures/extensions/app.module.js | 0 .../test/fixtures/extensions/dir/index.js | 0 .../test/fixtures/extensions/dir/index.ts | 0 .../test/fixtures/extensions/foo.js | 0 .../test/fixtures/extensions/foo.ts | 0 .../test/fixtures/extensions/index.js | 0 .../test/fixtures/extensions/index.ts | 0 .../extensions/node_modules/module.js | 0 .../extensions/node_modules/module/index.ts | 0 .../test/fixtures/extensions/package.json | 3 - .../enhanced_resolve/test/fixtures/file.load1 | 0 .../enhanced_resolve/test/fixtures/file.load2 | 0 .../test/fixtures/foo/index.js | 0 .../test/fixtures/foo/package.json | 4 - .../node_modules/m/package.json | 17 - .../node_modules/m/src/features/f.js | 0 .../m/src/features/internal/file.js | 0 .../node_modules/m/src/features/y/y.js | 0 .../node_modules/m/src/internal/i.js | 0 .../node_modules/m/src/middle-1/f.js | 0 .../node_modules/m/src/middle-1/nested/f.js | 0 .../node_modules/m/src/middle-2/nested/f.js | 1 - .../m/src/middle-3/nested/f/nested/f.js | 0 .../node_modules/m/src/middle-4/f/f.js | 0 .../node_modules/m/src/middle-5/f$/$.js | 0 .../node_modules/m/src/middle-5/f/$.js | 0 .../node_modules/m/src/middle/f.js | 0 .../node_modules/m/src/middle/nested/f.js | 0 .../test/fixtures/imports-field/a.js | 1 - .../test/fixtures/imports-field/b.js | 0 .../test/fixtures/imports-field/dir/b.js | 0 .../node_modules/a/lib/browser.js | 1 - .../imports-field/node_modules/a/lib/index.js | 0 .../node_modules/a/lib/lib2/main.js | 1 - .../imports-field/node_modules/a/lib/main.js | 1 - .../imports-field/node_modules/a/main.js | 1 - .../imports-field/node_modules/a/package.json | 18 - .../imports-field/node_modules/a/x.js | 1 - .../imports-field/node_modules/c/index.js | 0 .../test/fixtures/imports-field/package.json | 17 - .../fixtures/incorrect-package/pack1/a.js | 0 .../incorrect-package/pack1/package.json | 2 - .../fixtures/incorrect-package/pack2/a.js | 0 .../incorrect-package/pack2/package.json | 0 .../test/fixtures/issue-238/package.json | 3 - .../test/fixtures/issue-238/src/a/config.js | 0 .../src/common/config/myObjectFile.js | 0 .../enhanced_resolve/test/fixtures/lib.js | 0 .../test/fixtures/lib/complex1.js | 1 - .../test/fixtures/main-field-self/index.js | 0 .../fixtures/main-field-self/package.json | 3 - .../test/fixtures/main-field-self2/index.js | 0 .../fixtures/main-field-self2/package.json | 3 - .../enhanced_resolve/test/fixtures/main1.js | 9 - .../enhanced_resolve/test/fixtures/main2.js | 12 - .../enhanced_resolve/test/fixtures/main3.js | 4 - .../multiple_modules/node_modules/m1/a.js | 3 - .../test/fixtures/no#fragment/#/#.js | 0 fixtures/enhanced_resolve/test/fixtures/no.js | 0 .../browser-module-broken/browser.js | 0 .../browser-module-broken/main.js | 0 .../browser-module-broken/package.json | 4 - .../complexm/node_modules/m1/a.js | 1 - .../complexm/node_modules/m1/index.js | 1 - .../fixtures/node_modules/complexm/step1.js | 1 - .../fixtures/node_modules/complexm/step2.js | 1 - .../fixtures/node_modules/dash-name/index.js | 0 .../node_modules/dash-name/package.json | 4 - .../test/fixtures/node_modules/dash/index.js | 0 .../fixtures/node_modules/dash/package.json | 4 - .../invalidPackageJson/package.json | 0 .../test/fixtures/node_modules/m1/a.js | 3 - .../test/fixtures/node_modules/m1/b.js | 3 - .../test/fixtures/node_modules/m2/b.js | 1 - .../node_modules/recursive-module/file.js | 0 .../node_modules/recursive-module/index.js | 0 .../test/fixtures/pnp-a/m2/a.js | 3 - .../test/fixtures/pnp/pkg/dir/index.js | 0 .../test/fixtures/pnp/pkg/index.js | 0 .../test/fixtures/pnp/pkg/main.js | 0 .../fixtures/pnp/pkg/package-alias/browser.js | 0 .../fixtures/pnp/pkg/package-alias/index.js | 0 .../test/fixtures/pnp/pkg/package.json | 7 - .../test/fixtures/pnp/pkg/typescript/index.ts | 0 .../test/fixtures/pnp/pkg3/a.js | 1 - .../test/fixtures/pnp/pkg3/package.json | 8 - .../prefer-pnp/alternative-modules/m1/b.js | 0 .../restrictions/node_modules/pck1/index.css | 0 .../restrictions/node_modules/pck1/index.js | 0 .../node_modules/pck1/package.json | 3 - .../restrictions/node_modules/pck2/index.css | 0 .../restrictions/node_modules/pck2/module.js | 0 .../node_modules/pck2/package.json | 5 - .../test/fixtures/roots_fall_through/index.js | 0 .../scoped/node_modules/@scope/pack1/main.js | 0 .../node_modules/@scope/pack1/package.json | 5 - .../node_modules/@scope/pack2/lib/index.js | 0 .../scoped/node_modules/@scope/pack2/main.js | 0 .../node_modules/@scope/pack2/package.json | 3 - .../test/fixtures/shortcutdir.js/a.js | 0 .../test/fixtures/yield/a/foo-2/b | 0 .../test/fixtures/yield/a/foo-2/c | 0 .../test/fixtures/yield/a/foo/a | 0 .../test/fixtures/yield/a/foo/b | 0 .../test/fixtures/yield/b/foo/a | 0 .../test/fixtures/yield/c/foo/a | 0 .../test/fixtures/yield/c/foo/package.json | 7 - .../fixtures/\346\265\213\350\257\225.js" | 0 .../\344\270\255\346\226\207.js" | 0 fixtures/pnpm/.gitignore | 1 - fixtures/pnpm/package.json | 10 - fixtures/pnpm/pnpm-lock.yaml | 212 -- fixtures/tsconfig/cases/builtins/thing.js | 0 .../tsconfig/cases/builtins/tsconfig.json | 5 - fixtures/tsconfig/cases/exports/index.js | 0 fixtures/tsconfig/cases/exports/tsconfig.json | 3 - .../extends-extension/base-tsconfig.json | 7 - .../tsconfig/cases/extends-extension/foo.js | 0 .../cases/extends-extension/tsconfig.json | 3 - .../cases/extends-extensionless/foo.js | 0 .../cases/extends-extensionless/tsconfig.json | 3 - .../tsconfig/cases/extends-multiple/foo.js | 0 .../cases/extends-multiple/tsconfig.json | 6 - .../tsconfig/cases/extends-not-found/index.js | 0 .../cases/extends-not-found/tsconfig.json | 3 - .../tsconfig/cases/extends-paths/src/index.js | 0 .../cases/extends-paths/tsconfig.base.json | 7 - .../cases/extends-paths/tsconfig.json | 6 - fixtures/tsconfig/cases/field/index.js | 0 fixtures/tsconfig/cases/field/tsconfig.json | 3 - fixtures/tsconfig/cases/index/index.js | 0 fixtures/tsconfig/cases/index/tsconfig.json | 3 - .../cases/paths_template_variable/foo.js | 0 .../paths_template_variable/tsconfig1.json | 3 - .../paths_template_variable/tsconfig2.json | 8 - .../project_references/app/aliased/index.ts | 0 .../cases/project_references/app/index.ts | 0 .../project_references/app/tsconfig.json | 23 - .../project_a/aliased/index.ts | 0 .../project_references/project_a/conf.json | 8 - .../project_references/project_a/index.ts | 0 .../project_b/src/aliased/index.ts | 0 .../project_b/tsconfig.json | 9 - .../project_references/project_c/index.ts | 0 .../project_c/tsconfig.json | 5 - .../project_references/tsconfig.base.json | 4 - fixtures/tsconfig/cases/suffixes/a.ios.ts | 0 fixtures/tsconfig/cases/suffixes/a.ts | 0 fixtures/tsconfig/cases/suffixes/b.ts | 0 fixtures/tsconfig/cases/suffixes/c-test.ts | 0 fixtures/tsconfig/cases/suffixes/index.ts | 1 - .../tsconfig/cases/suffixes/tsconfig.json | 5 - fixtures/tsconfig/cases/trailing-comma/bar.js | 0 .../tsconfig/cases/trailing-comma/index.js | 0 .../cases/trailing-comma/tsconfig.json | 9 - fixtures/tsconfig/foo.js | 0 fixtures/tsconfig/nested/index.js | 0 fixtures/tsconfig/nested/test.js | 0 fixtures/tsconfig/nested/tsconfig.json | 8 - .../node_modules/tsconfig-exports/conf.json | 7 - .../node_modules/tsconfig-exports/foo.js | 0 .../tsconfig-exports/package.json | 7 - .../node_modules/tsconfig-field/conf.json | 7 - .../node_modules/tsconfig-field/foo.js | 0 .../node_modules/tsconfig-field/package.json | 5 - .../node_modules/tsconfig-index/foo.js | 0 .../node_modules/tsconfig-index/package.json | 4 - .../node_modules/tsconfig-index/tsconfig.json | 7 - .../node_modules/tsconfig-not-used/foo.js | 0 .../tsconfig-not-used/tsconfig.json | 7 - fixtures/tsconfig/package.json | 24 - fixtures/tsconfig/tsconfig.json | 7 - fixtures/tsconfig/tsconfig_broken.json | 1 - .../tsconfig/tsconfig_template_variable.json | 7 - napi/Source/lib.rs | 17 +- napi/{src => Source}/tracing.rs | 0 napi/__test__/resolver.spec.mjs | 260 -- napi/src/lib.rs | 186 -- napi/src/options.rs | 261 -- napi/tests/options.test.mjs | 59 - npm/package.json | 77 +- package.json | 53 +- pnpm-lock.yaml | 2690 ----------------- src/builtins.rs | 71 - src/cache.rs | 369 --- src/context.rs | 89 - src/error.rs | 174 -- src/file_system.rs | 133 - src/lib.rs | 1682 ----------- src/options.rs | 623 ---- src/package_json.rs | 219 -- src/path.rs | 132 - src/resolution.rs | 92 - src/specifier.rs | 230 -- src/tests/alias.rs | 280 -- src/tests/browser_field.rs | 189 -- src/tests/builtins.rs | 121 - src/tests/dependencies.rs | 110 - src/tests/exports_field.rs | 2546 ---------------- src/tests/extension_alias.rs | 66 - src/tests/extensions.rs | 125 - src/tests/fallback.rs | 100 - src/tests/full_specified.rs | 113 - src/tests/imports_field.rs | 1320 -------- src/tests/incorrect_description_file.rs | 65 - src/tests/main_field.rs | 24 - src/tests/memory_fs.rs | 74 - src/tests/missing.rs | 106 - src/tests/mod.rs | 49 - src/tests/resolve.rs | 119 - src/tests/restrictions.rs | 25 - src/tests/roots.rs | 92 - src/tests/scoped_packages.rs | 25 - src/tests/simple.rs | 68 - src/tests/symlink.rs | 121 - src/tests/tsconfig_paths.rs | 530 ---- src/tests/tsconfig_project_references.rs | 101 - src/tsconfig.rs | 223 -- tests/integration_test.rs | 103 - tests/package.json | 5 - tests/resolve_test.rs | 104 - 295 files changed, 113 insertions(+), 16019 deletions(-) delete mode 100644 Cargo.lock delete mode 100644 fixtures/enhanced_resolve/lib/index.js delete mode 100644 fixtures/enhanced_resolve/package.json delete mode 100644 fixtures/enhanced_resolve/test/.gitignore delete mode 100644 fixtures/enhanced_resolve/test/fixtures/#/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/abc.txt delete mode 100644 fixtures/enhanced_resolve/test/fixtures/alias/files/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/browser/module-a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/ignore.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/replaced.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/self.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/toString.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-c.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/c.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/d.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/builtins/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/c.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/complex.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/crypto-js/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/decorated-fs/exists.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/dirOrFile.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/directory-default/directory-default.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/pack1/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/umd.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/index delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/src/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.mts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mjs delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mts.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/app.module.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/foo.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/foo.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/file.load1 delete mode 100644 fixtures/enhanced_resolve/test/fixtures/file.load2 delete mode 100644 fixtures/enhanced_resolve/test/fixtures/foo/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/foo/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/internal/file.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/y/y.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/internal/i.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-3/nested/f/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-4/f/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f$/$.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f/$.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/dir/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/c/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/issue-238/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/issue-238/src/a/config.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/issue-238/src/common/config/myObjectFile.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/lib.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/lib/complex1.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self2/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main1.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main2.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main3.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/no#fragment/#/#.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/no.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/invalidPackageJson/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/file.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/dir/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/typescript/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/prefer-pnp/alternative-modules/m1/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.css delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/index.css delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/module.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/roots_fall_through/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/lib/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/shortcutdir.js/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/b delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/c delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo/a delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo/b delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/b/foo/a delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/c/foo/a delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json delete mode 100644 "fixtures/enhanced_resolve/test/fixtures/\346\265\213\350\257\225.js" delete mode 100644 "fixtures/misc/\344\270\255\346\226\207/\344\270\255\346\226\207.js" delete mode 100644 fixtures/pnpm/.gitignore delete mode 100644 fixtures/pnpm/package.json delete mode 100644 fixtures/pnpm/pnpm-lock.yaml delete mode 100644 fixtures/tsconfig/cases/builtins/thing.js delete mode 100644 fixtures/tsconfig/cases/builtins/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/exports/index.js delete mode 100644 fixtures/tsconfig/cases/exports/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-extension/base-tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-extension/foo.js delete mode 100644 fixtures/tsconfig/cases/extends-extension/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-extensionless/foo.js delete mode 100644 fixtures/tsconfig/cases/extends-extensionless/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-multiple/foo.js delete mode 100644 fixtures/tsconfig/cases/extends-multiple/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-not-found/index.js delete mode 100644 fixtures/tsconfig/cases/extends-not-found/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-paths/src/index.js delete mode 100644 fixtures/tsconfig/cases/extends-paths/tsconfig.base.json delete mode 100644 fixtures/tsconfig/cases/extends-paths/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/field/index.js delete mode 100644 fixtures/tsconfig/cases/field/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/index/index.js delete mode 100644 fixtures/tsconfig/cases/index/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/paths_template_variable/foo.js delete mode 100644 fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json delete mode 100644 fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json delete mode 100644 fixtures/tsconfig/cases/project_references/app/aliased/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/app/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/app/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/project_references/project_a/aliased/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_a/conf.json delete mode 100644 fixtures/tsconfig/cases/project_references/project_a/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_b/src/aliased/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_b/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/project_references/project_c/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_c/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/project_references/tsconfig.base.json delete mode 100644 fixtures/tsconfig/cases/suffixes/a.ios.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/a.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/b.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/c-test.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/index.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/trailing-comma/bar.js delete mode 100644 fixtures/tsconfig/cases/trailing-comma/index.js delete mode 100644 fixtures/tsconfig/cases/trailing-comma/tsconfig.json delete mode 100644 fixtures/tsconfig/foo.js delete mode 100644 fixtures/tsconfig/nested/index.js delete mode 100644 fixtures/tsconfig/nested/test.js delete mode 100644 fixtures/tsconfig/nested/tsconfig.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-exports/conf.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-exports/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-exports/package.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-field/conf.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-field/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-field/package.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-index/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-index/package.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-not-used/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json delete mode 100755 fixtures/tsconfig/package.json delete mode 100644 fixtures/tsconfig/tsconfig.json delete mode 100644 fixtures/tsconfig/tsconfig_broken.json delete mode 100644 fixtures/tsconfig/tsconfig_template_variable.json rename napi/{src => Source}/tracing.rs (100%) delete mode 100644 napi/__test__/resolver.spec.mjs delete mode 100644 napi/src/lib.rs delete mode 100644 napi/src/options.rs delete mode 100644 napi/tests/options.test.mjs delete mode 100644 pnpm-lock.yaml delete mode 100644 src/builtins.rs delete mode 100644 src/cache.rs delete mode 100644 src/context.rs delete mode 100644 src/error.rs delete mode 100644 src/file_system.rs delete mode 100644 src/lib.rs delete mode 100644 src/options.rs delete mode 100644 src/package_json.rs delete mode 100644 src/path.rs delete mode 100644 src/resolution.rs delete mode 100644 src/specifier.rs delete mode 100644 src/tests/alias.rs delete mode 100644 src/tests/browser_field.rs delete mode 100644 src/tests/builtins.rs delete mode 100644 src/tests/dependencies.rs delete mode 100644 src/tests/exports_field.rs delete mode 100644 src/tests/extension_alias.rs delete mode 100644 src/tests/extensions.rs delete mode 100644 src/tests/fallback.rs delete mode 100644 src/tests/full_specified.rs delete mode 100644 src/tests/imports_field.rs delete mode 100644 src/tests/incorrect_description_file.rs delete mode 100644 src/tests/main_field.rs delete mode 100644 src/tests/memory_fs.rs delete mode 100644 src/tests/missing.rs delete mode 100644 src/tests/mod.rs delete mode 100644 src/tests/resolve.rs delete mode 100644 src/tests/restrictions.rs delete mode 100644 src/tests/roots.rs delete mode 100644 src/tests/scoped_packages.rs delete mode 100644 src/tests/simple.rs delete mode 100644 src/tests/symlink.rs delete mode 100644 src/tests/tsconfig_paths.rs delete mode 100644 src/tests/tsconfig_project_references.rs delete mode 100644 src/tsconfig.rs delete mode 100644 tests/integration_test.rs delete mode 100644 tests/package.json delete mode 100644 tests/resolve_test.rs diff --git a/Cargo.lock b/Cargo.lock deleted file mode 100644 index 2861dc00..00000000 --- a/Cargo.lock +++ /dev/null @@ -1,1031 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "addr2line" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678" -dependencies = [ - "gimli", -] - -[[package]] -name = "adler" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" - -[[package]] -name = "aho-corasick" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" -dependencies = [ - "memchr", -] - -[[package]] -name = "anes" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "735d4f398ca57cfa2880225c2bf81c3b9af3be5bb22e44ae70118dad38713e84" - -[[package]] -name = "autocfg" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" - -[[package]] -name = "backtrace" -version = "0.3.73" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cc23269a4f8976d0a4d2e7109211a419fe30e8d88d677cd60b6bc79c5732e0a" -dependencies = [ - "addr2line", - "cc", - "cfg-if", - "libc", - "miniz_oxide", - "object", - "rustc-demangle", -] - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "bitflags" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" - -[[package]] -name = "bpaf" -version = "0.9.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3280efcf6d66bc77c2cf9b67dc8acee47a217d9be67dd590b3230dffe663724d" - -[[package]] -name = "cast" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" - -[[package]] -name = "cc" -version = "1.0.100" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c891175c3fb232128f48de6590095e59198bbeb8620c310be349bfc3afd12c7b" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "ciborium" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42e69ffd6f0917f5c029256a24d0161db17cea3997d185db0d35926308770f0e" -dependencies = [ - "ciborium-io", - "ciborium-ll", - "serde", -] - -[[package]] -name = "ciborium-io" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05afea1e0a06c9be33d539b876f1ce3692f4afea2cb41f740e7743225ed1c757" - -[[package]] -name = "ciborium-ll" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57663b653d948a338bfb3eeba9bb2fd5fcfaecb9e199e87e1eda4d9e8b240fd9" -dependencies = [ - "ciborium-io", - "half", -] - -[[package]] -name = "codspeed" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a104ac948e0188b921eb3fcbdd55dcf62e542df4c7ab7e660623f6288302089" -dependencies = [ - "colored", - "libc", - "serde_json", -] - -[[package]] -name = "colored" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbf2150cce219b664a8a70df7a1f933836724b503f8a413af9365b4dcc4d90b8" -dependencies = [ - "lazy_static", - "windows-sys 0.48.0", -] - -[[package]] -name = "convert_case" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec182b0ca2f35d8fc196cf3404988fd8b8c739a4d270ff118a398feb0cbec1ca" -dependencies = [ - "unicode-segmentation", -] - -[[package]] -name = "criterion2" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7258985df1aa8b33359ee2392cbc3b7802875242cdacdda91a17a602132c24a9" -dependencies = [ - "anes", - "bpaf", - "cast", - "ciborium", - "codspeed", - "colored", - "num-traits", - "oorandom", - "serde", - "serde_json", - "walkdir", -] - -[[package]] -name = "crossbeam-deque" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" -dependencies = [ - "crossbeam-epoch", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.9.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" -dependencies = [ - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" - -[[package]] -name = "crunchy" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" - -[[package]] -name = "ctor" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edb49164822f3ee45b17acd4a208cfc1251410cf0cad9a833234c9890774dd9f" -dependencies = [ - "quote", - "syn", -] - -[[package]] -name = "dashmap" -version = "6.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "804c8821570c3f8b70230c2ba75ffa5c0f9a4189b9a432b6656c536712acae28" -dependencies = [ - "cfg-if", - "crossbeam-utils", - "hashbrown", - "lock_api", - "once_cell", - "parking_lot_core", -] - -[[package]] -name = "document-features" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef5282ad69563b5fc40319526ba27e0e7363d552a896f0297d54f767717f9b95" -dependencies = [ - "litrs", -] - -[[package]] -name = "dunce" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b" - -[[package]] -name = "either" -version = "1.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dca9240753cf90908d7e4aac30f630662b02aebaa1b58a3cadabdb23385b58b" - -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "filetime" -version = "0.2.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ee447700ac8aa0b2f2bd7bc4462ad686ba06baa6727ac149a2d6277f0d240fd" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall 0.4.1", - "windows-sys 0.52.0", -] - -[[package]] -name = "gimli" -version = "0.29.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" - -[[package]] -name = "half" -version = "2.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dd08c532ae367adf81c312a4580bc67f1d0fe8bc9c460520283f4c0ff277888" -dependencies = [ - "cfg-if", - "crunchy", -] - -[[package]] -name = "hashbrown" -version = "0.14.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" - -[[package]] -name = "hermit-abi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" - -[[package]] -name = "indexmap" -version = "2.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" -dependencies = [ - "equivalent", - "hashbrown", - "serde", -] - -[[package]] -name = "itoa" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" - -[[package]] -name = "json-strip-comments" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3d129799327c8f80861e467c59b825ba24c277dba6ad0d71a141dc98f9e04ee" - -[[package]] -name = "lazy_static" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" - -[[package]] -name = "libc" -version = "0.2.155" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" - -[[package]] -name = "libloading" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c2a198fb6b0eada2a8df47933734e6d35d350665a33a3593d7164fa52c75c19" -dependencies = [ - "cfg-if", - "windows-targets 0.52.5", -] - -[[package]] -name = "litrs" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4ce301924b7887e9d637144fdade93f9dfff9b60981d4ac161db09720d39aa5" - -[[package]] -name = "lock_api" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" -dependencies = [ - "autocfg", - "scopeguard", -] - -[[package]] -name = "log" -version = "0.4.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" - -[[package]] -name = "memchr" -version = "2.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" - -[[package]] -name = "miniz_oxide" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" -dependencies = [ - "adler", -] - -[[package]] -name = "napi" -version = "2.16.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "633e41b2b983cf7983134f0c50986ca524d0caf38a2c6fc893ea3fa2e26abb0c" -dependencies = [ - "bitflags 2.5.0", - "ctor", - "napi-derive", - "napi-sys", - "once_cell", - "serde", - "serde_json", - "tokio", -] - -[[package]] -name = "napi-build" -version = "2.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1c0f5d67ee408a4685b61f5ab7e58605c8ae3f2b4189f0127d804ff13d5560a" - -[[package]] -name = "napi-derive" -version = "2.16.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70a8a778fd367b13c64232e58632514b795514ece491ce136d96e976d34a3eb8" -dependencies = [ - "cfg-if", - "convert_case", - "napi-derive-backend", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "napi-derive-backend" -version = "1.0.68" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35849e64596ecd467e1ac897153364a1ffd09b1d79b32ebad94ef8980ac73311" -dependencies = [ - "convert_case", - "once_cell", - "proc-macro2", - "quote", - "regex", - "semver", - "syn", -] - -[[package]] -name = "napi-sys" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "427802e8ec3a734331fec1035594a210ce1ff4dc5bc1950530920ab717964ea3" -dependencies = [ - "libloading", -] - -[[package]] -name = "normalize-path" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5438dd2b2ff4c6df6e1ce22d825ed2fa93ee2922235cc45186991717f0a892d" - -[[package]] -name = "nu-ansi-term" -version = "0.46.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" -dependencies = [ - "overload", - "winapi", -] - -[[package]] -name = "num-traits" -version = "0.2.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" -dependencies = [ - "autocfg", -] - -[[package]] -name = "num_cpus" -version = "1.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" -dependencies = [ - "hermit-abi", - "libc", -] - -[[package]] -name = "object" -version = "0.36.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "576dfe1fc8f9df304abb159d767a29d0476f7750fbf8aa7ad07816004a207434" -dependencies = [ - "memchr", -] - -[[package]] -name = "once_cell" -version = "1.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" - -[[package]] -name = "oorandom" -version = "11.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575" - -[[package]] -name = "overload" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" - -[[package]] -name = "oxc_napi_resolver" -version = "0.0.0" -dependencies = [ - "napi", - "napi-build", - "napi-derive", - "oxc_resolver", - "tokio", - "tracing-subscriber", -] - -[[package]] -name = "oxc_resolver" -version = "1.9.2" -dependencies = [ - "criterion2", - "dashmap", - "document-features", - "dunce", - "indexmap", - "json-strip-comments", - "normalize-path", - "once_cell", - "rayon", - "rustc-hash", - "serde", - "serde_json", - "thiserror", - "tracing", - "vfs", -] - -[[package]] -name = "parking_lot_core" -version = "0.9.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall 0.5.1", - "smallvec", - "windows-targets 0.52.5", -] - -[[package]] -name = "pin-project-lite" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" - -[[package]] -name = "proc-macro2" -version = "1.0.85" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22244ce15aa966053a896d1accb3a6e68469b97c7f33f284b99f0d576879fc23" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.36" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "rayon" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" -dependencies = [ - "either", - "rayon-core", -] - -[[package]] -name = "rayon-core" -version = "1.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" -dependencies = [ - "crossbeam-deque", - "crossbeam-utils", -] - -[[package]] -name = "redox_syscall" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" -dependencies = [ - "bitflags 1.3.2", -] - -[[package]] -name = "redox_syscall" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "469052894dcb553421e483e4209ee581a45100d31b4018de03e5a7ad86374a7e" -dependencies = [ - "bitflags 2.5.0", -] - -[[package]] -name = "regex" -version = "1.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" -dependencies = [ - "aho-corasick", - "memchr", - "regex-automata", - "regex-syntax", -] - -[[package]] -name = "regex-automata" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", -] - -[[package]] -name = "regex-syntax" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" - -[[package]] -name = "rustc-demangle" -version = "0.1.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" - -[[package]] -name = "rustc-hash" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" - -[[package]] -name = "ryu" -version = "1.0.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" - -[[package]] -name = "same-file" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "scopeguard" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" - -[[package]] -name = "semver" -version = "1.0.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" - -[[package]] -name = "serde" -version = "1.0.203" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7253ab4de971e72fb7be983802300c30b5a7f0c2e56fab8abfc6a214307c0094" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.203" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "serde_json" -version = "1.0.119" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8eddb61f0697cc3989c5d64b452f5488e2b8a60fd7d5076a3045076ffef8cb0" -dependencies = [ - "indexmap", - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "sharded-slab" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" -dependencies = [ - "lazy_static", -] - -[[package]] -name = "smallvec" -version = "1.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" - -[[package]] -name = "syn" -version = "2.0.66" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c42f3f41a2de00b01c0aaad383c5a45241efc8b2d1eda5661812fda5f3cdcff5" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "thiserror" -version = "1.0.61" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.61" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "thread_local" -version = "1.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" -dependencies = [ - "cfg-if", - "once_cell", -] - -[[package]] -name = "tokio" -version = "1.38.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba4f4a02a7a80d6f274636f0aa95c7e383b912d41fe721a31f29e29698585a4a" -dependencies = [ - "backtrace", - "num_cpus", - "pin-project-lite", -] - -[[package]] -name = "tracing" -version = "0.1.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" -dependencies = [ - "pin-project-lite", - "tracing-attributes", - "tracing-core", -] - -[[package]] -name = "tracing-attributes" -version = "0.1.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "tracing-core" -version = "0.1.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" -dependencies = [ - "once_cell", - "valuable", -] - -[[package]] -name = "tracing-log" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" -dependencies = [ - "log", - "once_cell", - "tracing-core", -] - -[[package]] -name = "tracing-subscriber" -version = "0.3.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" -dependencies = [ - "nu-ansi-term", - "sharded-slab", - "smallvec", - "thread_local", - "tracing-core", - "tracing-log", -] - -[[package]] -name = "unicode-ident" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" - -[[package]] -name = "unicode-segmentation" -version = "1.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" - -[[package]] -name = "valuable" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" - -[[package]] -name = "vfs" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "654cd097e182a71dbf899178e6b5662c2157dd0b8afd5975de18008f6fc173d1" -dependencies = [ - "filetime", -] - -[[package]] -name = "walkdir" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" -dependencies = [ - "same-file", - "winapi-util", -] - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-util" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b" -dependencies = [ - "windows-sys 0.52.0", -] - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - -[[package]] -name = "windows-sys" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" -dependencies = [ - "windows-targets 0.48.5", -] - -[[package]] -name = "windows-sys" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" -dependencies = [ - "windows-targets 0.52.5", -] - -[[package]] -name = "windows-targets" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" -dependencies = [ - "windows_aarch64_gnullvm 0.48.5", - "windows_aarch64_msvc 0.48.5", - "windows_i686_gnu 0.48.5", - "windows_i686_msvc 0.48.5", - "windows_x86_64_gnu 0.48.5", - "windows_x86_64_gnullvm 0.48.5", - "windows_x86_64_msvc 0.48.5", -] - -[[package]] -name = "windows-targets" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" -dependencies = [ - "windows_aarch64_gnullvm 0.52.5", - "windows_aarch64_msvc 0.52.5", - "windows_i686_gnu 0.52.5", - "windows_i686_gnullvm", - "windows_i686_msvc 0.52.5", - "windows_x86_64_gnu 0.52.5", - "windows_x86_64_gnullvm 0.52.5", - "windows_x86_64_msvc 0.52.5", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" - -[[package]] -name = "windows_i686_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" - -[[package]] -name = "windows_i686_gnu" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" - -[[package]] -name = "windows_i686_gnullvm" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" - -[[package]] -name = "windows_i686_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" - -[[package]] -name = "windows_i686_msvc" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" diff --git a/Source/error.rs b/Source/error.rs index ff2aaa4f..d8b190ba 100644 --- a/Source/error.rs +++ b/Source/error.rs @@ -147,14 +147,28 @@ fn test_into_io_error() { assert_eq!(resolve_io_error, ResolveError::from(string_error)); assert_eq!(resolve_io_error.clone(), resolve_io_error); - if let ResolveError::IOError(io_error) = resolve_io_error { - // fix for https://github.com/web-infra-dev/rspack/issues/4564 - let std_io_error: io::Error = io_error.into(); - assert_eq!(std_io_error.kind(), ErrorKind::Interrupted); - assert_eq!(std_io_error.to_string(), error_string); - assert_eq!( - format!("{std_io_error:?}"), - r#"Custom { kind: Interrupted, error: "IOError occurred" }"# - ); - } + let ResolveError::IOError(io_error) = resolve_io_error else { unreachable!() }; + assert_eq!( + format!("{io_error:?}"), + r#"IOError(Custom { kind: Interrupted, error: "IOError occurred" })"# + ); + // fix for https://github.com/web-infra-dev/rspack/issues/4564 + let std_io_error: io::Error = io_error.into(); + assert_eq!(std_io_error.kind(), ErrorKind::Interrupted); + assert_eq!(std_io_error.to_string(), error_string); + assert_eq!( + format!("{std_io_error:?}"), + r#"Custom { kind: Interrupted, error: "IOError occurred" }"# + ); +} + +#[test] +fn test_coverage() { + let error = ResolveError::NotFound("x".into()); + assert_eq!(format!("{error:?}"), r#"NotFound("x")"#); + assert_eq!(error.clone(), error); + + let error = ResolveError::Specifier(SpecifierError::Empty("x".into())); + assert_eq!(format!("{error:?}"), r#"Specifier(Empty("x"))"#); + assert_eq!(error.clone(), error); } diff --git a/Source/lib.rs b/Source/lib.rs index 70c36b1c..ac95d63f 100644 --- a/Source/lib.rs +++ b/Source/lib.rs @@ -156,11 +156,11 @@ impl ResolverGeneric { self.cache.clear(); } - /// Resolve `specifier` at an absolute `path`. + /// Resolve `specifier` at an absolute path to a `directory`. /// /// A specifier is the string passed to require or import, i.e. `require("specifier")` or `import "specifier"`. /// - /// `path` must be an **absolute** path to a directory where the specifier is resolved against. + /// `directory` must be an **absolute** path to a directory where the specifier is resolved against. /// For CommonJS modules, it is the `__dirname` variable that contains the absolute path to the folder containing current module. /// For ECMAScript modules, it is the value of `import.meta.url`. /// @@ -169,11 +169,11 @@ impl ResolverGeneric { /// * See [ResolveError] pub fn resolve>( &self, - path: P, + directory: P, specifier: &str, ) -> Result { let mut ctx = Ctx::default(); - self.resolve_tracing(path.as_ref(), specifier, &mut ctx) + self.resolve_tracing(directory.as_ref(), specifier, &mut ctx) } /// Resolve `specifier` at absolute `path` with [ResolveContext] @@ -183,13 +183,13 @@ impl ResolverGeneric { /// * See [ResolveError] pub fn resolve_with_context>( &self, - path: P, + directory: P, specifier: &str, resolve_context: &mut ResolveContext, ) -> Result { let mut ctx = Ctx::default(); ctx.init_file_dependencies(); - let result = self.resolve_tracing(path.as_ref(), specifier, &mut ctx); + let result = self.resolve_tracing(directory.as_ref(), specifier, &mut ctx); if let Some(deps) = &mut ctx.file_dependencies { resolve_context.file_dependencies.extend(deps.drain(..)); } @@ -202,19 +202,19 @@ impl ResolverGeneric { /// Wrap `resolve_impl` with `tracing` information fn resolve_tracing( &self, - path: &Path, + directory: &Path, specifier: &str, ctx: &mut Ctx, ) -> Result { - let span = tracing::debug_span!("resolve", path = ?path, specifier = specifier); + let span = tracing::debug_span!("resolve", path = ?directory, specifier = specifier); let _enter = span.enter(); - let r = self.resolve_impl(path, specifier, ctx); + let r = self.resolve_impl(directory, specifier, ctx); match &r { Ok(r) => { - tracing::debug!(options = ?self.options, path = ?path, specifier = specifier, ret = ?r.path); + tracing::debug!(options = ?self.options, path = ?directory, specifier = specifier, ret = ?r.path); } Err(err) => { - tracing::debug!(options = ?self.options, path = ?path, specifier = specifier, err = ?err); + tracing::debug!(options = ?self.options, path = ?directory, specifier = specifier, err = ?err); } }; r @@ -981,6 +981,9 @@ impl ResolverGeneric { /// /// * [ResolveError::ExtensionAlias]: When all of the aliased extensions are not found fn load_extension_alias(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { + if self.options.extension_alias.is_empty() { + return Ok(None); + } let Some(path_extension) = cached_path.path().extension() else { return Ok(None); }; @@ -1007,13 +1010,14 @@ impl ResolverGeneric { /// /// On non-Windows systems these requests are resolved as an absolute path first. fn load_roots(&self, specifier: &str, ctx: &mut Ctx) -> Option { - if !self.options.roots.is_empty() { - if let Some(specifier) = specifier.strip_prefix(SLASH_START) { - for root in &self.options.roots { - let cached_path = self.cache.value(root); - if let Ok(path) = self.require_relative(&cached_path, specifier, ctx) { - return Some(path); - } + if self.options.roots.is_empty() { + return None; + } + if let Some(specifier) = specifier.strip_prefix(SLASH_START) { + for root in &self.options.roots { + let cached_path = self.cache.value(root); + if let Ok(path) = self.require_relative(&cached_path, specifier, ctx) { + return Some(path); } } } diff --git a/fixtures/enhanced_resolve/lib/index.js b/fixtures/enhanced_resolve/lib/index.js deleted file mode 100644 index 1e872e8f..00000000 --- a/fixtures/enhanced_resolve/lib/index.js +++ /dev/null @@ -1 +0,0 @@ -// mimic enhanced-resolved root directory structure diff --git a/fixtures/enhanced_resolve/package.json b/fixtures/enhanced_resolve/package.json deleted file mode 100644 index d1b845b5..00000000 --- a/fixtures/enhanced_resolve/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "enhanced-resolve", - "main": "lib/index.js" -} diff --git a/fixtures/enhanced_resolve/test/.gitignore b/fixtures/enhanced_resolve/test/.gitignore deleted file mode 100644 index bbbec5f4..00000000 --- a/fixtures/enhanced_resolve/test/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# created by symlink.rs -/temp diff --git a/fixtures/enhanced_resolve/test/fixtures/#/a.js b/fixtures/enhanced_resolve/test/fixtures/#/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/a.js b/fixtures/enhanced_resolve/test/fixtures/a.js deleted file mode 100644 index 896ffc6d..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/abc.txt b/fixtures/enhanced_resolve/test/fixtures/abc.txt deleted file mode 100644 index f2ba8f84..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/abc.txt +++ /dev/null @@ -1 +0,0 @@ -abc \ No newline at end of file diff --git a/fixtures/enhanced_resolve/test/fixtures/alias/files/a.js b/fixtures/enhanced_resolve/test/fixtures/alias/files/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/b.js b/fixtures/enhanced_resolve/test/fixtures/b.js deleted file mode 100644 index 11476340..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/b.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function b() { - return "This is b"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/browser/module-a.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/browser/module-a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/browser.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/ignore.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/ignore.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/replaced.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/replaced.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/self.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/self.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/toString.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/toString.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-a.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-b.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-c.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-c.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/a.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/b.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/c.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/c.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/d.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/d.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json deleted file mode 100644 index c13fe23b..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "browser": { - "a.js": "./a", - "./b.js": "./b", - "c.js": "./d.js", - "./d.js": "./c.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/package.json b/fixtures/enhanced_resolve/test/fixtures/browser-module/package.json deleted file mode 100644 index 19ff7739..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/browser-module/package.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "exports": { - "./lib/index.js": "./lib/index.js" - }, - "browser": { - "./lib/ignore.js": false, - "./lib/replaced.js": "./lib/browser", - "module-a": "./browser/module-a.js", - "module-b": "module-c", - "module-c": "module-c", - "./toString": "./lib/toString.js", - "./lib/main.js": "./lib/main.js", - "./main.js": "./lib/main.js", - "./lib/xyz.js": "./xyz.js", - "./xyz.js": "./lib/xyz.js", - "./lib/non-existent.js": "./lib/non-existent.js", - ".": false, - "./number": 1, - "./foo": "./lib/replaced.js?query" - }, - "innerBrowser1": { - "field": { - "browser": { - "./lib/main1.js": "./lib/main.js" - } - } - }, - "innerBrowser2": { - "browser": { - "./lib/main2.js": "./lib/replaced.js" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/builtins/package.json b/fixtures/enhanced_resolve/test/fixtures/builtins/package.json deleted file mode 100644 index 4a54ea96..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/builtins/package.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "name": "builtins", - "private": true, - "imports": { - "#fs": { - "default": "fs" - }, - "#http": { - "node": "node:http" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/c.js b/fixtures/enhanced_resolve/test/fixtures/c.js deleted file mode 100644 index e3aca8aa..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/c.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = function b() { - require("./a"); - return "This is c"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/complex.js b/fixtures/enhanced_resolve/test/fixtures/complex.js deleted file mode 100644 index 1f62db84..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/complex.js +++ /dev/null @@ -1,13 +0,0 @@ -var 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); diff --git a/fixtures/enhanced_resolve/test/fixtures/crypto-js/index.js b/fixtures/enhanced_resolve/test/fixtures/crypto-js/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json b/fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json deleted file mode 100644 index 1d31aa8b..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "crypto-js", - "main": "index.js", - "browser": { - "crypto": false - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/decorated-fs/exists.js b/fixtures/enhanced_resolve/test/fixtures/decorated-fs/exists.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/dirOrFile.js b/fixtures/enhanced_resolve/test/fixtures/dirOrFile.js deleted file mode 100644 index c3cb885f..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/dirOrFile.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "file"; diff --git a/fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js b/fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js deleted file mode 100644 index 85e01cd4..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "dir"; diff --git a/fixtures/enhanced_resolve/test/fixtures/directory-default/directory-default.js b/fixtures/enhanced_resolve/test/fixtures/directory-default/directory-default.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js deleted file mode 100644 index d1007aae..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js +++ /dev/null @@ -1 +0,0 @@ -export default "string"; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts deleted file mode 100644 index cb0ff5c3..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json deleted file mode 100644 index b523a1e9..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "@org/pkg", - "exports": { - "./*.js": { - "types": "./dist/*.d.ts", - "default": "./dist/*.js" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js deleted file mode 100644 index d1007aae..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js +++ /dev/null @@ -1 +0,0 @@ -export default "string"; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts deleted file mode 100644 index cb0ff5c3..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json deleted file mode 100644 index 8e55fb46..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "@raviqqe/hidash", - "exports": { - "./*.js": { - "types": "./dist/*.d.ts", - "default": "./dist/*.js" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json deleted file mode 100644 index f0edf449..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "exports-field", - "version": "1.0.0", - "exports": { - ".": "./a/../b/../../pack1/index.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/pack1/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/pack1/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/a.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/a.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json deleted file mode 100644 index 6b105c08..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "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/": { - "webpack": ["./lib/lib2/", "./lib/"], - "node": "./lib/", - "default": "./lib/" - }, - "./dist/a.js": "./../../a.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json deleted file mode 100644 index 0012a3de..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "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" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/umd.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/umd.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field/package.json deleted file mode 100644 index 5fa72bb5..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "@exports-field/core", - "version": "1.0.0", - "exports": "./a.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json deleted file mode 100644 index e6f12074..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "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/lib2/", "./lib/"], - "node": "./lib/", - "default": "./lib/" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/index b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/index deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json deleted file mode 100644 index 1a838f49..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "name": "exports-field", - "exportsField": { - "exports": "./main.js" - }, - "ex": "./index", - "broken": { - ".": "./src" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/src/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/src/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.ts b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.mts b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.mts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mjs b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mjs deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mts.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mts.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.ts b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/app.module.js b/fixtures/enhanced_resolve/test/fixtures/extensions/app.module.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.js b/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/foo.js b/fixtures/enhanced_resolve/test/fixtures/extensions/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/foo.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/foo.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/index.js b/fixtures/enhanced_resolve/test/fixtures/extensions/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/index.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module.js b/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module/index.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/package.json b/fixtures/enhanced_resolve/test/fixtures/extensions/package.json deleted file mode 100644 index 5e55a1e8..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/extensions/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "./index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/file.load1 b/fixtures/enhanced_resolve/test/fixtures/file.load1 deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/file.load2 b/fixtures/enhanced_resolve/test/fixtures/file.load2 deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/foo/index.js b/fixtures/enhanced_resolve/test/fixtures/foo/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/foo/package.json b/fixtures/enhanced_resolve/test/fixtures/foo/package.json deleted file mode 100644 index da86787a..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/foo/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "foo", - "version": "1.0.0" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json deleted file mode 100644 index aa2be496..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "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" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/internal/file.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/internal/file.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/y/y.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/y/y.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/internal/i.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/internal/i.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/nested/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js deleted file mode 100644 index e5b70a86..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = { nested: "nested" } diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-3/nested/f/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-3/nested/f/nested/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-4/f/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-4/f/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f$/$.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f$/$.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f/$.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f/$.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/nested/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/a.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/a.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/b.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/dir/b.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/dir/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/index.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json deleted file mode 100644 index 8d8d3a46..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "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/lib2/", "./lib/"], - "node": "./lib/", - "default": "./lib/" - }, - "./dist/a.js": "./../../a.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/c/index.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/c/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/imports-field/package.json deleted file mode 100644 index 248351a9..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "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" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/a.js b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json deleted file mode 100644 index ded7faa2..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json +++ /dev/null @@ -1,2 +0,0 @@ -{ - "main": "./a.js", diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/a.js b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/package.json b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/package.json deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/issue-238/package.json b/fixtures/enhanced_resolve/test/fixtures/issue-238/package.json deleted file mode 100644 index 352055cd..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/issue-238/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "private": true -} diff --git a/fixtures/enhanced_resolve/test/fixtures/issue-238/src/a/config.js b/fixtures/enhanced_resolve/test/fixtures/issue-238/src/a/config.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/issue-238/src/common/config/myObjectFile.js b/fixtures/enhanced_resolve/test/fixtures/issue-238/src/common/config/myObjectFile.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/lib.js b/fixtures/enhanced_resolve/test/fixtures/lib.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/lib/complex1.js b/fixtures/enhanced_resolve/test/fixtures/lib/complex1.js deleted file mode 100644 index b3de3d70..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/lib/complex1.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "lib complex1"; diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self/index.js b/fixtures/enhanced_resolve/test/fixtures/main-field-self/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json b/fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json deleted file mode 100644 index a2b6f341..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "./" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self2/index.js b/fixtures/enhanced_resolve/test/fixtures/main-field-self2/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json b/fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json deleted file mode 100644 index 4fa6f730..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "." -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main1.js b/fixtures/enhanced_resolve/test/fixtures/main1.js deleted file mode 100644 index 168f2a1e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main1.js +++ /dev/null @@ -1,9 +0,0 @@ -var a = require("./a"); -if (x) { - for (var i = 0; i < 100; i++) { - while (true) require("./b"); - do { - i++; - } while (require("m1/a")()); - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main2.js b/fixtures/enhanced_resolve/test/fixtures/main2.js deleted file mode 100644 index 39f062b1..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main2.js +++ /dev/null @@ -1,12 +0,0 @@ -var 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"); - }); - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main3.js b/fixtures/enhanced_resolve/test/fixtures/main3.js deleted file mode 100644 index 1c180166..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main3.js +++ /dev/null @@ -1,4 +0,0 @@ -var a = require("./a"); -require.ensure([], function(require) { - require("./c.js"); -}); diff --git a/fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js b/fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js deleted file mode 100644 index 997c1051..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is nested m1/a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/no#fragment/#/#.js b/fixtures/enhanced_resolve/test/fixtures/no#fragment/#/#.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/no.js b/fixtures/enhanced_resolve/test/fixtures/no.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/browser.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/browser.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/main.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json deleted file mode 100644 index c469e1fd..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "main": "./main.js", - "browser": "./browser.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js deleted file mode 100644 index 549620a5..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "the correct a.js"; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js deleted file mode 100644 index 5db6632e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = " :) " + require("m2/b.js"); diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js deleted file mode 100644 index d308569d..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require("m1/a") + require("m1"); diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js deleted file mode 100644 index cb8127e8..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "Step2"; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json deleted file mode 100644 index 8d6dfa56..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "dash-name", - "exports": "./index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json deleted file mode 100644 index 4fd8706e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "dash", - "exports": "./index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/invalidPackageJson/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/invalidPackageJson/package.json deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js deleted file mode 100644 index 46fc8e6c..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is m1/a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js deleted file mode 100644 index 8565c244..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is m1/b"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js deleted file mode 100644 index 34faaaf5..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "This is m2/b"; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/file.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/file.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js b/fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js deleted file mode 100644 index 997c1051..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is nested m1/a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/dir/index.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/dir/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/index.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/main.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/browser.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/browser.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/index.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json deleted file mode 100644 index e20ceaeb..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "main": "main.js", - "browser": { - "./package-alias/index.js": "./package-alias/browser.js", - "module": "pkg/dir/index" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/typescript/index.ts b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/typescript/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json deleted file mode 100644 index 4a1f838e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "@exports-field/core", - "version": "1.0.0", - "exports": { - ".": "./a.js", - "./x": "./a.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/prefer-pnp/alternative-modules/m1/b.js b/fixtures/enhanced_resolve/test/fixtures/prefer-pnp/alternative-modules/m1/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.css b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.css deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.js b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json deleted file mode 100644 index 14ab704d..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/index.css b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/index.css deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/module.js b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/module.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json deleted file mode 100644 index ee0eb71b..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "main": "../../../c.js", - "module": "module.js", - "style": "index.css" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/roots_fall_through/index.js b/fixtures/enhanced_resolve/test/fixtures/roots_fall_through/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/main.js b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json deleted file mode 100644 index 70a0f20f..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "browser": { - "./index.js": "./main.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/lib/index.js b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/lib/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/main.js b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json deleted file mode 100644 index 2af9e0d1..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "./main.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/shortcutdir.js/a.js b/fixtures/enhanced_resolve/test/fixtures/shortcutdir.js/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/b b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/b deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/c b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/c deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/a b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/a deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/b b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/b deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/b/foo/a b/fixtures/enhanced_resolve/test/fixtures/yield/b/foo/a deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/a b/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/a deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json b/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json deleted file mode 100644 index 0acc4b4c..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "foo", - "version": "1.0.0", - "browser": { - "./a": false - } -} diff --git "a/fixtures/enhanced_resolve/test/fixtures/\346\265\213\350\257\225.js" "b/fixtures/enhanced_resolve/test/fixtures/\346\265\213\350\257\225.js" deleted file mode 100644 index e69de29b..00000000 diff --git "a/fixtures/misc/\344\270\255\346\226\207/\344\270\255\346\226\207.js" "b/fixtures/misc/\344\270\255\346\226\207/\344\270\255\346\226\207.js" deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/pnpm/.gitignore b/fixtures/pnpm/.gitignore deleted file mode 100644 index 3c3629e6..00000000 --- a/fixtures/pnpm/.gitignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/fixtures/pnpm/package.json b/fixtures/pnpm/package.json deleted file mode 100644 index 78712e2b..00000000 --- a/fixtures/pnpm/package.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "name": "pnpm", - "version": "1.0.0", - "private": true, - "devDependencies": { - "axios": "1.6.2", - "styled-components": "6.1.1", - "postcss": "8.4.33" - } -} diff --git a/fixtures/pnpm/pnpm-lock.yaml b/fixtures/pnpm/pnpm-lock.yaml deleted file mode 100644 index e51dfd6a..00000000 --- a/fixtures/pnpm/pnpm-lock.yaml +++ /dev/null @@ -1,212 +0,0 @@ -lockfileVersion: '6.0' - -settings: - autoInstallPeers: true - excludeLinksFromLockfile: false - -devDependencies: - axios: - specifier: 1.6.2 - version: 1.6.2 - postcss: - specifier: 8.4.33 - version: 8.4.33 - styled-components: - specifier: 6.1.1 - version: 6.1.1(react-dom@18.2.0)(react@18.2.0) - -packages: - - /@emotion/is-prop-valid@1.2.1: - resolution: {integrity: sha512-61Mf7Ufx4aDxx1xlDeOm8aFFigGHE4z+0sKCa+IHCeZKiyP9RLD0Mmx7m8b9/Cf37f7NAvQOOJAbQQGVr5uERw==} - dependencies: - '@emotion/memoize': 0.8.1 - dev: true - - /@emotion/memoize@0.8.1: - resolution: {integrity: sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA==} - dev: true - - /@emotion/unitless@0.8.1: - resolution: {integrity: sha512-KOEGMu6dmJZtpadb476IsZBclKvILjopjUii3V+7MnXIQCYh8W3NgNcgwo21n9LXZX6EDIKvqfjYxXebDwxKmQ==} - dev: true - - /@types/stylis@4.2.4: - resolution: {integrity: sha512-36ZrGJ8fgtBr6nwNnuJ9jXIj+bn/pF6UoqmrQT7+Y99+tFFeHHsoR54+194dHdyhPjgbeoNz3Qru0oRt0l6ASQ==} - dev: true - - /asynckit@0.4.0: - resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} - dev: true - - /axios@1.6.2: - resolution: {integrity: sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A==} - dependencies: - follow-redirects: 1.15.3 - form-data: 4.0.0 - proxy-from-env: 1.1.0 - transitivePeerDependencies: - - debug - dev: true - - /camelize@1.0.1: - resolution: {integrity: sha512-dU+Tx2fsypxTgtLoE36npi3UqcjSSMNYfkqgmoEhtZrraP5VWq0K7FkWVTYa8eMPtnU/G2txVsfdCJTn9uzpuQ==} - dev: true - - /combined-stream@1.0.8: - resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} - engines: {node: '>= 0.8'} - dependencies: - delayed-stream: 1.0.0 - dev: true - - /css-color-keywords@1.0.0: - resolution: {integrity: sha512-FyyrDHZKEjXDpNJYvVsV960FiqQyXc/LlYmsxl2BcdMb2WPx0OGRVgTg55rPSyLSNMqP52R9r8geSp7apN3Ofg==} - engines: {node: '>=4'} - dev: true - - /css-to-react-native@3.2.0: - resolution: {integrity: sha512-e8RKaLXMOFii+02mOlqwjbD00KSEKqblnpO9e++1aXS1fPQOpS1YoqdVHBqPjHNoxeF2mimzVqawm2KCbEdtHQ==} - dependencies: - camelize: 1.0.1 - css-color-keywords: 1.0.0 - postcss-value-parser: 4.2.0 - dev: true - - /csstype@3.1.2: - resolution: {integrity: sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==} - dev: true - - /delayed-stream@1.0.0: - resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} - engines: {node: '>=0.4.0'} - dev: true - - /follow-redirects@1.15.3: - resolution: {integrity: sha512-1VzOtuEM8pC9SFU1E+8KfTjZyMztRsgEfwQl44z8A25uy13jSzTj6dyK2Df52iV0vgHCfBwLhDWevLn95w5v6Q==} - engines: {node: '>=4.0'} - peerDependencies: - debug: '*' - peerDependenciesMeta: - debug: - optional: true - dev: true - - /form-data@4.0.0: - resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==} - engines: {node: '>= 6'} - dependencies: - asynckit: 0.4.0 - combined-stream: 1.0.8 - mime-types: 2.1.35 - dev: true - - /js-tokens@4.0.0: - resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} - dev: true - - /loose-envify@1.4.0: - resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==} - hasBin: true - dependencies: - js-tokens: 4.0.0 - dev: true - - /mime-db@1.52.0: - resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} - engines: {node: '>= 0.6'} - dev: true - - /mime-types@2.1.35: - resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} - engines: {node: '>= 0.6'} - dependencies: - mime-db: 1.52.0 - dev: true - - /nanoid@3.3.7: - resolution: {integrity: sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==} - engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} - hasBin: true - dev: true - - /picocolors@1.0.0: - resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==} - dev: true - - /postcss-value-parser@4.2.0: - resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==} - dev: true - - /postcss@8.4.33: - resolution: {integrity: sha512-Kkpbhhdjw2qQs2O2DGX+8m5OVqEcbB9HRBvuYM9pgrjEFUg30A9LmXNlTAUj4S9kgtGyrMbTzVjH7E+s5Re2yg==} - engines: {node: ^10 || ^12 || >=14} - dependencies: - nanoid: 3.3.7 - picocolors: 1.0.0 - source-map-js: 1.0.2 - dev: true - - /proxy-from-env@1.1.0: - resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==} - dev: true - - /react-dom@18.2.0(react@18.2.0): - resolution: {integrity: sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==} - peerDependencies: - react: ^18.2.0 - dependencies: - loose-envify: 1.4.0 - react: 18.2.0 - scheduler: 0.23.0 - dev: true - - /react@18.2.0: - resolution: {integrity: sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==} - engines: {node: '>=0.10.0'} - dependencies: - loose-envify: 1.4.0 - dev: true - - /scheduler@0.23.0: - resolution: {integrity: sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw==} - dependencies: - loose-envify: 1.4.0 - dev: true - - /shallowequal@1.1.0: - resolution: {integrity: sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ==} - dev: true - - /source-map-js@1.0.2: - resolution: {integrity: sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==} - engines: {node: '>=0.10.0'} - dev: true - - /styled-components@6.1.1(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-cpZZP5RrKRIClBW5Eby4JM1wElLVP4NQrJbJ0h10TidTyJf4SIIwa3zLXOoPb4gJi8MsJ8mjq5mu2IrEhZIAcQ==} - engines: {node: '>= 16'} - peerDependencies: - react: '>= 16.8.0' - react-dom: '>= 16.8.0' - dependencies: - '@emotion/is-prop-valid': 1.2.1 - '@emotion/unitless': 0.8.1 - '@types/stylis': 4.2.4 - css-to-react-native: 3.2.0 - csstype: 3.1.2 - postcss: 8.4.33 - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - shallowequal: 1.1.0 - stylis: 4.3.0 - tslib: 2.6.2 - dev: true - - /stylis@4.3.0: - resolution: {integrity: sha512-E87pIogpwUsUwXw7dNyU4QDjdgVMy52m+XEOPEKUn161cCzWjjhPSQhByfd1CcNvrOLnXQ6OnnZDwnJrz/Z4YQ==} - dev: true - - /tslib@2.6.2: - resolution: {integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==} - dev: true diff --git a/fixtures/tsconfig/cases/builtins/thing.js b/fixtures/tsconfig/cases/builtins/thing.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/builtins/tsconfig.json b/fixtures/tsconfig/cases/builtins/tsconfig.json deleted file mode 100644 index 36aa1a4d..00000000 --- a/fixtures/tsconfig/cases/builtins/tsconfig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compilerOptions": { - "baseUrl": "." - } -} diff --git a/fixtures/tsconfig/cases/exports/index.js b/fixtures/tsconfig/cases/exports/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/exports/tsconfig.json b/fixtures/tsconfig/cases/exports/tsconfig.json deleted file mode 100644 index f0e3159b..00000000 --- a/fixtures/tsconfig/cases/exports/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-exports" -} diff --git a/fixtures/tsconfig/cases/extends-extension/base-tsconfig.json b/fixtures/tsconfig/cases/extends-extension/base-tsconfig.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/cases/extends-extension/base-tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/cases/extends-extension/foo.js b/fixtures/tsconfig/cases/extends-extension/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-extension/tsconfig.json b/fixtures/tsconfig/cases/extends-extension/tsconfig.json deleted file mode 100644 index 0ae4c6a3..00000000 --- a/fixtures/tsconfig/cases/extends-extension/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./base-tsconfig" -} diff --git a/fixtures/tsconfig/cases/extends-extensionless/foo.js b/fixtures/tsconfig/cases/extends-extensionless/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-extensionless/tsconfig.json b/fixtures/tsconfig/cases/extends-extensionless/tsconfig.json deleted file mode 100644 index c36cb7d4..00000000 --- a/fixtures/tsconfig/cases/extends-extensionless/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-field/conf" -} diff --git a/fixtures/tsconfig/cases/extends-multiple/foo.js b/fixtures/tsconfig/cases/extends-multiple/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-multiple/tsconfig.json b/fixtures/tsconfig/cases/extends-multiple/tsconfig.json deleted file mode 100644 index aa2ae783..00000000 --- a/fixtures/tsconfig/cases/extends-multiple/tsconfig.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": ["../extends-extension", "../extends-paths"], - "compilerOptions": { - "baseUrl": ".", - }, -} diff --git a/fixtures/tsconfig/cases/extends-not-found/index.js b/fixtures/tsconfig/cases/extends-not-found/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-not-found/tsconfig.json b/fixtures/tsconfig/cases/extends-not-found/tsconfig.json deleted file mode 100644 index 99df91da..00000000 --- a/fixtures/tsconfig/cases/extends-not-found/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./not-found" -} diff --git a/fixtures/tsconfig/cases/extends-paths/src/index.js b/fixtures/tsconfig/cases/extends-paths/src/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-paths/tsconfig.base.json b/fixtures/tsconfig/cases/extends-paths/tsconfig.base.json deleted file mode 100644 index 5c64b067..00000000 --- a/fixtures/tsconfig/cases/extends-paths/tsconfig.base.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "@/*": ["./*"] - } - } -} diff --git a/fixtures/tsconfig/cases/extends-paths/tsconfig.json b/fixtures/tsconfig/cases/extends-paths/tsconfig.json deleted file mode 100644 index 51086018..00000000 --- a/fixtures/tsconfig/cases/extends-paths/tsconfig.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": "./tsconfig.base.json", - "compilerOptions": { - "baseUrl": "src", - }, -} diff --git a/fixtures/tsconfig/cases/field/index.js b/fixtures/tsconfig/cases/field/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/field/tsconfig.json b/fixtures/tsconfig/cases/field/tsconfig.json deleted file mode 100644 index 9f86c3f4..00000000 --- a/fixtures/tsconfig/cases/field/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-field" -} diff --git a/fixtures/tsconfig/cases/index/index.js b/fixtures/tsconfig/cases/index/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/index/tsconfig.json b/fixtures/tsconfig/cases/index/tsconfig.json deleted file mode 100644 index d20b1774..00000000 --- a/fixtures/tsconfig/cases/index/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-index" -} diff --git a/fixtures/tsconfig/cases/paths_template_variable/foo.js b/fixtures/tsconfig/cases/paths_template_variable/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json b/fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json deleted file mode 100644 index a1a37bb6..00000000 --- a/fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "../../tsconfig_template_variable.json" -} diff --git a/fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json b/fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json deleted file mode 100644 index e7d8e5e5..00000000 --- a/fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "compilerOptions": { - "composite": true, - "paths": { - "foo": ["${configDir}/foo.js"] - } - } -} diff --git a/fixtures/tsconfig/cases/project_references/app/aliased/index.ts b/fixtures/tsconfig/cases/project_references/app/aliased/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/app/index.ts b/fixtures/tsconfig/cases/project_references/app/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/app/tsconfig.json b/fixtures/tsconfig/cases/project_references/app/tsconfig.json deleted file mode 100644 index 7036d2bb..00000000 --- a/fixtures/tsconfig/cases/project_references/app/tsconfig.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "extends": "../tsconfig.base.json", - "compilerOptions": { - "baseUrl": "./", - "paths": { - "@/*": ["./aliased/*"] - } - }, - "references": [ - { - "path": "../project_a/conf.json" - }, - { - "path": "../project_b" - }, - { - "path": "../project_c/tsconfig.json" - }, - { - "path": "../../paths_template_variable/tsconfig2.json" - } - ] -} diff --git a/fixtures/tsconfig/cases/project_references/project_a/aliased/index.ts b/fixtures/tsconfig/cases/project_references/project_a/aliased/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_a/conf.json b/fixtures/tsconfig/cases/project_references/project_a/conf.json deleted file mode 100644 index 4d389d7a..00000000 --- a/fixtures/tsconfig/cases/project_references/project_a/conf.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "compilerOptions": { - "composite": true, - "paths": { - "@/*": ["./aliased/*"] - } - } -} diff --git a/fixtures/tsconfig/cases/project_references/project_a/index.ts b/fixtures/tsconfig/cases/project_references/project_a/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_b/src/aliased/index.ts b/fixtures/tsconfig/cases/project_references/project_b/src/aliased/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_b/tsconfig.json b/fixtures/tsconfig/cases/project_references/project_b/tsconfig.json deleted file mode 100644 index 4ab05cd8..00000000 --- a/fixtures/tsconfig/cases/project_references/project_b/tsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "compilerOptions": { - "composite": true, - "baseUrl": "./src", - "paths": { - "@/*": ["./aliased/*"] - } - } -} diff --git a/fixtures/tsconfig/cases/project_references/project_c/index.ts b/fixtures/tsconfig/cases/project_references/project_c/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_c/tsconfig.json b/fixtures/tsconfig/cases/project_references/project_c/tsconfig.json deleted file mode 100644 index fe520939..00000000 --- a/fixtures/tsconfig/cases/project_references/project_c/tsconfig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compilerOptions": { - "composite": true - } -} diff --git a/fixtures/tsconfig/cases/project_references/tsconfig.base.json b/fixtures/tsconfig/cases/project_references/tsconfig.base.json deleted file mode 100644 index 88ccffe7..00000000 --- a/fixtures/tsconfig/cases/project_references/tsconfig.base.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "compilerOptions": { - } -} diff --git a/fixtures/tsconfig/cases/suffixes/a.ios.ts b/fixtures/tsconfig/cases/suffixes/a.ios.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/a.ts b/fixtures/tsconfig/cases/suffixes/a.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/b.ts b/fixtures/tsconfig/cases/suffixes/b.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/c-test.ts b/fixtures/tsconfig/cases/suffixes/c-test.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/index.ts b/fixtures/tsconfig/cases/suffixes/index.ts deleted file mode 100644 index b09939b9..00000000 --- a/fixtures/tsconfig/cases/suffixes/index.ts +++ /dev/null @@ -1 +0,0 @@ -import './a'; diff --git a/fixtures/tsconfig/cases/suffixes/tsconfig.json b/fixtures/tsconfig/cases/suffixes/tsconfig.json deleted file mode 100644 index 4c2ccc8f..00000000 --- a/fixtures/tsconfig/cases/suffixes/tsconfig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compilerOptions": { - "moduleSuffixes": [".ios", "-test", ""] - } -} diff --git a/fixtures/tsconfig/cases/trailing-comma/bar.js b/fixtures/tsconfig/cases/trailing-comma/bar.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/trailing-comma/index.js b/fixtures/tsconfig/cases/trailing-comma/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/trailing-comma/tsconfig.json b/fixtures/tsconfig/cases/trailing-comma/tsconfig.json deleted file mode 100644 index 6dc20ca5..00000000 --- a/fixtures/tsconfig/cases/trailing-comma/tsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "compilerOptions": { - "paths": { - /* some comment */ - "foo": ["bar.js"], - }, - }, - // another comment -} diff --git a/fixtures/tsconfig/foo.js b/fixtures/tsconfig/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/nested/index.js b/fixtures/tsconfig/nested/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/nested/test.js b/fixtures/tsconfig/nested/test.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/nested/tsconfig.json b/fixtures/tsconfig/nested/tsconfig.json deleted file mode 100644 index 6deb3011..00000000 --- a/fixtures/tsconfig/nested/tsconfig.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "extends": "..", - "compilerOptions": { - "paths": { - "ts-path": ["test.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-exports/conf.json b/fixtures/tsconfig/node_modules/tsconfig-exports/conf.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-exports/conf.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-exports/foo.js b/fixtures/tsconfig/node_modules/tsconfig-exports/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-exports/package.json b/fixtures/tsconfig/node_modules/tsconfig-exports/package.json deleted file mode 100644 index be0ddee6..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-exports/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "tsconfig-exports", - "private": true, - "exports": { - ".": "./conf.json" - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-field/conf.json b/fixtures/tsconfig/node_modules/tsconfig-field/conf.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-field/conf.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-field/foo.js b/fixtures/tsconfig/node_modules/tsconfig-field/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-field/package.json b/fixtures/tsconfig/node_modules/tsconfig-field/package.json deleted file mode 100644 index 7138fdde..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-field/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "tsconfig-field", - "private": true, - "tsconfig": "conf.json" -} \ No newline at end of file diff --git a/fixtures/tsconfig/node_modules/tsconfig-index/foo.js b/fixtures/tsconfig/node_modules/tsconfig-index/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-index/package.json b/fixtures/tsconfig/node_modules/tsconfig-index/package.json deleted file mode 100644 index eb2431e7..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-index/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "tsconfig-index", - "private": true -} \ No newline at end of file diff --git a/fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json b/fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-not-used/foo.js b/fixtures/tsconfig/node_modules/tsconfig-not-used/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json b/fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json deleted file mode 100644 index eb16d127..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "ts-path": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/package.json b/fixtures/tsconfig/package.json deleted file mode 100755 index f48acd1c..00000000 --- a/fixtures/tsconfig/package.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "name": "resolver", - "private": true, - "alias": { - "aliased": "foo", - "aliased-file": "./bar.js", - "something": "./nested/test.js", - "aliasedfolder": "./nested", - "aliasedabsolute": "/nested", - "foo/bar": "./bar.js", - "glob/*/*": "./nested/$2", - "./baz": "./bar.js", - "url": false - }, - "imports": { - "#test": "./bar.js" - }, - "dependencies": { - "foo": "^0.3.4" - }, - "peerDependencies": { - "bar": "*" - } -} diff --git a/fixtures/tsconfig/tsconfig.json b/fixtures/tsconfig/tsconfig.json deleted file mode 100644 index eb16d127..00000000 --- a/fixtures/tsconfig/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "ts-path": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/tsconfig_broken.json b/fixtures/tsconfig/tsconfig_broken.json deleted file mode 100644 index 98232c64..00000000 --- a/fixtures/tsconfig/tsconfig_broken.json +++ /dev/null @@ -1 +0,0 @@ -{ diff --git a/fixtures/tsconfig/tsconfig_template_variable.json b/fixtures/tsconfig/tsconfig_template_variable.json deleted file mode 100644 index 6f272344..00000000 --- a/fixtures/tsconfig/tsconfig_template_variable.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["${configDir}/foo.js"] - } - } -} diff --git a/napi/Source/lib.rs b/napi/Source/lib.rs index 96287041..dc9b8249 100644 --- a/napi/Source/lib.rs +++ b/napi/Source/lib.rs @@ -10,9 +10,13 @@ use std::{ use napi_derive::napi; use oxc_resolver::{ResolveOptions, Resolver}; -use self::options::{NapiResolveOptions, StrOrStrList}; +use self::{ + options::{NapiResolveOptions, StrOrStrList}, + tracing::init_tracing, +}; mod options; +mod tracing; #[napi(object)] pub struct ResolveResult { @@ -47,6 +51,7 @@ pub struct ResolverFactory { impl ResolverFactory { #[napi(constructor)] pub fn new(options: NapiResolveOptions) -> Self { + init_tracing(); Self { resolver: Arc::new(Resolver::new(Self::normalize_options(options))) } } @@ -70,17 +75,19 @@ impl ResolverFactory { self.resolver.clear_cache(); } + /// Synchronously resolve `specifier` at an absolute path to a `directory`. #[allow(clippy::needless_pass_by_value)] #[napi] - pub fn sync(&self, path: String, request: String) -> ResolveResult { - let path = PathBuf::from(path); + pub fn sync(&self, directory: String, request: String) -> ResolveResult { + let path = PathBuf::from(directory); resolve(&self.resolver, &path, &request) } + /// Asynchronously resolve `specifier` at an absolute path to a `directory`. #[allow(clippy::needless_pass_by_value)] #[napi(js_name = "async")] - pub async fn resolve_async(&self, path: String, request: String) -> ResolveResult { - let path = PathBuf::from(path); + pub async fn resolve_async(&self, directory: String, request: String) -> ResolveResult { + let path = PathBuf::from(directory); let resolver = self.resolver.clone(); tokio::spawn(async move { resolve(&resolver, &path, &request) }).await.unwrap() } diff --git a/napi/src/tracing.rs b/napi/Source/tracing.rs similarity index 100% rename from napi/src/tracing.rs rename to napi/Source/tracing.rs diff --git a/napi/__test__/resolver.spec.mjs b/napi/__test__/resolver.spec.mjs deleted file mode 100644 index ac6ee0ef..00000000 --- a/napi/__test__/resolver.spec.mjs +++ /dev/null @@ -1,260 +0,0 @@ -import { join } from 'node:path' -import { fileURLToPath } from 'node:url' - -import test from 'ava' - -let ResolverFactory - -if (process.env.WASI_TEST) { - const wasi = await import('../resolver.wasi.cjs') - ResolverFactory = wasi.ResolverFactory -} else { - const napi = await import('../index.js') - ResolverFactory = napi.ResolverFactory -} - -const currentDir = join(fileURLToPath(import.meta.url), '..') - -const enhancedResolveRoot = join( - currentDir, - '..', - '..', - 'fixtures', - 'enhanced_resolve', - 'test', - 'fixtures' -) - -// https://github.com/webpack/enhanced-resolve/blob/main/test/resolve.test.js - -for (const [title, context, request, expected] of [ - [ - 'absolute path', - enhancedResolveRoot, - join(enhancedResolveRoot, 'main1.js'), - join(enhancedResolveRoot, 'main1.js'), - ], - [ - 'file with .js', - enhancedResolveRoot, - './main1.js', - join(enhancedResolveRoot, 'main1.js'), - ], - [ - 'file without extension', - enhancedResolveRoot, - './main1', - join(enhancedResolveRoot, 'main1.js'), - ], - [ - 'another file with .js', - enhancedResolveRoot, - './a.js', - join(enhancedResolveRoot, 'a.js'), - ], - [ - 'another file without extension', - enhancedResolveRoot, - './a', - join(enhancedResolveRoot, 'a.js'), - ], - [ - 'file in module with .js', - enhancedResolveRoot, - 'm1/a.js', - join(enhancedResolveRoot, 'node_modules/m1/a.js'), - ], - [ - 'file in module without extension', - enhancedResolveRoot, - 'm1/a', - join(enhancedResolveRoot, 'node_modules/m1/a.js'), - ], - [ - 'another file in module without extension', - enhancedResolveRoot, - 'complexm/step1', - join(enhancedResolveRoot, 'node_modules/complexm/step1.js'), - ], - [ - 'from submodule to file in sibling module', - join(enhancedResolveRoot, 'node_modules/complexm'), - 'm2/b.js', - join(enhancedResolveRoot, 'node_modules/m2/b.js'), - ], - [ - 'from nested directory to overwritten file in module', - join(enhancedResolveRoot, 'multiple_modules'), - 'm1/a.js', - join(enhancedResolveRoot, 'multiple_modules/node_modules/m1/a.js'), - ], - [ - 'from nested directory to not overwritten file in module', - join(enhancedResolveRoot, 'multiple_modules'), - 'm1/b.js', - join(enhancedResolveRoot, 'node_modules/m1/b.js'), - ], - [ - 'file with query', - enhancedResolveRoot, - './main1.js?query', - join(enhancedResolveRoot, 'main1.js?query'), - ], - [ - 'file with fragment', - enhancedResolveRoot, - './main1.js#fragment', - join(enhancedResolveRoot, 'main1.js#fragment'), - ], - [ - 'file with fragment and query', - enhancedResolveRoot, - './main1.js#fragment?query', - join(enhancedResolveRoot, 'main1.js#fragment?query'), - ], - [ - 'file with query and fragment', - enhancedResolveRoot, - './main1.js?#fragment', - join(enhancedResolveRoot, 'main1.js?#fragment'), - ], - - [ - 'file with query (unicode)', - enhancedResolveRoot, - './测试.js?query', - join(enhancedResolveRoot, '测试.js?query'), - ], - [ - 'file with fragment (unicode)', - enhancedResolveRoot, - './测试.js#fragment', - join(enhancedResolveRoot, '测试.js#fragment'), - ], - [ - 'file with fragment and query (unicode)', - enhancedResolveRoot, - './测试.js#fragment?query', - join(enhancedResolveRoot, '测试.js#fragment?query'), - ], - [ - 'file with query and fragment (unicode)', - enhancedResolveRoot, - './测试.js?#fragment', - join(enhancedResolveRoot, '测试.js?#fragment'), - ], - - [ - 'file in module with query', - enhancedResolveRoot, - 'm1/a?query', - join(enhancedResolveRoot, 'node_modules/m1/a.js?query'), - ], - [ - 'file in module with fragment', - enhancedResolveRoot, - 'm1/a#fragment', - join(enhancedResolveRoot, 'node_modules/m1/a.js#fragment'), - ], - [ - 'file in module with fragment and query', - enhancedResolveRoot, - 'm1/a#fragment?query', - join(enhancedResolveRoot, 'node_modules/m1/a.js#fragment?query'), - ], - [ - 'file in module with query and fragment', - enhancedResolveRoot, - 'm1/a?#fragment', - join(enhancedResolveRoot, 'node_modules/m1/a.js?#fragment'), - ], - [ - 'differ between directory and file, resolve file', - enhancedResolveRoot, - './dirOrFile', - join(enhancedResolveRoot, 'dirOrFile.js'), - ], - [ - 'differ between directory and file, resolve directory', - enhancedResolveRoot, - './dirOrFile/', - join(enhancedResolveRoot, 'dirOrFile/index.js'), - ], - [ - 'find node_modules outside of node_modules', - join(enhancedResolveRoot, 'browser-module/node_modules'), - 'm1/a', - join(enhancedResolveRoot, 'node_modules/m1/a.js'), - ], - [ - "don't crash on main field pointing to self", - enhancedResolveRoot, - './main-field-self', - join(enhancedResolveRoot, './main-field-self/index.js'), - ], - [ - "don't crash on main field pointing to self (2)", - enhancedResolveRoot, - './main-field-self2', - join(enhancedResolveRoot, './main-field-self2/index.js'), - ], - // enhanced-resolve has `#` prepended with a `\0`, they are removed from the - // following 3 expected test results. - // See https://github.com/webpack/enhanced-resolve#escaping - [ - 'handle fragment edge case (no fragment)', - enhancedResolveRoot, - './no#fragment/#/#', - join(enhancedResolveRoot, 'no#fragment', '#', '#.js'), - ], - [ - 'handle fragment edge case (fragment)', - enhancedResolveRoot, - './no#fragment/#/', - join(enhancedResolveRoot, 'no.js#fragment') + '/#/', - ], - [ - 'handle fragment escaping', - enhancedResolveRoot, - './no\0#fragment/\0#/\0##fragment', - join(enhancedResolveRoot, 'no#fragment', '#', '#.js#fragment'), - ], -]) { - test(title, (t) => { - const resolver = new ResolverFactory({ - modules: ['src/a', 'src/b', 'src/common', 'node_modules'], - extensions: ['.js', '.jsx', '.ts', '.tsx'], - }) - - t.is(resolver.sync(context, request).path, expected) - }) -} - -test('resolve pnpm package', (t) => { - const rootDir = join(currentDir, '..', '..'); - const pnpmProjectPath = join(rootDir, 'fixtures', 'pnpm') - const resolver = new ResolverFactory({ - aliasFields: ['browser'], - }) - t.deepEqual(resolver.sync(pnpmProjectPath, 'styled-components'), { - path: join( - rootDir, - 'node_modules/.pnpm/styled-components@6.1.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/styled-components/dist/styled-components.browser.cjs.js' - ), - }) - t.deepEqual( - resolver.sync( - join( - rootDir, - 'node_modules/.pnpm/styled-components@6.1.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/styled-components' - ), - 'react' - ), - { - path: join( - rootDir, - 'node_modules/.pnpm/react@18.3.1/node_modules/react/index.js' - ), - } - ) -}) diff --git a/napi/src/lib.rs b/napi/src/lib.rs deleted file mode 100644 index dc9b8249..00000000 --- a/napi/src/lib.rs +++ /dev/null @@ -1,186 +0,0 @@ -extern crate napi; -extern crate napi_derive; -extern crate oxc_resolver; - -use std::{ - path::{Path, PathBuf}, - sync::Arc, -}; - -use napi_derive::napi; -use oxc_resolver::{ResolveOptions, Resolver}; - -use self::{ - options::{NapiResolveOptions, StrOrStrList}, - tracing::init_tracing, -}; - -mod options; -mod tracing; - -#[napi(object)] -pub struct ResolveResult { - pub path: Option, - pub error: Option, -} - -fn resolve(resolver: &Resolver, path: &Path, request: &str) -> ResolveResult { - match resolver.resolve(path, request) { - Ok(resolution) => ResolveResult { - path: Some(resolution.full_path().to_string_lossy().to_string()), - error: None, - }, - Err(err) => ResolveResult { path: None, error: Some(err.to_string()) }, - } -} - -#[allow(clippy::needless_pass_by_value)] -#[napi] -pub fn sync(path: String, request: String) -> ResolveResult { - let path = PathBuf::from(path); - let resolver = Resolver::new(ResolveOptions::default()); - resolve(&resolver, &path, &request) -} - -#[napi] -pub struct ResolverFactory { - resolver: Arc, -} - -#[napi] -impl ResolverFactory { - #[napi(constructor)] - pub fn new(options: NapiResolveOptions) -> Self { - init_tracing(); - Self { resolver: Arc::new(Resolver::new(Self::normalize_options(options))) } - } - - #[napi] - pub fn default() -> Self { - let default_options = ResolveOptions::default(); - Self { resolver: Arc::new(Resolver::new(default_options)) } - } - - /// Clone the resolver using the same underlying cache. - #[napi] - pub fn clone_with_options(&self, options: NapiResolveOptions) -> Self { - Self { - resolver: Arc::new(self.resolver.clone_with_options(Self::normalize_options(options))), - } - } - - /// Clear the underlying cache. - #[napi] - pub fn clear_cache(&self) { - self.resolver.clear_cache(); - } - - /// Synchronously resolve `specifier` at an absolute path to a `directory`. - #[allow(clippy::needless_pass_by_value)] - #[napi] - pub fn sync(&self, directory: String, request: String) -> ResolveResult { - let path = PathBuf::from(directory); - resolve(&self.resolver, &path, &request) - } - - /// Asynchronously resolve `specifier` at an absolute path to a `directory`. - #[allow(clippy::needless_pass_by_value)] - #[napi(js_name = "async")] - pub async fn resolve_async(&self, directory: String, request: String) -> ResolveResult { - let path = PathBuf::from(directory); - let resolver = self.resolver.clone(); - tokio::spawn(async move { resolve(&resolver, &path, &request) }).await.unwrap() - } - - fn normalize_options(op: NapiResolveOptions) -> ResolveOptions { - let default = ResolveOptions::default(); - // merging options - ResolveOptions { - tsconfig: op.tsconfig.map(|tsconfig| tsconfig.into()), - alias: op - .alias - .map(|alias| { - alias - .into_iter() - .map(|(k, v)| { - let v = v - .into_iter() - .map(|item| match item { - Some(path) => oxc_resolver::AliasValue::from(path), - None => oxc_resolver::AliasValue::Ignore, - }) - .collect(); - (k, v) - }) - .collect::>() - }) - .unwrap_or(default.alias), - alias_fields: op - .alias_fields - .map(|o| o.into_iter().map(|x| StrOrStrList(x).into()).collect::>()) - .unwrap_or(default.alias_fields), - condition_names: op.condition_names.unwrap_or(default.condition_names), - description_files: op.description_files.unwrap_or(default.description_files), - enforce_extension: op - .enforce_extension - .map(|enforce_extension| enforce_extension.into()) - .unwrap_or(default.enforce_extension), - exports_fields: op - .exports_fields - .map(|o| o.into_iter().map(|x| StrOrStrList(x).into()).collect::>()) - .unwrap_or(default.exports_fields), - imports_fields: op - .imports_fields - .map(|o| o.into_iter().map(|x| StrOrStrList(x).into()).collect::>()) - .unwrap_or(default.imports_fields), - extension_alias: op - .extension_alias - .map(|extension_alias| extension_alias.into_iter().collect::>()) - .unwrap_or(default.extension_alias), - extensions: op.extensions.unwrap_or(default.extensions), - fallback: op - .fallback - .map(|fallback| { - fallback - .into_iter() - .map(|(k, v)| { - let v = v - .into_iter() - .map(|item| match item { - Some(path) => oxc_resolver::AliasValue::from(path), - None => oxc_resolver::AliasValue::Ignore, - }) - .collect(); - (k, v) - }) - .collect::>() - }) - .unwrap_or(default.fallback), - fully_specified: op.fully_specified.unwrap_or(default.fully_specified), - main_fields: op - .main_fields - .map(|o| StrOrStrList(o).into()) - .unwrap_or(default.main_fields), - main_files: op.main_files.unwrap_or(default.main_files), - modules: op.modules.map(|o| StrOrStrList(o).into()).unwrap_or(default.modules), - resolve_to_context: op.resolve_to_context.unwrap_or(default.resolve_to_context), - prefer_relative: op.prefer_relative.unwrap_or(default.prefer_relative), - prefer_absolute: op.prefer_absolute.unwrap_or(default.prefer_absolute), - restrictions: op - .restrictions - .map(|restrictions| { - restrictions - .into_iter() - .map(|restriction| restriction.into()) - .collect::>() - }) - .unwrap_or(default.restrictions), - roots: op - .roots - .map(|roots| roots.into_iter().map(PathBuf::from).collect::>()) - .unwrap_or(default.roots), - symlinks: op.symlinks.unwrap_or(default.symlinks), - builtin_modules: op.builtin_modules.unwrap_or(default.builtin_modules), - } - } -} diff --git a/napi/src/options.rs b/napi/src/options.rs deleted file mode 100644 index ea35672f..00000000 --- a/napi/src/options.rs +++ /dev/null @@ -1,261 +0,0 @@ -use std::path::PathBuf; - -use napi::Either; -use napi_derive::napi; -use std::collections::HashMap; - -/// Module Resolution Options -/// -/// Options are directly ported from [enhanced-resolve](https://github.com/webpack/enhanced-resolve#resolver-options). -/// -/// See [webpack resolve](https://webpack.js.org/configuration/resolve/) for information and examples -#[derive(Debug, Clone)] -#[napi(object)] -pub struct NapiResolveOptions { - /// Path to TypeScript configuration file. - /// - /// Default `None` - pub tsconfig: Option, - - /// Alias for [ResolveOptions::alias] and [ResolveOptions::fallback]. - /// - /// For the second value of the tuple, `None -> AliasValue::Ignore`, Some(String) -> - /// AliasValue::Path(String)` - /// Create aliases to import or require certain modules more easily. - /// A trailing $ can also be added to the given object's keys to signify an exact match. - pub alias: Option>>>, - - /// A list of alias fields in description files. - /// Specify a field, such as `browser`, to be parsed according to [this specification](https://github.com/defunctzombie/package-browser-field-spec). - /// Can be a path to json object such as `["path", "to", "exports"]`. - /// - /// Default `[]` - #[napi(ts_type = "(string | string[])[]")] - pub alias_fields: Option>, - - /// Condition names for exports field which defines entry points of a package. - /// The key order in the exports field is significant. During condition matching, earlier entries have higher priority and take precedence over later entries. - /// - /// Default `[]` - pub condition_names: Option>, - - /// The JSON files to use for descriptions. (There was once a `bower.json`.) - /// - /// Default `["package.json"]` - pub description_files: Option>, - - /// If true, it will not allow extension-less files. - /// So by default `require('./foo')` works if `./foo` has a `.js` extension, - /// but with this enabled only `require('./foo.js')` will work. - /// - /// Default to `true` when [ResolveOptions::extensions] contains an empty string. - /// Use `Some(false)` to disable the behavior. - /// See - /// - /// Default None, which is the same as `Some(false)` when the above empty rule is not applied. - pub enforce_extension: Option, - - /// A list of exports fields in description files. - /// Can be a path to json object such as `["path", "to", "exports"]`. - /// - /// Default `[["exports"]]`. - #[napi(ts_type = "(string | string[])[]")] - pub exports_fields: Option>, - - /// Fields from `package.json` which are used to provide the internal requests of a package - /// (requests starting with # are considered internal). - /// - /// Can be a path to a JSON object such as `["path", "to", "imports"]`. - /// - /// Default `[["imports"]]`. - #[napi(ts_type = "(string | string[])[]")] - pub imports_fields: Option>, - - /// An object which maps extension to extension aliases. - /// - /// Default `{}` - pub extension_alias: Option>>, - - /// Attempt to resolve these extensions in order. - /// If multiple files share the same name but have different extensions, - /// will resolve the one with the extension listed first in the array and skip the rest. - /// - /// Default `[".js", ".json", ".node"]` - pub extensions: Option>, - - /// Redirect module requests when normal resolving fails. - /// - /// Default `[]` - pub fallback: Option>>>, - - /// 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). - /// - /// See also webpack configuration [resolve.fullySpecified](https://webpack.js.org/configuration/module/#resolvefullyspecified) - /// - /// Default `false` - pub fully_specified: Option, - - /// A list of main fields in description files - /// - /// Default `["main"]`. - #[napi(ts_type = "string | string[]")] - pub main_fields: Option, - - /// The filename to be used while resolving directories. - /// - /// Default `["index"]` - pub main_files: Option>, - - /// A list of directories to resolve modules from, can be absolute path or folder name. - /// - /// Default `["node_modules"]` - #[napi(ts_type = "string | string[]")] - pub modules: Option, - - /// Resolve to a context instead of a file. - /// - /// Default `false` - pub resolve_to_context: Option, - - /// Prefer to resolve module requests as relative requests instead of using modules from node_modules directories. - /// - /// Default `false` - pub prefer_relative: Option, - - /// Prefer to resolve server-relative urls as absolute paths before falling back to resolve in ResolveOptions::roots. - /// - /// Default `false` - pub prefer_absolute: Option, - - /// A list of resolve restrictions to restrict the paths that a request can be resolved on. - /// - /// Default `[]` - pub restrictions: Option>, - - /// A list of directories where requests of server-relative URLs (starting with '/') are resolved. - /// On non-Windows systems these requests are resolved as an absolute path first. - /// - /// Default `[]` - pub roots: Option>, - - /// Whether to resolve symlinks to their symlinked location. - /// When enabled, symlinked resources are resolved to their real path, not their symlinked location. - /// Note that this may cause module resolution to fail when using tools that symlink packages (like npm link). - /// - /// Default `true` - pub symlinks: Option, - - /// Whether to parse [module.builtinModules](https://nodejs.org/api/module.html#modulebuiltinmodules) or not. - /// For example, "zlib" will throw [crate::ResolveError::Builtin] when set to true. - /// - /// Default `false` - pub builtin_modules: Option, -} - -#[napi] -#[derive(Debug, PartialEq, Eq)] -pub enum EnforceExtension { - Auto, - Enabled, - Disabled, -} - -impl EnforceExtension { - pub fn is_auto(&self) -> bool { - *self == Self::Auto - } - - pub fn is_enabled(&self) -> bool { - *self == Self::Enabled - } - - pub fn is_disabled(&self) -> bool { - *self == Self::Disabled - } -} - -/// Alias Value for [ResolveOptions::alias] and [ResolveOptions::fallback]. -/// Use struct because napi don't support structured union now -#[napi(object)] -#[derive(Debug, Clone)] -pub struct Restriction { - pub path: Option, - pub regex: Option, -} - -/// Tsconfig Options -/// -/// Derived from [tsconfig-paths-webpack-plugin](https://github.com/dividab/tsconfig-paths-webpack-plugin#options) -#[napi(object)] -#[derive(Debug, Clone)] -pub struct TsconfigOptions { - /// Allows you to specify where to find the TypeScript configuration file. - /// You may provide - /// * a relative path to the configuration file. It will be resolved relative to cwd. - /// * an absolute path to the configuration file. - pub config_file: String, - - /// Support for Typescript Project References. - /// - /// * `'auto'`: use the `references` field from tsconfig of `config_file`. - /// * `string[]`: manually provided relative or absolute path. - #[napi(ts_type = "'auto' | string[]")] - pub references: Option>>, -} - -impl Into for Restriction { - fn into(self) -> oxc_resolver::Restriction { - match (self.path, self.regex) { - (None, None) => { - panic!("Should specify path or regex") - } - (None, Some(regex)) => oxc_resolver::Restriction::RegExp(regex), - (Some(path), None) => oxc_resolver::Restriction::Path(PathBuf::from(path)), - (Some(_), Some(_)) => { - panic!("Restriction can't be path and regex at the same time") - } - } - } -} - -impl Into for EnforceExtension { - fn into(self) -> oxc_resolver::EnforceExtension { - match self { - EnforceExtension::Auto => oxc_resolver::EnforceExtension::Auto, - EnforceExtension::Enabled => oxc_resolver::EnforceExtension::Enabled, - EnforceExtension::Disabled => oxc_resolver::EnforceExtension::Disabled, - } - } -} - -impl Into for TsconfigOptions { - fn into(self) -> oxc_resolver::TsconfigOptions { - oxc_resolver::TsconfigOptions { - config_file: PathBuf::from(self.config_file), - references: match self.references { - Some(Either::A(string)) if string.as_str() == "auto" => { - oxc_resolver::TsconfigReferences::Auto - } - Some(Either::A(opt)) => { - panic!("`{}` is not a valid option for tsconfig references", opt) - } - Some(Either::B(paths)) => oxc_resolver::TsconfigReferences::Paths( - paths.into_iter().map(PathBuf::from).collect::>(), - ), - None => oxc_resolver::TsconfigReferences::Disabled, - }, - } - } -} - -type StrOrStrListType = Either>; -pub struct StrOrStrList(pub StrOrStrListType); - -impl Into> for StrOrStrList { - fn into(self) -> Vec { - match self { - StrOrStrList(Either::A(s)) => Vec::from([s]), - StrOrStrList(Either::B(a)) => a, - } - } -} diff --git a/napi/tests/options.test.mjs b/napi/tests/options.test.mjs deleted file mode 100644 index 4a93efff..00000000 --- a/napi/tests/options.test.mjs +++ /dev/null @@ -1,59 +0,0 @@ -import { describe, it } from "node:test"; -import { ResolverFactory } from "../index.js"; -import * as assert from "node:assert"; -import * as path from "node:path"; - -const fixtureDir = new URL( - "../../fixtures/enhanced_resolve/test/fixtures", - import.meta.url -).pathname; - -describe("option", () => { - describe("aliasFields", () => { - it("should allow field string ", () => { - const resolver = new ResolverFactory({ aliasFields: ["browser"] }); - assert.match( - resolver.sync(fixtureDir, "./browser-module/lib/replaced.js").path, - /browser-module\/lib\/browser\.js$/ - ); - }); - it("should allow json path array", () => { - const resolver = new ResolverFactory({ - aliasFields: [["innerBrowser1", "field", "browser"]], - }); - - assert.match( - resolver.sync(fixtureDir, "./browser-module/lib/main1.js").path, - /browser-module\/lib\/main\.js$/ - ); - }); - }); - - describe("exportsFields", () => { - const createTest = (exportsFields) => { - const resolver = new ResolverFactory({ exportsFields }); - assert.match( - resolver.sync( - path.resolve(fixtureDir, "./exports-field3"), - "exports-field" - ).path, - /\/exports-field\/src\/index\.js$/ - ); - }; - it("should allow string as field item", createTest(["broken"])); - it("should allow json path array as field item", createTest([["broken"]])); - }); - - describe("mainFields", () => { - const createTest = (mainFields) => { - const resolver = new ResolverFactory({ mainFields }); - assert.match( - resolver.sync(fixtureDir, "../..").path, - /\/lib\/index\.js$/ - ); - }; - it("should use `'main'` as default", createTest(undefined)); - it("should allow field string", createTest("main")); - it("should allow field array", createTest(["main"])); - }); -}); diff --git a/npm/package.json b/npm/package.json index 7ec18fde..8e711b3a 100644 --- a/npm/package.json +++ b/npm/package.json @@ -1,46 +1,35 @@ { - "name": "oxc-resolver", - "version": "1.9.2", - "description": "Oxc Resolver Node API", - "main": "index.js", - "browser": "browser.js", - "files": [ - "index.d.ts", - "index.js", - "browser.js" - ], - "license": "MIT", - "homepage": "https://oxc.rs", - "repository": { - "type": "git", - "url": "git+https://github.com/oxc-project/oxc-resolver.git" - }, - "publishConfig": { - "registry": "https://registry.npmjs.org/", - "access": "public" - }, - "napi": { - "binaryName": "resolver", - "packageName": "@oxc-resolver/binding", - "wasm": { - "browser": { - "fs": true - } - }, - "targets": [ - "x86_64-pc-windows-msvc", - "aarch64-pc-windows-msvc", - "x86_64-unknown-linux-gnu", - "x86_64-unknown-linux-musl", - "aarch64-unknown-linux-gnu", - "aarch64-unknown-linux-musl", - "armv7-unknown-linux-gnueabihf", - "x86_64-apple-darwin", - "aarch64-apple-darwin", - "wasm32-wasip1-threads" - ] - }, - "funding": { - "url": "https://github.com/sponsors/Boshen" - } + "name": "oxc-resolver", + "description": "Oxc Resolver Node API", + "funding": { + "url": "https://github.com/sponsors/Boshen" + }, + "main": "index.js", + "browser": "browser.js", + "files": [ + "index.d.ts", + "index.js", + "browser.js" + ], + "napi": { + "binaryName": "resolver", + "packageName": "@oxc-resolver/binding", + "targets": [ + "x86_64-pc-windows-msvc", + "aarch64-pc-windows-msvc", + "x86_64-unknown-linux-gnu", + "x86_64-unknown-linux-musl", + "aarch64-unknown-linux-gnu", + "aarch64-unknown-linux-musl", + "armv7-unknown-linux-gnueabihf", + "x86_64-apple-darwin", + "aarch64-apple-darwin", + "wasm32-wasip1-threads" + ], + "wasm": { + "browser": { + "fs": true + } + } + } } diff --git a/package.json b/package.json index 51cb822a..a431e48f 100644 --- a/package.json +++ b/package.json @@ -1,33 +1,24 @@ { - "name": "@oxc-resolver/binding", - "private": true, - "version": "0.0.0", - "scripts": { - "build": "napi build --platform --release --package-json-path npm/package.json --manifest-path napi/Cargo.toml", - "build:debug": "napi build --platform --package-json-path npm/package.json --manifest-path napi/Cargo.toml", - "prepublishOnly": "napi pre-publish -t npm", - "test": "ava" - }, - "devDependencies": { - "@napi-rs/cli": "^3.0.0-alpha.43", - "@napi-rs/wasm-runtime": "^0.2.0", - "@types/node": "^20.10.4", - "ava": "^6.0.1", - "emnapi": "^1.0.0", - "typescript": "^5.3.3" - }, - "ava": { - "files": [ - "napi/__test__/*.spec.mjs" - ], - "cache": false - }, - "packageManager": "pnpm@9.4.0", - "repository": { - "type": "git", - "url": "git+https://github.com/oxc-project/oxc-resolver.git" - }, - "funding": { - "url": "https://github.com/sponsors/Boshen" - } + "name": "@oxc-resolver/binding", + "funding": { + "url": "https://github.com/sponsors/Boshen" + }, + "scripts": { + "build": "napi build --platform --release --package-json-path npm/package.json --manifest-path napi/Cargo.toml", + "build:debug": "napi build --platform --package-json-path npm/package.json --manifest-path napi/Cargo.toml", + "prepublishOnly": "napi pre-publish -t npm" + }, + "ava": { + "cache": false, + "files": [ + "napi/__test__/*.spec.mjs" + ] + }, + "devDependencies": { + "@napi-rs/cli": "^3.0.0-alpha.43", + "@napi-rs/wasm-runtime": "^0.2.0", + "@types/node": "^20.10.4", + "ava": "^6.0.1", + "emnapi": "^1.0.0" + } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml deleted file mode 100644 index 68c6a391..00000000 --- a/pnpm-lock.yaml +++ /dev/null @@ -1,2690 +0,0 @@ -lockfileVersion: '9.0' - -settings: - autoInstallPeers: true - excludeLinksFromLockfile: false - -importers: - - .: - devDependencies: - '@napi-rs/cli': - specifier: ^3.0.0-alpha.43 - version: 3.0.0-alpha.55(@emnapi/runtime@1.2.0)(emnapi@1.2.0) - '@napi-rs/wasm-runtime': - specifier: ^0.2.0 - version: 0.2.4 - '@types/node': - specifier: ^20.10.4 - version: 20.14.9 - ava: - specifier: ^6.0.1 - version: 6.1.3 - emnapi: - specifier: ^1.0.0 - version: 1.2.0 - typescript: - specifier: ^5.3.3 - version: 5.5.2 - - fixtures/pnpm: - devDependencies: - axios: - specifier: 1.6.2 - version: 1.6.2 - postcss: - specifier: 8.4.33 - version: 8.4.33 - styled-components: - specifier: 6.1.1 - version: 6.1.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - - npm: {} - -packages: - - '@emnapi/core@1.2.0': - resolution: {integrity: sha512-E7Vgw78I93we4ZWdYCb4DGAwRROGkMIXk7/y87UmANR+J6qsWusmC3gLt0H+O0KOt5e6O38U8oJamgbudrES/w==} - - '@emnapi/runtime@1.2.0': - resolution: {integrity: sha512-bV21/9LQmcQeCPEg3BDFtvwL6cwiTMksYNWQQ4KOxCZikEGalWtenoZ0wCiukJINlGCIi2KXx01g4FoH/LxpzQ==} - - '@emnapi/wasi-threads@1.0.1': - resolution: {integrity: sha512-iIBu7mwkq4UQGeMEM8bLwNK962nXdhodeScX4slfQnRhEMMzvYivHhutCIk8uojvmASXXPC2WNEjwxFWk72Oqw==} - - '@emotion/is-prop-valid@1.2.2': - resolution: {integrity: sha512-uNsoYd37AFmaCdXlg6EYD1KaPOaRWRByMCYzbKUX4+hhMfrxdVSelShywL4JVaAeM/eHUOSprYBQls+/neX3pw==} - - '@emotion/memoize@0.8.1': - resolution: {integrity: sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA==} - - '@emotion/unitless@0.8.1': - resolution: {integrity: sha512-KOEGMu6dmJZtpadb476IsZBclKvILjopjUii3V+7MnXIQCYh8W3NgNcgwo21n9LXZX6EDIKvqfjYxXebDwxKmQ==} - - '@inquirer/figures@1.0.3': - resolution: {integrity: sha512-ErXXzENMH5pJt5/ssXV0DfWUZqly8nGzf0UcBV9xTnP+KyffE2mqyxIMBrZ8ijQck2nU0TQm40EQB53YreyWHw==} - engines: {node: '>=18'} - - '@ljharb/through@2.3.13': - resolution: {integrity: sha512-/gKJun8NNiWGZJkGzI/Ragc53cOdcLNdzjLaIa+GEjguQs0ulsurx8WN0jijdK9yPqDvziX995sMRLyLt1uZMQ==} - engines: {node: '>= 0.4'} - - '@mapbox/node-pre-gyp@1.0.11': - resolution: {integrity: sha512-Yhlar6v9WQgUp/He7BdgzOz8lqMQ8sU+jkCq7Wx8Myc5YFJLbEe7lgui/V7G1qB1DJykHSGwreceSaD60Y0PUQ==} - hasBin: true - - '@napi-rs/cli@3.0.0-alpha.55': - resolution: {integrity: sha512-6XgBBTX8O28W5gcSzqYkI72UVJV6Y2YcyQNrEqak39JavJRLlXCv09uLF97raynXAOO50KeP6DEXFy5P8MR2sw==} - engines: {node: '>= 16'} - hasBin: true - peerDependencies: - '@emnapi/runtime': ^1.1.0 - emnapi: ^1.1.0 - peerDependenciesMeta: - '@emnapi/runtime': - optional: true - emnapi: - optional: true - - '@napi-rs/cross-toolchain@0.0.16': - resolution: {integrity: sha512-jwdjHT5L0m9MH0CmzDwPp0ckn/UO7afHCsPeo7NugHUvYgvlgS7SWhdMVgIgJW2HHqhcW/2nhaLLGpAU1c7QRQ==} - peerDependencies: - '@napi-rs/cross-toolchain-arm64-target-aarch64': ^0.0.16 - '@napi-rs/cross-toolchain-arm64-target-armv7': ^0.0.16 - '@napi-rs/cross-toolchain-arm64-target-x86_64': ^0.0.16 - '@napi-rs/cross-toolchain-x64-target-aarch64': ^0.0.16 - '@napi-rs/cross-toolchain-x64-target-armv7': ^0.0.16 - '@napi-rs/cross-toolchain-x64-target-x86_64': ^0.0.16 - peerDependenciesMeta: - '@napi-rs/cross-toolchain-arm64-target-aarch64': - optional: true - '@napi-rs/cross-toolchain-arm64-target-armv7': - optional: true - '@napi-rs/cross-toolchain-arm64-target-x86_64': - optional: true - '@napi-rs/cross-toolchain-x64-target-aarch64': - optional: true - '@napi-rs/cross-toolchain-x64-target-armv7': - optional: true - '@napi-rs/cross-toolchain-x64-target-x86_64': - optional: true - - '@napi-rs/lzma-android-arm-eabi@1.3.1': - resolution: {integrity: sha512-mtGOg8jXlc+pTBI86cqohfndS9UmOAkk9d5CChKMb8btVks70yhUN1e7YYS3QFbmoxbPs2Ee+wmuH1Khdc7B2w==} - engines: {node: '>= 10'} - cpu: [arm] - os: [android] - - '@napi-rs/lzma-android-arm64@1.3.1': - resolution: {integrity: sha512-4uGkQgAv9Tnc/i0k2eIgbhZgyzs94+iECWxz4MFZNcZ1fNGvGbRL2j+SITE4OmwrUn3TuFK/uYWfgzooq8E1Qg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [android] - - '@napi-rs/lzma-darwin-arm64@1.3.1': - resolution: {integrity: sha512-MZBg4iwHTS8icjTiCMdzh8kYrMmKBCEglFPa+vjI91R2XDwuuwSzqmpATRpmMH8cWUUWtGPF4fnxKzjgkzhd4Q==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [darwin] - - '@napi-rs/lzma-darwin-x64@1.3.1': - resolution: {integrity: sha512-7vte+1lYV7xgZERKH/pjAeh4T16aQASKOzu4op70pK6VP/64Plr5rrvqxQqQmlAIe4pwyo/RkFl1n4LXDod3xg==} - engines: {node: '>= 10'} - cpu: [x64] - os: [darwin] - - '@napi-rs/lzma-freebsd-x64@1.3.1': - resolution: {integrity: sha512-uBS74fynTqLUC3catIxyezCafn8UDlr2yxVV47vz1T6Vop2PGDz/cMQdV6rnLSjPE08Rv66ihM36mgf/MmOkOg==} - engines: {node: '>= 10'} - cpu: [x64] - os: [freebsd] - - '@napi-rs/lzma-linux-arm-gnueabihf@1.3.1': - resolution: {integrity: sha512-rrVLyqBJeN29gPJCNkPbZ7dAzaseEcERKyhjwM+DfbFrDUvtkEcrYPvo+iwE/NmF+OkZQkzcanrVMGnq/mcJYQ==} - engines: {node: '>= 10'} - cpu: [arm] - os: [linux] - - '@napi-rs/lzma-linux-arm64-gnu@1.3.1': - resolution: {integrity: sha512-vDmVsthRbX2opkgRirJJGKQxUP/spvyVM2Y5CyCWZ7sadSID3hA97r38gf9ISn/sJ8/r93IPWLq+iycudNKi+Q==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/lzma-linux-arm64-musl@1.3.1': - resolution: {integrity: sha512-x4m/J3hRdFd3IoqKc+4aBcSUkcuDEP7hH6vdss8bKNLjPfXmnG/lcHJEQX3hNnNOULPP8xVRxgiY8jeL62cnsw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/lzma-linux-x64-gnu@1.3.1': - resolution: {integrity: sha512-riB+Xg72NfH8Kcpq07omshVu0QsLW0v2bhywBNYxvA+t2dGGWSIEN1U/zazUXys+IEA6pBQKqLVseurWE6Cl8g==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/lzma-linux-x64-musl@1.3.1': - resolution: {integrity: sha512-JXLgJFwoeysxdSg7rdVYP8wrliCQVJlU5JcLYjRVSCL4P0mQTjnYi7R7VdaOkDACw/Fvlji7oIJXt0KiaDTcOw==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/lzma-wasm32-wasi@1.3.1': - resolution: {integrity: sha512-XTA9XTUtj0KPKuzNS2oi3bWN6tJodk00wwMd/TiKoEqx9Fe/zu+OfDGuXAn+xs+P7S3YCDHqjYinuTQMZ0ucJw==} - engines: {node: '>=14.0.0'} - cpu: [wasm32] - - '@napi-rs/lzma-win32-arm64-msvc@1.3.1': - resolution: {integrity: sha512-qLDfs9UEtLPPTN/FdSz3gSdlx86VwFQBuLBrQtaiYQtUTKZCOYV1Z1fXqFt5Zqa1HKV2oyXnwGcTI7RpcyXxtg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [win32] - - '@napi-rs/lzma-win32-ia32-msvc@1.3.1': - resolution: {integrity: sha512-rWNlxLFMIfvxzfdQCfeQ3D/HEnQG3vfladFYrXUx6ePXO6r+BLCGn6/LWSSuKlw4vKkb1iHEWsAVaRLIcJEMIA==} - engines: {node: '>= 10'} - cpu: [ia32] - os: [win32] - - '@napi-rs/lzma-win32-x64-msvc@1.3.1': - resolution: {integrity: sha512-SNfHNqEjabXfTL1+KRi0qiAhwIlZHhQystvfSYX6p1g+2trSC/3WUpUQ4fbbR7KyE31g2AAnwjXivnlQ0af/pg==} - engines: {node: '>= 10'} - cpu: [x64] - os: [win32] - - '@napi-rs/lzma@1.3.1': - resolution: {integrity: sha512-XyZoBlYNMvCulK/RmVK/0nB3j7IdH7HpqcrMMg0U+HqQqKRLOQBwvnKNBocPC1bZQ7iZuKWYTLn1ayZwTyek8w==} - engines: {node: '>= 10'} - - '@napi-rs/tar-android-arm-eabi@0.1.1': - resolution: {integrity: sha512-Ufa0ahZvE5KGrC2WBux5svCe/jvC+e8IgtleiicwqnfgTfbDknYyq/QuqkP1AnMp/IvTmx2iutCZt6OFIG0zAg==} - engines: {node: '>= 10'} - cpu: [arm] - os: [android] - - '@napi-rs/tar-android-arm64@0.1.1': - resolution: {integrity: sha512-KUu5fHIiIObSuZ/crHxUrQ243+LiCRKPwdCVLHwjtftqFjzls+R2Mp6GrpM41XxexDMN00SUta3kazi93Xr19A==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [android] - - '@napi-rs/tar-darwin-arm64@0.1.1': - resolution: {integrity: sha512-jaqgdX20iIga+2gzotQ78eF00Cm8vECocUYeMY62WqyzJNv/jx1dlOfELWEccOjpmawFT9tjWebsS9F1QMvSUg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [darwin] - - '@napi-rs/tar-darwin-x64@0.1.1': - resolution: {integrity: sha512-80sa32IxfRso9x9sGTFpfLSx3BnruyJODpSkUzalOCz9i14n5gOKA8KR/JrnSWwDz0p5l5P9kfQD3pu8Voj7WA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [darwin] - - '@napi-rs/tar-freebsd-x64@0.1.1': - resolution: {integrity: sha512-P7V1zBjjC1dCrTwtUzuzYM4AeZduigeCtd8qQw2IUZowM5AsmhMd77oYuXjdU29cEpKUpyYjJRxjPCzFy+WbAQ==} - engines: {node: '>= 10'} - cpu: [x64] - os: [freebsd] - - '@napi-rs/tar-linux-arm-gnueabihf@0.1.1': - resolution: {integrity: sha512-qpC71ILPkWKt8k1iJCYt5gjwcOkd2VFSQIelTRr12t5CVNKV04rE/TMdwFoCP7kxbtb9Fl2cZzCRISw2BhMCmQ==} - engines: {node: '>= 10'} - cpu: [arm] - os: [linux] - - '@napi-rs/tar-linux-arm64-gnu@0.1.1': - resolution: {integrity: sha512-71QgxcFJCog6O4Tauoge8D0ILkDGJTRk3ru7zG8PUFG1QXJ1kkiRikdT77YmoVxtomc9FUOt+bdEdU5Yn+3QUQ==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/tar-linux-arm64-musl@0.1.1': - resolution: {integrity: sha512-R2e7YEILPKc447N1hUt1zQuyy0st83HX6nhmtFywS1aOj76/3hzxLVrebGiiS6kifyCrO82o66CNTYe7DixMZw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/tar-linux-x64-gnu@0.1.1': - resolution: {integrity: sha512-tmy9q2LXUB2GQ+IgUzJn3+us52leplMu96ORyFq1iHQEelGSqXt4xi5DzU07JhX3obJPqVqkybtcRS4enBfmBA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/tar-linux-x64-musl@0.1.1': - resolution: {integrity: sha512-j5ePbe6vihApl0cGPPDUVTWZbf2mF4NhxngAoG2jp7AeX3cWP2O4pjsvaOraW6QfvWEMFPeER7S0b6eBS7duvA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/tar-wasm32-wasi@0.1.1': - resolution: {integrity: sha512-se0+DlOiIRt7mcz7BeOJDoZtCrROpKLwiAOGmNgrjQ/SZS7TnOPuwm3wy9XN9WLoepttEjCEem6UP8yD5GJuQg==} - engines: {node: '>=14.0.0'} - cpu: [wasm32] - - '@napi-rs/tar-win32-arm64-msvc@0.1.1': - resolution: {integrity: sha512-FDZPi2wC7RwzvodogigLh/pJvhqCTVTUqOYuHlLkPSUbSAGiEkI55wk9RqH3y3EdJQaDuzyqC0QKz5ket2U+GA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [win32] - - '@napi-rs/tar-win32-ia32-msvc@0.1.1': - resolution: {integrity: sha512-OPR9Tou5z5M912G7Kc7gkf1ltinbOQx5dS/OeDIWHvPGOfdFDIxt0YVKhzSLRJi43+zIDp8/+cbeMD/cKXfX8w==} - engines: {node: '>= 10'} - cpu: [ia32] - os: [win32] - - '@napi-rs/tar-win32-x64-msvc@0.1.1': - resolution: {integrity: sha512-hiv5KfhrMSg8tTRC2oQXVckVg1h6ZVjwbd5aF9Esl0V3p2TaNFwwbqgnAN4Gm/PmSnHWNL/IRTHkk3cOzDWihQ==} - engines: {node: '>= 10'} - cpu: [x64] - os: [win32] - - '@napi-rs/tar@0.1.1': - resolution: {integrity: sha512-FOMhwwlvoYjHaDBxP26K3D92ltw1Y/CC4CIjgC6qXdzW4MYNwTlEyI58smCM3k+nCVJH3kpOYyH3sgbK4WZA4A==} - engines: {node: '>= 10'} - - '@napi-rs/wasm-runtime@0.2.4': - resolution: {integrity: sha512-9zESzOO5aDByvhIAsOy9TbpZ0Ur2AJbUI7UT73kcUTS2mxAMHOBaa1st/jAymNoCtvrit99kkzT1FZuXVcgfIQ==} - - '@napi-rs/wasm-tools-android-arm-eabi@0.0.2': - resolution: {integrity: sha512-/b+UU3suXjW4P0DzHRNdrnebQtFKcQf/YMeZJH+xUlKgvwli5kbmWjx8Wqqz0VETVkUTuPqJMBDIVLyc+14FGw==} - engines: {node: '>= 10'} - cpu: [arm] - os: [android] - - '@napi-rs/wasm-tools-android-arm64@0.0.2': - resolution: {integrity: sha512-j57GbDflwJdZtT8pZj5fOV4JAP+LdKN+wzsUYs+QRUoBqpWbbUANudolqfw63bkS9sD4z7fbCuz8iwtJqzxTVA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [android] - - '@napi-rs/wasm-tools-darwin-arm64@0.0.2': - resolution: {integrity: sha512-P2ChgWgVuv9GwmbxN89R84KzIImoTqXINteEixUvmkdnhyFiR+I8deNs89Yed+5w8QLC6MEfrtRqLP9YI+NoQA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [darwin] - - '@napi-rs/wasm-tools-darwin-x64@0.0.2': - resolution: {integrity: sha512-T/kQQ0gt8+wau1Z821PKVAD76QhmwVoLs2CT7Z9tTBs2pJvwSCP0C/kQiQAHcJIMi7A2E9Ab/Mez0BERy50EFA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [darwin] - - '@napi-rs/wasm-tools-freebsd-x64@0.0.2': - resolution: {integrity: sha512-GnnHu+r5sfzuxC/1J5UMF/h3BOZnHb3NQZ5hmbCfZYCKzpzRxrAJhzRunlbRN+v0x8M/49dztVTYR3s7K4ooAw==} - engines: {node: '>= 10'} - cpu: [x64] - os: [freebsd] - - '@napi-rs/wasm-tools-linux-arm64-gnu@0.0.2': - resolution: {integrity: sha512-KnZdLT0OnKb1CG2kdt3/WvM43vr9i+FEwXCvSOVC/6Tsifz7ynhMg7LAVESILd03HubzQJfg9nbRsk0bQ+IOwg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/wasm-tools-linux-arm64-musl@0.0.2': - resolution: {integrity: sha512-HkpZOID2U8P6pWqK3mqZ8bxU5xcuT3iA2fO+jrxn78h006iYgfNmdc5JaVhHnHazMmk32xKhSV4iV0VUh8UWDg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/wasm-tools-linux-x64-gnu@0.0.2': - resolution: {integrity: sha512-YksJWBCyOalB9ogtP9+/dZKP+vR6+h7BmzMXaXMT71WW/GvIsifMVgv+DY/FRSNJQupp5Y+ugjqVAOUOc/G65g==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/wasm-tools-linux-x64-musl@0.0.2': - resolution: {integrity: sha512-sPtRxPMdw05KdTcxgSPMmSXG2+PiK3vJ/l2+g9hvjnnKtvslJN2Hr7j8zgzuoKRAUFPaJVe6+D2xVh5cpdqhww==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/wasm-tools-wasm32-wasi@0.0.2': - resolution: {integrity: sha512-muRvZK7AIuo88G2AxYx3gA59rHMQgoN004saQkBvXnz3K/DVHKfTZ6TtUebss8zI3dURU6xExL8drxFWYxjEbQ==} - engines: {node: '>=14.0.0'} - cpu: [wasm32] - - '@napi-rs/wasm-tools-win32-arm64-msvc@0.0.2': - resolution: {integrity: sha512-Cn13WQ+tpFqdVwx0DIWKbsI9auFyzVZV4F5UNOUeDt6GgOL+NndgJul0Pc9bSU6fi03AylMPfF/nTCaDWO2Wgw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [win32] - - '@napi-rs/wasm-tools-win32-ia32-msvc@0.0.2': - resolution: {integrity: sha512-xsg5DkIQi82a8rcx6246Y3XC8TIqHamY+/C6sIlPLaZEuHctDkMECAw0AANwRf5vN//D2oo2oljOuoYtB1GOKw==} - engines: {node: '>= 10'} - cpu: [ia32] - os: [win32] - - '@napi-rs/wasm-tools-win32-x64-msvc@0.0.2': - resolution: {integrity: sha512-yHigltEt33eq8bappvKsIliz4MxfMPn1M+NWbIFRWN+IS1Z57mhmc1osuk+IRXrSlq0Tom0R6MYN1jpkZKz81Q==} - engines: {node: '>= 10'} - cpu: [x64] - os: [win32] - - '@napi-rs/wasm-tools@0.0.2': - resolution: {integrity: sha512-kBvDQCP5BLw2TxTENXLp3Of7vVEx0uyIye824JHE4dduzzOHVgSoOFVhVqAT3Fx/hLV445RVWfEqQbXMg4w/Mw==} - engines: {node: '>= 10'} - - '@nodelib/fs.scandir@2.1.5': - resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} - engines: {node: '>= 8'} - - '@nodelib/fs.stat@2.0.5': - resolution: {integrity: sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==} - engines: {node: '>= 8'} - - '@nodelib/fs.walk@1.2.8': - resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} - engines: {node: '>= 8'} - - '@octokit/auth-token@4.0.0': - resolution: {integrity: sha512-tY/msAuJo6ARbK6SPIxZrPBms3xPbfwBrulZe0Wtr/DIY9lje2HeV1uoebShn6mx7SjCHif6EjMvoREj+gZ+SA==} - engines: {node: '>= 18'} - - '@octokit/core@5.2.0': - resolution: {integrity: sha512-1LFfa/qnMQvEOAdzlQymH0ulepxbxnCYAKJZfMci/5XJyIHWgEYnDmgnKakbTh7CH2tFQ5O60oYDvns4i9RAIg==} - engines: {node: '>= 18'} - - '@octokit/endpoint@9.0.5': - resolution: {integrity: sha512-ekqR4/+PCLkEBF6qgj8WqJfvDq65RH85OAgrtnVp1mSxaXF03u2xW/hUdweGS5654IlC0wkNYC18Z50tSYTAFw==} - engines: {node: '>= 18'} - - '@octokit/graphql@7.1.0': - resolution: {integrity: sha512-r+oZUH7aMFui1ypZnAvZmn0KSqAUgE1/tUXIWaqUCa1758ts/Jio84GZuzsvUkme98kv0WFY8//n0J1Z+vsIsQ==} - engines: {node: '>= 18'} - - '@octokit/openapi-types@22.2.0': - resolution: {integrity: sha512-QBhVjcUa9W7Wwhm6DBFu6ZZ+1/t/oYxqc2tp81Pi41YNuJinbFRx8B133qVOrAaBbF7D/m0Et6f9/pZt9Rc+tg==} - - '@octokit/plugin-paginate-rest@11.3.1': - resolution: {integrity: sha512-ryqobs26cLtM1kQxqeZui4v8FeznirUsksiA+RYemMPJ7Micju0WSkv50dBksTuZks9O5cg4wp+t8fZ/cLY56g==} - engines: {node: '>= 18'} - peerDependencies: - '@octokit/core': '5' - - '@octokit/plugin-request-log@4.0.1': - resolution: {integrity: sha512-GihNqNpGHorUrO7Qa9JbAl0dbLnqJVrV8OXe2Zm5/Y4wFkZQDfTreBzVmiRfJVfE4mClXdihHnbpyyO9FSX4HA==} - engines: {node: '>= 18'} - peerDependencies: - '@octokit/core': '5' - - '@octokit/plugin-rest-endpoint-methods@13.2.2': - resolution: {integrity: sha512-EI7kXWidkt3Xlok5uN43suK99VWqc8OaIMktY9d9+RNKl69juoTyxmLoWPIZgJYzi41qj/9zU7G/ljnNOJ5AFA==} - engines: {node: '>= 18'} - peerDependencies: - '@octokit/core': ^5 - - '@octokit/request-error@5.1.0': - resolution: {integrity: sha512-GETXfE05J0+7H2STzekpKObFe765O5dlAKUTLNGeH+x47z7JjXHfsHKo5z21D/o/IOZTUEI6nyWyR+bZVP/n5Q==} - engines: {node: '>= 18'} - - '@octokit/request@8.4.0': - resolution: {integrity: sha512-9Bb014e+m2TgBeEJGEbdplMVWwPmL1FPtggHQRkV+WVsMggPtEkLKPlcVYm/o8xKLkpJ7B+6N8WfQMtDLX2Dpw==} - engines: {node: '>= 18'} - - '@octokit/rest@20.1.1': - resolution: {integrity: sha512-MB4AYDsM5jhIHro/dq4ix1iWTLGToIGk6cWF5L6vanFaMble5jTX/UBQyiv05HsWnwUtY8JrfHy2LWfKwihqMw==} - engines: {node: '>= 18'} - - '@octokit/types@13.5.0': - resolution: {integrity: sha512-HdqWTf5Z3qwDVlzCrP8UJquMwunpDiMPt5er+QjGzL4hqr/vBVY/MauQgS1xWxCDT1oMx1EULyqxncdCY/NVSQ==} - - '@rollup/pluginutils@4.2.1': - resolution: {integrity: sha512-iKnFXr7NkdZAIHiIWE+BX5ULi/ucVFYWD6TbAV+rZctiRTY2PL6tsIKhoIOaoskiWAkgu+VsbXgUVDNLHf+InQ==} - engines: {node: '>= 8.0.0'} - - '@sindresorhus/merge-streams@2.3.0': - resolution: {integrity: sha512-LtoMMhxAlorcGhmFYI+LhPgbPZCkgP6ra1YL604EeF6U98pLlQ3iWIGMdWSC+vWmPBWBNgmDBAhnAobLROJmwg==} - engines: {node: '>=18'} - - '@tybys/wasm-util@0.9.0': - resolution: {integrity: sha512-6+7nlbMVX/PVDCwaIQ8nTOPveOcFLSt8GcXdx8hD0bt39uWxYT88uXzqTd4fTvqta7oeUJqudepapKNt2DYJFw==} - - '@types/node@20.14.9': - resolution: {integrity: sha512-06OCtnTXtWOZBJlRApleWndH4JsRVs1pDCc8dLSQp+7PpUpX3ePdHyeNSFTeSe7FtKyQkrlPvHwJOW3SLd8Oyg==} - - '@types/stylis@4.2.6': - resolution: {integrity: sha512-4nebF2ZJGzQk0ka0O6+FZUWceyFv4vWq/0dXBMmrSeAwzOuOd/GxE5Pa64d/ndeNLG73dXoBsRzvtsVsYUv6Uw==} - - '@vercel/nft@0.26.5': - resolution: {integrity: sha512-NHxohEqad6Ra/r4lGknO52uc/GrWILXAMs1BB4401GTqww0fw1bAqzpG1XHuDO+dprg4GvsD9ZLLSsdo78p9hQ==} - engines: {node: '>=16'} - hasBin: true - - abbrev@1.1.1: - resolution: {integrity: sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==} - - acorn-import-attributes@1.9.5: - resolution: {integrity: sha512-n02Vykv5uA3eHGM/Z2dQrcD56kL8TyDb2p1+0P83PClMnC/nc+anbQRhIOWnSq4Ke/KvDPrY3C9hDtC/A3eHnQ==} - peerDependencies: - acorn: ^8 - - acorn-walk@8.3.3: - resolution: {integrity: sha512-MxXdReSRhGO7VlFe1bRG/oI7/mdLV9B9JJT0N8vZOhF7gFRR5l3M8W9G8JxmKV+JC5mGqJ0QvqfSOLsCPa4nUw==} - engines: {node: '>=0.4.0'} - - acorn@8.12.0: - resolution: {integrity: sha512-RTvkC4w+KNXrM39/lWCUaG0IbRkWdCv7W/IOW9oU6SawyxulvkQy5HQPVTKxEjczcUvapcrw3cFx/60VN/NRNw==} - engines: {node: '>=0.4.0'} - hasBin: true - - agent-base@6.0.2: - resolution: {integrity: sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==} - engines: {node: '>= 6.0.0'} - - ansi-escapes@4.3.2: - resolution: {integrity: sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==} - engines: {node: '>=8'} - - ansi-regex@5.0.1: - resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} - engines: {node: '>=8'} - - ansi-regex@6.0.1: - resolution: {integrity: sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==} - engines: {node: '>=12'} - - ansi-styles@4.3.0: - resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} - engines: {node: '>=8'} - - ansi-styles@6.2.1: - resolution: {integrity: sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==} - engines: {node: '>=12'} - - aproba@2.0.0: - resolution: {integrity: sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==} - - are-we-there-yet@2.0.0: - resolution: {integrity: sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw==} - engines: {node: '>=10'} - deprecated: This package is no longer supported. - - argparse@1.0.10: - resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==} - - argparse@2.0.1: - resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} - - array-find-index@1.0.2: - resolution: {integrity: sha512-M1HQyIXcBGtVywBt8WVdim+lrNaK7VHp99Qt5pSNziXznKHViIBbXWtfRTpEFpF/c4FdfxNAsCCwPp5phBYJtw==} - engines: {node: '>=0.10.0'} - - arrgv@1.0.2: - resolution: {integrity: sha512-a4eg4yhp7mmruZDQFqVMlxNRFGi/i1r87pt8SDHy0/I8PqSXoUTlWZRdAZo0VXgvEARcujbtTk8kiZRi1uDGRw==} - engines: {node: '>=8.0.0'} - - arrify@3.0.0: - resolution: {integrity: sha512-tLkvA81vQG/XqE2mjDkGQHoOINtMHtysSnemrmoGe6PydDPMRbVugqyk4A6V/WDWEfm3l+0d8anA9r8cv/5Jaw==} - engines: {node: '>=12'} - - async-sema@3.1.1: - resolution: {integrity: sha512-tLRNUXati5MFePdAk8dw7Qt7DpxPB60ofAgn8WRhW6a2rcimZnYBP9oxHiv0OHy+Wz7kPMG+t4LGdt31+4EmGg==} - - asynckit@0.4.0: - resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} - - ava@6.1.3: - resolution: {integrity: sha512-tkKbpF1pIiC+q09wNU9OfyTDYZa8yuWvU2up3+lFJ3lr1RmnYh2GBpPwzYUEB0wvTPIUysGjcZLNZr7STDviRA==} - engines: {node: ^18.18 || ^20.8 || ^21 || ^22} - hasBin: true - peerDependencies: - '@ava/typescript': '*' - peerDependenciesMeta: - '@ava/typescript': - optional: true - - axios@1.6.2: - resolution: {integrity: sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A==} - - balanced-match@1.0.2: - resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} - - base64-js@1.5.1: - resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==} - - before-after-hook@2.2.3: - resolution: {integrity: sha512-NzUnlZexiaH/46WDhANlyR2bXRopNg4F/zuSA3OpZnllCUgRaOF2znDioDWrmbNVsuZk6l9pMquQB38cfBZwkQ==} - - bindings@1.5.0: - resolution: {integrity: sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==} - - bl@4.1.0: - resolution: {integrity: sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==} - - blueimp-md5@2.19.0: - resolution: {integrity: sha512-DRQrD6gJyy8FbiE4s+bDoXS9hiW3Vbx5uCdwvcCf3zLHL+Iv7LtGHLpr+GZV8rHG8tK766FGYBwRbu8pELTt+w==} - - brace-expansion@1.1.11: - resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} - - braces@3.0.3: - resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==} - engines: {node: '>=8'} - - buffer@5.7.1: - resolution: {integrity: sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==} - - call-bind@1.0.7: - resolution: {integrity: sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==} - engines: {node: '>= 0.4'} - - callsites@4.1.0: - resolution: {integrity: sha512-aBMbD1Xxay75ViYezwT40aQONfr+pSXTHwNKvIXhXD6+LY3F1dLIcceoC5OZKBVHbXcysz1hL9D2w0JJIMXpUw==} - engines: {node: '>=12.20'} - - camelize@1.0.1: - resolution: {integrity: sha512-dU+Tx2fsypxTgtLoE36npi3UqcjSSMNYfkqgmoEhtZrraP5VWq0K7FkWVTYa8eMPtnU/G2txVsfdCJTn9uzpuQ==} - - cbor@9.0.2: - resolution: {integrity: sha512-JPypkxsB10s9QOWwa6zwPzqE1Md3vqpPc+cai4sAecuCsRyAtAl/pMyhPlMbT/xtPnm2dznJZYRLui57qiRhaQ==} - engines: {node: '>=16'} - - chalk@4.1.2: - resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} - engines: {node: '>=10'} - - chalk@5.3.0: - resolution: {integrity: sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==} - engines: {node: ^12.17.0 || ^14.13 || >=16.0.0} - - chardet@0.7.0: - resolution: {integrity: sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==} - - chownr@2.0.0: - resolution: {integrity: sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==} - engines: {node: '>=10'} - - chunkd@2.0.1: - resolution: {integrity: sha512-7d58XsFmOq0j6el67Ug9mHf9ELUXsQXYJBkyxhH/k+6Ke0qXRnv0kbemx+Twc6fRJ07C49lcbdgm9FL1Ei/6SQ==} - - ci-info@4.0.0: - resolution: {integrity: sha512-TdHqgGf9odd8SXNuxtUBVx8Nv+qZOejE6qyqiy5NtbYYQOeFa6zmHkxlPzmaLxWWHsU6nJmB7AETdVPi+2NBUg==} - engines: {node: '>=8'} - - ci-parallel-vars@1.0.1: - resolution: {integrity: sha512-uvzpYrpmidaoxvIQHM+rKSrigjOe9feHYbw4uOI2gdfe1C3xIlxO+kVXq83WQWNniTf8bAxVpy+cQeFQsMERKg==} - - cli-cursor@3.1.0: - resolution: {integrity: sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==} - engines: {node: '>=8'} - - cli-spinners@2.9.2: - resolution: {integrity: sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==} - engines: {node: '>=6'} - - cli-truncate@4.0.0: - resolution: {integrity: sha512-nPdaFdQ0h/GEigbPClz11D0v/ZJEwxmeVZGeMo3Z5StPtUTkA9o1lD6QwoirYiSDzbcwn2XcjwmCp68W1IS4TA==} - engines: {node: '>=18'} - - cli-width@4.1.0: - resolution: {integrity: sha512-ouuZd4/dm2Sw5Gmqy6bGyNNNe1qt9RpmxveLSO7KcgsTnU7RXfsw+/bukWGo1abgBiMAic068rclZsO4IWmmxQ==} - engines: {node: '>= 12'} - - clipanion@3.2.1: - resolution: {integrity: sha512-dYFdjLb7y1ajfxQopN05mylEpK9ZX0sO1/RfMXdfmwjlIsPkbh4p7A682x++zFPLDCo1x3p82dtljHf5cW2LKA==} - peerDependencies: - typanion: '*' - - cliui@8.0.1: - resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==} - engines: {node: '>=12'} - - clone@1.0.4: - resolution: {integrity: sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==} - engines: {node: '>=0.8'} - - code-excerpt@4.0.0: - resolution: {integrity: sha512-xxodCmBen3iy2i0WtAK8FlFNrRzjUqjRsMfho58xT/wvZU1YTM3fCnRjcy1gJPMepaRlgm/0e6w8SpWHpn3/cA==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - color-convert@2.0.1: - resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} - engines: {node: '>=7.0.0'} - - color-name@1.1.4: - resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} - - color-support@1.1.3: - resolution: {integrity: sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==} - hasBin: true - - colorette@2.0.20: - resolution: {integrity: sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==} - - combined-stream@1.0.8: - resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} - engines: {node: '>= 0.8'} - - common-path-prefix@3.0.0: - resolution: {integrity: sha512-QE33hToZseCH3jS0qN96O/bSh3kaw/h+Tq7ngyY9eWDUnTlTNUyqfqvCXioLe5Na5jFsL78ra/wuBU4iuEgd4w==} - - concat-map@0.0.1: - resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} - - concordance@5.0.4: - resolution: {integrity: sha512-OAcsnTEYu1ARJqWVGwf4zh4JDfHZEaSNlNccFmt8YjB2l/n19/PF2viLINHc57vO4FKIAFl2FWASIGZZWZ2Kxw==} - engines: {node: '>=10.18.0 <11 || >=12.14.0 <13 || >=14'} - - console-control-strings@1.1.0: - resolution: {integrity: sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==} - - convert-to-spaces@2.0.1: - resolution: {integrity: sha512-rcQ1bsQO9799wq24uE5AM2tAILy4gXGIK/njFWcVQkGNZ96edlpY+A7bjwvzjYvLDyzmG1MmMLZhpcsb+klNMQ==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - css-color-keywords@1.0.0: - resolution: {integrity: sha512-FyyrDHZKEjXDpNJYvVsV960FiqQyXc/LlYmsxl2BcdMb2WPx0OGRVgTg55rPSyLSNMqP52R9r8geSp7apN3Ofg==} - engines: {node: '>=4'} - - css-to-react-native@3.2.0: - resolution: {integrity: sha512-e8RKaLXMOFii+02mOlqwjbD00KSEKqblnpO9e++1aXS1fPQOpS1YoqdVHBqPjHNoxeF2mimzVqawm2KCbEdtHQ==} - - csstype@3.1.3: - resolution: {integrity: sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==} - - currently-unhandled@0.4.1: - resolution: {integrity: sha512-/fITjgjGU50vjQ4FH6eUoYu+iUoUKIXws2hL15JJpIR+BbTxaXQsMuuyjtNh2WqsSBS5nsaZHFsFecyw5CCAng==} - engines: {node: '>=0.10.0'} - - date-time@3.1.0: - resolution: {integrity: sha512-uqCUKXE5q1PNBXjPqvwhwJf9SwMoAHBgWJ6DcrnS5o+W2JOiIILl0JEdVD8SGujrNS02GGxgwAg2PN2zONgtjg==} - engines: {node: '>=6'} - - debug@4.3.5: - resolution: {integrity: sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg==} - engines: {node: '>=6.0'} - peerDependencies: - supports-color: '*' - peerDependenciesMeta: - supports-color: - optional: true - - defaults@1.0.4: - resolution: {integrity: sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A==} - - define-data-property@1.1.4: - resolution: {integrity: sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==} - engines: {node: '>= 0.4'} - - delayed-stream@1.0.0: - resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} - engines: {node: '>=0.4.0'} - - delegates@1.0.0: - resolution: {integrity: sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==} - - deprecation@2.3.1: - resolution: {integrity: sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==} - - detect-libc@2.0.3: - resolution: {integrity: sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw==} - engines: {node: '>=8'} - - emittery@1.0.3: - resolution: {integrity: sha512-tJdCJitoy2lrC2ldJcqN4vkqJ00lT+tOWNT1hBJjO/3FDMJa5TTIiYGCKGkn/WfCyOzUMObeohbVTj00fhiLiA==} - engines: {node: '>=14.16'} - - emnapi@1.2.0: - resolution: {integrity: sha512-rcq+dJCcfr08I0XM/57LPRqaUokGfni/+SvhO7NaJthTTjRdohhIy0FQwyC5rR1enAsjkldQg83th8J5hURv0Q==} - peerDependencies: - node-addon-api: '>= 6.1.0' - peerDependenciesMeta: - node-addon-api: - optional: true - - emoji-regex@10.3.0: - resolution: {integrity: sha512-QpLs9D9v9kArv4lfDEgg1X/gN5XLnf/A6l9cs8SPZLRZR3ZkY9+kwIQTxm+fsSej5UMYGE8fdoaZVIBlqG0XTw==} - - emoji-regex@8.0.0: - resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} - - es-define-property@1.0.0: - resolution: {integrity: sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==} - engines: {node: '>= 0.4'} - - es-errors@1.3.0: - resolution: {integrity: sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==} - engines: {node: '>= 0.4'} - - escalade@3.1.2: - resolution: {integrity: sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==} - engines: {node: '>=6'} - - escape-string-regexp@2.0.0: - resolution: {integrity: sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==} - engines: {node: '>=8'} - - escape-string-regexp@5.0.0: - resolution: {integrity: sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==} - engines: {node: '>=12'} - - esprima@4.0.1: - resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==} - engines: {node: '>=4'} - hasBin: true - - estree-walker@2.0.2: - resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==} - - esutils@2.0.3: - resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} - engines: {node: '>=0.10.0'} - - external-editor@3.1.0: - resolution: {integrity: sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==} - engines: {node: '>=4'} - - fast-diff@1.3.0: - resolution: {integrity: sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==} - - fast-glob@3.3.2: - resolution: {integrity: sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==} - engines: {node: '>=8.6.0'} - - fastq@1.17.1: - resolution: {integrity: sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==} - - figures@6.1.0: - resolution: {integrity: sha512-d+l3qxjSesT4V7v2fh+QnmFnUWv9lSpjarhShNTgBOfA0ttejbQUAlHLitbjkoRiDulW0OPoQPYIGhIC8ohejg==} - engines: {node: '>=18'} - - file-uri-to-path@1.0.0: - resolution: {integrity: sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==} - - fill-range@7.1.1: - resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==} - engines: {node: '>=8'} - - find-up-simple@1.0.0: - resolution: {integrity: sha512-q7Us7kcjj2VMePAa02hDAF6d+MzsdsAWEwYyOpwUtlerRBkOEPBCRZrAV4XfcSN8fHAgaD0hP7miwoay6DCprw==} - engines: {node: '>=18'} - - follow-redirects@1.15.6: - resolution: {integrity: sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==} - engines: {node: '>=4.0'} - peerDependencies: - debug: '*' - peerDependenciesMeta: - debug: - optional: true - - form-data@4.0.0: - resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==} - engines: {node: '>= 6'} - - fs-minipass@2.1.0: - resolution: {integrity: sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==} - engines: {node: '>= 8'} - - fs.realpath@1.0.0: - resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} - - function-bind@1.1.2: - resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==} - - gauge@3.0.2: - resolution: {integrity: sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q==} - engines: {node: '>=10'} - deprecated: This package is no longer supported. - - get-caller-file@2.0.5: - resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} - engines: {node: 6.* || 8.* || >= 10.*} - - get-east-asian-width@1.2.0: - resolution: {integrity: sha512-2nk+7SIVb14QrgXFHcm84tD4bKQz0RxPuMT8Ag5KPOq7J5fEmAg0UbXdTOSHqNuHSU28k55qnceesxXRZGzKWA==} - engines: {node: '>=18'} - - get-intrinsic@1.2.4: - resolution: {integrity: sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==} - engines: {node: '>= 0.4'} - - glob-parent@5.1.2: - resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} - engines: {node: '>= 6'} - - glob@7.2.3: - resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} - deprecated: Glob versions prior to v9 are no longer supported - - globby@14.0.1: - resolution: {integrity: sha512-jOMLD2Z7MAhyG8aJpNOpmziMOP4rPLcc95oQPKXBazW82z+CEgPFBQvEpRUa1KeIMUJo4Wsm+q6uzO/Q/4BksQ==} - engines: {node: '>=18'} - - gopd@1.0.1: - resolution: {integrity: sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==} - - graceful-fs@4.2.11: - resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} - - has-flag@4.0.0: - resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} - engines: {node: '>=8'} - - has-property-descriptors@1.0.2: - resolution: {integrity: sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==} - - has-proto@1.0.3: - resolution: {integrity: sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==} - engines: {node: '>= 0.4'} - - has-symbols@1.0.3: - resolution: {integrity: sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==} - engines: {node: '>= 0.4'} - - has-unicode@2.0.1: - resolution: {integrity: sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==} - - hasown@2.0.2: - resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==} - engines: {node: '>= 0.4'} - - https-proxy-agent@5.0.1: - resolution: {integrity: sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==} - engines: {node: '>= 6'} - - iconv-lite@0.4.24: - resolution: {integrity: sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==} - engines: {node: '>=0.10.0'} - - ieee754@1.2.1: - resolution: {integrity: sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==} - - ignore-by-default@2.1.0: - resolution: {integrity: sha512-yiWd4GVmJp0Q6ghmM2B/V3oZGRmjrKLXvHR3TE1nfoXsmoggllfZUQe74EN0fJdPFZu2NIvNdrMMLm3OsV7Ohw==} - engines: {node: '>=10 <11 || >=12 <13 || >=14'} - - ignore@5.3.1: - resolution: {integrity: sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==} - engines: {node: '>= 4'} - - imurmurhash@0.1.4: - resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} - engines: {node: '>=0.8.19'} - - indent-string@5.0.0: - resolution: {integrity: sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==} - engines: {node: '>=12'} - - inflight@1.0.6: - resolution: {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. - - inherits@2.0.4: - resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} - - inquirer@9.2.23: - resolution: {integrity: sha512-kod5s+FBPIDM2xiy9fu+6wdU/SkK5le5GS9lh4FEBjBHqiMgD9lLFbCbuqFNAjNL2ZOy9Wd9F694IOzN9pZHBA==} - engines: {node: '>=18'} - - irregular-plurals@3.5.0: - resolution: {integrity: sha512-1ANGLZ+Nkv1ptFb2pa8oG8Lem4krflKuX/gINiHJHjJUKaJHk/SXk5x6K3J+39/p0h1RQ2saROclJJ+QLvETCQ==} - engines: {node: '>=8'} - - is-extglob@2.1.1: - resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} - engines: {node: '>=0.10.0'} - - is-fullwidth-code-point@3.0.0: - resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} - engines: {node: '>=8'} - - is-fullwidth-code-point@4.0.0: - resolution: {integrity: sha512-O4L094N2/dZ7xqVdrXhh9r1KODPJpFms8B5sGdJLPy664AgvXsreZUyCQQNItZRDlYug4xStLjNp/sz3HvBowQ==} - engines: {node: '>=12'} - - is-glob@4.0.3: - resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} - engines: {node: '>=0.10.0'} - - is-interactive@1.0.0: - resolution: {integrity: sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w==} - engines: {node: '>=8'} - - is-number@7.0.0: - resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} - engines: {node: '>=0.12.0'} - - is-plain-object@5.0.0: - resolution: {integrity: sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==} - engines: {node: '>=0.10.0'} - - is-promise@4.0.0: - resolution: {integrity: sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==} - - is-unicode-supported@0.1.0: - resolution: {integrity: sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==} - engines: {node: '>=10'} - - is-unicode-supported@2.0.0: - resolution: {integrity: sha512-FRdAyx5lusK1iHG0TWpVtk9+1i+GjrzRffhDg4ovQ7mcidMQ6mj+MhKPmvh7Xwyv5gIS06ns49CA7Sqg7lC22Q==} - engines: {node: '>=18'} - - js-string-escape@1.0.1: - resolution: {integrity: sha512-Smw4xcfIQ5LVjAOuJCvN/zIodzA/BBSsluuoSykP+lUvScIi4U6RJLfwHet5cxFnCswUjISV8oAXaqaJDY3chg==} - engines: {node: '>= 0.8'} - - js-tokens@4.0.0: - resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} - - js-yaml@3.14.1: - resolution: {integrity: sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==} - hasBin: true - - js-yaml@4.1.0: - resolution: {integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==} - hasBin: true - - load-json-file@7.0.1: - resolution: {integrity: sha512-Gnxj3ev3mB5TkVBGad0JM6dmLiQL+o0t23JPBZ9sd+yvSLk05mFoqKBw5N8gbbkU4TNXyqCgIrl/VM17OgUIgQ==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - lodash-es@4.17.21: - resolution: {integrity: sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==} - - lodash@4.17.21: - resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} - - log-symbols@4.1.0: - resolution: {integrity: sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==} - engines: {node: '>=10'} - - loose-envify@1.4.0: - resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==} - hasBin: true - - make-dir@3.1.0: - resolution: {integrity: sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==} - engines: {node: '>=8'} - - matcher@5.0.0: - resolution: {integrity: sha512-s2EMBOWtXFc8dgqvoAzKJXxNHibcdJMV0gwqKUaw9E2JBJuGUK7DrNKrA6g/i+v72TT16+6sVm5mS3thaMLQUw==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - md5-hex@3.0.1: - resolution: {integrity: sha512-BUiRtTtV39LIJwinWBjqVsU9xhdnz7/i889V859IBFpuqGAj6LuOvHv5XLbgZ2R7ptJoJaEcxkv88/h25T7Ciw==} - engines: {node: '>=8'} - - memoize@10.0.0: - resolution: {integrity: sha512-H6cBLgsi6vMWOcCpvVCdFFnl3kerEXbrYh9q+lY6VXvQSmM6CkmV08VOwT+WE2tzIEqRPFfAq3fm4v/UIW6mSA==} - engines: {node: '>=18'} - - merge2@1.4.1: - resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} - engines: {node: '>= 8'} - - micromatch@4.0.7: - resolution: {integrity: sha512-LPP/3KorzCwBxfeUuZmaR6bG2kdeHSbe0P2tY3FLRU4vYrjYz5hI4QZwV0njUx3jeuKe67YukQ1LSPZBKDqO/Q==} - engines: {node: '>=8.6'} - - mime-db@1.52.0: - resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} - engines: {node: '>= 0.6'} - - mime-types@2.1.35: - resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} - engines: {node: '>= 0.6'} - - mimic-fn@2.1.0: - resolution: {integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==} - engines: {node: '>=6'} - - mimic-function@5.0.1: - resolution: {integrity: sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==} - engines: {node: '>=18'} - - minimatch@3.1.2: - resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} - - minipass@3.3.6: - resolution: {integrity: sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==} - engines: {node: '>=8'} - - minipass@5.0.0: - resolution: {integrity: sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==} - engines: {node: '>=8'} - - minizlib@2.1.2: - resolution: {integrity: sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==} - engines: {node: '>= 8'} - - mkdirp@1.0.4: - resolution: {integrity: sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==} - engines: {node: '>=10'} - hasBin: true - - ms@2.1.2: - resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} - - ms@2.1.3: - resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} - - mute-stream@1.0.0: - resolution: {integrity: sha512-avsJQhyd+680gKXyG/sQc0nXaC6rBkPOfyHYcFb9+hdkqQkR9bdnkJ0AMZhke0oesPqIO+mFFJ+IdBc7mst4IA==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - - nanoid@3.3.7: - resolution: {integrity: sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==} - engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} - hasBin: true - - node-fetch@2.7.0: - resolution: {integrity: sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==} - engines: {node: 4.x || >=6.0.0} - peerDependencies: - encoding: ^0.1.0 - peerDependenciesMeta: - encoding: - optional: true - - node-gyp-build@4.8.1: - resolution: {integrity: sha512-OSs33Z9yWr148JZcbZd5WiAXhh/n9z8TxQcdMhIOlpN9AhWpLfvVFO73+m77bBABQMaY9XSvIa+qk0jlI7Gcaw==} - hasBin: true - - nofilter@3.1.0: - resolution: {integrity: sha512-l2NNj07e9afPnhAhvgVrCD/oy2Ai1yfLpuo3EpiO1jFTsB4sFz6oIfAfSZyQzVpkZQ9xS8ZS5g1jCBgq4Hwo0g==} - engines: {node: '>=12.19'} - - nopt@5.0.0: - resolution: {integrity: sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==} - engines: {node: '>=6'} - hasBin: true - - npmlog@5.0.1: - resolution: {integrity: sha512-AqZtDUWOMKs1G/8lwylVjrdYgqA4d9nu8hc+0gzRxlDb1I10+FHBGMXs6aiQHFdCUUlqH99MUMuLfzWDNDtfxw==} - deprecated: This package is no longer supported. - - object-assign@4.1.1: - resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} - engines: {node: '>=0.10.0'} - - once@1.4.0: - resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} - - onetime@5.1.2: - resolution: {integrity: sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==} - engines: {node: '>=6'} - - ora@5.4.1: - resolution: {integrity: sha512-5b6Y85tPxZZ7QytO+BQzysW31HJku27cRIlkbAXaNx+BdcVi+LlRFmVXzeF6a7JCwJpyw5c4b+YSVImQIrBpuQ==} - engines: {node: '>=10'} - - os-tmpdir@1.0.2: - resolution: {integrity: sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==} - engines: {node: '>=0.10.0'} - - p-map@7.0.2: - resolution: {integrity: sha512-z4cYYMMdKHzw4O5UkWJImbZynVIo0lSGTXc7bzB1e/rrDqkgGUNysK/o4bTr+0+xKvvLoTyGqYC4Fgljy9qe1Q==} - engines: {node: '>=18'} - - package-config@5.0.0: - resolution: {integrity: sha512-GYTTew2slBcYdvRHqjhwaaydVMvn/qrGC323+nKclYioNSLTDUM/lGgtGTgyHVtYcozb+XkE8CNhwcraOmZ9Mg==} - engines: {node: '>=18'} - - parse-ms@4.0.0: - resolution: {integrity: sha512-TXfryirbmq34y8QBwgqCVLi+8oA3oWx2eAnSn62ITyEhEYaWRlVZ2DvMM9eZbMs/RfxPu/PK/aBLyGj4IrqMHw==} - engines: {node: '>=18'} - - path-is-absolute@1.0.1: - resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==} - engines: {node: '>=0.10.0'} - - path-type@5.0.0: - resolution: {integrity: sha512-5HviZNaZcfqP95rwpv+1HDgUamezbqdSYTyzjTvwtJSnIH+3vnbmWsItli8OFEndS984VT55M3jduxZbX351gg==} - engines: {node: '>=12'} - - picocolors@1.0.1: - resolution: {integrity: sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==} - - picomatch@2.3.1: - resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} - engines: {node: '>=8.6'} - - picomatch@3.0.1: - resolution: {integrity: sha512-I3EurrIQMlRc9IaAZnqRR044Phh2DXY+55o7uJ0V+hYZAcQYSuFWsc9q5PvyDHUSCe1Qxn/iBz+78s86zWnGag==} - engines: {node: '>=10'} - - plur@5.1.0: - resolution: {integrity: sha512-VP/72JeXqak2KiOzjgKtQen5y3IZHn+9GOuLDafPv0eXa47xq0At93XahYBs26MsifCQ4enGKwbjBTKgb9QJXg==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - postcss-value-parser@4.2.0: - resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==} - - postcss@8.4.33: - resolution: {integrity: sha512-Kkpbhhdjw2qQs2O2DGX+8m5OVqEcbB9HRBvuYM9pgrjEFUg30A9LmXNlTAUj4S9kgtGyrMbTzVjH7E+s5Re2yg==} - engines: {node: ^10 || ^12 || >=14} - - pretty-ms@9.0.0: - resolution: {integrity: sha512-E9e9HJ9R9NasGOgPaPE8VMeiPKAyWR5jcFpNnwIejslIhWqdqOrb2wShBsncMPUb+BcCd2OPYfh7p2W6oemTng==} - engines: {node: '>=18'} - - proxy-from-env@1.1.0: - resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==} - - queue-microtask@1.2.3: - resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} - - react-dom@18.3.1: - resolution: {integrity: sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==} - peerDependencies: - react: ^18.3.1 - - react@18.3.1: - resolution: {integrity: sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==} - engines: {node: '>=0.10.0'} - - readable-stream@3.6.2: - resolution: {integrity: sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==} - engines: {node: '>= 6'} - - require-directory@2.1.1: - resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} - engines: {node: '>=0.10.0'} - - resolve-cwd@3.0.0: - resolution: {integrity: sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==} - engines: {node: '>=8'} - - resolve-from@5.0.0: - resolution: {integrity: sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==} - engines: {node: '>=8'} - - restore-cursor@3.1.0: - resolution: {integrity: sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==} - engines: {node: '>=8'} - - reusify@1.0.4: - resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==} - engines: {iojs: '>=1.0.0', node: '>=0.10.0'} - - rimraf@3.0.2: - resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==} - deprecated: Rimraf versions prior to v4 are no longer supported - hasBin: true - - run-async@3.0.0: - resolution: {integrity: sha512-540WwVDOMxA6dN6We19EcT9sc3hkXPw5mzRNGM3FkdN/vtE9NFvj5lFAPNwUDmJjXidm3v7TC1cTE7t17Ulm1Q==} - engines: {node: '>=0.12.0'} - - run-parallel@1.2.0: - resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} - - rxjs@7.8.1: - resolution: {integrity: sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==} - - safe-buffer@5.2.1: - resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} - - safer-buffer@2.1.2: - resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} - - scheduler@0.23.2: - resolution: {integrity: sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ==} - - semver@6.3.1: - resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} - hasBin: true - - semver@7.6.2: - resolution: {integrity: sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==} - engines: {node: '>=10'} - hasBin: true - - serialize-error@7.0.1: - resolution: {integrity: sha512-8I8TjW5KMOKsZQTvoxjuSIa7foAwPWGOts+6o7sgjz41/qMD9VQHEDxi6PBvK2l0MXUmqZyNpUK+T2tQaaElvw==} - engines: {node: '>=10'} - - set-blocking@2.0.0: - resolution: {integrity: sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==} - - set-function-length@1.2.2: - resolution: {integrity: sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==} - engines: {node: '>= 0.4'} - - shallowequal@1.1.0: - resolution: {integrity: sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ==} - - signal-exit@3.0.7: - resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} - - signal-exit@4.1.0: - resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} - engines: {node: '>=14'} - - slash@5.1.0: - resolution: {integrity: sha512-ZA6oR3T/pEyuqwMgAKT0/hAv8oAXckzbkmR0UkUosQ+Mc4RxGoJkRmwHgHufaenlyAgE1Mxgpdcrf75y6XcnDg==} - engines: {node: '>=14.16'} - - slice-ansi@5.0.0: - resolution: {integrity: sha512-FC+lgizVPfie0kkhqUScwRu1O/lF6NOgJmlCgK+/LYxDCTk8sGelYaHDhFcDN+Sn3Cv+3VSa4Byeo+IMCzpMgQ==} - engines: {node: '>=12'} - - source-map-js@1.2.0: - resolution: {integrity: sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==} - engines: {node: '>=0.10.0'} - - sprintf-js@1.0.3: - resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==} - - stack-utils@2.0.6: - resolution: {integrity: sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==} - engines: {node: '>=10'} - - string-width@4.2.3: - resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} - engines: {node: '>=8'} - - string-width@7.1.0: - resolution: {integrity: sha512-SEIJCWiX7Kg4c129n48aDRwLbFb2LJmXXFrWBG4NGaRtMQ3myKPKbwrD1BKqQn74oCoNMBVrfDEr5M9YxCsrkw==} - engines: {node: '>=18'} - - string_decoder@1.3.0: - resolution: {integrity: sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==} - - strip-ansi@6.0.1: - resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} - engines: {node: '>=8'} - - strip-ansi@7.1.0: - resolution: {integrity: sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==} - engines: {node: '>=12'} - - styled-components@6.1.1: - resolution: {integrity: sha512-cpZZP5RrKRIClBW5Eby4JM1wElLVP4NQrJbJ0h10TidTyJf4SIIwa3zLXOoPb4gJi8MsJ8mjq5mu2IrEhZIAcQ==} - engines: {node: '>= 16'} - peerDependencies: - react: '>= 16.8.0' - react-dom: '>= 16.8.0' - - stylis@4.3.2: - resolution: {integrity: sha512-bhtUjWd/z6ltJiQwg0dUfxEJ+W+jdqQd8TbWLWyeIJHlnsqmGLRFFd8e5mA0AZi/zx90smXRlN66YMTcaSFifg==} - - supertap@3.0.1: - resolution: {integrity: sha512-u1ZpIBCawJnO+0QePsEiOknOfCRq0yERxiAchT0i4li0WHNUJbf0evXXSXOcCAR4M8iMDoajXYmstm/qO81Isw==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - supports-color@7.2.0: - resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} - engines: {node: '>=8'} - - tar@6.2.1: - resolution: {integrity: sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==} - engines: {node: '>=10'} - - temp-dir@3.0.0: - resolution: {integrity: sha512-nHc6S/bwIilKHNRgK/3jlhDoIHcp45YgyiwcAk46Tr0LfEqGBVpmiAyuiuxeVE44m3mXnEeVhaipLOEWmH+Njw==} - engines: {node: '>=14.16'} - - time-zone@1.0.0: - resolution: {integrity: sha512-TIsDdtKo6+XrPtiTm1ssmMngN1sAhyKnTO2kunQWqNPWIVvCm15Wmw4SWInwTVgJ5u/Tr04+8Ei9TNcw4x4ONA==} - engines: {node: '>=4'} - - tmp@0.0.33: - resolution: {integrity: sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==} - engines: {node: '>=0.6.0'} - - to-regex-range@5.0.1: - resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} - engines: {node: '>=8.0'} - - toml@3.0.0: - resolution: {integrity: sha512-y/mWCZinnvxjTKYhJ+pYxwD0mRLVvOtdS2Awbgxln6iEnt4rk0yBxeSBHkGJcPucRiG0e55mwWp+g/05rsrd6w==} - - tr46@0.0.3: - resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==} - - tslib@2.6.3: - resolution: {integrity: sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ==} - - typanion@3.14.0: - resolution: {integrity: sha512-ZW/lVMRabETuYCd9O9ZvMhAh8GslSqaUjxmK/JLPCh6l73CvLBiuXswj/+7LdnWOgYsQ130FqLzFz5aGT4I3Ug==} - - type-fest@0.13.1: - resolution: {integrity: sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==} - engines: {node: '>=10'} - - type-fest@0.21.3: - resolution: {integrity: sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==} - engines: {node: '>=10'} - - typescript@5.5.2: - resolution: {integrity: sha512-NcRtPEOsPFFWjobJEtfihkLCZCXZt/os3zf8nTxjVH3RvTSxjrCamJpbExGvYOF+tFHc3pA65qpdwPbzjohhew==} - engines: {node: '>=14.17'} - hasBin: true - - undici-types@5.26.5: - resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==} - - unicorn-magic@0.1.0: - resolution: {integrity: sha512-lRfVq8fE8gz6QMBuDM6a+LO3IAzTi05H6gCVaUpir2E1Rwpo4ZUog45KpNXKC/Mn3Yb9UDuHumeFTo9iV/D9FQ==} - engines: {node: '>=18'} - - universal-user-agent@6.0.1: - resolution: {integrity: sha512-yCzhz6FN2wU1NiiQRogkTQszlQSlpWaw8SvVegAc+bDxbzHgh1vX8uIe8OYyMH6DwH+sdTJsgMl36+mSMdRJIQ==} - - util-deprecate@1.0.2: - resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} - - wasm-sjlj@1.0.5: - resolution: {integrity: sha512-Z/MHJeOkAvJJVWnGX3/YZGYldGaawZbYHX4ldYG9kLhcdB8H31F5x66M7Zc4BP/7pg0aLsusQj1629m2B3Rilg==} - - wcwidth@1.0.1: - resolution: {integrity: sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==} - - webidl-conversions@3.0.1: - resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==} - - well-known-symbols@2.0.0: - resolution: {integrity: sha512-ZMjC3ho+KXo0BfJb7JgtQ5IBuvnShdlACNkKkdsqBmYw3bPAaJfPeYUo6tLUaT5tG/Gkh7xkpBhKRQ9e7pyg9Q==} - engines: {node: '>=6'} - - whatwg-url@5.0.0: - resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==} - - wide-align@1.1.5: - resolution: {integrity: sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==} - - wrap-ansi@6.2.0: - resolution: {integrity: sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==} - engines: {node: '>=8'} - - wrap-ansi@7.0.0: - resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==} - engines: {node: '>=10'} - - wrappy@1.0.2: - resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} - - write-file-atomic@5.0.1: - resolution: {integrity: sha512-+QU2zd6OTD8XWIJCbffaiQeH9U73qIqafo1x6V1snCWYGJf6cVE0cDR4D8xRzcEnfI21IFrUPzPGtcPf8AC+Rw==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - - y18n@5.0.8: - resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==} - engines: {node: '>=10'} - - yallist@4.0.0: - resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==} - - yargs-parser@21.1.1: - resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} - engines: {node: '>=12'} - - yargs@17.7.2: - resolution: {integrity: sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==} - engines: {node: '>=12'} - -snapshots: - - '@emnapi/core@1.2.0': - dependencies: - '@emnapi/wasi-threads': 1.0.1 - tslib: 2.6.3 - - '@emnapi/runtime@1.2.0': - dependencies: - tslib: 2.6.3 - - '@emnapi/wasi-threads@1.0.1': - dependencies: - tslib: 2.6.3 - - '@emotion/is-prop-valid@1.2.2': - dependencies: - '@emotion/memoize': 0.8.1 - - '@emotion/memoize@0.8.1': {} - - '@emotion/unitless@0.8.1': {} - - '@inquirer/figures@1.0.3': {} - - '@ljharb/through@2.3.13': - dependencies: - call-bind: 1.0.7 - - '@mapbox/node-pre-gyp@1.0.11': - dependencies: - detect-libc: 2.0.3 - https-proxy-agent: 5.0.1 - make-dir: 3.1.0 - node-fetch: 2.7.0 - nopt: 5.0.0 - npmlog: 5.0.1 - rimraf: 3.0.2 - semver: 7.6.2 - tar: 6.2.1 - transitivePeerDependencies: - - encoding - - supports-color - - '@napi-rs/cli@3.0.0-alpha.55(@emnapi/runtime@1.2.0)(emnapi@1.2.0)': - dependencies: - '@napi-rs/cross-toolchain': 0.0.16 - '@napi-rs/wasm-tools': 0.0.2 - '@octokit/rest': 20.1.1 - clipanion: 3.2.1(typanion@3.14.0) - colorette: 2.0.20 - debug: 4.3.5 - inquirer: 9.2.23 - js-yaml: 4.1.0 - lodash-es: 4.17.21 - semver: 7.6.2 - toml: 3.0.0 - typanion: 3.14.0 - wasm-sjlj: 1.0.5 - optionalDependencies: - '@emnapi/runtime': 1.2.0 - emnapi: 1.2.0 - transitivePeerDependencies: - - '@napi-rs/cross-toolchain-arm64-target-aarch64' - - '@napi-rs/cross-toolchain-arm64-target-armv7' - - '@napi-rs/cross-toolchain-arm64-target-x86_64' - - '@napi-rs/cross-toolchain-x64-target-aarch64' - - '@napi-rs/cross-toolchain-x64-target-armv7' - - '@napi-rs/cross-toolchain-x64-target-x86_64' - - supports-color - - '@napi-rs/cross-toolchain@0.0.16': - dependencies: - '@napi-rs/lzma': 1.3.1 - '@napi-rs/tar': 0.1.1 - debug: 4.3.5 - transitivePeerDependencies: - - supports-color - - '@napi-rs/lzma-android-arm-eabi@1.3.1': - optional: true - - '@napi-rs/lzma-android-arm64@1.3.1': - optional: true - - '@napi-rs/lzma-darwin-arm64@1.3.1': - optional: true - - '@napi-rs/lzma-darwin-x64@1.3.1': - optional: true - - '@napi-rs/lzma-freebsd-x64@1.3.1': - optional: true - - '@napi-rs/lzma-linux-arm-gnueabihf@1.3.1': - optional: true - - '@napi-rs/lzma-linux-arm64-gnu@1.3.1': - optional: true - - '@napi-rs/lzma-linux-arm64-musl@1.3.1': - optional: true - - '@napi-rs/lzma-linux-x64-gnu@1.3.1': - optional: true - - '@napi-rs/lzma-linux-x64-musl@1.3.1': - optional: true - - '@napi-rs/lzma-wasm32-wasi@1.3.1': - dependencies: - '@napi-rs/wasm-runtime': 0.2.4 - optional: true - - '@napi-rs/lzma-win32-arm64-msvc@1.3.1': - optional: true - - '@napi-rs/lzma-win32-ia32-msvc@1.3.1': - optional: true - - '@napi-rs/lzma-win32-x64-msvc@1.3.1': - optional: true - - '@napi-rs/lzma@1.3.1': - optionalDependencies: - '@napi-rs/lzma-android-arm-eabi': 1.3.1 - '@napi-rs/lzma-android-arm64': 1.3.1 - '@napi-rs/lzma-darwin-arm64': 1.3.1 - '@napi-rs/lzma-darwin-x64': 1.3.1 - '@napi-rs/lzma-freebsd-x64': 1.3.1 - '@napi-rs/lzma-linux-arm-gnueabihf': 1.3.1 - '@napi-rs/lzma-linux-arm64-gnu': 1.3.1 - '@napi-rs/lzma-linux-arm64-musl': 1.3.1 - '@napi-rs/lzma-linux-x64-gnu': 1.3.1 - '@napi-rs/lzma-linux-x64-musl': 1.3.1 - '@napi-rs/lzma-wasm32-wasi': 1.3.1 - '@napi-rs/lzma-win32-arm64-msvc': 1.3.1 - '@napi-rs/lzma-win32-ia32-msvc': 1.3.1 - '@napi-rs/lzma-win32-x64-msvc': 1.3.1 - - '@napi-rs/tar-android-arm-eabi@0.1.1': - optional: true - - '@napi-rs/tar-android-arm64@0.1.1': - optional: true - - '@napi-rs/tar-darwin-arm64@0.1.1': - optional: true - - '@napi-rs/tar-darwin-x64@0.1.1': - optional: true - - '@napi-rs/tar-freebsd-x64@0.1.1': - optional: true - - '@napi-rs/tar-linux-arm-gnueabihf@0.1.1': - optional: true - - '@napi-rs/tar-linux-arm64-gnu@0.1.1': - optional: true - - '@napi-rs/tar-linux-arm64-musl@0.1.1': - optional: true - - '@napi-rs/tar-linux-x64-gnu@0.1.1': - optional: true - - '@napi-rs/tar-linux-x64-musl@0.1.1': - optional: true - - '@napi-rs/tar-wasm32-wasi@0.1.1': - dependencies: - '@napi-rs/wasm-runtime': 0.2.4 - optional: true - - '@napi-rs/tar-win32-arm64-msvc@0.1.1': - optional: true - - '@napi-rs/tar-win32-ia32-msvc@0.1.1': - optional: true - - '@napi-rs/tar-win32-x64-msvc@0.1.1': - optional: true - - '@napi-rs/tar@0.1.1': - optionalDependencies: - '@napi-rs/tar-android-arm-eabi': 0.1.1 - '@napi-rs/tar-android-arm64': 0.1.1 - '@napi-rs/tar-darwin-arm64': 0.1.1 - '@napi-rs/tar-darwin-x64': 0.1.1 - '@napi-rs/tar-freebsd-x64': 0.1.1 - '@napi-rs/tar-linux-arm-gnueabihf': 0.1.1 - '@napi-rs/tar-linux-arm64-gnu': 0.1.1 - '@napi-rs/tar-linux-arm64-musl': 0.1.1 - '@napi-rs/tar-linux-x64-gnu': 0.1.1 - '@napi-rs/tar-linux-x64-musl': 0.1.1 - '@napi-rs/tar-wasm32-wasi': 0.1.1 - '@napi-rs/tar-win32-arm64-msvc': 0.1.1 - '@napi-rs/tar-win32-ia32-msvc': 0.1.1 - '@napi-rs/tar-win32-x64-msvc': 0.1.1 - - '@napi-rs/wasm-runtime@0.2.4': - dependencies: - '@emnapi/core': 1.2.0 - '@emnapi/runtime': 1.2.0 - '@tybys/wasm-util': 0.9.0 - - '@napi-rs/wasm-tools-android-arm-eabi@0.0.2': - optional: true - - '@napi-rs/wasm-tools-android-arm64@0.0.2': - optional: true - - '@napi-rs/wasm-tools-darwin-arm64@0.0.2': - optional: true - - '@napi-rs/wasm-tools-darwin-x64@0.0.2': - optional: true - - '@napi-rs/wasm-tools-freebsd-x64@0.0.2': - optional: true - - '@napi-rs/wasm-tools-linux-arm64-gnu@0.0.2': - optional: true - - '@napi-rs/wasm-tools-linux-arm64-musl@0.0.2': - optional: true - - '@napi-rs/wasm-tools-linux-x64-gnu@0.0.2': - optional: true - - '@napi-rs/wasm-tools-linux-x64-musl@0.0.2': - optional: true - - '@napi-rs/wasm-tools-wasm32-wasi@0.0.2': - dependencies: - '@napi-rs/wasm-runtime': 0.2.4 - optional: true - - '@napi-rs/wasm-tools-win32-arm64-msvc@0.0.2': - optional: true - - '@napi-rs/wasm-tools-win32-ia32-msvc@0.0.2': - optional: true - - '@napi-rs/wasm-tools-win32-x64-msvc@0.0.2': - optional: true - - '@napi-rs/wasm-tools@0.0.2': - optionalDependencies: - '@napi-rs/wasm-tools-android-arm-eabi': 0.0.2 - '@napi-rs/wasm-tools-android-arm64': 0.0.2 - '@napi-rs/wasm-tools-darwin-arm64': 0.0.2 - '@napi-rs/wasm-tools-darwin-x64': 0.0.2 - '@napi-rs/wasm-tools-freebsd-x64': 0.0.2 - '@napi-rs/wasm-tools-linux-arm64-gnu': 0.0.2 - '@napi-rs/wasm-tools-linux-arm64-musl': 0.0.2 - '@napi-rs/wasm-tools-linux-x64-gnu': 0.0.2 - '@napi-rs/wasm-tools-linux-x64-musl': 0.0.2 - '@napi-rs/wasm-tools-wasm32-wasi': 0.0.2 - '@napi-rs/wasm-tools-win32-arm64-msvc': 0.0.2 - '@napi-rs/wasm-tools-win32-ia32-msvc': 0.0.2 - '@napi-rs/wasm-tools-win32-x64-msvc': 0.0.2 - - '@nodelib/fs.scandir@2.1.5': - dependencies: - '@nodelib/fs.stat': 2.0.5 - run-parallel: 1.2.0 - - '@nodelib/fs.stat@2.0.5': {} - - '@nodelib/fs.walk@1.2.8': - dependencies: - '@nodelib/fs.scandir': 2.1.5 - fastq: 1.17.1 - - '@octokit/auth-token@4.0.0': {} - - '@octokit/core@5.2.0': - dependencies: - '@octokit/auth-token': 4.0.0 - '@octokit/graphql': 7.1.0 - '@octokit/request': 8.4.0 - '@octokit/request-error': 5.1.0 - '@octokit/types': 13.5.0 - before-after-hook: 2.2.3 - universal-user-agent: 6.0.1 - - '@octokit/endpoint@9.0.5': - dependencies: - '@octokit/types': 13.5.0 - universal-user-agent: 6.0.1 - - '@octokit/graphql@7.1.0': - dependencies: - '@octokit/request': 8.4.0 - '@octokit/types': 13.5.0 - universal-user-agent: 6.0.1 - - '@octokit/openapi-types@22.2.0': {} - - '@octokit/plugin-paginate-rest@11.3.1(@octokit/core@5.2.0)': - dependencies: - '@octokit/core': 5.2.0 - '@octokit/types': 13.5.0 - - '@octokit/plugin-request-log@4.0.1(@octokit/core@5.2.0)': - dependencies: - '@octokit/core': 5.2.0 - - '@octokit/plugin-rest-endpoint-methods@13.2.2(@octokit/core@5.2.0)': - dependencies: - '@octokit/core': 5.2.0 - '@octokit/types': 13.5.0 - - '@octokit/request-error@5.1.0': - dependencies: - '@octokit/types': 13.5.0 - deprecation: 2.3.1 - once: 1.4.0 - - '@octokit/request@8.4.0': - dependencies: - '@octokit/endpoint': 9.0.5 - '@octokit/request-error': 5.1.0 - '@octokit/types': 13.5.0 - universal-user-agent: 6.0.1 - - '@octokit/rest@20.1.1': - dependencies: - '@octokit/core': 5.2.0 - '@octokit/plugin-paginate-rest': 11.3.1(@octokit/core@5.2.0) - '@octokit/plugin-request-log': 4.0.1(@octokit/core@5.2.0) - '@octokit/plugin-rest-endpoint-methods': 13.2.2(@octokit/core@5.2.0) - - '@octokit/types@13.5.0': - dependencies: - '@octokit/openapi-types': 22.2.0 - - '@rollup/pluginutils@4.2.1': - dependencies: - estree-walker: 2.0.2 - picomatch: 2.3.1 - - '@sindresorhus/merge-streams@2.3.0': {} - - '@tybys/wasm-util@0.9.0': - dependencies: - tslib: 2.6.3 - - '@types/node@20.14.9': - dependencies: - undici-types: 5.26.5 - - '@types/stylis@4.2.6': {} - - '@vercel/nft@0.26.5': - dependencies: - '@mapbox/node-pre-gyp': 1.0.11 - '@rollup/pluginutils': 4.2.1 - acorn: 8.12.0 - acorn-import-attributes: 1.9.5(acorn@8.12.0) - async-sema: 3.1.1 - bindings: 1.5.0 - estree-walker: 2.0.2 - glob: 7.2.3 - graceful-fs: 4.2.11 - micromatch: 4.0.7 - node-gyp-build: 4.8.1 - resolve-from: 5.0.0 - transitivePeerDependencies: - - encoding - - supports-color - - abbrev@1.1.1: {} - - acorn-import-attributes@1.9.5(acorn@8.12.0): - dependencies: - acorn: 8.12.0 - - acorn-walk@8.3.3: - dependencies: - acorn: 8.12.0 - - acorn@8.12.0: {} - - agent-base@6.0.2: - dependencies: - debug: 4.3.5 - transitivePeerDependencies: - - supports-color - - ansi-escapes@4.3.2: - dependencies: - type-fest: 0.21.3 - - ansi-regex@5.0.1: {} - - ansi-regex@6.0.1: {} - - ansi-styles@4.3.0: - dependencies: - color-convert: 2.0.1 - - ansi-styles@6.2.1: {} - - aproba@2.0.0: {} - - are-we-there-yet@2.0.0: - dependencies: - delegates: 1.0.0 - readable-stream: 3.6.2 - - argparse@1.0.10: - dependencies: - sprintf-js: 1.0.3 - - argparse@2.0.1: {} - - array-find-index@1.0.2: {} - - arrgv@1.0.2: {} - - arrify@3.0.0: {} - - async-sema@3.1.1: {} - - asynckit@0.4.0: {} - - ava@6.1.3: - dependencies: - '@vercel/nft': 0.26.5 - acorn: 8.12.0 - acorn-walk: 8.3.3 - ansi-styles: 6.2.1 - arrgv: 1.0.2 - arrify: 3.0.0 - callsites: 4.1.0 - cbor: 9.0.2 - chalk: 5.3.0 - chunkd: 2.0.1 - ci-info: 4.0.0 - ci-parallel-vars: 1.0.1 - cli-truncate: 4.0.0 - code-excerpt: 4.0.0 - common-path-prefix: 3.0.0 - concordance: 5.0.4 - currently-unhandled: 0.4.1 - debug: 4.3.5 - emittery: 1.0.3 - figures: 6.1.0 - globby: 14.0.1 - ignore-by-default: 2.1.0 - indent-string: 5.0.0 - is-plain-object: 5.0.0 - is-promise: 4.0.0 - matcher: 5.0.0 - memoize: 10.0.0 - ms: 2.1.3 - p-map: 7.0.2 - package-config: 5.0.0 - picomatch: 3.0.1 - plur: 5.1.0 - pretty-ms: 9.0.0 - resolve-cwd: 3.0.0 - stack-utils: 2.0.6 - strip-ansi: 7.1.0 - supertap: 3.0.1 - temp-dir: 3.0.0 - write-file-atomic: 5.0.1 - yargs: 17.7.2 - transitivePeerDependencies: - - encoding - - supports-color - - axios@1.6.2: - dependencies: - follow-redirects: 1.15.6 - form-data: 4.0.0 - proxy-from-env: 1.1.0 - transitivePeerDependencies: - - debug - - balanced-match@1.0.2: {} - - base64-js@1.5.1: {} - - before-after-hook@2.2.3: {} - - bindings@1.5.0: - dependencies: - file-uri-to-path: 1.0.0 - - bl@4.1.0: - dependencies: - buffer: 5.7.1 - inherits: 2.0.4 - readable-stream: 3.6.2 - - blueimp-md5@2.19.0: {} - - brace-expansion@1.1.11: - dependencies: - balanced-match: 1.0.2 - concat-map: 0.0.1 - - braces@3.0.3: - dependencies: - fill-range: 7.1.1 - - buffer@5.7.1: - dependencies: - base64-js: 1.5.1 - ieee754: 1.2.1 - - call-bind@1.0.7: - dependencies: - es-define-property: 1.0.0 - es-errors: 1.3.0 - function-bind: 1.1.2 - get-intrinsic: 1.2.4 - set-function-length: 1.2.2 - - callsites@4.1.0: {} - - camelize@1.0.1: {} - - cbor@9.0.2: - dependencies: - nofilter: 3.1.0 - - chalk@4.1.2: - dependencies: - ansi-styles: 4.3.0 - supports-color: 7.2.0 - - chalk@5.3.0: {} - - chardet@0.7.0: {} - - chownr@2.0.0: {} - - chunkd@2.0.1: {} - - ci-info@4.0.0: {} - - ci-parallel-vars@1.0.1: {} - - cli-cursor@3.1.0: - dependencies: - restore-cursor: 3.1.0 - - cli-spinners@2.9.2: {} - - cli-truncate@4.0.0: - dependencies: - slice-ansi: 5.0.0 - string-width: 7.1.0 - - cli-width@4.1.0: {} - - clipanion@3.2.1(typanion@3.14.0): - dependencies: - typanion: 3.14.0 - - cliui@8.0.1: - dependencies: - string-width: 4.2.3 - strip-ansi: 6.0.1 - wrap-ansi: 7.0.0 - - clone@1.0.4: {} - - code-excerpt@4.0.0: - dependencies: - convert-to-spaces: 2.0.1 - - color-convert@2.0.1: - dependencies: - color-name: 1.1.4 - - color-name@1.1.4: {} - - color-support@1.1.3: {} - - colorette@2.0.20: {} - - combined-stream@1.0.8: - dependencies: - delayed-stream: 1.0.0 - - common-path-prefix@3.0.0: {} - - concat-map@0.0.1: {} - - concordance@5.0.4: - dependencies: - date-time: 3.1.0 - esutils: 2.0.3 - fast-diff: 1.3.0 - js-string-escape: 1.0.1 - lodash: 4.17.21 - md5-hex: 3.0.1 - semver: 7.6.2 - well-known-symbols: 2.0.0 - - console-control-strings@1.1.0: {} - - convert-to-spaces@2.0.1: {} - - css-color-keywords@1.0.0: {} - - css-to-react-native@3.2.0: - dependencies: - camelize: 1.0.1 - css-color-keywords: 1.0.0 - postcss-value-parser: 4.2.0 - - csstype@3.1.3: {} - - currently-unhandled@0.4.1: - dependencies: - array-find-index: 1.0.2 - - date-time@3.1.0: - dependencies: - time-zone: 1.0.0 - - debug@4.3.5: - dependencies: - ms: 2.1.2 - - defaults@1.0.4: - dependencies: - clone: 1.0.4 - - define-data-property@1.1.4: - dependencies: - es-define-property: 1.0.0 - es-errors: 1.3.0 - gopd: 1.0.1 - - delayed-stream@1.0.0: {} - - delegates@1.0.0: {} - - deprecation@2.3.1: {} - - detect-libc@2.0.3: {} - - emittery@1.0.3: {} - - emnapi@1.2.0: {} - - emoji-regex@10.3.0: {} - - emoji-regex@8.0.0: {} - - es-define-property@1.0.0: - dependencies: - get-intrinsic: 1.2.4 - - es-errors@1.3.0: {} - - escalade@3.1.2: {} - - escape-string-regexp@2.0.0: {} - - escape-string-regexp@5.0.0: {} - - esprima@4.0.1: {} - - estree-walker@2.0.2: {} - - esutils@2.0.3: {} - - external-editor@3.1.0: - dependencies: - chardet: 0.7.0 - iconv-lite: 0.4.24 - tmp: 0.0.33 - - fast-diff@1.3.0: {} - - fast-glob@3.3.2: - dependencies: - '@nodelib/fs.stat': 2.0.5 - '@nodelib/fs.walk': 1.2.8 - glob-parent: 5.1.2 - merge2: 1.4.1 - micromatch: 4.0.7 - - fastq@1.17.1: - dependencies: - reusify: 1.0.4 - - figures@6.1.0: - dependencies: - is-unicode-supported: 2.0.0 - - file-uri-to-path@1.0.0: {} - - fill-range@7.1.1: - dependencies: - to-regex-range: 5.0.1 - - find-up-simple@1.0.0: {} - - follow-redirects@1.15.6: {} - - form-data@4.0.0: - dependencies: - asynckit: 0.4.0 - combined-stream: 1.0.8 - mime-types: 2.1.35 - - fs-minipass@2.1.0: - dependencies: - minipass: 3.3.6 - - fs.realpath@1.0.0: {} - - function-bind@1.1.2: {} - - gauge@3.0.2: - dependencies: - aproba: 2.0.0 - color-support: 1.1.3 - console-control-strings: 1.1.0 - has-unicode: 2.0.1 - object-assign: 4.1.1 - signal-exit: 3.0.7 - string-width: 4.2.3 - strip-ansi: 6.0.1 - wide-align: 1.1.5 - - get-caller-file@2.0.5: {} - - get-east-asian-width@1.2.0: {} - - get-intrinsic@1.2.4: - dependencies: - es-errors: 1.3.0 - function-bind: 1.1.2 - has-proto: 1.0.3 - has-symbols: 1.0.3 - hasown: 2.0.2 - - glob-parent@5.1.2: - dependencies: - is-glob: 4.0.3 - - glob@7.2.3: - dependencies: - fs.realpath: 1.0.0 - inflight: 1.0.6 - inherits: 2.0.4 - minimatch: 3.1.2 - once: 1.4.0 - path-is-absolute: 1.0.1 - - globby@14.0.1: - dependencies: - '@sindresorhus/merge-streams': 2.3.0 - fast-glob: 3.3.2 - ignore: 5.3.1 - path-type: 5.0.0 - slash: 5.1.0 - unicorn-magic: 0.1.0 - - gopd@1.0.1: - dependencies: - get-intrinsic: 1.2.4 - - graceful-fs@4.2.11: {} - - has-flag@4.0.0: {} - - has-property-descriptors@1.0.2: - dependencies: - es-define-property: 1.0.0 - - has-proto@1.0.3: {} - - has-symbols@1.0.3: {} - - has-unicode@2.0.1: {} - - hasown@2.0.2: - dependencies: - function-bind: 1.1.2 - - https-proxy-agent@5.0.1: - dependencies: - agent-base: 6.0.2 - debug: 4.3.5 - transitivePeerDependencies: - - supports-color - - iconv-lite@0.4.24: - dependencies: - safer-buffer: 2.1.2 - - ieee754@1.2.1: {} - - ignore-by-default@2.1.0: {} - - ignore@5.3.1: {} - - imurmurhash@0.1.4: {} - - indent-string@5.0.0: {} - - inflight@1.0.6: - dependencies: - once: 1.4.0 - wrappy: 1.0.2 - - inherits@2.0.4: {} - - inquirer@9.2.23: - dependencies: - '@inquirer/figures': 1.0.3 - '@ljharb/through': 2.3.13 - ansi-escapes: 4.3.2 - chalk: 5.3.0 - cli-cursor: 3.1.0 - cli-width: 4.1.0 - external-editor: 3.1.0 - lodash: 4.17.21 - mute-stream: 1.0.0 - ora: 5.4.1 - run-async: 3.0.0 - rxjs: 7.8.1 - string-width: 4.2.3 - strip-ansi: 6.0.1 - wrap-ansi: 6.2.0 - - irregular-plurals@3.5.0: {} - - is-extglob@2.1.1: {} - - is-fullwidth-code-point@3.0.0: {} - - is-fullwidth-code-point@4.0.0: {} - - is-glob@4.0.3: - dependencies: - is-extglob: 2.1.1 - - is-interactive@1.0.0: {} - - is-number@7.0.0: {} - - is-plain-object@5.0.0: {} - - is-promise@4.0.0: {} - - is-unicode-supported@0.1.0: {} - - is-unicode-supported@2.0.0: {} - - js-string-escape@1.0.1: {} - - js-tokens@4.0.0: {} - - js-yaml@3.14.1: - dependencies: - argparse: 1.0.10 - esprima: 4.0.1 - - js-yaml@4.1.0: - dependencies: - argparse: 2.0.1 - - load-json-file@7.0.1: {} - - lodash-es@4.17.21: {} - - lodash@4.17.21: {} - - log-symbols@4.1.0: - dependencies: - chalk: 4.1.2 - is-unicode-supported: 0.1.0 - - loose-envify@1.4.0: - dependencies: - js-tokens: 4.0.0 - - make-dir@3.1.0: - dependencies: - semver: 6.3.1 - - matcher@5.0.0: - dependencies: - escape-string-regexp: 5.0.0 - - md5-hex@3.0.1: - dependencies: - blueimp-md5: 2.19.0 - - memoize@10.0.0: - dependencies: - mimic-function: 5.0.1 - - merge2@1.4.1: {} - - micromatch@4.0.7: - dependencies: - braces: 3.0.3 - picomatch: 2.3.1 - - mime-db@1.52.0: {} - - mime-types@2.1.35: - dependencies: - mime-db: 1.52.0 - - mimic-fn@2.1.0: {} - - mimic-function@5.0.1: {} - - minimatch@3.1.2: - dependencies: - brace-expansion: 1.1.11 - - minipass@3.3.6: - dependencies: - yallist: 4.0.0 - - minipass@5.0.0: {} - - minizlib@2.1.2: - dependencies: - minipass: 3.3.6 - yallist: 4.0.0 - - mkdirp@1.0.4: {} - - ms@2.1.2: {} - - ms@2.1.3: {} - - mute-stream@1.0.0: {} - - nanoid@3.3.7: {} - - node-fetch@2.7.0: - dependencies: - whatwg-url: 5.0.0 - - node-gyp-build@4.8.1: {} - - nofilter@3.1.0: {} - - nopt@5.0.0: - dependencies: - abbrev: 1.1.1 - - npmlog@5.0.1: - dependencies: - are-we-there-yet: 2.0.0 - console-control-strings: 1.1.0 - gauge: 3.0.2 - set-blocking: 2.0.0 - - object-assign@4.1.1: {} - - once@1.4.0: - dependencies: - wrappy: 1.0.2 - - onetime@5.1.2: - dependencies: - mimic-fn: 2.1.0 - - ora@5.4.1: - dependencies: - bl: 4.1.0 - chalk: 4.1.2 - cli-cursor: 3.1.0 - cli-spinners: 2.9.2 - is-interactive: 1.0.0 - is-unicode-supported: 0.1.0 - log-symbols: 4.1.0 - strip-ansi: 6.0.1 - wcwidth: 1.0.1 - - os-tmpdir@1.0.2: {} - - p-map@7.0.2: {} - - package-config@5.0.0: - dependencies: - find-up-simple: 1.0.0 - load-json-file: 7.0.1 - - parse-ms@4.0.0: {} - - path-is-absolute@1.0.1: {} - - path-type@5.0.0: {} - - picocolors@1.0.1: {} - - picomatch@2.3.1: {} - - picomatch@3.0.1: {} - - plur@5.1.0: - dependencies: - irregular-plurals: 3.5.0 - - postcss-value-parser@4.2.0: {} - - postcss@8.4.33: - dependencies: - nanoid: 3.3.7 - picocolors: 1.0.1 - source-map-js: 1.2.0 - - pretty-ms@9.0.0: - dependencies: - parse-ms: 4.0.0 - - proxy-from-env@1.1.0: {} - - queue-microtask@1.2.3: {} - - react-dom@18.3.1(react@18.3.1): - dependencies: - loose-envify: 1.4.0 - react: 18.3.1 - scheduler: 0.23.2 - - react@18.3.1: - dependencies: - loose-envify: 1.4.0 - - readable-stream@3.6.2: - dependencies: - inherits: 2.0.4 - string_decoder: 1.3.0 - util-deprecate: 1.0.2 - - require-directory@2.1.1: {} - - resolve-cwd@3.0.0: - dependencies: - resolve-from: 5.0.0 - - resolve-from@5.0.0: {} - - restore-cursor@3.1.0: - dependencies: - onetime: 5.1.2 - signal-exit: 3.0.7 - - reusify@1.0.4: {} - - rimraf@3.0.2: - dependencies: - glob: 7.2.3 - - run-async@3.0.0: {} - - run-parallel@1.2.0: - dependencies: - queue-microtask: 1.2.3 - - rxjs@7.8.1: - dependencies: - tslib: 2.6.3 - - safe-buffer@5.2.1: {} - - safer-buffer@2.1.2: {} - - scheduler@0.23.2: - dependencies: - loose-envify: 1.4.0 - - semver@6.3.1: {} - - semver@7.6.2: {} - - serialize-error@7.0.1: - dependencies: - type-fest: 0.13.1 - - set-blocking@2.0.0: {} - - set-function-length@1.2.2: - 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 - - shallowequal@1.1.0: {} - - signal-exit@3.0.7: {} - - signal-exit@4.1.0: {} - - slash@5.1.0: {} - - slice-ansi@5.0.0: - dependencies: - ansi-styles: 6.2.1 - is-fullwidth-code-point: 4.0.0 - - source-map-js@1.2.0: {} - - sprintf-js@1.0.3: {} - - stack-utils@2.0.6: - dependencies: - escape-string-regexp: 2.0.0 - - string-width@4.2.3: - dependencies: - emoji-regex: 8.0.0 - is-fullwidth-code-point: 3.0.0 - strip-ansi: 6.0.1 - - string-width@7.1.0: - dependencies: - emoji-regex: 10.3.0 - get-east-asian-width: 1.2.0 - strip-ansi: 7.1.0 - - string_decoder@1.3.0: - dependencies: - safe-buffer: 5.2.1 - - strip-ansi@6.0.1: - dependencies: - ansi-regex: 5.0.1 - - strip-ansi@7.1.0: - dependencies: - ansi-regex: 6.0.1 - - styled-components@6.1.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1): - dependencies: - '@emotion/is-prop-valid': 1.2.2 - '@emotion/unitless': 0.8.1 - '@types/stylis': 4.2.6 - css-to-react-native: 3.2.0 - csstype: 3.1.3 - postcss: 8.4.33 - react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) - shallowequal: 1.1.0 - stylis: 4.3.2 - tslib: 2.6.3 - - stylis@4.3.2: {} - - supertap@3.0.1: - dependencies: - indent-string: 5.0.0 - js-yaml: 3.14.1 - serialize-error: 7.0.1 - strip-ansi: 7.1.0 - - supports-color@7.2.0: - dependencies: - has-flag: 4.0.0 - - tar@6.2.1: - dependencies: - chownr: 2.0.0 - fs-minipass: 2.1.0 - minipass: 5.0.0 - minizlib: 2.1.2 - mkdirp: 1.0.4 - yallist: 4.0.0 - - temp-dir@3.0.0: {} - - time-zone@1.0.0: {} - - tmp@0.0.33: - dependencies: - os-tmpdir: 1.0.2 - - to-regex-range@5.0.1: - dependencies: - is-number: 7.0.0 - - toml@3.0.0: {} - - tr46@0.0.3: {} - - tslib@2.6.3: {} - - typanion@3.14.0: {} - - type-fest@0.13.1: {} - - type-fest@0.21.3: {} - - typescript@5.5.2: {} - - undici-types@5.26.5: {} - - unicorn-magic@0.1.0: {} - - universal-user-agent@6.0.1: {} - - util-deprecate@1.0.2: {} - - wasm-sjlj@1.0.5: {} - - wcwidth@1.0.1: - dependencies: - defaults: 1.0.4 - - webidl-conversions@3.0.1: {} - - well-known-symbols@2.0.0: {} - - whatwg-url@5.0.0: - dependencies: - tr46: 0.0.3 - webidl-conversions: 3.0.1 - - wide-align@1.1.5: - dependencies: - string-width: 4.2.3 - - wrap-ansi@6.2.0: - dependencies: - ansi-styles: 4.3.0 - string-width: 4.2.3 - strip-ansi: 6.0.1 - - wrap-ansi@7.0.0: - dependencies: - ansi-styles: 4.3.0 - string-width: 4.2.3 - strip-ansi: 6.0.1 - - wrappy@1.0.2: {} - - write-file-atomic@5.0.1: - dependencies: - imurmurhash: 0.1.4 - signal-exit: 4.1.0 - - y18n@5.0.8: {} - - yallist@4.0.0: {} - - yargs-parser@21.1.1: {} - - yargs@17.7.2: - dependencies: - cliui: 8.0.1 - escalade: 3.1.2 - get-caller-file: 2.0.5 - require-directory: 2.1.1 - string-width: 4.2.3 - y18n: 5.0.8 - yargs-parser: 21.1.1 diff --git a/src/builtins.rs b/src/builtins.rs deleted file mode 100644 index 45a25117..00000000 --- a/src/builtins.rs +++ /dev/null @@ -1,71 +0,0 @@ -/// Node.js built-in modules -/// -/// `node -p "[...require('module').builtinModules].map(b => JSON.stringify(b)).join(',\n')"` -/// -pub const NODEJS_BUILTINS: &[&str] = &[ - "_http_agent", - "_http_client", - "_http_common", - "_http_incoming", - "_http_outgoing", - "_http_server", - "_stream_duplex", - "_stream_passthrough", - "_stream_readable", - "_stream_transform", - "_stream_wrap", - "_stream_writable", - "_tls_common", - "_tls_wrap", - "assert", - "assert/strict", - "async_hooks", - "buffer", - "child_process", - "cluster", - "console", - "constants", - "crypto", - "dgram", - "diagnostics_channel", - "dns", - "dns/promises", - "domain", - "events", - "fs", - "fs/promises", - "http", - "http2", - "https", - "inspector", - "module", - "net", - "os", - "path", - "path/posix", - "path/win32", - "perf_hooks", - "process", - "punycode", - "querystring", - "readline", - "repl", - "stream", - "stream/consumers", - "stream/promises", - "stream/web", - "string_decoder", - "sys", - "timers", - "timers/promises", - "tls", - "trace_events", - "tty", - "url", - "util", - "util/types", - "v8", - "vm", - "worker_threads", - "zlib", -]; diff --git a/src/cache.rs b/src/cache.rs deleted file mode 100644 index a1bde36c..00000000 --- a/src/cache.rs +++ /dev/null @@ -1,369 +0,0 @@ -use once_cell::sync::OnceCell as OnceLock; -use std::{ - borrow::{Borrow, Cow}, - convert::AsRef, - hash::{BuildHasherDefault, Hash, Hasher}, - io, - ops::Deref, - path::{Path, PathBuf}, - sync::Arc, -}; - -use dashmap::{DashMap, DashSet}; -use rustc_hash::FxHasher; - -use crate::{ - context::ResolveContext as Ctx, package_json::PackageJson, path::PathUtil, FileMetadata, - FileSystem, ResolveError, ResolveOptions, TsConfig, -}; - -#[derive(Default)] -pub struct Cache { - pub(crate) fs: Fs, - paths: DashSet>, - tsconfigs: DashMap, BuildHasherDefault>, -} - -impl Cache { - pub fn new(fs: Fs) -> Self { - Self { fs, paths: DashSet::default(), tsconfigs: DashMap::default() } - } - - pub fn clear(&self) { - self.paths.clear(); - self.tsconfigs.clear(); - } - - pub fn value(&self, path: &Path) -> CachedPath { - let hash = { - let mut hasher = FxHasher::default(); - path.hash(&mut hasher); - hasher.finish() - }; - if let Some(cache_entry) = self.paths.get((hash, path).borrow() as &dyn CacheKey) { - return cache_entry.clone(); - } - let parent = path.parent().map(|p| self.value(p)); - let data = CachedPath(Arc::new(CachedPathImpl::new( - hash, - path.to_path_buf().into_boxed_path(), - parent, - ))); - self.paths.insert(data.clone()); - data - } - - pub fn tsconfig Result<(), ResolveError>>( - &self, - root: bool, - path: &Path, - callback: F, // callback for modifying tsconfig with `extends` - ) -> Result, ResolveError> { - if let Some(tsconfig_ref) = self.tsconfigs.get(path) { - return Ok(Arc::clone(tsconfig_ref.value())); - } - let meta = self.fs.metadata(path).ok(); - let tsconfig_path = if meta.is_some_and(|m| m.is_file) { - Cow::Borrowed(path) - } else if meta.is_some_and(|m| m.is_dir) { - Cow::Owned(path.join("tsconfig.json")) - } else { - let mut os_string = path.to_path_buf().into_os_string(); - os_string.push(".json"); - Cow::Owned(PathBuf::from(os_string)) - }; - let mut tsconfig_string = self - .fs - .read_to_string(&tsconfig_path) - .map_err(|_| ResolveError::TsconfigNotFound(path.to_path_buf()))?; - let mut tsconfig = - TsConfig::parse(root, &tsconfig_path, &mut tsconfig_string).map_err(|error| { - ResolveError::from_serde_json_error(tsconfig_path.to_path_buf(), &error) - })?; - callback(&mut tsconfig)?; - let tsconfig = Arc::new(tsconfig.build()); - self.tsconfigs.insert(path.to_path_buf(), Arc::clone(&tsconfig)); - Ok(tsconfig) - } -} - -#[derive(Clone)] -pub struct CachedPath(Arc); - -impl Hash for CachedPath { - fn hash(&self, state: &mut H) { - self.0.hash.hash(state); - } -} - -impl PartialEq for CachedPath { - fn eq(&self, other: &Self) -> bool { - self.0.path == other.0.path - } -} -impl Eq for CachedPath {} - -impl Deref for CachedPath { - type Target = CachedPathImpl; - - fn deref(&self) -> &Self::Target { - self.0.as_ref() - } -} - -impl<'a> Borrow for CachedPath { - fn borrow(&self) -> &(dyn CacheKey + 'a) { - self - } -} - -impl AsRef for CachedPath { - fn as_ref(&self) -> &CachedPathImpl { - self.0.as_ref() - } -} - -impl CacheKey for CachedPath { - fn tuple(&self) -> (u64, &Path) { - (self.hash, &self.path) - } -} - -pub struct CachedPathImpl { - hash: u64, - path: Box, - parent: Option, - meta: OnceLock>, - symlink: OnceLock>, - canonicalized: OnceLock>, - node_modules: OnceLock>, - package_json: OnceLock>>, -} - -impl CachedPathImpl { - fn new(hash: u64, path: Box, parent: Option) -> Self { - Self { - hash, - path, - parent, - meta: OnceLock::new(), - symlink: OnceLock::new(), - canonicalized: OnceLock::new(), - node_modules: OnceLock::new(), - package_json: OnceLock::new(), - } - } - - pub fn path(&self) -> &Path { - &self.path - } - - pub fn to_path_buf(&self) -> PathBuf { - self.path.to_path_buf() - } - - pub fn parent(&self) -> Option<&CachedPath> { - self.parent.as_ref() - } - - fn meta(&self, fs: &Fs) -> Option { - *self.meta.get_or_init(|| fs.metadata(&self.path).ok()) - } - - pub fn is_file(&self, fs: &Fs, ctx: &mut Ctx) -> bool { - if let Some(meta) = self.meta(fs) { - ctx.add_file_dependency(self.path()); - meta.is_file - } else { - ctx.add_missing_dependency(self.path()); - false - } - } - - pub fn is_dir(&self, fs: &Fs, ctx: &mut Ctx) -> bool { - self.meta(fs).map_or_else( - || { - ctx.add_missing_dependency(self.path()); - false - }, - |meta| meta.is_dir, - ) - } - - fn symlink(&self, fs: &Fs) -> io::Result> { - self.symlink - .get_or_try_init(|| { - if let Ok(symlink_metadata) = fs.symlink_metadata(&self.path) { - if symlink_metadata.is_symlink { - return fs.canonicalize(self.path()).map(Some); - } - } - Ok(None) - }) - .cloned() - } - - pub fn realpath(&self, fs: &Fs) -> io::Result { - self.canonicalized - .get_or_try_init(|| { - if let Some(link) = self.symlink(fs)? { - return Ok(Some(link)); - } - if let Some(parent) = self.parent() { - let parent_path = parent.realpath(fs)?; - return Ok(Some( - parent_path.normalize_with(self.path.strip_prefix(&parent.path).unwrap()), - )); - }; - Ok(None) - }) - .cloned() - .map(|r| r.unwrap_or_else(|| self.path.clone().to_path_buf())) - } - - pub fn module_directory( - &self, - module_name: &str, - cache: &Cache, - ctx: &mut Ctx, - ) -> Option { - let cached_path = cache.value(&self.path.join(module_name)); - cached_path.is_dir(&cache.fs, ctx).then_some(cached_path) - } - - pub fn cached_node_modules( - &self, - cache: &Cache, - ctx: &mut Ctx, - ) -> Option { - self.node_modules.get_or_init(|| self.module_directory("node_modules", cache, ctx)).clone() - } - - /// Find package.json of a path by traversing parent directories. - /// - /// # Errors - /// - /// * [ResolveError::JSON] - pub fn find_package_json( - &self, - fs: &Fs, - options: &ResolveOptions, - ctx: &mut Ctx, - ) -> Result>, ResolveError> { - let mut cache_value = self; - // Go up directories when the querying path is not a directory - while !cache_value.is_dir(fs, ctx) { - if let Some(cv) = &cache_value.parent { - cache_value = cv.as_ref(); - } else { - break; - } - } - let mut cache_value = Some(cache_value); - while let Some(cv) = cache_value { - if let Some(package_json) = cv.package_json(fs, options, ctx)? { - return Ok(Some(Arc::clone(&package_json))); - } - cache_value = cv.parent.as_deref(); - } - Ok(None) - } - - /// Get package.json of the given path. - /// - /// # Errors - /// - /// * [ResolveError::JSON] - pub fn package_json( - &self, - fs: &Fs, - options: &ResolveOptions, - ctx: &mut Ctx, - ) -> Result>, ResolveError> { - // Change to `std::sync::OnceLock::get_or_try_init` when it is stable. - let result = self - .package_json - .get_or_try_init(|| { - let package_json_path = self.path.join("package.json"); - let Ok(package_json_string) = fs.read_to_string(&package_json_path) else { - return Ok(None); - }; - let real_path = if options.symlinks { - self.realpath(fs)?.join("package.json") - } else { - package_json_path.clone() - }; - PackageJson::parse(package_json_path.clone(), real_path, &package_json_string) - .map(Arc::new) - .map(Some) - .map_err(|error| ResolveError::from_serde_json_error(package_json_path, &error)) - }) - .cloned(); - // https://github.com/webpack/enhanced-resolve/blob/58464fc7cb56673c9aa849e68e6300239601e615/lib/DescriptionFileUtils.js#L68-L82 - match &result { - Ok(Some(package_json)) => { - ctx.add_file_dependency(&package_json.path); - } - Ok(None) => { - // Avoid an allocation by making this lazy - if let Some(deps) = &mut ctx.missing_dependencies { - deps.push(self.path.join("package.json")); - } - } - Err(_) => { - if let Some(deps) = &mut ctx.file_dependencies { - deps.push(self.path.join("package.json")); - } - } - } - result - } -} - -/// Memoized cache key, code adapted from . -trait CacheKey { - fn tuple(&self) -> (u64, &Path); -} - -impl Hash for dyn CacheKey + '_ { - fn hash(&self, state: &mut H) { - self.tuple().0.hash(state); - } -} - -impl PartialEq for dyn CacheKey + '_ { - fn eq(&self, other: &Self) -> bool { - self.tuple().1 == other.tuple().1 - } -} - -impl Eq for dyn CacheKey + '_ {} - -impl<'a> CacheKey for (u64, &'a Path) { - fn tuple(&self) -> (u64, &Path) { - (self.0, self.1) - } -} - -impl<'a> Borrow for (u64, &'a Path) { - fn borrow(&self) -> &(dyn CacheKey + 'a) { - self - } -} - -/// Since the cache key is memoized, use an identity hasher -/// to avoid double cache. -#[derive(Default)] -struct IdentityHasher(u64); - -impl Hasher for IdentityHasher { - fn write(&mut self, _: &[u8]) { - unreachable!("Invalid use of IdentityHasher") - } - fn write_u64(&mut self, n: u64) { - self.0 = n; - } - fn finish(&self) -> u64 { - self.0 - } -} diff --git a/src/context.rs b/src/context.rs deleted file mode 100644 index 9349de30..00000000 --- a/src/context.rs +++ /dev/null @@ -1,89 +0,0 @@ -use std::{ - ops::{Deref, DerefMut}, - path::{Path, PathBuf}, -}; - -use crate::error::ResolveError; - -#[derive(Debug, Default, Clone)] -pub struct ResolveContext(ResolveContextImpl); - -#[derive(Debug, Default, Clone)] -pub struct ResolveContextImpl { - pub fully_specified: bool, - - pub query: Option, - - pub fragment: Option, - - /// Files that was found on file system - pub file_dependencies: Option>, - - /// Files that was found on file system - pub missing_dependencies: Option>, - - /// The current resolving alias for bailing recursion alias. - pub resolving_alias: Option, - - /// For avoiding infinite recursion, which will cause stack overflow. - depth: u8, -} - -impl Deref for ResolveContext { - type Target = ResolveContextImpl; - - fn deref(&self) -> &Self::Target { - &self.0 - } -} - -impl DerefMut for ResolveContext { - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} - -impl ResolveContext { - pub fn with_fully_specified(&mut self, yes: bool) { - self.fully_specified = yes; - } - - pub fn with_query_fragment(&mut self, query: Option<&str>, fragment: Option<&str>) { - if let Some(query) = query { - self.query.replace(query.to_string()); - } - if let Some(fragment) = fragment { - self.fragment.replace(fragment.to_string()); - } - } - - pub fn init_file_dependencies(&mut self) { - self.file_dependencies.replace(vec![]); - self.missing_dependencies.replace(vec![]); - } - - pub fn add_file_dependency(&mut self, dep: &Path) { - if let Some(deps) = &mut self.file_dependencies { - deps.push(dep.to_path_buf()); - } - } - - pub fn add_missing_dependency(&mut self, dep: &Path) { - if let Some(deps) = &mut self.missing_dependencies { - deps.push(dep.to_path_buf()); - } - } - - pub fn with_resolving_alias(&mut self, alias: String) { - self.resolving_alias = Some(alias); - } - - pub fn test_for_infinite_recursion(&mut self) -> Result<(), ResolveError> { - self.depth += 1; - // 64 should be more than enough for detecting infinite recursion. - if self.depth > 64 { - return Err(ResolveError::Recursion); - } - Ok(()) - } -} diff --git a/src/error.rs b/src/error.rs deleted file mode 100644 index d8b190ba..00000000 --- a/src/error.rs +++ /dev/null @@ -1,174 +0,0 @@ -use std::{io, path::PathBuf, sync::Arc}; -use thiserror::Error; - -/// All resolution errors -/// -/// `thiserror` is used to display meaningful error messages. -#[derive(Debug, Clone, PartialEq, Error)] -pub enum ResolveError { - /// Ignored path - /// - /// Derived from ignored path (false value) from browser field in package.json - /// ```json - /// { - /// "browser": { - /// "./module": false - /// } - /// } - /// ``` - /// See - #[error("Path is ignored {0}")] - Ignored(PathBuf), - - /// Module not found - #[error("Cannot find module '{0}'")] - NotFound(/* specifier */ String), - - /// Tsconfig not found - #[error("Tsconfig not found {0}")] - TsconfigNotFound(PathBuf), - - #[error("{0}")] - IOError(IOError), - - /// Node.js builtin modules - /// - /// This is an error due to not being a Node.js runtime. - /// The `alias` option can be used to resolve a builtin module to a polyfill. - #[error("Builtin module {0}")] - Builtin(String), - - /// All of the aliased extension are not found - #[error("All of the aliased extension are not found")] - ExtensionAlias, - - /// The provided path specifier cannot be parsed - #[error("{0}")] - Specifier(SpecifierError), - - /// JSON parse error - #[error("{0:?}")] - JSON(JSONError), - - /// Restricted by `ResolveOptions::restrictions` - #[error(r#"Path "{0}" restricted by {0}"#)] - Restriction(PathBuf, PathBuf), - - #[error(r#"Invalid module "{0}" specifier is not a valid subpath for the "exports" resolution of {1}"#)] - InvalidModuleSpecifier(String, PathBuf), - - #[error(r#"Invalid "exports" target "{0}" defined for '{1}' in the package config {2}"#)] - InvalidPackageTarget(String, String, PathBuf), - - #[error(r#"Package subpath '{0}' is not defined by "exports" in {1}"#)] - PackagePathNotExported(String, PathBuf), - - #[error(r#"Invalid package config "{0}", "exports" cannot contain some keys starting with '.' and some not. The exports object must either be an object of package subpath keys or an object of main entry condition name keys only."#)] - InvalidPackageConfig(PathBuf), - - #[error(r#"Default condition should be last one in "{0}""#)] - InvalidPackageConfigDefault(PathBuf), - - #[error(r#"Expecting folder to folder mapping. "{0}" should end with "/"#)] - InvalidPackageConfigDirectory(PathBuf), - - #[error(r#"Package import specifier "{0}" is not defined in package {1}"#)] - PackageImportNotDefined(String, PathBuf), - - #[error("{0} is unimplemented")] - Unimplemented(&'static str), - - /// Occurs when alias paths reference each other. - #[error("Recursion in resolving")] - Recursion, -} - -impl ResolveError { - pub fn is_ignore(&self) -> bool { - matches!(self, Self::Ignored(_)) - } - - pub(crate) fn from_serde_json_error(path: PathBuf, error: &serde_json::Error) -> Self { - Self::JSON(JSONError { - path, - message: error.to_string(), - line: error.line(), - column: error.column(), - }) - } -} - -/// Error for [ResolveError::Specifier] -#[derive(Debug, Clone, Eq, PartialEq, Error)] -pub enum SpecifierError { - #[error("The specifiers must be a non-empty string. Received \"{0}\"")] - Empty(String), -} - -/// JSON error from [serde_json::Error] -#[derive(Debug, Clone, Eq, PartialEq)] -pub struct JSONError { - pub path: PathBuf, - pub message: String, - pub line: usize, - pub column: usize, -} - -#[derive(Debug, Clone, Error)] -#[error("{0}")] -pub struct IOError(Arc); - -impl PartialEq for IOError { - fn eq(&self, other: &Self) -> bool { - self.0.kind() == other.0.kind() - } -} - -impl From for io::Error { - fn from(error: IOError) -> Self { - let io_error = error.0.as_ref(); - Self::new(io_error.kind(), io_error.to_string()) - } -} - -impl From for ResolveError { - fn from(err: io::Error) -> Self { - Self::IOError(IOError(Arc::new(err))) - } -} - -#[test] -fn test_into_io_error() { - use std::io::{self, ErrorKind}; - let error_string = "IOError occurred"; - let string_error = io::Error::new(ErrorKind::Interrupted, error_string.to_string()); - let string_error2 = io::Error::new(ErrorKind::Interrupted, error_string.to_string()); - let resolve_io_error: ResolveError = ResolveError::from(string_error2); - - assert_eq!(resolve_io_error, ResolveError::from(string_error)); - assert_eq!(resolve_io_error.clone(), resolve_io_error); - let ResolveError::IOError(io_error) = resolve_io_error else { unreachable!() }; - assert_eq!( - format!("{io_error:?}"), - r#"IOError(Custom { kind: Interrupted, error: "IOError occurred" })"# - ); - // fix for https://github.com/web-infra-dev/rspack/issues/4564 - let std_io_error: io::Error = io_error.into(); - assert_eq!(std_io_error.kind(), ErrorKind::Interrupted); - assert_eq!(std_io_error.to_string(), error_string); - assert_eq!( - format!("{std_io_error:?}"), - r#"Custom { kind: Interrupted, error: "IOError occurred" }"# - ); -} - -#[test] -fn test_coverage() { - let error = ResolveError::NotFound("x".into()); - assert_eq!(format!("{error:?}"), r#"NotFound("x")"#); - assert_eq!(error.clone(), error); - - let error = ResolveError::Specifier(SpecifierError::Empty("x".into())); - assert_eq!(format!("{error:?}"), r#"Specifier(Empty("x"))"#); - assert_eq!(error.clone(), error); -} diff --git a/src/file_system.rs b/src/file_system.rs deleted file mode 100644 index 04d177de..00000000 --- a/src/file_system.rs +++ /dev/null @@ -1,133 +0,0 @@ -use std::{ - fs, io, - path::{Path, PathBuf}, -}; - -/// File System abstraction used for `ResolverGeneric` -pub trait FileSystem: Send + Sync { - /// See [std::fs::read_to_string] - /// - /// # Errors - /// - /// * See [std::fs::read_to_string] - /// ## Warning - /// Use `&Path` instead of a generic `P: AsRef` here, - /// because object safety requirements, it is especially useful, when - /// you want to store multiple `dyn FileSystem` in a `Vec` or use a `ResolverGeneric` in - /// napi env. - fn read_to_string(&self, path: &Path) -> io::Result; - - /// See [std::fs::metadata] - /// - /// # Errors - /// See [std::fs::metadata] - /// ## Warning - /// Use `&Path` instead of a generic `P: AsRef` here, - /// because object safety requirements, it is especially useful, when - /// you want to store multiple `dyn FileSystem` in a `Vec` or use a `ResolverGeneric` in - /// napi env. - fn metadata(&self, path: &Path) -> io::Result; - - /// See [std::fs::symlink_metadata] - /// - /// # Errors - /// - /// See [std::fs::symlink_metadata] - /// ## Warning - /// Use `&Path` instead of a generic `P: AsRef` here, - /// because object safety requirements, it is especially useful, when - /// you want to store multiple `dyn FileSystem` in a `Vec` or use a `ResolverGeneric` in - /// napi env. - fn symlink_metadata(&self, path: &Path) -> io::Result; - - /// See [std::fs::canonicalize] - /// - /// # Errors - /// - /// See [std::fs::read_link] - /// ## Warning - /// Use `&Path` instead of a generic `P: AsRef` here, - /// because object safety requirements, it is especially useful, when - /// you want to store multiple `dyn FileSystem` in a `Vec` or use a `ResolverGeneric` in - /// napi env. - fn canonicalize(&self, path: &Path) -> io::Result; -} - -/// Metadata information about a file -#[derive(Debug, Clone, Copy)] -pub struct FileMetadata { - pub(crate) is_file: bool, - pub(crate) is_dir: bool, - pub(crate) is_symlink: bool, -} - -impl FileMetadata { - pub fn new(is_file: bool, is_dir: bool, is_symlink: bool) -> Self { - Self { is_file, is_dir, is_symlink } - } -} - -impl From for FileMetadata { - fn from(metadata: fs::Metadata) -> Self { - Self::new(metadata.is_file(), metadata.is_dir(), metadata.is_symlink()) - } -} - -/// Operating System -#[derive(Default)] -pub struct FileSystemOs; - -impl FileSystem for FileSystemOs { - fn read_to_string(&self, path: &Path) -> io::Result { - fs::read_to_string(path) - } - - fn metadata(&self, path: &Path) -> io::Result { - fs::metadata(path).map(FileMetadata::from) - } - - fn symlink_metadata(&self, path: &Path) -> io::Result { - fs::symlink_metadata(path).map(FileMetadata::from) - } - - fn canonicalize(&self, path: &Path) -> io::Result { - #[cfg(not(target_os = "wasi"))] - { - dunce::canonicalize(path) - } - #[cfg(target_os = "wasi")] - { - let meta = fs::symlink_metadata(path)?; - if meta.file_type().is_symlink() { - let link = fs::read_link(path)?; - let mut path_buf = path.to_path_buf(); - path_buf.pop(); - for segment in link.iter() { - match segment.to_str() { - Some("..") => { - path_buf.pop(); - } - Some(".") | None => {} - Some(seg) => { - // Need to trim the extra \0 introduces by rust std rust-lang/rust#123727 - path_buf.push(seg.trim_end_matches('\0')); - } - } - } - Ok(path_buf) - } else { - Ok(path.to_path_buf()) - } - } - } -} - -#[test] -fn metadata() { - let meta = FileMetadata { is_file: true, is_dir: true, is_symlink: true }; - assert_eq!( - format!("{meta:?}"), - "FileMetadata { is_file: true, is_dir: true, is_symlink: true }" - ); - let _ = meta; -} diff --git a/src/lib.rs b/src/lib.rs deleted file mode 100644 index ac95d63f..00000000 --- a/src/lib.rs +++ /dev/null @@ -1,1682 +0,0 @@ -//! # Oxc Resolver -//! -//! Node.js [CommonJS][cjs] and [ECMAScript][esm] Module Resolution. -//! -//! Released on [crates.io](https://crates.io/crates/oxc_resolver) and [npm](https://www.npmjs.com/package/oxc-resolver). -//! -//! A module resolution is the process of finding the file referenced by a module specifier in -//! `import "specifier"` or `require("specifier")`. -//! -//! All [configuration options](ResolveOptions) are aligned with webpack's [enhanced-resolve]. -//! -//! ## Terminology -//! -//! ### Specifier -//! -//! For [CommonJS modules][cjs], -//! the specifier is the string passed to the `require` function. e.g. `"id"` in `require("id")`. -//! -//! For [ECMAScript modules][esm], -//! the specifier of an `import` statement is the string after the `from` keyword, -//! e.g. `'specifier'` in `import 'specifier'` or `import { sep } from 'specifier'`. -//! Specifiers are also used in export from statements, and as the argument to an `import()` expression. -//! -//! This is also named "request" in some places. -//! -//! ## References: -//! -//! * Algorithm adapted from Node.js [CommonJS Module Resolution Algorithm] and [ECMAScript Module Resolution Algorithm]. -//! * Tests are ported from [enhanced-resolve]. -//! * Some code is adapted from [parcel-resolver]. -//! * The documentation is copied from [webpack's resolve configuration](https://webpack.js.org/configuration/resolve). -//! -//! [enhanced-resolve]: https://github.com/webpack/enhanced-resolve -//! [CommonJS Module Resolution Algorithm]: https://nodejs.org/api/modules.html#all-together -//! [ECMAScript Module Resolution Algorithm]: https://nodejs.org/api/esm.html#resolution-algorithm-specification -//! [parcel-resolver]: https://github.com/parcel-bundler/parcel/blob/v2/packages/utils/node-resolver-rs -//! [cjs]: https://nodejs.org/api/modules.html -//! [esm]: https://nodejs.org/api/esm.html -//! -//! ## Feature flags -#![cfg_attr(feature = "document-features", doc = document_features::document_features!())] -#![cfg_attr(docsrs, feature(doc_auto_cfg))] -//! -//! ## Example -//! -//! ```rust,ignore -#![doc = include_str!("../examples/resolver.rs")] -//! ``` - -mod builtins; -mod cache; -mod context; -mod error; -mod file_system; -mod options; -mod package_json; -mod path; -mod resolution; -mod specifier; -mod tsconfig; - -#[cfg(test)] -mod tests; - -use std::{ - borrow::Cow, - cmp::Ordering, - ffi::OsStr, - fmt, - path::{Component, Path, PathBuf}, - sync::Arc, -}; - -use rustc_hash::FxHashSet; -use serde_json::Value as JSONValue; - -pub use crate::{ - builtins::NODEJS_BUILTINS, - error::{JSONError, ResolveError, SpecifierError}, - file_system::{FileMetadata, FileSystem}, - options::{ - Alias, AliasValue, EnforceExtension, ResolveOptions, Restriction, TsconfigOptions, - TsconfigReferences, - }, - package_json::PackageJson, - resolution::Resolution, -}; -use crate::{ - cache::{Cache, CachedPath}, - context::ResolveContext as Ctx, - file_system::FileSystemOs, - package_json::JSONMap, - path::{PathUtil, SLASH_START}, - specifier::Specifier, - tsconfig::ExtendsField, - tsconfig::{ProjectReference, TsConfig}, -}; - -type ResolveResult = Result, ResolveError>; - -/// Context returned from the [Resolver::resolve_with_context] API -#[derive(Debug, Default, Clone)] -pub struct ResolveContext { - /// Files that was found on file system - pub file_dependencies: FxHashSet, - - /// Dependencies that was not found on file system - pub missing_dependencies: FxHashSet, -} - -/// Resolver with the current operating system as the file system -pub type Resolver = ResolverGeneric; - -/// Generic implementation of the resolver, can be configured by the [FileSystem] trait -pub struct ResolverGeneric { - options: ResolveOptions, - cache: Arc>, -} - -impl fmt::Debug for ResolverGeneric { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - self.options.fmt(f) - } -} - -impl Default for ResolverGeneric { - fn default() -> Self { - Self::new(ResolveOptions::default()) - } -} - -impl ResolverGeneric { - pub fn new(options: ResolveOptions) -> Self { - Self { options: options.sanitize(), cache: Arc::new(Cache::new(Fs::default())) } - } -} - -impl ResolverGeneric { - pub fn new_with_file_system(file_system: Fs, options: ResolveOptions) -> Self { - Self { cache: Arc::new(Cache::new(file_system)), options: options.sanitize() } - } - - /// Clone the resolver using the same underlying cache. - #[must_use] - pub fn clone_with_options(&self, options: ResolveOptions) -> Self { - Self { options: options.sanitize(), cache: Arc::clone(&self.cache) } - } - - /// Returns the options. - pub fn options(&self) -> &ResolveOptions { - &self.options - } - - /// Clear the underlying cache. - pub fn clear_cache(&self) { - self.cache.clear(); - } - - /// Resolve `specifier` at an absolute path to a `directory`. - /// - /// A specifier is the string passed to require or import, i.e. `require("specifier")` or `import "specifier"`. - /// - /// `directory` must be an **absolute** path to a directory where the specifier is resolved against. - /// For CommonJS modules, it is the `__dirname` variable that contains the absolute path to the folder containing current module. - /// For ECMAScript modules, it is the value of `import.meta.url`. - /// - /// # Errors - /// - /// * See [ResolveError] - pub fn resolve>( - &self, - directory: P, - specifier: &str, - ) -> Result { - let mut ctx = Ctx::default(); - self.resolve_tracing(directory.as_ref(), specifier, &mut ctx) - } - - /// Resolve `specifier` at absolute `path` with [ResolveContext] - /// - /// # Errors - /// - /// * See [ResolveError] - pub fn resolve_with_context>( - &self, - directory: P, - specifier: &str, - resolve_context: &mut ResolveContext, - ) -> Result { - let mut ctx = Ctx::default(); - ctx.init_file_dependencies(); - let result = self.resolve_tracing(directory.as_ref(), specifier, &mut ctx); - if let Some(deps) = &mut ctx.file_dependencies { - resolve_context.file_dependencies.extend(deps.drain(..)); - } - if let Some(deps) = &mut ctx.missing_dependencies { - resolve_context.missing_dependencies.extend(deps.drain(..)); - } - result - } - - /// Wrap `resolve_impl` with `tracing` information - fn resolve_tracing( - &self, - directory: &Path, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - let span = tracing::debug_span!("resolve", path = ?directory, specifier = specifier); - let _enter = span.enter(); - let r = self.resolve_impl(directory, specifier, ctx); - match &r { - Ok(r) => { - tracing::debug!(options = ?self.options, path = ?directory, specifier = specifier, ret = ?r.path); - } - Err(err) => { - tracing::debug!(options = ?self.options, path = ?directory, specifier = specifier, err = ?err); - } - }; - r - } - - fn resolve_impl( - &self, - path: &Path, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - ctx.with_fully_specified(self.options.fully_specified); - let cached_path = self.cache.value(path); - let cached_path = self.require(&cached_path, specifier, ctx)?; - let path = self.load_realpath(&cached_path)?; - // enhanced-resolve: restrictions - self.check_restrictions(&path)?; - let package_json = cached_path.find_package_json(&self.cache.fs, &self.options, ctx)?; - if let Some(package_json) = &package_json { - // path must be inside the package. - debug_assert!(path.starts_with(package_json.directory())); - } - Ok(Resolution { - path, - query: ctx.query.take(), - fragment: ctx.fragment.take(), - package_json, - }) - } - - /// require(X) from module at path Y - /// - /// X: specifier - /// Y: path - /// - /// - fn require( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - ctx.test_for_infinite_recursion()?; - - // enhanced-resolve: parse - let (parsed, try_fragment_as_path) = self.load_parse(cached_path, specifier, ctx)?; - if let Some(path) = try_fragment_as_path { - return Ok(path); - } - - self.require_without_parse(cached_path, parsed.path(), ctx) - } - - fn require_without_parse( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - // tsconfig-paths - if let Some(path) = self.load_tsconfig_paths(cached_path, specifier, &mut Ctx::default())? { - return Ok(path); - } - - // enhanced-resolve: try alias - if let Some(path) = self.load_alias(cached_path, specifier, &self.options.alias, ctx)? { - return Ok(path); - } - - let result = match Path::new(specifier).components().next() { - // 2. If X begins with '/' - Some(Component::RootDir | Component::Prefix(_)) => { - self.require_absolute(cached_path, specifier, ctx) - } - // 3. If X begins with './' or '/' or '../' - Some(Component::CurDir | Component::ParentDir) => { - self.require_relative(cached_path, specifier, ctx) - } - // 4. If X begins with '#' - Some(Component::Normal(_)) if specifier.as_bytes()[0] == b'#' => { - self.require_hash(cached_path, specifier, ctx) - } - _ => { - // 1. If X is a core module, - // a. return the core module - // b. STOP - self.require_core(specifier)?; - - // (ESM) 5. Otherwise, - // Note: specifier is now a bare specifier. - // Set resolved the result of PACKAGE_RESOLVE(specifier, parentURL). - self.require_bare(cached_path, specifier, ctx) - } - }; - - result.or_else(|err| { - if err.is_ignore() { - return Err(err); - } - // enhanced-resolve: try fallback - self.load_alias(cached_path, specifier, &self.options.fallback, ctx) - .and_then(|value| value.ok_or(err)) - }) - } - - // PACKAGE_RESOLVE(packageSpecifier, parentURL) - // 3. If packageSpecifier is a Node.js builtin module name, then - // 1. Return the string "node:" concatenated with packageSpecifier. - fn require_core(&self, specifier: &str) -> Result<(), ResolveError> { - if self.options.builtin_modules { - let starts_with_node = specifier.starts_with("node:"); - if starts_with_node || NODEJS_BUILTINS.binary_search(&specifier).is_ok() { - let mut specifier = specifier.to_string(); - if !starts_with_node { - specifier = format!("node:{specifier}"); - } - return Err(ResolveError::Builtin(specifier)); - } - } - Ok(()) - } - - fn require_absolute( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - // Make sure only path prefixes gets called - debug_assert!(Path::new(specifier) - .components() - .next() - .is_some_and(|c| matches!(c, Component::RootDir | Component::Prefix(_)))); - if !self.options.prefer_relative && self.options.prefer_absolute { - if let Ok(path) = self.load_package_self_or_node_modules(cached_path, specifier, ctx) { - return Ok(path); - } - } - if let Some(path) = self.load_roots(specifier, ctx) { - return Ok(path); - } - // 2. If X begins with '/' - // a. set Y to be the file system root - let path = self.cache.value(Path::new(specifier)); - if let Some(path) = self.load_as_file_or_directory(&path, specifier, ctx)? { - return Ok(path); - } - Err(ResolveError::NotFound(specifier.to_string())) - } - - // 3. If X begins with './' or '/' or '../' - fn require_relative( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - // Make sure only relative or normal paths gets called - debug_assert!(Path::new(specifier).components().next().is_some_and(|c| matches!( - c, - Component::CurDir | Component::ParentDir | Component::Normal(_) - ))); - let path = cached_path.path().normalize_with(specifier); - let cached_path = self.cache.value(&path); - // a. LOAD_AS_FILE(Y + X) - // b. LOAD_AS_DIRECTORY(Y + X) - if let Some(path) = self.load_as_file_or_directory(&cached_path, specifier, ctx)? { - return Ok(path); - } - // c. THROW "not found" - Err(ResolveError::NotFound(specifier.to_string())) - } - - fn require_hash( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - debug_assert_eq!(specifier.chars().next(), Some('#')); - // a. LOAD_PACKAGE_IMPORTS(X, dirname(Y)) - if let Some(path) = self.load_package_imports(cached_path, specifier, ctx)? { - return Ok(path); - } - self.load_package_self_or_node_modules(cached_path, specifier, ctx) - } - - fn require_bare( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - // Make sure no other path prefixes gets called - debug_assert!(Path::new(specifier) - .components() - .next() - .is_some_and(|c| matches!(c, Component::Normal(_)))); - if self.options.prefer_relative { - if let Ok(path) = self.require_relative(cached_path, specifier, ctx) { - return Ok(path); - } - } - self.load_package_self_or_node_modules(cached_path, specifier, ctx) - } - - /// enhanced-resolve: ParsePlugin. - /// - /// 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`. - /// - /// - fn load_parse<'s>( - &self, - cached_path: &CachedPath, - specifier: &'s str, - ctx: &mut Ctx, - ) -> Result<(Specifier<'s>, Option), ResolveError> { - let parsed = Specifier::parse(specifier).map_err(ResolveError::Specifier)?; - ctx.with_query_fragment(parsed.query, parsed.fragment); - - // There is an edge-case where a request with # can be a path or a fragment -> try both - if ctx.fragment.is_some() && ctx.query.is_none() { - let specifier = parsed.path(); - let fragment = ctx.fragment.take().unwrap(); - let path = format!("{specifier}{fragment}"); - if let Ok(path) = self.require_without_parse(cached_path, &path, ctx) { - return Ok((parsed, Some(path))); - } - ctx.fragment.replace(fragment); - } - Ok((parsed, None)) - } - - fn load_package_self_or_node_modules( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - let (_, subpath) = Self::parse_package_specifier(specifier); - if subpath.is_empty() { - ctx.with_fully_specified(false); - } - // 5. LOAD_PACKAGE_SELF(X, dirname(Y)) - if let Some(path) = self.load_package_self(cached_path, specifier, ctx)? { - return Ok(path); - } - // 6. LOAD_NODE_MODULES(X, dirname(Y)) - if let Some(path) = self.load_node_modules(cached_path, specifier, ctx)? { - return Ok(path); - } - // 7. THROW "not found" - Err(ResolveError::NotFound(specifier.to_string())) - } - - /// LOAD_PACKAGE_IMPORTS(X, DIR) - fn load_package_imports( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - // 1. Find the closest package scope SCOPE to DIR. - // 2. If no scope was found, return. - let Some(package_json) = - cached_path.find_package_json(&self.cache.fs, &self.options, ctx)? - else { - return Ok(None); - }; - // 3. If the SCOPE/package.json "imports" is null or undefined, return. - // 4. let MATCH = PACKAGE_IMPORTS_RESOLVE(X, pathToFileURL(SCOPE), ["node", "require"]) defined in the ESM resolver. - if let Some(path) = self.package_imports_resolve(specifier, &package_json, ctx)? { - // 5. RESOLVE_ESM_MATCH(MATCH). - return self.resolve_esm_match(specifier, &path, ctx); - } - Ok(None) - } - - fn load_as_file(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - // enhanced-resolve feature: extension_alias - if let Some(path) = self.load_extension_alias(cached_path, ctx)? { - return Ok(Some(path)); - } - if self.options.enforce_extension.is_disabled() { - // 1. If X is a file, load X as its file extension format. STOP - if let Some(path) = self.load_alias_or_file(cached_path, ctx)? { - return Ok(Some(path)); - } - } - // 2. If X.js is a file, load X.js as JavaScript text. STOP - // 3. If X.json is a file, parse X.json to a JavaScript Object. STOP - // 4. If X.node is a file, load X.node as binary addon. STOP - if let Some(path) = - self.load_extensions(cached_path.path(), &self.options.extensions, ctx)? - { - return Ok(Some(path)); - } - Ok(None) - } - - fn load_as_directory(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - // TODO: Only package.json is supported, so warn about having other values - // Checking for empty files is needed for omitting checks on package.json - // 1. If X/package.json is a file, - if !self.options.description_files.is_empty() { - // a. Parse X/package.json, and look for "main" field. - if let Some(package_json) = - cached_path.package_json(&self.cache.fs, &self.options, ctx)? - { - // b. If "main" is a falsy value, GOTO 2. - for main_field in package_json.main_fields(&self.options.main_fields) { - // c. let M = X + (json main field) - let main_field_path = cached_path.path().normalize_with(main_field); - // d. LOAD_AS_FILE(M) - let cached_path = self.cache.value(&main_field_path); - if let Some(path) = self.load_as_file(&cached_path, ctx)? { - return Ok(Some(path)); - } - // e. LOAD_INDEX(M) - if let Some(path) = self.load_index(&cached_path, ctx)? { - return Ok(Some(path)); - } - } - // f. LOAD_INDEX(X) DEPRECATED - // g. THROW "not found" - } - } - // 2. LOAD_INDEX(X) - self.load_index(cached_path, ctx) - } - - fn load_as_file_or_directory( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - if self.options.resolve_to_context { - return Ok(cached_path.is_dir(&self.cache.fs, ctx).then(|| cached_path.clone())); - } - if !specifier.ends_with('/') { - if let Some(path) = self.load_as_file(cached_path, ctx)? { - return Ok(Some(path)); - } - } - if cached_path.is_dir(&self.cache.fs, ctx) { - if let Some(path) = self.load_as_directory(cached_path, ctx)? { - return Ok(Some(path)); - } - } - Ok(None) - } - - fn load_extensions(&self, path: &Path, extensions: &[String], ctx: &mut Ctx) -> ResolveResult { - if ctx.fully_specified { - return Ok(None); - } - let path = path.as_os_str(); - for extension in extensions { - let mut path_with_extension = path.to_os_string(); - path_with_extension.reserve_exact(extension.len()); - path_with_extension.push(extension); - let cached_path = self.cache.value(Path::new(&path_with_extension)); - if let Some(path) = self.load_alias_or_file(&cached_path, ctx)? { - return Ok(Some(path)); - } - } - Ok(None) - } - - fn load_realpath(&self, cached_path: &CachedPath) -> Result { - if self.options.symlinks { - cached_path.realpath(&self.cache.fs).map_err(ResolveError::from) - } else { - Ok(cached_path.to_path_buf()) - } - } - - fn check_restrictions(&self, path: &Path) -> Result<(), ResolveError> { - // https://github.com/webpack/enhanced-resolve/blob/a998c7d218b7a9ec2461fc4fddd1ad5dd7687485/lib/RestrictionsPlugin.js#L19-L24 - fn is_inside(path: &Path, parent: &Path) -> bool { - if !path.starts_with(parent) { - return false; - } - if path.as_os_str().len() == parent.as_os_str().len() { - return true; - } - path.strip_prefix(parent).is_ok_and(|p| p == Path::new("./")) - } - for restriction in &self.options.restrictions { - match restriction { - Restriction::Path(restricted_path) => { - if !is_inside(path, restricted_path) { - return Err(ResolveError::Restriction( - path.to_path_buf(), - restricted_path.clone(), - )); - } - } - Restriction::RegExp(_) => { - return Err(ResolveError::Unimplemented("Restriction with regex")) - } - } - } - Ok(()) - } - - fn load_index(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - for main_file in &self.options.main_files { - let main_path = cached_path.path().normalize_with(main_file); - let cached_path = self.cache.value(&main_path); - if self.options.enforce_extension.is_disabled() { - if let Some(path) = self.load_alias_or_file(&cached_path, ctx)? { - return Ok(Some(path)); - } - } - // 1. If X/index.js is a file, load X/index.js as JavaScript text. STOP - // 2. If X/index.json is a file, parse X/index.json to a JavaScript object. STOP - // 3. If X/index.node is a file, load X/index.node as binary addon. STOP - if let Some(path) = - self.load_extensions(cached_path.path(), &self.options.extensions, ctx)? - { - return Ok(Some(path)); - } - } - Ok(None) - } - - fn load_alias_or_file(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - if !self.options.alias_fields.is_empty() { - if let Some(package_json) = - cached_path.find_package_json(&self.cache.fs, &self.options, ctx)? - { - if let Some(path) = - self.load_browser_field(cached_path, None, &package_json, ctx)? - { - return Ok(Some(path)); - } - } - } - // enhanced-resolve: try file as alias - let alias_specifier = cached_path.path().to_string_lossy(); - if let Some(path) = - self.load_alias(cached_path, &alias_specifier, &self.options.alias, ctx)? - { - return Ok(Some(path)); - } - if cached_path.is_file(&self.cache.fs, ctx) { - return Ok(Some(cached_path.clone())); - } - Ok(None) - } - - fn load_node_modules( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - let (package_name, subpath) = Self::parse_package_specifier(specifier); - // 1. let DIRS = NODE_MODULES_PATHS(START) - // 2. for each DIR in DIRS: - for module_name in &self.options.modules { - for cached_path in std::iter::successors(Some(cached_path), |p| p.parent()) { - // Skip if /path/to/node_modules does not exist - if !cached_path.is_dir(&self.cache.fs, ctx) { - continue; - } - - let Some(cached_path) = self.get_module_directory(cached_path, module_name, ctx) - else { - continue; - }; - // Optimize node_modules lookup by inspecting whether the package exists - // From LOAD_PACKAGE_EXPORTS(X, DIR) - // 1. Try to interpret X as a combination of NAME and SUBPATH where the name - // may have a @scope/ prefix and the subpath begins with a slash (`/`). - if !package_name.is_empty() { - let package_path = cached_path.path().normalize_with(package_name); - let cached_path = self.cache.value(&package_path); - // Try foo/node_modules/package_name - if cached_path.is_dir(&self.cache.fs, ctx) { - // a. LOAD_PACKAGE_EXPORTS(X, DIR) - if let Some(path) = - self.load_package_exports(specifier, subpath, &cached_path, ctx)? - { - return Ok(Some(path)); - } - } else { - // foo/node_modules/package_name is not a directory, so useless to check inside it - if !subpath.is_empty() { - continue; - } - // Skip if the directory lead to the scope package does not exist - // i.e. `foo/node_modules/@scope` is not a directory for `foo/node_modules/@scope/package` - if package_name.starts_with('@') { - if let Some(path) = cached_path.parent() { - if !path.is_dir(&self.cache.fs, ctx) { - continue; - } - } - } - } - } - - // Try as file or directory for all other cases - // b. LOAD_AS_FILE(DIR/X) - // c. LOAD_AS_DIRECTORY(DIR/X) - let node_module_file = cached_path.path().normalize_with(specifier); - let cached_path = self.cache.value(&node_module_file); - if let Some(path) = self.load_as_file_or_directory(&cached_path, specifier, ctx)? { - return Ok(Some(path)); - } - } - } - Ok(None) - } - - fn get_module_directory( - &self, - cached_path: &CachedPath, - module_name: &str, - ctx: &mut Ctx, - ) -> Option { - if module_name == "node_modules" { - cached_path.cached_node_modules(&self.cache, ctx) - } else if cached_path.path().components().next_back() - == Some(Component::Normal(OsStr::new(module_name))) - { - Some(cached_path.clone()) - } else { - cached_path.module_directory(module_name, &self.cache, ctx) - } - } - - fn load_package_exports( - &self, - specifier: &str, - subpath: &str, - cached_path: &CachedPath, - ctx: &mut Ctx, - ) -> ResolveResult { - // 2. If X does not match this pattern or DIR/NAME/package.json is not a file, - // return. - let Some(package_json) = cached_path.package_json(&self.cache.fs, &self.options, ctx)? - else { - return Ok(None); - }; - // 3. Parse DIR/NAME/package.json, and look for "exports" field. - // 4. If "exports" is null or undefined, return. - // 5. let MATCH = PACKAGE_EXPORTS_RESOLVE(pathToFileURL(DIR/NAME), "." + SUBPATH, - // `package.json` "exports", ["node", "require"]) defined in the ESM resolver. - // Note: The subpath is not prepended with a dot on purpose - for exports in package_json.exports_fields(&self.options.exports_fields) { - if let Some(path) = self.package_exports_resolve( - cached_path.path(), - &format!(".{subpath}"), - exports, - ctx, - )? { - // 6. RESOLVE_ESM_MATCH(MATCH) - return self.resolve_esm_match(specifier, &path, ctx); - }; - } - Ok(None) - } - - fn load_package_self( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - // 1. Find the closest package scope SCOPE to DIR. - // 2. If no scope was found, return. - let Some(package_json) = - cached_path.find_package_json(&self.cache.fs, &self.options, ctx)? - else { - return Ok(None); - }; - // 3. If the SCOPE/package.json "exports" is null or undefined, return. - // 4. If the SCOPE/package.json "name" is not the first segment of X, return. - if let Some(subpath) = package_json - .name - .as_ref() - .and_then(|package_name| Self::strip_package_name(specifier, package_name)) - { - // 5. let MATCH = PACKAGE_EXPORTS_RESOLVE(pathToFileURL(SCOPE), - // "." + X.slice("name".length), `package.json` "exports", ["node", "require"]) - // defined in the ESM resolver. - let package_url = package_json.directory(); - // Note: The subpath is not prepended with a dot on purpose - // because `package_exports_resolve` matches subpath without the leading dot. - for exports in package_json.exports_fields(&self.options.exports_fields) { - if let Some(cached_path) = - self.package_exports_resolve(package_url, &format!(".{subpath}"), exports, ctx)? - { - // 6. RESOLVE_ESM_MATCH(MATCH) - return self.resolve_esm_match(specifier, &cached_path, ctx); - } - } - } - self.load_browser_field(cached_path, Some(specifier), &package_json, ctx) - } - - /// RESOLVE_ESM_MATCH(MATCH) - fn resolve_esm_match( - &self, - specifier: &str, - cached_path: &CachedPath, - ctx: &mut Ctx, - ) -> ResolveResult { - // 1. let RESOLVED_PATH = fileURLToPath(MATCH) - // 2. If the file at RESOLVED_PATH exists, load RESOLVED_PATH as its extension format. STOP - // - // Non-compliant ESM can result in a directory, so directory is tried as well. - if let Some(path) = self.load_as_file_or_directory(cached_path, "", ctx)? { - return Ok(Some(path)); - } - // 3. THROW "not found" - Err(ResolveError::NotFound(specifier.to_string())) - } - - /// enhanced-resolve: AliasFieldPlugin for [ResolveOptions::alias_fields] - fn load_browser_field( - &self, - cached_path: &CachedPath, - module_specifier: Option<&str>, - package_json: &PackageJson, - ctx: &mut Ctx, - ) -> ResolveResult { - let path = cached_path.path(); - let Some(new_specifier) = package_json.resolve_browser_field( - path, - module_specifier, - &self.options.alias_fields, - )? - else { - return Ok(None); - }; - // Abort when resolving recursive module - if module_specifier.is_some_and(|s| s == new_specifier) { - return Ok(None); - } - if ctx.resolving_alias.as_ref().is_some_and(|s| s == new_specifier) { - // Complete when resolving to self `{"./a.js": "./a.js"}` - if new_specifier.strip_prefix("./").filter(|s| path.ends_with(Path::new(s))).is_some() { - return if cached_path.is_file(&self.cache.fs, ctx) { - Ok(Some(cached_path.clone())) - } else { - Err(ResolveError::NotFound(new_specifier.to_string())) - }; - } - return Err(ResolveError::Recursion); - } - ctx.with_resolving_alias(new_specifier.to_string()); - ctx.with_fully_specified(false); - let cached_path = self.cache.value(package_json.directory()); - self.require(&cached_path, new_specifier, ctx).map(Some) - } - - /// enhanced-resolve: AliasPlugin for [ResolveOptions::alias] and [ResolveOptions::fallback]. - fn load_alias( - &self, - cached_path: &CachedPath, - specifier: &str, - aliases: &Alias, - ctx: &mut Ctx, - ) -> ResolveResult { - for (alias_key_raw, specifiers) in aliases { - let alias_key = if let Some(alias_key) = alias_key_raw.strip_suffix('$') { - if alias_key != specifier { - continue; - } - alias_key - } else { - let strip_package_name = Self::strip_package_name(specifier, alias_key_raw); - if strip_package_name.is_none() { - continue; - } - alias_key_raw - }; - // It should stop resolving when all of the tried alias values - // failed to resolve. - // - let mut should_stop = false; - for r in specifiers { - match r { - AliasValue::Path(alias_value) => { - if let Some(path) = self.load_alias_value( - cached_path, - alias_key, - alias_value, - specifier, - ctx, - &mut should_stop, - )? { - return Ok(Some(path)); - } - } - AliasValue::Ignore => { - let path = cached_path.path().normalize_with(alias_key); - return Err(ResolveError::Ignored(path)); - } - } - } - if should_stop { - return Err(ResolveError::NotFound(specifier.to_string())); - } - } - Ok(None) - } - - fn load_alias_value( - &self, - cached_path: &CachedPath, - alias_key: &str, - alias_value: &str, - request: &str, - ctx: &mut Ctx, - should_stop: &mut bool, - ) -> ResolveResult { - if request != alias_value - && !request.strip_prefix(alias_value).is_some_and(|prefix| prefix.starts_with('/')) - { - let tail = &request[alias_key.len()..]; - - let new_specifier = if tail.is_empty() { - Cow::Borrowed(alias_value) - } else { - let alias_value = Path::new(alias_value).normalize(); - // Must not append anything to alias_value if it is a file. - let alias_value_cached_path = self.cache.value(&alias_value); - if alias_value_cached_path.is_file(&self.cache.fs, ctx) { - return Ok(None); - } - - // Remove the leading slash so the final path is concatenated. - let tail = tail.trim_start_matches(SLASH_START); - let normalized = alias_value.normalize_with(tail); - Cow::Owned(normalized.to_string_lossy().to_string()) - }; - - *should_stop = true; - ctx.with_fully_specified(false); - return match self.require(cached_path, new_specifier.as_ref(), ctx) { - Err(ResolveError::NotFound(_)) => Ok(None), - Ok(path) => return Ok(Some(path)), - Err(err) => return Err(err), - }; - } - Ok(None) - } - - /// Given an extension alias map `{".js": [".ts", "js"]}`, - /// load the mapping instead of the provided extension - /// - /// This is an enhanced-resolve feature - /// - /// # Errors - /// - /// * [ResolveError::ExtensionAlias]: When all of the aliased extensions are not found - fn load_extension_alias(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - if self.options.extension_alias.is_empty() { - return Ok(None); - } - let Some(path_extension) = cached_path.path().extension() else { - return Ok(None); - }; - let Some((_, extensions)) = self - .options - .extension_alias - .iter() - .find(|(ext, _)| OsStr::new(ext.trim_start_matches('.')) == path_extension) - else { - return Ok(None); - }; - let path = cached_path.path().with_extension(""); - ctx.with_fully_specified(false); - if let Some(path) = self.load_extensions(&path, extensions, ctx)? { - return Ok(Some(path)); - } - Err(ResolveError::ExtensionAlias) - } - - /// enhanced-resolve: RootsPlugin - /// - /// A list of directories where requests of server-relative URLs (starting with '/') are resolved, - /// defaults to context configuration option. - /// - /// On non-Windows systems these requests are resolved as an absolute path first. - fn load_roots(&self, specifier: &str, ctx: &mut Ctx) -> Option { - if self.options.roots.is_empty() { - return None; - } - if let Some(specifier) = specifier.strip_prefix(SLASH_START) { - for root in &self.options.roots { - let cached_path = self.cache.value(root); - if let Ok(path) = self.require_relative(&cached_path, specifier, ctx) { - return Some(path); - } - } - } - None - } - - fn load_tsconfig_paths( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - let Some(tsconfig_options) = &self.options.tsconfig else { - return Ok(None); - }; - let tsconfig = self.load_tsconfig( - /* root */ true, - &tsconfig_options.config_file, - &tsconfig_options.references, - )?; - let paths = tsconfig.resolve(cached_path.path(), specifier); - for path in paths { - let cached_path = self.cache.value(&path); - if let Ok(path) = self.require_relative(&cached_path, ".", ctx) { - return Ok(Some(path)); - } - } - Ok(None) - } - - fn load_tsconfig( - &self, - root: bool, - path: &Path, - references: &TsconfigReferences, - ) -> Result, ResolveError> { - self.cache.tsconfig(root, path, |tsconfig| { - let directory = self.cache.value(tsconfig.directory()); - tracing::trace!(tsconfig = ?tsconfig, "load_tsconfig"); - - // Extend tsconfig - if let Some(extends) = &tsconfig.extends { - let extended_tsconfig_paths = match extends { - ExtendsField::Single(s) => { - vec![self.get_extended_tsconfig_path(&directory, tsconfig, s)?] - } - ExtendsField::Multiple(specifiers) => specifiers - .iter() - .map(|s| self.get_extended_tsconfig_path(&directory, tsconfig, s)) - .collect::, ResolveError>>()?, - }; - for extended_tsconfig_path in extended_tsconfig_paths { - let extended_tsconfig = self.load_tsconfig( - /* root */ false, - &extended_tsconfig_path, - &TsconfigReferences::Disabled, - )?; - tsconfig.extend_tsconfig(&extended_tsconfig); - } - } - - // Load project references - match references { - TsconfigReferences::Disabled => { - tsconfig.references.drain(..); - } - TsconfigReferences::Auto => {} - TsconfigReferences::Paths(paths) => { - tsconfig.references = paths - .iter() - .map(|path| ProjectReference { path: path.clone(), tsconfig: None }) - .collect(); - } - } - if !tsconfig.references.is_empty() { - let directory = tsconfig.directory().to_path_buf(); - for reference in &mut tsconfig.references { - let reference_tsconfig_path = directory.normalize_with(&reference.path); - let tsconfig = self.cache.tsconfig( - /* root */ true, - &reference_tsconfig_path, - |_| Ok(()), - )?; - reference.tsconfig.replace(tsconfig); - } - } - Ok(()) - }) - } - - fn get_extended_tsconfig_path( - &self, - directory: &CachedPath, - tsconfig: &TsConfig, - specifier: &str, - ) -> Result { - match specifier.as_bytes().first() { - None => Err(ResolveError::Specifier(SpecifierError::Empty(specifier.to_string()))), - Some(b'/') => Ok(PathBuf::from(specifier)), - Some(b'.') => Ok(tsconfig.directory().normalize_with(specifier)), - _ => self - .clone_with_options(ResolveOptions { - description_files: vec![], - extensions: vec![".json".into()], - main_files: vec!["tsconfig.json".into()], - ..ResolveOptions::default() - }) - .load_package_self_or_node_modules(directory, specifier, &mut Ctx::default()) - .map(|p| p.to_path_buf()) - .map_err(|err| match err { - ResolveError::NotFound(_) => { - ResolveError::TsconfigNotFound(PathBuf::from(specifier)) - } - _ => err, - }), - } - } - - /// PACKAGE_RESOLVE(packageSpecifier, parentURL) - fn package_resolve( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - let (package_name, subpath) = Self::parse_package_specifier(specifier); - - // 3. If packageSpecifier is a Node.js builtin module name, then - // 1. Return the string "node:" concatenated with packageSpecifier. - self.require_core(package_name)?; - - // 11. While parentURL is not the file system root, - for module_name in &self.options.modules { - for cached_path in std::iter::successors(Some(cached_path), |p| p.parent()) { - // 1. Let packageURL be the URL resolution of "node_modules/" concatenated with packageSpecifier, relative to parentURL. - let Some(cached_path) = self.get_module_directory(cached_path, module_name, ctx) - else { - continue; - }; - // 2. Set parentURL to the parent folder URL of parentURL. - let package_path = cached_path.path().normalize_with(package_name); - let cached_path = self.cache.value(&package_path); - // 3. If the folder at packageURL does not exist, then - // 1. Continue the next loop iteration. - if cached_path.is_dir(&self.cache.fs, ctx) { - // 4. Let pjson be the result of READ_PACKAGE_JSON(packageURL). - if let Some(package_json) = - cached_path.package_json(&self.cache.fs, &self.options, ctx)? - { - // 5. If pjson is not null and pjson.exports is not null or undefined, then - // 1. Return the result of PACKAGE_EXPORTS_RESOLVE(packageURL, packageSubpath, pjson.exports, defaultConditions). - for exports in package_json.exports_fields(&self.options.exports_fields) { - if let Some(path) = self.package_exports_resolve( - cached_path.path(), - &format!(".{subpath}"), - exports, - ctx, - )? { - return Ok(Some(path)); - } - } - // 6. Otherwise, if packageSubpath is equal to ".", then - if subpath == "." { - // 1. If pjson.main is a string, then - for main_field in package_json.main_fields(&self.options.main_fields) { - // 1. Return the URL resolution of main in packageURL. - let path = cached_path.path().normalize_with(main_field); - let cached_path = self.cache.value(&path); - if cached_path.is_file(&self.cache.fs, ctx) { - return Ok(Some(cached_path)); - } - } - } - } - let subpath = format!(".{subpath}"); - ctx.with_fully_specified(false); - return self.require(&cached_path, &subpath, ctx).map(Some); - } - } - } - - Err(ResolveError::NotFound(specifier.to_string())) - } - - /// PACKAGE_EXPORTS_RESOLVE(packageURL, subpath, exports, conditions) - fn package_exports_resolve( - &self, - package_url: &Path, - subpath: &str, - exports: &JSONValue, - ctx: &mut Ctx, - ) -> ResolveResult { - let conditions = &self.options.condition_names; - // 1. If exports is an Object with both a key starting with "." and a key not starting with ".", throw an Invalid Package Configuration error. - if let JSONValue::Object(map) = exports { - let mut has_dot = false; - let mut without_dot = false; - for key in map.keys() { - has_dot = has_dot || key.starts_with(|s| s == '.' || s == '#'); - without_dot = without_dot || !key.starts_with(|s| s == '.' || s == '#'); - if has_dot && without_dot { - return Err(ResolveError::InvalidPackageConfig( - package_url.join("package.json"), - )); - } - } - } - // 2. If subpath is equal to ".", then - // Note: subpath is not prepended with a dot when passed in. - if subpath == "." { - // enhanced-resolve appends query and fragment when resolving exports field - // https://github.com/webpack/enhanced-resolve/blob/a998c7d218b7a9ec2461fc4fddd1ad5dd7687485/lib/ExportsFieldPlugin.js#L57-L62 - // This is only need when querying the main export, otherwise ctx is passed through. - if ctx.query.is_some() || ctx.fragment.is_some() { - let query = ctx.query.clone().unwrap_or_default(); - let fragment = ctx.fragment.clone().unwrap_or_default(); - return Err(ResolveError::PackagePathNotExported( - format!("./{}{query}{fragment}", subpath.trim_start_matches('.')), - package_url.join("package.json"), - )); - } - // 1. Let mainExport be undefined. - let main_export = match exports { - // 2. If exports is a String or Array, or an Object containing no keys starting with ".", then - JSONValue::String(_) | JSONValue::Array(_) => { - // 1. Set mainExport to exports. - Some(exports) - } - // 3. Otherwise if exports is an Object containing a "." property, then - JSONValue::Object(map) => { - // 1. Set mainExport to exports["."]. - map.get(".").map_or_else( - || { - if map.keys().any(|key| key.starts_with("./") || key.starts_with('#')) { - None - } else { - Some(exports) - } - }, - Some, - ) - } - _ => None, - }; - // 4. If mainExport is not undefined, then - if let Some(main_export) = main_export { - // 1. Let resolved be the result of PACKAGE_TARGET_RESOLVE( packageURL, mainExport, null, false, conditions). - let resolved = self.package_target_resolve( - package_url, - ".", - main_export, - None, - /* is_imports */ false, - conditions, - ctx, - )?; - // 2. If resolved is not null or undefined, return resolved. - if let Some(path) = resolved { - return Ok(Some(path)); - } - } - } - // 3. Otherwise, if exports is an Object and all keys of exports start with ".", then - if let JSONValue::Object(exports) = exports { - // 1. Let matchKey be the string "./" concatenated with subpath. - // Note: `package_imports_exports_resolve` does not require the leading dot. - let match_key = &subpath; - // 2. Let resolved be the result of PACKAGE_IMPORTS_EXPORTS_RESOLVE( matchKey, exports, packageURL, false, conditions). - if let Some(path) = self.package_imports_exports_resolve( - match_key, - exports, - package_url, - /* is_imports */ false, - conditions, - ctx, - )? { - // 3. If resolved is not null or undefined, return resolved. - return Ok(Some(path)); - } - } - // 4. Throw a Package Path Not Exported error. - Err(ResolveError::PackagePathNotExported( - subpath.to_string(), - package_url.join("package.json"), - )) - } - - /// PACKAGE_IMPORTS_RESOLVE(specifier, parentURL, conditions) - fn package_imports_resolve( - &self, - specifier: &str, - package_json: &PackageJson, - ctx: &mut Ctx, - ) -> Result, ResolveError> { - // 1. Assert: specifier begins with "#". - debug_assert!(specifier.starts_with('#'), "{specifier}"); - // 2. If specifier is exactly equal to "#" or starts with "#/", then - // 1. Throw an Invalid Module Specifier error. - // 3. Let packageURL be the result of LOOKUP_PACKAGE_SCOPE(parentURL). - // 4. If packageURL is not null, then - - // 1. Let pjson be the result of READ_PACKAGE_JSON(packageURL). - // 2. If pjson.imports is a non-null Object, then - - // 1. Let resolved be the result of PACKAGE_IMPORTS_EXPORTS_RESOLVE( specifier, pjson.imports, packageURL, true, conditions). - let mut has_imports = false; - for imports in package_json.imports_fields(&self.options.imports_fields) { - if !has_imports { - has_imports = true; - // TODO: fill in test case for this case - if specifier == "#" || specifier.starts_with("#/") { - return Err(ResolveError::InvalidModuleSpecifier( - specifier.to_string(), - package_json.path.clone(), - )); - } - } - if let Some(path) = self.package_imports_exports_resolve( - specifier, - imports, - package_json.directory(), - /* is_imports */ true, - &self.options.condition_names, - ctx, - )? { - // 2. If resolved is not null or undefined, return resolved. - return Ok(Some(path)); - } - } - - // 5. Throw a Package Import Not Defined error. - if has_imports { - Err(ResolveError::PackageImportNotDefined( - specifier.to_string(), - package_json.path.clone(), - )) - } else { - Ok(None) - } - } - - /// PACKAGE_IMPORTS_EXPORTS_RESOLVE(matchKey, matchObj, packageURL, isImports, conditions) - fn package_imports_exports_resolve( - &self, - match_key: &str, - match_obj: &JSONMap, - package_url: &Path, - is_imports: bool, - conditions: &[String], - ctx: &mut Ctx, - ) -> ResolveResult { - // enhanced-resolve behaves differently, it throws - // Error: CachedPath to directories is not possible with the exports field (specifier was ./dist/) - if match_key.ends_with('/') { - return Ok(None); - } - // 1. If matchKey is a key of matchObj and does not contain "*", then - if !match_key.contains('*') { - // 1. Let target be the value of matchObj[matchKey]. - if let Some(target) = match_obj.get(match_key) { - // 2. Return the result of PACKAGE_TARGET_RESOLVE(packageURL, target, null, isImports, conditions). - return self.package_target_resolve( - package_url, - match_key, - target, - None, - is_imports, - conditions, - ctx, - ); - } - } - - let mut best_target = None; - let mut best_match = ""; - let mut best_key = ""; - // 2. Let expansionKeys be the list of keys of matchObj containing only a single "*", sorted by the sorting function PATTERN_KEY_COMPARE which orders in descending order of specificity. - // 3. For each key expansionKey in expansionKeys, do - for (expansion_key, target) in match_obj { - if expansion_key.starts_with("./") || expansion_key.starts_with('#') { - // 1. Let patternBase be the substring of expansionKey up to but excluding the first "*" character. - if let Some((pattern_base, pattern_trailer)) = expansion_key.split_once('*') { - // 2. If matchKey starts with but is not equal to patternBase, then - if match_key.starts_with(pattern_base) - // 1. Let patternTrailer be the substring of expansionKey from the index after the first "*" character. - && !pattern_trailer.contains('*') - // 2. If patternTrailer has zero length, or if matchKey ends with patternTrailer and the length of matchKey is greater than or equal to the length of expansionKey, then - && (pattern_trailer.is_empty() - || (match_key.len() >= expansion_key.len() - && match_key.ends_with(pattern_trailer))) - && Self::pattern_key_compare(best_key, expansion_key).is_gt() - { - // 1. Let target be the value of matchObj[expansionKey]. - best_target = Some(target); - // 2. Let patternMatch be the substring of matchKey starting at the index of the length of patternBase up to the length of matchKey minus the length of patternTrailer. - best_match = - &match_key[pattern_base.len()..match_key.len() - pattern_trailer.len()]; - best_key = expansion_key; - } - } else if expansion_key.ends_with('/') - && match_key.starts_with(expansion_key) - && Self::pattern_key_compare(best_key, expansion_key).is_gt() - { - // TODO: [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./dist/" in the "exports" field module resolution of the package at xxx/package.json. - best_target = Some(target); - best_match = &match_key[expansion_key.len()..]; - best_key = expansion_key; - } - } - } - if let Some(best_target) = best_target { - // 3. Return the result of PACKAGE_TARGET_RESOLVE(packageURL, target, patternMatch, isImports, conditions). - return self.package_target_resolve( - package_url, - best_key, - best_target, - Some(best_match), - is_imports, - conditions, - ctx, - ); - } - // 4. Return null. - Ok(None) - } - - /// PACKAGE_TARGET_RESOLVE(packageURL, target, patternMatch, isImports, conditions) - #[allow(clippy::too_many_arguments)] - fn package_target_resolve( - &self, - package_url: &Path, - target_key: &str, - target: &JSONValue, - pattern_match: Option<&str>, - is_imports: bool, - conditions: &[String], - ctx: &mut Ctx, - ) -> ResolveResult { - fn normalize_string_target<'a>( - target_key: &'a str, - target: &'a str, - pattern_match: Option<&'a str>, - package_url: &Path, - ) -> Result, ResolveError> { - let target = if let Some(pattern_match) = pattern_match { - if !target_key.contains('*') && !target.contains('*') { - // enhanced-resolve behaviour - // TODO: [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./dist/" in the "exports" field module resolution of the package at xxx/package.json. - if target_key.ends_with('/') && target.ends_with('/') { - Cow::Owned(format!("{target}{pattern_match}")) - } else { - return Err(ResolveError::InvalidPackageConfigDirectory( - package_url.join("package.json"), - )); - } - } else { - Cow::Owned(target.replace('*', pattern_match)) - } - } else { - Cow::Borrowed(target) - }; - Ok(target) - } - - match target { - // 1. If target is a String, then - JSONValue::String(target) => { - // 1. If target does not start with "./", then - if !target.starts_with("./") { - // 1. If isImports is false, or if target starts with "../" or "/", or if target is a valid URL, then - if !is_imports || target.starts_with("../") || target.starts_with('/') { - // 1. Throw an Invalid Package Target error. - return Err(ResolveError::InvalidPackageTarget( - target.to_string(), - target_key.to_string(), - package_url.join("package.json"), - )); - } - // 2. If patternMatch is a String, then - // 1. Return PACKAGE_RESOLVE(target with every instance of "*" replaced by patternMatch, packageURL + "/"). - let target = - normalize_string_target(target_key, target, pattern_match, package_url)?; - let package_url = self.cache.value(package_url); - // // 3. Return PACKAGE_RESOLVE(target, packageURL + "/"). - return self.package_resolve(&package_url, &target, ctx); - } - - // 2. If target split on "/" or "\" contains any "", ".", "..", or "node_modules" segments after the first "." segment, case insensitive and including percent encoded variants, throw an Invalid Package Target error. - // 3. Let resolvedTarget be the URL resolution of the concatenation of packageURL and target. - // 4. Assert: resolvedTarget is contained in packageURL. - // 5. If patternMatch is null, then - let target = - normalize_string_target(target_key, target, pattern_match, package_url)?; - if Path::new(target.as_ref()).is_invalid_exports_target() { - return Err(ResolveError::InvalidPackageTarget( - target.to_string(), - target_key.to_string(), - package_url.join("package.json"), - )); - } - let resolved_target = package_url.normalize_with(target.as_ref()); - // 6. If patternMatch split on "/" or "\" contains any "", ".", "..", or "node_modules" segments, case insensitive and including percent encoded variants, throw an Invalid Module Specifier error. - // 7. Return the URL resolution of resolvedTarget with every instance of "*" replaced with patternMatch. - let value = self.cache.value(&resolved_target); - return Ok(Some(value)); - } - // 2. Otherwise, if target is a non-null Object, then - JSONValue::Object(target) => { - // 1. If exports contains any index property keys, as defined in ECMA-262 6.1.7 Array Index, throw an Invalid Package Configuration error. - // 2. For each property p of target, in object insertion order as, - for (key, target_value) in target { - // 1. If p equals "default" or conditions contains an entry for p, then - if key == "default" || conditions.contains(key) { - // 1. Let targetValue be the value of the p property in target. - // 2. Let resolved be the result of PACKAGE_TARGET_RESOLVE( packageURL, targetValue, patternMatch, isImports, conditions). - let resolved = self.package_target_resolve( - package_url, - target_key, - target_value, - pattern_match, - is_imports, - conditions, - ctx, - ); - // 3. If resolved is equal to undefined, continue the loop. - if let Some(path) = resolved? { - // 4. Return resolved. - return Ok(Some(path)); - } - } - } - // 3. Return undefined. - return Ok(None); - } - // 3. Otherwise, if target is an Array, then - JSONValue::Array(targets) => { - // 1. If _target.length is zero, return null. - if targets.is_empty() { - // Note: return PackagePathNotExported has the same effect as return because there are no matches. - return Err(ResolveError::PackagePathNotExported( - pattern_match.unwrap_or(".").to_string(), - package_url.join("package.json"), - )); - } - // 2. For each item targetValue in target, do - for (i, target_value) in targets.iter().enumerate() { - // 1. Let resolved be the result of PACKAGE_TARGET_RESOLVE( packageURL, targetValue, patternMatch, isImports, conditions), continuing the loop on any Invalid Package Target error. - let resolved = self.package_target_resolve( - package_url, - target_key, - target_value, - pattern_match, - is_imports, - conditions, - ctx, - ); - - if resolved.is_err() && i == targets.len() { - return resolved; - } - - // 2. If resolved is undefined, continue the loop. - if let Ok(Some(path)) = resolved { - // 3. Return resolved. - return Ok(Some(path)); - } - } - // 3. Return or throw the last fallback resolution null return or error. - // Note: see `resolved.is_err() && i == targets.len()` - } - _ => {} - } - // 4. Otherwise, if target is null, return null. - Ok(None) - // 5. Otherwise throw an Invalid Package Target error. - } - - // Returns (module, subpath) - // https://github.com/nodejs/node/blob/8f0f17e1e3b6c4e58ce748e06343c5304062c491/lib/internal/modules/esm/resolve.js#L688 - fn parse_package_specifier(specifier: &str) -> (&str, &str) { - let mut separator_index = specifier.as_bytes().iter().position(|b| *b == b'/'); - // let mut valid_package_name = true; - // let mut is_scoped = false; - if specifier.starts_with('@') { - // is_scoped = true; - if separator_index.is_none() || specifier.is_empty() { - // valid_package_name = false; - } else if let Some(index) = &separator_index { - separator_index = specifier[*index + 1..] - .as_bytes() - .iter() - .position(|b| *b == b'/') - .map(|i| i + *index + 1); - } - } - let package_name = - separator_index.map_or(specifier, |separator_index| &specifier[..separator_index]); - - // TODO: https://github.com/nodejs/node/blob/8f0f17e1e3b6c4e58ce748e06343c5304062c491/lib/internal/modules/esm/resolve.js#L705C1-L714C1 - // Package name cannot have leading . and cannot have percent-encoding or - // \\ separators. - // if (RegExpPrototypeExec(invalidPackageNameRegEx, packageName) !== null) - // validPackageName = false; - - // if (!validPackageName) { - // throw new ERR_INVALID_MODULE_SPECIFIER( - // specifier, 'is not a valid package name', fileURLToPath(base)); - // } - let package_subpath = - separator_index.map_or("", |separator_index| &specifier[separator_index..]); - (package_name, package_subpath) - } - - /// PATTERN_KEY_COMPARE(keyA, keyB) - fn pattern_key_compare(key_a: &str, key_b: &str) -> Ordering { - if key_a.is_empty() { - return Ordering::Greater; - } - // 1. Assert: keyA ends with "/" or contains only a single "*". - debug_assert!(key_a.ends_with('/') || key_a.match_indices('*').count() == 1, "{key_a}"); - // 2. Assert: keyB ends with "/" or contains only a single "*". - debug_assert!(key_b.ends_with('/') || key_b.match_indices('*').count() == 1, "{key_b}"); - // 3. Let baseLengthA be the index of "*" in keyA plus one, if keyA contains "*", or the length of keyA otherwise. - let a_pos = key_a.chars().position(|c| c == '*'); - let base_length_a = a_pos.map_or(key_a.len(), |p| p + 1); - // 4. Let baseLengthB be the index of "*" in keyB plus one, if keyB contains "*", or the length of keyB otherwise. - let b_pos = key_b.chars().position(|c| c == '*'); - let base_length_b = b_pos.map_or(key_b.len(), |p| p + 1); - // 5. If baseLengthA is greater than baseLengthB, return -1. - if base_length_a > base_length_b { - return Ordering::Less; - } - // 6. If baseLengthB is greater than baseLengthA, return 1. - if base_length_b > base_length_a { - return Ordering::Greater; - } - // 7. If keyA does not contain "*", return 1. - if !key_a.contains('*') { - return Ordering::Greater; - } - // 8. If keyB does not contain "*", return -1. - if !key_b.contains('*') { - return Ordering::Less; - } - // 9. If the length of keyA is greater than the length of keyB, return -1. - if key_a.len() > key_b.len() { - return Ordering::Less; - } - // 10. If the length of keyB is greater than the length of keyA, return 1. - if key_b.len() > key_a.len() { - return Ordering::Greater; - } - // 11. Return 0. - Ordering::Equal - } - - fn strip_package_name<'a>(specifier: &'a str, package_name: &'a str) -> Option<&'a str> { - specifier - .strip_prefix(package_name) - .filter(|tail| tail.is_empty() || tail.starts_with(SLASH_START)) - } -} diff --git a/src/options.rs b/src/options.rs deleted file mode 100644 index f473a133..00000000 --- a/src/options.rs +++ /dev/null @@ -1,623 +0,0 @@ -use std::path::Path; -use std::{fmt, path::PathBuf}; - -/// Module Resolution Options -/// -/// Options are directly ported from [enhanced-resolve](https://github.com/webpack/enhanced-resolve#resolver-options). -/// -/// See [webpack resolve](https://webpack.js.org/configuration/resolve/) for information and examples -#[derive(Debug, Clone)] -pub struct ResolveOptions { - /// Path to TypeScript configuration file. - /// - /// Default `None` - pub tsconfig: Option, - - /// Create aliases to import or require certain modules more easily. - /// - /// An alias is used to replace a whole path or part of a path. - /// For example, to alias a commonly used `src/` folders: `vec![("@/src"), vec![AliasValue::Path("/path/to/src")]]` - /// - /// A trailing $ can also be added to the given object's keys to signify an exact match. - /// - /// See [webpack's `resolve.alias` documentation](https://webpack.js.org/configuration/resolve/#resolvealias) for a list of use cases. - pub alias: Alias, - - /// A list of alias fields in description files. - /// - /// Specify a field, such as `browser`, to be parsed according to [this specification](https://github.com/defunctzombie/package-browser-field-spec). - /// Can be a path to json object such as `["path", "to", "exports"]`. - /// - /// Default `[]` - pub alias_fields: Vec>, - - /// Condition names for exports field which defines entry points of a package. - /// - /// The key order in the exports field is significant. During condition matching, earlier entries have higher priority and take precedence over later entries. - /// - /// Default `[]` - pub condition_names: Vec, - - /// The JSON files to use for descriptions. (There was once a `bower.json`.) - /// - /// Default `["package.json"]` - pub description_files: Vec, - - /// Set to [EnforceExtension::Enabled] for [ESM Mandatory file extensions](https://nodejs.org/api/esm.html#mandatory-file-extensions). - /// - /// If `enforce_extension` is set to [EnforceExtension::Enabled], resolution will not allow extension-less files. - /// This means `require('./foo.js')` will resolve, while `require('./foo')` will not. - /// - /// The default value for `enforce_extension` is [EnforceExtension::Auto], which is changed upon initialization. - /// - /// It changes to [EnforceExtension::Enabled] if [ResolveOptions::extensions] contains an empty string; - /// otherwise, this value changes to [EnforceExtension::Disabled]. - /// - /// Explicitly set the value to [EnforceExtension::Disabled] to disable this automatic behavior. - /// - /// For reference, this behavior is aligned with `enhanced-resolve`. See . - pub enforce_extension: EnforceExtension, - - /// A list of exports fields in description files. - /// - /// Can be a path to a JSON object such as `["path", "to", "exports"]`. - /// - /// Default `[["exports"]]`. - pub exports_fields: Vec>, - - /// Fields from `package.json` which are used to provide the internal requests of a package - /// (requests starting with # are considered internal). - /// - /// Can be a path to a JSON object such as `["path", "to", "imports"]`. - /// - /// Default `[["imports"]]`. - pub imports_fields: Vec>, - - /// An object which maps extension to extension aliases. - /// - /// Default `{}` - pub extension_alias: Vec<(String, Vec)>, - - /// Attempt to resolve these extensions in order. - /// - /// If multiple files share the same name but have different extensions, - /// will resolve the one with the extension listed first in the array and skip the rest. - /// - /// All extensions must have a leading dot. - /// - /// Default `[".js", ".json", ".node"]` - pub extensions: Vec, - - /// Redirect module requests when normal resolving fails. - /// - /// Default `[]` - pub fallback: Alias, - - /// 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). - /// - /// See also webpack configuration [resolve.fullySpecified](https://webpack.js.org/configuration/module/#resolvefullyspecified) - /// - /// Default `false` - pub fully_specified: bool, - - /// A list of main fields in description files - /// - /// Default `["main"]`. - pub main_fields: Vec, - - /// The filename to be used while resolving directories. - /// - /// Default `["index"]` - pub main_files: Vec, - - /// A list of directories to resolve modules from, can be absolute path or folder name. - /// - /// Default `["node_modules"]` - pub modules: Vec, - - /// Resolve to a context instead of a file. - /// - /// Default `false` - pub resolve_to_context: bool, - - /// Prefer to resolve module requests as relative requests instead of using modules from node_modules directories. - /// - /// Default `false` - pub prefer_relative: bool, - - /// Prefer to resolve server-relative urls as absolute paths before falling back to resolve in ResolveOptions::roots. - /// - /// Default `false` - pub prefer_absolute: bool, - - /// A list of resolve restrictions to restrict the paths that a request can be resolved on. - /// - /// Default `[]` - pub restrictions: Vec, - - /// A list of directories where requests of server-relative URLs (starting with '/') are resolved. - /// On non-Windows systems these requests are resolved as an absolute path first. - /// - /// Default `[]` - pub roots: Vec, - - /// Whether to resolve symlinks to their symlinked location. - /// When enabled, symlinked resources are resolved to their real path, not their symlinked location. - /// Note that this may cause module resolution to fail when using tools that symlink packages (like npm link). - /// - /// Default `true` - pub symlinks: bool, - - /// Whether to parse [module.builtinModules](https://nodejs.org/api/module.html#modulebuiltinmodules) or not. - /// For example, "zlib" will throw [crate::ResolveError::Builtin] when set to true. - /// - /// Default `false` - pub builtin_modules: bool, -} - -impl ResolveOptions { - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// - /// let options = ResolveOptions::default().with_condition_names(&["bar"]); - /// assert_eq!(options.condition_names, vec!["bar".to_string()]) - /// ``` - #[must_use] - pub fn with_condition_names(mut self, names: &[&str]) -> Self { - self.condition_names = names.iter().map(ToString::to_string).collect::>(); - self - } - - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// - /// let options = ResolveOptions::default().with_builtin_modules(false); - /// assert_eq!(options.builtin_modules, false) - /// ``` - #[must_use] - pub fn with_builtin_modules(mut self, flag: bool) -> Self { - self.builtin_modules = flag; - self - } - - /// Adds a single root to the options - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_root("foo"); - /// assert_eq!(options.roots, vec![PathBuf::from("foo")]) - /// ``` - #[must_use] - pub fn with_root>(mut self, root: P) -> Self { - self.roots.push(root.as_ref().to_path_buf()); - self - } - - /// Adds a single extension to the list of extensions - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_extension("jsonc"); - /// assert!(options.extensions.contains(&"jsonc".to_string())); - /// ``` - #[must_use] - pub fn with_extension>(mut self, extension: S) -> Self { - self.extensions.push(extension.into()); - self - } - - /// Adds a single main field to the list of fields - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_main_field("something"); - /// assert!(options.main_fields.contains(&"something".to_string())); - /// ``` - #[must_use] - pub fn with_main_field>(mut self, field: S) -> Self { - self.main_fields.push(field.into()); - self - } - - /// Changes how the extension should be treated - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions, EnforceExtension}; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_force_extension(EnforceExtension::Enabled); - /// assert_eq!(options.enforce_extension, EnforceExtension::Enabled); - /// ``` - #[must_use] - pub fn with_force_extension(mut self, enforce_extension: EnforceExtension) -> Self { - self.enforce_extension = enforce_extension; - self - } - - /// Sets the value for [ResolveOptions::fully_specified] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_fully_specified(true); - /// assert_eq!(options.fully_specified, true); - /// ``` - #[must_use] - pub fn with_fully_specified(mut self, fully_specified: bool) -> Self { - self.fully_specified = fully_specified; - self - } - /// Sets the value for [ResolveOptions::prefer_relative] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_prefer_relative(true); - /// assert_eq!(options.prefer_relative, true); - /// ``` - #[must_use] - pub fn with_prefer_relative(mut self, flag: bool) -> Self { - self.prefer_relative = flag; - self - } - /// Sets the value for [ResolveOptions::prefer_absolute] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_prefer_absolute(true); - /// assert_eq!(options.prefer_absolute, true); - /// ``` - #[must_use] - pub fn with_prefer_absolute(mut self, flag: bool) -> Self { - self.prefer_absolute = flag; - self - } - - /// Changes the value of [ResolveOptions::symlinks] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// - /// let options = ResolveOptions::default().with_symbolic_link(false); - /// assert_eq!(options.symlinks, false); - /// ``` - #[must_use] - pub fn with_symbolic_link(mut self, flag: bool) -> Self { - self.symlinks = flag; - self - } - - /// Adds a module to [ResolveOptions::modules] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// - /// let options = ResolveOptions::default().with_module("module"); - /// assert!(options.modules.contains(&"module".to_string())); - /// ``` - #[must_use] - pub fn with_module>(mut self, module: M) -> Self { - self.modules.push(module.into()); - self - } - - /// Adds a main file to [ResolveOptions::main_files] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// - /// let options = ResolveOptions::default().with_main_file("foo"); - /// assert!(options.main_files.contains(&"foo".to_string())); - /// ``` - #[must_use] - pub fn with_main_file>(mut self, module: M) -> Self { - self.main_files.push(module.into()); - self - } - - pub(crate) fn sanitize(mut self) -> Self { - debug_assert!( - self.extensions.iter().filter(|e| !e.is_empty()).all(|e| e.starts_with('.')), - "All extensions must start with a leading dot" - ); - // Set `enforceExtension` to `true` when [ResolveOptions::extensions] contains an empty string. - // See - if self.enforce_extension == EnforceExtension::Auto { - if !self.extensions.is_empty() && self.extensions.iter().any(String::is_empty) { - self.enforce_extension = EnforceExtension::Enabled; - } else { - self.enforce_extension = EnforceExtension::Disabled; - } - } - self - } -} - -/// Value for [ResolveOptions::enforce_extension] -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -pub enum EnforceExtension { - Auto, - Enabled, - Disabled, -} - -impl EnforceExtension { - pub const fn is_auto(&self) -> bool { - matches!(self, Self::Auto) - } - - pub const fn is_enabled(&self) -> bool { - matches!(self, Self::Enabled) - } - - pub const fn is_disabled(&self) -> bool { - matches!(self, Self::Disabled) - } -} - -/// Alias for [ResolveOptions::alias] and [ResolveOptions::fallback] -pub type Alias = Vec<(String, Vec)>; - -/// Alias Value for [ResolveOptions::alias] and [ResolveOptions::fallback] -#[derive(Debug, Clone, Hash, PartialEq, Eq)] -pub enum AliasValue { - /// The path value - Path(String), - - /// The `false` value - Ignore, -} - -impl From for AliasValue -where - S: Into, -{ - fn from(value: S) -> Self { - Self::Path(value.into()) - } -} - -/// Value for [ResolveOptions::restrictions] -#[derive(Debug, Clone)] -pub enum Restriction { - Path(PathBuf), - RegExp(String), -} - -/// Tsconfig Options for [ResolveOptions::tsconfig] -/// -/// Derived from [tsconfig-paths-webpack-plugin](https://github.com/dividab/tsconfig-paths-webpack-plugin#options) -#[derive(Debug, Clone)] -pub struct TsconfigOptions { - /// Allows you to specify where to find the TypeScript configuration file. - /// You may provide - /// * a relative path to the configuration file. It will be resolved relative to cwd. - /// * an absolute path to the configuration file. - pub config_file: PathBuf, - - /// Support for Typescript Project References. - pub references: TsconfigReferences, -} - -/// Configuration for [TsconfigOptions::references] -#[derive(Debug, Clone)] -pub enum TsconfigReferences { - Disabled, - /// Use the `references` field from tsconfig of `config_file`. - Auto, - /// Manually provided relative or absolute path. - Paths(Vec), -} - -impl Default for ResolveOptions { - fn default() -> Self { - Self { - tsconfig: None, - alias: vec![], - alias_fields: vec![], - condition_names: vec![], - description_files: vec!["package.json".into()], - enforce_extension: EnforceExtension::Auto, - extension_alias: vec![], - exports_fields: vec![vec!["exports".into()]], - imports_fields: vec![vec!["imports".into()]], - extensions: vec![".js".into(), ".json".into(), ".node".into()], - fallback: vec![], - fully_specified: false, - main_fields: vec!["main".into()], - main_files: vec!["index".into()], - modules: vec!["node_modules".into()], - resolve_to_context: false, - prefer_relative: false, - prefer_absolute: false, - restrictions: vec![], - roots: vec![], - symlinks: true, - builtin_modules: false, - } - } -} - -// For tracing -impl fmt::Display for ResolveOptions { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - if let Some(tsconfig) = &self.tsconfig { - write!(f, "tsconfig:{tsconfig:?},")?; - } - if !self.alias.is_empty() { - write!(f, "alias:{:?},", self.alias)?; - } - if !self.alias_fields.is_empty() { - write!(f, "alias_fields:{:?},", self.alias_fields)?; - } - if !self.condition_names.is_empty() { - write!(f, "condition_names:{:?},", self.condition_names)?; - } - if self.enforce_extension.is_enabled() { - write!(f, "enforce_extension:{:?},", self.enforce_extension)?; - } - if !self.exports_fields.is_empty() { - write!(f, "exports_fields:{:?},", self.exports_fields)?; - } - if !self.imports_fields.is_empty() { - write!(f, "imports_fields:{:?},", self.imports_fields)?; - } - if !self.extension_alias.is_empty() { - write!(f, "extension_alias:{:?},", self.extension_alias)?; - } - if !self.extensions.is_empty() { - write!(f, "extensions:{:?},", self.extensions)?; - } - if !self.fallback.is_empty() { - write!(f, "fallback:{:?},", self.fallback)?; - } - if self.fully_specified { - write!(f, "fully_specified:{:?},", self.fully_specified)?; - } - if !self.main_fields.is_empty() { - write!(f, "main_fields:{:?},", self.main_fields)?; - } - if !self.main_files.is_empty() { - write!(f, "main_files:{:?},", self.main_files)?; - } - if !self.modules.is_empty() { - write!(f, "modules:{:?},", self.modules)?; - } - if self.resolve_to_context { - write!(f, "resolve_to_context:{:?},", self.resolve_to_context)?; - } - if self.prefer_relative { - write!(f, "prefer_relative:{:?},", self.prefer_relative)?; - } - if self.prefer_absolute { - write!(f, "prefer_absolute:{:?},", self.prefer_absolute)?; - } - if !self.restrictions.is_empty() { - write!(f, "restrictions:{:?},", self.restrictions)?; - } - if !self.roots.is_empty() { - write!(f, "roots:{:?},", self.roots)?; - } - if self.symlinks { - write!(f, "symlinks:{:?},", self.symlinks)?; - } - if self.builtin_modules { - write!(f, "builtin_modules:{:?},", self.builtin_modules)?; - } - Ok(()) - } -} - -#[cfg(test)] -mod test { - use super::{ - AliasValue, EnforceExtension, ResolveOptions, Restriction, TsconfigOptions, - TsconfigReferences, - }; - use std::path::PathBuf; - - #[test] - fn enforce_extension() { - assert!(EnforceExtension::Auto.is_auto()); - assert!(!EnforceExtension::Enabled.is_auto()); - assert!(!EnforceExtension::Disabled.is_auto()); - - assert!(!EnforceExtension::Auto.is_enabled()); - assert!(EnforceExtension::Enabled.is_enabled()); - assert!(!EnforceExtension::Disabled.is_enabled()); - - assert!(!EnforceExtension::Auto.is_disabled()); - assert!(!EnforceExtension::Enabled.is_disabled()); - assert!(EnforceExtension::Disabled.is_disabled()); - } - - #[test] - fn display() { - let options = ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: PathBuf::from("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - alias: vec![("a".into(), vec![AliasValue::Ignore])], - alias_fields: vec![vec!["browser".into()]], - condition_names: vec!["require".into()], - enforce_extension: EnforceExtension::Enabled, - extension_alias: vec![(".js".into(), vec![".ts".into()])], - exports_fields: vec![vec!["exports".into()]], - imports_fields: vec![vec!["imports".into()]], - fallback: vec![("fallback".into(), vec![AliasValue::Ignore])], - fully_specified: true, - resolve_to_context: true, - prefer_relative: true, - prefer_absolute: true, - restrictions: vec![Restriction::Path(PathBuf::from("restrictions"))], - roots: vec![PathBuf::from("roots")], - builtin_modules: true, - ..ResolveOptions::default() - }; - - let expected = r#"tsconfig:TsconfigOptions { config_file: "tsconfig.json", references: Auto },alias:[("a", [Ignore])],alias_fields:[["browser"]],condition_names:["require"],enforce_extension:Enabled,exports_fields:[["exports"]],imports_fields:[["imports"]],extension_alias:[(".js", [".ts"])],extensions:[".js", ".json", ".node"],fallback:[("fallback", [Ignore])],fully_specified:true,main_fields:["main"],main_files:["index"],modules:["node_modules"],resolve_to_context:true,prefer_relative:true,prefer_absolute:true,restrictions:[Path("restrictions")],roots:["roots"],symlinks:true,builtin_modules:true,"#; - assert_eq!(format!("{options}"), expected); - - let options = ResolveOptions { - alias: vec![], - alias_fields: vec![], - builtin_modules: false, - condition_names: vec![], - description_files: vec![], - enforce_extension: EnforceExtension::Disabled, - exports_fields: vec![], - extension_alias: vec![], - extensions: vec![], - fallback: vec![], - fully_specified: false, - imports_fields: vec![], - main_fields: vec![], - main_files: vec![], - modules: vec![], - prefer_absolute: false, - prefer_relative: false, - resolve_to_context: false, - restrictions: vec![], - roots: vec![], - symlinks: false, - tsconfig: None, - }; - - assert_eq!(format!("{options}"), ""); - } -} diff --git a/src/package_json.rs b/src/package_json.rs deleted file mode 100644 index 7e05d202..00000000 --- a/src/package_json.rs +++ /dev/null @@ -1,219 +0,0 @@ -//! package.json definitions -//! -//! Code related to export field are copied from [Parcel's resolver](https://github.com/parcel-bundler/parcel/blob/v2/packages/utils/node-resolver-rs/src/package_json.rs) -use std::path::{Path, PathBuf}; - -use serde_json::Value as JSONValue; - -use crate::{path::PathUtil, ResolveError}; - -pub type JSONMap = serde_json::Map; - -/// Deserialized package.json -#[derive(Debug, Default)] -pub struct PackageJson { - /// Path to `package.json`. Contains the `package.json` filename. - pub path: PathBuf, - - /// Realpath to `package.json`. Contains the `package.json` filename. - pub realpath: PathBuf, - - /// The "name" field defines your package's name. - /// The "name" field can be used in addition to the "exports" field to self-reference a package using its name. - /// - /// - pub name: Option, - - /// The "type" field. - /// - /// - pub r#type: Option, - - /// The "sideEffects" field. - /// - /// - pub side_effects: Option, - - raw_json: std::sync::Arc, -} - -impl PackageJson { - /// # Panics - /// # Errors - pub(crate) fn parse( - path: PathBuf, - realpath: PathBuf, - json: &str, - ) -> Result { - let mut raw_json: JSONValue = serde_json::from_str(json)?; - let mut package_json = Self::default(); - - if let Some(json_object) = raw_json.as_object_mut() { - // Remove large fields that are useless for pragmatic use. - #[cfg(feature = "package_json_raw_json_api")] - { - json_object.remove("description"); - json_object.remove("keywords"); - json_object.remove("scripts"); - json_object.remove("dependencies"); - json_object.remove("devDependencies"); - json_object.remove("peerDependencies"); - json_object.remove("optionalDependencies"); - } - - // Add name, type and sideEffects. - package_json.name = - json_object.get("name").and_then(|field| field.as_str()).map(ToString::to_string); - package_json.r#type = json_object.get("type").cloned(); - package_json.side_effects = json_object.get("sideEffects").cloned(); - } - - package_json.path = path; - package_json.realpath = realpath; - package_json.raw_json = std::sync::Arc::new(raw_json); - Ok(package_json) - } - - fn get_value_by_path<'a>( - fields: &'a serde_json::Map, - path: &[String], - ) -> Option<&'a JSONValue> { - if path.is_empty() { - return None; - } - let mut value = fields.get(&path[0])?; - for key in path.iter().skip(1) { - if let Some(inner_value) = value.as_object().and_then(|o| o.get(key)) { - value = inner_value; - } else { - return None; - } - } - Some(value) - } - - /// Raw serde json value of `package.json`. - /// - /// This is currently used in Rspack for: - /// * getting the `sideEffects` field - /// * query in - search on GitHub indicates query on the `type` field. - /// - /// To reduce overall memory consumption, large fields that useless for pragmatic use are removed. - /// They are: `description`, `keywords`, `scripts`, - /// `dependencies` and `devDependencies`, `peerDependencies`, `optionalDependencies`. - #[cfg(feature = "package_json_raw_json_api")] - pub fn raw_json(&self) -> &std::sync::Arc { - &self.raw_json - } - - /// Directory to `package.json` - /// - /// # Panics - /// - /// * When the package.json path is misconfigured. - pub fn directory(&self) -> &Path { - debug_assert!(self.realpath.file_name().is_some_and(|x| x == "package.json")); - self.realpath.parent().unwrap() - } - - /// The "main" field defines the entry point of a package when imported by name via a node_modules lookup. Its value is a path. - /// - /// When a package has an "exports" field, this will take precedence over the "main" field when importing the package by name. - /// - /// Values are dynamically retrieved from [ResolveOptions::main_fields]. - /// - /// - pub(crate) fn main_fields<'a>( - &'a self, - main_fields: &'a [String], - ) -> impl Iterator + '_ { - main_fields - .iter() - .filter_map(|main_field| self.raw_json.get(main_field)) - .filter_map(|value| value.as_str()) - } - - /// The "exports" field allows defining the entry points of a package when imported by name loaded either via a node_modules lookup or a self-reference to its own name. - /// - /// - pub(crate) fn exports_fields<'a>( - &'a self, - exports_fields: &'a [Vec], - ) -> impl Iterator + '_ { - exports_fields.iter().filter_map(|object_path| { - self.raw_json - .as_object() - .and_then(|json_object| Self::get_value_by_path(json_object, object_path)) - }) - } - - /// In addition to the "exports" field, there is a package "imports" field to create private mappings that only apply to import specifiers from within the package itself. - /// - /// - pub(crate) fn imports_fields<'a>( - &'a self, - imports_fields: &'a [Vec], - ) -> impl Iterator + '_ { - imports_fields.iter().filter_map(|object_path| { - self.raw_json - .as_object() - .and_then(|json_object| Self::get_value_by_path(json_object, object_path)) - .and_then(|value| value.as_object()) - }) - } - - /// The "browser" field is provided by a module author as a hint to javascript bundlers or component tools when packaging modules for client side use. - /// Multiple values are configured by [ResolveOptions::alias_fields]. - /// - /// - fn browser_fields<'a>( - &'a self, - alias_fields: &'a [Vec], - ) -> impl Iterator + '_ { - alias_fields.iter().filter_map(|object_path| { - self.raw_json - .as_object() - .and_then(|json_object| Self::get_value_by_path(json_object, object_path)) - // Only object is valid, all other types are invalid - // https://github.com/webpack/enhanced-resolve/blob/3a28f47788de794d9da4d1702a3a583d8422cd48/lib/AliasFieldPlugin.js#L44-L52 - .and_then(|value| value.as_object()) - }) - } - - /// Resolve the request string for this package.json by looking at the `browser` field. - /// - /// # Errors - /// - /// * Returns [ResolveError::Ignored] for `"path": false` in `browser` field. - pub(crate) fn resolve_browser_field<'a>( - &'a self, - path: &Path, - request: Option<&str>, - alias_fields: &'a [Vec], - ) -> Result, ResolveError> { - for object in self.browser_fields(alias_fields) { - if let Some(request) = request { - if let Some(value) = object.get(request) { - return Self::alias_value(path, value); - } - } else { - let dir = self.path.parent().unwrap(); - for (key, value) in object { - let joined = dir.normalize_with(key); - if joined == path { - return Self::alias_value(path, value); - } - } - } - } - Ok(None) - } - - fn alias_value<'a>(key: &Path, value: &'a JSONValue) -> Result, ResolveError> { - match value { - JSONValue::String(value) => Ok(Some(value.as_str())), - JSONValue::Bool(b) if !b => Err(ResolveError::Ignored(key.to_path_buf())), - _ => Ok(None), - } - } -} diff --git a/src/path.rs b/src/path.rs deleted file mode 100644 index f66fdd76..00000000 --- a/src/path.rs +++ /dev/null @@ -1,132 +0,0 @@ -//! Path Utilities -//! -//! Code adapted from the following libraries -//! * [path-absolutize](https://docs.rs/path-absolutize) -//! * [normalize_path](https://docs.rs/normalize-path) -use std::path::{Component, Path, PathBuf}; - -pub const SLASH_START: &[char; 2] = &['/', '\\']; - -/// Extension trait to add path normalization to std's [`Path`]. -pub trait PathUtil { - /// Normalize this path without performing I/O. - /// - /// All redundant separator and up-level references are collapsed. - /// - /// However, this does not resolve links. - fn normalize(&self) -> PathBuf; - - /// Normalize with subpath assuming this path is normalized without performing I/O. - /// - /// All redundant separator and up-level references are collapsed. - /// - /// However, this does not resolve links. - fn normalize_with>(&self, subpath: P) -> PathBuf; - - /// Defined in ESM PACKAGE_TARGET_RESOLVE - /// If target split on "/" or "\" contains any "", ".", "..", or "node_modules" segments after the first "." segment, case insensitive and including percent encoded variants - fn is_invalid_exports_target(&self) -> bool; -} - -impl PathUtil for Path { - // https://github.com/parcel-bundler/parcel/blob/e0b99c2a42e9109a9ecbd6f537844a1b33e7faf5/packages/utils/node-resolver-rs/src/path.rs#L7 - fn normalize(&self) -> PathBuf { - let mut components = self.components().peekable(); - let mut ret = if let Some(c @ Component::Prefix(..)) = components.peek() { - let buf = PathBuf::from(c.as_os_str()); - components.next(); - buf - } else { - PathBuf::new() - }; - - for component in components { - match component { - Component::Prefix(..) => unreachable!("Path {:?}", self), - Component::RootDir => { - ret.push(component.as_os_str()); - } - Component::CurDir => {} - Component::ParentDir => { - ret.pop(); - } - Component::Normal(c) => { - ret.push(c); - } - } - } - - ret - } - - // https://github.com/parcel-bundler/parcel/blob/e0b99c2a42e9109a9ecbd6f537844a1b33e7faf5/packages/utils/node-resolver-rs/src/path.rs#L37 - fn normalize_with>(&self, subpath: B) -> PathBuf { - let subpath = subpath.as_ref(); - - let mut components = subpath.components(); - - let Some(head) = components.next() else { return subpath.to_path_buf() }; - - if matches!(head, Component::Prefix(..) | Component::RootDir) { - return subpath.to_path_buf(); - } - - let mut ret = self.to_path_buf(); - for component in std::iter::once(head).chain(components) { - match component { - Component::CurDir => {} - Component::ParentDir => { - ret.pop(); - } - Component::Normal(c) => { - ret.push(c); - } - Component::Prefix(..) | Component::RootDir => { - unreachable!("Path {:?} Subpath {:?}", self, subpath) - } - } - } - - ret - } - - fn is_invalid_exports_target(&self) -> bool { - self.components().enumerate().any(|(index, c)| match c { - Component::ParentDir => true, - Component::CurDir => index > 0, - Component::Normal(c) => c.eq_ignore_ascii_case("node_modules"), - _ => false, - }) - } -} - -// https://github.com/webpack/enhanced-resolve/blob/main/test/path.test.js -#[test] -fn is_invalid_exports_target() { - let test_cases = [ - "../a.js", - "../", - "./a/b/../../../c.js", - "./a/b/../../../", - "./../../c.js", - "./../../", - "./a/../b/../../c.js", - "./a/../b/../../", - "./././../", - ]; - - for case in test_cases { - assert!(Path::new(case).is_invalid_exports_target(), "{case}"); - } - - assert!(!Path::new("C:").is_invalid_exports_target()); - assert!(!Path::new("/").is_invalid_exports_target()); -} - -#[test] -fn normalize() { - assert_eq!(Path::new("/foo/.././foo/").normalize(), Path::new("/foo")); - assert_eq!(Path::new("C://").normalize(), Path::new("C://")); - assert_eq!(Path::new("C:").normalize(), Path::new("C:")); - assert_eq!(Path::new(r"\\server\share").normalize(), Path::new(r"\\server\share")); -} diff --git a/src/resolution.rs b/src/resolution.rs deleted file mode 100644 index a3aaa2e7..00000000 --- a/src/resolution.rs +++ /dev/null @@ -1,92 +0,0 @@ -use crate::package_json::PackageJson; -use std::{ - fmt, - path::{Path, PathBuf}, - sync::Arc, -}; - -/// The final path resolution with optional `?query` and `#fragment` -#[derive(Clone)] -pub struct Resolution { - pub(crate) path: PathBuf, - - /// path query `?query`, contains `?`. - pub(crate) query: Option, - - /// path fragment `#query`, contains `#`. - pub(crate) fragment: Option, - - pub(crate) package_json: Option>, -} - -impl fmt::Debug for Resolution { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - f.debug_struct("Resolution") - .field("path", &self.path) - .field("query", &self.query) - .field("fragment", &self.fragment) - .field("package_json", &self.package_json.as_ref().map(|p| &p.path)) - .finish() - } -} - -impl PartialEq for Resolution { - fn eq(&self, other: &Self) -> bool { - self.path == other.path && self.query == other.query && self.fragment == other.fragment - } -} -impl Eq for Resolution {} - -impl Resolution { - /// Returns the path without query and fragment - pub fn path(&self) -> &Path { - &self.path - } - - /// Returns the path without query and fragment - pub fn into_path_buf(self) -> PathBuf { - self.path - } - - /// Returns the path query `?query`, contains the leading `?` - pub fn query(&self) -> Option<&str> { - self.query.as_deref() - } - - /// Returns the path fragment `#fragment`, contains the leading `#` - pub fn fragment(&self) -> Option<&str> { - self.fragment.as_deref() - } - - /// Returns serialized package_json - pub fn package_json(&self) -> Option<&Arc> { - self.package_json.as_ref() - } - - /// Returns the full path with query and fragment - pub fn full_path(&self) -> PathBuf { - let mut path = self.path.clone().into_os_string(); - if let Some(query) = &self.query { - path.push(query); - } - if let Some(fragment) = &self.fragment { - path.push(fragment); - } - PathBuf::from(path) - } -} - -#[test] -fn test() { - let resolution = Resolution { - path: PathBuf::from("foo"), - query: Some("?query".to_string()), - fragment: Some("#fragment".to_string()), - package_json: None, - }; - assert_eq!(resolution.path(), Path::new("foo")); - assert_eq!(resolution.query(), Some("?query")); - assert_eq!(resolution.fragment(), Some("#fragment")); - assert_eq!(resolution.full_path(), PathBuf::from("foo?query#fragment")); - assert_eq!(resolution.into_path_buf(), PathBuf::from("foo")); -} diff --git a/src/specifier.rs b/src/specifier.rs deleted file mode 100644 index 73ed038c..00000000 --- a/src/specifier.rs +++ /dev/null @@ -1,230 +0,0 @@ -use crate::error::SpecifierError; -use std::borrow::Cow; - -#[derive(Debug)] -pub struct Specifier<'a> { - path: Cow<'a, str>, - pub query: Option<&'a str>, - pub fragment: Option<&'a str>, -} - -impl<'a> Specifier<'a> { - pub fn path(&'a self) -> &'a str { - self.path.as_ref() - } - - pub fn parse(specifier: &'a str) -> Result { - if specifier.is_empty() { - return Err(SpecifierError::Empty(specifier.to_string())); - } - let offset = match specifier.as_bytes()[0] { - b'/' | b'.' | b'#' => 1, - _ => 0, - }; - let (path, query, fragment) = Self::parse_query_framgment(specifier, offset); - if path.is_empty() { - return Err(SpecifierError::Empty(specifier.to_string())); - } - Ok(Self { path, query, fragment }) - } - - fn parse_query_framgment( - specifier: &'a str, - skip: usize, - ) -> (Cow<'a, str>, Option<&str>, Option<&str>) { - let mut query_start: Option = None; - let mut fragment_start: Option = None; - - let mut prev = specifier.chars().next().unwrap(); - let mut escaped_indexes = vec![]; - for (i, c) in specifier.char_indices().skip(skip) { - if c == '?' && query_start.is_none() { - query_start = Some(i); - } - if c == '#' { - if prev == '\0' { - escaped_indexes.push(i - 1); - } else { - fragment_start = Some(i); - break; - } - } - prev = c; - } - - let (path, query, fragment) = match (query_start, fragment_start) { - (Some(i), Some(j)) => { - debug_assert!(i < j); - (&specifier[..i], Some(&specifier[i..j]), Some(&specifier[j..])) - } - (Some(i), None) => (&specifier[..i], Some(&specifier[i..]), None), - (None, Some(j)) => (&specifier[..j], None, Some(&specifier[j..])), - _ => (specifier, None, None), - }; - - let path = if escaped_indexes.is_empty() { - Cow::Borrowed(path) - } else { - // Remove the `\0` characters for a legal path. - Cow::Owned( - path.chars() - .enumerate() - .filter_map(|(i, c)| (!escaped_indexes.contains(&i)).then_some(c)) - .collect::(), - ) - }; - - (path, query, fragment) - } -} - -#[cfg(test)] -mod tests { - use super::{Specifier, SpecifierError}; - - #[test] - fn debug() { - let specifier = Specifier::parse("/").unwrap(); - assert_eq!( - format!("{specifier:?}"), - r#"Specifier { path: "/", query: None, fragment: None }"# - ); - } - - #[test] - fn empty() { - let specifiers = ["", "?"]; - for specifier in specifiers { - let error = Specifier::parse(specifier).unwrap_err(); - assert_eq!(error, SpecifierError::Empty(specifier.to_string())); - } - } - - #[test] - fn absolute() -> Result<(), SpecifierError> { - let specifier = "/test?#"; - let parsed = Specifier::parse(specifier)?; - assert_eq!(parsed.path, "/test"); - assert_eq!(parsed.query, Some("?")); - assert_eq!(parsed.fragment, Some("#")); - Ok(()) - } - - #[test] - fn relative() -> Result<(), SpecifierError> { - let specifiers = ["./test", "../test", "../../test"]; - for specifier in specifiers { - let mut r = specifier.to_string(); - r.push_str("?#"); - let parsed = Specifier::parse(&r)?; - assert_eq!(parsed.path, specifier); - assert_eq!(parsed.query, Some("?")); - assert_eq!(parsed.fragment, Some("#")); - } - Ok(()) - } - - #[test] - fn hash() -> Result<(), SpecifierError> { - let specifiers = ["#", "#path"]; - for specifier in specifiers { - let mut r = specifier.to_string(); - r.push_str("?#"); - let parsed = Specifier::parse(&r)?; - assert_eq!(parsed.path, specifier); - assert_eq!(parsed.query, Some("?")); - assert_eq!(parsed.fragment, Some("#")); - } - Ok(()) - } - - #[test] - fn module() -> Result<(), SpecifierError> { - let specifiers = ["module"]; - for specifier in specifiers { - let mut r = specifier.to_string(); - r.push_str("?#"); - let parsed = Specifier::parse(&r)?; - assert_eq!(parsed.path, specifier); - assert_eq!(parsed.query, Some("?")); - assert_eq!(parsed.fragment, Some("#")); - } - Ok(()) - } - - #[test] - fn query_fragment() -> Result<(), SpecifierError> { - let data = [ - ("a?", Some("?"), None), - ("a?query", Some("?query"), None), - ("a?query1?query2", Some("?query1?query2"), None), - ("a?query1?query2?query3", Some("?query1?query2?query3"), None), - ("a#", None, Some("#")), - ("a#b#c", None, Some("#b#c")), - ("a#fragment", None, Some("#fragment")), - ("a?#", Some("?"), Some("#")), - ("a?#fragment", Some("?"), Some("#fragment")), - ("a?query#", Some("?query"), Some("#")), - ("a?query#fragment", Some("?query"), Some("#fragment")), - ("a#fragment?", None, Some("#fragment?")), - ("a#fragment?query", None, Some("#fragment?query")), - ]; - - for (specifier_str, query, fragment) in data { - let specifier = Specifier::parse(specifier_str)?; - assert_eq!(specifier.path, "a", "{specifier_str}"); - assert_eq!(specifier.query, query, "{specifier_str}"); - assert_eq!(specifier.fragment, fragment, "{specifier_str}"); - } - - Ok(()) - } - - #[test] - // https://github.com/webpack/enhanced-resolve/blob/main/test/identifier.test.js - fn enhanced_resolve_edge_cases() -> Result<(), SpecifierError> { - let data = [ - ("path/#", "path/", "", "#"), - ("path/as/?", "path/as/", "?", ""), - ("path/#/?", "path/", "", "#/?"), - ("path/#repo#hash", "path/", "", "#repo#hash"), - ("path/#r#hash", "path/", "", "#r#hash"), - ("path/#repo/#repo2#hash", "path/", "", "#repo/#repo2#hash"), - ("path/#r/#r#hash", "path/", "", "#r/#r#hash"), - ("path/#/not/a/hash?not-a-query", "path/", "", "#/not/a/hash?not-a-query"), - ]; - - for (specifier_str, path, query, fragment) in data { - let specifier = Specifier::parse(specifier_str)?; - assert_eq!(specifier.path, path, "{specifier_str}"); - assert_eq!(specifier.query.unwrap_or(""), query, "{specifier_str}"); - assert_eq!(specifier.fragment.unwrap_or(""), fragment, "{specifier_str}"); - } - - Ok(()) - } - - // https://github.com/webpack/enhanced-resolve/blob/main/test/identifier.test.js - #[test] - fn enhanced_resolve_windows_like() -> Result<(), SpecifierError> { - let data = [ - ("path\\#", "path\\", "", "#"), - ("path\\as\\?", "path\\as\\", "?", ""), - ("path\\#\\?", "path\\", "", "#\\?"), - ("path\\#repo#hash", "path\\", "", "#repo#hash"), - ("path\\#r#hash", "path\\", "", "#r#hash"), - ("path\\#repo\\#repo2#hash", "path\\", "", "#repo\\#repo2#hash"), - ("path\\#r\\#r#hash", "path\\", "", "#r\\#r#hash"), - ("path\\#/not/a/hash?not-a-query", "path\\", "", "#/not/a/hash?not-a-query"), - ]; - - for (specifier_str, path, query, fragment) in data { - let specifier = Specifier::parse(specifier_str)?; - assert_eq!(specifier.path, path, "{specifier_str}"); - assert_eq!(specifier.query.unwrap_or(""), query, "{specifier_str}"); - assert_eq!(specifier.fragment.unwrap_or(""), fragment, "{specifier_str}"); - } - - Ok(()) - } -} diff --git a/src/tests/alias.rs b/src/tests/alias.rs deleted file mode 100644 index 07c615f4..00000000 --- a/src/tests/alias.rs +++ /dev/null @@ -1,280 +0,0 @@ -//! - -use normalize_path::NormalizePath; -use std::path::Path; - -use crate::{AliasValue, Resolution, ResolveContext, ResolveError, ResolveOptions, Resolver}; - -#[test] -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -fn alias() { - use super::memory_fs::MemoryFS; - use crate::ResolverGeneric; - use std::path::{Path, PathBuf}; - - let f = Path::new("/"); - - let file_system = MemoryFS::new(&[ - ("/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", ""), - ("/dashed-name", ""), - ]); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - alias: vec![ - ("aliasA".into(), vec![AliasValue::from("a")]), - ("b$".into(), vec![AliasValue::from("a/index")]), - ("c$".into(), vec![AliasValue::from("/a/index")]), - ( - "multiAlias".into(), - vec![ - AliasValue::from("b"), - AliasValue::from("c"), - AliasValue::from("d"), - AliasValue::from("e"), - AliasValue::from("a"), - ], - ), - ("recursive".into(), vec![AliasValue::from("recursive/dir")]), - ("/d/dir".into(), vec![AliasValue::from("/c/dir")]), - ("/d/index.js".into(), vec![AliasValue::from("/c/index")]), - ("#".into(), vec![AliasValue::from("/c/dir")]), - ("@".into(), vec![AliasValue::from("/c/dir")]), - ("ignored".into(), vec![AliasValue::Ignore]), - // not part of enhanced-resolve, added to make sure query in alias value works - ("alias_query".into(), vec![AliasValue::from("a?query_after")]), - ("alias_fragment".into(), vec![AliasValue::from("a#fragment_after")]), - ("dash".into(), vec![AliasValue::Ignore]), - ("@scope/package-name/file$".into(), vec![AliasValue::from("/c/dir")]), - ], - modules: vec!["/".into()], - ..ResolveOptions::default() - }, - ); - - #[rustfmt::skip] - let pass = [ - ("should resolve a not aliased module 1", "a", "/a/index"), - ("should resolve a not aliased module 2", "a/index", "/a/index"), - ("should resolve a not aliased module 3", "a/dir", "/a/dir/index"), - ("should resolve a not aliased module 4", "a/dir/index", "/a/dir/index"), - ("should resolve an aliased module 1", "aliasA", "/a/index"), - ("should resolve an aliased module 2", "aliasA/index", "/a/index"), - ("should resolve an aliased module 3", "aliasA/dir", "/a/dir/index"), - ("should resolve an aliased module 4", "aliasA/dir/index", "/a/dir/index"), - ("should resolve '#' alias 1", "#", "/c/dir/index"), - ("should resolve '#' alias 2", "#/index", "/c/dir/index"), - ("should resolve '@' alias 1", "@", "/c/dir/index"), - ("should resolve '@' alias 2", "@/index", "/c/dir/index"), - ("should resolve a recursive aliased module 1", "recursive", "/recursive/dir/index"), - ("should resolve a recursive aliased module 2", "recursive/index", "/recursive/dir/index"), - ("should resolve a recursive aliased module 3", "recursive/dir", "/recursive/dir/index"), - ("should resolve a recursive aliased module 4", "recursive/dir/index", "/recursive/dir/index"), - ("should resolve a file aliased module 1", "b", "/a/index"), - ("should resolve a file aliased module 2", "c", "/a/index"), - ("should resolve a file aliased module with a query 1", "b?query", "/a/index?query"), - ("should resolve a file aliased module with a query 2", "c?query", "/a/index?query"), - ("should resolve a path in a file aliased module 1", "b/index", "/b/index"), - ("should resolve a path in a file aliased module 2", "b/dir", "/b/dir/index"), - ("should resolve a path in a file aliased module 3", "b/dir/index", "/b/dir/index"), - ("should resolve a path in a file aliased module 4", "c/index", "/c/index"), - ("should resolve a path in a file aliased module 5", "c/dir", "/c/dir/index"), - ("should resolve a path in a file aliased module 6", "c/dir/index", "/c/dir/index"), - ("should resolve a file aliased file 1", "d", "/c/index"), - ("should resolve a file aliased file 2", "d/dir/index", "/c/dir/index"), - ("should resolve a file in multiple aliased dirs 1", "multiAlias/dir/file", "/e/dir/file"), - ("should resolve a file in multiple aliased dirs 2", "multiAlias/anotherDir", "/e/anotherDir/index"), - // not part of enhanced-resolve, added to make sure query in alias value works - ("should resolve query in alias value", "alias_query?query_before", "/a/index?query_after"), - ("should resolve query in alias value", "alias_fragment#fragment_before", "/a/index#fragment_after"), - ("should resolve dashed name", "dashed-name", "/dashed-name"), - ("should resolve scoped package name with sub dir", "@scope/package-name/file", "/c/dir/index"), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - - #[rustfmt::skip] - let ignore = [ - ("should resolve an ignore module", "ignored", ResolveError::Ignored(f.join("ignored"))) - ]; - - for (comment, request, expected) in ignore { - let resolution = resolver.resolve(f, request); - assert_eq!(resolution, Err(expected), "{comment} {request}"); - } -} - -// Not part of enhanced-resolve -#[test] -fn infinite_recursion() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![ - ("./a".into(), vec![AliasValue::from("./b")]), - ("./b".into(), vec![AliasValue::from("./a")]), - ], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(f, "./a"); - assert_eq!(resolution, Err(ResolveError::Recursion)); -} - -fn check_slash(path: &Path) { - let s = path.to_string_lossy().to_string(); - #[cfg(target_os = "windows")] - { - assert!(!s.contains('/'), "{s}"); - assert!(s.contains('\\'), "{s}"); - } - #[cfg(not(target_os = "windows"))] - { - assert!(s.contains('/'), "{s}"); - assert!(!s.contains('\\'), "{s}"); - } -} - -#[test] -fn absolute_path() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![(f.join("foo").to_str().unwrap().to_string(), vec![AliasValue::Ignore])], - modules: vec![f.clone().to_str().unwrap().to_string()], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(&f, "foo/index"); - assert_eq!(resolution, Err(ResolveError::Ignored(f.join("foo")))); -} - -#[test] -fn system_path() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![("@app".into(), vec![AliasValue::from(f.join("alias").to_string_lossy())])], - ..ResolveOptions::default() - }); - - let specifiers = ["@app/files/a", "@app/files/a.js"]; - - for specifier in specifiers { - let path = resolver.resolve(&f, specifier).map(Resolution::into_path_buf).unwrap(); - assert_eq!(path, f.join("alias/files/a.js")); - check_slash(&path); - } -} - -#[test] -fn alias_is_full_path() { - let f = super::fixture(); - let dir = f.join("foo"); - let dir_str = dir.to_string_lossy().to_string(); - - let resolver = Resolver::new(ResolveOptions { - alias: vec![("@".into(), vec![AliasValue::Path(dir_str.clone())])], - ..ResolveOptions::default() - }); - - let mut ctx = ResolveContext::default(); - - let specifiers = [ - "@/index".to_string(), - "@/index.js".to_string(), - // specifier has multiple `/` for reasons we'll never know - "@////index".to_string(), - // specifier is a full path - dir_str, - ]; - - for specifier in specifiers { - let resolution = resolver.resolve_with_context(&f, &specifier, &mut ctx); - assert_eq!(resolution.map(|r| r.full_path()), Ok(dir.join("index.js"))); - } - - for path in ctx.file_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - check_slash(&path); - } - - for path in ctx.missing_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - check_slash(&path); - if let Some(path) = path.parent() { - assert!(!path.is_file(), "{path:?} must not be a file"); - } - } -} - -// For the `should_stop` variable in `load_alias` -#[test] -fn all_alias_values_are_not_found() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![( - "m1".to_string(), - vec![AliasValue::Path(f.join("node_modules").join("m2").to_string_lossy().to_string())], - )], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(&f, "m1/a.js"); - assert_eq!(resolution, Err(ResolveError::NotFound("m1/a.js".to_string()))); -} - -#[test] -fn alias_fragment() { - let f = super::fixture(); - - let data = [ - // enhanced-resolve has `#` prepended with a `\0`, they are removed from the - // following 3 expected test results. - // See https://github.com/webpack/enhanced-resolve#escaping - ( - "handle fragment edge case (no fragment)", - "./no#fragment/#/#", - f.join("no#fragment/#/#.js"), - ), - ("handle fragment edge case (fragment)", "./no#fragment/#/", f.join("no.js#fragment/#/")), - ( - "handle fragment escaping", - "./no\0#fragment/\0#/\0##fragment", - f.join("no#fragment/#/#.js#fragment"), - ), - ]; - - for (comment, request, expected) in data { - let resolver = Resolver::new(ResolveOptions { - alias: vec![("foo".to_string(), vec![AliasValue::Path(request.to_string())])], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f, "foo").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } -} - -#[test] -fn alias_try_fragment_as_path() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![( - "#".to_string(), - vec![AliasValue::Path(f.join("#").to_string_lossy().to_string())], - )], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(&f, "#/a").map(|r| r.full_path()); - assert_eq!(resolution, Ok(f.join("#").join("a.js"))); -} diff --git a/src/tests/browser_field.rs b/src/tests/browser_field.rs deleted file mode 100644 index 171ee099..00000000 --- a/src/tests/browser_field.rs +++ /dev/null @@ -1,189 +0,0 @@ -//! - -use crate::{AliasValue, ResolveError, ResolveOptions, Resolver}; - -#[test] -fn ignore() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![ - vec!["browser".into()], - vec!["innerBrowser1".into()], - vec!["innerBrowser2".into()], - vec![], - ], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - (f.clone(), "./lib/ignore", f.join("lib/ignore.js")), - (f.clone(), "./lib/ignore.js", f.join("lib/ignore.js")), - (f.join("lib"), "./ignore", f.join("lib/ignore.js")), - (f.join("lib"), "./ignore.js", f.join("lib/ignore.js")), - ]; - - for (path, request, expected) in data { - let resolution = resolver.resolve(&path, request); - let expected = ResolveError::Ignored(expected); - assert_eq!(resolution, Err(expected), "{path:?} {request}"); - } -} - -#[test] -fn shared_resolvers() { - let f = super::fixture().join("browser-module"); - - let resolver1 = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["innerBrowser1".into(), "field".into(), "browser".into()]], - ..ResolveOptions::default() - }); - let resolved_path = resolver1.resolve(&f, "./lib/main1.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("lib/main.js"))); - - let resolver2 = resolver1.clone_with_options(ResolveOptions { - alias_fields: vec![vec!["innerBrowser2".into(), "browser".into()]], - ..ResolveOptions::default() - }); - let resolved_path = resolver2.resolve(&f, "./lib/main2.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("./lib/replaced.js"))); -} - -#[test] -fn replace_file() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![ - vec!["browser".into()], - vec!["innerBrowser1".into(), "field2".into(), "browser".into()], // not presented - vec!["innerBrowser1".into(), "field".into(), "browser".into()], - vec!["innerBrowser2".into(), "browser".into()], - ], - // Not part of enhanced-resolve. Added to make sure no interaction between these two fields. - main_fields: vec!["browser".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - ("should replace a file 1", f.clone(), "./lib/replaced", f.join("lib/browser.js")), - ("should replace a file 2", f.clone(), "./lib/replaced.js", f.join("lib/browser.js")), - ("should replace a file 3", f.join("lib"), "./replaced", f.join("lib/browser.js")), - ("should replace a file 4", f.join("lib"), "./replaced.js", f.join("lib/browser.js")), - ("should replace a module with a file 1", f.clone(), "module-a", f.join("browser/module-a.js")), - ("should replace a module with a file 2", f.join("lib"), "module-a", f.join("browser/module-a.js")), - ("should replace a module with a module 1", f.clone(), "module-b", f.join("node_modules/module-c.js")), - ("should replace a module with a module 2", f.join("lib"), "module-b", f.join("node_modules/module-c.js")), - ("should resolve in nested property 1", f.clone(), "./lib/main1.js", f.join("lib/main.js")), - ("should resolve in nested property 2", f.clone(), "./lib/main2.js", f.join("lib/browser.js")), - ("should check only alias field properties", f.clone(), "./toString", f.join("lib/toString.js")), - // not part of enhanced-resolve - ("recursion", f.clone(), "module-c", f.join("node_modules/module-c.js")), - ("resolve self 1", f.clone(), "./lib/main.js", f.join("lib/main.js")), - ("resolve self 2", f.clone(), "./main.js", f.join("lib/main.js")), - ]; - - for (comment, path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn recurse_fail() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - ("recurse non existent", f.clone(), "./lib/non-existent.js", ResolveError::NotFound("./lib/non-existent.js".into())), - ("path partial match 1", f.clone(), "./xyz.js", ResolveError::NotFound("./xyz.js".into())), - ("path partial match 2", f, "./lib/xyz.js", ResolveError::NotFound("./lib/xyz.js".into())), - ]; - - for (comment, path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Err(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn broken() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - // The browser field string value should be ignored - (f.clone(), "browser-module-broken", Ok(f.join("node_modules/browser-module-broken/main.js"))), - (f.join("browser-module"), "./number", Err(ResolveError::NotFound("./number".into()))), - ]; - - for (path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, expected, "{path:?} {request}"); - } -} - -#[test] -fn crypto_js() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - fallback: vec![( - "crypto".into(), - vec![AliasValue::from(f.join("lib.js").to_string_lossy())], - )], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(f.join("crypto-js"), "crypto").map(|r| r.full_path()); - assert_eq!(resolved_path, Err(ResolveError::Ignored(f.join("crypto-js")))); -} - -// https://github.com/webpack/webpack/blob/87660921808566ef3b8796f8df61bd79fc026108/test/cases/resolving/browser-field/index.js#L40-L43 -#[test] -fn recursive() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - let data = [ - ("should handle recursive file 1", f.clone(), "recursive-file/a"), - ("should handle recursive file 2", f.clone(), "recursive-file/b"), - ("should handle recursive file 3", f.clone(), "recursive-file/c"), - ("should handle recursive file 4", f, "recursive-file/d"), - ]; - - for (comment, path, request) in data { - let resolved_path = resolver.resolve(&path, request); - assert_eq!(resolved_path, Err(ResolveError::Recursion), "{comment} {path:?} {request}"); - } -} - -#[test] -fn with_query() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "./foo").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("lib").join("browser.js?query"))); -} diff --git a/src/tests/builtins.rs b/src/tests/builtins.rs deleted file mode 100644 index 5d6d14d9..00000000 --- a/src/tests/builtins.rs +++ /dev/null @@ -1,121 +0,0 @@ -use std::path::Path; - -use crate::{ResolveError, ResolveOptions, Resolver}; - -#[test] -fn builtins_off() { - let f = Path::new("/"); - let resolver = Resolver::default(); - let resolved_path = resolver.resolve(f, "zlib").map(|r| r.full_path()); - assert_eq!(resolved_path, Err(ResolveError::NotFound("zlib".into()))); -} - -#[test] -fn builtins() { - let f = Path::new("/"); - - let resolver = Resolver::new(ResolveOptions::default().with_builtin_modules(true)); - - let pass = [ - "_http_agent", - "_http_client", - "_http_common", - "_http_incoming", - "_http_outgoing", - "_http_server", - "_stream_duplex", - "_stream_passthrough", - "_stream_readable", - "_stream_transform", - "_stream_wrap", - "_stream_writable", - "_tls_common", - "_tls_wrap", - "assert", - "assert/strict", - "async_hooks", - "buffer", - "child_process", - "cluster", - "console", - "constants", - "crypto", - "dgram", - "diagnostics_channel", - "dns", - "dns/promises", - "domain", - "events", - "fs", - "fs/promises", - "http", - "http2", - "https", - "inspector", - "module", - "net", - "os", - "path", - "path/posix", - "path/win32", - "perf_hooks", - "process", - "punycode", - "querystring", - "readline", - "repl", - "stream", - "stream/consumers", - "stream/promises", - "stream/web", - "string_decoder", - "sys", - "timers", - "timers/promises", - "tls", - "trace_events", - "tty", - "url", - "util", - "util/types", - "v8", - "vm", - "worker_threads", - "zlib", - ]; - - for request in pass { - let prefixed_request = format!("node:{request}"); - for request in [prefixed_request.clone(), request.to_string()] { - let resolved_path = resolver.resolve(f, &request).map(|r| r.full_path()); - let err = ResolveError::Builtin(prefixed_request.clone()); - assert_eq!(resolved_path, Err(err), "{request}"); - } - } -} - -#[test] -fn fail() { - let f = Path::new("/"); - let resolver = Resolver::new(ResolveOptions::default().with_builtin_modules(true)); - let request = "xxx"; - let resolved_path = resolver.resolve(f, request); - let err = ResolveError::NotFound(request.to_string()); - assert_eq!(resolved_path, Err(err), "{request}"); -} - -#[test] -fn imports() { - let f = super::fixture().join("builtins"); - let resolver = Resolver::new(ResolveOptions { - builtin_modules: true, - condition_names: vec!["node".into()], - ..ResolveOptions::default() - }); - - for request in ["#fs", "#http"] { - let resolved_path = resolver.resolve(f.clone(), request).map(|r| r.full_path()); - let err = ResolveError::Builtin(format!("node:{}", request.trim_start_matches('#'))); - assert_eq!(resolved_path, Err(err)); - } -} diff --git a/src/tests/dependencies.rs b/src/tests/dependencies.rs deleted file mode 100644 index bcc2355b..00000000 --- a/src/tests/dependencies.rs +++ /dev/null @@ -1,110 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/dependencies.test.js - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows { - use rustc_hash::FxHashSet; - use std::path::PathBuf; - - use crate::{ResolveContext, ResolveOptions, ResolverGeneric}; - - use super::super::memory_fs::MemoryFS; - - fn file_system() -> MemoryFS { - MemoryFS::new(&[ - ("/a/b/node_modules/some-module/index.js", ""), - ("/a/node_modules/module/package.json", r#"{"main":"entry.js"}"#), - ("/a/node_modules/module/file.js", r#"{"main":"entry.js"}"#), - ("/modules/other-module/file.js", ""), - ]) - } - - #[test] - fn test() { - let file_system = file_system(); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - extensions: vec![".json".into(), ".js".into()], - modules: vec!["/modules".into(), "node_modules".into()], - ..ResolveOptions::default() - }, - ); - - let data = [ - ( - "middle module request", - "/a/b/c", - "module/file", - "/a/node_modules/module/file.js", - // These dependencies are different from enhanced-resolve due to different code path to - // querying the file system - vec![ - // 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", - // "/", - ], - vec![ - // missing package.jsons - // "/a/b/c/package.json", - "/a/b/package.json", - "/a/package.json", - "/package.json", - // missing modules directories - "/a/b/c", - // "/a/b/c/node_modules", - // missing single file modules - "/modules/module", - "/a/b/node_modules/module", - // missing files with alternative extensions - "/a/node_modules/module/file", - "/a/node_modules/module/file.json", - ], - ), - ( - "fast found module", - "/a/b/c", - "other-module/file.js", - "/modules/other-module/file.js", - // These dependencies are different from enhanced-resolve due to different code path to - // querying the file system - vec![ - // symlink checks - "/modules/other-module/file.js", - // "/modules/other-module", - // "/modules", - // "/", - ], - vec![ - // missing package.jsons - // "/a/b/c/package.json", - "/a/b/c", - "/a/b/package.json", - "/a/package.json", - "/package.json", - "/modules/other-module/package.json", - "/modules/package.json", - ], - ), - ]; - - for (name, context, request, result, file_dependencies, missing_dependencies) in data { - let mut ctx = ResolveContext::default(); - let path = PathBuf::from(context); - let resolved = - resolver.resolve_with_context(path, request, &mut ctx).map(|r| r.full_path()); - assert_eq!(resolved, Ok(PathBuf::from(result))); - let file_dependencies = - FxHashSet::from_iter(file_dependencies.iter().map(PathBuf::from)); - let missing_dependencies = - FxHashSet::from_iter(missing_dependencies.iter().map(PathBuf::from)); - assert_eq!(ctx.file_dependencies, file_dependencies, "{name}"); - assert_eq!(ctx.missing_dependencies, missing_dependencies, "{name}"); - } - } -} diff --git a/src/tests/exports_field.rs b/src/tests/exports_field.rs deleted file mode 100644 index fd68c1f7..00000000 --- a/src/tests/exports_field.rs +++ /dev/null @@ -1,2546 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/exportsField.test.js -//! -//! The huge exports field test cases are at the bottom of this file. - -use crate::{Ctx, PathUtil, ResolveError, ResolveOptions, Resolver}; -use serde_json::json; -use std::path::Path; - -#[test] -fn test_simple() { - let f = super::fixture().join("exports-field"); - let f2 = super::fixture().join("exports-field2"); - let f4 = super::fixture().join("exports-field-error"); - let f5 = super::fixture().join("imports-exports-wildcard"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - fully_specified: true, - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("resolve root using exports field, not a main field", f.clone(), "exports-field", f.join("node_modules/exports-field/x.js")), - ("resolver should respect condition names", f.clone(), "exports-field/dist/main.js", f.join("node_modules/exports-field/lib/lib2/main.js")), - // enhanced_resolve behaves differently to node.js. enhanced_resolve fallbacks when an - // array item is unresolved, where as node.js fallbacks when an array has an - // InvalidPackageTarget error. - // ("resolver should respect fallback", f2.clone(), "exports-field/dist/browser.js", f2.join("node_modules/exports-field/lib/browser.js")), - // The following two tests require fallback from array values, the path is changed here to - // only test query and fragment. - ("resolver should respect query parameters #1", f2.clone(), "exports-field/dist/main.js?foo", f2.join("node_modules/exports-field/lib/lib2/main.js?foo")), - ("resolver should respect fragment parameters #1", f2.clone(), "exports-field/dist/main.js#foo", f2.join("node_modules/exports-field/lib/lib2/main.js#foo")), - ("relative path should work, if relative path as request is used", f.clone(), "./node_modules/exports-field/lib/main.js", f.join("node_modules/exports-field/lib/main.js")), - ("self-resolving root", f.clone(), "@exports-field/core", f.join("a.js")), - ("should resolve with wildcard pattern #1", f5.clone(), "m/features/f.js", f5.join("node_modules/m/src/features/f.js")), - ("should resolve with wildcard pattern #2", f5.clone(), "m/features/y/y.js", f5.join("node_modules/m/src/features/y/y.js")), - ("should resolve with wildcard pattern #3", f5.clone(), "m/features-no-ext/y/y.js", f5.join("node_modules/m/src/features/y/y.js")), - ("should resolve with wildcard pattern #4", f5.clone(), "m/middle/nested/f.js", f5.join("node_modules/m/src/middle/nested/f.js")), - ("should resolve with wildcard pattern #5", f5.clone(), "m/middle-1/nested/f.js", f5.join("node_modules/m/src/middle-1/nested/f.js")), - ("should resolve with wildcard pattern #6", f5.clone(), "m/middle-2/nested/f.js", f5.join("node_modules/m/src/middle-2/nested/f.js")), - ("should resolve with wildcard pattern #7", f5.clone(), "m/middle-3/nested/f", f5.join("node_modules/m/src/middle-3/nested/f/nested/f.js")), - ("should resolve with wildcard pattern #8", f5.clone(), "m/middle-4/f/nested", f5.join("node_modules/m/src/middle-4/f/f.js")), - ("should resolve with wildcard pattern #9", f5.clone(), "m/middle-5/f$/$", f5.join("node_modules/m/src/middle-5/f$/$.js")), - ]; - - // Not needed or snapshot: - // * should log the correct info - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } - - let p = f.join("node_modules/exports-field/package.json"); - let p2 = f2.join("node_modules/exports-field/package.json"); - let p4 = f4.join("node_modules/exports-field/package.json"); - let p5 = f5.join("node_modules/m/package.json"); - - #[rustfmt::skip] - let fail = [ - // ("throw error if extension not provided", f2.clone(), "exports-field/dist/main", ResolveError::NotFound(f2.join("node_modules/exports-field/lib/lib2/main"))), - ("resolver should respect query parameters #2. Direct matching", f2.clone(), "exports-field?foo", ResolveError::PackagePathNotExported("./?foo".into(), p2.clone())), - ("resolver should respect fragment parameters #2. Direct matching", f2, "exports-field#foo", ResolveError::PackagePathNotExported("./#foo".into(), p2)), - ("relative path should not work with exports field", f.clone(), "./node_modules/exports-field/dist/main.js", ResolveError::NotFound("./node_modules/exports-field/dist/main.js".into())), - ("backtracking should not work for request", f.clone(), "exports-field/dist/../../../a.js", ResolveError::InvalidPackageTarget("./lib/../../../a.js".to_string(), "./dist/".to_string(), p.clone())), - ("backtracking should not work for exports field target", f.clone(), "exports-field/dist/a.js", ResolveError::InvalidPackageTarget("./../../a.js".to_string(), "./dist/a.js".to_string(), p.clone())), - ("not exported error", f.clone(), "exports-field/anything/else", ResolveError::PackagePathNotExported("./anything/else".to_string(), p.clone())), - ("request ending with slash #1", f.clone(), "exports-field/", ResolveError::PackagePathNotExported("./".to_string(), p.clone())), - ("request ending with slash #2", f.clone(), "exports-field/dist/", ResolveError::PackagePathNotExported("./dist/".to_string(), p.clone())), - ("request ending with slash #3", f.clone(), "exports-field/lib/", ResolveError::PackagePathNotExported("./lib/".to_string(), p)), - ("should throw error if target is invalid", f4, "exports-field", ResolveError::InvalidPackageTarget("./a/../b/../../pack1/index.js".to_string(), ".".to_string(), p4)), - ("throw error if exports field is invalid", f.clone(), "invalid-exports-field", ResolveError::InvalidPackageConfig(f.join("node_modules/invalid-exports-field/package.json"))), - ("should throw error if target is 'null'", f5, "m/features/internal/file.js", ResolveError::PackagePathNotExported("./features/internal/file.js".to_string(), p5)), - ]; - - for (comment, path, request, error) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!(resolution, Err(error), "{comment} {path:?} {request}"); - } -} - -// resolve using exports field, not a browser field #1 -#[test] -fn exports_not_browser_field1() { - let f = super::fixture().join("exports-field"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - condition_names: vec!["webpack".into()], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "exports-field/dist/main.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("node_modules/exports-field/lib/lib2/main.js"))); -} - -// resolve using exports field and a browser alias field #2 -#[test] -fn exports_not_browser_field2() { - let f2 = super::fixture().join("exports-field2"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - extensions: vec![".js".into()], - condition_names: vec!["node".into()], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f2, "exports-field/dist/main.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f2.join("node_modules/exports-field/lib/browser.js"))); -} - -// should resolve extension without fullySpecified -#[test] -fn extension_without_fully_specified() { - let f2 = super::fixture().join("exports-field2"); - - let commonjs_resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - let resolved_path = - commonjs_resolver.resolve(&f2, "exports-field/dist/main").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f2.join("node_modules/exports-field/lib/lib2/main.js"))); -} - -#[test] -fn field_name_path() { - let f2 = super::fixture().join("exports-field2"); - let f3 = super::fixture().join("exports-field3"); - - // field name path #1 #2 #3 - let exports_fields = [ - vec![vec!["exportsField".into(), "exports".into()]], - vec![vec!["exportsField".into(), "exports".into()], vec!["exports".into()]], - vec![vec!["exports".into()], vec!["exportsField".into(), "exports".into()]], - ]; - - for exports_fields in exports_fields { - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - exports_fields, - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/main.js"))); - } - - // field name path #4 - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - exports_fields: vec![vec!["exports".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f2, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f2.join("node_modules/exports-field/index.js"))); - - // field name path #5 - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - exports_fields: vec![vec!["ex".into()], vec!["exports_field".into(), "exports".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/index"))); - - // non-compliant export targeting a directory - let resolver = Resolver::new(ResolveOptions { - exports_fields: vec![vec!["broken".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/src/index.js"))); -} - -#[test] -fn shared_resolvers() { - let f3 = super::fixture().join("exports-field3"); - - let resolver1 = Resolver::new(ResolveOptions { - exports_fields: vec![vec!["exportsField".into(), "exports".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver1.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/main.js"))); - - let resolver2 = resolver1.clone_with_options(ResolveOptions { - exports_fields: vec![vec!["ex".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver2.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/index"))); -} - -#[test] -fn extension_alias_1_2() { - let f = super::fixture().join("exports-field-and-extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - extension_alias: vec![(".js".into(), vec![".ts".into(), ".js".into()])], - fully_specified: true, - condition_names: vec!["webpack".into(), "default".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve with the `extensionAlias` option", f.clone(), "@org/pkg/string.js", f.join("node_modules/@org/pkg/dist/string.js")), - ("should resolve with the `extensionAlias` option #2", f.clone(), "pkg/string.js", f.join("node_modules/pkg/dist/string.js")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn extension_alias_3() { - let f = super::fixture().join("exports-field-and-extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - extension_alias: vec![( - ".js".into(), - vec![".foo".into(), ".baz".into(), ".baz".into(), ".ts".into(), ".js".into()], - )], - fully_specified: true, - condition_names: vec!["webpack".into(), "default".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve with the `extensionAlias` option #3", f.clone(), "pkg/string.js", f.join("node_modules/pkg/dist/string.js")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn extension_alias_throw_error() { - let f = super::fixture().join("exports-field-and-extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - extension_alias: vec![(".js".into(), vec![".ts".into()])], - fully_specified: true, - condition_names: vec!["webpack".into(), "default".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let fail = [ - // enhanced-resolve has two test cases that are exactly the same here - // https://github.com/webpack/enhanced-resolve/blob/a998c7d218b7a9ec2461fc4fddd1ad5dd7687485/test/exportsField.test.js#L2976-L3024 - ("should throw error with the `extensionAlias` option", f, "pkg/string.js", ResolveError::ExtensionAlias), - // TODO: The error is PackagePathNotExported in enhanced-resolve - // ("should throw error with the `extensionAlias` option", f.clone(), "pkg/string.js", ResolveError::PackagePathNotExported("node_modules/pkg/dist/string.ts".to_string())), - ]; - - for (comment, path, request, error) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!(resolution, Err(error), "{comment} {path:?} {request}"); - } -} - -// Small script for generating the test cases from enhanced-resolve -// for (c of testCases) { -// console.log("TestCase {") -// console.log(`name: ${JSON.stringify(c.name)},`) -// if (c.expect instanceof Error) { -// console.log(`expect: None,`) -// } else { -// console.log(`expect: Some(vec!${JSON.stringify(c.expect)}),`) -// } -// console.log(`exports_field: exports_field(json!(${JSON.stringify(c.suite[0], null, 2)})),`) -// console.log(`request: "${c.suite[1]}",`) -// console.log(`condition_names: vec!${JSON.stringify(c.suite[2])},`) -// console.log("},") -//} -struct TestCase { - name: &'static str, - expect: Option>, - exports_field: serde_json::Value, - request: &'static str, - condition_names: Vec<&'static str>, -} - -#[allow(clippy::needless_pass_by_value)] -fn exports_field(value: serde_json::Value) -> serde_json::Value { - value -} - -#[test] -fn test_cases() { - let test_cases = [ - TestCase { - name: "sample #1", - expect: Some(vec!["./dist/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/": { - "import": [ - "./dist/", - "./src/" - ], - "webpack": "./wp/" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "sample #1", - expect: Some(vec!["./src/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/": { - "import": [ - "./src/" - ], - "webpack": "./wp/" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - TestCase { - name: "sample #1 (wildcard)", - expect: Some(vec!["./dist/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/*": { - "import": [ - "./dist/*", - "./src/*" - ], - "webpack": "./wp/*" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "sample #1 (wildcard)", - expect: Some(vec!["./src/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/*": { - "import": [ - "./src/*" - ], - "webpack": "./wp/*" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - TestCase { - name: "sample #2", - expect: Some(vec!["./data/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./timezones/": "./data/timezones/" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #2 (wildcard)", - expect: Some(vec!["./data/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./timezones/*": "./data/timezones/*" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #3", - expect: Some(vec!["./data/timezones/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./": "./data/timezones/" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #3 (wildcard)", - expect: Some(vec!["./data/timezones/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./*": "./data/timezones/*.mjs" - })), - request: "./timezones/pdt", - condition_names: vec![], - }, - TestCase { - name: "sample #4", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./lib/": { - "browser": [ - "./browser/" - ] - }, - "./dist/index.js": { - "node": "./index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #4 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "node": "./index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #5", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/": { - "browser": [ - "./browser/" - ] - }, - "./dist/index.js": { - "node": "./index.js", - "default": "./browser/index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #5 (wildcard)", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "node": "./index.js", - "default": "./browser/index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./dist/a": "./dist/index.js" - })), - request: "./dist/aaa", - condition_names: vec![], - }, - TestCase { - name: "sample #7", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./dist/a/a/": "./dist/index.js" - })), - request: "./dist/a/a", - condition_names: vec![], - }, - TestCase { - name: "sample #7 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./dist/a/a/*": "./dist/index.js" - })), - request: "./dist/a/a", - condition_names: vec![], - }, - TestCase { - name: "sample #8", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": "./index.js" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #9", - expect: Some(vec!["./main.js"]), - exports_field: exports_field(json!({ - "./index.js": "./main.js" - })), - request: "./index.js", - condition_names: vec![], - }, - TestCase { - name: "sample #10", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #11", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./bar#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #12", - expect: Some(vec!["./ok.js#abc"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/ok.js#abc", - condition_names: vec![], - }, - TestCase { - name: "sample #12", - expect: Some(vec!["./ok.js#abc"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/ok.js#abc", - condition_names: vec![], - }, - TestCase { - name: "sample #13", - expect: Some(vec!["./ok.js?abc"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/ok.js?abc", - condition_names: vec![], - }, - TestCase { - name: "sample #14", - expect: Some(vec!["./🎉.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/🎉.js", - condition_names: vec![], - }, - TestCase { - name: "sample #15", - expect: Some(vec!["./%F0%9F%8E%89.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/%F0%9F%8E%89.js", - condition_names: vec![], - }, - TestCase { - name: "sample #16", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./🎉", - condition_names: vec![], - }, - TestCase { - name: "sample #17", - expect: Some(vec!["./other.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./%F0%9F%8E%89", - condition_names: vec![], - }, - TestCase { - name: "sample #18", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./module", - condition_names: vec![], - }, - TestCase { - name: "sample #19", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./module#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #20", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./module?foo", - condition_names: vec![], - }, - TestCase { - name: "sample #21", - expect: Some(vec!["./zizizi"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./z*z*z*" - })), - request: "./#zippi", - condition_names: vec![], - }, - TestCase { - name: "sample #22", - expect: Some(vec!["./d?e?f"]), - exports_field: exports_field(json!({ - "./a?b?c/": "./" - })), - request: "./a?b?c/d?e?f", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #1", - expect: Some(vec!["./dist/index.js"]), - exports_field: exports_field(json!({ - ".": "./dist/index.js" - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #2", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./": "./", - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #3", - expect: Some(vec!["./dist/a.js"]), - exports_field: exports_field(json!({ - "./dist/": "./dist/", - "./dist/*": "./dist/*", - "./dist*": "./dist*", - "./dist/index.js": "./dist/a.js" - })), - request: "./dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #4", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./": { - "browser": [ - "./browser/" - ] - }, - "./*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "browser": "./index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #5", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./": { - "browser": [ - "./browser/" - ] - }, - "./*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "node": "./node.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #6", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - ".": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #7", - expect: Some(vec!["./src/index.js"]), // `enhanced_resolve` is `None` - exports_field: exports_field(json!({ - ".": { - "default": "./src/index.js", - "browser": "./index.js", - "node": "./src/node/index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #8", - expect: Some(vec!["./src/index.js"]), - exports_field: exports_field(json!({ - ".": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #9", - expect: Some(vec!["./index"]), - exports_field: exports_field(json!({ - ".": "./index" - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #10", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./index": "./index.js" - })), - request: "./index", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #11", - expect: Some(vec!["./foo.js"]), - exports_field: exports_field(json!({ - "./": "./", - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #12", - expect: Some(vec!["./foo/bar/baz.js"]), - exports_field: exports_field(json!({ - "./": "./", - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo/bar/baz.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #13", - expect: Some(vec!["./foo/bar/baz.js"]), - exports_field: exports_field(json!({ - "./": "./", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo/bar/baz.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #14", - expect: Some(vec!["./foo/bar/baz.js"]), - exports_field: exports_field(json!({ - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo/bar/baz.js", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #1", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "require": "./require.js" - }, { - "import": "./import.mjs" - }] - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #2", - expect: Some(vec!["./import.mjs"]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "require": "./require.js" - }, { - "import": "./import.mjs" - }] - })), - request: ".", - condition_names: vec!["import"], - }, - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./require.js"]), - exports_field: exports_field(json!({ - ".": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./import.mjs"]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "import": "./import.mjs" - }] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./require.js"]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "require": [ - "./require.js" - ] - }, { - "import": [ - "./import.mjs", - "./import.js" - ] - }] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./import.mjs"]), - exports_field: exports_field(json!({ - ".": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "./import.mjs", - "./import.js" - ] - } - ] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./import.js"]), - exports_field: exports_field(json!({ - ".": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "./import.js" - ] - } - ] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "mapping to a folder root #1", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./timezones": "./data/timezones/" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #2", - expect: None, - exports_field: exports_field(json!({ - "./timezones/": "./data/timezones" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #3", - expect: Some(vec!["./data/timezones/pdt/index.mjs"]), - exports_field: exports_field(json!({ - "./timezones/pdt/": "./data/timezones/pdt/" - })), - request: "./timezones/pdt/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #3 (wildcard)", - expect: Some(vec!["./data/timezones/pdt/index.mjs"]), - exports_field: exports_field(json!({ - "./timezones/pdt/*": "./data/timezones/pdt/*" - })), - request: "./timezones/pdt/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #4", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./": "./timezones/" - })), - request: "./pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #4 (wildcard)", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./*": "./timezones/*" - })), - request: "./pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #5", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./": "./" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #5 (wildcard)", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./*": "./*" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #6", - expect: None, - exports_field: exports_field(json!({ - "./": "." - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #6 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "./*": "." - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #7", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": "./" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #7 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": "./*" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #1", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./": "./", - "./dist/": "./lib/" - })), - request: "./dist/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #1 (wildcard)", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./*": "./*", - "./dist/*": "./lib/*" - })), - request: "./dist/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #2", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/": "./dist/utils/", - "./dist/": "./lib/" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #2 (wildcard)", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/*": "./dist/utils/*", - "./dist/*": "./lib/*" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #3", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/index.js": "./dist/utils/index.js", - "./dist/utils/": "./dist/utils/index.mjs", - "./dist/": "./lib/" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #3 (wildcard)", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/index.js": "./dist/utils/index.js", - "./dist/utils/*": "./dist/utils/index.mjs", - "./dist/*": "./lib/*" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #4", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./": { - "browser": "./browser/" - }, - "./dist/": "./lib/" - })), - request: "./dist/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "the longest matching path prefix is prioritized #4 (wildcard)", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./*": { - "browser": "./browser/*" - }, - "./dist/*": "./lib/*" - })), - request: "./dist/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #1", - // `lodash/` does not start with './' so fallbacks to util - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "conditional mapping folder #1", - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": [ - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #1 (wildcard)", - // `lodash/` does not start with './' so fallbacks to util - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": [ - "lodash/*", - "./utils/*" - ], - "node": [ - "./utils-node/*" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "conditional mapping folder #1 (wildcard)", - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": [ - "./utils/*" - ], - "node": [ - "./utils-node/*" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #2", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./node/" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "conditional mapping folder #2 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "webpack": "./wpk/*", - "browser": [ - "lodash/*", - "./utils/*" - ], - "node": [ - "./node/*" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "conditional mapping folder #3", - expect: Some(vec!["./wpk/index.mjs"]), - exports_field: exports_field(json!({ - "./utils/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils/" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "conditional mapping folder #3 (wildcard)", - expect: Some(vec!["./wpk/index.mjs"]), - exports_field: exports_field(json!({ - "./utils/*": { - "webpack": "./wpk/*", - "browser": [ - "lodash/*", - "./utils/*" - ], - "node": [ - "./utils/*" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "incorrect exports field #1", - expect: None, - exports_field: exports_field(json!({ - "/utils/": "./a/" - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #2", - expect: None, - exports_field: exports_field(json!({ - "./utils/": "/a/" - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #3", - expect: None, - exports_field: exports_field(json!({ - "/utils/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #4", - expect: None, - exports_field: exports_field(json!({ - "./utils/": { - "browser": "/a/", - "default": "/b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #4 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "/a/", - "default": "/b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #5", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index": "./a/index.js" - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index.mjs": "./a/index.js" - })), - request: "./utils/index", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #7", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #8", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index.mjs": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - // Requests that are not `./` does not apply to `package_exports_resolve` - // TestCase { - // name: "incorrect request #1", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": "./a/" - // })), - // request: "/utils/index.mjs", - // condition_names: vec![], - // }, - // TestCase { - // name: "incorrect request #2", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": { - // "browser": "./a/", - // "default": "./b/" - // } - // })), - // request: "/utils/index.mjs", - // condition_names: vec!["browser"], - // }, - // TestCase { - // name: "incorrect request #3", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": { - // "browser": "./a/", - // "default": "./b/" - // } - // })), - // request: "../utils/index.mjs", - // condition_names: vec!["browser"], - // }, - // TestCase { - // name: "incorrect request #4", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": { - // "browser": "./a/", - // "default": "./b/" - // } - // })), - // request: "/utils/index.mjs/", - // condition_names: vec!["browser"], - // }, - TestCase { - name: "backtracking package base #1", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./../../utils/": "./dist/" - })), - request: "./../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #1 (wildcard)", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./../../utils/*": "./dist/*" - })), - request: "./../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #2", - expect: None, - exports_field: exports_field(json!({ - "../../utils/": "./dist/" - })), - request: "../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #2 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "../../utils/*": "./dist/*" - })), - request: "../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #3", - expect: None, - exports_field: exports_field(json!({ - "./utils/": "../src/" - })), - request: "./utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #3 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "./utils/*": "../src/*" - })), - request: "./utils/index", - condition_names: vec![], - }, - // enhanced-resolve does not handle backtracking here - // TestCase { - // name: "backtracking package base #4", - // expect: Some(vec!["./../src/index"]), - // exports_field: exports_field(json!({ - // "./utils/": "./../src/" - // })), - // request: "./utils/index", - // condition_names: vec![], - // }, - // TestCase { - // name: "backtracking package base #4 (wildcard)", - // expect: Some(vec!["./../src/index"]), - // exports_field: exports_field(json!({ - // "./utils/*": "./../src/*" - // })), - // request: "./utils/index", - // condition_names: vec![], - // }, - // TestCase { - // name: "backtracking package base #5", - // expect: Some(vec!["./src/../index.js"]), - // exports_field: exports_field(json!({ - // "./utils/index": "./src/../index.js" - // })), - // request: "./utils/index", - // condition_names: vec![], - // }, - TestCase { - name: "backtracking package base #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/../utils/index": "./src/../index.js" - })), - request: "./utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #7", - expect: None, - exports_field: exports_field(json!({ - "./utils/": { - "browser": "../this/" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #7", - expect: None, - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "../this/*" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #8", - // We throw "InvalidPackageTarget" - // expect: Some(vec!["./utils/../index"]), - expect: None, - exports_field: exports_field(json!({ - "./utils/": { - "browser": "./utils/../" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #8 (wildcard)", - // We throw "InvalidPackageTarget" - // expect: Some(vec!["./utils/../index"]), - expect: None, - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "./utils/../*" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #9", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./": "./src/../../", - "./dist/": "./dist/" - })), - request: "./dist/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #9 (wildcard)", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./*": "./src/../../*", - "./dist/*": "./dist/*" - })), - request: "./dist/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking target folder #1", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../../index"]), - exports_field: exports_field(json!({ - "./utils/": "./dist/" - })), - request: "./utils/timezone/../../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #1 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../../index"]), - exports_field: exports_field(json!({ - "./utils/*": "./dist/*" - })), - request: "./utils/timezone/../../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #2", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../index"]), - exports_field: exports_field(json!({ - "./utils/": "./dist/" - })), - request: "./utils/timezone/../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #2 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../index"]), - exports_field: exports_field(json!({ - "./utils/*": "./dist/*" - })), - request: "./utils/timezone/../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #3", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/target/../../index"]), - exports_field: exports_field(json!({ - "./utils/": "./dist/target/" - })), - request: "./utils/../../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #3 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/target/../../index"]), - exports_field: exports_field(json!({ - "./utils/*": "./dist/target/*" - })), - request: "./utils/../../index", - condition_names: vec![], - }, - // enhanced-resolve does not handle `node_modules` in target - TestCase { - name: "nested node_modules path #1", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": "./node_modules/" - } - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #1 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "./node_modules/*" - } - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #2", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./utils/../node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/": "./utils/../node_modules/" - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "nested node_modules path #2 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./utils/../node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": "./utils/../node_modules/*" - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "nested mapping #1", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": "./", - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested mapping #1 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": "./*", - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "nested mapping #2 (wildcard)", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #2 (wildcard)", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "nested mapping #3", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["webpack"], - }, - TestCase { - name: "nested mapping #3 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["webpack"], - }, - TestCase { - name: "nested mapping #4", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["node", "browser"], - }, - TestCase { - name: "nested mapping #4 (wildcard)", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["node", "browser"], - }, - TestCase { - name: "nested mapping #5", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node"], - }, - TestCase { - name: "nested mapping #5 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": { - "webpack": [ - "./wpck/*" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node"], - }, - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - TestCase { - name: "nested mapping #6 (wildcard)", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": { - "webpack": [ - "./wpck/*" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #6 (wildcard)", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./node/*" - ], - "default": { - "node": { - "webpack": [ - "./wpck/*" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - TestCase { - name: "nested mapping #7", - expect: Some(vec!["./y.js"]), - exports_field: exports_field(json!({ - "./a.js": { - "abc": { - "def": "./x.js" - }, - "ghi": "./y.js" - } - })), - request: "./a.js", - condition_names: vec!["abc", "ghi"], - }, - TestCase { - name: "nested mapping #8", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./a.js": { - "abc": { - "def": "./x.js", - "default": [] - }, - "ghi": "./y.js" - } - })), - request: "./a.js", - condition_names: vec!["abc", "ghi"], - }, - TestCase { - name: "syntax sugar #1", - expect: Some(vec!["./main.js"]), - exports_field: exports_field(json!("./main.js")), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #2", - expect: Some(vec![]), - exports_field: exports_field(json!("./main.js")), - request: "./lib.js", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #3", - expect: Some(vec!["./a.js"]), - exports_field: exports_field(json!(["./a.js", "./b.js"])), - request: ".", - condition_names: vec![], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "syntax sugar #3", - expect: Some(vec!["./b.js"]), - exports_field: exports_field(json!(["./b.js"])), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #4", - expect: Some(vec![]), - exports_field: exports_field(json!(["./a.js", "./b.js"])), - request: "./lib.js", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #5", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "browser": { - "default": "./index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "syntax sugar #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "browser": { - "default": "./index.js" - } - })), - request: "./lib.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "syntax sugar #7", - expect: None, - exports_field: exports_field(json!({ - "./node": "./node.js", - "browser": { - "default": "./index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "syntax sugar #8", - expect: None, - exports_field: exports_field(json!({ - "browser": { - "default": "./index.js" - }, - "./node": "./node.js" - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #1", - expect: Some(vec!["./abc/d"]), - exports_field: exports_field(json!({ - "./ab*": "./ab/*", - "./abc*": "./abc/*", - "./a*": "./a/*" - })), - request: "./abcd", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #2", - expect: Some(vec!["./abc/d/e"]), - exports_field: exports_field(json!({ - "./ab*": "./ab/*", - "./abc*": "./abc/*", - "./a*": "./a/*" - })), - request: "./abcd/e", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #3", - expect: Some(vec!["./abc/d"]), - exports_field: exports_field(json!({ - "./x/ab*": "./ab/*", - "./x/abc*": "./abc/*", - "./x/a*": "./a/*" - })), - request: "./x/abcd", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #4", - expect: Some(vec!["./abc/d/e"]), - exports_field: exports_field(json!({ - "./x/ab*": "./ab/*", - "./x/abc*": "./abc/*", - "./x/a*": "./a/*" - })), - request: "./x/abcd/e", - condition_names: vec!["browser"], - }, - TestCase { - name: "path tree edge case #1", - expect: Some(vec!["./A/b/d.js"]), - exports_field: exports_field(json!({ - "./a/": "./A/", - "./a/b/c": "./c.js" - })), - request: "./a/b/d.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #1 (wildcard)", - expect: Some(vec!["./A/b/d.js"]), - exports_field: exports_field(json!({ - "./a/*": "./A/*", - "./a/b/c": "./c.js" - })), - request: "./a/b/d.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #2", - expect: Some(vec!["./A/c.js"]), - exports_field: exports_field(json!({ - "./a/": "./A/", - "./a/b": "./b.js" - })), - request: "./a/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #2 (wildcard)", - expect: Some(vec!["./A/c.js"]), - exports_field: exports_field(json!({ - "./a/*": "./A/*", - "./a/b": "./b.js" - })), - request: "./a/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #3", - expect: Some(vec!["./A/b/d/c.js"]), - exports_field: exports_field(json!({ - "./a/": "./A/", - "./a/b/c/d": "./c.js" - })), - request: "./a/b/d/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #3 (wildcard)", - expect: Some(vec!["./A/b/d/c.js"]), - exports_field: exports_field(json!({ - "./a/*": "./A/*", - "./a/b/c/d": "./c.js" - })), - request: "./a/b/d/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #1", - expect: Some(vec!["./A/b.js"]), - exports_field: exports_field(json!({ - "./a/*.js": "./A/*.js" - })), - request: "./a/b.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #2", - expect: Some(vec!["./A/b/c.js"]), - exports_field: exports_field(json!({ - "./a/*.js": "./A/*.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #3", - expect: Some(vec!["./A/b/c.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": "./A/*/c.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #4", - expect: Some(vec!["./A/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": "./A/*/*.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #5", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/*.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #5", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/*.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./lib/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #6", - expect: Some(vec!["./browser/foo/bar.js"]), - exports_field: exports_field(json!({ - "./lib/*/bar.js": { - "browser": [ - "./browser/*/bar.js" - ] - }, - "./dist/*/bar.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./lib/foo/bar.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #6", - expect: Some(vec!["./browser/foo.js"]), - exports_field: exports_field(json!({ - "./lib/*/bar.js": { - "browser": [ - "./browser/*/bar.js" - ] - }, - "./dist/*/bar.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./dist/foo/bar.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #7", - expect: Some(vec!["./browser/foo/default.js"]), - exports_field: exports_field(json!({ - "./lib/*/bar.js": { - "browser": [ - "./browser/*/bar.js" - ] - }, - "./dist/*/bar.js": { - "node": "./*.js", - "default": "./browser/*/default.js" - } - })), - request: "./dist/foo/bar.js", - condition_names: vec!["default"], - }, - TestCase { - name: "wildcard pattern #8", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": "./A/*/*/*.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #9", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": [ - "./A/*/*/*.js", - "./B/*/*/*.js" - ] - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "wildcard pattern #9", - expect: Some(vec!["./B/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": [ - "./B/*/*/*.js" - ] - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #10", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/foo-*/c.js": "./A/*/*/*.js" - })), - request: "./a/foo-b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #11", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*-foo/c.js": "./A/*/*/*.js" - })), - request: "./a/b-foo/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #12", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/foo-*-foo/c.js": "./A/*/*/*.js" - })), - request: "./a/foo-b-foo/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #13", - expect: Some(vec!["./A/b/c/d.js"]), - exports_field: exports_field(json!({ - "./a/foo-*-foo/c.js": "./A/b/c/d.js" - })), - request: "./a/foo-b-foo/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #14", - expect: Some(vec!["./A/b/c/*.js"]), - exports_field: exports_field(json!({ - "./a/foo-foo/c.js": "./A/b/c/*.js" - })), - request: "./a/foo-foo/c.js", - condition_names: vec![], - }, - ]; - - for case in test_cases { - let resolved = Resolver::new(ResolveOptions { - condition_names: case - .condition_names - .iter() - .map(ToString::to_string) - .collect::>(), - ..ResolveOptions::default() - }) - .package_exports_resolve( - Path::new(""), - case.request, - &case.exports_field, - &mut Ctx::default(), - ) - .map(|p| p.map(|p| p.to_path_buf())); - if let Some(expect) = case.expect { - if expect.is_empty() { - assert!( - matches!(resolved, Err(ResolveError::PackagePathNotExported(_, _))), - "{} {:?}", - &case.name, - &resolved - ); - } else { - for expect in expect { - assert_eq!(resolved, Ok(Some(Path::new(expect).normalize())), "{}", &case.name); - } - } - } else { - assert!(resolved.is_err(), "{} {resolved:?}", &case.name); - } - } -} diff --git a/src/tests/extension_alias.rs b/src/tests/extension_alias.rs deleted file mode 100644 index 86afab73..00000000 --- a/src/tests/extension_alias.rs +++ /dev/null @@ -1,66 +0,0 @@ -//! - -use crate::{ResolveError, ResolveOptions, Resolver}; - -#[test] -fn extension_alias() { - let f = super::fixture().join("extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - extension_alias: vec![ - (".js".into(), vec![".ts".into(), ".js".into()]), - (".mjs".into(), vec![".mts".into()]), - ], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should alias fully specified file", f.clone(), "./index.js", f.join("index.ts")), - ("should alias fully specified file when there are two alternatives", f.clone(), "./dir/index.js", f.join("dir/index.ts")), - ("should also allow the second alternative", f.clone(), "./dir2/index.js", f.join("dir2/index.js")), - ("should support alias option without an array", f.clone(), "./dir2/index.mjs", f.join("dir2/index.mts")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } - - #[rustfmt::skip] - let fail = [ - ("should not allow to fallback to the original extension or add extensions", f, "./index.mjs"), - ]; - - for (comment, path, request) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!(resolution, Err(ResolveError::ExtensionAlias), "{comment} {path:?} {request}"); - } -} - -// should not apply extension alias to extensions or mainFiles field -#[test] -fn not_apply_to_extension_nor_main_files() { - let f = super::fixture().join("extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - extension_alias: vec![(".js".into(), vec![])], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("directory", f.clone(), "./dir2", "dir2/index.js"), - ("file", f.clone(), "./dir2/index", "dir2/index.js"), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - let expected = f.join(expected); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} diff --git a/src/tests/extensions.rs b/src/tests/extensions.rs deleted file mode 100644 index 1ebd86f4..00000000 --- a/src/tests/extensions.rs +++ /dev/null @@ -1,125 +0,0 @@ -//! - -use crate::{EnforceExtension, Resolution, ResolveContext, ResolveError, ResolveOptions, Resolver}; -use rustc_hash::FxHashSet; - -#[test] -fn extensions() { - let f = super::fixture().join("extensions"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".ts".into(), ".js".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve according to order of provided extensions", "./foo", "foo.ts"), - ("should resolve according to order of provided extensions (dir index)", "./dir", "dir/index.ts"), - ("should resolve according to main field in module root", ".", "index.js"), - // This is a core module - // ("should resolve single file module before directory", "module", "node_modules/module.js"), - ("should resolve trailing slash directory before single file", "module/", "node_modules/module/index.ts"), - ]; - - for (comment, request, expected_path) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - let expected = f.join(expected_path); - assert_eq!(resolved_path, Ok(expected), "{comment} {request} {expected_path}"); - } - - #[rustfmt::skip] - let fail = [ - ("not resolve to file when request has a trailing slash (relative)", "./foo.js/", "./foo.js/".into()) - ]; - - for (comment, request, expected_error) in fail { - let resolution = resolver.resolve(&f, request); - let error = ResolveError::NotFound(expected_error); - assert_eq!(resolution, Err(error), "{comment} {request} {resolution:?}"); - } -} - -// should default enforceExtension to true when extensions includes an empty string -#[test] -fn default_enforce_extension() { - let f = super::fixture().join("extensions"); - - let mut ctx = ResolveContext::default(); - let resolved = Resolver::new(ResolveOptions { - extensions: vec![".ts".into(), String::new(), ".js".into()], - ..ResolveOptions::default() - }) - .resolve_with_context(&f, "./foo", &mut ctx); - - assert_eq!(resolved.map(Resolution::into_path_buf), Ok(f.join("foo.ts"))); - assert_eq!( - ctx.file_dependencies, - FxHashSet::from_iter([f.join("foo.ts"), f.join("package.json")]) - ); - assert!(ctx.missing_dependencies.is_empty()); -} - -// should respect enforceExtension when extensions includes an empty string -#[test] -fn respect_enforce_extension() { - let f = super::fixture().join("extensions"); - - let mut ctx = ResolveContext::default(); - let resolved = Resolver::new(ResolveOptions { - enforce_extension: EnforceExtension::Disabled, - extensions: vec![".ts".into(), String::new(), ".js".into()], - ..ResolveOptions::default() - }) - .resolve_with_context(&f, "./foo", &mut ctx); - - assert_eq!(resolved.map(Resolution::into_path_buf), Ok(f.join("foo.ts"))); - assert_eq!( - ctx.file_dependencies, - FxHashSet::from_iter([f.join("foo.ts"), f.join("package.json")]) - ); - assert_eq!(ctx.missing_dependencies, FxHashSet::from_iter([f.join("foo")])); -} - -#[test] -fn multi_dot_extension() { - let f = super::fixture().join("extensions"); - - let resolver = Resolver::new(ResolveOptions { - // Test for `.d.ts`, not part of enhanced-resolve. - extensions: vec![".a.b.c".into(), ".d.ts".into(), ".ts".into(), ".js".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve according to order of provided extensions", "./foo", "foo.ts"), - ("should resolve file with extension", "./app.module", "app.module.js") - ]; - - for (comment, request, expected_path) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - let expected = f.join(expected_path); - assert_eq!(resolved_path, Ok(expected), "{comment} {request} {expected_path}"); - } - - #[rustfmt::skip] - let fail = [ - ("not resolve to file", "./index.", "./index.".into()) - ]; - - for (comment, request, expected_error) in fail { - let resolution = resolver.resolve(&f, request); - let error = ResolveError::NotFound(expected_error); - assert_eq!(resolution, Err(error), "{comment} {request} {resolution:?}"); - } -} - -#[test] -#[should_panic = "All extensions must start with a leading dot"] -fn without_leading_dot() { - Resolver::new(ResolveOptions { - extensions: vec!["ts".into(), "js".into()], - ..ResolveOptions::default() - }); -} diff --git a/src/tests/fallback.rs b/src/tests/fallback.rs deleted file mode 100644 index 3da2d767..00000000 --- a/src/tests/fallback.rs +++ /dev/null @@ -1,100 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/fallback.test.js - -#[test] -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -fn fallback() { - use super::memory_fs::MemoryFS; - use crate::{AliasValue, ResolveError, ResolveOptions, ResolverGeneric}; - use std::path::{Path, PathBuf}; - - let f = Path::new("/"); - - let file_system = MemoryFS::new(&[ - ("/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", ""), - ]); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - fallback: vec![ - ("aliasA".into(), vec![AliasValue::Path("a".into())]), - ("b$".into(), vec![AliasValue::Path("a/index".into())]), - ("c$".into(), vec![AliasValue::Path("/a/index".into())]), - ( - "multiAlias".into(), - vec![ - AliasValue::Path("b".into()), - AliasValue::Path("c".into()), - AliasValue::Path("d".into()), - AliasValue::Path("e".into()), - AliasValue::Path("a".into()), - ], - ), - ("recursive".into(), vec![AliasValue::Path("recursive/dir".into())]), - ("/d/dir".into(), vec![AliasValue::Path("/c/dir".into())]), - ("/d/index.js".into(), vec![AliasValue::Path("/c/index".into())]), - ("ignored".into(), vec![AliasValue::Ignore]), - ("node:path".into(), vec![AliasValue::Ignore]), - ], - modules: vec!["/".into()], - ..ResolveOptions::default() - }, - ); - - #[rustfmt::skip] - let pass = [ - ("should resolve a not aliased module 1", "a", "/a/index"), - ("should resolve a not aliased module 2", "a/index", "/a/index"), - ("should resolve a not aliased module 3", "a/dir", "/a/dir/index"), - ("should resolve a not aliased module 4", "a/dir/index", "/a/dir/index"), - ("should resolve an fallback module 1", "aliasA", "/a/index"), - ("should resolve an fallback module 2", "aliasA/index", "/a/index"), - ("should resolve an fallback module 3", "aliasA/dir", "/a/dir/index"), - ("should resolve an fallback module 4", "aliasA/dir/index", "/a/dir/index"), - ("should resolve a recursive aliased module 1", "recursive", "/recursive/index"), - ("should resolve a recursive aliased module 2", "recursive/index", "/recursive/index"), - ("should resolve a recursive aliased module 3", "recursive/dir", "/recursive/dir/index"), - ("should resolve a recursive aliased module 4", "recursive/dir/index", "/recursive/dir/index"), - ("should resolve a recursive aliased module 5", "recursive/file", "/recursive/dir/file"), - ("should resolve a file aliased module with a query 1", "b?query", "/b/index?query"), - ("should resolve a file aliased module with a query 2", "c?query", "/c/index?query"), - ("should resolve a path in a file aliased module 1", "b/index", "/b/index"), - ("should resolve a path in a file aliased module 2", "b/dir", "/b/dir/index"), - ("should resolve a path in a file aliased module 3", "b/dir/index", "/b/dir/index"), - ("should resolve a path in a file aliased module 4", "c/index", "/c/index"), - ("should resolve a path in a file aliased module 5", "c/dir", "/c/dir/index"), - ("should resolve a path in a file aliased module 6", "c/dir/index", "/c/dir/index"), - ("should resolve a file in multiple aliased dirs 1", "multiAlias/dir/file", "/e/dir/file"), - ("should resolve a file in multiple aliased dirs 2", "multiAlias/anotherDir", "/e/anotherDir/index"), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - - #[rustfmt::skip] - let ignore = [ - ("should resolve an ignore module", "ignored", ResolveError::Ignored(f.join("ignored"))), - ("should resolve node: builtin module", "node:path", ResolveError::Ignored(PathBuf::from("/node:path"))), - ]; - - for (comment, request, expected) in ignore { - let resolution = resolver.resolve(f, request); - assert_eq!(resolution, Err(expected), "{comment} {request}"); - } -} diff --git a/src/tests/full_specified.rs b/src/tests/full_specified.rs deleted file mode 100644 index a70c0191..00000000 --- a/src/tests/full_specified.rs +++ /dev/null @@ -1,113 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/fullSpecified.test.js - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows { - use std::path::PathBuf; - - use crate::{AliasValue, ResolveOptions, ResolverGeneric}; - - use super::super::memory_fs::MemoryFS; - - fn file_system() -> MemoryFS { - MemoryFS::new(&[ - ("/a/node_modules/package1/index.js", ""), - ("/a/node_modules/package1/file.js", ""), - ("/a/node_modules/package2/package.json", r#"{"main":"a"}"#), - ("/a/node_modules/package2/a.js", ""), - ("/a/node_modules/package3/package.json", r#"{"main":"dir"}"#), - ("/a/node_modules/package3/dir/index.js", ""), - ("/a/node_modules/package4/package.json", r#"{"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", ""), - ]) - } - - #[test] - fn test() { - let file_system = file_system(); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - alias: vec![ - ("alias1".into(), vec![AliasValue::from("/a/abc")]), - ("alias2".into(), vec![AliasValue::from("/a")]), - ], - alias_fields: vec![vec!["browser".into()]], - fully_specified: true, - ..ResolveOptions::default() - }, - ); - - let failing_resolves = [ - ("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"), - ]; - - for (comment, request) in failing_resolves { - let resolution = resolver.resolve("/a", request); - assert!(resolution.is_err(), "{comment} {request}"); - } - - let successful_resolves = [ - ("fully relative", "./abc.js", "/a/abc.js"), - ("fully absolute", "/a/abc.js", "/a/abc.js"), - ("fully relative in package", "package1/file.js", "/a/node_modules/package1/file.js"), - ("extensions in mainFiles", "package1", "/a/node_modules/package1/index.js"), - ("extensions in mainFields", "package2", "/a/node_modules/package2/a.js"), - ("extensions in alias", "alias1", "/a/abc.js"), - ("directories in alias", "alias2", "/a/index.js"), - ("directories in packages", "package3", "/a/node_modules/package3/dir/index.js"), - ("extensions in aliasFields", "package4/a.js", "/a/node_modules/package4/b.js"), - ]; - - for (comment, request, expected) in successful_resolves { - let resolution = resolver.resolve("/a", request).map(|r| r.full_path()); - assert_eq!(resolution, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - } - - #[test] - #[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. - fn resolve_to_context() { - let file_system = file_system(); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - alias: vec![ - ("alias1".into(), vec![AliasValue::from("/a/abc")]), - ("alias2".into(), vec![AliasValue::from("/a")]), - ], - alias_fields: vec![vec!["browser".into()]], - fully_specified: true, - resolve_to_context: true, - ..ResolveOptions::default() - }, - ); - - let successful_resolves = [ - ("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", "/a/node_modules/package3/dir"), - ]; - - for (comment, request, expected) in successful_resolves { - let resolution = resolver.resolve("/a", request).map(|r| r.full_path()); - assert_eq!(resolution, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - } -} diff --git a/src/tests/imports_field.rs b/src/tests/imports_field.rs deleted file mode 100644 index c928627a..00000000 --- a/src/tests/imports_field.rs +++ /dev/null @@ -1,1320 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/importsField.test.js -//! -//! The huge imports field test cases are at the bottom of this file. - -use serde_json::json; - -use crate::{Ctx, JSONMap, PathUtil, ResolveError, ResolveOptions, Resolver}; -use std::path::Path; - -#[test] -fn test_simple() { - let f = super::fixture().join("imports-field"); - let f2 = super::fixture().join("imports-exports-wildcard/node_modules/m/"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve using imports field instead of self-referencing", f.clone(), "#imports-field", f.join("b.js")), - ("should resolve using imports field instead of self-referencing for a subpath", f.join("dir"), "#imports-field", f.join("b.js")), - ("should resolve package #1", f.clone(), "#a/dist/main.js", f.join("node_modules/a/lib/lib2/main.js")), - ("should resolve package #3", f.clone(), "#ccc/index.js", f.join("node_modules/c/index.js")), - ("should resolve package #4", f.clone(), "#c", f.join("node_modules/c/index.js")), - ("should resolve with wildcard pattern", f2.clone(), "#internal/i.js", f2.join("src/internal/i.js")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } - - // Note added: - // * should resolve absolute path as an imports field target - // * should log the correct info - - #[rustfmt::skip] - let fail = [ - ("should disallow resolve out of package scope", f.clone(), "#b", ResolveError::InvalidPackageTarget("../b.js".to_string(), "#b".to_string(), f.join("package.json"))), - ("should resolve package #2", f.clone(), "#a", ResolveError::PackageImportNotDefined("#a".to_string(), f.join("package.json"))), - ]; - - for (comment, path, request, error) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!(resolution, Err(error), "{comment} {path:?} {request}"); - } -} - -#[test] -fn shared_resolvers() { - let f = super::fixture().join("imports-field"); - - // field name #1 - let resolver1 = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - imports_fields: vec![vec!["imports".into()]], - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - let resolved_path = resolver1.resolve(&f, "#imports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("b.js"))); - - // field name #2 - let resolver2 = resolver1.clone_with_options(ResolveOptions { - imports_fields: vec![vec!["other".into(), "imports".into()]], - ..ResolveOptions::default() - }); - - let resolved_path = resolver2.resolve(&f, "#b").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("a.js"))); -} - -// Small script for generating the test cases from enhanced_resolve -// for (c of testCases) { -// console.log("TestCase {") -// console.log(`name: ${JSON.stringify(c.name)},`) -// if (c.expect instanceof Error) { -// console.log(`expect: None,`) -// } else { -// console.log(`expect: Some(vec!${JSON.stringify(c.expect)}),`) -// } -// console.log(`imports_field: imports_field(json!(${JSON.stringify(c.suite[0], null, 2)})),`) -// console.log(`request: "${c.suite[1]}",`) -// console.log(`condition_names: vec!${JSON.stringify(c.suite[2])},`) -// console.log("},") -// } - -struct TestCase { - name: &'static str, - expect: Option>, - imports_field: JSONMap, - request: &'static str, - condition_names: Vec<&'static str>, -} - -#[allow(clippy::needless_pass_by_value)] -fn imports_field(value: serde_json::Value) -> JSONMap { - let s = serde_json::to_string(&value).unwrap(); - serde_json::from_str(&s).unwrap() -} - -#[test] -fn test_cases() { - let test_cases = [ - TestCase { - name: "sample #1", - expect: Some(vec!["./dist/test/file.js"]), - imports_field: imports_field(json!({ - "#abc/": { - "import": [ - "./dist/", - "./src/" - ], - "webpack": "./wp/" - }, - "#abc": "./main.js" - })), - request: "#abc/test/file.js", - condition_names: vec!["import", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "sample #1", - expect: Some(vec!["./src/test/file.js"]), - imports_field: imports_field(json!({ - "#abc/": { - "import": [ - "./src/" - ], - "webpack": "./wp/" - }, - "#abc": "./main.js" - })), - request: "#abc/test/file.js", - condition_names: vec!["import", "webpack"], - }, - TestCase { - name: "sample #2", - expect: Some(vec!["./data/timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#1/timezones/": "./data/timezones/" - })), - request: "#1/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #3", - expect: Some(vec!["./data/timezones/timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#aaa/": "./data/timezones/", - "#a/": "./data/timezones/" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #4", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/lib/": { - "browser": [ - "./browser/" - ] - }, - "#a/dist/index.js": { - "node": "./index.js" - } - })), - request: "#a/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #5", - expect: Some(vec!["./browser/index.js"]), - imports_field: imports_field(json!({ - "#a/lib/": { - "browser": [ - "./browser/" - ] - }, - "#a/dist/index.js": { - "node": "./index.js", - "default": "./browser/index.js" - } - })), - request: "#a/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #6", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/dist/a": "./dist/index.js" - })), - request: "#a/dist/aaa", - condition_names: vec![], - }, - TestCase { - name: "sample #7", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/a/a/": "./dist/index.js" - })), - request: "#a/a/a", - condition_names: vec![], - }, - TestCase { - name: "sample #8", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": "./index.js" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #9", - expect: Some(vec!["./main.js"]), - imports_field: imports_field(json!({ - "#a/index.js": "./main.js" - })), - request: "#a/index.js", - condition_names: vec![], - }, - TestCase { - name: "sample #10", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #11", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/bar#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #12", - expect: Some(vec!["./ok.js#abc"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/ok.js#abc", - condition_names: vec![], - }, - TestCase { - name: "sample #13", - expect: Some(vec!["./ok.js?abc"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/ok.js?abc", - condition_names: vec![], - }, - TestCase { - name: "sample #14", - expect: Some(vec!["./🎉.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/🎉.js", - condition_names: vec![], - }, - TestCase { - name: "sample #15", - expect: Some(vec!["./%F0%9F%8E%89.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/%F0%9F%8E%89.js", - condition_names: vec![], - }, - TestCase { - name: "sample #16", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/🎉", - condition_names: vec![], - }, - TestCase { - name: "sample #17", - expect: Some(vec!["./other.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/%F0%9F%8E%89", - condition_names: vec![], - }, - TestCase { - name: "sample #18", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/module", - condition_names: vec![], - }, - TestCase { - name: "sample #19", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/module#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #20", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/module?foo", - condition_names: vec![], - }, - TestCase { - name: "sample #21", - expect: Some(vec!["./d?e?f"]), - imports_field: imports_field(json!({ - "#a/a?b?c/": "./" - })), - request: "#a/a?b?c/d?e?f", - condition_names: vec![], - }, - TestCase { - name: "sample #22", - // We throw InvalidPackageTarget - expect: None, - // expect: Some(vec!["/user/a/index"]), - imports_field: imports_field(json!({ - "#a/": "/user/a/" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #1", - expect: Some(vec!["./A/b/d.js"]), - imports_field: imports_field(json!({ - "#a/": "./A/", - "#a/b/c": "./c.js" - })), - request: "#a/b/d.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #2", - expect: Some(vec!["./A/c.js"]), - imports_field: imports_field(json!({ - "#a/": "./A/", - "#a/b": "./b.js" - })), - request: "#a/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #3", - expect: Some(vec!["./A/b/c/d.js"]), - imports_field: imports_field(json!({ - "#a/": "./A/", - "#a/b/c/d": "./c.js" - })), - request: "#a/b/c/d.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #1", - expect: Some(vec!["./dist/index.js"]), - imports_field: imports_field(json!({ - "#a": "./dist/index.js" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #2", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": "./" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #3", - expect: Some(vec!["./dist/a.js"]), - imports_field: imports_field(json!({ - "#a/": "./dist/", - "#a/index.js": "./dist/a.js" - })), - request: "#a/index.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #4", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "./browser/" - ] - }, - "#a/index.js": { - "browser": "./index.js" - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #5", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "./browser/" - ] - }, - "#a/index.js": { - "node": "./node.js" - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #6", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: "#a", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #7", - expect: Some(vec!["./src/index.js"]), // `enhanced_resolve` is `None` - imports_field: imports_field(json!({ - "#a": { - "default": "./src/index.js", - "browser": "./index.js", - "node": "./src/node/index.js" - } - })), - request: "#a", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #8", - expect: Some(vec!["./src/index.js"]), - imports_field: imports_field(json!({ - "#a": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #9", - expect: Some(vec!["./index"]), - imports_field: imports_field(json!({ - "#a": "./index" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #10", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/index": "./index.js" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #11", - // We throw InvalidPackageTarget - // expect: Some(vec!["b"]), - expect: None, - imports_field: imports_field(json!({ - "#a": "b" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #12", - // We throw InvalidPackageTarget - // expect: Some(vec!["b/index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "b/" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #13", - // We throw InvalidPackageTarget - // expect: Some(vec!["b#anotherhashishere"]), - expect: None, - imports_field: imports_field(json!({ - "#a?q=a#hashishere": "b#anotherhashishere" - })), - request: "#a?q=a#hashishere", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #1", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #2", - expect: Some(vec!["./import.mjs"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec!["import"], - }, - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./require.js"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./import.mjs"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./require.js"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": [ - "./require.js" - ] - }, - { - "import": [ - "./import.mjs", - "#b/import.js" - ] - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./import.mjs"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "./import.mjs", - "#b/import.js" - ] - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "#b/import.js" - ] - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "mapping to a folder root #1", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#timezones": "./data/timezones/" - })), - request: "#timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #2", - expect: None, - imports_field: imports_field(json!({ - "#timezones/": "./data/timezones" - })), - request: "#timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #3", - expect: Some(vec!["./data/timezones/pdt/index.mjs"]), - imports_field: imports_field(json!({ - "#timezones/pdt/": "./data/timezones/pdt/" - })), - request: "#timezones/pdt/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #4", - expect: Some(vec!["./timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#a/": "./timezones/" - })), - request: "#a/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #5", - expect: Some(vec!["./timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#a/": "./" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #6", - expect: None, - imports_field: imports_field(json!({ - "#a/": "." - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #7", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": "./" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #1", - expect: Some(vec!["./lib/index.mjs"]), - imports_field: imports_field(json!({ - "#a/": "./", - "#a/dist/": "./lib/" - })), - request: "#a/dist/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #2", - expect: Some(vec!["./dist/utils/index.js"]), - imports_field: imports_field(json!({ - "#a/dist/utils/": "./dist/utils/", - "#a/dist/": "./lib/" - })), - request: "#a/dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #3", - expect: Some(vec!["./dist/utils/index.js"]), - imports_field: imports_field(json!({ - "#a/dist/utils/index.js": "./dist/utils/index.js", - "#a/dist/utils/": "./dist/utils/index.mjs", - "#a/dist/": "./lib/" - })), - request: "#a/dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #4", - expect: Some(vec!["./lib/index.mjs"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./browser/" - }, - "#a/dist/": "./lib/" - })), - request: "#a/dist/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #1", - // This behaves differently from enhanced_resolve, because `lodash/` is an an InvalidPackageConfig - // expect: Some(vec!["lodash/index.js"]), - expect: Some(vec!["./utils/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "conditional mapping folder #1", - expect: Some(vec!["./utils/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #2", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./node/" - ] - } - })), - request: "#a/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "conditional mapping folder #3", - expect: Some(vec!["./wpk/index.mjs"]), - imports_field: imports_field(json!({ - "#a/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils/" - ] - } - })), - request: "#a/index.mjs", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "incorrect exports field #1", - // We throw `PackageImportNotDefined` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "/utils/": "./a/" - })), - request: "#a/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #2", - // We throw `PackageImportNotDefined` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "/utils/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#a/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #3", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index": "./a/index.js" - })), - request: "#a/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #4", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index.mjs": "./a/index.js" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #5", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "#a/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #6", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index.mjs": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "#a/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #1", - // We don't throw in `package_imports_exports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": "./a/" - })), - request: "/utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect request #2", - // We don't throw in `package_imports_exports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #3", - // We don't throw in `package_imports_exports_resolve`, it's thrown in `package_imports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #4", - // We don't throw in `package_imports_exports_resolve`, it's thrown in `package_imports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#/", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #5", - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#a/", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #1", - // expect: Some(vec!["./dist/index"]), - expect: Some(vec!["dist/index"]), - imports_field: imports_field(json!({ - "#a/../../utils/": "./dist/" - })), - request: "#a/../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #2", - // We throw InvalidPackageTarget - // expect: Some(vec!["./dist/../../utils/index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "./dist/" - })), - request: "#a/../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #3", - // We throw InvalidPackageTarget - // expect: Some(vec!["../src/index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "../src/" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #4", - // We throw InvalidPackageTarget - // expect: Some(vec!["./utils/../../../index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": { - "browser": "./utils/../../../" - } - })), - request: "#a/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #1", - // expect: Some(vec!["moment/node_modules/lodash/dist/index.js"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": { - "browser": "moment/node_modules/" - } - })), - request: "#a/lodash/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #2", - // We throw InvalidPackageTarget - // expect: Some(vec!["../node_modules/lodash/dist/index.js"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "../node_modules/" - })), - request: "#a/lodash/dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "nested mapping #1", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": "./", - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./node/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "nested mapping #3", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["webpack"], - }, - TestCase { - name: "nested mapping #4", - // We throw NotFound - // expect: Some(vec!["moment/node/index.js"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "moment/node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["node", "browser"], - }, - TestCase { - name: "nested mapping #5", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "node"], - }, - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./node/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - TestCase { - name: "nested mapping #7", - expect: Some(vec!["./y.js"]), - imports_field: imports_field(json!({ - "#a": { - "abc": { - "def": "./x.js" - }, - "ghi": "./y.js" - } - })), - request: "#a", - condition_names: vec!["abc", "ghi"], - }, - TestCase { - name: "nested mapping #8", - // We throw PackageImportNotDefined - // expect: Some(vec![]), - expect: None, - imports_field: imports_field(json!({ - "#a": { - "abc": { - "def": "./x.js", - "default": [] - }, - "ghi": "./y.js" - } - })), - request: "#a", - condition_names: vec!["abc", "ghi"], - }, - ]; - - for case in test_cases { - let resolved = Resolver::default() - .package_imports_exports_resolve( - case.request, - &case.imports_field, - Path::new(""), - true, - &case.condition_names.iter().map(ToString::to_string).collect::>(), - &mut Ctx::default(), - ) - .map(|p| p.map(|p| p.to_path_buf())); - if let Some(expect) = case.expect { - if expect.is_empty() { - assert!(matches!(resolved, Ok(None)), "{} {:?}", &case.name, &resolved); - } else { - for expect in expect { - assert_eq!(resolved, Ok(Some(Path::new(expect).normalize())), "{}", &case.name); - } - } - } else { - assert!(resolved.is_err(), "{} {resolved:?}", &case.name); - } - } -} diff --git a/src/tests/incorrect_description_file.rs b/src/tests/incorrect_description_file.rs deleted file mode 100644 index e2caecbb..00000000 --- a/src/tests/incorrect_description_file.rs +++ /dev/null @@ -1,65 +0,0 @@ -//! - -use rustc_hash::FxHashSet; - -use crate::{JSONError, Resolution, ResolveContext, ResolveError, ResolveOptions, Resolver}; - -// should not resolve main in incorrect description file #1 -#[test] -fn incorrect_description_file_1() { - let f = super::fixture().join("incorrect-package"); - let mut ctx = ResolveContext::default(); - let resolution = Resolver::default().resolve_with_context(f.join("pack1"), ".", &mut ctx); - let error = ResolveError::JSON(JSONError { - path: f.join("pack1/package.json"), - message: String::from("EOF while parsing a value at line 3 column 0"), - line: 3, - column: 0, - }); - assert_eq!(resolution, Err(error)); - assert_eq!( - ctx.file_dependencies, - FxHashSet::from_iter([f.join("pack1"), f.join("pack1/package.json")]) - ); - assert!(!ctx.missing_dependencies.is_empty()); -} - -// should not resolve main in incorrect description file #2 -#[test] -fn incorrect_description_file_2() { - let f = super::fixture().join("incorrect-package"); - let resolution = Resolver::default().resolve(f.join("pack2"), "."); - let error = ResolveError::JSON(JSONError { - path: f.join("pack2/package.json"), - message: String::from("EOF while parsing a value at line 1 column 0"), - line: 1, - column: 0, - }); - assert_eq!(resolution, Err(error)); -} - -// should not resolve main in incorrect description file #3 -#[test] -fn incorrect_description_file_3() { - let f = super::fixture().join("incorrect-package"); - let resolution = Resolver::default().resolve(f.join("pack2"), "."); - assert!(resolution.is_err()); -} - -// `enhanced_resolve` does not have this test case -#[test] -fn no_description_file() { - let f = super::fixture_root().join("enhanced_resolve"); - - // has description file - let resolver = Resolver::default(); - assert_eq!( - resolver.resolve(&f, ".").map(Resolution::into_path_buf), - Ok(f.join("lib/index.js")) - ); - - // without description file - let resolver = - Resolver::new(ResolveOptions { description_files: vec![], ..ResolveOptions::default() }); - assert_eq!(resolver.resolve(&f, "."), Err(ResolveError::NotFound(".".into()))); -} diff --git a/src/tests/main_field.rs b/src/tests/main_field.rs deleted file mode 100644 index 3cadc8ce..00000000 --- a/src/tests/main_field.rs +++ /dev/null @@ -1,24 +0,0 @@ -//! Not part of enhanced_resolve's test suite - -use crate::{ResolveOptions, Resolver}; - -#[test] -fn test() { - let f = super::fixture().join("restrictions"); - - let resolver1 = Resolver::new(ResolveOptions { - main_fields: vec!["style".into()], - ..ResolveOptions::default() - }); - - let resolution = resolver1.resolve(&f, "pck2").map(|r| r.full_path()); - assert_eq!(resolution, Ok(f.join("node_modules/pck2/index.css"))); - - let resolver2 = resolver1.clone_with_options(ResolveOptions { - main_fields: vec!["module".into(), "main".into()], - ..ResolveOptions::default() - }); - - let resolution = resolver2.resolve(&f, "pck2").map(|r| r.full_path()); - assert_eq!(resolution, Ok(f.join("node_modules/pck2/module.js"))); -} diff --git a/src/tests/memory_fs.rs b/src/tests/memory_fs.rs deleted file mode 100644 index e4116609..00000000 --- a/src/tests/memory_fs.rs +++ /dev/null @@ -1,74 +0,0 @@ -use std::{ - io, - path::{Path, PathBuf}, -}; - -use crate::{FileMetadata, FileSystem}; - -#[derive(Default)] -pub struct MemoryFS { - fs: vfs::MemoryFS, -} - -impl MemoryFS { - /// # Panics - /// - /// * Fails to create directory - /// * Fails to write file - #[allow(dead_code)] - pub fn new(data: &[(&'static str, &'static str)]) -> Self { - let mut fs = Self { fs: vfs::MemoryFS::default() }; - for (path, content) in data { - fs.add_file(Path::new(path), content); - } - fs - } - - #[allow(dead_code)] - pub fn add_file(&mut self, path: &Path, content: &str) { - use vfs::FileSystem; - let fs = &mut self.fs; - // Create all parent directories - for path in path.ancestors().collect::>().iter().rev() { - let path = path.to_string_lossy(); - if !fs.exists(path.as_ref()).unwrap() { - fs.create_dir(path.as_ref()).unwrap(); - } - } - // Create file - let mut file = fs.create_file(path.to_string_lossy().as_ref()).unwrap(); - file.write_all(content.as_bytes()).unwrap(); - } -} - -impl FileSystem for MemoryFS { - fn read_to_string(&self, path: &Path) -> io::Result { - use vfs::FileSystem; - let mut file = self - .fs - .open_file(path.to_string_lossy().as_ref()) - .map_err(|err| io::Error::new(io::ErrorKind::NotFound, err))?; - let mut buffer = String::new(); - file.read_to_string(&mut buffer).unwrap(); - Ok(buffer) - } - - fn metadata(&self, path: &Path) -> io::Result { - use vfs::FileSystem; - let metadata = self - .fs - .metadata(path.to_string_lossy().as_ref()) - .map_err(|err| io::Error::new(io::ErrorKind::NotFound, err))?; - let is_file = metadata.file_type == vfs::VfsFileType::File; - let is_dir = metadata.file_type == vfs::VfsFileType::Directory; - Ok(FileMetadata::new(is_file, is_dir, false)) - } - - fn symlink_metadata(&self, path: &Path) -> io::Result { - self.metadata(path) - } - - fn canonicalize(&self, _path: &Path) -> io::Result { - Err(io::Error::new(io::ErrorKind::NotFound, "not a symlink")) - } -} diff --git a/src/tests/missing.rs b/src/tests/missing.rs deleted file mode 100644 index 4bf611ef..00000000 --- a/src/tests/missing.rs +++ /dev/null @@ -1,106 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/missing.test.js - -use normalize_path::NormalizePath; - -use crate::{AliasValue, ResolveContext, ResolveOptions, Resolver}; - -#[test] -fn test() { - let f = super::fixture(); - - let data = [ - ( - "./missing-file", - vec![f.join("missing-file"), f.join("missing-file.js"), f.join("missing-file.node")], - ), - ( - "missing-module", - vec![ - f.join("node_modules/missing-module"), - f.parent().unwrap().join("node_modules"), // enhanced-resolve is "node_modules/missing-module" - ], - ), - ( - "missing-module/missing-file", - vec![ - f.join("node_modules/missing-module"), - // f.parent().unwrap().join("node_modules/missing-module"), // we don't report this - ], - ), - ( - "m1/missing-file", - vec![ - f.join("node_modules/m1/missing-file"), - f.join("node_modules/m1/missing-file.js"), - f.join("node_modules/m1/missing-file.node"), - // f.parent().unwrap().join("node_modules/m1"), // we don't report this - ], - ), - ( - "m1/", - vec![ - f.join("node_modules/m1/index"), - f.join("node_modules/m1/index.js"), - f.join("node_modules/m1/index.json"), - f.join("node_modules/m1/index.node"), - ], - ), - ("m1/a", vec![f.join("node_modules/m1/a")]), - ]; - - let resolver = Resolver::default(); - - for (specifier, missing_dependencies) in data { - let mut ctx = ResolveContext::default(); - let _ = resolver.resolve_with_context(&f, specifier, &mut ctx); - - for path in ctx.file_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - } - - for path in missing_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - assert!( - ctx.missing_dependencies.contains(&path), - "{specifier}: {path:?} not in {:?}", - &ctx.missing_dependencies - ); - } - } -} - -#[test] -fn alias_and_extensions() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias: vec![ - ( - "@scope-js/package-name/dir$".into(), - vec![AliasValue::Path(f.join("foo/index.js").to_string_lossy().to_string())], - ), - ( - "react-dom".into(), - vec![AliasValue::Path(f.join("foo/index.js").to_string_lossy().to_string())], - ), - ], - extensions: vec![".server.ts".into()], - - ..ResolveOptions::default() - }); - - let mut ctx = ResolveContext::default(); - let _ = resolver.resolve_with_context(&f, "@scope-js/package-name/dir/router", &mut ctx); - let _ = resolver.resolve_with_context(&f, "react-dom/client", &mut ctx); - - for path in ctx.file_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - } - - for path in ctx.missing_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - if let Some(path) = path.parent() { - assert!(!path.is_file(), "{path:?} must not be a file"); - } - } -} diff --git a/src/tests/mod.rs b/src/tests/mod.rs deleted file mode 100644 index 94e6bd86..00000000 --- a/src/tests/mod.rs +++ /dev/null @@ -1,49 +0,0 @@ -mod alias; -mod browser_field; -mod builtins; -mod dependencies; -mod exports_field; -mod extension_alias; -mod extensions; -mod fallback; -mod full_specified; -mod imports_field; -mod incorrect_description_file; -mod main_field; -mod memory_fs; -mod missing; -mod resolve; -mod restrictions; -mod roots; -mod scoped_packages; -mod simple; -mod symlink; -mod tsconfig_paths; -mod tsconfig_project_references; - -use crate::Resolver; -use std::{env, path::PathBuf, sync::Arc, thread}; - -pub fn fixture_root() -> PathBuf { - env::current_dir().unwrap().join("fixtures") -} - -pub fn fixture() -> PathBuf { - fixture_root().join("enhanced_resolve").join("test").join("fixtures") -} - -#[test] -fn threaded_environment() { - let cwd = env::current_dir().unwrap(); - let resolver = Arc::new(Resolver::default()); - for _ in 0..2 { - _ = thread::spawn({ - let cwd = cwd.clone(); - let resolver = Arc::clone(&resolver); - move || { - _ = resolver.resolve(cwd, "."); - } - }) - .join(); - } -} diff --git a/src/tests/resolve.rs b/src/tests/resolve.rs deleted file mode 100644 index f2dbb88e..00000000 --- a/src/tests/resolve.rs +++ /dev/null @@ -1,119 +0,0 @@ -//! - -use crate::{ResolveError, ResolveOptions, Resolver}; - -#[test] -fn resolve() { - let f = super::fixture(); - - let resolver = Resolver::default(); - - let main1_js_path = f.join("main1.js").to_string_lossy().to_string(); - - #[rustfmt::skip] - let pass = [ - ("absolute path", f.clone(), main1_js_path.as_str(), f.join("main1.js")), - ("file with .js", f.clone(), "./main1.js", f.join("main1.js")), - ("file without extension", f.clone(), "./main1", f.join("main1.js")), - ("another file with .js", f.clone(), "./a.js", f.join("a.js")), - ("another file without extension", f.clone(), "./a", f.join("a.js")), - ("file in module with .js", f.clone(), "m1/a.js", f.join("node_modules/m1/a.js")), - ("file in module without extension", f.clone(), "m1/a", f.join("node_modules/m1/a.js")), - ("another file in module without extension", f.clone(), "complexm/step1", f.join("node_modules/complexm/step1.js")), - ("from submodule to file in sibling module", f.join("node_modules/complexm"), "m2/b.js", f.join("node_modules/m2/b.js")), - ("from nested directory to overwritten file in module", f.join("multiple_modules"), "m1/a.js", f.join("multiple_modules/node_modules/m1/a.js")), - ("from nested directory to not overwritten file in module", f.join("multiple_modules"), "m1/b.js", f.join("node_modules/m1/b.js")), - ("file with query", f.clone(), "./main1.js?query", f.join("main1.js?query")), - ("file with fragment", f.clone(), "./main1.js#fragment", f.join("main1.js#fragment")), - ("file with fragment and query", f.clone(), "./main1.js#fragment?query", f.join("main1.js#fragment?query")), - ("file with query and fragment", f.clone(), "./main1.js?#fragment", f.join("main1.js?#fragment")), - - ("file with query (unicode)", f.clone(), "./测试.js?query", f.join("测试.js?query")), - ("file with fragment (unicode)", f.clone(), "./测试.js#fragment", f.join("测试.js#fragment")), - ("file with fragment and query (unicode)", f.clone(), "./测试.js#fragment?query", f.join("测试.js#fragment?query")), - ("file with query and fragment (unicode)", f.clone(), "./测试.js?#fragment", f.join("测试.js?#fragment")), - - ("file in module with query", f.clone(), "m1/a?query", f.join("node_modules/m1/a.js?query")), - ("file in module with fragment", f.clone(), "m1/a#fragment", f.join("node_modules/m1/a.js#fragment")), - ("file in module with fragment and query", f.clone(), "m1/a#fragment?query", f.join("node_modules/m1/a.js#fragment?query")), - ("file in module with query and fragment", f.clone(), "m1/a?#fragment", f.join("node_modules/m1/a.js?#fragment")), - ("file in module with query and fragment", f.clone(), "m1/a?#fragment", f.join("node_modules/m1/a.js?#fragment")), - ("differ between directory and file, resolve file", f.clone(), "./dirOrFile", f.join("dirOrFile.js")), - ("differ between directory and file, resolve directory", f.clone(), "./dirOrFile/", f.join("dirOrFile/index.js")), - ("find node_modules outside of node_modules", f.join("browser-module/node_modules"), "m1/a", f.join("node_modules/m1/a.js")), - ("don't crash on main field pointing to self", f.clone(), "./main-field-self", f.join("./main-field-self/index.js")), - ("don't crash on main field pointing to self (2)", f.clone(), "./main-field-self2", f.join("./main-field-self2/index.js")), - // enhanced-resolve has `#` prepended with a `\0`, they are removed from the - // following 3 expected test results. - // See https://github.com/webpack/enhanced-resolve#escaping - ("handle fragment edge case (no fragment)", f.clone(), "./no#fragment/#/#", f.join("no#fragment/#/#.js")), - ("handle fragment edge case (fragment)", f.clone(), "./no#fragment/#/", f.join("no.js#fragment/#/")), - ("handle fragment escaping", f.clone(), "./no\0#fragment/\0#/\0##fragment", f.join("no#fragment/#/#.js#fragment")), - - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn issue238_resolve() { - let f = super::fixture().join("issue-238"); - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into(), ".jsx".into(), ".ts".into(), ".tsx".into()], - modules: vec!["src/a".into(), "src/b".into(), "src/common".into(), "node_modules".into()], - ..ResolveOptions::default() - }); - let resolved_path = - resolver.resolve(f.join("src/common"), "config/myObjectFile").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("src/common/config/myObjectFile.js")),); -} - -#[test] -fn prefer_relative() { - let f = super::fixture(); - - let resolver = - Resolver::new(ResolveOptions { prefer_relative: true, ..ResolveOptions::default() }); - - #[rustfmt::skip] - let pass = [ - ("should correctly resolve with preferRelative 1", "main1.js", f.join("main1.js")), - ("should correctly resolve with preferRelative 2", "m1/a.js", f.join("node_modules/m1/a.js")), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } -} - -#[test] -fn resolve_to_context() { - let f = super::fixture(); - let resolver = - Resolver::new(ResolveOptions { resolve_to_context: true, ..ResolveOptions::default() }); - - #[rustfmt::skip] - let data = [ - ("context for fixtures", f.clone(), "./", f.clone()), - ("context for fixtures/lib", f.clone(), "./lib", f.join("lib")), - ("context for fixtures with ..", f.clone(), "./lib/../../fixtures/./lib/..", f.clone()), - ("context for fixtures with query", f.clone(), "./?query", f.clone().with_file_name("fixtures?query")), - ]; - - for (comment, path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn resolve_hash_as_module() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions::default()); - let resolution = resolver.resolve(f, "#a"); - assert_eq!(resolution, Err(ResolveError::NotFound("#a".into()))); -} diff --git a/src/tests/restrictions.rs b/src/tests/restrictions.rs deleted file mode 100644 index 5ba56596..00000000 --- a/src/tests/restrictions.rs +++ /dev/null @@ -1,25 +0,0 @@ -//! - -use crate::{ResolveError, ResolveOptions, Resolver, Restriction}; - -// TODO: regex -// * should respect RegExp restriction -// * should try to find alternative #1 -// * should try to find alternative #2 -// * should try to find alternative #3 - -// should respect string restriction -#[test] -fn restriction1() { - let fixture = super::fixture(); - let f = fixture.join("restrictions"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - restrictions: vec![Restriction::Path(f.clone())], - ..ResolveOptions::default() - }); - - let resolution = resolver.resolve(&f, "pck2"); - assert_eq!(resolution, Err(ResolveError::Restriction(fixture.join("c.js"), f))); -} diff --git a/src/tests/roots.rs b/src/tests/roots.rs deleted file mode 100644 index b50e2a07..00000000 --- a/src/tests/roots.rs +++ /dev/null @@ -1,92 +0,0 @@ -//! - -use std::path::PathBuf; - -use crate::{AliasValue, ResolveError, ResolveOptions, Resolver}; - -fn dirname() -> PathBuf { - super::fixture_root().join("enhanced_resolve").join("test") -} - -#[test] -fn roots() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - alias: vec![("foo".into(), vec![AliasValue::from("/fixtures")])], - roots: vec![dirname(), f.clone()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should respect roots option", "/fixtures/b.js", f.join("b.js")), - ("should try another root option, if it exists", "/b.js", f.join("b.js")), - ("should respect extension", "/fixtures/b", f.join("b.js")), - ("should resolve in directory", "/fixtures/extensions/dir", f.join("extensions/dir/index.js")), - ("should respect aliases", "foo/b", f.join("b.js")), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } - - #[rustfmt::skip] - let fail = [ - ("should not work with relative path", "fixtures/b.js", ResolveError::NotFound("fixtures/b.js".into())) - ]; - - for (comment, request, expected) in fail { - let resolution = resolver.resolve(&f, request); - assert_eq!(resolution, Err(expected), "{comment} {request}"); - } -} - -#[test] -fn resolve_to_context() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - roots: vec![dirname(), f.clone()], - resolve_to_context: true, - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f, "/fixtures/lib").map(|r| r.full_path()); - let expected = f.join("lib"); - assert_eq!(resolved_path, Ok(expected)); -} - -#[test] -fn prefer_absolute() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - alias: vec![("foo".into(), vec![AliasValue::from("/fixtures")])], - roots: vec![dirname(), f.clone()], - prefer_absolute: true, - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve an absolute path (prefer absolute)", f.join("b.js").to_string_lossy().to_string(), f.join("b.js")), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(&f, &request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } -} - -#[test] -fn roots_fall_through() { - let f = super::fixture(); - let absolute_path = f.join("roots_fall_through/index.js"); - let specifier = absolute_path.to_string_lossy(); - let resolution = Resolver::new(ResolveOptions::default().with_root(&f)).resolve(&f, &specifier); - assert_eq!( - resolution.map(super::super::resolution::Resolution::into_path_buf), - Ok(absolute_path) - ); -} diff --git a/src/tests/scoped_packages.rs b/src/tests/scoped_packages.rs deleted file mode 100644 index 8258f00f..00000000 --- a/src/tests/scoped_packages.rs +++ /dev/null @@ -1,25 +0,0 @@ -//! - -use crate::{ResolveOptions, Resolver}; - -#[test] -fn scoped_packages() { - let f = super::fixture().join("scoped"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("main field should work", f.clone(), "@scope/pack1", f.join("./node_modules/@scope/pack1/main.js")), - ("browser field should work", f.clone(), "@scope/pack2", f.join("./node_modules/@scope/pack2/main.js")), - ("folder request should work", f.clone(), "@scope/pack2/lib", f.join("./node_modules/@scope/pack2/lib/index.js")) - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} diff --git a/src/tests/simple.rs b/src/tests/simple.rs deleted file mode 100644 index 08e1238a..00000000 --- a/src/tests/simple.rs +++ /dev/null @@ -1,68 +0,0 @@ -//! - -use std::env; - -use crate::Resolver; - -#[test] -fn simple() { - // mimic `enhanced-resolve/test/simple.test.js` - let dirname = env::current_dir().unwrap().join("fixtures"); - let f = dirname.join("enhanced_resolve/test"); - - let resolver = Resolver::default(); - - let data = [ - ("direct", f.clone(), "../lib/index"), - ("as directory", f, ".."), - ("as module", dirname.clone(), "./enhanced_resolve"), - ]; - - for (comment, path, request) in data { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - let expected = dirname.join("enhanced_resolve/lib/index.js"); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn dashed_name() { - let f = super::fixture(); - - let resolver = Resolver::default(); - - let data = [ - (f.clone(), "dash", f.join("node_modules/dash/index.js")), - (f.clone(), "dash-name", f.join("node_modules/dash-name/index.js")), - (f.join("node_modules/dash"), "dash", f.join("node_modules/dash/index.js")), - (f.join("node_modules/dash"), "dash-name", f.join("node_modules/dash-name/index.js")), - (f.join("node_modules/dash-name"), "dash", f.join("node_modules/dash/index.js")), - (f.join("node_modules/dash-name"), "dash-name", f.join("node_modules/dash-name/index.js")), - ]; - - for (path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{path:?} {request}"); - } -} - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows { - use super::super::memory_fs::MemoryFS; - - use crate::ResolveOptions; - - #[test] - fn no_package() { - use crate::ResolverGeneric; - use std::path::Path; - let f = Path::new("/"); - let file_system = MemoryFS::new(&[]); - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions::default(), - ); - let resolved_path = resolver.resolve(f, "package"); - assert!(resolved_path.is_err()); - } -} diff --git a/src/tests/symlink.rs b/src/tests/symlink.rs deleted file mode 100644 index 7589b560..00000000 --- a/src/tests/symlink.rs +++ /dev/null @@ -1,121 +0,0 @@ -use std::{fs, io, path::Path}; - -use crate::{ResolveOptions, Resolver}; - -#[derive(Debug, Clone, Copy)] -enum FileType { - File, - Dir, -} - -#[allow(unused_variables)] -fn symlink, Q: AsRef>( - original: P, - link: Q, - file_type: FileType, -) -> io::Result<()> { - #[cfg(target_family = "unix")] - { - std::os::unix::fs::symlink(original, link) - } - - #[cfg(target_family = "windows")] - match file_type { - FileType::File => std::os::windows::fs::symlink_file(original, link), - FileType::Dir => std::os::windows::fs::symlink_dir(original, link), - } -} - -fn init(dirname: &Path, temp_path: &Path) -> io::Result<()> { - if temp_path.exists() { - _ = fs::remove_dir_all(temp_path); - } - fs::create_dir(temp_path)?; - symlink(dirname.join("../lib/index.js"), temp_path.join("test"), FileType::File)?; - symlink(dirname.join("../lib"), temp_path.join("test2"), FileType::Dir)?; - fs::remove_file(temp_path.join("test"))?; - fs::remove_file(temp_path.join("test2"))?; - fs::remove_dir(temp_path) -} - -fn create_symlinks(dirname: &Path, temp_path: &Path) -> io::Result<()> { - fs::create_dir(temp_path).unwrap(); - symlink( - dirname.join("../lib/index.js").canonicalize().unwrap(), - temp_path.join("index.js"), - FileType::File, - )?; - symlink(dirname.join("../lib").canonicalize().unwrap(), temp_path.join("lib"), FileType::Dir)?; - symlink(dirname.join("..").canonicalize().unwrap(), temp_path.join("this"), FileType::Dir)?; - symlink(temp_path.join("this"), temp_path.join("that"), FileType::Dir)?; - symlink(Path::new("../../lib/index.js"), temp_path.join("node.relative.js"), FileType::File)?; - symlink( - Path::new("./node.relative.js"), - temp_path.join("node.relative.sym.js"), - FileType::File, - )?; - Ok(()) -} - -fn cleanup_symlinks(temp_path: &Path) { - _ = fs::remove_dir_all(temp_path); -} - -#[test] -fn test() -> io::Result<()> { - let root = super::fixture_root().join("enhanced_resolve"); - let dirname = root.join("test"); - let temp_path = dirname.join("temp"); - if !temp_path.exists() { - let is_admin = init(&dirname, &temp_path).is_ok(); - if !is_admin { - return Ok(()); - } - if let Err(err) = create_symlinks(&dirname, &temp_path) { - cleanup_symlinks(&temp_path); - return Err(err); - } - } - - let resolver_without_symlinks = - Resolver::new(ResolveOptions { symlinks: false, ..ResolveOptions::default() }); - let resolver_with_symlinks = Resolver::default(); - - #[rustfmt::skip] - let pass = [ - ("with a symlink to a file", temp_path.clone(), "./index.js"), - ("with a relative symlink to a file", temp_path.clone(), "./node.relative.js"), - ("with a relative symlink to a symlink to a file", temp_path.clone(), "./node.relative.sym.js"), - ("with a symlink to a directory 1", temp_path.clone(), "./lib/index.js"), - ("with a symlink to a directory 2", temp_path.clone(), "./this/lib/index.js"), - ("with multiple symlinks in the path 1", temp_path.clone(), "./this/test/temp/index.js"), - ("with multiple symlinks in the path 2", temp_path.clone(), "./this/test/temp/lib/index.js"), - ("with multiple symlinks in the path 3", temp_path.clone(), "./this/test/temp/this/lib/index.js"), - ("with a symlink to a directory 2 (chained)", temp_path.clone(), "./that/lib/index.js"), - ("with multiple symlinks in the path 1 (chained)", temp_path.clone(), "./that/test/temp/index.js"), - ("with multiple symlinks in the path 2 (chained)", temp_path.clone(), "./that/test/temp/lib/index.js"), - ("with multiple symlinks in the path 3 (chained)", temp_path.clone(), "./that/test/temp/that/lib/index.js"), - ("with symlinked directory as context 1", temp_path.join( "lib"), "./index.js"), - ("with symlinked directory as context 2", temp_path.join( "this"), "./lib/index.js"), - ("with symlinked directory as context and in path", temp_path.join( "this"), "./test/temp/lib/index.js"), - ("with symlinked directory in context path", temp_path.join( "this/lib"), "./index.js"), - ("with symlinked directory in context path and symlinked file", temp_path.join( "this/test"), "./temp/index.js"), - ("with symlinked directory in context path and symlinked directory", temp_path.join( "this/test"), "./temp/lib/index.js"), - ("with symlinked directory as context 2 (chained)", temp_path.join( "that"), "./lib/index.js"), - ("with symlinked directory as context and in path (chained)", temp_path.join( "that"), "./test/temp/lib/index.js"), - ("with symlinked directory in context path (chained)", temp_path.join( "that/lib"), "./index.js"), - ("with symlinked directory in context path and symlinked file (chained)", temp_path.join( "that/test"), "./temp/index.js"), - ("with symlinked directory in context path and symlinked directory (chained)", temp_path.join( "that/test"), "./temp/lib/index.js") - ]; - - for (comment, path, request) in pass { - let filename = resolver_with_symlinks.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(filename, Ok(root.join("lib/index.js")), "{comment:?}"); - - let resolved_path = - resolver_without_symlinks.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(path.join(request))); - } - - Ok(()) -} diff --git a/src/tests/tsconfig_paths.rs b/src/tests/tsconfig_paths.rs deleted file mode 100644 index b85bf6be..00000000 --- a/src/tests/tsconfig_paths.rs +++ /dev/null @@ -1,530 +0,0 @@ -//! tests for tsconfig-paths -//! -//! Fixtures copied from . - -use std::path::{Path, PathBuf}; - -use crate::{ - JSONError, ResolveError, ResolveOptions, Resolver, TsConfig, TsconfigOptions, - TsconfigReferences, -}; - -// -#[test] -fn tsconfig() { - let f = super::fixture_root().join("tsconfig"); - - #[rustfmt::skip] - let pass = [ - (f.clone(), None, "ts-path", f.join("foo.js")), - (f.join("nested"), None, "ts-path", f.join("nested/test.js")), - (f.join("cases/index"), None, "foo", f.join("node_modules/tsconfig-index/foo.js")), - // This requires reading package.json.tsconfig field - // (f.join("cases/field"), "foo", f.join("node_modules/tsconfig-field/foo.js")) - (f.join("cases/exports"), None, "foo", f.join("node_modules/tsconfig-exports/foo.js")), - (f.join("cases/extends-extension"), None, "foo", f.join("cases/extends-extension/foo.js")), - (f.join("cases/extends-extensionless"), None, "foo", f.join("node_modules/tsconfig-field/foo.js")), - (f.join("cases/extends-paths"), Some("src"), "@/index", f.join("cases/extends-paths/src/index.js")), - (f.join("cases/extends-multiple"), None, "foo", f.join("cases/extends-multiple/foo.js")), - ]; - - for (dir, subdir, request, expected) in pass { - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: dir.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - let path = subdir.map_or(dir.clone(), |subdir| dir.join(subdir)); - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{request} {path:?}"); - } - - #[rustfmt::skip] - let data = [ - (f.join("node_modules/tsconfig-not-used"), "ts-path", Ok(f.join("foo.js"))), - ]; - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - for (path, request, expected) in data { - let resolution = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolution, expected, "{path:?} {request}"); - } -} - -#[test] -fn tsconfig_fallthrough() { - let f = super::fixture_root().join("tsconfig"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "/"); - assert_eq!(resolved_path, Err(ResolveError::NotFound("/".into()))); -} - -#[test] -fn json_with_comments() { - let f = super::fixture_root().join("tsconfig/cases/trailing-comma"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "foo").map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(f.join("bar.js"))); -} - -#[test] -fn broken() { - let f = super::fixture_root().join("tsconfig"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("tsconfig_broken.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "/"); - let error = ResolveError::JSON(JSONError { - path: f.join("tsconfig_broken.json"), - message: String::from("EOF while parsing an object at line 2 column 0"), - line: 2, - column: 0, - }); - assert_eq!(resolved_path, Err(error)); -} - -// -#[test] -fn test_paths() { - let path = Path::new("/foo/tsconfig.json"); - let mut tsconfig_json = serde_json::json!({ - "compilerOptions": { - "paths": { - "jquery": ["node_modules/jquery/dist/jquery"], - "*": ["generated/*"], - "bar/*": ["test/*"], - "bar/baz/*": ["baz/*", "yo/*"], - "@/components/*": ["components/*"], - "url": ["node_modules/my-url"], - } - } - }) - .to_string(); - let tsconfig = TsConfig::parse(true, path, &mut tsconfig_json).unwrap(); - - let data = [ - ("jquery", vec!["/foo/node_modules/jquery/dist/jquery"]), - ("test", vec!["/foo/generated/test"]), - ("test/hello", vec!["/foo/generated/test/hello"]), - ("bar/hi", vec!["/foo/test/hi"]), - ("bar/baz/hi", vec!["/foo/baz/hi", "/foo/yo/hi"]), - ("@/components/button", vec!["/foo/components/button"]), - ("./jquery", vec![]), - ("url", vec!["/foo/node_modules/my-url"]), - ]; - - for (specifier, expected) in data { - let paths = tsconfig.resolve_path_alias(specifier); - let expected = expected.into_iter().map(PathBuf::from).collect::>(); - assert_eq!(paths, expected, "{specifier}"); - } -} - -// -#[test] -fn test_base_url() { - let path = Path::new("/foo/tsconfig.json"); - let mut tsconfig_json = serde_json::json!({ - "compilerOptions": { - "baseUrl": "./src" - } - }) - .to_string(); - let tsconfig = TsConfig::parse(true, path, &mut tsconfig_json).unwrap(); - - let data = [ - ("foo", vec!["/foo/src/foo"]), - ("components/button", vec!["/foo/src/components/button"]), - ("./jquery", vec![]), - ]; - - for (specifier, expected) in data { - let paths = tsconfig.resolve_path_alias(specifier); - let expected = expected.into_iter().map(PathBuf::from).collect::>(); - assert_eq!(paths, expected, "{specifier}"); - } -} - -// -#[test] -fn test_paths_and_base_url() { - let path = Path::new("/foo/tsconfig.json"); - let mut tsconfig_json = serde_json::json!({ - "compilerOptions": { - "baseUrl": "./src", - "paths": { - "*": ["generated/*"], - "bar/*": ["test/*"], - "bar/baz/*": ["baz/*", "yo/*"], - "@/components/*": ["components/*"] - } - } - }) - .to_string(); - let tsconfig = TsConfig::parse(true, path, &mut tsconfig_json).unwrap(); - - let data = [ - ("test", vec!["/foo/src/generated/test", "/foo/src/test"]), - ("test/hello", vec!["/foo/src/generated/test/hello", "/foo/src/test/hello"]), - ("bar/hi", vec!["/foo/src/test/hi", "/foo/src/bar/hi"]), - ("bar/baz/hi", vec!["/foo/src/baz/hi", "/foo/src/yo/hi", "/foo/src/bar/baz/hi"]), - ("@/components/button", vec!["/foo/src/components/button", "/foo/src/@/components/button"]), - ("./jquery", vec![]), - ]; - - for (specifier, expected) in data { - let paths = tsconfig.resolve_path_alias(specifier); - let expected = expected.into_iter().map(PathBuf::from).collect::>(); - assert_eq!(paths, expected, "{specifier}"); - } -} - -// Template variable ${configDir} for substitution of config files directory path -// https://github.com/microsoft/TypeScript/pull/58042 -#[test] -fn test_template_variable() { - let f = super::fixture_root().join("tsconfig"); - let f2 = f.join("cases").join("paths_template_variable"); - - #[rustfmt::skip] - let pass = [ - (f2.clone(), "tsconfig1.json", "foo", f2.join("foo.js")), - (f2.clone(), "tsconfig2.json", "foo", f2.join("foo.js")), - (f.clone(), "tsconfig_template_variable.json", "foo", f.join("foo.js")), - ]; - - for (dir, tsconfig, request, expected) in pass { - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: dir.join(tsconfig), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&dir, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{request} {tsconfig} {dir:?}"); - } -} - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows_test { - use std::path::{Path, PathBuf}; - - use crate::{ - ResolveError, ResolveOptions, ResolverGeneric, TsconfigOptions, TsconfigReferences, - }; - - use super::super::memory_fs::MemoryFS; - - struct OneTest { - name: &'static str, - tsconfig: String, - package_json: Option<(PathBuf, String)>, - main_fields: Option>, - existing_files: Vec<&'static str>, - requested_module: &'static str, - expected_path: &'static str, - extensions: Vec, - } - - impl Default for OneTest { - fn default() -> Self { - Self { - name: "", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/*": ["location/*"] - } - } - }) - .to_string(), - package_json: None, - main_fields: None, - existing_files: vec![], - requested_module: "", - expected_path: "", - extensions: vec![ - ".js".into(), - ".json".into(), - ".node".into(), - ".ts".into(), - ".tsx".into(), - ], - } - } - } - - impl OneTest { - fn resolver(&self, root: &Path) -> ResolverGeneric { - let mut file_system = MemoryFS::default(); - - file_system.add_file(&root.join("tsconfig.json"), &self.tsconfig); - if let Some((path, package_json)) = &self.package_json { - file_system.add_file(&root.join(path).join("package.json"), package_json); - } - for path in &self.existing_files { - file_system.add_file(Path::new(path), ""); - } - - let mut options = ResolveOptions { - extensions: self.extensions.clone(), - tsconfig: Some(TsconfigOptions { - config_file: root.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }; - if let Some(main_fields) = &self.main_fields { - options.main_fields.clone_from(main_fields); - } - - ResolverGeneric::::new_with_file_system(file_system, options) - } - } - - // Path matching tests from tsconfig-paths - // * - // * - #[test] - fn match_path() { - let pass = [ - OneTest { - name: "should locate path that matches with star and exists", - existing_files: vec!["/root/location/mylib/index.ts"], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve to correct path when many are specified", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/*": ["foo1/*", "foo2/*", "location/*", "foo3/*"], - } - } - }) - .to_string(), - existing_files: vec!["/root/location/mylib/index.ts"], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should locate path that matches with star and prioritize pattern with longest prefix", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "*": ["location/*"], - "lib/*": ["location/*"], - } - } - }) - .to_string(), - existing_files: vec![ - "/root/location/lib/mylib/index.ts", - "/root/location/mylib/index.ts", - ], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should locate path that matches with star and exists with extension", - existing_files: vec![ - "/root/location/mylib.myext", - ], - requested_module: "lib/mylib", - extensions: vec![".js".into(), ".myext".into()], - expected_path: "/root/location/mylib.myext", - ..OneTest::default() - }, - OneTest { - name: "should resolve request with extension specified", - existing_files: vec![ - "/root/location/test.jpg", - ], - requested_module: "lib/test.jpg", - expected_path: "/root/location/test.jpg", - ..OneTest::default() - }, - OneTest { - name: "should locate path that matches without star and exists", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/foo": ["location/foo"] - } - } - }) - .to_string(), - existing_files: vec![ - "/root/location/foo.ts", - ], - requested_module: "lib/foo", - expected_path: "/root/location/foo.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve to parent folder when filename is in subfolder", - existing_files: vec![ - "/root/location/mylib/index.ts", - ], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve from main field in package.json", - package_json: Some((PathBuf::from("/root/location/mylib"), serde_json::json!({ - "main": "./kalle.ts" - }).to_string())), - existing_files: vec![ - "/root/location/mylib/kalle.ts", - ], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/kalle.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve from main field in package.json (js)", - package_json: Some((PathBuf::from("/root/location/mylib.js"), serde_json::json!({ - "main": "./kalle.js" - }).to_string())), - existing_files: vec![ - "/root/location/mylib.js/kalle.js", - ], - extensions: vec![".ts".into(), ".js".into()], - requested_module: "lib/mylib.js", - expected_path: "/root/location/mylib.js/kalle.js", - ..OneTest::default() - }, - OneTest { - name: "should resolve from list of fields by priority in package.json", - main_fields: Some(vec!["missing".into(), "browser".into(), "main".into()]), - package_json: Some((PathBuf::from("/root/location/mylibjs"), serde_json::json!({ - "main": "./main.js", - "browser": "./browser.js" - }).to_string())), - existing_files: vec![ - "/root/location/mylibjs/main.js", - "/root/location/mylibjs/browser.js", - ], - extensions: vec![".ts".into(), ".js".into()], - requested_module: "lib/mylibjs", - expected_path: "/root/location/mylibjs/browser.js", - ..OneTest::default() - }, -OneTest { - name: "should ignore field mappings to missing files in package.json", - main_fields: Some(vec!["browser".into(), "main".into()]), - package_json: Some((PathBuf::from("/root/location/mylibjs"), serde_json::json!({ - "main": "./kalle.js", - "browser": "./nope.js" - }).to_string())), - existing_files: vec![ - "/root/location/mylibjs/kalle.js", - ], - extensions: vec![".ts".into(), ".js".into()], - requested_module: "lib/mylibjs", - expected_path: "/root/location/mylibjs/kalle.js", - ..OneTest::default() - }, - // Tests that are not applicable: - // name: "should resolve nested main fields" - // name: "should ignore advanced field mappings in package.json" - // name: "should resolve to with the help of baseUrl when not explicitly set" - // name: "should not resolve with the help of baseUrl when asked not to" - // name: "should resolve main file with cjs file extension" - OneTest { - name: "should resolve .ts from .js alias", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "@/*": ["src/*"] - } - } - }).to_string(), - existing_files: vec![ - "/root/src/foo.ts", - ], - requested_module: "@/foo", // original data was "@/foo.ts" but I don't get why it is the case? - expected_path: "/root/src/foo.ts", // original data was "/root/src/foo" - ..OneTest::default() - }, - ]; - - let root = PathBuf::from("/root"); - - for test in pass { - let resolved_path = - test.resolver(&root).resolve(&root, test.requested_module).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(PathBuf::from(test.expected_path)), "{}", test.name); - } - - let fail = [ - OneTest { - name: "should not locate path that does not match", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/*": ["location/*"] - } - } - }) - .to_string(), - existing_files: vec!["/root/location/mylib"], - requested_module: "lib/mylibjs", - ..OneTest::default() - }, - OneTest { - name: "should not resolve typings file (index.d.ts)", - existing_files: vec!["/root/location/mylib/index.d.ts"], - requested_module: "lib/mylib", - ..OneTest::default() - }, - ]; - - for test in fail { - let resolved_path = - test.resolver(&root).resolve(&root, test.requested_module).map(|f| f.full_path()); - assert_eq!( - resolved_path, - Err(ResolveError::NotFound(test.requested_module.into())), - "{}", - test.name - ); - } - } -} diff --git a/src/tests/tsconfig_project_references.rs b/src/tests/tsconfig_project_references.rs deleted file mode 100644 index b552fefe..00000000 --- a/src/tests/tsconfig_project_references.rs +++ /dev/null @@ -1,101 +0,0 @@ -//! Tests for tsconfig project references - -use crate::{ResolveError, ResolveOptions, Resolver, TsconfigOptions, TsconfigReferences}; - -#[test] -fn auto() { - let f = super::fixture_root().join("tsconfig/cases/project_references"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("app"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - // Test normal paths alias - (f.join("app"), "@/index.ts", f.join("app/aliased/index.ts")), - (f.join("app"), "@/../index.ts", f.join("app/index.ts")), - // Test project reference - (f.join("project_a"), "@/index.ts", f.join("project_a/aliased/index.ts")), - (f.join("project_b/src"), "@/index.ts", f.join("project_b/src/aliased/index.ts")), - // Does not have paths alias - (f.join("project_a"), "./index.ts", f.join("project_a/index.ts")), - (f.join("project_c"), "./index.ts", f.join("project_c/index.ts")), - // Template variable - { - let dir = f.parent().unwrap().join("paths_template_variable"); - (dir.clone(), "foo", dir.join("foo.js")) - } - ]; - - for (path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{request} {path:?}"); - } -} - -#[test] -fn disabled() { - let f = super::fixture_root().join("tsconfig/cases/project_references"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("app"), - references: TsconfigReferences::Disabled, - }), - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - // Test normal paths alias - (f.join("app"), "@/index.ts", Ok(f.join("app/aliased/index.ts"))), - (f.join("app"), "@/../index.ts", Ok(f.join("app/index.ts"))), - // Test project reference - (f.join("project_a"), "@/index.ts", Err(ResolveError::NotFound("@/index.ts".into()))), - (f.join("project_b/src"), "@/index.ts", Err(ResolveError::NotFound("@/index.ts".into()))), - // Does not have paths alias - (f.join("project_a"), "./index.ts", Ok(f.join("project_a/index.ts"))), - (f.join("project_c"), "./index.ts", Ok(f.join("project_c/index.ts"))), - ]; - - for (path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, expected, "{request} {path:?}"); - } -} - -#[test] -fn manual() { - let f = super::fixture_root().join("tsconfig/cases/project_references"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("app"), - references: TsconfigReferences::Paths(vec!["../project_a/conf.json".into()]), - }), - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - // Test normal paths alias - (f.join("app"), "@/index.ts", Ok(f.join("app/aliased/index.ts"))), - (f.join("app"), "@/../index.ts", Ok(f.join("app/index.ts"))), - // Test project reference - (f.join("project_a"), "@/index.ts", Ok(f.join("project_a/aliased/index.ts"))), - (f.join("project_b/src"), "@/index.ts", Err(ResolveError::NotFound("@/index.ts".into()))), - // Does not have paths alias - (f.join("project_a"), "./index.ts", Ok(f.join("project_a/index.ts"))), - (f.join("project_c"), "./index.ts", Ok(f.join("project_c/index.ts"))), - ]; - - for (path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, expected, "{request} {path:?}"); - } -} diff --git a/src/tsconfig.rs b/src/tsconfig.rs deleted file mode 100644 index 9ea23c99..00000000 --- a/src/tsconfig.rs +++ /dev/null @@ -1,223 +0,0 @@ -use std::{ - hash::BuildHasherDefault, - path::{Path, PathBuf}, - sync::Arc, -}; - -use indexmap::IndexMap; -use rustc_hash::FxHasher; -use serde::Deserialize; - -use crate::PathUtil; - -pub type CompilerOptionsPathsMap = IndexMap, BuildHasherDefault>; - -#[derive(Debug, Clone, Eq, PartialEq, Deserialize)] -#[serde(untagged)] -pub enum ExtendsField { - Single(String), - Multiple(Vec), -} - -#[derive(Debug, Deserialize)] -#[serde(rename_all = "camelCase")] -pub struct TsConfig { - /// Whether this is the caller tsconfig. - /// Used for final template variable substitution when all configs are extended and merged. - #[serde(skip)] - root: bool, - - /// Path to `tsconfig.json`. Contains the `tsconfig.json` filename. - #[serde(skip)] - path: PathBuf, - - #[serde(default)] - pub extends: Option, - - #[serde(default)] - pub compiler_options: CompilerOptions, - - /// Bubbled up project references with a reference to their tsconfig. - #[serde(default)] - pub references: Vec, -} - -/// Compiler Options -/// -/// -#[derive(Debug, Default, Deserialize)] -#[serde(rename_all = "camelCase")] -pub struct CompilerOptions { - base_url: Option, - - /// Path aliases - paths: Option, - - /// The actual base for where path aliases are resolved from. - #[serde(skip)] - paths_base: PathBuf, -} - -/// Project Reference -/// -/// -#[derive(Debug, Deserialize)] -pub struct ProjectReference { - /// The path property of each reference can point to a directory containing a tsconfig.json file, - /// or to the config file itself (which may have any name). - pub path: PathBuf, - - /// Reference to the resolved tsconfig - #[serde(skip)] - pub tsconfig: Option>, -} - -impl TsConfig { - pub fn parse(root: bool, path: &Path, json: &mut str) -> Result { - _ = json_strip_comments::strip(json); - let mut tsconfig: Self = serde_json::from_str(json)?; - tsconfig.root = root; - tsconfig.path = path.to_path_buf(); - let directory = tsconfig.directory().to_path_buf(); - if let Some(base_url) = tsconfig.compiler_options.base_url { - tsconfig.compiler_options.base_url = Some(directory.normalize_with(base_url)); - } - if tsconfig.compiler_options.paths.is_some() { - tsconfig.compiler_options.paths_base = - tsconfig.compiler_options.base_url.as_ref().map_or(directory, Clone::clone); - } - Ok(tsconfig) - } - - pub fn build(mut self) -> Self { - if self.root { - let dir = self.directory().to_path_buf(); - // Substitute template variable in `tsconfig.compilerOptions.paths` - if let Some(paths) = &mut self.compiler_options.paths { - for paths in paths.values_mut() { - for path in paths { - Self::substitute_template_variable(&dir, path); - } - } - } - } - self - } - - /// Directory to `tsconfig.json` - /// - /// # Panics - /// - /// * When the `tsconfig.json` path is misconfigured. - pub fn directory(&self) -> &Path { - debug_assert!(self.path.file_name().is_some()); - self.path.parent().unwrap() - } - - pub fn extend_tsconfig(&mut self, tsconfig: &Self) { - let compiler_options = &mut self.compiler_options; - if compiler_options.paths.is_none() { - compiler_options.paths_base = compiler_options - .base_url - .as_ref() - .map_or_else(|| tsconfig.compiler_options.paths_base.clone(), Clone::clone); - compiler_options.paths.clone_from(&tsconfig.compiler_options.paths); - } - if compiler_options.base_url.is_none() { - compiler_options.base_url.clone_from(&tsconfig.compiler_options.base_url); - } - } - - pub fn resolve(&self, path: &Path, specifier: &str) -> Vec { - if path.starts_with(self.base_path()) { - let paths = self.resolve_path_alias(specifier); - if !paths.is_empty() { - return paths; - } - } - for tsconfig in self.references.iter().filter_map(|reference| reference.tsconfig.as_ref()) { - if path.starts_with(tsconfig.base_path()) { - return tsconfig.resolve_path_alias(specifier); - } - } - vec![] - } - - // Copied from parcel - // - pub fn resolve_path_alias(&self, specifier: &str) -> Vec { - if specifier.starts_with(|s| s == '/' || s == '.') { - return vec![]; - } - - let base_url_iter = self - .compiler_options - .base_url - .as_ref() - .map_or_else(Vec::new, |base_url| vec![base_url.normalize_with(specifier)]); - - let Some(paths_map) = &self.compiler_options.paths else { - return base_url_iter; - }; - - let paths = paths_map.get(specifier).map_or_else( - || { - let mut longest_prefix_length = 0; - let mut longest_suffix_length = 0; - let mut best_key: Option<&String> = None; - - for key in paths_map.keys() { - if let Some((prefix, suffix)) = key.split_once('*') { - if (best_key.is_none() || prefix.len() > longest_prefix_length) - && specifier.starts_with(prefix) - && specifier.ends_with(suffix) - { - longest_prefix_length = prefix.len(); - longest_suffix_length = suffix.len(); - best_key.replace(key); - } - } - } - - best_key.and_then(|key| paths_map.get(key)).map_or_else(Vec::new, |paths| { - paths - .iter() - .map(|path| { - path.replace( - '*', - &specifier[longest_prefix_length - ..specifier.len() - longest_suffix_length], - ) - }) - .collect::>() - }) - }, - Clone::clone, - ); - - paths - .into_iter() - .map(|p| self.compiler_options.paths_base.normalize_with(p)) - .chain(base_url_iter) - .collect() - } - - fn base_path(&self) -> &Path { - self.compiler_options - .base_url - .as_ref() - .map_or_else(|| self.directory(), |path| path.as_ref()) - } - - /// Template variable `${configDir}` for substitution of config files directory path - /// - /// NOTE: All tests cases are just a head replacement of `${configDir}`, so we are constrained as such. - /// - /// See - fn substitute_template_variable(directory: &Path, path: &mut String) { - const TEMPLATE_VARIABLE: &str = "${configDir}/"; - if let Some(stripped_path) = path.strip_prefix(TEMPLATE_VARIABLE) { - *path = directory.join(stripped_path).to_string_lossy().to_string(); - } - } -} diff --git a/tests/integration_test.rs b/tests/integration_test.rs deleted file mode 100644 index 0fc52887..00000000 --- a/tests/integration_test.rs +++ /dev/null @@ -1,103 +0,0 @@ -//! Test public APIs - -use std::{env, path::PathBuf}; - -use oxc_resolver::{EnforceExtension, Resolution, ResolveContext, ResolveOptions, Resolver}; - -fn dir() -> PathBuf { - env::current_dir().unwrap() -} - -fn resolve(specifier: &str) -> Resolution { - let path = dir(); - Resolver::new(ResolveOptions::default()).resolve(path, specifier).unwrap() -} - -#[test] -fn clone() { - let resolution = resolve("./tests/package.json"); - assert_eq!(resolution.clone(), resolution); -} - -#[test] -fn debug() { - let resolution = resolve("./tests/package.json"); - let s = format!("{resolution:?}"); - assert!(!s.is_empty()); -} - -#[test] -fn eq() { - let resolution = resolve("./tests/package.json"); - assert_eq!(resolution, resolution); -} - -#[test] -fn package_json() { - let resolution = resolve("./tests/package.json"); - let package_json = resolution.package_json().unwrap(); - assert_eq!(package_json.name.as_ref().unwrap(), "name"); - assert_eq!(package_json.r#type.as_ref().unwrap().as_str(), "module".into()); - assert!(package_json.side_effects.as_ref().unwrap().is_object()); -} - -#[cfg(feature = "package_json_raw_json_api")] -#[test] -fn package_json_raw_json_api() { - let resolution = resolve("./tests/package.json"); - assert!(resolution - .package_json() - .unwrap() - .raw_json() - .get("name") - .is_some_and(|name| name == "name")); -} - -#[test] -fn clear_cache() { - let resolver = Resolver::new(ResolveOptions::default()); - resolver.clear_cache(); // exists -} - -#[test] -fn options() { - let resolver = Resolver::new(ResolveOptions::default()); - let options = resolver.options(); - assert!(!format!("{options:?}").is_empty()); -} - -#[test] -fn debug_resolver() { - let resolver = Resolver::new(ResolveOptions::default()); - assert!(!format!("{resolver:?}").is_empty()); -} - -#[test] -fn dependencies() { - let path = dir(); - let mut ctx = ResolveContext::default(); - let _ = Resolver::new(ResolveOptions::default()).resolve_with_context( - path, - "./tests/package.json", - &mut ctx, - ); - assert!(!ctx.file_dependencies.is_empty()); - assert!(ctx.missing_dependencies.is_empty()); -} - -#[test] -fn options_api() { - _ = ResolveOptions::default() - .with_builtin_modules(true) - .with_condition_names(&[]) - .with_extension(".js") - .with_force_extension(EnforceExtension::Auto) - .with_fully_specified(true) - .with_main_field("asdf") - .with_main_file("main") - .with_module("module") - .with_prefer_absolute(true) - .with_prefer_relative(true) - .with_root(PathBuf::new()) - .with_symbolic_link(true); -} diff --git a/tests/package.json b/tests/package.json deleted file mode 100644 index 54f58b8c..00000000 --- a/tests/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "name", - "type": "module", - "sideEffects": {} -} diff --git a/tests/resolve_test.rs b/tests/resolve_test.rs deleted file mode 100644 index 30d1ceff..00000000 --- a/tests/resolve_test.rs +++ /dev/null @@ -1,104 +0,0 @@ -use std::{env, path::PathBuf}; - -use oxc_resolver::{ResolveError, ResolveOptions, Resolver}; - -fn dir() -> PathBuf { - env::current_dir().unwrap() -} - -#[test] -fn chinese() { - let dir = dir(); - let specifier = "./fixtures/misc/中文/中文.js"; - let resolution = Resolver::new(ResolveOptions::default()).resolve(&dir, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(dir.join("fixtures/misc/中文/中文.js")) - ); -} - -#[test] -fn styled_components() { - let dir = dir(); - let path = dir.join("fixtures/pnpm"); - let module_path = dir.join("node_modules/.pnpm/styled-components@6.1.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/styled-components"); - let specifier = "styled-components"; - - // cjs - let options = - ResolveOptions { alias_fields: vec![vec!["browser".into()]], ..ResolveOptions::default() }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/styled-components.browser.cjs.js")) - ); - - // esm - let options = ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - main_fields: vec!["module".into()], - ..ResolveOptions::default() - }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/styled-components.browser.esm.js")) - ); -} - -#[test] -fn axios() { - let dir = dir(); - let path = dir.join("fixtures/pnpm"); - let module_path = dir.join("node_modules/.pnpm/axios@1.6.2/node_modules/axios"); - let specifier = "axios"; - - // default - let options = ResolveOptions::default(); - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("index.js")) - ); - - // browser - let options = ResolveOptions { - condition_names: vec!["browser".into(), "require".into()], - ..ResolveOptions::default() - }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/browser/axios.cjs")) - ); - - // cjs - let options = ResolveOptions { - condition_names: vec!["node".into(), "require".into()], - ..ResolveOptions::default() - }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/node/axios.cjs")) - ); -} - -#[test] -fn postcss() { - let dir = dir(); - let path = dir.join("fixtures/pnpm"); - let module_path = path.join("node_modules/postcss"); - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - // should ignore "path" - let resolution = resolver.resolve(&module_path, "path"); - assert_eq!(resolution, Err(ResolveError::Ignored(module_path.clone()))); - - // should ignore "./lib/terminal-highlight" - let resolution = resolver.resolve(&module_path, "./lib/terminal-highlight"); - assert_eq!(resolution, Err(ResolveError::Ignored(module_path.join("lib/terminal-highlight")))); -} From b602ced3c493e9dc60e9f3586ed9163ff2b6e695 Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Tue, 2 Jul 2024 10:34:41 +0300 Subject: [PATCH 45/82] squash! --- package.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index a431e48f..8e220114 100644 --- a/package.json +++ b/package.json @@ -16,9 +16,9 @@ }, "devDependencies": { "@napi-rs/cli": "^3.0.0-alpha.43", - "@napi-rs/wasm-runtime": "^0.2.0", - "@types/node": "^20.10.4", - "ava": "^6.0.1", - "emnapi": "^1.0.0" + "@napi-rs/wasm-runtime": "^0.2.4", + "@types/node": "^20.14.9", + "ava": "^6.1.3", + "emnapi": "^1.2.0" } } From e24e701f0eb8c0528ed52bc582fa2b45bb9c8e81 Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Sat, 6 Jul 2024 12:43:30 +0300 Subject: [PATCH 46/82] squash! --- Cargo.lock | 871 ------ Source/error.rs | 4 + Source/lib.rs | 9 +- Source/tsconfig.rs | 2 +- fixtures/enhanced_resolve/lib/index.js | 1 - fixtures/enhanced_resolve/package.json | 4 - fixtures/enhanced_resolve/test/.gitignore | 2 - .../enhanced_resolve/test/fixtures/#/a.js | 0 fixtures/enhanced_resolve/test/fixtures/a.js | 3 - .../enhanced_resolve/test/fixtures/abc.txt | 1 - .../test/fixtures/alias/files/a.js | 0 fixtures/enhanced_resolve/test/fixtures/b.js | 3 - .../browser-module/browser/module-a.js | 0 .../fixtures/browser-module/lib/browser.js | 0 .../fixtures/browser-module/lib/ignore.js | 0 .../test/fixtures/browser-module/lib/main.js | 0 .../fixtures/browser-module/lib/replaced.js | 0 .../test/fixtures/browser-module/lib/self.js | 0 .../fixtures/browser-module/lib/toString.js | 0 .../browser-module/node_modules/module-a.js | 0 .../browser-module/node_modules/module-b.js | 0 .../browser-module/node_modules/module-c.js | 0 .../node_modules/recursive-file/a.js | 0 .../node_modules/recursive-file/b.js | 0 .../node_modules/recursive-file/c.js | 0 .../node_modules/recursive-file/d.js | 0 .../node_modules/recursive-file/package.json | 8 - .../test/fixtures/browser-module/package.json | 33 - .../test/fixtures/builtins/package.json | 12 - fixtures/enhanced_resolve/test/fixtures/c.js | 4 - .../enhanced_resolve/test/fixtures/complex.js | 13 - .../test/fixtures/crypto-js/index.js | 0 .../test/fixtures/crypto-js/package.json | 7 - .../test/fixtures/decorated-fs/exists.js | 0 .../test/fixtures/dirOrFile.js | 1 - .../test/fixtures/dirOrFile/index.js | 1 - .../directory-default/directory-default.js | 0 .../node_modules/@org/pkg/dist/string.js | 1 - .../@org/pkg/dist/string.test.d.ts | 1 - .../node_modules/@org/pkg/package.json | 9 - .../node_modules/pkg/dist/string.js | 1 - .../node_modules/pkg/dist/string.test.d.ts | 1 - .../node_modules/pkg/package.json | 9 - .../node_modules/exports-field/package.json | 7 - .../node_modules/pack1/index.js | 0 .../test/fixtures/exports-field/a.js | 1 - .../node_modules/exports-field/lib/browser.js | 1 - .../node_modules/exports-field/lib/index.js | 0 .../exports-field/lib/lib2/main.js | 1 - .../node_modules/exports-field/lib/main.js | 1 - .../node_modules/exports-field/main.js | 1 - .../node_modules/exports-field/package.json | 18 - .../node_modules/exports-field/x.js | 1 - .../invalid-exports-field/index.js | 0 .../invalid-exports-field/package.json | 13 - .../node_modules/invalid-exports-field/umd.js | 0 .../test/fixtures/exports-field/package.json | 5 - .../node_modules/exports-field/index.js | 1 - .../node_modules/exports-field/lib/browser.js | 1 - .../exports-field/lib/lib2/main.js | 1 - .../node_modules/exports-field/lib/main.js | 1 - .../node_modules/exports-field/main.js | 1 - .../node_modules/exports-field/package.json | 17 - .../node_modules/exports-field/index | 0 .../node_modules/exports-field/main.js | 1 - .../node_modules/exports-field/package.json | 10 - .../node_modules/exports-field/src/index.js | 0 .../fixtures/extension-alias/dir/index.js | 0 .../fixtures/extension-alias/dir/index.ts | 0 .../fixtures/extension-alias/dir2/index.js | 0 .../fixtures/extension-alias/dir2/index.mts | 0 .../test/fixtures/extension-alias/index.js | 0 .../test/fixtures/extension-alias/index.mjs | 0 .../fixtures/extension-alias/index.mts.js | 0 .../test/fixtures/extension-alias/index.ts | 0 .../test/fixtures/extensions/app.module.js | 0 .../test/fixtures/extensions/dir/index.js | 0 .../test/fixtures/extensions/dir/index.ts | 0 .../test/fixtures/extensions/foo.js | 0 .../test/fixtures/extensions/foo.ts | 0 .../test/fixtures/extensions/index.js | 0 .../test/fixtures/extensions/index.ts | 0 .../extensions/node_modules/module.js | 0 .../extensions/node_modules/module/index.ts | 0 .../test/fixtures/extensions/package.json | 3 - .../enhanced_resolve/test/fixtures/file.load1 | 0 .../enhanced_resolve/test/fixtures/file.load2 | 0 .../test/fixtures/foo/index.js | 0 .../test/fixtures/foo/package.json | 4 - .../node_modules/m/package.json | 17 - .../node_modules/m/src/features/f.js | 0 .../m/src/features/internal/file.js | 0 .../node_modules/m/src/features/y/y.js | 0 .../node_modules/m/src/internal/i.js | 0 .../node_modules/m/src/middle-1/f.js | 0 .../node_modules/m/src/middle-1/nested/f.js | 0 .../node_modules/m/src/middle-2/nested/f.js | 1 - .../m/src/middle-3/nested/f/nested/f.js | 0 .../node_modules/m/src/middle-4/f/f.js | 0 .../node_modules/m/src/middle-5/f$/$.js | 0 .../node_modules/m/src/middle-5/f/$.js | 0 .../node_modules/m/src/middle/f.js | 0 .../node_modules/m/src/middle/nested/f.js | 0 .../test/fixtures/imports-field/a.js | 1 - .../test/fixtures/imports-field/b.js | 0 .../test/fixtures/imports-field/dir/b.js | 0 .../node_modules/a/lib/browser.js | 1 - .../imports-field/node_modules/a/lib/index.js | 0 .../node_modules/a/lib/lib2/main.js | 1 - .../imports-field/node_modules/a/lib/main.js | 1 - .../imports-field/node_modules/a/main.js | 1 - .../imports-field/node_modules/a/package.json | 18 - .../imports-field/node_modules/a/x.js | 1 - .../imports-field/node_modules/c/index.js | 0 .../test/fixtures/imports-field/package.json | 17 - .../fixtures/incorrect-package/pack1/a.js | 0 .../incorrect-package/pack1/package.json | 2 - .../fixtures/incorrect-package/pack2/a.js | 0 .../incorrect-package/pack2/package.json | 0 .../test/fixtures/issue-238/package.json | 3 - .../test/fixtures/issue-238/src/a/config.js | 0 .../src/common/config/myObjectFile.js | 0 .../enhanced_resolve/test/fixtures/lib.js | 0 .../test/fixtures/lib/complex1.js | 1 - .../test/fixtures/main-field-self/index.js | 0 .../fixtures/main-field-self/package.json | 3 - .../test/fixtures/main-field-self2/index.js | 0 .../fixtures/main-field-self2/package.json | 3 - .../enhanced_resolve/test/fixtures/main1.js | 9 - .../enhanced_resolve/test/fixtures/main2.js | 12 - .../enhanced_resolve/test/fixtures/main3.js | 4 - .../multiple_modules/node_modules/m1/a.js | 3 - .../test/fixtures/no#fragment/#/#.js | 0 fixtures/enhanced_resolve/test/fixtures/no.js | 0 .../browser-module-broken/browser.js | 0 .../browser-module-broken/main.js | 0 .../browser-module-broken/package.json | 4 - .../complexm/node_modules/m1/a.js | 1 - .../complexm/node_modules/m1/index.js | 1 - .../fixtures/node_modules/complexm/step1.js | 1 - .../fixtures/node_modules/complexm/step2.js | 1 - .../fixtures/node_modules/dash-name/index.js | 0 .../node_modules/dash-name/package.json | 4 - .../test/fixtures/node_modules/dash/index.js | 0 .../fixtures/node_modules/dash/package.json | 4 - .../invalidPackageJson/package.json | 0 .../test/fixtures/node_modules/m1/a.js | 3 - .../test/fixtures/node_modules/m1/b.js | 3 - .../test/fixtures/node_modules/m2/b.js | 1 - .../node_modules/recursive-module/file.js | 0 .../node_modules/recursive-module/index.js | 0 .../test/fixtures/pnp-a/m2/a.js | 3 - .../test/fixtures/pnp/pkg/dir/index.js | 0 .../test/fixtures/pnp/pkg/index.js | 0 .../test/fixtures/pnp/pkg/main.js | 0 .../fixtures/pnp/pkg/package-alias/browser.js | 0 .../fixtures/pnp/pkg/package-alias/index.js | 0 .../test/fixtures/pnp/pkg/package.json | 7 - .../test/fixtures/pnp/pkg/typescript/index.ts | 0 .../test/fixtures/pnp/pkg3/a.js | 1 - .../test/fixtures/pnp/pkg3/package.json | 8 - .../prefer-pnp/alternative-modules/m1/b.js | 0 .../restrictions/node_modules/pck1/index.css | 0 .../restrictions/node_modules/pck1/index.js | 0 .../node_modules/pck1/package.json | 3 - .../restrictions/node_modules/pck2/index.css | 0 .../restrictions/node_modules/pck2/module.js | 0 .../node_modules/pck2/package.json | 5 - .../test/fixtures/roots_fall_through/index.js | 0 .../scoped/node_modules/@scope/pack1/main.js | 0 .../node_modules/@scope/pack1/package.json | 5 - .../node_modules/@scope/pack2/lib/index.js | 0 .../scoped/node_modules/@scope/pack2/main.js | 0 .../node_modules/@scope/pack2/package.json | 3 - .../test/fixtures/shortcutdir.js/a.js | 0 .../test/fixtures/yield/a/foo-2/b | 0 .../test/fixtures/yield/a/foo-2/c | 0 .../test/fixtures/yield/a/foo/a | 0 .../test/fixtures/yield/a/foo/b | 0 .../test/fixtures/yield/b/foo/a | 0 .../test/fixtures/yield/c/foo/a | 0 .../test/fixtures/yield/c/foo/package.json | 7 - .../fixtures/\346\265\213\350\257\225.js" | 0 .../\344\270\255\346\226\207.js" | 0 fixtures/pnpm/.gitignore | 1 - fixtures/pnpm/package.json | 10 - fixtures/pnpm/pnpm-lock.yaml | 212 -- fixtures/tsconfig/cases/builtins/thing.js | 0 .../tsconfig/cases/builtins/tsconfig.json | 5 - fixtures/tsconfig/cases/exports/index.js | 0 fixtures/tsconfig/cases/exports/tsconfig.json | 3 - .../extends-extension/base-tsconfig.json | 7 - .../tsconfig/cases/extends-extension/foo.js | 0 .../cases/extends-extension/tsconfig.json | 3 - .../cases/extends-extensionless/foo.js | 0 .../cases/extends-extensionless/tsconfig.json | 3 - .../tsconfig/cases/extends-multiple/foo.js | 0 .../cases/extends-multiple/tsconfig.json | 6 - .../tsconfig/cases/extends-not-found/index.js | 0 .../cases/extends-not-found/tsconfig.json | 3 - .../tsconfig/cases/extends-paths/src/index.js | 0 .../cases/extends-paths/tsconfig.base.json | 7 - .../cases/extends-paths/tsconfig.json | 6 - fixtures/tsconfig/cases/field/index.js | 0 fixtures/tsconfig/cases/field/tsconfig.json | 3 - fixtures/tsconfig/cases/index/index.js | 0 fixtures/tsconfig/cases/index/tsconfig.json | 3 - .../cases/paths_template_variable/foo.js | 0 .../paths_template_variable/tsconfig1.json | 3 - .../paths_template_variable/tsconfig2.json | 8 - .../project_references/app/aliased/index.ts | 0 .../cases/project_references/app/index.ts | 0 .../project_references/app/tsconfig.json | 23 - .../project_a/aliased/index.ts | 0 .../project_references/project_a/conf.json | 8 - .../project_references/project_a/index.ts | 0 .../project_b/src/aliased/index.ts | 0 .../project_b/tsconfig.json | 9 - .../project_references/project_c/index.ts | 0 .../project_c/tsconfig.json | 5 - .../project_references/tsconfig.base.json | 4 - fixtures/tsconfig/cases/suffixes/a.ios.ts | 0 fixtures/tsconfig/cases/suffixes/a.ts | 0 fixtures/tsconfig/cases/suffixes/b.ts | 0 fixtures/tsconfig/cases/suffixes/c-test.ts | 0 fixtures/tsconfig/cases/suffixes/index.ts | 1 - .../tsconfig/cases/suffixes/tsconfig.json | 5 - fixtures/tsconfig/cases/trailing-comma/bar.js | 0 .../tsconfig/cases/trailing-comma/index.js | 0 .../cases/trailing-comma/tsconfig.json | 9 - fixtures/tsconfig/foo.js | 0 fixtures/tsconfig/nested/index.js | 0 fixtures/tsconfig/nested/test.js | 0 fixtures/tsconfig/nested/tsconfig.json | 8 - .../node_modules/tsconfig-exports/conf.json | 7 - .../node_modules/tsconfig-exports/foo.js | 0 .../tsconfig-exports/package.json | 7 - .../node_modules/tsconfig-field/conf.json | 7 - .../node_modules/tsconfig-field/foo.js | 0 .../node_modules/tsconfig-field/package.json | 5 - .../node_modules/tsconfig-index/foo.js | 0 .../node_modules/tsconfig-index/package.json | 4 - .../node_modules/tsconfig-index/tsconfig.json | 7 - .../node_modules/tsconfig-not-used/foo.js | 0 .../tsconfig-not-used/tsconfig.json | 7 - fixtures/tsconfig/package.json | 24 - fixtures/tsconfig/tsconfig.json | 7 - fixtures/tsconfig/tsconfig_broken.json | 1 - .../tsconfig/tsconfig_template_variable.json | 7 - napi/Source/lib.rs | 25 +- napi/Source/tracing.rs | 4 +- napi/__test__/resolver.spec.mjs | 260 -- napi/src/lib.rs | 207 -- napi/src/options.rs | 261 -- napi/src/tracing.rs | 25 - napi/tests/options.test.mjs | 59 - npm/package.json | 77 +- package.json | 53 +- pnpm-lock.yaml | 2690 ----------------- src/builtins.rs | 71 - src/cache.rs | 369 --- src/context.rs | 89 - src/error.rs | 178 -- src/file_system.rs | 133 - src/lib.rs | 1689 ----------- src/options.rs | 623 ---- src/package_json.rs | 219 -- src/path.rs | 132 - src/resolution.rs | 92 - src/specifier.rs | 230 -- src/tests/alias.rs | 280 -- src/tests/browser_field.rs | 189 -- src/tests/builtins.rs | 121 - src/tests/dependencies.rs | 110 - src/tests/exports_field.rs | 2546 ---------------- src/tests/extension_alias.rs | 66 - src/tests/extensions.rs | 125 - src/tests/fallback.rs | 100 - src/tests/full_specified.rs | 113 - src/tests/imports_field.rs | 1320 -------- src/tests/incorrect_description_file.rs | 65 - src/tests/main_field.rs | 24 - src/tests/memory_fs.rs | 74 - src/tests/missing.rs | 106 - src/tests/mod.rs | 49 - src/tests/resolve.rs | 119 - src/tests/restrictions.rs | 25 - src/tests/roots.rs | 92 - src/tests/scoped_packages.rs | 25 - src/tests/simple.rs | 68 - src/tests/symlink.rs | 121 - src/tests/tsconfig_paths.rs | 530 ---- src/tests/tsconfig_project_references.rs | 132 - src/tsconfig.rs | 223 -- tests/integration_test.rs | 103 - tests/package.json | 5 - tests/resolve_test.rs | 104 - 297 files changed, 94 insertions(+), 15919 deletions(-) delete mode 100644 Cargo.lock delete mode 100644 fixtures/enhanced_resolve/lib/index.js delete mode 100644 fixtures/enhanced_resolve/package.json delete mode 100644 fixtures/enhanced_resolve/test/.gitignore delete mode 100644 fixtures/enhanced_resolve/test/fixtures/#/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/abc.txt delete mode 100644 fixtures/enhanced_resolve/test/fixtures/alias/files/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/browser/module-a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/ignore.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/replaced.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/self.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/toString.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-c.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/c.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/d.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/builtins/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/c.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/complex.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/crypto-js/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/decorated-fs/exists.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/dirOrFile.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/directory-default/directory-default.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/pack1/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/umd.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/index delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/src/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.mts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mjs delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mts.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/app.module.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/foo.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/foo.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/file.load1 delete mode 100644 fixtures/enhanced_resolve/test/fixtures/file.load2 delete mode 100644 fixtures/enhanced_resolve/test/fixtures/foo/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/foo/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/internal/file.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/y/y.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/internal/i.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-3/nested/f/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-4/f/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f$/$.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f/$.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/dir/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/c/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/issue-238/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/issue-238/src/a/config.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/issue-238/src/common/config/myObjectFile.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/lib.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/lib/complex1.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self2/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main1.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main2.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main3.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/no#fragment/#/#.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/no.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/invalidPackageJson/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/file.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/dir/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/typescript/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/prefer-pnp/alternative-modules/m1/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.css delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/index.css delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/module.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/roots_fall_through/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/lib/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/shortcutdir.js/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/b delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/c delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo/a delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo/b delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/b/foo/a delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/c/foo/a delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json delete mode 100644 "fixtures/enhanced_resolve/test/fixtures/\346\265\213\350\257\225.js" delete mode 100644 "fixtures/misc/\344\270\255\346\226\207/\344\270\255\346\226\207.js" delete mode 100644 fixtures/pnpm/.gitignore delete mode 100644 fixtures/pnpm/package.json delete mode 100644 fixtures/pnpm/pnpm-lock.yaml delete mode 100644 fixtures/tsconfig/cases/builtins/thing.js delete mode 100644 fixtures/tsconfig/cases/builtins/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/exports/index.js delete mode 100644 fixtures/tsconfig/cases/exports/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-extension/base-tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-extension/foo.js delete mode 100644 fixtures/tsconfig/cases/extends-extension/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-extensionless/foo.js delete mode 100644 fixtures/tsconfig/cases/extends-extensionless/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-multiple/foo.js delete mode 100644 fixtures/tsconfig/cases/extends-multiple/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-not-found/index.js delete mode 100644 fixtures/tsconfig/cases/extends-not-found/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-paths/src/index.js delete mode 100644 fixtures/tsconfig/cases/extends-paths/tsconfig.base.json delete mode 100644 fixtures/tsconfig/cases/extends-paths/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/field/index.js delete mode 100644 fixtures/tsconfig/cases/field/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/index/index.js delete mode 100644 fixtures/tsconfig/cases/index/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/paths_template_variable/foo.js delete mode 100644 fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json delete mode 100644 fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json delete mode 100644 fixtures/tsconfig/cases/project_references/app/aliased/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/app/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/app/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/project_references/project_a/aliased/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_a/conf.json delete mode 100644 fixtures/tsconfig/cases/project_references/project_a/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_b/src/aliased/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_b/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/project_references/project_c/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_c/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/project_references/tsconfig.base.json delete mode 100644 fixtures/tsconfig/cases/suffixes/a.ios.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/a.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/b.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/c-test.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/index.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/trailing-comma/bar.js delete mode 100644 fixtures/tsconfig/cases/trailing-comma/index.js delete mode 100644 fixtures/tsconfig/cases/trailing-comma/tsconfig.json delete mode 100644 fixtures/tsconfig/foo.js delete mode 100644 fixtures/tsconfig/nested/index.js delete mode 100644 fixtures/tsconfig/nested/test.js delete mode 100644 fixtures/tsconfig/nested/tsconfig.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-exports/conf.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-exports/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-exports/package.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-field/conf.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-field/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-field/package.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-index/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-index/package.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-not-used/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json delete mode 100755 fixtures/tsconfig/package.json delete mode 100644 fixtures/tsconfig/tsconfig.json delete mode 100644 fixtures/tsconfig/tsconfig_broken.json delete mode 100644 fixtures/tsconfig/tsconfig_template_variable.json delete mode 100644 napi/__test__/resolver.spec.mjs delete mode 100644 napi/src/lib.rs delete mode 100644 napi/src/options.rs delete mode 100644 napi/src/tracing.rs delete mode 100644 napi/tests/options.test.mjs delete mode 100644 pnpm-lock.yaml delete mode 100644 src/builtins.rs delete mode 100644 src/cache.rs delete mode 100644 src/context.rs delete mode 100644 src/error.rs delete mode 100644 src/file_system.rs delete mode 100644 src/lib.rs delete mode 100644 src/options.rs delete mode 100644 src/package_json.rs delete mode 100644 src/path.rs delete mode 100644 src/resolution.rs delete mode 100644 src/specifier.rs delete mode 100644 src/tests/alias.rs delete mode 100644 src/tests/browser_field.rs delete mode 100644 src/tests/builtins.rs delete mode 100644 src/tests/dependencies.rs delete mode 100644 src/tests/exports_field.rs delete mode 100644 src/tests/extension_alias.rs delete mode 100644 src/tests/extensions.rs delete mode 100644 src/tests/fallback.rs delete mode 100644 src/tests/full_specified.rs delete mode 100644 src/tests/imports_field.rs delete mode 100644 src/tests/incorrect_description_file.rs delete mode 100644 src/tests/main_field.rs delete mode 100644 src/tests/memory_fs.rs delete mode 100644 src/tests/missing.rs delete mode 100644 src/tests/mod.rs delete mode 100644 src/tests/resolve.rs delete mode 100644 src/tests/restrictions.rs delete mode 100644 src/tests/roots.rs delete mode 100644 src/tests/scoped_packages.rs delete mode 100644 src/tests/simple.rs delete mode 100644 src/tests/symlink.rs delete mode 100644 src/tests/tsconfig_paths.rs delete mode 100644 src/tests/tsconfig_project_references.rs delete mode 100644 src/tsconfig.rs delete mode 100644 tests/integration_test.rs delete mode 100644 tests/package.json delete mode 100644 tests/resolve_test.rs diff --git a/Cargo.lock b/Cargo.lock deleted file mode 100644 index 7ef169f0..00000000 --- a/Cargo.lock +++ /dev/null @@ -1,871 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "aho-corasick" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" -dependencies = [ - "memchr", -] - -[[package]] -name = "anes" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "735d4f398ca57cfa2880225c2bf81c3b9af3be5bb22e44ae70118dad38713e84" - -[[package]] -name = "autocfg" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "bitflags" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" - -[[package]] -name = "bpaf" -version = "0.9.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3280efcf6d66bc77c2cf9b67dc8acee47a217d9be67dd590b3230dffe663724d" - -[[package]] -name = "cast" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "ciborium" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42e69ffd6f0917f5c029256a24d0161db17cea3997d185db0d35926308770f0e" -dependencies = [ - "ciborium-io", - "ciborium-ll", - "serde", -] - -[[package]] -name = "ciborium-io" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05afea1e0a06c9be33d539b876f1ce3692f4afea2cb41f740e7743225ed1c757" - -[[package]] -name = "ciborium-ll" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57663b653d948a338bfb3eeba9bb2fd5fcfaecb9e199e87e1eda4d9e8b240fd9" -dependencies = [ - "ciborium-io", - "half", -] - -[[package]] -name = "codspeed" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a104ac948e0188b921eb3fcbdd55dcf62e542df4c7ab7e660623f6288302089" -dependencies = [ - "colored", - "libc", - "serde_json", -] - -[[package]] -name = "colored" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbf2150cce219b664a8a70df7a1f933836724b503f8a413af9365b4dcc4d90b8" -dependencies = [ - "lazy_static", - "windows-sys 0.48.0", -] - -[[package]] -name = "convert_case" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec182b0ca2f35d8fc196cf3404988fd8b8c739a4d270ff118a398feb0cbec1ca" -dependencies = [ - "unicode-segmentation", -] - -[[package]] -name = "criterion2" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7258985df1aa8b33359ee2392cbc3b7802875242cdacdda91a17a602132c24a9" -dependencies = [ - "anes", - "bpaf", - "cast", - "ciborium", - "codspeed", - "colored", - "num-traits", - "oorandom", - "serde", - "serde_json", - "walkdir", -] - -[[package]] -name = "crossbeam-deque" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" -dependencies = [ - "crossbeam-epoch", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.9.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" -dependencies = [ - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" - -[[package]] -name = "crunchy" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" - -[[package]] -name = "ctor" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edb49164822f3ee45b17acd4a208cfc1251410cf0cad9a833234c9890774dd9f" -dependencies = [ - "quote", - "syn", -] - -[[package]] -name = "dashmap" -version = "6.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "804c8821570c3f8b70230c2ba75ffa5c0f9a4189b9a432b6656c536712acae28" -dependencies = [ - "cfg-if", - "crossbeam-utils", - "hashbrown", - "lock_api", - "once_cell", - "parking_lot_core", -] - -[[package]] -name = "document-features" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef5282ad69563b5fc40319526ba27e0e7363d552a896f0297d54f767717f9b95" -dependencies = [ - "litrs", -] - -[[package]] -name = "dunce" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b" - -[[package]] -name = "either" -version = "1.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" - -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "filetime" -version = "0.2.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ee447700ac8aa0b2f2bd7bc4462ad686ba06baa6727ac149a2d6277f0d240fd" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall 0.4.1", - "windows-sys 0.52.0", -] - -[[package]] -name = "half" -version = "2.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dd08c532ae367adf81c312a4580bc67f1d0fe8bc9c460520283f4c0ff277888" -dependencies = [ - "cfg-if", - "crunchy", -] - -[[package]] -name = "hashbrown" -version = "0.14.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" - -[[package]] -name = "indexmap" -version = "2.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" -dependencies = [ - "equivalent", - "hashbrown", - "serde", -] - -[[package]] -name = "itoa" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" - -[[package]] -name = "json-strip-comments" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3d129799327c8f80861e467c59b825ba24c277dba6ad0d71a141dc98f9e04ee" - -[[package]] -name = "lazy_static" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" - -[[package]] -name = "libc" -version = "0.2.155" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" - -[[package]] -name = "libloading" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e310b3a6b5907f99202fcdb4960ff45b93735d7c7d96b760fcff8db2dc0e103d" -dependencies = [ - "cfg-if", - "windows-targets 0.52.5", -] - -[[package]] -name = "litrs" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4ce301924b7887e9d637144fdade93f9dfff9b60981d4ac161db09720d39aa5" - -[[package]] -name = "lock_api" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" -dependencies = [ - "autocfg", - "scopeguard", -] - -[[package]] -name = "memchr" -version = "2.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" - -[[package]] -name = "napi" -version = "2.16.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1bd081bbaef43600fd2c5dd4c525b8ecea7dfdacf40ebc674e87851dce6559e" -dependencies = [ - "bitflags 2.6.0", - "ctor", - "napi-derive", - "napi-sys", - "once_cell", - "serde", - "serde_json", -] - -[[package]] -name = "napi-build" -version = "2.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1c0f5d67ee408a4685b61f5ab7e58605c8ae3f2b4189f0127d804ff13d5560a" - -[[package]] -name = "napi-derive" -version = "2.16.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eafd2b920906ea5b1f5f1f9d1eff9cc74e4ff8124dca41b501c1413079589187" -dependencies = [ - "cfg-if", - "convert_case", - "napi-derive-backend", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "napi-derive-backend" -version = "1.0.70" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b370b784440c65eb9001d839012eb912ee43e3a2d0361e2c30c13052372c39fe" -dependencies = [ - "convert_case", - "once_cell", - "proc-macro2", - "quote", - "regex", - "semver", - "syn", -] - -[[package]] -name = "napi-sys" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "427802e8ec3a734331fec1035594a210ce1ff4dc5bc1950530920ab717964ea3" -dependencies = [ - "libloading", -] - -[[package]] -name = "normalize-path" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5438dd2b2ff4c6df6e1ce22d825ed2fa93ee2922235cc45186991717f0a892d" - -[[package]] -name = "num-traits" -version = "0.2.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" -dependencies = [ - "autocfg", -] - -[[package]] -name = "once_cell" -version = "1.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" - -[[package]] -name = "oorandom" -version = "11.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575" - -[[package]] -name = "oxc_napi_resolver" -version = "0.0.0" -dependencies = [ - "napi", - "napi-build", - "napi-derive", - "oxc_resolver", - "tracing-subscriber", -] - -[[package]] -name = "oxc_resolver" -version = "1.9.3" -dependencies = [ - "criterion2", - "dashmap", - "document-features", - "dunce", - "indexmap", - "json-strip-comments", - "normalize-path", - "once_cell", - "rayon", - "rustc-hash", - "serde", - "serde_json", - "thiserror", - "tracing", - "vfs", -] - -[[package]] -name = "parking_lot_core" -version = "0.9.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall 0.5.2", - "smallvec", - "windows-targets 0.52.5", -] - -[[package]] -name = "pin-project-lite" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" - -[[package]] -name = "proc-macro2" -version = "1.0.86" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.36" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "rayon" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" -dependencies = [ - "either", - "rayon-core", -] - -[[package]] -name = "rayon-core" -version = "1.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" -dependencies = [ - "crossbeam-deque", - "crossbeam-utils", -] - -[[package]] -name = "redox_syscall" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" -dependencies = [ - "bitflags 1.3.2", -] - -[[package]] -name = "redox_syscall" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c82cf8cff14456045f55ec4241383baeff27af886adb72ffb2162f99911de0fd" -dependencies = [ - "bitflags 2.6.0", -] - -[[package]] -name = "regex" -version = "1.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b91213439dad192326a0d7c6ee3955910425f441d7038e0d6933b0aec5c4517f" -dependencies = [ - "aho-corasick", - "memchr", - "regex-automata", - "regex-syntax", -] - -[[package]] -name = "regex-automata" -version = "0.4.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", -] - -[[package]] -name = "regex-syntax" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" - -[[package]] -name = "rustc-hash" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" - -[[package]] -name = "ryu" -version = "1.0.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" - -[[package]] -name = "same-file" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "scopeguard" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" - -[[package]] -name = "semver" -version = "1.0.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" - -[[package]] -name = "serde" -version = "1.0.203" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7253ab4de971e72fb7be983802300c30b5a7f0c2e56fab8abfc6a214307c0094" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.203" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "serde_json" -version = "1.0.120" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e0d21c9a8cae1235ad58a00c11cb40d4b1e5c784f1ef2c537876ed6ffd8b7c5" -dependencies = [ - "indexmap", - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "sharded-slab" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" -dependencies = [ - "lazy_static", -] - -[[package]] -name = "smallvec" -version = "1.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" - -[[package]] -name = "syn" -version = "2.0.68" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "901fa70d88b9d6c98022e23b4136f9f3e54e4662c3bc1bd1d84a42a9a0f0c1e9" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "thiserror" -version = "1.0.61" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.61" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "thread_local" -version = "1.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" -dependencies = [ - "cfg-if", - "once_cell", -] - -[[package]] -name = "tracing" -version = "0.1.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" -dependencies = [ - "pin-project-lite", - "tracing-attributes", - "tracing-core", -] - -[[package]] -name = "tracing-attributes" -version = "0.1.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "tracing-core" -version = "0.1.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" -dependencies = [ - "once_cell", -] - -[[package]] -name = "tracing-subscriber" -version = "0.3.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" -dependencies = [ - "sharded-slab", - "thread_local", - "tracing-core", -] - -[[package]] -name = "unicode-ident" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" - -[[package]] -name = "unicode-segmentation" -version = "1.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" - -[[package]] -name = "vfs" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "654cd097e182a71dbf899178e6b5662c2157dd0b8afd5975de18008f6fc173d1" -dependencies = [ - "filetime", -] - -[[package]] -name = "walkdir" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" -dependencies = [ - "same-file", - "winapi-util", -] - -[[package]] -name = "winapi-util" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b" -dependencies = [ - "windows-sys 0.52.0", -] - -[[package]] -name = "windows-sys" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" -dependencies = [ - "windows-targets 0.48.5", -] - -[[package]] -name = "windows-sys" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" -dependencies = [ - "windows-targets 0.52.5", -] - -[[package]] -name = "windows-targets" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" -dependencies = [ - "windows_aarch64_gnullvm 0.48.5", - "windows_aarch64_msvc 0.48.5", - "windows_i686_gnu 0.48.5", - "windows_i686_msvc 0.48.5", - "windows_x86_64_gnu 0.48.5", - "windows_x86_64_gnullvm 0.48.5", - "windows_x86_64_msvc 0.48.5", -] - -[[package]] -name = "windows-targets" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" -dependencies = [ - "windows_aarch64_gnullvm 0.52.5", - "windows_aarch64_msvc 0.52.5", - "windows_i686_gnu 0.52.5", - "windows_i686_gnullvm", - "windows_i686_msvc 0.52.5", - "windows_x86_64_gnu 0.52.5", - "windows_x86_64_gnullvm 0.52.5", - "windows_x86_64_msvc 0.52.5", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" - -[[package]] -name = "windows_i686_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" - -[[package]] -name = "windows_i686_gnu" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" - -[[package]] -name = "windows_i686_gnullvm" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" - -[[package]] -name = "windows_i686_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" - -[[package]] -name = "windows_i686_msvc" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" diff --git a/Source/error.rs b/Source/error.rs index d8b190ba..901e67ff 100644 --- a/Source/error.rs +++ b/Source/error.rs @@ -28,6 +28,10 @@ pub enum ResolveError { #[error("Tsconfig not found {0}")] TsconfigNotFound(PathBuf), + /// Tsconfig's project reference path points to it self + #[error("Tsconfig's project reference path points to this tsconfig {0}")] + TsconfigSelfReference(PathBuf), + #[error("{0}")] IOError(IOError), diff --git a/Source/lib.rs b/Source/lib.rs index ac95d63f..cfe6c25a 100644 --- a/Source/lib.rs +++ b/Source/lib.rs @@ -1099,7 +1099,14 @@ impl ResolverGeneric { let tsconfig = self.cache.tsconfig( /* root */ true, &reference_tsconfig_path, - |_| Ok(()), + |reference_tsconfig| { + if reference_tsconfig.path == tsconfig.path { + return Err(ResolveError::TsconfigSelfReference( + reference_tsconfig.path.clone(), + )); + } + Ok(()) + }, )?; reference.tsconfig.replace(tsconfig); } diff --git a/Source/tsconfig.rs b/Source/tsconfig.rs index 9ea23c99..0de8e8ec 100644 --- a/Source/tsconfig.rs +++ b/Source/tsconfig.rs @@ -29,7 +29,7 @@ pub struct TsConfig { /// Path to `tsconfig.json`. Contains the `tsconfig.json` filename. #[serde(skip)] - path: PathBuf, + pub(crate) path: PathBuf, #[serde(default)] pub extends: Option, diff --git a/fixtures/enhanced_resolve/lib/index.js b/fixtures/enhanced_resolve/lib/index.js deleted file mode 100644 index 1e872e8f..00000000 --- a/fixtures/enhanced_resolve/lib/index.js +++ /dev/null @@ -1 +0,0 @@ -// mimic enhanced-resolved root directory structure diff --git a/fixtures/enhanced_resolve/package.json b/fixtures/enhanced_resolve/package.json deleted file mode 100644 index d1b845b5..00000000 --- a/fixtures/enhanced_resolve/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "enhanced-resolve", - "main": "lib/index.js" -} diff --git a/fixtures/enhanced_resolve/test/.gitignore b/fixtures/enhanced_resolve/test/.gitignore deleted file mode 100644 index bbbec5f4..00000000 --- a/fixtures/enhanced_resolve/test/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# created by symlink.rs -/temp diff --git a/fixtures/enhanced_resolve/test/fixtures/#/a.js b/fixtures/enhanced_resolve/test/fixtures/#/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/a.js b/fixtures/enhanced_resolve/test/fixtures/a.js deleted file mode 100644 index 896ffc6d..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/abc.txt b/fixtures/enhanced_resolve/test/fixtures/abc.txt deleted file mode 100644 index f2ba8f84..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/abc.txt +++ /dev/null @@ -1 +0,0 @@ -abc \ No newline at end of file diff --git a/fixtures/enhanced_resolve/test/fixtures/alias/files/a.js b/fixtures/enhanced_resolve/test/fixtures/alias/files/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/b.js b/fixtures/enhanced_resolve/test/fixtures/b.js deleted file mode 100644 index 11476340..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/b.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function b() { - return "This is b"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/browser/module-a.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/browser/module-a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/browser.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/ignore.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/ignore.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/replaced.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/replaced.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/self.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/self.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/toString.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/toString.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-a.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-b.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-c.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-c.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/a.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/b.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/c.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/c.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/d.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/d.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json deleted file mode 100644 index c13fe23b..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "browser": { - "a.js": "./a", - "./b.js": "./b", - "c.js": "./d.js", - "./d.js": "./c.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/package.json b/fixtures/enhanced_resolve/test/fixtures/browser-module/package.json deleted file mode 100644 index 19ff7739..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/browser-module/package.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "exports": { - "./lib/index.js": "./lib/index.js" - }, - "browser": { - "./lib/ignore.js": false, - "./lib/replaced.js": "./lib/browser", - "module-a": "./browser/module-a.js", - "module-b": "module-c", - "module-c": "module-c", - "./toString": "./lib/toString.js", - "./lib/main.js": "./lib/main.js", - "./main.js": "./lib/main.js", - "./lib/xyz.js": "./xyz.js", - "./xyz.js": "./lib/xyz.js", - "./lib/non-existent.js": "./lib/non-existent.js", - ".": false, - "./number": 1, - "./foo": "./lib/replaced.js?query" - }, - "innerBrowser1": { - "field": { - "browser": { - "./lib/main1.js": "./lib/main.js" - } - } - }, - "innerBrowser2": { - "browser": { - "./lib/main2.js": "./lib/replaced.js" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/builtins/package.json b/fixtures/enhanced_resolve/test/fixtures/builtins/package.json deleted file mode 100644 index 4a54ea96..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/builtins/package.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "name": "builtins", - "private": true, - "imports": { - "#fs": { - "default": "fs" - }, - "#http": { - "node": "node:http" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/c.js b/fixtures/enhanced_resolve/test/fixtures/c.js deleted file mode 100644 index e3aca8aa..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/c.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = function b() { - require("./a"); - return "This is c"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/complex.js b/fixtures/enhanced_resolve/test/fixtures/complex.js deleted file mode 100644 index 1f62db84..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/complex.js +++ /dev/null @@ -1,13 +0,0 @@ -var 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); diff --git a/fixtures/enhanced_resolve/test/fixtures/crypto-js/index.js b/fixtures/enhanced_resolve/test/fixtures/crypto-js/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json b/fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json deleted file mode 100644 index 1d31aa8b..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "crypto-js", - "main": "index.js", - "browser": { - "crypto": false - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/decorated-fs/exists.js b/fixtures/enhanced_resolve/test/fixtures/decorated-fs/exists.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/dirOrFile.js b/fixtures/enhanced_resolve/test/fixtures/dirOrFile.js deleted file mode 100644 index c3cb885f..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/dirOrFile.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "file"; diff --git a/fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js b/fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js deleted file mode 100644 index 85e01cd4..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "dir"; diff --git a/fixtures/enhanced_resolve/test/fixtures/directory-default/directory-default.js b/fixtures/enhanced_resolve/test/fixtures/directory-default/directory-default.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js deleted file mode 100644 index d1007aae..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js +++ /dev/null @@ -1 +0,0 @@ -export default "string"; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts deleted file mode 100644 index cb0ff5c3..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json deleted file mode 100644 index b523a1e9..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "@org/pkg", - "exports": { - "./*.js": { - "types": "./dist/*.d.ts", - "default": "./dist/*.js" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js deleted file mode 100644 index d1007aae..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js +++ /dev/null @@ -1 +0,0 @@ -export default "string"; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts deleted file mode 100644 index cb0ff5c3..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json deleted file mode 100644 index 8e55fb46..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "@raviqqe/hidash", - "exports": { - "./*.js": { - "types": "./dist/*.d.ts", - "default": "./dist/*.js" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json deleted file mode 100644 index f0edf449..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "exports-field", - "version": "1.0.0", - "exports": { - ".": "./a/../b/../../pack1/index.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/pack1/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/pack1/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/a.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/a.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json deleted file mode 100644 index 6b105c08..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "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/": { - "webpack": ["./lib/lib2/", "./lib/"], - "node": "./lib/", - "default": "./lib/" - }, - "./dist/a.js": "./../../a.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json deleted file mode 100644 index 0012a3de..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "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" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/umd.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/umd.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field/package.json deleted file mode 100644 index 5fa72bb5..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "@exports-field/core", - "version": "1.0.0", - "exports": "./a.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json deleted file mode 100644 index e6f12074..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "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/lib2/", "./lib/"], - "node": "./lib/", - "default": "./lib/" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/index b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/index deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json deleted file mode 100644 index 1a838f49..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "name": "exports-field", - "exportsField": { - "exports": "./main.js" - }, - "ex": "./index", - "broken": { - ".": "./src" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/src/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/src/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.ts b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.mts b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.mts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mjs b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mjs deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mts.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mts.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.ts b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/app.module.js b/fixtures/enhanced_resolve/test/fixtures/extensions/app.module.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.js b/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/foo.js b/fixtures/enhanced_resolve/test/fixtures/extensions/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/foo.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/foo.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/index.js b/fixtures/enhanced_resolve/test/fixtures/extensions/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/index.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module.js b/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module/index.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/package.json b/fixtures/enhanced_resolve/test/fixtures/extensions/package.json deleted file mode 100644 index 5e55a1e8..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/extensions/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "./index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/file.load1 b/fixtures/enhanced_resolve/test/fixtures/file.load1 deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/file.load2 b/fixtures/enhanced_resolve/test/fixtures/file.load2 deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/foo/index.js b/fixtures/enhanced_resolve/test/fixtures/foo/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/foo/package.json b/fixtures/enhanced_resolve/test/fixtures/foo/package.json deleted file mode 100644 index da86787a..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/foo/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "foo", - "version": "1.0.0" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json deleted file mode 100644 index aa2be496..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "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" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/internal/file.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/internal/file.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/y/y.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/y/y.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/internal/i.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/internal/i.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/nested/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js deleted file mode 100644 index e5b70a86..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = { nested: "nested" } diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-3/nested/f/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-3/nested/f/nested/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-4/f/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-4/f/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f$/$.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f$/$.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f/$.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f/$.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/nested/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/a.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/a.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/b.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/dir/b.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/dir/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/index.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json deleted file mode 100644 index 8d8d3a46..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "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/lib2/", "./lib/"], - "node": "./lib/", - "default": "./lib/" - }, - "./dist/a.js": "./../../a.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/c/index.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/c/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/imports-field/package.json deleted file mode 100644 index 248351a9..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "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" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/a.js b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json deleted file mode 100644 index ded7faa2..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json +++ /dev/null @@ -1,2 +0,0 @@ -{ - "main": "./a.js", diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/a.js b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/package.json b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/package.json deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/issue-238/package.json b/fixtures/enhanced_resolve/test/fixtures/issue-238/package.json deleted file mode 100644 index 352055cd..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/issue-238/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "private": true -} diff --git a/fixtures/enhanced_resolve/test/fixtures/issue-238/src/a/config.js b/fixtures/enhanced_resolve/test/fixtures/issue-238/src/a/config.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/issue-238/src/common/config/myObjectFile.js b/fixtures/enhanced_resolve/test/fixtures/issue-238/src/common/config/myObjectFile.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/lib.js b/fixtures/enhanced_resolve/test/fixtures/lib.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/lib/complex1.js b/fixtures/enhanced_resolve/test/fixtures/lib/complex1.js deleted file mode 100644 index b3de3d70..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/lib/complex1.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "lib complex1"; diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self/index.js b/fixtures/enhanced_resolve/test/fixtures/main-field-self/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json b/fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json deleted file mode 100644 index a2b6f341..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "./" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self2/index.js b/fixtures/enhanced_resolve/test/fixtures/main-field-self2/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json b/fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json deleted file mode 100644 index 4fa6f730..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "." -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main1.js b/fixtures/enhanced_resolve/test/fixtures/main1.js deleted file mode 100644 index 168f2a1e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main1.js +++ /dev/null @@ -1,9 +0,0 @@ -var a = require("./a"); -if (x) { - for (var i = 0; i < 100; i++) { - while (true) require("./b"); - do { - i++; - } while (require("m1/a")()); - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main2.js b/fixtures/enhanced_resolve/test/fixtures/main2.js deleted file mode 100644 index 39f062b1..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main2.js +++ /dev/null @@ -1,12 +0,0 @@ -var 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"); - }); - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main3.js b/fixtures/enhanced_resolve/test/fixtures/main3.js deleted file mode 100644 index 1c180166..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main3.js +++ /dev/null @@ -1,4 +0,0 @@ -var a = require("./a"); -require.ensure([], function(require) { - require("./c.js"); -}); diff --git a/fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js b/fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js deleted file mode 100644 index 997c1051..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is nested m1/a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/no#fragment/#/#.js b/fixtures/enhanced_resolve/test/fixtures/no#fragment/#/#.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/no.js b/fixtures/enhanced_resolve/test/fixtures/no.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/browser.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/browser.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/main.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json deleted file mode 100644 index c469e1fd..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "main": "./main.js", - "browser": "./browser.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js deleted file mode 100644 index 549620a5..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "the correct a.js"; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js deleted file mode 100644 index 5db6632e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = " :) " + require("m2/b.js"); diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js deleted file mode 100644 index d308569d..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require("m1/a") + require("m1"); diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js deleted file mode 100644 index cb8127e8..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "Step2"; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json deleted file mode 100644 index 8d6dfa56..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "dash-name", - "exports": "./index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json deleted file mode 100644 index 4fd8706e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "dash", - "exports": "./index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/invalidPackageJson/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/invalidPackageJson/package.json deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js deleted file mode 100644 index 46fc8e6c..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is m1/a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js deleted file mode 100644 index 8565c244..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is m1/b"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js deleted file mode 100644 index 34faaaf5..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "This is m2/b"; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/file.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/file.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js b/fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js deleted file mode 100644 index 997c1051..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is nested m1/a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/dir/index.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/dir/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/index.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/main.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/browser.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/browser.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/index.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json deleted file mode 100644 index e20ceaeb..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "main": "main.js", - "browser": { - "./package-alias/index.js": "./package-alias/browser.js", - "module": "pkg/dir/index" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/typescript/index.ts b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/typescript/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json deleted file mode 100644 index 4a1f838e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "@exports-field/core", - "version": "1.0.0", - "exports": { - ".": "./a.js", - "./x": "./a.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/prefer-pnp/alternative-modules/m1/b.js b/fixtures/enhanced_resolve/test/fixtures/prefer-pnp/alternative-modules/m1/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.css b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.css deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.js b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json deleted file mode 100644 index 14ab704d..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/index.css b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/index.css deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/module.js b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/module.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json deleted file mode 100644 index ee0eb71b..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "main": "../../../c.js", - "module": "module.js", - "style": "index.css" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/roots_fall_through/index.js b/fixtures/enhanced_resolve/test/fixtures/roots_fall_through/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/main.js b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json deleted file mode 100644 index 70a0f20f..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "browser": { - "./index.js": "./main.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/lib/index.js b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/lib/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/main.js b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json deleted file mode 100644 index 2af9e0d1..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "./main.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/shortcutdir.js/a.js b/fixtures/enhanced_resolve/test/fixtures/shortcutdir.js/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/b b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/b deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/c b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/c deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/a b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/a deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/b b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/b deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/b/foo/a b/fixtures/enhanced_resolve/test/fixtures/yield/b/foo/a deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/a b/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/a deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json b/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json deleted file mode 100644 index 0acc4b4c..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "foo", - "version": "1.0.0", - "browser": { - "./a": false - } -} diff --git "a/fixtures/enhanced_resolve/test/fixtures/\346\265\213\350\257\225.js" "b/fixtures/enhanced_resolve/test/fixtures/\346\265\213\350\257\225.js" deleted file mode 100644 index e69de29b..00000000 diff --git "a/fixtures/misc/\344\270\255\346\226\207/\344\270\255\346\226\207.js" "b/fixtures/misc/\344\270\255\346\226\207/\344\270\255\346\226\207.js" deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/pnpm/.gitignore b/fixtures/pnpm/.gitignore deleted file mode 100644 index 3c3629e6..00000000 --- a/fixtures/pnpm/.gitignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/fixtures/pnpm/package.json b/fixtures/pnpm/package.json deleted file mode 100644 index 78712e2b..00000000 --- a/fixtures/pnpm/package.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "name": "pnpm", - "version": "1.0.0", - "private": true, - "devDependencies": { - "axios": "1.6.2", - "styled-components": "6.1.1", - "postcss": "8.4.33" - } -} diff --git a/fixtures/pnpm/pnpm-lock.yaml b/fixtures/pnpm/pnpm-lock.yaml deleted file mode 100644 index e51dfd6a..00000000 --- a/fixtures/pnpm/pnpm-lock.yaml +++ /dev/null @@ -1,212 +0,0 @@ -lockfileVersion: '6.0' - -settings: - autoInstallPeers: true - excludeLinksFromLockfile: false - -devDependencies: - axios: - specifier: 1.6.2 - version: 1.6.2 - postcss: - specifier: 8.4.33 - version: 8.4.33 - styled-components: - specifier: 6.1.1 - version: 6.1.1(react-dom@18.2.0)(react@18.2.0) - -packages: - - /@emotion/is-prop-valid@1.2.1: - resolution: {integrity: sha512-61Mf7Ufx4aDxx1xlDeOm8aFFigGHE4z+0sKCa+IHCeZKiyP9RLD0Mmx7m8b9/Cf37f7NAvQOOJAbQQGVr5uERw==} - dependencies: - '@emotion/memoize': 0.8.1 - dev: true - - /@emotion/memoize@0.8.1: - resolution: {integrity: sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA==} - dev: true - - /@emotion/unitless@0.8.1: - resolution: {integrity: sha512-KOEGMu6dmJZtpadb476IsZBclKvILjopjUii3V+7MnXIQCYh8W3NgNcgwo21n9LXZX6EDIKvqfjYxXebDwxKmQ==} - dev: true - - /@types/stylis@4.2.4: - resolution: {integrity: sha512-36ZrGJ8fgtBr6nwNnuJ9jXIj+bn/pF6UoqmrQT7+Y99+tFFeHHsoR54+194dHdyhPjgbeoNz3Qru0oRt0l6ASQ==} - dev: true - - /asynckit@0.4.0: - resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} - dev: true - - /axios@1.6.2: - resolution: {integrity: sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A==} - dependencies: - follow-redirects: 1.15.3 - form-data: 4.0.0 - proxy-from-env: 1.1.0 - transitivePeerDependencies: - - debug - dev: true - - /camelize@1.0.1: - resolution: {integrity: sha512-dU+Tx2fsypxTgtLoE36npi3UqcjSSMNYfkqgmoEhtZrraP5VWq0K7FkWVTYa8eMPtnU/G2txVsfdCJTn9uzpuQ==} - dev: true - - /combined-stream@1.0.8: - resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} - engines: {node: '>= 0.8'} - dependencies: - delayed-stream: 1.0.0 - dev: true - - /css-color-keywords@1.0.0: - resolution: {integrity: sha512-FyyrDHZKEjXDpNJYvVsV960FiqQyXc/LlYmsxl2BcdMb2WPx0OGRVgTg55rPSyLSNMqP52R9r8geSp7apN3Ofg==} - engines: {node: '>=4'} - dev: true - - /css-to-react-native@3.2.0: - resolution: {integrity: sha512-e8RKaLXMOFii+02mOlqwjbD00KSEKqblnpO9e++1aXS1fPQOpS1YoqdVHBqPjHNoxeF2mimzVqawm2KCbEdtHQ==} - dependencies: - camelize: 1.0.1 - css-color-keywords: 1.0.0 - postcss-value-parser: 4.2.0 - dev: true - - /csstype@3.1.2: - resolution: {integrity: sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==} - dev: true - - /delayed-stream@1.0.0: - resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} - engines: {node: '>=0.4.0'} - dev: true - - /follow-redirects@1.15.3: - resolution: {integrity: sha512-1VzOtuEM8pC9SFU1E+8KfTjZyMztRsgEfwQl44z8A25uy13jSzTj6dyK2Df52iV0vgHCfBwLhDWevLn95w5v6Q==} - engines: {node: '>=4.0'} - peerDependencies: - debug: '*' - peerDependenciesMeta: - debug: - optional: true - dev: true - - /form-data@4.0.0: - resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==} - engines: {node: '>= 6'} - dependencies: - asynckit: 0.4.0 - combined-stream: 1.0.8 - mime-types: 2.1.35 - dev: true - - /js-tokens@4.0.0: - resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} - dev: true - - /loose-envify@1.4.0: - resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==} - hasBin: true - dependencies: - js-tokens: 4.0.0 - dev: true - - /mime-db@1.52.0: - resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} - engines: {node: '>= 0.6'} - dev: true - - /mime-types@2.1.35: - resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} - engines: {node: '>= 0.6'} - dependencies: - mime-db: 1.52.0 - dev: true - - /nanoid@3.3.7: - resolution: {integrity: sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==} - engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} - hasBin: true - dev: true - - /picocolors@1.0.0: - resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==} - dev: true - - /postcss-value-parser@4.2.0: - resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==} - dev: true - - /postcss@8.4.33: - resolution: {integrity: sha512-Kkpbhhdjw2qQs2O2DGX+8m5OVqEcbB9HRBvuYM9pgrjEFUg30A9LmXNlTAUj4S9kgtGyrMbTzVjH7E+s5Re2yg==} - engines: {node: ^10 || ^12 || >=14} - dependencies: - nanoid: 3.3.7 - picocolors: 1.0.0 - source-map-js: 1.0.2 - dev: true - - /proxy-from-env@1.1.0: - resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==} - dev: true - - /react-dom@18.2.0(react@18.2.0): - resolution: {integrity: sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==} - peerDependencies: - react: ^18.2.0 - dependencies: - loose-envify: 1.4.0 - react: 18.2.0 - scheduler: 0.23.0 - dev: true - - /react@18.2.0: - resolution: {integrity: sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==} - engines: {node: '>=0.10.0'} - dependencies: - loose-envify: 1.4.0 - dev: true - - /scheduler@0.23.0: - resolution: {integrity: sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw==} - dependencies: - loose-envify: 1.4.0 - dev: true - - /shallowequal@1.1.0: - resolution: {integrity: sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ==} - dev: true - - /source-map-js@1.0.2: - resolution: {integrity: sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==} - engines: {node: '>=0.10.0'} - dev: true - - /styled-components@6.1.1(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-cpZZP5RrKRIClBW5Eby4JM1wElLVP4NQrJbJ0h10TidTyJf4SIIwa3zLXOoPb4gJi8MsJ8mjq5mu2IrEhZIAcQ==} - engines: {node: '>= 16'} - peerDependencies: - react: '>= 16.8.0' - react-dom: '>= 16.8.0' - dependencies: - '@emotion/is-prop-valid': 1.2.1 - '@emotion/unitless': 0.8.1 - '@types/stylis': 4.2.4 - css-to-react-native: 3.2.0 - csstype: 3.1.2 - postcss: 8.4.33 - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - shallowequal: 1.1.0 - stylis: 4.3.0 - tslib: 2.6.2 - dev: true - - /stylis@4.3.0: - resolution: {integrity: sha512-E87pIogpwUsUwXw7dNyU4QDjdgVMy52m+XEOPEKUn161cCzWjjhPSQhByfd1CcNvrOLnXQ6OnnZDwnJrz/Z4YQ==} - dev: true - - /tslib@2.6.2: - resolution: {integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==} - dev: true diff --git a/fixtures/tsconfig/cases/builtins/thing.js b/fixtures/tsconfig/cases/builtins/thing.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/builtins/tsconfig.json b/fixtures/tsconfig/cases/builtins/tsconfig.json deleted file mode 100644 index 36aa1a4d..00000000 --- a/fixtures/tsconfig/cases/builtins/tsconfig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compilerOptions": { - "baseUrl": "." - } -} diff --git a/fixtures/tsconfig/cases/exports/index.js b/fixtures/tsconfig/cases/exports/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/exports/tsconfig.json b/fixtures/tsconfig/cases/exports/tsconfig.json deleted file mode 100644 index f0e3159b..00000000 --- a/fixtures/tsconfig/cases/exports/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-exports" -} diff --git a/fixtures/tsconfig/cases/extends-extension/base-tsconfig.json b/fixtures/tsconfig/cases/extends-extension/base-tsconfig.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/cases/extends-extension/base-tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/cases/extends-extension/foo.js b/fixtures/tsconfig/cases/extends-extension/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-extension/tsconfig.json b/fixtures/tsconfig/cases/extends-extension/tsconfig.json deleted file mode 100644 index 0ae4c6a3..00000000 --- a/fixtures/tsconfig/cases/extends-extension/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./base-tsconfig" -} diff --git a/fixtures/tsconfig/cases/extends-extensionless/foo.js b/fixtures/tsconfig/cases/extends-extensionless/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-extensionless/tsconfig.json b/fixtures/tsconfig/cases/extends-extensionless/tsconfig.json deleted file mode 100644 index c36cb7d4..00000000 --- a/fixtures/tsconfig/cases/extends-extensionless/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-field/conf" -} diff --git a/fixtures/tsconfig/cases/extends-multiple/foo.js b/fixtures/tsconfig/cases/extends-multiple/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-multiple/tsconfig.json b/fixtures/tsconfig/cases/extends-multiple/tsconfig.json deleted file mode 100644 index aa2ae783..00000000 --- a/fixtures/tsconfig/cases/extends-multiple/tsconfig.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": ["../extends-extension", "../extends-paths"], - "compilerOptions": { - "baseUrl": ".", - }, -} diff --git a/fixtures/tsconfig/cases/extends-not-found/index.js b/fixtures/tsconfig/cases/extends-not-found/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-not-found/tsconfig.json b/fixtures/tsconfig/cases/extends-not-found/tsconfig.json deleted file mode 100644 index 99df91da..00000000 --- a/fixtures/tsconfig/cases/extends-not-found/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./not-found" -} diff --git a/fixtures/tsconfig/cases/extends-paths/src/index.js b/fixtures/tsconfig/cases/extends-paths/src/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-paths/tsconfig.base.json b/fixtures/tsconfig/cases/extends-paths/tsconfig.base.json deleted file mode 100644 index 5c64b067..00000000 --- a/fixtures/tsconfig/cases/extends-paths/tsconfig.base.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "@/*": ["./*"] - } - } -} diff --git a/fixtures/tsconfig/cases/extends-paths/tsconfig.json b/fixtures/tsconfig/cases/extends-paths/tsconfig.json deleted file mode 100644 index 51086018..00000000 --- a/fixtures/tsconfig/cases/extends-paths/tsconfig.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": "./tsconfig.base.json", - "compilerOptions": { - "baseUrl": "src", - }, -} diff --git a/fixtures/tsconfig/cases/field/index.js b/fixtures/tsconfig/cases/field/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/field/tsconfig.json b/fixtures/tsconfig/cases/field/tsconfig.json deleted file mode 100644 index 9f86c3f4..00000000 --- a/fixtures/tsconfig/cases/field/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-field" -} diff --git a/fixtures/tsconfig/cases/index/index.js b/fixtures/tsconfig/cases/index/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/index/tsconfig.json b/fixtures/tsconfig/cases/index/tsconfig.json deleted file mode 100644 index d20b1774..00000000 --- a/fixtures/tsconfig/cases/index/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-index" -} diff --git a/fixtures/tsconfig/cases/paths_template_variable/foo.js b/fixtures/tsconfig/cases/paths_template_variable/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json b/fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json deleted file mode 100644 index a1a37bb6..00000000 --- a/fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "../../tsconfig_template_variable.json" -} diff --git a/fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json b/fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json deleted file mode 100644 index e7d8e5e5..00000000 --- a/fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "compilerOptions": { - "composite": true, - "paths": { - "foo": ["${configDir}/foo.js"] - } - } -} diff --git a/fixtures/tsconfig/cases/project_references/app/aliased/index.ts b/fixtures/tsconfig/cases/project_references/app/aliased/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/app/index.ts b/fixtures/tsconfig/cases/project_references/app/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/app/tsconfig.json b/fixtures/tsconfig/cases/project_references/app/tsconfig.json deleted file mode 100644 index 7036d2bb..00000000 --- a/fixtures/tsconfig/cases/project_references/app/tsconfig.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "extends": "../tsconfig.base.json", - "compilerOptions": { - "baseUrl": "./", - "paths": { - "@/*": ["./aliased/*"] - } - }, - "references": [ - { - "path": "../project_a/conf.json" - }, - { - "path": "../project_b" - }, - { - "path": "../project_c/tsconfig.json" - }, - { - "path": "../../paths_template_variable/tsconfig2.json" - } - ] -} diff --git a/fixtures/tsconfig/cases/project_references/project_a/aliased/index.ts b/fixtures/tsconfig/cases/project_references/project_a/aliased/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_a/conf.json b/fixtures/tsconfig/cases/project_references/project_a/conf.json deleted file mode 100644 index 4d389d7a..00000000 --- a/fixtures/tsconfig/cases/project_references/project_a/conf.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "compilerOptions": { - "composite": true, - "paths": { - "@/*": ["./aliased/*"] - } - } -} diff --git a/fixtures/tsconfig/cases/project_references/project_a/index.ts b/fixtures/tsconfig/cases/project_references/project_a/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_b/src/aliased/index.ts b/fixtures/tsconfig/cases/project_references/project_b/src/aliased/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_b/tsconfig.json b/fixtures/tsconfig/cases/project_references/project_b/tsconfig.json deleted file mode 100644 index 4ab05cd8..00000000 --- a/fixtures/tsconfig/cases/project_references/project_b/tsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "compilerOptions": { - "composite": true, - "baseUrl": "./src", - "paths": { - "@/*": ["./aliased/*"] - } - } -} diff --git a/fixtures/tsconfig/cases/project_references/project_c/index.ts b/fixtures/tsconfig/cases/project_references/project_c/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_c/tsconfig.json b/fixtures/tsconfig/cases/project_references/project_c/tsconfig.json deleted file mode 100644 index fe520939..00000000 --- a/fixtures/tsconfig/cases/project_references/project_c/tsconfig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compilerOptions": { - "composite": true - } -} diff --git a/fixtures/tsconfig/cases/project_references/tsconfig.base.json b/fixtures/tsconfig/cases/project_references/tsconfig.base.json deleted file mode 100644 index 88ccffe7..00000000 --- a/fixtures/tsconfig/cases/project_references/tsconfig.base.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "compilerOptions": { - } -} diff --git a/fixtures/tsconfig/cases/suffixes/a.ios.ts b/fixtures/tsconfig/cases/suffixes/a.ios.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/a.ts b/fixtures/tsconfig/cases/suffixes/a.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/b.ts b/fixtures/tsconfig/cases/suffixes/b.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/c-test.ts b/fixtures/tsconfig/cases/suffixes/c-test.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/index.ts b/fixtures/tsconfig/cases/suffixes/index.ts deleted file mode 100644 index b09939b9..00000000 --- a/fixtures/tsconfig/cases/suffixes/index.ts +++ /dev/null @@ -1 +0,0 @@ -import './a'; diff --git a/fixtures/tsconfig/cases/suffixes/tsconfig.json b/fixtures/tsconfig/cases/suffixes/tsconfig.json deleted file mode 100644 index 4c2ccc8f..00000000 --- a/fixtures/tsconfig/cases/suffixes/tsconfig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compilerOptions": { - "moduleSuffixes": [".ios", "-test", ""] - } -} diff --git a/fixtures/tsconfig/cases/trailing-comma/bar.js b/fixtures/tsconfig/cases/trailing-comma/bar.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/trailing-comma/index.js b/fixtures/tsconfig/cases/trailing-comma/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/trailing-comma/tsconfig.json b/fixtures/tsconfig/cases/trailing-comma/tsconfig.json deleted file mode 100644 index 6dc20ca5..00000000 --- a/fixtures/tsconfig/cases/trailing-comma/tsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "compilerOptions": { - "paths": { - /* some comment */ - "foo": ["bar.js"], - }, - }, - // another comment -} diff --git a/fixtures/tsconfig/foo.js b/fixtures/tsconfig/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/nested/index.js b/fixtures/tsconfig/nested/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/nested/test.js b/fixtures/tsconfig/nested/test.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/nested/tsconfig.json b/fixtures/tsconfig/nested/tsconfig.json deleted file mode 100644 index 6deb3011..00000000 --- a/fixtures/tsconfig/nested/tsconfig.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "extends": "..", - "compilerOptions": { - "paths": { - "ts-path": ["test.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-exports/conf.json b/fixtures/tsconfig/node_modules/tsconfig-exports/conf.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-exports/conf.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-exports/foo.js b/fixtures/tsconfig/node_modules/tsconfig-exports/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-exports/package.json b/fixtures/tsconfig/node_modules/tsconfig-exports/package.json deleted file mode 100644 index be0ddee6..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-exports/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "tsconfig-exports", - "private": true, - "exports": { - ".": "./conf.json" - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-field/conf.json b/fixtures/tsconfig/node_modules/tsconfig-field/conf.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-field/conf.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-field/foo.js b/fixtures/tsconfig/node_modules/tsconfig-field/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-field/package.json b/fixtures/tsconfig/node_modules/tsconfig-field/package.json deleted file mode 100644 index 7138fdde..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-field/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "tsconfig-field", - "private": true, - "tsconfig": "conf.json" -} \ No newline at end of file diff --git a/fixtures/tsconfig/node_modules/tsconfig-index/foo.js b/fixtures/tsconfig/node_modules/tsconfig-index/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-index/package.json b/fixtures/tsconfig/node_modules/tsconfig-index/package.json deleted file mode 100644 index eb2431e7..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-index/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "tsconfig-index", - "private": true -} \ No newline at end of file diff --git a/fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json b/fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-not-used/foo.js b/fixtures/tsconfig/node_modules/tsconfig-not-used/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json b/fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json deleted file mode 100644 index eb16d127..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "ts-path": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/package.json b/fixtures/tsconfig/package.json deleted file mode 100755 index f48acd1c..00000000 --- a/fixtures/tsconfig/package.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "name": "resolver", - "private": true, - "alias": { - "aliased": "foo", - "aliased-file": "./bar.js", - "something": "./nested/test.js", - "aliasedfolder": "./nested", - "aliasedabsolute": "/nested", - "foo/bar": "./bar.js", - "glob/*/*": "./nested/$2", - "./baz": "./bar.js", - "url": false - }, - "imports": { - "#test": "./bar.js" - }, - "dependencies": { - "foo": "^0.3.4" - }, - "peerDependencies": { - "bar": "*" - } -} diff --git a/fixtures/tsconfig/tsconfig.json b/fixtures/tsconfig/tsconfig.json deleted file mode 100644 index eb16d127..00000000 --- a/fixtures/tsconfig/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "ts-path": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/tsconfig_broken.json b/fixtures/tsconfig/tsconfig_broken.json deleted file mode 100644 index 98232c64..00000000 --- a/fixtures/tsconfig/tsconfig_broken.json +++ /dev/null @@ -1 +0,0 @@ -{ diff --git a/fixtures/tsconfig/tsconfig_template_variable.json b/fixtures/tsconfig/tsconfig_template_variable.json deleted file mode 100644 index 6f272344..00000000 --- a/fixtures/tsconfig/tsconfig_template_variable.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["${configDir}/foo.js"] - } - } -} diff --git a/napi/Source/lib.rs b/napi/Source/lib.rs index dc9b8249..06e369d8 100644 --- a/napi/Source/lib.rs +++ b/napi/Source/lib.rs @@ -7,6 +7,7 @@ use std::{ sync::Arc, }; +use napi::{bindgen_prelude::AsyncTask, Task}; use napi_derive::napi; use oxc_resolver::{ResolveOptions, Resolver}; @@ -42,6 +43,26 @@ pub fn sync(path: String, request: String) -> ResolveResult { resolve(&resolver, &path, &request) } +pub struct ResolveTask { + resolver: Arc, + directory: PathBuf, + request: String, +} + +#[napi] +impl Task for ResolveTask { + type Output = ResolveResult; + type JsValue = ResolveResult; + + fn compute(&mut self) -> napi::Result { + Ok(resolve(&self.resolver, &self.directory, &self.request)) + } + + fn resolve(&mut self, _: napi::Env, result: Self::Output) -> napi::Result { + Ok(result) + } +} + #[napi] pub struct ResolverFactory { resolver: Arc, @@ -86,10 +107,10 @@ impl ResolverFactory { /// Asynchronously resolve `specifier` at an absolute path to a `directory`. #[allow(clippy::needless_pass_by_value)] #[napi(js_name = "async")] - pub async fn resolve_async(&self, directory: String, request: String) -> ResolveResult { + pub fn resolve_async(&self, directory: String, request: String) -> AsyncTask { let path = PathBuf::from(directory); let resolver = self.resolver.clone(); - tokio::spawn(async move { resolve(&resolver, &path, &request) }).await.unwrap() + AsyncTask::new(ResolveTask { resolver, directory: path, request }) } fn normalize_options(op: NapiResolveOptions) -> ResolveOptions { diff --git a/napi/Source/tracing.rs b/napi/Source/tracing.rs index 1f7d309f..88e4cd7e 100644 --- a/napi/Source/tracing.rs +++ b/napi/Source/tracing.rs @@ -1,6 +1,8 @@ use std::sync::OnceLock; -use tracing_subscriber::{filter::Targets, prelude::*}; +use tracing_subscriber::filter::Targets; +use tracing_subscriber::prelude::__tracing_subscriber_SubscriberExt; +use tracing_subscriber::util::SubscriberInitExt; /// To debug `oxc_resolver`: /// `OXC_LOG=DEBUG your program` diff --git a/napi/__test__/resolver.spec.mjs b/napi/__test__/resolver.spec.mjs deleted file mode 100644 index ac6ee0ef..00000000 --- a/napi/__test__/resolver.spec.mjs +++ /dev/null @@ -1,260 +0,0 @@ -import { join } from 'node:path' -import { fileURLToPath } from 'node:url' - -import test from 'ava' - -let ResolverFactory - -if (process.env.WASI_TEST) { - const wasi = await import('../resolver.wasi.cjs') - ResolverFactory = wasi.ResolverFactory -} else { - const napi = await import('../index.js') - ResolverFactory = napi.ResolverFactory -} - -const currentDir = join(fileURLToPath(import.meta.url), '..') - -const enhancedResolveRoot = join( - currentDir, - '..', - '..', - 'fixtures', - 'enhanced_resolve', - 'test', - 'fixtures' -) - -// https://github.com/webpack/enhanced-resolve/blob/main/test/resolve.test.js - -for (const [title, context, request, expected] of [ - [ - 'absolute path', - enhancedResolveRoot, - join(enhancedResolveRoot, 'main1.js'), - join(enhancedResolveRoot, 'main1.js'), - ], - [ - 'file with .js', - enhancedResolveRoot, - './main1.js', - join(enhancedResolveRoot, 'main1.js'), - ], - [ - 'file without extension', - enhancedResolveRoot, - './main1', - join(enhancedResolveRoot, 'main1.js'), - ], - [ - 'another file with .js', - enhancedResolveRoot, - './a.js', - join(enhancedResolveRoot, 'a.js'), - ], - [ - 'another file without extension', - enhancedResolveRoot, - './a', - join(enhancedResolveRoot, 'a.js'), - ], - [ - 'file in module with .js', - enhancedResolveRoot, - 'm1/a.js', - join(enhancedResolveRoot, 'node_modules/m1/a.js'), - ], - [ - 'file in module without extension', - enhancedResolveRoot, - 'm1/a', - join(enhancedResolveRoot, 'node_modules/m1/a.js'), - ], - [ - 'another file in module without extension', - enhancedResolveRoot, - 'complexm/step1', - join(enhancedResolveRoot, 'node_modules/complexm/step1.js'), - ], - [ - 'from submodule to file in sibling module', - join(enhancedResolveRoot, 'node_modules/complexm'), - 'm2/b.js', - join(enhancedResolveRoot, 'node_modules/m2/b.js'), - ], - [ - 'from nested directory to overwritten file in module', - join(enhancedResolveRoot, 'multiple_modules'), - 'm1/a.js', - join(enhancedResolveRoot, 'multiple_modules/node_modules/m1/a.js'), - ], - [ - 'from nested directory to not overwritten file in module', - join(enhancedResolveRoot, 'multiple_modules'), - 'm1/b.js', - join(enhancedResolveRoot, 'node_modules/m1/b.js'), - ], - [ - 'file with query', - enhancedResolveRoot, - './main1.js?query', - join(enhancedResolveRoot, 'main1.js?query'), - ], - [ - 'file with fragment', - enhancedResolveRoot, - './main1.js#fragment', - join(enhancedResolveRoot, 'main1.js#fragment'), - ], - [ - 'file with fragment and query', - enhancedResolveRoot, - './main1.js#fragment?query', - join(enhancedResolveRoot, 'main1.js#fragment?query'), - ], - [ - 'file with query and fragment', - enhancedResolveRoot, - './main1.js?#fragment', - join(enhancedResolveRoot, 'main1.js?#fragment'), - ], - - [ - 'file with query (unicode)', - enhancedResolveRoot, - './测试.js?query', - join(enhancedResolveRoot, '测试.js?query'), - ], - [ - 'file with fragment (unicode)', - enhancedResolveRoot, - './测试.js#fragment', - join(enhancedResolveRoot, '测试.js#fragment'), - ], - [ - 'file with fragment and query (unicode)', - enhancedResolveRoot, - './测试.js#fragment?query', - join(enhancedResolveRoot, '测试.js#fragment?query'), - ], - [ - 'file with query and fragment (unicode)', - enhancedResolveRoot, - './测试.js?#fragment', - join(enhancedResolveRoot, '测试.js?#fragment'), - ], - - [ - 'file in module with query', - enhancedResolveRoot, - 'm1/a?query', - join(enhancedResolveRoot, 'node_modules/m1/a.js?query'), - ], - [ - 'file in module with fragment', - enhancedResolveRoot, - 'm1/a#fragment', - join(enhancedResolveRoot, 'node_modules/m1/a.js#fragment'), - ], - [ - 'file in module with fragment and query', - enhancedResolveRoot, - 'm1/a#fragment?query', - join(enhancedResolveRoot, 'node_modules/m1/a.js#fragment?query'), - ], - [ - 'file in module with query and fragment', - enhancedResolveRoot, - 'm1/a?#fragment', - join(enhancedResolveRoot, 'node_modules/m1/a.js?#fragment'), - ], - [ - 'differ between directory and file, resolve file', - enhancedResolveRoot, - './dirOrFile', - join(enhancedResolveRoot, 'dirOrFile.js'), - ], - [ - 'differ between directory and file, resolve directory', - enhancedResolveRoot, - './dirOrFile/', - join(enhancedResolveRoot, 'dirOrFile/index.js'), - ], - [ - 'find node_modules outside of node_modules', - join(enhancedResolveRoot, 'browser-module/node_modules'), - 'm1/a', - join(enhancedResolveRoot, 'node_modules/m1/a.js'), - ], - [ - "don't crash on main field pointing to self", - enhancedResolveRoot, - './main-field-self', - join(enhancedResolveRoot, './main-field-self/index.js'), - ], - [ - "don't crash on main field pointing to self (2)", - enhancedResolveRoot, - './main-field-self2', - join(enhancedResolveRoot, './main-field-self2/index.js'), - ], - // enhanced-resolve has `#` prepended with a `\0`, they are removed from the - // following 3 expected test results. - // See https://github.com/webpack/enhanced-resolve#escaping - [ - 'handle fragment edge case (no fragment)', - enhancedResolveRoot, - './no#fragment/#/#', - join(enhancedResolveRoot, 'no#fragment', '#', '#.js'), - ], - [ - 'handle fragment edge case (fragment)', - enhancedResolveRoot, - './no#fragment/#/', - join(enhancedResolveRoot, 'no.js#fragment') + '/#/', - ], - [ - 'handle fragment escaping', - enhancedResolveRoot, - './no\0#fragment/\0#/\0##fragment', - join(enhancedResolveRoot, 'no#fragment', '#', '#.js#fragment'), - ], -]) { - test(title, (t) => { - const resolver = new ResolverFactory({ - modules: ['src/a', 'src/b', 'src/common', 'node_modules'], - extensions: ['.js', '.jsx', '.ts', '.tsx'], - }) - - t.is(resolver.sync(context, request).path, expected) - }) -} - -test('resolve pnpm package', (t) => { - const rootDir = join(currentDir, '..', '..'); - const pnpmProjectPath = join(rootDir, 'fixtures', 'pnpm') - const resolver = new ResolverFactory({ - aliasFields: ['browser'], - }) - t.deepEqual(resolver.sync(pnpmProjectPath, 'styled-components'), { - path: join( - rootDir, - 'node_modules/.pnpm/styled-components@6.1.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/styled-components/dist/styled-components.browser.cjs.js' - ), - }) - t.deepEqual( - resolver.sync( - join( - rootDir, - 'node_modules/.pnpm/styled-components@6.1.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/styled-components' - ), - 'react' - ), - { - path: join( - rootDir, - 'node_modules/.pnpm/react@18.3.1/node_modules/react/index.js' - ), - } - ) -}) diff --git a/napi/src/lib.rs b/napi/src/lib.rs deleted file mode 100644 index 06e369d8..00000000 --- a/napi/src/lib.rs +++ /dev/null @@ -1,207 +0,0 @@ -extern crate napi; -extern crate napi_derive; -extern crate oxc_resolver; - -use std::{ - path::{Path, PathBuf}, - sync::Arc, -}; - -use napi::{bindgen_prelude::AsyncTask, Task}; -use napi_derive::napi; -use oxc_resolver::{ResolveOptions, Resolver}; - -use self::{ - options::{NapiResolveOptions, StrOrStrList}, - tracing::init_tracing, -}; - -mod options; -mod tracing; - -#[napi(object)] -pub struct ResolveResult { - pub path: Option, - pub error: Option, -} - -fn resolve(resolver: &Resolver, path: &Path, request: &str) -> ResolveResult { - match resolver.resolve(path, request) { - Ok(resolution) => ResolveResult { - path: Some(resolution.full_path().to_string_lossy().to_string()), - error: None, - }, - Err(err) => ResolveResult { path: None, error: Some(err.to_string()) }, - } -} - -#[allow(clippy::needless_pass_by_value)] -#[napi] -pub fn sync(path: String, request: String) -> ResolveResult { - let path = PathBuf::from(path); - let resolver = Resolver::new(ResolveOptions::default()); - resolve(&resolver, &path, &request) -} - -pub struct ResolveTask { - resolver: Arc, - directory: PathBuf, - request: String, -} - -#[napi] -impl Task for ResolveTask { - type Output = ResolveResult; - type JsValue = ResolveResult; - - fn compute(&mut self) -> napi::Result { - Ok(resolve(&self.resolver, &self.directory, &self.request)) - } - - fn resolve(&mut self, _: napi::Env, result: Self::Output) -> napi::Result { - Ok(result) - } -} - -#[napi] -pub struct ResolverFactory { - resolver: Arc, -} - -#[napi] -impl ResolverFactory { - #[napi(constructor)] - pub fn new(options: NapiResolveOptions) -> Self { - init_tracing(); - Self { resolver: Arc::new(Resolver::new(Self::normalize_options(options))) } - } - - #[napi] - pub fn default() -> Self { - let default_options = ResolveOptions::default(); - Self { resolver: Arc::new(Resolver::new(default_options)) } - } - - /// Clone the resolver using the same underlying cache. - #[napi] - pub fn clone_with_options(&self, options: NapiResolveOptions) -> Self { - Self { - resolver: Arc::new(self.resolver.clone_with_options(Self::normalize_options(options))), - } - } - - /// Clear the underlying cache. - #[napi] - pub fn clear_cache(&self) { - self.resolver.clear_cache(); - } - - /// Synchronously resolve `specifier` at an absolute path to a `directory`. - #[allow(clippy::needless_pass_by_value)] - #[napi] - pub fn sync(&self, directory: String, request: String) -> ResolveResult { - let path = PathBuf::from(directory); - resolve(&self.resolver, &path, &request) - } - - /// Asynchronously resolve `specifier` at an absolute path to a `directory`. - #[allow(clippy::needless_pass_by_value)] - #[napi(js_name = "async")] - pub fn resolve_async(&self, directory: String, request: String) -> AsyncTask { - let path = PathBuf::from(directory); - let resolver = self.resolver.clone(); - AsyncTask::new(ResolveTask { resolver, directory: path, request }) - } - - fn normalize_options(op: NapiResolveOptions) -> ResolveOptions { - let default = ResolveOptions::default(); - // merging options - ResolveOptions { - tsconfig: op.tsconfig.map(|tsconfig| tsconfig.into()), - alias: op - .alias - .map(|alias| { - alias - .into_iter() - .map(|(k, v)| { - let v = v - .into_iter() - .map(|item| match item { - Some(path) => oxc_resolver::AliasValue::from(path), - None => oxc_resolver::AliasValue::Ignore, - }) - .collect(); - (k, v) - }) - .collect::>() - }) - .unwrap_or(default.alias), - alias_fields: op - .alias_fields - .map(|o| o.into_iter().map(|x| StrOrStrList(x).into()).collect::>()) - .unwrap_or(default.alias_fields), - condition_names: op.condition_names.unwrap_or(default.condition_names), - description_files: op.description_files.unwrap_or(default.description_files), - enforce_extension: op - .enforce_extension - .map(|enforce_extension| enforce_extension.into()) - .unwrap_or(default.enforce_extension), - exports_fields: op - .exports_fields - .map(|o| o.into_iter().map(|x| StrOrStrList(x).into()).collect::>()) - .unwrap_or(default.exports_fields), - imports_fields: op - .imports_fields - .map(|o| o.into_iter().map(|x| StrOrStrList(x).into()).collect::>()) - .unwrap_or(default.imports_fields), - extension_alias: op - .extension_alias - .map(|extension_alias| extension_alias.into_iter().collect::>()) - .unwrap_or(default.extension_alias), - extensions: op.extensions.unwrap_or(default.extensions), - fallback: op - .fallback - .map(|fallback| { - fallback - .into_iter() - .map(|(k, v)| { - let v = v - .into_iter() - .map(|item| match item { - Some(path) => oxc_resolver::AliasValue::from(path), - None => oxc_resolver::AliasValue::Ignore, - }) - .collect(); - (k, v) - }) - .collect::>() - }) - .unwrap_or(default.fallback), - fully_specified: op.fully_specified.unwrap_or(default.fully_specified), - main_fields: op - .main_fields - .map(|o| StrOrStrList(o).into()) - .unwrap_or(default.main_fields), - main_files: op.main_files.unwrap_or(default.main_files), - modules: op.modules.map(|o| StrOrStrList(o).into()).unwrap_or(default.modules), - resolve_to_context: op.resolve_to_context.unwrap_or(default.resolve_to_context), - prefer_relative: op.prefer_relative.unwrap_or(default.prefer_relative), - prefer_absolute: op.prefer_absolute.unwrap_or(default.prefer_absolute), - restrictions: op - .restrictions - .map(|restrictions| { - restrictions - .into_iter() - .map(|restriction| restriction.into()) - .collect::>() - }) - .unwrap_or(default.restrictions), - roots: op - .roots - .map(|roots| roots.into_iter().map(PathBuf::from).collect::>()) - .unwrap_or(default.roots), - symlinks: op.symlinks.unwrap_or(default.symlinks), - builtin_modules: op.builtin_modules.unwrap_or(default.builtin_modules), - } - } -} diff --git a/napi/src/options.rs b/napi/src/options.rs deleted file mode 100644 index ea35672f..00000000 --- a/napi/src/options.rs +++ /dev/null @@ -1,261 +0,0 @@ -use std::path::PathBuf; - -use napi::Either; -use napi_derive::napi; -use std::collections::HashMap; - -/// Module Resolution Options -/// -/// Options are directly ported from [enhanced-resolve](https://github.com/webpack/enhanced-resolve#resolver-options). -/// -/// See [webpack resolve](https://webpack.js.org/configuration/resolve/) for information and examples -#[derive(Debug, Clone)] -#[napi(object)] -pub struct NapiResolveOptions { - /// Path to TypeScript configuration file. - /// - /// Default `None` - pub tsconfig: Option, - - /// Alias for [ResolveOptions::alias] and [ResolveOptions::fallback]. - /// - /// For the second value of the tuple, `None -> AliasValue::Ignore`, Some(String) -> - /// AliasValue::Path(String)` - /// Create aliases to import or require certain modules more easily. - /// A trailing $ can also be added to the given object's keys to signify an exact match. - pub alias: Option>>>, - - /// A list of alias fields in description files. - /// Specify a field, such as `browser`, to be parsed according to [this specification](https://github.com/defunctzombie/package-browser-field-spec). - /// Can be a path to json object such as `["path", "to", "exports"]`. - /// - /// Default `[]` - #[napi(ts_type = "(string | string[])[]")] - pub alias_fields: Option>, - - /// Condition names for exports field which defines entry points of a package. - /// The key order in the exports field is significant. During condition matching, earlier entries have higher priority and take precedence over later entries. - /// - /// Default `[]` - pub condition_names: Option>, - - /// The JSON files to use for descriptions. (There was once a `bower.json`.) - /// - /// Default `["package.json"]` - pub description_files: Option>, - - /// If true, it will not allow extension-less files. - /// So by default `require('./foo')` works if `./foo` has a `.js` extension, - /// but with this enabled only `require('./foo.js')` will work. - /// - /// Default to `true` when [ResolveOptions::extensions] contains an empty string. - /// Use `Some(false)` to disable the behavior. - /// See - /// - /// Default None, which is the same as `Some(false)` when the above empty rule is not applied. - pub enforce_extension: Option, - - /// A list of exports fields in description files. - /// Can be a path to json object such as `["path", "to", "exports"]`. - /// - /// Default `[["exports"]]`. - #[napi(ts_type = "(string | string[])[]")] - pub exports_fields: Option>, - - /// Fields from `package.json` which are used to provide the internal requests of a package - /// (requests starting with # are considered internal). - /// - /// Can be a path to a JSON object such as `["path", "to", "imports"]`. - /// - /// Default `[["imports"]]`. - #[napi(ts_type = "(string | string[])[]")] - pub imports_fields: Option>, - - /// An object which maps extension to extension aliases. - /// - /// Default `{}` - pub extension_alias: Option>>, - - /// Attempt to resolve these extensions in order. - /// If multiple files share the same name but have different extensions, - /// will resolve the one with the extension listed first in the array and skip the rest. - /// - /// Default `[".js", ".json", ".node"]` - pub extensions: Option>, - - /// Redirect module requests when normal resolving fails. - /// - /// Default `[]` - pub fallback: Option>>>, - - /// 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). - /// - /// See also webpack configuration [resolve.fullySpecified](https://webpack.js.org/configuration/module/#resolvefullyspecified) - /// - /// Default `false` - pub fully_specified: Option, - - /// A list of main fields in description files - /// - /// Default `["main"]`. - #[napi(ts_type = "string | string[]")] - pub main_fields: Option, - - /// The filename to be used while resolving directories. - /// - /// Default `["index"]` - pub main_files: Option>, - - /// A list of directories to resolve modules from, can be absolute path or folder name. - /// - /// Default `["node_modules"]` - #[napi(ts_type = "string | string[]")] - pub modules: Option, - - /// Resolve to a context instead of a file. - /// - /// Default `false` - pub resolve_to_context: Option, - - /// Prefer to resolve module requests as relative requests instead of using modules from node_modules directories. - /// - /// Default `false` - pub prefer_relative: Option, - - /// Prefer to resolve server-relative urls as absolute paths before falling back to resolve in ResolveOptions::roots. - /// - /// Default `false` - pub prefer_absolute: Option, - - /// A list of resolve restrictions to restrict the paths that a request can be resolved on. - /// - /// Default `[]` - pub restrictions: Option>, - - /// A list of directories where requests of server-relative URLs (starting with '/') are resolved. - /// On non-Windows systems these requests are resolved as an absolute path first. - /// - /// Default `[]` - pub roots: Option>, - - /// Whether to resolve symlinks to their symlinked location. - /// When enabled, symlinked resources are resolved to their real path, not their symlinked location. - /// Note that this may cause module resolution to fail when using tools that symlink packages (like npm link). - /// - /// Default `true` - pub symlinks: Option, - - /// Whether to parse [module.builtinModules](https://nodejs.org/api/module.html#modulebuiltinmodules) or not. - /// For example, "zlib" will throw [crate::ResolveError::Builtin] when set to true. - /// - /// Default `false` - pub builtin_modules: Option, -} - -#[napi] -#[derive(Debug, PartialEq, Eq)] -pub enum EnforceExtension { - Auto, - Enabled, - Disabled, -} - -impl EnforceExtension { - pub fn is_auto(&self) -> bool { - *self == Self::Auto - } - - pub fn is_enabled(&self) -> bool { - *self == Self::Enabled - } - - pub fn is_disabled(&self) -> bool { - *self == Self::Disabled - } -} - -/// Alias Value for [ResolveOptions::alias] and [ResolveOptions::fallback]. -/// Use struct because napi don't support structured union now -#[napi(object)] -#[derive(Debug, Clone)] -pub struct Restriction { - pub path: Option, - pub regex: Option, -} - -/// Tsconfig Options -/// -/// Derived from [tsconfig-paths-webpack-plugin](https://github.com/dividab/tsconfig-paths-webpack-plugin#options) -#[napi(object)] -#[derive(Debug, Clone)] -pub struct TsconfigOptions { - /// Allows you to specify where to find the TypeScript configuration file. - /// You may provide - /// * a relative path to the configuration file. It will be resolved relative to cwd. - /// * an absolute path to the configuration file. - pub config_file: String, - - /// Support for Typescript Project References. - /// - /// * `'auto'`: use the `references` field from tsconfig of `config_file`. - /// * `string[]`: manually provided relative or absolute path. - #[napi(ts_type = "'auto' | string[]")] - pub references: Option>>, -} - -impl Into for Restriction { - fn into(self) -> oxc_resolver::Restriction { - match (self.path, self.regex) { - (None, None) => { - panic!("Should specify path or regex") - } - (None, Some(regex)) => oxc_resolver::Restriction::RegExp(regex), - (Some(path), None) => oxc_resolver::Restriction::Path(PathBuf::from(path)), - (Some(_), Some(_)) => { - panic!("Restriction can't be path and regex at the same time") - } - } - } -} - -impl Into for EnforceExtension { - fn into(self) -> oxc_resolver::EnforceExtension { - match self { - EnforceExtension::Auto => oxc_resolver::EnforceExtension::Auto, - EnforceExtension::Enabled => oxc_resolver::EnforceExtension::Enabled, - EnforceExtension::Disabled => oxc_resolver::EnforceExtension::Disabled, - } - } -} - -impl Into for TsconfigOptions { - fn into(self) -> oxc_resolver::TsconfigOptions { - oxc_resolver::TsconfigOptions { - config_file: PathBuf::from(self.config_file), - references: match self.references { - Some(Either::A(string)) if string.as_str() == "auto" => { - oxc_resolver::TsconfigReferences::Auto - } - Some(Either::A(opt)) => { - panic!("`{}` is not a valid option for tsconfig references", opt) - } - Some(Either::B(paths)) => oxc_resolver::TsconfigReferences::Paths( - paths.into_iter().map(PathBuf::from).collect::>(), - ), - None => oxc_resolver::TsconfigReferences::Disabled, - }, - } - } -} - -type StrOrStrListType = Either>; -pub struct StrOrStrList(pub StrOrStrListType); - -impl Into> for StrOrStrList { - fn into(self) -> Vec { - match self { - StrOrStrList(Either::A(s)) => Vec::from([s]), - StrOrStrList(Either::B(a)) => a, - } - } -} diff --git a/napi/src/tracing.rs b/napi/src/tracing.rs deleted file mode 100644 index 88e4cd7e..00000000 --- a/napi/src/tracing.rs +++ /dev/null @@ -1,25 +0,0 @@ -use std::sync::OnceLock; - -use tracing_subscriber::filter::Targets; -use tracing_subscriber::prelude::__tracing_subscriber_SubscriberExt; -use tracing_subscriber::util::SubscriberInitExt; - -/// To debug `oxc_resolver`: -/// `OXC_LOG=DEBUG your program` -pub fn init_tracing() { - static TRACING: OnceLock<()> = OnceLock::new(); - TRACING.get_or_init(|| { - // Usage without the `regex` feature. - // - tracing_subscriber::registry() - .with(std::env::var("OXC_LOG").map_or_else( - |_| Targets::new(), - |env_var| { - use std::str::FromStr; - Targets::from_str(&env_var).unwrap() - }, - )) - .with(tracing_subscriber::fmt::layer()) - .init(); - }); -} diff --git a/napi/tests/options.test.mjs b/napi/tests/options.test.mjs deleted file mode 100644 index 4a93efff..00000000 --- a/napi/tests/options.test.mjs +++ /dev/null @@ -1,59 +0,0 @@ -import { describe, it } from "node:test"; -import { ResolverFactory } from "../index.js"; -import * as assert from "node:assert"; -import * as path from "node:path"; - -const fixtureDir = new URL( - "../../fixtures/enhanced_resolve/test/fixtures", - import.meta.url -).pathname; - -describe("option", () => { - describe("aliasFields", () => { - it("should allow field string ", () => { - const resolver = new ResolverFactory({ aliasFields: ["browser"] }); - assert.match( - resolver.sync(fixtureDir, "./browser-module/lib/replaced.js").path, - /browser-module\/lib\/browser\.js$/ - ); - }); - it("should allow json path array", () => { - const resolver = new ResolverFactory({ - aliasFields: [["innerBrowser1", "field", "browser"]], - }); - - assert.match( - resolver.sync(fixtureDir, "./browser-module/lib/main1.js").path, - /browser-module\/lib\/main\.js$/ - ); - }); - }); - - describe("exportsFields", () => { - const createTest = (exportsFields) => { - const resolver = new ResolverFactory({ exportsFields }); - assert.match( - resolver.sync( - path.resolve(fixtureDir, "./exports-field3"), - "exports-field" - ).path, - /\/exports-field\/src\/index\.js$/ - ); - }; - it("should allow string as field item", createTest(["broken"])); - it("should allow json path array as field item", createTest([["broken"]])); - }); - - describe("mainFields", () => { - const createTest = (mainFields) => { - const resolver = new ResolverFactory({ mainFields }); - assert.match( - resolver.sync(fixtureDir, "../..").path, - /\/lib\/index\.js$/ - ); - }; - it("should use `'main'` as default", createTest(undefined)); - it("should allow field string", createTest("main")); - it("should allow field array", createTest(["main"])); - }); -}); diff --git a/npm/package.json b/npm/package.json index a93c2f79..8e711b3a 100644 --- a/npm/package.json +++ b/npm/package.json @@ -1,46 +1,35 @@ { - "name": "oxc-resolver", - "version": "1.9.3", - "description": "Oxc Resolver Node API", - "main": "index.js", - "browser": "browser.js", - "files": [ - "index.d.ts", - "index.js", - "browser.js" - ], - "license": "MIT", - "homepage": "https://oxc.rs", - "repository": { - "type": "git", - "url": "git+https://github.com/oxc-project/oxc-resolver.git" - }, - "publishConfig": { - "registry": "https://registry.npmjs.org/", - "access": "public" - }, - "napi": { - "binaryName": "resolver", - "packageName": "@oxc-resolver/binding", - "wasm": { - "browser": { - "fs": true - } - }, - "targets": [ - "x86_64-pc-windows-msvc", - "aarch64-pc-windows-msvc", - "x86_64-unknown-linux-gnu", - "x86_64-unknown-linux-musl", - "aarch64-unknown-linux-gnu", - "aarch64-unknown-linux-musl", - "armv7-unknown-linux-gnueabihf", - "x86_64-apple-darwin", - "aarch64-apple-darwin", - "wasm32-wasip1-threads" - ] - }, - "funding": { - "url": "https://github.com/sponsors/Boshen" - } + "name": "oxc-resolver", + "description": "Oxc Resolver Node API", + "funding": { + "url": "https://github.com/sponsors/Boshen" + }, + "main": "index.js", + "browser": "browser.js", + "files": [ + "index.d.ts", + "index.js", + "browser.js" + ], + "napi": { + "binaryName": "resolver", + "packageName": "@oxc-resolver/binding", + "targets": [ + "x86_64-pc-windows-msvc", + "aarch64-pc-windows-msvc", + "x86_64-unknown-linux-gnu", + "x86_64-unknown-linux-musl", + "aarch64-unknown-linux-gnu", + "aarch64-unknown-linux-musl", + "armv7-unknown-linux-gnueabihf", + "x86_64-apple-darwin", + "aarch64-apple-darwin", + "wasm32-wasip1-threads" + ], + "wasm": { + "browser": { + "fs": true + } + } + } } diff --git a/package.json b/package.json index 51cb822a..a431e48f 100644 --- a/package.json +++ b/package.json @@ -1,33 +1,24 @@ { - "name": "@oxc-resolver/binding", - "private": true, - "version": "0.0.0", - "scripts": { - "build": "napi build --platform --release --package-json-path npm/package.json --manifest-path napi/Cargo.toml", - "build:debug": "napi build --platform --package-json-path npm/package.json --manifest-path napi/Cargo.toml", - "prepublishOnly": "napi pre-publish -t npm", - "test": "ava" - }, - "devDependencies": { - "@napi-rs/cli": "^3.0.0-alpha.43", - "@napi-rs/wasm-runtime": "^0.2.0", - "@types/node": "^20.10.4", - "ava": "^6.0.1", - "emnapi": "^1.0.0", - "typescript": "^5.3.3" - }, - "ava": { - "files": [ - "napi/__test__/*.spec.mjs" - ], - "cache": false - }, - "packageManager": "pnpm@9.4.0", - "repository": { - "type": "git", - "url": "git+https://github.com/oxc-project/oxc-resolver.git" - }, - "funding": { - "url": "https://github.com/sponsors/Boshen" - } + "name": "@oxc-resolver/binding", + "funding": { + "url": "https://github.com/sponsors/Boshen" + }, + "scripts": { + "build": "napi build --platform --release --package-json-path npm/package.json --manifest-path napi/Cargo.toml", + "build:debug": "napi build --platform --package-json-path npm/package.json --manifest-path napi/Cargo.toml", + "prepublishOnly": "napi pre-publish -t npm" + }, + "ava": { + "cache": false, + "files": [ + "napi/__test__/*.spec.mjs" + ] + }, + "devDependencies": { + "@napi-rs/cli": "^3.0.0-alpha.43", + "@napi-rs/wasm-runtime": "^0.2.0", + "@types/node": "^20.10.4", + "ava": "^6.0.1", + "emnapi": "^1.0.0" + } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml deleted file mode 100644 index 68c6a391..00000000 --- a/pnpm-lock.yaml +++ /dev/null @@ -1,2690 +0,0 @@ -lockfileVersion: '9.0' - -settings: - autoInstallPeers: true - excludeLinksFromLockfile: false - -importers: - - .: - devDependencies: - '@napi-rs/cli': - specifier: ^3.0.0-alpha.43 - version: 3.0.0-alpha.55(@emnapi/runtime@1.2.0)(emnapi@1.2.0) - '@napi-rs/wasm-runtime': - specifier: ^0.2.0 - version: 0.2.4 - '@types/node': - specifier: ^20.10.4 - version: 20.14.9 - ava: - specifier: ^6.0.1 - version: 6.1.3 - emnapi: - specifier: ^1.0.0 - version: 1.2.0 - typescript: - specifier: ^5.3.3 - version: 5.5.2 - - fixtures/pnpm: - devDependencies: - axios: - specifier: 1.6.2 - version: 1.6.2 - postcss: - specifier: 8.4.33 - version: 8.4.33 - styled-components: - specifier: 6.1.1 - version: 6.1.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - - npm: {} - -packages: - - '@emnapi/core@1.2.0': - resolution: {integrity: sha512-E7Vgw78I93we4ZWdYCb4DGAwRROGkMIXk7/y87UmANR+J6qsWusmC3gLt0H+O0KOt5e6O38U8oJamgbudrES/w==} - - '@emnapi/runtime@1.2.0': - resolution: {integrity: sha512-bV21/9LQmcQeCPEg3BDFtvwL6cwiTMksYNWQQ4KOxCZikEGalWtenoZ0wCiukJINlGCIi2KXx01g4FoH/LxpzQ==} - - '@emnapi/wasi-threads@1.0.1': - resolution: {integrity: sha512-iIBu7mwkq4UQGeMEM8bLwNK962nXdhodeScX4slfQnRhEMMzvYivHhutCIk8uojvmASXXPC2WNEjwxFWk72Oqw==} - - '@emotion/is-prop-valid@1.2.2': - resolution: {integrity: sha512-uNsoYd37AFmaCdXlg6EYD1KaPOaRWRByMCYzbKUX4+hhMfrxdVSelShywL4JVaAeM/eHUOSprYBQls+/neX3pw==} - - '@emotion/memoize@0.8.1': - resolution: {integrity: sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA==} - - '@emotion/unitless@0.8.1': - resolution: {integrity: sha512-KOEGMu6dmJZtpadb476IsZBclKvILjopjUii3V+7MnXIQCYh8W3NgNcgwo21n9LXZX6EDIKvqfjYxXebDwxKmQ==} - - '@inquirer/figures@1.0.3': - resolution: {integrity: sha512-ErXXzENMH5pJt5/ssXV0DfWUZqly8nGzf0UcBV9xTnP+KyffE2mqyxIMBrZ8ijQck2nU0TQm40EQB53YreyWHw==} - engines: {node: '>=18'} - - '@ljharb/through@2.3.13': - resolution: {integrity: sha512-/gKJun8NNiWGZJkGzI/Ragc53cOdcLNdzjLaIa+GEjguQs0ulsurx8WN0jijdK9yPqDvziX995sMRLyLt1uZMQ==} - engines: {node: '>= 0.4'} - - '@mapbox/node-pre-gyp@1.0.11': - resolution: {integrity: sha512-Yhlar6v9WQgUp/He7BdgzOz8lqMQ8sU+jkCq7Wx8Myc5YFJLbEe7lgui/V7G1qB1DJykHSGwreceSaD60Y0PUQ==} - hasBin: true - - '@napi-rs/cli@3.0.0-alpha.55': - resolution: {integrity: sha512-6XgBBTX8O28W5gcSzqYkI72UVJV6Y2YcyQNrEqak39JavJRLlXCv09uLF97raynXAOO50KeP6DEXFy5P8MR2sw==} - engines: {node: '>= 16'} - hasBin: true - peerDependencies: - '@emnapi/runtime': ^1.1.0 - emnapi: ^1.1.0 - peerDependenciesMeta: - '@emnapi/runtime': - optional: true - emnapi: - optional: true - - '@napi-rs/cross-toolchain@0.0.16': - resolution: {integrity: sha512-jwdjHT5L0m9MH0CmzDwPp0ckn/UO7afHCsPeo7NugHUvYgvlgS7SWhdMVgIgJW2HHqhcW/2nhaLLGpAU1c7QRQ==} - peerDependencies: - '@napi-rs/cross-toolchain-arm64-target-aarch64': ^0.0.16 - '@napi-rs/cross-toolchain-arm64-target-armv7': ^0.0.16 - '@napi-rs/cross-toolchain-arm64-target-x86_64': ^0.0.16 - '@napi-rs/cross-toolchain-x64-target-aarch64': ^0.0.16 - '@napi-rs/cross-toolchain-x64-target-armv7': ^0.0.16 - '@napi-rs/cross-toolchain-x64-target-x86_64': ^0.0.16 - peerDependenciesMeta: - '@napi-rs/cross-toolchain-arm64-target-aarch64': - optional: true - '@napi-rs/cross-toolchain-arm64-target-armv7': - optional: true - '@napi-rs/cross-toolchain-arm64-target-x86_64': - optional: true - '@napi-rs/cross-toolchain-x64-target-aarch64': - optional: true - '@napi-rs/cross-toolchain-x64-target-armv7': - optional: true - '@napi-rs/cross-toolchain-x64-target-x86_64': - optional: true - - '@napi-rs/lzma-android-arm-eabi@1.3.1': - resolution: {integrity: sha512-mtGOg8jXlc+pTBI86cqohfndS9UmOAkk9d5CChKMb8btVks70yhUN1e7YYS3QFbmoxbPs2Ee+wmuH1Khdc7B2w==} - engines: {node: '>= 10'} - cpu: [arm] - os: [android] - - '@napi-rs/lzma-android-arm64@1.3.1': - resolution: {integrity: sha512-4uGkQgAv9Tnc/i0k2eIgbhZgyzs94+iECWxz4MFZNcZ1fNGvGbRL2j+SITE4OmwrUn3TuFK/uYWfgzooq8E1Qg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [android] - - '@napi-rs/lzma-darwin-arm64@1.3.1': - resolution: {integrity: sha512-MZBg4iwHTS8icjTiCMdzh8kYrMmKBCEglFPa+vjI91R2XDwuuwSzqmpATRpmMH8cWUUWtGPF4fnxKzjgkzhd4Q==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [darwin] - - '@napi-rs/lzma-darwin-x64@1.3.1': - resolution: {integrity: sha512-7vte+1lYV7xgZERKH/pjAeh4T16aQASKOzu4op70pK6VP/64Plr5rrvqxQqQmlAIe4pwyo/RkFl1n4LXDod3xg==} - engines: {node: '>= 10'} - cpu: [x64] - os: [darwin] - - '@napi-rs/lzma-freebsd-x64@1.3.1': - resolution: {integrity: sha512-uBS74fynTqLUC3catIxyezCafn8UDlr2yxVV47vz1T6Vop2PGDz/cMQdV6rnLSjPE08Rv66ihM36mgf/MmOkOg==} - engines: {node: '>= 10'} - cpu: [x64] - os: [freebsd] - - '@napi-rs/lzma-linux-arm-gnueabihf@1.3.1': - resolution: {integrity: sha512-rrVLyqBJeN29gPJCNkPbZ7dAzaseEcERKyhjwM+DfbFrDUvtkEcrYPvo+iwE/NmF+OkZQkzcanrVMGnq/mcJYQ==} - engines: {node: '>= 10'} - cpu: [arm] - os: [linux] - - '@napi-rs/lzma-linux-arm64-gnu@1.3.1': - resolution: {integrity: sha512-vDmVsthRbX2opkgRirJJGKQxUP/spvyVM2Y5CyCWZ7sadSID3hA97r38gf9ISn/sJ8/r93IPWLq+iycudNKi+Q==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/lzma-linux-arm64-musl@1.3.1': - resolution: {integrity: sha512-x4m/J3hRdFd3IoqKc+4aBcSUkcuDEP7hH6vdss8bKNLjPfXmnG/lcHJEQX3hNnNOULPP8xVRxgiY8jeL62cnsw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/lzma-linux-x64-gnu@1.3.1': - resolution: {integrity: sha512-riB+Xg72NfH8Kcpq07omshVu0QsLW0v2bhywBNYxvA+t2dGGWSIEN1U/zazUXys+IEA6pBQKqLVseurWE6Cl8g==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/lzma-linux-x64-musl@1.3.1': - resolution: {integrity: sha512-JXLgJFwoeysxdSg7rdVYP8wrliCQVJlU5JcLYjRVSCL4P0mQTjnYi7R7VdaOkDACw/Fvlji7oIJXt0KiaDTcOw==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/lzma-wasm32-wasi@1.3.1': - resolution: {integrity: sha512-XTA9XTUtj0KPKuzNS2oi3bWN6tJodk00wwMd/TiKoEqx9Fe/zu+OfDGuXAn+xs+P7S3YCDHqjYinuTQMZ0ucJw==} - engines: {node: '>=14.0.0'} - cpu: [wasm32] - - '@napi-rs/lzma-win32-arm64-msvc@1.3.1': - resolution: {integrity: sha512-qLDfs9UEtLPPTN/FdSz3gSdlx86VwFQBuLBrQtaiYQtUTKZCOYV1Z1fXqFt5Zqa1HKV2oyXnwGcTI7RpcyXxtg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [win32] - - '@napi-rs/lzma-win32-ia32-msvc@1.3.1': - resolution: {integrity: sha512-rWNlxLFMIfvxzfdQCfeQ3D/HEnQG3vfladFYrXUx6ePXO6r+BLCGn6/LWSSuKlw4vKkb1iHEWsAVaRLIcJEMIA==} - engines: {node: '>= 10'} - cpu: [ia32] - os: [win32] - - '@napi-rs/lzma-win32-x64-msvc@1.3.1': - resolution: {integrity: sha512-SNfHNqEjabXfTL1+KRi0qiAhwIlZHhQystvfSYX6p1g+2trSC/3WUpUQ4fbbR7KyE31g2AAnwjXivnlQ0af/pg==} - engines: {node: '>= 10'} - cpu: [x64] - os: [win32] - - '@napi-rs/lzma@1.3.1': - resolution: {integrity: sha512-XyZoBlYNMvCulK/RmVK/0nB3j7IdH7HpqcrMMg0U+HqQqKRLOQBwvnKNBocPC1bZQ7iZuKWYTLn1ayZwTyek8w==} - engines: {node: '>= 10'} - - '@napi-rs/tar-android-arm-eabi@0.1.1': - resolution: {integrity: sha512-Ufa0ahZvE5KGrC2WBux5svCe/jvC+e8IgtleiicwqnfgTfbDknYyq/QuqkP1AnMp/IvTmx2iutCZt6OFIG0zAg==} - engines: {node: '>= 10'} - cpu: [arm] - os: [android] - - '@napi-rs/tar-android-arm64@0.1.1': - resolution: {integrity: sha512-KUu5fHIiIObSuZ/crHxUrQ243+LiCRKPwdCVLHwjtftqFjzls+R2Mp6GrpM41XxexDMN00SUta3kazi93Xr19A==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [android] - - '@napi-rs/tar-darwin-arm64@0.1.1': - resolution: {integrity: sha512-jaqgdX20iIga+2gzotQ78eF00Cm8vECocUYeMY62WqyzJNv/jx1dlOfELWEccOjpmawFT9tjWebsS9F1QMvSUg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [darwin] - - '@napi-rs/tar-darwin-x64@0.1.1': - resolution: {integrity: sha512-80sa32IxfRso9x9sGTFpfLSx3BnruyJODpSkUzalOCz9i14n5gOKA8KR/JrnSWwDz0p5l5P9kfQD3pu8Voj7WA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [darwin] - - '@napi-rs/tar-freebsd-x64@0.1.1': - resolution: {integrity: sha512-P7V1zBjjC1dCrTwtUzuzYM4AeZduigeCtd8qQw2IUZowM5AsmhMd77oYuXjdU29cEpKUpyYjJRxjPCzFy+WbAQ==} - engines: {node: '>= 10'} - cpu: [x64] - os: [freebsd] - - '@napi-rs/tar-linux-arm-gnueabihf@0.1.1': - resolution: {integrity: sha512-qpC71ILPkWKt8k1iJCYt5gjwcOkd2VFSQIelTRr12t5CVNKV04rE/TMdwFoCP7kxbtb9Fl2cZzCRISw2BhMCmQ==} - engines: {node: '>= 10'} - cpu: [arm] - os: [linux] - - '@napi-rs/tar-linux-arm64-gnu@0.1.1': - resolution: {integrity: sha512-71QgxcFJCog6O4Tauoge8D0ILkDGJTRk3ru7zG8PUFG1QXJ1kkiRikdT77YmoVxtomc9FUOt+bdEdU5Yn+3QUQ==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/tar-linux-arm64-musl@0.1.1': - resolution: {integrity: sha512-R2e7YEILPKc447N1hUt1zQuyy0st83HX6nhmtFywS1aOj76/3hzxLVrebGiiS6kifyCrO82o66CNTYe7DixMZw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/tar-linux-x64-gnu@0.1.1': - resolution: {integrity: sha512-tmy9q2LXUB2GQ+IgUzJn3+us52leplMu96ORyFq1iHQEelGSqXt4xi5DzU07JhX3obJPqVqkybtcRS4enBfmBA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/tar-linux-x64-musl@0.1.1': - resolution: {integrity: sha512-j5ePbe6vihApl0cGPPDUVTWZbf2mF4NhxngAoG2jp7AeX3cWP2O4pjsvaOraW6QfvWEMFPeER7S0b6eBS7duvA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/tar-wasm32-wasi@0.1.1': - resolution: {integrity: sha512-se0+DlOiIRt7mcz7BeOJDoZtCrROpKLwiAOGmNgrjQ/SZS7TnOPuwm3wy9XN9WLoepttEjCEem6UP8yD5GJuQg==} - engines: {node: '>=14.0.0'} - cpu: [wasm32] - - '@napi-rs/tar-win32-arm64-msvc@0.1.1': - resolution: {integrity: sha512-FDZPi2wC7RwzvodogigLh/pJvhqCTVTUqOYuHlLkPSUbSAGiEkI55wk9RqH3y3EdJQaDuzyqC0QKz5ket2U+GA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [win32] - - '@napi-rs/tar-win32-ia32-msvc@0.1.1': - resolution: {integrity: sha512-OPR9Tou5z5M912G7Kc7gkf1ltinbOQx5dS/OeDIWHvPGOfdFDIxt0YVKhzSLRJi43+zIDp8/+cbeMD/cKXfX8w==} - engines: {node: '>= 10'} - cpu: [ia32] - os: [win32] - - '@napi-rs/tar-win32-x64-msvc@0.1.1': - resolution: {integrity: sha512-hiv5KfhrMSg8tTRC2oQXVckVg1h6ZVjwbd5aF9Esl0V3p2TaNFwwbqgnAN4Gm/PmSnHWNL/IRTHkk3cOzDWihQ==} - engines: {node: '>= 10'} - cpu: [x64] - os: [win32] - - '@napi-rs/tar@0.1.1': - resolution: {integrity: sha512-FOMhwwlvoYjHaDBxP26K3D92ltw1Y/CC4CIjgC6qXdzW4MYNwTlEyI58smCM3k+nCVJH3kpOYyH3sgbK4WZA4A==} - engines: {node: '>= 10'} - - '@napi-rs/wasm-runtime@0.2.4': - resolution: {integrity: sha512-9zESzOO5aDByvhIAsOy9TbpZ0Ur2AJbUI7UT73kcUTS2mxAMHOBaa1st/jAymNoCtvrit99kkzT1FZuXVcgfIQ==} - - '@napi-rs/wasm-tools-android-arm-eabi@0.0.2': - resolution: {integrity: sha512-/b+UU3suXjW4P0DzHRNdrnebQtFKcQf/YMeZJH+xUlKgvwli5kbmWjx8Wqqz0VETVkUTuPqJMBDIVLyc+14FGw==} - engines: {node: '>= 10'} - cpu: [arm] - os: [android] - - '@napi-rs/wasm-tools-android-arm64@0.0.2': - resolution: {integrity: sha512-j57GbDflwJdZtT8pZj5fOV4JAP+LdKN+wzsUYs+QRUoBqpWbbUANudolqfw63bkS9sD4z7fbCuz8iwtJqzxTVA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [android] - - '@napi-rs/wasm-tools-darwin-arm64@0.0.2': - resolution: {integrity: sha512-P2ChgWgVuv9GwmbxN89R84KzIImoTqXINteEixUvmkdnhyFiR+I8deNs89Yed+5w8QLC6MEfrtRqLP9YI+NoQA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [darwin] - - '@napi-rs/wasm-tools-darwin-x64@0.0.2': - resolution: {integrity: sha512-T/kQQ0gt8+wau1Z821PKVAD76QhmwVoLs2CT7Z9tTBs2pJvwSCP0C/kQiQAHcJIMi7A2E9Ab/Mez0BERy50EFA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [darwin] - - '@napi-rs/wasm-tools-freebsd-x64@0.0.2': - resolution: {integrity: sha512-GnnHu+r5sfzuxC/1J5UMF/h3BOZnHb3NQZ5hmbCfZYCKzpzRxrAJhzRunlbRN+v0x8M/49dztVTYR3s7K4ooAw==} - engines: {node: '>= 10'} - cpu: [x64] - os: [freebsd] - - '@napi-rs/wasm-tools-linux-arm64-gnu@0.0.2': - resolution: {integrity: sha512-KnZdLT0OnKb1CG2kdt3/WvM43vr9i+FEwXCvSOVC/6Tsifz7ynhMg7LAVESILd03HubzQJfg9nbRsk0bQ+IOwg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/wasm-tools-linux-arm64-musl@0.0.2': - resolution: {integrity: sha512-HkpZOID2U8P6pWqK3mqZ8bxU5xcuT3iA2fO+jrxn78h006iYgfNmdc5JaVhHnHazMmk32xKhSV4iV0VUh8UWDg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/wasm-tools-linux-x64-gnu@0.0.2': - resolution: {integrity: sha512-YksJWBCyOalB9ogtP9+/dZKP+vR6+h7BmzMXaXMT71WW/GvIsifMVgv+DY/FRSNJQupp5Y+ugjqVAOUOc/G65g==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/wasm-tools-linux-x64-musl@0.0.2': - resolution: {integrity: sha512-sPtRxPMdw05KdTcxgSPMmSXG2+PiK3vJ/l2+g9hvjnnKtvslJN2Hr7j8zgzuoKRAUFPaJVe6+D2xVh5cpdqhww==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/wasm-tools-wasm32-wasi@0.0.2': - resolution: {integrity: sha512-muRvZK7AIuo88G2AxYx3gA59rHMQgoN004saQkBvXnz3K/DVHKfTZ6TtUebss8zI3dURU6xExL8drxFWYxjEbQ==} - engines: {node: '>=14.0.0'} - cpu: [wasm32] - - '@napi-rs/wasm-tools-win32-arm64-msvc@0.0.2': - resolution: {integrity: sha512-Cn13WQ+tpFqdVwx0DIWKbsI9auFyzVZV4F5UNOUeDt6GgOL+NndgJul0Pc9bSU6fi03AylMPfF/nTCaDWO2Wgw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [win32] - - '@napi-rs/wasm-tools-win32-ia32-msvc@0.0.2': - resolution: {integrity: sha512-xsg5DkIQi82a8rcx6246Y3XC8TIqHamY+/C6sIlPLaZEuHctDkMECAw0AANwRf5vN//D2oo2oljOuoYtB1GOKw==} - engines: {node: '>= 10'} - cpu: [ia32] - os: [win32] - - '@napi-rs/wasm-tools-win32-x64-msvc@0.0.2': - resolution: {integrity: sha512-yHigltEt33eq8bappvKsIliz4MxfMPn1M+NWbIFRWN+IS1Z57mhmc1osuk+IRXrSlq0Tom0R6MYN1jpkZKz81Q==} - engines: {node: '>= 10'} - cpu: [x64] - os: [win32] - - '@napi-rs/wasm-tools@0.0.2': - resolution: {integrity: sha512-kBvDQCP5BLw2TxTENXLp3Of7vVEx0uyIye824JHE4dduzzOHVgSoOFVhVqAT3Fx/hLV445RVWfEqQbXMg4w/Mw==} - engines: {node: '>= 10'} - - '@nodelib/fs.scandir@2.1.5': - resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} - engines: {node: '>= 8'} - - '@nodelib/fs.stat@2.0.5': - resolution: {integrity: sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==} - engines: {node: '>= 8'} - - '@nodelib/fs.walk@1.2.8': - resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} - engines: {node: '>= 8'} - - '@octokit/auth-token@4.0.0': - resolution: {integrity: sha512-tY/msAuJo6ARbK6SPIxZrPBms3xPbfwBrulZe0Wtr/DIY9lje2HeV1uoebShn6mx7SjCHif6EjMvoREj+gZ+SA==} - engines: {node: '>= 18'} - - '@octokit/core@5.2.0': - resolution: {integrity: sha512-1LFfa/qnMQvEOAdzlQymH0ulepxbxnCYAKJZfMci/5XJyIHWgEYnDmgnKakbTh7CH2tFQ5O60oYDvns4i9RAIg==} - engines: {node: '>= 18'} - - '@octokit/endpoint@9.0.5': - resolution: {integrity: sha512-ekqR4/+PCLkEBF6qgj8WqJfvDq65RH85OAgrtnVp1mSxaXF03u2xW/hUdweGS5654IlC0wkNYC18Z50tSYTAFw==} - engines: {node: '>= 18'} - - '@octokit/graphql@7.1.0': - resolution: {integrity: sha512-r+oZUH7aMFui1ypZnAvZmn0KSqAUgE1/tUXIWaqUCa1758ts/Jio84GZuzsvUkme98kv0WFY8//n0J1Z+vsIsQ==} - engines: {node: '>= 18'} - - '@octokit/openapi-types@22.2.0': - resolution: {integrity: sha512-QBhVjcUa9W7Wwhm6DBFu6ZZ+1/t/oYxqc2tp81Pi41YNuJinbFRx8B133qVOrAaBbF7D/m0Et6f9/pZt9Rc+tg==} - - '@octokit/plugin-paginate-rest@11.3.1': - resolution: {integrity: sha512-ryqobs26cLtM1kQxqeZui4v8FeznirUsksiA+RYemMPJ7Micju0WSkv50dBksTuZks9O5cg4wp+t8fZ/cLY56g==} - engines: {node: '>= 18'} - peerDependencies: - '@octokit/core': '5' - - '@octokit/plugin-request-log@4.0.1': - resolution: {integrity: sha512-GihNqNpGHorUrO7Qa9JbAl0dbLnqJVrV8OXe2Zm5/Y4wFkZQDfTreBzVmiRfJVfE4mClXdihHnbpyyO9FSX4HA==} - engines: {node: '>= 18'} - peerDependencies: - '@octokit/core': '5' - - '@octokit/plugin-rest-endpoint-methods@13.2.2': - resolution: {integrity: sha512-EI7kXWidkt3Xlok5uN43suK99VWqc8OaIMktY9d9+RNKl69juoTyxmLoWPIZgJYzi41qj/9zU7G/ljnNOJ5AFA==} - engines: {node: '>= 18'} - peerDependencies: - '@octokit/core': ^5 - - '@octokit/request-error@5.1.0': - resolution: {integrity: sha512-GETXfE05J0+7H2STzekpKObFe765O5dlAKUTLNGeH+x47z7JjXHfsHKo5z21D/o/IOZTUEI6nyWyR+bZVP/n5Q==} - engines: {node: '>= 18'} - - '@octokit/request@8.4.0': - resolution: {integrity: sha512-9Bb014e+m2TgBeEJGEbdplMVWwPmL1FPtggHQRkV+WVsMggPtEkLKPlcVYm/o8xKLkpJ7B+6N8WfQMtDLX2Dpw==} - engines: {node: '>= 18'} - - '@octokit/rest@20.1.1': - resolution: {integrity: sha512-MB4AYDsM5jhIHro/dq4ix1iWTLGToIGk6cWF5L6vanFaMble5jTX/UBQyiv05HsWnwUtY8JrfHy2LWfKwihqMw==} - engines: {node: '>= 18'} - - '@octokit/types@13.5.0': - resolution: {integrity: sha512-HdqWTf5Z3qwDVlzCrP8UJquMwunpDiMPt5er+QjGzL4hqr/vBVY/MauQgS1xWxCDT1oMx1EULyqxncdCY/NVSQ==} - - '@rollup/pluginutils@4.2.1': - resolution: {integrity: sha512-iKnFXr7NkdZAIHiIWE+BX5ULi/ucVFYWD6TbAV+rZctiRTY2PL6tsIKhoIOaoskiWAkgu+VsbXgUVDNLHf+InQ==} - engines: {node: '>= 8.0.0'} - - '@sindresorhus/merge-streams@2.3.0': - resolution: {integrity: sha512-LtoMMhxAlorcGhmFYI+LhPgbPZCkgP6ra1YL604EeF6U98pLlQ3iWIGMdWSC+vWmPBWBNgmDBAhnAobLROJmwg==} - engines: {node: '>=18'} - - '@tybys/wasm-util@0.9.0': - resolution: {integrity: sha512-6+7nlbMVX/PVDCwaIQ8nTOPveOcFLSt8GcXdx8hD0bt39uWxYT88uXzqTd4fTvqta7oeUJqudepapKNt2DYJFw==} - - '@types/node@20.14.9': - resolution: {integrity: sha512-06OCtnTXtWOZBJlRApleWndH4JsRVs1pDCc8dLSQp+7PpUpX3ePdHyeNSFTeSe7FtKyQkrlPvHwJOW3SLd8Oyg==} - - '@types/stylis@4.2.6': - resolution: {integrity: sha512-4nebF2ZJGzQk0ka0O6+FZUWceyFv4vWq/0dXBMmrSeAwzOuOd/GxE5Pa64d/ndeNLG73dXoBsRzvtsVsYUv6Uw==} - - '@vercel/nft@0.26.5': - resolution: {integrity: sha512-NHxohEqad6Ra/r4lGknO52uc/GrWILXAMs1BB4401GTqww0fw1bAqzpG1XHuDO+dprg4GvsD9ZLLSsdo78p9hQ==} - engines: {node: '>=16'} - hasBin: true - - abbrev@1.1.1: - resolution: {integrity: sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==} - - acorn-import-attributes@1.9.5: - resolution: {integrity: sha512-n02Vykv5uA3eHGM/Z2dQrcD56kL8TyDb2p1+0P83PClMnC/nc+anbQRhIOWnSq4Ke/KvDPrY3C9hDtC/A3eHnQ==} - peerDependencies: - acorn: ^8 - - acorn-walk@8.3.3: - resolution: {integrity: sha512-MxXdReSRhGO7VlFe1bRG/oI7/mdLV9B9JJT0N8vZOhF7gFRR5l3M8W9G8JxmKV+JC5mGqJ0QvqfSOLsCPa4nUw==} - engines: {node: '>=0.4.0'} - - acorn@8.12.0: - resolution: {integrity: sha512-RTvkC4w+KNXrM39/lWCUaG0IbRkWdCv7W/IOW9oU6SawyxulvkQy5HQPVTKxEjczcUvapcrw3cFx/60VN/NRNw==} - engines: {node: '>=0.4.0'} - hasBin: true - - agent-base@6.0.2: - resolution: {integrity: sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==} - engines: {node: '>= 6.0.0'} - - ansi-escapes@4.3.2: - resolution: {integrity: sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==} - engines: {node: '>=8'} - - ansi-regex@5.0.1: - resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} - engines: {node: '>=8'} - - ansi-regex@6.0.1: - resolution: {integrity: sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==} - engines: {node: '>=12'} - - ansi-styles@4.3.0: - resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} - engines: {node: '>=8'} - - ansi-styles@6.2.1: - resolution: {integrity: sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==} - engines: {node: '>=12'} - - aproba@2.0.0: - resolution: {integrity: sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==} - - are-we-there-yet@2.0.0: - resolution: {integrity: sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw==} - engines: {node: '>=10'} - deprecated: This package is no longer supported. - - argparse@1.0.10: - resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==} - - argparse@2.0.1: - resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} - - array-find-index@1.0.2: - resolution: {integrity: sha512-M1HQyIXcBGtVywBt8WVdim+lrNaK7VHp99Qt5pSNziXznKHViIBbXWtfRTpEFpF/c4FdfxNAsCCwPp5phBYJtw==} - engines: {node: '>=0.10.0'} - - arrgv@1.0.2: - resolution: {integrity: sha512-a4eg4yhp7mmruZDQFqVMlxNRFGi/i1r87pt8SDHy0/I8PqSXoUTlWZRdAZo0VXgvEARcujbtTk8kiZRi1uDGRw==} - engines: {node: '>=8.0.0'} - - arrify@3.0.0: - resolution: {integrity: sha512-tLkvA81vQG/XqE2mjDkGQHoOINtMHtysSnemrmoGe6PydDPMRbVugqyk4A6V/WDWEfm3l+0d8anA9r8cv/5Jaw==} - engines: {node: '>=12'} - - async-sema@3.1.1: - resolution: {integrity: sha512-tLRNUXati5MFePdAk8dw7Qt7DpxPB60ofAgn8WRhW6a2rcimZnYBP9oxHiv0OHy+Wz7kPMG+t4LGdt31+4EmGg==} - - asynckit@0.4.0: - resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} - - ava@6.1.3: - resolution: {integrity: sha512-tkKbpF1pIiC+q09wNU9OfyTDYZa8yuWvU2up3+lFJ3lr1RmnYh2GBpPwzYUEB0wvTPIUysGjcZLNZr7STDviRA==} - engines: {node: ^18.18 || ^20.8 || ^21 || ^22} - hasBin: true - peerDependencies: - '@ava/typescript': '*' - peerDependenciesMeta: - '@ava/typescript': - optional: true - - axios@1.6.2: - resolution: {integrity: sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A==} - - balanced-match@1.0.2: - resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} - - base64-js@1.5.1: - resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==} - - before-after-hook@2.2.3: - resolution: {integrity: sha512-NzUnlZexiaH/46WDhANlyR2bXRopNg4F/zuSA3OpZnllCUgRaOF2znDioDWrmbNVsuZk6l9pMquQB38cfBZwkQ==} - - bindings@1.5.0: - resolution: {integrity: sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==} - - bl@4.1.0: - resolution: {integrity: sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==} - - blueimp-md5@2.19.0: - resolution: {integrity: sha512-DRQrD6gJyy8FbiE4s+bDoXS9hiW3Vbx5uCdwvcCf3zLHL+Iv7LtGHLpr+GZV8rHG8tK766FGYBwRbu8pELTt+w==} - - brace-expansion@1.1.11: - resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} - - braces@3.0.3: - resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==} - engines: {node: '>=8'} - - buffer@5.7.1: - resolution: {integrity: sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==} - - call-bind@1.0.7: - resolution: {integrity: sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==} - engines: {node: '>= 0.4'} - - callsites@4.1.0: - resolution: {integrity: sha512-aBMbD1Xxay75ViYezwT40aQONfr+pSXTHwNKvIXhXD6+LY3F1dLIcceoC5OZKBVHbXcysz1hL9D2w0JJIMXpUw==} - engines: {node: '>=12.20'} - - camelize@1.0.1: - resolution: {integrity: sha512-dU+Tx2fsypxTgtLoE36npi3UqcjSSMNYfkqgmoEhtZrraP5VWq0K7FkWVTYa8eMPtnU/G2txVsfdCJTn9uzpuQ==} - - cbor@9.0.2: - resolution: {integrity: sha512-JPypkxsB10s9QOWwa6zwPzqE1Md3vqpPc+cai4sAecuCsRyAtAl/pMyhPlMbT/xtPnm2dznJZYRLui57qiRhaQ==} - engines: {node: '>=16'} - - chalk@4.1.2: - resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} - engines: {node: '>=10'} - - chalk@5.3.0: - resolution: {integrity: sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==} - engines: {node: ^12.17.0 || ^14.13 || >=16.0.0} - - chardet@0.7.0: - resolution: {integrity: sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==} - - chownr@2.0.0: - resolution: {integrity: sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==} - engines: {node: '>=10'} - - chunkd@2.0.1: - resolution: {integrity: sha512-7d58XsFmOq0j6el67Ug9mHf9ELUXsQXYJBkyxhH/k+6Ke0qXRnv0kbemx+Twc6fRJ07C49lcbdgm9FL1Ei/6SQ==} - - ci-info@4.0.0: - resolution: {integrity: sha512-TdHqgGf9odd8SXNuxtUBVx8Nv+qZOejE6qyqiy5NtbYYQOeFa6zmHkxlPzmaLxWWHsU6nJmB7AETdVPi+2NBUg==} - engines: {node: '>=8'} - - ci-parallel-vars@1.0.1: - resolution: {integrity: sha512-uvzpYrpmidaoxvIQHM+rKSrigjOe9feHYbw4uOI2gdfe1C3xIlxO+kVXq83WQWNniTf8bAxVpy+cQeFQsMERKg==} - - cli-cursor@3.1.0: - resolution: {integrity: sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==} - engines: {node: '>=8'} - - cli-spinners@2.9.2: - resolution: {integrity: sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==} - engines: {node: '>=6'} - - cli-truncate@4.0.0: - resolution: {integrity: sha512-nPdaFdQ0h/GEigbPClz11D0v/ZJEwxmeVZGeMo3Z5StPtUTkA9o1lD6QwoirYiSDzbcwn2XcjwmCp68W1IS4TA==} - engines: {node: '>=18'} - - cli-width@4.1.0: - resolution: {integrity: sha512-ouuZd4/dm2Sw5Gmqy6bGyNNNe1qt9RpmxveLSO7KcgsTnU7RXfsw+/bukWGo1abgBiMAic068rclZsO4IWmmxQ==} - engines: {node: '>= 12'} - - clipanion@3.2.1: - resolution: {integrity: sha512-dYFdjLb7y1ajfxQopN05mylEpK9ZX0sO1/RfMXdfmwjlIsPkbh4p7A682x++zFPLDCo1x3p82dtljHf5cW2LKA==} - peerDependencies: - typanion: '*' - - cliui@8.0.1: - resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==} - engines: {node: '>=12'} - - clone@1.0.4: - resolution: {integrity: sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==} - engines: {node: '>=0.8'} - - code-excerpt@4.0.0: - resolution: {integrity: sha512-xxodCmBen3iy2i0WtAK8FlFNrRzjUqjRsMfho58xT/wvZU1YTM3fCnRjcy1gJPMepaRlgm/0e6w8SpWHpn3/cA==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - color-convert@2.0.1: - resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} - engines: {node: '>=7.0.0'} - - color-name@1.1.4: - resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} - - color-support@1.1.3: - resolution: {integrity: sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==} - hasBin: true - - colorette@2.0.20: - resolution: {integrity: sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==} - - combined-stream@1.0.8: - resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} - engines: {node: '>= 0.8'} - - common-path-prefix@3.0.0: - resolution: {integrity: sha512-QE33hToZseCH3jS0qN96O/bSh3kaw/h+Tq7ngyY9eWDUnTlTNUyqfqvCXioLe5Na5jFsL78ra/wuBU4iuEgd4w==} - - concat-map@0.0.1: - resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} - - concordance@5.0.4: - resolution: {integrity: sha512-OAcsnTEYu1ARJqWVGwf4zh4JDfHZEaSNlNccFmt8YjB2l/n19/PF2viLINHc57vO4FKIAFl2FWASIGZZWZ2Kxw==} - engines: {node: '>=10.18.0 <11 || >=12.14.0 <13 || >=14'} - - console-control-strings@1.1.0: - resolution: {integrity: sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==} - - convert-to-spaces@2.0.1: - resolution: {integrity: sha512-rcQ1bsQO9799wq24uE5AM2tAILy4gXGIK/njFWcVQkGNZ96edlpY+A7bjwvzjYvLDyzmG1MmMLZhpcsb+klNMQ==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - css-color-keywords@1.0.0: - resolution: {integrity: sha512-FyyrDHZKEjXDpNJYvVsV960FiqQyXc/LlYmsxl2BcdMb2WPx0OGRVgTg55rPSyLSNMqP52R9r8geSp7apN3Ofg==} - engines: {node: '>=4'} - - css-to-react-native@3.2.0: - resolution: {integrity: sha512-e8RKaLXMOFii+02mOlqwjbD00KSEKqblnpO9e++1aXS1fPQOpS1YoqdVHBqPjHNoxeF2mimzVqawm2KCbEdtHQ==} - - csstype@3.1.3: - resolution: {integrity: sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==} - - currently-unhandled@0.4.1: - resolution: {integrity: sha512-/fITjgjGU50vjQ4FH6eUoYu+iUoUKIXws2hL15JJpIR+BbTxaXQsMuuyjtNh2WqsSBS5nsaZHFsFecyw5CCAng==} - engines: {node: '>=0.10.0'} - - date-time@3.1.0: - resolution: {integrity: sha512-uqCUKXE5q1PNBXjPqvwhwJf9SwMoAHBgWJ6DcrnS5o+W2JOiIILl0JEdVD8SGujrNS02GGxgwAg2PN2zONgtjg==} - engines: {node: '>=6'} - - debug@4.3.5: - resolution: {integrity: sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg==} - engines: {node: '>=6.0'} - peerDependencies: - supports-color: '*' - peerDependenciesMeta: - supports-color: - optional: true - - defaults@1.0.4: - resolution: {integrity: sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A==} - - define-data-property@1.1.4: - resolution: {integrity: sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==} - engines: {node: '>= 0.4'} - - delayed-stream@1.0.0: - resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} - engines: {node: '>=0.4.0'} - - delegates@1.0.0: - resolution: {integrity: sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==} - - deprecation@2.3.1: - resolution: {integrity: sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==} - - detect-libc@2.0.3: - resolution: {integrity: sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw==} - engines: {node: '>=8'} - - emittery@1.0.3: - resolution: {integrity: sha512-tJdCJitoy2lrC2ldJcqN4vkqJ00lT+tOWNT1hBJjO/3FDMJa5TTIiYGCKGkn/WfCyOzUMObeohbVTj00fhiLiA==} - engines: {node: '>=14.16'} - - emnapi@1.2.0: - resolution: {integrity: sha512-rcq+dJCcfr08I0XM/57LPRqaUokGfni/+SvhO7NaJthTTjRdohhIy0FQwyC5rR1enAsjkldQg83th8J5hURv0Q==} - peerDependencies: - node-addon-api: '>= 6.1.0' - peerDependenciesMeta: - node-addon-api: - optional: true - - emoji-regex@10.3.0: - resolution: {integrity: sha512-QpLs9D9v9kArv4lfDEgg1X/gN5XLnf/A6l9cs8SPZLRZR3ZkY9+kwIQTxm+fsSej5UMYGE8fdoaZVIBlqG0XTw==} - - emoji-regex@8.0.0: - resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} - - es-define-property@1.0.0: - resolution: {integrity: sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==} - engines: {node: '>= 0.4'} - - es-errors@1.3.0: - resolution: {integrity: sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==} - engines: {node: '>= 0.4'} - - escalade@3.1.2: - resolution: {integrity: sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==} - engines: {node: '>=6'} - - escape-string-regexp@2.0.0: - resolution: {integrity: sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==} - engines: {node: '>=8'} - - escape-string-regexp@5.0.0: - resolution: {integrity: sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==} - engines: {node: '>=12'} - - esprima@4.0.1: - resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==} - engines: {node: '>=4'} - hasBin: true - - estree-walker@2.0.2: - resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==} - - esutils@2.0.3: - resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} - engines: {node: '>=0.10.0'} - - external-editor@3.1.0: - resolution: {integrity: sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==} - engines: {node: '>=4'} - - fast-diff@1.3.0: - resolution: {integrity: sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==} - - fast-glob@3.3.2: - resolution: {integrity: sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==} - engines: {node: '>=8.6.0'} - - fastq@1.17.1: - resolution: {integrity: sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==} - - figures@6.1.0: - resolution: {integrity: sha512-d+l3qxjSesT4V7v2fh+QnmFnUWv9lSpjarhShNTgBOfA0ttejbQUAlHLitbjkoRiDulW0OPoQPYIGhIC8ohejg==} - engines: {node: '>=18'} - - file-uri-to-path@1.0.0: - resolution: {integrity: sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==} - - fill-range@7.1.1: - resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==} - engines: {node: '>=8'} - - find-up-simple@1.0.0: - resolution: {integrity: sha512-q7Us7kcjj2VMePAa02hDAF6d+MzsdsAWEwYyOpwUtlerRBkOEPBCRZrAV4XfcSN8fHAgaD0hP7miwoay6DCprw==} - engines: {node: '>=18'} - - follow-redirects@1.15.6: - resolution: {integrity: sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==} - engines: {node: '>=4.0'} - peerDependencies: - debug: '*' - peerDependenciesMeta: - debug: - optional: true - - form-data@4.0.0: - resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==} - engines: {node: '>= 6'} - - fs-minipass@2.1.0: - resolution: {integrity: sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==} - engines: {node: '>= 8'} - - fs.realpath@1.0.0: - resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} - - function-bind@1.1.2: - resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==} - - gauge@3.0.2: - resolution: {integrity: sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q==} - engines: {node: '>=10'} - deprecated: This package is no longer supported. - - get-caller-file@2.0.5: - resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} - engines: {node: 6.* || 8.* || >= 10.*} - - get-east-asian-width@1.2.0: - resolution: {integrity: sha512-2nk+7SIVb14QrgXFHcm84tD4bKQz0RxPuMT8Ag5KPOq7J5fEmAg0UbXdTOSHqNuHSU28k55qnceesxXRZGzKWA==} - engines: {node: '>=18'} - - get-intrinsic@1.2.4: - resolution: {integrity: sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==} - engines: {node: '>= 0.4'} - - glob-parent@5.1.2: - resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} - engines: {node: '>= 6'} - - glob@7.2.3: - resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} - deprecated: Glob versions prior to v9 are no longer supported - - globby@14.0.1: - resolution: {integrity: sha512-jOMLD2Z7MAhyG8aJpNOpmziMOP4rPLcc95oQPKXBazW82z+CEgPFBQvEpRUa1KeIMUJo4Wsm+q6uzO/Q/4BksQ==} - engines: {node: '>=18'} - - gopd@1.0.1: - resolution: {integrity: sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==} - - graceful-fs@4.2.11: - resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} - - has-flag@4.0.0: - resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} - engines: {node: '>=8'} - - has-property-descriptors@1.0.2: - resolution: {integrity: sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==} - - has-proto@1.0.3: - resolution: {integrity: sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==} - engines: {node: '>= 0.4'} - - has-symbols@1.0.3: - resolution: {integrity: sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==} - engines: {node: '>= 0.4'} - - has-unicode@2.0.1: - resolution: {integrity: sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==} - - hasown@2.0.2: - resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==} - engines: {node: '>= 0.4'} - - https-proxy-agent@5.0.1: - resolution: {integrity: sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==} - engines: {node: '>= 6'} - - iconv-lite@0.4.24: - resolution: {integrity: sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==} - engines: {node: '>=0.10.0'} - - ieee754@1.2.1: - resolution: {integrity: sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==} - - ignore-by-default@2.1.0: - resolution: {integrity: sha512-yiWd4GVmJp0Q6ghmM2B/V3oZGRmjrKLXvHR3TE1nfoXsmoggllfZUQe74EN0fJdPFZu2NIvNdrMMLm3OsV7Ohw==} - engines: {node: '>=10 <11 || >=12 <13 || >=14'} - - ignore@5.3.1: - resolution: {integrity: sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==} - engines: {node: '>= 4'} - - imurmurhash@0.1.4: - resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} - engines: {node: '>=0.8.19'} - - indent-string@5.0.0: - resolution: {integrity: sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==} - engines: {node: '>=12'} - - inflight@1.0.6: - resolution: {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. - - inherits@2.0.4: - resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} - - inquirer@9.2.23: - resolution: {integrity: sha512-kod5s+FBPIDM2xiy9fu+6wdU/SkK5le5GS9lh4FEBjBHqiMgD9lLFbCbuqFNAjNL2ZOy9Wd9F694IOzN9pZHBA==} - engines: {node: '>=18'} - - irregular-plurals@3.5.0: - resolution: {integrity: sha512-1ANGLZ+Nkv1ptFb2pa8oG8Lem4krflKuX/gINiHJHjJUKaJHk/SXk5x6K3J+39/p0h1RQ2saROclJJ+QLvETCQ==} - engines: {node: '>=8'} - - is-extglob@2.1.1: - resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} - engines: {node: '>=0.10.0'} - - is-fullwidth-code-point@3.0.0: - resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} - engines: {node: '>=8'} - - is-fullwidth-code-point@4.0.0: - resolution: {integrity: sha512-O4L094N2/dZ7xqVdrXhh9r1KODPJpFms8B5sGdJLPy664AgvXsreZUyCQQNItZRDlYug4xStLjNp/sz3HvBowQ==} - engines: {node: '>=12'} - - is-glob@4.0.3: - resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} - engines: {node: '>=0.10.0'} - - is-interactive@1.0.0: - resolution: {integrity: sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w==} - engines: {node: '>=8'} - - is-number@7.0.0: - resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} - engines: {node: '>=0.12.0'} - - is-plain-object@5.0.0: - resolution: {integrity: sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==} - engines: {node: '>=0.10.0'} - - is-promise@4.0.0: - resolution: {integrity: sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==} - - is-unicode-supported@0.1.0: - resolution: {integrity: sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==} - engines: {node: '>=10'} - - is-unicode-supported@2.0.0: - resolution: {integrity: sha512-FRdAyx5lusK1iHG0TWpVtk9+1i+GjrzRffhDg4ovQ7mcidMQ6mj+MhKPmvh7Xwyv5gIS06ns49CA7Sqg7lC22Q==} - engines: {node: '>=18'} - - js-string-escape@1.0.1: - resolution: {integrity: sha512-Smw4xcfIQ5LVjAOuJCvN/zIodzA/BBSsluuoSykP+lUvScIi4U6RJLfwHet5cxFnCswUjISV8oAXaqaJDY3chg==} - engines: {node: '>= 0.8'} - - js-tokens@4.0.0: - resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} - - js-yaml@3.14.1: - resolution: {integrity: sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==} - hasBin: true - - js-yaml@4.1.0: - resolution: {integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==} - hasBin: true - - load-json-file@7.0.1: - resolution: {integrity: sha512-Gnxj3ev3mB5TkVBGad0JM6dmLiQL+o0t23JPBZ9sd+yvSLk05mFoqKBw5N8gbbkU4TNXyqCgIrl/VM17OgUIgQ==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - lodash-es@4.17.21: - resolution: {integrity: sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==} - - lodash@4.17.21: - resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} - - log-symbols@4.1.0: - resolution: {integrity: sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==} - engines: {node: '>=10'} - - loose-envify@1.4.0: - resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==} - hasBin: true - - make-dir@3.1.0: - resolution: {integrity: sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==} - engines: {node: '>=8'} - - matcher@5.0.0: - resolution: {integrity: sha512-s2EMBOWtXFc8dgqvoAzKJXxNHibcdJMV0gwqKUaw9E2JBJuGUK7DrNKrA6g/i+v72TT16+6sVm5mS3thaMLQUw==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - md5-hex@3.0.1: - resolution: {integrity: sha512-BUiRtTtV39LIJwinWBjqVsU9xhdnz7/i889V859IBFpuqGAj6LuOvHv5XLbgZ2R7ptJoJaEcxkv88/h25T7Ciw==} - engines: {node: '>=8'} - - memoize@10.0.0: - resolution: {integrity: sha512-H6cBLgsi6vMWOcCpvVCdFFnl3kerEXbrYh9q+lY6VXvQSmM6CkmV08VOwT+WE2tzIEqRPFfAq3fm4v/UIW6mSA==} - engines: {node: '>=18'} - - merge2@1.4.1: - resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} - engines: {node: '>= 8'} - - micromatch@4.0.7: - resolution: {integrity: sha512-LPP/3KorzCwBxfeUuZmaR6bG2kdeHSbe0P2tY3FLRU4vYrjYz5hI4QZwV0njUx3jeuKe67YukQ1LSPZBKDqO/Q==} - engines: {node: '>=8.6'} - - mime-db@1.52.0: - resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} - engines: {node: '>= 0.6'} - - mime-types@2.1.35: - resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} - engines: {node: '>= 0.6'} - - mimic-fn@2.1.0: - resolution: {integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==} - engines: {node: '>=6'} - - mimic-function@5.0.1: - resolution: {integrity: sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==} - engines: {node: '>=18'} - - minimatch@3.1.2: - resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} - - minipass@3.3.6: - resolution: {integrity: sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==} - engines: {node: '>=8'} - - minipass@5.0.0: - resolution: {integrity: sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==} - engines: {node: '>=8'} - - minizlib@2.1.2: - resolution: {integrity: sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==} - engines: {node: '>= 8'} - - mkdirp@1.0.4: - resolution: {integrity: sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==} - engines: {node: '>=10'} - hasBin: true - - ms@2.1.2: - resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} - - ms@2.1.3: - resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} - - mute-stream@1.0.0: - resolution: {integrity: sha512-avsJQhyd+680gKXyG/sQc0nXaC6rBkPOfyHYcFb9+hdkqQkR9bdnkJ0AMZhke0oesPqIO+mFFJ+IdBc7mst4IA==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - - nanoid@3.3.7: - resolution: {integrity: sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==} - engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} - hasBin: true - - node-fetch@2.7.0: - resolution: {integrity: sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==} - engines: {node: 4.x || >=6.0.0} - peerDependencies: - encoding: ^0.1.0 - peerDependenciesMeta: - encoding: - optional: true - - node-gyp-build@4.8.1: - resolution: {integrity: sha512-OSs33Z9yWr148JZcbZd5WiAXhh/n9z8TxQcdMhIOlpN9AhWpLfvVFO73+m77bBABQMaY9XSvIa+qk0jlI7Gcaw==} - hasBin: true - - nofilter@3.1.0: - resolution: {integrity: sha512-l2NNj07e9afPnhAhvgVrCD/oy2Ai1yfLpuo3EpiO1jFTsB4sFz6oIfAfSZyQzVpkZQ9xS8ZS5g1jCBgq4Hwo0g==} - engines: {node: '>=12.19'} - - nopt@5.0.0: - resolution: {integrity: sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==} - engines: {node: '>=6'} - hasBin: true - - npmlog@5.0.1: - resolution: {integrity: sha512-AqZtDUWOMKs1G/8lwylVjrdYgqA4d9nu8hc+0gzRxlDb1I10+FHBGMXs6aiQHFdCUUlqH99MUMuLfzWDNDtfxw==} - deprecated: This package is no longer supported. - - object-assign@4.1.1: - resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} - engines: {node: '>=0.10.0'} - - once@1.4.0: - resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} - - onetime@5.1.2: - resolution: {integrity: sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==} - engines: {node: '>=6'} - - ora@5.4.1: - resolution: {integrity: sha512-5b6Y85tPxZZ7QytO+BQzysW31HJku27cRIlkbAXaNx+BdcVi+LlRFmVXzeF6a7JCwJpyw5c4b+YSVImQIrBpuQ==} - engines: {node: '>=10'} - - os-tmpdir@1.0.2: - resolution: {integrity: sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==} - engines: {node: '>=0.10.0'} - - p-map@7.0.2: - resolution: {integrity: sha512-z4cYYMMdKHzw4O5UkWJImbZynVIo0lSGTXc7bzB1e/rrDqkgGUNysK/o4bTr+0+xKvvLoTyGqYC4Fgljy9qe1Q==} - engines: {node: '>=18'} - - package-config@5.0.0: - resolution: {integrity: sha512-GYTTew2slBcYdvRHqjhwaaydVMvn/qrGC323+nKclYioNSLTDUM/lGgtGTgyHVtYcozb+XkE8CNhwcraOmZ9Mg==} - engines: {node: '>=18'} - - parse-ms@4.0.0: - resolution: {integrity: sha512-TXfryirbmq34y8QBwgqCVLi+8oA3oWx2eAnSn62ITyEhEYaWRlVZ2DvMM9eZbMs/RfxPu/PK/aBLyGj4IrqMHw==} - engines: {node: '>=18'} - - path-is-absolute@1.0.1: - resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==} - engines: {node: '>=0.10.0'} - - path-type@5.0.0: - resolution: {integrity: sha512-5HviZNaZcfqP95rwpv+1HDgUamezbqdSYTyzjTvwtJSnIH+3vnbmWsItli8OFEndS984VT55M3jduxZbX351gg==} - engines: {node: '>=12'} - - picocolors@1.0.1: - resolution: {integrity: sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==} - - picomatch@2.3.1: - resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} - engines: {node: '>=8.6'} - - picomatch@3.0.1: - resolution: {integrity: sha512-I3EurrIQMlRc9IaAZnqRR044Phh2DXY+55o7uJ0V+hYZAcQYSuFWsc9q5PvyDHUSCe1Qxn/iBz+78s86zWnGag==} - engines: {node: '>=10'} - - plur@5.1.0: - resolution: {integrity: sha512-VP/72JeXqak2KiOzjgKtQen5y3IZHn+9GOuLDafPv0eXa47xq0At93XahYBs26MsifCQ4enGKwbjBTKgb9QJXg==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - postcss-value-parser@4.2.0: - resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==} - - postcss@8.4.33: - resolution: {integrity: sha512-Kkpbhhdjw2qQs2O2DGX+8m5OVqEcbB9HRBvuYM9pgrjEFUg30A9LmXNlTAUj4S9kgtGyrMbTzVjH7E+s5Re2yg==} - engines: {node: ^10 || ^12 || >=14} - - pretty-ms@9.0.0: - resolution: {integrity: sha512-E9e9HJ9R9NasGOgPaPE8VMeiPKAyWR5jcFpNnwIejslIhWqdqOrb2wShBsncMPUb+BcCd2OPYfh7p2W6oemTng==} - engines: {node: '>=18'} - - proxy-from-env@1.1.0: - resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==} - - queue-microtask@1.2.3: - resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} - - react-dom@18.3.1: - resolution: {integrity: sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==} - peerDependencies: - react: ^18.3.1 - - react@18.3.1: - resolution: {integrity: sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==} - engines: {node: '>=0.10.0'} - - readable-stream@3.6.2: - resolution: {integrity: sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==} - engines: {node: '>= 6'} - - require-directory@2.1.1: - resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} - engines: {node: '>=0.10.0'} - - resolve-cwd@3.0.0: - resolution: {integrity: sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==} - engines: {node: '>=8'} - - resolve-from@5.0.0: - resolution: {integrity: sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==} - engines: {node: '>=8'} - - restore-cursor@3.1.0: - resolution: {integrity: sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==} - engines: {node: '>=8'} - - reusify@1.0.4: - resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==} - engines: {iojs: '>=1.0.0', node: '>=0.10.0'} - - rimraf@3.0.2: - resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==} - deprecated: Rimraf versions prior to v4 are no longer supported - hasBin: true - - run-async@3.0.0: - resolution: {integrity: sha512-540WwVDOMxA6dN6We19EcT9sc3hkXPw5mzRNGM3FkdN/vtE9NFvj5lFAPNwUDmJjXidm3v7TC1cTE7t17Ulm1Q==} - engines: {node: '>=0.12.0'} - - run-parallel@1.2.0: - resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} - - rxjs@7.8.1: - resolution: {integrity: sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==} - - safe-buffer@5.2.1: - resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} - - safer-buffer@2.1.2: - resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} - - scheduler@0.23.2: - resolution: {integrity: sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ==} - - semver@6.3.1: - resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} - hasBin: true - - semver@7.6.2: - resolution: {integrity: sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==} - engines: {node: '>=10'} - hasBin: true - - serialize-error@7.0.1: - resolution: {integrity: sha512-8I8TjW5KMOKsZQTvoxjuSIa7foAwPWGOts+6o7sgjz41/qMD9VQHEDxi6PBvK2l0MXUmqZyNpUK+T2tQaaElvw==} - engines: {node: '>=10'} - - set-blocking@2.0.0: - resolution: {integrity: sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==} - - set-function-length@1.2.2: - resolution: {integrity: sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==} - engines: {node: '>= 0.4'} - - shallowequal@1.1.0: - resolution: {integrity: sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ==} - - signal-exit@3.0.7: - resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} - - signal-exit@4.1.0: - resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} - engines: {node: '>=14'} - - slash@5.1.0: - resolution: {integrity: sha512-ZA6oR3T/pEyuqwMgAKT0/hAv8oAXckzbkmR0UkUosQ+Mc4RxGoJkRmwHgHufaenlyAgE1Mxgpdcrf75y6XcnDg==} - engines: {node: '>=14.16'} - - slice-ansi@5.0.0: - resolution: {integrity: sha512-FC+lgizVPfie0kkhqUScwRu1O/lF6NOgJmlCgK+/LYxDCTk8sGelYaHDhFcDN+Sn3Cv+3VSa4Byeo+IMCzpMgQ==} - engines: {node: '>=12'} - - source-map-js@1.2.0: - resolution: {integrity: sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==} - engines: {node: '>=0.10.0'} - - sprintf-js@1.0.3: - resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==} - - stack-utils@2.0.6: - resolution: {integrity: sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==} - engines: {node: '>=10'} - - string-width@4.2.3: - resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} - engines: {node: '>=8'} - - string-width@7.1.0: - resolution: {integrity: sha512-SEIJCWiX7Kg4c129n48aDRwLbFb2LJmXXFrWBG4NGaRtMQ3myKPKbwrD1BKqQn74oCoNMBVrfDEr5M9YxCsrkw==} - engines: {node: '>=18'} - - string_decoder@1.3.0: - resolution: {integrity: sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==} - - strip-ansi@6.0.1: - resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} - engines: {node: '>=8'} - - strip-ansi@7.1.0: - resolution: {integrity: sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==} - engines: {node: '>=12'} - - styled-components@6.1.1: - resolution: {integrity: sha512-cpZZP5RrKRIClBW5Eby4JM1wElLVP4NQrJbJ0h10TidTyJf4SIIwa3zLXOoPb4gJi8MsJ8mjq5mu2IrEhZIAcQ==} - engines: {node: '>= 16'} - peerDependencies: - react: '>= 16.8.0' - react-dom: '>= 16.8.0' - - stylis@4.3.2: - resolution: {integrity: sha512-bhtUjWd/z6ltJiQwg0dUfxEJ+W+jdqQd8TbWLWyeIJHlnsqmGLRFFd8e5mA0AZi/zx90smXRlN66YMTcaSFifg==} - - supertap@3.0.1: - resolution: {integrity: sha512-u1ZpIBCawJnO+0QePsEiOknOfCRq0yERxiAchT0i4li0WHNUJbf0evXXSXOcCAR4M8iMDoajXYmstm/qO81Isw==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - supports-color@7.2.0: - resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} - engines: {node: '>=8'} - - tar@6.2.1: - resolution: {integrity: sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==} - engines: {node: '>=10'} - - temp-dir@3.0.0: - resolution: {integrity: sha512-nHc6S/bwIilKHNRgK/3jlhDoIHcp45YgyiwcAk46Tr0LfEqGBVpmiAyuiuxeVE44m3mXnEeVhaipLOEWmH+Njw==} - engines: {node: '>=14.16'} - - time-zone@1.0.0: - resolution: {integrity: sha512-TIsDdtKo6+XrPtiTm1ssmMngN1sAhyKnTO2kunQWqNPWIVvCm15Wmw4SWInwTVgJ5u/Tr04+8Ei9TNcw4x4ONA==} - engines: {node: '>=4'} - - tmp@0.0.33: - resolution: {integrity: sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==} - engines: {node: '>=0.6.0'} - - to-regex-range@5.0.1: - resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} - engines: {node: '>=8.0'} - - toml@3.0.0: - resolution: {integrity: sha512-y/mWCZinnvxjTKYhJ+pYxwD0mRLVvOtdS2Awbgxln6iEnt4rk0yBxeSBHkGJcPucRiG0e55mwWp+g/05rsrd6w==} - - tr46@0.0.3: - resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==} - - tslib@2.6.3: - resolution: {integrity: sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ==} - - typanion@3.14.0: - resolution: {integrity: sha512-ZW/lVMRabETuYCd9O9ZvMhAh8GslSqaUjxmK/JLPCh6l73CvLBiuXswj/+7LdnWOgYsQ130FqLzFz5aGT4I3Ug==} - - type-fest@0.13.1: - resolution: {integrity: sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==} - engines: {node: '>=10'} - - type-fest@0.21.3: - resolution: {integrity: sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==} - engines: {node: '>=10'} - - typescript@5.5.2: - resolution: {integrity: sha512-NcRtPEOsPFFWjobJEtfihkLCZCXZt/os3zf8nTxjVH3RvTSxjrCamJpbExGvYOF+tFHc3pA65qpdwPbzjohhew==} - engines: {node: '>=14.17'} - hasBin: true - - undici-types@5.26.5: - resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==} - - unicorn-magic@0.1.0: - resolution: {integrity: sha512-lRfVq8fE8gz6QMBuDM6a+LO3IAzTi05H6gCVaUpir2E1Rwpo4ZUog45KpNXKC/Mn3Yb9UDuHumeFTo9iV/D9FQ==} - engines: {node: '>=18'} - - universal-user-agent@6.0.1: - resolution: {integrity: sha512-yCzhz6FN2wU1NiiQRogkTQszlQSlpWaw8SvVegAc+bDxbzHgh1vX8uIe8OYyMH6DwH+sdTJsgMl36+mSMdRJIQ==} - - util-deprecate@1.0.2: - resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} - - wasm-sjlj@1.0.5: - resolution: {integrity: sha512-Z/MHJeOkAvJJVWnGX3/YZGYldGaawZbYHX4ldYG9kLhcdB8H31F5x66M7Zc4BP/7pg0aLsusQj1629m2B3Rilg==} - - wcwidth@1.0.1: - resolution: {integrity: sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==} - - webidl-conversions@3.0.1: - resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==} - - well-known-symbols@2.0.0: - resolution: {integrity: sha512-ZMjC3ho+KXo0BfJb7JgtQ5IBuvnShdlACNkKkdsqBmYw3bPAaJfPeYUo6tLUaT5tG/Gkh7xkpBhKRQ9e7pyg9Q==} - engines: {node: '>=6'} - - whatwg-url@5.0.0: - resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==} - - wide-align@1.1.5: - resolution: {integrity: sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==} - - wrap-ansi@6.2.0: - resolution: {integrity: sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==} - engines: {node: '>=8'} - - wrap-ansi@7.0.0: - resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==} - engines: {node: '>=10'} - - wrappy@1.0.2: - resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} - - write-file-atomic@5.0.1: - resolution: {integrity: sha512-+QU2zd6OTD8XWIJCbffaiQeH9U73qIqafo1x6V1snCWYGJf6cVE0cDR4D8xRzcEnfI21IFrUPzPGtcPf8AC+Rw==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - - y18n@5.0.8: - resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==} - engines: {node: '>=10'} - - yallist@4.0.0: - resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==} - - yargs-parser@21.1.1: - resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} - engines: {node: '>=12'} - - yargs@17.7.2: - resolution: {integrity: sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==} - engines: {node: '>=12'} - -snapshots: - - '@emnapi/core@1.2.0': - dependencies: - '@emnapi/wasi-threads': 1.0.1 - tslib: 2.6.3 - - '@emnapi/runtime@1.2.0': - dependencies: - tslib: 2.6.3 - - '@emnapi/wasi-threads@1.0.1': - dependencies: - tslib: 2.6.3 - - '@emotion/is-prop-valid@1.2.2': - dependencies: - '@emotion/memoize': 0.8.1 - - '@emotion/memoize@0.8.1': {} - - '@emotion/unitless@0.8.1': {} - - '@inquirer/figures@1.0.3': {} - - '@ljharb/through@2.3.13': - dependencies: - call-bind: 1.0.7 - - '@mapbox/node-pre-gyp@1.0.11': - dependencies: - detect-libc: 2.0.3 - https-proxy-agent: 5.0.1 - make-dir: 3.1.0 - node-fetch: 2.7.0 - nopt: 5.0.0 - npmlog: 5.0.1 - rimraf: 3.0.2 - semver: 7.6.2 - tar: 6.2.1 - transitivePeerDependencies: - - encoding - - supports-color - - '@napi-rs/cli@3.0.0-alpha.55(@emnapi/runtime@1.2.0)(emnapi@1.2.0)': - dependencies: - '@napi-rs/cross-toolchain': 0.0.16 - '@napi-rs/wasm-tools': 0.0.2 - '@octokit/rest': 20.1.1 - clipanion: 3.2.1(typanion@3.14.0) - colorette: 2.0.20 - debug: 4.3.5 - inquirer: 9.2.23 - js-yaml: 4.1.0 - lodash-es: 4.17.21 - semver: 7.6.2 - toml: 3.0.0 - typanion: 3.14.0 - wasm-sjlj: 1.0.5 - optionalDependencies: - '@emnapi/runtime': 1.2.0 - emnapi: 1.2.0 - transitivePeerDependencies: - - '@napi-rs/cross-toolchain-arm64-target-aarch64' - - '@napi-rs/cross-toolchain-arm64-target-armv7' - - '@napi-rs/cross-toolchain-arm64-target-x86_64' - - '@napi-rs/cross-toolchain-x64-target-aarch64' - - '@napi-rs/cross-toolchain-x64-target-armv7' - - '@napi-rs/cross-toolchain-x64-target-x86_64' - - supports-color - - '@napi-rs/cross-toolchain@0.0.16': - dependencies: - '@napi-rs/lzma': 1.3.1 - '@napi-rs/tar': 0.1.1 - debug: 4.3.5 - transitivePeerDependencies: - - supports-color - - '@napi-rs/lzma-android-arm-eabi@1.3.1': - optional: true - - '@napi-rs/lzma-android-arm64@1.3.1': - optional: true - - '@napi-rs/lzma-darwin-arm64@1.3.1': - optional: true - - '@napi-rs/lzma-darwin-x64@1.3.1': - optional: true - - '@napi-rs/lzma-freebsd-x64@1.3.1': - optional: true - - '@napi-rs/lzma-linux-arm-gnueabihf@1.3.1': - optional: true - - '@napi-rs/lzma-linux-arm64-gnu@1.3.1': - optional: true - - '@napi-rs/lzma-linux-arm64-musl@1.3.1': - optional: true - - '@napi-rs/lzma-linux-x64-gnu@1.3.1': - optional: true - - '@napi-rs/lzma-linux-x64-musl@1.3.1': - optional: true - - '@napi-rs/lzma-wasm32-wasi@1.3.1': - dependencies: - '@napi-rs/wasm-runtime': 0.2.4 - optional: true - - '@napi-rs/lzma-win32-arm64-msvc@1.3.1': - optional: true - - '@napi-rs/lzma-win32-ia32-msvc@1.3.1': - optional: true - - '@napi-rs/lzma-win32-x64-msvc@1.3.1': - optional: true - - '@napi-rs/lzma@1.3.1': - optionalDependencies: - '@napi-rs/lzma-android-arm-eabi': 1.3.1 - '@napi-rs/lzma-android-arm64': 1.3.1 - '@napi-rs/lzma-darwin-arm64': 1.3.1 - '@napi-rs/lzma-darwin-x64': 1.3.1 - '@napi-rs/lzma-freebsd-x64': 1.3.1 - '@napi-rs/lzma-linux-arm-gnueabihf': 1.3.1 - '@napi-rs/lzma-linux-arm64-gnu': 1.3.1 - '@napi-rs/lzma-linux-arm64-musl': 1.3.1 - '@napi-rs/lzma-linux-x64-gnu': 1.3.1 - '@napi-rs/lzma-linux-x64-musl': 1.3.1 - '@napi-rs/lzma-wasm32-wasi': 1.3.1 - '@napi-rs/lzma-win32-arm64-msvc': 1.3.1 - '@napi-rs/lzma-win32-ia32-msvc': 1.3.1 - '@napi-rs/lzma-win32-x64-msvc': 1.3.1 - - '@napi-rs/tar-android-arm-eabi@0.1.1': - optional: true - - '@napi-rs/tar-android-arm64@0.1.1': - optional: true - - '@napi-rs/tar-darwin-arm64@0.1.1': - optional: true - - '@napi-rs/tar-darwin-x64@0.1.1': - optional: true - - '@napi-rs/tar-freebsd-x64@0.1.1': - optional: true - - '@napi-rs/tar-linux-arm-gnueabihf@0.1.1': - optional: true - - '@napi-rs/tar-linux-arm64-gnu@0.1.1': - optional: true - - '@napi-rs/tar-linux-arm64-musl@0.1.1': - optional: true - - '@napi-rs/tar-linux-x64-gnu@0.1.1': - optional: true - - '@napi-rs/tar-linux-x64-musl@0.1.1': - optional: true - - '@napi-rs/tar-wasm32-wasi@0.1.1': - dependencies: - '@napi-rs/wasm-runtime': 0.2.4 - optional: true - - '@napi-rs/tar-win32-arm64-msvc@0.1.1': - optional: true - - '@napi-rs/tar-win32-ia32-msvc@0.1.1': - optional: true - - '@napi-rs/tar-win32-x64-msvc@0.1.1': - optional: true - - '@napi-rs/tar@0.1.1': - optionalDependencies: - '@napi-rs/tar-android-arm-eabi': 0.1.1 - '@napi-rs/tar-android-arm64': 0.1.1 - '@napi-rs/tar-darwin-arm64': 0.1.1 - '@napi-rs/tar-darwin-x64': 0.1.1 - '@napi-rs/tar-freebsd-x64': 0.1.1 - '@napi-rs/tar-linux-arm-gnueabihf': 0.1.1 - '@napi-rs/tar-linux-arm64-gnu': 0.1.1 - '@napi-rs/tar-linux-arm64-musl': 0.1.1 - '@napi-rs/tar-linux-x64-gnu': 0.1.1 - '@napi-rs/tar-linux-x64-musl': 0.1.1 - '@napi-rs/tar-wasm32-wasi': 0.1.1 - '@napi-rs/tar-win32-arm64-msvc': 0.1.1 - '@napi-rs/tar-win32-ia32-msvc': 0.1.1 - '@napi-rs/tar-win32-x64-msvc': 0.1.1 - - '@napi-rs/wasm-runtime@0.2.4': - dependencies: - '@emnapi/core': 1.2.0 - '@emnapi/runtime': 1.2.0 - '@tybys/wasm-util': 0.9.0 - - '@napi-rs/wasm-tools-android-arm-eabi@0.0.2': - optional: true - - '@napi-rs/wasm-tools-android-arm64@0.0.2': - optional: true - - '@napi-rs/wasm-tools-darwin-arm64@0.0.2': - optional: true - - '@napi-rs/wasm-tools-darwin-x64@0.0.2': - optional: true - - '@napi-rs/wasm-tools-freebsd-x64@0.0.2': - optional: true - - '@napi-rs/wasm-tools-linux-arm64-gnu@0.0.2': - optional: true - - '@napi-rs/wasm-tools-linux-arm64-musl@0.0.2': - optional: true - - '@napi-rs/wasm-tools-linux-x64-gnu@0.0.2': - optional: true - - '@napi-rs/wasm-tools-linux-x64-musl@0.0.2': - optional: true - - '@napi-rs/wasm-tools-wasm32-wasi@0.0.2': - dependencies: - '@napi-rs/wasm-runtime': 0.2.4 - optional: true - - '@napi-rs/wasm-tools-win32-arm64-msvc@0.0.2': - optional: true - - '@napi-rs/wasm-tools-win32-ia32-msvc@0.0.2': - optional: true - - '@napi-rs/wasm-tools-win32-x64-msvc@0.0.2': - optional: true - - '@napi-rs/wasm-tools@0.0.2': - optionalDependencies: - '@napi-rs/wasm-tools-android-arm-eabi': 0.0.2 - '@napi-rs/wasm-tools-android-arm64': 0.0.2 - '@napi-rs/wasm-tools-darwin-arm64': 0.0.2 - '@napi-rs/wasm-tools-darwin-x64': 0.0.2 - '@napi-rs/wasm-tools-freebsd-x64': 0.0.2 - '@napi-rs/wasm-tools-linux-arm64-gnu': 0.0.2 - '@napi-rs/wasm-tools-linux-arm64-musl': 0.0.2 - '@napi-rs/wasm-tools-linux-x64-gnu': 0.0.2 - '@napi-rs/wasm-tools-linux-x64-musl': 0.0.2 - '@napi-rs/wasm-tools-wasm32-wasi': 0.0.2 - '@napi-rs/wasm-tools-win32-arm64-msvc': 0.0.2 - '@napi-rs/wasm-tools-win32-ia32-msvc': 0.0.2 - '@napi-rs/wasm-tools-win32-x64-msvc': 0.0.2 - - '@nodelib/fs.scandir@2.1.5': - dependencies: - '@nodelib/fs.stat': 2.0.5 - run-parallel: 1.2.0 - - '@nodelib/fs.stat@2.0.5': {} - - '@nodelib/fs.walk@1.2.8': - dependencies: - '@nodelib/fs.scandir': 2.1.5 - fastq: 1.17.1 - - '@octokit/auth-token@4.0.0': {} - - '@octokit/core@5.2.0': - dependencies: - '@octokit/auth-token': 4.0.0 - '@octokit/graphql': 7.1.0 - '@octokit/request': 8.4.0 - '@octokit/request-error': 5.1.0 - '@octokit/types': 13.5.0 - before-after-hook: 2.2.3 - universal-user-agent: 6.0.1 - - '@octokit/endpoint@9.0.5': - dependencies: - '@octokit/types': 13.5.0 - universal-user-agent: 6.0.1 - - '@octokit/graphql@7.1.0': - dependencies: - '@octokit/request': 8.4.0 - '@octokit/types': 13.5.0 - universal-user-agent: 6.0.1 - - '@octokit/openapi-types@22.2.0': {} - - '@octokit/plugin-paginate-rest@11.3.1(@octokit/core@5.2.0)': - dependencies: - '@octokit/core': 5.2.0 - '@octokit/types': 13.5.0 - - '@octokit/plugin-request-log@4.0.1(@octokit/core@5.2.0)': - dependencies: - '@octokit/core': 5.2.0 - - '@octokit/plugin-rest-endpoint-methods@13.2.2(@octokit/core@5.2.0)': - dependencies: - '@octokit/core': 5.2.0 - '@octokit/types': 13.5.0 - - '@octokit/request-error@5.1.0': - dependencies: - '@octokit/types': 13.5.0 - deprecation: 2.3.1 - once: 1.4.0 - - '@octokit/request@8.4.0': - dependencies: - '@octokit/endpoint': 9.0.5 - '@octokit/request-error': 5.1.0 - '@octokit/types': 13.5.0 - universal-user-agent: 6.0.1 - - '@octokit/rest@20.1.1': - dependencies: - '@octokit/core': 5.2.0 - '@octokit/plugin-paginate-rest': 11.3.1(@octokit/core@5.2.0) - '@octokit/plugin-request-log': 4.0.1(@octokit/core@5.2.0) - '@octokit/plugin-rest-endpoint-methods': 13.2.2(@octokit/core@5.2.0) - - '@octokit/types@13.5.0': - dependencies: - '@octokit/openapi-types': 22.2.0 - - '@rollup/pluginutils@4.2.1': - dependencies: - estree-walker: 2.0.2 - picomatch: 2.3.1 - - '@sindresorhus/merge-streams@2.3.0': {} - - '@tybys/wasm-util@0.9.0': - dependencies: - tslib: 2.6.3 - - '@types/node@20.14.9': - dependencies: - undici-types: 5.26.5 - - '@types/stylis@4.2.6': {} - - '@vercel/nft@0.26.5': - dependencies: - '@mapbox/node-pre-gyp': 1.0.11 - '@rollup/pluginutils': 4.2.1 - acorn: 8.12.0 - acorn-import-attributes: 1.9.5(acorn@8.12.0) - async-sema: 3.1.1 - bindings: 1.5.0 - estree-walker: 2.0.2 - glob: 7.2.3 - graceful-fs: 4.2.11 - micromatch: 4.0.7 - node-gyp-build: 4.8.1 - resolve-from: 5.0.0 - transitivePeerDependencies: - - encoding - - supports-color - - abbrev@1.1.1: {} - - acorn-import-attributes@1.9.5(acorn@8.12.0): - dependencies: - acorn: 8.12.0 - - acorn-walk@8.3.3: - dependencies: - acorn: 8.12.0 - - acorn@8.12.0: {} - - agent-base@6.0.2: - dependencies: - debug: 4.3.5 - transitivePeerDependencies: - - supports-color - - ansi-escapes@4.3.2: - dependencies: - type-fest: 0.21.3 - - ansi-regex@5.0.1: {} - - ansi-regex@6.0.1: {} - - ansi-styles@4.3.0: - dependencies: - color-convert: 2.0.1 - - ansi-styles@6.2.1: {} - - aproba@2.0.0: {} - - are-we-there-yet@2.0.0: - dependencies: - delegates: 1.0.0 - readable-stream: 3.6.2 - - argparse@1.0.10: - dependencies: - sprintf-js: 1.0.3 - - argparse@2.0.1: {} - - array-find-index@1.0.2: {} - - arrgv@1.0.2: {} - - arrify@3.0.0: {} - - async-sema@3.1.1: {} - - asynckit@0.4.0: {} - - ava@6.1.3: - dependencies: - '@vercel/nft': 0.26.5 - acorn: 8.12.0 - acorn-walk: 8.3.3 - ansi-styles: 6.2.1 - arrgv: 1.0.2 - arrify: 3.0.0 - callsites: 4.1.0 - cbor: 9.0.2 - chalk: 5.3.0 - chunkd: 2.0.1 - ci-info: 4.0.0 - ci-parallel-vars: 1.0.1 - cli-truncate: 4.0.0 - code-excerpt: 4.0.0 - common-path-prefix: 3.0.0 - concordance: 5.0.4 - currently-unhandled: 0.4.1 - debug: 4.3.5 - emittery: 1.0.3 - figures: 6.1.0 - globby: 14.0.1 - ignore-by-default: 2.1.0 - indent-string: 5.0.0 - is-plain-object: 5.0.0 - is-promise: 4.0.0 - matcher: 5.0.0 - memoize: 10.0.0 - ms: 2.1.3 - p-map: 7.0.2 - package-config: 5.0.0 - picomatch: 3.0.1 - plur: 5.1.0 - pretty-ms: 9.0.0 - resolve-cwd: 3.0.0 - stack-utils: 2.0.6 - strip-ansi: 7.1.0 - supertap: 3.0.1 - temp-dir: 3.0.0 - write-file-atomic: 5.0.1 - yargs: 17.7.2 - transitivePeerDependencies: - - encoding - - supports-color - - axios@1.6.2: - dependencies: - follow-redirects: 1.15.6 - form-data: 4.0.0 - proxy-from-env: 1.1.0 - transitivePeerDependencies: - - debug - - balanced-match@1.0.2: {} - - base64-js@1.5.1: {} - - before-after-hook@2.2.3: {} - - bindings@1.5.0: - dependencies: - file-uri-to-path: 1.0.0 - - bl@4.1.0: - dependencies: - buffer: 5.7.1 - inherits: 2.0.4 - readable-stream: 3.6.2 - - blueimp-md5@2.19.0: {} - - brace-expansion@1.1.11: - dependencies: - balanced-match: 1.0.2 - concat-map: 0.0.1 - - braces@3.0.3: - dependencies: - fill-range: 7.1.1 - - buffer@5.7.1: - dependencies: - base64-js: 1.5.1 - ieee754: 1.2.1 - - call-bind@1.0.7: - dependencies: - es-define-property: 1.0.0 - es-errors: 1.3.0 - function-bind: 1.1.2 - get-intrinsic: 1.2.4 - set-function-length: 1.2.2 - - callsites@4.1.0: {} - - camelize@1.0.1: {} - - cbor@9.0.2: - dependencies: - nofilter: 3.1.0 - - chalk@4.1.2: - dependencies: - ansi-styles: 4.3.0 - supports-color: 7.2.0 - - chalk@5.3.0: {} - - chardet@0.7.0: {} - - chownr@2.0.0: {} - - chunkd@2.0.1: {} - - ci-info@4.0.0: {} - - ci-parallel-vars@1.0.1: {} - - cli-cursor@3.1.0: - dependencies: - restore-cursor: 3.1.0 - - cli-spinners@2.9.2: {} - - cli-truncate@4.0.0: - dependencies: - slice-ansi: 5.0.0 - string-width: 7.1.0 - - cli-width@4.1.0: {} - - clipanion@3.2.1(typanion@3.14.0): - dependencies: - typanion: 3.14.0 - - cliui@8.0.1: - dependencies: - string-width: 4.2.3 - strip-ansi: 6.0.1 - wrap-ansi: 7.0.0 - - clone@1.0.4: {} - - code-excerpt@4.0.0: - dependencies: - convert-to-spaces: 2.0.1 - - color-convert@2.0.1: - dependencies: - color-name: 1.1.4 - - color-name@1.1.4: {} - - color-support@1.1.3: {} - - colorette@2.0.20: {} - - combined-stream@1.0.8: - dependencies: - delayed-stream: 1.0.0 - - common-path-prefix@3.0.0: {} - - concat-map@0.0.1: {} - - concordance@5.0.4: - dependencies: - date-time: 3.1.0 - esutils: 2.0.3 - fast-diff: 1.3.0 - js-string-escape: 1.0.1 - lodash: 4.17.21 - md5-hex: 3.0.1 - semver: 7.6.2 - well-known-symbols: 2.0.0 - - console-control-strings@1.1.0: {} - - convert-to-spaces@2.0.1: {} - - css-color-keywords@1.0.0: {} - - css-to-react-native@3.2.0: - dependencies: - camelize: 1.0.1 - css-color-keywords: 1.0.0 - postcss-value-parser: 4.2.0 - - csstype@3.1.3: {} - - currently-unhandled@0.4.1: - dependencies: - array-find-index: 1.0.2 - - date-time@3.1.0: - dependencies: - time-zone: 1.0.0 - - debug@4.3.5: - dependencies: - ms: 2.1.2 - - defaults@1.0.4: - dependencies: - clone: 1.0.4 - - define-data-property@1.1.4: - dependencies: - es-define-property: 1.0.0 - es-errors: 1.3.0 - gopd: 1.0.1 - - delayed-stream@1.0.0: {} - - delegates@1.0.0: {} - - deprecation@2.3.1: {} - - detect-libc@2.0.3: {} - - emittery@1.0.3: {} - - emnapi@1.2.0: {} - - emoji-regex@10.3.0: {} - - emoji-regex@8.0.0: {} - - es-define-property@1.0.0: - dependencies: - get-intrinsic: 1.2.4 - - es-errors@1.3.0: {} - - escalade@3.1.2: {} - - escape-string-regexp@2.0.0: {} - - escape-string-regexp@5.0.0: {} - - esprima@4.0.1: {} - - estree-walker@2.0.2: {} - - esutils@2.0.3: {} - - external-editor@3.1.0: - dependencies: - chardet: 0.7.0 - iconv-lite: 0.4.24 - tmp: 0.0.33 - - fast-diff@1.3.0: {} - - fast-glob@3.3.2: - dependencies: - '@nodelib/fs.stat': 2.0.5 - '@nodelib/fs.walk': 1.2.8 - glob-parent: 5.1.2 - merge2: 1.4.1 - micromatch: 4.0.7 - - fastq@1.17.1: - dependencies: - reusify: 1.0.4 - - figures@6.1.0: - dependencies: - is-unicode-supported: 2.0.0 - - file-uri-to-path@1.0.0: {} - - fill-range@7.1.1: - dependencies: - to-regex-range: 5.0.1 - - find-up-simple@1.0.0: {} - - follow-redirects@1.15.6: {} - - form-data@4.0.0: - dependencies: - asynckit: 0.4.0 - combined-stream: 1.0.8 - mime-types: 2.1.35 - - fs-minipass@2.1.0: - dependencies: - minipass: 3.3.6 - - fs.realpath@1.0.0: {} - - function-bind@1.1.2: {} - - gauge@3.0.2: - dependencies: - aproba: 2.0.0 - color-support: 1.1.3 - console-control-strings: 1.1.0 - has-unicode: 2.0.1 - object-assign: 4.1.1 - signal-exit: 3.0.7 - string-width: 4.2.3 - strip-ansi: 6.0.1 - wide-align: 1.1.5 - - get-caller-file@2.0.5: {} - - get-east-asian-width@1.2.0: {} - - get-intrinsic@1.2.4: - dependencies: - es-errors: 1.3.0 - function-bind: 1.1.2 - has-proto: 1.0.3 - has-symbols: 1.0.3 - hasown: 2.0.2 - - glob-parent@5.1.2: - dependencies: - is-glob: 4.0.3 - - glob@7.2.3: - dependencies: - fs.realpath: 1.0.0 - inflight: 1.0.6 - inherits: 2.0.4 - minimatch: 3.1.2 - once: 1.4.0 - path-is-absolute: 1.0.1 - - globby@14.0.1: - dependencies: - '@sindresorhus/merge-streams': 2.3.0 - fast-glob: 3.3.2 - ignore: 5.3.1 - path-type: 5.0.0 - slash: 5.1.0 - unicorn-magic: 0.1.0 - - gopd@1.0.1: - dependencies: - get-intrinsic: 1.2.4 - - graceful-fs@4.2.11: {} - - has-flag@4.0.0: {} - - has-property-descriptors@1.0.2: - dependencies: - es-define-property: 1.0.0 - - has-proto@1.0.3: {} - - has-symbols@1.0.3: {} - - has-unicode@2.0.1: {} - - hasown@2.0.2: - dependencies: - function-bind: 1.1.2 - - https-proxy-agent@5.0.1: - dependencies: - agent-base: 6.0.2 - debug: 4.3.5 - transitivePeerDependencies: - - supports-color - - iconv-lite@0.4.24: - dependencies: - safer-buffer: 2.1.2 - - ieee754@1.2.1: {} - - ignore-by-default@2.1.0: {} - - ignore@5.3.1: {} - - imurmurhash@0.1.4: {} - - indent-string@5.0.0: {} - - inflight@1.0.6: - dependencies: - once: 1.4.0 - wrappy: 1.0.2 - - inherits@2.0.4: {} - - inquirer@9.2.23: - dependencies: - '@inquirer/figures': 1.0.3 - '@ljharb/through': 2.3.13 - ansi-escapes: 4.3.2 - chalk: 5.3.0 - cli-cursor: 3.1.0 - cli-width: 4.1.0 - external-editor: 3.1.0 - lodash: 4.17.21 - mute-stream: 1.0.0 - ora: 5.4.1 - run-async: 3.0.0 - rxjs: 7.8.1 - string-width: 4.2.3 - strip-ansi: 6.0.1 - wrap-ansi: 6.2.0 - - irregular-plurals@3.5.0: {} - - is-extglob@2.1.1: {} - - is-fullwidth-code-point@3.0.0: {} - - is-fullwidth-code-point@4.0.0: {} - - is-glob@4.0.3: - dependencies: - is-extglob: 2.1.1 - - is-interactive@1.0.0: {} - - is-number@7.0.0: {} - - is-plain-object@5.0.0: {} - - is-promise@4.0.0: {} - - is-unicode-supported@0.1.0: {} - - is-unicode-supported@2.0.0: {} - - js-string-escape@1.0.1: {} - - js-tokens@4.0.0: {} - - js-yaml@3.14.1: - dependencies: - argparse: 1.0.10 - esprima: 4.0.1 - - js-yaml@4.1.0: - dependencies: - argparse: 2.0.1 - - load-json-file@7.0.1: {} - - lodash-es@4.17.21: {} - - lodash@4.17.21: {} - - log-symbols@4.1.0: - dependencies: - chalk: 4.1.2 - is-unicode-supported: 0.1.0 - - loose-envify@1.4.0: - dependencies: - js-tokens: 4.0.0 - - make-dir@3.1.0: - dependencies: - semver: 6.3.1 - - matcher@5.0.0: - dependencies: - escape-string-regexp: 5.0.0 - - md5-hex@3.0.1: - dependencies: - blueimp-md5: 2.19.0 - - memoize@10.0.0: - dependencies: - mimic-function: 5.0.1 - - merge2@1.4.1: {} - - micromatch@4.0.7: - dependencies: - braces: 3.0.3 - picomatch: 2.3.1 - - mime-db@1.52.0: {} - - mime-types@2.1.35: - dependencies: - mime-db: 1.52.0 - - mimic-fn@2.1.0: {} - - mimic-function@5.0.1: {} - - minimatch@3.1.2: - dependencies: - brace-expansion: 1.1.11 - - minipass@3.3.6: - dependencies: - yallist: 4.0.0 - - minipass@5.0.0: {} - - minizlib@2.1.2: - dependencies: - minipass: 3.3.6 - yallist: 4.0.0 - - mkdirp@1.0.4: {} - - ms@2.1.2: {} - - ms@2.1.3: {} - - mute-stream@1.0.0: {} - - nanoid@3.3.7: {} - - node-fetch@2.7.0: - dependencies: - whatwg-url: 5.0.0 - - node-gyp-build@4.8.1: {} - - nofilter@3.1.0: {} - - nopt@5.0.0: - dependencies: - abbrev: 1.1.1 - - npmlog@5.0.1: - dependencies: - are-we-there-yet: 2.0.0 - console-control-strings: 1.1.0 - gauge: 3.0.2 - set-blocking: 2.0.0 - - object-assign@4.1.1: {} - - once@1.4.0: - dependencies: - wrappy: 1.0.2 - - onetime@5.1.2: - dependencies: - mimic-fn: 2.1.0 - - ora@5.4.1: - dependencies: - bl: 4.1.0 - chalk: 4.1.2 - cli-cursor: 3.1.0 - cli-spinners: 2.9.2 - is-interactive: 1.0.0 - is-unicode-supported: 0.1.0 - log-symbols: 4.1.0 - strip-ansi: 6.0.1 - wcwidth: 1.0.1 - - os-tmpdir@1.0.2: {} - - p-map@7.0.2: {} - - package-config@5.0.0: - dependencies: - find-up-simple: 1.0.0 - load-json-file: 7.0.1 - - parse-ms@4.0.0: {} - - path-is-absolute@1.0.1: {} - - path-type@5.0.0: {} - - picocolors@1.0.1: {} - - picomatch@2.3.1: {} - - picomatch@3.0.1: {} - - plur@5.1.0: - dependencies: - irregular-plurals: 3.5.0 - - postcss-value-parser@4.2.0: {} - - postcss@8.4.33: - dependencies: - nanoid: 3.3.7 - picocolors: 1.0.1 - source-map-js: 1.2.0 - - pretty-ms@9.0.0: - dependencies: - parse-ms: 4.0.0 - - proxy-from-env@1.1.0: {} - - queue-microtask@1.2.3: {} - - react-dom@18.3.1(react@18.3.1): - dependencies: - loose-envify: 1.4.0 - react: 18.3.1 - scheduler: 0.23.2 - - react@18.3.1: - dependencies: - loose-envify: 1.4.0 - - readable-stream@3.6.2: - dependencies: - inherits: 2.0.4 - string_decoder: 1.3.0 - util-deprecate: 1.0.2 - - require-directory@2.1.1: {} - - resolve-cwd@3.0.0: - dependencies: - resolve-from: 5.0.0 - - resolve-from@5.0.0: {} - - restore-cursor@3.1.0: - dependencies: - onetime: 5.1.2 - signal-exit: 3.0.7 - - reusify@1.0.4: {} - - rimraf@3.0.2: - dependencies: - glob: 7.2.3 - - run-async@3.0.0: {} - - run-parallel@1.2.0: - dependencies: - queue-microtask: 1.2.3 - - rxjs@7.8.1: - dependencies: - tslib: 2.6.3 - - safe-buffer@5.2.1: {} - - safer-buffer@2.1.2: {} - - scheduler@0.23.2: - dependencies: - loose-envify: 1.4.0 - - semver@6.3.1: {} - - semver@7.6.2: {} - - serialize-error@7.0.1: - dependencies: - type-fest: 0.13.1 - - set-blocking@2.0.0: {} - - set-function-length@1.2.2: - 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 - - shallowequal@1.1.0: {} - - signal-exit@3.0.7: {} - - signal-exit@4.1.0: {} - - slash@5.1.0: {} - - slice-ansi@5.0.0: - dependencies: - ansi-styles: 6.2.1 - is-fullwidth-code-point: 4.0.0 - - source-map-js@1.2.0: {} - - sprintf-js@1.0.3: {} - - stack-utils@2.0.6: - dependencies: - escape-string-regexp: 2.0.0 - - string-width@4.2.3: - dependencies: - emoji-regex: 8.0.0 - is-fullwidth-code-point: 3.0.0 - strip-ansi: 6.0.1 - - string-width@7.1.0: - dependencies: - emoji-regex: 10.3.0 - get-east-asian-width: 1.2.0 - strip-ansi: 7.1.0 - - string_decoder@1.3.0: - dependencies: - safe-buffer: 5.2.1 - - strip-ansi@6.0.1: - dependencies: - ansi-regex: 5.0.1 - - strip-ansi@7.1.0: - dependencies: - ansi-regex: 6.0.1 - - styled-components@6.1.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1): - dependencies: - '@emotion/is-prop-valid': 1.2.2 - '@emotion/unitless': 0.8.1 - '@types/stylis': 4.2.6 - css-to-react-native: 3.2.0 - csstype: 3.1.3 - postcss: 8.4.33 - react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) - shallowequal: 1.1.0 - stylis: 4.3.2 - tslib: 2.6.3 - - stylis@4.3.2: {} - - supertap@3.0.1: - dependencies: - indent-string: 5.0.0 - js-yaml: 3.14.1 - serialize-error: 7.0.1 - strip-ansi: 7.1.0 - - supports-color@7.2.0: - dependencies: - has-flag: 4.0.0 - - tar@6.2.1: - dependencies: - chownr: 2.0.0 - fs-minipass: 2.1.0 - minipass: 5.0.0 - minizlib: 2.1.2 - mkdirp: 1.0.4 - yallist: 4.0.0 - - temp-dir@3.0.0: {} - - time-zone@1.0.0: {} - - tmp@0.0.33: - dependencies: - os-tmpdir: 1.0.2 - - to-regex-range@5.0.1: - dependencies: - is-number: 7.0.0 - - toml@3.0.0: {} - - tr46@0.0.3: {} - - tslib@2.6.3: {} - - typanion@3.14.0: {} - - type-fest@0.13.1: {} - - type-fest@0.21.3: {} - - typescript@5.5.2: {} - - undici-types@5.26.5: {} - - unicorn-magic@0.1.0: {} - - universal-user-agent@6.0.1: {} - - util-deprecate@1.0.2: {} - - wasm-sjlj@1.0.5: {} - - wcwidth@1.0.1: - dependencies: - defaults: 1.0.4 - - webidl-conversions@3.0.1: {} - - well-known-symbols@2.0.0: {} - - whatwg-url@5.0.0: - dependencies: - tr46: 0.0.3 - webidl-conversions: 3.0.1 - - wide-align@1.1.5: - dependencies: - string-width: 4.2.3 - - wrap-ansi@6.2.0: - dependencies: - ansi-styles: 4.3.0 - string-width: 4.2.3 - strip-ansi: 6.0.1 - - wrap-ansi@7.0.0: - dependencies: - ansi-styles: 4.3.0 - string-width: 4.2.3 - strip-ansi: 6.0.1 - - wrappy@1.0.2: {} - - write-file-atomic@5.0.1: - dependencies: - imurmurhash: 0.1.4 - signal-exit: 4.1.0 - - y18n@5.0.8: {} - - yallist@4.0.0: {} - - yargs-parser@21.1.1: {} - - yargs@17.7.2: - dependencies: - cliui: 8.0.1 - escalade: 3.1.2 - get-caller-file: 2.0.5 - require-directory: 2.1.1 - string-width: 4.2.3 - y18n: 5.0.8 - yargs-parser: 21.1.1 diff --git a/src/builtins.rs b/src/builtins.rs deleted file mode 100644 index 45a25117..00000000 --- a/src/builtins.rs +++ /dev/null @@ -1,71 +0,0 @@ -/// Node.js built-in modules -/// -/// `node -p "[...require('module').builtinModules].map(b => JSON.stringify(b)).join(',\n')"` -/// -pub const NODEJS_BUILTINS: &[&str] = &[ - "_http_agent", - "_http_client", - "_http_common", - "_http_incoming", - "_http_outgoing", - "_http_server", - "_stream_duplex", - "_stream_passthrough", - "_stream_readable", - "_stream_transform", - "_stream_wrap", - "_stream_writable", - "_tls_common", - "_tls_wrap", - "assert", - "assert/strict", - "async_hooks", - "buffer", - "child_process", - "cluster", - "console", - "constants", - "crypto", - "dgram", - "diagnostics_channel", - "dns", - "dns/promises", - "domain", - "events", - "fs", - "fs/promises", - "http", - "http2", - "https", - "inspector", - "module", - "net", - "os", - "path", - "path/posix", - "path/win32", - "perf_hooks", - "process", - "punycode", - "querystring", - "readline", - "repl", - "stream", - "stream/consumers", - "stream/promises", - "stream/web", - "string_decoder", - "sys", - "timers", - "timers/promises", - "tls", - "trace_events", - "tty", - "url", - "util", - "util/types", - "v8", - "vm", - "worker_threads", - "zlib", -]; diff --git a/src/cache.rs b/src/cache.rs deleted file mode 100644 index a1bde36c..00000000 --- a/src/cache.rs +++ /dev/null @@ -1,369 +0,0 @@ -use once_cell::sync::OnceCell as OnceLock; -use std::{ - borrow::{Borrow, Cow}, - convert::AsRef, - hash::{BuildHasherDefault, Hash, Hasher}, - io, - ops::Deref, - path::{Path, PathBuf}, - sync::Arc, -}; - -use dashmap::{DashMap, DashSet}; -use rustc_hash::FxHasher; - -use crate::{ - context::ResolveContext as Ctx, package_json::PackageJson, path::PathUtil, FileMetadata, - FileSystem, ResolveError, ResolveOptions, TsConfig, -}; - -#[derive(Default)] -pub struct Cache { - pub(crate) fs: Fs, - paths: DashSet>, - tsconfigs: DashMap, BuildHasherDefault>, -} - -impl Cache { - pub fn new(fs: Fs) -> Self { - Self { fs, paths: DashSet::default(), tsconfigs: DashMap::default() } - } - - pub fn clear(&self) { - self.paths.clear(); - self.tsconfigs.clear(); - } - - pub fn value(&self, path: &Path) -> CachedPath { - let hash = { - let mut hasher = FxHasher::default(); - path.hash(&mut hasher); - hasher.finish() - }; - if let Some(cache_entry) = self.paths.get((hash, path).borrow() as &dyn CacheKey) { - return cache_entry.clone(); - } - let parent = path.parent().map(|p| self.value(p)); - let data = CachedPath(Arc::new(CachedPathImpl::new( - hash, - path.to_path_buf().into_boxed_path(), - parent, - ))); - self.paths.insert(data.clone()); - data - } - - pub fn tsconfig Result<(), ResolveError>>( - &self, - root: bool, - path: &Path, - callback: F, // callback for modifying tsconfig with `extends` - ) -> Result, ResolveError> { - if let Some(tsconfig_ref) = self.tsconfigs.get(path) { - return Ok(Arc::clone(tsconfig_ref.value())); - } - let meta = self.fs.metadata(path).ok(); - let tsconfig_path = if meta.is_some_and(|m| m.is_file) { - Cow::Borrowed(path) - } else if meta.is_some_and(|m| m.is_dir) { - Cow::Owned(path.join("tsconfig.json")) - } else { - let mut os_string = path.to_path_buf().into_os_string(); - os_string.push(".json"); - Cow::Owned(PathBuf::from(os_string)) - }; - let mut tsconfig_string = self - .fs - .read_to_string(&tsconfig_path) - .map_err(|_| ResolveError::TsconfigNotFound(path.to_path_buf()))?; - let mut tsconfig = - TsConfig::parse(root, &tsconfig_path, &mut tsconfig_string).map_err(|error| { - ResolveError::from_serde_json_error(tsconfig_path.to_path_buf(), &error) - })?; - callback(&mut tsconfig)?; - let tsconfig = Arc::new(tsconfig.build()); - self.tsconfigs.insert(path.to_path_buf(), Arc::clone(&tsconfig)); - Ok(tsconfig) - } -} - -#[derive(Clone)] -pub struct CachedPath(Arc); - -impl Hash for CachedPath { - fn hash(&self, state: &mut H) { - self.0.hash.hash(state); - } -} - -impl PartialEq for CachedPath { - fn eq(&self, other: &Self) -> bool { - self.0.path == other.0.path - } -} -impl Eq for CachedPath {} - -impl Deref for CachedPath { - type Target = CachedPathImpl; - - fn deref(&self) -> &Self::Target { - self.0.as_ref() - } -} - -impl<'a> Borrow for CachedPath { - fn borrow(&self) -> &(dyn CacheKey + 'a) { - self - } -} - -impl AsRef for CachedPath { - fn as_ref(&self) -> &CachedPathImpl { - self.0.as_ref() - } -} - -impl CacheKey for CachedPath { - fn tuple(&self) -> (u64, &Path) { - (self.hash, &self.path) - } -} - -pub struct CachedPathImpl { - hash: u64, - path: Box, - parent: Option, - meta: OnceLock>, - symlink: OnceLock>, - canonicalized: OnceLock>, - node_modules: OnceLock>, - package_json: OnceLock>>, -} - -impl CachedPathImpl { - fn new(hash: u64, path: Box, parent: Option) -> Self { - Self { - hash, - path, - parent, - meta: OnceLock::new(), - symlink: OnceLock::new(), - canonicalized: OnceLock::new(), - node_modules: OnceLock::new(), - package_json: OnceLock::new(), - } - } - - pub fn path(&self) -> &Path { - &self.path - } - - pub fn to_path_buf(&self) -> PathBuf { - self.path.to_path_buf() - } - - pub fn parent(&self) -> Option<&CachedPath> { - self.parent.as_ref() - } - - fn meta(&self, fs: &Fs) -> Option { - *self.meta.get_or_init(|| fs.metadata(&self.path).ok()) - } - - pub fn is_file(&self, fs: &Fs, ctx: &mut Ctx) -> bool { - if let Some(meta) = self.meta(fs) { - ctx.add_file_dependency(self.path()); - meta.is_file - } else { - ctx.add_missing_dependency(self.path()); - false - } - } - - pub fn is_dir(&self, fs: &Fs, ctx: &mut Ctx) -> bool { - self.meta(fs).map_or_else( - || { - ctx.add_missing_dependency(self.path()); - false - }, - |meta| meta.is_dir, - ) - } - - fn symlink(&self, fs: &Fs) -> io::Result> { - self.symlink - .get_or_try_init(|| { - if let Ok(symlink_metadata) = fs.symlink_metadata(&self.path) { - if symlink_metadata.is_symlink { - return fs.canonicalize(self.path()).map(Some); - } - } - Ok(None) - }) - .cloned() - } - - pub fn realpath(&self, fs: &Fs) -> io::Result { - self.canonicalized - .get_or_try_init(|| { - if let Some(link) = self.symlink(fs)? { - return Ok(Some(link)); - } - if let Some(parent) = self.parent() { - let parent_path = parent.realpath(fs)?; - return Ok(Some( - parent_path.normalize_with(self.path.strip_prefix(&parent.path).unwrap()), - )); - }; - Ok(None) - }) - .cloned() - .map(|r| r.unwrap_or_else(|| self.path.clone().to_path_buf())) - } - - pub fn module_directory( - &self, - module_name: &str, - cache: &Cache, - ctx: &mut Ctx, - ) -> Option { - let cached_path = cache.value(&self.path.join(module_name)); - cached_path.is_dir(&cache.fs, ctx).then_some(cached_path) - } - - pub fn cached_node_modules( - &self, - cache: &Cache, - ctx: &mut Ctx, - ) -> Option { - self.node_modules.get_or_init(|| self.module_directory("node_modules", cache, ctx)).clone() - } - - /// Find package.json of a path by traversing parent directories. - /// - /// # Errors - /// - /// * [ResolveError::JSON] - pub fn find_package_json( - &self, - fs: &Fs, - options: &ResolveOptions, - ctx: &mut Ctx, - ) -> Result>, ResolveError> { - let mut cache_value = self; - // Go up directories when the querying path is not a directory - while !cache_value.is_dir(fs, ctx) { - if let Some(cv) = &cache_value.parent { - cache_value = cv.as_ref(); - } else { - break; - } - } - let mut cache_value = Some(cache_value); - while let Some(cv) = cache_value { - if let Some(package_json) = cv.package_json(fs, options, ctx)? { - return Ok(Some(Arc::clone(&package_json))); - } - cache_value = cv.parent.as_deref(); - } - Ok(None) - } - - /// Get package.json of the given path. - /// - /// # Errors - /// - /// * [ResolveError::JSON] - pub fn package_json( - &self, - fs: &Fs, - options: &ResolveOptions, - ctx: &mut Ctx, - ) -> Result>, ResolveError> { - // Change to `std::sync::OnceLock::get_or_try_init` when it is stable. - let result = self - .package_json - .get_or_try_init(|| { - let package_json_path = self.path.join("package.json"); - let Ok(package_json_string) = fs.read_to_string(&package_json_path) else { - return Ok(None); - }; - let real_path = if options.symlinks { - self.realpath(fs)?.join("package.json") - } else { - package_json_path.clone() - }; - PackageJson::parse(package_json_path.clone(), real_path, &package_json_string) - .map(Arc::new) - .map(Some) - .map_err(|error| ResolveError::from_serde_json_error(package_json_path, &error)) - }) - .cloned(); - // https://github.com/webpack/enhanced-resolve/blob/58464fc7cb56673c9aa849e68e6300239601e615/lib/DescriptionFileUtils.js#L68-L82 - match &result { - Ok(Some(package_json)) => { - ctx.add_file_dependency(&package_json.path); - } - Ok(None) => { - // Avoid an allocation by making this lazy - if let Some(deps) = &mut ctx.missing_dependencies { - deps.push(self.path.join("package.json")); - } - } - Err(_) => { - if let Some(deps) = &mut ctx.file_dependencies { - deps.push(self.path.join("package.json")); - } - } - } - result - } -} - -/// Memoized cache key, code adapted from . -trait CacheKey { - fn tuple(&self) -> (u64, &Path); -} - -impl Hash for dyn CacheKey + '_ { - fn hash(&self, state: &mut H) { - self.tuple().0.hash(state); - } -} - -impl PartialEq for dyn CacheKey + '_ { - fn eq(&self, other: &Self) -> bool { - self.tuple().1 == other.tuple().1 - } -} - -impl Eq for dyn CacheKey + '_ {} - -impl<'a> CacheKey for (u64, &'a Path) { - fn tuple(&self) -> (u64, &Path) { - (self.0, self.1) - } -} - -impl<'a> Borrow for (u64, &'a Path) { - fn borrow(&self) -> &(dyn CacheKey + 'a) { - self - } -} - -/// Since the cache key is memoized, use an identity hasher -/// to avoid double cache. -#[derive(Default)] -struct IdentityHasher(u64); - -impl Hasher for IdentityHasher { - fn write(&mut self, _: &[u8]) { - unreachable!("Invalid use of IdentityHasher") - } - fn write_u64(&mut self, n: u64) { - self.0 = n; - } - fn finish(&self) -> u64 { - self.0 - } -} diff --git a/src/context.rs b/src/context.rs deleted file mode 100644 index 9349de30..00000000 --- a/src/context.rs +++ /dev/null @@ -1,89 +0,0 @@ -use std::{ - ops::{Deref, DerefMut}, - path::{Path, PathBuf}, -}; - -use crate::error::ResolveError; - -#[derive(Debug, Default, Clone)] -pub struct ResolveContext(ResolveContextImpl); - -#[derive(Debug, Default, Clone)] -pub struct ResolveContextImpl { - pub fully_specified: bool, - - pub query: Option, - - pub fragment: Option, - - /// Files that was found on file system - pub file_dependencies: Option>, - - /// Files that was found on file system - pub missing_dependencies: Option>, - - /// The current resolving alias for bailing recursion alias. - pub resolving_alias: Option, - - /// For avoiding infinite recursion, which will cause stack overflow. - depth: u8, -} - -impl Deref for ResolveContext { - type Target = ResolveContextImpl; - - fn deref(&self) -> &Self::Target { - &self.0 - } -} - -impl DerefMut for ResolveContext { - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} - -impl ResolveContext { - pub fn with_fully_specified(&mut self, yes: bool) { - self.fully_specified = yes; - } - - pub fn with_query_fragment(&mut self, query: Option<&str>, fragment: Option<&str>) { - if let Some(query) = query { - self.query.replace(query.to_string()); - } - if let Some(fragment) = fragment { - self.fragment.replace(fragment.to_string()); - } - } - - pub fn init_file_dependencies(&mut self) { - self.file_dependencies.replace(vec![]); - self.missing_dependencies.replace(vec![]); - } - - pub fn add_file_dependency(&mut self, dep: &Path) { - if let Some(deps) = &mut self.file_dependencies { - deps.push(dep.to_path_buf()); - } - } - - pub fn add_missing_dependency(&mut self, dep: &Path) { - if let Some(deps) = &mut self.missing_dependencies { - deps.push(dep.to_path_buf()); - } - } - - pub fn with_resolving_alias(&mut self, alias: String) { - self.resolving_alias = Some(alias); - } - - pub fn test_for_infinite_recursion(&mut self) -> Result<(), ResolveError> { - self.depth += 1; - // 64 should be more than enough for detecting infinite recursion. - if self.depth > 64 { - return Err(ResolveError::Recursion); - } - Ok(()) - } -} diff --git a/src/error.rs b/src/error.rs deleted file mode 100644 index 901e67ff..00000000 --- a/src/error.rs +++ /dev/null @@ -1,178 +0,0 @@ -use std::{io, path::PathBuf, sync::Arc}; -use thiserror::Error; - -/// All resolution errors -/// -/// `thiserror` is used to display meaningful error messages. -#[derive(Debug, Clone, PartialEq, Error)] -pub enum ResolveError { - /// Ignored path - /// - /// Derived from ignored path (false value) from browser field in package.json - /// ```json - /// { - /// "browser": { - /// "./module": false - /// } - /// } - /// ``` - /// See - #[error("Path is ignored {0}")] - Ignored(PathBuf), - - /// Module not found - #[error("Cannot find module '{0}'")] - NotFound(/* specifier */ String), - - /// Tsconfig not found - #[error("Tsconfig not found {0}")] - TsconfigNotFound(PathBuf), - - /// Tsconfig's project reference path points to it self - #[error("Tsconfig's project reference path points to this tsconfig {0}")] - TsconfigSelfReference(PathBuf), - - #[error("{0}")] - IOError(IOError), - - /// Node.js builtin modules - /// - /// This is an error due to not being a Node.js runtime. - /// The `alias` option can be used to resolve a builtin module to a polyfill. - #[error("Builtin module {0}")] - Builtin(String), - - /// All of the aliased extension are not found - #[error("All of the aliased extension are not found")] - ExtensionAlias, - - /// The provided path specifier cannot be parsed - #[error("{0}")] - Specifier(SpecifierError), - - /// JSON parse error - #[error("{0:?}")] - JSON(JSONError), - - /// Restricted by `ResolveOptions::restrictions` - #[error(r#"Path "{0}" restricted by {0}"#)] - Restriction(PathBuf, PathBuf), - - #[error(r#"Invalid module "{0}" specifier is not a valid subpath for the "exports" resolution of {1}"#)] - InvalidModuleSpecifier(String, PathBuf), - - #[error(r#"Invalid "exports" target "{0}" defined for '{1}' in the package config {2}"#)] - InvalidPackageTarget(String, String, PathBuf), - - #[error(r#"Package subpath '{0}' is not defined by "exports" in {1}"#)] - PackagePathNotExported(String, PathBuf), - - #[error(r#"Invalid package config "{0}", "exports" cannot contain some keys starting with '.' and some not. The exports object must either be an object of package subpath keys or an object of main entry condition name keys only."#)] - InvalidPackageConfig(PathBuf), - - #[error(r#"Default condition should be last one in "{0}""#)] - InvalidPackageConfigDefault(PathBuf), - - #[error(r#"Expecting folder to folder mapping. "{0}" should end with "/"#)] - InvalidPackageConfigDirectory(PathBuf), - - #[error(r#"Package import specifier "{0}" is not defined in package {1}"#)] - PackageImportNotDefined(String, PathBuf), - - #[error("{0} is unimplemented")] - Unimplemented(&'static str), - - /// Occurs when alias paths reference each other. - #[error("Recursion in resolving")] - Recursion, -} - -impl ResolveError { - pub fn is_ignore(&self) -> bool { - matches!(self, Self::Ignored(_)) - } - - pub(crate) fn from_serde_json_error(path: PathBuf, error: &serde_json::Error) -> Self { - Self::JSON(JSONError { - path, - message: error.to_string(), - line: error.line(), - column: error.column(), - }) - } -} - -/// Error for [ResolveError::Specifier] -#[derive(Debug, Clone, Eq, PartialEq, Error)] -pub enum SpecifierError { - #[error("The specifiers must be a non-empty string. Received \"{0}\"")] - Empty(String), -} - -/// JSON error from [serde_json::Error] -#[derive(Debug, Clone, Eq, PartialEq)] -pub struct JSONError { - pub path: PathBuf, - pub message: String, - pub line: usize, - pub column: usize, -} - -#[derive(Debug, Clone, Error)] -#[error("{0}")] -pub struct IOError(Arc); - -impl PartialEq for IOError { - fn eq(&self, other: &Self) -> bool { - self.0.kind() == other.0.kind() - } -} - -impl From for io::Error { - fn from(error: IOError) -> Self { - let io_error = error.0.as_ref(); - Self::new(io_error.kind(), io_error.to_string()) - } -} - -impl From for ResolveError { - fn from(err: io::Error) -> Self { - Self::IOError(IOError(Arc::new(err))) - } -} - -#[test] -fn test_into_io_error() { - use std::io::{self, ErrorKind}; - let error_string = "IOError occurred"; - let string_error = io::Error::new(ErrorKind::Interrupted, error_string.to_string()); - let string_error2 = io::Error::new(ErrorKind::Interrupted, error_string.to_string()); - let resolve_io_error: ResolveError = ResolveError::from(string_error2); - - assert_eq!(resolve_io_error, ResolveError::from(string_error)); - assert_eq!(resolve_io_error.clone(), resolve_io_error); - let ResolveError::IOError(io_error) = resolve_io_error else { unreachable!() }; - assert_eq!( - format!("{io_error:?}"), - r#"IOError(Custom { kind: Interrupted, error: "IOError occurred" })"# - ); - // fix for https://github.com/web-infra-dev/rspack/issues/4564 - let std_io_error: io::Error = io_error.into(); - assert_eq!(std_io_error.kind(), ErrorKind::Interrupted); - assert_eq!(std_io_error.to_string(), error_string); - assert_eq!( - format!("{std_io_error:?}"), - r#"Custom { kind: Interrupted, error: "IOError occurred" }"# - ); -} - -#[test] -fn test_coverage() { - let error = ResolveError::NotFound("x".into()); - assert_eq!(format!("{error:?}"), r#"NotFound("x")"#); - assert_eq!(error.clone(), error); - - let error = ResolveError::Specifier(SpecifierError::Empty("x".into())); - assert_eq!(format!("{error:?}"), r#"Specifier(Empty("x"))"#); - assert_eq!(error.clone(), error); -} diff --git a/src/file_system.rs b/src/file_system.rs deleted file mode 100644 index 04d177de..00000000 --- a/src/file_system.rs +++ /dev/null @@ -1,133 +0,0 @@ -use std::{ - fs, io, - path::{Path, PathBuf}, -}; - -/// File System abstraction used for `ResolverGeneric` -pub trait FileSystem: Send + Sync { - /// See [std::fs::read_to_string] - /// - /// # Errors - /// - /// * See [std::fs::read_to_string] - /// ## Warning - /// Use `&Path` instead of a generic `P: AsRef` here, - /// because object safety requirements, it is especially useful, when - /// you want to store multiple `dyn FileSystem` in a `Vec` or use a `ResolverGeneric` in - /// napi env. - fn read_to_string(&self, path: &Path) -> io::Result; - - /// See [std::fs::metadata] - /// - /// # Errors - /// See [std::fs::metadata] - /// ## Warning - /// Use `&Path` instead of a generic `P: AsRef` here, - /// because object safety requirements, it is especially useful, when - /// you want to store multiple `dyn FileSystem` in a `Vec` or use a `ResolverGeneric` in - /// napi env. - fn metadata(&self, path: &Path) -> io::Result; - - /// See [std::fs::symlink_metadata] - /// - /// # Errors - /// - /// See [std::fs::symlink_metadata] - /// ## Warning - /// Use `&Path` instead of a generic `P: AsRef` here, - /// because object safety requirements, it is especially useful, when - /// you want to store multiple `dyn FileSystem` in a `Vec` or use a `ResolverGeneric` in - /// napi env. - fn symlink_metadata(&self, path: &Path) -> io::Result; - - /// See [std::fs::canonicalize] - /// - /// # Errors - /// - /// See [std::fs::read_link] - /// ## Warning - /// Use `&Path` instead of a generic `P: AsRef` here, - /// because object safety requirements, it is especially useful, when - /// you want to store multiple `dyn FileSystem` in a `Vec` or use a `ResolverGeneric` in - /// napi env. - fn canonicalize(&self, path: &Path) -> io::Result; -} - -/// Metadata information about a file -#[derive(Debug, Clone, Copy)] -pub struct FileMetadata { - pub(crate) is_file: bool, - pub(crate) is_dir: bool, - pub(crate) is_symlink: bool, -} - -impl FileMetadata { - pub fn new(is_file: bool, is_dir: bool, is_symlink: bool) -> Self { - Self { is_file, is_dir, is_symlink } - } -} - -impl From for FileMetadata { - fn from(metadata: fs::Metadata) -> Self { - Self::new(metadata.is_file(), metadata.is_dir(), metadata.is_symlink()) - } -} - -/// Operating System -#[derive(Default)] -pub struct FileSystemOs; - -impl FileSystem for FileSystemOs { - fn read_to_string(&self, path: &Path) -> io::Result { - fs::read_to_string(path) - } - - fn metadata(&self, path: &Path) -> io::Result { - fs::metadata(path).map(FileMetadata::from) - } - - fn symlink_metadata(&self, path: &Path) -> io::Result { - fs::symlink_metadata(path).map(FileMetadata::from) - } - - fn canonicalize(&self, path: &Path) -> io::Result { - #[cfg(not(target_os = "wasi"))] - { - dunce::canonicalize(path) - } - #[cfg(target_os = "wasi")] - { - let meta = fs::symlink_metadata(path)?; - if meta.file_type().is_symlink() { - let link = fs::read_link(path)?; - let mut path_buf = path.to_path_buf(); - path_buf.pop(); - for segment in link.iter() { - match segment.to_str() { - Some("..") => { - path_buf.pop(); - } - Some(".") | None => {} - Some(seg) => { - // Need to trim the extra \0 introduces by rust std rust-lang/rust#123727 - path_buf.push(seg.trim_end_matches('\0')); - } - } - } - Ok(path_buf) - } else { - Ok(path.to_path_buf()) - } - } - } -} - -#[test] -fn metadata() { - let meta = FileMetadata { is_file: true, is_dir: true, is_symlink: true }; - assert_eq!( - format!("{meta:?}"), - "FileMetadata { is_file: true, is_dir: true, is_symlink: true }" - ); - let _ = meta; -} diff --git a/src/lib.rs b/src/lib.rs deleted file mode 100644 index cfe6c25a..00000000 --- a/src/lib.rs +++ /dev/null @@ -1,1689 +0,0 @@ -//! # Oxc Resolver -//! -//! Node.js [CommonJS][cjs] and [ECMAScript][esm] Module Resolution. -//! -//! Released on [crates.io](https://crates.io/crates/oxc_resolver) and [npm](https://www.npmjs.com/package/oxc-resolver). -//! -//! A module resolution is the process of finding the file referenced by a module specifier in -//! `import "specifier"` or `require("specifier")`. -//! -//! All [configuration options](ResolveOptions) are aligned with webpack's [enhanced-resolve]. -//! -//! ## Terminology -//! -//! ### Specifier -//! -//! For [CommonJS modules][cjs], -//! the specifier is the string passed to the `require` function. e.g. `"id"` in `require("id")`. -//! -//! For [ECMAScript modules][esm], -//! the specifier of an `import` statement is the string after the `from` keyword, -//! e.g. `'specifier'` in `import 'specifier'` or `import { sep } from 'specifier'`. -//! Specifiers are also used in export from statements, and as the argument to an `import()` expression. -//! -//! This is also named "request" in some places. -//! -//! ## References: -//! -//! * Algorithm adapted from Node.js [CommonJS Module Resolution Algorithm] and [ECMAScript Module Resolution Algorithm]. -//! * Tests are ported from [enhanced-resolve]. -//! * Some code is adapted from [parcel-resolver]. -//! * The documentation is copied from [webpack's resolve configuration](https://webpack.js.org/configuration/resolve). -//! -//! [enhanced-resolve]: https://github.com/webpack/enhanced-resolve -//! [CommonJS Module Resolution Algorithm]: https://nodejs.org/api/modules.html#all-together -//! [ECMAScript Module Resolution Algorithm]: https://nodejs.org/api/esm.html#resolution-algorithm-specification -//! [parcel-resolver]: https://github.com/parcel-bundler/parcel/blob/v2/packages/utils/node-resolver-rs -//! [cjs]: https://nodejs.org/api/modules.html -//! [esm]: https://nodejs.org/api/esm.html -//! -//! ## Feature flags -#![cfg_attr(feature = "document-features", doc = document_features::document_features!())] -#![cfg_attr(docsrs, feature(doc_auto_cfg))] -//! -//! ## Example -//! -//! ```rust,ignore -#![doc = include_str!("../examples/resolver.rs")] -//! ``` - -mod builtins; -mod cache; -mod context; -mod error; -mod file_system; -mod options; -mod package_json; -mod path; -mod resolution; -mod specifier; -mod tsconfig; - -#[cfg(test)] -mod tests; - -use std::{ - borrow::Cow, - cmp::Ordering, - ffi::OsStr, - fmt, - path::{Component, Path, PathBuf}, - sync::Arc, -}; - -use rustc_hash::FxHashSet; -use serde_json::Value as JSONValue; - -pub use crate::{ - builtins::NODEJS_BUILTINS, - error::{JSONError, ResolveError, SpecifierError}, - file_system::{FileMetadata, FileSystem}, - options::{ - Alias, AliasValue, EnforceExtension, ResolveOptions, Restriction, TsconfigOptions, - TsconfigReferences, - }, - package_json::PackageJson, - resolution::Resolution, -}; -use crate::{ - cache::{Cache, CachedPath}, - context::ResolveContext as Ctx, - file_system::FileSystemOs, - package_json::JSONMap, - path::{PathUtil, SLASH_START}, - specifier::Specifier, - tsconfig::ExtendsField, - tsconfig::{ProjectReference, TsConfig}, -}; - -type ResolveResult = Result, ResolveError>; - -/// Context returned from the [Resolver::resolve_with_context] API -#[derive(Debug, Default, Clone)] -pub struct ResolveContext { - /// Files that was found on file system - pub file_dependencies: FxHashSet, - - /// Dependencies that was not found on file system - pub missing_dependencies: FxHashSet, -} - -/// Resolver with the current operating system as the file system -pub type Resolver = ResolverGeneric; - -/// Generic implementation of the resolver, can be configured by the [FileSystem] trait -pub struct ResolverGeneric { - options: ResolveOptions, - cache: Arc>, -} - -impl fmt::Debug for ResolverGeneric { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - self.options.fmt(f) - } -} - -impl Default for ResolverGeneric { - fn default() -> Self { - Self::new(ResolveOptions::default()) - } -} - -impl ResolverGeneric { - pub fn new(options: ResolveOptions) -> Self { - Self { options: options.sanitize(), cache: Arc::new(Cache::new(Fs::default())) } - } -} - -impl ResolverGeneric { - pub fn new_with_file_system(file_system: Fs, options: ResolveOptions) -> Self { - Self { cache: Arc::new(Cache::new(file_system)), options: options.sanitize() } - } - - /// Clone the resolver using the same underlying cache. - #[must_use] - pub fn clone_with_options(&self, options: ResolveOptions) -> Self { - Self { options: options.sanitize(), cache: Arc::clone(&self.cache) } - } - - /// Returns the options. - pub fn options(&self) -> &ResolveOptions { - &self.options - } - - /// Clear the underlying cache. - pub fn clear_cache(&self) { - self.cache.clear(); - } - - /// Resolve `specifier` at an absolute path to a `directory`. - /// - /// A specifier is the string passed to require or import, i.e. `require("specifier")` or `import "specifier"`. - /// - /// `directory` must be an **absolute** path to a directory where the specifier is resolved against. - /// For CommonJS modules, it is the `__dirname` variable that contains the absolute path to the folder containing current module. - /// For ECMAScript modules, it is the value of `import.meta.url`. - /// - /// # Errors - /// - /// * See [ResolveError] - pub fn resolve>( - &self, - directory: P, - specifier: &str, - ) -> Result { - let mut ctx = Ctx::default(); - self.resolve_tracing(directory.as_ref(), specifier, &mut ctx) - } - - /// Resolve `specifier` at absolute `path` with [ResolveContext] - /// - /// # Errors - /// - /// * See [ResolveError] - pub fn resolve_with_context>( - &self, - directory: P, - specifier: &str, - resolve_context: &mut ResolveContext, - ) -> Result { - let mut ctx = Ctx::default(); - ctx.init_file_dependencies(); - let result = self.resolve_tracing(directory.as_ref(), specifier, &mut ctx); - if let Some(deps) = &mut ctx.file_dependencies { - resolve_context.file_dependencies.extend(deps.drain(..)); - } - if let Some(deps) = &mut ctx.missing_dependencies { - resolve_context.missing_dependencies.extend(deps.drain(..)); - } - result - } - - /// Wrap `resolve_impl` with `tracing` information - fn resolve_tracing( - &self, - directory: &Path, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - let span = tracing::debug_span!("resolve", path = ?directory, specifier = specifier); - let _enter = span.enter(); - let r = self.resolve_impl(directory, specifier, ctx); - match &r { - Ok(r) => { - tracing::debug!(options = ?self.options, path = ?directory, specifier = specifier, ret = ?r.path); - } - Err(err) => { - tracing::debug!(options = ?self.options, path = ?directory, specifier = specifier, err = ?err); - } - }; - r - } - - fn resolve_impl( - &self, - path: &Path, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - ctx.with_fully_specified(self.options.fully_specified); - let cached_path = self.cache.value(path); - let cached_path = self.require(&cached_path, specifier, ctx)?; - let path = self.load_realpath(&cached_path)?; - // enhanced-resolve: restrictions - self.check_restrictions(&path)?; - let package_json = cached_path.find_package_json(&self.cache.fs, &self.options, ctx)?; - if let Some(package_json) = &package_json { - // path must be inside the package. - debug_assert!(path.starts_with(package_json.directory())); - } - Ok(Resolution { - path, - query: ctx.query.take(), - fragment: ctx.fragment.take(), - package_json, - }) - } - - /// require(X) from module at path Y - /// - /// X: specifier - /// Y: path - /// - /// - fn require( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - ctx.test_for_infinite_recursion()?; - - // enhanced-resolve: parse - let (parsed, try_fragment_as_path) = self.load_parse(cached_path, specifier, ctx)?; - if let Some(path) = try_fragment_as_path { - return Ok(path); - } - - self.require_without_parse(cached_path, parsed.path(), ctx) - } - - fn require_without_parse( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - // tsconfig-paths - if let Some(path) = self.load_tsconfig_paths(cached_path, specifier, &mut Ctx::default())? { - return Ok(path); - } - - // enhanced-resolve: try alias - if let Some(path) = self.load_alias(cached_path, specifier, &self.options.alias, ctx)? { - return Ok(path); - } - - let result = match Path::new(specifier).components().next() { - // 2. If X begins with '/' - Some(Component::RootDir | Component::Prefix(_)) => { - self.require_absolute(cached_path, specifier, ctx) - } - // 3. If X begins with './' or '/' or '../' - Some(Component::CurDir | Component::ParentDir) => { - self.require_relative(cached_path, specifier, ctx) - } - // 4. If X begins with '#' - Some(Component::Normal(_)) if specifier.as_bytes()[0] == b'#' => { - self.require_hash(cached_path, specifier, ctx) - } - _ => { - // 1. If X is a core module, - // a. return the core module - // b. STOP - self.require_core(specifier)?; - - // (ESM) 5. Otherwise, - // Note: specifier is now a bare specifier. - // Set resolved the result of PACKAGE_RESOLVE(specifier, parentURL). - self.require_bare(cached_path, specifier, ctx) - } - }; - - result.or_else(|err| { - if err.is_ignore() { - return Err(err); - } - // enhanced-resolve: try fallback - self.load_alias(cached_path, specifier, &self.options.fallback, ctx) - .and_then(|value| value.ok_or(err)) - }) - } - - // PACKAGE_RESOLVE(packageSpecifier, parentURL) - // 3. If packageSpecifier is a Node.js builtin module name, then - // 1. Return the string "node:" concatenated with packageSpecifier. - fn require_core(&self, specifier: &str) -> Result<(), ResolveError> { - if self.options.builtin_modules { - let starts_with_node = specifier.starts_with("node:"); - if starts_with_node || NODEJS_BUILTINS.binary_search(&specifier).is_ok() { - let mut specifier = specifier.to_string(); - if !starts_with_node { - specifier = format!("node:{specifier}"); - } - return Err(ResolveError::Builtin(specifier)); - } - } - Ok(()) - } - - fn require_absolute( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - // Make sure only path prefixes gets called - debug_assert!(Path::new(specifier) - .components() - .next() - .is_some_and(|c| matches!(c, Component::RootDir | Component::Prefix(_)))); - if !self.options.prefer_relative && self.options.prefer_absolute { - if let Ok(path) = self.load_package_self_or_node_modules(cached_path, specifier, ctx) { - return Ok(path); - } - } - if let Some(path) = self.load_roots(specifier, ctx) { - return Ok(path); - } - // 2. If X begins with '/' - // a. set Y to be the file system root - let path = self.cache.value(Path::new(specifier)); - if let Some(path) = self.load_as_file_or_directory(&path, specifier, ctx)? { - return Ok(path); - } - Err(ResolveError::NotFound(specifier.to_string())) - } - - // 3. If X begins with './' or '/' or '../' - fn require_relative( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - // Make sure only relative or normal paths gets called - debug_assert!(Path::new(specifier).components().next().is_some_and(|c| matches!( - c, - Component::CurDir | Component::ParentDir | Component::Normal(_) - ))); - let path = cached_path.path().normalize_with(specifier); - let cached_path = self.cache.value(&path); - // a. LOAD_AS_FILE(Y + X) - // b. LOAD_AS_DIRECTORY(Y + X) - if let Some(path) = self.load_as_file_or_directory(&cached_path, specifier, ctx)? { - return Ok(path); - } - // c. THROW "not found" - Err(ResolveError::NotFound(specifier.to_string())) - } - - fn require_hash( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - debug_assert_eq!(specifier.chars().next(), Some('#')); - // a. LOAD_PACKAGE_IMPORTS(X, dirname(Y)) - if let Some(path) = self.load_package_imports(cached_path, specifier, ctx)? { - return Ok(path); - } - self.load_package_self_or_node_modules(cached_path, specifier, ctx) - } - - fn require_bare( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - // Make sure no other path prefixes gets called - debug_assert!(Path::new(specifier) - .components() - .next() - .is_some_and(|c| matches!(c, Component::Normal(_)))); - if self.options.prefer_relative { - if let Ok(path) = self.require_relative(cached_path, specifier, ctx) { - return Ok(path); - } - } - self.load_package_self_or_node_modules(cached_path, specifier, ctx) - } - - /// enhanced-resolve: ParsePlugin. - /// - /// 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`. - /// - /// - fn load_parse<'s>( - &self, - cached_path: &CachedPath, - specifier: &'s str, - ctx: &mut Ctx, - ) -> Result<(Specifier<'s>, Option), ResolveError> { - let parsed = Specifier::parse(specifier).map_err(ResolveError::Specifier)?; - ctx.with_query_fragment(parsed.query, parsed.fragment); - - // There is an edge-case where a request with # can be a path or a fragment -> try both - if ctx.fragment.is_some() && ctx.query.is_none() { - let specifier = parsed.path(); - let fragment = ctx.fragment.take().unwrap(); - let path = format!("{specifier}{fragment}"); - if let Ok(path) = self.require_without_parse(cached_path, &path, ctx) { - return Ok((parsed, Some(path))); - } - ctx.fragment.replace(fragment); - } - Ok((parsed, None)) - } - - fn load_package_self_or_node_modules( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - let (_, subpath) = Self::parse_package_specifier(specifier); - if subpath.is_empty() { - ctx.with_fully_specified(false); - } - // 5. LOAD_PACKAGE_SELF(X, dirname(Y)) - if let Some(path) = self.load_package_self(cached_path, specifier, ctx)? { - return Ok(path); - } - // 6. LOAD_NODE_MODULES(X, dirname(Y)) - if let Some(path) = self.load_node_modules(cached_path, specifier, ctx)? { - return Ok(path); - } - // 7. THROW "not found" - Err(ResolveError::NotFound(specifier.to_string())) - } - - /// LOAD_PACKAGE_IMPORTS(X, DIR) - fn load_package_imports( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - // 1. Find the closest package scope SCOPE to DIR. - // 2. If no scope was found, return. - let Some(package_json) = - cached_path.find_package_json(&self.cache.fs, &self.options, ctx)? - else { - return Ok(None); - }; - // 3. If the SCOPE/package.json "imports" is null or undefined, return. - // 4. let MATCH = PACKAGE_IMPORTS_RESOLVE(X, pathToFileURL(SCOPE), ["node", "require"]) defined in the ESM resolver. - if let Some(path) = self.package_imports_resolve(specifier, &package_json, ctx)? { - // 5. RESOLVE_ESM_MATCH(MATCH). - return self.resolve_esm_match(specifier, &path, ctx); - } - Ok(None) - } - - fn load_as_file(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - // enhanced-resolve feature: extension_alias - if let Some(path) = self.load_extension_alias(cached_path, ctx)? { - return Ok(Some(path)); - } - if self.options.enforce_extension.is_disabled() { - // 1. If X is a file, load X as its file extension format. STOP - if let Some(path) = self.load_alias_or_file(cached_path, ctx)? { - return Ok(Some(path)); - } - } - // 2. If X.js is a file, load X.js as JavaScript text. STOP - // 3. If X.json is a file, parse X.json to a JavaScript Object. STOP - // 4. If X.node is a file, load X.node as binary addon. STOP - if let Some(path) = - self.load_extensions(cached_path.path(), &self.options.extensions, ctx)? - { - return Ok(Some(path)); - } - Ok(None) - } - - fn load_as_directory(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - // TODO: Only package.json is supported, so warn about having other values - // Checking for empty files is needed for omitting checks on package.json - // 1. If X/package.json is a file, - if !self.options.description_files.is_empty() { - // a. Parse X/package.json, and look for "main" field. - if let Some(package_json) = - cached_path.package_json(&self.cache.fs, &self.options, ctx)? - { - // b. If "main" is a falsy value, GOTO 2. - for main_field in package_json.main_fields(&self.options.main_fields) { - // c. let M = X + (json main field) - let main_field_path = cached_path.path().normalize_with(main_field); - // d. LOAD_AS_FILE(M) - let cached_path = self.cache.value(&main_field_path); - if let Some(path) = self.load_as_file(&cached_path, ctx)? { - return Ok(Some(path)); - } - // e. LOAD_INDEX(M) - if let Some(path) = self.load_index(&cached_path, ctx)? { - return Ok(Some(path)); - } - } - // f. LOAD_INDEX(X) DEPRECATED - // g. THROW "not found" - } - } - // 2. LOAD_INDEX(X) - self.load_index(cached_path, ctx) - } - - fn load_as_file_or_directory( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - if self.options.resolve_to_context { - return Ok(cached_path.is_dir(&self.cache.fs, ctx).then(|| cached_path.clone())); - } - if !specifier.ends_with('/') { - if let Some(path) = self.load_as_file(cached_path, ctx)? { - return Ok(Some(path)); - } - } - if cached_path.is_dir(&self.cache.fs, ctx) { - if let Some(path) = self.load_as_directory(cached_path, ctx)? { - return Ok(Some(path)); - } - } - Ok(None) - } - - fn load_extensions(&self, path: &Path, extensions: &[String], ctx: &mut Ctx) -> ResolveResult { - if ctx.fully_specified { - return Ok(None); - } - let path = path.as_os_str(); - for extension in extensions { - let mut path_with_extension = path.to_os_string(); - path_with_extension.reserve_exact(extension.len()); - path_with_extension.push(extension); - let cached_path = self.cache.value(Path::new(&path_with_extension)); - if let Some(path) = self.load_alias_or_file(&cached_path, ctx)? { - return Ok(Some(path)); - } - } - Ok(None) - } - - fn load_realpath(&self, cached_path: &CachedPath) -> Result { - if self.options.symlinks { - cached_path.realpath(&self.cache.fs).map_err(ResolveError::from) - } else { - Ok(cached_path.to_path_buf()) - } - } - - fn check_restrictions(&self, path: &Path) -> Result<(), ResolveError> { - // https://github.com/webpack/enhanced-resolve/blob/a998c7d218b7a9ec2461fc4fddd1ad5dd7687485/lib/RestrictionsPlugin.js#L19-L24 - fn is_inside(path: &Path, parent: &Path) -> bool { - if !path.starts_with(parent) { - return false; - } - if path.as_os_str().len() == parent.as_os_str().len() { - return true; - } - path.strip_prefix(parent).is_ok_and(|p| p == Path::new("./")) - } - for restriction in &self.options.restrictions { - match restriction { - Restriction::Path(restricted_path) => { - if !is_inside(path, restricted_path) { - return Err(ResolveError::Restriction( - path.to_path_buf(), - restricted_path.clone(), - )); - } - } - Restriction::RegExp(_) => { - return Err(ResolveError::Unimplemented("Restriction with regex")) - } - } - } - Ok(()) - } - - fn load_index(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - for main_file in &self.options.main_files { - let main_path = cached_path.path().normalize_with(main_file); - let cached_path = self.cache.value(&main_path); - if self.options.enforce_extension.is_disabled() { - if let Some(path) = self.load_alias_or_file(&cached_path, ctx)? { - return Ok(Some(path)); - } - } - // 1. If X/index.js is a file, load X/index.js as JavaScript text. STOP - // 2. If X/index.json is a file, parse X/index.json to a JavaScript object. STOP - // 3. If X/index.node is a file, load X/index.node as binary addon. STOP - if let Some(path) = - self.load_extensions(cached_path.path(), &self.options.extensions, ctx)? - { - return Ok(Some(path)); - } - } - Ok(None) - } - - fn load_alias_or_file(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - if !self.options.alias_fields.is_empty() { - if let Some(package_json) = - cached_path.find_package_json(&self.cache.fs, &self.options, ctx)? - { - if let Some(path) = - self.load_browser_field(cached_path, None, &package_json, ctx)? - { - return Ok(Some(path)); - } - } - } - // enhanced-resolve: try file as alias - let alias_specifier = cached_path.path().to_string_lossy(); - if let Some(path) = - self.load_alias(cached_path, &alias_specifier, &self.options.alias, ctx)? - { - return Ok(Some(path)); - } - if cached_path.is_file(&self.cache.fs, ctx) { - return Ok(Some(cached_path.clone())); - } - Ok(None) - } - - fn load_node_modules( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - let (package_name, subpath) = Self::parse_package_specifier(specifier); - // 1. let DIRS = NODE_MODULES_PATHS(START) - // 2. for each DIR in DIRS: - for module_name in &self.options.modules { - for cached_path in std::iter::successors(Some(cached_path), |p| p.parent()) { - // Skip if /path/to/node_modules does not exist - if !cached_path.is_dir(&self.cache.fs, ctx) { - continue; - } - - let Some(cached_path) = self.get_module_directory(cached_path, module_name, ctx) - else { - continue; - }; - // Optimize node_modules lookup by inspecting whether the package exists - // From LOAD_PACKAGE_EXPORTS(X, DIR) - // 1. Try to interpret X as a combination of NAME and SUBPATH where the name - // may have a @scope/ prefix and the subpath begins with a slash (`/`). - if !package_name.is_empty() { - let package_path = cached_path.path().normalize_with(package_name); - let cached_path = self.cache.value(&package_path); - // Try foo/node_modules/package_name - if cached_path.is_dir(&self.cache.fs, ctx) { - // a. LOAD_PACKAGE_EXPORTS(X, DIR) - if let Some(path) = - self.load_package_exports(specifier, subpath, &cached_path, ctx)? - { - return Ok(Some(path)); - } - } else { - // foo/node_modules/package_name is not a directory, so useless to check inside it - if !subpath.is_empty() { - continue; - } - // Skip if the directory lead to the scope package does not exist - // i.e. `foo/node_modules/@scope` is not a directory for `foo/node_modules/@scope/package` - if package_name.starts_with('@') { - if let Some(path) = cached_path.parent() { - if !path.is_dir(&self.cache.fs, ctx) { - continue; - } - } - } - } - } - - // Try as file or directory for all other cases - // b. LOAD_AS_FILE(DIR/X) - // c. LOAD_AS_DIRECTORY(DIR/X) - let node_module_file = cached_path.path().normalize_with(specifier); - let cached_path = self.cache.value(&node_module_file); - if let Some(path) = self.load_as_file_or_directory(&cached_path, specifier, ctx)? { - return Ok(Some(path)); - } - } - } - Ok(None) - } - - fn get_module_directory( - &self, - cached_path: &CachedPath, - module_name: &str, - ctx: &mut Ctx, - ) -> Option { - if module_name == "node_modules" { - cached_path.cached_node_modules(&self.cache, ctx) - } else if cached_path.path().components().next_back() - == Some(Component::Normal(OsStr::new(module_name))) - { - Some(cached_path.clone()) - } else { - cached_path.module_directory(module_name, &self.cache, ctx) - } - } - - fn load_package_exports( - &self, - specifier: &str, - subpath: &str, - cached_path: &CachedPath, - ctx: &mut Ctx, - ) -> ResolveResult { - // 2. If X does not match this pattern or DIR/NAME/package.json is not a file, - // return. - let Some(package_json) = cached_path.package_json(&self.cache.fs, &self.options, ctx)? - else { - return Ok(None); - }; - // 3. Parse DIR/NAME/package.json, and look for "exports" field. - // 4. If "exports" is null or undefined, return. - // 5. let MATCH = PACKAGE_EXPORTS_RESOLVE(pathToFileURL(DIR/NAME), "." + SUBPATH, - // `package.json` "exports", ["node", "require"]) defined in the ESM resolver. - // Note: The subpath is not prepended with a dot on purpose - for exports in package_json.exports_fields(&self.options.exports_fields) { - if let Some(path) = self.package_exports_resolve( - cached_path.path(), - &format!(".{subpath}"), - exports, - ctx, - )? { - // 6. RESOLVE_ESM_MATCH(MATCH) - return self.resolve_esm_match(specifier, &path, ctx); - }; - } - Ok(None) - } - - fn load_package_self( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - // 1. Find the closest package scope SCOPE to DIR. - // 2. If no scope was found, return. - let Some(package_json) = - cached_path.find_package_json(&self.cache.fs, &self.options, ctx)? - else { - return Ok(None); - }; - // 3. If the SCOPE/package.json "exports" is null or undefined, return. - // 4. If the SCOPE/package.json "name" is not the first segment of X, return. - if let Some(subpath) = package_json - .name - .as_ref() - .and_then(|package_name| Self::strip_package_name(specifier, package_name)) - { - // 5. let MATCH = PACKAGE_EXPORTS_RESOLVE(pathToFileURL(SCOPE), - // "." + X.slice("name".length), `package.json` "exports", ["node", "require"]) - // defined in the ESM resolver. - let package_url = package_json.directory(); - // Note: The subpath is not prepended with a dot on purpose - // because `package_exports_resolve` matches subpath without the leading dot. - for exports in package_json.exports_fields(&self.options.exports_fields) { - if let Some(cached_path) = - self.package_exports_resolve(package_url, &format!(".{subpath}"), exports, ctx)? - { - // 6. RESOLVE_ESM_MATCH(MATCH) - return self.resolve_esm_match(specifier, &cached_path, ctx); - } - } - } - self.load_browser_field(cached_path, Some(specifier), &package_json, ctx) - } - - /// RESOLVE_ESM_MATCH(MATCH) - fn resolve_esm_match( - &self, - specifier: &str, - cached_path: &CachedPath, - ctx: &mut Ctx, - ) -> ResolveResult { - // 1. let RESOLVED_PATH = fileURLToPath(MATCH) - // 2. If the file at RESOLVED_PATH exists, load RESOLVED_PATH as its extension format. STOP - // - // Non-compliant ESM can result in a directory, so directory is tried as well. - if let Some(path) = self.load_as_file_or_directory(cached_path, "", ctx)? { - return Ok(Some(path)); - } - // 3. THROW "not found" - Err(ResolveError::NotFound(specifier.to_string())) - } - - /// enhanced-resolve: AliasFieldPlugin for [ResolveOptions::alias_fields] - fn load_browser_field( - &self, - cached_path: &CachedPath, - module_specifier: Option<&str>, - package_json: &PackageJson, - ctx: &mut Ctx, - ) -> ResolveResult { - let path = cached_path.path(); - let Some(new_specifier) = package_json.resolve_browser_field( - path, - module_specifier, - &self.options.alias_fields, - )? - else { - return Ok(None); - }; - // Abort when resolving recursive module - if module_specifier.is_some_and(|s| s == new_specifier) { - return Ok(None); - } - if ctx.resolving_alias.as_ref().is_some_and(|s| s == new_specifier) { - // Complete when resolving to self `{"./a.js": "./a.js"}` - if new_specifier.strip_prefix("./").filter(|s| path.ends_with(Path::new(s))).is_some() { - return if cached_path.is_file(&self.cache.fs, ctx) { - Ok(Some(cached_path.clone())) - } else { - Err(ResolveError::NotFound(new_specifier.to_string())) - }; - } - return Err(ResolveError::Recursion); - } - ctx.with_resolving_alias(new_specifier.to_string()); - ctx.with_fully_specified(false); - let cached_path = self.cache.value(package_json.directory()); - self.require(&cached_path, new_specifier, ctx).map(Some) - } - - /// enhanced-resolve: AliasPlugin for [ResolveOptions::alias] and [ResolveOptions::fallback]. - fn load_alias( - &self, - cached_path: &CachedPath, - specifier: &str, - aliases: &Alias, - ctx: &mut Ctx, - ) -> ResolveResult { - for (alias_key_raw, specifiers) in aliases { - let alias_key = if let Some(alias_key) = alias_key_raw.strip_suffix('$') { - if alias_key != specifier { - continue; - } - alias_key - } else { - let strip_package_name = Self::strip_package_name(specifier, alias_key_raw); - if strip_package_name.is_none() { - continue; - } - alias_key_raw - }; - // It should stop resolving when all of the tried alias values - // failed to resolve. - // - let mut should_stop = false; - for r in specifiers { - match r { - AliasValue::Path(alias_value) => { - if let Some(path) = self.load_alias_value( - cached_path, - alias_key, - alias_value, - specifier, - ctx, - &mut should_stop, - )? { - return Ok(Some(path)); - } - } - AliasValue::Ignore => { - let path = cached_path.path().normalize_with(alias_key); - return Err(ResolveError::Ignored(path)); - } - } - } - if should_stop { - return Err(ResolveError::NotFound(specifier.to_string())); - } - } - Ok(None) - } - - fn load_alias_value( - &self, - cached_path: &CachedPath, - alias_key: &str, - alias_value: &str, - request: &str, - ctx: &mut Ctx, - should_stop: &mut bool, - ) -> ResolveResult { - if request != alias_value - && !request.strip_prefix(alias_value).is_some_and(|prefix| prefix.starts_with('/')) - { - let tail = &request[alias_key.len()..]; - - let new_specifier = if tail.is_empty() { - Cow::Borrowed(alias_value) - } else { - let alias_value = Path::new(alias_value).normalize(); - // Must not append anything to alias_value if it is a file. - let alias_value_cached_path = self.cache.value(&alias_value); - if alias_value_cached_path.is_file(&self.cache.fs, ctx) { - return Ok(None); - } - - // Remove the leading slash so the final path is concatenated. - let tail = tail.trim_start_matches(SLASH_START); - let normalized = alias_value.normalize_with(tail); - Cow::Owned(normalized.to_string_lossy().to_string()) - }; - - *should_stop = true; - ctx.with_fully_specified(false); - return match self.require(cached_path, new_specifier.as_ref(), ctx) { - Err(ResolveError::NotFound(_)) => Ok(None), - Ok(path) => return Ok(Some(path)), - Err(err) => return Err(err), - }; - } - Ok(None) - } - - /// Given an extension alias map `{".js": [".ts", "js"]}`, - /// load the mapping instead of the provided extension - /// - /// This is an enhanced-resolve feature - /// - /// # Errors - /// - /// * [ResolveError::ExtensionAlias]: When all of the aliased extensions are not found - fn load_extension_alias(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - if self.options.extension_alias.is_empty() { - return Ok(None); - } - let Some(path_extension) = cached_path.path().extension() else { - return Ok(None); - }; - let Some((_, extensions)) = self - .options - .extension_alias - .iter() - .find(|(ext, _)| OsStr::new(ext.trim_start_matches('.')) == path_extension) - else { - return Ok(None); - }; - let path = cached_path.path().with_extension(""); - ctx.with_fully_specified(false); - if let Some(path) = self.load_extensions(&path, extensions, ctx)? { - return Ok(Some(path)); - } - Err(ResolveError::ExtensionAlias) - } - - /// enhanced-resolve: RootsPlugin - /// - /// A list of directories where requests of server-relative URLs (starting with '/') are resolved, - /// defaults to context configuration option. - /// - /// On non-Windows systems these requests are resolved as an absolute path first. - fn load_roots(&self, specifier: &str, ctx: &mut Ctx) -> Option { - if self.options.roots.is_empty() { - return None; - } - if let Some(specifier) = specifier.strip_prefix(SLASH_START) { - for root in &self.options.roots { - let cached_path = self.cache.value(root); - if let Ok(path) = self.require_relative(&cached_path, specifier, ctx) { - return Some(path); - } - } - } - None - } - - fn load_tsconfig_paths( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - let Some(tsconfig_options) = &self.options.tsconfig else { - return Ok(None); - }; - let tsconfig = self.load_tsconfig( - /* root */ true, - &tsconfig_options.config_file, - &tsconfig_options.references, - )?; - let paths = tsconfig.resolve(cached_path.path(), specifier); - for path in paths { - let cached_path = self.cache.value(&path); - if let Ok(path) = self.require_relative(&cached_path, ".", ctx) { - return Ok(Some(path)); - } - } - Ok(None) - } - - fn load_tsconfig( - &self, - root: bool, - path: &Path, - references: &TsconfigReferences, - ) -> Result, ResolveError> { - self.cache.tsconfig(root, path, |tsconfig| { - let directory = self.cache.value(tsconfig.directory()); - tracing::trace!(tsconfig = ?tsconfig, "load_tsconfig"); - - // Extend tsconfig - if let Some(extends) = &tsconfig.extends { - let extended_tsconfig_paths = match extends { - ExtendsField::Single(s) => { - vec![self.get_extended_tsconfig_path(&directory, tsconfig, s)?] - } - ExtendsField::Multiple(specifiers) => specifiers - .iter() - .map(|s| self.get_extended_tsconfig_path(&directory, tsconfig, s)) - .collect::, ResolveError>>()?, - }; - for extended_tsconfig_path in extended_tsconfig_paths { - let extended_tsconfig = self.load_tsconfig( - /* root */ false, - &extended_tsconfig_path, - &TsconfigReferences::Disabled, - )?; - tsconfig.extend_tsconfig(&extended_tsconfig); - } - } - - // Load project references - match references { - TsconfigReferences::Disabled => { - tsconfig.references.drain(..); - } - TsconfigReferences::Auto => {} - TsconfigReferences::Paths(paths) => { - tsconfig.references = paths - .iter() - .map(|path| ProjectReference { path: path.clone(), tsconfig: None }) - .collect(); - } - } - if !tsconfig.references.is_empty() { - let directory = tsconfig.directory().to_path_buf(); - for reference in &mut tsconfig.references { - let reference_tsconfig_path = directory.normalize_with(&reference.path); - let tsconfig = self.cache.tsconfig( - /* root */ true, - &reference_tsconfig_path, - |reference_tsconfig| { - if reference_tsconfig.path == tsconfig.path { - return Err(ResolveError::TsconfigSelfReference( - reference_tsconfig.path.clone(), - )); - } - Ok(()) - }, - )?; - reference.tsconfig.replace(tsconfig); - } - } - Ok(()) - }) - } - - fn get_extended_tsconfig_path( - &self, - directory: &CachedPath, - tsconfig: &TsConfig, - specifier: &str, - ) -> Result { - match specifier.as_bytes().first() { - None => Err(ResolveError::Specifier(SpecifierError::Empty(specifier.to_string()))), - Some(b'/') => Ok(PathBuf::from(specifier)), - Some(b'.') => Ok(tsconfig.directory().normalize_with(specifier)), - _ => self - .clone_with_options(ResolveOptions { - description_files: vec![], - extensions: vec![".json".into()], - main_files: vec!["tsconfig.json".into()], - ..ResolveOptions::default() - }) - .load_package_self_or_node_modules(directory, specifier, &mut Ctx::default()) - .map(|p| p.to_path_buf()) - .map_err(|err| match err { - ResolveError::NotFound(_) => { - ResolveError::TsconfigNotFound(PathBuf::from(specifier)) - } - _ => err, - }), - } - } - - /// PACKAGE_RESOLVE(packageSpecifier, parentURL) - fn package_resolve( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - let (package_name, subpath) = Self::parse_package_specifier(specifier); - - // 3. If packageSpecifier is a Node.js builtin module name, then - // 1. Return the string "node:" concatenated with packageSpecifier. - self.require_core(package_name)?; - - // 11. While parentURL is not the file system root, - for module_name in &self.options.modules { - for cached_path in std::iter::successors(Some(cached_path), |p| p.parent()) { - // 1. Let packageURL be the URL resolution of "node_modules/" concatenated with packageSpecifier, relative to parentURL. - let Some(cached_path) = self.get_module_directory(cached_path, module_name, ctx) - else { - continue; - }; - // 2. Set parentURL to the parent folder URL of parentURL. - let package_path = cached_path.path().normalize_with(package_name); - let cached_path = self.cache.value(&package_path); - // 3. If the folder at packageURL does not exist, then - // 1. Continue the next loop iteration. - if cached_path.is_dir(&self.cache.fs, ctx) { - // 4. Let pjson be the result of READ_PACKAGE_JSON(packageURL). - if let Some(package_json) = - cached_path.package_json(&self.cache.fs, &self.options, ctx)? - { - // 5. If pjson is not null and pjson.exports is not null or undefined, then - // 1. Return the result of PACKAGE_EXPORTS_RESOLVE(packageURL, packageSubpath, pjson.exports, defaultConditions). - for exports in package_json.exports_fields(&self.options.exports_fields) { - if let Some(path) = self.package_exports_resolve( - cached_path.path(), - &format!(".{subpath}"), - exports, - ctx, - )? { - return Ok(Some(path)); - } - } - // 6. Otherwise, if packageSubpath is equal to ".", then - if subpath == "." { - // 1. If pjson.main is a string, then - for main_field in package_json.main_fields(&self.options.main_fields) { - // 1. Return the URL resolution of main in packageURL. - let path = cached_path.path().normalize_with(main_field); - let cached_path = self.cache.value(&path); - if cached_path.is_file(&self.cache.fs, ctx) { - return Ok(Some(cached_path)); - } - } - } - } - let subpath = format!(".{subpath}"); - ctx.with_fully_specified(false); - return self.require(&cached_path, &subpath, ctx).map(Some); - } - } - } - - Err(ResolveError::NotFound(specifier.to_string())) - } - - /// PACKAGE_EXPORTS_RESOLVE(packageURL, subpath, exports, conditions) - fn package_exports_resolve( - &self, - package_url: &Path, - subpath: &str, - exports: &JSONValue, - ctx: &mut Ctx, - ) -> ResolveResult { - let conditions = &self.options.condition_names; - // 1. If exports is an Object with both a key starting with "." and a key not starting with ".", throw an Invalid Package Configuration error. - if let JSONValue::Object(map) = exports { - let mut has_dot = false; - let mut without_dot = false; - for key in map.keys() { - has_dot = has_dot || key.starts_with(|s| s == '.' || s == '#'); - without_dot = without_dot || !key.starts_with(|s| s == '.' || s == '#'); - if has_dot && without_dot { - return Err(ResolveError::InvalidPackageConfig( - package_url.join("package.json"), - )); - } - } - } - // 2. If subpath is equal to ".", then - // Note: subpath is not prepended with a dot when passed in. - if subpath == "." { - // enhanced-resolve appends query and fragment when resolving exports field - // https://github.com/webpack/enhanced-resolve/blob/a998c7d218b7a9ec2461fc4fddd1ad5dd7687485/lib/ExportsFieldPlugin.js#L57-L62 - // This is only need when querying the main export, otherwise ctx is passed through. - if ctx.query.is_some() || ctx.fragment.is_some() { - let query = ctx.query.clone().unwrap_or_default(); - let fragment = ctx.fragment.clone().unwrap_or_default(); - return Err(ResolveError::PackagePathNotExported( - format!("./{}{query}{fragment}", subpath.trim_start_matches('.')), - package_url.join("package.json"), - )); - } - // 1. Let mainExport be undefined. - let main_export = match exports { - // 2. If exports is a String or Array, or an Object containing no keys starting with ".", then - JSONValue::String(_) | JSONValue::Array(_) => { - // 1. Set mainExport to exports. - Some(exports) - } - // 3. Otherwise if exports is an Object containing a "." property, then - JSONValue::Object(map) => { - // 1. Set mainExport to exports["."]. - map.get(".").map_or_else( - || { - if map.keys().any(|key| key.starts_with("./") || key.starts_with('#')) { - None - } else { - Some(exports) - } - }, - Some, - ) - } - _ => None, - }; - // 4. If mainExport is not undefined, then - if let Some(main_export) = main_export { - // 1. Let resolved be the result of PACKAGE_TARGET_RESOLVE( packageURL, mainExport, null, false, conditions). - let resolved = self.package_target_resolve( - package_url, - ".", - main_export, - None, - /* is_imports */ false, - conditions, - ctx, - )?; - // 2. If resolved is not null or undefined, return resolved. - if let Some(path) = resolved { - return Ok(Some(path)); - } - } - } - // 3. Otherwise, if exports is an Object and all keys of exports start with ".", then - if let JSONValue::Object(exports) = exports { - // 1. Let matchKey be the string "./" concatenated with subpath. - // Note: `package_imports_exports_resolve` does not require the leading dot. - let match_key = &subpath; - // 2. Let resolved be the result of PACKAGE_IMPORTS_EXPORTS_RESOLVE( matchKey, exports, packageURL, false, conditions). - if let Some(path) = self.package_imports_exports_resolve( - match_key, - exports, - package_url, - /* is_imports */ false, - conditions, - ctx, - )? { - // 3. If resolved is not null or undefined, return resolved. - return Ok(Some(path)); - } - } - // 4. Throw a Package Path Not Exported error. - Err(ResolveError::PackagePathNotExported( - subpath.to_string(), - package_url.join("package.json"), - )) - } - - /// PACKAGE_IMPORTS_RESOLVE(specifier, parentURL, conditions) - fn package_imports_resolve( - &self, - specifier: &str, - package_json: &PackageJson, - ctx: &mut Ctx, - ) -> Result, ResolveError> { - // 1. Assert: specifier begins with "#". - debug_assert!(specifier.starts_with('#'), "{specifier}"); - // 2. If specifier is exactly equal to "#" or starts with "#/", then - // 1. Throw an Invalid Module Specifier error. - // 3. Let packageURL be the result of LOOKUP_PACKAGE_SCOPE(parentURL). - // 4. If packageURL is not null, then - - // 1. Let pjson be the result of READ_PACKAGE_JSON(packageURL). - // 2. If pjson.imports is a non-null Object, then - - // 1. Let resolved be the result of PACKAGE_IMPORTS_EXPORTS_RESOLVE( specifier, pjson.imports, packageURL, true, conditions). - let mut has_imports = false; - for imports in package_json.imports_fields(&self.options.imports_fields) { - if !has_imports { - has_imports = true; - // TODO: fill in test case for this case - if specifier == "#" || specifier.starts_with("#/") { - return Err(ResolveError::InvalidModuleSpecifier( - specifier.to_string(), - package_json.path.clone(), - )); - } - } - if let Some(path) = self.package_imports_exports_resolve( - specifier, - imports, - package_json.directory(), - /* is_imports */ true, - &self.options.condition_names, - ctx, - )? { - // 2. If resolved is not null or undefined, return resolved. - return Ok(Some(path)); - } - } - - // 5. Throw a Package Import Not Defined error. - if has_imports { - Err(ResolveError::PackageImportNotDefined( - specifier.to_string(), - package_json.path.clone(), - )) - } else { - Ok(None) - } - } - - /// PACKAGE_IMPORTS_EXPORTS_RESOLVE(matchKey, matchObj, packageURL, isImports, conditions) - fn package_imports_exports_resolve( - &self, - match_key: &str, - match_obj: &JSONMap, - package_url: &Path, - is_imports: bool, - conditions: &[String], - ctx: &mut Ctx, - ) -> ResolveResult { - // enhanced-resolve behaves differently, it throws - // Error: CachedPath to directories is not possible with the exports field (specifier was ./dist/) - if match_key.ends_with('/') { - return Ok(None); - } - // 1. If matchKey is a key of matchObj and does not contain "*", then - if !match_key.contains('*') { - // 1. Let target be the value of matchObj[matchKey]. - if let Some(target) = match_obj.get(match_key) { - // 2. Return the result of PACKAGE_TARGET_RESOLVE(packageURL, target, null, isImports, conditions). - return self.package_target_resolve( - package_url, - match_key, - target, - None, - is_imports, - conditions, - ctx, - ); - } - } - - let mut best_target = None; - let mut best_match = ""; - let mut best_key = ""; - // 2. Let expansionKeys be the list of keys of matchObj containing only a single "*", sorted by the sorting function PATTERN_KEY_COMPARE which orders in descending order of specificity. - // 3. For each key expansionKey in expansionKeys, do - for (expansion_key, target) in match_obj { - if expansion_key.starts_with("./") || expansion_key.starts_with('#') { - // 1. Let patternBase be the substring of expansionKey up to but excluding the first "*" character. - if let Some((pattern_base, pattern_trailer)) = expansion_key.split_once('*') { - // 2. If matchKey starts with but is not equal to patternBase, then - if match_key.starts_with(pattern_base) - // 1. Let patternTrailer be the substring of expansionKey from the index after the first "*" character. - && !pattern_trailer.contains('*') - // 2. If patternTrailer has zero length, or if matchKey ends with patternTrailer and the length of matchKey is greater than or equal to the length of expansionKey, then - && (pattern_trailer.is_empty() - || (match_key.len() >= expansion_key.len() - && match_key.ends_with(pattern_trailer))) - && Self::pattern_key_compare(best_key, expansion_key).is_gt() - { - // 1. Let target be the value of matchObj[expansionKey]. - best_target = Some(target); - // 2. Let patternMatch be the substring of matchKey starting at the index of the length of patternBase up to the length of matchKey minus the length of patternTrailer. - best_match = - &match_key[pattern_base.len()..match_key.len() - pattern_trailer.len()]; - best_key = expansion_key; - } - } else if expansion_key.ends_with('/') - && match_key.starts_with(expansion_key) - && Self::pattern_key_compare(best_key, expansion_key).is_gt() - { - // TODO: [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./dist/" in the "exports" field module resolution of the package at xxx/package.json. - best_target = Some(target); - best_match = &match_key[expansion_key.len()..]; - best_key = expansion_key; - } - } - } - if let Some(best_target) = best_target { - // 3. Return the result of PACKAGE_TARGET_RESOLVE(packageURL, target, patternMatch, isImports, conditions). - return self.package_target_resolve( - package_url, - best_key, - best_target, - Some(best_match), - is_imports, - conditions, - ctx, - ); - } - // 4. Return null. - Ok(None) - } - - /// PACKAGE_TARGET_RESOLVE(packageURL, target, patternMatch, isImports, conditions) - #[allow(clippy::too_many_arguments)] - fn package_target_resolve( - &self, - package_url: &Path, - target_key: &str, - target: &JSONValue, - pattern_match: Option<&str>, - is_imports: bool, - conditions: &[String], - ctx: &mut Ctx, - ) -> ResolveResult { - fn normalize_string_target<'a>( - target_key: &'a str, - target: &'a str, - pattern_match: Option<&'a str>, - package_url: &Path, - ) -> Result, ResolveError> { - let target = if let Some(pattern_match) = pattern_match { - if !target_key.contains('*') && !target.contains('*') { - // enhanced-resolve behaviour - // TODO: [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./dist/" in the "exports" field module resolution of the package at xxx/package.json. - if target_key.ends_with('/') && target.ends_with('/') { - Cow::Owned(format!("{target}{pattern_match}")) - } else { - return Err(ResolveError::InvalidPackageConfigDirectory( - package_url.join("package.json"), - )); - } - } else { - Cow::Owned(target.replace('*', pattern_match)) - } - } else { - Cow::Borrowed(target) - }; - Ok(target) - } - - match target { - // 1. If target is a String, then - JSONValue::String(target) => { - // 1. If target does not start with "./", then - if !target.starts_with("./") { - // 1. If isImports is false, or if target starts with "../" or "/", or if target is a valid URL, then - if !is_imports || target.starts_with("../") || target.starts_with('/') { - // 1. Throw an Invalid Package Target error. - return Err(ResolveError::InvalidPackageTarget( - target.to_string(), - target_key.to_string(), - package_url.join("package.json"), - )); - } - // 2. If patternMatch is a String, then - // 1. Return PACKAGE_RESOLVE(target with every instance of "*" replaced by patternMatch, packageURL + "/"). - let target = - normalize_string_target(target_key, target, pattern_match, package_url)?; - let package_url = self.cache.value(package_url); - // // 3. Return PACKAGE_RESOLVE(target, packageURL + "/"). - return self.package_resolve(&package_url, &target, ctx); - } - - // 2. If target split on "/" or "\" contains any "", ".", "..", or "node_modules" segments after the first "." segment, case insensitive and including percent encoded variants, throw an Invalid Package Target error. - // 3. Let resolvedTarget be the URL resolution of the concatenation of packageURL and target. - // 4. Assert: resolvedTarget is contained in packageURL. - // 5. If patternMatch is null, then - let target = - normalize_string_target(target_key, target, pattern_match, package_url)?; - if Path::new(target.as_ref()).is_invalid_exports_target() { - return Err(ResolveError::InvalidPackageTarget( - target.to_string(), - target_key.to_string(), - package_url.join("package.json"), - )); - } - let resolved_target = package_url.normalize_with(target.as_ref()); - // 6. If patternMatch split on "/" or "\" contains any "", ".", "..", or "node_modules" segments, case insensitive and including percent encoded variants, throw an Invalid Module Specifier error. - // 7. Return the URL resolution of resolvedTarget with every instance of "*" replaced with patternMatch. - let value = self.cache.value(&resolved_target); - return Ok(Some(value)); - } - // 2. Otherwise, if target is a non-null Object, then - JSONValue::Object(target) => { - // 1. If exports contains any index property keys, as defined in ECMA-262 6.1.7 Array Index, throw an Invalid Package Configuration error. - // 2. For each property p of target, in object insertion order as, - for (key, target_value) in target { - // 1. If p equals "default" or conditions contains an entry for p, then - if key == "default" || conditions.contains(key) { - // 1. Let targetValue be the value of the p property in target. - // 2. Let resolved be the result of PACKAGE_TARGET_RESOLVE( packageURL, targetValue, patternMatch, isImports, conditions). - let resolved = self.package_target_resolve( - package_url, - target_key, - target_value, - pattern_match, - is_imports, - conditions, - ctx, - ); - // 3. If resolved is equal to undefined, continue the loop. - if let Some(path) = resolved? { - // 4. Return resolved. - return Ok(Some(path)); - } - } - } - // 3. Return undefined. - return Ok(None); - } - // 3. Otherwise, if target is an Array, then - JSONValue::Array(targets) => { - // 1. If _target.length is zero, return null. - if targets.is_empty() { - // Note: return PackagePathNotExported has the same effect as return because there are no matches. - return Err(ResolveError::PackagePathNotExported( - pattern_match.unwrap_or(".").to_string(), - package_url.join("package.json"), - )); - } - // 2. For each item targetValue in target, do - for (i, target_value) in targets.iter().enumerate() { - // 1. Let resolved be the result of PACKAGE_TARGET_RESOLVE( packageURL, targetValue, patternMatch, isImports, conditions), continuing the loop on any Invalid Package Target error. - let resolved = self.package_target_resolve( - package_url, - target_key, - target_value, - pattern_match, - is_imports, - conditions, - ctx, - ); - - if resolved.is_err() && i == targets.len() { - return resolved; - } - - // 2. If resolved is undefined, continue the loop. - if let Ok(Some(path)) = resolved { - // 3. Return resolved. - return Ok(Some(path)); - } - } - // 3. Return or throw the last fallback resolution null return or error. - // Note: see `resolved.is_err() && i == targets.len()` - } - _ => {} - } - // 4. Otherwise, if target is null, return null. - Ok(None) - // 5. Otherwise throw an Invalid Package Target error. - } - - // Returns (module, subpath) - // https://github.com/nodejs/node/blob/8f0f17e1e3b6c4e58ce748e06343c5304062c491/lib/internal/modules/esm/resolve.js#L688 - fn parse_package_specifier(specifier: &str) -> (&str, &str) { - let mut separator_index = specifier.as_bytes().iter().position(|b| *b == b'/'); - // let mut valid_package_name = true; - // let mut is_scoped = false; - if specifier.starts_with('@') { - // is_scoped = true; - if separator_index.is_none() || specifier.is_empty() { - // valid_package_name = false; - } else if let Some(index) = &separator_index { - separator_index = specifier[*index + 1..] - .as_bytes() - .iter() - .position(|b| *b == b'/') - .map(|i| i + *index + 1); - } - } - let package_name = - separator_index.map_or(specifier, |separator_index| &specifier[..separator_index]); - - // TODO: https://github.com/nodejs/node/blob/8f0f17e1e3b6c4e58ce748e06343c5304062c491/lib/internal/modules/esm/resolve.js#L705C1-L714C1 - // Package name cannot have leading . and cannot have percent-encoding or - // \\ separators. - // if (RegExpPrototypeExec(invalidPackageNameRegEx, packageName) !== null) - // validPackageName = false; - - // if (!validPackageName) { - // throw new ERR_INVALID_MODULE_SPECIFIER( - // specifier, 'is not a valid package name', fileURLToPath(base)); - // } - let package_subpath = - separator_index.map_or("", |separator_index| &specifier[separator_index..]); - (package_name, package_subpath) - } - - /// PATTERN_KEY_COMPARE(keyA, keyB) - fn pattern_key_compare(key_a: &str, key_b: &str) -> Ordering { - if key_a.is_empty() { - return Ordering::Greater; - } - // 1. Assert: keyA ends with "/" or contains only a single "*". - debug_assert!(key_a.ends_with('/') || key_a.match_indices('*').count() == 1, "{key_a}"); - // 2. Assert: keyB ends with "/" or contains only a single "*". - debug_assert!(key_b.ends_with('/') || key_b.match_indices('*').count() == 1, "{key_b}"); - // 3. Let baseLengthA be the index of "*" in keyA plus one, if keyA contains "*", or the length of keyA otherwise. - let a_pos = key_a.chars().position(|c| c == '*'); - let base_length_a = a_pos.map_or(key_a.len(), |p| p + 1); - // 4. Let baseLengthB be the index of "*" in keyB plus one, if keyB contains "*", or the length of keyB otherwise. - let b_pos = key_b.chars().position(|c| c == '*'); - let base_length_b = b_pos.map_or(key_b.len(), |p| p + 1); - // 5. If baseLengthA is greater than baseLengthB, return -1. - if base_length_a > base_length_b { - return Ordering::Less; - } - // 6. If baseLengthB is greater than baseLengthA, return 1. - if base_length_b > base_length_a { - return Ordering::Greater; - } - // 7. If keyA does not contain "*", return 1. - if !key_a.contains('*') { - return Ordering::Greater; - } - // 8. If keyB does not contain "*", return -1. - if !key_b.contains('*') { - return Ordering::Less; - } - // 9. If the length of keyA is greater than the length of keyB, return -1. - if key_a.len() > key_b.len() { - return Ordering::Less; - } - // 10. If the length of keyB is greater than the length of keyA, return 1. - if key_b.len() > key_a.len() { - return Ordering::Greater; - } - // 11. Return 0. - Ordering::Equal - } - - fn strip_package_name<'a>(specifier: &'a str, package_name: &'a str) -> Option<&'a str> { - specifier - .strip_prefix(package_name) - .filter(|tail| tail.is_empty() || tail.starts_with(SLASH_START)) - } -} diff --git a/src/options.rs b/src/options.rs deleted file mode 100644 index f473a133..00000000 --- a/src/options.rs +++ /dev/null @@ -1,623 +0,0 @@ -use std::path::Path; -use std::{fmt, path::PathBuf}; - -/// Module Resolution Options -/// -/// Options are directly ported from [enhanced-resolve](https://github.com/webpack/enhanced-resolve#resolver-options). -/// -/// See [webpack resolve](https://webpack.js.org/configuration/resolve/) for information and examples -#[derive(Debug, Clone)] -pub struct ResolveOptions { - /// Path to TypeScript configuration file. - /// - /// Default `None` - pub tsconfig: Option, - - /// Create aliases to import or require certain modules more easily. - /// - /// An alias is used to replace a whole path or part of a path. - /// For example, to alias a commonly used `src/` folders: `vec![("@/src"), vec![AliasValue::Path("/path/to/src")]]` - /// - /// A trailing $ can also be added to the given object's keys to signify an exact match. - /// - /// See [webpack's `resolve.alias` documentation](https://webpack.js.org/configuration/resolve/#resolvealias) for a list of use cases. - pub alias: Alias, - - /// A list of alias fields in description files. - /// - /// Specify a field, such as `browser`, to be parsed according to [this specification](https://github.com/defunctzombie/package-browser-field-spec). - /// Can be a path to json object such as `["path", "to", "exports"]`. - /// - /// Default `[]` - pub alias_fields: Vec>, - - /// Condition names for exports field which defines entry points of a package. - /// - /// The key order in the exports field is significant. During condition matching, earlier entries have higher priority and take precedence over later entries. - /// - /// Default `[]` - pub condition_names: Vec, - - /// The JSON files to use for descriptions. (There was once a `bower.json`.) - /// - /// Default `["package.json"]` - pub description_files: Vec, - - /// Set to [EnforceExtension::Enabled] for [ESM Mandatory file extensions](https://nodejs.org/api/esm.html#mandatory-file-extensions). - /// - /// If `enforce_extension` is set to [EnforceExtension::Enabled], resolution will not allow extension-less files. - /// This means `require('./foo.js')` will resolve, while `require('./foo')` will not. - /// - /// The default value for `enforce_extension` is [EnforceExtension::Auto], which is changed upon initialization. - /// - /// It changes to [EnforceExtension::Enabled] if [ResolveOptions::extensions] contains an empty string; - /// otherwise, this value changes to [EnforceExtension::Disabled]. - /// - /// Explicitly set the value to [EnforceExtension::Disabled] to disable this automatic behavior. - /// - /// For reference, this behavior is aligned with `enhanced-resolve`. See . - pub enforce_extension: EnforceExtension, - - /// A list of exports fields in description files. - /// - /// Can be a path to a JSON object such as `["path", "to", "exports"]`. - /// - /// Default `[["exports"]]`. - pub exports_fields: Vec>, - - /// Fields from `package.json` which are used to provide the internal requests of a package - /// (requests starting with # are considered internal). - /// - /// Can be a path to a JSON object such as `["path", "to", "imports"]`. - /// - /// Default `[["imports"]]`. - pub imports_fields: Vec>, - - /// An object which maps extension to extension aliases. - /// - /// Default `{}` - pub extension_alias: Vec<(String, Vec)>, - - /// Attempt to resolve these extensions in order. - /// - /// If multiple files share the same name but have different extensions, - /// will resolve the one with the extension listed first in the array and skip the rest. - /// - /// All extensions must have a leading dot. - /// - /// Default `[".js", ".json", ".node"]` - pub extensions: Vec, - - /// Redirect module requests when normal resolving fails. - /// - /// Default `[]` - pub fallback: Alias, - - /// 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). - /// - /// See also webpack configuration [resolve.fullySpecified](https://webpack.js.org/configuration/module/#resolvefullyspecified) - /// - /// Default `false` - pub fully_specified: bool, - - /// A list of main fields in description files - /// - /// Default `["main"]`. - pub main_fields: Vec, - - /// The filename to be used while resolving directories. - /// - /// Default `["index"]` - pub main_files: Vec, - - /// A list of directories to resolve modules from, can be absolute path or folder name. - /// - /// Default `["node_modules"]` - pub modules: Vec, - - /// Resolve to a context instead of a file. - /// - /// Default `false` - pub resolve_to_context: bool, - - /// Prefer to resolve module requests as relative requests instead of using modules from node_modules directories. - /// - /// Default `false` - pub prefer_relative: bool, - - /// Prefer to resolve server-relative urls as absolute paths before falling back to resolve in ResolveOptions::roots. - /// - /// Default `false` - pub prefer_absolute: bool, - - /// A list of resolve restrictions to restrict the paths that a request can be resolved on. - /// - /// Default `[]` - pub restrictions: Vec, - - /// A list of directories where requests of server-relative URLs (starting with '/') are resolved. - /// On non-Windows systems these requests are resolved as an absolute path first. - /// - /// Default `[]` - pub roots: Vec, - - /// Whether to resolve symlinks to their symlinked location. - /// When enabled, symlinked resources are resolved to their real path, not their symlinked location. - /// Note that this may cause module resolution to fail when using tools that symlink packages (like npm link). - /// - /// Default `true` - pub symlinks: bool, - - /// Whether to parse [module.builtinModules](https://nodejs.org/api/module.html#modulebuiltinmodules) or not. - /// For example, "zlib" will throw [crate::ResolveError::Builtin] when set to true. - /// - /// Default `false` - pub builtin_modules: bool, -} - -impl ResolveOptions { - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// - /// let options = ResolveOptions::default().with_condition_names(&["bar"]); - /// assert_eq!(options.condition_names, vec!["bar".to_string()]) - /// ``` - #[must_use] - pub fn with_condition_names(mut self, names: &[&str]) -> Self { - self.condition_names = names.iter().map(ToString::to_string).collect::>(); - self - } - - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// - /// let options = ResolveOptions::default().with_builtin_modules(false); - /// assert_eq!(options.builtin_modules, false) - /// ``` - #[must_use] - pub fn with_builtin_modules(mut self, flag: bool) -> Self { - self.builtin_modules = flag; - self - } - - /// Adds a single root to the options - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_root("foo"); - /// assert_eq!(options.roots, vec![PathBuf::from("foo")]) - /// ``` - #[must_use] - pub fn with_root>(mut self, root: P) -> Self { - self.roots.push(root.as_ref().to_path_buf()); - self - } - - /// Adds a single extension to the list of extensions - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_extension("jsonc"); - /// assert!(options.extensions.contains(&"jsonc".to_string())); - /// ``` - #[must_use] - pub fn with_extension>(mut self, extension: S) -> Self { - self.extensions.push(extension.into()); - self - } - - /// Adds a single main field to the list of fields - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_main_field("something"); - /// assert!(options.main_fields.contains(&"something".to_string())); - /// ``` - #[must_use] - pub fn with_main_field>(mut self, field: S) -> Self { - self.main_fields.push(field.into()); - self - } - - /// Changes how the extension should be treated - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions, EnforceExtension}; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_force_extension(EnforceExtension::Enabled); - /// assert_eq!(options.enforce_extension, EnforceExtension::Enabled); - /// ``` - #[must_use] - pub fn with_force_extension(mut self, enforce_extension: EnforceExtension) -> Self { - self.enforce_extension = enforce_extension; - self - } - - /// Sets the value for [ResolveOptions::fully_specified] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_fully_specified(true); - /// assert_eq!(options.fully_specified, true); - /// ``` - #[must_use] - pub fn with_fully_specified(mut self, fully_specified: bool) -> Self { - self.fully_specified = fully_specified; - self - } - /// Sets the value for [ResolveOptions::prefer_relative] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_prefer_relative(true); - /// assert_eq!(options.prefer_relative, true); - /// ``` - #[must_use] - pub fn with_prefer_relative(mut self, flag: bool) -> Self { - self.prefer_relative = flag; - self - } - /// Sets the value for [ResolveOptions::prefer_absolute] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_prefer_absolute(true); - /// assert_eq!(options.prefer_absolute, true); - /// ``` - #[must_use] - pub fn with_prefer_absolute(mut self, flag: bool) -> Self { - self.prefer_absolute = flag; - self - } - - /// Changes the value of [ResolveOptions::symlinks] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// - /// let options = ResolveOptions::default().with_symbolic_link(false); - /// assert_eq!(options.symlinks, false); - /// ``` - #[must_use] - pub fn with_symbolic_link(mut self, flag: bool) -> Self { - self.symlinks = flag; - self - } - - /// Adds a module to [ResolveOptions::modules] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// - /// let options = ResolveOptions::default().with_module("module"); - /// assert!(options.modules.contains(&"module".to_string())); - /// ``` - #[must_use] - pub fn with_module>(mut self, module: M) -> Self { - self.modules.push(module.into()); - self - } - - /// Adds a main file to [ResolveOptions::main_files] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// - /// let options = ResolveOptions::default().with_main_file("foo"); - /// assert!(options.main_files.contains(&"foo".to_string())); - /// ``` - #[must_use] - pub fn with_main_file>(mut self, module: M) -> Self { - self.main_files.push(module.into()); - self - } - - pub(crate) fn sanitize(mut self) -> Self { - debug_assert!( - self.extensions.iter().filter(|e| !e.is_empty()).all(|e| e.starts_with('.')), - "All extensions must start with a leading dot" - ); - // Set `enforceExtension` to `true` when [ResolveOptions::extensions] contains an empty string. - // See - if self.enforce_extension == EnforceExtension::Auto { - if !self.extensions.is_empty() && self.extensions.iter().any(String::is_empty) { - self.enforce_extension = EnforceExtension::Enabled; - } else { - self.enforce_extension = EnforceExtension::Disabled; - } - } - self - } -} - -/// Value for [ResolveOptions::enforce_extension] -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -pub enum EnforceExtension { - Auto, - Enabled, - Disabled, -} - -impl EnforceExtension { - pub const fn is_auto(&self) -> bool { - matches!(self, Self::Auto) - } - - pub const fn is_enabled(&self) -> bool { - matches!(self, Self::Enabled) - } - - pub const fn is_disabled(&self) -> bool { - matches!(self, Self::Disabled) - } -} - -/// Alias for [ResolveOptions::alias] and [ResolveOptions::fallback] -pub type Alias = Vec<(String, Vec)>; - -/// Alias Value for [ResolveOptions::alias] and [ResolveOptions::fallback] -#[derive(Debug, Clone, Hash, PartialEq, Eq)] -pub enum AliasValue { - /// The path value - Path(String), - - /// The `false` value - Ignore, -} - -impl From for AliasValue -where - S: Into, -{ - fn from(value: S) -> Self { - Self::Path(value.into()) - } -} - -/// Value for [ResolveOptions::restrictions] -#[derive(Debug, Clone)] -pub enum Restriction { - Path(PathBuf), - RegExp(String), -} - -/// Tsconfig Options for [ResolveOptions::tsconfig] -/// -/// Derived from [tsconfig-paths-webpack-plugin](https://github.com/dividab/tsconfig-paths-webpack-plugin#options) -#[derive(Debug, Clone)] -pub struct TsconfigOptions { - /// Allows you to specify where to find the TypeScript configuration file. - /// You may provide - /// * a relative path to the configuration file. It will be resolved relative to cwd. - /// * an absolute path to the configuration file. - pub config_file: PathBuf, - - /// Support for Typescript Project References. - pub references: TsconfigReferences, -} - -/// Configuration for [TsconfigOptions::references] -#[derive(Debug, Clone)] -pub enum TsconfigReferences { - Disabled, - /// Use the `references` field from tsconfig of `config_file`. - Auto, - /// Manually provided relative or absolute path. - Paths(Vec), -} - -impl Default for ResolveOptions { - fn default() -> Self { - Self { - tsconfig: None, - alias: vec![], - alias_fields: vec![], - condition_names: vec![], - description_files: vec!["package.json".into()], - enforce_extension: EnforceExtension::Auto, - extension_alias: vec![], - exports_fields: vec![vec!["exports".into()]], - imports_fields: vec![vec!["imports".into()]], - extensions: vec![".js".into(), ".json".into(), ".node".into()], - fallback: vec![], - fully_specified: false, - main_fields: vec!["main".into()], - main_files: vec!["index".into()], - modules: vec!["node_modules".into()], - resolve_to_context: false, - prefer_relative: false, - prefer_absolute: false, - restrictions: vec![], - roots: vec![], - symlinks: true, - builtin_modules: false, - } - } -} - -// For tracing -impl fmt::Display for ResolveOptions { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - if let Some(tsconfig) = &self.tsconfig { - write!(f, "tsconfig:{tsconfig:?},")?; - } - if !self.alias.is_empty() { - write!(f, "alias:{:?},", self.alias)?; - } - if !self.alias_fields.is_empty() { - write!(f, "alias_fields:{:?},", self.alias_fields)?; - } - if !self.condition_names.is_empty() { - write!(f, "condition_names:{:?},", self.condition_names)?; - } - if self.enforce_extension.is_enabled() { - write!(f, "enforce_extension:{:?},", self.enforce_extension)?; - } - if !self.exports_fields.is_empty() { - write!(f, "exports_fields:{:?},", self.exports_fields)?; - } - if !self.imports_fields.is_empty() { - write!(f, "imports_fields:{:?},", self.imports_fields)?; - } - if !self.extension_alias.is_empty() { - write!(f, "extension_alias:{:?},", self.extension_alias)?; - } - if !self.extensions.is_empty() { - write!(f, "extensions:{:?},", self.extensions)?; - } - if !self.fallback.is_empty() { - write!(f, "fallback:{:?},", self.fallback)?; - } - if self.fully_specified { - write!(f, "fully_specified:{:?},", self.fully_specified)?; - } - if !self.main_fields.is_empty() { - write!(f, "main_fields:{:?},", self.main_fields)?; - } - if !self.main_files.is_empty() { - write!(f, "main_files:{:?},", self.main_files)?; - } - if !self.modules.is_empty() { - write!(f, "modules:{:?},", self.modules)?; - } - if self.resolve_to_context { - write!(f, "resolve_to_context:{:?},", self.resolve_to_context)?; - } - if self.prefer_relative { - write!(f, "prefer_relative:{:?},", self.prefer_relative)?; - } - if self.prefer_absolute { - write!(f, "prefer_absolute:{:?},", self.prefer_absolute)?; - } - if !self.restrictions.is_empty() { - write!(f, "restrictions:{:?},", self.restrictions)?; - } - if !self.roots.is_empty() { - write!(f, "roots:{:?},", self.roots)?; - } - if self.symlinks { - write!(f, "symlinks:{:?},", self.symlinks)?; - } - if self.builtin_modules { - write!(f, "builtin_modules:{:?},", self.builtin_modules)?; - } - Ok(()) - } -} - -#[cfg(test)] -mod test { - use super::{ - AliasValue, EnforceExtension, ResolveOptions, Restriction, TsconfigOptions, - TsconfigReferences, - }; - use std::path::PathBuf; - - #[test] - fn enforce_extension() { - assert!(EnforceExtension::Auto.is_auto()); - assert!(!EnforceExtension::Enabled.is_auto()); - assert!(!EnforceExtension::Disabled.is_auto()); - - assert!(!EnforceExtension::Auto.is_enabled()); - assert!(EnforceExtension::Enabled.is_enabled()); - assert!(!EnforceExtension::Disabled.is_enabled()); - - assert!(!EnforceExtension::Auto.is_disabled()); - assert!(!EnforceExtension::Enabled.is_disabled()); - assert!(EnforceExtension::Disabled.is_disabled()); - } - - #[test] - fn display() { - let options = ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: PathBuf::from("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - alias: vec![("a".into(), vec![AliasValue::Ignore])], - alias_fields: vec![vec!["browser".into()]], - condition_names: vec!["require".into()], - enforce_extension: EnforceExtension::Enabled, - extension_alias: vec![(".js".into(), vec![".ts".into()])], - exports_fields: vec![vec!["exports".into()]], - imports_fields: vec![vec!["imports".into()]], - fallback: vec![("fallback".into(), vec![AliasValue::Ignore])], - fully_specified: true, - resolve_to_context: true, - prefer_relative: true, - prefer_absolute: true, - restrictions: vec![Restriction::Path(PathBuf::from("restrictions"))], - roots: vec![PathBuf::from("roots")], - builtin_modules: true, - ..ResolveOptions::default() - }; - - let expected = r#"tsconfig:TsconfigOptions { config_file: "tsconfig.json", references: Auto },alias:[("a", [Ignore])],alias_fields:[["browser"]],condition_names:["require"],enforce_extension:Enabled,exports_fields:[["exports"]],imports_fields:[["imports"]],extension_alias:[(".js", [".ts"])],extensions:[".js", ".json", ".node"],fallback:[("fallback", [Ignore])],fully_specified:true,main_fields:["main"],main_files:["index"],modules:["node_modules"],resolve_to_context:true,prefer_relative:true,prefer_absolute:true,restrictions:[Path("restrictions")],roots:["roots"],symlinks:true,builtin_modules:true,"#; - assert_eq!(format!("{options}"), expected); - - let options = ResolveOptions { - alias: vec![], - alias_fields: vec![], - builtin_modules: false, - condition_names: vec![], - description_files: vec![], - enforce_extension: EnforceExtension::Disabled, - exports_fields: vec![], - extension_alias: vec![], - extensions: vec![], - fallback: vec![], - fully_specified: false, - imports_fields: vec![], - main_fields: vec![], - main_files: vec![], - modules: vec![], - prefer_absolute: false, - prefer_relative: false, - resolve_to_context: false, - restrictions: vec![], - roots: vec![], - symlinks: false, - tsconfig: None, - }; - - assert_eq!(format!("{options}"), ""); - } -} diff --git a/src/package_json.rs b/src/package_json.rs deleted file mode 100644 index 7e05d202..00000000 --- a/src/package_json.rs +++ /dev/null @@ -1,219 +0,0 @@ -//! package.json definitions -//! -//! Code related to export field are copied from [Parcel's resolver](https://github.com/parcel-bundler/parcel/blob/v2/packages/utils/node-resolver-rs/src/package_json.rs) -use std::path::{Path, PathBuf}; - -use serde_json::Value as JSONValue; - -use crate::{path::PathUtil, ResolveError}; - -pub type JSONMap = serde_json::Map; - -/// Deserialized package.json -#[derive(Debug, Default)] -pub struct PackageJson { - /// Path to `package.json`. Contains the `package.json` filename. - pub path: PathBuf, - - /// Realpath to `package.json`. Contains the `package.json` filename. - pub realpath: PathBuf, - - /// The "name" field defines your package's name. - /// The "name" field can be used in addition to the "exports" field to self-reference a package using its name. - /// - /// - pub name: Option, - - /// The "type" field. - /// - /// - pub r#type: Option, - - /// The "sideEffects" field. - /// - /// - pub side_effects: Option, - - raw_json: std::sync::Arc, -} - -impl PackageJson { - /// # Panics - /// # Errors - pub(crate) fn parse( - path: PathBuf, - realpath: PathBuf, - json: &str, - ) -> Result { - let mut raw_json: JSONValue = serde_json::from_str(json)?; - let mut package_json = Self::default(); - - if let Some(json_object) = raw_json.as_object_mut() { - // Remove large fields that are useless for pragmatic use. - #[cfg(feature = "package_json_raw_json_api")] - { - json_object.remove("description"); - json_object.remove("keywords"); - json_object.remove("scripts"); - json_object.remove("dependencies"); - json_object.remove("devDependencies"); - json_object.remove("peerDependencies"); - json_object.remove("optionalDependencies"); - } - - // Add name, type and sideEffects. - package_json.name = - json_object.get("name").and_then(|field| field.as_str()).map(ToString::to_string); - package_json.r#type = json_object.get("type").cloned(); - package_json.side_effects = json_object.get("sideEffects").cloned(); - } - - package_json.path = path; - package_json.realpath = realpath; - package_json.raw_json = std::sync::Arc::new(raw_json); - Ok(package_json) - } - - fn get_value_by_path<'a>( - fields: &'a serde_json::Map, - path: &[String], - ) -> Option<&'a JSONValue> { - if path.is_empty() { - return None; - } - let mut value = fields.get(&path[0])?; - for key in path.iter().skip(1) { - if let Some(inner_value) = value.as_object().and_then(|o| o.get(key)) { - value = inner_value; - } else { - return None; - } - } - Some(value) - } - - /// Raw serde json value of `package.json`. - /// - /// This is currently used in Rspack for: - /// * getting the `sideEffects` field - /// * query in - search on GitHub indicates query on the `type` field. - /// - /// To reduce overall memory consumption, large fields that useless for pragmatic use are removed. - /// They are: `description`, `keywords`, `scripts`, - /// `dependencies` and `devDependencies`, `peerDependencies`, `optionalDependencies`. - #[cfg(feature = "package_json_raw_json_api")] - pub fn raw_json(&self) -> &std::sync::Arc { - &self.raw_json - } - - /// Directory to `package.json` - /// - /// # Panics - /// - /// * When the package.json path is misconfigured. - pub fn directory(&self) -> &Path { - debug_assert!(self.realpath.file_name().is_some_and(|x| x == "package.json")); - self.realpath.parent().unwrap() - } - - /// The "main" field defines the entry point of a package when imported by name via a node_modules lookup. Its value is a path. - /// - /// When a package has an "exports" field, this will take precedence over the "main" field when importing the package by name. - /// - /// Values are dynamically retrieved from [ResolveOptions::main_fields]. - /// - /// - pub(crate) fn main_fields<'a>( - &'a self, - main_fields: &'a [String], - ) -> impl Iterator + '_ { - main_fields - .iter() - .filter_map(|main_field| self.raw_json.get(main_field)) - .filter_map(|value| value.as_str()) - } - - /// The "exports" field allows defining the entry points of a package when imported by name loaded either via a node_modules lookup or a self-reference to its own name. - /// - /// - pub(crate) fn exports_fields<'a>( - &'a self, - exports_fields: &'a [Vec], - ) -> impl Iterator + '_ { - exports_fields.iter().filter_map(|object_path| { - self.raw_json - .as_object() - .and_then(|json_object| Self::get_value_by_path(json_object, object_path)) - }) - } - - /// In addition to the "exports" field, there is a package "imports" field to create private mappings that only apply to import specifiers from within the package itself. - /// - /// - pub(crate) fn imports_fields<'a>( - &'a self, - imports_fields: &'a [Vec], - ) -> impl Iterator + '_ { - imports_fields.iter().filter_map(|object_path| { - self.raw_json - .as_object() - .and_then(|json_object| Self::get_value_by_path(json_object, object_path)) - .and_then(|value| value.as_object()) - }) - } - - /// The "browser" field is provided by a module author as a hint to javascript bundlers or component tools when packaging modules for client side use. - /// Multiple values are configured by [ResolveOptions::alias_fields]. - /// - /// - fn browser_fields<'a>( - &'a self, - alias_fields: &'a [Vec], - ) -> impl Iterator + '_ { - alias_fields.iter().filter_map(|object_path| { - self.raw_json - .as_object() - .and_then(|json_object| Self::get_value_by_path(json_object, object_path)) - // Only object is valid, all other types are invalid - // https://github.com/webpack/enhanced-resolve/blob/3a28f47788de794d9da4d1702a3a583d8422cd48/lib/AliasFieldPlugin.js#L44-L52 - .and_then(|value| value.as_object()) - }) - } - - /// Resolve the request string for this package.json by looking at the `browser` field. - /// - /// # Errors - /// - /// * Returns [ResolveError::Ignored] for `"path": false` in `browser` field. - pub(crate) fn resolve_browser_field<'a>( - &'a self, - path: &Path, - request: Option<&str>, - alias_fields: &'a [Vec], - ) -> Result, ResolveError> { - for object in self.browser_fields(alias_fields) { - if let Some(request) = request { - if let Some(value) = object.get(request) { - return Self::alias_value(path, value); - } - } else { - let dir = self.path.parent().unwrap(); - for (key, value) in object { - let joined = dir.normalize_with(key); - if joined == path { - return Self::alias_value(path, value); - } - } - } - } - Ok(None) - } - - fn alias_value<'a>(key: &Path, value: &'a JSONValue) -> Result, ResolveError> { - match value { - JSONValue::String(value) => Ok(Some(value.as_str())), - JSONValue::Bool(b) if !b => Err(ResolveError::Ignored(key.to_path_buf())), - _ => Ok(None), - } - } -} diff --git a/src/path.rs b/src/path.rs deleted file mode 100644 index f66fdd76..00000000 --- a/src/path.rs +++ /dev/null @@ -1,132 +0,0 @@ -//! Path Utilities -//! -//! Code adapted from the following libraries -//! * [path-absolutize](https://docs.rs/path-absolutize) -//! * [normalize_path](https://docs.rs/normalize-path) -use std::path::{Component, Path, PathBuf}; - -pub const SLASH_START: &[char; 2] = &['/', '\\']; - -/// Extension trait to add path normalization to std's [`Path`]. -pub trait PathUtil { - /// Normalize this path without performing I/O. - /// - /// All redundant separator and up-level references are collapsed. - /// - /// However, this does not resolve links. - fn normalize(&self) -> PathBuf; - - /// Normalize with subpath assuming this path is normalized without performing I/O. - /// - /// All redundant separator and up-level references are collapsed. - /// - /// However, this does not resolve links. - fn normalize_with>(&self, subpath: P) -> PathBuf; - - /// Defined in ESM PACKAGE_TARGET_RESOLVE - /// If target split on "/" or "\" contains any "", ".", "..", or "node_modules" segments after the first "." segment, case insensitive and including percent encoded variants - fn is_invalid_exports_target(&self) -> bool; -} - -impl PathUtil for Path { - // https://github.com/parcel-bundler/parcel/blob/e0b99c2a42e9109a9ecbd6f537844a1b33e7faf5/packages/utils/node-resolver-rs/src/path.rs#L7 - fn normalize(&self) -> PathBuf { - let mut components = self.components().peekable(); - let mut ret = if let Some(c @ Component::Prefix(..)) = components.peek() { - let buf = PathBuf::from(c.as_os_str()); - components.next(); - buf - } else { - PathBuf::new() - }; - - for component in components { - match component { - Component::Prefix(..) => unreachable!("Path {:?}", self), - Component::RootDir => { - ret.push(component.as_os_str()); - } - Component::CurDir => {} - Component::ParentDir => { - ret.pop(); - } - Component::Normal(c) => { - ret.push(c); - } - } - } - - ret - } - - // https://github.com/parcel-bundler/parcel/blob/e0b99c2a42e9109a9ecbd6f537844a1b33e7faf5/packages/utils/node-resolver-rs/src/path.rs#L37 - fn normalize_with>(&self, subpath: B) -> PathBuf { - let subpath = subpath.as_ref(); - - let mut components = subpath.components(); - - let Some(head) = components.next() else { return subpath.to_path_buf() }; - - if matches!(head, Component::Prefix(..) | Component::RootDir) { - return subpath.to_path_buf(); - } - - let mut ret = self.to_path_buf(); - for component in std::iter::once(head).chain(components) { - match component { - Component::CurDir => {} - Component::ParentDir => { - ret.pop(); - } - Component::Normal(c) => { - ret.push(c); - } - Component::Prefix(..) | Component::RootDir => { - unreachable!("Path {:?} Subpath {:?}", self, subpath) - } - } - } - - ret - } - - fn is_invalid_exports_target(&self) -> bool { - self.components().enumerate().any(|(index, c)| match c { - Component::ParentDir => true, - Component::CurDir => index > 0, - Component::Normal(c) => c.eq_ignore_ascii_case("node_modules"), - _ => false, - }) - } -} - -// https://github.com/webpack/enhanced-resolve/blob/main/test/path.test.js -#[test] -fn is_invalid_exports_target() { - let test_cases = [ - "../a.js", - "../", - "./a/b/../../../c.js", - "./a/b/../../../", - "./../../c.js", - "./../../", - "./a/../b/../../c.js", - "./a/../b/../../", - "./././../", - ]; - - for case in test_cases { - assert!(Path::new(case).is_invalid_exports_target(), "{case}"); - } - - assert!(!Path::new("C:").is_invalid_exports_target()); - assert!(!Path::new("/").is_invalid_exports_target()); -} - -#[test] -fn normalize() { - assert_eq!(Path::new("/foo/.././foo/").normalize(), Path::new("/foo")); - assert_eq!(Path::new("C://").normalize(), Path::new("C://")); - assert_eq!(Path::new("C:").normalize(), Path::new("C:")); - assert_eq!(Path::new(r"\\server\share").normalize(), Path::new(r"\\server\share")); -} diff --git a/src/resolution.rs b/src/resolution.rs deleted file mode 100644 index a3aaa2e7..00000000 --- a/src/resolution.rs +++ /dev/null @@ -1,92 +0,0 @@ -use crate::package_json::PackageJson; -use std::{ - fmt, - path::{Path, PathBuf}, - sync::Arc, -}; - -/// The final path resolution with optional `?query` and `#fragment` -#[derive(Clone)] -pub struct Resolution { - pub(crate) path: PathBuf, - - /// path query `?query`, contains `?`. - pub(crate) query: Option, - - /// path fragment `#query`, contains `#`. - pub(crate) fragment: Option, - - pub(crate) package_json: Option>, -} - -impl fmt::Debug for Resolution { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - f.debug_struct("Resolution") - .field("path", &self.path) - .field("query", &self.query) - .field("fragment", &self.fragment) - .field("package_json", &self.package_json.as_ref().map(|p| &p.path)) - .finish() - } -} - -impl PartialEq for Resolution { - fn eq(&self, other: &Self) -> bool { - self.path == other.path && self.query == other.query && self.fragment == other.fragment - } -} -impl Eq for Resolution {} - -impl Resolution { - /// Returns the path without query and fragment - pub fn path(&self) -> &Path { - &self.path - } - - /// Returns the path without query and fragment - pub fn into_path_buf(self) -> PathBuf { - self.path - } - - /// Returns the path query `?query`, contains the leading `?` - pub fn query(&self) -> Option<&str> { - self.query.as_deref() - } - - /// Returns the path fragment `#fragment`, contains the leading `#` - pub fn fragment(&self) -> Option<&str> { - self.fragment.as_deref() - } - - /// Returns serialized package_json - pub fn package_json(&self) -> Option<&Arc> { - self.package_json.as_ref() - } - - /// Returns the full path with query and fragment - pub fn full_path(&self) -> PathBuf { - let mut path = self.path.clone().into_os_string(); - if let Some(query) = &self.query { - path.push(query); - } - if let Some(fragment) = &self.fragment { - path.push(fragment); - } - PathBuf::from(path) - } -} - -#[test] -fn test() { - let resolution = Resolution { - path: PathBuf::from("foo"), - query: Some("?query".to_string()), - fragment: Some("#fragment".to_string()), - package_json: None, - }; - assert_eq!(resolution.path(), Path::new("foo")); - assert_eq!(resolution.query(), Some("?query")); - assert_eq!(resolution.fragment(), Some("#fragment")); - assert_eq!(resolution.full_path(), PathBuf::from("foo?query#fragment")); - assert_eq!(resolution.into_path_buf(), PathBuf::from("foo")); -} diff --git a/src/specifier.rs b/src/specifier.rs deleted file mode 100644 index 73ed038c..00000000 --- a/src/specifier.rs +++ /dev/null @@ -1,230 +0,0 @@ -use crate::error::SpecifierError; -use std::borrow::Cow; - -#[derive(Debug)] -pub struct Specifier<'a> { - path: Cow<'a, str>, - pub query: Option<&'a str>, - pub fragment: Option<&'a str>, -} - -impl<'a> Specifier<'a> { - pub fn path(&'a self) -> &'a str { - self.path.as_ref() - } - - pub fn parse(specifier: &'a str) -> Result { - if specifier.is_empty() { - return Err(SpecifierError::Empty(specifier.to_string())); - } - let offset = match specifier.as_bytes()[0] { - b'/' | b'.' | b'#' => 1, - _ => 0, - }; - let (path, query, fragment) = Self::parse_query_framgment(specifier, offset); - if path.is_empty() { - return Err(SpecifierError::Empty(specifier.to_string())); - } - Ok(Self { path, query, fragment }) - } - - fn parse_query_framgment( - specifier: &'a str, - skip: usize, - ) -> (Cow<'a, str>, Option<&str>, Option<&str>) { - let mut query_start: Option = None; - let mut fragment_start: Option = None; - - let mut prev = specifier.chars().next().unwrap(); - let mut escaped_indexes = vec![]; - for (i, c) in specifier.char_indices().skip(skip) { - if c == '?' && query_start.is_none() { - query_start = Some(i); - } - if c == '#' { - if prev == '\0' { - escaped_indexes.push(i - 1); - } else { - fragment_start = Some(i); - break; - } - } - prev = c; - } - - let (path, query, fragment) = match (query_start, fragment_start) { - (Some(i), Some(j)) => { - debug_assert!(i < j); - (&specifier[..i], Some(&specifier[i..j]), Some(&specifier[j..])) - } - (Some(i), None) => (&specifier[..i], Some(&specifier[i..]), None), - (None, Some(j)) => (&specifier[..j], None, Some(&specifier[j..])), - _ => (specifier, None, None), - }; - - let path = if escaped_indexes.is_empty() { - Cow::Borrowed(path) - } else { - // Remove the `\0` characters for a legal path. - Cow::Owned( - path.chars() - .enumerate() - .filter_map(|(i, c)| (!escaped_indexes.contains(&i)).then_some(c)) - .collect::(), - ) - }; - - (path, query, fragment) - } -} - -#[cfg(test)] -mod tests { - use super::{Specifier, SpecifierError}; - - #[test] - fn debug() { - let specifier = Specifier::parse("/").unwrap(); - assert_eq!( - format!("{specifier:?}"), - r#"Specifier { path: "/", query: None, fragment: None }"# - ); - } - - #[test] - fn empty() { - let specifiers = ["", "?"]; - for specifier in specifiers { - let error = Specifier::parse(specifier).unwrap_err(); - assert_eq!(error, SpecifierError::Empty(specifier.to_string())); - } - } - - #[test] - fn absolute() -> Result<(), SpecifierError> { - let specifier = "/test?#"; - let parsed = Specifier::parse(specifier)?; - assert_eq!(parsed.path, "/test"); - assert_eq!(parsed.query, Some("?")); - assert_eq!(parsed.fragment, Some("#")); - Ok(()) - } - - #[test] - fn relative() -> Result<(), SpecifierError> { - let specifiers = ["./test", "../test", "../../test"]; - for specifier in specifiers { - let mut r = specifier.to_string(); - r.push_str("?#"); - let parsed = Specifier::parse(&r)?; - assert_eq!(parsed.path, specifier); - assert_eq!(parsed.query, Some("?")); - assert_eq!(parsed.fragment, Some("#")); - } - Ok(()) - } - - #[test] - fn hash() -> Result<(), SpecifierError> { - let specifiers = ["#", "#path"]; - for specifier in specifiers { - let mut r = specifier.to_string(); - r.push_str("?#"); - let parsed = Specifier::parse(&r)?; - assert_eq!(parsed.path, specifier); - assert_eq!(parsed.query, Some("?")); - assert_eq!(parsed.fragment, Some("#")); - } - Ok(()) - } - - #[test] - fn module() -> Result<(), SpecifierError> { - let specifiers = ["module"]; - for specifier in specifiers { - let mut r = specifier.to_string(); - r.push_str("?#"); - let parsed = Specifier::parse(&r)?; - assert_eq!(parsed.path, specifier); - assert_eq!(parsed.query, Some("?")); - assert_eq!(parsed.fragment, Some("#")); - } - Ok(()) - } - - #[test] - fn query_fragment() -> Result<(), SpecifierError> { - let data = [ - ("a?", Some("?"), None), - ("a?query", Some("?query"), None), - ("a?query1?query2", Some("?query1?query2"), None), - ("a?query1?query2?query3", Some("?query1?query2?query3"), None), - ("a#", None, Some("#")), - ("a#b#c", None, Some("#b#c")), - ("a#fragment", None, Some("#fragment")), - ("a?#", Some("?"), Some("#")), - ("a?#fragment", Some("?"), Some("#fragment")), - ("a?query#", Some("?query"), Some("#")), - ("a?query#fragment", Some("?query"), Some("#fragment")), - ("a#fragment?", None, Some("#fragment?")), - ("a#fragment?query", None, Some("#fragment?query")), - ]; - - for (specifier_str, query, fragment) in data { - let specifier = Specifier::parse(specifier_str)?; - assert_eq!(specifier.path, "a", "{specifier_str}"); - assert_eq!(specifier.query, query, "{specifier_str}"); - assert_eq!(specifier.fragment, fragment, "{specifier_str}"); - } - - Ok(()) - } - - #[test] - // https://github.com/webpack/enhanced-resolve/blob/main/test/identifier.test.js - fn enhanced_resolve_edge_cases() -> Result<(), SpecifierError> { - let data = [ - ("path/#", "path/", "", "#"), - ("path/as/?", "path/as/", "?", ""), - ("path/#/?", "path/", "", "#/?"), - ("path/#repo#hash", "path/", "", "#repo#hash"), - ("path/#r#hash", "path/", "", "#r#hash"), - ("path/#repo/#repo2#hash", "path/", "", "#repo/#repo2#hash"), - ("path/#r/#r#hash", "path/", "", "#r/#r#hash"), - ("path/#/not/a/hash?not-a-query", "path/", "", "#/not/a/hash?not-a-query"), - ]; - - for (specifier_str, path, query, fragment) in data { - let specifier = Specifier::parse(specifier_str)?; - assert_eq!(specifier.path, path, "{specifier_str}"); - assert_eq!(specifier.query.unwrap_or(""), query, "{specifier_str}"); - assert_eq!(specifier.fragment.unwrap_or(""), fragment, "{specifier_str}"); - } - - Ok(()) - } - - // https://github.com/webpack/enhanced-resolve/blob/main/test/identifier.test.js - #[test] - fn enhanced_resolve_windows_like() -> Result<(), SpecifierError> { - let data = [ - ("path\\#", "path\\", "", "#"), - ("path\\as\\?", "path\\as\\", "?", ""), - ("path\\#\\?", "path\\", "", "#\\?"), - ("path\\#repo#hash", "path\\", "", "#repo#hash"), - ("path\\#r#hash", "path\\", "", "#r#hash"), - ("path\\#repo\\#repo2#hash", "path\\", "", "#repo\\#repo2#hash"), - ("path\\#r\\#r#hash", "path\\", "", "#r\\#r#hash"), - ("path\\#/not/a/hash?not-a-query", "path\\", "", "#/not/a/hash?not-a-query"), - ]; - - for (specifier_str, path, query, fragment) in data { - let specifier = Specifier::parse(specifier_str)?; - assert_eq!(specifier.path, path, "{specifier_str}"); - assert_eq!(specifier.query.unwrap_or(""), query, "{specifier_str}"); - assert_eq!(specifier.fragment.unwrap_or(""), fragment, "{specifier_str}"); - } - - Ok(()) - } -} diff --git a/src/tests/alias.rs b/src/tests/alias.rs deleted file mode 100644 index 07c615f4..00000000 --- a/src/tests/alias.rs +++ /dev/null @@ -1,280 +0,0 @@ -//! - -use normalize_path::NormalizePath; -use std::path::Path; - -use crate::{AliasValue, Resolution, ResolveContext, ResolveError, ResolveOptions, Resolver}; - -#[test] -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -fn alias() { - use super::memory_fs::MemoryFS; - use crate::ResolverGeneric; - use std::path::{Path, PathBuf}; - - let f = Path::new("/"); - - let file_system = MemoryFS::new(&[ - ("/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", ""), - ("/dashed-name", ""), - ]); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - alias: vec![ - ("aliasA".into(), vec![AliasValue::from("a")]), - ("b$".into(), vec![AliasValue::from("a/index")]), - ("c$".into(), vec![AliasValue::from("/a/index")]), - ( - "multiAlias".into(), - vec![ - AliasValue::from("b"), - AliasValue::from("c"), - AliasValue::from("d"), - AliasValue::from("e"), - AliasValue::from("a"), - ], - ), - ("recursive".into(), vec![AliasValue::from("recursive/dir")]), - ("/d/dir".into(), vec![AliasValue::from("/c/dir")]), - ("/d/index.js".into(), vec![AliasValue::from("/c/index")]), - ("#".into(), vec![AliasValue::from("/c/dir")]), - ("@".into(), vec![AliasValue::from("/c/dir")]), - ("ignored".into(), vec![AliasValue::Ignore]), - // not part of enhanced-resolve, added to make sure query in alias value works - ("alias_query".into(), vec![AliasValue::from("a?query_after")]), - ("alias_fragment".into(), vec![AliasValue::from("a#fragment_after")]), - ("dash".into(), vec![AliasValue::Ignore]), - ("@scope/package-name/file$".into(), vec![AliasValue::from("/c/dir")]), - ], - modules: vec!["/".into()], - ..ResolveOptions::default() - }, - ); - - #[rustfmt::skip] - let pass = [ - ("should resolve a not aliased module 1", "a", "/a/index"), - ("should resolve a not aliased module 2", "a/index", "/a/index"), - ("should resolve a not aliased module 3", "a/dir", "/a/dir/index"), - ("should resolve a not aliased module 4", "a/dir/index", "/a/dir/index"), - ("should resolve an aliased module 1", "aliasA", "/a/index"), - ("should resolve an aliased module 2", "aliasA/index", "/a/index"), - ("should resolve an aliased module 3", "aliasA/dir", "/a/dir/index"), - ("should resolve an aliased module 4", "aliasA/dir/index", "/a/dir/index"), - ("should resolve '#' alias 1", "#", "/c/dir/index"), - ("should resolve '#' alias 2", "#/index", "/c/dir/index"), - ("should resolve '@' alias 1", "@", "/c/dir/index"), - ("should resolve '@' alias 2", "@/index", "/c/dir/index"), - ("should resolve a recursive aliased module 1", "recursive", "/recursive/dir/index"), - ("should resolve a recursive aliased module 2", "recursive/index", "/recursive/dir/index"), - ("should resolve a recursive aliased module 3", "recursive/dir", "/recursive/dir/index"), - ("should resolve a recursive aliased module 4", "recursive/dir/index", "/recursive/dir/index"), - ("should resolve a file aliased module 1", "b", "/a/index"), - ("should resolve a file aliased module 2", "c", "/a/index"), - ("should resolve a file aliased module with a query 1", "b?query", "/a/index?query"), - ("should resolve a file aliased module with a query 2", "c?query", "/a/index?query"), - ("should resolve a path in a file aliased module 1", "b/index", "/b/index"), - ("should resolve a path in a file aliased module 2", "b/dir", "/b/dir/index"), - ("should resolve a path in a file aliased module 3", "b/dir/index", "/b/dir/index"), - ("should resolve a path in a file aliased module 4", "c/index", "/c/index"), - ("should resolve a path in a file aliased module 5", "c/dir", "/c/dir/index"), - ("should resolve a path in a file aliased module 6", "c/dir/index", "/c/dir/index"), - ("should resolve a file aliased file 1", "d", "/c/index"), - ("should resolve a file aliased file 2", "d/dir/index", "/c/dir/index"), - ("should resolve a file in multiple aliased dirs 1", "multiAlias/dir/file", "/e/dir/file"), - ("should resolve a file in multiple aliased dirs 2", "multiAlias/anotherDir", "/e/anotherDir/index"), - // not part of enhanced-resolve, added to make sure query in alias value works - ("should resolve query in alias value", "alias_query?query_before", "/a/index?query_after"), - ("should resolve query in alias value", "alias_fragment#fragment_before", "/a/index#fragment_after"), - ("should resolve dashed name", "dashed-name", "/dashed-name"), - ("should resolve scoped package name with sub dir", "@scope/package-name/file", "/c/dir/index"), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - - #[rustfmt::skip] - let ignore = [ - ("should resolve an ignore module", "ignored", ResolveError::Ignored(f.join("ignored"))) - ]; - - for (comment, request, expected) in ignore { - let resolution = resolver.resolve(f, request); - assert_eq!(resolution, Err(expected), "{comment} {request}"); - } -} - -// Not part of enhanced-resolve -#[test] -fn infinite_recursion() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![ - ("./a".into(), vec![AliasValue::from("./b")]), - ("./b".into(), vec![AliasValue::from("./a")]), - ], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(f, "./a"); - assert_eq!(resolution, Err(ResolveError::Recursion)); -} - -fn check_slash(path: &Path) { - let s = path.to_string_lossy().to_string(); - #[cfg(target_os = "windows")] - { - assert!(!s.contains('/'), "{s}"); - assert!(s.contains('\\'), "{s}"); - } - #[cfg(not(target_os = "windows"))] - { - assert!(s.contains('/'), "{s}"); - assert!(!s.contains('\\'), "{s}"); - } -} - -#[test] -fn absolute_path() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![(f.join("foo").to_str().unwrap().to_string(), vec![AliasValue::Ignore])], - modules: vec![f.clone().to_str().unwrap().to_string()], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(&f, "foo/index"); - assert_eq!(resolution, Err(ResolveError::Ignored(f.join("foo")))); -} - -#[test] -fn system_path() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![("@app".into(), vec![AliasValue::from(f.join("alias").to_string_lossy())])], - ..ResolveOptions::default() - }); - - let specifiers = ["@app/files/a", "@app/files/a.js"]; - - for specifier in specifiers { - let path = resolver.resolve(&f, specifier).map(Resolution::into_path_buf).unwrap(); - assert_eq!(path, f.join("alias/files/a.js")); - check_slash(&path); - } -} - -#[test] -fn alias_is_full_path() { - let f = super::fixture(); - let dir = f.join("foo"); - let dir_str = dir.to_string_lossy().to_string(); - - let resolver = Resolver::new(ResolveOptions { - alias: vec![("@".into(), vec![AliasValue::Path(dir_str.clone())])], - ..ResolveOptions::default() - }); - - let mut ctx = ResolveContext::default(); - - let specifiers = [ - "@/index".to_string(), - "@/index.js".to_string(), - // specifier has multiple `/` for reasons we'll never know - "@////index".to_string(), - // specifier is a full path - dir_str, - ]; - - for specifier in specifiers { - let resolution = resolver.resolve_with_context(&f, &specifier, &mut ctx); - assert_eq!(resolution.map(|r| r.full_path()), Ok(dir.join("index.js"))); - } - - for path in ctx.file_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - check_slash(&path); - } - - for path in ctx.missing_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - check_slash(&path); - if let Some(path) = path.parent() { - assert!(!path.is_file(), "{path:?} must not be a file"); - } - } -} - -// For the `should_stop` variable in `load_alias` -#[test] -fn all_alias_values_are_not_found() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![( - "m1".to_string(), - vec![AliasValue::Path(f.join("node_modules").join("m2").to_string_lossy().to_string())], - )], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(&f, "m1/a.js"); - assert_eq!(resolution, Err(ResolveError::NotFound("m1/a.js".to_string()))); -} - -#[test] -fn alias_fragment() { - let f = super::fixture(); - - let data = [ - // enhanced-resolve has `#` prepended with a `\0`, they are removed from the - // following 3 expected test results. - // See https://github.com/webpack/enhanced-resolve#escaping - ( - "handle fragment edge case (no fragment)", - "./no#fragment/#/#", - f.join("no#fragment/#/#.js"), - ), - ("handle fragment edge case (fragment)", "./no#fragment/#/", f.join("no.js#fragment/#/")), - ( - "handle fragment escaping", - "./no\0#fragment/\0#/\0##fragment", - f.join("no#fragment/#/#.js#fragment"), - ), - ]; - - for (comment, request, expected) in data { - let resolver = Resolver::new(ResolveOptions { - alias: vec![("foo".to_string(), vec![AliasValue::Path(request.to_string())])], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f, "foo").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } -} - -#[test] -fn alias_try_fragment_as_path() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![( - "#".to_string(), - vec![AliasValue::Path(f.join("#").to_string_lossy().to_string())], - )], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(&f, "#/a").map(|r| r.full_path()); - assert_eq!(resolution, Ok(f.join("#").join("a.js"))); -} diff --git a/src/tests/browser_field.rs b/src/tests/browser_field.rs deleted file mode 100644 index 171ee099..00000000 --- a/src/tests/browser_field.rs +++ /dev/null @@ -1,189 +0,0 @@ -//! - -use crate::{AliasValue, ResolveError, ResolveOptions, Resolver}; - -#[test] -fn ignore() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![ - vec!["browser".into()], - vec!["innerBrowser1".into()], - vec!["innerBrowser2".into()], - vec![], - ], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - (f.clone(), "./lib/ignore", f.join("lib/ignore.js")), - (f.clone(), "./lib/ignore.js", f.join("lib/ignore.js")), - (f.join("lib"), "./ignore", f.join("lib/ignore.js")), - (f.join("lib"), "./ignore.js", f.join("lib/ignore.js")), - ]; - - for (path, request, expected) in data { - let resolution = resolver.resolve(&path, request); - let expected = ResolveError::Ignored(expected); - assert_eq!(resolution, Err(expected), "{path:?} {request}"); - } -} - -#[test] -fn shared_resolvers() { - let f = super::fixture().join("browser-module"); - - let resolver1 = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["innerBrowser1".into(), "field".into(), "browser".into()]], - ..ResolveOptions::default() - }); - let resolved_path = resolver1.resolve(&f, "./lib/main1.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("lib/main.js"))); - - let resolver2 = resolver1.clone_with_options(ResolveOptions { - alias_fields: vec![vec!["innerBrowser2".into(), "browser".into()]], - ..ResolveOptions::default() - }); - let resolved_path = resolver2.resolve(&f, "./lib/main2.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("./lib/replaced.js"))); -} - -#[test] -fn replace_file() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![ - vec!["browser".into()], - vec!["innerBrowser1".into(), "field2".into(), "browser".into()], // not presented - vec!["innerBrowser1".into(), "field".into(), "browser".into()], - vec!["innerBrowser2".into(), "browser".into()], - ], - // Not part of enhanced-resolve. Added to make sure no interaction between these two fields. - main_fields: vec!["browser".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - ("should replace a file 1", f.clone(), "./lib/replaced", f.join("lib/browser.js")), - ("should replace a file 2", f.clone(), "./lib/replaced.js", f.join("lib/browser.js")), - ("should replace a file 3", f.join("lib"), "./replaced", f.join("lib/browser.js")), - ("should replace a file 4", f.join("lib"), "./replaced.js", f.join("lib/browser.js")), - ("should replace a module with a file 1", f.clone(), "module-a", f.join("browser/module-a.js")), - ("should replace a module with a file 2", f.join("lib"), "module-a", f.join("browser/module-a.js")), - ("should replace a module with a module 1", f.clone(), "module-b", f.join("node_modules/module-c.js")), - ("should replace a module with a module 2", f.join("lib"), "module-b", f.join("node_modules/module-c.js")), - ("should resolve in nested property 1", f.clone(), "./lib/main1.js", f.join("lib/main.js")), - ("should resolve in nested property 2", f.clone(), "./lib/main2.js", f.join("lib/browser.js")), - ("should check only alias field properties", f.clone(), "./toString", f.join("lib/toString.js")), - // not part of enhanced-resolve - ("recursion", f.clone(), "module-c", f.join("node_modules/module-c.js")), - ("resolve self 1", f.clone(), "./lib/main.js", f.join("lib/main.js")), - ("resolve self 2", f.clone(), "./main.js", f.join("lib/main.js")), - ]; - - for (comment, path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn recurse_fail() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - ("recurse non existent", f.clone(), "./lib/non-existent.js", ResolveError::NotFound("./lib/non-existent.js".into())), - ("path partial match 1", f.clone(), "./xyz.js", ResolveError::NotFound("./xyz.js".into())), - ("path partial match 2", f, "./lib/xyz.js", ResolveError::NotFound("./lib/xyz.js".into())), - ]; - - for (comment, path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Err(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn broken() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - // The browser field string value should be ignored - (f.clone(), "browser-module-broken", Ok(f.join("node_modules/browser-module-broken/main.js"))), - (f.join("browser-module"), "./number", Err(ResolveError::NotFound("./number".into()))), - ]; - - for (path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, expected, "{path:?} {request}"); - } -} - -#[test] -fn crypto_js() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - fallback: vec![( - "crypto".into(), - vec![AliasValue::from(f.join("lib.js").to_string_lossy())], - )], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(f.join("crypto-js"), "crypto").map(|r| r.full_path()); - assert_eq!(resolved_path, Err(ResolveError::Ignored(f.join("crypto-js")))); -} - -// https://github.com/webpack/webpack/blob/87660921808566ef3b8796f8df61bd79fc026108/test/cases/resolving/browser-field/index.js#L40-L43 -#[test] -fn recursive() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - let data = [ - ("should handle recursive file 1", f.clone(), "recursive-file/a"), - ("should handle recursive file 2", f.clone(), "recursive-file/b"), - ("should handle recursive file 3", f.clone(), "recursive-file/c"), - ("should handle recursive file 4", f, "recursive-file/d"), - ]; - - for (comment, path, request) in data { - let resolved_path = resolver.resolve(&path, request); - assert_eq!(resolved_path, Err(ResolveError::Recursion), "{comment} {path:?} {request}"); - } -} - -#[test] -fn with_query() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "./foo").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("lib").join("browser.js?query"))); -} diff --git a/src/tests/builtins.rs b/src/tests/builtins.rs deleted file mode 100644 index 5d6d14d9..00000000 --- a/src/tests/builtins.rs +++ /dev/null @@ -1,121 +0,0 @@ -use std::path::Path; - -use crate::{ResolveError, ResolveOptions, Resolver}; - -#[test] -fn builtins_off() { - let f = Path::new("/"); - let resolver = Resolver::default(); - let resolved_path = resolver.resolve(f, "zlib").map(|r| r.full_path()); - assert_eq!(resolved_path, Err(ResolveError::NotFound("zlib".into()))); -} - -#[test] -fn builtins() { - let f = Path::new("/"); - - let resolver = Resolver::new(ResolveOptions::default().with_builtin_modules(true)); - - let pass = [ - "_http_agent", - "_http_client", - "_http_common", - "_http_incoming", - "_http_outgoing", - "_http_server", - "_stream_duplex", - "_stream_passthrough", - "_stream_readable", - "_stream_transform", - "_stream_wrap", - "_stream_writable", - "_tls_common", - "_tls_wrap", - "assert", - "assert/strict", - "async_hooks", - "buffer", - "child_process", - "cluster", - "console", - "constants", - "crypto", - "dgram", - "diagnostics_channel", - "dns", - "dns/promises", - "domain", - "events", - "fs", - "fs/promises", - "http", - "http2", - "https", - "inspector", - "module", - "net", - "os", - "path", - "path/posix", - "path/win32", - "perf_hooks", - "process", - "punycode", - "querystring", - "readline", - "repl", - "stream", - "stream/consumers", - "stream/promises", - "stream/web", - "string_decoder", - "sys", - "timers", - "timers/promises", - "tls", - "trace_events", - "tty", - "url", - "util", - "util/types", - "v8", - "vm", - "worker_threads", - "zlib", - ]; - - for request in pass { - let prefixed_request = format!("node:{request}"); - for request in [prefixed_request.clone(), request.to_string()] { - let resolved_path = resolver.resolve(f, &request).map(|r| r.full_path()); - let err = ResolveError::Builtin(prefixed_request.clone()); - assert_eq!(resolved_path, Err(err), "{request}"); - } - } -} - -#[test] -fn fail() { - let f = Path::new("/"); - let resolver = Resolver::new(ResolveOptions::default().with_builtin_modules(true)); - let request = "xxx"; - let resolved_path = resolver.resolve(f, request); - let err = ResolveError::NotFound(request.to_string()); - assert_eq!(resolved_path, Err(err), "{request}"); -} - -#[test] -fn imports() { - let f = super::fixture().join("builtins"); - let resolver = Resolver::new(ResolveOptions { - builtin_modules: true, - condition_names: vec!["node".into()], - ..ResolveOptions::default() - }); - - for request in ["#fs", "#http"] { - let resolved_path = resolver.resolve(f.clone(), request).map(|r| r.full_path()); - let err = ResolveError::Builtin(format!("node:{}", request.trim_start_matches('#'))); - assert_eq!(resolved_path, Err(err)); - } -} diff --git a/src/tests/dependencies.rs b/src/tests/dependencies.rs deleted file mode 100644 index bcc2355b..00000000 --- a/src/tests/dependencies.rs +++ /dev/null @@ -1,110 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/dependencies.test.js - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows { - use rustc_hash::FxHashSet; - use std::path::PathBuf; - - use crate::{ResolveContext, ResolveOptions, ResolverGeneric}; - - use super::super::memory_fs::MemoryFS; - - fn file_system() -> MemoryFS { - MemoryFS::new(&[ - ("/a/b/node_modules/some-module/index.js", ""), - ("/a/node_modules/module/package.json", r#"{"main":"entry.js"}"#), - ("/a/node_modules/module/file.js", r#"{"main":"entry.js"}"#), - ("/modules/other-module/file.js", ""), - ]) - } - - #[test] - fn test() { - let file_system = file_system(); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - extensions: vec![".json".into(), ".js".into()], - modules: vec!["/modules".into(), "node_modules".into()], - ..ResolveOptions::default() - }, - ); - - let data = [ - ( - "middle module request", - "/a/b/c", - "module/file", - "/a/node_modules/module/file.js", - // These dependencies are different from enhanced-resolve due to different code path to - // querying the file system - vec![ - // 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", - // "/", - ], - vec![ - // missing package.jsons - // "/a/b/c/package.json", - "/a/b/package.json", - "/a/package.json", - "/package.json", - // missing modules directories - "/a/b/c", - // "/a/b/c/node_modules", - // missing single file modules - "/modules/module", - "/a/b/node_modules/module", - // missing files with alternative extensions - "/a/node_modules/module/file", - "/a/node_modules/module/file.json", - ], - ), - ( - "fast found module", - "/a/b/c", - "other-module/file.js", - "/modules/other-module/file.js", - // These dependencies are different from enhanced-resolve due to different code path to - // querying the file system - vec![ - // symlink checks - "/modules/other-module/file.js", - // "/modules/other-module", - // "/modules", - // "/", - ], - vec![ - // missing package.jsons - // "/a/b/c/package.json", - "/a/b/c", - "/a/b/package.json", - "/a/package.json", - "/package.json", - "/modules/other-module/package.json", - "/modules/package.json", - ], - ), - ]; - - for (name, context, request, result, file_dependencies, missing_dependencies) in data { - let mut ctx = ResolveContext::default(); - let path = PathBuf::from(context); - let resolved = - resolver.resolve_with_context(path, request, &mut ctx).map(|r| r.full_path()); - assert_eq!(resolved, Ok(PathBuf::from(result))); - let file_dependencies = - FxHashSet::from_iter(file_dependencies.iter().map(PathBuf::from)); - let missing_dependencies = - FxHashSet::from_iter(missing_dependencies.iter().map(PathBuf::from)); - assert_eq!(ctx.file_dependencies, file_dependencies, "{name}"); - assert_eq!(ctx.missing_dependencies, missing_dependencies, "{name}"); - } - } -} diff --git a/src/tests/exports_field.rs b/src/tests/exports_field.rs deleted file mode 100644 index fd68c1f7..00000000 --- a/src/tests/exports_field.rs +++ /dev/null @@ -1,2546 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/exportsField.test.js -//! -//! The huge exports field test cases are at the bottom of this file. - -use crate::{Ctx, PathUtil, ResolveError, ResolveOptions, Resolver}; -use serde_json::json; -use std::path::Path; - -#[test] -fn test_simple() { - let f = super::fixture().join("exports-field"); - let f2 = super::fixture().join("exports-field2"); - let f4 = super::fixture().join("exports-field-error"); - let f5 = super::fixture().join("imports-exports-wildcard"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - fully_specified: true, - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("resolve root using exports field, not a main field", f.clone(), "exports-field", f.join("node_modules/exports-field/x.js")), - ("resolver should respect condition names", f.clone(), "exports-field/dist/main.js", f.join("node_modules/exports-field/lib/lib2/main.js")), - // enhanced_resolve behaves differently to node.js. enhanced_resolve fallbacks when an - // array item is unresolved, where as node.js fallbacks when an array has an - // InvalidPackageTarget error. - // ("resolver should respect fallback", f2.clone(), "exports-field/dist/browser.js", f2.join("node_modules/exports-field/lib/browser.js")), - // The following two tests require fallback from array values, the path is changed here to - // only test query and fragment. - ("resolver should respect query parameters #1", f2.clone(), "exports-field/dist/main.js?foo", f2.join("node_modules/exports-field/lib/lib2/main.js?foo")), - ("resolver should respect fragment parameters #1", f2.clone(), "exports-field/dist/main.js#foo", f2.join("node_modules/exports-field/lib/lib2/main.js#foo")), - ("relative path should work, if relative path as request is used", f.clone(), "./node_modules/exports-field/lib/main.js", f.join("node_modules/exports-field/lib/main.js")), - ("self-resolving root", f.clone(), "@exports-field/core", f.join("a.js")), - ("should resolve with wildcard pattern #1", f5.clone(), "m/features/f.js", f5.join("node_modules/m/src/features/f.js")), - ("should resolve with wildcard pattern #2", f5.clone(), "m/features/y/y.js", f5.join("node_modules/m/src/features/y/y.js")), - ("should resolve with wildcard pattern #3", f5.clone(), "m/features-no-ext/y/y.js", f5.join("node_modules/m/src/features/y/y.js")), - ("should resolve with wildcard pattern #4", f5.clone(), "m/middle/nested/f.js", f5.join("node_modules/m/src/middle/nested/f.js")), - ("should resolve with wildcard pattern #5", f5.clone(), "m/middle-1/nested/f.js", f5.join("node_modules/m/src/middle-1/nested/f.js")), - ("should resolve with wildcard pattern #6", f5.clone(), "m/middle-2/nested/f.js", f5.join("node_modules/m/src/middle-2/nested/f.js")), - ("should resolve with wildcard pattern #7", f5.clone(), "m/middle-3/nested/f", f5.join("node_modules/m/src/middle-3/nested/f/nested/f.js")), - ("should resolve with wildcard pattern #8", f5.clone(), "m/middle-4/f/nested", f5.join("node_modules/m/src/middle-4/f/f.js")), - ("should resolve with wildcard pattern #9", f5.clone(), "m/middle-5/f$/$", f5.join("node_modules/m/src/middle-5/f$/$.js")), - ]; - - // Not needed or snapshot: - // * should log the correct info - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } - - let p = f.join("node_modules/exports-field/package.json"); - let p2 = f2.join("node_modules/exports-field/package.json"); - let p4 = f4.join("node_modules/exports-field/package.json"); - let p5 = f5.join("node_modules/m/package.json"); - - #[rustfmt::skip] - let fail = [ - // ("throw error if extension not provided", f2.clone(), "exports-field/dist/main", ResolveError::NotFound(f2.join("node_modules/exports-field/lib/lib2/main"))), - ("resolver should respect query parameters #2. Direct matching", f2.clone(), "exports-field?foo", ResolveError::PackagePathNotExported("./?foo".into(), p2.clone())), - ("resolver should respect fragment parameters #2. Direct matching", f2, "exports-field#foo", ResolveError::PackagePathNotExported("./#foo".into(), p2)), - ("relative path should not work with exports field", f.clone(), "./node_modules/exports-field/dist/main.js", ResolveError::NotFound("./node_modules/exports-field/dist/main.js".into())), - ("backtracking should not work for request", f.clone(), "exports-field/dist/../../../a.js", ResolveError::InvalidPackageTarget("./lib/../../../a.js".to_string(), "./dist/".to_string(), p.clone())), - ("backtracking should not work for exports field target", f.clone(), "exports-field/dist/a.js", ResolveError::InvalidPackageTarget("./../../a.js".to_string(), "./dist/a.js".to_string(), p.clone())), - ("not exported error", f.clone(), "exports-field/anything/else", ResolveError::PackagePathNotExported("./anything/else".to_string(), p.clone())), - ("request ending with slash #1", f.clone(), "exports-field/", ResolveError::PackagePathNotExported("./".to_string(), p.clone())), - ("request ending with slash #2", f.clone(), "exports-field/dist/", ResolveError::PackagePathNotExported("./dist/".to_string(), p.clone())), - ("request ending with slash #3", f.clone(), "exports-field/lib/", ResolveError::PackagePathNotExported("./lib/".to_string(), p)), - ("should throw error if target is invalid", f4, "exports-field", ResolveError::InvalidPackageTarget("./a/../b/../../pack1/index.js".to_string(), ".".to_string(), p4)), - ("throw error if exports field is invalid", f.clone(), "invalid-exports-field", ResolveError::InvalidPackageConfig(f.join("node_modules/invalid-exports-field/package.json"))), - ("should throw error if target is 'null'", f5, "m/features/internal/file.js", ResolveError::PackagePathNotExported("./features/internal/file.js".to_string(), p5)), - ]; - - for (comment, path, request, error) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!(resolution, Err(error), "{comment} {path:?} {request}"); - } -} - -// resolve using exports field, not a browser field #1 -#[test] -fn exports_not_browser_field1() { - let f = super::fixture().join("exports-field"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - condition_names: vec!["webpack".into()], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "exports-field/dist/main.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("node_modules/exports-field/lib/lib2/main.js"))); -} - -// resolve using exports field and a browser alias field #2 -#[test] -fn exports_not_browser_field2() { - let f2 = super::fixture().join("exports-field2"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - extensions: vec![".js".into()], - condition_names: vec!["node".into()], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f2, "exports-field/dist/main.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f2.join("node_modules/exports-field/lib/browser.js"))); -} - -// should resolve extension without fullySpecified -#[test] -fn extension_without_fully_specified() { - let f2 = super::fixture().join("exports-field2"); - - let commonjs_resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - let resolved_path = - commonjs_resolver.resolve(&f2, "exports-field/dist/main").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f2.join("node_modules/exports-field/lib/lib2/main.js"))); -} - -#[test] -fn field_name_path() { - let f2 = super::fixture().join("exports-field2"); - let f3 = super::fixture().join("exports-field3"); - - // field name path #1 #2 #3 - let exports_fields = [ - vec![vec!["exportsField".into(), "exports".into()]], - vec![vec!["exportsField".into(), "exports".into()], vec!["exports".into()]], - vec![vec!["exports".into()], vec!["exportsField".into(), "exports".into()]], - ]; - - for exports_fields in exports_fields { - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - exports_fields, - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/main.js"))); - } - - // field name path #4 - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - exports_fields: vec![vec!["exports".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f2, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f2.join("node_modules/exports-field/index.js"))); - - // field name path #5 - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - exports_fields: vec![vec!["ex".into()], vec!["exports_field".into(), "exports".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/index"))); - - // non-compliant export targeting a directory - let resolver = Resolver::new(ResolveOptions { - exports_fields: vec![vec!["broken".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/src/index.js"))); -} - -#[test] -fn shared_resolvers() { - let f3 = super::fixture().join("exports-field3"); - - let resolver1 = Resolver::new(ResolveOptions { - exports_fields: vec![vec!["exportsField".into(), "exports".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver1.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/main.js"))); - - let resolver2 = resolver1.clone_with_options(ResolveOptions { - exports_fields: vec![vec!["ex".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver2.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/index"))); -} - -#[test] -fn extension_alias_1_2() { - let f = super::fixture().join("exports-field-and-extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - extension_alias: vec![(".js".into(), vec![".ts".into(), ".js".into()])], - fully_specified: true, - condition_names: vec!["webpack".into(), "default".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve with the `extensionAlias` option", f.clone(), "@org/pkg/string.js", f.join("node_modules/@org/pkg/dist/string.js")), - ("should resolve with the `extensionAlias` option #2", f.clone(), "pkg/string.js", f.join("node_modules/pkg/dist/string.js")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn extension_alias_3() { - let f = super::fixture().join("exports-field-and-extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - extension_alias: vec![( - ".js".into(), - vec![".foo".into(), ".baz".into(), ".baz".into(), ".ts".into(), ".js".into()], - )], - fully_specified: true, - condition_names: vec!["webpack".into(), "default".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve with the `extensionAlias` option #3", f.clone(), "pkg/string.js", f.join("node_modules/pkg/dist/string.js")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn extension_alias_throw_error() { - let f = super::fixture().join("exports-field-and-extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - extension_alias: vec![(".js".into(), vec![".ts".into()])], - fully_specified: true, - condition_names: vec!["webpack".into(), "default".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let fail = [ - // enhanced-resolve has two test cases that are exactly the same here - // https://github.com/webpack/enhanced-resolve/blob/a998c7d218b7a9ec2461fc4fddd1ad5dd7687485/test/exportsField.test.js#L2976-L3024 - ("should throw error with the `extensionAlias` option", f, "pkg/string.js", ResolveError::ExtensionAlias), - // TODO: The error is PackagePathNotExported in enhanced-resolve - // ("should throw error with the `extensionAlias` option", f.clone(), "pkg/string.js", ResolveError::PackagePathNotExported("node_modules/pkg/dist/string.ts".to_string())), - ]; - - for (comment, path, request, error) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!(resolution, Err(error), "{comment} {path:?} {request}"); - } -} - -// Small script for generating the test cases from enhanced-resolve -// for (c of testCases) { -// console.log("TestCase {") -// console.log(`name: ${JSON.stringify(c.name)},`) -// if (c.expect instanceof Error) { -// console.log(`expect: None,`) -// } else { -// console.log(`expect: Some(vec!${JSON.stringify(c.expect)}),`) -// } -// console.log(`exports_field: exports_field(json!(${JSON.stringify(c.suite[0], null, 2)})),`) -// console.log(`request: "${c.suite[1]}",`) -// console.log(`condition_names: vec!${JSON.stringify(c.suite[2])},`) -// console.log("},") -//} -struct TestCase { - name: &'static str, - expect: Option>, - exports_field: serde_json::Value, - request: &'static str, - condition_names: Vec<&'static str>, -} - -#[allow(clippy::needless_pass_by_value)] -fn exports_field(value: serde_json::Value) -> serde_json::Value { - value -} - -#[test] -fn test_cases() { - let test_cases = [ - TestCase { - name: "sample #1", - expect: Some(vec!["./dist/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/": { - "import": [ - "./dist/", - "./src/" - ], - "webpack": "./wp/" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "sample #1", - expect: Some(vec!["./src/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/": { - "import": [ - "./src/" - ], - "webpack": "./wp/" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - TestCase { - name: "sample #1 (wildcard)", - expect: Some(vec!["./dist/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/*": { - "import": [ - "./dist/*", - "./src/*" - ], - "webpack": "./wp/*" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "sample #1 (wildcard)", - expect: Some(vec!["./src/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/*": { - "import": [ - "./src/*" - ], - "webpack": "./wp/*" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - TestCase { - name: "sample #2", - expect: Some(vec!["./data/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./timezones/": "./data/timezones/" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #2 (wildcard)", - expect: Some(vec!["./data/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./timezones/*": "./data/timezones/*" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #3", - expect: Some(vec!["./data/timezones/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./": "./data/timezones/" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #3 (wildcard)", - expect: Some(vec!["./data/timezones/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./*": "./data/timezones/*.mjs" - })), - request: "./timezones/pdt", - condition_names: vec![], - }, - TestCase { - name: "sample #4", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./lib/": { - "browser": [ - "./browser/" - ] - }, - "./dist/index.js": { - "node": "./index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #4 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "node": "./index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #5", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/": { - "browser": [ - "./browser/" - ] - }, - "./dist/index.js": { - "node": "./index.js", - "default": "./browser/index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #5 (wildcard)", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "node": "./index.js", - "default": "./browser/index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./dist/a": "./dist/index.js" - })), - request: "./dist/aaa", - condition_names: vec![], - }, - TestCase { - name: "sample #7", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./dist/a/a/": "./dist/index.js" - })), - request: "./dist/a/a", - condition_names: vec![], - }, - TestCase { - name: "sample #7 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./dist/a/a/*": "./dist/index.js" - })), - request: "./dist/a/a", - condition_names: vec![], - }, - TestCase { - name: "sample #8", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": "./index.js" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #9", - expect: Some(vec!["./main.js"]), - exports_field: exports_field(json!({ - "./index.js": "./main.js" - })), - request: "./index.js", - condition_names: vec![], - }, - TestCase { - name: "sample #10", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #11", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./bar#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #12", - expect: Some(vec!["./ok.js#abc"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/ok.js#abc", - condition_names: vec![], - }, - TestCase { - name: "sample #12", - expect: Some(vec!["./ok.js#abc"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/ok.js#abc", - condition_names: vec![], - }, - TestCase { - name: "sample #13", - expect: Some(vec!["./ok.js?abc"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/ok.js?abc", - condition_names: vec![], - }, - TestCase { - name: "sample #14", - expect: Some(vec!["./🎉.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/🎉.js", - condition_names: vec![], - }, - TestCase { - name: "sample #15", - expect: Some(vec!["./%F0%9F%8E%89.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/%F0%9F%8E%89.js", - condition_names: vec![], - }, - TestCase { - name: "sample #16", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./🎉", - condition_names: vec![], - }, - TestCase { - name: "sample #17", - expect: Some(vec!["./other.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./%F0%9F%8E%89", - condition_names: vec![], - }, - TestCase { - name: "sample #18", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./module", - condition_names: vec![], - }, - TestCase { - name: "sample #19", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./module#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #20", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./module?foo", - condition_names: vec![], - }, - TestCase { - name: "sample #21", - expect: Some(vec!["./zizizi"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./z*z*z*" - })), - request: "./#zippi", - condition_names: vec![], - }, - TestCase { - name: "sample #22", - expect: Some(vec!["./d?e?f"]), - exports_field: exports_field(json!({ - "./a?b?c/": "./" - })), - request: "./a?b?c/d?e?f", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #1", - expect: Some(vec!["./dist/index.js"]), - exports_field: exports_field(json!({ - ".": "./dist/index.js" - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #2", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./": "./", - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #3", - expect: Some(vec!["./dist/a.js"]), - exports_field: exports_field(json!({ - "./dist/": "./dist/", - "./dist/*": "./dist/*", - "./dist*": "./dist*", - "./dist/index.js": "./dist/a.js" - })), - request: "./dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #4", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./": { - "browser": [ - "./browser/" - ] - }, - "./*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "browser": "./index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #5", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./": { - "browser": [ - "./browser/" - ] - }, - "./*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "node": "./node.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #6", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - ".": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #7", - expect: Some(vec!["./src/index.js"]), // `enhanced_resolve` is `None` - exports_field: exports_field(json!({ - ".": { - "default": "./src/index.js", - "browser": "./index.js", - "node": "./src/node/index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #8", - expect: Some(vec!["./src/index.js"]), - exports_field: exports_field(json!({ - ".": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #9", - expect: Some(vec!["./index"]), - exports_field: exports_field(json!({ - ".": "./index" - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #10", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./index": "./index.js" - })), - request: "./index", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #11", - expect: Some(vec!["./foo.js"]), - exports_field: exports_field(json!({ - "./": "./", - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #12", - expect: Some(vec!["./foo/bar/baz.js"]), - exports_field: exports_field(json!({ - "./": "./", - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo/bar/baz.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #13", - expect: Some(vec!["./foo/bar/baz.js"]), - exports_field: exports_field(json!({ - "./": "./", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo/bar/baz.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #14", - expect: Some(vec!["./foo/bar/baz.js"]), - exports_field: exports_field(json!({ - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo/bar/baz.js", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #1", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "require": "./require.js" - }, { - "import": "./import.mjs" - }] - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #2", - expect: Some(vec!["./import.mjs"]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "require": "./require.js" - }, { - "import": "./import.mjs" - }] - })), - request: ".", - condition_names: vec!["import"], - }, - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./require.js"]), - exports_field: exports_field(json!({ - ".": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./import.mjs"]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "import": "./import.mjs" - }] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./require.js"]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "require": [ - "./require.js" - ] - }, { - "import": [ - "./import.mjs", - "./import.js" - ] - }] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./import.mjs"]), - exports_field: exports_field(json!({ - ".": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "./import.mjs", - "./import.js" - ] - } - ] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./import.js"]), - exports_field: exports_field(json!({ - ".": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "./import.js" - ] - } - ] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "mapping to a folder root #1", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./timezones": "./data/timezones/" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #2", - expect: None, - exports_field: exports_field(json!({ - "./timezones/": "./data/timezones" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #3", - expect: Some(vec!["./data/timezones/pdt/index.mjs"]), - exports_field: exports_field(json!({ - "./timezones/pdt/": "./data/timezones/pdt/" - })), - request: "./timezones/pdt/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #3 (wildcard)", - expect: Some(vec!["./data/timezones/pdt/index.mjs"]), - exports_field: exports_field(json!({ - "./timezones/pdt/*": "./data/timezones/pdt/*" - })), - request: "./timezones/pdt/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #4", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./": "./timezones/" - })), - request: "./pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #4 (wildcard)", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./*": "./timezones/*" - })), - request: "./pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #5", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./": "./" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #5 (wildcard)", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./*": "./*" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #6", - expect: None, - exports_field: exports_field(json!({ - "./": "." - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #6 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "./*": "." - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #7", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": "./" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #7 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": "./*" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #1", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./": "./", - "./dist/": "./lib/" - })), - request: "./dist/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #1 (wildcard)", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./*": "./*", - "./dist/*": "./lib/*" - })), - request: "./dist/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #2", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/": "./dist/utils/", - "./dist/": "./lib/" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #2 (wildcard)", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/*": "./dist/utils/*", - "./dist/*": "./lib/*" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #3", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/index.js": "./dist/utils/index.js", - "./dist/utils/": "./dist/utils/index.mjs", - "./dist/": "./lib/" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #3 (wildcard)", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/index.js": "./dist/utils/index.js", - "./dist/utils/*": "./dist/utils/index.mjs", - "./dist/*": "./lib/*" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #4", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./": { - "browser": "./browser/" - }, - "./dist/": "./lib/" - })), - request: "./dist/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "the longest matching path prefix is prioritized #4 (wildcard)", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./*": { - "browser": "./browser/*" - }, - "./dist/*": "./lib/*" - })), - request: "./dist/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #1", - // `lodash/` does not start with './' so fallbacks to util - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "conditional mapping folder #1", - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": [ - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #1 (wildcard)", - // `lodash/` does not start with './' so fallbacks to util - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": [ - "lodash/*", - "./utils/*" - ], - "node": [ - "./utils-node/*" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "conditional mapping folder #1 (wildcard)", - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": [ - "./utils/*" - ], - "node": [ - "./utils-node/*" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #2", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./node/" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "conditional mapping folder #2 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "webpack": "./wpk/*", - "browser": [ - "lodash/*", - "./utils/*" - ], - "node": [ - "./node/*" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "conditional mapping folder #3", - expect: Some(vec!["./wpk/index.mjs"]), - exports_field: exports_field(json!({ - "./utils/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils/" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "conditional mapping folder #3 (wildcard)", - expect: Some(vec!["./wpk/index.mjs"]), - exports_field: exports_field(json!({ - "./utils/*": { - "webpack": "./wpk/*", - "browser": [ - "lodash/*", - "./utils/*" - ], - "node": [ - "./utils/*" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "incorrect exports field #1", - expect: None, - exports_field: exports_field(json!({ - "/utils/": "./a/" - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #2", - expect: None, - exports_field: exports_field(json!({ - "./utils/": "/a/" - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #3", - expect: None, - exports_field: exports_field(json!({ - "/utils/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #4", - expect: None, - exports_field: exports_field(json!({ - "./utils/": { - "browser": "/a/", - "default": "/b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #4 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "/a/", - "default": "/b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #5", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index": "./a/index.js" - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index.mjs": "./a/index.js" - })), - request: "./utils/index", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #7", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #8", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index.mjs": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - // Requests that are not `./` does not apply to `package_exports_resolve` - // TestCase { - // name: "incorrect request #1", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": "./a/" - // })), - // request: "/utils/index.mjs", - // condition_names: vec![], - // }, - // TestCase { - // name: "incorrect request #2", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": { - // "browser": "./a/", - // "default": "./b/" - // } - // })), - // request: "/utils/index.mjs", - // condition_names: vec!["browser"], - // }, - // TestCase { - // name: "incorrect request #3", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": { - // "browser": "./a/", - // "default": "./b/" - // } - // })), - // request: "../utils/index.mjs", - // condition_names: vec!["browser"], - // }, - // TestCase { - // name: "incorrect request #4", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": { - // "browser": "./a/", - // "default": "./b/" - // } - // })), - // request: "/utils/index.mjs/", - // condition_names: vec!["browser"], - // }, - TestCase { - name: "backtracking package base #1", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./../../utils/": "./dist/" - })), - request: "./../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #1 (wildcard)", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./../../utils/*": "./dist/*" - })), - request: "./../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #2", - expect: None, - exports_field: exports_field(json!({ - "../../utils/": "./dist/" - })), - request: "../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #2 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "../../utils/*": "./dist/*" - })), - request: "../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #3", - expect: None, - exports_field: exports_field(json!({ - "./utils/": "../src/" - })), - request: "./utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #3 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "./utils/*": "../src/*" - })), - request: "./utils/index", - condition_names: vec![], - }, - // enhanced-resolve does not handle backtracking here - // TestCase { - // name: "backtracking package base #4", - // expect: Some(vec!["./../src/index"]), - // exports_field: exports_field(json!({ - // "./utils/": "./../src/" - // })), - // request: "./utils/index", - // condition_names: vec![], - // }, - // TestCase { - // name: "backtracking package base #4 (wildcard)", - // expect: Some(vec!["./../src/index"]), - // exports_field: exports_field(json!({ - // "./utils/*": "./../src/*" - // })), - // request: "./utils/index", - // condition_names: vec![], - // }, - // TestCase { - // name: "backtracking package base #5", - // expect: Some(vec!["./src/../index.js"]), - // exports_field: exports_field(json!({ - // "./utils/index": "./src/../index.js" - // })), - // request: "./utils/index", - // condition_names: vec![], - // }, - TestCase { - name: "backtracking package base #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/../utils/index": "./src/../index.js" - })), - request: "./utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #7", - expect: None, - exports_field: exports_field(json!({ - "./utils/": { - "browser": "../this/" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #7", - expect: None, - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "../this/*" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #8", - // We throw "InvalidPackageTarget" - // expect: Some(vec!["./utils/../index"]), - expect: None, - exports_field: exports_field(json!({ - "./utils/": { - "browser": "./utils/../" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #8 (wildcard)", - // We throw "InvalidPackageTarget" - // expect: Some(vec!["./utils/../index"]), - expect: None, - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "./utils/../*" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #9", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./": "./src/../../", - "./dist/": "./dist/" - })), - request: "./dist/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #9 (wildcard)", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./*": "./src/../../*", - "./dist/*": "./dist/*" - })), - request: "./dist/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking target folder #1", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../../index"]), - exports_field: exports_field(json!({ - "./utils/": "./dist/" - })), - request: "./utils/timezone/../../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #1 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../../index"]), - exports_field: exports_field(json!({ - "./utils/*": "./dist/*" - })), - request: "./utils/timezone/../../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #2", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../index"]), - exports_field: exports_field(json!({ - "./utils/": "./dist/" - })), - request: "./utils/timezone/../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #2 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../index"]), - exports_field: exports_field(json!({ - "./utils/*": "./dist/*" - })), - request: "./utils/timezone/../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #3", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/target/../../index"]), - exports_field: exports_field(json!({ - "./utils/": "./dist/target/" - })), - request: "./utils/../../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #3 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/target/../../index"]), - exports_field: exports_field(json!({ - "./utils/*": "./dist/target/*" - })), - request: "./utils/../../index", - condition_names: vec![], - }, - // enhanced-resolve does not handle `node_modules` in target - TestCase { - name: "nested node_modules path #1", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": "./node_modules/" - } - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #1 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "./node_modules/*" - } - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #2", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./utils/../node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/": "./utils/../node_modules/" - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "nested node_modules path #2 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./utils/../node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": "./utils/../node_modules/*" - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "nested mapping #1", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": "./", - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested mapping #1 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": "./*", - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "nested mapping #2 (wildcard)", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #2 (wildcard)", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "nested mapping #3", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["webpack"], - }, - TestCase { - name: "nested mapping #3 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["webpack"], - }, - TestCase { - name: "nested mapping #4", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["node", "browser"], - }, - TestCase { - name: "nested mapping #4 (wildcard)", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["node", "browser"], - }, - TestCase { - name: "nested mapping #5", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node"], - }, - TestCase { - name: "nested mapping #5 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": { - "webpack": [ - "./wpck/*" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node"], - }, - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - TestCase { - name: "nested mapping #6 (wildcard)", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": { - "webpack": [ - "./wpck/*" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #6 (wildcard)", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./node/*" - ], - "default": { - "node": { - "webpack": [ - "./wpck/*" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - TestCase { - name: "nested mapping #7", - expect: Some(vec!["./y.js"]), - exports_field: exports_field(json!({ - "./a.js": { - "abc": { - "def": "./x.js" - }, - "ghi": "./y.js" - } - })), - request: "./a.js", - condition_names: vec!["abc", "ghi"], - }, - TestCase { - name: "nested mapping #8", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./a.js": { - "abc": { - "def": "./x.js", - "default": [] - }, - "ghi": "./y.js" - } - })), - request: "./a.js", - condition_names: vec!["abc", "ghi"], - }, - TestCase { - name: "syntax sugar #1", - expect: Some(vec!["./main.js"]), - exports_field: exports_field(json!("./main.js")), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #2", - expect: Some(vec![]), - exports_field: exports_field(json!("./main.js")), - request: "./lib.js", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #3", - expect: Some(vec!["./a.js"]), - exports_field: exports_field(json!(["./a.js", "./b.js"])), - request: ".", - condition_names: vec![], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "syntax sugar #3", - expect: Some(vec!["./b.js"]), - exports_field: exports_field(json!(["./b.js"])), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #4", - expect: Some(vec![]), - exports_field: exports_field(json!(["./a.js", "./b.js"])), - request: "./lib.js", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #5", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "browser": { - "default": "./index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "syntax sugar #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "browser": { - "default": "./index.js" - } - })), - request: "./lib.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "syntax sugar #7", - expect: None, - exports_field: exports_field(json!({ - "./node": "./node.js", - "browser": { - "default": "./index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "syntax sugar #8", - expect: None, - exports_field: exports_field(json!({ - "browser": { - "default": "./index.js" - }, - "./node": "./node.js" - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #1", - expect: Some(vec!["./abc/d"]), - exports_field: exports_field(json!({ - "./ab*": "./ab/*", - "./abc*": "./abc/*", - "./a*": "./a/*" - })), - request: "./abcd", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #2", - expect: Some(vec!["./abc/d/e"]), - exports_field: exports_field(json!({ - "./ab*": "./ab/*", - "./abc*": "./abc/*", - "./a*": "./a/*" - })), - request: "./abcd/e", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #3", - expect: Some(vec!["./abc/d"]), - exports_field: exports_field(json!({ - "./x/ab*": "./ab/*", - "./x/abc*": "./abc/*", - "./x/a*": "./a/*" - })), - request: "./x/abcd", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #4", - expect: Some(vec!["./abc/d/e"]), - exports_field: exports_field(json!({ - "./x/ab*": "./ab/*", - "./x/abc*": "./abc/*", - "./x/a*": "./a/*" - })), - request: "./x/abcd/e", - condition_names: vec!["browser"], - }, - TestCase { - name: "path tree edge case #1", - expect: Some(vec!["./A/b/d.js"]), - exports_field: exports_field(json!({ - "./a/": "./A/", - "./a/b/c": "./c.js" - })), - request: "./a/b/d.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #1 (wildcard)", - expect: Some(vec!["./A/b/d.js"]), - exports_field: exports_field(json!({ - "./a/*": "./A/*", - "./a/b/c": "./c.js" - })), - request: "./a/b/d.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #2", - expect: Some(vec!["./A/c.js"]), - exports_field: exports_field(json!({ - "./a/": "./A/", - "./a/b": "./b.js" - })), - request: "./a/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #2 (wildcard)", - expect: Some(vec!["./A/c.js"]), - exports_field: exports_field(json!({ - "./a/*": "./A/*", - "./a/b": "./b.js" - })), - request: "./a/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #3", - expect: Some(vec!["./A/b/d/c.js"]), - exports_field: exports_field(json!({ - "./a/": "./A/", - "./a/b/c/d": "./c.js" - })), - request: "./a/b/d/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #3 (wildcard)", - expect: Some(vec!["./A/b/d/c.js"]), - exports_field: exports_field(json!({ - "./a/*": "./A/*", - "./a/b/c/d": "./c.js" - })), - request: "./a/b/d/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #1", - expect: Some(vec!["./A/b.js"]), - exports_field: exports_field(json!({ - "./a/*.js": "./A/*.js" - })), - request: "./a/b.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #2", - expect: Some(vec!["./A/b/c.js"]), - exports_field: exports_field(json!({ - "./a/*.js": "./A/*.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #3", - expect: Some(vec!["./A/b/c.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": "./A/*/c.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #4", - expect: Some(vec!["./A/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": "./A/*/*.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #5", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/*.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #5", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/*.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./lib/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #6", - expect: Some(vec!["./browser/foo/bar.js"]), - exports_field: exports_field(json!({ - "./lib/*/bar.js": { - "browser": [ - "./browser/*/bar.js" - ] - }, - "./dist/*/bar.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./lib/foo/bar.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #6", - expect: Some(vec!["./browser/foo.js"]), - exports_field: exports_field(json!({ - "./lib/*/bar.js": { - "browser": [ - "./browser/*/bar.js" - ] - }, - "./dist/*/bar.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./dist/foo/bar.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #7", - expect: Some(vec!["./browser/foo/default.js"]), - exports_field: exports_field(json!({ - "./lib/*/bar.js": { - "browser": [ - "./browser/*/bar.js" - ] - }, - "./dist/*/bar.js": { - "node": "./*.js", - "default": "./browser/*/default.js" - } - })), - request: "./dist/foo/bar.js", - condition_names: vec!["default"], - }, - TestCase { - name: "wildcard pattern #8", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": "./A/*/*/*.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #9", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": [ - "./A/*/*/*.js", - "./B/*/*/*.js" - ] - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "wildcard pattern #9", - expect: Some(vec!["./B/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": [ - "./B/*/*/*.js" - ] - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #10", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/foo-*/c.js": "./A/*/*/*.js" - })), - request: "./a/foo-b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #11", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*-foo/c.js": "./A/*/*/*.js" - })), - request: "./a/b-foo/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #12", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/foo-*-foo/c.js": "./A/*/*/*.js" - })), - request: "./a/foo-b-foo/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #13", - expect: Some(vec!["./A/b/c/d.js"]), - exports_field: exports_field(json!({ - "./a/foo-*-foo/c.js": "./A/b/c/d.js" - })), - request: "./a/foo-b-foo/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #14", - expect: Some(vec!["./A/b/c/*.js"]), - exports_field: exports_field(json!({ - "./a/foo-foo/c.js": "./A/b/c/*.js" - })), - request: "./a/foo-foo/c.js", - condition_names: vec![], - }, - ]; - - for case in test_cases { - let resolved = Resolver::new(ResolveOptions { - condition_names: case - .condition_names - .iter() - .map(ToString::to_string) - .collect::>(), - ..ResolveOptions::default() - }) - .package_exports_resolve( - Path::new(""), - case.request, - &case.exports_field, - &mut Ctx::default(), - ) - .map(|p| p.map(|p| p.to_path_buf())); - if let Some(expect) = case.expect { - if expect.is_empty() { - assert!( - matches!(resolved, Err(ResolveError::PackagePathNotExported(_, _))), - "{} {:?}", - &case.name, - &resolved - ); - } else { - for expect in expect { - assert_eq!(resolved, Ok(Some(Path::new(expect).normalize())), "{}", &case.name); - } - } - } else { - assert!(resolved.is_err(), "{} {resolved:?}", &case.name); - } - } -} diff --git a/src/tests/extension_alias.rs b/src/tests/extension_alias.rs deleted file mode 100644 index 86afab73..00000000 --- a/src/tests/extension_alias.rs +++ /dev/null @@ -1,66 +0,0 @@ -//! - -use crate::{ResolveError, ResolveOptions, Resolver}; - -#[test] -fn extension_alias() { - let f = super::fixture().join("extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - extension_alias: vec![ - (".js".into(), vec![".ts".into(), ".js".into()]), - (".mjs".into(), vec![".mts".into()]), - ], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should alias fully specified file", f.clone(), "./index.js", f.join("index.ts")), - ("should alias fully specified file when there are two alternatives", f.clone(), "./dir/index.js", f.join("dir/index.ts")), - ("should also allow the second alternative", f.clone(), "./dir2/index.js", f.join("dir2/index.js")), - ("should support alias option without an array", f.clone(), "./dir2/index.mjs", f.join("dir2/index.mts")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } - - #[rustfmt::skip] - let fail = [ - ("should not allow to fallback to the original extension or add extensions", f, "./index.mjs"), - ]; - - for (comment, path, request) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!(resolution, Err(ResolveError::ExtensionAlias), "{comment} {path:?} {request}"); - } -} - -// should not apply extension alias to extensions or mainFiles field -#[test] -fn not_apply_to_extension_nor_main_files() { - let f = super::fixture().join("extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - extension_alias: vec![(".js".into(), vec![])], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("directory", f.clone(), "./dir2", "dir2/index.js"), - ("file", f.clone(), "./dir2/index", "dir2/index.js"), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - let expected = f.join(expected); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} diff --git a/src/tests/extensions.rs b/src/tests/extensions.rs deleted file mode 100644 index 1ebd86f4..00000000 --- a/src/tests/extensions.rs +++ /dev/null @@ -1,125 +0,0 @@ -//! - -use crate::{EnforceExtension, Resolution, ResolveContext, ResolveError, ResolveOptions, Resolver}; -use rustc_hash::FxHashSet; - -#[test] -fn extensions() { - let f = super::fixture().join("extensions"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".ts".into(), ".js".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve according to order of provided extensions", "./foo", "foo.ts"), - ("should resolve according to order of provided extensions (dir index)", "./dir", "dir/index.ts"), - ("should resolve according to main field in module root", ".", "index.js"), - // This is a core module - // ("should resolve single file module before directory", "module", "node_modules/module.js"), - ("should resolve trailing slash directory before single file", "module/", "node_modules/module/index.ts"), - ]; - - for (comment, request, expected_path) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - let expected = f.join(expected_path); - assert_eq!(resolved_path, Ok(expected), "{comment} {request} {expected_path}"); - } - - #[rustfmt::skip] - let fail = [ - ("not resolve to file when request has a trailing slash (relative)", "./foo.js/", "./foo.js/".into()) - ]; - - for (comment, request, expected_error) in fail { - let resolution = resolver.resolve(&f, request); - let error = ResolveError::NotFound(expected_error); - assert_eq!(resolution, Err(error), "{comment} {request} {resolution:?}"); - } -} - -// should default enforceExtension to true when extensions includes an empty string -#[test] -fn default_enforce_extension() { - let f = super::fixture().join("extensions"); - - let mut ctx = ResolveContext::default(); - let resolved = Resolver::new(ResolveOptions { - extensions: vec![".ts".into(), String::new(), ".js".into()], - ..ResolveOptions::default() - }) - .resolve_with_context(&f, "./foo", &mut ctx); - - assert_eq!(resolved.map(Resolution::into_path_buf), Ok(f.join("foo.ts"))); - assert_eq!( - ctx.file_dependencies, - FxHashSet::from_iter([f.join("foo.ts"), f.join("package.json")]) - ); - assert!(ctx.missing_dependencies.is_empty()); -} - -// should respect enforceExtension when extensions includes an empty string -#[test] -fn respect_enforce_extension() { - let f = super::fixture().join("extensions"); - - let mut ctx = ResolveContext::default(); - let resolved = Resolver::new(ResolveOptions { - enforce_extension: EnforceExtension::Disabled, - extensions: vec![".ts".into(), String::new(), ".js".into()], - ..ResolveOptions::default() - }) - .resolve_with_context(&f, "./foo", &mut ctx); - - assert_eq!(resolved.map(Resolution::into_path_buf), Ok(f.join("foo.ts"))); - assert_eq!( - ctx.file_dependencies, - FxHashSet::from_iter([f.join("foo.ts"), f.join("package.json")]) - ); - assert_eq!(ctx.missing_dependencies, FxHashSet::from_iter([f.join("foo")])); -} - -#[test] -fn multi_dot_extension() { - let f = super::fixture().join("extensions"); - - let resolver = Resolver::new(ResolveOptions { - // Test for `.d.ts`, not part of enhanced-resolve. - extensions: vec![".a.b.c".into(), ".d.ts".into(), ".ts".into(), ".js".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve according to order of provided extensions", "./foo", "foo.ts"), - ("should resolve file with extension", "./app.module", "app.module.js") - ]; - - for (comment, request, expected_path) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - let expected = f.join(expected_path); - assert_eq!(resolved_path, Ok(expected), "{comment} {request} {expected_path}"); - } - - #[rustfmt::skip] - let fail = [ - ("not resolve to file", "./index.", "./index.".into()) - ]; - - for (comment, request, expected_error) in fail { - let resolution = resolver.resolve(&f, request); - let error = ResolveError::NotFound(expected_error); - assert_eq!(resolution, Err(error), "{comment} {request} {resolution:?}"); - } -} - -#[test] -#[should_panic = "All extensions must start with a leading dot"] -fn without_leading_dot() { - Resolver::new(ResolveOptions { - extensions: vec!["ts".into(), "js".into()], - ..ResolveOptions::default() - }); -} diff --git a/src/tests/fallback.rs b/src/tests/fallback.rs deleted file mode 100644 index 3da2d767..00000000 --- a/src/tests/fallback.rs +++ /dev/null @@ -1,100 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/fallback.test.js - -#[test] -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -fn fallback() { - use super::memory_fs::MemoryFS; - use crate::{AliasValue, ResolveError, ResolveOptions, ResolverGeneric}; - use std::path::{Path, PathBuf}; - - let f = Path::new("/"); - - let file_system = MemoryFS::new(&[ - ("/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", ""), - ]); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - fallback: vec![ - ("aliasA".into(), vec![AliasValue::Path("a".into())]), - ("b$".into(), vec![AliasValue::Path("a/index".into())]), - ("c$".into(), vec![AliasValue::Path("/a/index".into())]), - ( - "multiAlias".into(), - vec![ - AliasValue::Path("b".into()), - AliasValue::Path("c".into()), - AliasValue::Path("d".into()), - AliasValue::Path("e".into()), - AliasValue::Path("a".into()), - ], - ), - ("recursive".into(), vec![AliasValue::Path("recursive/dir".into())]), - ("/d/dir".into(), vec![AliasValue::Path("/c/dir".into())]), - ("/d/index.js".into(), vec![AliasValue::Path("/c/index".into())]), - ("ignored".into(), vec![AliasValue::Ignore]), - ("node:path".into(), vec![AliasValue::Ignore]), - ], - modules: vec!["/".into()], - ..ResolveOptions::default() - }, - ); - - #[rustfmt::skip] - let pass = [ - ("should resolve a not aliased module 1", "a", "/a/index"), - ("should resolve a not aliased module 2", "a/index", "/a/index"), - ("should resolve a not aliased module 3", "a/dir", "/a/dir/index"), - ("should resolve a not aliased module 4", "a/dir/index", "/a/dir/index"), - ("should resolve an fallback module 1", "aliasA", "/a/index"), - ("should resolve an fallback module 2", "aliasA/index", "/a/index"), - ("should resolve an fallback module 3", "aliasA/dir", "/a/dir/index"), - ("should resolve an fallback module 4", "aliasA/dir/index", "/a/dir/index"), - ("should resolve a recursive aliased module 1", "recursive", "/recursive/index"), - ("should resolve a recursive aliased module 2", "recursive/index", "/recursive/index"), - ("should resolve a recursive aliased module 3", "recursive/dir", "/recursive/dir/index"), - ("should resolve a recursive aliased module 4", "recursive/dir/index", "/recursive/dir/index"), - ("should resolve a recursive aliased module 5", "recursive/file", "/recursive/dir/file"), - ("should resolve a file aliased module with a query 1", "b?query", "/b/index?query"), - ("should resolve a file aliased module with a query 2", "c?query", "/c/index?query"), - ("should resolve a path in a file aliased module 1", "b/index", "/b/index"), - ("should resolve a path in a file aliased module 2", "b/dir", "/b/dir/index"), - ("should resolve a path in a file aliased module 3", "b/dir/index", "/b/dir/index"), - ("should resolve a path in a file aliased module 4", "c/index", "/c/index"), - ("should resolve a path in a file aliased module 5", "c/dir", "/c/dir/index"), - ("should resolve a path in a file aliased module 6", "c/dir/index", "/c/dir/index"), - ("should resolve a file in multiple aliased dirs 1", "multiAlias/dir/file", "/e/dir/file"), - ("should resolve a file in multiple aliased dirs 2", "multiAlias/anotherDir", "/e/anotherDir/index"), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - - #[rustfmt::skip] - let ignore = [ - ("should resolve an ignore module", "ignored", ResolveError::Ignored(f.join("ignored"))), - ("should resolve node: builtin module", "node:path", ResolveError::Ignored(PathBuf::from("/node:path"))), - ]; - - for (comment, request, expected) in ignore { - let resolution = resolver.resolve(f, request); - assert_eq!(resolution, Err(expected), "{comment} {request}"); - } -} diff --git a/src/tests/full_specified.rs b/src/tests/full_specified.rs deleted file mode 100644 index a70c0191..00000000 --- a/src/tests/full_specified.rs +++ /dev/null @@ -1,113 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/fullSpecified.test.js - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows { - use std::path::PathBuf; - - use crate::{AliasValue, ResolveOptions, ResolverGeneric}; - - use super::super::memory_fs::MemoryFS; - - fn file_system() -> MemoryFS { - MemoryFS::new(&[ - ("/a/node_modules/package1/index.js", ""), - ("/a/node_modules/package1/file.js", ""), - ("/a/node_modules/package2/package.json", r#"{"main":"a"}"#), - ("/a/node_modules/package2/a.js", ""), - ("/a/node_modules/package3/package.json", r#"{"main":"dir"}"#), - ("/a/node_modules/package3/dir/index.js", ""), - ("/a/node_modules/package4/package.json", r#"{"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", ""), - ]) - } - - #[test] - fn test() { - let file_system = file_system(); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - alias: vec![ - ("alias1".into(), vec![AliasValue::from("/a/abc")]), - ("alias2".into(), vec![AliasValue::from("/a")]), - ], - alias_fields: vec![vec!["browser".into()]], - fully_specified: true, - ..ResolveOptions::default() - }, - ); - - let failing_resolves = [ - ("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"), - ]; - - for (comment, request) in failing_resolves { - let resolution = resolver.resolve("/a", request); - assert!(resolution.is_err(), "{comment} {request}"); - } - - let successful_resolves = [ - ("fully relative", "./abc.js", "/a/abc.js"), - ("fully absolute", "/a/abc.js", "/a/abc.js"), - ("fully relative in package", "package1/file.js", "/a/node_modules/package1/file.js"), - ("extensions in mainFiles", "package1", "/a/node_modules/package1/index.js"), - ("extensions in mainFields", "package2", "/a/node_modules/package2/a.js"), - ("extensions in alias", "alias1", "/a/abc.js"), - ("directories in alias", "alias2", "/a/index.js"), - ("directories in packages", "package3", "/a/node_modules/package3/dir/index.js"), - ("extensions in aliasFields", "package4/a.js", "/a/node_modules/package4/b.js"), - ]; - - for (comment, request, expected) in successful_resolves { - let resolution = resolver.resolve("/a", request).map(|r| r.full_path()); - assert_eq!(resolution, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - } - - #[test] - #[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. - fn resolve_to_context() { - let file_system = file_system(); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - alias: vec![ - ("alias1".into(), vec![AliasValue::from("/a/abc")]), - ("alias2".into(), vec![AliasValue::from("/a")]), - ], - alias_fields: vec![vec!["browser".into()]], - fully_specified: true, - resolve_to_context: true, - ..ResolveOptions::default() - }, - ); - - let successful_resolves = [ - ("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", "/a/node_modules/package3/dir"), - ]; - - for (comment, request, expected) in successful_resolves { - let resolution = resolver.resolve("/a", request).map(|r| r.full_path()); - assert_eq!(resolution, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - } -} diff --git a/src/tests/imports_field.rs b/src/tests/imports_field.rs deleted file mode 100644 index c928627a..00000000 --- a/src/tests/imports_field.rs +++ /dev/null @@ -1,1320 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/importsField.test.js -//! -//! The huge imports field test cases are at the bottom of this file. - -use serde_json::json; - -use crate::{Ctx, JSONMap, PathUtil, ResolveError, ResolveOptions, Resolver}; -use std::path::Path; - -#[test] -fn test_simple() { - let f = super::fixture().join("imports-field"); - let f2 = super::fixture().join("imports-exports-wildcard/node_modules/m/"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve using imports field instead of self-referencing", f.clone(), "#imports-field", f.join("b.js")), - ("should resolve using imports field instead of self-referencing for a subpath", f.join("dir"), "#imports-field", f.join("b.js")), - ("should resolve package #1", f.clone(), "#a/dist/main.js", f.join("node_modules/a/lib/lib2/main.js")), - ("should resolve package #3", f.clone(), "#ccc/index.js", f.join("node_modules/c/index.js")), - ("should resolve package #4", f.clone(), "#c", f.join("node_modules/c/index.js")), - ("should resolve with wildcard pattern", f2.clone(), "#internal/i.js", f2.join("src/internal/i.js")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } - - // Note added: - // * should resolve absolute path as an imports field target - // * should log the correct info - - #[rustfmt::skip] - let fail = [ - ("should disallow resolve out of package scope", f.clone(), "#b", ResolveError::InvalidPackageTarget("../b.js".to_string(), "#b".to_string(), f.join("package.json"))), - ("should resolve package #2", f.clone(), "#a", ResolveError::PackageImportNotDefined("#a".to_string(), f.join("package.json"))), - ]; - - for (comment, path, request, error) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!(resolution, Err(error), "{comment} {path:?} {request}"); - } -} - -#[test] -fn shared_resolvers() { - let f = super::fixture().join("imports-field"); - - // field name #1 - let resolver1 = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - imports_fields: vec![vec!["imports".into()]], - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - let resolved_path = resolver1.resolve(&f, "#imports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("b.js"))); - - // field name #2 - let resolver2 = resolver1.clone_with_options(ResolveOptions { - imports_fields: vec![vec!["other".into(), "imports".into()]], - ..ResolveOptions::default() - }); - - let resolved_path = resolver2.resolve(&f, "#b").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("a.js"))); -} - -// Small script for generating the test cases from enhanced_resolve -// for (c of testCases) { -// console.log("TestCase {") -// console.log(`name: ${JSON.stringify(c.name)},`) -// if (c.expect instanceof Error) { -// console.log(`expect: None,`) -// } else { -// console.log(`expect: Some(vec!${JSON.stringify(c.expect)}),`) -// } -// console.log(`imports_field: imports_field(json!(${JSON.stringify(c.suite[0], null, 2)})),`) -// console.log(`request: "${c.suite[1]}",`) -// console.log(`condition_names: vec!${JSON.stringify(c.suite[2])},`) -// console.log("},") -// } - -struct TestCase { - name: &'static str, - expect: Option>, - imports_field: JSONMap, - request: &'static str, - condition_names: Vec<&'static str>, -} - -#[allow(clippy::needless_pass_by_value)] -fn imports_field(value: serde_json::Value) -> JSONMap { - let s = serde_json::to_string(&value).unwrap(); - serde_json::from_str(&s).unwrap() -} - -#[test] -fn test_cases() { - let test_cases = [ - TestCase { - name: "sample #1", - expect: Some(vec!["./dist/test/file.js"]), - imports_field: imports_field(json!({ - "#abc/": { - "import": [ - "./dist/", - "./src/" - ], - "webpack": "./wp/" - }, - "#abc": "./main.js" - })), - request: "#abc/test/file.js", - condition_names: vec!["import", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "sample #1", - expect: Some(vec!["./src/test/file.js"]), - imports_field: imports_field(json!({ - "#abc/": { - "import": [ - "./src/" - ], - "webpack": "./wp/" - }, - "#abc": "./main.js" - })), - request: "#abc/test/file.js", - condition_names: vec!["import", "webpack"], - }, - TestCase { - name: "sample #2", - expect: Some(vec!["./data/timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#1/timezones/": "./data/timezones/" - })), - request: "#1/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #3", - expect: Some(vec!["./data/timezones/timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#aaa/": "./data/timezones/", - "#a/": "./data/timezones/" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #4", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/lib/": { - "browser": [ - "./browser/" - ] - }, - "#a/dist/index.js": { - "node": "./index.js" - } - })), - request: "#a/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #5", - expect: Some(vec!["./browser/index.js"]), - imports_field: imports_field(json!({ - "#a/lib/": { - "browser": [ - "./browser/" - ] - }, - "#a/dist/index.js": { - "node": "./index.js", - "default": "./browser/index.js" - } - })), - request: "#a/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #6", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/dist/a": "./dist/index.js" - })), - request: "#a/dist/aaa", - condition_names: vec![], - }, - TestCase { - name: "sample #7", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/a/a/": "./dist/index.js" - })), - request: "#a/a/a", - condition_names: vec![], - }, - TestCase { - name: "sample #8", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": "./index.js" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #9", - expect: Some(vec!["./main.js"]), - imports_field: imports_field(json!({ - "#a/index.js": "./main.js" - })), - request: "#a/index.js", - condition_names: vec![], - }, - TestCase { - name: "sample #10", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #11", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/bar#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #12", - expect: Some(vec!["./ok.js#abc"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/ok.js#abc", - condition_names: vec![], - }, - TestCase { - name: "sample #13", - expect: Some(vec!["./ok.js?abc"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/ok.js?abc", - condition_names: vec![], - }, - TestCase { - name: "sample #14", - expect: Some(vec!["./🎉.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/🎉.js", - condition_names: vec![], - }, - TestCase { - name: "sample #15", - expect: Some(vec!["./%F0%9F%8E%89.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/%F0%9F%8E%89.js", - condition_names: vec![], - }, - TestCase { - name: "sample #16", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/🎉", - condition_names: vec![], - }, - TestCase { - name: "sample #17", - expect: Some(vec!["./other.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/%F0%9F%8E%89", - condition_names: vec![], - }, - TestCase { - name: "sample #18", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/module", - condition_names: vec![], - }, - TestCase { - name: "sample #19", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/module#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #20", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/module?foo", - condition_names: vec![], - }, - TestCase { - name: "sample #21", - expect: Some(vec!["./d?e?f"]), - imports_field: imports_field(json!({ - "#a/a?b?c/": "./" - })), - request: "#a/a?b?c/d?e?f", - condition_names: vec![], - }, - TestCase { - name: "sample #22", - // We throw InvalidPackageTarget - expect: None, - // expect: Some(vec!["/user/a/index"]), - imports_field: imports_field(json!({ - "#a/": "/user/a/" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #1", - expect: Some(vec!["./A/b/d.js"]), - imports_field: imports_field(json!({ - "#a/": "./A/", - "#a/b/c": "./c.js" - })), - request: "#a/b/d.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #2", - expect: Some(vec!["./A/c.js"]), - imports_field: imports_field(json!({ - "#a/": "./A/", - "#a/b": "./b.js" - })), - request: "#a/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #3", - expect: Some(vec!["./A/b/c/d.js"]), - imports_field: imports_field(json!({ - "#a/": "./A/", - "#a/b/c/d": "./c.js" - })), - request: "#a/b/c/d.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #1", - expect: Some(vec!["./dist/index.js"]), - imports_field: imports_field(json!({ - "#a": "./dist/index.js" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #2", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": "./" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #3", - expect: Some(vec!["./dist/a.js"]), - imports_field: imports_field(json!({ - "#a/": "./dist/", - "#a/index.js": "./dist/a.js" - })), - request: "#a/index.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #4", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "./browser/" - ] - }, - "#a/index.js": { - "browser": "./index.js" - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #5", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "./browser/" - ] - }, - "#a/index.js": { - "node": "./node.js" - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #6", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: "#a", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #7", - expect: Some(vec!["./src/index.js"]), // `enhanced_resolve` is `None` - imports_field: imports_field(json!({ - "#a": { - "default": "./src/index.js", - "browser": "./index.js", - "node": "./src/node/index.js" - } - })), - request: "#a", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #8", - expect: Some(vec!["./src/index.js"]), - imports_field: imports_field(json!({ - "#a": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #9", - expect: Some(vec!["./index"]), - imports_field: imports_field(json!({ - "#a": "./index" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #10", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/index": "./index.js" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #11", - // We throw InvalidPackageTarget - // expect: Some(vec!["b"]), - expect: None, - imports_field: imports_field(json!({ - "#a": "b" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #12", - // We throw InvalidPackageTarget - // expect: Some(vec!["b/index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "b/" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #13", - // We throw InvalidPackageTarget - // expect: Some(vec!["b#anotherhashishere"]), - expect: None, - imports_field: imports_field(json!({ - "#a?q=a#hashishere": "b#anotherhashishere" - })), - request: "#a?q=a#hashishere", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #1", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #2", - expect: Some(vec!["./import.mjs"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec!["import"], - }, - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./require.js"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./import.mjs"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./require.js"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": [ - "./require.js" - ] - }, - { - "import": [ - "./import.mjs", - "#b/import.js" - ] - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./import.mjs"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "./import.mjs", - "#b/import.js" - ] - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "#b/import.js" - ] - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "mapping to a folder root #1", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#timezones": "./data/timezones/" - })), - request: "#timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #2", - expect: None, - imports_field: imports_field(json!({ - "#timezones/": "./data/timezones" - })), - request: "#timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #3", - expect: Some(vec!["./data/timezones/pdt/index.mjs"]), - imports_field: imports_field(json!({ - "#timezones/pdt/": "./data/timezones/pdt/" - })), - request: "#timezones/pdt/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #4", - expect: Some(vec!["./timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#a/": "./timezones/" - })), - request: "#a/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #5", - expect: Some(vec!["./timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#a/": "./" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #6", - expect: None, - imports_field: imports_field(json!({ - "#a/": "." - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #7", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": "./" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #1", - expect: Some(vec!["./lib/index.mjs"]), - imports_field: imports_field(json!({ - "#a/": "./", - "#a/dist/": "./lib/" - })), - request: "#a/dist/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #2", - expect: Some(vec!["./dist/utils/index.js"]), - imports_field: imports_field(json!({ - "#a/dist/utils/": "./dist/utils/", - "#a/dist/": "./lib/" - })), - request: "#a/dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #3", - expect: Some(vec!["./dist/utils/index.js"]), - imports_field: imports_field(json!({ - "#a/dist/utils/index.js": "./dist/utils/index.js", - "#a/dist/utils/": "./dist/utils/index.mjs", - "#a/dist/": "./lib/" - })), - request: "#a/dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #4", - expect: Some(vec!["./lib/index.mjs"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./browser/" - }, - "#a/dist/": "./lib/" - })), - request: "#a/dist/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #1", - // This behaves differently from enhanced_resolve, because `lodash/` is an an InvalidPackageConfig - // expect: Some(vec!["lodash/index.js"]), - expect: Some(vec!["./utils/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "conditional mapping folder #1", - expect: Some(vec!["./utils/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #2", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./node/" - ] - } - })), - request: "#a/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "conditional mapping folder #3", - expect: Some(vec!["./wpk/index.mjs"]), - imports_field: imports_field(json!({ - "#a/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils/" - ] - } - })), - request: "#a/index.mjs", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "incorrect exports field #1", - // We throw `PackageImportNotDefined` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "/utils/": "./a/" - })), - request: "#a/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #2", - // We throw `PackageImportNotDefined` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "/utils/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#a/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #3", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index": "./a/index.js" - })), - request: "#a/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #4", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index.mjs": "./a/index.js" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #5", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "#a/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #6", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index.mjs": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "#a/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #1", - // We don't throw in `package_imports_exports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": "./a/" - })), - request: "/utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect request #2", - // We don't throw in `package_imports_exports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #3", - // We don't throw in `package_imports_exports_resolve`, it's thrown in `package_imports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #4", - // We don't throw in `package_imports_exports_resolve`, it's thrown in `package_imports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#/", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #5", - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#a/", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #1", - // expect: Some(vec!["./dist/index"]), - expect: Some(vec!["dist/index"]), - imports_field: imports_field(json!({ - "#a/../../utils/": "./dist/" - })), - request: "#a/../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #2", - // We throw InvalidPackageTarget - // expect: Some(vec!["./dist/../../utils/index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "./dist/" - })), - request: "#a/../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #3", - // We throw InvalidPackageTarget - // expect: Some(vec!["../src/index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "../src/" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #4", - // We throw InvalidPackageTarget - // expect: Some(vec!["./utils/../../../index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": { - "browser": "./utils/../../../" - } - })), - request: "#a/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #1", - // expect: Some(vec!["moment/node_modules/lodash/dist/index.js"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": { - "browser": "moment/node_modules/" - } - })), - request: "#a/lodash/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #2", - // We throw InvalidPackageTarget - // expect: Some(vec!["../node_modules/lodash/dist/index.js"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "../node_modules/" - })), - request: "#a/lodash/dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "nested mapping #1", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": "./", - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./node/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "nested mapping #3", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["webpack"], - }, - TestCase { - name: "nested mapping #4", - // We throw NotFound - // expect: Some(vec!["moment/node/index.js"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "moment/node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["node", "browser"], - }, - TestCase { - name: "nested mapping #5", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "node"], - }, - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./node/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - TestCase { - name: "nested mapping #7", - expect: Some(vec!["./y.js"]), - imports_field: imports_field(json!({ - "#a": { - "abc": { - "def": "./x.js" - }, - "ghi": "./y.js" - } - })), - request: "#a", - condition_names: vec!["abc", "ghi"], - }, - TestCase { - name: "nested mapping #8", - // We throw PackageImportNotDefined - // expect: Some(vec![]), - expect: None, - imports_field: imports_field(json!({ - "#a": { - "abc": { - "def": "./x.js", - "default": [] - }, - "ghi": "./y.js" - } - })), - request: "#a", - condition_names: vec!["abc", "ghi"], - }, - ]; - - for case in test_cases { - let resolved = Resolver::default() - .package_imports_exports_resolve( - case.request, - &case.imports_field, - Path::new(""), - true, - &case.condition_names.iter().map(ToString::to_string).collect::>(), - &mut Ctx::default(), - ) - .map(|p| p.map(|p| p.to_path_buf())); - if let Some(expect) = case.expect { - if expect.is_empty() { - assert!(matches!(resolved, Ok(None)), "{} {:?}", &case.name, &resolved); - } else { - for expect in expect { - assert_eq!(resolved, Ok(Some(Path::new(expect).normalize())), "{}", &case.name); - } - } - } else { - assert!(resolved.is_err(), "{} {resolved:?}", &case.name); - } - } -} diff --git a/src/tests/incorrect_description_file.rs b/src/tests/incorrect_description_file.rs deleted file mode 100644 index e2caecbb..00000000 --- a/src/tests/incorrect_description_file.rs +++ /dev/null @@ -1,65 +0,0 @@ -//! - -use rustc_hash::FxHashSet; - -use crate::{JSONError, Resolution, ResolveContext, ResolveError, ResolveOptions, Resolver}; - -// should not resolve main in incorrect description file #1 -#[test] -fn incorrect_description_file_1() { - let f = super::fixture().join("incorrect-package"); - let mut ctx = ResolveContext::default(); - let resolution = Resolver::default().resolve_with_context(f.join("pack1"), ".", &mut ctx); - let error = ResolveError::JSON(JSONError { - path: f.join("pack1/package.json"), - message: String::from("EOF while parsing a value at line 3 column 0"), - line: 3, - column: 0, - }); - assert_eq!(resolution, Err(error)); - assert_eq!( - ctx.file_dependencies, - FxHashSet::from_iter([f.join("pack1"), f.join("pack1/package.json")]) - ); - assert!(!ctx.missing_dependencies.is_empty()); -} - -// should not resolve main in incorrect description file #2 -#[test] -fn incorrect_description_file_2() { - let f = super::fixture().join("incorrect-package"); - let resolution = Resolver::default().resolve(f.join("pack2"), "."); - let error = ResolveError::JSON(JSONError { - path: f.join("pack2/package.json"), - message: String::from("EOF while parsing a value at line 1 column 0"), - line: 1, - column: 0, - }); - assert_eq!(resolution, Err(error)); -} - -// should not resolve main in incorrect description file #3 -#[test] -fn incorrect_description_file_3() { - let f = super::fixture().join("incorrect-package"); - let resolution = Resolver::default().resolve(f.join("pack2"), "."); - assert!(resolution.is_err()); -} - -// `enhanced_resolve` does not have this test case -#[test] -fn no_description_file() { - let f = super::fixture_root().join("enhanced_resolve"); - - // has description file - let resolver = Resolver::default(); - assert_eq!( - resolver.resolve(&f, ".").map(Resolution::into_path_buf), - Ok(f.join("lib/index.js")) - ); - - // without description file - let resolver = - Resolver::new(ResolveOptions { description_files: vec![], ..ResolveOptions::default() }); - assert_eq!(resolver.resolve(&f, "."), Err(ResolveError::NotFound(".".into()))); -} diff --git a/src/tests/main_field.rs b/src/tests/main_field.rs deleted file mode 100644 index 3cadc8ce..00000000 --- a/src/tests/main_field.rs +++ /dev/null @@ -1,24 +0,0 @@ -//! Not part of enhanced_resolve's test suite - -use crate::{ResolveOptions, Resolver}; - -#[test] -fn test() { - let f = super::fixture().join("restrictions"); - - let resolver1 = Resolver::new(ResolveOptions { - main_fields: vec!["style".into()], - ..ResolveOptions::default() - }); - - let resolution = resolver1.resolve(&f, "pck2").map(|r| r.full_path()); - assert_eq!(resolution, Ok(f.join("node_modules/pck2/index.css"))); - - let resolver2 = resolver1.clone_with_options(ResolveOptions { - main_fields: vec!["module".into(), "main".into()], - ..ResolveOptions::default() - }); - - let resolution = resolver2.resolve(&f, "pck2").map(|r| r.full_path()); - assert_eq!(resolution, Ok(f.join("node_modules/pck2/module.js"))); -} diff --git a/src/tests/memory_fs.rs b/src/tests/memory_fs.rs deleted file mode 100644 index e4116609..00000000 --- a/src/tests/memory_fs.rs +++ /dev/null @@ -1,74 +0,0 @@ -use std::{ - io, - path::{Path, PathBuf}, -}; - -use crate::{FileMetadata, FileSystem}; - -#[derive(Default)] -pub struct MemoryFS { - fs: vfs::MemoryFS, -} - -impl MemoryFS { - /// # Panics - /// - /// * Fails to create directory - /// * Fails to write file - #[allow(dead_code)] - pub fn new(data: &[(&'static str, &'static str)]) -> Self { - let mut fs = Self { fs: vfs::MemoryFS::default() }; - for (path, content) in data { - fs.add_file(Path::new(path), content); - } - fs - } - - #[allow(dead_code)] - pub fn add_file(&mut self, path: &Path, content: &str) { - use vfs::FileSystem; - let fs = &mut self.fs; - // Create all parent directories - for path in path.ancestors().collect::>().iter().rev() { - let path = path.to_string_lossy(); - if !fs.exists(path.as_ref()).unwrap() { - fs.create_dir(path.as_ref()).unwrap(); - } - } - // Create file - let mut file = fs.create_file(path.to_string_lossy().as_ref()).unwrap(); - file.write_all(content.as_bytes()).unwrap(); - } -} - -impl FileSystem for MemoryFS { - fn read_to_string(&self, path: &Path) -> io::Result { - use vfs::FileSystem; - let mut file = self - .fs - .open_file(path.to_string_lossy().as_ref()) - .map_err(|err| io::Error::new(io::ErrorKind::NotFound, err))?; - let mut buffer = String::new(); - file.read_to_string(&mut buffer).unwrap(); - Ok(buffer) - } - - fn metadata(&self, path: &Path) -> io::Result { - use vfs::FileSystem; - let metadata = self - .fs - .metadata(path.to_string_lossy().as_ref()) - .map_err(|err| io::Error::new(io::ErrorKind::NotFound, err))?; - let is_file = metadata.file_type == vfs::VfsFileType::File; - let is_dir = metadata.file_type == vfs::VfsFileType::Directory; - Ok(FileMetadata::new(is_file, is_dir, false)) - } - - fn symlink_metadata(&self, path: &Path) -> io::Result { - self.metadata(path) - } - - fn canonicalize(&self, _path: &Path) -> io::Result { - Err(io::Error::new(io::ErrorKind::NotFound, "not a symlink")) - } -} diff --git a/src/tests/missing.rs b/src/tests/missing.rs deleted file mode 100644 index 4bf611ef..00000000 --- a/src/tests/missing.rs +++ /dev/null @@ -1,106 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/missing.test.js - -use normalize_path::NormalizePath; - -use crate::{AliasValue, ResolveContext, ResolveOptions, Resolver}; - -#[test] -fn test() { - let f = super::fixture(); - - let data = [ - ( - "./missing-file", - vec![f.join("missing-file"), f.join("missing-file.js"), f.join("missing-file.node")], - ), - ( - "missing-module", - vec![ - f.join("node_modules/missing-module"), - f.parent().unwrap().join("node_modules"), // enhanced-resolve is "node_modules/missing-module" - ], - ), - ( - "missing-module/missing-file", - vec![ - f.join("node_modules/missing-module"), - // f.parent().unwrap().join("node_modules/missing-module"), // we don't report this - ], - ), - ( - "m1/missing-file", - vec![ - f.join("node_modules/m1/missing-file"), - f.join("node_modules/m1/missing-file.js"), - f.join("node_modules/m1/missing-file.node"), - // f.parent().unwrap().join("node_modules/m1"), // we don't report this - ], - ), - ( - "m1/", - vec![ - f.join("node_modules/m1/index"), - f.join("node_modules/m1/index.js"), - f.join("node_modules/m1/index.json"), - f.join("node_modules/m1/index.node"), - ], - ), - ("m1/a", vec![f.join("node_modules/m1/a")]), - ]; - - let resolver = Resolver::default(); - - for (specifier, missing_dependencies) in data { - let mut ctx = ResolveContext::default(); - let _ = resolver.resolve_with_context(&f, specifier, &mut ctx); - - for path in ctx.file_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - } - - for path in missing_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - assert!( - ctx.missing_dependencies.contains(&path), - "{specifier}: {path:?} not in {:?}", - &ctx.missing_dependencies - ); - } - } -} - -#[test] -fn alias_and_extensions() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias: vec![ - ( - "@scope-js/package-name/dir$".into(), - vec![AliasValue::Path(f.join("foo/index.js").to_string_lossy().to_string())], - ), - ( - "react-dom".into(), - vec![AliasValue::Path(f.join("foo/index.js").to_string_lossy().to_string())], - ), - ], - extensions: vec![".server.ts".into()], - - ..ResolveOptions::default() - }); - - let mut ctx = ResolveContext::default(); - let _ = resolver.resolve_with_context(&f, "@scope-js/package-name/dir/router", &mut ctx); - let _ = resolver.resolve_with_context(&f, "react-dom/client", &mut ctx); - - for path in ctx.file_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - } - - for path in ctx.missing_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - if let Some(path) = path.parent() { - assert!(!path.is_file(), "{path:?} must not be a file"); - } - } -} diff --git a/src/tests/mod.rs b/src/tests/mod.rs deleted file mode 100644 index 94e6bd86..00000000 --- a/src/tests/mod.rs +++ /dev/null @@ -1,49 +0,0 @@ -mod alias; -mod browser_field; -mod builtins; -mod dependencies; -mod exports_field; -mod extension_alias; -mod extensions; -mod fallback; -mod full_specified; -mod imports_field; -mod incorrect_description_file; -mod main_field; -mod memory_fs; -mod missing; -mod resolve; -mod restrictions; -mod roots; -mod scoped_packages; -mod simple; -mod symlink; -mod tsconfig_paths; -mod tsconfig_project_references; - -use crate::Resolver; -use std::{env, path::PathBuf, sync::Arc, thread}; - -pub fn fixture_root() -> PathBuf { - env::current_dir().unwrap().join("fixtures") -} - -pub fn fixture() -> PathBuf { - fixture_root().join("enhanced_resolve").join("test").join("fixtures") -} - -#[test] -fn threaded_environment() { - let cwd = env::current_dir().unwrap(); - let resolver = Arc::new(Resolver::default()); - for _ in 0..2 { - _ = thread::spawn({ - let cwd = cwd.clone(); - let resolver = Arc::clone(&resolver); - move || { - _ = resolver.resolve(cwd, "."); - } - }) - .join(); - } -} diff --git a/src/tests/resolve.rs b/src/tests/resolve.rs deleted file mode 100644 index f2dbb88e..00000000 --- a/src/tests/resolve.rs +++ /dev/null @@ -1,119 +0,0 @@ -//! - -use crate::{ResolveError, ResolveOptions, Resolver}; - -#[test] -fn resolve() { - let f = super::fixture(); - - let resolver = Resolver::default(); - - let main1_js_path = f.join("main1.js").to_string_lossy().to_string(); - - #[rustfmt::skip] - let pass = [ - ("absolute path", f.clone(), main1_js_path.as_str(), f.join("main1.js")), - ("file with .js", f.clone(), "./main1.js", f.join("main1.js")), - ("file without extension", f.clone(), "./main1", f.join("main1.js")), - ("another file with .js", f.clone(), "./a.js", f.join("a.js")), - ("another file without extension", f.clone(), "./a", f.join("a.js")), - ("file in module with .js", f.clone(), "m1/a.js", f.join("node_modules/m1/a.js")), - ("file in module without extension", f.clone(), "m1/a", f.join("node_modules/m1/a.js")), - ("another file in module without extension", f.clone(), "complexm/step1", f.join("node_modules/complexm/step1.js")), - ("from submodule to file in sibling module", f.join("node_modules/complexm"), "m2/b.js", f.join("node_modules/m2/b.js")), - ("from nested directory to overwritten file in module", f.join("multiple_modules"), "m1/a.js", f.join("multiple_modules/node_modules/m1/a.js")), - ("from nested directory to not overwritten file in module", f.join("multiple_modules"), "m1/b.js", f.join("node_modules/m1/b.js")), - ("file with query", f.clone(), "./main1.js?query", f.join("main1.js?query")), - ("file with fragment", f.clone(), "./main1.js#fragment", f.join("main1.js#fragment")), - ("file with fragment and query", f.clone(), "./main1.js#fragment?query", f.join("main1.js#fragment?query")), - ("file with query and fragment", f.clone(), "./main1.js?#fragment", f.join("main1.js?#fragment")), - - ("file with query (unicode)", f.clone(), "./测试.js?query", f.join("测试.js?query")), - ("file with fragment (unicode)", f.clone(), "./测试.js#fragment", f.join("测试.js#fragment")), - ("file with fragment and query (unicode)", f.clone(), "./测试.js#fragment?query", f.join("测试.js#fragment?query")), - ("file with query and fragment (unicode)", f.clone(), "./测试.js?#fragment", f.join("测试.js?#fragment")), - - ("file in module with query", f.clone(), "m1/a?query", f.join("node_modules/m1/a.js?query")), - ("file in module with fragment", f.clone(), "m1/a#fragment", f.join("node_modules/m1/a.js#fragment")), - ("file in module with fragment and query", f.clone(), "m1/a#fragment?query", f.join("node_modules/m1/a.js#fragment?query")), - ("file in module with query and fragment", f.clone(), "m1/a?#fragment", f.join("node_modules/m1/a.js?#fragment")), - ("file in module with query and fragment", f.clone(), "m1/a?#fragment", f.join("node_modules/m1/a.js?#fragment")), - ("differ between directory and file, resolve file", f.clone(), "./dirOrFile", f.join("dirOrFile.js")), - ("differ between directory and file, resolve directory", f.clone(), "./dirOrFile/", f.join("dirOrFile/index.js")), - ("find node_modules outside of node_modules", f.join("browser-module/node_modules"), "m1/a", f.join("node_modules/m1/a.js")), - ("don't crash on main field pointing to self", f.clone(), "./main-field-self", f.join("./main-field-self/index.js")), - ("don't crash on main field pointing to self (2)", f.clone(), "./main-field-self2", f.join("./main-field-self2/index.js")), - // enhanced-resolve has `#` prepended with a `\0`, they are removed from the - // following 3 expected test results. - // See https://github.com/webpack/enhanced-resolve#escaping - ("handle fragment edge case (no fragment)", f.clone(), "./no#fragment/#/#", f.join("no#fragment/#/#.js")), - ("handle fragment edge case (fragment)", f.clone(), "./no#fragment/#/", f.join("no.js#fragment/#/")), - ("handle fragment escaping", f.clone(), "./no\0#fragment/\0#/\0##fragment", f.join("no#fragment/#/#.js#fragment")), - - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn issue238_resolve() { - let f = super::fixture().join("issue-238"); - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into(), ".jsx".into(), ".ts".into(), ".tsx".into()], - modules: vec!["src/a".into(), "src/b".into(), "src/common".into(), "node_modules".into()], - ..ResolveOptions::default() - }); - let resolved_path = - resolver.resolve(f.join("src/common"), "config/myObjectFile").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("src/common/config/myObjectFile.js")),); -} - -#[test] -fn prefer_relative() { - let f = super::fixture(); - - let resolver = - Resolver::new(ResolveOptions { prefer_relative: true, ..ResolveOptions::default() }); - - #[rustfmt::skip] - let pass = [ - ("should correctly resolve with preferRelative 1", "main1.js", f.join("main1.js")), - ("should correctly resolve with preferRelative 2", "m1/a.js", f.join("node_modules/m1/a.js")), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } -} - -#[test] -fn resolve_to_context() { - let f = super::fixture(); - let resolver = - Resolver::new(ResolveOptions { resolve_to_context: true, ..ResolveOptions::default() }); - - #[rustfmt::skip] - let data = [ - ("context for fixtures", f.clone(), "./", f.clone()), - ("context for fixtures/lib", f.clone(), "./lib", f.join("lib")), - ("context for fixtures with ..", f.clone(), "./lib/../../fixtures/./lib/..", f.clone()), - ("context for fixtures with query", f.clone(), "./?query", f.clone().with_file_name("fixtures?query")), - ]; - - for (comment, path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn resolve_hash_as_module() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions::default()); - let resolution = resolver.resolve(f, "#a"); - assert_eq!(resolution, Err(ResolveError::NotFound("#a".into()))); -} diff --git a/src/tests/restrictions.rs b/src/tests/restrictions.rs deleted file mode 100644 index 5ba56596..00000000 --- a/src/tests/restrictions.rs +++ /dev/null @@ -1,25 +0,0 @@ -//! - -use crate::{ResolveError, ResolveOptions, Resolver, Restriction}; - -// TODO: regex -// * should respect RegExp restriction -// * should try to find alternative #1 -// * should try to find alternative #2 -// * should try to find alternative #3 - -// should respect string restriction -#[test] -fn restriction1() { - let fixture = super::fixture(); - let f = fixture.join("restrictions"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - restrictions: vec![Restriction::Path(f.clone())], - ..ResolveOptions::default() - }); - - let resolution = resolver.resolve(&f, "pck2"); - assert_eq!(resolution, Err(ResolveError::Restriction(fixture.join("c.js"), f))); -} diff --git a/src/tests/roots.rs b/src/tests/roots.rs deleted file mode 100644 index b50e2a07..00000000 --- a/src/tests/roots.rs +++ /dev/null @@ -1,92 +0,0 @@ -//! - -use std::path::PathBuf; - -use crate::{AliasValue, ResolveError, ResolveOptions, Resolver}; - -fn dirname() -> PathBuf { - super::fixture_root().join("enhanced_resolve").join("test") -} - -#[test] -fn roots() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - alias: vec![("foo".into(), vec![AliasValue::from("/fixtures")])], - roots: vec![dirname(), f.clone()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should respect roots option", "/fixtures/b.js", f.join("b.js")), - ("should try another root option, if it exists", "/b.js", f.join("b.js")), - ("should respect extension", "/fixtures/b", f.join("b.js")), - ("should resolve in directory", "/fixtures/extensions/dir", f.join("extensions/dir/index.js")), - ("should respect aliases", "foo/b", f.join("b.js")), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } - - #[rustfmt::skip] - let fail = [ - ("should not work with relative path", "fixtures/b.js", ResolveError::NotFound("fixtures/b.js".into())) - ]; - - for (comment, request, expected) in fail { - let resolution = resolver.resolve(&f, request); - assert_eq!(resolution, Err(expected), "{comment} {request}"); - } -} - -#[test] -fn resolve_to_context() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - roots: vec![dirname(), f.clone()], - resolve_to_context: true, - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f, "/fixtures/lib").map(|r| r.full_path()); - let expected = f.join("lib"); - assert_eq!(resolved_path, Ok(expected)); -} - -#[test] -fn prefer_absolute() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - alias: vec![("foo".into(), vec![AliasValue::from("/fixtures")])], - roots: vec![dirname(), f.clone()], - prefer_absolute: true, - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve an absolute path (prefer absolute)", f.join("b.js").to_string_lossy().to_string(), f.join("b.js")), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(&f, &request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } -} - -#[test] -fn roots_fall_through() { - let f = super::fixture(); - let absolute_path = f.join("roots_fall_through/index.js"); - let specifier = absolute_path.to_string_lossy(); - let resolution = Resolver::new(ResolveOptions::default().with_root(&f)).resolve(&f, &specifier); - assert_eq!( - resolution.map(super::super::resolution::Resolution::into_path_buf), - Ok(absolute_path) - ); -} diff --git a/src/tests/scoped_packages.rs b/src/tests/scoped_packages.rs deleted file mode 100644 index 8258f00f..00000000 --- a/src/tests/scoped_packages.rs +++ /dev/null @@ -1,25 +0,0 @@ -//! - -use crate::{ResolveOptions, Resolver}; - -#[test] -fn scoped_packages() { - let f = super::fixture().join("scoped"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("main field should work", f.clone(), "@scope/pack1", f.join("./node_modules/@scope/pack1/main.js")), - ("browser field should work", f.clone(), "@scope/pack2", f.join("./node_modules/@scope/pack2/main.js")), - ("folder request should work", f.clone(), "@scope/pack2/lib", f.join("./node_modules/@scope/pack2/lib/index.js")) - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} diff --git a/src/tests/simple.rs b/src/tests/simple.rs deleted file mode 100644 index 08e1238a..00000000 --- a/src/tests/simple.rs +++ /dev/null @@ -1,68 +0,0 @@ -//! - -use std::env; - -use crate::Resolver; - -#[test] -fn simple() { - // mimic `enhanced-resolve/test/simple.test.js` - let dirname = env::current_dir().unwrap().join("fixtures"); - let f = dirname.join("enhanced_resolve/test"); - - let resolver = Resolver::default(); - - let data = [ - ("direct", f.clone(), "../lib/index"), - ("as directory", f, ".."), - ("as module", dirname.clone(), "./enhanced_resolve"), - ]; - - for (comment, path, request) in data { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - let expected = dirname.join("enhanced_resolve/lib/index.js"); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn dashed_name() { - let f = super::fixture(); - - let resolver = Resolver::default(); - - let data = [ - (f.clone(), "dash", f.join("node_modules/dash/index.js")), - (f.clone(), "dash-name", f.join("node_modules/dash-name/index.js")), - (f.join("node_modules/dash"), "dash", f.join("node_modules/dash/index.js")), - (f.join("node_modules/dash"), "dash-name", f.join("node_modules/dash-name/index.js")), - (f.join("node_modules/dash-name"), "dash", f.join("node_modules/dash/index.js")), - (f.join("node_modules/dash-name"), "dash-name", f.join("node_modules/dash-name/index.js")), - ]; - - for (path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{path:?} {request}"); - } -} - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows { - use super::super::memory_fs::MemoryFS; - - use crate::ResolveOptions; - - #[test] - fn no_package() { - use crate::ResolverGeneric; - use std::path::Path; - let f = Path::new("/"); - let file_system = MemoryFS::new(&[]); - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions::default(), - ); - let resolved_path = resolver.resolve(f, "package"); - assert!(resolved_path.is_err()); - } -} diff --git a/src/tests/symlink.rs b/src/tests/symlink.rs deleted file mode 100644 index 7589b560..00000000 --- a/src/tests/symlink.rs +++ /dev/null @@ -1,121 +0,0 @@ -use std::{fs, io, path::Path}; - -use crate::{ResolveOptions, Resolver}; - -#[derive(Debug, Clone, Copy)] -enum FileType { - File, - Dir, -} - -#[allow(unused_variables)] -fn symlink, Q: AsRef>( - original: P, - link: Q, - file_type: FileType, -) -> io::Result<()> { - #[cfg(target_family = "unix")] - { - std::os::unix::fs::symlink(original, link) - } - - #[cfg(target_family = "windows")] - match file_type { - FileType::File => std::os::windows::fs::symlink_file(original, link), - FileType::Dir => std::os::windows::fs::symlink_dir(original, link), - } -} - -fn init(dirname: &Path, temp_path: &Path) -> io::Result<()> { - if temp_path.exists() { - _ = fs::remove_dir_all(temp_path); - } - fs::create_dir(temp_path)?; - symlink(dirname.join("../lib/index.js"), temp_path.join("test"), FileType::File)?; - symlink(dirname.join("../lib"), temp_path.join("test2"), FileType::Dir)?; - fs::remove_file(temp_path.join("test"))?; - fs::remove_file(temp_path.join("test2"))?; - fs::remove_dir(temp_path) -} - -fn create_symlinks(dirname: &Path, temp_path: &Path) -> io::Result<()> { - fs::create_dir(temp_path).unwrap(); - symlink( - dirname.join("../lib/index.js").canonicalize().unwrap(), - temp_path.join("index.js"), - FileType::File, - )?; - symlink(dirname.join("../lib").canonicalize().unwrap(), temp_path.join("lib"), FileType::Dir)?; - symlink(dirname.join("..").canonicalize().unwrap(), temp_path.join("this"), FileType::Dir)?; - symlink(temp_path.join("this"), temp_path.join("that"), FileType::Dir)?; - symlink(Path::new("../../lib/index.js"), temp_path.join("node.relative.js"), FileType::File)?; - symlink( - Path::new("./node.relative.js"), - temp_path.join("node.relative.sym.js"), - FileType::File, - )?; - Ok(()) -} - -fn cleanup_symlinks(temp_path: &Path) { - _ = fs::remove_dir_all(temp_path); -} - -#[test] -fn test() -> io::Result<()> { - let root = super::fixture_root().join("enhanced_resolve"); - let dirname = root.join("test"); - let temp_path = dirname.join("temp"); - if !temp_path.exists() { - let is_admin = init(&dirname, &temp_path).is_ok(); - if !is_admin { - return Ok(()); - } - if let Err(err) = create_symlinks(&dirname, &temp_path) { - cleanup_symlinks(&temp_path); - return Err(err); - } - } - - let resolver_without_symlinks = - Resolver::new(ResolveOptions { symlinks: false, ..ResolveOptions::default() }); - let resolver_with_symlinks = Resolver::default(); - - #[rustfmt::skip] - let pass = [ - ("with a symlink to a file", temp_path.clone(), "./index.js"), - ("with a relative symlink to a file", temp_path.clone(), "./node.relative.js"), - ("with a relative symlink to a symlink to a file", temp_path.clone(), "./node.relative.sym.js"), - ("with a symlink to a directory 1", temp_path.clone(), "./lib/index.js"), - ("with a symlink to a directory 2", temp_path.clone(), "./this/lib/index.js"), - ("with multiple symlinks in the path 1", temp_path.clone(), "./this/test/temp/index.js"), - ("with multiple symlinks in the path 2", temp_path.clone(), "./this/test/temp/lib/index.js"), - ("with multiple symlinks in the path 3", temp_path.clone(), "./this/test/temp/this/lib/index.js"), - ("with a symlink to a directory 2 (chained)", temp_path.clone(), "./that/lib/index.js"), - ("with multiple symlinks in the path 1 (chained)", temp_path.clone(), "./that/test/temp/index.js"), - ("with multiple symlinks in the path 2 (chained)", temp_path.clone(), "./that/test/temp/lib/index.js"), - ("with multiple symlinks in the path 3 (chained)", temp_path.clone(), "./that/test/temp/that/lib/index.js"), - ("with symlinked directory as context 1", temp_path.join( "lib"), "./index.js"), - ("with symlinked directory as context 2", temp_path.join( "this"), "./lib/index.js"), - ("with symlinked directory as context and in path", temp_path.join( "this"), "./test/temp/lib/index.js"), - ("with symlinked directory in context path", temp_path.join( "this/lib"), "./index.js"), - ("with symlinked directory in context path and symlinked file", temp_path.join( "this/test"), "./temp/index.js"), - ("with symlinked directory in context path and symlinked directory", temp_path.join( "this/test"), "./temp/lib/index.js"), - ("with symlinked directory as context 2 (chained)", temp_path.join( "that"), "./lib/index.js"), - ("with symlinked directory as context and in path (chained)", temp_path.join( "that"), "./test/temp/lib/index.js"), - ("with symlinked directory in context path (chained)", temp_path.join( "that/lib"), "./index.js"), - ("with symlinked directory in context path and symlinked file (chained)", temp_path.join( "that/test"), "./temp/index.js"), - ("with symlinked directory in context path and symlinked directory (chained)", temp_path.join( "that/test"), "./temp/lib/index.js") - ]; - - for (comment, path, request) in pass { - let filename = resolver_with_symlinks.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(filename, Ok(root.join("lib/index.js")), "{comment:?}"); - - let resolved_path = - resolver_without_symlinks.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(path.join(request))); - } - - Ok(()) -} diff --git a/src/tests/tsconfig_paths.rs b/src/tests/tsconfig_paths.rs deleted file mode 100644 index b85bf6be..00000000 --- a/src/tests/tsconfig_paths.rs +++ /dev/null @@ -1,530 +0,0 @@ -//! tests for tsconfig-paths -//! -//! Fixtures copied from . - -use std::path::{Path, PathBuf}; - -use crate::{ - JSONError, ResolveError, ResolveOptions, Resolver, TsConfig, TsconfigOptions, - TsconfigReferences, -}; - -// -#[test] -fn tsconfig() { - let f = super::fixture_root().join("tsconfig"); - - #[rustfmt::skip] - let pass = [ - (f.clone(), None, "ts-path", f.join("foo.js")), - (f.join("nested"), None, "ts-path", f.join("nested/test.js")), - (f.join("cases/index"), None, "foo", f.join("node_modules/tsconfig-index/foo.js")), - // This requires reading package.json.tsconfig field - // (f.join("cases/field"), "foo", f.join("node_modules/tsconfig-field/foo.js")) - (f.join("cases/exports"), None, "foo", f.join("node_modules/tsconfig-exports/foo.js")), - (f.join("cases/extends-extension"), None, "foo", f.join("cases/extends-extension/foo.js")), - (f.join("cases/extends-extensionless"), None, "foo", f.join("node_modules/tsconfig-field/foo.js")), - (f.join("cases/extends-paths"), Some("src"), "@/index", f.join("cases/extends-paths/src/index.js")), - (f.join("cases/extends-multiple"), None, "foo", f.join("cases/extends-multiple/foo.js")), - ]; - - for (dir, subdir, request, expected) in pass { - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: dir.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - let path = subdir.map_or(dir.clone(), |subdir| dir.join(subdir)); - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{request} {path:?}"); - } - - #[rustfmt::skip] - let data = [ - (f.join("node_modules/tsconfig-not-used"), "ts-path", Ok(f.join("foo.js"))), - ]; - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - for (path, request, expected) in data { - let resolution = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolution, expected, "{path:?} {request}"); - } -} - -#[test] -fn tsconfig_fallthrough() { - let f = super::fixture_root().join("tsconfig"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "/"); - assert_eq!(resolved_path, Err(ResolveError::NotFound("/".into()))); -} - -#[test] -fn json_with_comments() { - let f = super::fixture_root().join("tsconfig/cases/trailing-comma"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "foo").map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(f.join("bar.js"))); -} - -#[test] -fn broken() { - let f = super::fixture_root().join("tsconfig"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("tsconfig_broken.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "/"); - let error = ResolveError::JSON(JSONError { - path: f.join("tsconfig_broken.json"), - message: String::from("EOF while parsing an object at line 2 column 0"), - line: 2, - column: 0, - }); - assert_eq!(resolved_path, Err(error)); -} - -// -#[test] -fn test_paths() { - let path = Path::new("/foo/tsconfig.json"); - let mut tsconfig_json = serde_json::json!({ - "compilerOptions": { - "paths": { - "jquery": ["node_modules/jquery/dist/jquery"], - "*": ["generated/*"], - "bar/*": ["test/*"], - "bar/baz/*": ["baz/*", "yo/*"], - "@/components/*": ["components/*"], - "url": ["node_modules/my-url"], - } - } - }) - .to_string(); - let tsconfig = TsConfig::parse(true, path, &mut tsconfig_json).unwrap(); - - let data = [ - ("jquery", vec!["/foo/node_modules/jquery/dist/jquery"]), - ("test", vec!["/foo/generated/test"]), - ("test/hello", vec!["/foo/generated/test/hello"]), - ("bar/hi", vec!["/foo/test/hi"]), - ("bar/baz/hi", vec!["/foo/baz/hi", "/foo/yo/hi"]), - ("@/components/button", vec!["/foo/components/button"]), - ("./jquery", vec![]), - ("url", vec!["/foo/node_modules/my-url"]), - ]; - - for (specifier, expected) in data { - let paths = tsconfig.resolve_path_alias(specifier); - let expected = expected.into_iter().map(PathBuf::from).collect::>(); - assert_eq!(paths, expected, "{specifier}"); - } -} - -// -#[test] -fn test_base_url() { - let path = Path::new("/foo/tsconfig.json"); - let mut tsconfig_json = serde_json::json!({ - "compilerOptions": { - "baseUrl": "./src" - } - }) - .to_string(); - let tsconfig = TsConfig::parse(true, path, &mut tsconfig_json).unwrap(); - - let data = [ - ("foo", vec!["/foo/src/foo"]), - ("components/button", vec!["/foo/src/components/button"]), - ("./jquery", vec![]), - ]; - - for (specifier, expected) in data { - let paths = tsconfig.resolve_path_alias(specifier); - let expected = expected.into_iter().map(PathBuf::from).collect::>(); - assert_eq!(paths, expected, "{specifier}"); - } -} - -// -#[test] -fn test_paths_and_base_url() { - let path = Path::new("/foo/tsconfig.json"); - let mut tsconfig_json = serde_json::json!({ - "compilerOptions": { - "baseUrl": "./src", - "paths": { - "*": ["generated/*"], - "bar/*": ["test/*"], - "bar/baz/*": ["baz/*", "yo/*"], - "@/components/*": ["components/*"] - } - } - }) - .to_string(); - let tsconfig = TsConfig::parse(true, path, &mut tsconfig_json).unwrap(); - - let data = [ - ("test", vec!["/foo/src/generated/test", "/foo/src/test"]), - ("test/hello", vec!["/foo/src/generated/test/hello", "/foo/src/test/hello"]), - ("bar/hi", vec!["/foo/src/test/hi", "/foo/src/bar/hi"]), - ("bar/baz/hi", vec!["/foo/src/baz/hi", "/foo/src/yo/hi", "/foo/src/bar/baz/hi"]), - ("@/components/button", vec!["/foo/src/components/button", "/foo/src/@/components/button"]), - ("./jquery", vec![]), - ]; - - for (specifier, expected) in data { - let paths = tsconfig.resolve_path_alias(specifier); - let expected = expected.into_iter().map(PathBuf::from).collect::>(); - assert_eq!(paths, expected, "{specifier}"); - } -} - -// Template variable ${configDir} for substitution of config files directory path -// https://github.com/microsoft/TypeScript/pull/58042 -#[test] -fn test_template_variable() { - let f = super::fixture_root().join("tsconfig"); - let f2 = f.join("cases").join("paths_template_variable"); - - #[rustfmt::skip] - let pass = [ - (f2.clone(), "tsconfig1.json", "foo", f2.join("foo.js")), - (f2.clone(), "tsconfig2.json", "foo", f2.join("foo.js")), - (f.clone(), "tsconfig_template_variable.json", "foo", f.join("foo.js")), - ]; - - for (dir, tsconfig, request, expected) in pass { - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: dir.join(tsconfig), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&dir, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{request} {tsconfig} {dir:?}"); - } -} - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows_test { - use std::path::{Path, PathBuf}; - - use crate::{ - ResolveError, ResolveOptions, ResolverGeneric, TsconfigOptions, TsconfigReferences, - }; - - use super::super::memory_fs::MemoryFS; - - struct OneTest { - name: &'static str, - tsconfig: String, - package_json: Option<(PathBuf, String)>, - main_fields: Option>, - existing_files: Vec<&'static str>, - requested_module: &'static str, - expected_path: &'static str, - extensions: Vec, - } - - impl Default for OneTest { - fn default() -> Self { - Self { - name: "", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/*": ["location/*"] - } - } - }) - .to_string(), - package_json: None, - main_fields: None, - existing_files: vec![], - requested_module: "", - expected_path: "", - extensions: vec![ - ".js".into(), - ".json".into(), - ".node".into(), - ".ts".into(), - ".tsx".into(), - ], - } - } - } - - impl OneTest { - fn resolver(&self, root: &Path) -> ResolverGeneric { - let mut file_system = MemoryFS::default(); - - file_system.add_file(&root.join("tsconfig.json"), &self.tsconfig); - if let Some((path, package_json)) = &self.package_json { - file_system.add_file(&root.join(path).join("package.json"), package_json); - } - for path in &self.existing_files { - file_system.add_file(Path::new(path), ""); - } - - let mut options = ResolveOptions { - extensions: self.extensions.clone(), - tsconfig: Some(TsconfigOptions { - config_file: root.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }; - if let Some(main_fields) = &self.main_fields { - options.main_fields.clone_from(main_fields); - } - - ResolverGeneric::::new_with_file_system(file_system, options) - } - } - - // Path matching tests from tsconfig-paths - // * - // * - #[test] - fn match_path() { - let pass = [ - OneTest { - name: "should locate path that matches with star and exists", - existing_files: vec!["/root/location/mylib/index.ts"], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve to correct path when many are specified", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/*": ["foo1/*", "foo2/*", "location/*", "foo3/*"], - } - } - }) - .to_string(), - existing_files: vec!["/root/location/mylib/index.ts"], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should locate path that matches with star and prioritize pattern with longest prefix", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "*": ["location/*"], - "lib/*": ["location/*"], - } - } - }) - .to_string(), - existing_files: vec![ - "/root/location/lib/mylib/index.ts", - "/root/location/mylib/index.ts", - ], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should locate path that matches with star and exists with extension", - existing_files: vec![ - "/root/location/mylib.myext", - ], - requested_module: "lib/mylib", - extensions: vec![".js".into(), ".myext".into()], - expected_path: "/root/location/mylib.myext", - ..OneTest::default() - }, - OneTest { - name: "should resolve request with extension specified", - existing_files: vec![ - "/root/location/test.jpg", - ], - requested_module: "lib/test.jpg", - expected_path: "/root/location/test.jpg", - ..OneTest::default() - }, - OneTest { - name: "should locate path that matches without star and exists", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/foo": ["location/foo"] - } - } - }) - .to_string(), - existing_files: vec![ - "/root/location/foo.ts", - ], - requested_module: "lib/foo", - expected_path: "/root/location/foo.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve to parent folder when filename is in subfolder", - existing_files: vec![ - "/root/location/mylib/index.ts", - ], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve from main field in package.json", - package_json: Some((PathBuf::from("/root/location/mylib"), serde_json::json!({ - "main": "./kalle.ts" - }).to_string())), - existing_files: vec![ - "/root/location/mylib/kalle.ts", - ], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/kalle.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve from main field in package.json (js)", - package_json: Some((PathBuf::from("/root/location/mylib.js"), serde_json::json!({ - "main": "./kalle.js" - }).to_string())), - existing_files: vec![ - "/root/location/mylib.js/kalle.js", - ], - extensions: vec![".ts".into(), ".js".into()], - requested_module: "lib/mylib.js", - expected_path: "/root/location/mylib.js/kalle.js", - ..OneTest::default() - }, - OneTest { - name: "should resolve from list of fields by priority in package.json", - main_fields: Some(vec!["missing".into(), "browser".into(), "main".into()]), - package_json: Some((PathBuf::from("/root/location/mylibjs"), serde_json::json!({ - "main": "./main.js", - "browser": "./browser.js" - }).to_string())), - existing_files: vec![ - "/root/location/mylibjs/main.js", - "/root/location/mylibjs/browser.js", - ], - extensions: vec![".ts".into(), ".js".into()], - requested_module: "lib/mylibjs", - expected_path: "/root/location/mylibjs/browser.js", - ..OneTest::default() - }, -OneTest { - name: "should ignore field mappings to missing files in package.json", - main_fields: Some(vec!["browser".into(), "main".into()]), - package_json: Some((PathBuf::from("/root/location/mylibjs"), serde_json::json!({ - "main": "./kalle.js", - "browser": "./nope.js" - }).to_string())), - existing_files: vec![ - "/root/location/mylibjs/kalle.js", - ], - extensions: vec![".ts".into(), ".js".into()], - requested_module: "lib/mylibjs", - expected_path: "/root/location/mylibjs/kalle.js", - ..OneTest::default() - }, - // Tests that are not applicable: - // name: "should resolve nested main fields" - // name: "should ignore advanced field mappings in package.json" - // name: "should resolve to with the help of baseUrl when not explicitly set" - // name: "should not resolve with the help of baseUrl when asked not to" - // name: "should resolve main file with cjs file extension" - OneTest { - name: "should resolve .ts from .js alias", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "@/*": ["src/*"] - } - } - }).to_string(), - existing_files: vec![ - "/root/src/foo.ts", - ], - requested_module: "@/foo", // original data was "@/foo.ts" but I don't get why it is the case? - expected_path: "/root/src/foo.ts", // original data was "/root/src/foo" - ..OneTest::default() - }, - ]; - - let root = PathBuf::from("/root"); - - for test in pass { - let resolved_path = - test.resolver(&root).resolve(&root, test.requested_module).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(PathBuf::from(test.expected_path)), "{}", test.name); - } - - let fail = [ - OneTest { - name: "should not locate path that does not match", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/*": ["location/*"] - } - } - }) - .to_string(), - existing_files: vec!["/root/location/mylib"], - requested_module: "lib/mylibjs", - ..OneTest::default() - }, - OneTest { - name: "should not resolve typings file (index.d.ts)", - existing_files: vec!["/root/location/mylib/index.d.ts"], - requested_module: "lib/mylib", - ..OneTest::default() - }, - ]; - - for test in fail { - let resolved_path = - test.resolver(&root).resolve(&root, test.requested_module).map(|f| f.full_path()); - assert_eq!( - resolved_path, - Err(ResolveError::NotFound(test.requested_module.into())), - "{}", - test.name - ); - } - } -} diff --git a/src/tests/tsconfig_project_references.rs b/src/tests/tsconfig_project_references.rs deleted file mode 100644 index 0d019d27..00000000 --- a/src/tests/tsconfig_project_references.rs +++ /dev/null @@ -1,132 +0,0 @@ -//! Tests for tsconfig project references - -use crate::{ResolveError, ResolveOptions, Resolver, TsconfigOptions, TsconfigReferences}; - -#[test] -fn auto() { - let f = super::fixture_root().join("tsconfig/cases/project_references"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("app"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - // Test normal paths alias - (f.join("app"), "@/index.ts", f.join("app/aliased/index.ts")), - (f.join("app"), "@/../index.ts", f.join("app/index.ts")), - // Test project reference - (f.join("project_a"), "@/index.ts", f.join("project_a/aliased/index.ts")), - (f.join("project_b/src"), "@/index.ts", f.join("project_b/src/aliased/index.ts")), - // Does not have paths alias - (f.join("project_a"), "./index.ts", f.join("project_a/index.ts")), - (f.join("project_c"), "./index.ts", f.join("project_c/index.ts")), - // Template variable - { - let dir = f.parent().unwrap().join("paths_template_variable"); - (dir.clone(), "foo", dir.join("foo.js")) - } - ]; - - for (path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{request} {path:?}"); - } -} - -#[test] -fn disabled() { - let f = super::fixture_root().join("tsconfig/cases/project_references"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("app"), - references: TsconfigReferences::Disabled, - }), - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - // Test normal paths alias - (f.join("app"), "@/index.ts", Ok(f.join("app/aliased/index.ts"))), - (f.join("app"), "@/../index.ts", Ok(f.join("app/index.ts"))), - // Test project reference - (f.join("project_a"), "@/index.ts", Err(ResolveError::NotFound("@/index.ts".into()))), - (f.join("project_b/src"), "@/index.ts", Err(ResolveError::NotFound("@/index.ts".into()))), - // Does not have paths alias - (f.join("project_a"), "./index.ts", Ok(f.join("project_a/index.ts"))), - (f.join("project_c"), "./index.ts", Ok(f.join("project_c/index.ts"))), - ]; - - for (path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, expected, "{request} {path:?}"); - } -} - -#[test] -fn manual() { - let f = super::fixture_root().join("tsconfig/cases/project_references"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("app"), - references: TsconfigReferences::Paths(vec!["../project_a/conf.json".into()]), - }), - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - // Test normal paths alias - (f.join("app"), "@/index.ts", Ok(f.join("app/aliased/index.ts"))), - (f.join("app"), "@/../index.ts", Ok(f.join("app/index.ts"))), - // Test project reference - (f.join("project_a"), "@/index.ts", Ok(f.join("project_a/aliased/index.ts"))), - (f.join("project_b/src"), "@/index.ts", Err(ResolveError::NotFound("@/index.ts".into()))), - // Does not have paths alias - (f.join("project_a"), "./index.ts", Ok(f.join("project_a/index.ts"))), - (f.join("project_c"), "./index.ts", Ok(f.join("project_c/index.ts"))), - ]; - - for (path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, expected, "{request} {path:?}"); - } -} - -#[test] -fn self_reference() { - let f = super::fixture_root().join("tsconfig/cases/project_references"); - - #[rustfmt::skip] - let pass = [ - (f.join("app"), vec!["./tsconfig.json".into()]), - (f.join("app/tsconfig.json"), vec!["./tsconfig.json".into()]), - (f.join("app"), vec![f.join("app")]), - (f.join("app/tsconfig.json"), vec![f.join("app")]), - (f.join("app/tsconfig.json"), vec![f.join("project_b"), f.join("app")]), - ]; - - for (config_file, reference_paths) in pass { - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: config_file.clone(), - references: TsconfigReferences::Paths(reference_paths.clone()), - }), - ..ResolveOptions::default() - }); - let path = f.join("app"); - let resolved_path = resolver.resolve(&path, "@/index.ts").map(|f| f.full_path()); - assert_eq!( - resolved_path, - Err(ResolveError::TsconfigSelfReference(f.join("app/tsconfig.json"))), - "{config_file:?} {reference_paths:?}" - ); - } -} diff --git a/src/tsconfig.rs b/src/tsconfig.rs deleted file mode 100644 index 0de8e8ec..00000000 --- a/src/tsconfig.rs +++ /dev/null @@ -1,223 +0,0 @@ -use std::{ - hash::BuildHasherDefault, - path::{Path, PathBuf}, - sync::Arc, -}; - -use indexmap::IndexMap; -use rustc_hash::FxHasher; -use serde::Deserialize; - -use crate::PathUtil; - -pub type CompilerOptionsPathsMap = IndexMap, BuildHasherDefault>; - -#[derive(Debug, Clone, Eq, PartialEq, Deserialize)] -#[serde(untagged)] -pub enum ExtendsField { - Single(String), - Multiple(Vec), -} - -#[derive(Debug, Deserialize)] -#[serde(rename_all = "camelCase")] -pub struct TsConfig { - /// Whether this is the caller tsconfig. - /// Used for final template variable substitution when all configs are extended and merged. - #[serde(skip)] - root: bool, - - /// Path to `tsconfig.json`. Contains the `tsconfig.json` filename. - #[serde(skip)] - pub(crate) path: PathBuf, - - #[serde(default)] - pub extends: Option, - - #[serde(default)] - pub compiler_options: CompilerOptions, - - /// Bubbled up project references with a reference to their tsconfig. - #[serde(default)] - pub references: Vec, -} - -/// Compiler Options -/// -/// -#[derive(Debug, Default, Deserialize)] -#[serde(rename_all = "camelCase")] -pub struct CompilerOptions { - base_url: Option, - - /// Path aliases - paths: Option, - - /// The actual base for where path aliases are resolved from. - #[serde(skip)] - paths_base: PathBuf, -} - -/// Project Reference -/// -/// -#[derive(Debug, Deserialize)] -pub struct ProjectReference { - /// The path property of each reference can point to a directory containing a tsconfig.json file, - /// or to the config file itself (which may have any name). - pub path: PathBuf, - - /// Reference to the resolved tsconfig - #[serde(skip)] - pub tsconfig: Option>, -} - -impl TsConfig { - pub fn parse(root: bool, path: &Path, json: &mut str) -> Result { - _ = json_strip_comments::strip(json); - let mut tsconfig: Self = serde_json::from_str(json)?; - tsconfig.root = root; - tsconfig.path = path.to_path_buf(); - let directory = tsconfig.directory().to_path_buf(); - if let Some(base_url) = tsconfig.compiler_options.base_url { - tsconfig.compiler_options.base_url = Some(directory.normalize_with(base_url)); - } - if tsconfig.compiler_options.paths.is_some() { - tsconfig.compiler_options.paths_base = - tsconfig.compiler_options.base_url.as_ref().map_or(directory, Clone::clone); - } - Ok(tsconfig) - } - - pub fn build(mut self) -> Self { - if self.root { - let dir = self.directory().to_path_buf(); - // Substitute template variable in `tsconfig.compilerOptions.paths` - if let Some(paths) = &mut self.compiler_options.paths { - for paths in paths.values_mut() { - for path in paths { - Self::substitute_template_variable(&dir, path); - } - } - } - } - self - } - - /// Directory to `tsconfig.json` - /// - /// # Panics - /// - /// * When the `tsconfig.json` path is misconfigured. - pub fn directory(&self) -> &Path { - debug_assert!(self.path.file_name().is_some()); - self.path.parent().unwrap() - } - - pub fn extend_tsconfig(&mut self, tsconfig: &Self) { - let compiler_options = &mut self.compiler_options; - if compiler_options.paths.is_none() { - compiler_options.paths_base = compiler_options - .base_url - .as_ref() - .map_or_else(|| tsconfig.compiler_options.paths_base.clone(), Clone::clone); - compiler_options.paths.clone_from(&tsconfig.compiler_options.paths); - } - if compiler_options.base_url.is_none() { - compiler_options.base_url.clone_from(&tsconfig.compiler_options.base_url); - } - } - - pub fn resolve(&self, path: &Path, specifier: &str) -> Vec { - if path.starts_with(self.base_path()) { - let paths = self.resolve_path_alias(specifier); - if !paths.is_empty() { - return paths; - } - } - for tsconfig in self.references.iter().filter_map(|reference| reference.tsconfig.as_ref()) { - if path.starts_with(tsconfig.base_path()) { - return tsconfig.resolve_path_alias(specifier); - } - } - vec![] - } - - // Copied from parcel - // - pub fn resolve_path_alias(&self, specifier: &str) -> Vec { - if specifier.starts_with(|s| s == '/' || s == '.') { - return vec![]; - } - - let base_url_iter = self - .compiler_options - .base_url - .as_ref() - .map_or_else(Vec::new, |base_url| vec![base_url.normalize_with(specifier)]); - - let Some(paths_map) = &self.compiler_options.paths else { - return base_url_iter; - }; - - let paths = paths_map.get(specifier).map_or_else( - || { - let mut longest_prefix_length = 0; - let mut longest_suffix_length = 0; - let mut best_key: Option<&String> = None; - - for key in paths_map.keys() { - if let Some((prefix, suffix)) = key.split_once('*') { - if (best_key.is_none() || prefix.len() > longest_prefix_length) - && specifier.starts_with(prefix) - && specifier.ends_with(suffix) - { - longest_prefix_length = prefix.len(); - longest_suffix_length = suffix.len(); - best_key.replace(key); - } - } - } - - best_key.and_then(|key| paths_map.get(key)).map_or_else(Vec::new, |paths| { - paths - .iter() - .map(|path| { - path.replace( - '*', - &specifier[longest_prefix_length - ..specifier.len() - longest_suffix_length], - ) - }) - .collect::>() - }) - }, - Clone::clone, - ); - - paths - .into_iter() - .map(|p| self.compiler_options.paths_base.normalize_with(p)) - .chain(base_url_iter) - .collect() - } - - fn base_path(&self) -> &Path { - self.compiler_options - .base_url - .as_ref() - .map_or_else(|| self.directory(), |path| path.as_ref()) - } - - /// Template variable `${configDir}` for substitution of config files directory path - /// - /// NOTE: All tests cases are just a head replacement of `${configDir}`, so we are constrained as such. - /// - /// See - fn substitute_template_variable(directory: &Path, path: &mut String) { - const TEMPLATE_VARIABLE: &str = "${configDir}/"; - if let Some(stripped_path) = path.strip_prefix(TEMPLATE_VARIABLE) { - *path = directory.join(stripped_path).to_string_lossy().to_string(); - } - } -} diff --git a/tests/integration_test.rs b/tests/integration_test.rs deleted file mode 100644 index 0fc52887..00000000 --- a/tests/integration_test.rs +++ /dev/null @@ -1,103 +0,0 @@ -//! Test public APIs - -use std::{env, path::PathBuf}; - -use oxc_resolver::{EnforceExtension, Resolution, ResolveContext, ResolveOptions, Resolver}; - -fn dir() -> PathBuf { - env::current_dir().unwrap() -} - -fn resolve(specifier: &str) -> Resolution { - let path = dir(); - Resolver::new(ResolveOptions::default()).resolve(path, specifier).unwrap() -} - -#[test] -fn clone() { - let resolution = resolve("./tests/package.json"); - assert_eq!(resolution.clone(), resolution); -} - -#[test] -fn debug() { - let resolution = resolve("./tests/package.json"); - let s = format!("{resolution:?}"); - assert!(!s.is_empty()); -} - -#[test] -fn eq() { - let resolution = resolve("./tests/package.json"); - assert_eq!(resolution, resolution); -} - -#[test] -fn package_json() { - let resolution = resolve("./tests/package.json"); - let package_json = resolution.package_json().unwrap(); - assert_eq!(package_json.name.as_ref().unwrap(), "name"); - assert_eq!(package_json.r#type.as_ref().unwrap().as_str(), "module".into()); - assert!(package_json.side_effects.as_ref().unwrap().is_object()); -} - -#[cfg(feature = "package_json_raw_json_api")] -#[test] -fn package_json_raw_json_api() { - let resolution = resolve("./tests/package.json"); - assert!(resolution - .package_json() - .unwrap() - .raw_json() - .get("name") - .is_some_and(|name| name == "name")); -} - -#[test] -fn clear_cache() { - let resolver = Resolver::new(ResolveOptions::default()); - resolver.clear_cache(); // exists -} - -#[test] -fn options() { - let resolver = Resolver::new(ResolveOptions::default()); - let options = resolver.options(); - assert!(!format!("{options:?}").is_empty()); -} - -#[test] -fn debug_resolver() { - let resolver = Resolver::new(ResolveOptions::default()); - assert!(!format!("{resolver:?}").is_empty()); -} - -#[test] -fn dependencies() { - let path = dir(); - let mut ctx = ResolveContext::default(); - let _ = Resolver::new(ResolveOptions::default()).resolve_with_context( - path, - "./tests/package.json", - &mut ctx, - ); - assert!(!ctx.file_dependencies.is_empty()); - assert!(ctx.missing_dependencies.is_empty()); -} - -#[test] -fn options_api() { - _ = ResolveOptions::default() - .with_builtin_modules(true) - .with_condition_names(&[]) - .with_extension(".js") - .with_force_extension(EnforceExtension::Auto) - .with_fully_specified(true) - .with_main_field("asdf") - .with_main_file("main") - .with_module("module") - .with_prefer_absolute(true) - .with_prefer_relative(true) - .with_root(PathBuf::new()) - .with_symbolic_link(true); -} diff --git a/tests/package.json b/tests/package.json deleted file mode 100644 index 54f58b8c..00000000 --- a/tests/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "name", - "type": "module", - "sideEffects": {} -} diff --git a/tests/resolve_test.rs b/tests/resolve_test.rs deleted file mode 100644 index 30d1ceff..00000000 --- a/tests/resolve_test.rs +++ /dev/null @@ -1,104 +0,0 @@ -use std::{env, path::PathBuf}; - -use oxc_resolver::{ResolveError, ResolveOptions, Resolver}; - -fn dir() -> PathBuf { - env::current_dir().unwrap() -} - -#[test] -fn chinese() { - let dir = dir(); - let specifier = "./fixtures/misc/中文/中文.js"; - let resolution = Resolver::new(ResolveOptions::default()).resolve(&dir, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(dir.join("fixtures/misc/中文/中文.js")) - ); -} - -#[test] -fn styled_components() { - let dir = dir(); - let path = dir.join("fixtures/pnpm"); - let module_path = dir.join("node_modules/.pnpm/styled-components@6.1.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/styled-components"); - let specifier = "styled-components"; - - // cjs - let options = - ResolveOptions { alias_fields: vec![vec!["browser".into()]], ..ResolveOptions::default() }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/styled-components.browser.cjs.js")) - ); - - // esm - let options = ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - main_fields: vec!["module".into()], - ..ResolveOptions::default() - }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/styled-components.browser.esm.js")) - ); -} - -#[test] -fn axios() { - let dir = dir(); - let path = dir.join("fixtures/pnpm"); - let module_path = dir.join("node_modules/.pnpm/axios@1.6.2/node_modules/axios"); - let specifier = "axios"; - - // default - let options = ResolveOptions::default(); - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("index.js")) - ); - - // browser - let options = ResolveOptions { - condition_names: vec!["browser".into(), "require".into()], - ..ResolveOptions::default() - }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/browser/axios.cjs")) - ); - - // cjs - let options = ResolveOptions { - condition_names: vec!["node".into(), "require".into()], - ..ResolveOptions::default() - }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/node/axios.cjs")) - ); -} - -#[test] -fn postcss() { - let dir = dir(); - let path = dir.join("fixtures/pnpm"); - let module_path = path.join("node_modules/postcss"); - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - // should ignore "path" - let resolution = resolver.resolve(&module_path, "path"); - assert_eq!(resolution, Err(ResolveError::Ignored(module_path.clone()))); - - // should ignore "./lib/terminal-highlight" - let resolution = resolver.resolve(&module_path, "./lib/terminal-highlight"); - assert_eq!(resolution, Err(ResolveError::Ignored(module_path.join("lib/terminal-highlight")))); -} From 7f6bcab2456a18c134cf937b598896cb17724712 Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Mon, 8 Jul 2024 16:15:48 +0300 Subject: [PATCH 47/82] squash! --- CODE_OF_CONDUCT.md | 146 +++++++++++++++++++++++++++++++++++++++++++++ LICENSE | 25 ++++---- 2 files changed, 158 insertions(+), 13 deletions(-) create mode 100644 CODE_OF_CONDUCT.md diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 00000000..d35c6688 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,146 @@ +# Code of Conduct + +## Our Pledge + +Welcome to our community! We are committed to creating a welcoming and inclusive +environment for all contributors. As members, contributors, and leaders, we +pledge to make participation in our community a harassment-free experience for +everyone, regardless of: + +- Age +- Body size +- Visible or invisible disability +- Ethnicity +- Sex characteristics +- Gender identity and expression +- Level of experience +- Education +- Socio-economic status +- Nationality +- Personal appearance +- Race +- Caste +- Color +- Religion +- Sexual identity and orientation + +We promise to act and interact in ways that contribute to an open, welcoming, +diverse, inclusive, and healthy community. + +## Our Standards + +Examples of behavior that contributes to a positive environment for our +community include: + +- Demonstrating empathy and kindness toward other people +- Being respectful of differing opinions, viewpoints, and experiences +- Giving and gracefully accepting constructive feedback +- Accepting responsibility and apologizing to those affected by our mistakes, + and learning from the experience +- Focusing on what is best not just for us as individuals but for the overall + community + +Examples of unacceptable behavior include: + +- The use of sexualized language or imagery, and sexual attention or advances + of any kind +- Trolling, insulting, or derogatory comments, and personal or political + attacks +- Public or private harassment +- Publishing others' private information, such as a physical or email address, + without their explicit permission +- Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Enforcement Responsibilities + +Community leaders are responsible for clarifying and enforcing our standards of +acceptable behavior. They will take appropriate and fair corrective action in +response to any behavior they deem inappropriate, threatening, offensive, or +harmful. This may include removing, editing, or rejecting comments, commits, +code, wiki edits, issues, and other contributions that do not align with this +Code of Conduct. Community leaders will communicate reasons for moderation +decisions when appropriate. + +## Scope + +This Code of Conduct applies within all community spaces, and also applies when +an individual is officially representing the community in public spaces. +Examples of representing our community include using an official e-mail address, +posting via an official social media account, or acting as an appointed +representative at an online or offline event. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported to the community leaders responsible for enforcement at +Community@PlayForm.Cloud. All complaints will be reviewed and investigated +promptly and fairly. All community leaders are obligated to respect the privacy +and security of the reporter of any incident. + +## Enforcement Guidelines + +Community leaders will follow these Community Impact Guidelines in determining +the consequences for any action they deem in violation of this Code of Conduct: + +### 1. Correction + +**Community Impact**: Use of inappropriate language or other behavior deemed +unprofessional or unwelcome in the community. + +**Consequence**: A private, written warning from community leaders, providing +clarity around the nature of the violation and an explanation of why the +behavior was inappropriate. A public apology may be requested. + +### 2. Warning + +**Community Impact**: A violation through a single incident or series of +actions. + +**Consequence**: A warning with consequences for continued behavior. No +interaction with the people involved, including unsolicited interaction with +those enforcing the Code of Conduct, for a specified period of time. This +includes avoiding interactions in community spaces as well as external channels +like social media. Violating these terms may lead to a temporary or permanent +ban. + +### 3. Temporary Ban + +**Community Impact**: A serious violation of community standards, including +sustained inappropriate behavior. + +**Consequence**: A temporary ban from any sort of interaction or public +communication with the community for a specified period of time. No public or +private interaction with the people involved, including unsolicited interaction +with those enforcing the Code of Conduct, is allowed during this period. +Violating these terms may lead to a permanent ban. + +### 4. Permanent Ban + +**Community Impact**: Demonstrating a pattern of violation of community +standards, including sustained inappropriate behavior, harassment of an +individual, or aggression toward or disparagement of classes of individuals. + +**Consequence**: A permanent ban from any sort of public interaction within the +community. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], +version 2.1, available at +[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1]. +Community Impact Guidelines were inspired by [Mozilla's code of conduct +enforcement ladder][Mozilla CoC]. + +For answers to common questions about this code of conduct, see the FAQ at +[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at +[https://www.contributor-covenant.org/translations][translations]. + +[homepage]: https://www.contributor-covenant.org +[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html +[Mozilla CoC]: https://github.com/mozilla/diversity +[FAQ]: https://www.contributor-covenant.org/faq +[translations]: https://www.contributor-covenant.org/translations + +Thank you for being part of our community and helping us create a safe and +respectful environment for everyone! diff --git a/LICENSE b/LICENSE index e8308cad..f236d76d 100644 --- a/LICENSE +++ b/LICENSE @@ -1,21 +1,20 @@ MIT License -Copyright (c) 2023-present Boshen +Copyright (c) 2023-2024 PlayForm -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: +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. +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. From bc5712556e18bbc08ffcb37f1a881e93fb79c05b Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Tue, 9 Jul 2024 04:05:38 +0300 Subject: [PATCH 48/82] squash! --- Cargo.lock | 871 ------ fixtures/enhanced_resolve/lib/index.js | 1 - fixtures/enhanced_resolve/package.json | 4 - fixtures/enhanced_resolve/test/.gitignore | 2 - .../enhanced_resolve/test/fixtures/#/a.js | 0 fixtures/enhanced_resolve/test/fixtures/a.js | 3 - .../enhanced_resolve/test/fixtures/abc.txt | 1 - .../test/fixtures/alias/files/a.js | 0 fixtures/enhanced_resolve/test/fixtures/b.js | 3 - .../browser-module/browser/module-a.js | 0 .../fixtures/browser-module/lib/browser.js | 0 .../fixtures/browser-module/lib/ignore.js | 0 .../test/fixtures/browser-module/lib/main.js | 0 .../fixtures/browser-module/lib/replaced.js | 0 .../test/fixtures/browser-module/lib/self.js | 0 .../fixtures/browser-module/lib/toString.js | 0 .../browser-module/node_modules/module-a.js | 0 .../browser-module/node_modules/module-b.js | 0 .../browser-module/node_modules/module-c.js | 0 .../node_modules/recursive-file/a.js | 0 .../node_modules/recursive-file/b.js | 0 .../node_modules/recursive-file/c.js | 0 .../node_modules/recursive-file/d.js | 0 .../node_modules/recursive-file/package.json | 8 - .../test/fixtures/browser-module/package.json | 33 - .../test/fixtures/builtins/package.json | 12 - fixtures/enhanced_resolve/test/fixtures/c.js | 4 - .../enhanced_resolve/test/fixtures/complex.js | 13 - .../test/fixtures/crypto-js/index.js | 0 .../test/fixtures/crypto-js/package.json | 7 - .../test/fixtures/decorated-fs/exists.js | 0 .../test/fixtures/dirOrFile.js | 1 - .../test/fixtures/dirOrFile/index.js | 1 - .../directory-default/directory-default.js | 0 .../node_modules/@org/pkg/dist/string.js | 1 - .../@org/pkg/dist/string.test.d.ts | 1 - .../node_modules/@org/pkg/package.json | 9 - .../node_modules/pkg/dist/string.js | 1 - .../node_modules/pkg/dist/string.test.d.ts | 1 - .../node_modules/pkg/package.json | 9 - .../node_modules/exports-field/package.json | 7 - .../node_modules/pack1/index.js | 0 .../test/fixtures/exports-field/a.js | 1 - .../node_modules/exports-field/lib/browser.js | 1 - .../node_modules/exports-field/lib/index.js | 0 .../exports-field/lib/lib2/main.js | 1 - .../node_modules/exports-field/lib/main.js | 1 - .../node_modules/exports-field/main.js | 1 - .../node_modules/exports-field/package.json | 18 - .../node_modules/exports-field/x.js | 1 - .../invalid-exports-field/index.js | 0 .../invalid-exports-field/package.json | 13 - .../node_modules/invalid-exports-field/umd.js | 0 .../test/fixtures/exports-field/package.json | 5 - .../node_modules/exports-field/index.js | 1 - .../node_modules/exports-field/lib/browser.js | 1 - .../exports-field/lib/lib2/main.js | 1 - .../node_modules/exports-field/lib/main.js | 1 - .../node_modules/exports-field/main.js | 1 - .../node_modules/exports-field/package.json | 17 - .../node_modules/exports-field/index | 0 .../node_modules/exports-field/main.js | 1 - .../node_modules/exports-field/package.json | 10 - .../node_modules/exports-field/src/index.js | 0 .../fixtures/extension-alias/dir/index.js | 0 .../fixtures/extension-alias/dir/index.ts | 0 .../fixtures/extension-alias/dir2/index.js | 0 .../fixtures/extension-alias/dir2/index.mts | 0 .../test/fixtures/extension-alias/index.js | 0 .../test/fixtures/extension-alias/index.mjs | 0 .../fixtures/extension-alias/index.mts.js | 0 .../test/fixtures/extension-alias/index.ts | 0 .../test/fixtures/extensions/app.module.js | 0 .../test/fixtures/extensions/dir/index.js | 0 .../test/fixtures/extensions/dir/index.ts | 0 .../test/fixtures/extensions/foo.js | 0 .../test/fixtures/extensions/foo.ts | 0 .../test/fixtures/extensions/index.js | 0 .../test/fixtures/extensions/index.ts | 0 .../extensions/node_modules/module.js | 0 .../extensions/node_modules/module/index.ts | 0 .../test/fixtures/extensions/package.json | 3 - .../enhanced_resolve/test/fixtures/file.load1 | 0 .../enhanced_resolve/test/fixtures/file.load2 | 0 .../test/fixtures/foo/index.js | 0 .../test/fixtures/foo/package.json | 4 - .../node_modules/m/package.json | 17 - .../node_modules/m/src/features/f.js | 0 .../m/src/features/internal/file.js | 0 .../node_modules/m/src/features/y/y.js | 0 .../node_modules/m/src/internal/i.js | 0 .../node_modules/m/src/middle-1/f.js | 0 .../node_modules/m/src/middle-1/nested/f.js | 0 .../node_modules/m/src/middle-2/nested/f.js | 1 - .../m/src/middle-3/nested/f/nested/f.js | 0 .../node_modules/m/src/middle-4/f/f.js | 0 .../node_modules/m/src/middle-5/f$/$.js | 0 .../node_modules/m/src/middle-5/f/$.js | 0 .../node_modules/m/src/middle/f.js | 0 .../node_modules/m/src/middle/nested/f.js | 0 .../test/fixtures/imports-field/a.js | 1 - .../test/fixtures/imports-field/b.js | 0 .../test/fixtures/imports-field/dir/b.js | 0 .../node_modules/a/lib/browser.js | 1 - .../imports-field/node_modules/a/lib/index.js | 0 .../node_modules/a/lib/lib2/main.js | 1 - .../imports-field/node_modules/a/lib/main.js | 1 - .../imports-field/node_modules/a/main.js | 1 - .../imports-field/node_modules/a/package.json | 18 - .../imports-field/node_modules/a/x.js | 1 - .../imports-field/node_modules/c/index.js | 0 .../test/fixtures/imports-field/package.json | 17 - .../fixtures/incorrect-package/pack1/a.js | 0 .../incorrect-package/pack1/package.json | 2 - .../fixtures/incorrect-package/pack2/a.js | 0 .../incorrect-package/pack2/package.json | 0 .../test/fixtures/issue-238/package.json | 3 - .../test/fixtures/issue-238/src/a/config.js | 0 .../src/common/config/myObjectFile.js | 0 .../enhanced_resolve/test/fixtures/lib.js | 0 .../test/fixtures/lib/complex1.js | 1 - .../test/fixtures/main-field-self/index.js | 0 .../fixtures/main-field-self/package.json | 3 - .../test/fixtures/main-field-self2/index.js | 0 .../fixtures/main-field-self2/package.json | 3 - .../enhanced_resolve/test/fixtures/main1.js | 9 - .../enhanced_resolve/test/fixtures/main2.js | 12 - .../enhanced_resolve/test/fixtures/main3.js | 4 - .../multiple_modules/node_modules/m1/a.js | 3 - .../test/fixtures/no#fragment/#/#.js | 0 fixtures/enhanced_resolve/test/fixtures/no.js | 0 .../browser-module-broken/browser.js | 0 .../browser-module-broken/main.js | 0 .../browser-module-broken/package.json | 4 - .../complexm/node_modules/m1/a.js | 1 - .../complexm/node_modules/m1/index.js | 1 - .../fixtures/node_modules/complexm/step1.js | 1 - .../fixtures/node_modules/complexm/step2.js | 1 - .../fixtures/node_modules/dash-name/index.js | 0 .../node_modules/dash-name/package.json | 4 - .../test/fixtures/node_modules/dash/index.js | 0 .../fixtures/node_modules/dash/package.json | 4 - .../invalidPackageJson/package.json | 0 .../test/fixtures/node_modules/m1/a.js | 3 - .../test/fixtures/node_modules/m1/b.js | 3 - .../test/fixtures/node_modules/m2/b.js | 1 - .../node_modules/recursive-module/file.js | 0 .../node_modules/recursive-module/index.js | 0 .../test/fixtures/pnp-a/m2/a.js | 3 - .../test/fixtures/pnp/pkg/dir/index.js | 0 .../test/fixtures/pnp/pkg/index.js | 0 .../test/fixtures/pnp/pkg/main.js | 0 .../fixtures/pnp/pkg/package-alias/browser.js | 0 .../fixtures/pnp/pkg/package-alias/index.js | 0 .../test/fixtures/pnp/pkg/package.json | 7 - .../test/fixtures/pnp/pkg/typescript/index.ts | 0 .../test/fixtures/pnp/pkg3/a.js | 1 - .../test/fixtures/pnp/pkg3/package.json | 8 - .../prefer-pnp/alternative-modules/m1/b.js | 0 .../restrictions/node_modules/pck1/index.css | 0 .../restrictions/node_modules/pck1/index.js | 0 .../node_modules/pck1/package.json | 3 - .../restrictions/node_modules/pck2/index.css | 0 .../restrictions/node_modules/pck2/module.js | 0 .../node_modules/pck2/package.json | 5 - .../test/fixtures/roots_fall_through/index.js | 0 .../scoped/node_modules/@scope/pack1/main.js | 0 .../node_modules/@scope/pack1/package.json | 5 - .../node_modules/@scope/pack2/lib/index.js | 0 .../scoped/node_modules/@scope/pack2/main.js | 0 .../node_modules/@scope/pack2/package.json | 3 - .../test/fixtures/shortcutdir.js/a.js | 0 .../test/fixtures/yield/a/foo-2/b | 0 .../test/fixtures/yield/a/foo-2/c | 0 .../test/fixtures/yield/a/foo/a | 0 .../test/fixtures/yield/a/foo/b | 0 .../test/fixtures/yield/b/foo/a | 0 .../test/fixtures/yield/c/foo/a | 0 .../test/fixtures/yield/c/foo/package.json | 7 - .../fixtures/\346\265\213\350\257\225.js" | 0 .../\344\270\255\346\226\207.js" | 0 fixtures/pnpm/.gitignore | 1 - fixtures/pnpm/package.json | 10 - fixtures/pnpm/pnpm-lock.yaml | 212 -- fixtures/tsconfig/cases/builtins/thing.js | 0 .../tsconfig/cases/builtins/tsconfig.json | 5 - fixtures/tsconfig/cases/exports/index.js | 0 fixtures/tsconfig/cases/exports/tsconfig.json | 3 - .../extends-extension/base-tsconfig.json | 7 - .../tsconfig/cases/extends-extension/foo.js | 0 .../cases/extends-extension/tsconfig.json | 3 - .../cases/extends-extensionless/foo.js | 0 .../cases/extends-extensionless/tsconfig.json | 3 - .../tsconfig/cases/extends-multiple/foo.js | 0 .../cases/extends-multiple/tsconfig.json | 6 - .../tsconfig/cases/extends-not-found/index.js | 0 .../cases/extends-not-found/tsconfig.json | 3 - .../tsconfig/cases/extends-paths/src/index.js | 0 .../cases/extends-paths/tsconfig.base.json | 7 - .../cases/extends-paths/tsconfig.json | 6 - fixtures/tsconfig/cases/field/index.js | 0 fixtures/tsconfig/cases/field/tsconfig.json | 3 - fixtures/tsconfig/cases/index/index.js | 0 fixtures/tsconfig/cases/index/tsconfig.json | 3 - .../cases/paths_template_variable/foo.js | 0 .../paths_template_variable/tsconfig1.json | 3 - .../paths_template_variable/tsconfig2.json | 8 - .../project_references/app/aliased/index.ts | 0 .../cases/project_references/app/index.ts | 0 .../project_references/app/tsconfig.json | 23 - .../project_a/aliased/index.ts | 0 .../project_references/project_a/conf.json | 8 - .../project_references/project_a/index.ts | 0 .../project_b/src/aliased/index.ts | 0 .../project_b/tsconfig.json | 9 - .../project_references/project_c/index.ts | 0 .../project_c/tsconfig.json | 5 - .../project_references/tsconfig.base.json | 4 - fixtures/tsconfig/cases/suffixes/a.ios.ts | 0 fixtures/tsconfig/cases/suffixes/a.ts | 0 fixtures/tsconfig/cases/suffixes/b.ts | 0 fixtures/tsconfig/cases/suffixes/c-test.ts | 0 fixtures/tsconfig/cases/suffixes/index.ts | 1 - .../tsconfig/cases/suffixes/tsconfig.json | 5 - fixtures/tsconfig/cases/trailing-comma/bar.js | 0 .../tsconfig/cases/trailing-comma/index.js | 0 .../cases/trailing-comma/tsconfig.json | 9 - fixtures/tsconfig/foo.js | 0 fixtures/tsconfig/nested/index.js | 0 fixtures/tsconfig/nested/test.js | 0 fixtures/tsconfig/nested/tsconfig.json | 8 - .../node_modules/tsconfig-exports/conf.json | 7 - .../node_modules/tsconfig-exports/foo.js | 0 .../tsconfig-exports/package.json | 7 - .../node_modules/tsconfig-field/conf.json | 7 - .../node_modules/tsconfig-field/foo.js | 0 .../node_modules/tsconfig-field/package.json | 5 - .../node_modules/tsconfig-index/foo.js | 0 .../node_modules/tsconfig-index/package.json | 4 - .../node_modules/tsconfig-index/tsconfig.json | 7 - .../node_modules/tsconfig-not-used/foo.js | 0 .../tsconfig-not-used/tsconfig.json | 7 - fixtures/tsconfig/package.json | 24 - fixtures/tsconfig/tsconfig.json | 7 - fixtures/tsconfig/tsconfig_broken.json | 1 - .../tsconfig/tsconfig_template_variable.json | 7 - napi/__test__/resolver.spec.mjs | 260 -- napi/src/lib.rs | 207 -- napi/src/options.rs | 261 -- napi/src/tracing.rs | 25 - napi/tests/options.test.mjs | 59 - npm/package.json | 77 +- package.json | 53 +- pnpm-lock.yaml | 2578 ----------------- src/builtins.rs | 71 - src/cache.rs | 369 --- src/context.rs | 89 - src/error.rs | 178 -- src/file_system.rs | 133 - src/lib.rs | 1689 ----------- src/options.rs | 623 ---- src/package_json.rs | 219 -- src/path.rs | 132 - src/resolution.rs | 92 - src/specifier.rs | 230 -- src/tests/alias.rs | 280 -- src/tests/browser_field.rs | 189 -- src/tests/builtins.rs | 121 - src/tests/dependencies.rs | 110 - src/tests/exports_field.rs | 2546 ---------------- src/tests/extension_alias.rs | 66 - src/tests/extensions.rs | 125 - src/tests/fallback.rs | 100 - src/tests/full_specified.rs | 113 - src/tests/imports_field.rs | 1320 --------- src/tests/incorrect_description_file.rs | 65 - src/tests/main_field.rs | 24 - src/tests/memory_fs.rs | 74 - src/tests/missing.rs | 106 - src/tests/mod.rs | 49 - src/tests/resolve.rs | 119 - src/tests/restrictions.rs | 25 - src/tests/roots.rs | 92 - src/tests/scoped_packages.rs | 25 - src/tests/simple.rs | 68 - src/tests/symlink.rs | 121 - src/tests/tsconfig_paths.rs | 530 ---- src/tests/tsconfig_project_references.rs | 132 - src/tsconfig.rs | 223 -- tests/integration_test.rs | 103 - tests/package.json | 5 - tests/resolve_test.rs | 104 - 292 files changed, 55 insertions(+), 15802 deletions(-) delete mode 100644 Cargo.lock delete mode 100644 fixtures/enhanced_resolve/lib/index.js delete mode 100644 fixtures/enhanced_resolve/package.json delete mode 100644 fixtures/enhanced_resolve/test/.gitignore delete mode 100644 fixtures/enhanced_resolve/test/fixtures/#/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/abc.txt delete mode 100644 fixtures/enhanced_resolve/test/fixtures/alias/files/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/browser/module-a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/ignore.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/replaced.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/self.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/toString.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-c.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/c.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/d.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/builtins/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/c.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/complex.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/crypto-js/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/decorated-fs/exists.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/dirOrFile.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/directory-default/directory-default.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/pack1/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/umd.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/index delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/src/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.mts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mjs delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mts.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/app.module.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/foo.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/foo.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/file.load1 delete mode 100644 fixtures/enhanced_resolve/test/fixtures/file.load2 delete mode 100644 fixtures/enhanced_resolve/test/fixtures/foo/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/foo/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/internal/file.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/y/y.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/internal/i.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-3/nested/f/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-4/f/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f$/$.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f/$.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/dir/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/c/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/issue-238/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/issue-238/src/a/config.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/issue-238/src/common/config/myObjectFile.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/lib.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/lib/complex1.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self2/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main1.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main2.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main3.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/no#fragment/#/#.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/no.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/invalidPackageJson/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/file.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/dir/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/typescript/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/prefer-pnp/alternative-modules/m1/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.css delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/index.css delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/module.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/roots_fall_through/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/lib/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/shortcutdir.js/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/b delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/c delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo/a delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo/b delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/b/foo/a delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/c/foo/a delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json delete mode 100644 "fixtures/enhanced_resolve/test/fixtures/\346\265\213\350\257\225.js" delete mode 100644 "fixtures/misc/\344\270\255\346\226\207/\344\270\255\346\226\207.js" delete mode 100644 fixtures/pnpm/.gitignore delete mode 100644 fixtures/pnpm/package.json delete mode 100644 fixtures/pnpm/pnpm-lock.yaml delete mode 100644 fixtures/tsconfig/cases/builtins/thing.js delete mode 100644 fixtures/tsconfig/cases/builtins/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/exports/index.js delete mode 100644 fixtures/tsconfig/cases/exports/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-extension/base-tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-extension/foo.js delete mode 100644 fixtures/tsconfig/cases/extends-extension/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-extensionless/foo.js delete mode 100644 fixtures/tsconfig/cases/extends-extensionless/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-multiple/foo.js delete mode 100644 fixtures/tsconfig/cases/extends-multiple/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-not-found/index.js delete mode 100644 fixtures/tsconfig/cases/extends-not-found/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-paths/src/index.js delete mode 100644 fixtures/tsconfig/cases/extends-paths/tsconfig.base.json delete mode 100644 fixtures/tsconfig/cases/extends-paths/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/field/index.js delete mode 100644 fixtures/tsconfig/cases/field/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/index/index.js delete mode 100644 fixtures/tsconfig/cases/index/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/paths_template_variable/foo.js delete mode 100644 fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json delete mode 100644 fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json delete mode 100644 fixtures/tsconfig/cases/project_references/app/aliased/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/app/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/app/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/project_references/project_a/aliased/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_a/conf.json delete mode 100644 fixtures/tsconfig/cases/project_references/project_a/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_b/src/aliased/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_b/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/project_references/project_c/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_c/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/project_references/tsconfig.base.json delete mode 100644 fixtures/tsconfig/cases/suffixes/a.ios.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/a.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/b.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/c-test.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/index.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/trailing-comma/bar.js delete mode 100644 fixtures/tsconfig/cases/trailing-comma/index.js delete mode 100644 fixtures/tsconfig/cases/trailing-comma/tsconfig.json delete mode 100644 fixtures/tsconfig/foo.js delete mode 100644 fixtures/tsconfig/nested/index.js delete mode 100644 fixtures/tsconfig/nested/test.js delete mode 100644 fixtures/tsconfig/nested/tsconfig.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-exports/conf.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-exports/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-exports/package.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-field/conf.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-field/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-field/package.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-index/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-index/package.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-not-used/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json delete mode 100755 fixtures/tsconfig/package.json delete mode 100644 fixtures/tsconfig/tsconfig.json delete mode 100644 fixtures/tsconfig/tsconfig_broken.json delete mode 100644 fixtures/tsconfig/tsconfig_template_variable.json delete mode 100644 napi/__test__/resolver.spec.mjs delete mode 100644 napi/src/lib.rs delete mode 100644 napi/src/options.rs delete mode 100644 napi/src/tracing.rs delete mode 100644 napi/tests/options.test.mjs delete mode 100644 pnpm-lock.yaml delete mode 100644 src/builtins.rs delete mode 100644 src/cache.rs delete mode 100644 src/context.rs delete mode 100644 src/error.rs delete mode 100644 src/file_system.rs delete mode 100644 src/lib.rs delete mode 100644 src/options.rs delete mode 100644 src/package_json.rs delete mode 100644 src/path.rs delete mode 100644 src/resolution.rs delete mode 100644 src/specifier.rs delete mode 100644 src/tests/alias.rs delete mode 100644 src/tests/browser_field.rs delete mode 100644 src/tests/builtins.rs delete mode 100644 src/tests/dependencies.rs delete mode 100644 src/tests/exports_field.rs delete mode 100644 src/tests/extension_alias.rs delete mode 100644 src/tests/extensions.rs delete mode 100644 src/tests/fallback.rs delete mode 100644 src/tests/full_specified.rs delete mode 100644 src/tests/imports_field.rs delete mode 100644 src/tests/incorrect_description_file.rs delete mode 100644 src/tests/main_field.rs delete mode 100644 src/tests/memory_fs.rs delete mode 100644 src/tests/missing.rs delete mode 100644 src/tests/mod.rs delete mode 100644 src/tests/resolve.rs delete mode 100644 src/tests/restrictions.rs delete mode 100644 src/tests/roots.rs delete mode 100644 src/tests/scoped_packages.rs delete mode 100644 src/tests/simple.rs delete mode 100644 src/tests/symlink.rs delete mode 100644 src/tests/tsconfig_paths.rs delete mode 100644 src/tests/tsconfig_project_references.rs delete mode 100644 src/tsconfig.rs delete mode 100644 tests/integration_test.rs delete mode 100644 tests/package.json delete mode 100644 tests/resolve_test.rs diff --git a/Cargo.lock b/Cargo.lock deleted file mode 100644 index 22fe5538..00000000 --- a/Cargo.lock +++ /dev/null @@ -1,871 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "aho-corasick" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" -dependencies = [ - "memchr", -] - -[[package]] -name = "anes" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "735d4f398ca57cfa2880225c2bf81c3b9af3be5bb22e44ae70118dad38713e84" - -[[package]] -name = "autocfg" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "bitflags" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" - -[[package]] -name = "bpaf" -version = "0.9.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3280efcf6d66bc77c2cf9b67dc8acee47a217d9be67dd590b3230dffe663724d" - -[[package]] -name = "cast" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "ciborium" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42e69ffd6f0917f5c029256a24d0161db17cea3997d185db0d35926308770f0e" -dependencies = [ - "ciborium-io", - "ciborium-ll", - "serde", -] - -[[package]] -name = "ciborium-io" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05afea1e0a06c9be33d539b876f1ce3692f4afea2cb41f740e7743225ed1c757" - -[[package]] -name = "ciborium-ll" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57663b653d948a338bfb3eeba9bb2fd5fcfaecb9e199e87e1eda4d9e8b240fd9" -dependencies = [ - "ciborium-io", - "half", -] - -[[package]] -name = "codspeed" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a104ac948e0188b921eb3fcbdd55dcf62e542df4c7ab7e660623f6288302089" -dependencies = [ - "colored", - "libc", - "serde_json", -] - -[[package]] -name = "colored" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbf2150cce219b664a8a70df7a1f933836724b503f8a413af9365b4dcc4d90b8" -dependencies = [ - "lazy_static", - "windows-sys 0.48.0", -] - -[[package]] -name = "convert_case" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec182b0ca2f35d8fc196cf3404988fd8b8c739a4d270ff118a398feb0cbec1ca" -dependencies = [ - "unicode-segmentation", -] - -[[package]] -name = "criterion2" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7258985df1aa8b33359ee2392cbc3b7802875242cdacdda91a17a602132c24a9" -dependencies = [ - "anes", - "bpaf", - "cast", - "ciborium", - "codspeed", - "colored", - "num-traits", - "oorandom", - "serde", - "serde_json", - "walkdir", -] - -[[package]] -name = "crossbeam-deque" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" -dependencies = [ - "crossbeam-epoch", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.9.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" -dependencies = [ - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" - -[[package]] -name = "crunchy" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" - -[[package]] -name = "ctor" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edb49164822f3ee45b17acd4a208cfc1251410cf0cad9a833234c9890774dd9f" -dependencies = [ - "quote", - "syn", -] - -[[package]] -name = "dashmap" -version = "6.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "804c8821570c3f8b70230c2ba75ffa5c0f9a4189b9a432b6656c536712acae28" -dependencies = [ - "cfg-if", - "crossbeam-utils", - "hashbrown", - "lock_api", - "once_cell", - "parking_lot_core", -] - -[[package]] -name = "document-features" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef5282ad69563b5fc40319526ba27e0e7363d552a896f0297d54f767717f9b95" -dependencies = [ - "litrs", -] - -[[package]] -name = "dunce" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b" - -[[package]] -name = "either" -version = "1.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" - -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "filetime" -version = "0.2.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ee447700ac8aa0b2f2bd7bc4462ad686ba06baa6727ac149a2d6277f0d240fd" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall 0.4.1", - "windows-sys 0.52.0", -] - -[[package]] -name = "half" -version = "2.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dd08c532ae367adf81c312a4580bc67f1d0fe8bc9c460520283f4c0ff277888" -dependencies = [ - "cfg-if", - "crunchy", -] - -[[package]] -name = "hashbrown" -version = "0.14.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" - -[[package]] -name = "indexmap" -version = "2.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" -dependencies = [ - "equivalent", - "hashbrown", - "serde", -] - -[[package]] -name = "itoa" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" - -[[package]] -name = "json-strip-comments" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3d129799327c8f80861e467c59b825ba24c277dba6ad0d71a141dc98f9e04ee" - -[[package]] -name = "lazy_static" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" - -[[package]] -name = "libc" -version = "0.2.155" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" - -[[package]] -name = "libloading" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e310b3a6b5907f99202fcdb4960ff45b93735d7c7d96b760fcff8db2dc0e103d" -dependencies = [ - "cfg-if", - "windows-targets 0.48.5", -] - -[[package]] -name = "litrs" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4ce301924b7887e9d637144fdade93f9dfff9b60981d4ac161db09720d39aa5" - -[[package]] -name = "lock_api" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" -dependencies = [ - "autocfg", - "scopeguard", -] - -[[package]] -name = "memchr" -version = "2.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" - -[[package]] -name = "napi" -version = "2.16.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1bd081bbaef43600fd2c5dd4c525b8ecea7dfdacf40ebc674e87851dce6559e" -dependencies = [ - "bitflags 2.6.0", - "ctor", - "napi-derive", - "napi-sys", - "once_cell", - "serde", - "serde_json", -] - -[[package]] -name = "napi-build" -version = "2.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1c0f5d67ee408a4685b61f5ab7e58605c8ae3f2b4189f0127d804ff13d5560a" - -[[package]] -name = "napi-derive" -version = "2.16.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eafd2b920906ea5b1f5f1f9d1eff9cc74e4ff8124dca41b501c1413079589187" -dependencies = [ - "cfg-if", - "convert_case", - "napi-derive-backend", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "napi-derive-backend" -version = "1.0.70" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b370b784440c65eb9001d839012eb912ee43e3a2d0361e2c30c13052372c39fe" -dependencies = [ - "convert_case", - "once_cell", - "proc-macro2", - "quote", - "regex", - "semver", - "syn", -] - -[[package]] -name = "napi-sys" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "427802e8ec3a734331fec1035594a210ce1ff4dc5bc1950530920ab717964ea3" -dependencies = [ - "libloading", -] - -[[package]] -name = "normalize-path" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5438dd2b2ff4c6df6e1ce22d825ed2fa93ee2922235cc45186991717f0a892d" - -[[package]] -name = "num-traits" -version = "0.2.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" -dependencies = [ - "autocfg", -] - -[[package]] -name = "once_cell" -version = "1.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" - -[[package]] -name = "oorandom" -version = "11.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575" - -[[package]] -name = "oxc_napi_resolver" -version = "0.0.0" -dependencies = [ - "napi", - "napi-build", - "napi-derive", - "oxc_resolver", - "tracing-subscriber", -] - -[[package]] -name = "oxc_resolver" -version = "1.9.3" -dependencies = [ - "criterion2", - "dashmap", - "document-features", - "dunce", - "indexmap", - "json-strip-comments", - "normalize-path", - "once_cell", - "rayon", - "rustc-hash", - "serde", - "serde_json", - "thiserror", - "tracing", - "vfs", -] - -[[package]] -name = "parking_lot_core" -version = "0.9.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall 0.5.2", - "smallvec", - "windows-targets 0.52.5", -] - -[[package]] -name = "pin-project-lite" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" - -[[package]] -name = "proc-macro2" -version = "1.0.86" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.36" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "rayon" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" -dependencies = [ - "either", - "rayon-core", -] - -[[package]] -name = "rayon-core" -version = "1.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" -dependencies = [ - "crossbeam-deque", - "crossbeam-utils", -] - -[[package]] -name = "redox_syscall" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" -dependencies = [ - "bitflags 1.3.2", -] - -[[package]] -name = "redox_syscall" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c82cf8cff14456045f55ec4241383baeff27af886adb72ffb2162f99911de0fd" -dependencies = [ - "bitflags 2.6.0", -] - -[[package]] -name = "regex" -version = "1.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b91213439dad192326a0d7c6ee3955910425f441d7038e0d6933b0aec5c4517f" -dependencies = [ - "aho-corasick", - "memchr", - "regex-automata", - "regex-syntax", -] - -[[package]] -name = "regex-automata" -version = "0.4.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", -] - -[[package]] -name = "regex-syntax" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" - -[[package]] -name = "rustc-hash" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" - -[[package]] -name = "ryu" -version = "1.0.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" - -[[package]] -name = "same-file" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "scopeguard" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" - -[[package]] -name = "semver" -version = "1.0.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" - -[[package]] -name = "serde" -version = "1.0.204" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc76f558e0cbb2a839d37354c575f1dc3fdc6546b5be373ba43d95f231bf7c12" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.204" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0cd7e117be63d3c3678776753929474f3b04a43a080c744d6b0ae2a8c28e222" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "serde_json" -version = "1.0.120" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e0d21c9a8cae1235ad58a00c11cb40d4b1e5c784f1ef2c537876ed6ffd8b7c5" -dependencies = [ - "indexmap", - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "sharded-slab" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" -dependencies = [ - "lazy_static", -] - -[[package]] -name = "smallvec" -version = "1.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" - -[[package]] -name = "syn" -version = "2.0.68" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "901fa70d88b9d6c98022e23b4136f9f3e54e4662c3bc1bd1d84a42a9a0f0c1e9" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "thiserror" -version = "1.0.61" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.61" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "thread_local" -version = "1.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" -dependencies = [ - "cfg-if", - "once_cell", -] - -[[package]] -name = "tracing" -version = "0.1.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" -dependencies = [ - "pin-project-lite", - "tracing-attributes", - "tracing-core", -] - -[[package]] -name = "tracing-attributes" -version = "0.1.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "tracing-core" -version = "0.1.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" -dependencies = [ - "once_cell", -] - -[[package]] -name = "tracing-subscriber" -version = "0.3.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" -dependencies = [ - "sharded-slab", - "thread_local", - "tracing-core", -] - -[[package]] -name = "unicode-ident" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" - -[[package]] -name = "unicode-segmentation" -version = "1.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" - -[[package]] -name = "vfs" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "654cd097e182a71dbf899178e6b5662c2157dd0b8afd5975de18008f6fc173d1" -dependencies = [ - "filetime", -] - -[[package]] -name = "walkdir" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" -dependencies = [ - "same-file", - "winapi-util", -] - -[[package]] -name = "winapi-util" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b" -dependencies = [ - "windows-sys 0.52.0", -] - -[[package]] -name = "windows-sys" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" -dependencies = [ - "windows-targets 0.48.5", -] - -[[package]] -name = "windows-sys" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" -dependencies = [ - "windows-targets 0.52.5", -] - -[[package]] -name = "windows-targets" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" -dependencies = [ - "windows_aarch64_gnullvm 0.48.5", - "windows_aarch64_msvc 0.48.5", - "windows_i686_gnu 0.48.5", - "windows_i686_msvc 0.48.5", - "windows_x86_64_gnu 0.48.5", - "windows_x86_64_gnullvm 0.48.5", - "windows_x86_64_msvc 0.48.5", -] - -[[package]] -name = "windows-targets" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" -dependencies = [ - "windows_aarch64_gnullvm 0.52.5", - "windows_aarch64_msvc 0.52.5", - "windows_i686_gnu 0.52.5", - "windows_i686_gnullvm", - "windows_i686_msvc 0.52.5", - "windows_x86_64_gnu 0.52.5", - "windows_x86_64_gnullvm 0.52.5", - "windows_x86_64_msvc 0.52.5", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" - -[[package]] -name = "windows_i686_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" - -[[package]] -name = "windows_i686_gnu" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" - -[[package]] -name = "windows_i686_gnullvm" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" - -[[package]] -name = "windows_i686_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" - -[[package]] -name = "windows_i686_msvc" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" diff --git a/fixtures/enhanced_resolve/lib/index.js b/fixtures/enhanced_resolve/lib/index.js deleted file mode 100644 index 1e872e8f..00000000 --- a/fixtures/enhanced_resolve/lib/index.js +++ /dev/null @@ -1 +0,0 @@ -// mimic enhanced-resolved root directory structure diff --git a/fixtures/enhanced_resolve/package.json b/fixtures/enhanced_resolve/package.json deleted file mode 100644 index d1b845b5..00000000 --- a/fixtures/enhanced_resolve/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "enhanced-resolve", - "main": "lib/index.js" -} diff --git a/fixtures/enhanced_resolve/test/.gitignore b/fixtures/enhanced_resolve/test/.gitignore deleted file mode 100644 index bbbec5f4..00000000 --- a/fixtures/enhanced_resolve/test/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# created by symlink.rs -/temp diff --git a/fixtures/enhanced_resolve/test/fixtures/#/a.js b/fixtures/enhanced_resolve/test/fixtures/#/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/a.js b/fixtures/enhanced_resolve/test/fixtures/a.js deleted file mode 100644 index 896ffc6d..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/abc.txt b/fixtures/enhanced_resolve/test/fixtures/abc.txt deleted file mode 100644 index f2ba8f84..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/abc.txt +++ /dev/null @@ -1 +0,0 @@ -abc \ No newline at end of file diff --git a/fixtures/enhanced_resolve/test/fixtures/alias/files/a.js b/fixtures/enhanced_resolve/test/fixtures/alias/files/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/b.js b/fixtures/enhanced_resolve/test/fixtures/b.js deleted file mode 100644 index 11476340..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/b.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function b() { - return "This is b"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/browser/module-a.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/browser/module-a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/browser.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/ignore.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/ignore.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/replaced.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/replaced.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/self.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/self.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/toString.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/toString.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-a.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-b.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-c.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-c.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/a.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/b.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/c.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/c.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/d.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/d.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json deleted file mode 100644 index c13fe23b..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "browser": { - "a.js": "./a", - "./b.js": "./b", - "c.js": "./d.js", - "./d.js": "./c.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/package.json b/fixtures/enhanced_resolve/test/fixtures/browser-module/package.json deleted file mode 100644 index 19ff7739..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/browser-module/package.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "exports": { - "./lib/index.js": "./lib/index.js" - }, - "browser": { - "./lib/ignore.js": false, - "./lib/replaced.js": "./lib/browser", - "module-a": "./browser/module-a.js", - "module-b": "module-c", - "module-c": "module-c", - "./toString": "./lib/toString.js", - "./lib/main.js": "./lib/main.js", - "./main.js": "./lib/main.js", - "./lib/xyz.js": "./xyz.js", - "./xyz.js": "./lib/xyz.js", - "./lib/non-existent.js": "./lib/non-existent.js", - ".": false, - "./number": 1, - "./foo": "./lib/replaced.js?query" - }, - "innerBrowser1": { - "field": { - "browser": { - "./lib/main1.js": "./lib/main.js" - } - } - }, - "innerBrowser2": { - "browser": { - "./lib/main2.js": "./lib/replaced.js" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/builtins/package.json b/fixtures/enhanced_resolve/test/fixtures/builtins/package.json deleted file mode 100644 index 4a54ea96..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/builtins/package.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "name": "builtins", - "private": true, - "imports": { - "#fs": { - "default": "fs" - }, - "#http": { - "node": "node:http" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/c.js b/fixtures/enhanced_resolve/test/fixtures/c.js deleted file mode 100644 index e3aca8aa..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/c.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = function b() { - require("./a"); - return "This is c"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/complex.js b/fixtures/enhanced_resolve/test/fixtures/complex.js deleted file mode 100644 index 1f62db84..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/complex.js +++ /dev/null @@ -1,13 +0,0 @@ -var 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); diff --git a/fixtures/enhanced_resolve/test/fixtures/crypto-js/index.js b/fixtures/enhanced_resolve/test/fixtures/crypto-js/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json b/fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json deleted file mode 100644 index 1d31aa8b..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "crypto-js", - "main": "index.js", - "browser": { - "crypto": false - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/decorated-fs/exists.js b/fixtures/enhanced_resolve/test/fixtures/decorated-fs/exists.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/dirOrFile.js b/fixtures/enhanced_resolve/test/fixtures/dirOrFile.js deleted file mode 100644 index c3cb885f..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/dirOrFile.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "file"; diff --git a/fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js b/fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js deleted file mode 100644 index 85e01cd4..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "dir"; diff --git a/fixtures/enhanced_resolve/test/fixtures/directory-default/directory-default.js b/fixtures/enhanced_resolve/test/fixtures/directory-default/directory-default.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js deleted file mode 100644 index d1007aae..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js +++ /dev/null @@ -1 +0,0 @@ -export default "string"; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts deleted file mode 100644 index cb0ff5c3..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json deleted file mode 100644 index b523a1e9..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "@org/pkg", - "exports": { - "./*.js": { - "types": "./dist/*.d.ts", - "default": "./dist/*.js" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js deleted file mode 100644 index d1007aae..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js +++ /dev/null @@ -1 +0,0 @@ -export default "string"; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts deleted file mode 100644 index cb0ff5c3..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json deleted file mode 100644 index 8e55fb46..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "@raviqqe/hidash", - "exports": { - "./*.js": { - "types": "./dist/*.d.ts", - "default": "./dist/*.js" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json deleted file mode 100644 index f0edf449..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "exports-field", - "version": "1.0.0", - "exports": { - ".": "./a/../b/../../pack1/index.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/pack1/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/pack1/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/a.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/a.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json deleted file mode 100644 index 6b105c08..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "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/": { - "webpack": ["./lib/lib2/", "./lib/"], - "node": "./lib/", - "default": "./lib/" - }, - "./dist/a.js": "./../../a.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json deleted file mode 100644 index 0012a3de..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "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" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/umd.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/umd.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field/package.json deleted file mode 100644 index 5fa72bb5..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "@exports-field/core", - "version": "1.0.0", - "exports": "./a.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json deleted file mode 100644 index e6f12074..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "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/lib2/", "./lib/"], - "node": "./lib/", - "default": "./lib/" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/index b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/index deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json deleted file mode 100644 index 1a838f49..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "name": "exports-field", - "exportsField": { - "exports": "./main.js" - }, - "ex": "./index", - "broken": { - ".": "./src" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/src/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/src/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.ts b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.mts b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.mts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mjs b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mjs deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mts.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mts.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.ts b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/app.module.js b/fixtures/enhanced_resolve/test/fixtures/extensions/app.module.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.js b/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/foo.js b/fixtures/enhanced_resolve/test/fixtures/extensions/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/foo.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/foo.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/index.js b/fixtures/enhanced_resolve/test/fixtures/extensions/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/index.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module.js b/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module/index.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/package.json b/fixtures/enhanced_resolve/test/fixtures/extensions/package.json deleted file mode 100644 index 5e55a1e8..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/extensions/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "./index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/file.load1 b/fixtures/enhanced_resolve/test/fixtures/file.load1 deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/file.load2 b/fixtures/enhanced_resolve/test/fixtures/file.load2 deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/foo/index.js b/fixtures/enhanced_resolve/test/fixtures/foo/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/foo/package.json b/fixtures/enhanced_resolve/test/fixtures/foo/package.json deleted file mode 100644 index da86787a..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/foo/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "foo", - "version": "1.0.0" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json deleted file mode 100644 index aa2be496..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "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" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/internal/file.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/internal/file.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/y/y.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/y/y.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/internal/i.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/internal/i.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/nested/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js deleted file mode 100644 index e5b70a86..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = { nested: "nested" } diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-3/nested/f/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-3/nested/f/nested/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-4/f/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-4/f/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f$/$.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f$/$.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f/$.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f/$.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/nested/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/a.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/a.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/b.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/dir/b.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/dir/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/index.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json deleted file mode 100644 index 8d8d3a46..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "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/lib2/", "./lib/"], - "node": "./lib/", - "default": "./lib/" - }, - "./dist/a.js": "./../../a.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/c/index.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/c/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/imports-field/package.json deleted file mode 100644 index 248351a9..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "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" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/a.js b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json deleted file mode 100644 index ded7faa2..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json +++ /dev/null @@ -1,2 +0,0 @@ -{ - "main": "./a.js", diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/a.js b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/package.json b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/package.json deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/issue-238/package.json b/fixtures/enhanced_resolve/test/fixtures/issue-238/package.json deleted file mode 100644 index 352055cd..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/issue-238/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "private": true -} diff --git a/fixtures/enhanced_resolve/test/fixtures/issue-238/src/a/config.js b/fixtures/enhanced_resolve/test/fixtures/issue-238/src/a/config.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/issue-238/src/common/config/myObjectFile.js b/fixtures/enhanced_resolve/test/fixtures/issue-238/src/common/config/myObjectFile.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/lib.js b/fixtures/enhanced_resolve/test/fixtures/lib.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/lib/complex1.js b/fixtures/enhanced_resolve/test/fixtures/lib/complex1.js deleted file mode 100644 index b3de3d70..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/lib/complex1.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "lib complex1"; diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self/index.js b/fixtures/enhanced_resolve/test/fixtures/main-field-self/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json b/fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json deleted file mode 100644 index a2b6f341..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "./" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self2/index.js b/fixtures/enhanced_resolve/test/fixtures/main-field-self2/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json b/fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json deleted file mode 100644 index 4fa6f730..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "." -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main1.js b/fixtures/enhanced_resolve/test/fixtures/main1.js deleted file mode 100644 index 168f2a1e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main1.js +++ /dev/null @@ -1,9 +0,0 @@ -var a = require("./a"); -if (x) { - for (var i = 0; i < 100; i++) { - while (true) require("./b"); - do { - i++; - } while (require("m1/a")()); - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main2.js b/fixtures/enhanced_resolve/test/fixtures/main2.js deleted file mode 100644 index 39f062b1..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main2.js +++ /dev/null @@ -1,12 +0,0 @@ -var 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"); - }); - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main3.js b/fixtures/enhanced_resolve/test/fixtures/main3.js deleted file mode 100644 index 1c180166..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main3.js +++ /dev/null @@ -1,4 +0,0 @@ -var a = require("./a"); -require.ensure([], function(require) { - require("./c.js"); -}); diff --git a/fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js b/fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js deleted file mode 100644 index 997c1051..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is nested m1/a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/no#fragment/#/#.js b/fixtures/enhanced_resolve/test/fixtures/no#fragment/#/#.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/no.js b/fixtures/enhanced_resolve/test/fixtures/no.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/browser.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/browser.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/main.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json deleted file mode 100644 index c469e1fd..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "main": "./main.js", - "browser": "./browser.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js deleted file mode 100644 index 549620a5..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "the correct a.js"; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js deleted file mode 100644 index 5db6632e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = " :) " + require("m2/b.js"); diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js deleted file mode 100644 index d308569d..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require("m1/a") + require("m1"); diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js deleted file mode 100644 index cb8127e8..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "Step2"; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json deleted file mode 100644 index 8d6dfa56..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "dash-name", - "exports": "./index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json deleted file mode 100644 index 4fd8706e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "dash", - "exports": "./index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/invalidPackageJson/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/invalidPackageJson/package.json deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js deleted file mode 100644 index 46fc8e6c..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is m1/a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js deleted file mode 100644 index 8565c244..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is m1/b"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js deleted file mode 100644 index 34faaaf5..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "This is m2/b"; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/file.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/file.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js b/fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js deleted file mode 100644 index 997c1051..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is nested m1/a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/dir/index.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/dir/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/index.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/main.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/browser.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/browser.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/index.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json deleted file mode 100644 index e20ceaeb..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "main": "main.js", - "browser": { - "./package-alias/index.js": "./package-alias/browser.js", - "module": "pkg/dir/index" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/typescript/index.ts b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/typescript/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json deleted file mode 100644 index 4a1f838e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "@exports-field/core", - "version": "1.0.0", - "exports": { - ".": "./a.js", - "./x": "./a.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/prefer-pnp/alternative-modules/m1/b.js b/fixtures/enhanced_resolve/test/fixtures/prefer-pnp/alternative-modules/m1/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.css b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.css deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.js b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json deleted file mode 100644 index 14ab704d..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/index.css b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/index.css deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/module.js b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/module.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json deleted file mode 100644 index ee0eb71b..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "main": "../../../c.js", - "module": "module.js", - "style": "index.css" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/roots_fall_through/index.js b/fixtures/enhanced_resolve/test/fixtures/roots_fall_through/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/main.js b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json deleted file mode 100644 index 70a0f20f..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "browser": { - "./index.js": "./main.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/lib/index.js b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/lib/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/main.js b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json deleted file mode 100644 index 2af9e0d1..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "./main.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/shortcutdir.js/a.js b/fixtures/enhanced_resolve/test/fixtures/shortcutdir.js/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/b b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/b deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/c b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/c deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/a b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/a deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/b b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/b deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/b/foo/a b/fixtures/enhanced_resolve/test/fixtures/yield/b/foo/a deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/a b/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/a deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json b/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json deleted file mode 100644 index 0acc4b4c..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "foo", - "version": "1.0.0", - "browser": { - "./a": false - } -} diff --git "a/fixtures/enhanced_resolve/test/fixtures/\346\265\213\350\257\225.js" "b/fixtures/enhanced_resolve/test/fixtures/\346\265\213\350\257\225.js" deleted file mode 100644 index e69de29b..00000000 diff --git "a/fixtures/misc/\344\270\255\346\226\207/\344\270\255\346\226\207.js" "b/fixtures/misc/\344\270\255\346\226\207/\344\270\255\346\226\207.js" deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/pnpm/.gitignore b/fixtures/pnpm/.gitignore deleted file mode 100644 index 3c3629e6..00000000 --- a/fixtures/pnpm/.gitignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/fixtures/pnpm/package.json b/fixtures/pnpm/package.json deleted file mode 100644 index 78712e2b..00000000 --- a/fixtures/pnpm/package.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "name": "pnpm", - "version": "1.0.0", - "private": true, - "devDependencies": { - "axios": "1.6.2", - "styled-components": "6.1.1", - "postcss": "8.4.33" - } -} diff --git a/fixtures/pnpm/pnpm-lock.yaml b/fixtures/pnpm/pnpm-lock.yaml deleted file mode 100644 index e51dfd6a..00000000 --- a/fixtures/pnpm/pnpm-lock.yaml +++ /dev/null @@ -1,212 +0,0 @@ -lockfileVersion: '6.0' - -settings: - autoInstallPeers: true - excludeLinksFromLockfile: false - -devDependencies: - axios: - specifier: 1.6.2 - version: 1.6.2 - postcss: - specifier: 8.4.33 - version: 8.4.33 - styled-components: - specifier: 6.1.1 - version: 6.1.1(react-dom@18.2.0)(react@18.2.0) - -packages: - - /@emotion/is-prop-valid@1.2.1: - resolution: {integrity: sha512-61Mf7Ufx4aDxx1xlDeOm8aFFigGHE4z+0sKCa+IHCeZKiyP9RLD0Mmx7m8b9/Cf37f7NAvQOOJAbQQGVr5uERw==} - dependencies: - '@emotion/memoize': 0.8.1 - dev: true - - /@emotion/memoize@0.8.1: - resolution: {integrity: sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA==} - dev: true - - /@emotion/unitless@0.8.1: - resolution: {integrity: sha512-KOEGMu6dmJZtpadb476IsZBclKvILjopjUii3V+7MnXIQCYh8W3NgNcgwo21n9LXZX6EDIKvqfjYxXebDwxKmQ==} - dev: true - - /@types/stylis@4.2.4: - resolution: {integrity: sha512-36ZrGJ8fgtBr6nwNnuJ9jXIj+bn/pF6UoqmrQT7+Y99+tFFeHHsoR54+194dHdyhPjgbeoNz3Qru0oRt0l6ASQ==} - dev: true - - /asynckit@0.4.0: - resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} - dev: true - - /axios@1.6.2: - resolution: {integrity: sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A==} - dependencies: - follow-redirects: 1.15.3 - form-data: 4.0.0 - proxy-from-env: 1.1.0 - transitivePeerDependencies: - - debug - dev: true - - /camelize@1.0.1: - resolution: {integrity: sha512-dU+Tx2fsypxTgtLoE36npi3UqcjSSMNYfkqgmoEhtZrraP5VWq0K7FkWVTYa8eMPtnU/G2txVsfdCJTn9uzpuQ==} - dev: true - - /combined-stream@1.0.8: - resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} - engines: {node: '>= 0.8'} - dependencies: - delayed-stream: 1.0.0 - dev: true - - /css-color-keywords@1.0.0: - resolution: {integrity: sha512-FyyrDHZKEjXDpNJYvVsV960FiqQyXc/LlYmsxl2BcdMb2WPx0OGRVgTg55rPSyLSNMqP52R9r8geSp7apN3Ofg==} - engines: {node: '>=4'} - dev: true - - /css-to-react-native@3.2.0: - resolution: {integrity: sha512-e8RKaLXMOFii+02mOlqwjbD00KSEKqblnpO9e++1aXS1fPQOpS1YoqdVHBqPjHNoxeF2mimzVqawm2KCbEdtHQ==} - dependencies: - camelize: 1.0.1 - css-color-keywords: 1.0.0 - postcss-value-parser: 4.2.0 - dev: true - - /csstype@3.1.2: - resolution: {integrity: sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==} - dev: true - - /delayed-stream@1.0.0: - resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} - engines: {node: '>=0.4.0'} - dev: true - - /follow-redirects@1.15.3: - resolution: {integrity: sha512-1VzOtuEM8pC9SFU1E+8KfTjZyMztRsgEfwQl44z8A25uy13jSzTj6dyK2Df52iV0vgHCfBwLhDWevLn95w5v6Q==} - engines: {node: '>=4.0'} - peerDependencies: - debug: '*' - peerDependenciesMeta: - debug: - optional: true - dev: true - - /form-data@4.0.0: - resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==} - engines: {node: '>= 6'} - dependencies: - asynckit: 0.4.0 - combined-stream: 1.0.8 - mime-types: 2.1.35 - dev: true - - /js-tokens@4.0.0: - resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} - dev: true - - /loose-envify@1.4.0: - resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==} - hasBin: true - dependencies: - js-tokens: 4.0.0 - dev: true - - /mime-db@1.52.0: - resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} - engines: {node: '>= 0.6'} - dev: true - - /mime-types@2.1.35: - resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} - engines: {node: '>= 0.6'} - dependencies: - mime-db: 1.52.0 - dev: true - - /nanoid@3.3.7: - resolution: {integrity: sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==} - engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} - hasBin: true - dev: true - - /picocolors@1.0.0: - resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==} - dev: true - - /postcss-value-parser@4.2.0: - resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==} - dev: true - - /postcss@8.4.33: - resolution: {integrity: sha512-Kkpbhhdjw2qQs2O2DGX+8m5OVqEcbB9HRBvuYM9pgrjEFUg30A9LmXNlTAUj4S9kgtGyrMbTzVjH7E+s5Re2yg==} - engines: {node: ^10 || ^12 || >=14} - dependencies: - nanoid: 3.3.7 - picocolors: 1.0.0 - source-map-js: 1.0.2 - dev: true - - /proxy-from-env@1.1.0: - resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==} - dev: true - - /react-dom@18.2.0(react@18.2.0): - resolution: {integrity: sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==} - peerDependencies: - react: ^18.2.0 - dependencies: - loose-envify: 1.4.0 - react: 18.2.0 - scheduler: 0.23.0 - dev: true - - /react@18.2.0: - resolution: {integrity: sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==} - engines: {node: '>=0.10.0'} - dependencies: - loose-envify: 1.4.0 - dev: true - - /scheduler@0.23.0: - resolution: {integrity: sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw==} - dependencies: - loose-envify: 1.4.0 - dev: true - - /shallowequal@1.1.0: - resolution: {integrity: sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ==} - dev: true - - /source-map-js@1.0.2: - resolution: {integrity: sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==} - engines: {node: '>=0.10.0'} - dev: true - - /styled-components@6.1.1(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-cpZZP5RrKRIClBW5Eby4JM1wElLVP4NQrJbJ0h10TidTyJf4SIIwa3zLXOoPb4gJi8MsJ8mjq5mu2IrEhZIAcQ==} - engines: {node: '>= 16'} - peerDependencies: - react: '>= 16.8.0' - react-dom: '>= 16.8.0' - dependencies: - '@emotion/is-prop-valid': 1.2.1 - '@emotion/unitless': 0.8.1 - '@types/stylis': 4.2.4 - css-to-react-native: 3.2.0 - csstype: 3.1.2 - postcss: 8.4.33 - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - shallowequal: 1.1.0 - stylis: 4.3.0 - tslib: 2.6.2 - dev: true - - /stylis@4.3.0: - resolution: {integrity: sha512-E87pIogpwUsUwXw7dNyU4QDjdgVMy52m+XEOPEKUn161cCzWjjhPSQhByfd1CcNvrOLnXQ6OnnZDwnJrz/Z4YQ==} - dev: true - - /tslib@2.6.2: - resolution: {integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==} - dev: true diff --git a/fixtures/tsconfig/cases/builtins/thing.js b/fixtures/tsconfig/cases/builtins/thing.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/builtins/tsconfig.json b/fixtures/tsconfig/cases/builtins/tsconfig.json deleted file mode 100644 index 36aa1a4d..00000000 --- a/fixtures/tsconfig/cases/builtins/tsconfig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compilerOptions": { - "baseUrl": "." - } -} diff --git a/fixtures/tsconfig/cases/exports/index.js b/fixtures/tsconfig/cases/exports/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/exports/tsconfig.json b/fixtures/tsconfig/cases/exports/tsconfig.json deleted file mode 100644 index f0e3159b..00000000 --- a/fixtures/tsconfig/cases/exports/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-exports" -} diff --git a/fixtures/tsconfig/cases/extends-extension/base-tsconfig.json b/fixtures/tsconfig/cases/extends-extension/base-tsconfig.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/cases/extends-extension/base-tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/cases/extends-extension/foo.js b/fixtures/tsconfig/cases/extends-extension/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-extension/tsconfig.json b/fixtures/tsconfig/cases/extends-extension/tsconfig.json deleted file mode 100644 index 0ae4c6a3..00000000 --- a/fixtures/tsconfig/cases/extends-extension/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./base-tsconfig" -} diff --git a/fixtures/tsconfig/cases/extends-extensionless/foo.js b/fixtures/tsconfig/cases/extends-extensionless/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-extensionless/tsconfig.json b/fixtures/tsconfig/cases/extends-extensionless/tsconfig.json deleted file mode 100644 index c36cb7d4..00000000 --- a/fixtures/tsconfig/cases/extends-extensionless/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-field/conf" -} diff --git a/fixtures/tsconfig/cases/extends-multiple/foo.js b/fixtures/tsconfig/cases/extends-multiple/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-multiple/tsconfig.json b/fixtures/tsconfig/cases/extends-multiple/tsconfig.json deleted file mode 100644 index aa2ae783..00000000 --- a/fixtures/tsconfig/cases/extends-multiple/tsconfig.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": ["../extends-extension", "../extends-paths"], - "compilerOptions": { - "baseUrl": ".", - }, -} diff --git a/fixtures/tsconfig/cases/extends-not-found/index.js b/fixtures/tsconfig/cases/extends-not-found/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-not-found/tsconfig.json b/fixtures/tsconfig/cases/extends-not-found/tsconfig.json deleted file mode 100644 index 99df91da..00000000 --- a/fixtures/tsconfig/cases/extends-not-found/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./not-found" -} diff --git a/fixtures/tsconfig/cases/extends-paths/src/index.js b/fixtures/tsconfig/cases/extends-paths/src/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-paths/tsconfig.base.json b/fixtures/tsconfig/cases/extends-paths/tsconfig.base.json deleted file mode 100644 index 5c64b067..00000000 --- a/fixtures/tsconfig/cases/extends-paths/tsconfig.base.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "@/*": ["./*"] - } - } -} diff --git a/fixtures/tsconfig/cases/extends-paths/tsconfig.json b/fixtures/tsconfig/cases/extends-paths/tsconfig.json deleted file mode 100644 index 51086018..00000000 --- a/fixtures/tsconfig/cases/extends-paths/tsconfig.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": "./tsconfig.base.json", - "compilerOptions": { - "baseUrl": "src", - }, -} diff --git a/fixtures/tsconfig/cases/field/index.js b/fixtures/tsconfig/cases/field/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/field/tsconfig.json b/fixtures/tsconfig/cases/field/tsconfig.json deleted file mode 100644 index 9f86c3f4..00000000 --- a/fixtures/tsconfig/cases/field/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-field" -} diff --git a/fixtures/tsconfig/cases/index/index.js b/fixtures/tsconfig/cases/index/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/index/tsconfig.json b/fixtures/tsconfig/cases/index/tsconfig.json deleted file mode 100644 index d20b1774..00000000 --- a/fixtures/tsconfig/cases/index/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-index" -} diff --git a/fixtures/tsconfig/cases/paths_template_variable/foo.js b/fixtures/tsconfig/cases/paths_template_variable/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json b/fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json deleted file mode 100644 index a1a37bb6..00000000 --- a/fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "../../tsconfig_template_variable.json" -} diff --git a/fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json b/fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json deleted file mode 100644 index e7d8e5e5..00000000 --- a/fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "compilerOptions": { - "composite": true, - "paths": { - "foo": ["${configDir}/foo.js"] - } - } -} diff --git a/fixtures/tsconfig/cases/project_references/app/aliased/index.ts b/fixtures/tsconfig/cases/project_references/app/aliased/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/app/index.ts b/fixtures/tsconfig/cases/project_references/app/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/app/tsconfig.json b/fixtures/tsconfig/cases/project_references/app/tsconfig.json deleted file mode 100644 index 7036d2bb..00000000 --- a/fixtures/tsconfig/cases/project_references/app/tsconfig.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "extends": "../tsconfig.base.json", - "compilerOptions": { - "baseUrl": "./", - "paths": { - "@/*": ["./aliased/*"] - } - }, - "references": [ - { - "path": "../project_a/conf.json" - }, - { - "path": "../project_b" - }, - { - "path": "../project_c/tsconfig.json" - }, - { - "path": "../../paths_template_variable/tsconfig2.json" - } - ] -} diff --git a/fixtures/tsconfig/cases/project_references/project_a/aliased/index.ts b/fixtures/tsconfig/cases/project_references/project_a/aliased/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_a/conf.json b/fixtures/tsconfig/cases/project_references/project_a/conf.json deleted file mode 100644 index 4d389d7a..00000000 --- a/fixtures/tsconfig/cases/project_references/project_a/conf.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "compilerOptions": { - "composite": true, - "paths": { - "@/*": ["./aliased/*"] - } - } -} diff --git a/fixtures/tsconfig/cases/project_references/project_a/index.ts b/fixtures/tsconfig/cases/project_references/project_a/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_b/src/aliased/index.ts b/fixtures/tsconfig/cases/project_references/project_b/src/aliased/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_b/tsconfig.json b/fixtures/tsconfig/cases/project_references/project_b/tsconfig.json deleted file mode 100644 index 4ab05cd8..00000000 --- a/fixtures/tsconfig/cases/project_references/project_b/tsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "compilerOptions": { - "composite": true, - "baseUrl": "./src", - "paths": { - "@/*": ["./aliased/*"] - } - } -} diff --git a/fixtures/tsconfig/cases/project_references/project_c/index.ts b/fixtures/tsconfig/cases/project_references/project_c/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_c/tsconfig.json b/fixtures/tsconfig/cases/project_references/project_c/tsconfig.json deleted file mode 100644 index fe520939..00000000 --- a/fixtures/tsconfig/cases/project_references/project_c/tsconfig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compilerOptions": { - "composite": true - } -} diff --git a/fixtures/tsconfig/cases/project_references/tsconfig.base.json b/fixtures/tsconfig/cases/project_references/tsconfig.base.json deleted file mode 100644 index 88ccffe7..00000000 --- a/fixtures/tsconfig/cases/project_references/tsconfig.base.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "compilerOptions": { - } -} diff --git a/fixtures/tsconfig/cases/suffixes/a.ios.ts b/fixtures/tsconfig/cases/suffixes/a.ios.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/a.ts b/fixtures/tsconfig/cases/suffixes/a.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/b.ts b/fixtures/tsconfig/cases/suffixes/b.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/c-test.ts b/fixtures/tsconfig/cases/suffixes/c-test.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/index.ts b/fixtures/tsconfig/cases/suffixes/index.ts deleted file mode 100644 index b09939b9..00000000 --- a/fixtures/tsconfig/cases/suffixes/index.ts +++ /dev/null @@ -1 +0,0 @@ -import './a'; diff --git a/fixtures/tsconfig/cases/suffixes/tsconfig.json b/fixtures/tsconfig/cases/suffixes/tsconfig.json deleted file mode 100644 index 4c2ccc8f..00000000 --- a/fixtures/tsconfig/cases/suffixes/tsconfig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compilerOptions": { - "moduleSuffixes": [".ios", "-test", ""] - } -} diff --git a/fixtures/tsconfig/cases/trailing-comma/bar.js b/fixtures/tsconfig/cases/trailing-comma/bar.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/trailing-comma/index.js b/fixtures/tsconfig/cases/trailing-comma/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/trailing-comma/tsconfig.json b/fixtures/tsconfig/cases/trailing-comma/tsconfig.json deleted file mode 100644 index 6dc20ca5..00000000 --- a/fixtures/tsconfig/cases/trailing-comma/tsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "compilerOptions": { - "paths": { - /* some comment */ - "foo": ["bar.js"], - }, - }, - // another comment -} diff --git a/fixtures/tsconfig/foo.js b/fixtures/tsconfig/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/nested/index.js b/fixtures/tsconfig/nested/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/nested/test.js b/fixtures/tsconfig/nested/test.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/nested/tsconfig.json b/fixtures/tsconfig/nested/tsconfig.json deleted file mode 100644 index 6deb3011..00000000 --- a/fixtures/tsconfig/nested/tsconfig.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "extends": "..", - "compilerOptions": { - "paths": { - "ts-path": ["test.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-exports/conf.json b/fixtures/tsconfig/node_modules/tsconfig-exports/conf.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-exports/conf.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-exports/foo.js b/fixtures/tsconfig/node_modules/tsconfig-exports/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-exports/package.json b/fixtures/tsconfig/node_modules/tsconfig-exports/package.json deleted file mode 100644 index be0ddee6..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-exports/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "tsconfig-exports", - "private": true, - "exports": { - ".": "./conf.json" - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-field/conf.json b/fixtures/tsconfig/node_modules/tsconfig-field/conf.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-field/conf.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-field/foo.js b/fixtures/tsconfig/node_modules/tsconfig-field/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-field/package.json b/fixtures/tsconfig/node_modules/tsconfig-field/package.json deleted file mode 100644 index 7138fdde..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-field/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "tsconfig-field", - "private": true, - "tsconfig": "conf.json" -} \ No newline at end of file diff --git a/fixtures/tsconfig/node_modules/tsconfig-index/foo.js b/fixtures/tsconfig/node_modules/tsconfig-index/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-index/package.json b/fixtures/tsconfig/node_modules/tsconfig-index/package.json deleted file mode 100644 index eb2431e7..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-index/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "tsconfig-index", - "private": true -} \ No newline at end of file diff --git a/fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json b/fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-not-used/foo.js b/fixtures/tsconfig/node_modules/tsconfig-not-used/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json b/fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json deleted file mode 100644 index eb16d127..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "ts-path": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/package.json b/fixtures/tsconfig/package.json deleted file mode 100755 index f48acd1c..00000000 --- a/fixtures/tsconfig/package.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "name": "resolver", - "private": true, - "alias": { - "aliased": "foo", - "aliased-file": "./bar.js", - "something": "./nested/test.js", - "aliasedfolder": "./nested", - "aliasedabsolute": "/nested", - "foo/bar": "./bar.js", - "glob/*/*": "./nested/$2", - "./baz": "./bar.js", - "url": false - }, - "imports": { - "#test": "./bar.js" - }, - "dependencies": { - "foo": "^0.3.4" - }, - "peerDependencies": { - "bar": "*" - } -} diff --git a/fixtures/tsconfig/tsconfig.json b/fixtures/tsconfig/tsconfig.json deleted file mode 100644 index eb16d127..00000000 --- a/fixtures/tsconfig/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "ts-path": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/tsconfig_broken.json b/fixtures/tsconfig/tsconfig_broken.json deleted file mode 100644 index 98232c64..00000000 --- a/fixtures/tsconfig/tsconfig_broken.json +++ /dev/null @@ -1 +0,0 @@ -{ diff --git a/fixtures/tsconfig/tsconfig_template_variable.json b/fixtures/tsconfig/tsconfig_template_variable.json deleted file mode 100644 index 6f272344..00000000 --- a/fixtures/tsconfig/tsconfig_template_variable.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["${configDir}/foo.js"] - } - } -} diff --git a/napi/__test__/resolver.spec.mjs b/napi/__test__/resolver.spec.mjs deleted file mode 100644 index ac6ee0ef..00000000 --- a/napi/__test__/resolver.spec.mjs +++ /dev/null @@ -1,260 +0,0 @@ -import { join } from 'node:path' -import { fileURLToPath } from 'node:url' - -import test from 'ava' - -let ResolverFactory - -if (process.env.WASI_TEST) { - const wasi = await import('../resolver.wasi.cjs') - ResolverFactory = wasi.ResolverFactory -} else { - const napi = await import('../index.js') - ResolverFactory = napi.ResolverFactory -} - -const currentDir = join(fileURLToPath(import.meta.url), '..') - -const enhancedResolveRoot = join( - currentDir, - '..', - '..', - 'fixtures', - 'enhanced_resolve', - 'test', - 'fixtures' -) - -// https://github.com/webpack/enhanced-resolve/blob/main/test/resolve.test.js - -for (const [title, context, request, expected] of [ - [ - 'absolute path', - enhancedResolveRoot, - join(enhancedResolveRoot, 'main1.js'), - join(enhancedResolveRoot, 'main1.js'), - ], - [ - 'file with .js', - enhancedResolveRoot, - './main1.js', - join(enhancedResolveRoot, 'main1.js'), - ], - [ - 'file without extension', - enhancedResolveRoot, - './main1', - join(enhancedResolveRoot, 'main1.js'), - ], - [ - 'another file with .js', - enhancedResolveRoot, - './a.js', - join(enhancedResolveRoot, 'a.js'), - ], - [ - 'another file without extension', - enhancedResolveRoot, - './a', - join(enhancedResolveRoot, 'a.js'), - ], - [ - 'file in module with .js', - enhancedResolveRoot, - 'm1/a.js', - join(enhancedResolveRoot, 'node_modules/m1/a.js'), - ], - [ - 'file in module without extension', - enhancedResolveRoot, - 'm1/a', - join(enhancedResolveRoot, 'node_modules/m1/a.js'), - ], - [ - 'another file in module without extension', - enhancedResolveRoot, - 'complexm/step1', - join(enhancedResolveRoot, 'node_modules/complexm/step1.js'), - ], - [ - 'from submodule to file in sibling module', - join(enhancedResolveRoot, 'node_modules/complexm'), - 'm2/b.js', - join(enhancedResolveRoot, 'node_modules/m2/b.js'), - ], - [ - 'from nested directory to overwritten file in module', - join(enhancedResolveRoot, 'multiple_modules'), - 'm1/a.js', - join(enhancedResolveRoot, 'multiple_modules/node_modules/m1/a.js'), - ], - [ - 'from nested directory to not overwritten file in module', - join(enhancedResolveRoot, 'multiple_modules'), - 'm1/b.js', - join(enhancedResolveRoot, 'node_modules/m1/b.js'), - ], - [ - 'file with query', - enhancedResolveRoot, - './main1.js?query', - join(enhancedResolveRoot, 'main1.js?query'), - ], - [ - 'file with fragment', - enhancedResolveRoot, - './main1.js#fragment', - join(enhancedResolveRoot, 'main1.js#fragment'), - ], - [ - 'file with fragment and query', - enhancedResolveRoot, - './main1.js#fragment?query', - join(enhancedResolveRoot, 'main1.js#fragment?query'), - ], - [ - 'file with query and fragment', - enhancedResolveRoot, - './main1.js?#fragment', - join(enhancedResolveRoot, 'main1.js?#fragment'), - ], - - [ - 'file with query (unicode)', - enhancedResolveRoot, - './测试.js?query', - join(enhancedResolveRoot, '测试.js?query'), - ], - [ - 'file with fragment (unicode)', - enhancedResolveRoot, - './测试.js#fragment', - join(enhancedResolveRoot, '测试.js#fragment'), - ], - [ - 'file with fragment and query (unicode)', - enhancedResolveRoot, - './测试.js#fragment?query', - join(enhancedResolveRoot, '测试.js#fragment?query'), - ], - [ - 'file with query and fragment (unicode)', - enhancedResolveRoot, - './测试.js?#fragment', - join(enhancedResolveRoot, '测试.js?#fragment'), - ], - - [ - 'file in module with query', - enhancedResolveRoot, - 'm1/a?query', - join(enhancedResolveRoot, 'node_modules/m1/a.js?query'), - ], - [ - 'file in module with fragment', - enhancedResolveRoot, - 'm1/a#fragment', - join(enhancedResolveRoot, 'node_modules/m1/a.js#fragment'), - ], - [ - 'file in module with fragment and query', - enhancedResolveRoot, - 'm1/a#fragment?query', - join(enhancedResolveRoot, 'node_modules/m1/a.js#fragment?query'), - ], - [ - 'file in module with query and fragment', - enhancedResolveRoot, - 'm1/a?#fragment', - join(enhancedResolveRoot, 'node_modules/m1/a.js?#fragment'), - ], - [ - 'differ between directory and file, resolve file', - enhancedResolveRoot, - './dirOrFile', - join(enhancedResolveRoot, 'dirOrFile.js'), - ], - [ - 'differ between directory and file, resolve directory', - enhancedResolveRoot, - './dirOrFile/', - join(enhancedResolveRoot, 'dirOrFile/index.js'), - ], - [ - 'find node_modules outside of node_modules', - join(enhancedResolveRoot, 'browser-module/node_modules'), - 'm1/a', - join(enhancedResolveRoot, 'node_modules/m1/a.js'), - ], - [ - "don't crash on main field pointing to self", - enhancedResolveRoot, - './main-field-self', - join(enhancedResolveRoot, './main-field-self/index.js'), - ], - [ - "don't crash on main field pointing to self (2)", - enhancedResolveRoot, - './main-field-self2', - join(enhancedResolveRoot, './main-field-self2/index.js'), - ], - // enhanced-resolve has `#` prepended with a `\0`, they are removed from the - // following 3 expected test results. - // See https://github.com/webpack/enhanced-resolve#escaping - [ - 'handle fragment edge case (no fragment)', - enhancedResolveRoot, - './no#fragment/#/#', - join(enhancedResolveRoot, 'no#fragment', '#', '#.js'), - ], - [ - 'handle fragment edge case (fragment)', - enhancedResolveRoot, - './no#fragment/#/', - join(enhancedResolveRoot, 'no.js#fragment') + '/#/', - ], - [ - 'handle fragment escaping', - enhancedResolveRoot, - './no\0#fragment/\0#/\0##fragment', - join(enhancedResolveRoot, 'no#fragment', '#', '#.js#fragment'), - ], -]) { - test(title, (t) => { - const resolver = new ResolverFactory({ - modules: ['src/a', 'src/b', 'src/common', 'node_modules'], - extensions: ['.js', '.jsx', '.ts', '.tsx'], - }) - - t.is(resolver.sync(context, request).path, expected) - }) -} - -test('resolve pnpm package', (t) => { - const rootDir = join(currentDir, '..', '..'); - const pnpmProjectPath = join(rootDir, 'fixtures', 'pnpm') - const resolver = new ResolverFactory({ - aliasFields: ['browser'], - }) - t.deepEqual(resolver.sync(pnpmProjectPath, 'styled-components'), { - path: join( - rootDir, - 'node_modules/.pnpm/styled-components@6.1.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/styled-components/dist/styled-components.browser.cjs.js' - ), - }) - t.deepEqual( - resolver.sync( - join( - rootDir, - 'node_modules/.pnpm/styled-components@6.1.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/styled-components' - ), - 'react' - ), - { - path: join( - rootDir, - 'node_modules/.pnpm/react@18.3.1/node_modules/react/index.js' - ), - } - ) -}) diff --git a/napi/src/lib.rs b/napi/src/lib.rs deleted file mode 100644 index 06e369d8..00000000 --- a/napi/src/lib.rs +++ /dev/null @@ -1,207 +0,0 @@ -extern crate napi; -extern crate napi_derive; -extern crate oxc_resolver; - -use std::{ - path::{Path, PathBuf}, - sync::Arc, -}; - -use napi::{bindgen_prelude::AsyncTask, Task}; -use napi_derive::napi; -use oxc_resolver::{ResolveOptions, Resolver}; - -use self::{ - options::{NapiResolveOptions, StrOrStrList}, - tracing::init_tracing, -}; - -mod options; -mod tracing; - -#[napi(object)] -pub struct ResolveResult { - pub path: Option, - pub error: Option, -} - -fn resolve(resolver: &Resolver, path: &Path, request: &str) -> ResolveResult { - match resolver.resolve(path, request) { - Ok(resolution) => ResolveResult { - path: Some(resolution.full_path().to_string_lossy().to_string()), - error: None, - }, - Err(err) => ResolveResult { path: None, error: Some(err.to_string()) }, - } -} - -#[allow(clippy::needless_pass_by_value)] -#[napi] -pub fn sync(path: String, request: String) -> ResolveResult { - let path = PathBuf::from(path); - let resolver = Resolver::new(ResolveOptions::default()); - resolve(&resolver, &path, &request) -} - -pub struct ResolveTask { - resolver: Arc, - directory: PathBuf, - request: String, -} - -#[napi] -impl Task for ResolveTask { - type Output = ResolveResult; - type JsValue = ResolveResult; - - fn compute(&mut self) -> napi::Result { - Ok(resolve(&self.resolver, &self.directory, &self.request)) - } - - fn resolve(&mut self, _: napi::Env, result: Self::Output) -> napi::Result { - Ok(result) - } -} - -#[napi] -pub struct ResolverFactory { - resolver: Arc, -} - -#[napi] -impl ResolverFactory { - #[napi(constructor)] - pub fn new(options: NapiResolveOptions) -> Self { - init_tracing(); - Self { resolver: Arc::new(Resolver::new(Self::normalize_options(options))) } - } - - #[napi] - pub fn default() -> Self { - let default_options = ResolveOptions::default(); - Self { resolver: Arc::new(Resolver::new(default_options)) } - } - - /// Clone the resolver using the same underlying cache. - #[napi] - pub fn clone_with_options(&self, options: NapiResolveOptions) -> Self { - Self { - resolver: Arc::new(self.resolver.clone_with_options(Self::normalize_options(options))), - } - } - - /// Clear the underlying cache. - #[napi] - pub fn clear_cache(&self) { - self.resolver.clear_cache(); - } - - /// Synchronously resolve `specifier` at an absolute path to a `directory`. - #[allow(clippy::needless_pass_by_value)] - #[napi] - pub fn sync(&self, directory: String, request: String) -> ResolveResult { - let path = PathBuf::from(directory); - resolve(&self.resolver, &path, &request) - } - - /// Asynchronously resolve `specifier` at an absolute path to a `directory`. - #[allow(clippy::needless_pass_by_value)] - #[napi(js_name = "async")] - pub fn resolve_async(&self, directory: String, request: String) -> AsyncTask { - let path = PathBuf::from(directory); - let resolver = self.resolver.clone(); - AsyncTask::new(ResolveTask { resolver, directory: path, request }) - } - - fn normalize_options(op: NapiResolveOptions) -> ResolveOptions { - let default = ResolveOptions::default(); - // merging options - ResolveOptions { - tsconfig: op.tsconfig.map(|tsconfig| tsconfig.into()), - alias: op - .alias - .map(|alias| { - alias - .into_iter() - .map(|(k, v)| { - let v = v - .into_iter() - .map(|item| match item { - Some(path) => oxc_resolver::AliasValue::from(path), - None => oxc_resolver::AliasValue::Ignore, - }) - .collect(); - (k, v) - }) - .collect::>() - }) - .unwrap_or(default.alias), - alias_fields: op - .alias_fields - .map(|o| o.into_iter().map(|x| StrOrStrList(x).into()).collect::>()) - .unwrap_or(default.alias_fields), - condition_names: op.condition_names.unwrap_or(default.condition_names), - description_files: op.description_files.unwrap_or(default.description_files), - enforce_extension: op - .enforce_extension - .map(|enforce_extension| enforce_extension.into()) - .unwrap_or(default.enforce_extension), - exports_fields: op - .exports_fields - .map(|o| o.into_iter().map(|x| StrOrStrList(x).into()).collect::>()) - .unwrap_or(default.exports_fields), - imports_fields: op - .imports_fields - .map(|o| o.into_iter().map(|x| StrOrStrList(x).into()).collect::>()) - .unwrap_or(default.imports_fields), - extension_alias: op - .extension_alias - .map(|extension_alias| extension_alias.into_iter().collect::>()) - .unwrap_or(default.extension_alias), - extensions: op.extensions.unwrap_or(default.extensions), - fallback: op - .fallback - .map(|fallback| { - fallback - .into_iter() - .map(|(k, v)| { - let v = v - .into_iter() - .map(|item| match item { - Some(path) => oxc_resolver::AliasValue::from(path), - None => oxc_resolver::AliasValue::Ignore, - }) - .collect(); - (k, v) - }) - .collect::>() - }) - .unwrap_or(default.fallback), - fully_specified: op.fully_specified.unwrap_or(default.fully_specified), - main_fields: op - .main_fields - .map(|o| StrOrStrList(o).into()) - .unwrap_or(default.main_fields), - main_files: op.main_files.unwrap_or(default.main_files), - modules: op.modules.map(|o| StrOrStrList(o).into()).unwrap_or(default.modules), - resolve_to_context: op.resolve_to_context.unwrap_or(default.resolve_to_context), - prefer_relative: op.prefer_relative.unwrap_or(default.prefer_relative), - prefer_absolute: op.prefer_absolute.unwrap_or(default.prefer_absolute), - restrictions: op - .restrictions - .map(|restrictions| { - restrictions - .into_iter() - .map(|restriction| restriction.into()) - .collect::>() - }) - .unwrap_or(default.restrictions), - roots: op - .roots - .map(|roots| roots.into_iter().map(PathBuf::from).collect::>()) - .unwrap_or(default.roots), - symlinks: op.symlinks.unwrap_or(default.symlinks), - builtin_modules: op.builtin_modules.unwrap_or(default.builtin_modules), - } - } -} diff --git a/napi/src/options.rs b/napi/src/options.rs deleted file mode 100644 index ea35672f..00000000 --- a/napi/src/options.rs +++ /dev/null @@ -1,261 +0,0 @@ -use std::path::PathBuf; - -use napi::Either; -use napi_derive::napi; -use std::collections::HashMap; - -/// Module Resolution Options -/// -/// Options are directly ported from [enhanced-resolve](https://github.com/webpack/enhanced-resolve#resolver-options). -/// -/// See [webpack resolve](https://webpack.js.org/configuration/resolve/) for information and examples -#[derive(Debug, Clone)] -#[napi(object)] -pub struct NapiResolveOptions { - /// Path to TypeScript configuration file. - /// - /// Default `None` - pub tsconfig: Option, - - /// Alias for [ResolveOptions::alias] and [ResolveOptions::fallback]. - /// - /// For the second value of the tuple, `None -> AliasValue::Ignore`, Some(String) -> - /// AliasValue::Path(String)` - /// Create aliases to import or require certain modules more easily. - /// A trailing $ can also be added to the given object's keys to signify an exact match. - pub alias: Option>>>, - - /// A list of alias fields in description files. - /// Specify a field, such as `browser`, to be parsed according to [this specification](https://github.com/defunctzombie/package-browser-field-spec). - /// Can be a path to json object such as `["path", "to", "exports"]`. - /// - /// Default `[]` - #[napi(ts_type = "(string | string[])[]")] - pub alias_fields: Option>, - - /// Condition names for exports field which defines entry points of a package. - /// The key order in the exports field is significant. During condition matching, earlier entries have higher priority and take precedence over later entries. - /// - /// Default `[]` - pub condition_names: Option>, - - /// The JSON files to use for descriptions. (There was once a `bower.json`.) - /// - /// Default `["package.json"]` - pub description_files: Option>, - - /// If true, it will not allow extension-less files. - /// So by default `require('./foo')` works if `./foo` has a `.js` extension, - /// but with this enabled only `require('./foo.js')` will work. - /// - /// Default to `true` when [ResolveOptions::extensions] contains an empty string. - /// Use `Some(false)` to disable the behavior. - /// See - /// - /// Default None, which is the same as `Some(false)` when the above empty rule is not applied. - pub enforce_extension: Option, - - /// A list of exports fields in description files. - /// Can be a path to json object such as `["path", "to", "exports"]`. - /// - /// Default `[["exports"]]`. - #[napi(ts_type = "(string | string[])[]")] - pub exports_fields: Option>, - - /// Fields from `package.json` which are used to provide the internal requests of a package - /// (requests starting with # are considered internal). - /// - /// Can be a path to a JSON object such as `["path", "to", "imports"]`. - /// - /// Default `[["imports"]]`. - #[napi(ts_type = "(string | string[])[]")] - pub imports_fields: Option>, - - /// An object which maps extension to extension aliases. - /// - /// Default `{}` - pub extension_alias: Option>>, - - /// Attempt to resolve these extensions in order. - /// If multiple files share the same name but have different extensions, - /// will resolve the one with the extension listed first in the array and skip the rest. - /// - /// Default `[".js", ".json", ".node"]` - pub extensions: Option>, - - /// Redirect module requests when normal resolving fails. - /// - /// Default `[]` - pub fallback: Option>>>, - - /// 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). - /// - /// See also webpack configuration [resolve.fullySpecified](https://webpack.js.org/configuration/module/#resolvefullyspecified) - /// - /// Default `false` - pub fully_specified: Option, - - /// A list of main fields in description files - /// - /// Default `["main"]`. - #[napi(ts_type = "string | string[]")] - pub main_fields: Option, - - /// The filename to be used while resolving directories. - /// - /// Default `["index"]` - pub main_files: Option>, - - /// A list of directories to resolve modules from, can be absolute path or folder name. - /// - /// Default `["node_modules"]` - #[napi(ts_type = "string | string[]")] - pub modules: Option, - - /// Resolve to a context instead of a file. - /// - /// Default `false` - pub resolve_to_context: Option, - - /// Prefer to resolve module requests as relative requests instead of using modules from node_modules directories. - /// - /// Default `false` - pub prefer_relative: Option, - - /// Prefer to resolve server-relative urls as absolute paths before falling back to resolve in ResolveOptions::roots. - /// - /// Default `false` - pub prefer_absolute: Option, - - /// A list of resolve restrictions to restrict the paths that a request can be resolved on. - /// - /// Default `[]` - pub restrictions: Option>, - - /// A list of directories where requests of server-relative URLs (starting with '/') are resolved. - /// On non-Windows systems these requests are resolved as an absolute path first. - /// - /// Default `[]` - pub roots: Option>, - - /// Whether to resolve symlinks to their symlinked location. - /// When enabled, symlinked resources are resolved to their real path, not their symlinked location. - /// Note that this may cause module resolution to fail when using tools that symlink packages (like npm link). - /// - /// Default `true` - pub symlinks: Option, - - /// Whether to parse [module.builtinModules](https://nodejs.org/api/module.html#modulebuiltinmodules) or not. - /// For example, "zlib" will throw [crate::ResolveError::Builtin] when set to true. - /// - /// Default `false` - pub builtin_modules: Option, -} - -#[napi] -#[derive(Debug, PartialEq, Eq)] -pub enum EnforceExtension { - Auto, - Enabled, - Disabled, -} - -impl EnforceExtension { - pub fn is_auto(&self) -> bool { - *self == Self::Auto - } - - pub fn is_enabled(&self) -> bool { - *self == Self::Enabled - } - - pub fn is_disabled(&self) -> bool { - *self == Self::Disabled - } -} - -/// Alias Value for [ResolveOptions::alias] and [ResolveOptions::fallback]. -/// Use struct because napi don't support structured union now -#[napi(object)] -#[derive(Debug, Clone)] -pub struct Restriction { - pub path: Option, - pub regex: Option, -} - -/// Tsconfig Options -/// -/// Derived from [tsconfig-paths-webpack-plugin](https://github.com/dividab/tsconfig-paths-webpack-plugin#options) -#[napi(object)] -#[derive(Debug, Clone)] -pub struct TsconfigOptions { - /// Allows you to specify where to find the TypeScript configuration file. - /// You may provide - /// * a relative path to the configuration file. It will be resolved relative to cwd. - /// * an absolute path to the configuration file. - pub config_file: String, - - /// Support for Typescript Project References. - /// - /// * `'auto'`: use the `references` field from tsconfig of `config_file`. - /// * `string[]`: manually provided relative or absolute path. - #[napi(ts_type = "'auto' | string[]")] - pub references: Option>>, -} - -impl Into for Restriction { - fn into(self) -> oxc_resolver::Restriction { - match (self.path, self.regex) { - (None, None) => { - panic!("Should specify path or regex") - } - (None, Some(regex)) => oxc_resolver::Restriction::RegExp(regex), - (Some(path), None) => oxc_resolver::Restriction::Path(PathBuf::from(path)), - (Some(_), Some(_)) => { - panic!("Restriction can't be path and regex at the same time") - } - } - } -} - -impl Into for EnforceExtension { - fn into(self) -> oxc_resolver::EnforceExtension { - match self { - EnforceExtension::Auto => oxc_resolver::EnforceExtension::Auto, - EnforceExtension::Enabled => oxc_resolver::EnforceExtension::Enabled, - EnforceExtension::Disabled => oxc_resolver::EnforceExtension::Disabled, - } - } -} - -impl Into for TsconfigOptions { - fn into(self) -> oxc_resolver::TsconfigOptions { - oxc_resolver::TsconfigOptions { - config_file: PathBuf::from(self.config_file), - references: match self.references { - Some(Either::A(string)) if string.as_str() == "auto" => { - oxc_resolver::TsconfigReferences::Auto - } - Some(Either::A(opt)) => { - panic!("`{}` is not a valid option for tsconfig references", opt) - } - Some(Either::B(paths)) => oxc_resolver::TsconfigReferences::Paths( - paths.into_iter().map(PathBuf::from).collect::>(), - ), - None => oxc_resolver::TsconfigReferences::Disabled, - }, - } - } -} - -type StrOrStrListType = Either>; -pub struct StrOrStrList(pub StrOrStrListType); - -impl Into> for StrOrStrList { - fn into(self) -> Vec { - match self { - StrOrStrList(Either::A(s)) => Vec::from([s]), - StrOrStrList(Either::B(a)) => a, - } - } -} diff --git a/napi/src/tracing.rs b/napi/src/tracing.rs deleted file mode 100644 index 88e4cd7e..00000000 --- a/napi/src/tracing.rs +++ /dev/null @@ -1,25 +0,0 @@ -use std::sync::OnceLock; - -use tracing_subscriber::filter::Targets; -use tracing_subscriber::prelude::__tracing_subscriber_SubscriberExt; -use tracing_subscriber::util::SubscriberInitExt; - -/// To debug `oxc_resolver`: -/// `OXC_LOG=DEBUG your program` -pub fn init_tracing() { - static TRACING: OnceLock<()> = OnceLock::new(); - TRACING.get_or_init(|| { - // Usage without the `regex` feature. - // - tracing_subscriber::registry() - .with(std::env::var("OXC_LOG").map_or_else( - |_| Targets::new(), - |env_var| { - use std::str::FromStr; - Targets::from_str(&env_var).unwrap() - }, - )) - .with(tracing_subscriber::fmt::layer()) - .init(); - }); -} diff --git a/napi/tests/options.test.mjs b/napi/tests/options.test.mjs deleted file mode 100644 index 4a93efff..00000000 --- a/napi/tests/options.test.mjs +++ /dev/null @@ -1,59 +0,0 @@ -import { describe, it } from "node:test"; -import { ResolverFactory } from "../index.js"; -import * as assert from "node:assert"; -import * as path from "node:path"; - -const fixtureDir = new URL( - "../../fixtures/enhanced_resolve/test/fixtures", - import.meta.url -).pathname; - -describe("option", () => { - describe("aliasFields", () => { - it("should allow field string ", () => { - const resolver = new ResolverFactory({ aliasFields: ["browser"] }); - assert.match( - resolver.sync(fixtureDir, "./browser-module/lib/replaced.js").path, - /browser-module\/lib\/browser\.js$/ - ); - }); - it("should allow json path array", () => { - const resolver = new ResolverFactory({ - aliasFields: [["innerBrowser1", "field", "browser"]], - }); - - assert.match( - resolver.sync(fixtureDir, "./browser-module/lib/main1.js").path, - /browser-module\/lib\/main\.js$/ - ); - }); - }); - - describe("exportsFields", () => { - const createTest = (exportsFields) => { - const resolver = new ResolverFactory({ exportsFields }); - assert.match( - resolver.sync( - path.resolve(fixtureDir, "./exports-field3"), - "exports-field" - ).path, - /\/exports-field\/src\/index\.js$/ - ); - }; - it("should allow string as field item", createTest(["broken"])); - it("should allow json path array as field item", createTest([["broken"]])); - }); - - describe("mainFields", () => { - const createTest = (mainFields) => { - const resolver = new ResolverFactory({ mainFields }); - assert.match( - resolver.sync(fixtureDir, "../..").path, - /\/lib\/index\.js$/ - ); - }; - it("should use `'main'` as default", createTest(undefined)); - it("should allow field string", createTest("main")); - it("should allow field array", createTest(["main"])); - }); -}); diff --git a/npm/package.json b/npm/package.json index a93c2f79..8e711b3a 100644 --- a/npm/package.json +++ b/npm/package.json @@ -1,46 +1,35 @@ { - "name": "oxc-resolver", - "version": "1.9.3", - "description": "Oxc Resolver Node API", - "main": "index.js", - "browser": "browser.js", - "files": [ - "index.d.ts", - "index.js", - "browser.js" - ], - "license": "MIT", - "homepage": "https://oxc.rs", - "repository": { - "type": "git", - "url": "git+https://github.com/oxc-project/oxc-resolver.git" - }, - "publishConfig": { - "registry": "https://registry.npmjs.org/", - "access": "public" - }, - "napi": { - "binaryName": "resolver", - "packageName": "@oxc-resolver/binding", - "wasm": { - "browser": { - "fs": true - } - }, - "targets": [ - "x86_64-pc-windows-msvc", - "aarch64-pc-windows-msvc", - "x86_64-unknown-linux-gnu", - "x86_64-unknown-linux-musl", - "aarch64-unknown-linux-gnu", - "aarch64-unknown-linux-musl", - "armv7-unknown-linux-gnueabihf", - "x86_64-apple-darwin", - "aarch64-apple-darwin", - "wasm32-wasip1-threads" - ] - }, - "funding": { - "url": "https://github.com/sponsors/Boshen" - } + "name": "oxc-resolver", + "description": "Oxc Resolver Node API", + "funding": { + "url": "https://github.com/sponsors/Boshen" + }, + "main": "index.js", + "browser": "browser.js", + "files": [ + "index.d.ts", + "index.js", + "browser.js" + ], + "napi": { + "binaryName": "resolver", + "packageName": "@oxc-resolver/binding", + "targets": [ + "x86_64-pc-windows-msvc", + "aarch64-pc-windows-msvc", + "x86_64-unknown-linux-gnu", + "x86_64-unknown-linux-musl", + "aarch64-unknown-linux-gnu", + "aarch64-unknown-linux-musl", + "armv7-unknown-linux-gnueabihf", + "x86_64-apple-darwin", + "aarch64-apple-darwin", + "wasm32-wasip1-threads" + ], + "wasm": { + "browser": { + "fs": true + } + } + } } diff --git a/package.json b/package.json index 6e1f3aa0..a431e48f 100644 --- a/package.json +++ b/package.json @@ -1,33 +1,24 @@ { - "name": "@oxc-resolver/binding", - "private": true, - "version": "0.0.0", - "scripts": { - "build": "napi build --platform --release --package-json-path npm/package.json --manifest-path napi/Cargo.toml", - "build:debug": "napi build --platform --package-json-path npm/package.json --manifest-path napi/Cargo.toml", - "prepublishOnly": "napi pre-publish -t npm", - "test": "ava" - }, - "devDependencies": { - "@napi-rs/cli": "^3.0.0-alpha.43", - "@napi-rs/wasm-runtime": "^0.2.0", - "@types/node": "^20.10.4", - "ava": "^6.0.1", - "emnapi": "^1.0.0", - "typescript": "^5.3.3" - }, - "ava": { - "files": [ - "napi/__test__/*.spec.mjs" - ], - "cache": false - }, - "packageManager": "pnpm@9.5.0", - "repository": { - "type": "git", - "url": "git+https://github.com/oxc-project/oxc-resolver.git" - }, - "funding": { - "url": "https://github.com/sponsors/Boshen" - } + "name": "@oxc-resolver/binding", + "funding": { + "url": "https://github.com/sponsors/Boshen" + }, + "scripts": { + "build": "napi build --platform --release --package-json-path npm/package.json --manifest-path napi/Cargo.toml", + "build:debug": "napi build --platform --package-json-path npm/package.json --manifest-path napi/Cargo.toml", + "prepublishOnly": "napi pre-publish -t npm" + }, + "ava": { + "cache": false, + "files": [ + "napi/__test__/*.spec.mjs" + ] + }, + "devDependencies": { + "@napi-rs/cli": "^3.0.0-alpha.43", + "@napi-rs/wasm-runtime": "^0.2.0", + "@types/node": "^20.10.4", + "ava": "^6.0.1", + "emnapi": "^1.0.0" + } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml deleted file mode 100644 index d92646ec..00000000 --- a/pnpm-lock.yaml +++ /dev/null @@ -1,2578 +0,0 @@ -lockfileVersion: '9.0' - -settings: - autoInstallPeers: true - excludeLinksFromLockfile: false - -importers: - - .: - devDependencies: - '@napi-rs/cli': - specifier: ^3.0.0-alpha.43 - version: 3.0.0-alpha.56(@emnapi/runtime@1.2.0)(emnapi@1.2.0) - '@napi-rs/wasm-runtime': - specifier: ^0.2.0 - version: 0.2.4 - '@types/node': - specifier: ^20.10.4 - version: 20.14.10 - ava: - specifier: ^6.0.1 - version: 6.1.3 - emnapi: - specifier: ^1.0.0 - version: 1.2.0 - typescript: - specifier: ^5.3.3 - version: 5.5.3 - - fixtures/pnpm: - devDependencies: - axios: - specifier: 1.6.2 - version: 1.6.2 - postcss: - specifier: 8.4.33 - version: 8.4.33 - styled-components: - specifier: 6.1.1 - version: 6.1.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - - npm: {} - -packages: - - '@emnapi/core@1.2.0': - resolution: {integrity: sha512-E7Vgw78I93we4ZWdYCb4DGAwRROGkMIXk7/y87UmANR+J6qsWusmC3gLt0H+O0KOt5e6O38U8oJamgbudrES/w==} - - '@emnapi/runtime@1.2.0': - resolution: {integrity: sha512-bV21/9LQmcQeCPEg3BDFtvwL6cwiTMksYNWQQ4KOxCZikEGalWtenoZ0wCiukJINlGCIi2KXx01g4FoH/LxpzQ==} - - '@emnapi/wasi-threads@1.0.1': - resolution: {integrity: sha512-iIBu7mwkq4UQGeMEM8bLwNK962nXdhodeScX4slfQnRhEMMzvYivHhutCIk8uojvmASXXPC2WNEjwxFWk72Oqw==} - - '@emotion/is-prop-valid@1.2.2': - resolution: {integrity: sha512-uNsoYd37AFmaCdXlg6EYD1KaPOaRWRByMCYzbKUX4+hhMfrxdVSelShywL4JVaAeM/eHUOSprYBQls+/neX3pw==} - - '@emotion/memoize@0.8.1': - resolution: {integrity: sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA==} - - '@emotion/unitless@0.8.1': - resolution: {integrity: sha512-KOEGMu6dmJZtpadb476IsZBclKvILjopjUii3V+7MnXIQCYh8W3NgNcgwo21n9LXZX6EDIKvqfjYxXebDwxKmQ==} - - '@inquirer/figures@1.0.3': - resolution: {integrity: sha512-ErXXzENMH5pJt5/ssXV0DfWUZqly8nGzf0UcBV9xTnP+KyffE2mqyxIMBrZ8ijQck2nU0TQm40EQB53YreyWHw==} - engines: {node: '>=18'} - - '@mapbox/node-pre-gyp@1.0.11': - resolution: {integrity: sha512-Yhlar6v9WQgUp/He7BdgzOz8lqMQ8sU+jkCq7Wx8Myc5YFJLbEe7lgui/V7G1qB1DJykHSGwreceSaD60Y0PUQ==} - hasBin: true - - '@napi-rs/cli@3.0.0-alpha.56': - resolution: {integrity: sha512-a03KyEodiZD9+MIL8xnIAcnNzznZy+BT/IBtXZe/kIEUYv/zVcxwpcBuNme5r6zIyDqla8NkhsC6h8IZR+HAgg==} - engines: {node: '>= 16'} - hasBin: true - peerDependencies: - '@emnapi/runtime': ^1.1.0 - emnapi: ^1.1.0 - peerDependenciesMeta: - '@emnapi/runtime': - optional: true - emnapi: - optional: true - - '@napi-rs/cross-toolchain@0.0.16': - resolution: {integrity: sha512-jwdjHT5L0m9MH0CmzDwPp0ckn/UO7afHCsPeo7NugHUvYgvlgS7SWhdMVgIgJW2HHqhcW/2nhaLLGpAU1c7QRQ==} - peerDependencies: - '@napi-rs/cross-toolchain-arm64-target-aarch64': ^0.0.16 - '@napi-rs/cross-toolchain-arm64-target-armv7': ^0.0.16 - '@napi-rs/cross-toolchain-arm64-target-x86_64': ^0.0.16 - '@napi-rs/cross-toolchain-x64-target-aarch64': ^0.0.16 - '@napi-rs/cross-toolchain-x64-target-armv7': ^0.0.16 - '@napi-rs/cross-toolchain-x64-target-x86_64': ^0.0.16 - peerDependenciesMeta: - '@napi-rs/cross-toolchain-arm64-target-aarch64': - optional: true - '@napi-rs/cross-toolchain-arm64-target-armv7': - optional: true - '@napi-rs/cross-toolchain-arm64-target-x86_64': - optional: true - '@napi-rs/cross-toolchain-x64-target-aarch64': - optional: true - '@napi-rs/cross-toolchain-x64-target-armv7': - optional: true - '@napi-rs/cross-toolchain-x64-target-x86_64': - optional: true - - '@napi-rs/lzma-android-arm-eabi@1.3.1': - resolution: {integrity: sha512-mtGOg8jXlc+pTBI86cqohfndS9UmOAkk9d5CChKMb8btVks70yhUN1e7YYS3QFbmoxbPs2Ee+wmuH1Khdc7B2w==} - engines: {node: '>= 10'} - cpu: [arm] - os: [android] - - '@napi-rs/lzma-android-arm64@1.3.1': - resolution: {integrity: sha512-4uGkQgAv9Tnc/i0k2eIgbhZgyzs94+iECWxz4MFZNcZ1fNGvGbRL2j+SITE4OmwrUn3TuFK/uYWfgzooq8E1Qg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [android] - - '@napi-rs/lzma-darwin-arm64@1.3.1': - resolution: {integrity: sha512-MZBg4iwHTS8icjTiCMdzh8kYrMmKBCEglFPa+vjI91R2XDwuuwSzqmpATRpmMH8cWUUWtGPF4fnxKzjgkzhd4Q==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [darwin] - - '@napi-rs/lzma-darwin-x64@1.3.1': - resolution: {integrity: sha512-7vte+1lYV7xgZERKH/pjAeh4T16aQASKOzu4op70pK6VP/64Plr5rrvqxQqQmlAIe4pwyo/RkFl1n4LXDod3xg==} - engines: {node: '>= 10'} - cpu: [x64] - os: [darwin] - - '@napi-rs/lzma-freebsd-x64@1.3.1': - resolution: {integrity: sha512-uBS74fynTqLUC3catIxyezCafn8UDlr2yxVV47vz1T6Vop2PGDz/cMQdV6rnLSjPE08Rv66ihM36mgf/MmOkOg==} - engines: {node: '>= 10'} - cpu: [x64] - os: [freebsd] - - '@napi-rs/lzma-linux-arm-gnueabihf@1.3.1': - resolution: {integrity: sha512-rrVLyqBJeN29gPJCNkPbZ7dAzaseEcERKyhjwM+DfbFrDUvtkEcrYPvo+iwE/NmF+OkZQkzcanrVMGnq/mcJYQ==} - engines: {node: '>= 10'} - cpu: [arm] - os: [linux] - - '@napi-rs/lzma-linux-arm64-gnu@1.3.1': - resolution: {integrity: sha512-vDmVsthRbX2opkgRirJJGKQxUP/spvyVM2Y5CyCWZ7sadSID3hA97r38gf9ISn/sJ8/r93IPWLq+iycudNKi+Q==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/lzma-linux-arm64-musl@1.3.1': - resolution: {integrity: sha512-x4m/J3hRdFd3IoqKc+4aBcSUkcuDEP7hH6vdss8bKNLjPfXmnG/lcHJEQX3hNnNOULPP8xVRxgiY8jeL62cnsw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/lzma-linux-x64-gnu@1.3.1': - resolution: {integrity: sha512-riB+Xg72NfH8Kcpq07omshVu0QsLW0v2bhywBNYxvA+t2dGGWSIEN1U/zazUXys+IEA6pBQKqLVseurWE6Cl8g==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/lzma-linux-x64-musl@1.3.1': - resolution: {integrity: sha512-JXLgJFwoeysxdSg7rdVYP8wrliCQVJlU5JcLYjRVSCL4P0mQTjnYi7R7VdaOkDACw/Fvlji7oIJXt0KiaDTcOw==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/lzma-wasm32-wasi@1.3.1': - resolution: {integrity: sha512-XTA9XTUtj0KPKuzNS2oi3bWN6tJodk00wwMd/TiKoEqx9Fe/zu+OfDGuXAn+xs+P7S3YCDHqjYinuTQMZ0ucJw==} - engines: {node: '>=14.0.0'} - cpu: [wasm32] - - '@napi-rs/lzma-win32-arm64-msvc@1.3.1': - resolution: {integrity: sha512-qLDfs9UEtLPPTN/FdSz3gSdlx86VwFQBuLBrQtaiYQtUTKZCOYV1Z1fXqFt5Zqa1HKV2oyXnwGcTI7RpcyXxtg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [win32] - - '@napi-rs/lzma-win32-ia32-msvc@1.3.1': - resolution: {integrity: sha512-rWNlxLFMIfvxzfdQCfeQ3D/HEnQG3vfladFYrXUx6ePXO6r+BLCGn6/LWSSuKlw4vKkb1iHEWsAVaRLIcJEMIA==} - engines: {node: '>= 10'} - cpu: [ia32] - os: [win32] - - '@napi-rs/lzma-win32-x64-msvc@1.3.1': - resolution: {integrity: sha512-SNfHNqEjabXfTL1+KRi0qiAhwIlZHhQystvfSYX6p1g+2trSC/3WUpUQ4fbbR7KyE31g2AAnwjXivnlQ0af/pg==} - engines: {node: '>= 10'} - cpu: [x64] - os: [win32] - - '@napi-rs/lzma@1.3.1': - resolution: {integrity: sha512-XyZoBlYNMvCulK/RmVK/0nB3j7IdH7HpqcrMMg0U+HqQqKRLOQBwvnKNBocPC1bZQ7iZuKWYTLn1ayZwTyek8w==} - engines: {node: '>= 10'} - - '@napi-rs/tar-android-arm-eabi@0.1.1': - resolution: {integrity: sha512-Ufa0ahZvE5KGrC2WBux5svCe/jvC+e8IgtleiicwqnfgTfbDknYyq/QuqkP1AnMp/IvTmx2iutCZt6OFIG0zAg==} - engines: {node: '>= 10'} - cpu: [arm] - os: [android] - - '@napi-rs/tar-android-arm64@0.1.1': - resolution: {integrity: sha512-KUu5fHIiIObSuZ/crHxUrQ243+LiCRKPwdCVLHwjtftqFjzls+R2Mp6GrpM41XxexDMN00SUta3kazi93Xr19A==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [android] - - '@napi-rs/tar-darwin-arm64@0.1.1': - resolution: {integrity: sha512-jaqgdX20iIga+2gzotQ78eF00Cm8vECocUYeMY62WqyzJNv/jx1dlOfELWEccOjpmawFT9tjWebsS9F1QMvSUg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [darwin] - - '@napi-rs/tar-darwin-x64@0.1.1': - resolution: {integrity: sha512-80sa32IxfRso9x9sGTFpfLSx3BnruyJODpSkUzalOCz9i14n5gOKA8KR/JrnSWwDz0p5l5P9kfQD3pu8Voj7WA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [darwin] - - '@napi-rs/tar-freebsd-x64@0.1.1': - resolution: {integrity: sha512-P7V1zBjjC1dCrTwtUzuzYM4AeZduigeCtd8qQw2IUZowM5AsmhMd77oYuXjdU29cEpKUpyYjJRxjPCzFy+WbAQ==} - engines: {node: '>= 10'} - cpu: [x64] - os: [freebsd] - - '@napi-rs/tar-linux-arm-gnueabihf@0.1.1': - resolution: {integrity: sha512-qpC71ILPkWKt8k1iJCYt5gjwcOkd2VFSQIelTRr12t5CVNKV04rE/TMdwFoCP7kxbtb9Fl2cZzCRISw2BhMCmQ==} - engines: {node: '>= 10'} - cpu: [arm] - os: [linux] - - '@napi-rs/tar-linux-arm64-gnu@0.1.1': - resolution: {integrity: sha512-71QgxcFJCog6O4Tauoge8D0ILkDGJTRk3ru7zG8PUFG1QXJ1kkiRikdT77YmoVxtomc9FUOt+bdEdU5Yn+3QUQ==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/tar-linux-arm64-musl@0.1.1': - resolution: {integrity: sha512-R2e7YEILPKc447N1hUt1zQuyy0st83HX6nhmtFywS1aOj76/3hzxLVrebGiiS6kifyCrO82o66CNTYe7DixMZw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/tar-linux-x64-gnu@0.1.1': - resolution: {integrity: sha512-tmy9q2LXUB2GQ+IgUzJn3+us52leplMu96ORyFq1iHQEelGSqXt4xi5DzU07JhX3obJPqVqkybtcRS4enBfmBA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/tar-linux-x64-musl@0.1.1': - resolution: {integrity: sha512-j5ePbe6vihApl0cGPPDUVTWZbf2mF4NhxngAoG2jp7AeX3cWP2O4pjsvaOraW6QfvWEMFPeER7S0b6eBS7duvA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/tar-wasm32-wasi@0.1.1': - resolution: {integrity: sha512-se0+DlOiIRt7mcz7BeOJDoZtCrROpKLwiAOGmNgrjQ/SZS7TnOPuwm3wy9XN9WLoepttEjCEem6UP8yD5GJuQg==} - engines: {node: '>=14.0.0'} - cpu: [wasm32] - - '@napi-rs/tar-win32-arm64-msvc@0.1.1': - resolution: {integrity: sha512-FDZPi2wC7RwzvodogigLh/pJvhqCTVTUqOYuHlLkPSUbSAGiEkI55wk9RqH3y3EdJQaDuzyqC0QKz5ket2U+GA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [win32] - - '@napi-rs/tar-win32-ia32-msvc@0.1.1': - resolution: {integrity: sha512-OPR9Tou5z5M912G7Kc7gkf1ltinbOQx5dS/OeDIWHvPGOfdFDIxt0YVKhzSLRJi43+zIDp8/+cbeMD/cKXfX8w==} - engines: {node: '>= 10'} - cpu: [ia32] - os: [win32] - - '@napi-rs/tar-win32-x64-msvc@0.1.1': - resolution: {integrity: sha512-hiv5KfhrMSg8tTRC2oQXVckVg1h6ZVjwbd5aF9Esl0V3p2TaNFwwbqgnAN4Gm/PmSnHWNL/IRTHkk3cOzDWihQ==} - engines: {node: '>= 10'} - cpu: [x64] - os: [win32] - - '@napi-rs/tar@0.1.1': - resolution: {integrity: sha512-FOMhwwlvoYjHaDBxP26K3D92ltw1Y/CC4CIjgC6qXdzW4MYNwTlEyI58smCM3k+nCVJH3kpOYyH3sgbK4WZA4A==} - engines: {node: '>= 10'} - - '@napi-rs/wasm-runtime@0.2.4': - resolution: {integrity: sha512-9zESzOO5aDByvhIAsOy9TbpZ0Ur2AJbUI7UT73kcUTS2mxAMHOBaa1st/jAymNoCtvrit99kkzT1FZuXVcgfIQ==} - - '@napi-rs/wasm-tools-android-arm-eabi@0.0.2': - resolution: {integrity: sha512-/b+UU3suXjW4P0DzHRNdrnebQtFKcQf/YMeZJH+xUlKgvwli5kbmWjx8Wqqz0VETVkUTuPqJMBDIVLyc+14FGw==} - engines: {node: '>= 10'} - cpu: [arm] - os: [android] - - '@napi-rs/wasm-tools-android-arm64@0.0.2': - resolution: {integrity: sha512-j57GbDflwJdZtT8pZj5fOV4JAP+LdKN+wzsUYs+QRUoBqpWbbUANudolqfw63bkS9sD4z7fbCuz8iwtJqzxTVA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [android] - - '@napi-rs/wasm-tools-darwin-arm64@0.0.2': - resolution: {integrity: sha512-P2ChgWgVuv9GwmbxN89R84KzIImoTqXINteEixUvmkdnhyFiR+I8deNs89Yed+5w8QLC6MEfrtRqLP9YI+NoQA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [darwin] - - '@napi-rs/wasm-tools-darwin-x64@0.0.2': - resolution: {integrity: sha512-T/kQQ0gt8+wau1Z821PKVAD76QhmwVoLs2CT7Z9tTBs2pJvwSCP0C/kQiQAHcJIMi7A2E9Ab/Mez0BERy50EFA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [darwin] - - '@napi-rs/wasm-tools-freebsd-x64@0.0.2': - resolution: {integrity: sha512-GnnHu+r5sfzuxC/1J5UMF/h3BOZnHb3NQZ5hmbCfZYCKzpzRxrAJhzRunlbRN+v0x8M/49dztVTYR3s7K4ooAw==} - engines: {node: '>= 10'} - cpu: [x64] - os: [freebsd] - - '@napi-rs/wasm-tools-linux-arm64-gnu@0.0.2': - resolution: {integrity: sha512-KnZdLT0OnKb1CG2kdt3/WvM43vr9i+FEwXCvSOVC/6Tsifz7ynhMg7LAVESILd03HubzQJfg9nbRsk0bQ+IOwg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/wasm-tools-linux-arm64-musl@0.0.2': - resolution: {integrity: sha512-HkpZOID2U8P6pWqK3mqZ8bxU5xcuT3iA2fO+jrxn78h006iYgfNmdc5JaVhHnHazMmk32xKhSV4iV0VUh8UWDg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/wasm-tools-linux-x64-gnu@0.0.2': - resolution: {integrity: sha512-YksJWBCyOalB9ogtP9+/dZKP+vR6+h7BmzMXaXMT71WW/GvIsifMVgv+DY/FRSNJQupp5Y+ugjqVAOUOc/G65g==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/wasm-tools-linux-x64-musl@0.0.2': - resolution: {integrity: sha512-sPtRxPMdw05KdTcxgSPMmSXG2+PiK3vJ/l2+g9hvjnnKtvslJN2Hr7j8zgzuoKRAUFPaJVe6+D2xVh5cpdqhww==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/wasm-tools-wasm32-wasi@0.0.2': - resolution: {integrity: sha512-muRvZK7AIuo88G2AxYx3gA59rHMQgoN004saQkBvXnz3K/DVHKfTZ6TtUebss8zI3dURU6xExL8drxFWYxjEbQ==} - engines: {node: '>=14.0.0'} - cpu: [wasm32] - - '@napi-rs/wasm-tools-win32-arm64-msvc@0.0.2': - resolution: {integrity: sha512-Cn13WQ+tpFqdVwx0DIWKbsI9auFyzVZV4F5UNOUeDt6GgOL+NndgJul0Pc9bSU6fi03AylMPfF/nTCaDWO2Wgw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [win32] - - '@napi-rs/wasm-tools-win32-ia32-msvc@0.0.2': - resolution: {integrity: sha512-xsg5DkIQi82a8rcx6246Y3XC8TIqHamY+/C6sIlPLaZEuHctDkMECAw0AANwRf5vN//D2oo2oljOuoYtB1GOKw==} - engines: {node: '>= 10'} - cpu: [ia32] - os: [win32] - - '@napi-rs/wasm-tools-win32-x64-msvc@0.0.2': - resolution: {integrity: sha512-yHigltEt33eq8bappvKsIliz4MxfMPn1M+NWbIFRWN+IS1Z57mhmc1osuk+IRXrSlq0Tom0R6MYN1jpkZKz81Q==} - engines: {node: '>= 10'} - cpu: [x64] - os: [win32] - - '@napi-rs/wasm-tools@0.0.2': - resolution: {integrity: sha512-kBvDQCP5BLw2TxTENXLp3Of7vVEx0uyIye824JHE4dduzzOHVgSoOFVhVqAT3Fx/hLV445RVWfEqQbXMg4w/Mw==} - engines: {node: '>= 10'} - - '@nodelib/fs.scandir@2.1.5': - resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} - engines: {node: '>= 8'} - - '@nodelib/fs.stat@2.0.5': - resolution: {integrity: sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==} - engines: {node: '>= 8'} - - '@nodelib/fs.walk@1.2.8': - resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} - engines: {node: '>= 8'} - - '@octokit/auth-token@5.1.1': - resolution: {integrity: sha512-rh3G3wDO8J9wSjfI436JUKzHIxq8NaiL0tVeB2aXmG6p/9859aUOAjA9pmSPNGGZxfwmaJ9ozOJImuNVJdpvbA==} - engines: {node: '>= 18'} - - '@octokit/core@6.1.2': - resolution: {integrity: sha512-hEb7Ma4cGJGEUNOAVmyfdB/3WirWMg5hDuNFVejGEDFqupeOysLc2sG6HJxY2etBp5YQu5Wtxwi020jS9xlUwg==} - engines: {node: '>= 18'} - - '@octokit/endpoint@10.1.1': - resolution: {integrity: sha512-JYjh5rMOwXMJyUpj028cu0Gbp7qe/ihxfJMLc8VZBMMqSwLgOxDI1911gV4Enl1QSavAQNJcwmwBF9M0VvLh6Q==} - engines: {node: '>= 18'} - - '@octokit/graphql@8.1.1': - resolution: {integrity: sha512-ukiRmuHTi6ebQx/HFRCXKbDlOh/7xEV6QUXaE7MJEKGNAncGI/STSbOkl12qVXZrfZdpXctx5O9X1AIaebiDBg==} - engines: {node: '>= 18'} - - '@octokit/openapi-types@22.2.0': - resolution: {integrity: sha512-QBhVjcUa9W7Wwhm6DBFu6ZZ+1/t/oYxqc2tp81Pi41YNuJinbFRx8B133qVOrAaBbF7D/m0Et6f9/pZt9Rc+tg==} - - '@octokit/plugin-paginate-rest@11.3.3': - resolution: {integrity: sha512-o4WRoOJZlKqEEgj+i9CpcmnByvtzoUYC6I8PD2SA95M+BJ2x8h7oLcVOg9qcowWXBOdcTRsMZiwvM3EyLm9AfA==} - engines: {node: '>= 18'} - peerDependencies: - '@octokit/core': '>=6' - - '@octokit/plugin-request-log@5.3.0': - resolution: {integrity: sha512-FiGcyjdtYPlr03ExBk/0ysIlEFIFGJQAVoPPMxL19B24bVSEiZQnVGBunNtaAF1YnvE/EFoDpXmITtRnyCiypQ==} - engines: {node: '>= 18'} - peerDependencies: - '@octokit/core': '>=6' - - '@octokit/plugin-rest-endpoint-methods@13.2.4': - resolution: {integrity: sha512-gusyAVgTrPiuXOdfqOySMDztQHv6928PQ3E4dqVGEtOvRXAKRbJR4b1zQyniIT9waqaWk/UDaoJ2dyPr7Bk7Iw==} - engines: {node: '>= 18'} - peerDependencies: - '@octokit/core': '>=6' - - '@octokit/request-error@6.1.1': - resolution: {integrity: sha512-1mw1gqT3fR/WFvnoVpY/zUM2o/XkMs/2AszUUG9I69xn0JFLv6PGkPhNk5lbfvROs79wiS0bqiJNxfCZcRJJdg==} - engines: {node: '>= 18'} - - '@octokit/request@9.1.1': - resolution: {integrity: sha512-pyAguc0p+f+GbQho0uNetNQMmLG1e80WjkIaqqgUkihqUp0boRU6nKItXO4VWnr+nbZiLGEyy4TeKRwqaLvYgw==} - engines: {node: '>= 18'} - - '@octokit/rest@21.0.0': - resolution: {integrity: sha512-XudXXOmiIjivdjNZ+fN71NLrnDM00sxSZlhqmPR3v0dVoJwyP628tSlc12xqn8nX3N0965583RBw5GPo6r8u4Q==} - engines: {node: '>= 18'} - - '@octokit/types@13.5.0': - resolution: {integrity: sha512-HdqWTf5Z3qwDVlzCrP8UJquMwunpDiMPt5er+QjGzL4hqr/vBVY/MauQgS1xWxCDT1oMx1EULyqxncdCY/NVSQ==} - - '@rollup/pluginutils@4.2.1': - resolution: {integrity: sha512-iKnFXr7NkdZAIHiIWE+BX5ULi/ucVFYWD6TbAV+rZctiRTY2PL6tsIKhoIOaoskiWAkgu+VsbXgUVDNLHf+InQ==} - engines: {node: '>= 8.0.0'} - - '@sindresorhus/merge-streams@2.3.0': - resolution: {integrity: sha512-LtoMMhxAlorcGhmFYI+LhPgbPZCkgP6ra1YL604EeF6U98pLlQ3iWIGMdWSC+vWmPBWBNgmDBAhnAobLROJmwg==} - engines: {node: '>=18'} - - '@tybys/wasm-util@0.9.0': - resolution: {integrity: sha512-6+7nlbMVX/PVDCwaIQ8nTOPveOcFLSt8GcXdx8hD0bt39uWxYT88uXzqTd4fTvqta7oeUJqudepapKNt2DYJFw==} - - '@types/node@20.14.10': - resolution: {integrity: sha512-MdiXf+nDuMvY0gJKxyfZ7/6UFsETO7mGKF54MVD/ekJS6HdFtpZFBgrh6Pseu64XTb2MLyFPlbW6hj8HYRQNOQ==} - - '@types/stylis@4.2.6': - resolution: {integrity: sha512-4nebF2ZJGzQk0ka0O6+FZUWceyFv4vWq/0dXBMmrSeAwzOuOd/GxE5Pa64d/ndeNLG73dXoBsRzvtsVsYUv6Uw==} - - '@vercel/nft@0.26.5': - resolution: {integrity: sha512-NHxohEqad6Ra/r4lGknO52uc/GrWILXAMs1BB4401GTqww0fw1bAqzpG1XHuDO+dprg4GvsD9ZLLSsdo78p9hQ==} - engines: {node: '>=16'} - hasBin: true - - abbrev@1.1.1: - resolution: {integrity: sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==} - - acorn-import-attributes@1.9.5: - resolution: {integrity: sha512-n02Vykv5uA3eHGM/Z2dQrcD56kL8TyDb2p1+0P83PClMnC/nc+anbQRhIOWnSq4Ke/KvDPrY3C9hDtC/A3eHnQ==} - peerDependencies: - acorn: ^8 - - acorn-walk@8.3.3: - resolution: {integrity: sha512-MxXdReSRhGO7VlFe1bRG/oI7/mdLV9B9JJT0N8vZOhF7gFRR5l3M8W9G8JxmKV+JC5mGqJ0QvqfSOLsCPa4nUw==} - engines: {node: '>=0.4.0'} - - acorn@8.12.0: - resolution: {integrity: sha512-RTvkC4w+KNXrM39/lWCUaG0IbRkWdCv7W/IOW9oU6SawyxulvkQy5HQPVTKxEjczcUvapcrw3cFx/60VN/NRNw==} - engines: {node: '>=0.4.0'} - hasBin: true - - agent-base@6.0.2: - resolution: {integrity: sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==} - engines: {node: '>= 6.0.0'} - - ansi-escapes@4.3.2: - resolution: {integrity: sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==} - engines: {node: '>=8'} - - ansi-regex@5.0.1: - resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} - engines: {node: '>=8'} - - ansi-regex@6.0.1: - resolution: {integrity: sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==} - engines: {node: '>=12'} - - ansi-styles@4.3.0: - resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} - engines: {node: '>=8'} - - ansi-styles@6.2.1: - resolution: {integrity: sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==} - engines: {node: '>=12'} - - aproba@2.0.0: - resolution: {integrity: sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==} - - are-we-there-yet@2.0.0: - resolution: {integrity: sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw==} - engines: {node: '>=10'} - deprecated: This package is no longer supported. - - argparse@1.0.10: - resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==} - - argparse@2.0.1: - resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} - - array-find-index@1.0.2: - resolution: {integrity: sha512-M1HQyIXcBGtVywBt8WVdim+lrNaK7VHp99Qt5pSNziXznKHViIBbXWtfRTpEFpF/c4FdfxNAsCCwPp5phBYJtw==} - engines: {node: '>=0.10.0'} - - arrgv@1.0.2: - resolution: {integrity: sha512-a4eg4yhp7mmruZDQFqVMlxNRFGi/i1r87pt8SDHy0/I8PqSXoUTlWZRdAZo0VXgvEARcujbtTk8kiZRi1uDGRw==} - engines: {node: '>=8.0.0'} - - arrify@3.0.0: - resolution: {integrity: sha512-tLkvA81vQG/XqE2mjDkGQHoOINtMHtysSnemrmoGe6PydDPMRbVugqyk4A6V/WDWEfm3l+0d8anA9r8cv/5Jaw==} - engines: {node: '>=12'} - - async-sema@3.1.1: - resolution: {integrity: sha512-tLRNUXati5MFePdAk8dw7Qt7DpxPB60ofAgn8WRhW6a2rcimZnYBP9oxHiv0OHy+Wz7kPMG+t4LGdt31+4EmGg==} - - asynckit@0.4.0: - resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} - - ava@6.1.3: - resolution: {integrity: sha512-tkKbpF1pIiC+q09wNU9OfyTDYZa8yuWvU2up3+lFJ3lr1RmnYh2GBpPwzYUEB0wvTPIUysGjcZLNZr7STDviRA==} - engines: {node: ^18.18 || ^20.8 || ^21 || ^22} - hasBin: true - peerDependencies: - '@ava/typescript': '*' - peerDependenciesMeta: - '@ava/typescript': - optional: true - - axios@1.6.2: - resolution: {integrity: sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A==} - - balanced-match@1.0.2: - resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} - - base64-js@1.5.1: - resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==} - - before-after-hook@3.0.2: - resolution: {integrity: sha512-Nik3Sc0ncrMK4UUdXQmAnRtzmNQTAAXmXIopizwZ1W1t8QmfJj+zL4OA2I7XPTPW5z5TDqv4hRo/JzouDJnX3A==} - - bindings@1.5.0: - resolution: {integrity: sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==} - - bl@4.1.0: - resolution: {integrity: sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==} - - blueimp-md5@2.19.0: - resolution: {integrity: sha512-DRQrD6gJyy8FbiE4s+bDoXS9hiW3Vbx5uCdwvcCf3zLHL+Iv7LtGHLpr+GZV8rHG8tK766FGYBwRbu8pELTt+w==} - - brace-expansion@1.1.11: - resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} - - braces@3.0.3: - resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==} - engines: {node: '>=8'} - - buffer@5.7.1: - resolution: {integrity: sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==} - - callsites@4.1.0: - resolution: {integrity: sha512-aBMbD1Xxay75ViYezwT40aQONfr+pSXTHwNKvIXhXD6+LY3F1dLIcceoC5OZKBVHbXcysz1hL9D2w0JJIMXpUw==} - engines: {node: '>=12.20'} - - camelize@1.0.1: - resolution: {integrity: sha512-dU+Tx2fsypxTgtLoE36npi3UqcjSSMNYfkqgmoEhtZrraP5VWq0K7FkWVTYa8eMPtnU/G2txVsfdCJTn9uzpuQ==} - - cbor@9.0.2: - resolution: {integrity: sha512-JPypkxsB10s9QOWwa6zwPzqE1Md3vqpPc+cai4sAecuCsRyAtAl/pMyhPlMbT/xtPnm2dznJZYRLui57qiRhaQ==} - engines: {node: '>=16'} - - chalk@4.1.2: - resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} - engines: {node: '>=10'} - - chalk@5.3.0: - resolution: {integrity: sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==} - engines: {node: ^12.17.0 || ^14.13 || >=16.0.0} - - chardet@0.7.0: - resolution: {integrity: sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==} - - chownr@2.0.0: - resolution: {integrity: sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==} - engines: {node: '>=10'} - - chunkd@2.0.1: - resolution: {integrity: sha512-7d58XsFmOq0j6el67Ug9mHf9ELUXsQXYJBkyxhH/k+6Ke0qXRnv0kbemx+Twc6fRJ07C49lcbdgm9FL1Ei/6SQ==} - - ci-info@4.0.0: - resolution: {integrity: sha512-TdHqgGf9odd8SXNuxtUBVx8Nv+qZOejE6qyqiy5NtbYYQOeFa6zmHkxlPzmaLxWWHsU6nJmB7AETdVPi+2NBUg==} - engines: {node: '>=8'} - - ci-parallel-vars@1.0.1: - resolution: {integrity: sha512-uvzpYrpmidaoxvIQHM+rKSrigjOe9feHYbw4uOI2gdfe1C3xIlxO+kVXq83WQWNniTf8bAxVpy+cQeFQsMERKg==} - - cli-cursor@3.1.0: - resolution: {integrity: sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==} - engines: {node: '>=8'} - - cli-spinners@2.9.2: - resolution: {integrity: sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==} - engines: {node: '>=6'} - - cli-truncate@4.0.0: - resolution: {integrity: sha512-nPdaFdQ0h/GEigbPClz11D0v/ZJEwxmeVZGeMo3Z5StPtUTkA9o1lD6QwoirYiSDzbcwn2XcjwmCp68W1IS4TA==} - engines: {node: '>=18'} - - cli-width@4.1.0: - resolution: {integrity: sha512-ouuZd4/dm2Sw5Gmqy6bGyNNNe1qt9RpmxveLSO7KcgsTnU7RXfsw+/bukWGo1abgBiMAic068rclZsO4IWmmxQ==} - engines: {node: '>= 12'} - - clipanion@3.2.1: - resolution: {integrity: sha512-dYFdjLb7y1ajfxQopN05mylEpK9ZX0sO1/RfMXdfmwjlIsPkbh4p7A682x++zFPLDCo1x3p82dtljHf5cW2LKA==} - peerDependencies: - typanion: '*' - - cliui@8.0.1: - resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==} - engines: {node: '>=12'} - - clone@1.0.4: - resolution: {integrity: sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==} - engines: {node: '>=0.8'} - - code-excerpt@4.0.0: - resolution: {integrity: sha512-xxodCmBen3iy2i0WtAK8FlFNrRzjUqjRsMfho58xT/wvZU1YTM3fCnRjcy1gJPMepaRlgm/0e6w8SpWHpn3/cA==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - color-convert@2.0.1: - resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} - engines: {node: '>=7.0.0'} - - color-name@1.1.4: - resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} - - color-support@1.1.3: - resolution: {integrity: sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==} - hasBin: true - - colorette@2.0.20: - resolution: {integrity: sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==} - - combined-stream@1.0.8: - resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} - engines: {node: '>= 0.8'} - - common-path-prefix@3.0.0: - resolution: {integrity: sha512-QE33hToZseCH3jS0qN96O/bSh3kaw/h+Tq7ngyY9eWDUnTlTNUyqfqvCXioLe5Na5jFsL78ra/wuBU4iuEgd4w==} - - concat-map@0.0.1: - resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} - - concordance@5.0.4: - resolution: {integrity: sha512-OAcsnTEYu1ARJqWVGwf4zh4JDfHZEaSNlNccFmt8YjB2l/n19/PF2viLINHc57vO4FKIAFl2FWASIGZZWZ2Kxw==} - engines: {node: '>=10.18.0 <11 || >=12.14.0 <13 || >=14'} - - console-control-strings@1.1.0: - resolution: {integrity: sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==} - - convert-to-spaces@2.0.1: - resolution: {integrity: sha512-rcQ1bsQO9799wq24uE5AM2tAILy4gXGIK/njFWcVQkGNZ96edlpY+A7bjwvzjYvLDyzmG1MmMLZhpcsb+klNMQ==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - css-color-keywords@1.0.0: - resolution: {integrity: sha512-FyyrDHZKEjXDpNJYvVsV960FiqQyXc/LlYmsxl2BcdMb2WPx0OGRVgTg55rPSyLSNMqP52R9r8geSp7apN3Ofg==} - engines: {node: '>=4'} - - css-to-react-native@3.2.0: - resolution: {integrity: sha512-e8RKaLXMOFii+02mOlqwjbD00KSEKqblnpO9e++1aXS1fPQOpS1YoqdVHBqPjHNoxeF2mimzVqawm2KCbEdtHQ==} - - csstype@3.1.3: - resolution: {integrity: sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==} - - currently-unhandled@0.4.1: - resolution: {integrity: sha512-/fITjgjGU50vjQ4FH6eUoYu+iUoUKIXws2hL15JJpIR+BbTxaXQsMuuyjtNh2WqsSBS5nsaZHFsFecyw5CCAng==} - engines: {node: '>=0.10.0'} - - date-time@3.1.0: - resolution: {integrity: sha512-uqCUKXE5q1PNBXjPqvwhwJf9SwMoAHBgWJ6DcrnS5o+W2JOiIILl0JEdVD8SGujrNS02GGxgwAg2PN2zONgtjg==} - engines: {node: '>=6'} - - debug@4.3.5: - resolution: {integrity: sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg==} - engines: {node: '>=6.0'} - peerDependencies: - supports-color: '*' - peerDependenciesMeta: - supports-color: - optional: true - - defaults@1.0.4: - resolution: {integrity: sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A==} - - delayed-stream@1.0.0: - resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} - engines: {node: '>=0.4.0'} - - delegates@1.0.0: - resolution: {integrity: sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==} - - detect-libc@2.0.3: - resolution: {integrity: sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw==} - engines: {node: '>=8'} - - emittery@1.0.3: - resolution: {integrity: sha512-tJdCJitoy2lrC2ldJcqN4vkqJ00lT+tOWNT1hBJjO/3FDMJa5TTIiYGCKGkn/WfCyOzUMObeohbVTj00fhiLiA==} - engines: {node: '>=14.16'} - - emnapi@1.2.0: - resolution: {integrity: sha512-rcq+dJCcfr08I0XM/57LPRqaUokGfni/+SvhO7NaJthTTjRdohhIy0FQwyC5rR1enAsjkldQg83th8J5hURv0Q==} - peerDependencies: - node-addon-api: '>= 6.1.0' - peerDependenciesMeta: - node-addon-api: - optional: true - - emoji-regex@10.3.0: - resolution: {integrity: sha512-QpLs9D9v9kArv4lfDEgg1X/gN5XLnf/A6l9cs8SPZLRZR3ZkY9+kwIQTxm+fsSej5UMYGE8fdoaZVIBlqG0XTw==} - - emoji-regex@8.0.0: - resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} - - escalade@3.1.2: - resolution: {integrity: sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==} - engines: {node: '>=6'} - - escape-string-regexp@2.0.0: - resolution: {integrity: sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==} - engines: {node: '>=8'} - - escape-string-regexp@5.0.0: - resolution: {integrity: sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==} - engines: {node: '>=12'} - - esprima@4.0.1: - resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==} - engines: {node: '>=4'} - hasBin: true - - estree-walker@2.0.2: - resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==} - - esutils@2.0.3: - resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} - engines: {node: '>=0.10.0'} - - external-editor@3.1.0: - resolution: {integrity: sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==} - engines: {node: '>=4'} - - fast-diff@1.3.0: - resolution: {integrity: sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==} - - fast-glob@3.3.2: - resolution: {integrity: sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==} - engines: {node: '>=8.6.0'} - - fastq@1.17.1: - resolution: {integrity: sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==} - - figures@6.1.0: - resolution: {integrity: sha512-d+l3qxjSesT4V7v2fh+QnmFnUWv9lSpjarhShNTgBOfA0ttejbQUAlHLitbjkoRiDulW0OPoQPYIGhIC8ohejg==} - engines: {node: '>=18'} - - file-uri-to-path@1.0.0: - resolution: {integrity: sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==} - - fill-range@7.1.1: - resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==} - engines: {node: '>=8'} - - find-up-simple@1.0.0: - resolution: {integrity: sha512-q7Us7kcjj2VMePAa02hDAF6d+MzsdsAWEwYyOpwUtlerRBkOEPBCRZrAV4XfcSN8fHAgaD0hP7miwoay6DCprw==} - engines: {node: '>=18'} - - follow-redirects@1.15.6: - resolution: {integrity: sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==} - engines: {node: '>=4.0'} - peerDependencies: - debug: '*' - peerDependenciesMeta: - debug: - optional: true - - form-data@4.0.0: - resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==} - engines: {node: '>= 6'} - - fs-minipass@2.1.0: - resolution: {integrity: sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==} - engines: {node: '>= 8'} - - fs.realpath@1.0.0: - resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} - - gauge@3.0.2: - resolution: {integrity: sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q==} - engines: {node: '>=10'} - deprecated: This package is no longer supported. - - get-caller-file@2.0.5: - resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} - engines: {node: 6.* || 8.* || >= 10.*} - - get-east-asian-width@1.2.0: - resolution: {integrity: sha512-2nk+7SIVb14QrgXFHcm84tD4bKQz0RxPuMT8Ag5KPOq7J5fEmAg0UbXdTOSHqNuHSU28k55qnceesxXRZGzKWA==} - engines: {node: '>=18'} - - glob-parent@5.1.2: - resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} - engines: {node: '>= 6'} - - glob@7.2.3: - resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} - deprecated: Glob versions prior to v9 are no longer supported - - globby@14.0.1: - resolution: {integrity: sha512-jOMLD2Z7MAhyG8aJpNOpmziMOP4rPLcc95oQPKXBazW82z+CEgPFBQvEpRUa1KeIMUJo4Wsm+q6uzO/Q/4BksQ==} - engines: {node: '>=18'} - - graceful-fs@4.2.11: - resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} - - has-flag@4.0.0: - resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} - engines: {node: '>=8'} - - has-unicode@2.0.1: - resolution: {integrity: sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==} - - https-proxy-agent@5.0.1: - resolution: {integrity: sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==} - engines: {node: '>= 6'} - - iconv-lite@0.4.24: - resolution: {integrity: sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==} - engines: {node: '>=0.10.0'} - - ieee754@1.2.1: - resolution: {integrity: sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==} - - ignore-by-default@2.1.0: - resolution: {integrity: sha512-yiWd4GVmJp0Q6ghmM2B/V3oZGRmjrKLXvHR3TE1nfoXsmoggllfZUQe74EN0fJdPFZu2NIvNdrMMLm3OsV7Ohw==} - engines: {node: '>=10 <11 || >=12 <13 || >=14'} - - ignore@5.3.1: - resolution: {integrity: sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==} - engines: {node: '>= 4'} - - imurmurhash@0.1.4: - resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} - engines: {node: '>=0.8.19'} - - indent-string@5.0.0: - resolution: {integrity: sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==} - engines: {node: '>=12'} - - inflight@1.0.6: - resolution: {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. - - inherits@2.0.4: - resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} - - inquirer@9.3.5: - resolution: {integrity: sha512-SVRCRovA7KaT6nqWB2mCNpTvU4cuZ0hOXo5KPyiyOcNNUIZwq/JKtvXuDJNaxfuJKabBYRu1ecHze0YEwDYoRQ==} - engines: {node: '>=18'} - - irregular-plurals@3.5.0: - resolution: {integrity: sha512-1ANGLZ+Nkv1ptFb2pa8oG8Lem4krflKuX/gINiHJHjJUKaJHk/SXk5x6K3J+39/p0h1RQ2saROclJJ+QLvETCQ==} - engines: {node: '>=8'} - - is-extglob@2.1.1: - resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} - engines: {node: '>=0.10.0'} - - is-fullwidth-code-point@3.0.0: - resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} - engines: {node: '>=8'} - - is-fullwidth-code-point@4.0.0: - resolution: {integrity: sha512-O4L094N2/dZ7xqVdrXhh9r1KODPJpFms8B5sGdJLPy664AgvXsreZUyCQQNItZRDlYug4xStLjNp/sz3HvBowQ==} - engines: {node: '>=12'} - - is-glob@4.0.3: - resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} - engines: {node: '>=0.10.0'} - - is-interactive@1.0.0: - resolution: {integrity: sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w==} - engines: {node: '>=8'} - - is-number@7.0.0: - resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} - engines: {node: '>=0.12.0'} - - is-plain-object@5.0.0: - resolution: {integrity: sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==} - engines: {node: '>=0.10.0'} - - is-promise@4.0.0: - resolution: {integrity: sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==} - - is-unicode-supported@0.1.0: - resolution: {integrity: sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==} - engines: {node: '>=10'} - - is-unicode-supported@2.0.0: - resolution: {integrity: sha512-FRdAyx5lusK1iHG0TWpVtk9+1i+GjrzRffhDg4ovQ7mcidMQ6mj+MhKPmvh7Xwyv5gIS06ns49CA7Sqg7lC22Q==} - engines: {node: '>=18'} - - js-string-escape@1.0.1: - resolution: {integrity: sha512-Smw4xcfIQ5LVjAOuJCvN/zIodzA/BBSsluuoSykP+lUvScIi4U6RJLfwHet5cxFnCswUjISV8oAXaqaJDY3chg==} - engines: {node: '>= 0.8'} - - js-tokens@4.0.0: - resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} - - js-yaml@3.14.1: - resolution: {integrity: sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==} - hasBin: true - - js-yaml@4.1.0: - resolution: {integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==} - hasBin: true - - load-json-file@7.0.1: - resolution: {integrity: sha512-Gnxj3ev3mB5TkVBGad0JM6dmLiQL+o0t23JPBZ9sd+yvSLk05mFoqKBw5N8gbbkU4TNXyqCgIrl/VM17OgUIgQ==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - lodash-es@4.17.21: - resolution: {integrity: sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==} - - lodash@4.17.21: - resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} - - log-symbols@4.1.0: - resolution: {integrity: sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==} - engines: {node: '>=10'} - - loose-envify@1.4.0: - resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==} - hasBin: true - - make-dir@3.1.0: - resolution: {integrity: sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==} - engines: {node: '>=8'} - - matcher@5.0.0: - resolution: {integrity: sha512-s2EMBOWtXFc8dgqvoAzKJXxNHibcdJMV0gwqKUaw9E2JBJuGUK7DrNKrA6g/i+v72TT16+6sVm5mS3thaMLQUw==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - md5-hex@3.0.1: - resolution: {integrity: sha512-BUiRtTtV39LIJwinWBjqVsU9xhdnz7/i889V859IBFpuqGAj6LuOvHv5XLbgZ2R7ptJoJaEcxkv88/h25T7Ciw==} - engines: {node: '>=8'} - - memoize@10.0.0: - resolution: {integrity: sha512-H6cBLgsi6vMWOcCpvVCdFFnl3kerEXbrYh9q+lY6VXvQSmM6CkmV08VOwT+WE2tzIEqRPFfAq3fm4v/UIW6mSA==} - engines: {node: '>=18'} - - merge2@1.4.1: - resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} - engines: {node: '>= 8'} - - micromatch@4.0.7: - resolution: {integrity: sha512-LPP/3KorzCwBxfeUuZmaR6bG2kdeHSbe0P2tY3FLRU4vYrjYz5hI4QZwV0njUx3jeuKe67YukQ1LSPZBKDqO/Q==} - engines: {node: '>=8.6'} - - mime-db@1.52.0: - resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} - engines: {node: '>= 0.6'} - - mime-types@2.1.35: - resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} - engines: {node: '>= 0.6'} - - mimic-fn@2.1.0: - resolution: {integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==} - engines: {node: '>=6'} - - mimic-function@5.0.1: - resolution: {integrity: sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==} - engines: {node: '>=18'} - - minimatch@3.1.2: - resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} - - minipass@3.3.6: - resolution: {integrity: sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==} - engines: {node: '>=8'} - - minipass@5.0.0: - resolution: {integrity: sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==} - engines: {node: '>=8'} - - minizlib@2.1.2: - resolution: {integrity: sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==} - engines: {node: '>= 8'} - - mkdirp@1.0.4: - resolution: {integrity: sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==} - engines: {node: '>=10'} - hasBin: true - - ms@2.1.2: - resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} - - ms@2.1.3: - resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} - - mute-stream@1.0.0: - resolution: {integrity: sha512-avsJQhyd+680gKXyG/sQc0nXaC6rBkPOfyHYcFb9+hdkqQkR9bdnkJ0AMZhke0oesPqIO+mFFJ+IdBc7mst4IA==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - - nanoid@3.3.7: - resolution: {integrity: sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==} - engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} - hasBin: true - - node-fetch@2.7.0: - resolution: {integrity: sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==} - engines: {node: 4.x || >=6.0.0} - peerDependencies: - encoding: ^0.1.0 - peerDependenciesMeta: - encoding: - optional: true - - node-gyp-build@4.8.1: - resolution: {integrity: sha512-OSs33Z9yWr148JZcbZd5WiAXhh/n9z8TxQcdMhIOlpN9AhWpLfvVFO73+m77bBABQMaY9XSvIa+qk0jlI7Gcaw==} - hasBin: true - - nofilter@3.1.0: - resolution: {integrity: sha512-l2NNj07e9afPnhAhvgVrCD/oy2Ai1yfLpuo3EpiO1jFTsB4sFz6oIfAfSZyQzVpkZQ9xS8ZS5g1jCBgq4Hwo0g==} - engines: {node: '>=12.19'} - - nopt@5.0.0: - resolution: {integrity: sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==} - engines: {node: '>=6'} - hasBin: true - - npmlog@5.0.1: - resolution: {integrity: sha512-AqZtDUWOMKs1G/8lwylVjrdYgqA4d9nu8hc+0gzRxlDb1I10+FHBGMXs6aiQHFdCUUlqH99MUMuLfzWDNDtfxw==} - deprecated: This package is no longer supported. - - object-assign@4.1.1: - resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} - engines: {node: '>=0.10.0'} - - once@1.4.0: - resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} - - onetime@5.1.2: - resolution: {integrity: sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==} - engines: {node: '>=6'} - - ora@5.4.1: - resolution: {integrity: sha512-5b6Y85tPxZZ7QytO+BQzysW31HJku27cRIlkbAXaNx+BdcVi+LlRFmVXzeF6a7JCwJpyw5c4b+YSVImQIrBpuQ==} - engines: {node: '>=10'} - - os-tmpdir@1.0.2: - resolution: {integrity: sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==} - engines: {node: '>=0.10.0'} - - p-map@7.0.2: - resolution: {integrity: sha512-z4cYYMMdKHzw4O5UkWJImbZynVIo0lSGTXc7bzB1e/rrDqkgGUNysK/o4bTr+0+xKvvLoTyGqYC4Fgljy9qe1Q==} - engines: {node: '>=18'} - - package-config@5.0.0: - resolution: {integrity: sha512-GYTTew2slBcYdvRHqjhwaaydVMvn/qrGC323+nKclYioNSLTDUM/lGgtGTgyHVtYcozb+XkE8CNhwcraOmZ9Mg==} - engines: {node: '>=18'} - - parse-ms@4.0.0: - resolution: {integrity: sha512-TXfryirbmq34y8QBwgqCVLi+8oA3oWx2eAnSn62ITyEhEYaWRlVZ2DvMM9eZbMs/RfxPu/PK/aBLyGj4IrqMHw==} - engines: {node: '>=18'} - - path-is-absolute@1.0.1: - resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==} - engines: {node: '>=0.10.0'} - - path-type@5.0.0: - resolution: {integrity: sha512-5HviZNaZcfqP95rwpv+1HDgUamezbqdSYTyzjTvwtJSnIH+3vnbmWsItli8OFEndS984VT55M3jduxZbX351gg==} - engines: {node: '>=12'} - - picocolors@1.0.1: - resolution: {integrity: sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==} - - picomatch@2.3.1: - resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} - engines: {node: '>=8.6'} - - picomatch@3.0.1: - resolution: {integrity: sha512-I3EurrIQMlRc9IaAZnqRR044Phh2DXY+55o7uJ0V+hYZAcQYSuFWsc9q5PvyDHUSCe1Qxn/iBz+78s86zWnGag==} - engines: {node: '>=10'} - - plur@5.1.0: - resolution: {integrity: sha512-VP/72JeXqak2KiOzjgKtQen5y3IZHn+9GOuLDafPv0eXa47xq0At93XahYBs26MsifCQ4enGKwbjBTKgb9QJXg==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - postcss-value-parser@4.2.0: - resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==} - - postcss@8.4.33: - resolution: {integrity: sha512-Kkpbhhdjw2qQs2O2DGX+8m5OVqEcbB9HRBvuYM9pgrjEFUg30A9LmXNlTAUj4S9kgtGyrMbTzVjH7E+s5Re2yg==} - engines: {node: ^10 || ^12 || >=14} - - pretty-ms@9.0.0: - resolution: {integrity: sha512-E9e9HJ9R9NasGOgPaPE8VMeiPKAyWR5jcFpNnwIejslIhWqdqOrb2wShBsncMPUb+BcCd2OPYfh7p2W6oemTng==} - engines: {node: '>=18'} - - proxy-from-env@1.1.0: - resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==} - - queue-microtask@1.2.3: - resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} - - react-dom@18.3.1: - resolution: {integrity: sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==} - peerDependencies: - react: ^18.3.1 - - react@18.3.1: - resolution: {integrity: sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==} - engines: {node: '>=0.10.0'} - - readable-stream@3.6.2: - resolution: {integrity: sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==} - engines: {node: '>= 6'} - - require-directory@2.1.1: - resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} - engines: {node: '>=0.10.0'} - - resolve-cwd@3.0.0: - resolution: {integrity: sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==} - engines: {node: '>=8'} - - resolve-from@5.0.0: - resolution: {integrity: sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==} - engines: {node: '>=8'} - - restore-cursor@3.1.0: - resolution: {integrity: sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==} - engines: {node: '>=8'} - - reusify@1.0.4: - resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==} - engines: {iojs: '>=1.0.0', node: '>=0.10.0'} - - rimraf@3.0.2: - resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==} - deprecated: Rimraf versions prior to v4 are no longer supported - hasBin: true - - run-async@3.0.0: - resolution: {integrity: sha512-540WwVDOMxA6dN6We19EcT9sc3hkXPw5mzRNGM3FkdN/vtE9NFvj5lFAPNwUDmJjXidm3v7TC1cTE7t17Ulm1Q==} - engines: {node: '>=0.12.0'} - - run-parallel@1.2.0: - resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} - - rxjs@7.8.1: - resolution: {integrity: sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==} - - safe-buffer@5.2.1: - resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} - - safer-buffer@2.1.2: - resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} - - scheduler@0.23.2: - resolution: {integrity: sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ==} - - semver@6.3.1: - resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} - hasBin: true - - semver@7.6.2: - resolution: {integrity: sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==} - engines: {node: '>=10'} - hasBin: true - - serialize-error@7.0.1: - resolution: {integrity: sha512-8I8TjW5KMOKsZQTvoxjuSIa7foAwPWGOts+6o7sgjz41/qMD9VQHEDxi6PBvK2l0MXUmqZyNpUK+T2tQaaElvw==} - engines: {node: '>=10'} - - set-blocking@2.0.0: - resolution: {integrity: sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==} - - shallowequal@1.1.0: - resolution: {integrity: sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ==} - - signal-exit@3.0.7: - resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} - - signal-exit@4.1.0: - resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} - engines: {node: '>=14'} - - slash@5.1.0: - resolution: {integrity: sha512-ZA6oR3T/pEyuqwMgAKT0/hAv8oAXckzbkmR0UkUosQ+Mc4RxGoJkRmwHgHufaenlyAgE1Mxgpdcrf75y6XcnDg==} - engines: {node: '>=14.16'} - - slice-ansi@5.0.0: - resolution: {integrity: sha512-FC+lgizVPfie0kkhqUScwRu1O/lF6NOgJmlCgK+/LYxDCTk8sGelYaHDhFcDN+Sn3Cv+3VSa4Byeo+IMCzpMgQ==} - engines: {node: '>=12'} - - source-map-js@1.2.0: - resolution: {integrity: sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==} - engines: {node: '>=0.10.0'} - - sprintf-js@1.0.3: - resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==} - - stack-utils@2.0.6: - resolution: {integrity: sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==} - engines: {node: '>=10'} - - string-width@4.2.3: - resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} - engines: {node: '>=8'} - - string-width@7.1.0: - resolution: {integrity: sha512-SEIJCWiX7Kg4c129n48aDRwLbFb2LJmXXFrWBG4NGaRtMQ3myKPKbwrD1BKqQn74oCoNMBVrfDEr5M9YxCsrkw==} - engines: {node: '>=18'} - - string_decoder@1.3.0: - resolution: {integrity: sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==} - - strip-ansi@6.0.1: - resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} - engines: {node: '>=8'} - - strip-ansi@7.1.0: - resolution: {integrity: sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==} - engines: {node: '>=12'} - - styled-components@6.1.1: - resolution: {integrity: sha512-cpZZP5RrKRIClBW5Eby4JM1wElLVP4NQrJbJ0h10TidTyJf4SIIwa3zLXOoPb4gJi8MsJ8mjq5mu2IrEhZIAcQ==} - engines: {node: '>= 16'} - peerDependencies: - react: '>= 16.8.0' - react-dom: '>= 16.8.0' - - stylis@4.3.2: - resolution: {integrity: sha512-bhtUjWd/z6ltJiQwg0dUfxEJ+W+jdqQd8TbWLWyeIJHlnsqmGLRFFd8e5mA0AZi/zx90smXRlN66YMTcaSFifg==} - - supertap@3.0.1: - resolution: {integrity: sha512-u1ZpIBCawJnO+0QePsEiOknOfCRq0yERxiAchT0i4li0WHNUJbf0evXXSXOcCAR4M8iMDoajXYmstm/qO81Isw==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - supports-color@7.2.0: - resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} - engines: {node: '>=8'} - - tar@6.2.1: - resolution: {integrity: sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==} - engines: {node: '>=10'} - - temp-dir@3.0.0: - resolution: {integrity: sha512-nHc6S/bwIilKHNRgK/3jlhDoIHcp45YgyiwcAk46Tr0LfEqGBVpmiAyuiuxeVE44m3mXnEeVhaipLOEWmH+Njw==} - engines: {node: '>=14.16'} - - time-zone@1.0.0: - resolution: {integrity: sha512-TIsDdtKo6+XrPtiTm1ssmMngN1sAhyKnTO2kunQWqNPWIVvCm15Wmw4SWInwTVgJ5u/Tr04+8Ei9TNcw4x4ONA==} - engines: {node: '>=4'} - - tmp@0.0.33: - resolution: {integrity: sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==} - engines: {node: '>=0.6.0'} - - to-regex-range@5.0.1: - resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} - engines: {node: '>=8.0'} - - toml@3.0.0: - resolution: {integrity: sha512-y/mWCZinnvxjTKYhJ+pYxwD0mRLVvOtdS2Awbgxln6iEnt4rk0yBxeSBHkGJcPucRiG0e55mwWp+g/05rsrd6w==} - - tr46@0.0.3: - resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==} - - tslib@2.6.3: - resolution: {integrity: sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ==} - - typanion@3.14.0: - resolution: {integrity: sha512-ZW/lVMRabETuYCd9O9ZvMhAh8GslSqaUjxmK/JLPCh6l73CvLBiuXswj/+7LdnWOgYsQ130FqLzFz5aGT4I3Ug==} - - type-fest@0.13.1: - resolution: {integrity: sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==} - engines: {node: '>=10'} - - type-fest@0.21.3: - resolution: {integrity: sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==} - engines: {node: '>=10'} - - typescript@5.5.3: - resolution: {integrity: sha512-/hreyEujaB0w76zKo6717l3L0o/qEUtRgdvUBvlkhoWeOVMjMuHNHk0BRBzikzuGDqNmPQbg5ifMEqsHLiIUcQ==} - engines: {node: '>=14.17'} - hasBin: true - - undici-types@5.26.5: - resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==} - - unicorn-magic@0.1.0: - resolution: {integrity: sha512-lRfVq8fE8gz6QMBuDM6a+LO3IAzTi05H6gCVaUpir2E1Rwpo4ZUog45KpNXKC/Mn3Yb9UDuHumeFTo9iV/D9FQ==} - engines: {node: '>=18'} - - universal-user-agent@7.0.2: - resolution: {integrity: sha512-0JCqzSKnStlRRQfCdowvqy3cy0Dvtlb8xecj/H8JFZuCze4rwjPZQOgvFvn0Ws/usCHQFGpyr+pB9adaGwXn4Q==} - - util-deprecate@1.0.2: - resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} - - wasm-sjlj@1.0.5: - resolution: {integrity: sha512-Z/MHJeOkAvJJVWnGX3/YZGYldGaawZbYHX4ldYG9kLhcdB8H31F5x66M7Zc4BP/7pg0aLsusQj1629m2B3Rilg==} - - wcwidth@1.0.1: - resolution: {integrity: sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==} - - webidl-conversions@3.0.1: - resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==} - - well-known-symbols@2.0.0: - resolution: {integrity: sha512-ZMjC3ho+KXo0BfJb7JgtQ5IBuvnShdlACNkKkdsqBmYw3bPAaJfPeYUo6tLUaT5tG/Gkh7xkpBhKRQ9e7pyg9Q==} - engines: {node: '>=6'} - - whatwg-url@5.0.0: - resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==} - - wide-align@1.1.5: - resolution: {integrity: sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==} - - wrap-ansi@6.2.0: - resolution: {integrity: sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==} - engines: {node: '>=8'} - - wrap-ansi@7.0.0: - resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==} - engines: {node: '>=10'} - - wrappy@1.0.2: - resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} - - write-file-atomic@5.0.1: - resolution: {integrity: sha512-+QU2zd6OTD8XWIJCbffaiQeH9U73qIqafo1x6V1snCWYGJf6cVE0cDR4D8xRzcEnfI21IFrUPzPGtcPf8AC+Rw==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - - y18n@5.0.8: - resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==} - engines: {node: '>=10'} - - yallist@4.0.0: - resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==} - - yargs-parser@21.1.1: - resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} - engines: {node: '>=12'} - - yargs@17.7.2: - resolution: {integrity: sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==} - engines: {node: '>=12'} - - yoctocolors-cjs@2.1.2: - resolution: {integrity: sha512-cYVsTjKl8b+FrnidjibDWskAv7UKOfcwaVZdp/it9n1s9fU3IkgDbhdIRKCW4JDsAlECJY0ytoVPT3sK6kideA==} - engines: {node: '>=18'} - -snapshots: - - '@emnapi/core@1.2.0': - dependencies: - '@emnapi/wasi-threads': 1.0.1 - tslib: 2.6.3 - - '@emnapi/runtime@1.2.0': - dependencies: - tslib: 2.6.3 - - '@emnapi/wasi-threads@1.0.1': - dependencies: - tslib: 2.6.3 - - '@emotion/is-prop-valid@1.2.2': - dependencies: - '@emotion/memoize': 0.8.1 - - '@emotion/memoize@0.8.1': {} - - '@emotion/unitless@0.8.1': {} - - '@inquirer/figures@1.0.3': {} - - '@mapbox/node-pre-gyp@1.0.11': - dependencies: - detect-libc: 2.0.3 - https-proxy-agent: 5.0.1 - make-dir: 3.1.0 - node-fetch: 2.7.0 - nopt: 5.0.0 - npmlog: 5.0.1 - rimraf: 3.0.2 - semver: 7.6.2 - tar: 6.2.1 - transitivePeerDependencies: - - encoding - - supports-color - - '@napi-rs/cli@3.0.0-alpha.56(@emnapi/runtime@1.2.0)(emnapi@1.2.0)': - dependencies: - '@napi-rs/cross-toolchain': 0.0.16 - '@napi-rs/wasm-tools': 0.0.2 - '@octokit/rest': 21.0.0 - clipanion: 3.2.1(typanion@3.14.0) - colorette: 2.0.20 - debug: 4.3.5 - inquirer: 9.3.5 - js-yaml: 4.1.0 - lodash-es: 4.17.21 - semver: 7.6.2 - toml: 3.0.0 - typanion: 3.14.0 - wasm-sjlj: 1.0.5 - optionalDependencies: - '@emnapi/runtime': 1.2.0 - emnapi: 1.2.0 - transitivePeerDependencies: - - '@napi-rs/cross-toolchain-arm64-target-aarch64' - - '@napi-rs/cross-toolchain-arm64-target-armv7' - - '@napi-rs/cross-toolchain-arm64-target-x86_64' - - '@napi-rs/cross-toolchain-x64-target-aarch64' - - '@napi-rs/cross-toolchain-x64-target-armv7' - - '@napi-rs/cross-toolchain-x64-target-x86_64' - - supports-color - - '@napi-rs/cross-toolchain@0.0.16': - dependencies: - '@napi-rs/lzma': 1.3.1 - '@napi-rs/tar': 0.1.1 - debug: 4.3.5 - transitivePeerDependencies: - - supports-color - - '@napi-rs/lzma-android-arm-eabi@1.3.1': - optional: true - - '@napi-rs/lzma-android-arm64@1.3.1': - optional: true - - '@napi-rs/lzma-darwin-arm64@1.3.1': - optional: true - - '@napi-rs/lzma-darwin-x64@1.3.1': - optional: true - - '@napi-rs/lzma-freebsd-x64@1.3.1': - optional: true - - '@napi-rs/lzma-linux-arm-gnueabihf@1.3.1': - optional: true - - '@napi-rs/lzma-linux-arm64-gnu@1.3.1': - optional: true - - '@napi-rs/lzma-linux-arm64-musl@1.3.1': - optional: true - - '@napi-rs/lzma-linux-x64-gnu@1.3.1': - optional: true - - '@napi-rs/lzma-linux-x64-musl@1.3.1': - optional: true - - '@napi-rs/lzma-wasm32-wasi@1.3.1': - dependencies: - '@napi-rs/wasm-runtime': 0.2.4 - optional: true - - '@napi-rs/lzma-win32-arm64-msvc@1.3.1': - optional: true - - '@napi-rs/lzma-win32-ia32-msvc@1.3.1': - optional: true - - '@napi-rs/lzma-win32-x64-msvc@1.3.1': - optional: true - - '@napi-rs/lzma@1.3.1': - optionalDependencies: - '@napi-rs/lzma-android-arm-eabi': 1.3.1 - '@napi-rs/lzma-android-arm64': 1.3.1 - '@napi-rs/lzma-darwin-arm64': 1.3.1 - '@napi-rs/lzma-darwin-x64': 1.3.1 - '@napi-rs/lzma-freebsd-x64': 1.3.1 - '@napi-rs/lzma-linux-arm-gnueabihf': 1.3.1 - '@napi-rs/lzma-linux-arm64-gnu': 1.3.1 - '@napi-rs/lzma-linux-arm64-musl': 1.3.1 - '@napi-rs/lzma-linux-x64-gnu': 1.3.1 - '@napi-rs/lzma-linux-x64-musl': 1.3.1 - '@napi-rs/lzma-wasm32-wasi': 1.3.1 - '@napi-rs/lzma-win32-arm64-msvc': 1.3.1 - '@napi-rs/lzma-win32-ia32-msvc': 1.3.1 - '@napi-rs/lzma-win32-x64-msvc': 1.3.1 - - '@napi-rs/tar-android-arm-eabi@0.1.1': - optional: true - - '@napi-rs/tar-android-arm64@0.1.1': - optional: true - - '@napi-rs/tar-darwin-arm64@0.1.1': - optional: true - - '@napi-rs/tar-darwin-x64@0.1.1': - optional: true - - '@napi-rs/tar-freebsd-x64@0.1.1': - optional: true - - '@napi-rs/tar-linux-arm-gnueabihf@0.1.1': - optional: true - - '@napi-rs/tar-linux-arm64-gnu@0.1.1': - optional: true - - '@napi-rs/tar-linux-arm64-musl@0.1.1': - optional: true - - '@napi-rs/tar-linux-x64-gnu@0.1.1': - optional: true - - '@napi-rs/tar-linux-x64-musl@0.1.1': - optional: true - - '@napi-rs/tar-wasm32-wasi@0.1.1': - dependencies: - '@napi-rs/wasm-runtime': 0.2.4 - optional: true - - '@napi-rs/tar-win32-arm64-msvc@0.1.1': - optional: true - - '@napi-rs/tar-win32-ia32-msvc@0.1.1': - optional: true - - '@napi-rs/tar-win32-x64-msvc@0.1.1': - optional: true - - '@napi-rs/tar@0.1.1': - optionalDependencies: - '@napi-rs/tar-android-arm-eabi': 0.1.1 - '@napi-rs/tar-android-arm64': 0.1.1 - '@napi-rs/tar-darwin-arm64': 0.1.1 - '@napi-rs/tar-darwin-x64': 0.1.1 - '@napi-rs/tar-freebsd-x64': 0.1.1 - '@napi-rs/tar-linux-arm-gnueabihf': 0.1.1 - '@napi-rs/tar-linux-arm64-gnu': 0.1.1 - '@napi-rs/tar-linux-arm64-musl': 0.1.1 - '@napi-rs/tar-linux-x64-gnu': 0.1.1 - '@napi-rs/tar-linux-x64-musl': 0.1.1 - '@napi-rs/tar-wasm32-wasi': 0.1.1 - '@napi-rs/tar-win32-arm64-msvc': 0.1.1 - '@napi-rs/tar-win32-ia32-msvc': 0.1.1 - '@napi-rs/tar-win32-x64-msvc': 0.1.1 - - '@napi-rs/wasm-runtime@0.2.4': - dependencies: - '@emnapi/core': 1.2.0 - '@emnapi/runtime': 1.2.0 - '@tybys/wasm-util': 0.9.0 - - '@napi-rs/wasm-tools-android-arm-eabi@0.0.2': - optional: true - - '@napi-rs/wasm-tools-android-arm64@0.0.2': - optional: true - - '@napi-rs/wasm-tools-darwin-arm64@0.0.2': - optional: true - - '@napi-rs/wasm-tools-darwin-x64@0.0.2': - optional: true - - '@napi-rs/wasm-tools-freebsd-x64@0.0.2': - optional: true - - '@napi-rs/wasm-tools-linux-arm64-gnu@0.0.2': - optional: true - - '@napi-rs/wasm-tools-linux-arm64-musl@0.0.2': - optional: true - - '@napi-rs/wasm-tools-linux-x64-gnu@0.0.2': - optional: true - - '@napi-rs/wasm-tools-linux-x64-musl@0.0.2': - optional: true - - '@napi-rs/wasm-tools-wasm32-wasi@0.0.2': - dependencies: - '@napi-rs/wasm-runtime': 0.2.4 - optional: true - - '@napi-rs/wasm-tools-win32-arm64-msvc@0.0.2': - optional: true - - '@napi-rs/wasm-tools-win32-ia32-msvc@0.0.2': - optional: true - - '@napi-rs/wasm-tools-win32-x64-msvc@0.0.2': - optional: true - - '@napi-rs/wasm-tools@0.0.2': - optionalDependencies: - '@napi-rs/wasm-tools-android-arm-eabi': 0.0.2 - '@napi-rs/wasm-tools-android-arm64': 0.0.2 - '@napi-rs/wasm-tools-darwin-arm64': 0.0.2 - '@napi-rs/wasm-tools-darwin-x64': 0.0.2 - '@napi-rs/wasm-tools-freebsd-x64': 0.0.2 - '@napi-rs/wasm-tools-linux-arm64-gnu': 0.0.2 - '@napi-rs/wasm-tools-linux-arm64-musl': 0.0.2 - '@napi-rs/wasm-tools-linux-x64-gnu': 0.0.2 - '@napi-rs/wasm-tools-linux-x64-musl': 0.0.2 - '@napi-rs/wasm-tools-wasm32-wasi': 0.0.2 - '@napi-rs/wasm-tools-win32-arm64-msvc': 0.0.2 - '@napi-rs/wasm-tools-win32-ia32-msvc': 0.0.2 - '@napi-rs/wasm-tools-win32-x64-msvc': 0.0.2 - - '@nodelib/fs.scandir@2.1.5': - dependencies: - '@nodelib/fs.stat': 2.0.5 - run-parallel: 1.2.0 - - '@nodelib/fs.stat@2.0.5': {} - - '@nodelib/fs.walk@1.2.8': - dependencies: - '@nodelib/fs.scandir': 2.1.5 - fastq: 1.17.1 - - '@octokit/auth-token@5.1.1': {} - - '@octokit/core@6.1.2': - dependencies: - '@octokit/auth-token': 5.1.1 - '@octokit/graphql': 8.1.1 - '@octokit/request': 9.1.1 - '@octokit/request-error': 6.1.1 - '@octokit/types': 13.5.0 - before-after-hook: 3.0.2 - universal-user-agent: 7.0.2 - - '@octokit/endpoint@10.1.1': - dependencies: - '@octokit/types': 13.5.0 - universal-user-agent: 7.0.2 - - '@octokit/graphql@8.1.1': - dependencies: - '@octokit/request': 9.1.1 - '@octokit/types': 13.5.0 - universal-user-agent: 7.0.2 - - '@octokit/openapi-types@22.2.0': {} - - '@octokit/plugin-paginate-rest@11.3.3(@octokit/core@6.1.2)': - dependencies: - '@octokit/core': 6.1.2 - '@octokit/types': 13.5.0 - - '@octokit/plugin-request-log@5.3.0(@octokit/core@6.1.2)': - dependencies: - '@octokit/core': 6.1.2 - - '@octokit/plugin-rest-endpoint-methods@13.2.4(@octokit/core@6.1.2)': - dependencies: - '@octokit/core': 6.1.2 - '@octokit/types': 13.5.0 - - '@octokit/request-error@6.1.1': - dependencies: - '@octokit/types': 13.5.0 - - '@octokit/request@9.1.1': - dependencies: - '@octokit/endpoint': 10.1.1 - '@octokit/request-error': 6.1.1 - '@octokit/types': 13.5.0 - universal-user-agent: 7.0.2 - - '@octokit/rest@21.0.0': - dependencies: - '@octokit/core': 6.1.2 - '@octokit/plugin-paginate-rest': 11.3.3(@octokit/core@6.1.2) - '@octokit/plugin-request-log': 5.3.0(@octokit/core@6.1.2) - '@octokit/plugin-rest-endpoint-methods': 13.2.4(@octokit/core@6.1.2) - - '@octokit/types@13.5.0': - dependencies: - '@octokit/openapi-types': 22.2.0 - - '@rollup/pluginutils@4.2.1': - dependencies: - estree-walker: 2.0.2 - picomatch: 2.3.1 - - '@sindresorhus/merge-streams@2.3.0': {} - - '@tybys/wasm-util@0.9.0': - dependencies: - tslib: 2.6.3 - - '@types/node@20.14.10': - dependencies: - undici-types: 5.26.5 - - '@types/stylis@4.2.6': {} - - '@vercel/nft@0.26.5': - dependencies: - '@mapbox/node-pre-gyp': 1.0.11 - '@rollup/pluginutils': 4.2.1 - acorn: 8.12.0 - acorn-import-attributes: 1.9.5(acorn@8.12.0) - async-sema: 3.1.1 - bindings: 1.5.0 - estree-walker: 2.0.2 - glob: 7.2.3 - graceful-fs: 4.2.11 - micromatch: 4.0.7 - node-gyp-build: 4.8.1 - resolve-from: 5.0.0 - transitivePeerDependencies: - - encoding - - supports-color - - abbrev@1.1.1: {} - - acorn-import-attributes@1.9.5(acorn@8.12.0): - dependencies: - acorn: 8.12.0 - - acorn-walk@8.3.3: - dependencies: - acorn: 8.12.0 - - acorn@8.12.0: {} - - agent-base@6.0.2: - dependencies: - debug: 4.3.5 - transitivePeerDependencies: - - supports-color - - ansi-escapes@4.3.2: - dependencies: - type-fest: 0.21.3 - - ansi-regex@5.0.1: {} - - ansi-regex@6.0.1: {} - - ansi-styles@4.3.0: - dependencies: - color-convert: 2.0.1 - - ansi-styles@6.2.1: {} - - aproba@2.0.0: {} - - are-we-there-yet@2.0.0: - dependencies: - delegates: 1.0.0 - readable-stream: 3.6.2 - - argparse@1.0.10: - dependencies: - sprintf-js: 1.0.3 - - argparse@2.0.1: {} - - array-find-index@1.0.2: {} - - arrgv@1.0.2: {} - - arrify@3.0.0: {} - - async-sema@3.1.1: {} - - asynckit@0.4.0: {} - - ava@6.1.3: - dependencies: - '@vercel/nft': 0.26.5 - acorn: 8.12.0 - acorn-walk: 8.3.3 - ansi-styles: 6.2.1 - arrgv: 1.0.2 - arrify: 3.0.0 - callsites: 4.1.0 - cbor: 9.0.2 - chalk: 5.3.0 - chunkd: 2.0.1 - ci-info: 4.0.0 - ci-parallel-vars: 1.0.1 - cli-truncate: 4.0.0 - code-excerpt: 4.0.0 - common-path-prefix: 3.0.0 - concordance: 5.0.4 - currently-unhandled: 0.4.1 - debug: 4.3.5 - emittery: 1.0.3 - figures: 6.1.0 - globby: 14.0.1 - ignore-by-default: 2.1.0 - indent-string: 5.0.0 - is-plain-object: 5.0.0 - is-promise: 4.0.0 - matcher: 5.0.0 - memoize: 10.0.0 - ms: 2.1.3 - p-map: 7.0.2 - package-config: 5.0.0 - picomatch: 3.0.1 - plur: 5.1.0 - pretty-ms: 9.0.0 - resolve-cwd: 3.0.0 - stack-utils: 2.0.6 - strip-ansi: 7.1.0 - supertap: 3.0.1 - temp-dir: 3.0.0 - write-file-atomic: 5.0.1 - yargs: 17.7.2 - transitivePeerDependencies: - - encoding - - supports-color - - axios@1.6.2: - dependencies: - follow-redirects: 1.15.6 - form-data: 4.0.0 - proxy-from-env: 1.1.0 - transitivePeerDependencies: - - debug - - balanced-match@1.0.2: {} - - base64-js@1.5.1: {} - - before-after-hook@3.0.2: {} - - bindings@1.5.0: - dependencies: - file-uri-to-path: 1.0.0 - - bl@4.1.0: - dependencies: - buffer: 5.7.1 - inherits: 2.0.4 - readable-stream: 3.6.2 - - blueimp-md5@2.19.0: {} - - brace-expansion@1.1.11: - dependencies: - balanced-match: 1.0.2 - concat-map: 0.0.1 - - braces@3.0.3: - dependencies: - fill-range: 7.1.1 - - buffer@5.7.1: - dependencies: - base64-js: 1.5.1 - ieee754: 1.2.1 - - callsites@4.1.0: {} - - camelize@1.0.1: {} - - cbor@9.0.2: - dependencies: - nofilter: 3.1.0 - - chalk@4.1.2: - dependencies: - ansi-styles: 4.3.0 - supports-color: 7.2.0 - - chalk@5.3.0: {} - - chardet@0.7.0: {} - - chownr@2.0.0: {} - - chunkd@2.0.1: {} - - ci-info@4.0.0: {} - - ci-parallel-vars@1.0.1: {} - - cli-cursor@3.1.0: - dependencies: - restore-cursor: 3.1.0 - - cli-spinners@2.9.2: {} - - cli-truncate@4.0.0: - dependencies: - slice-ansi: 5.0.0 - string-width: 7.1.0 - - cli-width@4.1.0: {} - - clipanion@3.2.1(typanion@3.14.0): - dependencies: - typanion: 3.14.0 - - cliui@8.0.1: - dependencies: - string-width: 4.2.3 - strip-ansi: 6.0.1 - wrap-ansi: 7.0.0 - - clone@1.0.4: {} - - code-excerpt@4.0.0: - dependencies: - convert-to-spaces: 2.0.1 - - color-convert@2.0.1: - dependencies: - color-name: 1.1.4 - - color-name@1.1.4: {} - - color-support@1.1.3: {} - - colorette@2.0.20: {} - - combined-stream@1.0.8: - dependencies: - delayed-stream: 1.0.0 - - common-path-prefix@3.0.0: {} - - concat-map@0.0.1: {} - - concordance@5.0.4: - dependencies: - date-time: 3.1.0 - esutils: 2.0.3 - fast-diff: 1.3.0 - js-string-escape: 1.0.1 - lodash: 4.17.21 - md5-hex: 3.0.1 - semver: 7.6.2 - well-known-symbols: 2.0.0 - - console-control-strings@1.1.0: {} - - convert-to-spaces@2.0.1: {} - - css-color-keywords@1.0.0: {} - - css-to-react-native@3.2.0: - dependencies: - camelize: 1.0.1 - css-color-keywords: 1.0.0 - postcss-value-parser: 4.2.0 - - csstype@3.1.3: {} - - currently-unhandled@0.4.1: - dependencies: - array-find-index: 1.0.2 - - date-time@3.1.0: - dependencies: - time-zone: 1.0.0 - - debug@4.3.5: - dependencies: - ms: 2.1.2 - - defaults@1.0.4: - dependencies: - clone: 1.0.4 - - delayed-stream@1.0.0: {} - - delegates@1.0.0: {} - - detect-libc@2.0.3: {} - - emittery@1.0.3: {} - - emnapi@1.2.0: {} - - emoji-regex@10.3.0: {} - - emoji-regex@8.0.0: {} - - escalade@3.1.2: {} - - escape-string-regexp@2.0.0: {} - - escape-string-regexp@5.0.0: {} - - esprima@4.0.1: {} - - estree-walker@2.0.2: {} - - esutils@2.0.3: {} - - external-editor@3.1.0: - dependencies: - chardet: 0.7.0 - iconv-lite: 0.4.24 - tmp: 0.0.33 - - fast-diff@1.3.0: {} - - fast-glob@3.3.2: - dependencies: - '@nodelib/fs.stat': 2.0.5 - '@nodelib/fs.walk': 1.2.8 - glob-parent: 5.1.2 - merge2: 1.4.1 - micromatch: 4.0.7 - - fastq@1.17.1: - dependencies: - reusify: 1.0.4 - - figures@6.1.0: - dependencies: - is-unicode-supported: 2.0.0 - - file-uri-to-path@1.0.0: {} - - fill-range@7.1.1: - dependencies: - to-regex-range: 5.0.1 - - find-up-simple@1.0.0: {} - - follow-redirects@1.15.6: {} - - form-data@4.0.0: - dependencies: - asynckit: 0.4.0 - combined-stream: 1.0.8 - mime-types: 2.1.35 - - fs-minipass@2.1.0: - dependencies: - minipass: 3.3.6 - - fs.realpath@1.0.0: {} - - gauge@3.0.2: - dependencies: - aproba: 2.0.0 - color-support: 1.1.3 - console-control-strings: 1.1.0 - has-unicode: 2.0.1 - object-assign: 4.1.1 - signal-exit: 3.0.7 - string-width: 4.2.3 - strip-ansi: 6.0.1 - wide-align: 1.1.5 - - get-caller-file@2.0.5: {} - - get-east-asian-width@1.2.0: {} - - glob-parent@5.1.2: - dependencies: - is-glob: 4.0.3 - - glob@7.2.3: - dependencies: - fs.realpath: 1.0.0 - inflight: 1.0.6 - inherits: 2.0.4 - minimatch: 3.1.2 - once: 1.4.0 - path-is-absolute: 1.0.1 - - globby@14.0.1: - dependencies: - '@sindresorhus/merge-streams': 2.3.0 - fast-glob: 3.3.2 - ignore: 5.3.1 - path-type: 5.0.0 - slash: 5.1.0 - unicorn-magic: 0.1.0 - - graceful-fs@4.2.11: {} - - has-flag@4.0.0: {} - - has-unicode@2.0.1: {} - - https-proxy-agent@5.0.1: - dependencies: - agent-base: 6.0.2 - debug: 4.3.5 - transitivePeerDependencies: - - supports-color - - iconv-lite@0.4.24: - dependencies: - safer-buffer: 2.1.2 - - ieee754@1.2.1: {} - - ignore-by-default@2.1.0: {} - - ignore@5.3.1: {} - - imurmurhash@0.1.4: {} - - indent-string@5.0.0: {} - - inflight@1.0.6: - dependencies: - once: 1.4.0 - wrappy: 1.0.2 - - inherits@2.0.4: {} - - inquirer@9.3.5: - dependencies: - '@inquirer/figures': 1.0.3 - ansi-escapes: 4.3.2 - cli-width: 4.1.0 - external-editor: 3.1.0 - mute-stream: 1.0.0 - ora: 5.4.1 - run-async: 3.0.0 - rxjs: 7.8.1 - string-width: 4.2.3 - strip-ansi: 6.0.1 - wrap-ansi: 6.2.0 - yoctocolors-cjs: 2.1.2 - - irregular-plurals@3.5.0: {} - - is-extglob@2.1.1: {} - - is-fullwidth-code-point@3.0.0: {} - - is-fullwidth-code-point@4.0.0: {} - - is-glob@4.0.3: - dependencies: - is-extglob: 2.1.1 - - is-interactive@1.0.0: {} - - is-number@7.0.0: {} - - is-plain-object@5.0.0: {} - - is-promise@4.0.0: {} - - is-unicode-supported@0.1.0: {} - - is-unicode-supported@2.0.0: {} - - js-string-escape@1.0.1: {} - - js-tokens@4.0.0: {} - - js-yaml@3.14.1: - dependencies: - argparse: 1.0.10 - esprima: 4.0.1 - - js-yaml@4.1.0: - dependencies: - argparse: 2.0.1 - - load-json-file@7.0.1: {} - - lodash-es@4.17.21: {} - - lodash@4.17.21: {} - - log-symbols@4.1.0: - dependencies: - chalk: 4.1.2 - is-unicode-supported: 0.1.0 - - loose-envify@1.4.0: - dependencies: - js-tokens: 4.0.0 - - make-dir@3.1.0: - dependencies: - semver: 6.3.1 - - matcher@5.0.0: - dependencies: - escape-string-regexp: 5.0.0 - - md5-hex@3.0.1: - dependencies: - blueimp-md5: 2.19.0 - - memoize@10.0.0: - dependencies: - mimic-function: 5.0.1 - - merge2@1.4.1: {} - - micromatch@4.0.7: - dependencies: - braces: 3.0.3 - picomatch: 2.3.1 - - mime-db@1.52.0: {} - - mime-types@2.1.35: - dependencies: - mime-db: 1.52.0 - - mimic-fn@2.1.0: {} - - mimic-function@5.0.1: {} - - minimatch@3.1.2: - dependencies: - brace-expansion: 1.1.11 - - minipass@3.3.6: - dependencies: - yallist: 4.0.0 - - minipass@5.0.0: {} - - minizlib@2.1.2: - dependencies: - minipass: 3.3.6 - yallist: 4.0.0 - - mkdirp@1.0.4: {} - - ms@2.1.2: {} - - ms@2.1.3: {} - - mute-stream@1.0.0: {} - - nanoid@3.3.7: {} - - node-fetch@2.7.0: - dependencies: - whatwg-url: 5.0.0 - - node-gyp-build@4.8.1: {} - - nofilter@3.1.0: {} - - nopt@5.0.0: - dependencies: - abbrev: 1.1.1 - - npmlog@5.0.1: - dependencies: - are-we-there-yet: 2.0.0 - console-control-strings: 1.1.0 - gauge: 3.0.2 - set-blocking: 2.0.0 - - object-assign@4.1.1: {} - - once@1.4.0: - dependencies: - wrappy: 1.0.2 - - onetime@5.1.2: - dependencies: - mimic-fn: 2.1.0 - - ora@5.4.1: - dependencies: - bl: 4.1.0 - chalk: 4.1.2 - cli-cursor: 3.1.0 - cli-spinners: 2.9.2 - is-interactive: 1.0.0 - is-unicode-supported: 0.1.0 - log-symbols: 4.1.0 - strip-ansi: 6.0.1 - wcwidth: 1.0.1 - - os-tmpdir@1.0.2: {} - - p-map@7.0.2: {} - - package-config@5.0.0: - dependencies: - find-up-simple: 1.0.0 - load-json-file: 7.0.1 - - parse-ms@4.0.0: {} - - path-is-absolute@1.0.1: {} - - path-type@5.0.0: {} - - picocolors@1.0.1: {} - - picomatch@2.3.1: {} - - picomatch@3.0.1: {} - - plur@5.1.0: - dependencies: - irregular-plurals: 3.5.0 - - postcss-value-parser@4.2.0: {} - - postcss@8.4.33: - dependencies: - nanoid: 3.3.7 - picocolors: 1.0.1 - source-map-js: 1.2.0 - - pretty-ms@9.0.0: - dependencies: - parse-ms: 4.0.0 - - proxy-from-env@1.1.0: {} - - queue-microtask@1.2.3: {} - - react-dom@18.3.1(react@18.3.1): - dependencies: - loose-envify: 1.4.0 - react: 18.3.1 - scheduler: 0.23.2 - - react@18.3.1: - dependencies: - loose-envify: 1.4.0 - - readable-stream@3.6.2: - dependencies: - inherits: 2.0.4 - string_decoder: 1.3.0 - util-deprecate: 1.0.2 - - require-directory@2.1.1: {} - - resolve-cwd@3.0.0: - dependencies: - resolve-from: 5.0.0 - - resolve-from@5.0.0: {} - - restore-cursor@3.1.0: - dependencies: - onetime: 5.1.2 - signal-exit: 3.0.7 - - reusify@1.0.4: {} - - rimraf@3.0.2: - dependencies: - glob: 7.2.3 - - run-async@3.0.0: {} - - run-parallel@1.2.0: - dependencies: - queue-microtask: 1.2.3 - - rxjs@7.8.1: - dependencies: - tslib: 2.6.3 - - safe-buffer@5.2.1: {} - - safer-buffer@2.1.2: {} - - scheduler@0.23.2: - dependencies: - loose-envify: 1.4.0 - - semver@6.3.1: {} - - semver@7.6.2: {} - - serialize-error@7.0.1: - dependencies: - type-fest: 0.13.1 - - set-blocking@2.0.0: {} - - shallowequal@1.1.0: {} - - signal-exit@3.0.7: {} - - signal-exit@4.1.0: {} - - slash@5.1.0: {} - - slice-ansi@5.0.0: - dependencies: - ansi-styles: 6.2.1 - is-fullwidth-code-point: 4.0.0 - - source-map-js@1.2.0: {} - - sprintf-js@1.0.3: {} - - stack-utils@2.0.6: - dependencies: - escape-string-regexp: 2.0.0 - - string-width@4.2.3: - dependencies: - emoji-regex: 8.0.0 - is-fullwidth-code-point: 3.0.0 - strip-ansi: 6.0.1 - - string-width@7.1.0: - dependencies: - emoji-regex: 10.3.0 - get-east-asian-width: 1.2.0 - strip-ansi: 7.1.0 - - string_decoder@1.3.0: - dependencies: - safe-buffer: 5.2.1 - - strip-ansi@6.0.1: - dependencies: - ansi-regex: 5.0.1 - - strip-ansi@7.1.0: - dependencies: - ansi-regex: 6.0.1 - - styled-components@6.1.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1): - dependencies: - '@emotion/is-prop-valid': 1.2.2 - '@emotion/unitless': 0.8.1 - '@types/stylis': 4.2.6 - css-to-react-native: 3.2.0 - csstype: 3.1.3 - postcss: 8.4.33 - react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) - shallowequal: 1.1.0 - stylis: 4.3.2 - tslib: 2.6.3 - - stylis@4.3.2: {} - - supertap@3.0.1: - dependencies: - indent-string: 5.0.0 - js-yaml: 3.14.1 - serialize-error: 7.0.1 - strip-ansi: 7.1.0 - - supports-color@7.2.0: - dependencies: - has-flag: 4.0.0 - - tar@6.2.1: - dependencies: - chownr: 2.0.0 - fs-minipass: 2.1.0 - minipass: 5.0.0 - minizlib: 2.1.2 - mkdirp: 1.0.4 - yallist: 4.0.0 - - temp-dir@3.0.0: {} - - time-zone@1.0.0: {} - - tmp@0.0.33: - dependencies: - os-tmpdir: 1.0.2 - - to-regex-range@5.0.1: - dependencies: - is-number: 7.0.0 - - toml@3.0.0: {} - - tr46@0.0.3: {} - - tslib@2.6.3: {} - - typanion@3.14.0: {} - - type-fest@0.13.1: {} - - type-fest@0.21.3: {} - - typescript@5.5.3: {} - - undici-types@5.26.5: {} - - unicorn-magic@0.1.0: {} - - universal-user-agent@7.0.2: {} - - util-deprecate@1.0.2: {} - - wasm-sjlj@1.0.5: {} - - wcwidth@1.0.1: - dependencies: - defaults: 1.0.4 - - webidl-conversions@3.0.1: {} - - well-known-symbols@2.0.0: {} - - whatwg-url@5.0.0: - dependencies: - tr46: 0.0.3 - webidl-conversions: 3.0.1 - - wide-align@1.1.5: - dependencies: - string-width: 4.2.3 - - wrap-ansi@6.2.0: - dependencies: - ansi-styles: 4.3.0 - string-width: 4.2.3 - strip-ansi: 6.0.1 - - wrap-ansi@7.0.0: - dependencies: - ansi-styles: 4.3.0 - string-width: 4.2.3 - strip-ansi: 6.0.1 - - wrappy@1.0.2: {} - - write-file-atomic@5.0.1: - dependencies: - imurmurhash: 0.1.4 - signal-exit: 4.1.0 - - y18n@5.0.8: {} - - yallist@4.0.0: {} - - yargs-parser@21.1.1: {} - - yargs@17.7.2: - dependencies: - cliui: 8.0.1 - escalade: 3.1.2 - get-caller-file: 2.0.5 - require-directory: 2.1.1 - string-width: 4.2.3 - y18n: 5.0.8 - yargs-parser: 21.1.1 - - yoctocolors-cjs@2.1.2: {} diff --git a/src/builtins.rs b/src/builtins.rs deleted file mode 100644 index 45a25117..00000000 --- a/src/builtins.rs +++ /dev/null @@ -1,71 +0,0 @@ -/// Node.js built-in modules -/// -/// `node -p "[...require('module').builtinModules].map(b => JSON.stringify(b)).join(',\n')"` -/// -pub const NODEJS_BUILTINS: &[&str] = &[ - "_http_agent", - "_http_client", - "_http_common", - "_http_incoming", - "_http_outgoing", - "_http_server", - "_stream_duplex", - "_stream_passthrough", - "_stream_readable", - "_stream_transform", - "_stream_wrap", - "_stream_writable", - "_tls_common", - "_tls_wrap", - "assert", - "assert/strict", - "async_hooks", - "buffer", - "child_process", - "cluster", - "console", - "constants", - "crypto", - "dgram", - "diagnostics_channel", - "dns", - "dns/promises", - "domain", - "events", - "fs", - "fs/promises", - "http", - "http2", - "https", - "inspector", - "module", - "net", - "os", - "path", - "path/posix", - "path/win32", - "perf_hooks", - "process", - "punycode", - "querystring", - "readline", - "repl", - "stream", - "stream/consumers", - "stream/promises", - "stream/web", - "string_decoder", - "sys", - "timers", - "timers/promises", - "tls", - "trace_events", - "tty", - "url", - "util", - "util/types", - "v8", - "vm", - "worker_threads", - "zlib", -]; diff --git a/src/cache.rs b/src/cache.rs deleted file mode 100644 index a1bde36c..00000000 --- a/src/cache.rs +++ /dev/null @@ -1,369 +0,0 @@ -use once_cell::sync::OnceCell as OnceLock; -use std::{ - borrow::{Borrow, Cow}, - convert::AsRef, - hash::{BuildHasherDefault, Hash, Hasher}, - io, - ops::Deref, - path::{Path, PathBuf}, - sync::Arc, -}; - -use dashmap::{DashMap, DashSet}; -use rustc_hash::FxHasher; - -use crate::{ - context::ResolveContext as Ctx, package_json::PackageJson, path::PathUtil, FileMetadata, - FileSystem, ResolveError, ResolveOptions, TsConfig, -}; - -#[derive(Default)] -pub struct Cache { - pub(crate) fs: Fs, - paths: DashSet>, - tsconfigs: DashMap, BuildHasherDefault>, -} - -impl Cache { - pub fn new(fs: Fs) -> Self { - Self { fs, paths: DashSet::default(), tsconfigs: DashMap::default() } - } - - pub fn clear(&self) { - self.paths.clear(); - self.tsconfigs.clear(); - } - - pub fn value(&self, path: &Path) -> CachedPath { - let hash = { - let mut hasher = FxHasher::default(); - path.hash(&mut hasher); - hasher.finish() - }; - if let Some(cache_entry) = self.paths.get((hash, path).borrow() as &dyn CacheKey) { - return cache_entry.clone(); - } - let parent = path.parent().map(|p| self.value(p)); - let data = CachedPath(Arc::new(CachedPathImpl::new( - hash, - path.to_path_buf().into_boxed_path(), - parent, - ))); - self.paths.insert(data.clone()); - data - } - - pub fn tsconfig Result<(), ResolveError>>( - &self, - root: bool, - path: &Path, - callback: F, // callback for modifying tsconfig with `extends` - ) -> Result, ResolveError> { - if let Some(tsconfig_ref) = self.tsconfigs.get(path) { - return Ok(Arc::clone(tsconfig_ref.value())); - } - let meta = self.fs.metadata(path).ok(); - let tsconfig_path = if meta.is_some_and(|m| m.is_file) { - Cow::Borrowed(path) - } else if meta.is_some_and(|m| m.is_dir) { - Cow::Owned(path.join("tsconfig.json")) - } else { - let mut os_string = path.to_path_buf().into_os_string(); - os_string.push(".json"); - Cow::Owned(PathBuf::from(os_string)) - }; - let mut tsconfig_string = self - .fs - .read_to_string(&tsconfig_path) - .map_err(|_| ResolveError::TsconfigNotFound(path.to_path_buf()))?; - let mut tsconfig = - TsConfig::parse(root, &tsconfig_path, &mut tsconfig_string).map_err(|error| { - ResolveError::from_serde_json_error(tsconfig_path.to_path_buf(), &error) - })?; - callback(&mut tsconfig)?; - let tsconfig = Arc::new(tsconfig.build()); - self.tsconfigs.insert(path.to_path_buf(), Arc::clone(&tsconfig)); - Ok(tsconfig) - } -} - -#[derive(Clone)] -pub struct CachedPath(Arc); - -impl Hash for CachedPath { - fn hash(&self, state: &mut H) { - self.0.hash.hash(state); - } -} - -impl PartialEq for CachedPath { - fn eq(&self, other: &Self) -> bool { - self.0.path == other.0.path - } -} -impl Eq for CachedPath {} - -impl Deref for CachedPath { - type Target = CachedPathImpl; - - fn deref(&self) -> &Self::Target { - self.0.as_ref() - } -} - -impl<'a> Borrow for CachedPath { - fn borrow(&self) -> &(dyn CacheKey + 'a) { - self - } -} - -impl AsRef for CachedPath { - fn as_ref(&self) -> &CachedPathImpl { - self.0.as_ref() - } -} - -impl CacheKey for CachedPath { - fn tuple(&self) -> (u64, &Path) { - (self.hash, &self.path) - } -} - -pub struct CachedPathImpl { - hash: u64, - path: Box, - parent: Option, - meta: OnceLock>, - symlink: OnceLock>, - canonicalized: OnceLock>, - node_modules: OnceLock>, - package_json: OnceLock>>, -} - -impl CachedPathImpl { - fn new(hash: u64, path: Box, parent: Option) -> Self { - Self { - hash, - path, - parent, - meta: OnceLock::new(), - symlink: OnceLock::new(), - canonicalized: OnceLock::new(), - node_modules: OnceLock::new(), - package_json: OnceLock::new(), - } - } - - pub fn path(&self) -> &Path { - &self.path - } - - pub fn to_path_buf(&self) -> PathBuf { - self.path.to_path_buf() - } - - pub fn parent(&self) -> Option<&CachedPath> { - self.parent.as_ref() - } - - fn meta(&self, fs: &Fs) -> Option { - *self.meta.get_or_init(|| fs.metadata(&self.path).ok()) - } - - pub fn is_file(&self, fs: &Fs, ctx: &mut Ctx) -> bool { - if let Some(meta) = self.meta(fs) { - ctx.add_file_dependency(self.path()); - meta.is_file - } else { - ctx.add_missing_dependency(self.path()); - false - } - } - - pub fn is_dir(&self, fs: &Fs, ctx: &mut Ctx) -> bool { - self.meta(fs).map_or_else( - || { - ctx.add_missing_dependency(self.path()); - false - }, - |meta| meta.is_dir, - ) - } - - fn symlink(&self, fs: &Fs) -> io::Result> { - self.symlink - .get_or_try_init(|| { - if let Ok(symlink_metadata) = fs.symlink_metadata(&self.path) { - if symlink_metadata.is_symlink { - return fs.canonicalize(self.path()).map(Some); - } - } - Ok(None) - }) - .cloned() - } - - pub fn realpath(&self, fs: &Fs) -> io::Result { - self.canonicalized - .get_or_try_init(|| { - if let Some(link) = self.symlink(fs)? { - return Ok(Some(link)); - } - if let Some(parent) = self.parent() { - let parent_path = parent.realpath(fs)?; - return Ok(Some( - parent_path.normalize_with(self.path.strip_prefix(&parent.path).unwrap()), - )); - }; - Ok(None) - }) - .cloned() - .map(|r| r.unwrap_or_else(|| self.path.clone().to_path_buf())) - } - - pub fn module_directory( - &self, - module_name: &str, - cache: &Cache, - ctx: &mut Ctx, - ) -> Option { - let cached_path = cache.value(&self.path.join(module_name)); - cached_path.is_dir(&cache.fs, ctx).then_some(cached_path) - } - - pub fn cached_node_modules( - &self, - cache: &Cache, - ctx: &mut Ctx, - ) -> Option { - self.node_modules.get_or_init(|| self.module_directory("node_modules", cache, ctx)).clone() - } - - /// Find package.json of a path by traversing parent directories. - /// - /// # Errors - /// - /// * [ResolveError::JSON] - pub fn find_package_json( - &self, - fs: &Fs, - options: &ResolveOptions, - ctx: &mut Ctx, - ) -> Result>, ResolveError> { - let mut cache_value = self; - // Go up directories when the querying path is not a directory - while !cache_value.is_dir(fs, ctx) { - if let Some(cv) = &cache_value.parent { - cache_value = cv.as_ref(); - } else { - break; - } - } - let mut cache_value = Some(cache_value); - while let Some(cv) = cache_value { - if let Some(package_json) = cv.package_json(fs, options, ctx)? { - return Ok(Some(Arc::clone(&package_json))); - } - cache_value = cv.parent.as_deref(); - } - Ok(None) - } - - /// Get package.json of the given path. - /// - /// # Errors - /// - /// * [ResolveError::JSON] - pub fn package_json( - &self, - fs: &Fs, - options: &ResolveOptions, - ctx: &mut Ctx, - ) -> Result>, ResolveError> { - // Change to `std::sync::OnceLock::get_or_try_init` when it is stable. - let result = self - .package_json - .get_or_try_init(|| { - let package_json_path = self.path.join("package.json"); - let Ok(package_json_string) = fs.read_to_string(&package_json_path) else { - return Ok(None); - }; - let real_path = if options.symlinks { - self.realpath(fs)?.join("package.json") - } else { - package_json_path.clone() - }; - PackageJson::parse(package_json_path.clone(), real_path, &package_json_string) - .map(Arc::new) - .map(Some) - .map_err(|error| ResolveError::from_serde_json_error(package_json_path, &error)) - }) - .cloned(); - // https://github.com/webpack/enhanced-resolve/blob/58464fc7cb56673c9aa849e68e6300239601e615/lib/DescriptionFileUtils.js#L68-L82 - match &result { - Ok(Some(package_json)) => { - ctx.add_file_dependency(&package_json.path); - } - Ok(None) => { - // Avoid an allocation by making this lazy - if let Some(deps) = &mut ctx.missing_dependencies { - deps.push(self.path.join("package.json")); - } - } - Err(_) => { - if let Some(deps) = &mut ctx.file_dependencies { - deps.push(self.path.join("package.json")); - } - } - } - result - } -} - -/// Memoized cache key, code adapted from . -trait CacheKey { - fn tuple(&self) -> (u64, &Path); -} - -impl Hash for dyn CacheKey + '_ { - fn hash(&self, state: &mut H) { - self.tuple().0.hash(state); - } -} - -impl PartialEq for dyn CacheKey + '_ { - fn eq(&self, other: &Self) -> bool { - self.tuple().1 == other.tuple().1 - } -} - -impl Eq for dyn CacheKey + '_ {} - -impl<'a> CacheKey for (u64, &'a Path) { - fn tuple(&self) -> (u64, &Path) { - (self.0, self.1) - } -} - -impl<'a> Borrow for (u64, &'a Path) { - fn borrow(&self) -> &(dyn CacheKey + 'a) { - self - } -} - -/// Since the cache key is memoized, use an identity hasher -/// to avoid double cache. -#[derive(Default)] -struct IdentityHasher(u64); - -impl Hasher for IdentityHasher { - fn write(&mut self, _: &[u8]) { - unreachable!("Invalid use of IdentityHasher") - } - fn write_u64(&mut self, n: u64) { - self.0 = n; - } - fn finish(&self) -> u64 { - self.0 - } -} diff --git a/src/context.rs b/src/context.rs deleted file mode 100644 index 9349de30..00000000 --- a/src/context.rs +++ /dev/null @@ -1,89 +0,0 @@ -use std::{ - ops::{Deref, DerefMut}, - path::{Path, PathBuf}, -}; - -use crate::error::ResolveError; - -#[derive(Debug, Default, Clone)] -pub struct ResolveContext(ResolveContextImpl); - -#[derive(Debug, Default, Clone)] -pub struct ResolveContextImpl { - pub fully_specified: bool, - - pub query: Option, - - pub fragment: Option, - - /// Files that was found on file system - pub file_dependencies: Option>, - - /// Files that was found on file system - pub missing_dependencies: Option>, - - /// The current resolving alias for bailing recursion alias. - pub resolving_alias: Option, - - /// For avoiding infinite recursion, which will cause stack overflow. - depth: u8, -} - -impl Deref for ResolveContext { - type Target = ResolveContextImpl; - - fn deref(&self) -> &Self::Target { - &self.0 - } -} - -impl DerefMut for ResolveContext { - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} - -impl ResolveContext { - pub fn with_fully_specified(&mut self, yes: bool) { - self.fully_specified = yes; - } - - pub fn with_query_fragment(&mut self, query: Option<&str>, fragment: Option<&str>) { - if let Some(query) = query { - self.query.replace(query.to_string()); - } - if let Some(fragment) = fragment { - self.fragment.replace(fragment.to_string()); - } - } - - pub fn init_file_dependencies(&mut self) { - self.file_dependencies.replace(vec![]); - self.missing_dependencies.replace(vec![]); - } - - pub fn add_file_dependency(&mut self, dep: &Path) { - if let Some(deps) = &mut self.file_dependencies { - deps.push(dep.to_path_buf()); - } - } - - pub fn add_missing_dependency(&mut self, dep: &Path) { - if let Some(deps) = &mut self.missing_dependencies { - deps.push(dep.to_path_buf()); - } - } - - pub fn with_resolving_alias(&mut self, alias: String) { - self.resolving_alias = Some(alias); - } - - pub fn test_for_infinite_recursion(&mut self) -> Result<(), ResolveError> { - self.depth += 1; - // 64 should be more than enough for detecting infinite recursion. - if self.depth > 64 { - return Err(ResolveError::Recursion); - } - Ok(()) - } -} diff --git a/src/error.rs b/src/error.rs deleted file mode 100644 index 901e67ff..00000000 --- a/src/error.rs +++ /dev/null @@ -1,178 +0,0 @@ -use std::{io, path::PathBuf, sync::Arc}; -use thiserror::Error; - -/// All resolution errors -/// -/// `thiserror` is used to display meaningful error messages. -#[derive(Debug, Clone, PartialEq, Error)] -pub enum ResolveError { - /// Ignored path - /// - /// Derived from ignored path (false value) from browser field in package.json - /// ```json - /// { - /// "browser": { - /// "./module": false - /// } - /// } - /// ``` - /// See - #[error("Path is ignored {0}")] - Ignored(PathBuf), - - /// Module not found - #[error("Cannot find module '{0}'")] - NotFound(/* specifier */ String), - - /// Tsconfig not found - #[error("Tsconfig not found {0}")] - TsconfigNotFound(PathBuf), - - /// Tsconfig's project reference path points to it self - #[error("Tsconfig's project reference path points to this tsconfig {0}")] - TsconfigSelfReference(PathBuf), - - #[error("{0}")] - IOError(IOError), - - /// Node.js builtin modules - /// - /// This is an error due to not being a Node.js runtime. - /// The `alias` option can be used to resolve a builtin module to a polyfill. - #[error("Builtin module {0}")] - Builtin(String), - - /// All of the aliased extension are not found - #[error("All of the aliased extension are not found")] - ExtensionAlias, - - /// The provided path specifier cannot be parsed - #[error("{0}")] - Specifier(SpecifierError), - - /// JSON parse error - #[error("{0:?}")] - JSON(JSONError), - - /// Restricted by `ResolveOptions::restrictions` - #[error(r#"Path "{0}" restricted by {0}"#)] - Restriction(PathBuf, PathBuf), - - #[error(r#"Invalid module "{0}" specifier is not a valid subpath for the "exports" resolution of {1}"#)] - InvalidModuleSpecifier(String, PathBuf), - - #[error(r#"Invalid "exports" target "{0}" defined for '{1}' in the package config {2}"#)] - InvalidPackageTarget(String, String, PathBuf), - - #[error(r#"Package subpath '{0}' is not defined by "exports" in {1}"#)] - PackagePathNotExported(String, PathBuf), - - #[error(r#"Invalid package config "{0}", "exports" cannot contain some keys starting with '.' and some not. The exports object must either be an object of package subpath keys or an object of main entry condition name keys only."#)] - InvalidPackageConfig(PathBuf), - - #[error(r#"Default condition should be last one in "{0}""#)] - InvalidPackageConfigDefault(PathBuf), - - #[error(r#"Expecting folder to folder mapping. "{0}" should end with "/"#)] - InvalidPackageConfigDirectory(PathBuf), - - #[error(r#"Package import specifier "{0}" is not defined in package {1}"#)] - PackageImportNotDefined(String, PathBuf), - - #[error("{0} is unimplemented")] - Unimplemented(&'static str), - - /// Occurs when alias paths reference each other. - #[error("Recursion in resolving")] - Recursion, -} - -impl ResolveError { - pub fn is_ignore(&self) -> bool { - matches!(self, Self::Ignored(_)) - } - - pub(crate) fn from_serde_json_error(path: PathBuf, error: &serde_json::Error) -> Self { - Self::JSON(JSONError { - path, - message: error.to_string(), - line: error.line(), - column: error.column(), - }) - } -} - -/// Error for [ResolveError::Specifier] -#[derive(Debug, Clone, Eq, PartialEq, Error)] -pub enum SpecifierError { - #[error("The specifiers must be a non-empty string. Received \"{0}\"")] - Empty(String), -} - -/// JSON error from [serde_json::Error] -#[derive(Debug, Clone, Eq, PartialEq)] -pub struct JSONError { - pub path: PathBuf, - pub message: String, - pub line: usize, - pub column: usize, -} - -#[derive(Debug, Clone, Error)] -#[error("{0}")] -pub struct IOError(Arc); - -impl PartialEq for IOError { - fn eq(&self, other: &Self) -> bool { - self.0.kind() == other.0.kind() - } -} - -impl From for io::Error { - fn from(error: IOError) -> Self { - let io_error = error.0.as_ref(); - Self::new(io_error.kind(), io_error.to_string()) - } -} - -impl From for ResolveError { - fn from(err: io::Error) -> Self { - Self::IOError(IOError(Arc::new(err))) - } -} - -#[test] -fn test_into_io_error() { - use std::io::{self, ErrorKind}; - let error_string = "IOError occurred"; - let string_error = io::Error::new(ErrorKind::Interrupted, error_string.to_string()); - let string_error2 = io::Error::new(ErrorKind::Interrupted, error_string.to_string()); - let resolve_io_error: ResolveError = ResolveError::from(string_error2); - - assert_eq!(resolve_io_error, ResolveError::from(string_error)); - assert_eq!(resolve_io_error.clone(), resolve_io_error); - let ResolveError::IOError(io_error) = resolve_io_error else { unreachable!() }; - assert_eq!( - format!("{io_error:?}"), - r#"IOError(Custom { kind: Interrupted, error: "IOError occurred" })"# - ); - // fix for https://github.com/web-infra-dev/rspack/issues/4564 - let std_io_error: io::Error = io_error.into(); - assert_eq!(std_io_error.kind(), ErrorKind::Interrupted); - assert_eq!(std_io_error.to_string(), error_string); - assert_eq!( - format!("{std_io_error:?}"), - r#"Custom { kind: Interrupted, error: "IOError occurred" }"# - ); -} - -#[test] -fn test_coverage() { - let error = ResolveError::NotFound("x".into()); - assert_eq!(format!("{error:?}"), r#"NotFound("x")"#); - assert_eq!(error.clone(), error); - - let error = ResolveError::Specifier(SpecifierError::Empty("x".into())); - assert_eq!(format!("{error:?}"), r#"Specifier(Empty("x"))"#); - assert_eq!(error.clone(), error); -} diff --git a/src/file_system.rs b/src/file_system.rs deleted file mode 100644 index 04d177de..00000000 --- a/src/file_system.rs +++ /dev/null @@ -1,133 +0,0 @@ -use std::{ - fs, io, - path::{Path, PathBuf}, -}; - -/// File System abstraction used for `ResolverGeneric` -pub trait FileSystem: Send + Sync { - /// See [std::fs::read_to_string] - /// - /// # Errors - /// - /// * See [std::fs::read_to_string] - /// ## Warning - /// Use `&Path` instead of a generic `P: AsRef` here, - /// because object safety requirements, it is especially useful, when - /// you want to store multiple `dyn FileSystem` in a `Vec` or use a `ResolverGeneric` in - /// napi env. - fn read_to_string(&self, path: &Path) -> io::Result; - - /// See [std::fs::metadata] - /// - /// # Errors - /// See [std::fs::metadata] - /// ## Warning - /// Use `&Path` instead of a generic `P: AsRef` here, - /// because object safety requirements, it is especially useful, when - /// you want to store multiple `dyn FileSystem` in a `Vec` or use a `ResolverGeneric` in - /// napi env. - fn metadata(&self, path: &Path) -> io::Result; - - /// See [std::fs::symlink_metadata] - /// - /// # Errors - /// - /// See [std::fs::symlink_metadata] - /// ## Warning - /// Use `&Path` instead of a generic `P: AsRef` here, - /// because object safety requirements, it is especially useful, when - /// you want to store multiple `dyn FileSystem` in a `Vec` or use a `ResolverGeneric` in - /// napi env. - fn symlink_metadata(&self, path: &Path) -> io::Result; - - /// See [std::fs::canonicalize] - /// - /// # Errors - /// - /// See [std::fs::read_link] - /// ## Warning - /// Use `&Path` instead of a generic `P: AsRef` here, - /// because object safety requirements, it is especially useful, when - /// you want to store multiple `dyn FileSystem` in a `Vec` or use a `ResolverGeneric` in - /// napi env. - fn canonicalize(&self, path: &Path) -> io::Result; -} - -/// Metadata information about a file -#[derive(Debug, Clone, Copy)] -pub struct FileMetadata { - pub(crate) is_file: bool, - pub(crate) is_dir: bool, - pub(crate) is_symlink: bool, -} - -impl FileMetadata { - pub fn new(is_file: bool, is_dir: bool, is_symlink: bool) -> Self { - Self { is_file, is_dir, is_symlink } - } -} - -impl From for FileMetadata { - fn from(metadata: fs::Metadata) -> Self { - Self::new(metadata.is_file(), metadata.is_dir(), metadata.is_symlink()) - } -} - -/// Operating System -#[derive(Default)] -pub struct FileSystemOs; - -impl FileSystem for FileSystemOs { - fn read_to_string(&self, path: &Path) -> io::Result { - fs::read_to_string(path) - } - - fn metadata(&self, path: &Path) -> io::Result { - fs::metadata(path).map(FileMetadata::from) - } - - fn symlink_metadata(&self, path: &Path) -> io::Result { - fs::symlink_metadata(path).map(FileMetadata::from) - } - - fn canonicalize(&self, path: &Path) -> io::Result { - #[cfg(not(target_os = "wasi"))] - { - dunce::canonicalize(path) - } - #[cfg(target_os = "wasi")] - { - let meta = fs::symlink_metadata(path)?; - if meta.file_type().is_symlink() { - let link = fs::read_link(path)?; - let mut path_buf = path.to_path_buf(); - path_buf.pop(); - for segment in link.iter() { - match segment.to_str() { - Some("..") => { - path_buf.pop(); - } - Some(".") | None => {} - Some(seg) => { - // Need to trim the extra \0 introduces by rust std rust-lang/rust#123727 - path_buf.push(seg.trim_end_matches('\0')); - } - } - } - Ok(path_buf) - } else { - Ok(path.to_path_buf()) - } - } - } -} - -#[test] -fn metadata() { - let meta = FileMetadata { is_file: true, is_dir: true, is_symlink: true }; - assert_eq!( - format!("{meta:?}"), - "FileMetadata { is_file: true, is_dir: true, is_symlink: true }" - ); - let _ = meta; -} diff --git a/src/lib.rs b/src/lib.rs deleted file mode 100644 index cfe6c25a..00000000 --- a/src/lib.rs +++ /dev/null @@ -1,1689 +0,0 @@ -//! # Oxc Resolver -//! -//! Node.js [CommonJS][cjs] and [ECMAScript][esm] Module Resolution. -//! -//! Released on [crates.io](https://crates.io/crates/oxc_resolver) and [npm](https://www.npmjs.com/package/oxc-resolver). -//! -//! A module resolution is the process of finding the file referenced by a module specifier in -//! `import "specifier"` or `require("specifier")`. -//! -//! All [configuration options](ResolveOptions) are aligned with webpack's [enhanced-resolve]. -//! -//! ## Terminology -//! -//! ### Specifier -//! -//! For [CommonJS modules][cjs], -//! the specifier is the string passed to the `require` function. e.g. `"id"` in `require("id")`. -//! -//! For [ECMAScript modules][esm], -//! the specifier of an `import` statement is the string after the `from` keyword, -//! e.g. `'specifier'` in `import 'specifier'` or `import { sep } from 'specifier'`. -//! Specifiers are also used in export from statements, and as the argument to an `import()` expression. -//! -//! This is also named "request" in some places. -//! -//! ## References: -//! -//! * Algorithm adapted from Node.js [CommonJS Module Resolution Algorithm] and [ECMAScript Module Resolution Algorithm]. -//! * Tests are ported from [enhanced-resolve]. -//! * Some code is adapted from [parcel-resolver]. -//! * The documentation is copied from [webpack's resolve configuration](https://webpack.js.org/configuration/resolve). -//! -//! [enhanced-resolve]: https://github.com/webpack/enhanced-resolve -//! [CommonJS Module Resolution Algorithm]: https://nodejs.org/api/modules.html#all-together -//! [ECMAScript Module Resolution Algorithm]: https://nodejs.org/api/esm.html#resolution-algorithm-specification -//! [parcel-resolver]: https://github.com/parcel-bundler/parcel/blob/v2/packages/utils/node-resolver-rs -//! [cjs]: https://nodejs.org/api/modules.html -//! [esm]: https://nodejs.org/api/esm.html -//! -//! ## Feature flags -#![cfg_attr(feature = "document-features", doc = document_features::document_features!())] -#![cfg_attr(docsrs, feature(doc_auto_cfg))] -//! -//! ## Example -//! -//! ```rust,ignore -#![doc = include_str!("../examples/resolver.rs")] -//! ``` - -mod builtins; -mod cache; -mod context; -mod error; -mod file_system; -mod options; -mod package_json; -mod path; -mod resolution; -mod specifier; -mod tsconfig; - -#[cfg(test)] -mod tests; - -use std::{ - borrow::Cow, - cmp::Ordering, - ffi::OsStr, - fmt, - path::{Component, Path, PathBuf}, - sync::Arc, -}; - -use rustc_hash::FxHashSet; -use serde_json::Value as JSONValue; - -pub use crate::{ - builtins::NODEJS_BUILTINS, - error::{JSONError, ResolveError, SpecifierError}, - file_system::{FileMetadata, FileSystem}, - options::{ - Alias, AliasValue, EnforceExtension, ResolveOptions, Restriction, TsconfigOptions, - TsconfigReferences, - }, - package_json::PackageJson, - resolution::Resolution, -}; -use crate::{ - cache::{Cache, CachedPath}, - context::ResolveContext as Ctx, - file_system::FileSystemOs, - package_json::JSONMap, - path::{PathUtil, SLASH_START}, - specifier::Specifier, - tsconfig::ExtendsField, - tsconfig::{ProjectReference, TsConfig}, -}; - -type ResolveResult = Result, ResolveError>; - -/// Context returned from the [Resolver::resolve_with_context] API -#[derive(Debug, Default, Clone)] -pub struct ResolveContext { - /// Files that was found on file system - pub file_dependencies: FxHashSet, - - /// Dependencies that was not found on file system - pub missing_dependencies: FxHashSet, -} - -/// Resolver with the current operating system as the file system -pub type Resolver = ResolverGeneric; - -/// Generic implementation of the resolver, can be configured by the [FileSystem] trait -pub struct ResolverGeneric { - options: ResolveOptions, - cache: Arc>, -} - -impl fmt::Debug for ResolverGeneric { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - self.options.fmt(f) - } -} - -impl Default for ResolverGeneric { - fn default() -> Self { - Self::new(ResolveOptions::default()) - } -} - -impl ResolverGeneric { - pub fn new(options: ResolveOptions) -> Self { - Self { options: options.sanitize(), cache: Arc::new(Cache::new(Fs::default())) } - } -} - -impl ResolverGeneric { - pub fn new_with_file_system(file_system: Fs, options: ResolveOptions) -> Self { - Self { cache: Arc::new(Cache::new(file_system)), options: options.sanitize() } - } - - /// Clone the resolver using the same underlying cache. - #[must_use] - pub fn clone_with_options(&self, options: ResolveOptions) -> Self { - Self { options: options.sanitize(), cache: Arc::clone(&self.cache) } - } - - /// Returns the options. - pub fn options(&self) -> &ResolveOptions { - &self.options - } - - /// Clear the underlying cache. - pub fn clear_cache(&self) { - self.cache.clear(); - } - - /// Resolve `specifier` at an absolute path to a `directory`. - /// - /// A specifier is the string passed to require or import, i.e. `require("specifier")` or `import "specifier"`. - /// - /// `directory` must be an **absolute** path to a directory where the specifier is resolved against. - /// For CommonJS modules, it is the `__dirname` variable that contains the absolute path to the folder containing current module. - /// For ECMAScript modules, it is the value of `import.meta.url`. - /// - /// # Errors - /// - /// * See [ResolveError] - pub fn resolve>( - &self, - directory: P, - specifier: &str, - ) -> Result { - let mut ctx = Ctx::default(); - self.resolve_tracing(directory.as_ref(), specifier, &mut ctx) - } - - /// Resolve `specifier` at absolute `path` with [ResolveContext] - /// - /// # Errors - /// - /// * See [ResolveError] - pub fn resolve_with_context>( - &self, - directory: P, - specifier: &str, - resolve_context: &mut ResolveContext, - ) -> Result { - let mut ctx = Ctx::default(); - ctx.init_file_dependencies(); - let result = self.resolve_tracing(directory.as_ref(), specifier, &mut ctx); - if let Some(deps) = &mut ctx.file_dependencies { - resolve_context.file_dependencies.extend(deps.drain(..)); - } - if let Some(deps) = &mut ctx.missing_dependencies { - resolve_context.missing_dependencies.extend(deps.drain(..)); - } - result - } - - /// Wrap `resolve_impl` with `tracing` information - fn resolve_tracing( - &self, - directory: &Path, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - let span = tracing::debug_span!("resolve", path = ?directory, specifier = specifier); - let _enter = span.enter(); - let r = self.resolve_impl(directory, specifier, ctx); - match &r { - Ok(r) => { - tracing::debug!(options = ?self.options, path = ?directory, specifier = specifier, ret = ?r.path); - } - Err(err) => { - tracing::debug!(options = ?self.options, path = ?directory, specifier = specifier, err = ?err); - } - }; - r - } - - fn resolve_impl( - &self, - path: &Path, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - ctx.with_fully_specified(self.options.fully_specified); - let cached_path = self.cache.value(path); - let cached_path = self.require(&cached_path, specifier, ctx)?; - let path = self.load_realpath(&cached_path)?; - // enhanced-resolve: restrictions - self.check_restrictions(&path)?; - let package_json = cached_path.find_package_json(&self.cache.fs, &self.options, ctx)?; - if let Some(package_json) = &package_json { - // path must be inside the package. - debug_assert!(path.starts_with(package_json.directory())); - } - Ok(Resolution { - path, - query: ctx.query.take(), - fragment: ctx.fragment.take(), - package_json, - }) - } - - /// require(X) from module at path Y - /// - /// X: specifier - /// Y: path - /// - /// - fn require( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - ctx.test_for_infinite_recursion()?; - - // enhanced-resolve: parse - let (parsed, try_fragment_as_path) = self.load_parse(cached_path, specifier, ctx)?; - if let Some(path) = try_fragment_as_path { - return Ok(path); - } - - self.require_without_parse(cached_path, parsed.path(), ctx) - } - - fn require_without_parse( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - // tsconfig-paths - if let Some(path) = self.load_tsconfig_paths(cached_path, specifier, &mut Ctx::default())? { - return Ok(path); - } - - // enhanced-resolve: try alias - if let Some(path) = self.load_alias(cached_path, specifier, &self.options.alias, ctx)? { - return Ok(path); - } - - let result = match Path::new(specifier).components().next() { - // 2. If X begins with '/' - Some(Component::RootDir | Component::Prefix(_)) => { - self.require_absolute(cached_path, specifier, ctx) - } - // 3. If X begins with './' or '/' or '../' - Some(Component::CurDir | Component::ParentDir) => { - self.require_relative(cached_path, specifier, ctx) - } - // 4. If X begins with '#' - Some(Component::Normal(_)) if specifier.as_bytes()[0] == b'#' => { - self.require_hash(cached_path, specifier, ctx) - } - _ => { - // 1. If X is a core module, - // a. return the core module - // b. STOP - self.require_core(specifier)?; - - // (ESM) 5. Otherwise, - // Note: specifier is now a bare specifier. - // Set resolved the result of PACKAGE_RESOLVE(specifier, parentURL). - self.require_bare(cached_path, specifier, ctx) - } - }; - - result.or_else(|err| { - if err.is_ignore() { - return Err(err); - } - // enhanced-resolve: try fallback - self.load_alias(cached_path, specifier, &self.options.fallback, ctx) - .and_then(|value| value.ok_or(err)) - }) - } - - // PACKAGE_RESOLVE(packageSpecifier, parentURL) - // 3. If packageSpecifier is a Node.js builtin module name, then - // 1. Return the string "node:" concatenated with packageSpecifier. - fn require_core(&self, specifier: &str) -> Result<(), ResolveError> { - if self.options.builtin_modules { - let starts_with_node = specifier.starts_with("node:"); - if starts_with_node || NODEJS_BUILTINS.binary_search(&specifier).is_ok() { - let mut specifier = specifier.to_string(); - if !starts_with_node { - specifier = format!("node:{specifier}"); - } - return Err(ResolveError::Builtin(specifier)); - } - } - Ok(()) - } - - fn require_absolute( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - // Make sure only path prefixes gets called - debug_assert!(Path::new(specifier) - .components() - .next() - .is_some_and(|c| matches!(c, Component::RootDir | Component::Prefix(_)))); - if !self.options.prefer_relative && self.options.prefer_absolute { - if let Ok(path) = self.load_package_self_or_node_modules(cached_path, specifier, ctx) { - return Ok(path); - } - } - if let Some(path) = self.load_roots(specifier, ctx) { - return Ok(path); - } - // 2. If X begins with '/' - // a. set Y to be the file system root - let path = self.cache.value(Path::new(specifier)); - if let Some(path) = self.load_as_file_or_directory(&path, specifier, ctx)? { - return Ok(path); - } - Err(ResolveError::NotFound(specifier.to_string())) - } - - // 3. If X begins with './' or '/' or '../' - fn require_relative( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - // Make sure only relative or normal paths gets called - debug_assert!(Path::new(specifier).components().next().is_some_and(|c| matches!( - c, - Component::CurDir | Component::ParentDir | Component::Normal(_) - ))); - let path = cached_path.path().normalize_with(specifier); - let cached_path = self.cache.value(&path); - // a. LOAD_AS_FILE(Y + X) - // b. LOAD_AS_DIRECTORY(Y + X) - if let Some(path) = self.load_as_file_or_directory(&cached_path, specifier, ctx)? { - return Ok(path); - } - // c. THROW "not found" - Err(ResolveError::NotFound(specifier.to_string())) - } - - fn require_hash( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - debug_assert_eq!(specifier.chars().next(), Some('#')); - // a. LOAD_PACKAGE_IMPORTS(X, dirname(Y)) - if let Some(path) = self.load_package_imports(cached_path, specifier, ctx)? { - return Ok(path); - } - self.load_package_self_or_node_modules(cached_path, specifier, ctx) - } - - fn require_bare( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - // Make sure no other path prefixes gets called - debug_assert!(Path::new(specifier) - .components() - .next() - .is_some_and(|c| matches!(c, Component::Normal(_)))); - if self.options.prefer_relative { - if let Ok(path) = self.require_relative(cached_path, specifier, ctx) { - return Ok(path); - } - } - self.load_package_self_or_node_modules(cached_path, specifier, ctx) - } - - /// enhanced-resolve: ParsePlugin. - /// - /// 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`. - /// - /// - fn load_parse<'s>( - &self, - cached_path: &CachedPath, - specifier: &'s str, - ctx: &mut Ctx, - ) -> Result<(Specifier<'s>, Option), ResolveError> { - let parsed = Specifier::parse(specifier).map_err(ResolveError::Specifier)?; - ctx.with_query_fragment(parsed.query, parsed.fragment); - - // There is an edge-case where a request with # can be a path or a fragment -> try both - if ctx.fragment.is_some() && ctx.query.is_none() { - let specifier = parsed.path(); - let fragment = ctx.fragment.take().unwrap(); - let path = format!("{specifier}{fragment}"); - if let Ok(path) = self.require_without_parse(cached_path, &path, ctx) { - return Ok((parsed, Some(path))); - } - ctx.fragment.replace(fragment); - } - Ok((parsed, None)) - } - - fn load_package_self_or_node_modules( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - let (_, subpath) = Self::parse_package_specifier(specifier); - if subpath.is_empty() { - ctx.with_fully_specified(false); - } - // 5. LOAD_PACKAGE_SELF(X, dirname(Y)) - if let Some(path) = self.load_package_self(cached_path, specifier, ctx)? { - return Ok(path); - } - // 6. LOAD_NODE_MODULES(X, dirname(Y)) - if let Some(path) = self.load_node_modules(cached_path, specifier, ctx)? { - return Ok(path); - } - // 7. THROW "not found" - Err(ResolveError::NotFound(specifier.to_string())) - } - - /// LOAD_PACKAGE_IMPORTS(X, DIR) - fn load_package_imports( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - // 1. Find the closest package scope SCOPE to DIR. - // 2. If no scope was found, return. - let Some(package_json) = - cached_path.find_package_json(&self.cache.fs, &self.options, ctx)? - else { - return Ok(None); - }; - // 3. If the SCOPE/package.json "imports" is null or undefined, return. - // 4. let MATCH = PACKAGE_IMPORTS_RESOLVE(X, pathToFileURL(SCOPE), ["node", "require"]) defined in the ESM resolver. - if let Some(path) = self.package_imports_resolve(specifier, &package_json, ctx)? { - // 5. RESOLVE_ESM_MATCH(MATCH). - return self.resolve_esm_match(specifier, &path, ctx); - } - Ok(None) - } - - fn load_as_file(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - // enhanced-resolve feature: extension_alias - if let Some(path) = self.load_extension_alias(cached_path, ctx)? { - return Ok(Some(path)); - } - if self.options.enforce_extension.is_disabled() { - // 1. If X is a file, load X as its file extension format. STOP - if let Some(path) = self.load_alias_or_file(cached_path, ctx)? { - return Ok(Some(path)); - } - } - // 2. If X.js is a file, load X.js as JavaScript text. STOP - // 3. If X.json is a file, parse X.json to a JavaScript Object. STOP - // 4. If X.node is a file, load X.node as binary addon. STOP - if let Some(path) = - self.load_extensions(cached_path.path(), &self.options.extensions, ctx)? - { - return Ok(Some(path)); - } - Ok(None) - } - - fn load_as_directory(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - // TODO: Only package.json is supported, so warn about having other values - // Checking for empty files is needed for omitting checks on package.json - // 1. If X/package.json is a file, - if !self.options.description_files.is_empty() { - // a. Parse X/package.json, and look for "main" field. - if let Some(package_json) = - cached_path.package_json(&self.cache.fs, &self.options, ctx)? - { - // b. If "main" is a falsy value, GOTO 2. - for main_field in package_json.main_fields(&self.options.main_fields) { - // c. let M = X + (json main field) - let main_field_path = cached_path.path().normalize_with(main_field); - // d. LOAD_AS_FILE(M) - let cached_path = self.cache.value(&main_field_path); - if let Some(path) = self.load_as_file(&cached_path, ctx)? { - return Ok(Some(path)); - } - // e. LOAD_INDEX(M) - if let Some(path) = self.load_index(&cached_path, ctx)? { - return Ok(Some(path)); - } - } - // f. LOAD_INDEX(X) DEPRECATED - // g. THROW "not found" - } - } - // 2. LOAD_INDEX(X) - self.load_index(cached_path, ctx) - } - - fn load_as_file_or_directory( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - if self.options.resolve_to_context { - return Ok(cached_path.is_dir(&self.cache.fs, ctx).then(|| cached_path.clone())); - } - if !specifier.ends_with('/') { - if let Some(path) = self.load_as_file(cached_path, ctx)? { - return Ok(Some(path)); - } - } - if cached_path.is_dir(&self.cache.fs, ctx) { - if let Some(path) = self.load_as_directory(cached_path, ctx)? { - return Ok(Some(path)); - } - } - Ok(None) - } - - fn load_extensions(&self, path: &Path, extensions: &[String], ctx: &mut Ctx) -> ResolveResult { - if ctx.fully_specified { - return Ok(None); - } - let path = path.as_os_str(); - for extension in extensions { - let mut path_with_extension = path.to_os_string(); - path_with_extension.reserve_exact(extension.len()); - path_with_extension.push(extension); - let cached_path = self.cache.value(Path::new(&path_with_extension)); - if let Some(path) = self.load_alias_or_file(&cached_path, ctx)? { - return Ok(Some(path)); - } - } - Ok(None) - } - - fn load_realpath(&self, cached_path: &CachedPath) -> Result { - if self.options.symlinks { - cached_path.realpath(&self.cache.fs).map_err(ResolveError::from) - } else { - Ok(cached_path.to_path_buf()) - } - } - - fn check_restrictions(&self, path: &Path) -> Result<(), ResolveError> { - // https://github.com/webpack/enhanced-resolve/blob/a998c7d218b7a9ec2461fc4fddd1ad5dd7687485/lib/RestrictionsPlugin.js#L19-L24 - fn is_inside(path: &Path, parent: &Path) -> bool { - if !path.starts_with(parent) { - return false; - } - if path.as_os_str().len() == parent.as_os_str().len() { - return true; - } - path.strip_prefix(parent).is_ok_and(|p| p == Path::new("./")) - } - for restriction in &self.options.restrictions { - match restriction { - Restriction::Path(restricted_path) => { - if !is_inside(path, restricted_path) { - return Err(ResolveError::Restriction( - path.to_path_buf(), - restricted_path.clone(), - )); - } - } - Restriction::RegExp(_) => { - return Err(ResolveError::Unimplemented("Restriction with regex")) - } - } - } - Ok(()) - } - - fn load_index(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - for main_file in &self.options.main_files { - let main_path = cached_path.path().normalize_with(main_file); - let cached_path = self.cache.value(&main_path); - if self.options.enforce_extension.is_disabled() { - if let Some(path) = self.load_alias_or_file(&cached_path, ctx)? { - return Ok(Some(path)); - } - } - // 1. If X/index.js is a file, load X/index.js as JavaScript text. STOP - // 2. If X/index.json is a file, parse X/index.json to a JavaScript object. STOP - // 3. If X/index.node is a file, load X/index.node as binary addon. STOP - if let Some(path) = - self.load_extensions(cached_path.path(), &self.options.extensions, ctx)? - { - return Ok(Some(path)); - } - } - Ok(None) - } - - fn load_alias_or_file(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - if !self.options.alias_fields.is_empty() { - if let Some(package_json) = - cached_path.find_package_json(&self.cache.fs, &self.options, ctx)? - { - if let Some(path) = - self.load_browser_field(cached_path, None, &package_json, ctx)? - { - return Ok(Some(path)); - } - } - } - // enhanced-resolve: try file as alias - let alias_specifier = cached_path.path().to_string_lossy(); - if let Some(path) = - self.load_alias(cached_path, &alias_specifier, &self.options.alias, ctx)? - { - return Ok(Some(path)); - } - if cached_path.is_file(&self.cache.fs, ctx) { - return Ok(Some(cached_path.clone())); - } - Ok(None) - } - - fn load_node_modules( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - let (package_name, subpath) = Self::parse_package_specifier(specifier); - // 1. let DIRS = NODE_MODULES_PATHS(START) - // 2. for each DIR in DIRS: - for module_name in &self.options.modules { - for cached_path in std::iter::successors(Some(cached_path), |p| p.parent()) { - // Skip if /path/to/node_modules does not exist - if !cached_path.is_dir(&self.cache.fs, ctx) { - continue; - } - - let Some(cached_path) = self.get_module_directory(cached_path, module_name, ctx) - else { - continue; - }; - // Optimize node_modules lookup by inspecting whether the package exists - // From LOAD_PACKAGE_EXPORTS(X, DIR) - // 1. Try to interpret X as a combination of NAME and SUBPATH where the name - // may have a @scope/ prefix and the subpath begins with a slash (`/`). - if !package_name.is_empty() { - let package_path = cached_path.path().normalize_with(package_name); - let cached_path = self.cache.value(&package_path); - // Try foo/node_modules/package_name - if cached_path.is_dir(&self.cache.fs, ctx) { - // a. LOAD_PACKAGE_EXPORTS(X, DIR) - if let Some(path) = - self.load_package_exports(specifier, subpath, &cached_path, ctx)? - { - return Ok(Some(path)); - } - } else { - // foo/node_modules/package_name is not a directory, so useless to check inside it - if !subpath.is_empty() { - continue; - } - // Skip if the directory lead to the scope package does not exist - // i.e. `foo/node_modules/@scope` is not a directory for `foo/node_modules/@scope/package` - if package_name.starts_with('@') { - if let Some(path) = cached_path.parent() { - if !path.is_dir(&self.cache.fs, ctx) { - continue; - } - } - } - } - } - - // Try as file or directory for all other cases - // b. LOAD_AS_FILE(DIR/X) - // c. LOAD_AS_DIRECTORY(DIR/X) - let node_module_file = cached_path.path().normalize_with(specifier); - let cached_path = self.cache.value(&node_module_file); - if let Some(path) = self.load_as_file_or_directory(&cached_path, specifier, ctx)? { - return Ok(Some(path)); - } - } - } - Ok(None) - } - - fn get_module_directory( - &self, - cached_path: &CachedPath, - module_name: &str, - ctx: &mut Ctx, - ) -> Option { - if module_name == "node_modules" { - cached_path.cached_node_modules(&self.cache, ctx) - } else if cached_path.path().components().next_back() - == Some(Component::Normal(OsStr::new(module_name))) - { - Some(cached_path.clone()) - } else { - cached_path.module_directory(module_name, &self.cache, ctx) - } - } - - fn load_package_exports( - &self, - specifier: &str, - subpath: &str, - cached_path: &CachedPath, - ctx: &mut Ctx, - ) -> ResolveResult { - // 2. If X does not match this pattern or DIR/NAME/package.json is not a file, - // return. - let Some(package_json) = cached_path.package_json(&self.cache.fs, &self.options, ctx)? - else { - return Ok(None); - }; - // 3. Parse DIR/NAME/package.json, and look for "exports" field. - // 4. If "exports" is null or undefined, return. - // 5. let MATCH = PACKAGE_EXPORTS_RESOLVE(pathToFileURL(DIR/NAME), "." + SUBPATH, - // `package.json` "exports", ["node", "require"]) defined in the ESM resolver. - // Note: The subpath is not prepended with a dot on purpose - for exports in package_json.exports_fields(&self.options.exports_fields) { - if let Some(path) = self.package_exports_resolve( - cached_path.path(), - &format!(".{subpath}"), - exports, - ctx, - )? { - // 6. RESOLVE_ESM_MATCH(MATCH) - return self.resolve_esm_match(specifier, &path, ctx); - }; - } - Ok(None) - } - - fn load_package_self( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - // 1. Find the closest package scope SCOPE to DIR. - // 2. If no scope was found, return. - let Some(package_json) = - cached_path.find_package_json(&self.cache.fs, &self.options, ctx)? - else { - return Ok(None); - }; - // 3. If the SCOPE/package.json "exports" is null or undefined, return. - // 4. If the SCOPE/package.json "name" is not the first segment of X, return. - if let Some(subpath) = package_json - .name - .as_ref() - .and_then(|package_name| Self::strip_package_name(specifier, package_name)) - { - // 5. let MATCH = PACKAGE_EXPORTS_RESOLVE(pathToFileURL(SCOPE), - // "." + X.slice("name".length), `package.json` "exports", ["node", "require"]) - // defined in the ESM resolver. - let package_url = package_json.directory(); - // Note: The subpath is not prepended with a dot on purpose - // because `package_exports_resolve` matches subpath without the leading dot. - for exports in package_json.exports_fields(&self.options.exports_fields) { - if let Some(cached_path) = - self.package_exports_resolve(package_url, &format!(".{subpath}"), exports, ctx)? - { - // 6. RESOLVE_ESM_MATCH(MATCH) - return self.resolve_esm_match(specifier, &cached_path, ctx); - } - } - } - self.load_browser_field(cached_path, Some(specifier), &package_json, ctx) - } - - /// RESOLVE_ESM_MATCH(MATCH) - fn resolve_esm_match( - &self, - specifier: &str, - cached_path: &CachedPath, - ctx: &mut Ctx, - ) -> ResolveResult { - // 1. let RESOLVED_PATH = fileURLToPath(MATCH) - // 2. If the file at RESOLVED_PATH exists, load RESOLVED_PATH as its extension format. STOP - // - // Non-compliant ESM can result in a directory, so directory is tried as well. - if let Some(path) = self.load_as_file_or_directory(cached_path, "", ctx)? { - return Ok(Some(path)); - } - // 3. THROW "not found" - Err(ResolveError::NotFound(specifier.to_string())) - } - - /// enhanced-resolve: AliasFieldPlugin for [ResolveOptions::alias_fields] - fn load_browser_field( - &self, - cached_path: &CachedPath, - module_specifier: Option<&str>, - package_json: &PackageJson, - ctx: &mut Ctx, - ) -> ResolveResult { - let path = cached_path.path(); - let Some(new_specifier) = package_json.resolve_browser_field( - path, - module_specifier, - &self.options.alias_fields, - )? - else { - return Ok(None); - }; - // Abort when resolving recursive module - if module_specifier.is_some_and(|s| s == new_specifier) { - return Ok(None); - } - if ctx.resolving_alias.as_ref().is_some_and(|s| s == new_specifier) { - // Complete when resolving to self `{"./a.js": "./a.js"}` - if new_specifier.strip_prefix("./").filter(|s| path.ends_with(Path::new(s))).is_some() { - return if cached_path.is_file(&self.cache.fs, ctx) { - Ok(Some(cached_path.clone())) - } else { - Err(ResolveError::NotFound(new_specifier.to_string())) - }; - } - return Err(ResolveError::Recursion); - } - ctx.with_resolving_alias(new_specifier.to_string()); - ctx.with_fully_specified(false); - let cached_path = self.cache.value(package_json.directory()); - self.require(&cached_path, new_specifier, ctx).map(Some) - } - - /// enhanced-resolve: AliasPlugin for [ResolveOptions::alias] and [ResolveOptions::fallback]. - fn load_alias( - &self, - cached_path: &CachedPath, - specifier: &str, - aliases: &Alias, - ctx: &mut Ctx, - ) -> ResolveResult { - for (alias_key_raw, specifiers) in aliases { - let alias_key = if let Some(alias_key) = alias_key_raw.strip_suffix('$') { - if alias_key != specifier { - continue; - } - alias_key - } else { - let strip_package_name = Self::strip_package_name(specifier, alias_key_raw); - if strip_package_name.is_none() { - continue; - } - alias_key_raw - }; - // It should stop resolving when all of the tried alias values - // failed to resolve. - // - let mut should_stop = false; - for r in specifiers { - match r { - AliasValue::Path(alias_value) => { - if let Some(path) = self.load_alias_value( - cached_path, - alias_key, - alias_value, - specifier, - ctx, - &mut should_stop, - )? { - return Ok(Some(path)); - } - } - AliasValue::Ignore => { - let path = cached_path.path().normalize_with(alias_key); - return Err(ResolveError::Ignored(path)); - } - } - } - if should_stop { - return Err(ResolveError::NotFound(specifier.to_string())); - } - } - Ok(None) - } - - fn load_alias_value( - &self, - cached_path: &CachedPath, - alias_key: &str, - alias_value: &str, - request: &str, - ctx: &mut Ctx, - should_stop: &mut bool, - ) -> ResolveResult { - if request != alias_value - && !request.strip_prefix(alias_value).is_some_and(|prefix| prefix.starts_with('/')) - { - let tail = &request[alias_key.len()..]; - - let new_specifier = if tail.is_empty() { - Cow::Borrowed(alias_value) - } else { - let alias_value = Path::new(alias_value).normalize(); - // Must not append anything to alias_value if it is a file. - let alias_value_cached_path = self.cache.value(&alias_value); - if alias_value_cached_path.is_file(&self.cache.fs, ctx) { - return Ok(None); - } - - // Remove the leading slash so the final path is concatenated. - let tail = tail.trim_start_matches(SLASH_START); - let normalized = alias_value.normalize_with(tail); - Cow::Owned(normalized.to_string_lossy().to_string()) - }; - - *should_stop = true; - ctx.with_fully_specified(false); - return match self.require(cached_path, new_specifier.as_ref(), ctx) { - Err(ResolveError::NotFound(_)) => Ok(None), - Ok(path) => return Ok(Some(path)), - Err(err) => return Err(err), - }; - } - Ok(None) - } - - /// Given an extension alias map `{".js": [".ts", "js"]}`, - /// load the mapping instead of the provided extension - /// - /// This is an enhanced-resolve feature - /// - /// # Errors - /// - /// * [ResolveError::ExtensionAlias]: When all of the aliased extensions are not found - fn load_extension_alias(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - if self.options.extension_alias.is_empty() { - return Ok(None); - } - let Some(path_extension) = cached_path.path().extension() else { - return Ok(None); - }; - let Some((_, extensions)) = self - .options - .extension_alias - .iter() - .find(|(ext, _)| OsStr::new(ext.trim_start_matches('.')) == path_extension) - else { - return Ok(None); - }; - let path = cached_path.path().with_extension(""); - ctx.with_fully_specified(false); - if let Some(path) = self.load_extensions(&path, extensions, ctx)? { - return Ok(Some(path)); - } - Err(ResolveError::ExtensionAlias) - } - - /// enhanced-resolve: RootsPlugin - /// - /// A list of directories where requests of server-relative URLs (starting with '/') are resolved, - /// defaults to context configuration option. - /// - /// On non-Windows systems these requests are resolved as an absolute path first. - fn load_roots(&self, specifier: &str, ctx: &mut Ctx) -> Option { - if self.options.roots.is_empty() { - return None; - } - if let Some(specifier) = specifier.strip_prefix(SLASH_START) { - for root in &self.options.roots { - let cached_path = self.cache.value(root); - if let Ok(path) = self.require_relative(&cached_path, specifier, ctx) { - return Some(path); - } - } - } - None - } - - fn load_tsconfig_paths( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - let Some(tsconfig_options) = &self.options.tsconfig else { - return Ok(None); - }; - let tsconfig = self.load_tsconfig( - /* root */ true, - &tsconfig_options.config_file, - &tsconfig_options.references, - )?; - let paths = tsconfig.resolve(cached_path.path(), specifier); - for path in paths { - let cached_path = self.cache.value(&path); - if let Ok(path) = self.require_relative(&cached_path, ".", ctx) { - return Ok(Some(path)); - } - } - Ok(None) - } - - fn load_tsconfig( - &self, - root: bool, - path: &Path, - references: &TsconfigReferences, - ) -> Result, ResolveError> { - self.cache.tsconfig(root, path, |tsconfig| { - let directory = self.cache.value(tsconfig.directory()); - tracing::trace!(tsconfig = ?tsconfig, "load_tsconfig"); - - // Extend tsconfig - if let Some(extends) = &tsconfig.extends { - let extended_tsconfig_paths = match extends { - ExtendsField::Single(s) => { - vec![self.get_extended_tsconfig_path(&directory, tsconfig, s)?] - } - ExtendsField::Multiple(specifiers) => specifiers - .iter() - .map(|s| self.get_extended_tsconfig_path(&directory, tsconfig, s)) - .collect::, ResolveError>>()?, - }; - for extended_tsconfig_path in extended_tsconfig_paths { - let extended_tsconfig = self.load_tsconfig( - /* root */ false, - &extended_tsconfig_path, - &TsconfigReferences::Disabled, - )?; - tsconfig.extend_tsconfig(&extended_tsconfig); - } - } - - // Load project references - match references { - TsconfigReferences::Disabled => { - tsconfig.references.drain(..); - } - TsconfigReferences::Auto => {} - TsconfigReferences::Paths(paths) => { - tsconfig.references = paths - .iter() - .map(|path| ProjectReference { path: path.clone(), tsconfig: None }) - .collect(); - } - } - if !tsconfig.references.is_empty() { - let directory = tsconfig.directory().to_path_buf(); - for reference in &mut tsconfig.references { - let reference_tsconfig_path = directory.normalize_with(&reference.path); - let tsconfig = self.cache.tsconfig( - /* root */ true, - &reference_tsconfig_path, - |reference_tsconfig| { - if reference_tsconfig.path == tsconfig.path { - return Err(ResolveError::TsconfigSelfReference( - reference_tsconfig.path.clone(), - )); - } - Ok(()) - }, - )?; - reference.tsconfig.replace(tsconfig); - } - } - Ok(()) - }) - } - - fn get_extended_tsconfig_path( - &self, - directory: &CachedPath, - tsconfig: &TsConfig, - specifier: &str, - ) -> Result { - match specifier.as_bytes().first() { - None => Err(ResolveError::Specifier(SpecifierError::Empty(specifier.to_string()))), - Some(b'/') => Ok(PathBuf::from(specifier)), - Some(b'.') => Ok(tsconfig.directory().normalize_with(specifier)), - _ => self - .clone_with_options(ResolveOptions { - description_files: vec![], - extensions: vec![".json".into()], - main_files: vec!["tsconfig.json".into()], - ..ResolveOptions::default() - }) - .load_package_self_or_node_modules(directory, specifier, &mut Ctx::default()) - .map(|p| p.to_path_buf()) - .map_err(|err| match err { - ResolveError::NotFound(_) => { - ResolveError::TsconfigNotFound(PathBuf::from(specifier)) - } - _ => err, - }), - } - } - - /// PACKAGE_RESOLVE(packageSpecifier, parentURL) - fn package_resolve( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - let (package_name, subpath) = Self::parse_package_specifier(specifier); - - // 3. If packageSpecifier is a Node.js builtin module name, then - // 1. Return the string "node:" concatenated with packageSpecifier. - self.require_core(package_name)?; - - // 11. While parentURL is not the file system root, - for module_name in &self.options.modules { - for cached_path in std::iter::successors(Some(cached_path), |p| p.parent()) { - // 1. Let packageURL be the URL resolution of "node_modules/" concatenated with packageSpecifier, relative to parentURL. - let Some(cached_path) = self.get_module_directory(cached_path, module_name, ctx) - else { - continue; - }; - // 2. Set parentURL to the parent folder URL of parentURL. - let package_path = cached_path.path().normalize_with(package_name); - let cached_path = self.cache.value(&package_path); - // 3. If the folder at packageURL does not exist, then - // 1. Continue the next loop iteration. - if cached_path.is_dir(&self.cache.fs, ctx) { - // 4. Let pjson be the result of READ_PACKAGE_JSON(packageURL). - if let Some(package_json) = - cached_path.package_json(&self.cache.fs, &self.options, ctx)? - { - // 5. If pjson is not null and pjson.exports is not null or undefined, then - // 1. Return the result of PACKAGE_EXPORTS_RESOLVE(packageURL, packageSubpath, pjson.exports, defaultConditions). - for exports in package_json.exports_fields(&self.options.exports_fields) { - if let Some(path) = self.package_exports_resolve( - cached_path.path(), - &format!(".{subpath}"), - exports, - ctx, - )? { - return Ok(Some(path)); - } - } - // 6. Otherwise, if packageSubpath is equal to ".", then - if subpath == "." { - // 1. If pjson.main is a string, then - for main_field in package_json.main_fields(&self.options.main_fields) { - // 1. Return the URL resolution of main in packageURL. - let path = cached_path.path().normalize_with(main_field); - let cached_path = self.cache.value(&path); - if cached_path.is_file(&self.cache.fs, ctx) { - return Ok(Some(cached_path)); - } - } - } - } - let subpath = format!(".{subpath}"); - ctx.with_fully_specified(false); - return self.require(&cached_path, &subpath, ctx).map(Some); - } - } - } - - Err(ResolveError::NotFound(specifier.to_string())) - } - - /// PACKAGE_EXPORTS_RESOLVE(packageURL, subpath, exports, conditions) - fn package_exports_resolve( - &self, - package_url: &Path, - subpath: &str, - exports: &JSONValue, - ctx: &mut Ctx, - ) -> ResolveResult { - let conditions = &self.options.condition_names; - // 1. If exports is an Object with both a key starting with "." and a key not starting with ".", throw an Invalid Package Configuration error. - if let JSONValue::Object(map) = exports { - let mut has_dot = false; - let mut without_dot = false; - for key in map.keys() { - has_dot = has_dot || key.starts_with(|s| s == '.' || s == '#'); - without_dot = without_dot || !key.starts_with(|s| s == '.' || s == '#'); - if has_dot && without_dot { - return Err(ResolveError::InvalidPackageConfig( - package_url.join("package.json"), - )); - } - } - } - // 2. If subpath is equal to ".", then - // Note: subpath is not prepended with a dot when passed in. - if subpath == "." { - // enhanced-resolve appends query and fragment when resolving exports field - // https://github.com/webpack/enhanced-resolve/blob/a998c7d218b7a9ec2461fc4fddd1ad5dd7687485/lib/ExportsFieldPlugin.js#L57-L62 - // This is only need when querying the main export, otherwise ctx is passed through. - if ctx.query.is_some() || ctx.fragment.is_some() { - let query = ctx.query.clone().unwrap_or_default(); - let fragment = ctx.fragment.clone().unwrap_or_default(); - return Err(ResolveError::PackagePathNotExported( - format!("./{}{query}{fragment}", subpath.trim_start_matches('.')), - package_url.join("package.json"), - )); - } - // 1. Let mainExport be undefined. - let main_export = match exports { - // 2. If exports is a String or Array, or an Object containing no keys starting with ".", then - JSONValue::String(_) | JSONValue::Array(_) => { - // 1. Set mainExport to exports. - Some(exports) - } - // 3. Otherwise if exports is an Object containing a "." property, then - JSONValue::Object(map) => { - // 1. Set mainExport to exports["."]. - map.get(".").map_or_else( - || { - if map.keys().any(|key| key.starts_with("./") || key.starts_with('#')) { - None - } else { - Some(exports) - } - }, - Some, - ) - } - _ => None, - }; - // 4. If mainExport is not undefined, then - if let Some(main_export) = main_export { - // 1. Let resolved be the result of PACKAGE_TARGET_RESOLVE( packageURL, mainExport, null, false, conditions). - let resolved = self.package_target_resolve( - package_url, - ".", - main_export, - None, - /* is_imports */ false, - conditions, - ctx, - )?; - // 2. If resolved is not null or undefined, return resolved. - if let Some(path) = resolved { - return Ok(Some(path)); - } - } - } - // 3. Otherwise, if exports is an Object and all keys of exports start with ".", then - if let JSONValue::Object(exports) = exports { - // 1. Let matchKey be the string "./" concatenated with subpath. - // Note: `package_imports_exports_resolve` does not require the leading dot. - let match_key = &subpath; - // 2. Let resolved be the result of PACKAGE_IMPORTS_EXPORTS_RESOLVE( matchKey, exports, packageURL, false, conditions). - if let Some(path) = self.package_imports_exports_resolve( - match_key, - exports, - package_url, - /* is_imports */ false, - conditions, - ctx, - )? { - // 3. If resolved is not null or undefined, return resolved. - return Ok(Some(path)); - } - } - // 4. Throw a Package Path Not Exported error. - Err(ResolveError::PackagePathNotExported( - subpath.to_string(), - package_url.join("package.json"), - )) - } - - /// PACKAGE_IMPORTS_RESOLVE(specifier, parentURL, conditions) - fn package_imports_resolve( - &self, - specifier: &str, - package_json: &PackageJson, - ctx: &mut Ctx, - ) -> Result, ResolveError> { - // 1. Assert: specifier begins with "#". - debug_assert!(specifier.starts_with('#'), "{specifier}"); - // 2. If specifier is exactly equal to "#" or starts with "#/", then - // 1. Throw an Invalid Module Specifier error. - // 3. Let packageURL be the result of LOOKUP_PACKAGE_SCOPE(parentURL). - // 4. If packageURL is not null, then - - // 1. Let pjson be the result of READ_PACKAGE_JSON(packageURL). - // 2. If pjson.imports is a non-null Object, then - - // 1. Let resolved be the result of PACKAGE_IMPORTS_EXPORTS_RESOLVE( specifier, pjson.imports, packageURL, true, conditions). - let mut has_imports = false; - for imports in package_json.imports_fields(&self.options.imports_fields) { - if !has_imports { - has_imports = true; - // TODO: fill in test case for this case - if specifier == "#" || specifier.starts_with("#/") { - return Err(ResolveError::InvalidModuleSpecifier( - specifier.to_string(), - package_json.path.clone(), - )); - } - } - if let Some(path) = self.package_imports_exports_resolve( - specifier, - imports, - package_json.directory(), - /* is_imports */ true, - &self.options.condition_names, - ctx, - )? { - // 2. If resolved is not null or undefined, return resolved. - return Ok(Some(path)); - } - } - - // 5. Throw a Package Import Not Defined error. - if has_imports { - Err(ResolveError::PackageImportNotDefined( - specifier.to_string(), - package_json.path.clone(), - )) - } else { - Ok(None) - } - } - - /// PACKAGE_IMPORTS_EXPORTS_RESOLVE(matchKey, matchObj, packageURL, isImports, conditions) - fn package_imports_exports_resolve( - &self, - match_key: &str, - match_obj: &JSONMap, - package_url: &Path, - is_imports: bool, - conditions: &[String], - ctx: &mut Ctx, - ) -> ResolveResult { - // enhanced-resolve behaves differently, it throws - // Error: CachedPath to directories is not possible with the exports field (specifier was ./dist/) - if match_key.ends_with('/') { - return Ok(None); - } - // 1. If matchKey is a key of matchObj and does not contain "*", then - if !match_key.contains('*') { - // 1. Let target be the value of matchObj[matchKey]. - if let Some(target) = match_obj.get(match_key) { - // 2. Return the result of PACKAGE_TARGET_RESOLVE(packageURL, target, null, isImports, conditions). - return self.package_target_resolve( - package_url, - match_key, - target, - None, - is_imports, - conditions, - ctx, - ); - } - } - - let mut best_target = None; - let mut best_match = ""; - let mut best_key = ""; - // 2. Let expansionKeys be the list of keys of matchObj containing only a single "*", sorted by the sorting function PATTERN_KEY_COMPARE which orders in descending order of specificity. - // 3. For each key expansionKey in expansionKeys, do - for (expansion_key, target) in match_obj { - if expansion_key.starts_with("./") || expansion_key.starts_with('#') { - // 1. Let patternBase be the substring of expansionKey up to but excluding the first "*" character. - if let Some((pattern_base, pattern_trailer)) = expansion_key.split_once('*') { - // 2. If matchKey starts with but is not equal to patternBase, then - if match_key.starts_with(pattern_base) - // 1. Let patternTrailer be the substring of expansionKey from the index after the first "*" character. - && !pattern_trailer.contains('*') - // 2. If patternTrailer has zero length, or if matchKey ends with patternTrailer and the length of matchKey is greater than or equal to the length of expansionKey, then - && (pattern_trailer.is_empty() - || (match_key.len() >= expansion_key.len() - && match_key.ends_with(pattern_trailer))) - && Self::pattern_key_compare(best_key, expansion_key).is_gt() - { - // 1. Let target be the value of matchObj[expansionKey]. - best_target = Some(target); - // 2. Let patternMatch be the substring of matchKey starting at the index of the length of patternBase up to the length of matchKey minus the length of patternTrailer. - best_match = - &match_key[pattern_base.len()..match_key.len() - pattern_trailer.len()]; - best_key = expansion_key; - } - } else if expansion_key.ends_with('/') - && match_key.starts_with(expansion_key) - && Self::pattern_key_compare(best_key, expansion_key).is_gt() - { - // TODO: [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./dist/" in the "exports" field module resolution of the package at xxx/package.json. - best_target = Some(target); - best_match = &match_key[expansion_key.len()..]; - best_key = expansion_key; - } - } - } - if let Some(best_target) = best_target { - // 3. Return the result of PACKAGE_TARGET_RESOLVE(packageURL, target, patternMatch, isImports, conditions). - return self.package_target_resolve( - package_url, - best_key, - best_target, - Some(best_match), - is_imports, - conditions, - ctx, - ); - } - // 4. Return null. - Ok(None) - } - - /// PACKAGE_TARGET_RESOLVE(packageURL, target, patternMatch, isImports, conditions) - #[allow(clippy::too_many_arguments)] - fn package_target_resolve( - &self, - package_url: &Path, - target_key: &str, - target: &JSONValue, - pattern_match: Option<&str>, - is_imports: bool, - conditions: &[String], - ctx: &mut Ctx, - ) -> ResolveResult { - fn normalize_string_target<'a>( - target_key: &'a str, - target: &'a str, - pattern_match: Option<&'a str>, - package_url: &Path, - ) -> Result, ResolveError> { - let target = if let Some(pattern_match) = pattern_match { - if !target_key.contains('*') && !target.contains('*') { - // enhanced-resolve behaviour - // TODO: [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./dist/" in the "exports" field module resolution of the package at xxx/package.json. - if target_key.ends_with('/') && target.ends_with('/') { - Cow::Owned(format!("{target}{pattern_match}")) - } else { - return Err(ResolveError::InvalidPackageConfigDirectory( - package_url.join("package.json"), - )); - } - } else { - Cow::Owned(target.replace('*', pattern_match)) - } - } else { - Cow::Borrowed(target) - }; - Ok(target) - } - - match target { - // 1. If target is a String, then - JSONValue::String(target) => { - // 1. If target does not start with "./", then - if !target.starts_with("./") { - // 1. If isImports is false, or if target starts with "../" or "/", or if target is a valid URL, then - if !is_imports || target.starts_with("../") || target.starts_with('/') { - // 1. Throw an Invalid Package Target error. - return Err(ResolveError::InvalidPackageTarget( - target.to_string(), - target_key.to_string(), - package_url.join("package.json"), - )); - } - // 2. If patternMatch is a String, then - // 1. Return PACKAGE_RESOLVE(target with every instance of "*" replaced by patternMatch, packageURL + "/"). - let target = - normalize_string_target(target_key, target, pattern_match, package_url)?; - let package_url = self.cache.value(package_url); - // // 3. Return PACKAGE_RESOLVE(target, packageURL + "/"). - return self.package_resolve(&package_url, &target, ctx); - } - - // 2. If target split on "/" or "\" contains any "", ".", "..", or "node_modules" segments after the first "." segment, case insensitive and including percent encoded variants, throw an Invalid Package Target error. - // 3. Let resolvedTarget be the URL resolution of the concatenation of packageURL and target. - // 4. Assert: resolvedTarget is contained in packageURL. - // 5. If patternMatch is null, then - let target = - normalize_string_target(target_key, target, pattern_match, package_url)?; - if Path::new(target.as_ref()).is_invalid_exports_target() { - return Err(ResolveError::InvalidPackageTarget( - target.to_string(), - target_key.to_string(), - package_url.join("package.json"), - )); - } - let resolved_target = package_url.normalize_with(target.as_ref()); - // 6. If patternMatch split on "/" or "\" contains any "", ".", "..", or "node_modules" segments, case insensitive and including percent encoded variants, throw an Invalid Module Specifier error. - // 7. Return the URL resolution of resolvedTarget with every instance of "*" replaced with patternMatch. - let value = self.cache.value(&resolved_target); - return Ok(Some(value)); - } - // 2. Otherwise, if target is a non-null Object, then - JSONValue::Object(target) => { - // 1. If exports contains any index property keys, as defined in ECMA-262 6.1.7 Array Index, throw an Invalid Package Configuration error. - // 2. For each property p of target, in object insertion order as, - for (key, target_value) in target { - // 1. If p equals "default" or conditions contains an entry for p, then - if key == "default" || conditions.contains(key) { - // 1. Let targetValue be the value of the p property in target. - // 2. Let resolved be the result of PACKAGE_TARGET_RESOLVE( packageURL, targetValue, patternMatch, isImports, conditions). - let resolved = self.package_target_resolve( - package_url, - target_key, - target_value, - pattern_match, - is_imports, - conditions, - ctx, - ); - // 3. If resolved is equal to undefined, continue the loop. - if let Some(path) = resolved? { - // 4. Return resolved. - return Ok(Some(path)); - } - } - } - // 3. Return undefined. - return Ok(None); - } - // 3. Otherwise, if target is an Array, then - JSONValue::Array(targets) => { - // 1. If _target.length is zero, return null. - if targets.is_empty() { - // Note: return PackagePathNotExported has the same effect as return because there are no matches. - return Err(ResolveError::PackagePathNotExported( - pattern_match.unwrap_or(".").to_string(), - package_url.join("package.json"), - )); - } - // 2. For each item targetValue in target, do - for (i, target_value) in targets.iter().enumerate() { - // 1. Let resolved be the result of PACKAGE_TARGET_RESOLVE( packageURL, targetValue, patternMatch, isImports, conditions), continuing the loop on any Invalid Package Target error. - let resolved = self.package_target_resolve( - package_url, - target_key, - target_value, - pattern_match, - is_imports, - conditions, - ctx, - ); - - if resolved.is_err() && i == targets.len() { - return resolved; - } - - // 2. If resolved is undefined, continue the loop. - if let Ok(Some(path)) = resolved { - // 3. Return resolved. - return Ok(Some(path)); - } - } - // 3. Return or throw the last fallback resolution null return or error. - // Note: see `resolved.is_err() && i == targets.len()` - } - _ => {} - } - // 4. Otherwise, if target is null, return null. - Ok(None) - // 5. Otherwise throw an Invalid Package Target error. - } - - // Returns (module, subpath) - // https://github.com/nodejs/node/blob/8f0f17e1e3b6c4e58ce748e06343c5304062c491/lib/internal/modules/esm/resolve.js#L688 - fn parse_package_specifier(specifier: &str) -> (&str, &str) { - let mut separator_index = specifier.as_bytes().iter().position(|b| *b == b'/'); - // let mut valid_package_name = true; - // let mut is_scoped = false; - if specifier.starts_with('@') { - // is_scoped = true; - if separator_index.is_none() || specifier.is_empty() { - // valid_package_name = false; - } else if let Some(index) = &separator_index { - separator_index = specifier[*index + 1..] - .as_bytes() - .iter() - .position(|b| *b == b'/') - .map(|i| i + *index + 1); - } - } - let package_name = - separator_index.map_or(specifier, |separator_index| &specifier[..separator_index]); - - // TODO: https://github.com/nodejs/node/blob/8f0f17e1e3b6c4e58ce748e06343c5304062c491/lib/internal/modules/esm/resolve.js#L705C1-L714C1 - // Package name cannot have leading . and cannot have percent-encoding or - // \\ separators. - // if (RegExpPrototypeExec(invalidPackageNameRegEx, packageName) !== null) - // validPackageName = false; - - // if (!validPackageName) { - // throw new ERR_INVALID_MODULE_SPECIFIER( - // specifier, 'is not a valid package name', fileURLToPath(base)); - // } - let package_subpath = - separator_index.map_or("", |separator_index| &specifier[separator_index..]); - (package_name, package_subpath) - } - - /// PATTERN_KEY_COMPARE(keyA, keyB) - fn pattern_key_compare(key_a: &str, key_b: &str) -> Ordering { - if key_a.is_empty() { - return Ordering::Greater; - } - // 1. Assert: keyA ends with "/" or contains only a single "*". - debug_assert!(key_a.ends_with('/') || key_a.match_indices('*').count() == 1, "{key_a}"); - // 2. Assert: keyB ends with "/" or contains only a single "*". - debug_assert!(key_b.ends_with('/') || key_b.match_indices('*').count() == 1, "{key_b}"); - // 3. Let baseLengthA be the index of "*" in keyA plus one, if keyA contains "*", or the length of keyA otherwise. - let a_pos = key_a.chars().position(|c| c == '*'); - let base_length_a = a_pos.map_or(key_a.len(), |p| p + 1); - // 4. Let baseLengthB be the index of "*" in keyB plus one, if keyB contains "*", or the length of keyB otherwise. - let b_pos = key_b.chars().position(|c| c == '*'); - let base_length_b = b_pos.map_or(key_b.len(), |p| p + 1); - // 5. If baseLengthA is greater than baseLengthB, return -1. - if base_length_a > base_length_b { - return Ordering::Less; - } - // 6. If baseLengthB is greater than baseLengthA, return 1. - if base_length_b > base_length_a { - return Ordering::Greater; - } - // 7. If keyA does not contain "*", return 1. - if !key_a.contains('*') { - return Ordering::Greater; - } - // 8. If keyB does not contain "*", return -1. - if !key_b.contains('*') { - return Ordering::Less; - } - // 9. If the length of keyA is greater than the length of keyB, return -1. - if key_a.len() > key_b.len() { - return Ordering::Less; - } - // 10. If the length of keyB is greater than the length of keyA, return 1. - if key_b.len() > key_a.len() { - return Ordering::Greater; - } - // 11. Return 0. - Ordering::Equal - } - - fn strip_package_name<'a>(specifier: &'a str, package_name: &'a str) -> Option<&'a str> { - specifier - .strip_prefix(package_name) - .filter(|tail| tail.is_empty() || tail.starts_with(SLASH_START)) - } -} diff --git a/src/options.rs b/src/options.rs deleted file mode 100644 index f473a133..00000000 --- a/src/options.rs +++ /dev/null @@ -1,623 +0,0 @@ -use std::path::Path; -use std::{fmt, path::PathBuf}; - -/// Module Resolution Options -/// -/// Options are directly ported from [enhanced-resolve](https://github.com/webpack/enhanced-resolve#resolver-options). -/// -/// See [webpack resolve](https://webpack.js.org/configuration/resolve/) for information and examples -#[derive(Debug, Clone)] -pub struct ResolveOptions { - /// Path to TypeScript configuration file. - /// - /// Default `None` - pub tsconfig: Option, - - /// Create aliases to import or require certain modules more easily. - /// - /// An alias is used to replace a whole path or part of a path. - /// For example, to alias a commonly used `src/` folders: `vec![("@/src"), vec![AliasValue::Path("/path/to/src")]]` - /// - /// A trailing $ can also be added to the given object's keys to signify an exact match. - /// - /// See [webpack's `resolve.alias` documentation](https://webpack.js.org/configuration/resolve/#resolvealias) for a list of use cases. - pub alias: Alias, - - /// A list of alias fields in description files. - /// - /// Specify a field, such as `browser`, to be parsed according to [this specification](https://github.com/defunctzombie/package-browser-field-spec). - /// Can be a path to json object such as `["path", "to", "exports"]`. - /// - /// Default `[]` - pub alias_fields: Vec>, - - /// Condition names for exports field which defines entry points of a package. - /// - /// The key order in the exports field is significant. During condition matching, earlier entries have higher priority and take precedence over later entries. - /// - /// Default `[]` - pub condition_names: Vec, - - /// The JSON files to use for descriptions. (There was once a `bower.json`.) - /// - /// Default `["package.json"]` - pub description_files: Vec, - - /// Set to [EnforceExtension::Enabled] for [ESM Mandatory file extensions](https://nodejs.org/api/esm.html#mandatory-file-extensions). - /// - /// If `enforce_extension` is set to [EnforceExtension::Enabled], resolution will not allow extension-less files. - /// This means `require('./foo.js')` will resolve, while `require('./foo')` will not. - /// - /// The default value for `enforce_extension` is [EnforceExtension::Auto], which is changed upon initialization. - /// - /// It changes to [EnforceExtension::Enabled] if [ResolveOptions::extensions] contains an empty string; - /// otherwise, this value changes to [EnforceExtension::Disabled]. - /// - /// Explicitly set the value to [EnforceExtension::Disabled] to disable this automatic behavior. - /// - /// For reference, this behavior is aligned with `enhanced-resolve`. See . - pub enforce_extension: EnforceExtension, - - /// A list of exports fields in description files. - /// - /// Can be a path to a JSON object such as `["path", "to", "exports"]`. - /// - /// Default `[["exports"]]`. - pub exports_fields: Vec>, - - /// Fields from `package.json` which are used to provide the internal requests of a package - /// (requests starting with # are considered internal). - /// - /// Can be a path to a JSON object such as `["path", "to", "imports"]`. - /// - /// Default `[["imports"]]`. - pub imports_fields: Vec>, - - /// An object which maps extension to extension aliases. - /// - /// Default `{}` - pub extension_alias: Vec<(String, Vec)>, - - /// Attempt to resolve these extensions in order. - /// - /// If multiple files share the same name but have different extensions, - /// will resolve the one with the extension listed first in the array and skip the rest. - /// - /// All extensions must have a leading dot. - /// - /// Default `[".js", ".json", ".node"]` - pub extensions: Vec, - - /// Redirect module requests when normal resolving fails. - /// - /// Default `[]` - pub fallback: Alias, - - /// 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). - /// - /// See also webpack configuration [resolve.fullySpecified](https://webpack.js.org/configuration/module/#resolvefullyspecified) - /// - /// Default `false` - pub fully_specified: bool, - - /// A list of main fields in description files - /// - /// Default `["main"]`. - pub main_fields: Vec, - - /// The filename to be used while resolving directories. - /// - /// Default `["index"]` - pub main_files: Vec, - - /// A list of directories to resolve modules from, can be absolute path or folder name. - /// - /// Default `["node_modules"]` - pub modules: Vec, - - /// Resolve to a context instead of a file. - /// - /// Default `false` - pub resolve_to_context: bool, - - /// Prefer to resolve module requests as relative requests instead of using modules from node_modules directories. - /// - /// Default `false` - pub prefer_relative: bool, - - /// Prefer to resolve server-relative urls as absolute paths before falling back to resolve in ResolveOptions::roots. - /// - /// Default `false` - pub prefer_absolute: bool, - - /// A list of resolve restrictions to restrict the paths that a request can be resolved on. - /// - /// Default `[]` - pub restrictions: Vec, - - /// A list of directories where requests of server-relative URLs (starting with '/') are resolved. - /// On non-Windows systems these requests are resolved as an absolute path first. - /// - /// Default `[]` - pub roots: Vec, - - /// Whether to resolve symlinks to their symlinked location. - /// When enabled, symlinked resources are resolved to their real path, not their symlinked location. - /// Note that this may cause module resolution to fail when using tools that symlink packages (like npm link). - /// - /// Default `true` - pub symlinks: bool, - - /// Whether to parse [module.builtinModules](https://nodejs.org/api/module.html#modulebuiltinmodules) or not. - /// For example, "zlib" will throw [crate::ResolveError::Builtin] when set to true. - /// - /// Default `false` - pub builtin_modules: bool, -} - -impl ResolveOptions { - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// - /// let options = ResolveOptions::default().with_condition_names(&["bar"]); - /// assert_eq!(options.condition_names, vec!["bar".to_string()]) - /// ``` - #[must_use] - pub fn with_condition_names(mut self, names: &[&str]) -> Self { - self.condition_names = names.iter().map(ToString::to_string).collect::>(); - self - } - - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// - /// let options = ResolveOptions::default().with_builtin_modules(false); - /// assert_eq!(options.builtin_modules, false) - /// ``` - #[must_use] - pub fn with_builtin_modules(mut self, flag: bool) -> Self { - self.builtin_modules = flag; - self - } - - /// Adds a single root to the options - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_root("foo"); - /// assert_eq!(options.roots, vec![PathBuf::from("foo")]) - /// ``` - #[must_use] - pub fn with_root>(mut self, root: P) -> Self { - self.roots.push(root.as_ref().to_path_buf()); - self - } - - /// Adds a single extension to the list of extensions - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_extension("jsonc"); - /// assert!(options.extensions.contains(&"jsonc".to_string())); - /// ``` - #[must_use] - pub fn with_extension>(mut self, extension: S) -> Self { - self.extensions.push(extension.into()); - self - } - - /// Adds a single main field to the list of fields - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_main_field("something"); - /// assert!(options.main_fields.contains(&"something".to_string())); - /// ``` - #[must_use] - pub fn with_main_field>(mut self, field: S) -> Self { - self.main_fields.push(field.into()); - self - } - - /// Changes how the extension should be treated - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions, EnforceExtension}; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_force_extension(EnforceExtension::Enabled); - /// assert_eq!(options.enforce_extension, EnforceExtension::Enabled); - /// ``` - #[must_use] - pub fn with_force_extension(mut self, enforce_extension: EnforceExtension) -> Self { - self.enforce_extension = enforce_extension; - self - } - - /// Sets the value for [ResolveOptions::fully_specified] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_fully_specified(true); - /// assert_eq!(options.fully_specified, true); - /// ``` - #[must_use] - pub fn with_fully_specified(mut self, fully_specified: bool) -> Self { - self.fully_specified = fully_specified; - self - } - /// Sets the value for [ResolveOptions::prefer_relative] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_prefer_relative(true); - /// assert_eq!(options.prefer_relative, true); - /// ``` - #[must_use] - pub fn with_prefer_relative(mut self, flag: bool) -> Self { - self.prefer_relative = flag; - self - } - /// Sets the value for [ResolveOptions::prefer_absolute] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_prefer_absolute(true); - /// assert_eq!(options.prefer_absolute, true); - /// ``` - #[must_use] - pub fn with_prefer_absolute(mut self, flag: bool) -> Self { - self.prefer_absolute = flag; - self - } - - /// Changes the value of [ResolveOptions::symlinks] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// - /// let options = ResolveOptions::default().with_symbolic_link(false); - /// assert_eq!(options.symlinks, false); - /// ``` - #[must_use] - pub fn with_symbolic_link(mut self, flag: bool) -> Self { - self.symlinks = flag; - self - } - - /// Adds a module to [ResolveOptions::modules] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// - /// let options = ResolveOptions::default().with_module("module"); - /// assert!(options.modules.contains(&"module".to_string())); - /// ``` - #[must_use] - pub fn with_module>(mut self, module: M) -> Self { - self.modules.push(module.into()); - self - } - - /// Adds a main file to [ResolveOptions::main_files] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// - /// let options = ResolveOptions::default().with_main_file("foo"); - /// assert!(options.main_files.contains(&"foo".to_string())); - /// ``` - #[must_use] - pub fn with_main_file>(mut self, module: M) -> Self { - self.main_files.push(module.into()); - self - } - - pub(crate) fn sanitize(mut self) -> Self { - debug_assert!( - self.extensions.iter().filter(|e| !e.is_empty()).all(|e| e.starts_with('.')), - "All extensions must start with a leading dot" - ); - // Set `enforceExtension` to `true` when [ResolveOptions::extensions] contains an empty string. - // See - if self.enforce_extension == EnforceExtension::Auto { - if !self.extensions.is_empty() && self.extensions.iter().any(String::is_empty) { - self.enforce_extension = EnforceExtension::Enabled; - } else { - self.enforce_extension = EnforceExtension::Disabled; - } - } - self - } -} - -/// Value for [ResolveOptions::enforce_extension] -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -pub enum EnforceExtension { - Auto, - Enabled, - Disabled, -} - -impl EnforceExtension { - pub const fn is_auto(&self) -> bool { - matches!(self, Self::Auto) - } - - pub const fn is_enabled(&self) -> bool { - matches!(self, Self::Enabled) - } - - pub const fn is_disabled(&self) -> bool { - matches!(self, Self::Disabled) - } -} - -/// Alias for [ResolveOptions::alias] and [ResolveOptions::fallback] -pub type Alias = Vec<(String, Vec)>; - -/// Alias Value for [ResolveOptions::alias] and [ResolveOptions::fallback] -#[derive(Debug, Clone, Hash, PartialEq, Eq)] -pub enum AliasValue { - /// The path value - Path(String), - - /// The `false` value - Ignore, -} - -impl From for AliasValue -where - S: Into, -{ - fn from(value: S) -> Self { - Self::Path(value.into()) - } -} - -/// Value for [ResolveOptions::restrictions] -#[derive(Debug, Clone)] -pub enum Restriction { - Path(PathBuf), - RegExp(String), -} - -/// Tsconfig Options for [ResolveOptions::tsconfig] -/// -/// Derived from [tsconfig-paths-webpack-plugin](https://github.com/dividab/tsconfig-paths-webpack-plugin#options) -#[derive(Debug, Clone)] -pub struct TsconfigOptions { - /// Allows you to specify where to find the TypeScript configuration file. - /// You may provide - /// * a relative path to the configuration file. It will be resolved relative to cwd. - /// * an absolute path to the configuration file. - pub config_file: PathBuf, - - /// Support for Typescript Project References. - pub references: TsconfigReferences, -} - -/// Configuration for [TsconfigOptions::references] -#[derive(Debug, Clone)] -pub enum TsconfigReferences { - Disabled, - /// Use the `references` field from tsconfig of `config_file`. - Auto, - /// Manually provided relative or absolute path. - Paths(Vec), -} - -impl Default for ResolveOptions { - fn default() -> Self { - Self { - tsconfig: None, - alias: vec![], - alias_fields: vec![], - condition_names: vec![], - description_files: vec!["package.json".into()], - enforce_extension: EnforceExtension::Auto, - extension_alias: vec![], - exports_fields: vec![vec!["exports".into()]], - imports_fields: vec![vec!["imports".into()]], - extensions: vec![".js".into(), ".json".into(), ".node".into()], - fallback: vec![], - fully_specified: false, - main_fields: vec!["main".into()], - main_files: vec!["index".into()], - modules: vec!["node_modules".into()], - resolve_to_context: false, - prefer_relative: false, - prefer_absolute: false, - restrictions: vec![], - roots: vec![], - symlinks: true, - builtin_modules: false, - } - } -} - -// For tracing -impl fmt::Display for ResolveOptions { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - if let Some(tsconfig) = &self.tsconfig { - write!(f, "tsconfig:{tsconfig:?},")?; - } - if !self.alias.is_empty() { - write!(f, "alias:{:?},", self.alias)?; - } - if !self.alias_fields.is_empty() { - write!(f, "alias_fields:{:?},", self.alias_fields)?; - } - if !self.condition_names.is_empty() { - write!(f, "condition_names:{:?},", self.condition_names)?; - } - if self.enforce_extension.is_enabled() { - write!(f, "enforce_extension:{:?},", self.enforce_extension)?; - } - if !self.exports_fields.is_empty() { - write!(f, "exports_fields:{:?},", self.exports_fields)?; - } - if !self.imports_fields.is_empty() { - write!(f, "imports_fields:{:?},", self.imports_fields)?; - } - if !self.extension_alias.is_empty() { - write!(f, "extension_alias:{:?},", self.extension_alias)?; - } - if !self.extensions.is_empty() { - write!(f, "extensions:{:?},", self.extensions)?; - } - if !self.fallback.is_empty() { - write!(f, "fallback:{:?},", self.fallback)?; - } - if self.fully_specified { - write!(f, "fully_specified:{:?},", self.fully_specified)?; - } - if !self.main_fields.is_empty() { - write!(f, "main_fields:{:?},", self.main_fields)?; - } - if !self.main_files.is_empty() { - write!(f, "main_files:{:?},", self.main_files)?; - } - if !self.modules.is_empty() { - write!(f, "modules:{:?},", self.modules)?; - } - if self.resolve_to_context { - write!(f, "resolve_to_context:{:?},", self.resolve_to_context)?; - } - if self.prefer_relative { - write!(f, "prefer_relative:{:?},", self.prefer_relative)?; - } - if self.prefer_absolute { - write!(f, "prefer_absolute:{:?},", self.prefer_absolute)?; - } - if !self.restrictions.is_empty() { - write!(f, "restrictions:{:?},", self.restrictions)?; - } - if !self.roots.is_empty() { - write!(f, "roots:{:?},", self.roots)?; - } - if self.symlinks { - write!(f, "symlinks:{:?},", self.symlinks)?; - } - if self.builtin_modules { - write!(f, "builtin_modules:{:?},", self.builtin_modules)?; - } - Ok(()) - } -} - -#[cfg(test)] -mod test { - use super::{ - AliasValue, EnforceExtension, ResolveOptions, Restriction, TsconfigOptions, - TsconfigReferences, - }; - use std::path::PathBuf; - - #[test] - fn enforce_extension() { - assert!(EnforceExtension::Auto.is_auto()); - assert!(!EnforceExtension::Enabled.is_auto()); - assert!(!EnforceExtension::Disabled.is_auto()); - - assert!(!EnforceExtension::Auto.is_enabled()); - assert!(EnforceExtension::Enabled.is_enabled()); - assert!(!EnforceExtension::Disabled.is_enabled()); - - assert!(!EnforceExtension::Auto.is_disabled()); - assert!(!EnforceExtension::Enabled.is_disabled()); - assert!(EnforceExtension::Disabled.is_disabled()); - } - - #[test] - fn display() { - let options = ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: PathBuf::from("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - alias: vec![("a".into(), vec![AliasValue::Ignore])], - alias_fields: vec![vec!["browser".into()]], - condition_names: vec!["require".into()], - enforce_extension: EnforceExtension::Enabled, - extension_alias: vec![(".js".into(), vec![".ts".into()])], - exports_fields: vec![vec!["exports".into()]], - imports_fields: vec![vec!["imports".into()]], - fallback: vec![("fallback".into(), vec![AliasValue::Ignore])], - fully_specified: true, - resolve_to_context: true, - prefer_relative: true, - prefer_absolute: true, - restrictions: vec![Restriction::Path(PathBuf::from("restrictions"))], - roots: vec![PathBuf::from("roots")], - builtin_modules: true, - ..ResolveOptions::default() - }; - - let expected = r#"tsconfig:TsconfigOptions { config_file: "tsconfig.json", references: Auto },alias:[("a", [Ignore])],alias_fields:[["browser"]],condition_names:["require"],enforce_extension:Enabled,exports_fields:[["exports"]],imports_fields:[["imports"]],extension_alias:[(".js", [".ts"])],extensions:[".js", ".json", ".node"],fallback:[("fallback", [Ignore])],fully_specified:true,main_fields:["main"],main_files:["index"],modules:["node_modules"],resolve_to_context:true,prefer_relative:true,prefer_absolute:true,restrictions:[Path("restrictions")],roots:["roots"],symlinks:true,builtin_modules:true,"#; - assert_eq!(format!("{options}"), expected); - - let options = ResolveOptions { - alias: vec![], - alias_fields: vec![], - builtin_modules: false, - condition_names: vec![], - description_files: vec![], - enforce_extension: EnforceExtension::Disabled, - exports_fields: vec![], - extension_alias: vec![], - extensions: vec![], - fallback: vec![], - fully_specified: false, - imports_fields: vec![], - main_fields: vec![], - main_files: vec![], - modules: vec![], - prefer_absolute: false, - prefer_relative: false, - resolve_to_context: false, - restrictions: vec![], - roots: vec![], - symlinks: false, - tsconfig: None, - }; - - assert_eq!(format!("{options}"), ""); - } -} diff --git a/src/package_json.rs b/src/package_json.rs deleted file mode 100644 index 7e05d202..00000000 --- a/src/package_json.rs +++ /dev/null @@ -1,219 +0,0 @@ -//! package.json definitions -//! -//! Code related to export field are copied from [Parcel's resolver](https://github.com/parcel-bundler/parcel/blob/v2/packages/utils/node-resolver-rs/src/package_json.rs) -use std::path::{Path, PathBuf}; - -use serde_json::Value as JSONValue; - -use crate::{path::PathUtil, ResolveError}; - -pub type JSONMap = serde_json::Map; - -/// Deserialized package.json -#[derive(Debug, Default)] -pub struct PackageJson { - /// Path to `package.json`. Contains the `package.json` filename. - pub path: PathBuf, - - /// Realpath to `package.json`. Contains the `package.json` filename. - pub realpath: PathBuf, - - /// The "name" field defines your package's name. - /// The "name" field can be used in addition to the "exports" field to self-reference a package using its name. - /// - /// - pub name: Option, - - /// The "type" field. - /// - /// - pub r#type: Option, - - /// The "sideEffects" field. - /// - /// - pub side_effects: Option, - - raw_json: std::sync::Arc, -} - -impl PackageJson { - /// # Panics - /// # Errors - pub(crate) fn parse( - path: PathBuf, - realpath: PathBuf, - json: &str, - ) -> Result { - let mut raw_json: JSONValue = serde_json::from_str(json)?; - let mut package_json = Self::default(); - - if let Some(json_object) = raw_json.as_object_mut() { - // Remove large fields that are useless for pragmatic use. - #[cfg(feature = "package_json_raw_json_api")] - { - json_object.remove("description"); - json_object.remove("keywords"); - json_object.remove("scripts"); - json_object.remove("dependencies"); - json_object.remove("devDependencies"); - json_object.remove("peerDependencies"); - json_object.remove("optionalDependencies"); - } - - // Add name, type and sideEffects. - package_json.name = - json_object.get("name").and_then(|field| field.as_str()).map(ToString::to_string); - package_json.r#type = json_object.get("type").cloned(); - package_json.side_effects = json_object.get("sideEffects").cloned(); - } - - package_json.path = path; - package_json.realpath = realpath; - package_json.raw_json = std::sync::Arc::new(raw_json); - Ok(package_json) - } - - fn get_value_by_path<'a>( - fields: &'a serde_json::Map, - path: &[String], - ) -> Option<&'a JSONValue> { - if path.is_empty() { - return None; - } - let mut value = fields.get(&path[0])?; - for key in path.iter().skip(1) { - if let Some(inner_value) = value.as_object().and_then(|o| o.get(key)) { - value = inner_value; - } else { - return None; - } - } - Some(value) - } - - /// Raw serde json value of `package.json`. - /// - /// This is currently used in Rspack for: - /// * getting the `sideEffects` field - /// * query in - search on GitHub indicates query on the `type` field. - /// - /// To reduce overall memory consumption, large fields that useless for pragmatic use are removed. - /// They are: `description`, `keywords`, `scripts`, - /// `dependencies` and `devDependencies`, `peerDependencies`, `optionalDependencies`. - #[cfg(feature = "package_json_raw_json_api")] - pub fn raw_json(&self) -> &std::sync::Arc { - &self.raw_json - } - - /// Directory to `package.json` - /// - /// # Panics - /// - /// * When the package.json path is misconfigured. - pub fn directory(&self) -> &Path { - debug_assert!(self.realpath.file_name().is_some_and(|x| x == "package.json")); - self.realpath.parent().unwrap() - } - - /// The "main" field defines the entry point of a package when imported by name via a node_modules lookup. Its value is a path. - /// - /// When a package has an "exports" field, this will take precedence over the "main" field when importing the package by name. - /// - /// Values are dynamically retrieved from [ResolveOptions::main_fields]. - /// - /// - pub(crate) fn main_fields<'a>( - &'a self, - main_fields: &'a [String], - ) -> impl Iterator + '_ { - main_fields - .iter() - .filter_map(|main_field| self.raw_json.get(main_field)) - .filter_map(|value| value.as_str()) - } - - /// The "exports" field allows defining the entry points of a package when imported by name loaded either via a node_modules lookup or a self-reference to its own name. - /// - /// - pub(crate) fn exports_fields<'a>( - &'a self, - exports_fields: &'a [Vec], - ) -> impl Iterator + '_ { - exports_fields.iter().filter_map(|object_path| { - self.raw_json - .as_object() - .and_then(|json_object| Self::get_value_by_path(json_object, object_path)) - }) - } - - /// In addition to the "exports" field, there is a package "imports" field to create private mappings that only apply to import specifiers from within the package itself. - /// - /// - pub(crate) fn imports_fields<'a>( - &'a self, - imports_fields: &'a [Vec], - ) -> impl Iterator + '_ { - imports_fields.iter().filter_map(|object_path| { - self.raw_json - .as_object() - .and_then(|json_object| Self::get_value_by_path(json_object, object_path)) - .and_then(|value| value.as_object()) - }) - } - - /// The "browser" field is provided by a module author as a hint to javascript bundlers or component tools when packaging modules for client side use. - /// Multiple values are configured by [ResolveOptions::alias_fields]. - /// - /// - fn browser_fields<'a>( - &'a self, - alias_fields: &'a [Vec], - ) -> impl Iterator + '_ { - alias_fields.iter().filter_map(|object_path| { - self.raw_json - .as_object() - .and_then(|json_object| Self::get_value_by_path(json_object, object_path)) - // Only object is valid, all other types are invalid - // https://github.com/webpack/enhanced-resolve/blob/3a28f47788de794d9da4d1702a3a583d8422cd48/lib/AliasFieldPlugin.js#L44-L52 - .and_then(|value| value.as_object()) - }) - } - - /// Resolve the request string for this package.json by looking at the `browser` field. - /// - /// # Errors - /// - /// * Returns [ResolveError::Ignored] for `"path": false` in `browser` field. - pub(crate) fn resolve_browser_field<'a>( - &'a self, - path: &Path, - request: Option<&str>, - alias_fields: &'a [Vec], - ) -> Result, ResolveError> { - for object in self.browser_fields(alias_fields) { - if let Some(request) = request { - if let Some(value) = object.get(request) { - return Self::alias_value(path, value); - } - } else { - let dir = self.path.parent().unwrap(); - for (key, value) in object { - let joined = dir.normalize_with(key); - if joined == path { - return Self::alias_value(path, value); - } - } - } - } - Ok(None) - } - - fn alias_value<'a>(key: &Path, value: &'a JSONValue) -> Result, ResolveError> { - match value { - JSONValue::String(value) => Ok(Some(value.as_str())), - JSONValue::Bool(b) if !b => Err(ResolveError::Ignored(key.to_path_buf())), - _ => Ok(None), - } - } -} diff --git a/src/path.rs b/src/path.rs deleted file mode 100644 index f66fdd76..00000000 --- a/src/path.rs +++ /dev/null @@ -1,132 +0,0 @@ -//! Path Utilities -//! -//! Code adapted from the following libraries -//! * [path-absolutize](https://docs.rs/path-absolutize) -//! * [normalize_path](https://docs.rs/normalize-path) -use std::path::{Component, Path, PathBuf}; - -pub const SLASH_START: &[char; 2] = &['/', '\\']; - -/// Extension trait to add path normalization to std's [`Path`]. -pub trait PathUtil { - /// Normalize this path without performing I/O. - /// - /// All redundant separator and up-level references are collapsed. - /// - /// However, this does not resolve links. - fn normalize(&self) -> PathBuf; - - /// Normalize with subpath assuming this path is normalized without performing I/O. - /// - /// All redundant separator and up-level references are collapsed. - /// - /// However, this does not resolve links. - fn normalize_with>(&self, subpath: P) -> PathBuf; - - /// Defined in ESM PACKAGE_TARGET_RESOLVE - /// If target split on "/" or "\" contains any "", ".", "..", or "node_modules" segments after the first "." segment, case insensitive and including percent encoded variants - fn is_invalid_exports_target(&self) -> bool; -} - -impl PathUtil for Path { - // https://github.com/parcel-bundler/parcel/blob/e0b99c2a42e9109a9ecbd6f537844a1b33e7faf5/packages/utils/node-resolver-rs/src/path.rs#L7 - fn normalize(&self) -> PathBuf { - let mut components = self.components().peekable(); - let mut ret = if let Some(c @ Component::Prefix(..)) = components.peek() { - let buf = PathBuf::from(c.as_os_str()); - components.next(); - buf - } else { - PathBuf::new() - }; - - for component in components { - match component { - Component::Prefix(..) => unreachable!("Path {:?}", self), - Component::RootDir => { - ret.push(component.as_os_str()); - } - Component::CurDir => {} - Component::ParentDir => { - ret.pop(); - } - Component::Normal(c) => { - ret.push(c); - } - } - } - - ret - } - - // https://github.com/parcel-bundler/parcel/blob/e0b99c2a42e9109a9ecbd6f537844a1b33e7faf5/packages/utils/node-resolver-rs/src/path.rs#L37 - fn normalize_with>(&self, subpath: B) -> PathBuf { - let subpath = subpath.as_ref(); - - let mut components = subpath.components(); - - let Some(head) = components.next() else { return subpath.to_path_buf() }; - - if matches!(head, Component::Prefix(..) | Component::RootDir) { - return subpath.to_path_buf(); - } - - let mut ret = self.to_path_buf(); - for component in std::iter::once(head).chain(components) { - match component { - Component::CurDir => {} - Component::ParentDir => { - ret.pop(); - } - Component::Normal(c) => { - ret.push(c); - } - Component::Prefix(..) | Component::RootDir => { - unreachable!("Path {:?} Subpath {:?}", self, subpath) - } - } - } - - ret - } - - fn is_invalid_exports_target(&self) -> bool { - self.components().enumerate().any(|(index, c)| match c { - Component::ParentDir => true, - Component::CurDir => index > 0, - Component::Normal(c) => c.eq_ignore_ascii_case("node_modules"), - _ => false, - }) - } -} - -// https://github.com/webpack/enhanced-resolve/blob/main/test/path.test.js -#[test] -fn is_invalid_exports_target() { - let test_cases = [ - "../a.js", - "../", - "./a/b/../../../c.js", - "./a/b/../../../", - "./../../c.js", - "./../../", - "./a/../b/../../c.js", - "./a/../b/../../", - "./././../", - ]; - - for case in test_cases { - assert!(Path::new(case).is_invalid_exports_target(), "{case}"); - } - - assert!(!Path::new("C:").is_invalid_exports_target()); - assert!(!Path::new("/").is_invalid_exports_target()); -} - -#[test] -fn normalize() { - assert_eq!(Path::new("/foo/.././foo/").normalize(), Path::new("/foo")); - assert_eq!(Path::new("C://").normalize(), Path::new("C://")); - assert_eq!(Path::new("C:").normalize(), Path::new("C:")); - assert_eq!(Path::new(r"\\server\share").normalize(), Path::new(r"\\server\share")); -} diff --git a/src/resolution.rs b/src/resolution.rs deleted file mode 100644 index a3aaa2e7..00000000 --- a/src/resolution.rs +++ /dev/null @@ -1,92 +0,0 @@ -use crate::package_json::PackageJson; -use std::{ - fmt, - path::{Path, PathBuf}, - sync::Arc, -}; - -/// The final path resolution with optional `?query` and `#fragment` -#[derive(Clone)] -pub struct Resolution { - pub(crate) path: PathBuf, - - /// path query `?query`, contains `?`. - pub(crate) query: Option, - - /// path fragment `#query`, contains `#`. - pub(crate) fragment: Option, - - pub(crate) package_json: Option>, -} - -impl fmt::Debug for Resolution { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - f.debug_struct("Resolution") - .field("path", &self.path) - .field("query", &self.query) - .field("fragment", &self.fragment) - .field("package_json", &self.package_json.as_ref().map(|p| &p.path)) - .finish() - } -} - -impl PartialEq for Resolution { - fn eq(&self, other: &Self) -> bool { - self.path == other.path && self.query == other.query && self.fragment == other.fragment - } -} -impl Eq for Resolution {} - -impl Resolution { - /// Returns the path without query and fragment - pub fn path(&self) -> &Path { - &self.path - } - - /// Returns the path without query and fragment - pub fn into_path_buf(self) -> PathBuf { - self.path - } - - /// Returns the path query `?query`, contains the leading `?` - pub fn query(&self) -> Option<&str> { - self.query.as_deref() - } - - /// Returns the path fragment `#fragment`, contains the leading `#` - pub fn fragment(&self) -> Option<&str> { - self.fragment.as_deref() - } - - /// Returns serialized package_json - pub fn package_json(&self) -> Option<&Arc> { - self.package_json.as_ref() - } - - /// Returns the full path with query and fragment - pub fn full_path(&self) -> PathBuf { - let mut path = self.path.clone().into_os_string(); - if let Some(query) = &self.query { - path.push(query); - } - if let Some(fragment) = &self.fragment { - path.push(fragment); - } - PathBuf::from(path) - } -} - -#[test] -fn test() { - let resolution = Resolution { - path: PathBuf::from("foo"), - query: Some("?query".to_string()), - fragment: Some("#fragment".to_string()), - package_json: None, - }; - assert_eq!(resolution.path(), Path::new("foo")); - assert_eq!(resolution.query(), Some("?query")); - assert_eq!(resolution.fragment(), Some("#fragment")); - assert_eq!(resolution.full_path(), PathBuf::from("foo?query#fragment")); - assert_eq!(resolution.into_path_buf(), PathBuf::from("foo")); -} diff --git a/src/specifier.rs b/src/specifier.rs deleted file mode 100644 index 73ed038c..00000000 --- a/src/specifier.rs +++ /dev/null @@ -1,230 +0,0 @@ -use crate::error::SpecifierError; -use std::borrow::Cow; - -#[derive(Debug)] -pub struct Specifier<'a> { - path: Cow<'a, str>, - pub query: Option<&'a str>, - pub fragment: Option<&'a str>, -} - -impl<'a> Specifier<'a> { - pub fn path(&'a self) -> &'a str { - self.path.as_ref() - } - - pub fn parse(specifier: &'a str) -> Result { - if specifier.is_empty() { - return Err(SpecifierError::Empty(specifier.to_string())); - } - let offset = match specifier.as_bytes()[0] { - b'/' | b'.' | b'#' => 1, - _ => 0, - }; - let (path, query, fragment) = Self::parse_query_framgment(specifier, offset); - if path.is_empty() { - return Err(SpecifierError::Empty(specifier.to_string())); - } - Ok(Self { path, query, fragment }) - } - - fn parse_query_framgment( - specifier: &'a str, - skip: usize, - ) -> (Cow<'a, str>, Option<&str>, Option<&str>) { - let mut query_start: Option = None; - let mut fragment_start: Option = None; - - let mut prev = specifier.chars().next().unwrap(); - let mut escaped_indexes = vec![]; - for (i, c) in specifier.char_indices().skip(skip) { - if c == '?' && query_start.is_none() { - query_start = Some(i); - } - if c == '#' { - if prev == '\0' { - escaped_indexes.push(i - 1); - } else { - fragment_start = Some(i); - break; - } - } - prev = c; - } - - let (path, query, fragment) = match (query_start, fragment_start) { - (Some(i), Some(j)) => { - debug_assert!(i < j); - (&specifier[..i], Some(&specifier[i..j]), Some(&specifier[j..])) - } - (Some(i), None) => (&specifier[..i], Some(&specifier[i..]), None), - (None, Some(j)) => (&specifier[..j], None, Some(&specifier[j..])), - _ => (specifier, None, None), - }; - - let path = if escaped_indexes.is_empty() { - Cow::Borrowed(path) - } else { - // Remove the `\0` characters for a legal path. - Cow::Owned( - path.chars() - .enumerate() - .filter_map(|(i, c)| (!escaped_indexes.contains(&i)).then_some(c)) - .collect::(), - ) - }; - - (path, query, fragment) - } -} - -#[cfg(test)] -mod tests { - use super::{Specifier, SpecifierError}; - - #[test] - fn debug() { - let specifier = Specifier::parse("/").unwrap(); - assert_eq!( - format!("{specifier:?}"), - r#"Specifier { path: "/", query: None, fragment: None }"# - ); - } - - #[test] - fn empty() { - let specifiers = ["", "?"]; - for specifier in specifiers { - let error = Specifier::parse(specifier).unwrap_err(); - assert_eq!(error, SpecifierError::Empty(specifier.to_string())); - } - } - - #[test] - fn absolute() -> Result<(), SpecifierError> { - let specifier = "/test?#"; - let parsed = Specifier::parse(specifier)?; - assert_eq!(parsed.path, "/test"); - assert_eq!(parsed.query, Some("?")); - assert_eq!(parsed.fragment, Some("#")); - Ok(()) - } - - #[test] - fn relative() -> Result<(), SpecifierError> { - let specifiers = ["./test", "../test", "../../test"]; - for specifier in specifiers { - let mut r = specifier.to_string(); - r.push_str("?#"); - let parsed = Specifier::parse(&r)?; - assert_eq!(parsed.path, specifier); - assert_eq!(parsed.query, Some("?")); - assert_eq!(parsed.fragment, Some("#")); - } - Ok(()) - } - - #[test] - fn hash() -> Result<(), SpecifierError> { - let specifiers = ["#", "#path"]; - for specifier in specifiers { - let mut r = specifier.to_string(); - r.push_str("?#"); - let parsed = Specifier::parse(&r)?; - assert_eq!(parsed.path, specifier); - assert_eq!(parsed.query, Some("?")); - assert_eq!(parsed.fragment, Some("#")); - } - Ok(()) - } - - #[test] - fn module() -> Result<(), SpecifierError> { - let specifiers = ["module"]; - for specifier in specifiers { - let mut r = specifier.to_string(); - r.push_str("?#"); - let parsed = Specifier::parse(&r)?; - assert_eq!(parsed.path, specifier); - assert_eq!(parsed.query, Some("?")); - assert_eq!(parsed.fragment, Some("#")); - } - Ok(()) - } - - #[test] - fn query_fragment() -> Result<(), SpecifierError> { - let data = [ - ("a?", Some("?"), None), - ("a?query", Some("?query"), None), - ("a?query1?query2", Some("?query1?query2"), None), - ("a?query1?query2?query3", Some("?query1?query2?query3"), None), - ("a#", None, Some("#")), - ("a#b#c", None, Some("#b#c")), - ("a#fragment", None, Some("#fragment")), - ("a?#", Some("?"), Some("#")), - ("a?#fragment", Some("?"), Some("#fragment")), - ("a?query#", Some("?query"), Some("#")), - ("a?query#fragment", Some("?query"), Some("#fragment")), - ("a#fragment?", None, Some("#fragment?")), - ("a#fragment?query", None, Some("#fragment?query")), - ]; - - for (specifier_str, query, fragment) in data { - let specifier = Specifier::parse(specifier_str)?; - assert_eq!(specifier.path, "a", "{specifier_str}"); - assert_eq!(specifier.query, query, "{specifier_str}"); - assert_eq!(specifier.fragment, fragment, "{specifier_str}"); - } - - Ok(()) - } - - #[test] - // https://github.com/webpack/enhanced-resolve/blob/main/test/identifier.test.js - fn enhanced_resolve_edge_cases() -> Result<(), SpecifierError> { - let data = [ - ("path/#", "path/", "", "#"), - ("path/as/?", "path/as/", "?", ""), - ("path/#/?", "path/", "", "#/?"), - ("path/#repo#hash", "path/", "", "#repo#hash"), - ("path/#r#hash", "path/", "", "#r#hash"), - ("path/#repo/#repo2#hash", "path/", "", "#repo/#repo2#hash"), - ("path/#r/#r#hash", "path/", "", "#r/#r#hash"), - ("path/#/not/a/hash?not-a-query", "path/", "", "#/not/a/hash?not-a-query"), - ]; - - for (specifier_str, path, query, fragment) in data { - let specifier = Specifier::parse(specifier_str)?; - assert_eq!(specifier.path, path, "{specifier_str}"); - assert_eq!(specifier.query.unwrap_or(""), query, "{specifier_str}"); - assert_eq!(specifier.fragment.unwrap_or(""), fragment, "{specifier_str}"); - } - - Ok(()) - } - - // https://github.com/webpack/enhanced-resolve/blob/main/test/identifier.test.js - #[test] - fn enhanced_resolve_windows_like() -> Result<(), SpecifierError> { - let data = [ - ("path\\#", "path\\", "", "#"), - ("path\\as\\?", "path\\as\\", "?", ""), - ("path\\#\\?", "path\\", "", "#\\?"), - ("path\\#repo#hash", "path\\", "", "#repo#hash"), - ("path\\#r#hash", "path\\", "", "#r#hash"), - ("path\\#repo\\#repo2#hash", "path\\", "", "#repo\\#repo2#hash"), - ("path\\#r\\#r#hash", "path\\", "", "#r\\#r#hash"), - ("path\\#/not/a/hash?not-a-query", "path\\", "", "#/not/a/hash?not-a-query"), - ]; - - for (specifier_str, path, query, fragment) in data { - let specifier = Specifier::parse(specifier_str)?; - assert_eq!(specifier.path, path, "{specifier_str}"); - assert_eq!(specifier.query.unwrap_or(""), query, "{specifier_str}"); - assert_eq!(specifier.fragment.unwrap_or(""), fragment, "{specifier_str}"); - } - - Ok(()) - } -} diff --git a/src/tests/alias.rs b/src/tests/alias.rs deleted file mode 100644 index 07c615f4..00000000 --- a/src/tests/alias.rs +++ /dev/null @@ -1,280 +0,0 @@ -//! - -use normalize_path::NormalizePath; -use std::path::Path; - -use crate::{AliasValue, Resolution, ResolveContext, ResolveError, ResolveOptions, Resolver}; - -#[test] -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -fn alias() { - use super::memory_fs::MemoryFS; - use crate::ResolverGeneric; - use std::path::{Path, PathBuf}; - - let f = Path::new("/"); - - let file_system = MemoryFS::new(&[ - ("/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", ""), - ("/dashed-name", ""), - ]); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - alias: vec![ - ("aliasA".into(), vec![AliasValue::from("a")]), - ("b$".into(), vec![AliasValue::from("a/index")]), - ("c$".into(), vec![AliasValue::from("/a/index")]), - ( - "multiAlias".into(), - vec![ - AliasValue::from("b"), - AliasValue::from("c"), - AliasValue::from("d"), - AliasValue::from("e"), - AliasValue::from("a"), - ], - ), - ("recursive".into(), vec![AliasValue::from("recursive/dir")]), - ("/d/dir".into(), vec![AliasValue::from("/c/dir")]), - ("/d/index.js".into(), vec![AliasValue::from("/c/index")]), - ("#".into(), vec![AliasValue::from("/c/dir")]), - ("@".into(), vec![AliasValue::from("/c/dir")]), - ("ignored".into(), vec![AliasValue::Ignore]), - // not part of enhanced-resolve, added to make sure query in alias value works - ("alias_query".into(), vec![AliasValue::from("a?query_after")]), - ("alias_fragment".into(), vec![AliasValue::from("a#fragment_after")]), - ("dash".into(), vec![AliasValue::Ignore]), - ("@scope/package-name/file$".into(), vec![AliasValue::from("/c/dir")]), - ], - modules: vec!["/".into()], - ..ResolveOptions::default() - }, - ); - - #[rustfmt::skip] - let pass = [ - ("should resolve a not aliased module 1", "a", "/a/index"), - ("should resolve a not aliased module 2", "a/index", "/a/index"), - ("should resolve a not aliased module 3", "a/dir", "/a/dir/index"), - ("should resolve a not aliased module 4", "a/dir/index", "/a/dir/index"), - ("should resolve an aliased module 1", "aliasA", "/a/index"), - ("should resolve an aliased module 2", "aliasA/index", "/a/index"), - ("should resolve an aliased module 3", "aliasA/dir", "/a/dir/index"), - ("should resolve an aliased module 4", "aliasA/dir/index", "/a/dir/index"), - ("should resolve '#' alias 1", "#", "/c/dir/index"), - ("should resolve '#' alias 2", "#/index", "/c/dir/index"), - ("should resolve '@' alias 1", "@", "/c/dir/index"), - ("should resolve '@' alias 2", "@/index", "/c/dir/index"), - ("should resolve a recursive aliased module 1", "recursive", "/recursive/dir/index"), - ("should resolve a recursive aliased module 2", "recursive/index", "/recursive/dir/index"), - ("should resolve a recursive aliased module 3", "recursive/dir", "/recursive/dir/index"), - ("should resolve a recursive aliased module 4", "recursive/dir/index", "/recursive/dir/index"), - ("should resolve a file aliased module 1", "b", "/a/index"), - ("should resolve a file aliased module 2", "c", "/a/index"), - ("should resolve a file aliased module with a query 1", "b?query", "/a/index?query"), - ("should resolve a file aliased module with a query 2", "c?query", "/a/index?query"), - ("should resolve a path in a file aliased module 1", "b/index", "/b/index"), - ("should resolve a path in a file aliased module 2", "b/dir", "/b/dir/index"), - ("should resolve a path in a file aliased module 3", "b/dir/index", "/b/dir/index"), - ("should resolve a path in a file aliased module 4", "c/index", "/c/index"), - ("should resolve a path in a file aliased module 5", "c/dir", "/c/dir/index"), - ("should resolve a path in a file aliased module 6", "c/dir/index", "/c/dir/index"), - ("should resolve a file aliased file 1", "d", "/c/index"), - ("should resolve a file aliased file 2", "d/dir/index", "/c/dir/index"), - ("should resolve a file in multiple aliased dirs 1", "multiAlias/dir/file", "/e/dir/file"), - ("should resolve a file in multiple aliased dirs 2", "multiAlias/anotherDir", "/e/anotherDir/index"), - // not part of enhanced-resolve, added to make sure query in alias value works - ("should resolve query in alias value", "alias_query?query_before", "/a/index?query_after"), - ("should resolve query in alias value", "alias_fragment#fragment_before", "/a/index#fragment_after"), - ("should resolve dashed name", "dashed-name", "/dashed-name"), - ("should resolve scoped package name with sub dir", "@scope/package-name/file", "/c/dir/index"), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - - #[rustfmt::skip] - let ignore = [ - ("should resolve an ignore module", "ignored", ResolveError::Ignored(f.join("ignored"))) - ]; - - for (comment, request, expected) in ignore { - let resolution = resolver.resolve(f, request); - assert_eq!(resolution, Err(expected), "{comment} {request}"); - } -} - -// Not part of enhanced-resolve -#[test] -fn infinite_recursion() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![ - ("./a".into(), vec![AliasValue::from("./b")]), - ("./b".into(), vec![AliasValue::from("./a")]), - ], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(f, "./a"); - assert_eq!(resolution, Err(ResolveError::Recursion)); -} - -fn check_slash(path: &Path) { - let s = path.to_string_lossy().to_string(); - #[cfg(target_os = "windows")] - { - assert!(!s.contains('/'), "{s}"); - assert!(s.contains('\\'), "{s}"); - } - #[cfg(not(target_os = "windows"))] - { - assert!(s.contains('/'), "{s}"); - assert!(!s.contains('\\'), "{s}"); - } -} - -#[test] -fn absolute_path() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![(f.join("foo").to_str().unwrap().to_string(), vec![AliasValue::Ignore])], - modules: vec![f.clone().to_str().unwrap().to_string()], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(&f, "foo/index"); - assert_eq!(resolution, Err(ResolveError::Ignored(f.join("foo")))); -} - -#[test] -fn system_path() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![("@app".into(), vec![AliasValue::from(f.join("alias").to_string_lossy())])], - ..ResolveOptions::default() - }); - - let specifiers = ["@app/files/a", "@app/files/a.js"]; - - for specifier in specifiers { - let path = resolver.resolve(&f, specifier).map(Resolution::into_path_buf).unwrap(); - assert_eq!(path, f.join("alias/files/a.js")); - check_slash(&path); - } -} - -#[test] -fn alias_is_full_path() { - let f = super::fixture(); - let dir = f.join("foo"); - let dir_str = dir.to_string_lossy().to_string(); - - let resolver = Resolver::new(ResolveOptions { - alias: vec![("@".into(), vec![AliasValue::Path(dir_str.clone())])], - ..ResolveOptions::default() - }); - - let mut ctx = ResolveContext::default(); - - let specifiers = [ - "@/index".to_string(), - "@/index.js".to_string(), - // specifier has multiple `/` for reasons we'll never know - "@////index".to_string(), - // specifier is a full path - dir_str, - ]; - - for specifier in specifiers { - let resolution = resolver.resolve_with_context(&f, &specifier, &mut ctx); - assert_eq!(resolution.map(|r| r.full_path()), Ok(dir.join("index.js"))); - } - - for path in ctx.file_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - check_slash(&path); - } - - for path in ctx.missing_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - check_slash(&path); - if let Some(path) = path.parent() { - assert!(!path.is_file(), "{path:?} must not be a file"); - } - } -} - -// For the `should_stop` variable in `load_alias` -#[test] -fn all_alias_values_are_not_found() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![( - "m1".to_string(), - vec![AliasValue::Path(f.join("node_modules").join("m2").to_string_lossy().to_string())], - )], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(&f, "m1/a.js"); - assert_eq!(resolution, Err(ResolveError::NotFound("m1/a.js".to_string()))); -} - -#[test] -fn alias_fragment() { - let f = super::fixture(); - - let data = [ - // enhanced-resolve has `#` prepended with a `\0`, they are removed from the - // following 3 expected test results. - // See https://github.com/webpack/enhanced-resolve#escaping - ( - "handle fragment edge case (no fragment)", - "./no#fragment/#/#", - f.join("no#fragment/#/#.js"), - ), - ("handle fragment edge case (fragment)", "./no#fragment/#/", f.join("no.js#fragment/#/")), - ( - "handle fragment escaping", - "./no\0#fragment/\0#/\0##fragment", - f.join("no#fragment/#/#.js#fragment"), - ), - ]; - - for (comment, request, expected) in data { - let resolver = Resolver::new(ResolveOptions { - alias: vec![("foo".to_string(), vec![AliasValue::Path(request.to_string())])], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f, "foo").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } -} - -#[test] -fn alias_try_fragment_as_path() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![( - "#".to_string(), - vec![AliasValue::Path(f.join("#").to_string_lossy().to_string())], - )], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(&f, "#/a").map(|r| r.full_path()); - assert_eq!(resolution, Ok(f.join("#").join("a.js"))); -} diff --git a/src/tests/browser_field.rs b/src/tests/browser_field.rs deleted file mode 100644 index 171ee099..00000000 --- a/src/tests/browser_field.rs +++ /dev/null @@ -1,189 +0,0 @@ -//! - -use crate::{AliasValue, ResolveError, ResolveOptions, Resolver}; - -#[test] -fn ignore() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![ - vec!["browser".into()], - vec!["innerBrowser1".into()], - vec!["innerBrowser2".into()], - vec![], - ], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - (f.clone(), "./lib/ignore", f.join("lib/ignore.js")), - (f.clone(), "./lib/ignore.js", f.join("lib/ignore.js")), - (f.join("lib"), "./ignore", f.join("lib/ignore.js")), - (f.join("lib"), "./ignore.js", f.join("lib/ignore.js")), - ]; - - for (path, request, expected) in data { - let resolution = resolver.resolve(&path, request); - let expected = ResolveError::Ignored(expected); - assert_eq!(resolution, Err(expected), "{path:?} {request}"); - } -} - -#[test] -fn shared_resolvers() { - let f = super::fixture().join("browser-module"); - - let resolver1 = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["innerBrowser1".into(), "field".into(), "browser".into()]], - ..ResolveOptions::default() - }); - let resolved_path = resolver1.resolve(&f, "./lib/main1.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("lib/main.js"))); - - let resolver2 = resolver1.clone_with_options(ResolveOptions { - alias_fields: vec![vec!["innerBrowser2".into(), "browser".into()]], - ..ResolveOptions::default() - }); - let resolved_path = resolver2.resolve(&f, "./lib/main2.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("./lib/replaced.js"))); -} - -#[test] -fn replace_file() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![ - vec!["browser".into()], - vec!["innerBrowser1".into(), "field2".into(), "browser".into()], // not presented - vec!["innerBrowser1".into(), "field".into(), "browser".into()], - vec!["innerBrowser2".into(), "browser".into()], - ], - // Not part of enhanced-resolve. Added to make sure no interaction between these two fields. - main_fields: vec!["browser".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - ("should replace a file 1", f.clone(), "./lib/replaced", f.join("lib/browser.js")), - ("should replace a file 2", f.clone(), "./lib/replaced.js", f.join("lib/browser.js")), - ("should replace a file 3", f.join("lib"), "./replaced", f.join("lib/browser.js")), - ("should replace a file 4", f.join("lib"), "./replaced.js", f.join("lib/browser.js")), - ("should replace a module with a file 1", f.clone(), "module-a", f.join("browser/module-a.js")), - ("should replace a module with a file 2", f.join("lib"), "module-a", f.join("browser/module-a.js")), - ("should replace a module with a module 1", f.clone(), "module-b", f.join("node_modules/module-c.js")), - ("should replace a module with a module 2", f.join("lib"), "module-b", f.join("node_modules/module-c.js")), - ("should resolve in nested property 1", f.clone(), "./lib/main1.js", f.join("lib/main.js")), - ("should resolve in nested property 2", f.clone(), "./lib/main2.js", f.join("lib/browser.js")), - ("should check only alias field properties", f.clone(), "./toString", f.join("lib/toString.js")), - // not part of enhanced-resolve - ("recursion", f.clone(), "module-c", f.join("node_modules/module-c.js")), - ("resolve self 1", f.clone(), "./lib/main.js", f.join("lib/main.js")), - ("resolve self 2", f.clone(), "./main.js", f.join("lib/main.js")), - ]; - - for (comment, path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn recurse_fail() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - ("recurse non existent", f.clone(), "./lib/non-existent.js", ResolveError::NotFound("./lib/non-existent.js".into())), - ("path partial match 1", f.clone(), "./xyz.js", ResolveError::NotFound("./xyz.js".into())), - ("path partial match 2", f, "./lib/xyz.js", ResolveError::NotFound("./lib/xyz.js".into())), - ]; - - for (comment, path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Err(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn broken() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - // The browser field string value should be ignored - (f.clone(), "browser-module-broken", Ok(f.join("node_modules/browser-module-broken/main.js"))), - (f.join("browser-module"), "./number", Err(ResolveError::NotFound("./number".into()))), - ]; - - for (path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, expected, "{path:?} {request}"); - } -} - -#[test] -fn crypto_js() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - fallback: vec![( - "crypto".into(), - vec![AliasValue::from(f.join("lib.js").to_string_lossy())], - )], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(f.join("crypto-js"), "crypto").map(|r| r.full_path()); - assert_eq!(resolved_path, Err(ResolveError::Ignored(f.join("crypto-js")))); -} - -// https://github.com/webpack/webpack/blob/87660921808566ef3b8796f8df61bd79fc026108/test/cases/resolving/browser-field/index.js#L40-L43 -#[test] -fn recursive() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - let data = [ - ("should handle recursive file 1", f.clone(), "recursive-file/a"), - ("should handle recursive file 2", f.clone(), "recursive-file/b"), - ("should handle recursive file 3", f.clone(), "recursive-file/c"), - ("should handle recursive file 4", f, "recursive-file/d"), - ]; - - for (comment, path, request) in data { - let resolved_path = resolver.resolve(&path, request); - assert_eq!(resolved_path, Err(ResolveError::Recursion), "{comment} {path:?} {request}"); - } -} - -#[test] -fn with_query() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "./foo").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("lib").join("browser.js?query"))); -} diff --git a/src/tests/builtins.rs b/src/tests/builtins.rs deleted file mode 100644 index 5d6d14d9..00000000 --- a/src/tests/builtins.rs +++ /dev/null @@ -1,121 +0,0 @@ -use std::path::Path; - -use crate::{ResolveError, ResolveOptions, Resolver}; - -#[test] -fn builtins_off() { - let f = Path::new("/"); - let resolver = Resolver::default(); - let resolved_path = resolver.resolve(f, "zlib").map(|r| r.full_path()); - assert_eq!(resolved_path, Err(ResolveError::NotFound("zlib".into()))); -} - -#[test] -fn builtins() { - let f = Path::new("/"); - - let resolver = Resolver::new(ResolveOptions::default().with_builtin_modules(true)); - - let pass = [ - "_http_agent", - "_http_client", - "_http_common", - "_http_incoming", - "_http_outgoing", - "_http_server", - "_stream_duplex", - "_stream_passthrough", - "_stream_readable", - "_stream_transform", - "_stream_wrap", - "_stream_writable", - "_tls_common", - "_tls_wrap", - "assert", - "assert/strict", - "async_hooks", - "buffer", - "child_process", - "cluster", - "console", - "constants", - "crypto", - "dgram", - "diagnostics_channel", - "dns", - "dns/promises", - "domain", - "events", - "fs", - "fs/promises", - "http", - "http2", - "https", - "inspector", - "module", - "net", - "os", - "path", - "path/posix", - "path/win32", - "perf_hooks", - "process", - "punycode", - "querystring", - "readline", - "repl", - "stream", - "stream/consumers", - "stream/promises", - "stream/web", - "string_decoder", - "sys", - "timers", - "timers/promises", - "tls", - "trace_events", - "tty", - "url", - "util", - "util/types", - "v8", - "vm", - "worker_threads", - "zlib", - ]; - - for request in pass { - let prefixed_request = format!("node:{request}"); - for request in [prefixed_request.clone(), request.to_string()] { - let resolved_path = resolver.resolve(f, &request).map(|r| r.full_path()); - let err = ResolveError::Builtin(prefixed_request.clone()); - assert_eq!(resolved_path, Err(err), "{request}"); - } - } -} - -#[test] -fn fail() { - let f = Path::new("/"); - let resolver = Resolver::new(ResolveOptions::default().with_builtin_modules(true)); - let request = "xxx"; - let resolved_path = resolver.resolve(f, request); - let err = ResolveError::NotFound(request.to_string()); - assert_eq!(resolved_path, Err(err), "{request}"); -} - -#[test] -fn imports() { - let f = super::fixture().join("builtins"); - let resolver = Resolver::new(ResolveOptions { - builtin_modules: true, - condition_names: vec!["node".into()], - ..ResolveOptions::default() - }); - - for request in ["#fs", "#http"] { - let resolved_path = resolver.resolve(f.clone(), request).map(|r| r.full_path()); - let err = ResolveError::Builtin(format!("node:{}", request.trim_start_matches('#'))); - assert_eq!(resolved_path, Err(err)); - } -} diff --git a/src/tests/dependencies.rs b/src/tests/dependencies.rs deleted file mode 100644 index bcc2355b..00000000 --- a/src/tests/dependencies.rs +++ /dev/null @@ -1,110 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/dependencies.test.js - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows { - use rustc_hash::FxHashSet; - use std::path::PathBuf; - - use crate::{ResolveContext, ResolveOptions, ResolverGeneric}; - - use super::super::memory_fs::MemoryFS; - - fn file_system() -> MemoryFS { - MemoryFS::new(&[ - ("/a/b/node_modules/some-module/index.js", ""), - ("/a/node_modules/module/package.json", r#"{"main":"entry.js"}"#), - ("/a/node_modules/module/file.js", r#"{"main":"entry.js"}"#), - ("/modules/other-module/file.js", ""), - ]) - } - - #[test] - fn test() { - let file_system = file_system(); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - extensions: vec![".json".into(), ".js".into()], - modules: vec!["/modules".into(), "node_modules".into()], - ..ResolveOptions::default() - }, - ); - - let data = [ - ( - "middle module request", - "/a/b/c", - "module/file", - "/a/node_modules/module/file.js", - // These dependencies are different from enhanced-resolve due to different code path to - // querying the file system - vec![ - // 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", - // "/", - ], - vec![ - // missing package.jsons - // "/a/b/c/package.json", - "/a/b/package.json", - "/a/package.json", - "/package.json", - // missing modules directories - "/a/b/c", - // "/a/b/c/node_modules", - // missing single file modules - "/modules/module", - "/a/b/node_modules/module", - // missing files with alternative extensions - "/a/node_modules/module/file", - "/a/node_modules/module/file.json", - ], - ), - ( - "fast found module", - "/a/b/c", - "other-module/file.js", - "/modules/other-module/file.js", - // These dependencies are different from enhanced-resolve due to different code path to - // querying the file system - vec![ - // symlink checks - "/modules/other-module/file.js", - // "/modules/other-module", - // "/modules", - // "/", - ], - vec![ - // missing package.jsons - // "/a/b/c/package.json", - "/a/b/c", - "/a/b/package.json", - "/a/package.json", - "/package.json", - "/modules/other-module/package.json", - "/modules/package.json", - ], - ), - ]; - - for (name, context, request, result, file_dependencies, missing_dependencies) in data { - let mut ctx = ResolveContext::default(); - let path = PathBuf::from(context); - let resolved = - resolver.resolve_with_context(path, request, &mut ctx).map(|r| r.full_path()); - assert_eq!(resolved, Ok(PathBuf::from(result))); - let file_dependencies = - FxHashSet::from_iter(file_dependencies.iter().map(PathBuf::from)); - let missing_dependencies = - FxHashSet::from_iter(missing_dependencies.iter().map(PathBuf::from)); - assert_eq!(ctx.file_dependencies, file_dependencies, "{name}"); - assert_eq!(ctx.missing_dependencies, missing_dependencies, "{name}"); - } - } -} diff --git a/src/tests/exports_field.rs b/src/tests/exports_field.rs deleted file mode 100644 index fd68c1f7..00000000 --- a/src/tests/exports_field.rs +++ /dev/null @@ -1,2546 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/exportsField.test.js -//! -//! The huge exports field test cases are at the bottom of this file. - -use crate::{Ctx, PathUtil, ResolveError, ResolveOptions, Resolver}; -use serde_json::json; -use std::path::Path; - -#[test] -fn test_simple() { - let f = super::fixture().join("exports-field"); - let f2 = super::fixture().join("exports-field2"); - let f4 = super::fixture().join("exports-field-error"); - let f5 = super::fixture().join("imports-exports-wildcard"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - fully_specified: true, - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("resolve root using exports field, not a main field", f.clone(), "exports-field", f.join("node_modules/exports-field/x.js")), - ("resolver should respect condition names", f.clone(), "exports-field/dist/main.js", f.join("node_modules/exports-field/lib/lib2/main.js")), - // enhanced_resolve behaves differently to node.js. enhanced_resolve fallbacks when an - // array item is unresolved, where as node.js fallbacks when an array has an - // InvalidPackageTarget error. - // ("resolver should respect fallback", f2.clone(), "exports-field/dist/browser.js", f2.join("node_modules/exports-field/lib/browser.js")), - // The following two tests require fallback from array values, the path is changed here to - // only test query and fragment. - ("resolver should respect query parameters #1", f2.clone(), "exports-field/dist/main.js?foo", f2.join("node_modules/exports-field/lib/lib2/main.js?foo")), - ("resolver should respect fragment parameters #1", f2.clone(), "exports-field/dist/main.js#foo", f2.join("node_modules/exports-field/lib/lib2/main.js#foo")), - ("relative path should work, if relative path as request is used", f.clone(), "./node_modules/exports-field/lib/main.js", f.join("node_modules/exports-field/lib/main.js")), - ("self-resolving root", f.clone(), "@exports-field/core", f.join("a.js")), - ("should resolve with wildcard pattern #1", f5.clone(), "m/features/f.js", f5.join("node_modules/m/src/features/f.js")), - ("should resolve with wildcard pattern #2", f5.clone(), "m/features/y/y.js", f5.join("node_modules/m/src/features/y/y.js")), - ("should resolve with wildcard pattern #3", f5.clone(), "m/features-no-ext/y/y.js", f5.join("node_modules/m/src/features/y/y.js")), - ("should resolve with wildcard pattern #4", f5.clone(), "m/middle/nested/f.js", f5.join("node_modules/m/src/middle/nested/f.js")), - ("should resolve with wildcard pattern #5", f5.clone(), "m/middle-1/nested/f.js", f5.join("node_modules/m/src/middle-1/nested/f.js")), - ("should resolve with wildcard pattern #6", f5.clone(), "m/middle-2/nested/f.js", f5.join("node_modules/m/src/middle-2/nested/f.js")), - ("should resolve with wildcard pattern #7", f5.clone(), "m/middle-3/nested/f", f5.join("node_modules/m/src/middle-3/nested/f/nested/f.js")), - ("should resolve with wildcard pattern #8", f5.clone(), "m/middle-4/f/nested", f5.join("node_modules/m/src/middle-4/f/f.js")), - ("should resolve with wildcard pattern #9", f5.clone(), "m/middle-5/f$/$", f5.join("node_modules/m/src/middle-5/f$/$.js")), - ]; - - // Not needed or snapshot: - // * should log the correct info - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } - - let p = f.join("node_modules/exports-field/package.json"); - let p2 = f2.join("node_modules/exports-field/package.json"); - let p4 = f4.join("node_modules/exports-field/package.json"); - let p5 = f5.join("node_modules/m/package.json"); - - #[rustfmt::skip] - let fail = [ - // ("throw error if extension not provided", f2.clone(), "exports-field/dist/main", ResolveError::NotFound(f2.join("node_modules/exports-field/lib/lib2/main"))), - ("resolver should respect query parameters #2. Direct matching", f2.clone(), "exports-field?foo", ResolveError::PackagePathNotExported("./?foo".into(), p2.clone())), - ("resolver should respect fragment parameters #2. Direct matching", f2, "exports-field#foo", ResolveError::PackagePathNotExported("./#foo".into(), p2)), - ("relative path should not work with exports field", f.clone(), "./node_modules/exports-field/dist/main.js", ResolveError::NotFound("./node_modules/exports-field/dist/main.js".into())), - ("backtracking should not work for request", f.clone(), "exports-field/dist/../../../a.js", ResolveError::InvalidPackageTarget("./lib/../../../a.js".to_string(), "./dist/".to_string(), p.clone())), - ("backtracking should not work for exports field target", f.clone(), "exports-field/dist/a.js", ResolveError::InvalidPackageTarget("./../../a.js".to_string(), "./dist/a.js".to_string(), p.clone())), - ("not exported error", f.clone(), "exports-field/anything/else", ResolveError::PackagePathNotExported("./anything/else".to_string(), p.clone())), - ("request ending with slash #1", f.clone(), "exports-field/", ResolveError::PackagePathNotExported("./".to_string(), p.clone())), - ("request ending with slash #2", f.clone(), "exports-field/dist/", ResolveError::PackagePathNotExported("./dist/".to_string(), p.clone())), - ("request ending with slash #3", f.clone(), "exports-field/lib/", ResolveError::PackagePathNotExported("./lib/".to_string(), p)), - ("should throw error if target is invalid", f4, "exports-field", ResolveError::InvalidPackageTarget("./a/../b/../../pack1/index.js".to_string(), ".".to_string(), p4)), - ("throw error if exports field is invalid", f.clone(), "invalid-exports-field", ResolveError::InvalidPackageConfig(f.join("node_modules/invalid-exports-field/package.json"))), - ("should throw error if target is 'null'", f5, "m/features/internal/file.js", ResolveError::PackagePathNotExported("./features/internal/file.js".to_string(), p5)), - ]; - - for (comment, path, request, error) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!(resolution, Err(error), "{comment} {path:?} {request}"); - } -} - -// resolve using exports field, not a browser field #1 -#[test] -fn exports_not_browser_field1() { - let f = super::fixture().join("exports-field"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - condition_names: vec!["webpack".into()], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "exports-field/dist/main.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("node_modules/exports-field/lib/lib2/main.js"))); -} - -// resolve using exports field and a browser alias field #2 -#[test] -fn exports_not_browser_field2() { - let f2 = super::fixture().join("exports-field2"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - extensions: vec![".js".into()], - condition_names: vec!["node".into()], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f2, "exports-field/dist/main.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f2.join("node_modules/exports-field/lib/browser.js"))); -} - -// should resolve extension without fullySpecified -#[test] -fn extension_without_fully_specified() { - let f2 = super::fixture().join("exports-field2"); - - let commonjs_resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - let resolved_path = - commonjs_resolver.resolve(&f2, "exports-field/dist/main").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f2.join("node_modules/exports-field/lib/lib2/main.js"))); -} - -#[test] -fn field_name_path() { - let f2 = super::fixture().join("exports-field2"); - let f3 = super::fixture().join("exports-field3"); - - // field name path #1 #2 #3 - let exports_fields = [ - vec![vec!["exportsField".into(), "exports".into()]], - vec![vec!["exportsField".into(), "exports".into()], vec!["exports".into()]], - vec![vec!["exports".into()], vec!["exportsField".into(), "exports".into()]], - ]; - - for exports_fields in exports_fields { - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - exports_fields, - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/main.js"))); - } - - // field name path #4 - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - exports_fields: vec![vec!["exports".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f2, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f2.join("node_modules/exports-field/index.js"))); - - // field name path #5 - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - exports_fields: vec![vec!["ex".into()], vec!["exports_field".into(), "exports".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/index"))); - - // non-compliant export targeting a directory - let resolver = Resolver::new(ResolveOptions { - exports_fields: vec![vec!["broken".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/src/index.js"))); -} - -#[test] -fn shared_resolvers() { - let f3 = super::fixture().join("exports-field3"); - - let resolver1 = Resolver::new(ResolveOptions { - exports_fields: vec![vec!["exportsField".into(), "exports".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver1.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/main.js"))); - - let resolver2 = resolver1.clone_with_options(ResolveOptions { - exports_fields: vec![vec!["ex".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver2.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/index"))); -} - -#[test] -fn extension_alias_1_2() { - let f = super::fixture().join("exports-field-and-extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - extension_alias: vec![(".js".into(), vec![".ts".into(), ".js".into()])], - fully_specified: true, - condition_names: vec!["webpack".into(), "default".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve with the `extensionAlias` option", f.clone(), "@org/pkg/string.js", f.join("node_modules/@org/pkg/dist/string.js")), - ("should resolve with the `extensionAlias` option #2", f.clone(), "pkg/string.js", f.join("node_modules/pkg/dist/string.js")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn extension_alias_3() { - let f = super::fixture().join("exports-field-and-extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - extension_alias: vec![( - ".js".into(), - vec![".foo".into(), ".baz".into(), ".baz".into(), ".ts".into(), ".js".into()], - )], - fully_specified: true, - condition_names: vec!["webpack".into(), "default".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve with the `extensionAlias` option #3", f.clone(), "pkg/string.js", f.join("node_modules/pkg/dist/string.js")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn extension_alias_throw_error() { - let f = super::fixture().join("exports-field-and-extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - extension_alias: vec![(".js".into(), vec![".ts".into()])], - fully_specified: true, - condition_names: vec!["webpack".into(), "default".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let fail = [ - // enhanced-resolve has two test cases that are exactly the same here - // https://github.com/webpack/enhanced-resolve/blob/a998c7d218b7a9ec2461fc4fddd1ad5dd7687485/test/exportsField.test.js#L2976-L3024 - ("should throw error with the `extensionAlias` option", f, "pkg/string.js", ResolveError::ExtensionAlias), - // TODO: The error is PackagePathNotExported in enhanced-resolve - // ("should throw error with the `extensionAlias` option", f.clone(), "pkg/string.js", ResolveError::PackagePathNotExported("node_modules/pkg/dist/string.ts".to_string())), - ]; - - for (comment, path, request, error) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!(resolution, Err(error), "{comment} {path:?} {request}"); - } -} - -// Small script for generating the test cases from enhanced-resolve -// for (c of testCases) { -// console.log("TestCase {") -// console.log(`name: ${JSON.stringify(c.name)},`) -// if (c.expect instanceof Error) { -// console.log(`expect: None,`) -// } else { -// console.log(`expect: Some(vec!${JSON.stringify(c.expect)}),`) -// } -// console.log(`exports_field: exports_field(json!(${JSON.stringify(c.suite[0], null, 2)})),`) -// console.log(`request: "${c.suite[1]}",`) -// console.log(`condition_names: vec!${JSON.stringify(c.suite[2])},`) -// console.log("},") -//} -struct TestCase { - name: &'static str, - expect: Option>, - exports_field: serde_json::Value, - request: &'static str, - condition_names: Vec<&'static str>, -} - -#[allow(clippy::needless_pass_by_value)] -fn exports_field(value: serde_json::Value) -> serde_json::Value { - value -} - -#[test] -fn test_cases() { - let test_cases = [ - TestCase { - name: "sample #1", - expect: Some(vec!["./dist/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/": { - "import": [ - "./dist/", - "./src/" - ], - "webpack": "./wp/" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "sample #1", - expect: Some(vec!["./src/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/": { - "import": [ - "./src/" - ], - "webpack": "./wp/" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - TestCase { - name: "sample #1 (wildcard)", - expect: Some(vec!["./dist/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/*": { - "import": [ - "./dist/*", - "./src/*" - ], - "webpack": "./wp/*" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "sample #1 (wildcard)", - expect: Some(vec!["./src/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/*": { - "import": [ - "./src/*" - ], - "webpack": "./wp/*" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - TestCase { - name: "sample #2", - expect: Some(vec!["./data/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./timezones/": "./data/timezones/" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #2 (wildcard)", - expect: Some(vec!["./data/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./timezones/*": "./data/timezones/*" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #3", - expect: Some(vec!["./data/timezones/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./": "./data/timezones/" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #3 (wildcard)", - expect: Some(vec!["./data/timezones/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./*": "./data/timezones/*.mjs" - })), - request: "./timezones/pdt", - condition_names: vec![], - }, - TestCase { - name: "sample #4", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./lib/": { - "browser": [ - "./browser/" - ] - }, - "./dist/index.js": { - "node": "./index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #4 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "node": "./index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #5", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/": { - "browser": [ - "./browser/" - ] - }, - "./dist/index.js": { - "node": "./index.js", - "default": "./browser/index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #5 (wildcard)", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "node": "./index.js", - "default": "./browser/index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./dist/a": "./dist/index.js" - })), - request: "./dist/aaa", - condition_names: vec![], - }, - TestCase { - name: "sample #7", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./dist/a/a/": "./dist/index.js" - })), - request: "./dist/a/a", - condition_names: vec![], - }, - TestCase { - name: "sample #7 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./dist/a/a/*": "./dist/index.js" - })), - request: "./dist/a/a", - condition_names: vec![], - }, - TestCase { - name: "sample #8", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": "./index.js" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #9", - expect: Some(vec!["./main.js"]), - exports_field: exports_field(json!({ - "./index.js": "./main.js" - })), - request: "./index.js", - condition_names: vec![], - }, - TestCase { - name: "sample #10", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #11", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./bar#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #12", - expect: Some(vec!["./ok.js#abc"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/ok.js#abc", - condition_names: vec![], - }, - TestCase { - name: "sample #12", - expect: Some(vec!["./ok.js#abc"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/ok.js#abc", - condition_names: vec![], - }, - TestCase { - name: "sample #13", - expect: Some(vec!["./ok.js?abc"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/ok.js?abc", - condition_names: vec![], - }, - TestCase { - name: "sample #14", - expect: Some(vec!["./🎉.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/🎉.js", - condition_names: vec![], - }, - TestCase { - name: "sample #15", - expect: Some(vec!["./%F0%9F%8E%89.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/%F0%9F%8E%89.js", - condition_names: vec![], - }, - TestCase { - name: "sample #16", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./🎉", - condition_names: vec![], - }, - TestCase { - name: "sample #17", - expect: Some(vec!["./other.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./%F0%9F%8E%89", - condition_names: vec![], - }, - TestCase { - name: "sample #18", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./module", - condition_names: vec![], - }, - TestCase { - name: "sample #19", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./module#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #20", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./module?foo", - condition_names: vec![], - }, - TestCase { - name: "sample #21", - expect: Some(vec!["./zizizi"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./z*z*z*" - })), - request: "./#zippi", - condition_names: vec![], - }, - TestCase { - name: "sample #22", - expect: Some(vec!["./d?e?f"]), - exports_field: exports_field(json!({ - "./a?b?c/": "./" - })), - request: "./a?b?c/d?e?f", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #1", - expect: Some(vec!["./dist/index.js"]), - exports_field: exports_field(json!({ - ".": "./dist/index.js" - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #2", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./": "./", - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #3", - expect: Some(vec!["./dist/a.js"]), - exports_field: exports_field(json!({ - "./dist/": "./dist/", - "./dist/*": "./dist/*", - "./dist*": "./dist*", - "./dist/index.js": "./dist/a.js" - })), - request: "./dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #4", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./": { - "browser": [ - "./browser/" - ] - }, - "./*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "browser": "./index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #5", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./": { - "browser": [ - "./browser/" - ] - }, - "./*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "node": "./node.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #6", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - ".": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #7", - expect: Some(vec!["./src/index.js"]), // `enhanced_resolve` is `None` - exports_field: exports_field(json!({ - ".": { - "default": "./src/index.js", - "browser": "./index.js", - "node": "./src/node/index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #8", - expect: Some(vec!["./src/index.js"]), - exports_field: exports_field(json!({ - ".": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #9", - expect: Some(vec!["./index"]), - exports_field: exports_field(json!({ - ".": "./index" - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #10", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./index": "./index.js" - })), - request: "./index", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #11", - expect: Some(vec!["./foo.js"]), - exports_field: exports_field(json!({ - "./": "./", - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #12", - expect: Some(vec!["./foo/bar/baz.js"]), - exports_field: exports_field(json!({ - "./": "./", - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo/bar/baz.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #13", - expect: Some(vec!["./foo/bar/baz.js"]), - exports_field: exports_field(json!({ - "./": "./", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo/bar/baz.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #14", - expect: Some(vec!["./foo/bar/baz.js"]), - exports_field: exports_field(json!({ - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo/bar/baz.js", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #1", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "require": "./require.js" - }, { - "import": "./import.mjs" - }] - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #2", - expect: Some(vec!["./import.mjs"]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "require": "./require.js" - }, { - "import": "./import.mjs" - }] - })), - request: ".", - condition_names: vec!["import"], - }, - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./require.js"]), - exports_field: exports_field(json!({ - ".": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./import.mjs"]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "import": "./import.mjs" - }] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./require.js"]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "require": [ - "./require.js" - ] - }, { - "import": [ - "./import.mjs", - "./import.js" - ] - }] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./import.mjs"]), - exports_field: exports_field(json!({ - ".": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "./import.mjs", - "./import.js" - ] - } - ] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./import.js"]), - exports_field: exports_field(json!({ - ".": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "./import.js" - ] - } - ] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "mapping to a folder root #1", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./timezones": "./data/timezones/" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #2", - expect: None, - exports_field: exports_field(json!({ - "./timezones/": "./data/timezones" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #3", - expect: Some(vec!["./data/timezones/pdt/index.mjs"]), - exports_field: exports_field(json!({ - "./timezones/pdt/": "./data/timezones/pdt/" - })), - request: "./timezones/pdt/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #3 (wildcard)", - expect: Some(vec!["./data/timezones/pdt/index.mjs"]), - exports_field: exports_field(json!({ - "./timezones/pdt/*": "./data/timezones/pdt/*" - })), - request: "./timezones/pdt/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #4", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./": "./timezones/" - })), - request: "./pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #4 (wildcard)", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./*": "./timezones/*" - })), - request: "./pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #5", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./": "./" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #5 (wildcard)", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./*": "./*" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #6", - expect: None, - exports_field: exports_field(json!({ - "./": "." - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #6 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "./*": "." - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #7", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": "./" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #7 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": "./*" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #1", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./": "./", - "./dist/": "./lib/" - })), - request: "./dist/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #1 (wildcard)", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./*": "./*", - "./dist/*": "./lib/*" - })), - request: "./dist/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #2", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/": "./dist/utils/", - "./dist/": "./lib/" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #2 (wildcard)", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/*": "./dist/utils/*", - "./dist/*": "./lib/*" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #3", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/index.js": "./dist/utils/index.js", - "./dist/utils/": "./dist/utils/index.mjs", - "./dist/": "./lib/" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #3 (wildcard)", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/index.js": "./dist/utils/index.js", - "./dist/utils/*": "./dist/utils/index.mjs", - "./dist/*": "./lib/*" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #4", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./": { - "browser": "./browser/" - }, - "./dist/": "./lib/" - })), - request: "./dist/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "the longest matching path prefix is prioritized #4 (wildcard)", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./*": { - "browser": "./browser/*" - }, - "./dist/*": "./lib/*" - })), - request: "./dist/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #1", - // `lodash/` does not start with './' so fallbacks to util - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "conditional mapping folder #1", - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": [ - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #1 (wildcard)", - // `lodash/` does not start with './' so fallbacks to util - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": [ - "lodash/*", - "./utils/*" - ], - "node": [ - "./utils-node/*" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "conditional mapping folder #1 (wildcard)", - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": [ - "./utils/*" - ], - "node": [ - "./utils-node/*" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #2", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./node/" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "conditional mapping folder #2 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "webpack": "./wpk/*", - "browser": [ - "lodash/*", - "./utils/*" - ], - "node": [ - "./node/*" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "conditional mapping folder #3", - expect: Some(vec!["./wpk/index.mjs"]), - exports_field: exports_field(json!({ - "./utils/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils/" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "conditional mapping folder #3 (wildcard)", - expect: Some(vec!["./wpk/index.mjs"]), - exports_field: exports_field(json!({ - "./utils/*": { - "webpack": "./wpk/*", - "browser": [ - "lodash/*", - "./utils/*" - ], - "node": [ - "./utils/*" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "incorrect exports field #1", - expect: None, - exports_field: exports_field(json!({ - "/utils/": "./a/" - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #2", - expect: None, - exports_field: exports_field(json!({ - "./utils/": "/a/" - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #3", - expect: None, - exports_field: exports_field(json!({ - "/utils/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #4", - expect: None, - exports_field: exports_field(json!({ - "./utils/": { - "browser": "/a/", - "default": "/b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #4 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "/a/", - "default": "/b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #5", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index": "./a/index.js" - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index.mjs": "./a/index.js" - })), - request: "./utils/index", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #7", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #8", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index.mjs": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - // Requests that are not `./` does not apply to `package_exports_resolve` - // TestCase { - // name: "incorrect request #1", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": "./a/" - // })), - // request: "/utils/index.mjs", - // condition_names: vec![], - // }, - // TestCase { - // name: "incorrect request #2", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": { - // "browser": "./a/", - // "default": "./b/" - // } - // })), - // request: "/utils/index.mjs", - // condition_names: vec!["browser"], - // }, - // TestCase { - // name: "incorrect request #3", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": { - // "browser": "./a/", - // "default": "./b/" - // } - // })), - // request: "../utils/index.mjs", - // condition_names: vec!["browser"], - // }, - // TestCase { - // name: "incorrect request #4", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": { - // "browser": "./a/", - // "default": "./b/" - // } - // })), - // request: "/utils/index.mjs/", - // condition_names: vec!["browser"], - // }, - TestCase { - name: "backtracking package base #1", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./../../utils/": "./dist/" - })), - request: "./../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #1 (wildcard)", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./../../utils/*": "./dist/*" - })), - request: "./../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #2", - expect: None, - exports_field: exports_field(json!({ - "../../utils/": "./dist/" - })), - request: "../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #2 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "../../utils/*": "./dist/*" - })), - request: "../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #3", - expect: None, - exports_field: exports_field(json!({ - "./utils/": "../src/" - })), - request: "./utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #3 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "./utils/*": "../src/*" - })), - request: "./utils/index", - condition_names: vec![], - }, - // enhanced-resolve does not handle backtracking here - // TestCase { - // name: "backtracking package base #4", - // expect: Some(vec!["./../src/index"]), - // exports_field: exports_field(json!({ - // "./utils/": "./../src/" - // })), - // request: "./utils/index", - // condition_names: vec![], - // }, - // TestCase { - // name: "backtracking package base #4 (wildcard)", - // expect: Some(vec!["./../src/index"]), - // exports_field: exports_field(json!({ - // "./utils/*": "./../src/*" - // })), - // request: "./utils/index", - // condition_names: vec![], - // }, - // TestCase { - // name: "backtracking package base #5", - // expect: Some(vec!["./src/../index.js"]), - // exports_field: exports_field(json!({ - // "./utils/index": "./src/../index.js" - // })), - // request: "./utils/index", - // condition_names: vec![], - // }, - TestCase { - name: "backtracking package base #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/../utils/index": "./src/../index.js" - })), - request: "./utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #7", - expect: None, - exports_field: exports_field(json!({ - "./utils/": { - "browser": "../this/" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #7", - expect: None, - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "../this/*" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #8", - // We throw "InvalidPackageTarget" - // expect: Some(vec!["./utils/../index"]), - expect: None, - exports_field: exports_field(json!({ - "./utils/": { - "browser": "./utils/../" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #8 (wildcard)", - // We throw "InvalidPackageTarget" - // expect: Some(vec!["./utils/../index"]), - expect: None, - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "./utils/../*" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #9", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./": "./src/../../", - "./dist/": "./dist/" - })), - request: "./dist/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #9 (wildcard)", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./*": "./src/../../*", - "./dist/*": "./dist/*" - })), - request: "./dist/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking target folder #1", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../../index"]), - exports_field: exports_field(json!({ - "./utils/": "./dist/" - })), - request: "./utils/timezone/../../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #1 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../../index"]), - exports_field: exports_field(json!({ - "./utils/*": "./dist/*" - })), - request: "./utils/timezone/../../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #2", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../index"]), - exports_field: exports_field(json!({ - "./utils/": "./dist/" - })), - request: "./utils/timezone/../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #2 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../index"]), - exports_field: exports_field(json!({ - "./utils/*": "./dist/*" - })), - request: "./utils/timezone/../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #3", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/target/../../index"]), - exports_field: exports_field(json!({ - "./utils/": "./dist/target/" - })), - request: "./utils/../../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #3 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/target/../../index"]), - exports_field: exports_field(json!({ - "./utils/*": "./dist/target/*" - })), - request: "./utils/../../index", - condition_names: vec![], - }, - // enhanced-resolve does not handle `node_modules` in target - TestCase { - name: "nested node_modules path #1", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": "./node_modules/" - } - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #1 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "./node_modules/*" - } - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #2", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./utils/../node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/": "./utils/../node_modules/" - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "nested node_modules path #2 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./utils/../node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": "./utils/../node_modules/*" - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "nested mapping #1", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": "./", - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested mapping #1 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": "./*", - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "nested mapping #2 (wildcard)", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #2 (wildcard)", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "nested mapping #3", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["webpack"], - }, - TestCase { - name: "nested mapping #3 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["webpack"], - }, - TestCase { - name: "nested mapping #4", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["node", "browser"], - }, - TestCase { - name: "nested mapping #4 (wildcard)", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["node", "browser"], - }, - TestCase { - name: "nested mapping #5", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node"], - }, - TestCase { - name: "nested mapping #5 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": { - "webpack": [ - "./wpck/*" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node"], - }, - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - TestCase { - name: "nested mapping #6 (wildcard)", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": { - "webpack": [ - "./wpck/*" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #6 (wildcard)", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./node/*" - ], - "default": { - "node": { - "webpack": [ - "./wpck/*" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - TestCase { - name: "nested mapping #7", - expect: Some(vec!["./y.js"]), - exports_field: exports_field(json!({ - "./a.js": { - "abc": { - "def": "./x.js" - }, - "ghi": "./y.js" - } - })), - request: "./a.js", - condition_names: vec!["abc", "ghi"], - }, - TestCase { - name: "nested mapping #8", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./a.js": { - "abc": { - "def": "./x.js", - "default": [] - }, - "ghi": "./y.js" - } - })), - request: "./a.js", - condition_names: vec!["abc", "ghi"], - }, - TestCase { - name: "syntax sugar #1", - expect: Some(vec!["./main.js"]), - exports_field: exports_field(json!("./main.js")), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #2", - expect: Some(vec![]), - exports_field: exports_field(json!("./main.js")), - request: "./lib.js", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #3", - expect: Some(vec!["./a.js"]), - exports_field: exports_field(json!(["./a.js", "./b.js"])), - request: ".", - condition_names: vec![], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "syntax sugar #3", - expect: Some(vec!["./b.js"]), - exports_field: exports_field(json!(["./b.js"])), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #4", - expect: Some(vec![]), - exports_field: exports_field(json!(["./a.js", "./b.js"])), - request: "./lib.js", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #5", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "browser": { - "default": "./index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "syntax sugar #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "browser": { - "default": "./index.js" - } - })), - request: "./lib.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "syntax sugar #7", - expect: None, - exports_field: exports_field(json!({ - "./node": "./node.js", - "browser": { - "default": "./index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "syntax sugar #8", - expect: None, - exports_field: exports_field(json!({ - "browser": { - "default": "./index.js" - }, - "./node": "./node.js" - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #1", - expect: Some(vec!["./abc/d"]), - exports_field: exports_field(json!({ - "./ab*": "./ab/*", - "./abc*": "./abc/*", - "./a*": "./a/*" - })), - request: "./abcd", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #2", - expect: Some(vec!["./abc/d/e"]), - exports_field: exports_field(json!({ - "./ab*": "./ab/*", - "./abc*": "./abc/*", - "./a*": "./a/*" - })), - request: "./abcd/e", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #3", - expect: Some(vec!["./abc/d"]), - exports_field: exports_field(json!({ - "./x/ab*": "./ab/*", - "./x/abc*": "./abc/*", - "./x/a*": "./a/*" - })), - request: "./x/abcd", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #4", - expect: Some(vec!["./abc/d/e"]), - exports_field: exports_field(json!({ - "./x/ab*": "./ab/*", - "./x/abc*": "./abc/*", - "./x/a*": "./a/*" - })), - request: "./x/abcd/e", - condition_names: vec!["browser"], - }, - TestCase { - name: "path tree edge case #1", - expect: Some(vec!["./A/b/d.js"]), - exports_field: exports_field(json!({ - "./a/": "./A/", - "./a/b/c": "./c.js" - })), - request: "./a/b/d.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #1 (wildcard)", - expect: Some(vec!["./A/b/d.js"]), - exports_field: exports_field(json!({ - "./a/*": "./A/*", - "./a/b/c": "./c.js" - })), - request: "./a/b/d.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #2", - expect: Some(vec!["./A/c.js"]), - exports_field: exports_field(json!({ - "./a/": "./A/", - "./a/b": "./b.js" - })), - request: "./a/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #2 (wildcard)", - expect: Some(vec!["./A/c.js"]), - exports_field: exports_field(json!({ - "./a/*": "./A/*", - "./a/b": "./b.js" - })), - request: "./a/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #3", - expect: Some(vec!["./A/b/d/c.js"]), - exports_field: exports_field(json!({ - "./a/": "./A/", - "./a/b/c/d": "./c.js" - })), - request: "./a/b/d/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #3 (wildcard)", - expect: Some(vec!["./A/b/d/c.js"]), - exports_field: exports_field(json!({ - "./a/*": "./A/*", - "./a/b/c/d": "./c.js" - })), - request: "./a/b/d/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #1", - expect: Some(vec!["./A/b.js"]), - exports_field: exports_field(json!({ - "./a/*.js": "./A/*.js" - })), - request: "./a/b.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #2", - expect: Some(vec!["./A/b/c.js"]), - exports_field: exports_field(json!({ - "./a/*.js": "./A/*.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #3", - expect: Some(vec!["./A/b/c.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": "./A/*/c.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #4", - expect: Some(vec!["./A/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": "./A/*/*.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #5", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/*.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #5", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/*.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./lib/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #6", - expect: Some(vec!["./browser/foo/bar.js"]), - exports_field: exports_field(json!({ - "./lib/*/bar.js": { - "browser": [ - "./browser/*/bar.js" - ] - }, - "./dist/*/bar.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./lib/foo/bar.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #6", - expect: Some(vec!["./browser/foo.js"]), - exports_field: exports_field(json!({ - "./lib/*/bar.js": { - "browser": [ - "./browser/*/bar.js" - ] - }, - "./dist/*/bar.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./dist/foo/bar.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #7", - expect: Some(vec!["./browser/foo/default.js"]), - exports_field: exports_field(json!({ - "./lib/*/bar.js": { - "browser": [ - "./browser/*/bar.js" - ] - }, - "./dist/*/bar.js": { - "node": "./*.js", - "default": "./browser/*/default.js" - } - })), - request: "./dist/foo/bar.js", - condition_names: vec!["default"], - }, - TestCase { - name: "wildcard pattern #8", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": "./A/*/*/*.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #9", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": [ - "./A/*/*/*.js", - "./B/*/*/*.js" - ] - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "wildcard pattern #9", - expect: Some(vec!["./B/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": [ - "./B/*/*/*.js" - ] - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #10", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/foo-*/c.js": "./A/*/*/*.js" - })), - request: "./a/foo-b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #11", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*-foo/c.js": "./A/*/*/*.js" - })), - request: "./a/b-foo/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #12", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/foo-*-foo/c.js": "./A/*/*/*.js" - })), - request: "./a/foo-b-foo/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #13", - expect: Some(vec!["./A/b/c/d.js"]), - exports_field: exports_field(json!({ - "./a/foo-*-foo/c.js": "./A/b/c/d.js" - })), - request: "./a/foo-b-foo/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #14", - expect: Some(vec!["./A/b/c/*.js"]), - exports_field: exports_field(json!({ - "./a/foo-foo/c.js": "./A/b/c/*.js" - })), - request: "./a/foo-foo/c.js", - condition_names: vec![], - }, - ]; - - for case in test_cases { - let resolved = Resolver::new(ResolveOptions { - condition_names: case - .condition_names - .iter() - .map(ToString::to_string) - .collect::>(), - ..ResolveOptions::default() - }) - .package_exports_resolve( - Path::new(""), - case.request, - &case.exports_field, - &mut Ctx::default(), - ) - .map(|p| p.map(|p| p.to_path_buf())); - if let Some(expect) = case.expect { - if expect.is_empty() { - assert!( - matches!(resolved, Err(ResolveError::PackagePathNotExported(_, _))), - "{} {:?}", - &case.name, - &resolved - ); - } else { - for expect in expect { - assert_eq!(resolved, Ok(Some(Path::new(expect).normalize())), "{}", &case.name); - } - } - } else { - assert!(resolved.is_err(), "{} {resolved:?}", &case.name); - } - } -} diff --git a/src/tests/extension_alias.rs b/src/tests/extension_alias.rs deleted file mode 100644 index 86afab73..00000000 --- a/src/tests/extension_alias.rs +++ /dev/null @@ -1,66 +0,0 @@ -//! - -use crate::{ResolveError, ResolveOptions, Resolver}; - -#[test] -fn extension_alias() { - let f = super::fixture().join("extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - extension_alias: vec![ - (".js".into(), vec![".ts".into(), ".js".into()]), - (".mjs".into(), vec![".mts".into()]), - ], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should alias fully specified file", f.clone(), "./index.js", f.join("index.ts")), - ("should alias fully specified file when there are two alternatives", f.clone(), "./dir/index.js", f.join("dir/index.ts")), - ("should also allow the second alternative", f.clone(), "./dir2/index.js", f.join("dir2/index.js")), - ("should support alias option without an array", f.clone(), "./dir2/index.mjs", f.join("dir2/index.mts")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } - - #[rustfmt::skip] - let fail = [ - ("should not allow to fallback to the original extension or add extensions", f, "./index.mjs"), - ]; - - for (comment, path, request) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!(resolution, Err(ResolveError::ExtensionAlias), "{comment} {path:?} {request}"); - } -} - -// should not apply extension alias to extensions or mainFiles field -#[test] -fn not_apply_to_extension_nor_main_files() { - let f = super::fixture().join("extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - extension_alias: vec![(".js".into(), vec![])], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("directory", f.clone(), "./dir2", "dir2/index.js"), - ("file", f.clone(), "./dir2/index", "dir2/index.js"), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - let expected = f.join(expected); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} diff --git a/src/tests/extensions.rs b/src/tests/extensions.rs deleted file mode 100644 index 1ebd86f4..00000000 --- a/src/tests/extensions.rs +++ /dev/null @@ -1,125 +0,0 @@ -//! - -use crate::{EnforceExtension, Resolution, ResolveContext, ResolveError, ResolveOptions, Resolver}; -use rustc_hash::FxHashSet; - -#[test] -fn extensions() { - let f = super::fixture().join("extensions"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".ts".into(), ".js".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve according to order of provided extensions", "./foo", "foo.ts"), - ("should resolve according to order of provided extensions (dir index)", "./dir", "dir/index.ts"), - ("should resolve according to main field in module root", ".", "index.js"), - // This is a core module - // ("should resolve single file module before directory", "module", "node_modules/module.js"), - ("should resolve trailing slash directory before single file", "module/", "node_modules/module/index.ts"), - ]; - - for (comment, request, expected_path) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - let expected = f.join(expected_path); - assert_eq!(resolved_path, Ok(expected), "{comment} {request} {expected_path}"); - } - - #[rustfmt::skip] - let fail = [ - ("not resolve to file when request has a trailing slash (relative)", "./foo.js/", "./foo.js/".into()) - ]; - - for (comment, request, expected_error) in fail { - let resolution = resolver.resolve(&f, request); - let error = ResolveError::NotFound(expected_error); - assert_eq!(resolution, Err(error), "{comment} {request} {resolution:?}"); - } -} - -// should default enforceExtension to true when extensions includes an empty string -#[test] -fn default_enforce_extension() { - let f = super::fixture().join("extensions"); - - let mut ctx = ResolveContext::default(); - let resolved = Resolver::new(ResolveOptions { - extensions: vec![".ts".into(), String::new(), ".js".into()], - ..ResolveOptions::default() - }) - .resolve_with_context(&f, "./foo", &mut ctx); - - assert_eq!(resolved.map(Resolution::into_path_buf), Ok(f.join("foo.ts"))); - assert_eq!( - ctx.file_dependencies, - FxHashSet::from_iter([f.join("foo.ts"), f.join("package.json")]) - ); - assert!(ctx.missing_dependencies.is_empty()); -} - -// should respect enforceExtension when extensions includes an empty string -#[test] -fn respect_enforce_extension() { - let f = super::fixture().join("extensions"); - - let mut ctx = ResolveContext::default(); - let resolved = Resolver::new(ResolveOptions { - enforce_extension: EnforceExtension::Disabled, - extensions: vec![".ts".into(), String::new(), ".js".into()], - ..ResolveOptions::default() - }) - .resolve_with_context(&f, "./foo", &mut ctx); - - assert_eq!(resolved.map(Resolution::into_path_buf), Ok(f.join("foo.ts"))); - assert_eq!( - ctx.file_dependencies, - FxHashSet::from_iter([f.join("foo.ts"), f.join("package.json")]) - ); - assert_eq!(ctx.missing_dependencies, FxHashSet::from_iter([f.join("foo")])); -} - -#[test] -fn multi_dot_extension() { - let f = super::fixture().join("extensions"); - - let resolver = Resolver::new(ResolveOptions { - // Test for `.d.ts`, not part of enhanced-resolve. - extensions: vec![".a.b.c".into(), ".d.ts".into(), ".ts".into(), ".js".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve according to order of provided extensions", "./foo", "foo.ts"), - ("should resolve file with extension", "./app.module", "app.module.js") - ]; - - for (comment, request, expected_path) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - let expected = f.join(expected_path); - assert_eq!(resolved_path, Ok(expected), "{comment} {request} {expected_path}"); - } - - #[rustfmt::skip] - let fail = [ - ("not resolve to file", "./index.", "./index.".into()) - ]; - - for (comment, request, expected_error) in fail { - let resolution = resolver.resolve(&f, request); - let error = ResolveError::NotFound(expected_error); - assert_eq!(resolution, Err(error), "{comment} {request} {resolution:?}"); - } -} - -#[test] -#[should_panic = "All extensions must start with a leading dot"] -fn without_leading_dot() { - Resolver::new(ResolveOptions { - extensions: vec!["ts".into(), "js".into()], - ..ResolveOptions::default() - }); -} diff --git a/src/tests/fallback.rs b/src/tests/fallback.rs deleted file mode 100644 index 3da2d767..00000000 --- a/src/tests/fallback.rs +++ /dev/null @@ -1,100 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/fallback.test.js - -#[test] -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -fn fallback() { - use super::memory_fs::MemoryFS; - use crate::{AliasValue, ResolveError, ResolveOptions, ResolverGeneric}; - use std::path::{Path, PathBuf}; - - let f = Path::new("/"); - - let file_system = MemoryFS::new(&[ - ("/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", ""), - ]); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - fallback: vec![ - ("aliasA".into(), vec![AliasValue::Path("a".into())]), - ("b$".into(), vec![AliasValue::Path("a/index".into())]), - ("c$".into(), vec![AliasValue::Path("/a/index".into())]), - ( - "multiAlias".into(), - vec![ - AliasValue::Path("b".into()), - AliasValue::Path("c".into()), - AliasValue::Path("d".into()), - AliasValue::Path("e".into()), - AliasValue::Path("a".into()), - ], - ), - ("recursive".into(), vec![AliasValue::Path("recursive/dir".into())]), - ("/d/dir".into(), vec![AliasValue::Path("/c/dir".into())]), - ("/d/index.js".into(), vec![AliasValue::Path("/c/index".into())]), - ("ignored".into(), vec![AliasValue::Ignore]), - ("node:path".into(), vec![AliasValue::Ignore]), - ], - modules: vec!["/".into()], - ..ResolveOptions::default() - }, - ); - - #[rustfmt::skip] - let pass = [ - ("should resolve a not aliased module 1", "a", "/a/index"), - ("should resolve a not aliased module 2", "a/index", "/a/index"), - ("should resolve a not aliased module 3", "a/dir", "/a/dir/index"), - ("should resolve a not aliased module 4", "a/dir/index", "/a/dir/index"), - ("should resolve an fallback module 1", "aliasA", "/a/index"), - ("should resolve an fallback module 2", "aliasA/index", "/a/index"), - ("should resolve an fallback module 3", "aliasA/dir", "/a/dir/index"), - ("should resolve an fallback module 4", "aliasA/dir/index", "/a/dir/index"), - ("should resolve a recursive aliased module 1", "recursive", "/recursive/index"), - ("should resolve a recursive aliased module 2", "recursive/index", "/recursive/index"), - ("should resolve a recursive aliased module 3", "recursive/dir", "/recursive/dir/index"), - ("should resolve a recursive aliased module 4", "recursive/dir/index", "/recursive/dir/index"), - ("should resolve a recursive aliased module 5", "recursive/file", "/recursive/dir/file"), - ("should resolve a file aliased module with a query 1", "b?query", "/b/index?query"), - ("should resolve a file aliased module with a query 2", "c?query", "/c/index?query"), - ("should resolve a path in a file aliased module 1", "b/index", "/b/index"), - ("should resolve a path in a file aliased module 2", "b/dir", "/b/dir/index"), - ("should resolve a path in a file aliased module 3", "b/dir/index", "/b/dir/index"), - ("should resolve a path in a file aliased module 4", "c/index", "/c/index"), - ("should resolve a path in a file aliased module 5", "c/dir", "/c/dir/index"), - ("should resolve a path in a file aliased module 6", "c/dir/index", "/c/dir/index"), - ("should resolve a file in multiple aliased dirs 1", "multiAlias/dir/file", "/e/dir/file"), - ("should resolve a file in multiple aliased dirs 2", "multiAlias/anotherDir", "/e/anotherDir/index"), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - - #[rustfmt::skip] - let ignore = [ - ("should resolve an ignore module", "ignored", ResolveError::Ignored(f.join("ignored"))), - ("should resolve node: builtin module", "node:path", ResolveError::Ignored(PathBuf::from("/node:path"))), - ]; - - for (comment, request, expected) in ignore { - let resolution = resolver.resolve(f, request); - assert_eq!(resolution, Err(expected), "{comment} {request}"); - } -} diff --git a/src/tests/full_specified.rs b/src/tests/full_specified.rs deleted file mode 100644 index a70c0191..00000000 --- a/src/tests/full_specified.rs +++ /dev/null @@ -1,113 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/fullSpecified.test.js - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows { - use std::path::PathBuf; - - use crate::{AliasValue, ResolveOptions, ResolverGeneric}; - - use super::super::memory_fs::MemoryFS; - - fn file_system() -> MemoryFS { - MemoryFS::new(&[ - ("/a/node_modules/package1/index.js", ""), - ("/a/node_modules/package1/file.js", ""), - ("/a/node_modules/package2/package.json", r#"{"main":"a"}"#), - ("/a/node_modules/package2/a.js", ""), - ("/a/node_modules/package3/package.json", r#"{"main":"dir"}"#), - ("/a/node_modules/package3/dir/index.js", ""), - ("/a/node_modules/package4/package.json", r#"{"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", ""), - ]) - } - - #[test] - fn test() { - let file_system = file_system(); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - alias: vec![ - ("alias1".into(), vec![AliasValue::from("/a/abc")]), - ("alias2".into(), vec![AliasValue::from("/a")]), - ], - alias_fields: vec![vec!["browser".into()]], - fully_specified: true, - ..ResolveOptions::default() - }, - ); - - let failing_resolves = [ - ("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"), - ]; - - for (comment, request) in failing_resolves { - let resolution = resolver.resolve("/a", request); - assert!(resolution.is_err(), "{comment} {request}"); - } - - let successful_resolves = [ - ("fully relative", "./abc.js", "/a/abc.js"), - ("fully absolute", "/a/abc.js", "/a/abc.js"), - ("fully relative in package", "package1/file.js", "/a/node_modules/package1/file.js"), - ("extensions in mainFiles", "package1", "/a/node_modules/package1/index.js"), - ("extensions in mainFields", "package2", "/a/node_modules/package2/a.js"), - ("extensions in alias", "alias1", "/a/abc.js"), - ("directories in alias", "alias2", "/a/index.js"), - ("directories in packages", "package3", "/a/node_modules/package3/dir/index.js"), - ("extensions in aliasFields", "package4/a.js", "/a/node_modules/package4/b.js"), - ]; - - for (comment, request, expected) in successful_resolves { - let resolution = resolver.resolve("/a", request).map(|r| r.full_path()); - assert_eq!(resolution, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - } - - #[test] - #[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. - fn resolve_to_context() { - let file_system = file_system(); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - alias: vec![ - ("alias1".into(), vec![AliasValue::from("/a/abc")]), - ("alias2".into(), vec![AliasValue::from("/a")]), - ], - alias_fields: vec![vec!["browser".into()]], - fully_specified: true, - resolve_to_context: true, - ..ResolveOptions::default() - }, - ); - - let successful_resolves = [ - ("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", "/a/node_modules/package3/dir"), - ]; - - for (comment, request, expected) in successful_resolves { - let resolution = resolver.resolve("/a", request).map(|r| r.full_path()); - assert_eq!(resolution, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - } -} diff --git a/src/tests/imports_field.rs b/src/tests/imports_field.rs deleted file mode 100644 index c928627a..00000000 --- a/src/tests/imports_field.rs +++ /dev/null @@ -1,1320 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/importsField.test.js -//! -//! The huge imports field test cases are at the bottom of this file. - -use serde_json::json; - -use crate::{Ctx, JSONMap, PathUtil, ResolveError, ResolveOptions, Resolver}; -use std::path::Path; - -#[test] -fn test_simple() { - let f = super::fixture().join("imports-field"); - let f2 = super::fixture().join("imports-exports-wildcard/node_modules/m/"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve using imports field instead of self-referencing", f.clone(), "#imports-field", f.join("b.js")), - ("should resolve using imports field instead of self-referencing for a subpath", f.join("dir"), "#imports-field", f.join("b.js")), - ("should resolve package #1", f.clone(), "#a/dist/main.js", f.join("node_modules/a/lib/lib2/main.js")), - ("should resolve package #3", f.clone(), "#ccc/index.js", f.join("node_modules/c/index.js")), - ("should resolve package #4", f.clone(), "#c", f.join("node_modules/c/index.js")), - ("should resolve with wildcard pattern", f2.clone(), "#internal/i.js", f2.join("src/internal/i.js")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } - - // Note added: - // * should resolve absolute path as an imports field target - // * should log the correct info - - #[rustfmt::skip] - let fail = [ - ("should disallow resolve out of package scope", f.clone(), "#b", ResolveError::InvalidPackageTarget("../b.js".to_string(), "#b".to_string(), f.join("package.json"))), - ("should resolve package #2", f.clone(), "#a", ResolveError::PackageImportNotDefined("#a".to_string(), f.join("package.json"))), - ]; - - for (comment, path, request, error) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!(resolution, Err(error), "{comment} {path:?} {request}"); - } -} - -#[test] -fn shared_resolvers() { - let f = super::fixture().join("imports-field"); - - // field name #1 - let resolver1 = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - imports_fields: vec![vec!["imports".into()]], - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - let resolved_path = resolver1.resolve(&f, "#imports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("b.js"))); - - // field name #2 - let resolver2 = resolver1.clone_with_options(ResolveOptions { - imports_fields: vec![vec!["other".into(), "imports".into()]], - ..ResolveOptions::default() - }); - - let resolved_path = resolver2.resolve(&f, "#b").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("a.js"))); -} - -// Small script for generating the test cases from enhanced_resolve -// for (c of testCases) { -// console.log("TestCase {") -// console.log(`name: ${JSON.stringify(c.name)},`) -// if (c.expect instanceof Error) { -// console.log(`expect: None,`) -// } else { -// console.log(`expect: Some(vec!${JSON.stringify(c.expect)}),`) -// } -// console.log(`imports_field: imports_field(json!(${JSON.stringify(c.suite[0], null, 2)})),`) -// console.log(`request: "${c.suite[1]}",`) -// console.log(`condition_names: vec!${JSON.stringify(c.suite[2])},`) -// console.log("},") -// } - -struct TestCase { - name: &'static str, - expect: Option>, - imports_field: JSONMap, - request: &'static str, - condition_names: Vec<&'static str>, -} - -#[allow(clippy::needless_pass_by_value)] -fn imports_field(value: serde_json::Value) -> JSONMap { - let s = serde_json::to_string(&value).unwrap(); - serde_json::from_str(&s).unwrap() -} - -#[test] -fn test_cases() { - let test_cases = [ - TestCase { - name: "sample #1", - expect: Some(vec!["./dist/test/file.js"]), - imports_field: imports_field(json!({ - "#abc/": { - "import": [ - "./dist/", - "./src/" - ], - "webpack": "./wp/" - }, - "#abc": "./main.js" - })), - request: "#abc/test/file.js", - condition_names: vec!["import", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "sample #1", - expect: Some(vec!["./src/test/file.js"]), - imports_field: imports_field(json!({ - "#abc/": { - "import": [ - "./src/" - ], - "webpack": "./wp/" - }, - "#abc": "./main.js" - })), - request: "#abc/test/file.js", - condition_names: vec!["import", "webpack"], - }, - TestCase { - name: "sample #2", - expect: Some(vec!["./data/timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#1/timezones/": "./data/timezones/" - })), - request: "#1/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #3", - expect: Some(vec!["./data/timezones/timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#aaa/": "./data/timezones/", - "#a/": "./data/timezones/" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #4", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/lib/": { - "browser": [ - "./browser/" - ] - }, - "#a/dist/index.js": { - "node": "./index.js" - } - })), - request: "#a/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #5", - expect: Some(vec!["./browser/index.js"]), - imports_field: imports_field(json!({ - "#a/lib/": { - "browser": [ - "./browser/" - ] - }, - "#a/dist/index.js": { - "node": "./index.js", - "default": "./browser/index.js" - } - })), - request: "#a/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #6", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/dist/a": "./dist/index.js" - })), - request: "#a/dist/aaa", - condition_names: vec![], - }, - TestCase { - name: "sample #7", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/a/a/": "./dist/index.js" - })), - request: "#a/a/a", - condition_names: vec![], - }, - TestCase { - name: "sample #8", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": "./index.js" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #9", - expect: Some(vec!["./main.js"]), - imports_field: imports_field(json!({ - "#a/index.js": "./main.js" - })), - request: "#a/index.js", - condition_names: vec![], - }, - TestCase { - name: "sample #10", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #11", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/bar#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #12", - expect: Some(vec!["./ok.js#abc"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/ok.js#abc", - condition_names: vec![], - }, - TestCase { - name: "sample #13", - expect: Some(vec!["./ok.js?abc"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/ok.js?abc", - condition_names: vec![], - }, - TestCase { - name: "sample #14", - expect: Some(vec!["./🎉.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/🎉.js", - condition_names: vec![], - }, - TestCase { - name: "sample #15", - expect: Some(vec!["./%F0%9F%8E%89.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/%F0%9F%8E%89.js", - condition_names: vec![], - }, - TestCase { - name: "sample #16", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/🎉", - condition_names: vec![], - }, - TestCase { - name: "sample #17", - expect: Some(vec!["./other.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/%F0%9F%8E%89", - condition_names: vec![], - }, - TestCase { - name: "sample #18", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/module", - condition_names: vec![], - }, - TestCase { - name: "sample #19", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/module#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #20", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/module?foo", - condition_names: vec![], - }, - TestCase { - name: "sample #21", - expect: Some(vec!["./d?e?f"]), - imports_field: imports_field(json!({ - "#a/a?b?c/": "./" - })), - request: "#a/a?b?c/d?e?f", - condition_names: vec![], - }, - TestCase { - name: "sample #22", - // We throw InvalidPackageTarget - expect: None, - // expect: Some(vec!["/user/a/index"]), - imports_field: imports_field(json!({ - "#a/": "/user/a/" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #1", - expect: Some(vec!["./A/b/d.js"]), - imports_field: imports_field(json!({ - "#a/": "./A/", - "#a/b/c": "./c.js" - })), - request: "#a/b/d.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #2", - expect: Some(vec!["./A/c.js"]), - imports_field: imports_field(json!({ - "#a/": "./A/", - "#a/b": "./b.js" - })), - request: "#a/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #3", - expect: Some(vec!["./A/b/c/d.js"]), - imports_field: imports_field(json!({ - "#a/": "./A/", - "#a/b/c/d": "./c.js" - })), - request: "#a/b/c/d.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #1", - expect: Some(vec!["./dist/index.js"]), - imports_field: imports_field(json!({ - "#a": "./dist/index.js" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #2", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": "./" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #3", - expect: Some(vec!["./dist/a.js"]), - imports_field: imports_field(json!({ - "#a/": "./dist/", - "#a/index.js": "./dist/a.js" - })), - request: "#a/index.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #4", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "./browser/" - ] - }, - "#a/index.js": { - "browser": "./index.js" - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #5", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "./browser/" - ] - }, - "#a/index.js": { - "node": "./node.js" - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #6", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: "#a", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #7", - expect: Some(vec!["./src/index.js"]), // `enhanced_resolve` is `None` - imports_field: imports_field(json!({ - "#a": { - "default": "./src/index.js", - "browser": "./index.js", - "node": "./src/node/index.js" - } - })), - request: "#a", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #8", - expect: Some(vec!["./src/index.js"]), - imports_field: imports_field(json!({ - "#a": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #9", - expect: Some(vec!["./index"]), - imports_field: imports_field(json!({ - "#a": "./index" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #10", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/index": "./index.js" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #11", - // We throw InvalidPackageTarget - // expect: Some(vec!["b"]), - expect: None, - imports_field: imports_field(json!({ - "#a": "b" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #12", - // We throw InvalidPackageTarget - // expect: Some(vec!["b/index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "b/" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #13", - // We throw InvalidPackageTarget - // expect: Some(vec!["b#anotherhashishere"]), - expect: None, - imports_field: imports_field(json!({ - "#a?q=a#hashishere": "b#anotherhashishere" - })), - request: "#a?q=a#hashishere", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #1", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #2", - expect: Some(vec!["./import.mjs"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec!["import"], - }, - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./require.js"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./import.mjs"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./require.js"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": [ - "./require.js" - ] - }, - { - "import": [ - "./import.mjs", - "#b/import.js" - ] - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./import.mjs"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "./import.mjs", - "#b/import.js" - ] - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "#b/import.js" - ] - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "mapping to a folder root #1", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#timezones": "./data/timezones/" - })), - request: "#timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #2", - expect: None, - imports_field: imports_field(json!({ - "#timezones/": "./data/timezones" - })), - request: "#timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #3", - expect: Some(vec!["./data/timezones/pdt/index.mjs"]), - imports_field: imports_field(json!({ - "#timezones/pdt/": "./data/timezones/pdt/" - })), - request: "#timezones/pdt/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #4", - expect: Some(vec!["./timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#a/": "./timezones/" - })), - request: "#a/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #5", - expect: Some(vec!["./timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#a/": "./" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #6", - expect: None, - imports_field: imports_field(json!({ - "#a/": "." - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #7", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": "./" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #1", - expect: Some(vec!["./lib/index.mjs"]), - imports_field: imports_field(json!({ - "#a/": "./", - "#a/dist/": "./lib/" - })), - request: "#a/dist/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #2", - expect: Some(vec!["./dist/utils/index.js"]), - imports_field: imports_field(json!({ - "#a/dist/utils/": "./dist/utils/", - "#a/dist/": "./lib/" - })), - request: "#a/dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #3", - expect: Some(vec!["./dist/utils/index.js"]), - imports_field: imports_field(json!({ - "#a/dist/utils/index.js": "./dist/utils/index.js", - "#a/dist/utils/": "./dist/utils/index.mjs", - "#a/dist/": "./lib/" - })), - request: "#a/dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #4", - expect: Some(vec!["./lib/index.mjs"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./browser/" - }, - "#a/dist/": "./lib/" - })), - request: "#a/dist/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #1", - // This behaves differently from enhanced_resolve, because `lodash/` is an an InvalidPackageConfig - // expect: Some(vec!["lodash/index.js"]), - expect: Some(vec!["./utils/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "conditional mapping folder #1", - expect: Some(vec!["./utils/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #2", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./node/" - ] - } - })), - request: "#a/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "conditional mapping folder #3", - expect: Some(vec!["./wpk/index.mjs"]), - imports_field: imports_field(json!({ - "#a/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils/" - ] - } - })), - request: "#a/index.mjs", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "incorrect exports field #1", - // We throw `PackageImportNotDefined` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "/utils/": "./a/" - })), - request: "#a/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #2", - // We throw `PackageImportNotDefined` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "/utils/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#a/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #3", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index": "./a/index.js" - })), - request: "#a/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #4", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index.mjs": "./a/index.js" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #5", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "#a/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #6", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index.mjs": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "#a/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #1", - // We don't throw in `package_imports_exports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": "./a/" - })), - request: "/utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect request #2", - // We don't throw in `package_imports_exports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #3", - // We don't throw in `package_imports_exports_resolve`, it's thrown in `package_imports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #4", - // We don't throw in `package_imports_exports_resolve`, it's thrown in `package_imports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#/", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #5", - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#a/", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #1", - // expect: Some(vec!["./dist/index"]), - expect: Some(vec!["dist/index"]), - imports_field: imports_field(json!({ - "#a/../../utils/": "./dist/" - })), - request: "#a/../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #2", - // We throw InvalidPackageTarget - // expect: Some(vec!["./dist/../../utils/index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "./dist/" - })), - request: "#a/../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #3", - // We throw InvalidPackageTarget - // expect: Some(vec!["../src/index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "../src/" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #4", - // We throw InvalidPackageTarget - // expect: Some(vec!["./utils/../../../index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": { - "browser": "./utils/../../../" - } - })), - request: "#a/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #1", - // expect: Some(vec!["moment/node_modules/lodash/dist/index.js"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": { - "browser": "moment/node_modules/" - } - })), - request: "#a/lodash/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #2", - // We throw InvalidPackageTarget - // expect: Some(vec!["../node_modules/lodash/dist/index.js"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "../node_modules/" - })), - request: "#a/lodash/dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "nested mapping #1", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": "./", - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./node/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "nested mapping #3", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["webpack"], - }, - TestCase { - name: "nested mapping #4", - // We throw NotFound - // expect: Some(vec!["moment/node/index.js"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "moment/node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["node", "browser"], - }, - TestCase { - name: "nested mapping #5", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "node"], - }, - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./node/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - TestCase { - name: "nested mapping #7", - expect: Some(vec!["./y.js"]), - imports_field: imports_field(json!({ - "#a": { - "abc": { - "def": "./x.js" - }, - "ghi": "./y.js" - } - })), - request: "#a", - condition_names: vec!["abc", "ghi"], - }, - TestCase { - name: "nested mapping #8", - // We throw PackageImportNotDefined - // expect: Some(vec![]), - expect: None, - imports_field: imports_field(json!({ - "#a": { - "abc": { - "def": "./x.js", - "default": [] - }, - "ghi": "./y.js" - } - })), - request: "#a", - condition_names: vec!["abc", "ghi"], - }, - ]; - - for case in test_cases { - let resolved = Resolver::default() - .package_imports_exports_resolve( - case.request, - &case.imports_field, - Path::new(""), - true, - &case.condition_names.iter().map(ToString::to_string).collect::>(), - &mut Ctx::default(), - ) - .map(|p| p.map(|p| p.to_path_buf())); - if let Some(expect) = case.expect { - if expect.is_empty() { - assert!(matches!(resolved, Ok(None)), "{} {:?}", &case.name, &resolved); - } else { - for expect in expect { - assert_eq!(resolved, Ok(Some(Path::new(expect).normalize())), "{}", &case.name); - } - } - } else { - assert!(resolved.is_err(), "{} {resolved:?}", &case.name); - } - } -} diff --git a/src/tests/incorrect_description_file.rs b/src/tests/incorrect_description_file.rs deleted file mode 100644 index e2caecbb..00000000 --- a/src/tests/incorrect_description_file.rs +++ /dev/null @@ -1,65 +0,0 @@ -//! - -use rustc_hash::FxHashSet; - -use crate::{JSONError, Resolution, ResolveContext, ResolveError, ResolveOptions, Resolver}; - -// should not resolve main in incorrect description file #1 -#[test] -fn incorrect_description_file_1() { - let f = super::fixture().join("incorrect-package"); - let mut ctx = ResolveContext::default(); - let resolution = Resolver::default().resolve_with_context(f.join("pack1"), ".", &mut ctx); - let error = ResolveError::JSON(JSONError { - path: f.join("pack1/package.json"), - message: String::from("EOF while parsing a value at line 3 column 0"), - line: 3, - column: 0, - }); - assert_eq!(resolution, Err(error)); - assert_eq!( - ctx.file_dependencies, - FxHashSet::from_iter([f.join("pack1"), f.join("pack1/package.json")]) - ); - assert!(!ctx.missing_dependencies.is_empty()); -} - -// should not resolve main in incorrect description file #2 -#[test] -fn incorrect_description_file_2() { - let f = super::fixture().join("incorrect-package"); - let resolution = Resolver::default().resolve(f.join("pack2"), "."); - let error = ResolveError::JSON(JSONError { - path: f.join("pack2/package.json"), - message: String::from("EOF while parsing a value at line 1 column 0"), - line: 1, - column: 0, - }); - assert_eq!(resolution, Err(error)); -} - -// should not resolve main in incorrect description file #3 -#[test] -fn incorrect_description_file_3() { - let f = super::fixture().join("incorrect-package"); - let resolution = Resolver::default().resolve(f.join("pack2"), "."); - assert!(resolution.is_err()); -} - -// `enhanced_resolve` does not have this test case -#[test] -fn no_description_file() { - let f = super::fixture_root().join("enhanced_resolve"); - - // has description file - let resolver = Resolver::default(); - assert_eq!( - resolver.resolve(&f, ".").map(Resolution::into_path_buf), - Ok(f.join("lib/index.js")) - ); - - // without description file - let resolver = - Resolver::new(ResolveOptions { description_files: vec![], ..ResolveOptions::default() }); - assert_eq!(resolver.resolve(&f, "."), Err(ResolveError::NotFound(".".into()))); -} diff --git a/src/tests/main_field.rs b/src/tests/main_field.rs deleted file mode 100644 index 3cadc8ce..00000000 --- a/src/tests/main_field.rs +++ /dev/null @@ -1,24 +0,0 @@ -//! Not part of enhanced_resolve's test suite - -use crate::{ResolveOptions, Resolver}; - -#[test] -fn test() { - let f = super::fixture().join("restrictions"); - - let resolver1 = Resolver::new(ResolveOptions { - main_fields: vec!["style".into()], - ..ResolveOptions::default() - }); - - let resolution = resolver1.resolve(&f, "pck2").map(|r| r.full_path()); - assert_eq!(resolution, Ok(f.join("node_modules/pck2/index.css"))); - - let resolver2 = resolver1.clone_with_options(ResolveOptions { - main_fields: vec!["module".into(), "main".into()], - ..ResolveOptions::default() - }); - - let resolution = resolver2.resolve(&f, "pck2").map(|r| r.full_path()); - assert_eq!(resolution, Ok(f.join("node_modules/pck2/module.js"))); -} diff --git a/src/tests/memory_fs.rs b/src/tests/memory_fs.rs deleted file mode 100644 index e4116609..00000000 --- a/src/tests/memory_fs.rs +++ /dev/null @@ -1,74 +0,0 @@ -use std::{ - io, - path::{Path, PathBuf}, -}; - -use crate::{FileMetadata, FileSystem}; - -#[derive(Default)] -pub struct MemoryFS { - fs: vfs::MemoryFS, -} - -impl MemoryFS { - /// # Panics - /// - /// * Fails to create directory - /// * Fails to write file - #[allow(dead_code)] - pub fn new(data: &[(&'static str, &'static str)]) -> Self { - let mut fs = Self { fs: vfs::MemoryFS::default() }; - for (path, content) in data { - fs.add_file(Path::new(path), content); - } - fs - } - - #[allow(dead_code)] - pub fn add_file(&mut self, path: &Path, content: &str) { - use vfs::FileSystem; - let fs = &mut self.fs; - // Create all parent directories - for path in path.ancestors().collect::>().iter().rev() { - let path = path.to_string_lossy(); - if !fs.exists(path.as_ref()).unwrap() { - fs.create_dir(path.as_ref()).unwrap(); - } - } - // Create file - let mut file = fs.create_file(path.to_string_lossy().as_ref()).unwrap(); - file.write_all(content.as_bytes()).unwrap(); - } -} - -impl FileSystem for MemoryFS { - fn read_to_string(&self, path: &Path) -> io::Result { - use vfs::FileSystem; - let mut file = self - .fs - .open_file(path.to_string_lossy().as_ref()) - .map_err(|err| io::Error::new(io::ErrorKind::NotFound, err))?; - let mut buffer = String::new(); - file.read_to_string(&mut buffer).unwrap(); - Ok(buffer) - } - - fn metadata(&self, path: &Path) -> io::Result { - use vfs::FileSystem; - let metadata = self - .fs - .metadata(path.to_string_lossy().as_ref()) - .map_err(|err| io::Error::new(io::ErrorKind::NotFound, err))?; - let is_file = metadata.file_type == vfs::VfsFileType::File; - let is_dir = metadata.file_type == vfs::VfsFileType::Directory; - Ok(FileMetadata::new(is_file, is_dir, false)) - } - - fn symlink_metadata(&self, path: &Path) -> io::Result { - self.metadata(path) - } - - fn canonicalize(&self, _path: &Path) -> io::Result { - Err(io::Error::new(io::ErrorKind::NotFound, "not a symlink")) - } -} diff --git a/src/tests/missing.rs b/src/tests/missing.rs deleted file mode 100644 index 4bf611ef..00000000 --- a/src/tests/missing.rs +++ /dev/null @@ -1,106 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/missing.test.js - -use normalize_path::NormalizePath; - -use crate::{AliasValue, ResolveContext, ResolveOptions, Resolver}; - -#[test] -fn test() { - let f = super::fixture(); - - let data = [ - ( - "./missing-file", - vec![f.join("missing-file"), f.join("missing-file.js"), f.join("missing-file.node")], - ), - ( - "missing-module", - vec![ - f.join("node_modules/missing-module"), - f.parent().unwrap().join("node_modules"), // enhanced-resolve is "node_modules/missing-module" - ], - ), - ( - "missing-module/missing-file", - vec![ - f.join("node_modules/missing-module"), - // f.parent().unwrap().join("node_modules/missing-module"), // we don't report this - ], - ), - ( - "m1/missing-file", - vec![ - f.join("node_modules/m1/missing-file"), - f.join("node_modules/m1/missing-file.js"), - f.join("node_modules/m1/missing-file.node"), - // f.parent().unwrap().join("node_modules/m1"), // we don't report this - ], - ), - ( - "m1/", - vec![ - f.join("node_modules/m1/index"), - f.join("node_modules/m1/index.js"), - f.join("node_modules/m1/index.json"), - f.join("node_modules/m1/index.node"), - ], - ), - ("m1/a", vec![f.join("node_modules/m1/a")]), - ]; - - let resolver = Resolver::default(); - - for (specifier, missing_dependencies) in data { - let mut ctx = ResolveContext::default(); - let _ = resolver.resolve_with_context(&f, specifier, &mut ctx); - - for path in ctx.file_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - } - - for path in missing_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - assert!( - ctx.missing_dependencies.contains(&path), - "{specifier}: {path:?} not in {:?}", - &ctx.missing_dependencies - ); - } - } -} - -#[test] -fn alias_and_extensions() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias: vec![ - ( - "@scope-js/package-name/dir$".into(), - vec![AliasValue::Path(f.join("foo/index.js").to_string_lossy().to_string())], - ), - ( - "react-dom".into(), - vec![AliasValue::Path(f.join("foo/index.js").to_string_lossy().to_string())], - ), - ], - extensions: vec![".server.ts".into()], - - ..ResolveOptions::default() - }); - - let mut ctx = ResolveContext::default(); - let _ = resolver.resolve_with_context(&f, "@scope-js/package-name/dir/router", &mut ctx); - let _ = resolver.resolve_with_context(&f, "react-dom/client", &mut ctx); - - for path in ctx.file_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - } - - for path in ctx.missing_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - if let Some(path) = path.parent() { - assert!(!path.is_file(), "{path:?} must not be a file"); - } - } -} diff --git a/src/tests/mod.rs b/src/tests/mod.rs deleted file mode 100644 index 94e6bd86..00000000 --- a/src/tests/mod.rs +++ /dev/null @@ -1,49 +0,0 @@ -mod alias; -mod browser_field; -mod builtins; -mod dependencies; -mod exports_field; -mod extension_alias; -mod extensions; -mod fallback; -mod full_specified; -mod imports_field; -mod incorrect_description_file; -mod main_field; -mod memory_fs; -mod missing; -mod resolve; -mod restrictions; -mod roots; -mod scoped_packages; -mod simple; -mod symlink; -mod tsconfig_paths; -mod tsconfig_project_references; - -use crate::Resolver; -use std::{env, path::PathBuf, sync::Arc, thread}; - -pub fn fixture_root() -> PathBuf { - env::current_dir().unwrap().join("fixtures") -} - -pub fn fixture() -> PathBuf { - fixture_root().join("enhanced_resolve").join("test").join("fixtures") -} - -#[test] -fn threaded_environment() { - let cwd = env::current_dir().unwrap(); - let resolver = Arc::new(Resolver::default()); - for _ in 0..2 { - _ = thread::spawn({ - let cwd = cwd.clone(); - let resolver = Arc::clone(&resolver); - move || { - _ = resolver.resolve(cwd, "."); - } - }) - .join(); - } -} diff --git a/src/tests/resolve.rs b/src/tests/resolve.rs deleted file mode 100644 index f2dbb88e..00000000 --- a/src/tests/resolve.rs +++ /dev/null @@ -1,119 +0,0 @@ -//! - -use crate::{ResolveError, ResolveOptions, Resolver}; - -#[test] -fn resolve() { - let f = super::fixture(); - - let resolver = Resolver::default(); - - let main1_js_path = f.join("main1.js").to_string_lossy().to_string(); - - #[rustfmt::skip] - let pass = [ - ("absolute path", f.clone(), main1_js_path.as_str(), f.join("main1.js")), - ("file with .js", f.clone(), "./main1.js", f.join("main1.js")), - ("file without extension", f.clone(), "./main1", f.join("main1.js")), - ("another file with .js", f.clone(), "./a.js", f.join("a.js")), - ("another file without extension", f.clone(), "./a", f.join("a.js")), - ("file in module with .js", f.clone(), "m1/a.js", f.join("node_modules/m1/a.js")), - ("file in module without extension", f.clone(), "m1/a", f.join("node_modules/m1/a.js")), - ("another file in module without extension", f.clone(), "complexm/step1", f.join("node_modules/complexm/step1.js")), - ("from submodule to file in sibling module", f.join("node_modules/complexm"), "m2/b.js", f.join("node_modules/m2/b.js")), - ("from nested directory to overwritten file in module", f.join("multiple_modules"), "m1/a.js", f.join("multiple_modules/node_modules/m1/a.js")), - ("from nested directory to not overwritten file in module", f.join("multiple_modules"), "m1/b.js", f.join("node_modules/m1/b.js")), - ("file with query", f.clone(), "./main1.js?query", f.join("main1.js?query")), - ("file with fragment", f.clone(), "./main1.js#fragment", f.join("main1.js#fragment")), - ("file with fragment and query", f.clone(), "./main1.js#fragment?query", f.join("main1.js#fragment?query")), - ("file with query and fragment", f.clone(), "./main1.js?#fragment", f.join("main1.js?#fragment")), - - ("file with query (unicode)", f.clone(), "./测试.js?query", f.join("测试.js?query")), - ("file with fragment (unicode)", f.clone(), "./测试.js#fragment", f.join("测试.js#fragment")), - ("file with fragment and query (unicode)", f.clone(), "./测试.js#fragment?query", f.join("测试.js#fragment?query")), - ("file with query and fragment (unicode)", f.clone(), "./测试.js?#fragment", f.join("测试.js?#fragment")), - - ("file in module with query", f.clone(), "m1/a?query", f.join("node_modules/m1/a.js?query")), - ("file in module with fragment", f.clone(), "m1/a#fragment", f.join("node_modules/m1/a.js#fragment")), - ("file in module with fragment and query", f.clone(), "m1/a#fragment?query", f.join("node_modules/m1/a.js#fragment?query")), - ("file in module with query and fragment", f.clone(), "m1/a?#fragment", f.join("node_modules/m1/a.js?#fragment")), - ("file in module with query and fragment", f.clone(), "m1/a?#fragment", f.join("node_modules/m1/a.js?#fragment")), - ("differ between directory and file, resolve file", f.clone(), "./dirOrFile", f.join("dirOrFile.js")), - ("differ between directory and file, resolve directory", f.clone(), "./dirOrFile/", f.join("dirOrFile/index.js")), - ("find node_modules outside of node_modules", f.join("browser-module/node_modules"), "m1/a", f.join("node_modules/m1/a.js")), - ("don't crash on main field pointing to self", f.clone(), "./main-field-self", f.join("./main-field-self/index.js")), - ("don't crash on main field pointing to self (2)", f.clone(), "./main-field-self2", f.join("./main-field-self2/index.js")), - // enhanced-resolve has `#` prepended with a `\0`, they are removed from the - // following 3 expected test results. - // See https://github.com/webpack/enhanced-resolve#escaping - ("handle fragment edge case (no fragment)", f.clone(), "./no#fragment/#/#", f.join("no#fragment/#/#.js")), - ("handle fragment edge case (fragment)", f.clone(), "./no#fragment/#/", f.join("no.js#fragment/#/")), - ("handle fragment escaping", f.clone(), "./no\0#fragment/\0#/\0##fragment", f.join("no#fragment/#/#.js#fragment")), - - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn issue238_resolve() { - let f = super::fixture().join("issue-238"); - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into(), ".jsx".into(), ".ts".into(), ".tsx".into()], - modules: vec!["src/a".into(), "src/b".into(), "src/common".into(), "node_modules".into()], - ..ResolveOptions::default() - }); - let resolved_path = - resolver.resolve(f.join("src/common"), "config/myObjectFile").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("src/common/config/myObjectFile.js")),); -} - -#[test] -fn prefer_relative() { - let f = super::fixture(); - - let resolver = - Resolver::new(ResolveOptions { prefer_relative: true, ..ResolveOptions::default() }); - - #[rustfmt::skip] - let pass = [ - ("should correctly resolve with preferRelative 1", "main1.js", f.join("main1.js")), - ("should correctly resolve with preferRelative 2", "m1/a.js", f.join("node_modules/m1/a.js")), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } -} - -#[test] -fn resolve_to_context() { - let f = super::fixture(); - let resolver = - Resolver::new(ResolveOptions { resolve_to_context: true, ..ResolveOptions::default() }); - - #[rustfmt::skip] - let data = [ - ("context for fixtures", f.clone(), "./", f.clone()), - ("context for fixtures/lib", f.clone(), "./lib", f.join("lib")), - ("context for fixtures with ..", f.clone(), "./lib/../../fixtures/./lib/..", f.clone()), - ("context for fixtures with query", f.clone(), "./?query", f.clone().with_file_name("fixtures?query")), - ]; - - for (comment, path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn resolve_hash_as_module() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions::default()); - let resolution = resolver.resolve(f, "#a"); - assert_eq!(resolution, Err(ResolveError::NotFound("#a".into()))); -} diff --git a/src/tests/restrictions.rs b/src/tests/restrictions.rs deleted file mode 100644 index 5ba56596..00000000 --- a/src/tests/restrictions.rs +++ /dev/null @@ -1,25 +0,0 @@ -//! - -use crate::{ResolveError, ResolveOptions, Resolver, Restriction}; - -// TODO: regex -// * should respect RegExp restriction -// * should try to find alternative #1 -// * should try to find alternative #2 -// * should try to find alternative #3 - -// should respect string restriction -#[test] -fn restriction1() { - let fixture = super::fixture(); - let f = fixture.join("restrictions"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - restrictions: vec![Restriction::Path(f.clone())], - ..ResolveOptions::default() - }); - - let resolution = resolver.resolve(&f, "pck2"); - assert_eq!(resolution, Err(ResolveError::Restriction(fixture.join("c.js"), f))); -} diff --git a/src/tests/roots.rs b/src/tests/roots.rs deleted file mode 100644 index b50e2a07..00000000 --- a/src/tests/roots.rs +++ /dev/null @@ -1,92 +0,0 @@ -//! - -use std::path::PathBuf; - -use crate::{AliasValue, ResolveError, ResolveOptions, Resolver}; - -fn dirname() -> PathBuf { - super::fixture_root().join("enhanced_resolve").join("test") -} - -#[test] -fn roots() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - alias: vec![("foo".into(), vec![AliasValue::from("/fixtures")])], - roots: vec![dirname(), f.clone()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should respect roots option", "/fixtures/b.js", f.join("b.js")), - ("should try another root option, if it exists", "/b.js", f.join("b.js")), - ("should respect extension", "/fixtures/b", f.join("b.js")), - ("should resolve in directory", "/fixtures/extensions/dir", f.join("extensions/dir/index.js")), - ("should respect aliases", "foo/b", f.join("b.js")), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } - - #[rustfmt::skip] - let fail = [ - ("should not work with relative path", "fixtures/b.js", ResolveError::NotFound("fixtures/b.js".into())) - ]; - - for (comment, request, expected) in fail { - let resolution = resolver.resolve(&f, request); - assert_eq!(resolution, Err(expected), "{comment} {request}"); - } -} - -#[test] -fn resolve_to_context() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - roots: vec![dirname(), f.clone()], - resolve_to_context: true, - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f, "/fixtures/lib").map(|r| r.full_path()); - let expected = f.join("lib"); - assert_eq!(resolved_path, Ok(expected)); -} - -#[test] -fn prefer_absolute() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - alias: vec![("foo".into(), vec![AliasValue::from("/fixtures")])], - roots: vec![dirname(), f.clone()], - prefer_absolute: true, - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve an absolute path (prefer absolute)", f.join("b.js").to_string_lossy().to_string(), f.join("b.js")), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(&f, &request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } -} - -#[test] -fn roots_fall_through() { - let f = super::fixture(); - let absolute_path = f.join("roots_fall_through/index.js"); - let specifier = absolute_path.to_string_lossy(); - let resolution = Resolver::new(ResolveOptions::default().with_root(&f)).resolve(&f, &specifier); - assert_eq!( - resolution.map(super::super::resolution::Resolution::into_path_buf), - Ok(absolute_path) - ); -} diff --git a/src/tests/scoped_packages.rs b/src/tests/scoped_packages.rs deleted file mode 100644 index 8258f00f..00000000 --- a/src/tests/scoped_packages.rs +++ /dev/null @@ -1,25 +0,0 @@ -//! - -use crate::{ResolveOptions, Resolver}; - -#[test] -fn scoped_packages() { - let f = super::fixture().join("scoped"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("main field should work", f.clone(), "@scope/pack1", f.join("./node_modules/@scope/pack1/main.js")), - ("browser field should work", f.clone(), "@scope/pack2", f.join("./node_modules/@scope/pack2/main.js")), - ("folder request should work", f.clone(), "@scope/pack2/lib", f.join("./node_modules/@scope/pack2/lib/index.js")) - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} diff --git a/src/tests/simple.rs b/src/tests/simple.rs deleted file mode 100644 index 08e1238a..00000000 --- a/src/tests/simple.rs +++ /dev/null @@ -1,68 +0,0 @@ -//! - -use std::env; - -use crate::Resolver; - -#[test] -fn simple() { - // mimic `enhanced-resolve/test/simple.test.js` - let dirname = env::current_dir().unwrap().join("fixtures"); - let f = dirname.join("enhanced_resolve/test"); - - let resolver = Resolver::default(); - - let data = [ - ("direct", f.clone(), "../lib/index"), - ("as directory", f, ".."), - ("as module", dirname.clone(), "./enhanced_resolve"), - ]; - - for (comment, path, request) in data { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - let expected = dirname.join("enhanced_resolve/lib/index.js"); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn dashed_name() { - let f = super::fixture(); - - let resolver = Resolver::default(); - - let data = [ - (f.clone(), "dash", f.join("node_modules/dash/index.js")), - (f.clone(), "dash-name", f.join("node_modules/dash-name/index.js")), - (f.join("node_modules/dash"), "dash", f.join("node_modules/dash/index.js")), - (f.join("node_modules/dash"), "dash-name", f.join("node_modules/dash-name/index.js")), - (f.join("node_modules/dash-name"), "dash", f.join("node_modules/dash/index.js")), - (f.join("node_modules/dash-name"), "dash-name", f.join("node_modules/dash-name/index.js")), - ]; - - for (path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{path:?} {request}"); - } -} - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows { - use super::super::memory_fs::MemoryFS; - - use crate::ResolveOptions; - - #[test] - fn no_package() { - use crate::ResolverGeneric; - use std::path::Path; - let f = Path::new("/"); - let file_system = MemoryFS::new(&[]); - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions::default(), - ); - let resolved_path = resolver.resolve(f, "package"); - assert!(resolved_path.is_err()); - } -} diff --git a/src/tests/symlink.rs b/src/tests/symlink.rs deleted file mode 100644 index 7589b560..00000000 --- a/src/tests/symlink.rs +++ /dev/null @@ -1,121 +0,0 @@ -use std::{fs, io, path::Path}; - -use crate::{ResolveOptions, Resolver}; - -#[derive(Debug, Clone, Copy)] -enum FileType { - File, - Dir, -} - -#[allow(unused_variables)] -fn symlink, Q: AsRef>( - original: P, - link: Q, - file_type: FileType, -) -> io::Result<()> { - #[cfg(target_family = "unix")] - { - std::os::unix::fs::symlink(original, link) - } - - #[cfg(target_family = "windows")] - match file_type { - FileType::File => std::os::windows::fs::symlink_file(original, link), - FileType::Dir => std::os::windows::fs::symlink_dir(original, link), - } -} - -fn init(dirname: &Path, temp_path: &Path) -> io::Result<()> { - if temp_path.exists() { - _ = fs::remove_dir_all(temp_path); - } - fs::create_dir(temp_path)?; - symlink(dirname.join("../lib/index.js"), temp_path.join("test"), FileType::File)?; - symlink(dirname.join("../lib"), temp_path.join("test2"), FileType::Dir)?; - fs::remove_file(temp_path.join("test"))?; - fs::remove_file(temp_path.join("test2"))?; - fs::remove_dir(temp_path) -} - -fn create_symlinks(dirname: &Path, temp_path: &Path) -> io::Result<()> { - fs::create_dir(temp_path).unwrap(); - symlink( - dirname.join("../lib/index.js").canonicalize().unwrap(), - temp_path.join("index.js"), - FileType::File, - )?; - symlink(dirname.join("../lib").canonicalize().unwrap(), temp_path.join("lib"), FileType::Dir)?; - symlink(dirname.join("..").canonicalize().unwrap(), temp_path.join("this"), FileType::Dir)?; - symlink(temp_path.join("this"), temp_path.join("that"), FileType::Dir)?; - symlink(Path::new("../../lib/index.js"), temp_path.join("node.relative.js"), FileType::File)?; - symlink( - Path::new("./node.relative.js"), - temp_path.join("node.relative.sym.js"), - FileType::File, - )?; - Ok(()) -} - -fn cleanup_symlinks(temp_path: &Path) { - _ = fs::remove_dir_all(temp_path); -} - -#[test] -fn test() -> io::Result<()> { - let root = super::fixture_root().join("enhanced_resolve"); - let dirname = root.join("test"); - let temp_path = dirname.join("temp"); - if !temp_path.exists() { - let is_admin = init(&dirname, &temp_path).is_ok(); - if !is_admin { - return Ok(()); - } - if let Err(err) = create_symlinks(&dirname, &temp_path) { - cleanup_symlinks(&temp_path); - return Err(err); - } - } - - let resolver_without_symlinks = - Resolver::new(ResolveOptions { symlinks: false, ..ResolveOptions::default() }); - let resolver_with_symlinks = Resolver::default(); - - #[rustfmt::skip] - let pass = [ - ("with a symlink to a file", temp_path.clone(), "./index.js"), - ("with a relative symlink to a file", temp_path.clone(), "./node.relative.js"), - ("with a relative symlink to a symlink to a file", temp_path.clone(), "./node.relative.sym.js"), - ("with a symlink to a directory 1", temp_path.clone(), "./lib/index.js"), - ("with a symlink to a directory 2", temp_path.clone(), "./this/lib/index.js"), - ("with multiple symlinks in the path 1", temp_path.clone(), "./this/test/temp/index.js"), - ("with multiple symlinks in the path 2", temp_path.clone(), "./this/test/temp/lib/index.js"), - ("with multiple symlinks in the path 3", temp_path.clone(), "./this/test/temp/this/lib/index.js"), - ("with a symlink to a directory 2 (chained)", temp_path.clone(), "./that/lib/index.js"), - ("with multiple symlinks in the path 1 (chained)", temp_path.clone(), "./that/test/temp/index.js"), - ("with multiple symlinks in the path 2 (chained)", temp_path.clone(), "./that/test/temp/lib/index.js"), - ("with multiple symlinks in the path 3 (chained)", temp_path.clone(), "./that/test/temp/that/lib/index.js"), - ("with symlinked directory as context 1", temp_path.join( "lib"), "./index.js"), - ("with symlinked directory as context 2", temp_path.join( "this"), "./lib/index.js"), - ("with symlinked directory as context and in path", temp_path.join( "this"), "./test/temp/lib/index.js"), - ("with symlinked directory in context path", temp_path.join( "this/lib"), "./index.js"), - ("with symlinked directory in context path and symlinked file", temp_path.join( "this/test"), "./temp/index.js"), - ("with symlinked directory in context path and symlinked directory", temp_path.join( "this/test"), "./temp/lib/index.js"), - ("with symlinked directory as context 2 (chained)", temp_path.join( "that"), "./lib/index.js"), - ("with symlinked directory as context and in path (chained)", temp_path.join( "that"), "./test/temp/lib/index.js"), - ("with symlinked directory in context path (chained)", temp_path.join( "that/lib"), "./index.js"), - ("with symlinked directory in context path and symlinked file (chained)", temp_path.join( "that/test"), "./temp/index.js"), - ("with symlinked directory in context path and symlinked directory (chained)", temp_path.join( "that/test"), "./temp/lib/index.js") - ]; - - for (comment, path, request) in pass { - let filename = resolver_with_symlinks.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(filename, Ok(root.join("lib/index.js")), "{comment:?}"); - - let resolved_path = - resolver_without_symlinks.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(path.join(request))); - } - - Ok(()) -} diff --git a/src/tests/tsconfig_paths.rs b/src/tests/tsconfig_paths.rs deleted file mode 100644 index b85bf6be..00000000 --- a/src/tests/tsconfig_paths.rs +++ /dev/null @@ -1,530 +0,0 @@ -//! tests for tsconfig-paths -//! -//! Fixtures copied from . - -use std::path::{Path, PathBuf}; - -use crate::{ - JSONError, ResolveError, ResolveOptions, Resolver, TsConfig, TsconfigOptions, - TsconfigReferences, -}; - -// -#[test] -fn tsconfig() { - let f = super::fixture_root().join("tsconfig"); - - #[rustfmt::skip] - let pass = [ - (f.clone(), None, "ts-path", f.join("foo.js")), - (f.join("nested"), None, "ts-path", f.join("nested/test.js")), - (f.join("cases/index"), None, "foo", f.join("node_modules/tsconfig-index/foo.js")), - // This requires reading package.json.tsconfig field - // (f.join("cases/field"), "foo", f.join("node_modules/tsconfig-field/foo.js")) - (f.join("cases/exports"), None, "foo", f.join("node_modules/tsconfig-exports/foo.js")), - (f.join("cases/extends-extension"), None, "foo", f.join("cases/extends-extension/foo.js")), - (f.join("cases/extends-extensionless"), None, "foo", f.join("node_modules/tsconfig-field/foo.js")), - (f.join("cases/extends-paths"), Some("src"), "@/index", f.join("cases/extends-paths/src/index.js")), - (f.join("cases/extends-multiple"), None, "foo", f.join("cases/extends-multiple/foo.js")), - ]; - - for (dir, subdir, request, expected) in pass { - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: dir.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - let path = subdir.map_or(dir.clone(), |subdir| dir.join(subdir)); - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{request} {path:?}"); - } - - #[rustfmt::skip] - let data = [ - (f.join("node_modules/tsconfig-not-used"), "ts-path", Ok(f.join("foo.js"))), - ]; - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - for (path, request, expected) in data { - let resolution = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolution, expected, "{path:?} {request}"); - } -} - -#[test] -fn tsconfig_fallthrough() { - let f = super::fixture_root().join("tsconfig"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "/"); - assert_eq!(resolved_path, Err(ResolveError::NotFound("/".into()))); -} - -#[test] -fn json_with_comments() { - let f = super::fixture_root().join("tsconfig/cases/trailing-comma"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "foo").map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(f.join("bar.js"))); -} - -#[test] -fn broken() { - let f = super::fixture_root().join("tsconfig"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("tsconfig_broken.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "/"); - let error = ResolveError::JSON(JSONError { - path: f.join("tsconfig_broken.json"), - message: String::from("EOF while parsing an object at line 2 column 0"), - line: 2, - column: 0, - }); - assert_eq!(resolved_path, Err(error)); -} - -// -#[test] -fn test_paths() { - let path = Path::new("/foo/tsconfig.json"); - let mut tsconfig_json = serde_json::json!({ - "compilerOptions": { - "paths": { - "jquery": ["node_modules/jquery/dist/jquery"], - "*": ["generated/*"], - "bar/*": ["test/*"], - "bar/baz/*": ["baz/*", "yo/*"], - "@/components/*": ["components/*"], - "url": ["node_modules/my-url"], - } - } - }) - .to_string(); - let tsconfig = TsConfig::parse(true, path, &mut tsconfig_json).unwrap(); - - let data = [ - ("jquery", vec!["/foo/node_modules/jquery/dist/jquery"]), - ("test", vec!["/foo/generated/test"]), - ("test/hello", vec!["/foo/generated/test/hello"]), - ("bar/hi", vec!["/foo/test/hi"]), - ("bar/baz/hi", vec!["/foo/baz/hi", "/foo/yo/hi"]), - ("@/components/button", vec!["/foo/components/button"]), - ("./jquery", vec![]), - ("url", vec!["/foo/node_modules/my-url"]), - ]; - - for (specifier, expected) in data { - let paths = tsconfig.resolve_path_alias(specifier); - let expected = expected.into_iter().map(PathBuf::from).collect::>(); - assert_eq!(paths, expected, "{specifier}"); - } -} - -// -#[test] -fn test_base_url() { - let path = Path::new("/foo/tsconfig.json"); - let mut tsconfig_json = serde_json::json!({ - "compilerOptions": { - "baseUrl": "./src" - } - }) - .to_string(); - let tsconfig = TsConfig::parse(true, path, &mut tsconfig_json).unwrap(); - - let data = [ - ("foo", vec!["/foo/src/foo"]), - ("components/button", vec!["/foo/src/components/button"]), - ("./jquery", vec![]), - ]; - - for (specifier, expected) in data { - let paths = tsconfig.resolve_path_alias(specifier); - let expected = expected.into_iter().map(PathBuf::from).collect::>(); - assert_eq!(paths, expected, "{specifier}"); - } -} - -// -#[test] -fn test_paths_and_base_url() { - let path = Path::new("/foo/tsconfig.json"); - let mut tsconfig_json = serde_json::json!({ - "compilerOptions": { - "baseUrl": "./src", - "paths": { - "*": ["generated/*"], - "bar/*": ["test/*"], - "bar/baz/*": ["baz/*", "yo/*"], - "@/components/*": ["components/*"] - } - } - }) - .to_string(); - let tsconfig = TsConfig::parse(true, path, &mut tsconfig_json).unwrap(); - - let data = [ - ("test", vec!["/foo/src/generated/test", "/foo/src/test"]), - ("test/hello", vec!["/foo/src/generated/test/hello", "/foo/src/test/hello"]), - ("bar/hi", vec!["/foo/src/test/hi", "/foo/src/bar/hi"]), - ("bar/baz/hi", vec!["/foo/src/baz/hi", "/foo/src/yo/hi", "/foo/src/bar/baz/hi"]), - ("@/components/button", vec!["/foo/src/components/button", "/foo/src/@/components/button"]), - ("./jquery", vec![]), - ]; - - for (specifier, expected) in data { - let paths = tsconfig.resolve_path_alias(specifier); - let expected = expected.into_iter().map(PathBuf::from).collect::>(); - assert_eq!(paths, expected, "{specifier}"); - } -} - -// Template variable ${configDir} for substitution of config files directory path -// https://github.com/microsoft/TypeScript/pull/58042 -#[test] -fn test_template_variable() { - let f = super::fixture_root().join("tsconfig"); - let f2 = f.join("cases").join("paths_template_variable"); - - #[rustfmt::skip] - let pass = [ - (f2.clone(), "tsconfig1.json", "foo", f2.join("foo.js")), - (f2.clone(), "tsconfig2.json", "foo", f2.join("foo.js")), - (f.clone(), "tsconfig_template_variable.json", "foo", f.join("foo.js")), - ]; - - for (dir, tsconfig, request, expected) in pass { - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: dir.join(tsconfig), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&dir, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{request} {tsconfig} {dir:?}"); - } -} - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows_test { - use std::path::{Path, PathBuf}; - - use crate::{ - ResolveError, ResolveOptions, ResolverGeneric, TsconfigOptions, TsconfigReferences, - }; - - use super::super::memory_fs::MemoryFS; - - struct OneTest { - name: &'static str, - tsconfig: String, - package_json: Option<(PathBuf, String)>, - main_fields: Option>, - existing_files: Vec<&'static str>, - requested_module: &'static str, - expected_path: &'static str, - extensions: Vec, - } - - impl Default for OneTest { - fn default() -> Self { - Self { - name: "", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/*": ["location/*"] - } - } - }) - .to_string(), - package_json: None, - main_fields: None, - existing_files: vec![], - requested_module: "", - expected_path: "", - extensions: vec![ - ".js".into(), - ".json".into(), - ".node".into(), - ".ts".into(), - ".tsx".into(), - ], - } - } - } - - impl OneTest { - fn resolver(&self, root: &Path) -> ResolverGeneric { - let mut file_system = MemoryFS::default(); - - file_system.add_file(&root.join("tsconfig.json"), &self.tsconfig); - if let Some((path, package_json)) = &self.package_json { - file_system.add_file(&root.join(path).join("package.json"), package_json); - } - for path in &self.existing_files { - file_system.add_file(Path::new(path), ""); - } - - let mut options = ResolveOptions { - extensions: self.extensions.clone(), - tsconfig: Some(TsconfigOptions { - config_file: root.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }; - if let Some(main_fields) = &self.main_fields { - options.main_fields.clone_from(main_fields); - } - - ResolverGeneric::::new_with_file_system(file_system, options) - } - } - - // Path matching tests from tsconfig-paths - // * - // * - #[test] - fn match_path() { - let pass = [ - OneTest { - name: "should locate path that matches with star and exists", - existing_files: vec!["/root/location/mylib/index.ts"], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve to correct path when many are specified", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/*": ["foo1/*", "foo2/*", "location/*", "foo3/*"], - } - } - }) - .to_string(), - existing_files: vec!["/root/location/mylib/index.ts"], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should locate path that matches with star and prioritize pattern with longest prefix", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "*": ["location/*"], - "lib/*": ["location/*"], - } - } - }) - .to_string(), - existing_files: vec![ - "/root/location/lib/mylib/index.ts", - "/root/location/mylib/index.ts", - ], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should locate path that matches with star and exists with extension", - existing_files: vec![ - "/root/location/mylib.myext", - ], - requested_module: "lib/mylib", - extensions: vec![".js".into(), ".myext".into()], - expected_path: "/root/location/mylib.myext", - ..OneTest::default() - }, - OneTest { - name: "should resolve request with extension specified", - existing_files: vec![ - "/root/location/test.jpg", - ], - requested_module: "lib/test.jpg", - expected_path: "/root/location/test.jpg", - ..OneTest::default() - }, - OneTest { - name: "should locate path that matches without star and exists", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/foo": ["location/foo"] - } - } - }) - .to_string(), - existing_files: vec![ - "/root/location/foo.ts", - ], - requested_module: "lib/foo", - expected_path: "/root/location/foo.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve to parent folder when filename is in subfolder", - existing_files: vec![ - "/root/location/mylib/index.ts", - ], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve from main field in package.json", - package_json: Some((PathBuf::from("/root/location/mylib"), serde_json::json!({ - "main": "./kalle.ts" - }).to_string())), - existing_files: vec![ - "/root/location/mylib/kalle.ts", - ], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/kalle.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve from main field in package.json (js)", - package_json: Some((PathBuf::from("/root/location/mylib.js"), serde_json::json!({ - "main": "./kalle.js" - }).to_string())), - existing_files: vec![ - "/root/location/mylib.js/kalle.js", - ], - extensions: vec![".ts".into(), ".js".into()], - requested_module: "lib/mylib.js", - expected_path: "/root/location/mylib.js/kalle.js", - ..OneTest::default() - }, - OneTest { - name: "should resolve from list of fields by priority in package.json", - main_fields: Some(vec!["missing".into(), "browser".into(), "main".into()]), - package_json: Some((PathBuf::from("/root/location/mylibjs"), serde_json::json!({ - "main": "./main.js", - "browser": "./browser.js" - }).to_string())), - existing_files: vec![ - "/root/location/mylibjs/main.js", - "/root/location/mylibjs/browser.js", - ], - extensions: vec![".ts".into(), ".js".into()], - requested_module: "lib/mylibjs", - expected_path: "/root/location/mylibjs/browser.js", - ..OneTest::default() - }, -OneTest { - name: "should ignore field mappings to missing files in package.json", - main_fields: Some(vec!["browser".into(), "main".into()]), - package_json: Some((PathBuf::from("/root/location/mylibjs"), serde_json::json!({ - "main": "./kalle.js", - "browser": "./nope.js" - }).to_string())), - existing_files: vec![ - "/root/location/mylibjs/kalle.js", - ], - extensions: vec![".ts".into(), ".js".into()], - requested_module: "lib/mylibjs", - expected_path: "/root/location/mylibjs/kalle.js", - ..OneTest::default() - }, - // Tests that are not applicable: - // name: "should resolve nested main fields" - // name: "should ignore advanced field mappings in package.json" - // name: "should resolve to with the help of baseUrl when not explicitly set" - // name: "should not resolve with the help of baseUrl when asked not to" - // name: "should resolve main file with cjs file extension" - OneTest { - name: "should resolve .ts from .js alias", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "@/*": ["src/*"] - } - } - }).to_string(), - existing_files: vec![ - "/root/src/foo.ts", - ], - requested_module: "@/foo", // original data was "@/foo.ts" but I don't get why it is the case? - expected_path: "/root/src/foo.ts", // original data was "/root/src/foo" - ..OneTest::default() - }, - ]; - - let root = PathBuf::from("/root"); - - for test in pass { - let resolved_path = - test.resolver(&root).resolve(&root, test.requested_module).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(PathBuf::from(test.expected_path)), "{}", test.name); - } - - let fail = [ - OneTest { - name: "should not locate path that does not match", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/*": ["location/*"] - } - } - }) - .to_string(), - existing_files: vec!["/root/location/mylib"], - requested_module: "lib/mylibjs", - ..OneTest::default() - }, - OneTest { - name: "should not resolve typings file (index.d.ts)", - existing_files: vec!["/root/location/mylib/index.d.ts"], - requested_module: "lib/mylib", - ..OneTest::default() - }, - ]; - - for test in fail { - let resolved_path = - test.resolver(&root).resolve(&root, test.requested_module).map(|f| f.full_path()); - assert_eq!( - resolved_path, - Err(ResolveError::NotFound(test.requested_module.into())), - "{}", - test.name - ); - } - } -} diff --git a/src/tests/tsconfig_project_references.rs b/src/tests/tsconfig_project_references.rs deleted file mode 100644 index 0d019d27..00000000 --- a/src/tests/tsconfig_project_references.rs +++ /dev/null @@ -1,132 +0,0 @@ -//! Tests for tsconfig project references - -use crate::{ResolveError, ResolveOptions, Resolver, TsconfigOptions, TsconfigReferences}; - -#[test] -fn auto() { - let f = super::fixture_root().join("tsconfig/cases/project_references"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("app"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - // Test normal paths alias - (f.join("app"), "@/index.ts", f.join("app/aliased/index.ts")), - (f.join("app"), "@/../index.ts", f.join("app/index.ts")), - // Test project reference - (f.join("project_a"), "@/index.ts", f.join("project_a/aliased/index.ts")), - (f.join("project_b/src"), "@/index.ts", f.join("project_b/src/aliased/index.ts")), - // Does not have paths alias - (f.join("project_a"), "./index.ts", f.join("project_a/index.ts")), - (f.join("project_c"), "./index.ts", f.join("project_c/index.ts")), - // Template variable - { - let dir = f.parent().unwrap().join("paths_template_variable"); - (dir.clone(), "foo", dir.join("foo.js")) - } - ]; - - for (path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{request} {path:?}"); - } -} - -#[test] -fn disabled() { - let f = super::fixture_root().join("tsconfig/cases/project_references"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("app"), - references: TsconfigReferences::Disabled, - }), - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - // Test normal paths alias - (f.join("app"), "@/index.ts", Ok(f.join("app/aliased/index.ts"))), - (f.join("app"), "@/../index.ts", Ok(f.join("app/index.ts"))), - // Test project reference - (f.join("project_a"), "@/index.ts", Err(ResolveError::NotFound("@/index.ts".into()))), - (f.join("project_b/src"), "@/index.ts", Err(ResolveError::NotFound("@/index.ts".into()))), - // Does not have paths alias - (f.join("project_a"), "./index.ts", Ok(f.join("project_a/index.ts"))), - (f.join("project_c"), "./index.ts", Ok(f.join("project_c/index.ts"))), - ]; - - for (path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, expected, "{request} {path:?}"); - } -} - -#[test] -fn manual() { - let f = super::fixture_root().join("tsconfig/cases/project_references"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("app"), - references: TsconfigReferences::Paths(vec!["../project_a/conf.json".into()]), - }), - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - // Test normal paths alias - (f.join("app"), "@/index.ts", Ok(f.join("app/aliased/index.ts"))), - (f.join("app"), "@/../index.ts", Ok(f.join("app/index.ts"))), - // Test project reference - (f.join("project_a"), "@/index.ts", Ok(f.join("project_a/aliased/index.ts"))), - (f.join("project_b/src"), "@/index.ts", Err(ResolveError::NotFound("@/index.ts".into()))), - // Does not have paths alias - (f.join("project_a"), "./index.ts", Ok(f.join("project_a/index.ts"))), - (f.join("project_c"), "./index.ts", Ok(f.join("project_c/index.ts"))), - ]; - - for (path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, expected, "{request} {path:?}"); - } -} - -#[test] -fn self_reference() { - let f = super::fixture_root().join("tsconfig/cases/project_references"); - - #[rustfmt::skip] - let pass = [ - (f.join("app"), vec!["./tsconfig.json".into()]), - (f.join("app/tsconfig.json"), vec!["./tsconfig.json".into()]), - (f.join("app"), vec![f.join("app")]), - (f.join("app/tsconfig.json"), vec![f.join("app")]), - (f.join("app/tsconfig.json"), vec![f.join("project_b"), f.join("app")]), - ]; - - for (config_file, reference_paths) in pass { - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: config_file.clone(), - references: TsconfigReferences::Paths(reference_paths.clone()), - }), - ..ResolveOptions::default() - }); - let path = f.join("app"); - let resolved_path = resolver.resolve(&path, "@/index.ts").map(|f| f.full_path()); - assert_eq!( - resolved_path, - Err(ResolveError::TsconfigSelfReference(f.join("app/tsconfig.json"))), - "{config_file:?} {reference_paths:?}" - ); - } -} diff --git a/src/tsconfig.rs b/src/tsconfig.rs deleted file mode 100644 index 0de8e8ec..00000000 --- a/src/tsconfig.rs +++ /dev/null @@ -1,223 +0,0 @@ -use std::{ - hash::BuildHasherDefault, - path::{Path, PathBuf}, - sync::Arc, -}; - -use indexmap::IndexMap; -use rustc_hash::FxHasher; -use serde::Deserialize; - -use crate::PathUtil; - -pub type CompilerOptionsPathsMap = IndexMap, BuildHasherDefault>; - -#[derive(Debug, Clone, Eq, PartialEq, Deserialize)] -#[serde(untagged)] -pub enum ExtendsField { - Single(String), - Multiple(Vec), -} - -#[derive(Debug, Deserialize)] -#[serde(rename_all = "camelCase")] -pub struct TsConfig { - /// Whether this is the caller tsconfig. - /// Used for final template variable substitution when all configs are extended and merged. - #[serde(skip)] - root: bool, - - /// Path to `tsconfig.json`. Contains the `tsconfig.json` filename. - #[serde(skip)] - pub(crate) path: PathBuf, - - #[serde(default)] - pub extends: Option, - - #[serde(default)] - pub compiler_options: CompilerOptions, - - /// Bubbled up project references with a reference to their tsconfig. - #[serde(default)] - pub references: Vec, -} - -/// Compiler Options -/// -/// -#[derive(Debug, Default, Deserialize)] -#[serde(rename_all = "camelCase")] -pub struct CompilerOptions { - base_url: Option, - - /// Path aliases - paths: Option, - - /// The actual base for where path aliases are resolved from. - #[serde(skip)] - paths_base: PathBuf, -} - -/// Project Reference -/// -/// -#[derive(Debug, Deserialize)] -pub struct ProjectReference { - /// The path property of each reference can point to a directory containing a tsconfig.json file, - /// or to the config file itself (which may have any name). - pub path: PathBuf, - - /// Reference to the resolved tsconfig - #[serde(skip)] - pub tsconfig: Option>, -} - -impl TsConfig { - pub fn parse(root: bool, path: &Path, json: &mut str) -> Result { - _ = json_strip_comments::strip(json); - let mut tsconfig: Self = serde_json::from_str(json)?; - tsconfig.root = root; - tsconfig.path = path.to_path_buf(); - let directory = tsconfig.directory().to_path_buf(); - if let Some(base_url) = tsconfig.compiler_options.base_url { - tsconfig.compiler_options.base_url = Some(directory.normalize_with(base_url)); - } - if tsconfig.compiler_options.paths.is_some() { - tsconfig.compiler_options.paths_base = - tsconfig.compiler_options.base_url.as_ref().map_or(directory, Clone::clone); - } - Ok(tsconfig) - } - - pub fn build(mut self) -> Self { - if self.root { - let dir = self.directory().to_path_buf(); - // Substitute template variable in `tsconfig.compilerOptions.paths` - if let Some(paths) = &mut self.compiler_options.paths { - for paths in paths.values_mut() { - for path in paths { - Self::substitute_template_variable(&dir, path); - } - } - } - } - self - } - - /// Directory to `tsconfig.json` - /// - /// # Panics - /// - /// * When the `tsconfig.json` path is misconfigured. - pub fn directory(&self) -> &Path { - debug_assert!(self.path.file_name().is_some()); - self.path.parent().unwrap() - } - - pub fn extend_tsconfig(&mut self, tsconfig: &Self) { - let compiler_options = &mut self.compiler_options; - if compiler_options.paths.is_none() { - compiler_options.paths_base = compiler_options - .base_url - .as_ref() - .map_or_else(|| tsconfig.compiler_options.paths_base.clone(), Clone::clone); - compiler_options.paths.clone_from(&tsconfig.compiler_options.paths); - } - if compiler_options.base_url.is_none() { - compiler_options.base_url.clone_from(&tsconfig.compiler_options.base_url); - } - } - - pub fn resolve(&self, path: &Path, specifier: &str) -> Vec { - if path.starts_with(self.base_path()) { - let paths = self.resolve_path_alias(specifier); - if !paths.is_empty() { - return paths; - } - } - for tsconfig in self.references.iter().filter_map(|reference| reference.tsconfig.as_ref()) { - if path.starts_with(tsconfig.base_path()) { - return tsconfig.resolve_path_alias(specifier); - } - } - vec![] - } - - // Copied from parcel - // - pub fn resolve_path_alias(&self, specifier: &str) -> Vec { - if specifier.starts_with(|s| s == '/' || s == '.') { - return vec![]; - } - - let base_url_iter = self - .compiler_options - .base_url - .as_ref() - .map_or_else(Vec::new, |base_url| vec![base_url.normalize_with(specifier)]); - - let Some(paths_map) = &self.compiler_options.paths else { - return base_url_iter; - }; - - let paths = paths_map.get(specifier).map_or_else( - || { - let mut longest_prefix_length = 0; - let mut longest_suffix_length = 0; - let mut best_key: Option<&String> = None; - - for key in paths_map.keys() { - if let Some((prefix, suffix)) = key.split_once('*') { - if (best_key.is_none() || prefix.len() > longest_prefix_length) - && specifier.starts_with(prefix) - && specifier.ends_with(suffix) - { - longest_prefix_length = prefix.len(); - longest_suffix_length = suffix.len(); - best_key.replace(key); - } - } - } - - best_key.and_then(|key| paths_map.get(key)).map_or_else(Vec::new, |paths| { - paths - .iter() - .map(|path| { - path.replace( - '*', - &specifier[longest_prefix_length - ..specifier.len() - longest_suffix_length], - ) - }) - .collect::>() - }) - }, - Clone::clone, - ); - - paths - .into_iter() - .map(|p| self.compiler_options.paths_base.normalize_with(p)) - .chain(base_url_iter) - .collect() - } - - fn base_path(&self) -> &Path { - self.compiler_options - .base_url - .as_ref() - .map_or_else(|| self.directory(), |path| path.as_ref()) - } - - /// Template variable `${configDir}` for substitution of config files directory path - /// - /// NOTE: All tests cases are just a head replacement of `${configDir}`, so we are constrained as such. - /// - /// See - fn substitute_template_variable(directory: &Path, path: &mut String) { - const TEMPLATE_VARIABLE: &str = "${configDir}/"; - if let Some(stripped_path) = path.strip_prefix(TEMPLATE_VARIABLE) { - *path = directory.join(stripped_path).to_string_lossy().to_string(); - } - } -} diff --git a/tests/integration_test.rs b/tests/integration_test.rs deleted file mode 100644 index 0fc52887..00000000 --- a/tests/integration_test.rs +++ /dev/null @@ -1,103 +0,0 @@ -//! Test public APIs - -use std::{env, path::PathBuf}; - -use oxc_resolver::{EnforceExtension, Resolution, ResolveContext, ResolveOptions, Resolver}; - -fn dir() -> PathBuf { - env::current_dir().unwrap() -} - -fn resolve(specifier: &str) -> Resolution { - let path = dir(); - Resolver::new(ResolveOptions::default()).resolve(path, specifier).unwrap() -} - -#[test] -fn clone() { - let resolution = resolve("./tests/package.json"); - assert_eq!(resolution.clone(), resolution); -} - -#[test] -fn debug() { - let resolution = resolve("./tests/package.json"); - let s = format!("{resolution:?}"); - assert!(!s.is_empty()); -} - -#[test] -fn eq() { - let resolution = resolve("./tests/package.json"); - assert_eq!(resolution, resolution); -} - -#[test] -fn package_json() { - let resolution = resolve("./tests/package.json"); - let package_json = resolution.package_json().unwrap(); - assert_eq!(package_json.name.as_ref().unwrap(), "name"); - assert_eq!(package_json.r#type.as_ref().unwrap().as_str(), "module".into()); - assert!(package_json.side_effects.as_ref().unwrap().is_object()); -} - -#[cfg(feature = "package_json_raw_json_api")] -#[test] -fn package_json_raw_json_api() { - let resolution = resolve("./tests/package.json"); - assert!(resolution - .package_json() - .unwrap() - .raw_json() - .get("name") - .is_some_and(|name| name == "name")); -} - -#[test] -fn clear_cache() { - let resolver = Resolver::new(ResolveOptions::default()); - resolver.clear_cache(); // exists -} - -#[test] -fn options() { - let resolver = Resolver::new(ResolveOptions::default()); - let options = resolver.options(); - assert!(!format!("{options:?}").is_empty()); -} - -#[test] -fn debug_resolver() { - let resolver = Resolver::new(ResolveOptions::default()); - assert!(!format!("{resolver:?}").is_empty()); -} - -#[test] -fn dependencies() { - let path = dir(); - let mut ctx = ResolveContext::default(); - let _ = Resolver::new(ResolveOptions::default()).resolve_with_context( - path, - "./tests/package.json", - &mut ctx, - ); - assert!(!ctx.file_dependencies.is_empty()); - assert!(ctx.missing_dependencies.is_empty()); -} - -#[test] -fn options_api() { - _ = ResolveOptions::default() - .with_builtin_modules(true) - .with_condition_names(&[]) - .with_extension(".js") - .with_force_extension(EnforceExtension::Auto) - .with_fully_specified(true) - .with_main_field("asdf") - .with_main_file("main") - .with_module("module") - .with_prefer_absolute(true) - .with_prefer_relative(true) - .with_root(PathBuf::new()) - .with_symbolic_link(true); -} diff --git a/tests/package.json b/tests/package.json deleted file mode 100644 index 54f58b8c..00000000 --- a/tests/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "name", - "type": "module", - "sideEffects": {} -} diff --git a/tests/resolve_test.rs b/tests/resolve_test.rs deleted file mode 100644 index 30d1ceff..00000000 --- a/tests/resolve_test.rs +++ /dev/null @@ -1,104 +0,0 @@ -use std::{env, path::PathBuf}; - -use oxc_resolver::{ResolveError, ResolveOptions, Resolver}; - -fn dir() -> PathBuf { - env::current_dir().unwrap() -} - -#[test] -fn chinese() { - let dir = dir(); - let specifier = "./fixtures/misc/中文/中文.js"; - let resolution = Resolver::new(ResolveOptions::default()).resolve(&dir, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(dir.join("fixtures/misc/中文/中文.js")) - ); -} - -#[test] -fn styled_components() { - let dir = dir(); - let path = dir.join("fixtures/pnpm"); - let module_path = dir.join("node_modules/.pnpm/styled-components@6.1.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/styled-components"); - let specifier = "styled-components"; - - // cjs - let options = - ResolveOptions { alias_fields: vec![vec!["browser".into()]], ..ResolveOptions::default() }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/styled-components.browser.cjs.js")) - ); - - // esm - let options = ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - main_fields: vec!["module".into()], - ..ResolveOptions::default() - }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/styled-components.browser.esm.js")) - ); -} - -#[test] -fn axios() { - let dir = dir(); - let path = dir.join("fixtures/pnpm"); - let module_path = dir.join("node_modules/.pnpm/axios@1.6.2/node_modules/axios"); - let specifier = "axios"; - - // default - let options = ResolveOptions::default(); - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("index.js")) - ); - - // browser - let options = ResolveOptions { - condition_names: vec!["browser".into(), "require".into()], - ..ResolveOptions::default() - }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/browser/axios.cjs")) - ); - - // cjs - let options = ResolveOptions { - condition_names: vec!["node".into(), "require".into()], - ..ResolveOptions::default() - }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/node/axios.cjs")) - ); -} - -#[test] -fn postcss() { - let dir = dir(); - let path = dir.join("fixtures/pnpm"); - let module_path = path.join("node_modules/postcss"); - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - // should ignore "path" - let resolution = resolver.resolve(&module_path, "path"); - assert_eq!(resolution, Err(ResolveError::Ignored(module_path.clone()))); - - // should ignore "./lib/terminal-highlight" - let resolution = resolver.resolve(&module_path, "./lib/terminal-highlight"); - assert_eq!(resolution, Err(ResolveError::Ignored(module_path.join("lib/terminal-highlight")))); -} From 87a07a577e5db09249cc6a666ab7d0d2a0242598 Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Tue, 9 Jul 2024 22:09:21 +0300 Subject: [PATCH 49/82] squash! --- .github/workflows/Dependabot.yml | 4 ++-- .github/workflows/GitHub.yml | 1 + .github/workflows/NPM.yml | 32 ++++++++++++++++++++++++++++++++ .github/workflows/Node.yml | 5 +++-- .github/workflows/Rust.yml | 1 + napi/wasi-worker.mjs | 10 +++++----- 6 files changed, 44 insertions(+), 9 deletions(-) diff --git a/.github/workflows/Dependabot.yml b/.github/workflows/Dependabot.yml index e6091e54..387fece7 100644 --- a/.github/workflows/Dependabot.yml +++ b/.github/workflows/Dependabot.yml @@ -20,7 +20,7 @@ jobs: if: ${{ github.actor == 'dependabot[bot]' }} steps: - - uses: dependabot/fetch-metadata@v2.1.0 + - uses: dependabot/fetch-metadata@v2.2.0 with: github-token: "${{ secrets.GITHUB_TOKEN }}" @@ -35,7 +35,7 @@ jobs: if: ${{ github.actor == 'dependabot[bot]' }} steps: - - uses: dependabot/fetch-metadata@v2.1.0 + - uses: dependabot/fetch-metadata@v2.2.0 with: github-token: "${{ secrets.GITHUB_TOKEN }}" diff --git a/.github/workflows/GitHub.yml b/.github/workflows/GitHub.yml index 5e814e3e..7b1e399c 100644 --- a/.github/workflows/GitHub.yml +++ b/.github/workflows/GitHub.yml @@ -48,6 +48,7 @@ jobs: STNOUPGRADE: 1 STRIPE_CLI_TELEMETRY_OPTOUT: 1 TELEMETRY_DISABLED: 1 + TERRAFORM_TELEMETRY: 0 steps: - uses: pozil/auto-assign-issue@v2.0.0 diff --git a/.github/workflows/NPM.yml b/.github/workflows/NPM.yml index 4eb3b12a..86bf8e24 100644 --- a/.github/workflows/NPM.yml +++ b/.github/workflows/NPM.yml @@ -19,6 +19,38 @@ jobs: Publish: runs-on: ubuntu-latest + env: + ADBLOCK: true + ASTRO_TELEMETRY_DISABLED: 1 + AUTOMATEDLAB_TELEMETRY_OPTOUT: 1 + AZURE_CORE_COLLECT_TELEMETRY: 0 + CHOOSENIM_NO_ANALYTICS: 1 + DIEZ_DO_NOT_TRACK: 1 + DOTNET_CLI_TELEMETRY_OPTOUT: 1 + DOTNET_INTERACTIVE_CLI_TELEMETRY_OPTOUT: 1 + DO_NOT_TRACK: 1 + ET_NO_TELEMETRY: 1 + GATSBY_TELEMETRY_DISABLED: 1 + GATSBY_TELEMETRY_OPTOUT: 1 + GATSBY_TELEMETRY_OPT_OUT: 1 + GRIT_TELEMETRY_DISABLED: 1 + HASURA_GRAPHQL_ENABLE_TELEMETRY: false + HINT_TELEMETRY: off + HOMEBREW_NO_ANALYTICS: 1 + INFLUXD_REPORTING_DISABLED: true + ITERATIVE_DO_NOT_TRACK: 1 + NEXT_TELEMETRY_DEBUG: 1 + NEXT_TELEMETRY_DISABLED: 1 + NG_CLI_ANALYTICS: false + NUXT_TELEMETRY_DISABLED: 1 + PIN_DO_NOT_TRACK: 1 + POWERSHELL_TELEMETRY_OPTOUT: 1 + SAM_CLI_TELEMETRY: 0 + STNOUPGRADE: 1 + STRIPE_CLI_TELEMETRY_OPTOUT: 1 + TELEMETRY_DISABLED: 1 + TERRAFORM_TELEMETRY: 0 + permissions: contents: read id-token: write diff --git a/.github/workflows/Node.yml b/.github/workflows/Node.yml index be3738a3..95af11fc 100644 --- a/.github/workflows/Node.yml +++ b/.github/workflows/Node.yml @@ -51,6 +51,7 @@ jobs: STNOUPGRADE: 1 STRIPE_CLI_TELEMETRY_OPTOUT: 1 TELEMETRY_DISABLED: 1 + TERRAFORM_TELEMETRY: 0 strategy: matrix: @@ -86,7 +87,7 @@ jobs: - run: pnpm run build working-directory: . - - uses: actions/upload-artifact@v4.3.3 + - uses: actions/upload-artifact@v4.3.4 with: name: .-Node-${{ matrix.node-version }}-Target path: ./Target @@ -94,7 +95,7 @@ jobs: - run: pnpm run prepublishOnly working-directory: . - - uses: actions/upload-artifact@v4.3.3 + - uses: actions/upload-artifact@v4.3.4 with: name: .-Node-${{ matrix.node-version }}-Target path: ./Target diff --git a/.github/workflows/Rust.yml b/.github/workflows/Rust.yml index 9ca23ee6..a12666e2 100644 --- a/.github/workflows/Rust.yml +++ b/.github/workflows/Rust.yml @@ -49,6 +49,7 @@ jobs: STNOUPGRADE: 1 STRIPE_CLI_TELEMETRY_OPTOUT: 1 TELEMETRY_DISABLED: 1 + TERRAFORM_TELEMETRY: 0 strategy: matrix: diff --git a/napi/wasi-worker.mjs b/napi/wasi-worker.mjs index 84b448fc..45b35a77 100644 --- a/napi/wasi-worker.mjs +++ b/napi/wasi-worker.mjs @@ -1,8 +1,8 @@ -import fs from "node:fs"; -import { createRequire } from "node:module"; -import { parse } from "node:path"; -import { WASI } from "node:wasi"; -import { parentPort, Worker } from "node:worker_threads"; +import fs from "fs"; +import { createRequire } from "module"; +import { parse } from "path"; +import { WASI } from "wasi"; +import { parentPort, Worker } from "worker_threads"; const require = createRequire(import.meta.url); From 8831dd97fffcf43d2d4f37dbcc4ad7a834713e99 Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Tue, 13 Aug 2024 16:47:31 +0300 Subject: [PATCH 50/82] --- .github/CODE_OF_CONDUCT.md | 127 - .github/FUNDING.yml | 1 - .github/SECURITY.md | 7 - .github/actions/pnpm/action.yml | 26 - .github/codecov.yml | 14 - .github/dependabot.yml | 38 - .github/renovate.json | 5 - .github/workflows/Dependabot.yml | 45 - .github/workflows/GitHub.yml | 58 - .github/workflows/NPM.yml | 74 - .github/workflows/Node.yml | 101 - .github/workflows/Rust.yml | 109 - .github/workflows/benchmark.yml | 41 - .github/workflows/ci.yml | 196 - .github/workflows/codecov.yml | 69 - .github/workflows/release-napi.yml | 252 - .github/workflows/release-plz.yml | 35 - Cargo.lock | 1319 ---- fixtures/enhanced_resolve/test/.gitignore | 3 - fixtures/pnp/.gitignore | 1 - fixtures/pnp/.pnp.cjs | 7543 --------------------- fixtures/pnp/.yarnrc.yml | 1 - fixtures/pnp/package.json | 8 - fixtures/pnp/yarn.lock | 74 - fixtures/pnpm/package.json | 11 - npm/package.json | 79 +- package.json | 53 +- pnpm-lock.yaml | 2603 ------- src/tests/exports_field.rs | 2546 ------- src/tests/extension_alias.rs | 70 - src/tests/mod.rs | 51 - src/tests/pnp.rs | 45 - tests/resolve_test.rs | 132 - 33 files changed, 56 insertions(+), 15681 deletions(-) delete mode 100644 .github/CODE_OF_CONDUCT.md delete mode 100644 .github/FUNDING.yml delete mode 100644 .github/SECURITY.md delete mode 100644 .github/actions/pnpm/action.yml delete mode 100644 .github/codecov.yml delete mode 100644 .github/dependabot.yml delete mode 100644 .github/renovate.json delete mode 100644 .github/workflows/Dependabot.yml delete mode 100644 .github/workflows/GitHub.yml delete mode 100644 .github/workflows/NPM.yml delete mode 100644 .github/workflows/Node.yml delete mode 100644 .github/workflows/Rust.yml delete mode 100644 .github/workflows/benchmark.yml delete mode 100644 .github/workflows/ci.yml delete mode 100644 .github/workflows/codecov.yml delete mode 100644 .github/workflows/release-napi.yml delete mode 100644 .github/workflows/release-plz.yml delete mode 100644 Cargo.lock delete mode 100644 fixtures/enhanced_resolve/test/.gitignore delete mode 100644 fixtures/pnp/.gitignore delete mode 100755 fixtures/pnp/.pnp.cjs delete mode 100644 fixtures/pnp/.yarnrc.yml delete mode 100644 fixtures/pnp/package.json delete mode 100644 fixtures/pnp/yarn.lock delete mode 100644 fixtures/pnpm/package.json delete mode 100644 pnpm-lock.yaml delete mode 100644 src/tests/exports_field.rs delete mode 100644 src/tests/extension_alias.rs delete mode 100644 src/tests/mod.rs delete mode 100644 src/tests/pnp.rs delete mode 100644 tests/resolve_test.rs diff --git a/.github/CODE_OF_CONDUCT.md b/.github/CODE_OF_CONDUCT.md deleted file mode 100644 index 41dd9ebe..00000000 --- a/.github/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,127 +0,0 @@ -# Contributor Covenant Code of Conduct - -## Our Pledge - -We as members, contributors, and leaders pledge to make participation in our -community a harassment-free experience for everyone, regardless of age, body -size, visible or invisible disability, ethnicity, sex characteristics, gender -identity and expression, level of experience, education, socio-economic status, -nationality, personal appearance, race, religion, or sexual identity -and orientation. - -We pledge to act and interact in ways that contribute to an open, welcoming, -diverse, inclusive, and healthy community. - -## Our Standards - -Examples of behavior that contributes to a positive environment for our -community include: - -* Demonstrating empathy and kindness toward other people -* Being respectful of differing opinions, viewpoints, and experiences -* Giving and gracefully accepting constructive feedback -* Accepting responsibility and apologizing to those affected by our mistakes, - and learning from the experience -* Focusing on what is best not just for us as individuals, but for the - overall community - -Examples of unacceptable behavior include: - -* The use of sexualized language or imagery, and sexual attention or - advances of any kind -* Trolling, insulting or derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or email - address, without their explicit permission -* Other conduct which could reasonably be considered inappropriate in a - professional setting - -## Enforcement Responsibilities - -Community leaders are responsible for clarifying and enforcing our standards of -acceptable behavior and will take appropriate and fair corrective action in -response to any behavior that they deem inappropriate, threatening, offensive, -or harmful. - -Community leaders have the right and responsibility to remove, edit, or reject -comments, commits, code, wiki edits, issues, and other contributions that are -not aligned to this Code of Conduct, and will communicate reasons for moderation -decisions when appropriate. - -## Scope - -This Code of Conduct applies within all community spaces, and also applies when -an individual is officially representing the community in public spaces. -Examples of representing our community include using an official e-mail address, -posting via an official social media account, or acting as an appointed -representative at an online or offline event. - -## Enforcement - -Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported to the community leaders responsible for enforcement. -All complaints will be reviewed and investigated promptly and fairly. - -All community leaders are obligated to respect the privacy and security of the -reporter of any incident. - -## Enforcement Guidelines - -Community leaders will follow these Community Impact Guidelines in determining -the consequences for any action they deem in violation of this Code of Conduct: - -### 1. Correction - -**Community Impact**: Use of inappropriate language or other behavior deemed -unprofessional or unwelcome in the community. - -**Consequence**: A private, written warning from community leaders, providing -clarity around the nature of the violation and an explanation of why the -behavior was inappropriate. A public apology may be requested. - -### 2. Warning - -**Community Impact**: A violation through a single incident or series -of actions. - -**Consequence**: A warning with consequences for continued behavior. No -interaction with the people involved, including unsolicited interaction with -those enforcing the Code of Conduct, for a specified period of time. This -includes avoiding interactions in community spaces as well as external channels -like social media. Violating these terms may lead to a temporary or -permanent ban. - -### 3. Temporary Ban - -**Community Impact**: A serious violation of community standards, including -sustained inappropriate behavior. - -**Consequence**: A temporary ban from any sort of interaction or public -communication with the community for a specified period of time. No public or -private interaction with the people involved, including unsolicited interaction -with those enforcing the Code of Conduct, is allowed during this period. -Violating these terms may lead to a permanent ban. - -### 4. Permanent Ban - -**Community Impact**: Demonstrating a pattern of violation of community -standards, including sustained inappropriate behavior, harassment of an -individual, or aggression toward or disparagement of classes of individuals. - -**Consequence**: A permanent ban from any sort of public interaction within -the community. - -## Attribution - -This Code of Conduct is adapted from the [Contributor Covenant][homepage], -version 2.0, available at -https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. - -Community Impact Guidelines were inspired by [Mozilla's code of conduct -enforcement ladder](https://github.com/mozilla/diversity). - -[homepage]: https://www.contributor-covenant.org - -For answers to common questions about this code of conduct, see the FAQ at -https://www.contributor-covenant.org/faq. Translations are available at -https://www.contributor-covenant.org/translations. diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml deleted file mode 100644 index 12f5195d..00000000 --- a/.github/FUNDING.yml +++ /dev/null @@ -1 +0,0 @@ -open_collective: code-editor-land diff --git a/.github/SECURITY.md b/.github/SECURITY.md deleted file mode 100644 index 63f5b072..00000000 --- a/.github/SECURITY.md +++ /dev/null @@ -1,7 +0,0 @@ -# Security Policy - -## Supported Versions - -## Reporting a Vulnerability - -If you find any potential vulnerability, join our [discord channel](https://discord.gg/9uXCAwqQZW) and contact Boshen. diff --git a/.github/actions/pnpm/action.yml b/.github/actions/pnpm/action.yml deleted file mode 100644 index ab4291c0..00000000 --- a/.github/actions/pnpm/action.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: Pnpm - -description: Install pnpm - -runs: - using: composite - steps: - - uses: pnpm/action-setup@v4 - - - uses: actions/setup-node@v4 - with: - node-version-file: .node-version - cache: pnpm - - - name: yarn - shell: bash - run: | - cd fixtures/pnp - corepack enable - yarn install - - - name: pnpm - shell: bash - run: | - corepack enable - pnpm install diff --git a/.github/codecov.yml b/.github/codecov.yml deleted file mode 100644 index 0610268a..00000000 --- a/.github/codecov.yml +++ /dev/null @@ -1,14 +0,0 @@ -coverage: - status: - project: - default: - informational: true - patch: - default: - informational: true - changes: - default: - informational: true - -ignore: - - "examples" diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index f02ca757..00000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,38 +0,0 @@ -version: 2 -enable-beta-ecosystems: true - -updates: - - package-ecosystem: "github-actions" - directory: "/" - schedule: - interval: "daily" - - - package-ecosystem: "cargo" - directory: "/" - schedule: - interval: "daily" - versioning-strategy: lockfile-only - - - package-ecosystem: "cargo" - directory: "/fuzz" - schedule: - interval: "daily" - versioning-strategy: lockfile-only - - - package-ecosystem: "cargo" - directory: "/napi" - schedule: - interval: "daily" - versioning-strategy: lockfile-only - - - package-ecosystem: "npm" - directory: "/npm" - schedule: - interval: "daily" - versioning-strategy: increase - - - package-ecosystem: "npm" - directory: "/" - schedule: - interval: "daily" - versioning-strategy: increase diff --git a/.github/renovate.json b/.github/renovate.json deleted file mode 100644 index 2339df09..00000000 --- a/.github/renovate.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "$schema": "https://docs.renovatebot.com/renovate-schema.json", - "extends": ["github>Boshen/renovate"], - "ignorePaths": ["**/node_modules/**", "**/fixtures/**"] -} diff --git a/.github/workflows/Dependabot.yml b/.github/workflows/Dependabot.yml deleted file mode 100644 index 387fece7..00000000 --- a/.github/workflows/Dependabot.yml +++ /dev/null @@ -1,45 +0,0 @@ -name: Dependabot - -concurrency: - group: Dependabot-${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -permissions: - security-events: write - contents: write - pull-requests: write - -on: - workflow_dispatch: - pull_request: - -jobs: - Approve: - runs-on: ubuntu-latest - - if: ${{ github.actor == 'dependabot[bot]' }} - - steps: - - uses: dependabot/fetch-metadata@v2.2.0 - with: - github-token: "${{ secrets.GITHUB_TOKEN }}" - - - run: gh pr review --approve "$PR_URL" - env: - PR_URL: ${{github.event.pull_request.html_url}} - GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} - - Merge: - runs-on: ubuntu-latest - - if: ${{ github.actor == 'dependabot[bot]' }} - - steps: - - uses: dependabot/fetch-metadata@v2.2.0 - with: - github-token: "${{ secrets.GITHUB_TOKEN }}" - - - run: gh pr merge --auto --merge "$PR_URL" - env: - PR_URL: ${{github.event.pull_request.html_url}} - GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} diff --git a/.github/workflows/GitHub.yml b/.github/workflows/GitHub.yml deleted file mode 100644 index 7b1e399c..00000000 --- a/.github/workflows/GitHub.yml +++ /dev/null @@ -1,58 +0,0 @@ -name: GitHub - -concurrency: - group: GitHub-${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -permissions: - issues: write - pull-requests: write - -on: - issues: - types: [opened] - pull_request: - types: [opened] - -jobs: - Assign: - runs-on: ubuntu-latest - - env: - ADBLOCK: true - ASTRO_TELEMETRY_DISABLED: 1 - AUTOMATEDLAB_TELEMETRY_OPTOUT: 1 - AZURE_CORE_COLLECT_TELEMETRY: 0 - CHOOSENIM_NO_ANALYTICS: 1 - DIEZ_DO_NOT_TRACK: 1 - DOTNET_CLI_TELEMETRY_OPTOUT: 1 - DOTNET_INTERACTIVE_CLI_TELEMETRY_OPTOUT: 1 - DO_NOT_TRACK: 1 - ET_NO_TELEMETRY: 1 - GATSBY_TELEMETRY_DISABLED: 1 - GATSBY_TELEMETRY_OPTOUT: 1 - GATSBY_TELEMETRY_OPT_OUT: 1 - GRIT_TELEMETRY_DISABLED: 1 - HASURA_GRAPHQL_ENABLE_TELEMETRY: false - HINT_TELEMETRY: off - HOMEBREW_NO_ANALYTICS: 1 - INFLUXD_REPORTING_DISABLED: true - ITERATIVE_DO_NOT_TRACK: 1 - NEXT_TELEMETRY_DEBUG: 1 - NEXT_TELEMETRY_DISABLED: 1 - NG_CLI_ANALYTICS: false - NUXT_TELEMETRY_DISABLED: 1 - PIN_DO_NOT_TRACK: 1 - POWERSHELL_TELEMETRY_OPTOUT: 1 - SAM_CLI_TELEMETRY: 0 - STNOUPGRADE: 1 - STRIPE_CLI_TELEMETRY_OPTOUT: 1 - TELEMETRY_DISABLED: 1 - TERRAFORM_TELEMETRY: 0 - - steps: - - uses: pozil/auto-assign-issue@v2.0.0 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - assignees: NikolaRHristov - numOfAssignee: 1 diff --git a/.github/workflows/NPM.yml b/.github/workflows/NPM.yml deleted file mode 100644 index 86bf8e24..00000000 --- a/.github/workflows/NPM.yml +++ /dev/null @@ -1,74 +0,0 @@ -name: NPM - -concurrency: - group: NPM-${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -permissions: - security-events: write - contents: write - pull-requests: write - -on: - workflow_dispatch: - release: - types: [created] - workflow_call: - -jobs: - Publish: - runs-on: ubuntu-latest - - env: - ADBLOCK: true - ASTRO_TELEMETRY_DISABLED: 1 - AUTOMATEDLAB_TELEMETRY_OPTOUT: 1 - AZURE_CORE_COLLECT_TELEMETRY: 0 - CHOOSENIM_NO_ANALYTICS: 1 - DIEZ_DO_NOT_TRACK: 1 - DOTNET_CLI_TELEMETRY_OPTOUT: 1 - DOTNET_INTERACTIVE_CLI_TELEMETRY_OPTOUT: 1 - DO_NOT_TRACK: 1 - ET_NO_TELEMETRY: 1 - GATSBY_TELEMETRY_DISABLED: 1 - GATSBY_TELEMETRY_OPTOUT: 1 - GATSBY_TELEMETRY_OPT_OUT: 1 - GRIT_TELEMETRY_DISABLED: 1 - HASURA_GRAPHQL_ENABLE_TELEMETRY: false - HINT_TELEMETRY: off - HOMEBREW_NO_ANALYTICS: 1 - INFLUXD_REPORTING_DISABLED: true - ITERATIVE_DO_NOT_TRACK: 1 - NEXT_TELEMETRY_DEBUG: 1 - NEXT_TELEMETRY_DISABLED: 1 - NG_CLI_ANALYTICS: false - NUXT_TELEMETRY_DISABLED: 1 - PIN_DO_NOT_TRACK: 1 - POWERSHELL_TELEMETRY_OPTOUT: 1 - SAM_CLI_TELEMETRY: 0 - STNOUPGRADE: 1 - STRIPE_CLI_TELEMETRY_OPTOUT: 1 - TELEMETRY_DISABLED: 1 - TERRAFORM_TELEMETRY: 0 - - permissions: - contents: read - id-token: write - - steps: - - uses: actions/checkout@v4.1.7 - - - uses: actions/setup-node@v4.0.2 - with: - node-version: "18" - registry-url: "https://registry.npmjs.org" - - - run: npm install -g npm - - - name: Publish . - continue-on-error: true - working-directory: . - run: | - npm publish --legacy-peer-deps --provenance --ignore-scripts - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/Node.yml b/.github/workflows/Node.yml deleted file mode 100644 index 95af11fc..00000000 --- a/.github/workflows/Node.yml +++ /dev/null @@ -1,101 +0,0 @@ -name: Node - -concurrency: - group: Node-${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -permissions: - security-events: write - contents: write - pull-requests: write - -on: - workflow_dispatch: - push: - branches: [Current] - pull_request: - branches: [Current] - workflow_call: - -jobs: - Pre-Publish: - runs-on: ubuntu-latest - - env: - ADBLOCK: true - ASTRO_TELEMETRY_DISABLED: 1 - AUTOMATEDLAB_TELEMETRY_OPTOUT: 1 - AZURE_CORE_COLLECT_TELEMETRY: 0 - CHOOSENIM_NO_ANALYTICS: 1 - DIEZ_DO_NOT_TRACK: 1 - DOTNET_CLI_TELEMETRY_OPTOUT: 1 - DOTNET_INTERACTIVE_CLI_TELEMETRY_OPTOUT: 1 - DO_NOT_TRACK: 1 - ET_NO_TELEMETRY: 1 - GATSBY_TELEMETRY_DISABLED: 1 - GATSBY_TELEMETRY_OPTOUT: 1 - GATSBY_TELEMETRY_OPT_OUT: 1 - GRIT_TELEMETRY_DISABLED: 1 - HASURA_GRAPHQL_ENABLE_TELEMETRY: false - HINT_TELEMETRY: off - HOMEBREW_NO_ANALYTICS: 1 - INFLUXD_REPORTING_DISABLED: true - ITERATIVE_DO_NOT_TRACK: 1 - NEXT_TELEMETRY_DEBUG: 1 - NEXT_TELEMETRY_DISABLED: 1 - NG_CLI_ANALYTICS: false - NUXT_TELEMETRY_DISABLED: 1 - PIN_DO_NOT_TRACK: 1 - POWERSHELL_TELEMETRY_OPTOUT: 1 - SAM_CLI_TELEMETRY: 0 - STNOUPGRADE: 1 - STRIPE_CLI_TELEMETRY_OPTOUT: 1 - TELEMETRY_DISABLED: 1 - TERRAFORM_TELEMETRY: 0 - - strategy: - matrix: - node-version: [18, 19, 20] - - steps: - - uses: actions/checkout@v4.1.7 - - - uses: pnpm/action-setup@v4.0.0 - with: - version: 9.3.0 - run_install: | - - recursive: true - args: [ - --link-workspace-packages=true, - --lockfile-only, - --prefer-frozen-lockfile=false, - --shamefully-hoist=false, - --shared-workspace-lockfile=true, - --strict-peer-dependencies=false, - --unsafe-perm=true - ] - - - uses: actions/setup-node@v4.0.2 - with: - node-version: ${{ matrix.node-version }} - cache: "pnpm" - cache-dependency-path: ./pnpm-lock.yaml - - - run: pnpm install - working-directory: . - - - run: pnpm run build - working-directory: . - - - uses: actions/upload-artifact@v4.3.4 - with: - name: .-Node-${{ matrix.node-version }}-Target - path: ./Target - - - run: pnpm run prepublishOnly - working-directory: . - - - uses: actions/upload-artifact@v4.3.4 - with: - name: .-Node-${{ matrix.node-version }}-Target - path: ./Target diff --git a/.github/workflows/Rust.yml b/.github/workflows/Rust.yml deleted file mode 100644 index a12666e2..00000000 --- a/.github/workflows/Rust.yml +++ /dev/null @@ -1,109 +0,0 @@ -name: Rust - -concurrency: - group: Rust-${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -permissions: - security-events: write - -on: - workflow_dispatch: - push: - branches: [Current] - pull_request: - branches: [Current] - workflow_call: - -jobs: - Build: - runs-on: ubuntu-latest - - env: - ADBLOCK: true - ASTRO_TELEMETRY_DISABLED: 1 - AUTOMATEDLAB_TELEMETRY_OPTOUT: 1 - AZURE_CORE_COLLECT_TELEMETRY: 0 - CHOOSENIM_NO_ANALYTICS: 1 - DIEZ_DO_NOT_TRACK: 1 - DOTNET_CLI_TELEMETRY_OPTOUT: 1 - DOTNET_INTERACTIVE_CLI_TELEMETRY_OPTOUT: 1 - DO_NOT_TRACK: 1 - ET_NO_TELEMETRY: 1 - GATSBY_TELEMETRY_DISABLED: 1 - GATSBY_TELEMETRY_OPTOUT: 1 - GATSBY_TELEMETRY_OPT_OUT: 1 - GRIT_TELEMETRY_DISABLED: 1 - HASURA_GRAPHQL_ENABLE_TELEMETRY: false - HINT_TELEMETRY: off - HOMEBREW_NO_ANALYTICS: 1 - INFLUXD_REPORTING_DISABLED: true - ITERATIVE_DO_NOT_TRACK: 1 - NEXT_TELEMETRY_DEBUG: 1 - NEXT_TELEMETRY_DISABLED: 1 - NG_CLI_ANALYTICS: false - NUXT_TELEMETRY_DISABLED: 1 - PIN_DO_NOT_TRACK: 1 - POWERSHELL_TELEMETRY_OPTOUT: 1 - SAM_CLI_TELEMETRY: 0 - STNOUPGRADE: 1 - STRIPE_CLI_TELEMETRY_OPTOUT: 1 - TELEMETRY_DISABLED: 1 - TERRAFORM_TELEMETRY: 0 - - strategy: - matrix: - toolchain: ["stable", "nightly"] - - steps: - - uses: actions/checkout@v4.1.7 - - - uses: actions-rs/toolchain@v1.0.7 - with: - profile: minimal - toolchain: ${{ matrix.toolchain }} - - - uses: actions/cache@v4.0.2 - with: - path: | - ~/.cargo/bin/ - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - target/ - Target/ - key: ${{ runner.os }}-cargo-${{ hashFiles('./Cargo.toml') }} - - uses: actions-rs/cargo@v1.0.3 - with: - command: build - args: --release --all-features --manifest-path ./Cargo.toml - - - uses: actions/cache@v4.0.2 - with: - path: | - ~/.cargo/bin/ - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - target/ - Target/ - key: ${{ runner.os }}-cargo-${{ hashFiles('./fuzz/Cargo.toml') }} - - uses: actions-rs/cargo@v1.0.3 - with: - command: build - args: --release --all-features --manifest-path ./fuzz/Cargo.toml - - - uses: actions/cache@v4.0.2 - with: - path: | - ~/.cargo/bin/ - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - target/ - Target/ - key: ${{ runner.os }}-cargo-${{ hashFiles('./napi/Cargo.toml') }} - - uses: actions-rs/cargo@v1.0.3 - with: - command: build - args: --release --all-features --manifest-path ./napi/Cargo.toml diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml deleted file mode 100644 index 7c25853b..00000000 --- a/.github/workflows/benchmark.yml +++ /dev/null @@ -1,41 +0,0 @@ -name: Benchmark - -on: - workflow_dispatch: - pull_request: - types: [opened, synchronize] - paths-ignore: - - '**/*.md' - push: - branches: - - main - paths-ignore: - - '**/*.md' - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} - cancel-in-progress: true - -jobs: - benchmark: - name: Benchmark - runs-on: ubuntu-latest - steps: - - name: Checkout Branch - uses: taiki-e/checkout-action@v1 - - - uses: Boshen/setup-rust@main - with: - cache-key: benchmark - save-cache: ${{ github.ref_name == 'main' }} - tools: cargo-codspeed - - uses: ./.github/actions/pnpm - - name: Build Benchmark - run: cargo codspeed build --features codspeed - - - name: Run benchmark - uses: CodSpeedHQ/action@v3 - timeout-minutes: 30 - with: - run: cargo codspeed run - token: ${{ secrets.CODSPEED_TOKEN }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index 86a399ab..00000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,196 +0,0 @@ -name: CI - -on: - workflow_dispatch: - pull_request: - types: [opened, synchronize] - paths-ignore: - - '**/*.md' - - '!.github/workflows/ci.yml' - push: - branches: - - main - - "renovate/**" - paths-ignore: - - '**/*.md' - - '!.github/workflows/ci.yml' - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} - cancel-in-progress: ${{ github.ref_name != 'main' }} - -defaults: - run: - shell: bash - -jobs: - cache: # Warm cache factory for all other CI jobs - name: Check and Build - strategy: - fail-fast: true - matrix: - include: - - os: windows-latest - - os: ubuntu-latest - - os: macos-14 - runs-on: ${{ matrix.os }} - steps: - - uses: taiki-e/checkout-action@v1 - - - uses: Boshen/setup-rust@main - with: - save-cache: ${{ github.ref_name == 'main' }} - cache-key: warm - - - run: cargo check --all-features --locked - - # Only need to build the test to create a warm cache on the main branch - - name: Build cache by Cargo Check and Cargo Test - if: ${{ github.ref_name == 'main' }} - run: cargo test --all-features --no-run - - wasm: - name: Check Wasm - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - - uses: Boshen/setup-rust@main - with: - cache-key: wasm - save-cache: ${{ github.ref_name == 'main' }} - - - name: Check - run: | - rustup target add wasm32-unknown-unknown - cargo check --all-features --target wasm32-unknown-unknown - - wasi: - name: Test wasi target - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - - uses: Boshen/setup-rust@main - with: - cache-key: wasi - save-cache: ${{ github.ref_name == 'main' }} - - - uses: ./.github/actions/pnpm - - - name: Build - run: | - rustup target add wasm32-wasip1-threads - pnpm build --target wasm32-wasip1-threads - - - name: Test - run: pnpm test - env: - WASI_TEST: 1 - - typos: - name: Spell Check - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - - uses: crate-ci/typos@v1.23.6 - with: - files: . - - deny: - name: Cargo Deny - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - - uses: dorny/paths-filter@v3 - id: filter - with: - filters: | - src: - - 'Cargo.lock' - - - uses: Boshen/setup-rust@main - with: - restore-cache: false - tools: cargo-deny - - - if: steps.filter.outputs.src == 'true' - run: cargo deny check - - unused-deps: - name: Check Unused Dependencies - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - uses: dorny/paths-filter@v3 - id: filter - with: - filters: | - src: - - '**/*.rs' - - '**/Cargo.toml' - - 'Cargo.lock' - - uses: Boshen/setup-rust@main - with: - restore-cache: false - if: steps.filter.outputs.src == 'true' - - uses: cargo-bins/cargo-binstall@main - if: steps.filter.outputs.src == 'true' - - run: cargo binstall --no-confirm cargo-shear@1 - if: steps.filter.outputs.src == 'true' - - run: cargo shear - if: steps.filter.outputs.src == 'true' - - format: - name: Format - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - uses: Boshen/setup-rust@main - with: - components: rustfmt - restore-cache: false - - run: cargo fmt --all -- --check - - lint: - name: Clippy - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - uses: Boshen/setup-rust@main - with: - components: clippy - - run: cargo clippy --all-features -- -D warnings - - doc: - name: Doc - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - uses: Boshen/setup-rust@main - with: - components: rust-docs - - run: RUSTDOCFLAGS='-D warnings' cargo doc --no-deps --all-features - - test: - name: Test - strategy: - fail-fast: true - matrix: - include: - - os: windows-latest - - os: ubuntu-latest - - os: macos-14 - runs-on: ${{ matrix.os }} - env: - RUST_BACKTRACE: 1 - steps: - - uses: taiki-e/checkout-action@v1 - - uses: ./.github/actions/pnpm - - uses: Boshen/setup-rust@main - with: - cache-key: warm - - run: cargo test --doc - - run: cargo test --all-features diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml deleted file mode 100644 index 97302b03..00000000 --- a/.github/workflows/codecov.yml +++ /dev/null @@ -1,69 +0,0 @@ -name: Code Coverage # Run cargo-llvm-cov and upload to codecov.io - -on: - workflow_dispatch: - pull_request: - types: [opened, synchronize] - paths-ignore: - - '**/*.md' - push: - branches: - - main - paths-ignore: - - '**/*.md' - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: ${{ github.ref_name != 'main' }} - -jobs: - coverage: - name: Code Coverage - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: taiki-e/checkout-action@v1 - - - uses: ./.github/actions/pnpm - - - uses: Boshen/setup-rust@main - with: - cache-key: codecov - save-cache: ${{ github.ref_name == 'main' }} - tools: cargo-llvm-cov - components: llvm-tools-preview - - - run: cargo llvm-cov --lcov --output-path lcov.info - - - name: Upload Artifact - uses: actions/upload-artifact@v4 - with: - name: codecov - path: lcov.info - - # codecov often fails, use another workflow for retry - upload-codecov: - name: Upload coverage file - runs-on: ubuntu-latest - needs: coverage - # Check if the event is not triggered by a fork by checking whether CODECOV_TOKEN is set - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - steps: - - name: Checkout - if: env.CODECOV_TOKEN - uses: taiki-e/checkout-action@v1 - - - name: Download coverage file - if: env.CODECOV_TOKEN - uses: actions/download-artifact@v4 - with: - name: codecov - - - name: Upload to codecov.io - if: env.CODECOV_TOKEN - uses: codecov/codecov-action@v4 - with: - token: ${{ secrets.CODECOV_TOKEN }} - fail_ci_if_error: true - files: lcov.info diff --git a/.github/workflows/release-napi.yml b/.github/workflows/release-napi.yml deleted file mode 100644 index 1ea68db8..00000000 --- a/.github/workflows/release-napi.yml +++ /dev/null @@ -1,252 +0,0 @@ -name: Release NAPI - -on: - workflow_dispatch: - push: - branches: - - main - paths: - - npm/package.json # Please only commit this file, so we don't need to wait for test CI to pass. - -env: - DEBUG: 'napi:*' - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - check: - name: Check version - runs-on: ubuntu-latest - outputs: - version: ${{ env.version }} - version_changed: ${{ steps.version.outputs.changed }} - steps: - - uses: taiki-e/checkout-action@v1 - - - name: Check version changes - uses: EndBug/version-check@v2 - id: version - with: - static-checking: localIsNew - file-url: https://unpkg.com/oxc-resolver@latest/package.json - file-name: npm/package.json - - - name: Set version name - if: steps.version.outputs.changed == 'true' - run: | - echo "Version change found! New version: ${{ steps.version.outputs.version }} (${{ steps.version.outputs.version_type }})" - echo "version=${{ steps.version.outputs.version }}" >> $GITHUB_ENV - - build: - needs: check - if: needs.check.outputs.version_changed == 'true' - env: - version: ${{ needs.check.outputs.version }} - outputs: - version: ${{ env.version }} - strategy: - fail-fast: false - matrix: - include: - - os: windows-latest - target: x86_64-pc-windows-msvc - - - os: windows-latest - target: aarch64-pc-windows-msvc - - - os: ubuntu-latest - target: x86_64-unknown-linux-gnu - - - os: ubuntu-latest - target: x86_64-unknown-linux-musl - - - os: ubuntu-latest - target: aarch64-unknown-linux-gnu - - - os: ubuntu-latest - target: aarch64-unknown-linux-musl - - - os: ubuntu-latest - target: armv7-unknown-linux-gnueabihf - - - os: macos-latest - target: x86_64-apple-darwin - - - os: macos-latest - target: aarch64-apple-darwin - - - os: ubuntu-latest - target: wasm32-wasip1-threads - - name: Package ${{ matrix.target }} - runs-on: ${{ matrix.os }} - steps: - - uses: taiki-e/checkout-action@v1 - - - uses: ./.github/actions/pnpm - - - name: Add Rust Target - run: rustup target add ${{ matrix.target }} - - - uses: goto-bus-stop/setup-zig@v2 - if: ${{ contains(matrix.target, 'musl') }} - with: - version: 0.13.0 - - - name: Build with zig cross - if: ${{ contains(matrix.target, 'musl') }} - run: pnpm build -x --target ${{ matrix.target }} - - - name: Build with napi cross - if: ${{ contains(matrix.target, 'gnu') }} - run: pnpm build --use-napi-cross --target ${{ matrix.target }} - - - name: Build - if: ${{ !contains(matrix.target, 'gnu') && !contains(matrix.target, 'musl') }} - run: pnpm build --target ${{ matrix.target }} - - - name: Test - if: matrix.target == 'x86_64-pc-windows-msvc' || matrix.target == 'aarch64-apple-darwin' || matrix.target == 'wasm32-wasip1-threads' - run: pnpm test - - - name: Output docker params - if: ${{ contains(matrix.target, 'linux') }} - id: docker - run: | - node -e " - if ('${{ matrix.target }}'.startsWith('aarch64')) { - console.log('PLATFORM=linux/arm64') - } else if ('${{ matrix.target }}'.startsWith('armv7')) { - console.log('PLATFORM=linux/arm/v7') - } else { - console.log('PLATFORM=linux/amd64') - } - " >> $GITHUB_OUTPUT - node -e " - if ('${{ matrix.target }}'.endsWith('-musl')) { - console.log('IMAGE=node:lts-alpine') - } else { - console.log('IMAGE=node:lts-slim') - } - " >> $GITHUB_OUTPUT - echo "PNPM_STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_OUTPUT - - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - if: ${{ contains(matrix.target, 'linux') }} - with: - platforms: all - - - run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes - if: ${{ contains(matrix.target, 'linux') }} - - - name: Run linux test - uses: addnab/docker-run-action@v3 - if: ${{ contains(matrix.target, 'linux') }} - with: - image: ${{ steps.docker.outputs.IMAGE }} - options: -v ${{ steps.docker.outputs.PNPM_STORE_PATH }}:${{ steps.docker.outputs.PNPM_STORE_PATH }} -v ${{ github.workspace }}:/oxc_resolver -w /oxc_resolver --platform ${{ steps.docker.outputs.PLATFORM }} - run: | - corepack enable - pnpm test - - - name: Upload artifacts - uses: actions/upload-artifact@v4 - with: - name: bindings-${{ matrix.target }} - path: | - napi/*.node - napi/*.wasm - - build-freebsd: - needs: check - if: needs.check.outputs.version_changed == 'true' - name: Build FreeBSD - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Build - id: build - uses: cross-platform-actions/action@v0.25.0 - env: - DEBUG: napi:* - RUSTUP_IO_THREADS: 1 - with: - operating_system: freebsd - version: '14.0' - memory: 8G - cpu_count: 3 - environment_variables: 'DEBUG RUSTUP_IO_THREADS' - shell: bash - run: | - sudo pkg install -y -f curl node libnghttp2 npm - curl https://sh.rustup.rs -sSf --output rustup.sh - sh rustup.sh -y --profile minimal --default-toolchain stable - source "$HOME/.cargo/env" - echo "~~~~ rustc --version ~~~~" - rustc --version - echo "~~~~ node -v ~~~~" - node -v - pwd - ls -lah - whoami - env - sudo corepack enable - pnpm install - pnpm build --target x86_64-unknown-freebsd - rm -rf node_modules - rm -rf target - - name: Upload artifact - uses: actions/upload-artifact@v4 - with: - name: bindings-freebsd - path: napi/*.node - if-no-files-found: error - - publish: - name: Publish NAPI - runs-on: ubuntu-latest - permissions: - id-token: write # for `npm publish --provenance` - needs: - - build - - build-freebsd - steps: - - uses: taiki-e/checkout-action@v1 - - - name: corepack - run: corepack enable - - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version-file: .node-version - cache: pnpm - - - name: Install dependencies - run: pnpm install --frozen-lockfile - - - name: Download Artifacts - uses: actions/download-artifact@v4 - with: - path: artifacts - - - name: Prepare dirs and artifacts - run: | - pnpm napi create-npm-dirs --package-json-path npm/package.json - pnpm napi artifacts --package-json-path npm/package.json --build-output-dir napi - - - name: Publish npm packages as latest - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - shell: bash - run: | - cp napi/index.js npm/index.js - cp napi/index.d.ts npm/index.d.ts - cp napi/browser.js npm/browser.js - echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc - pnpm napi pre-publish --no-gh-release -t npm --package-json-path npm/package.json - npm publish npm/ --tag latest --provenance --access public diff --git a/.github/workflows/release-plz.yml b/.github/workflows/release-plz.yml deleted file mode 100644 index f757d84a..00000000 --- a/.github/workflows/release-plz.yml +++ /dev/null @@ -1,35 +0,0 @@ -name: Release Plz - -on: - workflow_dispatch: - push: - branches: - - main - paths: - - Cargo.toml - -permissions: - pull-requests: write - contents: write - -jobs: - release-plz: - name: Release-plz - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - uses: Boshen/setup-rust@main - with: - save-cache: ${{ github.ref_name == 'main' }} - cache-key: warm - - - name: Run release-plz - uses: MarcoIeni/release-plz-action@v0.5 - with: - command: release - env: - GITHUB_TOKEN: ${{ secrets.RELEASE_PLZ_TOKEN }} - CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} diff --git a/Cargo.lock b/Cargo.lock deleted file mode 100644 index c6d22701..00000000 --- a/Cargo.lock +++ /dev/null @@ -1,1319 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "adler" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" - -[[package]] -name = "aho-corasick" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" -dependencies = [ - "memchr", -] - -[[package]] -name = "android-tzdata" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" - -[[package]] -name = "android_system_properties" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" -dependencies = [ - "libc", -] - -[[package]] -name = "anes" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "735d4f398ca57cfa2880225c2bf81c3b9af3be5bb22e44ae70118dad38713e84" - -[[package]] -name = "arca" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f915ddd863ef73f11c10c75170e86db1d4f539689bc6bfb9ce25d6528d6fe83" -dependencies = [ - "clean-path", - "path-slash", - "radix_trie", -] - -[[package]] -name = "autocfg" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" - -[[package]] -name = "base64" -version = "0.22.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" - -[[package]] -name = "bit-set" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1" -dependencies = [ - "bit-vec", -] - -[[package]] -name = "bit-vec" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "bitflags" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" - -[[package]] -name = "bpaf" -version = "0.9.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3280efcf6d66bc77c2cf9b67dc8acee47a217d9be67dd590b3230dffe663724d" - -[[package]] -name = "bumpalo" -version = "3.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" - -[[package]] -name = "byteorder" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" - -[[package]] -name = "cast" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" - -[[package]] -name = "cc" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eaff6f8ce506b9773fa786672d63fc7a191ffea1be33f72bbd4aeacefca9ffc8" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "chrono" -version = "0.4.38" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" -dependencies = [ - "android-tzdata", - "iana-time-zone", - "num-traits", - "serde", - "windows-targets 0.52.6", -] - -[[package]] -name = "ciborium" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42e69ffd6f0917f5c029256a24d0161db17cea3997d185db0d35926308770f0e" -dependencies = [ - "ciborium-io", - "ciborium-ll", - "serde", -] - -[[package]] -name = "ciborium-io" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05afea1e0a06c9be33d539b876f1ce3692f4afea2cb41f740e7743225ed1c757" - -[[package]] -name = "ciborium-ll" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57663b653d948a338bfb3eeba9bb2fd5fcfaecb9e199e87e1eda4d9e8b240fd9" -dependencies = [ - "ciborium-io", - "half", -] - -[[package]] -name = "clean-path" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aaa6b4b263a5d737e9bf6b7c09b72c41a5480aec4d7219af827f6564e950b6a5" - -[[package]] -name = "codspeed" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a104ac948e0188b921eb3fcbdd55dcf62e542df4c7ab7e660623f6288302089" -dependencies = [ - "colored", - "libc", - "serde_json", -] - -[[package]] -name = "colored" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbf2150cce219b664a8a70df7a1f933836724b503f8a413af9365b4dcc4d90b8" -dependencies = [ - "lazy_static", - "windows-sys 0.48.0", -] - -[[package]] -name = "concurrent_lru" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7feb5cb312f774e8a24540e27206db4e890f7d488563671d24a16389cf4c2e4e" -dependencies = [ - "once_cell", -] - -[[package]] -name = "convert_case" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec182b0ca2f35d8fc196cf3404988fd8b8c739a4d270ff118a398feb0cbec1ca" -dependencies = [ - "unicode-segmentation", -] - -[[package]] -name = "core-foundation-sys" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" - -[[package]] -name = "criterion2" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8df39381f28ced0ceebfb5611528d99aef14f8d75b43e9d4ceb6aba66e7b04d" -dependencies = [ - "anes", - "bpaf", - "cast", - "ciborium", - "codspeed", - "colored", - "num-traits", - "oorandom", - "serde", - "serde_json", - "walkdir", -] - -[[package]] -name = "crossbeam-deque" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" -dependencies = [ - "crossbeam-epoch", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.9.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" -dependencies = [ - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" - -[[package]] -name = "crunchy" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" - -[[package]] -name = "ctor" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edb49164822f3ee45b17acd4a208cfc1251410cf0cad9a833234c9890774dd9f" -dependencies = [ - "quote", - "syn", -] - -[[package]] -name = "darling" -version = "0.20.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" -dependencies = [ - "darling_core", - "darling_macro", -] - -[[package]] -name = "darling_core" -version = "0.20.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95133861a8032aaea082871032f5815eb9e98cef03fa916ab4500513994df9e5" -dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "strsim", - "syn", -] - -[[package]] -name = "darling_macro" -version = "0.20.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" -dependencies = [ - "darling_core", - "quote", - "syn", -] - -[[package]] -name = "dashmap" -version = "6.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "804c8821570c3f8b70230c2ba75ffa5c0f9a4189b9a432b6656c536712acae28" -dependencies = [ - "cfg-if", - "crossbeam-utils", - "hashbrown 0.14.5", - "lock_api", - "once_cell", - "parking_lot_core", -] - -[[package]] -name = "deranged" -version = "0.3.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" -dependencies = [ - "powerfmt", - "serde", -] - -[[package]] -name = "document-features" -version = "0.2.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb6969eaabd2421f8a2775cfd2471a2b634372b4a25d41e3bd647b79912850a0" -dependencies = [ - "litrs", -] - -[[package]] -name = "dunce" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" - -[[package]] -name = "either" -version = "1.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" - -[[package]] -name = "endian-type" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" - -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "fancy-regex" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "531e46835a22af56d1e3b66f04844bed63158bc094a628bec1d321d9b4c44bf2" -dependencies = [ - "bit-set", - "regex-automata", - "regex-syntax", -] - -[[package]] -name = "filetime" -version = "0.2.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ee447700ac8aa0b2f2bd7bc4462ad686ba06baa6727ac149a2d6277f0d240fd" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall 0.4.1", - "windows-sys 0.52.0", -] - -[[package]] -name = "fnv" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" - -[[package]] -name = "half" -version = "2.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dd08c532ae367adf81c312a4580bc67f1d0fe8bc9c460520283f4c0ff277888" -dependencies = [ - "cfg-if", - "crunchy", -] - -[[package]] -name = "hashbrown" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" - -[[package]] -name = "hashbrown" -version = "0.14.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "iana-time-zone" -version = "0.1.60" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" -dependencies = [ - "android_system_properties", - "core-foundation-sys", - "iana-time-zone-haiku", - "js-sys", - "wasm-bindgen", - "windows-core", -] - -[[package]] -name = "iana-time-zone-haiku" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" -dependencies = [ - "cc", -] - -[[package]] -name = "ident_case" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" - -[[package]] -name = "indexmap" -version = "1.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" -dependencies = [ - "autocfg", - "hashbrown 0.12.3", - "serde", -] - -[[package]] -name = "indexmap" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de3fc2e30ba82dd1b3911c8de1ffc143c74a914a14e99514d7637e3099df5ea0" -dependencies = [ - "equivalent", - "hashbrown 0.14.5", - "serde", -] - -[[package]] -name = "itoa" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" - -[[package]] -name = "js-sys" -version = "0.3.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" -dependencies = [ - "wasm-bindgen", -] - -[[package]] -name = "json-strip-comments" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b271732a960335e715b6b2ae66a086f115c74eb97360e996d2bd809bfc063bba" -dependencies = [ - "memchr", -] - -[[package]] -name = "lazy_static" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" - -[[package]] -name = "libc" -version = "0.2.155" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" - -[[package]] -name = "libloading" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e310b3a6b5907f99202fcdb4960ff45b93735d7c7d96b760fcff8db2dc0e103d" -dependencies = [ - "cfg-if", - "windows-targets 0.52.6", -] - -[[package]] -name = "litrs" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4ce301924b7887e9d637144fdade93f9dfff9b60981d4ac161db09720d39aa5" - -[[package]] -name = "lock_api" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" -dependencies = [ - "autocfg", - "scopeguard", -] - -[[package]] -name = "log" -version = "0.4.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" - -[[package]] -name = "memchr" -version = "2.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" - -[[package]] -name = "miniz_oxide" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" -dependencies = [ - "adler", -] - -[[package]] -name = "napi" -version = "3.0.0-alpha.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ec04344cc540f5897e97c9821ab99e7eb276b4dca6f3e6e441dfa72e5bcde70" -dependencies = [ - "bitflags 2.6.0", - "ctor", - "napi-build", - "napi-sys", - "once_cell", - "serde", - "serde_json", -] - -[[package]] -name = "napi-build" -version = "2.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1c0f5d67ee408a4685b61f5ab7e58605c8ae3f2b4189f0127d804ff13d5560a" - -[[package]] -name = "napi-derive" -version = "3.0.0-alpha.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c6240c4ddca592cde608bbfa26e2af397c3596e413a0c65c9bbcb65c2f1e485" -dependencies = [ - "cfg-if", - "convert_case", - "napi-derive-backend", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "napi-derive-backend" -version = "2.0.0-alpha.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b32dcc50065508fe2f387076c17adbdf10e038d1c080d48b10196813d94ac6a8" -dependencies = [ - "convert_case", - "once_cell", - "proc-macro2", - "quote", - "regex", - "semver", - "syn", -] - -[[package]] -name = "napi-sys" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "427802e8ec3a734331fec1035594a210ce1ff4dc5bc1950530920ab717964ea3" -dependencies = [ - "libloading", -] - -[[package]] -name = "nibble_vec" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" -dependencies = [ - "smallvec", -] - -[[package]] -name = "normalize-path" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5438dd2b2ff4c6df6e1ce22d825ed2fa93ee2922235cc45186991717f0a892d" - -[[package]] -name = "num-conv" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" - -[[package]] -name = "num-traits" -version = "0.2.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" -dependencies = [ - "autocfg", -] - -[[package]] -name = "once_cell" -version = "1.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" - -[[package]] -name = "oorandom" -version = "11.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b410bbe7e14ab526a0e86877eb47c6996a2bd7746f027ba551028c925390e4e9" - -[[package]] -name = "oxc_napi_resolver" -version = "0.0.0" -dependencies = [ - "napi", - "napi-build", - "napi-derive", - "oxc_resolver", - "tracing-subscriber", -] - -[[package]] -name = "oxc_resolver" -version = "1.10.2" -dependencies = [ - "cfg-if", - "criterion2", - "dashmap", - "document-features", - "dunce", - "indexmap 2.3.0", - "json-strip-comments", - "normalize-path", - "once_cell", - "pnp", - "rayon", - "rustc-hash", - "serde", - "serde_json", - "thiserror", - "tracing", - "vfs", -] - -[[package]] -name = "parking_lot_core" -version = "0.9.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall 0.5.2", - "smallvec", - "windows-targets 0.52.6", -] - -[[package]] -name = "path-slash" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e91099d4268b0e11973f036e885d652fb0b21fedcf69738c627f94db6a44f42" - -[[package]] -name = "pathdiff" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8835116a5c179084a830efb3adc117ab007512b535bc1a21c991d3b32a6b44dd" - -[[package]] -name = "pin-project-lite" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" - -[[package]] -name = "pnp" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46770cee76a618023fea15411d0449dd066dc232cc17e4562f154da215f27af7" -dependencies = [ - "arca", - "byteorder", - "concurrent_lru", - "fancy-regex", - "lazy_static", - "miniz_oxide", - "pathdiff", - "regex", - "serde", - "serde_json", - "serde_with", - "thiserror", -] - -[[package]] -name = "powerfmt" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" - -[[package]] -name = "proc-macro2" -version = "1.0.86" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.36" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "radix_trie" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" -dependencies = [ - "endian-type", - "nibble_vec", -] - -[[package]] -name = "rayon" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" -dependencies = [ - "either", - "rayon-core", -] - -[[package]] -name = "rayon-core" -version = "1.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" -dependencies = [ - "crossbeam-deque", - "crossbeam-utils", -] - -[[package]] -name = "redox_syscall" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" -dependencies = [ - "bitflags 1.3.2", -] - -[[package]] -name = "redox_syscall" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c82cf8cff14456045f55ec4241383baeff27af886adb72ffb2162f99911de0fd" -dependencies = [ - "bitflags 2.6.0", -] - -[[package]] -name = "regex" -version = "1.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b91213439dad192326a0d7c6ee3955910425f441d7038e0d6933b0aec5c4517f" -dependencies = [ - "aho-corasick", - "memchr", - "regex-automata", - "regex-syntax", -] - -[[package]] -name = "regex-automata" -version = "0.4.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", -] - -[[package]] -name = "regex-syntax" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" - -[[package]] -name = "rustc-hash" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" - -[[package]] -name = "ryu" -version = "1.0.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" - -[[package]] -name = "same-file" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "scopeguard" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" - -[[package]] -name = "semver" -version = "1.0.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" - -[[package]] -name = "serde" -version = "1.0.206" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b3e4cd94123dd520a128bcd11e34d9e9e423e7e3e50425cb1b4b1e3549d0284" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.206" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fabfb6138d2383ea8208cf98ccf69cdfb1aff4088460681d84189aa259762f97" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "serde_json" -version = "1.0.124" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66ad62847a56b3dba58cc891acd13884b9c61138d330c0d7b6181713d4fce38d" -dependencies = [ - "indexmap 2.3.0", - "itoa", - "memchr", - "ryu", - "serde", -] - -[[package]] -name = "serde_with" -version = "3.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e73139bc5ec2d45e6c5fd85be5a46949c1c39a4c18e56915f5eb4c12f975e377" -dependencies = [ - "base64", - "chrono", - "hex", - "indexmap 1.9.3", - "indexmap 2.3.0", - "serde", - "serde_derive", - "serde_json", - "serde_with_macros", - "time", -] - -[[package]] -name = "serde_with_macros" -version = "3.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b80d3d6b56b64335c0180e5ffde23b3c5e08c14c585b51a15bd0e95393f46703" -dependencies = [ - "darling", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "sharded-slab" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" -dependencies = [ - "lazy_static", -] - -[[package]] -name = "smallvec" -version = "1.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" - -[[package]] -name = "strsim" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" - -[[package]] -name = "syn" -version = "2.0.70" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f0209b68b3613b093e0ec905354eccaedcfe83b8cb37cbdeae64026c3064c16" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "thiserror" -version = "1.0.63" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.63" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "thread_local" -version = "1.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" -dependencies = [ - "cfg-if", - "once_cell", -] - -[[package]] -name = "time" -version = "0.3.36" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" -dependencies = [ - "deranged", - "itoa", - "num-conv", - "powerfmt", - "serde", - "time-core", - "time-macros", -] - -[[package]] -name = "time-core" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" - -[[package]] -name = "time-macros" -version = "0.2.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" -dependencies = [ - "num-conv", - "time-core", -] - -[[package]] -name = "tracing" -version = "0.1.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" -dependencies = [ - "pin-project-lite", - "tracing-attributes", - "tracing-core", -] - -[[package]] -name = "tracing-attributes" -version = "0.1.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "tracing-core" -version = "0.1.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" -dependencies = [ - "once_cell", -] - -[[package]] -name = "tracing-subscriber" -version = "0.3.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" -dependencies = [ - "sharded-slab", - "thread_local", - "tracing-core", -] - -[[package]] -name = "unicode-ident" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" - -[[package]] -name = "unicode-segmentation" -version = "1.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" - -[[package]] -name = "vfs" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "654cd097e182a71dbf899178e6b5662c2157dd0b8afd5975de18008f6fc173d1" -dependencies = [ - "filetime", -] - -[[package]] -name = "walkdir" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" -dependencies = [ - "same-file", - "winapi-util", -] - -[[package]] -name = "wasm-bindgen" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" -dependencies = [ - "cfg-if", - "wasm-bindgen-macro", -] - -[[package]] -name = "wasm-bindgen-backend" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" -dependencies = [ - "bumpalo", - "log", - "once_cell", - "proc-macro2", - "quote", - "syn", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-macro" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" -dependencies = [ - "quote", - "wasm-bindgen-macro-support", -] - -[[package]] -name = "wasm-bindgen-macro-support" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" -dependencies = [ - "proc-macro2", - "quote", - "syn", - "wasm-bindgen-backend", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-shared" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" - -[[package]] -name = "winapi-util" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b" -dependencies = [ - "windows-sys 0.52.0", -] - -[[package]] -name = "windows-core" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" -dependencies = [ - "windows-targets 0.52.6", -] - -[[package]] -name = "windows-sys" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" -dependencies = [ - "windows-targets 0.48.5", -] - -[[package]] -name = "windows-sys" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" -dependencies = [ - "windows-targets 0.52.6", -] - -[[package]] -name = "windows-targets" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" -dependencies = [ - "windows_aarch64_gnullvm 0.48.5", - "windows_aarch64_msvc 0.48.5", - "windows_i686_gnu 0.48.5", - "windows_i686_msvc 0.48.5", - "windows_x86_64_gnu 0.48.5", - "windows_x86_64_gnullvm 0.48.5", - "windows_x86_64_msvc 0.48.5", -] - -[[package]] -name = "windows-targets" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" -dependencies = [ - "windows_aarch64_gnullvm 0.52.6", - "windows_aarch64_msvc 0.52.6", - "windows_i686_gnu 0.52.6", - "windows_i686_gnullvm", - "windows_i686_msvc 0.52.6", - "windows_x86_64_gnu 0.52.6", - "windows_x86_64_gnullvm 0.52.6", - "windows_x86_64_msvc 0.52.6", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" - -[[package]] -name = "windows_i686_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" - -[[package]] -name = "windows_i686_gnu" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" - -[[package]] -name = "windows_i686_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" - -[[package]] -name = "windows_i686_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" - -[[package]] -name = "windows_i686_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" diff --git a/fixtures/enhanced_resolve/test/.gitignore b/fixtures/enhanced_resolve/test/.gitignore deleted file mode 100644 index b021b4e4..00000000 --- a/fixtures/enhanced_resolve/test/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -# created by symlink.rs -/temp -/temp_symlinks \ No newline at end of file diff --git a/fixtures/pnp/.gitignore b/fixtures/pnp/.gitignore deleted file mode 100644 index 1783c71a..00000000 --- a/fixtures/pnp/.gitignore +++ /dev/null @@ -1 +0,0 @@ -install_state.gz \ No newline at end of file diff --git a/fixtures/pnp/.pnp.cjs b/fixtures/pnp/.pnp.cjs deleted file mode 100755 index 2a8d1771..00000000 --- a/fixtures/pnp/.pnp.cjs +++ /dev/null @@ -1,7543 +0,0 @@ -#!/usr/bin/env node -/* eslint-disable */ -// @ts-nocheck -"use strict"; - -const RAW_RUNTIME_STATE = -'{\ - "__info": [\ - "This file is automatically generated. Do not touch it, or risk",\ - "your modifications being lost."\ - ],\ - "dependencyTreeRoots": [\ - {\ - "name": "pnp",\ - "reference": "workspace:."\ - }\ - ],\ - "enableTopLevelFallback": true,\ - "ignorePatternData": "(^(?:\\\\.yarn\\\\/sdks(?:\\\\/(?!\\\\.{1,2}(?:\\\\/|$))(?:(?:(?!(?:^|\\\\/)\\\\.{1,2}(?:\\\\/|$)).)*?)|$))$)",\ - "fallbackExclusionList": [\ - ["pnp", ["workspace:."]]\ - ],\ - "fallbackPool": [\ - ],\ - "packageRegistryData": [\ - [null, [\ - [null, {\ - "packageLocation": "./",\ - "packageDependencies": [\ - ["is-even", "npm:1.0.0"],\ - ["is-odd", "npm:3.0.1"]\ - ],\ - "linkType": "SOFT"\ - }]\ - ]],\ - ["is-buffer", [\ - ["npm:1.1.6", {\ - "packageLocation": "./.yarn/cache/is-buffer-npm-1.1.6-08199d9ccc-ae18aa0b6e.zip/node_modules/is-buffer/",\ - "packageDependencies": [\ - ["is-buffer", "npm:1.1.6"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["is-even", [\ - ["npm:1.0.0", {\ - "packageLocation": "./.yarn/cache/is-even-npm-1.0.0-9f726520dc-2728cc2f39.zip/node_modules/is-even/",\ - "packageDependencies": [\ - ["is-even", "npm:1.0.0"],\ - ["is-odd", "npm:0.1.2"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["is-number", [\ - ["npm:3.0.0", {\ - "packageLocation": "./.yarn/cache/is-number-npm-3.0.0-9088035ade-e639c54640.zip/node_modules/is-number/",\ - "packageDependencies": [\ - ["is-number", "npm:3.0.0"],\ - ["kind-of", "npm:3.2.2"]\ - ],\ - "linkType": "HARD"\ - }],\ - ["npm:6.0.0", {\ - "packageLocation": "./.yarn/cache/is-number-npm-6.0.0-30881e83e6-5da4c68401.zip/node_modules/is-number/",\ - "packageDependencies": [\ - ["is-number", "npm:6.0.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["is-odd", [\ - ["npm:0.1.2", {\ - "packageLocation": "./.yarn/cache/is-odd-npm-0.1.2-9d980a9da8-7dc6c6fd00.zip/node_modules/is-odd/",\ - "packageDependencies": [\ - ["is-odd", "npm:0.1.2"],\ - ["is-number", "npm:3.0.0"]\ - ],\ - "linkType": "HARD"\ - }],\ - ["npm:3.0.1", {\ - "packageLocation": "./.yarn/cache/is-odd-npm-3.0.1-93c3c3f41b-89ee2e353c.zip/node_modules/is-odd/",\ - "packageDependencies": [\ - ["is-odd", "npm:3.0.1"],\ - ["is-number", "npm:6.0.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["kind-of", [\ - ["npm:3.2.2", {\ - "packageLocation": "./.yarn/cache/kind-of-npm-3.2.2-7deaffa5f9-7e34bc29d4.zip/node_modules/kind-of/",\ - "packageDependencies": [\ - ["kind-of", "npm:3.2.2"],\ - ["is-buffer", "npm:1.1.6"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["pnp", [\ - ["workspace:.", {\ - "packageLocation": "./",\ - "packageDependencies": [\ - ["pnp", "workspace:."],\ - ["is-even", "npm:1.0.0"],\ - ["is-odd", "npm:3.0.1"]\ - ],\ - "linkType": "SOFT"\ - }]\ - ]]\ - ]\ -}'; - -function $$SETUP_STATE(hydrateRuntimeState, basePath) { - return hydrateRuntimeState(JSON.parse(RAW_RUNTIME_STATE), {basePath: basePath || __dirname}); -} - -const fs = require('fs'); -const path = require('path'); -const crypto = require('crypto'); -const os = require('os'); -const events = require('events'); -const nodeUtils = require('util'); -const stream = require('stream'); -const zlib = require('zlib'); -const require$$0 = require('module'); -const StringDecoder = require('string_decoder'); -const url = require('url'); -const buffer = require('buffer'); -const readline = require('readline'); -const assert = require('assert'); - -const _interopDefaultLegacy = e => e && typeof e === 'object' && 'default' in e ? e : { default: e }; - -function _interopNamespace(e) { - if (e && e.__esModule) return e; - const n = Object.create(null); - if (e) { - for (const k in e) { - if (k !== 'default') { - const d = Object.getOwnPropertyDescriptor(e, k); - Object.defineProperty(n, k, d.get ? d : { - enumerable: true, - get: () => e[k] - }); - } - } - } - n.default = e; - return Object.freeze(n); -} - -const fs__default = /*#__PURE__*/_interopDefaultLegacy(fs); -const path__default = /*#__PURE__*/_interopDefaultLegacy(path); -const nodeUtils__namespace = /*#__PURE__*/_interopNamespace(nodeUtils); -const zlib__default = /*#__PURE__*/_interopDefaultLegacy(zlib); -const require$$0__default = /*#__PURE__*/_interopDefaultLegacy(require$$0); -const StringDecoder__default = /*#__PURE__*/_interopDefaultLegacy(StringDecoder); -const buffer__default = /*#__PURE__*/_interopDefaultLegacy(buffer); -const assert__default = /*#__PURE__*/_interopDefaultLegacy(assert); - -const S_IFMT = 61440; -const S_IFDIR = 16384; -const S_IFREG = 32768; -const S_IFLNK = 40960; -const SAFE_TIME = 456789e3; - -function makeError$1(code, message) { - return Object.assign(new Error(`${code}: ${message}`), { code }); -} -function EBUSY(message) { - return makeError$1(`EBUSY`, message); -} -function ENOSYS(message, reason) { - return makeError$1(`ENOSYS`, `${message}, ${reason}`); -} -function EINVAL(reason) { - return makeError$1(`EINVAL`, `invalid argument, ${reason}`); -} -function EBADF(reason) { - return makeError$1(`EBADF`, `bad file descriptor, ${reason}`); -} -function ENOENT(reason) { - return makeError$1(`ENOENT`, `no such file or directory, ${reason}`); -} -function ENOTDIR(reason) { - return makeError$1(`ENOTDIR`, `not a directory, ${reason}`); -} -function EISDIR(reason) { - return makeError$1(`EISDIR`, `illegal operation on a directory, ${reason}`); -} -function EEXIST(reason) { - return makeError$1(`EEXIST`, `file already exists, ${reason}`); -} -function EROFS(reason) { - return makeError$1(`EROFS`, `read-only filesystem, ${reason}`); -} -function ENOTEMPTY(reason) { - return makeError$1(`ENOTEMPTY`, `directory not empty, ${reason}`); -} -function EOPNOTSUPP(reason) { - return makeError$1(`EOPNOTSUPP`, `operation not supported, ${reason}`); -} -function ERR_DIR_CLOSED() { - return makeError$1(`ERR_DIR_CLOSED`, `Directory handle was closed`); -} - -const DEFAULT_MODE = S_IFREG | 420; -class StatEntry { - constructor() { - this.uid = 0; - this.gid = 0; - this.size = 0; - this.blksize = 0; - this.atimeMs = 0; - this.mtimeMs = 0; - this.ctimeMs = 0; - this.birthtimeMs = 0; - this.atime = new Date(0); - this.mtime = new Date(0); - this.ctime = new Date(0); - this.birthtime = new Date(0); - this.dev = 0; - this.ino = 0; - this.mode = DEFAULT_MODE; - this.nlink = 1; - this.rdev = 0; - this.blocks = 1; - } - isBlockDevice() { - return false; - } - isCharacterDevice() { - return false; - } - isDirectory() { - return (this.mode & S_IFMT) === S_IFDIR; - } - isFIFO() { - return false; - } - isFile() { - return (this.mode & S_IFMT) === S_IFREG; - } - isSocket() { - return false; - } - isSymbolicLink() { - return (this.mode & S_IFMT) === S_IFLNK; - } -} -class BigIntStatsEntry { - constructor() { - this.uid = BigInt(0); - this.gid = BigInt(0); - this.size = BigInt(0); - this.blksize = BigInt(0); - this.atimeMs = BigInt(0); - this.mtimeMs = BigInt(0); - this.ctimeMs = BigInt(0); - this.birthtimeMs = BigInt(0); - this.atimeNs = BigInt(0); - this.mtimeNs = BigInt(0); - this.ctimeNs = BigInt(0); - this.birthtimeNs = BigInt(0); - this.atime = new Date(0); - this.mtime = new Date(0); - this.ctime = new Date(0); - this.birthtime = new Date(0); - this.dev = BigInt(0); - this.ino = BigInt(0); - this.mode = BigInt(DEFAULT_MODE); - this.nlink = BigInt(1); - this.rdev = BigInt(0); - this.blocks = BigInt(1); - } - isBlockDevice() { - return false; - } - isCharacterDevice() { - return false; - } - isDirectory() { - return (this.mode & BigInt(S_IFMT)) === BigInt(S_IFDIR); - } - isFIFO() { - return false; - } - isFile() { - return (this.mode & BigInt(S_IFMT)) === BigInt(S_IFREG); - } - isSocket() { - return false; - } - isSymbolicLink() { - return (this.mode & BigInt(S_IFMT)) === BigInt(S_IFLNK); - } -} -function makeDefaultStats() { - return new StatEntry(); -} -function clearStats(stats) { - for (const key in stats) { - if (Object.hasOwn(stats, key)) { - const element = stats[key]; - if (typeof element === `number`) { - stats[key] = 0; - } else if (typeof element === `bigint`) { - stats[key] = BigInt(0); - } else if (nodeUtils__namespace.types.isDate(element)) { - stats[key] = new Date(0); - } - } - } - return stats; -} -function convertToBigIntStats(stats) { - const bigintStats = new BigIntStatsEntry(); - for (const key in stats) { - if (Object.hasOwn(stats, key)) { - const element = stats[key]; - if (typeof element === `number`) { - bigintStats[key] = BigInt(element); - } else if (nodeUtils__namespace.types.isDate(element)) { - bigintStats[key] = new Date(element); - } - } - } - bigintStats.atimeNs = bigintStats.atimeMs * BigInt(1e6); - bigintStats.mtimeNs = bigintStats.mtimeMs * BigInt(1e6); - bigintStats.ctimeNs = bigintStats.ctimeMs * BigInt(1e6); - bigintStats.birthtimeNs = bigintStats.birthtimeMs * BigInt(1e6); - return bigintStats; -} -function areStatsEqual(a, b) { - if (a.atimeMs !== b.atimeMs) - return false; - if (a.birthtimeMs !== b.birthtimeMs) - return false; - if (a.blksize !== b.blksize) - return false; - if (a.blocks !== b.blocks) - return false; - if (a.ctimeMs !== b.ctimeMs) - return false; - if (a.dev !== b.dev) - return false; - if (a.gid !== b.gid) - return false; - if (a.ino !== b.ino) - return false; - if (a.isBlockDevice() !== b.isBlockDevice()) - return false; - if (a.isCharacterDevice() !== b.isCharacterDevice()) - return false; - if (a.isDirectory() !== b.isDirectory()) - return false; - if (a.isFIFO() !== b.isFIFO()) - return false; - if (a.isFile() !== b.isFile()) - return false; - if (a.isSocket() !== b.isSocket()) - return false; - if (a.isSymbolicLink() !== b.isSymbolicLink()) - return false; - if (a.mode !== b.mode) - return false; - if (a.mtimeMs !== b.mtimeMs) - return false; - if (a.nlink !== b.nlink) - return false; - if (a.rdev !== b.rdev) - return false; - if (a.size !== b.size) - return false; - if (a.uid !== b.uid) - return false; - const aN = a; - const bN = b; - if (aN.atimeNs !== bN.atimeNs) - return false; - if (aN.mtimeNs !== bN.mtimeNs) - return false; - if (aN.ctimeNs !== bN.ctimeNs) - return false; - if (aN.birthtimeNs !== bN.birthtimeNs) - return false; - return true; -} - -const PortablePath = { - root: `/`, - dot: `.`, - parent: `..` -}; -const Filename = { - home: `~`, - nodeModules: `node_modules`, - manifest: `package.json`, - lockfile: `yarn.lock`, - virtual: `__virtual__`, - pnpJs: `.pnp.js`, - pnpCjs: `.pnp.cjs`, - pnpData: `.pnp.data.json`, - pnpEsmLoader: `.pnp.loader.mjs`, - rc: `.yarnrc.yml`, - env: `.env` -}; -const npath = Object.create(path__default.default); -const ppath = Object.create(path__default.default.posix); -npath.cwd = () => process.cwd(); -ppath.cwd = process.platform === `win32` ? () => toPortablePath(process.cwd()) : process.cwd; -if (process.platform === `win32`) { - ppath.resolve = (...segments) => { - if (segments.length > 0 && ppath.isAbsolute(segments[0])) { - return path__default.default.posix.resolve(...segments); - } else { - return path__default.default.posix.resolve(ppath.cwd(), ...segments); - } - }; -} -const contains = function(pathUtils, from, to) { - from = pathUtils.normalize(from); - to = pathUtils.normalize(to); - if (from === to) - return `.`; - if (!from.endsWith(pathUtils.sep)) - from = from + pathUtils.sep; - if (to.startsWith(from)) { - return to.slice(from.length); - } else { - return null; - } -}; -npath.contains = (from, to) => contains(npath, from, to); -ppath.contains = (from, to) => contains(ppath, from, to); -const WINDOWS_PATH_REGEXP = /^([a-zA-Z]:.*)$/; -const UNC_WINDOWS_PATH_REGEXP = /^\/\/(\.\/)?(.*)$/; -const PORTABLE_PATH_REGEXP = /^\/([a-zA-Z]:.*)$/; -const UNC_PORTABLE_PATH_REGEXP = /^\/unc\/(\.dot\/)?(.*)$/; -function fromPortablePathWin32(p) { - let portablePathMatch, uncPortablePathMatch; - if (portablePathMatch = p.match(PORTABLE_PATH_REGEXP)) - p = portablePathMatch[1]; - else if (uncPortablePathMatch = p.match(UNC_PORTABLE_PATH_REGEXP)) - p = `\\\\${uncPortablePathMatch[1] ? `.\\` : ``}${uncPortablePathMatch[2]}`; - else - return p; - return p.replace(/\//g, `\\`); -} -function toPortablePathWin32(p) { - p = p.replace(/\\/g, `/`); - let windowsPathMatch, uncWindowsPathMatch; - if (windowsPathMatch = p.match(WINDOWS_PATH_REGEXP)) - p = `/${windowsPathMatch[1]}`; - else if (uncWindowsPathMatch = p.match(UNC_WINDOWS_PATH_REGEXP)) - p = `/unc/${uncWindowsPathMatch[1] ? `.dot/` : ``}${uncWindowsPathMatch[2]}`; - return p; -} -const toPortablePath = process.platform === `win32` ? toPortablePathWin32 : (p) => p; -const fromPortablePath = process.platform === `win32` ? fromPortablePathWin32 : (p) => p; -npath.fromPortablePath = fromPortablePath; -npath.toPortablePath = toPortablePath; -function convertPath(targetPathUtils, sourcePath) { - return targetPathUtils === npath ? fromPortablePath(sourcePath) : toPortablePath(sourcePath); -} - -const defaultTime = new Date(SAFE_TIME * 1e3); -const defaultTimeMs = defaultTime.getTime(); -async function copyPromise(destinationFs, destination, sourceFs, source, opts) { - const normalizedDestination = destinationFs.pathUtils.normalize(destination); - const normalizedSource = sourceFs.pathUtils.normalize(source); - const prelayout = []; - const postlayout = []; - const { atime, mtime } = opts.stableTime ? { atime: defaultTime, mtime: defaultTime } : await sourceFs.lstatPromise(normalizedSource); - await destinationFs.mkdirpPromise(destinationFs.pathUtils.dirname(destination), { utimes: [atime, mtime] }); - await copyImpl(prelayout, postlayout, destinationFs, normalizedDestination, sourceFs, normalizedSource, { ...opts, didParentExist: true }); - for (const operation of prelayout) - await operation(); - await Promise.all(postlayout.map((operation) => { - return operation(); - })); -} -async function copyImpl(prelayout, postlayout, destinationFs, destination, sourceFs, source, opts) { - const destinationStat = opts.didParentExist ? await maybeLStat(destinationFs, destination) : null; - const sourceStat = await sourceFs.lstatPromise(source); - const { atime, mtime } = opts.stableTime ? { atime: defaultTime, mtime: defaultTime } : sourceStat; - let updated; - switch (true) { - case sourceStat.isDirectory(): - { - updated = await copyFolder(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts); - } - break; - case sourceStat.isFile(): - { - updated = await copyFile(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts); - } - break; - case sourceStat.isSymbolicLink(): - { - updated = await copySymlink(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts); - } - break; - default: { - throw new Error(`Unsupported file type (${sourceStat.mode})`); - } - } - if (opts.linkStrategy?.type !== `HardlinkFromIndex` || !sourceStat.isFile()) { - if (updated || destinationStat?.mtime?.getTime() !== mtime.getTime() || destinationStat?.atime?.getTime() !== atime.getTime()) { - postlayout.push(() => destinationFs.lutimesPromise(destination, atime, mtime)); - updated = true; - } - if (destinationStat === null || (destinationStat.mode & 511) !== (sourceStat.mode & 511)) { - postlayout.push(() => destinationFs.chmodPromise(destination, sourceStat.mode & 511)); - updated = true; - } - } - return updated; -} -async function maybeLStat(baseFs, p) { - try { - return await baseFs.lstatPromise(p); - } catch (e) { - return null; - } -} -async function copyFolder(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts) { - if (destinationStat !== null && !destinationStat.isDirectory()) { - if (opts.overwrite) { - prelayout.push(async () => destinationFs.removePromise(destination)); - destinationStat = null; - } else { - return false; - } - } - let updated = false; - if (destinationStat === null) { - prelayout.push(async () => { - try { - await destinationFs.mkdirPromise(destination, { mode: sourceStat.mode }); - } catch (err) { - if (err.code !== `EEXIST`) { - throw err; - } - } - }); - updated = true; - } - const entries = await sourceFs.readdirPromise(source); - const nextOpts = opts.didParentExist && !destinationStat ? { ...opts, didParentExist: false } : opts; - if (opts.stableSort) { - for (const entry of entries.sort()) { - if (await copyImpl(prelayout, postlayout, destinationFs, destinationFs.pathUtils.join(destination, entry), sourceFs, sourceFs.pathUtils.join(source, entry), nextOpts)) { - updated = true; - } - } - } else { - const entriesUpdateStatus = await Promise.all(entries.map(async (entry) => { - await copyImpl(prelayout, postlayout, destinationFs, destinationFs.pathUtils.join(destination, entry), sourceFs, sourceFs.pathUtils.join(source, entry), nextOpts); - })); - if (entriesUpdateStatus.some((status) => status)) { - updated = true; - } - } - return updated; -} -async function copyFileViaIndex(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts, linkStrategy) { - const sourceHash = await sourceFs.checksumFilePromise(source, { algorithm: `sha1` }); - const defaultMode = 420; - const sourceMode = sourceStat.mode & 511; - const indexFileName = `${sourceHash}${sourceMode !== defaultMode ? sourceMode.toString(8) : ``}`; - const indexPath = destinationFs.pathUtils.join(linkStrategy.indexPath, sourceHash.slice(0, 2), `${indexFileName}.dat`); - let AtomicBehavior; - ((AtomicBehavior2) => { - AtomicBehavior2[AtomicBehavior2["Lock"] = 0] = "Lock"; - AtomicBehavior2[AtomicBehavior2["Rename"] = 1] = "Rename"; - })(AtomicBehavior || (AtomicBehavior = {})); - let atomicBehavior = 1 /* Rename */; - let indexStat = await maybeLStat(destinationFs, indexPath); - if (destinationStat) { - const isDestinationHardlinkedFromIndex = indexStat && destinationStat.dev === indexStat.dev && destinationStat.ino === indexStat.ino; - const isIndexModified = indexStat?.mtimeMs !== defaultTimeMs; - if (isDestinationHardlinkedFromIndex) { - if (isIndexModified && linkStrategy.autoRepair) { - atomicBehavior = 0 /* Lock */; - indexStat = null; - } - } - if (!isDestinationHardlinkedFromIndex) { - if (opts.overwrite) { - prelayout.push(async () => destinationFs.removePromise(destination)); - destinationStat = null; - } else { - return false; - } - } - } - const tempPath = !indexStat && atomicBehavior === 1 /* Rename */ ? `${indexPath}.${Math.floor(Math.random() * 4294967296).toString(16).padStart(8, `0`)}` : null; - let tempPathCleaned = false; - prelayout.push(async () => { - if (!indexStat) { - if (atomicBehavior === 0 /* Lock */) { - await destinationFs.lockPromise(indexPath, async () => { - const content = await sourceFs.readFilePromise(source); - await destinationFs.writeFilePromise(indexPath, content); - }); - } - if (atomicBehavior === 1 /* Rename */ && tempPath) { - const content = await sourceFs.readFilePromise(source); - await destinationFs.writeFilePromise(tempPath, content); - try { - await destinationFs.linkPromise(tempPath, indexPath); - } catch (err) { - if (err.code === `EEXIST`) { - tempPathCleaned = true; - await destinationFs.unlinkPromise(tempPath); - } else { - throw err; - } - } - } - } - if (!destinationStat) { - await destinationFs.linkPromise(indexPath, destination); - } - }); - postlayout.push(async () => { - if (!indexStat) { - await destinationFs.lutimesPromise(indexPath, defaultTime, defaultTime); - if (sourceMode !== defaultMode) { - await destinationFs.chmodPromise(indexPath, sourceMode); - } - } - if (tempPath && !tempPathCleaned) { - await destinationFs.unlinkPromise(tempPath); - } - }); - return false; -} -async function copyFileDirect(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts) { - if (destinationStat !== null) { - if (opts.overwrite) { - prelayout.push(async () => destinationFs.removePromise(destination)); - destinationStat = null; - } else { - return false; - } - } - prelayout.push(async () => { - const content = await sourceFs.readFilePromise(source); - await destinationFs.writeFilePromise(destination, content); - }); - return true; -} -async function copyFile(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts) { - if (opts.linkStrategy?.type === `HardlinkFromIndex`) { - return copyFileViaIndex(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts, opts.linkStrategy); - } else { - return copyFileDirect(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts); - } -} -async function copySymlink(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts) { - if (destinationStat !== null) { - if (opts.overwrite) { - prelayout.push(async () => destinationFs.removePromise(destination)); - destinationStat = null; - } else { - return false; - } - } - prelayout.push(async () => { - await destinationFs.symlinkPromise(convertPath(destinationFs.pathUtils, await sourceFs.readlinkPromise(source)), destination); - }); - return true; -} - -class CustomDir { - constructor(path, nextDirent, opts = {}) { - this.path = path; - this.nextDirent = nextDirent; - this.opts = opts; - this.closed = false; - } - throwIfClosed() { - if (this.closed) { - throw ERR_DIR_CLOSED(); - } - } - async *[Symbol.asyncIterator]() { - try { - let dirent; - while ((dirent = await this.read()) !== null) { - yield dirent; - } - } finally { - await this.close(); - } - } - read(cb) { - const dirent = this.readSync(); - if (typeof cb !== `undefined`) - return cb(null, dirent); - return Promise.resolve(dirent); - } - readSync() { - this.throwIfClosed(); - return this.nextDirent(); - } - close(cb) { - this.closeSync(); - if (typeof cb !== `undefined`) - return cb(null); - return Promise.resolve(); - } - closeSync() { - this.throwIfClosed(); - this.opts.onClose?.(); - this.closed = true; - } -} -function opendir(fakeFs, path, entries, opts) { - const nextDirent = () => { - const filename = entries.shift(); - if (typeof filename === `undefined`) - return null; - const entryPath = fakeFs.pathUtils.join(path, filename); - return Object.assign(fakeFs.statSync(entryPath), { - name: filename, - path: void 0 - }); - }; - return new CustomDir(path, nextDirent, opts); -} - -function assertStatus(current, expected) { - if (current !== expected) { - throw new Error(`Invalid StatWatcher status: expected '${expected}', got '${current}'`); - } -} -class CustomStatWatcher extends events.EventEmitter { - constructor(fakeFs, path, { bigint = false } = {}) { - super(); - this.status = "ready" /* Ready */; - this.changeListeners = /* @__PURE__ */ new Map(); - this.startTimeout = null; - this.fakeFs = fakeFs; - this.path = path; - this.bigint = bigint; - this.lastStats = this.stat(); - } - static create(fakeFs, path, opts) { - const statWatcher = new CustomStatWatcher(fakeFs, path, opts); - statWatcher.start(); - return statWatcher; - } - start() { - assertStatus(this.status, "ready" /* Ready */); - this.status = "running" /* Running */; - this.startTimeout = setTimeout(() => { - this.startTimeout = null; - if (!this.fakeFs.existsSync(this.path)) { - this.emit("change" /* Change */, this.lastStats, this.lastStats); - } - }, 3); - } - stop() { - assertStatus(this.status, "running" /* Running */); - this.status = "stopped" /* Stopped */; - if (this.startTimeout !== null) { - clearTimeout(this.startTimeout); - this.startTimeout = null; - } - this.emit("stop" /* Stop */); - } - stat() { - try { - return this.fakeFs.statSync(this.path, { bigint: this.bigint }); - } catch (error) { - const statInstance = this.bigint ? new BigIntStatsEntry() : new StatEntry(); - return clearStats(statInstance); - } - } - makeInterval(opts) { - const interval = setInterval(() => { - const currentStats = this.stat(); - const previousStats = this.lastStats; - if (areStatsEqual(currentStats, previousStats)) - return; - this.lastStats = currentStats; - this.emit("change" /* Change */, currentStats, previousStats); - }, opts.interval); - return opts.persistent ? interval : interval.unref(); - } - registerChangeListener(listener, opts) { - this.addListener("change" /* Change */, listener); - this.changeListeners.set(listener, this.makeInterval(opts)); - } - unregisterChangeListener(listener) { - this.removeListener("change" /* Change */, listener); - const interval = this.changeListeners.get(listener); - if (typeof interval !== `undefined`) - clearInterval(interval); - this.changeListeners.delete(listener); - } - unregisterAllChangeListeners() { - for (const listener of this.changeListeners.keys()) { - this.unregisterChangeListener(listener); - } - } - hasChangeListeners() { - return this.changeListeners.size > 0; - } - ref() { - for (const interval of this.changeListeners.values()) - interval.ref(); - return this; - } - unref() { - for (const interval of this.changeListeners.values()) - interval.unref(); - return this; - } -} - -const statWatchersByFakeFS = /* @__PURE__ */ new WeakMap(); -function watchFile(fakeFs, path, a, b) { - let bigint; - let persistent; - let interval; - let listener; - switch (typeof a) { - case `function`: - { - bigint = false; - persistent = true; - interval = 5007; - listener = a; - } - break; - default: - { - ({ - bigint = false, - persistent = true, - interval = 5007 - } = a); - listener = b; - } - break; - } - let statWatchers = statWatchersByFakeFS.get(fakeFs); - if (typeof statWatchers === `undefined`) - statWatchersByFakeFS.set(fakeFs, statWatchers = /* @__PURE__ */ new Map()); - let statWatcher = statWatchers.get(path); - if (typeof statWatcher === `undefined`) { - statWatcher = CustomStatWatcher.create(fakeFs, path, { bigint }); - statWatchers.set(path, statWatcher); - } - statWatcher.registerChangeListener(listener, { persistent, interval }); - return statWatcher; -} -function unwatchFile(fakeFs, path, cb) { - const statWatchers = statWatchersByFakeFS.get(fakeFs); - if (typeof statWatchers === `undefined`) - return; - const statWatcher = statWatchers.get(path); - if (typeof statWatcher === `undefined`) - return; - if (typeof cb === `undefined`) - statWatcher.unregisterAllChangeListeners(); - else - statWatcher.unregisterChangeListener(cb); - if (!statWatcher.hasChangeListeners()) { - statWatcher.stop(); - statWatchers.delete(path); - } -} -function unwatchAllFiles(fakeFs) { - const statWatchers = statWatchersByFakeFS.get(fakeFs); - if (typeof statWatchers === `undefined`) - return; - for (const path of statWatchers.keys()) { - unwatchFile(fakeFs, path); - } -} - -class FakeFS { - constructor(pathUtils) { - this.pathUtils = pathUtils; - } - async *genTraversePromise(init, { stableSort = false } = {}) { - const stack = [init]; - while (stack.length > 0) { - const p = stack.shift(); - const entry = await this.lstatPromise(p); - if (entry.isDirectory()) { - const entries = await this.readdirPromise(p); - if (stableSort) { - for (const entry2 of entries.sort()) { - stack.push(this.pathUtils.join(p, entry2)); - } - } else { - throw new Error(`Not supported`); - } - } else { - yield p; - } - } - } - async checksumFilePromise(path, { algorithm = `sha512` } = {}) { - const fd = await this.openPromise(path, `r`); - try { - const CHUNK_SIZE = 65536; - const chunk = Buffer.allocUnsafeSlow(CHUNK_SIZE); - const hash = crypto.createHash(algorithm); - let bytesRead = 0; - while ((bytesRead = await this.readPromise(fd, chunk, 0, CHUNK_SIZE)) !== 0) - hash.update(bytesRead === CHUNK_SIZE ? chunk : chunk.slice(0, bytesRead)); - return hash.digest(`hex`); - } finally { - await this.closePromise(fd); - } - } - async removePromise(p, { recursive = true, maxRetries = 5 } = {}) { - let stat; - try { - stat = await this.lstatPromise(p); - } catch (error) { - if (error.code === `ENOENT`) { - return; - } else { - throw error; - } - } - if (stat.isDirectory()) { - if (recursive) { - const entries = await this.readdirPromise(p); - await Promise.all(entries.map((entry) => { - return this.removePromise(this.pathUtils.resolve(p, entry)); - })); - } - for (let t = 0; t <= maxRetries; t++) { - try { - await this.rmdirPromise(p); - break; - } catch (error) { - if (error.code !== `EBUSY` && error.code !== `ENOTEMPTY`) { - throw error; - } else if (t < maxRetries) { - await new Promise((resolve) => setTimeout(resolve, t * 100)); - } - } - } - } else { - await this.unlinkPromise(p); - } - } - removeSync(p, { recursive = true } = {}) { - let stat; - try { - stat = this.lstatSync(p); - } catch (error) { - if (error.code === `ENOENT`) { - return; - } else { - throw error; - } - } - if (stat.isDirectory()) { - if (recursive) - for (const entry of this.readdirSync(p)) - this.removeSync(this.pathUtils.resolve(p, entry)); - this.rmdirSync(p); - } else { - this.unlinkSync(p); - } - } - async mkdirpPromise(p, { chmod, utimes } = {}) { - p = this.resolve(p); - if (p === this.pathUtils.dirname(p)) - return void 0; - const parts = p.split(this.pathUtils.sep); - let createdDirectory; - for (let u = 2; u <= parts.length; ++u) { - const subPath = parts.slice(0, u).join(this.pathUtils.sep); - if (!this.existsSync(subPath)) { - try { - await this.mkdirPromise(subPath); - } catch (error) { - if (error.code === `EEXIST`) { - continue; - } else { - throw error; - } - } - createdDirectory ??= subPath; - if (chmod != null) - await this.chmodPromise(subPath, chmod); - if (utimes != null) { - await this.utimesPromise(subPath, utimes[0], utimes[1]); - } else { - const parentStat = await this.statPromise(this.pathUtils.dirname(subPath)); - await this.utimesPromise(subPath, parentStat.atime, parentStat.mtime); - } - } - } - return createdDirectory; - } - mkdirpSync(p, { chmod, utimes } = {}) { - p = this.resolve(p); - if (p === this.pathUtils.dirname(p)) - return void 0; - const parts = p.split(this.pathUtils.sep); - let createdDirectory; - for (let u = 2; u <= parts.length; ++u) { - const subPath = parts.slice(0, u).join(this.pathUtils.sep); - if (!this.existsSync(subPath)) { - try { - this.mkdirSync(subPath); - } catch (error) { - if (error.code === `EEXIST`) { - continue; - } else { - throw error; - } - } - createdDirectory ??= subPath; - if (chmod != null) - this.chmodSync(subPath, chmod); - if (utimes != null) { - this.utimesSync(subPath, utimes[0], utimes[1]); - } else { - const parentStat = this.statSync(this.pathUtils.dirname(subPath)); - this.utimesSync(subPath, parentStat.atime, parentStat.mtime); - } - } - } - return createdDirectory; - } - async copyPromise(destination, source, { baseFs = this, overwrite = true, stableSort = false, stableTime = false, linkStrategy = null } = {}) { - return await copyPromise(this, destination, baseFs, source, { overwrite, stableSort, stableTime, linkStrategy }); - } - copySync(destination, source, { baseFs = this, overwrite = true } = {}) { - const stat = baseFs.lstatSync(source); - const exists = this.existsSync(destination); - if (stat.isDirectory()) { - this.mkdirpSync(destination); - const directoryListing = baseFs.readdirSync(source); - for (const entry of directoryListing) { - this.copySync(this.pathUtils.join(destination, entry), baseFs.pathUtils.join(source, entry), { baseFs, overwrite }); - } - } else if (stat.isFile()) { - if (!exists || overwrite) { - if (exists) - this.removeSync(destination); - const content = baseFs.readFileSync(source); - this.writeFileSync(destination, content); - } - } else if (stat.isSymbolicLink()) { - if (!exists || overwrite) { - if (exists) - this.removeSync(destination); - const target = baseFs.readlinkSync(source); - this.symlinkSync(convertPath(this.pathUtils, target), destination); - } - } else { - throw new Error(`Unsupported file type (file: ${source}, mode: 0o${stat.mode.toString(8).padStart(6, `0`)})`); - } - const mode = stat.mode & 511; - this.chmodSync(destination, mode); - } - async changeFilePromise(p, content, opts = {}) { - if (Buffer.isBuffer(content)) { - return this.changeFileBufferPromise(p, content, opts); - } else { - return this.changeFileTextPromise(p, content, opts); - } - } - async changeFileBufferPromise(p, content, { mode } = {}) { - let current = Buffer.alloc(0); - try { - current = await this.readFilePromise(p); - } catch (error) { - } - if (Buffer.compare(current, content) === 0) - return; - await this.writeFilePromise(p, content, { mode }); - } - async changeFileTextPromise(p, content, { automaticNewlines, mode } = {}) { - let current = ``; - try { - current = await this.readFilePromise(p, `utf8`); - } catch (error) { - } - const normalizedContent = automaticNewlines ? normalizeLineEndings(current, content) : content; - if (current === normalizedContent) - return; - await this.writeFilePromise(p, normalizedContent, { mode }); - } - changeFileSync(p, content, opts = {}) { - if (Buffer.isBuffer(content)) { - return this.changeFileBufferSync(p, content, opts); - } else { - return this.changeFileTextSync(p, content, opts); - } - } - changeFileBufferSync(p, content, { mode } = {}) { - let current = Buffer.alloc(0); - try { - current = this.readFileSync(p); - } catch (error) { - } - if (Buffer.compare(current, content) === 0) - return; - this.writeFileSync(p, content, { mode }); - } - changeFileTextSync(p, content, { automaticNewlines = false, mode } = {}) { - let current = ``; - try { - current = this.readFileSync(p, `utf8`); - } catch (error) { - } - const normalizedContent = automaticNewlines ? normalizeLineEndings(current, content) : content; - if (current === normalizedContent) - return; - this.writeFileSync(p, normalizedContent, { mode }); - } - async movePromise(fromP, toP) { - try { - await this.renamePromise(fromP, toP); - } catch (error) { - if (error.code === `EXDEV`) { - await this.copyPromise(toP, fromP); - await this.removePromise(fromP); - } else { - throw error; - } - } - } - moveSync(fromP, toP) { - try { - this.renameSync(fromP, toP); - } catch (error) { - if (error.code === `EXDEV`) { - this.copySync(toP, fromP); - this.removeSync(fromP); - } else { - throw error; - } - } - } - async lockPromise(affectedPath, callback) { - const lockPath = `${affectedPath}.flock`; - const interval = 1e3 / 60; - const startTime = Date.now(); - let fd = null; - const isAlive = async () => { - let pid; - try { - [pid] = await this.readJsonPromise(lockPath); - } catch (error) { - return Date.now() - startTime < 500; - } - try { - process.kill(pid, 0); - return true; - } catch (error) { - return false; - } - }; - while (fd === null) { - try { - fd = await this.openPromise(lockPath, `wx`); - } catch (error) { - if (error.code === `EEXIST`) { - if (!await isAlive()) { - try { - await this.unlinkPromise(lockPath); - continue; - } catch (error2) { - } - } - if (Date.now() - startTime < 60 * 1e3) { - await new Promise((resolve) => setTimeout(resolve, interval)); - } else { - throw new Error(`Couldn't acquire a lock in a reasonable time (via ${lockPath})`); - } - } else { - throw error; - } - } - } - await this.writePromise(fd, JSON.stringify([process.pid])); - try { - return await callback(); - } finally { - try { - await this.closePromise(fd); - await this.unlinkPromise(lockPath); - } catch (error) { - } - } - } - async readJsonPromise(p) { - const content = await this.readFilePromise(p, `utf8`); - try { - return JSON.parse(content); - } catch (error) { - error.message += ` (in ${p})`; - throw error; - } - } - readJsonSync(p) { - const content = this.readFileSync(p, `utf8`); - try { - return JSON.parse(content); - } catch (error) { - error.message += ` (in ${p})`; - throw error; - } - } - async writeJsonPromise(p, data, { compact = false } = {}) { - const space = compact ? 0 : 2; - return await this.writeFilePromise(p, `${JSON.stringify(data, null, space)} -`); - } - writeJsonSync(p, data, { compact = false } = {}) { - const space = compact ? 0 : 2; - return this.writeFileSync(p, `${JSON.stringify(data, null, space)} -`); - } - async preserveTimePromise(p, cb) { - const stat = await this.lstatPromise(p); - const result = await cb(); - if (typeof result !== `undefined`) - p = result; - await this.lutimesPromise(p, stat.atime, stat.mtime); - } - async preserveTimeSync(p, cb) { - const stat = this.lstatSync(p); - const result = cb(); - if (typeof result !== `undefined`) - p = result; - this.lutimesSync(p, stat.atime, stat.mtime); - } -} -class BasePortableFakeFS extends FakeFS { - constructor() { - super(ppath); - } -} -function getEndOfLine(content) { - const matches = content.match(/\r?\n/g); - if (matches === null) - return os.EOL; - const crlf = matches.filter((nl) => nl === `\r -`).length; - const lf = matches.length - crlf; - return crlf > lf ? `\r -` : ` -`; -} -function normalizeLineEndings(originalContent, newContent) { - return newContent.replace(/\r?\n/g, getEndOfLine(originalContent)); -} - -class ProxiedFS extends FakeFS { - getExtractHint(hints) { - return this.baseFs.getExtractHint(hints); - } - resolve(path) { - return this.mapFromBase(this.baseFs.resolve(this.mapToBase(path))); - } - getRealPath() { - return this.mapFromBase(this.baseFs.getRealPath()); - } - async openPromise(p, flags, mode) { - return this.baseFs.openPromise(this.mapToBase(p), flags, mode); - } - openSync(p, flags, mode) { - return this.baseFs.openSync(this.mapToBase(p), flags, mode); - } - async opendirPromise(p, opts) { - return Object.assign(await this.baseFs.opendirPromise(this.mapToBase(p), opts), { path: p }); - } - opendirSync(p, opts) { - return Object.assign(this.baseFs.opendirSync(this.mapToBase(p), opts), { path: p }); - } - async readPromise(fd, buffer, offset, length, position) { - return await this.baseFs.readPromise(fd, buffer, offset, length, position); - } - readSync(fd, buffer, offset, length, position) { - return this.baseFs.readSync(fd, buffer, offset, length, position); - } - async writePromise(fd, buffer, offset, length, position) { - if (typeof buffer === `string`) { - return await this.baseFs.writePromise(fd, buffer, offset); - } else { - return await this.baseFs.writePromise(fd, buffer, offset, length, position); - } - } - writeSync(fd, buffer, offset, length, position) { - if (typeof buffer === `string`) { - return this.baseFs.writeSync(fd, buffer, offset); - } else { - return this.baseFs.writeSync(fd, buffer, offset, length, position); - } - } - async closePromise(fd) { - return this.baseFs.closePromise(fd); - } - closeSync(fd) { - this.baseFs.closeSync(fd); - } - createReadStream(p, opts) { - return this.baseFs.createReadStream(p !== null ? this.mapToBase(p) : p, opts); - } - createWriteStream(p, opts) { - return this.baseFs.createWriteStream(p !== null ? this.mapToBase(p) : p, opts); - } - async realpathPromise(p) { - return this.mapFromBase(await this.baseFs.realpathPromise(this.mapToBase(p))); - } - realpathSync(p) { - return this.mapFromBase(this.baseFs.realpathSync(this.mapToBase(p))); - } - async existsPromise(p) { - return this.baseFs.existsPromise(this.mapToBase(p)); - } - existsSync(p) { - return this.baseFs.existsSync(this.mapToBase(p)); - } - accessSync(p, mode) { - return this.baseFs.accessSync(this.mapToBase(p), mode); - } - async accessPromise(p, mode) { - return this.baseFs.accessPromise(this.mapToBase(p), mode); - } - async statPromise(p, opts) { - return this.baseFs.statPromise(this.mapToBase(p), opts); - } - statSync(p, opts) { - return this.baseFs.statSync(this.mapToBase(p), opts); - } - async fstatPromise(fd, opts) { - return this.baseFs.fstatPromise(fd, opts); - } - fstatSync(fd, opts) { - return this.baseFs.fstatSync(fd, opts); - } - lstatPromise(p, opts) { - return this.baseFs.lstatPromise(this.mapToBase(p), opts); - } - lstatSync(p, opts) { - return this.baseFs.lstatSync(this.mapToBase(p), opts); - } - async fchmodPromise(fd, mask) { - return this.baseFs.fchmodPromise(fd, mask); - } - fchmodSync(fd, mask) { - return this.baseFs.fchmodSync(fd, mask); - } - async chmodPromise(p, mask) { - return this.baseFs.chmodPromise(this.mapToBase(p), mask); - } - chmodSync(p, mask) { - return this.baseFs.chmodSync(this.mapToBase(p), mask); - } - async fchownPromise(fd, uid, gid) { - return this.baseFs.fchownPromise(fd, uid, gid); - } - fchownSync(fd, uid, gid) { - return this.baseFs.fchownSync(fd, uid, gid); - } - async chownPromise(p, uid, gid) { - return this.baseFs.chownPromise(this.mapToBase(p), uid, gid); - } - chownSync(p, uid, gid) { - return this.baseFs.chownSync(this.mapToBase(p), uid, gid); - } - async renamePromise(oldP, newP) { - return this.baseFs.renamePromise(this.mapToBase(oldP), this.mapToBase(newP)); - } - renameSync(oldP, newP) { - return this.baseFs.renameSync(this.mapToBase(oldP), this.mapToBase(newP)); - } - async copyFilePromise(sourceP, destP, flags = 0) { - return this.baseFs.copyFilePromise(this.mapToBase(sourceP), this.mapToBase(destP), flags); - } - copyFileSync(sourceP, destP, flags = 0) { - return this.baseFs.copyFileSync(this.mapToBase(sourceP), this.mapToBase(destP), flags); - } - async appendFilePromise(p, content, opts) { - return this.baseFs.appendFilePromise(this.fsMapToBase(p), content, opts); - } - appendFileSync(p, content, opts) { - return this.baseFs.appendFileSync(this.fsMapToBase(p), content, opts); - } - async writeFilePromise(p, content, opts) { - return this.baseFs.writeFilePromise(this.fsMapToBase(p), content, opts); - } - writeFileSync(p, content, opts) { - return this.baseFs.writeFileSync(this.fsMapToBase(p), content, opts); - } - async unlinkPromise(p) { - return this.baseFs.unlinkPromise(this.mapToBase(p)); - } - unlinkSync(p) { - return this.baseFs.unlinkSync(this.mapToBase(p)); - } - async utimesPromise(p, atime, mtime) { - return this.baseFs.utimesPromise(this.mapToBase(p), atime, mtime); - } - utimesSync(p, atime, mtime) { - return this.baseFs.utimesSync(this.mapToBase(p), atime, mtime); - } - async lutimesPromise(p, atime, mtime) { - return this.baseFs.lutimesPromise(this.mapToBase(p), atime, mtime); - } - lutimesSync(p, atime, mtime) { - return this.baseFs.lutimesSync(this.mapToBase(p), atime, mtime); - } - async mkdirPromise(p, opts) { - return this.baseFs.mkdirPromise(this.mapToBase(p), opts); - } - mkdirSync(p, opts) { - return this.baseFs.mkdirSync(this.mapToBase(p), opts); - } - async rmdirPromise(p, opts) { - return this.baseFs.rmdirPromise(this.mapToBase(p), opts); - } - rmdirSync(p, opts) { - return this.baseFs.rmdirSync(this.mapToBase(p), opts); - } - async rmPromise(p, opts) { - return this.baseFs.rmPromise(this.mapToBase(p), opts); - } - rmSync(p, opts) { - return this.baseFs.rmSync(this.mapToBase(p), opts); - } - async linkPromise(existingP, newP) { - return this.baseFs.linkPromise(this.mapToBase(existingP), this.mapToBase(newP)); - } - linkSync(existingP, newP) { - return this.baseFs.linkSync(this.mapToBase(existingP), this.mapToBase(newP)); - } - async symlinkPromise(target, p, type) { - const mappedP = this.mapToBase(p); - if (this.pathUtils.isAbsolute(target)) - return this.baseFs.symlinkPromise(this.mapToBase(target), mappedP, type); - const mappedAbsoluteTarget = this.mapToBase(this.pathUtils.join(this.pathUtils.dirname(p), target)); - const mappedTarget = this.baseFs.pathUtils.relative(this.baseFs.pathUtils.dirname(mappedP), mappedAbsoluteTarget); - return this.baseFs.symlinkPromise(mappedTarget, mappedP, type); - } - symlinkSync(target, p, type) { - const mappedP = this.mapToBase(p); - if (this.pathUtils.isAbsolute(target)) - return this.baseFs.symlinkSync(this.mapToBase(target), mappedP, type); - const mappedAbsoluteTarget = this.mapToBase(this.pathUtils.join(this.pathUtils.dirname(p), target)); - const mappedTarget = this.baseFs.pathUtils.relative(this.baseFs.pathUtils.dirname(mappedP), mappedAbsoluteTarget); - return this.baseFs.symlinkSync(mappedTarget, mappedP, type); - } - async readFilePromise(p, encoding) { - return this.baseFs.readFilePromise(this.fsMapToBase(p), encoding); - } - readFileSync(p, encoding) { - return this.baseFs.readFileSync(this.fsMapToBase(p), encoding); - } - readdirPromise(p, opts) { - return this.baseFs.readdirPromise(this.mapToBase(p), opts); - } - readdirSync(p, opts) { - return this.baseFs.readdirSync(this.mapToBase(p), opts); - } - async readlinkPromise(p) { - return this.mapFromBase(await this.baseFs.readlinkPromise(this.mapToBase(p))); - } - readlinkSync(p) { - return this.mapFromBase(this.baseFs.readlinkSync(this.mapToBase(p))); - } - async truncatePromise(p, len) { - return this.baseFs.truncatePromise(this.mapToBase(p), len); - } - truncateSync(p, len) { - return this.baseFs.truncateSync(this.mapToBase(p), len); - } - async ftruncatePromise(fd, len) { - return this.baseFs.ftruncatePromise(fd, len); - } - ftruncateSync(fd, len) { - return this.baseFs.ftruncateSync(fd, len); - } - watch(p, a, b) { - return this.baseFs.watch( - this.mapToBase(p), - a, - b - ); - } - watchFile(p, a, b) { - return this.baseFs.watchFile( - this.mapToBase(p), - a, - b - ); - } - unwatchFile(p, cb) { - return this.baseFs.unwatchFile(this.mapToBase(p), cb); - } - fsMapToBase(p) { - if (typeof p === `number`) { - return p; - } else { - return this.mapToBase(p); - } - } -} - -function direntToPortable(dirent) { - const portableDirent = dirent; - if (typeof dirent.path === `string`) - portableDirent.path = npath.toPortablePath(dirent.path); - return portableDirent; -} -class NodeFS extends BasePortableFakeFS { - constructor(realFs = fs__default.default) { - super(); - this.realFs = realFs; - } - getExtractHint() { - return false; - } - getRealPath() { - return PortablePath.root; - } - resolve(p) { - return ppath.resolve(p); - } - async openPromise(p, flags, mode) { - return await new Promise((resolve, reject) => { - this.realFs.open(npath.fromPortablePath(p), flags, mode, this.makeCallback(resolve, reject)); - }); - } - openSync(p, flags, mode) { - return this.realFs.openSync(npath.fromPortablePath(p), flags, mode); - } - async opendirPromise(p, opts) { - return await new Promise((resolve, reject) => { - if (typeof opts !== `undefined`) { - this.realFs.opendir(npath.fromPortablePath(p), opts, this.makeCallback(resolve, reject)); - } else { - this.realFs.opendir(npath.fromPortablePath(p), this.makeCallback(resolve, reject)); - } - }).then((dir) => { - const dirWithFixedPath = dir; - Object.defineProperty(dirWithFixedPath, `path`, { - value: p, - configurable: true, - writable: true - }); - return dirWithFixedPath; - }); - } - opendirSync(p, opts) { - const dir = typeof opts !== `undefined` ? this.realFs.opendirSync(npath.fromPortablePath(p), opts) : this.realFs.opendirSync(npath.fromPortablePath(p)); - const dirWithFixedPath = dir; - Object.defineProperty(dirWithFixedPath, `path`, { - value: p, - configurable: true, - writable: true - }); - return dirWithFixedPath; - } - async readPromise(fd, buffer, offset = 0, length = 0, position = -1) { - return await new Promise((resolve, reject) => { - this.realFs.read(fd, buffer, offset, length, position, (error, bytesRead) => { - if (error) { - reject(error); - } else { - resolve(bytesRead); - } - }); - }); - } - readSync(fd, buffer, offset, length, position) { - return this.realFs.readSync(fd, buffer, offset, length, position); - } - async writePromise(fd, buffer, offset, length, position) { - return await new Promise((resolve, reject) => { - if (typeof buffer === `string`) { - return this.realFs.write(fd, buffer, offset, this.makeCallback(resolve, reject)); - } else { - return this.realFs.write(fd, buffer, offset, length, position, this.makeCallback(resolve, reject)); - } - }); - } - writeSync(fd, buffer, offset, length, position) { - if (typeof buffer === `string`) { - return this.realFs.writeSync(fd, buffer, offset); - } else { - return this.realFs.writeSync(fd, buffer, offset, length, position); - } - } - async closePromise(fd) { - await new Promise((resolve, reject) => { - this.realFs.close(fd, this.makeCallback(resolve, reject)); - }); - } - closeSync(fd) { - this.realFs.closeSync(fd); - } - createReadStream(p, opts) { - const realPath = p !== null ? npath.fromPortablePath(p) : p; - return this.realFs.createReadStream(realPath, opts); - } - createWriteStream(p, opts) { - const realPath = p !== null ? npath.fromPortablePath(p) : p; - return this.realFs.createWriteStream(realPath, opts); - } - async realpathPromise(p) { - return await new Promise((resolve, reject) => { - this.realFs.realpath(npath.fromPortablePath(p), {}, this.makeCallback(resolve, reject)); - }).then((path) => { - return npath.toPortablePath(path); - }); - } - realpathSync(p) { - return npath.toPortablePath(this.realFs.realpathSync(npath.fromPortablePath(p), {})); - } - async existsPromise(p) { - return await new Promise((resolve) => { - this.realFs.exists(npath.fromPortablePath(p), resolve); - }); - } - accessSync(p, mode) { - return this.realFs.accessSync(npath.fromPortablePath(p), mode); - } - async accessPromise(p, mode) { - return await new Promise((resolve, reject) => { - this.realFs.access(npath.fromPortablePath(p), mode, this.makeCallback(resolve, reject)); - }); - } - existsSync(p) { - return this.realFs.existsSync(npath.fromPortablePath(p)); - } - async statPromise(p, opts) { - return await new Promise((resolve, reject) => { - if (opts) { - this.realFs.stat(npath.fromPortablePath(p), opts, this.makeCallback(resolve, reject)); - } else { - this.realFs.stat(npath.fromPortablePath(p), this.makeCallback(resolve, reject)); - } - }); - } - statSync(p, opts) { - if (opts) { - return this.realFs.statSync(npath.fromPortablePath(p), opts); - } else { - return this.realFs.statSync(npath.fromPortablePath(p)); - } - } - async fstatPromise(fd, opts) { - return await new Promise((resolve, reject) => { - if (opts) { - this.realFs.fstat(fd, opts, this.makeCallback(resolve, reject)); - } else { - this.realFs.fstat(fd, this.makeCallback(resolve, reject)); - } - }); - } - fstatSync(fd, opts) { - if (opts) { - return this.realFs.fstatSync(fd, opts); - } else { - return this.realFs.fstatSync(fd); - } - } - async lstatPromise(p, opts) { - return await new Promise((resolve, reject) => { - if (opts) { - this.realFs.lstat(npath.fromPortablePath(p), opts, this.makeCallback(resolve, reject)); - } else { - this.realFs.lstat(npath.fromPortablePath(p), this.makeCallback(resolve, reject)); - } - }); - } - lstatSync(p, opts) { - if (opts) { - return this.realFs.lstatSync(npath.fromPortablePath(p), opts); - } else { - return this.realFs.lstatSync(npath.fromPortablePath(p)); - } - } - async fchmodPromise(fd, mask) { - return await new Promise((resolve, reject) => { - this.realFs.fchmod(fd, mask, this.makeCallback(resolve, reject)); - }); - } - fchmodSync(fd, mask) { - return this.realFs.fchmodSync(fd, mask); - } - async chmodPromise(p, mask) { - return await new Promise((resolve, reject) => { - this.realFs.chmod(npath.fromPortablePath(p), mask, this.makeCallback(resolve, reject)); - }); - } - chmodSync(p, mask) { - return this.realFs.chmodSync(npath.fromPortablePath(p), mask); - } - async fchownPromise(fd, uid, gid) { - return await new Promise((resolve, reject) => { - this.realFs.fchown(fd, uid, gid, this.makeCallback(resolve, reject)); - }); - } - fchownSync(fd, uid, gid) { - return this.realFs.fchownSync(fd, uid, gid); - } - async chownPromise(p, uid, gid) { - return await new Promise((resolve, reject) => { - this.realFs.chown(npath.fromPortablePath(p), uid, gid, this.makeCallback(resolve, reject)); - }); - } - chownSync(p, uid, gid) { - return this.realFs.chownSync(npath.fromPortablePath(p), uid, gid); - } - async renamePromise(oldP, newP) { - return await new Promise((resolve, reject) => { - this.realFs.rename(npath.fromPortablePath(oldP), npath.fromPortablePath(newP), this.makeCallback(resolve, reject)); - }); - } - renameSync(oldP, newP) { - return this.realFs.renameSync(npath.fromPortablePath(oldP), npath.fromPortablePath(newP)); - } - async copyFilePromise(sourceP, destP, flags = 0) { - return await new Promise((resolve, reject) => { - this.realFs.copyFile(npath.fromPortablePath(sourceP), npath.fromPortablePath(destP), flags, this.makeCallback(resolve, reject)); - }); - } - copyFileSync(sourceP, destP, flags = 0) { - return this.realFs.copyFileSync(npath.fromPortablePath(sourceP), npath.fromPortablePath(destP), flags); - } - async appendFilePromise(p, content, opts) { - return await new Promise((resolve, reject) => { - const fsNativePath = typeof p === `string` ? npath.fromPortablePath(p) : p; - if (opts) { - this.realFs.appendFile(fsNativePath, content, opts, this.makeCallback(resolve, reject)); - } else { - this.realFs.appendFile(fsNativePath, content, this.makeCallback(resolve, reject)); - } - }); - } - appendFileSync(p, content, opts) { - const fsNativePath = typeof p === `string` ? npath.fromPortablePath(p) : p; - if (opts) { - this.realFs.appendFileSync(fsNativePath, content, opts); - } else { - this.realFs.appendFileSync(fsNativePath, content); - } - } - async writeFilePromise(p, content, opts) { - return await new Promise((resolve, reject) => { - const fsNativePath = typeof p === `string` ? npath.fromPortablePath(p) : p; - if (opts) { - this.realFs.writeFile(fsNativePath, content, opts, this.makeCallback(resolve, reject)); - } else { - this.realFs.writeFile(fsNativePath, content, this.makeCallback(resolve, reject)); - } - }); - } - writeFileSync(p, content, opts) { - const fsNativePath = typeof p === `string` ? npath.fromPortablePath(p) : p; - if (opts) { - this.realFs.writeFileSync(fsNativePath, content, opts); - } else { - this.realFs.writeFileSync(fsNativePath, content); - } - } - async unlinkPromise(p) { - return await new Promise((resolve, reject) => { - this.realFs.unlink(npath.fromPortablePath(p), this.makeCallback(resolve, reject)); - }); - } - unlinkSync(p) { - return this.realFs.unlinkSync(npath.fromPortablePath(p)); - } - async utimesPromise(p, atime, mtime) { - return await new Promise((resolve, reject) => { - this.realFs.utimes(npath.fromPortablePath(p), atime, mtime, this.makeCallback(resolve, reject)); - }); - } - utimesSync(p, atime, mtime) { - this.realFs.utimesSync(npath.fromPortablePath(p), atime, mtime); - } - async lutimesPromise(p, atime, mtime) { - return await new Promise((resolve, reject) => { - this.realFs.lutimes(npath.fromPortablePath(p), atime, mtime, this.makeCallback(resolve, reject)); - }); - } - lutimesSync(p, atime, mtime) { - this.realFs.lutimesSync(npath.fromPortablePath(p), atime, mtime); - } - async mkdirPromise(p, opts) { - return await new Promise((resolve, reject) => { - this.realFs.mkdir(npath.fromPortablePath(p), opts, this.makeCallback(resolve, reject)); - }); - } - mkdirSync(p, opts) { - return this.realFs.mkdirSync(npath.fromPortablePath(p), opts); - } - async rmdirPromise(p, opts) { - return await new Promise((resolve, reject) => { - if (opts) { - this.realFs.rmdir(npath.fromPortablePath(p), opts, this.makeCallback(resolve, reject)); - } else { - this.realFs.rmdir(npath.fromPortablePath(p), this.makeCallback(resolve, reject)); - } - }); - } - rmdirSync(p, opts) { - return this.realFs.rmdirSync(npath.fromPortablePath(p), opts); - } - async rmPromise(p, opts) { - return await new Promise((resolve, reject) => { - if (opts) { - this.realFs.rm(npath.fromPortablePath(p), opts, this.makeCallback(resolve, reject)); - } else { - this.realFs.rm(npath.fromPortablePath(p), this.makeCallback(resolve, reject)); - } - }); - } - rmSync(p, opts) { - return this.realFs.rmSync(npath.fromPortablePath(p), opts); - } - async linkPromise(existingP, newP) { - return await new Promise((resolve, reject) => { - this.realFs.link(npath.fromPortablePath(existingP), npath.fromPortablePath(newP), this.makeCallback(resolve, reject)); - }); - } - linkSync(existingP, newP) { - return this.realFs.linkSync(npath.fromPortablePath(existingP), npath.fromPortablePath(newP)); - } - async symlinkPromise(target, p, type) { - return await new Promise((resolve, reject) => { - this.realFs.symlink(npath.fromPortablePath(target.replace(/\/+$/, ``)), npath.fromPortablePath(p), type, this.makeCallback(resolve, reject)); - }); - } - symlinkSync(target, p, type) { - return this.realFs.symlinkSync(npath.fromPortablePath(target.replace(/\/+$/, ``)), npath.fromPortablePath(p), type); - } - async readFilePromise(p, encoding) { - return await new Promise((resolve, reject) => { - const fsNativePath = typeof p === `string` ? npath.fromPortablePath(p) : p; - this.realFs.readFile(fsNativePath, encoding, this.makeCallback(resolve, reject)); - }); - } - readFileSync(p, encoding) { - const fsNativePath = typeof p === `string` ? npath.fromPortablePath(p) : p; - return this.realFs.readFileSync(fsNativePath, encoding); - } - async readdirPromise(p, opts) { - return await new Promise((resolve, reject) => { - if (opts) { - if (opts.recursive && process.platform === `win32`) { - if (opts.withFileTypes) { - this.realFs.readdir(npath.fromPortablePath(p), opts, this.makeCallback((results) => resolve(results.map(direntToPortable)), reject)); - } else { - this.realFs.readdir(npath.fromPortablePath(p), opts, this.makeCallback((results) => resolve(results.map(npath.toPortablePath)), reject)); - } - } else { - this.realFs.readdir(npath.fromPortablePath(p), opts, this.makeCallback(resolve, reject)); - } - } else { - this.realFs.readdir(npath.fromPortablePath(p), this.makeCallback(resolve, reject)); - } - }); - } - readdirSync(p, opts) { - if (opts) { - if (opts.recursive && process.platform === `win32`) { - if (opts.withFileTypes) { - return this.realFs.readdirSync(npath.fromPortablePath(p), opts).map(direntToPortable); - } else { - return this.realFs.readdirSync(npath.fromPortablePath(p), opts).map(npath.toPortablePath); - } - } else { - return this.realFs.readdirSync(npath.fromPortablePath(p), opts); - } - } else { - return this.realFs.readdirSync(npath.fromPortablePath(p)); - } - } - async readlinkPromise(p) { - return await new Promise((resolve, reject) => { - this.realFs.readlink(npath.fromPortablePath(p), this.makeCallback(resolve, reject)); - }).then((path) => { - return npath.toPortablePath(path); - }); - } - readlinkSync(p) { - return npath.toPortablePath(this.realFs.readlinkSync(npath.fromPortablePath(p))); - } - async truncatePromise(p, len) { - return await new Promise((resolve, reject) => { - this.realFs.truncate(npath.fromPortablePath(p), len, this.makeCallback(resolve, reject)); - }); - } - truncateSync(p, len) { - return this.realFs.truncateSync(npath.fromPortablePath(p), len); - } - async ftruncatePromise(fd, len) { - return await new Promise((resolve, reject) => { - this.realFs.ftruncate(fd, len, this.makeCallback(resolve, reject)); - }); - } - ftruncateSync(fd, len) { - return this.realFs.ftruncateSync(fd, len); - } - watch(p, a, b) { - return this.realFs.watch( - npath.fromPortablePath(p), - a, - b - ); - } - watchFile(p, a, b) { - return this.realFs.watchFile( - npath.fromPortablePath(p), - a, - b - ); - } - unwatchFile(p, cb) { - return this.realFs.unwatchFile(npath.fromPortablePath(p), cb); - } - makeCallback(resolve, reject) { - return (err, result) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }; - } -} - -const MOUNT_MASK = 4278190080; -class MountFS extends BasePortableFakeFS { - constructor({ baseFs = new NodeFS(), filter = null, magicByte = 42, maxOpenFiles = Infinity, useCache = true, maxAge = 5e3, typeCheck = fs.constants.S_IFREG, getMountPoint, factoryPromise, factorySync }) { - if (Math.floor(magicByte) !== magicByte || !(magicByte > 1 && magicByte <= 127)) - throw new Error(`The magic byte must be set to a round value between 1 and 127 included`); - super(); - this.fdMap = /* @__PURE__ */ new Map(); - this.nextFd = 3; - this.isMount = /* @__PURE__ */ new Set(); - this.notMount = /* @__PURE__ */ new Set(); - this.realPaths = /* @__PURE__ */ new Map(); - this.limitOpenFilesTimeout = null; - this.baseFs = baseFs; - this.mountInstances = useCache ? /* @__PURE__ */ new Map() : null; - this.factoryPromise = factoryPromise; - this.factorySync = factorySync; - this.filter = filter; - this.getMountPoint = getMountPoint; - this.magic = magicByte << 24; - this.maxAge = maxAge; - this.maxOpenFiles = maxOpenFiles; - this.typeCheck = typeCheck; - } - getExtractHint(hints) { - return this.baseFs.getExtractHint(hints); - } - getRealPath() { - return this.baseFs.getRealPath(); - } - saveAndClose() { - unwatchAllFiles(this); - if (this.mountInstances) { - for (const [path, { childFs }] of this.mountInstances.entries()) { - childFs.saveAndClose?.(); - this.mountInstances.delete(path); - } - } - } - discardAndClose() { - unwatchAllFiles(this); - if (this.mountInstances) { - for (const [path, { childFs }] of this.mountInstances.entries()) { - childFs.discardAndClose?.(); - this.mountInstances.delete(path); - } - } - } - resolve(p) { - return this.baseFs.resolve(p); - } - remapFd(mountFs, fd) { - const remappedFd = this.nextFd++ | this.magic; - this.fdMap.set(remappedFd, [mountFs, fd]); - return remappedFd; - } - async openPromise(p, flags, mode) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.openPromise(p, flags, mode); - }, async (mountFs, { subPath }) => { - return this.remapFd(mountFs, await mountFs.openPromise(subPath, flags, mode)); - }); - } - openSync(p, flags, mode) { - return this.makeCallSync(p, () => { - return this.baseFs.openSync(p, flags, mode); - }, (mountFs, { subPath }) => { - return this.remapFd(mountFs, mountFs.openSync(subPath, flags, mode)); - }); - } - async opendirPromise(p, opts) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.opendirPromise(p, opts); - }, async (mountFs, { subPath }) => { - return await mountFs.opendirPromise(subPath, opts); - }, { - requireSubpath: false - }); - } - opendirSync(p, opts) { - return this.makeCallSync(p, () => { - return this.baseFs.opendirSync(p, opts); - }, (mountFs, { subPath }) => { - return mountFs.opendirSync(subPath, opts); - }, { - requireSubpath: false - }); - } - async readPromise(fd, buffer, offset, length, position) { - if ((fd & MOUNT_MASK) !== this.magic) - return await this.baseFs.readPromise(fd, buffer, offset, length, position); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`read`); - const [mountFs, realFd] = entry; - return await mountFs.readPromise(realFd, buffer, offset, length, position); - } - readSync(fd, buffer, offset, length, position) { - if ((fd & MOUNT_MASK) !== this.magic) - return this.baseFs.readSync(fd, buffer, offset, length, position); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`readSync`); - const [mountFs, realFd] = entry; - return mountFs.readSync(realFd, buffer, offset, length, position); - } - async writePromise(fd, buffer, offset, length, position) { - if ((fd & MOUNT_MASK) !== this.magic) { - if (typeof buffer === `string`) { - return await this.baseFs.writePromise(fd, buffer, offset); - } else { - return await this.baseFs.writePromise(fd, buffer, offset, length, position); - } - } - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`write`); - const [mountFs, realFd] = entry; - if (typeof buffer === `string`) { - return await mountFs.writePromise(realFd, buffer, offset); - } else { - return await mountFs.writePromise(realFd, buffer, offset, length, position); - } - } - writeSync(fd, buffer, offset, length, position) { - if ((fd & MOUNT_MASK) !== this.magic) { - if (typeof buffer === `string`) { - return this.baseFs.writeSync(fd, buffer, offset); - } else { - return this.baseFs.writeSync(fd, buffer, offset, length, position); - } - } - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`writeSync`); - const [mountFs, realFd] = entry; - if (typeof buffer === `string`) { - return mountFs.writeSync(realFd, buffer, offset); - } else { - return mountFs.writeSync(realFd, buffer, offset, length, position); - } - } - async closePromise(fd) { - if ((fd & MOUNT_MASK) !== this.magic) - return await this.baseFs.closePromise(fd); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`close`); - this.fdMap.delete(fd); - const [mountFs, realFd] = entry; - return await mountFs.closePromise(realFd); - } - closeSync(fd) { - if ((fd & MOUNT_MASK) !== this.magic) - return this.baseFs.closeSync(fd); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`closeSync`); - this.fdMap.delete(fd); - const [mountFs, realFd] = entry; - return mountFs.closeSync(realFd); - } - createReadStream(p, opts) { - if (p === null) - return this.baseFs.createReadStream(p, opts); - return this.makeCallSync(p, () => { - return this.baseFs.createReadStream(p, opts); - }, (mountFs, { archivePath, subPath }) => { - const stream = mountFs.createReadStream(subPath, opts); - stream.path = npath.fromPortablePath(this.pathUtils.join(archivePath, subPath)); - return stream; - }); - } - createWriteStream(p, opts) { - if (p === null) - return this.baseFs.createWriteStream(p, opts); - return this.makeCallSync(p, () => { - return this.baseFs.createWriteStream(p, opts); - }, (mountFs, { subPath }) => { - return mountFs.createWriteStream(subPath, opts); - }); - } - async realpathPromise(p) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.realpathPromise(p); - }, async (mountFs, { archivePath, subPath }) => { - let realArchivePath = this.realPaths.get(archivePath); - if (typeof realArchivePath === `undefined`) { - realArchivePath = await this.baseFs.realpathPromise(archivePath); - this.realPaths.set(archivePath, realArchivePath); - } - return this.pathUtils.join(realArchivePath, this.pathUtils.relative(PortablePath.root, await mountFs.realpathPromise(subPath))); - }); - } - realpathSync(p) { - return this.makeCallSync(p, () => { - return this.baseFs.realpathSync(p); - }, (mountFs, { archivePath, subPath }) => { - let realArchivePath = this.realPaths.get(archivePath); - if (typeof realArchivePath === `undefined`) { - realArchivePath = this.baseFs.realpathSync(archivePath); - this.realPaths.set(archivePath, realArchivePath); - } - return this.pathUtils.join(realArchivePath, this.pathUtils.relative(PortablePath.root, mountFs.realpathSync(subPath))); - }); - } - async existsPromise(p) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.existsPromise(p); - }, async (mountFs, { subPath }) => { - return await mountFs.existsPromise(subPath); - }); - } - existsSync(p) { - return this.makeCallSync(p, () => { - return this.baseFs.existsSync(p); - }, (mountFs, { subPath }) => { - return mountFs.existsSync(subPath); - }); - } - async accessPromise(p, mode) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.accessPromise(p, mode); - }, async (mountFs, { subPath }) => { - return await mountFs.accessPromise(subPath, mode); - }); - } - accessSync(p, mode) { - return this.makeCallSync(p, () => { - return this.baseFs.accessSync(p, mode); - }, (mountFs, { subPath }) => { - return mountFs.accessSync(subPath, mode); - }); - } - async statPromise(p, opts) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.statPromise(p, opts); - }, async (mountFs, { subPath }) => { - return await mountFs.statPromise(subPath, opts); - }); - } - statSync(p, opts) { - return this.makeCallSync(p, () => { - return this.baseFs.statSync(p, opts); - }, (mountFs, { subPath }) => { - return mountFs.statSync(subPath, opts); - }); - } - async fstatPromise(fd, opts) { - if ((fd & MOUNT_MASK) !== this.magic) - return this.baseFs.fstatPromise(fd, opts); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`fstat`); - const [mountFs, realFd] = entry; - return mountFs.fstatPromise(realFd, opts); - } - fstatSync(fd, opts) { - if ((fd & MOUNT_MASK) !== this.magic) - return this.baseFs.fstatSync(fd, opts); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`fstatSync`); - const [mountFs, realFd] = entry; - return mountFs.fstatSync(realFd, opts); - } - async lstatPromise(p, opts) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.lstatPromise(p, opts); - }, async (mountFs, { subPath }) => { - return await mountFs.lstatPromise(subPath, opts); - }); - } - lstatSync(p, opts) { - return this.makeCallSync(p, () => { - return this.baseFs.lstatSync(p, opts); - }, (mountFs, { subPath }) => { - return mountFs.lstatSync(subPath, opts); - }); - } - async fchmodPromise(fd, mask) { - if ((fd & MOUNT_MASK) !== this.magic) - return this.baseFs.fchmodPromise(fd, mask); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`fchmod`); - const [mountFs, realFd] = entry; - return mountFs.fchmodPromise(realFd, mask); - } - fchmodSync(fd, mask) { - if ((fd & MOUNT_MASK) !== this.magic) - return this.baseFs.fchmodSync(fd, mask); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`fchmodSync`); - const [mountFs, realFd] = entry; - return mountFs.fchmodSync(realFd, mask); - } - async chmodPromise(p, mask) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.chmodPromise(p, mask); - }, async (mountFs, { subPath }) => { - return await mountFs.chmodPromise(subPath, mask); - }); - } - chmodSync(p, mask) { - return this.makeCallSync(p, () => { - return this.baseFs.chmodSync(p, mask); - }, (mountFs, { subPath }) => { - return mountFs.chmodSync(subPath, mask); - }); - } - async fchownPromise(fd, uid, gid) { - if ((fd & MOUNT_MASK) !== this.magic) - return this.baseFs.fchownPromise(fd, uid, gid); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`fchown`); - const [zipFs, realFd] = entry; - return zipFs.fchownPromise(realFd, uid, gid); - } - fchownSync(fd, uid, gid) { - if ((fd & MOUNT_MASK) !== this.magic) - return this.baseFs.fchownSync(fd, uid, gid); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`fchownSync`); - const [zipFs, realFd] = entry; - return zipFs.fchownSync(realFd, uid, gid); - } - async chownPromise(p, uid, gid) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.chownPromise(p, uid, gid); - }, async (mountFs, { subPath }) => { - return await mountFs.chownPromise(subPath, uid, gid); - }); - } - chownSync(p, uid, gid) { - return this.makeCallSync(p, () => { - return this.baseFs.chownSync(p, uid, gid); - }, (mountFs, { subPath }) => { - return mountFs.chownSync(subPath, uid, gid); - }); - } - async renamePromise(oldP, newP) { - return await this.makeCallPromise(oldP, async () => { - return await this.makeCallPromise(newP, async () => { - return await this.baseFs.renamePromise(oldP, newP); - }, async () => { - throw Object.assign(new Error(`EEXDEV: cross-device link not permitted`), { code: `EEXDEV` }); - }); - }, async (mountFsO, { subPath: subPathO }) => { - return await this.makeCallPromise(newP, async () => { - throw Object.assign(new Error(`EEXDEV: cross-device link not permitted`), { code: `EEXDEV` }); - }, async (mountFsN, { subPath: subPathN }) => { - if (mountFsO !== mountFsN) { - throw Object.assign(new Error(`EEXDEV: cross-device link not permitted`), { code: `EEXDEV` }); - } else { - return await mountFsO.renamePromise(subPathO, subPathN); - } - }); - }); - } - renameSync(oldP, newP) { - return this.makeCallSync(oldP, () => { - return this.makeCallSync(newP, () => { - return this.baseFs.renameSync(oldP, newP); - }, () => { - throw Object.assign(new Error(`EEXDEV: cross-device link not permitted`), { code: `EEXDEV` }); - }); - }, (mountFsO, { subPath: subPathO }) => { - return this.makeCallSync(newP, () => { - throw Object.assign(new Error(`EEXDEV: cross-device link not permitted`), { code: `EEXDEV` }); - }, (mountFsN, { subPath: subPathN }) => { - if (mountFsO !== mountFsN) { - throw Object.assign(new Error(`EEXDEV: cross-device link not permitted`), { code: `EEXDEV` }); - } else { - return mountFsO.renameSync(subPathO, subPathN); - } - }); - }); - } - async copyFilePromise(sourceP, destP, flags = 0) { - const fallback = async (sourceFs, sourceP2, destFs, destP2) => { - if ((flags & fs.constants.COPYFILE_FICLONE_FORCE) !== 0) - throw Object.assign(new Error(`EXDEV: cross-device clone not permitted, copyfile '${sourceP2}' -> ${destP2}'`), { code: `EXDEV` }); - if (flags & fs.constants.COPYFILE_EXCL && await this.existsPromise(sourceP2)) - throw Object.assign(new Error(`EEXIST: file already exists, copyfile '${sourceP2}' -> '${destP2}'`), { code: `EEXIST` }); - let content; - try { - content = await sourceFs.readFilePromise(sourceP2); - } catch (error) { - throw Object.assign(new Error(`EINVAL: invalid argument, copyfile '${sourceP2}' -> '${destP2}'`), { code: `EINVAL` }); - } - await destFs.writeFilePromise(destP2, content); - }; - return await this.makeCallPromise(sourceP, async () => { - return await this.makeCallPromise(destP, async () => { - return await this.baseFs.copyFilePromise(sourceP, destP, flags); - }, async (mountFsD, { subPath: subPathD }) => { - return await fallback(this.baseFs, sourceP, mountFsD, subPathD); - }); - }, async (mountFsS, { subPath: subPathS }) => { - return await this.makeCallPromise(destP, async () => { - return await fallback(mountFsS, subPathS, this.baseFs, destP); - }, async (mountFsD, { subPath: subPathD }) => { - if (mountFsS !== mountFsD) { - return await fallback(mountFsS, subPathS, mountFsD, subPathD); - } else { - return await mountFsS.copyFilePromise(subPathS, subPathD, flags); - } - }); - }); - } - copyFileSync(sourceP, destP, flags = 0) { - const fallback = (sourceFs, sourceP2, destFs, destP2) => { - if ((flags & fs.constants.COPYFILE_FICLONE_FORCE) !== 0) - throw Object.assign(new Error(`EXDEV: cross-device clone not permitted, copyfile '${sourceP2}' -> ${destP2}'`), { code: `EXDEV` }); - if (flags & fs.constants.COPYFILE_EXCL && this.existsSync(sourceP2)) - throw Object.assign(new Error(`EEXIST: file already exists, copyfile '${sourceP2}' -> '${destP2}'`), { code: `EEXIST` }); - let content; - try { - content = sourceFs.readFileSync(sourceP2); - } catch (error) { - throw Object.assign(new Error(`EINVAL: invalid argument, copyfile '${sourceP2}' -> '${destP2}'`), { code: `EINVAL` }); - } - destFs.writeFileSync(destP2, content); - }; - return this.makeCallSync(sourceP, () => { - return this.makeCallSync(destP, () => { - return this.baseFs.copyFileSync(sourceP, destP, flags); - }, (mountFsD, { subPath: subPathD }) => { - return fallback(this.baseFs, sourceP, mountFsD, subPathD); - }); - }, (mountFsS, { subPath: subPathS }) => { - return this.makeCallSync(destP, () => { - return fallback(mountFsS, subPathS, this.baseFs, destP); - }, (mountFsD, { subPath: subPathD }) => { - if (mountFsS !== mountFsD) { - return fallback(mountFsS, subPathS, mountFsD, subPathD); - } else { - return mountFsS.copyFileSync(subPathS, subPathD, flags); - } - }); - }); - } - async appendFilePromise(p, content, opts) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.appendFilePromise(p, content, opts); - }, async (mountFs, { subPath }) => { - return await mountFs.appendFilePromise(subPath, content, opts); - }); - } - appendFileSync(p, content, opts) { - return this.makeCallSync(p, () => { - return this.baseFs.appendFileSync(p, content, opts); - }, (mountFs, { subPath }) => { - return mountFs.appendFileSync(subPath, content, opts); - }); - } - async writeFilePromise(p, content, opts) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.writeFilePromise(p, content, opts); - }, async (mountFs, { subPath }) => { - return await mountFs.writeFilePromise(subPath, content, opts); - }); - } - writeFileSync(p, content, opts) { - return this.makeCallSync(p, () => { - return this.baseFs.writeFileSync(p, content, opts); - }, (mountFs, { subPath }) => { - return mountFs.writeFileSync(subPath, content, opts); - }); - } - async unlinkPromise(p) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.unlinkPromise(p); - }, async (mountFs, { subPath }) => { - return await mountFs.unlinkPromise(subPath); - }); - } - unlinkSync(p) { - return this.makeCallSync(p, () => { - return this.baseFs.unlinkSync(p); - }, (mountFs, { subPath }) => { - return mountFs.unlinkSync(subPath); - }); - } - async utimesPromise(p, atime, mtime) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.utimesPromise(p, atime, mtime); - }, async (mountFs, { subPath }) => { - return await mountFs.utimesPromise(subPath, atime, mtime); - }); - } - utimesSync(p, atime, mtime) { - return this.makeCallSync(p, () => { - return this.baseFs.utimesSync(p, atime, mtime); - }, (mountFs, { subPath }) => { - return mountFs.utimesSync(subPath, atime, mtime); - }); - } - async lutimesPromise(p, atime, mtime) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.lutimesPromise(p, atime, mtime); - }, async (mountFs, { subPath }) => { - return await mountFs.lutimesPromise(subPath, atime, mtime); - }); - } - lutimesSync(p, atime, mtime) { - return this.makeCallSync(p, () => { - return this.baseFs.lutimesSync(p, atime, mtime); - }, (mountFs, { subPath }) => { - return mountFs.lutimesSync(subPath, atime, mtime); - }); - } - async mkdirPromise(p, opts) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.mkdirPromise(p, opts); - }, async (mountFs, { subPath }) => { - return await mountFs.mkdirPromise(subPath, opts); - }); - } - mkdirSync(p, opts) { - return this.makeCallSync(p, () => { - return this.baseFs.mkdirSync(p, opts); - }, (mountFs, { subPath }) => { - return mountFs.mkdirSync(subPath, opts); - }); - } - async rmdirPromise(p, opts) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.rmdirPromise(p, opts); - }, async (mountFs, { subPath }) => { - return await mountFs.rmdirPromise(subPath, opts); - }); - } - rmdirSync(p, opts) { - return this.makeCallSync(p, () => { - return this.baseFs.rmdirSync(p, opts); - }, (mountFs, { subPath }) => { - return mountFs.rmdirSync(subPath, opts); - }); - } - async rmPromise(p, opts) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.rmPromise(p, opts); - }, async (mountFs, { subPath }) => { - return await mountFs.rmPromise(subPath, opts); - }); - } - rmSync(p, opts) { - return this.makeCallSync(p, () => { - return this.baseFs.rmSync(p, opts); - }, (mountFs, { subPath }) => { - return mountFs.rmSync(subPath, opts); - }); - } - async linkPromise(existingP, newP) { - return await this.makeCallPromise(newP, async () => { - return await this.baseFs.linkPromise(existingP, newP); - }, async (mountFs, { subPath }) => { - return await mountFs.linkPromise(existingP, subPath); - }); - } - linkSync(existingP, newP) { - return this.makeCallSync(newP, () => { - return this.baseFs.linkSync(existingP, newP); - }, (mountFs, { subPath }) => { - return mountFs.linkSync(existingP, subPath); - }); - } - async symlinkPromise(target, p, type) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.symlinkPromise(target, p, type); - }, async (mountFs, { subPath }) => { - return await mountFs.symlinkPromise(target, subPath); - }); - } - symlinkSync(target, p, type) { - return this.makeCallSync(p, () => { - return this.baseFs.symlinkSync(target, p, type); - }, (mountFs, { subPath }) => { - return mountFs.symlinkSync(target, subPath); - }); - } - async readFilePromise(p, encoding) { - return this.makeCallPromise(p, async () => { - return await this.baseFs.readFilePromise(p, encoding); - }, async (mountFs, { subPath }) => { - return await mountFs.readFilePromise(subPath, encoding); - }); - } - readFileSync(p, encoding) { - return this.makeCallSync(p, () => { - return this.baseFs.readFileSync(p, encoding); - }, (mountFs, { subPath }) => { - return mountFs.readFileSync(subPath, encoding); - }); - } - async readdirPromise(p, opts) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.readdirPromise(p, opts); - }, async (mountFs, { subPath }) => { - return await mountFs.readdirPromise(subPath, opts); - }, { - requireSubpath: false - }); - } - readdirSync(p, opts) { - return this.makeCallSync(p, () => { - return this.baseFs.readdirSync(p, opts); - }, (mountFs, { subPath }) => { - return mountFs.readdirSync(subPath, opts); - }, { - requireSubpath: false - }); - } - async readlinkPromise(p) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.readlinkPromise(p); - }, async (mountFs, { subPath }) => { - return await mountFs.readlinkPromise(subPath); - }); - } - readlinkSync(p) { - return this.makeCallSync(p, () => { - return this.baseFs.readlinkSync(p); - }, (mountFs, { subPath }) => { - return mountFs.readlinkSync(subPath); - }); - } - async truncatePromise(p, len) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.truncatePromise(p, len); - }, async (mountFs, { subPath }) => { - return await mountFs.truncatePromise(subPath, len); - }); - } - truncateSync(p, len) { - return this.makeCallSync(p, () => { - return this.baseFs.truncateSync(p, len); - }, (mountFs, { subPath }) => { - return mountFs.truncateSync(subPath, len); - }); - } - async ftruncatePromise(fd, len) { - if ((fd & MOUNT_MASK) !== this.magic) - return this.baseFs.ftruncatePromise(fd, len); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`ftruncate`); - const [mountFs, realFd] = entry; - return mountFs.ftruncatePromise(realFd, len); - } - ftruncateSync(fd, len) { - if ((fd & MOUNT_MASK) !== this.magic) - return this.baseFs.ftruncateSync(fd, len); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`ftruncateSync`); - const [mountFs, realFd] = entry; - return mountFs.ftruncateSync(realFd, len); - } - watch(p, a, b) { - return this.makeCallSync(p, () => { - return this.baseFs.watch( - p, - a, - b - ); - }, (mountFs, { subPath }) => { - return mountFs.watch( - subPath, - a, - b - ); - }); - } - watchFile(p, a, b) { - return this.makeCallSync(p, () => { - return this.baseFs.watchFile( - p, - a, - b - ); - }, () => { - return watchFile(this, p, a, b); - }); - } - unwatchFile(p, cb) { - return this.makeCallSync(p, () => { - return this.baseFs.unwatchFile(p, cb); - }, () => { - return unwatchFile(this, p, cb); - }); - } - async makeCallPromise(p, discard, accept, { requireSubpath = true } = {}) { - if (typeof p !== `string`) - return await discard(); - const normalizedP = this.resolve(p); - const mountInfo = this.findMount(normalizedP); - if (!mountInfo) - return await discard(); - if (requireSubpath && mountInfo.subPath === `/`) - return await discard(); - return await this.getMountPromise(mountInfo.archivePath, async (mountFs) => await accept(mountFs, mountInfo)); - } - makeCallSync(p, discard, accept, { requireSubpath = true } = {}) { - if (typeof p !== `string`) - return discard(); - const normalizedP = this.resolve(p); - const mountInfo = this.findMount(normalizedP); - if (!mountInfo) - return discard(); - if (requireSubpath && mountInfo.subPath === `/`) - return discard(); - return this.getMountSync(mountInfo.archivePath, (mountFs) => accept(mountFs, mountInfo)); - } - findMount(p) { - if (this.filter && !this.filter.test(p)) - return null; - let filePath = ``; - while (true) { - const pathPartWithArchive = p.substring(filePath.length); - const mountPoint = this.getMountPoint(pathPartWithArchive, filePath); - if (!mountPoint) - return null; - filePath = this.pathUtils.join(filePath, mountPoint); - if (!this.isMount.has(filePath)) { - if (this.notMount.has(filePath)) - continue; - try { - if (this.typeCheck !== null && (this.baseFs.lstatSync(filePath).mode & fs.constants.S_IFMT) !== this.typeCheck) { - this.notMount.add(filePath); - continue; - } - } catch { - return null; - } - this.isMount.add(filePath); - } - return { - archivePath: filePath, - subPath: this.pathUtils.join(PortablePath.root, p.substring(filePath.length)) - }; - } - } - limitOpenFiles(max) { - if (this.mountInstances === null) - return; - const now = Date.now(); - let nextExpiresAt = now + this.maxAge; - let closeCount = max === null ? 0 : this.mountInstances.size - max; - for (const [path, { childFs, expiresAt, refCount }] of this.mountInstances.entries()) { - if (refCount !== 0 || childFs.hasOpenFileHandles?.()) { - continue; - } else if (now >= expiresAt) { - childFs.saveAndClose?.(); - this.mountInstances.delete(path); - closeCount -= 1; - continue; - } else if (max === null || closeCount <= 0) { - nextExpiresAt = expiresAt; - break; - } - childFs.saveAndClose?.(); - this.mountInstances.delete(path); - closeCount -= 1; - } - if (this.limitOpenFilesTimeout === null && (max === null && this.mountInstances.size > 0 || max !== null) && isFinite(nextExpiresAt)) { - this.limitOpenFilesTimeout = setTimeout(() => { - this.limitOpenFilesTimeout = null; - this.limitOpenFiles(null); - }, nextExpiresAt - now).unref(); - } - } - async getMountPromise(p, accept) { - if (this.mountInstances) { - let cachedMountFs = this.mountInstances.get(p); - if (!cachedMountFs) { - const createFsInstance = await this.factoryPromise(this.baseFs, p); - cachedMountFs = this.mountInstances.get(p); - if (!cachedMountFs) { - cachedMountFs = { - childFs: createFsInstance(), - expiresAt: 0, - refCount: 0 - }; - } - } - this.mountInstances.delete(p); - this.limitOpenFiles(this.maxOpenFiles - 1); - this.mountInstances.set(p, cachedMountFs); - cachedMountFs.expiresAt = Date.now() + this.maxAge; - cachedMountFs.refCount += 1; - try { - return await accept(cachedMountFs.childFs); - } finally { - cachedMountFs.refCount -= 1; - } - } else { - const mountFs = (await this.factoryPromise(this.baseFs, p))(); - try { - return await accept(mountFs); - } finally { - mountFs.saveAndClose?.(); - } - } - } - getMountSync(p, accept) { - if (this.mountInstances) { - let cachedMountFs = this.mountInstances.get(p); - if (!cachedMountFs) { - cachedMountFs = { - childFs: this.factorySync(this.baseFs, p), - expiresAt: 0, - refCount: 0 - }; - } - this.mountInstances.delete(p); - this.limitOpenFiles(this.maxOpenFiles - 1); - this.mountInstances.set(p, cachedMountFs); - cachedMountFs.expiresAt = Date.now() + this.maxAge; - return accept(cachedMountFs.childFs); - } else { - const childFs = this.factorySync(this.baseFs, p); - try { - return accept(childFs); - } finally { - childFs.saveAndClose?.(); - } - } - } -} - -class PosixFS extends ProxiedFS { - constructor(baseFs) { - super(npath); - this.baseFs = baseFs; - } - mapFromBase(path) { - return npath.fromPortablePath(path); - } - mapToBase(path) { - return npath.toPortablePath(path); - } -} - -const NUMBER_REGEXP = /^[0-9]+$/; -const VIRTUAL_REGEXP = /^(\/(?:[^/]+\/)*?(?:\$\$virtual|__virtual__))((?:\/((?:[^/]+-)?[a-f0-9]+)(?:\/([^/]+))?)?((?:\/.*)?))$/; -const VALID_COMPONENT = /^([^/]+-)?[a-f0-9]+$/; -class VirtualFS extends ProxiedFS { - constructor({ baseFs = new NodeFS() } = {}) { - super(ppath); - this.baseFs = baseFs; - } - static makeVirtualPath(base, component, to) { - if (ppath.basename(base) !== `__virtual__`) - throw new Error(`Assertion failed: Virtual folders must be named "__virtual__"`); - if (!ppath.basename(component).match(VALID_COMPONENT)) - throw new Error(`Assertion failed: Virtual components must be ended by an hexadecimal hash`); - const target = ppath.relative(ppath.dirname(base), to); - const segments = target.split(`/`); - let depth = 0; - while (depth < segments.length && segments[depth] === `..`) - depth += 1; - const finalSegments = segments.slice(depth); - const fullVirtualPath = ppath.join(base, component, String(depth), ...finalSegments); - return fullVirtualPath; - } - static resolveVirtual(p) { - const match = p.match(VIRTUAL_REGEXP); - if (!match || !match[3] && match[5]) - return p; - const target = ppath.dirname(match[1]); - if (!match[3] || !match[4]) - return target; - const isnum = NUMBER_REGEXP.test(match[4]); - if (!isnum) - return p; - const depth = Number(match[4]); - const backstep = `../`.repeat(depth); - const subpath = match[5] || `.`; - return VirtualFS.resolveVirtual(ppath.join(target, backstep, subpath)); - } - getExtractHint(hints) { - return this.baseFs.getExtractHint(hints); - } - getRealPath() { - return this.baseFs.getRealPath(); - } - realpathSync(p) { - const match = p.match(VIRTUAL_REGEXP); - if (!match) - return this.baseFs.realpathSync(p); - if (!match[5]) - return p; - const realpath = this.baseFs.realpathSync(this.mapToBase(p)); - return VirtualFS.makeVirtualPath(match[1], match[3], realpath); - } - async realpathPromise(p) { - const match = p.match(VIRTUAL_REGEXP); - if (!match) - return await this.baseFs.realpathPromise(p); - if (!match[5]) - return p; - const realpath = await this.baseFs.realpathPromise(this.mapToBase(p)); - return VirtualFS.makeVirtualPath(match[1], match[3], realpath); - } - mapToBase(p) { - if (p === ``) - return p; - if (this.pathUtils.isAbsolute(p)) - return VirtualFS.resolveVirtual(p); - const resolvedRoot = VirtualFS.resolveVirtual(this.baseFs.resolve(PortablePath.dot)); - const resolvedP = VirtualFS.resolveVirtual(this.baseFs.resolve(p)); - return ppath.relative(resolvedRoot, resolvedP) || PortablePath.dot; - } - mapFromBase(p) { - return p; - } -} - -const URL = Number(process.versions.node.split('.', 1)[0]) < 20 ? url.URL : globalThis.URL; - -class NodePathFS extends ProxiedFS { - constructor(baseFs) { - super(npath); - this.baseFs = baseFs; - } - mapFromBase(path) { - return path; - } - mapToBase(path) { - if (typeof path === `string`) - return path; - if (path instanceof URL) - return url.fileURLToPath(path); - if (Buffer.isBuffer(path)) { - const str = path.toString(); - if (!isUtf8(path, str)) - throw new Error(`Non-utf8 buffers are not supported at the moment. Please upvote the following issue if you encounter this error: https://github.com/yarnpkg/berry/issues/4942`); - return str; - } - throw new Error(`Unsupported path type: ${nodeUtils.inspect(path)}`); - } -} -function isUtf8(buf, str) { - if (typeof buffer__default.default.isUtf8 !== `undefined`) - return buffer__default.default.isUtf8(buf); - return Buffer.byteLength(str) === buf.byteLength; -} - -var _a, _b, _c, _d; -const kBaseFs = Symbol(`kBaseFs`); -const kFd = Symbol(`kFd`); -const kClosePromise = Symbol(`kClosePromise`); -const kCloseResolve = Symbol(`kCloseResolve`); -const kCloseReject = Symbol(`kCloseReject`); -const kRefs = Symbol(`kRefs`); -const kRef = Symbol(`kRef`); -const kUnref = Symbol(`kUnref`); -class FileHandle { - constructor(fd, baseFs) { - this[_a] = 1; - this[_b] = void 0; - this[_c] = void 0; - this[_d] = void 0; - this[kBaseFs] = baseFs; - this[kFd] = fd; - } - get fd() { - return this[kFd]; - } - async appendFile(data, options) { - try { - this[kRef](this.appendFile); - const encoding = (typeof options === `string` ? options : options?.encoding) ?? void 0; - return await this[kBaseFs].appendFilePromise(this.fd, data, encoding ? { encoding } : void 0); - } finally { - this[kUnref](); - } - } - async chown(uid, gid) { - try { - this[kRef](this.chown); - return await this[kBaseFs].fchownPromise(this.fd, uid, gid); - } finally { - this[kUnref](); - } - } - async chmod(mode) { - try { - this[kRef](this.chmod); - return await this[kBaseFs].fchmodPromise(this.fd, mode); - } finally { - this[kUnref](); - } - } - createReadStream(options) { - return this[kBaseFs].createReadStream(null, { ...options, fd: this.fd }); - } - createWriteStream(options) { - return this[kBaseFs].createWriteStream(null, { ...options, fd: this.fd }); - } - datasync() { - throw new Error(`Method not implemented.`); - } - sync() { - throw new Error(`Method not implemented.`); - } - async read(bufferOrOptions, offset, length, position) { - try { - this[kRef](this.read); - let buffer; - if (!Buffer.isBuffer(bufferOrOptions)) { - bufferOrOptions ??= {}; - buffer = bufferOrOptions.buffer ?? Buffer.alloc(16384); - offset = bufferOrOptions.offset || 0; - length = bufferOrOptions.length ?? buffer.byteLength; - position = bufferOrOptions.position ?? null; - } else { - buffer = bufferOrOptions; - } - offset ??= 0; - length ??= 0; - if (length === 0) { - return { - bytesRead: length, - buffer - }; - } - const bytesRead = await this[kBaseFs].readPromise(this.fd, buffer, offset, length, position); - return { - bytesRead, - buffer - }; - } finally { - this[kUnref](); - } - } - async readFile(options) { - try { - this[kRef](this.readFile); - const encoding = (typeof options === `string` ? options : options?.encoding) ?? void 0; - return await this[kBaseFs].readFilePromise(this.fd, encoding); - } finally { - this[kUnref](); - } - } - readLines(options) { - return readline.createInterface({ - input: this.createReadStream(options), - crlfDelay: Infinity - }); - } - async stat(opts) { - try { - this[kRef](this.stat); - return await this[kBaseFs].fstatPromise(this.fd, opts); - } finally { - this[kUnref](); - } - } - async truncate(len) { - try { - this[kRef](this.truncate); - return await this[kBaseFs].ftruncatePromise(this.fd, len); - } finally { - this[kUnref](); - } - } - utimes(atime, mtime) { - throw new Error(`Method not implemented.`); - } - async writeFile(data, options) { - try { - this[kRef](this.writeFile); - const encoding = (typeof options === `string` ? options : options?.encoding) ?? void 0; - await this[kBaseFs].writeFilePromise(this.fd, data, encoding); - } finally { - this[kUnref](); - } - } - async write(...args) { - try { - this[kRef](this.write); - if (ArrayBuffer.isView(args[0])) { - const [buffer, offset, length, position] = args; - const bytesWritten = await this[kBaseFs].writePromise(this.fd, buffer, offset ?? void 0, length ?? void 0, position ?? void 0); - return { bytesWritten, buffer }; - } else { - const [data, position, encoding] = args; - const bytesWritten = await this[kBaseFs].writePromise(this.fd, data, position, encoding); - return { bytesWritten, buffer: data }; - } - } finally { - this[kUnref](); - } - } - async writev(buffers, position) { - try { - this[kRef](this.writev); - let bytesWritten = 0; - if (typeof position !== `undefined`) { - for (const buffer of buffers) { - const writeResult = await this.write(buffer, void 0, void 0, position); - bytesWritten += writeResult.bytesWritten; - position += writeResult.bytesWritten; - } - } else { - for (const buffer of buffers) { - const writeResult = await this.write(buffer); - bytesWritten += writeResult.bytesWritten; - } - } - return { - buffers, - bytesWritten - }; - } finally { - this[kUnref](); - } - } - readv(buffers, position) { - throw new Error(`Method not implemented.`); - } - close() { - if (this[kFd] === -1) - return Promise.resolve(); - if (this[kClosePromise]) - return this[kClosePromise]; - this[kRefs]--; - if (this[kRefs] === 0) { - const fd = this[kFd]; - this[kFd] = -1; - this[kClosePromise] = this[kBaseFs].closePromise(fd).finally(() => { - this[kClosePromise] = void 0; - }); - } else { - this[kClosePromise] = new Promise((resolve, reject) => { - this[kCloseResolve] = resolve; - this[kCloseReject] = reject; - }).finally(() => { - this[kClosePromise] = void 0; - this[kCloseReject] = void 0; - this[kCloseResolve] = void 0; - }); - } - return this[kClosePromise]; - } - [(_a = kRefs, _b = kClosePromise, _c = kCloseResolve, _d = kCloseReject, kRef)](caller) { - if (this[kFd] === -1) { - const err = new Error(`file closed`); - err.code = `EBADF`; - err.syscall = caller.name; - throw err; - } - this[kRefs]++; - } - [kUnref]() { - this[kRefs]--; - if (this[kRefs] === 0) { - const fd = this[kFd]; - this[kFd] = -1; - this[kBaseFs].closePromise(fd).then(this[kCloseResolve], this[kCloseReject]); - } - } -} - -const SYNC_IMPLEMENTATIONS = /* @__PURE__ */ new Set([ - `accessSync`, - `appendFileSync`, - `createReadStream`, - `createWriteStream`, - `chmodSync`, - `fchmodSync`, - `chownSync`, - `fchownSync`, - `closeSync`, - `copyFileSync`, - `linkSync`, - `lstatSync`, - `fstatSync`, - `lutimesSync`, - `mkdirSync`, - `openSync`, - `opendirSync`, - `readlinkSync`, - `readFileSync`, - `readdirSync`, - `readlinkSync`, - `realpathSync`, - `renameSync`, - `rmdirSync`, - `rmSync`, - `statSync`, - `symlinkSync`, - `truncateSync`, - `ftruncateSync`, - `unlinkSync`, - `unwatchFile`, - `utimesSync`, - `watch`, - `watchFile`, - `writeFileSync`, - `writeSync` -]); -const ASYNC_IMPLEMENTATIONS = /* @__PURE__ */ new Set([ - `accessPromise`, - `appendFilePromise`, - `fchmodPromise`, - `chmodPromise`, - `fchownPromise`, - `chownPromise`, - `closePromise`, - `copyFilePromise`, - `linkPromise`, - `fstatPromise`, - `lstatPromise`, - `lutimesPromise`, - `mkdirPromise`, - `openPromise`, - `opendirPromise`, - `readdirPromise`, - `realpathPromise`, - `readFilePromise`, - `readdirPromise`, - `readlinkPromise`, - `renamePromise`, - `rmdirPromise`, - `rmPromise`, - `statPromise`, - `symlinkPromise`, - `truncatePromise`, - `ftruncatePromise`, - `unlinkPromise`, - `utimesPromise`, - `writeFilePromise`, - `writeSync` -]); -function patchFs(patchedFs, fakeFs) { - fakeFs = new NodePathFS(fakeFs); - const setupFn = (target, name, replacement) => { - const orig = target[name]; - target[name] = replacement; - if (typeof orig?.[nodeUtils.promisify.custom] !== `undefined`) { - replacement[nodeUtils.promisify.custom] = orig[nodeUtils.promisify.custom]; - } - }; - { - setupFn(patchedFs, `exists`, (p, ...args) => { - const hasCallback = typeof args[args.length - 1] === `function`; - const callback = hasCallback ? args.pop() : () => { - }; - process.nextTick(() => { - fakeFs.existsPromise(p).then((exists) => { - callback(exists); - }, () => { - callback(false); - }); - }); - }); - setupFn(patchedFs, `read`, (...args) => { - let [fd, buffer, offset, length, position, callback] = args; - if (args.length <= 3) { - let options = {}; - if (args.length < 3) { - callback = args[1]; - } else { - options = args[1]; - callback = args[2]; - } - ({ - buffer = Buffer.alloc(16384), - offset = 0, - length = buffer.byteLength, - position - } = options); - } - if (offset == null) - offset = 0; - length |= 0; - if (length === 0) { - process.nextTick(() => { - callback(null, 0, buffer); - }); - return; - } - if (position == null) - position = -1; - process.nextTick(() => { - fakeFs.readPromise(fd, buffer, offset, length, position).then((bytesRead) => { - callback(null, bytesRead, buffer); - }, (error) => { - callback(error, 0, buffer); - }); - }); - }); - for (const fnName of ASYNC_IMPLEMENTATIONS) { - const origName = fnName.replace(/Promise$/, ``); - if (typeof patchedFs[origName] === `undefined`) - continue; - const fakeImpl = fakeFs[fnName]; - if (typeof fakeImpl === `undefined`) - continue; - const wrapper = (...args) => { - const hasCallback = typeof args[args.length - 1] === `function`; - const callback = hasCallback ? args.pop() : () => { - }; - process.nextTick(() => { - fakeImpl.apply(fakeFs, args).then((result) => { - callback(null, result); - }, (error) => { - callback(error); - }); - }); - }; - setupFn(patchedFs, origName, wrapper); - } - patchedFs.realpath.native = patchedFs.realpath; - } - { - setupFn(patchedFs, `existsSync`, (p) => { - try { - return fakeFs.existsSync(p); - } catch (error) { - return false; - } - }); - setupFn(patchedFs, `readSync`, (...args) => { - let [fd, buffer, offset, length, position] = args; - if (args.length <= 3) { - const options = args[2] || {}; - ({ offset = 0, length = buffer.byteLength, position } = options); - } - if (offset == null) - offset = 0; - length |= 0; - if (length === 0) - return 0; - if (position == null) - position = -1; - return fakeFs.readSync(fd, buffer, offset, length, position); - }); - for (const fnName of SYNC_IMPLEMENTATIONS) { - const origName = fnName; - if (typeof patchedFs[origName] === `undefined`) - continue; - const fakeImpl = fakeFs[fnName]; - if (typeof fakeImpl === `undefined`) - continue; - setupFn(patchedFs, origName, fakeImpl.bind(fakeFs)); - } - patchedFs.realpathSync.native = patchedFs.realpathSync; - } - { - const patchedFsPromises = patchedFs.promises; - for (const fnName of ASYNC_IMPLEMENTATIONS) { - const origName = fnName.replace(/Promise$/, ``); - if (typeof patchedFsPromises[origName] === `undefined`) - continue; - const fakeImpl = fakeFs[fnName]; - if (typeof fakeImpl === `undefined`) - continue; - if (fnName === `open`) - continue; - setupFn(patchedFsPromises, origName, (pathLike, ...args) => { - if (pathLike instanceof FileHandle) { - return pathLike[origName].apply(pathLike, args); - } else { - return fakeImpl.call(fakeFs, pathLike, ...args); - } - }); - } - setupFn(patchedFsPromises, `open`, async (...args) => { - const fd = await fakeFs.openPromise(...args); - return new FileHandle(fd, fakeFs); - }); - } - { - patchedFs.read[nodeUtils.promisify.custom] = async (fd, buffer, ...args) => { - const res = fakeFs.readPromise(fd, buffer, ...args); - return { bytesRead: await res, buffer }; - }; - patchedFs.write[nodeUtils.promisify.custom] = async (fd, buffer, ...args) => { - const res = fakeFs.writePromise(fd, buffer, ...args); - return { bytesWritten: await res, buffer }; - }; - } -} - -let cachedInstance; -let registeredFactory = () => { - throw new Error(`Assertion failed: No libzip instance is available, and no factory was configured`); -}; -function setFactory(factory) { - registeredFactory = factory; -} -function getInstance() { - if (typeof cachedInstance === `undefined`) - cachedInstance = registeredFactory(); - return cachedInstance; -} - -var libzipSync = {exports: {}}; - -(function (module, exports) { -var frozenFs = Object.assign({}, fs__default.default); -var createModule = function() { - var _scriptDir = void 0; - if (typeof __filename !== "undefined") - _scriptDir = _scriptDir || __filename; - return function(createModule2) { - createModule2 = createModule2 || {}; - var Module = typeof createModule2 !== "undefined" ? createModule2 : {}; - var readyPromiseResolve, readyPromiseReject; - Module["ready"] = new Promise(function(resolve, reject) { - readyPromiseResolve = resolve; - readyPromiseReject = reject; - }); - var moduleOverrides = {}; - var key; - for (key in Module) { - if (Module.hasOwnProperty(key)) { - moduleOverrides[key] = Module[key]; - } - } - var scriptDirectory = ""; - function locateFile(path) { - if (Module["locateFile"]) { - return Module["locateFile"](path, scriptDirectory); - } - return scriptDirectory + path; - } - var read_, readBinary; - var nodeFS; - var nodePath; - { - { - scriptDirectory = __dirname + "/"; - } - read_ = function shell_read(filename, binary) { - var ret = tryParseAsDataURI(filename); - if (ret) { - return binary ? ret : ret.toString(); - } - if (!nodeFS) - nodeFS = frozenFs; - if (!nodePath) - nodePath = path__default.default; - filename = nodePath["normalize"](filename); - return nodeFS["readFileSync"](filename, binary ? null : "utf8"); - }; - readBinary = function readBinary2(filename) { - var ret = read_(filename, true); - if (!ret.buffer) { - ret = new Uint8Array(ret); - } - assert(ret.buffer); - return ret; - }; - if (process["argv"].length > 1) { - process["argv"][1].replace(/\\/g, "/"); - } - process["argv"].slice(2); - Module["inspect"] = function() { - return "[Emscripten Module object]"; - }; - } - Module["print"] || console.log.bind(console); - var err = Module["printErr"] || console.warn.bind(console); - for (key in moduleOverrides) { - if (moduleOverrides.hasOwnProperty(key)) { - Module[key] = moduleOverrides[key]; - } - } - moduleOverrides = null; - if (Module["arguments"]) - ; - if (Module["thisProgram"]) - ; - if (Module["quit"]) - ; - var wasmBinary; - if (Module["wasmBinary"]) - wasmBinary = Module["wasmBinary"]; - Module["noExitRuntime"] || true; - if (typeof WebAssembly !== "object") { - abort("no native wasm support detected"); - } - function getValue(ptr, type, noSafe) { - type = type || "i8"; - if (type.charAt(type.length - 1) === "*") - type = "i32"; - switch (type) { - case "i1": - return HEAP8[ptr >> 0]; - case "i8": - return HEAP8[ptr >> 0]; - case "i16": - return LE_HEAP_LOAD_I16((ptr >> 1) * 2); - case "i32": - return LE_HEAP_LOAD_I32((ptr >> 2) * 4); - case "i64": - return LE_HEAP_LOAD_I32((ptr >> 2) * 4); - case "float": - return LE_HEAP_LOAD_F32((ptr >> 2) * 4); - case "double": - return LE_HEAP_LOAD_F64((ptr >> 3) * 8); - default: - abort("invalid type for getValue: " + type); - } - return null; - } - var wasmMemory; - var ABORT = false; - function assert(condition, text) { - if (!condition) { - abort("Assertion failed: " + text); - } - } - function getCFunc(ident) { - var func = Module["_" + ident]; - assert( - func, - "Cannot call unknown function " + ident + ", make sure it is exported" - ); - return func; - } - function ccall(ident, returnType, argTypes, args, opts) { - var toC = { - string: function(str) { - var ret2 = 0; - if (str !== null && str !== void 0 && str !== 0) { - var len = (str.length << 2) + 1; - ret2 = stackAlloc(len); - stringToUTF8(str, ret2, len); - } - return ret2; - }, - array: function(arr) { - var ret2 = stackAlloc(arr.length); - writeArrayToMemory(arr, ret2); - return ret2; - } - }; - function convertReturnValue(ret2) { - if (returnType === "string") - return UTF8ToString(ret2); - if (returnType === "boolean") - return Boolean(ret2); - return ret2; - } - var func = getCFunc(ident); - var cArgs = []; - var stack = 0; - if (args) { - for (var i = 0; i < args.length; i++) { - var converter = toC[argTypes[i]]; - if (converter) { - if (stack === 0) - stack = stackSave(); - cArgs[i] = converter(args[i]); - } else { - cArgs[i] = args[i]; - } - } - } - var ret = func.apply(null, cArgs); - ret = convertReturnValue(ret); - if (stack !== 0) - stackRestore(stack); - return ret; - } - function cwrap(ident, returnType, argTypes, opts) { - argTypes = argTypes || []; - var numericArgs = argTypes.every(function(type) { - return type === "number"; - }); - var numericRet = returnType !== "string"; - if (numericRet && numericArgs && !opts) { - return getCFunc(ident); - } - return function() { - return ccall(ident, returnType, argTypes, arguments); - }; - } - var UTF8Decoder = new TextDecoder("utf8"); - function UTF8ToString(ptr, maxBytesToRead) { - if (!ptr) - return ""; - var maxPtr = ptr + maxBytesToRead; - for (var end = ptr; !(end >= maxPtr) && HEAPU8[end]; ) - ++end; - return UTF8Decoder.decode(HEAPU8.subarray(ptr, end)); - } - function stringToUTF8Array(str, heap, outIdx, maxBytesToWrite) { - if (!(maxBytesToWrite > 0)) - return 0; - var startIdx = outIdx; - var endIdx = outIdx + maxBytesToWrite - 1; - for (var i = 0; i < str.length; ++i) { - var u = str.charCodeAt(i); - if (u >= 55296 && u <= 57343) { - var u1 = str.charCodeAt(++i); - u = 65536 + ((u & 1023) << 10) | u1 & 1023; - } - if (u <= 127) { - if (outIdx >= endIdx) - break; - heap[outIdx++] = u; - } else if (u <= 2047) { - if (outIdx + 1 >= endIdx) - break; - heap[outIdx++] = 192 | u >> 6; - heap[outIdx++] = 128 | u & 63; - } else if (u <= 65535) { - if (outIdx + 2 >= endIdx) - break; - heap[outIdx++] = 224 | u >> 12; - heap[outIdx++] = 128 | u >> 6 & 63; - heap[outIdx++] = 128 | u & 63; - } else { - if (outIdx + 3 >= endIdx) - break; - heap[outIdx++] = 240 | u >> 18; - heap[outIdx++] = 128 | u >> 12 & 63; - heap[outIdx++] = 128 | u >> 6 & 63; - heap[outIdx++] = 128 | u & 63; - } - } - heap[outIdx] = 0; - return outIdx - startIdx; - } - function stringToUTF8(str, outPtr, maxBytesToWrite) { - return stringToUTF8Array(str, HEAPU8, outPtr, maxBytesToWrite); - } - function lengthBytesUTF8(str) { - var len = 0; - for (var i = 0; i < str.length; ++i) { - var u = str.charCodeAt(i); - if (u >= 55296 && u <= 57343) - u = 65536 + ((u & 1023) << 10) | str.charCodeAt(++i) & 1023; - if (u <= 127) - ++len; - else if (u <= 2047) - len += 2; - else if (u <= 65535) - len += 3; - else - len += 4; - } - return len; - } - function allocateUTF8(str) { - var size = lengthBytesUTF8(str) + 1; - var ret = _malloc(size); - if (ret) - stringToUTF8Array(str, HEAP8, ret, size); - return ret; - } - function writeArrayToMemory(array, buffer2) { - HEAP8.set(array, buffer2); - } - function alignUp(x, multiple) { - if (x % multiple > 0) { - x += multiple - x % multiple; - } - return x; - } - var buffer, HEAP8, HEAPU8; - var HEAP_DATA_VIEW; - function updateGlobalBufferAndViews(buf) { - buffer = buf; - Module["HEAP_DATA_VIEW"] = HEAP_DATA_VIEW = new DataView(buf); - Module["HEAP8"] = HEAP8 = new Int8Array(buf); - Module["HEAP16"] = new Int16Array(buf); - Module["HEAP32"] = new Int32Array(buf); - Module["HEAPU8"] = HEAPU8 = new Uint8Array(buf); - Module["HEAPU16"] = new Uint16Array(buf); - Module["HEAPU32"] = new Uint32Array(buf); - Module["HEAPF32"] = new Float32Array(buf); - Module["HEAPF64"] = new Float64Array(buf); - } - Module["INITIAL_MEMORY"] || 16777216; - var wasmTable; - var __ATPRERUN__ = []; - var __ATINIT__ = []; - var __ATPOSTRUN__ = []; - function preRun() { - if (Module["preRun"]) { - if (typeof Module["preRun"] == "function") - Module["preRun"] = [Module["preRun"]]; - while (Module["preRun"].length) { - addOnPreRun(Module["preRun"].shift()); - } - } - callRuntimeCallbacks(__ATPRERUN__); - } - function initRuntime() { - callRuntimeCallbacks(__ATINIT__); - } - function postRun() { - if (Module["postRun"]) { - if (typeof Module["postRun"] == "function") - Module["postRun"] = [Module["postRun"]]; - while (Module["postRun"].length) { - addOnPostRun(Module["postRun"].shift()); - } - } - callRuntimeCallbacks(__ATPOSTRUN__); - } - function addOnPreRun(cb) { - __ATPRERUN__.unshift(cb); - } - function addOnInit(cb) { - __ATINIT__.unshift(cb); - } - function addOnPostRun(cb) { - __ATPOSTRUN__.unshift(cb); - } - var runDependencies = 0; - var dependenciesFulfilled = null; - function addRunDependency(id) { - runDependencies++; - if (Module["monitorRunDependencies"]) { - Module["monitorRunDependencies"](runDependencies); - } - } - function removeRunDependency(id) { - runDependencies--; - if (Module["monitorRunDependencies"]) { - Module["monitorRunDependencies"](runDependencies); - } - if (runDependencies == 0) { - if (dependenciesFulfilled) { - var callback = dependenciesFulfilled; - dependenciesFulfilled = null; - callback(); - } - } - } - Module["preloadedImages"] = {}; - Module["preloadedAudios"] = {}; - function abort(what) { - if (Module["onAbort"]) { - Module["onAbort"](what); - } - what += ""; - err(what); - ABORT = true; - what = "abort(" + what + "). Build with -s ASSERTIONS=1 for more info."; - var e = new WebAssembly.RuntimeError(what); - readyPromiseReject(e); - throw e; - } - var dataURIPrefix = "data:application/octet-stream;base64,"; - function isDataURI(filename) { - return filename.startsWith(dataURIPrefix); - } - var wasmBinaryFile = "data:application/octet-stream;base64,AGFzbQEAAAAB/wEkYAN/f38Bf2ABfwF/YAJ/fwF/YAF/AGAEf39/fwF/YAN/f38AYAV/f39/fwF/YAJ/fwBgBH9/f38AYAABf2AFf39/fn8BfmAEf35/fwF/YAR/f35/AX5gAn9+AX9gA398fwBgA39/fgF/YAF/AX5gBn9/f39/fwF/YAN/fn8Bf2AEf39/fwF+YAV/f35/fwF/YAR/f35/AX9gA39/fgF+YAJ/fgBgAn9/AX5gBX9/f39/AGADf35/AX5gBX5+f35/AX5gA39/fwF+YAZ/fH9/f38Bf2AAAGAHf35/f39+fwF/YAV/fn9/fwF/YAV/f39/fwF+YAJ+fwF/YAJ/fAACJQYBYQFhAAMBYQFiAAEBYQFjAAABYQFkAAEBYQFlAAIBYQFmAAED5wHlAQMAAwEDAwEHDAgDFgcNEgEDDRcFAQ8DEAUQAwIBAhgECxkEAQMBBQsFAwMDARACBAMAAggLBwEAAwADGgQDGwYGABwBBgMTFBEHBwcVCx4ABAgHBAICAgAfAQICAgIGFSAAIQAiAAIBBgIHAg0LEw0FAQUCACMDAQAUAAAGBQECBQUDCwsSAgEDBQIHAQEICAACCQQEAQABCAEBCQoBAwkBAQEBBgEGBgYABAIEBAQGEQQEAAARAAEDCQEJAQAJCQkBAQECCgoAAAMPAQEBAwACAgICBQIABwAKBgwHAAADAgICBQEEBQFwAT8/BQcBAYACgIACBgkBfwFBgInBAgsH+gEzAWcCAAFoAFQBaQDqAQFqALsBAWsAwQE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BADYCCCAAQgA3AwAgAEEANgIwIABC/////w83AyggAEIANwMYIABCADcDIAulAQEBf0HYABAJIgFFBEBBAA8LAkAgAARAIAEgAEHYABAHGgwBCyABQgA3AyAgAUEANgIYIAFC/////w83AxAgAUEAOwEMIAFBv4YoNgIIIAFBAToABiABQQA6AAQgAUIANwNIIAFBgIDYjXg2AkQgAUIANwMoIAFCADcDMCABQgA3AzggAUFAa0EAOwEAIAFCADcDUAsgAUEBOgAFIAFBADYCACABC1gCAn4BfwJAAkAgAC0AAEUNACAAKQMQIgMgAq18IgQgA1QNACAEIAApAwhYDQELIABBADoAAA8LIAAoAgQiBUUEQA8LIAAgBDcDECAFIAOnaiABIAIQBxoLlgEBAn8CQAJAIAJFBEAgAacQCSIFRQ0BQRgQCSIEDQIgBRAGDAELIAIhBUEYEAkiBA0BCyADBEAgA0EANgIEIANBDjYCAAtBAA8LIARCADcDECAEIAE3AwggBCAFNgIEIARBAToAACAEIAJFOgABIAAgBSABIAMQZUEASAR/IAQtAAEEQCAEKAIEEAYLIAQQBkEABSAECwubAgEDfyAALQAAQSBxRQRAAkAgASEDAkAgAiAAIgEoAhAiAAR/IAAFAn8gASABLQBKIgBBAWsgAHI6AEogASgCACIAQQhxBEAgASAAQSByNgIAQX8MAQsgAUIANwIEIAEgASgCLCIANgIcIAEgADYCFCABIAAgASgCMGo2AhBBAAsNASABKAIQCyABKAIUIgVrSwRAIAEgAyACIAEoAiQRAAAaDAILAn8gASwAS0F/SgRAIAIhAANAIAIgACIERQ0CGiADIARBAWsiAGotAABBCkcNAAsgASADIAQgASgCJBEAACAESQ0CIAMgBGohAyABKAIUIQUgAiAEawwBCyACCyEAIAUgAyAAEAcaIAEgASgCFCAAajYCFAsLCwvNBQEGfyAAKAIwIgNBhgJrIQYgACgCPCECIAMhAQNAIAAoAkQgAiAAKAJoIgRqayECIAEgBmogBE0EQCAAKAJIIgEgASADaiADEAcaAkAgAyAAKAJsIgFNBEAgACABIANrNgJsDAELIABCADcCbAsgACAAKAJoIANrIgE2AmggACAAKAJYIANrNgJYIAEgACgChC5JBEAgACABNgKELgsgAEH8gAEoAgARAwAgAiADaiECCwJAIAAoAgAiASgCBCIERQ0AIAAoAjwhBSAAIAIgBCACIARJGyICBH8gACgCSCAAKAJoaiAFaiEFIAEgBCACazYCBAJAAkACQAJAIAEoAhwiBCgCFEEBaw4CAQACCyAEQaABaiAFIAEoAgAgAkHcgAEoAgARCAAMAgsgASABKAIwIAUgASgCACACQcSAASgCABEEADYCMAwBCyAFIAEoAgAgAhAHGgsgASABKAIAIAJqNgIAIAEgASgCCCACajYCCCAAKAI8BSAFCyACaiICNgI8AkAgACgChC4iASACakEDSQ0AIAAoAmggAWshAQJAIAAoAnRBgQhPBEAgACAAIAAoAkggAWoiAi0AACACLQABIAAoAnwRAAA2AlQMAQsgAUUNACAAIAFBAWsgACgChAERAgAaCyAAKAKELiAAKAI8IgJBAUZrIgRFDQAgACABIAQgACgCgAERBQAgACAAKAKELiAEazYChC4gACgCPCECCyACQYUCSw0AIAAoAgAoAgRFDQAgACgCMCEBDAELCwJAIAAoAkQiAiAAKAJAIgNNDQAgAAJ/IAAoAjwgACgCaGoiASADSwRAIAAoAkggAWpBACACIAFrIgNBggIgA0GCAkkbIgMQGSABIANqDAELIAFBggJqIgEgA00NASAAKAJIIANqQQAgAiADayICIAEgA2siAyACIANJGyIDEBkgACgCQCADags2AkALC50CAQF/AkAgAAJ/IAAoAqAuIgFBwABGBEAgACgCBCAAKAIQaiAAKQOYLjcAACAAQgA3A5guIAAgACgCEEEIajYCEEEADAELIAFBIE4EQCAAKAIEIAAoAhBqIAApA5guPgAAIAAgAEGcLmo1AgA3A5guIAAgACgCEEEEajYCECAAIAAoAqAuQSBrIgE2AqAuCyABQRBOBEAgACgCBCAAKAIQaiAAKQOYLj0AACAAIAAoAhBBAmo2AhAgACAAKQOYLkIQiDcDmC4gACAAKAKgLkEQayIBNgKgLgsgAUEISA0BIAAgACgCECIBQQFqNgIQIAEgACgCBGogACk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kACQAJAAkACQAJAAkAgAC0ABQRAIAAtAABBAnFFDQELIAAoAjAQECAAQQA2AjAgAC0ABUUNAQsgAC0AAEEIcUUNAQsgACgCNBAcIABBADYCNCAALQAFRQ0BCyAALQAAQQRxRQ0BCyAAKAI4EBAgAEEANgI4IAAtAAVFDQELIAAtAABBgAFxRQ0BCyAAKAJUIgEEfyABQQAgARAiEBkgACgCVAVBAAsQBiAAQQA2AlQLC9wMAgl/AX4jAEFAaiIGJAACQAJAAkACQAJAIAEoAjBBABAjIgVBAkZBACABKAI4QQAQIyIEQQFGGw0AIAVBAUZBACAEQQJGGw0AIAVBAkciAw0BIARBAkcNAQsgASABLwEMQYAQcjsBDEEAIQMMAQsgASABLwEMQf/vA3E7AQxBACEFIANFBEBB9eABIAEoAjAgAEEIahBpIgVFDQILIAJBgAJxBEAgBSEDDAELIARBAkcEQCAFIQMMAQtB9cYBIAEoAjggAEEIahBpIgNFBEAgBRAcDAILIAMgBTYCAAsgASABLwEMQf7/A3EgAS8BUiIFQQBHcjsBDAJAAkACQAJAAn8CQAJAIAEpAyhC/v///w9WDQAgASkDIEL+////D1YNACACQYAEcUUNASABKQNIQv////8PVA0BCyAFQYECa0H//wNxQQNJIQdBAQwBCyAFQYECa0H//wNxIQQgAkGACnFBgApHDQEgBEEDSSEHQQALIQkgBkIcEBciBEUEQCAAQQhqIgAEQCAAQQA2AgQgAEEONgIACyADEBwMBQsgAkGACHEhBQJAAkAgAkGAAnEEQAJAIAUNACABKQMgQv////8PVg0AIAEpAyhCgICAgBBUDQMLIAQgASkDKBAYIAEpAyAhDAwBCwJAAkACQCAFDQAgASkDIEL/////D1YNACABKQMoIgxC/////w9WDQEgASkDSEKAgICAEFQNBAsgASkDKCIMQv////8PVA0BCyAEIAwQGAsgASkDICIMQv////8PWgRAIAQgDBAYCyABKQNIIgxC/////w9UDQELIAQgDBAYCyAELQAARQRAIABBCGoiAARAIABBADYCBCAAQRQ2AgALIAQQCCADEBwMBQtBASEKQQEgBC0AA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IQUgCCAEQQ9xIgNrIQggGiAErUIPg4ghHSABIBdrIgYgAjMBAiAaQX8gA3RBf3Otg3ynIgRPDQIgBCAGayIGIBlNDQEgBygCjEdFDQEgB0HR/gA2AgQgAEG5DDYCGAsgASECIAshBQwFCwJAIA5FBEAgDCARIAZraiEDDAELIAYgDk0EQCAMIA4gBmtqIQMMAQsgDCARIAYgDmsiBmtqIQMgBSAGTQ0AIAUgBmshBQJAAkAgASADTSABIA8gAWusIhogBq0iGyAaIBtUGyIapyIGaiICIANLcQ0AIAMgBmogAUsgASADT3ENACABIAMgBhAHGiACIQEMAQsgASADIAMgAWsiASABQR91IgFqIAFzIgIQByACaiEBIBogAq0iHn0iHFANACACIANqIQIDQAJAIBwgHiAcIB5UGyIbQiBUBEAgGyEaDAELIBsiGkIgfSIgQgWIQgF8QgODIh9QRQRAA0AgASACKQAANwAAIAEgAikAGDcAGCABIAIpABA3ABAgASACKQAINwAIIBpCIH0hGiACQSBqIQIgAUEgaiEBIB9CAX0iH0IAUg0ACwsgIELgAFQNAANAIAEgAikAADcAACABIAIpABg3ABggASACKQAQNwAQIAEgAikACDcACCABIAIpADg3ADggASACKQAwNwAwIAEgAikAKDcAKCABIAIpACA3ACAgASACKQBYNwBYIAEgAikAUDcAUCABIAIpAEg3AEggASACKQBANwBAIAEgAikAYDcAYCABIAIpAGg3AGggASACKQBwNwBwIAEgAikAeDcAeCACQYABaiECIAFBgAFqIQEgGkKAAX0iGkIfVg0ACwsgGkIQWgRAIAEgAikAADcAACABIAIpAAg3AAggGkIQfSEaIAJBEGohAiABQRBqIQELIBpCCFoEQCABIAIpAAA3AAAgGkIIfSEaIAJBCGohAiABQQhqIQELIBpCBFoEQCABIAIoAAA2AAAgGkIEfSEaIAJBBGohAiABQQRqIQELIBpCAloEQCABIAIvAAA7AAAgGkICfSEaIAJBAmohAiABQQJqIQELIBwgG30hHCAaUEUEQCABIAItAAA6AAAgAkEBaiECIAFBAWohAQsgHEIAUg0ACwsgDiEGIAwhA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IAJLcQ0AIAIgBCABEAcgAWohAgwDCyACIAQgAyADQR91IgFqIAFzIgEQByABaiECIBogAa0iHn0iHFANAiABIARqIQEDQAJAIBwgHiAcIB5UGyIbQiBUBEAgGyEaDAELIBsiGkIgfSIgQgWIQgF8QgODIh9QRQRAA0AgAiABKQAANwAAIAIgASkAGDcAGCACIAEpABA3ABAgAiABKQAINwAIIBpCIH0hGiABQSBqIQEgAkEgaiECIB9CAX0iH0IAUg0ACwsgIELgAFQNAANAIAIgASkAADcAACACIAEpABg3ABggAiABKQAQNwAQIAIgASkACDcACCACIAEpADg3ADggAiABKQAwNwAwIAIgASkAKDcAKCACIAEpACA3ACAgAiABKQBYNwBYIAIgASkAUDcAUCACIAEpAEg3AEggAiABKQBANwBAIAIgASkAYDcAYCACIAEpAGg3AGggAiABKQBwNwBwIAIgASkAeDcAeCABQYABaiEBIAJBgAFqIQIgGkKAAX0iGkIfVg0ACwsgGkIQWgRAIAIgASkAADcAACACIAEpAAg3AAggGkIQfSEaIAJBEGohAiABQRBqIQELIBpCCFoEQCACIAEpAAA3AAAgGkIIfSEaIAJBCGohAiABQQhqIQELIBpCBFoEQCACIAEoAAA2AAAgGkIEfSEaIAJBBGohAiABQQRqIQELIBpCAloEQCACIAEvAAA7AAAgGkICfSEaIAJBAmohAiABQQJqIQELIBwgG30hHCAaUEUEQCACIAEtAAA6AAAgAkEBaiECIAFBAWohAQsgHFBFDQALDAILAkAgASADTSABIA8gAWusIhogBa0iGyAaIBtUGyIapyIEaiICIANLcQ0AIAMgBGogAUsgASADT3ENACABIAMgBBAHGgwCCyABIAMgAyABayIBIAFBH3UiAWogAXMiARAHIAFqIQIgGiABrSIefSIcUA0BIAEgA2ohAQNAAkAgHCAeIBwgHlQbIhtCIFQEQCAbIRoMAQsgGyIaQiB9IiBCBYhCAXxCA4MiH1BFBEADQCACIAEpAAA3AAAgAiABKQAYNwAYIAIgASkAEDcAECACIAEpAAg3AAggGkIgfSEaIAFBIGohASACQSBqIQIgH0IBfSIfQgBSDQALCyAgQuAAVA0AA0AgAiABKQAANwAAIAIgASkAGDcAGCACIAEpABA3ABAgAiABKQAINwAIIAIgASkAODcAOCACIAEpADA3ADAgAiABKQAoNwAoIAIgASkAIDcAICACIAEpAFg3AFggAiABKQBQNwBQIAIgASkASDcASCACIAEpAEA3AEAgAiABKQBgNwBgIAIgASkAaDcAaCACIAEpAHA3AHAgAiABKQB4NwB4IAFBgAFqIQEgAkGAAWohAiAaQoABfSIaQh9WDQALCyAaQhBaBEAgAiABKQAANwAAIAIgASkACDcACCAaQhB9IRogAkEQaiECIAFBEGohAQsgGkIIWgRAIAIgASkAADcAACAaQgh9IRogAkEIaiECIAFBCGohAQsgGkIEWgRAIAIgASgAADYAACAaQgR9IRogAkEEaiECIAFBBGohAQsgGkICWgRAIAIgAS8AADsAACAaQgJ9IRogAkECaiECIAFBAmohAQsgHCAbfSEcIBpQRQRAIAIgAS0AADoAACACQQFqIQIgAUEBaiEBCyAcUEUNAAsMAQsCQAJAIBYEQAJAIAQgBUkEQCAHKAKYRyAESw0BCyABIARrIQMCQEEAIARrIgVBf0ogDyABa6wiGiAbIBogG1QbIhqnIgIgBUpxDQAgBUEBSCACIANqIAFLcQ0AIAEgAyACEAcgAmohAgwFCyABIAMgBCAEQR91IgFqIAFzIgEQByABaiECIBogAa0iHn0iHFANBCABIANqIQEDQAJAIBwgHiAcIB5UGyIbQiBUBEAgGyEaDAELIBsiGkIgfSIgQgWIQgF8QgODIh9QRQRAA0AgAiABKQAANwAAIAIgASkAGDcAGCACIAEpABA3ABAgAiABKQAINwAIIBpCIH0hGiABQSBqIQEgAkEgaiECIB9CAX0iH0IAUg0ACwsgIELgAFQNAANAIAIgASkAADcAACACIAEpABg3ABggAiABKQAQNwAQIAIgASkACDcACCACIAEpADg3ADggAiABKQAwNwAwIAIgASkAKDcAKCACIAEpACA3ACAgAiABKQBYNwBYIAIgASkAUDcAUCACIAEpAEg3AEggAiABKQBANwBAIAIgASkAYDcAYCACIAEpA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IQIMBgsgCiEBIAUhAwwFCyAKIQEgBSEDDAQLIAohASAFIQMMAwsgCiEBIAUhAwwCCyAKIQEgBSEDDAELIAohASAFIQMLAkACQCAGQRdNBEAgA0UNASADQQFrIQUgA0EHcSIEBEADQCABIAItAAA6AAAgA0EBayEDIAFBAWohASACQQFqIQIgBEEBayIEDQALCyAFQQdJDQEDQCABIAItAAA6AAAgASACLQABOgABIAEgAi0AAjoAAiABIAItAAM6AAMgASACLQAEOgAEIAEgAi0ABToABSABIAItAAY6AAYgASACLQAHOgAHIAFBCGohASACQQhqIQIgA0EIayIDDQALDAELIAMNAQsgASECDAELIAEgBCADED8hAgsgCyEFDAELIAEgAy0AAjoAACABQQFqIQILIAUgFE8NACACIBNJDQELCyAAIAI2AgwgACAFIAhBA3ZrIgE2AgAgACATIAJrQYMCajYCECAAIBQgAWtBDmo2AgQgByAIQQdxIgA2AogBIAcgHUJ/IACthkJ/hYM+AoQBC+cFAQR/IAMgAiACIANLGyEEIAAgAWshAgJAIABBB3FFDQAgBEUNACAAIAItAAA6AAAgA0EBayEGIAJBAWohAiAAQQFqIgdBB3FBACAEQQFrIgUbRQRAIAchACAFIQQgBiEDDAELIAAgAi0AADoAASADQQJrIQYgBEECayEFIAJBAWohAgJAIABBAmoiB0EHcUUNACAFRQ0AIAAgAi0AADoAAiADQQNrIQYgBEEDayEFIAJBAWohAgJAIABBA2oiB0EHcUUNACAFRQ0AIAAgAi0AADoAAyADQQRrIQYgBEEEayEFIAJBAWohAgJAIABBBGoiB0EHcUUNACAFRQ0AIAAgAi0AADoABCADQQVrIQYgBEEFayEFIAJBAWohAgJAIABBBWoiB0EHcUUNACAFRQ0AIAAgAi0AADoABSADQQZrIQYgBEEGayEFIAJBAWohAgJAIABBBmoiB0EHcUUNACAFRQ0AIAAgAi0AADoABiADQQdrIQYgBEEHayEFIAJBAWohAgJAIABBB2oiB0EHcUUNACAFRQ0AIAAgAi0AADoAByADQQhrIQMgBEEIayEEIABBCGohACACQQFqIQIM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AgQgAUEONgIAC0EADwsgAkIANwMIIAJBADYCACACQgA3AxAgAkIANwMYIAJCADcDICACQgA3ACUgAFAEQCACDwsCQCAAQv////8AVg0AIACnQQR0EAkiA0UNACACIAM2AgBBACEBQgEhBANAIAMgAUEEdGoiAUIANwIAIAFCADcABSAAIARSBEAgBKchASAEQgF8IQQMAQsLIAIgADcDCCACIAA3AxAgAg8LIAEEQCABQQA2AgQgAUEONgIAC0EAEBAgAhAGQQAL7gECA38BfiMAQRBrIgQkAAJAIARBDGpCBBAXIgNFBEBBfyECDAELAkAgAQRAIAJBgAZxIQUDQAJAIAUgASgCBHFFDQACQCADKQMIQgBUBEAgA0EAOgAADAELIANCADcDECADQQE6AAALIAMgAS8BCBANIAMgAS8BChANIAMtAABFBEAgAEEIaiIABEAgAEEANgIEIABBFDYCAAtBfyECDAQLQX8hAiAAIARBDGpCBBAbQQBIDQMgATMBCiIGUA0AIAAgASgCDCAGEBtBAEgNAwsgASgCACIBDQALC0EAIQILIAMQCAsgBEEQaiQAIAILPAEBfyAABEAgAUGABnEhAQNAIAEgACgCBHEEQCACIAAvAQpqQQRqIQILIAAoAgAiAA0ACwsgAkH//wNxC5wBAQN/IABFBEBBAA8LIAAhAwNAAn8CQAJAIAAvAQgiAUH04AFNBEAgAUEBRg0BIAFB9cYBRg0BDAILIAFBgbICRg0AIAFB9eABRw0BCyAAKAIAIQEgAEEANgIAIAAoAgwQBiAAEAYgASADIAAgA0YbIQMCQCACRQRAQQAhAgwBCyACIAE2AgALIAEMAQsgACICKAIACyIADQALIAMLsgQCBX8BfgJAAkACQCAAIAGtEBciAQRAIAEtAAANAUEAIQAMAgsgBARAIARBADYCBCAEQQ42AgALQQAPC0EAIQADQCABLQAABH4gASkDCCABKQMQfQVCAAtCBFQNASABEAwhByABIAEQDCIGrRATIghFBEBBACECIAQEQCAEQQA2AgQgBEEVNgIACyABEAggAEUNAwNAIAAoAgAhASAAKAIMEAYgABAGIAEiAA0ACwwDCwJAAkBBEBAJIgU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gATcDACAAIAJCEEEMEA5CP4enCyEAIAJBEGokACAAC9oDAQZ/IwBBEGsiBSQAIAUgAjYCDCMAQaABayIEJAAgBEEIakHA8ABBkAEQBxogBCAANgI0IAQgADYCHCAEQX4gAGsiA0H/////ByADQf////8HSRsiBjYCOCAEIAAgBmoiADYCJCAEIAA2AhggBEEIaiEAIwBB0AFrIgMkACADIAI2AswBIANBoAFqQQBBKBAZIAMgAygCzAE2AsgBAkBBACABIANByAFqIANB0ABqIANBoAFqEEpBAEgNACAAKAJMQQBOIQcgACgCACECIAAsAEpBAEwEQCAAIAJBX3E2AgALIAJBIHEhCAJ/IAAoAjAEQCAAIAEgA0HIAWogA0HQAGogA0GgAWoQSgwBCyAAQdAANgIwIAAgA0HQAGo2AhAgACADNgIcIAAgAzYCFCAAKAIsIQIgACADNgIsIAAgASADQcgBaiADQdAAaiADQaABahBKIAJFDQAaIABBAEEAIAAoAiQRAAAaIABBADYCMCAAIAI2AiwgAEEANgIcIABBADYCECAAKAIUGiAAQQA2AhRBAAsaIAAgACgCACAIcjYCACAHRQ0ACyADQdABaiQAIAYEQCAEKAIcIgAgACAEKAIYRmtBADoAAAsgBEGgAWokACAFQRBqJAALUwEDfwJAIAAoAgAsAABBMGtBCk8NAANAIAAoAgAiAiwAACEDIAAgAkEBajYCACABIANqQTBrIQEgAiwAAUEwa0EKTw0BIAFBCmwhAQwACwALIAELuwIAAkAgAUEUSw0AAkACQAJAAkACQAJAAkACQAJAAkAgAUEJaw4KAAECAwQFBgcICQoLIAIgAigCACIBQQRqNgIAIAAgASgCADYCAA8LIAIgAigCACIBQQRqNgIAIAAgATQCADcDAA8LIAIgAigCACIBQQRqNgIAIAAgATUCADcDAA8LIAIgAigCAEEHakF4cSIBQQhqNgIAIAAgASkDADcDAA8LIAIgAigCACIBQQRqNgIAIAAgATIBADcDAA8LIAIgAigCACIBQQRqNgIAIAAgATMBADcDAA8LIAIgAigCACIBQQRqNgIAIAAgATAAADcDAA8LIAIgAigCACIBQQR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RAIABBADYCDCAAQQ42AggLDAILIBggFX0hEyAVQv////8PViAUQv//A1ZyIApyQQFxBEAgBkGZEkEEECwgBkIsEBggBkEtEA0gBkEtEA0gBkEAEBIgBkEAEBIgBiAUEBggBiAUEBggBiATEBggBiAVEBggBkGUEkEEECwgBkEAEBIgBiAYEBggBkEBEBILIAZBnhJBBBAsIAZBABASIAYgFEL//wMgFEL//wNUG6dB//8DcSIBEA0gBiABEA0gBkF/IBOnIBNC/v///w9WGxASIAZBfyAVpyAVQv7///8PVhsQEiAGIABBJEEgIAAtACgbaigCACIDBH8gAy8BBAVBAAtB//8DcRANIAYtAABFBEAgAEEIagRAIABBADYCDCAAQRQ2AggLIAYQCAwCCyAAIAYoAgQgBi0AAAR+IAYpAxAFQgALEBshASAGEAggAUEASA0BIAMEQCAAIAMoAgAgAzMBBBAbQQBIDQILIBMhFwwBCyAAKAIAIQEgAEEIagRAIAAgASgCDDYCCCAAIAEoAhA2AgwLQn8hFwsgEUHwAGokACAXQgBTDQAgACgCABAfQj+HpyECCyALEAYgAkEASA0BAn8gACgCACIBKAIkQQFHBEAgAUEMagRAIAFBADYCECABQRI2AgwLQX8MAQsgASgCICICQQJPBEAgAUEMagRAIAFBADYCECABQR02AgwLQX8MAQsCQCACQQFHDQAgARAaQQBODQBBfwwBCyABQQBCAEEJEA5Cf1cEQCABQQI2AiRBfwwBCyABQQA2AiRBAAtFDQIgACgCACECIAQEQCAEIAIoAgw2AgAgBCACKAIQNgIECwwBCyALEAYLIAAoAlQQfCAAKAIAEENBfyECDAILIAAoAlQQfAsgABBLQQAhAgsgB0HAwABqJAAgAgtFAEHwgwFCADcDAEHogwFCADcDAEHggwFCADcDAEHYgwFCADcDAEHQgwFCADcDAEHIgwFCADcDAEHAgwFCADcDAEHAgwELoQMBCH8jAEGgAWsiAiQAIAAQMQJAAn8CQCAAKAIAIgFBAE4EQCABQbATKAIASA0BCyACIAE2AhAgAkEgakH2ESACQRBqEHZBASEGIAJBIGohBCACQSBqECIh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ASgCABEAAAs2AjALIAUoAhwiBhAwAkAgBSgCECIEIAYoAhAiASABIARLGyIBRQ0AIAUoAgwgBigCCCABEAcaIAUgBSgCDCABajYCDCAGIAYoAgggAWo2AgggBSAFKAIUIAFqNgIUIAUgBSgCECABazYCECAGIAYoAhAgAWsiATYCECABDQAgBiAGKAIENgIIC0EAIQRBACEJIAMoAhBFDQAMCgsgAygCHCgCJCEGIAMgAygCGCIBQQFqNgIYIAEgBmotAAAhASADIARBAWo2AhAgAygCBCAEaiABOgAAIAEEQCADKAIQIQQMAQsLIAMoAhwoAixFDQAgAygCECIGIAlNDQAgBQJ/IAUoAjAhBEEAIAMoAgQgCWoiAUUNABogBCABIAYgCWtB1IABKAIAEQAACzYCMAsgA0HnADYCIAsCQCADKAIcKAIsBEAgAygCDCADKAIQIgFBAmpJBH8gBRAKIAMoAhANAkEABSABCyADKAIEaiAFKAIwOwAAIAMgAygCEEECajYCECADQaABakHkgAEoAgARAQAaCyADQfEANgIgIAUQCiADKAIQRQ0BDAcLDAYLIAUoAgQNAQsgAygCPA0AIApFDQEgAygCIEGaBUYNAQsCfyADKAKIASIBRQRAIAMgChCFAQwBCwJAAkACQCADKAKMAUECaw4CAAECCwJ/AkADQAJAAkAgAygCPA0AIAMQLyADKAI8DQAgCg0BQQAMBAsgAygCSCADKAJoai0AACEEIAMgAygC8C0iAUEBajYC8C0gASADKALsLWpBADoAACADIAMoAvAtIgFBAWo2AvAtIAEgAygC7C1qQQA6AAAgAyADKALwLSIBQQFqNgLwLSABIAMoAuwtaiAEOgAAIAMgBEECdGoiASABLwHkAUEBajsB5AEgAyADKAI8QQFrNgI8IAMgAygCaEEBaiIBNgJoIAMoAvAtIAMoAvQtRw0BQQAhBCADIAMoAlgiBkEATgR/IAMoAkggBmoFQQALIAEgBmtBABAPIAMgAygCaDYCWCADKAIAEAogAygCACgCEA0BDAILCyADQQA2AoQuIApBBEYEQCADIAMoAlgiAUEATgR/IAMoAkggAWoFQQALIAMoAmggAWtBARAP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yADKAI8IARrNgI8IAMgAygCaCAEaiIENgJoCyADKALwLSADKAL0LUcNAUEAIQggAyADKAJYIgFBAE4EfyADKAJIIAFqBUEACyAEIAFrQQAQDyADIAMoAmg2AlggAygCABAKIAMoAgAoAhANAQwCCwsgA0EANgKELiAKQQRGBEAgAyADKAJYIgFBAE4EfyADKAJIIAFqBUEACyADKAJoIAFrQQEQDyADIAMoAmg2AlggAygCABAKQQNBAiADKAIAKAIQGwwCCyADKALwLQRAQQAhCCADIAMoAlgiAUEATgR/IAMoAkggAWoFQQALIAMoAmggAWtBABAPIAMgAygCaDYCWCADKAIAEAogAygCACgCEEUNAQtBASEICyAICwwBCyADIAogAUEMbEG42ABqKAIAEQIACyIBQX5xQQJGBEAgA0GaBTYCIAsgAUF9cUUEQEEAIQQgBSgCEA0CDAQLIAFBAUcNAAJAAkACQCAKQQFrDgUAAQEBAgELIAMpA5guISICfwJ+IAMoAqAuIgFBA2oiCUE/TQRAQgIgAa2GICKEDAELIAFBwABGBEAgAygCBCADKAIQaiAiNwAAIAMgAygCEEEIajYCEEICISJBCgwCCyADKAIEIAMoAhBqQgIgAa2GICKENwAAIAMgAygCEEEIajYCECABQT1rIQlCAkHAACABa62ICyEiIAlBB2ogCUE5SQ0AGiADKAIEIAMoAhBqICI3AAAgAyADKAIQQQhqNgIQQgAhIiAJQTlrCyEBIAMgIjcDmC4gAyABNgKgLiADEDAMAQsgA0EAQQBBABA5IApBA0cNACADKAJQQQBBgIAIEBkgAygCPA0AIANBADYChC4gA0EANgJYIANBADYCaAsgBRAKIAUoAhANAAwDC0EAIQQgCkEERw0AAkACfwJAAkAgAygCFEEBaw4CAQADCyAFIANBoAFqQeCAASgCABEBACIBNgIwIAMoAgQgAygCEGogATYAACADIAMoAhBBBGoiATYCECADKAIEIAFqIQQgBSgCCAwBCyADKAIEIAMoAhBqIQQgBSgCMCIBQRh0IAFBCHRBgID8B3FyIAFBCHZBgP4DcSABQRh2cnILIQEgBCABNgAAIAMgAygCEEEEaj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IAIoAihBgIAEQQIQKCEDIAFBgIACNgLoLSABQQA2AkAgASADNgJQIAEgAigCICACKAIoQYCAAkEEECgiAzYCBCABIAEoAugtIgRBAnQ2AgwCQAJAIAEoAkhFDQAgASgCTEUNACABKAJQRQ0AIAMNAQsgAUGaBTYCICACQejAACgCADYCGCACEIQBGkF8DAILIAFBADYCjAEgASAFNgKIASABQgA3AyggASADIARqNgLsLSABIARBA2xBA2s2AvQtQX4hAwJAIAJFDQAgAigCIEUNACACKAIkRQ0AIAIoAhwiAUUNACABKAIAIAJHDQACQAJAIAEoAiAiBEE5aw45AQICAgICAgICAgICAQICAgECAgICAgICAgICAgICAgICAgECAgICAgICAgICAgECAgICAgICAgIBAAsgBEGaBUYNACAEQSpHDQELIAJBAjYCLCACQQA2AgggAkIANwIUIAFBADYCECABIAEoAgQ2AgggASgCFCIDQX9MBEAgAUEAIANrIgM2AhQLIAFBOUEqIANBAkYbNgIgIAIgA0ECRgR/IAFBoAFqQeSAASgCABEBAAVBAQs2AjAgAUF+NgIkIAFBADYCoC4gAUIANwOYLiABQYgXakGg0wA2AgAgASABQcwVajYCgBcgAUH8FmpBjNMANgIAIAEgAUHYE2o2AvQWIAFB8BZqQfjSADYCACABIAFB5AFqNgLoFiABEIgBQQAhAwsgAw0AIAIoAhwiAiACKAIwQQF0NgJEQQAhAyACKAJQQQBBgIAIEBkgAiACKAKIASIEQQxsIgFBtNgAai8BADYClAEgAiABQbDYAGovAQA2ApABIAIgAUGy2ABqLwEANgJ4IAIgAUG22ABqLwEANgJ0QfiAASgCACEFQeyAASgCACEGQYCBASgCACEBIAJCADcCbCACQgA3AmQgAkEANgI8IAJBADYChC4gAkIANwJUIAJBKSABIARBCUYiARs2AnwgAkEqIAYgARs2AoABIAJBKyAFIAEbNgKEAQsgAwsFQXoLDAELAn9BekHrDC0AAEExRw0AGkF+IAJFDQAaIAJBADYCGCACKAIgIgNFBEAgAkEANgIoIAJBJzYCIEEnIQMLIAIoAiRFBEAgAkEoNgIk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IAAEQCAAQQA2AgQgAEEONgIACwwOCyABQgA3AwAgACgCECIBBEACQCABKAIoIgpFBEAgASkDGCEEDAELIApBADYCKCABKAIoQgA3AyAgASABKQMYIgIgASkDICIFIAIgBVYbIgQ3AxgLIAEpAwggBFYEQANAIAEoAgAgBKdBBHRqKAIAEAYgBEIBfCIEIAEpAwhUDQALCyABKAIAEAYgASgCBBAGIAEQBgsgACADNgIQQgAhBAwNCyAAKAIUIgEEQAJAIAEoAigiA0UEQCABKQMYIQIMAQsgA0EANgIoIAEoAihCADcDICABIAEpAxgiAiABKQMgIgUgAiAFVhsiAjcDGAsgASkDCCACVgRAA0AgASgCACACp0EEdGooAgAQBiACQgF8IgIgASkDCFQNAAsLIAEoAgAQBiABKAIEEAYgARAGCyAAQQA2AhQMDAsgACgCECIDKQM4IAMpAzAgASACIAAQRCIHQgBTDQogAyAHNwM4AkAgAykDCCIGQgF9IgJQDQAgAygCBCEAA0ACQCAHIAAgAiAEfUIBiCAEfCIFp0EDdGopAwBUBEAgBUIBfSECDAELIAUgBlEEQCAGIQUMAwsgACAFQgF8IgSnQQN0aikDACAHVg0CCyAEIQUgAiAEVg0ACwsgAyAFNwNAQgAhBAwLCyAAKAIUIgMpAzggAykDMCABIAIgABBEIgdCAFMNCSADIAc3AzgCQCADKQMIIgZCAX0iAlANACADKAIEIQADQAJAIAcgACACIAR9QgGIIAR8IgWnQQN0aikDAFQEQCAFQgF9IQIMAQsgBSAGUQRAIAYhBQwDCyAAIAVCAXwiBKdBA3RqKQMAIAdWDQILIAQhBSACIARWDQALCyADIAU3A0BCACEEDAoLIAJCN1gEQCAABEAgAEEANgIEIABBEjYCAAsMCQsgARAqIAEgACgCDDYCKCAAKAIQKQMwIQIgAUEANgIwIAEgAjcDICABIAI3AxggAULcATcDAEI4IQQMCQsgACABKAIANgIMDAgLIAtBQGtBfzYCACALQouAgICwAjcDOCALQoyAgIDQATcDMCALQo+AgICgATcDKCALQpGAgICQATcDICALQoeAgICAATcDGCALQoW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AAAJAAAACQAAAAoAAAAKAAAACwAAAAsAAAAMAAAADAAAAA0AAAANAEGA1gALIwIAAAADAAAABwAAAAAAAAAQERIACAcJBgoFCwQMAw0CDgEPAEHQ1gALTQEAAAABAAAAAQAAAAEAAAACAAAAAgAAAAIAAAACAAAAAwAAAAMAAAADAAAAAwAAAAQAAAAEAAAABAAAAAQAAAAFAAAABQAAAAUAAAAFAEHA1wALZQEAAAABAAAAAgAAAAIAAAADAAAAAwAAAAQAAAAEAAAABQAAAAUAAAAGAAAABgAAAAcAAAAHAAAACAAAAAgAAAAJAAAACQAAAAoAAAAKAAAACwAAAAsAAAAMAAAADAAAAA0AAAANAEG42AALASwAQcTYAAthLQAAAAQABAAIAAQALgAAAAQABgAQAAYALwAAAAQADAAgABgALwAAAAgAEAAgACAALwAAAAgAEACAAIAALwAAAAgAIACAAAABMAAAACAAgAACAQAEMAAAACAAAgECAQAQMABBsNkAC6UTAwAEAAUABgAHAAgACQAKAAsADQAPABEAEwAXABsAHwAjACsAMwA7AEMAUwBjAHMAgwCjAMMA4wACAQAAAAAAABAAEAAQABAAEAAQABAAEAARABEAEQARABIAEgASABIAEwATABMAEwAUABQAFAAUABUAFQAVABUAEABNAMoAAAABAAIAAwAEAAUABwAJAA0AEQAZACEAMQBBAGEAgQDBAAEBgQEBAgEDAQQBBgEIAQwBEAEYASABMAFAAWAAAAAAEAAQABAAEAARABEAEgASABMAEwAUABQAFQAVABYAFgAXABcAGAAYABkAGQAaABoAGwAbABwAHAAdAB0AQABAAGAHAAAACFAAAAgQABQIcwASBx8AAAhwAAAIMAAACcAAEAcKAAAIYAAACCAAAAmgAAAIAAAACIAAAAhAAAAJ4AAQBwYAAAhYAAAIGAAACZAAEwc7AAAIeAAACDgAAAnQABEHEQAACGgAAAgoAAAJsAAACAgAAAiIAAAISAAACfAAEAcEAAAIVAAACBQAFQjjABMHKwAACHQAAAg0AAAJyAARBw0AAAhkAAAIJAAACagAAAgEAAAIhAAACEQAAAnoABAHCAAACFw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BzZW5kIGFmdGVyIHNvY2tldCBzaHV0ZG93bgBPcGVyYXRpb24gYWxyZWFkeSBpbiBwcm9ncmVzcwBPcGVyYXRpb24gaW4gcHJvZ3Jlc3MAU3RhbGUgZmlsZSBoYW5kbGUAUmVtb3RlIEkvTyBlcnJvcgBRdW90YSBleGNlZWRlZABObyBtZWRpdW0gZm91bmQAV3JvbmcgbWVkaXVtIHR5cGUATm8gZXJyb3IgaW5mb3JtYXRpb24AQcCAAQuFARMAAAAUAAAAFQAAABYAAAAXAAAAGAAAABkAAAAaAAAAGwAAABwAAAAdAAAAHgAAAB8AAAAgAAAAIQAAACIAAAAjAAAAgERQADEAAAAyAAAAMwAAADQAAAA1AAAANgAAADcAAAA4AAAAOQAAADIAAAAzAAAANAAAADUAAAA2AAAANwAAADgAQfSCAQsCXEQAQbCDAQsQ/////////////////////w=="; - if (!isDataURI(wasmBinaryFile)) { - wasmBinaryFile = locateFile(wasmBinaryFile); - } - function getBinary(file) { - try { - if (file == wasmBinaryFile && wasmBinary) { - return new Uint8Array(wasmBinary); - } - var binary = tryParseAsDataURI(file); - if (binary) { - return binary; - } - if (readBinary) { - return readBinary(file); - } else { - throw "sync fetching of the wasm failed: you can preload it to Module['wasmBinary'] manually, or emcc.py will do that for you when generating HTML (but not JS)"; - } - } catch (err2) { - abort(err2); - } - } - function instantiateSync(file, info) { - var instance; - var module2; - var binary; - try { - binary = getBinary(file); - module2 = new WebAssembly.Module(binary); - instance = new WebAssembly.Instance(module2, info); - } catch (e) { - var str = e.toString(); - err("failed to compile wasm module: " + str); - if (str.includes("imported Memory") || str.includes("memory import")) { - err( - "Memory size incompatibility issues may be due to changing INITIAL_MEMORY at runtime to something too large. Use ALLOW_MEMORY_GROWTH to allow any size memory (and also make sure not to set INITIAL_MEMORY at runtime to something smaller than it was at compile time)." - ); - } - throw e; - } - return [instance, module2]; - } - function createWasm() { - var info = { a: asmLibraryArg }; - function receiveInstance(instance, module2) { - var exports3 = instance.exports; - Module["asm"] = exports3; - wasmMemory = Module["asm"]["g"]; - updateGlobalBufferAndViews(wasmMemory.buffer); - wasmTable = Module["asm"]["W"]; - addOnInit(Module["asm"]["h"]); - removeRunDependency(); - } - addRunDependency(); - if (Module["instantiateWasm"]) { - try { - var exports2 = Module["instantiateWasm"](info, receiveInstance); - return exports2; - } catch (e) { - err("Module.instantiateWasm callback failed with error: " + e); - return false; - } - } - var result = instantiateSync(wasmBinaryFile, info); - receiveInstance(result[0]); - return Module["asm"]; - } - function LE_HEAP_LOAD_F32(byteOffset) { - return HEAP_DATA_VIEW.getFloat32(byteOffset, true); - } - function LE_HEAP_LOAD_F64(byteOffset) { - return HEAP_DATA_VIEW.getFloat64(byteOffset, true); - } - function LE_HEAP_LOAD_I16(byteOffset) { - return HEAP_DATA_VIEW.getInt16(byteOffset, true); - } - function LE_HEAP_LOAD_I32(byteOffset) { - return HEAP_DATA_VIEW.getInt32(byteOffset, true); - } - function LE_HEAP_STORE_I32(byteOffset, value) { - HEAP_DATA_VIEW.setInt32(byteOffset, value, true); - } - function callRuntimeCallbacks(callbacks) { - while (callbacks.length > 0) { - var callback = callbacks.shift(); - if (typeof callback == "function") { - callback(Module); - continue; - } - var func = callback.func; - if (typeof func === "number") { - if (callback.arg === void 0) { - wasmTable.get(func)(); - } else { - wasmTable.get(func)(callback.arg); - } - } else { - func(callback.arg === void 0 ? null : callback.arg); - } - } - } - function _gmtime_r(time, tmPtr) { - var date = new Date(LE_HEAP_LOAD_I32((time >> 2) * 4) * 1e3); - LE_HEAP_STORE_I32((tmPtr >> 2) * 4, date.getUTCSeconds()); - LE_HEAP_STORE_I32((tmPtr + 4 >> 2) * 4, date.getUTCMinutes()); - LE_HEAP_STORE_I32((tmPtr + 8 >> 2) * 4, date.getUTCHours()); - LE_HEAP_STORE_I32((tmPtr + 12 >> 2) * 4, date.getUTCDate()); - LE_HEAP_STORE_I32((tmPtr + 16 >> 2) * 4, date.getUTCMonth()); - LE_HEAP_STORE_I32((tmPtr + 20 >> 2) * 4, date.getUTCFullYear() - 1900); - LE_HEAP_STORE_I32((tmPtr + 24 >> 2) * 4, date.getUTCDay()); - LE_HEAP_STORE_I32((tmPtr + 36 >> 2) * 4, 0); - LE_HEAP_STORE_I32((tmPtr + 32 >> 2) * 4, 0); - var start = Date.UTC(date.getUTCFullYear(), 0, 1, 0, 0, 0, 0); - var yday = (date.getTime() - start) / (1e3 * 60 * 60 * 24) | 0; - LE_HEAP_STORE_I32((tmPtr + 28 >> 2) * 4, yday); - if (!_gmtime_r.GMTString) - _gmtime_r.GMTString = allocateUTF8("GMT"); - LE_HEAP_STORE_I32((tmPtr + 40 >> 2) * 4, _gmtime_r.GMTString); - return tmPtr; - } - function ___gmtime_r(a0, a1) { - return _gmtime_r(a0, a1); - } - function _emscripten_memcpy_big(dest, src, num) { - HEAPU8.copyWithin(dest, src, src + num); - } - function emscripten_realloc_buffer(size) { - try { - wasmMemory.grow(size - buffer.byteLength + 65535 >>> 16); - updateGlobalBufferAndViews(wasmMemory.buffer); - return 1; - } catch (e) { - } - } - function _emscripten_resize_heap(requestedSize) { - var oldSize = HEAPU8.length; - requestedSize = requestedSize >>> 0; - var maxHeapSize = 2147483648; - if (requestedSize > maxHeapSize) { - return false; - } - for (var cutDown = 1; cutDown <= 4; cutDown *= 2) { - var overGrownHeapSize = oldSize * (1 + 0.2 / cutDown); - overGrownHeapSize = Math.min( - overGrownHeapSize, - requestedSize + 100663296 - ); - var newSize = Math.min( - maxHeapSize, - alignUp(Math.max(requestedSize, overGrownHeapSize), 65536) - ); - var replacement = emscripten_realloc_buffer(newSize); - if (replacement) { - return true; - } - } - return false; - } - function _setTempRet0(val) { - } - function _time(ptr) { - var ret = Date.now() / 1e3 | 0; - if (ptr) { - LE_HEAP_STORE_I32((ptr >> 2) * 4, ret); - } - return ret; - } - function _tzset() { - if (_tzset.called) - return; - _tzset.called = true; - var currentYear = new Date().getFullYear(); - var winter = new Date(currentYear, 0, 1); - var summer = new Date(currentYear, 6, 1); - var winterOffset = winter.getTimezoneOffset(); - var summerOffset = summer.getTimezoneOffset(); - var stdTimezoneOffset = Math.max(winterOffset, summerOffset); - LE_HEAP_STORE_I32((__get_timezone() >> 2) * 4, stdTimezoneOffset * 60); - LE_HEAP_STORE_I32( - (__get_daylight() >> 2) * 4, - Number(winterOffset != summerOffset) - ); - function extractZone(date) { - var match = date.toTimeString().match(/\(([A-Za-z ]+)\)$/); - return match ? match[1] : "GMT"; - } - var winterName = extractZone(winter); - var summerName = extractZone(summer); - var winterNamePtr = allocateUTF8(winterName); - var summerNamePtr = allocateUTF8(summerName); - if (summerOffset < winterOffset) { - LE_HEAP_STORE_I32((__get_tzname() >> 2) * 4, winterNamePtr); - LE_HEAP_STORE_I32((__get_tzname() + 4 >> 2) * 4, summerNamePtr); - } else { - LE_HEAP_STORE_I32((__get_tzname() >> 2) * 4, summerNamePtr); - LE_HEAP_STORE_I32((__get_tzname() + 4 >> 2) * 4, winterNamePtr); - } - } - function _timegm(tmPtr) { - _tzset(); - var time = Date.UTC( - LE_HEAP_LOAD_I32((tmPtr + 20 >> 2) * 4) + 1900, - LE_HEAP_LOAD_I32((tmPtr + 16 >> 2) * 4), - LE_HEAP_LOAD_I32((tmPtr + 12 >> 2) * 4), - LE_HEAP_LOAD_I32((tmPtr + 8 >> 2) * 4), - LE_HEAP_LOAD_I32((tmPtr + 4 >> 2) * 4), - LE_HEAP_LOAD_I32((tmPtr >> 2) * 4), - 0 - ); - var date = new Date(time); - LE_HEAP_STORE_I32((tmPtr + 24 >> 2) * 4, date.getUTCDay()); - var start = Date.UTC(date.getUTCFullYear(), 0, 1, 0, 0, 0, 0); - var yday = (date.getTime() - start) / (1e3 * 60 * 60 * 24) | 0; - LE_HEAP_STORE_I32((tmPtr + 28 >> 2) * 4, yday); - return date.getTime() / 1e3 | 0; - } - function intArrayFromBase64(s) { - { - var buf; - try { - buf = Buffer.from(s, "base64"); - } catch (_) { - buf = new Buffer(s, "base64"); - } - return new Uint8Array( - buf["buffer"], - buf["byteOffset"], - buf["byteLength"] - ); - } - } - function tryParseAsDataURI(filename) { - if (!isDataURI(filename)) { - return; - } - return intArrayFromBase64(filename.slice(dataURIPrefix.length)); - } - var asmLibraryArg = { - e: ___gmtime_r, - c: _emscripten_memcpy_big, - d: _emscripten_resize_heap, - a: _setTempRet0, - b: _time, - f: _timegm - }; - var asm = createWasm(); - Module["___wasm_call_ctors"] = asm["h"]; - Module["_zip_ext_count_symlinks"] = asm["i"]; - Module["_zip_file_get_external_attributes"] = asm["j"]; - Module["_zipstruct_statS"] = asm["k"]; - Module["_zipstruct_stat_size"] = asm["l"]; - Module["_zipstruct_stat_mtime"] = asm["m"]; - Module["_zipstruct_stat_crc"] = asm["n"]; - Module["_zipstruct_errorS"] = asm["o"]; - Module["_zipstruct_error_code_zip"] = asm["p"]; - Module["_zipstruct_stat_comp_size"] = asm["q"]; - Module["_zipstruct_stat_comp_method"] = asm["r"]; - Module["_zip_close"] = asm["s"]; - Module["_zip_delete"] = asm["t"]; - Module["_zip_dir_add"] = asm["u"]; - Module["_zip_discard"] = asm["v"]; - Module["_zip_error_init_with_code"] = asm["w"]; - Module["_zip_get_error"] = asm["x"]; - Module["_zip_file_get_error"] = asm["y"]; - Module["_zip_error_strerror"] = asm["z"]; - Module["_zip_fclose"] = asm["A"]; - Module["_zip_file_add"] = asm["B"]; - Module["_free"] = asm["C"]; - var _malloc = Module["_malloc"] = asm["D"]; - Module["_zip_source_error"] = asm["E"]; - Module["_zip_source_seek"] = asm["F"]; - Module["_zip_file_set_external_attributes"] = asm["G"]; - Module["_zip_file_set_mtime"] = asm["H"]; - Module["_zip_fopen_index"] = asm["I"]; - Module["_zip_fread"] = asm["J"]; - Module["_zip_get_name"] = asm["K"]; - Module["_zip_get_num_entries"] = asm["L"]; - Module["_zip_source_read"] = asm["M"]; - Module["_zip_name_locate"] = asm["N"]; - Module["_zip_open_from_source"] = asm["O"]; - Module["_zip_set_file_compression"] = asm["P"]; - Module["_zip_source_buffer"] = asm["Q"]; - Module["_zip_source_buffer_create"] = asm["R"]; - Module["_zip_source_close"] = asm["S"]; - Module["_zip_source_free"] = asm["T"]; - Module["_zip_source_keep"] = asm["U"]; - Module["_zip_source_open"] = asm["V"]; - Module["_zip_source_tell"] = asm["X"]; - Module["_zip_stat_index"] = asm["Y"]; - var __get_tzname = Module["__get_tzname"] = asm["Z"]; - var __get_daylight = Module["__get_daylight"] = asm["_"]; - var __get_timezone = Module["__get_timezone"] = asm["$"]; - var stackSave = Module["stackSave"] = asm["aa"]; - var stackRestore = Module["stackRestore"] = asm["ba"]; - var stackAlloc = Module["stackAlloc"] = asm["ca"]; - Module["cwrap"] = cwrap; - Module["getValue"] = getValue; - var calledRun; - dependenciesFulfilled = function runCaller() { - if (!calledRun) - run(); - if (!calledRun) - dependenciesFulfilled = runCaller; - }; - function run(args) { - if (runDependencies > 0) { - return; - } - preRun(); - if (runDependencies > 0) { - return; - } - function doRun() { - if (calledRun) - return; - calledRun = true; - Module["calledRun"] = true; - if (ABORT) - return; - initRuntime(); - readyPromiseResolve(Module); - if (Module["onRuntimeInitialized"]) - Module["onRuntimeInitialized"](); - postRun(); - } - if (Module["setStatus"]) { - Module["setStatus"]("Running..."); - setTimeout(function() { - setTimeout(function() { - Module["setStatus"](""); - }, 1); - doRun(); - }, 1); - } else { - doRun(); - } - } - Module["run"] = run; - if (Module["preInit"]) { - if (typeof Module["preInit"] == "function") - Module["preInit"] = [Module["preInit"]]; - while (Module["preInit"].length > 0) { - Module["preInit"].pop()(); - } - } - run(); - return createModule2; - }; -}(); -module.exports = createModule; -}(libzipSync)); - -const createModule = libzipSync.exports; - -const number64 = [ - `number`, - `number` -]; -var Errors = /* @__PURE__ */ ((Errors2) => { - Errors2[Errors2["ZIP_ER_OK"] = 0] = "ZIP_ER_OK"; - Errors2[Errors2["ZIP_ER_MULTIDISK"] = 1] = "ZIP_ER_MULTIDISK"; - Errors2[Errors2["ZIP_ER_RENAME"] = 2] = "ZIP_ER_RENAME"; - Errors2[Errors2["ZIP_ER_CLOSE"] = 3] = "ZIP_ER_CLOSE"; - Errors2[Errors2["ZIP_ER_SEEK"] = 4] = "ZIP_ER_SEEK"; - Errors2[Errors2["ZIP_ER_READ"] = 5] = "ZIP_ER_READ"; - Errors2[Errors2["ZIP_ER_WRITE"] = 6] = "ZIP_ER_WRITE"; - Errors2[Errors2["ZIP_ER_CRC"] = 7] = "ZIP_ER_CRC"; - Errors2[Errors2["ZIP_ER_ZIPCLOSED"] = 8] = "ZIP_ER_ZIPCLOSED"; - Errors2[Errors2["ZIP_ER_NOENT"] = 9] = "ZIP_ER_NOENT"; - Errors2[Errors2["ZIP_ER_EXISTS"] = 10] = "ZIP_ER_EXISTS"; - Errors2[Errors2["ZIP_ER_OPEN"] = 11] = "ZIP_ER_OPEN"; - Errors2[Errors2["ZIP_ER_TMPOPEN"] = 12] = "ZIP_ER_TMPOPEN"; - Errors2[Errors2["ZIP_ER_ZLIB"] = 13] = "ZIP_ER_ZLIB"; - Errors2[Errors2["ZIP_ER_MEMORY"] = 14] = "ZIP_ER_MEMORY"; - Errors2[Errors2["ZIP_ER_CHANGED"] = 15] = "ZIP_ER_CHANGED"; - Errors2[Errors2["ZIP_ER_COMPNOTSUPP"] = 16] = "ZIP_ER_COMPNOTSUPP"; - Errors2[Errors2["ZIP_ER_EOF"] = 17] = "ZIP_ER_EOF"; - Errors2[Errors2["ZIP_ER_INVAL"] = 18] = "ZIP_ER_INVAL"; - Errors2[Errors2["ZIP_ER_NOZIP"] = 19] = "ZIP_ER_NOZIP"; - Errors2[Errors2["ZIP_ER_INTERNAL"] = 20] = "ZIP_ER_INTERNAL"; - Errors2[Errors2["ZIP_ER_INCONS"] = 21] = "ZIP_ER_INCONS"; - Errors2[Errors2["ZIP_ER_REMOVE"] = 22] = "ZIP_ER_REMOVE"; - Errors2[Errors2["ZIP_ER_DELETED"] = 23] = "ZIP_ER_DELETED"; - Errors2[Errors2["ZIP_ER_ENCRNOTSUPP"] = 24] = "ZIP_ER_ENCRNOTSUPP"; - Errors2[Errors2["ZIP_ER_RDONLY"] = 25] = "ZIP_ER_RDONLY"; - Errors2[Errors2["ZIP_ER_NOPASSWD"] = 26] = "ZIP_ER_NOPASSWD"; - Errors2[Errors2["ZIP_ER_WRONGPASSWD"] = 27] = "ZIP_ER_WRONGPASSWD"; - Errors2[Errors2["ZIP_ER_OPNOTSUPP"] = 28] = "ZIP_ER_OPNOTSUPP"; - Errors2[Errors2["ZIP_ER_INUSE"] = 29] = "ZIP_ER_INUSE"; - Errors2[Errors2["ZIP_ER_TELL"] = 30] = "ZIP_ER_TELL"; - Errors2[Errors2["ZIP_ER_COMPRESSED_DATA"] = 31] = "ZIP_ER_COMPRESSED_DATA"; - return Errors2; -})(Errors || {}); -const makeInterface = (emZip) => ({ - get HEAPU8() { - return emZip.HEAPU8; - }, - errors: Errors, - SEEK_SET: 0, - SEEK_CUR: 1, - SEEK_END: 2, - ZIP_CHECKCONS: 4, - ZIP_EXCL: 2, - ZIP_RDONLY: 16, - ZIP_FL_OVERWRITE: 8192, - ZIP_FL_COMPRESSED: 4, - ZIP_OPSYS_DOS: 0, - ZIP_OPSYS_AMIGA: 1, - ZIP_OPSYS_OPENVMS: 2, - ZIP_OPSYS_UNIX: 3, - ZIP_OPSYS_VM_CMS: 4, - ZIP_OPSYS_ATARI_ST: 5, - ZIP_OPSYS_OS_2: 6, - ZIP_OPSYS_MACINTOSH: 7, - ZIP_OPSYS_Z_SYSTEM: 8, - ZIP_OPSYS_CPM: 9, - ZIP_OPSYS_WINDOWS_NTFS: 10, - ZIP_OPSYS_MVS: 11, - ZIP_OPSYS_VSE: 12, - ZIP_OPSYS_ACORN_RISC: 13, - ZIP_OPSYS_VFAT: 14, - ZIP_OPSYS_ALTERNATE_MVS: 15, - ZIP_OPSYS_BEOS: 16, - ZIP_OPSYS_TANDEM: 17, - ZIP_OPSYS_OS_400: 18, - ZIP_OPSYS_OS_X: 19, - ZIP_CM_DEFAULT: -1, - ZIP_CM_STORE: 0, - ZIP_CM_DEFLATE: 8, - uint08S: emZip._malloc(1), - uint32S: emZip._malloc(4), - malloc: emZip._malloc, - free: emZip._free, - getValue: emZip.getValue, - openFromSource: emZip.cwrap(`zip_open_from_source`, `number`, [`number`, `number`, `number`]), - close: emZip.cwrap(`zip_close`, `number`, [`number`]), - discard: emZip.cwrap(`zip_discard`, null, [`number`]), - getError: emZip.cwrap(`zip_get_error`, `number`, [`number`]), - getName: emZip.cwrap(`zip_get_name`, `string`, [`number`, `number`, `number`]), - getNumEntries: emZip.cwrap(`zip_get_num_entries`, `number`, [`number`, `number`]), - delete: emZip.cwrap(`zip_delete`, `number`, [`number`, `number`]), - statIndex: emZip.cwrap(`zip_stat_index`, `number`, [`number`, ...number64, `number`, `number`]), - fopenIndex: emZip.cwrap(`zip_fopen_index`, `number`, [`number`, ...number64, `number`]), - fread: emZip.cwrap(`zip_fread`, `number`, [`number`, `number`, `number`, `number`]), - fclose: emZip.cwrap(`zip_fclose`, `number`, [`number`]), - dir: { - add: emZip.cwrap(`zip_dir_add`, `number`, [`number`, `string`]) - }, - file: { - add: emZip.cwrap(`zip_file_add`, `number`, [`number`, `string`, `number`, `number`]), - getError: emZip.cwrap(`zip_file_get_error`, `number`, [`number`]), - getExternalAttributes: emZip.cwrap(`zip_file_get_external_attributes`, `number`, [`number`, ...number64, `number`, `number`, `number`]), - setExternalAttributes: emZip.cwrap(`zip_file_set_external_attributes`, `number`, [`number`, ...number64, `number`, `number`, `number`]), - setMtime: emZip.cwrap(`zip_file_set_mtime`, `number`, [`number`, ...number64, `number`, `number`]), - setCompression: emZip.cwrap(`zip_set_file_compression`, `number`, [`number`, ...number64, `number`, `number`]) - }, - ext: { - countSymlinks: emZip.cwrap(`zip_ext_count_symlinks`, `number`, [`number`]) - }, - error: { - initWithCode: emZip.cwrap(`zip_error_init_with_code`, null, [`number`, `number`]), - strerror: emZip.cwrap(`zip_error_strerror`, `string`, [`number`]) - }, - name: { - locate: emZip.cwrap(`zip_name_locate`, `number`, [`number`, `string`, `number`]) - }, - source: { - fromUnattachedBuffer: emZip.cwrap(`zip_source_buffer_create`, `number`, [`number`, ...number64, `number`, `number`]), - fromBuffer: emZip.cwrap(`zip_source_buffer`, `number`, [`number`, `number`, ...number64, `number`]), - free: emZip.cwrap(`zip_source_free`, null, [`number`]), - keep: emZip.cwrap(`zip_source_keep`, null, [`number`]), - open: emZip.cwrap(`zip_source_open`, `number`, [`number`]), - close: emZip.cwrap(`zip_source_close`, `number`, [`number`]), - seek: emZip.cwrap(`zip_source_seek`, `number`, [`number`, ...number64, `number`]), - tell: emZip.cwrap(`zip_source_tell`, `number`, [`number`]), - read: emZip.cwrap(`zip_source_read`, `number`, [`number`, `number`, `number`]), - error: emZip.cwrap(`zip_source_error`, `number`, [`number`]) - }, - struct: { - statS: emZip.cwrap(`zipstruct_statS`, `number`, []), - statSize: emZip.cwrap(`zipstruct_stat_size`, `number`, [`number`]), - statCompSize: emZip.cwrap(`zipstruct_stat_comp_size`, `number`, [`number`]), - statCompMethod: emZip.cwrap(`zipstruct_stat_comp_method`, `number`, [`number`]), - statMtime: emZip.cwrap(`zipstruct_stat_mtime`, `number`, [`number`]), - statCrc: emZip.cwrap(`zipstruct_stat_crc`, `number`, [`number`]), - errorS: emZip.cwrap(`zipstruct_errorS`, `number`, []), - errorCodeZip: emZip.cwrap(`zipstruct_error_code_zip`, `number`, [`number`]) - } -}); - -function getArchivePart(path, extension) { - let idx = path.indexOf(extension); - if (idx <= 0) - return null; - let nextCharIdx = idx; - while (idx >= 0) { - nextCharIdx = idx + extension.length; - if (path[nextCharIdx] === ppath.sep) - break; - if (path[idx - 1] === ppath.sep) - return null; - idx = path.indexOf(extension, nextCharIdx); - } - if (path.length > nextCharIdx && path[nextCharIdx] !== ppath.sep) - return null; - return path.slice(0, nextCharIdx); -} -class ZipOpenFS extends MountFS { - static async openPromise(fn, opts) { - const zipOpenFs = new ZipOpenFS(opts); - try { - return await fn(zipOpenFs); - } finally { - zipOpenFs.saveAndClose(); - } - } - constructor(opts = {}) { - const fileExtensions = opts.fileExtensions; - const readOnlyArchives = opts.readOnlyArchives; - const getMountPoint = typeof fileExtensions === `undefined` ? (path) => getArchivePart(path, `.zip`) : (path) => { - for (const extension of fileExtensions) { - const result = getArchivePart(path, extension); - if (result) { - return result; - } - } - return null; - }; - const factorySync = (baseFs, p) => { - return new ZipFS(p, { - baseFs, - readOnly: readOnlyArchives, - stats: baseFs.statSync(p) - }); - }; - const factoryPromise = async (baseFs, p) => { - const zipOptions = { - baseFs, - readOnly: readOnlyArchives, - stats: await baseFs.statPromise(p) - }; - return () => { - return new ZipFS(p, zipOptions); - }; - }; - super({ - ...opts, - factorySync, - factoryPromise, - getMountPoint - }); - } -} - -const DEFAULT_COMPRESSION_LEVEL = `mixed`; -function toUnixTimestamp(time) { - if (typeof time === `string` && String(+time) === time) - return +time; - if (typeof time === `number` && Number.isFinite(time)) { - if (time < 0) { - return Date.now() / 1e3; - } else { - return time; - } - } - if (nodeUtils.types.isDate(time)) - return time.getTime() / 1e3; - throw new Error(`Invalid time`); -} -function makeEmptyArchive() { - return Buffer.from([ - 80, - 75, - 5, - 6, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0 - ]); -} -class LibzipError extends Error { - constructor(message, code) { - super(message); - this.name = `Libzip Error`; - this.code = code; - } -} -class ZipFS extends BasePortableFakeFS { - constructor(source, opts = {}) { - super(); - this.listings = /* @__PURE__ */ new Map(); - this.entries = /* @__PURE__ */ new Map(); - this.fileSources = /* @__PURE__ */ new Map(); - this.fds = /* @__PURE__ */ new Map(); - this.nextFd = 0; - this.ready = false; - this.readOnly = false; - const pathOptions = opts; - this.level = typeof pathOptions.level !== `undefined` ? pathOptions.level : DEFAULT_COMPRESSION_LEVEL; - source ??= makeEmptyArchive(); - if (typeof source === `string`) { - const { baseFs = new NodeFS() } = pathOptions; - this.baseFs = baseFs; - this.path = source; - } else { - this.path = null; - this.baseFs = null; - } - if (opts.stats) { - this.stats = opts.stats; - } else { - if (typeof source === `string`) { - try { - this.stats = this.baseFs.statSync(source); - } catch (error) { - if (error.code === `ENOENT` && pathOptions.create) { - this.stats = makeDefaultStats(); - } else { - throw error; - } - } - } else { - this.stats = makeDefaultStats(); - } - } - this.libzip = getInstance(); - const errPtr = this.libzip.malloc(4); - try { - let flags = 0; - if (opts.readOnly) { - flags |= this.libzip.ZIP_RDONLY; - this.readOnly = true; - } - if (typeof source === `string`) - source = pathOptions.create ? makeEmptyArchive() : this.baseFs.readFileSync(source); - const lzSource = this.allocateUnattachedSource(source); - try { - this.zip = this.libzip.openFromSource(lzSource, flags, errPtr); - this.lzSource = lzSource; - } catch (error) { - this.libzip.source.free(lzSource); - throw error; - } - if (this.zip === 0) { - const error = this.libzip.struct.errorS(); - this.libzip.error.initWithCode(error, this.libzip.getValue(errPtr, `i32`)); - throw this.makeLibzipError(error); - } - } finally { - this.libzip.free(errPtr); - } - this.listings.set(PortablePath.root, /* @__PURE__ */ new Set()); - const entryCount = this.libzip.getNumEntries(this.zip, 0); - for (let t = 0; t < entryCount; ++t) { - const raw = this.libzip.getName(this.zip, t, 0); - if (ppath.isAbsolute(raw)) - continue; - const p = ppath.resolve(PortablePath.root, raw); - this.registerEntry(p, t); - if (raw.endsWith(`/`)) { - this.registerListing(p); - } - } - this.symlinkCount = this.libzip.ext.countSymlinks(this.zip); - if (this.symlinkCount === -1) - throw this.makeLibzipError(this.libzip.getError(this.zip)); - this.ready = true; - } - makeLibzipError(error) { - const errorCode = this.libzip.struct.errorCodeZip(error); - const strerror = this.libzip.error.strerror(error); - const libzipError = new LibzipError(strerror, this.libzip.errors[errorCode]); - if (errorCode === this.libzip.errors.ZIP_ER_CHANGED) - throw new Error(`Assertion failed: Unexpected libzip error: ${libzipError.message}`); - return libzipError; - } - getExtractHint(hints) { - for (const fileName of this.entries.keys()) { - const ext = this.pathUtils.extname(fileName); - if (hints.relevantExtensions.has(ext)) { - return true; - } - } - return false; - } - getAllFiles() { - return Array.from(this.entries.keys()); - } - getRealPath() { - if (!this.path) - throw new Error(`ZipFS don't have real paths when loaded from a buffer`); - return this.path; - } - prepareClose() { - if (!this.ready) - throw EBUSY(`archive closed, close`); - unwatchAllFiles(this); - } - getBufferAndClose() { - this.prepareClose(); - if (this.entries.size === 0) { - this.discardAndClose(); - return makeEmptyArchive(); - } - try { - this.libzip.source.keep(this.lzSource); - if (this.libzip.close(this.zip) === -1) - throw this.makeLibzipError(this.libzip.getError(this.zip)); - if (this.libzip.source.open(this.lzSource) === -1) - throw this.makeLibzipError(this.libzip.source.error(this.lzSource)); - if (this.libzip.source.seek(this.lzSource, 0, 0, this.libzip.SEEK_END) === -1) - throw this.makeLibzipError(this.libzip.source.error(this.lzSource)); - const size = this.libzip.source.tell(this.lzSource); - if (size === -1) - throw this.makeLibzipError(this.libzip.source.error(this.lzSource)); - if (this.libzip.source.seek(this.lzSource, 0, 0, this.libzip.SEEK_SET) === -1) - throw this.makeLibzipError(this.libzip.source.error(this.lzSource)); - const buffer = this.libzip.malloc(size); - if (!buffer) - throw new Error(`Couldn't allocate enough memory`); - try { - const rc = this.libzip.source.read(this.lzSource, buffer, size); - if (rc === -1) - throw this.makeLibzipError(this.libzip.source.error(this.lzSource)); - else if (rc < size) - throw new Error(`Incomplete read`); - else if (rc > size) - throw new Error(`Overread`); - let result = Buffer.from(this.libzip.HEAPU8.subarray(buffer, buffer + size)); - if (process.env.YARN_IS_TEST_ENV && process.env.YARN_ZIP_DATA_EPILOGUE) - result = Buffer.concat([result, Buffer.from(process.env.YARN_ZIP_DATA_EPILOGUE)]); - return result; - } finally { - this.libzip.free(buffer); - } - } finally { - this.libzip.source.close(this.lzSource); - this.libzip.source.free(this.lzSource); - this.ready = false; - } - } - discardAndClose() { - this.prepareClose(); - this.libzip.discard(this.zip); - this.ready = false; - } - saveAndClose() { - if (!this.path || !this.baseFs) - throw new Error(`ZipFS cannot be saved and must be discarded when loaded from a buffer`); - if (this.readOnly) { - this.discardAndClose(); - return; - } - const newMode = this.baseFs.existsSync(this.path) || this.stats.mode === DEFAULT_MODE ? void 0 : this.stats.mode; - this.baseFs.writeFileSync(this.path, this.getBufferAndClose(), { mode: newMode }); - this.ready = false; - } - resolve(p) { - return ppath.resolve(PortablePath.root, p); - } - async openPromise(p, flags, mode) { - return this.openSync(p, flags, mode); - } - openSync(p, flags, mode) { - const fd = this.nextFd++; - this.fds.set(fd, { cursor: 0, p }); - return fd; - } - hasOpenFileHandles() { - return !!this.fds.size; - } - async opendirPromise(p, opts) { - return this.opendirSync(p, opts); - } - opendirSync(p, opts = {}) { - const resolvedP = this.resolveFilename(`opendir '${p}'`, p); - if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) - throw ENOENT(`opendir '${p}'`); - const directoryListing = this.listings.get(resolvedP); - if (!directoryListing) - throw ENOTDIR(`opendir '${p}'`); - const entries = [...directoryListing]; - const fd = this.openSync(resolvedP, `r`); - const onClose = () => { - this.closeSync(fd); - }; - return opendir(this, resolvedP, entries, { onClose }); - } - async readPromise(fd, buffer, offset, length, position) { - return this.readSync(fd, buffer, offset, length, position); - } - readSync(fd, buffer, offset = 0, length = buffer.byteLength, position = -1) { - const entry = this.fds.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`read`); - const realPosition = position === -1 || position === null ? entry.cursor : position; - const source = this.readFileSync(entry.p); - source.copy(buffer, offset, realPosition, realPosition + length); - const bytesRead = Math.max(0, Math.min(source.length - realPosition, length)); - if (position === -1 || position === null) - entry.cursor += bytesRead; - return bytesRead; - } - async writePromise(fd, buffer, offset, length, position) { - if (typeof buffer === `string`) { - return this.writeSync(fd, buffer, position); - } else { - return this.writeSync(fd, buffer, offset, length, position); - } - } - writeSync(fd, buffer, offset, length, position) { - const entry = this.fds.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`read`); - throw new Error(`Unimplemented`); - } - async closePromise(fd) { - return this.closeSync(fd); - } - closeSync(fd) { - const entry = this.fds.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`read`); - this.fds.delete(fd); - } - createReadStream(p, { encoding } = {}) { - if (p === null) - throw new Error(`Unimplemented`); - const fd = this.openSync(p, `r`); - const stream$1 = Object.assign( - new stream.PassThrough({ - emitClose: true, - autoDestroy: true, - destroy: (error, callback) => { - clearImmediate(immediate); - this.closeSync(fd); - callback(error); - } - }), - { - close() { - stream$1.destroy(); - }, - bytesRead: 0, - path: p, - pending: false - } - ); - const immediate = setImmediate(async () => { - try { - const data = await this.readFilePromise(p, encoding); - stream$1.bytesRead = data.length; - stream$1.end(data); - } catch (error) { - stream$1.destroy(error); - } - }); - return stream$1; - } - createWriteStream(p, { encoding } = {}) { - if (this.readOnly) - throw EROFS(`open '${p}'`); - if (p === null) - throw new Error(`Unimplemented`); - const chunks = []; - const fd = this.openSync(p, `w`); - const stream$1 = Object.assign( - new stream.PassThrough({ - autoDestroy: true, - emitClose: true, - destroy: (error, callback) => { - try { - if (error) { - callback(error); - } else { - this.writeFileSync(p, Buffer.concat(chunks), encoding); - callback(null); - } - } catch (err) { - callback(err); - } finally { - this.closeSync(fd); - } - } - }), - { - close() { - stream$1.destroy(); - }, - bytesWritten: 0, - path: p, - pending: false - } - ); - stream$1.on(`data`, (chunk) => { - const chunkBuffer = Buffer.from(chunk); - stream$1.bytesWritten += chunkBuffer.length; - chunks.push(chunkBuffer); - }); - return stream$1; - } - async realpathPromise(p) { - return this.realpathSync(p); - } - realpathSync(p) { - const resolvedP = this.resolveFilename(`lstat '${p}'`, p); - if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) - throw ENOENT(`lstat '${p}'`); - return resolvedP; - } - async existsPromise(p) { - return this.existsSync(p); - } - existsSync(p) { - if (!this.ready) - throw EBUSY(`archive closed, existsSync '${p}'`); - if (this.symlinkCount === 0) { - const resolvedP2 = ppath.resolve(PortablePath.root, p); - return this.entries.has(resolvedP2) || this.listings.has(resolvedP2); - } - let resolvedP; - try { - resolvedP = this.resolveFilename(`stat '${p}'`, p, void 0, false); - } catch (error) { - return false; - } - if (resolvedP === void 0) - return false; - return this.entries.has(resolvedP) || this.listings.has(resolvedP); - } - async accessPromise(p, mode) { - return this.accessSync(p, mode); - } - accessSync(p, mode = fs.constants.F_OK) { - const resolvedP = this.resolveFilename(`access '${p}'`, p); - if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) - throw ENOENT(`access '${p}'`); - if (this.readOnly && mode & fs.constants.W_OK) { - throw EROFS(`access '${p}'`); - } - } - async statPromise(p, opts = { bigint: false }) { - if (opts.bigint) - return this.statSync(p, { bigint: true }); - return this.statSync(p); - } - statSync(p, opts = { bigint: false, throwIfNoEntry: true }) { - const resolvedP = this.resolveFilename(`stat '${p}'`, p, void 0, opts.throwIfNoEntry); - if (resolvedP === void 0) - return void 0; - if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) { - if (opts.throwIfNoEntry === false) - return void 0; - throw ENOENT(`stat '${p}'`); - } - if (p[p.length - 1] === `/` && !this.listings.has(resolvedP)) - throw ENOTDIR(`stat '${p}'`); - return this.statImpl(`stat '${p}'`, resolvedP, opts); - } - async fstatPromise(fd, opts) { - return this.fstatSync(fd, opts); - } - fstatSync(fd, opts) { - const entry = this.fds.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`fstatSync`); - const { p } = entry; - const resolvedP = this.resolveFilename(`stat '${p}'`, p); - if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) - throw ENOENT(`stat '${p}'`); - if (p[p.length - 1] === `/` && !this.listings.has(resolvedP)) - throw ENOTDIR(`stat '${p}'`); - return this.statImpl(`fstat '${p}'`, resolvedP, opts); - } - async lstatPromise(p, opts = { bigint: false }) { - if (opts.bigint) - return this.lstatSync(p, { bigint: true }); - return this.lstatSync(p); - } - lstatSync(p, opts = { bigint: false, throwIfNoEntry: true }) { - const resolvedP = this.resolveFilename(`lstat '${p}'`, p, false, opts.throwIfNoEntry); - if (resolvedP === void 0) - return void 0; - if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) { - if (opts.throwIfNoEntry === false) - return void 0; - throw ENOENT(`lstat '${p}'`); - } - if (p[p.length - 1] === `/` && !this.listings.has(resolvedP)) - throw ENOTDIR(`lstat '${p}'`); - return this.statImpl(`lstat '${p}'`, resolvedP, opts); - } - statImpl(reason, p, opts = {}) { - const entry = this.entries.get(p); - if (typeof entry !== `undefined`) { - const stat = this.libzip.struct.statS(); - const rc = this.libzip.statIndex(this.zip, entry, 0, 0, stat); - if (rc === -1) - throw this.makeLibzipError(this.libzip.getError(this.zip)); - const uid = this.stats.uid; - const gid = this.stats.gid; - const size = this.libzip.struct.statSize(stat) >>> 0; - const blksize = 512; - const blocks = Math.ceil(size / blksize); - const mtimeMs = (this.libzip.struct.statMtime(stat) >>> 0) * 1e3; - const atimeMs = mtimeMs; - const birthtimeMs = mtimeMs; - const ctimeMs = mtimeMs; - const atime = new Date(atimeMs); - const birthtime = new Date(birthtimeMs); - const ctime = new Date(ctimeMs); - const mtime = new Date(mtimeMs); - const type = this.listings.has(p) ? fs.constants.S_IFDIR : this.isSymbolicLink(entry) ? fs.constants.S_IFLNK : fs.constants.S_IFREG; - const defaultMode = type === fs.constants.S_IFDIR ? 493 : 420; - const mode = type | this.getUnixMode(entry, defaultMode) & 511; - const crc = this.libzip.struct.statCrc(stat); - const statInstance = Object.assign(new StatEntry(), { uid, gid, size, blksize, blocks, atime, birthtime, ctime, mtime, atimeMs, birthtimeMs, ctimeMs, mtimeMs, mode, crc }); - return opts.bigint === true ? convertToBigIntStats(statInstance) : statInstance; - } - if (this.listings.has(p)) { - const uid = this.stats.uid; - const gid = this.stats.gid; - const size = 0; - const blksize = 512; - const blocks = 0; - const atimeMs = this.stats.mtimeMs; - const birthtimeMs = this.stats.mtimeMs; - const ctimeMs = this.stats.mtimeMs; - const mtimeMs = this.stats.mtimeMs; - const atime = new Date(atimeMs); - const birthtime = new Date(birthtimeMs); - const ctime = new Date(ctimeMs); - const mtime = new Date(mtimeMs); - const mode = fs.constants.S_IFDIR | 493; - const crc = 0; - const statInstance = Object.assign(new StatEntry(), { uid, gid, size, blksize, blocks, atime, birthtime, ctime, mtime, atimeMs, birthtimeMs, ctimeMs, mtimeMs, mode, crc }); - return opts.bigint === true ? convertToBigIntStats(statInstance) : statInstance; - } - throw new Error(`Unreachable`); - } - getUnixMode(index, defaultMode) { - const rc = this.libzip.file.getExternalAttributes(this.zip, index, 0, 0, this.libzip.uint08S, this.libzip.uint32S); - if (rc === -1) - throw this.makeLibzipError(this.libzip.getError(this.zip)); - const opsys = this.libzip.getValue(this.libzip.uint08S, `i8`) >>> 0; - if (opsys !== this.libzip.ZIP_OPSYS_UNIX) - return defaultMode; - return this.libzip.getValue(this.libzip.uint32S, `i32`) >>> 16; - } - registerListing(p) { - const existingListing = this.listings.get(p); - if (existingListing) - return existingListing; - const parentListing = this.registerListing(ppath.dirname(p)); - parentListing.add(ppath.basename(p)); - const newListing = /* @__PURE__ */ new Set(); - this.listings.set(p, newListing); - return newListing; - } - registerEntry(p, index) { - const parentListing = this.registerListing(ppath.dirname(p)); - parentListing.add(ppath.basename(p)); - this.entries.set(p, index); - } - unregisterListing(p) { - this.listings.delete(p); - const parentListing = this.listings.get(ppath.dirname(p)); - parentListing?.delete(ppath.basename(p)); - } - unregisterEntry(p) { - this.unregisterListing(p); - const entry = this.entries.get(p); - this.entries.delete(p); - if (typeof entry === `undefined`) - return; - this.fileSources.delete(entry); - if (this.isSymbolicLink(entry)) { - this.symlinkCount--; - } - } - deleteEntry(p, index) { - this.unregisterEntry(p); - const rc = this.libzip.delete(this.zip, index); - if (rc === -1) { - throw this.makeLibzipError(this.libzip.getError(this.zip)); - } - } - resolveFilename(reason, p, resolveLastComponent = true, throwIfNoEntry = true) { - if (!this.ready) - throw EBUSY(`archive closed, ${reason}`); - let resolvedP = ppath.resolve(PortablePath.root, p); - if (resolvedP === `/`) - return PortablePath.root; - const fileIndex = this.entries.get(resolvedP); - if (resolveLastComponent && fileIndex !== void 0) { - if (this.symlinkCount !== 0 && this.isSymbolicLink(fileIndex)) { - const target = this.getFileSource(fileIndex).toString(); - return this.resolveFilename(reason, ppath.resolve(ppath.dirname(resolvedP), target), true, throwIfNoEntry); - } else { - return resolvedP; - } - } - while (true) { - const parentP = this.resolveFilename(reason, ppath.dirname(resolvedP), true, throwIfNoEntry); - if (parentP === void 0) - return parentP; - const isDir = this.listings.has(parentP); - const doesExist = this.entries.has(parentP); - if (!isDir && !doesExist) { - if (throwIfNoEntry === false) - return void 0; - throw ENOENT(reason); - } - if (!isDir) - throw ENOTDIR(reason); - resolvedP = ppath.resolve(parentP, ppath.basename(resolvedP)); - if (!resolveLastComponent || this.symlinkCount === 0) - break; - const index = this.libzip.name.locate(this.zip, resolvedP.slice(1), 0); - if (index === -1) - break; - if (this.isSymbolicLink(index)) { - const target = this.getFileSource(index).toString(); - resolvedP = ppath.resolve(ppath.dirname(resolvedP), target); - } else { - break; - } - } - return resolvedP; - } - allocateBuffer(content) { - if (!Buffer.isBuffer(content)) - content = Buffer.from(content); - const buffer = this.libzip.malloc(content.byteLength); - if (!buffer) - throw new Error(`Couldn't allocate enough memory`); - const heap = new Uint8Array(this.libzip.HEAPU8.buffer, buffer, content.byteLength); - heap.set(content); - return { buffer, byteLength: content.byteLength }; - } - allocateUnattachedSource(content) { - const error = this.libzip.struct.errorS(); - const { buffer, byteLength } = this.allocateBuffer(content); - const source = this.libzip.source.fromUnattachedBuffer(buffer, byteLength, 0, 1, error); - if (source === 0) { - this.libzip.free(error); - throw this.makeLibzipError(error); - } - return source; - } - allocateSource(content) { - const { buffer, byteLength } = this.allocateBuffer(content); - const source = this.libzip.source.fromBuffer(this.zip, buffer, byteLength, 0, 1); - if (source === 0) { - this.libzip.free(buffer); - throw this.makeLibzipError(this.libzip.getError(this.zip)); - } - return source; - } - setFileSource(p, content) { - const buffer = Buffer.isBuffer(content) ? content : Buffer.from(content); - const target = ppath.relative(PortablePath.root, p); - const lzSource = this.allocateSource(content); - try { - const newIndex = this.libzip.file.add(this.zip, target, lzSource, this.libzip.ZIP_FL_OVERWRITE); - if (newIndex === -1) - throw this.makeLibzipError(this.libzip.getError(this.zip)); - if (this.level !== `mixed`) { - const method = this.level === 0 ? this.libzip.ZIP_CM_STORE : this.libzip.ZIP_CM_DEFLATE; - const rc = this.libzip.file.setCompression(this.zip, newIndex, 0, method, this.level); - if (rc === -1) { - throw this.makeLibzipError(this.libzip.getError(this.zip)); - } - } - this.fileSources.set(newIndex, buffer); - return newIndex; - } catch (error) { - this.libzip.source.free(lzSource); - throw error; - } - } - isSymbolicLink(index) { - if (this.symlinkCount === 0) - return false; - const attrs = this.libzip.file.getExternalAttributes(this.zip, index, 0, 0, this.libzip.uint08S, this.libzip.uint32S); - if (attrs === -1) - throw this.makeLibzipError(this.libzip.getError(this.zip)); - const opsys = this.libzip.getValue(this.libzip.uint08S, `i8`) >>> 0; - if (opsys !== this.libzip.ZIP_OPSYS_UNIX) - return false; - const attributes = this.libzip.getValue(this.libzip.uint32S, `i32`) >>> 16; - return (attributes & fs.constants.S_IFMT) === fs.constants.S_IFLNK; - } - getFileSource(index, opts = { asyncDecompress: false }) { - const cachedFileSource = this.fileSources.get(index); - if (typeof cachedFileSource !== `undefined`) - return cachedFileSource; - const stat = this.libzip.struct.statS(); - const rc = this.libzip.statIndex(this.zip, index, 0, 0, stat); - if (rc === -1) - throw this.makeLibzipError(this.libzip.getError(this.zip)); - const size = this.libzip.struct.statCompSize(stat); - const compressionMethod = this.libzip.struct.statCompMethod(stat); - const buffer = this.libzip.malloc(size); - try { - const file = this.libzip.fopenIndex(this.zip, index, 0, this.libzip.ZIP_FL_COMPRESSED); - if (file === 0) - throw this.makeLibzipError(this.libzip.getError(this.zip)); - try { - const rc2 = this.libzip.fread(file, buffer, size, 0); - if (rc2 === -1) - throw this.makeLibzipError(this.libzip.file.getError(file)); - else if (rc2 < size) - throw new Error(`Incomplete read`); - else if (rc2 > size) - throw new Error(`Overread`); - const memory = this.libzip.HEAPU8.subarray(buffer, buffer + size); - const data = Buffer.from(memory); - if (compressionMethod === 0) { - this.fileSources.set(index, data); - return data; - } else if (opts.asyncDecompress) { - return new Promise((resolve, reject) => { - zlib__default.default.inflateRaw(data, (error, result) => { - if (error) { - reject(error); - } else { - this.fileSources.set(index, result); - resolve(result); - } - }); - }); - } else { - const decompressedData = zlib__default.default.inflateRawSync(data); - this.fileSources.set(index, decompressedData); - return decompressedData; - } - } finally { - this.libzip.fclose(file); - } - } finally { - this.libzip.free(buffer); - } - } - async fchmodPromise(fd, mask) { - return this.chmodPromise(this.fdToPath(fd, `fchmod`), mask); - } - fchmodSync(fd, mask) { - return this.chmodSync(this.fdToPath(fd, `fchmodSync`), mask); - } - async chmodPromise(p, mask) { - return this.chmodSync(p, mask); - } - chmodSync(p, mask) { - if (this.readOnly) - throw EROFS(`chmod '${p}'`); - mask &= 493; - const resolvedP = this.resolveFilename(`chmod '${p}'`, p, false); - const entry = this.entries.get(resolvedP); - if (typeof entry === `undefined`) - throw new Error(`Assertion failed: The entry should have been registered (${resolvedP})`); - const oldMod = this.getUnixMode(entry, fs.constants.S_IFREG | 0); - const newMod = oldMod & ~511 | mask; - const rc = this.libzip.file.setExternalAttributes(this.zip, entry, 0, 0, this.libzip.ZIP_OPSYS_UNIX, newMod << 16); - if (rc === -1) { - throw this.makeLibzipError(this.libzip.getError(this.zip)); - } - } - async fchownPromise(fd, uid, gid) { - return this.chownPromise(this.fdToPath(fd, `fchown`), uid, gid); - } - fchownSync(fd, uid, gid) { - return this.chownSync(this.fdToPath(fd, `fchownSync`), uid, gid); - } - async chownPromise(p, uid, gid) { - return this.chownSync(p, uid, gid); - } - chownSync(p, uid, gid) { - throw new Error(`Unimplemented`); - } - async renamePromise(oldP, newP) { - return this.renameSync(oldP, newP); - } - renameSync(oldP, newP) { - throw new Error(`Unimplemented`); - } - async copyFilePromise(sourceP, destP, flags) { - const { indexSource, indexDest, resolvedDestP } = this.prepareCopyFile(sourceP, destP, flags); - const source = await this.getFileSource(indexSource, { asyncDecompress: true }); - const newIndex = this.setFileSource(resolvedDestP, source); - if (newIndex !== indexDest) { - this.registerEntry(resolvedDestP, newIndex); - } - } - copyFileSync(sourceP, destP, flags = 0) { - const { indexSource, indexDest, resolvedDestP } = this.prepareCopyFile(sourceP, destP, flags); - const source = this.getFileSource(indexSource); - const newIndex = this.setFileSource(resolvedDestP, source); - if (newIndex !== indexDest) { - this.registerEntry(resolvedDestP, newIndex); - } - } - prepareCopyFile(sourceP, destP, flags = 0) { - if (this.readOnly) - throw EROFS(`copyfile '${sourceP} -> '${destP}'`); - if ((flags & fs.constants.COPYFILE_FICLONE_FORCE) !== 0) - throw ENOSYS(`unsupported clone operation`, `copyfile '${sourceP}' -> ${destP}'`); - const resolvedSourceP = this.resolveFilename(`copyfile '${sourceP} -> ${destP}'`, sourceP); - const indexSource = this.entries.get(resolvedSourceP); - if (typeof indexSource === `undefined`) - throw EINVAL(`copyfile '${sourceP}' -> '${destP}'`); - const resolvedDestP = this.resolveFilename(`copyfile '${sourceP}' -> ${destP}'`, destP); - const indexDest = this.entries.get(resolvedDestP); - if ((flags & (fs.constants.COPYFILE_EXCL | fs.constants.COPYFILE_FICLONE_FORCE)) !== 0 && typeof indexDest !== `undefined`) - throw EEXIST(`copyfile '${sourceP}' -> '${destP}'`); - return { - indexSource, - resolvedDestP, - indexDest - }; - } - async appendFilePromise(p, content, opts) { - if (this.readOnly) - throw EROFS(`open '${p}'`); - if (typeof opts === `undefined`) - opts = { flag: `a` }; - else if (typeof opts === `string`) - opts = { flag: `a`, encoding: opts }; - else if (typeof opts.flag === `undefined`) - opts = { flag: `a`, ...opts }; - return this.writeFilePromise(p, content, opts); - } - appendFileSync(p, content, opts = {}) { - if (this.readOnly) - throw EROFS(`open '${p}'`); - if (typeof opts === `undefined`) - opts = { flag: `a` }; - else if (typeof opts === `string`) - opts = { flag: `a`, encoding: opts }; - else if (typeof opts.flag === `undefined`) - opts = { flag: `a`, ...opts }; - return this.writeFileSync(p, content, opts); - } - fdToPath(fd, reason) { - const path = this.fds.get(fd)?.p; - if (typeof path === `undefined`) - throw EBADF(reason); - return path; - } - async writeFilePromise(p, content, opts) { - const { encoding, mode, index, resolvedP } = this.prepareWriteFile(p, opts); - if (index !== void 0 && typeof opts === `object` && opts.flag && opts.flag.includes(`a`)) - content = Buffer.concat([await this.getFileSource(index, { asyncDecompress: true }), Buffer.from(content)]); - if (encoding !== null) - content = content.toString(encoding); - const newIndex = this.setFileSource(resolvedP, content); - if (newIndex !== index) - this.registerEntry(resolvedP, newIndex); - if (mode !== null) { - await this.chmodPromise(resolvedP, mode); - } - } - writeFileSync(p, content, opts) { - const { encoding, mode, index, resolvedP } = this.prepareWriteFile(p, opts); - if (index !== void 0 && typeof opts === `object` && opts.flag && opts.flag.includes(`a`)) - content = Buffer.concat([this.getFileSource(index), Buffer.from(content)]); - if (encoding !== null) - content = content.toString(encoding); - const newIndex = this.setFileSource(resolvedP, content); - if (newIndex !== index) - this.registerEntry(resolvedP, newIndex); - if (mode !== null) { - this.chmodSync(resolvedP, mode); - } - } - prepareWriteFile(p, opts) { - if (typeof p === `number`) - p = this.fdToPath(p, `read`); - if (this.readOnly) - throw EROFS(`open '${p}'`); - const resolvedP = this.resolveFilename(`open '${p}'`, p); - if (this.listings.has(resolvedP)) - throw EISDIR(`open '${p}'`); - let encoding = null, mode = null; - if (typeof opts === `string`) { - encoding = opts; - } else if (typeof opts === `object`) { - ({ - encoding = null, - mode = null - } = opts); - } - const index = this.entries.get(resolvedP); - return { - encoding, - mode, - resolvedP, - index - }; - } - async unlinkPromise(p) { - return this.unlinkSync(p); - } - unlinkSync(p) { - if (this.readOnly) - throw EROFS(`unlink '${p}'`); - const resolvedP = this.resolveFilename(`unlink '${p}'`, p); - if (this.listings.has(resolvedP)) - throw EISDIR(`unlink '${p}'`); - const index = this.entries.get(resolvedP); - if (typeof index === `undefined`) - throw EINVAL(`unlink '${p}'`); - this.deleteEntry(resolvedP, index); - } - async utimesPromise(p, atime, mtime) { - return this.utimesSync(p, atime, mtime); - } - utimesSync(p, atime, mtime) { - if (this.readOnly) - throw EROFS(`utimes '${p}'`); - const resolvedP = this.resolveFilename(`utimes '${p}'`, p); - this.utimesImpl(resolvedP, mtime); - } - async lutimesPromise(p, atime, mtime) { - return this.lutimesSync(p, atime, mtime); - } - lutimesSync(p, atime, mtime) { - if (this.readOnly) - throw EROFS(`lutimes '${p}'`); - const resolvedP = this.resolveFilename(`utimes '${p}'`, p, false); - this.utimesImpl(resolvedP, mtime); - } - utimesImpl(resolvedP, mtime) { - if (this.listings.has(resolvedP)) { - if (!this.entries.has(resolvedP)) - this.hydrateDirectory(resolvedP); - } - const entry = this.entries.get(resolvedP); - if (entry === void 0) - throw new Error(`Unreachable`); - const rc = this.libzip.file.setMtime(this.zip, entry, 0, toUnixTimestamp(mtime), 0); - if (rc === -1) { - throw this.makeLibzipError(this.libzip.getError(this.zip)); - } - } - async mkdirPromise(p, opts) { - return this.mkdirSync(p, opts); - } - mkdirSync(p, { mode = 493, recursive = false } = {}) { - if (recursive) - return this.mkdirpSync(p, { chmod: mode }); - if (this.readOnly) - throw EROFS(`mkdir '${p}'`); - const resolvedP = this.resolveFilename(`mkdir '${p}'`, p); - if (this.entries.has(resolvedP) || this.listings.has(resolvedP)) - throw EEXIST(`mkdir '${p}'`); - this.hydrateDirectory(resolvedP); - this.chmodSync(resolvedP, mode); - return void 0; - } - async rmdirPromise(p, opts) { - return this.rmdirSync(p, opts); - } - rmdirSync(p, { recursive = false } = {}) { - if (this.readOnly) - throw EROFS(`rmdir '${p}'`); - if (recursive) { - this.removeSync(p); - return; - } - const resolvedP = this.resolveFilename(`rmdir '${p}'`, p); - const directoryListing = this.listings.get(resolvedP); - if (!directoryListing) - throw ENOTDIR(`rmdir '${p}'`); - if (directoryListing.size > 0) - throw ENOTEMPTY(`rmdir '${p}'`); - const index = this.entries.get(resolvedP); - if (typeof index === `undefined`) - throw EINVAL(`rmdir '${p}'`); - this.deleteEntry(p, index); - } - async rmPromise(p, opts) { - return this.rmSync(p, opts); - } - rmSync(p, { recursive = false } = {}) { - if (this.readOnly) - throw EROFS(`rm '${p}'`); - if (recursive) { - this.removeSync(p); - return; - } - const resolvedP = this.resolveFilename(`rm '${p}'`, p); - const directoryListing = this.listings.get(resolvedP); - if (!directoryListing) - throw ENOTDIR(`rm '${p}'`); - if (directoryListing.size > 0) - throw ENOTEMPTY(`rm '${p}'`); - const index = this.entries.get(resolvedP); - if (typeof index === `undefined`) - throw EINVAL(`rm '${p}'`); - this.deleteEntry(p, index); - } - hydrateDirectory(resolvedP) { - const index = this.libzip.dir.add(this.zip, ppath.relative(PortablePath.root, resolvedP)); - if (index === -1) - throw this.makeLibzipError(this.libzip.getError(this.zip)); - this.registerListing(resolvedP); - this.registerEntry(resolvedP, index); - return index; - } - async linkPromise(existingP, newP) { - return this.linkSync(existingP, newP); - } - linkSync(existingP, newP) { - throw EOPNOTSUPP(`link '${existingP}' -> '${newP}'`); - } - async symlinkPromise(target, p) { - return this.symlinkSync(target, p); - } - symlinkSync(target, p) { - if (this.readOnly) - throw EROFS(`symlink '${target}' -> '${p}'`); - const resolvedP = this.resolveFilename(`symlink '${target}' -> '${p}'`, p); - if (this.listings.has(resolvedP)) - throw EISDIR(`symlink '${target}' -> '${p}'`); - if (this.entries.has(resolvedP)) - throw EEXIST(`symlink '${target}' -> '${p}'`); - const index = this.setFileSource(resolvedP, target); - this.registerEntry(resolvedP, index); - const rc = this.libzip.file.setExternalAttributes(this.zip, index, 0, 0, this.libzip.ZIP_OPSYS_UNIX, (fs.constants.S_IFLNK | 511) << 16); - if (rc === -1) - throw this.makeLibzipError(this.libzip.getError(this.zip)); - this.symlinkCount += 1; - } - async readFilePromise(p, encoding) { - if (typeof encoding === `object`) - encoding = encoding ? encoding.encoding : void 0; - const data = await this.readFileBuffer(p, { asyncDecompress: true }); - return encoding ? data.toString(encoding) : data; - } - readFileSync(p, encoding) { - if (typeof encoding === `object`) - encoding = encoding ? encoding.encoding : void 0; - const data = this.readFileBuffer(p); - return encoding ? data.toString(encoding) : data; - } - readFileBuffer(p, opts = { asyncDecompress: false }) { - if (typeof p === `number`) - p = this.fdToPath(p, `read`); - const resolvedP = this.resolveFilename(`open '${p}'`, p); - if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) - throw ENOENT(`open '${p}'`); - if (p[p.length - 1] === `/` && !this.listings.has(resolvedP)) - throw ENOTDIR(`open '${p}'`); - if (this.listings.has(resolvedP)) - throw EISDIR(`read`); - const entry = this.entries.get(resolvedP); - if (entry === void 0) - throw new Error(`Unreachable`); - return this.getFileSource(entry, opts); - } - async readdirPromise(p, opts) { - return this.readdirSync(p, opts); - } - readdirSync(p, opts) { - const resolvedP = this.resolveFilename(`scandir '${p}'`, p); - if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) - throw ENOENT(`scandir '${p}'`); - const directoryListing = this.listings.get(resolvedP); - if (!directoryListing) - throw ENOTDIR(`scandir '${p}'`); - if (opts?.recursive) { - if (opts?.withFileTypes) { - const entries = Array.from(directoryListing, (name) => { - return Object.assign(this.statImpl(`lstat`, ppath.join(p, name)), { - name, - path: PortablePath.dot - }); - }); - for (const entry of entries) { - if (!entry.isDirectory()) - continue; - const subPath = ppath.join(entry.path, entry.name); - const subListing = this.listings.get(ppath.join(resolvedP, subPath)); - for (const child of subListing) { - entries.push(Object.assign(this.statImpl(`lstat`, ppath.join(p, subPath, child)), { - name: child, - path: subPath - })); - } - } - return entries; - } else { - const entries = [...directoryListing]; - for (const subPath of entries) { - const subListing = this.listings.get(ppath.join(resolvedP, subPath)); - if (typeof subListing === `undefined`) - continue; - for (const child of subListing) { - entries.push(ppath.join(subPath, child)); - } - } - return entries; - } - } else if (opts?.withFileTypes) { - return Array.from(directoryListing, (name) => { - return Object.assign(this.statImpl(`lstat`, ppath.join(p, name)), { - name, - path: void 0 - }); - }); - } else { - return [...directoryListing]; - } - } - async readlinkPromise(p) { - const entry = this.prepareReadlink(p); - return (await this.getFileSource(entry, { asyncDecompress: true })).toString(); - } - readlinkSync(p) { - const entry = this.prepareReadlink(p); - return this.getFileSource(entry).toString(); - } - prepareReadlink(p) { - const resolvedP = this.resolveFilename(`readlink '${p}'`, p, false); - if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) - throw ENOENT(`readlink '${p}'`); - if (p[p.length - 1] === `/` && !this.listings.has(resolvedP)) - throw ENOTDIR(`open '${p}'`); - if (this.listings.has(resolvedP)) - throw EINVAL(`readlink '${p}'`); - const entry = this.entries.get(resolvedP); - if (entry === void 0) - throw new Error(`Unreachable`); - if (!this.isSymbolicLink(entry)) - throw EINVAL(`readlink '${p}'`); - return entry; - } - async truncatePromise(p, len = 0) { - const resolvedP = this.resolveFilename(`open '${p}'`, p); - const index = this.entries.get(resolvedP); - if (typeof index === `undefined`) - throw EINVAL(`open '${p}'`); - const source = await this.getFileSource(index, { asyncDecompress: true }); - const truncated = Buffer.alloc(len, 0); - source.copy(truncated); - return await this.writeFilePromise(p, truncated); - } - truncateSync(p, len = 0) { - const resolvedP = this.resolveFilename(`open '${p}'`, p); - const index = this.entries.get(resolvedP); - if (typeof index === `undefined`) - throw EINVAL(`open '${p}'`); - const source = this.getFileSource(index); - const truncated = Buffer.alloc(len, 0); - source.copy(truncated); - return this.writeFileSync(p, truncated); - } - async ftruncatePromise(fd, len) { - return this.truncatePromise(this.fdToPath(fd, `ftruncate`), len); - } - ftruncateSync(fd, len) { - return this.truncateSync(this.fdToPath(fd, `ftruncateSync`), len); - } - watch(p, a, b) { - let persistent; - switch (typeof a) { - case `function`: - case `string`: - case `undefined`: - { - persistent = true; - } - break; - default: - { - ({ persistent = true } = a); - } - break; - } - if (!persistent) - return { on: () => { - }, close: () => { - } }; - const interval = setInterval(() => { - }, 24 * 60 * 60 * 1e3); - return { on: () => { - }, close: () => { - clearInterval(interval); - } }; - } - watchFile(p, a, b) { - const resolvedP = ppath.resolve(PortablePath.root, p); - return watchFile(this, resolvedP, a, b); - } - unwatchFile(p, cb) { - const resolvedP = ppath.resolve(PortablePath.root, p); - return unwatchFile(this, resolvedP, cb); - } -} - -setFactory(() => { - const emZip = createModule(); - return makeInterface(emZip); -}); - -var ErrorCode = /* @__PURE__ */ ((ErrorCode2) => { - ErrorCode2["API_ERROR"] = `API_ERROR`; - ErrorCode2["BUILTIN_NODE_RESOLUTION_FAILED"] = `BUILTIN_NODE_RESOLUTION_FAILED`; - ErrorCode2["EXPORTS_RESOLUTION_FAILED"] = `EXPORTS_RESOLUTION_FAILED`; - ErrorCode2["MISSING_DEPENDENCY"] = `MISSING_DEPENDENCY`; - ErrorCode2["MISSING_PEER_DEPENDENCY"] = `MISSING_PEER_DEPENDENCY`; - ErrorCode2["QUALIFIED_PATH_RESOLUTION_FAILED"] = `QUALIFIED_PATH_RESOLUTION_FAILED`; - ErrorCode2["INTERNAL"] = `INTERNAL`; - ErrorCode2["UNDECLARED_DEPENDENCY"] = `UNDECLARED_DEPENDENCY`; - ErrorCode2["UNSUPPORTED"] = `UNSUPPORTED`; - return ErrorCode2; -})(ErrorCode || {}); -const MODULE_NOT_FOUND_ERRORS = /* @__PURE__ */ new Set([ - "BUILTIN_NODE_RESOLUTION_FAILED" /* BUILTIN_NODE_RESOLUTION_FAILED */, - "MISSING_DEPENDENCY" /* MISSING_DEPENDENCY */, - "MISSING_PEER_DEPENDENCY" /* MISSING_PEER_DEPENDENCY */, - "QUALIFIED_PATH_RESOLUTION_FAILED" /* QUALIFIED_PATH_RESOLUTION_FAILED */, - "UNDECLARED_DEPENDENCY" /* UNDECLARED_DEPENDENCY */ -]); -function makeError(pnpCode, message, data = {}, code) { - code ??= MODULE_NOT_FOUND_ERRORS.has(pnpCode) ? `MODULE_NOT_FOUND` : pnpCode; - const propertySpec = { - configurable: true, - writable: true, - enumerable: false - }; - return Object.defineProperties(new Error(message), { - code: { - ...propertySpec, - value: code - }, - pnpCode: { - ...propertySpec, - value: pnpCode - }, - data: { - ...propertySpec, - value: data - } - }); -} -function getIssuerModule(parent) { - let issuer = parent; - while (issuer && (issuer.id === `[eval]` || issuer.id === `` || !issuer.filename)) - issuer = issuer.parent; - return issuer || null; -} -function getPathForDisplay(p) { - return npath.normalize(npath.fromPortablePath(p)); -} - -const [major, minor] = process.versions.node.split(`.`).map((value) => parseInt(value, 10)); -const WATCH_MODE_MESSAGE_USES_ARRAYS = major > 19 || major === 19 && minor >= 2 || major === 18 && minor >= 13; - -function readPackageScope(checkPath) { - const rootSeparatorIndex = checkPath.indexOf(npath.sep); - let separatorIndex; - do { - separatorIndex = checkPath.lastIndexOf(npath.sep); - checkPath = checkPath.slice(0, separatorIndex); - if (checkPath.endsWith(`${npath.sep}node_modules`)) - return false; - const pjson = readPackage(checkPath + npath.sep); - if (pjson) { - return { - data: pjson, - path: checkPath - }; - } - } while (separatorIndex > rootSeparatorIndex); - return false; -} -function readPackage(requestPath) { - const jsonPath = npath.resolve(requestPath, `package.json`); - if (!fs__default.default.existsSync(jsonPath)) - return null; - return JSON.parse(fs__default.default.readFileSync(jsonPath, `utf8`)); -} -function ERR_REQUIRE_ESM(filename, parentPath = null) { - const basename = parentPath && path__default.default.basename(filename) === path__default.default.basename(parentPath) ? filename : path__default.default.basename(filename); - const msg = `require() of ES Module ${filename}${parentPath ? ` from ${parentPath}` : ``} not supported. -Instead change the require of ${basename} in ${parentPath} to a dynamic import() which is available in all CommonJS modules.`; - const err = new Error(msg); - err.code = `ERR_REQUIRE_ESM`; - return err; -} -function reportRequiredFilesToWatchMode(files) { - if (process.env.WATCH_REPORT_DEPENDENCIES && process.send) { - files = files.map((filename) => npath.fromPortablePath(VirtualFS.resolveVirtual(npath.toPortablePath(filename)))); - if (WATCH_MODE_MESSAGE_USES_ARRAYS) { - process.send({ "watch:require": files }); - } else { - for (const filename of files) { - process.send({ "watch:require": filename }); - } - } - } -} - -function applyPatch(pnpapi, opts) { - let enableNativeHooks = true; - process.versions.pnp = String(pnpapi.VERSIONS.std); - const moduleExports = require$$0__default.default; - moduleExports.findPnpApi = (lookupSource) => { - const lookupPath = lookupSource instanceof URL ? url.fileURLToPath(lookupSource) : lookupSource; - const apiPath = opts.manager.findApiPathFor(lookupPath); - if (apiPath === null) - return null; - const apiEntry = opts.manager.getApiEntry(apiPath, true); - return apiEntry.instance.findPackageLocator(lookupPath) ? apiEntry.instance : null; - }; - function getRequireStack(parent) { - const requireStack = []; - for (let cursor = parent; cursor; cursor = cursor.parent) - requireStack.push(cursor.filename || cursor.id); - return requireStack; - } - const originalModuleLoad = require$$0.Module._load; - require$$0.Module._load = function(request, parent, isMain) { - if (request === `pnpapi`) { - const parentApiPath = opts.manager.getApiPathFromParent(parent); - if (parentApiPath) { - return opts.manager.getApiEntry(parentApiPath, true).instance; - } - } - return originalModuleLoad.call(require$$0.Module, request, parent, isMain); - }; - function getIssuerSpecsFromPaths(paths) { - return paths.map((path) => ({ - apiPath: opts.manager.findApiPathFor(path), - path, - module: null - })); - } - function getIssuerSpecsFromModule(module) { - if (module && module.id !== `` && module.id !== `internal/preload` && !module.parent && !module.filename && module.paths.length > 0) { - return [{ - apiPath: opts.manager.findApiPathFor(module.paths[0]), - path: module.paths[0], - module - }]; - } - const issuer = getIssuerModule(module); - if (issuer !== null) { - const path = npath.dirname(issuer.filename); - const apiPath = opts.manager.getApiPathFromParent(issuer); - return [{ apiPath, path, module }]; - } else { - const path = process.cwd(); - const apiPath = opts.manager.findApiPathFor(npath.join(path, `[file]`)) ?? opts.manager.getApiPathFromParent(null); - return [{ apiPath, path, module }]; - } - } - function makeFakeParent(path) { - const fakeParent = new require$$0.Module(``); - const fakeFilePath = npath.join(path, `[file]`); - fakeParent.paths = require$$0.Module._nodeModulePaths(fakeFilePath); - return fakeParent; - } - const pathRegExp = /^(?![a-zA-Z]:[\\/]|\\\\|\.{0,2}(?:\/|$))((?:@[^/]+\/)?[^/]+)\/*(.*|)$/; - const originalModuleResolveFilename = require$$0.Module._resolveFilename; - require$$0.Module._resolveFilename = function(request, parent, isMain, options) { - if (require$$0.isBuiltin(request)) - return request; - if (!enableNativeHooks) - return originalModuleResolveFilename.call(require$$0.Module, request, parent, isMain, options); - if (options && options.plugnplay === false) { - const { plugnplay, ...forwardedOptions } = options; - try { - enableNativeHooks = false; - return originalModuleResolveFilename.call(require$$0.Module, request, parent, isMain, forwardedOptions); - } finally { - enableNativeHooks = true; - } - } - if (options) { - const optionNames = new Set(Object.keys(options)); - optionNames.delete(`paths`); - optionNames.delete(`plugnplay`); - if (optionNames.size > 0) { - throw makeError( - ErrorCode.UNSUPPORTED, - `Some options passed to require() aren't supported by PnP yet (${Array.from(optionNames).join(`, `)})` - ); - } - } - const issuerSpecs = options && options.paths ? getIssuerSpecsFromPaths(options.paths) : getIssuerSpecsFromModule(parent); - if (request.match(pathRegExp) === null) { - const parentDirectory = parent?.filename != null ? npath.dirname(parent.filename) : null; - const absoluteRequest = npath.isAbsolute(request) ? request : parentDirectory !== null ? npath.resolve(parentDirectory, request) : null; - if (absoluteRequest !== null) { - const apiPath = parent && parentDirectory === npath.dirname(absoluteRequest) ? opts.manager.getApiPathFromParent(parent) : opts.manager.findApiPathFor(absoluteRequest); - if (apiPath !== null) { - issuerSpecs.unshift({ - apiPath, - path: parentDirectory, - module: null - }); - } - } - } - let firstError; - for (const { apiPath, path, module } of issuerSpecs) { - let resolution; - const issuerApi = apiPath !== null ? opts.manager.getApiEntry(apiPath, true).instance : null; - try { - if (issuerApi !== null) { - resolution = issuerApi.resolveRequest(request, path !== null ? `${path}/` : null); - } else { - if (path === null) - throw new Error(`Assertion failed: Expected the path to be set`); - resolution = originalModuleResolveFilename.call(require$$0.Module, request, module || makeFakeParent(path), isMain); - } - } catch (error) { - firstError = firstError || error; - continue; - } - if (resolution !== null) { - return resolution; - } - } - const requireStack = getRequireStack(parent); - Object.defineProperty(firstError, `requireStack`, { - configurable: true, - writable: true, - enumerable: false, - value: requireStack - }); - if (requireStack.length > 0) - firstError.message += ` -Require stack: -- ${requireStack.join(` -- `)}`; - if (typeof firstError.pnpCode === `string`) - Error.captureStackTrace(firstError); - throw firstError; - }; - const originalFindPath = require$$0.Module._findPath; - require$$0.Module._findPath = function(request, paths, isMain) { - if (request === `pnpapi`) - return false; - if (!enableNativeHooks) - return originalFindPath.call(require$$0.Module, request, paths, isMain); - const isAbsolute = npath.isAbsolute(request); - if (isAbsolute) - paths = [``]; - else if (!paths || paths.length === 0) - return false; - for (const path of paths) { - let resolution; - try { - const pnpApiPath = opts.manager.findApiPathFor(isAbsolute ? request : path); - if (pnpApiPath !== null) { - const api = opts.manager.getApiEntry(pnpApiPath, true).instance; - resolution = api.resolveRequest(request, path) || false; - } else { - resolution = originalFindPath.call(require$$0.Module, request, [path], isMain); - } - } catch (error) { - continue; - } - if (resolution) { - return resolution; - } - } - return false; - }; - const originalExtensionJSFunction = require$$0.Module._extensions[`.js`]; - require$$0.Module._extensions[`.js`] = function(module, filename) { - if (filename.endsWith(`.js`)) { - const pkg = readPackageScope(filename); - if (pkg && pkg.data?.type === `module`) { - const err = ERR_REQUIRE_ESM(filename, module.parent?.filename); - Error.captureStackTrace(err); - throw err; - } - } - originalExtensionJSFunction.call(this, module, filename); - }; - const originalDlopen = process.dlopen; - process.dlopen = function(...args) { - const [module, filename, ...rest] = args; - return originalDlopen.call( - this, - module, - npath.fromPortablePath(VirtualFS.resolveVirtual(npath.toPortablePath(filename))), - ...rest - ); - }; - const originalEmit = process.emit; - process.emit = function(name, data, ...args) { - if (name === `warning` && typeof data === `object` && data.name === `ExperimentalWarning` && (data.message.includes(`--experimental-loader`) || data.message.includes(`Custom ESM Loaders is an experimental feature`))) - return false; - return originalEmit.apply(process, arguments); - }; - patchFs(fs__default.default, new PosixFS(opts.fakeFs)); -} - -function hydrateRuntimeState(data, { basePath }) { - const portablePath = npath.toPortablePath(basePath); - const absolutePortablePath = ppath.resolve(portablePath); - const ignorePattern = data.ignorePatternData !== null ? new RegExp(data.ignorePatternData) : null; - const packageLocatorsByLocations = /* @__PURE__ */ new Map(); - const packageRegistry = new Map(data.packageRegistryData.map(([packageName, packageStoreData]) => { - return [packageName, new Map(packageStoreData.map(([packageReference, packageInformationData]) => { - if (packageName === null !== (packageReference === null)) - throw new Error(`Assertion failed: The name and reference should be null, or neither should`); - const discardFromLookup = packageInformationData.discardFromLookup ?? false; - const packageLocator = { name: packageName, reference: packageReference }; - const entry = packageLocatorsByLocations.get(packageInformationData.packageLocation); - if (!entry) { - packageLocatorsByLocations.set(packageInformationData.packageLocation, { locator: packageLocator, discardFromLookup }); - } else { - entry.discardFromLookup = entry.discardFromLookup && discardFromLookup; - if (!discardFromLookup) { - entry.locator = packageLocator; - } - } - let resolvedPackageLocation = null; - return [packageReference, { - packageDependencies: new Map(packageInformationData.packageDependencies), - packagePeers: new Set(packageInformationData.packagePeers), - linkType: packageInformationData.linkType, - discardFromLookup, - get packageLocation() { - return resolvedPackageLocation || (resolvedPackageLocation = ppath.join(absolutePortablePath, packageInformationData.packageLocation)); - } - }]; - }))]; - })); - const fallbackExclusionList = new Map(data.fallbackExclusionList.map(([packageName, packageReferences]) => { - return [packageName, new Set(packageReferences)]; - })); - const fallbackPool = new Map(data.fallbackPool); - const dependencyTreeRoots = data.dependencyTreeRoots; - const enableTopLevelFallback = data.enableTopLevelFallback; - return { - basePath: portablePath, - dependencyTreeRoots, - enableTopLevelFallback, - fallbackExclusionList, - fallbackPool, - ignorePattern, - packageLocatorsByLocations, - packageRegistry - }; -} - -const ArrayIsArray = Array.isArray; -const JSONStringify = JSON.stringify; -const ObjectGetOwnPropertyNames = Object.getOwnPropertyNames; -const ObjectPrototypeHasOwnProperty = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop); -const RegExpPrototypeExec = (obj, string) => RegExp.prototype.exec.call(obj, string); -const RegExpPrototypeSymbolReplace = (obj, ...rest) => RegExp.prototype[Symbol.replace].apply(obj, rest); -const StringPrototypeEndsWith = (str, ...rest) => String.prototype.endsWith.apply(str, rest); -const StringPrototypeIncludes = (str, ...rest) => String.prototype.includes.apply(str, rest); -const StringPrototypeLastIndexOf = (str, ...rest) => String.prototype.lastIndexOf.apply(str, rest); -const StringPrototypeIndexOf = (str, ...rest) => String.prototype.indexOf.apply(str, rest); -const StringPrototypeReplace = (str, ...rest) => String.prototype.replace.apply(str, rest); -const StringPrototypeSlice = (str, ...rest) => String.prototype.slice.apply(str, rest); -const StringPrototypeStartsWith = (str, ...rest) => String.prototype.startsWith.apply(str, rest); -const SafeMap = Map; -const JSONParse = JSON.parse; - -function createErrorType(code, messageCreator, errorType) { - return class extends errorType { - constructor(...args) { - super(messageCreator(...args)); - this.code = code; - this.name = `${errorType.name} [${code}]`; - } - }; -} -const ERR_PACKAGE_IMPORT_NOT_DEFINED = createErrorType( - `ERR_PACKAGE_IMPORT_NOT_DEFINED`, - (specifier, packagePath, base) => { - return `Package import specifier "${specifier}" is not defined${packagePath ? ` in package ${packagePath}package.json` : ``} imported from ${base}`; - }, - TypeError -); -const ERR_INVALID_MODULE_SPECIFIER = createErrorType( - `ERR_INVALID_MODULE_SPECIFIER`, - (request, reason, base = void 0) => { - return `Invalid module "${request}" ${reason}${base ? ` imported from ${base}` : ``}`; - }, - TypeError -); -const ERR_INVALID_PACKAGE_TARGET = createErrorType( - `ERR_INVALID_PACKAGE_TARGET`, - (pkgPath, key, target, isImport = false, base = void 0) => { - const relError = typeof target === `string` && !isImport && target.length && !StringPrototypeStartsWith(target, `./`); - if (key === `.`) { - assert__default.default(isImport === false); - return `Invalid "exports" main target ${JSONStringify(target)} defined in the package config ${pkgPath}package.json${base ? ` imported from ${base}` : ``}${relError ? `; targets must start with "./"` : ``}`; - } - return `Invalid "${isImport ? `imports` : `exports`}" target ${JSONStringify( - target - )} defined for '${key}' in the package config ${pkgPath}package.json${base ? ` imported from ${base}` : ``}${relError ? `; targets must start with "./"` : ``}`; - }, - Error -); -const ERR_INVALID_PACKAGE_CONFIG = createErrorType( - `ERR_INVALID_PACKAGE_CONFIG`, - (path, base, message) => { - return `Invalid package config ${path}${base ? ` while importing ${base}` : ``}${message ? `. ${message}` : ``}`; - }, - Error -); -const ERR_PACKAGE_PATH_NOT_EXPORTED = createErrorType( - "ERR_PACKAGE_PATH_NOT_EXPORTED", - (pkgPath, subpath, base = void 0) => { - if (subpath === ".") - return `No "exports" main defined in ${pkgPath}package.json${base ? ` imported from ${base}` : ""}`; - return `Package subpath '${subpath}' is not defined by "exports" in ${pkgPath}package.json${base ? ` imported from ${base}` : ""}`; - }, - Error -); - -function filterOwnProperties(source, keys) { - const filtered = /* @__PURE__ */ Object.create(null); - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - if (ObjectPrototypeHasOwnProperty(source, key)) { - filtered[key] = source[key]; - } - } - return filtered; -} - -const packageJSONCache = new SafeMap(); -function getPackageConfig(path, specifier, base, readFileSyncFn) { - const existing = packageJSONCache.get(path); - if (existing !== void 0) { - return existing; - } - const source = readFileSyncFn(path); - if (source === void 0) { - const packageConfig2 = { - pjsonPath: path, - exists: false, - main: void 0, - name: void 0, - type: "none", - exports: void 0, - imports: void 0 - }; - packageJSONCache.set(path, packageConfig2); - return packageConfig2; - } - let packageJSON; - try { - packageJSON = JSONParse(source); - } catch (error) { - throw new ERR_INVALID_PACKAGE_CONFIG( - path, - (base ? `"${specifier}" from ` : "") + url.fileURLToPath(base || specifier), - error.message - ); - } - let { imports, main, name, type } = filterOwnProperties(packageJSON, [ - "imports", - "main", - "name", - "type" - ]); - const exports = ObjectPrototypeHasOwnProperty(packageJSON, "exports") ? packageJSON.exports : void 0; - if (typeof imports !== "object" || imports === null) { - imports = void 0; - } - if (typeof main !== "string") { - main = void 0; - } - if (typeof name !== "string") { - name = void 0; - } - if (type !== "module" && type !== "commonjs") { - type = "none"; - } - const packageConfig = { - pjsonPath: path, - exists: true, - main, - name, - type, - exports, - imports - }; - packageJSONCache.set(path, packageConfig); - return packageConfig; -} -function getPackageScopeConfig(resolved, readFileSyncFn) { - let packageJSONUrl = new URL("./package.json", resolved); - while (true) { - const packageJSONPath2 = packageJSONUrl.pathname; - if (StringPrototypeEndsWith(packageJSONPath2, "node_modules/package.json")) { - break; - } - const packageConfig2 = getPackageConfig( - url.fileURLToPath(packageJSONUrl), - resolved, - void 0, - readFileSyncFn - ); - if (packageConfig2.exists) { - return packageConfig2; - } - const lastPackageJSONUrl = packageJSONUrl; - packageJSONUrl = new URL("../package.json", packageJSONUrl); - if (packageJSONUrl.pathname === lastPackageJSONUrl.pathname) { - break; - } - } - const packageJSONPath = url.fileURLToPath(packageJSONUrl); - const packageConfig = { - pjsonPath: packageJSONPath, - exists: false, - main: void 0, - name: void 0, - type: "none", - exports: void 0, - imports: void 0 - }; - packageJSONCache.set(packageJSONPath, packageConfig); - return packageConfig; -} - -function throwImportNotDefined(specifier, packageJSONUrl, base) { - throw new ERR_PACKAGE_IMPORT_NOT_DEFINED( - specifier, - packageJSONUrl && url.fileURLToPath(new URL(".", packageJSONUrl)), - url.fileURLToPath(base) - ); -} -function throwInvalidSubpath(subpath, packageJSONUrl, internal, base) { - const reason = `request is not a valid subpath for the "${internal ? "imports" : "exports"}" resolution of ${url.fileURLToPath(packageJSONUrl)}`; - throw new ERR_INVALID_MODULE_SPECIFIER( - subpath, - reason, - base && url.fileURLToPath(base) - ); -} -function throwInvalidPackageTarget(subpath, target, packageJSONUrl, internal, base) { - if (typeof target === "object" && target !== null) { - target = JSONStringify(target, null, ""); - } else { - target = `${target}`; - } - throw new ERR_INVALID_PACKAGE_TARGET( - url.fileURLToPath(new URL(".", packageJSONUrl)), - subpath, - target, - internal, - base && url.fileURLToPath(base) - ); -} -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; -const patternRegEx = /\*/g; -function resolvePackageTargetString(target, subpath, match, packageJSONUrl, base, pattern, internal, conditions) { - if (subpath !== "" && !pattern && target[target.length - 1] !== "/") - throwInvalidPackageTarget(match, target, packageJSONUrl, internal, base); - if (!StringPrototypeStartsWith(target, "./")) { - if (internal && !StringPrototypeStartsWith(target, "../") && !StringPrototypeStartsWith(target, "/")) { - let isURL = false; - try { - new URL(target); - isURL = true; - } catch { - } - if (!isURL) { - const exportTarget = pattern ? RegExpPrototypeSymbolReplace(patternRegEx, target, () => subpath) : target + subpath; - return exportTarget; - } - } - throwInvalidPackageTarget(match, target, packageJSONUrl, internal, base); - } - if (RegExpPrototypeExec( - invalidSegmentRegEx, - StringPrototypeSlice(target, 2) - ) !== null) - throwInvalidPackageTarget(match, target, packageJSONUrl, internal, base); - const resolved = new URL(target, packageJSONUrl); - const resolvedPath = resolved.pathname; - const packagePath = new URL(".", packageJSONUrl).pathname; - if (!StringPrototypeStartsWith(resolvedPath, packagePath)) - throwInvalidPackageTarget(match, target, packageJSONUrl, internal, base); - if (subpath === "") - return resolved; - if (RegExpPrototypeExec(invalidSegmentRegEx, subpath) !== null) { - const request = pattern ? StringPrototypeReplace(match, "*", () => subpath) : match + subpath; - throwInvalidSubpath(request, packageJSONUrl, internal, base); - } - if (pattern) { - return new URL( - RegExpPrototypeSymbolReplace(patternRegEx, resolved.href, () => subpath) - ); - } - return new URL(subpath, resolved); -} -function isArrayIndex(key) { - const keyNum = +key; - if (`${keyNum}` !== key) - return false; - return keyNum >= 0 && keyNum < 4294967295; -} -function resolvePackageTarget(packageJSONUrl, target, subpath, packageSubpath, base, pattern, internal, conditions) { - if (typeof target === "string") { - return resolvePackageTargetString( - target, - subpath, - packageSubpath, - packageJSONUrl, - base, - pattern, - internal); - } else if (ArrayIsArray(target)) { - if (target.length === 0) { - return null; - } - let lastException; - for (let i = 0; i < target.length; i++) { - const targetItem = target[i]; - let resolveResult; - try { - resolveResult = resolvePackageTarget( - packageJSONUrl, - targetItem, - subpath, - packageSubpath, - base, - pattern, - internal, - conditions - ); - } catch (e) { - lastException = e; - if (e.code === "ERR_INVALID_PACKAGE_TARGET") { - continue; - } - throw e; - } - if (resolveResult === void 0) { - continue; - } - if (resolveResult === null) { - lastException = null; - continue; - } - return resolveResult; - } - if (lastException === void 0 || lastException === null) - return lastException; - throw lastException; - } else if (typeof target === "object" && target !== null) { - const keys = ObjectGetOwnPropertyNames(target); - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - if (isArrayIndex(key)) { - throw new ERR_INVALID_PACKAGE_CONFIG( - url.fileURLToPath(packageJSONUrl), - base, - '"exports" cannot contain numeric property keys.' - ); - } - } - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - if (key === "default" || conditions.has(key)) { - const conditionalTarget = target[key]; - const resolveResult = resolvePackageTarget( - packageJSONUrl, - conditionalTarget, - subpath, - packageSubpath, - base, - pattern, - internal, - conditions - ); - if (resolveResult === void 0) - continue; - return resolveResult; - } - } - return void 0; - } else if (target === null) { - return null; - } - throwInvalidPackageTarget( - packageSubpath, - target, - packageJSONUrl, - internal, - base - ); -} -function patternKeyCompare(a, b) { - const aPatternIndex = StringPrototypeIndexOf(a, "*"); - const bPatternIndex = StringPrototypeIndexOf(b, "*"); - 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; -} -function isConditionalExportsMainSugar(exports, packageJSONUrl, base) { - if (typeof exports === "string" || ArrayIsArray(exports)) - return true; - if (typeof exports !== "object" || exports === null) - return false; - const keys = ObjectGetOwnPropertyNames(exports); - let isConditionalSugar = false; - let i = 0; - for (let j = 0; j < keys.length; j++) { - const key = keys[j]; - const curIsConditionalSugar = key === "" || key[0] !== "."; - if (i++ === 0) { - isConditionalSugar = curIsConditionalSugar; - } else if (isConditionalSugar !== curIsConditionalSugar) { - throw new ERR_INVALID_PACKAGE_CONFIG( - url.fileURLToPath(packageJSONUrl), - base, - `"exports" cannot contain some keys starting with '.' and some not. The exports object must either be an object of package subpath keys or an object of main entry condition name keys only.` - ); - } - } - return isConditionalSugar; -} -function throwExportsNotFound(subpath, packageJSONUrl, base) { - throw new ERR_PACKAGE_PATH_NOT_EXPORTED( - url.fileURLToPath(new URL(".", packageJSONUrl)), - subpath, - base && url.fileURLToPath(base) - ); -} -const emittedPackageWarnings = /* @__PURE__ */ new Set(); -function emitTrailingSlashPatternDeprecation(match, pjsonUrl, base) { - const pjsonPath = url.fileURLToPath(pjsonUrl); - if (emittedPackageWarnings.has(pjsonPath + "|" + match)) - return; - emittedPackageWarnings.add(pjsonPath + "|" + match); - process.emitWarning( - `Use of deprecated trailing slash pattern mapping "${match}" in the "exports" field module resolution of the package at ${pjsonPath}${base ? ` imported from ${url.fileURLToPath(base)}` : ""}. Mapping specifiers ending in "/" is no longer supported.`, - "DeprecationWarning", - "DEP0155" - ); -} -function packageExportsResolve({ - packageJSONUrl, - packageSubpath, - exports, - base, - conditions -}) { - if (isConditionalExportsMainSugar(exports, packageJSONUrl, base)) - exports = { ".": exports }; - if (ObjectPrototypeHasOwnProperty(exports, packageSubpath) && !StringPrototypeIncludes(packageSubpath, "*") && !StringPrototypeEndsWith(packageSubpath, "/")) { - const target = exports[packageSubpath]; - const resolveResult = resolvePackageTarget( - packageJSONUrl, - target, - "", - packageSubpath, - base, - false, - false, - conditions - ); - if (resolveResult == null) { - throwExportsNotFound(packageSubpath, packageJSONUrl, base); - } - return resolveResult; - } - let bestMatch = ""; - let bestMatchSubpath; - const keys = ObjectGetOwnPropertyNames(exports); - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - const patternIndex = StringPrototypeIndexOf(key, "*"); - if (patternIndex !== -1 && StringPrototypeStartsWith( - packageSubpath, - StringPrototypeSlice(key, 0, patternIndex) - )) { - if (StringPrototypeEndsWith(packageSubpath, "/")) - emitTrailingSlashPatternDeprecation( - packageSubpath, - packageJSONUrl, - base - ); - const patternTrailer = StringPrototypeSlice(key, patternIndex + 1); - if (packageSubpath.length >= key.length && StringPrototypeEndsWith(packageSubpath, patternTrailer) && patternKeyCompare(bestMatch, key) === 1 && StringPrototypeLastIndexOf(key, "*") === patternIndex) { - bestMatch = key; - bestMatchSubpath = StringPrototypeSlice( - packageSubpath, - patternIndex, - packageSubpath.length - patternTrailer.length - ); - } - } - } - if (bestMatch) { - const target = exports[bestMatch]; - const resolveResult = resolvePackageTarget( - packageJSONUrl, - target, - bestMatchSubpath, - bestMatch, - base, - true, - false, - conditions - ); - if (resolveResult == null) { - throwExportsNotFound(packageSubpath, packageJSONUrl, base); - } - return resolveResult; - } - throwExportsNotFound(packageSubpath, packageJSONUrl, base); -} -function packageImportsResolve({ name, base, conditions, readFileSyncFn }) { - if (name === "#" || StringPrototypeStartsWith(name, "#/") || StringPrototypeEndsWith(name, "/")) { - const reason = "is not a valid internal imports specifier name"; - throw new ERR_INVALID_MODULE_SPECIFIER(name, reason, url.fileURLToPath(base)); - } - let packageJSONUrl; - const packageConfig = getPackageScopeConfig(base, readFileSyncFn); - if (packageConfig.exists) { - packageJSONUrl = url.pathToFileURL(packageConfig.pjsonPath); - const imports = packageConfig.imports; - if (imports) { - if (ObjectPrototypeHasOwnProperty(imports, name) && !StringPrototypeIncludes(name, "*")) { - const resolveResult = resolvePackageTarget( - packageJSONUrl, - imports[name], - "", - name, - base, - false, - true, - conditions - ); - if (resolveResult != null) { - return resolveResult; - } - } else { - let bestMatch = ""; - let bestMatchSubpath; - const keys = ObjectGetOwnPropertyNames(imports); - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - const patternIndex = StringPrototypeIndexOf(key, "*"); - if (patternIndex !== -1 && StringPrototypeStartsWith( - name, - StringPrototypeSlice(key, 0, patternIndex) - )) { - const patternTrailer = StringPrototypeSlice(key, patternIndex + 1); - if (name.length >= key.length && StringPrototypeEndsWith(name, patternTrailer) && patternKeyCompare(bestMatch, key) === 1 && StringPrototypeLastIndexOf(key, "*") === patternIndex) { - bestMatch = key; - bestMatchSubpath = StringPrototypeSlice( - name, - patternIndex, - name.length - patternTrailer.length - ); - } - } - } - if (bestMatch) { - const target = imports[bestMatch]; - const resolveResult = resolvePackageTarget( - packageJSONUrl, - target, - bestMatchSubpath, - bestMatch, - base, - true, - true, - conditions - ); - if (resolveResult != null) { - return resolveResult; - } - } - } - } - } - throwImportNotDefined(name, packageJSONUrl, base); -} - -const flagSymbol = Symbol('arg flag'); - -class ArgError extends Error { - constructor(msg, code) { - super(msg); - this.name = 'ArgError'; - this.code = code; - - Object.setPrototypeOf(this, ArgError.prototype); - } -} - -function arg( - opts, - { - argv = process.argv.slice(2), - permissive = false, - stopAtPositional = false - } = {} -) { - if (!opts) { - throw new ArgError( - 'argument specification object is required', - 'ARG_CONFIG_NO_SPEC' - ); - } - - const result = { _: [] }; - - const aliases = {}; - const handlers = {}; - - for (const key of Object.keys(opts)) { - if (!key) { - throw new ArgError( - 'argument key cannot be an empty string', - 'ARG_CONFIG_EMPTY_KEY' - ); - } - - if (key[0] !== '-') { - throw new ArgError( - `argument key must start with '-' but found: '${key}'`, - 'ARG_CONFIG_NONOPT_KEY' - ); - } - - if (key.length === 1) { - throw new ArgError( - `argument key must have a name; singular '-' keys are not allowed: ${key}`, - 'ARG_CONFIG_NONAME_KEY' - ); - } - - if (typeof opts[key] === 'string') { - aliases[key] = opts[key]; - continue; - } - - let type = opts[key]; - let isFlag = false; - - if ( - Array.isArray(type) && - type.length === 1 && - typeof type[0] === 'function' - ) { - const [fn] = type; - type = (value, name, prev = []) => { - prev.push(fn(value, name, prev[prev.length - 1])); - return prev; - }; - isFlag = fn === Boolean || fn[flagSymbol] === true; - } else if (typeof type === 'function') { - isFlag = type === Boolean || type[flagSymbol] === true; - } else { - throw new ArgError( - `type missing or not a function or valid array type: ${key}`, - 'ARG_CONFIG_VAD_TYPE' - ); - } - - if (key[1] !== '-' && key.length > 2) { - throw new ArgError( - `short argument keys (with a single hyphen) must have only one character: ${key}`, - 'ARG_CONFIG_SHORTOPT_TOOLONG' - ); - } - - handlers[key] = [type, isFlag]; - } - - for (let i = 0, len = argv.length; i < len; i++) { - const wholeArg = argv[i]; - - if (stopAtPositional && result._.length > 0) { - result._ = result._.concat(argv.slice(i)); - break; - } - - if (wholeArg === '--') { - result._ = result._.concat(argv.slice(i + 1)); - break; - } - - if (wholeArg.length > 1 && wholeArg[0] === '-') { - /* eslint-disable operator-linebreak */ - const separatedArguments = - wholeArg[1] === '-' || wholeArg.length === 2 - ? [wholeArg] - : wholeArg - .slice(1) - .split('') - .map((a) => `-${a}`); - /* eslint-enable operator-linebreak */ - - for (let j = 0; j < separatedArguments.length; j++) { - const arg = separatedArguments[j]; - const [originalArgName, argStr] = - arg[1] === '-' ? arg.split(/=(.*)/, 2) : [arg, undefined]; - - let argName = originalArgName; - while (argName in aliases) { - argName = aliases[argName]; - } - - if (!(argName in handlers)) { - if (permissive) { - result._.push(arg); - continue; - } else { - throw new ArgError( - `unknown or unexpected option: ${originalArgName}`, - 'ARG_UNKNOWN_OPTION' - ); - } - } - - const [type, isFlag] = handlers[argName]; - - if (!isFlag && j + 1 < separatedArguments.length) { - throw new ArgError( - `option requires argument (but was followed by another short argument): ${originalArgName}`, - 'ARG_MISSING_REQUIRED_SHORTARG' - ); - } - - if (isFlag) { - result[argName] = type(true, argName, result[argName]); - } else if (argStr === undefined) { - if ( - argv.length < i + 2 || - (argv[i + 1].length > 1 && - argv[i + 1][0] === '-' && - !( - argv[i + 1].match(/^-?\d*(\.(?=\d))?\d*$/) && - (type === Number || - // eslint-disable-next-line no-undef - (typeof BigInt !== 'undefined' && type === BigInt)) - )) - ) { - const extended = - originalArgName === argName ? '' : ` (alias for ${argName})`; - throw new ArgError( - `option requires argument: ${originalArgName}${extended}`, - 'ARG_MISSING_REQUIRED_LONGARG' - ); - } - - result[argName] = type(argv[i + 1], argName, result[argName]); - ++i; - } else { - result[argName] = type(argStr, argName, result[argName]); - } - } - } else { - result._.push(wholeArg); - } - } - - return result; -} - -arg.flag = (fn) => { - fn[flagSymbol] = true; - return fn; -}; - -// Utility types -arg.COUNT = arg.flag((v, name, existingCount) => (existingCount || 0) + 1); - -// Expose error class -arg.ArgError = ArgError; - -var arg_1 = arg; - -/** - @license - The MIT License (MIT) - - Copyright (c) 2014 Blake Embrey (hello@blakeembrey.com) - - 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. -*/ -function getOptionValue(opt) { - parseOptions(); - return options[opt]; -} -let options; -function parseOptions() { - if (!options) { - options = { - "--conditions": [], - ...parseArgv(getNodeOptionsEnvArgv()), - ...parseArgv(process.execArgv) - }; - } -} -function parseArgv(argv) { - return arg_1( - { - "--conditions": [String], - "-C": "--conditions" - }, - { - argv, - permissive: true - } - ); -} -function getNodeOptionsEnvArgv() { - const errors = []; - const envArgv = ParseNodeOptionsEnvVar(process.env.NODE_OPTIONS || "", errors); - if (errors.length !== 0) ; - return envArgv; -} -function ParseNodeOptionsEnvVar(node_options, errors) { - const env_argv = []; - let is_in_string = false; - let will_start_new_arg = true; - for (let index = 0; index < node_options.length; ++index) { - let c = node_options[index]; - if (c === "\\" && is_in_string) { - if (index + 1 === node_options.length) { - errors.push("invalid value for NODE_OPTIONS (invalid escape)\n"); - return env_argv; - } else { - c = node_options[++index]; - } - } else if (c === " " && !is_in_string) { - will_start_new_arg = true; - continue; - } else if (c === '"') { - is_in_string = !is_in_string; - continue; - } - if (will_start_new_arg) { - env_argv.push(c); - will_start_new_arg = false; - } else { - env_argv[env_argv.length - 1] += c; - } - } - if (is_in_string) { - errors.push("invalid value for NODE_OPTIONS (unterminated string)\n"); - } - return env_argv; -} - -function makeApi(runtimeState, opts) { - const alwaysWarnOnFallback = Number(process.env.PNP_ALWAYS_WARN_ON_FALLBACK) > 0; - const debugLevel = Number(process.env.PNP_DEBUG_LEVEL); - const pathRegExp = /^(?![a-zA-Z]:[\\/]|\\\\|\.{0,2}(?:\/|$))((?:node:)?(?:@[^/]+\/)?[^/]+)\/*(.*|)$/; - const isStrictRegExp = /^(\/|\.{1,2}(\/|$))/; - const isDirRegExp = /\/$/; - const isRelativeRegexp = /^\.{0,2}\//; - const topLevelLocator = { name: null, reference: null }; - const fallbackLocators = []; - const emittedWarnings = /* @__PURE__ */ new Set(); - if (runtimeState.enableTopLevelFallback === true) - fallbackLocators.push(topLevelLocator); - if (opts.compatibilityMode !== false) { - for (const name of [`react-scripts`, `gatsby`]) { - const packageStore = runtimeState.packageRegistry.get(name); - if (packageStore) { - for (const reference of packageStore.keys()) { - if (reference === null) { - throw new Error(`Assertion failed: This reference shouldn't be null`); - } else { - fallbackLocators.push({ name, reference }); - } - } - } - } - } - const { - ignorePattern, - packageRegistry, - packageLocatorsByLocations - } = runtimeState; - function makeLogEntry(name, args) { - return { - fn: name, - args, - error: null, - result: null - }; - } - function trace(entry) { - const colors = process.stderr?.hasColors?.() ?? process.stdout.isTTY; - const c = (n, str) => `\x1B[${n}m${str}\x1B[0m`; - const error = entry.error; - if (error) - console.error(c(`31;1`, `\u2716 ${entry.error?.message.replace(/\n.*/s, ``)}`)); - else - console.error(c(`33;1`, `\u203C Resolution`)); - if (entry.args.length > 0) - console.error(); - for (const arg of entry.args) - console.error(` ${c(`37;1`, `In \u2190`)} ${nodeUtils.inspect(arg, { colors, compact: true })}`); - if (entry.result) { - console.error(); - console.error(` ${c(`37;1`, `Out \u2192`)} ${nodeUtils.inspect(entry.result, { colors, compact: true })}`); - } - const stack = new Error().stack.match(/(?<=^ +)at.*/gm)?.slice(2) ?? []; - if (stack.length > 0) { - console.error(); - for (const line of stack) { - console.error(` ${c(`38;5;244`, line)}`); - } - } - console.error(); - } - function maybeLog(name, fn) { - if (opts.allowDebug === false) - return fn; - if (Number.isFinite(debugLevel)) { - if (debugLevel >= 2) { - return (...args) => { - const logEntry = makeLogEntry(name, args); - try { - return logEntry.result = fn(...args); - } catch (error) { - throw logEntry.error = error; - } finally { - trace(logEntry); - } - }; - } else if (debugLevel >= 1) { - return (...args) => { - try { - return fn(...args); - } catch (error) { - const logEntry = makeLogEntry(name, args); - logEntry.error = error; - trace(logEntry); - throw error; - } - }; - } - } - return fn; - } - function getPackageInformationSafe(packageLocator) { - const packageInformation = getPackageInformation(packageLocator); - if (!packageInformation) { - throw makeError( - ErrorCode.INTERNAL, - `Couldn't find a matching entry in the dependency tree for the specified parent (this is probably an internal error)` - ); - } - return packageInformation; - } - function isDependencyTreeRoot(packageLocator) { - if (packageLocator.name === null) - return true; - for (const dependencyTreeRoot of runtimeState.dependencyTreeRoots) - if (dependencyTreeRoot.name === packageLocator.name && dependencyTreeRoot.reference === packageLocator.reference) - return true; - return false; - } - const defaultExportsConditions = /* @__PURE__ */ new Set([ - `node`, - `require`, - ...getOptionValue(`--conditions`) - ]); - function applyNodeExportsResolution(unqualifiedPath, conditions = defaultExportsConditions, issuer) { - const locator = findPackageLocator(ppath.join(unqualifiedPath, `internal.js`), { - resolveIgnored: true, - includeDiscardFromLookup: true - }); - if (locator === null) { - throw makeError( - ErrorCode.INTERNAL, - `The locator that owns the "${unqualifiedPath}" path can't be found inside the dependency tree (this is probably an internal error)` - ); - } - const { packageLocation } = getPackageInformationSafe(locator); - const manifestPath = ppath.join(packageLocation, Filename.manifest); - if (!opts.fakeFs.existsSync(manifestPath)) - return null; - const pkgJson = JSON.parse(opts.fakeFs.readFileSync(manifestPath, `utf8`)); - if (pkgJson.exports == null) - return null; - let subpath = ppath.contains(packageLocation, unqualifiedPath); - if (subpath === null) { - throw makeError( - ErrorCode.INTERNAL, - `unqualifiedPath doesn't contain the packageLocation (this is probably an internal error)` - ); - } - if (subpath !== `.` && !isRelativeRegexp.test(subpath)) - subpath = `./${subpath}`; - try { - const resolvedExport = packageExportsResolve({ - packageJSONUrl: url.pathToFileURL(npath.fromPortablePath(manifestPath)), - packageSubpath: subpath, - exports: pkgJson.exports, - base: issuer ? url.pathToFileURL(npath.fromPortablePath(issuer)) : null, - conditions - }); - return npath.toPortablePath(url.fileURLToPath(resolvedExport)); - } catch (error) { - throw makeError( - ErrorCode.EXPORTS_RESOLUTION_FAILED, - error.message, - { unqualifiedPath: getPathForDisplay(unqualifiedPath), locator, pkgJson, subpath: getPathForDisplay(subpath), conditions }, - error.code - ); - } - } - function applyNodeExtensionResolution(unqualifiedPath, candidates, { extensions }) { - let stat; - try { - candidates.push(unqualifiedPath); - stat = opts.fakeFs.statSync(unqualifiedPath); - } catch (error) { - } - if (stat && !stat.isDirectory()) - return opts.fakeFs.realpathSync(unqualifiedPath); - if (stat && stat.isDirectory()) { - let pkgJson; - try { - pkgJson = JSON.parse(opts.fakeFs.readFileSync(ppath.join(unqualifiedPath, Filename.manifest), `utf8`)); - } catch (error) { - } - let nextUnqualifiedPath; - if (pkgJson && pkgJson.main) - nextUnqualifiedPath = ppath.resolve(unqualifiedPath, pkgJson.main); - if (nextUnqualifiedPath && nextUnqualifiedPath !== unqualifiedPath) { - const resolution = applyNodeExtensionResolution(nextUnqualifiedPath, candidates, { extensions }); - if (resolution !== null) { - return resolution; - } - } - } - for (let i = 0, length = extensions.length; i < length; i++) { - const candidateFile = `${unqualifiedPath}${extensions[i]}`; - candidates.push(candidateFile); - if (opts.fakeFs.existsSync(candidateFile)) { - return candidateFile; - } - } - if (stat && stat.isDirectory()) { - for (let i = 0, length = extensions.length; i < length; i++) { - const candidateFile = ppath.format({ dir: unqualifiedPath, name: `index`, ext: extensions[i] }); - candidates.push(candidateFile); - if (opts.fakeFs.existsSync(candidateFile)) { - return candidateFile; - } - } - } - return null; - } - function makeFakeModule(path) { - const fakeModule = new require$$0.Module(path, null); - fakeModule.filename = path; - fakeModule.paths = require$$0.Module._nodeModulePaths(path); - return fakeModule; - } - function callNativeResolution(request, issuer) { - if (issuer.endsWith(`/`)) - issuer = ppath.join(issuer, `internal.js`); - return require$$0.Module._resolveFilename(npath.fromPortablePath(request), makeFakeModule(npath.fromPortablePath(issuer)), false, { plugnplay: false }); - } - function isPathIgnored(path) { - if (ignorePattern === null) - return false; - const subPath = ppath.contains(runtimeState.basePath, path); - if (subPath === null) - return false; - if (ignorePattern.test(subPath.replace(/\/$/, ``))) { - return true; - } else { - return false; - } - } - const VERSIONS = { std: 3, resolveVirtual: 1, getAllLocators: 1 }; - const topLevel = topLevelLocator; - function getPackageInformation({ name, reference }) { - const packageInformationStore = packageRegistry.get(name); - if (!packageInformationStore) - return null; - const packageInformation = packageInformationStore.get(reference); - if (!packageInformation) - return null; - return packageInformation; - } - function findPackageDependents({ name, reference }) { - const dependents = []; - for (const [dependentName, packageInformationStore] of packageRegistry) { - if (dependentName === null) - continue; - for (const [dependentReference, packageInformation] of packageInformationStore) { - if (dependentReference === null) - continue; - const dependencyReference = packageInformation.packageDependencies.get(name); - if (dependencyReference !== reference) - continue; - if (dependentName === name && dependentReference === reference) - continue; - dependents.push({ - name: dependentName, - reference: dependentReference - }); - } - } - return dependents; - } - function findBrokenPeerDependencies(dependency, initialPackage) { - const brokenPackages = /* @__PURE__ */ new Map(); - const alreadyVisited = /* @__PURE__ */ new Set(); - const traversal = (currentPackage) => { - const identifier = JSON.stringify(currentPackage.name); - if (alreadyVisited.has(identifier)) - return; - alreadyVisited.add(identifier); - const dependents = findPackageDependents(currentPackage); - for (const dependent of dependents) { - const dependentInformation = getPackageInformationSafe(dependent); - if (dependentInformation.packagePeers.has(dependency)) { - traversal(dependent); - } else { - let brokenSet = brokenPackages.get(dependent.name); - if (typeof brokenSet === `undefined`) - brokenPackages.set(dependent.name, brokenSet = /* @__PURE__ */ new Set()); - brokenSet.add(dependent.reference); - } - } - }; - traversal(initialPackage); - const brokenList = []; - for (const name of [...brokenPackages.keys()].sort()) - for (const reference of [...brokenPackages.get(name)].sort()) - brokenList.push({ name, reference }); - return brokenList; - } - function findPackageLocator(location, { resolveIgnored = false, includeDiscardFromLookup = false } = {}) { - if (isPathIgnored(location) && !resolveIgnored) - return null; - let relativeLocation = ppath.relative(runtimeState.basePath, location); - if (!relativeLocation.match(isStrictRegExp)) - relativeLocation = `./${relativeLocation}`; - if (!relativeLocation.endsWith(`/`)) - relativeLocation = `${relativeLocation}/`; - do { - const entry = packageLocatorsByLocations.get(relativeLocation); - if (typeof entry === `undefined` || entry.discardFromLookup && !includeDiscardFromLookup) { - relativeLocation = relativeLocation.substring(0, relativeLocation.lastIndexOf(`/`, relativeLocation.length - 2) + 1); - continue; - } - return entry.locator; - } while (relativeLocation !== ``); - return null; - } - function tryReadFile(filePath) { - try { - return opts.fakeFs.readFileSync(npath.toPortablePath(filePath), `utf8`); - } catch (err) { - if (err.code === `ENOENT`) - return void 0; - throw err; - } - } - function resolveToUnqualified(request, issuer, { considerBuiltins = true } = {}) { - if (request.startsWith(`#`)) - throw new Error(`resolveToUnqualified can not handle private import mappings`); - if (request === `pnpapi`) - return npath.toPortablePath(opts.pnpapiResolution); - if (considerBuiltins && require$$0.isBuiltin(request)) - return null; - const requestForDisplay = getPathForDisplay(request); - const issuerForDisplay = issuer && getPathForDisplay(issuer); - if (issuer && isPathIgnored(issuer)) { - if (!ppath.isAbsolute(request) || findPackageLocator(request) === null) { - const result = callNativeResolution(request, issuer); - if (result === false) { - throw makeError( - ErrorCode.BUILTIN_NODE_RESOLUTION_FAILED, - `The builtin node resolution algorithm was unable to resolve the requested module (it didn't go through the pnp resolver because the issuer was explicitely ignored by the regexp) - -Require request: "${requestForDisplay}" -Required by: ${issuerForDisplay} -`, - { request: requestForDisplay, issuer: issuerForDisplay } - ); - } - return npath.toPortablePath(result); - } - } - let unqualifiedPath; - const dependencyNameMatch = request.match(pathRegExp); - if (!dependencyNameMatch) { - if (ppath.isAbsolute(request)) { - unqualifiedPath = ppath.normalize(request); - } else { - if (!issuer) { - throw makeError( - ErrorCode.API_ERROR, - `The resolveToUnqualified function must be called with a valid issuer when the path isn't a builtin nor absolute`, - { request: requestForDisplay, issuer: issuerForDisplay } - ); - } - const absoluteIssuer = ppath.resolve(issuer); - if (issuer.match(isDirRegExp)) { - unqualifiedPath = ppath.normalize(ppath.join(absoluteIssuer, request)); - } else { - unqualifiedPath = ppath.normalize(ppath.join(ppath.dirname(absoluteIssuer), request)); - } - } - } else { - if (!issuer) { - throw makeError( - ErrorCode.API_ERROR, - `The resolveToUnqualified function must be called with a valid issuer when the path isn't a builtin nor absolute`, - { request: requestForDisplay, issuer: issuerForDisplay } - ); - } - const [, dependencyName, subPath] = dependencyNameMatch; - const issuerLocator = findPackageLocator(issuer); - if (!issuerLocator) { - const result = callNativeResolution(request, issuer); - if (result === false) { - throw makeError( - ErrorCode.BUILTIN_NODE_RESOLUTION_FAILED, - `The builtin node resolution algorithm was unable to resolve the requested module (it didn't go through the pnp resolver because the issuer doesn't seem to be part of the Yarn-managed dependency tree). - -Require path: "${requestForDisplay}" -Required by: ${issuerForDisplay} -`, - { request: requestForDisplay, issuer: issuerForDisplay } - ); - } - return npath.toPortablePath(result); - } - const issuerInformation = getPackageInformationSafe(issuerLocator); - let dependencyReference = issuerInformation.packageDependencies.get(dependencyName); - let fallbackReference = null; - if (dependencyReference == null) { - if (issuerLocator.name !== null) { - const exclusionEntry = runtimeState.fallbackExclusionList.get(issuerLocator.name); - const canUseFallbacks = !exclusionEntry || !exclusionEntry.has(issuerLocator.reference); - if (canUseFallbacks) { - for (let t = 0, T = fallbackLocators.length; t < T; ++t) { - const fallbackInformation = getPackageInformationSafe(fallbackLocators[t]); - const reference = fallbackInformation.packageDependencies.get(dependencyName); - if (reference == null) - continue; - if (alwaysWarnOnFallback) - fallbackReference = reference; - else - dependencyReference = reference; - break; - } - if (runtimeState.enableTopLevelFallback) { - if (dependencyReference == null && fallbackReference === null) { - const reference = runtimeState.fallbackPool.get(dependencyName); - if (reference != null) { - fallbackReference = reference; - } - } - } - } - } - } - let error = null; - if (dependencyReference === null) { - if (isDependencyTreeRoot(issuerLocator)) { - error = makeError( - ErrorCode.MISSING_PEER_DEPENDENCY, - `Your application tried to access ${dependencyName} (a peer dependency); this isn't allowed as there is no ancestor to satisfy the requirement. Use a devDependency if needed. - -Required package: ${dependencyName}${dependencyName !== requestForDisplay ? ` (via "${requestForDisplay}")` : ``} -Required by: ${issuerForDisplay} -`, - { request: requestForDisplay, issuer: issuerForDisplay, dependencyName } - ); - } else { - const brokenAncestors = findBrokenPeerDependencies(dependencyName, issuerLocator); - if (brokenAncestors.every((ancestor) => isDependencyTreeRoot(ancestor))) { - error = makeError( - ErrorCode.MISSING_PEER_DEPENDENCY, - `${issuerLocator.name} tried to access ${dependencyName} (a peer dependency) but it isn't provided by your application; this makes the require call ambiguous and unsound. - -Required package: ${dependencyName}${dependencyName !== requestForDisplay ? ` (via "${requestForDisplay}")` : ``} -Required by: ${issuerLocator.name}@${issuerLocator.reference} (via ${issuerForDisplay}) -${brokenAncestors.map((ancestorLocator) => `Ancestor breaking the chain: ${ancestorLocator.name}@${ancestorLocator.reference} -`).join(``)} -`, - { request: requestForDisplay, issuer: issuerForDisplay, issuerLocator: Object.assign({}, issuerLocator), dependencyName, brokenAncestors } - ); - } else { - error = makeError( - ErrorCode.MISSING_PEER_DEPENDENCY, - `${issuerLocator.name} tried to access ${dependencyName} (a peer dependency) but it isn't provided by its ancestors; this makes the require call ambiguous and unsound. - -Required package: ${dependencyName}${dependencyName !== requestForDisplay ? ` (via "${requestForDisplay}")` : ``} -Required by: ${issuerLocator.name}@${issuerLocator.reference} (via ${issuerForDisplay}) - -${brokenAncestors.map((ancestorLocator) => `Ancestor breaking the chain: ${ancestorLocator.name}@${ancestorLocator.reference} -`).join(``)} -`, - { request: requestForDisplay, issuer: issuerForDisplay, issuerLocator: Object.assign({}, issuerLocator), dependencyName, brokenAncestors } - ); - } - } - } else if (dependencyReference === void 0) { - if (!considerBuiltins && require$$0.isBuiltin(request)) { - if (isDependencyTreeRoot(issuerLocator)) { - error = makeError( - ErrorCode.UNDECLARED_DEPENDENCY, - `Your application tried to access ${dependencyName}. While this module is usually interpreted as a Node builtin, your resolver is running inside a non-Node resolution context where such builtins are ignored. Since ${dependencyName} isn't otherwise declared in your dependencies, this makes the require call ambiguous and unsound. - -Required package: ${dependencyName}${dependencyName !== requestForDisplay ? ` (via "${requestForDisplay}")` : ``} -Required by: ${issuerForDisplay} -`, - { request: requestForDisplay, issuer: issuerForDisplay, dependencyName } - ); - } else { - error = makeError( - ErrorCode.UNDECLARED_DEPENDENCY, - `${issuerLocator.name} tried to access ${dependencyName}. While this module is usually interpreted as a Node builtin, your resolver is running inside a non-Node resolution context where such builtins are ignored. Since ${dependencyName} isn't otherwise declared in ${issuerLocator.name}'s dependencies, this makes the require call ambiguous and unsound. - -Required package: ${dependencyName}${dependencyName !== requestForDisplay ? ` (via "${requestForDisplay}")` : ``} -Required by: ${issuerForDisplay} -`, - { request: requestForDisplay, issuer: issuerForDisplay, issuerLocator: Object.assign({}, issuerLocator), dependencyName } - ); - } - } else { - if (isDependencyTreeRoot(issuerLocator)) { - error = makeError( - ErrorCode.UNDECLARED_DEPENDENCY, - `Your application tried to access ${dependencyName}, but it isn't declared in your dependencies; this makes the require call ambiguous and unsound. - -Required package: ${dependencyName}${dependencyName !== requestForDisplay ? ` (via "${requestForDisplay}")` : ``} -Required by: ${issuerForDisplay} -`, - { request: requestForDisplay, issuer: issuerForDisplay, dependencyName } - ); - } else { - error = makeError( - ErrorCode.UNDECLARED_DEPENDENCY, - `${issuerLocator.name} tried to access ${dependencyName}, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound. - -Required package: ${dependencyName}${dependencyName !== requestForDisplay ? ` (via "${requestForDisplay}")` : ``} -Required by: ${issuerLocator.name}@${issuerLocator.reference} (via ${issuerForDisplay}) -`, - { request: requestForDisplay, issuer: issuerForDisplay, issuerLocator: Object.assign({}, issuerLocator), dependencyName } - ); - } - } - } - if (dependencyReference == null) { - if (fallbackReference === null || error === null) - throw error || new Error(`Assertion failed: Expected an error to have been set`); - dependencyReference = fallbackReference; - const message = error.message.replace(/\n.*/g, ``); - error.message = message; - if (!emittedWarnings.has(message) && debugLevel !== 0) { - emittedWarnings.add(message); - process.emitWarning(error); - } - } - const dependencyLocator = Array.isArray(dependencyReference) ? { name: dependencyReference[0], reference: dependencyReference[1] } : { name: dependencyName, reference: dependencyReference }; - const dependencyInformation = getPackageInformationSafe(dependencyLocator); - if (!dependencyInformation.packageLocation) { - throw makeError( - ErrorCode.MISSING_DEPENDENCY, - `A dependency seems valid but didn't get installed for some reason. This might be caused by a partial install, such as dev vs prod. - -Required package: ${dependencyLocator.name}@${dependencyLocator.reference}${dependencyLocator.name !== requestForDisplay ? ` (via "${requestForDisplay}")` : ``} -Required by: ${issuerLocator.name}@${issuerLocator.reference} (via ${issuerForDisplay}) -`, - { request: requestForDisplay, issuer: issuerForDisplay, dependencyLocator: Object.assign({}, dependencyLocator) } - ); - } - const dependencyLocation = dependencyInformation.packageLocation; - if (subPath) { - unqualifiedPath = ppath.join(dependencyLocation, subPath); - } else { - unqualifiedPath = dependencyLocation; - } - } - return ppath.normalize(unqualifiedPath); - } - function resolveUnqualifiedExport(request, unqualifiedPath, conditions = defaultExportsConditions, issuer) { - if (isStrictRegExp.test(request)) - return unqualifiedPath; - const unqualifiedExportPath = applyNodeExportsResolution(unqualifiedPath, conditions, issuer); - if (unqualifiedExportPath) { - return ppath.normalize(unqualifiedExportPath); - } else { - return unqualifiedPath; - } - } - function resolveUnqualified(unqualifiedPath, { extensions = Object.keys(require$$0.Module._extensions) } = {}) { - const candidates = []; - const qualifiedPath = applyNodeExtensionResolution(unqualifiedPath, candidates, { extensions }); - if (qualifiedPath) { - return ppath.normalize(qualifiedPath); - } else { - reportRequiredFilesToWatchMode(candidates.map((candidate) => npath.fromPortablePath(candidate))); - const unqualifiedPathForDisplay = getPathForDisplay(unqualifiedPath); - const containingPackage = findPackageLocator(unqualifiedPath); - if (containingPackage) { - const { packageLocation } = getPackageInformationSafe(containingPackage); - let exists = true; - try { - opts.fakeFs.accessSync(packageLocation); - } catch (err) { - if (err?.code === `ENOENT`) { - exists = false; - } else { - const readableError = (err?.message ?? err ?? `empty exception thrown`).replace(/^[A-Z]/, ($0) => $0.toLowerCase()); - throw makeError(ErrorCode.QUALIFIED_PATH_RESOLUTION_FAILED, `Required package exists but could not be accessed (${readableError}). - -Missing package: ${containingPackage.name}@${containingPackage.reference} -Expected package location: ${getPathForDisplay(packageLocation)} -`, { unqualifiedPath: unqualifiedPathForDisplay, extensions }); - } - } - if (!exists) { - const errorMessage = packageLocation.includes(`/unplugged/`) ? `Required unplugged package missing from disk. This may happen when switching branches without running installs (unplugged packages must be fully materialized on disk to work).` : `Required package missing from disk. If you keep your packages inside your repository then restarting the Node process may be enough. Otherwise, try to run an install first.`; - throw makeError( - ErrorCode.QUALIFIED_PATH_RESOLUTION_FAILED, - `${errorMessage} - -Missing package: ${containingPackage.name}@${containingPackage.reference} -Expected package location: ${getPathForDisplay(packageLocation)} -`, - { unqualifiedPath: unqualifiedPathForDisplay, extensions } - ); - } - } - throw makeError( - ErrorCode.QUALIFIED_PATH_RESOLUTION_FAILED, - `Qualified path resolution failed: we looked for the following paths, but none could be accessed. - -Source path: ${unqualifiedPathForDisplay} -${candidates.map((candidate) => `Not found: ${getPathForDisplay(candidate)} -`).join(``)}`, - { unqualifiedPath: unqualifiedPathForDisplay, extensions } - ); - } - } - function resolvePrivateRequest(request, issuer, opts2) { - if (!issuer) - throw new Error(`Assertion failed: An issuer is required to resolve private import mappings`); - const resolved = packageImportsResolve({ - name: request, - base: url.pathToFileURL(npath.fromPortablePath(issuer)), - conditions: opts2.conditions ?? defaultExportsConditions, - readFileSyncFn: tryReadFile - }); - if (resolved instanceof URL) { - return resolveUnqualified(npath.toPortablePath(url.fileURLToPath(resolved)), { extensions: opts2.extensions }); - } else { - if (resolved.startsWith(`#`)) - throw new Error(`Mapping from one private import to another isn't allowed`); - return resolveRequest(resolved, issuer, opts2); - } - } - function resolveRequest(request, issuer, opts2 = {}) { - try { - if (request.startsWith(`#`)) - return resolvePrivateRequest(request, issuer, opts2); - const { considerBuiltins, extensions, conditions } = opts2; - const unqualifiedPath = resolveToUnqualified(request, issuer, { considerBuiltins }); - if (request === `pnpapi`) - return unqualifiedPath; - if (unqualifiedPath === null) - return null; - const isIssuerIgnored = () => issuer !== null ? isPathIgnored(issuer) : false; - const remappedPath = (!considerBuiltins || !require$$0.isBuiltin(request)) && !isIssuerIgnored() ? resolveUnqualifiedExport(request, unqualifiedPath, conditions, issuer) : unqualifiedPath; - return resolveUnqualified(remappedPath, { extensions }); - } catch (error) { - if (Object.hasOwn(error, `pnpCode`)) - Object.assign(error.data, { request: getPathForDisplay(request), issuer: issuer && getPathForDisplay(issuer) }); - throw error; - } - } - function resolveVirtual(request) { - const normalized = ppath.normalize(request); - const resolved = VirtualFS.resolveVirtual(normalized); - return resolved !== normalized ? resolved : null; - } - return { - VERSIONS, - topLevel, - getLocator: (name, referencish) => { - if (Array.isArray(referencish)) { - return { name: referencish[0], reference: referencish[1] }; - } else { - return { name, reference: referencish }; - } - }, - getDependencyTreeRoots: () => { - return [...runtimeState.dependencyTreeRoots]; - }, - getAllLocators() { - const locators = []; - for (const [name, entry] of packageRegistry) - for (const reference of entry.keys()) - if (name !== null && reference !== null) - locators.push({ name, reference }); - return locators; - }, - getPackageInformation: (locator) => { - const info = getPackageInformation(locator); - if (info === null) - return null; - const packageLocation = npath.fromPortablePath(info.packageLocation); - const nativeInfo = { ...info, packageLocation }; - return nativeInfo; - }, - findPackageLocator: (path) => { - return findPackageLocator(npath.toPortablePath(path)); - }, - resolveToUnqualified: maybeLog(`resolveToUnqualified`, (request, issuer, opts2) => { - const portableIssuer = issuer !== null ? npath.toPortablePath(issuer) : null; - const resolution = resolveToUnqualified(npath.toPortablePath(request), portableIssuer, opts2); - if (resolution === null) - return null; - return npath.fromPortablePath(resolution); - }), - resolveUnqualified: maybeLog(`resolveUnqualified`, (unqualifiedPath, opts2) => { - return npath.fromPortablePath(resolveUnqualified(npath.toPortablePath(unqualifiedPath), opts2)); - }), - resolveRequest: maybeLog(`resolveRequest`, (request, issuer, opts2) => { - const portableIssuer = issuer !== null ? npath.toPortablePath(issuer) : null; - const resolution = resolveRequest(npath.toPortablePath(request), portableIssuer, opts2); - if (resolution === null) - return null; - return npath.fromPortablePath(resolution); - }), - resolveVirtual: maybeLog(`resolveVirtual`, (path) => { - const result = resolveVirtual(npath.toPortablePath(path)); - if (result !== null) { - return npath.fromPortablePath(result); - } else { - return null; - } - }) - }; -} - -function makeManager(pnpapi, opts) { - const initialApiPath = npath.toPortablePath(pnpapi.resolveToUnqualified(`pnpapi`, null)); - const initialApiStats = opts.fakeFs.statSync(npath.toPortablePath(initialApiPath)); - const apiMetadata = /* @__PURE__ */ new Map([ - [initialApiPath, { - instance: pnpapi, - stats: initialApiStats, - lastRefreshCheck: Date.now() - }] - ]); - function loadApiInstance(pnpApiPath) { - const nativePath = npath.fromPortablePath(pnpApiPath); - const module = new require$$0.Module(nativePath, null); - module.load(nativePath); - return module.exports; - } - function refreshApiEntry(pnpApiPath, apiEntry) { - const timeNow = Date.now(); - if (timeNow - apiEntry.lastRefreshCheck < 500) - return; - apiEntry.lastRefreshCheck = timeNow; - const stats = opts.fakeFs.statSync(pnpApiPath); - if (stats.mtime > apiEntry.stats.mtime) { - process.emitWarning(`[Warning] The runtime detected new information in a PnP file; reloading the API instance (${npath.fromPortablePath(pnpApiPath)})`); - apiEntry.stats = stats; - apiEntry.instance = loadApiInstance(pnpApiPath); - } - } - function getApiEntry(pnpApiPath, refresh = false) { - let apiEntry = apiMetadata.get(pnpApiPath); - if (typeof apiEntry !== `undefined`) { - if (refresh) { - refreshApiEntry(pnpApiPath, apiEntry); - } - } else { - apiMetadata.set(pnpApiPath, apiEntry = { - instance: loadApiInstance(pnpApiPath), - stats: opts.fakeFs.statSync(pnpApiPath), - lastRefreshCheck: Date.now() - }); - } - return apiEntry; - } - const findApiPathCache = /* @__PURE__ */ new Map(); - function addToCacheAndReturn(start, end, target) { - if (target !== null) { - target = VirtualFS.resolveVirtual(target); - target = opts.fakeFs.realpathSync(target); - } - let curr; - let next = start; - do { - curr = next; - findApiPathCache.set(curr, target); - next = ppath.dirname(curr); - } while (curr !== end); - return target; - } - function findApiPathFor(modulePath) { - let bestCandidate = null; - for (const [apiPath, apiEntry] of apiMetadata) { - const locator = apiEntry.instance.findPackageLocator(modulePath); - if (!locator) - continue; - if (apiMetadata.size === 1) - return apiPath; - const packageInformation = apiEntry.instance.getPackageInformation(locator); - if (!packageInformation) - throw new Error(`Assertion failed: Couldn't get package information for '${modulePath}'`); - if (!bestCandidate) - bestCandidate = { packageLocation: packageInformation.packageLocation, apiPaths: [] }; - if (packageInformation.packageLocation === bestCandidate.packageLocation) { - bestCandidate.apiPaths.push(apiPath); - } else if (packageInformation.packageLocation.length > bestCandidate.packageLocation.length) { - bestCandidate = { packageLocation: packageInformation.packageLocation, apiPaths: [apiPath] }; - } - } - if (bestCandidate) { - if (bestCandidate.apiPaths.length === 1) - return bestCandidate.apiPaths[0]; - const controlSegment = bestCandidate.apiPaths.map((apiPath) => ` ${npath.fromPortablePath(apiPath)}`).join(` -`); - throw new Error(`Unable to locate pnpapi, the module '${modulePath}' is controlled by multiple pnpapi instances. -This is usually caused by using the global cache (enableGlobalCache: true) - -Controlled by: -${controlSegment} -`); - } - const start = ppath.resolve(npath.toPortablePath(modulePath)); - let curr; - let next = start; - do { - curr = next; - const cached = findApiPathCache.get(curr); - if (cached !== void 0) - return addToCacheAndReturn(start, curr, cached); - const cjsCandidate = ppath.join(curr, Filename.pnpCjs); - if (opts.fakeFs.existsSync(cjsCandidate) && opts.fakeFs.statSync(cjsCandidate).isFile()) - return addToCacheAndReturn(start, curr, cjsCandidate); - const legacyCjsCandidate = ppath.join(curr, Filename.pnpJs); - if (opts.fakeFs.existsSync(legacyCjsCandidate) && opts.fakeFs.statSync(legacyCjsCandidate).isFile()) - return addToCacheAndReturn(start, curr, legacyCjsCandidate); - next = ppath.dirname(curr); - } while (curr !== PortablePath.root); - return addToCacheAndReturn(start, curr, null); - } - const moduleToApiPathCache = /* @__PURE__ */ new WeakMap(); - function getApiPathFromParent(parent) { - if (parent == null) - return initialApiPath; - let apiPath = moduleToApiPathCache.get(parent); - if (typeof apiPath !== `undefined`) - return apiPath; - apiPath = parent.filename ? findApiPathFor(parent.filename) : null; - moduleToApiPathCache.set(parent, apiPath); - return apiPath; - } - return { - getApiPathFromParent, - findApiPathFor, - getApiEntry - }; -} - -const localFs = { ...fs__default.default }; -const nodeFs = new NodeFS(localFs); -const defaultRuntimeState = $$SETUP_STATE(hydrateRuntimeState); -const defaultPnpapiResolution = __filename; -const defaultFsLayer = new VirtualFS({ - baseFs: new ZipOpenFS({ - baseFs: nodeFs, - maxOpenFiles: 80, - readOnlyArchives: true - }) -}); -class DynamicFS extends ProxiedFS { - constructor() { - super(ppath); - this.baseFs = defaultFsLayer; - } - mapToBase(p) { - return p; - } - mapFromBase(p) { - return p; - } -} -const dynamicFsLayer = new DynamicFS(); -let manager; -const defaultApi = Object.assign(makeApi(defaultRuntimeState, { - fakeFs: dynamicFsLayer, - pnpapiResolution: defaultPnpapiResolution -}), { - makeApi: ({ - basePath = void 0, - fakeFs = dynamicFsLayer, - pnpapiResolution = defaultPnpapiResolution, - ...rest - }) => { - const apiRuntimeState = typeof basePath !== `undefined` ? $$SETUP_STATE(hydrateRuntimeState, basePath) : defaultRuntimeState; - return makeApi(apiRuntimeState, { - fakeFs, - pnpapiResolution, - ...rest - }); - }, - setup: (api) => { - applyPatch(api || defaultApi, { - fakeFs: defaultFsLayer, - manager - }); - dynamicFsLayer.baseFs = new NodeFS(fs__default.default); - } -}); -manager = makeManager(defaultApi, { - fakeFs: dynamicFsLayer -}); -if (module.parent && module.parent.id === `internal/preload`) { - defaultApi.setup(); - if (module.filename) { - delete require$$0__default.default._cache[module.filename]; - } -} -if (process.mainModule === module) { - const reportError = (code, message, data) => { - process.stdout.write(`${JSON.stringify([{ code, message, data }, null])} -`); - }; - const reportSuccess = (resolution) => { - process.stdout.write(`${JSON.stringify([null, resolution])} -`); - }; - const processResolution = (request, issuer) => { - try { - reportSuccess(defaultApi.resolveRequest(request, issuer)); - } catch (error) { - reportError(error.code, error.message, error.data); - } - }; - const processRequest = (data) => { - try { - const [request, issuer] = JSON.parse(data); - processResolution(request, issuer); - } catch (error) { - reportError(`INVALID_JSON`, error.message, error.data); - } - }; - if (process.argv.length > 2) { - if (process.argv.length !== 4) { - process.stderr.write(`Usage: ${process.argv[0]} ${process.argv[1]} -`); - process.exitCode = 64; - } else { - processResolution(process.argv[2], process.argv[3]); - } - } else { - let buffer = ``; - const decoder = new StringDecoder__default.default.StringDecoder(); - process.stdin.on(`data`, (chunk) => { - buffer += decoder.write(chunk); - do { - const index = buffer.indexOf(` -`); - if (index === -1) - break; - const line = buffer.slice(0, index); - buffer = buffer.slice(index + 1); - processRequest(line); - } while (true); - }); - } -} - -module.exports = defaultApi; diff --git a/fixtures/pnp/.yarnrc.yml b/fixtures/pnp/.yarnrc.yml deleted file mode 100644 index 6a6b24d8..00000000 --- a/fixtures/pnp/.yarnrc.yml +++ /dev/null @@ -1 +0,0 @@ -enableGlobalCache: 0 diff --git a/fixtures/pnp/package.json b/fixtures/pnp/package.json deleted file mode 100644 index 5d119379..00000000 --- a/fixtures/pnp/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "pnp", - "packageManager": "yarn@4.3.1", - "dependencies": { - "is-even": "^1.0.0", - "is-odd": "^3.0.1" - } -} diff --git a/fixtures/pnp/yarn.lock b/fixtures/pnp/yarn.lock deleted file mode 100644 index ba89514d..00000000 --- a/fixtures/pnp/yarn.lock +++ /dev/null @@ -1,74 +0,0 @@ -# This file is generated by running "yarn install" inside your project. -# Manual changes might be lost - proceed with caution! - -__metadata: - version: 8 - cacheKey: 10c0 - -"is-buffer@npm:^1.1.5": - version: 1.1.6 - resolution: "is-buffer@npm:1.1.6" - checksum: 10c0/ae18aa0b6e113d6c490ad1db5e8df9bdb57758382b313f5a22c9c61084875c6396d50bbf49315f5b1926d142d74dfb8d31b40d993a383e0a158b15fea7a82234 - languageName: node - linkType: hard - -"is-even@npm:^1.0.0": - version: 1.0.0 - resolution: "is-even@npm:1.0.0" - dependencies: - is-odd: "npm:^0.1.2" - checksum: 10c0/2728cc2f390d07c6a44a054aa53ae6ce57c3a4adfd76a92df528e992b4a978fdec4eaa948e0de6e6431ef3c8deebf1c964fd870d4983044ec9f0f4e630dfb3a5 - languageName: node - linkType: hard - -"is-number@npm:^3.0.0": - version: 3.0.0 - resolution: "is-number@npm:3.0.0" - dependencies: - kind-of: "npm:^3.0.2" - checksum: 10c0/e639c54640b7f029623df24d3d103901e322c0c25ea5bde97cd723c2d0d4c05857a8364ab5c58d963089dbed6bf1d0ffe975cb6aef917e2ad0ccbca653d31b4f - languageName: node - linkType: hard - -"is-number@npm:^6.0.0": - version: 6.0.0 - resolution: "is-number@npm:6.0.0" - checksum: 10c0/5da4c68401529675c575878d2760d66f18eaef4b014858577f6003daf66488d7fe4eae684b1e8574e3fa1bb447c6c6c56b8491d2b4b3239da2d32e5f6f218008 - languageName: node - linkType: hard - -"is-odd@npm:^0.1.2": - version: 0.1.2 - resolution: "is-odd@npm:0.1.2" - dependencies: - is-number: "npm:^3.0.0" - checksum: 10c0/7dc6c6fd004861208ef9f324021c66f19b3dad209c2da3ef3720d4d76e141974fadb52c47b439fc8c52af579468640b554115395b5673f4558ef09719260e898 - languageName: node - linkType: hard - -"is-odd@npm:^3.0.1": - version: 3.0.1 - resolution: "is-odd@npm:3.0.1" - dependencies: - is-number: "npm:^6.0.0" - checksum: 10c0/89ee2e353c5a3f3bd400c79db1c307a5b3506198ee8169d521e533a9b1d8a08fc95f21a919c084e98845b4286d7ffe309778da03744dfe66c3c1763ab1a030c6 - languageName: node - linkType: hard - -"kind-of@npm:^3.0.2": - version: 3.2.2 - resolution: "kind-of@npm:3.2.2" - dependencies: - is-buffer: "npm:^1.1.5" - checksum: 10c0/7e34bc29d4b02c997f92f080de34ebb92033a96736bbb0bb2410e033a7e5ae6571f1fa37b2d7710018f95361473b816c604234197f4f203f9cf149d8ef1574d9 - languageName: node - linkType: hard - -"pnp@workspace:.": - version: 0.0.0-use.local - resolution: "pnp@workspace:." - dependencies: - is-even: "npm:^1.0.0" - is-odd: "npm:^3.0.1" - languageName: unknown - linkType: soft diff --git a/fixtures/pnpm/package.json b/fixtures/pnpm/package.json deleted file mode 100644 index b763d74d..00000000 --- a/fixtures/pnpm/package.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "name": "pnpm", - "version": "1.0.0", - "private": true, - "devDependencies": { - "axios": "1.6.2", - "ipaddr.js": "2.2.0", - "postcss": "8.4.33", - "styled-components": "6.1.1" - } -} diff --git a/npm/package.json b/npm/package.json index 5a97b635..7136edb8 100644 --- a/npm/package.json +++ b/npm/package.json @@ -1,47 +1,36 @@ { - "name": "oxc-resolver", - "version": "1.10.2", - "description": "Oxc Resolver Node API", - "main": "index.js", - "browser": "browser.js", - "files": [ - "index.d.ts", - "index.js", - "browser.js" - ], - "license": "MIT", - "homepage": "https://oxc.rs", - "repository": { - "type": "git", - "url": "git+https://github.com/oxc-project/oxc-resolver.git" - }, - "publishConfig": { - "registry": "https://registry.npmjs.org/", - "access": "public" - }, - "napi": { - "binaryName": "resolver", - "packageName": "@oxc-resolver/binding", - "wasm": { - "browser": { - "fs": true - } - }, - "targets": [ - "x86_64-pc-windows-msvc", - "aarch64-pc-windows-msvc", - "x86_64-unknown-linux-gnu", - "x86_64-unknown-linux-musl", - "x86_64-unknown-freebsd", - "aarch64-unknown-linux-gnu", - "aarch64-unknown-linux-musl", - "armv7-unknown-linux-gnueabihf", - "x86_64-apple-darwin", - "aarch64-apple-darwin", - "wasm32-wasip1-threads" - ] - }, - "funding": { - "url": "https://github.com/sponsors/Boshen" - } + "browser": "browser.js", + "description": "Oxc Resolver Node API", + "files": [ + "index.d.ts", + "index.js", + "browser.js" + ], + "funding": { + "url": "https://github.com/sponsors/Boshen" + }, + "main": "index.js", + "name": "oxc-resolver", + "napi": { + "binaryName": "resolver", + "packageName": "@oxc-resolver/binding", + "targets": [ + "x86_64-pc-windows-msvc", + "aarch64-pc-windows-msvc", + "x86_64-unknown-linux-gnu", + "x86_64-unknown-linux-musl", + "x86_64-unknown-freebsd", + "aarch64-unknown-linux-gnu", + "aarch64-unknown-linux-musl", + "armv7-unknown-linux-gnueabihf", + "x86_64-apple-darwin", + "aarch64-apple-darwin", + "wasm32-wasip1-threads" + ], + "wasm": { + "browser": { + "fs": true + } + } + } } diff --git a/package.json b/package.json index 4c09a427..a010e24d 100644 --- a/package.json +++ b/package.json @@ -1,33 +1,24 @@ { - "name": "@oxc-resolver/binding", - "private": true, - "version": "0.0.0", - "scripts": { - "build": "napi build --platform --release --package-json-path npm/package.json --manifest-path napi/Cargo.toml", - "build:debug": "napi build --platform --package-json-path npm/package.json --manifest-path napi/Cargo.toml", - "prepublishOnly": "napi pre-publish -t npm", - "test": "ava" - }, - "devDependencies": { - "@napi-rs/cli": "3.0.0-alpha.58", - "@napi-rs/wasm-runtime": "^0.2.4", - "@types/node": "^22.0.0", - "ava": "^6.1.3", - "emnapi": "^1.2.0", - "typescript": "^5.5.3" - }, - "ava": { - "files": [ - "napi/__test__/*.spec.mjs" - ], - "cache": false - }, - "packageManager": "pnpm@9.5.0", - "repository": { - "type": "git", - "url": "git+https://github.com/oxc-project/oxc-resolver.git" - }, - "funding": { - "url": "https://github.com/sponsors/Boshen" - } + "ava": { + "cache": false, + "files": [ + "napi/__test__/*.spec.mjs" + ] + }, + "devDependencies": { + "@napi-rs/cli": "3.0.0-alpha.58", + "@napi-rs/wasm-runtime": "^0.2.4", + "@types/node": "^22.0.0", + "ava": "^6.1.3", + "emnapi": "^1.2.0" + }, + "funding": { + "url": "https://github.com/sponsors/Boshen" + }, + "name": "@oxc-resolver/binding", + "scripts": { + "build": "napi build --platform --release --package-json-path npm/package.json --manifest-path napi/Cargo.toml", + "build:debug": "napi build --platform --package-json-path npm/package.json --manifest-path napi/Cargo.toml", + "prepublishOnly": "napi pre-publish -t npm" + } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml deleted file mode 100644 index 8a86a94f..00000000 --- a/pnpm-lock.yaml +++ /dev/null @@ -1,2603 +0,0 @@ -lockfileVersion: '9.0' - -settings: - autoInstallPeers: true - excludeLinksFromLockfile: false - -importers: - - .: - devDependencies: - '@napi-rs/cli': - specifier: 3.0.0-alpha.58 - version: 3.0.0-alpha.58(@emnapi/runtime@1.2.0)(emnapi@1.2.0) - '@napi-rs/wasm-runtime': - specifier: ^0.2.4 - version: 0.2.4 - '@types/node': - specifier: ^22.0.0 - version: 22.0.0 - ava: - specifier: ^6.1.3 - version: 6.1.3 - emnapi: - specifier: ^1.2.0 - version: 1.2.0 - typescript: - specifier: ^5.5.3 - version: 5.5.3 - - fixtures/pnpm: - devDependencies: - axios: - specifier: 1.6.2 - version: 1.6.2 - ipaddr.js: - specifier: 2.2.0 - version: 2.2.0 - postcss: - specifier: 8.4.33 - version: 8.4.33 - styled-components: - specifier: 6.1.1 - version: 6.1.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - - npm: {} - -packages: - - '@emnapi/core@1.2.0': - resolution: {integrity: sha512-E7Vgw78I93we4ZWdYCb4DGAwRROGkMIXk7/y87UmANR+J6qsWusmC3gLt0H+O0KOt5e6O38U8oJamgbudrES/w==} - - '@emnapi/runtime@1.2.0': - resolution: {integrity: sha512-bV21/9LQmcQeCPEg3BDFtvwL6cwiTMksYNWQQ4KOxCZikEGalWtenoZ0wCiukJINlGCIi2KXx01g4FoH/LxpzQ==} - - '@emnapi/wasi-threads@1.0.1': - resolution: {integrity: sha512-iIBu7mwkq4UQGeMEM8bLwNK962nXdhodeScX4slfQnRhEMMzvYivHhutCIk8uojvmASXXPC2WNEjwxFWk72Oqw==} - - '@emotion/is-prop-valid@1.2.2': - resolution: {integrity: sha512-uNsoYd37AFmaCdXlg6EYD1KaPOaRWRByMCYzbKUX4+hhMfrxdVSelShywL4JVaAeM/eHUOSprYBQls+/neX3pw==} - - '@emotion/memoize@0.8.1': - resolution: {integrity: sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA==} - - '@emotion/unitless@0.8.1': - resolution: {integrity: sha512-KOEGMu6dmJZtpadb476IsZBclKvILjopjUii3V+7MnXIQCYh8W3NgNcgwo21n9LXZX6EDIKvqfjYxXebDwxKmQ==} - - '@inquirer/checkbox@2.3.10': - resolution: {integrity: sha512-CTc864M2/523rKc9AglIzAcUCuPXDZENgc5S2KZFVRbnMzpXcYTsUWmbqSeL0XLvtlvEtNevkkVbfVhJpruOyQ==} - engines: {node: '>=18'} - - '@inquirer/confirm@3.1.14': - resolution: {integrity: sha512-nbLSX37b2dGPtKWL3rPuR/5hOuD30S+pqJ/MuFiUEgN6GiMs8UMxiurKAMDzKt6C95ltjupa8zH6+3csXNHWpA==} - engines: {node: '>=18'} - - '@inquirer/core@9.0.2': - resolution: {integrity: sha512-nguvH3TZar3ACwbytZrraRTzGqyxJfYJwv+ZwqZNatAosdWQMP1GV8zvmkNlBe2JeZSaw0WYBHZk52pDpWC9qA==} - engines: {node: '>=18'} - - '@inquirer/editor@2.1.14': - resolution: {integrity: sha512-6nWpoJyVAKwAcv67bkbBmmi3f32xua79fP7TRmNUoR4K+B1GiOBsHO1YdvET/jvC+nTlBZL7puKAKyM7G+Lkzw==} - engines: {node: '>=18'} - - '@inquirer/expand@2.1.14': - resolution: {integrity: sha512-JcxsLajwPykF2kq6biIUdoOzTQ3LXqb8XMVrWkCprG/pFeU1SsxcSSFbF1T5jJGvvlTVcsE+JdGjbQ8ZRZ82RA==} - engines: {node: '>=18'} - - '@inquirer/figures@1.0.3': - resolution: {integrity: sha512-ErXXzENMH5pJt5/ssXV0DfWUZqly8nGzf0UcBV9xTnP+KyffE2mqyxIMBrZ8ijQck2nU0TQm40EQB53YreyWHw==} - engines: {node: '>=18'} - - '@inquirer/input@2.2.1': - resolution: {integrity: sha512-Yl1G6h7qWydzrJwqN777geeJVaAFL5Ly83aZlw4xHf8Z/BoTMfKRheyuMaQwOG7LQ4e5nQP7PxXdEg4SzQ+OKw==} - engines: {node: '>=18'} - - '@inquirer/number@1.0.2': - resolution: {integrity: sha512-GcoK+Phxcln0Qw9e73S5a8B2Ejg3HgSTvNfDegIcS5/BKwUm8t5rejja1l09WXjZM9vrVbRDf9RzWtSUiWVYRQ==} - engines: {node: '>=18'} - - '@inquirer/password@2.1.14': - resolution: {integrity: sha512-sPzOkXLhWJQ96K6nPZFnF8XB8tsDrcCRobd1d3EDz81F+4hp8BbdmsnsQcqZ7oYDIOVM/mWJyIUtJ35TrssJxQ==} - engines: {node: '>=18'} - - '@inquirer/prompts@5.1.2': - resolution: {integrity: sha512-E+ndnfwtVQtcmPt888Hc/HAxJUHSaA6OIvyvLAQ5BLQv+t20GbYdFSjXeLgb47OpMU+aRsKA/ys+Zoylw3kTVg==} - engines: {node: '>=18'} - - '@inquirer/rawlist@2.1.14': - resolution: {integrity: sha512-pLpEzhKNQ/ugFAFfgCNaXljB+dcCwmXwR1jOxAbVeFIdB3l02E5gjI+h1rb136tq0T8JO6P5KFR1oTeld/wdrA==} - engines: {node: '>=18'} - - '@inquirer/select@2.3.10': - resolution: {integrity: sha512-rr7iR0Zj1YFfgM8IUGimPD9Yukd+n/U63CnYT9kdum6DbRXtMxR45rrreP+EA9ixCnShr+W4xj7suRxC1+8t9g==} - engines: {node: '>=18'} - - '@inquirer/type@1.4.0': - resolution: {integrity: sha512-AjOqykVyjdJQvtfkNDGUyMYGF8xN50VUxftCQWsOyIo4DFRLr6VQhW0VItGI1JIyQGCGgIpKa7hMMwNhZb4OIw==} - engines: {node: '>=18'} - - '@mapbox/node-pre-gyp@1.0.11': - resolution: {integrity: sha512-Yhlar6v9WQgUp/He7BdgzOz8lqMQ8sU+jkCq7Wx8Myc5YFJLbEe7lgui/V7G1qB1DJykHSGwreceSaD60Y0PUQ==} - hasBin: true - - '@napi-rs/cli@3.0.0-alpha.58': - resolution: {integrity: sha512-BVLF6rS5cjLJNPDktqcYsYax/nYhwHyFXFMJSDEqC0MmqCdiucVmW9pQZkrBKM1N/qddHcNr+GFEjTN0h7ns6Q==} - engines: {node: '>= 16'} - hasBin: true - peerDependencies: - '@emnapi/runtime': ^1.1.0 - emnapi: ^1.1.0 - peerDependenciesMeta: - '@emnapi/runtime': - optional: true - emnapi: - optional: true - - '@napi-rs/cross-toolchain@0.0.16': - resolution: {integrity: sha512-jwdjHT5L0m9MH0CmzDwPp0ckn/UO7afHCsPeo7NugHUvYgvlgS7SWhdMVgIgJW2HHqhcW/2nhaLLGpAU1c7QRQ==} - peerDependencies: - '@napi-rs/cross-toolchain-arm64-target-aarch64': ^0.0.16 - '@napi-rs/cross-toolchain-arm64-target-armv7': ^0.0.16 - '@napi-rs/cross-toolchain-arm64-target-x86_64': ^0.0.16 - '@napi-rs/cross-toolchain-x64-target-aarch64': ^0.0.16 - '@napi-rs/cross-toolchain-x64-target-armv7': ^0.0.16 - '@napi-rs/cross-toolchain-x64-target-x86_64': ^0.0.16 - peerDependenciesMeta: - '@napi-rs/cross-toolchain-arm64-target-aarch64': - optional: true - '@napi-rs/cross-toolchain-arm64-target-armv7': - optional: true - '@napi-rs/cross-toolchain-arm64-target-x86_64': - optional: true - '@napi-rs/cross-toolchain-x64-target-aarch64': - optional: true - '@napi-rs/cross-toolchain-x64-target-armv7': - optional: true - '@napi-rs/cross-toolchain-x64-target-x86_64': - optional: true - - '@napi-rs/lzma-android-arm-eabi@1.3.1': - resolution: {integrity: sha512-mtGOg8jXlc+pTBI86cqohfndS9UmOAkk9d5CChKMb8btVks70yhUN1e7YYS3QFbmoxbPs2Ee+wmuH1Khdc7B2w==} - engines: {node: '>= 10'} - cpu: [arm] - os: [android] - - '@napi-rs/lzma-android-arm64@1.3.1': - resolution: {integrity: sha512-4uGkQgAv9Tnc/i0k2eIgbhZgyzs94+iECWxz4MFZNcZ1fNGvGbRL2j+SITE4OmwrUn3TuFK/uYWfgzooq8E1Qg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [android] - - '@napi-rs/lzma-darwin-arm64@1.3.1': - resolution: {integrity: sha512-MZBg4iwHTS8icjTiCMdzh8kYrMmKBCEglFPa+vjI91R2XDwuuwSzqmpATRpmMH8cWUUWtGPF4fnxKzjgkzhd4Q==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [darwin] - - '@napi-rs/lzma-darwin-x64@1.3.1': - resolution: {integrity: sha512-7vte+1lYV7xgZERKH/pjAeh4T16aQASKOzu4op70pK6VP/64Plr5rrvqxQqQmlAIe4pwyo/RkFl1n4LXDod3xg==} - engines: {node: '>= 10'} - cpu: [x64] - os: [darwin] - - '@napi-rs/lzma-freebsd-x64@1.3.1': - resolution: {integrity: sha512-uBS74fynTqLUC3catIxyezCafn8UDlr2yxVV47vz1T6Vop2PGDz/cMQdV6rnLSjPE08Rv66ihM36mgf/MmOkOg==} - engines: {node: '>= 10'} - cpu: [x64] - os: [freebsd] - - '@napi-rs/lzma-linux-arm-gnueabihf@1.3.1': - resolution: {integrity: sha512-rrVLyqBJeN29gPJCNkPbZ7dAzaseEcERKyhjwM+DfbFrDUvtkEcrYPvo+iwE/NmF+OkZQkzcanrVMGnq/mcJYQ==} - engines: {node: '>= 10'} - cpu: [arm] - os: [linux] - - '@napi-rs/lzma-linux-arm64-gnu@1.3.1': - resolution: {integrity: sha512-vDmVsthRbX2opkgRirJJGKQxUP/spvyVM2Y5CyCWZ7sadSID3hA97r38gf9ISn/sJ8/r93IPWLq+iycudNKi+Q==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/lzma-linux-arm64-musl@1.3.1': - resolution: {integrity: sha512-x4m/J3hRdFd3IoqKc+4aBcSUkcuDEP7hH6vdss8bKNLjPfXmnG/lcHJEQX3hNnNOULPP8xVRxgiY8jeL62cnsw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/lzma-linux-x64-gnu@1.3.1': - resolution: {integrity: sha512-riB+Xg72NfH8Kcpq07omshVu0QsLW0v2bhywBNYxvA+t2dGGWSIEN1U/zazUXys+IEA6pBQKqLVseurWE6Cl8g==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/lzma-linux-x64-musl@1.3.1': - resolution: {integrity: sha512-JXLgJFwoeysxdSg7rdVYP8wrliCQVJlU5JcLYjRVSCL4P0mQTjnYi7R7VdaOkDACw/Fvlji7oIJXt0KiaDTcOw==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/lzma-wasm32-wasi@1.3.1': - resolution: {integrity: sha512-XTA9XTUtj0KPKuzNS2oi3bWN6tJodk00wwMd/TiKoEqx9Fe/zu+OfDGuXAn+xs+P7S3YCDHqjYinuTQMZ0ucJw==} - engines: {node: '>=14.0.0'} - cpu: [wasm32] - - '@napi-rs/lzma-win32-arm64-msvc@1.3.1': - resolution: {integrity: sha512-qLDfs9UEtLPPTN/FdSz3gSdlx86VwFQBuLBrQtaiYQtUTKZCOYV1Z1fXqFt5Zqa1HKV2oyXnwGcTI7RpcyXxtg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [win32] - - '@napi-rs/lzma-win32-ia32-msvc@1.3.1': - resolution: {integrity: sha512-rWNlxLFMIfvxzfdQCfeQ3D/HEnQG3vfladFYrXUx6ePXO6r+BLCGn6/LWSSuKlw4vKkb1iHEWsAVaRLIcJEMIA==} - engines: {node: '>= 10'} - cpu: [ia32] - os: [win32] - - '@napi-rs/lzma-win32-x64-msvc@1.3.1': - resolution: {integrity: sha512-SNfHNqEjabXfTL1+KRi0qiAhwIlZHhQystvfSYX6p1g+2trSC/3WUpUQ4fbbR7KyE31g2AAnwjXivnlQ0af/pg==} - engines: {node: '>= 10'} - cpu: [x64] - os: [win32] - - '@napi-rs/lzma@1.3.1': - resolution: {integrity: sha512-XyZoBlYNMvCulK/RmVK/0nB3j7IdH7HpqcrMMg0U+HqQqKRLOQBwvnKNBocPC1bZQ7iZuKWYTLn1ayZwTyek8w==} - engines: {node: '>= 10'} - - '@napi-rs/tar-android-arm-eabi@0.1.1': - resolution: {integrity: sha512-Ufa0ahZvE5KGrC2WBux5svCe/jvC+e8IgtleiicwqnfgTfbDknYyq/QuqkP1AnMp/IvTmx2iutCZt6OFIG0zAg==} - engines: {node: '>= 10'} - cpu: [arm] - os: [android] - - '@napi-rs/tar-android-arm64@0.1.1': - resolution: {integrity: sha512-KUu5fHIiIObSuZ/crHxUrQ243+LiCRKPwdCVLHwjtftqFjzls+R2Mp6GrpM41XxexDMN00SUta3kazi93Xr19A==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [android] - - '@napi-rs/tar-darwin-arm64@0.1.1': - resolution: {integrity: sha512-jaqgdX20iIga+2gzotQ78eF00Cm8vECocUYeMY62WqyzJNv/jx1dlOfELWEccOjpmawFT9tjWebsS9F1QMvSUg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [darwin] - - '@napi-rs/tar-darwin-x64@0.1.1': - resolution: {integrity: sha512-80sa32IxfRso9x9sGTFpfLSx3BnruyJODpSkUzalOCz9i14n5gOKA8KR/JrnSWwDz0p5l5P9kfQD3pu8Voj7WA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [darwin] - - '@napi-rs/tar-freebsd-x64@0.1.1': - resolution: {integrity: sha512-P7V1zBjjC1dCrTwtUzuzYM4AeZduigeCtd8qQw2IUZowM5AsmhMd77oYuXjdU29cEpKUpyYjJRxjPCzFy+WbAQ==} - engines: {node: '>= 10'} - cpu: [x64] - os: [freebsd] - - '@napi-rs/tar-linux-arm-gnueabihf@0.1.1': - resolution: {integrity: sha512-qpC71ILPkWKt8k1iJCYt5gjwcOkd2VFSQIelTRr12t5CVNKV04rE/TMdwFoCP7kxbtb9Fl2cZzCRISw2BhMCmQ==} - engines: {node: '>= 10'} - cpu: [arm] - os: [linux] - - '@napi-rs/tar-linux-arm64-gnu@0.1.1': - resolution: {integrity: sha512-71QgxcFJCog6O4Tauoge8D0ILkDGJTRk3ru7zG8PUFG1QXJ1kkiRikdT77YmoVxtomc9FUOt+bdEdU5Yn+3QUQ==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/tar-linux-arm64-musl@0.1.1': - resolution: {integrity: sha512-R2e7YEILPKc447N1hUt1zQuyy0st83HX6nhmtFywS1aOj76/3hzxLVrebGiiS6kifyCrO82o66CNTYe7DixMZw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/tar-linux-x64-gnu@0.1.1': - resolution: {integrity: sha512-tmy9q2LXUB2GQ+IgUzJn3+us52leplMu96ORyFq1iHQEelGSqXt4xi5DzU07JhX3obJPqVqkybtcRS4enBfmBA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/tar-linux-x64-musl@0.1.1': - resolution: {integrity: sha512-j5ePbe6vihApl0cGPPDUVTWZbf2mF4NhxngAoG2jp7AeX3cWP2O4pjsvaOraW6QfvWEMFPeER7S0b6eBS7duvA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/tar-wasm32-wasi@0.1.1': - resolution: {integrity: sha512-se0+DlOiIRt7mcz7BeOJDoZtCrROpKLwiAOGmNgrjQ/SZS7TnOPuwm3wy9XN9WLoepttEjCEem6UP8yD5GJuQg==} - engines: {node: '>=14.0.0'} - cpu: [wasm32] - - '@napi-rs/tar-win32-arm64-msvc@0.1.1': - resolution: {integrity: sha512-FDZPi2wC7RwzvodogigLh/pJvhqCTVTUqOYuHlLkPSUbSAGiEkI55wk9RqH3y3EdJQaDuzyqC0QKz5ket2U+GA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [win32] - - '@napi-rs/tar-win32-ia32-msvc@0.1.1': - resolution: {integrity: sha512-OPR9Tou5z5M912G7Kc7gkf1ltinbOQx5dS/OeDIWHvPGOfdFDIxt0YVKhzSLRJi43+zIDp8/+cbeMD/cKXfX8w==} - engines: {node: '>= 10'} - cpu: [ia32] - os: [win32] - - '@napi-rs/tar-win32-x64-msvc@0.1.1': - resolution: {integrity: sha512-hiv5KfhrMSg8tTRC2oQXVckVg1h6ZVjwbd5aF9Esl0V3p2TaNFwwbqgnAN4Gm/PmSnHWNL/IRTHkk3cOzDWihQ==} - engines: {node: '>= 10'} - cpu: [x64] - os: [win32] - - '@napi-rs/tar@0.1.1': - resolution: {integrity: sha512-FOMhwwlvoYjHaDBxP26K3D92ltw1Y/CC4CIjgC6qXdzW4MYNwTlEyI58smCM3k+nCVJH3kpOYyH3sgbK4WZA4A==} - engines: {node: '>= 10'} - - '@napi-rs/wasm-runtime@0.2.4': - resolution: {integrity: sha512-9zESzOO5aDByvhIAsOy9TbpZ0Ur2AJbUI7UT73kcUTS2mxAMHOBaa1st/jAymNoCtvrit99kkzT1FZuXVcgfIQ==} - - '@napi-rs/wasm-tools-android-arm-eabi@0.0.2': - resolution: {integrity: sha512-/b+UU3suXjW4P0DzHRNdrnebQtFKcQf/YMeZJH+xUlKgvwli5kbmWjx8Wqqz0VETVkUTuPqJMBDIVLyc+14FGw==} - engines: {node: '>= 10'} - cpu: [arm] - os: [android] - - '@napi-rs/wasm-tools-android-arm64@0.0.2': - resolution: {integrity: sha512-j57GbDflwJdZtT8pZj5fOV4JAP+LdKN+wzsUYs+QRUoBqpWbbUANudolqfw63bkS9sD4z7fbCuz8iwtJqzxTVA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [android] - - '@napi-rs/wasm-tools-darwin-arm64@0.0.2': - resolution: {integrity: sha512-P2ChgWgVuv9GwmbxN89R84KzIImoTqXINteEixUvmkdnhyFiR+I8deNs89Yed+5w8QLC6MEfrtRqLP9YI+NoQA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [darwin] - - '@napi-rs/wasm-tools-darwin-x64@0.0.2': - resolution: {integrity: sha512-T/kQQ0gt8+wau1Z821PKVAD76QhmwVoLs2CT7Z9tTBs2pJvwSCP0C/kQiQAHcJIMi7A2E9Ab/Mez0BERy50EFA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [darwin] - - '@napi-rs/wasm-tools-freebsd-x64@0.0.2': - resolution: {integrity: sha512-GnnHu+r5sfzuxC/1J5UMF/h3BOZnHb3NQZ5hmbCfZYCKzpzRxrAJhzRunlbRN+v0x8M/49dztVTYR3s7K4ooAw==} - engines: {node: '>= 10'} - cpu: [x64] - os: [freebsd] - - '@napi-rs/wasm-tools-linux-arm64-gnu@0.0.2': - resolution: {integrity: sha512-KnZdLT0OnKb1CG2kdt3/WvM43vr9i+FEwXCvSOVC/6Tsifz7ynhMg7LAVESILd03HubzQJfg9nbRsk0bQ+IOwg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/wasm-tools-linux-arm64-musl@0.0.2': - resolution: {integrity: sha512-HkpZOID2U8P6pWqK3mqZ8bxU5xcuT3iA2fO+jrxn78h006iYgfNmdc5JaVhHnHazMmk32xKhSV4iV0VUh8UWDg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/wasm-tools-linux-x64-gnu@0.0.2': - resolution: {integrity: sha512-YksJWBCyOalB9ogtP9+/dZKP+vR6+h7BmzMXaXMT71WW/GvIsifMVgv+DY/FRSNJQupp5Y+ugjqVAOUOc/G65g==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/wasm-tools-linux-x64-musl@0.0.2': - resolution: {integrity: sha512-sPtRxPMdw05KdTcxgSPMmSXG2+PiK3vJ/l2+g9hvjnnKtvslJN2Hr7j8zgzuoKRAUFPaJVe6+D2xVh5cpdqhww==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/wasm-tools-wasm32-wasi@0.0.2': - resolution: {integrity: sha512-muRvZK7AIuo88G2AxYx3gA59rHMQgoN004saQkBvXnz3K/DVHKfTZ6TtUebss8zI3dURU6xExL8drxFWYxjEbQ==} - engines: {node: '>=14.0.0'} - cpu: [wasm32] - - '@napi-rs/wasm-tools-win32-arm64-msvc@0.0.2': - resolution: {integrity: sha512-Cn13WQ+tpFqdVwx0DIWKbsI9auFyzVZV4F5UNOUeDt6GgOL+NndgJul0Pc9bSU6fi03AylMPfF/nTCaDWO2Wgw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [win32] - - '@napi-rs/wasm-tools-win32-ia32-msvc@0.0.2': - resolution: {integrity: sha512-xsg5DkIQi82a8rcx6246Y3XC8TIqHamY+/C6sIlPLaZEuHctDkMECAw0AANwRf5vN//D2oo2oljOuoYtB1GOKw==} - engines: {node: '>= 10'} - cpu: [ia32] - os: [win32] - - '@napi-rs/wasm-tools-win32-x64-msvc@0.0.2': - resolution: {integrity: sha512-yHigltEt33eq8bappvKsIliz4MxfMPn1M+NWbIFRWN+IS1Z57mhmc1osuk+IRXrSlq0Tom0R6MYN1jpkZKz81Q==} - engines: {node: '>= 10'} - cpu: [x64] - os: [win32] - - '@napi-rs/wasm-tools@0.0.2': - resolution: {integrity: sha512-kBvDQCP5BLw2TxTENXLp3Of7vVEx0uyIye824JHE4dduzzOHVgSoOFVhVqAT3Fx/hLV445RVWfEqQbXMg4w/Mw==} - engines: {node: '>= 10'} - - '@nodelib/fs.scandir@2.1.5': - resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} - engines: {node: '>= 8'} - - '@nodelib/fs.stat@2.0.5': - resolution: {integrity: sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==} - engines: {node: '>= 8'} - - '@nodelib/fs.walk@1.2.8': - resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} - engines: {node: '>= 8'} - - '@octokit/auth-token@5.1.1': - resolution: {integrity: sha512-rh3G3wDO8J9wSjfI436JUKzHIxq8NaiL0tVeB2aXmG6p/9859aUOAjA9pmSPNGGZxfwmaJ9ozOJImuNVJdpvbA==} - engines: {node: '>= 18'} - - '@octokit/core@6.1.2': - resolution: {integrity: sha512-hEb7Ma4cGJGEUNOAVmyfdB/3WirWMg5hDuNFVejGEDFqupeOysLc2sG6HJxY2etBp5YQu5Wtxwi020jS9xlUwg==} - engines: {node: '>= 18'} - - '@octokit/endpoint@10.1.1': - resolution: {integrity: sha512-JYjh5rMOwXMJyUpj028cu0Gbp7qe/ihxfJMLc8VZBMMqSwLgOxDI1911gV4Enl1QSavAQNJcwmwBF9M0VvLh6Q==} - engines: {node: '>= 18'} - - '@octokit/graphql@8.1.1': - resolution: {integrity: sha512-ukiRmuHTi6ebQx/HFRCXKbDlOh/7xEV6QUXaE7MJEKGNAncGI/STSbOkl12qVXZrfZdpXctx5O9X1AIaebiDBg==} - engines: {node: '>= 18'} - - '@octokit/openapi-types@22.2.0': - resolution: {integrity: sha512-QBhVjcUa9W7Wwhm6DBFu6ZZ+1/t/oYxqc2tp81Pi41YNuJinbFRx8B133qVOrAaBbF7D/m0Et6f9/pZt9Rc+tg==} - - '@octokit/plugin-paginate-rest@11.3.3': - resolution: {integrity: sha512-o4WRoOJZlKqEEgj+i9CpcmnByvtzoUYC6I8PD2SA95M+BJ2x8h7oLcVOg9qcowWXBOdcTRsMZiwvM3EyLm9AfA==} - engines: {node: '>= 18'} - peerDependencies: - '@octokit/core': '>=6' - - '@octokit/plugin-request-log@5.3.0': - resolution: {integrity: sha512-FiGcyjdtYPlr03ExBk/0ysIlEFIFGJQAVoPPMxL19B24bVSEiZQnVGBunNtaAF1YnvE/EFoDpXmITtRnyCiypQ==} - engines: {node: '>= 18'} - peerDependencies: - '@octokit/core': '>=6' - - '@octokit/plugin-rest-endpoint-methods@13.2.4': - resolution: {integrity: sha512-gusyAVgTrPiuXOdfqOySMDztQHv6928PQ3E4dqVGEtOvRXAKRbJR4b1zQyniIT9waqaWk/UDaoJ2dyPr7Bk7Iw==} - engines: {node: '>= 18'} - peerDependencies: - '@octokit/core': '>=6' - - '@octokit/request-error@6.1.2': - resolution: {integrity: sha512-sA0oF7aL5wXbNfl+7zgLYJiFZctei9GaIMJlTraJrlQyFaoIYr4MCqPSakzxxGCfm8fET4vn0cQdRFmD7avlDg==} - engines: {node: '>= 18'} - - '@octokit/request@9.1.1': - resolution: {integrity: sha512-pyAguc0p+f+GbQho0uNetNQMmLG1e80WjkIaqqgUkihqUp0boRU6nKItXO4VWnr+nbZiLGEyy4TeKRwqaLvYgw==} - engines: {node: '>= 18'} - - '@octokit/rest@21.0.0': - resolution: {integrity: sha512-XudXXOmiIjivdjNZ+fN71NLrnDM00sxSZlhqmPR3v0dVoJwyP628tSlc12xqn8nX3N0965583RBw5GPo6r8u4Q==} - engines: {node: '>= 18'} - - '@octokit/types@13.5.0': - resolution: {integrity: sha512-HdqWTf5Z3qwDVlzCrP8UJquMwunpDiMPt5er+QjGzL4hqr/vBVY/MauQgS1xWxCDT1oMx1EULyqxncdCY/NVSQ==} - - '@rollup/pluginutils@4.2.1': - resolution: {integrity: sha512-iKnFXr7NkdZAIHiIWE+BX5ULi/ucVFYWD6TbAV+rZctiRTY2PL6tsIKhoIOaoskiWAkgu+VsbXgUVDNLHf+InQ==} - engines: {node: '>= 8.0.0'} - - '@sindresorhus/merge-streams@2.3.0': - resolution: {integrity: sha512-LtoMMhxAlorcGhmFYI+LhPgbPZCkgP6ra1YL604EeF6U98pLlQ3iWIGMdWSC+vWmPBWBNgmDBAhnAobLROJmwg==} - engines: {node: '>=18'} - - '@tybys/wasm-util@0.9.0': - resolution: {integrity: sha512-6+7nlbMVX/PVDCwaIQ8nTOPveOcFLSt8GcXdx8hD0bt39uWxYT88uXzqTd4fTvqta7oeUJqudepapKNt2DYJFw==} - - '@types/mute-stream@0.0.4': - resolution: {integrity: sha512-CPM9nzrCPPJHQNA9keH9CVkVI+WR5kMa+7XEs5jcGQ0VoAGnLv242w8lIVgwAEfmE4oufJRaTc9PNLQl0ioAow==} - - '@types/node@20.14.10': - resolution: {integrity: sha512-MdiXf+nDuMvY0gJKxyfZ7/6UFsETO7mGKF54MVD/ekJS6HdFtpZFBgrh6Pseu64XTb2MLyFPlbW6hj8HYRQNOQ==} - - '@types/node@22.0.0': - resolution: {integrity: sha512-VT7KSYudcPOzP5Q0wfbowyNLaVR8QWUdw+088uFWwfvpY6uCWaXpqV6ieLAu9WBcnTa7H4Z5RLK8I5t2FuOcqw==} - - '@types/stylis@4.2.6': - resolution: {integrity: sha512-4nebF2ZJGzQk0ka0O6+FZUWceyFv4vWq/0dXBMmrSeAwzOuOd/GxE5Pa64d/ndeNLG73dXoBsRzvtsVsYUv6Uw==} - - '@types/wrap-ansi@3.0.0': - resolution: {integrity: sha512-ltIpx+kM7g/MLRZfkbL7EsCEjfzCcScLpkg37eXEtx5kmrAKBkTJwd1GIAjDSL8wTpM6Hzn5YO4pSb91BEwu1g==} - - '@vercel/nft@0.26.5': - resolution: {integrity: sha512-NHxohEqad6Ra/r4lGknO52uc/GrWILXAMs1BB4401GTqww0fw1bAqzpG1XHuDO+dprg4GvsD9ZLLSsdo78p9hQ==} - engines: {node: '>=16'} - hasBin: true - - abbrev@1.1.1: - resolution: {integrity: sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==} - - acorn-import-attributes@1.9.5: - resolution: {integrity: sha512-n02Vykv5uA3eHGM/Z2dQrcD56kL8TyDb2p1+0P83PClMnC/nc+anbQRhIOWnSq4Ke/KvDPrY3C9hDtC/A3eHnQ==} - peerDependencies: - acorn: ^8 - - acorn-walk@8.3.3: - resolution: {integrity: sha512-MxXdReSRhGO7VlFe1bRG/oI7/mdLV9B9JJT0N8vZOhF7gFRR5l3M8W9G8JxmKV+JC5mGqJ0QvqfSOLsCPa4nUw==} - engines: {node: '>=0.4.0'} - - acorn@8.12.1: - resolution: {integrity: sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg==} - engines: {node: '>=0.4.0'} - hasBin: true - - agent-base@6.0.2: - resolution: {integrity: sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==} - engines: {node: '>= 6.0.0'} - - ansi-escapes@4.3.2: - resolution: {integrity: sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==} - engines: {node: '>=8'} - - ansi-regex@5.0.1: - resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} - engines: {node: '>=8'} - - ansi-regex@6.0.1: - resolution: {integrity: sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==} - engines: {node: '>=12'} - - ansi-styles@4.3.0: - resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} - engines: {node: '>=8'} - - ansi-styles@6.2.1: - resolution: {integrity: sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==} - engines: {node: '>=12'} - - aproba@2.0.0: - resolution: {integrity: sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==} - - are-we-there-yet@2.0.0: - resolution: {integrity: sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw==} - engines: {node: '>=10'} - deprecated: This package is no longer supported. - - argparse@1.0.10: - resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==} - - argparse@2.0.1: - resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} - - array-find-index@1.0.2: - resolution: {integrity: sha512-M1HQyIXcBGtVywBt8WVdim+lrNaK7VHp99Qt5pSNziXznKHViIBbXWtfRTpEFpF/c4FdfxNAsCCwPp5phBYJtw==} - engines: {node: '>=0.10.0'} - - arrgv@1.0.2: - resolution: {integrity: sha512-a4eg4yhp7mmruZDQFqVMlxNRFGi/i1r87pt8SDHy0/I8PqSXoUTlWZRdAZo0VXgvEARcujbtTk8kiZRi1uDGRw==} - engines: {node: '>=8.0.0'} - - arrify@3.0.0: - resolution: {integrity: sha512-tLkvA81vQG/XqE2mjDkGQHoOINtMHtysSnemrmoGe6PydDPMRbVugqyk4A6V/WDWEfm3l+0d8anA9r8cv/5Jaw==} - engines: {node: '>=12'} - - async-sema@3.1.1: - resolution: {integrity: sha512-tLRNUXati5MFePdAk8dw7Qt7DpxPB60ofAgn8WRhW6a2rcimZnYBP9oxHiv0OHy+Wz7kPMG+t4LGdt31+4EmGg==} - - asynckit@0.4.0: - resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} - - ava@6.1.3: - resolution: {integrity: sha512-tkKbpF1pIiC+q09wNU9OfyTDYZa8yuWvU2up3+lFJ3lr1RmnYh2GBpPwzYUEB0wvTPIUysGjcZLNZr7STDviRA==} - engines: {node: ^18.18 || ^20.8 || ^21 || ^22} - hasBin: true - peerDependencies: - '@ava/typescript': '*' - peerDependenciesMeta: - '@ava/typescript': - optional: true - - axios@1.6.2: - resolution: {integrity: sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A==} - - balanced-match@1.0.2: - resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} - - before-after-hook@3.0.2: - resolution: {integrity: sha512-Nik3Sc0ncrMK4UUdXQmAnRtzmNQTAAXmXIopizwZ1W1t8QmfJj+zL4OA2I7XPTPW5z5TDqv4hRo/JzouDJnX3A==} - - bindings@1.5.0: - resolution: {integrity: sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==} - - blueimp-md5@2.19.0: - resolution: {integrity: sha512-DRQrD6gJyy8FbiE4s+bDoXS9hiW3Vbx5uCdwvcCf3zLHL+Iv7LtGHLpr+GZV8rHG8tK766FGYBwRbu8pELTt+w==} - - brace-expansion@1.1.11: - resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} - - braces@3.0.3: - resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==} - engines: {node: '>=8'} - - callsites@4.2.0: - resolution: {integrity: sha512-kfzR4zzQtAE9PC7CzZsjl3aBNbXWuXiSeOCdLcPpBfGW8YuCqQHcRPFDbr/BPVmd3EEPVpuFzLyuT/cUhPr4OQ==} - engines: {node: '>=12.20'} - - camelize@1.0.1: - resolution: {integrity: sha512-dU+Tx2fsypxTgtLoE36npi3UqcjSSMNYfkqgmoEhtZrraP5VWq0K7FkWVTYa8eMPtnU/G2txVsfdCJTn9uzpuQ==} - - cbor@9.0.2: - resolution: {integrity: sha512-JPypkxsB10s9QOWwa6zwPzqE1Md3vqpPc+cai4sAecuCsRyAtAl/pMyhPlMbT/xtPnm2dznJZYRLui57qiRhaQ==} - engines: {node: '>=16'} - - chalk@5.3.0: - resolution: {integrity: sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==} - engines: {node: ^12.17.0 || ^14.13 || >=16.0.0} - - chardet@0.7.0: - resolution: {integrity: sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==} - - chownr@2.0.0: - resolution: {integrity: sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==} - engines: {node: '>=10'} - - chunkd@2.0.1: - resolution: {integrity: sha512-7d58XsFmOq0j6el67Ug9mHf9ELUXsQXYJBkyxhH/k+6Ke0qXRnv0kbemx+Twc6fRJ07C49lcbdgm9FL1Ei/6SQ==} - - ci-info@4.0.0: - resolution: {integrity: sha512-TdHqgGf9odd8SXNuxtUBVx8Nv+qZOejE6qyqiy5NtbYYQOeFa6zmHkxlPzmaLxWWHsU6nJmB7AETdVPi+2NBUg==} - engines: {node: '>=8'} - - ci-parallel-vars@1.0.1: - resolution: {integrity: sha512-uvzpYrpmidaoxvIQHM+rKSrigjOe9feHYbw4uOI2gdfe1C3xIlxO+kVXq83WQWNniTf8bAxVpy+cQeFQsMERKg==} - - cli-spinners@2.9.2: - resolution: {integrity: sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==} - engines: {node: '>=6'} - - cli-truncate@4.0.0: - resolution: {integrity: sha512-nPdaFdQ0h/GEigbPClz11D0v/ZJEwxmeVZGeMo3Z5StPtUTkA9o1lD6QwoirYiSDzbcwn2XcjwmCp68W1IS4TA==} - engines: {node: '>=18'} - - cli-width@4.1.0: - resolution: {integrity: sha512-ouuZd4/dm2Sw5Gmqy6bGyNNNe1qt9RpmxveLSO7KcgsTnU7RXfsw+/bukWGo1abgBiMAic068rclZsO4IWmmxQ==} - engines: {node: '>= 12'} - - clipanion@3.2.1: - resolution: {integrity: sha512-dYFdjLb7y1ajfxQopN05mylEpK9ZX0sO1/RfMXdfmwjlIsPkbh4p7A682x++zFPLDCo1x3p82dtljHf5cW2LKA==} - peerDependencies: - typanion: '*' - - cliui@8.0.1: - resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==} - engines: {node: '>=12'} - - code-excerpt@4.0.0: - resolution: {integrity: sha512-xxodCmBen3iy2i0WtAK8FlFNrRzjUqjRsMfho58xT/wvZU1YTM3fCnRjcy1gJPMepaRlgm/0e6w8SpWHpn3/cA==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - color-convert@2.0.1: - resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} - engines: {node: '>=7.0.0'} - - color-name@1.1.4: - resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} - - color-support@1.1.3: - resolution: {integrity: sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==} - hasBin: true - - colorette@2.0.20: - resolution: {integrity: sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==} - - combined-stream@1.0.8: - resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} - engines: {node: '>= 0.8'} - - common-path-prefix@3.0.0: - resolution: {integrity: sha512-QE33hToZseCH3jS0qN96O/bSh3kaw/h+Tq7ngyY9eWDUnTlTNUyqfqvCXioLe5Na5jFsL78ra/wuBU4iuEgd4w==} - - concat-map@0.0.1: - resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} - - concordance@5.0.4: - resolution: {integrity: sha512-OAcsnTEYu1ARJqWVGwf4zh4JDfHZEaSNlNccFmt8YjB2l/n19/PF2viLINHc57vO4FKIAFl2FWASIGZZWZ2Kxw==} - engines: {node: '>=10.18.0 <11 || >=12.14.0 <13 || >=14'} - - console-control-strings@1.1.0: - resolution: {integrity: sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==} - - convert-to-spaces@2.0.1: - resolution: {integrity: sha512-rcQ1bsQO9799wq24uE5AM2tAILy4gXGIK/njFWcVQkGNZ96edlpY+A7bjwvzjYvLDyzmG1MmMLZhpcsb+klNMQ==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - css-color-keywords@1.0.0: - resolution: {integrity: sha512-FyyrDHZKEjXDpNJYvVsV960FiqQyXc/LlYmsxl2BcdMb2WPx0OGRVgTg55rPSyLSNMqP52R9r8geSp7apN3Ofg==} - engines: {node: '>=4'} - - css-to-react-native@3.2.0: - resolution: {integrity: sha512-e8RKaLXMOFii+02mOlqwjbD00KSEKqblnpO9e++1aXS1fPQOpS1YoqdVHBqPjHNoxeF2mimzVqawm2KCbEdtHQ==} - - csstype@3.1.3: - resolution: {integrity: sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==} - - currently-unhandled@0.4.1: - resolution: {integrity: sha512-/fITjgjGU50vjQ4FH6eUoYu+iUoUKIXws2hL15JJpIR+BbTxaXQsMuuyjtNh2WqsSBS5nsaZHFsFecyw5CCAng==} - engines: {node: '>=0.10.0'} - - date-time@3.1.0: - resolution: {integrity: sha512-uqCUKXE5q1PNBXjPqvwhwJf9SwMoAHBgWJ6DcrnS5o+W2JOiIILl0JEdVD8SGujrNS02GGxgwAg2PN2zONgtjg==} - engines: {node: '>=6'} - - debug@4.3.5: - resolution: {integrity: sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg==} - engines: {node: '>=6.0'} - peerDependencies: - supports-color: '*' - peerDependenciesMeta: - supports-color: - optional: true - - delayed-stream@1.0.0: - resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} - engines: {node: '>=0.4.0'} - - delegates@1.0.0: - resolution: {integrity: sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==} - - detect-libc@2.0.3: - resolution: {integrity: sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw==} - engines: {node: '>=8'} - - emittery@1.0.3: - resolution: {integrity: sha512-tJdCJitoy2lrC2ldJcqN4vkqJ00lT+tOWNT1hBJjO/3FDMJa5TTIiYGCKGkn/WfCyOzUMObeohbVTj00fhiLiA==} - engines: {node: '>=14.16'} - - emnapi@1.2.0: - resolution: {integrity: sha512-rcq+dJCcfr08I0XM/57LPRqaUokGfni/+SvhO7NaJthTTjRdohhIy0FQwyC5rR1enAsjkldQg83th8J5hURv0Q==} - peerDependencies: - node-addon-api: '>= 6.1.0' - peerDependenciesMeta: - node-addon-api: - optional: true - - emoji-regex@10.3.0: - resolution: {integrity: sha512-QpLs9D9v9kArv4lfDEgg1X/gN5XLnf/A6l9cs8SPZLRZR3ZkY9+kwIQTxm+fsSej5UMYGE8fdoaZVIBlqG0XTw==} - - emoji-regex@8.0.0: - resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} - - escalade@3.1.2: - resolution: {integrity: sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==} - engines: {node: '>=6'} - - escape-string-regexp@2.0.0: - resolution: {integrity: sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==} - engines: {node: '>=8'} - - escape-string-regexp@5.0.0: - resolution: {integrity: sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==} - engines: {node: '>=12'} - - esprima@4.0.1: - resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==} - engines: {node: '>=4'} - hasBin: true - - estree-walker@2.0.2: - resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==} - - esutils@2.0.3: - resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} - engines: {node: '>=0.10.0'} - - external-editor@3.1.0: - resolution: {integrity: sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==} - engines: {node: '>=4'} - - fast-diff@1.3.0: - resolution: {integrity: sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==} - - fast-glob@3.3.2: - resolution: {integrity: sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==} - engines: {node: '>=8.6.0'} - - fastq@1.17.1: - resolution: {integrity: sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==} - - figures@6.1.0: - resolution: {integrity: sha512-d+l3qxjSesT4V7v2fh+QnmFnUWv9lSpjarhShNTgBOfA0ttejbQUAlHLitbjkoRiDulW0OPoQPYIGhIC8ohejg==} - engines: {node: '>=18'} - - file-uri-to-path@1.0.0: - resolution: {integrity: sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==} - - fill-range@7.1.1: - resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==} - engines: {node: '>=8'} - - find-up-simple@1.0.0: - resolution: {integrity: sha512-q7Us7kcjj2VMePAa02hDAF6d+MzsdsAWEwYyOpwUtlerRBkOEPBCRZrAV4XfcSN8fHAgaD0hP7miwoay6DCprw==} - engines: {node: '>=18'} - - follow-redirects@1.15.6: - resolution: {integrity: sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==} - engines: {node: '>=4.0'} - peerDependencies: - debug: '*' - peerDependenciesMeta: - debug: - optional: true - - form-data@4.0.0: - resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==} - engines: {node: '>= 6'} - - fs-minipass@2.1.0: - resolution: {integrity: sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==} - engines: {node: '>= 8'} - - fs.realpath@1.0.0: - resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} - - gauge@3.0.2: - resolution: {integrity: sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q==} - engines: {node: '>=10'} - deprecated: This package is no longer supported. - - get-caller-file@2.0.5: - resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} - engines: {node: 6.* || 8.* || >= 10.*} - - get-east-asian-width@1.2.0: - resolution: {integrity: sha512-2nk+7SIVb14QrgXFHcm84tD4bKQz0RxPuMT8Ag5KPOq7J5fEmAg0UbXdTOSHqNuHSU28k55qnceesxXRZGzKWA==} - engines: {node: '>=18'} - - glob-parent@5.1.2: - resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} - engines: {node: '>= 6'} - - glob@7.2.3: - resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} - deprecated: Glob versions prior to v9 are no longer supported - - globby@14.0.2: - resolution: {integrity: sha512-s3Fq41ZVh7vbbe2PN3nrW7yC7U7MFVc5c98/iTl9c2GawNMKx/J648KQRW6WKkuU8GIbbh2IXfIRQjOZnXcTnw==} - engines: {node: '>=18'} - - graceful-fs@4.2.11: - resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} - - has-unicode@2.0.1: - resolution: {integrity: sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==} - - https-proxy-agent@5.0.1: - resolution: {integrity: sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==} - engines: {node: '>= 6'} - - iconv-lite@0.4.24: - resolution: {integrity: sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==} - engines: {node: '>=0.10.0'} - - ignore-by-default@2.1.0: - resolution: {integrity: sha512-yiWd4GVmJp0Q6ghmM2B/V3oZGRmjrKLXvHR3TE1nfoXsmoggllfZUQe74EN0fJdPFZu2NIvNdrMMLm3OsV7Ohw==} - engines: {node: '>=10 <11 || >=12 <13 || >=14'} - - ignore@5.3.1: - resolution: {integrity: sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==} - engines: {node: '>= 4'} - - imurmurhash@0.1.4: - resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} - engines: {node: '>=0.8.19'} - - indent-string@5.0.0: - resolution: {integrity: sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==} - engines: {node: '>=12'} - - inflight@1.0.6: - resolution: {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. - - inherits@2.0.4: - resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} - - inquirer@10.0.1: - resolution: {integrity: sha512-XgthhRIn0Ci9JdGJpUo2EtpPfaczbooZbGTN+FTzSCyUb7YHJcPPnuSXfeG5903bJMy3OyEoVTQMnvO4Ly5tFg==} - engines: {node: '>=18'} - - ipaddr.js@2.2.0: - resolution: {integrity: sha512-Ag3wB2o37wslZS19hZqorUnrnzSkpOVy+IiiDEiTqNubEYpYuHWIf6K4psgN2ZWKExS4xhVCrRVfb/wfW8fWJA==} - engines: {node: '>= 10'} - - irregular-plurals@3.5.0: - resolution: {integrity: sha512-1ANGLZ+Nkv1ptFb2pa8oG8Lem4krflKuX/gINiHJHjJUKaJHk/SXk5x6K3J+39/p0h1RQ2saROclJJ+QLvETCQ==} - engines: {node: '>=8'} - - is-extglob@2.1.1: - resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} - engines: {node: '>=0.10.0'} - - is-fullwidth-code-point@3.0.0: - resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} - engines: {node: '>=8'} - - is-fullwidth-code-point@4.0.0: - resolution: {integrity: sha512-O4L094N2/dZ7xqVdrXhh9r1KODPJpFms8B5sGdJLPy664AgvXsreZUyCQQNItZRDlYug4xStLjNp/sz3HvBowQ==} - engines: {node: '>=12'} - - is-glob@4.0.3: - resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} - engines: {node: '>=0.10.0'} - - is-number@7.0.0: - resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} - engines: {node: '>=0.12.0'} - - is-plain-object@5.0.0: - resolution: {integrity: sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==} - engines: {node: '>=0.10.0'} - - is-promise@4.0.0: - resolution: {integrity: sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==} - - is-unicode-supported@2.0.0: - resolution: {integrity: sha512-FRdAyx5lusK1iHG0TWpVtk9+1i+GjrzRffhDg4ovQ7mcidMQ6mj+MhKPmvh7Xwyv5gIS06ns49CA7Sqg7lC22Q==} - engines: {node: '>=18'} - - js-string-escape@1.0.1: - resolution: {integrity: sha512-Smw4xcfIQ5LVjAOuJCvN/zIodzA/BBSsluuoSykP+lUvScIi4U6RJLfwHet5cxFnCswUjISV8oAXaqaJDY3chg==} - engines: {node: '>= 0.8'} - - js-tokens@4.0.0: - resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} - - js-yaml@3.14.1: - resolution: {integrity: sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==} - hasBin: true - - js-yaml@4.1.0: - resolution: {integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==} - hasBin: true - - load-json-file@7.0.1: - resolution: {integrity: sha512-Gnxj3ev3mB5TkVBGad0JM6dmLiQL+o0t23JPBZ9sd+yvSLk05mFoqKBw5N8gbbkU4TNXyqCgIrl/VM17OgUIgQ==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - lodash-es@4.17.21: - resolution: {integrity: sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==} - - lodash@4.17.21: - resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} - - loose-envify@1.4.0: - resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==} - hasBin: true - - make-dir@3.1.0: - resolution: {integrity: sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==} - engines: {node: '>=8'} - - matcher@5.0.0: - resolution: {integrity: sha512-s2EMBOWtXFc8dgqvoAzKJXxNHibcdJMV0gwqKUaw9E2JBJuGUK7DrNKrA6g/i+v72TT16+6sVm5mS3thaMLQUw==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - md5-hex@3.0.1: - resolution: {integrity: sha512-BUiRtTtV39LIJwinWBjqVsU9xhdnz7/i889V859IBFpuqGAj6LuOvHv5XLbgZ2R7ptJoJaEcxkv88/h25T7Ciw==} - engines: {node: '>=8'} - - memoize@10.0.0: - resolution: {integrity: sha512-H6cBLgsi6vMWOcCpvVCdFFnl3kerEXbrYh9q+lY6VXvQSmM6CkmV08VOwT+WE2tzIEqRPFfAq3fm4v/UIW6mSA==} - engines: {node: '>=18'} - - merge2@1.4.1: - resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} - engines: {node: '>= 8'} - - micromatch@4.0.7: - resolution: {integrity: sha512-LPP/3KorzCwBxfeUuZmaR6bG2kdeHSbe0P2tY3FLRU4vYrjYz5hI4QZwV0njUx3jeuKe67YukQ1LSPZBKDqO/Q==} - engines: {node: '>=8.6'} - - mime-db@1.52.0: - resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} - engines: {node: '>= 0.6'} - - mime-types@2.1.35: - resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} - engines: {node: '>= 0.6'} - - mimic-function@5.0.1: - resolution: {integrity: sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==} - engines: {node: '>=18'} - - minimatch@3.1.2: - resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} - - minipass@3.3.6: - resolution: {integrity: sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==} - engines: {node: '>=8'} - - minipass@5.0.0: - resolution: {integrity: sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==} - engines: {node: '>=8'} - - minizlib@2.1.2: - resolution: {integrity: sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==} - engines: {node: '>= 8'} - - mkdirp@1.0.4: - resolution: {integrity: sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==} - engines: {node: '>=10'} - hasBin: true - - ms@2.1.2: - resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} - - ms@2.1.3: - resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} - - mute-stream@1.0.0: - resolution: {integrity: sha512-avsJQhyd+680gKXyG/sQc0nXaC6rBkPOfyHYcFb9+hdkqQkR9bdnkJ0AMZhke0oesPqIO+mFFJ+IdBc7mst4IA==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - - nanoid@3.3.7: - resolution: {integrity: sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==} - engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} - hasBin: true - - node-fetch@2.7.0: - resolution: {integrity: sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==} - engines: {node: 4.x || >=6.0.0} - peerDependencies: - encoding: ^0.1.0 - peerDependenciesMeta: - encoding: - optional: true - - node-gyp-build@4.8.1: - resolution: {integrity: sha512-OSs33Z9yWr148JZcbZd5WiAXhh/n9z8TxQcdMhIOlpN9AhWpLfvVFO73+m77bBABQMaY9XSvIa+qk0jlI7Gcaw==} - hasBin: true - - nofilter@3.1.0: - resolution: {integrity: sha512-l2NNj07e9afPnhAhvgVrCD/oy2Ai1yfLpuo3EpiO1jFTsB4sFz6oIfAfSZyQzVpkZQ9xS8ZS5g1jCBgq4Hwo0g==} - engines: {node: '>=12.19'} - - nopt@5.0.0: - resolution: {integrity: sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==} - engines: {node: '>=6'} - hasBin: true - - npmlog@5.0.1: - resolution: {integrity: sha512-AqZtDUWOMKs1G/8lwylVjrdYgqA4d9nu8hc+0gzRxlDb1I10+FHBGMXs6aiQHFdCUUlqH99MUMuLfzWDNDtfxw==} - deprecated: This package is no longer supported. - - object-assign@4.1.1: - resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} - engines: {node: '>=0.10.0'} - - once@1.4.0: - resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} - - os-tmpdir@1.0.2: - resolution: {integrity: sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==} - engines: {node: '>=0.10.0'} - - p-map@7.0.2: - resolution: {integrity: sha512-z4cYYMMdKHzw4O5UkWJImbZynVIo0lSGTXc7bzB1e/rrDqkgGUNysK/o4bTr+0+xKvvLoTyGqYC4Fgljy9qe1Q==} - engines: {node: '>=18'} - - package-config@5.0.0: - resolution: {integrity: sha512-GYTTew2slBcYdvRHqjhwaaydVMvn/qrGC323+nKclYioNSLTDUM/lGgtGTgyHVtYcozb+XkE8CNhwcraOmZ9Mg==} - engines: {node: '>=18'} - - parse-ms@4.0.0: - resolution: {integrity: sha512-TXfryirbmq34y8QBwgqCVLi+8oA3oWx2eAnSn62ITyEhEYaWRlVZ2DvMM9eZbMs/RfxPu/PK/aBLyGj4IrqMHw==} - engines: {node: '>=18'} - - path-is-absolute@1.0.1: - resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==} - engines: {node: '>=0.10.0'} - - path-type@5.0.0: - resolution: {integrity: sha512-5HviZNaZcfqP95rwpv+1HDgUamezbqdSYTyzjTvwtJSnIH+3vnbmWsItli8OFEndS984VT55M3jduxZbX351gg==} - engines: {node: '>=12'} - - picocolors@1.0.1: - resolution: {integrity: sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==} - - picomatch@2.3.1: - resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} - engines: {node: '>=8.6'} - - picomatch@3.0.1: - resolution: {integrity: sha512-I3EurrIQMlRc9IaAZnqRR044Phh2DXY+55o7uJ0V+hYZAcQYSuFWsc9q5PvyDHUSCe1Qxn/iBz+78s86zWnGag==} - engines: {node: '>=10'} - - plur@5.1.0: - resolution: {integrity: sha512-VP/72JeXqak2KiOzjgKtQen5y3IZHn+9GOuLDafPv0eXa47xq0At93XahYBs26MsifCQ4enGKwbjBTKgb9QJXg==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - postcss-value-parser@4.2.0: - resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==} - - postcss@8.4.33: - resolution: {integrity: sha512-Kkpbhhdjw2qQs2O2DGX+8m5OVqEcbB9HRBvuYM9pgrjEFUg30A9LmXNlTAUj4S9kgtGyrMbTzVjH7E+s5Re2yg==} - engines: {node: ^10 || ^12 || >=14} - - pretty-ms@9.0.0: - resolution: {integrity: sha512-E9e9HJ9R9NasGOgPaPE8VMeiPKAyWR5jcFpNnwIejslIhWqdqOrb2wShBsncMPUb+BcCd2OPYfh7p2W6oemTng==} - engines: {node: '>=18'} - - proxy-from-env@1.1.0: - resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==} - - queue-microtask@1.2.3: - resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} - - react-dom@18.3.1: - resolution: {integrity: sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==} - peerDependencies: - react: ^18.3.1 - - react@18.3.1: - resolution: {integrity: sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==} - engines: {node: '>=0.10.0'} - - readable-stream@3.6.2: - resolution: {integrity: sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==} - engines: {node: '>= 6'} - - require-directory@2.1.1: - resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} - engines: {node: '>=0.10.0'} - - resolve-cwd@3.0.0: - resolution: {integrity: sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==} - engines: {node: '>=8'} - - resolve-from@5.0.0: - resolution: {integrity: sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==} - engines: {node: '>=8'} - - reusify@1.0.4: - resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==} - engines: {iojs: '>=1.0.0', node: '>=0.10.0'} - - rimraf@3.0.2: - resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==} - deprecated: Rimraf versions prior to v4 are no longer supported - hasBin: true - - run-async@3.0.0: - resolution: {integrity: sha512-540WwVDOMxA6dN6We19EcT9sc3hkXPw5mzRNGM3FkdN/vtE9NFvj5lFAPNwUDmJjXidm3v7TC1cTE7t17Ulm1Q==} - engines: {node: '>=0.12.0'} - - run-parallel@1.2.0: - resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} - - rxjs@7.8.1: - resolution: {integrity: sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==} - - safe-buffer@5.2.1: - resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} - - safer-buffer@2.1.2: - resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} - - scheduler@0.23.2: - resolution: {integrity: sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ==} - - semver@6.3.1: - resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} - hasBin: true - - semver@7.6.2: - resolution: {integrity: sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==} - engines: {node: '>=10'} - hasBin: true - - serialize-error@7.0.1: - resolution: {integrity: sha512-8I8TjW5KMOKsZQTvoxjuSIa7foAwPWGOts+6o7sgjz41/qMD9VQHEDxi6PBvK2l0MXUmqZyNpUK+T2tQaaElvw==} - engines: {node: '>=10'} - - set-blocking@2.0.0: - resolution: {integrity: sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==} - - shallowequal@1.1.0: - resolution: {integrity: sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ==} - - signal-exit@3.0.7: - resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} - - signal-exit@4.1.0: - resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} - engines: {node: '>=14'} - - slash@5.1.0: - resolution: {integrity: sha512-ZA6oR3T/pEyuqwMgAKT0/hAv8oAXckzbkmR0UkUosQ+Mc4RxGoJkRmwHgHufaenlyAgE1Mxgpdcrf75y6XcnDg==} - engines: {node: '>=14.16'} - - slice-ansi@5.0.0: - resolution: {integrity: sha512-FC+lgizVPfie0kkhqUScwRu1O/lF6NOgJmlCgK+/LYxDCTk8sGelYaHDhFcDN+Sn3Cv+3VSa4Byeo+IMCzpMgQ==} - engines: {node: '>=12'} - - source-map-js@1.2.0: - resolution: {integrity: sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==} - engines: {node: '>=0.10.0'} - - sprintf-js@1.0.3: - resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==} - - stack-utils@2.0.6: - resolution: {integrity: sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==} - engines: {node: '>=10'} - - string-width@4.2.3: - resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} - engines: {node: '>=8'} - - string-width@7.2.0: - resolution: {integrity: sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==} - engines: {node: '>=18'} - - string_decoder@1.3.0: - resolution: {integrity: sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==} - - strip-ansi@6.0.1: - resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} - engines: {node: '>=8'} - - strip-ansi@7.1.0: - resolution: {integrity: sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==} - engines: {node: '>=12'} - - styled-components@6.1.1: - resolution: {integrity: sha512-cpZZP5RrKRIClBW5Eby4JM1wElLVP4NQrJbJ0h10TidTyJf4SIIwa3zLXOoPb4gJi8MsJ8mjq5mu2IrEhZIAcQ==} - engines: {node: '>= 16'} - peerDependencies: - react: '>= 16.8.0' - react-dom: '>= 16.8.0' - - stylis@4.3.2: - resolution: {integrity: sha512-bhtUjWd/z6ltJiQwg0dUfxEJ+W+jdqQd8TbWLWyeIJHlnsqmGLRFFd8e5mA0AZi/zx90smXRlN66YMTcaSFifg==} - - supertap@3.0.1: - resolution: {integrity: sha512-u1ZpIBCawJnO+0QePsEiOknOfCRq0yERxiAchT0i4li0WHNUJbf0evXXSXOcCAR4M8iMDoajXYmstm/qO81Isw==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - tar@6.2.1: - resolution: {integrity: sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==} - engines: {node: '>=10'} - - temp-dir@3.0.0: - resolution: {integrity: sha512-nHc6S/bwIilKHNRgK/3jlhDoIHcp45YgyiwcAk46Tr0LfEqGBVpmiAyuiuxeVE44m3mXnEeVhaipLOEWmH+Njw==} - engines: {node: '>=14.16'} - - time-zone@1.0.0: - resolution: {integrity: sha512-TIsDdtKo6+XrPtiTm1ssmMngN1sAhyKnTO2kunQWqNPWIVvCm15Wmw4SWInwTVgJ5u/Tr04+8Ei9TNcw4x4ONA==} - engines: {node: '>=4'} - - tmp@0.0.33: - resolution: {integrity: sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==} - engines: {node: '>=0.6.0'} - - to-regex-range@5.0.1: - resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} - engines: {node: '>=8.0'} - - toml@3.0.0: - resolution: {integrity: sha512-y/mWCZinnvxjTKYhJ+pYxwD0mRLVvOtdS2Awbgxln6iEnt4rk0yBxeSBHkGJcPucRiG0e55mwWp+g/05rsrd6w==} - - tr46@0.0.3: - resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==} - - tslib@2.6.3: - resolution: {integrity: sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ==} - - typanion@3.14.0: - resolution: {integrity: sha512-ZW/lVMRabETuYCd9O9ZvMhAh8GslSqaUjxmK/JLPCh6l73CvLBiuXswj/+7LdnWOgYsQ130FqLzFz5aGT4I3Ug==} - - type-fest@0.13.1: - resolution: {integrity: sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==} - engines: {node: '>=10'} - - type-fest@0.21.3: - resolution: {integrity: sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==} - engines: {node: '>=10'} - - typescript@5.5.3: - resolution: {integrity: sha512-/hreyEujaB0w76zKo6717l3L0o/qEUtRgdvUBvlkhoWeOVMjMuHNHk0BRBzikzuGDqNmPQbg5ifMEqsHLiIUcQ==} - engines: {node: '>=14.17'} - hasBin: true - - undici-types@5.26.5: - resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==} - - undici-types@6.11.1: - resolution: {integrity: sha512-mIDEX2ek50x0OlRgxryxsenE5XaQD4on5U2inY7RApK3SOJpofyw7uW2AyfMKkhAxXIceo2DeWGVGwyvng1GNQ==} - - unicorn-magic@0.1.0: - resolution: {integrity: sha512-lRfVq8fE8gz6QMBuDM6a+LO3IAzTi05H6gCVaUpir2E1Rwpo4ZUog45KpNXKC/Mn3Yb9UDuHumeFTo9iV/D9FQ==} - engines: {node: '>=18'} - - universal-user-agent@7.0.2: - resolution: {integrity: sha512-0JCqzSKnStlRRQfCdowvqy3cy0Dvtlb8xecj/H8JFZuCze4rwjPZQOgvFvn0Ws/usCHQFGpyr+pB9adaGwXn4Q==} - - util-deprecate@1.0.2: - resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} - - wasm-sjlj@1.0.5: - resolution: {integrity: sha512-Z/MHJeOkAvJJVWnGX3/YZGYldGaawZbYHX4ldYG9kLhcdB8H31F5x66M7Zc4BP/7pg0aLsusQj1629m2B3Rilg==} - - webidl-conversions@3.0.1: - resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==} - - well-known-symbols@2.0.0: - resolution: {integrity: sha512-ZMjC3ho+KXo0BfJb7JgtQ5IBuvnShdlACNkKkdsqBmYw3bPAaJfPeYUo6tLUaT5tG/Gkh7xkpBhKRQ9e7pyg9Q==} - engines: {node: '>=6'} - - whatwg-url@5.0.0: - resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==} - - wide-align@1.1.5: - resolution: {integrity: sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==} - - wrap-ansi@6.2.0: - resolution: {integrity: sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==} - engines: {node: '>=8'} - - wrap-ansi@7.0.0: - resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==} - engines: {node: '>=10'} - - wrappy@1.0.2: - resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} - - write-file-atomic@5.0.1: - resolution: {integrity: sha512-+QU2zd6OTD8XWIJCbffaiQeH9U73qIqafo1x6V1snCWYGJf6cVE0cDR4D8xRzcEnfI21IFrUPzPGtcPf8AC+Rw==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - - y18n@5.0.8: - resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==} - engines: {node: '>=10'} - - yallist@4.0.0: - resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==} - - yargs-parser@21.1.1: - resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} - engines: {node: '>=12'} - - yargs@17.7.2: - resolution: {integrity: sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==} - engines: {node: '>=12'} - - yoctocolors-cjs@2.1.2: - resolution: {integrity: sha512-cYVsTjKl8b+FrnidjibDWskAv7UKOfcwaVZdp/it9n1s9fU3IkgDbhdIRKCW4JDsAlECJY0ytoVPT3sK6kideA==} - engines: {node: '>=18'} - -snapshots: - - '@emnapi/core@1.2.0': - dependencies: - '@emnapi/wasi-threads': 1.0.1 - tslib: 2.6.3 - - '@emnapi/runtime@1.2.0': - dependencies: - tslib: 2.6.3 - - '@emnapi/wasi-threads@1.0.1': - dependencies: - tslib: 2.6.3 - - '@emotion/is-prop-valid@1.2.2': - dependencies: - '@emotion/memoize': 0.8.1 - - '@emotion/memoize@0.8.1': {} - - '@emotion/unitless@0.8.1': {} - - '@inquirer/checkbox@2.3.10': - dependencies: - '@inquirer/core': 9.0.2 - '@inquirer/figures': 1.0.3 - '@inquirer/type': 1.4.0 - ansi-escapes: 4.3.2 - yoctocolors-cjs: 2.1.2 - - '@inquirer/confirm@3.1.14': - dependencies: - '@inquirer/core': 9.0.2 - '@inquirer/type': 1.4.0 - - '@inquirer/core@9.0.2': - dependencies: - '@inquirer/figures': 1.0.3 - '@inquirer/type': 1.4.0 - '@types/mute-stream': 0.0.4 - '@types/node': 20.14.10 - '@types/wrap-ansi': 3.0.0 - ansi-escapes: 4.3.2 - cli-spinners: 2.9.2 - cli-width: 4.1.0 - mute-stream: 1.0.0 - signal-exit: 4.1.0 - strip-ansi: 6.0.1 - wrap-ansi: 6.2.0 - yoctocolors-cjs: 2.1.2 - - '@inquirer/editor@2.1.14': - dependencies: - '@inquirer/core': 9.0.2 - '@inquirer/type': 1.4.0 - external-editor: 3.1.0 - - '@inquirer/expand@2.1.14': - dependencies: - '@inquirer/core': 9.0.2 - '@inquirer/type': 1.4.0 - yoctocolors-cjs: 2.1.2 - - '@inquirer/figures@1.0.3': {} - - '@inquirer/input@2.2.1': - dependencies: - '@inquirer/core': 9.0.2 - '@inquirer/type': 1.4.0 - - '@inquirer/number@1.0.2': - dependencies: - '@inquirer/core': 9.0.2 - '@inquirer/type': 1.4.0 - - '@inquirer/password@2.1.14': - dependencies: - '@inquirer/core': 9.0.2 - '@inquirer/type': 1.4.0 - ansi-escapes: 4.3.2 - - '@inquirer/prompts@5.1.2': - dependencies: - '@inquirer/checkbox': 2.3.10 - '@inquirer/confirm': 3.1.14 - '@inquirer/editor': 2.1.14 - '@inquirer/expand': 2.1.14 - '@inquirer/input': 2.2.1 - '@inquirer/number': 1.0.2 - '@inquirer/password': 2.1.14 - '@inquirer/rawlist': 2.1.14 - '@inquirer/select': 2.3.10 - - '@inquirer/rawlist@2.1.14': - dependencies: - '@inquirer/core': 9.0.2 - '@inquirer/type': 1.4.0 - yoctocolors-cjs: 2.1.2 - - '@inquirer/select@2.3.10': - dependencies: - '@inquirer/core': 9.0.2 - '@inquirer/figures': 1.0.3 - '@inquirer/type': 1.4.0 - ansi-escapes: 4.3.2 - yoctocolors-cjs: 2.1.2 - - '@inquirer/type@1.4.0': - dependencies: - mute-stream: 1.0.0 - - '@mapbox/node-pre-gyp@1.0.11': - dependencies: - detect-libc: 2.0.3 - https-proxy-agent: 5.0.1 - make-dir: 3.1.0 - node-fetch: 2.7.0 - nopt: 5.0.0 - npmlog: 5.0.1 - rimraf: 3.0.2 - semver: 7.6.2 - tar: 6.2.1 - transitivePeerDependencies: - - encoding - - supports-color - - '@napi-rs/cli@3.0.0-alpha.58(@emnapi/runtime@1.2.0)(emnapi@1.2.0)': - dependencies: - '@napi-rs/cross-toolchain': 0.0.16 - '@napi-rs/wasm-tools': 0.0.2 - '@octokit/rest': 21.0.0 - clipanion: 3.2.1(typanion@3.14.0) - colorette: 2.0.20 - debug: 4.3.5 - inquirer: 10.0.1 - js-yaml: 4.1.0 - lodash-es: 4.17.21 - semver: 7.6.2 - toml: 3.0.0 - typanion: 3.14.0 - wasm-sjlj: 1.0.5 - optionalDependencies: - '@emnapi/runtime': 1.2.0 - emnapi: 1.2.0 - transitivePeerDependencies: - - '@napi-rs/cross-toolchain-arm64-target-aarch64' - - '@napi-rs/cross-toolchain-arm64-target-armv7' - - '@napi-rs/cross-toolchain-arm64-target-x86_64' - - '@napi-rs/cross-toolchain-x64-target-aarch64' - - '@napi-rs/cross-toolchain-x64-target-armv7' - - '@napi-rs/cross-toolchain-x64-target-x86_64' - - supports-color - - '@napi-rs/cross-toolchain@0.0.16': - dependencies: - '@napi-rs/lzma': 1.3.1 - '@napi-rs/tar': 0.1.1 - debug: 4.3.5 - transitivePeerDependencies: - - supports-color - - '@napi-rs/lzma-android-arm-eabi@1.3.1': - optional: true - - '@napi-rs/lzma-android-arm64@1.3.1': - optional: true - - '@napi-rs/lzma-darwin-arm64@1.3.1': - optional: true - - '@napi-rs/lzma-darwin-x64@1.3.1': - optional: true - - '@napi-rs/lzma-freebsd-x64@1.3.1': - optional: true - - '@napi-rs/lzma-linux-arm-gnueabihf@1.3.1': - optional: true - - '@napi-rs/lzma-linux-arm64-gnu@1.3.1': - optional: true - - '@napi-rs/lzma-linux-arm64-musl@1.3.1': - optional: true - - '@napi-rs/lzma-linux-x64-gnu@1.3.1': - optional: true - - '@napi-rs/lzma-linux-x64-musl@1.3.1': - optional: true - - '@napi-rs/lzma-wasm32-wasi@1.3.1': - dependencies: - '@napi-rs/wasm-runtime': 0.2.4 - optional: true - - '@napi-rs/lzma-win32-arm64-msvc@1.3.1': - optional: true - - '@napi-rs/lzma-win32-ia32-msvc@1.3.1': - optional: true - - '@napi-rs/lzma-win32-x64-msvc@1.3.1': - optional: true - - '@napi-rs/lzma@1.3.1': - optionalDependencies: - '@napi-rs/lzma-android-arm-eabi': 1.3.1 - '@napi-rs/lzma-android-arm64': 1.3.1 - '@napi-rs/lzma-darwin-arm64': 1.3.1 - '@napi-rs/lzma-darwin-x64': 1.3.1 - '@napi-rs/lzma-freebsd-x64': 1.3.1 - '@napi-rs/lzma-linux-arm-gnueabihf': 1.3.1 - '@napi-rs/lzma-linux-arm64-gnu': 1.3.1 - '@napi-rs/lzma-linux-arm64-musl': 1.3.1 - '@napi-rs/lzma-linux-x64-gnu': 1.3.1 - '@napi-rs/lzma-linux-x64-musl': 1.3.1 - '@napi-rs/lzma-wasm32-wasi': 1.3.1 - '@napi-rs/lzma-win32-arm64-msvc': 1.3.1 - '@napi-rs/lzma-win32-ia32-msvc': 1.3.1 - '@napi-rs/lzma-win32-x64-msvc': 1.3.1 - - '@napi-rs/tar-android-arm-eabi@0.1.1': - optional: true - - '@napi-rs/tar-android-arm64@0.1.1': - optional: true - - '@napi-rs/tar-darwin-arm64@0.1.1': - optional: true - - '@napi-rs/tar-darwin-x64@0.1.1': - optional: true - - '@napi-rs/tar-freebsd-x64@0.1.1': - optional: true - - '@napi-rs/tar-linux-arm-gnueabihf@0.1.1': - optional: true - - '@napi-rs/tar-linux-arm64-gnu@0.1.1': - optional: true - - '@napi-rs/tar-linux-arm64-musl@0.1.1': - optional: true - - '@napi-rs/tar-linux-x64-gnu@0.1.1': - optional: true - - '@napi-rs/tar-linux-x64-musl@0.1.1': - optional: true - - '@napi-rs/tar-wasm32-wasi@0.1.1': - dependencies: - '@napi-rs/wasm-runtime': 0.2.4 - optional: true - - '@napi-rs/tar-win32-arm64-msvc@0.1.1': - optional: true - - '@napi-rs/tar-win32-ia32-msvc@0.1.1': - optional: true - - '@napi-rs/tar-win32-x64-msvc@0.1.1': - optional: true - - '@napi-rs/tar@0.1.1': - optionalDependencies: - '@napi-rs/tar-android-arm-eabi': 0.1.1 - '@napi-rs/tar-android-arm64': 0.1.1 - '@napi-rs/tar-darwin-arm64': 0.1.1 - '@napi-rs/tar-darwin-x64': 0.1.1 - '@napi-rs/tar-freebsd-x64': 0.1.1 - '@napi-rs/tar-linux-arm-gnueabihf': 0.1.1 - '@napi-rs/tar-linux-arm64-gnu': 0.1.1 - '@napi-rs/tar-linux-arm64-musl': 0.1.1 - '@napi-rs/tar-linux-x64-gnu': 0.1.1 - '@napi-rs/tar-linux-x64-musl': 0.1.1 - '@napi-rs/tar-wasm32-wasi': 0.1.1 - '@napi-rs/tar-win32-arm64-msvc': 0.1.1 - '@napi-rs/tar-win32-ia32-msvc': 0.1.1 - '@napi-rs/tar-win32-x64-msvc': 0.1.1 - - '@napi-rs/wasm-runtime@0.2.4': - dependencies: - '@emnapi/core': 1.2.0 - '@emnapi/runtime': 1.2.0 - '@tybys/wasm-util': 0.9.0 - - '@napi-rs/wasm-tools-android-arm-eabi@0.0.2': - optional: true - - '@napi-rs/wasm-tools-android-arm64@0.0.2': - optional: true - - '@napi-rs/wasm-tools-darwin-arm64@0.0.2': - optional: true - - '@napi-rs/wasm-tools-darwin-x64@0.0.2': - optional: true - - '@napi-rs/wasm-tools-freebsd-x64@0.0.2': - optional: true - - '@napi-rs/wasm-tools-linux-arm64-gnu@0.0.2': - optional: true - - '@napi-rs/wasm-tools-linux-arm64-musl@0.0.2': - optional: true - - '@napi-rs/wasm-tools-linux-x64-gnu@0.0.2': - optional: true - - '@napi-rs/wasm-tools-linux-x64-musl@0.0.2': - optional: true - - '@napi-rs/wasm-tools-wasm32-wasi@0.0.2': - dependencies: - '@napi-rs/wasm-runtime': 0.2.4 - optional: true - - '@napi-rs/wasm-tools-win32-arm64-msvc@0.0.2': - optional: true - - '@napi-rs/wasm-tools-win32-ia32-msvc@0.0.2': - optional: true - - '@napi-rs/wasm-tools-win32-x64-msvc@0.0.2': - optional: true - - '@napi-rs/wasm-tools@0.0.2': - optionalDependencies: - '@napi-rs/wasm-tools-android-arm-eabi': 0.0.2 - '@napi-rs/wasm-tools-android-arm64': 0.0.2 - '@napi-rs/wasm-tools-darwin-arm64': 0.0.2 - '@napi-rs/wasm-tools-darwin-x64': 0.0.2 - '@napi-rs/wasm-tools-freebsd-x64': 0.0.2 - '@napi-rs/wasm-tools-linux-arm64-gnu': 0.0.2 - '@napi-rs/wasm-tools-linux-arm64-musl': 0.0.2 - '@napi-rs/wasm-tools-linux-x64-gnu': 0.0.2 - '@napi-rs/wasm-tools-linux-x64-musl': 0.0.2 - '@napi-rs/wasm-tools-wasm32-wasi': 0.0.2 - '@napi-rs/wasm-tools-win32-arm64-msvc': 0.0.2 - '@napi-rs/wasm-tools-win32-ia32-msvc': 0.0.2 - '@napi-rs/wasm-tools-win32-x64-msvc': 0.0.2 - - '@nodelib/fs.scandir@2.1.5': - dependencies: - '@nodelib/fs.stat': 2.0.5 - run-parallel: 1.2.0 - - '@nodelib/fs.stat@2.0.5': {} - - '@nodelib/fs.walk@1.2.8': - dependencies: - '@nodelib/fs.scandir': 2.1.5 - fastq: 1.17.1 - - '@octokit/auth-token@5.1.1': {} - - '@octokit/core@6.1.2': - dependencies: - '@octokit/auth-token': 5.1.1 - '@octokit/graphql': 8.1.1 - '@octokit/request': 9.1.1 - '@octokit/request-error': 6.1.2 - '@octokit/types': 13.5.0 - before-after-hook: 3.0.2 - universal-user-agent: 7.0.2 - - '@octokit/endpoint@10.1.1': - dependencies: - '@octokit/types': 13.5.0 - universal-user-agent: 7.0.2 - - '@octokit/graphql@8.1.1': - dependencies: - '@octokit/request': 9.1.1 - '@octokit/types': 13.5.0 - universal-user-agent: 7.0.2 - - '@octokit/openapi-types@22.2.0': {} - - '@octokit/plugin-paginate-rest@11.3.3(@octokit/core@6.1.2)': - dependencies: - '@octokit/core': 6.1.2 - '@octokit/types': 13.5.0 - - '@octokit/plugin-request-log@5.3.0(@octokit/core@6.1.2)': - dependencies: - '@octokit/core': 6.1.2 - - '@octokit/plugin-rest-endpoint-methods@13.2.4(@octokit/core@6.1.2)': - dependencies: - '@octokit/core': 6.1.2 - '@octokit/types': 13.5.0 - - '@octokit/request-error@6.1.2': - dependencies: - '@octokit/types': 13.5.0 - - '@octokit/request@9.1.1': - dependencies: - '@octokit/endpoint': 10.1.1 - '@octokit/request-error': 6.1.2 - '@octokit/types': 13.5.0 - universal-user-agent: 7.0.2 - - '@octokit/rest@21.0.0': - dependencies: - '@octokit/core': 6.1.2 - '@octokit/plugin-paginate-rest': 11.3.3(@octokit/core@6.1.2) - '@octokit/plugin-request-log': 5.3.0(@octokit/core@6.1.2) - '@octokit/plugin-rest-endpoint-methods': 13.2.4(@octokit/core@6.1.2) - - '@octokit/types@13.5.0': - dependencies: - '@octokit/openapi-types': 22.2.0 - - '@rollup/pluginutils@4.2.1': - dependencies: - estree-walker: 2.0.2 - picomatch: 2.3.1 - - '@sindresorhus/merge-streams@2.3.0': {} - - '@tybys/wasm-util@0.9.0': - dependencies: - tslib: 2.6.3 - - '@types/mute-stream@0.0.4': - dependencies: - '@types/node': 22.0.0 - - '@types/node@20.14.10': - dependencies: - undici-types: 5.26.5 - - '@types/node@22.0.0': - dependencies: - undici-types: 6.11.1 - - '@types/stylis@4.2.6': {} - - '@types/wrap-ansi@3.0.0': {} - - '@vercel/nft@0.26.5': - dependencies: - '@mapbox/node-pre-gyp': 1.0.11 - '@rollup/pluginutils': 4.2.1 - acorn: 8.12.1 - acorn-import-attributes: 1.9.5(acorn@8.12.1) - async-sema: 3.1.1 - bindings: 1.5.0 - estree-walker: 2.0.2 - glob: 7.2.3 - graceful-fs: 4.2.11 - micromatch: 4.0.7 - node-gyp-build: 4.8.1 - resolve-from: 5.0.0 - transitivePeerDependencies: - - encoding - - supports-color - - abbrev@1.1.1: {} - - acorn-import-attributes@1.9.5(acorn@8.12.1): - dependencies: - acorn: 8.12.1 - - acorn-walk@8.3.3: - dependencies: - acorn: 8.12.1 - - acorn@8.12.1: {} - - agent-base@6.0.2: - dependencies: - debug: 4.3.5 - transitivePeerDependencies: - - supports-color - - ansi-escapes@4.3.2: - dependencies: - type-fest: 0.21.3 - - ansi-regex@5.0.1: {} - - ansi-regex@6.0.1: {} - - ansi-styles@4.3.0: - dependencies: - color-convert: 2.0.1 - - ansi-styles@6.2.1: {} - - aproba@2.0.0: {} - - are-we-there-yet@2.0.0: - dependencies: - delegates: 1.0.0 - readable-stream: 3.6.2 - - argparse@1.0.10: - dependencies: - sprintf-js: 1.0.3 - - argparse@2.0.1: {} - - array-find-index@1.0.2: {} - - arrgv@1.0.2: {} - - arrify@3.0.0: {} - - async-sema@3.1.1: {} - - asynckit@0.4.0: {} - - ava@6.1.3: - dependencies: - '@vercel/nft': 0.26.5 - acorn: 8.12.1 - acorn-walk: 8.3.3 - ansi-styles: 6.2.1 - arrgv: 1.0.2 - arrify: 3.0.0 - callsites: 4.2.0 - cbor: 9.0.2 - chalk: 5.3.0 - chunkd: 2.0.1 - ci-info: 4.0.0 - ci-parallel-vars: 1.0.1 - cli-truncate: 4.0.0 - code-excerpt: 4.0.0 - common-path-prefix: 3.0.0 - concordance: 5.0.4 - currently-unhandled: 0.4.1 - debug: 4.3.5 - emittery: 1.0.3 - figures: 6.1.0 - globby: 14.0.2 - ignore-by-default: 2.1.0 - indent-string: 5.0.0 - is-plain-object: 5.0.0 - is-promise: 4.0.0 - matcher: 5.0.0 - memoize: 10.0.0 - ms: 2.1.3 - p-map: 7.0.2 - package-config: 5.0.0 - picomatch: 3.0.1 - plur: 5.1.0 - pretty-ms: 9.0.0 - resolve-cwd: 3.0.0 - stack-utils: 2.0.6 - strip-ansi: 7.1.0 - supertap: 3.0.1 - temp-dir: 3.0.0 - write-file-atomic: 5.0.1 - yargs: 17.7.2 - transitivePeerDependencies: - - encoding - - supports-color - - axios@1.6.2: - dependencies: - follow-redirects: 1.15.6 - form-data: 4.0.0 - proxy-from-env: 1.1.0 - transitivePeerDependencies: - - debug - - balanced-match@1.0.2: {} - - before-after-hook@3.0.2: {} - - bindings@1.5.0: - dependencies: - file-uri-to-path: 1.0.0 - - blueimp-md5@2.19.0: {} - - brace-expansion@1.1.11: - dependencies: - balanced-match: 1.0.2 - concat-map: 0.0.1 - - braces@3.0.3: - dependencies: - fill-range: 7.1.1 - - callsites@4.2.0: {} - - camelize@1.0.1: {} - - cbor@9.0.2: - dependencies: - nofilter: 3.1.0 - - chalk@5.3.0: {} - - chardet@0.7.0: {} - - chownr@2.0.0: {} - - chunkd@2.0.1: {} - - ci-info@4.0.0: {} - - ci-parallel-vars@1.0.1: {} - - cli-spinners@2.9.2: {} - - cli-truncate@4.0.0: - dependencies: - slice-ansi: 5.0.0 - string-width: 7.2.0 - - cli-width@4.1.0: {} - - clipanion@3.2.1(typanion@3.14.0): - dependencies: - typanion: 3.14.0 - - cliui@8.0.1: - dependencies: - string-width: 4.2.3 - strip-ansi: 6.0.1 - wrap-ansi: 7.0.0 - - code-excerpt@4.0.0: - dependencies: - convert-to-spaces: 2.0.1 - - color-convert@2.0.1: - dependencies: - color-name: 1.1.4 - - color-name@1.1.4: {} - - color-support@1.1.3: {} - - colorette@2.0.20: {} - - combined-stream@1.0.8: - dependencies: - delayed-stream: 1.0.0 - - common-path-prefix@3.0.0: {} - - concat-map@0.0.1: {} - - concordance@5.0.4: - dependencies: - date-time: 3.1.0 - esutils: 2.0.3 - fast-diff: 1.3.0 - js-string-escape: 1.0.1 - lodash: 4.17.21 - md5-hex: 3.0.1 - semver: 7.6.2 - well-known-symbols: 2.0.0 - - console-control-strings@1.1.0: {} - - convert-to-spaces@2.0.1: {} - - css-color-keywords@1.0.0: {} - - css-to-react-native@3.2.0: - dependencies: - camelize: 1.0.1 - css-color-keywords: 1.0.0 - postcss-value-parser: 4.2.0 - - csstype@3.1.3: {} - - currently-unhandled@0.4.1: - dependencies: - array-find-index: 1.0.2 - - date-time@3.1.0: - dependencies: - time-zone: 1.0.0 - - debug@4.3.5: - dependencies: - ms: 2.1.2 - - delayed-stream@1.0.0: {} - - delegates@1.0.0: {} - - detect-libc@2.0.3: {} - - emittery@1.0.3: {} - - emnapi@1.2.0: {} - - emoji-regex@10.3.0: {} - - emoji-regex@8.0.0: {} - - escalade@3.1.2: {} - - escape-string-regexp@2.0.0: {} - - escape-string-regexp@5.0.0: {} - - esprima@4.0.1: {} - - estree-walker@2.0.2: {} - - esutils@2.0.3: {} - - external-editor@3.1.0: - dependencies: - chardet: 0.7.0 - iconv-lite: 0.4.24 - tmp: 0.0.33 - - fast-diff@1.3.0: {} - - fast-glob@3.3.2: - dependencies: - '@nodelib/fs.stat': 2.0.5 - '@nodelib/fs.walk': 1.2.8 - glob-parent: 5.1.2 - merge2: 1.4.1 - micromatch: 4.0.7 - - fastq@1.17.1: - dependencies: - reusify: 1.0.4 - - figures@6.1.0: - dependencies: - is-unicode-supported: 2.0.0 - - file-uri-to-path@1.0.0: {} - - fill-range@7.1.1: - dependencies: - to-regex-range: 5.0.1 - - find-up-simple@1.0.0: {} - - follow-redirects@1.15.6: {} - - form-data@4.0.0: - dependencies: - asynckit: 0.4.0 - combined-stream: 1.0.8 - mime-types: 2.1.35 - - fs-minipass@2.1.0: - dependencies: - minipass: 3.3.6 - - fs.realpath@1.0.0: {} - - gauge@3.0.2: - dependencies: - aproba: 2.0.0 - color-support: 1.1.3 - console-control-strings: 1.1.0 - has-unicode: 2.0.1 - object-assign: 4.1.1 - signal-exit: 3.0.7 - string-width: 4.2.3 - strip-ansi: 6.0.1 - wide-align: 1.1.5 - - get-caller-file@2.0.5: {} - - get-east-asian-width@1.2.0: {} - - glob-parent@5.1.2: - dependencies: - is-glob: 4.0.3 - - glob@7.2.3: - dependencies: - fs.realpath: 1.0.0 - inflight: 1.0.6 - inherits: 2.0.4 - minimatch: 3.1.2 - once: 1.4.0 - path-is-absolute: 1.0.1 - - globby@14.0.2: - dependencies: - '@sindresorhus/merge-streams': 2.3.0 - fast-glob: 3.3.2 - ignore: 5.3.1 - path-type: 5.0.0 - slash: 5.1.0 - unicorn-magic: 0.1.0 - - graceful-fs@4.2.11: {} - - has-unicode@2.0.1: {} - - https-proxy-agent@5.0.1: - dependencies: - agent-base: 6.0.2 - debug: 4.3.5 - transitivePeerDependencies: - - supports-color - - iconv-lite@0.4.24: - dependencies: - safer-buffer: 2.1.2 - - ignore-by-default@2.1.0: {} - - ignore@5.3.1: {} - - imurmurhash@0.1.4: {} - - indent-string@5.0.0: {} - - inflight@1.0.6: - dependencies: - once: 1.4.0 - wrappy: 1.0.2 - - inherits@2.0.4: {} - - inquirer@10.0.1: - dependencies: - '@inquirer/prompts': 5.1.2 - '@inquirer/type': 1.4.0 - '@types/mute-stream': 0.0.4 - ansi-escapes: 4.3.2 - mute-stream: 1.0.0 - run-async: 3.0.0 - rxjs: 7.8.1 - - ipaddr.js@2.2.0: {} - - irregular-plurals@3.5.0: {} - - is-extglob@2.1.1: {} - - is-fullwidth-code-point@3.0.0: {} - - is-fullwidth-code-point@4.0.0: {} - - is-glob@4.0.3: - dependencies: - is-extglob: 2.1.1 - - is-number@7.0.0: {} - - is-plain-object@5.0.0: {} - - is-promise@4.0.0: {} - - is-unicode-supported@2.0.0: {} - - js-string-escape@1.0.1: {} - - js-tokens@4.0.0: {} - - js-yaml@3.14.1: - dependencies: - argparse: 1.0.10 - esprima: 4.0.1 - - js-yaml@4.1.0: - dependencies: - argparse: 2.0.1 - - load-json-file@7.0.1: {} - - lodash-es@4.17.21: {} - - lodash@4.17.21: {} - - loose-envify@1.4.0: - dependencies: - js-tokens: 4.0.0 - - make-dir@3.1.0: - dependencies: - semver: 6.3.1 - - matcher@5.0.0: - dependencies: - escape-string-regexp: 5.0.0 - - md5-hex@3.0.1: - dependencies: - blueimp-md5: 2.19.0 - - memoize@10.0.0: - dependencies: - mimic-function: 5.0.1 - - merge2@1.4.1: {} - - micromatch@4.0.7: - dependencies: - braces: 3.0.3 - picomatch: 2.3.1 - - mime-db@1.52.0: {} - - mime-types@2.1.35: - dependencies: - mime-db: 1.52.0 - - mimic-function@5.0.1: {} - - minimatch@3.1.2: - dependencies: - brace-expansion: 1.1.11 - - minipass@3.3.6: - dependencies: - yallist: 4.0.0 - - minipass@5.0.0: {} - - minizlib@2.1.2: - dependencies: - minipass: 3.3.6 - yallist: 4.0.0 - - mkdirp@1.0.4: {} - - ms@2.1.2: {} - - ms@2.1.3: {} - - mute-stream@1.0.0: {} - - nanoid@3.3.7: {} - - node-fetch@2.7.0: - dependencies: - whatwg-url: 5.0.0 - - node-gyp-build@4.8.1: {} - - nofilter@3.1.0: {} - - nopt@5.0.0: - dependencies: - abbrev: 1.1.1 - - npmlog@5.0.1: - dependencies: - are-we-there-yet: 2.0.0 - console-control-strings: 1.1.0 - gauge: 3.0.2 - set-blocking: 2.0.0 - - object-assign@4.1.1: {} - - once@1.4.0: - dependencies: - wrappy: 1.0.2 - - os-tmpdir@1.0.2: {} - - p-map@7.0.2: {} - - package-config@5.0.0: - dependencies: - find-up-simple: 1.0.0 - load-json-file: 7.0.1 - - parse-ms@4.0.0: {} - - path-is-absolute@1.0.1: {} - - path-type@5.0.0: {} - - picocolors@1.0.1: {} - - picomatch@2.3.1: {} - - picomatch@3.0.1: {} - - plur@5.1.0: - dependencies: - irregular-plurals: 3.5.0 - - postcss-value-parser@4.2.0: {} - - postcss@8.4.33: - dependencies: - nanoid: 3.3.7 - picocolors: 1.0.1 - source-map-js: 1.2.0 - - pretty-ms@9.0.0: - dependencies: - parse-ms: 4.0.0 - - proxy-from-env@1.1.0: {} - - queue-microtask@1.2.3: {} - - react-dom@18.3.1(react@18.3.1): - dependencies: - loose-envify: 1.4.0 - react: 18.3.1 - scheduler: 0.23.2 - - react@18.3.1: - dependencies: - loose-envify: 1.4.0 - - readable-stream@3.6.2: - dependencies: - inherits: 2.0.4 - string_decoder: 1.3.0 - util-deprecate: 1.0.2 - - require-directory@2.1.1: {} - - resolve-cwd@3.0.0: - dependencies: - resolve-from: 5.0.0 - - resolve-from@5.0.0: {} - - reusify@1.0.4: {} - - rimraf@3.0.2: - dependencies: - glob: 7.2.3 - - run-async@3.0.0: {} - - run-parallel@1.2.0: - dependencies: - queue-microtask: 1.2.3 - - rxjs@7.8.1: - dependencies: - tslib: 2.6.3 - - safe-buffer@5.2.1: {} - - safer-buffer@2.1.2: {} - - scheduler@0.23.2: - dependencies: - loose-envify: 1.4.0 - - semver@6.3.1: {} - - semver@7.6.2: {} - - serialize-error@7.0.1: - dependencies: - type-fest: 0.13.1 - - set-blocking@2.0.0: {} - - shallowequal@1.1.0: {} - - signal-exit@3.0.7: {} - - signal-exit@4.1.0: {} - - slash@5.1.0: {} - - slice-ansi@5.0.0: - dependencies: - ansi-styles: 6.2.1 - is-fullwidth-code-point: 4.0.0 - - source-map-js@1.2.0: {} - - sprintf-js@1.0.3: {} - - stack-utils@2.0.6: - dependencies: - escape-string-regexp: 2.0.0 - - string-width@4.2.3: - dependencies: - emoji-regex: 8.0.0 - is-fullwidth-code-point: 3.0.0 - strip-ansi: 6.0.1 - - string-width@7.2.0: - dependencies: - emoji-regex: 10.3.0 - get-east-asian-width: 1.2.0 - strip-ansi: 7.1.0 - - string_decoder@1.3.0: - dependencies: - safe-buffer: 5.2.1 - - strip-ansi@6.0.1: - dependencies: - ansi-regex: 5.0.1 - - strip-ansi@7.1.0: - dependencies: - ansi-regex: 6.0.1 - - styled-components@6.1.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1): - dependencies: - '@emotion/is-prop-valid': 1.2.2 - '@emotion/unitless': 0.8.1 - '@types/stylis': 4.2.6 - css-to-react-native: 3.2.0 - csstype: 3.1.3 - postcss: 8.4.33 - react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) - shallowequal: 1.1.0 - stylis: 4.3.2 - tslib: 2.6.3 - - stylis@4.3.2: {} - - supertap@3.0.1: - dependencies: - indent-string: 5.0.0 - js-yaml: 3.14.1 - serialize-error: 7.0.1 - strip-ansi: 7.1.0 - - tar@6.2.1: - dependencies: - chownr: 2.0.0 - fs-minipass: 2.1.0 - minipass: 5.0.0 - minizlib: 2.1.2 - mkdirp: 1.0.4 - yallist: 4.0.0 - - temp-dir@3.0.0: {} - - time-zone@1.0.0: {} - - tmp@0.0.33: - dependencies: - os-tmpdir: 1.0.2 - - to-regex-range@5.0.1: - dependencies: - is-number: 7.0.0 - - toml@3.0.0: {} - - tr46@0.0.3: {} - - tslib@2.6.3: {} - - typanion@3.14.0: {} - - type-fest@0.13.1: {} - - type-fest@0.21.3: {} - - typescript@5.5.3: {} - - undici-types@5.26.5: {} - - undici-types@6.11.1: {} - - unicorn-magic@0.1.0: {} - - universal-user-agent@7.0.2: {} - - util-deprecate@1.0.2: {} - - wasm-sjlj@1.0.5: {} - - webidl-conversions@3.0.1: {} - - well-known-symbols@2.0.0: {} - - whatwg-url@5.0.0: - dependencies: - tr46: 0.0.3 - webidl-conversions: 3.0.1 - - wide-align@1.1.5: - dependencies: - string-width: 4.2.3 - - wrap-ansi@6.2.0: - dependencies: - ansi-styles: 4.3.0 - string-width: 4.2.3 - strip-ansi: 6.0.1 - - wrap-ansi@7.0.0: - dependencies: - ansi-styles: 4.3.0 - string-width: 4.2.3 - strip-ansi: 6.0.1 - - wrappy@1.0.2: {} - - write-file-atomic@5.0.1: - dependencies: - imurmurhash: 0.1.4 - signal-exit: 4.1.0 - - y18n@5.0.8: {} - - yallist@4.0.0: {} - - yargs-parser@21.1.1: {} - - yargs@17.7.2: - dependencies: - cliui: 8.0.1 - escalade: 3.1.2 - get-caller-file: 2.0.5 - require-directory: 2.1.1 - string-width: 4.2.3 - y18n: 5.0.8 - yargs-parser: 21.1.1 - - yoctocolors-cjs@2.1.2: {} diff --git a/src/tests/exports_field.rs b/src/tests/exports_field.rs deleted file mode 100644 index 7ca73fbd..00000000 --- a/src/tests/exports_field.rs +++ /dev/null @@ -1,2546 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/exportsField.test.js -//! -//! The huge exports field test cases are at the bottom of this file. - -use crate::{Ctx, PathUtil, ResolveError, ResolveOptions, Resolver}; -use serde_json::json; -use std::path::Path; - -#[test] -fn test_simple() { - let f = super::fixture().join("exports-field"); - let f2 = super::fixture().join("exports-field2"); - let f4 = super::fixture().join("exports-field-error"); - let f5 = super::fixture().join("imports-exports-wildcard"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - fully_specified: true, - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("resolve root using exports field, not a main field", f.clone(), "exports-field", f.join("node_modules/exports-field/x.js")), - ("resolver should respect condition names", f.clone(), "exports-field/dist/main.js", f.join("node_modules/exports-field/lib/lib2/main.js")), - // enhanced_resolve behaves differently to node.js. enhanced_resolve fallbacks when an - // array item is unresolved, where as node.js fallbacks when an array has an - // InvalidPackageTarget error. - // ("resolver should respect fallback", f2.clone(), "exports-field/dist/browser.js", f2.join("node_modules/exports-field/lib/browser.js")), - // The following two tests require fallback from array values, the path is changed here to - // only test query and fragment. - ("resolver should respect query parameters #1", f2.clone(), "exports-field/dist/main.js?foo", f2.join("node_modules/exports-field/lib/lib2/main.js?foo")), - ("resolver should respect fragment parameters #1", f2.clone(), "exports-field/dist/main.js#foo", f2.join("node_modules/exports-field/lib/lib2/main.js#foo")), - ("relative path should work, if relative path as request is used", f.clone(), "./node_modules/exports-field/lib/main.js", f.join("node_modules/exports-field/lib/main.js")), - ("self-resolving root", f.clone(), "@exports-field/core", f.join("a.js")), - ("should resolve with wildcard pattern #1", f5.clone(), "m/features/f.js", f5.join("node_modules/m/src/features/f.js")), - ("should resolve with wildcard pattern #2", f5.clone(), "m/features/y/y.js", f5.join("node_modules/m/src/features/y/y.js")), - ("should resolve with wildcard pattern #3", f5.clone(), "m/features-no-ext/y/y.js", f5.join("node_modules/m/src/features/y/y.js")), - ("should resolve with wildcard pattern #4", f5.clone(), "m/middle/nested/f.js", f5.join("node_modules/m/src/middle/nested/f.js")), - ("should resolve with wildcard pattern #5", f5.clone(), "m/middle-1/nested/f.js", f5.join("node_modules/m/src/middle-1/nested/f.js")), - ("should resolve with wildcard pattern #6", f5.clone(), "m/middle-2/nested/f.js", f5.join("node_modules/m/src/middle-2/nested/f.js")), - ("should resolve with wildcard pattern #7", f5.clone(), "m/middle-3/nested/f", f5.join("node_modules/m/src/middle-3/nested/f/nested/f.js")), - ("should resolve with wildcard pattern #8", f5.clone(), "m/middle-4/f/nested", f5.join("node_modules/m/src/middle-4/f/f.js")), - ("should resolve with wildcard pattern #9", f5.clone(), "m/middle-5/f$/$", f5.join("node_modules/m/src/middle-5/f$/$.js")), - ]; - - // Not needed or snapshot: - // * should log the correct info - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } - - let p = f.join("node_modules/exports-field/package.json"); - let p2 = f2.join("node_modules/exports-field/package.json"); - let p4 = f4.join("node_modules/exports-field/package.json"); - let p5 = f5.join("node_modules/m/package.json"); - - #[rustfmt::skip] - let fail = [ - // ("throw error if extension not provided", f2.clone(), "exports-field/dist/main", ResolveError::NotFound(f2.join("node_modules/exports-field/lib/lib2/main"))), - ("resolver should respect query parameters #2. Direct matching", f2.clone(), "exports-field?foo", ResolveError::PackagePathNotExported("./?foo".into(), p2.clone())), - ("resolver should respect fragment parameters #2. Direct matching", f2, "exports-field#foo", ResolveError::PackagePathNotExported("./#foo".into(), p2)), - ("relative path should not work with exports field", f.clone(), "./node_modules/exports-field/dist/main.js", ResolveError::NotFound("./node_modules/exports-field/dist/main.js".into())), - ("backtracking should not work for request", f.clone(), "exports-field/dist/../../../a.js", ResolveError::InvalidPackageTarget("./lib/../../../a.js".to_string(), "./dist/".to_string(), p.clone())), - ("backtracking should not work for exports field target", f.clone(), "exports-field/dist/a.js", ResolveError::InvalidPackageTarget("./../../a.js".to_string(), "./dist/a.js".to_string(), p.clone())), - ("not exported error", f.clone(), "exports-field/anything/else", ResolveError::PackagePathNotExported("./anything/else".to_string(), p.clone())), - ("request ending with slash #1", f.clone(), "exports-field/", ResolveError::PackagePathNotExported("./".to_string(), p.clone())), - ("request ending with slash #2", f.clone(), "exports-field/dist/", ResolveError::PackagePathNotExported("./dist/".to_string(), p.clone())), - ("request ending with slash #3", f.clone(), "exports-field/lib/", ResolveError::PackagePathNotExported("./lib/".to_string(), p)), - ("should throw error if target is invalid", f4, "exports-field", ResolveError::InvalidPackageTarget("./a/../b/../../pack1/index.js".to_string(), ".".to_string(), p4)), - ("throw error if exports field is invalid", f.clone(), "invalid-exports-field", ResolveError::InvalidPackageConfig(f.join("node_modules/invalid-exports-field/package.json"))), - ("should throw error if target is 'null'", f5, "m/features/internal/file.js", ResolveError::PackagePathNotExported("./features/internal/file.js".to_string(), p5)), - ]; - - for (comment, path, request, error) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!(resolution, Err(error), "{comment} {path:?} {request}"); - } -} - -// resolve using exports field, not a browser field #1 -#[test] -fn exports_not_browser_field1() { - let f = super::fixture().join("exports-field"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - condition_names: vec!["webpack".into()], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "exports-field/dist/main.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("node_modules/exports-field/lib/lib2/main.js"))); -} - -// resolve using exports field and a browser alias field #2 -#[test] -fn exports_not_browser_field2() { - let f2 = super::fixture().join("exports-field2"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - extensions: vec![".js".into()], - condition_names: vec!["node".into()], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f2, "exports-field/dist/main.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f2.join("node_modules/exports-field/lib/browser.js"))); -} - -// should resolve extension without fullySpecified -#[test] -fn extension_without_fully_specified() { - let f2 = super::fixture().join("exports-field2"); - - let commonjs_resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - let resolved_path = - commonjs_resolver.resolve(&f2, "exports-field/dist/main").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f2.join("node_modules/exports-field/lib/lib2/main.js"))); -} - -#[test] -fn field_name_path() { - let f2 = super::fixture().join("exports-field2"); - let f3 = super::fixture().join("exports-field3"); - - // field name path #1 #2 #3 - let exports_fields = [ - vec![vec!["exportsField".into(), "exports".into()]], - vec![vec!["exportsField".into(), "exports".into()], vec!["exports".into()]], - vec![vec!["exports".into()], vec!["exportsField".into(), "exports".into()]], - ]; - - for exports_fields in exports_fields { - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - exports_fields, - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/main.js"))); - } - - // field name path #4 - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - exports_fields: vec![vec!["exports".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f2, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f2.join("node_modules/exports-field/index.js"))); - - // field name path #5 - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - exports_fields: vec![vec!["ex".into()], vec!["exports_field".into(), "exports".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/index"))); - - // non-compliant export targeting a directory - let resolver = Resolver::new(ResolveOptions { - exports_fields: vec![vec!["broken".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/src/index.js"))); -} - -#[test] -fn shared_resolvers() { - let f3 = super::fixture().join("exports-field3"); - - let resolver1 = Resolver::new(ResolveOptions { - exports_fields: vec![vec!["exportsField".into(), "exports".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver1.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/main.js"))); - - let resolver2 = resolver1.clone_with_options(ResolveOptions { - exports_fields: vec![vec!["ex".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver2.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/index"))); -} - -#[test] -fn extension_alias_1_2() { - let f = super::fixture().join("exports-field-and-extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - extension_alias: vec![(".js".into(), vec![".ts".into(), ".js".into()])], - fully_specified: true, - condition_names: vec!["webpack".into(), "default".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve with the `extensionAlias` option", f.clone(), "@org/pkg/string.js", f.join("node_modules/@org/pkg/dist/string.js")), - ("should resolve with the `extensionAlias` option #2", f.clone(), "pkg/string.js", f.join("node_modules/pkg/dist/string.js")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn extension_alias_3() { - let f = super::fixture().join("exports-field-and-extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - extension_alias: vec![( - ".js".into(), - vec![".foo".into(), ".baz".into(), ".baz".into(), ".ts".into(), ".js".into()], - )], - fully_specified: true, - condition_names: vec!["webpack".into(), "default".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve with the `extensionAlias` option #3", f.clone(), "pkg/string.js", f.join("node_modules/pkg/dist/string.js")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn extension_alias_throw_error() { - let f = super::fixture().join("exports-field-and-extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - extension_alias: vec![(".js".into(), vec![".ts".into()])], - fully_specified: true, - condition_names: vec!["webpack".into(), "default".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let fail = [ - // enhanced-resolve has two test cases that are exactly the same here - // https://github.com/webpack/enhanced-resolve/blob/a998c7d218b7a9ec2461fc4fddd1ad5dd7687485/test/exportsField.test.js#L2976-L3024 - ("should throw error with the `extensionAlias` option", f.clone(), "pkg/string.js", ResolveError::ExtensionAlias(f.join("node_modules/pkg/dist/string.js"))), - // TODO: The error is PackagePathNotExported in enhanced-resolve - // ("should throw error with the `extensionAlias` option", f.clone(), "pkg/string.js", ResolveError::PackagePathNotExported("node_modules/pkg/dist/string.ts".to_string())), - ]; - - for (comment, path, request, error) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!(resolution, Err(error), "{comment} {path:?} {request}"); - } -} - -// Small script for generating the test cases from enhanced-resolve -// for (c of testCases) { -// console.log("TestCase {") -// console.log(`name: ${JSON.stringify(c.name)},`) -// if (c.expect instanceof Error) { -// console.log(`expect: None,`) -// } else { -// console.log(`expect: Some(vec!${JSON.stringify(c.expect)}),`) -// } -// console.log(`exports_field: exports_field(json!(${JSON.stringify(c.suite[0], null, 2)})),`) -// console.log(`request: "${c.suite[1]}",`) -// console.log(`condition_names: vec!${JSON.stringify(c.suite[2])},`) -// console.log("},") -//} -struct TestCase { - name: &'static str, - expect: Option>, - exports_field: serde_json::Value, - request: &'static str, - condition_names: Vec<&'static str>, -} - -#[allow(clippy::needless_pass_by_value)] -fn exports_field(value: serde_json::Value) -> serde_json::Value { - value -} - -#[test] -fn test_cases() { - let test_cases = [ - TestCase { - name: "sample #1", - expect: Some(vec!["./dist/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/": { - "import": [ - "./dist/", - "./src/" - ], - "webpack": "./wp/" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "sample #1", - expect: Some(vec!["./src/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/": { - "import": [ - "./src/" - ], - "webpack": "./wp/" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - TestCase { - name: "sample #1 (wildcard)", - expect: Some(vec!["./dist/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/*": { - "import": [ - "./dist/*", - "./src/*" - ], - "webpack": "./wp/*" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "sample #1 (wildcard)", - expect: Some(vec!["./src/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/*": { - "import": [ - "./src/*" - ], - "webpack": "./wp/*" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - TestCase { - name: "sample #2", - expect: Some(vec!["./data/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./timezones/": "./data/timezones/" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #2 (wildcard)", - expect: Some(vec!["./data/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./timezones/*": "./data/timezones/*" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #3", - expect: Some(vec!["./data/timezones/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./": "./data/timezones/" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #3 (wildcard)", - expect: Some(vec!["./data/timezones/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./*": "./data/timezones/*.mjs" - })), - request: "./timezones/pdt", - condition_names: vec![], - }, - TestCase { - name: "sample #4", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./lib/": { - "browser": [ - "./browser/" - ] - }, - "./dist/index.js": { - "node": "./index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #4 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "node": "./index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #5", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/": { - "browser": [ - "./browser/" - ] - }, - "./dist/index.js": { - "node": "./index.js", - "default": "./browser/index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #5 (wildcard)", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "node": "./index.js", - "default": "./browser/index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./dist/a": "./dist/index.js" - })), - request: "./dist/aaa", - condition_names: vec![], - }, - TestCase { - name: "sample #7", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./dist/a/a/": "./dist/index.js" - })), - request: "./dist/a/a", - condition_names: vec![], - }, - TestCase { - name: "sample #7 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./dist/a/a/*": "./dist/index.js" - })), - request: "./dist/a/a", - condition_names: vec![], - }, - TestCase { - name: "sample #8", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": "./index.js" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #9", - expect: Some(vec!["./main.js"]), - exports_field: exports_field(json!({ - "./index.js": "./main.js" - })), - request: "./index.js", - condition_names: vec![], - }, - TestCase { - name: "sample #10", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #11", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./bar#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #12", - expect: Some(vec!["./ok.js#abc"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/ok.js#abc", - condition_names: vec![], - }, - TestCase { - name: "sample #12", - expect: Some(vec!["./ok.js#abc"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/ok.js#abc", - condition_names: vec![], - }, - TestCase { - name: "sample #13", - expect: Some(vec!["./ok.js?abc"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/ok.js?abc", - condition_names: vec![], - }, - TestCase { - name: "sample #14", - expect: Some(vec!["./🎉.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/🎉.js", - condition_names: vec![], - }, - TestCase { - name: "sample #15", - expect: Some(vec!["./%F0%9F%8E%89.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/%F0%9F%8E%89.js", - condition_names: vec![], - }, - TestCase { - name: "sample #16", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./🎉", - condition_names: vec![], - }, - TestCase { - name: "sample #17", - expect: Some(vec!["./other.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./%F0%9F%8E%89", - condition_names: vec![], - }, - TestCase { - name: "sample #18", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./module", - condition_names: vec![], - }, - TestCase { - name: "sample #19", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./module#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #20", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./module?foo", - condition_names: vec![], - }, - TestCase { - name: "sample #21", - expect: Some(vec!["./zizizi"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./z*z*z*" - })), - request: "./#zippi", - condition_names: vec![], - }, - TestCase { - name: "sample #22", - expect: Some(vec!["./d?e?f"]), - exports_field: exports_field(json!({ - "./a?b?c/": "./" - })), - request: "./a?b?c/d?e?f", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #1", - expect: Some(vec!["./dist/index.js"]), - exports_field: exports_field(json!({ - ".": "./dist/index.js" - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #2", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./": "./", - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #3", - expect: Some(vec!["./dist/a.js"]), - exports_field: exports_field(json!({ - "./dist/": "./dist/", - "./dist/*": "./dist/*", - "./dist*": "./dist*", - "./dist/index.js": "./dist/a.js" - })), - request: "./dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #4", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./": { - "browser": [ - "./browser/" - ] - }, - "./*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "browser": "./index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #5", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./": { - "browser": [ - "./browser/" - ] - }, - "./*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "node": "./node.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #6", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - ".": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #7", - expect: Some(vec!["./src/index.js"]), // `enhanced_resolve` is `None` - exports_field: exports_field(json!({ - ".": { - "default": "./src/index.js", - "browser": "./index.js", - "node": "./src/node/index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #8", - expect: Some(vec!["./src/index.js"]), - exports_field: exports_field(json!({ - ".": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #9", - expect: Some(vec!["./index"]), - exports_field: exports_field(json!({ - ".": "./index" - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #10", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./index": "./index.js" - })), - request: "./index", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #11", - expect: Some(vec!["./foo.js"]), - exports_field: exports_field(json!({ - "./": "./", - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #12", - expect: Some(vec!["./foo/bar/baz.js"]), - exports_field: exports_field(json!({ - "./": "./", - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo/bar/baz.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #13", - expect: Some(vec!["./foo/bar/baz.js"]), - exports_field: exports_field(json!({ - "./": "./", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo/bar/baz.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #14", - expect: Some(vec!["./foo/bar/baz.js"]), - exports_field: exports_field(json!({ - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo/bar/baz.js", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #1", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "require": "./require.js" - }, { - "import": "./import.mjs" - }] - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #2", - expect: Some(vec!["./import.mjs"]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "require": "./require.js" - }, { - "import": "./import.mjs" - }] - })), - request: ".", - condition_names: vec!["import"], - }, - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./require.js"]), - exports_field: exports_field(json!({ - ".": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./import.mjs"]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "import": "./import.mjs" - }] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./require.js"]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "require": [ - "./require.js" - ] - }, { - "import": [ - "./import.mjs", - "./import.js" - ] - }] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./import.mjs"]), - exports_field: exports_field(json!({ - ".": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "./import.mjs", - "./import.js" - ] - } - ] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./import.js"]), - exports_field: exports_field(json!({ - ".": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "./import.js" - ] - } - ] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "mapping to a folder root #1", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./timezones": "./data/timezones/" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #2", - expect: None, - exports_field: exports_field(json!({ - "./timezones/": "./data/timezones" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #3", - expect: Some(vec!["./data/timezones/pdt/index.mjs"]), - exports_field: exports_field(json!({ - "./timezones/pdt/": "./data/timezones/pdt/" - })), - request: "./timezones/pdt/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #3 (wildcard)", - expect: Some(vec!["./data/timezones/pdt/index.mjs"]), - exports_field: exports_field(json!({ - "./timezones/pdt/*": "./data/timezones/pdt/*" - })), - request: "./timezones/pdt/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #4", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./": "./timezones/" - })), - request: "./pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #4 (wildcard)", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./*": "./timezones/*" - })), - request: "./pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #5", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./": "./" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #5 (wildcard)", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./*": "./*" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #6", - expect: None, - exports_field: exports_field(json!({ - "./": "." - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #6 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "./*": "." - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #7", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": "./" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #7 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": "./*" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #1", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./": "./", - "./dist/": "./lib/" - })), - request: "./dist/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #1 (wildcard)", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./*": "./*", - "./dist/*": "./lib/*" - })), - request: "./dist/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #2", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/": "./dist/utils/", - "./dist/": "./lib/" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #2 (wildcard)", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/*": "./dist/utils/*", - "./dist/*": "./lib/*" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #3", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/index.js": "./dist/utils/index.js", - "./dist/utils/": "./dist/utils/index.mjs", - "./dist/": "./lib/" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #3 (wildcard)", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/index.js": "./dist/utils/index.js", - "./dist/utils/*": "./dist/utils/index.mjs", - "./dist/*": "./lib/*" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #4", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./": { - "browser": "./browser/" - }, - "./dist/": "./lib/" - })), - request: "./dist/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "the longest matching path prefix is prioritized #4 (wildcard)", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./*": { - "browser": "./browser/*" - }, - "./dist/*": "./lib/*" - })), - request: "./dist/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #1", - // `lodash/` does not start with './' so fallbacks to util - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "conditional mapping folder #1", - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": [ - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #1 (wildcard)", - // `lodash/` does not start with './' so fallbacks to util - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": [ - "lodash/*", - "./utils/*" - ], - "node": [ - "./utils-node/*" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "conditional mapping folder #1 (wildcard)", - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": [ - "./utils/*" - ], - "node": [ - "./utils-node/*" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #2", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./node/" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "conditional mapping folder #2 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "webpack": "./wpk/*", - "browser": [ - "lodash/*", - "./utils/*" - ], - "node": [ - "./node/*" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "conditional mapping folder #3", - expect: Some(vec!["./wpk/index.mjs"]), - exports_field: exports_field(json!({ - "./utils/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils/" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "conditional mapping folder #3 (wildcard)", - expect: Some(vec!["./wpk/index.mjs"]), - exports_field: exports_field(json!({ - "./utils/*": { - "webpack": "./wpk/*", - "browser": [ - "lodash/*", - "./utils/*" - ], - "node": [ - "./utils/*" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "incorrect exports field #1", - expect: None, - exports_field: exports_field(json!({ - "/utils/": "./a/" - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #2", - expect: None, - exports_field: exports_field(json!({ - "./utils/": "/a/" - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #3", - expect: None, - exports_field: exports_field(json!({ - "/utils/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #4", - expect: None, - exports_field: exports_field(json!({ - "./utils/": { - "browser": "/a/", - "default": "/b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #4 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "/a/", - "default": "/b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #5", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index": "./a/index.js" - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index.mjs": "./a/index.js" - })), - request: "./utils/index", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #7", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #8", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index.mjs": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - // Requests that are not `./` does not apply to `package_exports_resolve` - // TestCase { - // name: "incorrect request #1", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": "./a/" - // })), - // request: "/utils/index.mjs", - // condition_names: vec![], - // }, - // TestCase { - // name: "incorrect request #2", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": { - // "browser": "./a/", - // "default": "./b/" - // } - // })), - // request: "/utils/index.mjs", - // condition_names: vec!["browser"], - // }, - // TestCase { - // name: "incorrect request #3", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": { - // "browser": "./a/", - // "default": "./b/" - // } - // })), - // request: "../utils/index.mjs", - // condition_names: vec!["browser"], - // }, - // TestCase { - // name: "incorrect request #4", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": { - // "browser": "./a/", - // "default": "./b/" - // } - // })), - // request: "/utils/index.mjs/", - // condition_names: vec!["browser"], - // }, - TestCase { - name: "backtracking package base #1", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./../../utils/": "./dist/" - })), - request: "./../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #1 (wildcard)", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./../../utils/*": "./dist/*" - })), - request: "./../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #2", - expect: None, - exports_field: exports_field(json!({ - "../../utils/": "./dist/" - })), - request: "../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #2 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "../../utils/*": "./dist/*" - })), - request: "../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #3", - expect: None, - exports_field: exports_field(json!({ - "./utils/": "../src/" - })), - request: "./utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #3 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "./utils/*": "../src/*" - })), - request: "./utils/index", - condition_names: vec![], - }, - // enhanced-resolve does not handle backtracking here - // TestCase { - // name: "backtracking package base #4", - // expect: Some(vec!["./../src/index"]), - // exports_field: exports_field(json!({ - // "./utils/": "./../src/" - // })), - // request: "./utils/index", - // condition_names: vec![], - // }, - // TestCase { - // name: "backtracking package base #4 (wildcard)", - // expect: Some(vec!["./../src/index"]), - // exports_field: exports_field(json!({ - // "./utils/*": "./../src/*" - // })), - // request: "./utils/index", - // condition_names: vec![], - // }, - // TestCase { - // name: "backtracking package base #5", - // expect: Some(vec!["./src/../index.js"]), - // exports_field: exports_field(json!({ - // "./utils/index": "./src/../index.js" - // })), - // request: "./utils/index", - // condition_names: vec![], - // }, - TestCase { - name: "backtracking package base #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/../utils/index": "./src/../index.js" - })), - request: "./utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #7", - expect: None, - exports_field: exports_field(json!({ - "./utils/": { - "browser": "../this/" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #7", - expect: None, - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "../this/*" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #8", - // We throw "InvalidPackageTarget" - // expect: Some(vec!["./utils/../index"]), - expect: None, - exports_field: exports_field(json!({ - "./utils/": { - "browser": "./utils/../" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #8 (wildcard)", - // We throw "InvalidPackageTarget" - // expect: Some(vec!["./utils/../index"]), - expect: None, - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "./utils/../*" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #9", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./": "./src/../../", - "./dist/": "./dist/" - })), - request: "./dist/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #9 (wildcard)", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./*": "./src/../../*", - "./dist/*": "./dist/*" - })), - request: "./dist/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking target folder #1", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../../index"]), - exports_field: exports_field(json!({ - "./utils/": "./dist/" - })), - request: "./utils/timezone/../../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #1 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../../index"]), - exports_field: exports_field(json!({ - "./utils/*": "./dist/*" - })), - request: "./utils/timezone/../../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #2", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../index"]), - exports_field: exports_field(json!({ - "./utils/": "./dist/" - })), - request: "./utils/timezone/../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #2 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../index"]), - exports_field: exports_field(json!({ - "./utils/*": "./dist/*" - })), - request: "./utils/timezone/../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #3", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/target/../../index"]), - exports_field: exports_field(json!({ - "./utils/": "./dist/target/" - })), - request: "./utils/../../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #3 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/target/../../index"]), - exports_field: exports_field(json!({ - "./utils/*": "./dist/target/*" - })), - request: "./utils/../../index", - condition_names: vec![], - }, - // enhanced-resolve does not handle `node_modules` in target - TestCase { - name: "nested node_modules path #1", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": "./node_modules/" - } - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #1 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "./node_modules/*" - } - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #2", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./utils/../node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/": "./utils/../node_modules/" - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "nested node_modules path #2 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./utils/../node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": "./utils/../node_modules/*" - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "nested mapping #1", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": "./", - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested mapping #1 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": "./*", - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "nested mapping #2 (wildcard)", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #2 (wildcard)", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "nested mapping #3", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["webpack"], - }, - TestCase { - name: "nested mapping #3 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["webpack"], - }, - TestCase { - name: "nested mapping #4", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["node", "browser"], - }, - TestCase { - name: "nested mapping #4 (wildcard)", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["node", "browser"], - }, - TestCase { - name: "nested mapping #5", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node"], - }, - TestCase { - name: "nested mapping #5 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": { - "webpack": [ - "./wpck/*" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node"], - }, - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - TestCase { - name: "nested mapping #6 (wildcard)", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": { - "webpack": [ - "./wpck/*" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #6 (wildcard)", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./node/*" - ], - "default": { - "node": { - "webpack": [ - "./wpck/*" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - TestCase { - name: "nested mapping #7", - expect: Some(vec!["./y.js"]), - exports_field: exports_field(json!({ - "./a.js": { - "abc": { - "def": "./x.js" - }, - "ghi": "./y.js" - } - })), - request: "./a.js", - condition_names: vec!["abc", "ghi"], - }, - TestCase { - name: "nested mapping #8", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./a.js": { - "abc": { - "def": "./x.js", - "default": [] - }, - "ghi": "./y.js" - } - })), - request: "./a.js", - condition_names: vec!["abc", "ghi"], - }, - TestCase { - name: "syntax sugar #1", - expect: Some(vec!["./main.js"]), - exports_field: exports_field(json!("./main.js")), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #2", - expect: Some(vec![]), - exports_field: exports_field(json!("./main.js")), - request: "./lib.js", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #3", - expect: Some(vec!["./a.js"]), - exports_field: exports_field(json!(["./a.js", "./b.js"])), - request: ".", - condition_names: vec![], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "syntax sugar #3", - expect: Some(vec!["./b.js"]), - exports_field: exports_field(json!(["./b.js"])), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #4", - expect: Some(vec![]), - exports_field: exports_field(json!(["./a.js", "./b.js"])), - request: "./lib.js", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #5", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "browser": { - "default": "./index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "syntax sugar #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "browser": { - "default": "./index.js" - } - })), - request: "./lib.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "syntax sugar #7", - expect: None, - exports_field: exports_field(json!({ - "./node": "./node.js", - "browser": { - "default": "./index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "syntax sugar #8", - expect: None, - exports_field: exports_field(json!({ - "browser": { - "default": "./index.js" - }, - "./node": "./node.js" - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #1", - expect: Some(vec!["./abc/d"]), - exports_field: exports_field(json!({ - "./ab*": "./ab/*", - "./abc*": "./abc/*", - "./a*": "./a/*" - })), - request: "./abcd", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #2", - expect: Some(vec!["./abc/d/e"]), - exports_field: exports_field(json!({ - "./ab*": "./ab/*", - "./abc*": "./abc/*", - "./a*": "./a/*" - })), - request: "./abcd/e", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #3", - expect: Some(vec!["./abc/d"]), - exports_field: exports_field(json!({ - "./x/ab*": "./ab/*", - "./x/abc*": "./abc/*", - "./x/a*": "./a/*" - })), - request: "./x/abcd", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #4", - expect: Some(vec!["./abc/d/e"]), - exports_field: exports_field(json!({ - "./x/ab*": "./ab/*", - "./x/abc*": "./abc/*", - "./x/a*": "./a/*" - })), - request: "./x/abcd/e", - condition_names: vec!["browser"], - }, - TestCase { - name: "path tree edge case #1", - expect: Some(vec!["./A/b/d.js"]), - exports_field: exports_field(json!({ - "./a/": "./A/", - "./a/b/c": "./c.js" - })), - request: "./a/b/d.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #1 (wildcard)", - expect: Some(vec!["./A/b/d.js"]), - exports_field: exports_field(json!({ - "./a/*": "./A/*", - "./a/b/c": "./c.js" - })), - request: "./a/b/d.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #2", - expect: Some(vec!["./A/c.js"]), - exports_field: exports_field(json!({ - "./a/": "./A/", - "./a/b": "./b.js" - })), - request: "./a/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #2 (wildcard)", - expect: Some(vec!["./A/c.js"]), - exports_field: exports_field(json!({ - "./a/*": "./A/*", - "./a/b": "./b.js" - })), - request: "./a/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #3", - expect: Some(vec!["./A/b/d/c.js"]), - exports_field: exports_field(json!({ - "./a/": "./A/", - "./a/b/c/d": "./c.js" - })), - request: "./a/b/d/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #3 (wildcard)", - expect: Some(vec!["./A/b/d/c.js"]), - exports_field: exports_field(json!({ - "./a/*": "./A/*", - "./a/b/c/d": "./c.js" - })), - request: "./a/b/d/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #1", - expect: Some(vec!["./A/b.js"]), - exports_field: exports_field(json!({ - "./a/*.js": "./A/*.js" - })), - request: "./a/b.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #2", - expect: Some(vec!["./A/b/c.js"]), - exports_field: exports_field(json!({ - "./a/*.js": "./A/*.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #3", - expect: Some(vec!["./A/b/c.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": "./A/*/c.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #4", - expect: Some(vec!["./A/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": "./A/*/*.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #5", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/*.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #5", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/*.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./lib/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #6", - expect: Some(vec!["./browser/foo/bar.js"]), - exports_field: exports_field(json!({ - "./lib/*/bar.js": { - "browser": [ - "./browser/*/bar.js" - ] - }, - "./dist/*/bar.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./lib/foo/bar.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #6", - expect: Some(vec!["./browser/foo.js"]), - exports_field: exports_field(json!({ - "./lib/*/bar.js": { - "browser": [ - "./browser/*/bar.js" - ] - }, - "./dist/*/bar.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./dist/foo/bar.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #7", - expect: Some(vec!["./browser/foo/default.js"]), - exports_field: exports_field(json!({ - "./lib/*/bar.js": { - "browser": [ - "./browser/*/bar.js" - ] - }, - "./dist/*/bar.js": { - "node": "./*.js", - "default": "./browser/*/default.js" - } - })), - request: "./dist/foo/bar.js", - condition_names: vec!["default"], - }, - TestCase { - name: "wildcard pattern #8", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": "./A/*/*/*.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #9", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": [ - "./A/*/*/*.js", - "./B/*/*/*.js" - ] - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "wildcard pattern #9", - expect: Some(vec!["./B/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": [ - "./B/*/*/*.js" - ] - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #10", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/foo-*/c.js": "./A/*/*/*.js" - })), - request: "./a/foo-b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #11", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*-foo/c.js": "./A/*/*/*.js" - })), - request: "./a/b-foo/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #12", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/foo-*-foo/c.js": "./A/*/*/*.js" - })), - request: "./a/foo-b-foo/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #13", - expect: Some(vec!["./A/b/c/d.js"]), - exports_field: exports_field(json!({ - "./a/foo-*-foo/c.js": "./A/b/c/d.js" - })), - request: "./a/foo-b-foo/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #14", - expect: Some(vec!["./A/b/c/*.js"]), - exports_field: exports_field(json!({ - "./a/foo-foo/c.js": "./A/b/c/*.js" - })), - request: "./a/foo-foo/c.js", - condition_names: vec![], - }, - ]; - - for case in test_cases { - let resolved = Resolver::new(ResolveOptions { - condition_names: case - .condition_names - .iter() - .map(ToString::to_string) - .collect::>(), - ..ResolveOptions::default() - }) - .package_exports_resolve( - Path::new(""), - case.request, - &case.exports_field, - &mut Ctx::default(), - ) - .map(|p| p.map(|p| p.to_path_buf())); - if let Some(expect) = case.expect { - if expect.is_empty() { - assert!( - matches!(resolved, Err(ResolveError::PackagePathNotExported(_, _))), - "{} {:?}", - &case.name, - &resolved - ); - } else { - for expect in expect { - assert_eq!(resolved, Ok(Some(Path::new(expect).normalize())), "{}", &case.name); - } - } - } else { - assert!(resolved.is_err(), "{} {resolved:?}", &case.name); - } - } -} diff --git a/src/tests/extension_alias.rs b/src/tests/extension_alias.rs deleted file mode 100644 index cc6a906b..00000000 --- a/src/tests/extension_alias.rs +++ /dev/null @@ -1,70 +0,0 @@ -//! - -use crate::{ResolveError, ResolveOptions, Resolver}; - -#[test] -fn extension_alias() { - let f = super::fixture().join("extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - extension_alias: vec![ - (".js".into(), vec![".ts".into(), ".js".into()]), - (".mjs".into(), vec![".mts".into()]), - ], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should alias fully specified file", f.clone(), "./index.js", f.join("index.ts")), - ("should alias fully specified file when there are two alternatives", f.clone(), "./dir/index.js", f.join("dir/index.ts")), - ("should also allow the second alternative", f.clone(), "./dir2/index.js", f.join("dir2/index.js")), - ("should support alias option without an array", f.clone(), "./dir2/index.mjs", f.join("dir2/index.mts")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } - - #[rustfmt::skip] - let fail = [ - ("should not allow to fallback to the original extension or add extensions", f.clone(), "./index.mjs"), - ]; - - for (comment, path, request) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!( - resolution, - Err(ResolveError::ExtensionAlias(f.join(request))), - "{comment} {path:?} {request}" - ); - } -} - -// should not apply extension alias to extensions or mainFiles field -#[test] -fn not_apply_to_extension_nor_main_files() { - let f = super::fixture().join("extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - extension_alias: vec![(".js".into(), vec![])], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("directory", f.clone(), "./dir2", "dir2/index.js"), - ("file", f.clone(), "./dir2/index", "dir2/index.js"), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - let expected = f.join(expected); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} diff --git a/src/tests/mod.rs b/src/tests/mod.rs deleted file mode 100644 index e347dd1f..00000000 --- a/src/tests/mod.rs +++ /dev/null @@ -1,51 +0,0 @@ -mod alias; -mod browser_field; -mod builtins; -mod dependencies; -mod exports_field; -mod extension_alias; -mod extensions; -mod fallback; -mod full_specified; -mod imports_field; -mod incorrect_description_file; -mod main_field; -mod memory_fs; -mod missing; -#[cfg(feature = "yarn_pnp")] -mod pnp; -mod resolve; -mod restrictions; -mod roots; -mod scoped_packages; -mod simple; -mod symlink; -mod tsconfig_paths; -mod tsconfig_project_references; - -use crate::Resolver; -use std::{env, path::PathBuf, sync::Arc, thread}; - -pub fn fixture_root() -> PathBuf { - env::current_dir().unwrap().join("fixtures") -} - -pub fn fixture() -> PathBuf { - fixture_root().join("enhanced_resolve").join("test").join("fixtures") -} - -#[test] -fn threaded_environment() { - let cwd = env::current_dir().unwrap(); - let resolver = Arc::new(Resolver::default()); - for _ in 0..2 { - _ = thread::spawn({ - let cwd = cwd.clone(); - let resolver = Arc::clone(&resolver); - move || { - _ = resolver.resolve(cwd, "."); - } - }) - .join(); - } -} diff --git a/src/tests/pnp.rs b/src/tests/pnp.rs deleted file mode 100644 index 1562a009..00000000 --- a/src/tests/pnp.rs +++ /dev/null @@ -1,45 +0,0 @@ -//! Not part of enhanced_resolve's test suite -//! -//! enhanced_resolve's test -//! cannot be ported over because it uses mocks on `pnpApi` provided by the runtime. - -use crate::{ResolveOptions, Resolver}; - -#[test] -fn pnp1() { - let fixture = super::fixture_root().join("pnp"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - pnp_manifest: Some(pnp::load_pnp_manifest(fixture.join(".pnp.cjs")).unwrap()), - ..ResolveOptions::default() - }); - - assert_eq!( - resolver.resolve(&fixture, "is-even").map(|r| r.full_path()), - Ok(fixture.join( - ".yarn/cache/is-even-npm-1.0.0-9f726520dc-2728cc2f39.zip/node_modules/is-even/index.js" - )) - ); - - assert_eq!( - resolver - .resolve( - &fixture.join( - ".yarn/cache/is-even-npm-1.0.0-9f726520dc-2728cc2f39.zip/node_modules/is-even" - ), - "is-odd" - ) - .map(|r| r.full_path()), - Ok(fixture.join( - ".yarn/cache/is-odd-npm-0.1.2-9d980a9da8-7dc6c6fd00.zip/node_modules/is-odd/index.js" - )), - ); - - assert_eq!( - resolver.resolve(&fixture, "is-odd").map(|r| r.full_path()), - Ok(fixture.join( - ".yarn/cache/is-odd-npm-3.0.1-93c3c3f41b-89ee2e353c.zip/node_modules/is-odd/index.js" - )), - ); -} diff --git a/tests/resolve_test.rs b/tests/resolve_test.rs deleted file mode 100644 index 45934cf8..00000000 --- a/tests/resolve_test.rs +++ /dev/null @@ -1,132 +0,0 @@ -use std::{env, path::PathBuf}; - -use oxc_resolver::{ResolveError, ResolveOptions, Resolver}; - -fn dir() -> PathBuf { - env::current_dir().unwrap() -} - -#[test] -fn chinese() { - let dir = dir(); - let specifier = "./fixtures/misc/中文/中文.js"; - let resolution = Resolver::new(ResolveOptions::default()).resolve(&dir, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(dir.join("fixtures/misc/中文/中文.js")) - ); -} - -#[test] -fn styled_components() { - let dir = dir(); - let path = dir.join("fixtures/pnpm"); - let module_path = dir.join("node_modules/.pnpm/styled-components@6.1.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/styled-components"); - let specifier = "styled-components"; - - // cjs - let options = - ResolveOptions { alias_fields: vec![vec!["browser".into()]], ..ResolveOptions::default() }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/styled-components.browser.cjs.js")) - ); - - // esm - let options = ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - main_fields: vec!["module".into()], - ..ResolveOptions::default() - }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/styled-components.browser.esm.js")) - ); -} - -#[test] -fn axios() { - let dir = dir(); - let path = dir.join("fixtures/pnpm"); - let module_path = dir.join("node_modules/.pnpm/axios@1.6.2/node_modules/axios"); - let specifier = "axios"; - - // default - let options = ResolveOptions::default(); - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("index.js")) - ); - - // browser - let options = ResolveOptions { - condition_names: vec!["browser".into(), "require".into()], - ..ResolveOptions::default() - }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/browser/axios.cjs")) - ); - - // cjs - let options = ResolveOptions { - condition_names: vec!["node".into(), "require".into()], - ..ResolveOptions::default() - }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/node/axios.cjs")) - ); -} - -#[test] -fn postcss() { - let dir = dir(); - let path = dir.join("fixtures/pnpm"); - let module_path = path.join("node_modules/postcss"); - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - // should ignore "path" - let resolution = resolver.resolve(&module_path, "path"); - assert_eq!(resolution, Err(ResolveError::Ignored(module_path.clone()))); - - // should ignore "./lib/terminal-highlight" - let resolution = resolver.resolve(&module_path, "./lib/terminal-highlight"); - assert_eq!(resolution, Err(ResolveError::Ignored(module_path.join("lib/terminal-highlight")))); -} - -#[test] -fn ipaddr_js() { - let dir = dir(); - let path = dir.join("fixtures/pnpm"); - let module_path = - dir.join("node_modules/.pnpm/ipaddr.js@2.2.0/node_modules/ipaddr.js/lib/ipaddr.js"); - - let resolvers = [ - // with `extension_alias` - Resolver::new(ResolveOptions { - extension_alias: vec![(".js".into(), vec![".js".into(), ".ts".into(), ".tsx".into()])], - ..ResolveOptions::default() - }), - // with `extensions` should still resolve to module main - Resolver::new(ResolveOptions { - extensions: vec![(".ts".into())], - ..ResolveOptions::default() - }), - // default - Resolver::default(), - ]; - - for resolver in resolvers { - let resolution = resolver.resolve(&path, "ipaddr.js").map(|r| r.full_path()); - assert_eq!(resolution, Ok(module_path.clone())); - } -} From 4e54d92c062275b1f97aae8c80bc64049f892fac Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Mon, 19 Aug 2024 00:19:46 +0300 Subject: [PATCH 51/82] --- package.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index a010e24d..ee5f3b69 100644 --- a/package.json +++ b/package.json @@ -6,11 +6,11 @@ ] }, "devDependencies": { - "@napi-rs/cli": "3.0.0-alpha.58", - "@napi-rs/wasm-runtime": "^0.2.4", - "@types/node": "^22.0.0", - "ava": "^6.1.3", - "emnapi": "^1.2.0" + "@napi-rs/cli": "3.0.0-alpha.62", + "@napi-rs/wasm-runtime": "0.2.4", + "@types/node": "22.4.0", + "ava": "6.1.3", + "emnapi": "1.2.0" }, "funding": { "url": "https://github.com/sponsors/Boshen" From 20c072271109118d6c48c34003d82243207ab0b0 Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Mon, 19 Aug 2024 10:32:45 +0300 Subject: [PATCH 52/82] --- Cargo.lock | 1319 ---------------------------------------------------- 1 file changed, 1319 deletions(-) delete mode 100644 Cargo.lock diff --git a/Cargo.lock b/Cargo.lock deleted file mode 100644 index 5fda48e8..00000000 --- a/Cargo.lock +++ /dev/null @@ -1,1319 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "adler" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" - -[[package]] -name = "aho-corasick" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" -dependencies = [ - "memchr", -] - -[[package]] -name = "android-tzdata" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" - -[[package]] -name = "android_system_properties" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" -dependencies = [ - "libc", -] - -[[package]] -name = "anes" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "735d4f398ca57cfa2880225c2bf81c3b9af3be5bb22e44ae70118dad38713e84" - -[[package]] -name = "arca" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f915ddd863ef73f11c10c75170e86db1d4f539689bc6bfb9ce25d6528d6fe83" -dependencies = [ - "clean-path", - "path-slash", - "radix_trie", -] - -[[package]] -name = "autocfg" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" - -[[package]] -name = "base64" -version = "0.22.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" - -[[package]] -name = "bit-set" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1" -dependencies = [ - "bit-vec", -] - -[[package]] -name = "bit-vec" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "bitflags" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" - -[[package]] -name = "bpaf" -version = "0.9.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3280efcf6d66bc77c2cf9b67dc8acee47a217d9be67dd590b3230dffe663724d" - -[[package]] -name = "bumpalo" -version = "3.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" - -[[package]] -name = "byteorder" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" - -[[package]] -name = "cast" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" - -[[package]] -name = "cc" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eaff6f8ce506b9773fa786672d63fc7a191ffea1be33f72bbd4aeacefca9ffc8" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "chrono" -version = "0.4.38" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" -dependencies = [ - "android-tzdata", - "iana-time-zone", - "num-traits", - "serde", - "windows-targets 0.52.6", -] - -[[package]] -name = "ciborium" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42e69ffd6f0917f5c029256a24d0161db17cea3997d185db0d35926308770f0e" -dependencies = [ - "ciborium-io", - "ciborium-ll", - "serde", -] - -[[package]] -name = "ciborium-io" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05afea1e0a06c9be33d539b876f1ce3692f4afea2cb41f740e7743225ed1c757" - -[[package]] -name = "ciborium-ll" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57663b653d948a338bfb3eeba9bb2fd5fcfaecb9e199e87e1eda4d9e8b240fd9" -dependencies = [ - "ciborium-io", - "half", -] - -[[package]] -name = "clean-path" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aaa6b4b263a5d737e9bf6b7c09b72c41a5480aec4d7219af827f6564e950b6a5" - -[[package]] -name = "codspeed" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a104ac948e0188b921eb3fcbdd55dcf62e542df4c7ab7e660623f6288302089" -dependencies = [ - "colored", - "libc", - "serde_json", -] - -[[package]] -name = "colored" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbf2150cce219b664a8a70df7a1f933836724b503f8a413af9365b4dcc4d90b8" -dependencies = [ - "lazy_static", - "windows-sys 0.48.0", -] - -[[package]] -name = "concurrent_lru" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7feb5cb312f774e8a24540e27206db4e890f7d488563671d24a16389cf4c2e4e" -dependencies = [ - "once_cell", -] - -[[package]] -name = "convert_case" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec182b0ca2f35d8fc196cf3404988fd8b8c739a4d270ff118a398feb0cbec1ca" -dependencies = [ - "unicode-segmentation", -] - -[[package]] -name = "core-foundation-sys" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" - -[[package]] -name = "criterion2" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8df39381f28ced0ceebfb5611528d99aef14f8d75b43e9d4ceb6aba66e7b04d" -dependencies = [ - "anes", - "bpaf", - "cast", - "ciborium", - "codspeed", - "colored", - "num-traits", - "oorandom", - "serde", - "serde_json", - "walkdir", -] - -[[package]] -name = "crossbeam-deque" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" -dependencies = [ - "crossbeam-epoch", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.9.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" -dependencies = [ - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" - -[[package]] -name = "crunchy" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" - -[[package]] -name = "ctor" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edb49164822f3ee45b17acd4a208cfc1251410cf0cad9a833234c9890774dd9f" -dependencies = [ - "quote", - "syn", -] - -[[package]] -name = "darling" -version = "0.20.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" -dependencies = [ - "darling_core", - "darling_macro", -] - -[[package]] -name = "darling_core" -version = "0.20.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95133861a8032aaea082871032f5815eb9e98cef03fa916ab4500513994df9e5" -dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "strsim", - "syn", -] - -[[package]] -name = "darling_macro" -version = "0.20.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" -dependencies = [ - "darling_core", - "quote", - "syn", -] - -[[package]] -name = "dashmap" -version = "6.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "804c8821570c3f8b70230c2ba75ffa5c0f9a4189b9a432b6656c536712acae28" -dependencies = [ - "cfg-if", - "crossbeam-utils", - "hashbrown 0.14.5", - "lock_api", - "once_cell", - "parking_lot_core", -] - -[[package]] -name = "deranged" -version = "0.3.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" -dependencies = [ - "powerfmt", - "serde", -] - -[[package]] -name = "document-features" -version = "0.2.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb6969eaabd2421f8a2775cfd2471a2b634372b4a25d41e3bd647b79912850a0" -dependencies = [ - "litrs", -] - -[[package]] -name = "dunce" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" - -[[package]] -name = "either" -version = "1.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" - -[[package]] -name = "endian-type" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" - -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "fancy-regex" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "531e46835a22af56d1e3b66f04844bed63158bc094a628bec1d321d9b4c44bf2" -dependencies = [ - "bit-set", - "regex-automata", - "regex-syntax", -] - -[[package]] -name = "filetime" -version = "0.2.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ee447700ac8aa0b2f2bd7bc4462ad686ba06baa6727ac149a2d6277f0d240fd" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall 0.4.1", - "windows-sys 0.52.0", -] - -[[package]] -name = "fnv" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" - -[[package]] -name = "half" -version = "2.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dd08c532ae367adf81c312a4580bc67f1d0fe8bc9c460520283f4c0ff277888" -dependencies = [ - "cfg-if", - "crunchy", -] - -[[package]] -name = "hashbrown" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" - -[[package]] -name = "hashbrown" -version = "0.14.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "iana-time-zone" -version = "0.1.60" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" -dependencies = [ - "android_system_properties", - "core-foundation-sys", - "iana-time-zone-haiku", - "js-sys", - "wasm-bindgen", - "windows-core", -] - -[[package]] -name = "iana-time-zone-haiku" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" -dependencies = [ - "cc", -] - -[[package]] -name = "ident_case" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" - -[[package]] -name = "indexmap" -version = "1.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" -dependencies = [ - "autocfg", - "hashbrown 0.12.3", - "serde", -] - -[[package]] -name = "indexmap" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93ead53efc7ea8ed3cfb0c79fc8023fbb782a5432b52830b6518941cebe6505c" -dependencies = [ - "equivalent", - "hashbrown 0.14.5", - "serde", -] - -[[package]] -name = "itoa" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" - -[[package]] -name = "js-sys" -version = "0.3.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" -dependencies = [ - "wasm-bindgen", -] - -[[package]] -name = "json-strip-comments" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b271732a960335e715b6b2ae66a086f115c74eb97360e996d2bd809bfc063bba" -dependencies = [ - "memchr", -] - -[[package]] -name = "lazy_static" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" - -[[package]] -name = "libc" -version = "0.2.155" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" - -[[package]] -name = "libloading" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e310b3a6b5907f99202fcdb4960ff45b93735d7c7d96b760fcff8db2dc0e103d" -dependencies = [ - "cfg-if", - "windows-targets 0.52.6", -] - -[[package]] -name = "litrs" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4ce301924b7887e9d637144fdade93f9dfff9b60981d4ac161db09720d39aa5" - -[[package]] -name = "lock_api" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" -dependencies = [ - "autocfg", - "scopeguard", -] - -[[package]] -name = "log" -version = "0.4.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" - -[[package]] -name = "memchr" -version = "2.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" - -[[package]] -name = "miniz_oxide" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" -dependencies = [ - "adler", -] - -[[package]] -name = "napi" -version = "3.0.0-alpha.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ec04344cc540f5897e97c9821ab99e7eb276b4dca6f3e6e441dfa72e5bcde70" -dependencies = [ - "bitflags 2.6.0", - "ctor", - "napi-build", - "napi-sys", - "once_cell", - "serde", - "serde_json", -] - -[[package]] -name = "napi-build" -version = "2.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1c0f5d67ee408a4685b61f5ab7e58605c8ae3f2b4189f0127d804ff13d5560a" - -[[package]] -name = "napi-derive" -version = "3.0.0-alpha.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c6240c4ddca592cde608bbfa26e2af397c3596e413a0c65c9bbcb65c2f1e485" -dependencies = [ - "cfg-if", - "convert_case", - "napi-derive-backend", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "napi-derive-backend" -version = "2.0.0-alpha.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b32dcc50065508fe2f387076c17adbdf10e038d1c080d48b10196813d94ac6a8" -dependencies = [ - "convert_case", - "once_cell", - "proc-macro2", - "quote", - "regex", - "semver", - "syn", -] - -[[package]] -name = "napi-sys" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "427802e8ec3a734331fec1035594a210ce1ff4dc5bc1950530920ab717964ea3" -dependencies = [ - "libloading", -] - -[[package]] -name = "nibble_vec" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" -dependencies = [ - "smallvec", -] - -[[package]] -name = "normalize-path" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5438dd2b2ff4c6df6e1ce22d825ed2fa93ee2922235cc45186991717f0a892d" - -[[package]] -name = "num-conv" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" - -[[package]] -name = "num-traits" -version = "0.2.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" -dependencies = [ - "autocfg", -] - -[[package]] -name = "once_cell" -version = "1.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" - -[[package]] -name = "oorandom" -version = "11.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b410bbe7e14ab526a0e86877eb47c6996a2bd7746f027ba551028c925390e4e9" - -[[package]] -name = "oxc_napi_resolver" -version = "0.0.0" -dependencies = [ - "napi", - "napi-build", - "napi-derive", - "oxc_resolver", - "tracing-subscriber", -] - -[[package]] -name = "oxc_resolver" -version = "1.10.2" -dependencies = [ - "cfg-if", - "criterion2", - "dashmap", - "document-features", - "dunce", - "indexmap 2.4.0", - "json-strip-comments", - "normalize-path", - "once_cell", - "pnp", - "rayon", - "rustc-hash", - "serde", - "serde_json", - "thiserror", - "tracing", - "vfs", -] - -[[package]] -name = "parking_lot_core" -version = "0.9.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall 0.5.2", - "smallvec", - "windows-targets 0.52.6", -] - -[[package]] -name = "path-slash" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e91099d4268b0e11973f036e885d652fb0b21fedcf69738c627f94db6a44f42" - -[[package]] -name = "pathdiff" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8835116a5c179084a830efb3adc117ab007512b535bc1a21c991d3b32a6b44dd" - -[[package]] -name = "pin-project-lite" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" - -[[package]] -name = "pnp" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46770cee76a618023fea15411d0449dd066dc232cc17e4562f154da215f27af7" -dependencies = [ - "arca", - "byteorder", - "concurrent_lru", - "fancy-regex", - "lazy_static", - "miniz_oxide", - "pathdiff", - "regex", - "serde", - "serde_json", - "serde_with", - "thiserror", -] - -[[package]] -name = "powerfmt" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" - -[[package]] -name = "proc-macro2" -version = "1.0.86" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.36" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "radix_trie" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" -dependencies = [ - "endian-type", - "nibble_vec", -] - -[[package]] -name = "rayon" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" -dependencies = [ - "either", - "rayon-core", -] - -[[package]] -name = "rayon-core" -version = "1.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" -dependencies = [ - "crossbeam-deque", - "crossbeam-utils", -] - -[[package]] -name = "redox_syscall" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" -dependencies = [ - "bitflags 1.3.2", -] - -[[package]] -name = "redox_syscall" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c82cf8cff14456045f55ec4241383baeff27af886adb72ffb2162f99911de0fd" -dependencies = [ - "bitflags 2.6.0", -] - -[[package]] -name = "regex" -version = "1.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b91213439dad192326a0d7c6ee3955910425f441d7038e0d6933b0aec5c4517f" -dependencies = [ - "aho-corasick", - "memchr", - "regex-automata", - "regex-syntax", -] - -[[package]] -name = "regex-automata" -version = "0.4.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", -] - -[[package]] -name = "regex-syntax" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" - -[[package]] -name = "rustc-hash" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" - -[[package]] -name = "ryu" -version = "1.0.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" - -[[package]] -name = "same-file" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "scopeguard" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" - -[[package]] -name = "semver" -version = "1.0.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" - -[[package]] -name = "serde" -version = "1.0.208" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cff085d2cb684faa248efb494c39b68e522822ac0de72ccf08109abde717cfb2" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.208" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24008e81ff7613ed8e5ba0cfaf24e2c2f1e5b8a0495711e44fcd4882fca62bcf" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "serde_json" -version = "1.0.125" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83c8e735a073ccf5be70aa8066aa984eaf2fa000db6c8d0100ae605b366d31ed" -dependencies = [ - "indexmap 2.4.0", - "itoa", - "memchr", - "ryu", - "serde", -] - -[[package]] -name = "serde_with" -version = "3.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e73139bc5ec2d45e6c5fd85be5a46949c1c39a4c18e56915f5eb4c12f975e377" -dependencies = [ - "base64", - "chrono", - "hex", - "indexmap 1.9.3", - "indexmap 2.4.0", - "serde", - "serde_derive", - "serde_json", - "serde_with_macros", - "time", -] - -[[package]] -name = "serde_with_macros" -version = "3.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b80d3d6b56b64335c0180e5ffde23b3c5e08c14c585b51a15bd0e95393f46703" -dependencies = [ - "darling", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "sharded-slab" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" -dependencies = [ - "lazy_static", -] - -[[package]] -name = "smallvec" -version = "1.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" - -[[package]] -name = "strsim" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" - -[[package]] -name = "syn" -version = "2.0.70" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f0209b68b3613b093e0ec905354eccaedcfe83b8cb37cbdeae64026c3064c16" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "thiserror" -version = "1.0.63" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.63" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "thread_local" -version = "1.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" -dependencies = [ - "cfg-if", - "once_cell", -] - -[[package]] -name = "time" -version = "0.3.36" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" -dependencies = [ - "deranged", - "itoa", - "num-conv", - "powerfmt", - "serde", - "time-core", - "time-macros", -] - -[[package]] -name = "time-core" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" - -[[package]] -name = "time-macros" -version = "0.2.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" -dependencies = [ - "num-conv", - "time-core", -] - -[[package]] -name = "tracing" -version = "0.1.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" -dependencies = [ - "pin-project-lite", - "tracing-attributes", - "tracing-core", -] - -[[package]] -name = "tracing-attributes" -version = "0.1.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "tracing-core" -version = "0.1.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" -dependencies = [ - "once_cell", -] - -[[package]] -name = "tracing-subscriber" -version = "0.3.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" -dependencies = [ - "sharded-slab", - "thread_local", - "tracing-core", -] - -[[package]] -name = "unicode-ident" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" - -[[package]] -name = "unicode-segmentation" -version = "1.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" - -[[package]] -name = "vfs" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "654cd097e182a71dbf899178e6b5662c2157dd0b8afd5975de18008f6fc173d1" -dependencies = [ - "filetime", -] - -[[package]] -name = "walkdir" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" -dependencies = [ - "same-file", - "winapi-util", -] - -[[package]] -name = "wasm-bindgen" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" -dependencies = [ - "cfg-if", - "wasm-bindgen-macro", -] - -[[package]] -name = "wasm-bindgen-backend" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" -dependencies = [ - "bumpalo", - "log", - "once_cell", - "proc-macro2", - "quote", - "syn", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-macro" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" -dependencies = [ - "quote", - "wasm-bindgen-macro-support", -] - -[[package]] -name = "wasm-bindgen-macro-support" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" -dependencies = [ - "proc-macro2", - "quote", - "syn", - "wasm-bindgen-backend", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-shared" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" - -[[package]] -name = "winapi-util" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b" -dependencies = [ - "windows-sys 0.52.0", -] - -[[package]] -name = "windows-core" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" -dependencies = [ - "windows-targets 0.52.6", -] - -[[package]] -name = "windows-sys" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" -dependencies = [ - "windows-targets 0.48.5", -] - -[[package]] -name = "windows-sys" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" -dependencies = [ - "windows-targets 0.52.6", -] - -[[package]] -name = "windows-targets" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" -dependencies = [ - "windows_aarch64_gnullvm 0.48.5", - "windows_aarch64_msvc 0.48.5", - "windows_i686_gnu 0.48.5", - "windows_i686_msvc 0.48.5", - "windows_x86_64_gnu 0.48.5", - "windows_x86_64_gnullvm 0.48.5", - "windows_x86_64_msvc 0.48.5", -] - -[[package]] -name = "windows-targets" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" -dependencies = [ - "windows_aarch64_gnullvm 0.52.6", - "windows_aarch64_msvc 0.52.6", - "windows_i686_gnu 0.52.6", - "windows_i686_gnullvm", - "windows_i686_msvc 0.52.6", - "windows_x86_64_gnu 0.52.6", - "windows_x86_64_gnullvm 0.52.6", - "windows_x86_64_msvc 0.52.6", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" - -[[package]] -name = "windows_i686_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" - -[[package]] -name = "windows_i686_gnu" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" - -[[package]] -name = "windows_i686_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" - -[[package]] -name = "windows_i686_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" - -[[package]] -name = "windows_i686_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" From 2bf864073205592174577c2dc0d5a1fe24429ab7 Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Thu, 22 Aug 2024 03:04:34 +0300 Subject: [PATCH 53/82] --- .github/dependabot.yml | 38 +++++++++++ .github/workflows/Dependabot.yml | 45 +++++++++++++ .github/workflows/GitHub.yml | 58 ++++++++++++++++ .github/workflows/NPM.yml | 74 +++++++++++++++++++++ .github/workflows/Node.yml | 101 ++++++++++++++++++++++++++++ .github/workflows/Rust.yml | 109 +++++++++++++++++++++++++++++++ 6 files changed, 425 insertions(+) create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/Dependabot.yml create mode 100644 .github/workflows/GitHub.yml create mode 100644 .github/workflows/NPM.yml create mode 100644 .github/workflows/Node.yml create mode 100644 .github/workflows/Rust.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..f02ca757 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,38 @@ +version: 2 +enable-beta-ecosystems: true + +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "daily" + + - package-ecosystem: "cargo" + directory: "/" + schedule: + interval: "daily" + versioning-strategy: lockfile-only + + - package-ecosystem: "cargo" + directory: "/fuzz" + schedule: + interval: "daily" + versioning-strategy: lockfile-only + + - package-ecosystem: "cargo" + directory: "/napi" + schedule: + interval: "daily" + versioning-strategy: lockfile-only + + - package-ecosystem: "npm" + directory: "/npm" + schedule: + interval: "daily" + versioning-strategy: increase + + - package-ecosystem: "npm" + directory: "/" + schedule: + interval: "daily" + versioning-strategy: increase diff --git a/.github/workflows/Dependabot.yml b/.github/workflows/Dependabot.yml new file mode 100644 index 00000000..387fece7 --- /dev/null +++ b/.github/workflows/Dependabot.yml @@ -0,0 +1,45 @@ +name: Dependabot + +concurrency: + group: Dependabot-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +permissions: + security-events: write + contents: write + pull-requests: write + +on: + workflow_dispatch: + pull_request: + +jobs: + Approve: + runs-on: ubuntu-latest + + if: ${{ github.actor == 'dependabot[bot]' }} + + steps: + - uses: dependabot/fetch-metadata@v2.2.0 + with: + github-token: "${{ secrets.GITHUB_TOKEN }}" + + - run: gh pr review --approve "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} + + Merge: + runs-on: ubuntu-latest + + if: ${{ github.actor == 'dependabot[bot]' }} + + steps: + - uses: dependabot/fetch-metadata@v2.2.0 + with: + github-token: "${{ secrets.GITHUB_TOKEN }}" + + - run: gh pr merge --auto --merge "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} diff --git a/.github/workflows/GitHub.yml b/.github/workflows/GitHub.yml new file mode 100644 index 00000000..7b1e399c --- /dev/null +++ b/.github/workflows/GitHub.yml @@ -0,0 +1,58 @@ +name: GitHub + +concurrency: + group: GitHub-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +permissions: + issues: write + pull-requests: write + +on: + issues: + types: [opened] + pull_request: + types: [opened] + +jobs: + Assign: + runs-on: ubuntu-latest + + env: + ADBLOCK: true + ASTRO_TELEMETRY_DISABLED: 1 + AUTOMATEDLAB_TELEMETRY_OPTOUT: 1 + AZURE_CORE_COLLECT_TELEMETRY: 0 + CHOOSENIM_NO_ANALYTICS: 1 + DIEZ_DO_NOT_TRACK: 1 + DOTNET_CLI_TELEMETRY_OPTOUT: 1 + DOTNET_INTERACTIVE_CLI_TELEMETRY_OPTOUT: 1 + DO_NOT_TRACK: 1 + ET_NO_TELEMETRY: 1 + GATSBY_TELEMETRY_DISABLED: 1 + GATSBY_TELEMETRY_OPTOUT: 1 + GATSBY_TELEMETRY_OPT_OUT: 1 + GRIT_TELEMETRY_DISABLED: 1 + HASURA_GRAPHQL_ENABLE_TELEMETRY: false + HINT_TELEMETRY: off + HOMEBREW_NO_ANALYTICS: 1 + INFLUXD_REPORTING_DISABLED: true + ITERATIVE_DO_NOT_TRACK: 1 + NEXT_TELEMETRY_DEBUG: 1 + NEXT_TELEMETRY_DISABLED: 1 + NG_CLI_ANALYTICS: false + NUXT_TELEMETRY_DISABLED: 1 + PIN_DO_NOT_TRACK: 1 + POWERSHELL_TELEMETRY_OPTOUT: 1 + SAM_CLI_TELEMETRY: 0 + STNOUPGRADE: 1 + STRIPE_CLI_TELEMETRY_OPTOUT: 1 + TELEMETRY_DISABLED: 1 + TERRAFORM_TELEMETRY: 0 + + steps: + - uses: pozil/auto-assign-issue@v2.0.0 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + assignees: NikolaRHristov + numOfAssignee: 1 diff --git a/.github/workflows/NPM.yml b/.github/workflows/NPM.yml new file mode 100644 index 00000000..a3c48117 --- /dev/null +++ b/.github/workflows/NPM.yml @@ -0,0 +1,74 @@ +name: NPM + +concurrency: + group: NPM-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +permissions: + security-events: write + contents: write + pull-requests: write + +on: + workflow_dispatch: + release: + types: [created] + workflow_call: + +jobs: + Publish: + runs-on: ubuntu-latest + + env: + ADBLOCK: true + ASTRO_TELEMETRY_DISABLED: 1 + AUTOMATEDLAB_TELEMETRY_OPTOUT: 1 + AZURE_CORE_COLLECT_TELEMETRY: 0 + CHOOSENIM_NO_ANALYTICS: 1 + DIEZ_DO_NOT_TRACK: 1 + DOTNET_CLI_TELEMETRY_OPTOUT: 1 + DOTNET_INTERACTIVE_CLI_TELEMETRY_OPTOUT: 1 + DO_NOT_TRACK: 1 + ET_NO_TELEMETRY: 1 + GATSBY_TELEMETRY_DISABLED: 1 + GATSBY_TELEMETRY_OPTOUT: 1 + GATSBY_TELEMETRY_OPT_OUT: 1 + GRIT_TELEMETRY_DISABLED: 1 + HASURA_GRAPHQL_ENABLE_TELEMETRY: false + HINT_TELEMETRY: off + HOMEBREW_NO_ANALYTICS: 1 + INFLUXD_REPORTING_DISABLED: true + ITERATIVE_DO_NOT_TRACK: 1 + NEXT_TELEMETRY_DEBUG: 1 + NEXT_TELEMETRY_DISABLED: 1 + NG_CLI_ANALYTICS: false + NUXT_TELEMETRY_DISABLED: 1 + PIN_DO_NOT_TRACK: 1 + POWERSHELL_TELEMETRY_OPTOUT: 1 + SAM_CLI_TELEMETRY: 0 + STNOUPGRADE: 1 + STRIPE_CLI_TELEMETRY_OPTOUT: 1 + TELEMETRY_DISABLED: 1 + TERRAFORM_TELEMETRY: 0 + + permissions: + contents: read + id-token: write + + steps: + - uses: actions/checkout@v4.1.7 + + - uses: actions/setup-node@v4.0.3 + with: + node-version: "18" + registry-url: "https://registry.npmjs.org" + + - run: npm install -g npm + + - name: Publish . + continue-on-error: true + working-directory: . + run: | + npm publish --legacy-peer-deps --provenance --ignore-scripts + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/Node.yml b/.github/workflows/Node.yml new file mode 100644 index 00000000..7cd17cd2 --- /dev/null +++ b/.github/workflows/Node.yml @@ -0,0 +1,101 @@ +name: Node + +concurrency: + group: Node-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +permissions: + security-events: write + contents: write + pull-requests: write + +on: + workflow_dispatch: + push: + branches: [Current] + pull_request: + branches: [Current] + workflow_call: + +jobs: + Pre-Publish: + runs-on: ubuntu-latest + + env: + ADBLOCK: true + ASTRO_TELEMETRY_DISABLED: 1 + AUTOMATEDLAB_TELEMETRY_OPTOUT: 1 + AZURE_CORE_COLLECT_TELEMETRY: 0 + CHOOSENIM_NO_ANALYTICS: 1 + DIEZ_DO_NOT_TRACK: 1 + DOTNET_CLI_TELEMETRY_OPTOUT: 1 + DOTNET_INTERACTIVE_CLI_TELEMETRY_OPTOUT: 1 + DO_NOT_TRACK: 1 + ET_NO_TELEMETRY: 1 + GATSBY_TELEMETRY_DISABLED: 1 + GATSBY_TELEMETRY_OPTOUT: 1 + GATSBY_TELEMETRY_OPT_OUT: 1 + GRIT_TELEMETRY_DISABLED: 1 + HASURA_GRAPHQL_ENABLE_TELEMETRY: false + HINT_TELEMETRY: off + HOMEBREW_NO_ANALYTICS: 1 + INFLUXD_REPORTING_DISABLED: true + ITERATIVE_DO_NOT_TRACK: 1 + NEXT_TELEMETRY_DEBUG: 1 + NEXT_TELEMETRY_DISABLED: 1 + NG_CLI_ANALYTICS: false + NUXT_TELEMETRY_DISABLED: 1 + PIN_DO_NOT_TRACK: 1 + POWERSHELL_TELEMETRY_OPTOUT: 1 + SAM_CLI_TELEMETRY: 0 + STNOUPGRADE: 1 + STRIPE_CLI_TELEMETRY_OPTOUT: 1 + TELEMETRY_DISABLED: 1 + TERRAFORM_TELEMETRY: 0 + + strategy: + matrix: + node-version: [18, 19, 20] + + steps: + - uses: actions/checkout@v4.1.7 + + - uses: pnpm/action-setup@v4.0.0 + with: + version: 9.3.0 + run_install: | + - recursive: true + args: [ + --link-workspace-packages=true, + --lockfile-only, + --prefer-frozen-lockfile=false, + --shamefully-hoist=false, + --shared-workspace-lockfile=true, + --strict-peer-dependencies=false, + --unsafe-perm=true + ] + + - uses: actions/setup-node@v4.0.3 + with: + node-version: ${{ matrix.node-version }} + cache: "pnpm" + cache-dependency-path: ./pnpm-lock.yaml + + - run: pnpm install + working-directory: . + + - run: pnpm run build + working-directory: . + + - uses: actions/upload-artifact@v4.3.6 + with: + name: .-Node-${{ matrix.node-version }}-Target + path: ./Target + + - run: pnpm run prepublishOnly + working-directory: . + + - uses: actions/upload-artifact@v4.3.6 + with: + name: .-Node-${{ matrix.node-version }}-Target + path: ./Target diff --git a/.github/workflows/Rust.yml b/.github/workflows/Rust.yml new file mode 100644 index 00000000..a12666e2 --- /dev/null +++ b/.github/workflows/Rust.yml @@ -0,0 +1,109 @@ +name: Rust + +concurrency: + group: Rust-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +permissions: + security-events: write + +on: + workflow_dispatch: + push: + branches: [Current] + pull_request: + branches: [Current] + workflow_call: + +jobs: + Build: + runs-on: ubuntu-latest + + env: + ADBLOCK: true + ASTRO_TELEMETRY_DISABLED: 1 + AUTOMATEDLAB_TELEMETRY_OPTOUT: 1 + AZURE_CORE_COLLECT_TELEMETRY: 0 + CHOOSENIM_NO_ANALYTICS: 1 + DIEZ_DO_NOT_TRACK: 1 + DOTNET_CLI_TELEMETRY_OPTOUT: 1 + DOTNET_INTERACTIVE_CLI_TELEMETRY_OPTOUT: 1 + DO_NOT_TRACK: 1 + ET_NO_TELEMETRY: 1 + GATSBY_TELEMETRY_DISABLED: 1 + GATSBY_TELEMETRY_OPTOUT: 1 + GATSBY_TELEMETRY_OPT_OUT: 1 + GRIT_TELEMETRY_DISABLED: 1 + HASURA_GRAPHQL_ENABLE_TELEMETRY: false + HINT_TELEMETRY: off + HOMEBREW_NO_ANALYTICS: 1 + INFLUXD_REPORTING_DISABLED: true + ITERATIVE_DO_NOT_TRACK: 1 + NEXT_TELEMETRY_DEBUG: 1 + NEXT_TELEMETRY_DISABLED: 1 + NG_CLI_ANALYTICS: false + NUXT_TELEMETRY_DISABLED: 1 + PIN_DO_NOT_TRACK: 1 + POWERSHELL_TELEMETRY_OPTOUT: 1 + SAM_CLI_TELEMETRY: 0 + STNOUPGRADE: 1 + STRIPE_CLI_TELEMETRY_OPTOUT: 1 + TELEMETRY_DISABLED: 1 + TERRAFORM_TELEMETRY: 0 + + strategy: + matrix: + toolchain: ["stable", "nightly"] + + steps: + - uses: actions/checkout@v4.1.7 + + - uses: actions-rs/toolchain@v1.0.7 + with: + profile: minimal + toolchain: ${{ matrix.toolchain }} + + - uses: actions/cache@v4.0.2 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + Target/ + key: ${{ runner.os }}-cargo-${{ hashFiles('./Cargo.toml') }} + - uses: actions-rs/cargo@v1.0.3 + with: + command: build + args: --release --all-features --manifest-path ./Cargo.toml + + - uses: actions/cache@v4.0.2 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + Target/ + key: ${{ runner.os }}-cargo-${{ hashFiles('./fuzz/Cargo.toml') }} + - uses: actions-rs/cargo@v1.0.3 + with: + command: build + args: --release --all-features --manifest-path ./fuzz/Cargo.toml + + - uses: actions/cache@v4.0.2 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + Target/ + key: ${{ runner.os }}-cargo-${{ hashFiles('./napi/Cargo.toml') }} + - uses: actions-rs/cargo@v1.0.3 + with: + command: build + args: --release --all-features --manifest-path ./napi/Cargo.toml From 756e07775f0a0e63c8406753c44e89e24a185aa6 Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Thu, 22 Aug 2024 07:40:27 +0300 Subject: [PATCH 54/82] --- Documentation/.nojekyll | 1 + Documentation/assets/custom.css | 54 ++ Documentation/assets/highlight.css | 85 ++ Documentation/assets/icons.js | 18 + Documentation/assets/icons.svg | 1 + Documentation/assets/main.js | 60 ++ Documentation/assets/navigation.js | 1 + Documentation/assets/search.js | 1 + Documentation/assets/style.css | 1448 ++++++++++++++++++++++++++++ Documentation/index.html | 313 ++++++ Documentation/media/LICENSE | 21 + Documentation/modules.html | 1 + 12 files changed, 2004 insertions(+) create mode 100644 Documentation/.nojekyll create mode 100644 Documentation/assets/custom.css create mode 100644 Documentation/assets/highlight.css create mode 100644 Documentation/assets/icons.js create mode 100644 Documentation/assets/icons.svg create mode 100644 Documentation/assets/main.js create mode 100644 Documentation/assets/navigation.js create mode 100644 Documentation/assets/search.js create mode 100644 Documentation/assets/style.css create mode 100644 Documentation/index.html create mode 100644 Documentation/media/LICENSE create mode 100644 Documentation/modules.html diff --git a/Documentation/.nojekyll b/Documentation/.nojekyll new file mode 100644 index 00000000..e2ac6616 --- /dev/null +++ b/Documentation/.nojekyll @@ -0,0 +1 @@ +TypeDoc added this file to prevent GitHub Pages from using Jekyll. You can turn off this behavior by setting the `githubPages` option to false. \ No newline at end of file diff --git a/Documentation/assets/custom.css b/Documentation/assets/custom.css new file mode 100644 index 00000000..e360ec98 --- /dev/null +++ b/Documentation/assets/custom.css @@ -0,0 +1,54 @@ +:root { + --dark-color-background: #000; + --dark-color-background-secondary: #000; + --dark-code-background: #040404; + --color-accent: #2463eb; + --light-hl-0: #b58900; + --light-hl-1: #d33682; + --light-hl-2: #dc322f; + --light-hl-3: #2aa198; + --light-hl-4: #859900; + --dark-hl-0: #ffdd00; + --dark-hl-1: #ff66ff; + --dark-hl-2: #ff4444; + --dark-hl-3: #44ffff; + --dark-hl-4: #44ff44; +} + +body #tsd-search .field label { + left: 50%; + margin-left: -20px; + z-index: 1; + text-align: center; +} + +body #tsd-search.has-focus .field label { + display: none; +} + +body #tsd-search .field input { + z-index: 2; +} + +body pre, +body .tsd-page-toolbar, +body .tsd-generator { + border: none; +} + +body .tsd-navigation a, +body .tsd-navigation summary > span, +body .tsd-page-navigation a { + padding: 0.5rem; + border-radius: 8px; +} + +body .tsd-description .tsd-signatures .tsd-signature, +body .tsd-signature, +body .tsd-signatures .tsd-signature, +body .tsd-typography td, +body .tsd-typography th, +body code.tsd-tag { + border-radius: 12px; + border-width: 2px; +} diff --git a/Documentation/assets/highlight.css b/Documentation/assets/highlight.css new file mode 100644 index 00000000..e2c460e2 --- /dev/null +++ b/Documentation/assets/highlight.css @@ -0,0 +1,85 @@ +:root { + --light-hl-0: #000000; + --dark-hl-0: #D4D4D4; + --light-hl-1: #A31515; + --dark-hl-1: #CE9178; + --light-hl-2: #0000FF; + --dark-hl-2: #569CD6; + --light-hl-3: #0070C1; + --dark-hl-3: #4FC1FF; + --light-hl-4: #795E26; + --dark-hl-4: #DCDCAA; + --light-hl-5: #001080; + --dark-hl-5: #9CDCFE; + --light-hl-6: #098658; + --dark-hl-6: #B5CEA8; + --light-hl-7: #000000; + --dark-hl-7: #C8C8C8; + --light-hl-8: #AF00DB; + --dark-hl-8: #C586C0; + --light-code-background: #FFFFFF; + --dark-code-background: #1E1E1E; +} + +@media (prefers-color-scheme: light) { :root { + --hl-0: var(--light-hl-0); + --hl-1: var(--light-hl-1); + --hl-2: var(--light-hl-2); + --hl-3: var(--light-hl-3); + --hl-4: var(--light-hl-4); + --hl-5: var(--light-hl-5); + --hl-6: var(--light-hl-6); + --hl-7: var(--light-hl-7); + --hl-8: var(--light-hl-8); + --code-background: var(--light-code-background); +} } + +@media (prefers-color-scheme: dark) { :root { + --hl-0: var(--dark-hl-0); + --hl-1: var(--dark-hl-1); + --hl-2: var(--dark-hl-2); + --hl-3: var(--dark-hl-3); + --hl-4: var(--dark-hl-4); + --hl-5: var(--dark-hl-5); + --hl-6: var(--dark-hl-6); + --hl-7: var(--dark-hl-7); + --hl-8: var(--dark-hl-8); + --code-background: var(--dark-code-background); +} } + +:root[data-theme='light'] { + --hl-0: var(--light-hl-0); + --hl-1: var(--light-hl-1); + --hl-2: var(--light-hl-2); + --hl-3: var(--light-hl-3); + --hl-4: var(--light-hl-4); + --hl-5: var(--light-hl-5); + --hl-6: var(--light-hl-6); + --hl-7: var(--light-hl-7); + --hl-8: var(--light-hl-8); + --code-background: var(--light-code-background); +} + +:root[data-theme='dark'] { + --hl-0: var(--dark-hl-0); + --hl-1: var(--dark-hl-1); + --hl-2: var(--dark-hl-2); + --hl-3: var(--dark-hl-3); + --hl-4: var(--dark-hl-4); + --hl-5: var(--dark-hl-5); + --hl-6: var(--dark-hl-6); + --hl-7: var(--dark-hl-7); + --hl-8: var(--dark-hl-8); + --code-background: var(--dark-code-background); +} + +.hl-0 { color: var(--hl-0); } +.hl-1 { color: var(--hl-1); } +.hl-2 { color: var(--hl-2); } +.hl-3 { color: var(--hl-3); } +.hl-4 { color: var(--hl-4); } +.hl-5 { color: var(--hl-5); } +.hl-6 { color: var(--hl-6); } +.hl-7 { color: var(--hl-7); } +.hl-8 { color: var(--hl-8); } +pre, code { background: var(--code-background); } diff --git a/Documentation/assets/icons.js b/Documentation/assets/icons.js new file mode 100644 index 00000000..e88e8ca7 --- /dev/null +++ b/Documentation/assets/icons.js @@ -0,0 +1,18 @@ +(function() { + addIcons(); + function addIcons() { + if (document.readyState === "loading") return document.addEventListener("DOMContentLoaded", addIcons); + const svg = document.body.appendChild(document.createElementNS("http://www.w3.org/2000/svg", "svg")); + svg.innerHTML = `""`; + svg.style.display = "none"; + if (location.protocol === "file:") updateUseElements(); + } + + function updateUseElements() { + document.querySelectorAll("use").forEach(el => { + if (el.getAttribute("href").includes("#icon-")) { + el.setAttribute("href", el.getAttribute("href").replace(/.*#/, "#")); + } + }); + } +})() \ No newline at end of file diff --git a/Documentation/assets/icons.svg b/Documentation/assets/icons.svg new file mode 100644 index 00000000..e371b8b5 --- /dev/null +++ b/Documentation/assets/icons.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/Documentation/assets/main.js b/Documentation/assets/main.js new file mode 100644 index 00000000..21a5d74d --- /dev/null +++ b/Documentation/assets/main.js @@ -0,0 +1,60 @@ +"use strict"; +window.translations={"copy":"Copy","copied":"Copied!","normally_hidden":"This member is normally hidden due to your filter settings."}; +"use strict";(()=>{var Pe=Object.create;var ie=Object.defineProperty;var Oe=Object.getOwnPropertyDescriptor;var _e=Object.getOwnPropertyNames;var Re=Object.getPrototypeOf,Me=Object.prototype.hasOwnProperty;var Fe=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var De=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of _e(e))!Me.call(t,i)&&i!==n&&ie(t,i,{get:()=>e[i],enumerable:!(r=Oe(e,i))||r.enumerable});return t};var Ae=(t,e,n)=>(n=t!=null?Pe(Re(t)):{},De(e||!t||!t.__esModule?ie(n,"default",{value:t,enumerable:!0}):n,t));var ue=Fe((ae,le)=>{(function(){var t=function(e){var n=new t.Builder;return n.pipeline.add(t.trimmer,t.stopWordFilter,t.stemmer),n.searchPipeline.add(t.stemmer),e.call(n,n),n.build()};t.version="2.3.9";t.utils={},t.utils.warn=function(e){return function(n){e.console&&console.warn&&console.warn(n)}}(this),t.utils.asString=function(e){return e==null?"":e.toString()},t.utils.clone=function(e){if(e==null)return e;for(var n=Object.create(null),r=Object.keys(e),i=0;i0){var d=t.utils.clone(n)||{};d.position=[a,u],d.index=s.length,s.push(new t.Token(r.slice(a,o),d))}a=o+1}}return s},t.tokenizer.separator=/[\s\-]+/;t.Pipeline=function(){this._stack=[]},t.Pipeline.registeredFunctions=Object.create(null),t.Pipeline.registerFunction=function(e,n){n in this.registeredFunctions&&t.utils.warn("Overwriting existing registered function: "+n),e.label=n,t.Pipeline.registeredFunctions[e.label]=e},t.Pipeline.warnIfFunctionNotRegistered=function(e){var n=e.label&&e.label in this.registeredFunctions;n||t.utils.warn(`Function is not registered with pipeline. This may cause problems when serialising the index. +`,e)},t.Pipeline.load=function(e){var n=new t.Pipeline;return e.forEach(function(r){var i=t.Pipeline.registeredFunctions[r];if(i)n.add(i);else throw new Error("Cannot load unregistered function: "+r)}),n},t.Pipeline.prototype.add=function(){var e=Array.prototype.slice.call(arguments);e.forEach(function(n){t.Pipeline.warnIfFunctionNotRegistered(n),this._stack.push(n)},this)},t.Pipeline.prototype.after=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var r=this._stack.indexOf(e);if(r==-1)throw new Error("Cannot find existingFn");r=r+1,this._stack.splice(r,0,n)},t.Pipeline.prototype.before=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var r=this._stack.indexOf(e);if(r==-1)throw new Error("Cannot find existingFn");this._stack.splice(r,0,n)},t.Pipeline.prototype.remove=function(e){var n=this._stack.indexOf(e);n!=-1&&this._stack.splice(n,1)},t.Pipeline.prototype.run=function(e){for(var n=this._stack.length,r=0;r1&&(oe&&(r=s),o!=e);)i=r-n,s=n+Math.floor(i/2),o=this.elements[s*2];if(o==e||o>e)return s*2;if(ol?d+=2:a==l&&(n+=r[u+1]*i[d+1],u+=2,d+=2);return n},t.Vector.prototype.similarity=function(e){return this.dot(e)/this.magnitude()||0},t.Vector.prototype.toArray=function(){for(var e=new Array(this.elements.length/2),n=1,r=0;n0){var o=s.str.charAt(0),a;o in s.node.edges?a=s.node.edges[o]:(a=new t.TokenSet,s.node.edges[o]=a),s.str.length==1&&(a.final=!0),i.push({node:a,editsRemaining:s.editsRemaining,str:s.str.slice(1)})}if(s.editsRemaining!=0){if("*"in s.node.edges)var l=s.node.edges["*"];else{var l=new t.TokenSet;s.node.edges["*"]=l}if(s.str.length==0&&(l.final=!0),i.push({node:l,editsRemaining:s.editsRemaining-1,str:s.str}),s.str.length>1&&i.push({node:s.node,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)}),s.str.length==1&&(s.node.final=!0),s.str.length>=1){if("*"in s.node.edges)var u=s.node.edges["*"];else{var u=new t.TokenSet;s.node.edges["*"]=u}s.str.length==1&&(u.final=!0),i.push({node:u,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)})}if(s.str.length>1){var d=s.str.charAt(0),m=s.str.charAt(1),p;m in s.node.edges?p=s.node.edges[m]:(p=new t.TokenSet,s.node.edges[m]=p),s.str.length==1&&(p.final=!0),i.push({node:p,editsRemaining:s.editsRemaining-1,str:d+s.str.slice(2)})}}}return r},t.TokenSet.fromString=function(e){for(var n=new t.TokenSet,r=n,i=0,s=e.length;i=e;n--){var r=this.uncheckedNodes[n],i=r.child.toString();i in this.minimizedNodes?r.parent.edges[r.char]=this.minimizedNodes[i]:(r.child._str=i,this.minimizedNodes[i]=r.child),this.uncheckedNodes.pop()}};t.Index=function(e){this.invertedIndex=e.invertedIndex,this.fieldVectors=e.fieldVectors,this.tokenSet=e.tokenSet,this.fields=e.fields,this.pipeline=e.pipeline},t.Index.prototype.search=function(e){return this.query(function(n){var r=new t.QueryParser(e,n);r.parse()})},t.Index.prototype.query=function(e){for(var n=new t.Query(this.fields),r=Object.create(null),i=Object.create(null),s=Object.create(null),o=Object.create(null),a=Object.create(null),l=0;l1?this._b=1:this._b=e},t.Builder.prototype.k1=function(e){this._k1=e},t.Builder.prototype.add=function(e,n){var r=e[this._ref],i=Object.keys(this._fields);this._documents[r]=n||{},this.documentCount+=1;for(var s=0;s=this.length)return t.QueryLexer.EOS;var e=this.str.charAt(this.pos);return this.pos+=1,e},t.QueryLexer.prototype.width=function(){return this.pos-this.start},t.QueryLexer.prototype.ignore=function(){this.start==this.pos&&(this.pos+=1),this.start=this.pos},t.QueryLexer.prototype.backup=function(){this.pos-=1},t.QueryLexer.prototype.acceptDigitRun=function(){var e,n;do e=this.next(),n=e.charCodeAt(0);while(n>47&&n<58);e!=t.QueryLexer.EOS&&this.backup()},t.QueryLexer.prototype.more=function(){return this.pos1&&(e.backup(),e.emit(t.QueryLexer.TERM)),e.ignore(),e.more())return t.QueryLexer.lexText},t.QueryLexer.lexEditDistance=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(t.QueryLexer.EDIT_DISTANCE),t.QueryLexer.lexText},t.QueryLexer.lexBoost=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(t.QueryLexer.BOOST),t.QueryLexer.lexText},t.QueryLexer.lexEOS=function(e){e.width()>0&&e.emit(t.QueryLexer.TERM)},t.QueryLexer.termSeparator=t.tokenizer.separator,t.QueryLexer.lexText=function(e){for(;;){var n=e.next();if(n==t.QueryLexer.EOS)return t.QueryLexer.lexEOS;if(n.charCodeAt(0)==92){e.escapeCharacter();continue}if(n==":")return t.QueryLexer.lexField;if(n=="~")return e.backup(),e.width()>0&&e.emit(t.QueryLexer.TERM),t.QueryLexer.lexEditDistance;if(n=="^")return e.backup(),e.width()>0&&e.emit(t.QueryLexer.TERM),t.QueryLexer.lexBoost;if(n=="+"&&e.width()===1||n=="-"&&e.width()===1)return e.emit(t.QueryLexer.PRESENCE),t.QueryLexer.lexText;if(n.match(t.QueryLexer.termSeparator))return t.QueryLexer.lexTerm}},t.QueryParser=function(e,n){this.lexer=new t.QueryLexer(e),this.query=n,this.currentClause={},this.lexemeIdx=0},t.QueryParser.prototype.parse=function(){this.lexer.run(),this.lexemes=this.lexer.lexemes;for(var e=t.QueryParser.parseClause;e;)e=e(this);return this.query},t.QueryParser.prototype.peekLexeme=function(){return this.lexemes[this.lexemeIdx]},t.QueryParser.prototype.consumeLexeme=function(){var e=this.peekLexeme();return this.lexemeIdx+=1,e},t.QueryParser.prototype.nextClause=function(){var e=this.currentClause;this.query.clause(e),this.currentClause={}},t.QueryParser.parseClause=function(e){var n=e.peekLexeme();if(n!=null)switch(n.type){case t.QueryLexer.PRESENCE:return t.QueryParser.parsePresence;case t.QueryLexer.FIELD:return t.QueryParser.parseField;case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var r="expected either a field or a term, found "+n.type;throw n.str.length>=1&&(r+=" with value '"+n.str+"'"),new t.QueryParseError(r,n.start,n.end)}},t.QueryParser.parsePresence=function(e){var n=e.consumeLexeme();if(n!=null){switch(n.str){case"-":e.currentClause.presence=t.Query.presence.PROHIBITED;break;case"+":e.currentClause.presence=t.Query.presence.REQUIRED;break;default:var r="unrecognised presence operator'"+n.str+"'";throw new t.QueryParseError(r,n.start,n.end)}var i=e.peekLexeme();if(i==null){var r="expecting term or field, found nothing";throw new t.QueryParseError(r,n.start,n.end)}switch(i.type){case t.QueryLexer.FIELD:return t.QueryParser.parseField;case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var r="expecting term or field, found '"+i.type+"'";throw new t.QueryParseError(r,i.start,i.end)}}},t.QueryParser.parseField=function(e){var n=e.consumeLexeme();if(n!=null){if(e.query.allFields.indexOf(n.str)==-1){var r=e.query.allFields.map(function(o){return"'"+o+"'"}).join(", "),i="unrecognised field '"+n.str+"', possible fields: "+r;throw new t.QueryParseError(i,n.start,n.end)}e.currentClause.fields=[n.str];var s=e.peekLexeme();if(s==null){var i="expecting term, found nothing";throw new t.QueryParseError(i,n.start,n.end)}switch(s.type){case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var i="expecting term, found '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},t.QueryParser.parseTerm=function(e){var n=e.consumeLexeme();if(n!=null){e.currentClause.term=n.str.toLowerCase(),n.str.indexOf("*")!=-1&&(e.currentClause.usePipeline=!1);var r=e.peekLexeme();if(r==null){e.nextClause();return}switch(r.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+r.type+"'";throw new t.QueryParseError(i,r.start,r.end)}}},t.QueryParser.parseEditDistance=function(e){var n=e.consumeLexeme();if(n!=null){var r=parseInt(n.str,10);if(isNaN(r)){var i="edit distance must be numeric";throw new t.QueryParseError(i,n.start,n.end)}e.currentClause.editDistance=r;var s=e.peekLexeme();if(s==null){e.nextClause();return}switch(s.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},t.QueryParser.parseBoost=function(e){var n=e.consumeLexeme();if(n!=null){var r=parseInt(n.str,10);if(isNaN(r)){var i="boost must be numeric";throw new t.QueryParseError(i,n.start,n.end)}e.currentClause.boost=r;var s=e.peekLexeme();if(s==null){e.nextClause();return}switch(s.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},function(e,n){typeof define=="function"&&define.amd?define(n):typeof ae=="object"?le.exports=n():e.lunr=n()}(this,function(){return t})})()});var se=[];function G(t,e){se.push({selector:e,constructor:t})}var U=class{constructor(){this.alwaysVisibleMember=null;this.createComponents(document.body),this.ensureFocusedElementVisible(),this.listenForCodeCopies(),window.addEventListener("hashchange",()=>this.ensureFocusedElementVisible()),document.body.style.display||(this.ensureFocusedElementVisible(),this.updateIndexVisibility(),this.scrollToHash())}createComponents(e){se.forEach(n=>{e.querySelectorAll(n.selector).forEach(r=>{r.dataset.hasInstance||(new n.constructor({el:r,app:this}),r.dataset.hasInstance=String(!0))})})}filterChanged(){this.ensureFocusedElementVisible()}showPage(){document.body.style.display&&(document.body.style.removeProperty("display"),this.ensureFocusedElementVisible(),this.updateIndexVisibility(),this.scrollToHash())}scrollToHash(){if(location.hash){let e=document.getElementById(location.hash.substring(1));if(!e)return;e.scrollIntoView({behavior:"instant",block:"start"})}}ensureActivePageVisible(){let e=document.querySelector(".tsd-navigation .current"),n=e?.parentElement;for(;n&&!n.classList.contains(".tsd-navigation");)n instanceof HTMLDetailsElement&&(n.open=!0),n=n.parentElement;if(e&&!Ve(e)){let r=e.getBoundingClientRect().top-document.documentElement.clientHeight/4;document.querySelector(".site-menu").scrollTop=r,document.querySelector(".col-sidebar").scrollTop=r}}updateIndexVisibility(){let e=document.querySelector(".tsd-index-content"),n=e?.open;e&&(e.open=!0),document.querySelectorAll(".tsd-index-section").forEach(r=>{r.style.display="block";let i=Array.from(r.querySelectorAll(".tsd-index-link")).every(s=>s.offsetParent==null);r.style.display=i?"none":"block"}),e&&(e.open=n)}ensureFocusedElementVisible(){if(this.alwaysVisibleMember&&(this.alwaysVisibleMember.classList.remove("always-visible"),this.alwaysVisibleMember.firstElementChild.remove(),this.alwaysVisibleMember=null),!location.hash)return;let e=document.getElementById(location.hash.substring(1));if(!e)return;let n=e.parentElement;for(;n&&n.tagName!=="SECTION";)n=n.parentElement;if(!n)return;let r=n.offsetParent==null,i=n;for(;i!==document.body;)i instanceof HTMLDetailsElement&&(i.open=!0),i=i.parentElement;if(n.offsetParent==null){this.alwaysVisibleMember=n,n.classList.add("always-visible");let s=document.createElement("p");s.classList.add("warning"),s.textContent=window.translations.normally_hidden,n.prepend(s)}r&&e.scrollIntoView()}listenForCodeCopies(){document.querySelectorAll("pre > button").forEach(e=>{let n;e.addEventListener("click",()=>{e.previousElementSibling instanceof HTMLElement&&navigator.clipboard.writeText(e.previousElementSibling.innerText.trim()),e.textContent=window.translations.copied,e.classList.add("visible"),clearTimeout(n),n=setTimeout(()=>{e.classList.remove("visible"),n=setTimeout(()=>{e.textContent=window.translations.copy},100)},1e3)})})}};function Ve(t){let e=t.getBoundingClientRect(),n=Math.max(document.documentElement.clientHeight,window.innerHeight);return!(e.bottom<0||e.top-n>=0)}var oe=(t,e=100)=>{let n;return()=>{clearTimeout(n),n=setTimeout(()=>t(),e)}};var pe=Ae(ue());async function ce(t,e){if(!window.searchData)return;let n=await fetch(window.searchData),r=new Blob([await n.arrayBuffer()]).stream().pipeThrough(new DecompressionStream("gzip")),i=await new Response(r).json();t.data=i,t.index=pe.Index.load(i.index),e.classList.remove("loading"),e.classList.add("ready")}function fe(){let t=document.getElementById("tsd-search");if(!t)return;let e={base:t.dataset.base+"/"},n=document.getElementById("tsd-search-script");t.classList.add("loading"),n&&(n.addEventListener("error",()=>{t.classList.remove("loading"),t.classList.add("failure")}),n.addEventListener("load",()=>{ce(e,t)}),ce(e,t));let r=document.querySelector("#tsd-search input"),i=document.querySelector("#tsd-search .results");if(!r||!i)throw new Error("The input field or the result list wrapper was not found");i.addEventListener("mouseup",()=>{te(t)}),r.addEventListener("focus",()=>t.classList.add("has-focus")),He(t,i,r,e)}function He(t,e,n,r){n.addEventListener("input",oe(()=>{Ne(t,e,n,r)},200)),n.addEventListener("keydown",i=>{i.key=="Enter"?Be(e,t):i.key=="ArrowUp"?(de(e,n,-1),i.preventDefault()):i.key==="ArrowDown"&&(de(e,n,1),i.preventDefault())}),document.body.addEventListener("keypress",i=>{i.altKey||i.ctrlKey||i.metaKey||!n.matches(":focus")&&i.key==="/"&&(i.preventDefault(),n.focus())}),document.body.addEventListener("keyup",i=>{t.classList.contains("has-focus")&&(i.key==="Escape"||!e.matches(":focus-within")&&!n.matches(":focus"))&&(n.blur(),te(t))})}function te(t){t.classList.remove("has-focus")}function Ne(t,e,n,r){if(!r.index||!r.data)return;e.textContent="";let i=n.value.trim(),s;if(i){let o=i.split(" ").map(a=>a.length?`*${a}*`:"").join(" ");s=r.index.search(o)}else s=[];for(let o=0;oa.score-o.score);for(let o=0,a=Math.min(10,s.length);o`,d=he(l.name,i);globalThis.DEBUG_SEARCH_WEIGHTS&&(d+=` (score: ${s[o].score.toFixed(2)})`),l.parent&&(d=` + ${he(l.parent,i)}.${d}`);let m=document.createElement("li");m.classList.value=l.classes??"";let p=document.createElement("a");p.href=r.base+l.url,p.innerHTML=u+d,m.append(p),p.addEventListener("focus",()=>{e.querySelector(".current")?.classList.remove("current"),m.classList.add("current")}),e.appendChild(m)}}function de(t,e,n){let r=t.querySelector(".current");if(!r)r=t.querySelector(n==1?"li:first-child":"li:last-child"),r&&r.classList.add("current");else{let i=r;if(n===1)do i=i.nextElementSibling??void 0;while(i instanceof HTMLElement&&i.offsetParent==null);else do i=i.previousElementSibling??void 0;while(i instanceof HTMLElement&&i.offsetParent==null);i?(r.classList.remove("current"),i.classList.add("current")):n===-1&&(r.classList.remove("current"),e.focus())}}function Be(t,e){let n=t.querySelector(".current");if(n||(n=t.querySelector("li:first-child")),n){let r=n.querySelector("a");r&&(window.location.href=r.href),te(e)}}function he(t,e){if(e==="")return t;let n=t.toLocaleLowerCase(),r=e.toLocaleLowerCase(),i=[],s=0,o=n.indexOf(r);for(;o!=-1;)i.push(ee(t.substring(s,o)),`${ee(t.substring(o,o+r.length))}`),s=o+r.length,o=n.indexOf(r,s);return i.push(ee(t.substring(s))),i.join("")}var je={"&":"&","<":"<",">":">","'":"'",'"':"""};function ee(t){return t.replace(/[&<>"'"]/g,e=>je[e])}var I=class{constructor(e){this.el=e.el,this.app=e.app}};var F="mousedown",ye="mousemove",N="mouseup",J={x:0,y:0},me=!1,ne=!1,qe=!1,D=!1,ve=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);document.documentElement.classList.add(ve?"is-mobile":"not-mobile");ve&&"ontouchstart"in document.documentElement&&(qe=!0,F="touchstart",ye="touchmove",N="touchend");document.addEventListener(F,t=>{ne=!0,D=!1;let e=F=="touchstart"?t.targetTouches[0]:t;J.y=e.pageY||0,J.x=e.pageX||0});document.addEventListener(ye,t=>{if(ne&&!D){let e=F=="touchstart"?t.targetTouches[0]:t,n=J.x-(e.pageX||0),r=J.y-(e.pageY||0);D=Math.sqrt(n*n+r*r)>10}});document.addEventListener(N,()=>{ne=!1});document.addEventListener("click",t=>{me&&(t.preventDefault(),t.stopImmediatePropagation(),me=!1)});var X=class extends I{constructor(e){super(e),this.className=this.el.dataset.toggle||"",this.el.addEventListener(N,n=>this.onPointerUp(n)),this.el.addEventListener("click",n=>n.preventDefault()),document.addEventListener(F,n=>this.onDocumentPointerDown(n)),document.addEventListener(N,n=>this.onDocumentPointerUp(n))}setActive(e){if(this.active==e)return;this.active=e,document.documentElement.classList.toggle("has-"+this.className,e),this.el.classList.toggle("active",e);let n=(this.active?"to-has-":"from-has-")+this.className;document.documentElement.classList.add(n),setTimeout(()=>document.documentElement.classList.remove(n),500)}onPointerUp(e){D||(this.setActive(!0),e.preventDefault())}onDocumentPointerDown(e){if(this.active){if(e.target.closest(".col-sidebar, .tsd-filter-group"))return;this.setActive(!1)}}onDocumentPointerUp(e){if(!D&&this.active&&e.target.closest(".col-sidebar")){let n=e.target.closest("a");if(n){let r=window.location.href;r.indexOf("#")!=-1&&(r=r.substring(0,r.indexOf("#"))),n.href.substring(0,r.length)==r&&setTimeout(()=>this.setActive(!1),250)}}}};var re;try{re=localStorage}catch{re={getItem(){return null},setItem(){}}}var Q=re;var ge=document.head.appendChild(document.createElement("style"));ge.dataset.for="filters";var Y=class extends I{constructor(e){super(e),this.key=`filter-${this.el.name}`,this.value=this.el.checked,this.el.addEventListener("change",()=>{this.setLocalStorage(this.el.checked)}),this.setLocalStorage(this.fromLocalStorage()),ge.innerHTML+=`html:not(.${this.key}) .tsd-is-${this.el.name} { display: none; } +`,this.app.updateIndexVisibility()}fromLocalStorage(){let e=Q.getItem(this.key);return e?e==="true":this.el.checked}setLocalStorage(e){Q.setItem(this.key,e.toString()),this.value=e,this.handleValueChange()}handleValueChange(){this.el.checked=this.value,document.documentElement.classList.toggle(this.key,this.value),this.app.filterChanged(),this.app.updateIndexVisibility()}};var Z=class extends I{constructor(e){super(e),this.summary=this.el.querySelector(".tsd-accordion-summary"),this.icon=this.summary.querySelector("svg"),this.key=`tsd-accordion-${this.summary.dataset.key??this.summary.textContent.trim().replace(/\s+/g,"-").toLowerCase()}`;let n=Q.getItem(this.key);this.el.open=n?n==="true":this.el.open,this.el.addEventListener("toggle",()=>this.update());let r=this.summary.querySelector("a");r&&r.addEventListener("click",()=>{location.assign(r.href)}),this.update()}update(){this.icon.style.transform=`rotate(${this.el.open?0:-90}deg)`,Q.setItem(this.key,this.el.open.toString())}};function Ee(t){let e=Q.getItem("tsd-theme")||"os";t.value=e,xe(e),t.addEventListener("change",()=>{Q.setItem("tsd-theme",t.value),xe(t.value)})}function xe(t){document.documentElement.dataset.theme=t}var K;function we(){let t=document.getElementById("tsd-nav-script");t&&(t.addEventListener("load",Le),Le())}async function Le(){let t=document.getElementById("tsd-nav-container");if(!t||!window.navigationData)return;let n=await(await fetch(window.navigationData)).arrayBuffer(),r=new Blob([n]).stream().pipeThrough(new DecompressionStream("gzip")),i=await new Response(r).json();K=t.dataset.base,K.endsWith("/")||(K+="/"),t.innerHTML="";for(let s of i)Se(s,t,[]);window.app.createComponents(t),window.app.showPage(),window.app.ensureActivePageVisible()}function Se(t,e,n){let r=e.appendChild(document.createElement("li"));if(t.children){let i=[...n,t.text],s=r.appendChild(document.createElement("details"));s.className=t.class?`${t.class} tsd-accordion`:"tsd-accordion";let o=s.appendChild(document.createElement("summary"));o.className="tsd-accordion-summary",o.dataset.key=i.join("$"),o.innerHTML='',be(t,o);let a=s.appendChild(document.createElement("div"));a.className="tsd-accordion-details";let l=a.appendChild(document.createElement("ul"));l.className="tsd-nested-navigation";for(let u of t.children)Se(u,l,i)}else be(t,r,t.class)}function be(t,e,n){if(t.path){let r=e.appendChild(document.createElement("a"));r.href=K+t.path,n&&(r.className=n),location.pathname===r.pathname&&!r.href.includes("#")&&r.classList.add("current"),t.kind&&(r.innerHTML=``),r.appendChild(document.createElement("span")).textContent=t.text}else e.appendChild(document.createElement("span")).textContent=t.text}G(X,"a[data-toggle]");G(Z,".tsd-accordion");G(Y,".tsd-filter-item input[type=checkbox]");var Te=document.getElementById("tsd-theme");Te&&Ee(Te);var $e=new U;Object.defineProperty(window,"app",{value:$e});fe();we();})(); +/*! Bundled license information: + +lunr/lunr.js: + (** + * lunr - http://lunrjs.com - A bit like Solr, but much smaller and not as bright - 2.3.9 + * Copyright (C) 2020 Oliver Nightingale + * @license MIT + *) + (*! + * lunr.utils + * Copyright (C) 2020 Oliver Nightingale + *) + (*! + * lunr.Set + * Copyright (C) 2020 Oliver Nightingale + *) + (*! + * lunr.tokenizer + * Copyright (C) 2020 Oliver Nightingale + *) + (*! + * lunr.Pipeline + * Copyright (C) 2020 Oliver Nightingale + *) + (*! + * lunr.Vector + * Copyright (C) 2020 Oliver Nightingale + *) + (*! + * lunr.stemmer + * Copyright (C) 2020 Oliver Nightingale + * Includes code from - http://tartarus.org/~martin/PorterStemmer/js.txt + *) + (*! + * lunr.stopWordFilter + * Copyright (C) 2020 Oliver Nightingale + *) + (*! + * lunr.trimmer + * Copyright (C) 2020 Oliver Nightingale + *) + (*! + * lunr.TokenSet + * Copyright (C) 2020 Oliver Nightingale + *) + (*! + * lunr.Index + * Copyright (C) 2020 Oliver Nightingale + *) + (*! + * lunr.Builder + * Copyright (C) 2020 Oliver Nightingale + *) +*/ diff --git a/Documentation/assets/navigation.js b/Documentation/assets/navigation.js new file mode 100644 index 00000000..e7335e96 --- /dev/null +++ b/Documentation/assets/navigation.js @@ -0,0 +1 @@ +window.navigationData = "data:application/octet-stream;base64,H4sIAAAAAAAACouOBQApu0wNAgAAAA==" \ No newline at end of file diff --git a/Documentation/assets/search.js b/Documentation/assets/search.js new file mode 100644 index 00000000..31a4e1af --- /dev/null +++ b/Documentation/assets/search.js @@ -0,0 +1 @@ +window.searchData = "data:application/octet-stream;base64,H4sIAAAAAAAACj2MQQqDMBRE7zLr4MKuzA16ATfioiQjfDD/S0xtQby7pEp384bH25Hts8IPo4No5Bd+x8a8iik82ubRdHCYhHOsGvSVCIdgKVELHKKF92+Ot9YzFMv/5sZcGJ9Xu16LLJxFWek4TiJTfzuBAAAA"; \ No newline at end of file diff --git a/Documentation/assets/style.css b/Documentation/assets/style.css new file mode 100644 index 00000000..9d619a64 --- /dev/null +++ b/Documentation/assets/style.css @@ -0,0 +1,1448 @@ +:root { + /* Light */ + --light-color-background: #f2f4f8; + --light-color-background-secondary: #eff0f1; + --light-color-warning-text: #222; + --light-color-background-warning: #e6e600; + --light-color-icon-background: var(--light-color-background); + --light-color-accent: #c5c7c9; + --light-color-active-menu-item: var(--light-color-accent); + --light-color-text: #222; + --light-color-text-aside: #6e6e6e; + --light-color-link: #1f70c2; + --light-color-focus-outline: #3584e4; + + --light-color-ts-keyword: #056bd6; + --light-color-ts-project: #b111c9; + --light-color-ts-module: var(--light-color-ts-project); + --light-color-ts-namespace: var(--light-color-ts-project); + --light-color-ts-enum: #7e6f15; + --light-color-ts-enum-member: var(--light-color-ts-enum); + --light-color-ts-variable: #4760ec; + --light-color-ts-function: #572be7; + --light-color-ts-class: #1f70c2; + --light-color-ts-interface: #108024; + --light-color-ts-constructor: var(--light-color-ts-class); + --light-color-ts-property: var(--light-color-ts-variable); + --light-color-ts-method: var(--light-color-ts-function); + --light-color-ts-call-signature: var(--light-color-ts-method); + --light-color-ts-index-signature: var(--light-color-ts-property); + --light-color-ts-constructor-signature: var(--light-color-ts-constructor); + --light-color-ts-parameter: var(--light-color-ts-variable); + /* type literal not included as links will never be generated to it */ + --light-color-ts-type-parameter: #a55c0e; + --light-color-ts-accessor: var(--light-color-ts-property); + --light-color-ts-get-signature: var(--light-color-ts-accessor); + --light-color-ts-set-signature: var(--light-color-ts-accessor); + --light-color-ts-type-alias: #d51270; + /* reference not included as links will be colored with the kind that it points to */ + --light-color-document: #000000; + + --light-external-icon: url("data:image/svg+xml;utf8,"); + --light-color-scheme: light; + + /* Dark */ + --dark-color-background: #2b2e33; + --dark-color-background-secondary: #1e2024; + --dark-color-background-warning: #bebe00; + --dark-color-warning-text: #222; + --dark-color-icon-background: var(--dark-color-background-secondary); + --dark-color-accent: #9096a2; + --dark-color-active-menu-item: #5d5d6a; + --dark-color-text: #f5f5f5; + --dark-color-text-aside: #dddddd; + --dark-color-link: #00aff4; + --dark-color-focus-outline: #4c97f2; + + --dark-color-ts-keyword: #3399ff; + --dark-color-ts-project: #e358ff; + --dark-color-ts-module: var(--dark-color-ts-project); + --dark-color-ts-namespace: var(--dark-color-ts-project); + --dark-color-ts-enum: #f4d93e; + --dark-color-ts-enum-member: var(--dark-color-ts-enum); + --dark-color-ts-variable: #798dff; + --dark-color-ts-function: #a280ff; + --dark-color-ts-class: #8ac4ff; + --dark-color-ts-interface: #6cff87; + --dark-color-ts-constructor: var(--dark-color-ts-class); + --dark-color-ts-property: var(--dark-color-ts-variable); + --dark-color-ts-method: var(--dark-color-ts-function); + --dark-color-ts-call-signature: var(--dark-color-ts-method); + --dark-color-ts-index-signature: var(--dark-color-ts-property); + --dark-color-ts-constructor-signature: var(--dark-color-ts-constructor); + --dark-color-ts-parameter: var(--dark-color-ts-variable); + /* type literal not included as links will never be generated to it */ + --dark-color-ts-type-parameter: #e07d13; + --dark-color-ts-accessor: var(--dark-color-ts-property); + --dark-color-ts-get-signature: var(--dark-color-ts-accessor); + --dark-color-ts-set-signature: var(--dark-color-ts-accessor); + --dark-color-ts-type-alias: #ff6492; + /* reference not included as links will be colored with the kind that it points to */ + --dark-color-document: #ffffff; + + --dark-external-icon: url("data:image/svg+xml;utf8,"); + --dark-color-scheme: dark; +} + +@media (prefers-color-scheme: light) { + :root { + --color-background: var(--light-color-background); + --color-background-secondary: var(--light-color-background-secondary); + --color-background-warning: var(--light-color-background-warning); + --color-warning-text: var(--light-color-warning-text); + --color-icon-background: var(--light-color-icon-background); + --color-accent: var(--light-color-accent); + --color-active-menu-item: var(--light-color-active-menu-item); + --color-text: var(--light-color-text); + --color-text-aside: var(--light-color-text-aside); + --color-link: var(--light-color-link); + --color-focus-outline: var(--light-color-focus-outline); + + --color-ts-keyword: var(--light-color-ts-keyword); + --color-ts-module: var(--light-color-ts-module); + --color-ts-namespace: var(--light-color-ts-namespace); + --color-ts-enum: var(--light-color-ts-enum); + --color-ts-enum-member: var(--light-color-ts-enum-member); + --color-ts-variable: var(--light-color-ts-variable); + --color-ts-function: var(--light-color-ts-function); + --color-ts-class: var(--light-color-ts-class); + --color-ts-interface: var(--light-color-ts-interface); + --color-ts-constructor: var(--light-color-ts-constructor); + --color-ts-property: var(--light-color-ts-property); + --color-ts-method: var(--light-color-ts-method); + --color-ts-call-signature: var(--light-color-ts-call-signature); + --color-ts-index-signature: var(--light-color-ts-index-signature); + --color-ts-constructor-signature: var( + --light-color-ts-constructor-signature + ); + --color-ts-parameter: var(--light-color-ts-parameter); + --color-ts-type-parameter: var(--light-color-ts-type-parameter); + --color-ts-accessor: var(--light-color-ts-accessor); + --color-ts-get-signature: var(--light-color-ts-get-signature); + --color-ts-set-signature: var(--light-color-ts-set-signature); + --color-ts-type-alias: var(--light-color-ts-type-alias); + --color-document: var(--light-color-document); + + --external-icon: var(--light-external-icon); + --color-scheme: var(--light-color-scheme); + } +} + +@media (prefers-color-scheme: dark) { + :root { + --color-background: var(--dark-color-background); + --color-background-secondary: var(--dark-color-background-secondary); + --color-background-warning: var(--dark-color-background-warning); + --color-warning-text: var(--dark-color-warning-text); + --color-icon-background: var(--dark-color-icon-background); + --color-accent: var(--dark-color-accent); + --color-active-menu-item: var(--dark-color-active-menu-item); + --color-text: var(--dark-color-text); + --color-text-aside: var(--dark-color-text-aside); + --color-link: var(--dark-color-link); + --color-focus-outline: var(--dark-color-focus-outline); + + --color-ts-keyword: var(--dark-color-ts-keyword); + --color-ts-module: var(--dark-color-ts-module); + --color-ts-namespace: var(--dark-color-ts-namespace); + --color-ts-enum: var(--dark-color-ts-enum); + --color-ts-enum-member: var(--dark-color-ts-enum-member); + --color-ts-variable: var(--dark-color-ts-variable); + --color-ts-function: var(--dark-color-ts-function); + --color-ts-class: var(--dark-color-ts-class); + --color-ts-interface: var(--dark-color-ts-interface); + --color-ts-constructor: var(--dark-color-ts-constructor); + --color-ts-property: var(--dark-color-ts-property); + --color-ts-method: var(--dark-color-ts-method); + --color-ts-call-signature: var(--dark-color-ts-call-signature); + --color-ts-index-signature: var(--dark-color-ts-index-signature); + --color-ts-constructor-signature: var( + --dark-color-ts-constructor-signature + ); + --color-ts-parameter: var(--dark-color-ts-parameter); + --color-ts-type-parameter: var(--dark-color-ts-type-parameter); + --color-ts-accessor: var(--dark-color-ts-accessor); + --color-ts-get-signature: var(--dark-color-ts-get-signature); + --color-ts-set-signature: var(--dark-color-ts-set-signature); + --color-ts-type-alias: var(--dark-color-ts-type-alias); + --color-document: var(--dark-color-document); + + --external-icon: var(--dark-external-icon); + --color-scheme: var(--dark-color-scheme); + } +} + +html { + color-scheme: var(--color-scheme); +} + +body { + margin: 0; +} + +:root[data-theme="light"] { + --color-background: var(--light-color-background); + --color-background-secondary: var(--light-color-background-secondary); + --color-background-warning: var(--light-color-background-warning); + --color-warning-text: var(--light-color-warning-text); + --color-icon-background: var(--light-color-icon-background); + --color-accent: var(--light-color-accent); + --color-active-menu-item: var(--light-color-active-menu-item); + --color-text: var(--light-color-text); + --color-text-aside: var(--light-color-text-aside); + --color-link: var(--light-color-link); + --color-focus-outline: var(--light-color-focus-outline); + + --color-ts-keyword: var(--light-color-ts-keyword); + --color-ts-module: var(--light-color-ts-module); + --color-ts-namespace: var(--light-color-ts-namespace); + --color-ts-enum: var(--light-color-ts-enum); + --color-ts-enum-member: var(--light-color-ts-enum-member); + --color-ts-variable: var(--light-color-ts-variable); + --color-ts-function: var(--light-color-ts-function); + --color-ts-class: var(--light-color-ts-class); + --color-ts-interface: var(--light-color-ts-interface); + --color-ts-constructor: var(--light-color-ts-constructor); + --color-ts-property: var(--light-color-ts-property); + --color-ts-method: var(--light-color-ts-method); + --color-ts-call-signature: var(--light-color-ts-call-signature); + --color-ts-index-signature: var(--light-color-ts-index-signature); + --color-ts-constructor-signature: var( + --light-color-ts-constructor-signature + ); + --color-ts-parameter: var(--light-color-ts-parameter); + --color-ts-type-parameter: var(--light-color-ts-type-parameter); + --color-ts-accessor: var(--light-color-ts-accessor); + --color-ts-get-signature: var(--light-color-ts-get-signature); + --color-ts-set-signature: var(--light-color-ts-set-signature); + --color-ts-type-alias: var(--light-color-ts-type-alias); + --color-document: var(--light-color-document); + + --external-icon: var(--light-external-icon); + --color-scheme: var(--light-color-scheme); +} + +:root[data-theme="dark"] { + --color-background: var(--dark-color-background); + --color-background-secondary: var(--dark-color-background-secondary); + --color-background-warning: var(--dark-color-background-warning); + --color-warning-text: var(--dark-color-warning-text); + --color-icon-background: var(--dark-color-icon-background); + --color-accent: var(--dark-color-accent); + --color-active-menu-item: var(--dark-color-active-menu-item); + --color-text: var(--dark-color-text); + --color-text-aside: var(--dark-color-text-aside); + --color-link: var(--dark-color-link); + --color-focus-outline: var(--dark-color-focus-outline); + + --color-ts-keyword: var(--dark-color-ts-keyword); + --color-ts-module: var(--dark-color-ts-module); + --color-ts-namespace: var(--dark-color-ts-namespace); + --color-ts-enum: var(--dark-color-ts-enum); + --color-ts-enum-member: var(--dark-color-ts-enum-member); + --color-ts-variable: var(--dark-color-ts-variable); + --color-ts-function: var(--dark-color-ts-function); + --color-ts-class: var(--dark-color-ts-class); + --color-ts-interface: var(--dark-color-ts-interface); + --color-ts-constructor: var(--dark-color-ts-constructor); + --color-ts-property: var(--dark-color-ts-property); + --color-ts-method: var(--dark-color-ts-method); + --color-ts-call-signature: var(--dark-color-ts-call-signature); + --color-ts-index-signature: var(--dark-color-ts-index-signature); + --color-ts-constructor-signature: var( + --dark-color-ts-constructor-signature + ); + --color-ts-parameter: var(--dark-color-ts-parameter); + --color-ts-type-parameter: var(--dark-color-ts-type-parameter); + --color-ts-accessor: var(--dark-color-ts-accessor); + --color-ts-get-signature: var(--dark-color-ts-get-signature); + --color-ts-set-signature: var(--dark-color-ts-set-signature); + --color-ts-type-alias: var(--dark-color-ts-type-alias); + --color-document: var(--dark-color-document); + + --external-icon: var(--dark-external-icon); + --color-scheme: var(--dark-color-scheme); +} + +*:focus-visible, +.tsd-accordion-summary:focus-visible svg { + outline: 2px solid var(--color-focus-outline); +} + +.always-visible, +.always-visible .tsd-signatures { + display: inherit !important; +} + +h1, +h2, +h3, +h4, +h5, +h6 { + line-height: 1.2; +} + +h1 { + font-size: 1.875rem; + margin: 0.67rem 0; +} + +h2 { + font-size: 1.5rem; + margin: 0.83rem 0; +} + +h3 { + font-size: 1.25rem; + margin: 1rem 0; +} + +h4 { + font-size: 1.05rem; + margin: 1.33rem 0; +} + +h5 { + font-size: 1rem; + margin: 1.5rem 0; +} + +h6 { + font-size: 0.875rem; + margin: 2.33rem 0; +} + +dl, +menu, +ol, +ul { + margin: 1em 0; +} + +dd { + margin: 0 0 0 40px; +} + +.container { + max-width: 1700px; + padding: 0 2rem; +} + +/* Footer */ +footer { + border-top: 1px solid var(--color-accent); + padding-top: 1rem; + padding-bottom: 1rem; + max-height: 3.5rem; +} +footer > p { + margin: 0 1em; +} + +.container-main { + margin: 0 auto; + /* toolbar, footer, margin */ + min-height: calc(100vh - 41px - 56px - 4rem); +} + +@keyframes fade-in { + from { + opacity: 0; + } + to { + opacity: 1; + } +} +@keyframes fade-out { + from { + opacity: 1; + visibility: visible; + } + to { + opacity: 0; + } +} +@keyframes fade-in-delayed { + 0% { + opacity: 0; + } + 33% { + opacity: 0; + } + 100% { + opacity: 1; + } +} +@keyframes fade-out-delayed { + 0% { + opacity: 1; + visibility: visible; + } + 66% { + opacity: 0; + } + 100% { + opacity: 0; + } +} +@keyframes pop-in-from-right { + from { + transform: translate(100%, 0); + } + to { + transform: translate(0, 0); + } +} +@keyframes pop-out-to-right { + from { + transform: translate(0, 0); + visibility: visible; + } + to { + transform: translate(100%, 0); + } +} +body { + background: var(--color-background); + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", + Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"; + font-size: 16px; + color: var(--color-text); +} + +a { + color: var(--color-link); + text-decoration: none; +} +a:hover { + text-decoration: underline; +} +a.external[target="_blank"] { + background-image: var(--external-icon); + background-position: top 3px right; + background-repeat: no-repeat; + padding-right: 13px; +} +a.tsd-anchor-link { + color: var(--color-text); +} + +code, +pre { + font-family: Menlo, Monaco, Consolas, "Courier New", monospace; + padding: 0.2em; + margin: 0; + font-size: 0.875rem; + border-radius: 0.8em; +} + +pre { + position: relative; + white-space: pre; + white-space: pre-wrap; + word-wrap: break-word; + padding: 10px; + border: 1px solid var(--color-accent); +} +pre code { + padding: 0; + font-size: 100%; +} +pre > button { + position: absolute; + top: 10px; + right: 10px; + opacity: 0; + transition: opacity 0.1s; + box-sizing: border-box; +} +pre:hover > button, +pre > button.visible { + opacity: 1; +} + +blockquote { + margin: 1em 0; + padding-left: 1em; + border-left: 4px solid gray; +} + +.tsd-typography { + line-height: 1.333em; +} +.tsd-typography ul { + list-style: square; + padding: 0 0 0 20px; + margin: 0; +} +.tsd-typography .tsd-index-panel h3, +.tsd-index-panel .tsd-typography h3, +.tsd-typography h4, +.tsd-typography h5, +.tsd-typography h6 { + font-size: 1em; +} +.tsd-typography h5, +.tsd-typography h6 { + font-weight: normal; +} +.tsd-typography p, +.tsd-typography ul, +.tsd-typography ol { + margin: 1em 0; +} +.tsd-typography table { + border-collapse: collapse; + border: none; +} +.tsd-typography td, +.tsd-typography th { + padding: 6px 13px; + border: 1px solid var(--color-accent); +} +.tsd-typography thead, +.tsd-typography tr:nth-child(even) { + background-color: var(--color-background-secondary); +} + +.tsd-breadcrumb { + margin: 0; + padding: 0; + color: var(--color-text-aside); +} +.tsd-breadcrumb a { + color: var(--color-text-aside); + text-decoration: none; +} +.tsd-breadcrumb a:hover { + text-decoration: underline; +} +.tsd-breadcrumb li { + display: inline; +} +.tsd-breadcrumb li:after { + content: " / "; +} + +.tsd-comment-tags { + display: flex; + flex-direction: column; +} +dl.tsd-comment-tag-group { + display: flex; + align-items: center; + overflow: hidden; + margin: 0.5em 0; +} +dl.tsd-comment-tag-group dt { + display: flex; + margin-right: 0.5em; + font-size: 0.875em; + font-weight: normal; +} +dl.tsd-comment-tag-group dd { + margin: 0; +} +code.tsd-tag { + padding: 0.25em 0.4em; + border: 0.1em solid var(--color-accent); + margin-right: 0.25em; + font-size: 70%; +} +h1 code.tsd-tag:first-of-type { + margin-left: 0.25em; +} + +dl.tsd-comment-tag-group dd:before, +dl.tsd-comment-tag-group dd:after { + content: " "; +} +dl.tsd-comment-tag-group dd pre, +dl.tsd-comment-tag-group dd:after { + clear: both; +} +dl.tsd-comment-tag-group p { + margin: 0; +} + +.tsd-panel.tsd-comment .lead { + font-size: 1.1em; + line-height: 1.333em; + margin-bottom: 2em; +} +.tsd-panel.tsd-comment .lead:last-child { + margin-bottom: 0; +} + +.tsd-filter-visibility h4 { + font-size: 1rem; + padding-top: 0.75rem; + padding-bottom: 0.5rem; + margin: 0; +} +.tsd-filter-item:not(:last-child) { + margin-bottom: 0.5rem; +} +.tsd-filter-input { + display: flex; + width: -moz-fit-content; + width: fit-content; + align-items: center; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + cursor: pointer; +} +.tsd-filter-input input[type="checkbox"] { + cursor: pointer; + position: absolute; + width: 1.5em; + height: 1.5em; + opacity: 0; +} +.tsd-filter-input input[type="checkbox"]:disabled { + pointer-events: none; +} +.tsd-filter-input svg { + cursor: pointer; + width: 1.5em; + height: 1.5em; + margin-right: 0.5em; + border-radius: 0.33em; + /* Leaving this at full opacity breaks event listeners on Firefox. + Don't remove unless you know what you're doing. */ + opacity: 0.99; +} +.tsd-filter-input input[type="checkbox"]:focus-visible + svg { + outline: 2px solid var(--color-focus-outline); +} +.tsd-checkbox-background { + fill: var(--color-accent); +} +input[type="checkbox"]:checked ~ svg .tsd-checkbox-checkmark { + stroke: var(--color-text); +} +.tsd-filter-input input:disabled ~ svg > .tsd-checkbox-background { + fill: var(--color-background); + stroke: var(--color-accent); + stroke-width: 0.25rem; +} +.tsd-filter-input input:disabled ~ svg > .tsd-checkbox-checkmark { + stroke: var(--color-accent); +} + +.settings-label { + font-weight: bold; + text-transform: uppercase; + display: inline-block; +} + +.tsd-filter-visibility .settings-label { + margin: 0.75rem 0 0.5rem 0; +} + +.tsd-theme-toggle .settings-label { + margin: 0.75rem 0.75rem 0 0; +} + +.tsd-hierarchy { + list-style: square; + margin: 0; +} +.tsd-hierarchy .target { + font-weight: bold; +} + +.tsd-full-hierarchy:not(:last-child) { + margin-bottom: 1em; + padding-bottom: 1em; + border-bottom: 1px solid var(--color-accent); +} +.tsd-full-hierarchy, +.tsd-full-hierarchy ul { + list-style: none; + margin: 0; + padding: 0; +} +.tsd-full-hierarchy ul { + padding-left: 1.5rem; +} +.tsd-full-hierarchy a { + padding: 0.25rem 0 !important; + font-size: 1rem; + display: inline-flex; + align-items: center; + color: var(--color-text); +} + +.tsd-panel-group.tsd-index-group { + margin-bottom: 0; +} +.tsd-index-panel .tsd-index-list { + list-style: none; + line-height: 1.333em; + margin: 0; + padding: 0.25rem 0 0 0; + overflow: hidden; + display: grid; + grid-template-columns: repeat(3, 1fr); + column-gap: 1rem; + grid-template-rows: auto; +} +@media (max-width: 1024px) { + .tsd-index-panel .tsd-index-list { + grid-template-columns: repeat(2, 1fr); + } +} +@media (max-width: 768px) { + .tsd-index-panel .tsd-index-list { + grid-template-columns: repeat(1, 1fr); + } +} +.tsd-index-panel .tsd-index-list li { + -webkit-page-break-inside: avoid; + -moz-page-break-inside: avoid; + -ms-page-break-inside: avoid; + -o-page-break-inside: avoid; + page-break-inside: avoid; +} + +.tsd-flag { + display: inline-block; + padding: 0.25em 0.4em; + border-radius: 4px; + color: var(--color-comment-tag-text); + background-color: var(--color-comment-tag); + text-indent: 0; + font-size: 75%; + line-height: 1; + font-weight: normal; +} + +.tsd-anchor { + position: relative; + top: -100px; +} + +.tsd-member { + position: relative; +} +.tsd-member .tsd-anchor + h3 { + display: flex; + align-items: center; + margin-top: 0; + margin-bottom: 0; + border-bottom: none; +} + +.tsd-navigation.settings { + margin: 1rem 0; +} +.tsd-navigation > a, +.tsd-navigation .tsd-accordion-summary { + width: calc(100% - 0.25rem); + display: flex; + align-items: center; +} +.tsd-navigation a, +.tsd-navigation summary > span, +.tsd-page-navigation a { + display: flex; + width: calc(100% - 0.25rem); + align-items: center; + padding: 0.25rem; + color: var(--color-text); + text-decoration: none; + box-sizing: border-box; +} +.tsd-navigation a.current, +.tsd-page-navigation a.current { + background: var(--color-active-menu-item); +} +.tsd-navigation a:hover, +.tsd-page-navigation a:hover { + text-decoration: underline; +} +.tsd-navigation ul, +.tsd-page-navigation ul { + margin-top: 0; + margin-bottom: 0; + padding: 0; + list-style: none; +} +.tsd-navigation li, +.tsd-page-navigation li { + padding: 0; + max-width: 100%; +} +.tsd-navigation .tsd-nav-link { + display: none; +} +.tsd-nested-navigation { + margin-left: 3rem; +} +.tsd-nested-navigation > li > details { + margin-left: -1.5rem; +} +.tsd-small-nested-navigation { + margin-left: 1.5rem; +} +.tsd-small-nested-navigation > li > details { + margin-left: -1.5rem; +} + +.tsd-page-navigation-section { + margin-left: 10px; +} +.tsd-page-navigation-section > summary { + padding: 0.25rem; +} +.tsd-page-navigation-section > div { + margin-left: 20px; +} +.tsd-page-navigation ul { + padding-left: 1.75rem; +} + +#tsd-sidebar-links a { + margin-top: 0; + margin-bottom: 0.5rem; + line-height: 1.25rem; +} +#tsd-sidebar-links a:last-of-type { + margin-bottom: 0; +} + +a.tsd-index-link { + padding: 0.25rem 0 !important; + font-size: 1rem; + line-height: 1.25rem; + display: inline-flex; + align-items: center; + color: var(--color-text); +} +.tsd-accordion-summary { + list-style-type: none; /* hide marker on non-safari */ + outline: none; /* broken on safari, so just hide it */ +} +.tsd-accordion-summary::-webkit-details-marker { + display: none; /* hide marker on safari */ +} +.tsd-accordion-summary, +.tsd-accordion-summary a { + -moz-user-select: none; + -webkit-user-select: none; + -ms-user-select: none; + user-select: none; + + cursor: pointer; +} +.tsd-accordion-summary a { + width: calc(100% - 1.5rem); +} +.tsd-accordion-summary > * { + margin-top: 0; + margin-bottom: 0; + padding-top: 0; + padding-bottom: 0; +} +.tsd-accordion .tsd-accordion-summary > svg { + margin-left: 0.25rem; + vertical-align: text-top; +} +.tsd-index-content > :not(:first-child) { + margin-top: 0.75rem; +} +.tsd-index-heading { + margin-top: 1.5rem; + margin-bottom: 0.75rem; +} + +.tsd-kind-icon { + margin-right: 0.5rem; + width: 1.25rem; + height: 1.25rem; + min-width: 1.25rem; + min-height: 1.25rem; +} +.tsd-kind-icon path { + transform-origin: center; + transform: scale(1.1); +} +.tsd-signature > .tsd-kind-icon { + margin-right: 0.8rem; +} + +.tsd-panel { + margin-bottom: 2.5rem; +} +.tsd-panel.tsd-member { + margin-bottom: 4rem; +} +.tsd-panel:empty { + display: none; +} +.tsd-panel > h1, +.tsd-panel > h2, +.tsd-panel > h3 { + margin: 1.5rem -1.5rem 0.75rem -1.5rem; + padding: 0 1.5rem 0.75rem 1.5rem; +} +.tsd-panel > h1.tsd-before-signature, +.tsd-panel > h2.tsd-before-signature, +.tsd-panel > h3.tsd-before-signature { + margin-bottom: 0; + border-bottom: none; +} + +.tsd-panel-group { + margin: 2rem 0; +} +.tsd-panel-group.tsd-index-group { + margin: 2rem 0; +} +.tsd-panel-group.tsd-index-group details { + margin: 2rem 0; +} +.tsd-panel-group > .tsd-accordion-summary { + margin-bottom: 1rem; +} + +#tsd-search { + transition: background-color 0.2s; +} +#tsd-search .title { + position: relative; + z-index: 2; +} +#tsd-search .field { + position: absolute; + left: 0; + top: 0; + right: 2.5rem; + height: 100%; +} +#tsd-search .field input { + box-sizing: border-box; + position: relative; + top: -50px; + z-index: 1; + width: 100%; + padding: 0 10px; + opacity: 0; + outline: 0; + border: 0; + background: transparent; + color: var(--color-text); +} +#tsd-search .field label { + position: absolute; + overflow: hidden; + right: -40px; +} +#tsd-search .field input, +#tsd-search .title, +#tsd-toolbar-links a { + transition: opacity 0.2s; +} +#tsd-search .results { + position: absolute; + visibility: hidden; + top: 40px; + width: 100%; + margin: 0; + padding: 0; + list-style: none; + box-shadow: 0 0 4px rgba(0, 0, 0, 0.25); +} +#tsd-search .results li { + background-color: var(--color-background); + line-height: initial; + padding: 4px; +} +#tsd-search .results li:nth-child(even) { + background-color: var(--color-background-secondary); +} +#tsd-search .results li.state { + display: none; +} +#tsd-search .results li.current:not(.no-results), +#tsd-search .results li:hover:not(.no-results) { + background-color: var(--color-accent); +} +#tsd-search .results a { + display: flex; + align-items: center; + padding: 0.25rem; + box-sizing: border-box; +} +#tsd-search .results a:before { + top: 10px; +} +#tsd-search .results span.parent { + color: var(--color-text-aside); + font-weight: normal; +} +#tsd-search.has-focus { + background-color: var(--color-accent); +} +#tsd-search.has-focus .field input { + top: 0; + opacity: 1; +} +#tsd-search.has-focus .title, +#tsd-search.has-focus #tsd-toolbar-links a { + z-index: 0; + opacity: 0; +} +#tsd-search.has-focus .results { + visibility: visible; +} +#tsd-search.loading .results li.state.loading { + display: block; +} +#tsd-search.failure .results li.state.failure { + display: block; +} + +#tsd-toolbar-links { + position: absolute; + top: 0; + right: 2rem; + height: 100%; + display: flex; + align-items: center; + justify-content: flex-end; +} +#tsd-toolbar-links a { + margin-left: 1.5rem; +} +#tsd-toolbar-links a:hover { + text-decoration: underline; +} + +.tsd-signature { + margin: 0 0 1rem 0; + padding: 1rem 0.5rem; + border: 1px solid var(--color-accent); + font-family: Menlo, Monaco, Consolas, "Courier New", monospace; + font-size: 14px; + overflow-x: auto; +} + +.tsd-signature-keyword { + color: var(--color-ts-keyword); + font-weight: normal; +} + +.tsd-signature-symbol { + color: var(--color-text-aside); + font-weight: normal; +} + +.tsd-signature-type { + font-style: italic; + font-weight: normal; +} + +.tsd-signatures { + padding: 0; + margin: 0 0 1em 0; + list-style-type: none; +} +.tsd-signatures .tsd-signature { + margin: 0; + border-color: var(--color-accent); + border-width: 1px 0; + transition: background-color 0.1s; +} +.tsd-signatures .tsd-index-signature:not(:last-child) { + margin-bottom: 1em; +} +.tsd-signatures .tsd-index-signature .tsd-signature { + border-width: 1px; +} +.tsd-description .tsd-signatures .tsd-signature { + border-width: 1px; +} + +ul.tsd-parameter-list, +ul.tsd-type-parameter-list { + list-style: square; + margin: 0; + padding-left: 20px; +} +ul.tsd-parameter-list > li.tsd-parameter-signature, +ul.tsd-type-parameter-list > li.tsd-parameter-signature { + list-style: none; + margin-left: -20px; +} +ul.tsd-parameter-list h5, +ul.tsd-type-parameter-list h5 { + font-size: 16px; + margin: 1em 0 0.5em 0; +} +.tsd-sources { + margin-top: 1rem; + font-size: 0.875em; +} +.tsd-sources a { + color: var(--color-text-aside); + text-decoration: underline; +} +.tsd-sources ul { + list-style: none; + padding: 0; +} + +.tsd-page-toolbar { + position: sticky; + z-index: 1; + top: 0; + left: 0; + width: 100%; + color: var(--color-text); + background: var(--color-background-secondary); + border-bottom: 1px var(--color-accent) solid; + transition: transform 0.3s ease-in-out; +} +.tsd-page-toolbar a { + color: var(--color-text); + text-decoration: none; +} +.tsd-page-toolbar a.title { + font-weight: bold; +} +.tsd-page-toolbar a.title:hover { + text-decoration: underline; +} +.tsd-page-toolbar .tsd-toolbar-contents { + display: flex; + justify-content: space-between; + height: 2.5rem; + margin: 0 auto; +} +.tsd-page-toolbar .table-cell { + position: relative; + white-space: nowrap; + line-height: 40px; +} +.tsd-page-toolbar .table-cell:first-child { + width: 100%; +} +.tsd-page-toolbar .tsd-toolbar-icon { + box-sizing: border-box; + line-height: 0; + padding: 12px 0; +} + +.tsd-widget { + display: inline-block; + overflow: hidden; + opacity: 0.8; + height: 40px; + transition: + opacity 0.1s, + background-color 0.2s; + vertical-align: bottom; + cursor: pointer; +} +.tsd-widget:hover { + opacity: 0.9; +} +.tsd-widget.active { + opacity: 1; + background-color: var(--color-accent); +} +.tsd-widget.no-caption { + width: 40px; +} +.tsd-widget.no-caption:before { + margin: 0; +} + +.tsd-widget.options, +.tsd-widget.menu { + display: none; +} +input[type="checkbox"] + .tsd-widget:before { + background-position: -120px 0; +} +input[type="checkbox"]:checked + .tsd-widget:before { + background-position: -160px 0; +} + +img { + max-width: 100%; +} + +.tsd-anchor-icon { + display: inline-flex; + align-items: center; + margin-left: 0.5rem; + vertical-align: middle; + color: var(--color-text); +} + +.tsd-anchor-icon svg { + width: 1em; + height: 1em; + visibility: hidden; +} + +.tsd-anchor-link:hover > .tsd-anchor-icon svg { + visibility: visible; +} + +.deprecated { + text-decoration: line-through !important; +} + +.warning { + padding: 1rem; + color: var(--color-warning-text); + background: var(--color-background-warning); +} + +.tsd-kind-project { + color: var(--color-ts-project); +} +.tsd-kind-module { + color: var(--color-ts-module); +} +.tsd-kind-namespace { + color: var(--color-ts-namespace); +} +.tsd-kind-enum { + color: var(--color-ts-enum); +} +.tsd-kind-enum-member { + color: var(--color-ts-enum-member); +} +.tsd-kind-variable { + color: var(--color-ts-variable); +} +.tsd-kind-function { + color: var(--color-ts-function); +} +.tsd-kind-class { + color: var(--color-ts-class); +} +.tsd-kind-interface { + color: var(--color-ts-interface); +} +.tsd-kind-constructor { + color: var(--color-ts-constructor); +} +.tsd-kind-property { + color: var(--color-ts-property); +} +.tsd-kind-method { + color: var(--color-ts-method); +} +.tsd-kind-call-signature { + color: var(--color-ts-call-signature); +} +.tsd-kind-index-signature { + color: var(--color-ts-index-signature); +} +.tsd-kind-constructor-signature { + color: var(--color-ts-constructor-signature); +} +.tsd-kind-parameter { + color: var(--color-ts-parameter); +} +.tsd-kind-type-literal { + color: var(--color-ts-type-literal); +} +.tsd-kind-type-parameter { + color: var(--color-ts-type-parameter); +} +.tsd-kind-accessor { + color: var(--color-ts-accessor); +} +.tsd-kind-get-signature { + color: var(--color-ts-get-signature); +} +.tsd-kind-set-signature { + color: var(--color-ts-set-signature); +} +.tsd-kind-type-alias { + color: var(--color-ts-type-alias); +} + +/* if we have a kind icon, don't color the text by kind */ +.tsd-kind-icon ~ span { + color: var(--color-text); +} + +* { + scrollbar-width: thin; + scrollbar-color: var(--color-accent) var(--color-icon-background); +} + +*::-webkit-scrollbar { + width: 0.75rem; +} + +*::-webkit-scrollbar-track { + background: var(--color-icon-background); +} + +*::-webkit-scrollbar-thumb { + background-color: var(--color-accent); + border-radius: 999rem; + border: 0.25rem solid var(--color-icon-background); +} + +/* mobile */ +@media (max-width: 769px) { + .tsd-widget.options, + .tsd-widget.menu { + display: inline-block; + } + + .container-main { + display: flex; + } + html .col-content { + float: none; + max-width: 100%; + width: 100%; + } + html .col-sidebar { + position: fixed !important; + overflow-y: auto; + -webkit-overflow-scrolling: touch; + z-index: 1024; + top: 0 !important; + bottom: 0 !important; + left: auto !important; + right: 0 !important; + padding: 1.5rem 1.5rem 0 0; + width: 75vw; + visibility: hidden; + background-color: var(--color-background); + transform: translate(100%, 0); + } + html .col-sidebar > *:last-child { + padding-bottom: 20px; + } + html .overlay { + content: ""; + display: block; + position: fixed; + z-index: 1023; + top: 0; + left: 0; + right: 0; + bottom: 0; + background-color: rgba(0, 0, 0, 0.75); + visibility: hidden; + } + + .to-has-menu .overlay { + animation: fade-in 0.4s; + } + + .to-has-menu .col-sidebar { + animation: pop-in-from-right 0.4s; + } + + .from-has-menu .overlay { + animation: fade-out 0.4s; + } + + .from-has-menu .col-sidebar { + animation: pop-out-to-right 0.4s; + } + + .has-menu body { + overflow: hidden; + } + .has-menu .overlay { + visibility: visible; + } + .has-menu .col-sidebar { + visibility: visible; + transform: translate(0, 0); + display: flex; + flex-direction: column; + gap: 1.5rem; + max-height: 100vh; + padding: 1rem 2rem; + } + .has-menu .tsd-navigation { + max-height: 100%; + } + #tsd-toolbar-links { + display: none; + } + .tsd-navigation .tsd-nav-link { + display: flex; + } +} + +/* one sidebar */ +@media (min-width: 770px) { + .container-main { + display: grid; + grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); + grid-template-areas: "sidebar content"; + margin: 2rem auto; + } + + .col-sidebar { + grid-area: sidebar; + } + .col-content { + grid-area: content; + padding: 0 1rem; + } +} +@media (min-width: 770px) and (max-width: 1399px) { + .col-sidebar { + max-height: calc(100vh - 2rem - 42px); + overflow: auto; + position: sticky; + top: 42px; + padding-top: 1rem; + } + .site-menu { + margin-top: 1rem; + } +} + +/* two sidebars */ +@media (min-width: 1200px) { + .container-main { + grid-template-columns: minmax(0, 1fr) minmax(0, 2.5fr) minmax(0, 20rem); + grid-template-areas: "sidebar content toc"; + } + + .col-sidebar { + display: contents; + } + + .page-menu { + grid-area: toc; + padding-left: 1rem; + } + .site-menu { + grid-area: sidebar; + } + + .site-menu { + margin-top: 1rem 0; + } + + .page-menu, + .site-menu { + max-height: calc(100vh - 2rem - 42px); + overflow: auto; + position: sticky; + top: 42px; + } +} diff --git a/Documentation/index.html b/Documentation/index.html new file mode 100644 index 00000000..87508a96 --- /dev/null +++ b/Documentation/index.html @@ -0,0 +1,313 @@ +@oxc-resolver/binding

@oxc-resolver/binding

+ + + OXC Logo + +

+
+

Crates.io +npmjs.com

+

Docs.rs +Build Status +Code Coverage +CodSpeed Badge +Sponsors +Discord chat +MIT licensed

+
+

Oxc Resolver

Rust port of enhanced-resolve.

+ +

The following usages apply to both Rust and Node.js; the code snippets are written in JavaScript.

+

To handle the exports field in package.json, ESM and CJS need to be differentiated.

+

Per ESM Resolution algorithm

+
+

defaultConditions is the conditional environment name array, ["node", "import"].

+
+

This means when the caller is an ESM import (import "module"), resolve options should be

+
{
"conditionNames": ["node", "import"]
} +
+ +

Per CJS Resolution algorithm

+
+

LOAD_PACKAGE_EXPORTS(X, DIR)

+
    +
  1. let MATCH = PACKAGE_EXPORTS_RESOLVE(pathToFileURL(DIR/NAME), "." + SUBPATH, +package.json "exports", ["node", "require"]) defined in the ESM resolver.
  2. +
+
+

This means when the caller is a CJS require (require("module")), resolve options should be

+
{
"conditionNames": ["node", "require"]
} +
+ +

To support both CJS and ESM with the same cache:

+
const esmResolver = ResolverFactory({
conditionNames: ["node", "import"]
});

const cjsResolver = esmResolver.cloneWithOptions({
conditionNames: ["node", "require"]
}); +
+ +

From this non-standard spec:

+
+

The browser field is provided to JavaScript bundlers or component tools when packaging modules for client side use.

+
+

The option is

+
{
"aliasFields": ["browser"]
} +
+ +
{
"mainFields": ["module", "main"]
} +
+ +

Quoting esbuild's documentation:

+
    +
  • main - This is the standard field for all packages that are meant to be used with node. The name main is hard-coded in to node's module resolution logic itself. Because it's intended for use with node, it's reasonable to expect that the file path in this field is a CommonJS-style module.
  • +
  • module - This field came from a proposal for how to integrate ECMAScript modules into node. Because of this, it's reasonable to expect that the file path in this field is an ECMAScript-style module. This proposal wasn't adopted by node (node uses "type": "module" instead) but it was adopted by major bundlers because ECMAScript-style modules lead to better tree shaking, or dead code removal.
  • +
  • browser - This field came from a proposal that allows bundlers to replace node-specific files or modules with their browser-friendly versions. It lets you specify an alternate browser-specific entry point. Note that it is possible for a package to use both the browser and module field together (see the note below).
  • +
+
    +
  • Error: Package subpath '.' is not defined by "exports" in - occurs when resolving without conditionNames.
  • +
+

The options are aligned with enhanced-resolve.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldDefaultDescription
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
conditionNames[]A list of exports field condition names
descriptionFiles["package.json"]A list of description files to read from
enforceExtensionfalseEnforce 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
fileSystemThe file system which should be used
fullySpecifiedfalseRequest 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
resolveToContextfalseResolve to a context instead of a file
preferRelativefalsePrefer to resolve module requests as relative request and fallback to resolving as module
preferAbsolutefalsePrefer 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
symlinkstrueWhether to resolve symlinks to their symlinked location
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldDefaultDescription
cachePredicatefunction() { 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.
cacheWithContexttrueIf unsafe cache is enabled, includes request.context in the cache key
plugins[]A list of additional resolve plugins which should be applied
resolverundefinedA prepared Resolver to which the plugins are attached
unsafeCachefalseUse this cache object to unsafely cache the successful requests
+

The following environment variable emits tracing information for the oxc_resolver::resolve function.

+

e.g.

+
2024-06-11T07:12:20.003537Z DEBUG oxc_resolver: options: ResolveOptions { ... }, path: "...", specifier: "...", ret: "..."
at /path/to/oxc_resolver-1.8.1/src/lib.rs:212
in oxc_resolver::resolve with path: "...", specifier: "..." +
+ +

The input values are options, path and specifier, the returned value is ret.

+
OXC_LOG=DEBUG your_program
+
+ +
RD_LOG='oxc_resolver' rolldown build
+
+ +
RSPACK_PROFILE='TRACE=filter=oxc_resolver=trace&layer=logger' rspack build
+
+ +

Tests are ported from

+ +

Test cases are located in ./src/tests, fixtures are located in ./tests

+
    +
  • [x] alias.test.js
  • +
  • [x] browserField.test.js
  • +
  • [x] dependencies.test.js
  • +
  • [x] exportsField.test.js
  • +
  • [x] extension-alias.test.js
  • +
  • [x] extensions.test.js
  • +
  • [x] fallback.test.js
  • +
  • [x] fullSpecified.test.js
  • +
  • [x] identifier.test.js (see unit test in crates/oxc_resolver/src/request.rs)
  • +
  • [x] importsField.test.js
  • +
  • [x] incorrect-description-file.test.js (need to add ctx.fileDependencies)
  • +
  • [x] missing.test.js
  • +
  • [x] path.test.js (see unit test in crates/oxc_resolver/src/path.rs)
  • +
  • [ ] plugins.test.js
  • +
  • [ ] pnp.test.js
  • +
  • [x] resolve.test.js
  • +
  • [x] restrictions.test.js (partially done, regex is not supported yet)
  • +
  • [x] roots.test.js
  • +
  • [x] scoped-packages.test.js
  • +
  • [x] simple.test.js
  • +
  • [x] symlink.test.js
  • +
+

Irrelevant tests

+
    +
  • CachedInputFileSystem.test.js
  • +
  • SyncAsyncFileSystemDecorator.test.js
  • +
  • forEachBail.test.js
  • +
  • getPaths.test.js
  • +
  • pr-53.test.js
  • +
  • unsafe-cache.test.js
  • +
  • yield.test.js
  • +
+

+ + My sponsors + +

+

oxc_resolver is free and open-source software licensed under the MIT License.

+

Oxc partially copies code from the following projects.

+ + + + + + + + + + + + + + + + + + + + + + + + + +
ProjectLicense
webpack/enhanced-resolveMIT
dividab/tsconfig-pathsMIT
parcel-bundler/parcelMIT
tmccombs/json-comments-rsApache 2.0
+
diff --git a/Documentation/media/LICENSE b/Documentation/media/LICENSE new file mode 100644 index 00000000..e8308cad --- /dev/null +++ b/Documentation/media/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2023-present Boshen + +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. diff --git a/Documentation/modules.html b/Documentation/modules.html new file mode 100644 index 00000000..b8f3a07a --- /dev/null +++ b/Documentation/modules.html @@ -0,0 +1 @@ +@oxc-resolver/binding

@oxc-resolver/binding

From 87624c7c63f1584835dce2924e7c57fe3a9a8dc4 Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Sat, 24 Aug 2024 09:40:58 +0300 Subject: [PATCH 55/82] --- .github/dependabot.yml | 38 ----------- .github/workflows/Dependabot.yml | 45 ------------- .github/workflows/GitHub.yml | 58 ---------------- .github/workflows/NPM.yml | 74 --------------------- .github/workflows/Node.yml | 101 ---------------------------- .github/workflows/Rust.yml | 109 ------------------------------- 6 files changed, 425 deletions(-) delete mode 100644 .github/dependabot.yml delete mode 100644 .github/workflows/Dependabot.yml delete mode 100644 .github/workflows/GitHub.yml delete mode 100644 .github/workflows/NPM.yml delete mode 100644 .github/workflows/Node.yml delete mode 100644 .github/workflows/Rust.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index f02ca757..00000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,38 +0,0 @@ -version: 2 -enable-beta-ecosystems: true - -updates: - - package-ecosystem: "github-actions" - directory: "/" - schedule: - interval: "daily" - - - package-ecosystem: "cargo" - directory: "/" - schedule: - interval: "daily" - versioning-strategy: lockfile-only - - - package-ecosystem: "cargo" - directory: "/fuzz" - schedule: - interval: "daily" - versioning-strategy: lockfile-only - - - package-ecosystem: "cargo" - directory: "/napi" - schedule: - interval: "daily" - versioning-strategy: lockfile-only - - - package-ecosystem: "npm" - directory: "/npm" - schedule: - interval: "daily" - versioning-strategy: increase - - - package-ecosystem: "npm" - directory: "/" - schedule: - interval: "daily" - versioning-strategy: increase diff --git a/.github/workflows/Dependabot.yml b/.github/workflows/Dependabot.yml deleted file mode 100644 index 387fece7..00000000 --- a/.github/workflows/Dependabot.yml +++ /dev/null @@ -1,45 +0,0 @@ -name: Dependabot - -concurrency: - group: Dependabot-${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -permissions: - security-events: write - contents: write - pull-requests: write - -on: - workflow_dispatch: - pull_request: - -jobs: - Approve: - runs-on: ubuntu-latest - - if: ${{ github.actor == 'dependabot[bot]' }} - - steps: - - uses: dependabot/fetch-metadata@v2.2.0 - with: - github-token: "${{ secrets.GITHUB_TOKEN }}" - - - run: gh pr review --approve "$PR_URL" - env: - PR_URL: ${{github.event.pull_request.html_url}} - GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} - - Merge: - runs-on: ubuntu-latest - - if: ${{ github.actor == 'dependabot[bot]' }} - - steps: - - uses: dependabot/fetch-metadata@v2.2.0 - with: - github-token: "${{ secrets.GITHUB_TOKEN }}" - - - run: gh pr merge --auto --merge "$PR_URL" - env: - PR_URL: ${{github.event.pull_request.html_url}} - GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} diff --git a/.github/workflows/GitHub.yml b/.github/workflows/GitHub.yml deleted file mode 100644 index 7b1e399c..00000000 --- a/.github/workflows/GitHub.yml +++ /dev/null @@ -1,58 +0,0 @@ -name: GitHub - -concurrency: - group: GitHub-${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -permissions: - issues: write - pull-requests: write - -on: - issues: - types: [opened] - pull_request: - types: [opened] - -jobs: - Assign: - runs-on: ubuntu-latest - - env: - ADBLOCK: true - ASTRO_TELEMETRY_DISABLED: 1 - AUTOMATEDLAB_TELEMETRY_OPTOUT: 1 - AZURE_CORE_COLLECT_TELEMETRY: 0 - CHOOSENIM_NO_ANALYTICS: 1 - DIEZ_DO_NOT_TRACK: 1 - DOTNET_CLI_TELEMETRY_OPTOUT: 1 - DOTNET_INTERACTIVE_CLI_TELEMETRY_OPTOUT: 1 - DO_NOT_TRACK: 1 - ET_NO_TELEMETRY: 1 - GATSBY_TELEMETRY_DISABLED: 1 - GATSBY_TELEMETRY_OPTOUT: 1 - GATSBY_TELEMETRY_OPT_OUT: 1 - GRIT_TELEMETRY_DISABLED: 1 - HASURA_GRAPHQL_ENABLE_TELEMETRY: false - HINT_TELEMETRY: off - HOMEBREW_NO_ANALYTICS: 1 - INFLUXD_REPORTING_DISABLED: true - ITERATIVE_DO_NOT_TRACK: 1 - NEXT_TELEMETRY_DEBUG: 1 - NEXT_TELEMETRY_DISABLED: 1 - NG_CLI_ANALYTICS: false - NUXT_TELEMETRY_DISABLED: 1 - PIN_DO_NOT_TRACK: 1 - POWERSHELL_TELEMETRY_OPTOUT: 1 - SAM_CLI_TELEMETRY: 0 - STNOUPGRADE: 1 - STRIPE_CLI_TELEMETRY_OPTOUT: 1 - TELEMETRY_DISABLED: 1 - TERRAFORM_TELEMETRY: 0 - - steps: - - uses: pozil/auto-assign-issue@v2.0.0 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - assignees: NikolaRHristov - numOfAssignee: 1 diff --git a/.github/workflows/NPM.yml b/.github/workflows/NPM.yml deleted file mode 100644 index a3c48117..00000000 --- a/.github/workflows/NPM.yml +++ /dev/null @@ -1,74 +0,0 @@ -name: NPM - -concurrency: - group: NPM-${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -permissions: - security-events: write - contents: write - pull-requests: write - -on: - workflow_dispatch: - release: - types: [created] - workflow_call: - -jobs: - Publish: - runs-on: ubuntu-latest - - env: - ADBLOCK: true - ASTRO_TELEMETRY_DISABLED: 1 - AUTOMATEDLAB_TELEMETRY_OPTOUT: 1 - AZURE_CORE_COLLECT_TELEMETRY: 0 - CHOOSENIM_NO_ANALYTICS: 1 - DIEZ_DO_NOT_TRACK: 1 - DOTNET_CLI_TELEMETRY_OPTOUT: 1 - DOTNET_INTERACTIVE_CLI_TELEMETRY_OPTOUT: 1 - DO_NOT_TRACK: 1 - ET_NO_TELEMETRY: 1 - GATSBY_TELEMETRY_DISABLED: 1 - GATSBY_TELEMETRY_OPTOUT: 1 - GATSBY_TELEMETRY_OPT_OUT: 1 - GRIT_TELEMETRY_DISABLED: 1 - HASURA_GRAPHQL_ENABLE_TELEMETRY: false - HINT_TELEMETRY: off - HOMEBREW_NO_ANALYTICS: 1 - INFLUXD_REPORTING_DISABLED: true - ITERATIVE_DO_NOT_TRACK: 1 - NEXT_TELEMETRY_DEBUG: 1 - NEXT_TELEMETRY_DISABLED: 1 - NG_CLI_ANALYTICS: false - NUXT_TELEMETRY_DISABLED: 1 - PIN_DO_NOT_TRACK: 1 - POWERSHELL_TELEMETRY_OPTOUT: 1 - SAM_CLI_TELEMETRY: 0 - STNOUPGRADE: 1 - STRIPE_CLI_TELEMETRY_OPTOUT: 1 - TELEMETRY_DISABLED: 1 - TERRAFORM_TELEMETRY: 0 - - permissions: - contents: read - id-token: write - - steps: - - uses: actions/checkout@v4.1.7 - - - uses: actions/setup-node@v4.0.3 - with: - node-version: "18" - registry-url: "https://registry.npmjs.org" - - - run: npm install -g npm - - - name: Publish . - continue-on-error: true - working-directory: . - run: | - npm publish --legacy-peer-deps --provenance --ignore-scripts - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/Node.yml b/.github/workflows/Node.yml deleted file mode 100644 index 7cd17cd2..00000000 --- a/.github/workflows/Node.yml +++ /dev/null @@ -1,101 +0,0 @@ -name: Node - -concurrency: - group: Node-${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -permissions: - security-events: write - contents: write - pull-requests: write - -on: - workflow_dispatch: - push: - branches: [Current] - pull_request: - branches: [Current] - workflow_call: - -jobs: - Pre-Publish: - runs-on: ubuntu-latest - - env: - ADBLOCK: true - ASTRO_TELEMETRY_DISABLED: 1 - AUTOMATEDLAB_TELEMETRY_OPTOUT: 1 - AZURE_CORE_COLLECT_TELEMETRY: 0 - CHOOSENIM_NO_ANALYTICS: 1 - DIEZ_DO_NOT_TRACK: 1 - DOTNET_CLI_TELEMETRY_OPTOUT: 1 - DOTNET_INTERACTIVE_CLI_TELEMETRY_OPTOUT: 1 - DO_NOT_TRACK: 1 - ET_NO_TELEMETRY: 1 - GATSBY_TELEMETRY_DISABLED: 1 - GATSBY_TELEMETRY_OPTOUT: 1 - GATSBY_TELEMETRY_OPT_OUT: 1 - GRIT_TELEMETRY_DISABLED: 1 - HASURA_GRAPHQL_ENABLE_TELEMETRY: false - HINT_TELEMETRY: off - HOMEBREW_NO_ANALYTICS: 1 - INFLUXD_REPORTING_DISABLED: true - ITERATIVE_DO_NOT_TRACK: 1 - NEXT_TELEMETRY_DEBUG: 1 - NEXT_TELEMETRY_DISABLED: 1 - NG_CLI_ANALYTICS: false - NUXT_TELEMETRY_DISABLED: 1 - PIN_DO_NOT_TRACK: 1 - POWERSHELL_TELEMETRY_OPTOUT: 1 - SAM_CLI_TELEMETRY: 0 - STNOUPGRADE: 1 - STRIPE_CLI_TELEMETRY_OPTOUT: 1 - TELEMETRY_DISABLED: 1 - TERRAFORM_TELEMETRY: 0 - - strategy: - matrix: - node-version: [18, 19, 20] - - steps: - - uses: actions/checkout@v4.1.7 - - - uses: pnpm/action-setup@v4.0.0 - with: - version: 9.3.0 - run_install: | - - recursive: true - args: [ - --link-workspace-packages=true, - --lockfile-only, - --prefer-frozen-lockfile=false, - --shamefully-hoist=false, - --shared-workspace-lockfile=true, - --strict-peer-dependencies=false, - --unsafe-perm=true - ] - - - uses: actions/setup-node@v4.0.3 - with: - node-version: ${{ matrix.node-version }} - cache: "pnpm" - cache-dependency-path: ./pnpm-lock.yaml - - - run: pnpm install - working-directory: . - - - run: pnpm run build - working-directory: . - - - uses: actions/upload-artifact@v4.3.6 - with: - name: .-Node-${{ matrix.node-version }}-Target - path: ./Target - - - run: pnpm run prepublishOnly - working-directory: . - - - uses: actions/upload-artifact@v4.3.6 - with: - name: .-Node-${{ matrix.node-version }}-Target - path: ./Target diff --git a/.github/workflows/Rust.yml b/.github/workflows/Rust.yml deleted file mode 100644 index a12666e2..00000000 --- a/.github/workflows/Rust.yml +++ /dev/null @@ -1,109 +0,0 @@ -name: Rust - -concurrency: - group: Rust-${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -permissions: - security-events: write - -on: - workflow_dispatch: - push: - branches: [Current] - pull_request: - branches: [Current] - workflow_call: - -jobs: - Build: - runs-on: ubuntu-latest - - env: - ADBLOCK: true - ASTRO_TELEMETRY_DISABLED: 1 - AUTOMATEDLAB_TELEMETRY_OPTOUT: 1 - AZURE_CORE_COLLECT_TELEMETRY: 0 - CHOOSENIM_NO_ANALYTICS: 1 - DIEZ_DO_NOT_TRACK: 1 - DOTNET_CLI_TELEMETRY_OPTOUT: 1 - DOTNET_INTERACTIVE_CLI_TELEMETRY_OPTOUT: 1 - DO_NOT_TRACK: 1 - ET_NO_TELEMETRY: 1 - GATSBY_TELEMETRY_DISABLED: 1 - GATSBY_TELEMETRY_OPTOUT: 1 - GATSBY_TELEMETRY_OPT_OUT: 1 - GRIT_TELEMETRY_DISABLED: 1 - HASURA_GRAPHQL_ENABLE_TELEMETRY: false - HINT_TELEMETRY: off - HOMEBREW_NO_ANALYTICS: 1 - INFLUXD_REPORTING_DISABLED: true - ITERATIVE_DO_NOT_TRACK: 1 - NEXT_TELEMETRY_DEBUG: 1 - NEXT_TELEMETRY_DISABLED: 1 - NG_CLI_ANALYTICS: false - NUXT_TELEMETRY_DISABLED: 1 - PIN_DO_NOT_TRACK: 1 - POWERSHELL_TELEMETRY_OPTOUT: 1 - SAM_CLI_TELEMETRY: 0 - STNOUPGRADE: 1 - STRIPE_CLI_TELEMETRY_OPTOUT: 1 - TELEMETRY_DISABLED: 1 - TERRAFORM_TELEMETRY: 0 - - strategy: - matrix: - toolchain: ["stable", "nightly"] - - steps: - - uses: actions/checkout@v4.1.7 - - - uses: actions-rs/toolchain@v1.0.7 - with: - profile: minimal - toolchain: ${{ matrix.toolchain }} - - - uses: actions/cache@v4.0.2 - with: - path: | - ~/.cargo/bin/ - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - target/ - Target/ - key: ${{ runner.os }}-cargo-${{ hashFiles('./Cargo.toml') }} - - uses: actions-rs/cargo@v1.0.3 - with: - command: build - args: --release --all-features --manifest-path ./Cargo.toml - - - uses: actions/cache@v4.0.2 - with: - path: | - ~/.cargo/bin/ - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - target/ - Target/ - key: ${{ runner.os }}-cargo-${{ hashFiles('./fuzz/Cargo.toml') }} - - uses: actions-rs/cargo@v1.0.3 - with: - command: build - args: --release --all-features --manifest-path ./fuzz/Cargo.toml - - - uses: actions/cache@v4.0.2 - with: - path: | - ~/.cargo/bin/ - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - target/ - Target/ - key: ${{ runner.os }}-cargo-${{ hashFiles('./napi/Cargo.toml') }} - - uses: actions-rs/cargo@v1.0.3 - with: - command: build - args: --release --all-features --manifest-path ./napi/Cargo.toml From c801eb80fa50e17603748208c1c5c8e193eab86a Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Sun, 25 Aug 2024 06:37:57 +0300 Subject: [PATCH 56/82] --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index ee5f3b69..f351811c 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "devDependencies": { "@napi-rs/cli": "3.0.0-alpha.62", "@napi-rs/wasm-runtime": "0.2.4", - "@types/node": "22.4.0", + "@types/node": "22.5.0", "ava": "6.1.3", "emnapi": "1.2.0" }, From ce1e3b60c3719cbf3b54217bcddab2331c697e72 Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Mon, 26 Aug 2024 04:12:54 +0300 Subject: [PATCH 57/82] --- .github/workflows/ci.yml | 196 ------ Cargo.lock | 1319 -------------------------------------- 2 files changed, 1515 deletions(-) delete mode 100644 .github/workflows/ci.yml delete mode 100644 Cargo.lock diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index 3c213d01..00000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,196 +0,0 @@ -name: CI - -on: - workflow_dispatch: - pull_request: - types: [opened, synchronize] - paths-ignore: - - '**/*.md' - - '!.github/workflows/ci.yml' - push: - branches: - - main - - "renovate/**" - paths-ignore: - - '**/*.md' - - '!.github/workflows/ci.yml' - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} - cancel-in-progress: ${{ github.ref_name != 'main' }} - -defaults: - run: - shell: bash - -jobs: - cache: # Warm cache factory for all other CI jobs - name: Check and Build - strategy: - fail-fast: true - matrix: - include: - - os: windows-latest - - os: ubuntu-latest - - os: macos-14 - runs-on: ${{ matrix.os }} - steps: - - uses: taiki-e/checkout-action@v1 - - - uses: Boshen/setup-rust@main - with: - save-cache: ${{ github.ref_name == 'main' }} - cache-key: warm - - - run: cargo check --all-features --locked - - # Only need to build the test to create a warm cache on the main branch - - name: Build cache by Cargo Check and Cargo Test - if: ${{ github.ref_name == 'main' }} - run: cargo test --all-features --no-run - - wasm: - name: Check Wasm - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - - uses: Boshen/setup-rust@main - with: - cache-key: wasm - save-cache: ${{ github.ref_name == 'main' }} - - - name: Check - run: | - rustup target add wasm32-unknown-unknown - cargo check --all-features --target wasm32-unknown-unknown - - wasi: - name: Test wasi target - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - - uses: Boshen/setup-rust@main - with: - cache-key: wasi - save-cache: ${{ github.ref_name == 'main' }} - - - uses: ./.github/actions/pnpm - - - name: Build - run: | - rustup target add wasm32-wasip1-threads - pnpm build --target wasm32-wasip1-threads - - - name: Test - run: pnpm test - env: - WASI_TEST: 1 - - typos: - name: Spell Check - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - - uses: crate-ci/typos@v1.24.1 - with: - files: . - - deny: - name: Cargo Deny - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - - uses: dorny/paths-filter@v3 - id: filter - with: - filters: | - src: - - 'Cargo.lock' - - - uses: Boshen/setup-rust@main - with: - restore-cache: false - tools: cargo-deny - - - if: steps.filter.outputs.src == 'true' - run: cargo deny check - - unused-deps: - name: Check Unused Dependencies - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - uses: dorny/paths-filter@v3 - id: filter - with: - filters: | - src: - - '**/*.rs' - - '**/Cargo.toml' - - 'Cargo.lock' - - uses: Boshen/setup-rust@main - with: - restore-cache: false - if: steps.filter.outputs.src == 'true' - - uses: cargo-bins/cargo-binstall@main - if: steps.filter.outputs.src == 'true' - - run: cargo binstall --no-confirm cargo-shear@1 - if: steps.filter.outputs.src == 'true' - - run: cargo shear - if: steps.filter.outputs.src == 'true' - - format: - name: Format - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - uses: Boshen/setup-rust@main - with: - components: rustfmt - restore-cache: false - - run: cargo fmt --all -- --check - - lint: - name: Clippy - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - uses: Boshen/setup-rust@main - with: - components: clippy - - run: cargo clippy --all-features -- -D warnings - - doc: - name: Doc - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - uses: Boshen/setup-rust@main - with: - components: rust-docs - - run: RUSTDOCFLAGS='-D warnings' cargo doc --no-deps --all-features - - test: - name: Test - strategy: - fail-fast: true - matrix: - include: - - os: windows-latest - - os: ubuntu-latest - - os: macos-14 - runs-on: ${{ matrix.os }} - env: - RUST_BACKTRACE: 1 - steps: - - uses: taiki-e/checkout-action@v1 - - uses: ./.github/actions/pnpm - - uses: Boshen/setup-rust@main - with: - cache-key: warm - - run: cargo test --doc - - run: cargo test --all-features diff --git a/Cargo.lock b/Cargo.lock deleted file mode 100644 index eb1b4d92..00000000 --- a/Cargo.lock +++ /dev/null @@ -1,1319 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "adler" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" - -[[package]] -name = "aho-corasick" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" -dependencies = [ - "memchr", -] - -[[package]] -name = "android-tzdata" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" - -[[package]] -name = "android_system_properties" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" -dependencies = [ - "libc", -] - -[[package]] -name = "anes" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "735d4f398ca57cfa2880225c2bf81c3b9af3be5bb22e44ae70118dad38713e84" - -[[package]] -name = "arca" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f915ddd863ef73f11c10c75170e86db1d4f539689bc6bfb9ce25d6528d6fe83" -dependencies = [ - "clean-path", - "path-slash", - "radix_trie", -] - -[[package]] -name = "autocfg" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" - -[[package]] -name = "base64" -version = "0.22.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" - -[[package]] -name = "bit-set" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1" -dependencies = [ - "bit-vec", -] - -[[package]] -name = "bit-vec" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "bitflags" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" - -[[package]] -name = "bpaf" -version = "0.9.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3280efcf6d66bc77c2cf9b67dc8acee47a217d9be67dd590b3230dffe663724d" - -[[package]] -name = "bumpalo" -version = "3.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" - -[[package]] -name = "byteorder" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" - -[[package]] -name = "cast" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" - -[[package]] -name = "cc" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eaff6f8ce506b9773fa786672d63fc7a191ffea1be33f72bbd4aeacefca9ffc8" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "chrono" -version = "0.4.38" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" -dependencies = [ - "android-tzdata", - "iana-time-zone", - "num-traits", - "serde", - "windows-targets 0.52.6", -] - -[[package]] -name = "ciborium" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42e69ffd6f0917f5c029256a24d0161db17cea3997d185db0d35926308770f0e" -dependencies = [ - "ciborium-io", - "ciborium-ll", - "serde", -] - -[[package]] -name = "ciborium-io" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05afea1e0a06c9be33d539b876f1ce3692f4afea2cb41f740e7743225ed1c757" - -[[package]] -name = "ciborium-ll" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57663b653d948a338bfb3eeba9bb2fd5fcfaecb9e199e87e1eda4d9e8b240fd9" -dependencies = [ - "ciborium-io", - "half", -] - -[[package]] -name = "clean-path" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aaa6b4b263a5d737e9bf6b7c09b72c41a5480aec4d7219af827f6564e950b6a5" - -[[package]] -name = "codspeed" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a104ac948e0188b921eb3fcbdd55dcf62e542df4c7ab7e660623f6288302089" -dependencies = [ - "colored", - "libc", - "serde_json", -] - -[[package]] -name = "colored" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbf2150cce219b664a8a70df7a1f933836724b503f8a413af9365b4dcc4d90b8" -dependencies = [ - "lazy_static", - "windows-sys 0.48.0", -] - -[[package]] -name = "concurrent_lru" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7feb5cb312f774e8a24540e27206db4e890f7d488563671d24a16389cf4c2e4e" -dependencies = [ - "once_cell", -] - -[[package]] -name = "convert_case" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec182b0ca2f35d8fc196cf3404988fd8b8c739a4d270ff118a398feb0cbec1ca" -dependencies = [ - "unicode-segmentation", -] - -[[package]] -name = "core-foundation-sys" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" - -[[package]] -name = "criterion2" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8df39381f28ced0ceebfb5611528d99aef14f8d75b43e9d4ceb6aba66e7b04d" -dependencies = [ - "anes", - "bpaf", - "cast", - "ciborium", - "codspeed", - "colored", - "num-traits", - "oorandom", - "serde", - "serde_json", - "walkdir", -] - -[[package]] -name = "crossbeam-deque" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" -dependencies = [ - "crossbeam-epoch", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.9.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" -dependencies = [ - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" - -[[package]] -name = "crunchy" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" - -[[package]] -name = "ctor" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edb49164822f3ee45b17acd4a208cfc1251410cf0cad9a833234c9890774dd9f" -dependencies = [ - "quote", - "syn", -] - -[[package]] -name = "darling" -version = "0.20.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" -dependencies = [ - "darling_core", - "darling_macro", -] - -[[package]] -name = "darling_core" -version = "0.20.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95133861a8032aaea082871032f5815eb9e98cef03fa916ab4500513994df9e5" -dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "strsim", - "syn", -] - -[[package]] -name = "darling_macro" -version = "0.20.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" -dependencies = [ - "darling_core", - "quote", - "syn", -] - -[[package]] -name = "dashmap" -version = "6.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "804c8821570c3f8b70230c2ba75ffa5c0f9a4189b9a432b6656c536712acae28" -dependencies = [ - "cfg-if", - "crossbeam-utils", - "hashbrown 0.14.5", - "lock_api", - "once_cell", - "parking_lot_core", -] - -[[package]] -name = "deranged" -version = "0.3.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" -dependencies = [ - "powerfmt", - "serde", -] - -[[package]] -name = "document-features" -version = "0.2.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb6969eaabd2421f8a2775cfd2471a2b634372b4a25d41e3bd647b79912850a0" -dependencies = [ - "litrs", -] - -[[package]] -name = "dunce" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" - -[[package]] -name = "either" -version = "1.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" - -[[package]] -name = "endian-type" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" - -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "fancy-regex" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "531e46835a22af56d1e3b66f04844bed63158bc094a628bec1d321d9b4c44bf2" -dependencies = [ - "bit-set", - "regex-automata", - "regex-syntax", -] - -[[package]] -name = "filetime" -version = "0.2.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ee447700ac8aa0b2f2bd7bc4462ad686ba06baa6727ac149a2d6277f0d240fd" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall 0.4.1", - "windows-sys 0.52.0", -] - -[[package]] -name = "fnv" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" - -[[package]] -name = "half" -version = "2.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dd08c532ae367adf81c312a4580bc67f1d0fe8bc9c460520283f4c0ff277888" -dependencies = [ - "cfg-if", - "crunchy", -] - -[[package]] -name = "hashbrown" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" - -[[package]] -name = "hashbrown" -version = "0.14.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "iana-time-zone" -version = "0.1.60" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" -dependencies = [ - "android_system_properties", - "core-foundation-sys", - "iana-time-zone-haiku", - "js-sys", - "wasm-bindgen", - "windows-core", -] - -[[package]] -name = "iana-time-zone-haiku" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" -dependencies = [ - "cc", -] - -[[package]] -name = "ident_case" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" - -[[package]] -name = "indexmap" -version = "1.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" -dependencies = [ - "autocfg", - "hashbrown 0.12.3", - "serde", -] - -[[package]] -name = "indexmap" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93ead53efc7ea8ed3cfb0c79fc8023fbb782a5432b52830b6518941cebe6505c" -dependencies = [ - "equivalent", - "hashbrown 0.14.5", - "serde", -] - -[[package]] -name = "itoa" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" - -[[package]] -name = "js-sys" -version = "0.3.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" -dependencies = [ - "wasm-bindgen", -] - -[[package]] -name = "json-strip-comments" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b271732a960335e715b6b2ae66a086f115c74eb97360e996d2bd809bfc063bba" -dependencies = [ - "memchr", -] - -[[package]] -name = "lazy_static" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" - -[[package]] -name = "libc" -version = "0.2.155" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" - -[[package]] -name = "libloading" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e310b3a6b5907f99202fcdb4960ff45b93735d7c7d96b760fcff8db2dc0e103d" -dependencies = [ - "cfg-if", - "windows-targets 0.52.6", -] - -[[package]] -name = "litrs" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4ce301924b7887e9d637144fdade93f9dfff9b60981d4ac161db09720d39aa5" - -[[package]] -name = "lock_api" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" -dependencies = [ - "autocfg", - "scopeguard", -] - -[[package]] -name = "log" -version = "0.4.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" - -[[package]] -name = "memchr" -version = "2.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" - -[[package]] -name = "miniz_oxide" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" -dependencies = [ - "adler", -] - -[[package]] -name = "napi" -version = "3.0.0-alpha.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ec04344cc540f5897e97c9821ab99e7eb276b4dca6f3e6e441dfa72e5bcde70" -dependencies = [ - "bitflags 2.6.0", - "ctor", - "napi-build", - "napi-sys", - "once_cell", - "serde", - "serde_json", -] - -[[package]] -name = "napi-build" -version = "2.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1c0f5d67ee408a4685b61f5ab7e58605c8ae3f2b4189f0127d804ff13d5560a" - -[[package]] -name = "napi-derive" -version = "3.0.0-alpha.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c6240c4ddca592cde608bbfa26e2af397c3596e413a0c65c9bbcb65c2f1e485" -dependencies = [ - "cfg-if", - "convert_case", - "napi-derive-backend", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "napi-derive-backend" -version = "2.0.0-alpha.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b32dcc50065508fe2f387076c17adbdf10e038d1c080d48b10196813d94ac6a8" -dependencies = [ - "convert_case", - "once_cell", - "proc-macro2", - "quote", - "regex", - "semver", - "syn", -] - -[[package]] -name = "napi-sys" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "427802e8ec3a734331fec1035594a210ce1ff4dc5bc1950530920ab717964ea3" -dependencies = [ - "libloading", -] - -[[package]] -name = "nibble_vec" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" -dependencies = [ - "smallvec", -] - -[[package]] -name = "normalize-path" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5438dd2b2ff4c6df6e1ce22d825ed2fa93ee2922235cc45186991717f0a892d" - -[[package]] -name = "num-conv" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" - -[[package]] -name = "num-traits" -version = "0.2.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" -dependencies = [ - "autocfg", -] - -[[package]] -name = "once_cell" -version = "1.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" - -[[package]] -name = "oorandom" -version = "11.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b410bbe7e14ab526a0e86877eb47c6996a2bd7746f027ba551028c925390e4e9" - -[[package]] -name = "oxc_napi_resolver" -version = "0.0.0" -dependencies = [ - "napi", - "napi-build", - "napi-derive", - "oxc_resolver", - "tracing-subscriber", -] - -[[package]] -name = "oxc_resolver" -version = "1.10.2" -dependencies = [ - "cfg-if", - "criterion2", - "dashmap", - "document-features", - "dunce", - "indexmap 2.4.0", - "json-strip-comments", - "normalize-path", - "once_cell", - "pnp", - "rayon", - "rustc-hash", - "serde", - "serde_json", - "thiserror", - "tracing", - "vfs", -] - -[[package]] -name = "parking_lot_core" -version = "0.9.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall 0.5.2", - "smallvec", - "windows-targets 0.52.6", -] - -[[package]] -name = "path-slash" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e91099d4268b0e11973f036e885d652fb0b21fedcf69738c627f94db6a44f42" - -[[package]] -name = "pathdiff" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8835116a5c179084a830efb3adc117ab007512b535bc1a21c991d3b32a6b44dd" - -[[package]] -name = "pin-project-lite" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" - -[[package]] -name = "pnp" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46770cee76a618023fea15411d0449dd066dc232cc17e4562f154da215f27af7" -dependencies = [ - "arca", - "byteorder", - "concurrent_lru", - "fancy-regex", - "lazy_static", - "miniz_oxide", - "pathdiff", - "regex", - "serde", - "serde_json", - "serde_with", - "thiserror", -] - -[[package]] -name = "powerfmt" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" - -[[package]] -name = "proc-macro2" -version = "1.0.86" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.36" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "radix_trie" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" -dependencies = [ - "endian-type", - "nibble_vec", -] - -[[package]] -name = "rayon" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" -dependencies = [ - "either", - "rayon-core", -] - -[[package]] -name = "rayon-core" -version = "1.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" -dependencies = [ - "crossbeam-deque", - "crossbeam-utils", -] - -[[package]] -name = "redox_syscall" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" -dependencies = [ - "bitflags 1.3.2", -] - -[[package]] -name = "redox_syscall" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c82cf8cff14456045f55ec4241383baeff27af886adb72ffb2162f99911de0fd" -dependencies = [ - "bitflags 2.6.0", -] - -[[package]] -name = "regex" -version = "1.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b91213439dad192326a0d7c6ee3955910425f441d7038e0d6933b0aec5c4517f" -dependencies = [ - "aho-corasick", - "memchr", - "regex-automata", - "regex-syntax", -] - -[[package]] -name = "regex-automata" -version = "0.4.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", -] - -[[package]] -name = "regex-syntax" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" - -[[package]] -name = "rustc-hash" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" - -[[package]] -name = "ryu" -version = "1.0.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" - -[[package]] -name = "same-file" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "scopeguard" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" - -[[package]] -name = "semver" -version = "1.0.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" - -[[package]] -name = "serde" -version = "1.0.209" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99fce0ffe7310761ca6bf9faf5115afbc19688edd00171d81b1bb1b116c63e09" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.209" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5831b979fd7b5439637af1752d535ff49f4860c0f341d1baeb6faf0f4242170" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "serde_json" -version = "1.0.127" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8043c06d9f82bd7271361ed64f415fe5e12a77fdb52e573e7f06a516dea329ad" -dependencies = [ - "indexmap 2.4.0", - "itoa", - "memchr", - "ryu", - "serde", -] - -[[package]] -name = "serde_with" -version = "3.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e73139bc5ec2d45e6c5fd85be5a46949c1c39a4c18e56915f5eb4c12f975e377" -dependencies = [ - "base64", - "chrono", - "hex", - "indexmap 1.9.3", - "indexmap 2.4.0", - "serde", - "serde_derive", - "serde_json", - "serde_with_macros", - "time", -] - -[[package]] -name = "serde_with_macros" -version = "3.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b80d3d6b56b64335c0180e5ffde23b3c5e08c14c585b51a15bd0e95393f46703" -dependencies = [ - "darling", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "sharded-slab" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" -dependencies = [ - "lazy_static", -] - -[[package]] -name = "smallvec" -version = "1.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" - -[[package]] -name = "strsim" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" - -[[package]] -name = "syn" -version = "2.0.70" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f0209b68b3613b093e0ec905354eccaedcfe83b8cb37cbdeae64026c3064c16" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "thiserror" -version = "1.0.63" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.63" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "thread_local" -version = "1.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" -dependencies = [ - "cfg-if", - "once_cell", -] - -[[package]] -name = "time" -version = "0.3.36" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" -dependencies = [ - "deranged", - "itoa", - "num-conv", - "powerfmt", - "serde", - "time-core", - "time-macros", -] - -[[package]] -name = "time-core" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" - -[[package]] -name = "time-macros" -version = "0.2.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" -dependencies = [ - "num-conv", - "time-core", -] - -[[package]] -name = "tracing" -version = "0.1.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" -dependencies = [ - "pin-project-lite", - "tracing-attributes", - "tracing-core", -] - -[[package]] -name = "tracing-attributes" -version = "0.1.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "tracing-core" -version = "0.1.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" -dependencies = [ - "once_cell", -] - -[[package]] -name = "tracing-subscriber" -version = "0.3.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" -dependencies = [ - "sharded-slab", - "thread_local", - "tracing-core", -] - -[[package]] -name = "unicode-ident" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" - -[[package]] -name = "unicode-segmentation" -version = "1.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" - -[[package]] -name = "vfs" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "654cd097e182a71dbf899178e6b5662c2157dd0b8afd5975de18008f6fc173d1" -dependencies = [ - "filetime", -] - -[[package]] -name = "walkdir" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" -dependencies = [ - "same-file", - "winapi-util", -] - -[[package]] -name = "wasm-bindgen" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" -dependencies = [ - "cfg-if", - "wasm-bindgen-macro", -] - -[[package]] -name = "wasm-bindgen-backend" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" -dependencies = [ - "bumpalo", - "log", - "once_cell", - "proc-macro2", - "quote", - "syn", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-macro" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" -dependencies = [ - "quote", - "wasm-bindgen-macro-support", -] - -[[package]] -name = "wasm-bindgen-macro-support" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" -dependencies = [ - "proc-macro2", - "quote", - "syn", - "wasm-bindgen-backend", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-shared" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" - -[[package]] -name = "winapi-util" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b" -dependencies = [ - "windows-sys 0.52.0", -] - -[[package]] -name = "windows-core" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" -dependencies = [ - "windows-targets 0.52.6", -] - -[[package]] -name = "windows-sys" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" -dependencies = [ - "windows-targets 0.48.5", -] - -[[package]] -name = "windows-sys" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" -dependencies = [ - "windows-targets 0.52.6", -] - -[[package]] -name = "windows-targets" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" -dependencies = [ - "windows_aarch64_gnullvm 0.48.5", - "windows_aarch64_msvc 0.48.5", - "windows_i686_gnu 0.48.5", - "windows_i686_msvc 0.48.5", - "windows_x86_64_gnu 0.48.5", - "windows_x86_64_gnullvm 0.48.5", - "windows_x86_64_msvc 0.48.5", -] - -[[package]] -name = "windows-targets" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" -dependencies = [ - "windows_aarch64_gnullvm 0.52.6", - "windows_aarch64_msvc 0.52.6", - "windows_i686_gnu 0.52.6", - "windows_i686_gnullvm", - "windows_i686_msvc 0.52.6", - "windows_x86_64_gnu 0.52.6", - "windows_x86_64_gnullvm 0.52.6", - "windows_x86_64_msvc 0.52.6", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" - -[[package]] -name = "windows_i686_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" - -[[package]] -name = "windows_i686_gnu" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" - -[[package]] -name = "windows_i686_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" - -[[package]] -name = "windows_i686_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" - -[[package]] -name = "windows_i686_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" From d87f5b320c8f6b849660ab9f8d69bf10f21013c4 Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Mon, 26 Aug 2024 08:48:26 +0300 Subject: [PATCH 58/82] --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index f351811c..0bfd3847 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ ] }, "devDependencies": { - "@napi-rs/cli": "3.0.0-alpha.62", + "@napi-rs/cli": "2.18.4", "@napi-rs/wasm-runtime": "0.2.4", "@types/node": "22.5.0", "ava": "6.1.3", From 324ed1b164427a3a87551042a5680e19e768ddd1 Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Tue, 27 Aug 2024 07:11:05 +0300 Subject: [PATCH 59/82] --- napi/{Source => src}/lib.rs | 0 napi/{Source => src}/options.rs | 0 napi/{Source => src}/tracing.rs | 0 {Source => src}/builtins.rs | 0 {Source => src}/cache.rs | 0 {Source => src}/context.rs | 0 {Source => src}/error.rs | 0 {Source => src}/file_system.rs | 0 {Source => src}/lib.rs | 0 {Source => src}/options.rs | 0 {Source => src}/package_json.rs | 0 {Source => src}/path.rs | 0 {Source => src}/resolution.rs | 0 {Source => src}/specifier.rs | 0 {Source => src}/tsconfig.rs | 0 15 files changed, 0 insertions(+), 0 deletions(-) rename napi/{Source => src}/lib.rs (100%) rename napi/{Source => src}/options.rs (100%) rename napi/{Source => src}/tracing.rs (100%) rename {Source => src}/builtins.rs (100%) rename {Source => src}/cache.rs (100%) rename {Source => src}/context.rs (100%) rename {Source => src}/error.rs (100%) rename {Source => src}/file_system.rs (100%) rename {Source => src}/lib.rs (100%) rename {Source => src}/options.rs (100%) rename {Source => src}/package_json.rs (100%) rename {Source => src}/path.rs (100%) rename {Source => src}/resolution.rs (100%) rename {Source => src}/specifier.rs (100%) rename {Source => src}/tsconfig.rs (100%) diff --git a/napi/Source/lib.rs b/napi/src/lib.rs similarity index 100% rename from napi/Source/lib.rs rename to napi/src/lib.rs diff --git a/napi/Source/options.rs b/napi/src/options.rs similarity index 100% rename from napi/Source/options.rs rename to napi/src/options.rs diff --git a/napi/Source/tracing.rs b/napi/src/tracing.rs similarity index 100% rename from napi/Source/tracing.rs rename to napi/src/tracing.rs diff --git a/Source/builtins.rs b/src/builtins.rs similarity index 100% rename from Source/builtins.rs rename to src/builtins.rs diff --git a/Source/cache.rs b/src/cache.rs similarity index 100% rename from Source/cache.rs rename to src/cache.rs diff --git a/Source/context.rs b/src/context.rs similarity index 100% rename from Source/context.rs rename to src/context.rs diff --git a/Source/error.rs b/src/error.rs similarity index 100% rename from Source/error.rs rename to src/error.rs diff --git a/Source/file_system.rs b/src/file_system.rs similarity index 100% rename from Source/file_system.rs rename to src/file_system.rs diff --git a/Source/lib.rs b/src/lib.rs similarity index 100% rename from Source/lib.rs rename to src/lib.rs diff --git a/Source/options.rs b/src/options.rs similarity index 100% rename from Source/options.rs rename to src/options.rs diff --git a/Source/package_json.rs b/src/package_json.rs similarity index 100% rename from Source/package_json.rs rename to src/package_json.rs diff --git a/Source/path.rs b/src/path.rs similarity index 100% rename from Source/path.rs rename to src/path.rs diff --git a/Source/resolution.rs b/src/resolution.rs similarity index 100% rename from Source/resolution.rs rename to src/resolution.rs diff --git a/Source/specifier.rs b/src/specifier.rs similarity index 100% rename from Source/specifier.rs rename to src/specifier.rs diff --git a/Source/tsconfig.rs b/src/tsconfig.rs similarity index 100% rename from Source/tsconfig.rs rename to src/tsconfig.rs From 8743db90ca32610cef17ad5b2d6eec54c7449c7a Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Tue, 27 Aug 2024 08:42:16 +0300 Subject: [PATCH 60/82] --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1f4df134..68e291b7 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ Rust port of [enhanced-resolve]. * supports in-memory file system via the `FileSystem` trait * contains `tracing` instrumentation -## Usage +## 🛠️ Usage The following usages apply to both Rust and Node.js; the code snippets are written in JavaScript. From f70a6dba155d99d33c991840fa6679f360f66af9 Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Tue, 27 Aug 2024 11:22:54 +0300 Subject: [PATCH 61/82] --- .github/dependabot.yml | 38 +++++++++++ .github/workflows/Dependabot.yml | 45 +++++++++++++ .github/workflows/GitHub.yml | 58 ++++++++++++++++ .github/workflows/NPM.yml | 74 +++++++++++++++++++++ .github/workflows/Node.yml | 101 ++++++++++++++++++++++++++++ .github/workflows/Rust.yml | 109 +++++++++++++++++++++++++++++++ 6 files changed, 425 insertions(+) create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/Dependabot.yml create mode 100644 .github/workflows/GitHub.yml create mode 100644 .github/workflows/NPM.yml create mode 100644 .github/workflows/Node.yml create mode 100644 .github/workflows/Rust.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..f02ca757 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,38 @@ +version: 2 +enable-beta-ecosystems: true + +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "daily" + + - package-ecosystem: "cargo" + directory: "/" + schedule: + interval: "daily" + versioning-strategy: lockfile-only + + - package-ecosystem: "cargo" + directory: "/fuzz" + schedule: + interval: "daily" + versioning-strategy: lockfile-only + + - package-ecosystem: "cargo" + directory: "/napi" + schedule: + interval: "daily" + versioning-strategy: lockfile-only + + - package-ecosystem: "npm" + directory: "/npm" + schedule: + interval: "daily" + versioning-strategy: increase + + - package-ecosystem: "npm" + directory: "/" + schedule: + interval: "daily" + versioning-strategy: increase diff --git a/.github/workflows/Dependabot.yml b/.github/workflows/Dependabot.yml new file mode 100644 index 00000000..387fece7 --- /dev/null +++ b/.github/workflows/Dependabot.yml @@ -0,0 +1,45 @@ +name: Dependabot + +concurrency: + group: Dependabot-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +permissions: + security-events: write + contents: write + pull-requests: write + +on: + workflow_dispatch: + pull_request: + +jobs: + Approve: + runs-on: ubuntu-latest + + if: ${{ github.actor == 'dependabot[bot]' }} + + steps: + - uses: dependabot/fetch-metadata@v2.2.0 + with: + github-token: "${{ secrets.GITHUB_TOKEN }}" + + - run: gh pr review --approve "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} + + Merge: + runs-on: ubuntu-latest + + if: ${{ github.actor == 'dependabot[bot]' }} + + steps: + - uses: dependabot/fetch-metadata@v2.2.0 + with: + github-token: "${{ secrets.GITHUB_TOKEN }}" + + - run: gh pr merge --auto --merge "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} diff --git a/.github/workflows/GitHub.yml b/.github/workflows/GitHub.yml new file mode 100644 index 00000000..7b1e399c --- /dev/null +++ b/.github/workflows/GitHub.yml @@ -0,0 +1,58 @@ +name: GitHub + +concurrency: + group: GitHub-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +permissions: + issues: write + pull-requests: write + +on: + issues: + types: [opened] + pull_request: + types: [opened] + +jobs: + Assign: + runs-on: ubuntu-latest + + env: + ADBLOCK: true + ASTRO_TELEMETRY_DISABLED: 1 + AUTOMATEDLAB_TELEMETRY_OPTOUT: 1 + AZURE_CORE_COLLECT_TELEMETRY: 0 + CHOOSENIM_NO_ANALYTICS: 1 + DIEZ_DO_NOT_TRACK: 1 + DOTNET_CLI_TELEMETRY_OPTOUT: 1 + DOTNET_INTERACTIVE_CLI_TELEMETRY_OPTOUT: 1 + DO_NOT_TRACK: 1 + ET_NO_TELEMETRY: 1 + GATSBY_TELEMETRY_DISABLED: 1 + GATSBY_TELEMETRY_OPTOUT: 1 + GATSBY_TELEMETRY_OPT_OUT: 1 + GRIT_TELEMETRY_DISABLED: 1 + HASURA_GRAPHQL_ENABLE_TELEMETRY: false + HINT_TELEMETRY: off + HOMEBREW_NO_ANALYTICS: 1 + INFLUXD_REPORTING_DISABLED: true + ITERATIVE_DO_NOT_TRACK: 1 + NEXT_TELEMETRY_DEBUG: 1 + NEXT_TELEMETRY_DISABLED: 1 + NG_CLI_ANALYTICS: false + NUXT_TELEMETRY_DISABLED: 1 + PIN_DO_NOT_TRACK: 1 + POWERSHELL_TELEMETRY_OPTOUT: 1 + SAM_CLI_TELEMETRY: 0 + STNOUPGRADE: 1 + STRIPE_CLI_TELEMETRY_OPTOUT: 1 + TELEMETRY_DISABLED: 1 + TERRAFORM_TELEMETRY: 0 + + steps: + - uses: pozil/auto-assign-issue@v2.0.0 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + assignees: NikolaRHristov + numOfAssignee: 1 diff --git a/.github/workflows/NPM.yml b/.github/workflows/NPM.yml new file mode 100644 index 00000000..a3c48117 --- /dev/null +++ b/.github/workflows/NPM.yml @@ -0,0 +1,74 @@ +name: NPM + +concurrency: + group: NPM-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +permissions: + security-events: write + contents: write + pull-requests: write + +on: + workflow_dispatch: + release: + types: [created] + workflow_call: + +jobs: + Publish: + runs-on: ubuntu-latest + + env: + ADBLOCK: true + ASTRO_TELEMETRY_DISABLED: 1 + AUTOMATEDLAB_TELEMETRY_OPTOUT: 1 + AZURE_CORE_COLLECT_TELEMETRY: 0 + CHOOSENIM_NO_ANALYTICS: 1 + DIEZ_DO_NOT_TRACK: 1 + DOTNET_CLI_TELEMETRY_OPTOUT: 1 + DOTNET_INTERACTIVE_CLI_TELEMETRY_OPTOUT: 1 + DO_NOT_TRACK: 1 + ET_NO_TELEMETRY: 1 + GATSBY_TELEMETRY_DISABLED: 1 + GATSBY_TELEMETRY_OPTOUT: 1 + GATSBY_TELEMETRY_OPT_OUT: 1 + GRIT_TELEMETRY_DISABLED: 1 + HASURA_GRAPHQL_ENABLE_TELEMETRY: false + HINT_TELEMETRY: off + HOMEBREW_NO_ANALYTICS: 1 + INFLUXD_REPORTING_DISABLED: true + ITERATIVE_DO_NOT_TRACK: 1 + NEXT_TELEMETRY_DEBUG: 1 + NEXT_TELEMETRY_DISABLED: 1 + NG_CLI_ANALYTICS: false + NUXT_TELEMETRY_DISABLED: 1 + PIN_DO_NOT_TRACK: 1 + POWERSHELL_TELEMETRY_OPTOUT: 1 + SAM_CLI_TELEMETRY: 0 + STNOUPGRADE: 1 + STRIPE_CLI_TELEMETRY_OPTOUT: 1 + TELEMETRY_DISABLED: 1 + TERRAFORM_TELEMETRY: 0 + + permissions: + contents: read + id-token: write + + steps: + - uses: actions/checkout@v4.1.7 + + - uses: actions/setup-node@v4.0.3 + with: + node-version: "18" + registry-url: "https://registry.npmjs.org" + + - run: npm install -g npm + + - name: Publish . + continue-on-error: true + working-directory: . + run: | + npm publish --legacy-peer-deps --provenance --ignore-scripts + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/Node.yml b/.github/workflows/Node.yml new file mode 100644 index 00000000..7cd17cd2 --- /dev/null +++ b/.github/workflows/Node.yml @@ -0,0 +1,101 @@ +name: Node + +concurrency: + group: Node-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +permissions: + security-events: write + contents: write + pull-requests: write + +on: + workflow_dispatch: + push: + branches: [Current] + pull_request: + branches: [Current] + workflow_call: + +jobs: + Pre-Publish: + runs-on: ubuntu-latest + + env: + ADBLOCK: true + ASTRO_TELEMETRY_DISABLED: 1 + AUTOMATEDLAB_TELEMETRY_OPTOUT: 1 + AZURE_CORE_COLLECT_TELEMETRY: 0 + CHOOSENIM_NO_ANALYTICS: 1 + DIEZ_DO_NOT_TRACK: 1 + DOTNET_CLI_TELEMETRY_OPTOUT: 1 + DOTNET_INTERACTIVE_CLI_TELEMETRY_OPTOUT: 1 + DO_NOT_TRACK: 1 + ET_NO_TELEMETRY: 1 + GATSBY_TELEMETRY_DISABLED: 1 + GATSBY_TELEMETRY_OPTOUT: 1 + GATSBY_TELEMETRY_OPT_OUT: 1 + GRIT_TELEMETRY_DISABLED: 1 + HASURA_GRAPHQL_ENABLE_TELEMETRY: false + HINT_TELEMETRY: off + HOMEBREW_NO_ANALYTICS: 1 + INFLUXD_REPORTING_DISABLED: true + ITERATIVE_DO_NOT_TRACK: 1 + NEXT_TELEMETRY_DEBUG: 1 + NEXT_TELEMETRY_DISABLED: 1 + NG_CLI_ANALYTICS: false + NUXT_TELEMETRY_DISABLED: 1 + PIN_DO_NOT_TRACK: 1 + POWERSHELL_TELEMETRY_OPTOUT: 1 + SAM_CLI_TELEMETRY: 0 + STNOUPGRADE: 1 + STRIPE_CLI_TELEMETRY_OPTOUT: 1 + TELEMETRY_DISABLED: 1 + TERRAFORM_TELEMETRY: 0 + + strategy: + matrix: + node-version: [18, 19, 20] + + steps: + - uses: actions/checkout@v4.1.7 + + - uses: pnpm/action-setup@v4.0.0 + with: + version: 9.3.0 + run_install: | + - recursive: true + args: [ + --link-workspace-packages=true, + --lockfile-only, + --prefer-frozen-lockfile=false, + --shamefully-hoist=false, + --shared-workspace-lockfile=true, + --strict-peer-dependencies=false, + --unsafe-perm=true + ] + + - uses: actions/setup-node@v4.0.3 + with: + node-version: ${{ matrix.node-version }} + cache: "pnpm" + cache-dependency-path: ./pnpm-lock.yaml + + - run: pnpm install + working-directory: . + + - run: pnpm run build + working-directory: . + + - uses: actions/upload-artifact@v4.3.6 + with: + name: .-Node-${{ matrix.node-version }}-Target + path: ./Target + + - run: pnpm run prepublishOnly + working-directory: . + + - uses: actions/upload-artifact@v4.3.6 + with: + name: .-Node-${{ matrix.node-version }}-Target + path: ./Target diff --git a/.github/workflows/Rust.yml b/.github/workflows/Rust.yml new file mode 100644 index 00000000..a12666e2 --- /dev/null +++ b/.github/workflows/Rust.yml @@ -0,0 +1,109 @@ +name: Rust + +concurrency: + group: Rust-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +permissions: + security-events: write + +on: + workflow_dispatch: + push: + branches: [Current] + pull_request: + branches: [Current] + workflow_call: + +jobs: + Build: + runs-on: ubuntu-latest + + env: + ADBLOCK: true + ASTRO_TELEMETRY_DISABLED: 1 + AUTOMATEDLAB_TELEMETRY_OPTOUT: 1 + AZURE_CORE_COLLECT_TELEMETRY: 0 + CHOOSENIM_NO_ANALYTICS: 1 + DIEZ_DO_NOT_TRACK: 1 + DOTNET_CLI_TELEMETRY_OPTOUT: 1 + DOTNET_INTERACTIVE_CLI_TELEMETRY_OPTOUT: 1 + DO_NOT_TRACK: 1 + ET_NO_TELEMETRY: 1 + GATSBY_TELEMETRY_DISABLED: 1 + GATSBY_TELEMETRY_OPTOUT: 1 + GATSBY_TELEMETRY_OPT_OUT: 1 + GRIT_TELEMETRY_DISABLED: 1 + HASURA_GRAPHQL_ENABLE_TELEMETRY: false + HINT_TELEMETRY: off + HOMEBREW_NO_ANALYTICS: 1 + INFLUXD_REPORTING_DISABLED: true + ITERATIVE_DO_NOT_TRACK: 1 + NEXT_TELEMETRY_DEBUG: 1 + NEXT_TELEMETRY_DISABLED: 1 + NG_CLI_ANALYTICS: false + NUXT_TELEMETRY_DISABLED: 1 + PIN_DO_NOT_TRACK: 1 + POWERSHELL_TELEMETRY_OPTOUT: 1 + SAM_CLI_TELEMETRY: 0 + STNOUPGRADE: 1 + STRIPE_CLI_TELEMETRY_OPTOUT: 1 + TELEMETRY_DISABLED: 1 + TERRAFORM_TELEMETRY: 0 + + strategy: + matrix: + toolchain: ["stable", "nightly"] + + steps: + - uses: actions/checkout@v4.1.7 + + - uses: actions-rs/toolchain@v1.0.7 + with: + profile: minimal + toolchain: ${{ matrix.toolchain }} + + - uses: actions/cache@v4.0.2 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + Target/ + key: ${{ runner.os }}-cargo-${{ hashFiles('./Cargo.toml') }} + - uses: actions-rs/cargo@v1.0.3 + with: + command: build + args: --release --all-features --manifest-path ./Cargo.toml + + - uses: actions/cache@v4.0.2 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + Target/ + key: ${{ runner.os }}-cargo-${{ hashFiles('./fuzz/Cargo.toml') }} + - uses: actions-rs/cargo@v1.0.3 + with: + command: build + args: --release --all-features --manifest-path ./fuzz/Cargo.toml + + - uses: actions/cache@v4.0.2 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + Target/ + key: ${{ runner.os }}-cargo-${{ hashFiles('./napi/Cargo.toml') }} + - uses: actions-rs/cargo@v1.0.3 + with: + command: build + args: --release --all-features --manifest-path ./napi/Cargo.toml From a59b900b962aeb1492b7ba40a8bb4124fd37cf51 Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Tue, 27 Aug 2024 13:02:02 +0300 Subject: [PATCH 62/82] --- Documentation/index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/index.html b/Documentation/index.html index 87508a96..560eba1e 100644 --- a/Documentation/index.html +++ b/Documentation/index.html @@ -29,7 +29,7 @@
  • supports in-memory file system via the FileSystem trait
  • contains tracing instrumentation
  • -

    The following usages apply to both Rust and Node.js; the code snippets are written in JavaScript.

    +

    The following usages apply to both Rust and Node.js; the code snippets are written in JavaScript.

    To handle the exports field in package.json, ESM and CJS need to be differentiated.

    Per ESM Resolution algorithm

    @@ -310,4 +310,4 @@ -
    +
    From e587098461747cca2650994535e601ce1caec8d3 Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Wed, 28 Aug 2024 09:08:52 +0300 Subject: [PATCH 63/82] --- .github/dependabot.yml | 38 ----------- .github/workflows/Dependabot.yml | 45 ------------- .github/workflows/GitHub.yml | 58 ---------------- .github/workflows/NPM.yml | 74 --------------------- .github/workflows/Node.yml | 101 ---------------------------- .github/workflows/Rust.yml | 109 ------------------------------- 6 files changed, 425 deletions(-) delete mode 100644 .github/dependabot.yml delete mode 100644 .github/workflows/Dependabot.yml delete mode 100644 .github/workflows/GitHub.yml delete mode 100644 .github/workflows/NPM.yml delete mode 100644 .github/workflows/Node.yml delete mode 100644 .github/workflows/Rust.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index f02ca757..00000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,38 +0,0 @@ -version: 2 -enable-beta-ecosystems: true - -updates: - - package-ecosystem: "github-actions" - directory: "/" - schedule: - interval: "daily" - - - package-ecosystem: "cargo" - directory: "/" - schedule: - interval: "daily" - versioning-strategy: lockfile-only - - - package-ecosystem: "cargo" - directory: "/fuzz" - schedule: - interval: "daily" - versioning-strategy: lockfile-only - - - package-ecosystem: "cargo" - directory: "/napi" - schedule: - interval: "daily" - versioning-strategy: lockfile-only - - - package-ecosystem: "npm" - directory: "/npm" - schedule: - interval: "daily" - versioning-strategy: increase - - - package-ecosystem: "npm" - directory: "/" - schedule: - interval: "daily" - versioning-strategy: increase diff --git a/.github/workflows/Dependabot.yml b/.github/workflows/Dependabot.yml deleted file mode 100644 index 387fece7..00000000 --- a/.github/workflows/Dependabot.yml +++ /dev/null @@ -1,45 +0,0 @@ -name: Dependabot - -concurrency: - group: Dependabot-${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -permissions: - security-events: write - contents: write - pull-requests: write - -on: - workflow_dispatch: - pull_request: - -jobs: - Approve: - runs-on: ubuntu-latest - - if: ${{ github.actor == 'dependabot[bot]' }} - - steps: - - uses: dependabot/fetch-metadata@v2.2.0 - with: - github-token: "${{ secrets.GITHUB_TOKEN }}" - - - run: gh pr review --approve "$PR_URL" - env: - PR_URL: ${{github.event.pull_request.html_url}} - GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} - - Merge: - runs-on: ubuntu-latest - - if: ${{ github.actor == 'dependabot[bot]' }} - - steps: - - uses: dependabot/fetch-metadata@v2.2.0 - with: - github-token: "${{ secrets.GITHUB_TOKEN }}" - - - run: gh pr merge --auto --merge "$PR_URL" - env: - PR_URL: ${{github.event.pull_request.html_url}} - GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} diff --git a/.github/workflows/GitHub.yml b/.github/workflows/GitHub.yml deleted file mode 100644 index 7b1e399c..00000000 --- a/.github/workflows/GitHub.yml +++ /dev/null @@ -1,58 +0,0 @@ -name: GitHub - -concurrency: - group: GitHub-${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -permissions: - issues: write - pull-requests: write - -on: - issues: - types: [opened] - pull_request: - types: [opened] - -jobs: - Assign: - runs-on: ubuntu-latest - - env: - ADBLOCK: true - ASTRO_TELEMETRY_DISABLED: 1 - AUTOMATEDLAB_TELEMETRY_OPTOUT: 1 - AZURE_CORE_COLLECT_TELEMETRY: 0 - CHOOSENIM_NO_ANALYTICS: 1 - DIEZ_DO_NOT_TRACK: 1 - DOTNET_CLI_TELEMETRY_OPTOUT: 1 - DOTNET_INTERACTIVE_CLI_TELEMETRY_OPTOUT: 1 - DO_NOT_TRACK: 1 - ET_NO_TELEMETRY: 1 - GATSBY_TELEMETRY_DISABLED: 1 - GATSBY_TELEMETRY_OPTOUT: 1 - GATSBY_TELEMETRY_OPT_OUT: 1 - GRIT_TELEMETRY_DISABLED: 1 - HASURA_GRAPHQL_ENABLE_TELEMETRY: false - HINT_TELEMETRY: off - HOMEBREW_NO_ANALYTICS: 1 - INFLUXD_REPORTING_DISABLED: true - ITERATIVE_DO_NOT_TRACK: 1 - NEXT_TELEMETRY_DEBUG: 1 - NEXT_TELEMETRY_DISABLED: 1 - NG_CLI_ANALYTICS: false - NUXT_TELEMETRY_DISABLED: 1 - PIN_DO_NOT_TRACK: 1 - POWERSHELL_TELEMETRY_OPTOUT: 1 - SAM_CLI_TELEMETRY: 0 - STNOUPGRADE: 1 - STRIPE_CLI_TELEMETRY_OPTOUT: 1 - TELEMETRY_DISABLED: 1 - TERRAFORM_TELEMETRY: 0 - - steps: - - uses: pozil/auto-assign-issue@v2.0.0 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - assignees: NikolaRHristov - numOfAssignee: 1 diff --git a/.github/workflows/NPM.yml b/.github/workflows/NPM.yml deleted file mode 100644 index a3c48117..00000000 --- a/.github/workflows/NPM.yml +++ /dev/null @@ -1,74 +0,0 @@ -name: NPM - -concurrency: - group: NPM-${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -permissions: - security-events: write - contents: write - pull-requests: write - -on: - workflow_dispatch: - release: - types: [created] - workflow_call: - -jobs: - Publish: - runs-on: ubuntu-latest - - env: - ADBLOCK: true - ASTRO_TELEMETRY_DISABLED: 1 - AUTOMATEDLAB_TELEMETRY_OPTOUT: 1 - AZURE_CORE_COLLECT_TELEMETRY: 0 - CHOOSENIM_NO_ANALYTICS: 1 - DIEZ_DO_NOT_TRACK: 1 - DOTNET_CLI_TELEMETRY_OPTOUT: 1 - DOTNET_INTERACTIVE_CLI_TELEMETRY_OPTOUT: 1 - DO_NOT_TRACK: 1 - ET_NO_TELEMETRY: 1 - GATSBY_TELEMETRY_DISABLED: 1 - GATSBY_TELEMETRY_OPTOUT: 1 - GATSBY_TELEMETRY_OPT_OUT: 1 - GRIT_TELEMETRY_DISABLED: 1 - HASURA_GRAPHQL_ENABLE_TELEMETRY: false - HINT_TELEMETRY: off - HOMEBREW_NO_ANALYTICS: 1 - INFLUXD_REPORTING_DISABLED: true - ITERATIVE_DO_NOT_TRACK: 1 - NEXT_TELEMETRY_DEBUG: 1 - NEXT_TELEMETRY_DISABLED: 1 - NG_CLI_ANALYTICS: false - NUXT_TELEMETRY_DISABLED: 1 - PIN_DO_NOT_TRACK: 1 - POWERSHELL_TELEMETRY_OPTOUT: 1 - SAM_CLI_TELEMETRY: 0 - STNOUPGRADE: 1 - STRIPE_CLI_TELEMETRY_OPTOUT: 1 - TELEMETRY_DISABLED: 1 - TERRAFORM_TELEMETRY: 0 - - permissions: - contents: read - id-token: write - - steps: - - uses: actions/checkout@v4.1.7 - - - uses: actions/setup-node@v4.0.3 - with: - node-version: "18" - registry-url: "https://registry.npmjs.org" - - - run: npm install -g npm - - - name: Publish . - continue-on-error: true - working-directory: . - run: | - npm publish --legacy-peer-deps --provenance --ignore-scripts - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/Node.yml b/.github/workflows/Node.yml deleted file mode 100644 index 7cd17cd2..00000000 --- a/.github/workflows/Node.yml +++ /dev/null @@ -1,101 +0,0 @@ -name: Node - -concurrency: - group: Node-${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -permissions: - security-events: write - contents: write - pull-requests: write - -on: - workflow_dispatch: - push: - branches: [Current] - pull_request: - branches: [Current] - workflow_call: - -jobs: - Pre-Publish: - runs-on: ubuntu-latest - - env: - ADBLOCK: true - ASTRO_TELEMETRY_DISABLED: 1 - AUTOMATEDLAB_TELEMETRY_OPTOUT: 1 - AZURE_CORE_COLLECT_TELEMETRY: 0 - CHOOSENIM_NO_ANALYTICS: 1 - DIEZ_DO_NOT_TRACK: 1 - DOTNET_CLI_TELEMETRY_OPTOUT: 1 - DOTNET_INTERACTIVE_CLI_TELEMETRY_OPTOUT: 1 - DO_NOT_TRACK: 1 - ET_NO_TELEMETRY: 1 - GATSBY_TELEMETRY_DISABLED: 1 - GATSBY_TELEMETRY_OPTOUT: 1 - GATSBY_TELEMETRY_OPT_OUT: 1 - GRIT_TELEMETRY_DISABLED: 1 - HASURA_GRAPHQL_ENABLE_TELEMETRY: false - HINT_TELEMETRY: off - HOMEBREW_NO_ANALYTICS: 1 - INFLUXD_REPORTING_DISABLED: true - ITERATIVE_DO_NOT_TRACK: 1 - NEXT_TELEMETRY_DEBUG: 1 - NEXT_TELEMETRY_DISABLED: 1 - NG_CLI_ANALYTICS: false - NUXT_TELEMETRY_DISABLED: 1 - PIN_DO_NOT_TRACK: 1 - POWERSHELL_TELEMETRY_OPTOUT: 1 - SAM_CLI_TELEMETRY: 0 - STNOUPGRADE: 1 - STRIPE_CLI_TELEMETRY_OPTOUT: 1 - TELEMETRY_DISABLED: 1 - TERRAFORM_TELEMETRY: 0 - - strategy: - matrix: - node-version: [18, 19, 20] - - steps: - - uses: actions/checkout@v4.1.7 - - - uses: pnpm/action-setup@v4.0.0 - with: - version: 9.3.0 - run_install: | - - recursive: true - args: [ - --link-workspace-packages=true, - --lockfile-only, - --prefer-frozen-lockfile=false, - --shamefully-hoist=false, - --shared-workspace-lockfile=true, - --strict-peer-dependencies=false, - --unsafe-perm=true - ] - - - uses: actions/setup-node@v4.0.3 - with: - node-version: ${{ matrix.node-version }} - cache: "pnpm" - cache-dependency-path: ./pnpm-lock.yaml - - - run: pnpm install - working-directory: . - - - run: pnpm run build - working-directory: . - - - uses: actions/upload-artifact@v4.3.6 - with: - name: .-Node-${{ matrix.node-version }}-Target - path: ./Target - - - run: pnpm run prepublishOnly - working-directory: . - - - uses: actions/upload-artifact@v4.3.6 - with: - name: .-Node-${{ matrix.node-version }}-Target - path: ./Target diff --git a/.github/workflows/Rust.yml b/.github/workflows/Rust.yml deleted file mode 100644 index a12666e2..00000000 --- a/.github/workflows/Rust.yml +++ /dev/null @@ -1,109 +0,0 @@ -name: Rust - -concurrency: - group: Rust-${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -permissions: - security-events: write - -on: - workflow_dispatch: - push: - branches: [Current] - pull_request: - branches: [Current] - workflow_call: - -jobs: - Build: - runs-on: ubuntu-latest - - env: - ADBLOCK: true - ASTRO_TELEMETRY_DISABLED: 1 - AUTOMATEDLAB_TELEMETRY_OPTOUT: 1 - AZURE_CORE_COLLECT_TELEMETRY: 0 - CHOOSENIM_NO_ANALYTICS: 1 - DIEZ_DO_NOT_TRACK: 1 - DOTNET_CLI_TELEMETRY_OPTOUT: 1 - DOTNET_INTERACTIVE_CLI_TELEMETRY_OPTOUT: 1 - DO_NOT_TRACK: 1 - ET_NO_TELEMETRY: 1 - GATSBY_TELEMETRY_DISABLED: 1 - GATSBY_TELEMETRY_OPTOUT: 1 - GATSBY_TELEMETRY_OPT_OUT: 1 - GRIT_TELEMETRY_DISABLED: 1 - HASURA_GRAPHQL_ENABLE_TELEMETRY: false - HINT_TELEMETRY: off - HOMEBREW_NO_ANALYTICS: 1 - INFLUXD_REPORTING_DISABLED: true - ITERATIVE_DO_NOT_TRACK: 1 - NEXT_TELEMETRY_DEBUG: 1 - NEXT_TELEMETRY_DISABLED: 1 - NG_CLI_ANALYTICS: false - NUXT_TELEMETRY_DISABLED: 1 - PIN_DO_NOT_TRACK: 1 - POWERSHELL_TELEMETRY_OPTOUT: 1 - SAM_CLI_TELEMETRY: 0 - STNOUPGRADE: 1 - STRIPE_CLI_TELEMETRY_OPTOUT: 1 - TELEMETRY_DISABLED: 1 - TERRAFORM_TELEMETRY: 0 - - strategy: - matrix: - toolchain: ["stable", "nightly"] - - steps: - - uses: actions/checkout@v4.1.7 - - - uses: actions-rs/toolchain@v1.0.7 - with: - profile: minimal - toolchain: ${{ matrix.toolchain }} - - - uses: actions/cache@v4.0.2 - with: - path: | - ~/.cargo/bin/ - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - target/ - Target/ - key: ${{ runner.os }}-cargo-${{ hashFiles('./Cargo.toml') }} - - uses: actions-rs/cargo@v1.0.3 - with: - command: build - args: --release --all-features --manifest-path ./Cargo.toml - - - uses: actions/cache@v4.0.2 - with: - path: | - ~/.cargo/bin/ - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - target/ - Target/ - key: ${{ runner.os }}-cargo-${{ hashFiles('./fuzz/Cargo.toml') }} - - uses: actions-rs/cargo@v1.0.3 - with: - command: build - args: --release --all-features --manifest-path ./fuzz/Cargo.toml - - - uses: actions/cache@v4.0.2 - with: - path: | - ~/.cargo/bin/ - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - target/ - Target/ - key: ${{ runner.os }}-cargo-${{ hashFiles('./napi/Cargo.toml') }} - - uses: actions-rs/cargo@v1.0.3 - with: - command: build - args: --release --all-features --manifest-path ./napi/Cargo.toml From ced33b81fc0d1a5dde1004989e1f8cb5bc7ce4d8 Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Fri, 30 Aug 2024 14:06:33 +0300 Subject: [PATCH 64/82] --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 0bfd3847..0a957660 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "devDependencies": { "@napi-rs/cli": "2.18.4", "@napi-rs/wasm-runtime": "0.2.4", - "@types/node": "22.5.0", + "@types/node": "22.5.1", "ava": "6.1.3", "emnapi": "1.2.0" }, From bca5f25bf7b93d0976fa843d011d2b4b13056c1d Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Fri, 30 Aug 2024 19:33:20 +0300 Subject: [PATCH 65/82] --- {src => Source}/builtins.rs | 0 {src => Source}/cache.rs | 0 {src => Source}/context.rs | 0 {src => Source}/error.rs | 0 {src => Source}/file_system.rs | 0 {src => Source}/lib.rs | 0 {src => Source}/options.rs | 0 {src => Source}/package_json.rs | 0 {src => Source}/path.rs | 0 {src => Source}/resolution.rs | 0 {src => Source}/specifier.rs | 0 {src => Source}/tsconfig.rs | 0 napi/{src => Source}/lib.rs | 0 napi/{src => Source}/options.rs | 0 napi/{src => Source}/tracing.rs | 0 15 files changed, 0 insertions(+), 0 deletions(-) rename {src => Source}/builtins.rs (100%) rename {src => Source}/cache.rs (100%) rename {src => Source}/context.rs (100%) rename {src => Source}/error.rs (100%) rename {src => Source}/file_system.rs (100%) rename {src => Source}/lib.rs (100%) rename {src => Source}/options.rs (100%) rename {src => Source}/package_json.rs (100%) rename {src => Source}/path.rs (100%) rename {src => Source}/resolution.rs (100%) rename {src => Source}/specifier.rs (100%) rename {src => Source}/tsconfig.rs (100%) rename napi/{src => Source}/lib.rs (100%) rename napi/{src => Source}/options.rs (100%) rename napi/{src => Source}/tracing.rs (100%) diff --git a/src/builtins.rs b/Source/builtins.rs similarity index 100% rename from src/builtins.rs rename to Source/builtins.rs diff --git a/src/cache.rs b/Source/cache.rs similarity index 100% rename from src/cache.rs rename to Source/cache.rs diff --git a/src/context.rs b/Source/context.rs similarity index 100% rename from src/context.rs rename to Source/context.rs diff --git a/src/error.rs b/Source/error.rs similarity index 100% rename from src/error.rs rename to Source/error.rs diff --git a/src/file_system.rs b/Source/file_system.rs similarity index 100% rename from src/file_system.rs rename to Source/file_system.rs diff --git a/src/lib.rs b/Source/lib.rs similarity index 100% rename from src/lib.rs rename to Source/lib.rs diff --git a/src/options.rs b/Source/options.rs similarity index 100% rename from src/options.rs rename to Source/options.rs diff --git a/src/package_json.rs b/Source/package_json.rs similarity index 100% rename from src/package_json.rs rename to Source/package_json.rs diff --git a/src/path.rs b/Source/path.rs similarity index 100% rename from src/path.rs rename to Source/path.rs diff --git a/src/resolution.rs b/Source/resolution.rs similarity index 100% rename from src/resolution.rs rename to Source/resolution.rs diff --git a/src/specifier.rs b/Source/specifier.rs similarity index 100% rename from src/specifier.rs rename to Source/specifier.rs diff --git a/src/tsconfig.rs b/Source/tsconfig.rs similarity index 100% rename from src/tsconfig.rs rename to Source/tsconfig.rs diff --git a/napi/src/lib.rs b/napi/Source/lib.rs similarity index 100% rename from napi/src/lib.rs rename to napi/Source/lib.rs diff --git a/napi/src/options.rs b/napi/Source/options.rs similarity index 100% rename from napi/src/options.rs rename to napi/Source/options.rs diff --git a/napi/src/tracing.rs b/napi/Source/tracing.rs similarity index 100% rename from napi/src/tracing.rs rename to napi/Source/tracing.rs From 2af7afc106b947a0cf4ff0449f11f49b5fe36101 Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Mon, 2 Sep 2024 00:39:22 +0300 Subject: [PATCH 66/82] --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 0a957660..c8d857cb 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "devDependencies": { "@napi-rs/cli": "2.18.4", "@napi-rs/wasm-runtime": "0.2.4", - "@types/node": "22.5.1", + "@types/node": "22.5.2", "ava": "6.1.3", "emnapi": "1.2.0" }, From c0805575369d7c98f26649097197f99a17852964 Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Mon, 2 Sep 2024 21:20:35 +0300 Subject: [PATCH 67/82] --- pnpm-workspace.yaml | 4 ---- 1 file changed, 4 deletions(-) delete mode 100644 pnpm-workspace.yaml diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml deleted file mode 100644 index a6099e97..00000000 --- a/pnpm-workspace.yaml +++ /dev/null @@ -1,4 +0,0 @@ -packages: - - 'npm' - - 'napi' - - 'fixtures/pnpm' From 48529724008025911828ed090fb35110c1de26e8 Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Wed, 4 Sep 2024 22:08:27 +0300 Subject: [PATCH 68/82] --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c8d857cb..569bb774 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "devDependencies": { "@napi-rs/cli": "2.18.4", "@napi-rs/wasm-runtime": "0.2.4", - "@types/node": "22.5.2", + "@types/node": "22.5.3", "ava": "6.1.3", "emnapi": "1.2.0" }, From 1a12b376a0b1d92169561cdf17a1ab2d8437adba Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Wed, 4 Sep 2024 22:34:31 +0300 Subject: [PATCH 69/82] --- .github/workflows/ci.yml | 196 ------ Cargo.lock | 1326 -------------------------------------- npm/package.json | 79 +-- src/tests/alias.rs | 283 -------- 4 files changed, 34 insertions(+), 1850 deletions(-) delete mode 100644 .github/workflows/ci.yml delete mode 100644 Cargo.lock delete mode 100644 src/tests/alias.rs diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index 3f629ffb..00000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,196 +0,0 @@ -name: CI - -on: - workflow_dispatch: - pull_request: - types: [opened, synchronize] - paths-ignore: - - '**/*.md' - - '!.github/workflows/ci.yml' - push: - branches: - - main - - "renovate/**" - paths-ignore: - - '**/*.md' - - '!.github/workflows/ci.yml' - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} - cancel-in-progress: ${{ github.ref_name != 'main' }} - -defaults: - run: - shell: bash - -jobs: - cache: # Warm cache factory for all other CI jobs - name: Check and Build - strategy: - fail-fast: true - matrix: - include: - - os: windows-latest - - os: ubuntu-latest - - os: macos-14 - runs-on: ${{ matrix.os }} - steps: - - uses: taiki-e/checkout-action@v1 - - - uses: Boshen/setup-rust@main - with: - save-cache: ${{ github.ref_name == 'main' }} - cache-key: warm - - - run: cargo check --all-features --locked - - # Only need to build the test to create a warm cache on the main branch - - name: Build cache by Cargo Check and Cargo Test - if: ${{ github.ref_name == 'main' }} - run: cargo test --all-features --no-run - - wasm: - name: Check Wasm - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - - uses: Boshen/setup-rust@main - with: - cache-key: wasm - save-cache: ${{ github.ref_name == 'main' }} - - - name: Check - run: | - rustup target add wasm32-unknown-unknown - cargo check --all-features --target wasm32-unknown-unknown - - wasi: - name: Test wasi target - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - - uses: Boshen/setup-rust@main - with: - cache-key: wasi - save-cache: ${{ github.ref_name == 'main' }} - - - uses: ./.github/actions/pnpm - - - name: Build - run: | - rustup target add wasm32-wasip1-threads - pnpm build --target wasm32-wasip1-threads - - - name: Test - run: pnpm test - env: - WASI_TEST: 1 - - typos: - name: Spell Check - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - - uses: crate-ci/typos@v1.24.5 - with: - files: . - - deny: - name: Cargo Deny - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - - uses: dorny/paths-filter@v3 - id: filter - with: - filters: | - src: - - 'Cargo.lock' - - - uses: Boshen/setup-rust@main - with: - restore-cache: false - tools: cargo-deny - - - if: steps.filter.outputs.src == 'true' - run: cargo deny check - - unused-deps: - name: Check Unused Dependencies - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - uses: dorny/paths-filter@v3 - id: filter - with: - filters: | - src: - - '**/*.rs' - - '**/Cargo.toml' - - 'Cargo.lock' - - uses: Boshen/setup-rust@main - with: - restore-cache: false - if: steps.filter.outputs.src == 'true' - - uses: cargo-bins/cargo-binstall@main - if: steps.filter.outputs.src == 'true' - - run: cargo binstall --no-confirm cargo-shear@1 - if: steps.filter.outputs.src == 'true' - - run: cargo shear - if: steps.filter.outputs.src == 'true' - - format: - name: Format - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - uses: Boshen/setup-rust@main - with: - components: rustfmt - restore-cache: false - - run: cargo fmt --all -- --check - - lint: - name: Clippy - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - uses: Boshen/setup-rust@main - with: - components: clippy - - run: cargo clippy --all-features -- -D warnings - - doc: - name: Doc - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - uses: Boshen/setup-rust@main - with: - components: rust-docs - - run: RUSTDOCFLAGS='-D warnings' cargo doc --no-deps --all-features - - test: - name: Test - strategy: - fail-fast: true - matrix: - include: - - os: windows-latest - - os: ubuntu-latest - - os: macos-14 - runs-on: ${{ matrix.os }} - env: - RUST_BACKTRACE: 1 - steps: - - uses: taiki-e/checkout-action@v1 - - uses: ./.github/actions/pnpm - - uses: Boshen/setup-rust@main - with: - cache-key: warm - - run: cargo test --doc - - run: cargo test --all-features diff --git a/Cargo.lock b/Cargo.lock deleted file mode 100644 index 58c1e7ad..00000000 --- a/Cargo.lock +++ /dev/null @@ -1,1326 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "adler" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" - -[[package]] -name = "aho-corasick" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" -dependencies = [ - "memchr", -] - -[[package]] -name = "android-tzdata" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" - -[[package]] -name = "android_system_properties" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" -dependencies = [ - "libc", -] - -[[package]] -name = "anes" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "735d4f398ca57cfa2880225c2bf81c3b9af3be5bb22e44ae70118dad38713e84" - -[[package]] -name = "arca" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f915ddd863ef73f11c10c75170e86db1d4f539689bc6bfb9ce25d6528d6fe83" -dependencies = [ - "clean-path", - "path-slash", - "radix_trie", -] - -[[package]] -name = "autocfg" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" - -[[package]] -name = "base64" -version = "0.22.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" - -[[package]] -name = "bit-set" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1" -dependencies = [ - "bit-vec", -] - -[[package]] -name = "bit-vec" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "bitflags" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" - -[[package]] -name = "bpaf" -version = "0.9.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3280efcf6d66bc77c2cf9b67dc8acee47a217d9be67dd590b3230dffe663724d" - -[[package]] -name = "bumpalo" -version = "3.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" - -[[package]] -name = "byteorder" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" - -[[package]] -name = "cast" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" - -[[package]] -name = "cc" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eaff6f8ce506b9773fa786672d63fc7a191ffea1be33f72bbd4aeacefca9ffc8" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "chrono" -version = "0.4.38" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" -dependencies = [ - "android-tzdata", - "iana-time-zone", - "num-traits", - "serde", - "windows-targets 0.52.6", -] - -[[package]] -name = "ciborium" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42e69ffd6f0917f5c029256a24d0161db17cea3997d185db0d35926308770f0e" -dependencies = [ - "ciborium-io", - "ciborium-ll", - "serde", -] - -[[package]] -name = "ciborium-io" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05afea1e0a06c9be33d539b876f1ce3692f4afea2cb41f740e7743225ed1c757" - -[[package]] -name = "ciborium-ll" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57663b653d948a338bfb3eeba9bb2fd5fcfaecb9e199e87e1eda4d9e8b240fd9" -dependencies = [ - "ciborium-io", - "half", -] - -[[package]] -name = "clean-path" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aaa6b4b263a5d737e9bf6b7c09b72c41a5480aec4d7219af827f6564e950b6a5" - -[[package]] -name = "codspeed" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a104ac948e0188b921eb3fcbdd55dcf62e542df4c7ab7e660623f6288302089" -dependencies = [ - "colored", - "libc", - "serde_json", -] - -[[package]] -name = "colored" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbf2150cce219b664a8a70df7a1f933836724b503f8a413af9365b4dcc4d90b8" -dependencies = [ - "lazy_static", - "windows-sys 0.48.0", -] - -[[package]] -name = "concurrent_lru" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7feb5cb312f774e8a24540e27206db4e890f7d488563671d24a16389cf4c2e4e" -dependencies = [ - "once_cell", -] - -[[package]] -name = "convert_case" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec182b0ca2f35d8fc196cf3404988fd8b8c739a4d270ff118a398feb0cbec1ca" -dependencies = [ - "unicode-segmentation", -] - -[[package]] -name = "core-foundation-sys" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" - -[[package]] -name = "criterion2" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8df39381f28ced0ceebfb5611528d99aef14f8d75b43e9d4ceb6aba66e7b04d" -dependencies = [ - "anes", - "bpaf", - "cast", - "ciborium", - "codspeed", - "colored", - "num-traits", - "oorandom", - "serde", - "serde_json", - "walkdir", -] - -[[package]] -name = "crossbeam-deque" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" -dependencies = [ - "crossbeam-epoch", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.9.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" -dependencies = [ - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" - -[[package]] -name = "crunchy" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" - -[[package]] -name = "ctor" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edb49164822f3ee45b17acd4a208cfc1251410cf0cad9a833234c9890774dd9f" -dependencies = [ - "quote", - "syn", -] - -[[package]] -name = "darling" -version = "0.20.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" -dependencies = [ - "darling_core", - "darling_macro", -] - -[[package]] -name = "darling_core" -version = "0.20.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95133861a8032aaea082871032f5815eb9e98cef03fa916ab4500513994df9e5" -dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "strsim", - "syn", -] - -[[package]] -name = "darling_macro" -version = "0.20.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" -dependencies = [ - "darling_core", - "quote", - "syn", -] - -[[package]] -name = "dashmap" -version = "6.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "804c8821570c3f8b70230c2ba75ffa5c0f9a4189b9a432b6656c536712acae28" -dependencies = [ - "cfg-if", - "crossbeam-utils", - "hashbrown 0.14.5", - "lock_api", - "once_cell", - "parking_lot_core", -] - -[[package]] -name = "deranged" -version = "0.3.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" -dependencies = [ - "powerfmt", - "serde", -] - -[[package]] -name = "document-features" -version = "0.2.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb6969eaabd2421f8a2775cfd2471a2b634372b4a25d41e3bd647b79912850a0" -dependencies = [ - "litrs", -] - -[[package]] -name = "dunce" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" - -[[package]] -name = "either" -version = "1.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" - -[[package]] -name = "endian-type" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" - -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "fancy-regex" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "531e46835a22af56d1e3b66f04844bed63158bc094a628bec1d321d9b4c44bf2" -dependencies = [ - "bit-set", - "regex-automata", - "regex-syntax", -] - -[[package]] -name = "filetime" -version = "0.2.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ee447700ac8aa0b2f2bd7bc4462ad686ba06baa6727ac149a2d6277f0d240fd" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall 0.4.1", - "windows-sys 0.52.0", -] - -[[package]] -name = "fnv" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" - -[[package]] -name = "half" -version = "2.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dd08c532ae367adf81c312a4580bc67f1d0fe8bc9c460520283f4c0ff277888" -dependencies = [ - "cfg-if", - "crunchy", -] - -[[package]] -name = "hashbrown" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" - -[[package]] -name = "hashbrown" -version = "0.14.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "iana-time-zone" -version = "0.1.60" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" -dependencies = [ - "android_system_properties", - "core-foundation-sys", - "iana-time-zone-haiku", - "js-sys", - "wasm-bindgen", - "windows-core", -] - -[[package]] -name = "iana-time-zone-haiku" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" -dependencies = [ - "cc", -] - -[[package]] -name = "ident_case" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" - -[[package]] -name = "indexmap" -version = "1.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" -dependencies = [ - "autocfg", - "hashbrown 0.12.3", - "serde", -] - -[[package]] -name = "indexmap" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93ead53efc7ea8ed3cfb0c79fc8023fbb782a5432b52830b6518941cebe6505c" -dependencies = [ - "equivalent", - "hashbrown 0.14.5", - "serde", -] - -[[package]] -name = "itoa" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" - -[[package]] -name = "js-sys" -version = "0.3.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" -dependencies = [ - "wasm-bindgen", -] - -[[package]] -name = "json-strip-comments" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b271732a960335e715b6b2ae66a086f115c74eb97360e996d2bd809bfc063bba" -dependencies = [ - "memchr", -] - -[[package]] -name = "lazy_static" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" - -[[package]] -name = "libc" -version = "0.2.155" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" - -[[package]] -name = "libloading" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e310b3a6b5907f99202fcdb4960ff45b93735d7c7d96b760fcff8db2dc0e103d" -dependencies = [ - "cfg-if", - "windows-targets 0.52.6", -] - -[[package]] -name = "litrs" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4ce301924b7887e9d637144fdade93f9dfff9b60981d4ac161db09720d39aa5" - -[[package]] -name = "lock_api" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" -dependencies = [ - "autocfg", - "scopeguard", -] - -[[package]] -name = "log" -version = "0.4.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" - -[[package]] -name = "memchr" -version = "2.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" - -[[package]] -name = "miniz_oxide" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" -dependencies = [ - "adler", -] - -[[package]] -name = "napi" -version = "3.0.0-alpha.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ec04344cc540f5897e97c9821ab99e7eb276b4dca6f3e6e441dfa72e5bcde70" -dependencies = [ - "bitflags 2.6.0", - "ctor", - "napi-build", - "napi-sys", - "once_cell", - "serde", - "serde_json", -] - -[[package]] -name = "napi-build" -version = "2.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1c0f5d67ee408a4685b61f5ab7e58605c8ae3f2b4189f0127d804ff13d5560a" - -[[package]] -name = "napi-derive" -version = "3.0.0-alpha.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c6240c4ddca592cde608bbfa26e2af397c3596e413a0c65c9bbcb65c2f1e485" -dependencies = [ - "cfg-if", - "convert_case", - "napi-derive-backend", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "napi-derive-backend" -version = "2.0.0-alpha.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b32dcc50065508fe2f387076c17adbdf10e038d1c080d48b10196813d94ac6a8" -dependencies = [ - "convert_case", - "once_cell", - "proc-macro2", - "quote", - "regex", - "semver", - "syn", -] - -[[package]] -name = "napi-sys" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "427802e8ec3a734331fec1035594a210ce1ff4dc5bc1950530920ab717964ea3" -dependencies = [ - "libloading", -] - -[[package]] -name = "nibble_vec" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" -dependencies = [ - "smallvec", -] - -[[package]] -name = "normalize-path" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5438dd2b2ff4c6df6e1ce22d825ed2fa93ee2922235cc45186991717f0a892d" - -[[package]] -name = "num-conv" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" - -[[package]] -name = "num-traits" -version = "0.2.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" -dependencies = [ - "autocfg", -] - -[[package]] -name = "once_cell" -version = "1.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" - -[[package]] -name = "oorandom" -version = "11.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b410bbe7e14ab526a0e86877eb47c6996a2bd7746f027ba551028c925390e4e9" - -[[package]] -name = "oxc_napi_resolver" -version = "0.0.0" -dependencies = [ - "napi", - "napi-build", - "napi-derive", - "oxc_resolver", - "tracing-subscriber", -] - -[[package]] -name = "oxc_resolver" -version = "1.11.0" -dependencies = [ - "cfg-if", - "criterion2", - "dashmap", - "document-features", - "dunce", - "indexmap 2.4.0", - "json-strip-comments", - "normalize-path", - "once_cell", - "pnp", - "rayon", - "rustc-hash", - "serde", - "serde_json", - "simdutf8", - "thiserror", - "tracing", - "vfs", -] - -[[package]] -name = "parking_lot_core" -version = "0.9.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall 0.5.2", - "smallvec", - "windows-targets 0.52.6", -] - -[[package]] -name = "path-slash" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e91099d4268b0e11973f036e885d652fb0b21fedcf69738c627f94db6a44f42" - -[[package]] -name = "pathdiff" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8835116a5c179084a830efb3adc117ab007512b535bc1a21c991d3b32a6b44dd" - -[[package]] -name = "pin-project-lite" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" - -[[package]] -name = "pnp" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46770cee76a618023fea15411d0449dd066dc232cc17e4562f154da215f27af7" -dependencies = [ - "arca", - "byteorder", - "concurrent_lru", - "fancy-regex", - "lazy_static", - "miniz_oxide", - "pathdiff", - "regex", - "serde", - "serde_json", - "serde_with", - "thiserror", -] - -[[package]] -name = "powerfmt" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" - -[[package]] -name = "proc-macro2" -version = "1.0.86" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.36" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "radix_trie" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" -dependencies = [ - "endian-type", - "nibble_vec", -] - -[[package]] -name = "rayon" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" -dependencies = [ - "either", - "rayon-core", -] - -[[package]] -name = "rayon-core" -version = "1.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" -dependencies = [ - "crossbeam-deque", - "crossbeam-utils", -] - -[[package]] -name = "redox_syscall" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" -dependencies = [ - "bitflags 1.3.2", -] - -[[package]] -name = "redox_syscall" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c82cf8cff14456045f55ec4241383baeff27af886adb72ffb2162f99911de0fd" -dependencies = [ - "bitflags 2.6.0", -] - -[[package]] -name = "regex" -version = "1.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b91213439dad192326a0d7c6ee3955910425f441d7038e0d6933b0aec5c4517f" -dependencies = [ - "aho-corasick", - "memchr", - "regex-automata", - "regex-syntax", -] - -[[package]] -name = "regex-automata" -version = "0.4.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", -] - -[[package]] -name = "regex-syntax" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" - -[[package]] -name = "rustc-hash" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" - -[[package]] -name = "ryu" -version = "1.0.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" - -[[package]] -name = "same-file" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "scopeguard" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" - -[[package]] -name = "semver" -version = "1.0.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" - -[[package]] -name = "serde" -version = "1.0.209" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99fce0ffe7310761ca6bf9faf5115afbc19688edd00171d81b1bb1b116c63e09" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.209" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5831b979fd7b5439637af1752d535ff49f4860c0f341d1baeb6faf0f4242170" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "serde_json" -version = "1.0.127" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8043c06d9f82bd7271361ed64f415fe5e12a77fdb52e573e7f06a516dea329ad" -dependencies = [ - "indexmap 2.4.0", - "itoa", - "memchr", - "ryu", - "serde", -] - -[[package]] -name = "serde_with" -version = "3.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e73139bc5ec2d45e6c5fd85be5a46949c1c39a4c18e56915f5eb4c12f975e377" -dependencies = [ - "base64", - "chrono", - "hex", - "indexmap 1.9.3", - "indexmap 2.4.0", - "serde", - "serde_derive", - "serde_json", - "serde_with_macros", - "time", -] - -[[package]] -name = "serde_with_macros" -version = "3.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b80d3d6b56b64335c0180e5ffde23b3c5e08c14c585b51a15bd0e95393f46703" -dependencies = [ - "darling", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "sharded-slab" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" -dependencies = [ - "lazy_static", -] - -[[package]] -name = "simdutf8" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f27f6278552951f1f2b8cf9da965d10969b2efdea95a6ec47987ab46edfe263a" - -[[package]] -name = "smallvec" -version = "1.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" - -[[package]] -name = "strsim" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" - -[[package]] -name = "syn" -version = "2.0.70" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f0209b68b3613b093e0ec905354eccaedcfe83b8cb37cbdeae64026c3064c16" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "thiserror" -version = "1.0.63" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.63" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "thread_local" -version = "1.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" -dependencies = [ - "cfg-if", - "once_cell", -] - -[[package]] -name = "time" -version = "0.3.36" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" -dependencies = [ - "deranged", - "itoa", - "num-conv", - "powerfmt", - "serde", - "time-core", - "time-macros", -] - -[[package]] -name = "time-core" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" - -[[package]] -name = "time-macros" -version = "0.2.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" -dependencies = [ - "num-conv", - "time-core", -] - -[[package]] -name = "tracing" -version = "0.1.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" -dependencies = [ - "pin-project-lite", - "tracing-attributes", - "tracing-core", -] - -[[package]] -name = "tracing-attributes" -version = "0.1.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "tracing-core" -version = "0.1.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" -dependencies = [ - "once_cell", -] - -[[package]] -name = "tracing-subscriber" -version = "0.3.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" -dependencies = [ - "sharded-slab", - "thread_local", - "tracing-core", -] - -[[package]] -name = "unicode-ident" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" - -[[package]] -name = "unicode-segmentation" -version = "1.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" - -[[package]] -name = "vfs" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "654cd097e182a71dbf899178e6b5662c2157dd0b8afd5975de18008f6fc173d1" -dependencies = [ - "filetime", -] - -[[package]] -name = "walkdir" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" -dependencies = [ - "same-file", - "winapi-util", -] - -[[package]] -name = "wasm-bindgen" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" -dependencies = [ - "cfg-if", - "wasm-bindgen-macro", -] - -[[package]] -name = "wasm-bindgen-backend" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" -dependencies = [ - "bumpalo", - "log", - "once_cell", - "proc-macro2", - "quote", - "syn", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-macro" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" -dependencies = [ - "quote", - "wasm-bindgen-macro-support", -] - -[[package]] -name = "wasm-bindgen-macro-support" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" -dependencies = [ - "proc-macro2", - "quote", - "syn", - "wasm-bindgen-backend", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-shared" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" - -[[package]] -name = "winapi-util" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b" -dependencies = [ - "windows-sys 0.52.0", -] - -[[package]] -name = "windows-core" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" -dependencies = [ - "windows-targets 0.52.6", -] - -[[package]] -name = "windows-sys" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" -dependencies = [ - "windows-targets 0.48.5", -] - -[[package]] -name = "windows-sys" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" -dependencies = [ - "windows-targets 0.52.6", -] - -[[package]] -name = "windows-targets" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" -dependencies = [ - "windows_aarch64_gnullvm 0.48.5", - "windows_aarch64_msvc 0.48.5", - "windows_i686_gnu 0.48.5", - "windows_i686_msvc 0.48.5", - "windows_x86_64_gnu 0.48.5", - "windows_x86_64_gnullvm 0.48.5", - "windows_x86_64_msvc 0.48.5", -] - -[[package]] -name = "windows-targets" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" -dependencies = [ - "windows_aarch64_gnullvm 0.52.6", - "windows_aarch64_msvc 0.52.6", - "windows_i686_gnu 0.52.6", - "windows_i686_gnullvm", - "windows_i686_msvc 0.52.6", - "windows_x86_64_gnu 0.52.6", - "windows_x86_64_gnullvm 0.52.6", - "windows_x86_64_msvc 0.52.6", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" - -[[package]] -name = "windows_i686_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" - -[[package]] -name = "windows_i686_gnu" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" - -[[package]] -name = "windows_i686_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" - -[[package]] -name = "windows_i686_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" - -[[package]] -name = "windows_i686_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" diff --git a/npm/package.json b/npm/package.json index 85422809..7136edb8 100644 --- a/npm/package.json +++ b/npm/package.json @@ -1,47 +1,36 @@ { - "name": "oxc-resolver", - "version": "1.11.0", - "description": "Oxc Resolver Node API", - "main": "index.js", - "browser": "browser.js", - "files": [ - "index.d.ts", - "index.js", - "browser.js" - ], - "license": "MIT", - "homepage": "https://oxc.rs", - "repository": { - "type": "git", - "url": "git+https://github.com/oxc-project/oxc-resolver.git" - }, - "publishConfig": { - "registry": "https://registry.npmjs.org/", - "access": "public" - }, - "napi": { - "binaryName": "resolver", - "packageName": "@oxc-resolver/binding", - "wasm": { - "browser": { - "fs": true - } - }, - "targets": [ - "x86_64-pc-windows-msvc", - "aarch64-pc-windows-msvc", - "x86_64-unknown-linux-gnu", - "x86_64-unknown-linux-musl", - "x86_64-unknown-freebsd", - "aarch64-unknown-linux-gnu", - "aarch64-unknown-linux-musl", - "armv7-unknown-linux-gnueabihf", - "x86_64-apple-darwin", - "aarch64-apple-darwin", - "wasm32-wasip1-threads" - ] - }, - "funding": { - "url": "https://github.com/sponsors/Boshen" - } + "browser": "browser.js", + "description": "Oxc Resolver Node API", + "files": [ + "index.d.ts", + "index.js", + "browser.js" + ], + "funding": { + "url": "https://github.com/sponsors/Boshen" + }, + "main": "index.js", + "name": "oxc-resolver", + "napi": { + "binaryName": "resolver", + "packageName": "@oxc-resolver/binding", + "targets": [ + "x86_64-pc-windows-msvc", + "aarch64-pc-windows-msvc", + "x86_64-unknown-linux-gnu", + "x86_64-unknown-linux-musl", + "x86_64-unknown-freebsd", + "aarch64-unknown-linux-gnu", + "aarch64-unknown-linux-musl", + "armv7-unknown-linux-gnueabihf", + "x86_64-apple-darwin", + "aarch64-apple-darwin", + "wasm32-wasip1-threads" + ], + "wasm": { + "browser": { + "fs": true + } + } + } } diff --git a/src/tests/alias.rs b/src/tests/alias.rs deleted file mode 100644 index e5892066..00000000 --- a/src/tests/alias.rs +++ /dev/null @@ -1,283 +0,0 @@ -//! - -use normalize_path::NormalizePath; -use std::path::Path; - -use crate::{AliasValue, Resolution, ResolveContext, ResolveError, ResolveOptions, Resolver}; - -#[test] -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -fn alias() { - use super::memory_fs::MemoryFS; - use crate::ResolverGeneric; - use std::path::{Path, PathBuf}; - - let f = Path::new("/"); - - let file_system = MemoryFS::new(&[ - ("/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", ""), - ("/dashed-name", ""), - ]); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - alias: vec![ - ("aliasA".into(), vec![AliasValue::from("a")]), - ("b$".into(), vec![AliasValue::from("a/index")]), - ("c$".into(), vec![AliasValue::from("/a/index")]), - ( - "multiAlias".into(), - vec![ - AliasValue::from("b"), - AliasValue::from("c"), - AliasValue::from("d"), - AliasValue::from("e"), - AliasValue::from("a"), - ], - ), - ("recursive".into(), vec![AliasValue::from("recursive/dir")]), - ("/d/dir".into(), vec![AliasValue::from("/c/dir")]), - ("/d/index.js".into(), vec![AliasValue::from("/c/index")]), - ("#".into(), vec![AliasValue::from("/c/dir")]), - ("@".into(), vec![AliasValue::from("/c/dir")]), - ("ignored".into(), vec![AliasValue::Ignore]), - // not part of enhanced-resolve, added to make sure query in alias value works - ("alias_query".into(), vec![AliasValue::from("a?query_after")]), - ("alias_fragment".into(), vec![AliasValue::from("a#fragment_after")]), - ("dash".into(), vec![AliasValue::Ignore]), - ("@scope/package-name/file$".into(), vec![AliasValue::from("/c/dir")]), - ], - modules: vec!["/".into()], - ..ResolveOptions::default() - }, - ); - - #[rustfmt::skip] - let pass = [ - ("should resolve a not aliased module 1", "a", "/a/index"), - ("should resolve a not aliased module 2", "a/index", "/a/index"), - ("should resolve a not aliased module 3", "a/dir", "/a/dir/index"), - ("should resolve a not aliased module 4", "a/dir/index", "/a/dir/index"), - ("should resolve an aliased module 1", "aliasA", "/a/index"), - ("should resolve an aliased module 2", "aliasA/index", "/a/index"), - ("should resolve an aliased module 3", "aliasA/dir", "/a/dir/index"), - ("should resolve an aliased module 4", "aliasA/dir/index", "/a/dir/index"), - ("should resolve '#' alias 1", "#", "/c/dir/index"), - ("should resolve '#' alias 2", "#/index", "/c/dir/index"), - ("should resolve '@' alias 1", "@", "/c/dir/index"), - ("should resolve '@' alias 2", "@/index", "/c/dir/index"), - ("should resolve a recursive aliased module 1", "recursive", "/recursive/dir/index"), - ("should resolve a recursive aliased module 2", "recursive/index", "/recursive/dir/index"), - ("should resolve a recursive aliased module 3", "recursive/dir", "/recursive/dir/index"), - ("should resolve a recursive aliased module 4", "recursive/dir/index", "/recursive/dir/index"), - ("should resolve a file aliased module 1", "b", "/a/index"), - ("should resolve a file aliased module 2", "c", "/a/index"), - ("should resolve a file aliased module with a query 1", "b?query", "/a/index?query"), - ("should resolve a file aliased module with a query 2", "c?query", "/a/index?query"), - ("should resolve a path in a file aliased module 1", "b/index", "/b/index"), - ("should resolve a path in a file aliased module 2", "b/dir", "/b/dir/index"), - ("should resolve a path in a file aliased module 3", "b/dir/index", "/b/dir/index"), - ("should resolve a path in a file aliased module 4", "c/index", "/c/index"), - ("should resolve a path in a file aliased module 5", "c/dir", "/c/dir/index"), - ("should resolve a path in a file aliased module 6", "c/dir/index", "/c/dir/index"), - ("should resolve a file aliased file 1", "d", "/c/index"), - ("should resolve a file aliased file 2", "d/dir/index", "/c/dir/index"), - ("should resolve a file in multiple aliased dirs 1", "multiAlias/dir/file", "/e/dir/file"), - ("should resolve a file in multiple aliased dirs 2", "multiAlias/anotherDir", "/e/anotherDir/index"), - // not part of enhanced-resolve, added to make sure query in alias value works - ("should resolve query in alias value", "alias_query?query_before", "/a/index?query_after"), - ("should resolve query in alias value", "alias_fragment#fragment_before", "/a/index#fragment_after"), - ("should resolve dashed name", "dashed-name", "/dashed-name"), - ("should resolve scoped package name with sub dir", "@scope/package-name/file", "/c/dir/index"), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - - #[rustfmt::skip] - let ignore = [ - ("should resolve an ignore module", "ignored", ResolveError::Ignored(f.join("ignored"))) - ]; - - for (comment, request, expected) in ignore { - let resolution = resolver.resolve(f, request); - assert_eq!(resolution, Err(expected), "{comment} {request}"); - } -} - -// Not part of enhanced-resolve -#[test] -fn infinite_recursion() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![ - ("./a".into(), vec![AliasValue::from("./b")]), - ("./b".into(), vec![AliasValue::from("./a")]), - ], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(f, "./a"); - assert_eq!(resolution, Err(ResolveError::Recursion)); -} - -fn check_slash(path: &Path) { - let s = path.to_string_lossy().to_string(); - #[cfg(target_os = "windows")] - { - assert!(!s.contains('/'), "{s}"); - assert!(s.contains('\\'), "{s}"); - } - #[cfg(not(target_os = "windows"))] - { - assert!(s.contains('/'), "{s}"); - assert!(!s.contains('\\'), "{s}"); - } -} - -#[test] -fn absolute_path() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![(f.join("foo").to_str().unwrap().to_string(), vec![AliasValue::Ignore])], - modules: vec![f.clone().to_str().unwrap().to_string()], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(&f, "foo/index"); - assert_eq!(resolution, Err(ResolveError::Ignored(f.join("foo")))); -} - -#[test] -fn system_path() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![("@app".into(), vec![AliasValue::from(f.join("alias").to_string_lossy())])], - ..ResolveOptions::default() - }); - - let specifiers = ["@app/files/a", "@app/files/a.js"]; - - for specifier in specifiers { - let path = resolver.resolve(&f, specifier).map(Resolution::into_path_buf).unwrap(); - assert_eq!(path, f.join("alias/files/a.js")); - check_slash(&path); - } -} - -#[test] -fn alias_is_full_path() { - let f = super::fixture(); - let dir = f.join("foo"); - let dir_str = dir.to_string_lossy().to_string(); - - let resolver = Resolver::new(ResolveOptions { - alias: vec![("@".into(), vec![AliasValue::Path(dir_str.clone())])], - ..ResolveOptions::default() - }); - - let mut ctx = ResolveContext::default(); - - let specifiers = [ - "@/index".to_string(), - "@/index.js".to_string(), - // specifier has multiple `/` for reasons we'll never know - "@////index".to_string(), - // specifier is a full path - dir_str, - ]; - - for specifier in specifiers { - let resolution = resolver.resolve_with_context(&f, &specifier, &mut ctx); - assert_eq!(resolution.map(|r| r.full_path()), Ok(dir.join("index.js"))); - } - - for path in ctx.file_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - check_slash(&path); - } - - for path in ctx.missing_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - check_slash(&path); - if let Some(path) = path.parent() { - assert!(!path.is_file(), "{path:?} must not be a file"); - } - } -} - -// For the `should_stop` variable in `load_alias` -#[test] -fn all_alias_values_are_not_found() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![( - "m1".to_string(), - vec![AliasValue::Path(f.join("node_modules").join("m2").to_string_lossy().to_string())], - )], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(&f, "m1/a.js"); - assert_eq!( - resolution, - Err(ResolveError::MatchedAliasNotFound("m1/a.js".to_string(), "m1".to_string(),)) - ); -} - -#[test] -fn alias_fragment() { - let f = super::fixture(); - - let data = [ - // enhanced-resolve has `#` prepended with a `\0`, they are removed from the - // following 3 expected test results. - // See https://github.com/webpack/enhanced-resolve#escaping - ( - "handle fragment edge case (no fragment)", - "./no#fragment/#/#", - f.join("no#fragment/#/#.js"), - ), - ("handle fragment edge case (fragment)", "./no#fragment/#/", f.join("no.js#fragment/#/")), - ( - "handle fragment escaping", - "./no\0#fragment/\0#/\0##fragment", - f.join("no#fragment/#/#.js#fragment"), - ), - ]; - - for (comment, request, expected) in data { - let resolver = Resolver::new(ResolveOptions { - alias: vec![("foo".to_string(), vec![AliasValue::Path(request.to_string())])], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f, "foo").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } -} - -#[test] -fn alias_try_fragment_as_path() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![( - "#".to_string(), - vec![AliasValue::Path(f.join("#").to_string_lossy().to_string())], - )], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(&f, "#/a").map(|r| r.full_path()); - assert_eq!(resolution, Ok(f.join("#").join("a.js"))); -} From 3b11ad83954ad42175da0d941f5cd1f40bfb6f42 Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Thu, 5 Sep 2024 21:30:43 +0300 Subject: [PATCH 70/82] --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 569bb774..29d75f37 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "devDependencies": { "@napi-rs/cli": "2.18.4", "@napi-rs/wasm-runtime": "0.2.4", - "@types/node": "22.5.3", + "@types/node": "22.5.4", "ava": "6.1.3", "emnapi": "1.2.0" }, From f27bf0d5652211968c6c53a554f4765a3b826d23 Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Sun, 8 Sep 2024 19:32:15 +0300 Subject: [PATCH 71/82] --- .github/workflows/release-plz.yml | 55 - pnpm-lock.yaml | 2598 ----------------------------- 2 files changed, 2653 deletions(-) delete mode 100644 .github/workflows/release-plz.yml delete mode 100644 pnpm-lock.yaml diff --git a/.github/workflows/release-plz.yml b/.github/workflows/release-plz.yml deleted file mode 100644 index 121758ad..00000000 --- a/.github/workflows/release-plz.yml +++ /dev/null @@ -1,55 +0,0 @@ -name: Release Plz - -on: - workflow_dispatch: - push: - branches: - - main - -permissions: - pull-requests: write - contents: write - -jobs: - release-plz: - name: Release-plz - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - uses: Boshen/setup-rust@main - with: - save-cache: ${{ github.ref_name == 'main' }} - cache-key: warm - - - name: Run release-plz - id: release-plz - uses: MarcoIeni/release-plz-action@v0.5 - env: - GITHUB_TOKEN: ${{ secrets.RELEASE_PLZ_TOKEN }} - CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} - - - name: Bump package.json - if: ${{ steps.release-plz.outputs.prs_created }} - env: - GH_TOKEN: ${{ github.token }} - RELEASES: ${{ steps.release-plz.outputs.releases }} - PR: ${{ steps.release-plz.outputs.pr }} - run: | - set -e - - pr_number=${{ fromJSON(steps.release-plz.outputs.pr).number }} - if [[ -n "$pr_number" ]]; then - version=$(echo "$RELEASES" | jq -r '.[0].version') - echo "version: $version" - - jq --arg version "${version}" '.version = ($version)' npm/package.json > tmp - mv tmp npm/package.json - - gh pr checkout $pr_number - git add . - git commit -m "Update package.json" - git push - fi diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml deleted file mode 100644 index 12371017..00000000 --- a/pnpm-lock.yaml +++ /dev/null @@ -1,2598 +0,0 @@ -lockfileVersion: '9.0' - -settings: - autoInstallPeers: true - excludeLinksFromLockfile: false - -importers: - - .: - devDependencies: - '@napi-rs/cli': - specifier: 3.0.0-alpha.58 - version: 3.0.0-alpha.58(@emnapi/runtime@1.2.0)(emnapi@1.2.0) - '@napi-rs/wasm-runtime': - specifier: ^0.2.4 - version: 0.2.4 - '@types/node': - specifier: ^22.0.0 - version: 22.5.4 - ava: - specifier: ^6.1.3 - version: 6.1.3 - emnapi: - specifier: ^1.2.0 - version: 1.2.0 - typescript: - specifier: ^5.5.3 - version: 5.5.4 - - fixtures/pnpm: - devDependencies: - axios: - specifier: 1.6.2 - version: 1.6.2 - ipaddr.js: - specifier: 2.2.0 - version: 2.2.0 - postcss: - specifier: 8.4.33 - version: 8.4.33 - styled-components: - specifier: 6.1.1 - version: 6.1.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - - npm: {} - -packages: - - '@emnapi/core@1.2.0': - resolution: {integrity: sha512-E7Vgw78I93we4ZWdYCb4DGAwRROGkMIXk7/y87UmANR+J6qsWusmC3gLt0H+O0KOt5e6O38U8oJamgbudrES/w==} - - '@emnapi/runtime@1.2.0': - resolution: {integrity: sha512-bV21/9LQmcQeCPEg3BDFtvwL6cwiTMksYNWQQ4KOxCZikEGalWtenoZ0wCiukJINlGCIi2KXx01g4FoH/LxpzQ==} - - '@emnapi/wasi-threads@1.0.1': - resolution: {integrity: sha512-iIBu7mwkq4UQGeMEM8bLwNK962nXdhodeScX4slfQnRhEMMzvYivHhutCIk8uojvmASXXPC2WNEjwxFWk72Oqw==} - - '@emotion/is-prop-valid@1.2.2': - resolution: {integrity: sha512-uNsoYd37AFmaCdXlg6EYD1KaPOaRWRByMCYzbKUX4+hhMfrxdVSelShywL4JVaAeM/eHUOSprYBQls+/neX3pw==} - - '@emotion/memoize@0.8.1': - resolution: {integrity: sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA==} - - '@emotion/unitless@0.8.1': - resolution: {integrity: sha512-KOEGMu6dmJZtpadb476IsZBclKvILjopjUii3V+7MnXIQCYh8W3NgNcgwo21n9LXZX6EDIKvqfjYxXebDwxKmQ==} - - '@inquirer/checkbox@2.3.10': - resolution: {integrity: sha512-CTc864M2/523rKc9AglIzAcUCuPXDZENgc5S2KZFVRbnMzpXcYTsUWmbqSeL0XLvtlvEtNevkkVbfVhJpruOyQ==} - engines: {node: '>=18'} - - '@inquirer/confirm@3.1.14': - resolution: {integrity: sha512-nbLSX37b2dGPtKWL3rPuR/5hOuD30S+pqJ/MuFiUEgN6GiMs8UMxiurKAMDzKt6C95ltjupa8zH6+3csXNHWpA==} - engines: {node: '>=18'} - - '@inquirer/core@9.0.2': - resolution: {integrity: sha512-nguvH3TZar3ACwbytZrraRTzGqyxJfYJwv+ZwqZNatAosdWQMP1GV8zvmkNlBe2JeZSaw0WYBHZk52pDpWC9qA==} - engines: {node: '>=18'} - - '@inquirer/editor@2.1.14': - resolution: {integrity: sha512-6nWpoJyVAKwAcv67bkbBmmi3f32xua79fP7TRmNUoR4K+B1GiOBsHO1YdvET/jvC+nTlBZL7puKAKyM7G+Lkzw==} - engines: {node: '>=18'} - - '@inquirer/expand@2.1.14': - resolution: {integrity: sha512-JcxsLajwPykF2kq6biIUdoOzTQ3LXqb8XMVrWkCprG/pFeU1SsxcSSFbF1T5jJGvvlTVcsE+JdGjbQ8ZRZ82RA==} - engines: {node: '>=18'} - - '@inquirer/figures@1.0.3': - resolution: {integrity: sha512-ErXXzENMH5pJt5/ssXV0DfWUZqly8nGzf0UcBV9xTnP+KyffE2mqyxIMBrZ8ijQck2nU0TQm40EQB53YreyWHw==} - engines: {node: '>=18'} - - '@inquirer/input@2.2.1': - resolution: {integrity: sha512-Yl1G6h7qWydzrJwqN777geeJVaAFL5Ly83aZlw4xHf8Z/BoTMfKRheyuMaQwOG7LQ4e5nQP7PxXdEg4SzQ+OKw==} - engines: {node: '>=18'} - - '@inquirer/number@1.0.2': - resolution: {integrity: sha512-GcoK+Phxcln0Qw9e73S5a8B2Ejg3HgSTvNfDegIcS5/BKwUm8t5rejja1l09WXjZM9vrVbRDf9RzWtSUiWVYRQ==} - engines: {node: '>=18'} - - '@inquirer/password@2.1.14': - resolution: {integrity: sha512-sPzOkXLhWJQ96K6nPZFnF8XB8tsDrcCRobd1d3EDz81F+4hp8BbdmsnsQcqZ7oYDIOVM/mWJyIUtJ35TrssJxQ==} - engines: {node: '>=18'} - - '@inquirer/prompts@5.1.2': - resolution: {integrity: sha512-E+ndnfwtVQtcmPt888Hc/HAxJUHSaA6OIvyvLAQ5BLQv+t20GbYdFSjXeLgb47OpMU+aRsKA/ys+Zoylw3kTVg==} - engines: {node: '>=18'} - - '@inquirer/rawlist@2.1.14': - resolution: {integrity: sha512-pLpEzhKNQ/ugFAFfgCNaXljB+dcCwmXwR1jOxAbVeFIdB3l02E5gjI+h1rb136tq0T8JO6P5KFR1oTeld/wdrA==} - engines: {node: '>=18'} - - '@inquirer/select@2.3.10': - resolution: {integrity: sha512-rr7iR0Zj1YFfgM8IUGimPD9Yukd+n/U63CnYT9kdum6DbRXtMxR45rrreP+EA9ixCnShr+W4xj7suRxC1+8t9g==} - engines: {node: '>=18'} - - '@inquirer/type@1.4.0': - resolution: {integrity: sha512-AjOqykVyjdJQvtfkNDGUyMYGF8xN50VUxftCQWsOyIo4DFRLr6VQhW0VItGI1JIyQGCGgIpKa7hMMwNhZb4OIw==} - engines: {node: '>=18'} - - '@mapbox/node-pre-gyp@1.0.11': - resolution: {integrity: sha512-Yhlar6v9WQgUp/He7BdgzOz8lqMQ8sU+jkCq7Wx8Myc5YFJLbEe7lgui/V7G1qB1DJykHSGwreceSaD60Y0PUQ==} - hasBin: true - - '@napi-rs/cli@3.0.0-alpha.58': - resolution: {integrity: sha512-BVLF6rS5cjLJNPDktqcYsYax/nYhwHyFXFMJSDEqC0MmqCdiucVmW9pQZkrBKM1N/qddHcNr+GFEjTN0h7ns6Q==} - engines: {node: '>= 16'} - hasBin: true - peerDependencies: - '@emnapi/runtime': ^1.1.0 - emnapi: ^1.1.0 - peerDependenciesMeta: - '@emnapi/runtime': - optional: true - emnapi: - optional: true - - '@napi-rs/cross-toolchain@0.0.16': - resolution: {integrity: sha512-jwdjHT5L0m9MH0CmzDwPp0ckn/UO7afHCsPeo7NugHUvYgvlgS7SWhdMVgIgJW2HHqhcW/2nhaLLGpAU1c7QRQ==} - peerDependencies: - '@napi-rs/cross-toolchain-arm64-target-aarch64': ^0.0.16 - '@napi-rs/cross-toolchain-arm64-target-armv7': ^0.0.16 - '@napi-rs/cross-toolchain-arm64-target-x86_64': ^0.0.16 - '@napi-rs/cross-toolchain-x64-target-aarch64': ^0.0.16 - '@napi-rs/cross-toolchain-x64-target-armv7': ^0.0.16 - '@napi-rs/cross-toolchain-x64-target-x86_64': ^0.0.16 - peerDependenciesMeta: - '@napi-rs/cross-toolchain-arm64-target-aarch64': - optional: true - '@napi-rs/cross-toolchain-arm64-target-armv7': - optional: true - '@napi-rs/cross-toolchain-arm64-target-x86_64': - optional: true - '@napi-rs/cross-toolchain-x64-target-aarch64': - optional: true - '@napi-rs/cross-toolchain-x64-target-armv7': - optional: true - '@napi-rs/cross-toolchain-x64-target-x86_64': - optional: true - - '@napi-rs/lzma-android-arm-eabi@1.3.1': - resolution: {integrity: sha512-mtGOg8jXlc+pTBI86cqohfndS9UmOAkk9d5CChKMb8btVks70yhUN1e7YYS3QFbmoxbPs2Ee+wmuH1Khdc7B2w==} - engines: {node: '>= 10'} - cpu: [arm] - os: [android] - - '@napi-rs/lzma-android-arm64@1.3.1': - resolution: {integrity: sha512-4uGkQgAv9Tnc/i0k2eIgbhZgyzs94+iECWxz4MFZNcZ1fNGvGbRL2j+SITE4OmwrUn3TuFK/uYWfgzooq8E1Qg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [android] - - '@napi-rs/lzma-darwin-arm64@1.3.1': - resolution: {integrity: sha512-MZBg4iwHTS8icjTiCMdzh8kYrMmKBCEglFPa+vjI91R2XDwuuwSzqmpATRpmMH8cWUUWtGPF4fnxKzjgkzhd4Q==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [darwin] - - '@napi-rs/lzma-darwin-x64@1.3.1': - resolution: {integrity: sha512-7vte+1lYV7xgZERKH/pjAeh4T16aQASKOzu4op70pK6VP/64Plr5rrvqxQqQmlAIe4pwyo/RkFl1n4LXDod3xg==} - engines: {node: '>= 10'} - cpu: [x64] - os: [darwin] - - '@napi-rs/lzma-freebsd-x64@1.3.1': - resolution: {integrity: sha512-uBS74fynTqLUC3catIxyezCafn8UDlr2yxVV47vz1T6Vop2PGDz/cMQdV6rnLSjPE08Rv66ihM36mgf/MmOkOg==} - engines: {node: '>= 10'} - cpu: [x64] - os: [freebsd] - - '@napi-rs/lzma-linux-arm-gnueabihf@1.3.1': - resolution: {integrity: sha512-rrVLyqBJeN29gPJCNkPbZ7dAzaseEcERKyhjwM+DfbFrDUvtkEcrYPvo+iwE/NmF+OkZQkzcanrVMGnq/mcJYQ==} - engines: {node: '>= 10'} - cpu: [arm] - os: [linux] - - '@napi-rs/lzma-linux-arm64-gnu@1.3.1': - resolution: {integrity: sha512-vDmVsthRbX2opkgRirJJGKQxUP/spvyVM2Y5CyCWZ7sadSID3hA97r38gf9ISn/sJ8/r93IPWLq+iycudNKi+Q==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/lzma-linux-arm64-musl@1.3.1': - resolution: {integrity: sha512-x4m/J3hRdFd3IoqKc+4aBcSUkcuDEP7hH6vdss8bKNLjPfXmnG/lcHJEQX3hNnNOULPP8xVRxgiY8jeL62cnsw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/lzma-linux-x64-gnu@1.3.1': - resolution: {integrity: sha512-riB+Xg72NfH8Kcpq07omshVu0QsLW0v2bhywBNYxvA+t2dGGWSIEN1U/zazUXys+IEA6pBQKqLVseurWE6Cl8g==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/lzma-linux-x64-musl@1.3.1': - resolution: {integrity: sha512-JXLgJFwoeysxdSg7rdVYP8wrliCQVJlU5JcLYjRVSCL4P0mQTjnYi7R7VdaOkDACw/Fvlji7oIJXt0KiaDTcOw==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/lzma-wasm32-wasi@1.3.1': - resolution: {integrity: sha512-XTA9XTUtj0KPKuzNS2oi3bWN6tJodk00wwMd/TiKoEqx9Fe/zu+OfDGuXAn+xs+P7S3YCDHqjYinuTQMZ0ucJw==} - engines: {node: '>=14.0.0'} - cpu: [wasm32] - - '@napi-rs/lzma-win32-arm64-msvc@1.3.1': - resolution: {integrity: sha512-qLDfs9UEtLPPTN/FdSz3gSdlx86VwFQBuLBrQtaiYQtUTKZCOYV1Z1fXqFt5Zqa1HKV2oyXnwGcTI7RpcyXxtg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [win32] - - '@napi-rs/lzma-win32-ia32-msvc@1.3.1': - resolution: {integrity: sha512-rWNlxLFMIfvxzfdQCfeQ3D/HEnQG3vfladFYrXUx6ePXO6r+BLCGn6/LWSSuKlw4vKkb1iHEWsAVaRLIcJEMIA==} - engines: {node: '>= 10'} - cpu: [ia32] - os: [win32] - - '@napi-rs/lzma-win32-x64-msvc@1.3.1': - resolution: {integrity: sha512-SNfHNqEjabXfTL1+KRi0qiAhwIlZHhQystvfSYX6p1g+2trSC/3WUpUQ4fbbR7KyE31g2AAnwjXivnlQ0af/pg==} - engines: {node: '>= 10'} - cpu: [x64] - os: [win32] - - '@napi-rs/lzma@1.3.1': - resolution: {integrity: sha512-XyZoBlYNMvCulK/RmVK/0nB3j7IdH7HpqcrMMg0U+HqQqKRLOQBwvnKNBocPC1bZQ7iZuKWYTLn1ayZwTyek8w==} - engines: {node: '>= 10'} - - '@napi-rs/tar-android-arm-eabi@0.1.1': - resolution: {integrity: sha512-Ufa0ahZvE5KGrC2WBux5svCe/jvC+e8IgtleiicwqnfgTfbDknYyq/QuqkP1AnMp/IvTmx2iutCZt6OFIG0zAg==} - engines: {node: '>= 10'} - cpu: [arm] - os: [android] - - '@napi-rs/tar-android-arm64@0.1.1': - resolution: {integrity: sha512-KUu5fHIiIObSuZ/crHxUrQ243+LiCRKPwdCVLHwjtftqFjzls+R2Mp6GrpM41XxexDMN00SUta3kazi93Xr19A==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [android] - - '@napi-rs/tar-darwin-arm64@0.1.1': - resolution: {integrity: sha512-jaqgdX20iIga+2gzotQ78eF00Cm8vECocUYeMY62WqyzJNv/jx1dlOfELWEccOjpmawFT9tjWebsS9F1QMvSUg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [darwin] - - '@napi-rs/tar-darwin-x64@0.1.1': - resolution: {integrity: sha512-80sa32IxfRso9x9sGTFpfLSx3BnruyJODpSkUzalOCz9i14n5gOKA8KR/JrnSWwDz0p5l5P9kfQD3pu8Voj7WA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [darwin] - - '@napi-rs/tar-freebsd-x64@0.1.1': - resolution: {integrity: sha512-P7V1zBjjC1dCrTwtUzuzYM4AeZduigeCtd8qQw2IUZowM5AsmhMd77oYuXjdU29cEpKUpyYjJRxjPCzFy+WbAQ==} - engines: {node: '>= 10'} - cpu: [x64] - os: [freebsd] - - '@napi-rs/tar-linux-arm-gnueabihf@0.1.1': - resolution: {integrity: sha512-qpC71ILPkWKt8k1iJCYt5gjwcOkd2VFSQIelTRr12t5CVNKV04rE/TMdwFoCP7kxbtb9Fl2cZzCRISw2BhMCmQ==} - engines: {node: '>= 10'} - cpu: [arm] - os: [linux] - - '@napi-rs/tar-linux-arm64-gnu@0.1.1': - resolution: {integrity: sha512-71QgxcFJCog6O4Tauoge8D0ILkDGJTRk3ru7zG8PUFG1QXJ1kkiRikdT77YmoVxtomc9FUOt+bdEdU5Yn+3QUQ==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/tar-linux-arm64-musl@0.1.1': - resolution: {integrity: sha512-R2e7YEILPKc447N1hUt1zQuyy0st83HX6nhmtFywS1aOj76/3hzxLVrebGiiS6kifyCrO82o66CNTYe7DixMZw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/tar-linux-x64-gnu@0.1.1': - resolution: {integrity: sha512-tmy9q2LXUB2GQ+IgUzJn3+us52leplMu96ORyFq1iHQEelGSqXt4xi5DzU07JhX3obJPqVqkybtcRS4enBfmBA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/tar-linux-x64-musl@0.1.1': - resolution: {integrity: sha512-j5ePbe6vihApl0cGPPDUVTWZbf2mF4NhxngAoG2jp7AeX3cWP2O4pjsvaOraW6QfvWEMFPeER7S0b6eBS7duvA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/tar-wasm32-wasi@0.1.1': - resolution: {integrity: sha512-se0+DlOiIRt7mcz7BeOJDoZtCrROpKLwiAOGmNgrjQ/SZS7TnOPuwm3wy9XN9WLoepttEjCEem6UP8yD5GJuQg==} - engines: {node: '>=14.0.0'} - cpu: [wasm32] - - '@napi-rs/tar-win32-arm64-msvc@0.1.1': - resolution: {integrity: sha512-FDZPi2wC7RwzvodogigLh/pJvhqCTVTUqOYuHlLkPSUbSAGiEkI55wk9RqH3y3EdJQaDuzyqC0QKz5ket2U+GA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [win32] - - '@napi-rs/tar-win32-ia32-msvc@0.1.1': - resolution: {integrity: sha512-OPR9Tou5z5M912G7Kc7gkf1ltinbOQx5dS/OeDIWHvPGOfdFDIxt0YVKhzSLRJi43+zIDp8/+cbeMD/cKXfX8w==} - engines: {node: '>= 10'} - cpu: [ia32] - os: [win32] - - '@napi-rs/tar-win32-x64-msvc@0.1.1': - resolution: {integrity: sha512-hiv5KfhrMSg8tTRC2oQXVckVg1h6ZVjwbd5aF9Esl0V3p2TaNFwwbqgnAN4Gm/PmSnHWNL/IRTHkk3cOzDWihQ==} - engines: {node: '>= 10'} - cpu: [x64] - os: [win32] - - '@napi-rs/tar@0.1.1': - resolution: {integrity: sha512-FOMhwwlvoYjHaDBxP26K3D92ltw1Y/CC4CIjgC6qXdzW4MYNwTlEyI58smCM3k+nCVJH3kpOYyH3sgbK4WZA4A==} - engines: {node: '>= 10'} - - '@napi-rs/wasm-runtime@0.2.4': - resolution: {integrity: sha512-9zESzOO5aDByvhIAsOy9TbpZ0Ur2AJbUI7UT73kcUTS2mxAMHOBaa1st/jAymNoCtvrit99kkzT1FZuXVcgfIQ==} - - '@napi-rs/wasm-tools-android-arm-eabi@0.0.2': - resolution: {integrity: sha512-/b+UU3suXjW4P0DzHRNdrnebQtFKcQf/YMeZJH+xUlKgvwli5kbmWjx8Wqqz0VETVkUTuPqJMBDIVLyc+14FGw==} - engines: {node: '>= 10'} - cpu: [arm] - os: [android] - - '@napi-rs/wasm-tools-android-arm64@0.0.2': - resolution: {integrity: sha512-j57GbDflwJdZtT8pZj5fOV4JAP+LdKN+wzsUYs+QRUoBqpWbbUANudolqfw63bkS9sD4z7fbCuz8iwtJqzxTVA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [android] - - '@napi-rs/wasm-tools-darwin-arm64@0.0.2': - resolution: {integrity: sha512-P2ChgWgVuv9GwmbxN89R84KzIImoTqXINteEixUvmkdnhyFiR+I8deNs89Yed+5w8QLC6MEfrtRqLP9YI+NoQA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [darwin] - - '@napi-rs/wasm-tools-darwin-x64@0.0.2': - resolution: {integrity: sha512-T/kQQ0gt8+wau1Z821PKVAD76QhmwVoLs2CT7Z9tTBs2pJvwSCP0C/kQiQAHcJIMi7A2E9Ab/Mez0BERy50EFA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [darwin] - - '@napi-rs/wasm-tools-freebsd-x64@0.0.2': - resolution: {integrity: sha512-GnnHu+r5sfzuxC/1J5UMF/h3BOZnHb3NQZ5hmbCfZYCKzpzRxrAJhzRunlbRN+v0x8M/49dztVTYR3s7K4ooAw==} - engines: {node: '>= 10'} - cpu: [x64] - os: [freebsd] - - '@napi-rs/wasm-tools-linux-arm64-gnu@0.0.2': - resolution: {integrity: sha512-KnZdLT0OnKb1CG2kdt3/WvM43vr9i+FEwXCvSOVC/6Tsifz7ynhMg7LAVESILd03HubzQJfg9nbRsk0bQ+IOwg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/wasm-tools-linux-arm64-musl@0.0.2': - resolution: {integrity: sha512-HkpZOID2U8P6pWqK3mqZ8bxU5xcuT3iA2fO+jrxn78h006iYgfNmdc5JaVhHnHazMmk32xKhSV4iV0VUh8UWDg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/wasm-tools-linux-x64-gnu@0.0.2': - resolution: {integrity: sha512-YksJWBCyOalB9ogtP9+/dZKP+vR6+h7BmzMXaXMT71WW/GvIsifMVgv+DY/FRSNJQupp5Y+ugjqVAOUOc/G65g==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/wasm-tools-linux-x64-musl@0.0.2': - resolution: {integrity: sha512-sPtRxPMdw05KdTcxgSPMmSXG2+PiK3vJ/l2+g9hvjnnKtvslJN2Hr7j8zgzuoKRAUFPaJVe6+D2xVh5cpdqhww==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/wasm-tools-wasm32-wasi@0.0.2': - resolution: {integrity: sha512-muRvZK7AIuo88G2AxYx3gA59rHMQgoN004saQkBvXnz3K/DVHKfTZ6TtUebss8zI3dURU6xExL8drxFWYxjEbQ==} - engines: {node: '>=14.0.0'} - cpu: [wasm32] - - '@napi-rs/wasm-tools-win32-arm64-msvc@0.0.2': - resolution: {integrity: sha512-Cn13WQ+tpFqdVwx0DIWKbsI9auFyzVZV4F5UNOUeDt6GgOL+NndgJul0Pc9bSU6fi03AylMPfF/nTCaDWO2Wgw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [win32] - - '@napi-rs/wasm-tools-win32-ia32-msvc@0.0.2': - resolution: {integrity: sha512-xsg5DkIQi82a8rcx6246Y3XC8TIqHamY+/C6sIlPLaZEuHctDkMECAw0AANwRf5vN//D2oo2oljOuoYtB1GOKw==} - engines: {node: '>= 10'} - cpu: [ia32] - os: [win32] - - '@napi-rs/wasm-tools-win32-x64-msvc@0.0.2': - resolution: {integrity: sha512-yHigltEt33eq8bappvKsIliz4MxfMPn1M+NWbIFRWN+IS1Z57mhmc1osuk+IRXrSlq0Tom0R6MYN1jpkZKz81Q==} - engines: {node: '>= 10'} - cpu: [x64] - os: [win32] - - '@napi-rs/wasm-tools@0.0.2': - resolution: {integrity: sha512-kBvDQCP5BLw2TxTENXLp3Of7vVEx0uyIye824JHE4dduzzOHVgSoOFVhVqAT3Fx/hLV445RVWfEqQbXMg4w/Mw==} - engines: {node: '>= 10'} - - '@nodelib/fs.scandir@2.1.5': - resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} - engines: {node: '>= 8'} - - '@nodelib/fs.stat@2.0.5': - resolution: {integrity: sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==} - engines: {node: '>= 8'} - - '@nodelib/fs.walk@1.2.8': - resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} - engines: {node: '>= 8'} - - '@octokit/auth-token@5.1.1': - resolution: {integrity: sha512-rh3G3wDO8J9wSjfI436JUKzHIxq8NaiL0tVeB2aXmG6p/9859aUOAjA9pmSPNGGZxfwmaJ9ozOJImuNVJdpvbA==} - engines: {node: '>= 18'} - - '@octokit/core@6.1.2': - resolution: {integrity: sha512-hEb7Ma4cGJGEUNOAVmyfdB/3WirWMg5hDuNFVejGEDFqupeOysLc2sG6HJxY2etBp5YQu5Wtxwi020jS9xlUwg==} - engines: {node: '>= 18'} - - '@octokit/endpoint@10.1.1': - resolution: {integrity: sha512-JYjh5rMOwXMJyUpj028cu0Gbp7qe/ihxfJMLc8VZBMMqSwLgOxDI1911gV4Enl1QSavAQNJcwmwBF9M0VvLh6Q==} - engines: {node: '>= 18'} - - '@octokit/graphql@8.1.1': - resolution: {integrity: sha512-ukiRmuHTi6ebQx/HFRCXKbDlOh/7xEV6QUXaE7MJEKGNAncGI/STSbOkl12qVXZrfZdpXctx5O9X1AIaebiDBg==} - engines: {node: '>= 18'} - - '@octokit/openapi-types@22.2.0': - resolution: {integrity: sha512-QBhVjcUa9W7Wwhm6DBFu6ZZ+1/t/oYxqc2tp81Pi41YNuJinbFRx8B133qVOrAaBbF7D/m0Et6f9/pZt9Rc+tg==} - - '@octokit/plugin-paginate-rest@11.3.3': - resolution: {integrity: sha512-o4WRoOJZlKqEEgj+i9CpcmnByvtzoUYC6I8PD2SA95M+BJ2x8h7oLcVOg9qcowWXBOdcTRsMZiwvM3EyLm9AfA==} - engines: {node: '>= 18'} - peerDependencies: - '@octokit/core': '>=6' - - '@octokit/plugin-request-log@5.3.0': - resolution: {integrity: sha512-FiGcyjdtYPlr03ExBk/0ysIlEFIFGJQAVoPPMxL19B24bVSEiZQnVGBunNtaAF1YnvE/EFoDpXmITtRnyCiypQ==} - engines: {node: '>= 18'} - peerDependencies: - '@octokit/core': '>=6' - - '@octokit/plugin-rest-endpoint-methods@13.2.4': - resolution: {integrity: sha512-gusyAVgTrPiuXOdfqOySMDztQHv6928PQ3E4dqVGEtOvRXAKRbJR4b1zQyniIT9waqaWk/UDaoJ2dyPr7Bk7Iw==} - engines: {node: '>= 18'} - peerDependencies: - '@octokit/core': '>=6' - - '@octokit/request-error@6.1.2': - resolution: {integrity: sha512-sA0oF7aL5wXbNfl+7zgLYJiFZctei9GaIMJlTraJrlQyFaoIYr4MCqPSakzxxGCfm8fET4vn0cQdRFmD7avlDg==} - engines: {node: '>= 18'} - - '@octokit/request@9.1.1': - resolution: {integrity: sha512-pyAguc0p+f+GbQho0uNetNQMmLG1e80WjkIaqqgUkihqUp0boRU6nKItXO4VWnr+nbZiLGEyy4TeKRwqaLvYgw==} - engines: {node: '>= 18'} - - '@octokit/rest@21.0.0': - resolution: {integrity: sha512-XudXXOmiIjivdjNZ+fN71NLrnDM00sxSZlhqmPR3v0dVoJwyP628tSlc12xqn8nX3N0965583RBw5GPo6r8u4Q==} - engines: {node: '>= 18'} - - '@octokit/types@13.5.0': - resolution: {integrity: sha512-HdqWTf5Z3qwDVlzCrP8UJquMwunpDiMPt5er+QjGzL4hqr/vBVY/MauQgS1xWxCDT1oMx1EULyqxncdCY/NVSQ==} - - '@rollup/pluginutils@4.2.1': - resolution: {integrity: sha512-iKnFXr7NkdZAIHiIWE+BX5ULi/ucVFYWD6TbAV+rZctiRTY2PL6tsIKhoIOaoskiWAkgu+VsbXgUVDNLHf+InQ==} - engines: {node: '>= 8.0.0'} - - '@sindresorhus/merge-streams@2.3.0': - resolution: {integrity: sha512-LtoMMhxAlorcGhmFYI+LhPgbPZCkgP6ra1YL604EeF6U98pLlQ3iWIGMdWSC+vWmPBWBNgmDBAhnAobLROJmwg==} - engines: {node: '>=18'} - - '@tybys/wasm-util@0.9.0': - resolution: {integrity: sha512-6+7nlbMVX/PVDCwaIQ8nTOPveOcFLSt8GcXdx8hD0bt39uWxYT88uXzqTd4fTvqta7oeUJqudepapKNt2DYJFw==} - - '@types/mute-stream@0.0.4': - resolution: {integrity: sha512-CPM9nzrCPPJHQNA9keH9CVkVI+WR5kMa+7XEs5jcGQ0VoAGnLv242w8lIVgwAEfmE4oufJRaTc9PNLQl0ioAow==} - - '@types/node@20.16.5': - resolution: {integrity: sha512-VwYCweNo3ERajwy0IUlqqcyZ8/A7Zwa9ZP3MnENWcB11AejO+tLy3pu850goUW2FC/IJMdZUfKpX/yxL1gymCA==} - - '@types/node@22.5.4': - resolution: {integrity: sha512-FDuKUJQm/ju9fT/SeX/6+gBzoPzlVCzfzmGkwKvRHQVxi4BntVbyIwf6a4Xn62mrvndLiml6z/UBXIdEVjQLXg==} - - '@types/stylis@4.2.6': - resolution: {integrity: sha512-4nebF2ZJGzQk0ka0O6+FZUWceyFv4vWq/0dXBMmrSeAwzOuOd/GxE5Pa64d/ndeNLG73dXoBsRzvtsVsYUv6Uw==} - - '@types/wrap-ansi@3.0.0': - resolution: {integrity: sha512-ltIpx+kM7g/MLRZfkbL7EsCEjfzCcScLpkg37eXEtx5kmrAKBkTJwd1GIAjDSL8wTpM6Hzn5YO4pSb91BEwu1g==} - - '@vercel/nft@0.26.5': - resolution: {integrity: sha512-NHxohEqad6Ra/r4lGknO52uc/GrWILXAMs1BB4401GTqww0fw1bAqzpG1XHuDO+dprg4GvsD9ZLLSsdo78p9hQ==} - engines: {node: '>=16'} - hasBin: true - - abbrev@1.1.1: - resolution: {integrity: sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==} - - acorn-import-attributes@1.9.5: - resolution: {integrity: sha512-n02Vykv5uA3eHGM/Z2dQrcD56kL8TyDb2p1+0P83PClMnC/nc+anbQRhIOWnSq4Ke/KvDPrY3C9hDtC/A3eHnQ==} - peerDependencies: - acorn: ^8 - - acorn-walk@8.3.3: - resolution: {integrity: sha512-MxXdReSRhGO7VlFe1bRG/oI7/mdLV9B9JJT0N8vZOhF7gFRR5l3M8W9G8JxmKV+JC5mGqJ0QvqfSOLsCPa4nUw==} - engines: {node: '>=0.4.0'} - - acorn@8.12.1: - resolution: {integrity: sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg==} - engines: {node: '>=0.4.0'} - hasBin: true - - agent-base@6.0.2: - resolution: {integrity: sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==} - engines: {node: '>= 6.0.0'} - - ansi-escapes@4.3.2: - resolution: {integrity: sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==} - engines: {node: '>=8'} - - ansi-regex@5.0.1: - resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} - engines: {node: '>=8'} - - ansi-regex@6.0.1: - resolution: {integrity: sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==} - engines: {node: '>=12'} - - ansi-styles@4.3.0: - resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} - engines: {node: '>=8'} - - ansi-styles@6.2.1: - resolution: {integrity: sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==} - engines: {node: '>=12'} - - aproba@2.0.0: - resolution: {integrity: sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==} - - are-we-there-yet@2.0.0: - resolution: {integrity: sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw==} - engines: {node: '>=10'} - deprecated: This package is no longer supported. - - argparse@1.0.10: - resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==} - - argparse@2.0.1: - resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} - - array-find-index@1.0.2: - resolution: {integrity: sha512-M1HQyIXcBGtVywBt8WVdim+lrNaK7VHp99Qt5pSNziXznKHViIBbXWtfRTpEFpF/c4FdfxNAsCCwPp5phBYJtw==} - engines: {node: '>=0.10.0'} - - arrgv@1.0.2: - resolution: {integrity: sha512-a4eg4yhp7mmruZDQFqVMlxNRFGi/i1r87pt8SDHy0/I8PqSXoUTlWZRdAZo0VXgvEARcujbtTk8kiZRi1uDGRw==} - engines: {node: '>=8.0.0'} - - arrify@3.0.0: - resolution: {integrity: sha512-tLkvA81vQG/XqE2mjDkGQHoOINtMHtysSnemrmoGe6PydDPMRbVugqyk4A6V/WDWEfm3l+0d8anA9r8cv/5Jaw==} - engines: {node: '>=12'} - - async-sema@3.1.1: - resolution: {integrity: sha512-tLRNUXati5MFePdAk8dw7Qt7DpxPB60ofAgn8WRhW6a2rcimZnYBP9oxHiv0OHy+Wz7kPMG+t4LGdt31+4EmGg==} - - asynckit@0.4.0: - resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} - - ava@6.1.3: - resolution: {integrity: sha512-tkKbpF1pIiC+q09wNU9OfyTDYZa8yuWvU2up3+lFJ3lr1RmnYh2GBpPwzYUEB0wvTPIUysGjcZLNZr7STDviRA==} - engines: {node: ^18.18 || ^20.8 || ^21 || ^22} - hasBin: true - peerDependencies: - '@ava/typescript': '*' - peerDependenciesMeta: - '@ava/typescript': - optional: true - - axios@1.6.2: - resolution: {integrity: sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A==} - - balanced-match@1.0.2: - resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} - - before-after-hook@3.0.2: - resolution: {integrity: sha512-Nik3Sc0ncrMK4UUdXQmAnRtzmNQTAAXmXIopizwZ1W1t8QmfJj+zL4OA2I7XPTPW5z5TDqv4hRo/JzouDJnX3A==} - - bindings@1.5.0: - resolution: {integrity: sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==} - - blueimp-md5@2.19.0: - resolution: {integrity: sha512-DRQrD6gJyy8FbiE4s+bDoXS9hiW3Vbx5uCdwvcCf3zLHL+Iv7LtGHLpr+GZV8rHG8tK766FGYBwRbu8pELTt+w==} - - brace-expansion@1.1.11: - resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} - - braces@3.0.3: - resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==} - engines: {node: '>=8'} - - callsites@4.2.0: - resolution: {integrity: sha512-kfzR4zzQtAE9PC7CzZsjl3aBNbXWuXiSeOCdLcPpBfGW8YuCqQHcRPFDbr/BPVmd3EEPVpuFzLyuT/cUhPr4OQ==} - engines: {node: '>=12.20'} - - camelize@1.0.1: - resolution: {integrity: sha512-dU+Tx2fsypxTgtLoE36npi3UqcjSSMNYfkqgmoEhtZrraP5VWq0K7FkWVTYa8eMPtnU/G2txVsfdCJTn9uzpuQ==} - - cbor@9.0.2: - resolution: {integrity: sha512-JPypkxsB10s9QOWwa6zwPzqE1Md3vqpPc+cai4sAecuCsRyAtAl/pMyhPlMbT/xtPnm2dznJZYRLui57qiRhaQ==} - engines: {node: '>=16'} - - chalk@5.3.0: - resolution: {integrity: sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==} - engines: {node: ^12.17.0 || ^14.13 || >=16.0.0} - - chardet@0.7.0: - resolution: {integrity: sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==} - - chownr@2.0.0: - resolution: {integrity: sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==} - engines: {node: '>=10'} - - chunkd@2.0.1: - resolution: {integrity: sha512-7d58XsFmOq0j6el67Ug9mHf9ELUXsQXYJBkyxhH/k+6Ke0qXRnv0kbemx+Twc6fRJ07C49lcbdgm9FL1Ei/6SQ==} - - ci-info@4.0.0: - resolution: {integrity: sha512-TdHqgGf9odd8SXNuxtUBVx8Nv+qZOejE6qyqiy5NtbYYQOeFa6zmHkxlPzmaLxWWHsU6nJmB7AETdVPi+2NBUg==} - engines: {node: '>=8'} - - ci-parallel-vars@1.0.1: - resolution: {integrity: sha512-uvzpYrpmidaoxvIQHM+rKSrigjOe9feHYbw4uOI2gdfe1C3xIlxO+kVXq83WQWNniTf8bAxVpy+cQeFQsMERKg==} - - cli-spinners@2.9.2: - resolution: {integrity: sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==} - engines: {node: '>=6'} - - cli-truncate@4.0.0: - resolution: {integrity: sha512-nPdaFdQ0h/GEigbPClz11D0v/ZJEwxmeVZGeMo3Z5StPtUTkA9o1lD6QwoirYiSDzbcwn2XcjwmCp68W1IS4TA==} - engines: {node: '>=18'} - - cli-width@4.1.0: - resolution: {integrity: sha512-ouuZd4/dm2Sw5Gmqy6bGyNNNe1qt9RpmxveLSO7KcgsTnU7RXfsw+/bukWGo1abgBiMAic068rclZsO4IWmmxQ==} - engines: {node: '>= 12'} - - clipanion@3.2.1: - resolution: {integrity: sha512-dYFdjLb7y1ajfxQopN05mylEpK9ZX0sO1/RfMXdfmwjlIsPkbh4p7A682x++zFPLDCo1x3p82dtljHf5cW2LKA==} - peerDependencies: - typanion: '*' - - cliui@8.0.1: - resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==} - engines: {node: '>=12'} - - code-excerpt@4.0.0: - resolution: {integrity: sha512-xxodCmBen3iy2i0WtAK8FlFNrRzjUqjRsMfho58xT/wvZU1YTM3fCnRjcy1gJPMepaRlgm/0e6w8SpWHpn3/cA==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - color-convert@2.0.1: - resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} - engines: {node: '>=7.0.0'} - - color-name@1.1.4: - resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} - - color-support@1.1.3: - resolution: {integrity: sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==} - hasBin: true - - colorette@2.0.20: - resolution: {integrity: sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==} - - combined-stream@1.0.8: - resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} - engines: {node: '>= 0.8'} - - common-path-prefix@3.0.0: - resolution: {integrity: sha512-QE33hToZseCH3jS0qN96O/bSh3kaw/h+Tq7ngyY9eWDUnTlTNUyqfqvCXioLe5Na5jFsL78ra/wuBU4iuEgd4w==} - - concat-map@0.0.1: - resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} - - concordance@5.0.4: - resolution: {integrity: sha512-OAcsnTEYu1ARJqWVGwf4zh4JDfHZEaSNlNccFmt8YjB2l/n19/PF2viLINHc57vO4FKIAFl2FWASIGZZWZ2Kxw==} - engines: {node: '>=10.18.0 <11 || >=12.14.0 <13 || >=14'} - - console-control-strings@1.1.0: - resolution: {integrity: sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==} - - convert-to-spaces@2.0.1: - resolution: {integrity: sha512-rcQ1bsQO9799wq24uE5AM2tAILy4gXGIK/njFWcVQkGNZ96edlpY+A7bjwvzjYvLDyzmG1MmMLZhpcsb+klNMQ==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - css-color-keywords@1.0.0: - resolution: {integrity: sha512-FyyrDHZKEjXDpNJYvVsV960FiqQyXc/LlYmsxl2BcdMb2WPx0OGRVgTg55rPSyLSNMqP52R9r8geSp7apN3Ofg==} - engines: {node: '>=4'} - - css-to-react-native@3.2.0: - resolution: {integrity: sha512-e8RKaLXMOFii+02mOlqwjbD00KSEKqblnpO9e++1aXS1fPQOpS1YoqdVHBqPjHNoxeF2mimzVqawm2KCbEdtHQ==} - - csstype@3.1.3: - resolution: {integrity: sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==} - - currently-unhandled@0.4.1: - resolution: {integrity: sha512-/fITjgjGU50vjQ4FH6eUoYu+iUoUKIXws2hL15JJpIR+BbTxaXQsMuuyjtNh2WqsSBS5nsaZHFsFecyw5CCAng==} - engines: {node: '>=0.10.0'} - - date-time@3.1.0: - resolution: {integrity: sha512-uqCUKXE5q1PNBXjPqvwhwJf9SwMoAHBgWJ6DcrnS5o+W2JOiIILl0JEdVD8SGujrNS02GGxgwAg2PN2zONgtjg==} - engines: {node: '>=6'} - - debug@4.3.5: - resolution: {integrity: sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg==} - engines: {node: '>=6.0'} - peerDependencies: - supports-color: '*' - peerDependenciesMeta: - supports-color: - optional: true - - delayed-stream@1.0.0: - resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} - engines: {node: '>=0.4.0'} - - delegates@1.0.0: - resolution: {integrity: sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==} - - detect-libc@2.0.3: - resolution: {integrity: sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw==} - engines: {node: '>=8'} - - emittery@1.0.3: - resolution: {integrity: sha512-tJdCJitoy2lrC2ldJcqN4vkqJ00lT+tOWNT1hBJjO/3FDMJa5TTIiYGCKGkn/WfCyOzUMObeohbVTj00fhiLiA==} - engines: {node: '>=14.16'} - - emnapi@1.2.0: - resolution: {integrity: sha512-rcq+dJCcfr08I0XM/57LPRqaUokGfni/+SvhO7NaJthTTjRdohhIy0FQwyC5rR1enAsjkldQg83th8J5hURv0Q==} - peerDependencies: - node-addon-api: '>= 6.1.0' - peerDependenciesMeta: - node-addon-api: - optional: true - - emoji-regex@10.3.0: - resolution: {integrity: sha512-QpLs9D9v9kArv4lfDEgg1X/gN5XLnf/A6l9cs8SPZLRZR3ZkY9+kwIQTxm+fsSej5UMYGE8fdoaZVIBlqG0XTw==} - - emoji-regex@8.0.0: - resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} - - escalade@3.1.2: - resolution: {integrity: sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==} - engines: {node: '>=6'} - - escape-string-regexp@2.0.0: - resolution: {integrity: sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==} - engines: {node: '>=8'} - - escape-string-regexp@5.0.0: - resolution: {integrity: sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==} - engines: {node: '>=12'} - - esprima@4.0.1: - resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==} - engines: {node: '>=4'} - hasBin: true - - estree-walker@2.0.2: - resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==} - - esutils@2.0.3: - resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} - engines: {node: '>=0.10.0'} - - external-editor@3.1.0: - resolution: {integrity: sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==} - engines: {node: '>=4'} - - fast-diff@1.3.0: - resolution: {integrity: sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==} - - fast-glob@3.3.2: - resolution: {integrity: sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==} - engines: {node: '>=8.6.0'} - - fastq@1.17.1: - resolution: {integrity: sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==} - - figures@6.1.0: - resolution: {integrity: sha512-d+l3qxjSesT4V7v2fh+QnmFnUWv9lSpjarhShNTgBOfA0ttejbQUAlHLitbjkoRiDulW0OPoQPYIGhIC8ohejg==} - engines: {node: '>=18'} - - file-uri-to-path@1.0.0: - resolution: {integrity: sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==} - - fill-range@7.1.1: - resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==} - engines: {node: '>=8'} - - find-up-simple@1.0.0: - resolution: {integrity: sha512-q7Us7kcjj2VMePAa02hDAF6d+MzsdsAWEwYyOpwUtlerRBkOEPBCRZrAV4XfcSN8fHAgaD0hP7miwoay6DCprw==} - engines: {node: '>=18'} - - follow-redirects@1.15.6: - resolution: {integrity: sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==} - engines: {node: '>=4.0'} - peerDependencies: - debug: '*' - peerDependenciesMeta: - debug: - optional: true - - form-data@4.0.0: - resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==} - engines: {node: '>= 6'} - - fs-minipass@2.1.0: - resolution: {integrity: sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==} - engines: {node: '>= 8'} - - fs.realpath@1.0.0: - resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} - - gauge@3.0.2: - resolution: {integrity: sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q==} - engines: {node: '>=10'} - deprecated: This package is no longer supported. - - get-caller-file@2.0.5: - resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} - engines: {node: 6.* || 8.* || >= 10.*} - - get-east-asian-width@1.2.0: - resolution: {integrity: sha512-2nk+7SIVb14QrgXFHcm84tD4bKQz0RxPuMT8Ag5KPOq7J5fEmAg0UbXdTOSHqNuHSU28k55qnceesxXRZGzKWA==} - engines: {node: '>=18'} - - glob-parent@5.1.2: - resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} - engines: {node: '>= 6'} - - glob@7.2.3: - resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} - deprecated: Glob versions prior to v9 are no longer supported - - globby@14.0.2: - resolution: {integrity: sha512-s3Fq41ZVh7vbbe2PN3nrW7yC7U7MFVc5c98/iTl9c2GawNMKx/J648KQRW6WKkuU8GIbbh2IXfIRQjOZnXcTnw==} - engines: {node: '>=18'} - - graceful-fs@4.2.11: - resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} - - has-unicode@2.0.1: - resolution: {integrity: sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==} - - https-proxy-agent@5.0.1: - resolution: {integrity: sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==} - engines: {node: '>= 6'} - - iconv-lite@0.4.24: - resolution: {integrity: sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==} - engines: {node: '>=0.10.0'} - - ignore-by-default@2.1.0: - resolution: {integrity: sha512-yiWd4GVmJp0Q6ghmM2B/V3oZGRmjrKLXvHR3TE1nfoXsmoggllfZUQe74EN0fJdPFZu2NIvNdrMMLm3OsV7Ohw==} - engines: {node: '>=10 <11 || >=12 <13 || >=14'} - - ignore@5.3.1: - resolution: {integrity: sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==} - engines: {node: '>= 4'} - - imurmurhash@0.1.4: - resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} - engines: {node: '>=0.8.19'} - - indent-string@5.0.0: - resolution: {integrity: sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==} - engines: {node: '>=12'} - - inflight@1.0.6: - resolution: {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. - - inherits@2.0.4: - resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} - - inquirer@10.0.1: - resolution: {integrity: sha512-XgthhRIn0Ci9JdGJpUo2EtpPfaczbooZbGTN+FTzSCyUb7YHJcPPnuSXfeG5903bJMy3OyEoVTQMnvO4Ly5tFg==} - engines: {node: '>=18'} - - ipaddr.js@2.2.0: - resolution: {integrity: sha512-Ag3wB2o37wslZS19hZqorUnrnzSkpOVy+IiiDEiTqNubEYpYuHWIf6K4psgN2ZWKExS4xhVCrRVfb/wfW8fWJA==} - engines: {node: '>= 10'} - - irregular-plurals@3.5.0: - resolution: {integrity: sha512-1ANGLZ+Nkv1ptFb2pa8oG8Lem4krflKuX/gINiHJHjJUKaJHk/SXk5x6K3J+39/p0h1RQ2saROclJJ+QLvETCQ==} - engines: {node: '>=8'} - - is-extglob@2.1.1: - resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} - engines: {node: '>=0.10.0'} - - is-fullwidth-code-point@3.0.0: - resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} - engines: {node: '>=8'} - - is-fullwidth-code-point@4.0.0: - resolution: {integrity: sha512-O4L094N2/dZ7xqVdrXhh9r1KODPJpFms8B5sGdJLPy664AgvXsreZUyCQQNItZRDlYug4xStLjNp/sz3HvBowQ==} - engines: {node: '>=12'} - - is-glob@4.0.3: - resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} - engines: {node: '>=0.10.0'} - - is-number@7.0.0: - resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} - engines: {node: '>=0.12.0'} - - is-plain-object@5.0.0: - resolution: {integrity: sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==} - engines: {node: '>=0.10.0'} - - is-promise@4.0.0: - resolution: {integrity: sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==} - - is-unicode-supported@2.0.0: - resolution: {integrity: sha512-FRdAyx5lusK1iHG0TWpVtk9+1i+GjrzRffhDg4ovQ7mcidMQ6mj+MhKPmvh7Xwyv5gIS06ns49CA7Sqg7lC22Q==} - engines: {node: '>=18'} - - js-string-escape@1.0.1: - resolution: {integrity: sha512-Smw4xcfIQ5LVjAOuJCvN/zIodzA/BBSsluuoSykP+lUvScIi4U6RJLfwHet5cxFnCswUjISV8oAXaqaJDY3chg==} - engines: {node: '>= 0.8'} - - js-tokens@4.0.0: - resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} - - js-yaml@3.14.1: - resolution: {integrity: sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==} - hasBin: true - - js-yaml@4.1.0: - resolution: {integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==} - hasBin: true - - load-json-file@7.0.1: - resolution: {integrity: sha512-Gnxj3ev3mB5TkVBGad0JM6dmLiQL+o0t23JPBZ9sd+yvSLk05mFoqKBw5N8gbbkU4TNXyqCgIrl/VM17OgUIgQ==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - lodash-es@4.17.21: - resolution: {integrity: sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==} - - lodash@4.17.21: - resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} - - loose-envify@1.4.0: - resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==} - hasBin: true - - make-dir@3.1.0: - resolution: {integrity: sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==} - engines: {node: '>=8'} - - matcher@5.0.0: - resolution: {integrity: sha512-s2EMBOWtXFc8dgqvoAzKJXxNHibcdJMV0gwqKUaw9E2JBJuGUK7DrNKrA6g/i+v72TT16+6sVm5mS3thaMLQUw==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - md5-hex@3.0.1: - resolution: {integrity: sha512-BUiRtTtV39LIJwinWBjqVsU9xhdnz7/i889V859IBFpuqGAj6LuOvHv5XLbgZ2R7ptJoJaEcxkv88/h25T7Ciw==} - engines: {node: '>=8'} - - memoize@10.0.0: - resolution: {integrity: sha512-H6cBLgsi6vMWOcCpvVCdFFnl3kerEXbrYh9q+lY6VXvQSmM6CkmV08VOwT+WE2tzIEqRPFfAq3fm4v/UIW6mSA==} - engines: {node: '>=18'} - - merge2@1.4.1: - resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} - engines: {node: '>= 8'} - - micromatch@4.0.7: - resolution: {integrity: sha512-LPP/3KorzCwBxfeUuZmaR6bG2kdeHSbe0P2tY3FLRU4vYrjYz5hI4QZwV0njUx3jeuKe67YukQ1LSPZBKDqO/Q==} - engines: {node: '>=8.6'} - - mime-db@1.52.0: - resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} - engines: {node: '>= 0.6'} - - mime-types@2.1.35: - resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} - engines: {node: '>= 0.6'} - - mimic-function@5.0.1: - resolution: {integrity: sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==} - engines: {node: '>=18'} - - minimatch@3.1.2: - resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} - - minipass@3.3.6: - resolution: {integrity: sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==} - engines: {node: '>=8'} - - minipass@5.0.0: - resolution: {integrity: sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==} - engines: {node: '>=8'} - - minizlib@2.1.2: - resolution: {integrity: sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==} - engines: {node: '>= 8'} - - mkdirp@1.0.4: - resolution: {integrity: sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==} - engines: {node: '>=10'} - hasBin: true - - ms@2.1.2: - resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} - - ms@2.1.3: - resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} - - mute-stream@1.0.0: - resolution: {integrity: sha512-avsJQhyd+680gKXyG/sQc0nXaC6rBkPOfyHYcFb9+hdkqQkR9bdnkJ0AMZhke0oesPqIO+mFFJ+IdBc7mst4IA==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - - nanoid@3.3.7: - resolution: {integrity: sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==} - engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} - hasBin: true - - node-fetch@2.7.0: - resolution: {integrity: sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==} - engines: {node: 4.x || >=6.0.0} - peerDependencies: - encoding: ^0.1.0 - peerDependenciesMeta: - encoding: - optional: true - - node-gyp-build@4.8.1: - resolution: {integrity: sha512-OSs33Z9yWr148JZcbZd5WiAXhh/n9z8TxQcdMhIOlpN9AhWpLfvVFO73+m77bBABQMaY9XSvIa+qk0jlI7Gcaw==} - hasBin: true - - nofilter@3.1.0: - resolution: {integrity: sha512-l2NNj07e9afPnhAhvgVrCD/oy2Ai1yfLpuo3EpiO1jFTsB4sFz6oIfAfSZyQzVpkZQ9xS8ZS5g1jCBgq4Hwo0g==} - engines: {node: '>=12.19'} - - nopt@5.0.0: - resolution: {integrity: sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==} - engines: {node: '>=6'} - hasBin: true - - npmlog@5.0.1: - resolution: {integrity: sha512-AqZtDUWOMKs1G/8lwylVjrdYgqA4d9nu8hc+0gzRxlDb1I10+FHBGMXs6aiQHFdCUUlqH99MUMuLfzWDNDtfxw==} - deprecated: This package is no longer supported. - - object-assign@4.1.1: - resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} - engines: {node: '>=0.10.0'} - - once@1.4.0: - resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} - - os-tmpdir@1.0.2: - resolution: {integrity: sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==} - engines: {node: '>=0.10.0'} - - p-map@7.0.2: - resolution: {integrity: sha512-z4cYYMMdKHzw4O5UkWJImbZynVIo0lSGTXc7bzB1e/rrDqkgGUNysK/o4bTr+0+xKvvLoTyGqYC4Fgljy9qe1Q==} - engines: {node: '>=18'} - - package-config@5.0.0: - resolution: {integrity: sha512-GYTTew2slBcYdvRHqjhwaaydVMvn/qrGC323+nKclYioNSLTDUM/lGgtGTgyHVtYcozb+XkE8CNhwcraOmZ9Mg==} - engines: {node: '>=18'} - - parse-ms@4.0.0: - resolution: {integrity: sha512-TXfryirbmq34y8QBwgqCVLi+8oA3oWx2eAnSn62ITyEhEYaWRlVZ2DvMM9eZbMs/RfxPu/PK/aBLyGj4IrqMHw==} - engines: {node: '>=18'} - - path-is-absolute@1.0.1: - resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==} - engines: {node: '>=0.10.0'} - - path-type@5.0.0: - resolution: {integrity: sha512-5HviZNaZcfqP95rwpv+1HDgUamezbqdSYTyzjTvwtJSnIH+3vnbmWsItli8OFEndS984VT55M3jduxZbX351gg==} - engines: {node: '>=12'} - - picocolors@1.0.1: - resolution: {integrity: sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==} - - picomatch@2.3.1: - resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} - engines: {node: '>=8.6'} - - picomatch@3.0.1: - resolution: {integrity: sha512-I3EurrIQMlRc9IaAZnqRR044Phh2DXY+55o7uJ0V+hYZAcQYSuFWsc9q5PvyDHUSCe1Qxn/iBz+78s86zWnGag==} - engines: {node: '>=10'} - - plur@5.1.0: - resolution: {integrity: sha512-VP/72JeXqak2KiOzjgKtQen5y3IZHn+9GOuLDafPv0eXa47xq0At93XahYBs26MsifCQ4enGKwbjBTKgb9QJXg==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - postcss-value-parser@4.2.0: - resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==} - - postcss@8.4.33: - resolution: {integrity: sha512-Kkpbhhdjw2qQs2O2DGX+8m5OVqEcbB9HRBvuYM9pgrjEFUg30A9LmXNlTAUj4S9kgtGyrMbTzVjH7E+s5Re2yg==} - engines: {node: ^10 || ^12 || >=14} - - pretty-ms@9.0.0: - resolution: {integrity: sha512-E9e9HJ9R9NasGOgPaPE8VMeiPKAyWR5jcFpNnwIejslIhWqdqOrb2wShBsncMPUb+BcCd2OPYfh7p2W6oemTng==} - engines: {node: '>=18'} - - proxy-from-env@1.1.0: - resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==} - - queue-microtask@1.2.3: - resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} - - react-dom@18.3.1: - resolution: {integrity: sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==} - peerDependencies: - react: ^18.3.1 - - react@18.3.1: - resolution: {integrity: sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==} - engines: {node: '>=0.10.0'} - - readable-stream@3.6.2: - resolution: {integrity: sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==} - engines: {node: '>= 6'} - - require-directory@2.1.1: - resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} - engines: {node: '>=0.10.0'} - - resolve-cwd@3.0.0: - resolution: {integrity: sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==} - engines: {node: '>=8'} - - resolve-from@5.0.0: - resolution: {integrity: sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==} - engines: {node: '>=8'} - - reusify@1.0.4: - resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==} - engines: {iojs: '>=1.0.0', node: '>=0.10.0'} - - rimraf@3.0.2: - resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==} - deprecated: Rimraf versions prior to v4 are no longer supported - hasBin: true - - run-async@3.0.0: - resolution: {integrity: sha512-540WwVDOMxA6dN6We19EcT9sc3hkXPw5mzRNGM3FkdN/vtE9NFvj5lFAPNwUDmJjXidm3v7TC1cTE7t17Ulm1Q==} - engines: {node: '>=0.12.0'} - - run-parallel@1.2.0: - resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} - - rxjs@7.8.1: - resolution: {integrity: sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==} - - safe-buffer@5.2.1: - resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} - - safer-buffer@2.1.2: - resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} - - scheduler@0.23.2: - resolution: {integrity: sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ==} - - semver@6.3.1: - resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} - hasBin: true - - semver@7.6.2: - resolution: {integrity: sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==} - engines: {node: '>=10'} - hasBin: true - - serialize-error@7.0.1: - resolution: {integrity: sha512-8I8TjW5KMOKsZQTvoxjuSIa7foAwPWGOts+6o7sgjz41/qMD9VQHEDxi6PBvK2l0MXUmqZyNpUK+T2tQaaElvw==} - engines: {node: '>=10'} - - set-blocking@2.0.0: - resolution: {integrity: sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==} - - shallowequal@1.1.0: - resolution: {integrity: sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ==} - - signal-exit@3.0.7: - resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} - - signal-exit@4.1.0: - resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} - engines: {node: '>=14'} - - slash@5.1.0: - resolution: {integrity: sha512-ZA6oR3T/pEyuqwMgAKT0/hAv8oAXckzbkmR0UkUosQ+Mc4RxGoJkRmwHgHufaenlyAgE1Mxgpdcrf75y6XcnDg==} - engines: {node: '>=14.16'} - - slice-ansi@5.0.0: - resolution: {integrity: sha512-FC+lgizVPfie0kkhqUScwRu1O/lF6NOgJmlCgK+/LYxDCTk8sGelYaHDhFcDN+Sn3Cv+3VSa4Byeo+IMCzpMgQ==} - engines: {node: '>=12'} - - source-map-js@1.2.0: - resolution: {integrity: sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==} - engines: {node: '>=0.10.0'} - - sprintf-js@1.0.3: - resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==} - - stack-utils@2.0.6: - resolution: {integrity: sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==} - engines: {node: '>=10'} - - string-width@4.2.3: - resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} - engines: {node: '>=8'} - - string-width@7.2.0: - resolution: {integrity: sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==} - engines: {node: '>=18'} - - string_decoder@1.3.0: - resolution: {integrity: sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==} - - strip-ansi@6.0.1: - resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} - engines: {node: '>=8'} - - strip-ansi@7.1.0: - resolution: {integrity: sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==} - engines: {node: '>=12'} - - styled-components@6.1.1: - resolution: {integrity: sha512-cpZZP5RrKRIClBW5Eby4JM1wElLVP4NQrJbJ0h10TidTyJf4SIIwa3zLXOoPb4gJi8MsJ8mjq5mu2IrEhZIAcQ==} - engines: {node: '>= 16'} - peerDependencies: - react: '>= 16.8.0' - react-dom: '>= 16.8.0' - - stylis@4.3.2: - resolution: {integrity: sha512-bhtUjWd/z6ltJiQwg0dUfxEJ+W+jdqQd8TbWLWyeIJHlnsqmGLRFFd8e5mA0AZi/zx90smXRlN66YMTcaSFifg==} - - supertap@3.0.1: - resolution: {integrity: sha512-u1ZpIBCawJnO+0QePsEiOknOfCRq0yERxiAchT0i4li0WHNUJbf0evXXSXOcCAR4M8iMDoajXYmstm/qO81Isw==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - tar@6.2.1: - resolution: {integrity: sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==} - engines: {node: '>=10'} - - temp-dir@3.0.0: - resolution: {integrity: sha512-nHc6S/bwIilKHNRgK/3jlhDoIHcp45YgyiwcAk46Tr0LfEqGBVpmiAyuiuxeVE44m3mXnEeVhaipLOEWmH+Njw==} - engines: {node: '>=14.16'} - - time-zone@1.0.0: - resolution: {integrity: sha512-TIsDdtKo6+XrPtiTm1ssmMngN1sAhyKnTO2kunQWqNPWIVvCm15Wmw4SWInwTVgJ5u/Tr04+8Ei9TNcw4x4ONA==} - engines: {node: '>=4'} - - tmp@0.0.33: - resolution: {integrity: sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==} - engines: {node: '>=0.6.0'} - - to-regex-range@5.0.1: - resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} - engines: {node: '>=8.0'} - - toml@3.0.0: - resolution: {integrity: sha512-y/mWCZinnvxjTKYhJ+pYxwD0mRLVvOtdS2Awbgxln6iEnt4rk0yBxeSBHkGJcPucRiG0e55mwWp+g/05rsrd6w==} - - tr46@0.0.3: - resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==} - - tslib@2.6.3: - resolution: {integrity: sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ==} - - typanion@3.14.0: - resolution: {integrity: sha512-ZW/lVMRabETuYCd9O9ZvMhAh8GslSqaUjxmK/JLPCh6l73CvLBiuXswj/+7LdnWOgYsQ130FqLzFz5aGT4I3Ug==} - - type-fest@0.13.1: - resolution: {integrity: sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==} - engines: {node: '>=10'} - - type-fest@0.21.3: - resolution: {integrity: sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==} - engines: {node: '>=10'} - - typescript@5.5.4: - resolution: {integrity: sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q==} - engines: {node: '>=14.17'} - hasBin: true - - undici-types@6.19.8: - resolution: {integrity: sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==} - - unicorn-magic@0.1.0: - resolution: {integrity: sha512-lRfVq8fE8gz6QMBuDM6a+LO3IAzTi05H6gCVaUpir2E1Rwpo4ZUog45KpNXKC/Mn3Yb9UDuHumeFTo9iV/D9FQ==} - engines: {node: '>=18'} - - universal-user-agent@7.0.2: - resolution: {integrity: sha512-0JCqzSKnStlRRQfCdowvqy3cy0Dvtlb8xecj/H8JFZuCze4rwjPZQOgvFvn0Ws/usCHQFGpyr+pB9adaGwXn4Q==} - - util-deprecate@1.0.2: - resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} - - wasm-sjlj@1.0.5: - resolution: {integrity: sha512-Z/MHJeOkAvJJVWnGX3/YZGYldGaawZbYHX4ldYG9kLhcdB8H31F5x66M7Zc4BP/7pg0aLsusQj1629m2B3Rilg==} - - webidl-conversions@3.0.1: - resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==} - - well-known-symbols@2.0.0: - resolution: {integrity: sha512-ZMjC3ho+KXo0BfJb7JgtQ5IBuvnShdlACNkKkdsqBmYw3bPAaJfPeYUo6tLUaT5tG/Gkh7xkpBhKRQ9e7pyg9Q==} - engines: {node: '>=6'} - - whatwg-url@5.0.0: - resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==} - - wide-align@1.1.5: - resolution: {integrity: sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==} - - wrap-ansi@6.2.0: - resolution: {integrity: sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==} - engines: {node: '>=8'} - - wrap-ansi@7.0.0: - resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==} - engines: {node: '>=10'} - - wrappy@1.0.2: - resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} - - write-file-atomic@5.0.1: - resolution: {integrity: sha512-+QU2zd6OTD8XWIJCbffaiQeH9U73qIqafo1x6V1snCWYGJf6cVE0cDR4D8xRzcEnfI21IFrUPzPGtcPf8AC+Rw==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - - y18n@5.0.8: - resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==} - engines: {node: '>=10'} - - yallist@4.0.0: - resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==} - - yargs-parser@21.1.1: - resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} - engines: {node: '>=12'} - - yargs@17.7.2: - resolution: {integrity: sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==} - engines: {node: '>=12'} - - yoctocolors-cjs@2.1.2: - resolution: {integrity: sha512-cYVsTjKl8b+FrnidjibDWskAv7UKOfcwaVZdp/it9n1s9fU3IkgDbhdIRKCW4JDsAlECJY0ytoVPT3sK6kideA==} - engines: {node: '>=18'} - -snapshots: - - '@emnapi/core@1.2.0': - dependencies: - '@emnapi/wasi-threads': 1.0.1 - tslib: 2.6.3 - - '@emnapi/runtime@1.2.0': - dependencies: - tslib: 2.6.3 - - '@emnapi/wasi-threads@1.0.1': - dependencies: - tslib: 2.6.3 - - '@emotion/is-prop-valid@1.2.2': - dependencies: - '@emotion/memoize': 0.8.1 - - '@emotion/memoize@0.8.1': {} - - '@emotion/unitless@0.8.1': {} - - '@inquirer/checkbox@2.3.10': - dependencies: - '@inquirer/core': 9.0.2 - '@inquirer/figures': 1.0.3 - '@inquirer/type': 1.4.0 - ansi-escapes: 4.3.2 - yoctocolors-cjs: 2.1.2 - - '@inquirer/confirm@3.1.14': - dependencies: - '@inquirer/core': 9.0.2 - '@inquirer/type': 1.4.0 - - '@inquirer/core@9.0.2': - dependencies: - '@inquirer/figures': 1.0.3 - '@inquirer/type': 1.4.0 - '@types/mute-stream': 0.0.4 - '@types/node': 20.16.5 - '@types/wrap-ansi': 3.0.0 - ansi-escapes: 4.3.2 - cli-spinners: 2.9.2 - cli-width: 4.1.0 - mute-stream: 1.0.0 - signal-exit: 4.1.0 - strip-ansi: 6.0.1 - wrap-ansi: 6.2.0 - yoctocolors-cjs: 2.1.2 - - '@inquirer/editor@2.1.14': - dependencies: - '@inquirer/core': 9.0.2 - '@inquirer/type': 1.4.0 - external-editor: 3.1.0 - - '@inquirer/expand@2.1.14': - dependencies: - '@inquirer/core': 9.0.2 - '@inquirer/type': 1.4.0 - yoctocolors-cjs: 2.1.2 - - '@inquirer/figures@1.0.3': {} - - '@inquirer/input@2.2.1': - dependencies: - '@inquirer/core': 9.0.2 - '@inquirer/type': 1.4.0 - - '@inquirer/number@1.0.2': - dependencies: - '@inquirer/core': 9.0.2 - '@inquirer/type': 1.4.0 - - '@inquirer/password@2.1.14': - dependencies: - '@inquirer/core': 9.0.2 - '@inquirer/type': 1.4.0 - ansi-escapes: 4.3.2 - - '@inquirer/prompts@5.1.2': - dependencies: - '@inquirer/checkbox': 2.3.10 - '@inquirer/confirm': 3.1.14 - '@inquirer/editor': 2.1.14 - '@inquirer/expand': 2.1.14 - '@inquirer/input': 2.2.1 - '@inquirer/number': 1.0.2 - '@inquirer/password': 2.1.14 - '@inquirer/rawlist': 2.1.14 - '@inquirer/select': 2.3.10 - - '@inquirer/rawlist@2.1.14': - dependencies: - '@inquirer/core': 9.0.2 - '@inquirer/type': 1.4.0 - yoctocolors-cjs: 2.1.2 - - '@inquirer/select@2.3.10': - dependencies: - '@inquirer/core': 9.0.2 - '@inquirer/figures': 1.0.3 - '@inquirer/type': 1.4.0 - ansi-escapes: 4.3.2 - yoctocolors-cjs: 2.1.2 - - '@inquirer/type@1.4.0': - dependencies: - mute-stream: 1.0.0 - - '@mapbox/node-pre-gyp@1.0.11': - dependencies: - detect-libc: 2.0.3 - https-proxy-agent: 5.0.1 - make-dir: 3.1.0 - node-fetch: 2.7.0 - nopt: 5.0.0 - npmlog: 5.0.1 - rimraf: 3.0.2 - semver: 7.6.2 - tar: 6.2.1 - transitivePeerDependencies: - - encoding - - supports-color - - '@napi-rs/cli@3.0.0-alpha.58(@emnapi/runtime@1.2.0)(emnapi@1.2.0)': - dependencies: - '@napi-rs/cross-toolchain': 0.0.16 - '@napi-rs/wasm-tools': 0.0.2 - '@octokit/rest': 21.0.0 - clipanion: 3.2.1(typanion@3.14.0) - colorette: 2.0.20 - debug: 4.3.5 - inquirer: 10.0.1 - js-yaml: 4.1.0 - lodash-es: 4.17.21 - semver: 7.6.2 - toml: 3.0.0 - typanion: 3.14.0 - wasm-sjlj: 1.0.5 - optionalDependencies: - '@emnapi/runtime': 1.2.0 - emnapi: 1.2.0 - transitivePeerDependencies: - - '@napi-rs/cross-toolchain-arm64-target-aarch64' - - '@napi-rs/cross-toolchain-arm64-target-armv7' - - '@napi-rs/cross-toolchain-arm64-target-x86_64' - - '@napi-rs/cross-toolchain-x64-target-aarch64' - - '@napi-rs/cross-toolchain-x64-target-armv7' - - '@napi-rs/cross-toolchain-x64-target-x86_64' - - supports-color - - '@napi-rs/cross-toolchain@0.0.16': - dependencies: - '@napi-rs/lzma': 1.3.1 - '@napi-rs/tar': 0.1.1 - debug: 4.3.5 - transitivePeerDependencies: - - supports-color - - '@napi-rs/lzma-android-arm-eabi@1.3.1': - optional: true - - '@napi-rs/lzma-android-arm64@1.3.1': - optional: true - - '@napi-rs/lzma-darwin-arm64@1.3.1': - optional: true - - '@napi-rs/lzma-darwin-x64@1.3.1': - optional: true - - '@napi-rs/lzma-freebsd-x64@1.3.1': - optional: true - - '@napi-rs/lzma-linux-arm-gnueabihf@1.3.1': - optional: true - - '@napi-rs/lzma-linux-arm64-gnu@1.3.1': - optional: true - - '@napi-rs/lzma-linux-arm64-musl@1.3.1': - optional: true - - '@napi-rs/lzma-linux-x64-gnu@1.3.1': - optional: true - - '@napi-rs/lzma-linux-x64-musl@1.3.1': - optional: true - - '@napi-rs/lzma-wasm32-wasi@1.3.1': - dependencies: - '@napi-rs/wasm-runtime': 0.2.4 - optional: true - - '@napi-rs/lzma-win32-arm64-msvc@1.3.1': - optional: true - - '@napi-rs/lzma-win32-ia32-msvc@1.3.1': - optional: true - - '@napi-rs/lzma-win32-x64-msvc@1.3.1': - optional: true - - '@napi-rs/lzma@1.3.1': - optionalDependencies: - '@napi-rs/lzma-android-arm-eabi': 1.3.1 - '@napi-rs/lzma-android-arm64': 1.3.1 - '@napi-rs/lzma-darwin-arm64': 1.3.1 - '@napi-rs/lzma-darwin-x64': 1.3.1 - '@napi-rs/lzma-freebsd-x64': 1.3.1 - '@napi-rs/lzma-linux-arm-gnueabihf': 1.3.1 - '@napi-rs/lzma-linux-arm64-gnu': 1.3.1 - '@napi-rs/lzma-linux-arm64-musl': 1.3.1 - '@napi-rs/lzma-linux-x64-gnu': 1.3.1 - '@napi-rs/lzma-linux-x64-musl': 1.3.1 - '@napi-rs/lzma-wasm32-wasi': 1.3.1 - '@napi-rs/lzma-win32-arm64-msvc': 1.3.1 - '@napi-rs/lzma-win32-ia32-msvc': 1.3.1 - '@napi-rs/lzma-win32-x64-msvc': 1.3.1 - - '@napi-rs/tar-android-arm-eabi@0.1.1': - optional: true - - '@napi-rs/tar-android-arm64@0.1.1': - optional: true - - '@napi-rs/tar-darwin-arm64@0.1.1': - optional: true - - '@napi-rs/tar-darwin-x64@0.1.1': - optional: true - - '@napi-rs/tar-freebsd-x64@0.1.1': - optional: true - - '@napi-rs/tar-linux-arm-gnueabihf@0.1.1': - optional: true - - '@napi-rs/tar-linux-arm64-gnu@0.1.1': - optional: true - - '@napi-rs/tar-linux-arm64-musl@0.1.1': - optional: true - - '@napi-rs/tar-linux-x64-gnu@0.1.1': - optional: true - - '@napi-rs/tar-linux-x64-musl@0.1.1': - optional: true - - '@napi-rs/tar-wasm32-wasi@0.1.1': - dependencies: - '@napi-rs/wasm-runtime': 0.2.4 - optional: true - - '@napi-rs/tar-win32-arm64-msvc@0.1.1': - optional: true - - '@napi-rs/tar-win32-ia32-msvc@0.1.1': - optional: true - - '@napi-rs/tar-win32-x64-msvc@0.1.1': - optional: true - - '@napi-rs/tar@0.1.1': - optionalDependencies: - '@napi-rs/tar-android-arm-eabi': 0.1.1 - '@napi-rs/tar-android-arm64': 0.1.1 - '@napi-rs/tar-darwin-arm64': 0.1.1 - '@napi-rs/tar-darwin-x64': 0.1.1 - '@napi-rs/tar-freebsd-x64': 0.1.1 - '@napi-rs/tar-linux-arm-gnueabihf': 0.1.1 - '@napi-rs/tar-linux-arm64-gnu': 0.1.1 - '@napi-rs/tar-linux-arm64-musl': 0.1.1 - '@napi-rs/tar-linux-x64-gnu': 0.1.1 - '@napi-rs/tar-linux-x64-musl': 0.1.1 - '@napi-rs/tar-wasm32-wasi': 0.1.1 - '@napi-rs/tar-win32-arm64-msvc': 0.1.1 - '@napi-rs/tar-win32-ia32-msvc': 0.1.1 - '@napi-rs/tar-win32-x64-msvc': 0.1.1 - - '@napi-rs/wasm-runtime@0.2.4': - dependencies: - '@emnapi/core': 1.2.0 - '@emnapi/runtime': 1.2.0 - '@tybys/wasm-util': 0.9.0 - - '@napi-rs/wasm-tools-android-arm-eabi@0.0.2': - optional: true - - '@napi-rs/wasm-tools-android-arm64@0.0.2': - optional: true - - '@napi-rs/wasm-tools-darwin-arm64@0.0.2': - optional: true - - '@napi-rs/wasm-tools-darwin-x64@0.0.2': - optional: true - - '@napi-rs/wasm-tools-freebsd-x64@0.0.2': - optional: true - - '@napi-rs/wasm-tools-linux-arm64-gnu@0.0.2': - optional: true - - '@napi-rs/wasm-tools-linux-arm64-musl@0.0.2': - optional: true - - '@napi-rs/wasm-tools-linux-x64-gnu@0.0.2': - optional: true - - '@napi-rs/wasm-tools-linux-x64-musl@0.0.2': - optional: true - - '@napi-rs/wasm-tools-wasm32-wasi@0.0.2': - dependencies: - '@napi-rs/wasm-runtime': 0.2.4 - optional: true - - '@napi-rs/wasm-tools-win32-arm64-msvc@0.0.2': - optional: true - - '@napi-rs/wasm-tools-win32-ia32-msvc@0.0.2': - optional: true - - '@napi-rs/wasm-tools-win32-x64-msvc@0.0.2': - optional: true - - '@napi-rs/wasm-tools@0.0.2': - optionalDependencies: - '@napi-rs/wasm-tools-android-arm-eabi': 0.0.2 - '@napi-rs/wasm-tools-android-arm64': 0.0.2 - '@napi-rs/wasm-tools-darwin-arm64': 0.0.2 - '@napi-rs/wasm-tools-darwin-x64': 0.0.2 - '@napi-rs/wasm-tools-freebsd-x64': 0.0.2 - '@napi-rs/wasm-tools-linux-arm64-gnu': 0.0.2 - '@napi-rs/wasm-tools-linux-arm64-musl': 0.0.2 - '@napi-rs/wasm-tools-linux-x64-gnu': 0.0.2 - '@napi-rs/wasm-tools-linux-x64-musl': 0.0.2 - '@napi-rs/wasm-tools-wasm32-wasi': 0.0.2 - '@napi-rs/wasm-tools-win32-arm64-msvc': 0.0.2 - '@napi-rs/wasm-tools-win32-ia32-msvc': 0.0.2 - '@napi-rs/wasm-tools-win32-x64-msvc': 0.0.2 - - '@nodelib/fs.scandir@2.1.5': - dependencies: - '@nodelib/fs.stat': 2.0.5 - run-parallel: 1.2.0 - - '@nodelib/fs.stat@2.0.5': {} - - '@nodelib/fs.walk@1.2.8': - dependencies: - '@nodelib/fs.scandir': 2.1.5 - fastq: 1.17.1 - - '@octokit/auth-token@5.1.1': {} - - '@octokit/core@6.1.2': - dependencies: - '@octokit/auth-token': 5.1.1 - '@octokit/graphql': 8.1.1 - '@octokit/request': 9.1.1 - '@octokit/request-error': 6.1.2 - '@octokit/types': 13.5.0 - before-after-hook: 3.0.2 - universal-user-agent: 7.0.2 - - '@octokit/endpoint@10.1.1': - dependencies: - '@octokit/types': 13.5.0 - universal-user-agent: 7.0.2 - - '@octokit/graphql@8.1.1': - dependencies: - '@octokit/request': 9.1.1 - '@octokit/types': 13.5.0 - universal-user-agent: 7.0.2 - - '@octokit/openapi-types@22.2.0': {} - - '@octokit/plugin-paginate-rest@11.3.3(@octokit/core@6.1.2)': - dependencies: - '@octokit/core': 6.1.2 - '@octokit/types': 13.5.0 - - '@octokit/plugin-request-log@5.3.0(@octokit/core@6.1.2)': - dependencies: - '@octokit/core': 6.1.2 - - '@octokit/plugin-rest-endpoint-methods@13.2.4(@octokit/core@6.1.2)': - dependencies: - '@octokit/core': 6.1.2 - '@octokit/types': 13.5.0 - - '@octokit/request-error@6.1.2': - dependencies: - '@octokit/types': 13.5.0 - - '@octokit/request@9.1.1': - dependencies: - '@octokit/endpoint': 10.1.1 - '@octokit/request-error': 6.1.2 - '@octokit/types': 13.5.0 - universal-user-agent: 7.0.2 - - '@octokit/rest@21.0.0': - dependencies: - '@octokit/core': 6.1.2 - '@octokit/plugin-paginate-rest': 11.3.3(@octokit/core@6.1.2) - '@octokit/plugin-request-log': 5.3.0(@octokit/core@6.1.2) - '@octokit/plugin-rest-endpoint-methods': 13.2.4(@octokit/core@6.1.2) - - '@octokit/types@13.5.0': - dependencies: - '@octokit/openapi-types': 22.2.0 - - '@rollup/pluginutils@4.2.1': - dependencies: - estree-walker: 2.0.2 - picomatch: 2.3.1 - - '@sindresorhus/merge-streams@2.3.0': {} - - '@tybys/wasm-util@0.9.0': - dependencies: - tslib: 2.6.3 - - '@types/mute-stream@0.0.4': - dependencies: - '@types/node': 22.5.4 - - '@types/node@20.16.5': - dependencies: - undici-types: 6.19.8 - - '@types/node@22.5.4': - dependencies: - undici-types: 6.19.8 - - '@types/stylis@4.2.6': {} - - '@types/wrap-ansi@3.0.0': {} - - '@vercel/nft@0.26.5': - dependencies: - '@mapbox/node-pre-gyp': 1.0.11 - '@rollup/pluginutils': 4.2.1 - acorn: 8.12.1 - acorn-import-attributes: 1.9.5(acorn@8.12.1) - async-sema: 3.1.1 - bindings: 1.5.0 - estree-walker: 2.0.2 - glob: 7.2.3 - graceful-fs: 4.2.11 - micromatch: 4.0.7 - node-gyp-build: 4.8.1 - resolve-from: 5.0.0 - transitivePeerDependencies: - - encoding - - supports-color - - abbrev@1.1.1: {} - - acorn-import-attributes@1.9.5(acorn@8.12.1): - dependencies: - acorn: 8.12.1 - - acorn-walk@8.3.3: - dependencies: - acorn: 8.12.1 - - acorn@8.12.1: {} - - agent-base@6.0.2: - dependencies: - debug: 4.3.5 - transitivePeerDependencies: - - supports-color - - ansi-escapes@4.3.2: - dependencies: - type-fest: 0.21.3 - - ansi-regex@5.0.1: {} - - ansi-regex@6.0.1: {} - - ansi-styles@4.3.0: - dependencies: - color-convert: 2.0.1 - - ansi-styles@6.2.1: {} - - aproba@2.0.0: {} - - are-we-there-yet@2.0.0: - dependencies: - delegates: 1.0.0 - readable-stream: 3.6.2 - - argparse@1.0.10: - dependencies: - sprintf-js: 1.0.3 - - argparse@2.0.1: {} - - array-find-index@1.0.2: {} - - arrgv@1.0.2: {} - - arrify@3.0.0: {} - - async-sema@3.1.1: {} - - asynckit@0.4.0: {} - - ava@6.1.3: - dependencies: - '@vercel/nft': 0.26.5 - acorn: 8.12.1 - acorn-walk: 8.3.3 - ansi-styles: 6.2.1 - arrgv: 1.0.2 - arrify: 3.0.0 - callsites: 4.2.0 - cbor: 9.0.2 - chalk: 5.3.0 - chunkd: 2.0.1 - ci-info: 4.0.0 - ci-parallel-vars: 1.0.1 - cli-truncate: 4.0.0 - code-excerpt: 4.0.0 - common-path-prefix: 3.0.0 - concordance: 5.0.4 - currently-unhandled: 0.4.1 - debug: 4.3.5 - emittery: 1.0.3 - figures: 6.1.0 - globby: 14.0.2 - ignore-by-default: 2.1.0 - indent-string: 5.0.0 - is-plain-object: 5.0.0 - is-promise: 4.0.0 - matcher: 5.0.0 - memoize: 10.0.0 - ms: 2.1.3 - p-map: 7.0.2 - package-config: 5.0.0 - picomatch: 3.0.1 - plur: 5.1.0 - pretty-ms: 9.0.0 - resolve-cwd: 3.0.0 - stack-utils: 2.0.6 - strip-ansi: 7.1.0 - supertap: 3.0.1 - temp-dir: 3.0.0 - write-file-atomic: 5.0.1 - yargs: 17.7.2 - transitivePeerDependencies: - - encoding - - supports-color - - axios@1.6.2: - dependencies: - follow-redirects: 1.15.6 - form-data: 4.0.0 - proxy-from-env: 1.1.0 - transitivePeerDependencies: - - debug - - balanced-match@1.0.2: {} - - before-after-hook@3.0.2: {} - - bindings@1.5.0: - dependencies: - file-uri-to-path: 1.0.0 - - blueimp-md5@2.19.0: {} - - brace-expansion@1.1.11: - dependencies: - balanced-match: 1.0.2 - concat-map: 0.0.1 - - braces@3.0.3: - dependencies: - fill-range: 7.1.1 - - callsites@4.2.0: {} - - camelize@1.0.1: {} - - cbor@9.0.2: - dependencies: - nofilter: 3.1.0 - - chalk@5.3.0: {} - - chardet@0.7.0: {} - - chownr@2.0.0: {} - - chunkd@2.0.1: {} - - ci-info@4.0.0: {} - - ci-parallel-vars@1.0.1: {} - - cli-spinners@2.9.2: {} - - cli-truncate@4.0.0: - dependencies: - slice-ansi: 5.0.0 - string-width: 7.2.0 - - cli-width@4.1.0: {} - - clipanion@3.2.1(typanion@3.14.0): - dependencies: - typanion: 3.14.0 - - cliui@8.0.1: - dependencies: - string-width: 4.2.3 - strip-ansi: 6.0.1 - wrap-ansi: 7.0.0 - - code-excerpt@4.0.0: - dependencies: - convert-to-spaces: 2.0.1 - - color-convert@2.0.1: - dependencies: - color-name: 1.1.4 - - color-name@1.1.4: {} - - color-support@1.1.3: {} - - colorette@2.0.20: {} - - combined-stream@1.0.8: - dependencies: - delayed-stream: 1.0.0 - - common-path-prefix@3.0.0: {} - - concat-map@0.0.1: {} - - concordance@5.0.4: - dependencies: - date-time: 3.1.0 - esutils: 2.0.3 - fast-diff: 1.3.0 - js-string-escape: 1.0.1 - lodash: 4.17.21 - md5-hex: 3.0.1 - semver: 7.6.2 - well-known-symbols: 2.0.0 - - console-control-strings@1.1.0: {} - - convert-to-spaces@2.0.1: {} - - css-color-keywords@1.0.0: {} - - css-to-react-native@3.2.0: - dependencies: - camelize: 1.0.1 - css-color-keywords: 1.0.0 - postcss-value-parser: 4.2.0 - - csstype@3.1.3: {} - - currently-unhandled@0.4.1: - dependencies: - array-find-index: 1.0.2 - - date-time@3.1.0: - dependencies: - time-zone: 1.0.0 - - debug@4.3.5: - dependencies: - ms: 2.1.2 - - delayed-stream@1.0.0: {} - - delegates@1.0.0: {} - - detect-libc@2.0.3: {} - - emittery@1.0.3: {} - - emnapi@1.2.0: {} - - emoji-regex@10.3.0: {} - - emoji-regex@8.0.0: {} - - escalade@3.1.2: {} - - escape-string-regexp@2.0.0: {} - - escape-string-regexp@5.0.0: {} - - esprima@4.0.1: {} - - estree-walker@2.0.2: {} - - esutils@2.0.3: {} - - external-editor@3.1.0: - dependencies: - chardet: 0.7.0 - iconv-lite: 0.4.24 - tmp: 0.0.33 - - fast-diff@1.3.0: {} - - fast-glob@3.3.2: - dependencies: - '@nodelib/fs.stat': 2.0.5 - '@nodelib/fs.walk': 1.2.8 - glob-parent: 5.1.2 - merge2: 1.4.1 - micromatch: 4.0.7 - - fastq@1.17.1: - dependencies: - reusify: 1.0.4 - - figures@6.1.0: - dependencies: - is-unicode-supported: 2.0.0 - - file-uri-to-path@1.0.0: {} - - fill-range@7.1.1: - dependencies: - to-regex-range: 5.0.1 - - find-up-simple@1.0.0: {} - - follow-redirects@1.15.6: {} - - form-data@4.0.0: - dependencies: - asynckit: 0.4.0 - combined-stream: 1.0.8 - mime-types: 2.1.35 - - fs-minipass@2.1.0: - dependencies: - minipass: 3.3.6 - - fs.realpath@1.0.0: {} - - gauge@3.0.2: - dependencies: - aproba: 2.0.0 - color-support: 1.1.3 - console-control-strings: 1.1.0 - has-unicode: 2.0.1 - object-assign: 4.1.1 - signal-exit: 3.0.7 - string-width: 4.2.3 - strip-ansi: 6.0.1 - wide-align: 1.1.5 - - get-caller-file@2.0.5: {} - - get-east-asian-width@1.2.0: {} - - glob-parent@5.1.2: - dependencies: - is-glob: 4.0.3 - - glob@7.2.3: - dependencies: - fs.realpath: 1.0.0 - inflight: 1.0.6 - inherits: 2.0.4 - minimatch: 3.1.2 - once: 1.4.0 - path-is-absolute: 1.0.1 - - globby@14.0.2: - dependencies: - '@sindresorhus/merge-streams': 2.3.0 - fast-glob: 3.3.2 - ignore: 5.3.1 - path-type: 5.0.0 - slash: 5.1.0 - unicorn-magic: 0.1.0 - - graceful-fs@4.2.11: {} - - has-unicode@2.0.1: {} - - https-proxy-agent@5.0.1: - dependencies: - agent-base: 6.0.2 - debug: 4.3.5 - transitivePeerDependencies: - - supports-color - - iconv-lite@0.4.24: - dependencies: - safer-buffer: 2.1.2 - - ignore-by-default@2.1.0: {} - - ignore@5.3.1: {} - - imurmurhash@0.1.4: {} - - indent-string@5.0.0: {} - - inflight@1.0.6: - dependencies: - once: 1.4.0 - wrappy: 1.0.2 - - inherits@2.0.4: {} - - inquirer@10.0.1: - dependencies: - '@inquirer/prompts': 5.1.2 - '@inquirer/type': 1.4.0 - '@types/mute-stream': 0.0.4 - ansi-escapes: 4.3.2 - mute-stream: 1.0.0 - run-async: 3.0.0 - rxjs: 7.8.1 - - ipaddr.js@2.2.0: {} - - irregular-plurals@3.5.0: {} - - is-extglob@2.1.1: {} - - is-fullwidth-code-point@3.0.0: {} - - is-fullwidth-code-point@4.0.0: {} - - is-glob@4.0.3: - dependencies: - is-extglob: 2.1.1 - - is-number@7.0.0: {} - - is-plain-object@5.0.0: {} - - is-promise@4.0.0: {} - - is-unicode-supported@2.0.0: {} - - js-string-escape@1.0.1: {} - - js-tokens@4.0.0: {} - - js-yaml@3.14.1: - dependencies: - argparse: 1.0.10 - esprima: 4.0.1 - - js-yaml@4.1.0: - dependencies: - argparse: 2.0.1 - - load-json-file@7.0.1: {} - - lodash-es@4.17.21: {} - - lodash@4.17.21: {} - - loose-envify@1.4.0: - dependencies: - js-tokens: 4.0.0 - - make-dir@3.1.0: - dependencies: - semver: 6.3.1 - - matcher@5.0.0: - dependencies: - escape-string-regexp: 5.0.0 - - md5-hex@3.0.1: - dependencies: - blueimp-md5: 2.19.0 - - memoize@10.0.0: - dependencies: - mimic-function: 5.0.1 - - merge2@1.4.1: {} - - micromatch@4.0.7: - dependencies: - braces: 3.0.3 - picomatch: 2.3.1 - - mime-db@1.52.0: {} - - mime-types@2.1.35: - dependencies: - mime-db: 1.52.0 - - mimic-function@5.0.1: {} - - minimatch@3.1.2: - dependencies: - brace-expansion: 1.1.11 - - minipass@3.3.6: - dependencies: - yallist: 4.0.0 - - minipass@5.0.0: {} - - minizlib@2.1.2: - dependencies: - minipass: 3.3.6 - yallist: 4.0.0 - - mkdirp@1.0.4: {} - - ms@2.1.2: {} - - ms@2.1.3: {} - - mute-stream@1.0.0: {} - - nanoid@3.3.7: {} - - node-fetch@2.7.0: - dependencies: - whatwg-url: 5.0.0 - - node-gyp-build@4.8.1: {} - - nofilter@3.1.0: {} - - nopt@5.0.0: - dependencies: - abbrev: 1.1.1 - - npmlog@5.0.1: - dependencies: - are-we-there-yet: 2.0.0 - console-control-strings: 1.1.0 - gauge: 3.0.2 - set-blocking: 2.0.0 - - object-assign@4.1.1: {} - - once@1.4.0: - dependencies: - wrappy: 1.0.2 - - os-tmpdir@1.0.2: {} - - p-map@7.0.2: {} - - package-config@5.0.0: - dependencies: - find-up-simple: 1.0.0 - load-json-file: 7.0.1 - - parse-ms@4.0.0: {} - - path-is-absolute@1.0.1: {} - - path-type@5.0.0: {} - - picocolors@1.0.1: {} - - picomatch@2.3.1: {} - - picomatch@3.0.1: {} - - plur@5.1.0: - dependencies: - irregular-plurals: 3.5.0 - - postcss-value-parser@4.2.0: {} - - postcss@8.4.33: - dependencies: - nanoid: 3.3.7 - picocolors: 1.0.1 - source-map-js: 1.2.0 - - pretty-ms@9.0.0: - dependencies: - parse-ms: 4.0.0 - - proxy-from-env@1.1.0: {} - - queue-microtask@1.2.3: {} - - react-dom@18.3.1(react@18.3.1): - dependencies: - loose-envify: 1.4.0 - react: 18.3.1 - scheduler: 0.23.2 - - react@18.3.1: - dependencies: - loose-envify: 1.4.0 - - readable-stream@3.6.2: - dependencies: - inherits: 2.0.4 - string_decoder: 1.3.0 - util-deprecate: 1.0.2 - - require-directory@2.1.1: {} - - resolve-cwd@3.0.0: - dependencies: - resolve-from: 5.0.0 - - resolve-from@5.0.0: {} - - reusify@1.0.4: {} - - rimraf@3.0.2: - dependencies: - glob: 7.2.3 - - run-async@3.0.0: {} - - run-parallel@1.2.0: - dependencies: - queue-microtask: 1.2.3 - - rxjs@7.8.1: - dependencies: - tslib: 2.6.3 - - safe-buffer@5.2.1: {} - - safer-buffer@2.1.2: {} - - scheduler@0.23.2: - dependencies: - loose-envify: 1.4.0 - - semver@6.3.1: {} - - semver@7.6.2: {} - - serialize-error@7.0.1: - dependencies: - type-fest: 0.13.1 - - set-blocking@2.0.0: {} - - shallowequal@1.1.0: {} - - signal-exit@3.0.7: {} - - signal-exit@4.1.0: {} - - slash@5.1.0: {} - - slice-ansi@5.0.0: - dependencies: - ansi-styles: 6.2.1 - is-fullwidth-code-point: 4.0.0 - - source-map-js@1.2.0: {} - - sprintf-js@1.0.3: {} - - stack-utils@2.0.6: - dependencies: - escape-string-regexp: 2.0.0 - - string-width@4.2.3: - dependencies: - emoji-regex: 8.0.0 - is-fullwidth-code-point: 3.0.0 - strip-ansi: 6.0.1 - - string-width@7.2.0: - dependencies: - emoji-regex: 10.3.0 - get-east-asian-width: 1.2.0 - strip-ansi: 7.1.0 - - string_decoder@1.3.0: - dependencies: - safe-buffer: 5.2.1 - - strip-ansi@6.0.1: - dependencies: - ansi-regex: 5.0.1 - - strip-ansi@7.1.0: - dependencies: - ansi-regex: 6.0.1 - - styled-components@6.1.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1): - dependencies: - '@emotion/is-prop-valid': 1.2.2 - '@emotion/unitless': 0.8.1 - '@types/stylis': 4.2.6 - css-to-react-native: 3.2.0 - csstype: 3.1.3 - postcss: 8.4.33 - react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) - shallowequal: 1.1.0 - stylis: 4.3.2 - tslib: 2.6.3 - - stylis@4.3.2: {} - - supertap@3.0.1: - dependencies: - indent-string: 5.0.0 - js-yaml: 3.14.1 - serialize-error: 7.0.1 - strip-ansi: 7.1.0 - - tar@6.2.1: - dependencies: - chownr: 2.0.0 - fs-minipass: 2.1.0 - minipass: 5.0.0 - minizlib: 2.1.2 - mkdirp: 1.0.4 - yallist: 4.0.0 - - temp-dir@3.0.0: {} - - time-zone@1.0.0: {} - - tmp@0.0.33: - dependencies: - os-tmpdir: 1.0.2 - - to-regex-range@5.0.1: - dependencies: - is-number: 7.0.0 - - toml@3.0.0: {} - - tr46@0.0.3: {} - - tslib@2.6.3: {} - - typanion@3.14.0: {} - - type-fest@0.13.1: {} - - type-fest@0.21.3: {} - - typescript@5.5.4: {} - - undici-types@6.19.8: {} - - unicorn-magic@0.1.0: {} - - universal-user-agent@7.0.2: {} - - util-deprecate@1.0.2: {} - - wasm-sjlj@1.0.5: {} - - webidl-conversions@3.0.1: {} - - well-known-symbols@2.0.0: {} - - whatwg-url@5.0.0: - dependencies: - tr46: 0.0.3 - webidl-conversions: 3.0.1 - - wide-align@1.1.5: - dependencies: - string-width: 4.2.3 - - wrap-ansi@6.2.0: - dependencies: - ansi-styles: 4.3.0 - string-width: 4.2.3 - strip-ansi: 6.0.1 - - wrap-ansi@7.0.0: - dependencies: - ansi-styles: 4.3.0 - string-width: 4.2.3 - strip-ansi: 6.0.1 - - wrappy@1.0.2: {} - - write-file-atomic@5.0.1: - dependencies: - imurmurhash: 0.1.4 - signal-exit: 4.1.0 - - y18n@5.0.8: {} - - yallist@4.0.0: {} - - yargs-parser@21.1.1: {} - - yargs@17.7.2: - dependencies: - cliui: 8.0.1 - escalade: 3.1.2 - get-caller-file: 2.0.5 - require-directory: 2.1.1 - string-width: 4.2.3 - y18n: 5.0.8 - yargs-parser: 21.1.1 - - yoctocolors-cjs@2.1.2: {} From d2d1c8376947dc6b2dc242e033a161a63eba1b1d Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Tue, 10 Sep 2024 01:38:20 +0300 Subject: [PATCH 72/82] --- .github/CODE_OF_CONDUCT.md | 127 - .github/SECURITY.md | 7 - .github/actions/pnpm/action.yml | 26 - .github/codecov.yml | 14 - .github/renovate.json | 5 - .github/workflows/benchmark.yml | 41 - .github/workflows/ci.yml | 196 - .github/workflows/codecov.yml | 69 - .github/workflows/release-napi.yml | 252 - .github/workflows/release-plz.yml | 55 - Cargo.lock | 1326 --- fixtures/enhanced_resolve/lib/index.js | 1 - fixtures/enhanced_resolve/package.json | 4 - fixtures/enhanced_resolve/test/.gitignore | 3 - .../enhanced_resolve/test/fixtures/#/a.js | 0 fixtures/enhanced_resolve/test/fixtures/a.js | 3 - .../enhanced_resolve/test/fixtures/abc.txt | 1 - .../test/fixtures/alias/files/a.js | 0 fixtures/enhanced_resolve/test/fixtures/b.js | 3 - .../browser-module/browser/module-a.js | 0 .../fixtures/browser-module/lib/browser.js | 0 .../fixtures/browser-module/lib/ignore.js | 0 .../test/fixtures/browser-module/lib/main.js | 0 .../fixtures/browser-module/lib/replaced.js | 0 .../test/fixtures/browser-module/lib/self.js | 0 .../fixtures/browser-module/lib/toString.js | 0 .../browser-module/node_modules/module-a.js | 0 .../browser-module/node_modules/module-b.js | 0 .../browser-module/node_modules/module-c.js | 0 .../node_modules/recursive-file/a.js | 0 .../node_modules/recursive-file/b.js | 0 .../node_modules/recursive-file/c.js | 0 .../node_modules/recursive-file/d.js | 0 .../node_modules/recursive-file/package.json | 8 - .../test/fixtures/browser-module/package.json | 33 - .../test/fixtures/builtins/package.json | 12 - fixtures/enhanced_resolve/test/fixtures/c.js | 4 - .../enhanced_resolve/test/fixtures/complex.js | 13 - .../test/fixtures/crypto-js/index.js | 0 .../test/fixtures/crypto-js/package.json | 7 - .../test/fixtures/decorated-fs/exists.js | 0 .../test/fixtures/dirOrFile.js | 1 - .../test/fixtures/dirOrFile/index.js | 1 - .../directory-default/directory-default.js | 0 .../node_modules/@org/pkg/dist/string.js | 1 - .../@org/pkg/dist/string.test.d.ts | 1 - .../node_modules/@org/pkg/package.json | 9 - .../node_modules/pkg/dist/string.js | 1 - .../node_modules/pkg/dist/string.test.d.ts | 1 - .../node_modules/pkg/package.json | 9 - .../node_modules/exports-field/package.json | 7 - .../node_modules/pack1/index.js | 0 .../test/fixtures/exports-field/a.js | 1 - .../node_modules/exports-field/lib/browser.js | 1 - .../node_modules/exports-field/lib/index.js | 0 .../exports-field/lib/lib2/main.js | 1 - .../node_modules/exports-field/lib/main.js | 1 - .../node_modules/exports-field/main.js | 1 - .../node_modules/exports-field/package.json | 18 - .../node_modules/exports-field/x.js | 1 - .../invalid-exports-field/index.js | 0 .../invalid-exports-field/package.json | 13 - .../node_modules/invalid-exports-field/umd.js | 0 .../test/fixtures/exports-field/package.json | 5 - .../node_modules/exports-field/index.js | 1 - .../node_modules/exports-field/lib/browser.js | 1 - .../exports-field/lib/lib2/main.js | 1 - .../node_modules/exports-field/lib/main.js | 1 - .../node_modules/exports-field/main.js | 1 - .../node_modules/exports-field/package.json | 17 - .../node_modules/exports-field/index | 0 .../node_modules/exports-field/main.js | 1 - .../node_modules/exports-field/package.json | 10 - .../node_modules/exports-field/src/index.js | 0 .../fixtures/extension-alias/dir/index.js | 0 .../fixtures/extension-alias/dir/index.ts | 0 .../fixtures/extension-alias/dir2/index.js | 0 .../fixtures/extension-alias/dir2/index.mts | 0 .../test/fixtures/extension-alias/index.js | 0 .../test/fixtures/extension-alias/index.mjs | 0 .../fixtures/extension-alias/index.mts.js | 0 .../test/fixtures/extension-alias/index.ts | 0 .../test/fixtures/extensions/app.module.js | 0 .../test/fixtures/extensions/dir/index.js | 0 .../test/fixtures/extensions/dir/index.ts | 0 .../test/fixtures/extensions/foo.js | 0 .../test/fixtures/extensions/foo.ts | 0 .../test/fixtures/extensions/index.js | 0 .../test/fixtures/extensions/index.ts | 0 .../extensions/node_modules/module.js | 0 .../extensions/node_modules/module/index.ts | 0 .../test/fixtures/extensions/package.json | 3 - .../enhanced_resolve/test/fixtures/file.load1 | 0 .../enhanced_resolve/test/fixtures/file.load2 | 0 .../test/fixtures/foo/index.js | 0 .../test/fixtures/foo/package.json | 4 - .../node_modules/m/package.json | 17 - .../node_modules/m/src/features/f.js | 0 .../m/src/features/internal/file.js | 0 .../node_modules/m/src/features/y/y.js | 0 .../node_modules/m/src/internal/i.js | 0 .../node_modules/m/src/middle-1/f.js | 0 .../node_modules/m/src/middle-1/nested/f.js | 0 .../node_modules/m/src/middle-2/nested/f.js | 1 - .../m/src/middle-3/nested/f/nested/f.js | 0 .../node_modules/m/src/middle-4/f/f.js | 0 .../node_modules/m/src/middle-5/f$/$.js | 0 .../node_modules/m/src/middle-5/f/$.js | 0 .../node_modules/m/src/middle/f.js | 0 .../node_modules/m/src/middle/nested/f.js | 0 .../test/fixtures/imports-field/a.js | 1 - .../test/fixtures/imports-field/b.js | 0 .../test/fixtures/imports-field/dir/b.js | 0 .../node_modules/a/lib/browser.js | 1 - .../imports-field/node_modules/a/lib/index.js | 0 .../node_modules/a/lib/lib2/main.js | 1 - .../imports-field/node_modules/a/lib/main.js | 1 - .../imports-field/node_modules/a/main.js | 1 - .../imports-field/node_modules/a/package.json | 18 - .../imports-field/node_modules/a/x.js | 1 - .../imports-field/node_modules/c/index.js | 0 .../test/fixtures/imports-field/package.json | 17 - .../fixtures/incorrect-package/pack1/a.js | 0 .../incorrect-package/pack1/package.json | 2 - .../fixtures/incorrect-package/pack2/a.js | 0 .../incorrect-package/pack2/package.json | 0 .../test/fixtures/issue-238/package.json | 3 - .../test/fixtures/issue-238/src/a/config.js | 0 .../src/common/config/myObjectFile.js | 0 .../enhanced_resolve/test/fixtures/lib.js | 0 .../test/fixtures/lib/complex1.js | 1 - .../test/fixtures/main-field-self/index.js | 0 .../fixtures/main-field-self/package.json | 3 - .../test/fixtures/main-field-self2/index.js | 0 .../fixtures/main-field-self2/package.json | 3 - .../enhanced_resolve/test/fixtures/main1.js | 9 - .../enhanced_resolve/test/fixtures/main2.js | 12 - .../enhanced_resolve/test/fixtures/main3.js | 4 - .../multiple_modules/node_modules/m1/a.js | 3 - .../test/fixtures/no#fragment/#/#.js | 0 fixtures/enhanced_resolve/test/fixtures/no.js | 0 .../browser-module-broken/browser.js | 0 .../browser-module-broken/main.js | 0 .../browser-module-broken/package.json | 4 - .../complexm/node_modules/m1/a.js | 1 - .../complexm/node_modules/m1/index.js | 1 - .../fixtures/node_modules/complexm/step1.js | 1 - .../fixtures/node_modules/complexm/step2.js | 1 - .../fixtures/node_modules/dash-name/index.js | 0 .../node_modules/dash-name/package.json | 4 - .../test/fixtures/node_modules/dash/index.js | 0 .../fixtures/node_modules/dash/package.json | 4 - .../invalidPackageJson/package.json | 0 .../test/fixtures/node_modules/m1/a.js | 3 - .../test/fixtures/node_modules/m1/b.js | 3 - .../test/fixtures/node_modules/m2/b.js | 1 - .../node_modules/recursive-module/file.js | 0 .../node_modules/recursive-module/index.js | 0 .../test/fixtures/pnp-a/m2/a.js | 3 - .../test/fixtures/pnp/pkg/dir/index.js | 0 .../test/fixtures/pnp/pkg/index.js | 0 .../test/fixtures/pnp/pkg/main.js | 0 .../fixtures/pnp/pkg/package-alias/browser.js | 0 .../fixtures/pnp/pkg/package-alias/index.js | 0 .../test/fixtures/pnp/pkg/package.json | 7 - .../test/fixtures/pnp/pkg/typescript/index.ts | 0 .../test/fixtures/pnp/pkg3/a.js | 1 - .../test/fixtures/pnp/pkg3/package.json | 8 - .../prefer-pnp/alternative-modules/m1/b.js | 0 .../restrictions/node_modules/pck1/index.css | 0 .../restrictions/node_modules/pck1/index.js | 0 .../node_modules/pck1/package.json | 3 - .../restrictions/node_modules/pck2/index.css | 0 .../restrictions/node_modules/pck2/module.js | 0 .../node_modules/pck2/package.json | 5 - .../test/fixtures/roots_fall_through/index.js | 0 .../scoped/node_modules/@scope/pack1/main.js | 0 .../node_modules/@scope/pack1/package.json | 5 - .../node_modules/@scope/pack2/lib/index.js | 0 .../scoped/node_modules/@scope/pack2/main.js | 0 .../node_modules/@scope/pack2/package.json | 3 - .../test/fixtures/shortcutdir.js/a.js | 0 .../test/fixtures/yield/a/foo-2/b | 0 .../test/fixtures/yield/a/foo-2/c | 0 .../test/fixtures/yield/a/foo/a | 0 .../test/fixtures/yield/a/foo/b | 0 .../test/fixtures/yield/b/foo/a | 0 .../test/fixtures/yield/c/foo/a | 0 .../test/fixtures/yield/c/foo/package.json | 7 - .../fixtures/\346\265\213\350\257\225.js" | 0 .../\344\270\255\346\226\207.js" | 0 fixtures/pnp/.gitignore | 1 - fixtures/pnp/.pnp.cjs | 7543 ----------------- fixtures/pnp/.yarnrc.yml | 1 - fixtures/pnp/package.json | 8 - fixtures/pnp/yarn.lock | 74 - fixtures/pnpm/.gitignore | 1 - fixtures/pnpm/package.json | 11 - fixtures/pnpm/pnpm-lock.yaml | 212 - fixtures/tsconfig/cases/builtins/thing.js | 0 .../tsconfig/cases/builtins/tsconfig.json | 5 - fixtures/tsconfig/cases/exports/index.js | 0 fixtures/tsconfig/cases/exports/tsconfig.json | 3 - .../extends-extension/base-tsconfig.json | 7 - .../tsconfig/cases/extends-extension/foo.js | 0 .../cases/extends-extension/tsconfig.json | 3 - .../cases/extends-extensionless/foo.js | 0 .../cases/extends-extensionless/tsconfig.json | 3 - .../tsconfig/cases/extends-multiple/foo.js | 0 .../cases/extends-multiple/tsconfig.json | 6 - .../tsconfig/cases/extends-not-found/index.js | 0 .../cases/extends-not-found/tsconfig.json | 3 - .../tsconfig/cases/extends-paths/src/index.js | 0 .../cases/extends-paths/tsconfig.base.json | 7 - .../cases/extends-paths/tsconfig.json | 6 - fixtures/tsconfig/cases/field/index.js | 0 fixtures/tsconfig/cases/field/tsconfig.json | 3 - fixtures/tsconfig/cases/index/index.js | 0 fixtures/tsconfig/cases/index/tsconfig.json | 3 - .../cases/paths_template_variable/foo.js | 0 .../paths_template_variable/tsconfig1.json | 3 - .../paths_template_variable/tsconfig2.json | 8 - .../project_references/app/aliased/index.ts | 0 .../cases/project_references/app/index.ts | 0 .../project_references/app/tsconfig.json | 23 - .../project_a/aliased/index.ts | 0 .../project_references/project_a/conf.json | 8 - .../project_references/project_a/index.ts | 0 .../project_b/src/aliased/index.ts | 0 .../project_b/tsconfig.json | 9 - .../project_references/project_c/index.ts | 0 .../project_c/tsconfig.json | 5 - .../project_references/tsconfig.base.json | 4 - fixtures/tsconfig/cases/suffixes/a.ios.ts | 0 fixtures/tsconfig/cases/suffixes/a.ts | 0 fixtures/tsconfig/cases/suffixes/b.ts | 0 fixtures/tsconfig/cases/suffixes/c-test.ts | 0 fixtures/tsconfig/cases/suffixes/index.ts | 1 - .../tsconfig/cases/suffixes/tsconfig.json | 5 - fixtures/tsconfig/cases/trailing-comma/bar.js | 0 .../tsconfig/cases/trailing-comma/index.js | 0 .../cases/trailing-comma/tsconfig.json | 9 - fixtures/tsconfig/foo.js | 0 fixtures/tsconfig/nested/index.js | 0 fixtures/tsconfig/nested/test.js | 0 fixtures/tsconfig/nested/tsconfig.json | 8 - .../node_modules/tsconfig-exports/conf.json | 7 - .../node_modules/tsconfig-exports/foo.js | 0 .../tsconfig-exports/package.json | 7 - .../node_modules/tsconfig-field/conf.json | 7 - .../node_modules/tsconfig-field/foo.js | 0 .../node_modules/tsconfig-field/package.json | 5 - .../node_modules/tsconfig-index/foo.js | 0 .../node_modules/tsconfig-index/package.json | 4 - .../node_modules/tsconfig-index/tsconfig.json | 7 - .../node_modules/tsconfig-not-used/foo.js | 0 .../tsconfig-not-used/tsconfig.json | 7 - fixtures/tsconfig/package.json | 24 - fixtures/tsconfig/tsconfig.json | 7 - fixtures/tsconfig/tsconfig_broken.json | 1 - .../tsconfig/tsconfig_template_variable.json | 7 - napi/__test__/resolver.spec.mjs | 260 - napi/src/lib.rs | 214 - napi/src/options.rs | 261 - napi/src/tracing.rs | 25 - napi/tests/options.test.mjs | 59 - npm/package.json | 79 +- package.json | 53 +- pnpm-lock.yaml | 2598 ------ src/builtins.rs | 71 - src/cache.rs | 354 - src/context.rs | 89 - src/error.rs | 182 - src/file_system.rs | 220 - src/lib.rs | 1755 ---- src/options.rs | 633 -- src/package_json.rs | 219 - src/path.rs | 132 - src/resolution.rs | 92 - src/specifier.rs | 230 - src/tests/alias.rs | 283 - src/tests/browser_field.rs | 189 - src/tests/builtins.rs | 121 - src/tests/dependencies.rs | 110 - src/tests/exports_field.rs | 2546 ------ src/tests/extension_alias.rs | 70 - src/tests/extensions.rs | 125 - src/tests/fallback.rs | 100 - src/tests/full_specified.rs | 113 - src/tests/imports_field.rs | 1320 --- src/tests/incorrect_description_file.rs | 65 - src/tests/main_field.rs | 24 - src/tests/memory_fs.rs | 74 - src/tests/missing.rs | 106 - src/tests/mod.rs | 51 - src/tests/pnp.rs | 45 - src/tests/resolve.rs | 119 - src/tests/restrictions.rs | 25 - src/tests/roots.rs | 92 - src/tests/scoped_packages.rs | 25 - src/tests/simple.rs | 68 - src/tests/symlink.rs | 121 - src/tests/tsconfig_paths.rs | 530 -- src/tests/tsconfig_project_references.rs | 132 - src/tsconfig.rs | 223 - tests/integration_test.rs | 103 - tests/package.json | 5 - tests/resolve_test.rs | 132 - 308 files changed, 56 insertions(+), 24940 deletions(-) delete mode 100644 .github/CODE_OF_CONDUCT.md delete mode 100644 .github/SECURITY.md delete mode 100644 .github/actions/pnpm/action.yml delete mode 100644 .github/codecov.yml delete mode 100644 .github/renovate.json delete mode 100644 .github/workflows/benchmark.yml delete mode 100644 .github/workflows/ci.yml delete mode 100644 .github/workflows/codecov.yml delete mode 100644 .github/workflows/release-napi.yml delete mode 100644 .github/workflows/release-plz.yml delete mode 100644 Cargo.lock delete mode 100644 fixtures/enhanced_resolve/lib/index.js delete mode 100644 fixtures/enhanced_resolve/package.json delete mode 100644 fixtures/enhanced_resolve/test/.gitignore delete mode 100644 fixtures/enhanced_resolve/test/fixtures/#/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/abc.txt delete mode 100644 fixtures/enhanced_resolve/test/fixtures/alias/files/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/browser/module-a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/ignore.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/replaced.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/self.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/toString.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-c.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/c.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/d.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/builtins/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/c.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/complex.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/crypto-js/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/decorated-fs/exists.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/dirOrFile.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/directory-default/directory-default.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/pack1/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/umd.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/index delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/src/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.mts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mjs delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mts.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/app.module.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/foo.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/foo.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/file.load1 delete mode 100644 fixtures/enhanced_resolve/test/fixtures/file.load2 delete mode 100644 fixtures/enhanced_resolve/test/fixtures/foo/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/foo/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/internal/file.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/y/y.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/internal/i.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-3/nested/f/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-4/f/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f$/$.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f/$.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/dir/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/c/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/issue-238/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/issue-238/src/a/config.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/issue-238/src/common/config/myObjectFile.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/lib.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/lib/complex1.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self2/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main1.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main2.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main3.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/no#fragment/#/#.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/no.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/invalidPackageJson/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/file.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/dir/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/typescript/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/prefer-pnp/alternative-modules/m1/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.css delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/index.css delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/module.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/roots_fall_through/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/lib/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/shortcutdir.js/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/b delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/c delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo/a delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo/b delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/b/foo/a delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/c/foo/a delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json delete mode 100644 "fixtures/enhanced_resolve/test/fixtures/\346\265\213\350\257\225.js" delete mode 100644 "fixtures/misc/\344\270\255\346\226\207/\344\270\255\346\226\207.js" delete mode 100644 fixtures/pnp/.gitignore delete mode 100755 fixtures/pnp/.pnp.cjs delete mode 100644 fixtures/pnp/.yarnrc.yml delete mode 100644 fixtures/pnp/package.json delete mode 100644 fixtures/pnp/yarn.lock delete mode 100644 fixtures/pnpm/.gitignore delete mode 100644 fixtures/pnpm/package.json delete mode 100644 fixtures/pnpm/pnpm-lock.yaml delete mode 100644 fixtures/tsconfig/cases/builtins/thing.js delete mode 100644 fixtures/tsconfig/cases/builtins/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/exports/index.js delete mode 100644 fixtures/tsconfig/cases/exports/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-extension/base-tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-extension/foo.js delete mode 100644 fixtures/tsconfig/cases/extends-extension/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-extensionless/foo.js delete mode 100644 fixtures/tsconfig/cases/extends-extensionless/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-multiple/foo.js delete mode 100644 fixtures/tsconfig/cases/extends-multiple/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-not-found/index.js delete mode 100644 fixtures/tsconfig/cases/extends-not-found/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-paths/src/index.js delete mode 100644 fixtures/tsconfig/cases/extends-paths/tsconfig.base.json delete mode 100644 fixtures/tsconfig/cases/extends-paths/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/field/index.js delete mode 100644 fixtures/tsconfig/cases/field/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/index/index.js delete mode 100644 fixtures/tsconfig/cases/index/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/paths_template_variable/foo.js delete mode 100644 fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json delete mode 100644 fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json delete mode 100644 fixtures/tsconfig/cases/project_references/app/aliased/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/app/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/app/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/project_references/project_a/aliased/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_a/conf.json delete mode 100644 fixtures/tsconfig/cases/project_references/project_a/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_b/src/aliased/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_b/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/project_references/project_c/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_c/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/project_references/tsconfig.base.json delete mode 100644 fixtures/tsconfig/cases/suffixes/a.ios.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/a.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/b.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/c-test.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/index.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/trailing-comma/bar.js delete mode 100644 fixtures/tsconfig/cases/trailing-comma/index.js delete mode 100644 fixtures/tsconfig/cases/trailing-comma/tsconfig.json delete mode 100644 fixtures/tsconfig/foo.js delete mode 100644 fixtures/tsconfig/nested/index.js delete mode 100644 fixtures/tsconfig/nested/test.js delete mode 100644 fixtures/tsconfig/nested/tsconfig.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-exports/conf.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-exports/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-exports/package.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-field/conf.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-field/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-field/package.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-index/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-index/package.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-not-used/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json delete mode 100755 fixtures/tsconfig/package.json delete mode 100644 fixtures/tsconfig/tsconfig.json delete mode 100644 fixtures/tsconfig/tsconfig_broken.json delete mode 100644 fixtures/tsconfig/tsconfig_template_variable.json delete mode 100644 napi/__test__/resolver.spec.mjs delete mode 100644 napi/src/lib.rs delete mode 100644 napi/src/options.rs delete mode 100644 napi/src/tracing.rs delete mode 100644 napi/tests/options.test.mjs delete mode 100644 pnpm-lock.yaml delete mode 100644 src/builtins.rs delete mode 100644 src/cache.rs delete mode 100644 src/context.rs delete mode 100644 src/error.rs delete mode 100644 src/file_system.rs delete mode 100644 src/lib.rs delete mode 100644 src/options.rs delete mode 100644 src/package_json.rs delete mode 100644 src/path.rs delete mode 100644 src/resolution.rs delete mode 100644 src/specifier.rs delete mode 100644 src/tests/alias.rs delete mode 100644 src/tests/browser_field.rs delete mode 100644 src/tests/builtins.rs delete mode 100644 src/tests/dependencies.rs delete mode 100644 src/tests/exports_field.rs delete mode 100644 src/tests/extension_alias.rs delete mode 100644 src/tests/extensions.rs delete mode 100644 src/tests/fallback.rs delete mode 100644 src/tests/full_specified.rs delete mode 100644 src/tests/imports_field.rs delete mode 100644 src/tests/incorrect_description_file.rs delete mode 100644 src/tests/main_field.rs delete mode 100644 src/tests/memory_fs.rs delete mode 100644 src/tests/missing.rs delete mode 100644 src/tests/mod.rs delete mode 100644 src/tests/pnp.rs delete mode 100644 src/tests/resolve.rs delete mode 100644 src/tests/restrictions.rs delete mode 100644 src/tests/roots.rs delete mode 100644 src/tests/scoped_packages.rs delete mode 100644 src/tests/simple.rs delete mode 100644 src/tests/symlink.rs delete mode 100644 src/tests/tsconfig_paths.rs delete mode 100644 src/tests/tsconfig_project_references.rs delete mode 100644 src/tsconfig.rs delete mode 100644 tests/integration_test.rs delete mode 100644 tests/package.json delete mode 100644 tests/resolve_test.rs diff --git a/.github/CODE_OF_CONDUCT.md b/.github/CODE_OF_CONDUCT.md deleted file mode 100644 index 41dd9ebe..00000000 --- a/.github/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,127 +0,0 @@ -# Contributor Covenant Code of Conduct - -## Our Pledge - -We as members, contributors, and leaders pledge to make participation in our -community a harassment-free experience for everyone, regardless of age, body -size, visible or invisible disability, ethnicity, sex characteristics, gender -identity and expression, level of experience, education, socio-economic status, -nationality, personal appearance, race, religion, or sexual identity -and orientation. - -We pledge to act and interact in ways that contribute to an open, welcoming, -diverse, inclusive, and healthy community. - -## Our Standards - -Examples of behavior that contributes to a positive environment for our -community include: - -* Demonstrating empathy and kindness toward other people -* Being respectful of differing opinions, viewpoints, and experiences -* Giving and gracefully accepting constructive feedback -* Accepting responsibility and apologizing to those affected by our mistakes, - and learning from the experience -* Focusing on what is best not just for us as individuals, but for the - overall community - -Examples of unacceptable behavior include: - -* The use of sexualized language or imagery, and sexual attention or - advances of any kind -* Trolling, insulting or derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or email - address, without their explicit permission -* Other conduct which could reasonably be considered inappropriate in a - professional setting - -## Enforcement Responsibilities - -Community leaders are responsible for clarifying and enforcing our standards of -acceptable behavior and will take appropriate and fair corrective action in -response to any behavior that they deem inappropriate, threatening, offensive, -or harmful. - -Community leaders have the right and responsibility to remove, edit, or reject -comments, commits, code, wiki edits, issues, and other contributions that are -not aligned to this Code of Conduct, and will communicate reasons for moderation -decisions when appropriate. - -## Scope - -This Code of Conduct applies within all community spaces, and also applies when -an individual is officially representing the community in public spaces. -Examples of representing our community include using an official e-mail address, -posting via an official social media account, or acting as an appointed -representative at an online or offline event. - -## Enforcement - -Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported to the community leaders responsible for enforcement. -All complaints will be reviewed and investigated promptly and fairly. - -All community leaders are obligated to respect the privacy and security of the -reporter of any incident. - -## Enforcement Guidelines - -Community leaders will follow these Community Impact Guidelines in determining -the consequences for any action they deem in violation of this Code of Conduct: - -### 1. Correction - -**Community Impact**: Use of inappropriate language or other behavior deemed -unprofessional or unwelcome in the community. - -**Consequence**: A private, written warning from community leaders, providing -clarity around the nature of the violation and an explanation of why the -behavior was inappropriate. A public apology may be requested. - -### 2. Warning - -**Community Impact**: A violation through a single incident or series -of actions. - -**Consequence**: A warning with consequences for continued behavior. No -interaction with the people involved, including unsolicited interaction with -those enforcing the Code of Conduct, for a specified period of time. This -includes avoiding interactions in community spaces as well as external channels -like social media. Violating these terms may lead to a temporary or -permanent ban. - -### 3. Temporary Ban - -**Community Impact**: A serious violation of community standards, including -sustained inappropriate behavior. - -**Consequence**: A temporary ban from any sort of interaction or public -communication with the community for a specified period of time. No public or -private interaction with the people involved, including unsolicited interaction -with those enforcing the Code of Conduct, is allowed during this period. -Violating these terms may lead to a permanent ban. - -### 4. Permanent Ban - -**Community Impact**: Demonstrating a pattern of violation of community -standards, including sustained inappropriate behavior, harassment of an -individual, or aggression toward or disparagement of classes of individuals. - -**Consequence**: A permanent ban from any sort of public interaction within -the community. - -## Attribution - -This Code of Conduct is adapted from the [Contributor Covenant][homepage], -version 2.0, available at -https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. - -Community Impact Guidelines were inspired by [Mozilla's code of conduct -enforcement ladder](https://github.com/mozilla/diversity). - -[homepage]: https://www.contributor-covenant.org - -For answers to common questions about this code of conduct, see the FAQ at -https://www.contributor-covenant.org/faq. Translations are available at -https://www.contributor-covenant.org/translations. diff --git a/.github/SECURITY.md b/.github/SECURITY.md deleted file mode 100644 index 63f5b072..00000000 --- a/.github/SECURITY.md +++ /dev/null @@ -1,7 +0,0 @@ -# Security Policy - -## Supported Versions - -## Reporting a Vulnerability - -If you find any potential vulnerability, join our [discord channel](https://discord.gg/9uXCAwqQZW) and contact Boshen. diff --git a/.github/actions/pnpm/action.yml b/.github/actions/pnpm/action.yml deleted file mode 100644 index ab4291c0..00000000 --- a/.github/actions/pnpm/action.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: Pnpm - -description: Install pnpm - -runs: - using: composite - steps: - - uses: pnpm/action-setup@v4 - - - uses: actions/setup-node@v4 - with: - node-version-file: .node-version - cache: pnpm - - - name: yarn - shell: bash - run: | - cd fixtures/pnp - corepack enable - yarn install - - - name: pnpm - shell: bash - run: | - corepack enable - pnpm install diff --git a/.github/codecov.yml b/.github/codecov.yml deleted file mode 100644 index 0610268a..00000000 --- a/.github/codecov.yml +++ /dev/null @@ -1,14 +0,0 @@ -coverage: - status: - project: - default: - informational: true - patch: - default: - informational: true - changes: - default: - informational: true - -ignore: - - "examples" diff --git a/.github/renovate.json b/.github/renovate.json deleted file mode 100644 index 2339df09..00000000 --- a/.github/renovate.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "$schema": "https://docs.renovatebot.com/renovate-schema.json", - "extends": ["github>Boshen/renovate"], - "ignorePaths": ["**/node_modules/**", "**/fixtures/**"] -} diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml deleted file mode 100644 index 7c25853b..00000000 --- a/.github/workflows/benchmark.yml +++ /dev/null @@ -1,41 +0,0 @@ -name: Benchmark - -on: - workflow_dispatch: - pull_request: - types: [opened, synchronize] - paths-ignore: - - '**/*.md' - push: - branches: - - main - paths-ignore: - - '**/*.md' - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} - cancel-in-progress: true - -jobs: - benchmark: - name: Benchmark - runs-on: ubuntu-latest - steps: - - name: Checkout Branch - uses: taiki-e/checkout-action@v1 - - - uses: Boshen/setup-rust@main - with: - cache-key: benchmark - save-cache: ${{ github.ref_name == 'main' }} - tools: cargo-codspeed - - uses: ./.github/actions/pnpm - - name: Build Benchmark - run: cargo codspeed build --features codspeed - - - name: Run benchmark - uses: CodSpeedHQ/action@v3 - timeout-minutes: 30 - with: - run: cargo codspeed run - token: ${{ secrets.CODSPEED_TOKEN }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index 3f629ffb..00000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,196 +0,0 @@ -name: CI - -on: - workflow_dispatch: - pull_request: - types: [opened, synchronize] - paths-ignore: - - '**/*.md' - - '!.github/workflows/ci.yml' - push: - branches: - - main - - "renovate/**" - paths-ignore: - - '**/*.md' - - '!.github/workflows/ci.yml' - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} - cancel-in-progress: ${{ github.ref_name != 'main' }} - -defaults: - run: - shell: bash - -jobs: - cache: # Warm cache factory for all other CI jobs - name: Check and Build - strategy: - fail-fast: true - matrix: - include: - - os: windows-latest - - os: ubuntu-latest - - os: macos-14 - runs-on: ${{ matrix.os }} - steps: - - uses: taiki-e/checkout-action@v1 - - - uses: Boshen/setup-rust@main - with: - save-cache: ${{ github.ref_name == 'main' }} - cache-key: warm - - - run: cargo check --all-features --locked - - # Only need to build the test to create a warm cache on the main branch - - name: Build cache by Cargo Check and Cargo Test - if: ${{ github.ref_name == 'main' }} - run: cargo test --all-features --no-run - - wasm: - name: Check Wasm - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - - uses: Boshen/setup-rust@main - with: - cache-key: wasm - save-cache: ${{ github.ref_name == 'main' }} - - - name: Check - run: | - rustup target add wasm32-unknown-unknown - cargo check --all-features --target wasm32-unknown-unknown - - wasi: - name: Test wasi target - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - - uses: Boshen/setup-rust@main - with: - cache-key: wasi - save-cache: ${{ github.ref_name == 'main' }} - - - uses: ./.github/actions/pnpm - - - name: Build - run: | - rustup target add wasm32-wasip1-threads - pnpm build --target wasm32-wasip1-threads - - - name: Test - run: pnpm test - env: - WASI_TEST: 1 - - typos: - name: Spell Check - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - - uses: crate-ci/typos@v1.24.5 - with: - files: . - - deny: - name: Cargo Deny - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - - uses: dorny/paths-filter@v3 - id: filter - with: - filters: | - src: - - 'Cargo.lock' - - - uses: Boshen/setup-rust@main - with: - restore-cache: false - tools: cargo-deny - - - if: steps.filter.outputs.src == 'true' - run: cargo deny check - - unused-deps: - name: Check Unused Dependencies - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - uses: dorny/paths-filter@v3 - id: filter - with: - filters: | - src: - - '**/*.rs' - - '**/Cargo.toml' - - 'Cargo.lock' - - uses: Boshen/setup-rust@main - with: - restore-cache: false - if: steps.filter.outputs.src == 'true' - - uses: cargo-bins/cargo-binstall@main - if: steps.filter.outputs.src == 'true' - - run: cargo binstall --no-confirm cargo-shear@1 - if: steps.filter.outputs.src == 'true' - - run: cargo shear - if: steps.filter.outputs.src == 'true' - - format: - name: Format - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - uses: Boshen/setup-rust@main - with: - components: rustfmt - restore-cache: false - - run: cargo fmt --all -- --check - - lint: - name: Clippy - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - uses: Boshen/setup-rust@main - with: - components: clippy - - run: cargo clippy --all-features -- -D warnings - - doc: - name: Doc - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - uses: Boshen/setup-rust@main - with: - components: rust-docs - - run: RUSTDOCFLAGS='-D warnings' cargo doc --no-deps --all-features - - test: - name: Test - strategy: - fail-fast: true - matrix: - include: - - os: windows-latest - - os: ubuntu-latest - - os: macos-14 - runs-on: ${{ matrix.os }} - env: - RUST_BACKTRACE: 1 - steps: - - uses: taiki-e/checkout-action@v1 - - uses: ./.github/actions/pnpm - - uses: Boshen/setup-rust@main - with: - cache-key: warm - - run: cargo test --doc - - run: cargo test --all-features diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml deleted file mode 100644 index 97302b03..00000000 --- a/.github/workflows/codecov.yml +++ /dev/null @@ -1,69 +0,0 @@ -name: Code Coverage # Run cargo-llvm-cov and upload to codecov.io - -on: - workflow_dispatch: - pull_request: - types: [opened, synchronize] - paths-ignore: - - '**/*.md' - push: - branches: - - main - paths-ignore: - - '**/*.md' - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: ${{ github.ref_name != 'main' }} - -jobs: - coverage: - name: Code Coverage - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: taiki-e/checkout-action@v1 - - - uses: ./.github/actions/pnpm - - - uses: Boshen/setup-rust@main - with: - cache-key: codecov - save-cache: ${{ github.ref_name == 'main' }} - tools: cargo-llvm-cov - components: llvm-tools-preview - - - run: cargo llvm-cov --lcov --output-path lcov.info - - - name: Upload Artifact - uses: actions/upload-artifact@v4 - with: - name: codecov - path: lcov.info - - # codecov often fails, use another workflow for retry - upload-codecov: - name: Upload coverage file - runs-on: ubuntu-latest - needs: coverage - # Check if the event is not triggered by a fork by checking whether CODECOV_TOKEN is set - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - steps: - - name: Checkout - if: env.CODECOV_TOKEN - uses: taiki-e/checkout-action@v1 - - - name: Download coverage file - if: env.CODECOV_TOKEN - uses: actions/download-artifact@v4 - with: - name: codecov - - - name: Upload to codecov.io - if: env.CODECOV_TOKEN - uses: codecov/codecov-action@v4 - with: - token: ${{ secrets.CODECOV_TOKEN }} - fail_ci_if_error: true - files: lcov.info diff --git a/.github/workflows/release-napi.yml b/.github/workflows/release-napi.yml deleted file mode 100644 index 1ea68db8..00000000 --- a/.github/workflows/release-napi.yml +++ /dev/null @@ -1,252 +0,0 @@ -name: Release NAPI - -on: - workflow_dispatch: - push: - branches: - - main - paths: - - npm/package.json # Please only commit this file, so we don't need to wait for test CI to pass. - -env: - DEBUG: 'napi:*' - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - check: - name: Check version - runs-on: ubuntu-latest - outputs: - version: ${{ env.version }} - version_changed: ${{ steps.version.outputs.changed }} - steps: - - uses: taiki-e/checkout-action@v1 - - - name: Check version changes - uses: EndBug/version-check@v2 - id: version - with: - static-checking: localIsNew - file-url: https://unpkg.com/oxc-resolver@latest/package.json - file-name: npm/package.json - - - name: Set version name - if: steps.version.outputs.changed == 'true' - run: | - echo "Version change found! New version: ${{ steps.version.outputs.version }} (${{ steps.version.outputs.version_type }})" - echo "version=${{ steps.version.outputs.version }}" >> $GITHUB_ENV - - build: - needs: check - if: needs.check.outputs.version_changed == 'true' - env: - version: ${{ needs.check.outputs.version }} - outputs: - version: ${{ env.version }} - strategy: - fail-fast: false - matrix: - include: - - os: windows-latest - target: x86_64-pc-windows-msvc - - - os: windows-latest - target: aarch64-pc-windows-msvc - - - os: ubuntu-latest - target: x86_64-unknown-linux-gnu - - - os: ubuntu-latest - target: x86_64-unknown-linux-musl - - - os: ubuntu-latest - target: aarch64-unknown-linux-gnu - - - os: ubuntu-latest - target: aarch64-unknown-linux-musl - - - os: ubuntu-latest - target: armv7-unknown-linux-gnueabihf - - - os: macos-latest - target: x86_64-apple-darwin - - - os: macos-latest - target: aarch64-apple-darwin - - - os: ubuntu-latest - target: wasm32-wasip1-threads - - name: Package ${{ matrix.target }} - runs-on: ${{ matrix.os }} - steps: - - uses: taiki-e/checkout-action@v1 - - - uses: ./.github/actions/pnpm - - - name: Add Rust Target - run: rustup target add ${{ matrix.target }} - - - uses: goto-bus-stop/setup-zig@v2 - if: ${{ contains(matrix.target, 'musl') }} - with: - version: 0.13.0 - - - name: Build with zig cross - if: ${{ contains(matrix.target, 'musl') }} - run: pnpm build -x --target ${{ matrix.target }} - - - name: Build with napi cross - if: ${{ contains(matrix.target, 'gnu') }} - run: pnpm build --use-napi-cross --target ${{ matrix.target }} - - - name: Build - if: ${{ !contains(matrix.target, 'gnu') && !contains(matrix.target, 'musl') }} - run: pnpm build --target ${{ matrix.target }} - - - name: Test - if: matrix.target == 'x86_64-pc-windows-msvc' || matrix.target == 'aarch64-apple-darwin' || matrix.target == 'wasm32-wasip1-threads' - run: pnpm test - - - name: Output docker params - if: ${{ contains(matrix.target, 'linux') }} - id: docker - run: | - node -e " - if ('${{ matrix.target }}'.startsWith('aarch64')) { - console.log('PLATFORM=linux/arm64') - } else if ('${{ matrix.target }}'.startsWith('armv7')) { - console.log('PLATFORM=linux/arm/v7') - } else { - console.log('PLATFORM=linux/amd64') - } - " >> $GITHUB_OUTPUT - node -e " - if ('${{ matrix.target }}'.endsWith('-musl')) { - console.log('IMAGE=node:lts-alpine') - } else { - console.log('IMAGE=node:lts-slim') - } - " >> $GITHUB_OUTPUT - echo "PNPM_STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_OUTPUT - - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - if: ${{ contains(matrix.target, 'linux') }} - with: - platforms: all - - - run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes - if: ${{ contains(matrix.target, 'linux') }} - - - name: Run linux test - uses: addnab/docker-run-action@v3 - if: ${{ contains(matrix.target, 'linux') }} - with: - image: ${{ steps.docker.outputs.IMAGE }} - options: -v ${{ steps.docker.outputs.PNPM_STORE_PATH }}:${{ steps.docker.outputs.PNPM_STORE_PATH }} -v ${{ github.workspace }}:/oxc_resolver -w /oxc_resolver --platform ${{ steps.docker.outputs.PLATFORM }} - run: | - corepack enable - pnpm test - - - name: Upload artifacts - uses: actions/upload-artifact@v4 - with: - name: bindings-${{ matrix.target }} - path: | - napi/*.node - napi/*.wasm - - build-freebsd: - needs: check - if: needs.check.outputs.version_changed == 'true' - name: Build FreeBSD - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Build - id: build - uses: cross-platform-actions/action@v0.25.0 - env: - DEBUG: napi:* - RUSTUP_IO_THREADS: 1 - with: - operating_system: freebsd - version: '14.0' - memory: 8G - cpu_count: 3 - environment_variables: 'DEBUG RUSTUP_IO_THREADS' - shell: bash - run: | - sudo pkg install -y -f curl node libnghttp2 npm - curl https://sh.rustup.rs -sSf --output rustup.sh - sh rustup.sh -y --profile minimal --default-toolchain stable - source "$HOME/.cargo/env" - echo "~~~~ rustc --version ~~~~" - rustc --version - echo "~~~~ node -v ~~~~" - node -v - pwd - ls -lah - whoami - env - sudo corepack enable - pnpm install - pnpm build --target x86_64-unknown-freebsd - rm -rf node_modules - rm -rf target - - name: Upload artifact - uses: actions/upload-artifact@v4 - with: - name: bindings-freebsd - path: napi/*.node - if-no-files-found: error - - publish: - name: Publish NAPI - runs-on: ubuntu-latest - permissions: - id-token: write # for `npm publish --provenance` - needs: - - build - - build-freebsd - steps: - - uses: taiki-e/checkout-action@v1 - - - name: corepack - run: corepack enable - - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version-file: .node-version - cache: pnpm - - - name: Install dependencies - run: pnpm install --frozen-lockfile - - - name: Download Artifacts - uses: actions/download-artifact@v4 - with: - path: artifacts - - - name: Prepare dirs and artifacts - run: | - pnpm napi create-npm-dirs --package-json-path npm/package.json - pnpm napi artifacts --package-json-path npm/package.json --build-output-dir napi - - - name: Publish npm packages as latest - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - shell: bash - run: | - cp napi/index.js npm/index.js - cp napi/index.d.ts npm/index.d.ts - cp napi/browser.js npm/browser.js - echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc - pnpm napi pre-publish --no-gh-release -t npm --package-json-path npm/package.json - npm publish npm/ --tag latest --provenance --access public diff --git a/.github/workflows/release-plz.yml b/.github/workflows/release-plz.yml deleted file mode 100644 index 121758ad..00000000 --- a/.github/workflows/release-plz.yml +++ /dev/null @@ -1,55 +0,0 @@ -name: Release Plz - -on: - workflow_dispatch: - push: - branches: - - main - -permissions: - pull-requests: write - contents: write - -jobs: - release-plz: - name: Release-plz - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - uses: Boshen/setup-rust@main - with: - save-cache: ${{ github.ref_name == 'main' }} - cache-key: warm - - - name: Run release-plz - id: release-plz - uses: MarcoIeni/release-plz-action@v0.5 - env: - GITHUB_TOKEN: ${{ secrets.RELEASE_PLZ_TOKEN }} - CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} - - - name: Bump package.json - if: ${{ steps.release-plz.outputs.prs_created }} - env: - GH_TOKEN: ${{ github.token }} - RELEASES: ${{ steps.release-plz.outputs.releases }} - PR: ${{ steps.release-plz.outputs.pr }} - run: | - set -e - - pr_number=${{ fromJSON(steps.release-plz.outputs.pr).number }} - if [[ -n "$pr_number" ]]; then - version=$(echo "$RELEASES" | jq -r '.[0].version') - echo "version: $version" - - jq --arg version "${version}" '.version = ($version)' npm/package.json > tmp - mv tmp npm/package.json - - gh pr checkout $pr_number - git add . - git commit -m "Update package.json" - git push - fi diff --git a/Cargo.lock b/Cargo.lock deleted file mode 100644 index 58c1e7ad..00000000 --- a/Cargo.lock +++ /dev/null @@ -1,1326 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "adler" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" - -[[package]] -name = "aho-corasick" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" -dependencies = [ - "memchr", -] - -[[package]] -name = "android-tzdata" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" - -[[package]] -name = "android_system_properties" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" -dependencies = [ - "libc", -] - -[[package]] -name = "anes" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "735d4f398ca57cfa2880225c2bf81c3b9af3be5bb22e44ae70118dad38713e84" - -[[package]] -name = "arca" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f915ddd863ef73f11c10c75170e86db1d4f539689bc6bfb9ce25d6528d6fe83" -dependencies = [ - "clean-path", - "path-slash", - "radix_trie", -] - -[[package]] -name = "autocfg" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" - -[[package]] -name = "base64" -version = "0.22.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" - -[[package]] -name = "bit-set" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1" -dependencies = [ - "bit-vec", -] - -[[package]] -name = "bit-vec" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "bitflags" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" - -[[package]] -name = "bpaf" -version = "0.9.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3280efcf6d66bc77c2cf9b67dc8acee47a217d9be67dd590b3230dffe663724d" - -[[package]] -name = "bumpalo" -version = "3.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" - -[[package]] -name = "byteorder" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" - -[[package]] -name = "cast" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" - -[[package]] -name = "cc" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eaff6f8ce506b9773fa786672d63fc7a191ffea1be33f72bbd4aeacefca9ffc8" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "chrono" -version = "0.4.38" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" -dependencies = [ - "android-tzdata", - "iana-time-zone", - "num-traits", - "serde", - "windows-targets 0.52.6", -] - -[[package]] -name = "ciborium" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42e69ffd6f0917f5c029256a24d0161db17cea3997d185db0d35926308770f0e" -dependencies = [ - "ciborium-io", - "ciborium-ll", - "serde", -] - -[[package]] -name = "ciborium-io" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05afea1e0a06c9be33d539b876f1ce3692f4afea2cb41f740e7743225ed1c757" - -[[package]] -name = "ciborium-ll" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57663b653d948a338bfb3eeba9bb2fd5fcfaecb9e199e87e1eda4d9e8b240fd9" -dependencies = [ - "ciborium-io", - "half", -] - -[[package]] -name = "clean-path" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aaa6b4b263a5d737e9bf6b7c09b72c41a5480aec4d7219af827f6564e950b6a5" - -[[package]] -name = "codspeed" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a104ac948e0188b921eb3fcbdd55dcf62e542df4c7ab7e660623f6288302089" -dependencies = [ - "colored", - "libc", - "serde_json", -] - -[[package]] -name = "colored" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbf2150cce219b664a8a70df7a1f933836724b503f8a413af9365b4dcc4d90b8" -dependencies = [ - "lazy_static", - "windows-sys 0.48.0", -] - -[[package]] -name = "concurrent_lru" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7feb5cb312f774e8a24540e27206db4e890f7d488563671d24a16389cf4c2e4e" -dependencies = [ - "once_cell", -] - -[[package]] -name = "convert_case" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec182b0ca2f35d8fc196cf3404988fd8b8c739a4d270ff118a398feb0cbec1ca" -dependencies = [ - "unicode-segmentation", -] - -[[package]] -name = "core-foundation-sys" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" - -[[package]] -name = "criterion2" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8df39381f28ced0ceebfb5611528d99aef14f8d75b43e9d4ceb6aba66e7b04d" -dependencies = [ - "anes", - "bpaf", - "cast", - "ciborium", - "codspeed", - "colored", - "num-traits", - "oorandom", - "serde", - "serde_json", - "walkdir", -] - -[[package]] -name = "crossbeam-deque" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" -dependencies = [ - "crossbeam-epoch", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.9.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" -dependencies = [ - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" - -[[package]] -name = "crunchy" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" - -[[package]] -name = "ctor" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edb49164822f3ee45b17acd4a208cfc1251410cf0cad9a833234c9890774dd9f" -dependencies = [ - "quote", - "syn", -] - -[[package]] -name = "darling" -version = "0.20.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" -dependencies = [ - "darling_core", - "darling_macro", -] - -[[package]] -name = "darling_core" -version = "0.20.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95133861a8032aaea082871032f5815eb9e98cef03fa916ab4500513994df9e5" -dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "strsim", - "syn", -] - -[[package]] -name = "darling_macro" -version = "0.20.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" -dependencies = [ - "darling_core", - "quote", - "syn", -] - -[[package]] -name = "dashmap" -version = "6.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "804c8821570c3f8b70230c2ba75ffa5c0f9a4189b9a432b6656c536712acae28" -dependencies = [ - "cfg-if", - "crossbeam-utils", - "hashbrown 0.14.5", - "lock_api", - "once_cell", - "parking_lot_core", -] - -[[package]] -name = "deranged" -version = "0.3.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" -dependencies = [ - "powerfmt", - "serde", -] - -[[package]] -name = "document-features" -version = "0.2.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb6969eaabd2421f8a2775cfd2471a2b634372b4a25d41e3bd647b79912850a0" -dependencies = [ - "litrs", -] - -[[package]] -name = "dunce" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" - -[[package]] -name = "either" -version = "1.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" - -[[package]] -name = "endian-type" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" - -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "fancy-regex" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "531e46835a22af56d1e3b66f04844bed63158bc094a628bec1d321d9b4c44bf2" -dependencies = [ - "bit-set", - "regex-automata", - "regex-syntax", -] - -[[package]] -name = "filetime" -version = "0.2.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ee447700ac8aa0b2f2bd7bc4462ad686ba06baa6727ac149a2d6277f0d240fd" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall 0.4.1", - "windows-sys 0.52.0", -] - -[[package]] -name = "fnv" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" - -[[package]] -name = "half" -version = "2.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dd08c532ae367adf81c312a4580bc67f1d0fe8bc9c460520283f4c0ff277888" -dependencies = [ - "cfg-if", - "crunchy", -] - -[[package]] -name = "hashbrown" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" - -[[package]] -name = "hashbrown" -version = "0.14.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "iana-time-zone" -version = "0.1.60" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" -dependencies = [ - "android_system_properties", - "core-foundation-sys", - "iana-time-zone-haiku", - "js-sys", - "wasm-bindgen", - "windows-core", -] - -[[package]] -name = "iana-time-zone-haiku" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" -dependencies = [ - "cc", -] - -[[package]] -name = "ident_case" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" - -[[package]] -name = "indexmap" -version = "1.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" -dependencies = [ - "autocfg", - "hashbrown 0.12.3", - "serde", -] - -[[package]] -name = "indexmap" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93ead53efc7ea8ed3cfb0c79fc8023fbb782a5432b52830b6518941cebe6505c" -dependencies = [ - "equivalent", - "hashbrown 0.14.5", - "serde", -] - -[[package]] -name = "itoa" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" - -[[package]] -name = "js-sys" -version = "0.3.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" -dependencies = [ - "wasm-bindgen", -] - -[[package]] -name = "json-strip-comments" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b271732a960335e715b6b2ae66a086f115c74eb97360e996d2bd809bfc063bba" -dependencies = [ - "memchr", -] - -[[package]] -name = "lazy_static" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" - -[[package]] -name = "libc" -version = "0.2.155" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" - -[[package]] -name = "libloading" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e310b3a6b5907f99202fcdb4960ff45b93735d7c7d96b760fcff8db2dc0e103d" -dependencies = [ - "cfg-if", - "windows-targets 0.52.6", -] - -[[package]] -name = "litrs" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4ce301924b7887e9d637144fdade93f9dfff9b60981d4ac161db09720d39aa5" - -[[package]] -name = "lock_api" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" -dependencies = [ - "autocfg", - "scopeguard", -] - -[[package]] -name = "log" -version = "0.4.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" - -[[package]] -name = "memchr" -version = "2.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" - -[[package]] -name = "miniz_oxide" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" -dependencies = [ - "adler", -] - -[[package]] -name = "napi" -version = "3.0.0-alpha.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ec04344cc540f5897e97c9821ab99e7eb276b4dca6f3e6e441dfa72e5bcde70" -dependencies = [ - "bitflags 2.6.0", - "ctor", - "napi-build", - "napi-sys", - "once_cell", - "serde", - "serde_json", -] - -[[package]] -name = "napi-build" -version = "2.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1c0f5d67ee408a4685b61f5ab7e58605c8ae3f2b4189f0127d804ff13d5560a" - -[[package]] -name = "napi-derive" -version = "3.0.0-alpha.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c6240c4ddca592cde608bbfa26e2af397c3596e413a0c65c9bbcb65c2f1e485" -dependencies = [ - "cfg-if", - "convert_case", - "napi-derive-backend", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "napi-derive-backend" -version = "2.0.0-alpha.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b32dcc50065508fe2f387076c17adbdf10e038d1c080d48b10196813d94ac6a8" -dependencies = [ - "convert_case", - "once_cell", - "proc-macro2", - "quote", - "regex", - "semver", - "syn", -] - -[[package]] -name = "napi-sys" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "427802e8ec3a734331fec1035594a210ce1ff4dc5bc1950530920ab717964ea3" -dependencies = [ - "libloading", -] - -[[package]] -name = "nibble_vec" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" -dependencies = [ - "smallvec", -] - -[[package]] -name = "normalize-path" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5438dd2b2ff4c6df6e1ce22d825ed2fa93ee2922235cc45186991717f0a892d" - -[[package]] -name = "num-conv" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" - -[[package]] -name = "num-traits" -version = "0.2.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" -dependencies = [ - "autocfg", -] - -[[package]] -name = "once_cell" -version = "1.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" - -[[package]] -name = "oorandom" -version = "11.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b410bbe7e14ab526a0e86877eb47c6996a2bd7746f027ba551028c925390e4e9" - -[[package]] -name = "oxc_napi_resolver" -version = "0.0.0" -dependencies = [ - "napi", - "napi-build", - "napi-derive", - "oxc_resolver", - "tracing-subscriber", -] - -[[package]] -name = "oxc_resolver" -version = "1.11.0" -dependencies = [ - "cfg-if", - "criterion2", - "dashmap", - "document-features", - "dunce", - "indexmap 2.4.0", - "json-strip-comments", - "normalize-path", - "once_cell", - "pnp", - "rayon", - "rustc-hash", - "serde", - "serde_json", - "simdutf8", - "thiserror", - "tracing", - "vfs", -] - -[[package]] -name = "parking_lot_core" -version = "0.9.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall 0.5.2", - "smallvec", - "windows-targets 0.52.6", -] - -[[package]] -name = "path-slash" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e91099d4268b0e11973f036e885d652fb0b21fedcf69738c627f94db6a44f42" - -[[package]] -name = "pathdiff" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8835116a5c179084a830efb3adc117ab007512b535bc1a21c991d3b32a6b44dd" - -[[package]] -name = "pin-project-lite" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" - -[[package]] -name = "pnp" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46770cee76a618023fea15411d0449dd066dc232cc17e4562f154da215f27af7" -dependencies = [ - "arca", - "byteorder", - "concurrent_lru", - "fancy-regex", - "lazy_static", - "miniz_oxide", - "pathdiff", - "regex", - "serde", - "serde_json", - "serde_with", - "thiserror", -] - -[[package]] -name = "powerfmt" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" - -[[package]] -name = "proc-macro2" -version = "1.0.86" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.36" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "radix_trie" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" -dependencies = [ - "endian-type", - "nibble_vec", -] - -[[package]] -name = "rayon" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" -dependencies = [ - "either", - "rayon-core", -] - -[[package]] -name = "rayon-core" -version = "1.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" -dependencies = [ - "crossbeam-deque", - "crossbeam-utils", -] - -[[package]] -name = "redox_syscall" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" -dependencies = [ - "bitflags 1.3.2", -] - -[[package]] -name = "redox_syscall" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c82cf8cff14456045f55ec4241383baeff27af886adb72ffb2162f99911de0fd" -dependencies = [ - "bitflags 2.6.0", -] - -[[package]] -name = "regex" -version = "1.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b91213439dad192326a0d7c6ee3955910425f441d7038e0d6933b0aec5c4517f" -dependencies = [ - "aho-corasick", - "memchr", - "regex-automata", - "regex-syntax", -] - -[[package]] -name = "regex-automata" -version = "0.4.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", -] - -[[package]] -name = "regex-syntax" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" - -[[package]] -name = "rustc-hash" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" - -[[package]] -name = "ryu" -version = "1.0.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" - -[[package]] -name = "same-file" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "scopeguard" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" - -[[package]] -name = "semver" -version = "1.0.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" - -[[package]] -name = "serde" -version = "1.0.209" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99fce0ffe7310761ca6bf9faf5115afbc19688edd00171d81b1bb1b116c63e09" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.209" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5831b979fd7b5439637af1752d535ff49f4860c0f341d1baeb6faf0f4242170" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "serde_json" -version = "1.0.127" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8043c06d9f82bd7271361ed64f415fe5e12a77fdb52e573e7f06a516dea329ad" -dependencies = [ - "indexmap 2.4.0", - "itoa", - "memchr", - "ryu", - "serde", -] - -[[package]] -name = "serde_with" -version = "3.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e73139bc5ec2d45e6c5fd85be5a46949c1c39a4c18e56915f5eb4c12f975e377" -dependencies = [ - "base64", - "chrono", - "hex", - "indexmap 1.9.3", - "indexmap 2.4.0", - "serde", - "serde_derive", - "serde_json", - "serde_with_macros", - "time", -] - -[[package]] -name = "serde_with_macros" -version = "3.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b80d3d6b56b64335c0180e5ffde23b3c5e08c14c585b51a15bd0e95393f46703" -dependencies = [ - "darling", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "sharded-slab" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" -dependencies = [ - "lazy_static", -] - -[[package]] -name = "simdutf8" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f27f6278552951f1f2b8cf9da965d10969b2efdea95a6ec47987ab46edfe263a" - -[[package]] -name = "smallvec" -version = "1.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" - -[[package]] -name = "strsim" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" - -[[package]] -name = "syn" -version = "2.0.70" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f0209b68b3613b093e0ec905354eccaedcfe83b8cb37cbdeae64026c3064c16" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "thiserror" -version = "1.0.63" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.63" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "thread_local" -version = "1.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" -dependencies = [ - "cfg-if", - "once_cell", -] - -[[package]] -name = "time" -version = "0.3.36" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" -dependencies = [ - "deranged", - "itoa", - "num-conv", - "powerfmt", - "serde", - "time-core", - "time-macros", -] - -[[package]] -name = "time-core" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" - -[[package]] -name = "time-macros" -version = "0.2.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" -dependencies = [ - "num-conv", - "time-core", -] - -[[package]] -name = "tracing" -version = "0.1.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" -dependencies = [ - "pin-project-lite", - "tracing-attributes", - "tracing-core", -] - -[[package]] -name = "tracing-attributes" -version = "0.1.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "tracing-core" -version = "0.1.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" -dependencies = [ - "once_cell", -] - -[[package]] -name = "tracing-subscriber" -version = "0.3.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" -dependencies = [ - "sharded-slab", - "thread_local", - "tracing-core", -] - -[[package]] -name = "unicode-ident" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" - -[[package]] -name = "unicode-segmentation" -version = "1.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" - -[[package]] -name = "vfs" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "654cd097e182a71dbf899178e6b5662c2157dd0b8afd5975de18008f6fc173d1" -dependencies = [ - "filetime", -] - -[[package]] -name = "walkdir" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" -dependencies = [ - "same-file", - "winapi-util", -] - -[[package]] -name = "wasm-bindgen" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" -dependencies = [ - "cfg-if", - "wasm-bindgen-macro", -] - -[[package]] -name = "wasm-bindgen-backend" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" -dependencies = [ - "bumpalo", - "log", - "once_cell", - "proc-macro2", - "quote", - "syn", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-macro" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" -dependencies = [ - "quote", - "wasm-bindgen-macro-support", -] - -[[package]] -name = "wasm-bindgen-macro-support" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" -dependencies = [ - "proc-macro2", - "quote", - "syn", - "wasm-bindgen-backend", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-shared" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" - -[[package]] -name = "winapi-util" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b" -dependencies = [ - "windows-sys 0.52.0", -] - -[[package]] -name = "windows-core" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" -dependencies = [ - "windows-targets 0.52.6", -] - -[[package]] -name = "windows-sys" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" -dependencies = [ - "windows-targets 0.48.5", -] - -[[package]] -name = "windows-sys" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" -dependencies = [ - "windows-targets 0.52.6", -] - -[[package]] -name = "windows-targets" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" -dependencies = [ - "windows_aarch64_gnullvm 0.48.5", - "windows_aarch64_msvc 0.48.5", - "windows_i686_gnu 0.48.5", - "windows_i686_msvc 0.48.5", - "windows_x86_64_gnu 0.48.5", - "windows_x86_64_gnullvm 0.48.5", - "windows_x86_64_msvc 0.48.5", -] - -[[package]] -name = "windows-targets" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" -dependencies = [ - "windows_aarch64_gnullvm 0.52.6", - "windows_aarch64_msvc 0.52.6", - "windows_i686_gnu 0.52.6", - "windows_i686_gnullvm", - "windows_i686_msvc 0.52.6", - "windows_x86_64_gnu 0.52.6", - "windows_x86_64_gnullvm 0.52.6", - "windows_x86_64_msvc 0.52.6", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" - -[[package]] -name = "windows_i686_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" - -[[package]] -name = "windows_i686_gnu" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" - -[[package]] -name = "windows_i686_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" - -[[package]] -name = "windows_i686_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" - -[[package]] -name = "windows_i686_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" diff --git a/fixtures/enhanced_resolve/lib/index.js b/fixtures/enhanced_resolve/lib/index.js deleted file mode 100644 index 1e872e8f..00000000 --- a/fixtures/enhanced_resolve/lib/index.js +++ /dev/null @@ -1 +0,0 @@ -// mimic enhanced-resolved root directory structure diff --git a/fixtures/enhanced_resolve/package.json b/fixtures/enhanced_resolve/package.json deleted file mode 100644 index d1b845b5..00000000 --- a/fixtures/enhanced_resolve/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "enhanced-resolve", - "main": "lib/index.js" -} diff --git a/fixtures/enhanced_resolve/test/.gitignore b/fixtures/enhanced_resolve/test/.gitignore deleted file mode 100644 index b021b4e4..00000000 --- a/fixtures/enhanced_resolve/test/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -# created by symlink.rs -/temp -/temp_symlinks \ No newline at end of file diff --git a/fixtures/enhanced_resolve/test/fixtures/#/a.js b/fixtures/enhanced_resolve/test/fixtures/#/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/a.js b/fixtures/enhanced_resolve/test/fixtures/a.js deleted file mode 100644 index 896ffc6d..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/abc.txt b/fixtures/enhanced_resolve/test/fixtures/abc.txt deleted file mode 100644 index f2ba8f84..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/abc.txt +++ /dev/null @@ -1 +0,0 @@ -abc \ No newline at end of file diff --git a/fixtures/enhanced_resolve/test/fixtures/alias/files/a.js b/fixtures/enhanced_resolve/test/fixtures/alias/files/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/b.js b/fixtures/enhanced_resolve/test/fixtures/b.js deleted file mode 100644 index 11476340..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/b.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function b() { - return "This is b"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/browser/module-a.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/browser/module-a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/browser.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/ignore.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/ignore.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/replaced.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/replaced.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/self.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/self.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/toString.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/toString.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-a.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-b.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-c.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-c.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/a.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/b.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/c.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/c.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/d.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/d.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json deleted file mode 100644 index c13fe23b..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "browser": { - "a.js": "./a", - "./b.js": "./b", - "c.js": "./d.js", - "./d.js": "./c.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/package.json b/fixtures/enhanced_resolve/test/fixtures/browser-module/package.json deleted file mode 100644 index 19ff7739..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/browser-module/package.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "exports": { - "./lib/index.js": "./lib/index.js" - }, - "browser": { - "./lib/ignore.js": false, - "./lib/replaced.js": "./lib/browser", - "module-a": "./browser/module-a.js", - "module-b": "module-c", - "module-c": "module-c", - "./toString": "./lib/toString.js", - "./lib/main.js": "./lib/main.js", - "./main.js": "./lib/main.js", - "./lib/xyz.js": "./xyz.js", - "./xyz.js": "./lib/xyz.js", - "./lib/non-existent.js": "./lib/non-existent.js", - ".": false, - "./number": 1, - "./foo": "./lib/replaced.js?query" - }, - "innerBrowser1": { - "field": { - "browser": { - "./lib/main1.js": "./lib/main.js" - } - } - }, - "innerBrowser2": { - "browser": { - "./lib/main2.js": "./lib/replaced.js" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/builtins/package.json b/fixtures/enhanced_resolve/test/fixtures/builtins/package.json deleted file mode 100644 index 4a54ea96..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/builtins/package.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "name": "builtins", - "private": true, - "imports": { - "#fs": { - "default": "fs" - }, - "#http": { - "node": "node:http" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/c.js b/fixtures/enhanced_resolve/test/fixtures/c.js deleted file mode 100644 index e3aca8aa..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/c.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = function b() { - require("./a"); - return "This is c"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/complex.js b/fixtures/enhanced_resolve/test/fixtures/complex.js deleted file mode 100644 index 1f62db84..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/complex.js +++ /dev/null @@ -1,13 +0,0 @@ -var 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); diff --git a/fixtures/enhanced_resolve/test/fixtures/crypto-js/index.js b/fixtures/enhanced_resolve/test/fixtures/crypto-js/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json b/fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json deleted file mode 100644 index 1d31aa8b..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "crypto-js", - "main": "index.js", - "browser": { - "crypto": false - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/decorated-fs/exists.js b/fixtures/enhanced_resolve/test/fixtures/decorated-fs/exists.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/dirOrFile.js b/fixtures/enhanced_resolve/test/fixtures/dirOrFile.js deleted file mode 100644 index c3cb885f..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/dirOrFile.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "file"; diff --git a/fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js b/fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js deleted file mode 100644 index 85e01cd4..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "dir"; diff --git a/fixtures/enhanced_resolve/test/fixtures/directory-default/directory-default.js b/fixtures/enhanced_resolve/test/fixtures/directory-default/directory-default.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js deleted file mode 100644 index d1007aae..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js +++ /dev/null @@ -1 +0,0 @@ -export default "string"; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts deleted file mode 100644 index cb0ff5c3..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json deleted file mode 100644 index b523a1e9..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "@org/pkg", - "exports": { - "./*.js": { - "types": "./dist/*.d.ts", - "default": "./dist/*.js" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js deleted file mode 100644 index d1007aae..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js +++ /dev/null @@ -1 +0,0 @@ -export default "string"; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts deleted file mode 100644 index cb0ff5c3..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json deleted file mode 100644 index 8e55fb46..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "@raviqqe/hidash", - "exports": { - "./*.js": { - "types": "./dist/*.d.ts", - "default": "./dist/*.js" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json deleted file mode 100644 index f0edf449..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "exports-field", - "version": "1.0.0", - "exports": { - ".": "./a/../b/../../pack1/index.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/pack1/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/pack1/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/a.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/a.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json deleted file mode 100644 index 6b105c08..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "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/": { - "webpack": ["./lib/lib2/", "./lib/"], - "node": "./lib/", - "default": "./lib/" - }, - "./dist/a.js": "./../../a.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json deleted file mode 100644 index 0012a3de..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "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" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/umd.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/umd.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field/package.json deleted file mode 100644 index 5fa72bb5..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "@exports-field/core", - "version": "1.0.0", - "exports": "./a.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json deleted file mode 100644 index e6f12074..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "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/lib2/", "./lib/"], - "node": "./lib/", - "default": "./lib/" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/index b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/index deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json deleted file mode 100644 index 1a838f49..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "name": "exports-field", - "exportsField": { - "exports": "./main.js" - }, - "ex": "./index", - "broken": { - ".": "./src" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/src/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/src/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.ts b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.mts b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.mts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mjs b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mjs deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mts.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mts.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.ts b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/app.module.js b/fixtures/enhanced_resolve/test/fixtures/extensions/app.module.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.js b/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/foo.js b/fixtures/enhanced_resolve/test/fixtures/extensions/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/foo.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/foo.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/index.js b/fixtures/enhanced_resolve/test/fixtures/extensions/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/index.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module.js b/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module/index.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/package.json b/fixtures/enhanced_resolve/test/fixtures/extensions/package.json deleted file mode 100644 index 5e55a1e8..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/extensions/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "./index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/file.load1 b/fixtures/enhanced_resolve/test/fixtures/file.load1 deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/file.load2 b/fixtures/enhanced_resolve/test/fixtures/file.load2 deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/foo/index.js b/fixtures/enhanced_resolve/test/fixtures/foo/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/foo/package.json b/fixtures/enhanced_resolve/test/fixtures/foo/package.json deleted file mode 100644 index da86787a..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/foo/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "foo", - "version": "1.0.0" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json deleted file mode 100644 index aa2be496..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "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" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/internal/file.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/internal/file.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/y/y.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/y/y.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/internal/i.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/internal/i.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/nested/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js deleted file mode 100644 index e5b70a86..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = { nested: "nested" } diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-3/nested/f/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-3/nested/f/nested/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-4/f/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-4/f/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f$/$.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f$/$.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f/$.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f/$.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/nested/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/a.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/a.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/b.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/dir/b.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/dir/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/index.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json deleted file mode 100644 index 8d8d3a46..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "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/lib2/", "./lib/"], - "node": "./lib/", - "default": "./lib/" - }, - "./dist/a.js": "./../../a.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/c/index.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/c/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/imports-field/package.json deleted file mode 100644 index 248351a9..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "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" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/a.js b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json deleted file mode 100644 index ded7faa2..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json +++ /dev/null @@ -1,2 +0,0 @@ -{ - "main": "./a.js", diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/a.js b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/package.json b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/package.json deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/issue-238/package.json b/fixtures/enhanced_resolve/test/fixtures/issue-238/package.json deleted file mode 100644 index 352055cd..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/issue-238/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "private": true -} diff --git a/fixtures/enhanced_resolve/test/fixtures/issue-238/src/a/config.js b/fixtures/enhanced_resolve/test/fixtures/issue-238/src/a/config.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/issue-238/src/common/config/myObjectFile.js b/fixtures/enhanced_resolve/test/fixtures/issue-238/src/common/config/myObjectFile.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/lib.js b/fixtures/enhanced_resolve/test/fixtures/lib.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/lib/complex1.js b/fixtures/enhanced_resolve/test/fixtures/lib/complex1.js deleted file mode 100644 index b3de3d70..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/lib/complex1.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "lib complex1"; diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self/index.js b/fixtures/enhanced_resolve/test/fixtures/main-field-self/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json b/fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json deleted file mode 100644 index a2b6f341..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "./" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self2/index.js b/fixtures/enhanced_resolve/test/fixtures/main-field-self2/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json b/fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json deleted file mode 100644 index 4fa6f730..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "." -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main1.js b/fixtures/enhanced_resolve/test/fixtures/main1.js deleted file mode 100644 index 168f2a1e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main1.js +++ /dev/null @@ -1,9 +0,0 @@ -var a = require("./a"); -if (x) { - for (var i = 0; i < 100; i++) { - while (true) require("./b"); - do { - i++; - } while (require("m1/a")()); - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main2.js b/fixtures/enhanced_resolve/test/fixtures/main2.js deleted file mode 100644 index 39f062b1..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main2.js +++ /dev/null @@ -1,12 +0,0 @@ -var 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"); - }); - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main3.js b/fixtures/enhanced_resolve/test/fixtures/main3.js deleted file mode 100644 index 1c180166..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main3.js +++ /dev/null @@ -1,4 +0,0 @@ -var a = require("./a"); -require.ensure([], function(require) { - require("./c.js"); -}); diff --git a/fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js b/fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js deleted file mode 100644 index 997c1051..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is nested m1/a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/no#fragment/#/#.js b/fixtures/enhanced_resolve/test/fixtures/no#fragment/#/#.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/no.js b/fixtures/enhanced_resolve/test/fixtures/no.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/browser.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/browser.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/main.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json deleted file mode 100644 index c469e1fd..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "main": "./main.js", - "browser": "./browser.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js deleted file mode 100644 index 549620a5..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "the correct a.js"; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js deleted file mode 100644 index 5db6632e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = " :) " + require("m2/b.js"); diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js deleted file mode 100644 index d308569d..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require("m1/a") + require("m1"); diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js deleted file mode 100644 index cb8127e8..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "Step2"; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json deleted file mode 100644 index 8d6dfa56..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "dash-name", - "exports": "./index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json deleted file mode 100644 index 4fd8706e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "dash", - "exports": "./index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/invalidPackageJson/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/invalidPackageJson/package.json deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js deleted file mode 100644 index 46fc8e6c..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is m1/a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js deleted file mode 100644 index 8565c244..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is m1/b"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js deleted file mode 100644 index 34faaaf5..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "This is m2/b"; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/file.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/file.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js b/fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js deleted file mode 100644 index 997c1051..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is nested m1/a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/dir/index.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/dir/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/index.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/main.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/browser.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/browser.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/index.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json deleted file mode 100644 index e20ceaeb..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "main": "main.js", - "browser": { - "./package-alias/index.js": "./package-alias/browser.js", - "module": "pkg/dir/index" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/typescript/index.ts b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/typescript/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json deleted file mode 100644 index 4a1f838e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "@exports-field/core", - "version": "1.0.0", - "exports": { - ".": "./a.js", - "./x": "./a.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/prefer-pnp/alternative-modules/m1/b.js b/fixtures/enhanced_resolve/test/fixtures/prefer-pnp/alternative-modules/m1/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.css b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.css deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.js b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json deleted file mode 100644 index 14ab704d..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/index.css b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/index.css deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/module.js b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/module.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json deleted file mode 100644 index ee0eb71b..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "main": "../../../c.js", - "module": "module.js", - "style": "index.css" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/roots_fall_through/index.js b/fixtures/enhanced_resolve/test/fixtures/roots_fall_through/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/main.js b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json deleted file mode 100644 index 70a0f20f..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "browser": { - "./index.js": "./main.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/lib/index.js b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/lib/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/main.js b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json deleted file mode 100644 index 2af9e0d1..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "./main.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/shortcutdir.js/a.js b/fixtures/enhanced_resolve/test/fixtures/shortcutdir.js/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/b b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/b deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/c b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/c deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/a b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/a deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/b b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/b deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/b/foo/a b/fixtures/enhanced_resolve/test/fixtures/yield/b/foo/a deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/a b/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/a deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json b/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json deleted file mode 100644 index 0acc4b4c..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "foo", - "version": "1.0.0", - "browser": { - "./a": false - } -} diff --git "a/fixtures/enhanced_resolve/test/fixtures/\346\265\213\350\257\225.js" "b/fixtures/enhanced_resolve/test/fixtures/\346\265\213\350\257\225.js" deleted file mode 100644 index e69de29b..00000000 diff --git "a/fixtures/misc/\344\270\255\346\226\207/\344\270\255\346\226\207.js" "b/fixtures/misc/\344\270\255\346\226\207/\344\270\255\346\226\207.js" deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/pnp/.gitignore b/fixtures/pnp/.gitignore deleted file mode 100644 index 1783c71a..00000000 --- a/fixtures/pnp/.gitignore +++ /dev/null @@ -1 +0,0 @@ -install_state.gz \ No newline at end of file diff --git a/fixtures/pnp/.pnp.cjs b/fixtures/pnp/.pnp.cjs deleted file mode 100755 index 2a8d1771..00000000 --- a/fixtures/pnp/.pnp.cjs +++ /dev/null @@ -1,7543 +0,0 @@ -#!/usr/bin/env node -/* eslint-disable */ -// @ts-nocheck -"use strict"; - -const RAW_RUNTIME_STATE = -'{\ - "__info": [\ - "This file is automatically generated. Do not touch it, or risk",\ - "your modifications being lost."\ - ],\ - "dependencyTreeRoots": [\ - {\ - "name": "pnp",\ - "reference": "workspace:."\ - }\ - ],\ - "enableTopLevelFallback": true,\ - "ignorePatternData": "(^(?:\\\\.yarn\\\\/sdks(?:\\\\/(?!\\\\.{1,2}(?:\\\\/|$))(?:(?:(?!(?:^|\\\\/)\\\\.{1,2}(?:\\\\/|$)).)*?)|$))$)",\ - "fallbackExclusionList": [\ - ["pnp", ["workspace:."]]\ - ],\ - "fallbackPool": [\ - ],\ - "packageRegistryData": [\ - [null, [\ - [null, {\ - "packageLocation": "./",\ - "packageDependencies": [\ - ["is-even", "npm:1.0.0"],\ - ["is-odd", "npm:3.0.1"]\ - ],\ - "linkType": "SOFT"\ - }]\ - ]],\ - ["is-buffer", [\ - ["npm:1.1.6", {\ - "packageLocation": "./.yarn/cache/is-buffer-npm-1.1.6-08199d9ccc-ae18aa0b6e.zip/node_modules/is-buffer/",\ - "packageDependencies": [\ - ["is-buffer", "npm:1.1.6"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["is-even", [\ - ["npm:1.0.0", {\ - "packageLocation": "./.yarn/cache/is-even-npm-1.0.0-9f726520dc-2728cc2f39.zip/node_modules/is-even/",\ - "packageDependencies": [\ - ["is-even", "npm:1.0.0"],\ - ["is-odd", "npm:0.1.2"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["is-number", [\ - ["npm:3.0.0", {\ - "packageLocation": "./.yarn/cache/is-number-npm-3.0.0-9088035ade-e639c54640.zip/node_modules/is-number/",\ - "packageDependencies": [\ - ["is-number", "npm:3.0.0"],\ - ["kind-of", "npm:3.2.2"]\ - ],\ - "linkType": "HARD"\ - }],\ - ["npm:6.0.0", {\ - "packageLocation": "./.yarn/cache/is-number-npm-6.0.0-30881e83e6-5da4c68401.zip/node_modules/is-number/",\ - "packageDependencies": [\ - ["is-number", "npm:6.0.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["is-odd", [\ - ["npm:0.1.2", {\ - "packageLocation": "./.yarn/cache/is-odd-npm-0.1.2-9d980a9da8-7dc6c6fd00.zip/node_modules/is-odd/",\ - "packageDependencies": [\ - ["is-odd", "npm:0.1.2"],\ - ["is-number", "npm:3.0.0"]\ - ],\ - "linkType": "HARD"\ - }],\ - ["npm:3.0.1", {\ - "packageLocation": "./.yarn/cache/is-odd-npm-3.0.1-93c3c3f41b-89ee2e353c.zip/node_modules/is-odd/",\ - "packageDependencies": [\ - ["is-odd", "npm:3.0.1"],\ - ["is-number", "npm:6.0.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["kind-of", [\ - ["npm:3.2.2", {\ - "packageLocation": "./.yarn/cache/kind-of-npm-3.2.2-7deaffa5f9-7e34bc29d4.zip/node_modules/kind-of/",\ - "packageDependencies": [\ - ["kind-of", "npm:3.2.2"],\ - ["is-buffer", "npm:1.1.6"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["pnp", [\ - ["workspace:.", {\ - "packageLocation": "./",\ - "packageDependencies": [\ - ["pnp", "workspace:."],\ - ["is-even", "npm:1.0.0"],\ - ["is-odd", "npm:3.0.1"]\ - ],\ - "linkType": "SOFT"\ - }]\ - ]]\ - ]\ -}'; - -function $$SETUP_STATE(hydrateRuntimeState, basePath) { - return hydrateRuntimeState(JSON.parse(RAW_RUNTIME_STATE), {basePath: basePath || __dirname}); -} - -const fs = require('fs'); -const path = require('path'); -const crypto = require('crypto'); -const os = require('os'); -const events = require('events'); -const nodeUtils = require('util'); -const stream = require('stream'); -const zlib = require('zlib'); -const require$$0 = require('module'); -const StringDecoder = require('string_decoder'); -const url = require('url'); -const buffer = require('buffer'); -const readline = require('readline'); -const assert = require('assert'); - -const _interopDefaultLegacy = e => e && typeof e === 'object' && 'default' in e ? e : { default: e }; - -function _interopNamespace(e) { - if (e && e.__esModule) return e; - const n = Object.create(null); - if (e) { - for (const k in e) { - if (k !== 'default') { - const d = Object.getOwnPropertyDescriptor(e, k); - Object.defineProperty(n, k, d.get ? d : { - enumerable: true, - get: () => e[k] - }); - } - } - } - n.default = e; - return Object.freeze(n); -} - -const fs__default = /*#__PURE__*/_interopDefaultLegacy(fs); -const path__default = /*#__PURE__*/_interopDefaultLegacy(path); -const nodeUtils__namespace = /*#__PURE__*/_interopNamespace(nodeUtils); -const zlib__default = /*#__PURE__*/_interopDefaultLegacy(zlib); -const require$$0__default = /*#__PURE__*/_interopDefaultLegacy(require$$0); -const StringDecoder__default = /*#__PURE__*/_interopDefaultLegacy(StringDecoder); -const buffer__default = /*#__PURE__*/_interopDefaultLegacy(buffer); -const assert__default = /*#__PURE__*/_interopDefaultLegacy(assert); - -const S_IFMT = 61440; -const S_IFDIR = 16384; -const S_IFREG = 32768; -const S_IFLNK = 40960; -const SAFE_TIME = 456789e3; - -function makeError$1(code, message) { - return Object.assign(new Error(`${code}: ${message}`), { code }); -} -function EBUSY(message) { - return makeError$1(`EBUSY`, message); -} -function ENOSYS(message, reason) { - return makeError$1(`ENOSYS`, `${message}, ${reason}`); -} -function EINVAL(reason) { - return makeError$1(`EINVAL`, `invalid argument, ${reason}`); -} -function EBADF(reason) { - return makeError$1(`EBADF`, `bad file descriptor, ${reason}`); -} -function ENOENT(reason) { - return makeError$1(`ENOENT`, `no such file or directory, ${reason}`); -} -function ENOTDIR(reason) { - return makeError$1(`ENOTDIR`, `not a directory, ${reason}`); -} -function EISDIR(reason) { - return makeError$1(`EISDIR`, `illegal operation on a directory, ${reason}`); -} -function EEXIST(reason) { - return makeError$1(`EEXIST`, `file already exists, ${reason}`); -} -function EROFS(reason) { - return makeError$1(`EROFS`, `read-only filesystem, ${reason}`); -} -function ENOTEMPTY(reason) { - return makeError$1(`ENOTEMPTY`, `directory not empty, ${reason}`); -} -function EOPNOTSUPP(reason) { - return makeError$1(`EOPNOTSUPP`, `operation not supported, ${reason}`); -} -function ERR_DIR_CLOSED() { - return makeError$1(`ERR_DIR_CLOSED`, `Directory handle was closed`); -} - -const DEFAULT_MODE = S_IFREG | 420; -class StatEntry { - constructor() { - this.uid = 0; - this.gid = 0; - this.size = 0; - this.blksize = 0; - this.atimeMs = 0; - this.mtimeMs = 0; - this.ctimeMs = 0; - this.birthtimeMs = 0; - this.atime = new Date(0); - this.mtime = new Date(0); - this.ctime = new Date(0); - this.birthtime = new Date(0); - this.dev = 0; - this.ino = 0; - this.mode = DEFAULT_MODE; - this.nlink = 1; - this.rdev = 0; - this.blocks = 1; - } - isBlockDevice() { - return false; - } - isCharacterDevice() { - return false; - } - isDirectory() { - return (this.mode & S_IFMT) === S_IFDIR; - } - isFIFO() { - return false; - } - isFile() { - return (this.mode & S_IFMT) === S_IFREG; - } - isSocket() { - return false; - } - isSymbolicLink() { - return (this.mode & S_IFMT) === S_IFLNK; - } -} -class BigIntStatsEntry { - constructor() { - this.uid = BigInt(0); - this.gid = BigInt(0); - this.size = BigInt(0); - this.blksize = BigInt(0); - this.atimeMs = BigInt(0); - this.mtimeMs = BigInt(0); - this.ctimeMs = BigInt(0); - this.birthtimeMs = BigInt(0); - this.atimeNs = BigInt(0); - this.mtimeNs = BigInt(0); - this.ctimeNs = BigInt(0); - this.birthtimeNs = BigInt(0); - this.atime = new Date(0); - this.mtime = new Date(0); - this.ctime = new Date(0); - this.birthtime = new Date(0); - this.dev = BigInt(0); - this.ino = BigInt(0); - this.mode = BigInt(DEFAULT_MODE); - this.nlink = BigInt(1); - this.rdev = BigInt(0); - this.blocks = BigInt(1); - } - isBlockDevice() { - return false; - } - isCharacterDevice() { - return false; - } - isDirectory() { - return (this.mode & BigInt(S_IFMT)) === BigInt(S_IFDIR); - } - isFIFO() { - return false; - } - isFile() { - return (this.mode & BigInt(S_IFMT)) === BigInt(S_IFREG); - } - isSocket() { - return false; - } - isSymbolicLink() { - return (this.mode & BigInt(S_IFMT)) === BigInt(S_IFLNK); - } -} -function makeDefaultStats() { - return new StatEntry(); -} -function clearStats(stats) { - for (const key in stats) { - if (Object.hasOwn(stats, key)) { - const element = stats[key]; - if (typeof element === `number`) { - stats[key] = 0; - } else if (typeof element === `bigint`) { - stats[key] = BigInt(0); - } else if (nodeUtils__namespace.types.isDate(element)) { - stats[key] = new Date(0); - } - } - } - return stats; -} -function convertToBigIntStats(stats) { - const bigintStats = new BigIntStatsEntry(); - for (const key in stats) { - if (Object.hasOwn(stats, key)) { - const element = stats[key]; - if (typeof element === `number`) { - bigintStats[key] = BigInt(element); - } else if (nodeUtils__namespace.types.isDate(element)) { - bigintStats[key] = new Date(element); - } - } - } - bigintStats.atimeNs = bigintStats.atimeMs * BigInt(1e6); - bigintStats.mtimeNs = bigintStats.mtimeMs * BigInt(1e6); - bigintStats.ctimeNs = bigintStats.ctimeMs * BigInt(1e6); - bigintStats.birthtimeNs = bigintStats.birthtimeMs * BigInt(1e6); - return bigintStats; -} -function areStatsEqual(a, b) { - if (a.atimeMs !== b.atimeMs) - return false; - if (a.birthtimeMs !== b.birthtimeMs) - return false; - if (a.blksize !== b.blksize) - return false; - if (a.blocks !== b.blocks) - return false; - if (a.ctimeMs !== b.ctimeMs) - return false; - if (a.dev !== b.dev) - return false; - if (a.gid !== b.gid) - return false; - if (a.ino !== b.ino) - return false; - if (a.isBlockDevice() !== b.isBlockDevice()) - return false; - if (a.isCharacterDevice() !== b.isCharacterDevice()) - return false; - if (a.isDirectory() !== b.isDirectory()) - return false; - if (a.isFIFO() !== b.isFIFO()) - return false; - if (a.isFile() !== b.isFile()) - return false; - if (a.isSocket() !== b.isSocket()) - return false; - if (a.isSymbolicLink() !== b.isSymbolicLink()) - return false; - if (a.mode !== b.mode) - return false; - if (a.mtimeMs !== b.mtimeMs) - return false; - if (a.nlink !== b.nlink) - return false; - if (a.rdev !== b.rdev) - return false; - if (a.size !== b.size) - return false; - if (a.uid !== b.uid) - return false; - const aN = a; - const bN = b; - if (aN.atimeNs !== bN.atimeNs) - return false; - if (aN.mtimeNs !== bN.mtimeNs) - return false; - if (aN.ctimeNs !== bN.ctimeNs) - return false; - if (aN.birthtimeNs !== bN.birthtimeNs) - return false; - return true; -} - -const PortablePath = { - root: `/`, - dot: `.`, - parent: `..` -}; -const Filename = { - home: `~`, - nodeModules: `node_modules`, - manifest: `package.json`, - lockfile: `yarn.lock`, - virtual: `__virtual__`, - pnpJs: `.pnp.js`, - pnpCjs: `.pnp.cjs`, - pnpData: `.pnp.data.json`, - pnpEsmLoader: `.pnp.loader.mjs`, - rc: `.yarnrc.yml`, - env: `.env` -}; -const npath = Object.create(path__default.default); -const ppath = Object.create(path__default.default.posix); -npath.cwd = () => process.cwd(); -ppath.cwd = process.platform === `win32` ? () => toPortablePath(process.cwd()) : process.cwd; -if (process.platform === `win32`) { - ppath.resolve = (...segments) => { - if (segments.length > 0 && ppath.isAbsolute(segments[0])) { - return path__default.default.posix.resolve(...segments); - } else { - return path__default.default.posix.resolve(ppath.cwd(), ...segments); - } - }; -} -const contains = function(pathUtils, from, to) { - from = pathUtils.normalize(from); - to = pathUtils.normalize(to); - if (from === to) - return `.`; - if (!from.endsWith(pathUtils.sep)) - from = from + pathUtils.sep; - if (to.startsWith(from)) { - return to.slice(from.length); - } else { - return null; - } -}; -npath.contains = (from, to) => contains(npath, from, to); -ppath.contains = (from, to) => contains(ppath, from, to); -const WINDOWS_PATH_REGEXP = /^([a-zA-Z]:.*)$/; -const UNC_WINDOWS_PATH_REGEXP = /^\/\/(\.\/)?(.*)$/; -const PORTABLE_PATH_REGEXP = /^\/([a-zA-Z]:.*)$/; -const UNC_PORTABLE_PATH_REGEXP = /^\/unc\/(\.dot\/)?(.*)$/; -function fromPortablePathWin32(p) { - let portablePathMatch, uncPortablePathMatch; - if (portablePathMatch = p.match(PORTABLE_PATH_REGEXP)) - p = portablePathMatch[1]; - else if (uncPortablePathMatch = p.match(UNC_PORTABLE_PATH_REGEXP)) - p = `\\\\${uncPortablePathMatch[1] ? `.\\` : ``}${uncPortablePathMatch[2]}`; - else - return p; - return p.replace(/\//g, `\\`); -} -function toPortablePathWin32(p) { - p = p.replace(/\\/g, `/`); - let windowsPathMatch, uncWindowsPathMatch; - if (windowsPathMatch = p.match(WINDOWS_PATH_REGEXP)) - p = `/${windowsPathMatch[1]}`; - else if (uncWindowsPathMatch = p.match(UNC_WINDOWS_PATH_REGEXP)) - p = `/unc/${uncWindowsPathMatch[1] ? `.dot/` : ``}${uncWindowsPathMatch[2]}`; - return p; -} -const toPortablePath = process.platform === `win32` ? toPortablePathWin32 : (p) => p; -const fromPortablePath = process.platform === `win32` ? fromPortablePathWin32 : (p) => p; -npath.fromPortablePath = fromPortablePath; -npath.toPortablePath = toPortablePath; -function convertPath(targetPathUtils, sourcePath) { - return targetPathUtils === npath ? fromPortablePath(sourcePath) : toPortablePath(sourcePath); -} - -const defaultTime = new Date(SAFE_TIME * 1e3); -const defaultTimeMs = defaultTime.getTime(); -async function copyPromise(destinationFs, destination, sourceFs, source, opts) { - const normalizedDestination = destinationFs.pathUtils.normalize(destination); - const normalizedSource = sourceFs.pathUtils.normalize(source); - const prelayout = []; - const postlayout = []; - const { atime, mtime } = opts.stableTime ? { atime: defaultTime, mtime: defaultTime } : await sourceFs.lstatPromise(normalizedSource); - await destinationFs.mkdirpPromise(destinationFs.pathUtils.dirname(destination), { utimes: [atime, mtime] }); - await copyImpl(prelayout, postlayout, destinationFs, normalizedDestination, sourceFs, normalizedSource, { ...opts, didParentExist: true }); - for (const operation of prelayout) - await operation(); - await Promise.all(postlayout.map((operation) => { - return operation(); - })); -} -async function copyImpl(prelayout, postlayout, destinationFs, destination, sourceFs, source, opts) { - const destinationStat = opts.didParentExist ? await maybeLStat(destinationFs, destination) : null; - const sourceStat = await sourceFs.lstatPromise(source); - const { atime, mtime } = opts.stableTime ? { atime: defaultTime, mtime: defaultTime } : sourceStat; - let updated; - switch (true) { - case sourceStat.isDirectory(): - { - updated = await copyFolder(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts); - } - break; - case sourceStat.isFile(): - { - updated = await copyFile(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts); - } - break; - case sourceStat.isSymbolicLink(): - { - updated = await copySymlink(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts); - } - break; - default: { - throw new Error(`Unsupported file type (${sourceStat.mode})`); - } - } - if (opts.linkStrategy?.type !== `HardlinkFromIndex` || !sourceStat.isFile()) { - if (updated || destinationStat?.mtime?.getTime() !== mtime.getTime() || destinationStat?.atime?.getTime() !== atime.getTime()) { - postlayout.push(() => destinationFs.lutimesPromise(destination, atime, mtime)); - updated = true; - } - if (destinationStat === null || (destinationStat.mode & 511) !== (sourceStat.mode & 511)) { - postlayout.push(() => destinationFs.chmodPromise(destination, sourceStat.mode & 511)); - updated = true; - } - } - return updated; -} -async function maybeLStat(baseFs, p) { - try { - return await baseFs.lstatPromise(p); - } catch (e) { - return null; - } -} -async function copyFolder(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts) { - if (destinationStat !== null && !destinationStat.isDirectory()) { - if (opts.overwrite) { - prelayout.push(async () => destinationFs.removePromise(destination)); - destinationStat = null; - } else { - return false; - } - } - let updated = false; - if (destinationStat === null) { - prelayout.push(async () => { - try { - await destinationFs.mkdirPromise(destination, { mode: sourceStat.mode }); - } catch (err) { - if (err.code !== `EEXIST`) { - throw err; - } - } - }); - updated = true; - } - const entries = await sourceFs.readdirPromise(source); - const nextOpts = opts.didParentExist && !destinationStat ? { ...opts, didParentExist: false } : opts; - if (opts.stableSort) { - for (const entry of entries.sort()) { - if (await copyImpl(prelayout, postlayout, destinationFs, destinationFs.pathUtils.join(destination, entry), sourceFs, sourceFs.pathUtils.join(source, entry), nextOpts)) { - updated = true; - } - } - } else { - const entriesUpdateStatus = await Promise.all(entries.map(async (entry) => { - await copyImpl(prelayout, postlayout, destinationFs, destinationFs.pathUtils.join(destination, entry), sourceFs, sourceFs.pathUtils.join(source, entry), nextOpts); - })); - if (entriesUpdateStatus.some((status) => status)) { - updated = true; - } - } - return updated; -} -async function copyFileViaIndex(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts, linkStrategy) { - const sourceHash = await sourceFs.checksumFilePromise(source, { algorithm: `sha1` }); - const defaultMode = 420; - const sourceMode = sourceStat.mode & 511; - const indexFileName = `${sourceHash}${sourceMode !== defaultMode ? sourceMode.toString(8) : ``}`; - const indexPath = destinationFs.pathUtils.join(linkStrategy.indexPath, sourceHash.slice(0, 2), `${indexFileName}.dat`); - let AtomicBehavior; - ((AtomicBehavior2) => { - AtomicBehavior2[AtomicBehavior2["Lock"] = 0] = "Lock"; - AtomicBehavior2[AtomicBehavior2["Rename"] = 1] = "Rename"; - })(AtomicBehavior || (AtomicBehavior = {})); - let atomicBehavior = 1 /* Rename */; - let indexStat = await maybeLStat(destinationFs, indexPath); - if (destinationStat) { - const isDestinationHardlinkedFromIndex = indexStat && destinationStat.dev === indexStat.dev && destinationStat.ino === indexStat.ino; - const isIndexModified = indexStat?.mtimeMs !== defaultTimeMs; - if (isDestinationHardlinkedFromIndex) { - if (isIndexModified && linkStrategy.autoRepair) { - atomicBehavior = 0 /* Lock */; - indexStat = null; - } - } - if (!isDestinationHardlinkedFromIndex) { - if (opts.overwrite) { - prelayout.push(async () => destinationFs.removePromise(destination)); - destinationStat = null; - } else { - return false; - } - } - } - const tempPath = !indexStat && atomicBehavior === 1 /* Rename */ ? `${indexPath}.${Math.floor(Math.random() * 4294967296).toString(16).padStart(8, `0`)}` : null; - let tempPathCleaned = false; - prelayout.push(async () => { - if (!indexStat) { - if (atomicBehavior === 0 /* Lock */) { - await destinationFs.lockPromise(indexPath, async () => { - const content = await sourceFs.readFilePromise(source); - await destinationFs.writeFilePromise(indexPath, content); - }); - } - if (atomicBehavior === 1 /* Rename */ && tempPath) { - const content = await sourceFs.readFilePromise(source); - await destinationFs.writeFilePromise(tempPath, content); - try { - await destinationFs.linkPromise(tempPath, indexPath); - } catch (err) { - if (err.code === `EEXIST`) { - tempPathCleaned = true; - await destinationFs.unlinkPromise(tempPath); - } else { - throw err; - } - } - } - } - if (!destinationStat) { - await destinationFs.linkPromise(indexPath, destination); - } - }); - postlayout.push(async () => { - if (!indexStat) { - await destinationFs.lutimesPromise(indexPath, defaultTime, defaultTime); - if (sourceMode !== defaultMode) { - await destinationFs.chmodPromise(indexPath, sourceMode); - } - } - if (tempPath && !tempPathCleaned) { - await destinationFs.unlinkPromise(tempPath); - } - }); - return false; -} -async function copyFileDirect(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts) { - if (destinationStat !== null) { - if (opts.overwrite) { - prelayout.push(async () => destinationFs.removePromise(destination)); - destinationStat = null; - } else { - return false; - } - } - prelayout.push(async () => { - const content = await sourceFs.readFilePromise(source); - await destinationFs.writeFilePromise(destination, content); - }); - return true; -} -async function copyFile(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts) { - if (opts.linkStrategy?.type === `HardlinkFromIndex`) { - return copyFileViaIndex(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts, opts.linkStrategy); - } else { - return copyFileDirect(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts); - } -} -async function copySymlink(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts) { - if (destinationStat !== null) { - if (opts.overwrite) { - prelayout.push(async () => destinationFs.removePromise(destination)); - destinationStat = null; - } else { - return false; - } - } - prelayout.push(async () => { - await destinationFs.symlinkPromise(convertPath(destinationFs.pathUtils, await sourceFs.readlinkPromise(source)), destination); - }); - return true; -} - -class CustomDir { - constructor(path, nextDirent, opts = {}) { - this.path = path; - this.nextDirent = nextDirent; - this.opts = opts; - this.closed = false; - } - throwIfClosed() { - if (this.closed) { - throw ERR_DIR_CLOSED(); - } - } - async *[Symbol.asyncIterator]() { - try { - let dirent; - while ((dirent = await this.read()) !== null) { - yield dirent; - } - } finally { - await this.close(); - } - } - read(cb) { - const dirent = this.readSync(); - if (typeof cb !== `undefined`) - return cb(null, dirent); - return Promise.resolve(dirent); - } - readSync() { - this.throwIfClosed(); - return this.nextDirent(); - } - close(cb) { - this.closeSync(); - if (typeof cb !== `undefined`) - return cb(null); - return Promise.resolve(); - } - closeSync() { - this.throwIfClosed(); - this.opts.onClose?.(); - this.closed = true; - } -} -function opendir(fakeFs, path, entries, opts) { - const nextDirent = () => { - const filename = entries.shift(); - if (typeof filename === `undefined`) - return null; - const entryPath = fakeFs.pathUtils.join(path, filename); - return Object.assign(fakeFs.statSync(entryPath), { - name: filename, - path: void 0 - }); - }; - return new CustomDir(path, nextDirent, opts); -} - -function assertStatus(current, expected) { - if (current !== expected) { - throw new Error(`Invalid StatWatcher status: expected '${expected}', got '${current}'`); - } -} -class CustomStatWatcher extends events.EventEmitter { - constructor(fakeFs, path, { bigint = false } = {}) { - super(); - this.status = "ready" /* Ready */; - this.changeListeners = /* @__PURE__ */ new Map(); - this.startTimeout = null; - this.fakeFs = fakeFs; - this.path = path; - this.bigint = bigint; - this.lastStats = this.stat(); - } - static create(fakeFs, path, opts) { - const statWatcher = new CustomStatWatcher(fakeFs, path, opts); - statWatcher.start(); - return statWatcher; - } - start() { - assertStatus(this.status, "ready" /* Ready */); - this.status = "running" /* Running */; - this.startTimeout = setTimeout(() => { - this.startTimeout = null; - if (!this.fakeFs.existsSync(this.path)) { - this.emit("change" /* Change */, this.lastStats, this.lastStats); - } - }, 3); - } - stop() { - assertStatus(this.status, "running" /* Running */); - this.status = "stopped" /* Stopped */; - if (this.startTimeout !== null) { - clearTimeout(this.startTimeout); - this.startTimeout = null; - } - this.emit("stop" /* Stop */); - } - stat() { - try { - return this.fakeFs.statSync(this.path, { bigint: this.bigint }); - } catch (error) { - const statInstance = this.bigint ? new BigIntStatsEntry() : new StatEntry(); - return clearStats(statInstance); - } - } - makeInterval(opts) { - const interval = setInterval(() => { - const currentStats = this.stat(); - const previousStats = this.lastStats; - if (areStatsEqual(currentStats, previousStats)) - return; - this.lastStats = currentStats; - this.emit("change" /* Change */, currentStats, previousStats); - }, opts.interval); - return opts.persistent ? interval : interval.unref(); - } - registerChangeListener(listener, opts) { - this.addListener("change" /* Change */, listener); - this.changeListeners.set(listener, this.makeInterval(opts)); - } - unregisterChangeListener(listener) { - this.removeListener("change" /* Change */, listener); - const interval = this.changeListeners.get(listener); - if (typeof interval !== `undefined`) - clearInterval(interval); - this.changeListeners.delete(listener); - } - unregisterAllChangeListeners() { - for (const listener of this.changeListeners.keys()) { - this.unregisterChangeListener(listener); - } - } - hasChangeListeners() { - return this.changeListeners.size > 0; - } - ref() { - for (const interval of this.changeListeners.values()) - interval.ref(); - return this; - } - unref() { - for (const interval of this.changeListeners.values()) - interval.unref(); - return this; - } -} - -const statWatchersByFakeFS = /* @__PURE__ */ new WeakMap(); -function watchFile(fakeFs, path, a, b) { - let bigint; - let persistent; - let interval; - let listener; - switch (typeof a) { - case `function`: - { - bigint = false; - persistent = true; - interval = 5007; - listener = a; - } - break; - default: - { - ({ - bigint = false, - persistent = true, - interval = 5007 - } = a); - listener = b; - } - break; - } - let statWatchers = statWatchersByFakeFS.get(fakeFs); - if (typeof statWatchers === `undefined`) - statWatchersByFakeFS.set(fakeFs, statWatchers = /* @__PURE__ */ new Map()); - let statWatcher = statWatchers.get(path); - if (typeof statWatcher === `undefined`) { - statWatcher = CustomStatWatcher.create(fakeFs, path, { bigint }); - statWatchers.set(path, statWatcher); - } - statWatcher.registerChangeListener(listener, { persistent, interval }); - return statWatcher; -} -function unwatchFile(fakeFs, path, cb) { - const statWatchers = statWatchersByFakeFS.get(fakeFs); - if (typeof statWatchers === `undefined`) - return; - const statWatcher = statWatchers.get(path); - if (typeof statWatcher === `undefined`) - return; - if (typeof cb === `undefined`) - statWatcher.unregisterAllChangeListeners(); - else - statWatcher.unregisterChangeListener(cb); - if (!statWatcher.hasChangeListeners()) { - statWatcher.stop(); - statWatchers.delete(path); - } -} -function unwatchAllFiles(fakeFs) { - const statWatchers = statWatchersByFakeFS.get(fakeFs); - if (typeof statWatchers === `undefined`) - return; - for (const path of statWatchers.keys()) { - unwatchFile(fakeFs, path); - } -} - -class FakeFS { - constructor(pathUtils) { - this.pathUtils = pathUtils; - } - async *genTraversePromise(init, { stableSort = false } = {}) { - const stack = [init]; - while (stack.length > 0) { - const p = stack.shift(); - const entry = await this.lstatPromise(p); - if (entry.isDirectory()) { - const entries = await this.readdirPromise(p); - if (stableSort) { - for (const entry2 of entries.sort()) { - stack.push(this.pathUtils.join(p, entry2)); - } - } else { - throw new Error(`Not supported`); - } - } else { - yield p; - } - } - } - async checksumFilePromise(path, { algorithm = `sha512` } = {}) { - const fd = await this.openPromise(path, `r`); - try { - const CHUNK_SIZE = 65536; - const chunk = Buffer.allocUnsafeSlow(CHUNK_SIZE); - const hash = crypto.createHash(algorithm); - let bytesRead = 0; - while ((bytesRead = await this.readPromise(fd, chunk, 0, CHUNK_SIZE)) !== 0) - hash.update(bytesRead === CHUNK_SIZE ? chunk : chunk.slice(0, bytesRead)); - return hash.digest(`hex`); - } finally { - await this.closePromise(fd); - } - } - async removePromise(p, { recursive = true, maxRetries = 5 } = {}) { - let stat; - try { - stat = await this.lstatPromise(p); - } catch (error) { - if (error.code === `ENOENT`) { - return; - } else { - throw error; - } - } - if (stat.isDirectory()) { - if (recursive) { - const entries = await this.readdirPromise(p); - await Promise.all(entries.map((entry) => { - return this.removePromise(this.pathUtils.resolve(p, entry)); - })); - } - for (let t = 0; t <= maxRetries; t++) { - try { - await this.rmdirPromise(p); - break; - } catch (error) { - if (error.code !== `EBUSY` && error.code !== `ENOTEMPTY`) { - throw error; - } else if (t < maxRetries) { - await new Promise((resolve) => setTimeout(resolve, t * 100)); - } - } - } - } else { - await this.unlinkPromise(p); - } - } - removeSync(p, { recursive = true } = {}) { - let stat; - try { - stat = this.lstatSync(p); - } catch (error) { - if (error.code === `ENOENT`) { - return; - } else { - throw error; - } - } - if (stat.isDirectory()) { - if (recursive) - for (const entry of this.readdirSync(p)) - this.removeSync(this.pathUtils.resolve(p, entry)); - this.rmdirSync(p); - } else { - this.unlinkSync(p); - } - } - async mkdirpPromise(p, { chmod, utimes } = {}) { - p = this.resolve(p); - if (p === this.pathUtils.dirname(p)) - return void 0; - const parts = p.split(this.pathUtils.sep); - let createdDirectory; - for (let u = 2; u <= parts.length; ++u) { - const subPath = parts.slice(0, u).join(this.pathUtils.sep); - if (!this.existsSync(subPath)) { - try { - await this.mkdirPromise(subPath); - } catch (error) { - if (error.code === `EEXIST`) { - continue; - } else { - throw error; - } - } - createdDirectory ??= subPath; - if (chmod != null) - await this.chmodPromise(subPath, chmod); - if (utimes != null) { - await this.utimesPromise(subPath, utimes[0], utimes[1]); - } else { - const parentStat = await this.statPromise(this.pathUtils.dirname(subPath)); - await this.utimesPromise(subPath, parentStat.atime, parentStat.mtime); - } - } - } - return createdDirectory; - } - mkdirpSync(p, { chmod, utimes } = {}) { - p = this.resolve(p); - if (p === this.pathUtils.dirname(p)) - return void 0; - const parts = p.split(this.pathUtils.sep); - let createdDirectory; - for (let u = 2; u <= parts.length; ++u) { - const subPath = parts.slice(0, u).join(this.pathUtils.sep); - if (!this.existsSync(subPath)) { - try { - this.mkdirSync(subPath); - } catch (error) { - if (error.code === `EEXIST`) { - continue; - } else { - throw error; - } - } - createdDirectory ??= subPath; - if (chmod != null) - this.chmodSync(subPath, chmod); - if (utimes != null) { - this.utimesSync(subPath, utimes[0], utimes[1]); - } else { - const parentStat = this.statSync(this.pathUtils.dirname(subPath)); - this.utimesSync(subPath, parentStat.atime, parentStat.mtime); - } - } - } - return createdDirectory; - } - async copyPromise(destination, source, { baseFs = this, overwrite = true, stableSort = false, stableTime = false, linkStrategy = null } = {}) { - return await copyPromise(this, destination, baseFs, source, { overwrite, stableSort, stableTime, linkStrategy }); - } - copySync(destination, source, { baseFs = this, overwrite = true } = {}) { - const stat = baseFs.lstatSync(source); - const exists = this.existsSync(destination); - if (stat.isDirectory()) { - this.mkdirpSync(destination); - const directoryListing = baseFs.readdirSync(source); - for (const entry of directoryListing) { - this.copySync(this.pathUtils.join(destination, entry), baseFs.pathUtils.join(source, entry), { baseFs, overwrite }); - } - } else if (stat.isFile()) { - if (!exists || overwrite) { - if (exists) - this.removeSync(destination); - const content = baseFs.readFileSync(source); - this.writeFileSync(destination, content); - } - } else if (stat.isSymbolicLink()) { - if (!exists || overwrite) { - if (exists) - this.removeSync(destination); - const target = baseFs.readlinkSync(source); - this.symlinkSync(convertPath(this.pathUtils, target), destination); - } - } else { - throw new Error(`Unsupported file type (file: ${source}, mode: 0o${stat.mode.toString(8).padStart(6, `0`)})`); - } - const mode = stat.mode & 511; - this.chmodSync(destination, mode); - } - async changeFilePromise(p, content, opts = {}) { - if (Buffer.isBuffer(content)) { - return this.changeFileBufferPromise(p, content, opts); - } else { - return this.changeFileTextPromise(p, content, opts); - } - } - async changeFileBufferPromise(p, content, { mode } = {}) { - let current = Buffer.alloc(0); - try { - current = await this.readFilePromise(p); - } catch (error) { - } - if (Buffer.compare(current, content) === 0) - return; - await this.writeFilePromise(p, content, { mode }); - } - async changeFileTextPromise(p, content, { automaticNewlines, mode } = {}) { - let current = ``; - try { - current = await this.readFilePromise(p, `utf8`); - } catch (error) { - } - const normalizedContent = automaticNewlines ? normalizeLineEndings(current, content) : content; - if (current === normalizedContent) - return; - await this.writeFilePromise(p, normalizedContent, { mode }); - } - changeFileSync(p, content, opts = {}) { - if (Buffer.isBuffer(content)) { - return this.changeFileBufferSync(p, content, opts); - } else { - return this.changeFileTextSync(p, content, opts); - } - } - changeFileBufferSync(p, content, { mode } = {}) { - let current = Buffer.alloc(0); - try { - current = this.readFileSync(p); - } catch (error) { - } - if (Buffer.compare(current, content) === 0) - return; - this.writeFileSync(p, content, { mode }); - } - changeFileTextSync(p, content, { automaticNewlines = false, mode } = {}) { - let current = ``; - try { - current = this.readFileSync(p, `utf8`); - } catch (error) { - } - const normalizedContent = automaticNewlines ? normalizeLineEndings(current, content) : content; - if (current === normalizedContent) - return; - this.writeFileSync(p, normalizedContent, { mode }); - } - async movePromise(fromP, toP) { - try { - await this.renamePromise(fromP, toP); - } catch (error) { - if (error.code === `EXDEV`) { - await this.copyPromise(toP, fromP); - await this.removePromise(fromP); - } else { - throw error; - } - } - } - moveSync(fromP, toP) { - try { - this.renameSync(fromP, toP); - } catch (error) { - if (error.code === `EXDEV`) { - this.copySync(toP, fromP); - this.removeSync(fromP); - } else { - throw error; - } - } - } - async lockPromise(affectedPath, callback) { - const lockPath = `${affectedPath}.flock`; - const interval = 1e3 / 60; - const startTime = Date.now(); - let fd = null; - const isAlive = async () => { - let pid; - try { - [pid] = await this.readJsonPromise(lockPath); - } catch (error) { - return Date.now() - startTime < 500; - } - try { - process.kill(pid, 0); - return true; - } catch (error) { - return false; - } - }; - while (fd === null) { - try { - fd = await this.openPromise(lockPath, `wx`); - } catch (error) { - if (error.code === `EEXIST`) { - if (!await isAlive()) { - try { - await this.unlinkPromise(lockPath); - continue; - } catch (error2) { - } - } - if (Date.now() - startTime < 60 * 1e3) { - await new Promise((resolve) => setTimeout(resolve, interval)); - } else { - throw new Error(`Couldn't acquire a lock in a reasonable time (via ${lockPath})`); - } - } else { - throw error; - } - } - } - await this.writePromise(fd, JSON.stringify([process.pid])); - try { - return await callback(); - } finally { - try { - await this.closePromise(fd); - await this.unlinkPromise(lockPath); - } catch (error) { - } - } - } - async readJsonPromise(p) { - const content = await this.readFilePromise(p, `utf8`); - try { - return JSON.parse(content); - } catch (error) { - error.message += ` (in ${p})`; - throw error; - } - } - readJsonSync(p) { - const content = this.readFileSync(p, `utf8`); - try { - return JSON.parse(content); - } catch (error) { - error.message += ` (in ${p})`; - throw error; - } - } - async writeJsonPromise(p, data, { compact = false } = {}) { - const space = compact ? 0 : 2; - return await this.writeFilePromise(p, `${JSON.stringify(data, null, space)} -`); - } - writeJsonSync(p, data, { compact = false } = {}) { - const space = compact ? 0 : 2; - return this.writeFileSync(p, `${JSON.stringify(data, null, space)} -`); - } - async preserveTimePromise(p, cb) { - const stat = await this.lstatPromise(p); - const result = await cb(); - if (typeof result !== `undefined`) - p = result; - await this.lutimesPromise(p, stat.atime, stat.mtime); - } - async preserveTimeSync(p, cb) { - const stat = this.lstatSync(p); - const result = cb(); - if (typeof result !== `undefined`) - p = result; - this.lutimesSync(p, stat.atime, stat.mtime); - } -} -class BasePortableFakeFS extends FakeFS { - constructor() { - super(ppath); - } -} -function getEndOfLine(content) { - const matches = content.match(/\r?\n/g); - if (matches === null) - return os.EOL; - const crlf = matches.filter((nl) => nl === `\r -`).length; - const lf = matches.length - crlf; - return crlf > lf ? `\r -` : ` -`; -} -function normalizeLineEndings(originalContent, newContent) { - return newContent.replace(/\r?\n/g, getEndOfLine(originalContent)); -} - -class ProxiedFS extends FakeFS { - getExtractHint(hints) { - return this.baseFs.getExtractHint(hints); - } - resolve(path) { - return this.mapFromBase(this.baseFs.resolve(this.mapToBase(path))); - } - getRealPath() { - return this.mapFromBase(this.baseFs.getRealPath()); - } - async openPromise(p, flags, mode) { - return this.baseFs.openPromise(this.mapToBase(p), flags, mode); - } - openSync(p, flags, mode) { - return this.baseFs.openSync(this.mapToBase(p), flags, mode); - } - async opendirPromise(p, opts) { - return Object.assign(await this.baseFs.opendirPromise(this.mapToBase(p), opts), { path: p }); - } - opendirSync(p, opts) { - return Object.assign(this.baseFs.opendirSync(this.mapToBase(p), opts), { path: p }); - } - async readPromise(fd, buffer, offset, length, position) { - return await this.baseFs.readPromise(fd, buffer, offset, length, position); - } - readSync(fd, buffer, offset, length, position) { - return this.baseFs.readSync(fd, buffer, offset, length, position); - } - async writePromise(fd, buffer, offset, length, position) { - if (typeof buffer === `string`) { - return await this.baseFs.writePromise(fd, buffer, offset); - } else { - return await this.baseFs.writePromise(fd, buffer, offset, length, position); - } - } - writeSync(fd, buffer, offset, length, position) { - if (typeof buffer === `string`) { - return this.baseFs.writeSync(fd, buffer, offset); - } else { - return this.baseFs.writeSync(fd, buffer, offset, length, position); - } - } - async closePromise(fd) { - return this.baseFs.closePromise(fd); - } - closeSync(fd) { - this.baseFs.closeSync(fd); - } - createReadStream(p, opts) { - return this.baseFs.createReadStream(p !== null ? this.mapToBase(p) : p, opts); - } - createWriteStream(p, opts) { - return this.baseFs.createWriteStream(p !== null ? this.mapToBase(p) : p, opts); - } - async realpathPromise(p) { - return this.mapFromBase(await this.baseFs.realpathPromise(this.mapToBase(p))); - } - realpathSync(p) { - return this.mapFromBase(this.baseFs.realpathSync(this.mapToBase(p))); - } - async existsPromise(p) { - return this.baseFs.existsPromise(this.mapToBase(p)); - } - existsSync(p) { - return this.baseFs.existsSync(this.mapToBase(p)); - } - accessSync(p, mode) { - return this.baseFs.accessSync(this.mapToBase(p), mode); - } - async accessPromise(p, mode) { - return this.baseFs.accessPromise(this.mapToBase(p), mode); - } - async statPromise(p, opts) { - return this.baseFs.statPromise(this.mapToBase(p), opts); - } - statSync(p, opts) { - return this.baseFs.statSync(this.mapToBase(p), opts); - } - async fstatPromise(fd, opts) { - return this.baseFs.fstatPromise(fd, opts); - } - fstatSync(fd, opts) { - return this.baseFs.fstatSync(fd, opts); - } - lstatPromise(p, opts) { - return this.baseFs.lstatPromise(this.mapToBase(p), opts); - } - lstatSync(p, opts) { - return this.baseFs.lstatSync(this.mapToBase(p), opts); - } - async fchmodPromise(fd, mask) { - return this.baseFs.fchmodPromise(fd, mask); - } - fchmodSync(fd, mask) { - return this.baseFs.fchmodSync(fd, mask); - } - async chmodPromise(p, mask) { - return this.baseFs.chmodPromise(this.mapToBase(p), mask); - } - chmodSync(p, mask) { - return this.baseFs.chmodSync(this.mapToBase(p), mask); - } - async fchownPromise(fd, uid, gid) { - return this.baseFs.fchownPromise(fd, uid, gid); - } - fchownSync(fd, uid, gid) { - return this.baseFs.fchownSync(fd, uid, gid); - } - async chownPromise(p, uid, gid) { - return this.baseFs.chownPromise(this.mapToBase(p), uid, gid); - } - chownSync(p, uid, gid) { - return this.baseFs.chownSync(this.mapToBase(p), uid, gid); - } - async renamePromise(oldP, newP) { - return this.baseFs.renamePromise(this.mapToBase(oldP), this.mapToBase(newP)); - } - renameSync(oldP, newP) { - return this.baseFs.renameSync(this.mapToBase(oldP), this.mapToBase(newP)); - } - async copyFilePromise(sourceP, destP, flags = 0) { - return this.baseFs.copyFilePromise(this.mapToBase(sourceP), this.mapToBase(destP), flags); - } - copyFileSync(sourceP, destP, flags = 0) { - return this.baseFs.copyFileSync(this.mapToBase(sourceP), this.mapToBase(destP), flags); - } - async appendFilePromise(p, content, opts) { - return this.baseFs.appendFilePromise(this.fsMapToBase(p), content, opts); - } - appendFileSync(p, content, opts) { - return this.baseFs.appendFileSync(this.fsMapToBase(p), content, opts); - } - async writeFilePromise(p, content, opts) { - return this.baseFs.writeFilePromise(this.fsMapToBase(p), content, opts); - } - writeFileSync(p, content, opts) { - return this.baseFs.writeFileSync(this.fsMapToBase(p), content, opts); - } - async unlinkPromise(p) { - return this.baseFs.unlinkPromise(this.mapToBase(p)); - } - unlinkSync(p) { - return this.baseFs.unlinkSync(this.mapToBase(p)); - } - async utimesPromise(p, atime, mtime) { - return this.baseFs.utimesPromise(this.mapToBase(p), atime, mtime); - } - utimesSync(p, atime, mtime) { - return this.baseFs.utimesSync(this.mapToBase(p), atime, mtime); - } - async lutimesPromise(p, atime, mtime) { - return this.baseFs.lutimesPromise(this.mapToBase(p), atime, mtime); - } - lutimesSync(p, atime, mtime) { - return this.baseFs.lutimesSync(this.mapToBase(p), atime, mtime); - } - async mkdirPromise(p, opts) { - return this.baseFs.mkdirPromise(this.mapToBase(p), opts); - } - mkdirSync(p, opts) { - return this.baseFs.mkdirSync(this.mapToBase(p), opts); - } - async rmdirPromise(p, opts) { - return this.baseFs.rmdirPromise(this.mapToBase(p), opts); - } - rmdirSync(p, opts) { - return this.baseFs.rmdirSync(this.mapToBase(p), opts); - } - async rmPromise(p, opts) { - return this.baseFs.rmPromise(this.mapToBase(p), opts); - } - rmSync(p, opts) { - return this.baseFs.rmSync(this.mapToBase(p), opts); - } - async linkPromise(existingP, newP) { - return this.baseFs.linkPromise(this.mapToBase(existingP), this.mapToBase(newP)); - } - linkSync(existingP, newP) { - return this.baseFs.linkSync(this.mapToBase(existingP), this.mapToBase(newP)); - } - async symlinkPromise(target, p, type) { - const mappedP = this.mapToBase(p); - if (this.pathUtils.isAbsolute(target)) - return this.baseFs.symlinkPromise(this.mapToBase(target), mappedP, type); - const mappedAbsoluteTarget = this.mapToBase(this.pathUtils.join(this.pathUtils.dirname(p), target)); - const mappedTarget = this.baseFs.pathUtils.relative(this.baseFs.pathUtils.dirname(mappedP), mappedAbsoluteTarget); - return this.baseFs.symlinkPromise(mappedTarget, mappedP, type); - } - symlinkSync(target, p, type) { - const mappedP = this.mapToBase(p); - if (this.pathUtils.isAbsolute(target)) - return this.baseFs.symlinkSync(this.mapToBase(target), mappedP, type); - const mappedAbsoluteTarget = this.mapToBase(this.pathUtils.join(this.pathUtils.dirname(p), target)); - const mappedTarget = this.baseFs.pathUtils.relative(this.baseFs.pathUtils.dirname(mappedP), mappedAbsoluteTarget); - return this.baseFs.symlinkSync(mappedTarget, mappedP, type); - } - async readFilePromise(p, encoding) { - return this.baseFs.readFilePromise(this.fsMapToBase(p), encoding); - } - readFileSync(p, encoding) { - return this.baseFs.readFileSync(this.fsMapToBase(p), encoding); - } - readdirPromise(p, opts) { - return this.baseFs.readdirPromise(this.mapToBase(p), opts); - } - readdirSync(p, opts) { - return this.baseFs.readdirSync(this.mapToBase(p), opts); - } - async readlinkPromise(p) { - return this.mapFromBase(await this.baseFs.readlinkPromise(this.mapToBase(p))); - } - readlinkSync(p) { - return this.mapFromBase(this.baseFs.readlinkSync(this.mapToBase(p))); - } - async truncatePromise(p, len) { - return this.baseFs.truncatePromise(this.mapToBase(p), len); - } - truncateSync(p, len) { - return this.baseFs.truncateSync(this.mapToBase(p), len); - } - async ftruncatePromise(fd, len) { - return this.baseFs.ftruncatePromise(fd, len); - } - ftruncateSync(fd, len) { - return this.baseFs.ftruncateSync(fd, len); - } - watch(p, a, b) { - return this.baseFs.watch( - this.mapToBase(p), - a, - b - ); - } - watchFile(p, a, b) { - return this.baseFs.watchFile( - this.mapToBase(p), - a, - b - ); - } - unwatchFile(p, cb) { - return this.baseFs.unwatchFile(this.mapToBase(p), cb); - } - fsMapToBase(p) { - if (typeof p === `number`) { - return p; - } else { - return this.mapToBase(p); - } - } -} - -function direntToPortable(dirent) { - const portableDirent = dirent; - if (typeof dirent.path === `string`) - portableDirent.path = npath.toPortablePath(dirent.path); - return portableDirent; -} -class NodeFS extends BasePortableFakeFS { - constructor(realFs = fs__default.default) { - super(); - this.realFs = realFs; - } - getExtractHint() { - return false; - } - getRealPath() { - return PortablePath.root; - } - resolve(p) { - return ppath.resolve(p); - } - async openPromise(p, flags, mode) { - return await new Promise((resolve, reject) => { - this.realFs.open(npath.fromPortablePath(p), flags, mode, this.makeCallback(resolve, reject)); - }); - } - openSync(p, flags, mode) { - return this.realFs.openSync(npath.fromPortablePath(p), flags, mode); - } - async opendirPromise(p, opts) { - return await new Promise((resolve, reject) => { - if (typeof opts !== `undefined`) { - this.realFs.opendir(npath.fromPortablePath(p), opts, this.makeCallback(resolve, reject)); - } else { - this.realFs.opendir(npath.fromPortablePath(p), this.makeCallback(resolve, reject)); - } - }).then((dir) => { - const dirWithFixedPath = dir; - Object.defineProperty(dirWithFixedPath, `path`, { - value: p, - configurable: true, - writable: true - }); - return dirWithFixedPath; - }); - } - opendirSync(p, opts) { - const dir = typeof opts !== `undefined` ? this.realFs.opendirSync(npath.fromPortablePath(p), opts) : this.realFs.opendirSync(npath.fromPortablePath(p)); - const dirWithFixedPath = dir; - Object.defineProperty(dirWithFixedPath, `path`, { - value: p, - configurable: true, - writable: true - }); - return dirWithFixedPath; - } - async readPromise(fd, buffer, offset = 0, length = 0, position = -1) { - return await new Promise((resolve, reject) => { - this.realFs.read(fd, buffer, offset, length, position, (error, bytesRead) => { - if (error) { - reject(error); - } else { - resolve(bytesRead); - } - }); - }); - } - readSync(fd, buffer, offset, length, position) { - return this.realFs.readSync(fd, buffer, offset, length, position); - } - async writePromise(fd, buffer, offset, length, position) { - return await new Promise((resolve, reject) => { - if (typeof buffer === `string`) { - return this.realFs.write(fd, buffer, offset, this.makeCallback(resolve, reject)); - } else { - return this.realFs.write(fd, buffer, offset, length, position, this.makeCallback(resolve, reject)); - } - }); - } - writeSync(fd, buffer, offset, length, position) { - if (typeof buffer === `string`) { - return this.realFs.writeSync(fd, buffer, offset); - } else { - return this.realFs.writeSync(fd, buffer, offset, length, position); - } - } - async closePromise(fd) { - await new Promise((resolve, reject) => { - this.realFs.close(fd, this.makeCallback(resolve, reject)); - }); - } - closeSync(fd) { - this.realFs.closeSync(fd); - } - createReadStream(p, opts) { - const realPath = p !== null ? npath.fromPortablePath(p) : p; - return this.realFs.createReadStream(realPath, opts); - } - createWriteStream(p, opts) { - const realPath = p !== null ? npath.fromPortablePath(p) : p; - return this.realFs.createWriteStream(realPath, opts); - } - async realpathPromise(p) { - return await new Promise((resolve, reject) => { - this.realFs.realpath(npath.fromPortablePath(p), {}, this.makeCallback(resolve, reject)); - }).then((path) => { - return npath.toPortablePath(path); - }); - } - realpathSync(p) { - return npath.toPortablePath(this.realFs.realpathSync(npath.fromPortablePath(p), {})); - } - async existsPromise(p) { - return await new Promise((resolve) => { - this.realFs.exists(npath.fromPortablePath(p), resolve); - }); - } - accessSync(p, mode) { - return this.realFs.accessSync(npath.fromPortablePath(p), mode); - } - async accessPromise(p, mode) { - return await new Promise((resolve, reject) => { - this.realFs.access(npath.fromPortablePath(p), mode, this.makeCallback(resolve, reject)); - }); - } - existsSync(p) { - return this.realFs.existsSync(npath.fromPortablePath(p)); - } - async statPromise(p, opts) { - return await new Promise((resolve, reject) => { - if (opts) { - this.realFs.stat(npath.fromPortablePath(p), opts, this.makeCallback(resolve, reject)); - } else { - this.realFs.stat(npath.fromPortablePath(p), this.makeCallback(resolve, reject)); - } - }); - } - statSync(p, opts) { - if (opts) { - return this.realFs.statSync(npath.fromPortablePath(p), opts); - } else { - return this.realFs.statSync(npath.fromPortablePath(p)); - } - } - async fstatPromise(fd, opts) { - return await new Promise((resolve, reject) => { - if (opts) { - this.realFs.fstat(fd, opts, this.makeCallback(resolve, reject)); - } else { - this.realFs.fstat(fd, this.makeCallback(resolve, reject)); - } - }); - } - fstatSync(fd, opts) { - if (opts) { - return this.realFs.fstatSync(fd, opts); - } else { - return this.realFs.fstatSync(fd); - } - } - async lstatPromise(p, opts) { - return await new Promise((resolve, reject) => { - if (opts) { - this.realFs.lstat(npath.fromPortablePath(p), opts, this.makeCallback(resolve, reject)); - } else { - this.realFs.lstat(npath.fromPortablePath(p), this.makeCallback(resolve, reject)); - } - }); - } - lstatSync(p, opts) { - if (opts) { - return this.realFs.lstatSync(npath.fromPortablePath(p), opts); - } else { - return this.realFs.lstatSync(npath.fromPortablePath(p)); - } - } - async fchmodPromise(fd, mask) { - return await new Promise((resolve, reject) => { - this.realFs.fchmod(fd, mask, this.makeCallback(resolve, reject)); - }); - } - fchmodSync(fd, mask) { - return this.realFs.fchmodSync(fd, mask); - } - async chmodPromise(p, mask) { - return await new Promise((resolve, reject) => { - this.realFs.chmod(npath.fromPortablePath(p), mask, this.makeCallback(resolve, reject)); - }); - } - chmodSync(p, mask) { - return this.realFs.chmodSync(npath.fromPortablePath(p), mask); - } - async fchownPromise(fd, uid, gid) { - return await new Promise((resolve, reject) => { - this.realFs.fchown(fd, uid, gid, this.makeCallback(resolve, reject)); - }); - } - fchownSync(fd, uid, gid) { - return this.realFs.fchownSync(fd, uid, gid); - } - async chownPromise(p, uid, gid) { - return await new Promise((resolve, reject) => { - this.realFs.chown(npath.fromPortablePath(p), uid, gid, this.makeCallback(resolve, reject)); - }); - } - chownSync(p, uid, gid) { - return this.realFs.chownSync(npath.fromPortablePath(p), uid, gid); - } - async renamePromise(oldP, newP) { - return await new Promise((resolve, reject) => { - this.realFs.rename(npath.fromPortablePath(oldP), npath.fromPortablePath(newP), this.makeCallback(resolve, reject)); - }); - } - renameSync(oldP, newP) { - return this.realFs.renameSync(npath.fromPortablePath(oldP), npath.fromPortablePath(newP)); - } - async copyFilePromise(sourceP, destP, flags = 0) { - return await new Promise((resolve, reject) => { - this.realFs.copyFile(npath.fromPortablePath(sourceP), npath.fromPortablePath(destP), flags, this.makeCallback(resolve, reject)); - }); - } - copyFileSync(sourceP, destP, flags = 0) { - return this.realFs.copyFileSync(npath.fromPortablePath(sourceP), npath.fromPortablePath(destP), flags); - } - async appendFilePromise(p, content, opts) { - return await new Promise((resolve, reject) => { - const fsNativePath = typeof p === `string` ? npath.fromPortablePath(p) : p; - if (opts) { - this.realFs.appendFile(fsNativePath, content, opts, this.makeCallback(resolve, reject)); - } else { - this.realFs.appendFile(fsNativePath, content, this.makeCallback(resolve, reject)); - } - }); - } - appendFileSync(p, content, opts) { - const fsNativePath = typeof p === `string` ? npath.fromPortablePath(p) : p; - if (opts) { - this.realFs.appendFileSync(fsNativePath, content, opts); - } else { - this.realFs.appendFileSync(fsNativePath, content); - } - } - async writeFilePromise(p, content, opts) { - return await new Promise((resolve, reject) => { - const fsNativePath = typeof p === `string` ? npath.fromPortablePath(p) : p; - if (opts) { - this.realFs.writeFile(fsNativePath, content, opts, this.makeCallback(resolve, reject)); - } else { - this.realFs.writeFile(fsNativePath, content, this.makeCallback(resolve, reject)); - } - }); - } - writeFileSync(p, content, opts) { - const fsNativePath = typeof p === `string` ? npath.fromPortablePath(p) : p; - if (opts) { - this.realFs.writeFileSync(fsNativePath, content, opts); - } else { - this.realFs.writeFileSync(fsNativePath, content); - } - } - async unlinkPromise(p) { - return await new Promise((resolve, reject) => { - this.realFs.unlink(npath.fromPortablePath(p), this.makeCallback(resolve, reject)); - }); - } - unlinkSync(p) { - return this.realFs.unlinkSync(npath.fromPortablePath(p)); - } - async utimesPromise(p, atime, mtime) { - return await new Promise((resolve, reject) => { - this.realFs.utimes(npath.fromPortablePath(p), atime, mtime, this.makeCallback(resolve, reject)); - }); - } - utimesSync(p, atime, mtime) { - this.realFs.utimesSync(npath.fromPortablePath(p), atime, mtime); - } - async lutimesPromise(p, atime, mtime) { - return await new Promise((resolve, reject) => { - this.realFs.lutimes(npath.fromPortablePath(p), atime, mtime, this.makeCallback(resolve, reject)); - }); - } - lutimesSync(p, atime, mtime) { - this.realFs.lutimesSync(npath.fromPortablePath(p), atime, mtime); - } - async mkdirPromise(p, opts) { - return await new Promise((resolve, reject) => { - this.realFs.mkdir(npath.fromPortablePath(p), opts, this.makeCallback(resolve, reject)); - }); - } - mkdirSync(p, opts) { - return this.realFs.mkdirSync(npath.fromPortablePath(p), opts); - } - async rmdirPromise(p, opts) { - return await new Promise((resolve, reject) => { - if (opts) { - this.realFs.rmdir(npath.fromPortablePath(p), opts, this.makeCallback(resolve, reject)); - } else { - this.realFs.rmdir(npath.fromPortablePath(p), this.makeCallback(resolve, reject)); - } - }); - } - rmdirSync(p, opts) { - return this.realFs.rmdirSync(npath.fromPortablePath(p), opts); - } - async rmPromise(p, opts) { - return await new Promise((resolve, reject) => { - if (opts) { - this.realFs.rm(npath.fromPortablePath(p), opts, this.makeCallback(resolve, reject)); - } else { - this.realFs.rm(npath.fromPortablePath(p), this.makeCallback(resolve, reject)); - } - }); - } - rmSync(p, opts) { - return this.realFs.rmSync(npath.fromPortablePath(p), opts); - } - async linkPromise(existingP, newP) { - return await new Promise((resolve, reject) => { - this.realFs.link(npath.fromPortablePath(existingP), npath.fromPortablePath(newP), this.makeCallback(resolve, reject)); - }); - } - linkSync(existingP, newP) { - return this.realFs.linkSync(npath.fromPortablePath(existingP), npath.fromPortablePath(newP)); - } - async symlinkPromise(target, p, type) { - return await new Promise((resolve, reject) => { - this.realFs.symlink(npath.fromPortablePath(target.replace(/\/+$/, ``)), npath.fromPortablePath(p), type, this.makeCallback(resolve, reject)); - }); - } - symlinkSync(target, p, type) { - return this.realFs.symlinkSync(npath.fromPortablePath(target.replace(/\/+$/, ``)), npath.fromPortablePath(p), type); - } - async readFilePromise(p, encoding) { - return await new Promise((resolve, reject) => { - const fsNativePath = typeof p === `string` ? npath.fromPortablePath(p) : p; - this.realFs.readFile(fsNativePath, encoding, this.makeCallback(resolve, reject)); - }); - } - readFileSync(p, encoding) { - const fsNativePath = typeof p === `string` ? npath.fromPortablePath(p) : p; - return this.realFs.readFileSync(fsNativePath, encoding); - } - async readdirPromise(p, opts) { - return await new Promise((resolve, reject) => { - if (opts) { - if (opts.recursive && process.platform === `win32`) { - if (opts.withFileTypes) { - this.realFs.readdir(npath.fromPortablePath(p), opts, this.makeCallback((results) => resolve(results.map(direntToPortable)), reject)); - } else { - this.realFs.readdir(npath.fromPortablePath(p), opts, this.makeCallback((results) => resolve(results.map(npath.toPortablePath)), reject)); - } - } else { - this.realFs.readdir(npath.fromPortablePath(p), opts, this.makeCallback(resolve, reject)); - } - } else { - this.realFs.readdir(npath.fromPortablePath(p), this.makeCallback(resolve, reject)); - } - }); - } - readdirSync(p, opts) { - if (opts) { - if (opts.recursive && process.platform === `win32`) { - if (opts.withFileTypes) { - return this.realFs.readdirSync(npath.fromPortablePath(p), opts).map(direntToPortable); - } else { - return this.realFs.readdirSync(npath.fromPortablePath(p), opts).map(npath.toPortablePath); - } - } else { - return this.realFs.readdirSync(npath.fromPortablePath(p), opts); - } - } else { - return this.realFs.readdirSync(npath.fromPortablePath(p)); - } - } - async readlinkPromise(p) { - return await new Promise((resolve, reject) => { - this.realFs.readlink(npath.fromPortablePath(p), this.makeCallback(resolve, reject)); - }).then((path) => { - return npath.toPortablePath(path); - }); - } - readlinkSync(p) { - return npath.toPortablePath(this.realFs.readlinkSync(npath.fromPortablePath(p))); - } - async truncatePromise(p, len) { - return await new Promise((resolve, reject) => { - this.realFs.truncate(npath.fromPortablePath(p), len, this.makeCallback(resolve, reject)); - }); - } - truncateSync(p, len) { - return this.realFs.truncateSync(npath.fromPortablePath(p), len); - } - async ftruncatePromise(fd, len) { - return await new Promise((resolve, reject) => { - this.realFs.ftruncate(fd, len, this.makeCallback(resolve, reject)); - }); - } - ftruncateSync(fd, len) { - return this.realFs.ftruncateSync(fd, len); - } - watch(p, a, b) { - return this.realFs.watch( - npath.fromPortablePath(p), - a, - b - ); - } - watchFile(p, a, b) { - return this.realFs.watchFile( - npath.fromPortablePath(p), - a, - b - ); - } - unwatchFile(p, cb) { - return this.realFs.unwatchFile(npath.fromPortablePath(p), cb); - } - makeCallback(resolve, reject) { - return (err, result) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }; - } -} - -const MOUNT_MASK = 4278190080; -class MountFS extends BasePortableFakeFS { - constructor({ baseFs = new NodeFS(), filter = null, magicByte = 42, maxOpenFiles = Infinity, useCache = true, maxAge = 5e3, typeCheck = fs.constants.S_IFREG, getMountPoint, factoryPromise, factorySync }) { - if (Math.floor(magicByte) !== magicByte || !(magicByte > 1 && magicByte <= 127)) - throw new Error(`The magic byte must be set to a round value between 1 and 127 included`); - super(); - this.fdMap = /* @__PURE__ */ new Map(); - this.nextFd = 3; - this.isMount = /* @__PURE__ */ new Set(); - this.notMount = /* @__PURE__ */ new Set(); - this.realPaths = /* @__PURE__ */ new Map(); - this.limitOpenFilesTimeout = null; - this.baseFs = baseFs; - this.mountInstances = useCache ? /* @__PURE__ */ new Map() : null; - this.factoryPromise = factoryPromise; - this.factorySync = factorySync; - this.filter = filter; - this.getMountPoint = getMountPoint; - this.magic = magicByte << 24; - this.maxAge = maxAge; - this.maxOpenFiles = maxOpenFiles; - this.typeCheck = typeCheck; - } - getExtractHint(hints) { - return this.baseFs.getExtractHint(hints); - } - getRealPath() { - return this.baseFs.getRealPath(); - } - saveAndClose() { - unwatchAllFiles(this); - if (this.mountInstances) { - for (const [path, { childFs }] of this.mountInstances.entries()) { - childFs.saveAndClose?.(); - this.mountInstances.delete(path); - } - } - } - discardAndClose() { - unwatchAllFiles(this); - if (this.mountInstances) { - for (const [path, { childFs }] of this.mountInstances.entries()) { - childFs.discardAndClose?.(); - this.mountInstances.delete(path); - } - } - } - resolve(p) { - return this.baseFs.resolve(p); - } - remapFd(mountFs, fd) { - const remappedFd = this.nextFd++ | this.magic; - this.fdMap.set(remappedFd, [mountFs, fd]); - return remappedFd; - } - async openPromise(p, flags, mode) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.openPromise(p, flags, mode); - }, async (mountFs, { subPath }) => { - return this.remapFd(mountFs, await mountFs.openPromise(subPath, flags, mode)); - }); - } - openSync(p, flags, mode) { - return this.makeCallSync(p, () => { - return this.baseFs.openSync(p, flags, mode); - }, (mountFs, { subPath }) => { - return this.remapFd(mountFs, mountFs.openSync(subPath, flags, mode)); - }); - } - async opendirPromise(p, opts) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.opendirPromise(p, opts); - }, async (mountFs, { subPath }) => { - return await mountFs.opendirPromise(subPath, opts); - }, { - requireSubpath: false - }); - } - opendirSync(p, opts) { - return this.makeCallSync(p, () => { - return this.baseFs.opendirSync(p, opts); - }, (mountFs, { subPath }) => { - return mountFs.opendirSync(subPath, opts); - }, { - requireSubpath: false - }); - } - async readPromise(fd, buffer, offset, length, position) { - if ((fd & MOUNT_MASK) !== this.magic) - return await this.baseFs.readPromise(fd, buffer, offset, length, position); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`read`); - const [mountFs, realFd] = entry; - return await mountFs.readPromise(realFd, buffer, offset, length, position); - } - readSync(fd, buffer, offset, length, position) { - if ((fd & MOUNT_MASK) !== this.magic) - return this.baseFs.readSync(fd, buffer, offset, length, position); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`readSync`); - const [mountFs, realFd] = entry; - return mountFs.readSync(realFd, buffer, offset, length, position); - } - async writePromise(fd, buffer, offset, length, position) { - if ((fd & MOUNT_MASK) !== this.magic) { - if (typeof buffer === `string`) { - return await this.baseFs.writePromise(fd, buffer, offset); - } else { - return await this.baseFs.writePromise(fd, buffer, offset, length, position); - } - } - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`write`); - const [mountFs, realFd] = entry; - if (typeof buffer === `string`) { - return await mountFs.writePromise(realFd, buffer, offset); - } else { - return await mountFs.writePromise(realFd, buffer, offset, length, position); - } - } - writeSync(fd, buffer, offset, length, position) { - if ((fd & MOUNT_MASK) !== this.magic) { - if (typeof buffer === `string`) { - return this.baseFs.writeSync(fd, buffer, offset); - } else { - return this.baseFs.writeSync(fd, buffer, offset, length, position); - } - } - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`writeSync`); - const [mountFs, realFd] = entry; - if (typeof buffer === `string`) { - return mountFs.writeSync(realFd, buffer, offset); - } else { - return mountFs.writeSync(realFd, buffer, offset, length, position); - } - } - async closePromise(fd) { - if ((fd & MOUNT_MASK) !== this.magic) - return await this.baseFs.closePromise(fd); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`close`); - this.fdMap.delete(fd); - const [mountFs, realFd] = entry; - return await mountFs.closePromise(realFd); - } - closeSync(fd) { - if ((fd & MOUNT_MASK) !== this.magic) - return this.baseFs.closeSync(fd); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`closeSync`); - this.fdMap.delete(fd); - const [mountFs, realFd] = entry; - return mountFs.closeSync(realFd); - } - createReadStream(p, opts) { - if (p === null) - return this.baseFs.createReadStream(p, opts); - return this.makeCallSync(p, () => { - return this.baseFs.createReadStream(p, opts); - }, (mountFs, { archivePath, subPath }) => { - const stream = mountFs.createReadStream(subPath, opts); - stream.path = npath.fromPortablePath(this.pathUtils.join(archivePath, subPath)); - return stream; - }); - } - createWriteStream(p, opts) { - if (p === null) - return this.baseFs.createWriteStream(p, opts); - return this.makeCallSync(p, () => { - return this.baseFs.createWriteStream(p, opts); - }, (mountFs, { subPath }) => { - return mountFs.createWriteStream(subPath, opts); - }); - } - async realpathPromise(p) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.realpathPromise(p); - }, async (mountFs, { archivePath, subPath }) => { - let realArchivePath = this.realPaths.get(archivePath); - if (typeof realArchivePath === `undefined`) { - realArchivePath = await this.baseFs.realpathPromise(archivePath); - this.realPaths.set(archivePath, realArchivePath); - } - return this.pathUtils.join(realArchivePath, this.pathUtils.relative(PortablePath.root, await mountFs.realpathPromise(subPath))); - }); - } - realpathSync(p) { - return this.makeCallSync(p, () => { - return this.baseFs.realpathSync(p); - }, (mountFs, { archivePath, subPath }) => { - let realArchivePath = this.realPaths.get(archivePath); - if (typeof realArchivePath === `undefined`) { - realArchivePath = this.baseFs.realpathSync(archivePath); - this.realPaths.set(archivePath, realArchivePath); - } - return this.pathUtils.join(realArchivePath, this.pathUtils.relative(PortablePath.root, mountFs.realpathSync(subPath))); - }); - } - async existsPromise(p) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.existsPromise(p); - }, async (mountFs, { subPath }) => { - return await mountFs.existsPromise(subPath); - }); - } - existsSync(p) { - return this.makeCallSync(p, () => { - return this.baseFs.existsSync(p); - }, (mountFs, { subPath }) => { - return mountFs.existsSync(subPath); - }); - } - async accessPromise(p, mode) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.accessPromise(p, mode); - }, async (mountFs, { subPath }) => { - return await mountFs.accessPromise(subPath, mode); - }); - } - accessSync(p, mode) { - return this.makeCallSync(p, () => { - return this.baseFs.accessSync(p, mode); - }, (mountFs, { subPath }) => { - return mountFs.accessSync(subPath, mode); - }); - } - async statPromise(p, opts) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.statPromise(p, opts); - }, async (mountFs, { subPath }) => { - return await mountFs.statPromise(subPath, opts); - }); - } - statSync(p, opts) { - return this.makeCallSync(p, () => { - return this.baseFs.statSync(p, opts); - }, (mountFs, { subPath }) => { - return mountFs.statSync(subPath, opts); - }); - } - async fstatPromise(fd, opts) { - if ((fd & MOUNT_MASK) !== this.magic) - return this.baseFs.fstatPromise(fd, opts); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`fstat`); - const [mountFs, realFd] = entry; - return mountFs.fstatPromise(realFd, opts); - } - fstatSync(fd, opts) { - if ((fd & MOUNT_MASK) !== this.magic) - return this.baseFs.fstatSync(fd, opts); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`fstatSync`); - const [mountFs, realFd] = entry; - return mountFs.fstatSync(realFd, opts); - } - async lstatPromise(p, opts) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.lstatPromise(p, opts); - }, async (mountFs, { subPath }) => { - return await mountFs.lstatPromise(subPath, opts); - }); - } - lstatSync(p, opts) { - return this.makeCallSync(p, () => { - return this.baseFs.lstatSync(p, opts); - }, (mountFs, { subPath }) => { - return mountFs.lstatSync(subPath, opts); - }); - } - async fchmodPromise(fd, mask) { - if ((fd & MOUNT_MASK) !== this.magic) - return this.baseFs.fchmodPromise(fd, mask); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`fchmod`); - const [mountFs, realFd] = entry; - return mountFs.fchmodPromise(realFd, mask); - } - fchmodSync(fd, mask) { - if ((fd & MOUNT_MASK) !== this.magic) - return this.baseFs.fchmodSync(fd, mask); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`fchmodSync`); - const [mountFs, realFd] = entry; - return mountFs.fchmodSync(realFd, mask); - } - async chmodPromise(p, mask) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.chmodPromise(p, mask); - }, async (mountFs, { subPath }) => { - return await mountFs.chmodPromise(subPath, mask); - }); - } - chmodSync(p, mask) { - return this.makeCallSync(p, () => { - return this.baseFs.chmodSync(p, mask); - }, (mountFs, { subPath }) => { - return mountFs.chmodSync(subPath, mask); - }); - } - async fchownPromise(fd, uid, gid) { - if ((fd & MOUNT_MASK) !== this.magic) - return this.baseFs.fchownPromise(fd, uid, gid); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`fchown`); - const [zipFs, realFd] = entry; - return zipFs.fchownPromise(realFd, uid, gid); - } - fchownSync(fd, uid, gid) { - if ((fd & MOUNT_MASK) !== this.magic) - return this.baseFs.fchownSync(fd, uid, gid); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`fchownSync`); - const [zipFs, realFd] = entry; - return zipFs.fchownSync(realFd, uid, gid); - } - async chownPromise(p, uid, gid) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.chownPromise(p, uid, gid); - }, async (mountFs, { subPath }) => { - return await mountFs.chownPromise(subPath, uid, gid); - }); - } - chownSync(p, uid, gid) { - return this.makeCallSync(p, () => { - return this.baseFs.chownSync(p, uid, gid); - }, (mountFs, { subPath }) => { - return mountFs.chownSync(subPath, uid, gid); - }); - } - async renamePromise(oldP, newP) { - return await this.makeCallPromise(oldP, async () => { - return await this.makeCallPromise(newP, async () => { - return await this.baseFs.renamePromise(oldP, newP); - }, async () => { - throw Object.assign(new Error(`EEXDEV: cross-device link not permitted`), { code: `EEXDEV` }); - }); - }, async (mountFsO, { subPath: subPathO }) => { - return await this.makeCallPromise(newP, async () => { - throw Object.assign(new Error(`EEXDEV: cross-device link not permitted`), { code: `EEXDEV` }); - }, async (mountFsN, { subPath: subPathN }) => { - if (mountFsO !== mountFsN) { - throw Object.assign(new Error(`EEXDEV: cross-device link not permitted`), { code: `EEXDEV` }); - } else { - return await mountFsO.renamePromise(subPathO, subPathN); - } - }); - }); - } - renameSync(oldP, newP) { - return this.makeCallSync(oldP, () => { - return this.makeCallSync(newP, () => { - return this.baseFs.renameSync(oldP, newP); - }, () => { - throw Object.assign(new Error(`EEXDEV: cross-device link not permitted`), { code: `EEXDEV` }); - }); - }, (mountFsO, { subPath: subPathO }) => { - return this.makeCallSync(newP, () => { - throw Object.assign(new Error(`EEXDEV: cross-device link not permitted`), { code: `EEXDEV` }); - }, (mountFsN, { subPath: subPathN }) => { - if (mountFsO !== mountFsN) { - throw Object.assign(new Error(`EEXDEV: cross-device link not permitted`), { code: `EEXDEV` }); - } else { - return mountFsO.renameSync(subPathO, subPathN); - } - }); - }); - } - async copyFilePromise(sourceP, destP, flags = 0) { - const fallback = async (sourceFs, sourceP2, destFs, destP2) => { - if ((flags & fs.constants.COPYFILE_FICLONE_FORCE) !== 0) - throw Object.assign(new Error(`EXDEV: cross-device clone not permitted, copyfile '${sourceP2}' -> ${destP2}'`), { code: `EXDEV` }); - if (flags & fs.constants.COPYFILE_EXCL && await this.existsPromise(sourceP2)) - throw Object.assign(new Error(`EEXIST: file already exists, copyfile '${sourceP2}' -> '${destP2}'`), { code: `EEXIST` }); - let content; - try { - content = await sourceFs.readFilePromise(sourceP2); - } catch (error) { - throw Object.assign(new Error(`EINVAL: invalid argument, copyfile '${sourceP2}' -> '${destP2}'`), { code: `EINVAL` }); - } - await destFs.writeFilePromise(destP2, content); - }; - return await this.makeCallPromise(sourceP, async () => { - return await this.makeCallPromise(destP, async () => { - return await this.baseFs.copyFilePromise(sourceP, destP, flags); - }, async (mountFsD, { subPath: subPathD }) => { - return await fallback(this.baseFs, sourceP, mountFsD, subPathD); - }); - }, async (mountFsS, { subPath: subPathS }) => { - return await this.makeCallPromise(destP, async () => { - return await fallback(mountFsS, subPathS, this.baseFs, destP); - }, async (mountFsD, { subPath: subPathD }) => { - if (mountFsS !== mountFsD) { - return await fallback(mountFsS, subPathS, mountFsD, subPathD); - } else { - return await mountFsS.copyFilePromise(subPathS, subPathD, flags); - } - }); - }); - } - copyFileSync(sourceP, destP, flags = 0) { - const fallback = (sourceFs, sourceP2, destFs, destP2) => { - if ((flags & fs.constants.COPYFILE_FICLONE_FORCE) !== 0) - throw Object.assign(new Error(`EXDEV: cross-device clone not permitted, copyfile '${sourceP2}' -> ${destP2}'`), { code: `EXDEV` }); - if (flags & fs.constants.COPYFILE_EXCL && this.existsSync(sourceP2)) - throw Object.assign(new Error(`EEXIST: file already exists, copyfile '${sourceP2}' -> '${destP2}'`), { code: `EEXIST` }); - let content; - try { - content = sourceFs.readFileSync(sourceP2); - } catch (error) { - throw Object.assign(new Error(`EINVAL: invalid argument, copyfile '${sourceP2}' -> '${destP2}'`), { code: `EINVAL` }); - } - destFs.writeFileSync(destP2, content); - }; - return this.makeCallSync(sourceP, () => { - return this.makeCallSync(destP, () => { - return this.baseFs.copyFileSync(sourceP, destP, flags); - }, (mountFsD, { subPath: subPathD }) => { - return fallback(this.baseFs, sourceP, mountFsD, subPathD); - }); - }, (mountFsS, { subPath: subPathS }) => { - return this.makeCallSync(destP, () => { - return fallback(mountFsS, subPathS, this.baseFs, destP); - }, (mountFsD, { subPath: subPathD }) => { - if (mountFsS !== mountFsD) { - return fallback(mountFsS, subPathS, mountFsD, subPathD); - } else { - return mountFsS.copyFileSync(subPathS, subPathD, flags); - } - }); - }); - } - async appendFilePromise(p, content, opts) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.appendFilePromise(p, content, opts); - }, async (mountFs, { subPath }) => { - return await mountFs.appendFilePromise(subPath, content, opts); - }); - } - appendFileSync(p, content, opts) { - return this.makeCallSync(p, () => { - return this.baseFs.appendFileSync(p, content, opts); - }, (mountFs, { subPath }) => { - return mountFs.appendFileSync(subPath, content, opts); - }); - } - async writeFilePromise(p, content, opts) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.writeFilePromise(p, content, opts); - }, async (mountFs, { subPath }) => { - return await mountFs.writeFilePromise(subPath, content, opts); - }); - } - writeFileSync(p, content, opts) { - return this.makeCallSync(p, () => { - return this.baseFs.writeFileSync(p, content, opts); - }, (mountFs, { subPath }) => { - return mountFs.writeFileSync(subPath, content, opts); - }); - } - async unlinkPromise(p) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.unlinkPromise(p); - }, async (mountFs, { subPath }) => { - return await mountFs.unlinkPromise(subPath); - }); - } - unlinkSync(p) { - return this.makeCallSync(p, () => { - return this.baseFs.unlinkSync(p); - }, (mountFs, { subPath }) => { - return mountFs.unlinkSync(subPath); - }); - } - async utimesPromise(p, atime, mtime) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.utimesPromise(p, atime, mtime); - }, async (mountFs, { subPath }) => { - return await mountFs.utimesPromise(subPath, atime, mtime); - }); - } - utimesSync(p, atime, mtime) { - return this.makeCallSync(p, () => { - return this.baseFs.utimesSync(p, atime, mtime); - }, (mountFs, { subPath }) => { - return mountFs.utimesSync(subPath, atime, mtime); - }); - } - async lutimesPromise(p, atime, mtime) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.lutimesPromise(p, atime, mtime); - }, async (mountFs, { subPath }) => { - return await mountFs.lutimesPromise(subPath, atime, mtime); - }); - } - lutimesSync(p, atime, mtime) { - return this.makeCallSync(p, () => { - return this.baseFs.lutimesSync(p, atime, mtime); - }, (mountFs, { subPath }) => { - return mountFs.lutimesSync(subPath, atime, mtime); - }); - } - async mkdirPromise(p, opts) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.mkdirPromise(p, opts); - }, async (mountFs, { subPath }) => { - return await mountFs.mkdirPromise(subPath, opts); - }); - } - mkdirSync(p, opts) { - return this.makeCallSync(p, () => { - return this.baseFs.mkdirSync(p, opts); - }, (mountFs, { subPath }) => { - return mountFs.mkdirSync(subPath, opts); - }); - } - async rmdirPromise(p, opts) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.rmdirPromise(p, opts); - }, async (mountFs, { subPath }) => { - return await mountFs.rmdirPromise(subPath, opts); - }); - } - rmdirSync(p, opts) { - return this.makeCallSync(p, () => { - return this.baseFs.rmdirSync(p, opts); - }, (mountFs, { subPath }) => { - return mountFs.rmdirSync(subPath, opts); - }); - } - async rmPromise(p, opts) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.rmPromise(p, opts); - }, async (mountFs, { subPath }) => { - return await mountFs.rmPromise(subPath, opts); - }); - } - rmSync(p, opts) { - return this.makeCallSync(p, () => { - return this.baseFs.rmSync(p, opts); - }, (mountFs, { subPath }) => { - return mountFs.rmSync(subPath, opts); - }); - } - async linkPromise(existingP, newP) { - return await this.makeCallPromise(newP, async () => { - return await this.baseFs.linkPromise(existingP, newP); - }, async (mountFs, { subPath }) => { - return await mountFs.linkPromise(existingP, subPath); - }); - } - linkSync(existingP, newP) { - return this.makeCallSync(newP, () => { - return this.baseFs.linkSync(existingP, newP); - }, (mountFs, { subPath }) => { - return mountFs.linkSync(existingP, subPath); - }); - } - async symlinkPromise(target, p, type) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.symlinkPromise(target, p, type); - }, async (mountFs, { subPath }) => { - return await mountFs.symlinkPromise(target, subPath); - }); - } - symlinkSync(target, p, type) { - return this.makeCallSync(p, () => { - return this.baseFs.symlinkSync(target, p, type); - }, (mountFs, { subPath }) => { - return mountFs.symlinkSync(target, subPath); - }); - } - async readFilePromise(p, encoding) { - return this.makeCallPromise(p, async () => { - return await this.baseFs.readFilePromise(p, encoding); - }, async (mountFs, { subPath }) => { - return await mountFs.readFilePromise(subPath, encoding); - }); - } - readFileSync(p, encoding) { - return this.makeCallSync(p, () => { - return this.baseFs.readFileSync(p, encoding); - }, (mountFs, { subPath }) => { - return mountFs.readFileSync(subPath, encoding); - }); - } - async readdirPromise(p, opts) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.readdirPromise(p, opts); - }, async (mountFs, { subPath }) => { - return await mountFs.readdirPromise(subPath, opts); - }, { - requireSubpath: false - }); - } - readdirSync(p, opts) { - return this.makeCallSync(p, () => { - return this.baseFs.readdirSync(p, opts); - }, (mountFs, { subPath }) => { - return mountFs.readdirSync(subPath, opts); - }, { - requireSubpath: false - }); - } - async readlinkPromise(p) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.readlinkPromise(p); - }, async (mountFs, { subPath }) => { - return await mountFs.readlinkPromise(subPath); - }); - } - readlinkSync(p) { - return this.makeCallSync(p, () => { - return this.baseFs.readlinkSync(p); - }, (mountFs, { subPath }) => { - return mountFs.readlinkSync(subPath); - }); - } - async truncatePromise(p, len) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.truncatePromise(p, len); - }, async (mountFs, { subPath }) => { - return await mountFs.truncatePromise(subPath, len); - }); - } - truncateSync(p, len) { - return this.makeCallSync(p, () => { - return this.baseFs.truncateSync(p, len); - }, (mountFs, { subPath }) => { - return mountFs.truncateSync(subPath, len); - }); - } - async ftruncatePromise(fd, len) { - if ((fd & MOUNT_MASK) !== this.magic) - return this.baseFs.ftruncatePromise(fd, len); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`ftruncate`); - const [mountFs, realFd] = entry; - return mountFs.ftruncatePromise(realFd, len); - } - ftruncateSync(fd, len) { - if ((fd & MOUNT_MASK) !== this.magic) - return this.baseFs.ftruncateSync(fd, len); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`ftruncateSync`); - const [mountFs, realFd] = entry; - return mountFs.ftruncateSync(realFd, len); - } - watch(p, a, b) { - return this.makeCallSync(p, () => { - return this.baseFs.watch( - p, - a, - b - ); - }, (mountFs, { subPath }) => { - return mountFs.watch( - subPath, - a, - b - ); - }); - } - watchFile(p, a, b) { - return this.makeCallSync(p, () => { - return this.baseFs.watchFile( - p, - a, - b - ); - }, () => { - return watchFile(this, p, a, b); - }); - } - unwatchFile(p, cb) { - return this.makeCallSync(p, () => { - return this.baseFs.unwatchFile(p, cb); - }, () => { - return unwatchFile(this, p, cb); - }); - } - async makeCallPromise(p, discard, accept, { requireSubpath = true } = {}) { - if (typeof p !== `string`) - return await discard(); - const normalizedP = this.resolve(p); - const mountInfo = this.findMount(normalizedP); - if (!mountInfo) - return await discard(); - if (requireSubpath && mountInfo.subPath === `/`) - return await discard(); - return await this.getMountPromise(mountInfo.archivePath, async (mountFs) => await accept(mountFs, mountInfo)); - } - makeCallSync(p, discard, accept, { requireSubpath = true } = {}) { - if (typeof p !== `string`) - return discard(); - const normalizedP = this.resolve(p); - const mountInfo = this.findMount(normalizedP); - if (!mountInfo) - return discard(); - if (requireSubpath && mountInfo.subPath === `/`) - return discard(); - return this.getMountSync(mountInfo.archivePath, (mountFs) => accept(mountFs, mountInfo)); - } - findMount(p) { - if (this.filter && !this.filter.test(p)) - return null; - let filePath = ``; - while (true) { - const pathPartWithArchive = p.substring(filePath.length); - const mountPoint = this.getMountPoint(pathPartWithArchive, filePath); - if (!mountPoint) - return null; - filePath = this.pathUtils.join(filePath, mountPoint); - if (!this.isMount.has(filePath)) { - if (this.notMount.has(filePath)) - continue; - try { - if (this.typeCheck !== null && (this.baseFs.lstatSync(filePath).mode & fs.constants.S_IFMT) !== this.typeCheck) { - this.notMount.add(filePath); - continue; - } - } catch { - return null; - } - this.isMount.add(filePath); - } - return { - archivePath: filePath, - subPath: this.pathUtils.join(PortablePath.root, p.substring(filePath.length)) - }; - } - } - limitOpenFiles(max) { - if (this.mountInstances === null) - return; - const now = Date.now(); - let nextExpiresAt = now + this.maxAge; - let closeCount = max === null ? 0 : this.mountInstances.size - max; - for (const [path, { childFs, expiresAt, refCount }] of this.mountInstances.entries()) { - if (refCount !== 0 || childFs.hasOpenFileHandles?.()) { - continue; - } else if (now >= expiresAt) { - childFs.saveAndClose?.(); - this.mountInstances.delete(path); - closeCount -= 1; - continue; - } else if (max === null || closeCount <= 0) { - nextExpiresAt = expiresAt; - break; - } - childFs.saveAndClose?.(); - this.mountInstances.delete(path); - closeCount -= 1; - } - if (this.limitOpenFilesTimeout === null && (max === null && this.mountInstances.size > 0 || max !== null) && isFinite(nextExpiresAt)) { - this.limitOpenFilesTimeout = setTimeout(() => { - this.limitOpenFilesTimeout = null; - this.limitOpenFiles(null); - }, nextExpiresAt - now).unref(); - } - } - async getMountPromise(p, accept) { - if (this.mountInstances) { - let cachedMountFs = this.mountInstances.get(p); - if (!cachedMountFs) { - const createFsInstance = await this.factoryPromise(this.baseFs, p); - cachedMountFs = this.mountInstances.get(p); - if (!cachedMountFs) { - cachedMountFs = { - childFs: createFsInstance(), - expiresAt: 0, - refCount: 0 - }; - } - } - this.mountInstances.delete(p); - this.limitOpenFiles(this.maxOpenFiles - 1); - this.mountInstances.set(p, cachedMountFs); - cachedMountFs.expiresAt = Date.now() + this.maxAge; - cachedMountFs.refCount += 1; - try { - return await accept(cachedMountFs.childFs); - } finally { - cachedMountFs.refCount -= 1; - } - } else { - const mountFs = (await this.factoryPromise(this.baseFs, p))(); - try { - return await accept(mountFs); - } finally { - mountFs.saveAndClose?.(); - } - } - } - getMountSync(p, accept) { - if (this.mountInstances) { - let cachedMountFs = this.mountInstances.get(p); - if (!cachedMountFs) { - cachedMountFs = { - childFs: this.factorySync(this.baseFs, p), - expiresAt: 0, - refCount: 0 - }; - } - this.mountInstances.delete(p); - this.limitOpenFiles(this.maxOpenFiles - 1); - this.mountInstances.set(p, cachedMountFs); - cachedMountFs.expiresAt = Date.now() + this.maxAge; - return accept(cachedMountFs.childFs); - } else { - const childFs = this.factorySync(this.baseFs, p); - try { - return accept(childFs); - } finally { - childFs.saveAndClose?.(); - } - } - } -} - -class PosixFS extends ProxiedFS { - constructor(baseFs) { - super(npath); - this.baseFs = baseFs; - } - mapFromBase(path) { - return npath.fromPortablePath(path); - } - mapToBase(path) { - return npath.toPortablePath(path); - } -} - -const NUMBER_REGEXP = /^[0-9]+$/; -const VIRTUAL_REGEXP = /^(\/(?:[^/]+\/)*?(?:\$\$virtual|__virtual__))((?:\/((?:[^/]+-)?[a-f0-9]+)(?:\/([^/]+))?)?((?:\/.*)?))$/; -const VALID_COMPONENT = /^([^/]+-)?[a-f0-9]+$/; -class VirtualFS extends ProxiedFS { - constructor({ baseFs = new NodeFS() } = {}) { - super(ppath); - this.baseFs = baseFs; - } - static makeVirtualPath(base, component, to) { - if (ppath.basename(base) !== `__virtual__`) - throw new Error(`Assertion failed: Virtual folders must be named "__virtual__"`); - if (!ppath.basename(component).match(VALID_COMPONENT)) - throw new Error(`Assertion failed: Virtual components must be ended by an hexadecimal hash`); - const target = ppath.relative(ppath.dirname(base), to); - const segments = target.split(`/`); - let depth = 0; - while (depth < segments.length && segments[depth] === `..`) - depth += 1; - const finalSegments = segments.slice(depth); - const fullVirtualPath = ppath.join(base, component, String(depth), ...finalSegments); - return fullVirtualPath; - } - static resolveVirtual(p) { - const match = p.match(VIRTUAL_REGEXP); - if (!match || !match[3] && match[5]) - return p; - const target = ppath.dirname(match[1]); - if (!match[3] || !match[4]) - return target; - const isnum = NUMBER_REGEXP.test(match[4]); - if (!isnum) - return p; - const depth = Number(match[4]); - const backstep = `../`.repeat(depth); - const subpath = match[5] || `.`; - return VirtualFS.resolveVirtual(ppath.join(target, backstep, subpath)); - } - getExtractHint(hints) { - return this.baseFs.getExtractHint(hints); - } - getRealPath() { - return this.baseFs.getRealPath(); - } - realpathSync(p) { - const match = p.match(VIRTUAL_REGEXP); - if (!match) - return this.baseFs.realpathSync(p); - if (!match[5]) - return p; - const realpath = this.baseFs.realpathSync(this.mapToBase(p)); - return VirtualFS.makeVirtualPath(match[1], match[3], realpath); - } - async realpathPromise(p) { - const match = p.match(VIRTUAL_REGEXP); - if (!match) - return await this.baseFs.realpathPromise(p); - if (!match[5]) - return p; - const realpath = await this.baseFs.realpathPromise(this.mapToBase(p)); - return VirtualFS.makeVirtualPath(match[1], match[3], realpath); - } - mapToBase(p) { - if (p === ``) - return p; - if (this.pathUtils.isAbsolute(p)) - return VirtualFS.resolveVirtual(p); - const resolvedRoot = VirtualFS.resolveVirtual(this.baseFs.resolve(PortablePath.dot)); - const resolvedP = VirtualFS.resolveVirtual(this.baseFs.resolve(p)); - return ppath.relative(resolvedRoot, resolvedP) || PortablePath.dot; - } - mapFromBase(p) { - return p; - } -} - -const URL = Number(process.versions.node.split('.', 1)[0]) < 20 ? url.URL : globalThis.URL; - -class NodePathFS extends ProxiedFS { - constructor(baseFs) { - super(npath); - this.baseFs = baseFs; - } - mapFromBase(path) { - return path; - } - mapToBase(path) { - if (typeof path === `string`) - return path; - if (path instanceof URL) - return url.fileURLToPath(path); - if (Buffer.isBuffer(path)) { - const str = path.toString(); - if (!isUtf8(path, str)) - throw new Error(`Non-utf8 buffers are not supported at the moment. Please upvote the following issue if you encounter this error: https://github.com/yarnpkg/berry/issues/4942`); - return str; - } - throw new Error(`Unsupported path type: ${nodeUtils.inspect(path)}`); - } -} -function isUtf8(buf, str) { - if (typeof buffer__default.default.isUtf8 !== `undefined`) - return buffer__default.default.isUtf8(buf); - return Buffer.byteLength(str) === buf.byteLength; -} - -var _a, _b, _c, _d; -const kBaseFs = Symbol(`kBaseFs`); -const kFd = Symbol(`kFd`); -const kClosePromise = Symbol(`kClosePromise`); -const kCloseResolve = Symbol(`kCloseResolve`); -const kCloseReject = Symbol(`kCloseReject`); -const kRefs = Symbol(`kRefs`); -const kRef = Symbol(`kRef`); -const kUnref = Symbol(`kUnref`); -class FileHandle { - constructor(fd, baseFs) { - this[_a] = 1; - this[_b] = void 0; - this[_c] = void 0; - this[_d] = void 0; - this[kBaseFs] = baseFs; - this[kFd] = fd; - } - get fd() { - return this[kFd]; - } - async appendFile(data, options) { - try { - this[kRef](this.appendFile); - const encoding = (typeof options === `string` ? options : options?.encoding) ?? void 0; - return await this[kBaseFs].appendFilePromise(this.fd, data, encoding ? { encoding } : void 0); - } finally { - this[kUnref](); - } - } - async chown(uid, gid) { - try { - this[kRef](this.chown); - return await this[kBaseFs].fchownPromise(this.fd, uid, gid); - } finally { - this[kUnref](); - } - } - async chmod(mode) { - try { - this[kRef](this.chmod); - return await this[kBaseFs].fchmodPromise(this.fd, mode); - } finally { - this[kUnref](); - } - } - createReadStream(options) { - return this[kBaseFs].createReadStream(null, { ...options, fd: this.fd }); - } - createWriteStream(options) { - return this[kBaseFs].createWriteStream(null, { ...options, fd: this.fd }); - } - datasync() { - throw new Error(`Method not implemented.`); - } - sync() { - throw new Error(`Method not implemented.`); - } - async read(bufferOrOptions, offset, length, position) { - try { - this[kRef](this.read); - let buffer; - if (!Buffer.isBuffer(bufferOrOptions)) { - bufferOrOptions ??= {}; - buffer = bufferOrOptions.buffer ?? Buffer.alloc(16384); - offset = bufferOrOptions.offset || 0; - length = bufferOrOptions.length ?? buffer.byteLength; - position = bufferOrOptions.position ?? null; - } else { - buffer = bufferOrOptions; - } - offset ??= 0; - length ??= 0; - if (length === 0) { - return { - bytesRead: length, - buffer - }; - } - const bytesRead = await this[kBaseFs].readPromise(this.fd, buffer, offset, length, position); - return { - bytesRead, - buffer - }; - } finally { - this[kUnref](); - } - } - async readFile(options) { - try { - this[kRef](this.readFile); - const encoding = (typeof options === `string` ? options : options?.encoding) ?? void 0; - return await this[kBaseFs].readFilePromise(this.fd, encoding); - } finally { - this[kUnref](); - } - } - readLines(options) { - return readline.createInterface({ - input: this.createReadStream(options), - crlfDelay: Infinity - }); - } - async stat(opts) { - try { - this[kRef](this.stat); - return await this[kBaseFs].fstatPromise(this.fd, opts); - } finally { - this[kUnref](); - } - } - async truncate(len) { - try { - this[kRef](this.truncate); - return await this[kBaseFs].ftruncatePromise(this.fd, len); - } finally { - this[kUnref](); - } - } - utimes(atime, mtime) { - throw new Error(`Method not implemented.`); - } - async writeFile(data, options) { - try { - this[kRef](this.writeFile); - const encoding = (typeof options === `string` ? options : options?.encoding) ?? void 0; - await this[kBaseFs].writeFilePromise(this.fd, data, encoding); - } finally { - this[kUnref](); - } - } - async write(...args) { - try { - this[kRef](this.write); - if (ArrayBuffer.isView(args[0])) { - const [buffer, offset, length, position] = args; - const bytesWritten = await this[kBaseFs].writePromise(this.fd, buffer, offset ?? void 0, length ?? void 0, position ?? void 0); - return { bytesWritten, buffer }; - } else { - const [data, position, encoding] = args; - const bytesWritten = await this[kBaseFs].writePromise(this.fd, data, position, encoding); - return { bytesWritten, buffer: data }; - } - } finally { - this[kUnref](); - } - } - async writev(buffers, position) { - try { - this[kRef](this.writev); - let bytesWritten = 0; - if (typeof position !== `undefined`) { - for (const buffer of buffers) { - const writeResult = await this.write(buffer, void 0, void 0, position); - bytesWritten += writeResult.bytesWritten; - position += writeResult.bytesWritten; - } - } else { - for (const buffer of buffers) { - const writeResult = await this.write(buffer); - bytesWritten += writeResult.bytesWritten; - } - } - return { - buffers, - bytesWritten - }; - } finally { - this[kUnref](); - } - } - readv(buffers, position) { - throw new Error(`Method not implemented.`); - } - close() { - if (this[kFd] === -1) - return Promise.resolve(); - if (this[kClosePromise]) - return this[kClosePromise]; - this[kRefs]--; - if (this[kRefs] === 0) { - const fd = this[kFd]; - this[kFd] = -1; - this[kClosePromise] = this[kBaseFs].closePromise(fd).finally(() => { - this[kClosePromise] = void 0; - }); - } else { - this[kClosePromise] = new Promise((resolve, reject) => { - this[kCloseResolve] = resolve; - this[kCloseReject] = reject; - }).finally(() => { - this[kClosePromise] = void 0; - this[kCloseReject] = void 0; - this[kCloseResolve] = void 0; - }); - } - return this[kClosePromise]; - } - [(_a = kRefs, _b = kClosePromise, _c = kCloseResolve, _d = kCloseReject, kRef)](caller) { - if (this[kFd] === -1) { - const err = new Error(`file closed`); - err.code = `EBADF`; - err.syscall = caller.name; - throw err; - } - this[kRefs]++; - } - [kUnref]() { - this[kRefs]--; - if (this[kRefs] === 0) { - const fd = this[kFd]; - this[kFd] = -1; - this[kBaseFs].closePromise(fd).then(this[kCloseResolve], this[kCloseReject]); - } - } -} - -const SYNC_IMPLEMENTATIONS = /* @__PURE__ */ new Set([ - `accessSync`, - `appendFileSync`, - `createReadStream`, - `createWriteStream`, - `chmodSync`, - `fchmodSync`, - `chownSync`, - `fchownSync`, - `closeSync`, - `copyFileSync`, - `linkSync`, - `lstatSync`, - `fstatSync`, - `lutimesSync`, - `mkdirSync`, - `openSync`, - `opendirSync`, - `readlinkSync`, - `readFileSync`, - `readdirSync`, - `readlinkSync`, - `realpathSync`, - `renameSync`, - `rmdirSync`, - `rmSync`, - `statSync`, - `symlinkSync`, - `truncateSync`, - `ftruncateSync`, - `unlinkSync`, - `unwatchFile`, - `utimesSync`, - `watch`, - `watchFile`, - `writeFileSync`, - `writeSync` -]); -const ASYNC_IMPLEMENTATIONS = /* @__PURE__ */ new Set([ - `accessPromise`, - `appendFilePromise`, - `fchmodPromise`, - `chmodPromise`, - `fchownPromise`, - `chownPromise`, - `closePromise`, - `copyFilePromise`, - `linkPromise`, - `fstatPromise`, - `lstatPromise`, - `lutimesPromise`, - `mkdirPromise`, - `openPromise`, - `opendirPromise`, - `readdirPromise`, - `realpathPromise`, - `readFilePromise`, - `readdirPromise`, - `readlinkPromise`, - `renamePromise`, - `rmdirPromise`, - `rmPromise`, - `statPromise`, - `symlinkPromise`, - `truncatePromise`, - `ftruncatePromise`, - `unlinkPromise`, - `utimesPromise`, - `writeFilePromise`, - `writeSync` -]); -function patchFs(patchedFs, fakeFs) { - fakeFs = new NodePathFS(fakeFs); - const setupFn = (target, name, replacement) => { - const orig = target[name]; - target[name] = replacement; - if (typeof orig?.[nodeUtils.promisify.custom] !== `undefined`) { - replacement[nodeUtils.promisify.custom] = orig[nodeUtils.promisify.custom]; - } - }; - { - setupFn(patchedFs, `exists`, (p, ...args) => { - const hasCallback = typeof args[args.length - 1] === `function`; - const callback = hasCallback ? args.pop() : () => { - }; - process.nextTick(() => { - fakeFs.existsPromise(p).then((exists) => { - callback(exists); - }, () => { - callback(false); - }); - }); - }); - setupFn(patchedFs, `read`, (...args) => { - let [fd, buffer, offset, length, position, callback] = args; - if (args.length <= 3) { - let options = {}; - if (args.length < 3) { - callback = args[1]; - } else { - options = args[1]; - callback = args[2]; - } - ({ - buffer = Buffer.alloc(16384), - offset = 0, - length = buffer.byteLength, - position - } = options); - } - if (offset == null) - offset = 0; - length |= 0; - if (length === 0) { - process.nextTick(() => { - callback(null, 0, buffer); - }); - return; - } - if (position == null) - position = -1; - process.nextTick(() => { - fakeFs.readPromise(fd, buffer, offset, length, position).then((bytesRead) => { - callback(null, bytesRead, buffer); - }, (error) => { - callback(error, 0, buffer); - }); - }); - }); - for (const fnName of ASYNC_IMPLEMENTATIONS) { - const origName = fnName.replace(/Promise$/, ``); - if (typeof patchedFs[origName] === `undefined`) - continue; - const fakeImpl = fakeFs[fnName]; - if (typeof fakeImpl === `undefined`) - continue; - const wrapper = (...args) => { - const hasCallback = typeof args[args.length - 1] === `function`; - const callback = hasCallback ? args.pop() : () => { - }; - process.nextTick(() => { - fakeImpl.apply(fakeFs, args).then((result) => { - callback(null, result); - }, (error) => { - callback(error); - }); - }); - }; - setupFn(patchedFs, origName, wrapper); - } - patchedFs.realpath.native = patchedFs.realpath; - } - { - setupFn(patchedFs, `existsSync`, (p) => { - try { - return fakeFs.existsSync(p); - } catch (error) { - return false; - } - }); - setupFn(patchedFs, `readSync`, (...args) => { - let [fd, buffer, offset, length, position] = args; - if (args.length <= 3) { - const options = args[2] || {}; - ({ offset = 0, length = buffer.byteLength, position } = options); - } - if (offset == null) - offset = 0; - length |= 0; - if (length === 0) - return 0; - if (position == null) - position = -1; - return fakeFs.readSync(fd, buffer, offset, length, position); - }); - for (const fnName of SYNC_IMPLEMENTATIONS) { - const origName = fnName; - if (typeof patchedFs[origName] === `undefined`) - continue; - const fakeImpl = fakeFs[fnName]; - if (typeof fakeImpl === `undefined`) - continue; - setupFn(patchedFs, origName, fakeImpl.bind(fakeFs)); - } - patchedFs.realpathSync.native = patchedFs.realpathSync; - } - { - const patchedFsPromises = patchedFs.promises; - for (const fnName of ASYNC_IMPLEMENTATIONS) { - const origName = fnName.replace(/Promise$/, ``); - if (typeof patchedFsPromises[origName] === `undefined`) - continue; - const fakeImpl = fakeFs[fnName]; - if (typeof fakeImpl === `undefined`) - continue; - if (fnName === `open`) - continue; - setupFn(patchedFsPromises, origName, (pathLike, ...args) => { - if (pathLike instanceof FileHandle) { - return pathLike[origName].apply(pathLike, args); - } else { - return fakeImpl.call(fakeFs, pathLike, ...args); - } - }); - } - setupFn(patchedFsPromises, `open`, async (...args) => { - const fd = await fakeFs.openPromise(...args); - return new FileHandle(fd, fakeFs); - }); - } - { - patchedFs.read[nodeUtils.promisify.custom] = async (fd, buffer, ...args) => { - const res = fakeFs.readPromise(fd, buffer, ...args); - return { bytesRead: await res, buffer }; - }; - patchedFs.write[nodeUtils.promisify.custom] = async (fd, buffer, ...args) => { - const res = fakeFs.writePromise(fd, buffer, ...args); - return { bytesWritten: await res, buffer }; - }; - } -} - -let cachedInstance; -let registeredFactory = () => { - throw new Error(`Assertion failed: No libzip instance is available, and no factory was configured`); -}; -function setFactory(factory) { - registeredFactory = factory; -} -function getInstance() { - if (typeof cachedInstance === `undefined`) - cachedInstance = registeredFactory(); - return cachedInstance; -} - -var libzipSync = {exports: {}}; - -(function (module, exports) { -var frozenFs = Object.assign({}, fs__default.default); -var createModule = function() { - var _scriptDir = void 0; - if (typeof __filename !== "undefined") - _scriptDir = _scriptDir || __filename; - return function(createModule2) { - createModule2 = createModule2 || {}; - var Module = typeof createModule2 !== "undefined" ? createModule2 : {}; - var readyPromiseResolve, readyPromiseReject; - Module["ready"] = new Promise(function(resolve, reject) { - readyPromiseResolve = resolve; - readyPromiseReject = reject; - }); - var moduleOverrides = {}; - var key; - for (key in Module) { - if (Module.hasOwnProperty(key)) { - moduleOverrides[key] = Module[key]; - } - } - var scriptDirectory = ""; - function locateFile(path) { - if (Module["locateFile"]) { - return Module["locateFile"](path, scriptDirectory); - } - return scriptDirectory + path; - } - var read_, readBinary; - var nodeFS; - var nodePath; - { - { - scriptDirectory = __dirname + "/"; - } - read_ = function shell_read(filename, binary) { - var ret = tryParseAsDataURI(filename); - if (ret) { - return binary ? ret : ret.toString(); - } - if (!nodeFS) - nodeFS = frozenFs; - if (!nodePath) - nodePath = path__default.default; - filename = nodePath["normalize"](filename); - return nodeFS["readFileSync"](filename, binary ? null : "utf8"); - }; - readBinary = function readBinary2(filename) { - var ret = read_(filename, true); - if (!ret.buffer) { - ret = new Uint8Array(ret); - } - assert(ret.buffer); - return ret; - }; - if (process["argv"].length > 1) { - process["argv"][1].replace(/\\/g, "/"); - } - process["argv"].slice(2); - Module["inspect"] = function() { - return "[Emscripten Module object]"; - }; - } - Module["print"] || console.log.bind(console); - var err = Module["printErr"] || console.warn.bind(console); - for (key in moduleOverrides) { - if (moduleOverrides.hasOwnProperty(key)) { - Module[key] = moduleOverrides[key]; - } - } - moduleOverrides = null; - if (Module["arguments"]) - ; - if (Module["thisProgram"]) - ; - if (Module["quit"]) - ; - var wasmBinary; - if (Module["wasmBinary"]) - wasmBinary = Module["wasmBinary"]; - Module["noExitRuntime"] || true; - if (typeof WebAssembly !== "object") { - abort("no native wasm support detected"); - } - function getValue(ptr, type, noSafe) { - type = type || "i8"; - if (type.charAt(type.length - 1) === "*") - type = "i32"; - switch (type) { - case "i1": - return HEAP8[ptr >> 0]; - case "i8": - return HEAP8[ptr >> 0]; - case "i16": - return LE_HEAP_LOAD_I16((ptr >> 1) * 2); - case "i32": - return LE_HEAP_LOAD_I32((ptr >> 2) * 4); - case "i64": - return LE_HEAP_LOAD_I32((ptr >> 2) * 4); - case "float": - return LE_HEAP_LOAD_F32((ptr >> 2) * 4); - case "double": - return LE_HEAP_LOAD_F64((ptr >> 3) * 8); - default: - abort("invalid type for getValue: " + type); - } - return null; - } - var wasmMemory; - var ABORT = false; - function assert(condition, text) { - if (!condition) { - abort("Assertion failed: " + text); - } - } - function getCFunc(ident) { - var func = Module["_" + ident]; - assert( - func, - "Cannot call unknown function " + ident + ", make sure it is exported" - ); - return func; - } - function ccall(ident, returnType, argTypes, args, opts) { - var toC = { - string: function(str) { - var ret2 = 0; - if (str !== null && str !== void 0 && str !== 0) { - var len = (str.length << 2) + 1; - ret2 = stackAlloc(len); - stringToUTF8(str, ret2, len); - } - return ret2; - }, - array: function(arr) { - var ret2 = stackAlloc(arr.length); - writeArrayToMemory(arr, ret2); - return ret2; - } - }; - function convertReturnValue(ret2) { - if (returnType === "string") - return UTF8ToString(ret2); - if (returnType === "boolean") - return Boolean(ret2); - return ret2; - } - var func = getCFunc(ident); - var cArgs = []; - var stack = 0; - if (args) { - for (var i = 0; i < args.length; i++) { - var converter = toC[argTypes[i]]; - if (converter) { - if (stack === 0) - stack = stackSave(); - cArgs[i] = converter(args[i]); - } else { - cArgs[i] = args[i]; - } - } - } - var ret = func.apply(null, cArgs); - ret = convertReturnValue(ret); - if (stack !== 0) - stackRestore(stack); - return ret; - } - function cwrap(ident, returnType, argTypes, opts) { - argTypes = argTypes || []; - var numericArgs = argTypes.every(function(type) { - return type === "number"; - }); - var numericRet = returnType !== "string"; - if (numericRet && numericArgs && !opts) { - return getCFunc(ident); - } - return function() { - return ccall(ident, returnType, argTypes, arguments); - }; - } - var UTF8Decoder = new TextDecoder("utf8"); - function UTF8ToString(ptr, maxBytesToRead) { - if (!ptr) - return ""; - var maxPtr = ptr + maxBytesToRead; - for (var end = ptr; !(end >= maxPtr) && HEAPU8[end]; ) - ++end; - return UTF8Decoder.decode(HEAPU8.subarray(ptr, end)); - } - function stringToUTF8Array(str, heap, outIdx, maxBytesToWrite) { - if (!(maxBytesToWrite > 0)) - return 0; - var startIdx = outIdx; - var endIdx = outIdx + maxBytesToWrite - 1; - for (var i = 0; i < str.length; ++i) { - var u = str.charCodeAt(i); - if (u >= 55296 && u <= 57343) { - var u1 = str.charCodeAt(++i); - u = 65536 + ((u & 1023) << 10) | u1 & 1023; - } - if (u <= 127) { - if (outIdx >= endIdx) - break; - heap[outIdx++] = u; - } else if (u <= 2047) { - if (outIdx + 1 >= endIdx) - break; - heap[outIdx++] = 192 | u >> 6; - heap[outIdx++] = 128 | u & 63; - } else if (u <= 65535) { - if (outIdx + 2 >= endIdx) - break; - heap[outIdx++] = 224 | u >> 12; - heap[outIdx++] = 128 | u >> 6 & 63; - heap[outIdx++] = 128 | u & 63; - } else { - if (outIdx + 3 >= endIdx) - break; - heap[outIdx++] = 240 | u >> 18; - heap[outIdx++] = 128 | u >> 12 & 63; - heap[outIdx++] = 128 | u >> 6 & 63; - heap[outIdx++] = 128 | u & 63; - } - } - heap[outIdx] = 0; - return outIdx - startIdx; - } - function stringToUTF8(str, outPtr, maxBytesToWrite) { - return stringToUTF8Array(str, HEAPU8, outPtr, maxBytesToWrite); - } - function lengthBytesUTF8(str) { - var len = 0; - for (var i = 0; i < str.length; ++i) { - var u = str.charCodeAt(i); - if (u >= 55296 && u <= 57343) - u = 65536 + ((u & 1023) << 10) | str.charCodeAt(++i) & 1023; - if (u <= 127) - ++len; - else if (u <= 2047) - len += 2; - else if (u <= 65535) - len += 3; - else - len += 4; - } - return len; - } - function allocateUTF8(str) { - var size = lengthBytesUTF8(str) + 1; - var ret = _malloc(size); - if (ret) - stringToUTF8Array(str, HEAP8, ret, size); - return ret; - } - function writeArrayToMemory(array, buffer2) { - HEAP8.set(array, buffer2); - } - function alignUp(x, multiple) { - if (x % multiple > 0) { - x += multiple - x % multiple; - } - return x; - } - var buffer, HEAP8, HEAPU8; - var HEAP_DATA_VIEW; - function updateGlobalBufferAndViews(buf) { - buffer = buf; - Module["HEAP_DATA_VIEW"] = HEAP_DATA_VIEW = new DataView(buf); - Module["HEAP8"] = HEAP8 = new Int8Array(buf); - Module["HEAP16"] = new Int16Array(buf); - Module["HEAP32"] = new Int32Array(buf); - Module["HEAPU8"] = HEAPU8 = new Uint8Array(buf); - Module["HEAPU16"] = new Uint16Array(buf); - Module["HEAPU32"] = new Uint32Array(buf); - Module["HEAPF32"] = new Float32Array(buf); - Module["HEAPF64"] = new Float64Array(buf); - } - Module["INITIAL_MEMORY"] || 16777216; - var wasmTable; - var __ATPRERUN__ = []; - var __ATINIT__ = []; - var __ATPOSTRUN__ = []; - function preRun() { - if (Module["preRun"]) { - if (typeof Module["preRun"] == "function") - Module["preRun"] = [Module["preRun"]]; - while (Module["preRun"].length) { - addOnPreRun(Module["preRun"].shift()); - } - } - callRuntimeCallbacks(__ATPRERUN__); - } - function initRuntime() { - callRuntimeCallbacks(__ATINIT__); - } - function postRun() { - if (Module["postRun"]) { - if (typeof Module["postRun"] == "function") - Module["postRun"] = [Module["postRun"]]; - while (Module["postRun"].length) { - addOnPostRun(Module["postRun"].shift()); - } - } - callRuntimeCallbacks(__ATPOSTRUN__); - } - function addOnPreRun(cb) { - __ATPRERUN__.unshift(cb); - } - function addOnInit(cb) { - __ATINIT__.unshift(cb); - } - function addOnPostRun(cb) { - __ATPOSTRUN__.unshift(cb); - } - var runDependencies = 0; - var dependenciesFulfilled = null; - function addRunDependency(id) { - runDependencies++; - if (Module["monitorRunDependencies"]) { - Module["monitorRunDependencies"](runDependencies); - } - } - function removeRunDependency(id) { - runDependencies--; - if (Module["monitorRunDependencies"]) { - Module["monitorRunDependencies"](runDependencies); - } - if (runDependencies == 0) { - if (dependenciesFulfilled) { - var callback = dependenciesFulfilled; - dependenciesFulfilled = null; - callback(); - } - } - } - Module["preloadedImages"] = {}; - Module["preloadedAudios"] = {}; - function abort(what) { - if (Module["onAbort"]) { - Module["onAbort"](what); - } - what += ""; - err(what); - ABORT = true; - what = "abort(" + what + "). Build with -s ASSERTIONS=1 for more info."; - var e = new WebAssembly.RuntimeError(what); - readyPromiseReject(e); - throw e; - } - var dataURIPrefix = "data:application/octet-stream;base64,"; - function isDataURI(filename) { - return filename.startsWith(dataURIPrefix); - } - var wasmBinaryFile = "data:application/octet-stream;base64,AGFzbQEAAAAB/wEkYAN/f38Bf2ABfwF/YAJ/fwF/YAF/AGAEf39/fwF/YAN/f38AYAV/f39/fwF/YAJ/fwBgBH9/f38AYAABf2AFf39/fn8BfmAEf35/fwF/YAR/f35/AX5gAn9+AX9gA398fwBgA39/fgF/YAF/AX5gBn9/f39/fwF/YAN/fn8Bf2AEf39/fwF+YAV/f35/fwF/YAR/f35/AX9gA39/fgF+YAJ/fgBgAn9/AX5gBX9/f39/AGADf35/AX5gBX5+f35/AX5gA39/fwF+YAZ/fH9/f38Bf2AAAGAHf35/f39+fwF/YAV/fn9/fwF/YAV/f39/fwF+YAJ+fwF/YAJ/fAACJQYBYQFhAAMBYQFiAAEBYQFjAAABYQFkAAEBYQFlAAIBYQFmAAED5wHlAQMAAwEDAwEHDAgDFgcNEgEDDRcFAQ8DEAUQAwIBAhgECxkEAQMBBQsFAwMDARACBAMAAggLBwEAAwADGgQDGwYGABwBBgMTFBEHBwcVCx4ABAgHBAICAgAfAQICAgIGFSAAIQAiAAIBBgIHAg0LEw0FAQUCACMDAQAUAAAGBQECBQUDCwsSAgEDBQIHAQEICAACCQQEAQABCAEBCQoBAwkBAQEBBgEGBgYABAIEBAQGEQQEAAARAAEDCQEJAQAJCQkBAQECCgoAAAMPAQEBAwACAgICBQ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AKAJoIgRqayECIAEgBmogBE0EQCAAKAJIIgEgASADaiADEAcaAkAgAyAAKAJsIgFNBEAgACABIANrNgJsDAELIABCADcCbAsgACAAKAJoIANrIgE2AmggACAAKAJYIANrNgJYIAEgACgChC5JBEAgACABNgKELgsgAEH8gAEoAgARAwAgAiADaiECCwJAIAAoAgAiASgCBCIERQ0AIAAoAjwhBSAAIAIgBCACIARJGyICBH8gACgCSCAAKAJoaiAFaiEFIAEgBCACazYCBAJAAkACQAJAIAEoAhwiBCgCFEEBaw4CAQACCyAEQaABaiAFIAEoAgAgAkHcgAEoAgARCAAMAgsgASABKAIwIAUgASgCACACQcSAASgCABEEADYCMAwBCyAFIAEoAgAgAhAHGgsgASABKAIAIAJqNgIAIAEgASgCCCACajYCCCAAKAI8BSAFCyACaiICNgI8AkAgACgChC4iASACakEDSQ0AIAAoAmggAWshAQJAIAAoAnRBgQhPBEAgACAAIAAoAkggAWoiAi0AACACLQABIAAoAnwRAAA2AlQMAQsgAUUNACAAIAFBAWsgACgChAERAgAaCyAAKAKELiAAKAI8IgJBAUZrIgRFDQAgACABIAQgACgCgAERBQAgACAAKAKELiAEazYChC4gACgCPCECCyACQYUCSw0AIAAoAgAoAgRFDQAgACgCMCEBDAELCwJAIAAoAkQiAiAAKAJAIgNNDQAgAAJ/IAAoAjwgACgCaGoiASADSwRAIAAoAkggAWpBACACIAFrIgNBggIgA0GCAkkbIgMQGSABIANqDAELIAFBggJqIgEgA00NASAAKAJIIANqQQAgAiADayICIAEgA2siAyACIANJGyIDEBkgACgCQCADags2AkALC50CAQF/AkAgAAJ/IAAoAqAuIgFBwABGBEAgACgCBCAAKAIQaiAAKQOYLjcAACAAQgA3A5guIAAgACgCEEEIajYCEEEADAELIAFBIE4EQCAAKAIEIAAoAhBqIAApA5guPgAAIAAgAEGcLmo1AgA3A5guIAAgACgCEEEEajYCECAAIAAoAqAuQSBrIgE2AqAuCyABQRBOBEAgACgCBCAAKAIQaiAAKQOYLj0AACAAIAAoAhBB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BADYCJAsLbgACQAJAAkAgA0IQVA0AIAJFDQECfgJAAkACQCACKAIIDgMCAAEECyACKQMAIAB8DAILIAIpAwAgAXwMAQsgAikDAAsiA0IAUw0AIAEgA1oNAgsgBARAIARBADYCBCAEQRI2AgALC0J/IQMLIAMLggICAX8CfgJAQQEgAiADGwRAIAIgA2oQCSIFRQRAIAQEQCAEQQA2AgQgBEEONgIAC0EADwsgAq0hBgJAAkAgAARAIAAgBhATIgBFBEAgBARAIARBADYCBCAEQQ42AgALDAULIAUgACACEAcaIAMNAQwCCyABIAUgBhARIgdCf1cEQCAEBEAgBCABKAIMNgIAIAQgASgCEDYCBAsMBAsgBiAHVQRAIAQEQCAEQQA2AgQgBEERNgIACwwECyADRQ0BCyACIAVqIgBBADoAACACQQFIDQAgBSECA0AgAi0AAEUEQCACQSA6AAALIAJBAWoiAiAASQ0ACwsLIAUPCyAFEAZBAAuBAQEBfwJAIAAEQCADQYAGcSEFQQAhAwNAAkAgAC8BCCACRw0AIAUgACgCBHFFDQAgA0EATg0DIANBAWohAwsgACgCACIADQALCyAEBEAgBEEANgIEIARBCTYCAAtBAA8LIAEEQCABIAAvAQo7AQALIAAvAQpFBEBBwBQPCyAAKAIMC1cBAX9BEBAJIgNFBEBBAA8LIAMgATsBCiADIAA7AQggA0GABjYCBCADQQA2AgACQCABBEAgAyACIAEQYyIANgIMIAANASADEAZBAA8LIANBADYCDAsgAwvuBQIEfwV+IwBB4ABrIgQkACAEQQhqIgNCADcDICADQQA2AhggA0L/////DzcDECADQQA7AQwgA0G/hig2AgggA0EBOgAGIANBADsBBCADQQA2AgAgA0IANwNIIANBgIDYjXg2AkQgA0IANwMoIANCADcDMCADQgA3AzggA0FAa0EAOwEAIANCADcDUCABKQMIUCIDRQRAIAEoAgAoAgApA0ghBwsCfgJAIAMEQCAHIQkMAQsgByEJA0AgCqdBBHQiBSABKAIAaigCACIDKQNIIgggCSAIIAlUGyIJIAEpAyBWBEAgAgRAIAJBADYCBCACQRM2AgALQn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ERQ0HDAELCyAEQSBxBEAgB0G//gA2AgQgASECDAgLIAdB0f4ANgIEIABB0A42AhggASECDAcLIB1BfyAGdEF/c62DIBt8IhunIQUgCCAEQQ9xIgNrIQggGiAErUIPg4ghHSABIBdrIgYgAjMBAiAaQX8gA3RBf3Otg3ynIgRPDQIgBCAGayIGIBlNDQEgBygCjEdFDQEgB0HR/gA2AgQgAEG5DDYCGAsgASECIAshBQwFCwJAIA5FBEAgDCARIAZraiEDDAELIAYgDk0EQCAMIA4gBmtqIQMMAQsgDCARIAYgDmsiBmtqIQMgBSAGTQ0AIAUgBmshBQJAAkAgASADTSABIA8gAWusIhogBq0iGyAaIBtUGyIapyIGaiICIANLcQ0AIAMgBmogAUsgASADT3ENACABIAMgBhAHGiACIQEMAQsgASADIAMgAWsiASABQR91IgFqIAFzIgIQByACaiEBIBogAq0iHn0iHFANACACIANqIQIDQAJAIBwgHiAcIB5UGyIbQiBUBEAgGyEaDAELIBsiGkIgfSIgQgWIQgF8QgODIh9QRQRAA0AgASACKQAANwAAIAEgAikAGDcAGCABIAIpABA3ABAgASACKQAINwAIIBpCIH0hGiACQSBqIQIgAUEgaiEBIB9CAX0iH0IAUg0ACwsgIELgAFQNAANAIAEgAikAADcAACABIAIpABg3ABggASACKQAQNwAQIAEgAikACDcACCABIAIpADg3ADggASACKQAwNwAwIAEgAikAKDcAKCABIAIpACA3ACAgASACKQBYNwBYIAEgAikAUDcAUCABIAIpAEg3AEggASACKQBANwBAIAEgAikAYDcAYCABIAIpAGg3AGggASACKQBwNwBwIAEgAikAeDcAeCACQYABaiECIAFBgAFqIQEgGkKAAX0iGkIfVg0ACwsgGkIQWgRAIAEgAikAADcAACABIAIpAAg3AAggGkIQfSEaIAJBEGohAiABQRBqIQELIBpCCFoEQCABIAIpAAA3AAAgGkIIfSEaIAJBCGohAiABQQhqIQELIBpCBFoEQCABIAIoAAA2AAAgGkIEfSEaIAJBBGohAiABQQRqIQELIBpCAloEQCABIAIvAAA7AAAgGkICfSE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hBCABIANLDQELC0EAIANrIQULIAIgBWohBAJAIAUgDyACa6wiGiABrSIbIBogG1QbIhqnIgFIIAVBf0pxDQAgBUEBSCABIARqIAJLcQ0AIAIgBCABEAcgAWohAgwDCyACIAQgAyADQR91IgFqIAFzIgEQByABaiECIBogAa0iHn0iHFANAiABIARqIQEDQAJAIBwgHiAcIB5UGyIbQiBUBEAgGyEaDAELIBsiGkIgfSIgQgWIQgF8QgODIh9QRQRAA0AgAiABKQAANwAAIAIgASkAGDcAGCACIAEpABA3ABAgAiABKQAINwAIIBpCIH0hGiABQSBqIQEgAkEgaiECIB9CAX0iH0IAUg0ACwsgIELgAFQNAANAIAIgASkAADcAACACIAEpABg3ABggAiABKQAQNwAQIAIgASkACDcACCACIAEpADg3ADggAiABKQAwNwAwIAIgASkAKDcAKCACIAEpACA3ACAgAiABKQBYNwBYIAIgASkAUDcAUCACIAEpAEg3AEggAiABKQBANwBAIAIgASkAYDcAYCACIAEpAGg3AGggAiABKQBwNwBwIAIgASkAeDcAeCABQYABaiEBIAJBgAFqIQIgGkKAAX0iGkIfVg0ACwsgGkIQWgRAIAIgASkAADcAACACIAEpAAg3AAggGkIQfSEaIAJBEGohAiABQRBqIQELIBpCCFoEQCACIAEpAAA3AAAgGkIIfSEaIAJBCGohAiABQQhqIQELIBpCBFoEQCACIAEoAAA2AAAgGkIEfSEaIAJBBGohAiABQQRqIQELIBpCAloEQCACIAEvAAA7AAAgGkICfSEaIAJBAmohAiABQQJqIQELIBwgG30hHCAaUEUEQCACIAEtAAA6AAAgAkEBaiECIAFBAWohAQsgHFBFDQALDAILAkAgASADTSABIA8gAWusIhogBa0iGyAaIBtUGyIapyIEaiICIANLcQ0AIAMgBGogAUsgASADT3ENACABIAMgBBAHGgwCCyABIAMgAyABayIBIAFBH3UiAWogAXMiARAHIAFqIQIgGiABrSIefSIcUA0BIAEgA2ohAQNAAkAgHCAeIBwgHlQbIhtCIFQEQCAbIRoMAQsgGyIaQiB9IiBCBYhCAXxCA4MiH1BFBEADQCACIAEpAAA3AAAgAiABKQAYNwAYIAIgASkAEDcAECACIAEpAAg3AAggGkIgfSEaIAFBIGohASACQSBqIQIgH0IBfSIfQgBSDQALCyAgQuAAVA0AA0AgAiABKQAANwAAIAIgASkAGDcAGCACIAEpABA3ABAgAiABKQAINwAIIAIgASkAODcAOCACIAEpADA3ADAgAiABKQAoNwAoIAIgASkAIDcAICACIAEpAFg3AFggAiABKQBQNwBQIAIgASkASDcASCACIAEpAEA3AEAgAiABKQBgNwBgIAIgASkAaDcAaCACIAEpAHA3AHAgAiABKQB4NwB4IAFBgAFqIQEgAkGAAWohAiAaQoABfSIaQh9WDQALCyAaQhBaBEAgAiABKQAANwAAIAIgASkACDcACCAaQhB9IRogAkEQaiECIAFBEGohAQsgGkIIWgRAIAIgASkAADcAACAaQgh9IRogAkEIaiECIAFBCGohAQsgGkIEWgRAIAIgASgAADYAACAaQgR9IRogAkEEaiECIAFBBGohAQsgGkICWgRAIAIgAS8AADsAACAaQgJ9IRogAkECaiECIAFBAmohAQsgHCAbfSEcIBpQRQRAIAIgAS0AADoAACACQQFqIQIgAUEBaiEBCyAcUEUNAAsMAQsCQAJAIBYEQAJAIAQgBUkEQCAHKAKYRyAESw0BCyABIARrIQMCQEEAIARrIgVBf0ogDyABa6wiGiAbIBogG1QbIhqnIgIgBUpxDQAgBUEBSCACIANqIAFLcQ0AIAEgAyACEAcgAmohAgwFCyABIAMgBCAEQR91IgFqIAFzIgEQByABaiECIBogAa0iHn0iHFANBCABIANqIQEDQAJAIBwgHiAcIB5UGyIbQiBUBEAgGyEaDAELIBsiGkIgfSIgQgWIQgF8QgODIh9QRQRAA0AgAiABKQAANwAAIAIgASkAGDcAGCACIAEpABA3ABAgAiABKQAINwAIIBpCIH0hGiABQSBqIQEgAkEgaiECIB9CAX0iH0IAUg0ACwsgIELgAFQNAANAIAIgASkAADcAACACIAEpABg3ABggAiABKQAQNwAQIAIgASkACDcACCACIAEpADg3ADggAiABKQAwNwAwIAIg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YgA0EHayEFIAJBAWohAgJAIAFBB2oiCkEHcUUNACAFRQ0AIAEgAi0AADoAByAJQQdrIQYgA0EIayEDIAFBCGohASACQQFqIQIMBgsgCiEBIAUhAwwFCyAKIQEgBSEDDAQLIAohASAFIQMMAwsgCiEBIAUhAwwCCyAKIQEgBSEDDAELIAohASAFIQMLAkACQCAGQRdNBEAgA0UNASADQQFrIQUgA0EHcSIEBEADQCABIAItAAA6AAAgA0EBayEDIAFBAWohASACQQFqIQIgBEEBayIEDQALCyAFQQdJDQEDQCABIAItAAA6AAAgASACLQABOgABIAEgAi0AAjoAAiABIAItAAM6AAMgASACLQAEOgAEIAEgAi0ABToABSABIAItAAY6AAYgASACLQAHOgAHIAFBCGohASACQQhqIQIgA0EIayIDDQALDAELIAMNAQsgASECDAELIAEgBCADED8hAgsgCyEFDAELIAEgAy0AAjoAACABQQFqIQILIAUgFE8NACACIBNJDQELCyAAIAI2AgwgACAFIAhBA3ZrIgE2AgAgACATIAJrQYMCajYCECAAIBQgAWtBDmo2AgQgByAIQQdxIgA2AogBIAcgHUJ/IACthkJ/hYM+AoQBC+cFAQR/IAMgAiACIANLGyEEIAAgAWshAgJAIABBB3FFDQAgBEUNACAAIAItAAA6AAAgA0EBayEGIAJBAWohAiAAQQFqIgdBB3FBACAEQQFrIgUbRQRAIAchACAFIQQgBiEDDAELIAAgAi0AADoAASADQQJrIQYgBEECayEFIAJBAWohAgJAIABBAmoiB0EHcUUNACAFRQ0AIAAgAi0AADoAAiADQQNrIQYgBEEDayEFIAJBAWohAgJAIABBA2oiB0EHcUUNACAFRQ0AIAAgAi0AADoAAyADQQRrIQYgBEEEayEFIAJBAWohAgJAIABBBGoiB0EHcUUNACAFRQ0AIAAgAi0AADoABCADQQVrIQYgBEEFayEFIAJBAWohAgJAIABBBWoiB0EHcUUNACAFRQ0AIAAgAi0AADoABSADQQZrIQYgBEEGayEFIAJBAWohAgJAIABBBmoiB0EHcUUNACAFRQ0AIAAgAi0AADoABiADQQdrIQY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tAAAEfiADKQMQBUIAC6dB//8DcSADKAIEEEcLIQUgAxAICyAEQRBqJAAgBQvgAQICfwF+QTAQCSICRQRAIAEEQCABQQA2AgQgAUEONgIAC0EADwsgAkIANwMIIAJBADYCACACQgA3AxAgAkIANwMYIAJCADcDICACQgA3ACUgAFAEQCACDwsCQCAAQv////8AVg0AIACnQQR0EAkiA0UNACACIAM2AgBBACEBQgEhBANAIAMgAUEEdGoiAUIANwIAIAFCADcABSAAIARSBEAgBKchASAEQgF8IQQMAQsLIAIgADcDCCACIAA3AxAgAg8LIAEEQCABQQA2AgQgAUEONgIAC0EAEBAgAhAGQQAL7gECA38BfiMAQRBrIgQkAAJAIARBDGpCBBAXIgNFBEBBfyECDAELAkAgAQRAIAJBgAZxIQUDQAJAIAUgASgCBHFFDQACQCADKQMIQgBUBEAgA0EAOgAADAELIANCADcDECADQQE6AAALIAMgAS8BCBANIAMgAS8BChANIAMtAABFBEAgAEEIaiIABEAgAEEANgIEIABBFDYCAAtBfyECDAQLQX8hAiAAIARBDGpCBBAbQQBIDQMgATMBCiIGUA0AIAAgASgCDCAGEBtBAEgNAwsgASgCACIBDQALC0EAIQILIAMQCAsgBEEQaiQAIAILPAEBfyAABEAgAUGABnEhAQNAIAEgACgCBHEEQCACIAAvAQpqQQRqIQILIAAoAgAiAA0ACwsgAkH//wNxC5wBAQN/IABFBEBBAA8LIAAhAwNAAn8CQAJAIAAvAQgiAUH04AFNBEAgAUEBRg0BIAFB9cYBRg0BDAILIAFBgbICRg0AIAFB9eABRw0BCyAAKAIAIQEgAEEANgIAIAAoAgwQBiAAEAYgASADIAAgA0YbIQMCQCACRQRAQQAhAgwBCyACIAE2AgALIAEMAQsgACICKAIACyIADQALIAMLsgQCBX8BfgJAAkACQCAAIAGtEBciAQRAIAEtAAANAUEAIQAMAgsgBARAIARBADYCBCAEQQ42AgALQQAPC0EAIQADQCABLQAABH4gASkDCCABKQMQfQVCAAtCBFQNASABEAwhByABIAEQDCIGrRATIghFBEBBACEC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jYCCAtCfwteAQF/IwBBEGsiAiQAAn8gACgCJEEBRwRAIABBDGoiAARAIABBADYCBCAAQRI2AgALQX8MAQsgAkEANgIIIAIgATcDACAAIAJCEEEMEA5CP4enCyEAIAJBEGokACAAC9oDAQZ/IwBBEGsiBSQAIAUgAjYCDCMAQaABayIEJAAgBEEIakHA8ABBkAEQBxogBCAANgI0IAQgADYCHCAEQX4gAGsiA0H/////ByADQf////8HSRsiBjYCOCAEIAAgBmoiADYCJCAEIAA2AhggBEEIaiEAIwBB0AFrIgMkACADIAI2AswBIANBoAFqQQBBKBAZIAMgAygCzAE2AsgBAkBBACABIANByAFqIANB0ABqIANBoAFqEEpBAEgNACAAKAJMQQBOIQcgACgCACECIAAsAEpBAEwEQCAAIAJBX3E2AgALIAJBIHEhCAJ/IAAoAjAEQCAAIAEgA0HIAWogA0HQAGogA0GgAWoQSgwBCyAAQdAANgIwIAAgA0HQAGo2AhAgACADNgIcIAAgAzYCFCAAKAIsIQIgACADNgIsIAAgASADQcgBaiADQdAAaiADQaABahBKIAJFDQAaIABBAEEAIAAoAiQRAAAaIABBADYCMCAAIAI2AiwgAEEANgIcIABBADYCECAAKAIUGiAAQQA2AhRBAAsaIAAgACgCACAIcjYCACAHRQ0ACyADQdABaiQAIAYEQCAEKAIcIgAgACAEKAIYRmtBADoAAAsgBEGgAWokACAFQRBqJAALUwEDfwJAIAAoAgAsAABBMGtBCk8NAANAIAAoAgAiAiwAACEDIAAgAkEBajYCACABIANqQTBrIQEgAiwAAUEwa0EKTw0BIAFBCmwhAQwACwALIAELuwIAAkAgAUEUSw0AAkACQAJAAkACQAJAAkACQAJAAkAgAUEJaw4KAAECAwQFBgcICQoLIAIgAigCACIBQQRqNgIAIAAgASgCADYCAA8LIAIgAigCACIBQQRqNgIAIAAgATQCADcDAA8LIAIgAigCACIBQQRqNgIAIAAgATUCADcDAA8LIAIgAigCAEEHakF4cSIBQQhqNgIAIAAgASkDADcDAA8LIAIgAigCACIBQQRqNgIAIAAgAT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gC4gBEH9zgBqLQAAQQJ0IANqQegJaiIBIAEvAQBBAWo7AQAgA0GAywAtAABBAnRqQdgTaiIBIAEvAQBBAWo7AQAgAyADKAI8IARrNgI8IAMgAygCaCAEaiIENgJoCyADKALwLSADKAL0LUcNAUEAIQggAyADKAJYIgFBAE4EfyADKAJIIAFqBUEACyAEIAFrQQAQDyADIAMoAmg2AlggAygCABAKIAMoAgAoAhANAQwCCwsgA0EANgKELiAKQQRGBEAgAyADKAJYIgFBAE4EfyADKAJIIAFqBUEACyADKAJoIAFrQQEQDyADIAMoAmg2AlggAygCABAKQQNBAiADKAIAKAIQGwwCCyADKALwLQRAQQAhCCADIAMoAlgiAUEATgR/IAMoAkggAWoFQQALIAMoAmggAWtBABAPIAMgAygCaDYCWCADKAIAEAogAygCACgCEEUNAQtBASEICyAICwwBCyADIAogAUEMbEG42ABqKAIAEQIACyIBQX5xQQJGBEAgA0GaBTYCIAsgAUF9cUUEQEEAIQQgBSgCEA0CDAQLIAFBAUcNAAJAAkACQCAKQQFrDgUAAQEBAgELIAMpA5guISICfwJ+IAMoAqAuIgFBA2oiCUE/TQRAQgIgAa2GICKEDAELIAFBwABGBEAgAygCBCADKAIQaiAiNwAAIAMgAygCEEEIajYCEEICISJBCgwCCyADKAIEIAMoAhBqQgIgAa2GICKENwAAIAMgAygCEEEIajYCECABQT1rIQlCAkHAACABa62ICyEiIAlBB2ogCUE5SQ0AGiADKAIEIAMoAhBqICI3AAAgAyADKAIQQQhqNgIQQgAhIiAJQTlrCyEBIAMgIjcDmC4gAyABNgKgLiADEDAMAQsgA0EAQQBBABA5IApBA0cNACADKAJQQQBBgIAIEBkgAygCPA0AIANBADYChC4gA0EANgJYIANBADYCaAsgBRAKIAUoAhANAAwDC0EAIQQgCkEERw0AAkACfwJAAkAgAygCFEEBaw4CAQADCyAFIANBoAFqQeCAASgCABEBACIBNgIwIAMoAgQgAygCEGogATYAACADIAMoAhBBBGoiATYCECADKAIEIAFqIQQgBSgCCAwBCyADKA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OCABIAIoAiAgAigCKEGAgAJBAhAoNgJIIAEgAigCICACKAIoIAEoAjBBAhAoIgM2AkwgA0EAIAEoAjBBAXQQGSACKAIgIAIoAihBgIAEQQIQKCEDIAFBgIACNgLoLSABQQA2AkAgASADNgJQIAEgAigCICACKAIoQYCAAkEEECgiAzYCBCABIAEoAugtIgRBAnQ2AgwCQAJAIAEoAkhFDQAgASgCTEUNACABKAJQRQ0AIAMNAQsgAUGaBTYCICACQejAACgCADYCGCACEIQBGkF8DAILIAFBADYCjAEgASAFNgKIASABQgA3AyggASADIARqNgLsLSABIARBA2xBA2s2AvQtQX4hAwJAIAJFDQAgAigCIEUNACACKAIkRQ0AIAIoAhwiAUUNACABKAIAIAJHDQACQAJAIAEoAiAiBEE5aw45AQICAgICAgICAgICAQICAgECAgICAgICAgICAgICAgICAgECAgICAgICAgICAgECAgICAgICAgIBAAsgBEGaBUYNACAEQSpHDQELIAJBAjYCLCACQQA2AgggAkIANwIUIAFBADYCECABIAEoAgQ2AgggASgCFCIDQX9MBEAgAUEAIANrIgM2AhQLIAFBOUEqIANBAkYbNgIgIAIgA0ECRgR/IAFBoAFqQeSAASgCABEBAAVBAQs2AjAgAUF+NgIkIAFBADYCoC4gAUIANwOYLiABQYgXakGg0wA2AgAgASABQcwVajYCgBcgAUH8FmpBjNMANgIAIAEgAUHYE2o2AvQWIAFB8BZqQfjSADYCACABIAFB5AFqNgLoFiABEIgBQQAhAwsgAw0AIAIoAhwiAiACKAIwQQF0NgJEQQAhAyACKAJQQQBBgIAIEBkgAiACKAKIASIEQQxsIgFBtNgAai8BADYClAEgAiABQbDYAGovAQA2ApABIAIgAUGy2ABqLwEANgJ4IAIgAUG22ABqLwEANgJ0QfiAASgCACEFQeyAASgCACEGQYCBASgCACEBIAJCADcCbCACQgA3AmQgAkEANgI8IAJBADYChC4gAkIANwJUIAJBKSABIARBCUYiARs2AnwgAkEqIAYgARs2AoABIAJBKyAFIAEbNgKEAQsgAwsFQXoLDAELAn9BekHrDC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AAAIQAAACIAAAAjAAAAgERQADEAAAAyAAAAMwAAADQAAAA1AAAANgAAADcAAAA4AAAAOQAAADIAAAAzAAAANAAAADUAAAA2AAAANwAAADgAQfSCAQsCXEQAQbCDAQsQ/////////////////////w=="; - if (!isDataURI(wasmBinaryFile)) { - wasmBinaryFile = locateFile(wasmBinaryFile); - } - function getBinary(file) { - try { - if (file == wasmBinaryFile && wasmBinary) { - return new Uint8Array(wasmBinary); - } - var binary = tryParseAsDataURI(file); - if (binary) { - return binary; - } - if (readBinary) { - return readBinary(file); - } else { - throw "sync fetching of the wasm failed: you can preload it to Module['wasmBinary'] manually, or emcc.py will do that for you when generating HTML (but not JS)"; - } - } catch (err2) { - abort(err2); - } - } - function instantiateSync(file, info) { - var instance; - var module2; - var binary; - try { - binary = getBinary(file); - module2 = new WebAssembly.Module(binary); - instance = new WebAssembly.Instance(module2, info); - } catch (e) { - var str = e.toString(); - err("failed to compile wasm module: " + str); - if (str.includes("imported Memory") || str.includes("memory import")) { - err( - "Memory size incompatibility issues may be due to changing INITIAL_MEMORY at runtime to something too large. Use ALLOW_MEMORY_GROWTH to allow any size memory (and also make sure not to set INITIAL_MEMORY at runtime to something smaller than it was at compile time)." - ); - } - throw e; - } - return [instance, module2]; - } - function createWasm() { - var info = { a: asmLibraryArg }; - function receiveInstance(instance, module2) { - var exports3 = instance.exports; - Module["asm"] = exports3; - wasmMemory = Module["asm"]["g"]; - updateGlobalBufferAndViews(wasmMemory.buffer); - wasmTable = Module["asm"]["W"]; - addOnInit(Module["asm"]["h"]); - removeRunDependency(); - } - addRunDependency(); - if (Module["instantiateWasm"]) { - try { - var exports2 = Module["instantiateWasm"](info, receiveInstance); - return exports2; - } catch (e) { - err("Module.instantiateWasm callback failed with error: " + e); - return false; - } - } - var result = instantiateSync(wasmBinaryFile, info); - receiveInstance(result[0]); - return Module["asm"]; - } - function LE_HEAP_LOAD_F32(byteOffset) { - return HEAP_DATA_VIEW.getFloat32(byteOffset, true); - } - function LE_HEAP_LOAD_F64(byteOffset) { - return HEAP_DATA_VIEW.getFloat64(byteOffset, true); - } - function LE_HEAP_LOAD_I16(byteOffset) { - return HEAP_DATA_VIEW.getInt16(byteOffset, true); - } - function LE_HEAP_LOAD_I32(byteOffset) { - return HEAP_DATA_VIEW.getInt32(byteOffset, true); - } - function LE_HEAP_STORE_I32(byteOffset, value) { - HEAP_DATA_VIEW.setInt32(byteOffset, value, true); - } - function callRuntimeCallbacks(callbacks) { - while (callbacks.length > 0) { - var callback = callbacks.shift(); - if (typeof callback == "function") { - callback(Module); - continue; - } - var func = callback.func; - if (typeof func === "number") { - if (callback.arg === void 0) { - wasmTable.get(func)(); - } else { - wasmTable.get(func)(callback.arg); - } - } else { - func(callback.arg === void 0 ? null : callback.arg); - } - } - } - function _gmtime_r(time, tmPtr) { - var date = new Date(LE_HEAP_LOAD_I32((time >> 2) * 4) * 1e3); - LE_HEAP_STORE_I32((tmPtr >> 2) * 4, date.getUTCSeconds()); - LE_HEAP_STORE_I32((tmPtr + 4 >> 2) * 4, date.getUTCMinutes()); - LE_HEAP_STORE_I32((tmPtr + 8 >> 2) * 4, date.getUTCHours()); - LE_HEAP_STORE_I32((tmPtr + 12 >> 2) * 4, date.getUTCDate()); - LE_HEAP_STORE_I32((tmPtr + 16 >> 2) * 4, date.getUTCMonth()); - LE_HEAP_STORE_I32((tmPtr + 20 >> 2) * 4, date.getUTCFullYear() - 1900); - LE_HEAP_STORE_I32((tmPtr + 24 >> 2) * 4, date.getUTCDay()); - LE_HEAP_STORE_I32((tmPtr + 36 >> 2) * 4, 0); - LE_HEAP_STORE_I32((tmPtr + 32 >> 2) * 4, 0); - var start = Date.UTC(date.getUTCFullYear(), 0, 1, 0, 0, 0, 0); - var yday = (date.getTime() - start) / (1e3 * 60 * 60 * 24) | 0; - LE_HEAP_STORE_I32((tmPtr + 28 >> 2) * 4, yday); - if (!_gmtime_r.GMTString) - _gmtime_r.GMTString = allocateUTF8("GMT"); - LE_HEAP_STORE_I32((tmPtr + 40 >> 2) * 4, _gmtime_r.GMTString); - return tmPtr; - } - function ___gmtime_r(a0, a1) { - return _gmtime_r(a0, a1); - } - function _emscripten_memcpy_big(dest, src, num) { - HEAPU8.copyWithin(dest, src, src + num); - } - function emscripten_realloc_buffer(size) { - try { - wasmMemory.grow(size - buffer.byteLength + 65535 >>> 16); - updateGlobalBufferAndViews(wasmMemory.buffer); - return 1; - } catch (e) { - } - } - function _emscripten_resize_heap(requestedSize) { - var oldSize = HEAPU8.length; - requestedSize = requestedSize >>> 0; - var maxHeapSize = 2147483648; - if (requestedSize > maxHeapSize) { - return false; - } - for (var cutDown = 1; cutDown <= 4; cutDown *= 2) { - var overGrownHeapSize = oldSize * (1 + 0.2 / cutDown); - overGrownHeapSize = Math.min( - overGrownHeapSize, - requestedSize + 100663296 - ); - var newSize = Math.min( - maxHeapSize, - alignUp(Math.max(requestedSize, overGrownHeapSize), 65536) - ); - var replacement = emscripten_realloc_buffer(newSize); - if (replacement) { - return true; - } - } - return false; - } - function _setTempRet0(val) { - } - function _time(ptr) { - var ret = Date.now() / 1e3 | 0; - if (ptr) { - LE_HEAP_STORE_I32((ptr >> 2) * 4, ret); - } - return ret; - } - function _tzset() { - if (_tzset.called) - return; - _tzset.called = true; - var currentYear = new Date().getFullYear(); - var winter = new Date(currentYear, 0, 1); - var summer = new Date(currentYear, 6, 1); - var winterOffset = winter.getTimezoneOffset(); - var summerOffset = summer.getTimezoneOffset(); - var stdTimezoneOffset = Math.max(winterOffset, summerOffset); - LE_HEAP_STORE_I32((__get_timezone() >> 2) * 4, stdTimezoneOffset * 60); - LE_HEAP_STORE_I32( - (__get_daylight() >> 2) * 4, - Number(winterOffset != summerOffset) - ); - function extractZone(date) { - var match = date.toTimeString().match(/\(([A-Za-z ]+)\)$/); - return match ? match[1] : "GMT"; - } - var winterName = extractZone(winter); - var summerName = extractZone(summer); - var winterNamePtr = allocateUTF8(winterName); - var summerNamePtr = allocateUTF8(summerName); - if (summerOffset < winterOffset) { - LE_HEAP_STORE_I32((__get_tzname() >> 2) * 4, winterNamePtr); - LE_HEAP_STORE_I32((__get_tzname() + 4 >> 2) * 4, summerNamePtr); - } else { - LE_HEAP_STORE_I32((__get_tzname() >> 2) * 4, summerNamePtr); - LE_HEAP_STORE_I32((__get_tzname() + 4 >> 2) * 4, winterNamePtr); - } - } - function _timegm(tmPtr) { - _tzset(); - var time = Date.UTC( - LE_HEAP_LOAD_I32((tmPtr + 20 >> 2) * 4) + 1900, - LE_HEAP_LOAD_I32((tmPtr + 16 >> 2) * 4), - LE_HEAP_LOAD_I32((tmPtr + 12 >> 2) * 4), - LE_HEAP_LOAD_I32((tmPtr + 8 >> 2) * 4), - LE_HEAP_LOAD_I32((tmPtr + 4 >> 2) * 4), - LE_HEAP_LOAD_I32((tmPtr >> 2) * 4), - 0 - ); - var date = new Date(time); - LE_HEAP_STORE_I32((tmPtr + 24 >> 2) * 4, date.getUTCDay()); - var start = Date.UTC(date.getUTCFullYear(), 0, 1, 0, 0, 0, 0); - var yday = (date.getTime() - start) / (1e3 * 60 * 60 * 24) | 0; - LE_HEAP_STORE_I32((tmPtr + 28 >> 2) * 4, yday); - return date.getTime() / 1e3 | 0; - } - function intArrayFromBase64(s) { - { - var buf; - try { - buf = Buffer.from(s, "base64"); - } catch (_) { - buf = new Buffer(s, "base64"); - } - return new Uint8Array( - buf["buffer"], - buf["byteOffset"], - buf["byteLength"] - ); - } - } - function tryParseAsDataURI(filename) { - if (!isDataURI(filename)) { - return; - } - return intArrayFromBase64(filename.slice(dataURIPrefix.length)); - } - var asmLibraryArg = { - e: ___gmtime_r, - c: _emscripten_memcpy_big, - d: _emscripten_resize_heap, - a: _setTempRet0, - b: _time, - f: _timegm - }; - var asm = createWasm(); - Module["___wasm_call_ctors"] = asm["h"]; - Module["_zip_ext_count_symlinks"] = asm["i"]; - Module["_zip_file_get_external_attributes"] = asm["j"]; - Module["_zipstruct_statS"] = asm["k"]; - Module["_zipstruct_stat_size"] = asm["l"]; - Module["_zipstruct_stat_mtime"] = asm["m"]; - Module["_zipstruct_stat_crc"] = asm["n"]; - Module["_zipstruct_errorS"] = asm["o"]; - Module["_zipstruct_error_code_zip"] = asm["p"]; - Module["_zipstruct_stat_comp_size"] = asm["q"]; - Module["_zipstruct_stat_comp_method"] = asm["r"]; - Module["_zip_close"] = asm["s"]; - Module["_zip_delete"] = asm["t"]; - Module["_zip_dir_add"] = asm["u"]; - Module["_zip_discard"] = asm["v"]; - Module["_zip_error_init_with_code"] = asm["w"]; - Module["_zip_get_error"] = asm["x"]; - Module["_zip_file_get_error"] = asm["y"]; - Module["_zip_error_strerror"] = asm["z"]; - Module["_zip_fclose"] = asm["A"]; - Module["_zip_file_add"] = asm["B"]; - Module["_free"] = asm["C"]; - var _malloc = Module["_malloc"] = asm["D"]; - Module["_zip_source_error"] = asm["E"]; - Module["_zip_source_seek"] = asm["F"]; - Module["_zip_file_set_external_attributes"] = asm["G"]; - Module["_zip_file_set_mtime"] = asm["H"]; - Module["_zip_fopen_index"] = asm["I"]; - Module["_zip_fread"] = asm["J"]; - Module["_zip_get_name"] = asm["K"]; - Module["_zip_get_num_entries"] = asm["L"]; - Module["_zip_source_read"] = asm["M"]; - Module["_zip_name_locate"] = asm["N"]; - Module["_zip_open_from_source"] = asm["O"]; - Module["_zip_set_file_compression"] = asm["P"]; - Module["_zip_source_buffer"] = asm["Q"]; - Module["_zip_source_buffer_create"] = asm["R"]; - Module["_zip_source_close"] = asm["S"]; - Module["_zip_source_free"] = asm["T"]; - Module["_zip_source_keep"] = asm["U"]; - Module["_zip_source_open"] = asm["V"]; - Module["_zip_source_tell"] = asm["X"]; - Module["_zip_stat_index"] = asm["Y"]; - var __get_tzname = Module["__get_tzname"] = asm["Z"]; - var __get_daylight = Module["__get_daylight"] = asm["_"]; - var __get_timezone = Module["__get_timezone"] = asm["$"]; - var stackSave = Module["stackSave"] = asm["aa"]; - var stackRestore = Module["stackRestore"] = asm["ba"]; - var stackAlloc = Module["stackAlloc"] = asm["ca"]; - Module["cwrap"] = cwrap; - Module["getValue"] = getValue; - var calledRun; - dependenciesFulfilled = function runCaller() { - if (!calledRun) - run(); - if (!calledRun) - dependenciesFulfilled = runCaller; - }; - function run(args) { - if (runDependencies > 0) { - return; - } - preRun(); - if (runDependencies > 0) { - return; - } - function doRun() { - if (calledRun) - return; - calledRun = true; - Module["calledRun"] = true; - if (ABORT) - return; - initRuntime(); - readyPromiseResolve(Module); - if (Module["onRuntimeInitialized"]) - Module["onRuntimeInitialized"](); - postRun(); - } - if (Module["setStatus"]) { - Module["setStatus"]("Running..."); - setTimeout(function() { - setTimeout(function() { - Module["setStatus"](""); - }, 1); - doRun(); - }, 1); - } else { - doRun(); - } - } - Module["run"] = run; - if (Module["preInit"]) { - if (typeof Module["preInit"] == "function") - Module["preInit"] = [Module["preInit"]]; - while (Module["preInit"].length > 0) { - Module["preInit"].pop()(); - } - } - run(); - return createModule2; - }; -}(); -module.exports = createModule; -}(libzipSync)); - -const createModule = libzipSync.exports; - -const number64 = [ - `number`, - `number` -]; -var Errors = /* @__PURE__ */ ((Errors2) => { - Errors2[Errors2["ZIP_ER_OK"] = 0] = "ZIP_ER_OK"; - Errors2[Errors2["ZIP_ER_MULTIDISK"] = 1] = "ZIP_ER_MULTIDISK"; - Errors2[Errors2["ZIP_ER_RENAME"] = 2] = "ZIP_ER_RENAME"; - Errors2[Errors2["ZIP_ER_CLOSE"] = 3] = "ZIP_ER_CLOSE"; - Errors2[Errors2["ZIP_ER_SEEK"] = 4] = "ZIP_ER_SEEK"; - Errors2[Errors2["ZIP_ER_READ"] = 5] = "ZIP_ER_READ"; - Errors2[Errors2["ZIP_ER_WRITE"] = 6] = "ZIP_ER_WRITE"; - Errors2[Errors2["ZIP_ER_CRC"] = 7] = "ZIP_ER_CRC"; - Errors2[Errors2["ZIP_ER_ZIPCLOSED"] = 8] = "ZIP_ER_ZIPCLOSED"; - Errors2[Errors2["ZIP_ER_NOENT"] = 9] = "ZIP_ER_NOENT"; - Errors2[Errors2["ZIP_ER_EXISTS"] = 10] = "ZIP_ER_EXISTS"; - Errors2[Errors2["ZIP_ER_OPEN"] = 11] = "ZIP_ER_OPEN"; - Errors2[Errors2["ZIP_ER_TMPOPEN"] = 12] = "ZIP_ER_TMPOPEN"; - Errors2[Errors2["ZIP_ER_ZLIB"] = 13] = "ZIP_ER_ZLIB"; - Errors2[Errors2["ZIP_ER_MEMORY"] = 14] = "ZIP_ER_MEMORY"; - Errors2[Errors2["ZIP_ER_CHANGED"] = 15] = "ZIP_ER_CHANGED"; - Errors2[Errors2["ZIP_ER_COMPNOTSUPP"] = 16] = "ZIP_ER_COMPNOTSUPP"; - Errors2[Errors2["ZIP_ER_EOF"] = 17] = "ZIP_ER_EOF"; - Errors2[Errors2["ZIP_ER_INVAL"] = 18] = "ZIP_ER_INVAL"; - Errors2[Errors2["ZIP_ER_NOZIP"] = 19] = "ZIP_ER_NOZIP"; - Errors2[Errors2["ZIP_ER_INTERNAL"] = 20] = "ZIP_ER_INTERNAL"; - Errors2[Errors2["ZIP_ER_INCONS"] = 21] = "ZIP_ER_INCONS"; - Errors2[Errors2["ZIP_ER_REMOVE"] = 22] = "ZIP_ER_REMOVE"; - Errors2[Errors2["ZIP_ER_DELETED"] = 23] = "ZIP_ER_DELETED"; - Errors2[Errors2["ZIP_ER_ENCRNOTSUPP"] = 24] = "ZIP_ER_ENCRNOTSUPP"; - Errors2[Errors2["ZIP_ER_RDONLY"] = 25] = "ZIP_ER_RDONLY"; - Errors2[Errors2["ZIP_ER_NOPASSWD"] = 26] = "ZIP_ER_NOPASSWD"; - Errors2[Errors2["ZIP_ER_WRONGPASSWD"] = 27] = "ZIP_ER_WRONGPASSWD"; - Errors2[Errors2["ZIP_ER_OPNOTSUPP"] = 28] = "ZIP_ER_OPNOTSUPP"; - Errors2[Errors2["ZIP_ER_INUSE"] = 29] = "ZIP_ER_INUSE"; - Errors2[Errors2["ZIP_ER_TELL"] = 30] = "ZIP_ER_TELL"; - Errors2[Errors2["ZIP_ER_COMPRESSED_DATA"] = 31] = "ZIP_ER_COMPRESSED_DATA"; - return Errors2; -})(Errors || {}); -const makeInterface = (emZip) => ({ - get HEAPU8() { - return emZip.HEAPU8; - }, - errors: Errors, - SEEK_SET: 0, - SEEK_CUR: 1, - SEEK_END: 2, - ZIP_CHECKCONS: 4, - ZIP_EXCL: 2, - ZIP_RDONLY: 16, - ZIP_FL_OVERWRITE: 8192, - ZIP_FL_COMPRESSED: 4, - ZIP_OPSYS_DOS: 0, - ZIP_OPSYS_AMIGA: 1, - ZIP_OPSYS_OPENVMS: 2, - ZIP_OPSYS_UNIX: 3, - ZIP_OPSYS_VM_CMS: 4, - ZIP_OPSYS_ATARI_ST: 5, - ZIP_OPSYS_OS_2: 6, - ZIP_OPSYS_MACINTOSH: 7, - ZIP_OPSYS_Z_SYSTEM: 8, - ZIP_OPSYS_CPM: 9, - ZIP_OPSYS_WINDOWS_NTFS: 10, - ZIP_OPSYS_MVS: 11, - ZIP_OPSYS_VSE: 12, - ZIP_OPSYS_ACORN_RISC: 13, - ZIP_OPSYS_VFAT: 14, - ZIP_OPSYS_ALTERNATE_MVS: 15, - ZIP_OPSYS_BEOS: 16, - ZIP_OPSYS_TANDEM: 17, - ZIP_OPSYS_OS_400: 18, - ZIP_OPSYS_OS_X: 19, - ZIP_CM_DEFAULT: -1, - ZIP_CM_STORE: 0, - ZIP_CM_DEFLATE: 8, - uint08S: emZip._malloc(1), - uint32S: emZip._malloc(4), - malloc: emZip._malloc, - free: emZip._free, - getValue: emZip.getValue, - openFromSource: emZip.cwrap(`zip_open_from_source`, `number`, [`number`, `number`, `number`]), - close: emZip.cwrap(`zip_close`, `number`, [`number`]), - discard: emZip.cwrap(`zip_discard`, null, [`number`]), - getError: emZip.cwrap(`zip_get_error`, `number`, [`number`]), - getName: emZip.cwrap(`zip_get_name`, `string`, [`number`, `number`, `number`]), - getNumEntries: emZip.cwrap(`zip_get_num_entries`, `number`, [`number`, `number`]), - delete: emZip.cwrap(`zip_delete`, `number`, [`number`, `number`]), - statIndex: emZip.cwrap(`zip_stat_index`, `number`, [`number`, ...number64, `number`, `number`]), - fopenIndex: emZip.cwrap(`zip_fopen_index`, `number`, [`number`, ...number64, `number`]), - fread: emZip.cwrap(`zip_fread`, `number`, [`number`, `number`, `number`, `number`]), - fclose: emZip.cwrap(`zip_fclose`, `number`, [`number`]), - dir: { - add: emZip.cwrap(`zip_dir_add`, `number`, [`number`, `string`]) - }, - file: { - add: emZip.cwrap(`zip_file_add`, `number`, [`number`, `string`, `number`, `number`]), - getError: emZip.cwrap(`zip_file_get_error`, `number`, [`number`]), - getExternalAttributes: emZip.cwrap(`zip_file_get_external_attributes`, `number`, [`number`, ...number64, `number`, `number`, `number`]), - setExternalAttributes: emZip.cwrap(`zip_file_set_external_attributes`, `number`, [`number`, ...number64, `number`, `number`, `number`]), - setMtime: emZip.cwrap(`zip_file_set_mtime`, `number`, [`number`, ...number64, `number`, `number`]), - setCompression: emZip.cwrap(`zip_set_file_compression`, `number`, [`number`, ...number64, `number`, `number`]) - }, - ext: { - countSymlinks: emZip.cwrap(`zip_ext_count_symlinks`, `number`, [`number`]) - }, - error: { - initWithCode: emZip.cwrap(`zip_error_init_with_code`, null, [`number`, `number`]), - strerror: emZip.cwrap(`zip_error_strerror`, `string`, [`number`]) - }, - name: { - locate: emZip.cwrap(`zip_name_locate`, `number`, [`number`, `string`, `number`]) - }, - source: { - fromUnattachedBuffer: emZip.cwrap(`zip_source_buffer_create`, `number`, [`number`, ...number64, `number`, `number`]), - fromBuffer: emZip.cwrap(`zip_source_buffer`, `number`, [`number`, `number`, ...number64, `number`]), - free: emZip.cwrap(`zip_source_free`, null, [`number`]), - keep: emZip.cwrap(`zip_source_keep`, null, [`number`]), - open: emZip.cwrap(`zip_source_open`, `number`, [`number`]), - close: emZip.cwrap(`zip_source_close`, `number`, [`number`]), - seek: emZip.cwrap(`zip_source_seek`, `number`, [`number`, ...number64, `number`]), - tell: emZip.cwrap(`zip_source_tell`, `number`, [`number`]), - read: emZip.cwrap(`zip_source_read`, `number`, [`number`, `number`, `number`]), - error: emZip.cwrap(`zip_source_error`, `number`, [`number`]) - }, - struct: { - statS: emZip.cwrap(`zipstruct_statS`, `number`, []), - statSize: emZip.cwrap(`zipstruct_stat_size`, `number`, [`number`]), - statCompSize: emZip.cwrap(`zipstruct_stat_comp_size`, `number`, [`number`]), - statCompMethod: emZip.cwrap(`zipstruct_stat_comp_method`, `number`, [`number`]), - statMtime: emZip.cwrap(`zipstruct_stat_mtime`, `number`, [`number`]), - statCrc: emZip.cwrap(`zipstruct_stat_crc`, `number`, [`number`]), - errorS: emZip.cwrap(`zipstruct_errorS`, `number`, []), - errorCodeZip: emZip.cwrap(`zipstruct_error_code_zip`, `number`, [`number`]) - } -}); - -function getArchivePart(path, extension) { - let idx = path.indexOf(extension); - if (idx <= 0) - return null; - let nextCharIdx = idx; - while (idx >= 0) { - nextCharIdx = idx + extension.length; - if (path[nextCharIdx] === ppath.sep) - break; - if (path[idx - 1] === ppath.sep) - return null; - idx = path.indexOf(extension, nextCharIdx); - } - if (path.length > nextCharIdx && path[nextCharIdx] !== ppath.sep) - return null; - return path.slice(0, nextCharIdx); -} -class ZipOpenFS extends MountFS { - static async openPromise(fn, opts) { - const zipOpenFs = new ZipOpenFS(opts); - try { - return await fn(zipOpenFs); - } finally { - zipOpenFs.saveAndClose(); - } - } - constructor(opts = {}) { - const fileExtensions = opts.fileExtensions; - const readOnlyArchives = opts.readOnlyArchives; - const getMountPoint = typeof fileExtensions === `undefined` ? (path) => getArchivePart(path, `.zip`) : (path) => { - for (const extension of fileExtensions) { - const result = getArchivePart(path, extension); - if (result) { - return result; - } - } - return null; - }; - const factorySync = (baseFs, p) => { - return new ZipFS(p, { - baseFs, - readOnly: readOnlyArchives, - stats: baseFs.statSync(p) - }); - }; - const factoryPromise = async (baseFs, p) => { - const zipOptions = { - baseFs, - readOnly: readOnlyArchives, - stats: await baseFs.statPromise(p) - }; - return () => { - return new ZipFS(p, zipOptions); - }; - }; - super({ - ...opts, - factorySync, - factoryPromise, - getMountPoint - }); - } -} - -const DEFAULT_COMPRESSION_LEVEL = `mixed`; -function toUnixTimestamp(time) { - if (typeof time === `string` && String(+time) === time) - return +time; - if (typeof time === `number` && Number.isFinite(time)) { - if (time < 0) { - return Date.now() / 1e3; - } else { - return time; - } - } - if (nodeUtils.types.isDate(time)) - return time.getTime() / 1e3; - throw new Error(`Invalid time`); -} -function makeEmptyArchive() { - return Buffer.from([ - 80, - 75, - 5, - 6, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0 - ]); -} -class LibzipError extends Error { - constructor(message, code) { - super(message); - this.name = `Libzip Error`; - this.code = code; - } -} -class ZipFS extends BasePortableFakeFS { - constructor(source, opts = {}) { - super(); - this.listings = /* @__PURE__ */ new Map(); - this.entries = /* @__PURE__ */ new Map(); - this.fileSources = /* @__PURE__ */ new Map(); - this.fds = /* @__PURE__ */ new Map(); - this.nextFd = 0; - this.ready = false; - this.readOnly = false; - const pathOptions = opts; - this.level = typeof pathOptions.level !== `undefined` ? pathOptions.level : DEFAULT_COMPRESSION_LEVEL; - source ??= makeEmptyArchive(); - if (typeof source === `string`) { - const { baseFs = new NodeFS() } = pathOptions; - this.baseFs = baseFs; - this.path = source; - } else { - this.path = null; - this.baseFs = null; - } - if (opts.stats) { - this.stats = opts.stats; - } else { - if (typeof source === `string`) { - try { - this.stats = this.baseFs.statSync(source); - } catch (error) { - if (error.code === `ENOENT` && pathOptions.create) { - this.stats = makeDefaultStats(); - } else { - throw error; - } - } - } else { - this.stats = makeDefaultStats(); - } - } - this.libzip = getInstance(); - const errPtr = this.libzip.malloc(4); - try { - let flags = 0; - if (opts.readOnly) { - flags |= this.libzip.ZIP_RDONLY; - this.readOnly = true; - } - if (typeof source === `string`) - source = pathOptions.create ? makeEmptyArchive() : this.baseFs.readFileSync(source); - const lzSource = this.allocateUnattachedSource(source); - try { - this.zip = this.libzip.openFromSource(lzSource, flags, errPtr); - this.lzSource = lzSource; - } catch (error) { - this.libzip.source.free(lzSource); - throw error; - } - if (this.zip === 0) { - const error = this.libzip.struct.errorS(); - this.libzip.error.initWithCode(error, this.libzip.getValue(errPtr, `i32`)); - throw this.makeLibzipError(error); - } - } finally { - this.libzip.free(errPtr); - } - this.listings.set(PortablePath.root, /* @__PURE__ */ new Set()); - const entryCount = this.libzip.getNumEntries(this.zip, 0); - for (let t = 0; t < entryCount; ++t) { - const raw = this.libzip.getName(this.zip, t, 0); - if (ppath.isAbsolute(raw)) - continue; - const p = ppath.resolve(PortablePath.root, raw); - this.registerEntry(p, t); - if (raw.endsWith(`/`)) { - this.registerListing(p); - } - } - this.symlinkCount = this.libzip.ext.countSymlinks(this.zip); - if (this.symlinkCount === -1) - throw this.makeLibzipError(this.libzip.getError(this.zip)); - this.ready = true; - } - makeLibzipError(error) { - const errorCode = this.libzip.struct.errorCodeZip(error); - const strerror = this.libzip.error.strerror(error); - const libzipError = new LibzipError(strerror, this.libzip.errors[errorCode]); - if (errorCode === this.libzip.errors.ZIP_ER_CHANGED) - throw new Error(`Assertion failed: Unexpected libzip error: ${libzipError.message}`); - return libzipError; - } - getExtractHint(hints) { - for (const fileName of this.entries.keys()) { - const ext = this.pathUtils.extname(fileName); - if (hints.relevantExtensions.has(ext)) { - return true; - } - } - return false; - } - getAllFiles() { - return Array.from(this.entries.keys()); - } - getRealPath() { - if (!this.path) - throw new Error(`ZipFS don't have real paths when loaded from a buffer`); - return this.path; - } - prepareClose() { - if (!this.ready) - throw EBUSY(`archive closed, close`); - unwatchAllFiles(this); - } - getBufferAndClose() { - this.prepareClose(); - if (this.entries.size === 0) { - this.discardAndClose(); - return makeEmptyArchive(); - } - try { - this.libzip.source.keep(this.lzSource); - if (this.libzip.close(this.zip) === -1) - throw this.makeLibzipError(this.libzip.getError(this.zip)); - if (this.libzip.source.open(this.lzSource) === -1) - throw this.makeLibzipError(this.libzip.source.error(this.lzSource)); - if (this.libzip.source.seek(this.lzSource, 0, 0, this.libzip.SEEK_END) === -1) - throw this.makeLibzipError(this.libzip.source.error(this.lzSource)); - const size = this.libzip.source.tell(this.lzSource); - if (size === -1) - throw this.makeLibzipError(this.libzip.source.error(this.lzSource)); - if (this.libzip.source.seek(this.lzSource, 0, 0, this.libzip.SEEK_SET) === -1) - throw this.makeLibzipError(this.libzip.source.error(this.lzSource)); - const buffer = this.libzip.malloc(size); - if (!buffer) - throw new Error(`Couldn't allocate enough memory`); - try { - const rc = this.libzip.source.read(this.lzSource, buffer, size); - if (rc === -1) - throw this.makeLibzipError(this.libzip.source.error(this.lzSource)); - else if (rc < size) - throw new Error(`Incomplete read`); - else if (rc > size) - throw new Error(`Overread`); - let result = Buffer.from(this.libzip.HEAPU8.subarray(buffer, buffer + size)); - if (process.env.YARN_IS_TEST_ENV && process.env.YARN_ZIP_DATA_EPILOGUE) - result = Buffer.concat([result, Buffer.from(process.env.YARN_ZIP_DATA_EPILOGUE)]); - return result; - } finally { - this.libzip.free(buffer); - } - } finally { - this.libzip.source.close(this.lzSource); - this.libzip.source.free(this.lzSource); - this.ready = false; - } - } - discardAndClose() { - this.prepareClose(); - this.libzip.discard(this.zip); - this.ready = false; - } - saveAndClose() { - if (!this.path || !this.baseFs) - throw new Error(`ZipFS cannot be saved and must be discarded when loaded from a buffer`); - if (this.readOnly) { - this.discardAndClose(); - return; - } - const newMode = this.baseFs.existsSync(this.path) || this.stats.mode === DEFAULT_MODE ? void 0 : this.stats.mode; - this.baseFs.writeFileSync(this.path, this.getBufferAndClose(), { mode: newMode }); - this.ready = false; - } - resolve(p) { - return ppath.resolve(PortablePath.root, p); - } - async openPromise(p, flags, mode) { - return this.openSync(p, flags, mode); - } - openSync(p, flags, mode) { - const fd = this.nextFd++; - this.fds.set(fd, { cursor: 0, p }); - return fd; - } - hasOpenFileHandles() { - return !!this.fds.size; - } - async opendirPromise(p, opts) { - return this.opendirSync(p, opts); - } - opendirSync(p, opts = {}) { - const resolvedP = this.resolveFilename(`opendir '${p}'`, p); - if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) - throw ENOENT(`opendir '${p}'`); - const directoryListing = this.listings.get(resolvedP); - if (!directoryListing) - throw ENOTDIR(`opendir '${p}'`); - const entries = [...directoryListing]; - const fd = this.openSync(resolvedP, `r`); - const onClose = () => { - this.closeSync(fd); - }; - return opendir(this, resolvedP, entries, { onClose }); - } - async readPromise(fd, buffer, offset, length, position) { - return this.readSync(fd, buffer, offset, length, position); - } - readSync(fd, buffer, offset = 0, length = buffer.byteLength, position = -1) { - const entry = this.fds.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`read`); - const realPosition = position === -1 || position === null ? entry.cursor : position; - const source = this.readFileSync(entry.p); - source.copy(buffer, offset, realPosition, realPosition + length); - const bytesRead = Math.max(0, Math.min(source.length - realPosition, length)); - if (position === -1 || position === null) - entry.cursor += bytesRead; - return bytesRead; - } - async writePromise(fd, buffer, offset, length, position) { - if (typeof buffer === `string`) { - return this.writeSync(fd, buffer, position); - } else { - return this.writeSync(fd, buffer, offset, length, position); - } - } - writeSync(fd, buffer, offset, length, position) { - const entry = this.fds.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`read`); - throw new Error(`Unimplemented`); - } - async closePromise(fd) { - return this.closeSync(fd); - } - closeSync(fd) { - const entry = this.fds.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`read`); - this.fds.delete(fd); - } - createReadStream(p, { encoding } = {}) { - if (p === null) - throw new Error(`Unimplemented`); - const fd = this.openSync(p, `r`); - const stream$1 = Object.assign( - new stream.PassThrough({ - emitClose: true, - autoDestroy: true, - destroy: (error, callback) => { - clearImmediate(immediate); - this.closeSync(fd); - callback(error); - } - }), - { - close() { - stream$1.destroy(); - }, - bytesRead: 0, - path: p, - pending: false - } - ); - const immediate = setImmediate(async () => { - try { - const data = await this.readFilePromise(p, encoding); - stream$1.bytesRead = data.length; - stream$1.end(data); - } catch (error) { - stream$1.destroy(error); - } - }); - return stream$1; - } - createWriteStream(p, { encoding } = {}) { - if (this.readOnly) - throw EROFS(`open '${p}'`); - if (p === null) - throw new Error(`Unimplemented`); - const chunks = []; - const fd = this.openSync(p, `w`); - const stream$1 = Object.assign( - new stream.PassThrough({ - autoDestroy: true, - emitClose: true, - destroy: (error, callback) => { - try { - if (error) { - callback(error); - } else { - this.writeFileSync(p, Buffer.concat(chunks), encoding); - callback(null); - } - } catch (err) { - callback(err); - } finally { - this.closeSync(fd); - } - } - }), - { - close() { - stream$1.destroy(); - }, - bytesWritten: 0, - path: p, - pending: false - } - ); - stream$1.on(`data`, (chunk) => { - const chunkBuffer = Buffer.from(chunk); - stream$1.bytesWritten += chunkBuffer.length; - chunks.push(chunkBuffer); - }); - return stream$1; - } - async realpathPromise(p) { - return this.realpathSync(p); - } - realpathSync(p) { - const resolvedP = this.resolveFilename(`lstat '${p}'`, p); - if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) - throw ENOENT(`lstat '${p}'`); - return resolvedP; - } - async existsPromise(p) { - return this.existsSync(p); - } - existsSync(p) { - if (!this.ready) - throw EBUSY(`archive closed, existsSync '${p}'`); - if (this.symlinkCount === 0) { - const resolvedP2 = ppath.resolve(PortablePath.root, p); - return this.entries.has(resolvedP2) || this.listings.has(resolvedP2); - } - let resolvedP; - try { - resolvedP = this.resolveFilename(`stat '${p}'`, p, void 0, false); - } catch (error) { - return false; - } - if (resolvedP === void 0) - return false; - return this.entries.has(resolvedP) || this.listings.has(resolvedP); - } - async accessPromise(p, mode) { - return this.accessSync(p, mode); - } - accessSync(p, mode = fs.constants.F_OK) { - const resolvedP = this.resolveFilename(`access '${p}'`, p); - if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) - throw ENOENT(`access '${p}'`); - if (this.readOnly && mode & fs.constants.W_OK) { - throw EROFS(`access '${p}'`); - } - } - async statPromise(p, opts = { bigint: false }) { - if (opts.bigint) - return this.statSync(p, { bigint: true }); - return this.statSync(p); - } - statSync(p, opts = { bigint: false, throwIfNoEntry: true }) { - const resolvedP = this.resolveFilename(`stat '${p}'`, p, void 0, opts.throwIfNoEntry); - if (resolvedP === void 0) - return void 0; - if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) { - if (opts.throwIfNoEntry === false) - return void 0; - throw ENOENT(`stat '${p}'`); - } - if (p[p.length - 1] === `/` && !this.listings.has(resolvedP)) - throw ENOTDIR(`stat '${p}'`); - return this.statImpl(`stat '${p}'`, resolvedP, opts); - } - async fstatPromise(fd, opts) { - return this.fstatSync(fd, opts); - } - fstatSync(fd, opts) { - const entry = this.fds.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`fstatSync`); - const { p } = entry; - const resolvedP = this.resolveFilename(`stat '${p}'`, p); - if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) - throw ENOENT(`stat '${p}'`); - if (p[p.length - 1] === `/` && !this.listings.has(resolvedP)) - throw ENOTDIR(`stat '${p}'`); - return this.statImpl(`fstat '${p}'`, resolvedP, opts); - } - async lstatPromise(p, opts = { bigint: false }) { - if (opts.bigint) - return this.lstatSync(p, { bigint: true }); - return this.lstatSync(p); - } - lstatSync(p, opts = { bigint: false, throwIfNoEntry: true }) { - const resolvedP = this.resolveFilename(`lstat '${p}'`, p, false, opts.throwIfNoEntry); - if (resolvedP === void 0) - return void 0; - if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) { - if (opts.throwIfNoEntry === false) - return void 0; - throw ENOENT(`lstat '${p}'`); - } - if (p[p.length - 1] === `/` && !this.listings.has(resolvedP)) - throw ENOTDIR(`lstat '${p}'`); - return this.statImpl(`lstat '${p}'`, resolvedP, opts); - } - statImpl(reason, p, opts = {}) { - const entry = this.entries.get(p); - if (typeof entry !== `undefined`) { - const stat = this.libzip.struct.statS(); - const rc = this.libzip.statIndex(this.zip, entry, 0, 0, stat); - if (rc === -1) - throw this.makeLibzipError(this.libzip.getError(this.zip)); - const uid = this.stats.uid; - const gid = this.stats.gid; - const size = this.libzip.struct.statSize(stat) >>> 0; - const blksize = 512; - const blocks = Math.ceil(size / blksize); - const mtimeMs = (this.libzip.struct.statMtime(stat) >>> 0) * 1e3; - const atimeMs = mtimeMs; - const birthtimeMs = mtimeMs; - const ctimeMs = mtimeMs; - const atime = new Date(atimeMs); - const birthtime = new Date(birthtimeMs); - const ctime = new Date(ctimeMs); - const mtime = new Date(mtimeMs); - const type = this.listings.has(p) ? fs.constants.S_IFDIR : this.isSymbolicLink(entry) ? fs.constants.S_IFLNK : fs.constants.S_IFREG; - const defaultMode = type === fs.constants.S_IFDIR ? 493 : 420; - const mode = type | this.getUnixMode(entry, defaultMode) & 511; - const crc = this.libzip.struct.statCrc(stat); - const statInstance = Object.assign(new StatEntry(), { uid, gid, size, blksize, blocks, atime, birthtime, ctime, mtime, atimeMs, birthtimeMs, ctimeMs, mtimeMs, mode, crc }); - return opts.bigint === true ? convertToBigIntStats(statInstance) : statInstance; - } - if (this.listings.has(p)) { - const uid = this.stats.uid; - const gid = this.stats.gid; - const size = 0; - const blksize = 512; - const blocks = 0; - const atimeMs = this.stats.mtimeMs; - const birthtimeMs = this.stats.mtimeMs; - const ctimeMs = this.stats.mtimeMs; - const mtimeMs = this.stats.mtimeMs; - const atime = new Date(atimeMs); - const birthtime = new Date(birthtimeMs); - const ctime = new Date(ctimeMs); - const mtime = new Date(mtimeMs); - const mode = fs.constants.S_IFDIR | 493; - const crc = 0; - const statInstance = Object.assign(new StatEntry(), { uid, gid, size, blksize, blocks, atime, birthtime, ctime, mtime, atimeMs, birthtimeMs, ctimeMs, mtimeMs, mode, crc }); - return opts.bigint === true ? convertToBigIntStats(statInstance) : statInstance; - } - throw new Error(`Unreachable`); - } - getUnixMode(index, defaultMode) { - const rc = this.libzip.file.getExternalAttributes(this.zip, index, 0, 0, this.libzip.uint08S, this.libzip.uint32S); - if (rc === -1) - throw this.makeLibzipError(this.libzip.getError(this.zip)); - const opsys = this.libzip.getValue(this.libzip.uint08S, `i8`) >>> 0; - if (opsys !== this.libzip.ZIP_OPSYS_UNIX) - return defaultMode; - return this.libzip.getValue(this.libzip.uint32S, `i32`) >>> 16; - } - registerListing(p) { - const existingListing = this.listings.get(p); - if (existingListing) - return existingListing; - const parentListing = this.registerListing(ppath.dirname(p)); - parentListing.add(ppath.basename(p)); - const newListing = /* @__PURE__ */ new Set(); - this.listings.set(p, newListing); - return newListing; - } - registerEntry(p, index) { - const parentListing = this.registerListing(ppath.dirname(p)); - parentListing.add(ppath.basename(p)); - this.entries.set(p, index); - } - unregisterListing(p) { - this.listings.delete(p); - const parentListing = this.listings.get(ppath.dirname(p)); - parentListing?.delete(ppath.basename(p)); - } - unregisterEntry(p) { - this.unregisterListing(p); - const entry = this.entries.get(p); - this.entries.delete(p); - if (typeof entry === `undefined`) - return; - this.fileSources.delete(entry); - if (this.isSymbolicLink(entry)) { - this.symlinkCount--; - } - } - deleteEntry(p, index) { - this.unregisterEntry(p); - const rc = this.libzip.delete(this.zip, index); - if (rc === -1) { - throw this.makeLibzipError(this.libzip.getError(this.zip)); - } - } - resolveFilename(reason, p, resolveLastComponent = true, throwIfNoEntry = true) { - if (!this.ready) - throw EBUSY(`archive closed, ${reason}`); - let resolvedP = ppath.resolve(PortablePath.root, p); - if (resolvedP === `/`) - return PortablePath.root; - const fileIndex = this.entries.get(resolvedP); - if (resolveLastComponent && fileIndex !== void 0) { - if (this.symlinkCount !== 0 && this.isSymbolicLink(fileIndex)) { - const target = this.getFileSource(fileIndex).toString(); - return this.resolveFilename(reason, ppath.resolve(ppath.dirname(resolvedP), target), true, throwIfNoEntry); - } else { - return resolvedP; - } - } - while (true) { - const parentP = this.resolveFilename(reason, ppath.dirname(resolvedP), true, throwIfNoEntry); - if (parentP === void 0) - return parentP; - const isDir = this.listings.has(parentP); - const doesExist = this.entries.has(parentP); - if (!isDir && !doesExist) { - if (throwIfNoEntry === false) - return void 0; - throw ENOENT(reason); - } - if (!isDir) - throw ENOTDIR(reason); - resolvedP = ppath.resolve(parentP, ppath.basename(resolvedP)); - if (!resolveLastComponent || this.symlinkCount === 0) - break; - const index = this.libzip.name.locate(this.zip, resolvedP.slice(1), 0); - if (index === -1) - break; - if (this.isSymbolicLink(index)) { - const target = this.getFileSource(index).toString(); - resolvedP = ppath.resolve(ppath.dirname(resolvedP), target); - } else { - break; - } - } - return resolvedP; - } - allocateBuffer(content) { - if (!Buffer.isBuffer(content)) - content = Buffer.from(content); - const buffer = this.libzip.malloc(content.byteLength); - if (!buffer) - throw new Error(`Couldn't allocate enough memory`); - const heap = new Uint8Array(this.libzip.HEAPU8.buffer, buffer, content.byteLength); - heap.set(content); - return { buffer, byteLength: content.byteLength }; - } - allocateUnattachedSource(content) { - const error = this.libzip.struct.errorS(); - const { buffer, byteLength } = this.allocateBuffer(content); - const source = this.libzip.source.fromUnattachedBuffer(buffer, byteLength, 0, 1, error); - if (source === 0) { - this.libzip.free(error); - throw this.makeLibzipError(error); - } - return source; - } - allocateSource(content) { - const { buffer, byteLength } = this.allocateBuffer(content); - const source = this.libzip.source.fromBuffer(this.zip, buffer, byteLength, 0, 1); - if (source === 0) { - this.libzip.free(buffer); - throw this.makeLibzipError(this.libzip.getError(this.zip)); - } - return source; - } - setFileSource(p, content) { - const buffer = Buffer.isBuffer(content) ? content : Buffer.from(content); - const target = ppath.relative(PortablePath.root, p); - const lzSource = this.allocateSource(content); - try { - const newIndex = this.libzip.file.add(this.zip, target, lzSource, this.libzip.ZIP_FL_OVERWRITE); - if (newIndex === -1) - throw this.makeLibzipError(this.libzip.getError(this.zip)); - if (this.level !== `mixed`) { - const method = this.level === 0 ? this.libzip.ZIP_CM_STORE : this.libzip.ZIP_CM_DEFLATE; - const rc = this.libzip.file.setCompression(this.zip, newIndex, 0, method, this.level); - if (rc === -1) { - throw this.makeLibzipError(this.libzip.getError(this.zip)); - } - } - this.fileSources.set(newIndex, buffer); - return newIndex; - } catch (error) { - this.libzip.source.free(lzSource); - throw error; - } - } - isSymbolicLink(index) { - if (this.symlinkCount === 0) - return false; - const attrs = this.libzip.file.getExternalAttributes(this.zip, index, 0, 0, this.libzip.uint08S, this.libzip.uint32S); - if (attrs === -1) - throw this.makeLibzipError(this.libzip.getError(this.zip)); - const opsys = this.libzip.getValue(this.libzip.uint08S, `i8`) >>> 0; - if (opsys !== this.libzip.ZIP_OPSYS_UNIX) - return false; - const attributes = this.libzip.getValue(this.libzip.uint32S, `i32`) >>> 16; - return (attributes & fs.constants.S_IFMT) === fs.constants.S_IFLNK; - } - getFileSource(index, opts = { asyncDecompress: false }) { - const cachedFileSource = this.fileSources.get(index); - if (typeof cachedFileSource !== `undefined`) - return cachedFileSource; - const stat = this.libzip.struct.statS(); - const rc = this.libzip.statIndex(this.zip, index, 0, 0, stat); - if (rc === -1) - throw this.makeLibzipError(this.libzip.getError(this.zip)); - const size = this.libzip.struct.statCompSize(stat); - const compressionMethod = this.libzip.struct.statCompMethod(stat); - const buffer = this.libzip.malloc(size); - try { - const file = this.libzip.fopenIndex(this.zip, index, 0, this.libzip.ZIP_FL_COMPRESSED); - if (file === 0) - throw this.makeLibzipError(this.libzip.getError(this.zip)); - try { - const rc2 = this.libzip.fread(file, buffer, size, 0); - if (rc2 === -1) - throw this.makeLibzipError(this.libzip.file.getError(file)); - else if (rc2 < size) - throw new Error(`Incomplete read`); - else if (rc2 > size) - throw new Error(`Overread`); - const memory = this.libzip.HEAPU8.subarray(buffer, buffer + size); - const data = Buffer.from(memory); - if (compressionMethod === 0) { - this.fileSources.set(index, data); - return data; - } else if (opts.asyncDecompress) { - return new Promise((resolve, reject) => { - zlib__default.default.inflateRaw(data, (error, result) => { - if (error) { - reject(error); - } else { - this.fileSources.set(index, result); - resolve(result); - } - }); - }); - } else { - const decompressedData = zlib__default.default.inflateRawSync(data); - this.fileSources.set(index, decompressedData); - return decompressedData; - } - } finally { - this.libzip.fclose(file); - } - } finally { - this.libzip.free(buffer); - } - } - async fchmodPromise(fd, mask) { - return this.chmodPromise(this.fdToPath(fd, `fchmod`), mask); - } - fchmodSync(fd, mask) { - return this.chmodSync(this.fdToPath(fd, `fchmodSync`), mask); - } - async chmodPromise(p, mask) { - return this.chmodSync(p, mask); - } - chmodSync(p, mask) { - if (this.readOnly) - throw EROFS(`chmod '${p}'`); - mask &= 493; - const resolvedP = this.resolveFilename(`chmod '${p}'`, p, false); - const entry = this.entries.get(resolvedP); - if (typeof entry === `undefined`) - throw new Error(`Assertion failed: The entry should have been registered (${resolvedP})`); - const oldMod = this.getUnixMode(entry, fs.constants.S_IFREG | 0); - const newMod = oldMod & ~511 | mask; - const rc = this.libzip.file.setExternalAttributes(this.zip, entry, 0, 0, this.libzip.ZIP_OPSYS_UNIX, newMod << 16); - if (rc === -1) { - throw this.makeLibzipError(this.libzip.getError(this.zip)); - } - } - async fchownPromise(fd, uid, gid) { - return this.chownPromise(this.fdToPath(fd, `fchown`), uid, gid); - } - fchownSync(fd, uid, gid) { - return this.chownSync(this.fdToPath(fd, `fchownSync`), uid, gid); - } - async chownPromise(p, uid, gid) { - return this.chownSync(p, uid, gid); - } - chownSync(p, uid, gid) { - throw new Error(`Unimplemented`); - } - async renamePromise(oldP, newP) { - return this.renameSync(oldP, newP); - } - renameSync(oldP, newP) { - throw new Error(`Unimplemented`); - } - async copyFilePromise(sourceP, destP, flags) { - const { indexSource, indexDest, resolvedDestP } = this.prepareCopyFile(sourceP, destP, flags); - const source = await this.getFileSource(indexSource, { asyncDecompress: true }); - const newIndex = this.setFileSource(resolvedDestP, source); - if (newIndex !== indexDest) { - this.registerEntry(resolvedDestP, newIndex); - } - } - copyFileSync(sourceP, destP, flags = 0) { - const { indexSource, indexDest, resolvedDestP } = this.prepareCopyFile(sourceP, destP, flags); - const source = this.getFileSource(indexSource); - const newIndex = this.setFileSource(resolvedDestP, source); - if (newIndex !== indexDest) { - this.registerEntry(resolvedDestP, newIndex); - } - } - prepareCopyFile(sourceP, destP, flags = 0) { - if (this.readOnly) - throw EROFS(`copyfile '${sourceP} -> '${destP}'`); - if ((flags & fs.constants.COPYFILE_FICLONE_FORCE) !== 0) - throw ENOSYS(`unsupported clone operation`, `copyfile '${sourceP}' -> ${destP}'`); - const resolvedSourceP = this.resolveFilename(`copyfile '${sourceP} -> ${destP}'`, sourceP); - const indexSource = this.entries.get(resolvedSourceP); - if (typeof indexSource === `undefined`) - throw EINVAL(`copyfile '${sourceP}' -> '${destP}'`); - const resolvedDestP = this.resolveFilename(`copyfile '${sourceP}' -> ${destP}'`, destP); - const indexDest = this.entries.get(resolvedDestP); - if ((flags & (fs.constants.COPYFILE_EXCL | fs.constants.COPYFILE_FICLONE_FORCE)) !== 0 && typeof indexDest !== `undefined`) - throw EEXIST(`copyfile '${sourceP}' -> '${destP}'`); - return { - indexSource, - resolvedDestP, - indexDest - }; - } - async appendFilePromise(p, content, opts) { - if (this.readOnly) - throw EROFS(`open '${p}'`); - if (typeof opts === `undefined`) - opts = { flag: `a` }; - else if (typeof opts === `string`) - opts = { flag: `a`, encoding: opts }; - else if (typeof opts.flag === `undefined`) - opts = { flag: `a`, ...opts }; - return this.writeFilePromise(p, content, opts); - } - appendFileSync(p, content, opts = {}) { - if (this.readOnly) - throw EROFS(`open '${p}'`); - if (typeof opts === `undefined`) - opts = { flag: `a` }; - else if (typeof opts === `string`) - opts = { flag: `a`, encoding: opts }; - else if (typeof opts.flag === `undefined`) - opts = { flag: `a`, ...opts }; - return this.writeFileSync(p, content, opts); - } - fdToPath(fd, reason) { - const path = this.fds.get(fd)?.p; - if (typeof path === `undefined`) - throw EBADF(reason); - return path; - } - async writeFilePromise(p, content, opts) { - const { encoding, mode, index, resolvedP } = this.prepareWriteFile(p, opts); - if (index !== void 0 && typeof opts === `object` && opts.flag && opts.flag.includes(`a`)) - content = Buffer.concat([await this.getFileSource(index, { asyncDecompress: true }), Buffer.from(content)]); - if (encoding !== null) - content = content.toString(encoding); - const newIndex = this.setFileSource(resolvedP, content); - if (newIndex !== index) - this.registerEntry(resolvedP, newIndex); - if (mode !== null) { - await this.chmodPromise(resolvedP, mode); - } - } - writeFileSync(p, content, opts) { - const { encoding, mode, index, resolvedP } = this.prepareWriteFile(p, opts); - if (index !== void 0 && typeof opts === `object` && opts.flag && opts.flag.includes(`a`)) - content = Buffer.concat([this.getFileSource(index), Buffer.from(content)]); - if (encoding !== null) - content = content.toString(encoding); - const newIndex = this.setFileSource(resolvedP, content); - if (newIndex !== index) - this.registerEntry(resolvedP, newIndex); - if (mode !== null) { - this.chmodSync(resolvedP, mode); - } - } - prepareWriteFile(p, opts) { - if (typeof p === `number`) - p = this.fdToPath(p, `read`); - if (this.readOnly) - throw EROFS(`open '${p}'`); - const resolvedP = this.resolveFilename(`open '${p}'`, p); - if (this.listings.has(resolvedP)) - throw EISDIR(`open '${p}'`); - let encoding = null, mode = null; - if (typeof opts === `string`) { - encoding = opts; - } else if (typeof opts === `object`) { - ({ - encoding = null, - mode = null - } = opts); - } - const index = this.entries.get(resolvedP); - return { - encoding, - mode, - resolvedP, - index - }; - } - async unlinkPromise(p) { - return this.unlinkSync(p); - } - unlinkSync(p) { - if (this.readOnly) - throw EROFS(`unlink '${p}'`); - const resolvedP = this.resolveFilename(`unlink '${p}'`, p); - if (this.listings.has(resolvedP)) - throw EISDIR(`unlink '${p}'`); - const index = this.entries.get(resolvedP); - if (typeof index === `undefined`) - throw EINVAL(`unlink '${p}'`); - this.deleteEntry(resolvedP, index); - } - async utimesPromise(p, atime, mtime) { - return this.utimesSync(p, atime, mtime); - } - utimesSync(p, atime, mtime) { - if (this.readOnly) - throw EROFS(`utimes '${p}'`); - const resolvedP = this.resolveFilename(`utimes '${p}'`, p); - this.utimesImpl(resolvedP, mtime); - } - async lutimesPromise(p, atime, mtime) { - return this.lutimesSync(p, atime, mtime); - } - lutimesSync(p, atime, mtime) { - if (this.readOnly) - throw EROFS(`lutimes '${p}'`); - const resolvedP = this.resolveFilename(`utimes '${p}'`, p, false); - this.utimesImpl(resolvedP, mtime); - } - utimesImpl(resolvedP, mtime) { - if (this.listings.has(resolvedP)) { - if (!this.entries.has(resolvedP)) - this.hydrateDirectory(resolvedP); - } - const entry = this.entries.get(resolvedP); - if (entry === void 0) - throw new Error(`Unreachable`); - const rc = this.libzip.file.setMtime(this.zip, entry, 0, toUnixTimestamp(mtime), 0); - if (rc === -1) { - throw this.makeLibzipError(this.libzip.getError(this.zip)); - } - } - async mkdirPromise(p, opts) { - return this.mkdirSync(p, opts); - } - mkdirSync(p, { mode = 493, recursive = false } = {}) { - if (recursive) - return this.mkdirpSync(p, { chmod: mode }); - if (this.readOnly) - throw EROFS(`mkdir '${p}'`); - const resolvedP = this.resolveFilename(`mkdir '${p}'`, p); - if (this.entries.has(resolvedP) || this.listings.has(resolvedP)) - throw EEXIST(`mkdir '${p}'`); - this.hydrateDirectory(resolvedP); - this.chmodSync(resolvedP, mode); - return void 0; - } - async rmdirPromise(p, opts) { - return this.rmdirSync(p, opts); - } - rmdirSync(p, { recursive = false } = {}) { - if (this.readOnly) - throw EROFS(`rmdir '${p}'`); - if (recursive) { - this.removeSync(p); - return; - } - const resolvedP = this.resolveFilename(`rmdir '${p}'`, p); - const directoryListing = this.listings.get(resolvedP); - if (!directoryListing) - throw ENOTDIR(`rmdir '${p}'`); - if (directoryListing.size > 0) - throw ENOTEMPTY(`rmdir '${p}'`); - const index = this.entries.get(resolvedP); - if (typeof index === `undefined`) - throw EINVAL(`rmdir '${p}'`); - this.deleteEntry(p, index); - } - async rmPromise(p, opts) { - return this.rmSync(p, opts); - } - rmSync(p, { recursive = false } = {}) { - if (this.readOnly) - throw EROFS(`rm '${p}'`); - if (recursive) { - this.removeSync(p); - return; - } - const resolvedP = this.resolveFilename(`rm '${p}'`, p); - const directoryListing = this.listings.get(resolvedP); - if (!directoryListing) - throw ENOTDIR(`rm '${p}'`); - if (directoryListing.size > 0) - throw ENOTEMPTY(`rm '${p}'`); - const index = this.entries.get(resolvedP); - if (typeof index === `undefined`) - throw EINVAL(`rm '${p}'`); - this.deleteEntry(p, index); - } - hydrateDirectory(resolvedP) { - const index = this.libzip.dir.add(this.zip, ppath.relative(PortablePath.root, resolvedP)); - if (index === -1) - throw this.makeLibzipError(this.libzip.getError(this.zip)); - this.registerListing(resolvedP); - this.registerEntry(resolvedP, index); - return index; - } - async linkPromise(existingP, newP) { - return this.linkSync(existingP, newP); - } - linkSync(existingP, newP) { - throw EOPNOTSUPP(`link '${existingP}' -> '${newP}'`); - } - async symlinkPromise(target, p) { - return this.symlinkSync(target, p); - } - symlinkSync(target, p) { - if (this.readOnly) - throw EROFS(`symlink '${target}' -> '${p}'`); - const resolvedP = this.resolveFilename(`symlink '${target}' -> '${p}'`, p); - if (this.listings.has(resolvedP)) - throw EISDIR(`symlink '${target}' -> '${p}'`); - if (this.entries.has(resolvedP)) - throw EEXIST(`symlink '${target}' -> '${p}'`); - const index = this.setFileSource(resolvedP, target); - this.registerEntry(resolvedP, index); - const rc = this.libzip.file.setExternalAttributes(this.zip, index, 0, 0, this.libzip.ZIP_OPSYS_UNIX, (fs.constants.S_IFLNK | 511) << 16); - if (rc === -1) - throw this.makeLibzipError(this.libzip.getError(this.zip)); - this.symlinkCount += 1; - } - async readFilePromise(p, encoding) { - if (typeof encoding === `object`) - encoding = encoding ? encoding.encoding : void 0; - const data = await this.readFileBuffer(p, { asyncDecompress: true }); - return encoding ? data.toString(encoding) : data; - } - readFileSync(p, encoding) { - if (typeof encoding === `object`) - encoding = encoding ? encoding.encoding : void 0; - const data = this.readFileBuffer(p); - return encoding ? data.toString(encoding) : data; - } - readFileBuffer(p, opts = { asyncDecompress: false }) { - if (typeof p === `number`) - p = this.fdToPath(p, `read`); - const resolvedP = this.resolveFilename(`open '${p}'`, p); - if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) - throw ENOENT(`open '${p}'`); - if (p[p.length - 1] === `/` && !this.listings.has(resolvedP)) - throw ENOTDIR(`open '${p}'`); - if (this.listings.has(resolvedP)) - throw EISDIR(`read`); - const entry = this.entries.get(resolvedP); - if (entry === void 0) - throw new Error(`Unreachable`); - return this.getFileSource(entry, opts); - } - async readdirPromise(p, opts) { - return this.readdirSync(p, opts); - } - readdirSync(p, opts) { - const resolvedP = this.resolveFilename(`scandir '${p}'`, p); - if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) - throw ENOENT(`scandir '${p}'`); - const directoryListing = this.listings.get(resolvedP); - if (!directoryListing) - throw ENOTDIR(`scandir '${p}'`); - if (opts?.recursive) { - if (opts?.withFileTypes) { - const entries = Array.from(directoryListing, (name) => { - return Object.assign(this.statImpl(`lstat`, ppath.join(p, name)), { - name, - path: PortablePath.dot - }); - }); - for (const entry of entries) { - if (!entry.isDirectory()) - continue; - const subPath = ppath.join(entry.path, entry.name); - const subListing = this.listings.get(ppath.join(resolvedP, subPath)); - for (const child of subListing) { - entries.push(Object.assign(this.statImpl(`lstat`, ppath.join(p, subPath, child)), { - name: child, - path: subPath - })); - } - } - return entries; - } else { - const entries = [...directoryListing]; - for (const subPath of entries) { - const subListing = this.listings.get(ppath.join(resolvedP, subPath)); - if (typeof subListing === `undefined`) - continue; - for (const child of subListing) { - entries.push(ppath.join(subPath, child)); - } - } - return entries; - } - } else if (opts?.withFileTypes) { - return Array.from(directoryListing, (name) => { - return Object.assign(this.statImpl(`lstat`, ppath.join(p, name)), { - name, - path: void 0 - }); - }); - } else { - return [...directoryListing]; - } - } - async readlinkPromise(p) { - const entry = this.prepareReadlink(p); - return (await this.getFileSource(entry, { asyncDecompress: true })).toString(); - } - readlinkSync(p) { - const entry = this.prepareReadlink(p); - return this.getFileSource(entry).toString(); - } - prepareReadlink(p) { - const resolvedP = this.resolveFilename(`readlink '${p}'`, p, false); - if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) - throw ENOENT(`readlink '${p}'`); - if (p[p.length - 1] === `/` && !this.listings.has(resolvedP)) - throw ENOTDIR(`open '${p}'`); - if (this.listings.has(resolvedP)) - throw EINVAL(`readlink '${p}'`); - const entry = this.entries.get(resolvedP); - if (entry === void 0) - throw new Error(`Unreachable`); - if (!this.isSymbolicLink(entry)) - throw EINVAL(`readlink '${p}'`); - return entry; - } - async truncatePromise(p, len = 0) { - const resolvedP = this.resolveFilename(`open '${p}'`, p); - const index = this.entries.get(resolvedP); - if (typeof index === `undefined`) - throw EINVAL(`open '${p}'`); - const source = await this.getFileSource(index, { asyncDecompress: true }); - const truncated = Buffer.alloc(len, 0); - source.copy(truncated); - return await this.writeFilePromise(p, truncated); - } - truncateSync(p, len = 0) { - const resolvedP = this.resolveFilename(`open '${p}'`, p); - const index = this.entries.get(resolvedP); - if (typeof index === `undefined`) - throw EINVAL(`open '${p}'`); - const source = this.getFileSource(index); - const truncated = Buffer.alloc(len, 0); - source.copy(truncated); - return this.writeFileSync(p, truncated); - } - async ftruncatePromise(fd, len) { - return this.truncatePromise(this.fdToPath(fd, `ftruncate`), len); - } - ftruncateSync(fd, len) { - return this.truncateSync(this.fdToPath(fd, `ftruncateSync`), len); - } - watch(p, a, b) { - let persistent; - switch (typeof a) { - case `function`: - case `string`: - case `undefined`: - { - persistent = true; - } - break; - default: - { - ({ persistent = true } = a); - } - break; - } - if (!persistent) - return { on: () => { - }, close: () => { - } }; - const interval = setInterval(() => { - }, 24 * 60 * 60 * 1e3); - return { on: () => { - }, close: () => { - clearInterval(interval); - } }; - } - watchFile(p, a, b) { - const resolvedP = ppath.resolve(PortablePath.root, p); - return watchFile(this, resolvedP, a, b); - } - unwatchFile(p, cb) { - const resolvedP = ppath.resolve(PortablePath.root, p); - return unwatchFile(this, resolvedP, cb); - } -} - -setFactory(() => { - const emZip = createModule(); - return makeInterface(emZip); -}); - -var ErrorCode = /* @__PURE__ */ ((ErrorCode2) => { - ErrorCode2["API_ERROR"] = `API_ERROR`; - ErrorCode2["BUILTIN_NODE_RESOLUTION_FAILED"] = `BUILTIN_NODE_RESOLUTION_FAILED`; - ErrorCode2["EXPORTS_RESOLUTION_FAILED"] = `EXPORTS_RESOLUTION_FAILED`; - ErrorCode2["MISSING_DEPENDENCY"] = `MISSING_DEPENDENCY`; - ErrorCode2["MISSING_PEER_DEPENDENCY"] = `MISSING_PEER_DEPENDENCY`; - ErrorCode2["QUALIFIED_PATH_RESOLUTION_FAILED"] = `QUALIFIED_PATH_RESOLUTION_FAILED`; - ErrorCode2["INTERNAL"] = `INTERNAL`; - ErrorCode2["UNDECLARED_DEPENDENCY"] = `UNDECLARED_DEPENDENCY`; - ErrorCode2["UNSUPPORTED"] = `UNSUPPORTED`; - return ErrorCode2; -})(ErrorCode || {}); -const MODULE_NOT_FOUND_ERRORS = /* @__PURE__ */ new Set([ - "BUILTIN_NODE_RESOLUTION_FAILED" /* BUILTIN_NODE_RESOLUTION_FAILED */, - "MISSING_DEPENDENCY" /* MISSING_DEPENDENCY */, - "MISSING_PEER_DEPENDENCY" /* MISSING_PEER_DEPENDENCY */, - "QUALIFIED_PATH_RESOLUTION_FAILED" /* QUALIFIED_PATH_RESOLUTION_FAILED */, - "UNDECLARED_DEPENDENCY" /* UNDECLARED_DEPENDENCY */ -]); -function makeError(pnpCode, message, data = {}, code) { - code ??= MODULE_NOT_FOUND_ERRORS.has(pnpCode) ? `MODULE_NOT_FOUND` : pnpCode; - const propertySpec = { - configurable: true, - writable: true, - enumerable: false - }; - return Object.defineProperties(new Error(message), { - code: { - ...propertySpec, - value: code - }, - pnpCode: { - ...propertySpec, - value: pnpCode - }, - data: { - ...propertySpec, - value: data - } - }); -} -function getIssuerModule(parent) { - let issuer = parent; - while (issuer && (issuer.id === `[eval]` || issuer.id === `` || !issuer.filename)) - issuer = issuer.parent; - return issuer || null; -} -function getPathForDisplay(p) { - return npath.normalize(npath.fromPortablePath(p)); -} - -const [major, minor] = process.versions.node.split(`.`).map((value) => parseInt(value, 10)); -const WATCH_MODE_MESSAGE_USES_ARRAYS = major > 19 || major === 19 && minor >= 2 || major === 18 && minor >= 13; - -function readPackageScope(checkPath) { - const rootSeparatorIndex = checkPath.indexOf(npath.sep); - let separatorIndex; - do { - separatorIndex = checkPath.lastIndexOf(npath.sep); - checkPath = checkPath.slice(0, separatorIndex); - if (checkPath.endsWith(`${npath.sep}node_modules`)) - return false; - const pjson = readPackage(checkPath + npath.sep); - if (pjson) { - return { - data: pjson, - path: checkPath - }; - } - } while (separatorIndex > rootSeparatorIndex); - return false; -} -function readPackage(requestPath) { - const jsonPath = npath.resolve(requestPath, `package.json`); - if (!fs__default.default.existsSync(jsonPath)) - return null; - return JSON.parse(fs__default.default.readFileSync(jsonPath, `utf8`)); -} -function ERR_REQUIRE_ESM(filename, parentPath = null) { - const basename = parentPath && path__default.default.basename(filename) === path__default.default.basename(parentPath) ? filename : path__default.default.basename(filename); - const msg = `require() of ES Module ${filename}${parentPath ? ` from ${parentPath}` : ``} not supported. -Instead change the require of ${basename} in ${parentPath} to a dynamic import() which is available in all CommonJS modules.`; - const err = new Error(msg); - err.code = `ERR_REQUIRE_ESM`; - return err; -} -function reportRequiredFilesToWatchMode(files) { - if (process.env.WATCH_REPORT_DEPENDENCIES && process.send) { - files = files.map((filename) => npath.fromPortablePath(VirtualFS.resolveVirtual(npath.toPortablePath(filename)))); - if (WATCH_MODE_MESSAGE_USES_ARRAYS) { - process.send({ "watch:require": files }); - } else { - for (const filename of files) { - process.send({ "watch:require": filename }); - } - } - } -} - -function applyPatch(pnpapi, opts) { - let enableNativeHooks = true; - process.versions.pnp = String(pnpapi.VERSIONS.std); - const moduleExports = require$$0__default.default; - moduleExports.findPnpApi = (lookupSource) => { - const lookupPath = lookupSource instanceof URL ? url.fileURLToPath(lookupSource) : lookupSource; - const apiPath = opts.manager.findApiPathFor(lookupPath); - if (apiPath === null) - return null; - const apiEntry = opts.manager.getApiEntry(apiPath, true); - return apiEntry.instance.findPackageLocator(lookupPath) ? apiEntry.instance : null; - }; - function getRequireStack(parent) { - const requireStack = []; - for (let cursor = parent; cursor; cursor = cursor.parent) - requireStack.push(cursor.filename || cursor.id); - return requireStack; - } - const originalModuleLoad = require$$0.Module._load; - require$$0.Module._load = function(request, parent, isMain) { - if (request === `pnpapi`) { - const parentApiPath = opts.manager.getApiPathFromParent(parent); - if (parentApiPath) { - return opts.manager.getApiEntry(parentApiPath, true).instance; - } - } - return originalModuleLoad.call(require$$0.Module, request, parent, isMain); - }; - function getIssuerSpecsFromPaths(paths) { - return paths.map((path) => ({ - apiPath: opts.manager.findApiPathFor(path), - path, - module: null - })); - } - function getIssuerSpecsFromModule(module) { - if (module && module.id !== `` && module.id !== `internal/preload` && !module.parent && !module.filename && module.paths.length > 0) { - return [{ - apiPath: opts.manager.findApiPathFor(module.paths[0]), - path: module.paths[0], - module - }]; - } - const issuer = getIssuerModule(module); - if (issuer !== null) { - const path = npath.dirname(issuer.filename); - const apiPath = opts.manager.getApiPathFromParent(issuer); - return [{ apiPath, path, module }]; - } else { - const path = process.cwd(); - const apiPath = opts.manager.findApiPathFor(npath.join(path, `[file]`)) ?? opts.manager.getApiPathFromParent(null); - return [{ apiPath, path, module }]; - } - } - function makeFakeParent(path) { - const fakeParent = new require$$0.Module(``); - const fakeFilePath = npath.join(path, `[file]`); - fakeParent.paths = require$$0.Module._nodeModulePaths(fakeFilePath); - return fakeParent; - } - const pathRegExp = /^(?![a-zA-Z]:[\\/]|\\\\|\.{0,2}(?:\/|$))((?:@[^/]+\/)?[^/]+)\/*(.*|)$/; - const originalModuleResolveFilename = require$$0.Module._resolveFilename; - require$$0.Module._resolveFilename = function(request, parent, isMain, options) { - if (require$$0.isBuiltin(request)) - return request; - if (!enableNativeHooks) - return originalModuleResolveFilename.call(require$$0.Module, request, parent, isMain, options); - if (options && options.plugnplay === false) { - const { plugnplay, ...forwardedOptions } = options; - try { - enableNativeHooks = false; - return originalModuleResolveFilename.call(require$$0.Module, request, parent, isMain, forwardedOptions); - } finally { - enableNativeHooks = true; - } - } - if (options) { - const optionNames = new Set(Object.keys(options)); - optionNames.delete(`paths`); - optionNames.delete(`plugnplay`); - if (optionNames.size > 0) { - throw makeError( - ErrorCode.UNSUPPORTED, - `Some options passed to require() aren't supported by PnP yet (${Array.from(optionNames).join(`, `)})` - ); - } - } - const issuerSpecs = options && options.paths ? getIssuerSpecsFromPaths(options.paths) : getIssuerSpecsFromModule(parent); - if (request.match(pathRegExp) === null) { - const parentDirectory = parent?.filename != null ? npath.dirname(parent.filename) : null; - const absoluteRequest = npath.isAbsolute(request) ? request : parentDirectory !== null ? npath.resolve(parentDirectory, request) : null; - if (absoluteRequest !== null) { - const apiPath = parent && parentDirectory === npath.dirname(absoluteRequest) ? opts.manager.getApiPathFromParent(parent) : opts.manager.findApiPathFor(absoluteRequest); - if (apiPath !== null) { - issuerSpecs.unshift({ - apiPath, - path: parentDirectory, - module: null - }); - } - } - } - let firstError; - for (const { apiPath, path, module } of issuerSpecs) { - let resolution; - const issuerApi = apiPath !== null ? opts.manager.getApiEntry(apiPath, true).instance : null; - try { - if (issuerApi !== null) { - resolution = issuerApi.resolveRequest(request, path !== null ? `${path}/` : null); - } else { - if (path === null) - throw new Error(`Assertion failed: Expected the path to be set`); - resolution = originalModuleResolveFilename.call(require$$0.Module, request, module || makeFakeParent(path), isMain); - } - } catch (error) { - firstError = firstError || error; - continue; - } - if (resolution !== null) { - return resolution; - } - } - const requireStack = getRequireStack(parent); - Object.defineProperty(firstError, `requireStack`, { - configurable: true, - writable: true, - enumerable: false, - value: requireStack - }); - if (requireStack.length > 0) - firstError.message += ` -Require stack: -- ${requireStack.join(` -- `)}`; - if (typeof firstError.pnpCode === `string`) - Error.captureStackTrace(firstError); - throw firstError; - }; - const originalFindPath = require$$0.Module._findPath; - require$$0.Module._findPath = function(request, paths, isMain) { - if (request === `pnpapi`) - return false; - if (!enableNativeHooks) - return originalFindPath.call(require$$0.Module, request, paths, isMain); - const isAbsolute = npath.isAbsolute(request); - if (isAbsolute) - paths = [``]; - else if (!paths || paths.length === 0) - return false; - for (const path of paths) { - let resolution; - try { - const pnpApiPath = opts.manager.findApiPathFor(isAbsolute ? request : path); - if (pnpApiPath !== null) { - const api = opts.manager.getApiEntry(pnpApiPath, true).instance; - resolution = api.resolveRequest(request, path) || false; - } else { - resolution = originalFindPath.call(require$$0.Module, request, [path], isMain); - } - } catch (error) { - continue; - } - if (resolution) { - return resolution; - } - } - return false; - }; - const originalExtensionJSFunction = require$$0.Module._extensions[`.js`]; - require$$0.Module._extensions[`.js`] = function(module, filename) { - if (filename.endsWith(`.js`)) { - const pkg = readPackageScope(filename); - if (pkg && pkg.data?.type === `module`) { - const err = ERR_REQUIRE_ESM(filename, module.parent?.filename); - Error.captureStackTrace(err); - throw err; - } - } - originalExtensionJSFunction.call(this, module, filename); - }; - const originalDlopen = process.dlopen; - process.dlopen = function(...args) { - const [module, filename, ...rest] = args; - return originalDlopen.call( - this, - module, - npath.fromPortablePath(VirtualFS.resolveVirtual(npath.toPortablePath(filename))), - ...rest - ); - }; - const originalEmit = process.emit; - process.emit = function(name, data, ...args) { - if (name === `warning` && typeof data === `object` && data.name === `ExperimentalWarning` && (data.message.includes(`--experimental-loader`) || data.message.includes(`Custom ESM Loaders is an experimental feature`))) - return false; - return originalEmit.apply(process, arguments); - }; - patchFs(fs__default.default, new PosixFS(opts.fakeFs)); -} - -function hydrateRuntimeState(data, { basePath }) { - const portablePath = npath.toPortablePath(basePath); - const absolutePortablePath = ppath.resolve(portablePath); - const ignorePattern = data.ignorePatternData !== null ? new RegExp(data.ignorePatternData) : null; - const packageLocatorsByLocations = /* @__PURE__ */ new Map(); - const packageRegistry = new Map(data.packageRegistryData.map(([packageName, packageStoreData]) => { - return [packageName, new Map(packageStoreData.map(([packageReference, packageInformationData]) => { - if (packageName === null !== (packageReference === null)) - throw new Error(`Assertion failed: The name and reference should be null, or neither should`); - const discardFromLookup = packageInformationData.discardFromLookup ?? false; - const packageLocator = { name: packageName, reference: packageReference }; - const entry = packageLocatorsByLocations.get(packageInformationData.packageLocation); - if (!entry) { - packageLocatorsByLocations.set(packageInformationData.packageLocation, { locator: packageLocator, discardFromLookup }); - } else { - entry.discardFromLookup = entry.discardFromLookup && discardFromLookup; - if (!discardFromLookup) { - entry.locator = packageLocator; - } - } - let resolvedPackageLocation = null; - return [packageReference, { - packageDependencies: new Map(packageInformationData.packageDependencies), - packagePeers: new Set(packageInformationData.packagePeers), - linkType: packageInformationData.linkType, - discardFromLookup, - get packageLocation() { - return resolvedPackageLocation || (resolvedPackageLocation = ppath.join(absolutePortablePath, packageInformationData.packageLocation)); - } - }]; - }))]; - })); - const fallbackExclusionList = new Map(data.fallbackExclusionList.map(([packageName, packageReferences]) => { - return [packageName, new Set(packageReferences)]; - })); - const fallbackPool = new Map(data.fallbackPool); - const dependencyTreeRoots = data.dependencyTreeRoots; - const enableTopLevelFallback = data.enableTopLevelFallback; - return { - basePath: portablePath, - dependencyTreeRoots, - enableTopLevelFallback, - fallbackExclusionList, - fallbackPool, - ignorePattern, - packageLocatorsByLocations, - packageRegistry - }; -} - -const ArrayIsArray = Array.isArray; -const JSONStringify = JSON.stringify; -const ObjectGetOwnPropertyNames = Object.getOwnPropertyNames; -const ObjectPrototypeHasOwnProperty = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop); -const RegExpPrototypeExec = (obj, string) => RegExp.prototype.exec.call(obj, string); -const RegExpPrototypeSymbolReplace = (obj, ...rest) => RegExp.prototype[Symbol.replace].apply(obj, rest); -const StringPrototypeEndsWith = (str, ...rest) => String.prototype.endsWith.apply(str, rest); -const StringPrototypeIncludes = (str, ...rest) => String.prototype.includes.apply(str, rest); -const StringPrototypeLastIndexOf = (str, ...rest) => String.prototype.lastIndexOf.apply(str, rest); -const StringPrototypeIndexOf = (str, ...rest) => String.prototype.indexOf.apply(str, rest); -const StringPrototypeReplace = (str, ...rest) => String.prototype.replace.apply(str, rest); -const StringPrototypeSlice = (str, ...rest) => String.prototype.slice.apply(str, rest); -const StringPrototypeStartsWith = (str, ...rest) => String.prototype.startsWith.apply(str, rest); -const SafeMap = Map; -const JSONParse = JSON.parse; - -function createErrorType(code, messageCreator, errorType) { - return class extends errorType { - constructor(...args) { - super(messageCreator(...args)); - this.code = code; - this.name = `${errorType.name} [${code}]`; - } - }; -} -const ERR_PACKAGE_IMPORT_NOT_DEFINED = createErrorType( - `ERR_PACKAGE_IMPORT_NOT_DEFINED`, - (specifier, packagePath, base) => { - return `Package import specifier "${specifier}" is not defined${packagePath ? ` in package ${packagePath}package.json` : ``} imported from ${base}`; - }, - TypeError -); -const ERR_INVALID_MODULE_SPECIFIER = createErrorType( - `ERR_INVALID_MODULE_SPECIFIER`, - (request, reason, base = void 0) => { - return `Invalid module "${request}" ${reason}${base ? ` imported from ${base}` : ``}`; - }, - TypeError -); -const ERR_INVALID_PACKAGE_TARGET = createErrorType( - `ERR_INVALID_PACKAGE_TARGET`, - (pkgPath, key, target, isImport = false, base = void 0) => { - const relError = typeof target === `string` && !isImport && target.length && !StringPrototypeStartsWith(target, `./`); - if (key === `.`) { - assert__default.default(isImport === false); - return `Invalid "exports" main target ${JSONStringify(target)} defined in the package config ${pkgPath}package.json${base ? ` imported from ${base}` : ``}${relError ? `; targets must start with "./"` : ``}`; - } - return `Invalid "${isImport ? `imports` : `exports`}" target ${JSONStringify( - target - )} defined for '${key}' in the package config ${pkgPath}package.json${base ? ` imported from ${base}` : ``}${relError ? `; targets must start with "./"` : ``}`; - }, - Error -); -const ERR_INVALID_PACKAGE_CONFIG = createErrorType( - `ERR_INVALID_PACKAGE_CONFIG`, - (path, base, message) => { - return `Invalid package config ${path}${base ? ` while importing ${base}` : ``}${message ? `. ${message}` : ``}`; - }, - Error -); -const ERR_PACKAGE_PATH_NOT_EXPORTED = createErrorType( - "ERR_PACKAGE_PATH_NOT_EXPORTED", - (pkgPath, subpath, base = void 0) => { - if (subpath === ".") - return `No "exports" main defined in ${pkgPath}package.json${base ? ` imported from ${base}` : ""}`; - return `Package subpath '${subpath}' is not defined by "exports" in ${pkgPath}package.json${base ? ` imported from ${base}` : ""}`; - }, - Error -); - -function filterOwnProperties(source, keys) { - const filtered = /* @__PURE__ */ Object.create(null); - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - if (ObjectPrototypeHasOwnProperty(source, key)) { - filtered[key] = source[key]; - } - } - return filtered; -} - -const packageJSONCache = new SafeMap(); -function getPackageConfig(path, specifier, base, readFileSyncFn) { - const existing = packageJSONCache.get(path); - if (existing !== void 0) { - return existing; - } - const source = readFileSyncFn(path); - if (source === void 0) { - const packageConfig2 = { - pjsonPath: path, - exists: false, - main: void 0, - name: void 0, - type: "none", - exports: void 0, - imports: void 0 - }; - packageJSONCache.set(path, packageConfig2); - return packageConfig2; - } - let packageJSON; - try { - packageJSON = JSONParse(source); - } catch (error) { - throw new ERR_INVALID_PACKAGE_CONFIG( - path, - (base ? `"${specifier}" from ` : "") + url.fileURLToPath(base || specifier), - error.message - ); - } - let { imports, main, name, type } = filterOwnProperties(packageJSON, [ - "imports", - "main", - "name", - "type" - ]); - const exports = ObjectPrototypeHasOwnProperty(packageJSON, "exports") ? packageJSON.exports : void 0; - if (typeof imports !== "object" || imports === null) { - imports = void 0; - } - if (typeof main !== "string") { - main = void 0; - } - if (typeof name !== "string") { - name = void 0; - } - if (type !== "module" && type !== "commonjs") { - type = "none"; - } - const packageConfig = { - pjsonPath: path, - exists: true, - main, - name, - type, - exports, - imports - }; - packageJSONCache.set(path, packageConfig); - return packageConfig; -} -function getPackageScopeConfig(resolved, readFileSyncFn) { - let packageJSONUrl = new URL("./package.json", resolved); - while (true) { - const packageJSONPath2 = packageJSONUrl.pathname; - if (StringPrototypeEndsWith(packageJSONPath2, "node_modules/package.json")) { - break; - } - const packageConfig2 = getPackageConfig( - url.fileURLToPath(packageJSONUrl), - resolved, - void 0, - readFileSyncFn - ); - if (packageConfig2.exists) { - return packageConfig2; - } - const lastPackageJSONUrl = packageJSONUrl; - packageJSONUrl = new URL("../package.json", packageJSONUrl); - if (packageJSONUrl.pathname === lastPackageJSONUrl.pathname) { - break; - } - } - const packageJSONPath = url.fileURLToPath(packageJSONUrl); - const packageConfig = { - pjsonPath: packageJSONPath, - exists: false, - main: void 0, - name: void 0, - type: "none", - exports: void 0, - imports: void 0 - }; - packageJSONCache.set(packageJSONPath, packageConfig); - return packageConfig; -} - -function throwImportNotDefined(specifier, packageJSONUrl, base) { - throw new ERR_PACKAGE_IMPORT_NOT_DEFINED( - specifier, - packageJSONUrl && url.fileURLToPath(new URL(".", packageJSONUrl)), - url.fileURLToPath(base) - ); -} -function throwInvalidSubpath(subpath, packageJSONUrl, internal, base) { - const reason = `request is not a valid subpath for the "${internal ? "imports" : "exports"}" resolution of ${url.fileURLToPath(packageJSONUrl)}`; - throw new ERR_INVALID_MODULE_SPECIFIER( - subpath, - reason, - base && url.fileURLToPath(base) - ); -} -function throwInvalidPackageTarget(subpath, target, packageJSONUrl, internal, base) { - if (typeof target === "object" && target !== null) { - target = JSONStringify(target, null, ""); - } else { - target = `${target}`; - } - throw new ERR_INVALID_PACKAGE_TARGET( - url.fileURLToPath(new URL(".", packageJSONUrl)), - subpath, - target, - internal, - base && url.fileURLToPath(base) - ); -} -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; -const patternRegEx = /\*/g; -function resolvePackageTargetString(target, subpath, match, packageJSONUrl, base, pattern, internal, conditions) { - if (subpath !== "" && !pattern && target[target.length - 1] !== "/") - throwInvalidPackageTarget(match, target, packageJSONUrl, internal, base); - if (!StringPrototypeStartsWith(target, "./")) { - if (internal && !StringPrototypeStartsWith(target, "../") && !StringPrototypeStartsWith(target, "/")) { - let isURL = false; - try { - new URL(target); - isURL = true; - } catch { - } - if (!isURL) { - const exportTarget = pattern ? RegExpPrototypeSymbolReplace(patternRegEx, target, () => subpath) : target + subpath; - return exportTarget; - } - } - throwInvalidPackageTarget(match, target, packageJSONUrl, internal, base); - } - if (RegExpPrototypeExec( - invalidSegmentRegEx, - StringPrototypeSlice(target, 2) - ) !== null) - throwInvalidPackageTarget(match, target, packageJSONUrl, internal, base); - const resolved = new URL(target, packageJSONUrl); - const resolvedPath = resolved.pathname; - const packagePath = new URL(".", packageJSONUrl).pathname; - if (!StringPrototypeStartsWith(resolvedPath, packagePath)) - throwInvalidPackageTarget(match, target, packageJSONUrl, internal, base); - if (subpath === "") - return resolved; - if (RegExpPrototypeExec(invalidSegmentRegEx, subpath) !== null) { - const request = pattern ? StringPrototypeReplace(match, "*", () => subpath) : match + subpath; - throwInvalidSubpath(request, packageJSONUrl, internal, base); - } - if (pattern) { - return new URL( - RegExpPrototypeSymbolReplace(patternRegEx, resolved.href, () => subpath) - ); - } - return new URL(subpath, resolved); -} -function isArrayIndex(key) { - const keyNum = +key; - if (`${keyNum}` !== key) - return false; - return keyNum >= 0 && keyNum < 4294967295; -} -function resolvePackageTarget(packageJSONUrl, target, subpath, packageSubpath, base, pattern, internal, conditions) { - if (typeof target === "string") { - return resolvePackageTargetString( - target, - subpath, - packageSubpath, - packageJSONUrl, - base, - pattern, - internal); - } else if (ArrayIsArray(target)) { - if (target.length === 0) { - return null; - } - let lastException; - for (let i = 0; i < target.length; i++) { - const targetItem = target[i]; - let resolveResult; - try { - resolveResult = resolvePackageTarget( - packageJSONUrl, - targetItem, - subpath, - packageSubpath, - base, - pattern, - internal, - conditions - ); - } catch (e) { - lastException = e; - if (e.code === "ERR_INVALID_PACKAGE_TARGET") { - continue; - } - throw e; - } - if (resolveResult === void 0) { - continue; - } - if (resolveResult === null) { - lastException = null; - continue; - } - return resolveResult; - } - if (lastException === void 0 || lastException === null) - return lastException; - throw lastException; - } else if (typeof target === "object" && target !== null) { - const keys = ObjectGetOwnPropertyNames(target); - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - if (isArrayIndex(key)) { - throw new ERR_INVALID_PACKAGE_CONFIG( - url.fileURLToPath(packageJSONUrl), - base, - '"exports" cannot contain numeric property keys.' - ); - } - } - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - if (key === "default" || conditions.has(key)) { - const conditionalTarget = target[key]; - const resolveResult = resolvePackageTarget( - packageJSONUrl, - conditionalTarget, - subpath, - packageSubpath, - base, - pattern, - internal, - conditions - ); - if (resolveResult === void 0) - continue; - return resolveResult; - } - } - return void 0; - } else if (target === null) { - return null; - } - throwInvalidPackageTarget( - packageSubpath, - target, - packageJSONUrl, - internal, - base - ); -} -function patternKeyCompare(a, b) { - const aPatternIndex = StringPrototypeIndexOf(a, "*"); - const bPatternIndex = StringPrototypeIndexOf(b, "*"); - 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; -} -function isConditionalExportsMainSugar(exports, packageJSONUrl, base) { - if (typeof exports === "string" || ArrayIsArray(exports)) - return true; - if (typeof exports !== "object" || exports === null) - return false; - const keys = ObjectGetOwnPropertyNames(exports); - let isConditionalSugar = false; - let i = 0; - for (let j = 0; j < keys.length; j++) { - const key = keys[j]; - const curIsConditionalSugar = key === "" || key[0] !== "."; - if (i++ === 0) { - isConditionalSugar = curIsConditionalSugar; - } else if (isConditionalSugar !== curIsConditionalSugar) { - throw new ERR_INVALID_PACKAGE_CONFIG( - url.fileURLToPath(packageJSONUrl), - base, - `"exports" cannot contain some keys starting with '.' and some not. The exports object must either be an object of package subpath keys or an object of main entry condition name keys only.` - ); - } - } - return isConditionalSugar; -} -function throwExportsNotFound(subpath, packageJSONUrl, base) { - throw new ERR_PACKAGE_PATH_NOT_EXPORTED( - url.fileURLToPath(new URL(".", packageJSONUrl)), - subpath, - base && url.fileURLToPath(base) - ); -} -const emittedPackageWarnings = /* @__PURE__ */ new Set(); -function emitTrailingSlashPatternDeprecation(match, pjsonUrl, base) { - const pjsonPath = url.fileURLToPath(pjsonUrl); - if (emittedPackageWarnings.has(pjsonPath + "|" + match)) - return; - emittedPackageWarnings.add(pjsonPath + "|" + match); - process.emitWarning( - `Use of deprecated trailing slash pattern mapping "${match}" in the "exports" field module resolution of the package at ${pjsonPath}${base ? ` imported from ${url.fileURLToPath(base)}` : ""}. Mapping specifiers ending in "/" is no longer supported.`, - "DeprecationWarning", - "DEP0155" - ); -} -function packageExportsResolve({ - packageJSONUrl, - packageSubpath, - exports, - base, - conditions -}) { - if (isConditionalExportsMainSugar(exports, packageJSONUrl, base)) - exports = { ".": exports }; - if (ObjectPrototypeHasOwnProperty(exports, packageSubpath) && !StringPrototypeIncludes(packageSubpath, "*") && !StringPrototypeEndsWith(packageSubpath, "/")) { - const target = exports[packageSubpath]; - const resolveResult = resolvePackageTarget( - packageJSONUrl, - target, - "", - packageSubpath, - base, - false, - false, - conditions - ); - if (resolveResult == null) { - throwExportsNotFound(packageSubpath, packageJSONUrl, base); - } - return resolveResult; - } - let bestMatch = ""; - let bestMatchSubpath; - const keys = ObjectGetOwnPropertyNames(exports); - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - const patternIndex = StringPrototypeIndexOf(key, "*"); - if (patternIndex !== -1 && StringPrototypeStartsWith( - packageSubpath, - StringPrototypeSlice(key, 0, patternIndex) - )) { - if (StringPrototypeEndsWith(packageSubpath, "/")) - emitTrailingSlashPatternDeprecation( - packageSubpath, - packageJSONUrl, - base - ); - const patternTrailer = StringPrototypeSlice(key, patternIndex + 1); - if (packageSubpath.length >= key.length && StringPrototypeEndsWith(packageSubpath, patternTrailer) && patternKeyCompare(bestMatch, key) === 1 && StringPrototypeLastIndexOf(key, "*") === patternIndex) { - bestMatch = key; - bestMatchSubpath = StringPrototypeSlice( - packageSubpath, - patternIndex, - packageSubpath.length - patternTrailer.length - ); - } - } - } - if (bestMatch) { - const target = exports[bestMatch]; - const resolveResult = resolvePackageTarget( - packageJSONUrl, - target, - bestMatchSubpath, - bestMatch, - base, - true, - false, - conditions - ); - if (resolveResult == null) { - throwExportsNotFound(packageSubpath, packageJSONUrl, base); - } - return resolveResult; - } - throwExportsNotFound(packageSubpath, packageJSONUrl, base); -} -function packageImportsResolve({ name, base, conditions, readFileSyncFn }) { - if (name === "#" || StringPrototypeStartsWith(name, "#/") || StringPrototypeEndsWith(name, "/")) { - const reason = "is not a valid internal imports specifier name"; - throw new ERR_INVALID_MODULE_SPECIFIER(name, reason, url.fileURLToPath(base)); - } - let packageJSONUrl; - const packageConfig = getPackageScopeConfig(base, readFileSyncFn); - if (packageConfig.exists) { - packageJSONUrl = url.pathToFileURL(packageConfig.pjsonPath); - const imports = packageConfig.imports; - if (imports) { - if (ObjectPrototypeHasOwnProperty(imports, name) && !StringPrototypeIncludes(name, "*")) { - const resolveResult = resolvePackageTarget( - packageJSONUrl, - imports[name], - "", - name, - base, - false, - true, - conditions - ); - if (resolveResult != null) { - return resolveResult; - } - } else { - let bestMatch = ""; - let bestMatchSubpath; - const keys = ObjectGetOwnPropertyNames(imports); - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - const patternIndex = StringPrototypeIndexOf(key, "*"); - if (patternIndex !== -1 && StringPrototypeStartsWith( - name, - StringPrototypeSlice(key, 0, patternIndex) - )) { - const patternTrailer = StringPrototypeSlice(key, patternIndex + 1); - if (name.length >= key.length && StringPrototypeEndsWith(name, patternTrailer) && patternKeyCompare(bestMatch, key) === 1 && StringPrototypeLastIndexOf(key, "*") === patternIndex) { - bestMatch = key; - bestMatchSubpath = StringPrototypeSlice( - name, - patternIndex, - name.length - patternTrailer.length - ); - } - } - } - if (bestMatch) { - const target = imports[bestMatch]; - const resolveResult = resolvePackageTarget( - packageJSONUrl, - target, - bestMatchSubpath, - bestMatch, - base, - true, - true, - conditions - ); - if (resolveResult != null) { - return resolveResult; - } - } - } - } - } - throwImportNotDefined(name, packageJSONUrl, base); -} - -const flagSymbol = Symbol('arg flag'); - -class ArgError extends Error { - constructor(msg, code) { - super(msg); - this.name = 'ArgError'; - this.code = code; - - Object.setPrototypeOf(this, ArgError.prototype); - } -} - -function arg( - opts, - { - argv = process.argv.slice(2), - permissive = false, - stopAtPositional = false - } = {} -) { - if (!opts) { - throw new ArgError( - 'argument specification object is required', - 'ARG_CONFIG_NO_SPEC' - ); - } - - const result = { _: [] }; - - const aliases = {}; - const handlers = {}; - - for (const key of Object.keys(opts)) { - if (!key) { - throw new ArgError( - 'argument key cannot be an empty string', - 'ARG_CONFIG_EMPTY_KEY' - ); - } - - if (key[0] !== '-') { - throw new ArgError( - `argument key must start with '-' but found: '${key}'`, - 'ARG_CONFIG_NONOPT_KEY' - ); - } - - if (key.length === 1) { - throw new ArgError( - `argument key must have a name; singular '-' keys are not allowed: ${key}`, - 'ARG_CONFIG_NONAME_KEY' - ); - } - - if (typeof opts[key] === 'string') { - aliases[key] = opts[key]; - continue; - } - - let type = opts[key]; - let isFlag = false; - - if ( - Array.isArray(type) && - type.length === 1 && - typeof type[0] === 'function' - ) { - const [fn] = type; - type = (value, name, prev = []) => { - prev.push(fn(value, name, prev[prev.length - 1])); - return prev; - }; - isFlag = fn === Boolean || fn[flagSymbol] === true; - } else if (typeof type === 'function') { - isFlag = type === Boolean || type[flagSymbol] === true; - } else { - throw new ArgError( - `type missing or not a function or valid array type: ${key}`, - 'ARG_CONFIG_VAD_TYPE' - ); - } - - if (key[1] !== '-' && key.length > 2) { - throw new ArgError( - `short argument keys (with a single hyphen) must have only one character: ${key}`, - 'ARG_CONFIG_SHORTOPT_TOOLONG' - ); - } - - handlers[key] = [type, isFlag]; - } - - for (let i = 0, len = argv.length; i < len; i++) { - const wholeArg = argv[i]; - - if (stopAtPositional && result._.length > 0) { - result._ = result._.concat(argv.slice(i)); - break; - } - - if (wholeArg === '--') { - result._ = result._.concat(argv.slice(i + 1)); - break; - } - - if (wholeArg.length > 1 && wholeArg[0] === '-') { - /* eslint-disable operator-linebreak */ - const separatedArguments = - wholeArg[1] === '-' || wholeArg.length === 2 - ? [wholeArg] - : wholeArg - .slice(1) - .split('') - .map((a) => `-${a}`); - /* eslint-enable operator-linebreak */ - - for (let j = 0; j < separatedArguments.length; j++) { - const arg = separatedArguments[j]; - const [originalArgName, argStr] = - arg[1] === '-' ? arg.split(/=(.*)/, 2) : [arg, undefined]; - - let argName = originalArgName; - while (argName in aliases) { - argName = aliases[argName]; - } - - if (!(argName in handlers)) { - if (permissive) { - result._.push(arg); - continue; - } else { - throw new ArgError( - `unknown or unexpected option: ${originalArgName}`, - 'ARG_UNKNOWN_OPTION' - ); - } - } - - const [type, isFlag] = handlers[argName]; - - if (!isFlag && j + 1 < separatedArguments.length) { - throw new ArgError( - `option requires argument (but was followed by another short argument): ${originalArgName}`, - 'ARG_MISSING_REQUIRED_SHORTARG' - ); - } - - if (isFlag) { - result[argName] = type(true, argName, result[argName]); - } else if (argStr === undefined) { - if ( - argv.length < i + 2 || - (argv[i + 1].length > 1 && - argv[i + 1][0] === '-' && - !( - argv[i + 1].match(/^-?\d*(\.(?=\d))?\d*$/) && - (type === Number || - // eslint-disable-next-line no-undef - (typeof BigInt !== 'undefined' && type === BigInt)) - )) - ) { - const extended = - originalArgName === argName ? '' : ` (alias for ${argName})`; - throw new ArgError( - `option requires argument: ${originalArgName}${extended}`, - 'ARG_MISSING_REQUIRED_LONGARG' - ); - } - - result[argName] = type(argv[i + 1], argName, result[argName]); - ++i; - } else { - result[argName] = type(argStr, argName, result[argName]); - } - } - } else { - result._.push(wholeArg); - } - } - - return result; -} - -arg.flag = (fn) => { - fn[flagSymbol] = true; - return fn; -}; - -// Utility types -arg.COUNT = arg.flag((v, name, existingCount) => (existingCount || 0) + 1); - -// Expose error class -arg.ArgError = ArgError; - -var arg_1 = arg; - -/** - @license - The MIT License (MIT) - - Copyright (c) 2014 Blake Embrey (hello@blakeembrey.com) - - 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. -*/ -function getOptionValue(opt) { - parseOptions(); - return options[opt]; -} -let options; -function parseOptions() { - if (!options) { - options = { - "--conditions": [], - ...parseArgv(getNodeOptionsEnvArgv()), - ...parseArgv(process.execArgv) - }; - } -} -function parseArgv(argv) { - return arg_1( - { - "--conditions": [String], - "-C": "--conditions" - }, - { - argv, - permissive: true - } - ); -} -function getNodeOptionsEnvArgv() { - const errors = []; - const envArgv = ParseNodeOptionsEnvVar(process.env.NODE_OPTIONS || "", errors); - if (errors.length !== 0) ; - return envArgv; -} -function ParseNodeOptionsEnvVar(node_options, errors) { - const env_argv = []; - let is_in_string = false; - let will_start_new_arg = true; - for (let index = 0; index < node_options.length; ++index) { - let c = node_options[index]; - if (c === "\\" && is_in_string) { - if (index + 1 === node_options.length) { - errors.push("invalid value for NODE_OPTIONS (invalid escape)\n"); - return env_argv; - } else { - c = node_options[++index]; - } - } else if (c === " " && !is_in_string) { - will_start_new_arg = true; - continue; - } else if (c === '"') { - is_in_string = !is_in_string; - continue; - } - if (will_start_new_arg) { - env_argv.push(c); - will_start_new_arg = false; - } else { - env_argv[env_argv.length - 1] += c; - } - } - if (is_in_string) { - errors.push("invalid value for NODE_OPTIONS (unterminated string)\n"); - } - return env_argv; -} - -function makeApi(runtimeState, opts) { - const alwaysWarnOnFallback = Number(process.env.PNP_ALWAYS_WARN_ON_FALLBACK) > 0; - const debugLevel = Number(process.env.PNP_DEBUG_LEVEL); - const pathRegExp = /^(?![a-zA-Z]:[\\/]|\\\\|\.{0,2}(?:\/|$))((?:node:)?(?:@[^/]+\/)?[^/]+)\/*(.*|)$/; - const isStrictRegExp = /^(\/|\.{1,2}(\/|$))/; - const isDirRegExp = /\/$/; - const isRelativeRegexp = /^\.{0,2}\//; - const topLevelLocator = { name: null, reference: null }; - const fallbackLocators = []; - const emittedWarnings = /* @__PURE__ */ new Set(); - if (runtimeState.enableTopLevelFallback === true) - fallbackLocators.push(topLevelLocator); - if (opts.compatibilityMode !== false) { - for (const name of [`react-scripts`, `gatsby`]) { - const packageStore = runtimeState.packageRegistry.get(name); - if (packageStore) { - for (const reference of packageStore.keys()) { - if (reference === null) { - throw new Error(`Assertion failed: This reference shouldn't be null`); - } else { - fallbackLocators.push({ name, reference }); - } - } - } - } - } - const { - ignorePattern, - packageRegistry, - packageLocatorsByLocations - } = runtimeState; - function makeLogEntry(name, args) { - return { - fn: name, - args, - error: null, - result: null - }; - } - function trace(entry) { - const colors = process.stderr?.hasColors?.() ?? process.stdout.isTTY; - const c = (n, str) => `\x1B[${n}m${str}\x1B[0m`; - const error = entry.error; - if (error) - console.error(c(`31;1`, `\u2716 ${entry.error?.message.replace(/\n.*/s, ``)}`)); - else - console.error(c(`33;1`, `\u203C Resolution`)); - if (entry.args.length > 0) - console.error(); - for (const arg of entry.args) - console.error(` ${c(`37;1`, `In \u2190`)} ${nodeUtils.inspect(arg, { colors, compact: true })}`); - if (entry.result) { - console.error(); - console.error(` ${c(`37;1`, `Out \u2192`)} ${nodeUtils.inspect(entry.result, { colors, compact: true })}`); - } - const stack = new Error().stack.match(/(?<=^ +)at.*/gm)?.slice(2) ?? []; - if (stack.length > 0) { - console.error(); - for (const line of stack) { - console.error(` ${c(`38;5;244`, line)}`); - } - } - console.error(); - } - function maybeLog(name, fn) { - if (opts.allowDebug === false) - return fn; - if (Number.isFinite(debugLevel)) { - if (debugLevel >= 2) { - return (...args) => { - const logEntry = makeLogEntry(name, args); - try { - return logEntry.result = fn(...args); - } catch (error) { - throw logEntry.error = error; - } finally { - trace(logEntry); - } - }; - } else if (debugLevel >= 1) { - return (...args) => { - try { - return fn(...args); - } catch (error) { - const logEntry = makeLogEntry(name, args); - logEntry.error = error; - trace(logEntry); - throw error; - } - }; - } - } - return fn; - } - function getPackageInformationSafe(packageLocator) { - const packageInformation = getPackageInformation(packageLocator); - if (!packageInformation) { - throw makeError( - ErrorCode.INTERNAL, - `Couldn't find a matching entry in the dependency tree for the specified parent (this is probably an internal error)` - ); - } - return packageInformation; - } - function isDependencyTreeRoot(packageLocator) { - if (packageLocator.name === null) - return true; - for (const dependencyTreeRoot of runtimeState.dependencyTreeRoots) - if (dependencyTreeRoot.name === packageLocator.name && dependencyTreeRoot.reference === packageLocator.reference) - return true; - return false; - } - const defaultExportsConditions = /* @__PURE__ */ new Set([ - `node`, - `require`, - ...getOptionValue(`--conditions`) - ]); - function applyNodeExportsResolution(unqualifiedPath, conditions = defaultExportsConditions, issuer) { - const locator = findPackageLocator(ppath.join(unqualifiedPath, `internal.js`), { - resolveIgnored: true, - includeDiscardFromLookup: true - }); - if (locator === null) { - throw makeError( - ErrorCode.INTERNAL, - `The locator that owns the "${unqualifiedPath}" path can't be found inside the dependency tree (this is probably an internal error)` - ); - } - const { packageLocation } = getPackageInformationSafe(locator); - const manifestPath = ppath.join(packageLocation, Filename.manifest); - if (!opts.fakeFs.existsSync(manifestPath)) - return null; - const pkgJson = JSON.parse(opts.fakeFs.readFileSync(manifestPath, `utf8`)); - if (pkgJson.exports == null) - return null; - let subpath = ppath.contains(packageLocation, unqualifiedPath); - if (subpath === null) { - throw makeError( - ErrorCode.INTERNAL, - `unqualifiedPath doesn't contain the packageLocation (this is probably an internal error)` - ); - } - if (subpath !== `.` && !isRelativeRegexp.test(subpath)) - subpath = `./${subpath}`; - try { - const resolvedExport = packageExportsResolve({ - packageJSONUrl: url.pathToFileURL(npath.fromPortablePath(manifestPath)), - packageSubpath: subpath, - exports: pkgJson.exports, - base: issuer ? url.pathToFileURL(npath.fromPortablePath(issuer)) : null, - conditions - }); - return npath.toPortablePath(url.fileURLToPath(resolvedExport)); - } catch (error) { - throw makeError( - ErrorCode.EXPORTS_RESOLUTION_FAILED, - error.message, - { unqualifiedPath: getPathForDisplay(unqualifiedPath), locator, pkgJson, subpath: getPathForDisplay(subpath), conditions }, - error.code - ); - } - } - function applyNodeExtensionResolution(unqualifiedPath, candidates, { extensions }) { - let stat; - try { - candidates.push(unqualifiedPath); - stat = opts.fakeFs.statSync(unqualifiedPath); - } catch (error) { - } - if (stat && !stat.isDirectory()) - return opts.fakeFs.realpathSync(unqualifiedPath); - if (stat && stat.isDirectory()) { - let pkgJson; - try { - pkgJson = JSON.parse(opts.fakeFs.readFileSync(ppath.join(unqualifiedPath, Filename.manifest), `utf8`)); - } catch (error) { - } - let nextUnqualifiedPath; - if (pkgJson && pkgJson.main) - nextUnqualifiedPath = ppath.resolve(unqualifiedPath, pkgJson.main); - if (nextUnqualifiedPath && nextUnqualifiedPath !== unqualifiedPath) { - const resolution = applyNodeExtensionResolution(nextUnqualifiedPath, candidates, { extensions }); - if (resolution !== null) { - return resolution; - } - } - } - for (let i = 0, length = extensions.length; i < length; i++) { - const candidateFile = `${unqualifiedPath}${extensions[i]}`; - candidates.push(candidateFile); - if (opts.fakeFs.existsSync(candidateFile)) { - return candidateFile; - } - } - if (stat && stat.isDirectory()) { - for (let i = 0, length = extensions.length; i < length; i++) { - const candidateFile = ppath.format({ dir: unqualifiedPath, name: `index`, ext: extensions[i] }); - candidates.push(candidateFile); - if (opts.fakeFs.existsSync(candidateFile)) { - return candidateFile; - } - } - } - return null; - } - function makeFakeModule(path) { - const fakeModule = new require$$0.Module(path, null); - fakeModule.filename = path; - fakeModule.paths = require$$0.Module._nodeModulePaths(path); - return fakeModule; - } - function callNativeResolution(request, issuer) { - if (issuer.endsWith(`/`)) - issuer = ppath.join(issuer, `internal.js`); - return require$$0.Module._resolveFilename(npath.fromPortablePath(request), makeFakeModule(npath.fromPortablePath(issuer)), false, { plugnplay: false }); - } - function isPathIgnored(path) { - if (ignorePattern === null) - return false; - const subPath = ppath.contains(runtimeState.basePath, path); - if (subPath === null) - return false; - if (ignorePattern.test(subPath.replace(/\/$/, ``))) { - return true; - } else { - return false; - } - } - const VERSIONS = { std: 3, resolveVirtual: 1, getAllLocators: 1 }; - const topLevel = topLevelLocator; - function getPackageInformation({ name, reference }) { - const packageInformationStore = packageRegistry.get(name); - if (!packageInformationStore) - return null; - const packageInformation = packageInformationStore.get(reference); - if (!packageInformation) - return null; - return packageInformation; - } - function findPackageDependents({ name, reference }) { - const dependents = []; - for (const [dependentName, packageInformationStore] of packageRegistry) { - if (dependentName === null) - continue; - for (const [dependentReference, packageInformation] of packageInformationStore) { - if (dependentReference === null) - continue; - const dependencyReference = packageInformation.packageDependencies.get(name); - if (dependencyReference !== reference) - continue; - if (dependentName === name && dependentReference === reference) - continue; - dependents.push({ - name: dependentName, - reference: dependentReference - }); - } - } - return dependents; - } - function findBrokenPeerDependencies(dependency, initialPackage) { - const brokenPackages = /* @__PURE__ */ new Map(); - const alreadyVisited = /* @__PURE__ */ new Set(); - const traversal = (currentPackage) => { - const identifier = JSON.stringify(currentPackage.name); - if (alreadyVisited.has(identifier)) - return; - alreadyVisited.add(identifier); - const dependents = findPackageDependents(currentPackage); - for (const dependent of dependents) { - const dependentInformation = getPackageInformationSafe(dependent); - if (dependentInformation.packagePeers.has(dependency)) { - traversal(dependent); - } else { - let brokenSet = brokenPackages.get(dependent.name); - if (typeof brokenSet === `undefined`) - brokenPackages.set(dependent.name, brokenSet = /* @__PURE__ */ new Set()); - brokenSet.add(dependent.reference); - } - } - }; - traversal(initialPackage); - const brokenList = []; - for (const name of [...brokenPackages.keys()].sort()) - for (const reference of [...brokenPackages.get(name)].sort()) - brokenList.push({ name, reference }); - return brokenList; - } - function findPackageLocator(location, { resolveIgnored = false, includeDiscardFromLookup = false } = {}) { - if (isPathIgnored(location) && !resolveIgnored) - return null; - let relativeLocation = ppath.relative(runtimeState.basePath, location); - if (!relativeLocation.match(isStrictRegExp)) - relativeLocation = `./${relativeLocation}`; - if (!relativeLocation.endsWith(`/`)) - relativeLocation = `${relativeLocation}/`; - do { - const entry = packageLocatorsByLocations.get(relativeLocation); - if (typeof entry === `undefined` || entry.discardFromLookup && !includeDiscardFromLookup) { - relativeLocation = relativeLocation.substring(0, relativeLocation.lastIndexOf(`/`, relativeLocation.length - 2) + 1); - continue; - } - return entry.locator; - } while (relativeLocation !== ``); - return null; - } - function tryReadFile(filePath) { - try { - return opts.fakeFs.readFileSync(npath.toPortablePath(filePath), `utf8`); - } catch (err) { - if (err.code === `ENOENT`) - return void 0; - throw err; - } - } - function resolveToUnqualified(request, issuer, { considerBuiltins = true } = {}) { - if (request.startsWith(`#`)) - throw new Error(`resolveToUnqualified can not handle private import mappings`); - if (request === `pnpapi`) - return npath.toPortablePath(opts.pnpapiResolution); - if (considerBuiltins && require$$0.isBuiltin(request)) - return null; - const requestForDisplay = getPathForDisplay(request); - const issuerForDisplay = issuer && getPathForDisplay(issuer); - if (issuer && isPathIgnored(issuer)) { - if (!ppath.isAbsolute(request) || findPackageLocator(request) === null) { - const result = callNativeResolution(request, issuer); - if (result === false) { - throw makeError( - ErrorCode.BUILTIN_NODE_RESOLUTION_FAILED, - `The builtin node resolution algorithm was unable to resolve the requested module (it didn't go through the pnp resolver because the issuer was explicitely ignored by the regexp) - -Require request: "${requestForDisplay}" -Required by: ${issuerForDisplay} -`, - { request: requestForDisplay, issuer: issuerForDisplay } - ); - } - return npath.toPortablePath(result); - } - } - let unqualifiedPath; - const dependencyNameMatch = request.match(pathRegExp); - if (!dependencyNameMatch) { - if (ppath.isAbsolute(request)) { - unqualifiedPath = ppath.normalize(request); - } else { - if (!issuer) { - throw makeError( - ErrorCode.API_ERROR, - `The resolveToUnqualified function must be called with a valid issuer when the path isn't a builtin nor absolute`, - { request: requestForDisplay, issuer: issuerForDisplay } - ); - } - const absoluteIssuer = ppath.resolve(issuer); - if (issuer.match(isDirRegExp)) { - unqualifiedPath = ppath.normalize(ppath.join(absoluteIssuer, request)); - } else { - unqualifiedPath = ppath.normalize(ppath.join(ppath.dirname(absoluteIssuer), request)); - } - } - } else { - if (!issuer) { - throw makeError( - ErrorCode.API_ERROR, - `The resolveToUnqualified function must be called with a valid issuer when the path isn't a builtin nor absolute`, - { request: requestForDisplay, issuer: issuerForDisplay } - ); - } - const [, dependencyName, subPath] = dependencyNameMatch; - const issuerLocator = findPackageLocator(issuer); - if (!issuerLocator) { - const result = callNativeResolution(request, issuer); - if (result === false) { - throw makeError( - ErrorCode.BUILTIN_NODE_RESOLUTION_FAILED, - `The builtin node resolution algorithm was unable to resolve the requested module (it didn't go through the pnp resolver because the issuer doesn't seem to be part of the Yarn-managed dependency tree). - -Require path: "${requestForDisplay}" -Required by: ${issuerForDisplay} -`, - { request: requestForDisplay, issuer: issuerForDisplay } - ); - } - return npath.toPortablePath(result); - } - const issuerInformation = getPackageInformationSafe(issuerLocator); - let dependencyReference = issuerInformation.packageDependencies.get(dependencyName); - let fallbackReference = null; - if (dependencyReference == null) { - if (issuerLocator.name !== null) { - const exclusionEntry = runtimeState.fallbackExclusionList.get(issuerLocator.name); - const canUseFallbacks = !exclusionEntry || !exclusionEntry.has(issuerLocator.reference); - if (canUseFallbacks) { - for (let t = 0, T = fallbackLocators.length; t < T; ++t) { - const fallbackInformation = getPackageInformationSafe(fallbackLocators[t]); - const reference = fallbackInformation.packageDependencies.get(dependencyName); - if (reference == null) - continue; - if (alwaysWarnOnFallback) - fallbackReference = reference; - else - dependencyReference = reference; - break; - } - if (runtimeState.enableTopLevelFallback) { - if (dependencyReference == null && fallbackReference === null) { - const reference = runtimeState.fallbackPool.get(dependencyName); - if (reference != null) { - fallbackReference = reference; - } - } - } - } - } - } - let error = null; - if (dependencyReference === null) { - if (isDependencyTreeRoot(issuerLocator)) { - error = makeError( - ErrorCode.MISSING_PEER_DEPENDENCY, - `Your application tried to access ${dependencyName} (a peer dependency); this isn't allowed as there is no ancestor to satisfy the requirement. Use a devDependency if needed. - -Required package: ${dependencyName}${dependencyName !== requestForDisplay ? ` (via "${requestForDisplay}")` : ``} -Required by: ${issuerForDisplay} -`, - { request: requestForDisplay, issuer: issuerForDisplay, dependencyName } - ); - } else { - const brokenAncestors = findBrokenPeerDependencies(dependencyName, issuerLocator); - if (brokenAncestors.every((ancestor) => isDependencyTreeRoot(ancestor))) { - error = makeError( - ErrorCode.MISSING_PEER_DEPENDENCY, - `${issuerLocator.name} tried to access ${dependencyName} (a peer dependency) but it isn't provided by your application; this makes the require call ambiguous and unsound. - -Required package: ${dependencyName}${dependencyName !== requestForDisplay ? ` (via "${requestForDisplay}")` : ``} -Required by: ${issuerLocator.name}@${issuerLocator.reference} (via ${issuerForDisplay}) -${brokenAncestors.map((ancestorLocator) => `Ancestor breaking the chain: ${ancestorLocator.name}@${ancestorLocator.reference} -`).join(``)} -`, - { request: requestForDisplay, issuer: issuerForDisplay, issuerLocator: Object.assign({}, issuerLocator), dependencyName, brokenAncestors } - ); - } else { - error = makeError( - ErrorCode.MISSING_PEER_DEPENDENCY, - `${issuerLocator.name} tried to access ${dependencyName} (a peer dependency) but it isn't provided by its ancestors; this makes the require call ambiguous and unsound. - -Required package: ${dependencyName}${dependencyName !== requestForDisplay ? ` (via "${requestForDisplay}")` : ``} -Required by: ${issuerLocator.name}@${issuerLocator.reference} (via ${issuerForDisplay}) - -${brokenAncestors.map((ancestorLocator) => `Ancestor breaking the chain: ${ancestorLocator.name}@${ancestorLocator.reference} -`).join(``)} -`, - { request: requestForDisplay, issuer: issuerForDisplay, issuerLocator: Object.assign({}, issuerLocator), dependencyName, brokenAncestors } - ); - } - } - } else if (dependencyReference === void 0) { - if (!considerBuiltins && require$$0.isBuiltin(request)) { - if (isDependencyTreeRoot(issuerLocator)) { - error = makeError( - ErrorCode.UNDECLARED_DEPENDENCY, - `Your application tried to access ${dependencyName}. While this module is usually interpreted as a Node builtin, your resolver is running inside a non-Node resolution context where such builtins are ignored. Since ${dependencyName} isn't otherwise declared in your dependencies, this makes the require call ambiguous and unsound. - -Required package: ${dependencyName}${dependencyName !== requestForDisplay ? ` (via "${requestForDisplay}")` : ``} -Required by: ${issuerForDisplay} -`, - { request: requestForDisplay, issuer: issuerForDisplay, dependencyName } - ); - } else { - error = makeError( - ErrorCode.UNDECLARED_DEPENDENCY, - `${issuerLocator.name} tried to access ${dependencyName}. While this module is usually interpreted as a Node builtin, your resolver is running inside a non-Node resolution context where such builtins are ignored. Since ${dependencyName} isn't otherwise declared in ${issuerLocator.name}'s dependencies, this makes the require call ambiguous and unsound. - -Required package: ${dependencyName}${dependencyName !== requestForDisplay ? ` (via "${requestForDisplay}")` : ``} -Required by: ${issuerForDisplay} -`, - { request: requestForDisplay, issuer: issuerForDisplay, issuerLocator: Object.assign({}, issuerLocator), dependencyName } - ); - } - } else { - if (isDependencyTreeRoot(issuerLocator)) { - error = makeError( - ErrorCode.UNDECLARED_DEPENDENCY, - `Your application tried to access ${dependencyName}, but it isn't declared in your dependencies; this makes the require call ambiguous and unsound. - -Required package: ${dependencyName}${dependencyName !== requestForDisplay ? ` (via "${requestForDisplay}")` : ``} -Required by: ${issuerForDisplay} -`, - { request: requestForDisplay, issuer: issuerForDisplay, dependencyName } - ); - } else { - error = makeError( - ErrorCode.UNDECLARED_DEPENDENCY, - `${issuerLocator.name} tried to access ${dependencyName}, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound. - -Required package: ${dependencyName}${dependencyName !== requestForDisplay ? ` (via "${requestForDisplay}")` : ``} -Required by: ${issuerLocator.name}@${issuerLocator.reference} (via ${issuerForDisplay}) -`, - { request: requestForDisplay, issuer: issuerForDisplay, issuerLocator: Object.assign({}, issuerLocator), dependencyName } - ); - } - } - } - if (dependencyReference == null) { - if (fallbackReference === null || error === null) - throw error || new Error(`Assertion failed: Expected an error to have been set`); - dependencyReference = fallbackReference; - const message = error.message.replace(/\n.*/g, ``); - error.message = message; - if (!emittedWarnings.has(message) && debugLevel !== 0) { - emittedWarnings.add(message); - process.emitWarning(error); - } - } - const dependencyLocator = Array.isArray(dependencyReference) ? { name: dependencyReference[0], reference: dependencyReference[1] } : { name: dependencyName, reference: dependencyReference }; - const dependencyInformation = getPackageInformationSafe(dependencyLocator); - if (!dependencyInformation.packageLocation) { - throw makeError( - ErrorCode.MISSING_DEPENDENCY, - `A dependency seems valid but didn't get installed for some reason. This might be caused by a partial install, such as dev vs prod. - -Required package: ${dependencyLocator.name}@${dependencyLocator.reference}${dependencyLocator.name !== requestForDisplay ? ` (via "${requestForDisplay}")` : ``} -Required by: ${issuerLocator.name}@${issuerLocator.reference} (via ${issuerForDisplay}) -`, - { request: requestForDisplay, issuer: issuerForDisplay, dependencyLocator: Object.assign({}, dependencyLocator) } - ); - } - const dependencyLocation = dependencyInformation.packageLocation; - if (subPath) { - unqualifiedPath = ppath.join(dependencyLocation, subPath); - } else { - unqualifiedPath = dependencyLocation; - } - } - return ppath.normalize(unqualifiedPath); - } - function resolveUnqualifiedExport(request, unqualifiedPath, conditions = defaultExportsConditions, issuer) { - if (isStrictRegExp.test(request)) - return unqualifiedPath; - const unqualifiedExportPath = applyNodeExportsResolution(unqualifiedPath, conditions, issuer); - if (unqualifiedExportPath) { - return ppath.normalize(unqualifiedExportPath); - } else { - return unqualifiedPath; - } - } - function resolveUnqualified(unqualifiedPath, { extensions = Object.keys(require$$0.Module._extensions) } = {}) { - const candidates = []; - const qualifiedPath = applyNodeExtensionResolution(unqualifiedPath, candidates, { extensions }); - if (qualifiedPath) { - return ppath.normalize(qualifiedPath); - } else { - reportRequiredFilesToWatchMode(candidates.map((candidate) => npath.fromPortablePath(candidate))); - const unqualifiedPathForDisplay = getPathForDisplay(unqualifiedPath); - const containingPackage = findPackageLocator(unqualifiedPath); - if (containingPackage) { - const { packageLocation } = getPackageInformationSafe(containingPackage); - let exists = true; - try { - opts.fakeFs.accessSync(packageLocation); - } catch (err) { - if (err?.code === `ENOENT`) { - exists = false; - } else { - const readableError = (err?.message ?? err ?? `empty exception thrown`).replace(/^[A-Z]/, ($0) => $0.toLowerCase()); - throw makeError(ErrorCode.QUALIFIED_PATH_RESOLUTION_FAILED, `Required package exists but could not be accessed (${readableError}). - -Missing package: ${containingPackage.name}@${containingPackage.reference} -Expected package location: ${getPathForDisplay(packageLocation)} -`, { unqualifiedPath: unqualifiedPathForDisplay, extensions }); - } - } - if (!exists) { - const errorMessage = packageLocation.includes(`/unplugged/`) ? `Required unplugged package missing from disk. This may happen when switching branches without running installs (unplugged packages must be fully materialized on disk to work).` : `Required package missing from disk. If you keep your packages inside your repository then restarting the Node process may be enough. Otherwise, try to run an install first.`; - throw makeError( - ErrorCode.QUALIFIED_PATH_RESOLUTION_FAILED, - `${errorMessage} - -Missing package: ${containingPackage.name}@${containingPackage.reference} -Expected package location: ${getPathForDisplay(packageLocation)} -`, - { unqualifiedPath: unqualifiedPathForDisplay, extensions } - ); - } - } - throw makeError( - ErrorCode.QUALIFIED_PATH_RESOLUTION_FAILED, - `Qualified path resolution failed: we looked for the following paths, but none could be accessed. - -Source path: ${unqualifiedPathForDisplay} -${candidates.map((candidate) => `Not found: ${getPathForDisplay(candidate)} -`).join(``)}`, - { unqualifiedPath: unqualifiedPathForDisplay, extensions } - ); - } - } - function resolvePrivateRequest(request, issuer, opts2) { - if (!issuer) - throw new Error(`Assertion failed: An issuer is required to resolve private import mappings`); - const resolved = packageImportsResolve({ - name: request, - base: url.pathToFileURL(npath.fromPortablePath(issuer)), - conditions: opts2.conditions ?? defaultExportsConditions, - readFileSyncFn: tryReadFile - }); - if (resolved instanceof URL) { - return resolveUnqualified(npath.toPortablePath(url.fileURLToPath(resolved)), { extensions: opts2.extensions }); - } else { - if (resolved.startsWith(`#`)) - throw new Error(`Mapping from one private import to another isn't allowed`); - return resolveRequest(resolved, issuer, opts2); - } - } - function resolveRequest(request, issuer, opts2 = {}) { - try { - if (request.startsWith(`#`)) - return resolvePrivateRequest(request, issuer, opts2); - const { considerBuiltins, extensions, conditions } = opts2; - const unqualifiedPath = resolveToUnqualified(request, issuer, { considerBuiltins }); - if (request === `pnpapi`) - return unqualifiedPath; - if (unqualifiedPath === null) - return null; - const isIssuerIgnored = () => issuer !== null ? isPathIgnored(issuer) : false; - const remappedPath = (!considerBuiltins || !require$$0.isBuiltin(request)) && !isIssuerIgnored() ? resolveUnqualifiedExport(request, unqualifiedPath, conditions, issuer) : unqualifiedPath; - return resolveUnqualified(remappedPath, { extensions }); - } catch (error) { - if (Object.hasOwn(error, `pnpCode`)) - Object.assign(error.data, { request: getPathForDisplay(request), issuer: issuer && getPathForDisplay(issuer) }); - throw error; - } - } - function resolveVirtual(request) { - const normalized = ppath.normalize(request); - const resolved = VirtualFS.resolveVirtual(normalized); - return resolved !== normalized ? resolved : null; - } - return { - VERSIONS, - topLevel, - getLocator: (name, referencish) => { - if (Array.isArray(referencish)) { - return { name: referencish[0], reference: referencish[1] }; - } else { - return { name, reference: referencish }; - } - }, - getDependencyTreeRoots: () => { - return [...runtimeState.dependencyTreeRoots]; - }, - getAllLocators() { - const locators = []; - for (const [name, entry] of packageRegistry) - for (const reference of entry.keys()) - if (name !== null && reference !== null) - locators.push({ name, reference }); - return locators; - }, - getPackageInformation: (locator) => { - const info = getPackageInformation(locator); - if (info === null) - return null; - const packageLocation = npath.fromPortablePath(info.packageLocation); - const nativeInfo = { ...info, packageLocation }; - return nativeInfo; - }, - findPackageLocator: (path) => { - return findPackageLocator(npath.toPortablePath(path)); - }, - resolveToUnqualified: maybeLog(`resolveToUnqualified`, (request, issuer, opts2) => { - const portableIssuer = issuer !== null ? npath.toPortablePath(issuer) : null; - const resolution = resolveToUnqualified(npath.toPortablePath(request), portableIssuer, opts2); - if (resolution === null) - return null; - return npath.fromPortablePath(resolution); - }), - resolveUnqualified: maybeLog(`resolveUnqualified`, (unqualifiedPath, opts2) => { - return npath.fromPortablePath(resolveUnqualified(npath.toPortablePath(unqualifiedPath), opts2)); - }), - resolveRequest: maybeLog(`resolveRequest`, (request, issuer, opts2) => { - const portableIssuer = issuer !== null ? npath.toPortablePath(issuer) : null; - const resolution = resolveRequest(npath.toPortablePath(request), portableIssuer, opts2); - if (resolution === null) - return null; - return npath.fromPortablePath(resolution); - }), - resolveVirtual: maybeLog(`resolveVirtual`, (path) => { - const result = resolveVirtual(npath.toPortablePath(path)); - if (result !== null) { - return npath.fromPortablePath(result); - } else { - return null; - } - }) - }; -} - -function makeManager(pnpapi, opts) { - const initialApiPath = npath.toPortablePath(pnpapi.resolveToUnqualified(`pnpapi`, null)); - const initialApiStats = opts.fakeFs.statSync(npath.toPortablePath(initialApiPath)); - const apiMetadata = /* @__PURE__ */ new Map([ - [initialApiPath, { - instance: pnpapi, - stats: initialApiStats, - lastRefreshCheck: Date.now() - }] - ]); - function loadApiInstance(pnpApiPath) { - const nativePath = npath.fromPortablePath(pnpApiPath); - const module = new require$$0.Module(nativePath, null); - module.load(nativePath); - return module.exports; - } - function refreshApiEntry(pnpApiPath, apiEntry) { - const timeNow = Date.now(); - if (timeNow - apiEntry.lastRefreshCheck < 500) - return; - apiEntry.lastRefreshCheck = timeNow; - const stats = opts.fakeFs.statSync(pnpApiPath); - if (stats.mtime > apiEntry.stats.mtime) { - process.emitWarning(`[Warning] The runtime detected new information in a PnP file; reloading the API instance (${npath.fromPortablePath(pnpApiPath)})`); - apiEntry.stats = stats; - apiEntry.instance = loadApiInstance(pnpApiPath); - } - } - function getApiEntry(pnpApiPath, refresh = false) { - let apiEntry = apiMetadata.get(pnpApiPath); - if (typeof apiEntry !== `undefined`) { - if (refresh) { - refreshApiEntry(pnpApiPath, apiEntry); - } - } else { - apiMetadata.set(pnpApiPath, apiEntry = { - instance: loadApiInstance(pnpApiPath), - stats: opts.fakeFs.statSync(pnpApiPath), - lastRefreshCheck: Date.now() - }); - } - return apiEntry; - } - const findApiPathCache = /* @__PURE__ */ new Map(); - function addToCacheAndReturn(start, end, target) { - if (target !== null) { - target = VirtualFS.resolveVirtual(target); - target = opts.fakeFs.realpathSync(target); - } - let curr; - let next = start; - do { - curr = next; - findApiPathCache.set(curr, target); - next = ppath.dirname(curr); - } while (curr !== end); - return target; - } - function findApiPathFor(modulePath) { - let bestCandidate = null; - for (const [apiPath, apiEntry] of apiMetadata) { - const locator = apiEntry.instance.findPackageLocator(modulePath); - if (!locator) - continue; - if (apiMetadata.size === 1) - return apiPath; - const packageInformation = apiEntry.instance.getPackageInformation(locator); - if (!packageInformation) - throw new Error(`Assertion failed: Couldn't get package information for '${modulePath}'`); - if (!bestCandidate) - bestCandidate = { packageLocation: packageInformation.packageLocation, apiPaths: [] }; - if (packageInformation.packageLocation === bestCandidate.packageLocation) { - bestCandidate.apiPaths.push(apiPath); - } else if (packageInformation.packageLocation.length > bestCandidate.packageLocation.length) { - bestCandidate = { packageLocation: packageInformation.packageLocation, apiPaths: [apiPath] }; - } - } - if (bestCandidate) { - if (bestCandidate.apiPaths.length === 1) - return bestCandidate.apiPaths[0]; - const controlSegment = bestCandidate.apiPaths.map((apiPath) => ` ${npath.fromPortablePath(apiPath)}`).join(` -`); - throw new Error(`Unable to locate pnpapi, the module '${modulePath}' is controlled by multiple pnpapi instances. -This is usually caused by using the global cache (enableGlobalCache: true) - -Controlled by: -${controlSegment} -`); - } - const start = ppath.resolve(npath.toPortablePath(modulePath)); - let curr; - let next = start; - do { - curr = next; - const cached = findApiPathCache.get(curr); - if (cached !== void 0) - return addToCacheAndReturn(start, curr, cached); - const cjsCandidate = ppath.join(curr, Filename.pnpCjs); - if (opts.fakeFs.existsSync(cjsCandidate) && opts.fakeFs.statSync(cjsCandidate).isFile()) - return addToCacheAndReturn(start, curr, cjsCandidate); - const legacyCjsCandidate = ppath.join(curr, Filename.pnpJs); - if (opts.fakeFs.existsSync(legacyCjsCandidate) && opts.fakeFs.statSync(legacyCjsCandidate).isFile()) - return addToCacheAndReturn(start, curr, legacyCjsCandidate); - next = ppath.dirname(curr); - } while (curr !== PortablePath.root); - return addToCacheAndReturn(start, curr, null); - } - const moduleToApiPathCache = /* @__PURE__ */ new WeakMap(); - function getApiPathFromParent(parent) { - if (parent == null) - return initialApiPath; - let apiPath = moduleToApiPathCache.get(parent); - if (typeof apiPath !== `undefined`) - return apiPath; - apiPath = parent.filename ? findApiPathFor(parent.filename) : null; - moduleToApiPathCache.set(parent, apiPath); - return apiPath; - } - return { - getApiPathFromParent, - findApiPathFor, - getApiEntry - }; -} - -const localFs = { ...fs__default.default }; -const nodeFs = new NodeFS(localFs); -const defaultRuntimeState = $$SETUP_STATE(hydrateRuntimeState); -const defaultPnpapiResolution = __filename; -const defaultFsLayer = new VirtualFS({ - baseFs: new ZipOpenFS({ - baseFs: nodeFs, - maxOpenFiles: 80, - readOnlyArchives: true - }) -}); -class DynamicFS extends ProxiedFS { - constructor() { - super(ppath); - this.baseFs = defaultFsLayer; - } - mapToBase(p) { - return p; - } - mapFromBase(p) { - return p; - } -} -const dynamicFsLayer = new DynamicFS(); -let manager; -const defaultApi = Object.assign(makeApi(defaultRuntimeState, { - fakeFs: dynamicFsLayer, - pnpapiResolution: defaultPnpapiResolution -}), { - makeApi: ({ - basePath = void 0, - fakeFs = dynamicFsLayer, - pnpapiResolution = defaultPnpapiResolution, - ...rest - }) => { - const apiRuntimeState = typeof basePath !== `undefined` ? $$SETUP_STATE(hydrateRuntimeState, basePath) : defaultRuntimeState; - return makeApi(apiRuntimeState, { - fakeFs, - pnpapiResolution, - ...rest - }); - }, - setup: (api) => { - applyPatch(api || defaultApi, { - fakeFs: defaultFsLayer, - manager - }); - dynamicFsLayer.baseFs = new NodeFS(fs__default.default); - } -}); -manager = makeManager(defaultApi, { - fakeFs: dynamicFsLayer -}); -if (module.parent && module.parent.id === `internal/preload`) { - defaultApi.setup(); - if (module.filename) { - delete require$$0__default.default._cache[module.filename]; - } -} -if (process.mainModule === module) { - const reportError = (code, message, data) => { - process.stdout.write(`${JSON.stringify([{ code, message, data }, null])} -`); - }; - const reportSuccess = (resolution) => { - process.stdout.write(`${JSON.stringify([null, resolution])} -`); - }; - const processResolution = (request, issuer) => { - try { - reportSuccess(defaultApi.resolveRequest(request, issuer)); - } catch (error) { - reportError(error.code, error.message, error.data); - } - }; - const processRequest = (data) => { - try { - const [request, issuer] = JSON.parse(data); - processResolution(request, issuer); - } catch (error) { - reportError(`INVALID_JSON`, error.message, error.data); - } - }; - if (process.argv.length > 2) { - if (process.argv.length !== 4) { - process.stderr.write(`Usage: ${process.argv[0]} ${process.argv[1]} -`); - process.exitCode = 64; - } else { - processResolution(process.argv[2], process.argv[3]); - } - } else { - let buffer = ``; - const decoder = new StringDecoder__default.default.StringDecoder(); - process.stdin.on(`data`, (chunk) => { - buffer += decoder.write(chunk); - do { - const index = buffer.indexOf(` -`); - if (index === -1) - break; - const line = buffer.slice(0, index); - buffer = buffer.slice(index + 1); - processRequest(line); - } while (true); - }); - } -} - -module.exports = defaultApi; diff --git a/fixtures/pnp/.yarnrc.yml b/fixtures/pnp/.yarnrc.yml deleted file mode 100644 index 6a6b24d8..00000000 --- a/fixtures/pnp/.yarnrc.yml +++ /dev/null @@ -1 +0,0 @@ -enableGlobalCache: 0 diff --git a/fixtures/pnp/package.json b/fixtures/pnp/package.json deleted file mode 100644 index 5d119379..00000000 --- a/fixtures/pnp/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "pnp", - "packageManager": "yarn@4.3.1", - "dependencies": { - "is-even": "^1.0.0", - "is-odd": "^3.0.1" - } -} diff --git a/fixtures/pnp/yarn.lock b/fixtures/pnp/yarn.lock deleted file mode 100644 index ba89514d..00000000 --- a/fixtures/pnp/yarn.lock +++ /dev/null @@ -1,74 +0,0 @@ -# This file is generated by running "yarn install" inside your project. -# Manual changes might be lost - proceed with caution! - -__metadata: - version: 8 - cacheKey: 10c0 - -"is-buffer@npm:^1.1.5": - version: 1.1.6 - resolution: "is-buffer@npm:1.1.6" - checksum: 10c0/ae18aa0b6e113d6c490ad1db5e8df9bdb57758382b313f5a22c9c61084875c6396d50bbf49315f5b1926d142d74dfb8d31b40d993a383e0a158b15fea7a82234 - languageName: node - linkType: hard - -"is-even@npm:^1.0.0": - version: 1.0.0 - resolution: "is-even@npm:1.0.0" - dependencies: - is-odd: "npm:^0.1.2" - checksum: 10c0/2728cc2f390d07c6a44a054aa53ae6ce57c3a4adfd76a92df528e992b4a978fdec4eaa948e0de6e6431ef3c8deebf1c964fd870d4983044ec9f0f4e630dfb3a5 - languageName: node - linkType: hard - -"is-number@npm:^3.0.0": - version: 3.0.0 - resolution: "is-number@npm:3.0.0" - dependencies: - kind-of: "npm:^3.0.2" - checksum: 10c0/e639c54640b7f029623df24d3d103901e322c0c25ea5bde97cd723c2d0d4c05857a8364ab5c58d963089dbed6bf1d0ffe975cb6aef917e2ad0ccbca653d31b4f - languageName: node - linkType: hard - -"is-number@npm:^6.0.0": - version: 6.0.0 - resolution: "is-number@npm:6.0.0" - checksum: 10c0/5da4c68401529675c575878d2760d66f18eaef4b014858577f6003daf66488d7fe4eae684b1e8574e3fa1bb447c6c6c56b8491d2b4b3239da2d32e5f6f218008 - languageName: node - linkType: hard - -"is-odd@npm:^0.1.2": - version: 0.1.2 - resolution: "is-odd@npm:0.1.2" - dependencies: - is-number: "npm:^3.0.0" - checksum: 10c0/7dc6c6fd004861208ef9f324021c66f19b3dad209c2da3ef3720d4d76e141974fadb52c47b439fc8c52af579468640b554115395b5673f4558ef09719260e898 - languageName: node - linkType: hard - -"is-odd@npm:^3.0.1": - version: 3.0.1 - resolution: "is-odd@npm:3.0.1" - dependencies: - is-number: "npm:^6.0.0" - checksum: 10c0/89ee2e353c5a3f3bd400c79db1c307a5b3506198ee8169d521e533a9b1d8a08fc95f21a919c084e98845b4286d7ffe309778da03744dfe66c3c1763ab1a030c6 - languageName: node - linkType: hard - -"kind-of@npm:^3.0.2": - version: 3.2.2 - resolution: "kind-of@npm:3.2.2" - dependencies: - is-buffer: "npm:^1.1.5" - checksum: 10c0/7e34bc29d4b02c997f92f080de34ebb92033a96736bbb0bb2410e033a7e5ae6571f1fa37b2d7710018f95361473b816c604234197f4f203f9cf149d8ef1574d9 - languageName: node - linkType: hard - -"pnp@workspace:.": - version: 0.0.0-use.local - resolution: "pnp@workspace:." - dependencies: - is-even: "npm:^1.0.0" - is-odd: "npm:^3.0.1" - languageName: unknown - linkType: soft diff --git a/fixtures/pnpm/.gitignore b/fixtures/pnpm/.gitignore deleted file mode 100644 index 3c3629e6..00000000 --- a/fixtures/pnpm/.gitignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/fixtures/pnpm/package.json b/fixtures/pnpm/package.json deleted file mode 100644 index b763d74d..00000000 --- a/fixtures/pnpm/package.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "name": "pnpm", - "version": "1.0.0", - "private": true, - "devDependencies": { - "axios": "1.6.2", - "ipaddr.js": "2.2.0", - "postcss": "8.4.33", - "styled-components": "6.1.1" - } -} diff --git a/fixtures/pnpm/pnpm-lock.yaml b/fixtures/pnpm/pnpm-lock.yaml deleted file mode 100644 index e51dfd6a..00000000 --- a/fixtures/pnpm/pnpm-lock.yaml +++ /dev/null @@ -1,212 +0,0 @@ -lockfileVersion: '6.0' - -settings: - autoInstallPeers: true - excludeLinksFromLockfile: false - -devDependencies: - axios: - specifier: 1.6.2 - version: 1.6.2 - postcss: - specifier: 8.4.33 - version: 8.4.33 - styled-components: - specifier: 6.1.1 - version: 6.1.1(react-dom@18.2.0)(react@18.2.0) - -packages: - - /@emotion/is-prop-valid@1.2.1: - resolution: {integrity: sha512-61Mf7Ufx4aDxx1xlDeOm8aFFigGHE4z+0sKCa+IHCeZKiyP9RLD0Mmx7m8b9/Cf37f7NAvQOOJAbQQGVr5uERw==} - dependencies: - '@emotion/memoize': 0.8.1 - dev: true - - /@emotion/memoize@0.8.1: - resolution: {integrity: sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA==} - dev: true - - /@emotion/unitless@0.8.1: - resolution: {integrity: sha512-KOEGMu6dmJZtpadb476IsZBclKvILjopjUii3V+7MnXIQCYh8W3NgNcgwo21n9LXZX6EDIKvqfjYxXebDwxKmQ==} - dev: true - - /@types/stylis@4.2.4: - resolution: {integrity: sha512-36ZrGJ8fgtBr6nwNnuJ9jXIj+bn/pF6UoqmrQT7+Y99+tFFeHHsoR54+194dHdyhPjgbeoNz3Qru0oRt0l6ASQ==} - dev: true - - /asynckit@0.4.0: - resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} - dev: true - - /axios@1.6.2: - resolution: {integrity: sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A==} - dependencies: - follow-redirects: 1.15.3 - form-data: 4.0.0 - proxy-from-env: 1.1.0 - transitivePeerDependencies: - - debug - dev: true - - /camelize@1.0.1: - resolution: {integrity: sha512-dU+Tx2fsypxTgtLoE36npi3UqcjSSMNYfkqgmoEhtZrraP5VWq0K7FkWVTYa8eMPtnU/G2txVsfdCJTn9uzpuQ==} - dev: true - - /combined-stream@1.0.8: - resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} - engines: {node: '>= 0.8'} - dependencies: - delayed-stream: 1.0.0 - dev: true - - /css-color-keywords@1.0.0: - resolution: {integrity: sha512-FyyrDHZKEjXDpNJYvVsV960FiqQyXc/LlYmsxl2BcdMb2WPx0OGRVgTg55rPSyLSNMqP52R9r8geSp7apN3Ofg==} - engines: {node: '>=4'} - dev: true - - /css-to-react-native@3.2.0: - resolution: {integrity: sha512-e8RKaLXMOFii+02mOlqwjbD00KSEKqblnpO9e++1aXS1fPQOpS1YoqdVHBqPjHNoxeF2mimzVqawm2KCbEdtHQ==} - dependencies: - camelize: 1.0.1 - css-color-keywords: 1.0.0 - postcss-value-parser: 4.2.0 - dev: true - - /csstype@3.1.2: - resolution: {integrity: sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==} - dev: true - - /delayed-stream@1.0.0: - resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} - engines: {node: '>=0.4.0'} - dev: true - - /follow-redirects@1.15.3: - resolution: {integrity: sha512-1VzOtuEM8pC9SFU1E+8KfTjZyMztRsgEfwQl44z8A25uy13jSzTj6dyK2Df52iV0vgHCfBwLhDWevLn95w5v6Q==} - engines: {node: '>=4.0'} - peerDependencies: - debug: '*' - peerDependenciesMeta: - debug: - optional: true - dev: true - - /form-data@4.0.0: - resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==} - engines: {node: '>= 6'} - dependencies: - asynckit: 0.4.0 - combined-stream: 1.0.8 - mime-types: 2.1.35 - dev: true - - /js-tokens@4.0.0: - resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} - dev: true - - /loose-envify@1.4.0: - resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==} - hasBin: true - dependencies: - js-tokens: 4.0.0 - dev: true - - /mime-db@1.52.0: - resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} - engines: {node: '>= 0.6'} - dev: true - - /mime-types@2.1.35: - resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} - engines: {node: '>= 0.6'} - dependencies: - mime-db: 1.52.0 - dev: true - - /nanoid@3.3.7: - resolution: {integrity: sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==} - engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} - hasBin: true - dev: true - - /picocolors@1.0.0: - resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==} - dev: true - - /postcss-value-parser@4.2.0: - resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==} - dev: true - - /postcss@8.4.33: - resolution: {integrity: sha512-Kkpbhhdjw2qQs2O2DGX+8m5OVqEcbB9HRBvuYM9pgrjEFUg30A9LmXNlTAUj4S9kgtGyrMbTzVjH7E+s5Re2yg==} - engines: {node: ^10 || ^12 || >=14} - dependencies: - nanoid: 3.3.7 - picocolors: 1.0.0 - source-map-js: 1.0.2 - dev: true - - /proxy-from-env@1.1.0: - resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==} - dev: true - - /react-dom@18.2.0(react@18.2.0): - resolution: {integrity: sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==} - peerDependencies: - react: ^18.2.0 - dependencies: - loose-envify: 1.4.0 - react: 18.2.0 - scheduler: 0.23.0 - dev: true - - /react@18.2.0: - resolution: {integrity: sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==} - engines: {node: '>=0.10.0'} - dependencies: - loose-envify: 1.4.0 - dev: true - - /scheduler@0.23.0: - resolution: {integrity: sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw==} - dependencies: - loose-envify: 1.4.0 - dev: true - - /shallowequal@1.1.0: - resolution: {integrity: sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ==} - dev: true - - /source-map-js@1.0.2: - resolution: {integrity: sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==} - engines: {node: '>=0.10.0'} - dev: true - - /styled-components@6.1.1(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-cpZZP5RrKRIClBW5Eby4JM1wElLVP4NQrJbJ0h10TidTyJf4SIIwa3zLXOoPb4gJi8MsJ8mjq5mu2IrEhZIAcQ==} - engines: {node: '>= 16'} - peerDependencies: - react: '>= 16.8.0' - react-dom: '>= 16.8.0' - dependencies: - '@emotion/is-prop-valid': 1.2.1 - '@emotion/unitless': 0.8.1 - '@types/stylis': 4.2.4 - css-to-react-native: 3.2.0 - csstype: 3.1.2 - postcss: 8.4.33 - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - shallowequal: 1.1.0 - stylis: 4.3.0 - tslib: 2.6.2 - dev: true - - /stylis@4.3.0: - resolution: {integrity: sha512-E87pIogpwUsUwXw7dNyU4QDjdgVMy52m+XEOPEKUn161cCzWjjhPSQhByfd1CcNvrOLnXQ6OnnZDwnJrz/Z4YQ==} - dev: true - - /tslib@2.6.2: - resolution: {integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==} - dev: true diff --git a/fixtures/tsconfig/cases/builtins/thing.js b/fixtures/tsconfig/cases/builtins/thing.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/builtins/tsconfig.json b/fixtures/tsconfig/cases/builtins/tsconfig.json deleted file mode 100644 index 36aa1a4d..00000000 --- a/fixtures/tsconfig/cases/builtins/tsconfig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compilerOptions": { - "baseUrl": "." - } -} diff --git a/fixtures/tsconfig/cases/exports/index.js b/fixtures/tsconfig/cases/exports/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/exports/tsconfig.json b/fixtures/tsconfig/cases/exports/tsconfig.json deleted file mode 100644 index f0e3159b..00000000 --- a/fixtures/tsconfig/cases/exports/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-exports" -} diff --git a/fixtures/tsconfig/cases/extends-extension/base-tsconfig.json b/fixtures/tsconfig/cases/extends-extension/base-tsconfig.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/cases/extends-extension/base-tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/cases/extends-extension/foo.js b/fixtures/tsconfig/cases/extends-extension/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-extension/tsconfig.json b/fixtures/tsconfig/cases/extends-extension/tsconfig.json deleted file mode 100644 index 0ae4c6a3..00000000 --- a/fixtures/tsconfig/cases/extends-extension/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./base-tsconfig" -} diff --git a/fixtures/tsconfig/cases/extends-extensionless/foo.js b/fixtures/tsconfig/cases/extends-extensionless/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-extensionless/tsconfig.json b/fixtures/tsconfig/cases/extends-extensionless/tsconfig.json deleted file mode 100644 index c36cb7d4..00000000 --- a/fixtures/tsconfig/cases/extends-extensionless/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-field/conf" -} diff --git a/fixtures/tsconfig/cases/extends-multiple/foo.js b/fixtures/tsconfig/cases/extends-multiple/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-multiple/tsconfig.json b/fixtures/tsconfig/cases/extends-multiple/tsconfig.json deleted file mode 100644 index aa2ae783..00000000 --- a/fixtures/tsconfig/cases/extends-multiple/tsconfig.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": ["../extends-extension", "../extends-paths"], - "compilerOptions": { - "baseUrl": ".", - }, -} diff --git a/fixtures/tsconfig/cases/extends-not-found/index.js b/fixtures/tsconfig/cases/extends-not-found/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-not-found/tsconfig.json b/fixtures/tsconfig/cases/extends-not-found/tsconfig.json deleted file mode 100644 index 99df91da..00000000 --- a/fixtures/tsconfig/cases/extends-not-found/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./not-found" -} diff --git a/fixtures/tsconfig/cases/extends-paths/src/index.js b/fixtures/tsconfig/cases/extends-paths/src/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-paths/tsconfig.base.json b/fixtures/tsconfig/cases/extends-paths/tsconfig.base.json deleted file mode 100644 index 5c64b067..00000000 --- a/fixtures/tsconfig/cases/extends-paths/tsconfig.base.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "@/*": ["./*"] - } - } -} diff --git a/fixtures/tsconfig/cases/extends-paths/tsconfig.json b/fixtures/tsconfig/cases/extends-paths/tsconfig.json deleted file mode 100644 index 51086018..00000000 --- a/fixtures/tsconfig/cases/extends-paths/tsconfig.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": "./tsconfig.base.json", - "compilerOptions": { - "baseUrl": "src", - }, -} diff --git a/fixtures/tsconfig/cases/field/index.js b/fixtures/tsconfig/cases/field/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/field/tsconfig.json b/fixtures/tsconfig/cases/field/tsconfig.json deleted file mode 100644 index 9f86c3f4..00000000 --- a/fixtures/tsconfig/cases/field/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-field" -} diff --git a/fixtures/tsconfig/cases/index/index.js b/fixtures/tsconfig/cases/index/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/index/tsconfig.json b/fixtures/tsconfig/cases/index/tsconfig.json deleted file mode 100644 index d20b1774..00000000 --- a/fixtures/tsconfig/cases/index/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-index" -} diff --git a/fixtures/tsconfig/cases/paths_template_variable/foo.js b/fixtures/tsconfig/cases/paths_template_variable/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json b/fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json deleted file mode 100644 index a1a37bb6..00000000 --- a/fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "../../tsconfig_template_variable.json" -} diff --git a/fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json b/fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json deleted file mode 100644 index e7d8e5e5..00000000 --- a/fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "compilerOptions": { - "composite": true, - "paths": { - "foo": ["${configDir}/foo.js"] - } - } -} diff --git a/fixtures/tsconfig/cases/project_references/app/aliased/index.ts b/fixtures/tsconfig/cases/project_references/app/aliased/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/app/index.ts b/fixtures/tsconfig/cases/project_references/app/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/app/tsconfig.json b/fixtures/tsconfig/cases/project_references/app/tsconfig.json deleted file mode 100644 index 7036d2bb..00000000 --- a/fixtures/tsconfig/cases/project_references/app/tsconfig.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "extends": "../tsconfig.base.json", - "compilerOptions": { - "baseUrl": "./", - "paths": { - "@/*": ["./aliased/*"] - } - }, - "references": [ - { - "path": "../project_a/conf.json" - }, - { - "path": "../project_b" - }, - { - "path": "../project_c/tsconfig.json" - }, - { - "path": "../../paths_template_variable/tsconfig2.json" - } - ] -} diff --git a/fixtures/tsconfig/cases/project_references/project_a/aliased/index.ts b/fixtures/tsconfig/cases/project_references/project_a/aliased/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_a/conf.json b/fixtures/tsconfig/cases/project_references/project_a/conf.json deleted file mode 100644 index 4d389d7a..00000000 --- a/fixtures/tsconfig/cases/project_references/project_a/conf.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "compilerOptions": { - "composite": true, - "paths": { - "@/*": ["./aliased/*"] - } - } -} diff --git a/fixtures/tsconfig/cases/project_references/project_a/index.ts b/fixtures/tsconfig/cases/project_references/project_a/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_b/src/aliased/index.ts b/fixtures/tsconfig/cases/project_references/project_b/src/aliased/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_b/tsconfig.json b/fixtures/tsconfig/cases/project_references/project_b/tsconfig.json deleted file mode 100644 index 4ab05cd8..00000000 --- a/fixtures/tsconfig/cases/project_references/project_b/tsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "compilerOptions": { - "composite": true, - "baseUrl": "./src", - "paths": { - "@/*": ["./aliased/*"] - } - } -} diff --git a/fixtures/tsconfig/cases/project_references/project_c/index.ts b/fixtures/tsconfig/cases/project_references/project_c/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_c/tsconfig.json b/fixtures/tsconfig/cases/project_references/project_c/tsconfig.json deleted file mode 100644 index fe520939..00000000 --- a/fixtures/tsconfig/cases/project_references/project_c/tsconfig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compilerOptions": { - "composite": true - } -} diff --git a/fixtures/tsconfig/cases/project_references/tsconfig.base.json b/fixtures/tsconfig/cases/project_references/tsconfig.base.json deleted file mode 100644 index 88ccffe7..00000000 --- a/fixtures/tsconfig/cases/project_references/tsconfig.base.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "compilerOptions": { - } -} diff --git a/fixtures/tsconfig/cases/suffixes/a.ios.ts b/fixtures/tsconfig/cases/suffixes/a.ios.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/a.ts b/fixtures/tsconfig/cases/suffixes/a.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/b.ts b/fixtures/tsconfig/cases/suffixes/b.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/c-test.ts b/fixtures/tsconfig/cases/suffixes/c-test.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/index.ts b/fixtures/tsconfig/cases/suffixes/index.ts deleted file mode 100644 index b09939b9..00000000 --- a/fixtures/tsconfig/cases/suffixes/index.ts +++ /dev/null @@ -1 +0,0 @@ -import './a'; diff --git a/fixtures/tsconfig/cases/suffixes/tsconfig.json b/fixtures/tsconfig/cases/suffixes/tsconfig.json deleted file mode 100644 index 4c2ccc8f..00000000 --- a/fixtures/tsconfig/cases/suffixes/tsconfig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compilerOptions": { - "moduleSuffixes": [".ios", "-test", ""] - } -} diff --git a/fixtures/tsconfig/cases/trailing-comma/bar.js b/fixtures/tsconfig/cases/trailing-comma/bar.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/trailing-comma/index.js b/fixtures/tsconfig/cases/trailing-comma/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/trailing-comma/tsconfig.json b/fixtures/tsconfig/cases/trailing-comma/tsconfig.json deleted file mode 100644 index 6dc20ca5..00000000 --- a/fixtures/tsconfig/cases/trailing-comma/tsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "compilerOptions": { - "paths": { - /* some comment */ - "foo": ["bar.js"], - }, - }, - // another comment -} diff --git a/fixtures/tsconfig/foo.js b/fixtures/tsconfig/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/nested/index.js b/fixtures/tsconfig/nested/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/nested/test.js b/fixtures/tsconfig/nested/test.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/nested/tsconfig.json b/fixtures/tsconfig/nested/tsconfig.json deleted file mode 100644 index 6deb3011..00000000 --- a/fixtures/tsconfig/nested/tsconfig.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "extends": "..", - "compilerOptions": { - "paths": { - "ts-path": ["test.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-exports/conf.json b/fixtures/tsconfig/node_modules/tsconfig-exports/conf.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-exports/conf.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-exports/foo.js b/fixtures/tsconfig/node_modules/tsconfig-exports/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-exports/package.json b/fixtures/tsconfig/node_modules/tsconfig-exports/package.json deleted file mode 100644 index be0ddee6..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-exports/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "tsconfig-exports", - "private": true, - "exports": { - ".": "./conf.json" - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-field/conf.json b/fixtures/tsconfig/node_modules/tsconfig-field/conf.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-field/conf.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-field/foo.js b/fixtures/tsconfig/node_modules/tsconfig-field/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-field/package.json b/fixtures/tsconfig/node_modules/tsconfig-field/package.json deleted file mode 100644 index 7138fdde..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-field/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "tsconfig-field", - "private": true, - "tsconfig": "conf.json" -} \ No newline at end of file diff --git a/fixtures/tsconfig/node_modules/tsconfig-index/foo.js b/fixtures/tsconfig/node_modules/tsconfig-index/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-index/package.json b/fixtures/tsconfig/node_modules/tsconfig-index/package.json deleted file mode 100644 index eb2431e7..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-index/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "tsconfig-index", - "private": true -} \ No newline at end of file diff --git a/fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json b/fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-not-used/foo.js b/fixtures/tsconfig/node_modules/tsconfig-not-used/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json b/fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json deleted file mode 100644 index eb16d127..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "ts-path": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/package.json b/fixtures/tsconfig/package.json deleted file mode 100755 index f48acd1c..00000000 --- a/fixtures/tsconfig/package.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "name": "resolver", - "private": true, - "alias": { - "aliased": "foo", - "aliased-file": "./bar.js", - "something": "./nested/test.js", - "aliasedfolder": "./nested", - "aliasedabsolute": "/nested", - "foo/bar": "./bar.js", - "glob/*/*": "./nested/$2", - "./baz": "./bar.js", - "url": false - }, - "imports": { - "#test": "./bar.js" - }, - "dependencies": { - "foo": "^0.3.4" - }, - "peerDependencies": { - "bar": "*" - } -} diff --git a/fixtures/tsconfig/tsconfig.json b/fixtures/tsconfig/tsconfig.json deleted file mode 100644 index eb16d127..00000000 --- a/fixtures/tsconfig/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "ts-path": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/tsconfig_broken.json b/fixtures/tsconfig/tsconfig_broken.json deleted file mode 100644 index 98232c64..00000000 --- a/fixtures/tsconfig/tsconfig_broken.json +++ /dev/null @@ -1 +0,0 @@ -{ diff --git a/fixtures/tsconfig/tsconfig_template_variable.json b/fixtures/tsconfig/tsconfig_template_variable.json deleted file mode 100644 index 6f272344..00000000 --- a/fixtures/tsconfig/tsconfig_template_variable.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["${configDir}/foo.js"] - } - } -} diff --git a/napi/__test__/resolver.spec.mjs b/napi/__test__/resolver.spec.mjs deleted file mode 100644 index ac6ee0ef..00000000 --- a/napi/__test__/resolver.spec.mjs +++ /dev/null @@ -1,260 +0,0 @@ -import { join } from 'node:path' -import { fileURLToPath } from 'node:url' - -import test from 'ava' - -let ResolverFactory - -if (process.env.WASI_TEST) { - const wasi = await import('../resolver.wasi.cjs') - ResolverFactory = wasi.ResolverFactory -} else { - const napi = await import('../index.js') - ResolverFactory = napi.ResolverFactory -} - -const currentDir = join(fileURLToPath(import.meta.url), '..') - -const enhancedResolveRoot = join( - currentDir, - '..', - '..', - 'fixtures', - 'enhanced_resolve', - 'test', - 'fixtures' -) - -// https://github.com/webpack/enhanced-resolve/blob/main/test/resolve.test.js - -for (const [title, context, request, expected] of [ - [ - 'absolute path', - enhancedResolveRoot, - join(enhancedResolveRoot, 'main1.js'), - join(enhancedResolveRoot, 'main1.js'), - ], - [ - 'file with .js', - enhancedResolveRoot, - './main1.js', - join(enhancedResolveRoot, 'main1.js'), - ], - [ - 'file without extension', - enhancedResolveRoot, - './main1', - join(enhancedResolveRoot, 'main1.js'), - ], - [ - 'another file with .js', - enhancedResolveRoot, - './a.js', - join(enhancedResolveRoot, 'a.js'), - ], - [ - 'another file without extension', - enhancedResolveRoot, - './a', - join(enhancedResolveRoot, 'a.js'), - ], - [ - 'file in module with .js', - enhancedResolveRoot, - 'm1/a.js', - join(enhancedResolveRoot, 'node_modules/m1/a.js'), - ], - [ - 'file in module without extension', - enhancedResolveRoot, - 'm1/a', - join(enhancedResolveRoot, 'node_modules/m1/a.js'), - ], - [ - 'another file in module without extension', - enhancedResolveRoot, - 'complexm/step1', - join(enhancedResolveRoot, 'node_modules/complexm/step1.js'), - ], - [ - 'from submodule to file in sibling module', - join(enhancedResolveRoot, 'node_modules/complexm'), - 'm2/b.js', - join(enhancedResolveRoot, 'node_modules/m2/b.js'), - ], - [ - 'from nested directory to overwritten file in module', - join(enhancedResolveRoot, 'multiple_modules'), - 'm1/a.js', - join(enhancedResolveRoot, 'multiple_modules/node_modules/m1/a.js'), - ], - [ - 'from nested directory to not overwritten file in module', - join(enhancedResolveRoot, 'multiple_modules'), - 'm1/b.js', - join(enhancedResolveRoot, 'node_modules/m1/b.js'), - ], - [ - 'file with query', - enhancedResolveRoot, - './main1.js?query', - join(enhancedResolveRoot, 'main1.js?query'), - ], - [ - 'file with fragment', - enhancedResolveRoot, - './main1.js#fragment', - join(enhancedResolveRoot, 'main1.js#fragment'), - ], - [ - 'file with fragment and query', - enhancedResolveRoot, - './main1.js#fragment?query', - join(enhancedResolveRoot, 'main1.js#fragment?query'), - ], - [ - 'file with query and fragment', - enhancedResolveRoot, - './main1.js?#fragment', - join(enhancedResolveRoot, 'main1.js?#fragment'), - ], - - [ - 'file with query (unicode)', - enhancedResolveRoot, - './测试.js?query', - join(enhancedResolveRoot, '测试.js?query'), - ], - [ - 'file with fragment (unicode)', - enhancedResolveRoot, - './测试.js#fragment', - join(enhancedResolveRoot, '测试.js#fragment'), - ], - [ - 'file with fragment and query (unicode)', - enhancedResolveRoot, - './测试.js#fragment?query', - join(enhancedResolveRoot, '测试.js#fragment?query'), - ], - [ - 'file with query and fragment (unicode)', - enhancedResolveRoot, - './测试.js?#fragment', - join(enhancedResolveRoot, '测试.js?#fragment'), - ], - - [ - 'file in module with query', - enhancedResolveRoot, - 'm1/a?query', - join(enhancedResolveRoot, 'node_modules/m1/a.js?query'), - ], - [ - 'file in module with fragment', - enhancedResolveRoot, - 'm1/a#fragment', - join(enhancedResolveRoot, 'node_modules/m1/a.js#fragment'), - ], - [ - 'file in module with fragment and query', - enhancedResolveRoot, - 'm1/a#fragment?query', - join(enhancedResolveRoot, 'node_modules/m1/a.js#fragment?query'), - ], - [ - 'file in module with query and fragment', - enhancedResolveRoot, - 'm1/a?#fragment', - join(enhancedResolveRoot, 'node_modules/m1/a.js?#fragment'), - ], - [ - 'differ between directory and file, resolve file', - enhancedResolveRoot, - './dirOrFile', - join(enhancedResolveRoot, 'dirOrFile.js'), - ], - [ - 'differ between directory and file, resolve directory', - enhancedResolveRoot, - './dirOrFile/', - join(enhancedResolveRoot, 'dirOrFile/index.js'), - ], - [ - 'find node_modules outside of node_modules', - join(enhancedResolveRoot, 'browser-module/node_modules'), - 'm1/a', - join(enhancedResolveRoot, 'node_modules/m1/a.js'), - ], - [ - "don't crash on main field pointing to self", - enhancedResolveRoot, - './main-field-self', - join(enhancedResolveRoot, './main-field-self/index.js'), - ], - [ - "don't crash on main field pointing to self (2)", - enhancedResolveRoot, - './main-field-self2', - join(enhancedResolveRoot, './main-field-self2/index.js'), - ], - // enhanced-resolve has `#` prepended with a `\0`, they are removed from the - // following 3 expected test results. - // See https://github.com/webpack/enhanced-resolve#escaping - [ - 'handle fragment edge case (no fragment)', - enhancedResolveRoot, - './no#fragment/#/#', - join(enhancedResolveRoot, 'no#fragment', '#', '#.js'), - ], - [ - 'handle fragment edge case (fragment)', - enhancedResolveRoot, - './no#fragment/#/', - join(enhancedResolveRoot, 'no.js#fragment') + '/#/', - ], - [ - 'handle fragment escaping', - enhancedResolveRoot, - './no\0#fragment/\0#/\0##fragment', - join(enhancedResolveRoot, 'no#fragment', '#', '#.js#fragment'), - ], -]) { - test(title, (t) => { - const resolver = new ResolverFactory({ - modules: ['src/a', 'src/b', 'src/common', 'node_modules'], - extensions: ['.js', '.jsx', '.ts', '.tsx'], - }) - - t.is(resolver.sync(context, request).path, expected) - }) -} - -test('resolve pnpm package', (t) => { - const rootDir = join(currentDir, '..', '..'); - const pnpmProjectPath = join(rootDir, 'fixtures', 'pnpm') - const resolver = new ResolverFactory({ - aliasFields: ['browser'], - }) - t.deepEqual(resolver.sync(pnpmProjectPath, 'styled-components'), { - path: join( - rootDir, - 'node_modules/.pnpm/styled-components@6.1.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/styled-components/dist/styled-components.browser.cjs.js' - ), - }) - t.deepEqual( - resolver.sync( - join( - rootDir, - 'node_modules/.pnpm/styled-components@6.1.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/styled-components' - ), - 'react' - ), - { - path: join( - rootDir, - 'node_modules/.pnpm/react@18.3.1/node_modules/react/index.js' - ), - } - ) -}) diff --git a/napi/src/lib.rs b/napi/src/lib.rs deleted file mode 100644 index 7cd839c5..00000000 --- a/napi/src/lib.rs +++ /dev/null @@ -1,214 +0,0 @@ -extern crate napi; -extern crate napi_derive; -extern crate oxc_resolver; - -use std::{ - path::{Path, PathBuf}, - sync::Arc, -}; - -use napi::{bindgen_prelude::AsyncTask, Task}; -use napi_derive::napi; -use oxc_resolver::{ResolveOptions, Resolver}; - -use self::{ - options::{NapiResolveOptions, StrOrStrList}, - tracing::init_tracing, -}; - -mod options; -mod tracing; - -#[napi(object)] -pub struct ResolveResult { - pub path: Option, - pub error: Option, - /// "type" field in the package.json file - pub module_type: Option, -} - -fn resolve(resolver: &Resolver, path: &Path, request: &str) -> ResolveResult { - match resolver.resolve(path, request) { - Ok(resolution) => ResolveResult { - path: Some(resolution.full_path().to_string_lossy().to_string()), - error: None, - module_type: resolution - .package_json() - .and_then(|p| p.r#type.as_ref()) - .and_then(|t| t.as_str()) - .map(|t| t.to_string()), - }, - Err(err) => ResolveResult { path: None, module_type: None, error: Some(err.to_string()) }, - } -} - -#[allow(clippy::needless_pass_by_value)] -#[napi] -pub fn sync(path: String, request: String) -> ResolveResult { - let path = PathBuf::from(path); - let resolver = Resolver::new(ResolveOptions::default()); - resolve(&resolver, &path, &request) -} - -pub struct ResolveTask { - resolver: Arc, - directory: PathBuf, - request: String, -} - -#[napi] -impl Task for ResolveTask { - type Output = ResolveResult; - type JsValue = ResolveResult; - - fn compute(&mut self) -> napi::Result { - Ok(resolve(&self.resolver, &self.directory, &self.request)) - } - - fn resolve(&mut self, _: napi::Env, result: Self::Output) -> napi::Result { - Ok(result) - } -} - -#[napi] -pub struct ResolverFactory { - resolver: Arc, -} - -#[napi] -impl ResolverFactory { - #[napi(constructor)] - pub fn new(options: NapiResolveOptions) -> Self { - init_tracing(); - Self { resolver: Arc::new(Resolver::new(Self::normalize_options(options))) } - } - - #[napi] - pub fn default() -> Self { - let default_options = ResolveOptions::default(); - Self { resolver: Arc::new(Resolver::new(default_options)) } - } - - /// Clone the resolver using the same underlying cache. - #[napi] - pub fn clone_with_options(&self, options: NapiResolveOptions) -> Self { - Self { - resolver: Arc::new(self.resolver.clone_with_options(Self::normalize_options(options))), - } - } - - /// Clear the underlying cache. - #[napi] - pub fn clear_cache(&self) { - self.resolver.clear_cache(); - } - - /// Synchronously resolve `specifier` at an absolute path to a `directory`. - #[allow(clippy::needless_pass_by_value)] - #[napi] - pub fn sync(&self, directory: String, request: String) -> ResolveResult { - let path = PathBuf::from(directory); - resolve(&self.resolver, &path, &request) - } - - /// Asynchronously resolve `specifier` at an absolute path to a `directory`. - #[allow(clippy::needless_pass_by_value)] - #[napi(js_name = "async")] - pub fn resolve_async(&self, directory: String, request: String) -> AsyncTask { - let path = PathBuf::from(directory); - let resolver = self.resolver.clone(); - AsyncTask::new(ResolveTask { resolver, directory: path, request }) - } - - fn normalize_options(op: NapiResolveOptions) -> ResolveOptions { - let default = ResolveOptions::default(); - // merging options - ResolveOptions { - tsconfig: op.tsconfig.map(|tsconfig| tsconfig.into()), - alias: op - .alias - .map(|alias| { - alias - .into_iter() - .map(|(k, v)| { - let v = v - .into_iter() - .map(|item| match item { - Some(path) => oxc_resolver::AliasValue::from(path), - None => oxc_resolver::AliasValue::Ignore, - }) - .collect(); - (k, v) - }) - .collect::>() - }) - .unwrap_or(default.alias), - alias_fields: op - .alias_fields - .map(|o| o.into_iter().map(|x| StrOrStrList(x).into()).collect::>()) - .unwrap_or(default.alias_fields), - condition_names: op.condition_names.unwrap_or(default.condition_names), - description_files: op.description_files.unwrap_or(default.description_files), - enforce_extension: op - .enforce_extension - .map(|enforce_extension| enforce_extension.into()) - .unwrap_or(default.enforce_extension), - exports_fields: op - .exports_fields - .map(|o| o.into_iter().map(|x| StrOrStrList(x).into()).collect::>()) - .unwrap_or(default.exports_fields), - imports_fields: op - .imports_fields - .map(|o| o.into_iter().map(|x| StrOrStrList(x).into()).collect::>()) - .unwrap_or(default.imports_fields), - extension_alias: op - .extension_alias - .map(|extension_alias| extension_alias.into_iter().collect::>()) - .unwrap_or(default.extension_alias), - extensions: op.extensions.unwrap_or(default.extensions), - fallback: op - .fallback - .map(|fallback| { - fallback - .into_iter() - .map(|(k, v)| { - let v = v - .into_iter() - .map(|item| match item { - Some(path) => oxc_resolver::AliasValue::from(path), - None => oxc_resolver::AliasValue::Ignore, - }) - .collect(); - (k, v) - }) - .collect::>() - }) - .unwrap_or(default.fallback), - fully_specified: op.fully_specified.unwrap_or(default.fully_specified), - main_fields: op - .main_fields - .map(|o| StrOrStrList(o).into()) - .unwrap_or(default.main_fields), - main_files: op.main_files.unwrap_or(default.main_files), - modules: op.modules.map(|o| StrOrStrList(o).into()).unwrap_or(default.modules), - resolve_to_context: op.resolve_to_context.unwrap_or(default.resolve_to_context), - prefer_relative: op.prefer_relative.unwrap_or(default.prefer_relative), - prefer_absolute: op.prefer_absolute.unwrap_or(default.prefer_absolute), - restrictions: op - .restrictions - .map(|restrictions| { - restrictions - .into_iter() - .map(|restriction| restriction.into()) - .collect::>() - }) - .unwrap_or(default.restrictions), - roots: op - .roots - .map(|roots| roots.into_iter().map(PathBuf::from).collect::>()) - .unwrap_or(default.roots), - symlinks: op.symlinks.unwrap_or(default.symlinks), - builtin_modules: op.builtin_modules.unwrap_or(default.builtin_modules), - } - } -} diff --git a/napi/src/options.rs b/napi/src/options.rs deleted file mode 100644 index ea35672f..00000000 --- a/napi/src/options.rs +++ /dev/null @@ -1,261 +0,0 @@ -use std::path::PathBuf; - -use napi::Either; -use napi_derive::napi; -use std::collections::HashMap; - -/// Module Resolution Options -/// -/// Options are directly ported from [enhanced-resolve](https://github.com/webpack/enhanced-resolve#resolver-options). -/// -/// See [webpack resolve](https://webpack.js.org/configuration/resolve/) for information and examples -#[derive(Debug, Clone)] -#[napi(object)] -pub struct NapiResolveOptions { - /// Path to TypeScript configuration file. - /// - /// Default `None` - pub tsconfig: Option, - - /// Alias for [ResolveOptions::alias] and [ResolveOptions::fallback]. - /// - /// For the second value of the tuple, `None -> AliasValue::Ignore`, Some(String) -> - /// AliasValue::Path(String)` - /// Create aliases to import or require certain modules more easily. - /// A trailing $ can also be added to the given object's keys to signify an exact match. - pub alias: Option>>>, - - /// A list of alias fields in description files. - /// Specify a field, such as `browser`, to be parsed according to [this specification](https://github.com/defunctzombie/package-browser-field-spec). - /// Can be a path to json object such as `["path", "to", "exports"]`. - /// - /// Default `[]` - #[napi(ts_type = "(string | string[])[]")] - pub alias_fields: Option>, - - /// Condition names for exports field which defines entry points of a package. - /// The key order in the exports field is significant. During condition matching, earlier entries have higher priority and take precedence over later entries. - /// - /// Default `[]` - pub condition_names: Option>, - - /// The JSON files to use for descriptions. (There was once a `bower.json`.) - /// - /// Default `["package.json"]` - pub description_files: Option>, - - /// If true, it will not allow extension-less files. - /// So by default `require('./foo')` works if `./foo` has a `.js` extension, - /// but with this enabled only `require('./foo.js')` will work. - /// - /// Default to `true` when [ResolveOptions::extensions] contains an empty string. - /// Use `Some(false)` to disable the behavior. - /// See - /// - /// Default None, which is the same as `Some(false)` when the above empty rule is not applied. - pub enforce_extension: Option, - - /// A list of exports fields in description files. - /// Can be a path to json object such as `["path", "to", "exports"]`. - /// - /// Default `[["exports"]]`. - #[napi(ts_type = "(string | string[])[]")] - pub exports_fields: Option>, - - /// Fields from `package.json` which are used to provide the internal requests of a package - /// (requests starting with # are considered internal). - /// - /// Can be a path to a JSON object such as `["path", "to", "imports"]`. - /// - /// Default `[["imports"]]`. - #[napi(ts_type = "(string | string[])[]")] - pub imports_fields: Option>, - - /// An object which maps extension to extension aliases. - /// - /// Default `{}` - pub extension_alias: Option>>, - - /// Attempt to resolve these extensions in order. - /// If multiple files share the same name but have different extensions, - /// will resolve the one with the extension listed first in the array and skip the rest. - /// - /// Default `[".js", ".json", ".node"]` - pub extensions: Option>, - - /// Redirect module requests when normal resolving fails. - /// - /// Default `[]` - pub fallback: Option>>>, - - /// 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). - /// - /// See also webpack configuration [resolve.fullySpecified](https://webpack.js.org/configuration/module/#resolvefullyspecified) - /// - /// Default `false` - pub fully_specified: Option, - - /// A list of main fields in description files - /// - /// Default `["main"]`. - #[napi(ts_type = "string | string[]")] - pub main_fields: Option, - - /// The filename to be used while resolving directories. - /// - /// Default `["index"]` - pub main_files: Option>, - - /// A list of directories to resolve modules from, can be absolute path or folder name. - /// - /// Default `["node_modules"]` - #[napi(ts_type = "string | string[]")] - pub modules: Option, - - /// Resolve to a context instead of a file. - /// - /// Default `false` - pub resolve_to_context: Option, - - /// Prefer to resolve module requests as relative requests instead of using modules from node_modules directories. - /// - /// Default `false` - pub prefer_relative: Option, - - /// Prefer to resolve server-relative urls as absolute paths before falling back to resolve in ResolveOptions::roots. - /// - /// Default `false` - pub prefer_absolute: Option, - - /// A list of resolve restrictions to restrict the paths that a request can be resolved on. - /// - /// Default `[]` - pub restrictions: Option>, - - /// A list of directories where requests of server-relative URLs (starting with '/') are resolved. - /// On non-Windows systems these requests are resolved as an absolute path first. - /// - /// Default `[]` - pub roots: Option>, - - /// Whether to resolve symlinks to their symlinked location. - /// When enabled, symlinked resources are resolved to their real path, not their symlinked location. - /// Note that this may cause module resolution to fail when using tools that symlink packages (like npm link). - /// - /// Default `true` - pub symlinks: Option, - - /// Whether to parse [module.builtinModules](https://nodejs.org/api/module.html#modulebuiltinmodules) or not. - /// For example, "zlib" will throw [crate::ResolveError::Builtin] when set to true. - /// - /// Default `false` - pub builtin_modules: Option, -} - -#[napi] -#[derive(Debug, PartialEq, Eq)] -pub enum EnforceExtension { - Auto, - Enabled, - Disabled, -} - -impl EnforceExtension { - pub fn is_auto(&self) -> bool { - *self == Self::Auto - } - - pub fn is_enabled(&self) -> bool { - *self == Self::Enabled - } - - pub fn is_disabled(&self) -> bool { - *self == Self::Disabled - } -} - -/// Alias Value for [ResolveOptions::alias] and [ResolveOptions::fallback]. -/// Use struct because napi don't support structured union now -#[napi(object)] -#[derive(Debug, Clone)] -pub struct Restriction { - pub path: Option, - pub regex: Option, -} - -/// Tsconfig Options -/// -/// Derived from [tsconfig-paths-webpack-plugin](https://github.com/dividab/tsconfig-paths-webpack-plugin#options) -#[napi(object)] -#[derive(Debug, Clone)] -pub struct TsconfigOptions { - /// Allows you to specify where to find the TypeScript configuration file. - /// You may provide - /// * a relative path to the configuration file. It will be resolved relative to cwd. - /// * an absolute path to the configuration file. - pub config_file: String, - - /// Support for Typescript Project References. - /// - /// * `'auto'`: use the `references` field from tsconfig of `config_file`. - /// * `string[]`: manually provided relative or absolute path. - #[napi(ts_type = "'auto' | string[]")] - pub references: Option>>, -} - -impl Into for Restriction { - fn into(self) -> oxc_resolver::Restriction { - match (self.path, self.regex) { - (None, None) => { - panic!("Should specify path or regex") - } - (None, Some(regex)) => oxc_resolver::Restriction::RegExp(regex), - (Some(path), None) => oxc_resolver::Restriction::Path(PathBuf::from(path)), - (Some(_), Some(_)) => { - panic!("Restriction can't be path and regex at the same time") - } - } - } -} - -impl Into for EnforceExtension { - fn into(self) -> oxc_resolver::EnforceExtension { - match self { - EnforceExtension::Auto => oxc_resolver::EnforceExtension::Auto, - EnforceExtension::Enabled => oxc_resolver::EnforceExtension::Enabled, - EnforceExtension::Disabled => oxc_resolver::EnforceExtension::Disabled, - } - } -} - -impl Into for TsconfigOptions { - fn into(self) -> oxc_resolver::TsconfigOptions { - oxc_resolver::TsconfigOptions { - config_file: PathBuf::from(self.config_file), - references: match self.references { - Some(Either::A(string)) if string.as_str() == "auto" => { - oxc_resolver::TsconfigReferences::Auto - } - Some(Either::A(opt)) => { - panic!("`{}` is not a valid option for tsconfig references", opt) - } - Some(Either::B(paths)) => oxc_resolver::TsconfigReferences::Paths( - paths.into_iter().map(PathBuf::from).collect::>(), - ), - None => oxc_resolver::TsconfigReferences::Disabled, - }, - } - } -} - -type StrOrStrListType = Either>; -pub struct StrOrStrList(pub StrOrStrListType); - -impl Into> for StrOrStrList { - fn into(self) -> Vec { - match self { - StrOrStrList(Either::A(s)) => Vec::from([s]), - StrOrStrList(Either::B(a)) => a, - } - } -} diff --git a/napi/src/tracing.rs b/napi/src/tracing.rs deleted file mode 100644 index 88e4cd7e..00000000 --- a/napi/src/tracing.rs +++ /dev/null @@ -1,25 +0,0 @@ -use std::sync::OnceLock; - -use tracing_subscriber::filter::Targets; -use tracing_subscriber::prelude::__tracing_subscriber_SubscriberExt; -use tracing_subscriber::util::SubscriberInitExt; - -/// To debug `oxc_resolver`: -/// `OXC_LOG=DEBUG your program` -pub fn init_tracing() { - static TRACING: OnceLock<()> = OnceLock::new(); - TRACING.get_or_init(|| { - // Usage without the `regex` feature. - // - tracing_subscriber::registry() - .with(std::env::var("OXC_LOG").map_or_else( - |_| Targets::new(), - |env_var| { - use std::str::FromStr; - Targets::from_str(&env_var).unwrap() - }, - )) - .with(tracing_subscriber::fmt::layer()) - .init(); - }); -} diff --git a/napi/tests/options.test.mjs b/napi/tests/options.test.mjs deleted file mode 100644 index 4a93efff..00000000 --- a/napi/tests/options.test.mjs +++ /dev/null @@ -1,59 +0,0 @@ -import { describe, it } from "node:test"; -import { ResolverFactory } from "../index.js"; -import * as assert from "node:assert"; -import * as path from "node:path"; - -const fixtureDir = new URL( - "../../fixtures/enhanced_resolve/test/fixtures", - import.meta.url -).pathname; - -describe("option", () => { - describe("aliasFields", () => { - it("should allow field string ", () => { - const resolver = new ResolverFactory({ aliasFields: ["browser"] }); - assert.match( - resolver.sync(fixtureDir, "./browser-module/lib/replaced.js").path, - /browser-module\/lib\/browser\.js$/ - ); - }); - it("should allow json path array", () => { - const resolver = new ResolverFactory({ - aliasFields: [["innerBrowser1", "field", "browser"]], - }); - - assert.match( - resolver.sync(fixtureDir, "./browser-module/lib/main1.js").path, - /browser-module\/lib\/main\.js$/ - ); - }); - }); - - describe("exportsFields", () => { - const createTest = (exportsFields) => { - const resolver = new ResolverFactory({ exportsFields }); - assert.match( - resolver.sync( - path.resolve(fixtureDir, "./exports-field3"), - "exports-field" - ).path, - /\/exports-field\/src\/index\.js$/ - ); - }; - it("should allow string as field item", createTest(["broken"])); - it("should allow json path array as field item", createTest([["broken"]])); - }); - - describe("mainFields", () => { - const createTest = (mainFields) => { - const resolver = new ResolverFactory({ mainFields }); - assert.match( - resolver.sync(fixtureDir, "../..").path, - /\/lib\/index\.js$/ - ); - }; - it("should use `'main'` as default", createTest(undefined)); - it("should allow field string", createTest("main")); - it("should allow field array", createTest(["main"])); - }); -}); diff --git a/npm/package.json b/npm/package.json index 85422809..7136edb8 100644 --- a/npm/package.json +++ b/npm/package.json @@ -1,47 +1,36 @@ { - "name": "oxc-resolver", - "version": "1.11.0", - "description": "Oxc Resolver Node API", - "main": "index.js", - "browser": "browser.js", - "files": [ - "index.d.ts", - "index.js", - "browser.js" - ], - "license": "MIT", - "homepage": "https://oxc.rs", - "repository": { - "type": "git", - "url": "git+https://github.com/oxc-project/oxc-resolver.git" - }, - "publishConfig": { - "registry": "https://registry.npmjs.org/", - "access": "public" - }, - "napi": { - "binaryName": "resolver", - "packageName": "@oxc-resolver/binding", - "wasm": { - "browser": { - "fs": true - } - }, - "targets": [ - "x86_64-pc-windows-msvc", - "aarch64-pc-windows-msvc", - "x86_64-unknown-linux-gnu", - "x86_64-unknown-linux-musl", - "x86_64-unknown-freebsd", - "aarch64-unknown-linux-gnu", - "aarch64-unknown-linux-musl", - "armv7-unknown-linux-gnueabihf", - "x86_64-apple-darwin", - "aarch64-apple-darwin", - "wasm32-wasip1-threads" - ] - }, - "funding": { - "url": "https://github.com/sponsors/Boshen" - } + "browser": "browser.js", + "description": "Oxc Resolver Node API", + "files": [ + "index.d.ts", + "index.js", + "browser.js" + ], + "funding": { + "url": "https://github.com/sponsors/Boshen" + }, + "main": "index.js", + "name": "oxc-resolver", + "napi": { + "binaryName": "resolver", + "packageName": "@oxc-resolver/binding", + "targets": [ + "x86_64-pc-windows-msvc", + "aarch64-pc-windows-msvc", + "x86_64-unknown-linux-gnu", + "x86_64-unknown-linux-musl", + "x86_64-unknown-freebsd", + "aarch64-unknown-linux-gnu", + "aarch64-unknown-linux-musl", + "armv7-unknown-linux-gnueabihf", + "x86_64-apple-darwin", + "aarch64-apple-darwin", + "wasm32-wasip1-threads" + ], + "wasm": { + "browser": { + "fs": true + } + } + } } diff --git a/package.json b/package.json index 30892ca3..d0ee7633 100644 --- a/package.json +++ b/package.json @@ -1,33 +1,24 @@ { - "name": "@oxc-resolver/binding", - "private": true, - "version": "0.0.0", - "scripts": { - "build": "napi build --platform --release --package-json-path npm/package.json --manifest-path napi/Cargo.toml", - "build:debug": "napi build --platform --package-json-path npm/package.json --manifest-path napi/Cargo.toml", - "prepublishOnly": "napi pre-publish -t npm", - "test": "ava" - }, - "devDependencies": { - "@napi-rs/cli": "3.0.0-alpha.62", - "@napi-rs/wasm-runtime": "^0.2.4", - "@types/node": "^22.0.0", - "ava": "^6.1.3", - "emnapi": "^1.2.0", - "typescript": "^5.5.3" - }, - "ava": { - "files": [ - "napi/__test__/*.spec.mjs" - ], - "cache": false - }, - "packageManager": "pnpm@9.9.0", - "repository": { - "type": "git", - "url": "git+https://github.com/oxc-project/oxc-resolver.git" - }, - "funding": { - "url": "https://github.com/sponsors/Boshen" - } + "ava": { + "cache": false, + "files": [ + "napi/__test__/*.spec.mjs" + ] + }, + "devDependencies": { + "@napi-rs/cli": "3.0.0-alpha.62", + "@napi-rs/wasm-runtime": "^0.2.4", + "@types/node": "^22.0.0", + "ava": "^6.1.3", + "emnapi": "^1.2.0" + }, + "funding": { + "url": "https://github.com/sponsors/Boshen" + }, + "name": "@oxc-resolver/binding", + "scripts": { + "build": "napi build --platform --release --package-json-path npm/package.json --manifest-path napi/Cargo.toml", + "build:debug": "napi build --platform --package-json-path npm/package.json --manifest-path napi/Cargo.toml", + "prepublishOnly": "napi pre-publish -t npm" + } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml deleted file mode 100644 index db9e5b63..00000000 --- a/pnpm-lock.yaml +++ /dev/null @@ -1,2598 +0,0 @@ -lockfileVersion: '9.0' - -settings: - autoInstallPeers: true - excludeLinksFromLockfile: false - -importers: - - .: - devDependencies: - '@napi-rs/cli': - specifier: 3.0.0-alpha.62 - version: 3.0.0-alpha.62(@emnapi/runtime@1.2.0)(emnapi@1.2.0) - '@napi-rs/wasm-runtime': - specifier: ^0.2.4 - version: 0.2.4 - '@types/node': - specifier: ^22.0.0 - version: 22.5.4 - ava: - specifier: ^6.1.3 - version: 6.1.3 - emnapi: - specifier: ^1.2.0 - version: 1.2.0 - typescript: - specifier: ^5.5.3 - version: 5.5.4 - - fixtures/pnpm: - devDependencies: - axios: - specifier: 1.6.2 - version: 1.6.2 - ipaddr.js: - specifier: 2.2.0 - version: 2.2.0 - postcss: - specifier: 8.4.33 - version: 8.4.33 - styled-components: - specifier: 6.1.1 - version: 6.1.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - - npm: {} - -packages: - - '@emnapi/core@1.2.0': - resolution: {integrity: sha512-E7Vgw78I93we4ZWdYCb4DGAwRROGkMIXk7/y87UmANR+J6qsWusmC3gLt0H+O0KOt5e6O38U8oJamgbudrES/w==} - - '@emnapi/runtime@1.2.0': - resolution: {integrity: sha512-bV21/9LQmcQeCPEg3BDFtvwL6cwiTMksYNWQQ4KOxCZikEGalWtenoZ0wCiukJINlGCIi2KXx01g4FoH/LxpzQ==} - - '@emnapi/wasi-threads@1.0.1': - resolution: {integrity: sha512-iIBu7mwkq4UQGeMEM8bLwNK962nXdhodeScX4slfQnRhEMMzvYivHhutCIk8uojvmASXXPC2WNEjwxFWk72Oqw==} - - '@emotion/is-prop-valid@1.2.2': - resolution: {integrity: sha512-uNsoYd37AFmaCdXlg6EYD1KaPOaRWRByMCYzbKUX4+hhMfrxdVSelShywL4JVaAeM/eHUOSprYBQls+/neX3pw==} - - '@emotion/memoize@0.8.1': - resolution: {integrity: sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA==} - - '@emotion/unitless@0.8.1': - resolution: {integrity: sha512-KOEGMu6dmJZtpadb476IsZBclKvILjopjUii3V+7MnXIQCYh8W3NgNcgwo21n9LXZX6EDIKvqfjYxXebDwxKmQ==} - - '@inquirer/checkbox@2.3.10': - resolution: {integrity: sha512-CTc864M2/523rKc9AglIzAcUCuPXDZENgc5S2KZFVRbnMzpXcYTsUWmbqSeL0XLvtlvEtNevkkVbfVhJpruOyQ==} - engines: {node: '>=18'} - - '@inquirer/confirm@3.1.14': - resolution: {integrity: sha512-nbLSX37b2dGPtKWL3rPuR/5hOuD30S+pqJ/MuFiUEgN6GiMs8UMxiurKAMDzKt6C95ltjupa8zH6+3csXNHWpA==} - engines: {node: '>=18'} - - '@inquirer/core@9.0.2': - resolution: {integrity: sha512-nguvH3TZar3ACwbytZrraRTzGqyxJfYJwv+ZwqZNatAosdWQMP1GV8zvmkNlBe2JeZSaw0WYBHZk52pDpWC9qA==} - engines: {node: '>=18'} - - '@inquirer/editor@2.1.14': - resolution: {integrity: sha512-6nWpoJyVAKwAcv67bkbBmmi3f32xua79fP7TRmNUoR4K+B1GiOBsHO1YdvET/jvC+nTlBZL7puKAKyM7G+Lkzw==} - engines: {node: '>=18'} - - '@inquirer/expand@2.1.14': - resolution: {integrity: sha512-JcxsLajwPykF2kq6biIUdoOzTQ3LXqb8XMVrWkCprG/pFeU1SsxcSSFbF1T5jJGvvlTVcsE+JdGjbQ8ZRZ82RA==} - engines: {node: '>=18'} - - '@inquirer/figures@1.0.3': - resolution: {integrity: sha512-ErXXzENMH5pJt5/ssXV0DfWUZqly8nGzf0UcBV9xTnP+KyffE2mqyxIMBrZ8ijQck2nU0TQm40EQB53YreyWHw==} - engines: {node: '>=18'} - - '@inquirer/input@2.2.1': - resolution: {integrity: sha512-Yl1G6h7qWydzrJwqN777geeJVaAFL5Ly83aZlw4xHf8Z/BoTMfKRheyuMaQwOG7LQ4e5nQP7PxXdEg4SzQ+OKw==} - engines: {node: '>=18'} - - '@inquirer/number@1.0.2': - resolution: {integrity: sha512-GcoK+Phxcln0Qw9e73S5a8B2Ejg3HgSTvNfDegIcS5/BKwUm8t5rejja1l09WXjZM9vrVbRDf9RzWtSUiWVYRQ==} - engines: {node: '>=18'} - - '@inquirer/password@2.1.14': - resolution: {integrity: sha512-sPzOkXLhWJQ96K6nPZFnF8XB8tsDrcCRobd1d3EDz81F+4hp8BbdmsnsQcqZ7oYDIOVM/mWJyIUtJ35TrssJxQ==} - engines: {node: '>=18'} - - '@inquirer/prompts@5.1.2': - resolution: {integrity: sha512-E+ndnfwtVQtcmPt888Hc/HAxJUHSaA6OIvyvLAQ5BLQv+t20GbYdFSjXeLgb47OpMU+aRsKA/ys+Zoylw3kTVg==} - engines: {node: '>=18'} - - '@inquirer/rawlist@2.1.14': - resolution: {integrity: sha512-pLpEzhKNQ/ugFAFfgCNaXljB+dcCwmXwR1jOxAbVeFIdB3l02E5gjI+h1rb136tq0T8JO6P5KFR1oTeld/wdrA==} - engines: {node: '>=18'} - - '@inquirer/select@2.3.10': - resolution: {integrity: sha512-rr7iR0Zj1YFfgM8IUGimPD9Yukd+n/U63CnYT9kdum6DbRXtMxR45rrreP+EA9ixCnShr+W4xj7suRxC1+8t9g==} - engines: {node: '>=18'} - - '@inquirer/type@1.4.0': - resolution: {integrity: sha512-AjOqykVyjdJQvtfkNDGUyMYGF8xN50VUxftCQWsOyIo4DFRLr6VQhW0VItGI1JIyQGCGgIpKa7hMMwNhZb4OIw==} - engines: {node: '>=18'} - - '@mapbox/node-pre-gyp@1.0.11': - resolution: {integrity: sha512-Yhlar6v9WQgUp/He7BdgzOz8lqMQ8sU+jkCq7Wx8Myc5YFJLbEe7lgui/V7G1qB1DJykHSGwreceSaD60Y0PUQ==} - hasBin: true - - '@napi-rs/cli@3.0.0-alpha.62': - resolution: {integrity: sha512-IDUwHAEJZ9ad/s5oyhznrz5ZDcU+SJ6GdP5nb++Wx5MkS4FD9MeS3HfNZdsxkf10pOUPnmvCVFuG4xnLBQYmjw==} - engines: {node: '>= 16'} - hasBin: true - peerDependencies: - '@emnapi/runtime': ^1.1.0 - emnapi: ^1.1.0 - peerDependenciesMeta: - '@emnapi/runtime': - optional: true - emnapi: - optional: true - - '@napi-rs/cross-toolchain@0.0.16': - resolution: {integrity: sha512-jwdjHT5L0m9MH0CmzDwPp0ckn/UO7afHCsPeo7NugHUvYgvlgS7SWhdMVgIgJW2HHqhcW/2nhaLLGpAU1c7QRQ==} - peerDependencies: - '@napi-rs/cross-toolchain-arm64-target-aarch64': ^0.0.16 - '@napi-rs/cross-toolchain-arm64-target-armv7': ^0.0.16 - '@napi-rs/cross-toolchain-arm64-target-x86_64': ^0.0.16 - '@napi-rs/cross-toolchain-x64-target-aarch64': ^0.0.16 - '@napi-rs/cross-toolchain-x64-target-armv7': ^0.0.16 - '@napi-rs/cross-toolchain-x64-target-x86_64': ^0.0.16 - peerDependenciesMeta: - '@napi-rs/cross-toolchain-arm64-target-aarch64': - optional: true - '@napi-rs/cross-toolchain-arm64-target-armv7': - optional: true - '@napi-rs/cross-toolchain-arm64-target-x86_64': - optional: true - '@napi-rs/cross-toolchain-x64-target-aarch64': - optional: true - '@napi-rs/cross-toolchain-x64-target-armv7': - optional: true - '@napi-rs/cross-toolchain-x64-target-x86_64': - optional: true - - '@napi-rs/lzma-android-arm-eabi@1.3.1': - resolution: {integrity: sha512-mtGOg8jXlc+pTBI86cqohfndS9UmOAkk9d5CChKMb8btVks70yhUN1e7YYS3QFbmoxbPs2Ee+wmuH1Khdc7B2w==} - engines: {node: '>= 10'} - cpu: [arm] - os: [android] - - '@napi-rs/lzma-android-arm64@1.3.1': - resolution: {integrity: sha512-4uGkQgAv9Tnc/i0k2eIgbhZgyzs94+iECWxz4MFZNcZ1fNGvGbRL2j+SITE4OmwrUn3TuFK/uYWfgzooq8E1Qg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [android] - - '@napi-rs/lzma-darwin-arm64@1.3.1': - resolution: {integrity: sha512-MZBg4iwHTS8icjTiCMdzh8kYrMmKBCEglFPa+vjI91R2XDwuuwSzqmpATRpmMH8cWUUWtGPF4fnxKzjgkzhd4Q==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [darwin] - - '@napi-rs/lzma-darwin-x64@1.3.1': - resolution: {integrity: sha512-7vte+1lYV7xgZERKH/pjAeh4T16aQASKOzu4op70pK6VP/64Plr5rrvqxQqQmlAIe4pwyo/RkFl1n4LXDod3xg==} - engines: {node: '>= 10'} - cpu: [x64] - os: [darwin] - - '@napi-rs/lzma-freebsd-x64@1.3.1': - resolution: {integrity: sha512-uBS74fynTqLUC3catIxyezCafn8UDlr2yxVV47vz1T6Vop2PGDz/cMQdV6rnLSjPE08Rv66ihM36mgf/MmOkOg==} - engines: {node: '>= 10'} - cpu: [x64] - os: [freebsd] - - '@napi-rs/lzma-linux-arm-gnueabihf@1.3.1': - resolution: {integrity: sha512-rrVLyqBJeN29gPJCNkPbZ7dAzaseEcERKyhjwM+DfbFrDUvtkEcrYPvo+iwE/NmF+OkZQkzcanrVMGnq/mcJYQ==} - engines: {node: '>= 10'} - cpu: [arm] - os: [linux] - - '@napi-rs/lzma-linux-arm64-gnu@1.3.1': - resolution: {integrity: sha512-vDmVsthRbX2opkgRirJJGKQxUP/spvyVM2Y5CyCWZ7sadSID3hA97r38gf9ISn/sJ8/r93IPWLq+iycudNKi+Q==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/lzma-linux-arm64-musl@1.3.1': - resolution: {integrity: sha512-x4m/J3hRdFd3IoqKc+4aBcSUkcuDEP7hH6vdss8bKNLjPfXmnG/lcHJEQX3hNnNOULPP8xVRxgiY8jeL62cnsw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/lzma-linux-x64-gnu@1.3.1': - resolution: {integrity: sha512-riB+Xg72NfH8Kcpq07omshVu0QsLW0v2bhywBNYxvA+t2dGGWSIEN1U/zazUXys+IEA6pBQKqLVseurWE6Cl8g==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/lzma-linux-x64-musl@1.3.1': - resolution: {integrity: sha512-JXLgJFwoeysxdSg7rdVYP8wrliCQVJlU5JcLYjRVSCL4P0mQTjnYi7R7VdaOkDACw/Fvlji7oIJXt0KiaDTcOw==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/lzma-wasm32-wasi@1.3.1': - resolution: {integrity: sha512-XTA9XTUtj0KPKuzNS2oi3bWN6tJodk00wwMd/TiKoEqx9Fe/zu+OfDGuXAn+xs+P7S3YCDHqjYinuTQMZ0ucJw==} - engines: {node: '>=14.0.0'} - cpu: [wasm32] - - '@napi-rs/lzma-win32-arm64-msvc@1.3.1': - resolution: {integrity: sha512-qLDfs9UEtLPPTN/FdSz3gSdlx86VwFQBuLBrQtaiYQtUTKZCOYV1Z1fXqFt5Zqa1HKV2oyXnwGcTI7RpcyXxtg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [win32] - - '@napi-rs/lzma-win32-ia32-msvc@1.3.1': - resolution: {integrity: sha512-rWNlxLFMIfvxzfdQCfeQ3D/HEnQG3vfladFYrXUx6ePXO6r+BLCGn6/LWSSuKlw4vKkb1iHEWsAVaRLIcJEMIA==} - engines: {node: '>= 10'} - cpu: [ia32] - os: [win32] - - '@napi-rs/lzma-win32-x64-msvc@1.3.1': - resolution: {integrity: sha512-SNfHNqEjabXfTL1+KRi0qiAhwIlZHhQystvfSYX6p1g+2trSC/3WUpUQ4fbbR7KyE31g2AAnwjXivnlQ0af/pg==} - engines: {node: '>= 10'} - cpu: [x64] - os: [win32] - - '@napi-rs/lzma@1.3.1': - resolution: {integrity: sha512-XyZoBlYNMvCulK/RmVK/0nB3j7IdH7HpqcrMMg0U+HqQqKRLOQBwvnKNBocPC1bZQ7iZuKWYTLn1ayZwTyek8w==} - engines: {node: '>= 10'} - - '@napi-rs/tar-android-arm-eabi@0.1.1': - resolution: {integrity: sha512-Ufa0ahZvE5KGrC2WBux5svCe/jvC+e8IgtleiicwqnfgTfbDknYyq/QuqkP1AnMp/IvTmx2iutCZt6OFIG0zAg==} - engines: {node: '>= 10'} - cpu: [arm] - os: [android] - - '@napi-rs/tar-android-arm64@0.1.1': - resolution: {integrity: sha512-KUu5fHIiIObSuZ/crHxUrQ243+LiCRKPwdCVLHwjtftqFjzls+R2Mp6GrpM41XxexDMN00SUta3kazi93Xr19A==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [android] - - '@napi-rs/tar-darwin-arm64@0.1.1': - resolution: {integrity: sha512-jaqgdX20iIga+2gzotQ78eF00Cm8vECocUYeMY62WqyzJNv/jx1dlOfELWEccOjpmawFT9tjWebsS9F1QMvSUg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [darwin] - - '@napi-rs/tar-darwin-x64@0.1.1': - resolution: {integrity: sha512-80sa32IxfRso9x9sGTFpfLSx3BnruyJODpSkUzalOCz9i14n5gOKA8KR/JrnSWwDz0p5l5P9kfQD3pu8Voj7WA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [darwin] - - '@napi-rs/tar-freebsd-x64@0.1.1': - resolution: {integrity: sha512-P7V1zBjjC1dCrTwtUzuzYM4AeZduigeCtd8qQw2IUZowM5AsmhMd77oYuXjdU29cEpKUpyYjJRxjPCzFy+WbAQ==} - engines: {node: '>= 10'} - cpu: [x64] - os: [freebsd] - - '@napi-rs/tar-linux-arm-gnueabihf@0.1.1': - resolution: {integrity: sha512-qpC71ILPkWKt8k1iJCYt5gjwcOkd2VFSQIelTRr12t5CVNKV04rE/TMdwFoCP7kxbtb9Fl2cZzCRISw2BhMCmQ==} - engines: {node: '>= 10'} - cpu: [arm] - os: [linux] - - '@napi-rs/tar-linux-arm64-gnu@0.1.1': - resolution: {integrity: sha512-71QgxcFJCog6O4Tauoge8D0ILkDGJTRk3ru7zG8PUFG1QXJ1kkiRikdT77YmoVxtomc9FUOt+bdEdU5Yn+3QUQ==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/tar-linux-arm64-musl@0.1.1': - resolution: {integrity: sha512-R2e7YEILPKc447N1hUt1zQuyy0st83HX6nhmtFywS1aOj76/3hzxLVrebGiiS6kifyCrO82o66CNTYe7DixMZw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/tar-linux-x64-gnu@0.1.1': - resolution: {integrity: sha512-tmy9q2LXUB2GQ+IgUzJn3+us52leplMu96ORyFq1iHQEelGSqXt4xi5DzU07JhX3obJPqVqkybtcRS4enBfmBA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/tar-linux-x64-musl@0.1.1': - resolution: {integrity: sha512-j5ePbe6vihApl0cGPPDUVTWZbf2mF4NhxngAoG2jp7AeX3cWP2O4pjsvaOraW6QfvWEMFPeER7S0b6eBS7duvA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/tar-wasm32-wasi@0.1.1': - resolution: {integrity: sha512-se0+DlOiIRt7mcz7BeOJDoZtCrROpKLwiAOGmNgrjQ/SZS7TnOPuwm3wy9XN9WLoepttEjCEem6UP8yD5GJuQg==} - engines: {node: '>=14.0.0'} - cpu: [wasm32] - - '@napi-rs/tar-win32-arm64-msvc@0.1.1': - resolution: {integrity: sha512-FDZPi2wC7RwzvodogigLh/pJvhqCTVTUqOYuHlLkPSUbSAGiEkI55wk9RqH3y3EdJQaDuzyqC0QKz5ket2U+GA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [win32] - - '@napi-rs/tar-win32-ia32-msvc@0.1.1': - resolution: {integrity: sha512-OPR9Tou5z5M912G7Kc7gkf1ltinbOQx5dS/OeDIWHvPGOfdFDIxt0YVKhzSLRJi43+zIDp8/+cbeMD/cKXfX8w==} - engines: {node: '>= 10'} - cpu: [ia32] - os: [win32] - - '@napi-rs/tar-win32-x64-msvc@0.1.1': - resolution: {integrity: sha512-hiv5KfhrMSg8tTRC2oQXVckVg1h6ZVjwbd5aF9Esl0V3p2TaNFwwbqgnAN4Gm/PmSnHWNL/IRTHkk3cOzDWihQ==} - engines: {node: '>= 10'} - cpu: [x64] - os: [win32] - - '@napi-rs/tar@0.1.1': - resolution: {integrity: sha512-FOMhwwlvoYjHaDBxP26K3D92ltw1Y/CC4CIjgC6qXdzW4MYNwTlEyI58smCM3k+nCVJH3kpOYyH3sgbK4WZA4A==} - engines: {node: '>= 10'} - - '@napi-rs/wasm-runtime@0.2.4': - resolution: {integrity: sha512-9zESzOO5aDByvhIAsOy9TbpZ0Ur2AJbUI7UT73kcUTS2mxAMHOBaa1st/jAymNoCtvrit99kkzT1FZuXVcgfIQ==} - - '@napi-rs/wasm-tools-android-arm-eabi@0.0.2': - resolution: {integrity: sha512-/b+UU3suXjW4P0DzHRNdrnebQtFKcQf/YMeZJH+xUlKgvwli5kbmWjx8Wqqz0VETVkUTuPqJMBDIVLyc+14FGw==} - engines: {node: '>= 10'} - cpu: [arm] - os: [android] - - '@napi-rs/wasm-tools-android-arm64@0.0.2': - resolution: {integrity: sha512-j57GbDflwJdZtT8pZj5fOV4JAP+LdKN+wzsUYs+QRUoBqpWbbUANudolqfw63bkS9sD4z7fbCuz8iwtJqzxTVA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [android] - - '@napi-rs/wasm-tools-darwin-arm64@0.0.2': - resolution: {integrity: sha512-P2ChgWgVuv9GwmbxN89R84KzIImoTqXINteEixUvmkdnhyFiR+I8deNs89Yed+5w8QLC6MEfrtRqLP9YI+NoQA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [darwin] - - '@napi-rs/wasm-tools-darwin-x64@0.0.2': - resolution: {integrity: sha512-T/kQQ0gt8+wau1Z821PKVAD76QhmwVoLs2CT7Z9tTBs2pJvwSCP0C/kQiQAHcJIMi7A2E9Ab/Mez0BERy50EFA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [darwin] - - '@napi-rs/wasm-tools-freebsd-x64@0.0.2': - resolution: {integrity: sha512-GnnHu+r5sfzuxC/1J5UMF/h3BOZnHb3NQZ5hmbCfZYCKzpzRxrAJhzRunlbRN+v0x8M/49dztVTYR3s7K4ooAw==} - engines: {node: '>= 10'} - cpu: [x64] - os: [freebsd] - - '@napi-rs/wasm-tools-linux-arm64-gnu@0.0.2': - resolution: {integrity: sha512-KnZdLT0OnKb1CG2kdt3/WvM43vr9i+FEwXCvSOVC/6Tsifz7ynhMg7LAVESILd03HubzQJfg9nbRsk0bQ+IOwg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/wasm-tools-linux-arm64-musl@0.0.2': - resolution: {integrity: sha512-HkpZOID2U8P6pWqK3mqZ8bxU5xcuT3iA2fO+jrxn78h006iYgfNmdc5JaVhHnHazMmk32xKhSV4iV0VUh8UWDg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/wasm-tools-linux-x64-gnu@0.0.2': - resolution: {integrity: sha512-YksJWBCyOalB9ogtP9+/dZKP+vR6+h7BmzMXaXMT71WW/GvIsifMVgv+DY/FRSNJQupp5Y+ugjqVAOUOc/G65g==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/wasm-tools-linux-x64-musl@0.0.2': - resolution: {integrity: sha512-sPtRxPMdw05KdTcxgSPMmSXG2+PiK3vJ/l2+g9hvjnnKtvslJN2Hr7j8zgzuoKRAUFPaJVe6+D2xVh5cpdqhww==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/wasm-tools-wasm32-wasi@0.0.2': - resolution: {integrity: sha512-muRvZK7AIuo88G2AxYx3gA59rHMQgoN004saQkBvXnz3K/DVHKfTZ6TtUebss8zI3dURU6xExL8drxFWYxjEbQ==} - engines: {node: '>=14.0.0'} - cpu: [wasm32] - - '@napi-rs/wasm-tools-win32-arm64-msvc@0.0.2': - resolution: {integrity: sha512-Cn13WQ+tpFqdVwx0DIWKbsI9auFyzVZV4F5UNOUeDt6GgOL+NndgJul0Pc9bSU6fi03AylMPfF/nTCaDWO2Wgw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [win32] - - '@napi-rs/wasm-tools-win32-ia32-msvc@0.0.2': - resolution: {integrity: sha512-xsg5DkIQi82a8rcx6246Y3XC8TIqHamY+/C6sIlPLaZEuHctDkMECAw0AANwRf5vN//D2oo2oljOuoYtB1GOKw==} - engines: {node: '>= 10'} - cpu: [ia32] - os: [win32] - - '@napi-rs/wasm-tools-win32-x64-msvc@0.0.2': - resolution: {integrity: sha512-yHigltEt33eq8bappvKsIliz4MxfMPn1M+NWbIFRWN+IS1Z57mhmc1osuk+IRXrSlq0Tom0R6MYN1jpkZKz81Q==} - engines: {node: '>= 10'} - cpu: [x64] - os: [win32] - - '@napi-rs/wasm-tools@0.0.2': - resolution: {integrity: sha512-kBvDQCP5BLw2TxTENXLp3Of7vVEx0uyIye824JHE4dduzzOHVgSoOFVhVqAT3Fx/hLV445RVWfEqQbXMg4w/Mw==} - engines: {node: '>= 10'} - - '@nodelib/fs.scandir@2.1.5': - resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} - engines: {node: '>= 8'} - - '@nodelib/fs.stat@2.0.5': - resolution: {integrity: sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==} - engines: {node: '>= 8'} - - '@nodelib/fs.walk@1.2.8': - resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} - engines: {node: '>= 8'} - - '@octokit/auth-token@5.1.1': - resolution: {integrity: sha512-rh3G3wDO8J9wSjfI436JUKzHIxq8NaiL0tVeB2aXmG6p/9859aUOAjA9pmSPNGGZxfwmaJ9ozOJImuNVJdpvbA==} - engines: {node: '>= 18'} - - '@octokit/core@6.1.2': - resolution: {integrity: sha512-hEb7Ma4cGJGEUNOAVmyfdB/3WirWMg5hDuNFVejGEDFqupeOysLc2sG6HJxY2etBp5YQu5Wtxwi020jS9xlUwg==} - engines: {node: '>= 18'} - - '@octokit/endpoint@10.1.1': - resolution: {integrity: sha512-JYjh5rMOwXMJyUpj028cu0Gbp7qe/ihxfJMLc8VZBMMqSwLgOxDI1911gV4Enl1QSavAQNJcwmwBF9M0VvLh6Q==} - engines: {node: '>= 18'} - - '@octokit/graphql@8.1.1': - resolution: {integrity: sha512-ukiRmuHTi6ebQx/HFRCXKbDlOh/7xEV6QUXaE7MJEKGNAncGI/STSbOkl12qVXZrfZdpXctx5O9X1AIaebiDBg==} - engines: {node: '>= 18'} - - '@octokit/openapi-types@22.2.0': - resolution: {integrity: sha512-QBhVjcUa9W7Wwhm6DBFu6ZZ+1/t/oYxqc2tp81Pi41YNuJinbFRx8B133qVOrAaBbF7D/m0Et6f9/pZt9Rc+tg==} - - '@octokit/plugin-paginate-rest@11.3.3': - resolution: {integrity: sha512-o4WRoOJZlKqEEgj+i9CpcmnByvtzoUYC6I8PD2SA95M+BJ2x8h7oLcVOg9qcowWXBOdcTRsMZiwvM3EyLm9AfA==} - engines: {node: '>= 18'} - peerDependencies: - '@octokit/core': '>=6' - - '@octokit/plugin-request-log@5.3.0': - resolution: {integrity: sha512-FiGcyjdtYPlr03ExBk/0ysIlEFIFGJQAVoPPMxL19B24bVSEiZQnVGBunNtaAF1YnvE/EFoDpXmITtRnyCiypQ==} - engines: {node: '>= 18'} - peerDependencies: - '@octokit/core': '>=6' - - '@octokit/plugin-rest-endpoint-methods@13.2.4': - resolution: {integrity: sha512-gusyAVgTrPiuXOdfqOySMDztQHv6928PQ3E4dqVGEtOvRXAKRbJR4b1zQyniIT9waqaWk/UDaoJ2dyPr7Bk7Iw==} - engines: {node: '>= 18'} - peerDependencies: - '@octokit/core': '>=6' - - '@octokit/request-error@6.1.2': - resolution: {integrity: sha512-sA0oF7aL5wXbNfl+7zgLYJiFZctei9GaIMJlTraJrlQyFaoIYr4MCqPSakzxxGCfm8fET4vn0cQdRFmD7avlDg==} - engines: {node: '>= 18'} - - '@octokit/request@9.1.1': - resolution: {integrity: sha512-pyAguc0p+f+GbQho0uNetNQMmLG1e80WjkIaqqgUkihqUp0boRU6nKItXO4VWnr+nbZiLGEyy4TeKRwqaLvYgw==} - engines: {node: '>= 18'} - - '@octokit/rest@21.0.0': - resolution: {integrity: sha512-XudXXOmiIjivdjNZ+fN71NLrnDM00sxSZlhqmPR3v0dVoJwyP628tSlc12xqn8nX3N0965583RBw5GPo6r8u4Q==} - engines: {node: '>= 18'} - - '@octokit/types@13.5.0': - resolution: {integrity: sha512-HdqWTf5Z3qwDVlzCrP8UJquMwunpDiMPt5er+QjGzL4hqr/vBVY/MauQgS1xWxCDT1oMx1EULyqxncdCY/NVSQ==} - - '@rollup/pluginutils@4.2.1': - resolution: {integrity: sha512-iKnFXr7NkdZAIHiIWE+BX5ULi/ucVFYWD6TbAV+rZctiRTY2PL6tsIKhoIOaoskiWAkgu+VsbXgUVDNLHf+InQ==} - engines: {node: '>= 8.0.0'} - - '@sindresorhus/merge-streams@2.3.0': - resolution: {integrity: sha512-LtoMMhxAlorcGhmFYI+LhPgbPZCkgP6ra1YL604EeF6U98pLlQ3iWIGMdWSC+vWmPBWBNgmDBAhnAobLROJmwg==} - engines: {node: '>=18'} - - '@tybys/wasm-util@0.9.0': - resolution: {integrity: sha512-6+7nlbMVX/PVDCwaIQ8nTOPveOcFLSt8GcXdx8hD0bt39uWxYT88uXzqTd4fTvqta7oeUJqudepapKNt2DYJFw==} - - '@types/mute-stream@0.0.4': - resolution: {integrity: sha512-CPM9nzrCPPJHQNA9keH9CVkVI+WR5kMa+7XEs5jcGQ0VoAGnLv242w8lIVgwAEfmE4oufJRaTc9PNLQl0ioAow==} - - '@types/node@20.16.5': - resolution: {integrity: sha512-VwYCweNo3ERajwy0IUlqqcyZ8/A7Zwa9ZP3MnENWcB11AejO+tLy3pu850goUW2FC/IJMdZUfKpX/yxL1gymCA==} - - '@types/node@22.5.4': - resolution: {integrity: sha512-FDuKUJQm/ju9fT/SeX/6+gBzoPzlVCzfzmGkwKvRHQVxi4BntVbyIwf6a4Xn62mrvndLiml6z/UBXIdEVjQLXg==} - - '@types/stylis@4.2.6': - resolution: {integrity: sha512-4nebF2ZJGzQk0ka0O6+FZUWceyFv4vWq/0dXBMmrSeAwzOuOd/GxE5Pa64d/ndeNLG73dXoBsRzvtsVsYUv6Uw==} - - '@types/wrap-ansi@3.0.0': - resolution: {integrity: sha512-ltIpx+kM7g/MLRZfkbL7EsCEjfzCcScLpkg37eXEtx5kmrAKBkTJwd1GIAjDSL8wTpM6Hzn5YO4pSb91BEwu1g==} - - '@vercel/nft@0.26.5': - resolution: {integrity: sha512-NHxohEqad6Ra/r4lGknO52uc/GrWILXAMs1BB4401GTqww0fw1bAqzpG1XHuDO+dprg4GvsD9ZLLSsdo78p9hQ==} - engines: {node: '>=16'} - hasBin: true - - abbrev@1.1.1: - resolution: {integrity: sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==} - - acorn-import-attributes@1.9.5: - resolution: {integrity: sha512-n02Vykv5uA3eHGM/Z2dQrcD56kL8TyDb2p1+0P83PClMnC/nc+anbQRhIOWnSq4Ke/KvDPrY3C9hDtC/A3eHnQ==} - peerDependencies: - acorn: ^8 - - acorn-walk@8.3.3: - resolution: {integrity: sha512-MxXdReSRhGO7VlFe1bRG/oI7/mdLV9B9JJT0N8vZOhF7gFRR5l3M8W9G8JxmKV+JC5mGqJ0QvqfSOLsCPa4nUw==} - engines: {node: '>=0.4.0'} - - acorn@8.12.1: - resolution: {integrity: sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg==} - engines: {node: '>=0.4.0'} - hasBin: true - - agent-base@6.0.2: - resolution: {integrity: sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==} - engines: {node: '>= 6.0.0'} - - ansi-escapes@4.3.2: - resolution: {integrity: sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==} - engines: {node: '>=8'} - - ansi-regex@5.0.1: - resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} - engines: {node: '>=8'} - - ansi-regex@6.0.1: - resolution: {integrity: sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==} - engines: {node: '>=12'} - - ansi-styles@4.3.0: - resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} - engines: {node: '>=8'} - - ansi-styles@6.2.1: - resolution: {integrity: sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==} - engines: {node: '>=12'} - - aproba@2.0.0: - resolution: {integrity: sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==} - - are-we-there-yet@2.0.0: - resolution: {integrity: sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw==} - engines: {node: '>=10'} - deprecated: This package is no longer supported. - - argparse@1.0.10: - resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==} - - argparse@2.0.1: - resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} - - array-find-index@1.0.2: - resolution: {integrity: sha512-M1HQyIXcBGtVywBt8WVdim+lrNaK7VHp99Qt5pSNziXznKHViIBbXWtfRTpEFpF/c4FdfxNAsCCwPp5phBYJtw==} - engines: {node: '>=0.10.0'} - - arrgv@1.0.2: - resolution: {integrity: sha512-a4eg4yhp7mmruZDQFqVMlxNRFGi/i1r87pt8SDHy0/I8PqSXoUTlWZRdAZo0VXgvEARcujbtTk8kiZRi1uDGRw==} - engines: {node: '>=8.0.0'} - - arrify@3.0.0: - resolution: {integrity: sha512-tLkvA81vQG/XqE2mjDkGQHoOINtMHtysSnemrmoGe6PydDPMRbVugqyk4A6V/WDWEfm3l+0d8anA9r8cv/5Jaw==} - engines: {node: '>=12'} - - async-sema@3.1.1: - resolution: {integrity: sha512-tLRNUXati5MFePdAk8dw7Qt7DpxPB60ofAgn8WRhW6a2rcimZnYBP9oxHiv0OHy+Wz7kPMG+t4LGdt31+4EmGg==} - - asynckit@0.4.0: - resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} - - ava@6.1.3: - resolution: {integrity: sha512-tkKbpF1pIiC+q09wNU9OfyTDYZa8yuWvU2up3+lFJ3lr1RmnYh2GBpPwzYUEB0wvTPIUysGjcZLNZr7STDviRA==} - engines: {node: ^18.18 || ^20.8 || ^21 || ^22} - hasBin: true - peerDependencies: - '@ava/typescript': '*' - peerDependenciesMeta: - '@ava/typescript': - optional: true - - axios@1.6.2: - resolution: {integrity: sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A==} - - balanced-match@1.0.2: - resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} - - before-after-hook@3.0.2: - resolution: {integrity: sha512-Nik3Sc0ncrMK4UUdXQmAnRtzmNQTAAXmXIopizwZ1W1t8QmfJj+zL4OA2I7XPTPW5z5TDqv4hRo/JzouDJnX3A==} - - bindings@1.5.0: - resolution: {integrity: sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==} - - blueimp-md5@2.19.0: - resolution: {integrity: sha512-DRQrD6gJyy8FbiE4s+bDoXS9hiW3Vbx5uCdwvcCf3zLHL+Iv7LtGHLpr+GZV8rHG8tK766FGYBwRbu8pELTt+w==} - - brace-expansion@1.1.11: - resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} - - braces@3.0.3: - resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==} - engines: {node: '>=8'} - - callsites@4.2.0: - resolution: {integrity: sha512-kfzR4zzQtAE9PC7CzZsjl3aBNbXWuXiSeOCdLcPpBfGW8YuCqQHcRPFDbr/BPVmd3EEPVpuFzLyuT/cUhPr4OQ==} - engines: {node: '>=12.20'} - - camelize@1.0.1: - resolution: {integrity: sha512-dU+Tx2fsypxTgtLoE36npi3UqcjSSMNYfkqgmoEhtZrraP5VWq0K7FkWVTYa8eMPtnU/G2txVsfdCJTn9uzpuQ==} - - cbor@9.0.2: - resolution: {integrity: sha512-JPypkxsB10s9QOWwa6zwPzqE1Md3vqpPc+cai4sAecuCsRyAtAl/pMyhPlMbT/xtPnm2dznJZYRLui57qiRhaQ==} - engines: {node: '>=16'} - - chalk@5.3.0: - resolution: {integrity: sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==} - engines: {node: ^12.17.0 || ^14.13 || >=16.0.0} - - chardet@0.7.0: - resolution: {integrity: sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==} - - chownr@2.0.0: - resolution: {integrity: sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==} - engines: {node: '>=10'} - - chunkd@2.0.1: - resolution: {integrity: sha512-7d58XsFmOq0j6el67Ug9mHf9ELUXsQXYJBkyxhH/k+6Ke0qXRnv0kbemx+Twc6fRJ07C49lcbdgm9FL1Ei/6SQ==} - - ci-info@4.0.0: - resolution: {integrity: sha512-TdHqgGf9odd8SXNuxtUBVx8Nv+qZOejE6qyqiy5NtbYYQOeFa6zmHkxlPzmaLxWWHsU6nJmB7AETdVPi+2NBUg==} - engines: {node: '>=8'} - - ci-parallel-vars@1.0.1: - resolution: {integrity: sha512-uvzpYrpmidaoxvIQHM+rKSrigjOe9feHYbw4uOI2gdfe1C3xIlxO+kVXq83WQWNniTf8bAxVpy+cQeFQsMERKg==} - - cli-spinners@2.9.2: - resolution: {integrity: sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==} - engines: {node: '>=6'} - - cli-truncate@4.0.0: - resolution: {integrity: sha512-nPdaFdQ0h/GEigbPClz11D0v/ZJEwxmeVZGeMo3Z5StPtUTkA9o1lD6QwoirYiSDzbcwn2XcjwmCp68W1IS4TA==} - engines: {node: '>=18'} - - cli-width@4.1.0: - resolution: {integrity: sha512-ouuZd4/dm2Sw5Gmqy6bGyNNNe1qt9RpmxveLSO7KcgsTnU7RXfsw+/bukWGo1abgBiMAic068rclZsO4IWmmxQ==} - engines: {node: '>= 12'} - - clipanion@3.2.1: - resolution: {integrity: sha512-dYFdjLb7y1ajfxQopN05mylEpK9ZX0sO1/RfMXdfmwjlIsPkbh4p7A682x++zFPLDCo1x3p82dtljHf5cW2LKA==} - peerDependencies: - typanion: '*' - - cliui@8.0.1: - resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==} - engines: {node: '>=12'} - - code-excerpt@4.0.0: - resolution: {integrity: sha512-xxodCmBen3iy2i0WtAK8FlFNrRzjUqjRsMfho58xT/wvZU1YTM3fCnRjcy1gJPMepaRlgm/0e6w8SpWHpn3/cA==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - color-convert@2.0.1: - resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} - engines: {node: '>=7.0.0'} - - color-name@1.1.4: - resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} - - color-support@1.1.3: - resolution: {integrity: sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==} - hasBin: true - - colorette@2.0.20: - resolution: {integrity: sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==} - - combined-stream@1.0.8: - resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} - engines: {node: '>= 0.8'} - - common-path-prefix@3.0.0: - resolution: {integrity: sha512-QE33hToZseCH3jS0qN96O/bSh3kaw/h+Tq7ngyY9eWDUnTlTNUyqfqvCXioLe5Na5jFsL78ra/wuBU4iuEgd4w==} - - concat-map@0.0.1: - resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} - - concordance@5.0.4: - resolution: {integrity: sha512-OAcsnTEYu1ARJqWVGwf4zh4JDfHZEaSNlNccFmt8YjB2l/n19/PF2viLINHc57vO4FKIAFl2FWASIGZZWZ2Kxw==} - engines: {node: '>=10.18.0 <11 || >=12.14.0 <13 || >=14'} - - console-control-strings@1.1.0: - resolution: {integrity: sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==} - - convert-to-spaces@2.0.1: - resolution: {integrity: sha512-rcQ1bsQO9799wq24uE5AM2tAILy4gXGIK/njFWcVQkGNZ96edlpY+A7bjwvzjYvLDyzmG1MmMLZhpcsb+klNMQ==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - css-color-keywords@1.0.0: - resolution: {integrity: sha512-FyyrDHZKEjXDpNJYvVsV960FiqQyXc/LlYmsxl2BcdMb2WPx0OGRVgTg55rPSyLSNMqP52R9r8geSp7apN3Ofg==} - engines: {node: '>=4'} - - css-to-react-native@3.2.0: - resolution: {integrity: sha512-e8RKaLXMOFii+02mOlqwjbD00KSEKqblnpO9e++1aXS1fPQOpS1YoqdVHBqPjHNoxeF2mimzVqawm2KCbEdtHQ==} - - csstype@3.1.3: - resolution: {integrity: sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==} - - currently-unhandled@0.4.1: - resolution: {integrity: sha512-/fITjgjGU50vjQ4FH6eUoYu+iUoUKIXws2hL15JJpIR+BbTxaXQsMuuyjtNh2WqsSBS5nsaZHFsFecyw5CCAng==} - engines: {node: '>=0.10.0'} - - date-time@3.1.0: - resolution: {integrity: sha512-uqCUKXE5q1PNBXjPqvwhwJf9SwMoAHBgWJ6DcrnS5o+W2JOiIILl0JEdVD8SGujrNS02GGxgwAg2PN2zONgtjg==} - engines: {node: '>=6'} - - debug@4.3.5: - resolution: {integrity: sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg==} - engines: {node: '>=6.0'} - peerDependencies: - supports-color: '*' - peerDependenciesMeta: - supports-color: - optional: true - - delayed-stream@1.0.0: - resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} - engines: {node: '>=0.4.0'} - - delegates@1.0.0: - resolution: {integrity: sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==} - - detect-libc@2.0.3: - resolution: {integrity: sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw==} - engines: {node: '>=8'} - - emittery@1.0.3: - resolution: {integrity: sha512-tJdCJitoy2lrC2ldJcqN4vkqJ00lT+tOWNT1hBJjO/3FDMJa5TTIiYGCKGkn/WfCyOzUMObeohbVTj00fhiLiA==} - engines: {node: '>=14.16'} - - emnapi@1.2.0: - resolution: {integrity: sha512-rcq+dJCcfr08I0XM/57LPRqaUokGfni/+SvhO7NaJthTTjRdohhIy0FQwyC5rR1enAsjkldQg83th8J5hURv0Q==} - peerDependencies: - node-addon-api: '>= 6.1.0' - peerDependenciesMeta: - node-addon-api: - optional: true - - emoji-regex@10.3.0: - resolution: {integrity: sha512-QpLs9D9v9kArv4lfDEgg1X/gN5XLnf/A6l9cs8SPZLRZR3ZkY9+kwIQTxm+fsSej5UMYGE8fdoaZVIBlqG0XTw==} - - emoji-regex@8.0.0: - resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} - - escalade@3.1.2: - resolution: {integrity: sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==} - engines: {node: '>=6'} - - escape-string-regexp@2.0.0: - resolution: {integrity: sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==} - engines: {node: '>=8'} - - escape-string-regexp@5.0.0: - resolution: {integrity: sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==} - engines: {node: '>=12'} - - esprima@4.0.1: - resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==} - engines: {node: '>=4'} - hasBin: true - - estree-walker@2.0.2: - resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==} - - esutils@2.0.3: - resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} - engines: {node: '>=0.10.0'} - - external-editor@3.1.0: - resolution: {integrity: sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==} - engines: {node: '>=4'} - - fast-diff@1.3.0: - resolution: {integrity: sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==} - - fast-glob@3.3.2: - resolution: {integrity: sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==} - engines: {node: '>=8.6.0'} - - fastq@1.17.1: - resolution: {integrity: sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==} - - figures@6.1.0: - resolution: {integrity: sha512-d+l3qxjSesT4V7v2fh+QnmFnUWv9lSpjarhShNTgBOfA0ttejbQUAlHLitbjkoRiDulW0OPoQPYIGhIC8ohejg==} - engines: {node: '>=18'} - - file-uri-to-path@1.0.0: - resolution: {integrity: sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==} - - fill-range@7.1.1: - resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==} - engines: {node: '>=8'} - - find-up-simple@1.0.0: - resolution: {integrity: sha512-q7Us7kcjj2VMePAa02hDAF6d+MzsdsAWEwYyOpwUtlerRBkOEPBCRZrAV4XfcSN8fHAgaD0hP7miwoay6DCprw==} - engines: {node: '>=18'} - - follow-redirects@1.15.6: - resolution: {integrity: sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==} - engines: {node: '>=4.0'} - peerDependencies: - debug: '*' - peerDependenciesMeta: - debug: - optional: true - - form-data@4.0.0: - resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==} - engines: {node: '>= 6'} - - fs-minipass@2.1.0: - resolution: {integrity: sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==} - engines: {node: '>= 8'} - - fs.realpath@1.0.0: - resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} - - gauge@3.0.2: - resolution: {integrity: sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q==} - engines: {node: '>=10'} - deprecated: This package is no longer supported. - - get-caller-file@2.0.5: - resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} - engines: {node: 6.* || 8.* || >= 10.*} - - get-east-asian-width@1.2.0: - resolution: {integrity: sha512-2nk+7SIVb14QrgXFHcm84tD4bKQz0RxPuMT8Ag5KPOq7J5fEmAg0UbXdTOSHqNuHSU28k55qnceesxXRZGzKWA==} - engines: {node: '>=18'} - - glob-parent@5.1.2: - resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} - engines: {node: '>= 6'} - - glob@7.2.3: - resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} - deprecated: Glob versions prior to v9 are no longer supported - - globby@14.0.2: - resolution: {integrity: sha512-s3Fq41ZVh7vbbe2PN3nrW7yC7U7MFVc5c98/iTl9c2GawNMKx/J648KQRW6WKkuU8GIbbh2IXfIRQjOZnXcTnw==} - engines: {node: '>=18'} - - graceful-fs@4.2.11: - resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} - - has-unicode@2.0.1: - resolution: {integrity: sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==} - - https-proxy-agent@5.0.1: - resolution: {integrity: sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==} - engines: {node: '>= 6'} - - iconv-lite@0.4.24: - resolution: {integrity: sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==} - engines: {node: '>=0.10.0'} - - ignore-by-default@2.1.0: - resolution: {integrity: sha512-yiWd4GVmJp0Q6ghmM2B/V3oZGRmjrKLXvHR3TE1nfoXsmoggllfZUQe74EN0fJdPFZu2NIvNdrMMLm3OsV7Ohw==} - engines: {node: '>=10 <11 || >=12 <13 || >=14'} - - ignore@5.3.1: - resolution: {integrity: sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==} - engines: {node: '>= 4'} - - imurmurhash@0.1.4: - resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} - engines: {node: '>=0.8.19'} - - indent-string@5.0.0: - resolution: {integrity: sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==} - engines: {node: '>=12'} - - inflight@1.0.6: - resolution: {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. - - inherits@2.0.4: - resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} - - inquirer@10.0.1: - resolution: {integrity: sha512-XgthhRIn0Ci9JdGJpUo2EtpPfaczbooZbGTN+FTzSCyUb7YHJcPPnuSXfeG5903bJMy3OyEoVTQMnvO4Ly5tFg==} - engines: {node: '>=18'} - - ipaddr.js@2.2.0: - resolution: {integrity: sha512-Ag3wB2o37wslZS19hZqorUnrnzSkpOVy+IiiDEiTqNubEYpYuHWIf6K4psgN2ZWKExS4xhVCrRVfb/wfW8fWJA==} - engines: {node: '>= 10'} - - irregular-plurals@3.5.0: - resolution: {integrity: sha512-1ANGLZ+Nkv1ptFb2pa8oG8Lem4krflKuX/gINiHJHjJUKaJHk/SXk5x6K3J+39/p0h1RQ2saROclJJ+QLvETCQ==} - engines: {node: '>=8'} - - is-extglob@2.1.1: - resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} - engines: {node: '>=0.10.0'} - - is-fullwidth-code-point@3.0.0: - resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} - engines: {node: '>=8'} - - is-fullwidth-code-point@4.0.0: - resolution: {integrity: sha512-O4L094N2/dZ7xqVdrXhh9r1KODPJpFms8B5sGdJLPy664AgvXsreZUyCQQNItZRDlYug4xStLjNp/sz3HvBowQ==} - engines: {node: '>=12'} - - is-glob@4.0.3: - resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} - engines: {node: '>=0.10.0'} - - is-number@7.0.0: - resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} - engines: {node: '>=0.12.0'} - - is-plain-object@5.0.0: - resolution: {integrity: sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==} - engines: {node: '>=0.10.0'} - - is-promise@4.0.0: - resolution: {integrity: sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==} - - is-unicode-supported@2.0.0: - resolution: {integrity: sha512-FRdAyx5lusK1iHG0TWpVtk9+1i+GjrzRffhDg4ovQ7mcidMQ6mj+MhKPmvh7Xwyv5gIS06ns49CA7Sqg7lC22Q==} - engines: {node: '>=18'} - - js-string-escape@1.0.1: - resolution: {integrity: sha512-Smw4xcfIQ5LVjAOuJCvN/zIodzA/BBSsluuoSykP+lUvScIi4U6RJLfwHet5cxFnCswUjISV8oAXaqaJDY3chg==} - engines: {node: '>= 0.8'} - - js-tokens@4.0.0: - resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} - - js-yaml@3.14.1: - resolution: {integrity: sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==} - hasBin: true - - js-yaml@4.1.0: - resolution: {integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==} - hasBin: true - - load-json-file@7.0.1: - resolution: {integrity: sha512-Gnxj3ev3mB5TkVBGad0JM6dmLiQL+o0t23JPBZ9sd+yvSLk05mFoqKBw5N8gbbkU4TNXyqCgIrl/VM17OgUIgQ==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - lodash-es@4.17.21: - resolution: {integrity: sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==} - - lodash@4.17.21: - resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} - - loose-envify@1.4.0: - resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==} - hasBin: true - - make-dir@3.1.0: - resolution: {integrity: sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==} - engines: {node: '>=8'} - - matcher@5.0.0: - resolution: {integrity: sha512-s2EMBOWtXFc8dgqvoAzKJXxNHibcdJMV0gwqKUaw9E2JBJuGUK7DrNKrA6g/i+v72TT16+6sVm5mS3thaMLQUw==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - md5-hex@3.0.1: - resolution: {integrity: sha512-BUiRtTtV39LIJwinWBjqVsU9xhdnz7/i889V859IBFpuqGAj6LuOvHv5XLbgZ2R7ptJoJaEcxkv88/h25T7Ciw==} - engines: {node: '>=8'} - - memoize@10.0.0: - resolution: {integrity: sha512-H6cBLgsi6vMWOcCpvVCdFFnl3kerEXbrYh9q+lY6VXvQSmM6CkmV08VOwT+WE2tzIEqRPFfAq3fm4v/UIW6mSA==} - engines: {node: '>=18'} - - merge2@1.4.1: - resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} - engines: {node: '>= 8'} - - micromatch@4.0.7: - resolution: {integrity: sha512-LPP/3KorzCwBxfeUuZmaR6bG2kdeHSbe0P2tY3FLRU4vYrjYz5hI4QZwV0njUx3jeuKe67YukQ1LSPZBKDqO/Q==} - engines: {node: '>=8.6'} - - mime-db@1.52.0: - resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} - engines: {node: '>= 0.6'} - - mime-types@2.1.35: - resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} - engines: {node: '>= 0.6'} - - mimic-function@5.0.1: - resolution: {integrity: sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==} - engines: {node: '>=18'} - - minimatch@3.1.2: - resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} - - minipass@3.3.6: - resolution: {integrity: sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==} - engines: {node: '>=8'} - - minipass@5.0.0: - resolution: {integrity: sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==} - engines: {node: '>=8'} - - minizlib@2.1.2: - resolution: {integrity: sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==} - engines: {node: '>= 8'} - - mkdirp@1.0.4: - resolution: {integrity: sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==} - engines: {node: '>=10'} - hasBin: true - - ms@2.1.2: - resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} - - ms@2.1.3: - resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} - - mute-stream@1.0.0: - resolution: {integrity: sha512-avsJQhyd+680gKXyG/sQc0nXaC6rBkPOfyHYcFb9+hdkqQkR9bdnkJ0AMZhke0oesPqIO+mFFJ+IdBc7mst4IA==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - - nanoid@3.3.7: - resolution: {integrity: sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==} - engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} - hasBin: true - - node-fetch@2.7.0: - resolution: {integrity: sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==} - engines: {node: 4.x || >=6.0.0} - peerDependencies: - encoding: ^0.1.0 - peerDependenciesMeta: - encoding: - optional: true - - node-gyp-build@4.8.1: - resolution: {integrity: sha512-OSs33Z9yWr148JZcbZd5WiAXhh/n9z8TxQcdMhIOlpN9AhWpLfvVFO73+m77bBABQMaY9XSvIa+qk0jlI7Gcaw==} - hasBin: true - - nofilter@3.1.0: - resolution: {integrity: sha512-l2NNj07e9afPnhAhvgVrCD/oy2Ai1yfLpuo3EpiO1jFTsB4sFz6oIfAfSZyQzVpkZQ9xS8ZS5g1jCBgq4Hwo0g==} - engines: {node: '>=12.19'} - - nopt@5.0.0: - resolution: {integrity: sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==} - engines: {node: '>=6'} - hasBin: true - - npmlog@5.0.1: - resolution: {integrity: sha512-AqZtDUWOMKs1G/8lwylVjrdYgqA4d9nu8hc+0gzRxlDb1I10+FHBGMXs6aiQHFdCUUlqH99MUMuLfzWDNDtfxw==} - deprecated: This package is no longer supported. - - object-assign@4.1.1: - resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} - engines: {node: '>=0.10.0'} - - once@1.4.0: - resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} - - os-tmpdir@1.0.2: - resolution: {integrity: sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==} - engines: {node: '>=0.10.0'} - - p-map@7.0.2: - resolution: {integrity: sha512-z4cYYMMdKHzw4O5UkWJImbZynVIo0lSGTXc7bzB1e/rrDqkgGUNysK/o4bTr+0+xKvvLoTyGqYC4Fgljy9qe1Q==} - engines: {node: '>=18'} - - package-config@5.0.0: - resolution: {integrity: sha512-GYTTew2slBcYdvRHqjhwaaydVMvn/qrGC323+nKclYioNSLTDUM/lGgtGTgyHVtYcozb+XkE8CNhwcraOmZ9Mg==} - engines: {node: '>=18'} - - parse-ms@4.0.0: - resolution: {integrity: sha512-TXfryirbmq34y8QBwgqCVLi+8oA3oWx2eAnSn62ITyEhEYaWRlVZ2DvMM9eZbMs/RfxPu/PK/aBLyGj4IrqMHw==} - engines: {node: '>=18'} - - path-is-absolute@1.0.1: - resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==} - engines: {node: '>=0.10.0'} - - path-type@5.0.0: - resolution: {integrity: sha512-5HviZNaZcfqP95rwpv+1HDgUamezbqdSYTyzjTvwtJSnIH+3vnbmWsItli8OFEndS984VT55M3jduxZbX351gg==} - engines: {node: '>=12'} - - picocolors@1.0.1: - resolution: {integrity: sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==} - - picomatch@2.3.1: - resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} - engines: {node: '>=8.6'} - - picomatch@3.0.1: - resolution: {integrity: sha512-I3EurrIQMlRc9IaAZnqRR044Phh2DXY+55o7uJ0V+hYZAcQYSuFWsc9q5PvyDHUSCe1Qxn/iBz+78s86zWnGag==} - engines: {node: '>=10'} - - plur@5.1.0: - resolution: {integrity: sha512-VP/72JeXqak2KiOzjgKtQen5y3IZHn+9GOuLDafPv0eXa47xq0At93XahYBs26MsifCQ4enGKwbjBTKgb9QJXg==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - postcss-value-parser@4.2.0: - resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==} - - postcss@8.4.33: - resolution: {integrity: sha512-Kkpbhhdjw2qQs2O2DGX+8m5OVqEcbB9HRBvuYM9pgrjEFUg30A9LmXNlTAUj4S9kgtGyrMbTzVjH7E+s5Re2yg==} - engines: {node: ^10 || ^12 || >=14} - - pretty-ms@9.0.0: - resolution: {integrity: sha512-E9e9HJ9R9NasGOgPaPE8VMeiPKAyWR5jcFpNnwIejslIhWqdqOrb2wShBsncMPUb+BcCd2OPYfh7p2W6oemTng==} - engines: {node: '>=18'} - - proxy-from-env@1.1.0: - resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==} - - queue-microtask@1.2.3: - resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} - - react-dom@18.3.1: - resolution: {integrity: sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==} - peerDependencies: - react: ^18.3.1 - - react@18.3.1: - resolution: {integrity: sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==} - engines: {node: '>=0.10.0'} - - readable-stream@3.6.2: - resolution: {integrity: sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==} - engines: {node: '>= 6'} - - require-directory@2.1.1: - resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} - engines: {node: '>=0.10.0'} - - resolve-cwd@3.0.0: - resolution: {integrity: sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==} - engines: {node: '>=8'} - - resolve-from@5.0.0: - resolution: {integrity: sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==} - engines: {node: '>=8'} - - reusify@1.0.4: - resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==} - engines: {iojs: '>=1.0.0', node: '>=0.10.0'} - - rimraf@3.0.2: - resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==} - deprecated: Rimraf versions prior to v4 are no longer supported - hasBin: true - - run-async@3.0.0: - resolution: {integrity: sha512-540WwVDOMxA6dN6We19EcT9sc3hkXPw5mzRNGM3FkdN/vtE9NFvj5lFAPNwUDmJjXidm3v7TC1cTE7t17Ulm1Q==} - engines: {node: '>=0.12.0'} - - run-parallel@1.2.0: - resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} - - rxjs@7.8.1: - resolution: {integrity: sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==} - - safe-buffer@5.2.1: - resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} - - safer-buffer@2.1.2: - resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} - - scheduler@0.23.2: - resolution: {integrity: sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ==} - - semver@6.3.1: - resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} - hasBin: true - - semver@7.6.2: - resolution: {integrity: sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==} - engines: {node: '>=10'} - hasBin: true - - serialize-error@7.0.1: - resolution: {integrity: sha512-8I8TjW5KMOKsZQTvoxjuSIa7foAwPWGOts+6o7sgjz41/qMD9VQHEDxi6PBvK2l0MXUmqZyNpUK+T2tQaaElvw==} - engines: {node: '>=10'} - - set-blocking@2.0.0: - resolution: {integrity: sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==} - - shallowequal@1.1.0: - resolution: {integrity: sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ==} - - signal-exit@3.0.7: - resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} - - signal-exit@4.1.0: - resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} - engines: {node: '>=14'} - - slash@5.1.0: - resolution: {integrity: sha512-ZA6oR3T/pEyuqwMgAKT0/hAv8oAXckzbkmR0UkUosQ+Mc4RxGoJkRmwHgHufaenlyAgE1Mxgpdcrf75y6XcnDg==} - engines: {node: '>=14.16'} - - slice-ansi@5.0.0: - resolution: {integrity: sha512-FC+lgizVPfie0kkhqUScwRu1O/lF6NOgJmlCgK+/LYxDCTk8sGelYaHDhFcDN+Sn3Cv+3VSa4Byeo+IMCzpMgQ==} - engines: {node: '>=12'} - - source-map-js@1.2.0: - resolution: {integrity: sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==} - engines: {node: '>=0.10.0'} - - sprintf-js@1.0.3: - resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==} - - stack-utils@2.0.6: - resolution: {integrity: sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==} - engines: {node: '>=10'} - - string-width@4.2.3: - resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} - engines: {node: '>=8'} - - string-width@7.2.0: - resolution: {integrity: sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==} - engines: {node: '>=18'} - - string_decoder@1.3.0: - resolution: {integrity: sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==} - - strip-ansi@6.0.1: - resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} - engines: {node: '>=8'} - - strip-ansi@7.1.0: - resolution: {integrity: sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==} - engines: {node: '>=12'} - - styled-components@6.1.1: - resolution: {integrity: sha512-cpZZP5RrKRIClBW5Eby4JM1wElLVP4NQrJbJ0h10TidTyJf4SIIwa3zLXOoPb4gJi8MsJ8mjq5mu2IrEhZIAcQ==} - engines: {node: '>= 16'} - peerDependencies: - react: '>= 16.8.0' - react-dom: '>= 16.8.0' - - stylis@4.3.2: - resolution: {integrity: sha512-bhtUjWd/z6ltJiQwg0dUfxEJ+W+jdqQd8TbWLWyeIJHlnsqmGLRFFd8e5mA0AZi/zx90smXRlN66YMTcaSFifg==} - - supertap@3.0.1: - resolution: {integrity: sha512-u1ZpIBCawJnO+0QePsEiOknOfCRq0yERxiAchT0i4li0WHNUJbf0evXXSXOcCAR4M8iMDoajXYmstm/qO81Isw==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - tar@6.2.1: - resolution: {integrity: sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==} - engines: {node: '>=10'} - - temp-dir@3.0.0: - resolution: {integrity: sha512-nHc6S/bwIilKHNRgK/3jlhDoIHcp45YgyiwcAk46Tr0LfEqGBVpmiAyuiuxeVE44m3mXnEeVhaipLOEWmH+Njw==} - engines: {node: '>=14.16'} - - time-zone@1.0.0: - resolution: {integrity: sha512-TIsDdtKo6+XrPtiTm1ssmMngN1sAhyKnTO2kunQWqNPWIVvCm15Wmw4SWInwTVgJ5u/Tr04+8Ei9TNcw4x4ONA==} - engines: {node: '>=4'} - - tmp@0.0.33: - resolution: {integrity: sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==} - engines: {node: '>=0.6.0'} - - to-regex-range@5.0.1: - resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} - engines: {node: '>=8.0'} - - toml@3.0.0: - resolution: {integrity: sha512-y/mWCZinnvxjTKYhJ+pYxwD0mRLVvOtdS2Awbgxln6iEnt4rk0yBxeSBHkGJcPucRiG0e55mwWp+g/05rsrd6w==} - - tr46@0.0.3: - resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==} - - tslib@2.6.3: - resolution: {integrity: sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ==} - - typanion@3.14.0: - resolution: {integrity: sha512-ZW/lVMRabETuYCd9O9ZvMhAh8GslSqaUjxmK/JLPCh6l73CvLBiuXswj/+7LdnWOgYsQ130FqLzFz5aGT4I3Ug==} - - type-fest@0.13.1: - resolution: {integrity: sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==} - engines: {node: '>=10'} - - type-fest@0.21.3: - resolution: {integrity: sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==} - engines: {node: '>=10'} - - typescript@5.5.4: - resolution: {integrity: sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q==} - engines: {node: '>=14.17'} - hasBin: true - - undici-types@6.19.8: - resolution: {integrity: sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==} - - unicorn-magic@0.1.0: - resolution: {integrity: sha512-lRfVq8fE8gz6QMBuDM6a+LO3IAzTi05H6gCVaUpir2E1Rwpo4ZUog45KpNXKC/Mn3Yb9UDuHumeFTo9iV/D9FQ==} - engines: {node: '>=18'} - - universal-user-agent@7.0.2: - resolution: {integrity: sha512-0JCqzSKnStlRRQfCdowvqy3cy0Dvtlb8xecj/H8JFZuCze4rwjPZQOgvFvn0Ws/usCHQFGpyr+pB9adaGwXn4Q==} - - util-deprecate@1.0.2: - resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} - - wasm-sjlj@1.0.5: - resolution: {integrity: sha512-Z/MHJeOkAvJJVWnGX3/YZGYldGaawZbYHX4ldYG9kLhcdB8H31F5x66M7Zc4BP/7pg0aLsusQj1629m2B3Rilg==} - - webidl-conversions@3.0.1: - resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==} - - well-known-symbols@2.0.0: - resolution: {integrity: sha512-ZMjC3ho+KXo0BfJb7JgtQ5IBuvnShdlACNkKkdsqBmYw3bPAaJfPeYUo6tLUaT5tG/Gkh7xkpBhKRQ9e7pyg9Q==} - engines: {node: '>=6'} - - whatwg-url@5.0.0: - resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==} - - wide-align@1.1.5: - resolution: {integrity: sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==} - - wrap-ansi@6.2.0: - resolution: {integrity: sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==} - engines: {node: '>=8'} - - wrap-ansi@7.0.0: - resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==} - engines: {node: '>=10'} - - wrappy@1.0.2: - resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} - - write-file-atomic@5.0.1: - resolution: {integrity: sha512-+QU2zd6OTD8XWIJCbffaiQeH9U73qIqafo1x6V1snCWYGJf6cVE0cDR4D8xRzcEnfI21IFrUPzPGtcPf8AC+Rw==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - - y18n@5.0.8: - resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==} - engines: {node: '>=10'} - - yallist@4.0.0: - resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==} - - yargs-parser@21.1.1: - resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} - engines: {node: '>=12'} - - yargs@17.7.2: - resolution: {integrity: sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==} - engines: {node: '>=12'} - - yoctocolors-cjs@2.1.2: - resolution: {integrity: sha512-cYVsTjKl8b+FrnidjibDWskAv7UKOfcwaVZdp/it9n1s9fU3IkgDbhdIRKCW4JDsAlECJY0ytoVPT3sK6kideA==} - engines: {node: '>=18'} - -snapshots: - - '@emnapi/core@1.2.0': - dependencies: - '@emnapi/wasi-threads': 1.0.1 - tslib: 2.6.3 - - '@emnapi/runtime@1.2.0': - dependencies: - tslib: 2.6.3 - - '@emnapi/wasi-threads@1.0.1': - dependencies: - tslib: 2.6.3 - - '@emotion/is-prop-valid@1.2.2': - dependencies: - '@emotion/memoize': 0.8.1 - - '@emotion/memoize@0.8.1': {} - - '@emotion/unitless@0.8.1': {} - - '@inquirer/checkbox@2.3.10': - dependencies: - '@inquirer/core': 9.0.2 - '@inquirer/figures': 1.0.3 - '@inquirer/type': 1.4.0 - ansi-escapes: 4.3.2 - yoctocolors-cjs: 2.1.2 - - '@inquirer/confirm@3.1.14': - dependencies: - '@inquirer/core': 9.0.2 - '@inquirer/type': 1.4.0 - - '@inquirer/core@9.0.2': - dependencies: - '@inquirer/figures': 1.0.3 - '@inquirer/type': 1.4.0 - '@types/mute-stream': 0.0.4 - '@types/node': 20.16.5 - '@types/wrap-ansi': 3.0.0 - ansi-escapes: 4.3.2 - cli-spinners: 2.9.2 - cli-width: 4.1.0 - mute-stream: 1.0.0 - signal-exit: 4.1.0 - strip-ansi: 6.0.1 - wrap-ansi: 6.2.0 - yoctocolors-cjs: 2.1.2 - - '@inquirer/editor@2.1.14': - dependencies: - '@inquirer/core': 9.0.2 - '@inquirer/type': 1.4.0 - external-editor: 3.1.0 - - '@inquirer/expand@2.1.14': - dependencies: - '@inquirer/core': 9.0.2 - '@inquirer/type': 1.4.0 - yoctocolors-cjs: 2.1.2 - - '@inquirer/figures@1.0.3': {} - - '@inquirer/input@2.2.1': - dependencies: - '@inquirer/core': 9.0.2 - '@inquirer/type': 1.4.0 - - '@inquirer/number@1.0.2': - dependencies: - '@inquirer/core': 9.0.2 - '@inquirer/type': 1.4.0 - - '@inquirer/password@2.1.14': - dependencies: - '@inquirer/core': 9.0.2 - '@inquirer/type': 1.4.0 - ansi-escapes: 4.3.2 - - '@inquirer/prompts@5.1.2': - dependencies: - '@inquirer/checkbox': 2.3.10 - '@inquirer/confirm': 3.1.14 - '@inquirer/editor': 2.1.14 - '@inquirer/expand': 2.1.14 - '@inquirer/input': 2.2.1 - '@inquirer/number': 1.0.2 - '@inquirer/password': 2.1.14 - '@inquirer/rawlist': 2.1.14 - '@inquirer/select': 2.3.10 - - '@inquirer/rawlist@2.1.14': - dependencies: - '@inquirer/core': 9.0.2 - '@inquirer/type': 1.4.0 - yoctocolors-cjs: 2.1.2 - - '@inquirer/select@2.3.10': - dependencies: - '@inquirer/core': 9.0.2 - '@inquirer/figures': 1.0.3 - '@inquirer/type': 1.4.0 - ansi-escapes: 4.3.2 - yoctocolors-cjs: 2.1.2 - - '@inquirer/type@1.4.0': - dependencies: - mute-stream: 1.0.0 - - '@mapbox/node-pre-gyp@1.0.11': - dependencies: - detect-libc: 2.0.3 - https-proxy-agent: 5.0.1 - make-dir: 3.1.0 - node-fetch: 2.7.0 - nopt: 5.0.0 - npmlog: 5.0.1 - rimraf: 3.0.2 - semver: 7.6.2 - tar: 6.2.1 - transitivePeerDependencies: - - encoding - - supports-color - - '@napi-rs/cli@3.0.0-alpha.62(@emnapi/runtime@1.2.0)(emnapi@1.2.0)': - dependencies: - '@napi-rs/cross-toolchain': 0.0.16 - '@napi-rs/wasm-tools': 0.0.2 - '@octokit/rest': 21.0.0 - clipanion: 3.2.1(typanion@3.14.0) - colorette: 2.0.20 - debug: 4.3.5 - inquirer: 10.0.1 - js-yaml: 4.1.0 - lodash-es: 4.17.21 - semver: 7.6.2 - toml: 3.0.0 - typanion: 3.14.0 - wasm-sjlj: 1.0.5 - optionalDependencies: - '@emnapi/runtime': 1.2.0 - emnapi: 1.2.0 - transitivePeerDependencies: - - '@napi-rs/cross-toolchain-arm64-target-aarch64' - - '@napi-rs/cross-toolchain-arm64-target-armv7' - - '@napi-rs/cross-toolchain-arm64-target-x86_64' - - '@napi-rs/cross-toolchain-x64-target-aarch64' - - '@napi-rs/cross-toolchain-x64-target-armv7' - - '@napi-rs/cross-toolchain-x64-target-x86_64' - - supports-color - - '@napi-rs/cross-toolchain@0.0.16': - dependencies: - '@napi-rs/lzma': 1.3.1 - '@napi-rs/tar': 0.1.1 - debug: 4.3.5 - transitivePeerDependencies: - - supports-color - - '@napi-rs/lzma-android-arm-eabi@1.3.1': - optional: true - - '@napi-rs/lzma-android-arm64@1.3.1': - optional: true - - '@napi-rs/lzma-darwin-arm64@1.3.1': - optional: true - - '@napi-rs/lzma-darwin-x64@1.3.1': - optional: true - - '@napi-rs/lzma-freebsd-x64@1.3.1': - optional: true - - '@napi-rs/lzma-linux-arm-gnueabihf@1.3.1': - optional: true - - '@napi-rs/lzma-linux-arm64-gnu@1.3.1': - optional: true - - '@napi-rs/lzma-linux-arm64-musl@1.3.1': - optional: true - - '@napi-rs/lzma-linux-x64-gnu@1.3.1': - optional: true - - '@napi-rs/lzma-linux-x64-musl@1.3.1': - optional: true - - '@napi-rs/lzma-wasm32-wasi@1.3.1': - dependencies: - '@napi-rs/wasm-runtime': 0.2.4 - optional: true - - '@napi-rs/lzma-win32-arm64-msvc@1.3.1': - optional: true - - '@napi-rs/lzma-win32-ia32-msvc@1.3.1': - optional: true - - '@napi-rs/lzma-win32-x64-msvc@1.3.1': - optional: true - - '@napi-rs/lzma@1.3.1': - optionalDependencies: - '@napi-rs/lzma-android-arm-eabi': 1.3.1 - '@napi-rs/lzma-android-arm64': 1.3.1 - '@napi-rs/lzma-darwin-arm64': 1.3.1 - '@napi-rs/lzma-darwin-x64': 1.3.1 - '@napi-rs/lzma-freebsd-x64': 1.3.1 - '@napi-rs/lzma-linux-arm-gnueabihf': 1.3.1 - '@napi-rs/lzma-linux-arm64-gnu': 1.3.1 - '@napi-rs/lzma-linux-arm64-musl': 1.3.1 - '@napi-rs/lzma-linux-x64-gnu': 1.3.1 - '@napi-rs/lzma-linux-x64-musl': 1.3.1 - '@napi-rs/lzma-wasm32-wasi': 1.3.1 - '@napi-rs/lzma-win32-arm64-msvc': 1.3.1 - '@napi-rs/lzma-win32-ia32-msvc': 1.3.1 - '@napi-rs/lzma-win32-x64-msvc': 1.3.1 - - '@napi-rs/tar-android-arm-eabi@0.1.1': - optional: true - - '@napi-rs/tar-android-arm64@0.1.1': - optional: true - - '@napi-rs/tar-darwin-arm64@0.1.1': - optional: true - - '@napi-rs/tar-darwin-x64@0.1.1': - optional: true - - '@napi-rs/tar-freebsd-x64@0.1.1': - optional: true - - '@napi-rs/tar-linux-arm-gnueabihf@0.1.1': - optional: true - - '@napi-rs/tar-linux-arm64-gnu@0.1.1': - optional: true - - '@napi-rs/tar-linux-arm64-musl@0.1.1': - optional: true - - '@napi-rs/tar-linux-x64-gnu@0.1.1': - optional: true - - '@napi-rs/tar-linux-x64-musl@0.1.1': - optional: true - - '@napi-rs/tar-wasm32-wasi@0.1.1': - dependencies: - '@napi-rs/wasm-runtime': 0.2.4 - optional: true - - '@napi-rs/tar-win32-arm64-msvc@0.1.1': - optional: true - - '@napi-rs/tar-win32-ia32-msvc@0.1.1': - optional: true - - '@napi-rs/tar-win32-x64-msvc@0.1.1': - optional: true - - '@napi-rs/tar@0.1.1': - optionalDependencies: - '@napi-rs/tar-android-arm-eabi': 0.1.1 - '@napi-rs/tar-android-arm64': 0.1.1 - '@napi-rs/tar-darwin-arm64': 0.1.1 - '@napi-rs/tar-darwin-x64': 0.1.1 - '@napi-rs/tar-freebsd-x64': 0.1.1 - '@napi-rs/tar-linux-arm-gnueabihf': 0.1.1 - '@napi-rs/tar-linux-arm64-gnu': 0.1.1 - '@napi-rs/tar-linux-arm64-musl': 0.1.1 - '@napi-rs/tar-linux-x64-gnu': 0.1.1 - '@napi-rs/tar-linux-x64-musl': 0.1.1 - '@napi-rs/tar-wasm32-wasi': 0.1.1 - '@napi-rs/tar-win32-arm64-msvc': 0.1.1 - '@napi-rs/tar-win32-ia32-msvc': 0.1.1 - '@napi-rs/tar-win32-x64-msvc': 0.1.1 - - '@napi-rs/wasm-runtime@0.2.4': - dependencies: - '@emnapi/core': 1.2.0 - '@emnapi/runtime': 1.2.0 - '@tybys/wasm-util': 0.9.0 - - '@napi-rs/wasm-tools-android-arm-eabi@0.0.2': - optional: true - - '@napi-rs/wasm-tools-android-arm64@0.0.2': - optional: true - - '@napi-rs/wasm-tools-darwin-arm64@0.0.2': - optional: true - - '@napi-rs/wasm-tools-darwin-x64@0.0.2': - optional: true - - '@napi-rs/wasm-tools-freebsd-x64@0.0.2': - optional: true - - '@napi-rs/wasm-tools-linux-arm64-gnu@0.0.2': - optional: true - - '@napi-rs/wasm-tools-linux-arm64-musl@0.0.2': - optional: true - - '@napi-rs/wasm-tools-linux-x64-gnu@0.0.2': - optional: true - - '@napi-rs/wasm-tools-linux-x64-musl@0.0.2': - optional: true - - '@napi-rs/wasm-tools-wasm32-wasi@0.0.2': - dependencies: - '@napi-rs/wasm-runtime': 0.2.4 - optional: true - - '@napi-rs/wasm-tools-win32-arm64-msvc@0.0.2': - optional: true - - '@napi-rs/wasm-tools-win32-ia32-msvc@0.0.2': - optional: true - - '@napi-rs/wasm-tools-win32-x64-msvc@0.0.2': - optional: true - - '@napi-rs/wasm-tools@0.0.2': - optionalDependencies: - '@napi-rs/wasm-tools-android-arm-eabi': 0.0.2 - '@napi-rs/wasm-tools-android-arm64': 0.0.2 - '@napi-rs/wasm-tools-darwin-arm64': 0.0.2 - '@napi-rs/wasm-tools-darwin-x64': 0.0.2 - '@napi-rs/wasm-tools-freebsd-x64': 0.0.2 - '@napi-rs/wasm-tools-linux-arm64-gnu': 0.0.2 - '@napi-rs/wasm-tools-linux-arm64-musl': 0.0.2 - '@napi-rs/wasm-tools-linux-x64-gnu': 0.0.2 - '@napi-rs/wasm-tools-linux-x64-musl': 0.0.2 - '@napi-rs/wasm-tools-wasm32-wasi': 0.0.2 - '@napi-rs/wasm-tools-win32-arm64-msvc': 0.0.2 - '@napi-rs/wasm-tools-win32-ia32-msvc': 0.0.2 - '@napi-rs/wasm-tools-win32-x64-msvc': 0.0.2 - - '@nodelib/fs.scandir@2.1.5': - dependencies: - '@nodelib/fs.stat': 2.0.5 - run-parallel: 1.2.0 - - '@nodelib/fs.stat@2.0.5': {} - - '@nodelib/fs.walk@1.2.8': - dependencies: - '@nodelib/fs.scandir': 2.1.5 - fastq: 1.17.1 - - '@octokit/auth-token@5.1.1': {} - - '@octokit/core@6.1.2': - dependencies: - '@octokit/auth-token': 5.1.1 - '@octokit/graphql': 8.1.1 - '@octokit/request': 9.1.1 - '@octokit/request-error': 6.1.2 - '@octokit/types': 13.5.0 - before-after-hook: 3.0.2 - universal-user-agent: 7.0.2 - - '@octokit/endpoint@10.1.1': - dependencies: - '@octokit/types': 13.5.0 - universal-user-agent: 7.0.2 - - '@octokit/graphql@8.1.1': - dependencies: - '@octokit/request': 9.1.1 - '@octokit/types': 13.5.0 - universal-user-agent: 7.0.2 - - '@octokit/openapi-types@22.2.0': {} - - '@octokit/plugin-paginate-rest@11.3.3(@octokit/core@6.1.2)': - dependencies: - '@octokit/core': 6.1.2 - '@octokit/types': 13.5.0 - - '@octokit/plugin-request-log@5.3.0(@octokit/core@6.1.2)': - dependencies: - '@octokit/core': 6.1.2 - - '@octokit/plugin-rest-endpoint-methods@13.2.4(@octokit/core@6.1.2)': - dependencies: - '@octokit/core': 6.1.2 - '@octokit/types': 13.5.0 - - '@octokit/request-error@6.1.2': - dependencies: - '@octokit/types': 13.5.0 - - '@octokit/request@9.1.1': - dependencies: - '@octokit/endpoint': 10.1.1 - '@octokit/request-error': 6.1.2 - '@octokit/types': 13.5.0 - universal-user-agent: 7.0.2 - - '@octokit/rest@21.0.0': - dependencies: - '@octokit/core': 6.1.2 - '@octokit/plugin-paginate-rest': 11.3.3(@octokit/core@6.1.2) - '@octokit/plugin-request-log': 5.3.0(@octokit/core@6.1.2) - '@octokit/plugin-rest-endpoint-methods': 13.2.4(@octokit/core@6.1.2) - - '@octokit/types@13.5.0': - dependencies: - '@octokit/openapi-types': 22.2.0 - - '@rollup/pluginutils@4.2.1': - dependencies: - estree-walker: 2.0.2 - picomatch: 2.3.1 - - '@sindresorhus/merge-streams@2.3.0': {} - - '@tybys/wasm-util@0.9.0': - dependencies: - tslib: 2.6.3 - - '@types/mute-stream@0.0.4': - dependencies: - '@types/node': 22.5.4 - - '@types/node@20.16.5': - dependencies: - undici-types: 6.19.8 - - '@types/node@22.5.4': - dependencies: - undici-types: 6.19.8 - - '@types/stylis@4.2.6': {} - - '@types/wrap-ansi@3.0.0': {} - - '@vercel/nft@0.26.5': - dependencies: - '@mapbox/node-pre-gyp': 1.0.11 - '@rollup/pluginutils': 4.2.1 - acorn: 8.12.1 - acorn-import-attributes: 1.9.5(acorn@8.12.1) - async-sema: 3.1.1 - bindings: 1.5.0 - estree-walker: 2.0.2 - glob: 7.2.3 - graceful-fs: 4.2.11 - micromatch: 4.0.7 - node-gyp-build: 4.8.1 - resolve-from: 5.0.0 - transitivePeerDependencies: - - encoding - - supports-color - - abbrev@1.1.1: {} - - acorn-import-attributes@1.9.5(acorn@8.12.1): - dependencies: - acorn: 8.12.1 - - acorn-walk@8.3.3: - dependencies: - acorn: 8.12.1 - - acorn@8.12.1: {} - - agent-base@6.0.2: - dependencies: - debug: 4.3.5 - transitivePeerDependencies: - - supports-color - - ansi-escapes@4.3.2: - dependencies: - type-fest: 0.21.3 - - ansi-regex@5.0.1: {} - - ansi-regex@6.0.1: {} - - ansi-styles@4.3.0: - dependencies: - color-convert: 2.0.1 - - ansi-styles@6.2.1: {} - - aproba@2.0.0: {} - - are-we-there-yet@2.0.0: - dependencies: - delegates: 1.0.0 - readable-stream: 3.6.2 - - argparse@1.0.10: - dependencies: - sprintf-js: 1.0.3 - - argparse@2.0.1: {} - - array-find-index@1.0.2: {} - - arrgv@1.0.2: {} - - arrify@3.0.0: {} - - async-sema@3.1.1: {} - - asynckit@0.4.0: {} - - ava@6.1.3: - dependencies: - '@vercel/nft': 0.26.5 - acorn: 8.12.1 - acorn-walk: 8.3.3 - ansi-styles: 6.2.1 - arrgv: 1.0.2 - arrify: 3.0.0 - callsites: 4.2.0 - cbor: 9.0.2 - chalk: 5.3.0 - chunkd: 2.0.1 - ci-info: 4.0.0 - ci-parallel-vars: 1.0.1 - cli-truncate: 4.0.0 - code-excerpt: 4.0.0 - common-path-prefix: 3.0.0 - concordance: 5.0.4 - currently-unhandled: 0.4.1 - debug: 4.3.5 - emittery: 1.0.3 - figures: 6.1.0 - globby: 14.0.2 - ignore-by-default: 2.1.0 - indent-string: 5.0.0 - is-plain-object: 5.0.0 - is-promise: 4.0.0 - matcher: 5.0.0 - memoize: 10.0.0 - ms: 2.1.3 - p-map: 7.0.2 - package-config: 5.0.0 - picomatch: 3.0.1 - plur: 5.1.0 - pretty-ms: 9.0.0 - resolve-cwd: 3.0.0 - stack-utils: 2.0.6 - strip-ansi: 7.1.0 - supertap: 3.0.1 - temp-dir: 3.0.0 - write-file-atomic: 5.0.1 - yargs: 17.7.2 - transitivePeerDependencies: - - encoding - - supports-color - - axios@1.6.2: - dependencies: - follow-redirects: 1.15.6 - form-data: 4.0.0 - proxy-from-env: 1.1.0 - transitivePeerDependencies: - - debug - - balanced-match@1.0.2: {} - - before-after-hook@3.0.2: {} - - bindings@1.5.0: - dependencies: - file-uri-to-path: 1.0.0 - - blueimp-md5@2.19.0: {} - - brace-expansion@1.1.11: - dependencies: - balanced-match: 1.0.2 - concat-map: 0.0.1 - - braces@3.0.3: - dependencies: - fill-range: 7.1.1 - - callsites@4.2.0: {} - - camelize@1.0.1: {} - - cbor@9.0.2: - dependencies: - nofilter: 3.1.0 - - chalk@5.3.0: {} - - chardet@0.7.0: {} - - chownr@2.0.0: {} - - chunkd@2.0.1: {} - - ci-info@4.0.0: {} - - ci-parallel-vars@1.0.1: {} - - cli-spinners@2.9.2: {} - - cli-truncate@4.0.0: - dependencies: - slice-ansi: 5.0.0 - string-width: 7.2.0 - - cli-width@4.1.0: {} - - clipanion@3.2.1(typanion@3.14.0): - dependencies: - typanion: 3.14.0 - - cliui@8.0.1: - dependencies: - string-width: 4.2.3 - strip-ansi: 6.0.1 - wrap-ansi: 7.0.0 - - code-excerpt@4.0.0: - dependencies: - convert-to-spaces: 2.0.1 - - color-convert@2.0.1: - dependencies: - color-name: 1.1.4 - - color-name@1.1.4: {} - - color-support@1.1.3: {} - - colorette@2.0.20: {} - - combined-stream@1.0.8: - dependencies: - delayed-stream: 1.0.0 - - common-path-prefix@3.0.0: {} - - concat-map@0.0.1: {} - - concordance@5.0.4: - dependencies: - date-time: 3.1.0 - esutils: 2.0.3 - fast-diff: 1.3.0 - js-string-escape: 1.0.1 - lodash: 4.17.21 - md5-hex: 3.0.1 - semver: 7.6.2 - well-known-symbols: 2.0.0 - - console-control-strings@1.1.0: {} - - convert-to-spaces@2.0.1: {} - - css-color-keywords@1.0.0: {} - - css-to-react-native@3.2.0: - dependencies: - camelize: 1.0.1 - css-color-keywords: 1.0.0 - postcss-value-parser: 4.2.0 - - csstype@3.1.3: {} - - currently-unhandled@0.4.1: - dependencies: - array-find-index: 1.0.2 - - date-time@3.1.0: - dependencies: - time-zone: 1.0.0 - - debug@4.3.5: - dependencies: - ms: 2.1.2 - - delayed-stream@1.0.0: {} - - delegates@1.0.0: {} - - detect-libc@2.0.3: {} - - emittery@1.0.3: {} - - emnapi@1.2.0: {} - - emoji-regex@10.3.0: {} - - emoji-regex@8.0.0: {} - - escalade@3.1.2: {} - - escape-string-regexp@2.0.0: {} - - escape-string-regexp@5.0.0: {} - - esprima@4.0.1: {} - - estree-walker@2.0.2: {} - - esutils@2.0.3: {} - - external-editor@3.1.0: - dependencies: - chardet: 0.7.0 - iconv-lite: 0.4.24 - tmp: 0.0.33 - - fast-diff@1.3.0: {} - - fast-glob@3.3.2: - dependencies: - '@nodelib/fs.stat': 2.0.5 - '@nodelib/fs.walk': 1.2.8 - glob-parent: 5.1.2 - merge2: 1.4.1 - micromatch: 4.0.7 - - fastq@1.17.1: - dependencies: - reusify: 1.0.4 - - figures@6.1.0: - dependencies: - is-unicode-supported: 2.0.0 - - file-uri-to-path@1.0.0: {} - - fill-range@7.1.1: - dependencies: - to-regex-range: 5.0.1 - - find-up-simple@1.0.0: {} - - follow-redirects@1.15.6: {} - - form-data@4.0.0: - dependencies: - asynckit: 0.4.0 - combined-stream: 1.0.8 - mime-types: 2.1.35 - - fs-minipass@2.1.0: - dependencies: - minipass: 3.3.6 - - fs.realpath@1.0.0: {} - - gauge@3.0.2: - dependencies: - aproba: 2.0.0 - color-support: 1.1.3 - console-control-strings: 1.1.0 - has-unicode: 2.0.1 - object-assign: 4.1.1 - signal-exit: 3.0.7 - string-width: 4.2.3 - strip-ansi: 6.0.1 - wide-align: 1.1.5 - - get-caller-file@2.0.5: {} - - get-east-asian-width@1.2.0: {} - - glob-parent@5.1.2: - dependencies: - is-glob: 4.0.3 - - glob@7.2.3: - dependencies: - fs.realpath: 1.0.0 - inflight: 1.0.6 - inherits: 2.0.4 - minimatch: 3.1.2 - once: 1.4.0 - path-is-absolute: 1.0.1 - - globby@14.0.2: - dependencies: - '@sindresorhus/merge-streams': 2.3.0 - fast-glob: 3.3.2 - ignore: 5.3.1 - path-type: 5.0.0 - slash: 5.1.0 - unicorn-magic: 0.1.0 - - graceful-fs@4.2.11: {} - - has-unicode@2.0.1: {} - - https-proxy-agent@5.0.1: - dependencies: - agent-base: 6.0.2 - debug: 4.3.5 - transitivePeerDependencies: - - supports-color - - iconv-lite@0.4.24: - dependencies: - safer-buffer: 2.1.2 - - ignore-by-default@2.1.0: {} - - ignore@5.3.1: {} - - imurmurhash@0.1.4: {} - - indent-string@5.0.0: {} - - inflight@1.0.6: - dependencies: - once: 1.4.0 - wrappy: 1.0.2 - - inherits@2.0.4: {} - - inquirer@10.0.1: - dependencies: - '@inquirer/prompts': 5.1.2 - '@inquirer/type': 1.4.0 - '@types/mute-stream': 0.0.4 - ansi-escapes: 4.3.2 - mute-stream: 1.0.0 - run-async: 3.0.0 - rxjs: 7.8.1 - - ipaddr.js@2.2.0: {} - - irregular-plurals@3.5.0: {} - - is-extglob@2.1.1: {} - - is-fullwidth-code-point@3.0.0: {} - - is-fullwidth-code-point@4.0.0: {} - - is-glob@4.0.3: - dependencies: - is-extglob: 2.1.1 - - is-number@7.0.0: {} - - is-plain-object@5.0.0: {} - - is-promise@4.0.0: {} - - is-unicode-supported@2.0.0: {} - - js-string-escape@1.0.1: {} - - js-tokens@4.0.0: {} - - js-yaml@3.14.1: - dependencies: - argparse: 1.0.10 - esprima: 4.0.1 - - js-yaml@4.1.0: - dependencies: - argparse: 2.0.1 - - load-json-file@7.0.1: {} - - lodash-es@4.17.21: {} - - lodash@4.17.21: {} - - loose-envify@1.4.0: - dependencies: - js-tokens: 4.0.0 - - make-dir@3.1.0: - dependencies: - semver: 6.3.1 - - matcher@5.0.0: - dependencies: - escape-string-regexp: 5.0.0 - - md5-hex@3.0.1: - dependencies: - blueimp-md5: 2.19.0 - - memoize@10.0.0: - dependencies: - mimic-function: 5.0.1 - - merge2@1.4.1: {} - - micromatch@4.0.7: - dependencies: - braces: 3.0.3 - picomatch: 2.3.1 - - mime-db@1.52.0: {} - - mime-types@2.1.35: - dependencies: - mime-db: 1.52.0 - - mimic-function@5.0.1: {} - - minimatch@3.1.2: - dependencies: - brace-expansion: 1.1.11 - - minipass@3.3.6: - dependencies: - yallist: 4.0.0 - - minipass@5.0.0: {} - - minizlib@2.1.2: - dependencies: - minipass: 3.3.6 - yallist: 4.0.0 - - mkdirp@1.0.4: {} - - ms@2.1.2: {} - - ms@2.1.3: {} - - mute-stream@1.0.0: {} - - nanoid@3.3.7: {} - - node-fetch@2.7.0: - dependencies: - whatwg-url: 5.0.0 - - node-gyp-build@4.8.1: {} - - nofilter@3.1.0: {} - - nopt@5.0.0: - dependencies: - abbrev: 1.1.1 - - npmlog@5.0.1: - dependencies: - are-we-there-yet: 2.0.0 - console-control-strings: 1.1.0 - gauge: 3.0.2 - set-blocking: 2.0.0 - - object-assign@4.1.1: {} - - once@1.4.0: - dependencies: - wrappy: 1.0.2 - - os-tmpdir@1.0.2: {} - - p-map@7.0.2: {} - - package-config@5.0.0: - dependencies: - find-up-simple: 1.0.0 - load-json-file: 7.0.1 - - parse-ms@4.0.0: {} - - path-is-absolute@1.0.1: {} - - path-type@5.0.0: {} - - picocolors@1.0.1: {} - - picomatch@2.3.1: {} - - picomatch@3.0.1: {} - - plur@5.1.0: - dependencies: - irregular-plurals: 3.5.0 - - postcss-value-parser@4.2.0: {} - - postcss@8.4.33: - dependencies: - nanoid: 3.3.7 - picocolors: 1.0.1 - source-map-js: 1.2.0 - - pretty-ms@9.0.0: - dependencies: - parse-ms: 4.0.0 - - proxy-from-env@1.1.0: {} - - queue-microtask@1.2.3: {} - - react-dom@18.3.1(react@18.3.1): - dependencies: - loose-envify: 1.4.0 - react: 18.3.1 - scheduler: 0.23.2 - - react@18.3.1: - dependencies: - loose-envify: 1.4.0 - - readable-stream@3.6.2: - dependencies: - inherits: 2.0.4 - string_decoder: 1.3.0 - util-deprecate: 1.0.2 - - require-directory@2.1.1: {} - - resolve-cwd@3.0.0: - dependencies: - resolve-from: 5.0.0 - - resolve-from@5.0.0: {} - - reusify@1.0.4: {} - - rimraf@3.0.2: - dependencies: - glob: 7.2.3 - - run-async@3.0.0: {} - - run-parallel@1.2.0: - dependencies: - queue-microtask: 1.2.3 - - rxjs@7.8.1: - dependencies: - tslib: 2.6.3 - - safe-buffer@5.2.1: {} - - safer-buffer@2.1.2: {} - - scheduler@0.23.2: - dependencies: - loose-envify: 1.4.0 - - semver@6.3.1: {} - - semver@7.6.2: {} - - serialize-error@7.0.1: - dependencies: - type-fest: 0.13.1 - - set-blocking@2.0.0: {} - - shallowequal@1.1.0: {} - - signal-exit@3.0.7: {} - - signal-exit@4.1.0: {} - - slash@5.1.0: {} - - slice-ansi@5.0.0: - dependencies: - ansi-styles: 6.2.1 - is-fullwidth-code-point: 4.0.0 - - source-map-js@1.2.0: {} - - sprintf-js@1.0.3: {} - - stack-utils@2.0.6: - dependencies: - escape-string-regexp: 2.0.0 - - string-width@4.2.3: - dependencies: - emoji-regex: 8.0.0 - is-fullwidth-code-point: 3.0.0 - strip-ansi: 6.0.1 - - string-width@7.2.0: - dependencies: - emoji-regex: 10.3.0 - get-east-asian-width: 1.2.0 - strip-ansi: 7.1.0 - - string_decoder@1.3.0: - dependencies: - safe-buffer: 5.2.1 - - strip-ansi@6.0.1: - dependencies: - ansi-regex: 5.0.1 - - strip-ansi@7.1.0: - dependencies: - ansi-regex: 6.0.1 - - styled-components@6.1.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1): - dependencies: - '@emotion/is-prop-valid': 1.2.2 - '@emotion/unitless': 0.8.1 - '@types/stylis': 4.2.6 - css-to-react-native: 3.2.0 - csstype: 3.1.3 - postcss: 8.4.33 - react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) - shallowequal: 1.1.0 - stylis: 4.3.2 - tslib: 2.6.3 - - stylis@4.3.2: {} - - supertap@3.0.1: - dependencies: - indent-string: 5.0.0 - js-yaml: 3.14.1 - serialize-error: 7.0.1 - strip-ansi: 7.1.0 - - tar@6.2.1: - dependencies: - chownr: 2.0.0 - fs-minipass: 2.1.0 - minipass: 5.0.0 - minizlib: 2.1.2 - mkdirp: 1.0.4 - yallist: 4.0.0 - - temp-dir@3.0.0: {} - - time-zone@1.0.0: {} - - tmp@0.0.33: - dependencies: - os-tmpdir: 1.0.2 - - to-regex-range@5.0.1: - dependencies: - is-number: 7.0.0 - - toml@3.0.0: {} - - tr46@0.0.3: {} - - tslib@2.6.3: {} - - typanion@3.14.0: {} - - type-fest@0.13.1: {} - - type-fest@0.21.3: {} - - typescript@5.5.4: {} - - undici-types@6.19.8: {} - - unicorn-magic@0.1.0: {} - - universal-user-agent@7.0.2: {} - - util-deprecate@1.0.2: {} - - wasm-sjlj@1.0.5: {} - - webidl-conversions@3.0.1: {} - - well-known-symbols@2.0.0: {} - - whatwg-url@5.0.0: - dependencies: - tr46: 0.0.3 - webidl-conversions: 3.0.1 - - wide-align@1.1.5: - dependencies: - string-width: 4.2.3 - - wrap-ansi@6.2.0: - dependencies: - ansi-styles: 4.3.0 - string-width: 4.2.3 - strip-ansi: 6.0.1 - - wrap-ansi@7.0.0: - dependencies: - ansi-styles: 4.3.0 - string-width: 4.2.3 - strip-ansi: 6.0.1 - - wrappy@1.0.2: {} - - write-file-atomic@5.0.1: - dependencies: - imurmurhash: 0.1.4 - signal-exit: 4.1.0 - - y18n@5.0.8: {} - - yallist@4.0.0: {} - - yargs-parser@21.1.1: {} - - yargs@17.7.2: - dependencies: - cliui: 8.0.1 - escalade: 3.1.2 - get-caller-file: 2.0.5 - require-directory: 2.1.1 - string-width: 4.2.3 - y18n: 5.0.8 - yargs-parser: 21.1.1 - - yoctocolors-cjs@2.1.2: {} diff --git a/src/builtins.rs b/src/builtins.rs deleted file mode 100644 index 45a25117..00000000 --- a/src/builtins.rs +++ /dev/null @@ -1,71 +0,0 @@ -/// Node.js built-in modules -/// -/// `node -p "[...require('module').builtinModules].map(b => JSON.stringify(b)).join(',\n')"` -/// -pub const NODEJS_BUILTINS: &[&str] = &[ - "_http_agent", - "_http_client", - "_http_common", - "_http_incoming", - "_http_outgoing", - "_http_server", - "_stream_duplex", - "_stream_passthrough", - "_stream_readable", - "_stream_transform", - "_stream_wrap", - "_stream_writable", - "_tls_common", - "_tls_wrap", - "assert", - "assert/strict", - "async_hooks", - "buffer", - "child_process", - "cluster", - "console", - "constants", - "crypto", - "dgram", - "diagnostics_channel", - "dns", - "dns/promises", - "domain", - "events", - "fs", - "fs/promises", - "http", - "http2", - "https", - "inspector", - "module", - "net", - "os", - "path", - "path/posix", - "path/win32", - "perf_hooks", - "process", - "punycode", - "querystring", - "readline", - "repl", - "stream", - "stream/consumers", - "stream/promises", - "stream/web", - "string_decoder", - "sys", - "timers", - "timers/promises", - "tls", - "trace_events", - "tty", - "url", - "util", - "util/types", - "v8", - "vm", - "worker_threads", - "zlib", -]; diff --git a/src/cache.rs b/src/cache.rs deleted file mode 100644 index 6e600664..00000000 --- a/src/cache.rs +++ /dev/null @@ -1,354 +0,0 @@ -use once_cell::sync::OnceCell as OnceLock; -use std::{ - borrow::{Borrow, Cow}, - convert::AsRef, - hash::{BuildHasherDefault, Hash, Hasher}, - io, - ops::Deref, - path::{Path, PathBuf}, - sync::Arc, -}; - -use dashmap::{DashMap, DashSet}; -use rustc_hash::FxHasher; - -use crate::{ - context::ResolveContext as Ctx, package_json::PackageJson, path::PathUtil, FileMetadata, - FileSystem, ResolveError, ResolveOptions, TsConfig, -}; - -#[derive(Default)] -pub struct Cache { - pub(crate) fs: Fs, - paths: DashSet>, - tsconfigs: DashMap, BuildHasherDefault>, -} - -impl Cache { - pub fn new(fs: Fs) -> Self { - Self { fs, paths: DashSet::default(), tsconfigs: DashMap::default() } - } - - pub fn clear(&self) { - self.paths.clear(); - self.tsconfigs.clear(); - } - - pub fn value(&self, path: &Path) -> CachedPath { - let hash = { - let mut hasher = FxHasher::default(); - path.hash(&mut hasher); - hasher.finish() - }; - if let Some(cache_entry) = self.paths.get((hash, path).borrow() as &dyn CacheKey) { - return cache_entry.clone(); - } - let parent = path.parent().map(|p| self.value(p)); - let data = CachedPath(Arc::new(CachedPathImpl::new( - hash, - path.to_path_buf().into_boxed_path(), - parent, - ))); - self.paths.insert(data.clone()); - data - } - - pub fn tsconfig Result<(), ResolveError>>( - &self, - root: bool, - path: &Path, - callback: F, // callback for modifying tsconfig with `extends` - ) -> Result, ResolveError> { - if let Some(tsconfig_ref) = self.tsconfigs.get(path) { - return Ok(Arc::clone(tsconfig_ref.value())); - } - let meta = self.fs.metadata(path).ok(); - let tsconfig_path = if meta.is_some_and(|m| m.is_file) { - Cow::Borrowed(path) - } else if meta.is_some_and(|m| m.is_dir) { - Cow::Owned(path.join("tsconfig.json")) - } else { - let mut os_string = path.to_path_buf().into_os_string(); - os_string.push(".json"); - Cow::Owned(PathBuf::from(os_string)) - }; - let mut tsconfig_string = self - .fs - .read_to_string(&tsconfig_path) - .map_err(|_| ResolveError::TsconfigNotFound(path.to_path_buf()))?; - let mut tsconfig = - TsConfig::parse(root, &tsconfig_path, &mut tsconfig_string).map_err(|error| { - ResolveError::from_serde_json_error(tsconfig_path.to_path_buf(), &error) - })?; - callback(&mut tsconfig)?; - let tsconfig = Arc::new(tsconfig.build()); - self.tsconfigs.insert(path.to_path_buf(), Arc::clone(&tsconfig)); - Ok(tsconfig) - } -} - -#[derive(Clone)] -pub struct CachedPath(Arc); - -impl Hash for CachedPath { - fn hash(&self, state: &mut H) { - self.0.hash.hash(state); - } -} - -impl PartialEq for CachedPath { - fn eq(&self, other: &Self) -> bool { - self.0.path == other.0.path - } -} -impl Eq for CachedPath {} - -impl Deref for CachedPath { - type Target = CachedPathImpl; - - fn deref(&self) -> &Self::Target { - self.0.as_ref() - } -} - -impl<'a> Borrow for CachedPath { - fn borrow(&self) -> &(dyn CacheKey + 'a) { - self - } -} - -impl AsRef for CachedPath { - fn as_ref(&self) -> &CachedPathImpl { - self.0.as_ref() - } -} - -impl CacheKey for CachedPath { - fn tuple(&self) -> (u64, &Path) { - (self.hash, &self.path) - } -} - -pub struct CachedPathImpl { - hash: u64, - path: Box, - parent: Option, - meta: OnceLock>, - canonicalized: OnceLock>, - node_modules: OnceLock>, - package_json: OnceLock>>, -} - -impl CachedPathImpl { - fn new(hash: u64, path: Box, parent: Option) -> Self { - Self { - hash, - path, - parent, - meta: OnceLock::new(), - canonicalized: OnceLock::new(), - node_modules: OnceLock::new(), - package_json: OnceLock::new(), - } - } - - pub fn path(&self) -> &Path { - &self.path - } - - pub fn to_path_buf(&self) -> PathBuf { - self.path.to_path_buf() - } - - pub fn parent(&self) -> Option<&CachedPath> { - self.parent.as_ref() - } - - fn meta(&self, fs: &Fs) -> Option { - *self.meta.get_or_init(|| fs.metadata(&self.path).ok()) - } - - pub fn is_file(&self, fs: &Fs, ctx: &mut Ctx) -> bool { - if let Some(meta) = self.meta(fs) { - ctx.add_file_dependency(self.path()); - meta.is_file - } else { - ctx.add_missing_dependency(self.path()); - false - } - } - - pub fn is_dir(&self, fs: &Fs, ctx: &mut Ctx) -> bool { - self.meta(fs).map_or_else( - || { - ctx.add_missing_dependency(self.path()); - false - }, - |meta| meta.is_dir, - ) - } - - pub fn realpath(&self, fs: &Fs) -> io::Result { - self.canonicalized - .get_or_try_init(|| { - if fs.symlink_metadata(&self.path).is_ok_and(|m| m.is_symlink) { - return fs.canonicalize(&self.path).map(Some); - } - if let Some(parent) = self.parent() { - let parent_path = parent.realpath(fs)?; - return Ok(Some( - parent_path.normalize_with(self.path.strip_prefix(&parent.path).unwrap()), - )); - }; - Ok(None) - }) - .cloned() - .map(|r| r.unwrap_or_else(|| self.path.clone().to_path_buf())) - } - - pub fn module_directory( - &self, - module_name: &str, - cache: &Cache, - ctx: &mut Ctx, - ) -> Option { - let cached_path = cache.value(&self.path.join(module_name)); - cached_path.is_dir(&cache.fs, ctx).then_some(cached_path) - } - - pub fn cached_node_modules( - &self, - cache: &Cache, - ctx: &mut Ctx, - ) -> Option { - self.node_modules.get_or_init(|| self.module_directory("node_modules", cache, ctx)).clone() - } - - /// Find package.json of a path by traversing parent directories. - /// - /// # Errors - /// - /// * [ResolveError::JSON] - pub fn find_package_json( - &self, - fs: &Fs, - options: &ResolveOptions, - ctx: &mut Ctx, - ) -> Result>, ResolveError> { - let mut cache_value = self; - // Go up directories when the querying path is not a directory - while !cache_value.is_dir(fs, ctx) { - if let Some(cv) = &cache_value.parent { - cache_value = cv.as_ref(); - } else { - break; - } - } - let mut cache_value = Some(cache_value); - while let Some(cv) = cache_value { - if let Some(package_json) = cv.package_json(fs, options, ctx)? { - return Ok(Some(Arc::clone(&package_json))); - } - cache_value = cv.parent.as_deref(); - } - Ok(None) - } - - /// Get package.json of the given path. - /// - /// # Errors - /// - /// * [ResolveError::JSON] - pub fn package_json( - &self, - fs: &Fs, - options: &ResolveOptions, - ctx: &mut Ctx, - ) -> Result>, ResolveError> { - // Change to `std::sync::OnceLock::get_or_try_init` when it is stable. - let result = self - .package_json - .get_or_try_init(|| { - let package_json_path = self.path.join("package.json"); - let Ok(package_json_string) = fs.read_to_string(&package_json_path) else { - return Ok(None); - }; - let real_path = if options.symlinks { - self.realpath(fs)?.join("package.json") - } else { - package_json_path.clone() - }; - PackageJson::parse(package_json_path.clone(), real_path, &package_json_string) - .map(Arc::new) - .map(Some) - .map_err(|error| ResolveError::from_serde_json_error(package_json_path, &error)) - }) - .cloned(); - // https://github.com/webpack/enhanced-resolve/blob/58464fc7cb56673c9aa849e68e6300239601e615/lib/DescriptionFileUtils.js#L68-L82 - match &result { - Ok(Some(package_json)) => { - ctx.add_file_dependency(&package_json.path); - } - Ok(None) => { - // Avoid an allocation by making this lazy - if let Some(deps) = &mut ctx.missing_dependencies { - deps.push(self.path.join("package.json")); - } - } - Err(_) => { - if let Some(deps) = &mut ctx.file_dependencies { - deps.push(self.path.join("package.json")); - } - } - } - result - } -} - -/// Memoized cache key, code adapted from . -trait CacheKey { - fn tuple(&self) -> (u64, &Path); -} - -impl Hash for dyn CacheKey + '_ { - fn hash(&self, state: &mut H) { - self.tuple().0.hash(state); - } -} - -impl PartialEq for dyn CacheKey + '_ { - fn eq(&self, other: &Self) -> bool { - self.tuple().1 == other.tuple().1 - } -} - -impl Eq for dyn CacheKey + '_ {} - -impl<'a> CacheKey for (u64, &'a Path) { - fn tuple(&self) -> (u64, &Path) { - (self.0, self.1) - } -} - -impl<'a> Borrow for (u64, &'a Path) { - fn borrow(&self) -> &(dyn CacheKey + 'a) { - self - } -} - -/// Since the cache key is memoized, use an identity hasher -/// to avoid double cache. -#[derive(Default)] -struct IdentityHasher(u64); - -impl Hasher for IdentityHasher { - fn write(&mut self, _: &[u8]) { - unreachable!("Invalid use of IdentityHasher") - } - fn write_u64(&mut self, n: u64) { - self.0 = n; - } - fn finish(&self) -> u64 { - self.0 - } -} diff --git a/src/context.rs b/src/context.rs deleted file mode 100644 index 9349de30..00000000 --- a/src/context.rs +++ /dev/null @@ -1,89 +0,0 @@ -use std::{ - ops::{Deref, DerefMut}, - path::{Path, PathBuf}, -}; - -use crate::error::ResolveError; - -#[derive(Debug, Default, Clone)] -pub struct ResolveContext(ResolveContextImpl); - -#[derive(Debug, Default, Clone)] -pub struct ResolveContextImpl { - pub fully_specified: bool, - - pub query: Option, - - pub fragment: Option, - - /// Files that was found on file system - pub file_dependencies: Option>, - - /// Files that was found on file system - pub missing_dependencies: Option>, - - /// The current resolving alias for bailing recursion alias. - pub resolving_alias: Option, - - /// For avoiding infinite recursion, which will cause stack overflow. - depth: u8, -} - -impl Deref for ResolveContext { - type Target = ResolveContextImpl; - - fn deref(&self) -> &Self::Target { - &self.0 - } -} - -impl DerefMut for ResolveContext { - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} - -impl ResolveContext { - pub fn with_fully_specified(&mut self, yes: bool) { - self.fully_specified = yes; - } - - pub fn with_query_fragment(&mut self, query: Option<&str>, fragment: Option<&str>) { - if let Some(query) = query { - self.query.replace(query.to_string()); - } - if let Some(fragment) = fragment { - self.fragment.replace(fragment.to_string()); - } - } - - pub fn init_file_dependencies(&mut self) { - self.file_dependencies.replace(vec![]); - self.missing_dependencies.replace(vec![]); - } - - pub fn add_file_dependency(&mut self, dep: &Path) { - if let Some(deps) = &mut self.file_dependencies { - deps.push(dep.to_path_buf()); - } - } - - pub fn add_missing_dependency(&mut self, dep: &Path) { - if let Some(deps) = &mut self.missing_dependencies { - deps.push(dep.to_path_buf()); - } - } - - pub fn with_resolving_alias(&mut self, alias: String) { - self.resolving_alias = Some(alias); - } - - pub fn test_for_infinite_recursion(&mut self) -> Result<(), ResolveError> { - self.depth += 1; - // 64 should be more than enough for detecting infinite recursion. - if self.depth > 64 { - return Err(ResolveError::Recursion); - } - Ok(()) - } -} diff --git a/src/error.rs b/src/error.rs deleted file mode 100644 index b00a0ba8..00000000 --- a/src/error.rs +++ /dev/null @@ -1,182 +0,0 @@ -use std::{io, path::PathBuf, sync::Arc}; -use thiserror::Error; - -/// All resolution errors -/// -/// `thiserror` is used to display meaningful error messages. -#[derive(Debug, Clone, PartialEq, Error)] -pub enum ResolveError { - /// Ignored path - /// - /// Derived from ignored path (false value) from browser field in package.json - /// ```json - /// { - /// "browser": { - /// "./module": false - /// } - /// } - /// ``` - /// See - #[error("Path is ignored {0}")] - Ignored(PathBuf), - - /// Module not found - #[error("Cannot find module '{0}'")] - NotFound(/* specifier */ String), - - /// Matched alias value not found - #[error("Cannot find module '{0}' for matched aliased key '{1}'")] - MatchedAliasNotFound(/* specifier */ String, /* alias key */ String), - - /// Tsconfig not found - #[error("Tsconfig not found {0}")] - TsconfigNotFound(PathBuf), - - /// Tsconfig's project reference path points to it self - #[error("Tsconfig's project reference path points to this tsconfig {0}")] - TsconfigSelfReference(PathBuf), - - #[error("{0}")] - IOError(IOError), - - /// Node.js builtin modules - /// - /// This is an error due to not being a Node.js runtime. - /// The `alias` option can be used to resolve a builtin module to a polyfill. - #[error("Builtin module {0}")] - Builtin(String), - - /// All of the aliased extension are not found - #[error("All of the aliased extensions are not found for {0}")] - ExtensionAlias(PathBuf), - - /// The provided path specifier cannot be parsed - #[error("{0}")] - Specifier(SpecifierError), - - /// JSON parse error - #[error("{0:?}")] - JSON(JSONError), - - /// Restricted by `ResolveOptions::restrictions` - #[error(r#"Path "{0}" restricted by {0}"#)] - Restriction(PathBuf, PathBuf), - - #[error(r#"Invalid module "{0}" specifier is not a valid subpath for the "exports" resolution of {1}"#)] - InvalidModuleSpecifier(String, PathBuf), - - #[error(r#"Invalid "exports" target "{0}" defined for '{1}' in the package config {2}"#)] - InvalidPackageTarget(String, String, PathBuf), - - #[error(r#"Package subpath '{0}' is not defined by "exports" in {1}"#)] - PackagePathNotExported(String, PathBuf), - - #[error(r#"Invalid package config "{0}", "exports" cannot contain some keys starting with '.' and some not. The exports object must either be an object of package subpath keys or an object of main entry condition name keys only."#)] - InvalidPackageConfig(PathBuf), - - #[error(r#"Default condition should be last one in "{0}""#)] - InvalidPackageConfigDefault(PathBuf), - - #[error(r#"Expecting folder to folder mapping. "{0}" should end with "/"#)] - InvalidPackageConfigDirectory(PathBuf), - - #[error(r#"Package import specifier "{0}" is not defined in package {1}"#)] - PackageImportNotDefined(String, PathBuf), - - #[error("{0} is unimplemented")] - Unimplemented(&'static str), - - /// Occurs when alias paths reference each other. - #[error("Recursion in resolving")] - Recursion, -} - -impl ResolveError { - pub fn is_ignore(&self) -> bool { - matches!(self, Self::Ignored(_)) - } - - pub(crate) fn from_serde_json_error(path: PathBuf, error: &serde_json::Error) -> Self { - Self::JSON(JSONError { - path, - message: error.to_string(), - line: error.line(), - column: error.column(), - }) - } -} - -/// Error for [ResolveError::Specifier] -#[derive(Debug, Clone, Eq, PartialEq, Error)] -pub enum SpecifierError { - #[error("The specifiers must be a non-empty string. Received \"{0}\"")] - Empty(String), -} - -/// JSON error from [serde_json::Error] -#[derive(Debug, Clone, Eq, PartialEq)] -pub struct JSONError { - pub path: PathBuf, - pub message: String, - pub line: usize, - pub column: usize, -} - -#[derive(Debug, Clone, Error)] -#[error("{0}")] -pub struct IOError(Arc); - -impl PartialEq for IOError { - fn eq(&self, other: &Self) -> bool { - self.0.kind() == other.0.kind() - } -} - -impl From for io::Error { - fn from(error: IOError) -> Self { - let io_error = error.0.as_ref(); - Self::new(io_error.kind(), io_error.to_string()) - } -} - -impl From for ResolveError { - fn from(err: io::Error) -> Self { - Self::IOError(IOError(Arc::new(err))) - } -} - -#[test] -fn test_into_io_error() { - use std::io::{self, ErrorKind}; - let error_string = "IOError occurred"; - let string_error = io::Error::new(ErrorKind::Interrupted, error_string.to_string()); - let string_error2 = io::Error::new(ErrorKind::Interrupted, error_string.to_string()); - let resolve_io_error: ResolveError = ResolveError::from(string_error2); - - assert_eq!(resolve_io_error, ResolveError::from(string_error)); - assert_eq!(resolve_io_error.clone(), resolve_io_error); - let ResolveError::IOError(io_error) = resolve_io_error else { unreachable!() }; - assert_eq!( - format!("{io_error:?}"), - r#"IOError(Custom { kind: Interrupted, error: "IOError occurred" })"# - ); - // fix for https://github.com/web-infra-dev/rspack/issues/4564 - let std_io_error: io::Error = io_error.into(); - assert_eq!(std_io_error.kind(), ErrorKind::Interrupted); - assert_eq!(std_io_error.to_string(), error_string); - assert_eq!( - format!("{std_io_error:?}"), - r#"Custom { kind: Interrupted, error: "IOError occurred" }"# - ); -} - -#[test] -fn test_coverage() { - let error = ResolveError::NotFound("x".into()); - assert_eq!(format!("{error:?}"), r#"NotFound("x")"#); - assert_eq!(error.clone(), error); - - let error = ResolveError::Specifier(SpecifierError::Empty("x".into())); - assert_eq!(format!("{error:?}"), r#"Specifier(Empty("x"))"#); - assert_eq!(error.clone(), error); -} diff --git a/src/file_system.rs b/src/file_system.rs deleted file mode 100644 index d5f0ff8a..00000000 --- a/src/file_system.rs +++ /dev/null @@ -1,220 +0,0 @@ -use cfg_if::cfg_if; -use std::{ - fs, io, - path::{Path, PathBuf}, -}; - -#[cfg(feature = "yarn_pnp")] -use pnp::fs::{LruZipCache, VPath, VPathInfo, ZipCache}; - -/// File System abstraction used for `ResolverGeneric` -pub trait FileSystem: Send + Sync { - /// See [std::fs::read_to_string] - /// - /// # Errors - /// - /// * See [std::fs::read_to_string] - /// ## Warning - /// Use `&Path` instead of a generic `P: AsRef` here, - /// because object safety requirements, it is especially useful, when - /// you want to store multiple `dyn FileSystem` in a `Vec` or use a `ResolverGeneric` in - /// napi env. - fn read_to_string(&self, path: &Path) -> io::Result; - - /// See [std::fs::metadata] - /// - /// # Errors - /// See [std::fs::metadata] - /// ## Warning - /// Use `&Path` instead of a generic `P: AsRef` here, - /// because object safety requirements, it is especially useful, when - /// you want to store multiple `dyn FileSystem` in a `Vec` or use a `ResolverGeneric` in - /// napi env. - fn metadata(&self, path: &Path) -> io::Result; - - /// See [std::fs::symlink_metadata] - /// - /// # Errors - /// - /// See [std::fs::symlink_metadata] - /// ## Warning - /// Use `&Path` instead of a generic `P: AsRef` here, - /// because object safety requirements, it is especially useful, when - /// you want to store multiple `dyn FileSystem` in a `Vec` or use a `ResolverGeneric` in - /// napi env. - fn symlink_metadata(&self, path: &Path) -> io::Result; - - /// See [std::fs::canonicalize] - /// - /// # Errors - /// - /// See [std::fs::read_link] - /// ## Warning - /// Use `&Path` instead of a generic `P: AsRef` here, - /// because object safety requirements, it is especially useful, when - /// you want to store multiple `dyn FileSystem` in a `Vec` or use a `ResolverGeneric` in - /// napi env. - fn canonicalize(&self, path: &Path) -> io::Result; -} - -/// Metadata information about a file -#[derive(Debug, Clone, Copy)] -pub struct FileMetadata { - pub(crate) is_file: bool, - pub(crate) is_dir: bool, - pub(crate) is_symlink: bool, -} - -impl FileMetadata { - pub fn new(is_file: bool, is_dir: bool, is_symlink: bool) -> Self { - Self { is_file, is_dir, is_symlink } - } -} - -#[cfg(feature = "yarn_pnp")] -impl From for FileMetadata { - fn from(value: pnp::fs::FileType) -> Self { - Self::new(value == pnp::fs::FileType::File, value == pnp::fs::FileType::Directory, false) - } -} - -impl From for FileMetadata { - fn from(metadata: fs::Metadata) -> Self { - Self::new(metadata.is_file(), metadata.is_dir(), metadata.is_symlink()) - } -} - -/// Operating System -#[cfg(feature = "yarn_pnp")] -pub struct FileSystemOs { - pnp_lru: LruZipCache>, -} - -#[cfg(not(feature = "yarn_pnp"))] -pub struct FileSystemOs; - -impl Default for FileSystemOs { - fn default() -> Self { - cfg_if! { - if #[cfg(feature = "yarn_pnp")] { - Self { pnp_lru: LruZipCache::new(50, pnp::fs::open_zip_via_read_p) } - } else { - Self - } - } - } -} - -fn read_to_string(path: &Path) -> io::Result { - // `simdutf8` is faster than `std::str::from_utf8` which `fs::read_to_string` uses internally - let bytes = std::fs::read(path)?; - if simdutf8::basic::from_utf8(&bytes).is_err() { - // Same error as `fs::read_to_string` produces (`io::Error::INVALID_UTF8`) - return Err(io::Error::new( - io::ErrorKind::InvalidData, - "stream did not contain valid UTF-8", - )); - } - // SAFETY: `simdutf8` has ensured it's a valid UTF-8 string - Ok(unsafe { String::from_utf8_unchecked(bytes) }) -} - -impl FileSystem for FileSystemOs { - fn read_to_string(&self, path: &Path) -> io::Result { - cfg_if! { - if #[cfg(feature = "yarn_pnp")] { - match VPath::from(path)? { - VPath::Zip(info) => { - self.pnp_lru.read_to_string(info.physical_base_path(), info.zip_path) - } - VPath::Virtual(info) => read_to_string(&info.physical_base_path()), - VPath::Native(path) => read_to_string(&path), - } - } else { - read_to_string(path) - } - } - } - - fn metadata(&self, path: &Path) -> io::Result { - cfg_if! { - if #[cfg(feature = "yarn_pnp")] { - match VPath::from(path)? { - VPath::Zip(info) => self - .pnp_lru - .file_type(info.physical_base_path(), info.zip_path) - .map(FileMetadata::from), - VPath::Virtual(info) => { - fs::metadata(info.physical_base_path()).map(FileMetadata::from) - } - VPath::Native(path) => fs::metadata(path).map(FileMetadata::from), - } - } else { - fs::metadata(path).map(FileMetadata::from) - } - } - } - - fn symlink_metadata(&self, path: &Path) -> io::Result { - fs::symlink_metadata(path).map(FileMetadata::from) - } - - fn canonicalize(&self, path: &Path) -> io::Result { - cfg_if! { - if #[cfg(feature = "yarn_pnp")] { - match VPath::from(path)? { - VPath::Zip(info) => { - dunce::canonicalize(info.physical_base_path().join(info.zip_path)) - } - VPath::Virtual(info) => dunce::canonicalize(info.physical_base_path()), - VPath::Native(path) => dunce::canonicalize(path), - } - } else if #[cfg(windows)] { - dunce::canonicalize(path) - } else { - use std::path::Component; - let mut path_buf = path.to_path_buf(); - loop { - let link = fs::read_link(&path_buf)?; - path_buf.pop(); - for component in link.components() { - match component { - Component::ParentDir => { - path_buf.pop(); - } - Component::Normal(seg) => { - #[cfg(target_family = "wasm")] - // Need to trim the extra \0 introduces by https://github.com/nodejs/uvwasi/issues/262 - { - path_buf.push(seg.to_string_lossy().trim_end_matches('\0')); - } - #[cfg(not(target_family = "wasm"))] - { - path_buf.push(seg); - } - } - Component::RootDir => { - path_buf = PathBuf::from("/"); - } - Component::CurDir | Component::Prefix(_) => {} - } - } - if !fs::symlink_metadata(&path_buf)?.is_symlink() { - break; - } - } - Ok(path_buf) - } - } - } -} - -#[test] -fn metadata() { - let meta = FileMetadata { is_file: true, is_dir: true, is_symlink: true }; - assert_eq!( - format!("{meta:?}"), - "FileMetadata { is_file: true, is_dir: true, is_symlink: true }" - ); - let _ = meta; -} diff --git a/src/lib.rs b/src/lib.rs deleted file mode 100644 index e6cb2246..00000000 --- a/src/lib.rs +++ /dev/null @@ -1,1755 +0,0 @@ -//! # Oxc Resolver -//! -//! Node.js [CommonJS][cjs] and [ECMAScript][esm] Module Resolution. -//! -//! Released on [crates.io](https://crates.io/crates/oxc_resolver) and [npm](https://www.npmjs.com/package/oxc-resolver). -//! -//! A module resolution is the process of finding the file referenced by a module specifier in -//! `import "specifier"` or `require("specifier")`. -//! -//! All [configuration options](ResolveOptions) are aligned with webpack's [enhanced-resolve]. -//! -//! ## Terminology -//! -//! ### Specifier -//! -//! For [CommonJS modules][cjs], -//! the specifier is the string passed to the `require` function. e.g. `"id"` in `require("id")`. -//! -//! For [ECMAScript modules][esm], -//! the specifier of an `import` statement is the string after the `from` keyword, -//! e.g. `'specifier'` in `import 'specifier'` or `import { sep } from 'specifier'`. -//! Specifiers are also used in export from statements, and as the argument to an `import()` expression. -//! -//! This is also named "request" in some places. -//! -//! ## References: -//! -//! * Algorithm adapted from Node.js [CommonJS Module Resolution Algorithm] and [ECMAScript Module Resolution Algorithm]. -//! * Tests are ported from [enhanced-resolve]. -//! * Some code is adapted from [parcel-resolver]. -//! * The documentation is copied from [webpack's resolve configuration](https://webpack.js.org/configuration/resolve). -//! -//! [enhanced-resolve]: https://github.com/webpack/enhanced-resolve -//! [CommonJS Module Resolution Algorithm]: https://nodejs.org/api/modules.html#all-together -//! [ECMAScript Module Resolution Algorithm]: https://nodejs.org/api/esm.html#resolution-algorithm-specification -//! [parcel-resolver]: https://github.com/parcel-bundler/parcel/blob/v2/packages/utils/node-resolver-rs -//! [cjs]: https://nodejs.org/api/modules.html -//! [esm]: https://nodejs.org/api/esm.html -//! -//! ## Feature flags -#![cfg_attr(feature = "document-features", doc = document_features::document_features!())] -#![cfg_attr(docsrs, feature(doc_auto_cfg))] -//! -//! ## Example -//! -//! ```rust,ignore -#![doc = include_str!("../examples/resolver.rs")] -//! ``` - -mod builtins; -mod cache; -mod context; -mod error; -mod file_system; -mod options; -mod package_json; -mod path; -mod resolution; -mod specifier; -mod tsconfig; - -#[cfg(test)] -mod tests; - -use std::{ - borrow::Cow, - cmp::Ordering, - ffi::OsStr, - fmt, - path::{Component, Path, PathBuf}, - sync::Arc, -}; - -use rustc_hash::FxHashSet; -use serde_json::Value as JSONValue; - -pub use crate::{ - builtins::NODEJS_BUILTINS, - error::{JSONError, ResolveError, SpecifierError}, - file_system::{FileMetadata, FileSystem}, - options::{ - Alias, AliasValue, EnforceExtension, ResolveOptions, Restriction, TsconfigOptions, - TsconfigReferences, - }, - package_json::PackageJson, - resolution::Resolution, -}; -use crate::{ - cache::{Cache, CachedPath}, - context::ResolveContext as Ctx, - file_system::FileSystemOs, - package_json::JSONMap, - path::{PathUtil, SLASH_START}, - specifier::Specifier, - tsconfig::ExtendsField, - tsconfig::{ProjectReference, TsConfig}, -}; - -type ResolveResult = Result, ResolveError>; - -/// Context returned from the [Resolver::resolve_with_context] API -#[derive(Debug, Default, Clone)] -pub struct ResolveContext { - /// Files that was found on file system - pub file_dependencies: FxHashSet, - - /// Dependencies that was not found on file system - pub missing_dependencies: FxHashSet, -} - -/// Resolver with the current operating system as the file system -pub type Resolver = ResolverGeneric; - -/// Generic implementation of the resolver, can be configured by the [FileSystem] trait -pub struct ResolverGeneric { - options: ResolveOptions, - cache: Arc>, -} - -impl fmt::Debug for ResolverGeneric { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - self.options.fmt(f) - } -} - -impl Default for ResolverGeneric { - fn default() -> Self { - Self::new(ResolveOptions::default()) - } -} - -impl ResolverGeneric { - pub fn new(options: ResolveOptions) -> Self { - Self { options: options.sanitize(), cache: Arc::new(Cache::new(Fs::default())) } - } -} - -impl ResolverGeneric { - pub fn new_with_file_system(file_system: Fs, options: ResolveOptions) -> Self { - Self { cache: Arc::new(Cache::new(file_system)), options: options.sanitize() } - } - - /// Clone the resolver using the same underlying cache. - #[must_use] - pub fn clone_with_options(&self, options: ResolveOptions) -> Self { - Self { options: options.sanitize(), cache: Arc::clone(&self.cache) } - } - - /// Returns the options. - pub fn options(&self) -> &ResolveOptions { - &self.options - } - - /// Clear the underlying cache. - pub fn clear_cache(&self) { - self.cache.clear(); - } - - /// Resolve `specifier` at an absolute path to a `directory`. - /// - /// A specifier is the string passed to require or import, i.e. `require("specifier")` or `import "specifier"`. - /// - /// `directory` must be an **absolute** path to a directory where the specifier is resolved against. - /// For CommonJS modules, it is the `__dirname` variable that contains the absolute path to the folder containing current module. - /// For ECMAScript modules, it is the value of `import.meta.url`. - /// - /// # Errors - /// - /// * See [ResolveError] - pub fn resolve>( - &self, - directory: P, - specifier: &str, - ) -> Result { - let mut ctx = Ctx::default(); - self.resolve_tracing(directory.as_ref(), specifier, &mut ctx) - } - - /// Resolve `specifier` at absolute `path` with [ResolveContext] - /// - /// # Errors - /// - /// * See [ResolveError] - pub fn resolve_with_context>( - &self, - directory: P, - specifier: &str, - resolve_context: &mut ResolveContext, - ) -> Result { - let mut ctx = Ctx::default(); - ctx.init_file_dependencies(); - let result = self.resolve_tracing(directory.as_ref(), specifier, &mut ctx); - if let Some(deps) = &mut ctx.file_dependencies { - resolve_context.file_dependencies.extend(deps.drain(..)); - } - if let Some(deps) = &mut ctx.missing_dependencies { - resolve_context.missing_dependencies.extend(deps.drain(..)); - } - result - } - - /// Wrap `resolve_impl` with `tracing` information - fn resolve_tracing( - &self, - directory: &Path, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - let span = tracing::debug_span!("resolve", path = ?directory, specifier = specifier); - let _enter = span.enter(); - let r = self.resolve_impl(directory, specifier, ctx); - match &r { - Ok(r) => { - tracing::debug!(options = ?self.options, path = ?directory, specifier = specifier, ret = ?r.path); - } - Err(err) => { - tracing::debug!(options = ?self.options, path = ?directory, specifier = specifier, err = ?err); - } - }; - r - } - - fn resolve_impl( - &self, - path: &Path, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - ctx.with_fully_specified(self.options.fully_specified); - let cached_path = self.cache.value(path); - let cached_path = self.require(&cached_path, specifier, ctx)?; - let path = self.load_realpath(&cached_path)?; - // enhanced-resolve: restrictions - self.check_restrictions(&path)?; - let package_json = cached_path.find_package_json(&self.cache.fs, &self.options, ctx)?; - if let Some(package_json) = &package_json { - // path must be inside the package. - debug_assert!(path.starts_with(package_json.directory())); - } - Ok(Resolution { - path, - query: ctx.query.take(), - fragment: ctx.fragment.take(), - package_json, - }) - } - - /// require(X) from module at path Y - /// - /// X: specifier - /// Y: path - /// - /// - fn require( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - ctx.test_for_infinite_recursion()?; - - // enhanced-resolve: parse - let (parsed, try_fragment_as_path) = self.load_parse(cached_path, specifier, ctx)?; - if let Some(path) = try_fragment_as_path { - return Ok(path); - } - - self.require_without_parse(cached_path, parsed.path(), ctx) - } - - fn require_without_parse( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - // tsconfig-paths - if let Some(path) = self.load_tsconfig_paths(cached_path, specifier, &mut Ctx::default())? { - return Ok(path); - } - - // enhanced-resolve: try alias - if let Some(path) = self.load_alias(cached_path, specifier, &self.options.alias, ctx)? { - return Ok(path); - } - - let result = match Path::new(specifier).components().next() { - // 2. If X begins with '/' - Some(Component::RootDir | Component::Prefix(_)) => { - self.require_absolute(cached_path, specifier, ctx) - } - // 3. If X begins with './' or '/' or '../' - Some(Component::CurDir | Component::ParentDir) => { - self.require_relative(cached_path, specifier, ctx) - } - // 4. If X begins with '#' - Some(Component::Normal(_)) if specifier.as_bytes()[0] == b'#' => { - self.require_hash(cached_path, specifier, ctx) - } - _ => { - // 1. If X is a core module, - // a. return the core module - // b. STOP - self.require_core(specifier)?; - - // (ESM) 5. Otherwise, - // Note: specifier is now a bare specifier. - // Set resolved the result of PACKAGE_RESOLVE(specifier, parentURL). - self.require_bare(cached_path, specifier, ctx) - } - }; - - result.or_else(|err| { - if err.is_ignore() { - return Err(err); - } - // enhanced-resolve: try fallback - self.load_alias(cached_path, specifier, &self.options.fallback, ctx) - .and_then(|value| value.ok_or(err)) - }) - } - - // PACKAGE_RESOLVE(packageSpecifier, parentURL) - // 3. If packageSpecifier is a Node.js builtin module name, then - // 1. Return the string "node:" concatenated with packageSpecifier. - fn require_core(&self, specifier: &str) -> Result<(), ResolveError> { - if self.options.builtin_modules { - let starts_with_node = specifier.starts_with("node:"); - if starts_with_node || NODEJS_BUILTINS.binary_search(&specifier).is_ok() { - let mut specifier = specifier.to_string(); - if !starts_with_node { - specifier = format!("node:{specifier}"); - } - return Err(ResolveError::Builtin(specifier)); - } - } - Ok(()) - } - - fn require_absolute( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - // Make sure only path prefixes gets called - debug_assert!(Path::new(specifier) - .components() - .next() - .is_some_and(|c| matches!(c, Component::RootDir | Component::Prefix(_)))); - if !self.options.prefer_relative && self.options.prefer_absolute { - if let Ok(path) = self.load_package_self_or_node_modules(cached_path, specifier, ctx) { - return Ok(path); - } - } - if let Some(path) = self.load_roots(specifier, ctx) { - return Ok(path); - } - // 2. If X begins with '/' - // a. set Y to be the file system root - let path = self.cache.value(Path::new(specifier)); - if let Some(path) = self.load_as_file_or_directory(&path, specifier, ctx)? { - return Ok(path); - } - Err(ResolveError::NotFound(specifier.to_string())) - } - - // 3. If X begins with './' or '/' or '../' - fn require_relative( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - // Make sure only relative or normal paths gets called - debug_assert!(Path::new(specifier).components().next().is_some_and(|c| matches!( - c, - Component::CurDir | Component::ParentDir | Component::Normal(_) - ))); - let path = cached_path.path().normalize_with(specifier); - let cached_path = self.cache.value(&path); - // a. LOAD_AS_FILE(Y + X) - // b. LOAD_AS_DIRECTORY(Y + X) - if let Some(path) = self.load_as_file_or_directory(&cached_path, specifier, ctx)? { - return Ok(path); - } - // c. THROW "not found" - Err(ResolveError::NotFound(specifier.to_string())) - } - - fn require_hash( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - debug_assert_eq!(specifier.chars().next(), Some('#')); - // a. LOAD_PACKAGE_IMPORTS(X, dirname(Y)) - if let Some(path) = self.load_package_imports(cached_path, specifier, ctx)? { - return Ok(path); - } - self.load_package_self_or_node_modules(cached_path, specifier, ctx) - } - - fn require_bare( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - // Make sure no other path prefixes gets called - debug_assert!(Path::new(specifier) - .components() - .next() - .is_some_and(|c| matches!(c, Component::Normal(_)))); - if self.options.prefer_relative { - if let Ok(path) = self.require_relative(cached_path, specifier, ctx) { - return Ok(path); - } - } - self.load_package_self_or_node_modules(cached_path, specifier, ctx) - } - - /// enhanced-resolve: ParsePlugin. - /// - /// 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`. - /// - /// - fn load_parse<'s>( - &self, - cached_path: &CachedPath, - specifier: &'s str, - ctx: &mut Ctx, - ) -> Result<(Specifier<'s>, Option), ResolveError> { - let parsed = Specifier::parse(specifier).map_err(ResolveError::Specifier)?; - ctx.with_query_fragment(parsed.query, parsed.fragment); - - // There is an edge-case where a request with # can be a path or a fragment -> try both - if ctx.fragment.is_some() && ctx.query.is_none() { - let specifier = parsed.path(); - let fragment = ctx.fragment.take().unwrap(); - let path = format!("{specifier}{fragment}"); - if let Ok(path) = self.require_without_parse(cached_path, &path, ctx) { - return Ok((parsed, Some(path))); - } - ctx.fragment.replace(fragment); - } - Ok((parsed, None)) - } - - fn load_package_self_or_node_modules( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - let (_, subpath) = Self::parse_package_specifier(specifier); - if subpath.is_empty() { - ctx.with_fully_specified(false); - } - // 5. LOAD_PACKAGE_SELF(X, dirname(Y)) - if let Some(path) = self.load_package_self(cached_path, specifier, ctx)? { - return Ok(path); - } - // 6. LOAD_NODE_MODULES(X, dirname(Y)) - if let Some(path) = self.load_node_modules(cached_path, specifier, ctx)? { - return Ok(path); - } - // 7. THROW "not found" - Err(ResolveError::NotFound(specifier.to_string())) - } - - /// LOAD_PACKAGE_IMPORTS(X, DIR) - fn load_package_imports( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - // 1. Find the closest package scope SCOPE to DIR. - // 2. If no scope was found, return. - let Some(package_json) = - cached_path.find_package_json(&self.cache.fs, &self.options, ctx)? - else { - return Ok(None); - }; - // 3. If the SCOPE/package.json "imports" is null or undefined, return. - // 4. let MATCH = PACKAGE_IMPORTS_RESOLVE(X, pathToFileURL(SCOPE), ["node", "require"]) defined in the ESM resolver. - if let Some(path) = self.package_imports_resolve(specifier, &package_json, ctx)? { - // 5. RESOLVE_ESM_MATCH(MATCH). - return self.resolve_esm_match(specifier, &path, ctx); - } - Ok(None) - } - - fn load_as_file(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - // enhanced-resolve feature: extension_alias - if let Some(path) = self.load_extension_alias(cached_path, ctx)? { - return Ok(Some(path)); - } - if self.options.enforce_extension.is_disabled() { - // 1. If X is a file, load X as its file extension format. STOP - if let Some(path) = self.load_alias_or_file(cached_path, ctx)? { - return Ok(Some(path)); - } - } - // 2. If X.js is a file, load X.js as JavaScript text. STOP - // 3. If X.json is a file, parse X.json to a JavaScript Object. STOP - // 4. If X.node is a file, load X.node as binary addon. STOP - if let Some(path) = self.load_extensions(cached_path, &self.options.extensions, ctx)? { - return Ok(Some(path)); - } - Ok(None) - } - - fn load_as_directory(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - // TODO: Only package.json is supported, so warn about having other values - // Checking for empty files is needed for omitting checks on package.json - // 1. If X/package.json is a file, - if !self.options.description_files.is_empty() { - // a. Parse X/package.json, and look for "main" field. - if let Some(package_json) = - cached_path.package_json(&self.cache.fs, &self.options, ctx)? - { - // b. If "main" is a falsy value, GOTO 2. - for main_field in package_json.main_fields(&self.options.main_fields) { - // c. let M = X + (json main field) - let main_field_path = cached_path.path().normalize_with(main_field); - // d. LOAD_AS_FILE(M) - let cached_path = self.cache.value(&main_field_path); - if let Some(path) = self.load_as_file(&cached_path, ctx)? { - return Ok(Some(path)); - } - // e. LOAD_INDEX(M) - if let Some(path) = self.load_index(&cached_path, ctx)? { - return Ok(Some(path)); - } - } - // f. LOAD_INDEX(X) DEPRECATED - // g. THROW "not found" - } - } - // 2. LOAD_INDEX(X) - self.load_index(cached_path, ctx) - } - - fn load_as_file_or_directory( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - if self.options.resolve_to_context { - return Ok(cached_path.is_dir(&self.cache.fs, ctx).then(|| cached_path.clone())); - } - if !specifier.ends_with('/') { - if let Some(path) = self.load_as_file(cached_path, ctx)? { - return Ok(Some(path)); - } - } - if cached_path.is_dir(&self.cache.fs, ctx) { - if let Some(path) = self.load_as_directory(cached_path, ctx)? { - return Ok(Some(path)); - } - } - Ok(None) - } - - fn load_extensions( - &self, - path: &CachedPath, - extensions: &[String], - ctx: &mut Ctx, - ) -> ResolveResult { - if ctx.fully_specified { - return Ok(None); - } - let path = path.path().as_os_str(); - for extension in extensions { - let mut path_with_extension = path.to_os_string(); - path_with_extension.reserve_exact(extension.len()); - path_with_extension.push(extension); - let cached_path = self.cache.value(Path::new(&path_with_extension)); - if let Some(path) = self.load_alias_or_file(&cached_path, ctx)? { - return Ok(Some(path)); - } - } - Ok(None) - } - - fn load_realpath(&self, cached_path: &CachedPath) -> Result { - if self.options.symlinks { - cached_path.realpath(&self.cache.fs).map_err(ResolveError::from) - } else { - Ok(cached_path.to_path_buf()) - } - } - - fn check_restrictions(&self, path: &Path) -> Result<(), ResolveError> { - // https://github.com/webpack/enhanced-resolve/blob/a998c7d218b7a9ec2461fc4fddd1ad5dd7687485/lib/RestrictionsPlugin.js#L19-L24 - fn is_inside(path: &Path, parent: &Path) -> bool { - if !path.starts_with(parent) { - return false; - } - if path.as_os_str().len() == parent.as_os_str().len() { - return true; - } - path.strip_prefix(parent).is_ok_and(|p| p == Path::new("./")) - } - for restriction in &self.options.restrictions { - match restriction { - Restriction::Path(restricted_path) => { - if !is_inside(path, restricted_path) { - return Err(ResolveError::Restriction( - path.to_path_buf(), - restricted_path.clone(), - )); - } - } - Restriction::RegExp(_) => { - return Err(ResolveError::Unimplemented("Restriction with regex")) - } - } - } - Ok(()) - } - - fn load_index(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - for main_file in &self.options.main_files { - let main_path = cached_path.path().normalize_with(main_file); - let cached_path = self.cache.value(&main_path); - if self.options.enforce_extension.is_disabled() { - if let Some(path) = self.load_alias_or_file(&cached_path, ctx)? { - return Ok(Some(path)); - } - } - // 1. If X/index.js is a file, load X/index.js as JavaScript text. STOP - // 2. If X/index.json is a file, parse X/index.json to a JavaScript object. STOP - // 3. If X/index.node is a file, load X/index.node as binary addon. STOP - if let Some(path) = self.load_extensions(&cached_path, &self.options.extensions, ctx)? { - return Ok(Some(path)); - } - } - Ok(None) - } - - fn load_alias_or_file(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - if !self.options.alias_fields.is_empty() { - if let Some(package_json) = - cached_path.find_package_json(&self.cache.fs, &self.options, ctx)? - { - if let Some(path) = - self.load_browser_field(cached_path, None, &package_json, ctx)? - { - return Ok(Some(path)); - } - } - } - // enhanced-resolve: try file as alias - let alias_specifier = cached_path.path().to_string_lossy(); - if let Some(path) = - self.load_alias(cached_path, &alias_specifier, &self.options.alias, ctx)? - { - return Ok(Some(path)); - } - if cached_path.is_file(&self.cache.fs, ctx) { - return Ok(Some(cached_path.clone())); - } - Ok(None) - } - - fn load_node_modules( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - #[cfg(feature = "yarn_pnp")] - { - if let Some(resolved_path) = self.load_pnp(cached_path, specifier, ctx)? { - return Ok(Some(resolved_path)); - } - } - - let (package_name, subpath) = Self::parse_package_specifier(specifier); - // 1. let DIRS = NODE_MODULES_PATHS(START) - // 2. for each DIR in DIRS: - for module_name in &self.options.modules { - for cached_path in std::iter::successors(Some(cached_path), |p| p.parent()) { - // Skip if /path/to/node_modules does not exist - if !cached_path.is_dir(&self.cache.fs, ctx) { - continue; - } - - let Some(cached_path) = self.get_module_directory(cached_path, module_name, ctx) - else { - continue; - }; - // Optimize node_modules lookup by inspecting whether the package exists - // From LOAD_PACKAGE_EXPORTS(X, DIR) - // 1. Try to interpret X as a combination of NAME and SUBPATH where the name - // may have a @scope/ prefix and the subpath begins with a slash (`/`). - if !package_name.is_empty() { - let package_path = cached_path.path().normalize_with(package_name); - let cached_path = self.cache.value(&package_path); - // Try foo/node_modules/package_name - if cached_path.is_dir(&self.cache.fs, ctx) { - // a. LOAD_PACKAGE_EXPORTS(X, DIR) - if let Some(path) = - self.load_package_exports(specifier, subpath, &cached_path, ctx)? - { - return Ok(Some(path)); - } - } else { - // foo/node_modules/package_name is not a directory, so useless to check inside it - if !subpath.is_empty() { - continue; - } - // Skip if the directory lead to the scope package does not exist - // i.e. `foo/node_modules/@scope` is not a directory for `foo/node_modules/@scope/package` - if package_name.starts_with('@') { - if let Some(path) = cached_path.parent() { - if !path.is_dir(&self.cache.fs, ctx) { - continue; - } - } - } - } - } - - // Try as file or directory for all other cases - // b. LOAD_AS_FILE(DIR/X) - // c. LOAD_AS_DIRECTORY(DIR/X) - let node_module_file = cached_path.path().normalize_with(specifier); - let cached_path = self.cache.value(&node_module_file); - if let Some(path) = self.load_as_file_or_directory(&cached_path, specifier, ctx)? { - return Ok(Some(path)); - } - } - } - Ok(None) - } - - #[cfg(feature = "yarn_pnp")] - fn load_pnp( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result, ResolveError> { - let Some(pnp_manifest) = &self.options.pnp_manifest else { return Ok(None) }; - let resolution = - pnp::resolve_to_unqualified_via_manifest(pnp_manifest, specifier, cached_path.path()); - match resolution { - Ok(pnp::Resolution::Resolved(path, subpath)) => { - let cached_path = self.cache.value(&path); - let export_resolution = self.load_package_exports( - specifier, - &subpath.unwrap_or_default(), - &cached_path, - ctx, - )?; - if export_resolution.is_some() { - return Ok(export_resolution); - } - let file_or_directory_resolution = - self.load_as_file_or_directory(&cached_path, specifier, ctx)?; - if file_or_directory_resolution.is_some() { - return Ok(file_or_directory_resolution); - } - Err(ResolveError::NotFound(specifier.to_string())) - } - - Ok(pnp::Resolution::Skipped) => Ok(None), - - Err(_) => { - // Todo: Add a ResolveError::Pnp variant? - Err(ResolveError::NotFound(specifier.to_string())) - } - } - } - - fn get_module_directory( - &self, - cached_path: &CachedPath, - module_name: &str, - ctx: &mut Ctx, - ) -> Option { - if module_name == "node_modules" { - cached_path.cached_node_modules(&self.cache, ctx) - } else if cached_path.path().components().next_back() - == Some(Component::Normal(OsStr::new(module_name))) - { - Some(cached_path.clone()) - } else { - cached_path.module_directory(module_name, &self.cache, ctx) - } - } - - fn load_package_exports( - &self, - specifier: &str, - subpath: &str, - cached_path: &CachedPath, - ctx: &mut Ctx, - ) -> ResolveResult { - // 2. If X does not match this pattern or DIR/NAME/package.json is not a file, - // return. - let Some(package_json) = cached_path.package_json(&self.cache.fs, &self.options, ctx)? - else { - return Ok(None); - }; - // 3. Parse DIR/NAME/package.json, and look for "exports" field. - // 4. If "exports" is null or undefined, return. - // 5. let MATCH = PACKAGE_EXPORTS_RESOLVE(pathToFileURL(DIR/NAME), "." + SUBPATH, - // `package.json` "exports", ["node", "require"]) defined in the ESM resolver. - // Note: The subpath is not prepended with a dot on purpose - for exports in package_json.exports_fields(&self.options.exports_fields) { - if let Some(path) = self.package_exports_resolve( - cached_path.path(), - &format!(".{subpath}"), - exports, - ctx, - )? { - // 6. RESOLVE_ESM_MATCH(MATCH) - return self.resolve_esm_match(specifier, &path, ctx); - }; - } - Ok(None) - } - - fn load_package_self( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - // 1. Find the closest package scope SCOPE to DIR. - // 2. If no scope was found, return. - let Some(package_json) = - cached_path.find_package_json(&self.cache.fs, &self.options, ctx)? - else { - return Ok(None); - }; - // 3. If the SCOPE/package.json "exports" is null or undefined, return. - // 4. If the SCOPE/package.json "name" is not the first segment of X, return. - if let Some(subpath) = package_json - .name - .as_ref() - .and_then(|package_name| Self::strip_package_name(specifier, package_name)) - { - // 5. let MATCH = PACKAGE_EXPORTS_RESOLVE(pathToFileURL(SCOPE), - // "." + X.slice("name".length), `package.json` "exports", ["node", "require"]) - // defined in the ESM resolver. - let package_url = package_json.directory(); - // Note: The subpath is not prepended with a dot on purpose - // because `package_exports_resolve` matches subpath without the leading dot. - for exports in package_json.exports_fields(&self.options.exports_fields) { - if let Some(cached_path) = - self.package_exports_resolve(package_url, &format!(".{subpath}"), exports, ctx)? - { - // 6. RESOLVE_ESM_MATCH(MATCH) - return self.resolve_esm_match(specifier, &cached_path, ctx); - } - } - } - self.load_browser_field(cached_path, Some(specifier), &package_json, ctx) - } - - /// RESOLVE_ESM_MATCH(MATCH) - fn resolve_esm_match( - &self, - specifier: &str, - cached_path: &CachedPath, - ctx: &mut Ctx, - ) -> ResolveResult { - // 1. let RESOLVED_PATH = fileURLToPath(MATCH) - // 2. If the file at RESOLVED_PATH exists, load RESOLVED_PATH as its extension format. STOP - // - // Non-compliant ESM can result in a directory, so directory is tried as well. - if let Some(path) = self.load_as_file_or_directory(cached_path, "", ctx)? { - return Ok(Some(path)); - } - // 3. THROW "not found" - Err(ResolveError::NotFound(specifier.to_string())) - } - - /// enhanced-resolve: AliasFieldPlugin for [ResolveOptions::alias_fields] - fn load_browser_field( - &self, - cached_path: &CachedPath, - module_specifier: Option<&str>, - package_json: &PackageJson, - ctx: &mut Ctx, - ) -> ResolveResult { - let path = cached_path.path(); - let Some(new_specifier) = package_json.resolve_browser_field( - path, - module_specifier, - &self.options.alias_fields, - )? - else { - return Ok(None); - }; - // Abort when resolving recursive module - if module_specifier.is_some_and(|s| s == new_specifier) { - return Ok(None); - } - if ctx.resolving_alias.as_ref().is_some_and(|s| s == new_specifier) { - // Complete when resolving to self `{"./a.js": "./a.js"}` - if new_specifier.strip_prefix("./").filter(|s| path.ends_with(Path::new(s))).is_some() { - return if cached_path.is_file(&self.cache.fs, ctx) { - Ok(Some(cached_path.clone())) - } else { - Err(ResolveError::NotFound(new_specifier.to_string())) - }; - } - return Err(ResolveError::Recursion); - } - ctx.with_resolving_alias(new_specifier.to_string()); - ctx.with_fully_specified(false); - let cached_path = self.cache.value(package_json.directory()); - self.require(&cached_path, new_specifier, ctx).map(Some) - } - - /// enhanced-resolve: AliasPlugin for [ResolveOptions::alias] and [ResolveOptions::fallback]. - fn load_alias( - &self, - cached_path: &CachedPath, - specifier: &str, - aliases: &Alias, - ctx: &mut Ctx, - ) -> ResolveResult { - for (alias_key_raw, specifiers) in aliases { - let alias_key = if let Some(alias_key) = alias_key_raw.strip_suffix('$') { - if alias_key != specifier { - continue; - } - alias_key - } else { - let strip_package_name = Self::strip_package_name(specifier, alias_key_raw); - if strip_package_name.is_none() { - continue; - } - alias_key_raw - }; - // It should stop resolving when all of the tried alias values - // failed to resolve. - // - let mut should_stop = false; - for r in specifiers { - match r { - AliasValue::Path(alias_value) => { - if let Some(path) = self.load_alias_value( - cached_path, - alias_key, - alias_value, - specifier, - ctx, - &mut should_stop, - )? { - return Ok(Some(path)); - } - } - AliasValue::Ignore => { - let path = cached_path.path().normalize_with(alias_key); - return Err(ResolveError::Ignored(path)); - } - } - } - if should_stop { - return Err(ResolveError::MatchedAliasNotFound( - specifier.to_string(), - alias_key.to_string(), - )); - } - } - Ok(None) - } - - fn load_alias_value( - &self, - cached_path: &CachedPath, - alias_key: &str, - alias_value: &str, - request: &str, - ctx: &mut Ctx, - should_stop: &mut bool, - ) -> ResolveResult { - if request != alias_value - && !request.strip_prefix(alias_value).is_some_and(|prefix| prefix.starts_with('/')) - { - let tail = &request[alias_key.len()..]; - - let new_specifier = if tail.is_empty() { - Cow::Borrowed(alias_value) - } else { - let alias_value = Path::new(alias_value).normalize(); - // Must not append anything to alias_value if it is a file. - let alias_value_cached_path = self.cache.value(&alias_value); - if alias_value_cached_path.is_file(&self.cache.fs, ctx) { - return Ok(None); - } - - // Remove the leading slash so the final path is concatenated. - let tail = tail.trim_start_matches(SLASH_START); - let normalized = alias_value.normalize_with(tail); - Cow::Owned(normalized.to_string_lossy().to_string()) - }; - - *should_stop = true; - ctx.with_fully_specified(false); - return match self.require(cached_path, new_specifier.as_ref(), ctx) { - Err(ResolveError::NotFound(_) | ResolveError::MatchedAliasNotFound(_, _)) => { - Ok(None) - } - Ok(path) => return Ok(Some(path)), - Err(err) => return Err(err), - }; - } - Ok(None) - } - - /// Given an extension alias map `{".js": [".ts", ".js"]}`, - /// load the mapping instead of the provided extension - /// - /// This is an enhanced-resolve feature - /// - /// # Errors - /// - /// * [ResolveError::ExtensionAlias]: When all of the aliased extensions are not found - fn load_extension_alias(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - if self.options.extension_alias.is_empty() { - return Ok(None); - } - let Some(path_extension) = cached_path.path().extension() else { - return Ok(None); - }; - let Some((_, extensions)) = self - .options - .extension_alias - .iter() - .find(|(ext, _)| OsStr::new(ext.trim_start_matches('.')) == path_extension) - else { - return Ok(None); - }; - let path = cached_path.path().with_extension(""); - let path = path.as_os_str(); - ctx.with_fully_specified(true); - for extension in extensions { - let mut path_with_extension = path.to_os_string(); - path_with_extension.reserve_exact(extension.len()); - path_with_extension.push(extension); - let cached_path = self.cache.value(Path::new(&path_with_extension)); - // Bail if path is module directory such as `ipaddr.js` - if cached_path.is_dir(&self.cache.fs, ctx) { - ctx.with_fully_specified(false); - return Ok(None); - } - if let Some(path) = self.load_alias_or_file(&cached_path, ctx)? { - ctx.with_fully_specified(false); - return Ok(Some(path)); - } - } - Err(ResolveError::ExtensionAlias(cached_path.to_path_buf())) - } - - /// enhanced-resolve: RootsPlugin - /// - /// A list of directories where requests of server-relative URLs (starting with '/') are resolved, - /// defaults to context configuration option. - /// - /// On non-Windows systems these requests are resolved as an absolute path first. - fn load_roots(&self, specifier: &str, ctx: &mut Ctx) -> Option { - if self.options.roots.is_empty() { - return None; - } - if let Some(specifier) = specifier.strip_prefix(SLASH_START) { - for root in &self.options.roots { - let cached_path = self.cache.value(root); - if let Ok(path) = self.require_relative(&cached_path, specifier, ctx) { - return Some(path); - } - } - } - None - } - - fn load_tsconfig_paths( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - let Some(tsconfig_options) = &self.options.tsconfig else { - return Ok(None); - }; - let tsconfig = self.load_tsconfig( - /* root */ true, - &tsconfig_options.config_file, - &tsconfig_options.references, - )?; - let paths = tsconfig.resolve(cached_path.path(), specifier); - for path in paths { - let cached_path = self.cache.value(&path); - if let Ok(path) = self.require_relative(&cached_path, ".", ctx) { - return Ok(Some(path)); - } - } - Ok(None) - } - - fn load_tsconfig( - &self, - root: bool, - path: &Path, - references: &TsconfigReferences, - ) -> Result, ResolveError> { - self.cache.tsconfig(root, path, |tsconfig| { - let directory = self.cache.value(tsconfig.directory()); - tracing::trace!(tsconfig = ?tsconfig, "load_tsconfig"); - - // Extend tsconfig - if let Some(extends) = &tsconfig.extends { - let extended_tsconfig_paths = match extends { - ExtendsField::Single(s) => { - vec![self.get_extended_tsconfig_path(&directory, tsconfig, s)?] - } - ExtendsField::Multiple(specifiers) => specifiers - .iter() - .map(|s| self.get_extended_tsconfig_path(&directory, tsconfig, s)) - .collect::, ResolveError>>()?, - }; - for extended_tsconfig_path in extended_tsconfig_paths { - let extended_tsconfig = self.load_tsconfig( - /* root */ false, - &extended_tsconfig_path, - &TsconfigReferences::Disabled, - )?; - tsconfig.extend_tsconfig(&extended_tsconfig); - } - } - - // Load project references - match references { - TsconfigReferences::Disabled => { - tsconfig.references.drain(..); - } - TsconfigReferences::Auto => {} - TsconfigReferences::Paths(paths) => { - tsconfig.references = paths - .iter() - .map(|path| ProjectReference { path: path.clone(), tsconfig: None }) - .collect(); - } - } - if !tsconfig.references.is_empty() { - let directory = tsconfig.directory().to_path_buf(); - for reference in &mut tsconfig.references { - let reference_tsconfig_path = directory.normalize_with(&reference.path); - let tsconfig = self.cache.tsconfig( - /* root */ true, - &reference_tsconfig_path, - |reference_tsconfig| { - if reference_tsconfig.path == tsconfig.path { - return Err(ResolveError::TsconfigSelfReference( - reference_tsconfig.path.clone(), - )); - } - Ok(()) - }, - )?; - reference.tsconfig.replace(tsconfig); - } - } - Ok(()) - }) - } - - fn get_extended_tsconfig_path( - &self, - directory: &CachedPath, - tsconfig: &TsConfig, - specifier: &str, - ) -> Result { - match specifier.as_bytes().first() { - None => Err(ResolveError::Specifier(SpecifierError::Empty(specifier.to_string()))), - Some(b'/') => Ok(PathBuf::from(specifier)), - Some(b'.') => Ok(tsconfig.directory().normalize_with(specifier)), - _ => self - .clone_with_options(ResolveOptions { - description_files: vec![], - extensions: vec![".json".into()], - main_files: vec!["tsconfig.json".into()], - ..ResolveOptions::default() - }) - .load_package_self_or_node_modules(directory, specifier, &mut Ctx::default()) - .map(|p| p.to_path_buf()) - .map_err(|err| match err { - ResolveError::NotFound(_) => { - ResolveError::TsconfigNotFound(PathBuf::from(specifier)) - } - _ => err, - }), - } - } - - /// PACKAGE_RESOLVE(packageSpecifier, parentURL) - fn package_resolve( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - let (package_name, subpath) = Self::parse_package_specifier(specifier); - - // 3. If packageSpecifier is a Node.js builtin module name, then - // 1. Return the string "node:" concatenated with packageSpecifier. - self.require_core(package_name)?; - - // 11. While parentURL is not the file system root, - for module_name in &self.options.modules { - for cached_path in std::iter::successors(Some(cached_path), |p| p.parent()) { - // 1. Let packageURL be the URL resolution of "node_modules/" concatenated with packageSpecifier, relative to parentURL. - let Some(cached_path) = self.get_module_directory(cached_path, module_name, ctx) - else { - continue; - }; - // 2. Set parentURL to the parent folder URL of parentURL. - let package_path = cached_path.path().normalize_with(package_name); - let cached_path = self.cache.value(&package_path); - // 3. If the folder at packageURL does not exist, then - // 1. Continue the next loop iteration. - if cached_path.is_dir(&self.cache.fs, ctx) { - // 4. Let pjson be the result of READ_PACKAGE_JSON(packageURL). - if let Some(package_json) = - cached_path.package_json(&self.cache.fs, &self.options, ctx)? - { - // 5. If pjson is not null and pjson.exports is not null or undefined, then - // 1. Return the result of PACKAGE_EXPORTS_RESOLVE(packageURL, packageSubpath, pjson.exports, defaultConditions). - for exports in package_json.exports_fields(&self.options.exports_fields) { - if let Some(path) = self.package_exports_resolve( - cached_path.path(), - &format!(".{subpath}"), - exports, - ctx, - )? { - return Ok(Some(path)); - } - } - // 6. Otherwise, if packageSubpath is equal to ".", then - if subpath == "." { - // 1. If pjson.main is a string, then - for main_field in package_json.main_fields(&self.options.main_fields) { - // 1. Return the URL resolution of main in packageURL. - let path = cached_path.path().normalize_with(main_field); - let cached_path = self.cache.value(&path); - if cached_path.is_file(&self.cache.fs, ctx) { - return Ok(Some(cached_path)); - } - } - } - } - let subpath = format!(".{subpath}"); - ctx.with_fully_specified(false); - return self.require(&cached_path, &subpath, ctx).map(Some); - } - } - } - - Err(ResolveError::NotFound(specifier.to_string())) - } - - /// PACKAGE_EXPORTS_RESOLVE(packageURL, subpath, exports, conditions) - fn package_exports_resolve( - &self, - package_url: &Path, - subpath: &str, - exports: &JSONValue, - ctx: &mut Ctx, - ) -> ResolveResult { - let conditions = &self.options.condition_names; - // 1. If exports is an Object with both a key starting with "." and a key not starting with ".", throw an Invalid Package Configuration error. - if let JSONValue::Object(map) = exports { - let mut has_dot = false; - let mut without_dot = false; - for key in map.keys() { - let starts_with_dot_or_hash = key.starts_with(['.', '#']); - has_dot = has_dot || starts_with_dot_or_hash; - without_dot = without_dot || !starts_with_dot_or_hash; - if has_dot && without_dot { - return Err(ResolveError::InvalidPackageConfig( - package_url.join("package.json"), - )); - } - } - } - // 2. If subpath is equal to ".", then - // Note: subpath is not prepended with a dot when passed in. - if subpath == "." { - // enhanced-resolve appends query and fragment when resolving exports field - // https://github.com/webpack/enhanced-resolve/blob/a998c7d218b7a9ec2461fc4fddd1ad5dd7687485/lib/ExportsFieldPlugin.js#L57-L62 - // This is only need when querying the main export, otherwise ctx is passed through. - if ctx.query.is_some() || ctx.fragment.is_some() { - let query = ctx.query.clone().unwrap_or_default(); - let fragment = ctx.fragment.clone().unwrap_or_default(); - return Err(ResolveError::PackagePathNotExported( - format!("./{}{query}{fragment}", subpath.trim_start_matches('.')), - package_url.join("package.json"), - )); - } - // 1. Let mainExport be undefined. - let main_export = match exports { - // 2. If exports is a String or Array, or an Object containing no keys starting with ".", then - JSONValue::String(_) | JSONValue::Array(_) => { - // 1. Set mainExport to exports. - Some(exports) - } - // 3. Otherwise if exports is an Object containing a "." property, then - JSONValue::Object(map) => { - // 1. Set mainExport to exports["."]. - map.get(".").map_or_else( - || { - if map.keys().any(|key| key.starts_with("./") || key.starts_with('#')) { - None - } else { - Some(exports) - } - }, - Some, - ) - } - _ => None, - }; - // 4. If mainExport is not undefined, then - if let Some(main_export) = main_export { - // 1. Let resolved be the result of PACKAGE_TARGET_RESOLVE( packageURL, mainExport, null, false, conditions). - let resolved = self.package_target_resolve( - package_url, - ".", - main_export, - None, - /* is_imports */ false, - conditions, - ctx, - )?; - // 2. If resolved is not null or undefined, return resolved. - if let Some(path) = resolved { - return Ok(Some(path)); - } - } - } - // 3. Otherwise, if exports is an Object and all keys of exports start with ".", then - if let JSONValue::Object(exports) = exports { - // 1. Let matchKey be the string "./" concatenated with subpath. - // Note: `package_imports_exports_resolve` does not require the leading dot. - let match_key = &subpath; - // 2. Let resolved be the result of PACKAGE_IMPORTS_EXPORTS_RESOLVE( matchKey, exports, packageURL, false, conditions). - if let Some(path) = self.package_imports_exports_resolve( - match_key, - exports, - package_url, - /* is_imports */ false, - conditions, - ctx, - )? { - // 3. If resolved is not null or undefined, return resolved. - return Ok(Some(path)); - } - } - // 4. Throw a Package Path Not Exported error. - Err(ResolveError::PackagePathNotExported( - subpath.to_string(), - package_url.join("package.json"), - )) - } - - /// PACKAGE_IMPORTS_RESOLVE(specifier, parentURL, conditions) - fn package_imports_resolve( - &self, - specifier: &str, - package_json: &PackageJson, - ctx: &mut Ctx, - ) -> Result, ResolveError> { - // 1. Assert: specifier begins with "#". - debug_assert!(specifier.starts_with('#'), "{specifier}"); - // 2. If specifier is exactly equal to "#" or starts with "#/", then - // 1. Throw an Invalid Module Specifier error. - // 3. Let packageURL be the result of LOOKUP_PACKAGE_SCOPE(parentURL). - // 4. If packageURL is not null, then - - // 1. Let pjson be the result of READ_PACKAGE_JSON(packageURL). - // 2. If pjson.imports is a non-null Object, then - - // 1. Let resolved be the result of PACKAGE_IMPORTS_EXPORTS_RESOLVE( specifier, pjson.imports, packageURL, true, conditions). - let mut has_imports = false; - for imports in package_json.imports_fields(&self.options.imports_fields) { - if !has_imports { - has_imports = true; - // TODO: fill in test case for this case - if specifier == "#" || specifier.starts_with("#/") { - return Err(ResolveError::InvalidModuleSpecifier( - specifier.to_string(), - package_json.path.clone(), - )); - } - } - if let Some(path) = self.package_imports_exports_resolve( - specifier, - imports, - package_json.directory(), - /* is_imports */ true, - &self.options.condition_names, - ctx, - )? { - // 2. If resolved is not null or undefined, return resolved. - return Ok(Some(path)); - } - } - - // 5. Throw a Package Import Not Defined error. - if has_imports { - Err(ResolveError::PackageImportNotDefined( - specifier.to_string(), - package_json.path.clone(), - )) - } else { - Ok(None) - } - } - - /// PACKAGE_IMPORTS_EXPORTS_RESOLVE(matchKey, matchObj, packageURL, isImports, conditions) - fn package_imports_exports_resolve( - &self, - match_key: &str, - match_obj: &JSONMap, - package_url: &Path, - is_imports: bool, - conditions: &[String], - ctx: &mut Ctx, - ) -> ResolveResult { - // enhanced-resolve behaves differently, it throws - // Error: CachedPath to directories is not possible with the exports field (specifier was ./dist/) - if match_key.ends_with('/') { - return Ok(None); - } - // 1. If matchKey is a key of matchObj and does not contain "*", then - if !match_key.contains('*') { - // 1. Let target be the value of matchObj[matchKey]. - if let Some(target) = match_obj.get(match_key) { - // 2. Return the result of PACKAGE_TARGET_RESOLVE(packageURL, target, null, isImports, conditions). - return self.package_target_resolve( - package_url, - match_key, - target, - None, - is_imports, - conditions, - ctx, - ); - } - } - - let mut best_target = None; - let mut best_match = ""; - let mut best_key = ""; - // 2. Let expansionKeys be the list of keys of matchObj containing only a single "*", sorted by the sorting function PATTERN_KEY_COMPARE which orders in descending order of specificity. - // 3. For each key expansionKey in expansionKeys, do - for (expansion_key, target) in match_obj { - if expansion_key.starts_with("./") || expansion_key.starts_with('#') { - // 1. Let patternBase be the substring of expansionKey up to but excluding the first "*" character. - if let Some((pattern_base, pattern_trailer)) = expansion_key.split_once('*') { - // 2. If matchKey starts with but is not equal to patternBase, then - if match_key.starts_with(pattern_base) - // 1. Let patternTrailer be the substring of expansionKey from the index after the first "*" character. - && !pattern_trailer.contains('*') - // 2. If patternTrailer has zero length, or if matchKey ends with patternTrailer and the length of matchKey is greater than or equal to the length of expansionKey, then - && (pattern_trailer.is_empty() - || (match_key.len() >= expansion_key.len() - && match_key.ends_with(pattern_trailer))) - && Self::pattern_key_compare(best_key, expansion_key).is_gt() - { - // 1. Let target be the value of matchObj[expansionKey]. - best_target = Some(target); - // 2. Let patternMatch be the substring of matchKey starting at the index of the length of patternBase up to the length of matchKey minus the length of patternTrailer. - best_match = - &match_key[pattern_base.len()..match_key.len() - pattern_trailer.len()]; - best_key = expansion_key; - } - } else if expansion_key.ends_with('/') - && match_key.starts_with(expansion_key) - && Self::pattern_key_compare(best_key, expansion_key).is_gt() - { - // TODO: [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./dist/" in the "exports" field module resolution of the package at xxx/package.json. - best_target = Some(target); - best_match = &match_key[expansion_key.len()..]; - best_key = expansion_key; - } - } - } - if let Some(best_target) = best_target { - // 3. Return the result of PACKAGE_TARGET_RESOLVE(packageURL, target, patternMatch, isImports, conditions). - return self.package_target_resolve( - package_url, - best_key, - best_target, - Some(best_match), - is_imports, - conditions, - ctx, - ); - } - // 4. Return null. - Ok(None) - } - - /// PACKAGE_TARGET_RESOLVE(packageURL, target, patternMatch, isImports, conditions) - #[allow(clippy::too_many_arguments)] - fn package_target_resolve( - &self, - package_url: &Path, - target_key: &str, - target: &JSONValue, - pattern_match: Option<&str>, - is_imports: bool, - conditions: &[String], - ctx: &mut Ctx, - ) -> ResolveResult { - fn normalize_string_target<'a>( - target_key: &'a str, - target: &'a str, - pattern_match: Option<&'a str>, - package_url: &Path, - ) -> Result, ResolveError> { - let target = if let Some(pattern_match) = pattern_match { - if !target_key.contains('*') && !target.contains('*') { - // enhanced-resolve behaviour - // TODO: [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./dist/" in the "exports" field module resolution of the package at xxx/package.json. - if target_key.ends_with('/') && target.ends_with('/') { - Cow::Owned(format!("{target}{pattern_match}")) - } else { - return Err(ResolveError::InvalidPackageConfigDirectory( - package_url.join("package.json"), - )); - } - } else { - Cow::Owned(target.replace('*', pattern_match)) - } - } else { - Cow::Borrowed(target) - }; - Ok(target) - } - - match target { - // 1. If target is a String, then - JSONValue::String(target) => { - // 1. If target does not start with "./", then - if !target.starts_with("./") { - // 1. If isImports is false, or if target starts with "../" or "/", or if target is a valid URL, then - if !is_imports || target.starts_with("../") || target.starts_with('/') { - // 1. Throw an Invalid Package Target error. - return Err(ResolveError::InvalidPackageTarget( - target.to_string(), - target_key.to_string(), - package_url.join("package.json"), - )); - } - // 2. If patternMatch is a String, then - // 1. Return PACKAGE_RESOLVE(target with every instance of "*" replaced by patternMatch, packageURL + "/"). - let target = - normalize_string_target(target_key, target, pattern_match, package_url)?; - let package_url = self.cache.value(package_url); - // // 3. Return PACKAGE_RESOLVE(target, packageURL + "/"). - return self.package_resolve(&package_url, &target, ctx); - } - - // 2. If target split on "/" or "\" contains any "", ".", "..", or "node_modules" segments after the first "." segment, case insensitive and including percent encoded variants, throw an Invalid Package Target error. - // 3. Let resolvedTarget be the URL resolution of the concatenation of packageURL and target. - // 4. Assert: resolvedTarget is contained in packageURL. - // 5. If patternMatch is null, then - let target = - normalize_string_target(target_key, target, pattern_match, package_url)?; - if Path::new(target.as_ref()).is_invalid_exports_target() { - return Err(ResolveError::InvalidPackageTarget( - target.to_string(), - target_key.to_string(), - package_url.join("package.json"), - )); - } - let resolved_target = package_url.normalize_with(target.as_ref()); - // 6. If patternMatch split on "/" or "\" contains any "", ".", "..", or "node_modules" segments, case insensitive and including percent encoded variants, throw an Invalid Module Specifier error. - // 7. Return the URL resolution of resolvedTarget with every instance of "*" replaced with patternMatch. - let value = self.cache.value(&resolved_target); - return Ok(Some(value)); - } - // 2. Otherwise, if target is a non-null Object, then - JSONValue::Object(target) => { - // 1. If exports contains any index property keys, as defined in ECMA-262 6.1.7 Array Index, throw an Invalid Package Configuration error. - // 2. For each property p of target, in object insertion order as, - for (key, target_value) in target { - // 1. If p equals "default" or conditions contains an entry for p, then - if key == "default" || conditions.contains(key) { - // 1. Let targetValue be the value of the p property in target. - // 2. Let resolved be the result of PACKAGE_TARGET_RESOLVE( packageURL, targetValue, patternMatch, isImports, conditions). - let resolved = self.package_target_resolve( - package_url, - target_key, - target_value, - pattern_match, - is_imports, - conditions, - ctx, - ); - // 3. If resolved is equal to undefined, continue the loop. - if let Some(path) = resolved? { - // 4. Return resolved. - return Ok(Some(path)); - } - } - } - // 3. Return undefined. - return Ok(None); - } - // 3. Otherwise, if target is an Array, then - JSONValue::Array(targets) => { - // 1. If _target.length is zero, return null. - if targets.is_empty() { - // Note: return PackagePathNotExported has the same effect as return because there are no matches. - return Err(ResolveError::PackagePathNotExported( - pattern_match.unwrap_or(".").to_string(), - package_url.join("package.json"), - )); - } - // 2. For each item targetValue in target, do - for (i, target_value) in targets.iter().enumerate() { - // 1. Let resolved be the result of PACKAGE_TARGET_RESOLVE( packageURL, targetValue, patternMatch, isImports, conditions), continuing the loop on any Invalid Package Target error. - let resolved = self.package_target_resolve( - package_url, - target_key, - target_value, - pattern_match, - is_imports, - conditions, - ctx, - ); - - if resolved.is_err() && i == targets.len() { - return resolved; - } - - // 2. If resolved is undefined, continue the loop. - if let Ok(Some(path)) = resolved { - // 3. Return resolved. - return Ok(Some(path)); - } - } - // 3. Return or throw the last fallback resolution null return or error. - // Note: see `resolved.is_err() && i == targets.len()` - } - _ => {} - } - // 4. Otherwise, if target is null, return null. - Ok(None) - // 5. Otherwise throw an Invalid Package Target error. - } - - // Returns (module, subpath) - // https://github.com/nodejs/node/blob/8f0f17e1e3b6c4e58ce748e06343c5304062c491/lib/internal/modules/esm/resolve.js#L688 - fn parse_package_specifier(specifier: &str) -> (&str, &str) { - let mut separator_index = specifier.as_bytes().iter().position(|b| *b == b'/'); - // let mut valid_package_name = true; - // let mut is_scoped = false; - if specifier.starts_with('@') { - // is_scoped = true; - if separator_index.is_none() || specifier.is_empty() { - // valid_package_name = false; - } else if let Some(index) = &separator_index { - separator_index = specifier[*index + 1..] - .as_bytes() - .iter() - .position(|b| *b == b'/') - .map(|i| i + *index + 1); - } - } - let package_name = - separator_index.map_or(specifier, |separator_index| &specifier[..separator_index]); - - // TODO: https://github.com/nodejs/node/blob/8f0f17e1e3b6c4e58ce748e06343c5304062c491/lib/internal/modules/esm/resolve.js#L705C1-L714C1 - // Package name cannot have leading . and cannot have percent-encoding or - // \\ separators. - // if (RegExpPrototypeExec(invalidPackageNameRegEx, packageName) !== null) - // validPackageName = false; - - // if (!validPackageName) { - // throw new ERR_INVALID_MODULE_SPECIFIER( - // specifier, 'is not a valid package name', fileURLToPath(base)); - // } - let package_subpath = - separator_index.map_or("", |separator_index| &specifier[separator_index..]); - (package_name, package_subpath) - } - - /// PATTERN_KEY_COMPARE(keyA, keyB) - fn pattern_key_compare(key_a: &str, key_b: &str) -> Ordering { - if key_a.is_empty() { - return Ordering::Greater; - } - // 1. Assert: keyA ends with "/" or contains only a single "*". - debug_assert!(key_a.ends_with('/') || key_a.match_indices('*').count() == 1, "{key_a}"); - // 2. Assert: keyB ends with "/" or contains only a single "*". - debug_assert!(key_b.ends_with('/') || key_b.match_indices('*').count() == 1, "{key_b}"); - // 3. Let baseLengthA be the index of "*" in keyA plus one, if keyA contains "*", or the length of keyA otherwise. - let a_pos = key_a.chars().position(|c| c == '*'); - let base_length_a = a_pos.map_or(key_a.len(), |p| p + 1); - // 4. Let baseLengthB be the index of "*" in keyB plus one, if keyB contains "*", or the length of keyB otherwise. - let b_pos = key_b.chars().position(|c| c == '*'); - let base_length_b = b_pos.map_or(key_b.len(), |p| p + 1); - // 5. If baseLengthA is greater than baseLengthB, return -1. - if base_length_a > base_length_b { - return Ordering::Less; - } - // 6. If baseLengthB is greater than baseLengthA, return 1. - if base_length_b > base_length_a { - return Ordering::Greater; - } - // 7. If keyA does not contain "*", return 1. - if !key_a.contains('*') { - return Ordering::Greater; - } - // 8. If keyB does not contain "*", return -1. - if !key_b.contains('*') { - return Ordering::Less; - } - // 9. If the length of keyA is greater than the length of keyB, return -1. - if key_a.len() > key_b.len() { - return Ordering::Less; - } - // 10. If the length of keyB is greater than the length of keyA, return 1. - if key_b.len() > key_a.len() { - return Ordering::Greater; - } - // 11. Return 0. - Ordering::Equal - } - - fn strip_package_name<'a>(specifier: &'a str, package_name: &'a str) -> Option<&'a str> { - specifier - .strip_prefix(package_name) - .filter(|tail| tail.is_empty() || tail.starts_with(SLASH_START)) - } -} diff --git a/src/options.rs b/src/options.rs deleted file mode 100644 index 7893890e..00000000 --- a/src/options.rs +++ /dev/null @@ -1,633 +0,0 @@ -use std::path::Path; -use std::{fmt, path::PathBuf}; - -/// Module Resolution Options -/// -/// Options are directly ported from [enhanced-resolve](https://github.com/webpack/enhanced-resolve#resolver-options). -/// -/// See [webpack resolve](https://webpack.js.org/configuration/resolve/) for information and examples -#[derive(Debug, Clone)] -pub struct ResolveOptions { - /// Path to TypeScript configuration file. - /// - /// Default `None` - pub tsconfig: Option, - - /// Create aliases to import or require certain modules more easily. - /// - /// An alias is used to replace a whole path or part of a path. - /// For example, to alias a commonly used `src/` folders: `vec![("@/src"), vec![AliasValue::Path("/path/to/src")]]` - /// - /// A trailing $ can also be added to the given object's keys to signify an exact match. - /// - /// See [webpack's `resolve.alias` documentation](https://webpack.js.org/configuration/resolve/#resolvealias) for a list of use cases. - pub alias: Alias, - - /// A list of alias fields in description files. - /// - /// Specify a field, such as `browser`, to be parsed according to [this specification](https://github.com/defunctzombie/package-browser-field-spec). - /// Can be a path to json object such as `["path", "to", "exports"]`. - /// - /// Default `[]` - pub alias_fields: Vec>, - - /// Condition names for exports field which defines entry points of a package. - /// - /// The key order in the exports field is significant. During condition matching, earlier entries have higher priority and take precedence over later entries. - /// - /// Default `[]` - pub condition_names: Vec, - - /// The JSON files to use for descriptions. (There was once a `bower.json`.) - /// - /// Default `["package.json"]` - pub description_files: Vec, - - /// Set to [EnforceExtension::Enabled] for [ESM Mandatory file extensions](https://nodejs.org/api/esm.html#mandatory-file-extensions). - /// - /// If `enforce_extension` is set to [EnforceExtension::Enabled], resolution will not allow extension-less files. - /// This means `require('./foo.js')` will resolve, while `require('./foo')` will not. - /// - /// The default value for `enforce_extension` is [EnforceExtension::Auto], which is changed upon initialization. - /// - /// It changes to [EnforceExtension::Enabled] if [ResolveOptions::extensions] contains an empty string; - /// otherwise, this value changes to [EnforceExtension::Disabled]. - /// - /// Explicitly set the value to [EnforceExtension::Disabled] to disable this automatic behavior. - /// - /// For reference, this behavior is aligned with `enhanced-resolve`. See . - pub enforce_extension: EnforceExtension, - - /// A list of exports fields in description files. - /// - /// Can be a path to a JSON object such as `["path", "to", "exports"]`. - /// - /// Default `[["exports"]]`. - pub exports_fields: Vec>, - - /// Fields from `package.json` which are used to provide the internal requests of a package - /// (requests starting with # are considered internal). - /// - /// Can be a path to a JSON object such as `["path", "to", "imports"]`. - /// - /// Default `[["imports"]]`. - pub imports_fields: Vec>, - - /// An object which maps extension to extension aliases. - /// - /// Default `{}` - pub extension_alias: Vec<(String, Vec)>, - - /// Attempt to resolve these extensions in order. - /// - /// If multiple files share the same name but have different extensions, - /// will resolve the one with the extension listed first in the array and skip the rest. - /// - /// All extensions must have a leading dot. - /// - /// Default `[".js", ".json", ".node"]` - pub extensions: Vec, - - /// Redirect module requests when normal resolving fails. - /// - /// Default `[]` - pub fallback: Alias, - - /// 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). - /// - /// See also webpack configuration [resolve.fullySpecified](https://webpack.js.org/configuration/module/#resolvefullyspecified) - /// - /// Default `false` - pub fully_specified: bool, - - /// A list of main fields in description files - /// - /// Default `["main"]`. - pub main_fields: Vec, - - /// The filename to be used while resolving directories. - /// - /// Default `["index"]` - pub main_files: Vec, - - /// A list of directories to resolve modules from, can be absolute path or folder name. - /// - /// Default `["node_modules"]` - pub modules: Vec, - - /// A manifest loaded from pnp::load_pnp_manifest. - /// - /// Default `None` - #[cfg(feature = "yarn_pnp")] - pub pnp_manifest: Option, - - /// Resolve to a context instead of a file. - /// - /// Default `false` - pub resolve_to_context: bool, - - /// Prefer to resolve module requests as relative requests instead of using modules from node_modules directories. - /// - /// Default `false` - pub prefer_relative: bool, - - /// Prefer to resolve server-relative urls as absolute paths before falling back to resolve in ResolveOptions::roots. - /// - /// Default `false` - pub prefer_absolute: bool, - - /// A list of resolve restrictions to restrict the paths that a request can be resolved on. - /// - /// Default `[]` - pub restrictions: Vec, - - /// A list of directories where requests of server-relative URLs (starting with '/') are resolved. - /// On non-Windows systems these requests are resolved as an absolute path first. - /// - /// Default `[]` - pub roots: Vec, - - /// Whether to resolve symlinks to their symlinked location. - /// When enabled, symlinked resources are resolved to their real path, not their symlinked location. - /// Note that this may cause module resolution to fail when using tools that symlink packages (like npm link). - /// - /// Default `true` - pub symlinks: bool, - - /// Whether to parse [module.builtinModules](https://nodejs.org/api/module.html#modulebuiltinmodules) or not. - /// For example, "zlib" will throw [crate::ResolveError::Builtin] when set to true. - /// - /// Default `false` - pub builtin_modules: bool, -} - -impl ResolveOptions { - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// - /// let options = ResolveOptions::default().with_condition_names(&["bar"]); - /// assert_eq!(options.condition_names, vec!["bar".to_string()]) - /// ``` - #[must_use] - pub fn with_condition_names(mut self, names: &[&str]) -> Self { - self.condition_names = names.iter().map(ToString::to_string).collect::>(); - self - } - - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// - /// let options = ResolveOptions::default().with_builtin_modules(false); - /// assert_eq!(options.builtin_modules, false) - /// ``` - #[must_use] - pub fn with_builtin_modules(mut self, flag: bool) -> Self { - self.builtin_modules = flag; - self - } - - /// Adds a single root to the options - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_root("foo"); - /// assert_eq!(options.roots, vec![PathBuf::from("foo")]) - /// ``` - #[must_use] - pub fn with_root>(mut self, root: P) -> Self { - self.roots.push(root.as_ref().to_path_buf()); - self - } - - /// Adds a single extension to the list of extensions - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_extension("jsonc"); - /// assert!(options.extensions.contains(&"jsonc".to_string())); - /// ``` - #[must_use] - pub fn with_extension>(mut self, extension: S) -> Self { - self.extensions.push(extension.into()); - self - } - - /// Adds a single main field to the list of fields - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_main_field("something"); - /// assert!(options.main_fields.contains(&"something".to_string())); - /// ``` - #[must_use] - pub fn with_main_field>(mut self, field: S) -> Self { - self.main_fields.push(field.into()); - self - } - - /// Changes how the extension should be treated - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions, EnforceExtension}; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_force_extension(EnforceExtension::Enabled); - /// assert_eq!(options.enforce_extension, EnforceExtension::Enabled); - /// ``` - #[must_use] - pub fn with_force_extension(mut self, enforce_extension: EnforceExtension) -> Self { - self.enforce_extension = enforce_extension; - self - } - - /// Sets the value for [ResolveOptions::fully_specified] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_fully_specified(true); - /// assert_eq!(options.fully_specified, true); - /// ``` - #[must_use] - pub fn with_fully_specified(mut self, fully_specified: bool) -> Self { - self.fully_specified = fully_specified; - self - } - /// Sets the value for [ResolveOptions::prefer_relative] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_prefer_relative(true); - /// assert_eq!(options.prefer_relative, true); - /// ``` - #[must_use] - pub fn with_prefer_relative(mut self, flag: bool) -> Self { - self.prefer_relative = flag; - self - } - /// Sets the value for [ResolveOptions::prefer_absolute] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_prefer_absolute(true); - /// assert_eq!(options.prefer_absolute, true); - /// ``` - #[must_use] - pub fn with_prefer_absolute(mut self, flag: bool) -> Self { - self.prefer_absolute = flag; - self - } - - /// Changes the value of [ResolveOptions::symlinks] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// - /// let options = ResolveOptions::default().with_symbolic_link(false); - /// assert_eq!(options.symlinks, false); - /// ``` - #[must_use] - pub fn with_symbolic_link(mut self, flag: bool) -> Self { - self.symlinks = flag; - self - } - - /// Adds a module to [ResolveOptions::modules] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// - /// let options = ResolveOptions::default().with_module("module"); - /// assert!(options.modules.contains(&"module".to_string())); - /// ``` - #[must_use] - pub fn with_module>(mut self, module: M) -> Self { - self.modules.push(module.into()); - self - } - - /// Adds a main file to [ResolveOptions::main_files] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// - /// let options = ResolveOptions::default().with_main_file("foo"); - /// assert!(options.main_files.contains(&"foo".to_string())); - /// ``` - #[must_use] - pub fn with_main_file>(mut self, module: M) -> Self { - self.main_files.push(module.into()); - self - } - - pub(crate) fn sanitize(mut self) -> Self { - debug_assert!( - self.extensions.iter().filter(|e| !e.is_empty()).all(|e| e.starts_with('.')), - "All extensions must start with a leading dot" - ); - // Set `enforceExtension` to `true` when [ResolveOptions::extensions] contains an empty string. - // See - if self.enforce_extension == EnforceExtension::Auto { - if !self.extensions.is_empty() && self.extensions.iter().any(String::is_empty) { - self.enforce_extension = EnforceExtension::Enabled; - } else { - self.enforce_extension = EnforceExtension::Disabled; - } - } - self - } -} - -/// Value for [ResolveOptions::enforce_extension] -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -pub enum EnforceExtension { - Auto, - Enabled, - Disabled, -} - -impl EnforceExtension { - pub const fn is_auto(&self) -> bool { - matches!(self, Self::Auto) - } - - pub const fn is_enabled(&self) -> bool { - matches!(self, Self::Enabled) - } - - pub const fn is_disabled(&self) -> bool { - matches!(self, Self::Disabled) - } -} - -/// Alias for [ResolveOptions::alias] and [ResolveOptions::fallback] -pub type Alias = Vec<(String, Vec)>; - -/// Alias Value for [ResolveOptions::alias] and [ResolveOptions::fallback] -#[derive(Debug, Clone, Hash, PartialEq, Eq)] -pub enum AliasValue { - /// The path value - Path(String), - - /// The `false` value - Ignore, -} - -impl From for AliasValue -where - S: Into, -{ - fn from(value: S) -> Self { - Self::Path(value.into()) - } -} - -/// Value for [ResolveOptions::restrictions] -#[derive(Debug, Clone)] -pub enum Restriction { - Path(PathBuf), - RegExp(String), -} - -/// Tsconfig Options for [ResolveOptions::tsconfig] -/// -/// Derived from [tsconfig-paths-webpack-plugin](https://github.com/dividab/tsconfig-paths-webpack-plugin#options) -#[derive(Debug, Clone)] -pub struct TsconfigOptions { - /// Allows you to specify where to find the TypeScript configuration file. - /// You may provide - /// * a relative path to the configuration file. It will be resolved relative to cwd. - /// * an absolute path to the configuration file. - pub config_file: PathBuf, - - /// Support for Typescript Project References. - pub references: TsconfigReferences, -} - -/// Configuration for [TsconfigOptions::references] -#[derive(Debug, Clone)] -pub enum TsconfigReferences { - Disabled, - /// Use the `references` field from tsconfig of `config_file`. - Auto, - /// Manually provided relative or absolute path. - Paths(Vec), -} - -impl Default for ResolveOptions { - fn default() -> Self { - Self { - tsconfig: None, - alias: vec![], - alias_fields: vec![], - condition_names: vec![], - description_files: vec!["package.json".into()], - enforce_extension: EnforceExtension::Auto, - extension_alias: vec![], - exports_fields: vec![vec!["exports".into()]], - imports_fields: vec![vec!["imports".into()]], - extensions: vec![".js".into(), ".json".into(), ".node".into()], - fallback: vec![], - fully_specified: false, - main_fields: vec!["main".into()], - main_files: vec!["index".into()], - modules: vec!["node_modules".into()], - #[cfg(feature = "yarn_pnp")] - pnp_manifest: None, - resolve_to_context: false, - prefer_relative: false, - prefer_absolute: false, - restrictions: vec![], - roots: vec![], - symlinks: true, - builtin_modules: false, - } - } -} - -// For tracing -impl fmt::Display for ResolveOptions { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - if let Some(tsconfig) = &self.tsconfig { - write!(f, "tsconfig:{tsconfig:?},")?; - } - if !self.alias.is_empty() { - write!(f, "alias:{:?},", self.alias)?; - } - if !self.alias_fields.is_empty() { - write!(f, "alias_fields:{:?},", self.alias_fields)?; - } - if !self.condition_names.is_empty() { - write!(f, "condition_names:{:?},", self.condition_names)?; - } - if self.enforce_extension.is_enabled() { - write!(f, "enforce_extension:{:?},", self.enforce_extension)?; - } - if !self.exports_fields.is_empty() { - write!(f, "exports_fields:{:?},", self.exports_fields)?; - } - if !self.imports_fields.is_empty() { - write!(f, "imports_fields:{:?},", self.imports_fields)?; - } - if !self.extension_alias.is_empty() { - write!(f, "extension_alias:{:?},", self.extension_alias)?; - } - if !self.extensions.is_empty() { - write!(f, "extensions:{:?},", self.extensions)?; - } - if !self.fallback.is_empty() { - write!(f, "fallback:{:?},", self.fallback)?; - } - if self.fully_specified { - write!(f, "fully_specified:{:?},", self.fully_specified)?; - } - if !self.main_fields.is_empty() { - write!(f, "main_fields:{:?},", self.main_fields)?; - } - if !self.main_files.is_empty() { - write!(f, "main_files:{:?},", self.main_files)?; - } - if !self.modules.is_empty() { - write!(f, "modules:{:?},", self.modules)?; - } - if self.resolve_to_context { - write!(f, "resolve_to_context:{:?},", self.resolve_to_context)?; - } - if self.prefer_relative { - write!(f, "prefer_relative:{:?},", self.prefer_relative)?; - } - if self.prefer_absolute { - write!(f, "prefer_absolute:{:?},", self.prefer_absolute)?; - } - if !self.restrictions.is_empty() { - write!(f, "restrictions:{:?},", self.restrictions)?; - } - if !self.roots.is_empty() { - write!(f, "roots:{:?},", self.roots)?; - } - if self.symlinks { - write!(f, "symlinks:{:?},", self.symlinks)?; - } - if self.builtin_modules { - write!(f, "builtin_modules:{:?},", self.builtin_modules)?; - } - Ok(()) - } -} - -#[cfg(test)] -mod test { - use super::{ - AliasValue, EnforceExtension, ResolveOptions, Restriction, TsconfigOptions, - TsconfigReferences, - }; - use std::path::PathBuf; - - #[test] - fn enforce_extension() { - assert!(EnforceExtension::Auto.is_auto()); - assert!(!EnforceExtension::Enabled.is_auto()); - assert!(!EnforceExtension::Disabled.is_auto()); - - assert!(!EnforceExtension::Auto.is_enabled()); - assert!(EnforceExtension::Enabled.is_enabled()); - assert!(!EnforceExtension::Disabled.is_enabled()); - - assert!(!EnforceExtension::Auto.is_disabled()); - assert!(!EnforceExtension::Enabled.is_disabled()); - assert!(EnforceExtension::Disabled.is_disabled()); - } - - #[test] - fn display() { - let options = ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: PathBuf::from("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - alias: vec![("a".into(), vec![AliasValue::Ignore])], - alias_fields: vec![vec!["browser".into()]], - condition_names: vec!["require".into()], - enforce_extension: EnforceExtension::Enabled, - extension_alias: vec![(".js".into(), vec![".ts".into()])], - exports_fields: vec![vec!["exports".into()]], - imports_fields: vec![vec!["imports".into()]], - fallback: vec![("fallback".into(), vec![AliasValue::Ignore])], - fully_specified: true, - resolve_to_context: true, - prefer_relative: true, - prefer_absolute: true, - restrictions: vec![Restriction::Path(PathBuf::from("restrictions"))], - roots: vec![PathBuf::from("roots")], - builtin_modules: true, - ..ResolveOptions::default() - }; - - let expected = r#"tsconfig:TsconfigOptions { config_file: "tsconfig.json", references: Auto },alias:[("a", [Ignore])],alias_fields:[["browser"]],condition_names:["require"],enforce_extension:Enabled,exports_fields:[["exports"]],imports_fields:[["imports"]],extension_alias:[(".js", [".ts"])],extensions:[".js", ".json", ".node"],fallback:[("fallback", [Ignore])],fully_specified:true,main_fields:["main"],main_files:["index"],modules:["node_modules"],resolve_to_context:true,prefer_relative:true,prefer_absolute:true,restrictions:[Path("restrictions")],roots:["roots"],symlinks:true,builtin_modules:true,"#; - assert_eq!(format!("{options}"), expected); - - let options = ResolveOptions { - alias: vec![], - alias_fields: vec![], - builtin_modules: false, - condition_names: vec![], - description_files: vec![], - enforce_extension: EnforceExtension::Disabled, - exports_fields: vec![], - extension_alias: vec![], - extensions: vec![], - fallback: vec![], - fully_specified: false, - imports_fields: vec![], - main_fields: vec![], - main_files: vec![], - modules: vec![], - #[cfg(feature = "yarn_pnp")] - pnp_manifest: None, - prefer_absolute: false, - prefer_relative: false, - resolve_to_context: false, - restrictions: vec![], - roots: vec![], - symlinks: false, - tsconfig: None, - }; - - assert_eq!(format!("{options}"), ""); - } -} diff --git a/src/package_json.rs b/src/package_json.rs deleted file mode 100644 index 7e05d202..00000000 --- a/src/package_json.rs +++ /dev/null @@ -1,219 +0,0 @@ -//! package.json definitions -//! -//! Code related to export field are copied from [Parcel's resolver](https://github.com/parcel-bundler/parcel/blob/v2/packages/utils/node-resolver-rs/src/package_json.rs) -use std::path::{Path, PathBuf}; - -use serde_json::Value as JSONValue; - -use crate::{path::PathUtil, ResolveError}; - -pub type JSONMap = serde_json::Map; - -/// Deserialized package.json -#[derive(Debug, Default)] -pub struct PackageJson { - /// Path to `package.json`. Contains the `package.json` filename. - pub path: PathBuf, - - /// Realpath to `package.json`. Contains the `package.json` filename. - pub realpath: PathBuf, - - /// The "name" field defines your package's name. - /// The "name" field can be used in addition to the "exports" field to self-reference a package using its name. - /// - /// - pub name: Option, - - /// The "type" field. - /// - /// - pub r#type: Option, - - /// The "sideEffects" field. - /// - /// - pub side_effects: Option, - - raw_json: std::sync::Arc, -} - -impl PackageJson { - /// # Panics - /// # Errors - pub(crate) fn parse( - path: PathBuf, - realpath: PathBuf, - json: &str, - ) -> Result { - let mut raw_json: JSONValue = serde_json::from_str(json)?; - let mut package_json = Self::default(); - - if let Some(json_object) = raw_json.as_object_mut() { - // Remove large fields that are useless for pragmatic use. - #[cfg(feature = "package_json_raw_json_api")] - { - json_object.remove("description"); - json_object.remove("keywords"); - json_object.remove("scripts"); - json_object.remove("dependencies"); - json_object.remove("devDependencies"); - json_object.remove("peerDependencies"); - json_object.remove("optionalDependencies"); - } - - // Add name, type and sideEffects. - package_json.name = - json_object.get("name").and_then(|field| field.as_str()).map(ToString::to_string); - package_json.r#type = json_object.get("type").cloned(); - package_json.side_effects = json_object.get("sideEffects").cloned(); - } - - package_json.path = path; - package_json.realpath = realpath; - package_json.raw_json = std::sync::Arc::new(raw_json); - Ok(package_json) - } - - fn get_value_by_path<'a>( - fields: &'a serde_json::Map, - path: &[String], - ) -> Option<&'a JSONValue> { - if path.is_empty() { - return None; - } - let mut value = fields.get(&path[0])?; - for key in path.iter().skip(1) { - if let Some(inner_value) = value.as_object().and_then(|o| o.get(key)) { - value = inner_value; - } else { - return None; - } - } - Some(value) - } - - /// Raw serde json value of `package.json`. - /// - /// This is currently used in Rspack for: - /// * getting the `sideEffects` field - /// * query in - search on GitHub indicates query on the `type` field. - /// - /// To reduce overall memory consumption, large fields that useless for pragmatic use are removed. - /// They are: `description`, `keywords`, `scripts`, - /// `dependencies` and `devDependencies`, `peerDependencies`, `optionalDependencies`. - #[cfg(feature = "package_json_raw_json_api")] - pub fn raw_json(&self) -> &std::sync::Arc { - &self.raw_json - } - - /// Directory to `package.json` - /// - /// # Panics - /// - /// * When the package.json path is misconfigured. - pub fn directory(&self) -> &Path { - debug_assert!(self.realpath.file_name().is_some_and(|x| x == "package.json")); - self.realpath.parent().unwrap() - } - - /// The "main" field defines the entry point of a package when imported by name via a node_modules lookup. Its value is a path. - /// - /// When a package has an "exports" field, this will take precedence over the "main" field when importing the package by name. - /// - /// Values are dynamically retrieved from [ResolveOptions::main_fields]. - /// - /// - pub(crate) fn main_fields<'a>( - &'a self, - main_fields: &'a [String], - ) -> impl Iterator + '_ { - main_fields - .iter() - .filter_map(|main_field| self.raw_json.get(main_field)) - .filter_map(|value| value.as_str()) - } - - /// The "exports" field allows defining the entry points of a package when imported by name loaded either via a node_modules lookup or a self-reference to its own name. - /// - /// - pub(crate) fn exports_fields<'a>( - &'a self, - exports_fields: &'a [Vec], - ) -> impl Iterator + '_ { - exports_fields.iter().filter_map(|object_path| { - self.raw_json - .as_object() - .and_then(|json_object| Self::get_value_by_path(json_object, object_path)) - }) - } - - /// In addition to the "exports" field, there is a package "imports" field to create private mappings that only apply to import specifiers from within the package itself. - /// - /// - pub(crate) fn imports_fields<'a>( - &'a self, - imports_fields: &'a [Vec], - ) -> impl Iterator + '_ { - imports_fields.iter().filter_map(|object_path| { - self.raw_json - .as_object() - .and_then(|json_object| Self::get_value_by_path(json_object, object_path)) - .and_then(|value| value.as_object()) - }) - } - - /// The "browser" field is provided by a module author as a hint to javascript bundlers or component tools when packaging modules for client side use. - /// Multiple values are configured by [ResolveOptions::alias_fields]. - /// - /// - fn browser_fields<'a>( - &'a self, - alias_fields: &'a [Vec], - ) -> impl Iterator + '_ { - alias_fields.iter().filter_map(|object_path| { - self.raw_json - .as_object() - .and_then(|json_object| Self::get_value_by_path(json_object, object_path)) - // Only object is valid, all other types are invalid - // https://github.com/webpack/enhanced-resolve/blob/3a28f47788de794d9da4d1702a3a583d8422cd48/lib/AliasFieldPlugin.js#L44-L52 - .and_then(|value| value.as_object()) - }) - } - - /// Resolve the request string for this package.json by looking at the `browser` field. - /// - /// # Errors - /// - /// * Returns [ResolveError::Ignored] for `"path": false` in `browser` field. - pub(crate) fn resolve_browser_field<'a>( - &'a self, - path: &Path, - request: Option<&str>, - alias_fields: &'a [Vec], - ) -> Result, ResolveError> { - for object in self.browser_fields(alias_fields) { - if let Some(request) = request { - if let Some(value) = object.get(request) { - return Self::alias_value(path, value); - } - } else { - let dir = self.path.parent().unwrap(); - for (key, value) in object { - let joined = dir.normalize_with(key); - if joined == path { - return Self::alias_value(path, value); - } - } - } - } - Ok(None) - } - - fn alias_value<'a>(key: &Path, value: &'a JSONValue) -> Result, ResolveError> { - match value { - JSONValue::String(value) => Ok(Some(value.as_str())), - JSONValue::Bool(b) if !b => Err(ResolveError::Ignored(key.to_path_buf())), - _ => Ok(None), - } - } -} diff --git a/src/path.rs b/src/path.rs deleted file mode 100644 index f66fdd76..00000000 --- a/src/path.rs +++ /dev/null @@ -1,132 +0,0 @@ -//! Path Utilities -//! -//! Code adapted from the following libraries -//! * [path-absolutize](https://docs.rs/path-absolutize) -//! * [normalize_path](https://docs.rs/normalize-path) -use std::path::{Component, Path, PathBuf}; - -pub const SLASH_START: &[char; 2] = &['/', '\\']; - -/// Extension trait to add path normalization to std's [`Path`]. -pub trait PathUtil { - /// Normalize this path without performing I/O. - /// - /// All redundant separator and up-level references are collapsed. - /// - /// However, this does not resolve links. - fn normalize(&self) -> PathBuf; - - /// Normalize with subpath assuming this path is normalized without performing I/O. - /// - /// All redundant separator and up-level references are collapsed. - /// - /// However, this does not resolve links. - fn normalize_with>(&self, subpath: P) -> PathBuf; - - /// Defined in ESM PACKAGE_TARGET_RESOLVE - /// If target split on "/" or "\" contains any "", ".", "..", or "node_modules" segments after the first "." segment, case insensitive and including percent encoded variants - fn is_invalid_exports_target(&self) -> bool; -} - -impl PathUtil for Path { - // https://github.com/parcel-bundler/parcel/blob/e0b99c2a42e9109a9ecbd6f537844a1b33e7faf5/packages/utils/node-resolver-rs/src/path.rs#L7 - fn normalize(&self) -> PathBuf { - let mut components = self.components().peekable(); - let mut ret = if let Some(c @ Component::Prefix(..)) = components.peek() { - let buf = PathBuf::from(c.as_os_str()); - components.next(); - buf - } else { - PathBuf::new() - }; - - for component in components { - match component { - Component::Prefix(..) => unreachable!("Path {:?}", self), - Component::RootDir => { - ret.push(component.as_os_str()); - } - Component::CurDir => {} - Component::ParentDir => { - ret.pop(); - } - Component::Normal(c) => { - ret.push(c); - } - } - } - - ret - } - - // https://github.com/parcel-bundler/parcel/blob/e0b99c2a42e9109a9ecbd6f537844a1b33e7faf5/packages/utils/node-resolver-rs/src/path.rs#L37 - fn normalize_with>(&self, subpath: B) -> PathBuf { - let subpath = subpath.as_ref(); - - let mut components = subpath.components(); - - let Some(head) = components.next() else { return subpath.to_path_buf() }; - - if matches!(head, Component::Prefix(..) | Component::RootDir) { - return subpath.to_path_buf(); - } - - let mut ret = self.to_path_buf(); - for component in std::iter::once(head).chain(components) { - match component { - Component::CurDir => {} - Component::ParentDir => { - ret.pop(); - } - Component::Normal(c) => { - ret.push(c); - } - Component::Prefix(..) | Component::RootDir => { - unreachable!("Path {:?} Subpath {:?}", self, subpath) - } - } - } - - ret - } - - fn is_invalid_exports_target(&self) -> bool { - self.components().enumerate().any(|(index, c)| match c { - Component::ParentDir => true, - Component::CurDir => index > 0, - Component::Normal(c) => c.eq_ignore_ascii_case("node_modules"), - _ => false, - }) - } -} - -// https://github.com/webpack/enhanced-resolve/blob/main/test/path.test.js -#[test] -fn is_invalid_exports_target() { - let test_cases = [ - "../a.js", - "../", - "./a/b/../../../c.js", - "./a/b/../../../", - "./../../c.js", - "./../../", - "./a/../b/../../c.js", - "./a/../b/../../", - "./././../", - ]; - - for case in test_cases { - assert!(Path::new(case).is_invalid_exports_target(), "{case}"); - } - - assert!(!Path::new("C:").is_invalid_exports_target()); - assert!(!Path::new("/").is_invalid_exports_target()); -} - -#[test] -fn normalize() { - assert_eq!(Path::new("/foo/.././foo/").normalize(), Path::new("/foo")); - assert_eq!(Path::new("C://").normalize(), Path::new("C://")); - assert_eq!(Path::new("C:").normalize(), Path::new("C:")); - assert_eq!(Path::new(r"\\server\share").normalize(), Path::new(r"\\server\share")); -} diff --git a/src/resolution.rs b/src/resolution.rs deleted file mode 100644 index a3aaa2e7..00000000 --- a/src/resolution.rs +++ /dev/null @@ -1,92 +0,0 @@ -use crate::package_json::PackageJson; -use std::{ - fmt, - path::{Path, PathBuf}, - sync::Arc, -}; - -/// The final path resolution with optional `?query` and `#fragment` -#[derive(Clone)] -pub struct Resolution { - pub(crate) path: PathBuf, - - /// path query `?query`, contains `?`. - pub(crate) query: Option, - - /// path fragment `#query`, contains `#`. - pub(crate) fragment: Option, - - pub(crate) package_json: Option>, -} - -impl fmt::Debug for Resolution { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - f.debug_struct("Resolution") - .field("path", &self.path) - .field("query", &self.query) - .field("fragment", &self.fragment) - .field("package_json", &self.package_json.as_ref().map(|p| &p.path)) - .finish() - } -} - -impl PartialEq for Resolution { - fn eq(&self, other: &Self) -> bool { - self.path == other.path && self.query == other.query && self.fragment == other.fragment - } -} -impl Eq for Resolution {} - -impl Resolution { - /// Returns the path without query and fragment - pub fn path(&self) -> &Path { - &self.path - } - - /// Returns the path without query and fragment - pub fn into_path_buf(self) -> PathBuf { - self.path - } - - /// Returns the path query `?query`, contains the leading `?` - pub fn query(&self) -> Option<&str> { - self.query.as_deref() - } - - /// Returns the path fragment `#fragment`, contains the leading `#` - pub fn fragment(&self) -> Option<&str> { - self.fragment.as_deref() - } - - /// Returns serialized package_json - pub fn package_json(&self) -> Option<&Arc> { - self.package_json.as_ref() - } - - /// Returns the full path with query and fragment - pub fn full_path(&self) -> PathBuf { - let mut path = self.path.clone().into_os_string(); - if let Some(query) = &self.query { - path.push(query); - } - if let Some(fragment) = &self.fragment { - path.push(fragment); - } - PathBuf::from(path) - } -} - -#[test] -fn test() { - let resolution = Resolution { - path: PathBuf::from("foo"), - query: Some("?query".to_string()), - fragment: Some("#fragment".to_string()), - package_json: None, - }; - assert_eq!(resolution.path(), Path::new("foo")); - assert_eq!(resolution.query(), Some("?query")); - assert_eq!(resolution.fragment(), Some("#fragment")); - assert_eq!(resolution.full_path(), PathBuf::from("foo?query#fragment")); - assert_eq!(resolution.into_path_buf(), PathBuf::from("foo")); -} diff --git a/src/specifier.rs b/src/specifier.rs deleted file mode 100644 index 73ed038c..00000000 --- a/src/specifier.rs +++ /dev/null @@ -1,230 +0,0 @@ -use crate::error::SpecifierError; -use std::borrow::Cow; - -#[derive(Debug)] -pub struct Specifier<'a> { - path: Cow<'a, str>, - pub query: Option<&'a str>, - pub fragment: Option<&'a str>, -} - -impl<'a> Specifier<'a> { - pub fn path(&'a self) -> &'a str { - self.path.as_ref() - } - - pub fn parse(specifier: &'a str) -> Result { - if specifier.is_empty() { - return Err(SpecifierError::Empty(specifier.to_string())); - } - let offset = match specifier.as_bytes()[0] { - b'/' | b'.' | b'#' => 1, - _ => 0, - }; - let (path, query, fragment) = Self::parse_query_framgment(specifier, offset); - if path.is_empty() { - return Err(SpecifierError::Empty(specifier.to_string())); - } - Ok(Self { path, query, fragment }) - } - - fn parse_query_framgment( - specifier: &'a str, - skip: usize, - ) -> (Cow<'a, str>, Option<&str>, Option<&str>) { - let mut query_start: Option = None; - let mut fragment_start: Option = None; - - let mut prev = specifier.chars().next().unwrap(); - let mut escaped_indexes = vec![]; - for (i, c) in specifier.char_indices().skip(skip) { - if c == '?' && query_start.is_none() { - query_start = Some(i); - } - if c == '#' { - if prev == '\0' { - escaped_indexes.push(i - 1); - } else { - fragment_start = Some(i); - break; - } - } - prev = c; - } - - let (path, query, fragment) = match (query_start, fragment_start) { - (Some(i), Some(j)) => { - debug_assert!(i < j); - (&specifier[..i], Some(&specifier[i..j]), Some(&specifier[j..])) - } - (Some(i), None) => (&specifier[..i], Some(&specifier[i..]), None), - (None, Some(j)) => (&specifier[..j], None, Some(&specifier[j..])), - _ => (specifier, None, None), - }; - - let path = if escaped_indexes.is_empty() { - Cow::Borrowed(path) - } else { - // Remove the `\0` characters for a legal path. - Cow::Owned( - path.chars() - .enumerate() - .filter_map(|(i, c)| (!escaped_indexes.contains(&i)).then_some(c)) - .collect::(), - ) - }; - - (path, query, fragment) - } -} - -#[cfg(test)] -mod tests { - use super::{Specifier, SpecifierError}; - - #[test] - fn debug() { - let specifier = Specifier::parse("/").unwrap(); - assert_eq!( - format!("{specifier:?}"), - r#"Specifier { path: "/", query: None, fragment: None }"# - ); - } - - #[test] - fn empty() { - let specifiers = ["", "?"]; - for specifier in specifiers { - let error = Specifier::parse(specifier).unwrap_err(); - assert_eq!(error, SpecifierError::Empty(specifier.to_string())); - } - } - - #[test] - fn absolute() -> Result<(), SpecifierError> { - let specifier = "/test?#"; - let parsed = Specifier::parse(specifier)?; - assert_eq!(parsed.path, "/test"); - assert_eq!(parsed.query, Some("?")); - assert_eq!(parsed.fragment, Some("#")); - Ok(()) - } - - #[test] - fn relative() -> Result<(), SpecifierError> { - let specifiers = ["./test", "../test", "../../test"]; - for specifier in specifiers { - let mut r = specifier.to_string(); - r.push_str("?#"); - let parsed = Specifier::parse(&r)?; - assert_eq!(parsed.path, specifier); - assert_eq!(parsed.query, Some("?")); - assert_eq!(parsed.fragment, Some("#")); - } - Ok(()) - } - - #[test] - fn hash() -> Result<(), SpecifierError> { - let specifiers = ["#", "#path"]; - for specifier in specifiers { - let mut r = specifier.to_string(); - r.push_str("?#"); - let parsed = Specifier::parse(&r)?; - assert_eq!(parsed.path, specifier); - assert_eq!(parsed.query, Some("?")); - assert_eq!(parsed.fragment, Some("#")); - } - Ok(()) - } - - #[test] - fn module() -> Result<(), SpecifierError> { - let specifiers = ["module"]; - for specifier in specifiers { - let mut r = specifier.to_string(); - r.push_str("?#"); - let parsed = Specifier::parse(&r)?; - assert_eq!(parsed.path, specifier); - assert_eq!(parsed.query, Some("?")); - assert_eq!(parsed.fragment, Some("#")); - } - Ok(()) - } - - #[test] - fn query_fragment() -> Result<(), SpecifierError> { - let data = [ - ("a?", Some("?"), None), - ("a?query", Some("?query"), None), - ("a?query1?query2", Some("?query1?query2"), None), - ("a?query1?query2?query3", Some("?query1?query2?query3"), None), - ("a#", None, Some("#")), - ("a#b#c", None, Some("#b#c")), - ("a#fragment", None, Some("#fragment")), - ("a?#", Some("?"), Some("#")), - ("a?#fragment", Some("?"), Some("#fragment")), - ("a?query#", Some("?query"), Some("#")), - ("a?query#fragment", Some("?query"), Some("#fragment")), - ("a#fragment?", None, Some("#fragment?")), - ("a#fragment?query", None, Some("#fragment?query")), - ]; - - for (specifier_str, query, fragment) in data { - let specifier = Specifier::parse(specifier_str)?; - assert_eq!(specifier.path, "a", "{specifier_str}"); - assert_eq!(specifier.query, query, "{specifier_str}"); - assert_eq!(specifier.fragment, fragment, "{specifier_str}"); - } - - Ok(()) - } - - #[test] - // https://github.com/webpack/enhanced-resolve/blob/main/test/identifier.test.js - fn enhanced_resolve_edge_cases() -> Result<(), SpecifierError> { - let data = [ - ("path/#", "path/", "", "#"), - ("path/as/?", "path/as/", "?", ""), - ("path/#/?", "path/", "", "#/?"), - ("path/#repo#hash", "path/", "", "#repo#hash"), - ("path/#r#hash", "path/", "", "#r#hash"), - ("path/#repo/#repo2#hash", "path/", "", "#repo/#repo2#hash"), - ("path/#r/#r#hash", "path/", "", "#r/#r#hash"), - ("path/#/not/a/hash?not-a-query", "path/", "", "#/not/a/hash?not-a-query"), - ]; - - for (specifier_str, path, query, fragment) in data { - let specifier = Specifier::parse(specifier_str)?; - assert_eq!(specifier.path, path, "{specifier_str}"); - assert_eq!(specifier.query.unwrap_or(""), query, "{specifier_str}"); - assert_eq!(specifier.fragment.unwrap_or(""), fragment, "{specifier_str}"); - } - - Ok(()) - } - - // https://github.com/webpack/enhanced-resolve/blob/main/test/identifier.test.js - #[test] - fn enhanced_resolve_windows_like() -> Result<(), SpecifierError> { - let data = [ - ("path\\#", "path\\", "", "#"), - ("path\\as\\?", "path\\as\\", "?", ""), - ("path\\#\\?", "path\\", "", "#\\?"), - ("path\\#repo#hash", "path\\", "", "#repo#hash"), - ("path\\#r#hash", "path\\", "", "#r#hash"), - ("path\\#repo\\#repo2#hash", "path\\", "", "#repo\\#repo2#hash"), - ("path\\#r\\#r#hash", "path\\", "", "#r\\#r#hash"), - ("path\\#/not/a/hash?not-a-query", "path\\", "", "#/not/a/hash?not-a-query"), - ]; - - for (specifier_str, path, query, fragment) in data { - let specifier = Specifier::parse(specifier_str)?; - assert_eq!(specifier.path, path, "{specifier_str}"); - assert_eq!(specifier.query.unwrap_or(""), query, "{specifier_str}"); - assert_eq!(specifier.fragment.unwrap_or(""), fragment, "{specifier_str}"); - } - - Ok(()) - } -} diff --git a/src/tests/alias.rs b/src/tests/alias.rs deleted file mode 100644 index e5892066..00000000 --- a/src/tests/alias.rs +++ /dev/null @@ -1,283 +0,0 @@ -//! - -use normalize_path::NormalizePath; -use std::path::Path; - -use crate::{AliasValue, Resolution, ResolveContext, ResolveError, ResolveOptions, Resolver}; - -#[test] -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -fn alias() { - use super::memory_fs::MemoryFS; - use crate::ResolverGeneric; - use std::path::{Path, PathBuf}; - - let f = Path::new("/"); - - let file_system = MemoryFS::new(&[ - ("/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", ""), - ("/dashed-name", ""), - ]); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - alias: vec![ - ("aliasA".into(), vec![AliasValue::from("a")]), - ("b$".into(), vec![AliasValue::from("a/index")]), - ("c$".into(), vec![AliasValue::from("/a/index")]), - ( - "multiAlias".into(), - vec![ - AliasValue::from("b"), - AliasValue::from("c"), - AliasValue::from("d"), - AliasValue::from("e"), - AliasValue::from("a"), - ], - ), - ("recursive".into(), vec![AliasValue::from("recursive/dir")]), - ("/d/dir".into(), vec![AliasValue::from("/c/dir")]), - ("/d/index.js".into(), vec![AliasValue::from("/c/index")]), - ("#".into(), vec![AliasValue::from("/c/dir")]), - ("@".into(), vec![AliasValue::from("/c/dir")]), - ("ignored".into(), vec![AliasValue::Ignore]), - // not part of enhanced-resolve, added to make sure query in alias value works - ("alias_query".into(), vec![AliasValue::from("a?query_after")]), - ("alias_fragment".into(), vec![AliasValue::from("a#fragment_after")]), - ("dash".into(), vec![AliasValue::Ignore]), - ("@scope/package-name/file$".into(), vec![AliasValue::from("/c/dir")]), - ], - modules: vec!["/".into()], - ..ResolveOptions::default() - }, - ); - - #[rustfmt::skip] - let pass = [ - ("should resolve a not aliased module 1", "a", "/a/index"), - ("should resolve a not aliased module 2", "a/index", "/a/index"), - ("should resolve a not aliased module 3", "a/dir", "/a/dir/index"), - ("should resolve a not aliased module 4", "a/dir/index", "/a/dir/index"), - ("should resolve an aliased module 1", "aliasA", "/a/index"), - ("should resolve an aliased module 2", "aliasA/index", "/a/index"), - ("should resolve an aliased module 3", "aliasA/dir", "/a/dir/index"), - ("should resolve an aliased module 4", "aliasA/dir/index", "/a/dir/index"), - ("should resolve '#' alias 1", "#", "/c/dir/index"), - ("should resolve '#' alias 2", "#/index", "/c/dir/index"), - ("should resolve '@' alias 1", "@", "/c/dir/index"), - ("should resolve '@' alias 2", "@/index", "/c/dir/index"), - ("should resolve a recursive aliased module 1", "recursive", "/recursive/dir/index"), - ("should resolve a recursive aliased module 2", "recursive/index", "/recursive/dir/index"), - ("should resolve a recursive aliased module 3", "recursive/dir", "/recursive/dir/index"), - ("should resolve a recursive aliased module 4", "recursive/dir/index", "/recursive/dir/index"), - ("should resolve a file aliased module 1", "b", "/a/index"), - ("should resolve a file aliased module 2", "c", "/a/index"), - ("should resolve a file aliased module with a query 1", "b?query", "/a/index?query"), - ("should resolve a file aliased module with a query 2", "c?query", "/a/index?query"), - ("should resolve a path in a file aliased module 1", "b/index", "/b/index"), - ("should resolve a path in a file aliased module 2", "b/dir", "/b/dir/index"), - ("should resolve a path in a file aliased module 3", "b/dir/index", "/b/dir/index"), - ("should resolve a path in a file aliased module 4", "c/index", "/c/index"), - ("should resolve a path in a file aliased module 5", "c/dir", "/c/dir/index"), - ("should resolve a path in a file aliased module 6", "c/dir/index", "/c/dir/index"), - ("should resolve a file aliased file 1", "d", "/c/index"), - ("should resolve a file aliased file 2", "d/dir/index", "/c/dir/index"), - ("should resolve a file in multiple aliased dirs 1", "multiAlias/dir/file", "/e/dir/file"), - ("should resolve a file in multiple aliased dirs 2", "multiAlias/anotherDir", "/e/anotherDir/index"), - // not part of enhanced-resolve, added to make sure query in alias value works - ("should resolve query in alias value", "alias_query?query_before", "/a/index?query_after"), - ("should resolve query in alias value", "alias_fragment#fragment_before", "/a/index#fragment_after"), - ("should resolve dashed name", "dashed-name", "/dashed-name"), - ("should resolve scoped package name with sub dir", "@scope/package-name/file", "/c/dir/index"), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - - #[rustfmt::skip] - let ignore = [ - ("should resolve an ignore module", "ignored", ResolveError::Ignored(f.join("ignored"))) - ]; - - for (comment, request, expected) in ignore { - let resolution = resolver.resolve(f, request); - assert_eq!(resolution, Err(expected), "{comment} {request}"); - } -} - -// Not part of enhanced-resolve -#[test] -fn infinite_recursion() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![ - ("./a".into(), vec![AliasValue::from("./b")]), - ("./b".into(), vec![AliasValue::from("./a")]), - ], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(f, "./a"); - assert_eq!(resolution, Err(ResolveError::Recursion)); -} - -fn check_slash(path: &Path) { - let s = path.to_string_lossy().to_string(); - #[cfg(target_os = "windows")] - { - assert!(!s.contains('/'), "{s}"); - assert!(s.contains('\\'), "{s}"); - } - #[cfg(not(target_os = "windows"))] - { - assert!(s.contains('/'), "{s}"); - assert!(!s.contains('\\'), "{s}"); - } -} - -#[test] -fn absolute_path() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![(f.join("foo").to_str().unwrap().to_string(), vec![AliasValue::Ignore])], - modules: vec![f.clone().to_str().unwrap().to_string()], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(&f, "foo/index"); - assert_eq!(resolution, Err(ResolveError::Ignored(f.join("foo")))); -} - -#[test] -fn system_path() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![("@app".into(), vec![AliasValue::from(f.join("alias").to_string_lossy())])], - ..ResolveOptions::default() - }); - - let specifiers = ["@app/files/a", "@app/files/a.js"]; - - for specifier in specifiers { - let path = resolver.resolve(&f, specifier).map(Resolution::into_path_buf).unwrap(); - assert_eq!(path, f.join("alias/files/a.js")); - check_slash(&path); - } -} - -#[test] -fn alias_is_full_path() { - let f = super::fixture(); - let dir = f.join("foo"); - let dir_str = dir.to_string_lossy().to_string(); - - let resolver = Resolver::new(ResolveOptions { - alias: vec![("@".into(), vec![AliasValue::Path(dir_str.clone())])], - ..ResolveOptions::default() - }); - - let mut ctx = ResolveContext::default(); - - let specifiers = [ - "@/index".to_string(), - "@/index.js".to_string(), - // specifier has multiple `/` for reasons we'll never know - "@////index".to_string(), - // specifier is a full path - dir_str, - ]; - - for specifier in specifiers { - let resolution = resolver.resolve_with_context(&f, &specifier, &mut ctx); - assert_eq!(resolution.map(|r| r.full_path()), Ok(dir.join("index.js"))); - } - - for path in ctx.file_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - check_slash(&path); - } - - for path in ctx.missing_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - check_slash(&path); - if let Some(path) = path.parent() { - assert!(!path.is_file(), "{path:?} must not be a file"); - } - } -} - -// For the `should_stop` variable in `load_alias` -#[test] -fn all_alias_values_are_not_found() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![( - "m1".to_string(), - vec![AliasValue::Path(f.join("node_modules").join("m2").to_string_lossy().to_string())], - )], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(&f, "m1/a.js"); - assert_eq!( - resolution, - Err(ResolveError::MatchedAliasNotFound("m1/a.js".to_string(), "m1".to_string(),)) - ); -} - -#[test] -fn alias_fragment() { - let f = super::fixture(); - - let data = [ - // enhanced-resolve has `#` prepended with a `\0`, they are removed from the - // following 3 expected test results. - // See https://github.com/webpack/enhanced-resolve#escaping - ( - "handle fragment edge case (no fragment)", - "./no#fragment/#/#", - f.join("no#fragment/#/#.js"), - ), - ("handle fragment edge case (fragment)", "./no#fragment/#/", f.join("no.js#fragment/#/")), - ( - "handle fragment escaping", - "./no\0#fragment/\0#/\0##fragment", - f.join("no#fragment/#/#.js#fragment"), - ), - ]; - - for (comment, request, expected) in data { - let resolver = Resolver::new(ResolveOptions { - alias: vec![("foo".to_string(), vec![AliasValue::Path(request.to_string())])], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f, "foo").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } -} - -#[test] -fn alias_try_fragment_as_path() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![( - "#".to_string(), - vec![AliasValue::Path(f.join("#").to_string_lossy().to_string())], - )], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(&f, "#/a").map(|r| r.full_path()); - assert_eq!(resolution, Ok(f.join("#").join("a.js"))); -} diff --git a/src/tests/browser_field.rs b/src/tests/browser_field.rs deleted file mode 100644 index 171ee099..00000000 --- a/src/tests/browser_field.rs +++ /dev/null @@ -1,189 +0,0 @@ -//! - -use crate::{AliasValue, ResolveError, ResolveOptions, Resolver}; - -#[test] -fn ignore() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![ - vec!["browser".into()], - vec!["innerBrowser1".into()], - vec!["innerBrowser2".into()], - vec![], - ], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - (f.clone(), "./lib/ignore", f.join("lib/ignore.js")), - (f.clone(), "./lib/ignore.js", f.join("lib/ignore.js")), - (f.join("lib"), "./ignore", f.join("lib/ignore.js")), - (f.join("lib"), "./ignore.js", f.join("lib/ignore.js")), - ]; - - for (path, request, expected) in data { - let resolution = resolver.resolve(&path, request); - let expected = ResolveError::Ignored(expected); - assert_eq!(resolution, Err(expected), "{path:?} {request}"); - } -} - -#[test] -fn shared_resolvers() { - let f = super::fixture().join("browser-module"); - - let resolver1 = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["innerBrowser1".into(), "field".into(), "browser".into()]], - ..ResolveOptions::default() - }); - let resolved_path = resolver1.resolve(&f, "./lib/main1.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("lib/main.js"))); - - let resolver2 = resolver1.clone_with_options(ResolveOptions { - alias_fields: vec![vec!["innerBrowser2".into(), "browser".into()]], - ..ResolveOptions::default() - }); - let resolved_path = resolver2.resolve(&f, "./lib/main2.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("./lib/replaced.js"))); -} - -#[test] -fn replace_file() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![ - vec!["browser".into()], - vec!["innerBrowser1".into(), "field2".into(), "browser".into()], // not presented - vec!["innerBrowser1".into(), "field".into(), "browser".into()], - vec!["innerBrowser2".into(), "browser".into()], - ], - // Not part of enhanced-resolve. Added to make sure no interaction between these two fields. - main_fields: vec!["browser".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - ("should replace a file 1", f.clone(), "./lib/replaced", f.join("lib/browser.js")), - ("should replace a file 2", f.clone(), "./lib/replaced.js", f.join("lib/browser.js")), - ("should replace a file 3", f.join("lib"), "./replaced", f.join("lib/browser.js")), - ("should replace a file 4", f.join("lib"), "./replaced.js", f.join("lib/browser.js")), - ("should replace a module with a file 1", f.clone(), "module-a", f.join("browser/module-a.js")), - ("should replace a module with a file 2", f.join("lib"), "module-a", f.join("browser/module-a.js")), - ("should replace a module with a module 1", f.clone(), "module-b", f.join("node_modules/module-c.js")), - ("should replace a module with a module 2", f.join("lib"), "module-b", f.join("node_modules/module-c.js")), - ("should resolve in nested property 1", f.clone(), "./lib/main1.js", f.join("lib/main.js")), - ("should resolve in nested property 2", f.clone(), "./lib/main2.js", f.join("lib/browser.js")), - ("should check only alias field properties", f.clone(), "./toString", f.join("lib/toString.js")), - // not part of enhanced-resolve - ("recursion", f.clone(), "module-c", f.join("node_modules/module-c.js")), - ("resolve self 1", f.clone(), "./lib/main.js", f.join("lib/main.js")), - ("resolve self 2", f.clone(), "./main.js", f.join("lib/main.js")), - ]; - - for (comment, path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn recurse_fail() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - ("recurse non existent", f.clone(), "./lib/non-existent.js", ResolveError::NotFound("./lib/non-existent.js".into())), - ("path partial match 1", f.clone(), "./xyz.js", ResolveError::NotFound("./xyz.js".into())), - ("path partial match 2", f, "./lib/xyz.js", ResolveError::NotFound("./lib/xyz.js".into())), - ]; - - for (comment, path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Err(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn broken() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - // The browser field string value should be ignored - (f.clone(), "browser-module-broken", Ok(f.join("node_modules/browser-module-broken/main.js"))), - (f.join("browser-module"), "./number", Err(ResolveError::NotFound("./number".into()))), - ]; - - for (path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, expected, "{path:?} {request}"); - } -} - -#[test] -fn crypto_js() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - fallback: vec![( - "crypto".into(), - vec![AliasValue::from(f.join("lib.js").to_string_lossy())], - )], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(f.join("crypto-js"), "crypto").map(|r| r.full_path()); - assert_eq!(resolved_path, Err(ResolveError::Ignored(f.join("crypto-js")))); -} - -// https://github.com/webpack/webpack/blob/87660921808566ef3b8796f8df61bd79fc026108/test/cases/resolving/browser-field/index.js#L40-L43 -#[test] -fn recursive() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - let data = [ - ("should handle recursive file 1", f.clone(), "recursive-file/a"), - ("should handle recursive file 2", f.clone(), "recursive-file/b"), - ("should handle recursive file 3", f.clone(), "recursive-file/c"), - ("should handle recursive file 4", f, "recursive-file/d"), - ]; - - for (comment, path, request) in data { - let resolved_path = resolver.resolve(&path, request); - assert_eq!(resolved_path, Err(ResolveError::Recursion), "{comment} {path:?} {request}"); - } -} - -#[test] -fn with_query() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "./foo").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("lib").join("browser.js?query"))); -} diff --git a/src/tests/builtins.rs b/src/tests/builtins.rs deleted file mode 100644 index 5d6d14d9..00000000 --- a/src/tests/builtins.rs +++ /dev/null @@ -1,121 +0,0 @@ -use std::path::Path; - -use crate::{ResolveError, ResolveOptions, Resolver}; - -#[test] -fn builtins_off() { - let f = Path::new("/"); - let resolver = Resolver::default(); - let resolved_path = resolver.resolve(f, "zlib").map(|r| r.full_path()); - assert_eq!(resolved_path, Err(ResolveError::NotFound("zlib".into()))); -} - -#[test] -fn builtins() { - let f = Path::new("/"); - - let resolver = Resolver::new(ResolveOptions::default().with_builtin_modules(true)); - - let pass = [ - "_http_agent", - "_http_client", - "_http_common", - "_http_incoming", - "_http_outgoing", - "_http_server", - "_stream_duplex", - "_stream_passthrough", - "_stream_readable", - "_stream_transform", - "_stream_wrap", - "_stream_writable", - "_tls_common", - "_tls_wrap", - "assert", - "assert/strict", - "async_hooks", - "buffer", - "child_process", - "cluster", - "console", - "constants", - "crypto", - "dgram", - "diagnostics_channel", - "dns", - "dns/promises", - "domain", - "events", - "fs", - "fs/promises", - "http", - "http2", - "https", - "inspector", - "module", - "net", - "os", - "path", - "path/posix", - "path/win32", - "perf_hooks", - "process", - "punycode", - "querystring", - "readline", - "repl", - "stream", - "stream/consumers", - "stream/promises", - "stream/web", - "string_decoder", - "sys", - "timers", - "timers/promises", - "tls", - "trace_events", - "tty", - "url", - "util", - "util/types", - "v8", - "vm", - "worker_threads", - "zlib", - ]; - - for request in pass { - let prefixed_request = format!("node:{request}"); - for request in [prefixed_request.clone(), request.to_string()] { - let resolved_path = resolver.resolve(f, &request).map(|r| r.full_path()); - let err = ResolveError::Builtin(prefixed_request.clone()); - assert_eq!(resolved_path, Err(err), "{request}"); - } - } -} - -#[test] -fn fail() { - let f = Path::new("/"); - let resolver = Resolver::new(ResolveOptions::default().with_builtin_modules(true)); - let request = "xxx"; - let resolved_path = resolver.resolve(f, request); - let err = ResolveError::NotFound(request.to_string()); - assert_eq!(resolved_path, Err(err), "{request}"); -} - -#[test] -fn imports() { - let f = super::fixture().join("builtins"); - let resolver = Resolver::new(ResolveOptions { - builtin_modules: true, - condition_names: vec!["node".into()], - ..ResolveOptions::default() - }); - - for request in ["#fs", "#http"] { - let resolved_path = resolver.resolve(f.clone(), request).map(|r| r.full_path()); - let err = ResolveError::Builtin(format!("node:{}", request.trim_start_matches('#'))); - assert_eq!(resolved_path, Err(err)); - } -} diff --git a/src/tests/dependencies.rs b/src/tests/dependencies.rs deleted file mode 100644 index bcc2355b..00000000 --- a/src/tests/dependencies.rs +++ /dev/null @@ -1,110 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/dependencies.test.js - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows { - use rustc_hash::FxHashSet; - use std::path::PathBuf; - - use crate::{ResolveContext, ResolveOptions, ResolverGeneric}; - - use super::super::memory_fs::MemoryFS; - - fn file_system() -> MemoryFS { - MemoryFS::new(&[ - ("/a/b/node_modules/some-module/index.js", ""), - ("/a/node_modules/module/package.json", r#"{"main":"entry.js"}"#), - ("/a/node_modules/module/file.js", r#"{"main":"entry.js"}"#), - ("/modules/other-module/file.js", ""), - ]) - } - - #[test] - fn test() { - let file_system = file_system(); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - extensions: vec![".json".into(), ".js".into()], - modules: vec!["/modules".into(), "node_modules".into()], - ..ResolveOptions::default() - }, - ); - - let data = [ - ( - "middle module request", - "/a/b/c", - "module/file", - "/a/node_modules/module/file.js", - // These dependencies are different from enhanced-resolve due to different code path to - // querying the file system - vec![ - // 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", - // "/", - ], - vec![ - // missing package.jsons - // "/a/b/c/package.json", - "/a/b/package.json", - "/a/package.json", - "/package.json", - // missing modules directories - "/a/b/c", - // "/a/b/c/node_modules", - // missing single file modules - "/modules/module", - "/a/b/node_modules/module", - // missing files with alternative extensions - "/a/node_modules/module/file", - "/a/node_modules/module/file.json", - ], - ), - ( - "fast found module", - "/a/b/c", - "other-module/file.js", - "/modules/other-module/file.js", - // These dependencies are different from enhanced-resolve due to different code path to - // querying the file system - vec![ - // symlink checks - "/modules/other-module/file.js", - // "/modules/other-module", - // "/modules", - // "/", - ], - vec![ - // missing package.jsons - // "/a/b/c/package.json", - "/a/b/c", - "/a/b/package.json", - "/a/package.json", - "/package.json", - "/modules/other-module/package.json", - "/modules/package.json", - ], - ), - ]; - - for (name, context, request, result, file_dependencies, missing_dependencies) in data { - let mut ctx = ResolveContext::default(); - let path = PathBuf::from(context); - let resolved = - resolver.resolve_with_context(path, request, &mut ctx).map(|r| r.full_path()); - assert_eq!(resolved, Ok(PathBuf::from(result))); - let file_dependencies = - FxHashSet::from_iter(file_dependencies.iter().map(PathBuf::from)); - let missing_dependencies = - FxHashSet::from_iter(missing_dependencies.iter().map(PathBuf::from)); - assert_eq!(ctx.file_dependencies, file_dependencies, "{name}"); - assert_eq!(ctx.missing_dependencies, missing_dependencies, "{name}"); - } - } -} diff --git a/src/tests/exports_field.rs b/src/tests/exports_field.rs deleted file mode 100644 index 7ca73fbd..00000000 --- a/src/tests/exports_field.rs +++ /dev/null @@ -1,2546 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/exportsField.test.js -//! -//! The huge exports field test cases are at the bottom of this file. - -use crate::{Ctx, PathUtil, ResolveError, ResolveOptions, Resolver}; -use serde_json::json; -use std::path::Path; - -#[test] -fn test_simple() { - let f = super::fixture().join("exports-field"); - let f2 = super::fixture().join("exports-field2"); - let f4 = super::fixture().join("exports-field-error"); - let f5 = super::fixture().join("imports-exports-wildcard"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - fully_specified: true, - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("resolve root using exports field, not a main field", f.clone(), "exports-field", f.join("node_modules/exports-field/x.js")), - ("resolver should respect condition names", f.clone(), "exports-field/dist/main.js", f.join("node_modules/exports-field/lib/lib2/main.js")), - // enhanced_resolve behaves differently to node.js. enhanced_resolve fallbacks when an - // array item is unresolved, where as node.js fallbacks when an array has an - // InvalidPackageTarget error. - // ("resolver should respect fallback", f2.clone(), "exports-field/dist/browser.js", f2.join("node_modules/exports-field/lib/browser.js")), - // The following two tests require fallback from array values, the path is changed here to - // only test query and fragment. - ("resolver should respect query parameters #1", f2.clone(), "exports-field/dist/main.js?foo", f2.join("node_modules/exports-field/lib/lib2/main.js?foo")), - ("resolver should respect fragment parameters #1", f2.clone(), "exports-field/dist/main.js#foo", f2.join("node_modules/exports-field/lib/lib2/main.js#foo")), - ("relative path should work, if relative path as request is used", f.clone(), "./node_modules/exports-field/lib/main.js", f.join("node_modules/exports-field/lib/main.js")), - ("self-resolving root", f.clone(), "@exports-field/core", f.join("a.js")), - ("should resolve with wildcard pattern #1", f5.clone(), "m/features/f.js", f5.join("node_modules/m/src/features/f.js")), - ("should resolve with wildcard pattern #2", f5.clone(), "m/features/y/y.js", f5.join("node_modules/m/src/features/y/y.js")), - ("should resolve with wildcard pattern #3", f5.clone(), "m/features-no-ext/y/y.js", f5.join("node_modules/m/src/features/y/y.js")), - ("should resolve with wildcard pattern #4", f5.clone(), "m/middle/nested/f.js", f5.join("node_modules/m/src/middle/nested/f.js")), - ("should resolve with wildcard pattern #5", f5.clone(), "m/middle-1/nested/f.js", f5.join("node_modules/m/src/middle-1/nested/f.js")), - ("should resolve with wildcard pattern #6", f5.clone(), "m/middle-2/nested/f.js", f5.join("node_modules/m/src/middle-2/nested/f.js")), - ("should resolve with wildcard pattern #7", f5.clone(), "m/middle-3/nested/f", f5.join("node_modules/m/src/middle-3/nested/f/nested/f.js")), - ("should resolve with wildcard pattern #8", f5.clone(), "m/middle-4/f/nested", f5.join("node_modules/m/src/middle-4/f/f.js")), - ("should resolve with wildcard pattern #9", f5.clone(), "m/middle-5/f$/$", f5.join("node_modules/m/src/middle-5/f$/$.js")), - ]; - - // Not needed or snapshot: - // * should log the correct info - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } - - let p = f.join("node_modules/exports-field/package.json"); - let p2 = f2.join("node_modules/exports-field/package.json"); - let p4 = f4.join("node_modules/exports-field/package.json"); - let p5 = f5.join("node_modules/m/package.json"); - - #[rustfmt::skip] - let fail = [ - // ("throw error if extension not provided", f2.clone(), "exports-field/dist/main", ResolveError::NotFound(f2.join("node_modules/exports-field/lib/lib2/main"))), - ("resolver should respect query parameters #2. Direct matching", f2.clone(), "exports-field?foo", ResolveError::PackagePathNotExported("./?foo".into(), p2.clone())), - ("resolver should respect fragment parameters #2. Direct matching", f2, "exports-field#foo", ResolveError::PackagePathNotExported("./#foo".into(), p2)), - ("relative path should not work with exports field", f.clone(), "./node_modules/exports-field/dist/main.js", ResolveError::NotFound("./node_modules/exports-field/dist/main.js".into())), - ("backtracking should not work for request", f.clone(), "exports-field/dist/../../../a.js", ResolveError::InvalidPackageTarget("./lib/../../../a.js".to_string(), "./dist/".to_string(), p.clone())), - ("backtracking should not work for exports field target", f.clone(), "exports-field/dist/a.js", ResolveError::InvalidPackageTarget("./../../a.js".to_string(), "./dist/a.js".to_string(), p.clone())), - ("not exported error", f.clone(), "exports-field/anything/else", ResolveError::PackagePathNotExported("./anything/else".to_string(), p.clone())), - ("request ending with slash #1", f.clone(), "exports-field/", ResolveError::PackagePathNotExported("./".to_string(), p.clone())), - ("request ending with slash #2", f.clone(), "exports-field/dist/", ResolveError::PackagePathNotExported("./dist/".to_string(), p.clone())), - ("request ending with slash #3", f.clone(), "exports-field/lib/", ResolveError::PackagePathNotExported("./lib/".to_string(), p)), - ("should throw error if target is invalid", f4, "exports-field", ResolveError::InvalidPackageTarget("./a/../b/../../pack1/index.js".to_string(), ".".to_string(), p4)), - ("throw error if exports field is invalid", f.clone(), "invalid-exports-field", ResolveError::InvalidPackageConfig(f.join("node_modules/invalid-exports-field/package.json"))), - ("should throw error if target is 'null'", f5, "m/features/internal/file.js", ResolveError::PackagePathNotExported("./features/internal/file.js".to_string(), p5)), - ]; - - for (comment, path, request, error) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!(resolution, Err(error), "{comment} {path:?} {request}"); - } -} - -// resolve using exports field, not a browser field #1 -#[test] -fn exports_not_browser_field1() { - let f = super::fixture().join("exports-field"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - condition_names: vec!["webpack".into()], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "exports-field/dist/main.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("node_modules/exports-field/lib/lib2/main.js"))); -} - -// resolve using exports field and a browser alias field #2 -#[test] -fn exports_not_browser_field2() { - let f2 = super::fixture().join("exports-field2"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - extensions: vec![".js".into()], - condition_names: vec!["node".into()], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f2, "exports-field/dist/main.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f2.join("node_modules/exports-field/lib/browser.js"))); -} - -// should resolve extension without fullySpecified -#[test] -fn extension_without_fully_specified() { - let f2 = super::fixture().join("exports-field2"); - - let commonjs_resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - let resolved_path = - commonjs_resolver.resolve(&f2, "exports-field/dist/main").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f2.join("node_modules/exports-field/lib/lib2/main.js"))); -} - -#[test] -fn field_name_path() { - let f2 = super::fixture().join("exports-field2"); - let f3 = super::fixture().join("exports-field3"); - - // field name path #1 #2 #3 - let exports_fields = [ - vec![vec!["exportsField".into(), "exports".into()]], - vec![vec!["exportsField".into(), "exports".into()], vec!["exports".into()]], - vec![vec!["exports".into()], vec!["exportsField".into(), "exports".into()]], - ]; - - for exports_fields in exports_fields { - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - exports_fields, - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/main.js"))); - } - - // field name path #4 - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - exports_fields: vec![vec!["exports".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f2, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f2.join("node_modules/exports-field/index.js"))); - - // field name path #5 - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - exports_fields: vec![vec!["ex".into()], vec!["exports_field".into(), "exports".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/index"))); - - // non-compliant export targeting a directory - let resolver = Resolver::new(ResolveOptions { - exports_fields: vec![vec!["broken".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/src/index.js"))); -} - -#[test] -fn shared_resolvers() { - let f3 = super::fixture().join("exports-field3"); - - let resolver1 = Resolver::new(ResolveOptions { - exports_fields: vec![vec!["exportsField".into(), "exports".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver1.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/main.js"))); - - let resolver2 = resolver1.clone_with_options(ResolveOptions { - exports_fields: vec![vec!["ex".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver2.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/index"))); -} - -#[test] -fn extension_alias_1_2() { - let f = super::fixture().join("exports-field-and-extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - extension_alias: vec![(".js".into(), vec![".ts".into(), ".js".into()])], - fully_specified: true, - condition_names: vec!["webpack".into(), "default".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve with the `extensionAlias` option", f.clone(), "@org/pkg/string.js", f.join("node_modules/@org/pkg/dist/string.js")), - ("should resolve with the `extensionAlias` option #2", f.clone(), "pkg/string.js", f.join("node_modules/pkg/dist/string.js")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn extension_alias_3() { - let f = super::fixture().join("exports-field-and-extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - extension_alias: vec![( - ".js".into(), - vec![".foo".into(), ".baz".into(), ".baz".into(), ".ts".into(), ".js".into()], - )], - fully_specified: true, - condition_names: vec!["webpack".into(), "default".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve with the `extensionAlias` option #3", f.clone(), "pkg/string.js", f.join("node_modules/pkg/dist/string.js")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn extension_alias_throw_error() { - let f = super::fixture().join("exports-field-and-extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - extension_alias: vec![(".js".into(), vec![".ts".into()])], - fully_specified: true, - condition_names: vec!["webpack".into(), "default".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let fail = [ - // enhanced-resolve has two test cases that are exactly the same here - // https://github.com/webpack/enhanced-resolve/blob/a998c7d218b7a9ec2461fc4fddd1ad5dd7687485/test/exportsField.test.js#L2976-L3024 - ("should throw error with the `extensionAlias` option", f.clone(), "pkg/string.js", ResolveError::ExtensionAlias(f.join("node_modules/pkg/dist/string.js"))), - // TODO: The error is PackagePathNotExported in enhanced-resolve - // ("should throw error with the `extensionAlias` option", f.clone(), "pkg/string.js", ResolveError::PackagePathNotExported("node_modules/pkg/dist/string.ts".to_string())), - ]; - - for (comment, path, request, error) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!(resolution, Err(error), "{comment} {path:?} {request}"); - } -} - -// Small script for generating the test cases from enhanced-resolve -// for (c of testCases) { -// console.log("TestCase {") -// console.log(`name: ${JSON.stringify(c.name)},`) -// if (c.expect instanceof Error) { -// console.log(`expect: None,`) -// } else { -// console.log(`expect: Some(vec!${JSON.stringify(c.expect)}),`) -// } -// console.log(`exports_field: exports_field(json!(${JSON.stringify(c.suite[0], null, 2)})),`) -// console.log(`request: "${c.suite[1]}",`) -// console.log(`condition_names: vec!${JSON.stringify(c.suite[2])},`) -// console.log("},") -//} -struct TestCase { - name: &'static str, - expect: Option>, - exports_field: serde_json::Value, - request: &'static str, - condition_names: Vec<&'static str>, -} - -#[allow(clippy::needless_pass_by_value)] -fn exports_field(value: serde_json::Value) -> serde_json::Value { - value -} - -#[test] -fn test_cases() { - let test_cases = [ - TestCase { - name: "sample #1", - expect: Some(vec!["./dist/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/": { - "import": [ - "./dist/", - "./src/" - ], - "webpack": "./wp/" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "sample #1", - expect: Some(vec!["./src/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/": { - "import": [ - "./src/" - ], - "webpack": "./wp/" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - TestCase { - name: "sample #1 (wildcard)", - expect: Some(vec!["./dist/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/*": { - "import": [ - "./dist/*", - "./src/*" - ], - "webpack": "./wp/*" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "sample #1 (wildcard)", - expect: Some(vec!["./src/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/*": { - "import": [ - "./src/*" - ], - "webpack": "./wp/*" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - TestCase { - name: "sample #2", - expect: Some(vec!["./data/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./timezones/": "./data/timezones/" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #2 (wildcard)", - expect: Some(vec!["./data/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./timezones/*": "./data/timezones/*" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #3", - expect: Some(vec!["./data/timezones/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./": "./data/timezones/" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #3 (wildcard)", - expect: Some(vec!["./data/timezones/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./*": "./data/timezones/*.mjs" - })), - request: "./timezones/pdt", - condition_names: vec![], - }, - TestCase { - name: "sample #4", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./lib/": { - "browser": [ - "./browser/" - ] - }, - "./dist/index.js": { - "node": "./index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #4 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "node": "./index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #5", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/": { - "browser": [ - "./browser/" - ] - }, - "./dist/index.js": { - "node": "./index.js", - "default": "./browser/index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #5 (wildcard)", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "node": "./index.js", - "default": "./browser/index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./dist/a": "./dist/index.js" - })), - request: "./dist/aaa", - condition_names: vec![], - }, - TestCase { - name: "sample #7", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./dist/a/a/": "./dist/index.js" - })), - request: "./dist/a/a", - condition_names: vec![], - }, - TestCase { - name: "sample #7 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./dist/a/a/*": "./dist/index.js" - })), - request: "./dist/a/a", - condition_names: vec![], - }, - TestCase { - name: "sample #8", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": "./index.js" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #9", - expect: Some(vec!["./main.js"]), - exports_field: exports_field(json!({ - "./index.js": "./main.js" - })), - request: "./index.js", - condition_names: vec![], - }, - TestCase { - name: "sample #10", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #11", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./bar#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #12", - expect: Some(vec!["./ok.js#abc"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/ok.js#abc", - condition_names: vec![], - }, - TestCase { - name: "sample #12", - expect: Some(vec!["./ok.js#abc"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/ok.js#abc", - condition_names: vec![], - }, - TestCase { - name: "sample #13", - expect: Some(vec!["./ok.js?abc"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/ok.js?abc", - condition_names: vec![], - }, - TestCase { - name: "sample #14", - expect: Some(vec!["./🎉.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/🎉.js", - condition_names: vec![], - }, - TestCase { - name: "sample #15", - expect: Some(vec!["./%F0%9F%8E%89.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/%F0%9F%8E%89.js", - condition_names: vec![], - }, - TestCase { - name: "sample #16", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./🎉", - condition_names: vec![], - }, - TestCase { - name: "sample #17", - expect: Some(vec!["./other.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./%F0%9F%8E%89", - condition_names: vec![], - }, - TestCase { - name: "sample #18", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./module", - condition_names: vec![], - }, - TestCase { - name: "sample #19", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./module#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #20", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./module?foo", - condition_names: vec![], - }, - TestCase { - name: "sample #21", - expect: Some(vec!["./zizizi"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./z*z*z*" - })), - request: "./#zippi", - condition_names: vec![], - }, - TestCase { - name: "sample #22", - expect: Some(vec!["./d?e?f"]), - exports_field: exports_field(json!({ - "./a?b?c/": "./" - })), - request: "./a?b?c/d?e?f", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #1", - expect: Some(vec!["./dist/index.js"]), - exports_field: exports_field(json!({ - ".": "./dist/index.js" - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #2", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./": "./", - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #3", - expect: Some(vec!["./dist/a.js"]), - exports_field: exports_field(json!({ - "./dist/": "./dist/", - "./dist/*": "./dist/*", - "./dist*": "./dist*", - "./dist/index.js": "./dist/a.js" - })), - request: "./dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #4", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./": { - "browser": [ - "./browser/" - ] - }, - "./*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "browser": "./index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #5", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./": { - "browser": [ - "./browser/" - ] - }, - "./*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "node": "./node.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #6", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - ".": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #7", - expect: Some(vec!["./src/index.js"]), // `enhanced_resolve` is `None` - exports_field: exports_field(json!({ - ".": { - "default": "./src/index.js", - "browser": "./index.js", - "node": "./src/node/index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #8", - expect: Some(vec!["./src/index.js"]), - exports_field: exports_field(json!({ - ".": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #9", - expect: Some(vec!["./index"]), - exports_field: exports_field(json!({ - ".": "./index" - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #10", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./index": "./index.js" - })), - request: "./index", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #11", - expect: Some(vec!["./foo.js"]), - exports_field: exports_field(json!({ - "./": "./", - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #12", - expect: Some(vec!["./foo/bar/baz.js"]), - exports_field: exports_field(json!({ - "./": "./", - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo/bar/baz.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #13", - expect: Some(vec!["./foo/bar/baz.js"]), - exports_field: exports_field(json!({ - "./": "./", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo/bar/baz.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #14", - expect: Some(vec!["./foo/bar/baz.js"]), - exports_field: exports_field(json!({ - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo/bar/baz.js", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #1", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "require": "./require.js" - }, { - "import": "./import.mjs" - }] - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #2", - expect: Some(vec!["./import.mjs"]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "require": "./require.js" - }, { - "import": "./import.mjs" - }] - })), - request: ".", - condition_names: vec!["import"], - }, - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./require.js"]), - exports_field: exports_field(json!({ - ".": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./import.mjs"]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "import": "./import.mjs" - }] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./require.js"]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "require": [ - "./require.js" - ] - }, { - "import": [ - "./import.mjs", - "./import.js" - ] - }] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./import.mjs"]), - exports_field: exports_field(json!({ - ".": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "./import.mjs", - "./import.js" - ] - } - ] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./import.js"]), - exports_field: exports_field(json!({ - ".": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "./import.js" - ] - } - ] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "mapping to a folder root #1", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./timezones": "./data/timezones/" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #2", - expect: None, - exports_field: exports_field(json!({ - "./timezones/": "./data/timezones" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #3", - expect: Some(vec!["./data/timezones/pdt/index.mjs"]), - exports_field: exports_field(json!({ - "./timezones/pdt/": "./data/timezones/pdt/" - })), - request: "./timezones/pdt/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #3 (wildcard)", - expect: Some(vec!["./data/timezones/pdt/index.mjs"]), - exports_field: exports_field(json!({ - "./timezones/pdt/*": "./data/timezones/pdt/*" - })), - request: "./timezones/pdt/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #4", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./": "./timezones/" - })), - request: "./pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #4 (wildcard)", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./*": "./timezones/*" - })), - request: "./pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #5", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./": "./" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #5 (wildcard)", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./*": "./*" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #6", - expect: None, - exports_field: exports_field(json!({ - "./": "." - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #6 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "./*": "." - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #7", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": "./" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #7 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": "./*" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #1", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./": "./", - "./dist/": "./lib/" - })), - request: "./dist/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #1 (wildcard)", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./*": "./*", - "./dist/*": "./lib/*" - })), - request: "./dist/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #2", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/": "./dist/utils/", - "./dist/": "./lib/" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #2 (wildcard)", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/*": "./dist/utils/*", - "./dist/*": "./lib/*" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #3", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/index.js": "./dist/utils/index.js", - "./dist/utils/": "./dist/utils/index.mjs", - "./dist/": "./lib/" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #3 (wildcard)", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/index.js": "./dist/utils/index.js", - "./dist/utils/*": "./dist/utils/index.mjs", - "./dist/*": "./lib/*" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #4", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./": { - "browser": "./browser/" - }, - "./dist/": "./lib/" - })), - request: "./dist/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "the longest matching path prefix is prioritized #4 (wildcard)", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./*": { - "browser": "./browser/*" - }, - "./dist/*": "./lib/*" - })), - request: "./dist/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #1", - // `lodash/` does not start with './' so fallbacks to util - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "conditional mapping folder #1", - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": [ - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #1 (wildcard)", - // `lodash/` does not start with './' so fallbacks to util - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": [ - "lodash/*", - "./utils/*" - ], - "node": [ - "./utils-node/*" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "conditional mapping folder #1 (wildcard)", - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": [ - "./utils/*" - ], - "node": [ - "./utils-node/*" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #2", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./node/" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "conditional mapping folder #2 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "webpack": "./wpk/*", - "browser": [ - "lodash/*", - "./utils/*" - ], - "node": [ - "./node/*" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "conditional mapping folder #3", - expect: Some(vec!["./wpk/index.mjs"]), - exports_field: exports_field(json!({ - "./utils/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils/" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "conditional mapping folder #3 (wildcard)", - expect: Some(vec!["./wpk/index.mjs"]), - exports_field: exports_field(json!({ - "./utils/*": { - "webpack": "./wpk/*", - "browser": [ - "lodash/*", - "./utils/*" - ], - "node": [ - "./utils/*" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "incorrect exports field #1", - expect: None, - exports_field: exports_field(json!({ - "/utils/": "./a/" - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #2", - expect: None, - exports_field: exports_field(json!({ - "./utils/": "/a/" - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #3", - expect: None, - exports_field: exports_field(json!({ - "/utils/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #4", - expect: None, - exports_field: exports_field(json!({ - "./utils/": { - "browser": "/a/", - "default": "/b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #4 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "/a/", - "default": "/b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #5", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index": "./a/index.js" - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index.mjs": "./a/index.js" - })), - request: "./utils/index", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #7", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #8", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index.mjs": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - // Requests that are not `./` does not apply to `package_exports_resolve` - // TestCase { - // name: "incorrect request #1", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": "./a/" - // })), - // request: "/utils/index.mjs", - // condition_names: vec![], - // }, - // TestCase { - // name: "incorrect request #2", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": { - // "browser": "./a/", - // "default": "./b/" - // } - // })), - // request: "/utils/index.mjs", - // condition_names: vec!["browser"], - // }, - // TestCase { - // name: "incorrect request #3", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": { - // "browser": "./a/", - // "default": "./b/" - // } - // })), - // request: "../utils/index.mjs", - // condition_names: vec!["browser"], - // }, - // TestCase { - // name: "incorrect request #4", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": { - // "browser": "./a/", - // "default": "./b/" - // } - // })), - // request: "/utils/index.mjs/", - // condition_names: vec!["browser"], - // }, - TestCase { - name: "backtracking package base #1", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./../../utils/": "./dist/" - })), - request: "./../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #1 (wildcard)", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./../../utils/*": "./dist/*" - })), - request: "./../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #2", - expect: None, - exports_field: exports_field(json!({ - "../../utils/": "./dist/" - })), - request: "../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #2 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "../../utils/*": "./dist/*" - })), - request: "../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #3", - expect: None, - exports_field: exports_field(json!({ - "./utils/": "../src/" - })), - request: "./utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #3 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "./utils/*": "../src/*" - })), - request: "./utils/index", - condition_names: vec![], - }, - // enhanced-resolve does not handle backtracking here - // TestCase { - // name: "backtracking package base #4", - // expect: Some(vec!["./../src/index"]), - // exports_field: exports_field(json!({ - // "./utils/": "./../src/" - // })), - // request: "./utils/index", - // condition_names: vec![], - // }, - // TestCase { - // name: "backtracking package base #4 (wildcard)", - // expect: Some(vec!["./../src/index"]), - // exports_field: exports_field(json!({ - // "./utils/*": "./../src/*" - // })), - // request: "./utils/index", - // condition_names: vec![], - // }, - // TestCase { - // name: "backtracking package base #5", - // expect: Some(vec!["./src/../index.js"]), - // exports_field: exports_field(json!({ - // "./utils/index": "./src/../index.js" - // })), - // request: "./utils/index", - // condition_names: vec![], - // }, - TestCase { - name: "backtracking package base #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/../utils/index": "./src/../index.js" - })), - request: "./utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #7", - expect: None, - exports_field: exports_field(json!({ - "./utils/": { - "browser": "../this/" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #7", - expect: None, - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "../this/*" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #8", - // We throw "InvalidPackageTarget" - // expect: Some(vec!["./utils/../index"]), - expect: None, - exports_field: exports_field(json!({ - "./utils/": { - "browser": "./utils/../" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #8 (wildcard)", - // We throw "InvalidPackageTarget" - // expect: Some(vec!["./utils/../index"]), - expect: None, - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "./utils/../*" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #9", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./": "./src/../../", - "./dist/": "./dist/" - })), - request: "./dist/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #9 (wildcard)", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./*": "./src/../../*", - "./dist/*": "./dist/*" - })), - request: "./dist/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking target folder #1", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../../index"]), - exports_field: exports_field(json!({ - "./utils/": "./dist/" - })), - request: "./utils/timezone/../../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #1 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../../index"]), - exports_field: exports_field(json!({ - "./utils/*": "./dist/*" - })), - request: "./utils/timezone/../../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #2", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../index"]), - exports_field: exports_field(json!({ - "./utils/": "./dist/" - })), - request: "./utils/timezone/../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #2 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../index"]), - exports_field: exports_field(json!({ - "./utils/*": "./dist/*" - })), - request: "./utils/timezone/../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #3", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/target/../../index"]), - exports_field: exports_field(json!({ - "./utils/": "./dist/target/" - })), - request: "./utils/../../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #3 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/target/../../index"]), - exports_field: exports_field(json!({ - "./utils/*": "./dist/target/*" - })), - request: "./utils/../../index", - condition_names: vec![], - }, - // enhanced-resolve does not handle `node_modules` in target - TestCase { - name: "nested node_modules path #1", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": "./node_modules/" - } - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #1 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "./node_modules/*" - } - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #2", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./utils/../node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/": "./utils/../node_modules/" - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "nested node_modules path #2 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./utils/../node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": "./utils/../node_modules/*" - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "nested mapping #1", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": "./", - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested mapping #1 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": "./*", - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "nested mapping #2 (wildcard)", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #2 (wildcard)", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "nested mapping #3", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["webpack"], - }, - TestCase { - name: "nested mapping #3 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["webpack"], - }, - TestCase { - name: "nested mapping #4", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["node", "browser"], - }, - TestCase { - name: "nested mapping #4 (wildcard)", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["node", "browser"], - }, - TestCase { - name: "nested mapping #5", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node"], - }, - TestCase { - name: "nested mapping #5 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": { - "webpack": [ - "./wpck/*" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node"], - }, - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - TestCase { - name: "nested mapping #6 (wildcard)", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": { - "webpack": [ - "./wpck/*" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #6 (wildcard)", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./node/*" - ], - "default": { - "node": { - "webpack": [ - "./wpck/*" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - TestCase { - name: "nested mapping #7", - expect: Some(vec!["./y.js"]), - exports_field: exports_field(json!({ - "./a.js": { - "abc": { - "def": "./x.js" - }, - "ghi": "./y.js" - } - })), - request: "./a.js", - condition_names: vec!["abc", "ghi"], - }, - TestCase { - name: "nested mapping #8", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./a.js": { - "abc": { - "def": "./x.js", - "default": [] - }, - "ghi": "./y.js" - } - })), - request: "./a.js", - condition_names: vec!["abc", "ghi"], - }, - TestCase { - name: "syntax sugar #1", - expect: Some(vec!["./main.js"]), - exports_field: exports_field(json!("./main.js")), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #2", - expect: Some(vec![]), - exports_field: exports_field(json!("./main.js")), - request: "./lib.js", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #3", - expect: Some(vec!["./a.js"]), - exports_field: exports_field(json!(["./a.js", "./b.js"])), - request: ".", - condition_names: vec![], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "syntax sugar #3", - expect: Some(vec!["./b.js"]), - exports_field: exports_field(json!(["./b.js"])), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #4", - expect: Some(vec![]), - exports_field: exports_field(json!(["./a.js", "./b.js"])), - request: "./lib.js", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #5", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "browser": { - "default": "./index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "syntax sugar #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "browser": { - "default": "./index.js" - } - })), - request: "./lib.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "syntax sugar #7", - expect: None, - exports_field: exports_field(json!({ - "./node": "./node.js", - "browser": { - "default": "./index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "syntax sugar #8", - expect: None, - exports_field: exports_field(json!({ - "browser": { - "default": "./index.js" - }, - "./node": "./node.js" - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #1", - expect: Some(vec!["./abc/d"]), - exports_field: exports_field(json!({ - "./ab*": "./ab/*", - "./abc*": "./abc/*", - "./a*": "./a/*" - })), - request: "./abcd", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #2", - expect: Some(vec!["./abc/d/e"]), - exports_field: exports_field(json!({ - "./ab*": "./ab/*", - "./abc*": "./abc/*", - "./a*": "./a/*" - })), - request: "./abcd/e", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #3", - expect: Some(vec!["./abc/d"]), - exports_field: exports_field(json!({ - "./x/ab*": "./ab/*", - "./x/abc*": "./abc/*", - "./x/a*": "./a/*" - })), - request: "./x/abcd", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #4", - expect: Some(vec!["./abc/d/e"]), - exports_field: exports_field(json!({ - "./x/ab*": "./ab/*", - "./x/abc*": "./abc/*", - "./x/a*": "./a/*" - })), - request: "./x/abcd/e", - condition_names: vec!["browser"], - }, - TestCase { - name: "path tree edge case #1", - expect: Some(vec!["./A/b/d.js"]), - exports_field: exports_field(json!({ - "./a/": "./A/", - "./a/b/c": "./c.js" - })), - request: "./a/b/d.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #1 (wildcard)", - expect: Some(vec!["./A/b/d.js"]), - exports_field: exports_field(json!({ - "./a/*": "./A/*", - "./a/b/c": "./c.js" - })), - request: "./a/b/d.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #2", - expect: Some(vec!["./A/c.js"]), - exports_field: exports_field(json!({ - "./a/": "./A/", - "./a/b": "./b.js" - })), - request: "./a/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #2 (wildcard)", - expect: Some(vec!["./A/c.js"]), - exports_field: exports_field(json!({ - "./a/*": "./A/*", - "./a/b": "./b.js" - })), - request: "./a/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #3", - expect: Some(vec!["./A/b/d/c.js"]), - exports_field: exports_field(json!({ - "./a/": "./A/", - "./a/b/c/d": "./c.js" - })), - request: "./a/b/d/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #3 (wildcard)", - expect: Some(vec!["./A/b/d/c.js"]), - exports_field: exports_field(json!({ - "./a/*": "./A/*", - "./a/b/c/d": "./c.js" - })), - request: "./a/b/d/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #1", - expect: Some(vec!["./A/b.js"]), - exports_field: exports_field(json!({ - "./a/*.js": "./A/*.js" - })), - request: "./a/b.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #2", - expect: Some(vec!["./A/b/c.js"]), - exports_field: exports_field(json!({ - "./a/*.js": "./A/*.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #3", - expect: Some(vec!["./A/b/c.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": "./A/*/c.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #4", - expect: Some(vec!["./A/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": "./A/*/*.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #5", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/*.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #5", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/*.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./lib/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #6", - expect: Some(vec!["./browser/foo/bar.js"]), - exports_field: exports_field(json!({ - "./lib/*/bar.js": { - "browser": [ - "./browser/*/bar.js" - ] - }, - "./dist/*/bar.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./lib/foo/bar.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #6", - expect: Some(vec!["./browser/foo.js"]), - exports_field: exports_field(json!({ - "./lib/*/bar.js": { - "browser": [ - "./browser/*/bar.js" - ] - }, - "./dist/*/bar.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./dist/foo/bar.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #7", - expect: Some(vec!["./browser/foo/default.js"]), - exports_field: exports_field(json!({ - "./lib/*/bar.js": { - "browser": [ - "./browser/*/bar.js" - ] - }, - "./dist/*/bar.js": { - "node": "./*.js", - "default": "./browser/*/default.js" - } - })), - request: "./dist/foo/bar.js", - condition_names: vec!["default"], - }, - TestCase { - name: "wildcard pattern #8", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": "./A/*/*/*.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #9", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": [ - "./A/*/*/*.js", - "./B/*/*/*.js" - ] - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "wildcard pattern #9", - expect: Some(vec!["./B/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": [ - "./B/*/*/*.js" - ] - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #10", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/foo-*/c.js": "./A/*/*/*.js" - })), - request: "./a/foo-b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #11", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*-foo/c.js": "./A/*/*/*.js" - })), - request: "./a/b-foo/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #12", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/foo-*-foo/c.js": "./A/*/*/*.js" - })), - request: "./a/foo-b-foo/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #13", - expect: Some(vec!["./A/b/c/d.js"]), - exports_field: exports_field(json!({ - "./a/foo-*-foo/c.js": "./A/b/c/d.js" - })), - request: "./a/foo-b-foo/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #14", - expect: Some(vec!["./A/b/c/*.js"]), - exports_field: exports_field(json!({ - "./a/foo-foo/c.js": "./A/b/c/*.js" - })), - request: "./a/foo-foo/c.js", - condition_names: vec![], - }, - ]; - - for case in test_cases { - let resolved = Resolver::new(ResolveOptions { - condition_names: case - .condition_names - .iter() - .map(ToString::to_string) - .collect::>(), - ..ResolveOptions::default() - }) - .package_exports_resolve( - Path::new(""), - case.request, - &case.exports_field, - &mut Ctx::default(), - ) - .map(|p| p.map(|p| p.to_path_buf())); - if let Some(expect) = case.expect { - if expect.is_empty() { - assert!( - matches!(resolved, Err(ResolveError::PackagePathNotExported(_, _))), - "{} {:?}", - &case.name, - &resolved - ); - } else { - for expect in expect { - assert_eq!(resolved, Ok(Some(Path::new(expect).normalize())), "{}", &case.name); - } - } - } else { - assert!(resolved.is_err(), "{} {resolved:?}", &case.name); - } - } -} diff --git a/src/tests/extension_alias.rs b/src/tests/extension_alias.rs deleted file mode 100644 index cc6a906b..00000000 --- a/src/tests/extension_alias.rs +++ /dev/null @@ -1,70 +0,0 @@ -//! - -use crate::{ResolveError, ResolveOptions, Resolver}; - -#[test] -fn extension_alias() { - let f = super::fixture().join("extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - extension_alias: vec![ - (".js".into(), vec![".ts".into(), ".js".into()]), - (".mjs".into(), vec![".mts".into()]), - ], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should alias fully specified file", f.clone(), "./index.js", f.join("index.ts")), - ("should alias fully specified file when there are two alternatives", f.clone(), "./dir/index.js", f.join("dir/index.ts")), - ("should also allow the second alternative", f.clone(), "./dir2/index.js", f.join("dir2/index.js")), - ("should support alias option without an array", f.clone(), "./dir2/index.mjs", f.join("dir2/index.mts")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } - - #[rustfmt::skip] - let fail = [ - ("should not allow to fallback to the original extension or add extensions", f.clone(), "./index.mjs"), - ]; - - for (comment, path, request) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!( - resolution, - Err(ResolveError::ExtensionAlias(f.join(request))), - "{comment} {path:?} {request}" - ); - } -} - -// should not apply extension alias to extensions or mainFiles field -#[test] -fn not_apply_to_extension_nor_main_files() { - let f = super::fixture().join("extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - extension_alias: vec![(".js".into(), vec![])], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("directory", f.clone(), "./dir2", "dir2/index.js"), - ("file", f.clone(), "./dir2/index", "dir2/index.js"), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - let expected = f.join(expected); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} diff --git a/src/tests/extensions.rs b/src/tests/extensions.rs deleted file mode 100644 index 1ebd86f4..00000000 --- a/src/tests/extensions.rs +++ /dev/null @@ -1,125 +0,0 @@ -//! - -use crate::{EnforceExtension, Resolution, ResolveContext, ResolveError, ResolveOptions, Resolver}; -use rustc_hash::FxHashSet; - -#[test] -fn extensions() { - let f = super::fixture().join("extensions"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".ts".into(), ".js".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve according to order of provided extensions", "./foo", "foo.ts"), - ("should resolve according to order of provided extensions (dir index)", "./dir", "dir/index.ts"), - ("should resolve according to main field in module root", ".", "index.js"), - // This is a core module - // ("should resolve single file module before directory", "module", "node_modules/module.js"), - ("should resolve trailing slash directory before single file", "module/", "node_modules/module/index.ts"), - ]; - - for (comment, request, expected_path) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - let expected = f.join(expected_path); - assert_eq!(resolved_path, Ok(expected), "{comment} {request} {expected_path}"); - } - - #[rustfmt::skip] - let fail = [ - ("not resolve to file when request has a trailing slash (relative)", "./foo.js/", "./foo.js/".into()) - ]; - - for (comment, request, expected_error) in fail { - let resolution = resolver.resolve(&f, request); - let error = ResolveError::NotFound(expected_error); - assert_eq!(resolution, Err(error), "{comment} {request} {resolution:?}"); - } -} - -// should default enforceExtension to true when extensions includes an empty string -#[test] -fn default_enforce_extension() { - let f = super::fixture().join("extensions"); - - let mut ctx = ResolveContext::default(); - let resolved = Resolver::new(ResolveOptions { - extensions: vec![".ts".into(), String::new(), ".js".into()], - ..ResolveOptions::default() - }) - .resolve_with_context(&f, "./foo", &mut ctx); - - assert_eq!(resolved.map(Resolution::into_path_buf), Ok(f.join("foo.ts"))); - assert_eq!( - ctx.file_dependencies, - FxHashSet::from_iter([f.join("foo.ts"), f.join("package.json")]) - ); - assert!(ctx.missing_dependencies.is_empty()); -} - -// should respect enforceExtension when extensions includes an empty string -#[test] -fn respect_enforce_extension() { - let f = super::fixture().join("extensions"); - - let mut ctx = ResolveContext::default(); - let resolved = Resolver::new(ResolveOptions { - enforce_extension: EnforceExtension::Disabled, - extensions: vec![".ts".into(), String::new(), ".js".into()], - ..ResolveOptions::default() - }) - .resolve_with_context(&f, "./foo", &mut ctx); - - assert_eq!(resolved.map(Resolution::into_path_buf), Ok(f.join("foo.ts"))); - assert_eq!( - ctx.file_dependencies, - FxHashSet::from_iter([f.join("foo.ts"), f.join("package.json")]) - ); - assert_eq!(ctx.missing_dependencies, FxHashSet::from_iter([f.join("foo")])); -} - -#[test] -fn multi_dot_extension() { - let f = super::fixture().join("extensions"); - - let resolver = Resolver::new(ResolveOptions { - // Test for `.d.ts`, not part of enhanced-resolve. - extensions: vec![".a.b.c".into(), ".d.ts".into(), ".ts".into(), ".js".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve according to order of provided extensions", "./foo", "foo.ts"), - ("should resolve file with extension", "./app.module", "app.module.js") - ]; - - for (comment, request, expected_path) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - let expected = f.join(expected_path); - assert_eq!(resolved_path, Ok(expected), "{comment} {request} {expected_path}"); - } - - #[rustfmt::skip] - let fail = [ - ("not resolve to file", "./index.", "./index.".into()) - ]; - - for (comment, request, expected_error) in fail { - let resolution = resolver.resolve(&f, request); - let error = ResolveError::NotFound(expected_error); - assert_eq!(resolution, Err(error), "{comment} {request} {resolution:?}"); - } -} - -#[test] -#[should_panic = "All extensions must start with a leading dot"] -fn without_leading_dot() { - Resolver::new(ResolveOptions { - extensions: vec!["ts".into(), "js".into()], - ..ResolveOptions::default() - }); -} diff --git a/src/tests/fallback.rs b/src/tests/fallback.rs deleted file mode 100644 index 3da2d767..00000000 --- a/src/tests/fallback.rs +++ /dev/null @@ -1,100 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/fallback.test.js - -#[test] -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -fn fallback() { - use super::memory_fs::MemoryFS; - use crate::{AliasValue, ResolveError, ResolveOptions, ResolverGeneric}; - use std::path::{Path, PathBuf}; - - let f = Path::new("/"); - - let file_system = MemoryFS::new(&[ - ("/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", ""), - ]); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - fallback: vec![ - ("aliasA".into(), vec![AliasValue::Path("a".into())]), - ("b$".into(), vec![AliasValue::Path("a/index".into())]), - ("c$".into(), vec![AliasValue::Path("/a/index".into())]), - ( - "multiAlias".into(), - vec![ - AliasValue::Path("b".into()), - AliasValue::Path("c".into()), - AliasValue::Path("d".into()), - AliasValue::Path("e".into()), - AliasValue::Path("a".into()), - ], - ), - ("recursive".into(), vec![AliasValue::Path("recursive/dir".into())]), - ("/d/dir".into(), vec![AliasValue::Path("/c/dir".into())]), - ("/d/index.js".into(), vec![AliasValue::Path("/c/index".into())]), - ("ignored".into(), vec![AliasValue::Ignore]), - ("node:path".into(), vec![AliasValue::Ignore]), - ], - modules: vec!["/".into()], - ..ResolveOptions::default() - }, - ); - - #[rustfmt::skip] - let pass = [ - ("should resolve a not aliased module 1", "a", "/a/index"), - ("should resolve a not aliased module 2", "a/index", "/a/index"), - ("should resolve a not aliased module 3", "a/dir", "/a/dir/index"), - ("should resolve a not aliased module 4", "a/dir/index", "/a/dir/index"), - ("should resolve an fallback module 1", "aliasA", "/a/index"), - ("should resolve an fallback module 2", "aliasA/index", "/a/index"), - ("should resolve an fallback module 3", "aliasA/dir", "/a/dir/index"), - ("should resolve an fallback module 4", "aliasA/dir/index", "/a/dir/index"), - ("should resolve a recursive aliased module 1", "recursive", "/recursive/index"), - ("should resolve a recursive aliased module 2", "recursive/index", "/recursive/index"), - ("should resolve a recursive aliased module 3", "recursive/dir", "/recursive/dir/index"), - ("should resolve a recursive aliased module 4", "recursive/dir/index", "/recursive/dir/index"), - ("should resolve a recursive aliased module 5", "recursive/file", "/recursive/dir/file"), - ("should resolve a file aliased module with a query 1", "b?query", "/b/index?query"), - ("should resolve a file aliased module with a query 2", "c?query", "/c/index?query"), - ("should resolve a path in a file aliased module 1", "b/index", "/b/index"), - ("should resolve a path in a file aliased module 2", "b/dir", "/b/dir/index"), - ("should resolve a path in a file aliased module 3", "b/dir/index", "/b/dir/index"), - ("should resolve a path in a file aliased module 4", "c/index", "/c/index"), - ("should resolve a path in a file aliased module 5", "c/dir", "/c/dir/index"), - ("should resolve a path in a file aliased module 6", "c/dir/index", "/c/dir/index"), - ("should resolve a file in multiple aliased dirs 1", "multiAlias/dir/file", "/e/dir/file"), - ("should resolve a file in multiple aliased dirs 2", "multiAlias/anotherDir", "/e/anotherDir/index"), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - - #[rustfmt::skip] - let ignore = [ - ("should resolve an ignore module", "ignored", ResolveError::Ignored(f.join("ignored"))), - ("should resolve node: builtin module", "node:path", ResolveError::Ignored(PathBuf::from("/node:path"))), - ]; - - for (comment, request, expected) in ignore { - let resolution = resolver.resolve(f, request); - assert_eq!(resolution, Err(expected), "{comment} {request}"); - } -} diff --git a/src/tests/full_specified.rs b/src/tests/full_specified.rs deleted file mode 100644 index a70c0191..00000000 --- a/src/tests/full_specified.rs +++ /dev/null @@ -1,113 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/fullSpecified.test.js - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows { - use std::path::PathBuf; - - use crate::{AliasValue, ResolveOptions, ResolverGeneric}; - - use super::super::memory_fs::MemoryFS; - - fn file_system() -> MemoryFS { - MemoryFS::new(&[ - ("/a/node_modules/package1/index.js", ""), - ("/a/node_modules/package1/file.js", ""), - ("/a/node_modules/package2/package.json", r#"{"main":"a"}"#), - ("/a/node_modules/package2/a.js", ""), - ("/a/node_modules/package3/package.json", r#"{"main":"dir"}"#), - ("/a/node_modules/package3/dir/index.js", ""), - ("/a/node_modules/package4/package.json", r#"{"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", ""), - ]) - } - - #[test] - fn test() { - let file_system = file_system(); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - alias: vec![ - ("alias1".into(), vec![AliasValue::from("/a/abc")]), - ("alias2".into(), vec![AliasValue::from("/a")]), - ], - alias_fields: vec![vec!["browser".into()]], - fully_specified: true, - ..ResolveOptions::default() - }, - ); - - let failing_resolves = [ - ("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"), - ]; - - for (comment, request) in failing_resolves { - let resolution = resolver.resolve("/a", request); - assert!(resolution.is_err(), "{comment} {request}"); - } - - let successful_resolves = [ - ("fully relative", "./abc.js", "/a/abc.js"), - ("fully absolute", "/a/abc.js", "/a/abc.js"), - ("fully relative in package", "package1/file.js", "/a/node_modules/package1/file.js"), - ("extensions in mainFiles", "package1", "/a/node_modules/package1/index.js"), - ("extensions in mainFields", "package2", "/a/node_modules/package2/a.js"), - ("extensions in alias", "alias1", "/a/abc.js"), - ("directories in alias", "alias2", "/a/index.js"), - ("directories in packages", "package3", "/a/node_modules/package3/dir/index.js"), - ("extensions in aliasFields", "package4/a.js", "/a/node_modules/package4/b.js"), - ]; - - for (comment, request, expected) in successful_resolves { - let resolution = resolver.resolve("/a", request).map(|r| r.full_path()); - assert_eq!(resolution, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - } - - #[test] - #[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. - fn resolve_to_context() { - let file_system = file_system(); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - alias: vec![ - ("alias1".into(), vec![AliasValue::from("/a/abc")]), - ("alias2".into(), vec![AliasValue::from("/a")]), - ], - alias_fields: vec![vec!["browser".into()]], - fully_specified: true, - resolve_to_context: true, - ..ResolveOptions::default() - }, - ); - - let successful_resolves = [ - ("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", "/a/node_modules/package3/dir"), - ]; - - for (comment, request, expected) in successful_resolves { - let resolution = resolver.resolve("/a", request).map(|r| r.full_path()); - assert_eq!(resolution, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - } -} diff --git a/src/tests/imports_field.rs b/src/tests/imports_field.rs deleted file mode 100644 index c928627a..00000000 --- a/src/tests/imports_field.rs +++ /dev/null @@ -1,1320 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/importsField.test.js -//! -//! The huge imports field test cases are at the bottom of this file. - -use serde_json::json; - -use crate::{Ctx, JSONMap, PathUtil, ResolveError, ResolveOptions, Resolver}; -use std::path::Path; - -#[test] -fn test_simple() { - let f = super::fixture().join("imports-field"); - let f2 = super::fixture().join("imports-exports-wildcard/node_modules/m/"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve using imports field instead of self-referencing", f.clone(), "#imports-field", f.join("b.js")), - ("should resolve using imports field instead of self-referencing for a subpath", f.join("dir"), "#imports-field", f.join("b.js")), - ("should resolve package #1", f.clone(), "#a/dist/main.js", f.join("node_modules/a/lib/lib2/main.js")), - ("should resolve package #3", f.clone(), "#ccc/index.js", f.join("node_modules/c/index.js")), - ("should resolve package #4", f.clone(), "#c", f.join("node_modules/c/index.js")), - ("should resolve with wildcard pattern", f2.clone(), "#internal/i.js", f2.join("src/internal/i.js")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } - - // Note added: - // * should resolve absolute path as an imports field target - // * should log the correct info - - #[rustfmt::skip] - let fail = [ - ("should disallow resolve out of package scope", f.clone(), "#b", ResolveError::InvalidPackageTarget("../b.js".to_string(), "#b".to_string(), f.join("package.json"))), - ("should resolve package #2", f.clone(), "#a", ResolveError::PackageImportNotDefined("#a".to_string(), f.join("package.json"))), - ]; - - for (comment, path, request, error) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!(resolution, Err(error), "{comment} {path:?} {request}"); - } -} - -#[test] -fn shared_resolvers() { - let f = super::fixture().join("imports-field"); - - // field name #1 - let resolver1 = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - imports_fields: vec![vec!["imports".into()]], - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - let resolved_path = resolver1.resolve(&f, "#imports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("b.js"))); - - // field name #2 - let resolver2 = resolver1.clone_with_options(ResolveOptions { - imports_fields: vec![vec!["other".into(), "imports".into()]], - ..ResolveOptions::default() - }); - - let resolved_path = resolver2.resolve(&f, "#b").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("a.js"))); -} - -// Small script for generating the test cases from enhanced_resolve -// for (c of testCases) { -// console.log("TestCase {") -// console.log(`name: ${JSON.stringify(c.name)},`) -// if (c.expect instanceof Error) { -// console.log(`expect: None,`) -// } else { -// console.log(`expect: Some(vec!${JSON.stringify(c.expect)}),`) -// } -// console.log(`imports_field: imports_field(json!(${JSON.stringify(c.suite[0], null, 2)})),`) -// console.log(`request: "${c.suite[1]}",`) -// console.log(`condition_names: vec!${JSON.stringify(c.suite[2])},`) -// console.log("},") -// } - -struct TestCase { - name: &'static str, - expect: Option>, - imports_field: JSONMap, - request: &'static str, - condition_names: Vec<&'static str>, -} - -#[allow(clippy::needless_pass_by_value)] -fn imports_field(value: serde_json::Value) -> JSONMap { - let s = serde_json::to_string(&value).unwrap(); - serde_json::from_str(&s).unwrap() -} - -#[test] -fn test_cases() { - let test_cases = [ - TestCase { - name: "sample #1", - expect: Some(vec!["./dist/test/file.js"]), - imports_field: imports_field(json!({ - "#abc/": { - "import": [ - "./dist/", - "./src/" - ], - "webpack": "./wp/" - }, - "#abc": "./main.js" - })), - request: "#abc/test/file.js", - condition_names: vec!["import", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "sample #1", - expect: Some(vec!["./src/test/file.js"]), - imports_field: imports_field(json!({ - "#abc/": { - "import": [ - "./src/" - ], - "webpack": "./wp/" - }, - "#abc": "./main.js" - })), - request: "#abc/test/file.js", - condition_names: vec!["import", "webpack"], - }, - TestCase { - name: "sample #2", - expect: Some(vec!["./data/timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#1/timezones/": "./data/timezones/" - })), - request: "#1/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #3", - expect: Some(vec!["./data/timezones/timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#aaa/": "./data/timezones/", - "#a/": "./data/timezones/" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #4", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/lib/": { - "browser": [ - "./browser/" - ] - }, - "#a/dist/index.js": { - "node": "./index.js" - } - })), - request: "#a/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #5", - expect: Some(vec!["./browser/index.js"]), - imports_field: imports_field(json!({ - "#a/lib/": { - "browser": [ - "./browser/" - ] - }, - "#a/dist/index.js": { - "node": "./index.js", - "default": "./browser/index.js" - } - })), - request: "#a/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #6", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/dist/a": "./dist/index.js" - })), - request: "#a/dist/aaa", - condition_names: vec![], - }, - TestCase { - name: "sample #7", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/a/a/": "./dist/index.js" - })), - request: "#a/a/a", - condition_names: vec![], - }, - TestCase { - name: "sample #8", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": "./index.js" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #9", - expect: Some(vec!["./main.js"]), - imports_field: imports_field(json!({ - "#a/index.js": "./main.js" - })), - request: "#a/index.js", - condition_names: vec![], - }, - TestCase { - name: "sample #10", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #11", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/bar#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #12", - expect: Some(vec!["./ok.js#abc"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/ok.js#abc", - condition_names: vec![], - }, - TestCase { - name: "sample #13", - expect: Some(vec!["./ok.js?abc"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/ok.js?abc", - condition_names: vec![], - }, - TestCase { - name: "sample #14", - expect: Some(vec!["./🎉.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/🎉.js", - condition_names: vec![], - }, - TestCase { - name: "sample #15", - expect: Some(vec!["./%F0%9F%8E%89.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/%F0%9F%8E%89.js", - condition_names: vec![], - }, - TestCase { - name: "sample #16", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/🎉", - condition_names: vec![], - }, - TestCase { - name: "sample #17", - expect: Some(vec!["./other.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/%F0%9F%8E%89", - condition_names: vec![], - }, - TestCase { - name: "sample #18", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/module", - condition_names: vec![], - }, - TestCase { - name: "sample #19", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/module#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #20", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/module?foo", - condition_names: vec![], - }, - TestCase { - name: "sample #21", - expect: Some(vec!["./d?e?f"]), - imports_field: imports_field(json!({ - "#a/a?b?c/": "./" - })), - request: "#a/a?b?c/d?e?f", - condition_names: vec![], - }, - TestCase { - name: "sample #22", - // We throw InvalidPackageTarget - expect: None, - // expect: Some(vec!["/user/a/index"]), - imports_field: imports_field(json!({ - "#a/": "/user/a/" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #1", - expect: Some(vec!["./A/b/d.js"]), - imports_field: imports_field(json!({ - "#a/": "./A/", - "#a/b/c": "./c.js" - })), - request: "#a/b/d.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #2", - expect: Some(vec!["./A/c.js"]), - imports_field: imports_field(json!({ - "#a/": "./A/", - "#a/b": "./b.js" - })), - request: "#a/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #3", - expect: Some(vec!["./A/b/c/d.js"]), - imports_field: imports_field(json!({ - "#a/": "./A/", - "#a/b/c/d": "./c.js" - })), - request: "#a/b/c/d.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #1", - expect: Some(vec!["./dist/index.js"]), - imports_field: imports_field(json!({ - "#a": "./dist/index.js" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #2", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": "./" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #3", - expect: Some(vec!["./dist/a.js"]), - imports_field: imports_field(json!({ - "#a/": "./dist/", - "#a/index.js": "./dist/a.js" - })), - request: "#a/index.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #4", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "./browser/" - ] - }, - "#a/index.js": { - "browser": "./index.js" - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #5", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "./browser/" - ] - }, - "#a/index.js": { - "node": "./node.js" - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #6", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: "#a", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #7", - expect: Some(vec!["./src/index.js"]), // `enhanced_resolve` is `None` - imports_field: imports_field(json!({ - "#a": { - "default": "./src/index.js", - "browser": "./index.js", - "node": "./src/node/index.js" - } - })), - request: "#a", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #8", - expect: Some(vec!["./src/index.js"]), - imports_field: imports_field(json!({ - "#a": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #9", - expect: Some(vec!["./index"]), - imports_field: imports_field(json!({ - "#a": "./index" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #10", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/index": "./index.js" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #11", - // We throw InvalidPackageTarget - // expect: Some(vec!["b"]), - expect: None, - imports_field: imports_field(json!({ - "#a": "b" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #12", - // We throw InvalidPackageTarget - // expect: Some(vec!["b/index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "b/" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #13", - // We throw InvalidPackageTarget - // expect: Some(vec!["b#anotherhashishere"]), - expect: None, - imports_field: imports_field(json!({ - "#a?q=a#hashishere": "b#anotherhashishere" - })), - request: "#a?q=a#hashishere", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #1", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #2", - expect: Some(vec!["./import.mjs"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec!["import"], - }, - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./require.js"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./import.mjs"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./require.js"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": [ - "./require.js" - ] - }, - { - "import": [ - "./import.mjs", - "#b/import.js" - ] - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./import.mjs"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "./import.mjs", - "#b/import.js" - ] - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "#b/import.js" - ] - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "mapping to a folder root #1", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#timezones": "./data/timezones/" - })), - request: "#timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #2", - expect: None, - imports_field: imports_field(json!({ - "#timezones/": "./data/timezones" - })), - request: "#timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #3", - expect: Some(vec!["./data/timezones/pdt/index.mjs"]), - imports_field: imports_field(json!({ - "#timezones/pdt/": "./data/timezones/pdt/" - })), - request: "#timezones/pdt/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #4", - expect: Some(vec!["./timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#a/": "./timezones/" - })), - request: "#a/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #5", - expect: Some(vec!["./timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#a/": "./" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #6", - expect: None, - imports_field: imports_field(json!({ - "#a/": "." - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #7", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": "./" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #1", - expect: Some(vec!["./lib/index.mjs"]), - imports_field: imports_field(json!({ - "#a/": "./", - "#a/dist/": "./lib/" - })), - request: "#a/dist/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #2", - expect: Some(vec!["./dist/utils/index.js"]), - imports_field: imports_field(json!({ - "#a/dist/utils/": "./dist/utils/", - "#a/dist/": "./lib/" - })), - request: "#a/dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #3", - expect: Some(vec!["./dist/utils/index.js"]), - imports_field: imports_field(json!({ - "#a/dist/utils/index.js": "./dist/utils/index.js", - "#a/dist/utils/": "./dist/utils/index.mjs", - "#a/dist/": "./lib/" - })), - request: "#a/dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #4", - expect: Some(vec!["./lib/index.mjs"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./browser/" - }, - "#a/dist/": "./lib/" - })), - request: "#a/dist/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #1", - // This behaves differently from enhanced_resolve, because `lodash/` is an an InvalidPackageConfig - // expect: Some(vec!["lodash/index.js"]), - expect: Some(vec!["./utils/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "conditional mapping folder #1", - expect: Some(vec!["./utils/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #2", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./node/" - ] - } - })), - request: "#a/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "conditional mapping folder #3", - expect: Some(vec!["./wpk/index.mjs"]), - imports_field: imports_field(json!({ - "#a/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils/" - ] - } - })), - request: "#a/index.mjs", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "incorrect exports field #1", - // We throw `PackageImportNotDefined` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "/utils/": "./a/" - })), - request: "#a/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #2", - // We throw `PackageImportNotDefined` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "/utils/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#a/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #3", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index": "./a/index.js" - })), - request: "#a/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #4", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index.mjs": "./a/index.js" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #5", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "#a/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #6", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index.mjs": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "#a/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #1", - // We don't throw in `package_imports_exports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": "./a/" - })), - request: "/utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect request #2", - // We don't throw in `package_imports_exports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #3", - // We don't throw in `package_imports_exports_resolve`, it's thrown in `package_imports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #4", - // We don't throw in `package_imports_exports_resolve`, it's thrown in `package_imports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#/", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #5", - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#a/", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #1", - // expect: Some(vec!["./dist/index"]), - expect: Some(vec!["dist/index"]), - imports_field: imports_field(json!({ - "#a/../../utils/": "./dist/" - })), - request: "#a/../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #2", - // We throw InvalidPackageTarget - // expect: Some(vec!["./dist/../../utils/index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "./dist/" - })), - request: "#a/../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #3", - // We throw InvalidPackageTarget - // expect: Some(vec!["../src/index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "../src/" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #4", - // We throw InvalidPackageTarget - // expect: Some(vec!["./utils/../../../index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": { - "browser": "./utils/../../../" - } - })), - request: "#a/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #1", - // expect: Some(vec!["moment/node_modules/lodash/dist/index.js"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": { - "browser": "moment/node_modules/" - } - })), - request: "#a/lodash/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #2", - // We throw InvalidPackageTarget - // expect: Some(vec!["../node_modules/lodash/dist/index.js"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "../node_modules/" - })), - request: "#a/lodash/dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "nested mapping #1", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": "./", - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./node/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "nested mapping #3", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["webpack"], - }, - TestCase { - name: "nested mapping #4", - // We throw NotFound - // expect: Some(vec!["moment/node/index.js"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "moment/node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["node", "browser"], - }, - TestCase { - name: "nested mapping #5", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "node"], - }, - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./node/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - TestCase { - name: "nested mapping #7", - expect: Some(vec!["./y.js"]), - imports_field: imports_field(json!({ - "#a": { - "abc": { - "def": "./x.js" - }, - "ghi": "./y.js" - } - })), - request: "#a", - condition_names: vec!["abc", "ghi"], - }, - TestCase { - name: "nested mapping #8", - // We throw PackageImportNotDefined - // expect: Some(vec![]), - expect: None, - imports_field: imports_field(json!({ - "#a": { - "abc": { - "def": "./x.js", - "default": [] - }, - "ghi": "./y.js" - } - })), - request: "#a", - condition_names: vec!["abc", "ghi"], - }, - ]; - - for case in test_cases { - let resolved = Resolver::default() - .package_imports_exports_resolve( - case.request, - &case.imports_field, - Path::new(""), - true, - &case.condition_names.iter().map(ToString::to_string).collect::>(), - &mut Ctx::default(), - ) - .map(|p| p.map(|p| p.to_path_buf())); - if let Some(expect) = case.expect { - if expect.is_empty() { - assert!(matches!(resolved, Ok(None)), "{} {:?}", &case.name, &resolved); - } else { - for expect in expect { - assert_eq!(resolved, Ok(Some(Path::new(expect).normalize())), "{}", &case.name); - } - } - } else { - assert!(resolved.is_err(), "{} {resolved:?}", &case.name); - } - } -} diff --git a/src/tests/incorrect_description_file.rs b/src/tests/incorrect_description_file.rs deleted file mode 100644 index e2caecbb..00000000 --- a/src/tests/incorrect_description_file.rs +++ /dev/null @@ -1,65 +0,0 @@ -//! - -use rustc_hash::FxHashSet; - -use crate::{JSONError, Resolution, ResolveContext, ResolveError, ResolveOptions, Resolver}; - -// should not resolve main in incorrect description file #1 -#[test] -fn incorrect_description_file_1() { - let f = super::fixture().join("incorrect-package"); - let mut ctx = ResolveContext::default(); - let resolution = Resolver::default().resolve_with_context(f.join("pack1"), ".", &mut ctx); - let error = ResolveError::JSON(JSONError { - path: f.join("pack1/package.json"), - message: String::from("EOF while parsing a value at line 3 column 0"), - line: 3, - column: 0, - }); - assert_eq!(resolution, Err(error)); - assert_eq!( - ctx.file_dependencies, - FxHashSet::from_iter([f.join("pack1"), f.join("pack1/package.json")]) - ); - assert!(!ctx.missing_dependencies.is_empty()); -} - -// should not resolve main in incorrect description file #2 -#[test] -fn incorrect_description_file_2() { - let f = super::fixture().join("incorrect-package"); - let resolution = Resolver::default().resolve(f.join("pack2"), "."); - let error = ResolveError::JSON(JSONError { - path: f.join("pack2/package.json"), - message: String::from("EOF while parsing a value at line 1 column 0"), - line: 1, - column: 0, - }); - assert_eq!(resolution, Err(error)); -} - -// should not resolve main in incorrect description file #3 -#[test] -fn incorrect_description_file_3() { - let f = super::fixture().join("incorrect-package"); - let resolution = Resolver::default().resolve(f.join("pack2"), "."); - assert!(resolution.is_err()); -} - -// `enhanced_resolve` does not have this test case -#[test] -fn no_description_file() { - let f = super::fixture_root().join("enhanced_resolve"); - - // has description file - let resolver = Resolver::default(); - assert_eq!( - resolver.resolve(&f, ".").map(Resolution::into_path_buf), - Ok(f.join("lib/index.js")) - ); - - // without description file - let resolver = - Resolver::new(ResolveOptions { description_files: vec![], ..ResolveOptions::default() }); - assert_eq!(resolver.resolve(&f, "."), Err(ResolveError::NotFound(".".into()))); -} diff --git a/src/tests/main_field.rs b/src/tests/main_field.rs deleted file mode 100644 index 3cadc8ce..00000000 --- a/src/tests/main_field.rs +++ /dev/null @@ -1,24 +0,0 @@ -//! Not part of enhanced_resolve's test suite - -use crate::{ResolveOptions, Resolver}; - -#[test] -fn test() { - let f = super::fixture().join("restrictions"); - - let resolver1 = Resolver::new(ResolveOptions { - main_fields: vec!["style".into()], - ..ResolveOptions::default() - }); - - let resolution = resolver1.resolve(&f, "pck2").map(|r| r.full_path()); - assert_eq!(resolution, Ok(f.join("node_modules/pck2/index.css"))); - - let resolver2 = resolver1.clone_with_options(ResolveOptions { - main_fields: vec!["module".into(), "main".into()], - ..ResolveOptions::default() - }); - - let resolution = resolver2.resolve(&f, "pck2").map(|r| r.full_path()); - assert_eq!(resolution, Ok(f.join("node_modules/pck2/module.js"))); -} diff --git a/src/tests/memory_fs.rs b/src/tests/memory_fs.rs deleted file mode 100644 index e4116609..00000000 --- a/src/tests/memory_fs.rs +++ /dev/null @@ -1,74 +0,0 @@ -use std::{ - io, - path::{Path, PathBuf}, -}; - -use crate::{FileMetadata, FileSystem}; - -#[derive(Default)] -pub struct MemoryFS { - fs: vfs::MemoryFS, -} - -impl MemoryFS { - /// # Panics - /// - /// * Fails to create directory - /// * Fails to write file - #[allow(dead_code)] - pub fn new(data: &[(&'static str, &'static str)]) -> Self { - let mut fs = Self { fs: vfs::MemoryFS::default() }; - for (path, content) in data { - fs.add_file(Path::new(path), content); - } - fs - } - - #[allow(dead_code)] - pub fn add_file(&mut self, path: &Path, content: &str) { - use vfs::FileSystem; - let fs = &mut self.fs; - // Create all parent directories - for path in path.ancestors().collect::>().iter().rev() { - let path = path.to_string_lossy(); - if !fs.exists(path.as_ref()).unwrap() { - fs.create_dir(path.as_ref()).unwrap(); - } - } - // Create file - let mut file = fs.create_file(path.to_string_lossy().as_ref()).unwrap(); - file.write_all(content.as_bytes()).unwrap(); - } -} - -impl FileSystem for MemoryFS { - fn read_to_string(&self, path: &Path) -> io::Result { - use vfs::FileSystem; - let mut file = self - .fs - .open_file(path.to_string_lossy().as_ref()) - .map_err(|err| io::Error::new(io::ErrorKind::NotFound, err))?; - let mut buffer = String::new(); - file.read_to_string(&mut buffer).unwrap(); - Ok(buffer) - } - - fn metadata(&self, path: &Path) -> io::Result { - use vfs::FileSystem; - let metadata = self - .fs - .metadata(path.to_string_lossy().as_ref()) - .map_err(|err| io::Error::new(io::ErrorKind::NotFound, err))?; - let is_file = metadata.file_type == vfs::VfsFileType::File; - let is_dir = metadata.file_type == vfs::VfsFileType::Directory; - Ok(FileMetadata::new(is_file, is_dir, false)) - } - - fn symlink_metadata(&self, path: &Path) -> io::Result { - self.metadata(path) - } - - fn canonicalize(&self, _path: &Path) -> io::Result { - Err(io::Error::new(io::ErrorKind::NotFound, "not a symlink")) - } -} diff --git a/src/tests/missing.rs b/src/tests/missing.rs deleted file mode 100644 index 4bf611ef..00000000 --- a/src/tests/missing.rs +++ /dev/null @@ -1,106 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/missing.test.js - -use normalize_path::NormalizePath; - -use crate::{AliasValue, ResolveContext, ResolveOptions, Resolver}; - -#[test] -fn test() { - let f = super::fixture(); - - let data = [ - ( - "./missing-file", - vec![f.join("missing-file"), f.join("missing-file.js"), f.join("missing-file.node")], - ), - ( - "missing-module", - vec![ - f.join("node_modules/missing-module"), - f.parent().unwrap().join("node_modules"), // enhanced-resolve is "node_modules/missing-module" - ], - ), - ( - "missing-module/missing-file", - vec![ - f.join("node_modules/missing-module"), - // f.parent().unwrap().join("node_modules/missing-module"), // we don't report this - ], - ), - ( - "m1/missing-file", - vec![ - f.join("node_modules/m1/missing-file"), - f.join("node_modules/m1/missing-file.js"), - f.join("node_modules/m1/missing-file.node"), - // f.parent().unwrap().join("node_modules/m1"), // we don't report this - ], - ), - ( - "m1/", - vec![ - f.join("node_modules/m1/index"), - f.join("node_modules/m1/index.js"), - f.join("node_modules/m1/index.json"), - f.join("node_modules/m1/index.node"), - ], - ), - ("m1/a", vec![f.join("node_modules/m1/a")]), - ]; - - let resolver = Resolver::default(); - - for (specifier, missing_dependencies) in data { - let mut ctx = ResolveContext::default(); - let _ = resolver.resolve_with_context(&f, specifier, &mut ctx); - - for path in ctx.file_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - } - - for path in missing_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - assert!( - ctx.missing_dependencies.contains(&path), - "{specifier}: {path:?} not in {:?}", - &ctx.missing_dependencies - ); - } - } -} - -#[test] -fn alias_and_extensions() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias: vec![ - ( - "@scope-js/package-name/dir$".into(), - vec![AliasValue::Path(f.join("foo/index.js").to_string_lossy().to_string())], - ), - ( - "react-dom".into(), - vec![AliasValue::Path(f.join("foo/index.js").to_string_lossy().to_string())], - ), - ], - extensions: vec![".server.ts".into()], - - ..ResolveOptions::default() - }); - - let mut ctx = ResolveContext::default(); - let _ = resolver.resolve_with_context(&f, "@scope-js/package-name/dir/router", &mut ctx); - let _ = resolver.resolve_with_context(&f, "react-dom/client", &mut ctx); - - for path in ctx.file_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - } - - for path in ctx.missing_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - if let Some(path) = path.parent() { - assert!(!path.is_file(), "{path:?} must not be a file"); - } - } -} diff --git a/src/tests/mod.rs b/src/tests/mod.rs deleted file mode 100644 index e347dd1f..00000000 --- a/src/tests/mod.rs +++ /dev/null @@ -1,51 +0,0 @@ -mod alias; -mod browser_field; -mod builtins; -mod dependencies; -mod exports_field; -mod extension_alias; -mod extensions; -mod fallback; -mod full_specified; -mod imports_field; -mod incorrect_description_file; -mod main_field; -mod memory_fs; -mod missing; -#[cfg(feature = "yarn_pnp")] -mod pnp; -mod resolve; -mod restrictions; -mod roots; -mod scoped_packages; -mod simple; -mod symlink; -mod tsconfig_paths; -mod tsconfig_project_references; - -use crate::Resolver; -use std::{env, path::PathBuf, sync::Arc, thread}; - -pub fn fixture_root() -> PathBuf { - env::current_dir().unwrap().join("fixtures") -} - -pub fn fixture() -> PathBuf { - fixture_root().join("enhanced_resolve").join("test").join("fixtures") -} - -#[test] -fn threaded_environment() { - let cwd = env::current_dir().unwrap(); - let resolver = Arc::new(Resolver::default()); - for _ in 0..2 { - _ = thread::spawn({ - let cwd = cwd.clone(); - let resolver = Arc::clone(&resolver); - move || { - _ = resolver.resolve(cwd, "."); - } - }) - .join(); - } -} diff --git a/src/tests/pnp.rs b/src/tests/pnp.rs deleted file mode 100644 index 1562a009..00000000 --- a/src/tests/pnp.rs +++ /dev/null @@ -1,45 +0,0 @@ -//! Not part of enhanced_resolve's test suite -//! -//! enhanced_resolve's test -//! cannot be ported over because it uses mocks on `pnpApi` provided by the runtime. - -use crate::{ResolveOptions, Resolver}; - -#[test] -fn pnp1() { - let fixture = super::fixture_root().join("pnp"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - pnp_manifest: Some(pnp::load_pnp_manifest(fixture.join(".pnp.cjs")).unwrap()), - ..ResolveOptions::default() - }); - - assert_eq!( - resolver.resolve(&fixture, "is-even").map(|r| r.full_path()), - Ok(fixture.join( - ".yarn/cache/is-even-npm-1.0.0-9f726520dc-2728cc2f39.zip/node_modules/is-even/index.js" - )) - ); - - assert_eq!( - resolver - .resolve( - &fixture.join( - ".yarn/cache/is-even-npm-1.0.0-9f726520dc-2728cc2f39.zip/node_modules/is-even" - ), - "is-odd" - ) - .map(|r| r.full_path()), - Ok(fixture.join( - ".yarn/cache/is-odd-npm-0.1.2-9d980a9da8-7dc6c6fd00.zip/node_modules/is-odd/index.js" - )), - ); - - assert_eq!( - resolver.resolve(&fixture, "is-odd").map(|r| r.full_path()), - Ok(fixture.join( - ".yarn/cache/is-odd-npm-3.0.1-93c3c3f41b-89ee2e353c.zip/node_modules/is-odd/index.js" - )), - ); -} diff --git a/src/tests/resolve.rs b/src/tests/resolve.rs deleted file mode 100644 index f2dbb88e..00000000 --- a/src/tests/resolve.rs +++ /dev/null @@ -1,119 +0,0 @@ -//! - -use crate::{ResolveError, ResolveOptions, Resolver}; - -#[test] -fn resolve() { - let f = super::fixture(); - - let resolver = Resolver::default(); - - let main1_js_path = f.join("main1.js").to_string_lossy().to_string(); - - #[rustfmt::skip] - let pass = [ - ("absolute path", f.clone(), main1_js_path.as_str(), f.join("main1.js")), - ("file with .js", f.clone(), "./main1.js", f.join("main1.js")), - ("file without extension", f.clone(), "./main1", f.join("main1.js")), - ("another file with .js", f.clone(), "./a.js", f.join("a.js")), - ("another file without extension", f.clone(), "./a", f.join("a.js")), - ("file in module with .js", f.clone(), "m1/a.js", f.join("node_modules/m1/a.js")), - ("file in module without extension", f.clone(), "m1/a", f.join("node_modules/m1/a.js")), - ("another file in module without extension", f.clone(), "complexm/step1", f.join("node_modules/complexm/step1.js")), - ("from submodule to file in sibling module", f.join("node_modules/complexm"), "m2/b.js", f.join("node_modules/m2/b.js")), - ("from nested directory to overwritten file in module", f.join("multiple_modules"), "m1/a.js", f.join("multiple_modules/node_modules/m1/a.js")), - ("from nested directory to not overwritten file in module", f.join("multiple_modules"), "m1/b.js", f.join("node_modules/m1/b.js")), - ("file with query", f.clone(), "./main1.js?query", f.join("main1.js?query")), - ("file with fragment", f.clone(), "./main1.js#fragment", f.join("main1.js#fragment")), - ("file with fragment and query", f.clone(), "./main1.js#fragment?query", f.join("main1.js#fragment?query")), - ("file with query and fragment", f.clone(), "./main1.js?#fragment", f.join("main1.js?#fragment")), - - ("file with query (unicode)", f.clone(), "./测试.js?query", f.join("测试.js?query")), - ("file with fragment (unicode)", f.clone(), "./测试.js#fragment", f.join("测试.js#fragment")), - ("file with fragment and query (unicode)", f.clone(), "./测试.js#fragment?query", f.join("测试.js#fragment?query")), - ("file with query and fragment (unicode)", f.clone(), "./测试.js?#fragment", f.join("测试.js?#fragment")), - - ("file in module with query", f.clone(), "m1/a?query", f.join("node_modules/m1/a.js?query")), - ("file in module with fragment", f.clone(), "m1/a#fragment", f.join("node_modules/m1/a.js#fragment")), - ("file in module with fragment and query", f.clone(), "m1/a#fragment?query", f.join("node_modules/m1/a.js#fragment?query")), - ("file in module with query and fragment", f.clone(), "m1/a?#fragment", f.join("node_modules/m1/a.js?#fragment")), - ("file in module with query and fragment", f.clone(), "m1/a?#fragment", f.join("node_modules/m1/a.js?#fragment")), - ("differ between directory and file, resolve file", f.clone(), "./dirOrFile", f.join("dirOrFile.js")), - ("differ between directory and file, resolve directory", f.clone(), "./dirOrFile/", f.join("dirOrFile/index.js")), - ("find node_modules outside of node_modules", f.join("browser-module/node_modules"), "m1/a", f.join("node_modules/m1/a.js")), - ("don't crash on main field pointing to self", f.clone(), "./main-field-self", f.join("./main-field-self/index.js")), - ("don't crash on main field pointing to self (2)", f.clone(), "./main-field-self2", f.join("./main-field-self2/index.js")), - // enhanced-resolve has `#` prepended with a `\0`, they are removed from the - // following 3 expected test results. - // See https://github.com/webpack/enhanced-resolve#escaping - ("handle fragment edge case (no fragment)", f.clone(), "./no#fragment/#/#", f.join("no#fragment/#/#.js")), - ("handle fragment edge case (fragment)", f.clone(), "./no#fragment/#/", f.join("no.js#fragment/#/")), - ("handle fragment escaping", f.clone(), "./no\0#fragment/\0#/\0##fragment", f.join("no#fragment/#/#.js#fragment")), - - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn issue238_resolve() { - let f = super::fixture().join("issue-238"); - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into(), ".jsx".into(), ".ts".into(), ".tsx".into()], - modules: vec!["src/a".into(), "src/b".into(), "src/common".into(), "node_modules".into()], - ..ResolveOptions::default() - }); - let resolved_path = - resolver.resolve(f.join("src/common"), "config/myObjectFile").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("src/common/config/myObjectFile.js")),); -} - -#[test] -fn prefer_relative() { - let f = super::fixture(); - - let resolver = - Resolver::new(ResolveOptions { prefer_relative: true, ..ResolveOptions::default() }); - - #[rustfmt::skip] - let pass = [ - ("should correctly resolve with preferRelative 1", "main1.js", f.join("main1.js")), - ("should correctly resolve with preferRelative 2", "m1/a.js", f.join("node_modules/m1/a.js")), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } -} - -#[test] -fn resolve_to_context() { - let f = super::fixture(); - let resolver = - Resolver::new(ResolveOptions { resolve_to_context: true, ..ResolveOptions::default() }); - - #[rustfmt::skip] - let data = [ - ("context for fixtures", f.clone(), "./", f.clone()), - ("context for fixtures/lib", f.clone(), "./lib", f.join("lib")), - ("context for fixtures with ..", f.clone(), "./lib/../../fixtures/./lib/..", f.clone()), - ("context for fixtures with query", f.clone(), "./?query", f.clone().with_file_name("fixtures?query")), - ]; - - for (comment, path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn resolve_hash_as_module() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions::default()); - let resolution = resolver.resolve(f, "#a"); - assert_eq!(resolution, Err(ResolveError::NotFound("#a".into()))); -} diff --git a/src/tests/restrictions.rs b/src/tests/restrictions.rs deleted file mode 100644 index 5ba56596..00000000 --- a/src/tests/restrictions.rs +++ /dev/null @@ -1,25 +0,0 @@ -//! - -use crate::{ResolveError, ResolveOptions, Resolver, Restriction}; - -// TODO: regex -// * should respect RegExp restriction -// * should try to find alternative #1 -// * should try to find alternative #2 -// * should try to find alternative #3 - -// should respect string restriction -#[test] -fn restriction1() { - let fixture = super::fixture(); - let f = fixture.join("restrictions"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - restrictions: vec![Restriction::Path(f.clone())], - ..ResolveOptions::default() - }); - - let resolution = resolver.resolve(&f, "pck2"); - assert_eq!(resolution, Err(ResolveError::Restriction(fixture.join("c.js"), f))); -} diff --git a/src/tests/roots.rs b/src/tests/roots.rs deleted file mode 100644 index b50e2a07..00000000 --- a/src/tests/roots.rs +++ /dev/null @@ -1,92 +0,0 @@ -//! - -use std::path::PathBuf; - -use crate::{AliasValue, ResolveError, ResolveOptions, Resolver}; - -fn dirname() -> PathBuf { - super::fixture_root().join("enhanced_resolve").join("test") -} - -#[test] -fn roots() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - alias: vec![("foo".into(), vec![AliasValue::from("/fixtures")])], - roots: vec![dirname(), f.clone()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should respect roots option", "/fixtures/b.js", f.join("b.js")), - ("should try another root option, if it exists", "/b.js", f.join("b.js")), - ("should respect extension", "/fixtures/b", f.join("b.js")), - ("should resolve in directory", "/fixtures/extensions/dir", f.join("extensions/dir/index.js")), - ("should respect aliases", "foo/b", f.join("b.js")), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } - - #[rustfmt::skip] - let fail = [ - ("should not work with relative path", "fixtures/b.js", ResolveError::NotFound("fixtures/b.js".into())) - ]; - - for (comment, request, expected) in fail { - let resolution = resolver.resolve(&f, request); - assert_eq!(resolution, Err(expected), "{comment} {request}"); - } -} - -#[test] -fn resolve_to_context() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - roots: vec![dirname(), f.clone()], - resolve_to_context: true, - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f, "/fixtures/lib").map(|r| r.full_path()); - let expected = f.join("lib"); - assert_eq!(resolved_path, Ok(expected)); -} - -#[test] -fn prefer_absolute() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - alias: vec![("foo".into(), vec![AliasValue::from("/fixtures")])], - roots: vec![dirname(), f.clone()], - prefer_absolute: true, - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve an absolute path (prefer absolute)", f.join("b.js").to_string_lossy().to_string(), f.join("b.js")), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(&f, &request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } -} - -#[test] -fn roots_fall_through() { - let f = super::fixture(); - let absolute_path = f.join("roots_fall_through/index.js"); - let specifier = absolute_path.to_string_lossy(); - let resolution = Resolver::new(ResolveOptions::default().with_root(&f)).resolve(&f, &specifier); - assert_eq!( - resolution.map(super::super::resolution::Resolution::into_path_buf), - Ok(absolute_path) - ); -} diff --git a/src/tests/scoped_packages.rs b/src/tests/scoped_packages.rs deleted file mode 100644 index 8258f00f..00000000 --- a/src/tests/scoped_packages.rs +++ /dev/null @@ -1,25 +0,0 @@ -//! - -use crate::{ResolveOptions, Resolver}; - -#[test] -fn scoped_packages() { - let f = super::fixture().join("scoped"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("main field should work", f.clone(), "@scope/pack1", f.join("./node_modules/@scope/pack1/main.js")), - ("browser field should work", f.clone(), "@scope/pack2", f.join("./node_modules/@scope/pack2/main.js")), - ("folder request should work", f.clone(), "@scope/pack2/lib", f.join("./node_modules/@scope/pack2/lib/index.js")) - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} diff --git a/src/tests/simple.rs b/src/tests/simple.rs deleted file mode 100644 index 08e1238a..00000000 --- a/src/tests/simple.rs +++ /dev/null @@ -1,68 +0,0 @@ -//! - -use std::env; - -use crate::Resolver; - -#[test] -fn simple() { - // mimic `enhanced-resolve/test/simple.test.js` - let dirname = env::current_dir().unwrap().join("fixtures"); - let f = dirname.join("enhanced_resolve/test"); - - let resolver = Resolver::default(); - - let data = [ - ("direct", f.clone(), "../lib/index"), - ("as directory", f, ".."), - ("as module", dirname.clone(), "./enhanced_resolve"), - ]; - - for (comment, path, request) in data { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - let expected = dirname.join("enhanced_resolve/lib/index.js"); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn dashed_name() { - let f = super::fixture(); - - let resolver = Resolver::default(); - - let data = [ - (f.clone(), "dash", f.join("node_modules/dash/index.js")), - (f.clone(), "dash-name", f.join("node_modules/dash-name/index.js")), - (f.join("node_modules/dash"), "dash", f.join("node_modules/dash/index.js")), - (f.join("node_modules/dash"), "dash-name", f.join("node_modules/dash-name/index.js")), - (f.join("node_modules/dash-name"), "dash", f.join("node_modules/dash/index.js")), - (f.join("node_modules/dash-name"), "dash-name", f.join("node_modules/dash-name/index.js")), - ]; - - for (path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{path:?} {request}"); - } -} - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows { - use super::super::memory_fs::MemoryFS; - - use crate::ResolveOptions; - - #[test] - fn no_package() { - use crate::ResolverGeneric; - use std::path::Path; - let f = Path::new("/"); - let file_system = MemoryFS::new(&[]); - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions::default(), - ); - let resolved_path = resolver.resolve(f, "package"); - assert!(resolved_path.is_err()); - } -} diff --git a/src/tests/symlink.rs b/src/tests/symlink.rs deleted file mode 100644 index 7589b560..00000000 --- a/src/tests/symlink.rs +++ /dev/null @@ -1,121 +0,0 @@ -use std::{fs, io, path::Path}; - -use crate::{ResolveOptions, Resolver}; - -#[derive(Debug, Clone, Copy)] -enum FileType { - File, - Dir, -} - -#[allow(unused_variables)] -fn symlink, Q: AsRef>( - original: P, - link: Q, - file_type: FileType, -) -> io::Result<()> { - #[cfg(target_family = "unix")] - { - std::os::unix::fs::symlink(original, link) - } - - #[cfg(target_family = "windows")] - match file_type { - FileType::File => std::os::windows::fs::symlink_file(original, link), - FileType::Dir => std::os::windows::fs::symlink_dir(original, link), - } -} - -fn init(dirname: &Path, temp_path: &Path) -> io::Result<()> { - if temp_path.exists() { - _ = fs::remove_dir_all(temp_path); - } - fs::create_dir(temp_path)?; - symlink(dirname.join("../lib/index.js"), temp_path.join("test"), FileType::File)?; - symlink(dirname.join("../lib"), temp_path.join("test2"), FileType::Dir)?; - fs::remove_file(temp_path.join("test"))?; - fs::remove_file(temp_path.join("test2"))?; - fs::remove_dir(temp_path) -} - -fn create_symlinks(dirname: &Path, temp_path: &Path) -> io::Result<()> { - fs::create_dir(temp_path).unwrap(); - symlink( - dirname.join("../lib/index.js").canonicalize().unwrap(), - temp_path.join("index.js"), - FileType::File, - )?; - symlink(dirname.join("../lib").canonicalize().unwrap(), temp_path.join("lib"), FileType::Dir)?; - symlink(dirname.join("..").canonicalize().unwrap(), temp_path.join("this"), FileType::Dir)?; - symlink(temp_path.join("this"), temp_path.join("that"), FileType::Dir)?; - symlink(Path::new("../../lib/index.js"), temp_path.join("node.relative.js"), FileType::File)?; - symlink( - Path::new("./node.relative.js"), - temp_path.join("node.relative.sym.js"), - FileType::File, - )?; - Ok(()) -} - -fn cleanup_symlinks(temp_path: &Path) { - _ = fs::remove_dir_all(temp_path); -} - -#[test] -fn test() -> io::Result<()> { - let root = super::fixture_root().join("enhanced_resolve"); - let dirname = root.join("test"); - let temp_path = dirname.join("temp"); - if !temp_path.exists() { - let is_admin = init(&dirname, &temp_path).is_ok(); - if !is_admin { - return Ok(()); - } - if let Err(err) = create_symlinks(&dirname, &temp_path) { - cleanup_symlinks(&temp_path); - return Err(err); - } - } - - let resolver_without_symlinks = - Resolver::new(ResolveOptions { symlinks: false, ..ResolveOptions::default() }); - let resolver_with_symlinks = Resolver::default(); - - #[rustfmt::skip] - let pass = [ - ("with a symlink to a file", temp_path.clone(), "./index.js"), - ("with a relative symlink to a file", temp_path.clone(), "./node.relative.js"), - ("with a relative symlink to a symlink to a file", temp_path.clone(), "./node.relative.sym.js"), - ("with a symlink to a directory 1", temp_path.clone(), "./lib/index.js"), - ("with a symlink to a directory 2", temp_path.clone(), "./this/lib/index.js"), - ("with multiple symlinks in the path 1", temp_path.clone(), "./this/test/temp/index.js"), - ("with multiple symlinks in the path 2", temp_path.clone(), "./this/test/temp/lib/index.js"), - ("with multiple symlinks in the path 3", temp_path.clone(), "./this/test/temp/this/lib/index.js"), - ("with a symlink to a directory 2 (chained)", temp_path.clone(), "./that/lib/index.js"), - ("with multiple symlinks in the path 1 (chained)", temp_path.clone(), "./that/test/temp/index.js"), - ("with multiple symlinks in the path 2 (chained)", temp_path.clone(), "./that/test/temp/lib/index.js"), - ("with multiple symlinks in the path 3 (chained)", temp_path.clone(), "./that/test/temp/that/lib/index.js"), - ("with symlinked directory as context 1", temp_path.join( "lib"), "./index.js"), - ("with symlinked directory as context 2", temp_path.join( "this"), "./lib/index.js"), - ("with symlinked directory as context and in path", temp_path.join( "this"), "./test/temp/lib/index.js"), - ("with symlinked directory in context path", temp_path.join( "this/lib"), "./index.js"), - ("with symlinked directory in context path and symlinked file", temp_path.join( "this/test"), "./temp/index.js"), - ("with symlinked directory in context path and symlinked directory", temp_path.join( "this/test"), "./temp/lib/index.js"), - ("with symlinked directory as context 2 (chained)", temp_path.join( "that"), "./lib/index.js"), - ("with symlinked directory as context and in path (chained)", temp_path.join( "that"), "./test/temp/lib/index.js"), - ("with symlinked directory in context path (chained)", temp_path.join( "that/lib"), "./index.js"), - ("with symlinked directory in context path and symlinked file (chained)", temp_path.join( "that/test"), "./temp/index.js"), - ("with symlinked directory in context path and symlinked directory (chained)", temp_path.join( "that/test"), "./temp/lib/index.js") - ]; - - for (comment, path, request) in pass { - let filename = resolver_with_symlinks.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(filename, Ok(root.join("lib/index.js")), "{comment:?}"); - - let resolved_path = - resolver_without_symlinks.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(path.join(request))); - } - - Ok(()) -} diff --git a/src/tests/tsconfig_paths.rs b/src/tests/tsconfig_paths.rs deleted file mode 100644 index b85bf6be..00000000 --- a/src/tests/tsconfig_paths.rs +++ /dev/null @@ -1,530 +0,0 @@ -//! tests for tsconfig-paths -//! -//! Fixtures copied from . - -use std::path::{Path, PathBuf}; - -use crate::{ - JSONError, ResolveError, ResolveOptions, Resolver, TsConfig, TsconfigOptions, - TsconfigReferences, -}; - -// -#[test] -fn tsconfig() { - let f = super::fixture_root().join("tsconfig"); - - #[rustfmt::skip] - let pass = [ - (f.clone(), None, "ts-path", f.join("foo.js")), - (f.join("nested"), None, "ts-path", f.join("nested/test.js")), - (f.join("cases/index"), None, "foo", f.join("node_modules/tsconfig-index/foo.js")), - // This requires reading package.json.tsconfig field - // (f.join("cases/field"), "foo", f.join("node_modules/tsconfig-field/foo.js")) - (f.join("cases/exports"), None, "foo", f.join("node_modules/tsconfig-exports/foo.js")), - (f.join("cases/extends-extension"), None, "foo", f.join("cases/extends-extension/foo.js")), - (f.join("cases/extends-extensionless"), None, "foo", f.join("node_modules/tsconfig-field/foo.js")), - (f.join("cases/extends-paths"), Some("src"), "@/index", f.join("cases/extends-paths/src/index.js")), - (f.join("cases/extends-multiple"), None, "foo", f.join("cases/extends-multiple/foo.js")), - ]; - - for (dir, subdir, request, expected) in pass { - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: dir.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - let path = subdir.map_or(dir.clone(), |subdir| dir.join(subdir)); - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{request} {path:?}"); - } - - #[rustfmt::skip] - let data = [ - (f.join("node_modules/tsconfig-not-used"), "ts-path", Ok(f.join("foo.js"))), - ]; - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - for (path, request, expected) in data { - let resolution = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolution, expected, "{path:?} {request}"); - } -} - -#[test] -fn tsconfig_fallthrough() { - let f = super::fixture_root().join("tsconfig"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "/"); - assert_eq!(resolved_path, Err(ResolveError::NotFound("/".into()))); -} - -#[test] -fn json_with_comments() { - let f = super::fixture_root().join("tsconfig/cases/trailing-comma"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "foo").map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(f.join("bar.js"))); -} - -#[test] -fn broken() { - let f = super::fixture_root().join("tsconfig"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("tsconfig_broken.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "/"); - let error = ResolveError::JSON(JSONError { - path: f.join("tsconfig_broken.json"), - message: String::from("EOF while parsing an object at line 2 column 0"), - line: 2, - column: 0, - }); - assert_eq!(resolved_path, Err(error)); -} - -// -#[test] -fn test_paths() { - let path = Path::new("/foo/tsconfig.json"); - let mut tsconfig_json = serde_json::json!({ - "compilerOptions": { - "paths": { - "jquery": ["node_modules/jquery/dist/jquery"], - "*": ["generated/*"], - "bar/*": ["test/*"], - "bar/baz/*": ["baz/*", "yo/*"], - "@/components/*": ["components/*"], - "url": ["node_modules/my-url"], - } - } - }) - .to_string(); - let tsconfig = TsConfig::parse(true, path, &mut tsconfig_json).unwrap(); - - let data = [ - ("jquery", vec!["/foo/node_modules/jquery/dist/jquery"]), - ("test", vec!["/foo/generated/test"]), - ("test/hello", vec!["/foo/generated/test/hello"]), - ("bar/hi", vec!["/foo/test/hi"]), - ("bar/baz/hi", vec!["/foo/baz/hi", "/foo/yo/hi"]), - ("@/components/button", vec!["/foo/components/button"]), - ("./jquery", vec![]), - ("url", vec!["/foo/node_modules/my-url"]), - ]; - - for (specifier, expected) in data { - let paths = tsconfig.resolve_path_alias(specifier); - let expected = expected.into_iter().map(PathBuf::from).collect::>(); - assert_eq!(paths, expected, "{specifier}"); - } -} - -// -#[test] -fn test_base_url() { - let path = Path::new("/foo/tsconfig.json"); - let mut tsconfig_json = serde_json::json!({ - "compilerOptions": { - "baseUrl": "./src" - } - }) - .to_string(); - let tsconfig = TsConfig::parse(true, path, &mut tsconfig_json).unwrap(); - - let data = [ - ("foo", vec!["/foo/src/foo"]), - ("components/button", vec!["/foo/src/components/button"]), - ("./jquery", vec![]), - ]; - - for (specifier, expected) in data { - let paths = tsconfig.resolve_path_alias(specifier); - let expected = expected.into_iter().map(PathBuf::from).collect::>(); - assert_eq!(paths, expected, "{specifier}"); - } -} - -// -#[test] -fn test_paths_and_base_url() { - let path = Path::new("/foo/tsconfig.json"); - let mut tsconfig_json = serde_json::json!({ - "compilerOptions": { - "baseUrl": "./src", - "paths": { - "*": ["generated/*"], - "bar/*": ["test/*"], - "bar/baz/*": ["baz/*", "yo/*"], - "@/components/*": ["components/*"] - } - } - }) - .to_string(); - let tsconfig = TsConfig::parse(true, path, &mut tsconfig_json).unwrap(); - - let data = [ - ("test", vec!["/foo/src/generated/test", "/foo/src/test"]), - ("test/hello", vec!["/foo/src/generated/test/hello", "/foo/src/test/hello"]), - ("bar/hi", vec!["/foo/src/test/hi", "/foo/src/bar/hi"]), - ("bar/baz/hi", vec!["/foo/src/baz/hi", "/foo/src/yo/hi", "/foo/src/bar/baz/hi"]), - ("@/components/button", vec!["/foo/src/components/button", "/foo/src/@/components/button"]), - ("./jquery", vec![]), - ]; - - for (specifier, expected) in data { - let paths = tsconfig.resolve_path_alias(specifier); - let expected = expected.into_iter().map(PathBuf::from).collect::>(); - assert_eq!(paths, expected, "{specifier}"); - } -} - -// Template variable ${configDir} for substitution of config files directory path -// https://github.com/microsoft/TypeScript/pull/58042 -#[test] -fn test_template_variable() { - let f = super::fixture_root().join("tsconfig"); - let f2 = f.join("cases").join("paths_template_variable"); - - #[rustfmt::skip] - let pass = [ - (f2.clone(), "tsconfig1.json", "foo", f2.join("foo.js")), - (f2.clone(), "tsconfig2.json", "foo", f2.join("foo.js")), - (f.clone(), "tsconfig_template_variable.json", "foo", f.join("foo.js")), - ]; - - for (dir, tsconfig, request, expected) in pass { - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: dir.join(tsconfig), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&dir, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{request} {tsconfig} {dir:?}"); - } -} - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows_test { - use std::path::{Path, PathBuf}; - - use crate::{ - ResolveError, ResolveOptions, ResolverGeneric, TsconfigOptions, TsconfigReferences, - }; - - use super::super::memory_fs::MemoryFS; - - struct OneTest { - name: &'static str, - tsconfig: String, - package_json: Option<(PathBuf, String)>, - main_fields: Option>, - existing_files: Vec<&'static str>, - requested_module: &'static str, - expected_path: &'static str, - extensions: Vec, - } - - impl Default for OneTest { - fn default() -> Self { - Self { - name: "", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/*": ["location/*"] - } - } - }) - .to_string(), - package_json: None, - main_fields: None, - existing_files: vec![], - requested_module: "", - expected_path: "", - extensions: vec![ - ".js".into(), - ".json".into(), - ".node".into(), - ".ts".into(), - ".tsx".into(), - ], - } - } - } - - impl OneTest { - fn resolver(&self, root: &Path) -> ResolverGeneric { - let mut file_system = MemoryFS::default(); - - file_system.add_file(&root.join("tsconfig.json"), &self.tsconfig); - if let Some((path, package_json)) = &self.package_json { - file_system.add_file(&root.join(path).join("package.json"), package_json); - } - for path in &self.existing_files { - file_system.add_file(Path::new(path), ""); - } - - let mut options = ResolveOptions { - extensions: self.extensions.clone(), - tsconfig: Some(TsconfigOptions { - config_file: root.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }; - if let Some(main_fields) = &self.main_fields { - options.main_fields.clone_from(main_fields); - } - - ResolverGeneric::::new_with_file_system(file_system, options) - } - } - - // Path matching tests from tsconfig-paths - // * - // * - #[test] - fn match_path() { - let pass = [ - OneTest { - name: "should locate path that matches with star and exists", - existing_files: vec!["/root/location/mylib/index.ts"], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve to correct path when many are specified", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/*": ["foo1/*", "foo2/*", "location/*", "foo3/*"], - } - } - }) - .to_string(), - existing_files: vec!["/root/location/mylib/index.ts"], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should locate path that matches with star and prioritize pattern with longest prefix", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "*": ["location/*"], - "lib/*": ["location/*"], - } - } - }) - .to_string(), - existing_files: vec![ - "/root/location/lib/mylib/index.ts", - "/root/location/mylib/index.ts", - ], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should locate path that matches with star and exists with extension", - existing_files: vec![ - "/root/location/mylib.myext", - ], - requested_module: "lib/mylib", - extensions: vec![".js".into(), ".myext".into()], - expected_path: "/root/location/mylib.myext", - ..OneTest::default() - }, - OneTest { - name: "should resolve request with extension specified", - existing_files: vec![ - "/root/location/test.jpg", - ], - requested_module: "lib/test.jpg", - expected_path: "/root/location/test.jpg", - ..OneTest::default() - }, - OneTest { - name: "should locate path that matches without star and exists", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/foo": ["location/foo"] - } - } - }) - .to_string(), - existing_files: vec![ - "/root/location/foo.ts", - ], - requested_module: "lib/foo", - expected_path: "/root/location/foo.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve to parent folder when filename is in subfolder", - existing_files: vec![ - "/root/location/mylib/index.ts", - ], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve from main field in package.json", - package_json: Some((PathBuf::from("/root/location/mylib"), serde_json::json!({ - "main": "./kalle.ts" - }).to_string())), - existing_files: vec![ - "/root/location/mylib/kalle.ts", - ], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/kalle.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve from main field in package.json (js)", - package_json: Some((PathBuf::from("/root/location/mylib.js"), serde_json::json!({ - "main": "./kalle.js" - }).to_string())), - existing_files: vec![ - "/root/location/mylib.js/kalle.js", - ], - extensions: vec![".ts".into(), ".js".into()], - requested_module: "lib/mylib.js", - expected_path: "/root/location/mylib.js/kalle.js", - ..OneTest::default() - }, - OneTest { - name: "should resolve from list of fields by priority in package.json", - main_fields: Some(vec!["missing".into(), "browser".into(), "main".into()]), - package_json: Some((PathBuf::from("/root/location/mylibjs"), serde_json::json!({ - "main": "./main.js", - "browser": "./browser.js" - }).to_string())), - existing_files: vec![ - "/root/location/mylibjs/main.js", - "/root/location/mylibjs/browser.js", - ], - extensions: vec![".ts".into(), ".js".into()], - requested_module: "lib/mylibjs", - expected_path: "/root/location/mylibjs/browser.js", - ..OneTest::default() - }, -OneTest { - name: "should ignore field mappings to missing files in package.json", - main_fields: Some(vec!["browser".into(), "main".into()]), - package_json: Some((PathBuf::from("/root/location/mylibjs"), serde_json::json!({ - "main": "./kalle.js", - "browser": "./nope.js" - }).to_string())), - existing_files: vec![ - "/root/location/mylibjs/kalle.js", - ], - extensions: vec![".ts".into(), ".js".into()], - requested_module: "lib/mylibjs", - expected_path: "/root/location/mylibjs/kalle.js", - ..OneTest::default() - }, - // Tests that are not applicable: - // name: "should resolve nested main fields" - // name: "should ignore advanced field mappings in package.json" - // name: "should resolve to with the help of baseUrl when not explicitly set" - // name: "should not resolve with the help of baseUrl when asked not to" - // name: "should resolve main file with cjs file extension" - OneTest { - name: "should resolve .ts from .js alias", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "@/*": ["src/*"] - } - } - }).to_string(), - existing_files: vec![ - "/root/src/foo.ts", - ], - requested_module: "@/foo", // original data was "@/foo.ts" but I don't get why it is the case? - expected_path: "/root/src/foo.ts", // original data was "/root/src/foo" - ..OneTest::default() - }, - ]; - - let root = PathBuf::from("/root"); - - for test in pass { - let resolved_path = - test.resolver(&root).resolve(&root, test.requested_module).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(PathBuf::from(test.expected_path)), "{}", test.name); - } - - let fail = [ - OneTest { - name: "should not locate path that does not match", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/*": ["location/*"] - } - } - }) - .to_string(), - existing_files: vec!["/root/location/mylib"], - requested_module: "lib/mylibjs", - ..OneTest::default() - }, - OneTest { - name: "should not resolve typings file (index.d.ts)", - existing_files: vec!["/root/location/mylib/index.d.ts"], - requested_module: "lib/mylib", - ..OneTest::default() - }, - ]; - - for test in fail { - let resolved_path = - test.resolver(&root).resolve(&root, test.requested_module).map(|f| f.full_path()); - assert_eq!( - resolved_path, - Err(ResolveError::NotFound(test.requested_module.into())), - "{}", - test.name - ); - } - } -} diff --git a/src/tests/tsconfig_project_references.rs b/src/tests/tsconfig_project_references.rs deleted file mode 100644 index 0d019d27..00000000 --- a/src/tests/tsconfig_project_references.rs +++ /dev/null @@ -1,132 +0,0 @@ -//! Tests for tsconfig project references - -use crate::{ResolveError, ResolveOptions, Resolver, TsconfigOptions, TsconfigReferences}; - -#[test] -fn auto() { - let f = super::fixture_root().join("tsconfig/cases/project_references"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("app"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - // Test normal paths alias - (f.join("app"), "@/index.ts", f.join("app/aliased/index.ts")), - (f.join("app"), "@/../index.ts", f.join("app/index.ts")), - // Test project reference - (f.join("project_a"), "@/index.ts", f.join("project_a/aliased/index.ts")), - (f.join("project_b/src"), "@/index.ts", f.join("project_b/src/aliased/index.ts")), - // Does not have paths alias - (f.join("project_a"), "./index.ts", f.join("project_a/index.ts")), - (f.join("project_c"), "./index.ts", f.join("project_c/index.ts")), - // Template variable - { - let dir = f.parent().unwrap().join("paths_template_variable"); - (dir.clone(), "foo", dir.join("foo.js")) - } - ]; - - for (path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{request} {path:?}"); - } -} - -#[test] -fn disabled() { - let f = super::fixture_root().join("tsconfig/cases/project_references"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("app"), - references: TsconfigReferences::Disabled, - }), - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - // Test normal paths alias - (f.join("app"), "@/index.ts", Ok(f.join("app/aliased/index.ts"))), - (f.join("app"), "@/../index.ts", Ok(f.join("app/index.ts"))), - // Test project reference - (f.join("project_a"), "@/index.ts", Err(ResolveError::NotFound("@/index.ts".into()))), - (f.join("project_b/src"), "@/index.ts", Err(ResolveError::NotFound("@/index.ts".into()))), - // Does not have paths alias - (f.join("project_a"), "./index.ts", Ok(f.join("project_a/index.ts"))), - (f.join("project_c"), "./index.ts", Ok(f.join("project_c/index.ts"))), - ]; - - for (path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, expected, "{request} {path:?}"); - } -} - -#[test] -fn manual() { - let f = super::fixture_root().join("tsconfig/cases/project_references"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("app"), - references: TsconfigReferences::Paths(vec!["../project_a/conf.json".into()]), - }), - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - // Test normal paths alias - (f.join("app"), "@/index.ts", Ok(f.join("app/aliased/index.ts"))), - (f.join("app"), "@/../index.ts", Ok(f.join("app/index.ts"))), - // Test project reference - (f.join("project_a"), "@/index.ts", Ok(f.join("project_a/aliased/index.ts"))), - (f.join("project_b/src"), "@/index.ts", Err(ResolveError::NotFound("@/index.ts".into()))), - // Does not have paths alias - (f.join("project_a"), "./index.ts", Ok(f.join("project_a/index.ts"))), - (f.join("project_c"), "./index.ts", Ok(f.join("project_c/index.ts"))), - ]; - - for (path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, expected, "{request} {path:?}"); - } -} - -#[test] -fn self_reference() { - let f = super::fixture_root().join("tsconfig/cases/project_references"); - - #[rustfmt::skip] - let pass = [ - (f.join("app"), vec!["./tsconfig.json".into()]), - (f.join("app/tsconfig.json"), vec!["./tsconfig.json".into()]), - (f.join("app"), vec![f.join("app")]), - (f.join("app/tsconfig.json"), vec![f.join("app")]), - (f.join("app/tsconfig.json"), vec![f.join("project_b"), f.join("app")]), - ]; - - for (config_file, reference_paths) in pass { - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: config_file.clone(), - references: TsconfigReferences::Paths(reference_paths.clone()), - }), - ..ResolveOptions::default() - }); - let path = f.join("app"); - let resolved_path = resolver.resolve(&path, "@/index.ts").map(|f| f.full_path()); - assert_eq!( - resolved_path, - Err(ResolveError::TsconfigSelfReference(f.join("app/tsconfig.json"))), - "{config_file:?} {reference_paths:?}" - ); - } -} diff --git a/src/tsconfig.rs b/src/tsconfig.rs deleted file mode 100644 index 6a675442..00000000 --- a/src/tsconfig.rs +++ /dev/null @@ -1,223 +0,0 @@ -use std::{ - hash::BuildHasherDefault, - path::{Path, PathBuf}, - sync::Arc, -}; - -use indexmap::IndexMap; -use rustc_hash::FxHasher; -use serde::Deserialize; - -use crate::PathUtil; - -pub type CompilerOptionsPathsMap = IndexMap, BuildHasherDefault>; - -#[derive(Debug, Clone, Eq, PartialEq, Deserialize)] -#[serde(untagged)] -pub enum ExtendsField { - Single(String), - Multiple(Vec), -} - -#[derive(Debug, Deserialize)] -#[serde(rename_all = "camelCase")] -pub struct TsConfig { - /// Whether this is the caller tsconfig. - /// Used for final template variable substitution when all configs are extended and merged. - #[serde(skip)] - root: bool, - - /// Path to `tsconfig.json`. Contains the `tsconfig.json` filename. - #[serde(skip)] - pub(crate) path: PathBuf, - - #[serde(default)] - pub extends: Option, - - #[serde(default)] - pub compiler_options: CompilerOptions, - - /// Bubbled up project references with a reference to their tsconfig. - #[serde(default)] - pub references: Vec, -} - -/// Compiler Options -/// -/// -#[derive(Debug, Default, Deserialize)] -#[serde(rename_all = "camelCase")] -pub struct CompilerOptions { - base_url: Option, - - /// Path aliases - paths: Option, - - /// The actual base for where path aliases are resolved from. - #[serde(skip)] - paths_base: PathBuf, -} - -/// Project Reference -/// -/// -#[derive(Debug, Deserialize)] -pub struct ProjectReference { - /// The path property of each reference can point to a directory containing a tsconfig.json file, - /// or to the config file itself (which may have any name). - pub path: PathBuf, - - /// Reference to the resolved tsconfig - #[serde(skip)] - pub tsconfig: Option>, -} - -impl TsConfig { - pub fn parse(root: bool, path: &Path, json: &mut str) -> Result { - _ = json_strip_comments::strip(json); - let mut tsconfig: Self = serde_json::from_str(json)?; - tsconfig.root = root; - tsconfig.path = path.to_path_buf(); - let directory = tsconfig.directory().to_path_buf(); - if let Some(base_url) = tsconfig.compiler_options.base_url { - tsconfig.compiler_options.base_url = Some(directory.normalize_with(base_url)); - } - if tsconfig.compiler_options.paths.is_some() { - tsconfig.compiler_options.paths_base = - tsconfig.compiler_options.base_url.as_ref().map_or(directory, Clone::clone); - } - Ok(tsconfig) - } - - pub fn build(mut self) -> Self { - if self.root { - let dir = self.directory().to_path_buf(); - // Substitute template variable in `tsconfig.compilerOptions.paths` - if let Some(paths) = &mut self.compiler_options.paths { - for paths in paths.values_mut() { - for path in paths { - Self::substitute_template_variable(&dir, path); - } - } - } - } - self - } - - /// Directory to `tsconfig.json` - /// - /// # Panics - /// - /// * When the `tsconfig.json` path is misconfigured. - pub fn directory(&self) -> &Path { - debug_assert!(self.path.file_name().is_some()); - self.path.parent().unwrap() - } - - pub fn extend_tsconfig(&mut self, tsconfig: &Self) { - let compiler_options = &mut self.compiler_options; - if compiler_options.paths.is_none() { - compiler_options.paths_base = compiler_options - .base_url - .as_ref() - .map_or_else(|| tsconfig.compiler_options.paths_base.clone(), Clone::clone); - compiler_options.paths.clone_from(&tsconfig.compiler_options.paths); - } - if compiler_options.base_url.is_none() { - compiler_options.base_url.clone_from(&tsconfig.compiler_options.base_url); - } - } - - pub fn resolve(&self, path: &Path, specifier: &str) -> Vec { - if path.starts_with(self.base_path()) { - let paths = self.resolve_path_alias(specifier); - if !paths.is_empty() { - return paths; - } - } - for tsconfig in self.references.iter().filter_map(|reference| reference.tsconfig.as_ref()) { - if path.starts_with(tsconfig.base_path()) { - return tsconfig.resolve_path_alias(specifier); - } - } - vec![] - } - - // Copied from parcel - // - pub fn resolve_path_alias(&self, specifier: &str) -> Vec { - if specifier.starts_with(['/', '.']) { - return vec![]; - } - - let base_url_iter = self - .compiler_options - .base_url - .as_ref() - .map_or_else(Vec::new, |base_url| vec![base_url.normalize_with(specifier)]); - - let Some(paths_map) = &self.compiler_options.paths else { - return base_url_iter; - }; - - let paths = paths_map.get(specifier).map_or_else( - || { - let mut longest_prefix_length = 0; - let mut longest_suffix_length = 0; - let mut best_key: Option<&String> = None; - - for key in paths_map.keys() { - if let Some((prefix, suffix)) = key.split_once('*') { - if (best_key.is_none() || prefix.len() > longest_prefix_length) - && specifier.starts_with(prefix) - && specifier.ends_with(suffix) - { - longest_prefix_length = prefix.len(); - longest_suffix_length = suffix.len(); - best_key.replace(key); - } - } - } - - best_key.and_then(|key| paths_map.get(key)).map_or_else(Vec::new, |paths| { - paths - .iter() - .map(|path| { - path.replace( - '*', - &specifier[longest_prefix_length - ..specifier.len() - longest_suffix_length], - ) - }) - .collect::>() - }) - }, - Clone::clone, - ); - - paths - .into_iter() - .map(|p| self.compiler_options.paths_base.normalize_with(p)) - .chain(base_url_iter) - .collect() - } - - fn base_path(&self) -> &Path { - self.compiler_options - .base_url - .as_ref() - .map_or_else(|| self.directory(), |path| path.as_ref()) - } - - /// Template variable `${configDir}` for substitution of config files directory path - /// - /// NOTE: All tests cases are just a head replacement of `${configDir}`, so we are constrained as such. - /// - /// See - fn substitute_template_variable(directory: &Path, path: &mut String) { - const TEMPLATE_VARIABLE: &str = "${configDir}/"; - if let Some(stripped_path) = path.strip_prefix(TEMPLATE_VARIABLE) { - *path = directory.join(stripped_path).to_string_lossy().to_string(); - } - } -} diff --git a/tests/integration_test.rs b/tests/integration_test.rs deleted file mode 100644 index 0fc52887..00000000 --- a/tests/integration_test.rs +++ /dev/null @@ -1,103 +0,0 @@ -//! Test public APIs - -use std::{env, path::PathBuf}; - -use oxc_resolver::{EnforceExtension, Resolution, ResolveContext, ResolveOptions, Resolver}; - -fn dir() -> PathBuf { - env::current_dir().unwrap() -} - -fn resolve(specifier: &str) -> Resolution { - let path = dir(); - Resolver::new(ResolveOptions::default()).resolve(path, specifier).unwrap() -} - -#[test] -fn clone() { - let resolution = resolve("./tests/package.json"); - assert_eq!(resolution.clone(), resolution); -} - -#[test] -fn debug() { - let resolution = resolve("./tests/package.json"); - let s = format!("{resolution:?}"); - assert!(!s.is_empty()); -} - -#[test] -fn eq() { - let resolution = resolve("./tests/package.json"); - assert_eq!(resolution, resolution); -} - -#[test] -fn package_json() { - let resolution = resolve("./tests/package.json"); - let package_json = resolution.package_json().unwrap(); - assert_eq!(package_json.name.as_ref().unwrap(), "name"); - assert_eq!(package_json.r#type.as_ref().unwrap().as_str(), "module".into()); - assert!(package_json.side_effects.as_ref().unwrap().is_object()); -} - -#[cfg(feature = "package_json_raw_json_api")] -#[test] -fn package_json_raw_json_api() { - let resolution = resolve("./tests/package.json"); - assert!(resolution - .package_json() - .unwrap() - .raw_json() - .get("name") - .is_some_and(|name| name == "name")); -} - -#[test] -fn clear_cache() { - let resolver = Resolver::new(ResolveOptions::default()); - resolver.clear_cache(); // exists -} - -#[test] -fn options() { - let resolver = Resolver::new(ResolveOptions::default()); - let options = resolver.options(); - assert!(!format!("{options:?}").is_empty()); -} - -#[test] -fn debug_resolver() { - let resolver = Resolver::new(ResolveOptions::default()); - assert!(!format!("{resolver:?}").is_empty()); -} - -#[test] -fn dependencies() { - let path = dir(); - let mut ctx = ResolveContext::default(); - let _ = Resolver::new(ResolveOptions::default()).resolve_with_context( - path, - "./tests/package.json", - &mut ctx, - ); - assert!(!ctx.file_dependencies.is_empty()); - assert!(ctx.missing_dependencies.is_empty()); -} - -#[test] -fn options_api() { - _ = ResolveOptions::default() - .with_builtin_modules(true) - .with_condition_names(&[]) - .with_extension(".js") - .with_force_extension(EnforceExtension::Auto) - .with_fully_specified(true) - .with_main_field("asdf") - .with_main_file("main") - .with_module("module") - .with_prefer_absolute(true) - .with_prefer_relative(true) - .with_root(PathBuf::new()) - .with_symbolic_link(true); -} diff --git a/tests/package.json b/tests/package.json deleted file mode 100644 index 54f58b8c..00000000 --- a/tests/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "name", - "type": "module", - "sideEffects": {} -} diff --git a/tests/resolve_test.rs b/tests/resolve_test.rs deleted file mode 100644 index 45934cf8..00000000 --- a/tests/resolve_test.rs +++ /dev/null @@ -1,132 +0,0 @@ -use std::{env, path::PathBuf}; - -use oxc_resolver::{ResolveError, ResolveOptions, Resolver}; - -fn dir() -> PathBuf { - env::current_dir().unwrap() -} - -#[test] -fn chinese() { - let dir = dir(); - let specifier = "./fixtures/misc/中文/中文.js"; - let resolution = Resolver::new(ResolveOptions::default()).resolve(&dir, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(dir.join("fixtures/misc/中文/中文.js")) - ); -} - -#[test] -fn styled_components() { - let dir = dir(); - let path = dir.join("fixtures/pnpm"); - let module_path = dir.join("node_modules/.pnpm/styled-components@6.1.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/styled-components"); - let specifier = "styled-components"; - - // cjs - let options = - ResolveOptions { alias_fields: vec![vec!["browser".into()]], ..ResolveOptions::default() }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/styled-components.browser.cjs.js")) - ); - - // esm - let options = ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - main_fields: vec!["module".into()], - ..ResolveOptions::default() - }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/styled-components.browser.esm.js")) - ); -} - -#[test] -fn axios() { - let dir = dir(); - let path = dir.join("fixtures/pnpm"); - let module_path = dir.join("node_modules/.pnpm/axios@1.6.2/node_modules/axios"); - let specifier = "axios"; - - // default - let options = ResolveOptions::default(); - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("index.js")) - ); - - // browser - let options = ResolveOptions { - condition_names: vec!["browser".into(), "require".into()], - ..ResolveOptions::default() - }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/browser/axios.cjs")) - ); - - // cjs - let options = ResolveOptions { - condition_names: vec!["node".into(), "require".into()], - ..ResolveOptions::default() - }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/node/axios.cjs")) - ); -} - -#[test] -fn postcss() { - let dir = dir(); - let path = dir.join("fixtures/pnpm"); - let module_path = path.join("node_modules/postcss"); - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - // should ignore "path" - let resolution = resolver.resolve(&module_path, "path"); - assert_eq!(resolution, Err(ResolveError::Ignored(module_path.clone()))); - - // should ignore "./lib/terminal-highlight" - let resolution = resolver.resolve(&module_path, "./lib/terminal-highlight"); - assert_eq!(resolution, Err(ResolveError::Ignored(module_path.join("lib/terminal-highlight")))); -} - -#[test] -fn ipaddr_js() { - let dir = dir(); - let path = dir.join("fixtures/pnpm"); - let module_path = - dir.join("node_modules/.pnpm/ipaddr.js@2.2.0/node_modules/ipaddr.js/lib/ipaddr.js"); - - let resolvers = [ - // with `extension_alias` - Resolver::new(ResolveOptions { - extension_alias: vec![(".js".into(), vec![".js".into(), ".ts".into(), ".tsx".into()])], - ..ResolveOptions::default() - }), - // with `extensions` should still resolve to module main - Resolver::new(ResolveOptions { - extensions: vec![(".ts".into())], - ..ResolveOptions::default() - }), - // default - Resolver::default(), - ]; - - for resolver in resolvers { - let resolution = resolver.resolve(&path, "ipaddr.js").map(|r| r.full_path()); - assert_eq!(resolution, Ok(module_path.clone())); - } -} From 7639de1a5b6fb268d00a75d04104dde82b5e0aa9 Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Tue, 10 Sep 2024 02:52:23 +0300 Subject: [PATCH 73/82] --- .github/CODE_OF_CONDUCT.md | 127 - .github/SECURITY.md | 7 - .github/actions/pnpm/action.yml | 26 - .github/codecov.yml | 14 - .github/renovate.json | 5 - .github/workflows/benchmark.yml | 41 - .github/workflows/ci.yml | 196 - .github/workflows/codecov.yml | 69 - .github/workflows/release-napi.yml | 252 - .github/workflows/release-plz.yml | 55 - Cargo.lock | 1326 --- fixtures/enhanced_resolve/lib/index.js | 1 - fixtures/enhanced_resolve/package.json | 4 - fixtures/enhanced_resolve/test/.gitignore | 3 - .../enhanced_resolve/test/fixtures/#/a.js | 0 fixtures/enhanced_resolve/test/fixtures/a.js | 3 - .../enhanced_resolve/test/fixtures/abc.txt | 1 - .../test/fixtures/alias/files/a.js | 0 fixtures/enhanced_resolve/test/fixtures/b.js | 3 - .../browser-module/browser/module-a.js | 0 .../fixtures/browser-module/lib/browser.js | 0 .../fixtures/browser-module/lib/ignore.js | 0 .../test/fixtures/browser-module/lib/main.js | 0 .../fixtures/browser-module/lib/replaced.js | 0 .../test/fixtures/browser-module/lib/self.js | 0 .../fixtures/browser-module/lib/toString.js | 0 .../browser-module/node_modules/module-a.js | 0 .../browser-module/node_modules/module-b.js | 0 .../browser-module/node_modules/module-c.js | 0 .../node_modules/recursive-file/a.js | 0 .../node_modules/recursive-file/b.js | 0 .../node_modules/recursive-file/c.js | 0 .../node_modules/recursive-file/d.js | 0 .../node_modules/recursive-file/package.json | 8 - .../test/fixtures/browser-module/package.json | 33 - .../test/fixtures/builtins/package.json | 12 - fixtures/enhanced_resolve/test/fixtures/c.js | 4 - .../enhanced_resolve/test/fixtures/complex.js | 13 - .../test/fixtures/crypto-js/index.js | 0 .../test/fixtures/crypto-js/package.json | 7 - .../test/fixtures/decorated-fs/exists.js | 0 .../test/fixtures/dirOrFile.js | 1 - .../test/fixtures/dirOrFile/index.js | 1 - .../directory-default/directory-default.js | 0 .../node_modules/@org/pkg/dist/string.js | 1 - .../@org/pkg/dist/string.test.d.ts | 1 - .../node_modules/@org/pkg/package.json | 9 - .../node_modules/pkg/dist/string.js | 1 - .../node_modules/pkg/dist/string.test.d.ts | 1 - .../node_modules/pkg/package.json | 9 - .../node_modules/exports-field/package.json | 7 - .../node_modules/pack1/index.js | 0 .../test/fixtures/exports-field/a.js | 1 - .../node_modules/exports-field/lib/browser.js | 1 - .../node_modules/exports-field/lib/index.js | 0 .../exports-field/lib/lib2/main.js | 1 - .../node_modules/exports-field/lib/main.js | 1 - .../node_modules/exports-field/main.js | 1 - .../node_modules/exports-field/package.json | 18 - .../node_modules/exports-field/x.js | 1 - .../invalid-exports-field/index.js | 0 .../invalid-exports-field/package.json | 13 - .../node_modules/invalid-exports-field/umd.js | 0 .../test/fixtures/exports-field/package.json | 5 - .../node_modules/exports-field/index.js | 1 - .../node_modules/exports-field/lib/browser.js | 1 - .../exports-field/lib/lib2/main.js | 1 - .../node_modules/exports-field/lib/main.js | 1 - .../node_modules/exports-field/main.js | 1 - .../node_modules/exports-field/package.json | 17 - .../node_modules/exports-field/index | 0 .../node_modules/exports-field/main.js | 1 - .../node_modules/exports-field/package.json | 10 - .../node_modules/exports-field/src/index.js | 0 .../fixtures/extension-alias/dir/index.js | 0 .../fixtures/extension-alias/dir/index.ts | 0 .../fixtures/extension-alias/dir2/index.js | 0 .../fixtures/extension-alias/dir2/index.mts | 0 .../test/fixtures/extension-alias/index.js | 0 .../test/fixtures/extension-alias/index.mjs | 0 .../fixtures/extension-alias/index.mts.js | 0 .../test/fixtures/extension-alias/index.ts | 0 .../test/fixtures/extensions/app.module.js | 0 .../test/fixtures/extensions/dir/index.js | 0 .../test/fixtures/extensions/dir/index.ts | 0 .../test/fixtures/extensions/foo.js | 0 .../test/fixtures/extensions/foo.ts | 0 .../test/fixtures/extensions/index.js | 0 .../test/fixtures/extensions/index.ts | 0 .../extensions/node_modules/module.js | 0 .../extensions/node_modules/module/index.ts | 0 .../test/fixtures/extensions/package.json | 3 - .../enhanced_resolve/test/fixtures/file.load1 | 0 .../enhanced_resolve/test/fixtures/file.load2 | 0 .../test/fixtures/foo/index.js | 0 .../test/fixtures/foo/package.json | 4 - .../node_modules/m/package.json | 17 - .../node_modules/m/src/features/f.js | 0 .../m/src/features/internal/file.js | 0 .../node_modules/m/src/features/y/y.js | 0 .../node_modules/m/src/internal/i.js | 0 .../node_modules/m/src/middle-1/f.js | 0 .../node_modules/m/src/middle-1/nested/f.js | 0 .../node_modules/m/src/middle-2/nested/f.js | 1 - .../m/src/middle-3/nested/f/nested/f.js | 0 .../node_modules/m/src/middle-4/f/f.js | 0 .../node_modules/m/src/middle-5/f$/$.js | 0 .../node_modules/m/src/middle-5/f/$.js | 0 .../node_modules/m/src/middle/f.js | 0 .../node_modules/m/src/middle/nested/f.js | 0 .../test/fixtures/imports-field/a.js | 1 - .../test/fixtures/imports-field/b.js | 0 .../test/fixtures/imports-field/dir/b.js | 0 .../node_modules/a/lib/browser.js | 1 - .../imports-field/node_modules/a/lib/index.js | 0 .../node_modules/a/lib/lib2/main.js | 1 - .../imports-field/node_modules/a/lib/main.js | 1 - .../imports-field/node_modules/a/main.js | 1 - .../imports-field/node_modules/a/package.json | 18 - .../imports-field/node_modules/a/x.js | 1 - .../imports-field/node_modules/c/index.js | 0 .../test/fixtures/imports-field/package.json | 17 - .../fixtures/incorrect-package/pack1/a.js | 0 .../incorrect-package/pack1/package.json | 2 - .../fixtures/incorrect-package/pack2/a.js | 0 .../incorrect-package/pack2/package.json | 0 .../test/fixtures/issue-238/package.json | 3 - .../test/fixtures/issue-238/src/a/config.js | 0 .../src/common/config/myObjectFile.js | 0 .../enhanced_resolve/test/fixtures/lib.js | 0 .../test/fixtures/lib/complex1.js | 1 - .../test/fixtures/main-field-self/index.js | 0 .../fixtures/main-field-self/package.json | 3 - .../test/fixtures/main-field-self2/index.js | 0 .../fixtures/main-field-self2/package.json | 3 - .../enhanced_resolve/test/fixtures/main1.js | 9 - .../enhanced_resolve/test/fixtures/main2.js | 12 - .../enhanced_resolve/test/fixtures/main3.js | 4 - .../multiple_modules/node_modules/m1/a.js | 3 - .../test/fixtures/no#fragment/#/#.js | 0 fixtures/enhanced_resolve/test/fixtures/no.js | 0 .../browser-module-broken/browser.js | 0 .../browser-module-broken/main.js | 0 .../browser-module-broken/package.json | 4 - .../complexm/node_modules/m1/a.js | 1 - .../complexm/node_modules/m1/index.js | 1 - .../fixtures/node_modules/complexm/step1.js | 1 - .../fixtures/node_modules/complexm/step2.js | 1 - .../fixtures/node_modules/dash-name/index.js | 0 .../node_modules/dash-name/package.json | 4 - .../test/fixtures/node_modules/dash/index.js | 0 .../fixtures/node_modules/dash/package.json | 4 - .../invalidPackageJson/package.json | 0 .../test/fixtures/node_modules/m1/a.js | 3 - .../test/fixtures/node_modules/m1/b.js | 3 - .../test/fixtures/node_modules/m2/b.js | 1 - .../node_modules/recursive-module/file.js | 0 .../node_modules/recursive-module/index.js | 0 .../test/fixtures/pnp-a/m2/a.js | 3 - .../test/fixtures/pnp/pkg/dir/index.js | 0 .../test/fixtures/pnp/pkg/index.js | 0 .../test/fixtures/pnp/pkg/main.js | 0 .../fixtures/pnp/pkg/package-alias/browser.js | 0 .../fixtures/pnp/pkg/package-alias/index.js | 0 .../test/fixtures/pnp/pkg/package.json | 7 - .../test/fixtures/pnp/pkg/typescript/index.ts | 0 .../test/fixtures/pnp/pkg3/a.js | 1 - .../test/fixtures/pnp/pkg3/package.json | 8 - .../prefer-pnp/alternative-modules/m1/b.js | 0 .../restrictions/node_modules/pck1/index.css | 0 .../restrictions/node_modules/pck1/index.js | 0 .../node_modules/pck1/package.json | 3 - .../restrictions/node_modules/pck2/index.css | 0 .../restrictions/node_modules/pck2/module.js | 0 .../node_modules/pck2/package.json | 5 - .../test/fixtures/roots_fall_through/index.js | 0 .../scoped/node_modules/@scope/pack1/main.js | 0 .../node_modules/@scope/pack1/package.json | 5 - .../node_modules/@scope/pack2/lib/index.js | 0 .../scoped/node_modules/@scope/pack2/main.js | 0 .../node_modules/@scope/pack2/package.json | 3 - .../test/fixtures/shortcutdir.js/a.js | 0 .../test/fixtures/yield/a/foo-2/b | 0 .../test/fixtures/yield/a/foo-2/c | 0 .../test/fixtures/yield/a/foo/a | 0 .../test/fixtures/yield/a/foo/b | 0 .../test/fixtures/yield/b/foo/a | 0 .../test/fixtures/yield/c/foo/a | 0 .../test/fixtures/yield/c/foo/package.json | 7 - .../fixtures/\346\265\213\350\257\225.js" | 0 .../\344\270\255\346\226\207.js" | 0 fixtures/pnp/.gitignore | 1 - fixtures/pnp/.pnp.cjs | 7543 ----------------- fixtures/pnp/.yarnrc.yml | 1 - fixtures/pnp/package.json | 8 - fixtures/pnp/yarn.lock | 74 - fixtures/pnpm/.gitignore | 1 - fixtures/pnpm/package.json | 11 - fixtures/pnpm/pnpm-lock.yaml | 212 - fixtures/tsconfig/cases/builtins/thing.js | 0 .../tsconfig/cases/builtins/tsconfig.json | 5 - fixtures/tsconfig/cases/exports/index.js | 0 fixtures/tsconfig/cases/exports/tsconfig.json | 3 - .../extends-extension/base-tsconfig.json | 7 - .../tsconfig/cases/extends-extension/foo.js | 0 .../cases/extends-extension/tsconfig.json | 3 - .../cases/extends-extensionless/foo.js | 0 .../cases/extends-extensionless/tsconfig.json | 3 - .../tsconfig/cases/extends-multiple/foo.js | 0 .../cases/extends-multiple/tsconfig.json | 6 - .../tsconfig/cases/extends-not-found/index.js | 0 .../cases/extends-not-found/tsconfig.json | 3 - .../tsconfig/cases/extends-paths/src/index.js | 0 .../cases/extends-paths/tsconfig.base.json | 7 - .../cases/extends-paths/tsconfig.json | 6 - fixtures/tsconfig/cases/field/index.js | 0 fixtures/tsconfig/cases/field/tsconfig.json | 3 - fixtures/tsconfig/cases/index/index.js | 0 fixtures/tsconfig/cases/index/tsconfig.json | 3 - .../cases/paths_template_variable/foo.js | 0 .../paths_template_variable/tsconfig1.json | 3 - .../paths_template_variable/tsconfig2.json | 8 - .../project_references/app/aliased/index.ts | 0 .../cases/project_references/app/index.ts | 0 .../project_references/app/tsconfig.json | 23 - .../project_a/aliased/index.ts | 0 .../project_references/project_a/conf.json | 8 - .../project_references/project_a/index.ts | 0 .../project_b/src/aliased/index.ts | 0 .../project_b/tsconfig.json | 9 - .../project_references/project_c/index.ts | 0 .../project_c/tsconfig.json | 5 - .../project_references/tsconfig.base.json | 4 - fixtures/tsconfig/cases/suffixes/a.ios.ts | 0 fixtures/tsconfig/cases/suffixes/a.ts | 0 fixtures/tsconfig/cases/suffixes/b.ts | 0 fixtures/tsconfig/cases/suffixes/c-test.ts | 0 fixtures/tsconfig/cases/suffixes/index.ts | 1 - .../tsconfig/cases/suffixes/tsconfig.json | 5 - fixtures/tsconfig/cases/trailing-comma/bar.js | 0 .../tsconfig/cases/trailing-comma/index.js | 0 .../cases/trailing-comma/tsconfig.json | 9 - fixtures/tsconfig/foo.js | 0 fixtures/tsconfig/nested/index.js | 0 fixtures/tsconfig/nested/test.js | 0 fixtures/tsconfig/nested/tsconfig.json | 8 - .../node_modules/tsconfig-exports/conf.json | 7 - .../node_modules/tsconfig-exports/foo.js | 0 .../tsconfig-exports/package.json | 7 - .../node_modules/tsconfig-field/conf.json | 7 - .../node_modules/tsconfig-field/foo.js | 0 .../node_modules/tsconfig-field/package.json | 5 - .../node_modules/tsconfig-index/foo.js | 0 .../node_modules/tsconfig-index/package.json | 4 - .../node_modules/tsconfig-index/tsconfig.json | 7 - .../node_modules/tsconfig-not-used/foo.js | 0 .../tsconfig-not-used/tsconfig.json | 7 - fixtures/tsconfig/package.json | 24 - fixtures/tsconfig/tsconfig.json | 7 - fixtures/tsconfig/tsconfig_broken.json | 1 - .../tsconfig/tsconfig_template_variable.json | 7 - napi/__test__/resolver.spec.mjs | 260 - napi/src/lib.rs | 214 - napi/src/options.rs | 261 - napi/src/tracing.rs | 25 - napi/tests/options.test.mjs | 59 - npm/package.json | 79 +- package.json | 53 +- pnpm-lock.yaml | 2598 ------ src/builtins.rs | 71 - src/cache.rs | 354 - src/context.rs | 89 - src/error.rs | 182 - src/file_system.rs | 220 - src/lib.rs | 1755 ---- src/options.rs | 633 -- src/package_json.rs | 219 - src/path.rs | 132 - src/resolution.rs | 92 - src/specifier.rs | 230 - src/tests/alias.rs | 283 - src/tests/browser_field.rs | 189 - src/tests/builtins.rs | 121 - src/tests/dependencies.rs | 110 - src/tests/exports_field.rs | 2546 ------ src/tests/extension_alias.rs | 70 - src/tests/extensions.rs | 125 - src/tests/fallback.rs | 100 - src/tests/full_specified.rs | 113 - src/tests/imports_field.rs | 1320 --- src/tests/incorrect_description_file.rs | 65 - src/tests/main_field.rs | 24 - src/tests/memory_fs.rs | 74 - src/tests/missing.rs | 106 - src/tests/mod.rs | 51 - src/tests/pnp.rs | 45 - src/tests/resolve.rs | 119 - src/tests/restrictions.rs | 25 - src/tests/roots.rs | 92 - src/tests/scoped_packages.rs | 25 - src/tests/simple.rs | 68 - src/tests/symlink.rs | 121 - src/tests/tsconfig_paths.rs | 530 -- src/tests/tsconfig_project_references.rs | 132 - src/tsconfig.rs | 223 - tests/integration_test.rs | 103 - tests/package.json | 5 - tests/resolve_test.rs | 132 - 308 files changed, 56 insertions(+), 24940 deletions(-) delete mode 100644 .github/CODE_OF_CONDUCT.md delete mode 100644 .github/SECURITY.md delete mode 100644 .github/actions/pnpm/action.yml delete mode 100644 .github/codecov.yml delete mode 100644 .github/renovate.json delete mode 100644 .github/workflows/benchmark.yml delete mode 100644 .github/workflows/ci.yml delete mode 100644 .github/workflows/codecov.yml delete mode 100644 .github/workflows/release-napi.yml delete mode 100644 .github/workflows/release-plz.yml delete mode 100644 Cargo.lock delete mode 100644 fixtures/enhanced_resolve/lib/index.js delete mode 100644 fixtures/enhanced_resolve/package.json delete mode 100644 fixtures/enhanced_resolve/test/.gitignore delete mode 100644 fixtures/enhanced_resolve/test/fixtures/#/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/abc.txt delete mode 100644 fixtures/enhanced_resolve/test/fixtures/alias/files/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/browser/module-a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/ignore.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/replaced.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/self.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/toString.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-c.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/c.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/d.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/builtins/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/c.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/complex.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/crypto-js/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/decorated-fs/exists.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/dirOrFile.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/directory-default/directory-default.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/pack1/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/umd.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/index delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/src/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.mts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mjs delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mts.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/app.module.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/foo.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/foo.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/file.load1 delete mode 100644 fixtures/enhanced_resolve/test/fixtures/file.load2 delete mode 100644 fixtures/enhanced_resolve/test/fixtures/foo/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/foo/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/internal/file.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/y/y.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/internal/i.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-3/nested/f/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-4/f/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f$/$.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f/$.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/dir/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/c/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/issue-238/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/issue-238/src/a/config.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/issue-238/src/common/config/myObjectFile.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/lib.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/lib/complex1.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self2/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main1.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main2.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main3.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/no#fragment/#/#.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/no.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/invalidPackageJson/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/file.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/dir/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/typescript/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/prefer-pnp/alternative-modules/m1/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.css delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/index.css delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/module.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/roots_fall_through/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/lib/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/shortcutdir.js/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/b delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/c delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo/a delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo/b delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/b/foo/a delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/c/foo/a delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json delete mode 100644 "fixtures/enhanced_resolve/test/fixtures/\346\265\213\350\257\225.js" delete mode 100644 "fixtures/misc/\344\270\255\346\226\207/\344\270\255\346\226\207.js" delete mode 100644 fixtures/pnp/.gitignore delete mode 100755 fixtures/pnp/.pnp.cjs delete mode 100644 fixtures/pnp/.yarnrc.yml delete mode 100644 fixtures/pnp/package.json delete mode 100644 fixtures/pnp/yarn.lock delete mode 100644 fixtures/pnpm/.gitignore delete mode 100644 fixtures/pnpm/package.json delete mode 100644 fixtures/pnpm/pnpm-lock.yaml delete mode 100644 fixtures/tsconfig/cases/builtins/thing.js delete mode 100644 fixtures/tsconfig/cases/builtins/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/exports/index.js delete mode 100644 fixtures/tsconfig/cases/exports/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-extension/base-tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-extension/foo.js delete mode 100644 fixtures/tsconfig/cases/extends-extension/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-extensionless/foo.js delete mode 100644 fixtures/tsconfig/cases/extends-extensionless/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-multiple/foo.js delete mode 100644 fixtures/tsconfig/cases/extends-multiple/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-not-found/index.js delete mode 100644 fixtures/tsconfig/cases/extends-not-found/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-paths/src/index.js delete mode 100644 fixtures/tsconfig/cases/extends-paths/tsconfig.base.json delete mode 100644 fixtures/tsconfig/cases/extends-paths/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/field/index.js delete mode 100644 fixtures/tsconfig/cases/field/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/index/index.js delete mode 100644 fixtures/tsconfig/cases/index/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/paths_template_variable/foo.js delete mode 100644 fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json delete mode 100644 fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json delete mode 100644 fixtures/tsconfig/cases/project_references/app/aliased/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/app/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/app/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/project_references/project_a/aliased/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_a/conf.json delete mode 100644 fixtures/tsconfig/cases/project_references/project_a/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_b/src/aliased/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_b/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/project_references/project_c/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_c/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/project_references/tsconfig.base.json delete mode 100644 fixtures/tsconfig/cases/suffixes/a.ios.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/a.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/b.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/c-test.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/index.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/trailing-comma/bar.js delete mode 100644 fixtures/tsconfig/cases/trailing-comma/index.js delete mode 100644 fixtures/tsconfig/cases/trailing-comma/tsconfig.json delete mode 100644 fixtures/tsconfig/foo.js delete mode 100644 fixtures/tsconfig/nested/index.js delete mode 100644 fixtures/tsconfig/nested/test.js delete mode 100644 fixtures/tsconfig/nested/tsconfig.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-exports/conf.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-exports/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-exports/package.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-field/conf.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-field/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-field/package.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-index/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-index/package.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-not-used/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json delete mode 100755 fixtures/tsconfig/package.json delete mode 100644 fixtures/tsconfig/tsconfig.json delete mode 100644 fixtures/tsconfig/tsconfig_broken.json delete mode 100644 fixtures/tsconfig/tsconfig_template_variable.json delete mode 100644 napi/__test__/resolver.spec.mjs delete mode 100644 napi/src/lib.rs delete mode 100644 napi/src/options.rs delete mode 100644 napi/src/tracing.rs delete mode 100644 napi/tests/options.test.mjs delete mode 100644 pnpm-lock.yaml delete mode 100644 src/builtins.rs delete mode 100644 src/cache.rs delete mode 100644 src/context.rs delete mode 100644 src/error.rs delete mode 100644 src/file_system.rs delete mode 100644 src/lib.rs delete mode 100644 src/options.rs delete mode 100644 src/package_json.rs delete mode 100644 src/path.rs delete mode 100644 src/resolution.rs delete mode 100644 src/specifier.rs delete mode 100644 src/tests/alias.rs delete mode 100644 src/tests/browser_field.rs delete mode 100644 src/tests/builtins.rs delete mode 100644 src/tests/dependencies.rs delete mode 100644 src/tests/exports_field.rs delete mode 100644 src/tests/extension_alias.rs delete mode 100644 src/tests/extensions.rs delete mode 100644 src/tests/fallback.rs delete mode 100644 src/tests/full_specified.rs delete mode 100644 src/tests/imports_field.rs delete mode 100644 src/tests/incorrect_description_file.rs delete mode 100644 src/tests/main_field.rs delete mode 100644 src/tests/memory_fs.rs delete mode 100644 src/tests/missing.rs delete mode 100644 src/tests/mod.rs delete mode 100644 src/tests/pnp.rs delete mode 100644 src/tests/resolve.rs delete mode 100644 src/tests/restrictions.rs delete mode 100644 src/tests/roots.rs delete mode 100644 src/tests/scoped_packages.rs delete mode 100644 src/tests/simple.rs delete mode 100644 src/tests/symlink.rs delete mode 100644 src/tests/tsconfig_paths.rs delete mode 100644 src/tests/tsconfig_project_references.rs delete mode 100644 src/tsconfig.rs delete mode 100644 tests/integration_test.rs delete mode 100644 tests/package.json delete mode 100644 tests/resolve_test.rs diff --git a/.github/CODE_OF_CONDUCT.md b/.github/CODE_OF_CONDUCT.md deleted file mode 100644 index 41dd9ebe..00000000 --- a/.github/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,127 +0,0 @@ -# Contributor Covenant Code of Conduct - -## Our Pledge - -We as members, contributors, and leaders pledge to make participation in our -community a harassment-free experience for everyone, regardless of age, body -size, visible or invisible disability, ethnicity, sex characteristics, gender -identity and expression, level of experience, education, socio-economic status, -nationality, personal appearance, race, religion, or sexual identity -and orientation. - -We pledge to act and interact in ways that contribute to an open, welcoming, -diverse, inclusive, and healthy community. - -## Our Standards - -Examples of behavior that contributes to a positive environment for our -community include: - -* Demonstrating empathy and kindness toward other people -* Being respectful of differing opinions, viewpoints, and experiences -* Giving and gracefully accepting constructive feedback -* Accepting responsibility and apologizing to those affected by our mistakes, - and learning from the experience -* Focusing on what is best not just for us as individuals, but for the - overall community - -Examples of unacceptable behavior include: - -* The use of sexualized language or imagery, and sexual attention or - advances of any kind -* Trolling, insulting or derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or email - address, without their explicit permission -* Other conduct which could reasonably be considered inappropriate in a - professional setting - -## Enforcement Responsibilities - -Community leaders are responsible for clarifying and enforcing our standards of -acceptable behavior and will take appropriate and fair corrective action in -response to any behavior that they deem inappropriate, threatening, offensive, -or harmful. - -Community leaders have the right and responsibility to remove, edit, or reject -comments, commits, code, wiki edits, issues, and other contributions that are -not aligned to this Code of Conduct, and will communicate reasons for moderation -decisions when appropriate. - -## Scope - -This Code of Conduct applies within all community spaces, and also applies when -an individual is officially representing the community in public spaces. -Examples of representing our community include using an official e-mail address, -posting via an official social media account, or acting as an appointed -representative at an online or offline event. - -## Enforcement - -Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported to the community leaders responsible for enforcement. -All complaints will be reviewed and investigated promptly and fairly. - -All community leaders are obligated to respect the privacy and security of the -reporter of any incident. - -## Enforcement Guidelines - -Community leaders will follow these Community Impact Guidelines in determining -the consequences for any action they deem in violation of this Code of Conduct: - -### 1. Correction - -**Community Impact**: Use of inappropriate language or other behavior deemed -unprofessional or unwelcome in the community. - -**Consequence**: A private, written warning from community leaders, providing -clarity around the nature of the violation and an explanation of why the -behavior was inappropriate. A public apology may be requested. - -### 2. Warning - -**Community Impact**: A violation through a single incident or series -of actions. - -**Consequence**: A warning with consequences for continued behavior. No -interaction with the people involved, including unsolicited interaction with -those enforcing the Code of Conduct, for a specified period of time. This -includes avoiding interactions in community spaces as well as external channels -like social media. Violating these terms may lead to a temporary or -permanent ban. - -### 3. Temporary Ban - -**Community Impact**: A serious violation of community standards, including -sustained inappropriate behavior. - -**Consequence**: A temporary ban from any sort of interaction or public -communication with the community for a specified period of time. No public or -private interaction with the people involved, including unsolicited interaction -with those enforcing the Code of Conduct, is allowed during this period. -Violating these terms may lead to a permanent ban. - -### 4. Permanent Ban - -**Community Impact**: Demonstrating a pattern of violation of community -standards, including sustained inappropriate behavior, harassment of an -individual, or aggression toward or disparagement of classes of individuals. - -**Consequence**: A permanent ban from any sort of public interaction within -the community. - -## Attribution - -This Code of Conduct is adapted from the [Contributor Covenant][homepage], -version 2.0, available at -https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. - -Community Impact Guidelines were inspired by [Mozilla's code of conduct -enforcement ladder](https://github.com/mozilla/diversity). - -[homepage]: https://www.contributor-covenant.org - -For answers to common questions about this code of conduct, see the FAQ at -https://www.contributor-covenant.org/faq. Translations are available at -https://www.contributor-covenant.org/translations. diff --git a/.github/SECURITY.md b/.github/SECURITY.md deleted file mode 100644 index 63f5b072..00000000 --- a/.github/SECURITY.md +++ /dev/null @@ -1,7 +0,0 @@ -# Security Policy - -## Supported Versions - -## Reporting a Vulnerability - -If you find any potential vulnerability, join our [discord channel](https://discord.gg/9uXCAwqQZW) and contact Boshen. diff --git a/.github/actions/pnpm/action.yml b/.github/actions/pnpm/action.yml deleted file mode 100644 index ab4291c0..00000000 --- a/.github/actions/pnpm/action.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: Pnpm - -description: Install pnpm - -runs: - using: composite - steps: - - uses: pnpm/action-setup@v4 - - - uses: actions/setup-node@v4 - with: - node-version-file: .node-version - cache: pnpm - - - name: yarn - shell: bash - run: | - cd fixtures/pnp - corepack enable - yarn install - - - name: pnpm - shell: bash - run: | - corepack enable - pnpm install diff --git a/.github/codecov.yml b/.github/codecov.yml deleted file mode 100644 index 0610268a..00000000 --- a/.github/codecov.yml +++ /dev/null @@ -1,14 +0,0 @@ -coverage: - status: - project: - default: - informational: true - patch: - default: - informational: true - changes: - default: - informational: true - -ignore: - - "examples" diff --git a/.github/renovate.json b/.github/renovate.json deleted file mode 100644 index 2339df09..00000000 --- a/.github/renovate.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "$schema": "https://docs.renovatebot.com/renovate-schema.json", - "extends": ["github>Boshen/renovate"], - "ignorePaths": ["**/node_modules/**", "**/fixtures/**"] -} diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml deleted file mode 100644 index 7c25853b..00000000 --- a/.github/workflows/benchmark.yml +++ /dev/null @@ -1,41 +0,0 @@ -name: Benchmark - -on: - workflow_dispatch: - pull_request: - types: [opened, synchronize] - paths-ignore: - - '**/*.md' - push: - branches: - - main - paths-ignore: - - '**/*.md' - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} - cancel-in-progress: true - -jobs: - benchmark: - name: Benchmark - runs-on: ubuntu-latest - steps: - - name: Checkout Branch - uses: taiki-e/checkout-action@v1 - - - uses: Boshen/setup-rust@main - with: - cache-key: benchmark - save-cache: ${{ github.ref_name == 'main' }} - tools: cargo-codspeed - - uses: ./.github/actions/pnpm - - name: Build Benchmark - run: cargo codspeed build --features codspeed - - - name: Run benchmark - uses: CodSpeedHQ/action@v3 - timeout-minutes: 30 - with: - run: cargo codspeed run - token: ${{ secrets.CODSPEED_TOKEN }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index 3f629ffb..00000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,196 +0,0 @@ -name: CI - -on: - workflow_dispatch: - pull_request: - types: [opened, synchronize] - paths-ignore: - - '**/*.md' - - '!.github/workflows/ci.yml' - push: - branches: - - main - - "renovate/**" - paths-ignore: - - '**/*.md' - - '!.github/workflows/ci.yml' - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} - cancel-in-progress: ${{ github.ref_name != 'main' }} - -defaults: - run: - shell: bash - -jobs: - cache: # Warm cache factory for all other CI jobs - name: Check and Build - strategy: - fail-fast: true - matrix: - include: - - os: windows-latest - - os: ubuntu-latest - - os: macos-14 - runs-on: ${{ matrix.os }} - steps: - - uses: taiki-e/checkout-action@v1 - - - uses: Boshen/setup-rust@main - with: - save-cache: ${{ github.ref_name == 'main' }} - cache-key: warm - - - run: cargo check --all-features --locked - - # Only need to build the test to create a warm cache on the main branch - - name: Build cache by Cargo Check and Cargo Test - if: ${{ github.ref_name == 'main' }} - run: cargo test --all-features --no-run - - wasm: - name: Check Wasm - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - - uses: Boshen/setup-rust@main - with: - cache-key: wasm - save-cache: ${{ github.ref_name == 'main' }} - - - name: Check - run: | - rustup target add wasm32-unknown-unknown - cargo check --all-features --target wasm32-unknown-unknown - - wasi: - name: Test wasi target - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - - uses: Boshen/setup-rust@main - with: - cache-key: wasi - save-cache: ${{ github.ref_name == 'main' }} - - - uses: ./.github/actions/pnpm - - - name: Build - run: | - rustup target add wasm32-wasip1-threads - pnpm build --target wasm32-wasip1-threads - - - name: Test - run: pnpm test - env: - WASI_TEST: 1 - - typos: - name: Spell Check - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - - uses: crate-ci/typos@v1.24.5 - with: - files: . - - deny: - name: Cargo Deny - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - - uses: dorny/paths-filter@v3 - id: filter - with: - filters: | - src: - - 'Cargo.lock' - - - uses: Boshen/setup-rust@main - with: - restore-cache: false - tools: cargo-deny - - - if: steps.filter.outputs.src == 'true' - run: cargo deny check - - unused-deps: - name: Check Unused Dependencies - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - uses: dorny/paths-filter@v3 - id: filter - with: - filters: | - src: - - '**/*.rs' - - '**/Cargo.toml' - - 'Cargo.lock' - - uses: Boshen/setup-rust@main - with: - restore-cache: false - if: steps.filter.outputs.src == 'true' - - uses: cargo-bins/cargo-binstall@main - if: steps.filter.outputs.src == 'true' - - run: cargo binstall --no-confirm cargo-shear@1 - if: steps.filter.outputs.src == 'true' - - run: cargo shear - if: steps.filter.outputs.src == 'true' - - format: - name: Format - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - uses: Boshen/setup-rust@main - with: - components: rustfmt - restore-cache: false - - run: cargo fmt --all -- --check - - lint: - name: Clippy - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - uses: Boshen/setup-rust@main - with: - components: clippy - - run: cargo clippy --all-features -- -D warnings - - doc: - name: Doc - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - uses: Boshen/setup-rust@main - with: - components: rust-docs - - run: RUSTDOCFLAGS='-D warnings' cargo doc --no-deps --all-features - - test: - name: Test - strategy: - fail-fast: true - matrix: - include: - - os: windows-latest - - os: ubuntu-latest - - os: macos-14 - runs-on: ${{ matrix.os }} - env: - RUST_BACKTRACE: 1 - steps: - - uses: taiki-e/checkout-action@v1 - - uses: ./.github/actions/pnpm - - uses: Boshen/setup-rust@main - with: - cache-key: warm - - run: cargo test --doc - - run: cargo test --all-features diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml deleted file mode 100644 index 97302b03..00000000 --- a/.github/workflows/codecov.yml +++ /dev/null @@ -1,69 +0,0 @@ -name: Code Coverage # Run cargo-llvm-cov and upload to codecov.io - -on: - workflow_dispatch: - pull_request: - types: [opened, synchronize] - paths-ignore: - - '**/*.md' - push: - branches: - - main - paths-ignore: - - '**/*.md' - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: ${{ github.ref_name != 'main' }} - -jobs: - coverage: - name: Code Coverage - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: taiki-e/checkout-action@v1 - - - uses: ./.github/actions/pnpm - - - uses: Boshen/setup-rust@main - with: - cache-key: codecov - save-cache: ${{ github.ref_name == 'main' }} - tools: cargo-llvm-cov - components: llvm-tools-preview - - - run: cargo llvm-cov --lcov --output-path lcov.info - - - name: Upload Artifact - uses: actions/upload-artifact@v4 - with: - name: codecov - path: lcov.info - - # codecov often fails, use another workflow for retry - upload-codecov: - name: Upload coverage file - runs-on: ubuntu-latest - needs: coverage - # Check if the event is not triggered by a fork by checking whether CODECOV_TOKEN is set - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - steps: - - name: Checkout - if: env.CODECOV_TOKEN - uses: taiki-e/checkout-action@v1 - - - name: Download coverage file - if: env.CODECOV_TOKEN - uses: actions/download-artifact@v4 - with: - name: codecov - - - name: Upload to codecov.io - if: env.CODECOV_TOKEN - uses: codecov/codecov-action@v4 - with: - token: ${{ secrets.CODECOV_TOKEN }} - fail_ci_if_error: true - files: lcov.info diff --git a/.github/workflows/release-napi.yml b/.github/workflows/release-napi.yml deleted file mode 100644 index 1ea68db8..00000000 --- a/.github/workflows/release-napi.yml +++ /dev/null @@ -1,252 +0,0 @@ -name: Release NAPI - -on: - workflow_dispatch: - push: - branches: - - main - paths: - - npm/package.json # Please only commit this file, so we don't need to wait for test CI to pass. - -env: - DEBUG: 'napi:*' - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - check: - name: Check version - runs-on: ubuntu-latest - outputs: - version: ${{ env.version }} - version_changed: ${{ steps.version.outputs.changed }} - steps: - - uses: taiki-e/checkout-action@v1 - - - name: Check version changes - uses: EndBug/version-check@v2 - id: version - with: - static-checking: localIsNew - file-url: https://unpkg.com/oxc-resolver@latest/package.json - file-name: npm/package.json - - - name: Set version name - if: steps.version.outputs.changed == 'true' - run: | - echo "Version change found! New version: ${{ steps.version.outputs.version }} (${{ steps.version.outputs.version_type }})" - echo "version=${{ steps.version.outputs.version }}" >> $GITHUB_ENV - - build: - needs: check - if: needs.check.outputs.version_changed == 'true' - env: - version: ${{ needs.check.outputs.version }} - outputs: - version: ${{ env.version }} - strategy: - fail-fast: false - matrix: - include: - - os: windows-latest - target: x86_64-pc-windows-msvc - - - os: windows-latest - target: aarch64-pc-windows-msvc - - - os: ubuntu-latest - target: x86_64-unknown-linux-gnu - - - os: ubuntu-latest - target: x86_64-unknown-linux-musl - - - os: ubuntu-latest - target: aarch64-unknown-linux-gnu - - - os: ubuntu-latest - target: aarch64-unknown-linux-musl - - - os: ubuntu-latest - target: armv7-unknown-linux-gnueabihf - - - os: macos-latest - target: x86_64-apple-darwin - - - os: macos-latest - target: aarch64-apple-darwin - - - os: ubuntu-latest - target: wasm32-wasip1-threads - - name: Package ${{ matrix.target }} - runs-on: ${{ matrix.os }} - steps: - - uses: taiki-e/checkout-action@v1 - - - uses: ./.github/actions/pnpm - - - name: Add Rust Target - run: rustup target add ${{ matrix.target }} - - - uses: goto-bus-stop/setup-zig@v2 - if: ${{ contains(matrix.target, 'musl') }} - with: - version: 0.13.0 - - - name: Build with zig cross - if: ${{ contains(matrix.target, 'musl') }} - run: pnpm build -x --target ${{ matrix.target }} - - - name: Build with napi cross - if: ${{ contains(matrix.target, 'gnu') }} - run: pnpm build --use-napi-cross --target ${{ matrix.target }} - - - name: Build - if: ${{ !contains(matrix.target, 'gnu') && !contains(matrix.target, 'musl') }} - run: pnpm build --target ${{ matrix.target }} - - - name: Test - if: matrix.target == 'x86_64-pc-windows-msvc' || matrix.target == 'aarch64-apple-darwin' || matrix.target == 'wasm32-wasip1-threads' - run: pnpm test - - - name: Output docker params - if: ${{ contains(matrix.target, 'linux') }} - id: docker - run: | - node -e " - if ('${{ matrix.target }}'.startsWith('aarch64')) { - console.log('PLATFORM=linux/arm64') - } else if ('${{ matrix.target }}'.startsWith('armv7')) { - console.log('PLATFORM=linux/arm/v7') - } else { - console.log('PLATFORM=linux/amd64') - } - " >> $GITHUB_OUTPUT - node -e " - if ('${{ matrix.target }}'.endsWith('-musl')) { - console.log('IMAGE=node:lts-alpine') - } else { - console.log('IMAGE=node:lts-slim') - } - " >> $GITHUB_OUTPUT - echo "PNPM_STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_OUTPUT - - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - if: ${{ contains(matrix.target, 'linux') }} - with: - platforms: all - - - run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes - if: ${{ contains(matrix.target, 'linux') }} - - - name: Run linux test - uses: addnab/docker-run-action@v3 - if: ${{ contains(matrix.target, 'linux') }} - with: - image: ${{ steps.docker.outputs.IMAGE }} - options: -v ${{ steps.docker.outputs.PNPM_STORE_PATH }}:${{ steps.docker.outputs.PNPM_STORE_PATH }} -v ${{ github.workspace }}:/oxc_resolver -w /oxc_resolver --platform ${{ steps.docker.outputs.PLATFORM }} - run: | - corepack enable - pnpm test - - - name: Upload artifacts - uses: actions/upload-artifact@v4 - with: - name: bindings-${{ matrix.target }} - path: | - napi/*.node - napi/*.wasm - - build-freebsd: - needs: check - if: needs.check.outputs.version_changed == 'true' - name: Build FreeBSD - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Build - id: build - uses: cross-platform-actions/action@v0.25.0 - env: - DEBUG: napi:* - RUSTUP_IO_THREADS: 1 - with: - operating_system: freebsd - version: '14.0' - memory: 8G - cpu_count: 3 - environment_variables: 'DEBUG RUSTUP_IO_THREADS' - shell: bash - run: | - sudo pkg install -y -f curl node libnghttp2 npm - curl https://sh.rustup.rs -sSf --output rustup.sh - sh rustup.sh -y --profile minimal --default-toolchain stable - source "$HOME/.cargo/env" - echo "~~~~ rustc --version ~~~~" - rustc --version - echo "~~~~ node -v ~~~~" - node -v - pwd - ls -lah - whoami - env - sudo corepack enable - pnpm install - pnpm build --target x86_64-unknown-freebsd - rm -rf node_modules - rm -rf target - - name: Upload artifact - uses: actions/upload-artifact@v4 - with: - name: bindings-freebsd - path: napi/*.node - if-no-files-found: error - - publish: - name: Publish NAPI - runs-on: ubuntu-latest - permissions: - id-token: write # for `npm publish --provenance` - needs: - - build - - build-freebsd - steps: - - uses: taiki-e/checkout-action@v1 - - - name: corepack - run: corepack enable - - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version-file: .node-version - cache: pnpm - - - name: Install dependencies - run: pnpm install --frozen-lockfile - - - name: Download Artifacts - uses: actions/download-artifact@v4 - with: - path: artifacts - - - name: Prepare dirs and artifacts - run: | - pnpm napi create-npm-dirs --package-json-path npm/package.json - pnpm napi artifacts --package-json-path npm/package.json --build-output-dir napi - - - name: Publish npm packages as latest - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - shell: bash - run: | - cp napi/index.js npm/index.js - cp napi/index.d.ts npm/index.d.ts - cp napi/browser.js npm/browser.js - echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc - pnpm napi pre-publish --no-gh-release -t npm --package-json-path npm/package.json - npm publish npm/ --tag latest --provenance --access public diff --git a/.github/workflows/release-plz.yml b/.github/workflows/release-plz.yml deleted file mode 100644 index 121758ad..00000000 --- a/.github/workflows/release-plz.yml +++ /dev/null @@ -1,55 +0,0 @@ -name: Release Plz - -on: - workflow_dispatch: - push: - branches: - - main - -permissions: - pull-requests: write - contents: write - -jobs: - release-plz: - name: Release-plz - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - uses: Boshen/setup-rust@main - with: - save-cache: ${{ github.ref_name == 'main' }} - cache-key: warm - - - name: Run release-plz - id: release-plz - uses: MarcoIeni/release-plz-action@v0.5 - env: - GITHUB_TOKEN: ${{ secrets.RELEASE_PLZ_TOKEN }} - CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} - - - name: Bump package.json - if: ${{ steps.release-plz.outputs.prs_created }} - env: - GH_TOKEN: ${{ github.token }} - RELEASES: ${{ steps.release-plz.outputs.releases }} - PR: ${{ steps.release-plz.outputs.pr }} - run: | - set -e - - pr_number=${{ fromJSON(steps.release-plz.outputs.pr).number }} - if [[ -n "$pr_number" ]]; then - version=$(echo "$RELEASES" | jq -r '.[0].version') - echo "version: $version" - - jq --arg version "${version}" '.version = ($version)' npm/package.json > tmp - mv tmp npm/package.json - - gh pr checkout $pr_number - git add . - git commit -m "Update package.json" - git push - fi diff --git a/Cargo.lock b/Cargo.lock deleted file mode 100644 index 58c1e7ad..00000000 --- a/Cargo.lock +++ /dev/null @@ -1,1326 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "adler" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" - -[[package]] -name = "aho-corasick" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" -dependencies = [ - "memchr", -] - -[[package]] -name = "android-tzdata" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" - -[[package]] -name = "android_system_properties" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" -dependencies = [ - "libc", -] - -[[package]] -name = "anes" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "735d4f398ca57cfa2880225c2bf81c3b9af3be5bb22e44ae70118dad38713e84" - -[[package]] -name = "arca" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f915ddd863ef73f11c10c75170e86db1d4f539689bc6bfb9ce25d6528d6fe83" -dependencies = [ - "clean-path", - "path-slash", - "radix_trie", -] - -[[package]] -name = "autocfg" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" - -[[package]] -name = "base64" -version = "0.22.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" - -[[package]] -name = "bit-set" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1" -dependencies = [ - "bit-vec", -] - -[[package]] -name = "bit-vec" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "bitflags" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" - -[[package]] -name = "bpaf" -version = "0.9.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3280efcf6d66bc77c2cf9b67dc8acee47a217d9be67dd590b3230dffe663724d" - -[[package]] -name = "bumpalo" -version = "3.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" - -[[package]] -name = "byteorder" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" - -[[package]] -name = "cast" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" - -[[package]] -name = "cc" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eaff6f8ce506b9773fa786672d63fc7a191ffea1be33f72bbd4aeacefca9ffc8" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "chrono" -version = "0.4.38" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" -dependencies = [ - "android-tzdata", - "iana-time-zone", - "num-traits", - "serde", - "windows-targets 0.52.6", -] - -[[package]] -name = "ciborium" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42e69ffd6f0917f5c029256a24d0161db17cea3997d185db0d35926308770f0e" -dependencies = [ - "ciborium-io", - "ciborium-ll", - "serde", -] - -[[package]] -name = "ciborium-io" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05afea1e0a06c9be33d539b876f1ce3692f4afea2cb41f740e7743225ed1c757" - -[[package]] -name = "ciborium-ll" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57663b653d948a338bfb3eeba9bb2fd5fcfaecb9e199e87e1eda4d9e8b240fd9" -dependencies = [ - "ciborium-io", - "half", -] - -[[package]] -name = "clean-path" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aaa6b4b263a5d737e9bf6b7c09b72c41a5480aec4d7219af827f6564e950b6a5" - -[[package]] -name = "codspeed" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a104ac948e0188b921eb3fcbdd55dcf62e542df4c7ab7e660623f6288302089" -dependencies = [ - "colored", - "libc", - "serde_json", -] - -[[package]] -name = "colored" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbf2150cce219b664a8a70df7a1f933836724b503f8a413af9365b4dcc4d90b8" -dependencies = [ - "lazy_static", - "windows-sys 0.48.0", -] - -[[package]] -name = "concurrent_lru" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7feb5cb312f774e8a24540e27206db4e890f7d488563671d24a16389cf4c2e4e" -dependencies = [ - "once_cell", -] - -[[package]] -name = "convert_case" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec182b0ca2f35d8fc196cf3404988fd8b8c739a4d270ff118a398feb0cbec1ca" -dependencies = [ - "unicode-segmentation", -] - -[[package]] -name = "core-foundation-sys" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" - -[[package]] -name = "criterion2" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8df39381f28ced0ceebfb5611528d99aef14f8d75b43e9d4ceb6aba66e7b04d" -dependencies = [ - "anes", - "bpaf", - "cast", - "ciborium", - "codspeed", - "colored", - "num-traits", - "oorandom", - "serde", - "serde_json", - "walkdir", -] - -[[package]] -name = "crossbeam-deque" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" -dependencies = [ - "crossbeam-epoch", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.9.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" -dependencies = [ - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" - -[[package]] -name = "crunchy" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" - -[[package]] -name = "ctor" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edb49164822f3ee45b17acd4a208cfc1251410cf0cad9a833234c9890774dd9f" -dependencies = [ - "quote", - "syn", -] - -[[package]] -name = "darling" -version = "0.20.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" -dependencies = [ - "darling_core", - "darling_macro", -] - -[[package]] -name = "darling_core" -version = "0.20.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95133861a8032aaea082871032f5815eb9e98cef03fa916ab4500513994df9e5" -dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "strsim", - "syn", -] - -[[package]] -name = "darling_macro" -version = "0.20.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" -dependencies = [ - "darling_core", - "quote", - "syn", -] - -[[package]] -name = "dashmap" -version = "6.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "804c8821570c3f8b70230c2ba75ffa5c0f9a4189b9a432b6656c536712acae28" -dependencies = [ - "cfg-if", - "crossbeam-utils", - "hashbrown 0.14.5", - "lock_api", - "once_cell", - "parking_lot_core", -] - -[[package]] -name = "deranged" -version = "0.3.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" -dependencies = [ - "powerfmt", - "serde", -] - -[[package]] -name = "document-features" -version = "0.2.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb6969eaabd2421f8a2775cfd2471a2b634372b4a25d41e3bd647b79912850a0" -dependencies = [ - "litrs", -] - -[[package]] -name = "dunce" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" - -[[package]] -name = "either" -version = "1.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" - -[[package]] -name = "endian-type" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" - -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "fancy-regex" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "531e46835a22af56d1e3b66f04844bed63158bc094a628bec1d321d9b4c44bf2" -dependencies = [ - "bit-set", - "regex-automata", - "regex-syntax", -] - -[[package]] -name = "filetime" -version = "0.2.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ee447700ac8aa0b2f2bd7bc4462ad686ba06baa6727ac149a2d6277f0d240fd" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall 0.4.1", - "windows-sys 0.52.0", -] - -[[package]] -name = "fnv" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" - -[[package]] -name = "half" -version = "2.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dd08c532ae367adf81c312a4580bc67f1d0fe8bc9c460520283f4c0ff277888" -dependencies = [ - "cfg-if", - "crunchy", -] - -[[package]] -name = "hashbrown" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" - -[[package]] -name = "hashbrown" -version = "0.14.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "iana-time-zone" -version = "0.1.60" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" -dependencies = [ - "android_system_properties", - "core-foundation-sys", - "iana-time-zone-haiku", - "js-sys", - "wasm-bindgen", - "windows-core", -] - -[[package]] -name = "iana-time-zone-haiku" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" -dependencies = [ - "cc", -] - -[[package]] -name = "ident_case" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" - -[[package]] -name = "indexmap" -version = "1.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" -dependencies = [ - "autocfg", - "hashbrown 0.12.3", - "serde", -] - -[[package]] -name = "indexmap" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93ead53efc7ea8ed3cfb0c79fc8023fbb782a5432b52830b6518941cebe6505c" -dependencies = [ - "equivalent", - "hashbrown 0.14.5", - "serde", -] - -[[package]] -name = "itoa" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" - -[[package]] -name = "js-sys" -version = "0.3.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" -dependencies = [ - "wasm-bindgen", -] - -[[package]] -name = "json-strip-comments" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b271732a960335e715b6b2ae66a086f115c74eb97360e996d2bd809bfc063bba" -dependencies = [ - "memchr", -] - -[[package]] -name = "lazy_static" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" - -[[package]] -name = "libc" -version = "0.2.155" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" - -[[package]] -name = "libloading" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e310b3a6b5907f99202fcdb4960ff45b93735d7c7d96b760fcff8db2dc0e103d" -dependencies = [ - "cfg-if", - "windows-targets 0.52.6", -] - -[[package]] -name = "litrs" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4ce301924b7887e9d637144fdade93f9dfff9b60981d4ac161db09720d39aa5" - -[[package]] -name = "lock_api" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" -dependencies = [ - "autocfg", - "scopeguard", -] - -[[package]] -name = "log" -version = "0.4.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" - -[[package]] -name = "memchr" -version = "2.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" - -[[package]] -name = "miniz_oxide" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" -dependencies = [ - "adler", -] - -[[package]] -name = "napi" -version = "3.0.0-alpha.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ec04344cc540f5897e97c9821ab99e7eb276b4dca6f3e6e441dfa72e5bcde70" -dependencies = [ - "bitflags 2.6.0", - "ctor", - "napi-build", - "napi-sys", - "once_cell", - "serde", - "serde_json", -] - -[[package]] -name = "napi-build" -version = "2.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1c0f5d67ee408a4685b61f5ab7e58605c8ae3f2b4189f0127d804ff13d5560a" - -[[package]] -name = "napi-derive" -version = "3.0.0-alpha.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c6240c4ddca592cde608bbfa26e2af397c3596e413a0c65c9bbcb65c2f1e485" -dependencies = [ - "cfg-if", - "convert_case", - "napi-derive-backend", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "napi-derive-backend" -version = "2.0.0-alpha.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b32dcc50065508fe2f387076c17adbdf10e038d1c080d48b10196813d94ac6a8" -dependencies = [ - "convert_case", - "once_cell", - "proc-macro2", - "quote", - "regex", - "semver", - "syn", -] - -[[package]] -name = "napi-sys" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "427802e8ec3a734331fec1035594a210ce1ff4dc5bc1950530920ab717964ea3" -dependencies = [ - "libloading", -] - -[[package]] -name = "nibble_vec" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" -dependencies = [ - "smallvec", -] - -[[package]] -name = "normalize-path" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5438dd2b2ff4c6df6e1ce22d825ed2fa93ee2922235cc45186991717f0a892d" - -[[package]] -name = "num-conv" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" - -[[package]] -name = "num-traits" -version = "0.2.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" -dependencies = [ - "autocfg", -] - -[[package]] -name = "once_cell" -version = "1.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" - -[[package]] -name = "oorandom" -version = "11.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b410bbe7e14ab526a0e86877eb47c6996a2bd7746f027ba551028c925390e4e9" - -[[package]] -name = "oxc_napi_resolver" -version = "0.0.0" -dependencies = [ - "napi", - "napi-build", - "napi-derive", - "oxc_resolver", - "tracing-subscriber", -] - -[[package]] -name = "oxc_resolver" -version = "1.11.0" -dependencies = [ - "cfg-if", - "criterion2", - "dashmap", - "document-features", - "dunce", - "indexmap 2.4.0", - "json-strip-comments", - "normalize-path", - "once_cell", - "pnp", - "rayon", - "rustc-hash", - "serde", - "serde_json", - "simdutf8", - "thiserror", - "tracing", - "vfs", -] - -[[package]] -name = "parking_lot_core" -version = "0.9.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall 0.5.2", - "smallvec", - "windows-targets 0.52.6", -] - -[[package]] -name = "path-slash" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e91099d4268b0e11973f036e885d652fb0b21fedcf69738c627f94db6a44f42" - -[[package]] -name = "pathdiff" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8835116a5c179084a830efb3adc117ab007512b535bc1a21c991d3b32a6b44dd" - -[[package]] -name = "pin-project-lite" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" - -[[package]] -name = "pnp" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46770cee76a618023fea15411d0449dd066dc232cc17e4562f154da215f27af7" -dependencies = [ - "arca", - "byteorder", - "concurrent_lru", - "fancy-regex", - "lazy_static", - "miniz_oxide", - "pathdiff", - "regex", - "serde", - "serde_json", - "serde_with", - "thiserror", -] - -[[package]] -name = "powerfmt" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" - -[[package]] -name = "proc-macro2" -version = "1.0.86" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.36" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "radix_trie" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" -dependencies = [ - "endian-type", - "nibble_vec", -] - -[[package]] -name = "rayon" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" -dependencies = [ - "either", - "rayon-core", -] - -[[package]] -name = "rayon-core" -version = "1.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" -dependencies = [ - "crossbeam-deque", - "crossbeam-utils", -] - -[[package]] -name = "redox_syscall" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" -dependencies = [ - "bitflags 1.3.2", -] - -[[package]] -name = "redox_syscall" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c82cf8cff14456045f55ec4241383baeff27af886adb72ffb2162f99911de0fd" -dependencies = [ - "bitflags 2.6.0", -] - -[[package]] -name = "regex" -version = "1.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b91213439dad192326a0d7c6ee3955910425f441d7038e0d6933b0aec5c4517f" -dependencies = [ - "aho-corasick", - "memchr", - "regex-automata", - "regex-syntax", -] - -[[package]] -name = "regex-automata" -version = "0.4.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", -] - -[[package]] -name = "regex-syntax" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" - -[[package]] -name = "rustc-hash" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" - -[[package]] -name = "ryu" -version = "1.0.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" - -[[package]] -name = "same-file" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "scopeguard" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" - -[[package]] -name = "semver" -version = "1.0.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" - -[[package]] -name = "serde" -version = "1.0.209" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99fce0ffe7310761ca6bf9faf5115afbc19688edd00171d81b1bb1b116c63e09" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.209" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5831b979fd7b5439637af1752d535ff49f4860c0f341d1baeb6faf0f4242170" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "serde_json" -version = "1.0.127" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8043c06d9f82bd7271361ed64f415fe5e12a77fdb52e573e7f06a516dea329ad" -dependencies = [ - "indexmap 2.4.0", - "itoa", - "memchr", - "ryu", - "serde", -] - -[[package]] -name = "serde_with" -version = "3.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e73139bc5ec2d45e6c5fd85be5a46949c1c39a4c18e56915f5eb4c12f975e377" -dependencies = [ - "base64", - "chrono", - "hex", - "indexmap 1.9.3", - "indexmap 2.4.0", - "serde", - "serde_derive", - "serde_json", - "serde_with_macros", - "time", -] - -[[package]] -name = "serde_with_macros" -version = "3.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b80d3d6b56b64335c0180e5ffde23b3c5e08c14c585b51a15bd0e95393f46703" -dependencies = [ - "darling", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "sharded-slab" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" -dependencies = [ - "lazy_static", -] - -[[package]] -name = "simdutf8" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f27f6278552951f1f2b8cf9da965d10969b2efdea95a6ec47987ab46edfe263a" - -[[package]] -name = "smallvec" -version = "1.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" - -[[package]] -name = "strsim" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" - -[[package]] -name = "syn" -version = "2.0.70" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f0209b68b3613b093e0ec905354eccaedcfe83b8cb37cbdeae64026c3064c16" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "thiserror" -version = "1.0.63" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.63" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "thread_local" -version = "1.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" -dependencies = [ - "cfg-if", - "once_cell", -] - -[[package]] -name = "time" -version = "0.3.36" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" -dependencies = [ - "deranged", - "itoa", - "num-conv", - "powerfmt", - "serde", - "time-core", - "time-macros", -] - -[[package]] -name = "time-core" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" - -[[package]] -name = "time-macros" -version = "0.2.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" -dependencies = [ - "num-conv", - "time-core", -] - -[[package]] -name = "tracing" -version = "0.1.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" -dependencies = [ - "pin-project-lite", - "tracing-attributes", - "tracing-core", -] - -[[package]] -name = "tracing-attributes" -version = "0.1.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "tracing-core" -version = "0.1.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" -dependencies = [ - "once_cell", -] - -[[package]] -name = "tracing-subscriber" -version = "0.3.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" -dependencies = [ - "sharded-slab", - "thread_local", - "tracing-core", -] - -[[package]] -name = "unicode-ident" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" - -[[package]] -name = "unicode-segmentation" -version = "1.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" - -[[package]] -name = "vfs" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "654cd097e182a71dbf899178e6b5662c2157dd0b8afd5975de18008f6fc173d1" -dependencies = [ - "filetime", -] - -[[package]] -name = "walkdir" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" -dependencies = [ - "same-file", - "winapi-util", -] - -[[package]] -name = "wasm-bindgen" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" -dependencies = [ - "cfg-if", - "wasm-bindgen-macro", -] - -[[package]] -name = "wasm-bindgen-backend" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" -dependencies = [ - "bumpalo", - "log", - "once_cell", - "proc-macro2", - "quote", - "syn", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-macro" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" -dependencies = [ - "quote", - "wasm-bindgen-macro-support", -] - -[[package]] -name = "wasm-bindgen-macro-support" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" -dependencies = [ - "proc-macro2", - "quote", - "syn", - "wasm-bindgen-backend", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-shared" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" - -[[package]] -name = "winapi-util" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b" -dependencies = [ - "windows-sys 0.52.0", -] - -[[package]] -name = "windows-core" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" -dependencies = [ - "windows-targets 0.52.6", -] - -[[package]] -name = "windows-sys" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" -dependencies = [ - "windows-targets 0.48.5", -] - -[[package]] -name = "windows-sys" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" -dependencies = [ - "windows-targets 0.52.6", -] - -[[package]] -name = "windows-targets" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" -dependencies = [ - "windows_aarch64_gnullvm 0.48.5", - "windows_aarch64_msvc 0.48.5", - "windows_i686_gnu 0.48.5", - "windows_i686_msvc 0.48.5", - "windows_x86_64_gnu 0.48.5", - "windows_x86_64_gnullvm 0.48.5", - "windows_x86_64_msvc 0.48.5", -] - -[[package]] -name = "windows-targets" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" -dependencies = [ - "windows_aarch64_gnullvm 0.52.6", - "windows_aarch64_msvc 0.52.6", - "windows_i686_gnu 0.52.6", - "windows_i686_gnullvm", - "windows_i686_msvc 0.52.6", - "windows_x86_64_gnu 0.52.6", - "windows_x86_64_gnullvm 0.52.6", - "windows_x86_64_msvc 0.52.6", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" - -[[package]] -name = "windows_i686_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" - -[[package]] -name = "windows_i686_gnu" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" - -[[package]] -name = "windows_i686_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" - -[[package]] -name = "windows_i686_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" - -[[package]] -name = "windows_i686_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" diff --git a/fixtures/enhanced_resolve/lib/index.js b/fixtures/enhanced_resolve/lib/index.js deleted file mode 100644 index 1e872e8f..00000000 --- a/fixtures/enhanced_resolve/lib/index.js +++ /dev/null @@ -1 +0,0 @@ -// mimic enhanced-resolved root directory structure diff --git a/fixtures/enhanced_resolve/package.json b/fixtures/enhanced_resolve/package.json deleted file mode 100644 index d1b845b5..00000000 --- a/fixtures/enhanced_resolve/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "enhanced-resolve", - "main": "lib/index.js" -} diff --git a/fixtures/enhanced_resolve/test/.gitignore b/fixtures/enhanced_resolve/test/.gitignore deleted file mode 100644 index b021b4e4..00000000 --- a/fixtures/enhanced_resolve/test/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -# created by symlink.rs -/temp -/temp_symlinks \ No newline at end of file diff --git a/fixtures/enhanced_resolve/test/fixtures/#/a.js b/fixtures/enhanced_resolve/test/fixtures/#/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/a.js b/fixtures/enhanced_resolve/test/fixtures/a.js deleted file mode 100644 index 896ffc6d..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/abc.txt b/fixtures/enhanced_resolve/test/fixtures/abc.txt deleted file mode 100644 index f2ba8f84..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/abc.txt +++ /dev/null @@ -1 +0,0 @@ -abc \ No newline at end of file diff --git a/fixtures/enhanced_resolve/test/fixtures/alias/files/a.js b/fixtures/enhanced_resolve/test/fixtures/alias/files/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/b.js b/fixtures/enhanced_resolve/test/fixtures/b.js deleted file mode 100644 index 11476340..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/b.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function b() { - return "This is b"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/browser/module-a.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/browser/module-a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/browser.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/ignore.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/ignore.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/replaced.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/replaced.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/self.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/self.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/toString.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/toString.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-a.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-b.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-c.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-c.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/a.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/b.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/c.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/c.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/d.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/d.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json deleted file mode 100644 index c13fe23b..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "browser": { - "a.js": "./a", - "./b.js": "./b", - "c.js": "./d.js", - "./d.js": "./c.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/package.json b/fixtures/enhanced_resolve/test/fixtures/browser-module/package.json deleted file mode 100644 index 19ff7739..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/browser-module/package.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "exports": { - "./lib/index.js": "./lib/index.js" - }, - "browser": { - "./lib/ignore.js": false, - "./lib/replaced.js": "./lib/browser", - "module-a": "./browser/module-a.js", - "module-b": "module-c", - "module-c": "module-c", - "./toString": "./lib/toString.js", - "./lib/main.js": "./lib/main.js", - "./main.js": "./lib/main.js", - "./lib/xyz.js": "./xyz.js", - "./xyz.js": "./lib/xyz.js", - "./lib/non-existent.js": "./lib/non-existent.js", - ".": false, - "./number": 1, - "./foo": "./lib/replaced.js?query" - }, - "innerBrowser1": { - "field": { - "browser": { - "./lib/main1.js": "./lib/main.js" - } - } - }, - "innerBrowser2": { - "browser": { - "./lib/main2.js": "./lib/replaced.js" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/builtins/package.json b/fixtures/enhanced_resolve/test/fixtures/builtins/package.json deleted file mode 100644 index 4a54ea96..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/builtins/package.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "name": "builtins", - "private": true, - "imports": { - "#fs": { - "default": "fs" - }, - "#http": { - "node": "node:http" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/c.js b/fixtures/enhanced_resolve/test/fixtures/c.js deleted file mode 100644 index e3aca8aa..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/c.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = function b() { - require("./a"); - return "This is c"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/complex.js b/fixtures/enhanced_resolve/test/fixtures/complex.js deleted file mode 100644 index 1f62db84..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/complex.js +++ /dev/null @@ -1,13 +0,0 @@ -var 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); diff --git a/fixtures/enhanced_resolve/test/fixtures/crypto-js/index.js b/fixtures/enhanced_resolve/test/fixtures/crypto-js/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json b/fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json deleted file mode 100644 index 1d31aa8b..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "crypto-js", - "main": "index.js", - "browser": { - "crypto": false - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/decorated-fs/exists.js b/fixtures/enhanced_resolve/test/fixtures/decorated-fs/exists.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/dirOrFile.js b/fixtures/enhanced_resolve/test/fixtures/dirOrFile.js deleted file mode 100644 index c3cb885f..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/dirOrFile.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "file"; diff --git a/fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js b/fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js deleted file mode 100644 index 85e01cd4..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "dir"; diff --git a/fixtures/enhanced_resolve/test/fixtures/directory-default/directory-default.js b/fixtures/enhanced_resolve/test/fixtures/directory-default/directory-default.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js deleted file mode 100644 index d1007aae..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js +++ /dev/null @@ -1 +0,0 @@ -export default "string"; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts deleted file mode 100644 index cb0ff5c3..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json deleted file mode 100644 index b523a1e9..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "@org/pkg", - "exports": { - "./*.js": { - "types": "./dist/*.d.ts", - "default": "./dist/*.js" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js deleted file mode 100644 index d1007aae..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js +++ /dev/null @@ -1 +0,0 @@ -export default "string"; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts deleted file mode 100644 index cb0ff5c3..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json deleted file mode 100644 index 8e55fb46..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "@raviqqe/hidash", - "exports": { - "./*.js": { - "types": "./dist/*.d.ts", - "default": "./dist/*.js" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json deleted file mode 100644 index f0edf449..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "exports-field", - "version": "1.0.0", - "exports": { - ".": "./a/../b/../../pack1/index.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/pack1/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/pack1/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/a.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/a.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json deleted file mode 100644 index 6b105c08..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "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/": { - "webpack": ["./lib/lib2/", "./lib/"], - "node": "./lib/", - "default": "./lib/" - }, - "./dist/a.js": "./../../a.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json deleted file mode 100644 index 0012a3de..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "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" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/umd.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/umd.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field/package.json deleted file mode 100644 index 5fa72bb5..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "@exports-field/core", - "version": "1.0.0", - "exports": "./a.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json deleted file mode 100644 index e6f12074..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "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/lib2/", "./lib/"], - "node": "./lib/", - "default": "./lib/" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/index b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/index deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json deleted file mode 100644 index 1a838f49..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "name": "exports-field", - "exportsField": { - "exports": "./main.js" - }, - "ex": "./index", - "broken": { - ".": "./src" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/src/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/src/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.ts b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.mts b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.mts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mjs b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mjs deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mts.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mts.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.ts b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/app.module.js b/fixtures/enhanced_resolve/test/fixtures/extensions/app.module.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.js b/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/foo.js b/fixtures/enhanced_resolve/test/fixtures/extensions/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/foo.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/foo.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/index.js b/fixtures/enhanced_resolve/test/fixtures/extensions/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/index.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module.js b/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module/index.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/package.json b/fixtures/enhanced_resolve/test/fixtures/extensions/package.json deleted file mode 100644 index 5e55a1e8..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/extensions/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "./index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/file.load1 b/fixtures/enhanced_resolve/test/fixtures/file.load1 deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/file.load2 b/fixtures/enhanced_resolve/test/fixtures/file.load2 deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/foo/index.js b/fixtures/enhanced_resolve/test/fixtures/foo/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/foo/package.json b/fixtures/enhanced_resolve/test/fixtures/foo/package.json deleted file mode 100644 index da86787a..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/foo/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "foo", - "version": "1.0.0" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json deleted file mode 100644 index aa2be496..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "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" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/internal/file.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/internal/file.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/y/y.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/y/y.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/internal/i.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/internal/i.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/nested/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js deleted file mode 100644 index e5b70a86..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = { nested: "nested" } diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-3/nested/f/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-3/nested/f/nested/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-4/f/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-4/f/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f$/$.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f$/$.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f/$.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f/$.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/nested/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/a.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/a.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/b.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/dir/b.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/dir/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/index.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json deleted file mode 100644 index 8d8d3a46..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "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/lib2/", "./lib/"], - "node": "./lib/", - "default": "./lib/" - }, - "./dist/a.js": "./../../a.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/c/index.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/c/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/imports-field/package.json deleted file mode 100644 index 248351a9..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "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" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/a.js b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json deleted file mode 100644 index ded7faa2..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json +++ /dev/null @@ -1,2 +0,0 @@ -{ - "main": "./a.js", diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/a.js b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/package.json b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/package.json deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/issue-238/package.json b/fixtures/enhanced_resolve/test/fixtures/issue-238/package.json deleted file mode 100644 index 352055cd..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/issue-238/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "private": true -} diff --git a/fixtures/enhanced_resolve/test/fixtures/issue-238/src/a/config.js b/fixtures/enhanced_resolve/test/fixtures/issue-238/src/a/config.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/issue-238/src/common/config/myObjectFile.js b/fixtures/enhanced_resolve/test/fixtures/issue-238/src/common/config/myObjectFile.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/lib.js b/fixtures/enhanced_resolve/test/fixtures/lib.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/lib/complex1.js b/fixtures/enhanced_resolve/test/fixtures/lib/complex1.js deleted file mode 100644 index b3de3d70..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/lib/complex1.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "lib complex1"; diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self/index.js b/fixtures/enhanced_resolve/test/fixtures/main-field-self/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json b/fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json deleted file mode 100644 index a2b6f341..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "./" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self2/index.js b/fixtures/enhanced_resolve/test/fixtures/main-field-self2/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json b/fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json deleted file mode 100644 index 4fa6f730..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "." -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main1.js b/fixtures/enhanced_resolve/test/fixtures/main1.js deleted file mode 100644 index 168f2a1e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main1.js +++ /dev/null @@ -1,9 +0,0 @@ -var a = require("./a"); -if (x) { - for (var i = 0; i < 100; i++) { - while (true) require("./b"); - do { - i++; - } while (require("m1/a")()); - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main2.js b/fixtures/enhanced_resolve/test/fixtures/main2.js deleted file mode 100644 index 39f062b1..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main2.js +++ /dev/null @@ -1,12 +0,0 @@ -var 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"); - }); - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main3.js b/fixtures/enhanced_resolve/test/fixtures/main3.js deleted file mode 100644 index 1c180166..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main3.js +++ /dev/null @@ -1,4 +0,0 @@ -var a = require("./a"); -require.ensure([], function(require) { - require("./c.js"); -}); diff --git a/fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js b/fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js deleted file mode 100644 index 997c1051..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is nested m1/a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/no#fragment/#/#.js b/fixtures/enhanced_resolve/test/fixtures/no#fragment/#/#.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/no.js b/fixtures/enhanced_resolve/test/fixtures/no.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/browser.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/browser.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/main.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json deleted file mode 100644 index c469e1fd..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "main": "./main.js", - "browser": "./browser.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js deleted file mode 100644 index 549620a5..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "the correct a.js"; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js deleted file mode 100644 index 5db6632e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = " :) " + require("m2/b.js"); diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js deleted file mode 100644 index d308569d..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require("m1/a") + require("m1"); diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js deleted file mode 100644 index cb8127e8..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "Step2"; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json deleted file mode 100644 index 8d6dfa56..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "dash-name", - "exports": "./index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json deleted file mode 100644 index 4fd8706e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "dash", - "exports": "./index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/invalidPackageJson/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/invalidPackageJson/package.json deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js deleted file mode 100644 index 46fc8e6c..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is m1/a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js deleted file mode 100644 index 8565c244..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is m1/b"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js deleted file mode 100644 index 34faaaf5..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "This is m2/b"; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/file.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/file.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js b/fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js deleted file mode 100644 index 997c1051..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is nested m1/a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/dir/index.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/dir/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/index.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/main.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/browser.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/browser.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/index.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json deleted file mode 100644 index e20ceaeb..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "main": "main.js", - "browser": { - "./package-alias/index.js": "./package-alias/browser.js", - "module": "pkg/dir/index" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/typescript/index.ts b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/typescript/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json deleted file mode 100644 index 4a1f838e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "@exports-field/core", - "version": "1.0.0", - "exports": { - ".": "./a.js", - "./x": "./a.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/prefer-pnp/alternative-modules/m1/b.js b/fixtures/enhanced_resolve/test/fixtures/prefer-pnp/alternative-modules/m1/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.css b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.css deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.js b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json deleted file mode 100644 index 14ab704d..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/index.css b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/index.css deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/module.js b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/module.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json deleted file mode 100644 index ee0eb71b..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "main": "../../../c.js", - "module": "module.js", - "style": "index.css" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/roots_fall_through/index.js b/fixtures/enhanced_resolve/test/fixtures/roots_fall_through/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/main.js b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json deleted file mode 100644 index 70a0f20f..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "browser": { - "./index.js": "./main.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/lib/index.js b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/lib/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/main.js b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json deleted file mode 100644 index 2af9e0d1..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "./main.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/shortcutdir.js/a.js b/fixtures/enhanced_resolve/test/fixtures/shortcutdir.js/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/b b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/b deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/c b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/c deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/a b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/a deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/b b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/b deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/b/foo/a b/fixtures/enhanced_resolve/test/fixtures/yield/b/foo/a deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/a b/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/a deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json b/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json deleted file mode 100644 index 0acc4b4c..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "foo", - "version": "1.0.0", - "browser": { - "./a": false - } -} diff --git "a/fixtures/enhanced_resolve/test/fixtures/\346\265\213\350\257\225.js" "b/fixtures/enhanced_resolve/test/fixtures/\346\265\213\350\257\225.js" deleted file mode 100644 index e69de29b..00000000 diff --git "a/fixtures/misc/\344\270\255\346\226\207/\344\270\255\346\226\207.js" "b/fixtures/misc/\344\270\255\346\226\207/\344\270\255\346\226\207.js" deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/pnp/.gitignore b/fixtures/pnp/.gitignore deleted file mode 100644 index 1783c71a..00000000 --- a/fixtures/pnp/.gitignore +++ /dev/null @@ -1 +0,0 @@ -install_state.gz \ No newline at end of file diff --git a/fixtures/pnp/.pnp.cjs b/fixtures/pnp/.pnp.cjs deleted file mode 100755 index 2a8d1771..00000000 --- a/fixtures/pnp/.pnp.cjs +++ /dev/null @@ -1,7543 +0,0 @@ -#!/usr/bin/env node -/* eslint-disable */ -// @ts-nocheck -"use strict"; - -const RAW_RUNTIME_STATE = -'{\ - "__info": [\ - "This file is automatically generated. Do not touch it, or risk",\ - "your modifications being lost."\ - ],\ - "dependencyTreeRoots": [\ - {\ - "name": "pnp",\ - "reference": "workspace:."\ - }\ - ],\ - "enableTopLevelFallback": true,\ - "ignorePatternData": "(^(?:\\\\.yarn\\\\/sdks(?:\\\\/(?!\\\\.{1,2}(?:\\\\/|$))(?:(?:(?!(?:^|\\\\/)\\\\.{1,2}(?:\\\\/|$)).)*?)|$))$)",\ - "fallbackExclusionList": [\ - ["pnp", ["workspace:."]]\ - ],\ - "fallbackPool": [\ - ],\ - "packageRegistryData": [\ - [null, [\ - [null, {\ - "packageLocation": "./",\ - "packageDependencies": [\ - ["is-even", "npm:1.0.0"],\ - ["is-odd", "npm:3.0.1"]\ - ],\ - "linkType": "SOFT"\ - }]\ - ]],\ - ["is-buffer", [\ - ["npm:1.1.6", {\ - "packageLocation": "./.yarn/cache/is-buffer-npm-1.1.6-08199d9ccc-ae18aa0b6e.zip/node_modules/is-buffer/",\ - "packageDependencies": [\ - ["is-buffer", "npm:1.1.6"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["is-even", [\ - ["npm:1.0.0", {\ - "packageLocation": "./.yarn/cache/is-even-npm-1.0.0-9f726520dc-2728cc2f39.zip/node_modules/is-even/",\ - "packageDependencies": [\ - ["is-even", "npm:1.0.0"],\ - ["is-odd", "npm:0.1.2"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["is-number", [\ - ["npm:3.0.0", {\ - "packageLocation": "./.yarn/cache/is-number-npm-3.0.0-9088035ade-e639c54640.zip/node_modules/is-number/",\ - "packageDependencies": [\ - ["is-number", "npm:3.0.0"],\ - ["kind-of", "npm:3.2.2"]\ - ],\ - "linkType": "HARD"\ - }],\ - ["npm:6.0.0", {\ - "packageLocation": "./.yarn/cache/is-number-npm-6.0.0-30881e83e6-5da4c68401.zip/node_modules/is-number/",\ - "packageDependencies": [\ - ["is-number", "npm:6.0.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["is-odd", [\ - ["npm:0.1.2", {\ - "packageLocation": "./.yarn/cache/is-odd-npm-0.1.2-9d980a9da8-7dc6c6fd00.zip/node_modules/is-odd/",\ - "packageDependencies": [\ - ["is-odd", "npm:0.1.2"],\ - ["is-number", "npm:3.0.0"]\ - ],\ - "linkType": "HARD"\ - }],\ - ["npm:3.0.1", {\ - "packageLocation": "./.yarn/cache/is-odd-npm-3.0.1-93c3c3f41b-89ee2e353c.zip/node_modules/is-odd/",\ - "packageDependencies": [\ - ["is-odd", "npm:3.0.1"],\ - ["is-number", "npm:6.0.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["kind-of", [\ - ["npm:3.2.2", {\ - "packageLocation": "./.yarn/cache/kind-of-npm-3.2.2-7deaffa5f9-7e34bc29d4.zip/node_modules/kind-of/",\ - "packageDependencies": [\ - ["kind-of", "npm:3.2.2"],\ - ["is-buffer", "npm:1.1.6"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["pnp", [\ - ["workspace:.", {\ - "packageLocation": "./",\ - "packageDependencies": [\ - ["pnp", "workspace:."],\ - ["is-even", "npm:1.0.0"],\ - ["is-odd", "npm:3.0.1"]\ - ],\ - "linkType": "SOFT"\ - }]\ - ]]\ - ]\ -}'; - -function $$SETUP_STATE(hydrateRuntimeState, basePath) { - return hydrateRuntimeState(JSON.parse(RAW_RUNTIME_STATE), {basePath: basePath || __dirname}); -} - -const fs = require('fs'); -const path = require('path'); -const crypto = require('crypto'); -const os = require('os'); -const events = require('events'); -const nodeUtils = require('util'); -const stream = require('stream'); -const zlib = require('zlib'); -const require$$0 = require('module'); -const StringDecoder = require('string_decoder'); -const url = require('url'); -const buffer = require('buffer'); -const readline = require('readline'); -const assert = require('assert'); - -const _interopDefaultLegacy = e => e && typeof e === 'object' && 'default' in e ? e : { default: e }; - -function _interopNamespace(e) { - if (e && e.__esModule) return e; - const n = Object.create(null); - if (e) { - for (const k in e) { - if (k !== 'default') { - const d = Object.getOwnPropertyDescriptor(e, k); - Object.defineProperty(n, k, d.get ? d : { - enumerable: true, - get: () => e[k] - }); - } - } - } - n.default = e; - return Object.freeze(n); -} - -const fs__default = /*#__PURE__*/_interopDefaultLegacy(fs); -const path__default = /*#__PURE__*/_interopDefaultLegacy(path); -const nodeUtils__namespace = /*#__PURE__*/_interopNamespace(nodeUtils); -const zlib__default = /*#__PURE__*/_interopDefaultLegacy(zlib); -const require$$0__default = /*#__PURE__*/_interopDefaultLegacy(require$$0); -const StringDecoder__default = /*#__PURE__*/_interopDefaultLegacy(StringDecoder); -const buffer__default = /*#__PURE__*/_interopDefaultLegacy(buffer); -const assert__default = /*#__PURE__*/_interopDefaultLegacy(assert); - -const S_IFMT = 61440; -const S_IFDIR = 16384; -const S_IFREG = 32768; -const S_IFLNK = 40960; -const SAFE_TIME = 456789e3; - -function makeError$1(code, message) { - return Object.assign(new Error(`${code}: ${message}`), { code }); -} -function EBUSY(message) { - return makeError$1(`EBUSY`, message); -} -function ENOSYS(message, reason) { - return makeError$1(`ENOSYS`, `${message}, ${reason}`); -} -function EINVAL(reason) { - return makeError$1(`EINVAL`, `invalid argument, ${reason}`); -} -function EBADF(reason) { - return makeError$1(`EBADF`, `bad file descriptor, ${reason}`); -} -function ENOENT(reason) { - return makeError$1(`ENOENT`, `no such file or directory, ${reason}`); -} -function ENOTDIR(reason) { - return makeError$1(`ENOTDIR`, `not a directory, ${reason}`); -} -function EISDIR(reason) { - return makeError$1(`EISDIR`, `illegal operation on a directory, ${reason}`); -} -function EEXIST(reason) { - return makeError$1(`EEXIST`, `file already exists, ${reason}`); -} -function EROFS(reason) { - return makeError$1(`EROFS`, `read-only filesystem, ${reason}`); -} -function ENOTEMPTY(reason) { - return makeError$1(`ENOTEMPTY`, `directory not empty, ${reason}`); -} -function EOPNOTSUPP(reason) { - return makeError$1(`EOPNOTSUPP`, `operation not supported, ${reason}`); -} -function ERR_DIR_CLOSED() { - return makeError$1(`ERR_DIR_CLOSED`, `Directory handle was closed`); -} - -const DEFAULT_MODE = S_IFREG | 420; -class StatEntry { - constructor() { - this.uid = 0; - this.gid = 0; - this.size = 0; - this.blksize = 0; - this.atimeMs = 0; - this.mtimeMs = 0; - this.ctimeMs = 0; - this.birthtimeMs = 0; - this.atime = new Date(0); - this.mtime = new Date(0); - this.ctime = new Date(0); - this.birthtime = new Date(0); - this.dev = 0; - this.ino = 0; - this.mode = DEFAULT_MODE; - this.nlink = 1; - this.rdev = 0; - this.blocks = 1; - } - isBlockDevice() { - return false; - } - isCharacterDevice() { - return false; - } - isDirectory() { - return (this.mode & S_IFMT) === S_IFDIR; - } - isFIFO() { - return false; - } - isFile() { - return (this.mode & S_IFMT) === S_IFREG; - } - isSocket() { - return false; - } - isSymbolicLink() { - return (this.mode & S_IFMT) === S_IFLNK; - } -} -class BigIntStatsEntry { - constructor() { - this.uid = BigInt(0); - this.gid = BigInt(0); - this.size = BigInt(0); - this.blksize = BigInt(0); - this.atimeMs = BigInt(0); - this.mtimeMs = BigInt(0); - this.ctimeMs = BigInt(0); - this.birthtimeMs = BigInt(0); - this.atimeNs = BigInt(0); - this.mtimeNs = BigInt(0); - this.ctimeNs = BigInt(0); - this.birthtimeNs = BigInt(0); - this.atime = new Date(0); - this.mtime = new Date(0); - this.ctime = new Date(0); - this.birthtime = new Date(0); - this.dev = BigInt(0); - this.ino = BigInt(0); - this.mode = BigInt(DEFAULT_MODE); - this.nlink = BigInt(1); - this.rdev = BigInt(0); - this.blocks = BigInt(1); - } - isBlockDevice() { - return false; - } - isCharacterDevice() { - return false; - } - isDirectory() { - return (this.mode & BigInt(S_IFMT)) === BigInt(S_IFDIR); - } - isFIFO() { - return false; - } - isFile() { - return (this.mode & BigInt(S_IFMT)) === BigInt(S_IFREG); - } - isSocket() { - return false; - } - isSymbolicLink() { - return (this.mode & BigInt(S_IFMT)) === BigInt(S_IFLNK); - } -} -function makeDefaultStats() { - return new StatEntry(); -} -function clearStats(stats) { - for (const key in stats) { - if (Object.hasOwn(stats, key)) { - const element = stats[key]; - if (typeof element === `number`) { - stats[key] = 0; - } else if (typeof element === `bigint`) { - stats[key] = BigInt(0); - } else if (nodeUtils__namespace.types.isDate(element)) { - stats[key] = new Date(0); - } - } - } - return stats; -} -function convertToBigIntStats(stats) { - const bigintStats = new BigIntStatsEntry(); - for (const key in stats) { - if (Object.hasOwn(stats, key)) { - const element = stats[key]; - if (typeof element === `number`) { - bigintStats[key] = BigInt(element); - } else if (nodeUtils__namespace.types.isDate(element)) { - bigintStats[key] = new Date(element); - } - } - } - bigintStats.atimeNs = bigintStats.atimeMs * BigInt(1e6); - bigintStats.mtimeNs = bigintStats.mtimeMs * BigInt(1e6); - bigintStats.ctimeNs = bigintStats.ctimeMs * BigInt(1e6); - bigintStats.birthtimeNs = bigintStats.birthtimeMs * BigInt(1e6); - return bigintStats; -} -function areStatsEqual(a, b) { - if (a.atimeMs !== b.atimeMs) - return false; - if (a.birthtimeMs !== b.birthtimeMs) - return false; - if (a.blksize !== b.blksize) - return false; - if (a.blocks !== b.blocks) - return false; - if (a.ctimeMs !== b.ctimeMs) - return false; - if (a.dev !== b.dev) - return false; - if (a.gid !== b.gid) - return false; - if (a.ino !== b.ino) - return false; - if (a.isBlockDevice() !== b.isBlockDevice()) - return false; - if (a.isCharacterDevice() !== b.isCharacterDevice()) - return false; - if (a.isDirectory() !== b.isDirectory()) - return false; - if (a.isFIFO() !== b.isFIFO()) - return false; - if (a.isFile() !== b.isFile()) - return false; - if (a.isSocket() !== b.isSocket()) - return false; - if (a.isSymbolicLink() !== b.isSymbolicLink()) - return false; - if (a.mode !== b.mode) - return false; - if (a.mtimeMs !== b.mtimeMs) - return false; - if (a.nlink !== b.nlink) - return false; - if (a.rdev !== b.rdev) - return false; - if (a.size !== b.size) - return false; - if (a.uid !== b.uid) - return false; - const aN = a; - const bN = b; - if (aN.atimeNs !== bN.atimeNs) - return false; - if (aN.mtimeNs !== bN.mtimeNs) - return false; - if (aN.ctimeNs !== bN.ctimeNs) - return false; - if (aN.birthtimeNs !== bN.birthtimeNs) - return false; - return true; -} - -const PortablePath = { - root: `/`, - dot: `.`, - parent: `..` -}; -const Filename = { - home: `~`, - nodeModules: `node_modules`, - manifest: `package.json`, - lockfile: `yarn.lock`, - virtual: `__virtual__`, - pnpJs: `.pnp.js`, - pnpCjs: `.pnp.cjs`, - pnpData: `.pnp.data.json`, - pnpEsmLoader: `.pnp.loader.mjs`, - rc: `.yarnrc.yml`, - env: `.env` -}; -const npath = Object.create(path__default.default); -const ppath = Object.create(path__default.default.posix); -npath.cwd = () => process.cwd(); -ppath.cwd = process.platform === `win32` ? () => toPortablePath(process.cwd()) : process.cwd; -if (process.platform === `win32`) { - ppath.resolve = (...segments) => { - if (segments.length > 0 && ppath.isAbsolute(segments[0])) { - return path__default.default.posix.resolve(...segments); - } else { - return path__default.default.posix.resolve(ppath.cwd(), ...segments); - } - }; -} -const contains = function(pathUtils, from, to) { - from = pathUtils.normalize(from); - to = pathUtils.normalize(to); - if (from === to) - return `.`; - if (!from.endsWith(pathUtils.sep)) - from = from + pathUtils.sep; - if (to.startsWith(from)) { - return to.slice(from.length); - } else { - return null; - } -}; -npath.contains = (from, to) => contains(npath, from, to); -ppath.contains = (from, to) => contains(ppath, from, to); -const WINDOWS_PATH_REGEXP = /^([a-zA-Z]:.*)$/; -const UNC_WINDOWS_PATH_REGEXP = /^\/\/(\.\/)?(.*)$/; -const PORTABLE_PATH_REGEXP = /^\/([a-zA-Z]:.*)$/; -const UNC_PORTABLE_PATH_REGEXP = /^\/unc\/(\.dot\/)?(.*)$/; -function fromPortablePathWin32(p) { - let portablePathMatch, uncPortablePathMatch; - if (portablePathMatch = p.match(PORTABLE_PATH_REGEXP)) - p = portablePathMatch[1]; - else if (uncPortablePathMatch = p.match(UNC_PORTABLE_PATH_REGEXP)) - p = `\\\\${uncPortablePathMatch[1] ? `.\\` : ``}${uncPortablePathMatch[2]}`; - else - return p; - return p.replace(/\//g, `\\`); -} -function toPortablePathWin32(p) { - p = p.replace(/\\/g, `/`); - let windowsPathMatch, uncWindowsPathMatch; - if (windowsPathMatch = p.match(WINDOWS_PATH_REGEXP)) - p = `/${windowsPathMatch[1]}`; - else if (uncWindowsPathMatch = p.match(UNC_WINDOWS_PATH_REGEXP)) - p = `/unc/${uncWindowsPathMatch[1] ? `.dot/` : ``}${uncWindowsPathMatch[2]}`; - return p; -} -const toPortablePath = process.platform === `win32` ? toPortablePathWin32 : (p) => p; -const fromPortablePath = process.platform === `win32` ? fromPortablePathWin32 : (p) => p; -npath.fromPortablePath = fromPortablePath; -npath.toPortablePath = toPortablePath; -function convertPath(targetPathUtils, sourcePath) { - return targetPathUtils === npath ? fromPortablePath(sourcePath) : toPortablePath(sourcePath); -} - -const defaultTime = new Date(SAFE_TIME * 1e3); -const defaultTimeMs = defaultTime.getTime(); -async function copyPromise(destinationFs, destination, sourceFs, source, opts) { - const normalizedDestination = destinationFs.pathUtils.normalize(destination); - const normalizedSource = sourceFs.pathUtils.normalize(source); - const prelayout = []; - const postlayout = []; - const { atime, mtime } = opts.stableTime ? { atime: defaultTime, mtime: defaultTime } : await sourceFs.lstatPromise(normalizedSource); - await destinationFs.mkdirpPromise(destinationFs.pathUtils.dirname(destination), { utimes: [atime, mtime] }); - await copyImpl(prelayout, postlayout, destinationFs, normalizedDestination, sourceFs, normalizedSource, { ...opts, didParentExist: true }); - for (const operation of prelayout) - await operation(); - await Promise.all(postlayout.map((operation) => { - return operation(); - })); -} -async function copyImpl(prelayout, postlayout, destinationFs, destination, sourceFs, source, opts) { - const destinationStat = opts.didParentExist ? await maybeLStat(destinationFs, destination) : null; - const sourceStat = await sourceFs.lstatPromise(source); - const { atime, mtime } = opts.stableTime ? { atime: defaultTime, mtime: defaultTime } : sourceStat; - let updated; - switch (true) { - case sourceStat.isDirectory(): - { - updated = await copyFolder(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts); - } - break; - case sourceStat.isFile(): - { - updated = await copyFile(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts); - } - break; - case sourceStat.isSymbolicLink(): - { - updated = await copySymlink(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts); - } - break; - default: { - throw new Error(`Unsupported file type (${sourceStat.mode})`); - } - } - if (opts.linkStrategy?.type !== `HardlinkFromIndex` || !sourceStat.isFile()) { - if (updated || destinationStat?.mtime?.getTime() !== mtime.getTime() || destinationStat?.atime?.getTime() !== atime.getTime()) { - postlayout.push(() => destinationFs.lutimesPromise(destination, atime, mtime)); - updated = true; - } - if (destinationStat === null || (destinationStat.mode & 511) !== (sourceStat.mode & 511)) { - postlayout.push(() => destinationFs.chmodPromise(destination, sourceStat.mode & 511)); - updated = true; - } - } - return updated; -} -async function maybeLStat(baseFs, p) { - try { - return await baseFs.lstatPromise(p); - } catch (e) { - return null; - } -} -async function copyFolder(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts) { - if (destinationStat !== null && !destinationStat.isDirectory()) { - if (opts.overwrite) { - prelayout.push(async () => destinationFs.removePromise(destination)); - destinationStat = null; - } else { - return false; - } - } - let updated = false; - if (destinationStat === null) { - prelayout.push(async () => { - try { - await destinationFs.mkdirPromise(destination, { mode: sourceStat.mode }); - } catch (err) { - if (err.code !== `EEXIST`) { - throw err; - } - } - }); - updated = true; - } - const entries = await sourceFs.readdirPromise(source); - const nextOpts = opts.didParentExist && !destinationStat ? { ...opts, didParentExist: false } : opts; - if (opts.stableSort) { - for (const entry of entries.sort()) { - if (await copyImpl(prelayout, postlayout, destinationFs, destinationFs.pathUtils.join(destination, entry), sourceFs, sourceFs.pathUtils.join(source, entry), nextOpts)) { - updated = true; - } - } - } else { - const entriesUpdateStatus = await Promise.all(entries.map(async (entry) => { - await copyImpl(prelayout, postlayout, destinationFs, destinationFs.pathUtils.join(destination, entry), sourceFs, sourceFs.pathUtils.join(source, entry), nextOpts); - })); - if (entriesUpdateStatus.some((status) => status)) { - updated = true; - } - } - return updated; -} -async function copyFileViaIndex(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts, linkStrategy) { - const sourceHash = await sourceFs.checksumFilePromise(source, { algorithm: `sha1` }); - const defaultMode = 420; - const sourceMode = sourceStat.mode & 511; - const indexFileName = `${sourceHash}${sourceMode !== defaultMode ? sourceMode.toString(8) : ``}`; - const indexPath = destinationFs.pathUtils.join(linkStrategy.indexPath, sourceHash.slice(0, 2), `${indexFileName}.dat`); - let AtomicBehavior; - ((AtomicBehavior2) => { - AtomicBehavior2[AtomicBehavior2["Lock"] = 0] = "Lock"; - AtomicBehavior2[AtomicBehavior2["Rename"] = 1] = "Rename"; - })(AtomicBehavior || (AtomicBehavior = {})); - let atomicBehavior = 1 /* Rename */; - let indexStat = await maybeLStat(destinationFs, indexPath); - if (destinationStat) { - const isDestinationHardlinkedFromIndex = indexStat && destinationStat.dev === indexStat.dev && destinationStat.ino === indexStat.ino; - const isIndexModified = indexStat?.mtimeMs !== defaultTimeMs; - if (isDestinationHardlinkedFromIndex) { - if (isIndexModified && linkStrategy.autoRepair) { - atomicBehavior = 0 /* Lock */; - indexStat = null; - } - } - if (!isDestinationHardlinkedFromIndex) { - if (opts.overwrite) { - prelayout.push(async () => destinationFs.removePromise(destination)); - destinationStat = null; - } else { - return false; - } - } - } - const tempPath = !indexStat && atomicBehavior === 1 /* Rename */ ? `${indexPath}.${Math.floor(Math.random() * 4294967296).toString(16).padStart(8, `0`)}` : null; - let tempPathCleaned = false; - prelayout.push(async () => { - if (!indexStat) { - if (atomicBehavior === 0 /* Lock */) { - await destinationFs.lockPromise(indexPath, async () => { - const content = await sourceFs.readFilePromise(source); - await destinationFs.writeFilePromise(indexPath, content); - }); - } - if (atomicBehavior === 1 /* Rename */ && tempPath) { - const content = await sourceFs.readFilePromise(source); - await destinationFs.writeFilePromise(tempPath, content); - try { - await destinationFs.linkPromise(tempPath, indexPath); - } catch (err) { - if (err.code === `EEXIST`) { - tempPathCleaned = true; - await destinationFs.unlinkPromise(tempPath); - } else { - throw err; - } - } - } - } - if (!destinationStat) { - await destinationFs.linkPromise(indexPath, destination); - } - }); - postlayout.push(async () => { - if (!indexStat) { - await destinationFs.lutimesPromise(indexPath, defaultTime, defaultTime); - if (sourceMode !== defaultMode) { - await destinationFs.chmodPromise(indexPath, sourceMode); - } - } - if (tempPath && !tempPathCleaned) { - await destinationFs.unlinkPromise(tempPath); - } - }); - return false; -} -async function copyFileDirect(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts) { - if (destinationStat !== null) { - if (opts.overwrite) { - prelayout.push(async () => destinationFs.removePromise(destination)); - destinationStat = null; - } else { - return false; - } - } - prelayout.push(async () => { - const content = await sourceFs.readFilePromise(source); - await destinationFs.writeFilePromise(destination, content); - }); - return true; -} -async function copyFile(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts) { - if (opts.linkStrategy?.type === `HardlinkFromIndex`) { - return copyFileViaIndex(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts, opts.linkStrategy); - } else { - return copyFileDirect(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts); - } -} -async function copySymlink(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts) { - if (destinationStat !== null) { - if (opts.overwrite) { - prelayout.push(async () => destinationFs.removePromise(destination)); - destinationStat = null; - } else { - return false; - } - } - prelayout.push(async () => { - await destinationFs.symlinkPromise(convertPath(destinationFs.pathUtils, await sourceFs.readlinkPromise(source)), destination); - }); - return true; -} - -class CustomDir { - constructor(path, nextDirent, opts = {}) { - this.path = path; - this.nextDirent = nextDirent; - this.opts = opts; - this.closed = false; - } - throwIfClosed() { - if (this.closed) { - throw ERR_DIR_CLOSED(); - } - } - async *[Symbol.asyncIterator]() { - try { - let dirent; - while ((dirent = await this.read()) !== null) { - yield dirent; - } - } finally { - await this.close(); - } - } - read(cb) { - const dirent = this.readSync(); - if (typeof cb !== `undefined`) - return cb(null, dirent); - return Promise.resolve(dirent); - } - readSync() { - this.throwIfClosed(); - return this.nextDirent(); - } - close(cb) { - this.closeSync(); - if (typeof cb !== `undefined`) - return cb(null); - return Promise.resolve(); - } - closeSync() { - this.throwIfClosed(); - this.opts.onClose?.(); - this.closed = true; - } -} -function opendir(fakeFs, path, entries, opts) { - const nextDirent = () => { - const filename = entries.shift(); - if (typeof filename === `undefined`) - return null; - const entryPath = fakeFs.pathUtils.join(path, filename); - return Object.assign(fakeFs.statSync(entryPath), { - name: filename, - path: void 0 - }); - }; - return new CustomDir(path, nextDirent, opts); -} - -function assertStatus(current, expected) { - if (current !== expected) { - throw new Error(`Invalid StatWatcher status: expected '${expected}', got '${current}'`); - } -} -class CustomStatWatcher extends events.EventEmitter { - constructor(fakeFs, path, { bigint = false } = {}) { - super(); - this.status = "ready" /* Ready */; - this.changeListeners = /* @__PURE__ */ new Map(); - this.startTimeout = null; - this.fakeFs = fakeFs; - this.path = path; - this.bigint = bigint; - this.lastStats = this.stat(); - } - static create(fakeFs, path, opts) { - const statWatcher = new CustomStatWatcher(fakeFs, path, opts); - statWatcher.start(); - return statWatcher; - } - start() { - assertStatus(this.status, "ready" /* Ready */); - this.status = "running" /* Running */; - this.startTimeout = setTimeout(() => { - this.startTimeout = null; - if (!this.fakeFs.existsSync(this.path)) { - this.emit("change" /* Change */, this.lastStats, this.lastStats); - } - }, 3); - } - stop() { - assertStatus(this.status, "running" /* Running */); - this.status = "stopped" /* Stopped */; - if (this.startTimeout !== null) { - clearTimeout(this.startTimeout); - this.startTimeout = null; - } - this.emit("stop" /* Stop */); - } - stat() { - try { - return this.fakeFs.statSync(this.path, { bigint: this.bigint }); - } catch (error) { - const statInstance = this.bigint ? new BigIntStatsEntry() : new StatEntry(); - return clearStats(statInstance); - } - } - makeInterval(opts) { - const interval = setInterval(() => { - const currentStats = this.stat(); - const previousStats = this.lastStats; - if (areStatsEqual(currentStats, previousStats)) - return; - this.lastStats = currentStats; - this.emit("change" /* Change */, currentStats, previousStats); - }, opts.interval); - return opts.persistent ? interval : interval.unref(); - } - registerChangeListener(listener, opts) { - this.addListener("change" /* Change */, listener); - this.changeListeners.set(listener, this.makeInterval(opts)); - } - unregisterChangeListener(listener) { - this.removeListener("change" /* Change */, listener); - const interval = this.changeListeners.get(listener); - if (typeof interval !== `undefined`) - clearInterval(interval); - this.changeListeners.delete(listener); - } - unregisterAllChangeListeners() { - for (const listener of this.changeListeners.keys()) { - this.unregisterChangeListener(listener); - } - } - hasChangeListeners() { - return this.changeListeners.size > 0; - } - ref() { - for (const interval of this.changeListeners.values()) - interval.ref(); - return this; - } - unref() { - for (const interval of this.changeListeners.values()) - interval.unref(); - return this; - } -} - -const statWatchersByFakeFS = /* @__PURE__ */ new WeakMap(); -function watchFile(fakeFs, path, a, b) { - let bigint; - let persistent; - let interval; - let listener; - switch (typeof a) { - case `function`: - { - bigint = false; - persistent = true; - interval = 5007; - listener = a; - } - break; - default: - { - ({ - bigint = false, - persistent = true, - interval = 5007 - } = a); - listener = b; - } - break; - } - let statWatchers = statWatchersByFakeFS.get(fakeFs); - if (typeof statWatchers === `undefined`) - statWatchersByFakeFS.set(fakeFs, statWatchers = /* @__PURE__ */ new Map()); - let statWatcher = statWatchers.get(path); - if (typeof statWatcher === `undefined`) { - statWatcher = CustomStatWatcher.create(fakeFs, path, { bigint }); - statWatchers.set(path, statWatcher); - } - statWatcher.registerChangeListener(listener, { persistent, interval }); - return statWatcher; -} -function unwatchFile(fakeFs, path, cb) { - const statWatchers = statWatchersByFakeFS.get(fakeFs); - if (typeof statWatchers === `undefined`) - return; - const statWatcher = statWatchers.get(path); - if (typeof statWatcher === `undefined`) - return; - if (typeof cb === `undefined`) - statWatcher.unregisterAllChangeListeners(); - else - statWatcher.unregisterChangeListener(cb); - if (!statWatcher.hasChangeListeners()) { - statWatcher.stop(); - statWatchers.delete(path); - } -} -function unwatchAllFiles(fakeFs) { - const statWatchers = statWatchersByFakeFS.get(fakeFs); - if (typeof statWatchers === `undefined`) - return; - for (const path of statWatchers.keys()) { - unwatchFile(fakeFs, path); - } -} - -class FakeFS { - constructor(pathUtils) { - this.pathUtils = pathUtils; - } - async *genTraversePromise(init, { stableSort = false } = {}) { - const stack = [init]; - while (stack.length > 0) { - const p = stack.shift(); - const entry = await this.lstatPromise(p); - if (entry.isDirectory()) { - const entries = await this.readdirPromise(p); - if (stableSort) { - for (const entry2 of entries.sort()) { - stack.push(this.pathUtils.join(p, entry2)); - } - } else { - throw new Error(`Not supported`); - } - } else { - yield p; - } - } - } - async checksumFilePromise(path, { algorithm = `sha512` } = {}) { - const fd = await this.openPromise(path, `r`); - try { - const CHUNK_SIZE = 65536; - const chunk = Buffer.allocUnsafeSlow(CHUNK_SIZE); - const hash = crypto.createHash(algorithm); - let bytesRead = 0; - while ((bytesRead = await this.readPromise(fd, chunk, 0, CHUNK_SIZE)) !== 0) - hash.update(bytesRead === CHUNK_SIZE ? chunk : chunk.slice(0, bytesRead)); - return hash.digest(`hex`); - } finally { - await this.closePromise(fd); - } - } - async removePromise(p, { recursive = true, maxRetries = 5 } = {}) { - let stat; - try { - stat = await this.lstatPromise(p); - } catch (error) { - if (error.code === `ENOENT`) { - return; - } else { - throw error; - } - } - if (stat.isDirectory()) { - if (recursive) { - const entries = await this.readdirPromise(p); - await Promise.all(entries.map((entry) => { - return this.removePromise(this.pathUtils.resolve(p, entry)); - })); - } - for (let t = 0; t <= maxRetries; t++) { - try { - await this.rmdirPromise(p); - break; - } catch (error) { - if (error.code !== `EBUSY` && error.code !== `ENOTEMPTY`) { - throw error; - } else if (t < maxRetries) { - await new Promise((resolve) => setTimeout(resolve, t * 100)); - } - } - } - } else { - await this.unlinkPromise(p); - } - } - removeSync(p, { recursive = true } = {}) { - let stat; - try { - stat = this.lstatSync(p); - } catch (error) { - if (error.code === `ENOENT`) { - return; - } else { - throw error; - } - } - if (stat.isDirectory()) { - if (recursive) - for (const entry of this.readdirSync(p)) - this.removeSync(this.pathUtils.resolve(p, entry)); - this.rmdirSync(p); - } else { - this.unlinkSync(p); - } - } - async mkdirpPromise(p, { chmod, utimes } = {}) { - p = this.resolve(p); - if (p === this.pathUtils.dirname(p)) - return void 0; - const parts = p.split(this.pathUtils.sep); - let createdDirectory; - for (let u = 2; u <= parts.length; ++u) { - const subPath = parts.slice(0, u).join(this.pathUtils.sep); - if (!this.existsSync(subPath)) { - try { - await this.mkdirPromise(subPath); - } catch (error) { - if (error.code === `EEXIST`) { - continue; - } else { - throw error; - } - } - createdDirectory ??= subPath; - if (chmod != null) - await this.chmodPromise(subPath, chmod); - if (utimes != null) { - await this.utimesPromise(subPath, utimes[0], utimes[1]); - } else { - const parentStat = await this.statPromise(this.pathUtils.dirname(subPath)); - await this.utimesPromise(subPath, parentStat.atime, parentStat.mtime); - } - } - } - return createdDirectory; - } - mkdirpSync(p, { chmod, utimes } = {}) { - p = this.resolve(p); - if (p === this.pathUtils.dirname(p)) - return void 0; - const parts = p.split(this.pathUtils.sep); - let createdDirectory; - for (let u = 2; u <= parts.length; ++u) { - const subPath = parts.slice(0, u).join(this.pathUtils.sep); - if (!this.existsSync(subPath)) { - try { - this.mkdirSync(subPath); - } catch (error) { - if (error.code === `EEXIST`) { - continue; - } else { - throw error; - } - } - createdDirectory ??= subPath; - if (chmod != null) - this.chmodSync(subPath, chmod); - if (utimes != null) { - this.utimesSync(subPath, utimes[0], utimes[1]); - } else { - const parentStat = this.statSync(this.pathUtils.dirname(subPath)); - this.utimesSync(subPath, parentStat.atime, parentStat.mtime); - } - } - } - return createdDirectory; - } - async copyPromise(destination, source, { baseFs = this, overwrite = true, stableSort = false, stableTime = false, linkStrategy = null } = {}) { - return await copyPromise(this, destination, baseFs, source, { overwrite, stableSort, stableTime, linkStrategy }); - } - copySync(destination, source, { baseFs = this, overwrite = true } = {}) { - const stat = baseFs.lstatSync(source); - const exists = this.existsSync(destination); - if (stat.isDirectory()) { - this.mkdirpSync(destination); - const directoryListing = baseFs.readdirSync(source); - for (const entry of directoryListing) { - this.copySync(this.pathUtils.join(destination, entry), baseFs.pathUtils.join(source, entry), { baseFs, overwrite }); - } - } else if (stat.isFile()) { - if (!exists || overwrite) { - if (exists) - this.removeSync(destination); - const content = baseFs.readFileSync(source); - this.writeFileSync(destination, content); - } - } else if (stat.isSymbolicLink()) { - if (!exists || overwrite) { - if (exists) - this.removeSync(destination); - const target = baseFs.readlinkSync(source); - this.symlinkSync(convertPath(this.pathUtils, target), destination); - } - } else { - throw new Error(`Unsupported file type (file: ${source}, mode: 0o${stat.mode.toString(8).padStart(6, `0`)})`); - } - const mode = stat.mode & 511; - this.chmodSync(destination, mode); - } - async changeFilePromise(p, content, opts = {}) { - if (Buffer.isBuffer(content)) { - return this.changeFileBufferPromise(p, content, opts); - } else { - return this.changeFileTextPromise(p, content, opts); - } - } - async changeFileBufferPromise(p, content, { mode } = {}) { - let current = Buffer.alloc(0); - try { - current = await this.readFilePromise(p); - } catch (error) { - } - if (Buffer.compare(current, content) === 0) - return; - await this.writeFilePromise(p, content, { mode }); - } - async changeFileTextPromise(p, content, { automaticNewlines, mode } = {}) { - let current = ``; - try { - current = await this.readFilePromise(p, `utf8`); - } catch (error) { - } - const normalizedContent = automaticNewlines ? normalizeLineEndings(current, content) : content; - if (current === normalizedContent) - return; - await this.writeFilePromise(p, normalizedContent, { mode }); - } - changeFileSync(p, content, opts = {}) { - if (Buffer.isBuffer(content)) { - return this.changeFileBufferSync(p, content, opts); - } else { - return this.changeFileTextSync(p, content, opts); - } - } - changeFileBufferSync(p, content, { mode } = {}) { - let current = Buffer.alloc(0); - try { - current = this.readFileSync(p); - } catch (error) { - } - if (Buffer.compare(current, content) === 0) - return; - this.writeFileSync(p, content, { mode }); - } - changeFileTextSync(p, content, { automaticNewlines = false, mode } = {}) { - let current = ``; - try { - current = this.readFileSync(p, `utf8`); - } catch (error) { - } - const normalizedContent = automaticNewlines ? normalizeLineEndings(current, content) : content; - if (current === normalizedContent) - return; - this.writeFileSync(p, normalizedContent, { mode }); - } - async movePromise(fromP, toP) { - try { - await this.renamePromise(fromP, toP); - } catch (error) { - if (error.code === `EXDEV`) { - await this.copyPromise(toP, fromP); - await this.removePromise(fromP); - } else { - throw error; - } - } - } - moveSync(fromP, toP) { - try { - this.renameSync(fromP, toP); - } catch (error) { - if (error.code === `EXDEV`) { - this.copySync(toP, fromP); - this.removeSync(fromP); - } else { - throw error; - } - } - } - async lockPromise(affectedPath, callback) { - const lockPath = `${affectedPath}.flock`; - const interval = 1e3 / 60; - const startTime = Date.now(); - let fd = null; - const isAlive = async () => { - let pid; - try { - [pid] = await this.readJsonPromise(lockPath); - } catch (error) { - return Date.now() - startTime < 500; - } - try { - process.kill(pid, 0); - return true; - } catch (error) { - return false; - } - }; - while (fd === null) { - try { - fd = await this.openPromise(lockPath, `wx`); - } catch (error) { - if (error.code === `EEXIST`) { - if (!await isAlive()) { - try { - await this.unlinkPromise(lockPath); - continue; - } catch (error2) { - } - } - if (Date.now() - startTime < 60 * 1e3) { - await new Promise((resolve) => setTimeout(resolve, interval)); - } else { - throw new Error(`Couldn't acquire a lock in a reasonable time (via ${lockPath})`); - } - } else { - throw error; - } - } - } - await this.writePromise(fd, JSON.stringify([process.pid])); - try { - return await callback(); - } finally { - try { - await this.closePromise(fd); - await this.unlinkPromise(lockPath); - } catch (error) { - } - } - } - async readJsonPromise(p) { - const content = await this.readFilePromise(p, `utf8`); - try { - return JSON.parse(content); - } catch (error) { - error.message += ` (in ${p})`; - throw error; - } - } - readJsonSync(p) { - const content = this.readFileSync(p, `utf8`); - try { - return JSON.parse(content); - } catch (error) { - error.message += ` (in ${p})`; - throw error; - } - } - async writeJsonPromise(p, data, { compact = false } = {}) { - const space = compact ? 0 : 2; - return await this.writeFilePromise(p, `${JSON.stringify(data, null, space)} -`); - } - writeJsonSync(p, data, { compact = false } = {}) { - const space = compact ? 0 : 2; - return this.writeFileSync(p, `${JSON.stringify(data, null, space)} -`); - } - async preserveTimePromise(p, cb) { - const stat = await this.lstatPromise(p); - const result = await cb(); - if (typeof result !== `undefined`) - p = result; - await this.lutimesPromise(p, stat.atime, stat.mtime); - } - async preserveTimeSync(p, cb) { - const stat = this.lstatSync(p); - const result = cb(); - if (typeof result !== `undefined`) - p = result; - this.lutimesSync(p, stat.atime, stat.mtime); - } -} -class BasePortableFakeFS extends FakeFS { - constructor() { - super(ppath); - } -} -function getEndOfLine(content) { - const matches = content.match(/\r?\n/g); - if (matches === null) - return os.EOL; - const crlf = matches.filter((nl) => nl === `\r -`).length; - const lf = matches.length - crlf; - return crlf > lf ? `\r -` : ` -`; -} -function normalizeLineEndings(originalContent, newContent) { - return newContent.replace(/\r?\n/g, getEndOfLine(originalContent)); -} - -class ProxiedFS extends FakeFS { - getExtractHint(hints) { - return this.baseFs.getExtractHint(hints); - } - resolve(path) { - return this.mapFromBase(this.baseFs.resolve(this.mapToBase(path))); - } - getRealPath() { - return this.mapFromBase(this.baseFs.getRealPath()); - } - async openPromise(p, flags, mode) { - return this.baseFs.openPromise(this.mapToBase(p), flags, mode); - } - openSync(p, flags, mode) { - return this.baseFs.openSync(this.mapToBase(p), flags, mode); - } - async opendirPromise(p, opts) { - return Object.assign(await this.baseFs.opendirPromise(this.mapToBase(p), opts), { path: p }); - } - opendirSync(p, opts) { - return Object.assign(this.baseFs.opendirSync(this.mapToBase(p), opts), { path: p }); - } - async readPromise(fd, buffer, offset, length, position) { - return await this.baseFs.readPromise(fd, buffer, offset, length, position); - } - readSync(fd, buffer, offset, length, position) { - return this.baseFs.readSync(fd, buffer, offset, length, position); - } - async writePromise(fd, buffer, offset, length, position) { - if (typeof buffer === `string`) { - return await this.baseFs.writePromise(fd, buffer, offset); - } else { - return await this.baseFs.writePromise(fd, buffer, offset, length, position); - } - } - writeSync(fd, buffer, offset, length, position) { - if (typeof buffer === `string`) { - return this.baseFs.writeSync(fd, buffer, offset); - } else { - return this.baseFs.writeSync(fd, buffer, offset, length, position); - } - } - async closePromise(fd) { - return this.baseFs.closePromise(fd); - } - closeSync(fd) { - this.baseFs.closeSync(fd); - } - createReadStream(p, opts) { - return this.baseFs.createReadStream(p !== null ? this.mapToBase(p) : p, opts); - } - createWriteStream(p, opts) { - return this.baseFs.createWriteStream(p !== null ? this.mapToBase(p) : p, opts); - } - async realpathPromise(p) { - return this.mapFromBase(await this.baseFs.realpathPromise(this.mapToBase(p))); - } - realpathSync(p) { - return this.mapFromBase(this.baseFs.realpathSync(this.mapToBase(p))); - } - async existsPromise(p) { - return this.baseFs.existsPromise(this.mapToBase(p)); - } - existsSync(p) { - return this.baseFs.existsSync(this.mapToBase(p)); - } - accessSync(p, mode) { - return this.baseFs.accessSync(this.mapToBase(p), mode); - } - async accessPromise(p, mode) { - return this.baseFs.accessPromise(this.mapToBase(p), mode); - } - async statPromise(p, opts) { - return this.baseFs.statPromise(this.mapToBase(p), opts); - } - statSync(p, opts) { - return this.baseFs.statSync(this.mapToBase(p), opts); - } - async fstatPromise(fd, opts) { - return this.baseFs.fstatPromise(fd, opts); - } - fstatSync(fd, opts) { - return this.baseFs.fstatSync(fd, opts); - } - lstatPromise(p, opts) { - return this.baseFs.lstatPromise(this.mapToBase(p), opts); - } - lstatSync(p, opts) { - return this.baseFs.lstatSync(this.mapToBase(p), opts); - } - async fchmodPromise(fd, mask) { - return this.baseFs.fchmodPromise(fd, mask); - } - fchmodSync(fd, mask) { - return this.baseFs.fchmodSync(fd, mask); - } - async chmodPromise(p, mask) { - return this.baseFs.chmodPromise(this.mapToBase(p), mask); - } - chmodSync(p, mask) { - return this.baseFs.chmodSync(this.mapToBase(p), mask); - } - async fchownPromise(fd, uid, gid) { - return this.baseFs.fchownPromise(fd, uid, gid); - } - fchownSync(fd, uid, gid) { - return this.baseFs.fchownSync(fd, uid, gid); - } - async chownPromise(p, uid, gid) { - return this.baseFs.chownPromise(this.mapToBase(p), uid, gid); - } - chownSync(p, uid, gid) { - return this.baseFs.chownSync(this.mapToBase(p), uid, gid); - } - async renamePromise(oldP, newP) { - return this.baseFs.renamePromise(this.mapToBase(oldP), this.mapToBase(newP)); - } - renameSync(oldP, newP) { - return this.baseFs.renameSync(this.mapToBase(oldP), this.mapToBase(newP)); - } - async copyFilePromise(sourceP, destP, flags = 0) { - return this.baseFs.copyFilePromise(this.mapToBase(sourceP), this.mapToBase(destP), flags); - } - copyFileSync(sourceP, destP, flags = 0) { - return this.baseFs.copyFileSync(this.mapToBase(sourceP), this.mapToBase(destP), flags); - } - async appendFilePromise(p, content, opts) { - return this.baseFs.appendFilePromise(this.fsMapToBase(p), content, opts); - } - appendFileSync(p, content, opts) { - return this.baseFs.appendFileSync(this.fsMapToBase(p), content, opts); - } - async writeFilePromise(p, content, opts) { - return this.baseFs.writeFilePromise(this.fsMapToBase(p), content, opts); - } - writeFileSync(p, content, opts) { - return this.baseFs.writeFileSync(this.fsMapToBase(p), content, opts); - } - async unlinkPromise(p) { - return this.baseFs.unlinkPromise(this.mapToBase(p)); - } - unlinkSync(p) { - return this.baseFs.unlinkSync(this.mapToBase(p)); - } - async utimesPromise(p, atime, mtime) { - return this.baseFs.utimesPromise(this.mapToBase(p), atime, mtime); - } - utimesSync(p, atime, mtime) { - return this.baseFs.utimesSync(this.mapToBase(p), atime, mtime); - } - async lutimesPromise(p, atime, mtime) { - return this.baseFs.lutimesPromise(this.mapToBase(p), atime, mtime); - } - lutimesSync(p, atime, mtime) { - return this.baseFs.lutimesSync(this.mapToBase(p), atime, mtime); - } - async mkdirPromise(p, opts) { - return this.baseFs.mkdirPromise(this.mapToBase(p), opts); - } - mkdirSync(p, opts) { - return this.baseFs.mkdirSync(this.mapToBase(p), opts); - } - async rmdirPromise(p, opts) { - return this.baseFs.rmdirPromise(this.mapToBase(p), opts); - } - rmdirSync(p, opts) { - return this.baseFs.rmdirSync(this.mapToBase(p), opts); - } - async rmPromise(p, opts) { - return this.baseFs.rmPromise(this.mapToBase(p), opts); - } - rmSync(p, opts) { - return this.baseFs.rmSync(this.mapToBase(p), opts); - } - async linkPromise(existingP, newP) { - return this.baseFs.linkPromise(this.mapToBase(existingP), this.mapToBase(newP)); - } - linkSync(existingP, newP) { - return this.baseFs.linkSync(this.mapToBase(existingP), this.mapToBase(newP)); - } - async symlinkPromise(target, p, type) { - const mappedP = this.mapToBase(p); - if (this.pathUtils.isAbsolute(target)) - return this.baseFs.symlinkPromise(this.mapToBase(target), mappedP, type); - const mappedAbsoluteTarget = this.mapToBase(this.pathUtils.join(this.pathUtils.dirname(p), target)); - const mappedTarget = this.baseFs.pathUtils.relative(this.baseFs.pathUtils.dirname(mappedP), mappedAbsoluteTarget); - return this.baseFs.symlinkPromise(mappedTarget, mappedP, type); - } - symlinkSync(target, p, type) { - const mappedP = this.mapToBase(p); - if (this.pathUtils.isAbsolute(target)) - return this.baseFs.symlinkSync(this.mapToBase(target), mappedP, type); - const mappedAbsoluteTarget = this.mapToBase(this.pathUtils.join(this.pathUtils.dirname(p), target)); - const mappedTarget = this.baseFs.pathUtils.relative(this.baseFs.pathUtils.dirname(mappedP), mappedAbsoluteTarget); - return this.baseFs.symlinkSync(mappedTarget, mappedP, type); - } - async readFilePromise(p, encoding) { - return this.baseFs.readFilePromise(this.fsMapToBase(p), encoding); - } - readFileSync(p, encoding) { - return this.baseFs.readFileSync(this.fsMapToBase(p), encoding); - } - readdirPromise(p, opts) { - return this.baseFs.readdirPromise(this.mapToBase(p), opts); - } - readdirSync(p, opts) { - return this.baseFs.readdirSync(this.mapToBase(p), opts); - } - async readlinkPromise(p) { - return this.mapFromBase(await this.baseFs.readlinkPromise(this.mapToBase(p))); - } - readlinkSync(p) { - return this.mapFromBase(this.baseFs.readlinkSync(this.mapToBase(p))); - } - async truncatePromise(p, len) { - return this.baseFs.truncatePromise(this.mapToBase(p), len); - } - truncateSync(p, len) { - return this.baseFs.truncateSync(this.mapToBase(p), len); - } - async ftruncatePromise(fd, len) { - return this.baseFs.ftruncatePromise(fd, len); - } - ftruncateSync(fd, len) { - return this.baseFs.ftruncateSync(fd, len); - } - watch(p, a, b) { - return this.baseFs.watch( - this.mapToBase(p), - a, - b - ); - } - watchFile(p, a, b) { - return this.baseFs.watchFile( - this.mapToBase(p), - a, - b - ); - } - unwatchFile(p, cb) { - return this.baseFs.unwatchFile(this.mapToBase(p), cb); - } - fsMapToBase(p) { - if (typeof p === `number`) { - return p; - } else { - return this.mapToBase(p); - } - } -} - -function direntToPortable(dirent) { - const portableDirent = dirent; - if (typeof dirent.path === `string`) - portableDirent.path = npath.toPortablePath(dirent.path); - return portableDirent; -} -class NodeFS extends BasePortableFakeFS { - constructor(realFs = fs__default.default) { - super(); - this.realFs = realFs; - } - getExtractHint() { - return false; - } - getRealPath() { - return PortablePath.root; - } - resolve(p) { - return ppath.resolve(p); - } - async openPromise(p, flags, mode) { - return await new Promise((resolve, reject) => { - this.realFs.open(npath.fromPortablePath(p), flags, mode, this.makeCallback(resolve, reject)); - }); - } - openSync(p, flags, mode) { - return this.realFs.openSync(npath.fromPortablePath(p), flags, mode); - } - async opendirPromise(p, opts) { - return await new Promise((resolve, reject) => { - if (typeof opts !== `undefined`) { - this.realFs.opendir(npath.fromPortablePath(p), opts, this.makeCallback(resolve, reject)); - } else { - this.realFs.opendir(npath.fromPortablePath(p), this.makeCallback(resolve, reject)); - } - }).then((dir) => { - const dirWithFixedPath = dir; - Object.defineProperty(dirWithFixedPath, `path`, { - value: p, - configurable: true, - writable: true - }); - return dirWithFixedPath; - }); - } - opendirSync(p, opts) { - const dir = typeof opts !== `undefined` ? this.realFs.opendirSync(npath.fromPortablePath(p), opts) : this.realFs.opendirSync(npath.fromPortablePath(p)); - const dirWithFixedPath = dir; - Object.defineProperty(dirWithFixedPath, `path`, { - value: p, - configurable: true, - writable: true - }); - return dirWithFixedPath; - } - async readPromise(fd, buffer, offset = 0, length = 0, position = -1) { - return await new Promise((resolve, reject) => { - this.realFs.read(fd, buffer, offset, length, position, (error, bytesRead) => { - if (error) { - reject(error); - } else { - resolve(bytesRead); - } - }); - }); - } - readSync(fd, buffer, offset, length, position) { - return this.realFs.readSync(fd, buffer, offset, length, position); - } - async writePromise(fd, buffer, offset, length, position) { - return await new Promise((resolve, reject) => { - if (typeof buffer === `string`) { - return this.realFs.write(fd, buffer, offset, this.makeCallback(resolve, reject)); - } else { - return this.realFs.write(fd, buffer, offset, length, position, this.makeCallback(resolve, reject)); - } - }); - } - writeSync(fd, buffer, offset, length, position) { - if (typeof buffer === `string`) { - return this.realFs.writeSync(fd, buffer, offset); - } else { - return this.realFs.writeSync(fd, buffer, offset, length, position); - } - } - async closePromise(fd) { - await new Promise((resolve, reject) => { - this.realFs.close(fd, this.makeCallback(resolve, reject)); - }); - } - closeSync(fd) { - this.realFs.closeSync(fd); - } - createReadStream(p, opts) { - const realPath = p !== null ? npath.fromPortablePath(p) : p; - return this.realFs.createReadStream(realPath, opts); - } - createWriteStream(p, opts) { - const realPath = p !== null ? npath.fromPortablePath(p) : p; - return this.realFs.createWriteStream(realPath, opts); - } - async realpathPromise(p) { - return await new Promise((resolve, reject) => { - this.realFs.realpath(npath.fromPortablePath(p), {}, this.makeCallback(resolve, reject)); - }).then((path) => { - return npath.toPortablePath(path); - }); - } - realpathSync(p) { - return npath.toPortablePath(this.realFs.realpathSync(npath.fromPortablePath(p), {})); - } - async existsPromise(p) { - return await new Promise((resolve) => { - this.realFs.exists(npath.fromPortablePath(p), resolve); - }); - } - accessSync(p, mode) { - return this.realFs.accessSync(npath.fromPortablePath(p), mode); - } - async accessPromise(p, mode) { - return await new Promise((resolve, reject) => { - this.realFs.access(npath.fromPortablePath(p), mode, this.makeCallback(resolve, reject)); - }); - } - existsSync(p) { - return this.realFs.existsSync(npath.fromPortablePath(p)); - } - async statPromise(p, opts) { - return await new Promise((resolve, reject) => { - if (opts) { - this.realFs.stat(npath.fromPortablePath(p), opts, this.makeCallback(resolve, reject)); - } else { - this.realFs.stat(npath.fromPortablePath(p), this.makeCallback(resolve, reject)); - } - }); - } - statSync(p, opts) { - if (opts) { - return this.realFs.statSync(npath.fromPortablePath(p), opts); - } else { - return this.realFs.statSync(npath.fromPortablePath(p)); - } - } - async fstatPromise(fd, opts) { - return await new Promise((resolve, reject) => { - if (opts) { - this.realFs.fstat(fd, opts, this.makeCallback(resolve, reject)); - } else { - this.realFs.fstat(fd, this.makeCallback(resolve, reject)); - } - }); - } - fstatSync(fd, opts) { - if (opts) { - return this.realFs.fstatSync(fd, opts); - } else { - return this.realFs.fstatSync(fd); - } - } - async lstatPromise(p, opts) { - return await new Promise((resolve, reject) => { - if (opts) { - this.realFs.lstat(npath.fromPortablePath(p), opts, this.makeCallback(resolve, reject)); - } else { - this.realFs.lstat(npath.fromPortablePath(p), this.makeCallback(resolve, reject)); - } - }); - } - lstatSync(p, opts) { - if (opts) { - return this.realFs.lstatSync(npath.fromPortablePath(p), opts); - } else { - return this.realFs.lstatSync(npath.fromPortablePath(p)); - } - } - async fchmodPromise(fd, mask) { - return await new Promise((resolve, reject) => { - this.realFs.fchmod(fd, mask, this.makeCallback(resolve, reject)); - }); - } - fchmodSync(fd, mask) { - return this.realFs.fchmodSync(fd, mask); - } - async chmodPromise(p, mask) { - return await new Promise((resolve, reject) => { - this.realFs.chmod(npath.fromPortablePath(p), mask, this.makeCallback(resolve, reject)); - }); - } - chmodSync(p, mask) { - return this.realFs.chmodSync(npath.fromPortablePath(p), mask); - } - async fchownPromise(fd, uid, gid) { - return await new Promise((resolve, reject) => { - this.realFs.fchown(fd, uid, gid, this.makeCallback(resolve, reject)); - }); - } - fchownSync(fd, uid, gid) { - return this.realFs.fchownSync(fd, uid, gid); - } - async chownPromise(p, uid, gid) { - return await new Promise((resolve, reject) => { - this.realFs.chown(npath.fromPortablePath(p), uid, gid, this.makeCallback(resolve, reject)); - }); - } - chownSync(p, uid, gid) { - return this.realFs.chownSync(npath.fromPortablePath(p), uid, gid); - } - async renamePromise(oldP, newP) { - return await new Promise((resolve, reject) => { - this.realFs.rename(npath.fromPortablePath(oldP), npath.fromPortablePath(newP), this.makeCallback(resolve, reject)); - }); - } - renameSync(oldP, newP) { - return this.realFs.renameSync(npath.fromPortablePath(oldP), npath.fromPortablePath(newP)); - } - async copyFilePromise(sourceP, destP, flags = 0) { - return await new Promise((resolve, reject) => { - this.realFs.copyFile(npath.fromPortablePath(sourceP), npath.fromPortablePath(destP), flags, this.makeCallback(resolve, reject)); - }); - } - copyFileSync(sourceP, destP, flags = 0) { - return this.realFs.copyFileSync(npath.fromPortablePath(sourceP), npath.fromPortablePath(destP), flags); - } - async appendFilePromise(p, content, opts) { - return await new Promise((resolve, reject) => { - const fsNativePath = typeof p === `string` ? npath.fromPortablePath(p) : p; - if (opts) { - this.realFs.appendFile(fsNativePath, content, opts, this.makeCallback(resolve, reject)); - } else { - this.realFs.appendFile(fsNativePath, content, this.makeCallback(resolve, reject)); - } - }); - } - appendFileSync(p, content, opts) { - const fsNativePath = typeof p === `string` ? npath.fromPortablePath(p) : p; - if (opts) { - this.realFs.appendFileSync(fsNativePath, content, opts); - } else { - this.realFs.appendFileSync(fsNativePath, content); - } - } - async writeFilePromise(p, content, opts) { - return await new Promise((resolve, reject) => { - const fsNativePath = typeof p === `string` ? npath.fromPortablePath(p) : p; - if (opts) { - this.realFs.writeFile(fsNativePath, content, opts, this.makeCallback(resolve, reject)); - } else { - this.realFs.writeFile(fsNativePath, content, this.makeCallback(resolve, reject)); - } - }); - } - writeFileSync(p, content, opts) { - const fsNativePath = typeof p === `string` ? npath.fromPortablePath(p) : p; - if (opts) { - this.realFs.writeFileSync(fsNativePath, content, opts); - } else { - this.realFs.writeFileSync(fsNativePath, content); - } - } - async unlinkPromise(p) { - return await new Promise((resolve, reject) => { - this.realFs.unlink(npath.fromPortablePath(p), this.makeCallback(resolve, reject)); - }); - } - unlinkSync(p) { - return this.realFs.unlinkSync(npath.fromPortablePath(p)); - } - async utimesPromise(p, atime, mtime) { - return await new Promise((resolve, reject) => { - this.realFs.utimes(npath.fromPortablePath(p), atime, mtime, this.makeCallback(resolve, reject)); - }); - } - utimesSync(p, atime, mtime) { - this.realFs.utimesSync(npath.fromPortablePath(p), atime, mtime); - } - async lutimesPromise(p, atime, mtime) { - return await new Promise((resolve, reject) => { - this.realFs.lutimes(npath.fromPortablePath(p), atime, mtime, this.makeCallback(resolve, reject)); - }); - } - lutimesSync(p, atime, mtime) { - this.realFs.lutimesSync(npath.fromPortablePath(p), atime, mtime); - } - async mkdirPromise(p, opts) { - return await new Promise((resolve, reject) => { - this.realFs.mkdir(npath.fromPortablePath(p), opts, this.makeCallback(resolve, reject)); - }); - } - mkdirSync(p, opts) { - return this.realFs.mkdirSync(npath.fromPortablePath(p), opts); - } - async rmdirPromise(p, opts) { - return await new Promise((resolve, reject) => { - if (opts) { - this.realFs.rmdir(npath.fromPortablePath(p), opts, this.makeCallback(resolve, reject)); - } else { - this.realFs.rmdir(npath.fromPortablePath(p), this.makeCallback(resolve, reject)); - } - }); - } - rmdirSync(p, opts) { - return this.realFs.rmdirSync(npath.fromPortablePath(p), opts); - } - async rmPromise(p, opts) { - return await new Promise((resolve, reject) => { - if (opts) { - this.realFs.rm(npath.fromPortablePath(p), opts, this.makeCallback(resolve, reject)); - } else { - this.realFs.rm(npath.fromPortablePath(p), this.makeCallback(resolve, reject)); - } - }); - } - rmSync(p, opts) { - return this.realFs.rmSync(npath.fromPortablePath(p), opts); - } - async linkPromise(existingP, newP) { - return await new Promise((resolve, reject) => { - this.realFs.link(npath.fromPortablePath(existingP), npath.fromPortablePath(newP), this.makeCallback(resolve, reject)); - }); - } - linkSync(existingP, newP) { - return this.realFs.linkSync(npath.fromPortablePath(existingP), npath.fromPortablePath(newP)); - } - async symlinkPromise(target, p, type) { - return await new Promise((resolve, reject) => { - this.realFs.symlink(npath.fromPortablePath(target.replace(/\/+$/, ``)), npath.fromPortablePath(p), type, this.makeCallback(resolve, reject)); - }); - } - symlinkSync(target, p, type) { - return this.realFs.symlinkSync(npath.fromPortablePath(target.replace(/\/+$/, ``)), npath.fromPortablePath(p), type); - } - async readFilePromise(p, encoding) { - return await new Promise((resolve, reject) => { - const fsNativePath = typeof p === `string` ? npath.fromPortablePath(p) : p; - this.realFs.readFile(fsNativePath, encoding, this.makeCallback(resolve, reject)); - }); - } - readFileSync(p, encoding) { - const fsNativePath = typeof p === `string` ? npath.fromPortablePath(p) : p; - return this.realFs.readFileSync(fsNativePath, encoding); - } - async readdirPromise(p, opts) { - return await new Promise((resolve, reject) => { - if (opts) { - if (opts.recursive && process.platform === `win32`) { - if (opts.withFileTypes) { - this.realFs.readdir(npath.fromPortablePath(p), opts, this.makeCallback((results) => resolve(results.map(direntToPortable)), reject)); - } else { - this.realFs.readdir(npath.fromPortablePath(p), opts, this.makeCallback((results) => resolve(results.map(npath.toPortablePath)), reject)); - } - } else { - this.realFs.readdir(npath.fromPortablePath(p), opts, this.makeCallback(resolve, reject)); - } - } else { - this.realFs.readdir(npath.fromPortablePath(p), this.makeCallback(resolve, reject)); - } - }); - } - readdirSync(p, opts) { - if (opts) { - if (opts.recursive && process.platform === `win32`) { - if (opts.withFileTypes) { - return this.realFs.readdirSync(npath.fromPortablePath(p), opts).map(direntToPortable); - } else { - return this.realFs.readdirSync(npath.fromPortablePath(p), opts).map(npath.toPortablePath); - } - } else { - return this.realFs.readdirSync(npath.fromPortablePath(p), opts); - } - } else { - return this.realFs.readdirSync(npath.fromPortablePath(p)); - } - } - async readlinkPromise(p) { - return await new Promise((resolve, reject) => { - this.realFs.readlink(npath.fromPortablePath(p), this.makeCallback(resolve, reject)); - }).then((path) => { - return npath.toPortablePath(path); - }); - } - readlinkSync(p) { - return npath.toPortablePath(this.realFs.readlinkSync(npath.fromPortablePath(p))); - } - async truncatePromise(p, len) { - return await new Promise((resolve, reject) => { - this.realFs.truncate(npath.fromPortablePath(p), len, this.makeCallback(resolve, reject)); - }); - } - truncateSync(p, len) { - return this.realFs.truncateSync(npath.fromPortablePath(p), len); - } - async ftruncatePromise(fd, len) { - return await new Promise((resolve, reject) => { - this.realFs.ftruncate(fd, len, this.makeCallback(resolve, reject)); - }); - } - ftruncateSync(fd, len) { - return this.realFs.ftruncateSync(fd, len); - } - watch(p, a, b) { - return this.realFs.watch( - npath.fromPortablePath(p), - a, - b - ); - } - watchFile(p, a, b) { - return this.realFs.watchFile( - npath.fromPortablePath(p), - a, - b - ); - } - unwatchFile(p, cb) { - return this.realFs.unwatchFile(npath.fromPortablePath(p), cb); - } - makeCallback(resolve, reject) { - return (err, result) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }; - } -} - -const MOUNT_MASK = 4278190080; -class MountFS extends BasePortableFakeFS { - constructor({ baseFs = new NodeFS(), filter = null, magicByte = 42, maxOpenFiles = Infinity, useCache = true, maxAge = 5e3, typeCheck = fs.constants.S_IFREG, getMountPoint, factoryPromise, factorySync }) { - if (Math.floor(magicByte) !== magicByte || !(magicByte > 1 && magicByte <= 127)) - throw new Error(`The magic byte must be set to a round value between 1 and 127 included`); - super(); - this.fdMap = /* @__PURE__ */ new Map(); - this.nextFd = 3; - this.isMount = /* @__PURE__ */ new Set(); - this.notMount = /* @__PURE__ */ new Set(); - this.realPaths = /* @__PURE__ */ new Map(); - this.limitOpenFilesTimeout = null; - this.baseFs = baseFs; - this.mountInstances = useCache ? /* @__PURE__ */ new Map() : null; - this.factoryPromise = factoryPromise; - this.factorySync = factorySync; - this.filter = filter; - this.getMountPoint = getMountPoint; - this.magic = magicByte << 24; - this.maxAge = maxAge; - this.maxOpenFiles = maxOpenFiles; - this.typeCheck = typeCheck; - } - getExtractHint(hints) { - return this.baseFs.getExtractHint(hints); - } - getRealPath() { - return this.baseFs.getRealPath(); - } - saveAndClose() { - unwatchAllFiles(this); - if (this.mountInstances) { - for (const [path, { childFs }] of this.mountInstances.entries()) { - childFs.saveAndClose?.(); - this.mountInstances.delete(path); - } - } - } - discardAndClose() { - unwatchAllFiles(this); - if (this.mountInstances) { - for (const [path, { childFs }] of this.mountInstances.entries()) { - childFs.discardAndClose?.(); - this.mountInstances.delete(path); - } - } - } - resolve(p) { - return this.baseFs.resolve(p); - } - remapFd(mountFs, fd) { - const remappedFd = this.nextFd++ | this.magic; - this.fdMap.set(remappedFd, [mountFs, fd]); - return remappedFd; - } - async openPromise(p, flags, mode) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.openPromise(p, flags, mode); - }, async (mountFs, { subPath }) => { - return this.remapFd(mountFs, await mountFs.openPromise(subPath, flags, mode)); - }); - } - openSync(p, flags, mode) { - return this.makeCallSync(p, () => { - return this.baseFs.openSync(p, flags, mode); - }, (mountFs, { subPath }) => { - return this.remapFd(mountFs, mountFs.openSync(subPath, flags, mode)); - }); - } - async opendirPromise(p, opts) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.opendirPromise(p, opts); - }, async (mountFs, { subPath }) => { - return await mountFs.opendirPromise(subPath, opts); - }, { - requireSubpath: false - }); - } - opendirSync(p, opts) { - return this.makeCallSync(p, () => { - return this.baseFs.opendirSync(p, opts); - }, (mountFs, { subPath }) => { - return mountFs.opendirSync(subPath, opts); - }, { - requireSubpath: false - }); - } - async readPromise(fd, buffer, offset, length, position) { - if ((fd & MOUNT_MASK) !== this.magic) - return await this.baseFs.readPromise(fd, buffer, offset, length, position); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`read`); - const [mountFs, realFd] = entry; - return await mountFs.readPromise(realFd, buffer, offset, length, position); - } - readSync(fd, buffer, offset, length, position) { - if ((fd & MOUNT_MASK) !== this.magic) - return this.baseFs.readSync(fd, buffer, offset, length, position); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`readSync`); - const [mountFs, realFd] = entry; - return mountFs.readSync(realFd, buffer, offset, length, position); - } - async writePromise(fd, buffer, offset, length, position) { - if ((fd & MOUNT_MASK) !== this.magic) { - if (typeof buffer === `string`) { - return await this.baseFs.writePromise(fd, buffer, offset); - } else { - return await this.baseFs.writePromise(fd, buffer, offset, length, position); - } - } - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`write`); - const [mountFs, realFd] = entry; - if (typeof buffer === `string`) { - return await mountFs.writePromise(realFd, buffer, offset); - } else { - return await mountFs.writePromise(realFd, buffer, offset, length, position); - } - } - writeSync(fd, buffer, offset, length, position) { - if ((fd & MOUNT_MASK) !== this.magic) { - if (typeof buffer === `string`) { - return this.baseFs.writeSync(fd, buffer, offset); - } else { - return this.baseFs.writeSync(fd, buffer, offset, length, position); - } - } - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`writeSync`); - const [mountFs, realFd] = entry; - if (typeof buffer === `string`) { - return mountFs.writeSync(realFd, buffer, offset); - } else { - return mountFs.writeSync(realFd, buffer, offset, length, position); - } - } - async closePromise(fd) { - if ((fd & MOUNT_MASK) !== this.magic) - return await this.baseFs.closePromise(fd); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`close`); - this.fdMap.delete(fd); - const [mountFs, realFd] = entry; - return await mountFs.closePromise(realFd); - } - closeSync(fd) { - if ((fd & MOUNT_MASK) !== this.magic) - return this.baseFs.closeSync(fd); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`closeSync`); - this.fdMap.delete(fd); - const [mountFs, realFd] = entry; - return mountFs.closeSync(realFd); - } - createReadStream(p, opts) { - if (p === null) - return this.baseFs.createReadStream(p, opts); - return this.makeCallSync(p, () => { - return this.baseFs.createReadStream(p, opts); - }, (mountFs, { archivePath, subPath }) => { - const stream = mountFs.createReadStream(subPath, opts); - stream.path = npath.fromPortablePath(this.pathUtils.join(archivePath, subPath)); - return stream; - }); - } - createWriteStream(p, opts) { - if (p === null) - return this.baseFs.createWriteStream(p, opts); - return this.makeCallSync(p, () => { - return this.baseFs.createWriteStream(p, opts); - }, (mountFs, { subPath }) => { - return mountFs.createWriteStream(subPath, opts); - }); - } - async realpathPromise(p) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.realpathPromise(p); - }, async (mountFs, { archivePath, subPath }) => { - let realArchivePath = this.realPaths.get(archivePath); - if (typeof realArchivePath === `undefined`) { - realArchivePath = await this.baseFs.realpathPromise(archivePath); - this.realPaths.set(archivePath, realArchivePath); - } - return this.pathUtils.join(realArchivePath, this.pathUtils.relative(PortablePath.root, await mountFs.realpathPromise(subPath))); - }); - } - realpathSync(p) { - return this.makeCallSync(p, () => { - return this.baseFs.realpathSync(p); - }, (mountFs, { archivePath, subPath }) => { - let realArchivePath = this.realPaths.get(archivePath); - if (typeof realArchivePath === `undefined`) { - realArchivePath = this.baseFs.realpathSync(archivePath); - this.realPaths.set(archivePath, realArchivePath); - } - return this.pathUtils.join(realArchivePath, this.pathUtils.relative(PortablePath.root, mountFs.realpathSync(subPath))); - }); - } - async existsPromise(p) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.existsPromise(p); - }, async (mountFs, { subPath }) => { - return await mountFs.existsPromise(subPath); - }); - } - existsSync(p) { - return this.makeCallSync(p, () => { - return this.baseFs.existsSync(p); - }, (mountFs, { subPath }) => { - return mountFs.existsSync(subPath); - }); - } - async accessPromise(p, mode) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.accessPromise(p, mode); - }, async (mountFs, { subPath }) => { - return await mountFs.accessPromise(subPath, mode); - }); - } - accessSync(p, mode) { - return this.makeCallSync(p, () => { - return this.baseFs.accessSync(p, mode); - }, (mountFs, { subPath }) => { - return mountFs.accessSync(subPath, mode); - }); - } - async statPromise(p, opts) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.statPromise(p, opts); - }, async (mountFs, { subPath }) => { - return await mountFs.statPromise(subPath, opts); - }); - } - statSync(p, opts) { - return this.makeCallSync(p, () => { - return this.baseFs.statSync(p, opts); - }, (mountFs, { subPath }) => { - return mountFs.statSync(subPath, opts); - }); - } - async fstatPromise(fd, opts) { - if ((fd & MOUNT_MASK) !== this.magic) - return this.baseFs.fstatPromise(fd, opts); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`fstat`); - const [mountFs, realFd] = entry; - return mountFs.fstatPromise(realFd, opts); - } - fstatSync(fd, opts) { - if ((fd & MOUNT_MASK) !== this.magic) - return this.baseFs.fstatSync(fd, opts); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`fstatSync`); - const [mountFs, realFd] = entry; - return mountFs.fstatSync(realFd, opts); - } - async lstatPromise(p, opts) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.lstatPromise(p, opts); - }, async (mountFs, { subPath }) => { - return await mountFs.lstatPromise(subPath, opts); - }); - } - lstatSync(p, opts) { - return this.makeCallSync(p, () => { - return this.baseFs.lstatSync(p, opts); - }, (mountFs, { subPath }) => { - return mountFs.lstatSync(subPath, opts); - }); - } - async fchmodPromise(fd, mask) { - if ((fd & MOUNT_MASK) !== this.magic) - return this.baseFs.fchmodPromise(fd, mask); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`fchmod`); - const [mountFs, realFd] = entry; - return mountFs.fchmodPromise(realFd, mask); - } - fchmodSync(fd, mask) { - if ((fd & MOUNT_MASK) !== this.magic) - return this.baseFs.fchmodSync(fd, mask); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`fchmodSync`); - const [mountFs, realFd] = entry; - return mountFs.fchmodSync(realFd, mask); - } - async chmodPromise(p, mask) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.chmodPromise(p, mask); - }, async (mountFs, { subPath }) => { - return await mountFs.chmodPromise(subPath, mask); - }); - } - chmodSync(p, mask) { - return this.makeCallSync(p, () => { - return this.baseFs.chmodSync(p, mask); - }, (mountFs, { subPath }) => { - return mountFs.chmodSync(subPath, mask); - }); - } - async fchownPromise(fd, uid, gid) { - if ((fd & MOUNT_MASK) !== this.magic) - return this.baseFs.fchownPromise(fd, uid, gid); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`fchown`); - const [zipFs, realFd] = entry; - return zipFs.fchownPromise(realFd, uid, gid); - } - fchownSync(fd, uid, gid) { - if ((fd & MOUNT_MASK) !== this.magic) - return this.baseFs.fchownSync(fd, uid, gid); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`fchownSync`); - const [zipFs, realFd] = entry; - return zipFs.fchownSync(realFd, uid, gid); - } - async chownPromise(p, uid, gid) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.chownPromise(p, uid, gid); - }, async (mountFs, { subPath }) => { - return await mountFs.chownPromise(subPath, uid, gid); - }); - } - chownSync(p, uid, gid) { - return this.makeCallSync(p, () => { - return this.baseFs.chownSync(p, uid, gid); - }, (mountFs, { subPath }) => { - return mountFs.chownSync(subPath, uid, gid); - }); - } - async renamePromise(oldP, newP) { - return await this.makeCallPromise(oldP, async () => { - return await this.makeCallPromise(newP, async () => { - return await this.baseFs.renamePromise(oldP, newP); - }, async () => { - throw Object.assign(new Error(`EEXDEV: cross-device link not permitted`), { code: `EEXDEV` }); - }); - }, async (mountFsO, { subPath: subPathO }) => { - return await this.makeCallPromise(newP, async () => { - throw Object.assign(new Error(`EEXDEV: cross-device link not permitted`), { code: `EEXDEV` }); - }, async (mountFsN, { subPath: subPathN }) => { - if (mountFsO !== mountFsN) { - throw Object.assign(new Error(`EEXDEV: cross-device link not permitted`), { code: `EEXDEV` }); - } else { - return await mountFsO.renamePromise(subPathO, subPathN); - } - }); - }); - } - renameSync(oldP, newP) { - return this.makeCallSync(oldP, () => { - return this.makeCallSync(newP, () => { - return this.baseFs.renameSync(oldP, newP); - }, () => { - throw Object.assign(new Error(`EEXDEV: cross-device link not permitted`), { code: `EEXDEV` }); - }); - }, (mountFsO, { subPath: subPathO }) => { - return this.makeCallSync(newP, () => { - throw Object.assign(new Error(`EEXDEV: cross-device link not permitted`), { code: `EEXDEV` }); - }, (mountFsN, { subPath: subPathN }) => { - if (mountFsO !== mountFsN) { - throw Object.assign(new Error(`EEXDEV: cross-device link not permitted`), { code: `EEXDEV` }); - } else { - return mountFsO.renameSync(subPathO, subPathN); - } - }); - }); - } - async copyFilePromise(sourceP, destP, flags = 0) { - const fallback = async (sourceFs, sourceP2, destFs, destP2) => { - if ((flags & fs.constants.COPYFILE_FICLONE_FORCE) !== 0) - throw Object.assign(new Error(`EXDEV: cross-device clone not permitted, copyfile '${sourceP2}' -> ${destP2}'`), { code: `EXDEV` }); - if (flags & fs.constants.COPYFILE_EXCL && await this.existsPromise(sourceP2)) - throw Object.assign(new Error(`EEXIST: file already exists, copyfile '${sourceP2}' -> '${destP2}'`), { code: `EEXIST` }); - let content; - try { - content = await sourceFs.readFilePromise(sourceP2); - } catch (error) { - throw Object.assign(new Error(`EINVAL: invalid argument, copyfile '${sourceP2}' -> '${destP2}'`), { code: `EINVAL` }); - } - await destFs.writeFilePromise(destP2, content); - }; - return await this.makeCallPromise(sourceP, async () => { - return await this.makeCallPromise(destP, async () => { - return await this.baseFs.copyFilePromise(sourceP, destP, flags); - }, async (mountFsD, { subPath: subPathD }) => { - return await fallback(this.baseFs, sourceP, mountFsD, subPathD); - }); - }, async (mountFsS, { subPath: subPathS }) => { - return await this.makeCallPromise(destP, async () => { - return await fallback(mountFsS, subPathS, this.baseFs, destP); - }, async (mountFsD, { subPath: subPathD }) => { - if (mountFsS !== mountFsD) { - return await fallback(mountFsS, subPathS, mountFsD, subPathD); - } else { - return await mountFsS.copyFilePromise(subPathS, subPathD, flags); - } - }); - }); - } - copyFileSync(sourceP, destP, flags = 0) { - const fallback = (sourceFs, sourceP2, destFs, destP2) => { - if ((flags & fs.constants.COPYFILE_FICLONE_FORCE) !== 0) - throw Object.assign(new Error(`EXDEV: cross-device clone not permitted, copyfile '${sourceP2}' -> ${destP2}'`), { code: `EXDEV` }); - if (flags & fs.constants.COPYFILE_EXCL && this.existsSync(sourceP2)) - throw Object.assign(new Error(`EEXIST: file already exists, copyfile '${sourceP2}' -> '${destP2}'`), { code: `EEXIST` }); - let content; - try { - content = sourceFs.readFileSync(sourceP2); - } catch (error) { - throw Object.assign(new Error(`EINVAL: invalid argument, copyfile '${sourceP2}' -> '${destP2}'`), { code: `EINVAL` }); - } - destFs.writeFileSync(destP2, content); - }; - return this.makeCallSync(sourceP, () => { - return this.makeCallSync(destP, () => { - return this.baseFs.copyFileSync(sourceP, destP, flags); - }, (mountFsD, { subPath: subPathD }) => { - return fallback(this.baseFs, sourceP, mountFsD, subPathD); - }); - }, (mountFsS, { subPath: subPathS }) => { - return this.makeCallSync(destP, () => { - return fallback(mountFsS, subPathS, this.baseFs, destP); - }, (mountFsD, { subPath: subPathD }) => { - if (mountFsS !== mountFsD) { - return fallback(mountFsS, subPathS, mountFsD, subPathD); - } else { - return mountFsS.copyFileSync(subPathS, subPathD, flags); - } - }); - }); - } - async appendFilePromise(p, content, opts) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.appendFilePromise(p, content, opts); - }, async (mountFs, { subPath }) => { - return await mountFs.appendFilePromise(subPath, content, opts); - }); - } - appendFileSync(p, content, opts) { - return this.makeCallSync(p, () => { - return this.baseFs.appendFileSync(p, content, opts); - }, (mountFs, { subPath }) => { - return mountFs.appendFileSync(subPath, content, opts); - }); - } - async writeFilePromise(p, content, opts) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.writeFilePromise(p, content, opts); - }, async (mountFs, { subPath }) => { - return await mountFs.writeFilePromise(subPath, content, opts); - }); - } - writeFileSync(p, content, opts) { - return this.makeCallSync(p, () => { - return this.baseFs.writeFileSync(p, content, opts); - }, (mountFs, { subPath }) => { - return mountFs.writeFileSync(subPath, content, opts); - }); - } - async unlinkPromise(p) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.unlinkPromise(p); - }, async (mountFs, { subPath }) => { - return await mountFs.unlinkPromise(subPath); - }); - } - unlinkSync(p) { - return this.makeCallSync(p, () => { - return this.baseFs.unlinkSync(p); - }, (mountFs, { subPath }) => { - return mountFs.unlinkSync(subPath); - }); - } - async utimesPromise(p, atime, mtime) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.utimesPromise(p, atime, mtime); - }, async (mountFs, { subPath }) => { - return await mountFs.utimesPromise(subPath, atime, mtime); - }); - } - utimesSync(p, atime, mtime) { - return this.makeCallSync(p, () => { - return this.baseFs.utimesSync(p, atime, mtime); - }, (mountFs, { subPath }) => { - return mountFs.utimesSync(subPath, atime, mtime); - }); - } - async lutimesPromise(p, atime, mtime) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.lutimesPromise(p, atime, mtime); - }, async (mountFs, { subPath }) => { - return await mountFs.lutimesPromise(subPath, atime, mtime); - }); - } - lutimesSync(p, atime, mtime) { - return this.makeCallSync(p, () => { - return this.baseFs.lutimesSync(p, atime, mtime); - }, (mountFs, { subPath }) => { - return mountFs.lutimesSync(subPath, atime, mtime); - }); - } - async mkdirPromise(p, opts) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.mkdirPromise(p, opts); - }, async (mountFs, { subPath }) => { - return await mountFs.mkdirPromise(subPath, opts); - }); - } - mkdirSync(p, opts) { - return this.makeCallSync(p, () => { - return this.baseFs.mkdirSync(p, opts); - }, (mountFs, { subPath }) => { - return mountFs.mkdirSync(subPath, opts); - }); - } - async rmdirPromise(p, opts) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.rmdirPromise(p, opts); - }, async (mountFs, { subPath }) => { - return await mountFs.rmdirPromise(subPath, opts); - }); - } - rmdirSync(p, opts) { - return this.makeCallSync(p, () => { - return this.baseFs.rmdirSync(p, opts); - }, (mountFs, { subPath }) => { - return mountFs.rmdirSync(subPath, opts); - }); - } - async rmPromise(p, opts) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.rmPromise(p, opts); - }, async (mountFs, { subPath }) => { - return await mountFs.rmPromise(subPath, opts); - }); - } - rmSync(p, opts) { - return this.makeCallSync(p, () => { - return this.baseFs.rmSync(p, opts); - }, (mountFs, { subPath }) => { - return mountFs.rmSync(subPath, opts); - }); - } - async linkPromise(existingP, newP) { - return await this.makeCallPromise(newP, async () => { - return await this.baseFs.linkPromise(existingP, newP); - }, async (mountFs, { subPath }) => { - return await mountFs.linkPromise(existingP, subPath); - }); - } - linkSync(existingP, newP) { - return this.makeCallSync(newP, () => { - return this.baseFs.linkSync(existingP, newP); - }, (mountFs, { subPath }) => { - return mountFs.linkSync(existingP, subPath); - }); - } - async symlinkPromise(target, p, type) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.symlinkPromise(target, p, type); - }, async (mountFs, { subPath }) => { - return await mountFs.symlinkPromise(target, subPath); - }); - } - symlinkSync(target, p, type) { - return this.makeCallSync(p, () => { - return this.baseFs.symlinkSync(target, p, type); - }, (mountFs, { subPath }) => { - return mountFs.symlinkSync(target, subPath); - }); - } - async readFilePromise(p, encoding) { - return this.makeCallPromise(p, async () => { - return await this.baseFs.readFilePromise(p, encoding); - }, async (mountFs, { subPath }) => { - return await mountFs.readFilePromise(subPath, encoding); - }); - } - readFileSync(p, encoding) { - return this.makeCallSync(p, () => { - return this.baseFs.readFileSync(p, encoding); - }, (mountFs, { subPath }) => { - return mountFs.readFileSync(subPath, encoding); - }); - } - async readdirPromise(p, opts) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.readdirPromise(p, opts); - }, async (mountFs, { subPath }) => { - return await mountFs.readdirPromise(subPath, opts); - }, { - requireSubpath: false - }); - } - readdirSync(p, opts) { - return this.makeCallSync(p, () => { - return this.baseFs.readdirSync(p, opts); - }, (mountFs, { subPath }) => { - return mountFs.readdirSync(subPath, opts); - }, { - requireSubpath: false - }); - } - async readlinkPromise(p) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.readlinkPromise(p); - }, async (mountFs, { subPath }) => { - return await mountFs.readlinkPromise(subPath); - }); - } - readlinkSync(p) { - return this.makeCallSync(p, () => { - return this.baseFs.readlinkSync(p); - }, (mountFs, { subPath }) => { - return mountFs.readlinkSync(subPath); - }); - } - async truncatePromise(p, len) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.truncatePromise(p, len); - }, async (mountFs, { subPath }) => { - return await mountFs.truncatePromise(subPath, len); - }); - } - truncateSync(p, len) { - return this.makeCallSync(p, () => { - return this.baseFs.truncateSync(p, len); - }, (mountFs, { subPath }) => { - return mountFs.truncateSync(subPath, len); - }); - } - async ftruncatePromise(fd, len) { - if ((fd & MOUNT_MASK) !== this.magic) - return this.baseFs.ftruncatePromise(fd, len); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`ftruncate`); - const [mountFs, realFd] = entry; - return mountFs.ftruncatePromise(realFd, len); - } - ftruncateSync(fd, len) { - if ((fd & MOUNT_MASK) !== this.magic) - return this.baseFs.ftruncateSync(fd, len); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`ftruncateSync`); - const [mountFs, realFd] = entry; - return mountFs.ftruncateSync(realFd, len); - } - watch(p, a, b) { - return this.makeCallSync(p, () => { - return this.baseFs.watch( - p, - a, - b - ); - }, (mountFs, { subPath }) => { - return mountFs.watch( - subPath, - a, - b - ); - }); - } - watchFile(p, a, b) { - return this.makeCallSync(p, () => { - return this.baseFs.watchFile( - p, - a, - b - ); - }, () => { - return watchFile(this, p, a, b); - }); - } - unwatchFile(p, cb) { - return this.makeCallSync(p, () => { - return this.baseFs.unwatchFile(p, cb); - }, () => { - return unwatchFile(this, p, cb); - }); - } - async makeCallPromise(p, discard, accept, { requireSubpath = true } = {}) { - if (typeof p !== `string`) - return await discard(); - const normalizedP = this.resolve(p); - const mountInfo = this.findMount(normalizedP); - if (!mountInfo) - return await discard(); - if (requireSubpath && mountInfo.subPath === `/`) - return await discard(); - return await this.getMountPromise(mountInfo.archivePath, async (mountFs) => await accept(mountFs, mountInfo)); - } - makeCallSync(p, discard, accept, { requireSubpath = true } = {}) { - if (typeof p !== `string`) - return discard(); - const normalizedP = this.resolve(p); - const mountInfo = this.findMount(normalizedP); - if (!mountInfo) - return discard(); - if (requireSubpath && mountInfo.subPath === `/`) - return discard(); - return this.getMountSync(mountInfo.archivePath, (mountFs) => accept(mountFs, mountInfo)); - } - findMount(p) { - if (this.filter && !this.filter.test(p)) - return null; - let filePath = ``; - while (true) { - const pathPartWithArchive = p.substring(filePath.length); - const mountPoint = this.getMountPoint(pathPartWithArchive, filePath); - if (!mountPoint) - return null; - filePath = this.pathUtils.join(filePath, mountPoint); - if (!this.isMount.has(filePath)) { - if (this.notMount.has(filePath)) - continue; - try { - if (this.typeCheck !== null && (this.baseFs.lstatSync(filePath).mode & fs.constants.S_IFMT) !== this.typeCheck) { - this.notMount.add(filePath); - continue; - } - } catch { - return null; - } - this.isMount.add(filePath); - } - return { - archivePath: filePath, - subPath: this.pathUtils.join(PortablePath.root, p.substring(filePath.length)) - }; - } - } - limitOpenFiles(max) { - if (this.mountInstances === null) - return; - const now = Date.now(); - let nextExpiresAt = now + this.maxAge; - let closeCount = max === null ? 0 : this.mountInstances.size - max; - for (const [path, { childFs, expiresAt, refCount }] of this.mountInstances.entries()) { - if (refCount !== 0 || childFs.hasOpenFileHandles?.()) { - continue; - } else if (now >= expiresAt) { - childFs.saveAndClose?.(); - this.mountInstances.delete(path); - closeCount -= 1; - continue; - } else if (max === null || closeCount <= 0) { - nextExpiresAt = expiresAt; - break; - } - childFs.saveAndClose?.(); - this.mountInstances.delete(path); - closeCount -= 1; - } - if (this.limitOpenFilesTimeout === null && (max === null && this.mountInstances.size > 0 || max !== null) && isFinite(nextExpiresAt)) { - this.limitOpenFilesTimeout = setTimeout(() => { - this.limitOpenFilesTimeout = null; - this.limitOpenFiles(null); - }, nextExpiresAt - now).unref(); - } - } - async getMountPromise(p, accept) { - if (this.mountInstances) { - let cachedMountFs = this.mountInstances.get(p); - if (!cachedMountFs) { - const createFsInstance = await this.factoryPromise(this.baseFs, p); - cachedMountFs = this.mountInstances.get(p); - if (!cachedMountFs) { - cachedMountFs = { - childFs: createFsInstance(), - expiresAt: 0, - refCount: 0 - }; - } - } - this.mountInstances.delete(p); - this.limitOpenFiles(this.maxOpenFiles - 1); - this.mountInstances.set(p, cachedMountFs); - cachedMountFs.expiresAt = Date.now() + this.maxAge; - cachedMountFs.refCount += 1; - try { - return await accept(cachedMountFs.childFs); - } finally { - cachedMountFs.refCount -= 1; - } - } else { - const mountFs = (await this.factoryPromise(this.baseFs, p))(); - try { - return await accept(mountFs); - } finally { - mountFs.saveAndClose?.(); - } - } - } - getMountSync(p, accept) { - if (this.mountInstances) { - let cachedMountFs = this.mountInstances.get(p); - if (!cachedMountFs) { - cachedMountFs = { - childFs: this.factorySync(this.baseFs, p), - expiresAt: 0, - refCount: 0 - }; - } - this.mountInstances.delete(p); - this.limitOpenFiles(this.maxOpenFiles - 1); - this.mountInstances.set(p, cachedMountFs); - cachedMountFs.expiresAt = Date.now() + this.maxAge; - return accept(cachedMountFs.childFs); - } else { - const childFs = this.factorySync(this.baseFs, p); - try { - return accept(childFs); - } finally { - childFs.saveAndClose?.(); - } - } - } -} - -class PosixFS extends ProxiedFS { - constructor(baseFs) { - super(npath); - this.baseFs = baseFs; - } - mapFromBase(path) { - return npath.fromPortablePath(path); - } - mapToBase(path) { - return npath.toPortablePath(path); - } -} - -const NUMBER_REGEXP = /^[0-9]+$/; -const VIRTUAL_REGEXP = /^(\/(?:[^/]+\/)*?(?:\$\$virtual|__virtual__))((?:\/((?:[^/]+-)?[a-f0-9]+)(?:\/([^/]+))?)?((?:\/.*)?))$/; -const VALID_COMPONENT = /^([^/]+-)?[a-f0-9]+$/; -class VirtualFS extends ProxiedFS { - constructor({ baseFs = new NodeFS() } = {}) { - super(ppath); - this.baseFs = baseFs; - } - static makeVirtualPath(base, component, to) { - if (ppath.basename(base) !== `__virtual__`) - throw new Error(`Assertion failed: Virtual folders must be named "__virtual__"`); - if (!ppath.basename(component).match(VALID_COMPONENT)) - throw new Error(`Assertion failed: Virtual components must be ended by an hexadecimal hash`); - const target = ppath.relative(ppath.dirname(base), to); - const segments = target.split(`/`); - let depth = 0; - while (depth < segments.length && segments[depth] === `..`) - depth += 1; - const finalSegments = segments.slice(depth); - const fullVirtualPath = ppath.join(base, component, String(depth), ...finalSegments); - return fullVirtualPath; - } - static resolveVirtual(p) { - const match = p.match(VIRTUAL_REGEXP); - if (!match || !match[3] && match[5]) - return p; - const target = ppath.dirname(match[1]); - if (!match[3] || !match[4]) - return target; - const isnum = NUMBER_REGEXP.test(match[4]); - if (!isnum) - return p; - const depth = Number(match[4]); - const backstep = `../`.repeat(depth); - const subpath = match[5] || `.`; - return VirtualFS.resolveVirtual(ppath.join(target, backstep, subpath)); - } - getExtractHint(hints) { - return this.baseFs.getExtractHint(hints); - } - getRealPath() { - return this.baseFs.getRealPath(); - } - realpathSync(p) { - const match = p.match(VIRTUAL_REGEXP); - if (!match) - return this.baseFs.realpathSync(p); - if (!match[5]) - return p; - const realpath = this.baseFs.realpathSync(this.mapToBase(p)); - return VirtualFS.makeVirtualPath(match[1], match[3], realpath); - } - async realpathPromise(p) { - const match = p.match(VIRTUAL_REGEXP); - if (!match) - return await this.baseFs.realpathPromise(p); - if (!match[5]) - return p; - const realpath = await this.baseFs.realpathPromise(this.mapToBase(p)); - return VirtualFS.makeVirtualPath(match[1], match[3], realpath); - } - mapToBase(p) { - if (p === ``) - return p; - if (this.pathUtils.isAbsolute(p)) - return VirtualFS.resolveVirtual(p); - const resolvedRoot = VirtualFS.resolveVirtual(this.baseFs.resolve(PortablePath.dot)); - const resolvedP = VirtualFS.resolveVirtual(this.baseFs.resolve(p)); - return ppath.relative(resolvedRoot, resolvedP) || PortablePath.dot; - } - mapFromBase(p) { - return p; - } -} - -const URL = Number(process.versions.node.split('.', 1)[0]) < 20 ? url.URL : globalThis.URL; - -class NodePathFS extends ProxiedFS { - constructor(baseFs) { - super(npath); - this.baseFs = baseFs; - } - mapFromBase(path) { - return path; - } - mapToBase(path) { - if (typeof path === `string`) - return path; - if (path instanceof URL) - return url.fileURLToPath(path); - if (Buffer.isBuffer(path)) { - const str = path.toString(); - if (!isUtf8(path, str)) - throw new Error(`Non-utf8 buffers are not supported at the moment. Please upvote the following issue if you encounter this error: https://github.com/yarnpkg/berry/issues/4942`); - return str; - } - throw new Error(`Unsupported path type: ${nodeUtils.inspect(path)}`); - } -} -function isUtf8(buf, str) { - if (typeof buffer__default.default.isUtf8 !== `undefined`) - return buffer__default.default.isUtf8(buf); - return Buffer.byteLength(str) === buf.byteLength; -} - -var _a, _b, _c, _d; -const kBaseFs = Symbol(`kBaseFs`); -const kFd = Symbol(`kFd`); -const kClosePromise = Symbol(`kClosePromise`); -const kCloseResolve = Symbol(`kCloseResolve`); -const kCloseReject = Symbol(`kCloseReject`); -const kRefs = Symbol(`kRefs`); -const kRef = Symbol(`kRef`); -const kUnref = Symbol(`kUnref`); -class FileHandle { - constructor(fd, baseFs) { - this[_a] = 1; - this[_b] = void 0; - this[_c] = void 0; - this[_d] = void 0; - this[kBaseFs] = baseFs; - this[kFd] = fd; - } - get fd() { - return this[kFd]; - } - async appendFile(data, options) { - try { - this[kRef](this.appendFile); - const encoding = (typeof options === `string` ? options : options?.encoding) ?? void 0; - return await this[kBaseFs].appendFilePromise(this.fd, data, encoding ? { encoding } : void 0); - } finally { - this[kUnref](); - } - } - async chown(uid, gid) { - try { - this[kRef](this.chown); - return await this[kBaseFs].fchownPromise(this.fd, uid, gid); - } finally { - this[kUnref](); - } - } - async chmod(mode) { - try { - this[kRef](this.chmod); - return await this[kBaseFs].fchmodPromise(this.fd, mode); - } finally { - this[kUnref](); - } - } - createReadStream(options) { - return this[kBaseFs].createReadStream(null, { ...options, fd: this.fd }); - } - createWriteStream(options) { - return this[kBaseFs].createWriteStream(null, { ...options, fd: this.fd }); - } - datasync() { - throw new Error(`Method not implemented.`); - } - sync() { - throw new Error(`Method not implemented.`); - } - async read(bufferOrOptions, offset, length, position) { - try { - this[kRef](this.read); - let buffer; - if (!Buffer.isBuffer(bufferOrOptions)) { - bufferOrOptions ??= {}; - buffer = bufferOrOptions.buffer ?? Buffer.alloc(16384); - offset = bufferOrOptions.offset || 0; - length = bufferOrOptions.length ?? buffer.byteLength; - position = bufferOrOptions.position ?? null; - } else { - buffer = bufferOrOptions; - } - offset ??= 0; - length ??= 0; - if (length === 0) { - return { - bytesRead: length, - buffer - }; - } - const bytesRead = await this[kBaseFs].readPromise(this.fd, buffer, offset, length, position); - return { - bytesRead, - buffer - }; - } finally { - this[kUnref](); - } - } - async readFile(options) { - try { - this[kRef](this.readFile); - const encoding = (typeof options === `string` ? options : options?.encoding) ?? void 0; - return await this[kBaseFs].readFilePromise(this.fd, encoding); - } finally { - this[kUnref](); - } - } - readLines(options) { - return readline.createInterface({ - input: this.createReadStream(options), - crlfDelay: Infinity - }); - } - async stat(opts) { - try { - this[kRef](this.stat); - return await this[kBaseFs].fstatPromise(this.fd, opts); - } finally { - this[kUnref](); - } - } - async truncate(len) { - try { - this[kRef](this.truncate); - return await this[kBaseFs].ftruncatePromise(this.fd, len); - } finally { - this[kUnref](); - } - } - utimes(atime, mtime) { - throw new Error(`Method not implemented.`); - } - async writeFile(data, options) { - try { - this[kRef](this.writeFile); - const encoding = (typeof options === `string` ? options : options?.encoding) ?? void 0; - await this[kBaseFs].writeFilePromise(this.fd, data, encoding); - } finally { - this[kUnref](); - } - } - async write(...args) { - try { - this[kRef](this.write); - if (ArrayBuffer.isView(args[0])) { - const [buffer, offset, length, position] = args; - const bytesWritten = await this[kBaseFs].writePromise(this.fd, buffer, offset ?? void 0, length ?? void 0, position ?? void 0); - return { bytesWritten, buffer }; - } else { - const [data, position, encoding] = args; - const bytesWritten = await this[kBaseFs].writePromise(this.fd, data, position, encoding); - return { bytesWritten, buffer: data }; - } - } finally { - this[kUnref](); - } - } - async writev(buffers, position) { - try { - this[kRef](this.writev); - let bytesWritten = 0; - if (typeof position !== `undefined`) { - for (const buffer of buffers) { - const writeResult = await this.write(buffer, void 0, void 0, position); - bytesWritten += writeResult.bytesWritten; - position += writeResult.bytesWritten; - } - } else { - for (const buffer of buffers) { - const writeResult = await this.write(buffer); - bytesWritten += writeResult.bytesWritten; - } - } - return { - buffers, - bytesWritten - }; - } finally { - this[kUnref](); - } - } - readv(buffers, position) { - throw new Error(`Method not implemented.`); - } - close() { - if (this[kFd] === -1) - return Promise.resolve(); - if (this[kClosePromise]) - return this[kClosePromise]; - this[kRefs]--; - if (this[kRefs] === 0) { - const fd = this[kFd]; - this[kFd] = -1; - this[kClosePromise] = this[kBaseFs].closePromise(fd).finally(() => { - this[kClosePromise] = void 0; - }); - } else { - this[kClosePromise] = new Promise((resolve, reject) => { - this[kCloseResolve] = resolve; - this[kCloseReject] = reject; - }).finally(() => { - this[kClosePromise] = void 0; - this[kCloseReject] = void 0; - this[kCloseResolve] = void 0; - }); - } - return this[kClosePromise]; - } - [(_a = kRefs, _b = kClosePromise, _c = kCloseResolve, _d = kCloseReject, kRef)](caller) { - if (this[kFd] === -1) { - const err = new Error(`file closed`); - err.code = `EBADF`; - err.syscall = caller.name; - throw err; - } - this[kRefs]++; - } - [kUnref]() { - this[kRefs]--; - if (this[kRefs] === 0) { - const fd = this[kFd]; - this[kFd] = -1; - this[kBaseFs].closePromise(fd).then(this[kCloseResolve], this[kCloseReject]); - } - } -} - -const SYNC_IMPLEMENTATIONS = /* @__PURE__ */ new Set([ - `accessSync`, - `appendFileSync`, - `createReadStream`, - `createWriteStream`, - `chmodSync`, - `fchmodSync`, - `chownSync`, - `fchownSync`, - `closeSync`, - `copyFileSync`, - `linkSync`, - `lstatSync`, - `fstatSync`, - `lutimesSync`, - `mkdirSync`, - `openSync`, - `opendirSync`, - `readlinkSync`, - `readFileSync`, - `readdirSync`, - `readlinkSync`, - `realpathSync`, - `renameSync`, - `rmdirSync`, - `rmSync`, - `statSync`, - `symlinkSync`, - `truncateSync`, - `ftruncateSync`, - `unlinkSync`, - `unwatchFile`, - `utimesSync`, - `watch`, - `watchFile`, - `writeFileSync`, - `writeSync` -]); -const ASYNC_IMPLEMENTATIONS = /* @__PURE__ */ new Set([ - `accessPromise`, - `appendFilePromise`, - `fchmodPromise`, - `chmodPromise`, - `fchownPromise`, - `chownPromise`, - `closePromise`, - `copyFilePromise`, - `linkPromise`, - `fstatPromise`, - `lstatPromise`, - `lutimesPromise`, - `mkdirPromise`, - `openPromise`, - `opendirPromise`, - `readdirPromise`, - `realpathPromise`, - `readFilePromise`, - `readdirPromise`, - `readlinkPromise`, - `renamePromise`, - `rmdirPromise`, - `rmPromise`, - `statPromise`, - `symlinkPromise`, - `truncatePromise`, - `ftruncatePromise`, - `unlinkPromise`, - `utimesPromise`, - `writeFilePromise`, - `writeSync` -]); -function patchFs(patchedFs, fakeFs) { - fakeFs = new NodePathFS(fakeFs); - const setupFn = (target, name, replacement) => { - const orig = target[name]; - target[name] = replacement; - if (typeof orig?.[nodeUtils.promisify.custom] !== `undefined`) { - replacement[nodeUtils.promisify.custom] = orig[nodeUtils.promisify.custom]; - } - }; - { - setupFn(patchedFs, `exists`, (p, ...args) => { - const hasCallback = typeof args[args.length - 1] === `function`; - const callback = hasCallback ? args.pop() : () => { - }; - process.nextTick(() => { - fakeFs.existsPromise(p).then((exists) => { - callback(exists); - }, () => { - callback(false); - }); - }); - }); - setupFn(patchedFs, `read`, (...args) => { - let [fd, buffer, offset, length, position, callback] = args; - if (args.length <= 3) { - let options = {}; - if (args.length < 3) { - callback = args[1]; - } else { - options = args[1]; - callback = args[2]; - } - ({ - buffer = Buffer.alloc(16384), - offset = 0, - length = buffer.byteLength, - position - } = options); - } - if (offset == null) - offset = 0; - length |= 0; - if (length === 0) { - process.nextTick(() => { - callback(null, 0, buffer); - }); - return; - } - if (position == null) - position = -1; - process.nextTick(() => { - fakeFs.readPromise(fd, buffer, offset, length, position).then((bytesRead) => { - callback(null, bytesRead, buffer); - }, (error) => { - callback(error, 0, buffer); - }); - }); - }); - for (const fnName of ASYNC_IMPLEMENTATIONS) { - const origName = fnName.replace(/Promise$/, ``); - if (typeof patchedFs[origName] === `undefined`) - continue; - const fakeImpl = fakeFs[fnName]; - if (typeof fakeImpl === `undefined`) - continue; - const wrapper = (...args) => { - const hasCallback = typeof args[args.length - 1] === `function`; - const callback = hasCallback ? args.pop() : () => { - }; - process.nextTick(() => { - fakeImpl.apply(fakeFs, args).then((result) => { - callback(null, result); - }, (error) => { - callback(error); - }); - }); - }; - setupFn(patchedFs, origName, wrapper); - } - patchedFs.realpath.native = patchedFs.realpath; - } - { - setupFn(patchedFs, `existsSync`, (p) => { - try { - return fakeFs.existsSync(p); - } catch (error) { - return false; - } - }); - setupFn(patchedFs, `readSync`, (...args) => { - let [fd, buffer, offset, length, position] = args; - if (args.length <= 3) { - const options = args[2] || {}; - ({ offset = 0, length = buffer.byteLength, position } = options); - } - if (offset == null) - offset = 0; - length |= 0; - if (length === 0) - return 0; - if (position == null) - position = -1; - return fakeFs.readSync(fd, buffer, offset, length, position); - }); - for (const fnName of SYNC_IMPLEMENTATIONS) { - const origName = fnName; - if (typeof patchedFs[origName] === `undefined`) - continue; - const fakeImpl = fakeFs[fnName]; - if (typeof fakeImpl === `undefined`) - continue; - setupFn(patchedFs, origName, fakeImpl.bind(fakeFs)); - } - patchedFs.realpathSync.native = patchedFs.realpathSync; - } - { - const patchedFsPromises = patchedFs.promises; - for (const fnName of ASYNC_IMPLEMENTATIONS) { - const origName = fnName.replace(/Promise$/, ``); - if (typeof patchedFsPromises[origName] === `undefined`) - continue; - const fakeImpl = fakeFs[fnName]; - if (typeof fakeImpl === `undefined`) - continue; - if (fnName === `open`) - continue; - setupFn(patchedFsPromises, origName, (pathLike, ...args) => { - if (pathLike instanceof FileHandle) { - return pathLike[origName].apply(pathLike, args); - } else { - return fakeImpl.call(fakeFs, pathLike, ...args); - } - }); - } - setupFn(patchedFsPromises, `open`, async (...args) => { - const fd = await fakeFs.openPromise(...args); - return new FileHandle(fd, fakeFs); - }); - } - { - patchedFs.read[nodeUtils.promisify.custom] = async (fd, buffer, ...args) => { - const res = fakeFs.readPromise(fd, buffer, ...args); - return { bytesRead: await res, buffer }; - }; - patchedFs.write[nodeUtils.promisify.custom] = async (fd, buffer, ...args) => { - const res = fakeFs.writePromise(fd, buffer, ...args); - return { bytesWritten: await res, buffer }; - }; - } -} - -let cachedInstance; -let registeredFactory = () => { - throw new Error(`Assertion failed: No libzip instance is available, and no factory was configured`); -}; -function setFactory(factory) { - registeredFactory = factory; -} -function getInstance() { - if (typeof cachedInstance === `undefined`) - cachedInstance = registeredFactory(); - return cachedInstance; -} - -var libzipSync = {exports: {}}; - -(function (module, exports) { -var frozenFs = Object.assign({}, fs__default.default); -var createModule = function() { - var _scriptDir = void 0; - if (typeof __filename !== "undefined") - _scriptDir = _scriptDir || __filename; - return function(createModule2) { - createModule2 = createModule2 || {}; - var Module = typeof createModule2 !== "undefined" ? createModule2 : {}; - var readyPromiseResolve, readyPromiseReject; - Module["ready"] = new Promise(function(resolve, reject) { - readyPromiseResolve = resolve; - readyPromiseReject = reject; - }); - var moduleOverrides = {}; - var key; - for (key in Module) { - if (Module.hasOwnProperty(key)) { - moduleOverrides[key] = Module[key]; - } - } - var scriptDirectory = ""; - function locateFile(path) { - if (Module["locateFile"]) { - return Module["locateFile"](path, scriptDirectory); - } - return scriptDirectory + path; - } - var read_, readBinary; - var nodeFS; - var nodePath; - { - { - scriptDirectory = __dirname + "/"; - } - read_ = function shell_read(filename, binary) { - var ret = tryParseAsDataURI(filename); - if (ret) { - return binary ? ret : ret.toString(); - } - if (!nodeFS) - nodeFS = frozenFs; - if (!nodePath) - nodePath = path__default.default; - filename = nodePath["normalize"](filename); - return nodeFS["readFileSync"](filename, binary ? null : "utf8"); - }; - readBinary = function readBinary2(filename) { - var ret = read_(filename, true); - if (!ret.buffer) { - ret = new Uint8Array(ret); - } - assert(ret.buffer); - return ret; - }; - if (process["argv"].length > 1) { - process["argv"][1].replace(/\\/g, "/"); - } - process["argv"].slice(2); - Module["inspect"] = function() { - return "[Emscripten Module object]"; - }; - } - Module["print"] || console.log.bind(console); - var err = Module["printErr"] || console.warn.bind(console); - for (key in moduleOverrides) { - if (moduleOverrides.hasOwnProperty(key)) { - Module[key] = moduleOverrides[key]; - } - } - moduleOverrides = null; - if (Module["arguments"]) - ; - if (Module["thisProgram"]) - ; - if (Module["quit"]) - ; - var wasmBinary; - if (Module["wasmBinary"]) - wasmBinary = Module["wasmBinary"]; - Module["noExitRuntime"] || true; - if (typeof WebAssembly !== "object") { - abort("no native wasm support detected"); - } - function getValue(ptr, type, noSafe) { - type = type || "i8"; - if (type.charAt(type.length - 1) === "*") - type = "i32"; - switch (type) { - case "i1": - return HEAP8[ptr >> 0]; - case "i8": - return HEAP8[ptr >> 0]; - case "i16": - return LE_HEAP_LOAD_I16((ptr >> 1) * 2); - case "i32": - return LE_HEAP_LOAD_I32((ptr >> 2) * 4); - case "i64": - return LE_HEAP_LOAD_I32((ptr >> 2) * 4); - case "float": - return LE_HEAP_LOAD_F32((ptr >> 2) * 4); - case "double": - return LE_HEAP_LOAD_F64((ptr >> 3) * 8); - default: - abort("invalid type for getValue: " + type); - } - return null; - } - var wasmMemory; - var ABORT = false; - function assert(condition, text) { - if (!condition) { - abort("Assertion failed: " + text); - } - } - function getCFunc(ident) { - var func = Module["_" + ident]; - assert( - func, - "Cannot call unknown function " + ident + ", make sure it is exported" - ); - return func; - } - function ccall(ident, returnType, argTypes, args, opts) { - var toC = { - string: function(str) { - var ret2 = 0; - if (str !== null && str !== void 0 && str !== 0) { - var len = (str.length << 2) + 1; - ret2 = stackAlloc(len); - stringToUTF8(str, ret2, len); - } - return ret2; - }, - array: function(arr) { - var ret2 = stackAlloc(arr.length); - writeArrayToMemory(arr, ret2); - return ret2; - } - }; - function convertReturnValue(ret2) { - if (returnType === "string") - return UTF8ToString(ret2); - if (returnType === "boolean") - return Boolean(ret2); - return ret2; - } - var func = getCFunc(ident); - var cArgs = []; - var stack = 0; - if (args) { - for (var i = 0; i < args.length; i++) { - var converter = toC[argTypes[i]]; - if (converter) { - if (stack === 0) - stack = stackSave(); - cArgs[i] = converter(args[i]); - } else { - cArgs[i] = args[i]; - } - } - } - var ret = func.apply(null, cArgs); - ret = convertReturnValue(ret); - if (stack !== 0) - stackRestore(stack); - return ret; - } - function cwrap(ident, returnType, argTypes, opts) { - argTypes = argTypes || []; - var numericArgs = argTypes.every(function(type) { - return type === "number"; - }); - var numericRet = returnType !== "string"; - if (numericRet && numericArgs && !opts) { - return getCFunc(ident); - } - return function() { - return ccall(ident, returnType, argTypes, arguments); - }; - } - var UTF8Decoder = new TextDecoder("utf8"); - function UTF8ToString(ptr, maxBytesToRead) { - if (!ptr) - return ""; - var maxPtr = ptr + maxBytesToRead; - for (var end = ptr; !(end >= maxPtr) && HEAPU8[end]; ) - ++end; - return UTF8Decoder.decode(HEAPU8.subarray(ptr, end)); - } - function stringToUTF8Array(str, heap, outIdx, maxBytesToWrite) { - if (!(maxBytesToWrite > 0)) - return 0; - var startIdx = outIdx; - var endIdx = outIdx + maxBytesToWrite - 1; - for (var i = 0; i < str.length; ++i) { - var u = str.charCodeAt(i); - if (u >= 55296 && u <= 57343) { - var u1 = str.charCodeAt(++i); - u = 65536 + ((u & 1023) << 10) | u1 & 1023; - } - if (u <= 127) { - if (outIdx >= endIdx) - break; - heap[outIdx++] = u; - } else if (u <= 2047) { - if (outIdx + 1 >= endIdx) - break; - heap[outIdx++] = 192 | u >> 6; - heap[outIdx++] = 128 | u & 63; - } else if (u <= 65535) { - if (outIdx + 2 >= endIdx) - break; - heap[outIdx++] = 224 | u >> 12; - heap[outIdx++] = 128 | u >> 6 & 63; - heap[outIdx++] = 128 | u & 63; - } else { - if (outIdx + 3 >= endIdx) - break; - heap[outIdx++] = 240 | u >> 18; - heap[outIdx++] = 128 | u >> 12 & 63; - heap[outIdx++] = 128 | u >> 6 & 63; - heap[outIdx++] = 128 | u & 63; - } - } - heap[outIdx] = 0; - return outIdx - startIdx; - } - function stringToUTF8(str, outPtr, maxBytesToWrite) { - return stringToUTF8Array(str, HEAPU8, outPtr, maxBytesToWrite); - } - function lengthBytesUTF8(str) { - var len = 0; - for (var i = 0; i < str.length; ++i) { - var u = str.charCodeAt(i); - if (u >= 55296 && u <= 57343) - u = 65536 + ((u & 1023) << 10) | str.charCodeAt(++i) & 1023; - if (u <= 127) - ++len; - else if (u <= 2047) - len += 2; - else if (u <= 65535) - len += 3; - else - len += 4; - } - return len; - } - function allocateUTF8(str) { - var size = lengthBytesUTF8(str) + 1; - var ret = _malloc(size); - if (ret) - stringToUTF8Array(str, HEAP8, ret, size); - return ret; - } - function writeArrayToMemory(array, buffer2) { - HEAP8.set(array, buffer2); - } - function alignUp(x, multiple) { - if (x % multiple > 0) { - x += multiple - x % multiple; - } - return x; - } - var buffer, HEAP8, HEAPU8; - var HEAP_DATA_VIEW; - function updateGlobalBufferAndViews(buf) { - buffer = buf; - Module["HEAP_DATA_VIEW"] = HEAP_DATA_VIEW = new DataView(buf); - Module["HEAP8"] = HEAP8 = new Int8Array(buf); - Module["HEAP16"] = new Int16Array(buf); - Module["HEAP32"] = new Int32Array(buf); - Module["HEAPU8"] = HEAPU8 = new Uint8Array(buf); - Module["HEAPU16"] = new Uint16Array(buf); - Module["HEAPU32"] = new Uint32Array(buf); - Module["HEAPF32"] = new Float32Array(buf); - Module["HEAPF64"] = new Float64Array(buf); - } - Module["INITIAL_MEMORY"] || 16777216; - var wasmTable; - var __ATPRERUN__ = []; - var __ATINIT__ = []; - var __ATPOSTRUN__ = []; - function preRun() { - if (Module["preRun"]) { - if (typeof Module["preRun"] == "function") - Module["preRun"] = [Module["preRun"]]; - while (Module["preRun"].length) { - addOnPreRun(Module["preRun"].shift()); - } - } - callRuntimeCallbacks(__ATPRERUN__); - } - function initRuntime() { - callRuntimeCallbacks(__ATINIT__); - } - function postRun() { - if (Module["postRun"]) { - if (typeof Module["postRun"] == "function") - Module["postRun"] = [Module["postRun"]]; - while (Module["postRun"].length) { - addOnPostRun(Module["postRun"].shift()); - } - } - callRuntimeCallbacks(__ATPOSTRUN__); - } - function addOnPreRun(cb) { - __ATPRERUN__.unshift(cb); - } - function addOnInit(cb) { - __ATINIT__.unshift(cb); - } - function addOnPostRun(cb) { - __ATPOSTRUN__.unshift(cb); - } - var runDependencies = 0; - var dependenciesFulfilled = null; - function addRunDependency(id) { - runDependencies++; - if (Module["monitorRunDependencies"]) { - Module["monitorRunDependencies"](runDependencies); - } - } - function removeRunDependency(id) { - runDependencies--; - if (Module["monitorRunDependencies"]) { - Module["monitorRunDependencies"](runDependencies); - } - if (runDependencies == 0) { - if (dependenciesFulfilled) { - var callback = dependenciesFulfilled; - dependenciesFulfilled = null; - callback(); - } - } - } - Module["preloadedImages"] = {}; - Module["preloadedAudios"] = {}; - function abort(what) { - if (Module["onAbort"]) { - Module["onAbort"](what); - } - what += ""; - err(what); - ABORT = true; - what = "abort(" + what + "). Build with -s ASSERTIONS=1 for more info."; - var e = new WebAssembly.RuntimeError(what); - readyPromiseReject(e); - throw e; - } - var dataURIPrefix = "data:application/octet-stream;base64,"; - function isDataURI(filename) { - return filename.startsWith(dataURIPrefix); - } - var wasmBinaryFile = "data:application/octet-stream;base64,AGFzbQEAAAAB/wEkYAN/f38Bf2ABfwF/YAJ/fwF/YAF/AGAEf39/fwF/YAN/f38AYAV/f39/fwF/YAJ/fwBgBH9/f38AYAABf2AFf39/fn8BfmAEf35/fwF/YAR/f35/AX5gAn9+AX9gA398fwBgA39/fgF/YAF/AX5gBn9/f39/fwF/YAN/fn8Bf2AEf39/fwF+YAV/f35/fwF/YAR/f35/AX9gA39/fgF+YAJ/fgBgAn9/AX5gBX9/f39/AGADf35/AX5gBX5+f35/AX5gA39/fwF+YAZ/fH9/f38Bf2AAAGAHf35/f39+fwF/YAV/fn9/fwF/YAV/f39/fwF+YAJ+fwF/YAJ/fAACJQYBYQFhAAMBYQFiAAEBYQFjAAABYQFkAAEBYQFlAAIBYQFmAAED5wHlAQMAAwEDAwEHDAgDFgcNEgEDDRcFAQ8DEAUQAwIBAhgECxkEAQMBBQsFAwMDARACBAMAAggLBwEAAwADGgQDGwYGABwBBgMTFBEHBwcVCx4ABAgHBAICAgAfAQICAgIGFSAAIQAiAAIBBgIHAg0LEw0FAQUCACMDAQAUAAAGBQECBQUDCwsSAgEDBQIHAQEICAACCQQEAQABCAEBCQoBAwkBAQEBBgEGBgYABAIEBAQGEQQEAAARAAEDCQEJAQAJCQkBAQECCgoAAAMPAQEBAwACAgICBQIABwAKBgwHAAADAgICBQEEBQFwAT8/BQcBAYACgIACBgkBfwFBgInBAgsH+g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LQYSEAUEwNgIAQX8LNwAgAEJ/NwMQIABBADYCCCAAQgA3AwAgAEEANgIwIABC/////w83AyggAEIANwMYIABCADcDIAulAQEBf0HYABAJIgFFBEBBAA8LAkAgAARAIAEgAEHYABAHGgwBCyABQgA3AyAgAUEANgIYIAFC/////w83AxAgAUEAOwEMIAFBv4YoNgIIIAFBAToABiABQQA6AAQgAUIANwNIIAFBgIDYjXg2AkQgAUIANwMoIAFCADcDMCABQgA3AzggAUFAa0EAOwEAIAFCADcDUAsgAUEBOgAFIAFBADYCACABC1gCAn4BfwJAAkAgAC0AAEUNACAAKQMQIgMgAq18IgQgA1QNACAEIAApAwhYDQELIABBADoAAA8LIAAoAgQiBUUEQA8LIAAgBDcDECAFIAOnaiABIAIQBxoLlgEBAn8CQAJAIAJFBEAgAacQCSIFRQ0BQRgQCSIEDQIgBRAGDAELIAIhBUEYEAkiBA0BCyADBEAgA0EANgIEIANBDjYCAAtBAA8LIARCADcDECAEIAE3AwggBCAFNgIEIARBAToAACAEIAJFOgABIAAgBSABIAMQZUEASAR/IAQtAAEEQCAEKAIEEAYLIAQQBkEABSAECwubAgEDfyAALQAAQSBxRQRAAkAgASEDAkAgAiAAIgEoAhAiAAR/IAAFAn8gASABLQBKIgBBAWsgAHI6AEogASgCACIAQQhxBEAgASAAQSByNgIAQX8MAQsgAUIANwIEIAEgASgCLCIANgIcIAEgADYCFCABIAAgASgCMGo2AhBBAAsNASABKAIQCyABKAIUIgVrSwRAIAEgAyACIAEoAiQRAAAaDAILAn8gASwAS0F/SgRAIAIhAANAIAIgACIERQ0CGiADIARBAWsiAGotAABBCkcNAAsgASADIAQgASgCJBEAACAESQ0CIAMgBGohAyABKAIUIQUgAiAEawwBCyACCyEAIAUgAyAAEAcaIAEgASgCFCAAajYCFAsLCwvNBQEGfyAAKAIwIgNBhgJrIQYgACgCPCECIAMhAQNAIAAoAkQgAiAAKAJoIgRqayECIAEgBmogBE0EQCAAKAJIIgEgASADaiADEAcaAkAgAyAAKAJsIgFNBEAgACABIANrNgJsDAELIABCADcCbAsgACAAKAJoIANrIgE2AmggACAAKAJYIANrNgJYIAEgACgChC5JBEAgACABNgKELgsgAEH8gAEoAgARAwAgAiADaiECCwJAIAAoAgAiASgCBCIERQ0AIAAoAjwhBSAAIAIgBCACIARJGyICBH8gACgCSCAAKAJoaiAFaiEFIAEgBCACazYCBAJAAkACQAJAIAEoAhwiBCgCFEEBaw4CAQACCyAEQaABaiAFIAEoAgAgAkHcgAEoAgARCAAMAgsgASABKAIwIAUgASgCACACQcSAASgCABEEADYCMAwBCyAFIAEoAgAgAhAHGgsgASABKAIAIAJqNgIAIAEgASgCCCACajYCCCAAKAI8BSAFCyACaiICNgI8AkAgACgChC4iASACakEDSQ0AIAAoAmggAWshAQJAIAAoAnRBgQhPBEAgACAAIAAoAkggAWoiAi0AACACLQABIAAoAnwRAAA2AlQMAQsgAUUNACAAIAFBAWsgACgChAERAgAaCyAAKAKELiAAKAI8IgJBAUZrIgRFDQAgACABIAQgACgCgAERBQAgACAAKAKELiAEazYChC4gACgCPCECCyACQYUCSw0AIAAoAgAoAgRFDQAgACgCMCEBDAELCwJAIAAoAkQiAiAAKAJAIgNNDQAgAAJ/IAAoAjwgACgCaGoiASADSwRAIAAoAkggAWpBACACIAFrIgNBggIgA0GCAkkbIgMQGSABIANqDAELIAFBggJqIgEgA00NASAAKAJIIANqQQAgAiADayICIAEgA2siAyACIANJGyIDEBkgACgCQCADags2AkALC50CAQF/AkAgAAJ/IAAoAqAuIgFBwABGBEAgACgCBCAAKAIQaiAAKQOYLjcAACAAQgA3A5guIAAgACgCEEEIajYCEEEADAELIAFBIE4EQCAAKAIEIAAoAhBqIAApA5guPgAAIAAgAEGcLmo1AgA3A5guIAAgACgCEEEEajYCECAAIAAoAqAuQSBrIgE2AqAuCyABQRBOBEAgACgCBCAAKAIQaiAAKQOYLj0AACAAIAAoAhBBAmo2AhAgACAAKQOYLkIQiDcDmC4gACAAKAKgLkEQayIBNgKgLgsgAUEISA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RAIANBADYCBCADQRI2AgALCyAEC7UBAQJ/AkACQAJAAkACQAJAAkAgAC0ABQRAIAAtAABBAnFFDQELIAAoAjAQECAAQQA2AjAgAC0ABUUNAQsgAC0AAEEIcUUNAQsgACgCNBAcIABBADYCNCAALQAFRQ0BCyAALQAAQQRxRQ0BCyAAKAI4EBAgAEEANgI4IAAtAAVFDQELIAAtAABBgAFxRQ0BCyAAKAJUIgEEfyABQQAgARAiEBkgACgCVAVBAAsQBiAAQQA2AlQLC9wMAgl/AX4jAEFAaiIGJAACQAJAAkACQAJAIAEoAjBBABAjIgVBAkZBACABKAI4QQAQIyIEQQFGGw0AIAVBAUZBACAEQQJGGw0AIAVBAkciAw0BIARBAkcNAQsgASABLwEMQYAQcjsBDEEAIQMMAQsgASABLwEMQf/vA3E7AQxBACEFIANFBEBB9eABIAEoAjAgAEEIahBpIgVFDQILIAJBgAJxBEAgBSEDDAELIARBAkcEQCAFIQMMAQtB9cYBIAEoAjggAEEIahBpIgNFBEAgBRAcDAILIAMgBTYCAAsgASABLwEMQf7/A3EgAS8BUiIFQQBHcjsBDAJAAkACQAJAAn8CQAJAIAEpAyhC/v///w9WDQAgASkDIEL+////D1YNACACQYAEcUUNASABKQNIQv////8PVA0BCyAFQYECa0H//wNxQQNJIQdBAQwBCyAFQYECa0H//wNxIQQgAkGACnFBgApHDQEgBEEDSSEHQQALIQkgBkIcEBciBEUEQCAAQQhqIgAEQCAAQQA2AgQgAEEONgIACyADEBwMBQsgAkGACHEhBQJAAkAgAkGAAnEEQAJAIAUNACABKQMgQv////8PVg0AIAEpAyhCgICAgBBUDQMLIAQgASkDKBAYIAEpAyAhDAwBCwJAAkACQCAFDQAgASkDIEL/////D1YNACABKQMoIgxC/////w9WDQEgASkDSEKAgICAEFQNBAsgASkDKCIMQv////8PVA0BCyAEIAwQGAsgASkDICIMQv////8PWgRAIAQgDBAYCyABKQNIIgxC/////w9UDQELIAQgDBAYCyAELQAARQRAIABBCGoiAARAIABBADYCBCAAQRQ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42AhggASECDAcLIB1BfyAGdEF/c62DIBt8IhunIQUgCCAEQQ9xIgNrIQggGiAErUIPg4ghHSABIBdrIgYgAjMBAiAaQX8gA3RBf3Otg3ynIgRPDQIgBCAGayIGIBlNDQEgBygCjEdFDQEgB0HR/gA2AgQgAEG5DDYCGAsgASECIAshBQwFCwJAIA5FBEAgDCARIAZraiEDDAELIAYgDk0EQCAMIA4gBmtqIQMMAQsgDCARIAYgDmsiBmtqIQMgBSAGTQ0AIAUgBmshBQJAAkAgASADTSABIA8gAWusIhogBq0iGyAaIBtUGyIapyIGaiICIANLcQ0AIAMgBmogAUsgASADT3ENACABIAMgBhAHGiACIQEMAQsgASADIAMgAWsiASABQR91IgFqIAFzIgIQByACaiEBIBogAq0iHn0iHFANACACIANqIQIDQAJAIBwgHiAcIB5UGyIbQiBUBEAgGyEaDAELIBsiGkIgfSIgQgWIQgF8QgODIh9QRQRAA0AgASACKQAANwAAIAEgAikAGDcAGCABIAIpABA3ABAgASACKQAINwAIIBpCIH0hGiACQSBqIQIgAUEgaiEBIB9CAX0iH0IAUg0ACwsgIELgAFQNAANAIAEgAikAADcAACABIAIpABg3ABggASACKQAQNwAQIAEgAikACDcACCABIAIpADg3ADggASACKQAwNwAwIAEgAikAKDcAKCABIAIpACA3ACAgASACKQBYNwBYIAEgAikAUDcAUCABIAIpAEg3AEggASACKQBANwBAIAEgAikAYDcAYCABIAIpAGg3AGggASACKQBwNwBwIAEgAikAeDcAeCACQYABaiECIAFBgAFqIQEgGkKAAX0iGkIfVg0ACwsgGkIQWgRAIAEgAikAADcAACABIAIpAAg3AAggGkIQfSEaIAJBEGohAiABQRBqIQELIBpCCFoEQCABIAIpAAA3AAAgGkIIfSEaIAJBCGohAiABQQhqIQELIBpCBFoEQCABIAIoAAA2AAAgGkIEfSEaIAJBBGohAiABQQRqIQELIBpCAloEQCABIAIvAAA7AAAgGkICfSEaIAJBAmohAiABQQJqIQELIBwgG30hHCAaUEUEQCABIAItAAA6AAAgAkEBaiEC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QbIhqnIgFIIAVBf0pxDQAgBUEBSCABIARqIAJLcQ0AIAIgBCABEAcgAWohAgwDCyACIAQgAyADQR91IgFqIAFzIgEQByABaiECIBogAa0iHn0iHFANAiABIARqIQEDQAJAIBwgHiAcIB5UGyIbQiBUBEAgGyEaDAELIBsiGkIgfSIgQgWIQgF8QgODIh9QRQRAA0AgAiABKQAANwAAIAIgASkAGDcAGCACIAEpABA3ABAgAiABKQAINwAIIBpCIH0hGiABQSBqIQEgAkEgaiECIB9CAX0iH0IAUg0ACwsgIELgAFQNAANAIAIgASkAADcAACACIAEpABg3ABggAiABKQAQNwAQIAIgASkACDcACCACIAEpADg3ADggAiABKQAwNwAwIAIgASkAKDcAKCACIAEpACA3ACAgAiABKQBYNwBYIAIgASkAUDcAUCACIAEpAEg3AEggAiABKQBANwBAIAIgASkAYDcAYCACIAEpAGg3AGggAiABKQBwNwBwIAIgASkAeDcAeCABQYABaiEBIAJBgAFqIQIgGkKAAX0iGkIfVg0ACwsgGkIQWgRAIAIgASkAADcAACACIAEpAAg3AAggGkIQfSEaIAJBEGohAiABQRBqIQELIBpCCFoEQCACIAEpAAA3AAAgGkIIfSEaIAJBCGohAiABQQhqIQELIBpCBFoEQCACIAEoAAA2AAAgGkIEfSEaIAJBBGohAiABQQRqIQELIBpCAloEQCACIAEvAAA7AAAgGkICfSEaIAJBAmohAiABQQJqIQELIBwgG30hHCAaUEUEQCACIAEtAAA6AAAgAkEBaiECIAFBAWohAQsgHFBFDQALDAILAkAgASADTSABIA8gAWusIhogBa0iGyAaIBtUGyIapyIEaiICIANLcQ0AIAMgBGogAUsgASADT3ENACABIAMgBBAHGgwCCyABIAMgAyABayIBIAFBH3UiAWogAXMiARAHIAFqIQIgGiABrSIefSIcUA0BIAEgA2ohAQNAAkAgHCAeIBwgHlQbIhtCIFQEQCAbIRoMAQsgGyIaQiB9IiBCBYhCAXxCA4MiH1BFBEADQCACIAEpAAA3AAAgAiABKQAYNwAYIAIgASkAEDcAECACIAEpAAg3AAggGkIgfSEaIAFBIGohASACQSBqIQIgH0IBfSIfQgBSDQALCyAgQuAAVA0AA0AgAiABKQAANwAAIAIgASkAGDcAGCACIAEpABA3ABAgAiABKQAINwAIIAIgASkAODcAOCACIAEpADA3ADAgAiABKQAoNwAoIAIgASkAIDcAICACIAEpAFg3AFggAiABKQBQNwBQIAIgASkASDcASCACIAEpAEA3AEAgAiABKQBgNwBgIAIgASkAaDcAaCACIAEpAHA3AHAgAiABKQB4NwB4IAFBgAFqIQEgAkGAAWohAiAaQoABfSIaQh9WDQALCyAaQhBaBEAgAiABKQAANwAAIAIgASkACDcACCAaQhB9IRogAkEQaiECIAFBEGohAQsgGkIIWgRAIAIgASkAADcAACAaQgh9IRogAkEIaiECIAFBCGohAQsgGkIEWgRAIAIgASgAADYAACAaQgR9IRogAkEEaiECIAFBBGohAQsgGkICWgRAIAIgAS8AADsAACAaQgJ9IRogAkECaiECIAFBAmohAQsgHCAbfSEcIBpQRQRAIAIgAS0AADoAACACQQFqIQIgAUEBaiEBCyAcUEUNAAsMAQsCQAJAIBYEQAJAIAQgBUkEQCAHKAKYRyAESw0BCyABIARrIQMCQEEAIARrIgVBf0ogDyABa6wiGiAbIBogG1QbIhqnIgIgBUpxDQAgBUEBSCACIANqIAFLcQ0AIAEgAyACEAcgAmohAgwFCyABIAMgBCAEQR91IgFqIAFzIgEQByABaiECIBogAa0iHn0iHFANBCABIANqIQEDQAJAIBwgHiAcIB5UGyIbQiBUBEAgGyEaDAELIBsiGkIgfSIgQgWIQgF8QgODIh9QRQRAA0AgAiABKQAANwAAIAIgASkAGDcAGCACIAEpABA3ABAgAiABKQAINwAIIBpCIH0hGiABQSBqIQEgAkEgaiECIB9CAX0iH0IAUg0ACwsgIELgAFQNAANAIAIgASkAADcAACACIAEpABg3ABggAiABKQAQNwAQIAIgASkACDcACCACIAEpADg3ADggAiABKQAwNwAwIAIgASkAKDcAKCACIAEpACA3ACAgAiABKQBYNwBYIAIgASkAUDcAUCACIAEpAEg3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AByAJQQdrIQYgA0EIayEDIAFBCGohASACQQFqIQIMBgsgCiEBIAUhAwwFCyAKIQEgBSEDDAQLIAohASAFIQMMAwsgCiEBIAUhAwwCCyAKIQEgBSEDDAELIAohASAFIQMLAkACQCAGQRdNBEAgA0UNASADQQFrIQUgA0EHcSIEBEADQCABIAItAAA6AAAgA0EBayEDIAFBAWohASACQQFqIQIgBEEBayIEDQALCyAFQQdJDQEDQCABIAItAAA6AAAgASACLQABOgABIAEgAi0AAjoAAiABIAItAAM6AAMgASACLQAEOgAEIAEgAi0ABToABSABIAItAAY6AAYgASACLQAHOgAHIAFBCGohASACQQhqIQIgA0EIayIDDQALDAELIAMNAQsgASECDAELIAEgBCADED8hAgsgCyEFDAELIAEgAy0AAjoAACABQQFqIQILIAUgFE8NACACIBNJDQELCyAAIAI2AgwgACAFIAhBA3ZrIgE2AgAgACATIAJrQYMCajYCECAAIBQgAWtBDmo2AgQgByAIQQdxIgA2AogBIAcgHUJ/IACthkJ/hYM+AoQBC+cFAQR/IAMgAiACIANLGyEEIAAgAWshAgJAIABBB3FFDQAgBEUNACAAIAItAAA6AAAgA0EBayEGIAJBAWohAiAAQQFqIgdBB3FBACAEQQFrIgUbRQRAIAchACAFIQQgBiEDDAELIAAgAi0AADoAASADQQJrIQYgBEECayEFIAJBAWohAgJAIABBAmoiB0EHcUUNACAFRQ0AIAAgAi0AADoAAiADQQNrIQYgBEEDayEFIAJBAWohAgJAIABBA2oiB0EHcUUNACAFRQ0AIAAgAi0AADoAAyADQQRrIQYgBEEEayEFIAJBAWohAgJAIABBBGoiB0EHcUUNACAFRQ0AIAAgAi0AADoABCADQQVrIQYgBEEFayEFIAJBAWohAgJAIABBBWoiB0EHcUUNACAFRQ0AIAAgAi0AADoABSADQQZrIQYgBEEGayEFIAJBAWohAgJAIABBBmoiB0EHcUUNACAFRQ0AIAAgAi0AADoABiADQQdrIQYgBEEHayEFIAJBAWohAgJAIABBB2oiB0EHcUUNACAFRQ0AIAAgAi0AADoABy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QvgAQICfwF+QTAQCSICRQRAIAEEQCABQQA2AgQgAUEONgIAC0EADwsgAkIANwMIIAJBADYCACACQgA3AxAgAkIANwMYIAJCADcDICACQgA3ACUgAFAEQCACDwsCQCAAQv////8AVg0AIACnQQR0EAkiA0UNACACIAM2AgBBACEBQgEhBANAIAMgAUEEdGoiAUIANwIAIAFCADcABSAAIARSBEAgBKchASAEQgF8IQQMAQsLIAIgADcDCCACIAA3AxAgAg8LIAEEQCABQQA2AgQgAUEONgIAC0EAEBAgAhAGQQAL7gECA38BfiMAQRBrIgQkAAJAIARBDGpCBBAXIgNFBEBBfyECDAELAkAgAQRAIAJBgAZxIQUDQAJAIAUgASgCBHFFDQACQCADKQMIQgBUBEAgA0EAOgAADAELIANCADcDECADQQE6AAALIAMgAS8BCBANIAMgAS8BChANIAMtAABFBEAgAEEIaiIABEAgAEEANgIEIABBFDYCAAtBfyECDAQLQX8hAiAAIARBDGpCBBAbQQBIDQMgATMBCiIGUA0AIAAgASgCDCAGEBtBAEgNAwsgASgCACIBDQALC0EAIQILIAMQCAsgBEEQaiQAIAILPAEBfyAABEAgAUGABnEhAQNAIAEgACgCBHEEQCACIAAvAQpqQQRqIQILIAAoAgAiAA0ACwsgAkH//wNxC5wBAQN/IABFBEBBAA8LIAAhAwNAAn8CQAJAIAAvAQgiAUH04AFNBEAgAUEBRg0BIAFB9cYBRg0BDAILIAFBgbICRg0AIAFB9eABRw0BCyAAKAIAIQEgAEEANgIAIAAoAgwQBiAAEAYgASADIAAgA0YbIQMCQCACRQRAQQAhAgwBCyACIAE2AgALIAEMAQsgACICKAIACyIADQALIAMLsgQCBX8BfgJAAkACQCAAIAGtEBciAQRAIAEtAAANAUEAIQAMAgsgBARAIARBADYCBCAEQQ42AgALQQAPC0EAIQADQCABLQAABH4gASkDCCABKQMQfQVCAAtCBFQNASABEAwhByABIAEQDCIGrRATIghFBEBBACECIAQEQCAEQQA2AgQgBEEVNgIACyABEAggAEUNAwNAIAAoAgAhASAAKAIMEA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ADYCBCAAQRI2AgALQX8MAQsgAkEANgIIIAIgATcDACAAIAJCEEEMEA5CP4enCyEAIAJBEGokACAAC9oDAQZ/IwBBEGsiBSQAIAUgAjYCDCMAQaABayIEJAAgBEEIakHA8ABBkAEQBxogBCAANgI0IAQgADYCHCAEQX4gAGsiA0H/////ByADQf////8HSRsiBjYCOCAEIAAgBmoiADYCJCAEIAA2AhggBEEIaiEAIwBB0AFrIgMkACADIAI2AswBIANBoAFqQQBBKBAZIAMgAygCzAE2AsgBAkBBACABIANByAFqIANB0ABqIANBoAFqEEpBAEgNACAAKAJMQQBOIQcgACgCACECIAAsAEpBAEwEQCAAIAJBX3E2AgALIAJBIHEhCAJ/IAAoAjAEQCAAIAEgA0HIAWogA0HQAGogA0GgAWoQSgwBCyAAQdAANgIwIAAgA0HQAGo2AhAgACADNgIcIAAgAzYCFCAAKAIsIQIgACADNgIsIAAgASADQcgBaiADQdAAaiADQaABahBKIAJFDQAaIABBAEEAIAAoAiQRAAAaIABBADYCMCAAIAI2AiwgAEEANgIcIABBADYCECAAKAIUGiAAQQA2AhRBAAsaIAAgACgCACAIcjYCACAHRQ0ACyADQdABaiQAIAYEQCAEKAIcIgAgACAEKAIYRmtBADoAAAsgBEGgAWokACAFQRBqJAALUwEDfwJAIAAoAgAsAABBMGtBCk8NAANAIAAoAgAiAiwAACEDIAAgAkEBajYCACABIANqQTBrIQEgAiwAAUEwa0EKTw0BIAFBCmwhAQwACwALIAELuwIAAkAgAUEUSw0AAkACQAJAAkACQAJAAkACQAJAAkAgAUEJaw4KAAECAwQFBgcICQoLIAIgAigCACIBQQRqNgIAIAAgASgCADYCAA8LIAIgAigCACIBQQRqNgIAIAAgATQCADcDAA8LIAIgAigCACIBQQRqNgIAIAAgATUCADcDAA8LIAIgAigCAEEHakF4cSIBQQhqNgIAIAAgASkDADcDAA8LIAIgAigCACIBQQRqNgIAIAAgATIBADcDAA8LIAIgAigCACIBQQRqNgIAIAAgATMBADcDAA8LIAIgAigCACIBQQR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CEDYCDAsMAgsgEULiABAXIgZFBEAgAEEIagRAIABBADYCDCAAQQ42AggLDAILIBggFX0hEyAVQv////8PViAUQv//A1ZyIApyQQFxBEAgBkGZEkEEECwgBkIsEBggBkEtEA0gBkEtEA0gBkEAEBIgBkEAEBIgBiAUEBggBiAUEBggBiATEBggBiAVEBggBkGUEkEEECwgBkEAEBIgBiAYEBggBkEBEBILIAZBnhJBBBAsIAZBABASIAYgFEL//wMgFEL//wNUG6dB//8DcSIBEA0gBiABEA0gBkF/IBOnIBNC/v///w9WGxASIAZBfyAVpyAVQv7///8PVhsQEiAGIABBJEEgIAAtACgbaigCACIDBH8gAy8BBAVBAAtB//8DcRANIAYtAABFBEAgAEEIagRAIABBADYCDCAAQRQ2AggLIAYQCAwCCyAAIAYoAgQgBi0AAAR+IAYpAxAFQgALEBshASAGEAggAUEASA0BIAMEQCAAIAMoAgAgAzMBBBAbQQBIDQILIBMhFwwBCyAAKAIAIQEgAEEIagRAIAAgASgCDDYCCCAAIAEoAhA2AgwLQn8hFwsgEUHwAGokACAXQgBTDQAgACgCABAfQj+HpyECCyALEAYgAkEASA0BAn8gACgCACIBKAIkQQFHBEAgAUEMagRAIAFBADYCECABQRI2AgwLQX8MAQsgASgCICICQQJPBEAgAUEMagRAIAFBADYCECABQR02AgwLQX8MAQsCQCACQQFHDQAgARAaQQBODQBBfwwBCyABQQBCAEEJEA5Cf1cEQCABQQI2AiRBfwwBCyABQQA2AiRBAAtFDQIgACgCACECIAQEQCAEIAIoAgw2AgAgBCACKAIQNgIECwwBCyALEAYLIAAoAlQQfCAAKAIAEENBfyECDAILIAAoAlQQfAsgABBLQQAhAgsgB0HAwABqJAAgAgtFAEHwgwFCADcDAEHogwFCADcDAEHggwFCADcDAEHYgwFCADcDAEHQgwFCADcDAEHIgwFCADcDAEHAgwFCADcDAEHAgwELoQMBCH8jAEGgAWsiAiQAIAAQMQJAAn8CQCAAKAIAIgFBAE4EQCABQbATKAIASA0BCyACIAE2AhAgAkEgakH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ADKAIEIAlqIgFFDQAaIAYgASAEIAlrQdSAASgCABEAAAs2AjALIAUoAhwiBhAwAkAgBSgCECIEIAYoAhAiASABIARLGyIBRQ0AIAUoAgwgBigCCCABEAcaIAUgBSgCDCABajYCDCAGIAYoAgggAWo2AgggBSAFKAIUIAFqNgIUIAUgBSgCECABazYCECAGIAYoAhAgAWsiATYCECABDQAgBiAGKAIENgIIC0EAIQRBACEJIAMoAhBFDQAMCgsgAygCHCgCJCEGIAMgAygCGCIBQQFqNgIYIAEgBmotAAAhASADIARBAWo2AhAgAygCBCAEaiABOgAAIAEEQCADKAIQIQQMAQsLIAMoAhwoAixFDQAgAygCECIGIAlNDQAgBQJ/IAUoAjAhBEEAIAMoAgQgCWoiAUUNABogBCABIAYgCWtB1IABKAIAEQAACzYCMAsgA0HnADYCIAsCQCADKAIcKAIsBEAgAygCDCADKAIQIgFBAmpJBH8gBRAKIAMoAhANAkEABSABCyADKAIEaiAFKAIwOwAAIAMgAygCEEECajYCECADQaABakHkgAEoAgARAQAaCyADQfEANgIgIAUQCiADKAIQRQ0BDAcLDAYLIAUoAgQNAQsgAygCPA0AIApFDQEgAygCIEGaBUYNAQsCfyADKAKIASIBRQRAIAMgChCFAQwBCwJAAkACQCADKAKMAUECaw4CAAECCwJ/AkADQAJAAkAgAygCPA0AIAMQLyADKAI8DQAgCg0BQQAMBAsgAygCSCADKAJoai0AACEEIAMgAygC8C0iAUEBajYC8C0gASADKALsLWpBADoAACADIAMoAvAtIgFBAWo2AvAtIAEgAygC7C1qQQA6AAAgAyADKALwLSIBQQFqNgLwLSABIAMoAuwtaiAEOgAAIAMgBEECdGoiASABLwHkAUEBajsB5AEgAyADKAI8QQFrNgI8IAMgAygCaEEBaiIBNgJoIAMoAvAtIAMoAvQtRw0BQQAhBCADIAMoAlgiBkEATgR/IAMoAkggBmoFQQALIAEgBmtBABAPIAMgAygCaDYCWCADKAIAEAogAygCACgCEA0BDAILCyADQQA2AoQuIApBBEYEQCADIAMoAlgiAUE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AABBAnRqQdgTaiIBIAEvAQBBAWo7AQAgAyADKAI8IARrNgI8IAMgAygCaCAEaiIENgJoCyADKALwLSADKAL0LUcNAUEAIQggAyADKAJYIgFBAE4EfyADKAJIIAFqBUEACyAEIAFrQQAQDyADIAMoAmg2AlggAygCABAKIAMoAgAoAhANAQwCCwsgA0EANgKELiAKQQRGBEAgAyADKAJYIgFBAE4EfyADKAJIIAFqBUEACyADKAJoIAFrQQEQDyADIAMoAmg2AlggAygCABAKQQNBAiADKAIAKAIQGwwCCyADKALwLQRAQQAhCCADIAMoAlgiAUEATgR/IAMoAkggAWoFQQALIAMoAmggAWtBABAPIAMgAygCaDYCWCADKAIAEAogAygCACgCEEUNAQtBASEICyAICwwBCyADIAogAUEMbEG42ABqKAIAEQIACyIBQX5xQQJGBEAgA0GaBTYCIAsgAUF9cUUEQEEAIQQgBSgCEA0CDAQLIAFBAUcNAAJAAkACQCAKQQFrDgUAAQEBAgELIAMpA5guISICfwJ+IAMoAqAuIgFBA2oiCUE/TQRAQgIgAa2GICKEDAELIAFBwABGBEAgAygCBCADKAIQaiAiNwAAIAMgAygCEEEIajYCEEICISJBCgwCCyADKAIEIAMoAhBqQgIgAa2GICKENwAAIAMgAygCEEEIajYCECABQT1rIQlCAkHAACABa62ICyEiIAlBB2ogCUE5SQ0AGiADKAIEIAMoAhBqICI3AAAgAyADKAIQQQhqNgIQQgAhIiAJQTlrCyEBIAMgIjcDmC4gAyABNgKgLiADEDAMAQsgA0EAQQBBABA5IApBA0cNACADKAJQQQBBgIAIEBkgAygCPA0AIANBADYChC4gA0EANgJYIANBADYCaAsgBRAKIAUoAhANAAwDC0EAIQQgCkEERw0AAkACfwJAAkAgAygCFEEBaw4CAQADCyAFIANBoAFqQeCAASgCABEBACIBNgIwIAMoAgQgAygCEGogATYAACADIAMoAhBBBGoiATYCECADKAIEIAFqIQQgBSgCCAwBCyADKAIEIAMoAhBqIQQgBSgCMCIBQRh0IAFBCHRBgID8B3FyIAFBCHZBgP4Dc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oIgM2AkwgA0EAIAEoAjBBAXQQGSACKAIgIAIoAihBgIAEQQIQKCEDIAFBgIACNgLoLSABQQA2AkAgASADNgJQIAEgAigCICACKAIoQYCAAkEEECgiAzYCBCABIAEoAugtIgRBAnQ2AgwCQAJAIAEoAkhFDQAgASgCTEUNACABKAJQRQ0AIAMNAQsgAUGaBTYCICACQejAACgCADYCGCACEIQBGkF8DAILIAFBADYCjAEgASAFNgKIASABQgA3AyggASADIARqNgLsLSABIARBA2xBA2s2AvQtQX4hAwJAIAJFDQAgAigCIEUNACACKAIkRQ0AIAIoAhwiAUUNACABKAIAIAJHDQACQAJAIAEoAiAiBEE5aw45AQICAgICAgICAgICAQICAgECAgICAgICAgICAgICAgICAgECAgICAgICAgICAgECAgICAgICAgIBAAsgBEGaBUYNACAEQSpHDQELIAJBAjYCLCACQQA2AgggAkIANwIUIAFBADYCECABIAEoAgQ2AgggASgCFCIDQX9MBEAgAUEAIANrIgM2AhQLIAFBOUEqIANBAkYbNgIgIAIgA0ECRgR/IAFBoAFqQeSAASgCABEBAAVBAQs2AjAgAUF+NgIkIAFBADYCoC4gAUIANwOYLiABQYgXakGg0wA2AgAgASABQcwVajYCgBcgAUH8FmpBjNMANgIAIAEgAUHYE2o2AvQWIAFB8BZqQfjSADYCACABIAFB5AFqNgLoFiABEIgBQQAhAwsgAw0AIAIoAhwiAiACKAIwQQF0NgJEQQAhAyACKAJQQQBBgIAIEBkgAiACKAKIASIEQQxsIgFBtNgAai8BADYClAEgAiABQbDYAGovAQA2ApABIAIgAUGy2ABqLwEANgJ4IAIgAUG22ABqLwEANgJ0QfiAASgCACEFQeyAASgCACEGQYCBASgCACEBIAJCADcCbCACQgA3AmQgAkEANgI8IAJBADYChC4gAkIANwJUIAJBKSABIARBCUYiARs2AnwgAkEqIAYgARs2AoABIAJBKyAFIAEbNgKEAQsgAwsFQXoLDAELAn9BekHrDC0AAEExRw0AGkF+IAJFDQAaIAJBADYCGCACKAIgIgNFBEAgAkEANgIoIAJB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AA4AAAAOQAAADIAAAAzAAAANAAAADUAAAA2AAAANwAAADgAQfSCAQsCXEQAQbCDAQsQ/////////////////////w=="; - if (!isDataURI(wasmBinaryFile)) { - wasmBinaryFile = locateFile(wasmBinaryFile); - } - function getBinary(file) { - try { - if (file == wasmBinaryFile && wasmBinary) { - return new Uint8Array(wasmBinary); - } - var binary = tryParseAsDataURI(file); - if (binary) { - return binary; - } - if (readBinary) { - return readBinary(file); - } else { - throw "sync fetching of the wasm failed: you can preload it to Module['wasmBinary'] manually, or emcc.py will do that for you when generating HTML (but not JS)"; - } - } catch (err2) { - abort(err2); - } - } - function instantiateSync(file, info) { - var instance; - var module2; - var binary; - try { - binary = getBinary(file); - module2 = new WebAssembly.Module(binary); - instance = new WebAssembly.Instance(module2, info); - } catch (e) { - var str = e.toString(); - err("failed to compile wasm module: " + str); - if (str.includes("imported Memory") || str.includes("memory import")) { - err( - "Memory size incompatibility issues may be due to changing INITIAL_MEMORY at runtime to something too large. Use ALLOW_MEMORY_GROWTH to allow any size memory (and also make sure not to set INITIAL_MEMORY at runtime to something smaller than it was at compile time)." - ); - } - throw e; - } - return [instance, module2]; - } - function createWasm() { - var info = { a: asmLibraryArg }; - function receiveInstance(instance, module2) { - var exports3 = instance.exports; - Module["asm"] = exports3; - wasmMemory = Module["asm"]["g"]; - updateGlobalBufferAndViews(wasmMemory.buffer); - wasmTable = Module["asm"]["W"]; - addOnInit(Module["asm"]["h"]); - removeRunDependency(); - } - addRunDependency(); - if (Module["instantiateWasm"]) { - try { - var exports2 = Module["instantiateWasm"](info, receiveInstance); - return exports2; - } catch (e) { - err("Module.instantiateWasm callback failed with error: " + e); - return false; - } - } - var result = instantiateSync(wasmBinaryFile, info); - receiveInstance(result[0]); - return Module["asm"]; - } - function LE_HEAP_LOAD_F32(byteOffset) { - return HEAP_DATA_VIEW.getFloat32(byteOffset, true); - } - function LE_HEAP_LOAD_F64(byteOffset) { - return HEAP_DATA_VIEW.getFloat64(byteOffset, true); - } - function LE_HEAP_LOAD_I16(byteOffset) { - return HEAP_DATA_VIEW.getInt16(byteOffset, true); - } - function LE_HEAP_LOAD_I32(byteOffset) { - return HEAP_DATA_VIEW.getInt32(byteOffset, true); - } - function LE_HEAP_STORE_I32(byteOffset, value) { - HEAP_DATA_VIEW.setInt32(byteOffset, value, true); - } - function callRuntimeCallbacks(callbacks) { - while (callbacks.length > 0) { - var callback = callbacks.shift(); - if (typeof callback == "function") { - callback(Module); - continue; - } - var func = callback.func; - if (typeof func === "number") { - if (callback.arg === void 0) { - wasmTable.get(func)(); - } else { - wasmTable.get(func)(callback.arg); - } - } else { - func(callback.arg === void 0 ? null : callback.arg); - } - } - } - function _gmtime_r(time, tmPtr) { - var date = new Date(LE_HEAP_LOAD_I32((time >> 2) * 4) * 1e3); - LE_HEAP_STORE_I32((tmPtr >> 2) * 4, date.getUTCSeconds()); - LE_HEAP_STORE_I32((tmPtr + 4 >> 2) * 4, date.getUTCMinutes()); - LE_HEAP_STORE_I32((tmPtr + 8 >> 2) * 4, date.getUTCHours()); - LE_HEAP_STORE_I32((tmPtr + 12 >> 2) * 4, date.getUTCDate()); - LE_HEAP_STORE_I32((tmPtr + 16 >> 2) * 4, date.getUTCMonth()); - LE_HEAP_STORE_I32((tmPtr + 20 >> 2) * 4, date.getUTCFullYear() - 1900); - LE_HEAP_STORE_I32((tmPtr + 24 >> 2) * 4, date.getUTCDay()); - LE_HEAP_STORE_I32((tmPtr + 36 >> 2) * 4, 0); - LE_HEAP_STORE_I32((tmPtr + 32 >> 2) * 4, 0); - var start = Date.UTC(date.getUTCFullYear(), 0, 1, 0, 0, 0, 0); - var yday = (date.getTime() - start) / (1e3 * 60 * 60 * 24) | 0; - LE_HEAP_STORE_I32((tmPtr + 28 >> 2) * 4, yday); - if (!_gmtime_r.GMTString) - _gmtime_r.GMTString = allocateUTF8("GMT"); - LE_HEAP_STORE_I32((tmPtr + 40 >> 2) * 4, _gmtime_r.GMTString); - return tmPtr; - } - function ___gmtime_r(a0, a1) { - return _gmtime_r(a0, a1); - } - function _emscripten_memcpy_big(dest, src, num) { - HEAPU8.copyWithin(dest, src, src + num); - } - function emscripten_realloc_buffer(size) { - try { - wasmMemory.grow(size - buffer.byteLength + 65535 >>> 16); - updateGlobalBufferAndViews(wasmMemory.buffer); - return 1; - } catch (e) { - } - } - function _emscripten_resize_heap(requestedSize) { - var oldSize = HEAPU8.length; - requestedSize = requestedSize >>> 0; - var maxHeapSize = 2147483648; - if (requestedSize > maxHeapSize) { - return false; - } - for (var cutDown = 1; cutDown <= 4; cutDown *= 2) { - var overGrownHeapSize = oldSize * (1 + 0.2 / cutDown); - overGrownHeapSize = Math.min( - overGrownHeapSize, - requestedSize + 100663296 - ); - var newSize = Math.min( - maxHeapSize, - alignUp(Math.max(requestedSize, overGrownHeapSize), 65536) - ); - var replacement = emscripten_realloc_buffer(newSize); - if (replacement) { - return true; - } - } - return false; - } - function _setTempRet0(val) { - } - function _time(ptr) { - var ret = Date.now() / 1e3 | 0; - if (ptr) { - LE_HEAP_STORE_I32((ptr >> 2) * 4, ret); - } - return ret; - } - function _tzset() { - if (_tzset.called) - return; - _tzset.called = true; - var currentYear = new Date().getFullYear(); - var winter = new Date(currentYear, 0, 1); - var summer = new Date(currentYear, 6, 1); - var winterOffset = winter.getTimezoneOffset(); - var summerOffset = summer.getTimezoneOffset(); - var stdTimezoneOffset = Math.max(winterOffset, summerOffset); - LE_HEAP_STORE_I32((__get_timezone() >> 2) * 4, stdTimezoneOffset * 60); - LE_HEAP_STORE_I32( - (__get_daylight() >> 2) * 4, - Number(winterOffset != summerOffset) - ); - function extractZone(date) { - var match = date.toTimeString().match(/\(([A-Za-z ]+)\)$/); - return match ? match[1] : "GMT"; - } - var winterName = extractZone(winter); - var summerName = extractZone(summer); - var winterNamePtr = allocateUTF8(winterName); - var summerNamePtr = allocateUTF8(summerName); - if (summerOffset < winterOffset) { - LE_HEAP_STORE_I32((__get_tzname() >> 2) * 4, winterNamePtr); - LE_HEAP_STORE_I32((__get_tzname() + 4 >> 2) * 4, summerNamePtr); - } else { - LE_HEAP_STORE_I32((__get_tzname() >> 2) * 4, summerNamePtr); - LE_HEAP_STORE_I32((__get_tzname() + 4 >> 2) * 4, winterNamePtr); - } - } - function _timegm(tmPtr) { - _tzset(); - var time = Date.UTC( - LE_HEAP_LOAD_I32((tmPtr + 20 >> 2) * 4) + 1900, - LE_HEAP_LOAD_I32((tmPtr + 16 >> 2) * 4), - LE_HEAP_LOAD_I32((tmPtr + 12 >> 2) * 4), - LE_HEAP_LOAD_I32((tmPtr + 8 >> 2) * 4), - LE_HEAP_LOAD_I32((tmPtr + 4 >> 2) * 4), - LE_HEAP_LOAD_I32((tmPtr >> 2) * 4), - 0 - ); - var date = new Date(time); - LE_HEAP_STORE_I32((tmPtr + 24 >> 2) * 4, date.getUTCDay()); - var start = Date.UTC(date.getUTCFullYear(), 0, 1, 0, 0, 0, 0); - var yday = (date.getTime() - start) / (1e3 * 60 * 60 * 24) | 0; - LE_HEAP_STORE_I32((tmPtr + 28 >> 2) * 4, yday); - return date.getTime() / 1e3 | 0; - } - function intArrayFromBase64(s) { - { - var buf; - try { - buf = Buffer.from(s, "base64"); - } catch (_) { - buf = new Buffer(s, "base64"); - } - return new Uint8Array( - buf["buffer"], - buf["byteOffset"], - buf["byteLength"] - ); - } - } - function tryParseAsDataURI(filename) { - if (!isDataURI(filename)) { - return; - } - return intArrayFromBase64(filename.slice(dataURIPrefix.length)); - } - var asmLibraryArg = { - e: ___gmtime_r, - c: _emscripten_memcpy_big, - d: _emscripten_resize_heap, - a: _setTempRet0, - b: _time, - f: _timegm - }; - var asm = createWasm(); - Module["___wasm_call_ctors"] = asm["h"]; - Module["_zip_ext_count_symlinks"] = asm["i"]; - Module["_zip_file_get_external_attributes"] = asm["j"]; - Module["_zipstruct_statS"] = asm["k"]; - Module["_zipstruct_stat_size"] = asm["l"]; - Module["_zipstruct_stat_mtime"] = asm["m"]; - Module["_zipstruct_stat_crc"] = asm["n"]; - Module["_zipstruct_errorS"] = asm["o"]; - Module["_zipstruct_error_code_zip"] = asm["p"]; - Module["_zipstruct_stat_comp_size"] = asm["q"]; - Module["_zipstruct_stat_comp_method"] = asm["r"]; - Module["_zip_close"] = asm["s"]; - Module["_zip_delete"] = asm["t"]; - Module["_zip_dir_add"] = asm["u"]; - Module["_zip_discard"] = asm["v"]; - Module["_zip_error_init_with_code"] = asm["w"]; - Module["_zip_get_error"] = asm["x"]; - Module["_zip_file_get_error"] = asm["y"]; - Module["_zip_error_strerror"] = asm["z"]; - Module["_zip_fclose"] = asm["A"]; - Module["_zip_file_add"] = asm["B"]; - Module["_free"] = asm["C"]; - var _malloc = Module["_malloc"] = asm["D"]; - Module["_zip_source_error"] = asm["E"]; - Module["_zip_source_seek"] = asm["F"]; - Module["_zip_file_set_external_attributes"] = asm["G"]; - Module["_zip_file_set_mtime"] = asm["H"]; - Module["_zip_fopen_index"] = asm["I"]; - Module["_zip_fread"] = asm["J"]; - Module["_zip_get_name"] = asm["K"]; - Module["_zip_get_num_entries"] = asm["L"]; - Module["_zip_source_read"] = asm["M"]; - Module["_zip_name_locate"] = asm["N"]; - Module["_zip_open_from_source"] = asm["O"]; - Module["_zip_set_file_compression"] = asm["P"]; - Module["_zip_source_buffer"] = asm["Q"]; - Module["_zip_source_buffer_create"] = asm["R"]; - Module["_zip_source_close"] = asm["S"]; - Module["_zip_source_free"] = asm["T"]; - Module["_zip_source_keep"] = asm["U"]; - Module["_zip_source_open"] = asm["V"]; - Module["_zip_source_tell"] = asm["X"]; - Module["_zip_stat_index"] = asm["Y"]; - var __get_tzname = Module["__get_tzname"] = asm["Z"]; - var __get_daylight = Module["__get_daylight"] = asm["_"]; - var __get_timezone = Module["__get_timezone"] = asm["$"]; - var stackSave = Module["stackSave"] = asm["aa"]; - var stackRestore = Module["stackRestore"] = asm["ba"]; - var stackAlloc = Module["stackAlloc"] = asm["ca"]; - Module["cwrap"] = cwrap; - Module["getValue"] = getValue; - var calledRun; - dependenciesFulfilled = function runCaller() { - if (!calledRun) - run(); - if (!calledRun) - dependenciesFulfilled = runCaller; - }; - function run(args) { - if (runDependencies > 0) { - return; - } - preRun(); - if (runDependencies > 0) { - return; - } - function doRun() { - if (calledRun) - return; - calledRun = true; - Module["calledRun"] = true; - if (ABORT) - return; - initRuntime(); - readyPromiseResolve(Module); - if (Module["onRuntimeInitialized"]) - Module["onRuntimeInitialized"](); - postRun(); - } - if (Module["setStatus"]) { - Module["setStatus"]("Running..."); - setTimeout(function() { - setTimeout(function() { - Module["setStatus"](""); - }, 1); - doRun(); - }, 1); - } else { - doRun(); - } - } - Module["run"] = run; - if (Module["preInit"]) { - if (typeof Module["preInit"] == "function") - Module["preInit"] = [Module["preInit"]]; - while (Module["preInit"].length > 0) { - Module["preInit"].pop()(); - } - } - run(); - return createModule2; - }; -}(); -module.exports = createModule; -}(libzipSync)); - -const createModule = libzipSync.exports; - -const number64 = [ - `number`, - `number` -]; -var Errors = /* @__PURE__ */ ((Errors2) => { - Errors2[Errors2["ZIP_ER_OK"] = 0] = "ZIP_ER_OK"; - Errors2[Errors2["ZIP_ER_MULTIDISK"] = 1] = "ZIP_ER_MULTIDISK"; - Errors2[Errors2["ZIP_ER_RENAME"] = 2] = "ZIP_ER_RENAME"; - Errors2[Errors2["ZIP_ER_CLOSE"] = 3] = "ZIP_ER_CLOSE"; - Errors2[Errors2["ZIP_ER_SEEK"] = 4] = "ZIP_ER_SEEK"; - Errors2[Errors2["ZIP_ER_READ"] = 5] = "ZIP_ER_READ"; - Errors2[Errors2["ZIP_ER_WRITE"] = 6] = "ZIP_ER_WRITE"; - Errors2[Errors2["ZIP_ER_CRC"] = 7] = "ZIP_ER_CRC"; - Errors2[Errors2["ZIP_ER_ZIPCLOSED"] = 8] = "ZIP_ER_ZIPCLOSED"; - Errors2[Errors2["ZIP_ER_NOENT"] = 9] = "ZIP_ER_NOENT"; - Errors2[Errors2["ZIP_ER_EXISTS"] = 10] = "ZIP_ER_EXISTS"; - Errors2[Errors2["ZIP_ER_OPEN"] = 11] = "ZIP_ER_OPEN"; - Errors2[Errors2["ZIP_ER_TMPOPEN"] = 12] = "ZIP_ER_TMPOPEN"; - Errors2[Errors2["ZIP_ER_ZLIB"] = 13] = "ZIP_ER_ZLIB"; - Errors2[Errors2["ZIP_ER_MEMORY"] = 14] = "ZIP_ER_MEMORY"; - Errors2[Errors2["ZIP_ER_CHANGED"] = 15] = "ZIP_ER_CHANGED"; - Errors2[Errors2["ZIP_ER_COMPNOTSUPP"] = 16] = "ZIP_ER_COMPNOTSUPP"; - Errors2[Errors2["ZIP_ER_EOF"] = 17] = "ZIP_ER_EOF"; - Errors2[Errors2["ZIP_ER_INVAL"] = 18] = "ZIP_ER_INVAL"; - Errors2[Errors2["ZIP_ER_NOZIP"] = 19] = "ZIP_ER_NOZIP"; - Errors2[Errors2["ZIP_ER_INTERNAL"] = 20] = "ZIP_ER_INTERNAL"; - Errors2[Errors2["ZIP_ER_INCONS"] = 21] = "ZIP_ER_INCONS"; - Errors2[Errors2["ZIP_ER_REMOVE"] = 22] = "ZIP_ER_REMOVE"; - Errors2[Errors2["ZIP_ER_DELETED"] = 23] = "ZIP_ER_DELETED"; - Errors2[Errors2["ZIP_ER_ENCRNOTSUPP"] = 24] = "ZIP_ER_ENCRNOTSUPP"; - Errors2[Errors2["ZIP_ER_RDONLY"] = 25] = "ZIP_ER_RDONLY"; - Errors2[Errors2["ZIP_ER_NOPASSWD"] = 26] = "ZIP_ER_NOPASSWD"; - Errors2[Errors2["ZIP_ER_WRONGPASSWD"] = 27] = "ZIP_ER_WRONGPASSWD"; - Errors2[Errors2["ZIP_ER_OPNOTSUPP"] = 28] = "ZIP_ER_OPNOTSUPP"; - Errors2[Errors2["ZIP_ER_INUSE"] = 29] = "ZIP_ER_INUSE"; - Errors2[Errors2["ZIP_ER_TELL"] = 30] = "ZIP_ER_TELL"; - Errors2[Errors2["ZIP_ER_COMPRESSED_DATA"] = 31] = "ZIP_ER_COMPRESSED_DATA"; - return Errors2; -})(Errors || {}); -const makeInterface = (emZip) => ({ - get HEAPU8() { - return emZip.HEAPU8; - }, - errors: Errors, - SEEK_SET: 0, - SEEK_CUR: 1, - SEEK_END: 2, - ZIP_CHECKCONS: 4, - ZIP_EXCL: 2, - ZIP_RDONLY: 16, - ZIP_FL_OVERWRITE: 8192, - ZIP_FL_COMPRESSED: 4, - ZIP_OPSYS_DOS: 0, - ZIP_OPSYS_AMIGA: 1, - ZIP_OPSYS_OPENVMS: 2, - ZIP_OPSYS_UNIX: 3, - ZIP_OPSYS_VM_CMS: 4, - ZIP_OPSYS_ATARI_ST: 5, - ZIP_OPSYS_OS_2: 6, - ZIP_OPSYS_MACINTOSH: 7, - ZIP_OPSYS_Z_SYSTEM: 8, - ZIP_OPSYS_CPM: 9, - ZIP_OPSYS_WINDOWS_NTFS: 10, - ZIP_OPSYS_MVS: 11, - ZIP_OPSYS_VSE: 12, - ZIP_OPSYS_ACORN_RISC: 13, - ZIP_OPSYS_VFAT: 14, - ZIP_OPSYS_ALTERNATE_MVS: 15, - ZIP_OPSYS_BEOS: 16, - ZIP_OPSYS_TANDEM: 17, - ZIP_OPSYS_OS_400: 18, - ZIP_OPSYS_OS_X: 19, - ZIP_CM_DEFAULT: -1, - ZIP_CM_STORE: 0, - ZIP_CM_DEFLATE: 8, - uint08S: emZip._malloc(1), - uint32S: emZip._malloc(4), - malloc: emZip._malloc, - free: emZip._free, - getValue: emZip.getValue, - openFromSource: emZip.cwrap(`zip_open_from_source`, `number`, [`number`, `number`, `number`]), - close: emZip.cwrap(`zip_close`, `number`, [`number`]), - discard: emZip.cwrap(`zip_discard`, null, [`number`]), - getError: emZip.cwrap(`zip_get_error`, `number`, [`number`]), - getName: emZip.cwrap(`zip_get_name`, `string`, [`number`, `number`, `number`]), - getNumEntries: emZip.cwrap(`zip_get_num_entries`, `number`, [`number`, `number`]), - delete: emZip.cwrap(`zip_delete`, `number`, [`number`, `number`]), - statIndex: emZip.cwrap(`zip_stat_index`, `number`, [`number`, ...number64, `number`, `number`]), - fopenIndex: emZip.cwrap(`zip_fopen_index`, `number`, [`number`, ...number64, `number`]), - fread: emZip.cwrap(`zip_fread`, `number`, [`number`, `number`, `number`, `number`]), - fclose: emZip.cwrap(`zip_fclose`, `number`, [`number`]), - dir: { - add: emZip.cwrap(`zip_dir_add`, `number`, [`number`, `string`]) - }, - file: { - add: emZip.cwrap(`zip_file_add`, `number`, [`number`, `string`, `number`, `number`]), - getError: emZip.cwrap(`zip_file_get_error`, `number`, [`number`]), - getExternalAttributes: emZip.cwrap(`zip_file_get_external_attributes`, `number`, [`number`, ...number64, `number`, `number`, `number`]), - setExternalAttributes: emZip.cwrap(`zip_file_set_external_attributes`, `number`, [`number`, ...number64, `number`, `number`, `number`]), - setMtime: emZip.cwrap(`zip_file_set_mtime`, `number`, [`number`, ...number64, `number`, `number`]), - setCompression: emZip.cwrap(`zip_set_file_compression`, `number`, [`number`, ...number64, `number`, `number`]) - }, - ext: { - countSymlinks: emZip.cwrap(`zip_ext_count_symlinks`, `number`, [`number`]) - }, - error: { - initWithCode: emZip.cwrap(`zip_error_init_with_code`, null, [`number`, `number`]), - strerror: emZip.cwrap(`zip_error_strerror`, `string`, [`number`]) - }, - name: { - locate: emZip.cwrap(`zip_name_locate`, `number`, [`number`, `string`, `number`]) - }, - source: { - fromUnattachedBuffer: emZip.cwrap(`zip_source_buffer_create`, `number`, [`number`, ...number64, `number`, `number`]), - fromBuffer: emZip.cwrap(`zip_source_buffer`, `number`, [`number`, `number`, ...number64, `number`]), - free: emZip.cwrap(`zip_source_free`, null, [`number`]), - keep: emZip.cwrap(`zip_source_keep`, null, [`number`]), - open: emZip.cwrap(`zip_source_open`, `number`, [`number`]), - close: emZip.cwrap(`zip_source_close`, `number`, [`number`]), - seek: emZip.cwrap(`zip_source_seek`, `number`, [`number`, ...number64, `number`]), - tell: emZip.cwrap(`zip_source_tell`, `number`, [`number`]), - read: emZip.cwrap(`zip_source_read`, `number`, [`number`, `number`, `number`]), - error: emZip.cwrap(`zip_source_error`, `number`, [`number`]) - }, - struct: { - statS: emZip.cwrap(`zipstruct_statS`, `number`, []), - statSize: emZip.cwrap(`zipstruct_stat_size`, `number`, [`number`]), - statCompSize: emZip.cwrap(`zipstruct_stat_comp_size`, `number`, [`number`]), - statCompMethod: emZip.cwrap(`zipstruct_stat_comp_method`, `number`, [`number`]), - statMtime: emZip.cwrap(`zipstruct_stat_mtime`, `number`, [`number`]), - statCrc: emZip.cwrap(`zipstruct_stat_crc`, `number`, [`number`]), - errorS: emZip.cwrap(`zipstruct_errorS`, `number`, []), - errorCodeZip: emZip.cwrap(`zipstruct_error_code_zip`, `number`, [`number`]) - } -}); - -function getArchivePart(path, extension) { - let idx = path.indexOf(extension); - if (idx <= 0) - return null; - let nextCharIdx = idx; - while (idx >= 0) { - nextCharIdx = idx + extension.length; - if (path[nextCharIdx] === ppath.sep) - break; - if (path[idx - 1] === ppath.sep) - return null; - idx = path.indexOf(extension, nextCharIdx); - } - if (path.length > nextCharIdx && path[nextCharIdx] !== ppath.sep) - return null; - return path.slice(0, nextCharIdx); -} -class ZipOpenFS extends MountFS { - static async openPromise(fn, opts) { - const zipOpenFs = new ZipOpenFS(opts); - try { - return await fn(zipOpenFs); - } finally { - zipOpenFs.saveAndClose(); - } - } - constructor(opts = {}) { - const fileExtensions = opts.fileExtensions; - const readOnlyArchives = opts.readOnlyArchives; - const getMountPoint = typeof fileExtensions === `undefined` ? (path) => getArchivePart(path, `.zip`) : (path) => { - for (const extension of fileExtensions) { - const result = getArchivePart(path, extension); - if (result) { - return result; - } - } - return null; - }; - const factorySync = (baseFs, p) => { - return new ZipFS(p, { - baseFs, - readOnly: readOnlyArchives, - stats: baseFs.statSync(p) - }); - }; - const factoryPromise = async (baseFs, p) => { - const zipOptions = { - baseFs, - readOnly: readOnlyArchives, - stats: await baseFs.statPromise(p) - }; - return () => { - return new ZipFS(p, zipOptions); - }; - }; - super({ - ...opts, - factorySync, - factoryPromise, - getMountPoint - }); - } -} - -const DEFAULT_COMPRESSION_LEVEL = `mixed`; -function toUnixTimestamp(time) { - if (typeof time === `string` && String(+time) === time) - return +time; - if (typeof time === `number` && Number.isFinite(time)) { - if (time < 0) { - return Date.now() / 1e3; - } else { - return time; - } - } - if (nodeUtils.types.isDate(time)) - return time.getTime() / 1e3; - throw new Error(`Invalid time`); -} -function makeEmptyArchive() { - return Buffer.from([ - 80, - 75, - 5, - 6, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0 - ]); -} -class LibzipError extends Error { - constructor(message, code) { - super(message); - this.name = `Libzip Error`; - this.code = code; - } -} -class ZipFS extends BasePortableFakeFS { - constructor(source, opts = {}) { - super(); - this.listings = /* @__PURE__ */ new Map(); - this.entries = /* @__PURE__ */ new Map(); - this.fileSources = /* @__PURE__ */ new Map(); - this.fds = /* @__PURE__ */ new Map(); - this.nextFd = 0; - this.ready = false; - this.readOnly = false; - const pathOptions = opts; - this.level = typeof pathOptions.level !== `undefined` ? pathOptions.level : DEFAULT_COMPRESSION_LEVEL; - source ??= makeEmptyArchive(); - if (typeof source === `string`) { - const { baseFs = new NodeFS() } = pathOptions; - this.baseFs = baseFs; - this.path = source; - } else { - this.path = null; - this.baseFs = null; - } - if (opts.stats) { - this.stats = opts.stats; - } else { - if (typeof source === `string`) { - try { - this.stats = this.baseFs.statSync(source); - } catch (error) { - if (error.code === `ENOENT` && pathOptions.create) { - this.stats = makeDefaultStats(); - } else { - throw error; - } - } - } else { - this.stats = makeDefaultStats(); - } - } - this.libzip = getInstance(); - const errPtr = this.libzip.malloc(4); - try { - let flags = 0; - if (opts.readOnly) { - flags |= this.libzip.ZIP_RDONLY; - this.readOnly = true; - } - if (typeof source === `string`) - source = pathOptions.create ? makeEmptyArchive() : this.baseFs.readFileSync(source); - const lzSource = this.allocateUnattachedSource(source); - try { - this.zip = this.libzip.openFromSource(lzSource, flags, errPtr); - this.lzSource = lzSource; - } catch (error) { - this.libzip.source.free(lzSource); - throw error; - } - if (this.zip === 0) { - const error = this.libzip.struct.errorS(); - this.libzip.error.initWithCode(error, this.libzip.getValue(errPtr, `i32`)); - throw this.makeLibzipError(error); - } - } finally { - this.libzip.free(errPtr); - } - this.listings.set(PortablePath.root, /* @__PURE__ */ new Set()); - const entryCount = this.libzip.getNumEntries(this.zip, 0); - for (let t = 0; t < entryCount; ++t) { - const raw = this.libzip.getName(this.zip, t, 0); - if (ppath.isAbsolute(raw)) - continue; - const p = ppath.resolve(PortablePath.root, raw); - this.registerEntry(p, t); - if (raw.endsWith(`/`)) { - this.registerListing(p); - } - } - this.symlinkCount = this.libzip.ext.countSymlinks(this.zip); - if (this.symlinkCount === -1) - throw this.makeLibzipError(this.libzip.getError(this.zip)); - this.ready = true; - } - makeLibzipError(error) { - const errorCode = this.libzip.struct.errorCodeZip(error); - const strerror = this.libzip.error.strerror(error); - const libzipError = new LibzipError(strerror, this.libzip.errors[errorCode]); - if (errorCode === this.libzip.errors.ZIP_ER_CHANGED) - throw new Error(`Assertion failed: Unexpected libzip error: ${libzipError.message}`); - return libzipError; - } - getExtractHint(hints) { - for (const fileName of this.entries.keys()) { - const ext = this.pathUtils.extname(fileName); - if (hints.relevantExtensions.has(ext)) { - return true; - } - } - return false; - } - getAllFiles() { - return Array.from(this.entries.keys()); - } - getRealPath() { - if (!this.path) - throw new Error(`ZipFS don't have real paths when loaded from a buffer`); - return this.path; - } - prepareClose() { - if (!this.ready) - throw EBUSY(`archive closed, close`); - unwatchAllFiles(this); - } - getBufferAndClose() { - this.prepareClose(); - if (this.entries.size === 0) { - this.discardAndClose(); - return makeEmptyArchive(); - } - try { - this.libzip.source.keep(this.lzSource); - if (this.libzip.close(this.zip) === -1) - throw this.makeLibzipError(this.libzip.getError(this.zip)); - if (this.libzip.source.open(this.lzSource) === -1) - throw this.makeLibzipError(this.libzip.source.error(this.lzSource)); - if (this.libzip.source.seek(this.lzSource, 0, 0, this.libzip.SEEK_END) === -1) - throw this.makeLibzipError(this.libzip.source.error(this.lzSource)); - const size = this.libzip.source.tell(this.lzSource); - if (size === -1) - throw this.makeLibzipError(this.libzip.source.error(this.lzSource)); - if (this.libzip.source.seek(this.lzSource, 0, 0, this.libzip.SEEK_SET) === -1) - throw this.makeLibzipError(this.libzip.source.error(this.lzSource)); - const buffer = this.libzip.malloc(size); - if (!buffer) - throw new Error(`Couldn't allocate enough memory`); - try { - const rc = this.libzip.source.read(this.lzSource, buffer, size); - if (rc === -1) - throw this.makeLibzipError(this.libzip.source.error(this.lzSource)); - else if (rc < size) - throw new Error(`Incomplete read`); - else if (rc > size) - throw new Error(`Overread`); - let result = Buffer.from(this.libzip.HEAPU8.subarray(buffer, buffer + size)); - if (process.env.YARN_IS_TEST_ENV && process.env.YARN_ZIP_DATA_EPILOGUE) - result = Buffer.concat([result, Buffer.from(process.env.YARN_ZIP_DATA_EPILOGUE)]); - return result; - } finally { - this.libzip.free(buffer); - } - } finally { - this.libzip.source.close(this.lzSource); - this.libzip.source.free(this.lzSource); - this.ready = false; - } - } - discardAndClose() { - this.prepareClose(); - this.libzip.discard(this.zip); - this.ready = false; - } - saveAndClose() { - if (!this.path || !this.baseFs) - throw new Error(`ZipFS cannot be saved and must be discarded when loaded from a buffer`); - if (this.readOnly) { - this.discardAndClose(); - return; - } - const newMode = this.baseFs.existsSync(this.path) || this.stats.mode === DEFAULT_MODE ? void 0 : this.stats.mode; - this.baseFs.writeFileSync(this.path, this.getBufferAndClose(), { mode: newMode }); - this.ready = false; - } - resolve(p) { - return ppath.resolve(PortablePath.root, p); - } - async openPromise(p, flags, mode) { - return this.openSync(p, flags, mode); - } - openSync(p, flags, mode) { - const fd = this.nextFd++; - this.fds.set(fd, { cursor: 0, p }); - return fd; - } - hasOpenFileHandles() { - return !!this.fds.size; - } - async opendirPromise(p, opts) { - return this.opendirSync(p, opts); - } - opendirSync(p, opts = {}) { - const resolvedP = this.resolveFilename(`opendir '${p}'`, p); - if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) - throw ENOENT(`opendir '${p}'`); - const directoryListing = this.listings.get(resolvedP); - if (!directoryListing) - throw ENOTDIR(`opendir '${p}'`); - const entries = [...directoryListing]; - const fd = this.openSync(resolvedP, `r`); - const onClose = () => { - this.closeSync(fd); - }; - return opendir(this, resolvedP, entries, { onClose }); - } - async readPromise(fd, buffer, offset, length, position) { - return this.readSync(fd, buffer, offset, length, position); - } - readSync(fd, buffer, offset = 0, length = buffer.byteLength, position = -1) { - const entry = this.fds.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`read`); - const realPosition = position === -1 || position === null ? entry.cursor : position; - const source = this.readFileSync(entry.p); - source.copy(buffer, offset, realPosition, realPosition + length); - const bytesRead = Math.max(0, Math.min(source.length - realPosition, length)); - if (position === -1 || position === null) - entry.cursor += bytesRead; - return bytesRead; - } - async writePromise(fd, buffer, offset, length, position) { - if (typeof buffer === `string`) { - return this.writeSync(fd, buffer, position); - } else { - return this.writeSync(fd, buffer, offset, length, position); - } - } - writeSync(fd, buffer, offset, length, position) { - const entry = this.fds.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`read`); - throw new Error(`Unimplemented`); - } - async closePromise(fd) { - return this.closeSync(fd); - } - closeSync(fd) { - const entry = this.fds.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`read`); - this.fds.delete(fd); - } - createReadStream(p, { encoding } = {}) { - if (p === null) - throw new Error(`Unimplemented`); - const fd = this.openSync(p, `r`); - const stream$1 = Object.assign( - new stream.PassThrough({ - emitClose: true, - autoDestroy: true, - destroy: (error, callback) => { - clearImmediate(immediate); - this.closeSync(fd); - callback(error); - } - }), - { - close() { - stream$1.destroy(); - }, - bytesRead: 0, - path: p, - pending: false - } - ); - const immediate = setImmediate(async () => { - try { - const data = await this.readFilePromise(p, encoding); - stream$1.bytesRead = data.length; - stream$1.end(data); - } catch (error) { - stream$1.destroy(error); - } - }); - return stream$1; - } - createWriteStream(p, { encoding } = {}) { - if (this.readOnly) - throw EROFS(`open '${p}'`); - if (p === null) - throw new Error(`Unimplemented`); - const chunks = []; - const fd = this.openSync(p, `w`); - const stream$1 = Object.assign( - new stream.PassThrough({ - autoDestroy: true, - emitClose: true, - destroy: (error, callback) => { - try { - if (error) { - callback(error); - } else { - this.writeFileSync(p, Buffer.concat(chunks), encoding); - callback(null); - } - } catch (err) { - callback(err); - } finally { - this.closeSync(fd); - } - } - }), - { - close() { - stream$1.destroy(); - }, - bytesWritten: 0, - path: p, - pending: false - } - ); - stream$1.on(`data`, (chunk) => { - const chunkBuffer = Buffer.from(chunk); - stream$1.bytesWritten += chunkBuffer.length; - chunks.push(chunkBuffer); - }); - return stream$1; - } - async realpathPromise(p) { - return this.realpathSync(p); - } - realpathSync(p) { - const resolvedP = this.resolveFilename(`lstat '${p}'`, p); - if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) - throw ENOENT(`lstat '${p}'`); - return resolvedP; - } - async existsPromise(p) { - return this.existsSync(p); - } - existsSync(p) { - if (!this.ready) - throw EBUSY(`archive closed, existsSync '${p}'`); - if (this.symlinkCount === 0) { - const resolvedP2 = ppath.resolve(PortablePath.root, p); - return this.entries.has(resolvedP2) || this.listings.has(resolvedP2); - } - let resolvedP; - try { - resolvedP = this.resolveFilename(`stat '${p}'`, p, void 0, false); - } catch (error) { - return false; - } - if (resolvedP === void 0) - return false; - return this.entries.has(resolvedP) || this.listings.has(resolvedP); - } - async accessPromise(p, mode) { - return this.accessSync(p, mode); - } - accessSync(p, mode = fs.constants.F_OK) { - const resolvedP = this.resolveFilename(`access '${p}'`, p); - if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) - throw ENOENT(`access '${p}'`); - if (this.readOnly && mode & fs.constants.W_OK) { - throw EROFS(`access '${p}'`); - } - } - async statPromise(p, opts = { bigint: false }) { - if (opts.bigint) - return this.statSync(p, { bigint: true }); - return this.statSync(p); - } - statSync(p, opts = { bigint: false, throwIfNoEntry: true }) { - const resolvedP = this.resolveFilename(`stat '${p}'`, p, void 0, opts.throwIfNoEntry); - if (resolvedP === void 0) - return void 0; - if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) { - if (opts.throwIfNoEntry === false) - return void 0; - throw ENOENT(`stat '${p}'`); - } - if (p[p.length - 1] === `/` && !this.listings.has(resolvedP)) - throw ENOTDIR(`stat '${p}'`); - return this.statImpl(`stat '${p}'`, resolvedP, opts); - } - async fstatPromise(fd, opts) { - return this.fstatSync(fd, opts); - } - fstatSync(fd, opts) { - const entry = this.fds.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`fstatSync`); - const { p } = entry; - const resolvedP = this.resolveFilename(`stat '${p}'`, p); - if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) - throw ENOENT(`stat '${p}'`); - if (p[p.length - 1] === `/` && !this.listings.has(resolvedP)) - throw ENOTDIR(`stat '${p}'`); - return this.statImpl(`fstat '${p}'`, resolvedP, opts); - } - async lstatPromise(p, opts = { bigint: false }) { - if (opts.bigint) - return this.lstatSync(p, { bigint: true }); - return this.lstatSync(p); - } - lstatSync(p, opts = { bigint: false, throwIfNoEntry: true }) { - const resolvedP = this.resolveFilename(`lstat '${p}'`, p, false, opts.throwIfNoEntry); - if (resolvedP === void 0) - return void 0; - if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) { - if (opts.throwIfNoEntry === false) - return void 0; - throw ENOENT(`lstat '${p}'`); - } - if (p[p.length - 1] === `/` && !this.listings.has(resolvedP)) - throw ENOTDIR(`lstat '${p}'`); - return this.statImpl(`lstat '${p}'`, resolvedP, opts); - } - statImpl(reason, p, opts = {}) { - const entry = this.entries.get(p); - if (typeof entry !== `undefined`) { - const stat = this.libzip.struct.statS(); - const rc = this.libzip.statIndex(this.zip, entry, 0, 0, stat); - if (rc === -1) - throw this.makeLibzipError(this.libzip.getError(this.zip)); - const uid = this.stats.uid; - const gid = this.stats.gid; - const size = this.libzip.struct.statSize(stat) >>> 0; - const blksize = 512; - const blocks = Math.ceil(size / blksize); - const mtimeMs = (this.libzip.struct.statMtime(stat) >>> 0) * 1e3; - const atimeMs = mtimeMs; - const birthtimeMs = mtimeMs; - const ctimeMs = mtimeMs; - const atime = new Date(atimeMs); - const birthtime = new Date(birthtimeMs); - const ctime = new Date(ctimeMs); - const mtime = new Date(mtimeMs); - const type = this.listings.has(p) ? fs.constants.S_IFDIR : this.isSymbolicLink(entry) ? fs.constants.S_IFLNK : fs.constants.S_IFREG; - const defaultMode = type === fs.constants.S_IFDIR ? 493 : 420; - const mode = type | this.getUnixMode(entry, defaultMode) & 511; - const crc = this.libzip.struct.statCrc(stat); - const statInstance = Object.assign(new StatEntry(), { uid, gid, size, blksize, blocks, atime, birthtime, ctime, mtime, atimeMs, birthtimeMs, ctimeMs, mtimeMs, mode, crc }); - return opts.bigint === true ? convertToBigIntStats(statInstance) : statInstance; - } - if (this.listings.has(p)) { - const uid = this.stats.uid; - const gid = this.stats.gid; - const size = 0; - const blksize = 512; - const blocks = 0; - const atimeMs = this.stats.mtimeMs; - const birthtimeMs = this.stats.mtimeMs; - const ctimeMs = this.stats.mtimeMs; - const mtimeMs = this.stats.mtimeMs; - const atime = new Date(atimeMs); - const birthtime = new Date(birthtimeMs); - const ctime = new Date(ctimeMs); - const mtime = new Date(mtimeMs); - const mode = fs.constants.S_IFDIR | 493; - const crc = 0; - const statInstance = Object.assign(new StatEntry(), { uid, gid, size, blksize, blocks, atime, birthtime, ctime, mtime, atimeMs, birthtimeMs, ctimeMs, mtimeMs, mode, crc }); - return opts.bigint === true ? convertToBigIntStats(statInstance) : statInstance; - } - throw new Error(`Unreachable`); - } - getUnixMode(index, defaultMode) { - const rc = this.libzip.file.getExternalAttributes(this.zip, index, 0, 0, this.libzip.uint08S, this.libzip.uint32S); - if (rc === -1) - throw this.makeLibzipError(this.libzip.getError(this.zip)); - const opsys = this.libzip.getValue(this.libzip.uint08S, `i8`) >>> 0; - if (opsys !== this.libzip.ZIP_OPSYS_UNIX) - return defaultMode; - return this.libzip.getValue(this.libzip.uint32S, `i32`) >>> 16; - } - registerListing(p) { - const existingListing = this.listings.get(p); - if (existingListing) - return existingListing; - const parentListing = this.registerListing(ppath.dirname(p)); - parentListing.add(ppath.basename(p)); - const newListing = /* @__PURE__ */ new Set(); - this.listings.set(p, newListing); - return newListing; - } - registerEntry(p, index) { - const parentListing = this.registerListing(ppath.dirname(p)); - parentListing.add(ppath.basename(p)); - this.entries.set(p, index); - } - unregisterListing(p) { - this.listings.delete(p); - const parentListing = this.listings.get(ppath.dirname(p)); - parentListing?.delete(ppath.basename(p)); - } - unregisterEntry(p) { - this.unregisterListing(p); - const entry = this.entries.get(p); - this.entries.delete(p); - if (typeof entry === `undefined`) - return; - this.fileSources.delete(entry); - if (this.isSymbolicLink(entry)) { - this.symlinkCount--; - } - } - deleteEntry(p, index) { - this.unregisterEntry(p); - const rc = this.libzip.delete(this.zip, index); - if (rc === -1) { - throw this.makeLibzipError(this.libzip.getError(this.zip)); - } - } - resolveFilename(reason, p, resolveLastComponent = true, throwIfNoEntry = true) { - if (!this.ready) - throw EBUSY(`archive closed, ${reason}`); - let resolvedP = ppath.resolve(PortablePath.root, p); - if (resolvedP === `/`) - return PortablePath.root; - const fileIndex = this.entries.get(resolvedP); - if (resolveLastComponent && fileIndex !== void 0) { - if (this.symlinkCount !== 0 && this.isSymbolicLink(fileIndex)) { - const target = this.getFileSource(fileIndex).toString(); - return this.resolveFilename(reason, ppath.resolve(ppath.dirname(resolvedP), target), true, throwIfNoEntry); - } else { - return resolvedP; - } - } - while (true) { - const parentP = this.resolveFilename(reason, ppath.dirname(resolvedP), true, throwIfNoEntry); - if (parentP === void 0) - return parentP; - const isDir = this.listings.has(parentP); - const doesExist = this.entries.has(parentP); - if (!isDir && !doesExist) { - if (throwIfNoEntry === false) - return void 0; - throw ENOENT(reason); - } - if (!isDir) - throw ENOTDIR(reason); - resolvedP = ppath.resolve(parentP, ppath.basename(resolvedP)); - if (!resolveLastComponent || this.symlinkCount === 0) - break; - const index = this.libzip.name.locate(this.zip, resolvedP.slice(1), 0); - if (index === -1) - break; - if (this.isSymbolicLink(index)) { - const target = this.getFileSource(index).toString(); - resolvedP = ppath.resolve(ppath.dirname(resolvedP), target); - } else { - break; - } - } - return resolvedP; - } - allocateBuffer(content) { - if (!Buffer.isBuffer(content)) - content = Buffer.from(content); - const buffer = this.libzip.malloc(content.byteLength); - if (!buffer) - throw new Error(`Couldn't allocate enough memory`); - const heap = new Uint8Array(this.libzip.HEAPU8.buffer, buffer, content.byteLength); - heap.set(content); - return { buffer, byteLength: content.byteLength }; - } - allocateUnattachedSource(content) { - const error = this.libzip.struct.errorS(); - const { buffer, byteLength } = this.allocateBuffer(content); - const source = this.libzip.source.fromUnattachedBuffer(buffer, byteLength, 0, 1, error); - if (source === 0) { - this.libzip.free(error); - throw this.makeLibzipError(error); - } - return source; - } - allocateSource(content) { - const { buffer, byteLength } = this.allocateBuffer(content); - const source = this.libzip.source.fromBuffer(this.zip, buffer, byteLength, 0, 1); - if (source === 0) { - this.libzip.free(buffer); - throw this.makeLibzipError(this.libzip.getError(this.zip)); - } - return source; - } - setFileSource(p, content) { - const buffer = Buffer.isBuffer(content) ? content : Buffer.from(content); - const target = ppath.relative(PortablePath.root, p); - const lzSource = this.allocateSource(content); - try { - const newIndex = this.libzip.file.add(this.zip, target, lzSource, this.libzip.ZIP_FL_OVERWRITE); - if (newIndex === -1) - throw this.makeLibzipError(this.libzip.getError(this.zip)); - if (this.level !== `mixed`) { - const method = this.level === 0 ? this.libzip.ZIP_CM_STORE : this.libzip.ZIP_CM_DEFLATE; - const rc = this.libzip.file.setCompression(this.zip, newIndex, 0, method, this.level); - if (rc === -1) { - throw this.makeLibzipError(this.libzip.getError(this.zip)); - } - } - this.fileSources.set(newIndex, buffer); - return newIndex; - } catch (error) { - this.libzip.source.free(lzSource); - throw error; - } - } - isSymbolicLink(index) { - if (this.symlinkCount === 0) - return false; - const attrs = this.libzip.file.getExternalAttributes(this.zip, index, 0, 0, this.libzip.uint08S, this.libzip.uint32S); - if (attrs === -1) - throw this.makeLibzipError(this.libzip.getError(this.zip)); - const opsys = this.libzip.getValue(this.libzip.uint08S, `i8`) >>> 0; - if (opsys !== this.libzip.ZIP_OPSYS_UNIX) - return false; - const attributes = this.libzip.getValue(this.libzip.uint32S, `i32`) >>> 16; - return (attributes & fs.constants.S_IFMT) === fs.constants.S_IFLNK; - } - getFileSource(index, opts = { asyncDecompress: false }) { - const cachedFileSource = this.fileSources.get(index); - if (typeof cachedFileSource !== `undefined`) - return cachedFileSource; - const stat = this.libzip.struct.statS(); - const rc = this.libzip.statIndex(this.zip, index, 0, 0, stat); - if (rc === -1) - throw this.makeLibzipError(this.libzip.getError(this.zip)); - const size = this.libzip.struct.statCompSize(stat); - const compressionMethod = this.libzip.struct.statCompMethod(stat); - const buffer = this.libzip.malloc(size); - try { - const file = this.libzip.fopenIndex(this.zip, index, 0, this.libzip.ZIP_FL_COMPRESSED); - if (file === 0) - throw this.makeLibzipError(this.libzip.getError(this.zip)); - try { - const rc2 = this.libzip.fread(file, buffer, size, 0); - if (rc2 === -1) - throw this.makeLibzipError(this.libzip.file.getError(file)); - else if (rc2 < size) - throw new Error(`Incomplete read`); - else if (rc2 > size) - throw new Error(`Overread`); - const memory = this.libzip.HEAPU8.subarray(buffer, buffer + size); - const data = Buffer.from(memory); - if (compressionMethod === 0) { - this.fileSources.set(index, data); - return data; - } else if (opts.asyncDecompress) { - return new Promise((resolve, reject) => { - zlib__default.default.inflateRaw(data, (error, result) => { - if (error) { - reject(error); - } else { - this.fileSources.set(index, result); - resolve(result); - } - }); - }); - } else { - const decompressedData = zlib__default.default.inflateRawSync(data); - this.fileSources.set(index, decompressedData); - return decompressedData; - } - } finally { - this.libzip.fclose(file); - } - } finally { - this.libzip.free(buffer); - } - } - async fchmodPromise(fd, mask) { - return this.chmodPromise(this.fdToPath(fd, `fchmod`), mask); - } - fchmodSync(fd, mask) { - return this.chmodSync(this.fdToPath(fd, `fchmodSync`), mask); - } - async chmodPromise(p, mask) { - return this.chmodSync(p, mask); - } - chmodSync(p, mask) { - if (this.readOnly) - throw EROFS(`chmod '${p}'`); - mask &= 493; - const resolvedP = this.resolveFilename(`chmod '${p}'`, p, false); - const entry = this.entries.get(resolvedP); - if (typeof entry === `undefined`) - throw new Error(`Assertion failed: The entry should have been registered (${resolvedP})`); - const oldMod = this.getUnixMode(entry, fs.constants.S_IFREG | 0); - const newMod = oldMod & ~511 | mask; - const rc = this.libzip.file.setExternalAttributes(this.zip, entry, 0, 0, this.libzip.ZIP_OPSYS_UNIX, newMod << 16); - if (rc === -1) { - throw this.makeLibzipError(this.libzip.getError(this.zip)); - } - } - async fchownPromise(fd, uid, gid) { - return this.chownPromise(this.fdToPath(fd, `fchown`), uid, gid); - } - fchownSync(fd, uid, gid) { - return this.chownSync(this.fdToPath(fd, `fchownSync`), uid, gid); - } - async chownPromise(p, uid, gid) { - return this.chownSync(p, uid, gid); - } - chownSync(p, uid, gid) { - throw new Error(`Unimplemented`); - } - async renamePromise(oldP, newP) { - return this.renameSync(oldP, newP); - } - renameSync(oldP, newP) { - throw new Error(`Unimplemented`); - } - async copyFilePromise(sourceP, destP, flags) { - const { indexSource, indexDest, resolvedDestP } = this.prepareCopyFile(sourceP, destP, flags); - const source = await this.getFileSource(indexSource, { asyncDecompress: true }); - const newIndex = this.setFileSource(resolvedDestP, source); - if (newIndex !== indexDest) { - this.registerEntry(resolvedDestP, newIndex); - } - } - copyFileSync(sourceP, destP, flags = 0) { - const { indexSource, indexDest, resolvedDestP } = this.prepareCopyFile(sourceP, destP, flags); - const source = this.getFileSource(indexSource); - const newIndex = this.setFileSource(resolvedDestP, source); - if (newIndex !== indexDest) { - this.registerEntry(resolvedDestP, newIndex); - } - } - prepareCopyFile(sourceP, destP, flags = 0) { - if (this.readOnly) - throw EROFS(`copyfile '${sourceP} -> '${destP}'`); - if ((flags & fs.constants.COPYFILE_FICLONE_FORCE) !== 0) - throw ENOSYS(`unsupported clone operation`, `copyfile '${sourceP}' -> ${destP}'`); - const resolvedSourceP = this.resolveFilename(`copyfile '${sourceP} -> ${destP}'`, sourceP); - const indexSource = this.entries.get(resolvedSourceP); - if (typeof indexSource === `undefined`) - throw EINVAL(`copyfile '${sourceP}' -> '${destP}'`); - const resolvedDestP = this.resolveFilename(`copyfile '${sourceP}' -> ${destP}'`, destP); - const indexDest = this.entries.get(resolvedDestP); - if ((flags & (fs.constants.COPYFILE_EXCL | fs.constants.COPYFILE_FICLONE_FORCE)) !== 0 && typeof indexDest !== `undefined`) - throw EEXIST(`copyfile '${sourceP}' -> '${destP}'`); - return { - indexSource, - resolvedDestP, - indexDest - }; - } - async appendFilePromise(p, content, opts) { - if (this.readOnly) - throw EROFS(`open '${p}'`); - if (typeof opts === `undefined`) - opts = { flag: `a` }; - else if (typeof opts === `string`) - opts = { flag: `a`, encoding: opts }; - else if (typeof opts.flag === `undefined`) - opts = { flag: `a`, ...opts }; - return this.writeFilePromise(p, content, opts); - } - appendFileSync(p, content, opts = {}) { - if (this.readOnly) - throw EROFS(`open '${p}'`); - if (typeof opts === `undefined`) - opts = { flag: `a` }; - else if (typeof opts === `string`) - opts = { flag: `a`, encoding: opts }; - else if (typeof opts.flag === `undefined`) - opts = { flag: `a`, ...opts }; - return this.writeFileSync(p, content, opts); - } - fdToPath(fd, reason) { - const path = this.fds.get(fd)?.p; - if (typeof path === `undefined`) - throw EBADF(reason); - return path; - } - async writeFilePromise(p, content, opts) { - const { encoding, mode, index, resolvedP } = this.prepareWriteFile(p, opts); - if (index !== void 0 && typeof opts === `object` && opts.flag && opts.flag.includes(`a`)) - content = Buffer.concat([await this.getFileSource(index, { asyncDecompress: true }), Buffer.from(content)]); - if (encoding !== null) - content = content.toString(encoding); - const newIndex = this.setFileSource(resolvedP, content); - if (newIndex !== index) - this.registerEntry(resolvedP, newIndex); - if (mode !== null) { - await this.chmodPromise(resolvedP, mode); - } - } - writeFileSync(p, content, opts) { - const { encoding, mode, index, resolvedP } = this.prepareWriteFile(p, opts); - if (index !== void 0 && typeof opts === `object` && opts.flag && opts.flag.includes(`a`)) - content = Buffer.concat([this.getFileSource(index), Buffer.from(content)]); - if (encoding !== null) - content = content.toString(encoding); - const newIndex = this.setFileSource(resolvedP, content); - if (newIndex !== index) - this.registerEntry(resolvedP, newIndex); - if (mode !== null) { - this.chmodSync(resolvedP, mode); - } - } - prepareWriteFile(p, opts) { - if (typeof p === `number`) - p = this.fdToPath(p, `read`); - if (this.readOnly) - throw EROFS(`open '${p}'`); - const resolvedP = this.resolveFilename(`open '${p}'`, p); - if (this.listings.has(resolvedP)) - throw EISDIR(`open '${p}'`); - let encoding = null, mode = null; - if (typeof opts === `string`) { - encoding = opts; - } else if (typeof opts === `object`) { - ({ - encoding = null, - mode = null - } = opts); - } - const index = this.entries.get(resolvedP); - return { - encoding, - mode, - resolvedP, - index - }; - } - async unlinkPromise(p) { - return this.unlinkSync(p); - } - unlinkSync(p) { - if (this.readOnly) - throw EROFS(`unlink '${p}'`); - const resolvedP = this.resolveFilename(`unlink '${p}'`, p); - if (this.listings.has(resolvedP)) - throw EISDIR(`unlink '${p}'`); - const index = this.entries.get(resolvedP); - if (typeof index === `undefined`) - throw EINVAL(`unlink '${p}'`); - this.deleteEntry(resolvedP, index); - } - async utimesPromise(p, atime, mtime) { - return this.utimesSync(p, atime, mtime); - } - utimesSync(p, atime, mtime) { - if (this.readOnly) - throw EROFS(`utimes '${p}'`); - const resolvedP = this.resolveFilename(`utimes '${p}'`, p); - this.utimesImpl(resolvedP, mtime); - } - async lutimesPromise(p, atime, mtime) { - return this.lutimesSync(p, atime, mtime); - } - lutimesSync(p, atime, mtime) { - if (this.readOnly) - throw EROFS(`lutimes '${p}'`); - const resolvedP = this.resolveFilename(`utimes '${p}'`, p, false); - this.utimesImpl(resolvedP, mtime); - } - utimesImpl(resolvedP, mtime) { - if (this.listings.has(resolvedP)) { - if (!this.entries.has(resolvedP)) - this.hydrateDirectory(resolvedP); - } - const entry = this.entries.get(resolvedP); - if (entry === void 0) - throw new Error(`Unreachable`); - const rc = this.libzip.file.setMtime(this.zip, entry, 0, toUnixTimestamp(mtime), 0); - if (rc === -1) { - throw this.makeLibzipError(this.libzip.getError(this.zip)); - } - } - async mkdirPromise(p, opts) { - return this.mkdirSync(p, opts); - } - mkdirSync(p, { mode = 493, recursive = false } = {}) { - if (recursive) - return this.mkdirpSync(p, { chmod: mode }); - if (this.readOnly) - throw EROFS(`mkdir '${p}'`); - const resolvedP = this.resolveFilename(`mkdir '${p}'`, p); - if (this.entries.has(resolvedP) || this.listings.has(resolvedP)) - throw EEXIST(`mkdir '${p}'`); - this.hydrateDirectory(resolvedP); - this.chmodSync(resolvedP, mode); - return void 0; - } - async rmdirPromise(p, opts) { - return this.rmdirSync(p, opts); - } - rmdirSync(p, { recursive = false } = {}) { - if (this.readOnly) - throw EROFS(`rmdir '${p}'`); - if (recursive) { - this.removeSync(p); - return; - } - const resolvedP = this.resolveFilename(`rmdir '${p}'`, p); - const directoryListing = this.listings.get(resolvedP); - if (!directoryListing) - throw ENOTDIR(`rmdir '${p}'`); - if (directoryListing.size > 0) - throw ENOTEMPTY(`rmdir '${p}'`); - const index = this.entries.get(resolvedP); - if (typeof index === `undefined`) - throw EINVAL(`rmdir '${p}'`); - this.deleteEntry(p, index); - } - async rmPromise(p, opts) { - return this.rmSync(p, opts); - } - rmSync(p, { recursive = false } = {}) { - if (this.readOnly) - throw EROFS(`rm '${p}'`); - if (recursive) { - this.removeSync(p); - return; - } - const resolvedP = this.resolveFilename(`rm '${p}'`, p); - const directoryListing = this.listings.get(resolvedP); - if (!directoryListing) - throw ENOTDIR(`rm '${p}'`); - if (directoryListing.size > 0) - throw ENOTEMPTY(`rm '${p}'`); - const index = this.entries.get(resolvedP); - if (typeof index === `undefined`) - throw EINVAL(`rm '${p}'`); - this.deleteEntry(p, index); - } - hydrateDirectory(resolvedP) { - const index = this.libzip.dir.add(this.zip, ppath.relative(PortablePath.root, resolvedP)); - if (index === -1) - throw this.makeLibzipError(this.libzip.getError(this.zip)); - this.registerListing(resolvedP); - this.registerEntry(resolvedP, index); - return index; - } - async linkPromise(existingP, newP) { - return this.linkSync(existingP, newP); - } - linkSync(existingP, newP) { - throw EOPNOTSUPP(`link '${existingP}' -> '${newP}'`); - } - async symlinkPromise(target, p) { - return this.symlinkSync(target, p); - } - symlinkSync(target, p) { - if (this.readOnly) - throw EROFS(`symlink '${target}' -> '${p}'`); - const resolvedP = this.resolveFilename(`symlink '${target}' -> '${p}'`, p); - if (this.listings.has(resolvedP)) - throw EISDIR(`symlink '${target}' -> '${p}'`); - if (this.entries.has(resolvedP)) - throw EEXIST(`symlink '${target}' -> '${p}'`); - const index = this.setFileSource(resolvedP, target); - this.registerEntry(resolvedP, index); - const rc = this.libzip.file.setExternalAttributes(this.zip, index, 0, 0, this.libzip.ZIP_OPSYS_UNIX, (fs.constants.S_IFLNK | 511) << 16); - if (rc === -1) - throw this.makeLibzipError(this.libzip.getError(this.zip)); - this.symlinkCount += 1; - } - async readFilePromise(p, encoding) { - if (typeof encoding === `object`) - encoding = encoding ? encoding.encoding : void 0; - const data = await this.readFileBuffer(p, { asyncDecompress: true }); - return encoding ? data.toString(encoding) : data; - } - readFileSync(p, encoding) { - if (typeof encoding === `object`) - encoding = encoding ? encoding.encoding : void 0; - const data = this.readFileBuffer(p); - return encoding ? data.toString(encoding) : data; - } - readFileBuffer(p, opts = { asyncDecompress: false }) { - if (typeof p === `number`) - p = this.fdToPath(p, `read`); - const resolvedP = this.resolveFilename(`open '${p}'`, p); - if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) - throw ENOENT(`open '${p}'`); - if (p[p.length - 1] === `/` && !this.listings.has(resolvedP)) - throw ENOTDIR(`open '${p}'`); - if (this.listings.has(resolvedP)) - throw EISDIR(`read`); - const entry = this.entries.get(resolvedP); - if (entry === void 0) - throw new Error(`Unreachable`); - return this.getFileSource(entry, opts); - } - async readdirPromise(p, opts) { - return this.readdirSync(p, opts); - } - readdirSync(p, opts) { - const resolvedP = this.resolveFilename(`scandir '${p}'`, p); - if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) - throw ENOENT(`scandir '${p}'`); - const directoryListing = this.listings.get(resolvedP); - if (!directoryListing) - throw ENOTDIR(`scandir '${p}'`); - if (opts?.recursive) { - if (opts?.withFileTypes) { - const entries = Array.from(directoryListing, (name) => { - return Object.assign(this.statImpl(`lstat`, ppath.join(p, name)), { - name, - path: PortablePath.dot - }); - }); - for (const entry of entries) { - if (!entry.isDirectory()) - continue; - const subPath = ppath.join(entry.path, entry.name); - const subListing = this.listings.get(ppath.join(resolvedP, subPath)); - for (const child of subListing) { - entries.push(Object.assign(this.statImpl(`lstat`, ppath.join(p, subPath, child)), { - name: child, - path: subPath - })); - } - } - return entries; - } else { - const entries = [...directoryListing]; - for (const subPath of entries) { - const subListing = this.listings.get(ppath.join(resolvedP, subPath)); - if (typeof subListing === `undefined`) - continue; - for (const child of subListing) { - entries.push(ppath.join(subPath, child)); - } - } - return entries; - } - } else if (opts?.withFileTypes) { - return Array.from(directoryListing, (name) => { - return Object.assign(this.statImpl(`lstat`, ppath.join(p, name)), { - name, - path: void 0 - }); - }); - } else { - return [...directoryListing]; - } - } - async readlinkPromise(p) { - const entry = this.prepareReadlink(p); - return (await this.getFileSource(entry, { asyncDecompress: true })).toString(); - } - readlinkSync(p) { - const entry = this.prepareReadlink(p); - return this.getFileSource(entry).toString(); - } - prepareReadlink(p) { - const resolvedP = this.resolveFilename(`readlink '${p}'`, p, false); - if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) - throw ENOENT(`readlink '${p}'`); - if (p[p.length - 1] === `/` && !this.listings.has(resolvedP)) - throw ENOTDIR(`open '${p}'`); - if (this.listings.has(resolvedP)) - throw EINVAL(`readlink '${p}'`); - const entry = this.entries.get(resolvedP); - if (entry === void 0) - throw new Error(`Unreachable`); - if (!this.isSymbolicLink(entry)) - throw EINVAL(`readlink '${p}'`); - return entry; - } - async truncatePromise(p, len = 0) { - const resolvedP = this.resolveFilename(`open '${p}'`, p); - const index = this.entries.get(resolvedP); - if (typeof index === `undefined`) - throw EINVAL(`open '${p}'`); - const source = await this.getFileSource(index, { asyncDecompress: true }); - const truncated = Buffer.alloc(len, 0); - source.copy(truncated); - return await this.writeFilePromise(p, truncated); - } - truncateSync(p, len = 0) { - const resolvedP = this.resolveFilename(`open '${p}'`, p); - const index = this.entries.get(resolvedP); - if (typeof index === `undefined`) - throw EINVAL(`open '${p}'`); - const source = this.getFileSource(index); - const truncated = Buffer.alloc(len, 0); - source.copy(truncated); - return this.writeFileSync(p, truncated); - } - async ftruncatePromise(fd, len) { - return this.truncatePromise(this.fdToPath(fd, `ftruncate`), len); - } - ftruncateSync(fd, len) { - return this.truncateSync(this.fdToPath(fd, `ftruncateSync`), len); - } - watch(p, a, b) { - let persistent; - switch (typeof a) { - case `function`: - case `string`: - case `undefined`: - { - persistent = true; - } - break; - default: - { - ({ persistent = true } = a); - } - break; - } - if (!persistent) - return { on: () => { - }, close: () => { - } }; - const interval = setInterval(() => { - }, 24 * 60 * 60 * 1e3); - return { on: () => { - }, close: () => { - clearInterval(interval); - } }; - } - watchFile(p, a, b) { - const resolvedP = ppath.resolve(PortablePath.root, p); - return watchFile(this, resolvedP, a, b); - } - unwatchFile(p, cb) { - const resolvedP = ppath.resolve(PortablePath.root, p); - return unwatchFile(this, resolvedP, cb); - } -} - -setFactory(() => { - const emZip = createModule(); - return makeInterface(emZip); -}); - -var ErrorCode = /* @__PURE__ */ ((ErrorCode2) => { - ErrorCode2["API_ERROR"] = `API_ERROR`; - ErrorCode2["BUILTIN_NODE_RESOLUTION_FAILED"] = `BUILTIN_NODE_RESOLUTION_FAILED`; - ErrorCode2["EXPORTS_RESOLUTION_FAILED"] = `EXPORTS_RESOLUTION_FAILED`; - ErrorCode2["MISSING_DEPENDENCY"] = `MISSING_DEPENDENCY`; - ErrorCode2["MISSING_PEER_DEPENDENCY"] = `MISSING_PEER_DEPENDENCY`; - ErrorCode2["QUALIFIED_PATH_RESOLUTION_FAILED"] = `QUALIFIED_PATH_RESOLUTION_FAILED`; - ErrorCode2["INTERNAL"] = `INTERNAL`; - ErrorCode2["UNDECLARED_DEPENDENCY"] = `UNDECLARED_DEPENDENCY`; - ErrorCode2["UNSUPPORTED"] = `UNSUPPORTED`; - return ErrorCode2; -})(ErrorCode || {}); -const MODULE_NOT_FOUND_ERRORS = /* @__PURE__ */ new Set([ - "BUILTIN_NODE_RESOLUTION_FAILED" /* BUILTIN_NODE_RESOLUTION_FAILED */, - "MISSING_DEPENDENCY" /* MISSING_DEPENDENCY */, - "MISSING_PEER_DEPENDENCY" /* MISSING_PEER_DEPENDENCY */, - "QUALIFIED_PATH_RESOLUTION_FAILED" /* QUALIFIED_PATH_RESOLUTION_FAILED */, - "UNDECLARED_DEPENDENCY" /* UNDECLARED_DEPENDENCY */ -]); -function makeError(pnpCode, message, data = {}, code) { - code ??= MODULE_NOT_FOUND_ERRORS.has(pnpCode) ? `MODULE_NOT_FOUND` : pnpCode; - const propertySpec = { - configurable: true, - writable: true, - enumerable: false - }; - return Object.defineProperties(new Error(message), { - code: { - ...propertySpec, - value: code - }, - pnpCode: { - ...propertySpec, - value: pnpCode - }, - data: { - ...propertySpec, - value: data - } - }); -} -function getIssuerModule(parent) { - let issuer = parent; - while (issuer && (issuer.id === `[eval]` || issuer.id === `` || !issuer.filename)) - issuer = issuer.parent; - return issuer || null; -} -function getPathForDisplay(p) { - return npath.normalize(npath.fromPortablePath(p)); -} - -const [major, minor] = process.versions.node.split(`.`).map((value) => parseInt(value, 10)); -const WATCH_MODE_MESSAGE_USES_ARRAYS = major > 19 || major === 19 && minor >= 2 || major === 18 && minor >= 13; - -function readPackageScope(checkPath) { - const rootSeparatorIndex = checkPath.indexOf(npath.sep); - let separatorIndex; - do { - separatorIndex = checkPath.lastIndexOf(npath.sep); - checkPath = checkPath.slice(0, separatorIndex); - if (checkPath.endsWith(`${npath.sep}node_modules`)) - return false; - const pjson = readPackage(checkPath + npath.sep); - if (pjson) { - return { - data: pjson, - path: checkPath - }; - } - } while (separatorIndex > rootSeparatorIndex); - return false; -} -function readPackage(requestPath) { - const jsonPath = npath.resolve(requestPath, `package.json`); - if (!fs__default.default.existsSync(jsonPath)) - return null; - return JSON.parse(fs__default.default.readFileSync(jsonPath, `utf8`)); -} -function ERR_REQUIRE_ESM(filename, parentPath = null) { - const basename = parentPath && path__default.default.basename(filename) === path__default.default.basename(parentPath) ? filename : path__default.default.basename(filename); - const msg = `require() of ES Module ${filename}${parentPath ? ` from ${parentPath}` : ``} not supported. -Instead change the require of ${basename} in ${parentPath} to a dynamic import() which is available in all CommonJS modules.`; - const err = new Error(msg); - err.code = `ERR_REQUIRE_ESM`; - return err; -} -function reportRequiredFilesToWatchMode(files) { - if (process.env.WATCH_REPORT_DEPENDENCIES && process.send) { - files = files.map((filename) => npath.fromPortablePath(VirtualFS.resolveVirtual(npath.toPortablePath(filename)))); - if (WATCH_MODE_MESSAGE_USES_ARRAYS) { - process.send({ "watch:require": files }); - } else { - for (const filename of files) { - process.send({ "watch:require": filename }); - } - } - } -} - -function applyPatch(pnpapi, opts) { - let enableNativeHooks = true; - process.versions.pnp = String(pnpapi.VERSIONS.std); - const moduleExports = require$$0__default.default; - moduleExports.findPnpApi = (lookupSource) => { - const lookupPath = lookupSource instanceof URL ? url.fileURLToPath(lookupSource) : lookupSource; - const apiPath = opts.manager.findApiPathFor(lookupPath); - if (apiPath === null) - return null; - const apiEntry = opts.manager.getApiEntry(apiPath, true); - return apiEntry.instance.findPackageLocator(lookupPath) ? apiEntry.instance : null; - }; - function getRequireStack(parent) { - const requireStack = []; - for (let cursor = parent; cursor; cursor = cursor.parent) - requireStack.push(cursor.filename || cursor.id); - return requireStack; - } - const originalModuleLoad = require$$0.Module._load; - require$$0.Module._load = function(request, parent, isMain) { - if (request === `pnpapi`) { - const parentApiPath = opts.manager.getApiPathFromParent(parent); - if (parentApiPath) { - return opts.manager.getApiEntry(parentApiPath, true).instance; - } - } - return originalModuleLoad.call(require$$0.Module, request, parent, isMain); - }; - function getIssuerSpecsFromPaths(paths) { - return paths.map((path) => ({ - apiPath: opts.manager.findApiPathFor(path), - path, - module: null - })); - } - function getIssuerSpecsFromModule(module) { - if (module && module.id !== `` && module.id !== `internal/preload` && !module.parent && !module.filename && module.paths.length > 0) { - return [{ - apiPath: opts.manager.findApiPathFor(module.paths[0]), - path: module.paths[0], - module - }]; - } - const issuer = getIssuerModule(module); - if (issuer !== null) { - const path = npath.dirname(issuer.filename); - const apiPath = opts.manager.getApiPathFromParent(issuer); - return [{ apiPath, path, module }]; - } else { - const path = process.cwd(); - const apiPath = opts.manager.findApiPathFor(npath.join(path, `[file]`)) ?? opts.manager.getApiPathFromParent(null); - return [{ apiPath, path, module }]; - } - } - function makeFakeParent(path) { - const fakeParent = new require$$0.Module(``); - const fakeFilePath = npath.join(path, `[file]`); - fakeParent.paths = require$$0.Module._nodeModulePaths(fakeFilePath); - return fakeParent; - } - const pathRegExp = /^(?![a-zA-Z]:[\\/]|\\\\|\.{0,2}(?:\/|$))((?:@[^/]+\/)?[^/]+)\/*(.*|)$/; - const originalModuleResolveFilename = require$$0.Module._resolveFilename; - require$$0.Module._resolveFilename = function(request, parent, isMain, options) { - if (require$$0.isBuiltin(request)) - return request; - if (!enableNativeHooks) - return originalModuleResolveFilename.call(require$$0.Module, request, parent, isMain, options); - if (options && options.plugnplay === false) { - const { plugnplay, ...forwardedOptions } = options; - try { - enableNativeHooks = false; - return originalModuleResolveFilename.call(require$$0.Module, request, parent, isMain, forwardedOptions); - } finally { - enableNativeHooks = true; - } - } - if (options) { - const optionNames = new Set(Object.keys(options)); - optionNames.delete(`paths`); - optionNames.delete(`plugnplay`); - if (optionNames.size > 0) { - throw makeError( - ErrorCode.UNSUPPORTED, - `Some options passed to require() aren't supported by PnP yet (${Array.from(optionNames).join(`, `)})` - ); - } - } - const issuerSpecs = options && options.paths ? getIssuerSpecsFromPaths(options.paths) : getIssuerSpecsFromModule(parent); - if (request.match(pathRegExp) === null) { - const parentDirectory = parent?.filename != null ? npath.dirname(parent.filename) : null; - const absoluteRequest = npath.isAbsolute(request) ? request : parentDirectory !== null ? npath.resolve(parentDirectory, request) : null; - if (absoluteRequest !== null) { - const apiPath = parent && parentDirectory === npath.dirname(absoluteRequest) ? opts.manager.getApiPathFromParent(parent) : opts.manager.findApiPathFor(absoluteRequest); - if (apiPath !== null) { - issuerSpecs.unshift({ - apiPath, - path: parentDirectory, - module: null - }); - } - } - } - let firstError; - for (const { apiPath, path, module } of issuerSpecs) { - let resolution; - const issuerApi = apiPath !== null ? opts.manager.getApiEntry(apiPath, true).instance : null; - try { - if (issuerApi !== null) { - resolution = issuerApi.resolveRequest(request, path !== null ? `${path}/` : null); - } else { - if (path === null) - throw new Error(`Assertion failed: Expected the path to be set`); - resolution = originalModuleResolveFilename.call(require$$0.Module, request, module || makeFakeParent(path), isMain); - } - } catch (error) { - firstError = firstError || error; - continue; - } - if (resolution !== null) { - return resolution; - } - } - const requireStack = getRequireStack(parent); - Object.defineProperty(firstError, `requireStack`, { - configurable: true, - writable: true, - enumerable: false, - value: requireStack - }); - if (requireStack.length > 0) - firstError.message += ` -Require stack: -- ${requireStack.join(` -- `)}`; - if (typeof firstError.pnpCode === `string`) - Error.captureStackTrace(firstError); - throw firstError; - }; - const originalFindPath = require$$0.Module._findPath; - require$$0.Module._findPath = function(request, paths, isMain) { - if (request === `pnpapi`) - return false; - if (!enableNativeHooks) - return originalFindPath.call(require$$0.Module, request, paths, isMain); - const isAbsolute = npath.isAbsolute(request); - if (isAbsolute) - paths = [``]; - else if (!paths || paths.length === 0) - return false; - for (const path of paths) { - let resolution; - try { - const pnpApiPath = opts.manager.findApiPathFor(isAbsolute ? request : path); - if (pnpApiPath !== null) { - const api = opts.manager.getApiEntry(pnpApiPath, true).instance; - resolution = api.resolveRequest(request, path) || false; - } else { - resolution = originalFindPath.call(require$$0.Module, request, [path], isMain); - } - } catch (error) { - continue; - } - if (resolution) { - return resolution; - } - } - return false; - }; - const originalExtensionJSFunction = require$$0.Module._extensions[`.js`]; - require$$0.Module._extensions[`.js`] = function(module, filename) { - if (filename.endsWith(`.js`)) { - const pkg = readPackageScope(filename); - if (pkg && pkg.data?.type === `module`) { - const err = ERR_REQUIRE_ESM(filename, module.parent?.filename); - Error.captureStackTrace(err); - throw err; - } - } - originalExtensionJSFunction.call(this, module, filename); - }; - const originalDlopen = process.dlopen; - process.dlopen = function(...args) { - const [module, filename, ...rest] = args; - return originalDlopen.call( - this, - module, - npath.fromPortablePath(VirtualFS.resolveVirtual(npath.toPortablePath(filename))), - ...rest - ); - }; - const originalEmit = process.emit; - process.emit = function(name, data, ...args) { - if (name === `warning` && typeof data === `object` && data.name === `ExperimentalWarning` && (data.message.includes(`--experimental-loader`) || data.message.includes(`Custom ESM Loaders is an experimental feature`))) - return false; - return originalEmit.apply(process, arguments); - }; - patchFs(fs__default.default, new PosixFS(opts.fakeFs)); -} - -function hydrateRuntimeState(data, { basePath }) { - const portablePath = npath.toPortablePath(basePath); - const absolutePortablePath = ppath.resolve(portablePath); - const ignorePattern = data.ignorePatternData !== null ? new RegExp(data.ignorePatternData) : null; - const packageLocatorsByLocations = /* @__PURE__ */ new Map(); - const packageRegistry = new Map(data.packageRegistryData.map(([packageName, packageStoreData]) => { - return [packageName, new Map(packageStoreData.map(([packageReference, packageInformationData]) => { - if (packageName === null !== (packageReference === null)) - throw new Error(`Assertion failed: The name and reference should be null, or neither should`); - const discardFromLookup = packageInformationData.discardFromLookup ?? false; - const packageLocator = { name: packageName, reference: packageReference }; - const entry = packageLocatorsByLocations.get(packageInformationData.packageLocation); - if (!entry) { - packageLocatorsByLocations.set(packageInformationData.packageLocation, { locator: packageLocator, discardFromLookup }); - } else { - entry.discardFromLookup = entry.discardFromLookup && discardFromLookup; - if (!discardFromLookup) { - entry.locator = packageLocator; - } - } - let resolvedPackageLocation = null; - return [packageReference, { - packageDependencies: new Map(packageInformationData.packageDependencies), - packagePeers: new Set(packageInformationData.packagePeers), - linkType: packageInformationData.linkType, - discardFromLookup, - get packageLocation() { - return resolvedPackageLocation || (resolvedPackageLocation = ppath.join(absolutePortablePath, packageInformationData.packageLocation)); - } - }]; - }))]; - })); - const fallbackExclusionList = new Map(data.fallbackExclusionList.map(([packageName, packageReferences]) => { - return [packageName, new Set(packageReferences)]; - })); - const fallbackPool = new Map(data.fallbackPool); - const dependencyTreeRoots = data.dependencyTreeRoots; - const enableTopLevelFallback = data.enableTopLevelFallback; - return { - basePath: portablePath, - dependencyTreeRoots, - enableTopLevelFallback, - fallbackExclusionList, - fallbackPool, - ignorePattern, - packageLocatorsByLocations, - packageRegistry - }; -} - -const ArrayIsArray = Array.isArray; -const JSONStringify = JSON.stringify; -const ObjectGetOwnPropertyNames = Object.getOwnPropertyNames; -const ObjectPrototypeHasOwnProperty = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop); -const RegExpPrototypeExec = (obj, string) => RegExp.prototype.exec.call(obj, string); -const RegExpPrototypeSymbolReplace = (obj, ...rest) => RegExp.prototype[Symbol.replace].apply(obj, rest); -const StringPrototypeEndsWith = (str, ...rest) => String.prototype.endsWith.apply(str, rest); -const StringPrototypeIncludes = (str, ...rest) => String.prototype.includes.apply(str, rest); -const StringPrototypeLastIndexOf = (str, ...rest) => String.prototype.lastIndexOf.apply(str, rest); -const StringPrototypeIndexOf = (str, ...rest) => String.prototype.indexOf.apply(str, rest); -const StringPrototypeReplace = (str, ...rest) => String.prototype.replace.apply(str, rest); -const StringPrototypeSlice = (str, ...rest) => String.prototype.slice.apply(str, rest); -const StringPrototypeStartsWith = (str, ...rest) => String.prototype.startsWith.apply(str, rest); -const SafeMap = Map; -const JSONParse = JSON.parse; - -function createErrorType(code, messageCreator, errorType) { - return class extends errorType { - constructor(...args) { - super(messageCreator(...args)); - this.code = code; - this.name = `${errorType.name} [${code}]`; - } - }; -} -const ERR_PACKAGE_IMPORT_NOT_DEFINED = createErrorType( - `ERR_PACKAGE_IMPORT_NOT_DEFINED`, - (specifier, packagePath, base) => { - return `Package import specifier "${specifier}" is not defined${packagePath ? ` in package ${packagePath}package.json` : ``} imported from ${base}`; - }, - TypeError -); -const ERR_INVALID_MODULE_SPECIFIER = createErrorType( - `ERR_INVALID_MODULE_SPECIFIER`, - (request, reason, base = void 0) => { - return `Invalid module "${request}" ${reason}${base ? ` imported from ${base}` : ``}`; - }, - TypeError -); -const ERR_INVALID_PACKAGE_TARGET = createErrorType( - `ERR_INVALID_PACKAGE_TARGET`, - (pkgPath, key, target, isImport = false, base = void 0) => { - const relError = typeof target === `string` && !isImport && target.length && !StringPrototypeStartsWith(target, `./`); - if (key === `.`) { - assert__default.default(isImport === false); - return `Invalid "exports" main target ${JSONStringify(target)} defined in the package config ${pkgPath}package.json${base ? ` imported from ${base}` : ``}${relError ? `; targets must start with "./"` : ``}`; - } - return `Invalid "${isImport ? `imports` : `exports`}" target ${JSONStringify( - target - )} defined for '${key}' in the package config ${pkgPath}package.json${base ? ` imported from ${base}` : ``}${relError ? `; targets must start with "./"` : ``}`; - }, - Error -); -const ERR_INVALID_PACKAGE_CONFIG = createErrorType( - `ERR_INVALID_PACKAGE_CONFIG`, - (path, base, message) => { - return `Invalid package config ${path}${base ? ` while importing ${base}` : ``}${message ? `. ${message}` : ``}`; - }, - Error -); -const ERR_PACKAGE_PATH_NOT_EXPORTED = createErrorType( - "ERR_PACKAGE_PATH_NOT_EXPORTED", - (pkgPath, subpath, base = void 0) => { - if (subpath === ".") - return `No "exports" main defined in ${pkgPath}package.json${base ? ` imported from ${base}` : ""}`; - return `Package subpath '${subpath}' is not defined by "exports" in ${pkgPath}package.json${base ? ` imported from ${base}` : ""}`; - }, - Error -); - -function filterOwnProperties(source, keys) { - const filtered = /* @__PURE__ */ Object.create(null); - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - if (ObjectPrototypeHasOwnProperty(source, key)) { - filtered[key] = source[key]; - } - } - return filtered; -} - -const packageJSONCache = new SafeMap(); -function getPackageConfig(path, specifier, base, readFileSyncFn) { - const existing = packageJSONCache.get(path); - if (existing !== void 0) { - return existing; - } - const source = readFileSyncFn(path); - if (source === void 0) { - const packageConfig2 = { - pjsonPath: path, - exists: false, - main: void 0, - name: void 0, - type: "none", - exports: void 0, - imports: void 0 - }; - packageJSONCache.set(path, packageConfig2); - return packageConfig2; - } - let packageJSON; - try { - packageJSON = JSONParse(source); - } catch (error) { - throw new ERR_INVALID_PACKAGE_CONFIG( - path, - (base ? `"${specifier}" from ` : "") + url.fileURLToPath(base || specifier), - error.message - ); - } - let { imports, main, name, type } = filterOwnProperties(packageJSON, [ - "imports", - "main", - "name", - "type" - ]); - const exports = ObjectPrototypeHasOwnProperty(packageJSON, "exports") ? packageJSON.exports : void 0; - if (typeof imports !== "object" || imports === null) { - imports = void 0; - } - if (typeof main !== "string") { - main = void 0; - } - if (typeof name !== "string") { - name = void 0; - } - if (type !== "module" && type !== "commonjs") { - type = "none"; - } - const packageConfig = { - pjsonPath: path, - exists: true, - main, - name, - type, - exports, - imports - }; - packageJSONCache.set(path, packageConfig); - return packageConfig; -} -function getPackageScopeConfig(resolved, readFileSyncFn) { - let packageJSONUrl = new URL("./package.json", resolved); - while (true) { - const packageJSONPath2 = packageJSONUrl.pathname; - if (StringPrototypeEndsWith(packageJSONPath2, "node_modules/package.json")) { - break; - } - const packageConfig2 = getPackageConfig( - url.fileURLToPath(packageJSONUrl), - resolved, - void 0, - readFileSyncFn - ); - if (packageConfig2.exists) { - return packageConfig2; - } - const lastPackageJSONUrl = packageJSONUrl; - packageJSONUrl = new URL("../package.json", packageJSONUrl); - if (packageJSONUrl.pathname === lastPackageJSONUrl.pathname) { - break; - } - } - const packageJSONPath = url.fileURLToPath(packageJSONUrl); - const packageConfig = { - pjsonPath: packageJSONPath, - exists: false, - main: void 0, - name: void 0, - type: "none", - exports: void 0, - imports: void 0 - }; - packageJSONCache.set(packageJSONPath, packageConfig); - return packageConfig; -} - -function throwImportNotDefined(specifier, packageJSONUrl, base) { - throw new ERR_PACKAGE_IMPORT_NOT_DEFINED( - specifier, - packageJSONUrl && url.fileURLToPath(new URL(".", packageJSONUrl)), - url.fileURLToPath(base) - ); -} -function throwInvalidSubpath(subpath, packageJSONUrl, internal, base) { - const reason = `request is not a valid subpath for the "${internal ? "imports" : "exports"}" resolution of ${url.fileURLToPath(packageJSONUrl)}`; - throw new ERR_INVALID_MODULE_SPECIFIER( - subpath, - reason, - base && url.fileURLToPath(base) - ); -} -function throwInvalidPackageTarget(subpath, target, packageJSONUrl, internal, base) { - if (typeof target === "object" && target !== null) { - target = JSONStringify(target, null, ""); - } else { - target = `${target}`; - } - throw new ERR_INVALID_PACKAGE_TARGET( - url.fileURLToPath(new URL(".", packageJSONUrl)), - subpath, - target, - internal, - base && url.fileURLToPath(base) - ); -} -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; -const patternRegEx = /\*/g; -function resolvePackageTargetString(target, subpath, match, packageJSONUrl, base, pattern, internal, conditions) { - if (subpath !== "" && !pattern && target[target.length - 1] !== "/") - throwInvalidPackageTarget(match, target, packageJSONUrl, internal, base); - if (!StringPrototypeStartsWith(target, "./")) { - if (internal && !StringPrototypeStartsWith(target, "../") && !StringPrototypeStartsWith(target, "/")) { - let isURL = false; - try { - new URL(target); - isURL = true; - } catch { - } - if (!isURL) { - const exportTarget = pattern ? RegExpPrototypeSymbolReplace(patternRegEx, target, () => subpath) : target + subpath; - return exportTarget; - } - } - throwInvalidPackageTarget(match, target, packageJSONUrl, internal, base); - } - if (RegExpPrototypeExec( - invalidSegmentRegEx, - StringPrototypeSlice(target, 2) - ) !== null) - throwInvalidPackageTarget(match, target, packageJSONUrl, internal, base); - const resolved = new URL(target, packageJSONUrl); - const resolvedPath = resolved.pathname; - const packagePath = new URL(".", packageJSONUrl).pathname; - if (!StringPrototypeStartsWith(resolvedPath, packagePath)) - throwInvalidPackageTarget(match, target, packageJSONUrl, internal, base); - if (subpath === "") - return resolved; - if (RegExpPrototypeExec(invalidSegmentRegEx, subpath) !== null) { - const request = pattern ? StringPrototypeReplace(match, "*", () => subpath) : match + subpath; - throwInvalidSubpath(request, packageJSONUrl, internal, base); - } - if (pattern) { - return new URL( - RegExpPrototypeSymbolReplace(patternRegEx, resolved.href, () => subpath) - ); - } - return new URL(subpath, resolved); -} -function isArrayIndex(key) { - const keyNum = +key; - if (`${keyNum}` !== key) - return false; - return keyNum >= 0 && keyNum < 4294967295; -} -function resolvePackageTarget(packageJSONUrl, target, subpath, packageSubpath, base, pattern, internal, conditions) { - if (typeof target === "string") { - return resolvePackageTargetString( - target, - subpath, - packageSubpath, - packageJSONUrl, - base, - pattern, - internal); - } else if (ArrayIsArray(target)) { - if (target.length === 0) { - return null; - } - let lastException; - for (let i = 0; i < target.length; i++) { - const targetItem = target[i]; - let resolveResult; - try { - resolveResult = resolvePackageTarget( - packageJSONUrl, - targetItem, - subpath, - packageSubpath, - base, - pattern, - internal, - conditions - ); - } catch (e) { - lastException = e; - if (e.code === "ERR_INVALID_PACKAGE_TARGET") { - continue; - } - throw e; - } - if (resolveResult === void 0) { - continue; - } - if (resolveResult === null) { - lastException = null; - continue; - } - return resolveResult; - } - if (lastException === void 0 || lastException === null) - return lastException; - throw lastException; - } else if (typeof target === "object" && target !== null) { - const keys = ObjectGetOwnPropertyNames(target); - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - if (isArrayIndex(key)) { - throw new ERR_INVALID_PACKAGE_CONFIG( - url.fileURLToPath(packageJSONUrl), - base, - '"exports" cannot contain numeric property keys.' - ); - } - } - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - if (key === "default" || conditions.has(key)) { - const conditionalTarget = target[key]; - const resolveResult = resolvePackageTarget( - packageJSONUrl, - conditionalTarget, - subpath, - packageSubpath, - base, - pattern, - internal, - conditions - ); - if (resolveResult === void 0) - continue; - return resolveResult; - } - } - return void 0; - } else if (target === null) { - return null; - } - throwInvalidPackageTarget( - packageSubpath, - target, - packageJSONUrl, - internal, - base - ); -} -function patternKeyCompare(a, b) { - const aPatternIndex = StringPrototypeIndexOf(a, "*"); - const bPatternIndex = StringPrototypeIndexOf(b, "*"); - 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; -} -function isConditionalExportsMainSugar(exports, packageJSONUrl, base) { - if (typeof exports === "string" || ArrayIsArray(exports)) - return true; - if (typeof exports !== "object" || exports === null) - return false; - const keys = ObjectGetOwnPropertyNames(exports); - let isConditionalSugar = false; - let i = 0; - for (let j = 0; j < keys.length; j++) { - const key = keys[j]; - const curIsConditionalSugar = key === "" || key[0] !== "."; - if (i++ === 0) { - isConditionalSugar = curIsConditionalSugar; - } else if (isConditionalSugar !== curIsConditionalSugar) { - throw new ERR_INVALID_PACKAGE_CONFIG( - url.fileURLToPath(packageJSONUrl), - base, - `"exports" cannot contain some keys starting with '.' and some not. The exports object must either be an object of package subpath keys or an object of main entry condition name keys only.` - ); - } - } - return isConditionalSugar; -} -function throwExportsNotFound(subpath, packageJSONUrl, base) { - throw new ERR_PACKAGE_PATH_NOT_EXPORTED( - url.fileURLToPath(new URL(".", packageJSONUrl)), - subpath, - base && url.fileURLToPath(base) - ); -} -const emittedPackageWarnings = /* @__PURE__ */ new Set(); -function emitTrailingSlashPatternDeprecation(match, pjsonUrl, base) { - const pjsonPath = url.fileURLToPath(pjsonUrl); - if (emittedPackageWarnings.has(pjsonPath + "|" + match)) - return; - emittedPackageWarnings.add(pjsonPath + "|" + match); - process.emitWarning( - `Use of deprecated trailing slash pattern mapping "${match}" in the "exports" field module resolution of the package at ${pjsonPath}${base ? ` imported from ${url.fileURLToPath(base)}` : ""}. Mapping specifiers ending in "/" is no longer supported.`, - "DeprecationWarning", - "DEP0155" - ); -} -function packageExportsResolve({ - packageJSONUrl, - packageSubpath, - exports, - base, - conditions -}) { - if (isConditionalExportsMainSugar(exports, packageJSONUrl, base)) - exports = { ".": exports }; - if (ObjectPrototypeHasOwnProperty(exports, packageSubpath) && !StringPrototypeIncludes(packageSubpath, "*") && !StringPrototypeEndsWith(packageSubpath, "/")) { - const target = exports[packageSubpath]; - const resolveResult = resolvePackageTarget( - packageJSONUrl, - target, - "", - packageSubpath, - base, - false, - false, - conditions - ); - if (resolveResult == null) { - throwExportsNotFound(packageSubpath, packageJSONUrl, base); - } - return resolveResult; - } - let bestMatch = ""; - let bestMatchSubpath; - const keys = ObjectGetOwnPropertyNames(exports); - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - const patternIndex = StringPrototypeIndexOf(key, "*"); - if (patternIndex !== -1 && StringPrototypeStartsWith( - packageSubpath, - StringPrototypeSlice(key, 0, patternIndex) - )) { - if (StringPrototypeEndsWith(packageSubpath, "/")) - emitTrailingSlashPatternDeprecation( - packageSubpath, - packageJSONUrl, - base - ); - const patternTrailer = StringPrototypeSlice(key, patternIndex + 1); - if (packageSubpath.length >= key.length && StringPrototypeEndsWith(packageSubpath, patternTrailer) && patternKeyCompare(bestMatch, key) === 1 && StringPrototypeLastIndexOf(key, "*") === patternIndex) { - bestMatch = key; - bestMatchSubpath = StringPrototypeSlice( - packageSubpath, - patternIndex, - packageSubpath.length - patternTrailer.length - ); - } - } - } - if (bestMatch) { - const target = exports[bestMatch]; - const resolveResult = resolvePackageTarget( - packageJSONUrl, - target, - bestMatchSubpath, - bestMatch, - base, - true, - false, - conditions - ); - if (resolveResult == null) { - throwExportsNotFound(packageSubpath, packageJSONUrl, base); - } - return resolveResult; - } - throwExportsNotFound(packageSubpath, packageJSONUrl, base); -} -function packageImportsResolve({ name, base, conditions, readFileSyncFn }) { - if (name === "#" || StringPrototypeStartsWith(name, "#/") || StringPrototypeEndsWith(name, "/")) { - const reason = "is not a valid internal imports specifier name"; - throw new ERR_INVALID_MODULE_SPECIFIER(name, reason, url.fileURLToPath(base)); - } - let packageJSONUrl; - const packageConfig = getPackageScopeConfig(base, readFileSyncFn); - if (packageConfig.exists) { - packageJSONUrl = url.pathToFileURL(packageConfig.pjsonPath); - const imports = packageConfig.imports; - if (imports) { - if (ObjectPrototypeHasOwnProperty(imports, name) && !StringPrototypeIncludes(name, "*")) { - const resolveResult = resolvePackageTarget( - packageJSONUrl, - imports[name], - "", - name, - base, - false, - true, - conditions - ); - if (resolveResult != null) { - return resolveResult; - } - } else { - let bestMatch = ""; - let bestMatchSubpath; - const keys = ObjectGetOwnPropertyNames(imports); - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - const patternIndex = StringPrototypeIndexOf(key, "*"); - if (patternIndex !== -1 && StringPrototypeStartsWith( - name, - StringPrototypeSlice(key, 0, patternIndex) - )) { - const patternTrailer = StringPrototypeSlice(key, patternIndex + 1); - if (name.length >= key.length && StringPrototypeEndsWith(name, patternTrailer) && patternKeyCompare(bestMatch, key) === 1 && StringPrototypeLastIndexOf(key, "*") === patternIndex) { - bestMatch = key; - bestMatchSubpath = StringPrototypeSlice( - name, - patternIndex, - name.length - patternTrailer.length - ); - } - } - } - if (bestMatch) { - const target = imports[bestMatch]; - const resolveResult = resolvePackageTarget( - packageJSONUrl, - target, - bestMatchSubpath, - bestMatch, - base, - true, - true, - conditions - ); - if (resolveResult != null) { - return resolveResult; - } - } - } - } - } - throwImportNotDefined(name, packageJSONUrl, base); -} - -const flagSymbol = Symbol('arg flag'); - -class ArgError extends Error { - constructor(msg, code) { - super(msg); - this.name = 'ArgError'; - this.code = code; - - Object.setPrototypeOf(this, ArgError.prototype); - } -} - -function arg( - opts, - { - argv = process.argv.slice(2), - permissive = false, - stopAtPositional = false - } = {} -) { - if (!opts) { - throw new ArgError( - 'argument specification object is required', - 'ARG_CONFIG_NO_SPEC' - ); - } - - const result = { _: [] }; - - const aliases = {}; - const handlers = {}; - - for (const key of Object.keys(opts)) { - if (!key) { - throw new ArgError( - 'argument key cannot be an empty string', - 'ARG_CONFIG_EMPTY_KEY' - ); - } - - if (key[0] !== '-') { - throw new ArgError( - `argument key must start with '-' but found: '${key}'`, - 'ARG_CONFIG_NONOPT_KEY' - ); - } - - if (key.length === 1) { - throw new ArgError( - `argument key must have a name; singular '-' keys are not allowed: ${key}`, - 'ARG_CONFIG_NONAME_KEY' - ); - } - - if (typeof opts[key] === 'string') { - aliases[key] = opts[key]; - continue; - } - - let type = opts[key]; - let isFlag = false; - - if ( - Array.isArray(type) && - type.length === 1 && - typeof type[0] === 'function' - ) { - const [fn] = type; - type = (value, name, prev = []) => { - prev.push(fn(value, name, prev[prev.length - 1])); - return prev; - }; - isFlag = fn === Boolean || fn[flagSymbol] === true; - } else if (typeof type === 'function') { - isFlag = type === Boolean || type[flagSymbol] === true; - } else { - throw new ArgError( - `type missing or not a function or valid array type: ${key}`, - 'ARG_CONFIG_VAD_TYPE' - ); - } - - if (key[1] !== '-' && key.length > 2) { - throw new ArgError( - `short argument keys (with a single hyphen) must have only one character: ${key}`, - 'ARG_CONFIG_SHORTOPT_TOOLONG' - ); - } - - handlers[key] = [type, isFlag]; - } - - for (let i = 0, len = argv.length; i < len; i++) { - const wholeArg = argv[i]; - - if (stopAtPositional && result._.length > 0) { - result._ = result._.concat(argv.slice(i)); - break; - } - - if (wholeArg === '--') { - result._ = result._.concat(argv.slice(i + 1)); - break; - } - - if (wholeArg.length > 1 && wholeArg[0] === '-') { - /* eslint-disable operator-linebreak */ - const separatedArguments = - wholeArg[1] === '-' || wholeArg.length === 2 - ? [wholeArg] - : wholeArg - .slice(1) - .split('') - .map((a) => `-${a}`); - /* eslint-enable operator-linebreak */ - - for (let j = 0; j < separatedArguments.length; j++) { - const arg = separatedArguments[j]; - const [originalArgName, argStr] = - arg[1] === '-' ? arg.split(/=(.*)/, 2) : [arg, undefined]; - - let argName = originalArgName; - while (argName in aliases) { - argName = aliases[argName]; - } - - if (!(argName in handlers)) { - if (permissive) { - result._.push(arg); - continue; - } else { - throw new ArgError( - `unknown or unexpected option: ${originalArgName}`, - 'ARG_UNKNOWN_OPTION' - ); - } - } - - const [type, isFlag] = handlers[argName]; - - if (!isFlag && j + 1 < separatedArguments.length) { - throw new ArgError( - `option requires argument (but was followed by another short argument): ${originalArgName}`, - 'ARG_MISSING_REQUIRED_SHORTARG' - ); - } - - if (isFlag) { - result[argName] = type(true, argName, result[argName]); - } else if (argStr === undefined) { - if ( - argv.length < i + 2 || - (argv[i + 1].length > 1 && - argv[i + 1][0] === '-' && - !( - argv[i + 1].match(/^-?\d*(\.(?=\d))?\d*$/) && - (type === Number || - // eslint-disable-next-line no-undef - (typeof BigInt !== 'undefined' && type === BigInt)) - )) - ) { - const extended = - originalArgName === argName ? '' : ` (alias for ${argName})`; - throw new ArgError( - `option requires argument: ${originalArgName}${extended}`, - 'ARG_MISSING_REQUIRED_LONGARG' - ); - } - - result[argName] = type(argv[i + 1], argName, result[argName]); - ++i; - } else { - result[argName] = type(argStr, argName, result[argName]); - } - } - } else { - result._.push(wholeArg); - } - } - - return result; -} - -arg.flag = (fn) => { - fn[flagSymbol] = true; - return fn; -}; - -// Utility types -arg.COUNT = arg.flag((v, name, existingCount) => (existingCount || 0) + 1); - -// Expose error class -arg.ArgError = ArgError; - -var arg_1 = arg; - -/** - @license - The MIT License (MIT) - - Copyright (c) 2014 Blake Embrey (hello@blakeembrey.com) - - 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. -*/ -function getOptionValue(opt) { - parseOptions(); - return options[opt]; -} -let options; -function parseOptions() { - if (!options) { - options = { - "--conditions": [], - ...parseArgv(getNodeOptionsEnvArgv()), - ...parseArgv(process.execArgv) - }; - } -} -function parseArgv(argv) { - return arg_1( - { - "--conditions": [String], - "-C": "--conditions" - }, - { - argv, - permissive: true - } - ); -} -function getNodeOptionsEnvArgv() { - const errors = []; - const envArgv = ParseNodeOptionsEnvVar(process.env.NODE_OPTIONS || "", errors); - if (errors.length !== 0) ; - return envArgv; -} -function ParseNodeOptionsEnvVar(node_options, errors) { - const env_argv = []; - let is_in_string = false; - let will_start_new_arg = true; - for (let index = 0; index < node_options.length; ++index) { - let c = node_options[index]; - if (c === "\\" && is_in_string) { - if (index + 1 === node_options.length) { - errors.push("invalid value for NODE_OPTIONS (invalid escape)\n"); - return env_argv; - } else { - c = node_options[++index]; - } - } else if (c === " " && !is_in_string) { - will_start_new_arg = true; - continue; - } else if (c === '"') { - is_in_string = !is_in_string; - continue; - } - if (will_start_new_arg) { - env_argv.push(c); - will_start_new_arg = false; - } else { - env_argv[env_argv.length - 1] += c; - } - } - if (is_in_string) { - errors.push("invalid value for NODE_OPTIONS (unterminated string)\n"); - } - return env_argv; -} - -function makeApi(runtimeState, opts) { - const alwaysWarnOnFallback = Number(process.env.PNP_ALWAYS_WARN_ON_FALLBACK) > 0; - const debugLevel = Number(process.env.PNP_DEBUG_LEVEL); - const pathRegExp = /^(?![a-zA-Z]:[\\/]|\\\\|\.{0,2}(?:\/|$))((?:node:)?(?:@[^/]+\/)?[^/]+)\/*(.*|)$/; - const isStrictRegExp = /^(\/|\.{1,2}(\/|$))/; - const isDirRegExp = /\/$/; - const isRelativeRegexp = /^\.{0,2}\//; - const topLevelLocator = { name: null, reference: null }; - const fallbackLocators = []; - const emittedWarnings = /* @__PURE__ */ new Set(); - if (runtimeState.enableTopLevelFallback === true) - fallbackLocators.push(topLevelLocator); - if (opts.compatibilityMode !== false) { - for (const name of [`react-scripts`, `gatsby`]) { - const packageStore = runtimeState.packageRegistry.get(name); - if (packageStore) { - for (const reference of packageStore.keys()) { - if (reference === null) { - throw new Error(`Assertion failed: This reference shouldn't be null`); - } else { - fallbackLocators.push({ name, reference }); - } - } - } - } - } - const { - ignorePattern, - packageRegistry, - packageLocatorsByLocations - } = runtimeState; - function makeLogEntry(name, args) { - return { - fn: name, - args, - error: null, - result: null - }; - } - function trace(entry) { - const colors = process.stderr?.hasColors?.() ?? process.stdout.isTTY; - const c = (n, str) => `\x1B[${n}m${str}\x1B[0m`; - const error = entry.error; - if (error) - console.error(c(`31;1`, `\u2716 ${entry.error?.message.replace(/\n.*/s, ``)}`)); - else - console.error(c(`33;1`, `\u203C Resolution`)); - if (entry.args.length > 0) - console.error(); - for (const arg of entry.args) - console.error(` ${c(`37;1`, `In \u2190`)} ${nodeUtils.inspect(arg, { colors, compact: true })}`); - if (entry.result) { - console.error(); - console.error(` ${c(`37;1`, `Out \u2192`)} ${nodeUtils.inspect(entry.result, { colors, compact: true })}`); - } - const stack = new Error().stack.match(/(?<=^ +)at.*/gm)?.slice(2) ?? []; - if (stack.length > 0) { - console.error(); - for (const line of stack) { - console.error(` ${c(`38;5;244`, line)}`); - } - } - console.error(); - } - function maybeLog(name, fn) { - if (opts.allowDebug === false) - return fn; - if (Number.isFinite(debugLevel)) { - if (debugLevel >= 2) { - return (...args) => { - const logEntry = makeLogEntry(name, args); - try { - return logEntry.result = fn(...args); - } catch (error) { - throw logEntry.error = error; - } finally { - trace(logEntry); - } - }; - } else if (debugLevel >= 1) { - return (...args) => { - try { - return fn(...args); - } catch (error) { - const logEntry = makeLogEntry(name, args); - logEntry.error = error; - trace(logEntry); - throw error; - } - }; - } - } - return fn; - } - function getPackageInformationSafe(packageLocator) { - const packageInformation = getPackageInformation(packageLocator); - if (!packageInformation) { - throw makeError( - ErrorCode.INTERNAL, - `Couldn't find a matching entry in the dependency tree for the specified parent (this is probably an internal error)` - ); - } - return packageInformation; - } - function isDependencyTreeRoot(packageLocator) { - if (packageLocator.name === null) - return true; - for (const dependencyTreeRoot of runtimeState.dependencyTreeRoots) - if (dependencyTreeRoot.name === packageLocator.name && dependencyTreeRoot.reference === packageLocator.reference) - return true; - return false; - } - const defaultExportsConditions = /* @__PURE__ */ new Set([ - `node`, - `require`, - ...getOptionValue(`--conditions`) - ]); - function applyNodeExportsResolution(unqualifiedPath, conditions = defaultExportsConditions, issuer) { - const locator = findPackageLocator(ppath.join(unqualifiedPath, `internal.js`), { - resolveIgnored: true, - includeDiscardFromLookup: true - }); - if (locator === null) { - throw makeError( - ErrorCode.INTERNAL, - `The locator that owns the "${unqualifiedPath}" path can't be found inside the dependency tree (this is probably an internal error)` - ); - } - const { packageLocation } = getPackageInformationSafe(locator); - const manifestPath = ppath.join(packageLocation, Filename.manifest); - if (!opts.fakeFs.existsSync(manifestPath)) - return null; - const pkgJson = JSON.parse(opts.fakeFs.readFileSync(manifestPath, `utf8`)); - if (pkgJson.exports == null) - return null; - let subpath = ppath.contains(packageLocation, unqualifiedPath); - if (subpath === null) { - throw makeError( - ErrorCode.INTERNAL, - `unqualifiedPath doesn't contain the packageLocation (this is probably an internal error)` - ); - } - if (subpath !== `.` && !isRelativeRegexp.test(subpath)) - subpath = `./${subpath}`; - try { - const resolvedExport = packageExportsResolve({ - packageJSONUrl: url.pathToFileURL(npath.fromPortablePath(manifestPath)), - packageSubpath: subpath, - exports: pkgJson.exports, - base: issuer ? url.pathToFileURL(npath.fromPortablePath(issuer)) : null, - conditions - }); - return npath.toPortablePath(url.fileURLToPath(resolvedExport)); - } catch (error) { - throw makeError( - ErrorCode.EXPORTS_RESOLUTION_FAILED, - error.message, - { unqualifiedPath: getPathForDisplay(unqualifiedPath), locator, pkgJson, subpath: getPathForDisplay(subpath), conditions }, - error.code - ); - } - } - function applyNodeExtensionResolution(unqualifiedPath, candidates, { extensions }) { - let stat; - try { - candidates.push(unqualifiedPath); - stat = opts.fakeFs.statSync(unqualifiedPath); - } catch (error) { - } - if (stat && !stat.isDirectory()) - return opts.fakeFs.realpathSync(unqualifiedPath); - if (stat && stat.isDirectory()) { - let pkgJson; - try { - pkgJson = JSON.parse(opts.fakeFs.readFileSync(ppath.join(unqualifiedPath, Filename.manifest), `utf8`)); - } catch (error) { - } - let nextUnqualifiedPath; - if (pkgJson && pkgJson.main) - nextUnqualifiedPath = ppath.resolve(unqualifiedPath, pkgJson.main); - if (nextUnqualifiedPath && nextUnqualifiedPath !== unqualifiedPath) { - const resolution = applyNodeExtensionResolution(nextUnqualifiedPath, candidates, { extensions }); - if (resolution !== null) { - return resolution; - } - } - } - for (let i = 0, length = extensions.length; i < length; i++) { - const candidateFile = `${unqualifiedPath}${extensions[i]}`; - candidates.push(candidateFile); - if (opts.fakeFs.existsSync(candidateFile)) { - return candidateFile; - } - } - if (stat && stat.isDirectory()) { - for (let i = 0, length = extensions.length; i < length; i++) { - const candidateFile = ppath.format({ dir: unqualifiedPath, name: `index`, ext: extensions[i] }); - candidates.push(candidateFile); - if (opts.fakeFs.existsSync(candidateFile)) { - return candidateFile; - } - } - } - return null; - } - function makeFakeModule(path) { - const fakeModule = new require$$0.Module(path, null); - fakeModule.filename = path; - fakeModule.paths = require$$0.Module._nodeModulePaths(path); - return fakeModule; - } - function callNativeResolution(request, issuer) { - if (issuer.endsWith(`/`)) - issuer = ppath.join(issuer, `internal.js`); - return require$$0.Module._resolveFilename(npath.fromPortablePath(request), makeFakeModule(npath.fromPortablePath(issuer)), false, { plugnplay: false }); - } - function isPathIgnored(path) { - if (ignorePattern === null) - return false; - const subPath = ppath.contains(runtimeState.basePath, path); - if (subPath === null) - return false; - if (ignorePattern.test(subPath.replace(/\/$/, ``))) { - return true; - } else { - return false; - } - } - const VERSIONS = { std: 3, resolveVirtual: 1, getAllLocators: 1 }; - const topLevel = topLevelLocator; - function getPackageInformation({ name, reference }) { - const packageInformationStore = packageRegistry.get(name); - if (!packageInformationStore) - return null; - const packageInformation = packageInformationStore.get(reference); - if (!packageInformation) - return null; - return packageInformation; - } - function findPackageDependents({ name, reference }) { - const dependents = []; - for (const [dependentName, packageInformationStore] of packageRegistry) { - if (dependentName === null) - continue; - for (const [dependentReference, packageInformation] of packageInformationStore) { - if (dependentReference === null) - continue; - const dependencyReference = packageInformation.packageDependencies.get(name); - if (dependencyReference !== reference) - continue; - if (dependentName === name && dependentReference === reference) - continue; - dependents.push({ - name: dependentName, - reference: dependentReference - }); - } - } - return dependents; - } - function findBrokenPeerDependencies(dependency, initialPackage) { - const brokenPackages = /* @__PURE__ */ new Map(); - const alreadyVisited = /* @__PURE__ */ new Set(); - const traversal = (currentPackage) => { - const identifier = JSON.stringify(currentPackage.name); - if (alreadyVisited.has(identifier)) - return; - alreadyVisited.add(identifier); - const dependents = findPackageDependents(currentPackage); - for (const dependent of dependents) { - const dependentInformation = getPackageInformationSafe(dependent); - if (dependentInformation.packagePeers.has(dependency)) { - traversal(dependent); - } else { - let brokenSet = brokenPackages.get(dependent.name); - if (typeof brokenSet === `undefined`) - brokenPackages.set(dependent.name, brokenSet = /* @__PURE__ */ new Set()); - brokenSet.add(dependent.reference); - } - } - }; - traversal(initialPackage); - const brokenList = []; - for (const name of [...brokenPackages.keys()].sort()) - for (const reference of [...brokenPackages.get(name)].sort()) - brokenList.push({ name, reference }); - return brokenList; - } - function findPackageLocator(location, { resolveIgnored = false, includeDiscardFromLookup = false } = {}) { - if (isPathIgnored(location) && !resolveIgnored) - return null; - let relativeLocation = ppath.relative(runtimeState.basePath, location); - if (!relativeLocation.match(isStrictRegExp)) - relativeLocation = `./${relativeLocation}`; - if (!relativeLocation.endsWith(`/`)) - relativeLocation = `${relativeLocation}/`; - do { - const entry = packageLocatorsByLocations.get(relativeLocation); - if (typeof entry === `undefined` || entry.discardFromLookup && !includeDiscardFromLookup) { - relativeLocation = relativeLocation.substring(0, relativeLocation.lastIndexOf(`/`, relativeLocation.length - 2) + 1); - continue; - } - return entry.locator; - } while (relativeLocation !== ``); - return null; - } - function tryReadFile(filePath) { - try { - return opts.fakeFs.readFileSync(npath.toPortablePath(filePath), `utf8`); - } catch (err) { - if (err.code === `ENOENT`) - return void 0; - throw err; - } - } - function resolveToUnqualified(request, issuer, { considerBuiltins = true } = {}) { - if (request.startsWith(`#`)) - throw new Error(`resolveToUnqualified can not handle private import mappings`); - if (request === `pnpapi`) - return npath.toPortablePath(opts.pnpapiResolution); - if (considerBuiltins && require$$0.isBuiltin(request)) - return null; - const requestForDisplay = getPathForDisplay(request); - const issuerForDisplay = issuer && getPathForDisplay(issuer); - if (issuer && isPathIgnored(issuer)) { - if (!ppath.isAbsolute(request) || findPackageLocator(request) === null) { - const result = callNativeResolution(request, issuer); - if (result === false) { - throw makeError( - ErrorCode.BUILTIN_NODE_RESOLUTION_FAILED, - `The builtin node resolution algorithm was unable to resolve the requested module (it didn't go through the pnp resolver because the issuer was explicitely ignored by the regexp) - -Require request: "${requestForDisplay}" -Required by: ${issuerForDisplay} -`, - { request: requestForDisplay, issuer: issuerForDisplay } - ); - } - return npath.toPortablePath(result); - } - } - let unqualifiedPath; - const dependencyNameMatch = request.match(pathRegExp); - if (!dependencyNameMatch) { - if (ppath.isAbsolute(request)) { - unqualifiedPath = ppath.normalize(request); - } else { - if (!issuer) { - throw makeError( - ErrorCode.API_ERROR, - `The resolveToUnqualified function must be called with a valid issuer when the path isn't a builtin nor absolute`, - { request: requestForDisplay, issuer: issuerForDisplay } - ); - } - const absoluteIssuer = ppath.resolve(issuer); - if (issuer.match(isDirRegExp)) { - unqualifiedPath = ppath.normalize(ppath.join(absoluteIssuer, request)); - } else { - unqualifiedPath = ppath.normalize(ppath.join(ppath.dirname(absoluteIssuer), request)); - } - } - } else { - if (!issuer) { - throw makeError( - ErrorCode.API_ERROR, - `The resolveToUnqualified function must be called with a valid issuer when the path isn't a builtin nor absolute`, - { request: requestForDisplay, issuer: issuerForDisplay } - ); - } - const [, dependencyName, subPath] = dependencyNameMatch; - const issuerLocator = findPackageLocator(issuer); - if (!issuerLocator) { - const result = callNativeResolution(request, issuer); - if (result === false) { - throw makeError( - ErrorCode.BUILTIN_NODE_RESOLUTION_FAILED, - `The builtin node resolution algorithm was unable to resolve the requested module (it didn't go through the pnp resolver because the issuer doesn't seem to be part of the Yarn-managed dependency tree). - -Require path: "${requestForDisplay}" -Required by: ${issuerForDisplay} -`, - { request: requestForDisplay, issuer: issuerForDisplay } - ); - } - return npath.toPortablePath(result); - } - const issuerInformation = getPackageInformationSafe(issuerLocator); - let dependencyReference = issuerInformation.packageDependencies.get(dependencyName); - let fallbackReference = null; - if (dependencyReference == null) { - if (issuerLocator.name !== null) { - const exclusionEntry = runtimeState.fallbackExclusionList.get(issuerLocator.name); - const canUseFallbacks = !exclusionEntry || !exclusionEntry.has(issuerLocator.reference); - if (canUseFallbacks) { - for (let t = 0, T = fallbackLocators.length; t < T; ++t) { - const fallbackInformation = getPackageInformationSafe(fallbackLocators[t]); - const reference = fallbackInformation.packageDependencies.get(dependencyName); - if (reference == null) - continue; - if (alwaysWarnOnFallback) - fallbackReference = reference; - else - dependencyReference = reference; - break; - } - if (runtimeState.enableTopLevelFallback) { - if (dependencyReference == null && fallbackReference === null) { - const reference = runtimeState.fallbackPool.get(dependencyName); - if (reference != null) { - fallbackReference = reference; - } - } - } - } - } - } - let error = null; - if (dependencyReference === null) { - if (isDependencyTreeRoot(issuerLocator)) { - error = makeError( - ErrorCode.MISSING_PEER_DEPENDENCY, - `Your application tried to access ${dependencyName} (a peer dependency); this isn't allowed as there is no ancestor to satisfy the requirement. Use a devDependency if needed. - -Required package: ${dependencyName}${dependencyName !== requestForDisplay ? ` (via "${requestForDisplay}")` : ``} -Required by: ${issuerForDisplay} -`, - { request: requestForDisplay, issuer: issuerForDisplay, dependencyName } - ); - } else { - const brokenAncestors = findBrokenPeerDependencies(dependencyName, issuerLocator); - if (brokenAncestors.every((ancestor) => isDependencyTreeRoot(ancestor))) { - error = makeError( - ErrorCode.MISSING_PEER_DEPENDENCY, - `${issuerLocator.name} tried to access ${dependencyName} (a peer dependency) but it isn't provided by your application; this makes the require call ambiguous and unsound. - -Required package: ${dependencyName}${dependencyName !== requestForDisplay ? ` (via "${requestForDisplay}")` : ``} -Required by: ${issuerLocator.name}@${issuerLocator.reference} (via ${issuerForDisplay}) -${brokenAncestors.map((ancestorLocator) => `Ancestor breaking the chain: ${ancestorLocator.name}@${ancestorLocator.reference} -`).join(``)} -`, - { request: requestForDisplay, issuer: issuerForDisplay, issuerLocator: Object.assign({}, issuerLocator), dependencyName, brokenAncestors } - ); - } else { - error = makeError( - ErrorCode.MISSING_PEER_DEPENDENCY, - `${issuerLocator.name} tried to access ${dependencyName} (a peer dependency) but it isn't provided by its ancestors; this makes the require call ambiguous and unsound. - -Required package: ${dependencyName}${dependencyName !== requestForDisplay ? ` (via "${requestForDisplay}")` : ``} -Required by: ${issuerLocator.name}@${issuerLocator.reference} (via ${issuerForDisplay}) - -${brokenAncestors.map((ancestorLocator) => `Ancestor breaking the chain: ${ancestorLocator.name}@${ancestorLocator.reference} -`).join(``)} -`, - { request: requestForDisplay, issuer: issuerForDisplay, issuerLocator: Object.assign({}, issuerLocator), dependencyName, brokenAncestors } - ); - } - } - } else if (dependencyReference === void 0) { - if (!considerBuiltins && require$$0.isBuiltin(request)) { - if (isDependencyTreeRoot(issuerLocator)) { - error = makeError( - ErrorCode.UNDECLARED_DEPENDENCY, - `Your application tried to access ${dependencyName}. While this module is usually interpreted as a Node builtin, your resolver is running inside a non-Node resolution context where such builtins are ignored. Since ${dependencyName} isn't otherwise declared in your dependencies, this makes the require call ambiguous and unsound. - -Required package: ${dependencyName}${dependencyName !== requestForDisplay ? ` (via "${requestForDisplay}")` : ``} -Required by: ${issuerForDisplay} -`, - { request: requestForDisplay, issuer: issuerForDisplay, dependencyName } - ); - } else { - error = makeError( - ErrorCode.UNDECLARED_DEPENDENCY, - `${issuerLocator.name} tried to access ${dependencyName}. While this module is usually interpreted as a Node builtin, your resolver is running inside a non-Node resolution context where such builtins are ignored. Since ${dependencyName} isn't otherwise declared in ${issuerLocator.name}'s dependencies, this makes the require call ambiguous and unsound. - -Required package: ${dependencyName}${dependencyName !== requestForDisplay ? ` (via "${requestForDisplay}")` : ``} -Required by: ${issuerForDisplay} -`, - { request: requestForDisplay, issuer: issuerForDisplay, issuerLocator: Object.assign({}, issuerLocator), dependencyName } - ); - } - } else { - if (isDependencyTreeRoot(issuerLocator)) { - error = makeError( - ErrorCode.UNDECLARED_DEPENDENCY, - `Your application tried to access ${dependencyName}, but it isn't declared in your dependencies; this makes the require call ambiguous and unsound. - -Required package: ${dependencyName}${dependencyName !== requestForDisplay ? ` (via "${requestForDisplay}")` : ``} -Required by: ${issuerForDisplay} -`, - { request: requestForDisplay, issuer: issuerForDisplay, dependencyName } - ); - } else { - error = makeError( - ErrorCode.UNDECLARED_DEPENDENCY, - `${issuerLocator.name} tried to access ${dependencyName}, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound. - -Required package: ${dependencyName}${dependencyName !== requestForDisplay ? ` (via "${requestForDisplay}")` : ``} -Required by: ${issuerLocator.name}@${issuerLocator.reference} (via ${issuerForDisplay}) -`, - { request: requestForDisplay, issuer: issuerForDisplay, issuerLocator: Object.assign({}, issuerLocator), dependencyName } - ); - } - } - } - if (dependencyReference == null) { - if (fallbackReference === null || error === null) - throw error || new Error(`Assertion failed: Expected an error to have been set`); - dependencyReference = fallbackReference; - const message = error.message.replace(/\n.*/g, ``); - error.message = message; - if (!emittedWarnings.has(message) && debugLevel !== 0) { - emittedWarnings.add(message); - process.emitWarning(error); - } - } - const dependencyLocator = Array.isArray(dependencyReference) ? { name: dependencyReference[0], reference: dependencyReference[1] } : { name: dependencyName, reference: dependencyReference }; - const dependencyInformation = getPackageInformationSafe(dependencyLocator); - if (!dependencyInformation.packageLocation) { - throw makeError( - ErrorCode.MISSING_DEPENDENCY, - `A dependency seems valid but didn't get installed for some reason. This might be caused by a partial install, such as dev vs prod. - -Required package: ${dependencyLocator.name}@${dependencyLocator.reference}${dependencyLocator.name !== requestForDisplay ? ` (via "${requestForDisplay}")` : ``} -Required by: ${issuerLocator.name}@${issuerLocator.reference} (via ${issuerForDisplay}) -`, - { request: requestForDisplay, issuer: issuerForDisplay, dependencyLocator: Object.assign({}, dependencyLocator) } - ); - } - const dependencyLocation = dependencyInformation.packageLocation; - if (subPath) { - unqualifiedPath = ppath.join(dependencyLocation, subPath); - } else { - unqualifiedPath = dependencyLocation; - } - } - return ppath.normalize(unqualifiedPath); - } - function resolveUnqualifiedExport(request, unqualifiedPath, conditions = defaultExportsConditions, issuer) { - if (isStrictRegExp.test(request)) - return unqualifiedPath; - const unqualifiedExportPath = applyNodeExportsResolution(unqualifiedPath, conditions, issuer); - if (unqualifiedExportPath) { - return ppath.normalize(unqualifiedExportPath); - } else { - return unqualifiedPath; - } - } - function resolveUnqualified(unqualifiedPath, { extensions = Object.keys(require$$0.Module._extensions) } = {}) { - const candidates = []; - const qualifiedPath = applyNodeExtensionResolution(unqualifiedPath, candidates, { extensions }); - if (qualifiedPath) { - return ppath.normalize(qualifiedPath); - } else { - reportRequiredFilesToWatchMode(candidates.map((candidate) => npath.fromPortablePath(candidate))); - const unqualifiedPathForDisplay = getPathForDisplay(unqualifiedPath); - const containingPackage = findPackageLocator(unqualifiedPath); - if (containingPackage) { - const { packageLocation } = getPackageInformationSafe(containingPackage); - let exists = true; - try { - opts.fakeFs.accessSync(packageLocation); - } catch (err) { - if (err?.code === `ENOENT`) { - exists = false; - } else { - const readableError = (err?.message ?? err ?? `empty exception thrown`).replace(/^[A-Z]/, ($0) => $0.toLowerCase()); - throw makeError(ErrorCode.QUALIFIED_PATH_RESOLUTION_FAILED, `Required package exists but could not be accessed (${readableError}). - -Missing package: ${containingPackage.name}@${containingPackage.reference} -Expected package location: ${getPathForDisplay(packageLocation)} -`, { unqualifiedPath: unqualifiedPathForDisplay, extensions }); - } - } - if (!exists) { - const errorMessage = packageLocation.includes(`/unplugged/`) ? `Required unplugged package missing from disk. This may happen when switching branches without running installs (unplugged packages must be fully materialized on disk to work).` : `Required package missing from disk. If you keep your packages inside your repository then restarting the Node process may be enough. Otherwise, try to run an install first.`; - throw makeError( - ErrorCode.QUALIFIED_PATH_RESOLUTION_FAILED, - `${errorMessage} - -Missing package: ${containingPackage.name}@${containingPackage.reference} -Expected package location: ${getPathForDisplay(packageLocation)} -`, - { unqualifiedPath: unqualifiedPathForDisplay, extensions } - ); - } - } - throw makeError( - ErrorCode.QUALIFIED_PATH_RESOLUTION_FAILED, - `Qualified path resolution failed: we looked for the following paths, but none could be accessed. - -Source path: ${unqualifiedPathForDisplay} -${candidates.map((candidate) => `Not found: ${getPathForDisplay(candidate)} -`).join(``)}`, - { unqualifiedPath: unqualifiedPathForDisplay, extensions } - ); - } - } - function resolvePrivateRequest(request, issuer, opts2) { - if (!issuer) - throw new Error(`Assertion failed: An issuer is required to resolve private import mappings`); - const resolved = packageImportsResolve({ - name: request, - base: url.pathToFileURL(npath.fromPortablePath(issuer)), - conditions: opts2.conditions ?? defaultExportsConditions, - readFileSyncFn: tryReadFile - }); - if (resolved instanceof URL) { - return resolveUnqualified(npath.toPortablePath(url.fileURLToPath(resolved)), { extensions: opts2.extensions }); - } else { - if (resolved.startsWith(`#`)) - throw new Error(`Mapping from one private import to another isn't allowed`); - return resolveRequest(resolved, issuer, opts2); - } - } - function resolveRequest(request, issuer, opts2 = {}) { - try { - if (request.startsWith(`#`)) - return resolvePrivateRequest(request, issuer, opts2); - const { considerBuiltins, extensions, conditions } = opts2; - const unqualifiedPath = resolveToUnqualified(request, issuer, { considerBuiltins }); - if (request === `pnpapi`) - return unqualifiedPath; - if (unqualifiedPath === null) - return null; - const isIssuerIgnored = () => issuer !== null ? isPathIgnored(issuer) : false; - const remappedPath = (!considerBuiltins || !require$$0.isBuiltin(request)) && !isIssuerIgnored() ? resolveUnqualifiedExport(request, unqualifiedPath, conditions, issuer) : unqualifiedPath; - return resolveUnqualified(remappedPath, { extensions }); - } catch (error) { - if (Object.hasOwn(error, `pnpCode`)) - Object.assign(error.data, { request: getPathForDisplay(request), issuer: issuer && getPathForDisplay(issuer) }); - throw error; - } - } - function resolveVirtual(request) { - const normalized = ppath.normalize(request); - const resolved = VirtualFS.resolveVirtual(normalized); - return resolved !== normalized ? resolved : null; - } - return { - VERSIONS, - topLevel, - getLocator: (name, referencish) => { - if (Array.isArray(referencish)) { - return { name: referencish[0], reference: referencish[1] }; - } else { - return { name, reference: referencish }; - } - }, - getDependencyTreeRoots: () => { - return [...runtimeState.dependencyTreeRoots]; - }, - getAllLocators() { - const locators = []; - for (const [name, entry] of packageRegistry) - for (const reference of entry.keys()) - if (name !== null && reference !== null) - locators.push({ name, reference }); - return locators; - }, - getPackageInformation: (locator) => { - const info = getPackageInformation(locator); - if (info === null) - return null; - const packageLocation = npath.fromPortablePath(info.packageLocation); - const nativeInfo = { ...info, packageLocation }; - return nativeInfo; - }, - findPackageLocator: (path) => { - return findPackageLocator(npath.toPortablePath(path)); - }, - resolveToUnqualified: maybeLog(`resolveToUnqualified`, (request, issuer, opts2) => { - const portableIssuer = issuer !== null ? npath.toPortablePath(issuer) : null; - const resolution = resolveToUnqualified(npath.toPortablePath(request), portableIssuer, opts2); - if (resolution === null) - return null; - return npath.fromPortablePath(resolution); - }), - resolveUnqualified: maybeLog(`resolveUnqualified`, (unqualifiedPath, opts2) => { - return npath.fromPortablePath(resolveUnqualified(npath.toPortablePath(unqualifiedPath), opts2)); - }), - resolveRequest: maybeLog(`resolveRequest`, (request, issuer, opts2) => { - const portableIssuer = issuer !== null ? npath.toPortablePath(issuer) : null; - const resolution = resolveRequest(npath.toPortablePath(request), portableIssuer, opts2); - if (resolution === null) - return null; - return npath.fromPortablePath(resolution); - }), - resolveVirtual: maybeLog(`resolveVirtual`, (path) => { - const result = resolveVirtual(npath.toPortablePath(path)); - if (result !== null) { - return npath.fromPortablePath(result); - } else { - return null; - } - }) - }; -} - -function makeManager(pnpapi, opts) { - const initialApiPath = npath.toPortablePath(pnpapi.resolveToUnqualified(`pnpapi`, null)); - const initialApiStats = opts.fakeFs.statSync(npath.toPortablePath(initialApiPath)); - const apiMetadata = /* @__PURE__ */ new Map([ - [initialApiPath, { - instance: pnpapi, - stats: initialApiStats, - lastRefreshCheck: Date.now() - }] - ]); - function loadApiInstance(pnpApiPath) { - const nativePath = npath.fromPortablePath(pnpApiPath); - const module = new require$$0.Module(nativePath, null); - module.load(nativePath); - return module.exports; - } - function refreshApiEntry(pnpApiPath, apiEntry) { - const timeNow = Date.now(); - if (timeNow - apiEntry.lastRefreshCheck < 500) - return; - apiEntry.lastRefreshCheck = timeNow; - const stats = opts.fakeFs.statSync(pnpApiPath); - if (stats.mtime > apiEntry.stats.mtime) { - process.emitWarning(`[Warning] The runtime detected new information in a PnP file; reloading the API instance (${npath.fromPortablePath(pnpApiPath)})`); - apiEntry.stats = stats; - apiEntry.instance = loadApiInstance(pnpApiPath); - } - } - function getApiEntry(pnpApiPath, refresh = false) { - let apiEntry = apiMetadata.get(pnpApiPath); - if (typeof apiEntry !== `undefined`) { - if (refresh) { - refreshApiEntry(pnpApiPath, apiEntry); - } - } else { - apiMetadata.set(pnpApiPath, apiEntry = { - instance: loadApiInstance(pnpApiPath), - stats: opts.fakeFs.statSync(pnpApiPath), - lastRefreshCheck: Date.now() - }); - } - return apiEntry; - } - const findApiPathCache = /* @__PURE__ */ new Map(); - function addToCacheAndReturn(start, end, target) { - if (target !== null) { - target = VirtualFS.resolveVirtual(target); - target = opts.fakeFs.realpathSync(target); - } - let curr; - let next = start; - do { - curr = next; - findApiPathCache.set(curr, target); - next = ppath.dirname(curr); - } while (curr !== end); - return target; - } - function findApiPathFor(modulePath) { - let bestCandidate = null; - for (const [apiPath, apiEntry] of apiMetadata) { - const locator = apiEntry.instance.findPackageLocator(modulePath); - if (!locator) - continue; - if (apiMetadata.size === 1) - return apiPath; - const packageInformation = apiEntry.instance.getPackageInformation(locator); - if (!packageInformation) - throw new Error(`Assertion failed: Couldn't get package information for '${modulePath}'`); - if (!bestCandidate) - bestCandidate = { packageLocation: packageInformation.packageLocation, apiPaths: [] }; - if (packageInformation.packageLocation === bestCandidate.packageLocation) { - bestCandidate.apiPaths.push(apiPath); - } else if (packageInformation.packageLocation.length > bestCandidate.packageLocation.length) { - bestCandidate = { packageLocation: packageInformation.packageLocation, apiPaths: [apiPath] }; - } - } - if (bestCandidate) { - if (bestCandidate.apiPaths.length === 1) - return bestCandidate.apiPaths[0]; - const controlSegment = bestCandidate.apiPaths.map((apiPath) => ` ${npath.fromPortablePath(apiPath)}`).join(` -`); - throw new Error(`Unable to locate pnpapi, the module '${modulePath}' is controlled by multiple pnpapi instances. -This is usually caused by using the global cache (enableGlobalCache: true) - -Controlled by: -${controlSegment} -`); - } - const start = ppath.resolve(npath.toPortablePath(modulePath)); - let curr; - let next = start; - do { - curr = next; - const cached = findApiPathCache.get(curr); - if (cached !== void 0) - return addToCacheAndReturn(start, curr, cached); - const cjsCandidate = ppath.join(curr, Filename.pnpCjs); - if (opts.fakeFs.existsSync(cjsCandidate) && opts.fakeFs.statSync(cjsCandidate).isFile()) - return addToCacheAndReturn(start, curr, cjsCandidate); - const legacyCjsCandidate = ppath.join(curr, Filename.pnpJs); - if (opts.fakeFs.existsSync(legacyCjsCandidate) && opts.fakeFs.statSync(legacyCjsCandidate).isFile()) - return addToCacheAndReturn(start, curr, legacyCjsCandidate); - next = ppath.dirname(curr); - } while (curr !== PortablePath.root); - return addToCacheAndReturn(start, curr, null); - } - const moduleToApiPathCache = /* @__PURE__ */ new WeakMap(); - function getApiPathFromParent(parent) { - if (parent == null) - return initialApiPath; - let apiPath = moduleToApiPathCache.get(parent); - if (typeof apiPath !== `undefined`) - return apiPath; - apiPath = parent.filename ? findApiPathFor(parent.filename) : null; - moduleToApiPathCache.set(parent, apiPath); - return apiPath; - } - return { - getApiPathFromParent, - findApiPathFor, - getApiEntry - }; -} - -const localFs = { ...fs__default.default }; -const nodeFs = new NodeFS(localFs); -const defaultRuntimeState = $$SETUP_STATE(hydrateRuntimeState); -const defaultPnpapiResolution = __filename; -const defaultFsLayer = new VirtualFS({ - baseFs: new ZipOpenFS({ - baseFs: nodeFs, - maxOpenFiles: 80, - readOnlyArchives: true - }) -}); -class DynamicFS extends ProxiedFS { - constructor() { - super(ppath); - this.baseFs = defaultFsLayer; - } - mapToBase(p) { - return p; - } - mapFromBase(p) { - return p; - } -} -const dynamicFsLayer = new DynamicFS(); -let manager; -const defaultApi = Object.assign(makeApi(defaultRuntimeState, { - fakeFs: dynamicFsLayer, - pnpapiResolution: defaultPnpapiResolution -}), { - makeApi: ({ - basePath = void 0, - fakeFs = dynamicFsLayer, - pnpapiResolution = defaultPnpapiResolution, - ...rest - }) => { - const apiRuntimeState = typeof basePath !== `undefined` ? $$SETUP_STATE(hydrateRuntimeState, basePath) : defaultRuntimeState; - return makeApi(apiRuntimeState, { - fakeFs, - pnpapiResolution, - ...rest - }); - }, - setup: (api) => { - applyPatch(api || defaultApi, { - fakeFs: defaultFsLayer, - manager - }); - dynamicFsLayer.baseFs = new NodeFS(fs__default.default); - } -}); -manager = makeManager(defaultApi, { - fakeFs: dynamicFsLayer -}); -if (module.parent && module.parent.id === `internal/preload`) { - defaultApi.setup(); - if (module.filename) { - delete require$$0__default.default._cache[module.filename]; - } -} -if (process.mainModule === module) { - const reportError = (code, message, data) => { - process.stdout.write(`${JSON.stringify([{ code, message, data }, null])} -`); - }; - const reportSuccess = (resolution) => { - process.stdout.write(`${JSON.stringify([null, resolution])} -`); - }; - const processResolution = (request, issuer) => { - try { - reportSuccess(defaultApi.resolveRequest(request, issuer)); - } catch (error) { - reportError(error.code, error.message, error.data); - } - }; - const processRequest = (data) => { - try { - const [request, issuer] = JSON.parse(data); - processResolution(request, issuer); - } catch (error) { - reportError(`INVALID_JSON`, error.message, error.data); - } - }; - if (process.argv.length > 2) { - if (process.argv.length !== 4) { - process.stderr.write(`Usage: ${process.argv[0]} ${process.argv[1]} -`); - process.exitCode = 64; - } else { - processResolution(process.argv[2], process.argv[3]); - } - } else { - let buffer = ``; - const decoder = new StringDecoder__default.default.StringDecoder(); - process.stdin.on(`data`, (chunk) => { - buffer += decoder.write(chunk); - do { - const index = buffer.indexOf(` -`); - if (index === -1) - break; - const line = buffer.slice(0, index); - buffer = buffer.slice(index + 1); - processRequest(line); - } while (true); - }); - } -} - -module.exports = defaultApi; diff --git a/fixtures/pnp/.yarnrc.yml b/fixtures/pnp/.yarnrc.yml deleted file mode 100644 index 6a6b24d8..00000000 --- a/fixtures/pnp/.yarnrc.yml +++ /dev/null @@ -1 +0,0 @@ -enableGlobalCache: 0 diff --git a/fixtures/pnp/package.json b/fixtures/pnp/package.json deleted file mode 100644 index 5d119379..00000000 --- a/fixtures/pnp/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "pnp", - "packageManager": "yarn@4.3.1", - "dependencies": { - "is-even": "^1.0.0", - "is-odd": "^3.0.1" - } -} diff --git a/fixtures/pnp/yarn.lock b/fixtures/pnp/yarn.lock deleted file mode 100644 index ba89514d..00000000 --- a/fixtures/pnp/yarn.lock +++ /dev/null @@ -1,74 +0,0 @@ -# This file is generated by running "yarn install" inside your project. -# Manual changes might be lost - proceed with caution! - -__metadata: - version: 8 - cacheKey: 10c0 - -"is-buffer@npm:^1.1.5": - version: 1.1.6 - resolution: "is-buffer@npm:1.1.6" - checksum: 10c0/ae18aa0b6e113d6c490ad1db5e8df9bdb57758382b313f5a22c9c61084875c6396d50bbf49315f5b1926d142d74dfb8d31b40d993a383e0a158b15fea7a82234 - languageName: node - linkType: hard - -"is-even@npm:^1.0.0": - version: 1.0.0 - resolution: "is-even@npm:1.0.0" - dependencies: - is-odd: "npm:^0.1.2" - checksum: 10c0/2728cc2f390d07c6a44a054aa53ae6ce57c3a4adfd76a92df528e992b4a978fdec4eaa948e0de6e6431ef3c8deebf1c964fd870d4983044ec9f0f4e630dfb3a5 - languageName: node - linkType: hard - -"is-number@npm:^3.0.0": - version: 3.0.0 - resolution: "is-number@npm:3.0.0" - dependencies: - kind-of: "npm:^3.0.2" - checksum: 10c0/e639c54640b7f029623df24d3d103901e322c0c25ea5bde97cd723c2d0d4c05857a8364ab5c58d963089dbed6bf1d0ffe975cb6aef917e2ad0ccbca653d31b4f - languageName: node - linkType: hard - -"is-number@npm:^6.0.0": - version: 6.0.0 - resolution: "is-number@npm:6.0.0" - checksum: 10c0/5da4c68401529675c575878d2760d66f18eaef4b014858577f6003daf66488d7fe4eae684b1e8574e3fa1bb447c6c6c56b8491d2b4b3239da2d32e5f6f218008 - languageName: node - linkType: hard - -"is-odd@npm:^0.1.2": - version: 0.1.2 - resolution: "is-odd@npm:0.1.2" - dependencies: - is-number: "npm:^3.0.0" - checksum: 10c0/7dc6c6fd004861208ef9f324021c66f19b3dad209c2da3ef3720d4d76e141974fadb52c47b439fc8c52af579468640b554115395b5673f4558ef09719260e898 - languageName: node - linkType: hard - -"is-odd@npm:^3.0.1": - version: 3.0.1 - resolution: "is-odd@npm:3.0.1" - dependencies: - is-number: "npm:^6.0.0" - checksum: 10c0/89ee2e353c5a3f3bd400c79db1c307a5b3506198ee8169d521e533a9b1d8a08fc95f21a919c084e98845b4286d7ffe309778da03744dfe66c3c1763ab1a030c6 - languageName: node - linkType: hard - -"kind-of@npm:^3.0.2": - version: 3.2.2 - resolution: "kind-of@npm:3.2.2" - dependencies: - is-buffer: "npm:^1.1.5" - checksum: 10c0/7e34bc29d4b02c997f92f080de34ebb92033a96736bbb0bb2410e033a7e5ae6571f1fa37b2d7710018f95361473b816c604234197f4f203f9cf149d8ef1574d9 - languageName: node - linkType: hard - -"pnp@workspace:.": - version: 0.0.0-use.local - resolution: "pnp@workspace:." - dependencies: - is-even: "npm:^1.0.0" - is-odd: "npm:^3.0.1" - languageName: unknown - linkType: soft diff --git a/fixtures/pnpm/.gitignore b/fixtures/pnpm/.gitignore deleted file mode 100644 index 3c3629e6..00000000 --- a/fixtures/pnpm/.gitignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/fixtures/pnpm/package.json b/fixtures/pnpm/package.json deleted file mode 100644 index b763d74d..00000000 --- a/fixtures/pnpm/package.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "name": "pnpm", - "version": "1.0.0", - "private": true, - "devDependencies": { - "axios": "1.6.2", - "ipaddr.js": "2.2.0", - "postcss": "8.4.33", - "styled-components": "6.1.1" - } -} diff --git a/fixtures/pnpm/pnpm-lock.yaml b/fixtures/pnpm/pnpm-lock.yaml deleted file mode 100644 index e51dfd6a..00000000 --- a/fixtures/pnpm/pnpm-lock.yaml +++ /dev/null @@ -1,212 +0,0 @@ -lockfileVersion: '6.0' - -settings: - autoInstallPeers: true - excludeLinksFromLockfile: false - -devDependencies: - axios: - specifier: 1.6.2 - version: 1.6.2 - postcss: - specifier: 8.4.33 - version: 8.4.33 - styled-components: - specifier: 6.1.1 - version: 6.1.1(react-dom@18.2.0)(react@18.2.0) - -packages: - - /@emotion/is-prop-valid@1.2.1: - resolution: {integrity: sha512-61Mf7Ufx4aDxx1xlDeOm8aFFigGHE4z+0sKCa+IHCeZKiyP9RLD0Mmx7m8b9/Cf37f7NAvQOOJAbQQGVr5uERw==} - dependencies: - '@emotion/memoize': 0.8.1 - dev: true - - /@emotion/memoize@0.8.1: - resolution: {integrity: sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA==} - dev: true - - /@emotion/unitless@0.8.1: - resolution: {integrity: sha512-KOEGMu6dmJZtpadb476IsZBclKvILjopjUii3V+7MnXIQCYh8W3NgNcgwo21n9LXZX6EDIKvqfjYxXebDwxKmQ==} - dev: true - - /@types/stylis@4.2.4: - resolution: {integrity: sha512-36ZrGJ8fgtBr6nwNnuJ9jXIj+bn/pF6UoqmrQT7+Y99+tFFeHHsoR54+194dHdyhPjgbeoNz3Qru0oRt0l6ASQ==} - dev: true - - /asynckit@0.4.0: - resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} - dev: true - - /axios@1.6.2: - resolution: {integrity: sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A==} - dependencies: - follow-redirects: 1.15.3 - form-data: 4.0.0 - proxy-from-env: 1.1.0 - transitivePeerDependencies: - - debug - dev: true - - /camelize@1.0.1: - resolution: {integrity: sha512-dU+Tx2fsypxTgtLoE36npi3UqcjSSMNYfkqgmoEhtZrraP5VWq0K7FkWVTYa8eMPtnU/G2txVsfdCJTn9uzpuQ==} - dev: true - - /combined-stream@1.0.8: - resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} - engines: {node: '>= 0.8'} - dependencies: - delayed-stream: 1.0.0 - dev: true - - /css-color-keywords@1.0.0: - resolution: {integrity: sha512-FyyrDHZKEjXDpNJYvVsV960FiqQyXc/LlYmsxl2BcdMb2WPx0OGRVgTg55rPSyLSNMqP52R9r8geSp7apN3Ofg==} - engines: {node: '>=4'} - dev: true - - /css-to-react-native@3.2.0: - resolution: {integrity: sha512-e8RKaLXMOFii+02mOlqwjbD00KSEKqblnpO9e++1aXS1fPQOpS1YoqdVHBqPjHNoxeF2mimzVqawm2KCbEdtHQ==} - dependencies: - camelize: 1.0.1 - css-color-keywords: 1.0.0 - postcss-value-parser: 4.2.0 - dev: true - - /csstype@3.1.2: - resolution: {integrity: sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==} - dev: true - - /delayed-stream@1.0.0: - resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} - engines: {node: '>=0.4.0'} - dev: true - - /follow-redirects@1.15.3: - resolution: {integrity: sha512-1VzOtuEM8pC9SFU1E+8KfTjZyMztRsgEfwQl44z8A25uy13jSzTj6dyK2Df52iV0vgHCfBwLhDWevLn95w5v6Q==} - engines: {node: '>=4.0'} - peerDependencies: - debug: '*' - peerDependenciesMeta: - debug: - optional: true - dev: true - - /form-data@4.0.0: - resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==} - engines: {node: '>= 6'} - dependencies: - asynckit: 0.4.0 - combined-stream: 1.0.8 - mime-types: 2.1.35 - dev: true - - /js-tokens@4.0.0: - resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} - dev: true - - /loose-envify@1.4.0: - resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==} - hasBin: true - dependencies: - js-tokens: 4.0.0 - dev: true - - /mime-db@1.52.0: - resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} - engines: {node: '>= 0.6'} - dev: true - - /mime-types@2.1.35: - resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} - engines: {node: '>= 0.6'} - dependencies: - mime-db: 1.52.0 - dev: true - - /nanoid@3.3.7: - resolution: {integrity: sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==} - engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} - hasBin: true - dev: true - - /picocolors@1.0.0: - resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==} - dev: true - - /postcss-value-parser@4.2.0: - resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==} - dev: true - - /postcss@8.4.33: - resolution: {integrity: sha512-Kkpbhhdjw2qQs2O2DGX+8m5OVqEcbB9HRBvuYM9pgrjEFUg30A9LmXNlTAUj4S9kgtGyrMbTzVjH7E+s5Re2yg==} - engines: {node: ^10 || ^12 || >=14} - dependencies: - nanoid: 3.3.7 - picocolors: 1.0.0 - source-map-js: 1.0.2 - dev: true - - /proxy-from-env@1.1.0: - resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==} - dev: true - - /react-dom@18.2.0(react@18.2.0): - resolution: {integrity: sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==} - peerDependencies: - react: ^18.2.0 - dependencies: - loose-envify: 1.4.0 - react: 18.2.0 - scheduler: 0.23.0 - dev: true - - /react@18.2.0: - resolution: {integrity: sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==} - engines: {node: '>=0.10.0'} - dependencies: - loose-envify: 1.4.0 - dev: true - - /scheduler@0.23.0: - resolution: {integrity: sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw==} - dependencies: - loose-envify: 1.4.0 - dev: true - - /shallowequal@1.1.0: - resolution: {integrity: sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ==} - dev: true - - /source-map-js@1.0.2: - resolution: {integrity: sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==} - engines: {node: '>=0.10.0'} - dev: true - - /styled-components@6.1.1(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-cpZZP5RrKRIClBW5Eby4JM1wElLVP4NQrJbJ0h10TidTyJf4SIIwa3zLXOoPb4gJi8MsJ8mjq5mu2IrEhZIAcQ==} - engines: {node: '>= 16'} - peerDependencies: - react: '>= 16.8.0' - react-dom: '>= 16.8.0' - dependencies: - '@emotion/is-prop-valid': 1.2.1 - '@emotion/unitless': 0.8.1 - '@types/stylis': 4.2.4 - css-to-react-native: 3.2.0 - csstype: 3.1.2 - postcss: 8.4.33 - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - shallowequal: 1.1.0 - stylis: 4.3.0 - tslib: 2.6.2 - dev: true - - /stylis@4.3.0: - resolution: {integrity: sha512-E87pIogpwUsUwXw7dNyU4QDjdgVMy52m+XEOPEKUn161cCzWjjhPSQhByfd1CcNvrOLnXQ6OnnZDwnJrz/Z4YQ==} - dev: true - - /tslib@2.6.2: - resolution: {integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==} - dev: true diff --git a/fixtures/tsconfig/cases/builtins/thing.js b/fixtures/tsconfig/cases/builtins/thing.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/builtins/tsconfig.json b/fixtures/tsconfig/cases/builtins/tsconfig.json deleted file mode 100644 index 36aa1a4d..00000000 --- a/fixtures/tsconfig/cases/builtins/tsconfig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compilerOptions": { - "baseUrl": "." - } -} diff --git a/fixtures/tsconfig/cases/exports/index.js b/fixtures/tsconfig/cases/exports/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/exports/tsconfig.json b/fixtures/tsconfig/cases/exports/tsconfig.json deleted file mode 100644 index f0e3159b..00000000 --- a/fixtures/tsconfig/cases/exports/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-exports" -} diff --git a/fixtures/tsconfig/cases/extends-extension/base-tsconfig.json b/fixtures/tsconfig/cases/extends-extension/base-tsconfig.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/cases/extends-extension/base-tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/cases/extends-extension/foo.js b/fixtures/tsconfig/cases/extends-extension/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-extension/tsconfig.json b/fixtures/tsconfig/cases/extends-extension/tsconfig.json deleted file mode 100644 index 0ae4c6a3..00000000 --- a/fixtures/tsconfig/cases/extends-extension/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./base-tsconfig" -} diff --git a/fixtures/tsconfig/cases/extends-extensionless/foo.js b/fixtures/tsconfig/cases/extends-extensionless/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-extensionless/tsconfig.json b/fixtures/tsconfig/cases/extends-extensionless/tsconfig.json deleted file mode 100644 index c36cb7d4..00000000 --- a/fixtures/tsconfig/cases/extends-extensionless/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-field/conf" -} diff --git a/fixtures/tsconfig/cases/extends-multiple/foo.js b/fixtures/tsconfig/cases/extends-multiple/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-multiple/tsconfig.json b/fixtures/tsconfig/cases/extends-multiple/tsconfig.json deleted file mode 100644 index aa2ae783..00000000 --- a/fixtures/tsconfig/cases/extends-multiple/tsconfig.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": ["../extends-extension", "../extends-paths"], - "compilerOptions": { - "baseUrl": ".", - }, -} diff --git a/fixtures/tsconfig/cases/extends-not-found/index.js b/fixtures/tsconfig/cases/extends-not-found/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-not-found/tsconfig.json b/fixtures/tsconfig/cases/extends-not-found/tsconfig.json deleted file mode 100644 index 99df91da..00000000 --- a/fixtures/tsconfig/cases/extends-not-found/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./not-found" -} diff --git a/fixtures/tsconfig/cases/extends-paths/src/index.js b/fixtures/tsconfig/cases/extends-paths/src/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-paths/tsconfig.base.json b/fixtures/tsconfig/cases/extends-paths/tsconfig.base.json deleted file mode 100644 index 5c64b067..00000000 --- a/fixtures/tsconfig/cases/extends-paths/tsconfig.base.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "@/*": ["./*"] - } - } -} diff --git a/fixtures/tsconfig/cases/extends-paths/tsconfig.json b/fixtures/tsconfig/cases/extends-paths/tsconfig.json deleted file mode 100644 index 51086018..00000000 --- a/fixtures/tsconfig/cases/extends-paths/tsconfig.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": "./tsconfig.base.json", - "compilerOptions": { - "baseUrl": "src", - }, -} diff --git a/fixtures/tsconfig/cases/field/index.js b/fixtures/tsconfig/cases/field/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/field/tsconfig.json b/fixtures/tsconfig/cases/field/tsconfig.json deleted file mode 100644 index 9f86c3f4..00000000 --- a/fixtures/tsconfig/cases/field/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-field" -} diff --git a/fixtures/tsconfig/cases/index/index.js b/fixtures/tsconfig/cases/index/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/index/tsconfig.json b/fixtures/tsconfig/cases/index/tsconfig.json deleted file mode 100644 index d20b1774..00000000 --- a/fixtures/tsconfig/cases/index/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-index" -} diff --git a/fixtures/tsconfig/cases/paths_template_variable/foo.js b/fixtures/tsconfig/cases/paths_template_variable/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json b/fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json deleted file mode 100644 index a1a37bb6..00000000 --- a/fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "../../tsconfig_template_variable.json" -} diff --git a/fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json b/fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json deleted file mode 100644 index e7d8e5e5..00000000 --- a/fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "compilerOptions": { - "composite": true, - "paths": { - "foo": ["${configDir}/foo.js"] - } - } -} diff --git a/fixtures/tsconfig/cases/project_references/app/aliased/index.ts b/fixtures/tsconfig/cases/project_references/app/aliased/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/app/index.ts b/fixtures/tsconfig/cases/project_references/app/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/app/tsconfig.json b/fixtures/tsconfig/cases/project_references/app/tsconfig.json deleted file mode 100644 index 7036d2bb..00000000 --- a/fixtures/tsconfig/cases/project_references/app/tsconfig.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "extends": "../tsconfig.base.json", - "compilerOptions": { - "baseUrl": "./", - "paths": { - "@/*": ["./aliased/*"] - } - }, - "references": [ - { - "path": "../project_a/conf.json" - }, - { - "path": "../project_b" - }, - { - "path": "../project_c/tsconfig.json" - }, - { - "path": "../../paths_template_variable/tsconfig2.json" - } - ] -} diff --git a/fixtures/tsconfig/cases/project_references/project_a/aliased/index.ts b/fixtures/tsconfig/cases/project_references/project_a/aliased/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_a/conf.json b/fixtures/tsconfig/cases/project_references/project_a/conf.json deleted file mode 100644 index 4d389d7a..00000000 --- a/fixtures/tsconfig/cases/project_references/project_a/conf.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "compilerOptions": { - "composite": true, - "paths": { - "@/*": ["./aliased/*"] - } - } -} diff --git a/fixtures/tsconfig/cases/project_references/project_a/index.ts b/fixtures/tsconfig/cases/project_references/project_a/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_b/src/aliased/index.ts b/fixtures/tsconfig/cases/project_references/project_b/src/aliased/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_b/tsconfig.json b/fixtures/tsconfig/cases/project_references/project_b/tsconfig.json deleted file mode 100644 index 4ab05cd8..00000000 --- a/fixtures/tsconfig/cases/project_references/project_b/tsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "compilerOptions": { - "composite": true, - "baseUrl": "./src", - "paths": { - "@/*": ["./aliased/*"] - } - } -} diff --git a/fixtures/tsconfig/cases/project_references/project_c/index.ts b/fixtures/tsconfig/cases/project_references/project_c/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_c/tsconfig.json b/fixtures/tsconfig/cases/project_references/project_c/tsconfig.json deleted file mode 100644 index fe520939..00000000 --- a/fixtures/tsconfig/cases/project_references/project_c/tsconfig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compilerOptions": { - "composite": true - } -} diff --git a/fixtures/tsconfig/cases/project_references/tsconfig.base.json b/fixtures/tsconfig/cases/project_references/tsconfig.base.json deleted file mode 100644 index 88ccffe7..00000000 --- a/fixtures/tsconfig/cases/project_references/tsconfig.base.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "compilerOptions": { - } -} diff --git a/fixtures/tsconfig/cases/suffixes/a.ios.ts b/fixtures/tsconfig/cases/suffixes/a.ios.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/a.ts b/fixtures/tsconfig/cases/suffixes/a.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/b.ts b/fixtures/tsconfig/cases/suffixes/b.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/c-test.ts b/fixtures/tsconfig/cases/suffixes/c-test.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/index.ts b/fixtures/tsconfig/cases/suffixes/index.ts deleted file mode 100644 index b09939b9..00000000 --- a/fixtures/tsconfig/cases/suffixes/index.ts +++ /dev/null @@ -1 +0,0 @@ -import './a'; diff --git a/fixtures/tsconfig/cases/suffixes/tsconfig.json b/fixtures/tsconfig/cases/suffixes/tsconfig.json deleted file mode 100644 index 4c2ccc8f..00000000 --- a/fixtures/tsconfig/cases/suffixes/tsconfig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compilerOptions": { - "moduleSuffixes": [".ios", "-test", ""] - } -} diff --git a/fixtures/tsconfig/cases/trailing-comma/bar.js b/fixtures/tsconfig/cases/trailing-comma/bar.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/trailing-comma/index.js b/fixtures/tsconfig/cases/trailing-comma/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/trailing-comma/tsconfig.json b/fixtures/tsconfig/cases/trailing-comma/tsconfig.json deleted file mode 100644 index 6dc20ca5..00000000 --- a/fixtures/tsconfig/cases/trailing-comma/tsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "compilerOptions": { - "paths": { - /* some comment */ - "foo": ["bar.js"], - }, - }, - // another comment -} diff --git a/fixtures/tsconfig/foo.js b/fixtures/tsconfig/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/nested/index.js b/fixtures/tsconfig/nested/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/nested/test.js b/fixtures/tsconfig/nested/test.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/nested/tsconfig.json b/fixtures/tsconfig/nested/tsconfig.json deleted file mode 100644 index 6deb3011..00000000 --- a/fixtures/tsconfig/nested/tsconfig.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "extends": "..", - "compilerOptions": { - "paths": { - "ts-path": ["test.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-exports/conf.json b/fixtures/tsconfig/node_modules/tsconfig-exports/conf.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-exports/conf.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-exports/foo.js b/fixtures/tsconfig/node_modules/tsconfig-exports/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-exports/package.json b/fixtures/tsconfig/node_modules/tsconfig-exports/package.json deleted file mode 100644 index be0ddee6..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-exports/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "tsconfig-exports", - "private": true, - "exports": { - ".": "./conf.json" - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-field/conf.json b/fixtures/tsconfig/node_modules/tsconfig-field/conf.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-field/conf.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-field/foo.js b/fixtures/tsconfig/node_modules/tsconfig-field/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-field/package.json b/fixtures/tsconfig/node_modules/tsconfig-field/package.json deleted file mode 100644 index 7138fdde..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-field/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "tsconfig-field", - "private": true, - "tsconfig": "conf.json" -} \ No newline at end of file diff --git a/fixtures/tsconfig/node_modules/tsconfig-index/foo.js b/fixtures/tsconfig/node_modules/tsconfig-index/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-index/package.json b/fixtures/tsconfig/node_modules/tsconfig-index/package.json deleted file mode 100644 index eb2431e7..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-index/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "tsconfig-index", - "private": true -} \ No newline at end of file diff --git a/fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json b/fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-not-used/foo.js b/fixtures/tsconfig/node_modules/tsconfig-not-used/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json b/fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json deleted file mode 100644 index eb16d127..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "ts-path": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/package.json b/fixtures/tsconfig/package.json deleted file mode 100755 index f48acd1c..00000000 --- a/fixtures/tsconfig/package.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "name": "resolver", - "private": true, - "alias": { - "aliased": "foo", - "aliased-file": "./bar.js", - "something": "./nested/test.js", - "aliasedfolder": "./nested", - "aliasedabsolute": "/nested", - "foo/bar": "./bar.js", - "glob/*/*": "./nested/$2", - "./baz": "./bar.js", - "url": false - }, - "imports": { - "#test": "./bar.js" - }, - "dependencies": { - "foo": "^0.3.4" - }, - "peerDependencies": { - "bar": "*" - } -} diff --git a/fixtures/tsconfig/tsconfig.json b/fixtures/tsconfig/tsconfig.json deleted file mode 100644 index eb16d127..00000000 --- a/fixtures/tsconfig/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "ts-path": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/tsconfig_broken.json b/fixtures/tsconfig/tsconfig_broken.json deleted file mode 100644 index 98232c64..00000000 --- a/fixtures/tsconfig/tsconfig_broken.json +++ /dev/null @@ -1 +0,0 @@ -{ diff --git a/fixtures/tsconfig/tsconfig_template_variable.json b/fixtures/tsconfig/tsconfig_template_variable.json deleted file mode 100644 index 6f272344..00000000 --- a/fixtures/tsconfig/tsconfig_template_variable.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["${configDir}/foo.js"] - } - } -} diff --git a/napi/__test__/resolver.spec.mjs b/napi/__test__/resolver.spec.mjs deleted file mode 100644 index ac6ee0ef..00000000 --- a/napi/__test__/resolver.spec.mjs +++ /dev/null @@ -1,260 +0,0 @@ -import { join } from 'node:path' -import { fileURLToPath } from 'node:url' - -import test from 'ava' - -let ResolverFactory - -if (process.env.WASI_TEST) { - const wasi = await import('../resolver.wasi.cjs') - ResolverFactory = wasi.ResolverFactory -} else { - const napi = await import('../index.js') - ResolverFactory = napi.ResolverFactory -} - -const currentDir = join(fileURLToPath(import.meta.url), '..') - -const enhancedResolveRoot = join( - currentDir, - '..', - '..', - 'fixtures', - 'enhanced_resolve', - 'test', - 'fixtures' -) - -// https://github.com/webpack/enhanced-resolve/blob/main/test/resolve.test.js - -for (const [title, context, request, expected] of [ - [ - 'absolute path', - enhancedResolveRoot, - join(enhancedResolveRoot, 'main1.js'), - join(enhancedResolveRoot, 'main1.js'), - ], - [ - 'file with .js', - enhancedResolveRoot, - './main1.js', - join(enhancedResolveRoot, 'main1.js'), - ], - [ - 'file without extension', - enhancedResolveRoot, - './main1', - join(enhancedResolveRoot, 'main1.js'), - ], - [ - 'another file with .js', - enhancedResolveRoot, - './a.js', - join(enhancedResolveRoot, 'a.js'), - ], - [ - 'another file without extension', - enhancedResolveRoot, - './a', - join(enhancedResolveRoot, 'a.js'), - ], - [ - 'file in module with .js', - enhancedResolveRoot, - 'm1/a.js', - join(enhancedResolveRoot, 'node_modules/m1/a.js'), - ], - [ - 'file in module without extension', - enhancedResolveRoot, - 'm1/a', - join(enhancedResolveRoot, 'node_modules/m1/a.js'), - ], - [ - 'another file in module without extension', - enhancedResolveRoot, - 'complexm/step1', - join(enhancedResolveRoot, 'node_modules/complexm/step1.js'), - ], - [ - 'from submodule to file in sibling module', - join(enhancedResolveRoot, 'node_modules/complexm'), - 'm2/b.js', - join(enhancedResolveRoot, 'node_modules/m2/b.js'), - ], - [ - 'from nested directory to overwritten file in module', - join(enhancedResolveRoot, 'multiple_modules'), - 'm1/a.js', - join(enhancedResolveRoot, 'multiple_modules/node_modules/m1/a.js'), - ], - [ - 'from nested directory to not overwritten file in module', - join(enhancedResolveRoot, 'multiple_modules'), - 'm1/b.js', - join(enhancedResolveRoot, 'node_modules/m1/b.js'), - ], - [ - 'file with query', - enhancedResolveRoot, - './main1.js?query', - join(enhancedResolveRoot, 'main1.js?query'), - ], - [ - 'file with fragment', - enhancedResolveRoot, - './main1.js#fragment', - join(enhancedResolveRoot, 'main1.js#fragment'), - ], - [ - 'file with fragment and query', - enhancedResolveRoot, - './main1.js#fragment?query', - join(enhancedResolveRoot, 'main1.js#fragment?query'), - ], - [ - 'file with query and fragment', - enhancedResolveRoot, - './main1.js?#fragment', - join(enhancedResolveRoot, 'main1.js?#fragment'), - ], - - [ - 'file with query (unicode)', - enhancedResolveRoot, - './测试.js?query', - join(enhancedResolveRoot, '测试.js?query'), - ], - [ - 'file with fragment (unicode)', - enhancedResolveRoot, - './测试.js#fragment', - join(enhancedResolveRoot, '测试.js#fragment'), - ], - [ - 'file with fragment and query (unicode)', - enhancedResolveRoot, - './测试.js#fragment?query', - join(enhancedResolveRoot, '测试.js#fragment?query'), - ], - [ - 'file with query and fragment (unicode)', - enhancedResolveRoot, - './测试.js?#fragment', - join(enhancedResolveRoot, '测试.js?#fragment'), - ], - - [ - 'file in module with query', - enhancedResolveRoot, - 'm1/a?query', - join(enhancedResolveRoot, 'node_modules/m1/a.js?query'), - ], - [ - 'file in module with fragment', - enhancedResolveRoot, - 'm1/a#fragment', - join(enhancedResolveRoot, 'node_modules/m1/a.js#fragment'), - ], - [ - 'file in module with fragment and query', - enhancedResolveRoot, - 'm1/a#fragment?query', - join(enhancedResolveRoot, 'node_modules/m1/a.js#fragment?query'), - ], - [ - 'file in module with query and fragment', - enhancedResolveRoot, - 'm1/a?#fragment', - join(enhancedResolveRoot, 'node_modules/m1/a.js?#fragment'), - ], - [ - 'differ between directory and file, resolve file', - enhancedResolveRoot, - './dirOrFile', - join(enhancedResolveRoot, 'dirOrFile.js'), - ], - [ - 'differ between directory and file, resolve directory', - enhancedResolveRoot, - './dirOrFile/', - join(enhancedResolveRoot, 'dirOrFile/index.js'), - ], - [ - 'find node_modules outside of node_modules', - join(enhancedResolveRoot, 'browser-module/node_modules'), - 'm1/a', - join(enhancedResolveRoot, 'node_modules/m1/a.js'), - ], - [ - "don't crash on main field pointing to self", - enhancedResolveRoot, - './main-field-self', - join(enhancedResolveRoot, './main-field-self/index.js'), - ], - [ - "don't crash on main field pointing to self (2)", - enhancedResolveRoot, - './main-field-self2', - join(enhancedResolveRoot, './main-field-self2/index.js'), - ], - // enhanced-resolve has `#` prepended with a `\0`, they are removed from the - // following 3 expected test results. - // See https://github.com/webpack/enhanced-resolve#escaping - [ - 'handle fragment edge case (no fragment)', - enhancedResolveRoot, - './no#fragment/#/#', - join(enhancedResolveRoot, 'no#fragment', '#', '#.js'), - ], - [ - 'handle fragment edge case (fragment)', - enhancedResolveRoot, - './no#fragment/#/', - join(enhancedResolveRoot, 'no.js#fragment') + '/#/', - ], - [ - 'handle fragment escaping', - enhancedResolveRoot, - './no\0#fragment/\0#/\0##fragment', - join(enhancedResolveRoot, 'no#fragment', '#', '#.js#fragment'), - ], -]) { - test(title, (t) => { - const resolver = new ResolverFactory({ - modules: ['src/a', 'src/b', 'src/common', 'node_modules'], - extensions: ['.js', '.jsx', '.ts', '.tsx'], - }) - - t.is(resolver.sync(context, request).path, expected) - }) -} - -test('resolve pnpm package', (t) => { - const rootDir = join(currentDir, '..', '..'); - const pnpmProjectPath = join(rootDir, 'fixtures', 'pnpm') - const resolver = new ResolverFactory({ - aliasFields: ['browser'], - }) - t.deepEqual(resolver.sync(pnpmProjectPath, 'styled-components'), { - path: join( - rootDir, - 'node_modules/.pnpm/styled-components@6.1.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/styled-components/dist/styled-components.browser.cjs.js' - ), - }) - t.deepEqual( - resolver.sync( - join( - rootDir, - 'node_modules/.pnpm/styled-components@6.1.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/styled-components' - ), - 'react' - ), - { - path: join( - rootDir, - 'node_modules/.pnpm/react@18.3.1/node_modules/react/index.js' - ), - } - ) -}) diff --git a/napi/src/lib.rs b/napi/src/lib.rs deleted file mode 100644 index 7cd839c5..00000000 --- a/napi/src/lib.rs +++ /dev/null @@ -1,214 +0,0 @@ -extern crate napi; -extern crate napi_derive; -extern crate oxc_resolver; - -use std::{ - path::{Path, PathBuf}, - sync::Arc, -}; - -use napi::{bindgen_prelude::AsyncTask, Task}; -use napi_derive::napi; -use oxc_resolver::{ResolveOptions, Resolver}; - -use self::{ - options::{NapiResolveOptions, StrOrStrList}, - tracing::init_tracing, -}; - -mod options; -mod tracing; - -#[napi(object)] -pub struct ResolveResult { - pub path: Option, - pub error: Option, - /// "type" field in the package.json file - pub module_type: Option, -} - -fn resolve(resolver: &Resolver, path: &Path, request: &str) -> ResolveResult { - match resolver.resolve(path, request) { - Ok(resolution) => ResolveResult { - path: Some(resolution.full_path().to_string_lossy().to_string()), - error: None, - module_type: resolution - .package_json() - .and_then(|p| p.r#type.as_ref()) - .and_then(|t| t.as_str()) - .map(|t| t.to_string()), - }, - Err(err) => ResolveResult { path: None, module_type: None, error: Some(err.to_string()) }, - } -} - -#[allow(clippy::needless_pass_by_value)] -#[napi] -pub fn sync(path: String, request: String) -> ResolveResult { - let path = PathBuf::from(path); - let resolver = Resolver::new(ResolveOptions::default()); - resolve(&resolver, &path, &request) -} - -pub struct ResolveTask { - resolver: Arc, - directory: PathBuf, - request: String, -} - -#[napi] -impl Task for ResolveTask { - type Output = ResolveResult; - type JsValue = ResolveResult; - - fn compute(&mut self) -> napi::Result { - Ok(resolve(&self.resolver, &self.directory, &self.request)) - } - - fn resolve(&mut self, _: napi::Env, result: Self::Output) -> napi::Result { - Ok(result) - } -} - -#[napi] -pub struct ResolverFactory { - resolver: Arc, -} - -#[napi] -impl ResolverFactory { - #[napi(constructor)] - pub fn new(options: NapiResolveOptions) -> Self { - init_tracing(); - Self { resolver: Arc::new(Resolver::new(Self::normalize_options(options))) } - } - - #[napi] - pub fn default() -> Self { - let default_options = ResolveOptions::default(); - Self { resolver: Arc::new(Resolver::new(default_options)) } - } - - /// Clone the resolver using the same underlying cache. - #[napi] - pub fn clone_with_options(&self, options: NapiResolveOptions) -> Self { - Self { - resolver: Arc::new(self.resolver.clone_with_options(Self::normalize_options(options))), - } - } - - /// Clear the underlying cache. - #[napi] - pub fn clear_cache(&self) { - self.resolver.clear_cache(); - } - - /// Synchronously resolve `specifier` at an absolute path to a `directory`. - #[allow(clippy::needless_pass_by_value)] - #[napi] - pub fn sync(&self, directory: String, request: String) -> ResolveResult { - let path = PathBuf::from(directory); - resolve(&self.resolver, &path, &request) - } - - /// Asynchronously resolve `specifier` at an absolute path to a `directory`. - #[allow(clippy::needless_pass_by_value)] - #[napi(js_name = "async")] - pub fn resolve_async(&self, directory: String, request: String) -> AsyncTask { - let path = PathBuf::from(directory); - let resolver = self.resolver.clone(); - AsyncTask::new(ResolveTask { resolver, directory: path, request }) - } - - fn normalize_options(op: NapiResolveOptions) -> ResolveOptions { - let default = ResolveOptions::default(); - // merging options - ResolveOptions { - tsconfig: op.tsconfig.map(|tsconfig| tsconfig.into()), - alias: op - .alias - .map(|alias| { - alias - .into_iter() - .map(|(k, v)| { - let v = v - .into_iter() - .map(|item| match item { - Some(path) => oxc_resolver::AliasValue::from(path), - None => oxc_resolver::AliasValue::Ignore, - }) - .collect(); - (k, v) - }) - .collect::>() - }) - .unwrap_or(default.alias), - alias_fields: op - .alias_fields - .map(|o| o.into_iter().map(|x| StrOrStrList(x).into()).collect::>()) - .unwrap_or(default.alias_fields), - condition_names: op.condition_names.unwrap_or(default.condition_names), - description_files: op.description_files.unwrap_or(default.description_files), - enforce_extension: op - .enforce_extension - .map(|enforce_extension| enforce_extension.into()) - .unwrap_or(default.enforce_extension), - exports_fields: op - .exports_fields - .map(|o| o.into_iter().map(|x| StrOrStrList(x).into()).collect::>()) - .unwrap_or(default.exports_fields), - imports_fields: op - .imports_fields - .map(|o| o.into_iter().map(|x| StrOrStrList(x).into()).collect::>()) - .unwrap_or(default.imports_fields), - extension_alias: op - .extension_alias - .map(|extension_alias| extension_alias.into_iter().collect::>()) - .unwrap_or(default.extension_alias), - extensions: op.extensions.unwrap_or(default.extensions), - fallback: op - .fallback - .map(|fallback| { - fallback - .into_iter() - .map(|(k, v)| { - let v = v - .into_iter() - .map(|item| match item { - Some(path) => oxc_resolver::AliasValue::from(path), - None => oxc_resolver::AliasValue::Ignore, - }) - .collect(); - (k, v) - }) - .collect::>() - }) - .unwrap_or(default.fallback), - fully_specified: op.fully_specified.unwrap_or(default.fully_specified), - main_fields: op - .main_fields - .map(|o| StrOrStrList(o).into()) - .unwrap_or(default.main_fields), - main_files: op.main_files.unwrap_or(default.main_files), - modules: op.modules.map(|o| StrOrStrList(o).into()).unwrap_or(default.modules), - resolve_to_context: op.resolve_to_context.unwrap_or(default.resolve_to_context), - prefer_relative: op.prefer_relative.unwrap_or(default.prefer_relative), - prefer_absolute: op.prefer_absolute.unwrap_or(default.prefer_absolute), - restrictions: op - .restrictions - .map(|restrictions| { - restrictions - .into_iter() - .map(|restriction| restriction.into()) - .collect::>() - }) - .unwrap_or(default.restrictions), - roots: op - .roots - .map(|roots| roots.into_iter().map(PathBuf::from).collect::>()) - .unwrap_or(default.roots), - symlinks: op.symlinks.unwrap_or(default.symlinks), - builtin_modules: op.builtin_modules.unwrap_or(default.builtin_modules), - } - } -} diff --git a/napi/src/options.rs b/napi/src/options.rs deleted file mode 100644 index ea35672f..00000000 --- a/napi/src/options.rs +++ /dev/null @@ -1,261 +0,0 @@ -use std::path::PathBuf; - -use napi::Either; -use napi_derive::napi; -use std::collections::HashMap; - -/// Module Resolution Options -/// -/// Options are directly ported from [enhanced-resolve](https://github.com/webpack/enhanced-resolve#resolver-options). -/// -/// See [webpack resolve](https://webpack.js.org/configuration/resolve/) for information and examples -#[derive(Debug, Clone)] -#[napi(object)] -pub struct NapiResolveOptions { - /// Path to TypeScript configuration file. - /// - /// Default `None` - pub tsconfig: Option, - - /// Alias for [ResolveOptions::alias] and [ResolveOptions::fallback]. - /// - /// For the second value of the tuple, `None -> AliasValue::Ignore`, Some(String) -> - /// AliasValue::Path(String)` - /// Create aliases to import or require certain modules more easily. - /// A trailing $ can also be added to the given object's keys to signify an exact match. - pub alias: Option>>>, - - /// A list of alias fields in description files. - /// Specify a field, such as `browser`, to be parsed according to [this specification](https://github.com/defunctzombie/package-browser-field-spec). - /// Can be a path to json object such as `["path", "to", "exports"]`. - /// - /// Default `[]` - #[napi(ts_type = "(string | string[])[]")] - pub alias_fields: Option>, - - /// Condition names for exports field which defines entry points of a package. - /// The key order in the exports field is significant. During condition matching, earlier entries have higher priority and take precedence over later entries. - /// - /// Default `[]` - pub condition_names: Option>, - - /// The JSON files to use for descriptions. (There was once a `bower.json`.) - /// - /// Default `["package.json"]` - pub description_files: Option>, - - /// If true, it will not allow extension-less files. - /// So by default `require('./foo')` works if `./foo` has a `.js` extension, - /// but with this enabled only `require('./foo.js')` will work. - /// - /// Default to `true` when [ResolveOptions::extensions] contains an empty string. - /// Use `Some(false)` to disable the behavior. - /// See - /// - /// Default None, which is the same as `Some(false)` when the above empty rule is not applied. - pub enforce_extension: Option, - - /// A list of exports fields in description files. - /// Can be a path to json object such as `["path", "to", "exports"]`. - /// - /// Default `[["exports"]]`. - #[napi(ts_type = "(string | string[])[]")] - pub exports_fields: Option>, - - /// Fields from `package.json` which are used to provide the internal requests of a package - /// (requests starting with # are considered internal). - /// - /// Can be a path to a JSON object such as `["path", "to", "imports"]`. - /// - /// Default `[["imports"]]`. - #[napi(ts_type = "(string | string[])[]")] - pub imports_fields: Option>, - - /// An object which maps extension to extension aliases. - /// - /// Default `{}` - pub extension_alias: Option>>, - - /// Attempt to resolve these extensions in order. - /// If multiple files share the same name but have different extensions, - /// will resolve the one with the extension listed first in the array and skip the rest. - /// - /// Default `[".js", ".json", ".node"]` - pub extensions: Option>, - - /// Redirect module requests when normal resolving fails. - /// - /// Default `[]` - pub fallback: Option>>>, - - /// 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). - /// - /// See also webpack configuration [resolve.fullySpecified](https://webpack.js.org/configuration/module/#resolvefullyspecified) - /// - /// Default `false` - pub fully_specified: Option, - - /// A list of main fields in description files - /// - /// Default `["main"]`. - #[napi(ts_type = "string | string[]")] - pub main_fields: Option, - - /// The filename to be used while resolving directories. - /// - /// Default `["index"]` - pub main_files: Option>, - - /// A list of directories to resolve modules from, can be absolute path or folder name. - /// - /// Default `["node_modules"]` - #[napi(ts_type = "string | string[]")] - pub modules: Option, - - /// Resolve to a context instead of a file. - /// - /// Default `false` - pub resolve_to_context: Option, - - /// Prefer to resolve module requests as relative requests instead of using modules from node_modules directories. - /// - /// Default `false` - pub prefer_relative: Option, - - /// Prefer to resolve server-relative urls as absolute paths before falling back to resolve in ResolveOptions::roots. - /// - /// Default `false` - pub prefer_absolute: Option, - - /// A list of resolve restrictions to restrict the paths that a request can be resolved on. - /// - /// Default `[]` - pub restrictions: Option>, - - /// A list of directories where requests of server-relative URLs (starting with '/') are resolved. - /// On non-Windows systems these requests are resolved as an absolute path first. - /// - /// Default `[]` - pub roots: Option>, - - /// Whether to resolve symlinks to their symlinked location. - /// When enabled, symlinked resources are resolved to their real path, not their symlinked location. - /// Note that this may cause module resolution to fail when using tools that symlink packages (like npm link). - /// - /// Default `true` - pub symlinks: Option, - - /// Whether to parse [module.builtinModules](https://nodejs.org/api/module.html#modulebuiltinmodules) or not. - /// For example, "zlib" will throw [crate::ResolveError::Builtin] when set to true. - /// - /// Default `false` - pub builtin_modules: Option, -} - -#[napi] -#[derive(Debug, PartialEq, Eq)] -pub enum EnforceExtension { - Auto, - Enabled, - Disabled, -} - -impl EnforceExtension { - pub fn is_auto(&self) -> bool { - *self == Self::Auto - } - - pub fn is_enabled(&self) -> bool { - *self == Self::Enabled - } - - pub fn is_disabled(&self) -> bool { - *self == Self::Disabled - } -} - -/// Alias Value for [ResolveOptions::alias] and [ResolveOptions::fallback]. -/// Use struct because napi don't support structured union now -#[napi(object)] -#[derive(Debug, Clone)] -pub struct Restriction { - pub path: Option, - pub regex: Option, -} - -/// Tsconfig Options -/// -/// Derived from [tsconfig-paths-webpack-plugin](https://github.com/dividab/tsconfig-paths-webpack-plugin#options) -#[napi(object)] -#[derive(Debug, Clone)] -pub struct TsconfigOptions { - /// Allows you to specify where to find the TypeScript configuration file. - /// You may provide - /// * a relative path to the configuration file. It will be resolved relative to cwd. - /// * an absolute path to the configuration file. - pub config_file: String, - - /// Support for Typescript Project References. - /// - /// * `'auto'`: use the `references` field from tsconfig of `config_file`. - /// * `string[]`: manually provided relative or absolute path. - #[napi(ts_type = "'auto' | string[]")] - pub references: Option>>, -} - -impl Into for Restriction { - fn into(self) -> oxc_resolver::Restriction { - match (self.path, self.regex) { - (None, None) => { - panic!("Should specify path or regex") - } - (None, Some(regex)) => oxc_resolver::Restriction::RegExp(regex), - (Some(path), None) => oxc_resolver::Restriction::Path(PathBuf::from(path)), - (Some(_), Some(_)) => { - panic!("Restriction can't be path and regex at the same time") - } - } - } -} - -impl Into for EnforceExtension { - fn into(self) -> oxc_resolver::EnforceExtension { - match self { - EnforceExtension::Auto => oxc_resolver::EnforceExtension::Auto, - EnforceExtension::Enabled => oxc_resolver::EnforceExtension::Enabled, - EnforceExtension::Disabled => oxc_resolver::EnforceExtension::Disabled, - } - } -} - -impl Into for TsconfigOptions { - fn into(self) -> oxc_resolver::TsconfigOptions { - oxc_resolver::TsconfigOptions { - config_file: PathBuf::from(self.config_file), - references: match self.references { - Some(Either::A(string)) if string.as_str() == "auto" => { - oxc_resolver::TsconfigReferences::Auto - } - Some(Either::A(opt)) => { - panic!("`{}` is not a valid option for tsconfig references", opt) - } - Some(Either::B(paths)) => oxc_resolver::TsconfigReferences::Paths( - paths.into_iter().map(PathBuf::from).collect::>(), - ), - None => oxc_resolver::TsconfigReferences::Disabled, - }, - } - } -} - -type StrOrStrListType = Either>; -pub struct StrOrStrList(pub StrOrStrListType); - -impl Into> for StrOrStrList { - fn into(self) -> Vec { - match self { - StrOrStrList(Either::A(s)) => Vec::from([s]), - StrOrStrList(Either::B(a)) => a, - } - } -} diff --git a/napi/src/tracing.rs b/napi/src/tracing.rs deleted file mode 100644 index 88e4cd7e..00000000 --- a/napi/src/tracing.rs +++ /dev/null @@ -1,25 +0,0 @@ -use std::sync::OnceLock; - -use tracing_subscriber::filter::Targets; -use tracing_subscriber::prelude::__tracing_subscriber_SubscriberExt; -use tracing_subscriber::util::SubscriberInitExt; - -/// To debug `oxc_resolver`: -/// `OXC_LOG=DEBUG your program` -pub fn init_tracing() { - static TRACING: OnceLock<()> = OnceLock::new(); - TRACING.get_or_init(|| { - // Usage without the `regex` feature. - // - tracing_subscriber::registry() - .with(std::env::var("OXC_LOG").map_or_else( - |_| Targets::new(), - |env_var| { - use std::str::FromStr; - Targets::from_str(&env_var).unwrap() - }, - )) - .with(tracing_subscriber::fmt::layer()) - .init(); - }); -} diff --git a/napi/tests/options.test.mjs b/napi/tests/options.test.mjs deleted file mode 100644 index 4a93efff..00000000 --- a/napi/tests/options.test.mjs +++ /dev/null @@ -1,59 +0,0 @@ -import { describe, it } from "node:test"; -import { ResolverFactory } from "../index.js"; -import * as assert from "node:assert"; -import * as path from "node:path"; - -const fixtureDir = new URL( - "../../fixtures/enhanced_resolve/test/fixtures", - import.meta.url -).pathname; - -describe("option", () => { - describe("aliasFields", () => { - it("should allow field string ", () => { - const resolver = new ResolverFactory({ aliasFields: ["browser"] }); - assert.match( - resolver.sync(fixtureDir, "./browser-module/lib/replaced.js").path, - /browser-module\/lib\/browser\.js$/ - ); - }); - it("should allow json path array", () => { - const resolver = new ResolverFactory({ - aliasFields: [["innerBrowser1", "field", "browser"]], - }); - - assert.match( - resolver.sync(fixtureDir, "./browser-module/lib/main1.js").path, - /browser-module\/lib\/main\.js$/ - ); - }); - }); - - describe("exportsFields", () => { - const createTest = (exportsFields) => { - const resolver = new ResolverFactory({ exportsFields }); - assert.match( - resolver.sync( - path.resolve(fixtureDir, "./exports-field3"), - "exports-field" - ).path, - /\/exports-field\/src\/index\.js$/ - ); - }; - it("should allow string as field item", createTest(["broken"])); - it("should allow json path array as field item", createTest([["broken"]])); - }); - - describe("mainFields", () => { - const createTest = (mainFields) => { - const resolver = new ResolverFactory({ mainFields }); - assert.match( - resolver.sync(fixtureDir, "../..").path, - /\/lib\/index\.js$/ - ); - }; - it("should use `'main'` as default", createTest(undefined)); - it("should allow field string", createTest("main")); - it("should allow field array", createTest(["main"])); - }); -}); diff --git a/npm/package.json b/npm/package.json index 85422809..7136edb8 100644 --- a/npm/package.json +++ b/npm/package.json @@ -1,47 +1,36 @@ { - "name": "oxc-resolver", - "version": "1.11.0", - "description": "Oxc Resolver Node API", - "main": "index.js", - "browser": "browser.js", - "files": [ - "index.d.ts", - "index.js", - "browser.js" - ], - "license": "MIT", - "homepage": "https://oxc.rs", - "repository": { - "type": "git", - "url": "git+https://github.com/oxc-project/oxc-resolver.git" - }, - "publishConfig": { - "registry": "https://registry.npmjs.org/", - "access": "public" - }, - "napi": { - "binaryName": "resolver", - "packageName": "@oxc-resolver/binding", - "wasm": { - "browser": { - "fs": true - } - }, - "targets": [ - "x86_64-pc-windows-msvc", - "aarch64-pc-windows-msvc", - "x86_64-unknown-linux-gnu", - "x86_64-unknown-linux-musl", - "x86_64-unknown-freebsd", - "aarch64-unknown-linux-gnu", - "aarch64-unknown-linux-musl", - "armv7-unknown-linux-gnueabihf", - "x86_64-apple-darwin", - "aarch64-apple-darwin", - "wasm32-wasip1-threads" - ] - }, - "funding": { - "url": "https://github.com/sponsors/Boshen" - } + "browser": "browser.js", + "description": "Oxc Resolver Node API", + "files": [ + "index.d.ts", + "index.js", + "browser.js" + ], + "funding": { + "url": "https://github.com/sponsors/Boshen" + }, + "main": "index.js", + "name": "oxc-resolver", + "napi": { + "binaryName": "resolver", + "packageName": "@oxc-resolver/binding", + "targets": [ + "x86_64-pc-windows-msvc", + "aarch64-pc-windows-msvc", + "x86_64-unknown-linux-gnu", + "x86_64-unknown-linux-musl", + "x86_64-unknown-freebsd", + "aarch64-unknown-linux-gnu", + "aarch64-unknown-linux-musl", + "armv7-unknown-linux-gnueabihf", + "x86_64-apple-darwin", + "aarch64-apple-darwin", + "wasm32-wasip1-threads" + ], + "wasm": { + "browser": { + "fs": true + } + } + } } diff --git a/package.json b/package.json index 30892ca3..d0ee7633 100644 --- a/package.json +++ b/package.json @@ -1,33 +1,24 @@ { - "name": "@oxc-resolver/binding", - "private": true, - "version": "0.0.0", - "scripts": { - "build": "napi build --platform --release --package-json-path npm/package.json --manifest-path napi/Cargo.toml", - "build:debug": "napi build --platform --package-json-path npm/package.json --manifest-path napi/Cargo.toml", - "prepublishOnly": "napi pre-publish -t npm", - "test": "ava" - }, - "devDependencies": { - "@napi-rs/cli": "3.0.0-alpha.62", - "@napi-rs/wasm-runtime": "^0.2.4", - "@types/node": "^22.0.0", - "ava": "^6.1.3", - "emnapi": "^1.2.0", - "typescript": "^5.5.3" - }, - "ava": { - "files": [ - "napi/__test__/*.spec.mjs" - ], - "cache": false - }, - "packageManager": "pnpm@9.9.0", - "repository": { - "type": "git", - "url": "git+https://github.com/oxc-project/oxc-resolver.git" - }, - "funding": { - "url": "https://github.com/sponsors/Boshen" - } + "ava": { + "cache": false, + "files": [ + "napi/__test__/*.spec.mjs" + ] + }, + "devDependencies": { + "@napi-rs/cli": "3.0.0-alpha.62", + "@napi-rs/wasm-runtime": "^0.2.4", + "@types/node": "^22.0.0", + "ava": "^6.1.3", + "emnapi": "^1.2.0" + }, + "funding": { + "url": "https://github.com/sponsors/Boshen" + }, + "name": "@oxc-resolver/binding", + "scripts": { + "build": "napi build --platform --release --package-json-path npm/package.json --manifest-path napi/Cargo.toml", + "build:debug": "napi build --platform --package-json-path npm/package.json --manifest-path napi/Cargo.toml", + "prepublishOnly": "napi pre-publish -t npm" + } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml deleted file mode 100644 index db9e5b63..00000000 --- a/pnpm-lock.yaml +++ /dev/null @@ -1,2598 +0,0 @@ -lockfileVersion: '9.0' - -settings: - autoInstallPeers: true - excludeLinksFromLockfile: false - -importers: - - .: - devDependencies: - '@napi-rs/cli': - specifier: 3.0.0-alpha.62 - version: 3.0.0-alpha.62(@emnapi/runtime@1.2.0)(emnapi@1.2.0) - '@napi-rs/wasm-runtime': - specifier: ^0.2.4 - version: 0.2.4 - '@types/node': - specifier: ^22.0.0 - version: 22.5.4 - ava: - specifier: ^6.1.3 - version: 6.1.3 - emnapi: - specifier: ^1.2.0 - version: 1.2.0 - typescript: - specifier: ^5.5.3 - version: 5.5.4 - - fixtures/pnpm: - devDependencies: - axios: - specifier: 1.6.2 - version: 1.6.2 - ipaddr.js: - specifier: 2.2.0 - version: 2.2.0 - postcss: - specifier: 8.4.33 - version: 8.4.33 - styled-components: - specifier: 6.1.1 - version: 6.1.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - - npm: {} - -packages: - - '@emnapi/core@1.2.0': - resolution: {integrity: sha512-E7Vgw78I93we4ZWdYCb4DGAwRROGkMIXk7/y87UmANR+J6qsWusmC3gLt0H+O0KOt5e6O38U8oJamgbudrES/w==} - - '@emnapi/runtime@1.2.0': - resolution: {integrity: sha512-bV21/9LQmcQeCPEg3BDFtvwL6cwiTMksYNWQQ4KOxCZikEGalWtenoZ0wCiukJINlGCIi2KXx01g4FoH/LxpzQ==} - - '@emnapi/wasi-threads@1.0.1': - resolution: {integrity: sha512-iIBu7mwkq4UQGeMEM8bLwNK962nXdhodeScX4slfQnRhEMMzvYivHhutCIk8uojvmASXXPC2WNEjwxFWk72Oqw==} - - '@emotion/is-prop-valid@1.2.2': - resolution: {integrity: sha512-uNsoYd37AFmaCdXlg6EYD1KaPOaRWRByMCYzbKUX4+hhMfrxdVSelShywL4JVaAeM/eHUOSprYBQls+/neX3pw==} - - '@emotion/memoize@0.8.1': - resolution: {integrity: sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA==} - - '@emotion/unitless@0.8.1': - resolution: {integrity: sha512-KOEGMu6dmJZtpadb476IsZBclKvILjopjUii3V+7MnXIQCYh8W3NgNcgwo21n9LXZX6EDIKvqfjYxXebDwxKmQ==} - - '@inquirer/checkbox@2.3.10': - resolution: {integrity: sha512-CTc864M2/523rKc9AglIzAcUCuPXDZENgc5S2KZFVRbnMzpXcYTsUWmbqSeL0XLvtlvEtNevkkVbfVhJpruOyQ==} - engines: {node: '>=18'} - - '@inquirer/confirm@3.1.14': - resolution: {integrity: sha512-nbLSX37b2dGPtKWL3rPuR/5hOuD30S+pqJ/MuFiUEgN6GiMs8UMxiurKAMDzKt6C95ltjupa8zH6+3csXNHWpA==} - engines: {node: '>=18'} - - '@inquirer/core@9.0.2': - resolution: {integrity: sha512-nguvH3TZar3ACwbytZrraRTzGqyxJfYJwv+ZwqZNatAosdWQMP1GV8zvmkNlBe2JeZSaw0WYBHZk52pDpWC9qA==} - engines: {node: '>=18'} - - '@inquirer/editor@2.1.14': - resolution: {integrity: sha512-6nWpoJyVAKwAcv67bkbBmmi3f32xua79fP7TRmNUoR4K+B1GiOBsHO1YdvET/jvC+nTlBZL7puKAKyM7G+Lkzw==} - engines: {node: '>=18'} - - '@inquirer/expand@2.1.14': - resolution: {integrity: sha512-JcxsLajwPykF2kq6biIUdoOzTQ3LXqb8XMVrWkCprG/pFeU1SsxcSSFbF1T5jJGvvlTVcsE+JdGjbQ8ZRZ82RA==} - engines: {node: '>=18'} - - '@inquirer/figures@1.0.3': - resolution: {integrity: sha512-ErXXzENMH5pJt5/ssXV0DfWUZqly8nGzf0UcBV9xTnP+KyffE2mqyxIMBrZ8ijQck2nU0TQm40EQB53YreyWHw==} - engines: {node: '>=18'} - - '@inquirer/input@2.2.1': - resolution: {integrity: sha512-Yl1G6h7qWydzrJwqN777geeJVaAFL5Ly83aZlw4xHf8Z/BoTMfKRheyuMaQwOG7LQ4e5nQP7PxXdEg4SzQ+OKw==} - engines: {node: '>=18'} - - '@inquirer/number@1.0.2': - resolution: {integrity: sha512-GcoK+Phxcln0Qw9e73S5a8B2Ejg3HgSTvNfDegIcS5/BKwUm8t5rejja1l09WXjZM9vrVbRDf9RzWtSUiWVYRQ==} - engines: {node: '>=18'} - - '@inquirer/password@2.1.14': - resolution: {integrity: sha512-sPzOkXLhWJQ96K6nPZFnF8XB8tsDrcCRobd1d3EDz81F+4hp8BbdmsnsQcqZ7oYDIOVM/mWJyIUtJ35TrssJxQ==} - engines: {node: '>=18'} - - '@inquirer/prompts@5.1.2': - resolution: {integrity: sha512-E+ndnfwtVQtcmPt888Hc/HAxJUHSaA6OIvyvLAQ5BLQv+t20GbYdFSjXeLgb47OpMU+aRsKA/ys+Zoylw3kTVg==} - engines: {node: '>=18'} - - '@inquirer/rawlist@2.1.14': - resolution: {integrity: sha512-pLpEzhKNQ/ugFAFfgCNaXljB+dcCwmXwR1jOxAbVeFIdB3l02E5gjI+h1rb136tq0T8JO6P5KFR1oTeld/wdrA==} - engines: {node: '>=18'} - - '@inquirer/select@2.3.10': - resolution: {integrity: sha512-rr7iR0Zj1YFfgM8IUGimPD9Yukd+n/U63CnYT9kdum6DbRXtMxR45rrreP+EA9ixCnShr+W4xj7suRxC1+8t9g==} - engines: {node: '>=18'} - - '@inquirer/type@1.4.0': - resolution: {integrity: sha512-AjOqykVyjdJQvtfkNDGUyMYGF8xN50VUxftCQWsOyIo4DFRLr6VQhW0VItGI1JIyQGCGgIpKa7hMMwNhZb4OIw==} - engines: {node: '>=18'} - - '@mapbox/node-pre-gyp@1.0.11': - resolution: {integrity: sha512-Yhlar6v9WQgUp/He7BdgzOz8lqMQ8sU+jkCq7Wx8Myc5YFJLbEe7lgui/V7G1qB1DJykHSGwreceSaD60Y0PUQ==} - hasBin: true - - '@napi-rs/cli@3.0.0-alpha.62': - resolution: {integrity: sha512-IDUwHAEJZ9ad/s5oyhznrz5ZDcU+SJ6GdP5nb++Wx5MkS4FD9MeS3HfNZdsxkf10pOUPnmvCVFuG4xnLBQYmjw==} - engines: {node: '>= 16'} - hasBin: true - peerDependencies: - '@emnapi/runtime': ^1.1.0 - emnapi: ^1.1.0 - peerDependenciesMeta: - '@emnapi/runtime': - optional: true - emnapi: - optional: true - - '@napi-rs/cross-toolchain@0.0.16': - resolution: {integrity: sha512-jwdjHT5L0m9MH0CmzDwPp0ckn/UO7afHCsPeo7NugHUvYgvlgS7SWhdMVgIgJW2HHqhcW/2nhaLLGpAU1c7QRQ==} - peerDependencies: - '@napi-rs/cross-toolchain-arm64-target-aarch64': ^0.0.16 - '@napi-rs/cross-toolchain-arm64-target-armv7': ^0.0.16 - '@napi-rs/cross-toolchain-arm64-target-x86_64': ^0.0.16 - '@napi-rs/cross-toolchain-x64-target-aarch64': ^0.0.16 - '@napi-rs/cross-toolchain-x64-target-armv7': ^0.0.16 - '@napi-rs/cross-toolchain-x64-target-x86_64': ^0.0.16 - peerDependenciesMeta: - '@napi-rs/cross-toolchain-arm64-target-aarch64': - optional: true - '@napi-rs/cross-toolchain-arm64-target-armv7': - optional: true - '@napi-rs/cross-toolchain-arm64-target-x86_64': - optional: true - '@napi-rs/cross-toolchain-x64-target-aarch64': - optional: true - '@napi-rs/cross-toolchain-x64-target-armv7': - optional: true - '@napi-rs/cross-toolchain-x64-target-x86_64': - optional: true - - '@napi-rs/lzma-android-arm-eabi@1.3.1': - resolution: {integrity: sha512-mtGOg8jXlc+pTBI86cqohfndS9UmOAkk9d5CChKMb8btVks70yhUN1e7YYS3QFbmoxbPs2Ee+wmuH1Khdc7B2w==} - engines: {node: '>= 10'} - cpu: [arm] - os: [android] - - '@napi-rs/lzma-android-arm64@1.3.1': - resolution: {integrity: sha512-4uGkQgAv9Tnc/i0k2eIgbhZgyzs94+iECWxz4MFZNcZ1fNGvGbRL2j+SITE4OmwrUn3TuFK/uYWfgzooq8E1Qg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [android] - - '@napi-rs/lzma-darwin-arm64@1.3.1': - resolution: {integrity: sha512-MZBg4iwHTS8icjTiCMdzh8kYrMmKBCEglFPa+vjI91R2XDwuuwSzqmpATRpmMH8cWUUWtGPF4fnxKzjgkzhd4Q==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [darwin] - - '@napi-rs/lzma-darwin-x64@1.3.1': - resolution: {integrity: sha512-7vte+1lYV7xgZERKH/pjAeh4T16aQASKOzu4op70pK6VP/64Plr5rrvqxQqQmlAIe4pwyo/RkFl1n4LXDod3xg==} - engines: {node: '>= 10'} - cpu: [x64] - os: [darwin] - - '@napi-rs/lzma-freebsd-x64@1.3.1': - resolution: {integrity: sha512-uBS74fynTqLUC3catIxyezCafn8UDlr2yxVV47vz1T6Vop2PGDz/cMQdV6rnLSjPE08Rv66ihM36mgf/MmOkOg==} - engines: {node: '>= 10'} - cpu: [x64] - os: [freebsd] - - '@napi-rs/lzma-linux-arm-gnueabihf@1.3.1': - resolution: {integrity: sha512-rrVLyqBJeN29gPJCNkPbZ7dAzaseEcERKyhjwM+DfbFrDUvtkEcrYPvo+iwE/NmF+OkZQkzcanrVMGnq/mcJYQ==} - engines: {node: '>= 10'} - cpu: [arm] - os: [linux] - - '@napi-rs/lzma-linux-arm64-gnu@1.3.1': - resolution: {integrity: sha512-vDmVsthRbX2opkgRirJJGKQxUP/spvyVM2Y5CyCWZ7sadSID3hA97r38gf9ISn/sJ8/r93IPWLq+iycudNKi+Q==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/lzma-linux-arm64-musl@1.3.1': - resolution: {integrity: sha512-x4m/J3hRdFd3IoqKc+4aBcSUkcuDEP7hH6vdss8bKNLjPfXmnG/lcHJEQX3hNnNOULPP8xVRxgiY8jeL62cnsw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/lzma-linux-x64-gnu@1.3.1': - resolution: {integrity: sha512-riB+Xg72NfH8Kcpq07omshVu0QsLW0v2bhywBNYxvA+t2dGGWSIEN1U/zazUXys+IEA6pBQKqLVseurWE6Cl8g==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/lzma-linux-x64-musl@1.3.1': - resolution: {integrity: sha512-JXLgJFwoeysxdSg7rdVYP8wrliCQVJlU5JcLYjRVSCL4P0mQTjnYi7R7VdaOkDACw/Fvlji7oIJXt0KiaDTcOw==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/lzma-wasm32-wasi@1.3.1': - resolution: {integrity: sha512-XTA9XTUtj0KPKuzNS2oi3bWN6tJodk00wwMd/TiKoEqx9Fe/zu+OfDGuXAn+xs+P7S3YCDHqjYinuTQMZ0ucJw==} - engines: {node: '>=14.0.0'} - cpu: [wasm32] - - '@napi-rs/lzma-win32-arm64-msvc@1.3.1': - resolution: {integrity: sha512-qLDfs9UEtLPPTN/FdSz3gSdlx86VwFQBuLBrQtaiYQtUTKZCOYV1Z1fXqFt5Zqa1HKV2oyXnwGcTI7RpcyXxtg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [win32] - - '@napi-rs/lzma-win32-ia32-msvc@1.3.1': - resolution: {integrity: sha512-rWNlxLFMIfvxzfdQCfeQ3D/HEnQG3vfladFYrXUx6ePXO6r+BLCGn6/LWSSuKlw4vKkb1iHEWsAVaRLIcJEMIA==} - engines: {node: '>= 10'} - cpu: [ia32] - os: [win32] - - '@napi-rs/lzma-win32-x64-msvc@1.3.1': - resolution: {integrity: sha512-SNfHNqEjabXfTL1+KRi0qiAhwIlZHhQystvfSYX6p1g+2trSC/3WUpUQ4fbbR7KyE31g2AAnwjXivnlQ0af/pg==} - engines: {node: '>= 10'} - cpu: [x64] - os: [win32] - - '@napi-rs/lzma@1.3.1': - resolution: {integrity: sha512-XyZoBlYNMvCulK/RmVK/0nB3j7IdH7HpqcrMMg0U+HqQqKRLOQBwvnKNBocPC1bZQ7iZuKWYTLn1ayZwTyek8w==} - engines: {node: '>= 10'} - - '@napi-rs/tar-android-arm-eabi@0.1.1': - resolution: {integrity: sha512-Ufa0ahZvE5KGrC2WBux5svCe/jvC+e8IgtleiicwqnfgTfbDknYyq/QuqkP1AnMp/IvTmx2iutCZt6OFIG0zAg==} - engines: {node: '>= 10'} - cpu: [arm] - os: [android] - - '@napi-rs/tar-android-arm64@0.1.1': - resolution: {integrity: sha512-KUu5fHIiIObSuZ/crHxUrQ243+LiCRKPwdCVLHwjtftqFjzls+R2Mp6GrpM41XxexDMN00SUta3kazi93Xr19A==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [android] - - '@napi-rs/tar-darwin-arm64@0.1.1': - resolution: {integrity: sha512-jaqgdX20iIga+2gzotQ78eF00Cm8vECocUYeMY62WqyzJNv/jx1dlOfELWEccOjpmawFT9tjWebsS9F1QMvSUg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [darwin] - - '@napi-rs/tar-darwin-x64@0.1.1': - resolution: {integrity: sha512-80sa32IxfRso9x9sGTFpfLSx3BnruyJODpSkUzalOCz9i14n5gOKA8KR/JrnSWwDz0p5l5P9kfQD3pu8Voj7WA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [darwin] - - '@napi-rs/tar-freebsd-x64@0.1.1': - resolution: {integrity: sha512-P7V1zBjjC1dCrTwtUzuzYM4AeZduigeCtd8qQw2IUZowM5AsmhMd77oYuXjdU29cEpKUpyYjJRxjPCzFy+WbAQ==} - engines: {node: '>= 10'} - cpu: [x64] - os: [freebsd] - - '@napi-rs/tar-linux-arm-gnueabihf@0.1.1': - resolution: {integrity: sha512-qpC71ILPkWKt8k1iJCYt5gjwcOkd2VFSQIelTRr12t5CVNKV04rE/TMdwFoCP7kxbtb9Fl2cZzCRISw2BhMCmQ==} - engines: {node: '>= 10'} - cpu: [arm] - os: [linux] - - '@napi-rs/tar-linux-arm64-gnu@0.1.1': - resolution: {integrity: sha512-71QgxcFJCog6O4Tauoge8D0ILkDGJTRk3ru7zG8PUFG1QXJ1kkiRikdT77YmoVxtomc9FUOt+bdEdU5Yn+3QUQ==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/tar-linux-arm64-musl@0.1.1': - resolution: {integrity: sha512-R2e7YEILPKc447N1hUt1zQuyy0st83HX6nhmtFywS1aOj76/3hzxLVrebGiiS6kifyCrO82o66CNTYe7DixMZw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/tar-linux-x64-gnu@0.1.1': - resolution: {integrity: sha512-tmy9q2LXUB2GQ+IgUzJn3+us52leplMu96ORyFq1iHQEelGSqXt4xi5DzU07JhX3obJPqVqkybtcRS4enBfmBA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/tar-linux-x64-musl@0.1.1': - resolution: {integrity: sha512-j5ePbe6vihApl0cGPPDUVTWZbf2mF4NhxngAoG2jp7AeX3cWP2O4pjsvaOraW6QfvWEMFPeER7S0b6eBS7duvA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/tar-wasm32-wasi@0.1.1': - resolution: {integrity: sha512-se0+DlOiIRt7mcz7BeOJDoZtCrROpKLwiAOGmNgrjQ/SZS7TnOPuwm3wy9XN9WLoepttEjCEem6UP8yD5GJuQg==} - engines: {node: '>=14.0.0'} - cpu: [wasm32] - - '@napi-rs/tar-win32-arm64-msvc@0.1.1': - resolution: {integrity: sha512-FDZPi2wC7RwzvodogigLh/pJvhqCTVTUqOYuHlLkPSUbSAGiEkI55wk9RqH3y3EdJQaDuzyqC0QKz5ket2U+GA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [win32] - - '@napi-rs/tar-win32-ia32-msvc@0.1.1': - resolution: {integrity: sha512-OPR9Tou5z5M912G7Kc7gkf1ltinbOQx5dS/OeDIWHvPGOfdFDIxt0YVKhzSLRJi43+zIDp8/+cbeMD/cKXfX8w==} - engines: {node: '>= 10'} - cpu: [ia32] - os: [win32] - - '@napi-rs/tar-win32-x64-msvc@0.1.1': - resolution: {integrity: sha512-hiv5KfhrMSg8tTRC2oQXVckVg1h6ZVjwbd5aF9Esl0V3p2TaNFwwbqgnAN4Gm/PmSnHWNL/IRTHkk3cOzDWihQ==} - engines: {node: '>= 10'} - cpu: [x64] - os: [win32] - - '@napi-rs/tar@0.1.1': - resolution: {integrity: sha512-FOMhwwlvoYjHaDBxP26K3D92ltw1Y/CC4CIjgC6qXdzW4MYNwTlEyI58smCM3k+nCVJH3kpOYyH3sgbK4WZA4A==} - engines: {node: '>= 10'} - - '@napi-rs/wasm-runtime@0.2.4': - resolution: {integrity: sha512-9zESzOO5aDByvhIAsOy9TbpZ0Ur2AJbUI7UT73kcUTS2mxAMHOBaa1st/jAymNoCtvrit99kkzT1FZuXVcgfIQ==} - - '@napi-rs/wasm-tools-android-arm-eabi@0.0.2': - resolution: {integrity: sha512-/b+UU3suXjW4P0DzHRNdrnebQtFKcQf/YMeZJH+xUlKgvwli5kbmWjx8Wqqz0VETVkUTuPqJMBDIVLyc+14FGw==} - engines: {node: '>= 10'} - cpu: [arm] - os: [android] - - '@napi-rs/wasm-tools-android-arm64@0.0.2': - resolution: {integrity: sha512-j57GbDflwJdZtT8pZj5fOV4JAP+LdKN+wzsUYs+QRUoBqpWbbUANudolqfw63bkS9sD4z7fbCuz8iwtJqzxTVA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [android] - - '@napi-rs/wasm-tools-darwin-arm64@0.0.2': - resolution: {integrity: sha512-P2ChgWgVuv9GwmbxN89R84KzIImoTqXINteEixUvmkdnhyFiR+I8deNs89Yed+5w8QLC6MEfrtRqLP9YI+NoQA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [darwin] - - '@napi-rs/wasm-tools-darwin-x64@0.0.2': - resolution: {integrity: sha512-T/kQQ0gt8+wau1Z821PKVAD76QhmwVoLs2CT7Z9tTBs2pJvwSCP0C/kQiQAHcJIMi7A2E9Ab/Mez0BERy50EFA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [darwin] - - '@napi-rs/wasm-tools-freebsd-x64@0.0.2': - resolution: {integrity: sha512-GnnHu+r5sfzuxC/1J5UMF/h3BOZnHb3NQZ5hmbCfZYCKzpzRxrAJhzRunlbRN+v0x8M/49dztVTYR3s7K4ooAw==} - engines: {node: '>= 10'} - cpu: [x64] - os: [freebsd] - - '@napi-rs/wasm-tools-linux-arm64-gnu@0.0.2': - resolution: {integrity: sha512-KnZdLT0OnKb1CG2kdt3/WvM43vr9i+FEwXCvSOVC/6Tsifz7ynhMg7LAVESILd03HubzQJfg9nbRsk0bQ+IOwg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/wasm-tools-linux-arm64-musl@0.0.2': - resolution: {integrity: sha512-HkpZOID2U8P6pWqK3mqZ8bxU5xcuT3iA2fO+jrxn78h006iYgfNmdc5JaVhHnHazMmk32xKhSV4iV0VUh8UWDg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/wasm-tools-linux-x64-gnu@0.0.2': - resolution: {integrity: sha512-YksJWBCyOalB9ogtP9+/dZKP+vR6+h7BmzMXaXMT71WW/GvIsifMVgv+DY/FRSNJQupp5Y+ugjqVAOUOc/G65g==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/wasm-tools-linux-x64-musl@0.0.2': - resolution: {integrity: sha512-sPtRxPMdw05KdTcxgSPMmSXG2+PiK3vJ/l2+g9hvjnnKtvslJN2Hr7j8zgzuoKRAUFPaJVe6+D2xVh5cpdqhww==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/wasm-tools-wasm32-wasi@0.0.2': - resolution: {integrity: sha512-muRvZK7AIuo88G2AxYx3gA59rHMQgoN004saQkBvXnz3K/DVHKfTZ6TtUebss8zI3dURU6xExL8drxFWYxjEbQ==} - engines: {node: '>=14.0.0'} - cpu: [wasm32] - - '@napi-rs/wasm-tools-win32-arm64-msvc@0.0.2': - resolution: {integrity: sha512-Cn13WQ+tpFqdVwx0DIWKbsI9auFyzVZV4F5UNOUeDt6GgOL+NndgJul0Pc9bSU6fi03AylMPfF/nTCaDWO2Wgw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [win32] - - '@napi-rs/wasm-tools-win32-ia32-msvc@0.0.2': - resolution: {integrity: sha512-xsg5DkIQi82a8rcx6246Y3XC8TIqHamY+/C6sIlPLaZEuHctDkMECAw0AANwRf5vN//D2oo2oljOuoYtB1GOKw==} - engines: {node: '>= 10'} - cpu: [ia32] - os: [win32] - - '@napi-rs/wasm-tools-win32-x64-msvc@0.0.2': - resolution: {integrity: sha512-yHigltEt33eq8bappvKsIliz4MxfMPn1M+NWbIFRWN+IS1Z57mhmc1osuk+IRXrSlq0Tom0R6MYN1jpkZKz81Q==} - engines: {node: '>= 10'} - cpu: [x64] - os: [win32] - - '@napi-rs/wasm-tools@0.0.2': - resolution: {integrity: sha512-kBvDQCP5BLw2TxTENXLp3Of7vVEx0uyIye824JHE4dduzzOHVgSoOFVhVqAT3Fx/hLV445RVWfEqQbXMg4w/Mw==} - engines: {node: '>= 10'} - - '@nodelib/fs.scandir@2.1.5': - resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} - engines: {node: '>= 8'} - - '@nodelib/fs.stat@2.0.5': - resolution: {integrity: sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==} - engines: {node: '>= 8'} - - '@nodelib/fs.walk@1.2.8': - resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} - engines: {node: '>= 8'} - - '@octokit/auth-token@5.1.1': - resolution: {integrity: sha512-rh3G3wDO8J9wSjfI436JUKzHIxq8NaiL0tVeB2aXmG6p/9859aUOAjA9pmSPNGGZxfwmaJ9ozOJImuNVJdpvbA==} - engines: {node: '>= 18'} - - '@octokit/core@6.1.2': - resolution: {integrity: sha512-hEb7Ma4cGJGEUNOAVmyfdB/3WirWMg5hDuNFVejGEDFqupeOysLc2sG6HJxY2etBp5YQu5Wtxwi020jS9xlUwg==} - engines: {node: '>= 18'} - - '@octokit/endpoint@10.1.1': - resolution: {integrity: sha512-JYjh5rMOwXMJyUpj028cu0Gbp7qe/ihxfJMLc8VZBMMqSwLgOxDI1911gV4Enl1QSavAQNJcwmwBF9M0VvLh6Q==} - engines: {node: '>= 18'} - - '@octokit/graphql@8.1.1': - resolution: {integrity: sha512-ukiRmuHTi6ebQx/HFRCXKbDlOh/7xEV6QUXaE7MJEKGNAncGI/STSbOkl12qVXZrfZdpXctx5O9X1AIaebiDBg==} - engines: {node: '>= 18'} - - '@octokit/openapi-types@22.2.0': - resolution: {integrity: sha512-QBhVjcUa9W7Wwhm6DBFu6ZZ+1/t/oYxqc2tp81Pi41YNuJinbFRx8B133qVOrAaBbF7D/m0Et6f9/pZt9Rc+tg==} - - '@octokit/plugin-paginate-rest@11.3.3': - resolution: {integrity: sha512-o4WRoOJZlKqEEgj+i9CpcmnByvtzoUYC6I8PD2SA95M+BJ2x8h7oLcVOg9qcowWXBOdcTRsMZiwvM3EyLm9AfA==} - engines: {node: '>= 18'} - peerDependencies: - '@octokit/core': '>=6' - - '@octokit/plugin-request-log@5.3.0': - resolution: {integrity: sha512-FiGcyjdtYPlr03ExBk/0ysIlEFIFGJQAVoPPMxL19B24bVSEiZQnVGBunNtaAF1YnvE/EFoDpXmITtRnyCiypQ==} - engines: {node: '>= 18'} - peerDependencies: - '@octokit/core': '>=6' - - '@octokit/plugin-rest-endpoint-methods@13.2.4': - resolution: {integrity: sha512-gusyAVgTrPiuXOdfqOySMDztQHv6928PQ3E4dqVGEtOvRXAKRbJR4b1zQyniIT9waqaWk/UDaoJ2dyPr7Bk7Iw==} - engines: {node: '>= 18'} - peerDependencies: - '@octokit/core': '>=6' - - '@octokit/request-error@6.1.2': - resolution: {integrity: sha512-sA0oF7aL5wXbNfl+7zgLYJiFZctei9GaIMJlTraJrlQyFaoIYr4MCqPSakzxxGCfm8fET4vn0cQdRFmD7avlDg==} - engines: {node: '>= 18'} - - '@octokit/request@9.1.1': - resolution: {integrity: sha512-pyAguc0p+f+GbQho0uNetNQMmLG1e80WjkIaqqgUkihqUp0boRU6nKItXO4VWnr+nbZiLGEyy4TeKRwqaLvYgw==} - engines: {node: '>= 18'} - - '@octokit/rest@21.0.0': - resolution: {integrity: sha512-XudXXOmiIjivdjNZ+fN71NLrnDM00sxSZlhqmPR3v0dVoJwyP628tSlc12xqn8nX3N0965583RBw5GPo6r8u4Q==} - engines: {node: '>= 18'} - - '@octokit/types@13.5.0': - resolution: {integrity: sha512-HdqWTf5Z3qwDVlzCrP8UJquMwunpDiMPt5er+QjGzL4hqr/vBVY/MauQgS1xWxCDT1oMx1EULyqxncdCY/NVSQ==} - - '@rollup/pluginutils@4.2.1': - resolution: {integrity: sha512-iKnFXr7NkdZAIHiIWE+BX5ULi/ucVFYWD6TbAV+rZctiRTY2PL6tsIKhoIOaoskiWAkgu+VsbXgUVDNLHf+InQ==} - engines: {node: '>= 8.0.0'} - - '@sindresorhus/merge-streams@2.3.0': - resolution: {integrity: sha512-LtoMMhxAlorcGhmFYI+LhPgbPZCkgP6ra1YL604EeF6U98pLlQ3iWIGMdWSC+vWmPBWBNgmDBAhnAobLROJmwg==} - engines: {node: '>=18'} - - '@tybys/wasm-util@0.9.0': - resolution: {integrity: sha512-6+7nlbMVX/PVDCwaIQ8nTOPveOcFLSt8GcXdx8hD0bt39uWxYT88uXzqTd4fTvqta7oeUJqudepapKNt2DYJFw==} - - '@types/mute-stream@0.0.4': - resolution: {integrity: sha512-CPM9nzrCPPJHQNA9keH9CVkVI+WR5kMa+7XEs5jcGQ0VoAGnLv242w8lIVgwAEfmE4oufJRaTc9PNLQl0ioAow==} - - '@types/node@20.16.5': - resolution: {integrity: sha512-VwYCweNo3ERajwy0IUlqqcyZ8/A7Zwa9ZP3MnENWcB11AejO+tLy3pu850goUW2FC/IJMdZUfKpX/yxL1gymCA==} - - '@types/node@22.5.4': - resolution: {integrity: sha512-FDuKUJQm/ju9fT/SeX/6+gBzoPzlVCzfzmGkwKvRHQVxi4BntVbyIwf6a4Xn62mrvndLiml6z/UBXIdEVjQLXg==} - - '@types/stylis@4.2.6': - resolution: {integrity: sha512-4nebF2ZJGzQk0ka0O6+FZUWceyFv4vWq/0dXBMmrSeAwzOuOd/GxE5Pa64d/ndeNLG73dXoBsRzvtsVsYUv6Uw==} - - '@types/wrap-ansi@3.0.0': - resolution: {integrity: sha512-ltIpx+kM7g/MLRZfkbL7EsCEjfzCcScLpkg37eXEtx5kmrAKBkTJwd1GIAjDSL8wTpM6Hzn5YO4pSb91BEwu1g==} - - '@vercel/nft@0.26.5': - resolution: {integrity: sha512-NHxohEqad6Ra/r4lGknO52uc/GrWILXAMs1BB4401GTqww0fw1bAqzpG1XHuDO+dprg4GvsD9ZLLSsdo78p9hQ==} - engines: {node: '>=16'} - hasBin: true - - abbrev@1.1.1: - resolution: {integrity: sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==} - - acorn-import-attributes@1.9.5: - resolution: {integrity: sha512-n02Vykv5uA3eHGM/Z2dQrcD56kL8TyDb2p1+0P83PClMnC/nc+anbQRhIOWnSq4Ke/KvDPrY3C9hDtC/A3eHnQ==} - peerDependencies: - acorn: ^8 - - acorn-walk@8.3.3: - resolution: {integrity: sha512-MxXdReSRhGO7VlFe1bRG/oI7/mdLV9B9JJT0N8vZOhF7gFRR5l3M8W9G8JxmKV+JC5mGqJ0QvqfSOLsCPa4nUw==} - engines: {node: '>=0.4.0'} - - acorn@8.12.1: - resolution: {integrity: sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg==} - engines: {node: '>=0.4.0'} - hasBin: true - - agent-base@6.0.2: - resolution: {integrity: sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==} - engines: {node: '>= 6.0.0'} - - ansi-escapes@4.3.2: - resolution: {integrity: sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==} - engines: {node: '>=8'} - - ansi-regex@5.0.1: - resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} - engines: {node: '>=8'} - - ansi-regex@6.0.1: - resolution: {integrity: sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==} - engines: {node: '>=12'} - - ansi-styles@4.3.0: - resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} - engines: {node: '>=8'} - - ansi-styles@6.2.1: - resolution: {integrity: sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==} - engines: {node: '>=12'} - - aproba@2.0.0: - resolution: {integrity: sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==} - - are-we-there-yet@2.0.0: - resolution: {integrity: sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw==} - engines: {node: '>=10'} - deprecated: This package is no longer supported. - - argparse@1.0.10: - resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==} - - argparse@2.0.1: - resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} - - array-find-index@1.0.2: - resolution: {integrity: sha512-M1HQyIXcBGtVywBt8WVdim+lrNaK7VHp99Qt5pSNziXznKHViIBbXWtfRTpEFpF/c4FdfxNAsCCwPp5phBYJtw==} - engines: {node: '>=0.10.0'} - - arrgv@1.0.2: - resolution: {integrity: sha512-a4eg4yhp7mmruZDQFqVMlxNRFGi/i1r87pt8SDHy0/I8PqSXoUTlWZRdAZo0VXgvEARcujbtTk8kiZRi1uDGRw==} - engines: {node: '>=8.0.0'} - - arrify@3.0.0: - resolution: {integrity: sha512-tLkvA81vQG/XqE2mjDkGQHoOINtMHtysSnemrmoGe6PydDPMRbVugqyk4A6V/WDWEfm3l+0d8anA9r8cv/5Jaw==} - engines: {node: '>=12'} - - async-sema@3.1.1: - resolution: {integrity: sha512-tLRNUXati5MFePdAk8dw7Qt7DpxPB60ofAgn8WRhW6a2rcimZnYBP9oxHiv0OHy+Wz7kPMG+t4LGdt31+4EmGg==} - - asynckit@0.4.0: - resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} - - ava@6.1.3: - resolution: {integrity: sha512-tkKbpF1pIiC+q09wNU9OfyTDYZa8yuWvU2up3+lFJ3lr1RmnYh2GBpPwzYUEB0wvTPIUysGjcZLNZr7STDviRA==} - engines: {node: ^18.18 || ^20.8 || ^21 || ^22} - hasBin: true - peerDependencies: - '@ava/typescript': '*' - peerDependenciesMeta: - '@ava/typescript': - optional: true - - axios@1.6.2: - resolution: {integrity: sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A==} - - balanced-match@1.0.2: - resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} - - before-after-hook@3.0.2: - resolution: {integrity: sha512-Nik3Sc0ncrMK4UUdXQmAnRtzmNQTAAXmXIopizwZ1W1t8QmfJj+zL4OA2I7XPTPW5z5TDqv4hRo/JzouDJnX3A==} - - bindings@1.5.0: - resolution: {integrity: sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==} - - blueimp-md5@2.19.0: - resolution: {integrity: sha512-DRQrD6gJyy8FbiE4s+bDoXS9hiW3Vbx5uCdwvcCf3zLHL+Iv7LtGHLpr+GZV8rHG8tK766FGYBwRbu8pELTt+w==} - - brace-expansion@1.1.11: - resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} - - braces@3.0.3: - resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==} - engines: {node: '>=8'} - - callsites@4.2.0: - resolution: {integrity: sha512-kfzR4zzQtAE9PC7CzZsjl3aBNbXWuXiSeOCdLcPpBfGW8YuCqQHcRPFDbr/BPVmd3EEPVpuFzLyuT/cUhPr4OQ==} - engines: {node: '>=12.20'} - - camelize@1.0.1: - resolution: {integrity: sha512-dU+Tx2fsypxTgtLoE36npi3UqcjSSMNYfkqgmoEhtZrraP5VWq0K7FkWVTYa8eMPtnU/G2txVsfdCJTn9uzpuQ==} - - cbor@9.0.2: - resolution: {integrity: sha512-JPypkxsB10s9QOWwa6zwPzqE1Md3vqpPc+cai4sAecuCsRyAtAl/pMyhPlMbT/xtPnm2dznJZYRLui57qiRhaQ==} - engines: {node: '>=16'} - - chalk@5.3.0: - resolution: {integrity: sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==} - engines: {node: ^12.17.0 || ^14.13 || >=16.0.0} - - chardet@0.7.0: - resolution: {integrity: sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==} - - chownr@2.0.0: - resolution: {integrity: sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==} - engines: {node: '>=10'} - - chunkd@2.0.1: - resolution: {integrity: sha512-7d58XsFmOq0j6el67Ug9mHf9ELUXsQXYJBkyxhH/k+6Ke0qXRnv0kbemx+Twc6fRJ07C49lcbdgm9FL1Ei/6SQ==} - - ci-info@4.0.0: - resolution: {integrity: sha512-TdHqgGf9odd8SXNuxtUBVx8Nv+qZOejE6qyqiy5NtbYYQOeFa6zmHkxlPzmaLxWWHsU6nJmB7AETdVPi+2NBUg==} - engines: {node: '>=8'} - - ci-parallel-vars@1.0.1: - resolution: {integrity: sha512-uvzpYrpmidaoxvIQHM+rKSrigjOe9feHYbw4uOI2gdfe1C3xIlxO+kVXq83WQWNniTf8bAxVpy+cQeFQsMERKg==} - - cli-spinners@2.9.2: - resolution: {integrity: sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==} - engines: {node: '>=6'} - - cli-truncate@4.0.0: - resolution: {integrity: sha512-nPdaFdQ0h/GEigbPClz11D0v/ZJEwxmeVZGeMo3Z5StPtUTkA9o1lD6QwoirYiSDzbcwn2XcjwmCp68W1IS4TA==} - engines: {node: '>=18'} - - cli-width@4.1.0: - resolution: {integrity: sha512-ouuZd4/dm2Sw5Gmqy6bGyNNNe1qt9RpmxveLSO7KcgsTnU7RXfsw+/bukWGo1abgBiMAic068rclZsO4IWmmxQ==} - engines: {node: '>= 12'} - - clipanion@3.2.1: - resolution: {integrity: sha512-dYFdjLb7y1ajfxQopN05mylEpK9ZX0sO1/RfMXdfmwjlIsPkbh4p7A682x++zFPLDCo1x3p82dtljHf5cW2LKA==} - peerDependencies: - typanion: '*' - - cliui@8.0.1: - resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==} - engines: {node: '>=12'} - - code-excerpt@4.0.0: - resolution: {integrity: sha512-xxodCmBen3iy2i0WtAK8FlFNrRzjUqjRsMfho58xT/wvZU1YTM3fCnRjcy1gJPMepaRlgm/0e6w8SpWHpn3/cA==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - color-convert@2.0.1: - resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} - engines: {node: '>=7.0.0'} - - color-name@1.1.4: - resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} - - color-support@1.1.3: - resolution: {integrity: sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==} - hasBin: true - - colorette@2.0.20: - resolution: {integrity: sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==} - - combined-stream@1.0.8: - resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} - engines: {node: '>= 0.8'} - - common-path-prefix@3.0.0: - resolution: {integrity: sha512-QE33hToZseCH3jS0qN96O/bSh3kaw/h+Tq7ngyY9eWDUnTlTNUyqfqvCXioLe5Na5jFsL78ra/wuBU4iuEgd4w==} - - concat-map@0.0.1: - resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} - - concordance@5.0.4: - resolution: {integrity: sha512-OAcsnTEYu1ARJqWVGwf4zh4JDfHZEaSNlNccFmt8YjB2l/n19/PF2viLINHc57vO4FKIAFl2FWASIGZZWZ2Kxw==} - engines: {node: '>=10.18.0 <11 || >=12.14.0 <13 || >=14'} - - console-control-strings@1.1.0: - resolution: {integrity: sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==} - - convert-to-spaces@2.0.1: - resolution: {integrity: sha512-rcQ1bsQO9799wq24uE5AM2tAILy4gXGIK/njFWcVQkGNZ96edlpY+A7bjwvzjYvLDyzmG1MmMLZhpcsb+klNMQ==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - css-color-keywords@1.0.0: - resolution: {integrity: sha512-FyyrDHZKEjXDpNJYvVsV960FiqQyXc/LlYmsxl2BcdMb2WPx0OGRVgTg55rPSyLSNMqP52R9r8geSp7apN3Ofg==} - engines: {node: '>=4'} - - css-to-react-native@3.2.0: - resolution: {integrity: sha512-e8RKaLXMOFii+02mOlqwjbD00KSEKqblnpO9e++1aXS1fPQOpS1YoqdVHBqPjHNoxeF2mimzVqawm2KCbEdtHQ==} - - csstype@3.1.3: - resolution: {integrity: sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==} - - currently-unhandled@0.4.1: - resolution: {integrity: sha512-/fITjgjGU50vjQ4FH6eUoYu+iUoUKIXws2hL15JJpIR+BbTxaXQsMuuyjtNh2WqsSBS5nsaZHFsFecyw5CCAng==} - engines: {node: '>=0.10.0'} - - date-time@3.1.0: - resolution: {integrity: sha512-uqCUKXE5q1PNBXjPqvwhwJf9SwMoAHBgWJ6DcrnS5o+W2JOiIILl0JEdVD8SGujrNS02GGxgwAg2PN2zONgtjg==} - engines: {node: '>=6'} - - debug@4.3.5: - resolution: {integrity: sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg==} - engines: {node: '>=6.0'} - peerDependencies: - supports-color: '*' - peerDependenciesMeta: - supports-color: - optional: true - - delayed-stream@1.0.0: - resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} - engines: {node: '>=0.4.0'} - - delegates@1.0.0: - resolution: {integrity: sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==} - - detect-libc@2.0.3: - resolution: {integrity: sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw==} - engines: {node: '>=8'} - - emittery@1.0.3: - resolution: {integrity: sha512-tJdCJitoy2lrC2ldJcqN4vkqJ00lT+tOWNT1hBJjO/3FDMJa5TTIiYGCKGkn/WfCyOzUMObeohbVTj00fhiLiA==} - engines: {node: '>=14.16'} - - emnapi@1.2.0: - resolution: {integrity: sha512-rcq+dJCcfr08I0XM/57LPRqaUokGfni/+SvhO7NaJthTTjRdohhIy0FQwyC5rR1enAsjkldQg83th8J5hURv0Q==} - peerDependencies: - node-addon-api: '>= 6.1.0' - peerDependenciesMeta: - node-addon-api: - optional: true - - emoji-regex@10.3.0: - resolution: {integrity: sha512-QpLs9D9v9kArv4lfDEgg1X/gN5XLnf/A6l9cs8SPZLRZR3ZkY9+kwIQTxm+fsSej5UMYGE8fdoaZVIBlqG0XTw==} - - emoji-regex@8.0.0: - resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} - - escalade@3.1.2: - resolution: {integrity: sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==} - engines: {node: '>=6'} - - escape-string-regexp@2.0.0: - resolution: {integrity: sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==} - engines: {node: '>=8'} - - escape-string-regexp@5.0.0: - resolution: {integrity: sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==} - engines: {node: '>=12'} - - esprima@4.0.1: - resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==} - engines: {node: '>=4'} - hasBin: true - - estree-walker@2.0.2: - resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==} - - esutils@2.0.3: - resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} - engines: {node: '>=0.10.0'} - - external-editor@3.1.0: - resolution: {integrity: sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==} - engines: {node: '>=4'} - - fast-diff@1.3.0: - resolution: {integrity: sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==} - - fast-glob@3.3.2: - resolution: {integrity: sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==} - engines: {node: '>=8.6.0'} - - fastq@1.17.1: - resolution: {integrity: sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==} - - figures@6.1.0: - resolution: {integrity: sha512-d+l3qxjSesT4V7v2fh+QnmFnUWv9lSpjarhShNTgBOfA0ttejbQUAlHLitbjkoRiDulW0OPoQPYIGhIC8ohejg==} - engines: {node: '>=18'} - - file-uri-to-path@1.0.0: - resolution: {integrity: sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==} - - fill-range@7.1.1: - resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==} - engines: {node: '>=8'} - - find-up-simple@1.0.0: - resolution: {integrity: sha512-q7Us7kcjj2VMePAa02hDAF6d+MzsdsAWEwYyOpwUtlerRBkOEPBCRZrAV4XfcSN8fHAgaD0hP7miwoay6DCprw==} - engines: {node: '>=18'} - - follow-redirects@1.15.6: - resolution: {integrity: sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==} - engines: {node: '>=4.0'} - peerDependencies: - debug: '*' - peerDependenciesMeta: - debug: - optional: true - - form-data@4.0.0: - resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==} - engines: {node: '>= 6'} - - fs-minipass@2.1.0: - resolution: {integrity: sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==} - engines: {node: '>= 8'} - - fs.realpath@1.0.0: - resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} - - gauge@3.0.2: - resolution: {integrity: sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q==} - engines: {node: '>=10'} - deprecated: This package is no longer supported. - - get-caller-file@2.0.5: - resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} - engines: {node: 6.* || 8.* || >= 10.*} - - get-east-asian-width@1.2.0: - resolution: {integrity: sha512-2nk+7SIVb14QrgXFHcm84tD4bKQz0RxPuMT8Ag5KPOq7J5fEmAg0UbXdTOSHqNuHSU28k55qnceesxXRZGzKWA==} - engines: {node: '>=18'} - - glob-parent@5.1.2: - resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} - engines: {node: '>= 6'} - - glob@7.2.3: - resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} - deprecated: Glob versions prior to v9 are no longer supported - - globby@14.0.2: - resolution: {integrity: sha512-s3Fq41ZVh7vbbe2PN3nrW7yC7U7MFVc5c98/iTl9c2GawNMKx/J648KQRW6WKkuU8GIbbh2IXfIRQjOZnXcTnw==} - engines: {node: '>=18'} - - graceful-fs@4.2.11: - resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} - - has-unicode@2.0.1: - resolution: {integrity: sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==} - - https-proxy-agent@5.0.1: - resolution: {integrity: sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==} - engines: {node: '>= 6'} - - iconv-lite@0.4.24: - resolution: {integrity: sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==} - engines: {node: '>=0.10.0'} - - ignore-by-default@2.1.0: - resolution: {integrity: sha512-yiWd4GVmJp0Q6ghmM2B/V3oZGRmjrKLXvHR3TE1nfoXsmoggllfZUQe74EN0fJdPFZu2NIvNdrMMLm3OsV7Ohw==} - engines: {node: '>=10 <11 || >=12 <13 || >=14'} - - ignore@5.3.1: - resolution: {integrity: sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==} - engines: {node: '>= 4'} - - imurmurhash@0.1.4: - resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} - engines: {node: '>=0.8.19'} - - indent-string@5.0.0: - resolution: {integrity: sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==} - engines: {node: '>=12'} - - inflight@1.0.6: - resolution: {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. - - inherits@2.0.4: - resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} - - inquirer@10.0.1: - resolution: {integrity: sha512-XgthhRIn0Ci9JdGJpUo2EtpPfaczbooZbGTN+FTzSCyUb7YHJcPPnuSXfeG5903bJMy3OyEoVTQMnvO4Ly5tFg==} - engines: {node: '>=18'} - - ipaddr.js@2.2.0: - resolution: {integrity: sha512-Ag3wB2o37wslZS19hZqorUnrnzSkpOVy+IiiDEiTqNubEYpYuHWIf6K4psgN2ZWKExS4xhVCrRVfb/wfW8fWJA==} - engines: {node: '>= 10'} - - irregular-plurals@3.5.0: - resolution: {integrity: sha512-1ANGLZ+Nkv1ptFb2pa8oG8Lem4krflKuX/gINiHJHjJUKaJHk/SXk5x6K3J+39/p0h1RQ2saROclJJ+QLvETCQ==} - engines: {node: '>=8'} - - is-extglob@2.1.1: - resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} - engines: {node: '>=0.10.0'} - - is-fullwidth-code-point@3.0.0: - resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} - engines: {node: '>=8'} - - is-fullwidth-code-point@4.0.0: - resolution: {integrity: sha512-O4L094N2/dZ7xqVdrXhh9r1KODPJpFms8B5sGdJLPy664AgvXsreZUyCQQNItZRDlYug4xStLjNp/sz3HvBowQ==} - engines: {node: '>=12'} - - is-glob@4.0.3: - resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} - engines: {node: '>=0.10.0'} - - is-number@7.0.0: - resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} - engines: {node: '>=0.12.0'} - - is-plain-object@5.0.0: - resolution: {integrity: sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==} - engines: {node: '>=0.10.0'} - - is-promise@4.0.0: - resolution: {integrity: sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==} - - is-unicode-supported@2.0.0: - resolution: {integrity: sha512-FRdAyx5lusK1iHG0TWpVtk9+1i+GjrzRffhDg4ovQ7mcidMQ6mj+MhKPmvh7Xwyv5gIS06ns49CA7Sqg7lC22Q==} - engines: {node: '>=18'} - - js-string-escape@1.0.1: - resolution: {integrity: sha512-Smw4xcfIQ5LVjAOuJCvN/zIodzA/BBSsluuoSykP+lUvScIi4U6RJLfwHet5cxFnCswUjISV8oAXaqaJDY3chg==} - engines: {node: '>= 0.8'} - - js-tokens@4.0.0: - resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} - - js-yaml@3.14.1: - resolution: {integrity: sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==} - hasBin: true - - js-yaml@4.1.0: - resolution: {integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==} - hasBin: true - - load-json-file@7.0.1: - resolution: {integrity: sha512-Gnxj3ev3mB5TkVBGad0JM6dmLiQL+o0t23JPBZ9sd+yvSLk05mFoqKBw5N8gbbkU4TNXyqCgIrl/VM17OgUIgQ==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - lodash-es@4.17.21: - resolution: {integrity: sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==} - - lodash@4.17.21: - resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} - - loose-envify@1.4.0: - resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==} - hasBin: true - - make-dir@3.1.0: - resolution: {integrity: sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==} - engines: {node: '>=8'} - - matcher@5.0.0: - resolution: {integrity: sha512-s2EMBOWtXFc8dgqvoAzKJXxNHibcdJMV0gwqKUaw9E2JBJuGUK7DrNKrA6g/i+v72TT16+6sVm5mS3thaMLQUw==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - md5-hex@3.0.1: - resolution: {integrity: sha512-BUiRtTtV39LIJwinWBjqVsU9xhdnz7/i889V859IBFpuqGAj6LuOvHv5XLbgZ2R7ptJoJaEcxkv88/h25T7Ciw==} - engines: {node: '>=8'} - - memoize@10.0.0: - resolution: {integrity: sha512-H6cBLgsi6vMWOcCpvVCdFFnl3kerEXbrYh9q+lY6VXvQSmM6CkmV08VOwT+WE2tzIEqRPFfAq3fm4v/UIW6mSA==} - engines: {node: '>=18'} - - merge2@1.4.1: - resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} - engines: {node: '>= 8'} - - micromatch@4.0.7: - resolution: {integrity: sha512-LPP/3KorzCwBxfeUuZmaR6bG2kdeHSbe0P2tY3FLRU4vYrjYz5hI4QZwV0njUx3jeuKe67YukQ1LSPZBKDqO/Q==} - engines: {node: '>=8.6'} - - mime-db@1.52.0: - resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} - engines: {node: '>= 0.6'} - - mime-types@2.1.35: - resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} - engines: {node: '>= 0.6'} - - mimic-function@5.0.1: - resolution: {integrity: sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==} - engines: {node: '>=18'} - - minimatch@3.1.2: - resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} - - minipass@3.3.6: - resolution: {integrity: sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==} - engines: {node: '>=8'} - - minipass@5.0.0: - resolution: {integrity: sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==} - engines: {node: '>=8'} - - minizlib@2.1.2: - resolution: {integrity: sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==} - engines: {node: '>= 8'} - - mkdirp@1.0.4: - resolution: {integrity: sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==} - engines: {node: '>=10'} - hasBin: true - - ms@2.1.2: - resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} - - ms@2.1.3: - resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} - - mute-stream@1.0.0: - resolution: {integrity: sha512-avsJQhyd+680gKXyG/sQc0nXaC6rBkPOfyHYcFb9+hdkqQkR9bdnkJ0AMZhke0oesPqIO+mFFJ+IdBc7mst4IA==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - - nanoid@3.3.7: - resolution: {integrity: sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==} - engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} - hasBin: true - - node-fetch@2.7.0: - resolution: {integrity: sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==} - engines: {node: 4.x || >=6.0.0} - peerDependencies: - encoding: ^0.1.0 - peerDependenciesMeta: - encoding: - optional: true - - node-gyp-build@4.8.1: - resolution: {integrity: sha512-OSs33Z9yWr148JZcbZd5WiAXhh/n9z8TxQcdMhIOlpN9AhWpLfvVFO73+m77bBABQMaY9XSvIa+qk0jlI7Gcaw==} - hasBin: true - - nofilter@3.1.0: - resolution: {integrity: sha512-l2NNj07e9afPnhAhvgVrCD/oy2Ai1yfLpuo3EpiO1jFTsB4sFz6oIfAfSZyQzVpkZQ9xS8ZS5g1jCBgq4Hwo0g==} - engines: {node: '>=12.19'} - - nopt@5.0.0: - resolution: {integrity: sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==} - engines: {node: '>=6'} - hasBin: true - - npmlog@5.0.1: - resolution: {integrity: sha512-AqZtDUWOMKs1G/8lwylVjrdYgqA4d9nu8hc+0gzRxlDb1I10+FHBGMXs6aiQHFdCUUlqH99MUMuLfzWDNDtfxw==} - deprecated: This package is no longer supported. - - object-assign@4.1.1: - resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} - engines: {node: '>=0.10.0'} - - once@1.4.0: - resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} - - os-tmpdir@1.0.2: - resolution: {integrity: sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==} - engines: {node: '>=0.10.0'} - - p-map@7.0.2: - resolution: {integrity: sha512-z4cYYMMdKHzw4O5UkWJImbZynVIo0lSGTXc7bzB1e/rrDqkgGUNysK/o4bTr+0+xKvvLoTyGqYC4Fgljy9qe1Q==} - engines: {node: '>=18'} - - package-config@5.0.0: - resolution: {integrity: sha512-GYTTew2slBcYdvRHqjhwaaydVMvn/qrGC323+nKclYioNSLTDUM/lGgtGTgyHVtYcozb+XkE8CNhwcraOmZ9Mg==} - engines: {node: '>=18'} - - parse-ms@4.0.0: - resolution: {integrity: sha512-TXfryirbmq34y8QBwgqCVLi+8oA3oWx2eAnSn62ITyEhEYaWRlVZ2DvMM9eZbMs/RfxPu/PK/aBLyGj4IrqMHw==} - engines: {node: '>=18'} - - path-is-absolute@1.0.1: - resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==} - engines: {node: '>=0.10.0'} - - path-type@5.0.0: - resolution: {integrity: sha512-5HviZNaZcfqP95rwpv+1HDgUamezbqdSYTyzjTvwtJSnIH+3vnbmWsItli8OFEndS984VT55M3jduxZbX351gg==} - engines: {node: '>=12'} - - picocolors@1.0.1: - resolution: {integrity: sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==} - - picomatch@2.3.1: - resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} - engines: {node: '>=8.6'} - - picomatch@3.0.1: - resolution: {integrity: sha512-I3EurrIQMlRc9IaAZnqRR044Phh2DXY+55o7uJ0V+hYZAcQYSuFWsc9q5PvyDHUSCe1Qxn/iBz+78s86zWnGag==} - engines: {node: '>=10'} - - plur@5.1.0: - resolution: {integrity: sha512-VP/72JeXqak2KiOzjgKtQen5y3IZHn+9GOuLDafPv0eXa47xq0At93XahYBs26MsifCQ4enGKwbjBTKgb9QJXg==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - postcss-value-parser@4.2.0: - resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==} - - postcss@8.4.33: - resolution: {integrity: sha512-Kkpbhhdjw2qQs2O2DGX+8m5OVqEcbB9HRBvuYM9pgrjEFUg30A9LmXNlTAUj4S9kgtGyrMbTzVjH7E+s5Re2yg==} - engines: {node: ^10 || ^12 || >=14} - - pretty-ms@9.0.0: - resolution: {integrity: sha512-E9e9HJ9R9NasGOgPaPE8VMeiPKAyWR5jcFpNnwIejslIhWqdqOrb2wShBsncMPUb+BcCd2OPYfh7p2W6oemTng==} - engines: {node: '>=18'} - - proxy-from-env@1.1.0: - resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==} - - queue-microtask@1.2.3: - resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} - - react-dom@18.3.1: - resolution: {integrity: sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==} - peerDependencies: - react: ^18.3.1 - - react@18.3.1: - resolution: {integrity: sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==} - engines: {node: '>=0.10.0'} - - readable-stream@3.6.2: - resolution: {integrity: sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==} - engines: {node: '>= 6'} - - require-directory@2.1.1: - resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} - engines: {node: '>=0.10.0'} - - resolve-cwd@3.0.0: - resolution: {integrity: sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==} - engines: {node: '>=8'} - - resolve-from@5.0.0: - resolution: {integrity: sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==} - engines: {node: '>=8'} - - reusify@1.0.4: - resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==} - engines: {iojs: '>=1.0.0', node: '>=0.10.0'} - - rimraf@3.0.2: - resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==} - deprecated: Rimraf versions prior to v4 are no longer supported - hasBin: true - - run-async@3.0.0: - resolution: {integrity: sha512-540WwVDOMxA6dN6We19EcT9sc3hkXPw5mzRNGM3FkdN/vtE9NFvj5lFAPNwUDmJjXidm3v7TC1cTE7t17Ulm1Q==} - engines: {node: '>=0.12.0'} - - run-parallel@1.2.0: - resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} - - rxjs@7.8.1: - resolution: {integrity: sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==} - - safe-buffer@5.2.1: - resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} - - safer-buffer@2.1.2: - resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} - - scheduler@0.23.2: - resolution: {integrity: sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ==} - - semver@6.3.1: - resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} - hasBin: true - - semver@7.6.2: - resolution: {integrity: sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==} - engines: {node: '>=10'} - hasBin: true - - serialize-error@7.0.1: - resolution: {integrity: sha512-8I8TjW5KMOKsZQTvoxjuSIa7foAwPWGOts+6o7sgjz41/qMD9VQHEDxi6PBvK2l0MXUmqZyNpUK+T2tQaaElvw==} - engines: {node: '>=10'} - - set-blocking@2.0.0: - resolution: {integrity: sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==} - - shallowequal@1.1.0: - resolution: {integrity: sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ==} - - signal-exit@3.0.7: - resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} - - signal-exit@4.1.0: - resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} - engines: {node: '>=14'} - - slash@5.1.0: - resolution: {integrity: sha512-ZA6oR3T/pEyuqwMgAKT0/hAv8oAXckzbkmR0UkUosQ+Mc4RxGoJkRmwHgHufaenlyAgE1Mxgpdcrf75y6XcnDg==} - engines: {node: '>=14.16'} - - slice-ansi@5.0.0: - resolution: {integrity: sha512-FC+lgizVPfie0kkhqUScwRu1O/lF6NOgJmlCgK+/LYxDCTk8sGelYaHDhFcDN+Sn3Cv+3VSa4Byeo+IMCzpMgQ==} - engines: {node: '>=12'} - - source-map-js@1.2.0: - resolution: {integrity: sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==} - engines: {node: '>=0.10.0'} - - sprintf-js@1.0.3: - resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==} - - stack-utils@2.0.6: - resolution: {integrity: sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==} - engines: {node: '>=10'} - - string-width@4.2.3: - resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} - engines: {node: '>=8'} - - string-width@7.2.0: - resolution: {integrity: sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==} - engines: {node: '>=18'} - - string_decoder@1.3.0: - resolution: {integrity: sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==} - - strip-ansi@6.0.1: - resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} - engines: {node: '>=8'} - - strip-ansi@7.1.0: - resolution: {integrity: sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==} - engines: {node: '>=12'} - - styled-components@6.1.1: - resolution: {integrity: sha512-cpZZP5RrKRIClBW5Eby4JM1wElLVP4NQrJbJ0h10TidTyJf4SIIwa3zLXOoPb4gJi8MsJ8mjq5mu2IrEhZIAcQ==} - engines: {node: '>= 16'} - peerDependencies: - react: '>= 16.8.0' - react-dom: '>= 16.8.0' - - stylis@4.3.2: - resolution: {integrity: sha512-bhtUjWd/z6ltJiQwg0dUfxEJ+W+jdqQd8TbWLWyeIJHlnsqmGLRFFd8e5mA0AZi/zx90smXRlN66YMTcaSFifg==} - - supertap@3.0.1: - resolution: {integrity: sha512-u1ZpIBCawJnO+0QePsEiOknOfCRq0yERxiAchT0i4li0WHNUJbf0evXXSXOcCAR4M8iMDoajXYmstm/qO81Isw==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - tar@6.2.1: - resolution: {integrity: sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==} - engines: {node: '>=10'} - - temp-dir@3.0.0: - resolution: {integrity: sha512-nHc6S/bwIilKHNRgK/3jlhDoIHcp45YgyiwcAk46Tr0LfEqGBVpmiAyuiuxeVE44m3mXnEeVhaipLOEWmH+Njw==} - engines: {node: '>=14.16'} - - time-zone@1.0.0: - resolution: {integrity: sha512-TIsDdtKo6+XrPtiTm1ssmMngN1sAhyKnTO2kunQWqNPWIVvCm15Wmw4SWInwTVgJ5u/Tr04+8Ei9TNcw4x4ONA==} - engines: {node: '>=4'} - - tmp@0.0.33: - resolution: {integrity: sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==} - engines: {node: '>=0.6.0'} - - to-regex-range@5.0.1: - resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} - engines: {node: '>=8.0'} - - toml@3.0.0: - resolution: {integrity: sha512-y/mWCZinnvxjTKYhJ+pYxwD0mRLVvOtdS2Awbgxln6iEnt4rk0yBxeSBHkGJcPucRiG0e55mwWp+g/05rsrd6w==} - - tr46@0.0.3: - resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==} - - tslib@2.6.3: - resolution: {integrity: sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ==} - - typanion@3.14.0: - resolution: {integrity: sha512-ZW/lVMRabETuYCd9O9ZvMhAh8GslSqaUjxmK/JLPCh6l73CvLBiuXswj/+7LdnWOgYsQ130FqLzFz5aGT4I3Ug==} - - type-fest@0.13.1: - resolution: {integrity: sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==} - engines: {node: '>=10'} - - type-fest@0.21.3: - resolution: {integrity: sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==} - engines: {node: '>=10'} - - typescript@5.5.4: - resolution: {integrity: sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q==} - engines: {node: '>=14.17'} - hasBin: true - - undici-types@6.19.8: - resolution: {integrity: sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==} - - unicorn-magic@0.1.0: - resolution: {integrity: sha512-lRfVq8fE8gz6QMBuDM6a+LO3IAzTi05H6gCVaUpir2E1Rwpo4ZUog45KpNXKC/Mn3Yb9UDuHumeFTo9iV/D9FQ==} - engines: {node: '>=18'} - - universal-user-agent@7.0.2: - resolution: {integrity: sha512-0JCqzSKnStlRRQfCdowvqy3cy0Dvtlb8xecj/H8JFZuCze4rwjPZQOgvFvn0Ws/usCHQFGpyr+pB9adaGwXn4Q==} - - util-deprecate@1.0.2: - resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} - - wasm-sjlj@1.0.5: - resolution: {integrity: sha512-Z/MHJeOkAvJJVWnGX3/YZGYldGaawZbYHX4ldYG9kLhcdB8H31F5x66M7Zc4BP/7pg0aLsusQj1629m2B3Rilg==} - - webidl-conversions@3.0.1: - resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==} - - well-known-symbols@2.0.0: - resolution: {integrity: sha512-ZMjC3ho+KXo0BfJb7JgtQ5IBuvnShdlACNkKkdsqBmYw3bPAaJfPeYUo6tLUaT5tG/Gkh7xkpBhKRQ9e7pyg9Q==} - engines: {node: '>=6'} - - whatwg-url@5.0.0: - resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==} - - wide-align@1.1.5: - resolution: {integrity: sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==} - - wrap-ansi@6.2.0: - resolution: {integrity: sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==} - engines: {node: '>=8'} - - wrap-ansi@7.0.0: - resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==} - engines: {node: '>=10'} - - wrappy@1.0.2: - resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} - - write-file-atomic@5.0.1: - resolution: {integrity: sha512-+QU2zd6OTD8XWIJCbffaiQeH9U73qIqafo1x6V1snCWYGJf6cVE0cDR4D8xRzcEnfI21IFrUPzPGtcPf8AC+Rw==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - - y18n@5.0.8: - resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==} - engines: {node: '>=10'} - - yallist@4.0.0: - resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==} - - yargs-parser@21.1.1: - resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} - engines: {node: '>=12'} - - yargs@17.7.2: - resolution: {integrity: sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==} - engines: {node: '>=12'} - - yoctocolors-cjs@2.1.2: - resolution: {integrity: sha512-cYVsTjKl8b+FrnidjibDWskAv7UKOfcwaVZdp/it9n1s9fU3IkgDbhdIRKCW4JDsAlECJY0ytoVPT3sK6kideA==} - engines: {node: '>=18'} - -snapshots: - - '@emnapi/core@1.2.0': - dependencies: - '@emnapi/wasi-threads': 1.0.1 - tslib: 2.6.3 - - '@emnapi/runtime@1.2.0': - dependencies: - tslib: 2.6.3 - - '@emnapi/wasi-threads@1.0.1': - dependencies: - tslib: 2.6.3 - - '@emotion/is-prop-valid@1.2.2': - dependencies: - '@emotion/memoize': 0.8.1 - - '@emotion/memoize@0.8.1': {} - - '@emotion/unitless@0.8.1': {} - - '@inquirer/checkbox@2.3.10': - dependencies: - '@inquirer/core': 9.0.2 - '@inquirer/figures': 1.0.3 - '@inquirer/type': 1.4.0 - ansi-escapes: 4.3.2 - yoctocolors-cjs: 2.1.2 - - '@inquirer/confirm@3.1.14': - dependencies: - '@inquirer/core': 9.0.2 - '@inquirer/type': 1.4.0 - - '@inquirer/core@9.0.2': - dependencies: - '@inquirer/figures': 1.0.3 - '@inquirer/type': 1.4.0 - '@types/mute-stream': 0.0.4 - '@types/node': 20.16.5 - '@types/wrap-ansi': 3.0.0 - ansi-escapes: 4.3.2 - cli-spinners: 2.9.2 - cli-width: 4.1.0 - mute-stream: 1.0.0 - signal-exit: 4.1.0 - strip-ansi: 6.0.1 - wrap-ansi: 6.2.0 - yoctocolors-cjs: 2.1.2 - - '@inquirer/editor@2.1.14': - dependencies: - '@inquirer/core': 9.0.2 - '@inquirer/type': 1.4.0 - external-editor: 3.1.0 - - '@inquirer/expand@2.1.14': - dependencies: - '@inquirer/core': 9.0.2 - '@inquirer/type': 1.4.0 - yoctocolors-cjs: 2.1.2 - - '@inquirer/figures@1.0.3': {} - - '@inquirer/input@2.2.1': - dependencies: - '@inquirer/core': 9.0.2 - '@inquirer/type': 1.4.0 - - '@inquirer/number@1.0.2': - dependencies: - '@inquirer/core': 9.0.2 - '@inquirer/type': 1.4.0 - - '@inquirer/password@2.1.14': - dependencies: - '@inquirer/core': 9.0.2 - '@inquirer/type': 1.4.0 - ansi-escapes: 4.3.2 - - '@inquirer/prompts@5.1.2': - dependencies: - '@inquirer/checkbox': 2.3.10 - '@inquirer/confirm': 3.1.14 - '@inquirer/editor': 2.1.14 - '@inquirer/expand': 2.1.14 - '@inquirer/input': 2.2.1 - '@inquirer/number': 1.0.2 - '@inquirer/password': 2.1.14 - '@inquirer/rawlist': 2.1.14 - '@inquirer/select': 2.3.10 - - '@inquirer/rawlist@2.1.14': - dependencies: - '@inquirer/core': 9.0.2 - '@inquirer/type': 1.4.0 - yoctocolors-cjs: 2.1.2 - - '@inquirer/select@2.3.10': - dependencies: - '@inquirer/core': 9.0.2 - '@inquirer/figures': 1.0.3 - '@inquirer/type': 1.4.0 - ansi-escapes: 4.3.2 - yoctocolors-cjs: 2.1.2 - - '@inquirer/type@1.4.0': - dependencies: - mute-stream: 1.0.0 - - '@mapbox/node-pre-gyp@1.0.11': - dependencies: - detect-libc: 2.0.3 - https-proxy-agent: 5.0.1 - make-dir: 3.1.0 - node-fetch: 2.7.0 - nopt: 5.0.0 - npmlog: 5.0.1 - rimraf: 3.0.2 - semver: 7.6.2 - tar: 6.2.1 - transitivePeerDependencies: - - encoding - - supports-color - - '@napi-rs/cli@3.0.0-alpha.62(@emnapi/runtime@1.2.0)(emnapi@1.2.0)': - dependencies: - '@napi-rs/cross-toolchain': 0.0.16 - '@napi-rs/wasm-tools': 0.0.2 - '@octokit/rest': 21.0.0 - clipanion: 3.2.1(typanion@3.14.0) - colorette: 2.0.20 - debug: 4.3.5 - inquirer: 10.0.1 - js-yaml: 4.1.0 - lodash-es: 4.17.21 - semver: 7.6.2 - toml: 3.0.0 - typanion: 3.14.0 - wasm-sjlj: 1.0.5 - optionalDependencies: - '@emnapi/runtime': 1.2.0 - emnapi: 1.2.0 - transitivePeerDependencies: - - '@napi-rs/cross-toolchain-arm64-target-aarch64' - - '@napi-rs/cross-toolchain-arm64-target-armv7' - - '@napi-rs/cross-toolchain-arm64-target-x86_64' - - '@napi-rs/cross-toolchain-x64-target-aarch64' - - '@napi-rs/cross-toolchain-x64-target-armv7' - - '@napi-rs/cross-toolchain-x64-target-x86_64' - - supports-color - - '@napi-rs/cross-toolchain@0.0.16': - dependencies: - '@napi-rs/lzma': 1.3.1 - '@napi-rs/tar': 0.1.1 - debug: 4.3.5 - transitivePeerDependencies: - - supports-color - - '@napi-rs/lzma-android-arm-eabi@1.3.1': - optional: true - - '@napi-rs/lzma-android-arm64@1.3.1': - optional: true - - '@napi-rs/lzma-darwin-arm64@1.3.1': - optional: true - - '@napi-rs/lzma-darwin-x64@1.3.1': - optional: true - - '@napi-rs/lzma-freebsd-x64@1.3.1': - optional: true - - '@napi-rs/lzma-linux-arm-gnueabihf@1.3.1': - optional: true - - '@napi-rs/lzma-linux-arm64-gnu@1.3.1': - optional: true - - '@napi-rs/lzma-linux-arm64-musl@1.3.1': - optional: true - - '@napi-rs/lzma-linux-x64-gnu@1.3.1': - optional: true - - '@napi-rs/lzma-linux-x64-musl@1.3.1': - optional: true - - '@napi-rs/lzma-wasm32-wasi@1.3.1': - dependencies: - '@napi-rs/wasm-runtime': 0.2.4 - optional: true - - '@napi-rs/lzma-win32-arm64-msvc@1.3.1': - optional: true - - '@napi-rs/lzma-win32-ia32-msvc@1.3.1': - optional: true - - '@napi-rs/lzma-win32-x64-msvc@1.3.1': - optional: true - - '@napi-rs/lzma@1.3.1': - optionalDependencies: - '@napi-rs/lzma-android-arm-eabi': 1.3.1 - '@napi-rs/lzma-android-arm64': 1.3.1 - '@napi-rs/lzma-darwin-arm64': 1.3.1 - '@napi-rs/lzma-darwin-x64': 1.3.1 - '@napi-rs/lzma-freebsd-x64': 1.3.1 - '@napi-rs/lzma-linux-arm-gnueabihf': 1.3.1 - '@napi-rs/lzma-linux-arm64-gnu': 1.3.1 - '@napi-rs/lzma-linux-arm64-musl': 1.3.1 - '@napi-rs/lzma-linux-x64-gnu': 1.3.1 - '@napi-rs/lzma-linux-x64-musl': 1.3.1 - '@napi-rs/lzma-wasm32-wasi': 1.3.1 - '@napi-rs/lzma-win32-arm64-msvc': 1.3.1 - '@napi-rs/lzma-win32-ia32-msvc': 1.3.1 - '@napi-rs/lzma-win32-x64-msvc': 1.3.1 - - '@napi-rs/tar-android-arm-eabi@0.1.1': - optional: true - - '@napi-rs/tar-android-arm64@0.1.1': - optional: true - - '@napi-rs/tar-darwin-arm64@0.1.1': - optional: true - - '@napi-rs/tar-darwin-x64@0.1.1': - optional: true - - '@napi-rs/tar-freebsd-x64@0.1.1': - optional: true - - '@napi-rs/tar-linux-arm-gnueabihf@0.1.1': - optional: true - - '@napi-rs/tar-linux-arm64-gnu@0.1.1': - optional: true - - '@napi-rs/tar-linux-arm64-musl@0.1.1': - optional: true - - '@napi-rs/tar-linux-x64-gnu@0.1.1': - optional: true - - '@napi-rs/tar-linux-x64-musl@0.1.1': - optional: true - - '@napi-rs/tar-wasm32-wasi@0.1.1': - dependencies: - '@napi-rs/wasm-runtime': 0.2.4 - optional: true - - '@napi-rs/tar-win32-arm64-msvc@0.1.1': - optional: true - - '@napi-rs/tar-win32-ia32-msvc@0.1.1': - optional: true - - '@napi-rs/tar-win32-x64-msvc@0.1.1': - optional: true - - '@napi-rs/tar@0.1.1': - optionalDependencies: - '@napi-rs/tar-android-arm-eabi': 0.1.1 - '@napi-rs/tar-android-arm64': 0.1.1 - '@napi-rs/tar-darwin-arm64': 0.1.1 - '@napi-rs/tar-darwin-x64': 0.1.1 - '@napi-rs/tar-freebsd-x64': 0.1.1 - '@napi-rs/tar-linux-arm-gnueabihf': 0.1.1 - '@napi-rs/tar-linux-arm64-gnu': 0.1.1 - '@napi-rs/tar-linux-arm64-musl': 0.1.1 - '@napi-rs/tar-linux-x64-gnu': 0.1.1 - '@napi-rs/tar-linux-x64-musl': 0.1.1 - '@napi-rs/tar-wasm32-wasi': 0.1.1 - '@napi-rs/tar-win32-arm64-msvc': 0.1.1 - '@napi-rs/tar-win32-ia32-msvc': 0.1.1 - '@napi-rs/tar-win32-x64-msvc': 0.1.1 - - '@napi-rs/wasm-runtime@0.2.4': - dependencies: - '@emnapi/core': 1.2.0 - '@emnapi/runtime': 1.2.0 - '@tybys/wasm-util': 0.9.0 - - '@napi-rs/wasm-tools-android-arm-eabi@0.0.2': - optional: true - - '@napi-rs/wasm-tools-android-arm64@0.0.2': - optional: true - - '@napi-rs/wasm-tools-darwin-arm64@0.0.2': - optional: true - - '@napi-rs/wasm-tools-darwin-x64@0.0.2': - optional: true - - '@napi-rs/wasm-tools-freebsd-x64@0.0.2': - optional: true - - '@napi-rs/wasm-tools-linux-arm64-gnu@0.0.2': - optional: true - - '@napi-rs/wasm-tools-linux-arm64-musl@0.0.2': - optional: true - - '@napi-rs/wasm-tools-linux-x64-gnu@0.0.2': - optional: true - - '@napi-rs/wasm-tools-linux-x64-musl@0.0.2': - optional: true - - '@napi-rs/wasm-tools-wasm32-wasi@0.0.2': - dependencies: - '@napi-rs/wasm-runtime': 0.2.4 - optional: true - - '@napi-rs/wasm-tools-win32-arm64-msvc@0.0.2': - optional: true - - '@napi-rs/wasm-tools-win32-ia32-msvc@0.0.2': - optional: true - - '@napi-rs/wasm-tools-win32-x64-msvc@0.0.2': - optional: true - - '@napi-rs/wasm-tools@0.0.2': - optionalDependencies: - '@napi-rs/wasm-tools-android-arm-eabi': 0.0.2 - '@napi-rs/wasm-tools-android-arm64': 0.0.2 - '@napi-rs/wasm-tools-darwin-arm64': 0.0.2 - '@napi-rs/wasm-tools-darwin-x64': 0.0.2 - '@napi-rs/wasm-tools-freebsd-x64': 0.0.2 - '@napi-rs/wasm-tools-linux-arm64-gnu': 0.0.2 - '@napi-rs/wasm-tools-linux-arm64-musl': 0.0.2 - '@napi-rs/wasm-tools-linux-x64-gnu': 0.0.2 - '@napi-rs/wasm-tools-linux-x64-musl': 0.0.2 - '@napi-rs/wasm-tools-wasm32-wasi': 0.0.2 - '@napi-rs/wasm-tools-win32-arm64-msvc': 0.0.2 - '@napi-rs/wasm-tools-win32-ia32-msvc': 0.0.2 - '@napi-rs/wasm-tools-win32-x64-msvc': 0.0.2 - - '@nodelib/fs.scandir@2.1.5': - dependencies: - '@nodelib/fs.stat': 2.0.5 - run-parallel: 1.2.0 - - '@nodelib/fs.stat@2.0.5': {} - - '@nodelib/fs.walk@1.2.8': - dependencies: - '@nodelib/fs.scandir': 2.1.5 - fastq: 1.17.1 - - '@octokit/auth-token@5.1.1': {} - - '@octokit/core@6.1.2': - dependencies: - '@octokit/auth-token': 5.1.1 - '@octokit/graphql': 8.1.1 - '@octokit/request': 9.1.1 - '@octokit/request-error': 6.1.2 - '@octokit/types': 13.5.0 - before-after-hook: 3.0.2 - universal-user-agent: 7.0.2 - - '@octokit/endpoint@10.1.1': - dependencies: - '@octokit/types': 13.5.0 - universal-user-agent: 7.0.2 - - '@octokit/graphql@8.1.1': - dependencies: - '@octokit/request': 9.1.1 - '@octokit/types': 13.5.0 - universal-user-agent: 7.0.2 - - '@octokit/openapi-types@22.2.0': {} - - '@octokit/plugin-paginate-rest@11.3.3(@octokit/core@6.1.2)': - dependencies: - '@octokit/core': 6.1.2 - '@octokit/types': 13.5.0 - - '@octokit/plugin-request-log@5.3.0(@octokit/core@6.1.2)': - dependencies: - '@octokit/core': 6.1.2 - - '@octokit/plugin-rest-endpoint-methods@13.2.4(@octokit/core@6.1.2)': - dependencies: - '@octokit/core': 6.1.2 - '@octokit/types': 13.5.0 - - '@octokit/request-error@6.1.2': - dependencies: - '@octokit/types': 13.5.0 - - '@octokit/request@9.1.1': - dependencies: - '@octokit/endpoint': 10.1.1 - '@octokit/request-error': 6.1.2 - '@octokit/types': 13.5.0 - universal-user-agent: 7.0.2 - - '@octokit/rest@21.0.0': - dependencies: - '@octokit/core': 6.1.2 - '@octokit/plugin-paginate-rest': 11.3.3(@octokit/core@6.1.2) - '@octokit/plugin-request-log': 5.3.0(@octokit/core@6.1.2) - '@octokit/plugin-rest-endpoint-methods': 13.2.4(@octokit/core@6.1.2) - - '@octokit/types@13.5.0': - dependencies: - '@octokit/openapi-types': 22.2.0 - - '@rollup/pluginutils@4.2.1': - dependencies: - estree-walker: 2.0.2 - picomatch: 2.3.1 - - '@sindresorhus/merge-streams@2.3.0': {} - - '@tybys/wasm-util@0.9.0': - dependencies: - tslib: 2.6.3 - - '@types/mute-stream@0.0.4': - dependencies: - '@types/node': 22.5.4 - - '@types/node@20.16.5': - dependencies: - undici-types: 6.19.8 - - '@types/node@22.5.4': - dependencies: - undici-types: 6.19.8 - - '@types/stylis@4.2.6': {} - - '@types/wrap-ansi@3.0.0': {} - - '@vercel/nft@0.26.5': - dependencies: - '@mapbox/node-pre-gyp': 1.0.11 - '@rollup/pluginutils': 4.2.1 - acorn: 8.12.1 - acorn-import-attributes: 1.9.5(acorn@8.12.1) - async-sema: 3.1.1 - bindings: 1.5.0 - estree-walker: 2.0.2 - glob: 7.2.3 - graceful-fs: 4.2.11 - micromatch: 4.0.7 - node-gyp-build: 4.8.1 - resolve-from: 5.0.0 - transitivePeerDependencies: - - encoding - - supports-color - - abbrev@1.1.1: {} - - acorn-import-attributes@1.9.5(acorn@8.12.1): - dependencies: - acorn: 8.12.1 - - acorn-walk@8.3.3: - dependencies: - acorn: 8.12.1 - - acorn@8.12.1: {} - - agent-base@6.0.2: - dependencies: - debug: 4.3.5 - transitivePeerDependencies: - - supports-color - - ansi-escapes@4.3.2: - dependencies: - type-fest: 0.21.3 - - ansi-regex@5.0.1: {} - - ansi-regex@6.0.1: {} - - ansi-styles@4.3.0: - dependencies: - color-convert: 2.0.1 - - ansi-styles@6.2.1: {} - - aproba@2.0.0: {} - - are-we-there-yet@2.0.0: - dependencies: - delegates: 1.0.0 - readable-stream: 3.6.2 - - argparse@1.0.10: - dependencies: - sprintf-js: 1.0.3 - - argparse@2.0.1: {} - - array-find-index@1.0.2: {} - - arrgv@1.0.2: {} - - arrify@3.0.0: {} - - async-sema@3.1.1: {} - - asynckit@0.4.0: {} - - ava@6.1.3: - dependencies: - '@vercel/nft': 0.26.5 - acorn: 8.12.1 - acorn-walk: 8.3.3 - ansi-styles: 6.2.1 - arrgv: 1.0.2 - arrify: 3.0.0 - callsites: 4.2.0 - cbor: 9.0.2 - chalk: 5.3.0 - chunkd: 2.0.1 - ci-info: 4.0.0 - ci-parallel-vars: 1.0.1 - cli-truncate: 4.0.0 - code-excerpt: 4.0.0 - common-path-prefix: 3.0.0 - concordance: 5.0.4 - currently-unhandled: 0.4.1 - debug: 4.3.5 - emittery: 1.0.3 - figures: 6.1.0 - globby: 14.0.2 - ignore-by-default: 2.1.0 - indent-string: 5.0.0 - is-plain-object: 5.0.0 - is-promise: 4.0.0 - matcher: 5.0.0 - memoize: 10.0.0 - ms: 2.1.3 - p-map: 7.0.2 - package-config: 5.0.0 - picomatch: 3.0.1 - plur: 5.1.0 - pretty-ms: 9.0.0 - resolve-cwd: 3.0.0 - stack-utils: 2.0.6 - strip-ansi: 7.1.0 - supertap: 3.0.1 - temp-dir: 3.0.0 - write-file-atomic: 5.0.1 - yargs: 17.7.2 - transitivePeerDependencies: - - encoding - - supports-color - - axios@1.6.2: - dependencies: - follow-redirects: 1.15.6 - form-data: 4.0.0 - proxy-from-env: 1.1.0 - transitivePeerDependencies: - - debug - - balanced-match@1.0.2: {} - - before-after-hook@3.0.2: {} - - bindings@1.5.0: - dependencies: - file-uri-to-path: 1.0.0 - - blueimp-md5@2.19.0: {} - - brace-expansion@1.1.11: - dependencies: - balanced-match: 1.0.2 - concat-map: 0.0.1 - - braces@3.0.3: - dependencies: - fill-range: 7.1.1 - - callsites@4.2.0: {} - - camelize@1.0.1: {} - - cbor@9.0.2: - dependencies: - nofilter: 3.1.0 - - chalk@5.3.0: {} - - chardet@0.7.0: {} - - chownr@2.0.0: {} - - chunkd@2.0.1: {} - - ci-info@4.0.0: {} - - ci-parallel-vars@1.0.1: {} - - cli-spinners@2.9.2: {} - - cli-truncate@4.0.0: - dependencies: - slice-ansi: 5.0.0 - string-width: 7.2.0 - - cli-width@4.1.0: {} - - clipanion@3.2.1(typanion@3.14.0): - dependencies: - typanion: 3.14.0 - - cliui@8.0.1: - dependencies: - string-width: 4.2.3 - strip-ansi: 6.0.1 - wrap-ansi: 7.0.0 - - code-excerpt@4.0.0: - dependencies: - convert-to-spaces: 2.0.1 - - color-convert@2.0.1: - dependencies: - color-name: 1.1.4 - - color-name@1.1.4: {} - - color-support@1.1.3: {} - - colorette@2.0.20: {} - - combined-stream@1.0.8: - dependencies: - delayed-stream: 1.0.0 - - common-path-prefix@3.0.0: {} - - concat-map@0.0.1: {} - - concordance@5.0.4: - dependencies: - date-time: 3.1.0 - esutils: 2.0.3 - fast-diff: 1.3.0 - js-string-escape: 1.0.1 - lodash: 4.17.21 - md5-hex: 3.0.1 - semver: 7.6.2 - well-known-symbols: 2.0.0 - - console-control-strings@1.1.0: {} - - convert-to-spaces@2.0.1: {} - - css-color-keywords@1.0.0: {} - - css-to-react-native@3.2.0: - dependencies: - camelize: 1.0.1 - css-color-keywords: 1.0.0 - postcss-value-parser: 4.2.0 - - csstype@3.1.3: {} - - currently-unhandled@0.4.1: - dependencies: - array-find-index: 1.0.2 - - date-time@3.1.0: - dependencies: - time-zone: 1.0.0 - - debug@4.3.5: - dependencies: - ms: 2.1.2 - - delayed-stream@1.0.0: {} - - delegates@1.0.0: {} - - detect-libc@2.0.3: {} - - emittery@1.0.3: {} - - emnapi@1.2.0: {} - - emoji-regex@10.3.0: {} - - emoji-regex@8.0.0: {} - - escalade@3.1.2: {} - - escape-string-regexp@2.0.0: {} - - escape-string-regexp@5.0.0: {} - - esprima@4.0.1: {} - - estree-walker@2.0.2: {} - - esutils@2.0.3: {} - - external-editor@3.1.0: - dependencies: - chardet: 0.7.0 - iconv-lite: 0.4.24 - tmp: 0.0.33 - - fast-diff@1.3.0: {} - - fast-glob@3.3.2: - dependencies: - '@nodelib/fs.stat': 2.0.5 - '@nodelib/fs.walk': 1.2.8 - glob-parent: 5.1.2 - merge2: 1.4.1 - micromatch: 4.0.7 - - fastq@1.17.1: - dependencies: - reusify: 1.0.4 - - figures@6.1.0: - dependencies: - is-unicode-supported: 2.0.0 - - file-uri-to-path@1.0.0: {} - - fill-range@7.1.1: - dependencies: - to-regex-range: 5.0.1 - - find-up-simple@1.0.0: {} - - follow-redirects@1.15.6: {} - - form-data@4.0.0: - dependencies: - asynckit: 0.4.0 - combined-stream: 1.0.8 - mime-types: 2.1.35 - - fs-minipass@2.1.0: - dependencies: - minipass: 3.3.6 - - fs.realpath@1.0.0: {} - - gauge@3.0.2: - dependencies: - aproba: 2.0.0 - color-support: 1.1.3 - console-control-strings: 1.1.0 - has-unicode: 2.0.1 - object-assign: 4.1.1 - signal-exit: 3.0.7 - string-width: 4.2.3 - strip-ansi: 6.0.1 - wide-align: 1.1.5 - - get-caller-file@2.0.5: {} - - get-east-asian-width@1.2.0: {} - - glob-parent@5.1.2: - dependencies: - is-glob: 4.0.3 - - glob@7.2.3: - dependencies: - fs.realpath: 1.0.0 - inflight: 1.0.6 - inherits: 2.0.4 - minimatch: 3.1.2 - once: 1.4.0 - path-is-absolute: 1.0.1 - - globby@14.0.2: - dependencies: - '@sindresorhus/merge-streams': 2.3.0 - fast-glob: 3.3.2 - ignore: 5.3.1 - path-type: 5.0.0 - slash: 5.1.0 - unicorn-magic: 0.1.0 - - graceful-fs@4.2.11: {} - - has-unicode@2.0.1: {} - - https-proxy-agent@5.0.1: - dependencies: - agent-base: 6.0.2 - debug: 4.3.5 - transitivePeerDependencies: - - supports-color - - iconv-lite@0.4.24: - dependencies: - safer-buffer: 2.1.2 - - ignore-by-default@2.1.0: {} - - ignore@5.3.1: {} - - imurmurhash@0.1.4: {} - - indent-string@5.0.0: {} - - inflight@1.0.6: - dependencies: - once: 1.4.0 - wrappy: 1.0.2 - - inherits@2.0.4: {} - - inquirer@10.0.1: - dependencies: - '@inquirer/prompts': 5.1.2 - '@inquirer/type': 1.4.0 - '@types/mute-stream': 0.0.4 - ansi-escapes: 4.3.2 - mute-stream: 1.0.0 - run-async: 3.0.0 - rxjs: 7.8.1 - - ipaddr.js@2.2.0: {} - - irregular-plurals@3.5.0: {} - - is-extglob@2.1.1: {} - - is-fullwidth-code-point@3.0.0: {} - - is-fullwidth-code-point@4.0.0: {} - - is-glob@4.0.3: - dependencies: - is-extglob: 2.1.1 - - is-number@7.0.0: {} - - is-plain-object@5.0.0: {} - - is-promise@4.0.0: {} - - is-unicode-supported@2.0.0: {} - - js-string-escape@1.0.1: {} - - js-tokens@4.0.0: {} - - js-yaml@3.14.1: - dependencies: - argparse: 1.0.10 - esprima: 4.0.1 - - js-yaml@4.1.0: - dependencies: - argparse: 2.0.1 - - load-json-file@7.0.1: {} - - lodash-es@4.17.21: {} - - lodash@4.17.21: {} - - loose-envify@1.4.0: - dependencies: - js-tokens: 4.0.0 - - make-dir@3.1.0: - dependencies: - semver: 6.3.1 - - matcher@5.0.0: - dependencies: - escape-string-regexp: 5.0.0 - - md5-hex@3.0.1: - dependencies: - blueimp-md5: 2.19.0 - - memoize@10.0.0: - dependencies: - mimic-function: 5.0.1 - - merge2@1.4.1: {} - - micromatch@4.0.7: - dependencies: - braces: 3.0.3 - picomatch: 2.3.1 - - mime-db@1.52.0: {} - - mime-types@2.1.35: - dependencies: - mime-db: 1.52.0 - - mimic-function@5.0.1: {} - - minimatch@3.1.2: - dependencies: - brace-expansion: 1.1.11 - - minipass@3.3.6: - dependencies: - yallist: 4.0.0 - - minipass@5.0.0: {} - - minizlib@2.1.2: - dependencies: - minipass: 3.3.6 - yallist: 4.0.0 - - mkdirp@1.0.4: {} - - ms@2.1.2: {} - - ms@2.1.3: {} - - mute-stream@1.0.0: {} - - nanoid@3.3.7: {} - - node-fetch@2.7.0: - dependencies: - whatwg-url: 5.0.0 - - node-gyp-build@4.8.1: {} - - nofilter@3.1.0: {} - - nopt@5.0.0: - dependencies: - abbrev: 1.1.1 - - npmlog@5.0.1: - dependencies: - are-we-there-yet: 2.0.0 - console-control-strings: 1.1.0 - gauge: 3.0.2 - set-blocking: 2.0.0 - - object-assign@4.1.1: {} - - once@1.4.0: - dependencies: - wrappy: 1.0.2 - - os-tmpdir@1.0.2: {} - - p-map@7.0.2: {} - - package-config@5.0.0: - dependencies: - find-up-simple: 1.0.0 - load-json-file: 7.0.1 - - parse-ms@4.0.0: {} - - path-is-absolute@1.0.1: {} - - path-type@5.0.0: {} - - picocolors@1.0.1: {} - - picomatch@2.3.1: {} - - picomatch@3.0.1: {} - - plur@5.1.0: - dependencies: - irregular-plurals: 3.5.0 - - postcss-value-parser@4.2.0: {} - - postcss@8.4.33: - dependencies: - nanoid: 3.3.7 - picocolors: 1.0.1 - source-map-js: 1.2.0 - - pretty-ms@9.0.0: - dependencies: - parse-ms: 4.0.0 - - proxy-from-env@1.1.0: {} - - queue-microtask@1.2.3: {} - - react-dom@18.3.1(react@18.3.1): - dependencies: - loose-envify: 1.4.0 - react: 18.3.1 - scheduler: 0.23.2 - - react@18.3.1: - dependencies: - loose-envify: 1.4.0 - - readable-stream@3.6.2: - dependencies: - inherits: 2.0.4 - string_decoder: 1.3.0 - util-deprecate: 1.0.2 - - require-directory@2.1.1: {} - - resolve-cwd@3.0.0: - dependencies: - resolve-from: 5.0.0 - - resolve-from@5.0.0: {} - - reusify@1.0.4: {} - - rimraf@3.0.2: - dependencies: - glob: 7.2.3 - - run-async@3.0.0: {} - - run-parallel@1.2.0: - dependencies: - queue-microtask: 1.2.3 - - rxjs@7.8.1: - dependencies: - tslib: 2.6.3 - - safe-buffer@5.2.1: {} - - safer-buffer@2.1.2: {} - - scheduler@0.23.2: - dependencies: - loose-envify: 1.4.0 - - semver@6.3.1: {} - - semver@7.6.2: {} - - serialize-error@7.0.1: - dependencies: - type-fest: 0.13.1 - - set-blocking@2.0.0: {} - - shallowequal@1.1.0: {} - - signal-exit@3.0.7: {} - - signal-exit@4.1.0: {} - - slash@5.1.0: {} - - slice-ansi@5.0.0: - dependencies: - ansi-styles: 6.2.1 - is-fullwidth-code-point: 4.0.0 - - source-map-js@1.2.0: {} - - sprintf-js@1.0.3: {} - - stack-utils@2.0.6: - dependencies: - escape-string-regexp: 2.0.0 - - string-width@4.2.3: - dependencies: - emoji-regex: 8.0.0 - is-fullwidth-code-point: 3.0.0 - strip-ansi: 6.0.1 - - string-width@7.2.0: - dependencies: - emoji-regex: 10.3.0 - get-east-asian-width: 1.2.0 - strip-ansi: 7.1.0 - - string_decoder@1.3.0: - dependencies: - safe-buffer: 5.2.1 - - strip-ansi@6.0.1: - dependencies: - ansi-regex: 5.0.1 - - strip-ansi@7.1.0: - dependencies: - ansi-regex: 6.0.1 - - styled-components@6.1.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1): - dependencies: - '@emotion/is-prop-valid': 1.2.2 - '@emotion/unitless': 0.8.1 - '@types/stylis': 4.2.6 - css-to-react-native: 3.2.0 - csstype: 3.1.3 - postcss: 8.4.33 - react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) - shallowequal: 1.1.0 - stylis: 4.3.2 - tslib: 2.6.3 - - stylis@4.3.2: {} - - supertap@3.0.1: - dependencies: - indent-string: 5.0.0 - js-yaml: 3.14.1 - serialize-error: 7.0.1 - strip-ansi: 7.1.0 - - tar@6.2.1: - dependencies: - chownr: 2.0.0 - fs-minipass: 2.1.0 - minipass: 5.0.0 - minizlib: 2.1.2 - mkdirp: 1.0.4 - yallist: 4.0.0 - - temp-dir@3.0.0: {} - - time-zone@1.0.0: {} - - tmp@0.0.33: - dependencies: - os-tmpdir: 1.0.2 - - to-regex-range@5.0.1: - dependencies: - is-number: 7.0.0 - - toml@3.0.0: {} - - tr46@0.0.3: {} - - tslib@2.6.3: {} - - typanion@3.14.0: {} - - type-fest@0.13.1: {} - - type-fest@0.21.3: {} - - typescript@5.5.4: {} - - undici-types@6.19.8: {} - - unicorn-magic@0.1.0: {} - - universal-user-agent@7.0.2: {} - - util-deprecate@1.0.2: {} - - wasm-sjlj@1.0.5: {} - - webidl-conversions@3.0.1: {} - - well-known-symbols@2.0.0: {} - - whatwg-url@5.0.0: - dependencies: - tr46: 0.0.3 - webidl-conversions: 3.0.1 - - wide-align@1.1.5: - dependencies: - string-width: 4.2.3 - - wrap-ansi@6.2.0: - dependencies: - ansi-styles: 4.3.0 - string-width: 4.2.3 - strip-ansi: 6.0.1 - - wrap-ansi@7.0.0: - dependencies: - ansi-styles: 4.3.0 - string-width: 4.2.3 - strip-ansi: 6.0.1 - - wrappy@1.0.2: {} - - write-file-atomic@5.0.1: - dependencies: - imurmurhash: 0.1.4 - signal-exit: 4.1.0 - - y18n@5.0.8: {} - - yallist@4.0.0: {} - - yargs-parser@21.1.1: {} - - yargs@17.7.2: - dependencies: - cliui: 8.0.1 - escalade: 3.1.2 - get-caller-file: 2.0.5 - require-directory: 2.1.1 - string-width: 4.2.3 - y18n: 5.0.8 - yargs-parser: 21.1.1 - - yoctocolors-cjs@2.1.2: {} diff --git a/src/builtins.rs b/src/builtins.rs deleted file mode 100644 index 45a25117..00000000 --- a/src/builtins.rs +++ /dev/null @@ -1,71 +0,0 @@ -/// Node.js built-in modules -/// -/// `node -p "[...require('module').builtinModules].map(b => JSON.stringify(b)).join(',\n')"` -/// -pub const NODEJS_BUILTINS: &[&str] = &[ - "_http_agent", - "_http_client", - "_http_common", - "_http_incoming", - "_http_outgoing", - "_http_server", - "_stream_duplex", - "_stream_passthrough", - "_stream_readable", - "_stream_transform", - "_stream_wrap", - "_stream_writable", - "_tls_common", - "_tls_wrap", - "assert", - "assert/strict", - "async_hooks", - "buffer", - "child_process", - "cluster", - "console", - "constants", - "crypto", - "dgram", - "diagnostics_channel", - "dns", - "dns/promises", - "domain", - "events", - "fs", - "fs/promises", - "http", - "http2", - "https", - "inspector", - "module", - "net", - "os", - "path", - "path/posix", - "path/win32", - "perf_hooks", - "process", - "punycode", - "querystring", - "readline", - "repl", - "stream", - "stream/consumers", - "stream/promises", - "stream/web", - "string_decoder", - "sys", - "timers", - "timers/promises", - "tls", - "trace_events", - "tty", - "url", - "util", - "util/types", - "v8", - "vm", - "worker_threads", - "zlib", -]; diff --git a/src/cache.rs b/src/cache.rs deleted file mode 100644 index 6e600664..00000000 --- a/src/cache.rs +++ /dev/null @@ -1,354 +0,0 @@ -use once_cell::sync::OnceCell as OnceLock; -use std::{ - borrow::{Borrow, Cow}, - convert::AsRef, - hash::{BuildHasherDefault, Hash, Hasher}, - io, - ops::Deref, - path::{Path, PathBuf}, - sync::Arc, -}; - -use dashmap::{DashMap, DashSet}; -use rustc_hash::FxHasher; - -use crate::{ - context::ResolveContext as Ctx, package_json::PackageJson, path::PathUtil, FileMetadata, - FileSystem, ResolveError, ResolveOptions, TsConfig, -}; - -#[derive(Default)] -pub struct Cache { - pub(crate) fs: Fs, - paths: DashSet>, - tsconfigs: DashMap, BuildHasherDefault>, -} - -impl Cache { - pub fn new(fs: Fs) -> Self { - Self { fs, paths: DashSet::default(), tsconfigs: DashMap::default() } - } - - pub fn clear(&self) { - self.paths.clear(); - self.tsconfigs.clear(); - } - - pub fn value(&self, path: &Path) -> CachedPath { - let hash = { - let mut hasher = FxHasher::default(); - path.hash(&mut hasher); - hasher.finish() - }; - if let Some(cache_entry) = self.paths.get((hash, path).borrow() as &dyn CacheKey) { - return cache_entry.clone(); - } - let parent = path.parent().map(|p| self.value(p)); - let data = CachedPath(Arc::new(CachedPathImpl::new( - hash, - path.to_path_buf().into_boxed_path(), - parent, - ))); - self.paths.insert(data.clone()); - data - } - - pub fn tsconfig Result<(), ResolveError>>( - &self, - root: bool, - path: &Path, - callback: F, // callback for modifying tsconfig with `extends` - ) -> Result, ResolveError> { - if let Some(tsconfig_ref) = self.tsconfigs.get(path) { - return Ok(Arc::clone(tsconfig_ref.value())); - } - let meta = self.fs.metadata(path).ok(); - let tsconfig_path = if meta.is_some_and(|m| m.is_file) { - Cow::Borrowed(path) - } else if meta.is_some_and(|m| m.is_dir) { - Cow::Owned(path.join("tsconfig.json")) - } else { - let mut os_string = path.to_path_buf().into_os_string(); - os_string.push(".json"); - Cow::Owned(PathBuf::from(os_string)) - }; - let mut tsconfig_string = self - .fs - .read_to_string(&tsconfig_path) - .map_err(|_| ResolveError::TsconfigNotFound(path.to_path_buf()))?; - let mut tsconfig = - TsConfig::parse(root, &tsconfig_path, &mut tsconfig_string).map_err(|error| { - ResolveError::from_serde_json_error(tsconfig_path.to_path_buf(), &error) - })?; - callback(&mut tsconfig)?; - let tsconfig = Arc::new(tsconfig.build()); - self.tsconfigs.insert(path.to_path_buf(), Arc::clone(&tsconfig)); - Ok(tsconfig) - } -} - -#[derive(Clone)] -pub struct CachedPath(Arc); - -impl Hash for CachedPath { - fn hash(&self, state: &mut H) { - self.0.hash.hash(state); - } -} - -impl PartialEq for CachedPath { - fn eq(&self, other: &Self) -> bool { - self.0.path == other.0.path - } -} -impl Eq for CachedPath {} - -impl Deref for CachedPath { - type Target = CachedPathImpl; - - fn deref(&self) -> &Self::Target { - self.0.as_ref() - } -} - -impl<'a> Borrow for CachedPath { - fn borrow(&self) -> &(dyn CacheKey + 'a) { - self - } -} - -impl AsRef for CachedPath { - fn as_ref(&self) -> &CachedPathImpl { - self.0.as_ref() - } -} - -impl CacheKey for CachedPath { - fn tuple(&self) -> (u64, &Path) { - (self.hash, &self.path) - } -} - -pub struct CachedPathImpl { - hash: u64, - path: Box, - parent: Option, - meta: OnceLock>, - canonicalized: OnceLock>, - node_modules: OnceLock>, - package_json: OnceLock>>, -} - -impl CachedPathImpl { - fn new(hash: u64, path: Box, parent: Option) -> Self { - Self { - hash, - path, - parent, - meta: OnceLock::new(), - canonicalized: OnceLock::new(), - node_modules: OnceLock::new(), - package_json: OnceLock::new(), - } - } - - pub fn path(&self) -> &Path { - &self.path - } - - pub fn to_path_buf(&self) -> PathBuf { - self.path.to_path_buf() - } - - pub fn parent(&self) -> Option<&CachedPath> { - self.parent.as_ref() - } - - fn meta(&self, fs: &Fs) -> Option { - *self.meta.get_or_init(|| fs.metadata(&self.path).ok()) - } - - pub fn is_file(&self, fs: &Fs, ctx: &mut Ctx) -> bool { - if let Some(meta) = self.meta(fs) { - ctx.add_file_dependency(self.path()); - meta.is_file - } else { - ctx.add_missing_dependency(self.path()); - false - } - } - - pub fn is_dir(&self, fs: &Fs, ctx: &mut Ctx) -> bool { - self.meta(fs).map_or_else( - || { - ctx.add_missing_dependency(self.path()); - false - }, - |meta| meta.is_dir, - ) - } - - pub fn realpath(&self, fs: &Fs) -> io::Result { - self.canonicalized - .get_or_try_init(|| { - if fs.symlink_metadata(&self.path).is_ok_and(|m| m.is_symlink) { - return fs.canonicalize(&self.path).map(Some); - } - if let Some(parent) = self.parent() { - let parent_path = parent.realpath(fs)?; - return Ok(Some( - parent_path.normalize_with(self.path.strip_prefix(&parent.path).unwrap()), - )); - }; - Ok(None) - }) - .cloned() - .map(|r| r.unwrap_or_else(|| self.path.clone().to_path_buf())) - } - - pub fn module_directory( - &self, - module_name: &str, - cache: &Cache, - ctx: &mut Ctx, - ) -> Option { - let cached_path = cache.value(&self.path.join(module_name)); - cached_path.is_dir(&cache.fs, ctx).then_some(cached_path) - } - - pub fn cached_node_modules( - &self, - cache: &Cache, - ctx: &mut Ctx, - ) -> Option { - self.node_modules.get_or_init(|| self.module_directory("node_modules", cache, ctx)).clone() - } - - /// Find package.json of a path by traversing parent directories. - /// - /// # Errors - /// - /// * [ResolveError::JSON] - pub fn find_package_json( - &self, - fs: &Fs, - options: &ResolveOptions, - ctx: &mut Ctx, - ) -> Result>, ResolveError> { - let mut cache_value = self; - // Go up directories when the querying path is not a directory - while !cache_value.is_dir(fs, ctx) { - if let Some(cv) = &cache_value.parent { - cache_value = cv.as_ref(); - } else { - break; - } - } - let mut cache_value = Some(cache_value); - while let Some(cv) = cache_value { - if let Some(package_json) = cv.package_json(fs, options, ctx)? { - return Ok(Some(Arc::clone(&package_json))); - } - cache_value = cv.parent.as_deref(); - } - Ok(None) - } - - /// Get package.json of the given path. - /// - /// # Errors - /// - /// * [ResolveError::JSON] - pub fn package_json( - &self, - fs: &Fs, - options: &ResolveOptions, - ctx: &mut Ctx, - ) -> Result>, ResolveError> { - // Change to `std::sync::OnceLock::get_or_try_init` when it is stable. - let result = self - .package_json - .get_or_try_init(|| { - let package_json_path = self.path.join("package.json"); - let Ok(package_json_string) = fs.read_to_string(&package_json_path) else { - return Ok(None); - }; - let real_path = if options.symlinks { - self.realpath(fs)?.join("package.json") - } else { - package_json_path.clone() - }; - PackageJson::parse(package_json_path.clone(), real_path, &package_json_string) - .map(Arc::new) - .map(Some) - .map_err(|error| ResolveError::from_serde_json_error(package_json_path, &error)) - }) - .cloned(); - // https://github.com/webpack/enhanced-resolve/blob/58464fc7cb56673c9aa849e68e6300239601e615/lib/DescriptionFileUtils.js#L68-L82 - match &result { - Ok(Some(package_json)) => { - ctx.add_file_dependency(&package_json.path); - } - Ok(None) => { - // Avoid an allocation by making this lazy - if let Some(deps) = &mut ctx.missing_dependencies { - deps.push(self.path.join("package.json")); - } - } - Err(_) => { - if let Some(deps) = &mut ctx.file_dependencies { - deps.push(self.path.join("package.json")); - } - } - } - result - } -} - -/// Memoized cache key, code adapted from . -trait CacheKey { - fn tuple(&self) -> (u64, &Path); -} - -impl Hash for dyn CacheKey + '_ { - fn hash(&self, state: &mut H) { - self.tuple().0.hash(state); - } -} - -impl PartialEq for dyn CacheKey + '_ { - fn eq(&self, other: &Self) -> bool { - self.tuple().1 == other.tuple().1 - } -} - -impl Eq for dyn CacheKey + '_ {} - -impl<'a> CacheKey for (u64, &'a Path) { - fn tuple(&self) -> (u64, &Path) { - (self.0, self.1) - } -} - -impl<'a> Borrow for (u64, &'a Path) { - fn borrow(&self) -> &(dyn CacheKey + 'a) { - self - } -} - -/// Since the cache key is memoized, use an identity hasher -/// to avoid double cache. -#[derive(Default)] -struct IdentityHasher(u64); - -impl Hasher for IdentityHasher { - fn write(&mut self, _: &[u8]) { - unreachable!("Invalid use of IdentityHasher") - } - fn write_u64(&mut self, n: u64) { - self.0 = n; - } - fn finish(&self) -> u64 { - self.0 - } -} diff --git a/src/context.rs b/src/context.rs deleted file mode 100644 index 9349de30..00000000 --- a/src/context.rs +++ /dev/null @@ -1,89 +0,0 @@ -use std::{ - ops::{Deref, DerefMut}, - path::{Path, PathBuf}, -}; - -use crate::error::ResolveError; - -#[derive(Debug, Default, Clone)] -pub struct ResolveContext(ResolveContextImpl); - -#[derive(Debug, Default, Clone)] -pub struct ResolveContextImpl { - pub fully_specified: bool, - - pub query: Option, - - pub fragment: Option, - - /// Files that was found on file system - pub file_dependencies: Option>, - - /// Files that was found on file system - pub missing_dependencies: Option>, - - /// The current resolving alias for bailing recursion alias. - pub resolving_alias: Option, - - /// For avoiding infinite recursion, which will cause stack overflow. - depth: u8, -} - -impl Deref for ResolveContext { - type Target = ResolveContextImpl; - - fn deref(&self) -> &Self::Target { - &self.0 - } -} - -impl DerefMut for ResolveContext { - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} - -impl ResolveContext { - pub fn with_fully_specified(&mut self, yes: bool) { - self.fully_specified = yes; - } - - pub fn with_query_fragment(&mut self, query: Option<&str>, fragment: Option<&str>) { - if let Some(query) = query { - self.query.replace(query.to_string()); - } - if let Some(fragment) = fragment { - self.fragment.replace(fragment.to_string()); - } - } - - pub fn init_file_dependencies(&mut self) { - self.file_dependencies.replace(vec![]); - self.missing_dependencies.replace(vec![]); - } - - pub fn add_file_dependency(&mut self, dep: &Path) { - if let Some(deps) = &mut self.file_dependencies { - deps.push(dep.to_path_buf()); - } - } - - pub fn add_missing_dependency(&mut self, dep: &Path) { - if let Some(deps) = &mut self.missing_dependencies { - deps.push(dep.to_path_buf()); - } - } - - pub fn with_resolving_alias(&mut self, alias: String) { - self.resolving_alias = Some(alias); - } - - pub fn test_for_infinite_recursion(&mut self) -> Result<(), ResolveError> { - self.depth += 1; - // 64 should be more than enough for detecting infinite recursion. - if self.depth > 64 { - return Err(ResolveError::Recursion); - } - Ok(()) - } -} diff --git a/src/error.rs b/src/error.rs deleted file mode 100644 index b00a0ba8..00000000 --- a/src/error.rs +++ /dev/null @@ -1,182 +0,0 @@ -use std::{io, path::PathBuf, sync::Arc}; -use thiserror::Error; - -/// All resolution errors -/// -/// `thiserror` is used to display meaningful error messages. -#[derive(Debug, Clone, PartialEq, Error)] -pub enum ResolveError { - /// Ignored path - /// - /// Derived from ignored path (false value) from browser field in package.json - /// ```json - /// { - /// "browser": { - /// "./module": false - /// } - /// } - /// ``` - /// See - #[error("Path is ignored {0}")] - Ignored(PathBuf), - - /// Module not found - #[error("Cannot find module '{0}'")] - NotFound(/* specifier */ String), - - /// Matched alias value not found - #[error("Cannot find module '{0}' for matched aliased key '{1}'")] - MatchedAliasNotFound(/* specifier */ String, /* alias key */ String), - - /// Tsconfig not found - #[error("Tsconfig not found {0}")] - TsconfigNotFound(PathBuf), - - /// Tsconfig's project reference path points to it self - #[error("Tsconfig's project reference path points to this tsconfig {0}")] - TsconfigSelfReference(PathBuf), - - #[error("{0}")] - IOError(IOError), - - /// Node.js builtin modules - /// - /// This is an error due to not being a Node.js runtime. - /// The `alias` option can be used to resolve a builtin module to a polyfill. - #[error("Builtin module {0}")] - Builtin(String), - - /// All of the aliased extension are not found - #[error("All of the aliased extensions are not found for {0}")] - ExtensionAlias(PathBuf), - - /// The provided path specifier cannot be parsed - #[error("{0}")] - Specifier(SpecifierError), - - /// JSON parse error - #[error("{0:?}")] - JSON(JSONError), - - /// Restricted by `ResolveOptions::restrictions` - #[error(r#"Path "{0}" restricted by {0}"#)] - Restriction(PathBuf, PathBuf), - - #[error(r#"Invalid module "{0}" specifier is not a valid subpath for the "exports" resolution of {1}"#)] - InvalidModuleSpecifier(String, PathBuf), - - #[error(r#"Invalid "exports" target "{0}" defined for '{1}' in the package config {2}"#)] - InvalidPackageTarget(String, String, PathBuf), - - #[error(r#"Package subpath '{0}' is not defined by "exports" in {1}"#)] - PackagePathNotExported(String, PathBuf), - - #[error(r#"Invalid package config "{0}", "exports" cannot contain some keys starting with '.' and some not. The exports object must either be an object of package subpath keys or an object of main entry condition name keys only."#)] - InvalidPackageConfig(PathBuf), - - #[error(r#"Default condition should be last one in "{0}""#)] - InvalidPackageConfigDefault(PathBuf), - - #[error(r#"Expecting folder to folder mapping. "{0}" should end with "/"#)] - InvalidPackageConfigDirectory(PathBuf), - - #[error(r#"Package import specifier "{0}" is not defined in package {1}"#)] - PackageImportNotDefined(String, PathBuf), - - #[error("{0} is unimplemented")] - Unimplemented(&'static str), - - /// Occurs when alias paths reference each other. - #[error("Recursion in resolving")] - Recursion, -} - -impl ResolveError { - pub fn is_ignore(&self) -> bool { - matches!(self, Self::Ignored(_)) - } - - pub(crate) fn from_serde_json_error(path: PathBuf, error: &serde_json::Error) -> Self { - Self::JSON(JSONError { - path, - message: error.to_string(), - line: error.line(), - column: error.column(), - }) - } -} - -/// Error for [ResolveError::Specifier] -#[derive(Debug, Clone, Eq, PartialEq, Error)] -pub enum SpecifierError { - #[error("The specifiers must be a non-empty string. Received \"{0}\"")] - Empty(String), -} - -/// JSON error from [serde_json::Error] -#[derive(Debug, Clone, Eq, PartialEq)] -pub struct JSONError { - pub path: PathBuf, - pub message: String, - pub line: usize, - pub column: usize, -} - -#[derive(Debug, Clone, Error)] -#[error("{0}")] -pub struct IOError(Arc); - -impl PartialEq for IOError { - fn eq(&self, other: &Self) -> bool { - self.0.kind() == other.0.kind() - } -} - -impl From for io::Error { - fn from(error: IOError) -> Self { - let io_error = error.0.as_ref(); - Self::new(io_error.kind(), io_error.to_string()) - } -} - -impl From for ResolveError { - fn from(err: io::Error) -> Self { - Self::IOError(IOError(Arc::new(err))) - } -} - -#[test] -fn test_into_io_error() { - use std::io::{self, ErrorKind}; - let error_string = "IOError occurred"; - let string_error = io::Error::new(ErrorKind::Interrupted, error_string.to_string()); - let string_error2 = io::Error::new(ErrorKind::Interrupted, error_string.to_string()); - let resolve_io_error: ResolveError = ResolveError::from(string_error2); - - assert_eq!(resolve_io_error, ResolveError::from(string_error)); - assert_eq!(resolve_io_error.clone(), resolve_io_error); - let ResolveError::IOError(io_error) = resolve_io_error else { unreachable!() }; - assert_eq!( - format!("{io_error:?}"), - r#"IOError(Custom { kind: Interrupted, error: "IOError occurred" })"# - ); - // fix for https://github.com/web-infra-dev/rspack/issues/4564 - let std_io_error: io::Error = io_error.into(); - assert_eq!(std_io_error.kind(), ErrorKind::Interrupted); - assert_eq!(std_io_error.to_string(), error_string); - assert_eq!( - format!("{std_io_error:?}"), - r#"Custom { kind: Interrupted, error: "IOError occurred" }"# - ); -} - -#[test] -fn test_coverage() { - let error = ResolveError::NotFound("x".into()); - assert_eq!(format!("{error:?}"), r#"NotFound("x")"#); - assert_eq!(error.clone(), error); - - let error = ResolveError::Specifier(SpecifierError::Empty("x".into())); - assert_eq!(format!("{error:?}"), r#"Specifier(Empty("x"))"#); - assert_eq!(error.clone(), error); -} diff --git a/src/file_system.rs b/src/file_system.rs deleted file mode 100644 index d5f0ff8a..00000000 --- a/src/file_system.rs +++ /dev/null @@ -1,220 +0,0 @@ -use cfg_if::cfg_if; -use std::{ - fs, io, - path::{Path, PathBuf}, -}; - -#[cfg(feature = "yarn_pnp")] -use pnp::fs::{LruZipCache, VPath, VPathInfo, ZipCache}; - -/// File System abstraction used for `ResolverGeneric` -pub trait FileSystem: Send + Sync { - /// See [std::fs::read_to_string] - /// - /// # Errors - /// - /// * See [std::fs::read_to_string] - /// ## Warning - /// Use `&Path` instead of a generic `P: AsRef` here, - /// because object safety requirements, it is especially useful, when - /// you want to store multiple `dyn FileSystem` in a `Vec` or use a `ResolverGeneric` in - /// napi env. - fn read_to_string(&self, path: &Path) -> io::Result; - - /// See [std::fs::metadata] - /// - /// # Errors - /// See [std::fs::metadata] - /// ## Warning - /// Use `&Path` instead of a generic `P: AsRef` here, - /// because object safety requirements, it is especially useful, when - /// you want to store multiple `dyn FileSystem` in a `Vec` or use a `ResolverGeneric` in - /// napi env. - fn metadata(&self, path: &Path) -> io::Result; - - /// See [std::fs::symlink_metadata] - /// - /// # Errors - /// - /// See [std::fs::symlink_metadata] - /// ## Warning - /// Use `&Path` instead of a generic `P: AsRef` here, - /// because object safety requirements, it is especially useful, when - /// you want to store multiple `dyn FileSystem` in a `Vec` or use a `ResolverGeneric` in - /// napi env. - fn symlink_metadata(&self, path: &Path) -> io::Result; - - /// See [std::fs::canonicalize] - /// - /// # Errors - /// - /// See [std::fs::read_link] - /// ## Warning - /// Use `&Path` instead of a generic `P: AsRef` here, - /// because object safety requirements, it is especially useful, when - /// you want to store multiple `dyn FileSystem` in a `Vec` or use a `ResolverGeneric` in - /// napi env. - fn canonicalize(&self, path: &Path) -> io::Result; -} - -/// Metadata information about a file -#[derive(Debug, Clone, Copy)] -pub struct FileMetadata { - pub(crate) is_file: bool, - pub(crate) is_dir: bool, - pub(crate) is_symlink: bool, -} - -impl FileMetadata { - pub fn new(is_file: bool, is_dir: bool, is_symlink: bool) -> Self { - Self { is_file, is_dir, is_symlink } - } -} - -#[cfg(feature = "yarn_pnp")] -impl From for FileMetadata { - fn from(value: pnp::fs::FileType) -> Self { - Self::new(value == pnp::fs::FileType::File, value == pnp::fs::FileType::Directory, false) - } -} - -impl From for FileMetadata { - fn from(metadata: fs::Metadata) -> Self { - Self::new(metadata.is_file(), metadata.is_dir(), metadata.is_symlink()) - } -} - -/// Operating System -#[cfg(feature = "yarn_pnp")] -pub struct FileSystemOs { - pnp_lru: LruZipCache>, -} - -#[cfg(not(feature = "yarn_pnp"))] -pub struct FileSystemOs; - -impl Default for FileSystemOs { - fn default() -> Self { - cfg_if! { - if #[cfg(feature = "yarn_pnp")] { - Self { pnp_lru: LruZipCache::new(50, pnp::fs::open_zip_via_read_p) } - } else { - Self - } - } - } -} - -fn read_to_string(path: &Path) -> io::Result { - // `simdutf8` is faster than `std::str::from_utf8` which `fs::read_to_string` uses internally - let bytes = std::fs::read(path)?; - if simdutf8::basic::from_utf8(&bytes).is_err() { - // Same error as `fs::read_to_string` produces (`io::Error::INVALID_UTF8`) - return Err(io::Error::new( - io::ErrorKind::InvalidData, - "stream did not contain valid UTF-8", - )); - } - // SAFETY: `simdutf8` has ensured it's a valid UTF-8 string - Ok(unsafe { String::from_utf8_unchecked(bytes) }) -} - -impl FileSystem for FileSystemOs { - fn read_to_string(&self, path: &Path) -> io::Result { - cfg_if! { - if #[cfg(feature = "yarn_pnp")] { - match VPath::from(path)? { - VPath::Zip(info) => { - self.pnp_lru.read_to_string(info.physical_base_path(), info.zip_path) - } - VPath::Virtual(info) => read_to_string(&info.physical_base_path()), - VPath::Native(path) => read_to_string(&path), - } - } else { - read_to_string(path) - } - } - } - - fn metadata(&self, path: &Path) -> io::Result { - cfg_if! { - if #[cfg(feature = "yarn_pnp")] { - match VPath::from(path)? { - VPath::Zip(info) => self - .pnp_lru - .file_type(info.physical_base_path(), info.zip_path) - .map(FileMetadata::from), - VPath::Virtual(info) => { - fs::metadata(info.physical_base_path()).map(FileMetadata::from) - } - VPath::Native(path) => fs::metadata(path).map(FileMetadata::from), - } - } else { - fs::metadata(path).map(FileMetadata::from) - } - } - } - - fn symlink_metadata(&self, path: &Path) -> io::Result { - fs::symlink_metadata(path).map(FileMetadata::from) - } - - fn canonicalize(&self, path: &Path) -> io::Result { - cfg_if! { - if #[cfg(feature = "yarn_pnp")] { - match VPath::from(path)? { - VPath::Zip(info) => { - dunce::canonicalize(info.physical_base_path().join(info.zip_path)) - } - VPath::Virtual(info) => dunce::canonicalize(info.physical_base_path()), - VPath::Native(path) => dunce::canonicalize(path), - } - } else if #[cfg(windows)] { - dunce::canonicalize(path) - } else { - use std::path::Component; - let mut path_buf = path.to_path_buf(); - loop { - let link = fs::read_link(&path_buf)?; - path_buf.pop(); - for component in link.components() { - match component { - Component::ParentDir => { - path_buf.pop(); - } - Component::Normal(seg) => { - #[cfg(target_family = "wasm")] - // Need to trim the extra \0 introduces by https://github.com/nodejs/uvwasi/issues/262 - { - path_buf.push(seg.to_string_lossy().trim_end_matches('\0')); - } - #[cfg(not(target_family = "wasm"))] - { - path_buf.push(seg); - } - } - Component::RootDir => { - path_buf = PathBuf::from("/"); - } - Component::CurDir | Component::Prefix(_) => {} - } - } - if !fs::symlink_metadata(&path_buf)?.is_symlink() { - break; - } - } - Ok(path_buf) - } - } - } -} - -#[test] -fn metadata() { - let meta = FileMetadata { is_file: true, is_dir: true, is_symlink: true }; - assert_eq!( - format!("{meta:?}"), - "FileMetadata { is_file: true, is_dir: true, is_symlink: true }" - ); - let _ = meta; -} diff --git a/src/lib.rs b/src/lib.rs deleted file mode 100644 index e6cb2246..00000000 --- a/src/lib.rs +++ /dev/null @@ -1,1755 +0,0 @@ -//! # Oxc Resolver -//! -//! Node.js [CommonJS][cjs] and [ECMAScript][esm] Module Resolution. -//! -//! Released on [crates.io](https://crates.io/crates/oxc_resolver) and [npm](https://www.npmjs.com/package/oxc-resolver). -//! -//! A module resolution is the process of finding the file referenced by a module specifier in -//! `import "specifier"` or `require("specifier")`. -//! -//! All [configuration options](ResolveOptions) are aligned with webpack's [enhanced-resolve]. -//! -//! ## Terminology -//! -//! ### Specifier -//! -//! For [CommonJS modules][cjs], -//! the specifier is the string passed to the `require` function. e.g. `"id"` in `require("id")`. -//! -//! For [ECMAScript modules][esm], -//! the specifier of an `import` statement is the string after the `from` keyword, -//! e.g. `'specifier'` in `import 'specifier'` or `import { sep } from 'specifier'`. -//! Specifiers are also used in export from statements, and as the argument to an `import()` expression. -//! -//! This is also named "request" in some places. -//! -//! ## References: -//! -//! * Algorithm adapted from Node.js [CommonJS Module Resolution Algorithm] and [ECMAScript Module Resolution Algorithm]. -//! * Tests are ported from [enhanced-resolve]. -//! * Some code is adapted from [parcel-resolver]. -//! * The documentation is copied from [webpack's resolve configuration](https://webpack.js.org/configuration/resolve). -//! -//! [enhanced-resolve]: https://github.com/webpack/enhanced-resolve -//! [CommonJS Module Resolution Algorithm]: https://nodejs.org/api/modules.html#all-together -//! [ECMAScript Module Resolution Algorithm]: https://nodejs.org/api/esm.html#resolution-algorithm-specification -//! [parcel-resolver]: https://github.com/parcel-bundler/parcel/blob/v2/packages/utils/node-resolver-rs -//! [cjs]: https://nodejs.org/api/modules.html -//! [esm]: https://nodejs.org/api/esm.html -//! -//! ## Feature flags -#![cfg_attr(feature = "document-features", doc = document_features::document_features!())] -#![cfg_attr(docsrs, feature(doc_auto_cfg))] -//! -//! ## Example -//! -//! ```rust,ignore -#![doc = include_str!("../examples/resolver.rs")] -//! ``` - -mod builtins; -mod cache; -mod context; -mod error; -mod file_system; -mod options; -mod package_json; -mod path; -mod resolution; -mod specifier; -mod tsconfig; - -#[cfg(test)] -mod tests; - -use std::{ - borrow::Cow, - cmp::Ordering, - ffi::OsStr, - fmt, - path::{Component, Path, PathBuf}, - sync::Arc, -}; - -use rustc_hash::FxHashSet; -use serde_json::Value as JSONValue; - -pub use crate::{ - builtins::NODEJS_BUILTINS, - error::{JSONError, ResolveError, SpecifierError}, - file_system::{FileMetadata, FileSystem}, - options::{ - Alias, AliasValue, EnforceExtension, ResolveOptions, Restriction, TsconfigOptions, - TsconfigReferences, - }, - package_json::PackageJson, - resolution::Resolution, -}; -use crate::{ - cache::{Cache, CachedPath}, - context::ResolveContext as Ctx, - file_system::FileSystemOs, - package_json::JSONMap, - path::{PathUtil, SLASH_START}, - specifier::Specifier, - tsconfig::ExtendsField, - tsconfig::{ProjectReference, TsConfig}, -}; - -type ResolveResult = Result, ResolveError>; - -/// Context returned from the [Resolver::resolve_with_context] API -#[derive(Debug, Default, Clone)] -pub struct ResolveContext { - /// Files that was found on file system - pub file_dependencies: FxHashSet, - - /// Dependencies that was not found on file system - pub missing_dependencies: FxHashSet, -} - -/// Resolver with the current operating system as the file system -pub type Resolver = ResolverGeneric; - -/// Generic implementation of the resolver, can be configured by the [FileSystem] trait -pub struct ResolverGeneric { - options: ResolveOptions, - cache: Arc>, -} - -impl fmt::Debug for ResolverGeneric { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - self.options.fmt(f) - } -} - -impl Default for ResolverGeneric { - fn default() -> Self { - Self::new(ResolveOptions::default()) - } -} - -impl ResolverGeneric { - pub fn new(options: ResolveOptions) -> Self { - Self { options: options.sanitize(), cache: Arc::new(Cache::new(Fs::default())) } - } -} - -impl ResolverGeneric { - pub fn new_with_file_system(file_system: Fs, options: ResolveOptions) -> Self { - Self { cache: Arc::new(Cache::new(file_system)), options: options.sanitize() } - } - - /// Clone the resolver using the same underlying cache. - #[must_use] - pub fn clone_with_options(&self, options: ResolveOptions) -> Self { - Self { options: options.sanitize(), cache: Arc::clone(&self.cache) } - } - - /// Returns the options. - pub fn options(&self) -> &ResolveOptions { - &self.options - } - - /// Clear the underlying cache. - pub fn clear_cache(&self) { - self.cache.clear(); - } - - /// Resolve `specifier` at an absolute path to a `directory`. - /// - /// A specifier is the string passed to require or import, i.e. `require("specifier")` or `import "specifier"`. - /// - /// `directory` must be an **absolute** path to a directory where the specifier is resolved against. - /// For CommonJS modules, it is the `__dirname` variable that contains the absolute path to the folder containing current module. - /// For ECMAScript modules, it is the value of `import.meta.url`. - /// - /// # Errors - /// - /// * See [ResolveError] - pub fn resolve>( - &self, - directory: P, - specifier: &str, - ) -> Result { - let mut ctx = Ctx::default(); - self.resolve_tracing(directory.as_ref(), specifier, &mut ctx) - } - - /// Resolve `specifier` at absolute `path` with [ResolveContext] - /// - /// # Errors - /// - /// * See [ResolveError] - pub fn resolve_with_context>( - &self, - directory: P, - specifier: &str, - resolve_context: &mut ResolveContext, - ) -> Result { - let mut ctx = Ctx::default(); - ctx.init_file_dependencies(); - let result = self.resolve_tracing(directory.as_ref(), specifier, &mut ctx); - if let Some(deps) = &mut ctx.file_dependencies { - resolve_context.file_dependencies.extend(deps.drain(..)); - } - if let Some(deps) = &mut ctx.missing_dependencies { - resolve_context.missing_dependencies.extend(deps.drain(..)); - } - result - } - - /// Wrap `resolve_impl` with `tracing` information - fn resolve_tracing( - &self, - directory: &Path, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - let span = tracing::debug_span!("resolve", path = ?directory, specifier = specifier); - let _enter = span.enter(); - let r = self.resolve_impl(directory, specifier, ctx); - match &r { - Ok(r) => { - tracing::debug!(options = ?self.options, path = ?directory, specifier = specifier, ret = ?r.path); - } - Err(err) => { - tracing::debug!(options = ?self.options, path = ?directory, specifier = specifier, err = ?err); - } - }; - r - } - - fn resolve_impl( - &self, - path: &Path, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - ctx.with_fully_specified(self.options.fully_specified); - let cached_path = self.cache.value(path); - let cached_path = self.require(&cached_path, specifier, ctx)?; - let path = self.load_realpath(&cached_path)?; - // enhanced-resolve: restrictions - self.check_restrictions(&path)?; - let package_json = cached_path.find_package_json(&self.cache.fs, &self.options, ctx)?; - if let Some(package_json) = &package_json { - // path must be inside the package. - debug_assert!(path.starts_with(package_json.directory())); - } - Ok(Resolution { - path, - query: ctx.query.take(), - fragment: ctx.fragment.take(), - package_json, - }) - } - - /// require(X) from module at path Y - /// - /// X: specifier - /// Y: path - /// - /// - fn require( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - ctx.test_for_infinite_recursion()?; - - // enhanced-resolve: parse - let (parsed, try_fragment_as_path) = self.load_parse(cached_path, specifier, ctx)?; - if let Some(path) = try_fragment_as_path { - return Ok(path); - } - - self.require_without_parse(cached_path, parsed.path(), ctx) - } - - fn require_without_parse( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - // tsconfig-paths - if let Some(path) = self.load_tsconfig_paths(cached_path, specifier, &mut Ctx::default())? { - return Ok(path); - } - - // enhanced-resolve: try alias - if let Some(path) = self.load_alias(cached_path, specifier, &self.options.alias, ctx)? { - return Ok(path); - } - - let result = match Path::new(specifier).components().next() { - // 2. If X begins with '/' - Some(Component::RootDir | Component::Prefix(_)) => { - self.require_absolute(cached_path, specifier, ctx) - } - // 3. If X begins with './' or '/' or '../' - Some(Component::CurDir | Component::ParentDir) => { - self.require_relative(cached_path, specifier, ctx) - } - // 4. If X begins with '#' - Some(Component::Normal(_)) if specifier.as_bytes()[0] == b'#' => { - self.require_hash(cached_path, specifier, ctx) - } - _ => { - // 1. If X is a core module, - // a. return the core module - // b. STOP - self.require_core(specifier)?; - - // (ESM) 5. Otherwise, - // Note: specifier is now a bare specifier. - // Set resolved the result of PACKAGE_RESOLVE(specifier, parentURL). - self.require_bare(cached_path, specifier, ctx) - } - }; - - result.or_else(|err| { - if err.is_ignore() { - return Err(err); - } - // enhanced-resolve: try fallback - self.load_alias(cached_path, specifier, &self.options.fallback, ctx) - .and_then(|value| value.ok_or(err)) - }) - } - - // PACKAGE_RESOLVE(packageSpecifier, parentURL) - // 3. If packageSpecifier is a Node.js builtin module name, then - // 1. Return the string "node:" concatenated with packageSpecifier. - fn require_core(&self, specifier: &str) -> Result<(), ResolveError> { - if self.options.builtin_modules { - let starts_with_node = specifier.starts_with("node:"); - if starts_with_node || NODEJS_BUILTINS.binary_search(&specifier).is_ok() { - let mut specifier = specifier.to_string(); - if !starts_with_node { - specifier = format!("node:{specifier}"); - } - return Err(ResolveError::Builtin(specifier)); - } - } - Ok(()) - } - - fn require_absolute( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - // Make sure only path prefixes gets called - debug_assert!(Path::new(specifier) - .components() - .next() - .is_some_and(|c| matches!(c, Component::RootDir | Component::Prefix(_)))); - if !self.options.prefer_relative && self.options.prefer_absolute { - if let Ok(path) = self.load_package_self_or_node_modules(cached_path, specifier, ctx) { - return Ok(path); - } - } - if let Some(path) = self.load_roots(specifier, ctx) { - return Ok(path); - } - // 2. If X begins with '/' - // a. set Y to be the file system root - let path = self.cache.value(Path::new(specifier)); - if let Some(path) = self.load_as_file_or_directory(&path, specifier, ctx)? { - return Ok(path); - } - Err(ResolveError::NotFound(specifier.to_string())) - } - - // 3. If X begins with './' or '/' or '../' - fn require_relative( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - // Make sure only relative or normal paths gets called - debug_assert!(Path::new(specifier).components().next().is_some_and(|c| matches!( - c, - Component::CurDir | Component::ParentDir | Component::Normal(_) - ))); - let path = cached_path.path().normalize_with(specifier); - let cached_path = self.cache.value(&path); - // a. LOAD_AS_FILE(Y + X) - // b. LOAD_AS_DIRECTORY(Y + X) - if let Some(path) = self.load_as_file_or_directory(&cached_path, specifier, ctx)? { - return Ok(path); - } - // c. THROW "not found" - Err(ResolveError::NotFound(specifier.to_string())) - } - - fn require_hash( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - debug_assert_eq!(specifier.chars().next(), Some('#')); - // a. LOAD_PACKAGE_IMPORTS(X, dirname(Y)) - if let Some(path) = self.load_package_imports(cached_path, specifier, ctx)? { - return Ok(path); - } - self.load_package_self_or_node_modules(cached_path, specifier, ctx) - } - - fn require_bare( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - // Make sure no other path prefixes gets called - debug_assert!(Path::new(specifier) - .components() - .next() - .is_some_and(|c| matches!(c, Component::Normal(_)))); - if self.options.prefer_relative { - if let Ok(path) = self.require_relative(cached_path, specifier, ctx) { - return Ok(path); - } - } - self.load_package_self_or_node_modules(cached_path, specifier, ctx) - } - - /// enhanced-resolve: ParsePlugin. - /// - /// 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`. - /// - /// - fn load_parse<'s>( - &self, - cached_path: &CachedPath, - specifier: &'s str, - ctx: &mut Ctx, - ) -> Result<(Specifier<'s>, Option), ResolveError> { - let parsed = Specifier::parse(specifier).map_err(ResolveError::Specifier)?; - ctx.with_query_fragment(parsed.query, parsed.fragment); - - // There is an edge-case where a request with # can be a path or a fragment -> try both - if ctx.fragment.is_some() && ctx.query.is_none() { - let specifier = parsed.path(); - let fragment = ctx.fragment.take().unwrap(); - let path = format!("{specifier}{fragment}"); - if let Ok(path) = self.require_without_parse(cached_path, &path, ctx) { - return Ok((parsed, Some(path))); - } - ctx.fragment.replace(fragment); - } - Ok((parsed, None)) - } - - fn load_package_self_or_node_modules( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - let (_, subpath) = Self::parse_package_specifier(specifier); - if subpath.is_empty() { - ctx.with_fully_specified(false); - } - // 5. LOAD_PACKAGE_SELF(X, dirname(Y)) - if let Some(path) = self.load_package_self(cached_path, specifier, ctx)? { - return Ok(path); - } - // 6. LOAD_NODE_MODULES(X, dirname(Y)) - if let Some(path) = self.load_node_modules(cached_path, specifier, ctx)? { - return Ok(path); - } - // 7. THROW "not found" - Err(ResolveError::NotFound(specifier.to_string())) - } - - /// LOAD_PACKAGE_IMPORTS(X, DIR) - fn load_package_imports( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - // 1. Find the closest package scope SCOPE to DIR. - // 2. If no scope was found, return. - let Some(package_json) = - cached_path.find_package_json(&self.cache.fs, &self.options, ctx)? - else { - return Ok(None); - }; - // 3. If the SCOPE/package.json "imports" is null or undefined, return. - // 4. let MATCH = PACKAGE_IMPORTS_RESOLVE(X, pathToFileURL(SCOPE), ["node", "require"]) defined in the ESM resolver. - if let Some(path) = self.package_imports_resolve(specifier, &package_json, ctx)? { - // 5. RESOLVE_ESM_MATCH(MATCH). - return self.resolve_esm_match(specifier, &path, ctx); - } - Ok(None) - } - - fn load_as_file(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - // enhanced-resolve feature: extension_alias - if let Some(path) = self.load_extension_alias(cached_path, ctx)? { - return Ok(Some(path)); - } - if self.options.enforce_extension.is_disabled() { - // 1. If X is a file, load X as its file extension format. STOP - if let Some(path) = self.load_alias_or_file(cached_path, ctx)? { - return Ok(Some(path)); - } - } - // 2. If X.js is a file, load X.js as JavaScript text. STOP - // 3. If X.json is a file, parse X.json to a JavaScript Object. STOP - // 4. If X.node is a file, load X.node as binary addon. STOP - if let Some(path) = self.load_extensions(cached_path, &self.options.extensions, ctx)? { - return Ok(Some(path)); - } - Ok(None) - } - - fn load_as_directory(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - // TODO: Only package.json is supported, so warn about having other values - // Checking for empty files is needed for omitting checks on package.json - // 1. If X/package.json is a file, - if !self.options.description_files.is_empty() { - // a. Parse X/package.json, and look for "main" field. - if let Some(package_json) = - cached_path.package_json(&self.cache.fs, &self.options, ctx)? - { - // b. If "main" is a falsy value, GOTO 2. - for main_field in package_json.main_fields(&self.options.main_fields) { - // c. let M = X + (json main field) - let main_field_path = cached_path.path().normalize_with(main_field); - // d. LOAD_AS_FILE(M) - let cached_path = self.cache.value(&main_field_path); - if let Some(path) = self.load_as_file(&cached_path, ctx)? { - return Ok(Some(path)); - } - // e. LOAD_INDEX(M) - if let Some(path) = self.load_index(&cached_path, ctx)? { - return Ok(Some(path)); - } - } - // f. LOAD_INDEX(X) DEPRECATED - // g. THROW "not found" - } - } - // 2. LOAD_INDEX(X) - self.load_index(cached_path, ctx) - } - - fn load_as_file_or_directory( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - if self.options.resolve_to_context { - return Ok(cached_path.is_dir(&self.cache.fs, ctx).then(|| cached_path.clone())); - } - if !specifier.ends_with('/') { - if let Some(path) = self.load_as_file(cached_path, ctx)? { - return Ok(Some(path)); - } - } - if cached_path.is_dir(&self.cache.fs, ctx) { - if let Some(path) = self.load_as_directory(cached_path, ctx)? { - return Ok(Some(path)); - } - } - Ok(None) - } - - fn load_extensions( - &self, - path: &CachedPath, - extensions: &[String], - ctx: &mut Ctx, - ) -> ResolveResult { - if ctx.fully_specified { - return Ok(None); - } - let path = path.path().as_os_str(); - for extension in extensions { - let mut path_with_extension = path.to_os_string(); - path_with_extension.reserve_exact(extension.len()); - path_with_extension.push(extension); - let cached_path = self.cache.value(Path::new(&path_with_extension)); - if let Some(path) = self.load_alias_or_file(&cached_path, ctx)? { - return Ok(Some(path)); - } - } - Ok(None) - } - - fn load_realpath(&self, cached_path: &CachedPath) -> Result { - if self.options.symlinks { - cached_path.realpath(&self.cache.fs).map_err(ResolveError::from) - } else { - Ok(cached_path.to_path_buf()) - } - } - - fn check_restrictions(&self, path: &Path) -> Result<(), ResolveError> { - // https://github.com/webpack/enhanced-resolve/blob/a998c7d218b7a9ec2461fc4fddd1ad5dd7687485/lib/RestrictionsPlugin.js#L19-L24 - fn is_inside(path: &Path, parent: &Path) -> bool { - if !path.starts_with(parent) { - return false; - } - if path.as_os_str().len() == parent.as_os_str().len() { - return true; - } - path.strip_prefix(parent).is_ok_and(|p| p == Path::new("./")) - } - for restriction in &self.options.restrictions { - match restriction { - Restriction::Path(restricted_path) => { - if !is_inside(path, restricted_path) { - return Err(ResolveError::Restriction( - path.to_path_buf(), - restricted_path.clone(), - )); - } - } - Restriction::RegExp(_) => { - return Err(ResolveError::Unimplemented("Restriction with regex")) - } - } - } - Ok(()) - } - - fn load_index(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - for main_file in &self.options.main_files { - let main_path = cached_path.path().normalize_with(main_file); - let cached_path = self.cache.value(&main_path); - if self.options.enforce_extension.is_disabled() { - if let Some(path) = self.load_alias_or_file(&cached_path, ctx)? { - return Ok(Some(path)); - } - } - // 1. If X/index.js is a file, load X/index.js as JavaScript text. STOP - // 2. If X/index.json is a file, parse X/index.json to a JavaScript object. STOP - // 3. If X/index.node is a file, load X/index.node as binary addon. STOP - if let Some(path) = self.load_extensions(&cached_path, &self.options.extensions, ctx)? { - return Ok(Some(path)); - } - } - Ok(None) - } - - fn load_alias_or_file(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - if !self.options.alias_fields.is_empty() { - if let Some(package_json) = - cached_path.find_package_json(&self.cache.fs, &self.options, ctx)? - { - if let Some(path) = - self.load_browser_field(cached_path, None, &package_json, ctx)? - { - return Ok(Some(path)); - } - } - } - // enhanced-resolve: try file as alias - let alias_specifier = cached_path.path().to_string_lossy(); - if let Some(path) = - self.load_alias(cached_path, &alias_specifier, &self.options.alias, ctx)? - { - return Ok(Some(path)); - } - if cached_path.is_file(&self.cache.fs, ctx) { - return Ok(Some(cached_path.clone())); - } - Ok(None) - } - - fn load_node_modules( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - #[cfg(feature = "yarn_pnp")] - { - if let Some(resolved_path) = self.load_pnp(cached_path, specifier, ctx)? { - return Ok(Some(resolved_path)); - } - } - - let (package_name, subpath) = Self::parse_package_specifier(specifier); - // 1. let DIRS = NODE_MODULES_PATHS(START) - // 2. for each DIR in DIRS: - for module_name in &self.options.modules { - for cached_path in std::iter::successors(Some(cached_path), |p| p.parent()) { - // Skip if /path/to/node_modules does not exist - if !cached_path.is_dir(&self.cache.fs, ctx) { - continue; - } - - let Some(cached_path) = self.get_module_directory(cached_path, module_name, ctx) - else { - continue; - }; - // Optimize node_modules lookup by inspecting whether the package exists - // From LOAD_PACKAGE_EXPORTS(X, DIR) - // 1. Try to interpret X as a combination of NAME and SUBPATH where the name - // may have a @scope/ prefix and the subpath begins with a slash (`/`). - if !package_name.is_empty() { - let package_path = cached_path.path().normalize_with(package_name); - let cached_path = self.cache.value(&package_path); - // Try foo/node_modules/package_name - if cached_path.is_dir(&self.cache.fs, ctx) { - // a. LOAD_PACKAGE_EXPORTS(X, DIR) - if let Some(path) = - self.load_package_exports(specifier, subpath, &cached_path, ctx)? - { - return Ok(Some(path)); - } - } else { - // foo/node_modules/package_name is not a directory, so useless to check inside it - if !subpath.is_empty() { - continue; - } - // Skip if the directory lead to the scope package does not exist - // i.e. `foo/node_modules/@scope` is not a directory for `foo/node_modules/@scope/package` - if package_name.starts_with('@') { - if let Some(path) = cached_path.parent() { - if !path.is_dir(&self.cache.fs, ctx) { - continue; - } - } - } - } - } - - // Try as file or directory for all other cases - // b. LOAD_AS_FILE(DIR/X) - // c. LOAD_AS_DIRECTORY(DIR/X) - let node_module_file = cached_path.path().normalize_with(specifier); - let cached_path = self.cache.value(&node_module_file); - if let Some(path) = self.load_as_file_or_directory(&cached_path, specifier, ctx)? { - return Ok(Some(path)); - } - } - } - Ok(None) - } - - #[cfg(feature = "yarn_pnp")] - fn load_pnp( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result, ResolveError> { - let Some(pnp_manifest) = &self.options.pnp_manifest else { return Ok(None) }; - let resolution = - pnp::resolve_to_unqualified_via_manifest(pnp_manifest, specifier, cached_path.path()); - match resolution { - Ok(pnp::Resolution::Resolved(path, subpath)) => { - let cached_path = self.cache.value(&path); - let export_resolution = self.load_package_exports( - specifier, - &subpath.unwrap_or_default(), - &cached_path, - ctx, - )?; - if export_resolution.is_some() { - return Ok(export_resolution); - } - let file_or_directory_resolution = - self.load_as_file_or_directory(&cached_path, specifier, ctx)?; - if file_or_directory_resolution.is_some() { - return Ok(file_or_directory_resolution); - } - Err(ResolveError::NotFound(specifier.to_string())) - } - - Ok(pnp::Resolution::Skipped) => Ok(None), - - Err(_) => { - // Todo: Add a ResolveError::Pnp variant? - Err(ResolveError::NotFound(specifier.to_string())) - } - } - } - - fn get_module_directory( - &self, - cached_path: &CachedPath, - module_name: &str, - ctx: &mut Ctx, - ) -> Option { - if module_name == "node_modules" { - cached_path.cached_node_modules(&self.cache, ctx) - } else if cached_path.path().components().next_back() - == Some(Component::Normal(OsStr::new(module_name))) - { - Some(cached_path.clone()) - } else { - cached_path.module_directory(module_name, &self.cache, ctx) - } - } - - fn load_package_exports( - &self, - specifier: &str, - subpath: &str, - cached_path: &CachedPath, - ctx: &mut Ctx, - ) -> ResolveResult { - // 2. If X does not match this pattern or DIR/NAME/package.json is not a file, - // return. - let Some(package_json) = cached_path.package_json(&self.cache.fs, &self.options, ctx)? - else { - return Ok(None); - }; - // 3. Parse DIR/NAME/package.json, and look for "exports" field. - // 4. If "exports" is null or undefined, return. - // 5. let MATCH = PACKAGE_EXPORTS_RESOLVE(pathToFileURL(DIR/NAME), "." + SUBPATH, - // `package.json` "exports", ["node", "require"]) defined in the ESM resolver. - // Note: The subpath is not prepended with a dot on purpose - for exports in package_json.exports_fields(&self.options.exports_fields) { - if let Some(path) = self.package_exports_resolve( - cached_path.path(), - &format!(".{subpath}"), - exports, - ctx, - )? { - // 6. RESOLVE_ESM_MATCH(MATCH) - return self.resolve_esm_match(specifier, &path, ctx); - }; - } - Ok(None) - } - - fn load_package_self( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - // 1. Find the closest package scope SCOPE to DIR. - // 2. If no scope was found, return. - let Some(package_json) = - cached_path.find_package_json(&self.cache.fs, &self.options, ctx)? - else { - return Ok(None); - }; - // 3. If the SCOPE/package.json "exports" is null or undefined, return. - // 4. If the SCOPE/package.json "name" is not the first segment of X, return. - if let Some(subpath) = package_json - .name - .as_ref() - .and_then(|package_name| Self::strip_package_name(specifier, package_name)) - { - // 5. let MATCH = PACKAGE_EXPORTS_RESOLVE(pathToFileURL(SCOPE), - // "." + X.slice("name".length), `package.json` "exports", ["node", "require"]) - // defined in the ESM resolver. - let package_url = package_json.directory(); - // Note: The subpath is not prepended with a dot on purpose - // because `package_exports_resolve` matches subpath without the leading dot. - for exports in package_json.exports_fields(&self.options.exports_fields) { - if let Some(cached_path) = - self.package_exports_resolve(package_url, &format!(".{subpath}"), exports, ctx)? - { - // 6. RESOLVE_ESM_MATCH(MATCH) - return self.resolve_esm_match(specifier, &cached_path, ctx); - } - } - } - self.load_browser_field(cached_path, Some(specifier), &package_json, ctx) - } - - /// RESOLVE_ESM_MATCH(MATCH) - fn resolve_esm_match( - &self, - specifier: &str, - cached_path: &CachedPath, - ctx: &mut Ctx, - ) -> ResolveResult { - // 1. let RESOLVED_PATH = fileURLToPath(MATCH) - // 2. If the file at RESOLVED_PATH exists, load RESOLVED_PATH as its extension format. STOP - // - // Non-compliant ESM can result in a directory, so directory is tried as well. - if let Some(path) = self.load_as_file_or_directory(cached_path, "", ctx)? { - return Ok(Some(path)); - } - // 3. THROW "not found" - Err(ResolveError::NotFound(specifier.to_string())) - } - - /// enhanced-resolve: AliasFieldPlugin for [ResolveOptions::alias_fields] - fn load_browser_field( - &self, - cached_path: &CachedPath, - module_specifier: Option<&str>, - package_json: &PackageJson, - ctx: &mut Ctx, - ) -> ResolveResult { - let path = cached_path.path(); - let Some(new_specifier) = package_json.resolve_browser_field( - path, - module_specifier, - &self.options.alias_fields, - )? - else { - return Ok(None); - }; - // Abort when resolving recursive module - if module_specifier.is_some_and(|s| s == new_specifier) { - return Ok(None); - } - if ctx.resolving_alias.as_ref().is_some_and(|s| s == new_specifier) { - // Complete when resolving to self `{"./a.js": "./a.js"}` - if new_specifier.strip_prefix("./").filter(|s| path.ends_with(Path::new(s))).is_some() { - return if cached_path.is_file(&self.cache.fs, ctx) { - Ok(Some(cached_path.clone())) - } else { - Err(ResolveError::NotFound(new_specifier.to_string())) - }; - } - return Err(ResolveError::Recursion); - } - ctx.with_resolving_alias(new_specifier.to_string()); - ctx.with_fully_specified(false); - let cached_path = self.cache.value(package_json.directory()); - self.require(&cached_path, new_specifier, ctx).map(Some) - } - - /// enhanced-resolve: AliasPlugin for [ResolveOptions::alias] and [ResolveOptions::fallback]. - fn load_alias( - &self, - cached_path: &CachedPath, - specifier: &str, - aliases: &Alias, - ctx: &mut Ctx, - ) -> ResolveResult { - for (alias_key_raw, specifiers) in aliases { - let alias_key = if let Some(alias_key) = alias_key_raw.strip_suffix('$') { - if alias_key != specifier { - continue; - } - alias_key - } else { - let strip_package_name = Self::strip_package_name(specifier, alias_key_raw); - if strip_package_name.is_none() { - continue; - } - alias_key_raw - }; - // It should stop resolving when all of the tried alias values - // failed to resolve. - // - let mut should_stop = false; - for r in specifiers { - match r { - AliasValue::Path(alias_value) => { - if let Some(path) = self.load_alias_value( - cached_path, - alias_key, - alias_value, - specifier, - ctx, - &mut should_stop, - )? { - return Ok(Some(path)); - } - } - AliasValue::Ignore => { - let path = cached_path.path().normalize_with(alias_key); - return Err(ResolveError::Ignored(path)); - } - } - } - if should_stop { - return Err(ResolveError::MatchedAliasNotFound( - specifier.to_string(), - alias_key.to_string(), - )); - } - } - Ok(None) - } - - fn load_alias_value( - &self, - cached_path: &CachedPath, - alias_key: &str, - alias_value: &str, - request: &str, - ctx: &mut Ctx, - should_stop: &mut bool, - ) -> ResolveResult { - if request != alias_value - && !request.strip_prefix(alias_value).is_some_and(|prefix| prefix.starts_with('/')) - { - let tail = &request[alias_key.len()..]; - - let new_specifier = if tail.is_empty() { - Cow::Borrowed(alias_value) - } else { - let alias_value = Path::new(alias_value).normalize(); - // Must not append anything to alias_value if it is a file. - let alias_value_cached_path = self.cache.value(&alias_value); - if alias_value_cached_path.is_file(&self.cache.fs, ctx) { - return Ok(None); - } - - // Remove the leading slash so the final path is concatenated. - let tail = tail.trim_start_matches(SLASH_START); - let normalized = alias_value.normalize_with(tail); - Cow::Owned(normalized.to_string_lossy().to_string()) - }; - - *should_stop = true; - ctx.with_fully_specified(false); - return match self.require(cached_path, new_specifier.as_ref(), ctx) { - Err(ResolveError::NotFound(_) | ResolveError::MatchedAliasNotFound(_, _)) => { - Ok(None) - } - Ok(path) => return Ok(Some(path)), - Err(err) => return Err(err), - }; - } - Ok(None) - } - - /// Given an extension alias map `{".js": [".ts", ".js"]}`, - /// load the mapping instead of the provided extension - /// - /// This is an enhanced-resolve feature - /// - /// # Errors - /// - /// * [ResolveError::ExtensionAlias]: When all of the aliased extensions are not found - fn load_extension_alias(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - if self.options.extension_alias.is_empty() { - return Ok(None); - } - let Some(path_extension) = cached_path.path().extension() else { - return Ok(None); - }; - let Some((_, extensions)) = self - .options - .extension_alias - .iter() - .find(|(ext, _)| OsStr::new(ext.trim_start_matches('.')) == path_extension) - else { - return Ok(None); - }; - let path = cached_path.path().with_extension(""); - let path = path.as_os_str(); - ctx.with_fully_specified(true); - for extension in extensions { - let mut path_with_extension = path.to_os_string(); - path_with_extension.reserve_exact(extension.len()); - path_with_extension.push(extension); - let cached_path = self.cache.value(Path::new(&path_with_extension)); - // Bail if path is module directory such as `ipaddr.js` - if cached_path.is_dir(&self.cache.fs, ctx) { - ctx.with_fully_specified(false); - return Ok(None); - } - if let Some(path) = self.load_alias_or_file(&cached_path, ctx)? { - ctx.with_fully_specified(false); - return Ok(Some(path)); - } - } - Err(ResolveError::ExtensionAlias(cached_path.to_path_buf())) - } - - /// enhanced-resolve: RootsPlugin - /// - /// A list of directories where requests of server-relative URLs (starting with '/') are resolved, - /// defaults to context configuration option. - /// - /// On non-Windows systems these requests are resolved as an absolute path first. - fn load_roots(&self, specifier: &str, ctx: &mut Ctx) -> Option { - if self.options.roots.is_empty() { - return None; - } - if let Some(specifier) = specifier.strip_prefix(SLASH_START) { - for root in &self.options.roots { - let cached_path = self.cache.value(root); - if let Ok(path) = self.require_relative(&cached_path, specifier, ctx) { - return Some(path); - } - } - } - None - } - - fn load_tsconfig_paths( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - let Some(tsconfig_options) = &self.options.tsconfig else { - return Ok(None); - }; - let tsconfig = self.load_tsconfig( - /* root */ true, - &tsconfig_options.config_file, - &tsconfig_options.references, - )?; - let paths = tsconfig.resolve(cached_path.path(), specifier); - for path in paths { - let cached_path = self.cache.value(&path); - if let Ok(path) = self.require_relative(&cached_path, ".", ctx) { - return Ok(Some(path)); - } - } - Ok(None) - } - - fn load_tsconfig( - &self, - root: bool, - path: &Path, - references: &TsconfigReferences, - ) -> Result, ResolveError> { - self.cache.tsconfig(root, path, |tsconfig| { - let directory = self.cache.value(tsconfig.directory()); - tracing::trace!(tsconfig = ?tsconfig, "load_tsconfig"); - - // Extend tsconfig - if let Some(extends) = &tsconfig.extends { - let extended_tsconfig_paths = match extends { - ExtendsField::Single(s) => { - vec![self.get_extended_tsconfig_path(&directory, tsconfig, s)?] - } - ExtendsField::Multiple(specifiers) => specifiers - .iter() - .map(|s| self.get_extended_tsconfig_path(&directory, tsconfig, s)) - .collect::, ResolveError>>()?, - }; - for extended_tsconfig_path in extended_tsconfig_paths { - let extended_tsconfig = self.load_tsconfig( - /* root */ false, - &extended_tsconfig_path, - &TsconfigReferences::Disabled, - )?; - tsconfig.extend_tsconfig(&extended_tsconfig); - } - } - - // Load project references - match references { - TsconfigReferences::Disabled => { - tsconfig.references.drain(..); - } - TsconfigReferences::Auto => {} - TsconfigReferences::Paths(paths) => { - tsconfig.references = paths - .iter() - .map(|path| ProjectReference { path: path.clone(), tsconfig: None }) - .collect(); - } - } - if !tsconfig.references.is_empty() { - let directory = tsconfig.directory().to_path_buf(); - for reference in &mut tsconfig.references { - let reference_tsconfig_path = directory.normalize_with(&reference.path); - let tsconfig = self.cache.tsconfig( - /* root */ true, - &reference_tsconfig_path, - |reference_tsconfig| { - if reference_tsconfig.path == tsconfig.path { - return Err(ResolveError::TsconfigSelfReference( - reference_tsconfig.path.clone(), - )); - } - Ok(()) - }, - )?; - reference.tsconfig.replace(tsconfig); - } - } - Ok(()) - }) - } - - fn get_extended_tsconfig_path( - &self, - directory: &CachedPath, - tsconfig: &TsConfig, - specifier: &str, - ) -> Result { - match specifier.as_bytes().first() { - None => Err(ResolveError::Specifier(SpecifierError::Empty(specifier.to_string()))), - Some(b'/') => Ok(PathBuf::from(specifier)), - Some(b'.') => Ok(tsconfig.directory().normalize_with(specifier)), - _ => self - .clone_with_options(ResolveOptions { - description_files: vec![], - extensions: vec![".json".into()], - main_files: vec!["tsconfig.json".into()], - ..ResolveOptions::default() - }) - .load_package_self_or_node_modules(directory, specifier, &mut Ctx::default()) - .map(|p| p.to_path_buf()) - .map_err(|err| match err { - ResolveError::NotFound(_) => { - ResolveError::TsconfigNotFound(PathBuf::from(specifier)) - } - _ => err, - }), - } - } - - /// PACKAGE_RESOLVE(packageSpecifier, parentURL) - fn package_resolve( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - let (package_name, subpath) = Self::parse_package_specifier(specifier); - - // 3. If packageSpecifier is a Node.js builtin module name, then - // 1. Return the string "node:" concatenated with packageSpecifier. - self.require_core(package_name)?; - - // 11. While parentURL is not the file system root, - for module_name in &self.options.modules { - for cached_path in std::iter::successors(Some(cached_path), |p| p.parent()) { - // 1. Let packageURL be the URL resolution of "node_modules/" concatenated with packageSpecifier, relative to parentURL. - let Some(cached_path) = self.get_module_directory(cached_path, module_name, ctx) - else { - continue; - }; - // 2. Set parentURL to the parent folder URL of parentURL. - let package_path = cached_path.path().normalize_with(package_name); - let cached_path = self.cache.value(&package_path); - // 3. If the folder at packageURL does not exist, then - // 1. Continue the next loop iteration. - if cached_path.is_dir(&self.cache.fs, ctx) { - // 4. Let pjson be the result of READ_PACKAGE_JSON(packageURL). - if let Some(package_json) = - cached_path.package_json(&self.cache.fs, &self.options, ctx)? - { - // 5. If pjson is not null and pjson.exports is not null or undefined, then - // 1. Return the result of PACKAGE_EXPORTS_RESOLVE(packageURL, packageSubpath, pjson.exports, defaultConditions). - for exports in package_json.exports_fields(&self.options.exports_fields) { - if let Some(path) = self.package_exports_resolve( - cached_path.path(), - &format!(".{subpath}"), - exports, - ctx, - )? { - return Ok(Some(path)); - } - } - // 6. Otherwise, if packageSubpath is equal to ".", then - if subpath == "." { - // 1. If pjson.main is a string, then - for main_field in package_json.main_fields(&self.options.main_fields) { - // 1. Return the URL resolution of main in packageURL. - let path = cached_path.path().normalize_with(main_field); - let cached_path = self.cache.value(&path); - if cached_path.is_file(&self.cache.fs, ctx) { - return Ok(Some(cached_path)); - } - } - } - } - let subpath = format!(".{subpath}"); - ctx.with_fully_specified(false); - return self.require(&cached_path, &subpath, ctx).map(Some); - } - } - } - - Err(ResolveError::NotFound(specifier.to_string())) - } - - /// PACKAGE_EXPORTS_RESOLVE(packageURL, subpath, exports, conditions) - fn package_exports_resolve( - &self, - package_url: &Path, - subpath: &str, - exports: &JSONValue, - ctx: &mut Ctx, - ) -> ResolveResult { - let conditions = &self.options.condition_names; - // 1. If exports is an Object with both a key starting with "." and a key not starting with ".", throw an Invalid Package Configuration error. - if let JSONValue::Object(map) = exports { - let mut has_dot = false; - let mut without_dot = false; - for key in map.keys() { - let starts_with_dot_or_hash = key.starts_with(['.', '#']); - has_dot = has_dot || starts_with_dot_or_hash; - without_dot = without_dot || !starts_with_dot_or_hash; - if has_dot && without_dot { - return Err(ResolveError::InvalidPackageConfig( - package_url.join("package.json"), - )); - } - } - } - // 2. If subpath is equal to ".", then - // Note: subpath is not prepended with a dot when passed in. - if subpath == "." { - // enhanced-resolve appends query and fragment when resolving exports field - // https://github.com/webpack/enhanced-resolve/blob/a998c7d218b7a9ec2461fc4fddd1ad5dd7687485/lib/ExportsFieldPlugin.js#L57-L62 - // This is only need when querying the main export, otherwise ctx is passed through. - if ctx.query.is_some() || ctx.fragment.is_some() { - let query = ctx.query.clone().unwrap_or_default(); - let fragment = ctx.fragment.clone().unwrap_or_default(); - return Err(ResolveError::PackagePathNotExported( - format!("./{}{query}{fragment}", subpath.trim_start_matches('.')), - package_url.join("package.json"), - )); - } - // 1. Let mainExport be undefined. - let main_export = match exports { - // 2. If exports is a String or Array, or an Object containing no keys starting with ".", then - JSONValue::String(_) | JSONValue::Array(_) => { - // 1. Set mainExport to exports. - Some(exports) - } - // 3. Otherwise if exports is an Object containing a "." property, then - JSONValue::Object(map) => { - // 1. Set mainExport to exports["."]. - map.get(".").map_or_else( - || { - if map.keys().any(|key| key.starts_with("./") || key.starts_with('#')) { - None - } else { - Some(exports) - } - }, - Some, - ) - } - _ => None, - }; - // 4. If mainExport is not undefined, then - if let Some(main_export) = main_export { - // 1. Let resolved be the result of PACKAGE_TARGET_RESOLVE( packageURL, mainExport, null, false, conditions). - let resolved = self.package_target_resolve( - package_url, - ".", - main_export, - None, - /* is_imports */ false, - conditions, - ctx, - )?; - // 2. If resolved is not null or undefined, return resolved. - if let Some(path) = resolved { - return Ok(Some(path)); - } - } - } - // 3. Otherwise, if exports is an Object and all keys of exports start with ".", then - if let JSONValue::Object(exports) = exports { - // 1. Let matchKey be the string "./" concatenated with subpath. - // Note: `package_imports_exports_resolve` does not require the leading dot. - let match_key = &subpath; - // 2. Let resolved be the result of PACKAGE_IMPORTS_EXPORTS_RESOLVE( matchKey, exports, packageURL, false, conditions). - if let Some(path) = self.package_imports_exports_resolve( - match_key, - exports, - package_url, - /* is_imports */ false, - conditions, - ctx, - )? { - // 3. If resolved is not null or undefined, return resolved. - return Ok(Some(path)); - } - } - // 4. Throw a Package Path Not Exported error. - Err(ResolveError::PackagePathNotExported( - subpath.to_string(), - package_url.join("package.json"), - )) - } - - /// PACKAGE_IMPORTS_RESOLVE(specifier, parentURL, conditions) - fn package_imports_resolve( - &self, - specifier: &str, - package_json: &PackageJson, - ctx: &mut Ctx, - ) -> Result, ResolveError> { - // 1. Assert: specifier begins with "#". - debug_assert!(specifier.starts_with('#'), "{specifier}"); - // 2. If specifier is exactly equal to "#" or starts with "#/", then - // 1. Throw an Invalid Module Specifier error. - // 3. Let packageURL be the result of LOOKUP_PACKAGE_SCOPE(parentURL). - // 4. If packageURL is not null, then - - // 1. Let pjson be the result of READ_PACKAGE_JSON(packageURL). - // 2. If pjson.imports is a non-null Object, then - - // 1. Let resolved be the result of PACKAGE_IMPORTS_EXPORTS_RESOLVE( specifier, pjson.imports, packageURL, true, conditions). - let mut has_imports = false; - for imports in package_json.imports_fields(&self.options.imports_fields) { - if !has_imports { - has_imports = true; - // TODO: fill in test case for this case - if specifier == "#" || specifier.starts_with("#/") { - return Err(ResolveError::InvalidModuleSpecifier( - specifier.to_string(), - package_json.path.clone(), - )); - } - } - if let Some(path) = self.package_imports_exports_resolve( - specifier, - imports, - package_json.directory(), - /* is_imports */ true, - &self.options.condition_names, - ctx, - )? { - // 2. If resolved is not null or undefined, return resolved. - return Ok(Some(path)); - } - } - - // 5. Throw a Package Import Not Defined error. - if has_imports { - Err(ResolveError::PackageImportNotDefined( - specifier.to_string(), - package_json.path.clone(), - )) - } else { - Ok(None) - } - } - - /// PACKAGE_IMPORTS_EXPORTS_RESOLVE(matchKey, matchObj, packageURL, isImports, conditions) - fn package_imports_exports_resolve( - &self, - match_key: &str, - match_obj: &JSONMap, - package_url: &Path, - is_imports: bool, - conditions: &[String], - ctx: &mut Ctx, - ) -> ResolveResult { - // enhanced-resolve behaves differently, it throws - // Error: CachedPath to directories is not possible with the exports field (specifier was ./dist/) - if match_key.ends_with('/') { - return Ok(None); - } - // 1. If matchKey is a key of matchObj and does not contain "*", then - if !match_key.contains('*') { - // 1. Let target be the value of matchObj[matchKey]. - if let Some(target) = match_obj.get(match_key) { - // 2. Return the result of PACKAGE_TARGET_RESOLVE(packageURL, target, null, isImports, conditions). - return self.package_target_resolve( - package_url, - match_key, - target, - None, - is_imports, - conditions, - ctx, - ); - } - } - - let mut best_target = None; - let mut best_match = ""; - let mut best_key = ""; - // 2. Let expansionKeys be the list of keys of matchObj containing only a single "*", sorted by the sorting function PATTERN_KEY_COMPARE which orders in descending order of specificity. - // 3. For each key expansionKey in expansionKeys, do - for (expansion_key, target) in match_obj { - if expansion_key.starts_with("./") || expansion_key.starts_with('#') { - // 1. Let patternBase be the substring of expansionKey up to but excluding the first "*" character. - if let Some((pattern_base, pattern_trailer)) = expansion_key.split_once('*') { - // 2. If matchKey starts with but is not equal to patternBase, then - if match_key.starts_with(pattern_base) - // 1. Let patternTrailer be the substring of expansionKey from the index after the first "*" character. - && !pattern_trailer.contains('*') - // 2. If patternTrailer has zero length, or if matchKey ends with patternTrailer and the length of matchKey is greater than or equal to the length of expansionKey, then - && (pattern_trailer.is_empty() - || (match_key.len() >= expansion_key.len() - && match_key.ends_with(pattern_trailer))) - && Self::pattern_key_compare(best_key, expansion_key).is_gt() - { - // 1. Let target be the value of matchObj[expansionKey]. - best_target = Some(target); - // 2. Let patternMatch be the substring of matchKey starting at the index of the length of patternBase up to the length of matchKey minus the length of patternTrailer. - best_match = - &match_key[pattern_base.len()..match_key.len() - pattern_trailer.len()]; - best_key = expansion_key; - } - } else if expansion_key.ends_with('/') - && match_key.starts_with(expansion_key) - && Self::pattern_key_compare(best_key, expansion_key).is_gt() - { - // TODO: [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./dist/" in the "exports" field module resolution of the package at xxx/package.json. - best_target = Some(target); - best_match = &match_key[expansion_key.len()..]; - best_key = expansion_key; - } - } - } - if let Some(best_target) = best_target { - // 3. Return the result of PACKAGE_TARGET_RESOLVE(packageURL, target, patternMatch, isImports, conditions). - return self.package_target_resolve( - package_url, - best_key, - best_target, - Some(best_match), - is_imports, - conditions, - ctx, - ); - } - // 4. Return null. - Ok(None) - } - - /// PACKAGE_TARGET_RESOLVE(packageURL, target, patternMatch, isImports, conditions) - #[allow(clippy::too_many_arguments)] - fn package_target_resolve( - &self, - package_url: &Path, - target_key: &str, - target: &JSONValue, - pattern_match: Option<&str>, - is_imports: bool, - conditions: &[String], - ctx: &mut Ctx, - ) -> ResolveResult { - fn normalize_string_target<'a>( - target_key: &'a str, - target: &'a str, - pattern_match: Option<&'a str>, - package_url: &Path, - ) -> Result, ResolveError> { - let target = if let Some(pattern_match) = pattern_match { - if !target_key.contains('*') && !target.contains('*') { - // enhanced-resolve behaviour - // TODO: [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./dist/" in the "exports" field module resolution of the package at xxx/package.json. - if target_key.ends_with('/') && target.ends_with('/') { - Cow::Owned(format!("{target}{pattern_match}")) - } else { - return Err(ResolveError::InvalidPackageConfigDirectory( - package_url.join("package.json"), - )); - } - } else { - Cow::Owned(target.replace('*', pattern_match)) - } - } else { - Cow::Borrowed(target) - }; - Ok(target) - } - - match target { - // 1. If target is a String, then - JSONValue::String(target) => { - // 1. If target does not start with "./", then - if !target.starts_with("./") { - // 1. If isImports is false, or if target starts with "../" or "/", or if target is a valid URL, then - if !is_imports || target.starts_with("../") || target.starts_with('/') { - // 1. Throw an Invalid Package Target error. - return Err(ResolveError::InvalidPackageTarget( - target.to_string(), - target_key.to_string(), - package_url.join("package.json"), - )); - } - // 2. If patternMatch is a String, then - // 1. Return PACKAGE_RESOLVE(target with every instance of "*" replaced by patternMatch, packageURL + "/"). - let target = - normalize_string_target(target_key, target, pattern_match, package_url)?; - let package_url = self.cache.value(package_url); - // // 3. Return PACKAGE_RESOLVE(target, packageURL + "/"). - return self.package_resolve(&package_url, &target, ctx); - } - - // 2. If target split on "/" or "\" contains any "", ".", "..", or "node_modules" segments after the first "." segment, case insensitive and including percent encoded variants, throw an Invalid Package Target error. - // 3. Let resolvedTarget be the URL resolution of the concatenation of packageURL and target. - // 4. Assert: resolvedTarget is contained in packageURL. - // 5. If patternMatch is null, then - let target = - normalize_string_target(target_key, target, pattern_match, package_url)?; - if Path::new(target.as_ref()).is_invalid_exports_target() { - return Err(ResolveError::InvalidPackageTarget( - target.to_string(), - target_key.to_string(), - package_url.join("package.json"), - )); - } - let resolved_target = package_url.normalize_with(target.as_ref()); - // 6. If patternMatch split on "/" or "\" contains any "", ".", "..", or "node_modules" segments, case insensitive and including percent encoded variants, throw an Invalid Module Specifier error. - // 7. Return the URL resolution of resolvedTarget with every instance of "*" replaced with patternMatch. - let value = self.cache.value(&resolved_target); - return Ok(Some(value)); - } - // 2. Otherwise, if target is a non-null Object, then - JSONValue::Object(target) => { - // 1. If exports contains any index property keys, as defined in ECMA-262 6.1.7 Array Index, throw an Invalid Package Configuration error. - // 2. For each property p of target, in object insertion order as, - for (key, target_value) in target { - // 1. If p equals "default" or conditions contains an entry for p, then - if key == "default" || conditions.contains(key) { - // 1. Let targetValue be the value of the p property in target. - // 2. Let resolved be the result of PACKAGE_TARGET_RESOLVE( packageURL, targetValue, patternMatch, isImports, conditions). - let resolved = self.package_target_resolve( - package_url, - target_key, - target_value, - pattern_match, - is_imports, - conditions, - ctx, - ); - // 3. If resolved is equal to undefined, continue the loop. - if let Some(path) = resolved? { - // 4. Return resolved. - return Ok(Some(path)); - } - } - } - // 3. Return undefined. - return Ok(None); - } - // 3. Otherwise, if target is an Array, then - JSONValue::Array(targets) => { - // 1. If _target.length is zero, return null. - if targets.is_empty() { - // Note: return PackagePathNotExported has the same effect as return because there are no matches. - return Err(ResolveError::PackagePathNotExported( - pattern_match.unwrap_or(".").to_string(), - package_url.join("package.json"), - )); - } - // 2. For each item targetValue in target, do - for (i, target_value) in targets.iter().enumerate() { - // 1. Let resolved be the result of PACKAGE_TARGET_RESOLVE( packageURL, targetValue, patternMatch, isImports, conditions), continuing the loop on any Invalid Package Target error. - let resolved = self.package_target_resolve( - package_url, - target_key, - target_value, - pattern_match, - is_imports, - conditions, - ctx, - ); - - if resolved.is_err() && i == targets.len() { - return resolved; - } - - // 2. If resolved is undefined, continue the loop. - if let Ok(Some(path)) = resolved { - // 3. Return resolved. - return Ok(Some(path)); - } - } - // 3. Return or throw the last fallback resolution null return or error. - // Note: see `resolved.is_err() && i == targets.len()` - } - _ => {} - } - // 4. Otherwise, if target is null, return null. - Ok(None) - // 5. Otherwise throw an Invalid Package Target error. - } - - // Returns (module, subpath) - // https://github.com/nodejs/node/blob/8f0f17e1e3b6c4e58ce748e06343c5304062c491/lib/internal/modules/esm/resolve.js#L688 - fn parse_package_specifier(specifier: &str) -> (&str, &str) { - let mut separator_index = specifier.as_bytes().iter().position(|b| *b == b'/'); - // let mut valid_package_name = true; - // let mut is_scoped = false; - if specifier.starts_with('@') { - // is_scoped = true; - if separator_index.is_none() || specifier.is_empty() { - // valid_package_name = false; - } else if let Some(index) = &separator_index { - separator_index = specifier[*index + 1..] - .as_bytes() - .iter() - .position(|b| *b == b'/') - .map(|i| i + *index + 1); - } - } - let package_name = - separator_index.map_or(specifier, |separator_index| &specifier[..separator_index]); - - // TODO: https://github.com/nodejs/node/blob/8f0f17e1e3b6c4e58ce748e06343c5304062c491/lib/internal/modules/esm/resolve.js#L705C1-L714C1 - // Package name cannot have leading . and cannot have percent-encoding or - // \\ separators. - // if (RegExpPrototypeExec(invalidPackageNameRegEx, packageName) !== null) - // validPackageName = false; - - // if (!validPackageName) { - // throw new ERR_INVALID_MODULE_SPECIFIER( - // specifier, 'is not a valid package name', fileURLToPath(base)); - // } - let package_subpath = - separator_index.map_or("", |separator_index| &specifier[separator_index..]); - (package_name, package_subpath) - } - - /// PATTERN_KEY_COMPARE(keyA, keyB) - fn pattern_key_compare(key_a: &str, key_b: &str) -> Ordering { - if key_a.is_empty() { - return Ordering::Greater; - } - // 1. Assert: keyA ends with "/" or contains only a single "*". - debug_assert!(key_a.ends_with('/') || key_a.match_indices('*').count() == 1, "{key_a}"); - // 2. Assert: keyB ends with "/" or contains only a single "*". - debug_assert!(key_b.ends_with('/') || key_b.match_indices('*').count() == 1, "{key_b}"); - // 3. Let baseLengthA be the index of "*" in keyA plus one, if keyA contains "*", or the length of keyA otherwise. - let a_pos = key_a.chars().position(|c| c == '*'); - let base_length_a = a_pos.map_or(key_a.len(), |p| p + 1); - // 4. Let baseLengthB be the index of "*" in keyB plus one, if keyB contains "*", or the length of keyB otherwise. - let b_pos = key_b.chars().position(|c| c == '*'); - let base_length_b = b_pos.map_or(key_b.len(), |p| p + 1); - // 5. If baseLengthA is greater than baseLengthB, return -1. - if base_length_a > base_length_b { - return Ordering::Less; - } - // 6. If baseLengthB is greater than baseLengthA, return 1. - if base_length_b > base_length_a { - return Ordering::Greater; - } - // 7. If keyA does not contain "*", return 1. - if !key_a.contains('*') { - return Ordering::Greater; - } - // 8. If keyB does not contain "*", return -1. - if !key_b.contains('*') { - return Ordering::Less; - } - // 9. If the length of keyA is greater than the length of keyB, return -1. - if key_a.len() > key_b.len() { - return Ordering::Less; - } - // 10. If the length of keyB is greater than the length of keyA, return 1. - if key_b.len() > key_a.len() { - return Ordering::Greater; - } - // 11. Return 0. - Ordering::Equal - } - - fn strip_package_name<'a>(specifier: &'a str, package_name: &'a str) -> Option<&'a str> { - specifier - .strip_prefix(package_name) - .filter(|tail| tail.is_empty() || tail.starts_with(SLASH_START)) - } -} diff --git a/src/options.rs b/src/options.rs deleted file mode 100644 index 7893890e..00000000 --- a/src/options.rs +++ /dev/null @@ -1,633 +0,0 @@ -use std::path::Path; -use std::{fmt, path::PathBuf}; - -/// Module Resolution Options -/// -/// Options are directly ported from [enhanced-resolve](https://github.com/webpack/enhanced-resolve#resolver-options). -/// -/// See [webpack resolve](https://webpack.js.org/configuration/resolve/) for information and examples -#[derive(Debug, Clone)] -pub struct ResolveOptions { - /// Path to TypeScript configuration file. - /// - /// Default `None` - pub tsconfig: Option, - - /// Create aliases to import or require certain modules more easily. - /// - /// An alias is used to replace a whole path or part of a path. - /// For example, to alias a commonly used `src/` folders: `vec![("@/src"), vec![AliasValue::Path("/path/to/src")]]` - /// - /// A trailing $ can also be added to the given object's keys to signify an exact match. - /// - /// See [webpack's `resolve.alias` documentation](https://webpack.js.org/configuration/resolve/#resolvealias) for a list of use cases. - pub alias: Alias, - - /// A list of alias fields in description files. - /// - /// Specify a field, such as `browser`, to be parsed according to [this specification](https://github.com/defunctzombie/package-browser-field-spec). - /// Can be a path to json object such as `["path", "to", "exports"]`. - /// - /// Default `[]` - pub alias_fields: Vec>, - - /// Condition names for exports field which defines entry points of a package. - /// - /// The key order in the exports field is significant. During condition matching, earlier entries have higher priority and take precedence over later entries. - /// - /// Default `[]` - pub condition_names: Vec, - - /// The JSON files to use for descriptions. (There was once a `bower.json`.) - /// - /// Default `["package.json"]` - pub description_files: Vec, - - /// Set to [EnforceExtension::Enabled] for [ESM Mandatory file extensions](https://nodejs.org/api/esm.html#mandatory-file-extensions). - /// - /// If `enforce_extension` is set to [EnforceExtension::Enabled], resolution will not allow extension-less files. - /// This means `require('./foo.js')` will resolve, while `require('./foo')` will not. - /// - /// The default value for `enforce_extension` is [EnforceExtension::Auto], which is changed upon initialization. - /// - /// It changes to [EnforceExtension::Enabled] if [ResolveOptions::extensions] contains an empty string; - /// otherwise, this value changes to [EnforceExtension::Disabled]. - /// - /// Explicitly set the value to [EnforceExtension::Disabled] to disable this automatic behavior. - /// - /// For reference, this behavior is aligned with `enhanced-resolve`. See . - pub enforce_extension: EnforceExtension, - - /// A list of exports fields in description files. - /// - /// Can be a path to a JSON object such as `["path", "to", "exports"]`. - /// - /// Default `[["exports"]]`. - pub exports_fields: Vec>, - - /// Fields from `package.json` which are used to provide the internal requests of a package - /// (requests starting with # are considered internal). - /// - /// Can be a path to a JSON object such as `["path", "to", "imports"]`. - /// - /// Default `[["imports"]]`. - pub imports_fields: Vec>, - - /// An object which maps extension to extension aliases. - /// - /// Default `{}` - pub extension_alias: Vec<(String, Vec)>, - - /// Attempt to resolve these extensions in order. - /// - /// If multiple files share the same name but have different extensions, - /// will resolve the one with the extension listed first in the array and skip the rest. - /// - /// All extensions must have a leading dot. - /// - /// Default `[".js", ".json", ".node"]` - pub extensions: Vec, - - /// Redirect module requests when normal resolving fails. - /// - /// Default `[]` - pub fallback: Alias, - - /// 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). - /// - /// See also webpack configuration [resolve.fullySpecified](https://webpack.js.org/configuration/module/#resolvefullyspecified) - /// - /// Default `false` - pub fully_specified: bool, - - /// A list of main fields in description files - /// - /// Default `["main"]`. - pub main_fields: Vec, - - /// The filename to be used while resolving directories. - /// - /// Default `["index"]` - pub main_files: Vec, - - /// A list of directories to resolve modules from, can be absolute path or folder name. - /// - /// Default `["node_modules"]` - pub modules: Vec, - - /// A manifest loaded from pnp::load_pnp_manifest. - /// - /// Default `None` - #[cfg(feature = "yarn_pnp")] - pub pnp_manifest: Option, - - /// Resolve to a context instead of a file. - /// - /// Default `false` - pub resolve_to_context: bool, - - /// Prefer to resolve module requests as relative requests instead of using modules from node_modules directories. - /// - /// Default `false` - pub prefer_relative: bool, - - /// Prefer to resolve server-relative urls as absolute paths before falling back to resolve in ResolveOptions::roots. - /// - /// Default `false` - pub prefer_absolute: bool, - - /// A list of resolve restrictions to restrict the paths that a request can be resolved on. - /// - /// Default `[]` - pub restrictions: Vec, - - /// A list of directories where requests of server-relative URLs (starting with '/') are resolved. - /// On non-Windows systems these requests are resolved as an absolute path first. - /// - /// Default `[]` - pub roots: Vec, - - /// Whether to resolve symlinks to their symlinked location. - /// When enabled, symlinked resources are resolved to their real path, not their symlinked location. - /// Note that this may cause module resolution to fail when using tools that symlink packages (like npm link). - /// - /// Default `true` - pub symlinks: bool, - - /// Whether to parse [module.builtinModules](https://nodejs.org/api/module.html#modulebuiltinmodules) or not. - /// For example, "zlib" will throw [crate::ResolveError::Builtin] when set to true. - /// - /// Default `false` - pub builtin_modules: bool, -} - -impl ResolveOptions { - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// - /// let options = ResolveOptions::default().with_condition_names(&["bar"]); - /// assert_eq!(options.condition_names, vec!["bar".to_string()]) - /// ``` - #[must_use] - pub fn with_condition_names(mut self, names: &[&str]) -> Self { - self.condition_names = names.iter().map(ToString::to_string).collect::>(); - self - } - - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// - /// let options = ResolveOptions::default().with_builtin_modules(false); - /// assert_eq!(options.builtin_modules, false) - /// ``` - #[must_use] - pub fn with_builtin_modules(mut self, flag: bool) -> Self { - self.builtin_modules = flag; - self - } - - /// Adds a single root to the options - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_root("foo"); - /// assert_eq!(options.roots, vec![PathBuf::from("foo")]) - /// ``` - #[must_use] - pub fn with_root>(mut self, root: P) -> Self { - self.roots.push(root.as_ref().to_path_buf()); - self - } - - /// Adds a single extension to the list of extensions - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_extension("jsonc"); - /// assert!(options.extensions.contains(&"jsonc".to_string())); - /// ``` - #[must_use] - pub fn with_extension>(mut self, extension: S) -> Self { - self.extensions.push(extension.into()); - self - } - - /// Adds a single main field to the list of fields - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_main_field("something"); - /// assert!(options.main_fields.contains(&"something".to_string())); - /// ``` - #[must_use] - pub fn with_main_field>(mut self, field: S) -> Self { - self.main_fields.push(field.into()); - self - } - - /// Changes how the extension should be treated - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions, EnforceExtension}; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_force_extension(EnforceExtension::Enabled); - /// assert_eq!(options.enforce_extension, EnforceExtension::Enabled); - /// ``` - #[must_use] - pub fn with_force_extension(mut self, enforce_extension: EnforceExtension) -> Self { - self.enforce_extension = enforce_extension; - self - } - - /// Sets the value for [ResolveOptions::fully_specified] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_fully_specified(true); - /// assert_eq!(options.fully_specified, true); - /// ``` - #[must_use] - pub fn with_fully_specified(mut self, fully_specified: bool) -> Self { - self.fully_specified = fully_specified; - self - } - /// Sets the value for [ResolveOptions::prefer_relative] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_prefer_relative(true); - /// assert_eq!(options.prefer_relative, true); - /// ``` - #[must_use] - pub fn with_prefer_relative(mut self, flag: bool) -> Self { - self.prefer_relative = flag; - self - } - /// Sets the value for [ResolveOptions::prefer_absolute] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_prefer_absolute(true); - /// assert_eq!(options.prefer_absolute, true); - /// ``` - #[must_use] - pub fn with_prefer_absolute(mut self, flag: bool) -> Self { - self.prefer_absolute = flag; - self - } - - /// Changes the value of [ResolveOptions::symlinks] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// - /// let options = ResolveOptions::default().with_symbolic_link(false); - /// assert_eq!(options.symlinks, false); - /// ``` - #[must_use] - pub fn with_symbolic_link(mut self, flag: bool) -> Self { - self.symlinks = flag; - self - } - - /// Adds a module to [ResolveOptions::modules] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// - /// let options = ResolveOptions::default().with_module("module"); - /// assert!(options.modules.contains(&"module".to_string())); - /// ``` - #[must_use] - pub fn with_module>(mut self, module: M) -> Self { - self.modules.push(module.into()); - self - } - - /// Adds a main file to [ResolveOptions::main_files] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// - /// let options = ResolveOptions::default().with_main_file("foo"); - /// assert!(options.main_files.contains(&"foo".to_string())); - /// ``` - #[must_use] - pub fn with_main_file>(mut self, module: M) -> Self { - self.main_files.push(module.into()); - self - } - - pub(crate) fn sanitize(mut self) -> Self { - debug_assert!( - self.extensions.iter().filter(|e| !e.is_empty()).all(|e| e.starts_with('.')), - "All extensions must start with a leading dot" - ); - // Set `enforceExtension` to `true` when [ResolveOptions::extensions] contains an empty string. - // See - if self.enforce_extension == EnforceExtension::Auto { - if !self.extensions.is_empty() && self.extensions.iter().any(String::is_empty) { - self.enforce_extension = EnforceExtension::Enabled; - } else { - self.enforce_extension = EnforceExtension::Disabled; - } - } - self - } -} - -/// Value for [ResolveOptions::enforce_extension] -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -pub enum EnforceExtension { - Auto, - Enabled, - Disabled, -} - -impl EnforceExtension { - pub const fn is_auto(&self) -> bool { - matches!(self, Self::Auto) - } - - pub const fn is_enabled(&self) -> bool { - matches!(self, Self::Enabled) - } - - pub const fn is_disabled(&self) -> bool { - matches!(self, Self::Disabled) - } -} - -/// Alias for [ResolveOptions::alias] and [ResolveOptions::fallback] -pub type Alias = Vec<(String, Vec)>; - -/// Alias Value for [ResolveOptions::alias] and [ResolveOptions::fallback] -#[derive(Debug, Clone, Hash, PartialEq, Eq)] -pub enum AliasValue { - /// The path value - Path(String), - - /// The `false` value - Ignore, -} - -impl From for AliasValue -where - S: Into, -{ - fn from(value: S) -> Self { - Self::Path(value.into()) - } -} - -/// Value for [ResolveOptions::restrictions] -#[derive(Debug, Clone)] -pub enum Restriction { - Path(PathBuf), - RegExp(String), -} - -/// Tsconfig Options for [ResolveOptions::tsconfig] -/// -/// Derived from [tsconfig-paths-webpack-plugin](https://github.com/dividab/tsconfig-paths-webpack-plugin#options) -#[derive(Debug, Clone)] -pub struct TsconfigOptions { - /// Allows you to specify where to find the TypeScript configuration file. - /// You may provide - /// * a relative path to the configuration file. It will be resolved relative to cwd. - /// * an absolute path to the configuration file. - pub config_file: PathBuf, - - /// Support for Typescript Project References. - pub references: TsconfigReferences, -} - -/// Configuration for [TsconfigOptions::references] -#[derive(Debug, Clone)] -pub enum TsconfigReferences { - Disabled, - /// Use the `references` field from tsconfig of `config_file`. - Auto, - /// Manually provided relative or absolute path. - Paths(Vec), -} - -impl Default for ResolveOptions { - fn default() -> Self { - Self { - tsconfig: None, - alias: vec![], - alias_fields: vec![], - condition_names: vec![], - description_files: vec!["package.json".into()], - enforce_extension: EnforceExtension::Auto, - extension_alias: vec![], - exports_fields: vec![vec!["exports".into()]], - imports_fields: vec![vec!["imports".into()]], - extensions: vec![".js".into(), ".json".into(), ".node".into()], - fallback: vec![], - fully_specified: false, - main_fields: vec!["main".into()], - main_files: vec!["index".into()], - modules: vec!["node_modules".into()], - #[cfg(feature = "yarn_pnp")] - pnp_manifest: None, - resolve_to_context: false, - prefer_relative: false, - prefer_absolute: false, - restrictions: vec![], - roots: vec![], - symlinks: true, - builtin_modules: false, - } - } -} - -// For tracing -impl fmt::Display for ResolveOptions { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - if let Some(tsconfig) = &self.tsconfig { - write!(f, "tsconfig:{tsconfig:?},")?; - } - if !self.alias.is_empty() { - write!(f, "alias:{:?},", self.alias)?; - } - if !self.alias_fields.is_empty() { - write!(f, "alias_fields:{:?},", self.alias_fields)?; - } - if !self.condition_names.is_empty() { - write!(f, "condition_names:{:?},", self.condition_names)?; - } - if self.enforce_extension.is_enabled() { - write!(f, "enforce_extension:{:?},", self.enforce_extension)?; - } - if !self.exports_fields.is_empty() { - write!(f, "exports_fields:{:?},", self.exports_fields)?; - } - if !self.imports_fields.is_empty() { - write!(f, "imports_fields:{:?},", self.imports_fields)?; - } - if !self.extension_alias.is_empty() { - write!(f, "extension_alias:{:?},", self.extension_alias)?; - } - if !self.extensions.is_empty() { - write!(f, "extensions:{:?},", self.extensions)?; - } - if !self.fallback.is_empty() { - write!(f, "fallback:{:?},", self.fallback)?; - } - if self.fully_specified { - write!(f, "fully_specified:{:?},", self.fully_specified)?; - } - if !self.main_fields.is_empty() { - write!(f, "main_fields:{:?},", self.main_fields)?; - } - if !self.main_files.is_empty() { - write!(f, "main_files:{:?},", self.main_files)?; - } - if !self.modules.is_empty() { - write!(f, "modules:{:?},", self.modules)?; - } - if self.resolve_to_context { - write!(f, "resolve_to_context:{:?},", self.resolve_to_context)?; - } - if self.prefer_relative { - write!(f, "prefer_relative:{:?},", self.prefer_relative)?; - } - if self.prefer_absolute { - write!(f, "prefer_absolute:{:?},", self.prefer_absolute)?; - } - if !self.restrictions.is_empty() { - write!(f, "restrictions:{:?},", self.restrictions)?; - } - if !self.roots.is_empty() { - write!(f, "roots:{:?},", self.roots)?; - } - if self.symlinks { - write!(f, "symlinks:{:?},", self.symlinks)?; - } - if self.builtin_modules { - write!(f, "builtin_modules:{:?},", self.builtin_modules)?; - } - Ok(()) - } -} - -#[cfg(test)] -mod test { - use super::{ - AliasValue, EnforceExtension, ResolveOptions, Restriction, TsconfigOptions, - TsconfigReferences, - }; - use std::path::PathBuf; - - #[test] - fn enforce_extension() { - assert!(EnforceExtension::Auto.is_auto()); - assert!(!EnforceExtension::Enabled.is_auto()); - assert!(!EnforceExtension::Disabled.is_auto()); - - assert!(!EnforceExtension::Auto.is_enabled()); - assert!(EnforceExtension::Enabled.is_enabled()); - assert!(!EnforceExtension::Disabled.is_enabled()); - - assert!(!EnforceExtension::Auto.is_disabled()); - assert!(!EnforceExtension::Enabled.is_disabled()); - assert!(EnforceExtension::Disabled.is_disabled()); - } - - #[test] - fn display() { - let options = ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: PathBuf::from("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - alias: vec![("a".into(), vec![AliasValue::Ignore])], - alias_fields: vec![vec!["browser".into()]], - condition_names: vec!["require".into()], - enforce_extension: EnforceExtension::Enabled, - extension_alias: vec![(".js".into(), vec![".ts".into()])], - exports_fields: vec![vec!["exports".into()]], - imports_fields: vec![vec!["imports".into()]], - fallback: vec![("fallback".into(), vec![AliasValue::Ignore])], - fully_specified: true, - resolve_to_context: true, - prefer_relative: true, - prefer_absolute: true, - restrictions: vec![Restriction::Path(PathBuf::from("restrictions"))], - roots: vec![PathBuf::from("roots")], - builtin_modules: true, - ..ResolveOptions::default() - }; - - let expected = r#"tsconfig:TsconfigOptions { config_file: "tsconfig.json", references: Auto },alias:[("a", [Ignore])],alias_fields:[["browser"]],condition_names:["require"],enforce_extension:Enabled,exports_fields:[["exports"]],imports_fields:[["imports"]],extension_alias:[(".js", [".ts"])],extensions:[".js", ".json", ".node"],fallback:[("fallback", [Ignore])],fully_specified:true,main_fields:["main"],main_files:["index"],modules:["node_modules"],resolve_to_context:true,prefer_relative:true,prefer_absolute:true,restrictions:[Path("restrictions")],roots:["roots"],symlinks:true,builtin_modules:true,"#; - assert_eq!(format!("{options}"), expected); - - let options = ResolveOptions { - alias: vec![], - alias_fields: vec![], - builtin_modules: false, - condition_names: vec![], - description_files: vec![], - enforce_extension: EnforceExtension::Disabled, - exports_fields: vec![], - extension_alias: vec![], - extensions: vec![], - fallback: vec![], - fully_specified: false, - imports_fields: vec![], - main_fields: vec![], - main_files: vec![], - modules: vec![], - #[cfg(feature = "yarn_pnp")] - pnp_manifest: None, - prefer_absolute: false, - prefer_relative: false, - resolve_to_context: false, - restrictions: vec![], - roots: vec![], - symlinks: false, - tsconfig: None, - }; - - assert_eq!(format!("{options}"), ""); - } -} diff --git a/src/package_json.rs b/src/package_json.rs deleted file mode 100644 index 7e05d202..00000000 --- a/src/package_json.rs +++ /dev/null @@ -1,219 +0,0 @@ -//! package.json definitions -//! -//! Code related to export field are copied from [Parcel's resolver](https://github.com/parcel-bundler/parcel/blob/v2/packages/utils/node-resolver-rs/src/package_json.rs) -use std::path::{Path, PathBuf}; - -use serde_json::Value as JSONValue; - -use crate::{path::PathUtil, ResolveError}; - -pub type JSONMap = serde_json::Map; - -/// Deserialized package.json -#[derive(Debug, Default)] -pub struct PackageJson { - /// Path to `package.json`. Contains the `package.json` filename. - pub path: PathBuf, - - /// Realpath to `package.json`. Contains the `package.json` filename. - pub realpath: PathBuf, - - /// The "name" field defines your package's name. - /// The "name" field can be used in addition to the "exports" field to self-reference a package using its name. - /// - /// - pub name: Option, - - /// The "type" field. - /// - /// - pub r#type: Option, - - /// The "sideEffects" field. - /// - /// - pub side_effects: Option, - - raw_json: std::sync::Arc, -} - -impl PackageJson { - /// # Panics - /// # Errors - pub(crate) fn parse( - path: PathBuf, - realpath: PathBuf, - json: &str, - ) -> Result { - let mut raw_json: JSONValue = serde_json::from_str(json)?; - let mut package_json = Self::default(); - - if let Some(json_object) = raw_json.as_object_mut() { - // Remove large fields that are useless for pragmatic use. - #[cfg(feature = "package_json_raw_json_api")] - { - json_object.remove("description"); - json_object.remove("keywords"); - json_object.remove("scripts"); - json_object.remove("dependencies"); - json_object.remove("devDependencies"); - json_object.remove("peerDependencies"); - json_object.remove("optionalDependencies"); - } - - // Add name, type and sideEffects. - package_json.name = - json_object.get("name").and_then(|field| field.as_str()).map(ToString::to_string); - package_json.r#type = json_object.get("type").cloned(); - package_json.side_effects = json_object.get("sideEffects").cloned(); - } - - package_json.path = path; - package_json.realpath = realpath; - package_json.raw_json = std::sync::Arc::new(raw_json); - Ok(package_json) - } - - fn get_value_by_path<'a>( - fields: &'a serde_json::Map, - path: &[String], - ) -> Option<&'a JSONValue> { - if path.is_empty() { - return None; - } - let mut value = fields.get(&path[0])?; - for key in path.iter().skip(1) { - if let Some(inner_value) = value.as_object().and_then(|o| o.get(key)) { - value = inner_value; - } else { - return None; - } - } - Some(value) - } - - /// Raw serde json value of `package.json`. - /// - /// This is currently used in Rspack for: - /// * getting the `sideEffects` field - /// * query in - search on GitHub indicates query on the `type` field. - /// - /// To reduce overall memory consumption, large fields that useless for pragmatic use are removed. - /// They are: `description`, `keywords`, `scripts`, - /// `dependencies` and `devDependencies`, `peerDependencies`, `optionalDependencies`. - #[cfg(feature = "package_json_raw_json_api")] - pub fn raw_json(&self) -> &std::sync::Arc { - &self.raw_json - } - - /// Directory to `package.json` - /// - /// # Panics - /// - /// * When the package.json path is misconfigured. - pub fn directory(&self) -> &Path { - debug_assert!(self.realpath.file_name().is_some_and(|x| x == "package.json")); - self.realpath.parent().unwrap() - } - - /// The "main" field defines the entry point of a package when imported by name via a node_modules lookup. Its value is a path. - /// - /// When a package has an "exports" field, this will take precedence over the "main" field when importing the package by name. - /// - /// Values are dynamically retrieved from [ResolveOptions::main_fields]. - /// - /// - pub(crate) fn main_fields<'a>( - &'a self, - main_fields: &'a [String], - ) -> impl Iterator + '_ { - main_fields - .iter() - .filter_map(|main_field| self.raw_json.get(main_field)) - .filter_map(|value| value.as_str()) - } - - /// The "exports" field allows defining the entry points of a package when imported by name loaded either via a node_modules lookup or a self-reference to its own name. - /// - /// - pub(crate) fn exports_fields<'a>( - &'a self, - exports_fields: &'a [Vec], - ) -> impl Iterator + '_ { - exports_fields.iter().filter_map(|object_path| { - self.raw_json - .as_object() - .and_then(|json_object| Self::get_value_by_path(json_object, object_path)) - }) - } - - /// In addition to the "exports" field, there is a package "imports" field to create private mappings that only apply to import specifiers from within the package itself. - /// - /// - pub(crate) fn imports_fields<'a>( - &'a self, - imports_fields: &'a [Vec], - ) -> impl Iterator + '_ { - imports_fields.iter().filter_map(|object_path| { - self.raw_json - .as_object() - .and_then(|json_object| Self::get_value_by_path(json_object, object_path)) - .and_then(|value| value.as_object()) - }) - } - - /// The "browser" field is provided by a module author as a hint to javascript bundlers or component tools when packaging modules for client side use. - /// Multiple values are configured by [ResolveOptions::alias_fields]. - /// - /// - fn browser_fields<'a>( - &'a self, - alias_fields: &'a [Vec], - ) -> impl Iterator + '_ { - alias_fields.iter().filter_map(|object_path| { - self.raw_json - .as_object() - .and_then(|json_object| Self::get_value_by_path(json_object, object_path)) - // Only object is valid, all other types are invalid - // https://github.com/webpack/enhanced-resolve/blob/3a28f47788de794d9da4d1702a3a583d8422cd48/lib/AliasFieldPlugin.js#L44-L52 - .and_then(|value| value.as_object()) - }) - } - - /// Resolve the request string for this package.json by looking at the `browser` field. - /// - /// # Errors - /// - /// * Returns [ResolveError::Ignored] for `"path": false` in `browser` field. - pub(crate) fn resolve_browser_field<'a>( - &'a self, - path: &Path, - request: Option<&str>, - alias_fields: &'a [Vec], - ) -> Result, ResolveError> { - for object in self.browser_fields(alias_fields) { - if let Some(request) = request { - if let Some(value) = object.get(request) { - return Self::alias_value(path, value); - } - } else { - let dir = self.path.parent().unwrap(); - for (key, value) in object { - let joined = dir.normalize_with(key); - if joined == path { - return Self::alias_value(path, value); - } - } - } - } - Ok(None) - } - - fn alias_value<'a>(key: &Path, value: &'a JSONValue) -> Result, ResolveError> { - match value { - JSONValue::String(value) => Ok(Some(value.as_str())), - JSONValue::Bool(b) if !b => Err(ResolveError::Ignored(key.to_path_buf())), - _ => Ok(None), - } - } -} diff --git a/src/path.rs b/src/path.rs deleted file mode 100644 index f66fdd76..00000000 --- a/src/path.rs +++ /dev/null @@ -1,132 +0,0 @@ -//! Path Utilities -//! -//! Code adapted from the following libraries -//! * [path-absolutize](https://docs.rs/path-absolutize) -//! * [normalize_path](https://docs.rs/normalize-path) -use std::path::{Component, Path, PathBuf}; - -pub const SLASH_START: &[char; 2] = &['/', '\\']; - -/// Extension trait to add path normalization to std's [`Path`]. -pub trait PathUtil { - /// Normalize this path without performing I/O. - /// - /// All redundant separator and up-level references are collapsed. - /// - /// However, this does not resolve links. - fn normalize(&self) -> PathBuf; - - /// Normalize with subpath assuming this path is normalized without performing I/O. - /// - /// All redundant separator and up-level references are collapsed. - /// - /// However, this does not resolve links. - fn normalize_with>(&self, subpath: P) -> PathBuf; - - /// Defined in ESM PACKAGE_TARGET_RESOLVE - /// If target split on "/" or "\" contains any "", ".", "..", or "node_modules" segments after the first "." segment, case insensitive and including percent encoded variants - fn is_invalid_exports_target(&self) -> bool; -} - -impl PathUtil for Path { - // https://github.com/parcel-bundler/parcel/blob/e0b99c2a42e9109a9ecbd6f537844a1b33e7faf5/packages/utils/node-resolver-rs/src/path.rs#L7 - fn normalize(&self) -> PathBuf { - let mut components = self.components().peekable(); - let mut ret = if let Some(c @ Component::Prefix(..)) = components.peek() { - let buf = PathBuf::from(c.as_os_str()); - components.next(); - buf - } else { - PathBuf::new() - }; - - for component in components { - match component { - Component::Prefix(..) => unreachable!("Path {:?}", self), - Component::RootDir => { - ret.push(component.as_os_str()); - } - Component::CurDir => {} - Component::ParentDir => { - ret.pop(); - } - Component::Normal(c) => { - ret.push(c); - } - } - } - - ret - } - - // https://github.com/parcel-bundler/parcel/blob/e0b99c2a42e9109a9ecbd6f537844a1b33e7faf5/packages/utils/node-resolver-rs/src/path.rs#L37 - fn normalize_with>(&self, subpath: B) -> PathBuf { - let subpath = subpath.as_ref(); - - let mut components = subpath.components(); - - let Some(head) = components.next() else { return subpath.to_path_buf() }; - - if matches!(head, Component::Prefix(..) | Component::RootDir) { - return subpath.to_path_buf(); - } - - let mut ret = self.to_path_buf(); - for component in std::iter::once(head).chain(components) { - match component { - Component::CurDir => {} - Component::ParentDir => { - ret.pop(); - } - Component::Normal(c) => { - ret.push(c); - } - Component::Prefix(..) | Component::RootDir => { - unreachable!("Path {:?} Subpath {:?}", self, subpath) - } - } - } - - ret - } - - fn is_invalid_exports_target(&self) -> bool { - self.components().enumerate().any(|(index, c)| match c { - Component::ParentDir => true, - Component::CurDir => index > 0, - Component::Normal(c) => c.eq_ignore_ascii_case("node_modules"), - _ => false, - }) - } -} - -// https://github.com/webpack/enhanced-resolve/blob/main/test/path.test.js -#[test] -fn is_invalid_exports_target() { - let test_cases = [ - "../a.js", - "../", - "./a/b/../../../c.js", - "./a/b/../../../", - "./../../c.js", - "./../../", - "./a/../b/../../c.js", - "./a/../b/../../", - "./././../", - ]; - - for case in test_cases { - assert!(Path::new(case).is_invalid_exports_target(), "{case}"); - } - - assert!(!Path::new("C:").is_invalid_exports_target()); - assert!(!Path::new("/").is_invalid_exports_target()); -} - -#[test] -fn normalize() { - assert_eq!(Path::new("/foo/.././foo/").normalize(), Path::new("/foo")); - assert_eq!(Path::new("C://").normalize(), Path::new("C://")); - assert_eq!(Path::new("C:").normalize(), Path::new("C:")); - assert_eq!(Path::new(r"\\server\share").normalize(), Path::new(r"\\server\share")); -} diff --git a/src/resolution.rs b/src/resolution.rs deleted file mode 100644 index a3aaa2e7..00000000 --- a/src/resolution.rs +++ /dev/null @@ -1,92 +0,0 @@ -use crate::package_json::PackageJson; -use std::{ - fmt, - path::{Path, PathBuf}, - sync::Arc, -}; - -/// The final path resolution with optional `?query` and `#fragment` -#[derive(Clone)] -pub struct Resolution { - pub(crate) path: PathBuf, - - /// path query `?query`, contains `?`. - pub(crate) query: Option, - - /// path fragment `#query`, contains `#`. - pub(crate) fragment: Option, - - pub(crate) package_json: Option>, -} - -impl fmt::Debug for Resolution { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - f.debug_struct("Resolution") - .field("path", &self.path) - .field("query", &self.query) - .field("fragment", &self.fragment) - .field("package_json", &self.package_json.as_ref().map(|p| &p.path)) - .finish() - } -} - -impl PartialEq for Resolution { - fn eq(&self, other: &Self) -> bool { - self.path == other.path && self.query == other.query && self.fragment == other.fragment - } -} -impl Eq for Resolution {} - -impl Resolution { - /// Returns the path without query and fragment - pub fn path(&self) -> &Path { - &self.path - } - - /// Returns the path without query and fragment - pub fn into_path_buf(self) -> PathBuf { - self.path - } - - /// Returns the path query `?query`, contains the leading `?` - pub fn query(&self) -> Option<&str> { - self.query.as_deref() - } - - /// Returns the path fragment `#fragment`, contains the leading `#` - pub fn fragment(&self) -> Option<&str> { - self.fragment.as_deref() - } - - /// Returns serialized package_json - pub fn package_json(&self) -> Option<&Arc> { - self.package_json.as_ref() - } - - /// Returns the full path with query and fragment - pub fn full_path(&self) -> PathBuf { - let mut path = self.path.clone().into_os_string(); - if let Some(query) = &self.query { - path.push(query); - } - if let Some(fragment) = &self.fragment { - path.push(fragment); - } - PathBuf::from(path) - } -} - -#[test] -fn test() { - let resolution = Resolution { - path: PathBuf::from("foo"), - query: Some("?query".to_string()), - fragment: Some("#fragment".to_string()), - package_json: None, - }; - assert_eq!(resolution.path(), Path::new("foo")); - assert_eq!(resolution.query(), Some("?query")); - assert_eq!(resolution.fragment(), Some("#fragment")); - assert_eq!(resolution.full_path(), PathBuf::from("foo?query#fragment")); - assert_eq!(resolution.into_path_buf(), PathBuf::from("foo")); -} diff --git a/src/specifier.rs b/src/specifier.rs deleted file mode 100644 index 73ed038c..00000000 --- a/src/specifier.rs +++ /dev/null @@ -1,230 +0,0 @@ -use crate::error::SpecifierError; -use std::borrow::Cow; - -#[derive(Debug)] -pub struct Specifier<'a> { - path: Cow<'a, str>, - pub query: Option<&'a str>, - pub fragment: Option<&'a str>, -} - -impl<'a> Specifier<'a> { - pub fn path(&'a self) -> &'a str { - self.path.as_ref() - } - - pub fn parse(specifier: &'a str) -> Result { - if specifier.is_empty() { - return Err(SpecifierError::Empty(specifier.to_string())); - } - let offset = match specifier.as_bytes()[0] { - b'/' | b'.' | b'#' => 1, - _ => 0, - }; - let (path, query, fragment) = Self::parse_query_framgment(specifier, offset); - if path.is_empty() { - return Err(SpecifierError::Empty(specifier.to_string())); - } - Ok(Self { path, query, fragment }) - } - - fn parse_query_framgment( - specifier: &'a str, - skip: usize, - ) -> (Cow<'a, str>, Option<&str>, Option<&str>) { - let mut query_start: Option = None; - let mut fragment_start: Option = None; - - let mut prev = specifier.chars().next().unwrap(); - let mut escaped_indexes = vec![]; - for (i, c) in specifier.char_indices().skip(skip) { - if c == '?' && query_start.is_none() { - query_start = Some(i); - } - if c == '#' { - if prev == '\0' { - escaped_indexes.push(i - 1); - } else { - fragment_start = Some(i); - break; - } - } - prev = c; - } - - let (path, query, fragment) = match (query_start, fragment_start) { - (Some(i), Some(j)) => { - debug_assert!(i < j); - (&specifier[..i], Some(&specifier[i..j]), Some(&specifier[j..])) - } - (Some(i), None) => (&specifier[..i], Some(&specifier[i..]), None), - (None, Some(j)) => (&specifier[..j], None, Some(&specifier[j..])), - _ => (specifier, None, None), - }; - - let path = if escaped_indexes.is_empty() { - Cow::Borrowed(path) - } else { - // Remove the `\0` characters for a legal path. - Cow::Owned( - path.chars() - .enumerate() - .filter_map(|(i, c)| (!escaped_indexes.contains(&i)).then_some(c)) - .collect::(), - ) - }; - - (path, query, fragment) - } -} - -#[cfg(test)] -mod tests { - use super::{Specifier, SpecifierError}; - - #[test] - fn debug() { - let specifier = Specifier::parse("/").unwrap(); - assert_eq!( - format!("{specifier:?}"), - r#"Specifier { path: "/", query: None, fragment: None }"# - ); - } - - #[test] - fn empty() { - let specifiers = ["", "?"]; - for specifier in specifiers { - let error = Specifier::parse(specifier).unwrap_err(); - assert_eq!(error, SpecifierError::Empty(specifier.to_string())); - } - } - - #[test] - fn absolute() -> Result<(), SpecifierError> { - let specifier = "/test?#"; - let parsed = Specifier::parse(specifier)?; - assert_eq!(parsed.path, "/test"); - assert_eq!(parsed.query, Some("?")); - assert_eq!(parsed.fragment, Some("#")); - Ok(()) - } - - #[test] - fn relative() -> Result<(), SpecifierError> { - let specifiers = ["./test", "../test", "../../test"]; - for specifier in specifiers { - let mut r = specifier.to_string(); - r.push_str("?#"); - let parsed = Specifier::parse(&r)?; - assert_eq!(parsed.path, specifier); - assert_eq!(parsed.query, Some("?")); - assert_eq!(parsed.fragment, Some("#")); - } - Ok(()) - } - - #[test] - fn hash() -> Result<(), SpecifierError> { - let specifiers = ["#", "#path"]; - for specifier in specifiers { - let mut r = specifier.to_string(); - r.push_str("?#"); - let parsed = Specifier::parse(&r)?; - assert_eq!(parsed.path, specifier); - assert_eq!(parsed.query, Some("?")); - assert_eq!(parsed.fragment, Some("#")); - } - Ok(()) - } - - #[test] - fn module() -> Result<(), SpecifierError> { - let specifiers = ["module"]; - for specifier in specifiers { - let mut r = specifier.to_string(); - r.push_str("?#"); - let parsed = Specifier::parse(&r)?; - assert_eq!(parsed.path, specifier); - assert_eq!(parsed.query, Some("?")); - assert_eq!(parsed.fragment, Some("#")); - } - Ok(()) - } - - #[test] - fn query_fragment() -> Result<(), SpecifierError> { - let data = [ - ("a?", Some("?"), None), - ("a?query", Some("?query"), None), - ("a?query1?query2", Some("?query1?query2"), None), - ("a?query1?query2?query3", Some("?query1?query2?query3"), None), - ("a#", None, Some("#")), - ("a#b#c", None, Some("#b#c")), - ("a#fragment", None, Some("#fragment")), - ("a?#", Some("?"), Some("#")), - ("a?#fragment", Some("?"), Some("#fragment")), - ("a?query#", Some("?query"), Some("#")), - ("a?query#fragment", Some("?query"), Some("#fragment")), - ("a#fragment?", None, Some("#fragment?")), - ("a#fragment?query", None, Some("#fragment?query")), - ]; - - for (specifier_str, query, fragment) in data { - let specifier = Specifier::parse(specifier_str)?; - assert_eq!(specifier.path, "a", "{specifier_str}"); - assert_eq!(specifier.query, query, "{specifier_str}"); - assert_eq!(specifier.fragment, fragment, "{specifier_str}"); - } - - Ok(()) - } - - #[test] - // https://github.com/webpack/enhanced-resolve/blob/main/test/identifier.test.js - fn enhanced_resolve_edge_cases() -> Result<(), SpecifierError> { - let data = [ - ("path/#", "path/", "", "#"), - ("path/as/?", "path/as/", "?", ""), - ("path/#/?", "path/", "", "#/?"), - ("path/#repo#hash", "path/", "", "#repo#hash"), - ("path/#r#hash", "path/", "", "#r#hash"), - ("path/#repo/#repo2#hash", "path/", "", "#repo/#repo2#hash"), - ("path/#r/#r#hash", "path/", "", "#r/#r#hash"), - ("path/#/not/a/hash?not-a-query", "path/", "", "#/not/a/hash?not-a-query"), - ]; - - for (specifier_str, path, query, fragment) in data { - let specifier = Specifier::parse(specifier_str)?; - assert_eq!(specifier.path, path, "{specifier_str}"); - assert_eq!(specifier.query.unwrap_or(""), query, "{specifier_str}"); - assert_eq!(specifier.fragment.unwrap_or(""), fragment, "{specifier_str}"); - } - - Ok(()) - } - - // https://github.com/webpack/enhanced-resolve/blob/main/test/identifier.test.js - #[test] - fn enhanced_resolve_windows_like() -> Result<(), SpecifierError> { - let data = [ - ("path\\#", "path\\", "", "#"), - ("path\\as\\?", "path\\as\\", "?", ""), - ("path\\#\\?", "path\\", "", "#\\?"), - ("path\\#repo#hash", "path\\", "", "#repo#hash"), - ("path\\#r#hash", "path\\", "", "#r#hash"), - ("path\\#repo\\#repo2#hash", "path\\", "", "#repo\\#repo2#hash"), - ("path\\#r\\#r#hash", "path\\", "", "#r\\#r#hash"), - ("path\\#/not/a/hash?not-a-query", "path\\", "", "#/not/a/hash?not-a-query"), - ]; - - for (specifier_str, path, query, fragment) in data { - let specifier = Specifier::parse(specifier_str)?; - assert_eq!(specifier.path, path, "{specifier_str}"); - assert_eq!(specifier.query.unwrap_or(""), query, "{specifier_str}"); - assert_eq!(specifier.fragment.unwrap_or(""), fragment, "{specifier_str}"); - } - - Ok(()) - } -} diff --git a/src/tests/alias.rs b/src/tests/alias.rs deleted file mode 100644 index e5892066..00000000 --- a/src/tests/alias.rs +++ /dev/null @@ -1,283 +0,0 @@ -//! - -use normalize_path::NormalizePath; -use std::path::Path; - -use crate::{AliasValue, Resolution, ResolveContext, ResolveError, ResolveOptions, Resolver}; - -#[test] -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -fn alias() { - use super::memory_fs::MemoryFS; - use crate::ResolverGeneric; - use std::path::{Path, PathBuf}; - - let f = Path::new("/"); - - let file_system = MemoryFS::new(&[ - ("/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", ""), - ("/dashed-name", ""), - ]); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - alias: vec![ - ("aliasA".into(), vec![AliasValue::from("a")]), - ("b$".into(), vec![AliasValue::from("a/index")]), - ("c$".into(), vec![AliasValue::from("/a/index")]), - ( - "multiAlias".into(), - vec![ - AliasValue::from("b"), - AliasValue::from("c"), - AliasValue::from("d"), - AliasValue::from("e"), - AliasValue::from("a"), - ], - ), - ("recursive".into(), vec![AliasValue::from("recursive/dir")]), - ("/d/dir".into(), vec![AliasValue::from("/c/dir")]), - ("/d/index.js".into(), vec![AliasValue::from("/c/index")]), - ("#".into(), vec![AliasValue::from("/c/dir")]), - ("@".into(), vec![AliasValue::from("/c/dir")]), - ("ignored".into(), vec![AliasValue::Ignore]), - // not part of enhanced-resolve, added to make sure query in alias value works - ("alias_query".into(), vec![AliasValue::from("a?query_after")]), - ("alias_fragment".into(), vec![AliasValue::from("a#fragment_after")]), - ("dash".into(), vec![AliasValue::Ignore]), - ("@scope/package-name/file$".into(), vec![AliasValue::from("/c/dir")]), - ], - modules: vec!["/".into()], - ..ResolveOptions::default() - }, - ); - - #[rustfmt::skip] - let pass = [ - ("should resolve a not aliased module 1", "a", "/a/index"), - ("should resolve a not aliased module 2", "a/index", "/a/index"), - ("should resolve a not aliased module 3", "a/dir", "/a/dir/index"), - ("should resolve a not aliased module 4", "a/dir/index", "/a/dir/index"), - ("should resolve an aliased module 1", "aliasA", "/a/index"), - ("should resolve an aliased module 2", "aliasA/index", "/a/index"), - ("should resolve an aliased module 3", "aliasA/dir", "/a/dir/index"), - ("should resolve an aliased module 4", "aliasA/dir/index", "/a/dir/index"), - ("should resolve '#' alias 1", "#", "/c/dir/index"), - ("should resolve '#' alias 2", "#/index", "/c/dir/index"), - ("should resolve '@' alias 1", "@", "/c/dir/index"), - ("should resolve '@' alias 2", "@/index", "/c/dir/index"), - ("should resolve a recursive aliased module 1", "recursive", "/recursive/dir/index"), - ("should resolve a recursive aliased module 2", "recursive/index", "/recursive/dir/index"), - ("should resolve a recursive aliased module 3", "recursive/dir", "/recursive/dir/index"), - ("should resolve a recursive aliased module 4", "recursive/dir/index", "/recursive/dir/index"), - ("should resolve a file aliased module 1", "b", "/a/index"), - ("should resolve a file aliased module 2", "c", "/a/index"), - ("should resolve a file aliased module with a query 1", "b?query", "/a/index?query"), - ("should resolve a file aliased module with a query 2", "c?query", "/a/index?query"), - ("should resolve a path in a file aliased module 1", "b/index", "/b/index"), - ("should resolve a path in a file aliased module 2", "b/dir", "/b/dir/index"), - ("should resolve a path in a file aliased module 3", "b/dir/index", "/b/dir/index"), - ("should resolve a path in a file aliased module 4", "c/index", "/c/index"), - ("should resolve a path in a file aliased module 5", "c/dir", "/c/dir/index"), - ("should resolve a path in a file aliased module 6", "c/dir/index", "/c/dir/index"), - ("should resolve a file aliased file 1", "d", "/c/index"), - ("should resolve a file aliased file 2", "d/dir/index", "/c/dir/index"), - ("should resolve a file in multiple aliased dirs 1", "multiAlias/dir/file", "/e/dir/file"), - ("should resolve a file in multiple aliased dirs 2", "multiAlias/anotherDir", "/e/anotherDir/index"), - // not part of enhanced-resolve, added to make sure query in alias value works - ("should resolve query in alias value", "alias_query?query_before", "/a/index?query_after"), - ("should resolve query in alias value", "alias_fragment#fragment_before", "/a/index#fragment_after"), - ("should resolve dashed name", "dashed-name", "/dashed-name"), - ("should resolve scoped package name with sub dir", "@scope/package-name/file", "/c/dir/index"), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - - #[rustfmt::skip] - let ignore = [ - ("should resolve an ignore module", "ignored", ResolveError::Ignored(f.join("ignored"))) - ]; - - for (comment, request, expected) in ignore { - let resolution = resolver.resolve(f, request); - assert_eq!(resolution, Err(expected), "{comment} {request}"); - } -} - -// Not part of enhanced-resolve -#[test] -fn infinite_recursion() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![ - ("./a".into(), vec![AliasValue::from("./b")]), - ("./b".into(), vec![AliasValue::from("./a")]), - ], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(f, "./a"); - assert_eq!(resolution, Err(ResolveError::Recursion)); -} - -fn check_slash(path: &Path) { - let s = path.to_string_lossy().to_string(); - #[cfg(target_os = "windows")] - { - assert!(!s.contains('/'), "{s}"); - assert!(s.contains('\\'), "{s}"); - } - #[cfg(not(target_os = "windows"))] - { - assert!(s.contains('/'), "{s}"); - assert!(!s.contains('\\'), "{s}"); - } -} - -#[test] -fn absolute_path() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![(f.join("foo").to_str().unwrap().to_string(), vec![AliasValue::Ignore])], - modules: vec![f.clone().to_str().unwrap().to_string()], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(&f, "foo/index"); - assert_eq!(resolution, Err(ResolveError::Ignored(f.join("foo")))); -} - -#[test] -fn system_path() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![("@app".into(), vec![AliasValue::from(f.join("alias").to_string_lossy())])], - ..ResolveOptions::default() - }); - - let specifiers = ["@app/files/a", "@app/files/a.js"]; - - for specifier in specifiers { - let path = resolver.resolve(&f, specifier).map(Resolution::into_path_buf).unwrap(); - assert_eq!(path, f.join("alias/files/a.js")); - check_slash(&path); - } -} - -#[test] -fn alias_is_full_path() { - let f = super::fixture(); - let dir = f.join("foo"); - let dir_str = dir.to_string_lossy().to_string(); - - let resolver = Resolver::new(ResolveOptions { - alias: vec![("@".into(), vec![AliasValue::Path(dir_str.clone())])], - ..ResolveOptions::default() - }); - - let mut ctx = ResolveContext::default(); - - let specifiers = [ - "@/index".to_string(), - "@/index.js".to_string(), - // specifier has multiple `/` for reasons we'll never know - "@////index".to_string(), - // specifier is a full path - dir_str, - ]; - - for specifier in specifiers { - let resolution = resolver.resolve_with_context(&f, &specifier, &mut ctx); - assert_eq!(resolution.map(|r| r.full_path()), Ok(dir.join("index.js"))); - } - - for path in ctx.file_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - check_slash(&path); - } - - for path in ctx.missing_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - check_slash(&path); - if let Some(path) = path.parent() { - assert!(!path.is_file(), "{path:?} must not be a file"); - } - } -} - -// For the `should_stop` variable in `load_alias` -#[test] -fn all_alias_values_are_not_found() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![( - "m1".to_string(), - vec![AliasValue::Path(f.join("node_modules").join("m2").to_string_lossy().to_string())], - )], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(&f, "m1/a.js"); - assert_eq!( - resolution, - Err(ResolveError::MatchedAliasNotFound("m1/a.js".to_string(), "m1".to_string(),)) - ); -} - -#[test] -fn alias_fragment() { - let f = super::fixture(); - - let data = [ - // enhanced-resolve has `#` prepended with a `\0`, they are removed from the - // following 3 expected test results. - // See https://github.com/webpack/enhanced-resolve#escaping - ( - "handle fragment edge case (no fragment)", - "./no#fragment/#/#", - f.join("no#fragment/#/#.js"), - ), - ("handle fragment edge case (fragment)", "./no#fragment/#/", f.join("no.js#fragment/#/")), - ( - "handle fragment escaping", - "./no\0#fragment/\0#/\0##fragment", - f.join("no#fragment/#/#.js#fragment"), - ), - ]; - - for (comment, request, expected) in data { - let resolver = Resolver::new(ResolveOptions { - alias: vec![("foo".to_string(), vec![AliasValue::Path(request.to_string())])], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f, "foo").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } -} - -#[test] -fn alias_try_fragment_as_path() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![( - "#".to_string(), - vec![AliasValue::Path(f.join("#").to_string_lossy().to_string())], - )], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(&f, "#/a").map(|r| r.full_path()); - assert_eq!(resolution, Ok(f.join("#").join("a.js"))); -} diff --git a/src/tests/browser_field.rs b/src/tests/browser_field.rs deleted file mode 100644 index 171ee099..00000000 --- a/src/tests/browser_field.rs +++ /dev/null @@ -1,189 +0,0 @@ -//! - -use crate::{AliasValue, ResolveError, ResolveOptions, Resolver}; - -#[test] -fn ignore() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![ - vec!["browser".into()], - vec!["innerBrowser1".into()], - vec!["innerBrowser2".into()], - vec![], - ], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - (f.clone(), "./lib/ignore", f.join("lib/ignore.js")), - (f.clone(), "./lib/ignore.js", f.join("lib/ignore.js")), - (f.join("lib"), "./ignore", f.join("lib/ignore.js")), - (f.join("lib"), "./ignore.js", f.join("lib/ignore.js")), - ]; - - for (path, request, expected) in data { - let resolution = resolver.resolve(&path, request); - let expected = ResolveError::Ignored(expected); - assert_eq!(resolution, Err(expected), "{path:?} {request}"); - } -} - -#[test] -fn shared_resolvers() { - let f = super::fixture().join("browser-module"); - - let resolver1 = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["innerBrowser1".into(), "field".into(), "browser".into()]], - ..ResolveOptions::default() - }); - let resolved_path = resolver1.resolve(&f, "./lib/main1.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("lib/main.js"))); - - let resolver2 = resolver1.clone_with_options(ResolveOptions { - alias_fields: vec![vec!["innerBrowser2".into(), "browser".into()]], - ..ResolveOptions::default() - }); - let resolved_path = resolver2.resolve(&f, "./lib/main2.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("./lib/replaced.js"))); -} - -#[test] -fn replace_file() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![ - vec!["browser".into()], - vec!["innerBrowser1".into(), "field2".into(), "browser".into()], // not presented - vec!["innerBrowser1".into(), "field".into(), "browser".into()], - vec!["innerBrowser2".into(), "browser".into()], - ], - // Not part of enhanced-resolve. Added to make sure no interaction between these two fields. - main_fields: vec!["browser".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - ("should replace a file 1", f.clone(), "./lib/replaced", f.join("lib/browser.js")), - ("should replace a file 2", f.clone(), "./lib/replaced.js", f.join("lib/browser.js")), - ("should replace a file 3", f.join("lib"), "./replaced", f.join("lib/browser.js")), - ("should replace a file 4", f.join("lib"), "./replaced.js", f.join("lib/browser.js")), - ("should replace a module with a file 1", f.clone(), "module-a", f.join("browser/module-a.js")), - ("should replace a module with a file 2", f.join("lib"), "module-a", f.join("browser/module-a.js")), - ("should replace a module with a module 1", f.clone(), "module-b", f.join("node_modules/module-c.js")), - ("should replace a module with a module 2", f.join("lib"), "module-b", f.join("node_modules/module-c.js")), - ("should resolve in nested property 1", f.clone(), "./lib/main1.js", f.join("lib/main.js")), - ("should resolve in nested property 2", f.clone(), "./lib/main2.js", f.join("lib/browser.js")), - ("should check only alias field properties", f.clone(), "./toString", f.join("lib/toString.js")), - // not part of enhanced-resolve - ("recursion", f.clone(), "module-c", f.join("node_modules/module-c.js")), - ("resolve self 1", f.clone(), "./lib/main.js", f.join("lib/main.js")), - ("resolve self 2", f.clone(), "./main.js", f.join("lib/main.js")), - ]; - - for (comment, path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn recurse_fail() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - ("recurse non existent", f.clone(), "./lib/non-existent.js", ResolveError::NotFound("./lib/non-existent.js".into())), - ("path partial match 1", f.clone(), "./xyz.js", ResolveError::NotFound("./xyz.js".into())), - ("path partial match 2", f, "./lib/xyz.js", ResolveError::NotFound("./lib/xyz.js".into())), - ]; - - for (comment, path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Err(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn broken() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - // The browser field string value should be ignored - (f.clone(), "browser-module-broken", Ok(f.join("node_modules/browser-module-broken/main.js"))), - (f.join("browser-module"), "./number", Err(ResolveError::NotFound("./number".into()))), - ]; - - for (path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, expected, "{path:?} {request}"); - } -} - -#[test] -fn crypto_js() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - fallback: vec![( - "crypto".into(), - vec![AliasValue::from(f.join("lib.js").to_string_lossy())], - )], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(f.join("crypto-js"), "crypto").map(|r| r.full_path()); - assert_eq!(resolved_path, Err(ResolveError::Ignored(f.join("crypto-js")))); -} - -// https://github.com/webpack/webpack/blob/87660921808566ef3b8796f8df61bd79fc026108/test/cases/resolving/browser-field/index.js#L40-L43 -#[test] -fn recursive() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - let data = [ - ("should handle recursive file 1", f.clone(), "recursive-file/a"), - ("should handle recursive file 2", f.clone(), "recursive-file/b"), - ("should handle recursive file 3", f.clone(), "recursive-file/c"), - ("should handle recursive file 4", f, "recursive-file/d"), - ]; - - for (comment, path, request) in data { - let resolved_path = resolver.resolve(&path, request); - assert_eq!(resolved_path, Err(ResolveError::Recursion), "{comment} {path:?} {request}"); - } -} - -#[test] -fn with_query() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "./foo").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("lib").join("browser.js?query"))); -} diff --git a/src/tests/builtins.rs b/src/tests/builtins.rs deleted file mode 100644 index 5d6d14d9..00000000 --- a/src/tests/builtins.rs +++ /dev/null @@ -1,121 +0,0 @@ -use std::path::Path; - -use crate::{ResolveError, ResolveOptions, Resolver}; - -#[test] -fn builtins_off() { - let f = Path::new("/"); - let resolver = Resolver::default(); - let resolved_path = resolver.resolve(f, "zlib").map(|r| r.full_path()); - assert_eq!(resolved_path, Err(ResolveError::NotFound("zlib".into()))); -} - -#[test] -fn builtins() { - let f = Path::new("/"); - - let resolver = Resolver::new(ResolveOptions::default().with_builtin_modules(true)); - - let pass = [ - "_http_agent", - "_http_client", - "_http_common", - "_http_incoming", - "_http_outgoing", - "_http_server", - "_stream_duplex", - "_stream_passthrough", - "_stream_readable", - "_stream_transform", - "_stream_wrap", - "_stream_writable", - "_tls_common", - "_tls_wrap", - "assert", - "assert/strict", - "async_hooks", - "buffer", - "child_process", - "cluster", - "console", - "constants", - "crypto", - "dgram", - "diagnostics_channel", - "dns", - "dns/promises", - "domain", - "events", - "fs", - "fs/promises", - "http", - "http2", - "https", - "inspector", - "module", - "net", - "os", - "path", - "path/posix", - "path/win32", - "perf_hooks", - "process", - "punycode", - "querystring", - "readline", - "repl", - "stream", - "stream/consumers", - "stream/promises", - "stream/web", - "string_decoder", - "sys", - "timers", - "timers/promises", - "tls", - "trace_events", - "tty", - "url", - "util", - "util/types", - "v8", - "vm", - "worker_threads", - "zlib", - ]; - - for request in pass { - let prefixed_request = format!("node:{request}"); - for request in [prefixed_request.clone(), request.to_string()] { - let resolved_path = resolver.resolve(f, &request).map(|r| r.full_path()); - let err = ResolveError::Builtin(prefixed_request.clone()); - assert_eq!(resolved_path, Err(err), "{request}"); - } - } -} - -#[test] -fn fail() { - let f = Path::new("/"); - let resolver = Resolver::new(ResolveOptions::default().with_builtin_modules(true)); - let request = "xxx"; - let resolved_path = resolver.resolve(f, request); - let err = ResolveError::NotFound(request.to_string()); - assert_eq!(resolved_path, Err(err), "{request}"); -} - -#[test] -fn imports() { - let f = super::fixture().join("builtins"); - let resolver = Resolver::new(ResolveOptions { - builtin_modules: true, - condition_names: vec!["node".into()], - ..ResolveOptions::default() - }); - - for request in ["#fs", "#http"] { - let resolved_path = resolver.resolve(f.clone(), request).map(|r| r.full_path()); - let err = ResolveError::Builtin(format!("node:{}", request.trim_start_matches('#'))); - assert_eq!(resolved_path, Err(err)); - } -} diff --git a/src/tests/dependencies.rs b/src/tests/dependencies.rs deleted file mode 100644 index bcc2355b..00000000 --- a/src/tests/dependencies.rs +++ /dev/null @@ -1,110 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/dependencies.test.js - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows { - use rustc_hash::FxHashSet; - use std::path::PathBuf; - - use crate::{ResolveContext, ResolveOptions, ResolverGeneric}; - - use super::super::memory_fs::MemoryFS; - - fn file_system() -> MemoryFS { - MemoryFS::new(&[ - ("/a/b/node_modules/some-module/index.js", ""), - ("/a/node_modules/module/package.json", r#"{"main":"entry.js"}"#), - ("/a/node_modules/module/file.js", r#"{"main":"entry.js"}"#), - ("/modules/other-module/file.js", ""), - ]) - } - - #[test] - fn test() { - let file_system = file_system(); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - extensions: vec![".json".into(), ".js".into()], - modules: vec!["/modules".into(), "node_modules".into()], - ..ResolveOptions::default() - }, - ); - - let data = [ - ( - "middle module request", - "/a/b/c", - "module/file", - "/a/node_modules/module/file.js", - // These dependencies are different from enhanced-resolve due to different code path to - // querying the file system - vec![ - // 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", - // "/", - ], - vec![ - // missing package.jsons - // "/a/b/c/package.json", - "/a/b/package.json", - "/a/package.json", - "/package.json", - // missing modules directories - "/a/b/c", - // "/a/b/c/node_modules", - // missing single file modules - "/modules/module", - "/a/b/node_modules/module", - // missing files with alternative extensions - "/a/node_modules/module/file", - "/a/node_modules/module/file.json", - ], - ), - ( - "fast found module", - "/a/b/c", - "other-module/file.js", - "/modules/other-module/file.js", - // These dependencies are different from enhanced-resolve due to different code path to - // querying the file system - vec![ - // symlink checks - "/modules/other-module/file.js", - // "/modules/other-module", - // "/modules", - // "/", - ], - vec![ - // missing package.jsons - // "/a/b/c/package.json", - "/a/b/c", - "/a/b/package.json", - "/a/package.json", - "/package.json", - "/modules/other-module/package.json", - "/modules/package.json", - ], - ), - ]; - - for (name, context, request, result, file_dependencies, missing_dependencies) in data { - let mut ctx = ResolveContext::default(); - let path = PathBuf::from(context); - let resolved = - resolver.resolve_with_context(path, request, &mut ctx).map(|r| r.full_path()); - assert_eq!(resolved, Ok(PathBuf::from(result))); - let file_dependencies = - FxHashSet::from_iter(file_dependencies.iter().map(PathBuf::from)); - let missing_dependencies = - FxHashSet::from_iter(missing_dependencies.iter().map(PathBuf::from)); - assert_eq!(ctx.file_dependencies, file_dependencies, "{name}"); - assert_eq!(ctx.missing_dependencies, missing_dependencies, "{name}"); - } - } -} diff --git a/src/tests/exports_field.rs b/src/tests/exports_field.rs deleted file mode 100644 index 7ca73fbd..00000000 --- a/src/tests/exports_field.rs +++ /dev/null @@ -1,2546 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/exportsField.test.js -//! -//! The huge exports field test cases are at the bottom of this file. - -use crate::{Ctx, PathUtil, ResolveError, ResolveOptions, Resolver}; -use serde_json::json; -use std::path::Path; - -#[test] -fn test_simple() { - let f = super::fixture().join("exports-field"); - let f2 = super::fixture().join("exports-field2"); - let f4 = super::fixture().join("exports-field-error"); - let f5 = super::fixture().join("imports-exports-wildcard"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - fully_specified: true, - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("resolve root using exports field, not a main field", f.clone(), "exports-field", f.join("node_modules/exports-field/x.js")), - ("resolver should respect condition names", f.clone(), "exports-field/dist/main.js", f.join("node_modules/exports-field/lib/lib2/main.js")), - // enhanced_resolve behaves differently to node.js. enhanced_resolve fallbacks when an - // array item is unresolved, where as node.js fallbacks when an array has an - // InvalidPackageTarget error. - // ("resolver should respect fallback", f2.clone(), "exports-field/dist/browser.js", f2.join("node_modules/exports-field/lib/browser.js")), - // The following two tests require fallback from array values, the path is changed here to - // only test query and fragment. - ("resolver should respect query parameters #1", f2.clone(), "exports-field/dist/main.js?foo", f2.join("node_modules/exports-field/lib/lib2/main.js?foo")), - ("resolver should respect fragment parameters #1", f2.clone(), "exports-field/dist/main.js#foo", f2.join("node_modules/exports-field/lib/lib2/main.js#foo")), - ("relative path should work, if relative path as request is used", f.clone(), "./node_modules/exports-field/lib/main.js", f.join("node_modules/exports-field/lib/main.js")), - ("self-resolving root", f.clone(), "@exports-field/core", f.join("a.js")), - ("should resolve with wildcard pattern #1", f5.clone(), "m/features/f.js", f5.join("node_modules/m/src/features/f.js")), - ("should resolve with wildcard pattern #2", f5.clone(), "m/features/y/y.js", f5.join("node_modules/m/src/features/y/y.js")), - ("should resolve with wildcard pattern #3", f5.clone(), "m/features-no-ext/y/y.js", f5.join("node_modules/m/src/features/y/y.js")), - ("should resolve with wildcard pattern #4", f5.clone(), "m/middle/nested/f.js", f5.join("node_modules/m/src/middle/nested/f.js")), - ("should resolve with wildcard pattern #5", f5.clone(), "m/middle-1/nested/f.js", f5.join("node_modules/m/src/middle-1/nested/f.js")), - ("should resolve with wildcard pattern #6", f5.clone(), "m/middle-2/nested/f.js", f5.join("node_modules/m/src/middle-2/nested/f.js")), - ("should resolve with wildcard pattern #7", f5.clone(), "m/middle-3/nested/f", f5.join("node_modules/m/src/middle-3/nested/f/nested/f.js")), - ("should resolve with wildcard pattern #8", f5.clone(), "m/middle-4/f/nested", f5.join("node_modules/m/src/middle-4/f/f.js")), - ("should resolve with wildcard pattern #9", f5.clone(), "m/middle-5/f$/$", f5.join("node_modules/m/src/middle-5/f$/$.js")), - ]; - - // Not needed or snapshot: - // * should log the correct info - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } - - let p = f.join("node_modules/exports-field/package.json"); - let p2 = f2.join("node_modules/exports-field/package.json"); - let p4 = f4.join("node_modules/exports-field/package.json"); - let p5 = f5.join("node_modules/m/package.json"); - - #[rustfmt::skip] - let fail = [ - // ("throw error if extension not provided", f2.clone(), "exports-field/dist/main", ResolveError::NotFound(f2.join("node_modules/exports-field/lib/lib2/main"))), - ("resolver should respect query parameters #2. Direct matching", f2.clone(), "exports-field?foo", ResolveError::PackagePathNotExported("./?foo".into(), p2.clone())), - ("resolver should respect fragment parameters #2. Direct matching", f2, "exports-field#foo", ResolveError::PackagePathNotExported("./#foo".into(), p2)), - ("relative path should not work with exports field", f.clone(), "./node_modules/exports-field/dist/main.js", ResolveError::NotFound("./node_modules/exports-field/dist/main.js".into())), - ("backtracking should not work for request", f.clone(), "exports-field/dist/../../../a.js", ResolveError::InvalidPackageTarget("./lib/../../../a.js".to_string(), "./dist/".to_string(), p.clone())), - ("backtracking should not work for exports field target", f.clone(), "exports-field/dist/a.js", ResolveError::InvalidPackageTarget("./../../a.js".to_string(), "./dist/a.js".to_string(), p.clone())), - ("not exported error", f.clone(), "exports-field/anything/else", ResolveError::PackagePathNotExported("./anything/else".to_string(), p.clone())), - ("request ending with slash #1", f.clone(), "exports-field/", ResolveError::PackagePathNotExported("./".to_string(), p.clone())), - ("request ending with slash #2", f.clone(), "exports-field/dist/", ResolveError::PackagePathNotExported("./dist/".to_string(), p.clone())), - ("request ending with slash #3", f.clone(), "exports-field/lib/", ResolveError::PackagePathNotExported("./lib/".to_string(), p)), - ("should throw error if target is invalid", f4, "exports-field", ResolveError::InvalidPackageTarget("./a/../b/../../pack1/index.js".to_string(), ".".to_string(), p4)), - ("throw error if exports field is invalid", f.clone(), "invalid-exports-field", ResolveError::InvalidPackageConfig(f.join("node_modules/invalid-exports-field/package.json"))), - ("should throw error if target is 'null'", f5, "m/features/internal/file.js", ResolveError::PackagePathNotExported("./features/internal/file.js".to_string(), p5)), - ]; - - for (comment, path, request, error) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!(resolution, Err(error), "{comment} {path:?} {request}"); - } -} - -// resolve using exports field, not a browser field #1 -#[test] -fn exports_not_browser_field1() { - let f = super::fixture().join("exports-field"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - condition_names: vec!["webpack".into()], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "exports-field/dist/main.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("node_modules/exports-field/lib/lib2/main.js"))); -} - -// resolve using exports field and a browser alias field #2 -#[test] -fn exports_not_browser_field2() { - let f2 = super::fixture().join("exports-field2"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - extensions: vec![".js".into()], - condition_names: vec!["node".into()], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f2, "exports-field/dist/main.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f2.join("node_modules/exports-field/lib/browser.js"))); -} - -// should resolve extension without fullySpecified -#[test] -fn extension_without_fully_specified() { - let f2 = super::fixture().join("exports-field2"); - - let commonjs_resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - let resolved_path = - commonjs_resolver.resolve(&f2, "exports-field/dist/main").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f2.join("node_modules/exports-field/lib/lib2/main.js"))); -} - -#[test] -fn field_name_path() { - let f2 = super::fixture().join("exports-field2"); - let f3 = super::fixture().join("exports-field3"); - - // field name path #1 #2 #3 - let exports_fields = [ - vec![vec!["exportsField".into(), "exports".into()]], - vec![vec!["exportsField".into(), "exports".into()], vec!["exports".into()]], - vec![vec!["exports".into()], vec!["exportsField".into(), "exports".into()]], - ]; - - for exports_fields in exports_fields { - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - exports_fields, - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/main.js"))); - } - - // field name path #4 - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - exports_fields: vec![vec!["exports".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f2, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f2.join("node_modules/exports-field/index.js"))); - - // field name path #5 - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - exports_fields: vec![vec!["ex".into()], vec!["exports_field".into(), "exports".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/index"))); - - // non-compliant export targeting a directory - let resolver = Resolver::new(ResolveOptions { - exports_fields: vec![vec!["broken".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/src/index.js"))); -} - -#[test] -fn shared_resolvers() { - let f3 = super::fixture().join("exports-field3"); - - let resolver1 = Resolver::new(ResolveOptions { - exports_fields: vec![vec!["exportsField".into(), "exports".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver1.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/main.js"))); - - let resolver2 = resolver1.clone_with_options(ResolveOptions { - exports_fields: vec![vec!["ex".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver2.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/index"))); -} - -#[test] -fn extension_alias_1_2() { - let f = super::fixture().join("exports-field-and-extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - extension_alias: vec![(".js".into(), vec![".ts".into(), ".js".into()])], - fully_specified: true, - condition_names: vec!["webpack".into(), "default".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve with the `extensionAlias` option", f.clone(), "@org/pkg/string.js", f.join("node_modules/@org/pkg/dist/string.js")), - ("should resolve with the `extensionAlias` option #2", f.clone(), "pkg/string.js", f.join("node_modules/pkg/dist/string.js")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn extension_alias_3() { - let f = super::fixture().join("exports-field-and-extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - extension_alias: vec![( - ".js".into(), - vec![".foo".into(), ".baz".into(), ".baz".into(), ".ts".into(), ".js".into()], - )], - fully_specified: true, - condition_names: vec!["webpack".into(), "default".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve with the `extensionAlias` option #3", f.clone(), "pkg/string.js", f.join("node_modules/pkg/dist/string.js")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn extension_alias_throw_error() { - let f = super::fixture().join("exports-field-and-extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - extension_alias: vec![(".js".into(), vec![".ts".into()])], - fully_specified: true, - condition_names: vec!["webpack".into(), "default".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let fail = [ - // enhanced-resolve has two test cases that are exactly the same here - // https://github.com/webpack/enhanced-resolve/blob/a998c7d218b7a9ec2461fc4fddd1ad5dd7687485/test/exportsField.test.js#L2976-L3024 - ("should throw error with the `extensionAlias` option", f.clone(), "pkg/string.js", ResolveError::ExtensionAlias(f.join("node_modules/pkg/dist/string.js"))), - // TODO: The error is PackagePathNotExported in enhanced-resolve - // ("should throw error with the `extensionAlias` option", f.clone(), "pkg/string.js", ResolveError::PackagePathNotExported("node_modules/pkg/dist/string.ts".to_string())), - ]; - - for (comment, path, request, error) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!(resolution, Err(error), "{comment} {path:?} {request}"); - } -} - -// Small script for generating the test cases from enhanced-resolve -// for (c of testCases) { -// console.log("TestCase {") -// console.log(`name: ${JSON.stringify(c.name)},`) -// if (c.expect instanceof Error) { -// console.log(`expect: None,`) -// } else { -// console.log(`expect: Some(vec!${JSON.stringify(c.expect)}),`) -// } -// console.log(`exports_field: exports_field(json!(${JSON.stringify(c.suite[0], null, 2)})),`) -// console.log(`request: "${c.suite[1]}",`) -// console.log(`condition_names: vec!${JSON.stringify(c.suite[2])},`) -// console.log("},") -//} -struct TestCase { - name: &'static str, - expect: Option>, - exports_field: serde_json::Value, - request: &'static str, - condition_names: Vec<&'static str>, -} - -#[allow(clippy::needless_pass_by_value)] -fn exports_field(value: serde_json::Value) -> serde_json::Value { - value -} - -#[test] -fn test_cases() { - let test_cases = [ - TestCase { - name: "sample #1", - expect: Some(vec!["./dist/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/": { - "import": [ - "./dist/", - "./src/" - ], - "webpack": "./wp/" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "sample #1", - expect: Some(vec!["./src/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/": { - "import": [ - "./src/" - ], - "webpack": "./wp/" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - TestCase { - name: "sample #1 (wildcard)", - expect: Some(vec!["./dist/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/*": { - "import": [ - "./dist/*", - "./src/*" - ], - "webpack": "./wp/*" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "sample #1 (wildcard)", - expect: Some(vec!["./src/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/*": { - "import": [ - "./src/*" - ], - "webpack": "./wp/*" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - TestCase { - name: "sample #2", - expect: Some(vec!["./data/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./timezones/": "./data/timezones/" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #2 (wildcard)", - expect: Some(vec!["./data/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./timezones/*": "./data/timezones/*" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #3", - expect: Some(vec!["./data/timezones/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./": "./data/timezones/" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #3 (wildcard)", - expect: Some(vec!["./data/timezones/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./*": "./data/timezones/*.mjs" - })), - request: "./timezones/pdt", - condition_names: vec![], - }, - TestCase { - name: "sample #4", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./lib/": { - "browser": [ - "./browser/" - ] - }, - "./dist/index.js": { - "node": "./index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #4 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "node": "./index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #5", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/": { - "browser": [ - "./browser/" - ] - }, - "./dist/index.js": { - "node": "./index.js", - "default": "./browser/index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #5 (wildcard)", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "node": "./index.js", - "default": "./browser/index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./dist/a": "./dist/index.js" - })), - request: "./dist/aaa", - condition_names: vec![], - }, - TestCase { - name: "sample #7", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./dist/a/a/": "./dist/index.js" - })), - request: "./dist/a/a", - condition_names: vec![], - }, - TestCase { - name: "sample #7 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./dist/a/a/*": "./dist/index.js" - })), - request: "./dist/a/a", - condition_names: vec![], - }, - TestCase { - name: "sample #8", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": "./index.js" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #9", - expect: Some(vec!["./main.js"]), - exports_field: exports_field(json!({ - "./index.js": "./main.js" - })), - request: "./index.js", - condition_names: vec![], - }, - TestCase { - name: "sample #10", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #11", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./bar#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #12", - expect: Some(vec!["./ok.js#abc"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/ok.js#abc", - condition_names: vec![], - }, - TestCase { - name: "sample #12", - expect: Some(vec!["./ok.js#abc"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/ok.js#abc", - condition_names: vec![], - }, - TestCase { - name: "sample #13", - expect: Some(vec!["./ok.js?abc"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/ok.js?abc", - condition_names: vec![], - }, - TestCase { - name: "sample #14", - expect: Some(vec!["./🎉.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/🎉.js", - condition_names: vec![], - }, - TestCase { - name: "sample #15", - expect: Some(vec!["./%F0%9F%8E%89.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/%F0%9F%8E%89.js", - condition_names: vec![], - }, - TestCase { - name: "sample #16", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./🎉", - condition_names: vec![], - }, - TestCase { - name: "sample #17", - expect: Some(vec!["./other.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./%F0%9F%8E%89", - condition_names: vec![], - }, - TestCase { - name: "sample #18", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./module", - condition_names: vec![], - }, - TestCase { - name: "sample #19", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./module#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #20", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./module?foo", - condition_names: vec![], - }, - TestCase { - name: "sample #21", - expect: Some(vec!["./zizizi"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./z*z*z*" - })), - request: "./#zippi", - condition_names: vec![], - }, - TestCase { - name: "sample #22", - expect: Some(vec!["./d?e?f"]), - exports_field: exports_field(json!({ - "./a?b?c/": "./" - })), - request: "./a?b?c/d?e?f", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #1", - expect: Some(vec!["./dist/index.js"]), - exports_field: exports_field(json!({ - ".": "./dist/index.js" - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #2", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./": "./", - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #3", - expect: Some(vec!["./dist/a.js"]), - exports_field: exports_field(json!({ - "./dist/": "./dist/", - "./dist/*": "./dist/*", - "./dist*": "./dist*", - "./dist/index.js": "./dist/a.js" - })), - request: "./dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #4", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./": { - "browser": [ - "./browser/" - ] - }, - "./*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "browser": "./index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #5", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./": { - "browser": [ - "./browser/" - ] - }, - "./*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "node": "./node.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #6", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - ".": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #7", - expect: Some(vec!["./src/index.js"]), // `enhanced_resolve` is `None` - exports_field: exports_field(json!({ - ".": { - "default": "./src/index.js", - "browser": "./index.js", - "node": "./src/node/index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #8", - expect: Some(vec!["./src/index.js"]), - exports_field: exports_field(json!({ - ".": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #9", - expect: Some(vec!["./index"]), - exports_field: exports_field(json!({ - ".": "./index" - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #10", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./index": "./index.js" - })), - request: "./index", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #11", - expect: Some(vec!["./foo.js"]), - exports_field: exports_field(json!({ - "./": "./", - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #12", - expect: Some(vec!["./foo/bar/baz.js"]), - exports_field: exports_field(json!({ - "./": "./", - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo/bar/baz.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #13", - expect: Some(vec!["./foo/bar/baz.js"]), - exports_field: exports_field(json!({ - "./": "./", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo/bar/baz.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #14", - expect: Some(vec!["./foo/bar/baz.js"]), - exports_field: exports_field(json!({ - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo/bar/baz.js", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #1", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "require": "./require.js" - }, { - "import": "./import.mjs" - }] - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #2", - expect: Some(vec!["./import.mjs"]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "require": "./require.js" - }, { - "import": "./import.mjs" - }] - })), - request: ".", - condition_names: vec!["import"], - }, - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./require.js"]), - exports_field: exports_field(json!({ - ".": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./import.mjs"]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "import": "./import.mjs" - }] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./require.js"]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "require": [ - "./require.js" - ] - }, { - "import": [ - "./import.mjs", - "./import.js" - ] - }] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./import.mjs"]), - exports_field: exports_field(json!({ - ".": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "./import.mjs", - "./import.js" - ] - } - ] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./import.js"]), - exports_field: exports_field(json!({ - ".": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "./import.js" - ] - } - ] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "mapping to a folder root #1", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./timezones": "./data/timezones/" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #2", - expect: None, - exports_field: exports_field(json!({ - "./timezones/": "./data/timezones" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #3", - expect: Some(vec!["./data/timezones/pdt/index.mjs"]), - exports_field: exports_field(json!({ - "./timezones/pdt/": "./data/timezones/pdt/" - })), - request: "./timezones/pdt/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #3 (wildcard)", - expect: Some(vec!["./data/timezones/pdt/index.mjs"]), - exports_field: exports_field(json!({ - "./timezones/pdt/*": "./data/timezones/pdt/*" - })), - request: "./timezones/pdt/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #4", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./": "./timezones/" - })), - request: "./pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #4 (wildcard)", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./*": "./timezones/*" - })), - request: "./pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #5", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./": "./" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #5 (wildcard)", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./*": "./*" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #6", - expect: None, - exports_field: exports_field(json!({ - "./": "." - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #6 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "./*": "." - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #7", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": "./" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #7 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": "./*" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #1", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./": "./", - "./dist/": "./lib/" - })), - request: "./dist/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #1 (wildcard)", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./*": "./*", - "./dist/*": "./lib/*" - })), - request: "./dist/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #2", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/": "./dist/utils/", - "./dist/": "./lib/" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #2 (wildcard)", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/*": "./dist/utils/*", - "./dist/*": "./lib/*" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #3", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/index.js": "./dist/utils/index.js", - "./dist/utils/": "./dist/utils/index.mjs", - "./dist/": "./lib/" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #3 (wildcard)", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/index.js": "./dist/utils/index.js", - "./dist/utils/*": "./dist/utils/index.mjs", - "./dist/*": "./lib/*" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #4", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./": { - "browser": "./browser/" - }, - "./dist/": "./lib/" - })), - request: "./dist/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "the longest matching path prefix is prioritized #4 (wildcard)", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./*": { - "browser": "./browser/*" - }, - "./dist/*": "./lib/*" - })), - request: "./dist/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #1", - // `lodash/` does not start with './' so fallbacks to util - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "conditional mapping folder #1", - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": [ - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #1 (wildcard)", - // `lodash/` does not start with './' so fallbacks to util - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": [ - "lodash/*", - "./utils/*" - ], - "node": [ - "./utils-node/*" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "conditional mapping folder #1 (wildcard)", - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": [ - "./utils/*" - ], - "node": [ - "./utils-node/*" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #2", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./node/" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "conditional mapping folder #2 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "webpack": "./wpk/*", - "browser": [ - "lodash/*", - "./utils/*" - ], - "node": [ - "./node/*" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "conditional mapping folder #3", - expect: Some(vec!["./wpk/index.mjs"]), - exports_field: exports_field(json!({ - "./utils/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils/" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "conditional mapping folder #3 (wildcard)", - expect: Some(vec!["./wpk/index.mjs"]), - exports_field: exports_field(json!({ - "./utils/*": { - "webpack": "./wpk/*", - "browser": [ - "lodash/*", - "./utils/*" - ], - "node": [ - "./utils/*" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "incorrect exports field #1", - expect: None, - exports_field: exports_field(json!({ - "/utils/": "./a/" - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #2", - expect: None, - exports_field: exports_field(json!({ - "./utils/": "/a/" - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #3", - expect: None, - exports_field: exports_field(json!({ - "/utils/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #4", - expect: None, - exports_field: exports_field(json!({ - "./utils/": { - "browser": "/a/", - "default": "/b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #4 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "/a/", - "default": "/b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #5", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index": "./a/index.js" - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index.mjs": "./a/index.js" - })), - request: "./utils/index", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #7", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #8", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index.mjs": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - // Requests that are not `./` does not apply to `package_exports_resolve` - // TestCase { - // name: "incorrect request #1", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": "./a/" - // })), - // request: "/utils/index.mjs", - // condition_names: vec![], - // }, - // TestCase { - // name: "incorrect request #2", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": { - // "browser": "./a/", - // "default": "./b/" - // } - // })), - // request: "/utils/index.mjs", - // condition_names: vec!["browser"], - // }, - // TestCase { - // name: "incorrect request #3", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": { - // "browser": "./a/", - // "default": "./b/" - // } - // })), - // request: "../utils/index.mjs", - // condition_names: vec!["browser"], - // }, - // TestCase { - // name: "incorrect request #4", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": { - // "browser": "./a/", - // "default": "./b/" - // } - // })), - // request: "/utils/index.mjs/", - // condition_names: vec!["browser"], - // }, - TestCase { - name: "backtracking package base #1", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./../../utils/": "./dist/" - })), - request: "./../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #1 (wildcard)", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./../../utils/*": "./dist/*" - })), - request: "./../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #2", - expect: None, - exports_field: exports_field(json!({ - "../../utils/": "./dist/" - })), - request: "../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #2 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "../../utils/*": "./dist/*" - })), - request: "../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #3", - expect: None, - exports_field: exports_field(json!({ - "./utils/": "../src/" - })), - request: "./utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #3 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "./utils/*": "../src/*" - })), - request: "./utils/index", - condition_names: vec![], - }, - // enhanced-resolve does not handle backtracking here - // TestCase { - // name: "backtracking package base #4", - // expect: Some(vec!["./../src/index"]), - // exports_field: exports_field(json!({ - // "./utils/": "./../src/" - // })), - // request: "./utils/index", - // condition_names: vec![], - // }, - // TestCase { - // name: "backtracking package base #4 (wildcard)", - // expect: Some(vec!["./../src/index"]), - // exports_field: exports_field(json!({ - // "./utils/*": "./../src/*" - // })), - // request: "./utils/index", - // condition_names: vec![], - // }, - // TestCase { - // name: "backtracking package base #5", - // expect: Some(vec!["./src/../index.js"]), - // exports_field: exports_field(json!({ - // "./utils/index": "./src/../index.js" - // })), - // request: "./utils/index", - // condition_names: vec![], - // }, - TestCase { - name: "backtracking package base #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/../utils/index": "./src/../index.js" - })), - request: "./utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #7", - expect: None, - exports_field: exports_field(json!({ - "./utils/": { - "browser": "../this/" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #7", - expect: None, - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "../this/*" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #8", - // We throw "InvalidPackageTarget" - // expect: Some(vec!["./utils/../index"]), - expect: None, - exports_field: exports_field(json!({ - "./utils/": { - "browser": "./utils/../" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #8 (wildcard)", - // We throw "InvalidPackageTarget" - // expect: Some(vec!["./utils/../index"]), - expect: None, - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "./utils/../*" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #9", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./": "./src/../../", - "./dist/": "./dist/" - })), - request: "./dist/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #9 (wildcard)", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./*": "./src/../../*", - "./dist/*": "./dist/*" - })), - request: "./dist/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking target folder #1", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../../index"]), - exports_field: exports_field(json!({ - "./utils/": "./dist/" - })), - request: "./utils/timezone/../../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #1 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../../index"]), - exports_field: exports_field(json!({ - "./utils/*": "./dist/*" - })), - request: "./utils/timezone/../../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #2", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../index"]), - exports_field: exports_field(json!({ - "./utils/": "./dist/" - })), - request: "./utils/timezone/../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #2 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../index"]), - exports_field: exports_field(json!({ - "./utils/*": "./dist/*" - })), - request: "./utils/timezone/../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #3", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/target/../../index"]), - exports_field: exports_field(json!({ - "./utils/": "./dist/target/" - })), - request: "./utils/../../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #3 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/target/../../index"]), - exports_field: exports_field(json!({ - "./utils/*": "./dist/target/*" - })), - request: "./utils/../../index", - condition_names: vec![], - }, - // enhanced-resolve does not handle `node_modules` in target - TestCase { - name: "nested node_modules path #1", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": "./node_modules/" - } - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #1 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "./node_modules/*" - } - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #2", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./utils/../node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/": "./utils/../node_modules/" - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "nested node_modules path #2 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./utils/../node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": "./utils/../node_modules/*" - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "nested mapping #1", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": "./", - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested mapping #1 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": "./*", - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "nested mapping #2 (wildcard)", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #2 (wildcard)", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "nested mapping #3", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["webpack"], - }, - TestCase { - name: "nested mapping #3 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["webpack"], - }, - TestCase { - name: "nested mapping #4", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["node", "browser"], - }, - TestCase { - name: "nested mapping #4 (wildcard)", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["node", "browser"], - }, - TestCase { - name: "nested mapping #5", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node"], - }, - TestCase { - name: "nested mapping #5 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": { - "webpack": [ - "./wpck/*" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node"], - }, - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - TestCase { - name: "nested mapping #6 (wildcard)", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": { - "webpack": [ - "./wpck/*" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #6 (wildcard)", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./node/*" - ], - "default": { - "node": { - "webpack": [ - "./wpck/*" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - TestCase { - name: "nested mapping #7", - expect: Some(vec!["./y.js"]), - exports_field: exports_field(json!({ - "./a.js": { - "abc": { - "def": "./x.js" - }, - "ghi": "./y.js" - } - })), - request: "./a.js", - condition_names: vec!["abc", "ghi"], - }, - TestCase { - name: "nested mapping #8", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./a.js": { - "abc": { - "def": "./x.js", - "default": [] - }, - "ghi": "./y.js" - } - })), - request: "./a.js", - condition_names: vec!["abc", "ghi"], - }, - TestCase { - name: "syntax sugar #1", - expect: Some(vec!["./main.js"]), - exports_field: exports_field(json!("./main.js")), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #2", - expect: Some(vec![]), - exports_field: exports_field(json!("./main.js")), - request: "./lib.js", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #3", - expect: Some(vec!["./a.js"]), - exports_field: exports_field(json!(["./a.js", "./b.js"])), - request: ".", - condition_names: vec![], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "syntax sugar #3", - expect: Some(vec!["./b.js"]), - exports_field: exports_field(json!(["./b.js"])), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #4", - expect: Some(vec![]), - exports_field: exports_field(json!(["./a.js", "./b.js"])), - request: "./lib.js", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #5", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "browser": { - "default": "./index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "syntax sugar #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "browser": { - "default": "./index.js" - } - })), - request: "./lib.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "syntax sugar #7", - expect: None, - exports_field: exports_field(json!({ - "./node": "./node.js", - "browser": { - "default": "./index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "syntax sugar #8", - expect: None, - exports_field: exports_field(json!({ - "browser": { - "default": "./index.js" - }, - "./node": "./node.js" - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #1", - expect: Some(vec!["./abc/d"]), - exports_field: exports_field(json!({ - "./ab*": "./ab/*", - "./abc*": "./abc/*", - "./a*": "./a/*" - })), - request: "./abcd", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #2", - expect: Some(vec!["./abc/d/e"]), - exports_field: exports_field(json!({ - "./ab*": "./ab/*", - "./abc*": "./abc/*", - "./a*": "./a/*" - })), - request: "./abcd/e", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #3", - expect: Some(vec!["./abc/d"]), - exports_field: exports_field(json!({ - "./x/ab*": "./ab/*", - "./x/abc*": "./abc/*", - "./x/a*": "./a/*" - })), - request: "./x/abcd", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #4", - expect: Some(vec!["./abc/d/e"]), - exports_field: exports_field(json!({ - "./x/ab*": "./ab/*", - "./x/abc*": "./abc/*", - "./x/a*": "./a/*" - })), - request: "./x/abcd/e", - condition_names: vec!["browser"], - }, - TestCase { - name: "path tree edge case #1", - expect: Some(vec!["./A/b/d.js"]), - exports_field: exports_field(json!({ - "./a/": "./A/", - "./a/b/c": "./c.js" - })), - request: "./a/b/d.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #1 (wildcard)", - expect: Some(vec!["./A/b/d.js"]), - exports_field: exports_field(json!({ - "./a/*": "./A/*", - "./a/b/c": "./c.js" - })), - request: "./a/b/d.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #2", - expect: Some(vec!["./A/c.js"]), - exports_field: exports_field(json!({ - "./a/": "./A/", - "./a/b": "./b.js" - })), - request: "./a/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #2 (wildcard)", - expect: Some(vec!["./A/c.js"]), - exports_field: exports_field(json!({ - "./a/*": "./A/*", - "./a/b": "./b.js" - })), - request: "./a/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #3", - expect: Some(vec!["./A/b/d/c.js"]), - exports_field: exports_field(json!({ - "./a/": "./A/", - "./a/b/c/d": "./c.js" - })), - request: "./a/b/d/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #3 (wildcard)", - expect: Some(vec!["./A/b/d/c.js"]), - exports_field: exports_field(json!({ - "./a/*": "./A/*", - "./a/b/c/d": "./c.js" - })), - request: "./a/b/d/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #1", - expect: Some(vec!["./A/b.js"]), - exports_field: exports_field(json!({ - "./a/*.js": "./A/*.js" - })), - request: "./a/b.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #2", - expect: Some(vec!["./A/b/c.js"]), - exports_field: exports_field(json!({ - "./a/*.js": "./A/*.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #3", - expect: Some(vec!["./A/b/c.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": "./A/*/c.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #4", - expect: Some(vec!["./A/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": "./A/*/*.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #5", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/*.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #5", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/*.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./lib/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #6", - expect: Some(vec!["./browser/foo/bar.js"]), - exports_field: exports_field(json!({ - "./lib/*/bar.js": { - "browser": [ - "./browser/*/bar.js" - ] - }, - "./dist/*/bar.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./lib/foo/bar.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #6", - expect: Some(vec!["./browser/foo.js"]), - exports_field: exports_field(json!({ - "./lib/*/bar.js": { - "browser": [ - "./browser/*/bar.js" - ] - }, - "./dist/*/bar.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./dist/foo/bar.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #7", - expect: Some(vec!["./browser/foo/default.js"]), - exports_field: exports_field(json!({ - "./lib/*/bar.js": { - "browser": [ - "./browser/*/bar.js" - ] - }, - "./dist/*/bar.js": { - "node": "./*.js", - "default": "./browser/*/default.js" - } - })), - request: "./dist/foo/bar.js", - condition_names: vec!["default"], - }, - TestCase { - name: "wildcard pattern #8", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": "./A/*/*/*.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #9", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": [ - "./A/*/*/*.js", - "./B/*/*/*.js" - ] - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "wildcard pattern #9", - expect: Some(vec!["./B/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": [ - "./B/*/*/*.js" - ] - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #10", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/foo-*/c.js": "./A/*/*/*.js" - })), - request: "./a/foo-b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #11", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*-foo/c.js": "./A/*/*/*.js" - })), - request: "./a/b-foo/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #12", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/foo-*-foo/c.js": "./A/*/*/*.js" - })), - request: "./a/foo-b-foo/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #13", - expect: Some(vec!["./A/b/c/d.js"]), - exports_field: exports_field(json!({ - "./a/foo-*-foo/c.js": "./A/b/c/d.js" - })), - request: "./a/foo-b-foo/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #14", - expect: Some(vec!["./A/b/c/*.js"]), - exports_field: exports_field(json!({ - "./a/foo-foo/c.js": "./A/b/c/*.js" - })), - request: "./a/foo-foo/c.js", - condition_names: vec![], - }, - ]; - - for case in test_cases { - let resolved = Resolver::new(ResolveOptions { - condition_names: case - .condition_names - .iter() - .map(ToString::to_string) - .collect::>(), - ..ResolveOptions::default() - }) - .package_exports_resolve( - Path::new(""), - case.request, - &case.exports_field, - &mut Ctx::default(), - ) - .map(|p| p.map(|p| p.to_path_buf())); - if let Some(expect) = case.expect { - if expect.is_empty() { - assert!( - matches!(resolved, Err(ResolveError::PackagePathNotExported(_, _))), - "{} {:?}", - &case.name, - &resolved - ); - } else { - for expect in expect { - assert_eq!(resolved, Ok(Some(Path::new(expect).normalize())), "{}", &case.name); - } - } - } else { - assert!(resolved.is_err(), "{} {resolved:?}", &case.name); - } - } -} diff --git a/src/tests/extension_alias.rs b/src/tests/extension_alias.rs deleted file mode 100644 index cc6a906b..00000000 --- a/src/tests/extension_alias.rs +++ /dev/null @@ -1,70 +0,0 @@ -//! - -use crate::{ResolveError, ResolveOptions, Resolver}; - -#[test] -fn extension_alias() { - let f = super::fixture().join("extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - extension_alias: vec![ - (".js".into(), vec![".ts".into(), ".js".into()]), - (".mjs".into(), vec![".mts".into()]), - ], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should alias fully specified file", f.clone(), "./index.js", f.join("index.ts")), - ("should alias fully specified file when there are two alternatives", f.clone(), "./dir/index.js", f.join("dir/index.ts")), - ("should also allow the second alternative", f.clone(), "./dir2/index.js", f.join("dir2/index.js")), - ("should support alias option without an array", f.clone(), "./dir2/index.mjs", f.join("dir2/index.mts")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } - - #[rustfmt::skip] - let fail = [ - ("should not allow to fallback to the original extension or add extensions", f.clone(), "./index.mjs"), - ]; - - for (comment, path, request) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!( - resolution, - Err(ResolveError::ExtensionAlias(f.join(request))), - "{comment} {path:?} {request}" - ); - } -} - -// should not apply extension alias to extensions or mainFiles field -#[test] -fn not_apply_to_extension_nor_main_files() { - let f = super::fixture().join("extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - extension_alias: vec![(".js".into(), vec![])], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("directory", f.clone(), "./dir2", "dir2/index.js"), - ("file", f.clone(), "./dir2/index", "dir2/index.js"), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - let expected = f.join(expected); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} diff --git a/src/tests/extensions.rs b/src/tests/extensions.rs deleted file mode 100644 index 1ebd86f4..00000000 --- a/src/tests/extensions.rs +++ /dev/null @@ -1,125 +0,0 @@ -//! - -use crate::{EnforceExtension, Resolution, ResolveContext, ResolveError, ResolveOptions, Resolver}; -use rustc_hash::FxHashSet; - -#[test] -fn extensions() { - let f = super::fixture().join("extensions"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".ts".into(), ".js".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve according to order of provided extensions", "./foo", "foo.ts"), - ("should resolve according to order of provided extensions (dir index)", "./dir", "dir/index.ts"), - ("should resolve according to main field in module root", ".", "index.js"), - // This is a core module - // ("should resolve single file module before directory", "module", "node_modules/module.js"), - ("should resolve trailing slash directory before single file", "module/", "node_modules/module/index.ts"), - ]; - - for (comment, request, expected_path) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - let expected = f.join(expected_path); - assert_eq!(resolved_path, Ok(expected), "{comment} {request} {expected_path}"); - } - - #[rustfmt::skip] - let fail = [ - ("not resolve to file when request has a trailing slash (relative)", "./foo.js/", "./foo.js/".into()) - ]; - - for (comment, request, expected_error) in fail { - let resolution = resolver.resolve(&f, request); - let error = ResolveError::NotFound(expected_error); - assert_eq!(resolution, Err(error), "{comment} {request} {resolution:?}"); - } -} - -// should default enforceExtension to true when extensions includes an empty string -#[test] -fn default_enforce_extension() { - let f = super::fixture().join("extensions"); - - let mut ctx = ResolveContext::default(); - let resolved = Resolver::new(ResolveOptions { - extensions: vec![".ts".into(), String::new(), ".js".into()], - ..ResolveOptions::default() - }) - .resolve_with_context(&f, "./foo", &mut ctx); - - assert_eq!(resolved.map(Resolution::into_path_buf), Ok(f.join("foo.ts"))); - assert_eq!( - ctx.file_dependencies, - FxHashSet::from_iter([f.join("foo.ts"), f.join("package.json")]) - ); - assert!(ctx.missing_dependencies.is_empty()); -} - -// should respect enforceExtension when extensions includes an empty string -#[test] -fn respect_enforce_extension() { - let f = super::fixture().join("extensions"); - - let mut ctx = ResolveContext::default(); - let resolved = Resolver::new(ResolveOptions { - enforce_extension: EnforceExtension::Disabled, - extensions: vec![".ts".into(), String::new(), ".js".into()], - ..ResolveOptions::default() - }) - .resolve_with_context(&f, "./foo", &mut ctx); - - assert_eq!(resolved.map(Resolution::into_path_buf), Ok(f.join("foo.ts"))); - assert_eq!( - ctx.file_dependencies, - FxHashSet::from_iter([f.join("foo.ts"), f.join("package.json")]) - ); - assert_eq!(ctx.missing_dependencies, FxHashSet::from_iter([f.join("foo")])); -} - -#[test] -fn multi_dot_extension() { - let f = super::fixture().join("extensions"); - - let resolver = Resolver::new(ResolveOptions { - // Test for `.d.ts`, not part of enhanced-resolve. - extensions: vec![".a.b.c".into(), ".d.ts".into(), ".ts".into(), ".js".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve according to order of provided extensions", "./foo", "foo.ts"), - ("should resolve file with extension", "./app.module", "app.module.js") - ]; - - for (comment, request, expected_path) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - let expected = f.join(expected_path); - assert_eq!(resolved_path, Ok(expected), "{comment} {request} {expected_path}"); - } - - #[rustfmt::skip] - let fail = [ - ("not resolve to file", "./index.", "./index.".into()) - ]; - - for (comment, request, expected_error) in fail { - let resolution = resolver.resolve(&f, request); - let error = ResolveError::NotFound(expected_error); - assert_eq!(resolution, Err(error), "{comment} {request} {resolution:?}"); - } -} - -#[test] -#[should_panic = "All extensions must start with a leading dot"] -fn without_leading_dot() { - Resolver::new(ResolveOptions { - extensions: vec!["ts".into(), "js".into()], - ..ResolveOptions::default() - }); -} diff --git a/src/tests/fallback.rs b/src/tests/fallback.rs deleted file mode 100644 index 3da2d767..00000000 --- a/src/tests/fallback.rs +++ /dev/null @@ -1,100 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/fallback.test.js - -#[test] -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -fn fallback() { - use super::memory_fs::MemoryFS; - use crate::{AliasValue, ResolveError, ResolveOptions, ResolverGeneric}; - use std::path::{Path, PathBuf}; - - let f = Path::new("/"); - - let file_system = MemoryFS::new(&[ - ("/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", ""), - ]); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - fallback: vec![ - ("aliasA".into(), vec![AliasValue::Path("a".into())]), - ("b$".into(), vec![AliasValue::Path("a/index".into())]), - ("c$".into(), vec![AliasValue::Path("/a/index".into())]), - ( - "multiAlias".into(), - vec![ - AliasValue::Path("b".into()), - AliasValue::Path("c".into()), - AliasValue::Path("d".into()), - AliasValue::Path("e".into()), - AliasValue::Path("a".into()), - ], - ), - ("recursive".into(), vec![AliasValue::Path("recursive/dir".into())]), - ("/d/dir".into(), vec![AliasValue::Path("/c/dir".into())]), - ("/d/index.js".into(), vec![AliasValue::Path("/c/index".into())]), - ("ignored".into(), vec![AliasValue::Ignore]), - ("node:path".into(), vec![AliasValue::Ignore]), - ], - modules: vec!["/".into()], - ..ResolveOptions::default() - }, - ); - - #[rustfmt::skip] - let pass = [ - ("should resolve a not aliased module 1", "a", "/a/index"), - ("should resolve a not aliased module 2", "a/index", "/a/index"), - ("should resolve a not aliased module 3", "a/dir", "/a/dir/index"), - ("should resolve a not aliased module 4", "a/dir/index", "/a/dir/index"), - ("should resolve an fallback module 1", "aliasA", "/a/index"), - ("should resolve an fallback module 2", "aliasA/index", "/a/index"), - ("should resolve an fallback module 3", "aliasA/dir", "/a/dir/index"), - ("should resolve an fallback module 4", "aliasA/dir/index", "/a/dir/index"), - ("should resolve a recursive aliased module 1", "recursive", "/recursive/index"), - ("should resolve a recursive aliased module 2", "recursive/index", "/recursive/index"), - ("should resolve a recursive aliased module 3", "recursive/dir", "/recursive/dir/index"), - ("should resolve a recursive aliased module 4", "recursive/dir/index", "/recursive/dir/index"), - ("should resolve a recursive aliased module 5", "recursive/file", "/recursive/dir/file"), - ("should resolve a file aliased module with a query 1", "b?query", "/b/index?query"), - ("should resolve a file aliased module with a query 2", "c?query", "/c/index?query"), - ("should resolve a path in a file aliased module 1", "b/index", "/b/index"), - ("should resolve a path in a file aliased module 2", "b/dir", "/b/dir/index"), - ("should resolve a path in a file aliased module 3", "b/dir/index", "/b/dir/index"), - ("should resolve a path in a file aliased module 4", "c/index", "/c/index"), - ("should resolve a path in a file aliased module 5", "c/dir", "/c/dir/index"), - ("should resolve a path in a file aliased module 6", "c/dir/index", "/c/dir/index"), - ("should resolve a file in multiple aliased dirs 1", "multiAlias/dir/file", "/e/dir/file"), - ("should resolve a file in multiple aliased dirs 2", "multiAlias/anotherDir", "/e/anotherDir/index"), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - - #[rustfmt::skip] - let ignore = [ - ("should resolve an ignore module", "ignored", ResolveError::Ignored(f.join("ignored"))), - ("should resolve node: builtin module", "node:path", ResolveError::Ignored(PathBuf::from("/node:path"))), - ]; - - for (comment, request, expected) in ignore { - let resolution = resolver.resolve(f, request); - assert_eq!(resolution, Err(expected), "{comment} {request}"); - } -} diff --git a/src/tests/full_specified.rs b/src/tests/full_specified.rs deleted file mode 100644 index a70c0191..00000000 --- a/src/tests/full_specified.rs +++ /dev/null @@ -1,113 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/fullSpecified.test.js - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows { - use std::path::PathBuf; - - use crate::{AliasValue, ResolveOptions, ResolverGeneric}; - - use super::super::memory_fs::MemoryFS; - - fn file_system() -> MemoryFS { - MemoryFS::new(&[ - ("/a/node_modules/package1/index.js", ""), - ("/a/node_modules/package1/file.js", ""), - ("/a/node_modules/package2/package.json", r#"{"main":"a"}"#), - ("/a/node_modules/package2/a.js", ""), - ("/a/node_modules/package3/package.json", r#"{"main":"dir"}"#), - ("/a/node_modules/package3/dir/index.js", ""), - ("/a/node_modules/package4/package.json", r#"{"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", ""), - ]) - } - - #[test] - fn test() { - let file_system = file_system(); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - alias: vec![ - ("alias1".into(), vec![AliasValue::from("/a/abc")]), - ("alias2".into(), vec![AliasValue::from("/a")]), - ], - alias_fields: vec![vec!["browser".into()]], - fully_specified: true, - ..ResolveOptions::default() - }, - ); - - let failing_resolves = [ - ("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"), - ]; - - for (comment, request) in failing_resolves { - let resolution = resolver.resolve("/a", request); - assert!(resolution.is_err(), "{comment} {request}"); - } - - let successful_resolves = [ - ("fully relative", "./abc.js", "/a/abc.js"), - ("fully absolute", "/a/abc.js", "/a/abc.js"), - ("fully relative in package", "package1/file.js", "/a/node_modules/package1/file.js"), - ("extensions in mainFiles", "package1", "/a/node_modules/package1/index.js"), - ("extensions in mainFields", "package2", "/a/node_modules/package2/a.js"), - ("extensions in alias", "alias1", "/a/abc.js"), - ("directories in alias", "alias2", "/a/index.js"), - ("directories in packages", "package3", "/a/node_modules/package3/dir/index.js"), - ("extensions in aliasFields", "package4/a.js", "/a/node_modules/package4/b.js"), - ]; - - for (comment, request, expected) in successful_resolves { - let resolution = resolver.resolve("/a", request).map(|r| r.full_path()); - assert_eq!(resolution, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - } - - #[test] - #[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. - fn resolve_to_context() { - let file_system = file_system(); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - alias: vec![ - ("alias1".into(), vec![AliasValue::from("/a/abc")]), - ("alias2".into(), vec![AliasValue::from("/a")]), - ], - alias_fields: vec![vec!["browser".into()]], - fully_specified: true, - resolve_to_context: true, - ..ResolveOptions::default() - }, - ); - - let successful_resolves = [ - ("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", "/a/node_modules/package3/dir"), - ]; - - for (comment, request, expected) in successful_resolves { - let resolution = resolver.resolve("/a", request).map(|r| r.full_path()); - assert_eq!(resolution, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - } -} diff --git a/src/tests/imports_field.rs b/src/tests/imports_field.rs deleted file mode 100644 index c928627a..00000000 --- a/src/tests/imports_field.rs +++ /dev/null @@ -1,1320 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/importsField.test.js -//! -//! The huge imports field test cases are at the bottom of this file. - -use serde_json::json; - -use crate::{Ctx, JSONMap, PathUtil, ResolveError, ResolveOptions, Resolver}; -use std::path::Path; - -#[test] -fn test_simple() { - let f = super::fixture().join("imports-field"); - let f2 = super::fixture().join("imports-exports-wildcard/node_modules/m/"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve using imports field instead of self-referencing", f.clone(), "#imports-field", f.join("b.js")), - ("should resolve using imports field instead of self-referencing for a subpath", f.join("dir"), "#imports-field", f.join("b.js")), - ("should resolve package #1", f.clone(), "#a/dist/main.js", f.join("node_modules/a/lib/lib2/main.js")), - ("should resolve package #3", f.clone(), "#ccc/index.js", f.join("node_modules/c/index.js")), - ("should resolve package #4", f.clone(), "#c", f.join("node_modules/c/index.js")), - ("should resolve with wildcard pattern", f2.clone(), "#internal/i.js", f2.join("src/internal/i.js")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } - - // Note added: - // * should resolve absolute path as an imports field target - // * should log the correct info - - #[rustfmt::skip] - let fail = [ - ("should disallow resolve out of package scope", f.clone(), "#b", ResolveError::InvalidPackageTarget("../b.js".to_string(), "#b".to_string(), f.join("package.json"))), - ("should resolve package #2", f.clone(), "#a", ResolveError::PackageImportNotDefined("#a".to_string(), f.join("package.json"))), - ]; - - for (comment, path, request, error) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!(resolution, Err(error), "{comment} {path:?} {request}"); - } -} - -#[test] -fn shared_resolvers() { - let f = super::fixture().join("imports-field"); - - // field name #1 - let resolver1 = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - imports_fields: vec![vec!["imports".into()]], - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - let resolved_path = resolver1.resolve(&f, "#imports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("b.js"))); - - // field name #2 - let resolver2 = resolver1.clone_with_options(ResolveOptions { - imports_fields: vec![vec!["other".into(), "imports".into()]], - ..ResolveOptions::default() - }); - - let resolved_path = resolver2.resolve(&f, "#b").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("a.js"))); -} - -// Small script for generating the test cases from enhanced_resolve -// for (c of testCases) { -// console.log("TestCase {") -// console.log(`name: ${JSON.stringify(c.name)},`) -// if (c.expect instanceof Error) { -// console.log(`expect: None,`) -// } else { -// console.log(`expect: Some(vec!${JSON.stringify(c.expect)}),`) -// } -// console.log(`imports_field: imports_field(json!(${JSON.stringify(c.suite[0], null, 2)})),`) -// console.log(`request: "${c.suite[1]}",`) -// console.log(`condition_names: vec!${JSON.stringify(c.suite[2])},`) -// console.log("},") -// } - -struct TestCase { - name: &'static str, - expect: Option>, - imports_field: JSONMap, - request: &'static str, - condition_names: Vec<&'static str>, -} - -#[allow(clippy::needless_pass_by_value)] -fn imports_field(value: serde_json::Value) -> JSONMap { - let s = serde_json::to_string(&value).unwrap(); - serde_json::from_str(&s).unwrap() -} - -#[test] -fn test_cases() { - let test_cases = [ - TestCase { - name: "sample #1", - expect: Some(vec!["./dist/test/file.js"]), - imports_field: imports_field(json!({ - "#abc/": { - "import": [ - "./dist/", - "./src/" - ], - "webpack": "./wp/" - }, - "#abc": "./main.js" - })), - request: "#abc/test/file.js", - condition_names: vec!["import", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "sample #1", - expect: Some(vec!["./src/test/file.js"]), - imports_field: imports_field(json!({ - "#abc/": { - "import": [ - "./src/" - ], - "webpack": "./wp/" - }, - "#abc": "./main.js" - })), - request: "#abc/test/file.js", - condition_names: vec!["import", "webpack"], - }, - TestCase { - name: "sample #2", - expect: Some(vec!["./data/timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#1/timezones/": "./data/timezones/" - })), - request: "#1/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #3", - expect: Some(vec!["./data/timezones/timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#aaa/": "./data/timezones/", - "#a/": "./data/timezones/" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #4", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/lib/": { - "browser": [ - "./browser/" - ] - }, - "#a/dist/index.js": { - "node": "./index.js" - } - })), - request: "#a/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #5", - expect: Some(vec!["./browser/index.js"]), - imports_field: imports_field(json!({ - "#a/lib/": { - "browser": [ - "./browser/" - ] - }, - "#a/dist/index.js": { - "node": "./index.js", - "default": "./browser/index.js" - } - })), - request: "#a/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #6", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/dist/a": "./dist/index.js" - })), - request: "#a/dist/aaa", - condition_names: vec![], - }, - TestCase { - name: "sample #7", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/a/a/": "./dist/index.js" - })), - request: "#a/a/a", - condition_names: vec![], - }, - TestCase { - name: "sample #8", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": "./index.js" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #9", - expect: Some(vec!["./main.js"]), - imports_field: imports_field(json!({ - "#a/index.js": "./main.js" - })), - request: "#a/index.js", - condition_names: vec![], - }, - TestCase { - name: "sample #10", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #11", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/bar#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #12", - expect: Some(vec!["./ok.js#abc"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/ok.js#abc", - condition_names: vec![], - }, - TestCase { - name: "sample #13", - expect: Some(vec!["./ok.js?abc"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/ok.js?abc", - condition_names: vec![], - }, - TestCase { - name: "sample #14", - expect: Some(vec!["./🎉.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/🎉.js", - condition_names: vec![], - }, - TestCase { - name: "sample #15", - expect: Some(vec!["./%F0%9F%8E%89.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/%F0%9F%8E%89.js", - condition_names: vec![], - }, - TestCase { - name: "sample #16", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/🎉", - condition_names: vec![], - }, - TestCase { - name: "sample #17", - expect: Some(vec!["./other.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/%F0%9F%8E%89", - condition_names: vec![], - }, - TestCase { - name: "sample #18", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/module", - condition_names: vec![], - }, - TestCase { - name: "sample #19", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/module#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #20", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/module?foo", - condition_names: vec![], - }, - TestCase { - name: "sample #21", - expect: Some(vec!["./d?e?f"]), - imports_field: imports_field(json!({ - "#a/a?b?c/": "./" - })), - request: "#a/a?b?c/d?e?f", - condition_names: vec![], - }, - TestCase { - name: "sample #22", - // We throw InvalidPackageTarget - expect: None, - // expect: Some(vec!["/user/a/index"]), - imports_field: imports_field(json!({ - "#a/": "/user/a/" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #1", - expect: Some(vec!["./A/b/d.js"]), - imports_field: imports_field(json!({ - "#a/": "./A/", - "#a/b/c": "./c.js" - })), - request: "#a/b/d.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #2", - expect: Some(vec!["./A/c.js"]), - imports_field: imports_field(json!({ - "#a/": "./A/", - "#a/b": "./b.js" - })), - request: "#a/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #3", - expect: Some(vec!["./A/b/c/d.js"]), - imports_field: imports_field(json!({ - "#a/": "./A/", - "#a/b/c/d": "./c.js" - })), - request: "#a/b/c/d.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #1", - expect: Some(vec!["./dist/index.js"]), - imports_field: imports_field(json!({ - "#a": "./dist/index.js" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #2", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": "./" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #3", - expect: Some(vec!["./dist/a.js"]), - imports_field: imports_field(json!({ - "#a/": "./dist/", - "#a/index.js": "./dist/a.js" - })), - request: "#a/index.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #4", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "./browser/" - ] - }, - "#a/index.js": { - "browser": "./index.js" - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #5", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "./browser/" - ] - }, - "#a/index.js": { - "node": "./node.js" - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #6", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: "#a", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #7", - expect: Some(vec!["./src/index.js"]), // `enhanced_resolve` is `None` - imports_field: imports_field(json!({ - "#a": { - "default": "./src/index.js", - "browser": "./index.js", - "node": "./src/node/index.js" - } - })), - request: "#a", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #8", - expect: Some(vec!["./src/index.js"]), - imports_field: imports_field(json!({ - "#a": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #9", - expect: Some(vec!["./index"]), - imports_field: imports_field(json!({ - "#a": "./index" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #10", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/index": "./index.js" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #11", - // We throw InvalidPackageTarget - // expect: Some(vec!["b"]), - expect: None, - imports_field: imports_field(json!({ - "#a": "b" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #12", - // We throw InvalidPackageTarget - // expect: Some(vec!["b/index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "b/" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #13", - // We throw InvalidPackageTarget - // expect: Some(vec!["b#anotherhashishere"]), - expect: None, - imports_field: imports_field(json!({ - "#a?q=a#hashishere": "b#anotherhashishere" - })), - request: "#a?q=a#hashishere", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #1", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #2", - expect: Some(vec!["./import.mjs"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec!["import"], - }, - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./require.js"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./import.mjs"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./require.js"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": [ - "./require.js" - ] - }, - { - "import": [ - "./import.mjs", - "#b/import.js" - ] - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./import.mjs"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "./import.mjs", - "#b/import.js" - ] - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "#b/import.js" - ] - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "mapping to a folder root #1", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#timezones": "./data/timezones/" - })), - request: "#timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #2", - expect: None, - imports_field: imports_field(json!({ - "#timezones/": "./data/timezones" - })), - request: "#timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #3", - expect: Some(vec!["./data/timezones/pdt/index.mjs"]), - imports_field: imports_field(json!({ - "#timezones/pdt/": "./data/timezones/pdt/" - })), - request: "#timezones/pdt/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #4", - expect: Some(vec!["./timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#a/": "./timezones/" - })), - request: "#a/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #5", - expect: Some(vec!["./timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#a/": "./" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #6", - expect: None, - imports_field: imports_field(json!({ - "#a/": "." - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #7", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": "./" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #1", - expect: Some(vec!["./lib/index.mjs"]), - imports_field: imports_field(json!({ - "#a/": "./", - "#a/dist/": "./lib/" - })), - request: "#a/dist/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #2", - expect: Some(vec!["./dist/utils/index.js"]), - imports_field: imports_field(json!({ - "#a/dist/utils/": "./dist/utils/", - "#a/dist/": "./lib/" - })), - request: "#a/dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #3", - expect: Some(vec!["./dist/utils/index.js"]), - imports_field: imports_field(json!({ - "#a/dist/utils/index.js": "./dist/utils/index.js", - "#a/dist/utils/": "./dist/utils/index.mjs", - "#a/dist/": "./lib/" - })), - request: "#a/dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #4", - expect: Some(vec!["./lib/index.mjs"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./browser/" - }, - "#a/dist/": "./lib/" - })), - request: "#a/dist/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #1", - // This behaves differently from enhanced_resolve, because `lodash/` is an an InvalidPackageConfig - // expect: Some(vec!["lodash/index.js"]), - expect: Some(vec!["./utils/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "conditional mapping folder #1", - expect: Some(vec!["./utils/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #2", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./node/" - ] - } - })), - request: "#a/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "conditional mapping folder #3", - expect: Some(vec!["./wpk/index.mjs"]), - imports_field: imports_field(json!({ - "#a/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils/" - ] - } - })), - request: "#a/index.mjs", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "incorrect exports field #1", - // We throw `PackageImportNotDefined` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "/utils/": "./a/" - })), - request: "#a/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #2", - // We throw `PackageImportNotDefined` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "/utils/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#a/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #3", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index": "./a/index.js" - })), - request: "#a/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #4", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index.mjs": "./a/index.js" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #5", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "#a/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #6", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index.mjs": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "#a/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #1", - // We don't throw in `package_imports_exports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": "./a/" - })), - request: "/utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect request #2", - // We don't throw in `package_imports_exports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #3", - // We don't throw in `package_imports_exports_resolve`, it's thrown in `package_imports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #4", - // We don't throw in `package_imports_exports_resolve`, it's thrown in `package_imports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#/", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #5", - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#a/", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #1", - // expect: Some(vec!["./dist/index"]), - expect: Some(vec!["dist/index"]), - imports_field: imports_field(json!({ - "#a/../../utils/": "./dist/" - })), - request: "#a/../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #2", - // We throw InvalidPackageTarget - // expect: Some(vec!["./dist/../../utils/index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "./dist/" - })), - request: "#a/../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #3", - // We throw InvalidPackageTarget - // expect: Some(vec!["../src/index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "../src/" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #4", - // We throw InvalidPackageTarget - // expect: Some(vec!["./utils/../../../index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": { - "browser": "./utils/../../../" - } - })), - request: "#a/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #1", - // expect: Some(vec!["moment/node_modules/lodash/dist/index.js"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": { - "browser": "moment/node_modules/" - } - })), - request: "#a/lodash/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #2", - // We throw InvalidPackageTarget - // expect: Some(vec!["../node_modules/lodash/dist/index.js"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "../node_modules/" - })), - request: "#a/lodash/dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "nested mapping #1", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": "./", - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./node/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "nested mapping #3", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["webpack"], - }, - TestCase { - name: "nested mapping #4", - // We throw NotFound - // expect: Some(vec!["moment/node/index.js"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "moment/node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["node", "browser"], - }, - TestCase { - name: "nested mapping #5", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "node"], - }, - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./node/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - TestCase { - name: "nested mapping #7", - expect: Some(vec!["./y.js"]), - imports_field: imports_field(json!({ - "#a": { - "abc": { - "def": "./x.js" - }, - "ghi": "./y.js" - } - })), - request: "#a", - condition_names: vec!["abc", "ghi"], - }, - TestCase { - name: "nested mapping #8", - // We throw PackageImportNotDefined - // expect: Some(vec![]), - expect: None, - imports_field: imports_field(json!({ - "#a": { - "abc": { - "def": "./x.js", - "default": [] - }, - "ghi": "./y.js" - } - })), - request: "#a", - condition_names: vec!["abc", "ghi"], - }, - ]; - - for case in test_cases { - let resolved = Resolver::default() - .package_imports_exports_resolve( - case.request, - &case.imports_field, - Path::new(""), - true, - &case.condition_names.iter().map(ToString::to_string).collect::>(), - &mut Ctx::default(), - ) - .map(|p| p.map(|p| p.to_path_buf())); - if let Some(expect) = case.expect { - if expect.is_empty() { - assert!(matches!(resolved, Ok(None)), "{} {:?}", &case.name, &resolved); - } else { - for expect in expect { - assert_eq!(resolved, Ok(Some(Path::new(expect).normalize())), "{}", &case.name); - } - } - } else { - assert!(resolved.is_err(), "{} {resolved:?}", &case.name); - } - } -} diff --git a/src/tests/incorrect_description_file.rs b/src/tests/incorrect_description_file.rs deleted file mode 100644 index e2caecbb..00000000 --- a/src/tests/incorrect_description_file.rs +++ /dev/null @@ -1,65 +0,0 @@ -//! - -use rustc_hash::FxHashSet; - -use crate::{JSONError, Resolution, ResolveContext, ResolveError, ResolveOptions, Resolver}; - -// should not resolve main in incorrect description file #1 -#[test] -fn incorrect_description_file_1() { - let f = super::fixture().join("incorrect-package"); - let mut ctx = ResolveContext::default(); - let resolution = Resolver::default().resolve_with_context(f.join("pack1"), ".", &mut ctx); - let error = ResolveError::JSON(JSONError { - path: f.join("pack1/package.json"), - message: String::from("EOF while parsing a value at line 3 column 0"), - line: 3, - column: 0, - }); - assert_eq!(resolution, Err(error)); - assert_eq!( - ctx.file_dependencies, - FxHashSet::from_iter([f.join("pack1"), f.join("pack1/package.json")]) - ); - assert!(!ctx.missing_dependencies.is_empty()); -} - -// should not resolve main in incorrect description file #2 -#[test] -fn incorrect_description_file_2() { - let f = super::fixture().join("incorrect-package"); - let resolution = Resolver::default().resolve(f.join("pack2"), "."); - let error = ResolveError::JSON(JSONError { - path: f.join("pack2/package.json"), - message: String::from("EOF while parsing a value at line 1 column 0"), - line: 1, - column: 0, - }); - assert_eq!(resolution, Err(error)); -} - -// should not resolve main in incorrect description file #3 -#[test] -fn incorrect_description_file_3() { - let f = super::fixture().join("incorrect-package"); - let resolution = Resolver::default().resolve(f.join("pack2"), "."); - assert!(resolution.is_err()); -} - -// `enhanced_resolve` does not have this test case -#[test] -fn no_description_file() { - let f = super::fixture_root().join("enhanced_resolve"); - - // has description file - let resolver = Resolver::default(); - assert_eq!( - resolver.resolve(&f, ".").map(Resolution::into_path_buf), - Ok(f.join("lib/index.js")) - ); - - // without description file - let resolver = - Resolver::new(ResolveOptions { description_files: vec![], ..ResolveOptions::default() }); - assert_eq!(resolver.resolve(&f, "."), Err(ResolveError::NotFound(".".into()))); -} diff --git a/src/tests/main_field.rs b/src/tests/main_field.rs deleted file mode 100644 index 3cadc8ce..00000000 --- a/src/tests/main_field.rs +++ /dev/null @@ -1,24 +0,0 @@ -//! Not part of enhanced_resolve's test suite - -use crate::{ResolveOptions, Resolver}; - -#[test] -fn test() { - let f = super::fixture().join("restrictions"); - - let resolver1 = Resolver::new(ResolveOptions { - main_fields: vec!["style".into()], - ..ResolveOptions::default() - }); - - let resolution = resolver1.resolve(&f, "pck2").map(|r| r.full_path()); - assert_eq!(resolution, Ok(f.join("node_modules/pck2/index.css"))); - - let resolver2 = resolver1.clone_with_options(ResolveOptions { - main_fields: vec!["module".into(), "main".into()], - ..ResolveOptions::default() - }); - - let resolution = resolver2.resolve(&f, "pck2").map(|r| r.full_path()); - assert_eq!(resolution, Ok(f.join("node_modules/pck2/module.js"))); -} diff --git a/src/tests/memory_fs.rs b/src/tests/memory_fs.rs deleted file mode 100644 index e4116609..00000000 --- a/src/tests/memory_fs.rs +++ /dev/null @@ -1,74 +0,0 @@ -use std::{ - io, - path::{Path, PathBuf}, -}; - -use crate::{FileMetadata, FileSystem}; - -#[derive(Default)] -pub struct MemoryFS { - fs: vfs::MemoryFS, -} - -impl MemoryFS { - /// # Panics - /// - /// * Fails to create directory - /// * Fails to write file - #[allow(dead_code)] - pub fn new(data: &[(&'static str, &'static str)]) -> Self { - let mut fs = Self { fs: vfs::MemoryFS::default() }; - for (path, content) in data { - fs.add_file(Path::new(path), content); - } - fs - } - - #[allow(dead_code)] - pub fn add_file(&mut self, path: &Path, content: &str) { - use vfs::FileSystem; - let fs = &mut self.fs; - // Create all parent directories - for path in path.ancestors().collect::>().iter().rev() { - let path = path.to_string_lossy(); - if !fs.exists(path.as_ref()).unwrap() { - fs.create_dir(path.as_ref()).unwrap(); - } - } - // Create file - let mut file = fs.create_file(path.to_string_lossy().as_ref()).unwrap(); - file.write_all(content.as_bytes()).unwrap(); - } -} - -impl FileSystem for MemoryFS { - fn read_to_string(&self, path: &Path) -> io::Result { - use vfs::FileSystem; - let mut file = self - .fs - .open_file(path.to_string_lossy().as_ref()) - .map_err(|err| io::Error::new(io::ErrorKind::NotFound, err))?; - let mut buffer = String::new(); - file.read_to_string(&mut buffer).unwrap(); - Ok(buffer) - } - - fn metadata(&self, path: &Path) -> io::Result { - use vfs::FileSystem; - let metadata = self - .fs - .metadata(path.to_string_lossy().as_ref()) - .map_err(|err| io::Error::new(io::ErrorKind::NotFound, err))?; - let is_file = metadata.file_type == vfs::VfsFileType::File; - let is_dir = metadata.file_type == vfs::VfsFileType::Directory; - Ok(FileMetadata::new(is_file, is_dir, false)) - } - - fn symlink_metadata(&self, path: &Path) -> io::Result { - self.metadata(path) - } - - fn canonicalize(&self, _path: &Path) -> io::Result { - Err(io::Error::new(io::ErrorKind::NotFound, "not a symlink")) - } -} diff --git a/src/tests/missing.rs b/src/tests/missing.rs deleted file mode 100644 index 4bf611ef..00000000 --- a/src/tests/missing.rs +++ /dev/null @@ -1,106 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/missing.test.js - -use normalize_path::NormalizePath; - -use crate::{AliasValue, ResolveContext, ResolveOptions, Resolver}; - -#[test] -fn test() { - let f = super::fixture(); - - let data = [ - ( - "./missing-file", - vec![f.join("missing-file"), f.join("missing-file.js"), f.join("missing-file.node")], - ), - ( - "missing-module", - vec![ - f.join("node_modules/missing-module"), - f.parent().unwrap().join("node_modules"), // enhanced-resolve is "node_modules/missing-module" - ], - ), - ( - "missing-module/missing-file", - vec![ - f.join("node_modules/missing-module"), - // f.parent().unwrap().join("node_modules/missing-module"), // we don't report this - ], - ), - ( - "m1/missing-file", - vec![ - f.join("node_modules/m1/missing-file"), - f.join("node_modules/m1/missing-file.js"), - f.join("node_modules/m1/missing-file.node"), - // f.parent().unwrap().join("node_modules/m1"), // we don't report this - ], - ), - ( - "m1/", - vec![ - f.join("node_modules/m1/index"), - f.join("node_modules/m1/index.js"), - f.join("node_modules/m1/index.json"), - f.join("node_modules/m1/index.node"), - ], - ), - ("m1/a", vec![f.join("node_modules/m1/a")]), - ]; - - let resolver = Resolver::default(); - - for (specifier, missing_dependencies) in data { - let mut ctx = ResolveContext::default(); - let _ = resolver.resolve_with_context(&f, specifier, &mut ctx); - - for path in ctx.file_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - } - - for path in missing_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - assert!( - ctx.missing_dependencies.contains(&path), - "{specifier}: {path:?} not in {:?}", - &ctx.missing_dependencies - ); - } - } -} - -#[test] -fn alias_and_extensions() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias: vec![ - ( - "@scope-js/package-name/dir$".into(), - vec![AliasValue::Path(f.join("foo/index.js").to_string_lossy().to_string())], - ), - ( - "react-dom".into(), - vec![AliasValue::Path(f.join("foo/index.js").to_string_lossy().to_string())], - ), - ], - extensions: vec![".server.ts".into()], - - ..ResolveOptions::default() - }); - - let mut ctx = ResolveContext::default(); - let _ = resolver.resolve_with_context(&f, "@scope-js/package-name/dir/router", &mut ctx); - let _ = resolver.resolve_with_context(&f, "react-dom/client", &mut ctx); - - for path in ctx.file_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - } - - for path in ctx.missing_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - if let Some(path) = path.parent() { - assert!(!path.is_file(), "{path:?} must not be a file"); - } - } -} diff --git a/src/tests/mod.rs b/src/tests/mod.rs deleted file mode 100644 index e347dd1f..00000000 --- a/src/tests/mod.rs +++ /dev/null @@ -1,51 +0,0 @@ -mod alias; -mod browser_field; -mod builtins; -mod dependencies; -mod exports_field; -mod extension_alias; -mod extensions; -mod fallback; -mod full_specified; -mod imports_field; -mod incorrect_description_file; -mod main_field; -mod memory_fs; -mod missing; -#[cfg(feature = "yarn_pnp")] -mod pnp; -mod resolve; -mod restrictions; -mod roots; -mod scoped_packages; -mod simple; -mod symlink; -mod tsconfig_paths; -mod tsconfig_project_references; - -use crate::Resolver; -use std::{env, path::PathBuf, sync::Arc, thread}; - -pub fn fixture_root() -> PathBuf { - env::current_dir().unwrap().join("fixtures") -} - -pub fn fixture() -> PathBuf { - fixture_root().join("enhanced_resolve").join("test").join("fixtures") -} - -#[test] -fn threaded_environment() { - let cwd = env::current_dir().unwrap(); - let resolver = Arc::new(Resolver::default()); - for _ in 0..2 { - _ = thread::spawn({ - let cwd = cwd.clone(); - let resolver = Arc::clone(&resolver); - move || { - _ = resolver.resolve(cwd, "."); - } - }) - .join(); - } -} diff --git a/src/tests/pnp.rs b/src/tests/pnp.rs deleted file mode 100644 index 1562a009..00000000 --- a/src/tests/pnp.rs +++ /dev/null @@ -1,45 +0,0 @@ -//! Not part of enhanced_resolve's test suite -//! -//! enhanced_resolve's test -//! cannot be ported over because it uses mocks on `pnpApi` provided by the runtime. - -use crate::{ResolveOptions, Resolver}; - -#[test] -fn pnp1() { - let fixture = super::fixture_root().join("pnp"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - pnp_manifest: Some(pnp::load_pnp_manifest(fixture.join(".pnp.cjs")).unwrap()), - ..ResolveOptions::default() - }); - - assert_eq!( - resolver.resolve(&fixture, "is-even").map(|r| r.full_path()), - Ok(fixture.join( - ".yarn/cache/is-even-npm-1.0.0-9f726520dc-2728cc2f39.zip/node_modules/is-even/index.js" - )) - ); - - assert_eq!( - resolver - .resolve( - &fixture.join( - ".yarn/cache/is-even-npm-1.0.0-9f726520dc-2728cc2f39.zip/node_modules/is-even" - ), - "is-odd" - ) - .map(|r| r.full_path()), - Ok(fixture.join( - ".yarn/cache/is-odd-npm-0.1.2-9d980a9da8-7dc6c6fd00.zip/node_modules/is-odd/index.js" - )), - ); - - assert_eq!( - resolver.resolve(&fixture, "is-odd").map(|r| r.full_path()), - Ok(fixture.join( - ".yarn/cache/is-odd-npm-3.0.1-93c3c3f41b-89ee2e353c.zip/node_modules/is-odd/index.js" - )), - ); -} diff --git a/src/tests/resolve.rs b/src/tests/resolve.rs deleted file mode 100644 index f2dbb88e..00000000 --- a/src/tests/resolve.rs +++ /dev/null @@ -1,119 +0,0 @@ -//! - -use crate::{ResolveError, ResolveOptions, Resolver}; - -#[test] -fn resolve() { - let f = super::fixture(); - - let resolver = Resolver::default(); - - let main1_js_path = f.join("main1.js").to_string_lossy().to_string(); - - #[rustfmt::skip] - let pass = [ - ("absolute path", f.clone(), main1_js_path.as_str(), f.join("main1.js")), - ("file with .js", f.clone(), "./main1.js", f.join("main1.js")), - ("file without extension", f.clone(), "./main1", f.join("main1.js")), - ("another file with .js", f.clone(), "./a.js", f.join("a.js")), - ("another file without extension", f.clone(), "./a", f.join("a.js")), - ("file in module with .js", f.clone(), "m1/a.js", f.join("node_modules/m1/a.js")), - ("file in module without extension", f.clone(), "m1/a", f.join("node_modules/m1/a.js")), - ("another file in module without extension", f.clone(), "complexm/step1", f.join("node_modules/complexm/step1.js")), - ("from submodule to file in sibling module", f.join("node_modules/complexm"), "m2/b.js", f.join("node_modules/m2/b.js")), - ("from nested directory to overwritten file in module", f.join("multiple_modules"), "m1/a.js", f.join("multiple_modules/node_modules/m1/a.js")), - ("from nested directory to not overwritten file in module", f.join("multiple_modules"), "m1/b.js", f.join("node_modules/m1/b.js")), - ("file with query", f.clone(), "./main1.js?query", f.join("main1.js?query")), - ("file with fragment", f.clone(), "./main1.js#fragment", f.join("main1.js#fragment")), - ("file with fragment and query", f.clone(), "./main1.js#fragment?query", f.join("main1.js#fragment?query")), - ("file with query and fragment", f.clone(), "./main1.js?#fragment", f.join("main1.js?#fragment")), - - ("file with query (unicode)", f.clone(), "./测试.js?query", f.join("测试.js?query")), - ("file with fragment (unicode)", f.clone(), "./测试.js#fragment", f.join("测试.js#fragment")), - ("file with fragment and query (unicode)", f.clone(), "./测试.js#fragment?query", f.join("测试.js#fragment?query")), - ("file with query and fragment (unicode)", f.clone(), "./测试.js?#fragment", f.join("测试.js?#fragment")), - - ("file in module with query", f.clone(), "m1/a?query", f.join("node_modules/m1/a.js?query")), - ("file in module with fragment", f.clone(), "m1/a#fragment", f.join("node_modules/m1/a.js#fragment")), - ("file in module with fragment and query", f.clone(), "m1/a#fragment?query", f.join("node_modules/m1/a.js#fragment?query")), - ("file in module with query and fragment", f.clone(), "m1/a?#fragment", f.join("node_modules/m1/a.js?#fragment")), - ("file in module with query and fragment", f.clone(), "m1/a?#fragment", f.join("node_modules/m1/a.js?#fragment")), - ("differ between directory and file, resolve file", f.clone(), "./dirOrFile", f.join("dirOrFile.js")), - ("differ between directory and file, resolve directory", f.clone(), "./dirOrFile/", f.join("dirOrFile/index.js")), - ("find node_modules outside of node_modules", f.join("browser-module/node_modules"), "m1/a", f.join("node_modules/m1/a.js")), - ("don't crash on main field pointing to self", f.clone(), "./main-field-self", f.join("./main-field-self/index.js")), - ("don't crash on main field pointing to self (2)", f.clone(), "./main-field-self2", f.join("./main-field-self2/index.js")), - // enhanced-resolve has `#` prepended with a `\0`, they are removed from the - // following 3 expected test results. - // See https://github.com/webpack/enhanced-resolve#escaping - ("handle fragment edge case (no fragment)", f.clone(), "./no#fragment/#/#", f.join("no#fragment/#/#.js")), - ("handle fragment edge case (fragment)", f.clone(), "./no#fragment/#/", f.join("no.js#fragment/#/")), - ("handle fragment escaping", f.clone(), "./no\0#fragment/\0#/\0##fragment", f.join("no#fragment/#/#.js#fragment")), - - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn issue238_resolve() { - let f = super::fixture().join("issue-238"); - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into(), ".jsx".into(), ".ts".into(), ".tsx".into()], - modules: vec!["src/a".into(), "src/b".into(), "src/common".into(), "node_modules".into()], - ..ResolveOptions::default() - }); - let resolved_path = - resolver.resolve(f.join("src/common"), "config/myObjectFile").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("src/common/config/myObjectFile.js")),); -} - -#[test] -fn prefer_relative() { - let f = super::fixture(); - - let resolver = - Resolver::new(ResolveOptions { prefer_relative: true, ..ResolveOptions::default() }); - - #[rustfmt::skip] - let pass = [ - ("should correctly resolve with preferRelative 1", "main1.js", f.join("main1.js")), - ("should correctly resolve with preferRelative 2", "m1/a.js", f.join("node_modules/m1/a.js")), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } -} - -#[test] -fn resolve_to_context() { - let f = super::fixture(); - let resolver = - Resolver::new(ResolveOptions { resolve_to_context: true, ..ResolveOptions::default() }); - - #[rustfmt::skip] - let data = [ - ("context for fixtures", f.clone(), "./", f.clone()), - ("context for fixtures/lib", f.clone(), "./lib", f.join("lib")), - ("context for fixtures with ..", f.clone(), "./lib/../../fixtures/./lib/..", f.clone()), - ("context for fixtures with query", f.clone(), "./?query", f.clone().with_file_name("fixtures?query")), - ]; - - for (comment, path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn resolve_hash_as_module() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions::default()); - let resolution = resolver.resolve(f, "#a"); - assert_eq!(resolution, Err(ResolveError::NotFound("#a".into()))); -} diff --git a/src/tests/restrictions.rs b/src/tests/restrictions.rs deleted file mode 100644 index 5ba56596..00000000 --- a/src/tests/restrictions.rs +++ /dev/null @@ -1,25 +0,0 @@ -//! - -use crate::{ResolveError, ResolveOptions, Resolver, Restriction}; - -// TODO: regex -// * should respect RegExp restriction -// * should try to find alternative #1 -// * should try to find alternative #2 -// * should try to find alternative #3 - -// should respect string restriction -#[test] -fn restriction1() { - let fixture = super::fixture(); - let f = fixture.join("restrictions"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - restrictions: vec![Restriction::Path(f.clone())], - ..ResolveOptions::default() - }); - - let resolution = resolver.resolve(&f, "pck2"); - assert_eq!(resolution, Err(ResolveError::Restriction(fixture.join("c.js"), f))); -} diff --git a/src/tests/roots.rs b/src/tests/roots.rs deleted file mode 100644 index b50e2a07..00000000 --- a/src/tests/roots.rs +++ /dev/null @@ -1,92 +0,0 @@ -//! - -use std::path::PathBuf; - -use crate::{AliasValue, ResolveError, ResolveOptions, Resolver}; - -fn dirname() -> PathBuf { - super::fixture_root().join("enhanced_resolve").join("test") -} - -#[test] -fn roots() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - alias: vec![("foo".into(), vec![AliasValue::from("/fixtures")])], - roots: vec![dirname(), f.clone()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should respect roots option", "/fixtures/b.js", f.join("b.js")), - ("should try another root option, if it exists", "/b.js", f.join("b.js")), - ("should respect extension", "/fixtures/b", f.join("b.js")), - ("should resolve in directory", "/fixtures/extensions/dir", f.join("extensions/dir/index.js")), - ("should respect aliases", "foo/b", f.join("b.js")), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } - - #[rustfmt::skip] - let fail = [ - ("should not work with relative path", "fixtures/b.js", ResolveError::NotFound("fixtures/b.js".into())) - ]; - - for (comment, request, expected) in fail { - let resolution = resolver.resolve(&f, request); - assert_eq!(resolution, Err(expected), "{comment} {request}"); - } -} - -#[test] -fn resolve_to_context() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - roots: vec![dirname(), f.clone()], - resolve_to_context: true, - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f, "/fixtures/lib").map(|r| r.full_path()); - let expected = f.join("lib"); - assert_eq!(resolved_path, Ok(expected)); -} - -#[test] -fn prefer_absolute() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - alias: vec![("foo".into(), vec![AliasValue::from("/fixtures")])], - roots: vec![dirname(), f.clone()], - prefer_absolute: true, - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve an absolute path (prefer absolute)", f.join("b.js").to_string_lossy().to_string(), f.join("b.js")), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(&f, &request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } -} - -#[test] -fn roots_fall_through() { - let f = super::fixture(); - let absolute_path = f.join("roots_fall_through/index.js"); - let specifier = absolute_path.to_string_lossy(); - let resolution = Resolver::new(ResolveOptions::default().with_root(&f)).resolve(&f, &specifier); - assert_eq!( - resolution.map(super::super::resolution::Resolution::into_path_buf), - Ok(absolute_path) - ); -} diff --git a/src/tests/scoped_packages.rs b/src/tests/scoped_packages.rs deleted file mode 100644 index 8258f00f..00000000 --- a/src/tests/scoped_packages.rs +++ /dev/null @@ -1,25 +0,0 @@ -//! - -use crate::{ResolveOptions, Resolver}; - -#[test] -fn scoped_packages() { - let f = super::fixture().join("scoped"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("main field should work", f.clone(), "@scope/pack1", f.join("./node_modules/@scope/pack1/main.js")), - ("browser field should work", f.clone(), "@scope/pack2", f.join("./node_modules/@scope/pack2/main.js")), - ("folder request should work", f.clone(), "@scope/pack2/lib", f.join("./node_modules/@scope/pack2/lib/index.js")) - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} diff --git a/src/tests/simple.rs b/src/tests/simple.rs deleted file mode 100644 index 08e1238a..00000000 --- a/src/tests/simple.rs +++ /dev/null @@ -1,68 +0,0 @@ -//! - -use std::env; - -use crate::Resolver; - -#[test] -fn simple() { - // mimic `enhanced-resolve/test/simple.test.js` - let dirname = env::current_dir().unwrap().join("fixtures"); - let f = dirname.join("enhanced_resolve/test"); - - let resolver = Resolver::default(); - - let data = [ - ("direct", f.clone(), "../lib/index"), - ("as directory", f, ".."), - ("as module", dirname.clone(), "./enhanced_resolve"), - ]; - - for (comment, path, request) in data { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - let expected = dirname.join("enhanced_resolve/lib/index.js"); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn dashed_name() { - let f = super::fixture(); - - let resolver = Resolver::default(); - - let data = [ - (f.clone(), "dash", f.join("node_modules/dash/index.js")), - (f.clone(), "dash-name", f.join("node_modules/dash-name/index.js")), - (f.join("node_modules/dash"), "dash", f.join("node_modules/dash/index.js")), - (f.join("node_modules/dash"), "dash-name", f.join("node_modules/dash-name/index.js")), - (f.join("node_modules/dash-name"), "dash", f.join("node_modules/dash/index.js")), - (f.join("node_modules/dash-name"), "dash-name", f.join("node_modules/dash-name/index.js")), - ]; - - for (path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{path:?} {request}"); - } -} - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows { - use super::super::memory_fs::MemoryFS; - - use crate::ResolveOptions; - - #[test] - fn no_package() { - use crate::ResolverGeneric; - use std::path::Path; - let f = Path::new("/"); - let file_system = MemoryFS::new(&[]); - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions::default(), - ); - let resolved_path = resolver.resolve(f, "package"); - assert!(resolved_path.is_err()); - } -} diff --git a/src/tests/symlink.rs b/src/tests/symlink.rs deleted file mode 100644 index 7589b560..00000000 --- a/src/tests/symlink.rs +++ /dev/null @@ -1,121 +0,0 @@ -use std::{fs, io, path::Path}; - -use crate::{ResolveOptions, Resolver}; - -#[derive(Debug, Clone, Copy)] -enum FileType { - File, - Dir, -} - -#[allow(unused_variables)] -fn symlink, Q: AsRef>( - original: P, - link: Q, - file_type: FileType, -) -> io::Result<()> { - #[cfg(target_family = "unix")] - { - std::os::unix::fs::symlink(original, link) - } - - #[cfg(target_family = "windows")] - match file_type { - FileType::File => std::os::windows::fs::symlink_file(original, link), - FileType::Dir => std::os::windows::fs::symlink_dir(original, link), - } -} - -fn init(dirname: &Path, temp_path: &Path) -> io::Result<()> { - if temp_path.exists() { - _ = fs::remove_dir_all(temp_path); - } - fs::create_dir(temp_path)?; - symlink(dirname.join("../lib/index.js"), temp_path.join("test"), FileType::File)?; - symlink(dirname.join("../lib"), temp_path.join("test2"), FileType::Dir)?; - fs::remove_file(temp_path.join("test"))?; - fs::remove_file(temp_path.join("test2"))?; - fs::remove_dir(temp_path) -} - -fn create_symlinks(dirname: &Path, temp_path: &Path) -> io::Result<()> { - fs::create_dir(temp_path).unwrap(); - symlink( - dirname.join("../lib/index.js").canonicalize().unwrap(), - temp_path.join("index.js"), - FileType::File, - )?; - symlink(dirname.join("../lib").canonicalize().unwrap(), temp_path.join("lib"), FileType::Dir)?; - symlink(dirname.join("..").canonicalize().unwrap(), temp_path.join("this"), FileType::Dir)?; - symlink(temp_path.join("this"), temp_path.join("that"), FileType::Dir)?; - symlink(Path::new("../../lib/index.js"), temp_path.join("node.relative.js"), FileType::File)?; - symlink( - Path::new("./node.relative.js"), - temp_path.join("node.relative.sym.js"), - FileType::File, - )?; - Ok(()) -} - -fn cleanup_symlinks(temp_path: &Path) { - _ = fs::remove_dir_all(temp_path); -} - -#[test] -fn test() -> io::Result<()> { - let root = super::fixture_root().join("enhanced_resolve"); - let dirname = root.join("test"); - let temp_path = dirname.join("temp"); - if !temp_path.exists() { - let is_admin = init(&dirname, &temp_path).is_ok(); - if !is_admin { - return Ok(()); - } - if let Err(err) = create_symlinks(&dirname, &temp_path) { - cleanup_symlinks(&temp_path); - return Err(err); - } - } - - let resolver_without_symlinks = - Resolver::new(ResolveOptions { symlinks: false, ..ResolveOptions::default() }); - let resolver_with_symlinks = Resolver::default(); - - #[rustfmt::skip] - let pass = [ - ("with a symlink to a file", temp_path.clone(), "./index.js"), - ("with a relative symlink to a file", temp_path.clone(), "./node.relative.js"), - ("with a relative symlink to a symlink to a file", temp_path.clone(), "./node.relative.sym.js"), - ("with a symlink to a directory 1", temp_path.clone(), "./lib/index.js"), - ("with a symlink to a directory 2", temp_path.clone(), "./this/lib/index.js"), - ("with multiple symlinks in the path 1", temp_path.clone(), "./this/test/temp/index.js"), - ("with multiple symlinks in the path 2", temp_path.clone(), "./this/test/temp/lib/index.js"), - ("with multiple symlinks in the path 3", temp_path.clone(), "./this/test/temp/this/lib/index.js"), - ("with a symlink to a directory 2 (chained)", temp_path.clone(), "./that/lib/index.js"), - ("with multiple symlinks in the path 1 (chained)", temp_path.clone(), "./that/test/temp/index.js"), - ("with multiple symlinks in the path 2 (chained)", temp_path.clone(), "./that/test/temp/lib/index.js"), - ("with multiple symlinks in the path 3 (chained)", temp_path.clone(), "./that/test/temp/that/lib/index.js"), - ("with symlinked directory as context 1", temp_path.join( "lib"), "./index.js"), - ("with symlinked directory as context 2", temp_path.join( "this"), "./lib/index.js"), - ("with symlinked directory as context and in path", temp_path.join( "this"), "./test/temp/lib/index.js"), - ("with symlinked directory in context path", temp_path.join( "this/lib"), "./index.js"), - ("with symlinked directory in context path and symlinked file", temp_path.join( "this/test"), "./temp/index.js"), - ("with symlinked directory in context path and symlinked directory", temp_path.join( "this/test"), "./temp/lib/index.js"), - ("with symlinked directory as context 2 (chained)", temp_path.join( "that"), "./lib/index.js"), - ("with symlinked directory as context and in path (chained)", temp_path.join( "that"), "./test/temp/lib/index.js"), - ("with symlinked directory in context path (chained)", temp_path.join( "that/lib"), "./index.js"), - ("with symlinked directory in context path and symlinked file (chained)", temp_path.join( "that/test"), "./temp/index.js"), - ("with symlinked directory in context path and symlinked directory (chained)", temp_path.join( "that/test"), "./temp/lib/index.js") - ]; - - for (comment, path, request) in pass { - let filename = resolver_with_symlinks.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(filename, Ok(root.join("lib/index.js")), "{comment:?}"); - - let resolved_path = - resolver_without_symlinks.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(path.join(request))); - } - - Ok(()) -} diff --git a/src/tests/tsconfig_paths.rs b/src/tests/tsconfig_paths.rs deleted file mode 100644 index b85bf6be..00000000 --- a/src/tests/tsconfig_paths.rs +++ /dev/null @@ -1,530 +0,0 @@ -//! tests for tsconfig-paths -//! -//! Fixtures copied from . - -use std::path::{Path, PathBuf}; - -use crate::{ - JSONError, ResolveError, ResolveOptions, Resolver, TsConfig, TsconfigOptions, - TsconfigReferences, -}; - -// -#[test] -fn tsconfig() { - let f = super::fixture_root().join("tsconfig"); - - #[rustfmt::skip] - let pass = [ - (f.clone(), None, "ts-path", f.join("foo.js")), - (f.join("nested"), None, "ts-path", f.join("nested/test.js")), - (f.join("cases/index"), None, "foo", f.join("node_modules/tsconfig-index/foo.js")), - // This requires reading package.json.tsconfig field - // (f.join("cases/field"), "foo", f.join("node_modules/tsconfig-field/foo.js")) - (f.join("cases/exports"), None, "foo", f.join("node_modules/tsconfig-exports/foo.js")), - (f.join("cases/extends-extension"), None, "foo", f.join("cases/extends-extension/foo.js")), - (f.join("cases/extends-extensionless"), None, "foo", f.join("node_modules/tsconfig-field/foo.js")), - (f.join("cases/extends-paths"), Some("src"), "@/index", f.join("cases/extends-paths/src/index.js")), - (f.join("cases/extends-multiple"), None, "foo", f.join("cases/extends-multiple/foo.js")), - ]; - - for (dir, subdir, request, expected) in pass { - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: dir.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - let path = subdir.map_or(dir.clone(), |subdir| dir.join(subdir)); - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{request} {path:?}"); - } - - #[rustfmt::skip] - let data = [ - (f.join("node_modules/tsconfig-not-used"), "ts-path", Ok(f.join("foo.js"))), - ]; - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - for (path, request, expected) in data { - let resolution = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolution, expected, "{path:?} {request}"); - } -} - -#[test] -fn tsconfig_fallthrough() { - let f = super::fixture_root().join("tsconfig"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "/"); - assert_eq!(resolved_path, Err(ResolveError::NotFound("/".into()))); -} - -#[test] -fn json_with_comments() { - let f = super::fixture_root().join("tsconfig/cases/trailing-comma"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "foo").map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(f.join("bar.js"))); -} - -#[test] -fn broken() { - let f = super::fixture_root().join("tsconfig"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("tsconfig_broken.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "/"); - let error = ResolveError::JSON(JSONError { - path: f.join("tsconfig_broken.json"), - message: String::from("EOF while parsing an object at line 2 column 0"), - line: 2, - column: 0, - }); - assert_eq!(resolved_path, Err(error)); -} - -// -#[test] -fn test_paths() { - let path = Path::new("/foo/tsconfig.json"); - let mut tsconfig_json = serde_json::json!({ - "compilerOptions": { - "paths": { - "jquery": ["node_modules/jquery/dist/jquery"], - "*": ["generated/*"], - "bar/*": ["test/*"], - "bar/baz/*": ["baz/*", "yo/*"], - "@/components/*": ["components/*"], - "url": ["node_modules/my-url"], - } - } - }) - .to_string(); - let tsconfig = TsConfig::parse(true, path, &mut tsconfig_json).unwrap(); - - let data = [ - ("jquery", vec!["/foo/node_modules/jquery/dist/jquery"]), - ("test", vec!["/foo/generated/test"]), - ("test/hello", vec!["/foo/generated/test/hello"]), - ("bar/hi", vec!["/foo/test/hi"]), - ("bar/baz/hi", vec!["/foo/baz/hi", "/foo/yo/hi"]), - ("@/components/button", vec!["/foo/components/button"]), - ("./jquery", vec![]), - ("url", vec!["/foo/node_modules/my-url"]), - ]; - - for (specifier, expected) in data { - let paths = tsconfig.resolve_path_alias(specifier); - let expected = expected.into_iter().map(PathBuf::from).collect::>(); - assert_eq!(paths, expected, "{specifier}"); - } -} - -// -#[test] -fn test_base_url() { - let path = Path::new("/foo/tsconfig.json"); - let mut tsconfig_json = serde_json::json!({ - "compilerOptions": { - "baseUrl": "./src" - } - }) - .to_string(); - let tsconfig = TsConfig::parse(true, path, &mut tsconfig_json).unwrap(); - - let data = [ - ("foo", vec!["/foo/src/foo"]), - ("components/button", vec!["/foo/src/components/button"]), - ("./jquery", vec![]), - ]; - - for (specifier, expected) in data { - let paths = tsconfig.resolve_path_alias(specifier); - let expected = expected.into_iter().map(PathBuf::from).collect::>(); - assert_eq!(paths, expected, "{specifier}"); - } -} - -// -#[test] -fn test_paths_and_base_url() { - let path = Path::new("/foo/tsconfig.json"); - let mut tsconfig_json = serde_json::json!({ - "compilerOptions": { - "baseUrl": "./src", - "paths": { - "*": ["generated/*"], - "bar/*": ["test/*"], - "bar/baz/*": ["baz/*", "yo/*"], - "@/components/*": ["components/*"] - } - } - }) - .to_string(); - let tsconfig = TsConfig::parse(true, path, &mut tsconfig_json).unwrap(); - - let data = [ - ("test", vec!["/foo/src/generated/test", "/foo/src/test"]), - ("test/hello", vec!["/foo/src/generated/test/hello", "/foo/src/test/hello"]), - ("bar/hi", vec!["/foo/src/test/hi", "/foo/src/bar/hi"]), - ("bar/baz/hi", vec!["/foo/src/baz/hi", "/foo/src/yo/hi", "/foo/src/bar/baz/hi"]), - ("@/components/button", vec!["/foo/src/components/button", "/foo/src/@/components/button"]), - ("./jquery", vec![]), - ]; - - for (specifier, expected) in data { - let paths = tsconfig.resolve_path_alias(specifier); - let expected = expected.into_iter().map(PathBuf::from).collect::>(); - assert_eq!(paths, expected, "{specifier}"); - } -} - -// Template variable ${configDir} for substitution of config files directory path -// https://github.com/microsoft/TypeScript/pull/58042 -#[test] -fn test_template_variable() { - let f = super::fixture_root().join("tsconfig"); - let f2 = f.join("cases").join("paths_template_variable"); - - #[rustfmt::skip] - let pass = [ - (f2.clone(), "tsconfig1.json", "foo", f2.join("foo.js")), - (f2.clone(), "tsconfig2.json", "foo", f2.join("foo.js")), - (f.clone(), "tsconfig_template_variable.json", "foo", f.join("foo.js")), - ]; - - for (dir, tsconfig, request, expected) in pass { - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: dir.join(tsconfig), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&dir, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{request} {tsconfig} {dir:?}"); - } -} - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows_test { - use std::path::{Path, PathBuf}; - - use crate::{ - ResolveError, ResolveOptions, ResolverGeneric, TsconfigOptions, TsconfigReferences, - }; - - use super::super::memory_fs::MemoryFS; - - struct OneTest { - name: &'static str, - tsconfig: String, - package_json: Option<(PathBuf, String)>, - main_fields: Option>, - existing_files: Vec<&'static str>, - requested_module: &'static str, - expected_path: &'static str, - extensions: Vec, - } - - impl Default for OneTest { - fn default() -> Self { - Self { - name: "", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/*": ["location/*"] - } - } - }) - .to_string(), - package_json: None, - main_fields: None, - existing_files: vec![], - requested_module: "", - expected_path: "", - extensions: vec![ - ".js".into(), - ".json".into(), - ".node".into(), - ".ts".into(), - ".tsx".into(), - ], - } - } - } - - impl OneTest { - fn resolver(&self, root: &Path) -> ResolverGeneric { - let mut file_system = MemoryFS::default(); - - file_system.add_file(&root.join("tsconfig.json"), &self.tsconfig); - if let Some((path, package_json)) = &self.package_json { - file_system.add_file(&root.join(path).join("package.json"), package_json); - } - for path in &self.existing_files { - file_system.add_file(Path::new(path), ""); - } - - let mut options = ResolveOptions { - extensions: self.extensions.clone(), - tsconfig: Some(TsconfigOptions { - config_file: root.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }; - if let Some(main_fields) = &self.main_fields { - options.main_fields.clone_from(main_fields); - } - - ResolverGeneric::::new_with_file_system(file_system, options) - } - } - - // Path matching tests from tsconfig-paths - // * - // * - #[test] - fn match_path() { - let pass = [ - OneTest { - name: "should locate path that matches with star and exists", - existing_files: vec!["/root/location/mylib/index.ts"], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve to correct path when many are specified", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/*": ["foo1/*", "foo2/*", "location/*", "foo3/*"], - } - } - }) - .to_string(), - existing_files: vec!["/root/location/mylib/index.ts"], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should locate path that matches with star and prioritize pattern with longest prefix", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "*": ["location/*"], - "lib/*": ["location/*"], - } - } - }) - .to_string(), - existing_files: vec![ - "/root/location/lib/mylib/index.ts", - "/root/location/mylib/index.ts", - ], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should locate path that matches with star and exists with extension", - existing_files: vec![ - "/root/location/mylib.myext", - ], - requested_module: "lib/mylib", - extensions: vec![".js".into(), ".myext".into()], - expected_path: "/root/location/mylib.myext", - ..OneTest::default() - }, - OneTest { - name: "should resolve request with extension specified", - existing_files: vec![ - "/root/location/test.jpg", - ], - requested_module: "lib/test.jpg", - expected_path: "/root/location/test.jpg", - ..OneTest::default() - }, - OneTest { - name: "should locate path that matches without star and exists", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/foo": ["location/foo"] - } - } - }) - .to_string(), - existing_files: vec![ - "/root/location/foo.ts", - ], - requested_module: "lib/foo", - expected_path: "/root/location/foo.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve to parent folder when filename is in subfolder", - existing_files: vec![ - "/root/location/mylib/index.ts", - ], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve from main field in package.json", - package_json: Some((PathBuf::from("/root/location/mylib"), serde_json::json!({ - "main": "./kalle.ts" - }).to_string())), - existing_files: vec![ - "/root/location/mylib/kalle.ts", - ], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/kalle.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve from main field in package.json (js)", - package_json: Some((PathBuf::from("/root/location/mylib.js"), serde_json::json!({ - "main": "./kalle.js" - }).to_string())), - existing_files: vec![ - "/root/location/mylib.js/kalle.js", - ], - extensions: vec![".ts".into(), ".js".into()], - requested_module: "lib/mylib.js", - expected_path: "/root/location/mylib.js/kalle.js", - ..OneTest::default() - }, - OneTest { - name: "should resolve from list of fields by priority in package.json", - main_fields: Some(vec!["missing".into(), "browser".into(), "main".into()]), - package_json: Some((PathBuf::from("/root/location/mylibjs"), serde_json::json!({ - "main": "./main.js", - "browser": "./browser.js" - }).to_string())), - existing_files: vec![ - "/root/location/mylibjs/main.js", - "/root/location/mylibjs/browser.js", - ], - extensions: vec![".ts".into(), ".js".into()], - requested_module: "lib/mylibjs", - expected_path: "/root/location/mylibjs/browser.js", - ..OneTest::default() - }, -OneTest { - name: "should ignore field mappings to missing files in package.json", - main_fields: Some(vec!["browser".into(), "main".into()]), - package_json: Some((PathBuf::from("/root/location/mylibjs"), serde_json::json!({ - "main": "./kalle.js", - "browser": "./nope.js" - }).to_string())), - existing_files: vec![ - "/root/location/mylibjs/kalle.js", - ], - extensions: vec![".ts".into(), ".js".into()], - requested_module: "lib/mylibjs", - expected_path: "/root/location/mylibjs/kalle.js", - ..OneTest::default() - }, - // Tests that are not applicable: - // name: "should resolve nested main fields" - // name: "should ignore advanced field mappings in package.json" - // name: "should resolve to with the help of baseUrl when not explicitly set" - // name: "should not resolve with the help of baseUrl when asked not to" - // name: "should resolve main file with cjs file extension" - OneTest { - name: "should resolve .ts from .js alias", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "@/*": ["src/*"] - } - } - }).to_string(), - existing_files: vec![ - "/root/src/foo.ts", - ], - requested_module: "@/foo", // original data was "@/foo.ts" but I don't get why it is the case? - expected_path: "/root/src/foo.ts", // original data was "/root/src/foo" - ..OneTest::default() - }, - ]; - - let root = PathBuf::from("/root"); - - for test in pass { - let resolved_path = - test.resolver(&root).resolve(&root, test.requested_module).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(PathBuf::from(test.expected_path)), "{}", test.name); - } - - let fail = [ - OneTest { - name: "should not locate path that does not match", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/*": ["location/*"] - } - } - }) - .to_string(), - existing_files: vec!["/root/location/mylib"], - requested_module: "lib/mylibjs", - ..OneTest::default() - }, - OneTest { - name: "should not resolve typings file (index.d.ts)", - existing_files: vec!["/root/location/mylib/index.d.ts"], - requested_module: "lib/mylib", - ..OneTest::default() - }, - ]; - - for test in fail { - let resolved_path = - test.resolver(&root).resolve(&root, test.requested_module).map(|f| f.full_path()); - assert_eq!( - resolved_path, - Err(ResolveError::NotFound(test.requested_module.into())), - "{}", - test.name - ); - } - } -} diff --git a/src/tests/tsconfig_project_references.rs b/src/tests/tsconfig_project_references.rs deleted file mode 100644 index 0d019d27..00000000 --- a/src/tests/tsconfig_project_references.rs +++ /dev/null @@ -1,132 +0,0 @@ -//! Tests for tsconfig project references - -use crate::{ResolveError, ResolveOptions, Resolver, TsconfigOptions, TsconfigReferences}; - -#[test] -fn auto() { - let f = super::fixture_root().join("tsconfig/cases/project_references"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("app"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - // Test normal paths alias - (f.join("app"), "@/index.ts", f.join("app/aliased/index.ts")), - (f.join("app"), "@/../index.ts", f.join("app/index.ts")), - // Test project reference - (f.join("project_a"), "@/index.ts", f.join("project_a/aliased/index.ts")), - (f.join("project_b/src"), "@/index.ts", f.join("project_b/src/aliased/index.ts")), - // Does not have paths alias - (f.join("project_a"), "./index.ts", f.join("project_a/index.ts")), - (f.join("project_c"), "./index.ts", f.join("project_c/index.ts")), - // Template variable - { - let dir = f.parent().unwrap().join("paths_template_variable"); - (dir.clone(), "foo", dir.join("foo.js")) - } - ]; - - for (path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{request} {path:?}"); - } -} - -#[test] -fn disabled() { - let f = super::fixture_root().join("tsconfig/cases/project_references"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("app"), - references: TsconfigReferences::Disabled, - }), - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - // Test normal paths alias - (f.join("app"), "@/index.ts", Ok(f.join("app/aliased/index.ts"))), - (f.join("app"), "@/../index.ts", Ok(f.join("app/index.ts"))), - // Test project reference - (f.join("project_a"), "@/index.ts", Err(ResolveError::NotFound("@/index.ts".into()))), - (f.join("project_b/src"), "@/index.ts", Err(ResolveError::NotFound("@/index.ts".into()))), - // Does not have paths alias - (f.join("project_a"), "./index.ts", Ok(f.join("project_a/index.ts"))), - (f.join("project_c"), "./index.ts", Ok(f.join("project_c/index.ts"))), - ]; - - for (path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, expected, "{request} {path:?}"); - } -} - -#[test] -fn manual() { - let f = super::fixture_root().join("tsconfig/cases/project_references"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("app"), - references: TsconfigReferences::Paths(vec!["../project_a/conf.json".into()]), - }), - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - // Test normal paths alias - (f.join("app"), "@/index.ts", Ok(f.join("app/aliased/index.ts"))), - (f.join("app"), "@/../index.ts", Ok(f.join("app/index.ts"))), - // Test project reference - (f.join("project_a"), "@/index.ts", Ok(f.join("project_a/aliased/index.ts"))), - (f.join("project_b/src"), "@/index.ts", Err(ResolveError::NotFound("@/index.ts".into()))), - // Does not have paths alias - (f.join("project_a"), "./index.ts", Ok(f.join("project_a/index.ts"))), - (f.join("project_c"), "./index.ts", Ok(f.join("project_c/index.ts"))), - ]; - - for (path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, expected, "{request} {path:?}"); - } -} - -#[test] -fn self_reference() { - let f = super::fixture_root().join("tsconfig/cases/project_references"); - - #[rustfmt::skip] - let pass = [ - (f.join("app"), vec!["./tsconfig.json".into()]), - (f.join("app/tsconfig.json"), vec!["./tsconfig.json".into()]), - (f.join("app"), vec![f.join("app")]), - (f.join("app/tsconfig.json"), vec![f.join("app")]), - (f.join("app/tsconfig.json"), vec![f.join("project_b"), f.join("app")]), - ]; - - for (config_file, reference_paths) in pass { - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: config_file.clone(), - references: TsconfigReferences::Paths(reference_paths.clone()), - }), - ..ResolveOptions::default() - }); - let path = f.join("app"); - let resolved_path = resolver.resolve(&path, "@/index.ts").map(|f| f.full_path()); - assert_eq!( - resolved_path, - Err(ResolveError::TsconfigSelfReference(f.join("app/tsconfig.json"))), - "{config_file:?} {reference_paths:?}" - ); - } -} diff --git a/src/tsconfig.rs b/src/tsconfig.rs deleted file mode 100644 index 6a675442..00000000 --- a/src/tsconfig.rs +++ /dev/null @@ -1,223 +0,0 @@ -use std::{ - hash::BuildHasherDefault, - path::{Path, PathBuf}, - sync::Arc, -}; - -use indexmap::IndexMap; -use rustc_hash::FxHasher; -use serde::Deserialize; - -use crate::PathUtil; - -pub type CompilerOptionsPathsMap = IndexMap, BuildHasherDefault>; - -#[derive(Debug, Clone, Eq, PartialEq, Deserialize)] -#[serde(untagged)] -pub enum ExtendsField { - Single(String), - Multiple(Vec), -} - -#[derive(Debug, Deserialize)] -#[serde(rename_all = "camelCase")] -pub struct TsConfig { - /// Whether this is the caller tsconfig. - /// Used for final template variable substitution when all configs are extended and merged. - #[serde(skip)] - root: bool, - - /// Path to `tsconfig.json`. Contains the `tsconfig.json` filename. - #[serde(skip)] - pub(crate) path: PathBuf, - - #[serde(default)] - pub extends: Option, - - #[serde(default)] - pub compiler_options: CompilerOptions, - - /// Bubbled up project references with a reference to their tsconfig. - #[serde(default)] - pub references: Vec, -} - -/// Compiler Options -/// -/// -#[derive(Debug, Default, Deserialize)] -#[serde(rename_all = "camelCase")] -pub struct CompilerOptions { - base_url: Option, - - /// Path aliases - paths: Option, - - /// The actual base for where path aliases are resolved from. - #[serde(skip)] - paths_base: PathBuf, -} - -/// Project Reference -/// -/// -#[derive(Debug, Deserialize)] -pub struct ProjectReference { - /// The path property of each reference can point to a directory containing a tsconfig.json file, - /// or to the config file itself (which may have any name). - pub path: PathBuf, - - /// Reference to the resolved tsconfig - #[serde(skip)] - pub tsconfig: Option>, -} - -impl TsConfig { - pub fn parse(root: bool, path: &Path, json: &mut str) -> Result { - _ = json_strip_comments::strip(json); - let mut tsconfig: Self = serde_json::from_str(json)?; - tsconfig.root = root; - tsconfig.path = path.to_path_buf(); - let directory = tsconfig.directory().to_path_buf(); - if let Some(base_url) = tsconfig.compiler_options.base_url { - tsconfig.compiler_options.base_url = Some(directory.normalize_with(base_url)); - } - if tsconfig.compiler_options.paths.is_some() { - tsconfig.compiler_options.paths_base = - tsconfig.compiler_options.base_url.as_ref().map_or(directory, Clone::clone); - } - Ok(tsconfig) - } - - pub fn build(mut self) -> Self { - if self.root { - let dir = self.directory().to_path_buf(); - // Substitute template variable in `tsconfig.compilerOptions.paths` - if let Some(paths) = &mut self.compiler_options.paths { - for paths in paths.values_mut() { - for path in paths { - Self::substitute_template_variable(&dir, path); - } - } - } - } - self - } - - /// Directory to `tsconfig.json` - /// - /// # Panics - /// - /// * When the `tsconfig.json` path is misconfigured. - pub fn directory(&self) -> &Path { - debug_assert!(self.path.file_name().is_some()); - self.path.parent().unwrap() - } - - pub fn extend_tsconfig(&mut self, tsconfig: &Self) { - let compiler_options = &mut self.compiler_options; - if compiler_options.paths.is_none() { - compiler_options.paths_base = compiler_options - .base_url - .as_ref() - .map_or_else(|| tsconfig.compiler_options.paths_base.clone(), Clone::clone); - compiler_options.paths.clone_from(&tsconfig.compiler_options.paths); - } - if compiler_options.base_url.is_none() { - compiler_options.base_url.clone_from(&tsconfig.compiler_options.base_url); - } - } - - pub fn resolve(&self, path: &Path, specifier: &str) -> Vec { - if path.starts_with(self.base_path()) { - let paths = self.resolve_path_alias(specifier); - if !paths.is_empty() { - return paths; - } - } - for tsconfig in self.references.iter().filter_map(|reference| reference.tsconfig.as_ref()) { - if path.starts_with(tsconfig.base_path()) { - return tsconfig.resolve_path_alias(specifier); - } - } - vec![] - } - - // Copied from parcel - // - pub fn resolve_path_alias(&self, specifier: &str) -> Vec { - if specifier.starts_with(['/', '.']) { - return vec![]; - } - - let base_url_iter = self - .compiler_options - .base_url - .as_ref() - .map_or_else(Vec::new, |base_url| vec![base_url.normalize_with(specifier)]); - - let Some(paths_map) = &self.compiler_options.paths else { - return base_url_iter; - }; - - let paths = paths_map.get(specifier).map_or_else( - || { - let mut longest_prefix_length = 0; - let mut longest_suffix_length = 0; - let mut best_key: Option<&String> = None; - - for key in paths_map.keys() { - if let Some((prefix, suffix)) = key.split_once('*') { - if (best_key.is_none() || prefix.len() > longest_prefix_length) - && specifier.starts_with(prefix) - && specifier.ends_with(suffix) - { - longest_prefix_length = prefix.len(); - longest_suffix_length = suffix.len(); - best_key.replace(key); - } - } - } - - best_key.and_then(|key| paths_map.get(key)).map_or_else(Vec::new, |paths| { - paths - .iter() - .map(|path| { - path.replace( - '*', - &specifier[longest_prefix_length - ..specifier.len() - longest_suffix_length], - ) - }) - .collect::>() - }) - }, - Clone::clone, - ); - - paths - .into_iter() - .map(|p| self.compiler_options.paths_base.normalize_with(p)) - .chain(base_url_iter) - .collect() - } - - fn base_path(&self) -> &Path { - self.compiler_options - .base_url - .as_ref() - .map_or_else(|| self.directory(), |path| path.as_ref()) - } - - /// Template variable `${configDir}` for substitution of config files directory path - /// - /// NOTE: All tests cases are just a head replacement of `${configDir}`, so we are constrained as such. - /// - /// See - fn substitute_template_variable(directory: &Path, path: &mut String) { - const TEMPLATE_VARIABLE: &str = "${configDir}/"; - if let Some(stripped_path) = path.strip_prefix(TEMPLATE_VARIABLE) { - *path = directory.join(stripped_path).to_string_lossy().to_string(); - } - } -} diff --git a/tests/integration_test.rs b/tests/integration_test.rs deleted file mode 100644 index 0fc52887..00000000 --- a/tests/integration_test.rs +++ /dev/null @@ -1,103 +0,0 @@ -//! Test public APIs - -use std::{env, path::PathBuf}; - -use oxc_resolver::{EnforceExtension, Resolution, ResolveContext, ResolveOptions, Resolver}; - -fn dir() -> PathBuf { - env::current_dir().unwrap() -} - -fn resolve(specifier: &str) -> Resolution { - let path = dir(); - Resolver::new(ResolveOptions::default()).resolve(path, specifier).unwrap() -} - -#[test] -fn clone() { - let resolution = resolve("./tests/package.json"); - assert_eq!(resolution.clone(), resolution); -} - -#[test] -fn debug() { - let resolution = resolve("./tests/package.json"); - let s = format!("{resolution:?}"); - assert!(!s.is_empty()); -} - -#[test] -fn eq() { - let resolution = resolve("./tests/package.json"); - assert_eq!(resolution, resolution); -} - -#[test] -fn package_json() { - let resolution = resolve("./tests/package.json"); - let package_json = resolution.package_json().unwrap(); - assert_eq!(package_json.name.as_ref().unwrap(), "name"); - assert_eq!(package_json.r#type.as_ref().unwrap().as_str(), "module".into()); - assert!(package_json.side_effects.as_ref().unwrap().is_object()); -} - -#[cfg(feature = "package_json_raw_json_api")] -#[test] -fn package_json_raw_json_api() { - let resolution = resolve("./tests/package.json"); - assert!(resolution - .package_json() - .unwrap() - .raw_json() - .get("name") - .is_some_and(|name| name == "name")); -} - -#[test] -fn clear_cache() { - let resolver = Resolver::new(ResolveOptions::default()); - resolver.clear_cache(); // exists -} - -#[test] -fn options() { - let resolver = Resolver::new(ResolveOptions::default()); - let options = resolver.options(); - assert!(!format!("{options:?}").is_empty()); -} - -#[test] -fn debug_resolver() { - let resolver = Resolver::new(ResolveOptions::default()); - assert!(!format!("{resolver:?}").is_empty()); -} - -#[test] -fn dependencies() { - let path = dir(); - let mut ctx = ResolveContext::default(); - let _ = Resolver::new(ResolveOptions::default()).resolve_with_context( - path, - "./tests/package.json", - &mut ctx, - ); - assert!(!ctx.file_dependencies.is_empty()); - assert!(ctx.missing_dependencies.is_empty()); -} - -#[test] -fn options_api() { - _ = ResolveOptions::default() - .with_builtin_modules(true) - .with_condition_names(&[]) - .with_extension(".js") - .with_force_extension(EnforceExtension::Auto) - .with_fully_specified(true) - .with_main_field("asdf") - .with_main_file("main") - .with_module("module") - .with_prefer_absolute(true) - .with_prefer_relative(true) - .with_root(PathBuf::new()) - .with_symbolic_link(true); -} diff --git a/tests/package.json b/tests/package.json deleted file mode 100644 index 54f58b8c..00000000 --- a/tests/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "name", - "type": "module", - "sideEffects": {} -} diff --git a/tests/resolve_test.rs b/tests/resolve_test.rs deleted file mode 100644 index 45934cf8..00000000 --- a/tests/resolve_test.rs +++ /dev/null @@ -1,132 +0,0 @@ -use std::{env, path::PathBuf}; - -use oxc_resolver::{ResolveError, ResolveOptions, Resolver}; - -fn dir() -> PathBuf { - env::current_dir().unwrap() -} - -#[test] -fn chinese() { - let dir = dir(); - let specifier = "./fixtures/misc/中文/中文.js"; - let resolution = Resolver::new(ResolveOptions::default()).resolve(&dir, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(dir.join("fixtures/misc/中文/中文.js")) - ); -} - -#[test] -fn styled_components() { - let dir = dir(); - let path = dir.join("fixtures/pnpm"); - let module_path = dir.join("node_modules/.pnpm/styled-components@6.1.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/styled-components"); - let specifier = "styled-components"; - - // cjs - let options = - ResolveOptions { alias_fields: vec![vec!["browser".into()]], ..ResolveOptions::default() }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/styled-components.browser.cjs.js")) - ); - - // esm - let options = ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - main_fields: vec!["module".into()], - ..ResolveOptions::default() - }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/styled-components.browser.esm.js")) - ); -} - -#[test] -fn axios() { - let dir = dir(); - let path = dir.join("fixtures/pnpm"); - let module_path = dir.join("node_modules/.pnpm/axios@1.6.2/node_modules/axios"); - let specifier = "axios"; - - // default - let options = ResolveOptions::default(); - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("index.js")) - ); - - // browser - let options = ResolveOptions { - condition_names: vec!["browser".into(), "require".into()], - ..ResolveOptions::default() - }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/browser/axios.cjs")) - ); - - // cjs - let options = ResolveOptions { - condition_names: vec!["node".into(), "require".into()], - ..ResolveOptions::default() - }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/node/axios.cjs")) - ); -} - -#[test] -fn postcss() { - let dir = dir(); - let path = dir.join("fixtures/pnpm"); - let module_path = path.join("node_modules/postcss"); - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - // should ignore "path" - let resolution = resolver.resolve(&module_path, "path"); - assert_eq!(resolution, Err(ResolveError::Ignored(module_path.clone()))); - - // should ignore "./lib/terminal-highlight" - let resolution = resolver.resolve(&module_path, "./lib/terminal-highlight"); - assert_eq!(resolution, Err(ResolveError::Ignored(module_path.join("lib/terminal-highlight")))); -} - -#[test] -fn ipaddr_js() { - let dir = dir(); - let path = dir.join("fixtures/pnpm"); - let module_path = - dir.join("node_modules/.pnpm/ipaddr.js@2.2.0/node_modules/ipaddr.js/lib/ipaddr.js"); - - let resolvers = [ - // with `extension_alias` - Resolver::new(ResolveOptions { - extension_alias: vec![(".js".into(), vec![".js".into(), ".ts".into(), ".tsx".into()])], - ..ResolveOptions::default() - }), - // with `extensions` should still resolve to module main - Resolver::new(ResolveOptions { - extensions: vec![(".ts".into())], - ..ResolveOptions::default() - }), - // default - Resolver::default(), - ]; - - for resolver in resolvers { - let resolution = resolver.resolve(&path, "ipaddr.js").map(|r| r.full_path()); - assert_eq!(resolution, Ok(module_path.clone())); - } -} From 836fed117a98aeec23e20dc20e0cc3397e7786d4 Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Tue, 10 Sep 2024 22:55:28 +0300 Subject: [PATCH 74/82] --- .github/CODE_OF_CONDUCT.md | 127 - .github/SECURITY.md | 7 - .github/actions/pnpm/action.yml | 26 - .github/codecov.yml | 14 - .github/renovate.json | 5 - .github/workflows/benchmark.yml | 41 - .github/workflows/ci.yml | 196 - .github/workflows/codecov.yml | 69 - .github/workflows/release-napi.yml | 252 - .github/workflows/release-plz.yml | 55 - Cargo.lock | 1326 --- fixtures/enhanced_resolve/lib/index.js | 1 - fixtures/enhanced_resolve/package.json | 4 - fixtures/enhanced_resolve/test/.gitignore | 3 - .../enhanced_resolve/test/fixtures/#/a.js | 0 fixtures/enhanced_resolve/test/fixtures/a.js | 3 - .../enhanced_resolve/test/fixtures/abc.txt | 1 - .../test/fixtures/alias/files/a.js | 0 fixtures/enhanced_resolve/test/fixtures/b.js | 3 - .../browser-module/browser/module-a.js | 0 .../fixtures/browser-module/lib/browser.js | 0 .../fixtures/browser-module/lib/ignore.js | 0 .../test/fixtures/browser-module/lib/main.js | 0 .../fixtures/browser-module/lib/replaced.js | 0 .../test/fixtures/browser-module/lib/self.js | 0 .../fixtures/browser-module/lib/toString.js | 0 .../browser-module/node_modules/module-a.js | 0 .../browser-module/node_modules/module-b.js | 0 .../browser-module/node_modules/module-c.js | 0 .../node_modules/recursive-file/a.js | 0 .../node_modules/recursive-file/b.js | 0 .../node_modules/recursive-file/c.js | 0 .../node_modules/recursive-file/d.js | 0 .../node_modules/recursive-file/package.json | 8 - .../test/fixtures/browser-module/package.json | 33 - .../test/fixtures/builtins/package.json | 12 - fixtures/enhanced_resolve/test/fixtures/c.js | 4 - .../enhanced_resolve/test/fixtures/complex.js | 13 - .../test/fixtures/crypto-js/index.js | 0 .../test/fixtures/crypto-js/package.json | 7 - .../test/fixtures/decorated-fs/exists.js | 0 .../test/fixtures/dirOrFile.js | 1 - .../test/fixtures/dirOrFile/index.js | 1 - .../directory-default/directory-default.js | 0 .../node_modules/@org/pkg/dist/string.js | 1 - .../@org/pkg/dist/string.test.d.ts | 1 - .../node_modules/@org/pkg/package.json | 9 - .../node_modules/pkg/dist/string.js | 1 - .../node_modules/pkg/dist/string.test.d.ts | 1 - .../node_modules/pkg/package.json | 9 - .../node_modules/exports-field/package.json | 7 - .../node_modules/pack1/index.js | 0 .../test/fixtures/exports-field/a.js | 1 - .../node_modules/exports-field/lib/browser.js | 1 - .../node_modules/exports-field/lib/index.js | 0 .../exports-field/lib/lib2/main.js | 1 - .../node_modules/exports-field/lib/main.js | 1 - .../node_modules/exports-field/main.js | 1 - .../node_modules/exports-field/package.json | 18 - .../node_modules/exports-field/x.js | 1 - .../invalid-exports-field/index.js | 0 .../invalid-exports-field/package.json | 13 - .../node_modules/invalid-exports-field/umd.js | 0 .../test/fixtures/exports-field/package.json | 5 - .../node_modules/exports-field/index.js | 1 - .../node_modules/exports-field/lib/browser.js | 1 - .../exports-field/lib/lib2/main.js | 1 - .../node_modules/exports-field/lib/main.js | 1 - .../node_modules/exports-field/main.js | 1 - .../node_modules/exports-field/package.json | 17 - .../node_modules/exports-field/index | 0 .../node_modules/exports-field/main.js | 1 - .../node_modules/exports-field/package.json | 10 - .../node_modules/exports-field/src/index.js | 0 .../fixtures/extension-alias/dir/index.js | 0 .../fixtures/extension-alias/dir/index.ts | 0 .../fixtures/extension-alias/dir2/index.js | 0 .../fixtures/extension-alias/dir2/index.mts | 0 .../test/fixtures/extension-alias/index.js | 0 .../test/fixtures/extension-alias/index.mjs | 0 .../fixtures/extension-alias/index.mts.js | 0 .../test/fixtures/extension-alias/index.ts | 0 .../test/fixtures/extensions/app.module.js | 0 .../test/fixtures/extensions/dir/index.js | 0 .../test/fixtures/extensions/dir/index.ts | 0 .../test/fixtures/extensions/foo.js | 0 .../test/fixtures/extensions/foo.ts | 0 .../test/fixtures/extensions/index.js | 0 .../test/fixtures/extensions/index.ts | 0 .../extensions/node_modules/module.js | 0 .../extensions/node_modules/module/index.ts | 0 .../test/fixtures/extensions/package.json | 3 - .../enhanced_resolve/test/fixtures/file.load1 | 0 .../enhanced_resolve/test/fixtures/file.load2 | 0 .../test/fixtures/foo/index.js | 0 .../test/fixtures/foo/package.json | 4 - .../node_modules/m/package.json | 17 - .../node_modules/m/src/features/f.js | 0 .../m/src/features/internal/file.js | 0 .../node_modules/m/src/features/y/y.js | 0 .../node_modules/m/src/internal/i.js | 0 .../node_modules/m/src/middle-1/f.js | 0 .../node_modules/m/src/middle-1/nested/f.js | 0 .../node_modules/m/src/middle-2/nested/f.js | 1 - .../m/src/middle-3/nested/f/nested/f.js | 0 .../node_modules/m/src/middle-4/f/f.js | 0 .../node_modules/m/src/middle-5/f$/$.js | 0 .../node_modules/m/src/middle-5/f/$.js | 0 .../node_modules/m/src/middle/f.js | 0 .../node_modules/m/src/middle/nested/f.js | 0 .../test/fixtures/imports-field/a.js | 1 - .../test/fixtures/imports-field/b.js | 0 .../test/fixtures/imports-field/dir/b.js | 0 .../node_modules/a/lib/browser.js | 1 - .../imports-field/node_modules/a/lib/index.js | 0 .../node_modules/a/lib/lib2/main.js | 1 - .../imports-field/node_modules/a/lib/main.js | 1 - .../imports-field/node_modules/a/main.js | 1 - .../imports-field/node_modules/a/package.json | 18 - .../imports-field/node_modules/a/x.js | 1 - .../imports-field/node_modules/c/index.js | 0 .../test/fixtures/imports-field/package.json | 17 - .../fixtures/incorrect-package/pack1/a.js | 0 .../incorrect-package/pack1/package.json | 2 - .../fixtures/incorrect-package/pack2/a.js | 0 .../incorrect-package/pack2/package.json | 0 .../test/fixtures/issue-238/package.json | 3 - .../test/fixtures/issue-238/src/a/config.js | 0 .../src/common/config/myObjectFile.js | 0 .../enhanced_resolve/test/fixtures/lib.js | 0 .../test/fixtures/lib/complex1.js | 1 - .../test/fixtures/main-field-self/index.js | 0 .../fixtures/main-field-self/package.json | 3 - .../test/fixtures/main-field-self2/index.js | 0 .../fixtures/main-field-self2/package.json | 3 - .../enhanced_resolve/test/fixtures/main1.js | 9 - .../enhanced_resolve/test/fixtures/main2.js | 12 - .../enhanced_resolve/test/fixtures/main3.js | 4 - .../multiple_modules/node_modules/m1/a.js | 3 - .../test/fixtures/no#fragment/#/#.js | 0 fixtures/enhanced_resolve/test/fixtures/no.js | 0 .../browser-module-broken/browser.js | 0 .../browser-module-broken/main.js | 0 .../browser-module-broken/package.json | 4 - .../complexm/node_modules/m1/a.js | 1 - .../complexm/node_modules/m1/index.js | 1 - .../fixtures/node_modules/complexm/step1.js | 1 - .../fixtures/node_modules/complexm/step2.js | 1 - .../fixtures/node_modules/dash-name/index.js | 0 .../node_modules/dash-name/package.json | 4 - .../test/fixtures/node_modules/dash/index.js | 0 .../fixtures/node_modules/dash/package.json | 4 - .../invalidPackageJson/package.json | 0 .../test/fixtures/node_modules/m1/a.js | 3 - .../test/fixtures/node_modules/m1/b.js | 3 - .../test/fixtures/node_modules/m2/b.js | 1 - .../node_modules/recursive-module/file.js | 0 .../node_modules/recursive-module/index.js | 0 .../test/fixtures/pnp-a/m2/a.js | 3 - .../test/fixtures/pnp/pkg/dir/index.js | 0 .../test/fixtures/pnp/pkg/index.js | 0 .../test/fixtures/pnp/pkg/main.js | 0 .../fixtures/pnp/pkg/package-alias/browser.js | 0 .../fixtures/pnp/pkg/package-alias/index.js | 0 .../test/fixtures/pnp/pkg/package.json | 7 - .../test/fixtures/pnp/pkg/typescript/index.ts | 0 .../test/fixtures/pnp/pkg3/a.js | 1 - .../test/fixtures/pnp/pkg3/package.json | 8 - .../prefer-pnp/alternative-modules/m1/b.js | 0 .../restrictions/node_modules/pck1/index.css | 0 .../restrictions/node_modules/pck1/index.js | 0 .../node_modules/pck1/package.json | 3 - .../restrictions/node_modules/pck2/index.css | 0 .../restrictions/node_modules/pck2/module.js | 0 .../node_modules/pck2/package.json | 5 - .../test/fixtures/roots_fall_through/index.js | 0 .../scoped/node_modules/@scope/pack1/main.js | 0 .../node_modules/@scope/pack1/package.json | 5 - .../node_modules/@scope/pack2/lib/index.js | 0 .../scoped/node_modules/@scope/pack2/main.js | 0 .../node_modules/@scope/pack2/package.json | 3 - .../test/fixtures/shortcutdir.js/a.js | 0 .../test/fixtures/yield/a/foo-2/b | 0 .../test/fixtures/yield/a/foo-2/c | 0 .../test/fixtures/yield/a/foo/a | 0 .../test/fixtures/yield/a/foo/b | 0 .../test/fixtures/yield/b/foo/a | 0 .../test/fixtures/yield/c/foo/a | 0 .../test/fixtures/yield/c/foo/package.json | 7 - .../fixtures/\346\265\213\350\257\225.js" | 0 .../\344\270\255\346\226\207.js" | 0 fixtures/pnp/.gitignore | 1 - fixtures/pnp/.pnp.cjs | 7543 ----------------- fixtures/pnp/.yarnrc.yml | 1 - fixtures/pnp/package.json | 8 - fixtures/pnp/yarn.lock | 74 - fixtures/pnpm/.gitignore | 1 - fixtures/pnpm/package.json | 11 - fixtures/pnpm/pnpm-lock.yaml | 212 - fixtures/tsconfig/cases/builtins/thing.js | 0 .../tsconfig/cases/builtins/tsconfig.json | 5 - fixtures/tsconfig/cases/exports/index.js | 0 fixtures/tsconfig/cases/exports/tsconfig.json | 3 - .../extends-extension/base-tsconfig.json | 7 - .../tsconfig/cases/extends-extension/foo.js | 0 .../cases/extends-extension/tsconfig.json | 3 - .../cases/extends-extensionless/foo.js | 0 .../cases/extends-extensionless/tsconfig.json | 3 - .../tsconfig/cases/extends-multiple/foo.js | 0 .../cases/extends-multiple/tsconfig.json | 6 - .../tsconfig/cases/extends-not-found/index.js | 0 .../cases/extends-not-found/tsconfig.json | 3 - .../tsconfig/cases/extends-paths/src/index.js | 0 .../cases/extends-paths/tsconfig.base.json | 7 - .../cases/extends-paths/tsconfig.json | 6 - fixtures/tsconfig/cases/field/index.js | 0 fixtures/tsconfig/cases/field/tsconfig.json | 3 - fixtures/tsconfig/cases/index/index.js | 0 fixtures/tsconfig/cases/index/tsconfig.json | 3 - .../cases/paths_template_variable/foo.js | 0 .../paths_template_variable/tsconfig1.json | 3 - .../paths_template_variable/tsconfig2.json | 8 - .../project_references/app/aliased/index.ts | 0 .../cases/project_references/app/index.ts | 0 .../project_references/app/tsconfig.json | 23 - .../project_a/aliased/index.ts | 0 .../project_references/project_a/conf.json | 8 - .../project_references/project_a/index.ts | 0 .../project_b/src/aliased/index.ts | 0 .../project_b/tsconfig.json | 9 - .../project_references/project_c/index.ts | 0 .../project_c/tsconfig.json | 5 - .../project_references/tsconfig.base.json | 4 - fixtures/tsconfig/cases/suffixes/a.ios.ts | 0 fixtures/tsconfig/cases/suffixes/a.ts | 0 fixtures/tsconfig/cases/suffixes/b.ts | 0 fixtures/tsconfig/cases/suffixes/c-test.ts | 0 fixtures/tsconfig/cases/suffixes/index.ts | 1 - .../tsconfig/cases/suffixes/tsconfig.json | 5 - fixtures/tsconfig/cases/trailing-comma/bar.js | 0 .../tsconfig/cases/trailing-comma/index.js | 0 .../cases/trailing-comma/tsconfig.json | 9 - fixtures/tsconfig/foo.js | 0 fixtures/tsconfig/nested/index.js | 0 fixtures/tsconfig/nested/test.js | 0 fixtures/tsconfig/nested/tsconfig.json | 8 - .../node_modules/tsconfig-exports/conf.json | 7 - .../node_modules/tsconfig-exports/foo.js | 0 .../tsconfig-exports/package.json | 7 - .../node_modules/tsconfig-field/conf.json | 7 - .../node_modules/tsconfig-field/foo.js | 0 .../node_modules/tsconfig-field/package.json | 5 - .../node_modules/tsconfig-index/foo.js | 0 .../node_modules/tsconfig-index/package.json | 4 - .../node_modules/tsconfig-index/tsconfig.json | 7 - .../node_modules/tsconfig-not-used/foo.js | 0 .../tsconfig-not-used/tsconfig.json | 7 - fixtures/tsconfig/package.json | 24 - fixtures/tsconfig/tsconfig.json | 7 - fixtures/tsconfig/tsconfig_broken.json | 1 - .../tsconfig/tsconfig_template_variable.json | 7 - napi/__test__/resolver.spec.mjs | 260 - napi/src/lib.rs | 214 - napi/src/options.rs | 261 - napi/src/tracing.rs | 25 - napi/tests/options.test.mjs | 59 - npm/package.json | 79 +- package.json | 53 +- pnpm-lock.yaml | 2598 ------ src/builtins.rs | 71 - src/cache.rs | 354 - src/context.rs | 89 - src/error.rs | 182 - src/file_system.rs | 220 - src/lib.rs | 1755 ---- src/options.rs | 633 -- src/package_json.rs | 219 - src/path.rs | 132 - src/resolution.rs | 92 - src/specifier.rs | 230 - src/tests/alias.rs | 283 - src/tests/browser_field.rs | 189 - src/tests/builtins.rs | 121 - src/tests/dependencies.rs | 110 - src/tests/exports_field.rs | 2546 ------ src/tests/extension_alias.rs | 70 - src/tests/extensions.rs | 125 - src/tests/fallback.rs | 100 - src/tests/full_specified.rs | 113 - src/tests/imports_field.rs | 1320 --- src/tests/incorrect_description_file.rs | 65 - src/tests/main_field.rs | 24 - src/tests/memory_fs.rs | 74 - src/tests/missing.rs | 106 - src/tests/mod.rs | 51 - src/tests/pnp.rs | 45 - src/tests/resolve.rs | 119 - src/tests/restrictions.rs | 25 - src/tests/roots.rs | 92 - src/tests/scoped_packages.rs | 25 - src/tests/simple.rs | 68 - src/tests/symlink.rs | 121 - src/tests/tsconfig_paths.rs | 530 -- src/tests/tsconfig_project_references.rs | 132 - src/tsconfig.rs | 223 - tests/integration_test.rs | 103 - tests/package.json | 5 - tests/resolve_test.rs | 132 - 308 files changed, 56 insertions(+), 24940 deletions(-) delete mode 100644 .github/CODE_OF_CONDUCT.md delete mode 100644 .github/SECURITY.md delete mode 100644 .github/actions/pnpm/action.yml delete mode 100644 .github/codecov.yml delete mode 100644 .github/renovate.json delete mode 100644 .github/workflows/benchmark.yml delete mode 100644 .github/workflows/ci.yml delete mode 100644 .github/workflows/codecov.yml delete mode 100644 .github/workflows/release-napi.yml delete mode 100644 .github/workflows/release-plz.yml delete mode 100644 Cargo.lock delete mode 100644 fixtures/enhanced_resolve/lib/index.js delete mode 100644 fixtures/enhanced_resolve/package.json delete mode 100644 fixtures/enhanced_resolve/test/.gitignore delete mode 100644 fixtures/enhanced_resolve/test/fixtures/#/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/abc.txt delete mode 100644 fixtures/enhanced_resolve/test/fixtures/alias/files/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/browser/module-a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/ignore.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/replaced.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/self.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/toString.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-c.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/c.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/d.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/builtins/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/c.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/complex.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/crypto-js/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/decorated-fs/exists.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/dirOrFile.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/directory-default/directory-default.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/pack1/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/umd.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/index delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/src/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.mts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mjs delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mts.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/app.module.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/foo.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/foo.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/file.load1 delete mode 100644 fixtures/enhanced_resolve/test/fixtures/file.load2 delete mode 100644 fixtures/enhanced_resolve/test/fixtures/foo/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/foo/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/internal/file.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/y/y.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/internal/i.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-3/nested/f/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-4/f/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f$/$.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f/$.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/dir/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/c/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/issue-238/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/issue-238/src/a/config.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/issue-238/src/common/config/myObjectFile.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/lib.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/lib/complex1.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self2/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main1.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main2.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main3.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/no#fragment/#/#.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/no.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/invalidPackageJson/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/file.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/dir/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/typescript/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/prefer-pnp/alternative-modules/m1/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.css delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/index.css delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/module.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/roots_fall_through/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/lib/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/shortcutdir.js/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/b delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/c delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo/a delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo/b delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/b/foo/a delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/c/foo/a delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json delete mode 100644 "fixtures/enhanced_resolve/test/fixtures/\346\265\213\350\257\225.js" delete mode 100644 "fixtures/misc/\344\270\255\346\226\207/\344\270\255\346\226\207.js" delete mode 100644 fixtures/pnp/.gitignore delete mode 100755 fixtures/pnp/.pnp.cjs delete mode 100644 fixtures/pnp/.yarnrc.yml delete mode 100644 fixtures/pnp/package.json delete mode 100644 fixtures/pnp/yarn.lock delete mode 100644 fixtures/pnpm/.gitignore delete mode 100644 fixtures/pnpm/package.json delete mode 100644 fixtures/pnpm/pnpm-lock.yaml delete mode 100644 fixtures/tsconfig/cases/builtins/thing.js delete mode 100644 fixtures/tsconfig/cases/builtins/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/exports/index.js delete mode 100644 fixtures/tsconfig/cases/exports/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-extension/base-tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-extension/foo.js delete mode 100644 fixtures/tsconfig/cases/extends-extension/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-extensionless/foo.js delete mode 100644 fixtures/tsconfig/cases/extends-extensionless/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-multiple/foo.js delete mode 100644 fixtures/tsconfig/cases/extends-multiple/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-not-found/index.js delete mode 100644 fixtures/tsconfig/cases/extends-not-found/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-paths/src/index.js delete mode 100644 fixtures/tsconfig/cases/extends-paths/tsconfig.base.json delete mode 100644 fixtures/tsconfig/cases/extends-paths/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/field/index.js delete mode 100644 fixtures/tsconfig/cases/field/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/index/index.js delete mode 100644 fixtures/tsconfig/cases/index/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/paths_template_variable/foo.js delete mode 100644 fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json delete mode 100644 fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json delete mode 100644 fixtures/tsconfig/cases/project_references/app/aliased/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/app/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/app/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/project_references/project_a/aliased/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_a/conf.json delete mode 100644 fixtures/tsconfig/cases/project_references/project_a/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_b/src/aliased/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_b/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/project_references/project_c/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_c/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/project_references/tsconfig.base.json delete mode 100644 fixtures/tsconfig/cases/suffixes/a.ios.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/a.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/b.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/c-test.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/index.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/trailing-comma/bar.js delete mode 100644 fixtures/tsconfig/cases/trailing-comma/index.js delete mode 100644 fixtures/tsconfig/cases/trailing-comma/tsconfig.json delete mode 100644 fixtures/tsconfig/foo.js delete mode 100644 fixtures/tsconfig/nested/index.js delete mode 100644 fixtures/tsconfig/nested/test.js delete mode 100644 fixtures/tsconfig/nested/tsconfig.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-exports/conf.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-exports/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-exports/package.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-field/conf.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-field/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-field/package.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-index/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-index/package.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-not-used/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json delete mode 100755 fixtures/tsconfig/package.json delete mode 100644 fixtures/tsconfig/tsconfig.json delete mode 100644 fixtures/tsconfig/tsconfig_broken.json delete mode 100644 fixtures/tsconfig/tsconfig_template_variable.json delete mode 100644 napi/__test__/resolver.spec.mjs delete mode 100644 napi/src/lib.rs delete mode 100644 napi/src/options.rs delete mode 100644 napi/src/tracing.rs delete mode 100644 napi/tests/options.test.mjs delete mode 100644 pnpm-lock.yaml delete mode 100644 src/builtins.rs delete mode 100644 src/cache.rs delete mode 100644 src/context.rs delete mode 100644 src/error.rs delete mode 100644 src/file_system.rs delete mode 100644 src/lib.rs delete mode 100644 src/options.rs delete mode 100644 src/package_json.rs delete mode 100644 src/path.rs delete mode 100644 src/resolution.rs delete mode 100644 src/specifier.rs delete mode 100644 src/tests/alias.rs delete mode 100644 src/tests/browser_field.rs delete mode 100644 src/tests/builtins.rs delete mode 100644 src/tests/dependencies.rs delete mode 100644 src/tests/exports_field.rs delete mode 100644 src/tests/extension_alias.rs delete mode 100644 src/tests/extensions.rs delete mode 100644 src/tests/fallback.rs delete mode 100644 src/tests/full_specified.rs delete mode 100644 src/tests/imports_field.rs delete mode 100644 src/tests/incorrect_description_file.rs delete mode 100644 src/tests/main_field.rs delete mode 100644 src/tests/memory_fs.rs delete mode 100644 src/tests/missing.rs delete mode 100644 src/tests/mod.rs delete mode 100644 src/tests/pnp.rs delete mode 100644 src/tests/resolve.rs delete mode 100644 src/tests/restrictions.rs delete mode 100644 src/tests/roots.rs delete mode 100644 src/tests/scoped_packages.rs delete mode 100644 src/tests/simple.rs delete mode 100644 src/tests/symlink.rs delete mode 100644 src/tests/tsconfig_paths.rs delete mode 100644 src/tests/tsconfig_project_references.rs delete mode 100644 src/tsconfig.rs delete mode 100644 tests/integration_test.rs delete mode 100644 tests/package.json delete mode 100644 tests/resolve_test.rs diff --git a/.github/CODE_OF_CONDUCT.md b/.github/CODE_OF_CONDUCT.md deleted file mode 100644 index 41dd9ebe..00000000 --- a/.github/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,127 +0,0 @@ -# Contributor Covenant Code of Conduct - -## Our Pledge - -We as members, contributors, and leaders pledge to make participation in our -community a harassment-free experience for everyone, regardless of age, body -size, visible or invisible disability, ethnicity, sex characteristics, gender -identity and expression, level of experience, education, socio-economic status, -nationality, personal appearance, race, religion, or sexual identity -and orientation. - -We pledge to act and interact in ways that contribute to an open, welcoming, -diverse, inclusive, and healthy community. - -## Our Standards - -Examples of behavior that contributes to a positive environment for our -community include: - -* Demonstrating empathy and kindness toward other people -* Being respectful of differing opinions, viewpoints, and experiences -* Giving and gracefully accepting constructive feedback -* Accepting responsibility and apologizing to those affected by our mistakes, - and learning from the experience -* Focusing on what is best not just for us as individuals, but for the - overall community - -Examples of unacceptable behavior include: - -* The use of sexualized language or imagery, and sexual attention or - advances of any kind -* Trolling, insulting or derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or email - address, without their explicit permission -* Other conduct which could reasonably be considered inappropriate in a - professional setting - -## Enforcement Responsibilities - -Community leaders are responsible for clarifying and enforcing our standards of -acceptable behavior and will take appropriate and fair corrective action in -response to any behavior that they deem inappropriate, threatening, offensive, -or harmful. - -Community leaders have the right and responsibility to remove, edit, or reject -comments, commits, code, wiki edits, issues, and other contributions that are -not aligned to this Code of Conduct, and will communicate reasons for moderation -decisions when appropriate. - -## Scope - -This Code of Conduct applies within all community spaces, and also applies when -an individual is officially representing the community in public spaces. -Examples of representing our community include using an official e-mail address, -posting via an official social media account, or acting as an appointed -representative at an online or offline event. - -## Enforcement - -Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported to the community leaders responsible for enforcement. -All complaints will be reviewed and investigated promptly and fairly. - -All community leaders are obligated to respect the privacy and security of the -reporter of any incident. - -## Enforcement Guidelines - -Community leaders will follow these Community Impact Guidelines in determining -the consequences for any action they deem in violation of this Code of Conduct: - -### 1. Correction - -**Community Impact**: Use of inappropriate language or other behavior deemed -unprofessional or unwelcome in the community. - -**Consequence**: A private, written warning from community leaders, providing -clarity around the nature of the violation and an explanation of why the -behavior was inappropriate. A public apology may be requested. - -### 2. Warning - -**Community Impact**: A violation through a single incident or series -of actions. - -**Consequence**: A warning with consequences for continued behavior. No -interaction with the people involved, including unsolicited interaction with -those enforcing the Code of Conduct, for a specified period of time. This -includes avoiding interactions in community spaces as well as external channels -like social media. Violating these terms may lead to a temporary or -permanent ban. - -### 3. Temporary Ban - -**Community Impact**: A serious violation of community standards, including -sustained inappropriate behavior. - -**Consequence**: A temporary ban from any sort of interaction or public -communication with the community for a specified period of time. No public or -private interaction with the people involved, including unsolicited interaction -with those enforcing the Code of Conduct, is allowed during this period. -Violating these terms may lead to a permanent ban. - -### 4. Permanent Ban - -**Community Impact**: Demonstrating a pattern of violation of community -standards, including sustained inappropriate behavior, harassment of an -individual, or aggression toward or disparagement of classes of individuals. - -**Consequence**: A permanent ban from any sort of public interaction within -the community. - -## Attribution - -This Code of Conduct is adapted from the [Contributor Covenant][homepage], -version 2.0, available at -https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. - -Community Impact Guidelines were inspired by [Mozilla's code of conduct -enforcement ladder](https://github.com/mozilla/diversity). - -[homepage]: https://www.contributor-covenant.org - -For answers to common questions about this code of conduct, see the FAQ at -https://www.contributor-covenant.org/faq. Translations are available at -https://www.contributor-covenant.org/translations. diff --git a/.github/SECURITY.md b/.github/SECURITY.md deleted file mode 100644 index 63f5b072..00000000 --- a/.github/SECURITY.md +++ /dev/null @@ -1,7 +0,0 @@ -# Security Policy - -## Supported Versions - -## Reporting a Vulnerability - -If you find any potential vulnerability, join our [discord channel](https://discord.gg/9uXCAwqQZW) and contact Boshen. diff --git a/.github/actions/pnpm/action.yml b/.github/actions/pnpm/action.yml deleted file mode 100644 index ab4291c0..00000000 --- a/.github/actions/pnpm/action.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: Pnpm - -description: Install pnpm - -runs: - using: composite - steps: - - uses: pnpm/action-setup@v4 - - - uses: actions/setup-node@v4 - with: - node-version-file: .node-version - cache: pnpm - - - name: yarn - shell: bash - run: | - cd fixtures/pnp - corepack enable - yarn install - - - name: pnpm - shell: bash - run: | - corepack enable - pnpm install diff --git a/.github/codecov.yml b/.github/codecov.yml deleted file mode 100644 index 0610268a..00000000 --- a/.github/codecov.yml +++ /dev/null @@ -1,14 +0,0 @@ -coverage: - status: - project: - default: - informational: true - patch: - default: - informational: true - changes: - default: - informational: true - -ignore: - - "examples" diff --git a/.github/renovate.json b/.github/renovate.json deleted file mode 100644 index 2339df09..00000000 --- a/.github/renovate.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "$schema": "https://docs.renovatebot.com/renovate-schema.json", - "extends": ["github>Boshen/renovate"], - "ignorePaths": ["**/node_modules/**", "**/fixtures/**"] -} diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml deleted file mode 100644 index 7c25853b..00000000 --- a/.github/workflows/benchmark.yml +++ /dev/null @@ -1,41 +0,0 @@ -name: Benchmark - -on: - workflow_dispatch: - pull_request: - types: [opened, synchronize] - paths-ignore: - - '**/*.md' - push: - branches: - - main - paths-ignore: - - '**/*.md' - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} - cancel-in-progress: true - -jobs: - benchmark: - name: Benchmark - runs-on: ubuntu-latest - steps: - - name: Checkout Branch - uses: taiki-e/checkout-action@v1 - - - uses: Boshen/setup-rust@main - with: - cache-key: benchmark - save-cache: ${{ github.ref_name == 'main' }} - tools: cargo-codspeed - - uses: ./.github/actions/pnpm - - name: Build Benchmark - run: cargo codspeed build --features codspeed - - - name: Run benchmark - uses: CodSpeedHQ/action@v3 - timeout-minutes: 30 - with: - run: cargo codspeed run - token: ${{ secrets.CODSPEED_TOKEN }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index 3f629ffb..00000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,196 +0,0 @@ -name: CI - -on: - workflow_dispatch: - pull_request: - types: [opened, synchronize] - paths-ignore: - - '**/*.md' - - '!.github/workflows/ci.yml' - push: - branches: - - main - - "renovate/**" - paths-ignore: - - '**/*.md' - - '!.github/workflows/ci.yml' - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} - cancel-in-progress: ${{ github.ref_name != 'main' }} - -defaults: - run: - shell: bash - -jobs: - cache: # Warm cache factory for all other CI jobs - name: Check and Build - strategy: - fail-fast: true - matrix: - include: - - os: windows-latest - - os: ubuntu-latest - - os: macos-14 - runs-on: ${{ matrix.os }} - steps: - - uses: taiki-e/checkout-action@v1 - - - uses: Boshen/setup-rust@main - with: - save-cache: ${{ github.ref_name == 'main' }} - cache-key: warm - - - run: cargo check --all-features --locked - - # Only need to build the test to create a warm cache on the main branch - - name: Build cache by Cargo Check and Cargo Test - if: ${{ github.ref_name == 'main' }} - run: cargo test --all-features --no-run - - wasm: - name: Check Wasm - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - - uses: Boshen/setup-rust@main - with: - cache-key: wasm - save-cache: ${{ github.ref_name == 'main' }} - - - name: Check - run: | - rustup target add wasm32-unknown-unknown - cargo check --all-features --target wasm32-unknown-unknown - - wasi: - name: Test wasi target - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - - uses: Boshen/setup-rust@main - with: - cache-key: wasi - save-cache: ${{ github.ref_name == 'main' }} - - - uses: ./.github/actions/pnpm - - - name: Build - run: | - rustup target add wasm32-wasip1-threads - pnpm build --target wasm32-wasip1-threads - - - name: Test - run: pnpm test - env: - WASI_TEST: 1 - - typos: - name: Spell Check - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - - uses: crate-ci/typos@v1.24.5 - with: - files: . - - deny: - name: Cargo Deny - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - - uses: dorny/paths-filter@v3 - id: filter - with: - filters: | - src: - - 'Cargo.lock' - - - uses: Boshen/setup-rust@main - with: - restore-cache: false - tools: cargo-deny - - - if: steps.filter.outputs.src == 'true' - run: cargo deny check - - unused-deps: - name: Check Unused Dependencies - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - uses: dorny/paths-filter@v3 - id: filter - with: - filters: | - src: - - '**/*.rs' - - '**/Cargo.toml' - - 'Cargo.lock' - - uses: Boshen/setup-rust@main - with: - restore-cache: false - if: steps.filter.outputs.src == 'true' - - uses: cargo-bins/cargo-binstall@main - if: steps.filter.outputs.src == 'true' - - run: cargo binstall --no-confirm cargo-shear@1 - if: steps.filter.outputs.src == 'true' - - run: cargo shear - if: steps.filter.outputs.src == 'true' - - format: - name: Format - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - uses: Boshen/setup-rust@main - with: - components: rustfmt - restore-cache: false - - run: cargo fmt --all -- --check - - lint: - name: Clippy - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - uses: Boshen/setup-rust@main - with: - components: clippy - - run: cargo clippy --all-features -- -D warnings - - doc: - name: Doc - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - uses: Boshen/setup-rust@main - with: - components: rust-docs - - run: RUSTDOCFLAGS='-D warnings' cargo doc --no-deps --all-features - - test: - name: Test - strategy: - fail-fast: true - matrix: - include: - - os: windows-latest - - os: ubuntu-latest - - os: macos-14 - runs-on: ${{ matrix.os }} - env: - RUST_BACKTRACE: 1 - steps: - - uses: taiki-e/checkout-action@v1 - - uses: ./.github/actions/pnpm - - uses: Boshen/setup-rust@main - with: - cache-key: warm - - run: cargo test --doc - - run: cargo test --all-features diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml deleted file mode 100644 index 97302b03..00000000 --- a/.github/workflows/codecov.yml +++ /dev/null @@ -1,69 +0,0 @@ -name: Code Coverage # Run cargo-llvm-cov and upload to codecov.io - -on: - workflow_dispatch: - pull_request: - types: [opened, synchronize] - paths-ignore: - - '**/*.md' - push: - branches: - - main - paths-ignore: - - '**/*.md' - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: ${{ github.ref_name != 'main' }} - -jobs: - coverage: - name: Code Coverage - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: taiki-e/checkout-action@v1 - - - uses: ./.github/actions/pnpm - - - uses: Boshen/setup-rust@main - with: - cache-key: codecov - save-cache: ${{ github.ref_name == 'main' }} - tools: cargo-llvm-cov - components: llvm-tools-preview - - - run: cargo llvm-cov --lcov --output-path lcov.info - - - name: Upload Artifact - uses: actions/upload-artifact@v4 - with: - name: codecov - path: lcov.info - - # codecov often fails, use another workflow for retry - upload-codecov: - name: Upload coverage file - runs-on: ubuntu-latest - needs: coverage - # Check if the event is not triggered by a fork by checking whether CODECOV_TOKEN is set - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - steps: - - name: Checkout - if: env.CODECOV_TOKEN - uses: taiki-e/checkout-action@v1 - - - name: Download coverage file - if: env.CODECOV_TOKEN - uses: actions/download-artifact@v4 - with: - name: codecov - - - name: Upload to codecov.io - if: env.CODECOV_TOKEN - uses: codecov/codecov-action@v4 - with: - token: ${{ secrets.CODECOV_TOKEN }} - fail_ci_if_error: true - files: lcov.info diff --git a/.github/workflows/release-napi.yml b/.github/workflows/release-napi.yml deleted file mode 100644 index 1ea68db8..00000000 --- a/.github/workflows/release-napi.yml +++ /dev/null @@ -1,252 +0,0 @@ -name: Release NAPI - -on: - workflow_dispatch: - push: - branches: - - main - paths: - - npm/package.json # Please only commit this file, so we don't need to wait for test CI to pass. - -env: - DEBUG: 'napi:*' - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - check: - name: Check version - runs-on: ubuntu-latest - outputs: - version: ${{ env.version }} - version_changed: ${{ steps.version.outputs.changed }} - steps: - - uses: taiki-e/checkout-action@v1 - - - name: Check version changes - uses: EndBug/version-check@v2 - id: version - with: - static-checking: localIsNew - file-url: https://unpkg.com/oxc-resolver@latest/package.json - file-name: npm/package.json - - - name: Set version name - if: steps.version.outputs.changed == 'true' - run: | - echo "Version change found! New version: ${{ steps.version.outputs.version }} (${{ steps.version.outputs.version_type }})" - echo "version=${{ steps.version.outputs.version }}" >> $GITHUB_ENV - - build: - needs: check - if: needs.check.outputs.version_changed == 'true' - env: - version: ${{ needs.check.outputs.version }} - outputs: - version: ${{ env.version }} - strategy: - fail-fast: false - matrix: - include: - - os: windows-latest - target: x86_64-pc-windows-msvc - - - os: windows-latest - target: aarch64-pc-windows-msvc - - - os: ubuntu-latest - target: x86_64-unknown-linux-gnu - - - os: ubuntu-latest - target: x86_64-unknown-linux-musl - - - os: ubuntu-latest - target: aarch64-unknown-linux-gnu - - - os: ubuntu-latest - target: aarch64-unknown-linux-musl - - - os: ubuntu-latest - target: armv7-unknown-linux-gnueabihf - - - os: macos-latest - target: x86_64-apple-darwin - - - os: macos-latest - target: aarch64-apple-darwin - - - os: ubuntu-latest - target: wasm32-wasip1-threads - - name: Package ${{ matrix.target }} - runs-on: ${{ matrix.os }} - steps: - - uses: taiki-e/checkout-action@v1 - - - uses: ./.github/actions/pnpm - - - name: Add Rust Target - run: rustup target add ${{ matrix.target }} - - - uses: goto-bus-stop/setup-zig@v2 - if: ${{ contains(matrix.target, 'musl') }} - with: - version: 0.13.0 - - - name: Build with zig cross - if: ${{ contains(matrix.target, 'musl') }} - run: pnpm build -x --target ${{ matrix.target }} - - - name: Build with napi cross - if: ${{ contains(matrix.target, 'gnu') }} - run: pnpm build --use-napi-cross --target ${{ matrix.target }} - - - name: Build - if: ${{ !contains(matrix.target, 'gnu') && !contains(matrix.target, 'musl') }} - run: pnpm build --target ${{ matrix.target }} - - - name: Test - if: matrix.target == 'x86_64-pc-windows-msvc' || matrix.target == 'aarch64-apple-darwin' || matrix.target == 'wasm32-wasip1-threads' - run: pnpm test - - - name: Output docker params - if: ${{ contains(matrix.target, 'linux') }} - id: docker - run: | - node -e " - if ('${{ matrix.target }}'.startsWith('aarch64')) { - console.log('PLATFORM=linux/arm64') - } else if ('${{ matrix.target }}'.startsWith('armv7')) { - console.log('PLATFORM=linux/arm/v7') - } else { - console.log('PLATFORM=linux/amd64') - } - " >> $GITHUB_OUTPUT - node -e " - if ('${{ matrix.target }}'.endsWith('-musl')) { - console.log('IMAGE=node:lts-alpine') - } else { - console.log('IMAGE=node:lts-slim') - } - " >> $GITHUB_OUTPUT - echo "PNPM_STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_OUTPUT - - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - if: ${{ contains(matrix.target, 'linux') }} - with: - platforms: all - - - run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes - if: ${{ contains(matrix.target, 'linux') }} - - - name: Run linux test - uses: addnab/docker-run-action@v3 - if: ${{ contains(matrix.target, 'linux') }} - with: - image: ${{ steps.docker.outputs.IMAGE }} - options: -v ${{ steps.docker.outputs.PNPM_STORE_PATH }}:${{ steps.docker.outputs.PNPM_STORE_PATH }} -v ${{ github.workspace }}:/oxc_resolver -w /oxc_resolver --platform ${{ steps.docker.outputs.PLATFORM }} - run: | - corepack enable - pnpm test - - - name: Upload artifacts - uses: actions/upload-artifact@v4 - with: - name: bindings-${{ matrix.target }} - path: | - napi/*.node - napi/*.wasm - - build-freebsd: - needs: check - if: needs.check.outputs.version_changed == 'true' - name: Build FreeBSD - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Build - id: build - uses: cross-platform-actions/action@v0.25.0 - env: - DEBUG: napi:* - RUSTUP_IO_THREADS: 1 - with: - operating_system: freebsd - version: '14.0' - memory: 8G - cpu_count: 3 - environment_variables: 'DEBUG RUSTUP_IO_THREADS' - shell: bash - run: | - sudo pkg install -y -f curl node libnghttp2 npm - curl https://sh.rustup.rs -sSf --output rustup.sh - sh rustup.sh -y --profile minimal --default-toolchain stable - source "$HOME/.cargo/env" - echo "~~~~ rustc --version ~~~~" - rustc --version - echo "~~~~ node -v ~~~~" - node -v - pwd - ls -lah - whoami - env - sudo corepack enable - pnpm install - pnpm build --target x86_64-unknown-freebsd - rm -rf node_modules - rm -rf target - - name: Upload artifact - uses: actions/upload-artifact@v4 - with: - name: bindings-freebsd - path: napi/*.node - if-no-files-found: error - - publish: - name: Publish NAPI - runs-on: ubuntu-latest - permissions: - id-token: write # for `npm publish --provenance` - needs: - - build - - build-freebsd - steps: - - uses: taiki-e/checkout-action@v1 - - - name: corepack - run: corepack enable - - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version-file: .node-version - cache: pnpm - - - name: Install dependencies - run: pnpm install --frozen-lockfile - - - name: Download Artifacts - uses: actions/download-artifact@v4 - with: - path: artifacts - - - name: Prepare dirs and artifacts - run: | - pnpm napi create-npm-dirs --package-json-path npm/package.json - pnpm napi artifacts --package-json-path npm/package.json --build-output-dir napi - - - name: Publish npm packages as latest - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - shell: bash - run: | - cp napi/index.js npm/index.js - cp napi/index.d.ts npm/index.d.ts - cp napi/browser.js npm/browser.js - echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc - pnpm napi pre-publish --no-gh-release -t npm --package-json-path npm/package.json - npm publish npm/ --tag latest --provenance --access public diff --git a/.github/workflows/release-plz.yml b/.github/workflows/release-plz.yml deleted file mode 100644 index 121758ad..00000000 --- a/.github/workflows/release-plz.yml +++ /dev/null @@ -1,55 +0,0 @@ -name: Release Plz - -on: - workflow_dispatch: - push: - branches: - - main - -permissions: - pull-requests: write - contents: write - -jobs: - release-plz: - name: Release-plz - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - uses: Boshen/setup-rust@main - with: - save-cache: ${{ github.ref_name == 'main' }} - cache-key: warm - - - name: Run release-plz - id: release-plz - uses: MarcoIeni/release-plz-action@v0.5 - env: - GITHUB_TOKEN: ${{ secrets.RELEASE_PLZ_TOKEN }} - CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} - - - name: Bump package.json - if: ${{ steps.release-plz.outputs.prs_created }} - env: - GH_TOKEN: ${{ github.token }} - RELEASES: ${{ steps.release-plz.outputs.releases }} - PR: ${{ steps.release-plz.outputs.pr }} - run: | - set -e - - pr_number=${{ fromJSON(steps.release-plz.outputs.pr).number }} - if [[ -n "$pr_number" ]]; then - version=$(echo "$RELEASES" | jq -r '.[0].version') - echo "version: $version" - - jq --arg version "${version}" '.version = ($version)' npm/package.json > tmp - mv tmp npm/package.json - - gh pr checkout $pr_number - git add . - git commit -m "Update package.json" - git push - fi diff --git a/Cargo.lock b/Cargo.lock deleted file mode 100644 index 58c1e7ad..00000000 --- a/Cargo.lock +++ /dev/null @@ -1,1326 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "adler" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" - -[[package]] -name = "aho-corasick" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" -dependencies = [ - "memchr", -] - -[[package]] -name = "android-tzdata" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" - -[[package]] -name = "android_system_properties" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" -dependencies = [ - "libc", -] - -[[package]] -name = "anes" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "735d4f398ca57cfa2880225c2bf81c3b9af3be5bb22e44ae70118dad38713e84" - -[[package]] -name = "arca" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f915ddd863ef73f11c10c75170e86db1d4f539689bc6bfb9ce25d6528d6fe83" -dependencies = [ - "clean-path", - "path-slash", - "radix_trie", -] - -[[package]] -name = "autocfg" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" - -[[package]] -name = "base64" -version = "0.22.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" - -[[package]] -name = "bit-set" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1" -dependencies = [ - "bit-vec", -] - -[[package]] -name = "bit-vec" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "bitflags" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" - -[[package]] -name = "bpaf" -version = "0.9.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3280efcf6d66bc77c2cf9b67dc8acee47a217d9be67dd590b3230dffe663724d" - -[[package]] -name = "bumpalo" -version = "3.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" - -[[package]] -name = "byteorder" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" - -[[package]] -name = "cast" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" - -[[package]] -name = "cc" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eaff6f8ce506b9773fa786672d63fc7a191ffea1be33f72bbd4aeacefca9ffc8" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "chrono" -version = "0.4.38" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" -dependencies = [ - "android-tzdata", - "iana-time-zone", - "num-traits", - "serde", - "windows-targets 0.52.6", -] - -[[package]] -name = "ciborium" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42e69ffd6f0917f5c029256a24d0161db17cea3997d185db0d35926308770f0e" -dependencies = [ - "ciborium-io", - "ciborium-ll", - "serde", -] - -[[package]] -name = "ciborium-io" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05afea1e0a06c9be33d539b876f1ce3692f4afea2cb41f740e7743225ed1c757" - -[[package]] -name = "ciborium-ll" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57663b653d948a338bfb3eeba9bb2fd5fcfaecb9e199e87e1eda4d9e8b240fd9" -dependencies = [ - "ciborium-io", - "half", -] - -[[package]] -name = "clean-path" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aaa6b4b263a5d737e9bf6b7c09b72c41a5480aec4d7219af827f6564e950b6a5" - -[[package]] -name = "codspeed" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a104ac948e0188b921eb3fcbdd55dcf62e542df4c7ab7e660623f6288302089" -dependencies = [ - "colored", - "libc", - "serde_json", -] - -[[package]] -name = "colored" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbf2150cce219b664a8a70df7a1f933836724b503f8a413af9365b4dcc4d90b8" -dependencies = [ - "lazy_static", - "windows-sys 0.48.0", -] - -[[package]] -name = "concurrent_lru" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7feb5cb312f774e8a24540e27206db4e890f7d488563671d24a16389cf4c2e4e" -dependencies = [ - "once_cell", -] - -[[package]] -name = "convert_case" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec182b0ca2f35d8fc196cf3404988fd8b8c739a4d270ff118a398feb0cbec1ca" -dependencies = [ - "unicode-segmentation", -] - -[[package]] -name = "core-foundation-sys" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" - -[[package]] -name = "criterion2" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8df39381f28ced0ceebfb5611528d99aef14f8d75b43e9d4ceb6aba66e7b04d" -dependencies = [ - "anes", - "bpaf", - "cast", - "ciborium", - "codspeed", - "colored", - "num-traits", - "oorandom", - "serde", - "serde_json", - "walkdir", -] - -[[package]] -name = "crossbeam-deque" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" -dependencies = [ - "crossbeam-epoch", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.9.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" -dependencies = [ - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" - -[[package]] -name = "crunchy" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" - -[[package]] -name = "ctor" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edb49164822f3ee45b17acd4a208cfc1251410cf0cad9a833234c9890774dd9f" -dependencies = [ - "quote", - "syn", -] - -[[package]] -name = "darling" -version = "0.20.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" -dependencies = [ - "darling_core", - "darling_macro", -] - -[[package]] -name = "darling_core" -version = "0.20.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95133861a8032aaea082871032f5815eb9e98cef03fa916ab4500513994df9e5" -dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "strsim", - "syn", -] - -[[package]] -name = "darling_macro" -version = "0.20.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" -dependencies = [ - "darling_core", - "quote", - "syn", -] - -[[package]] -name = "dashmap" -version = "6.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "804c8821570c3f8b70230c2ba75ffa5c0f9a4189b9a432b6656c536712acae28" -dependencies = [ - "cfg-if", - "crossbeam-utils", - "hashbrown 0.14.5", - "lock_api", - "once_cell", - "parking_lot_core", -] - -[[package]] -name = "deranged" -version = "0.3.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" -dependencies = [ - "powerfmt", - "serde", -] - -[[package]] -name = "document-features" -version = "0.2.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb6969eaabd2421f8a2775cfd2471a2b634372b4a25d41e3bd647b79912850a0" -dependencies = [ - "litrs", -] - -[[package]] -name = "dunce" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" - -[[package]] -name = "either" -version = "1.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" - -[[package]] -name = "endian-type" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" - -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "fancy-regex" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "531e46835a22af56d1e3b66f04844bed63158bc094a628bec1d321d9b4c44bf2" -dependencies = [ - "bit-set", - "regex-automata", - "regex-syntax", -] - -[[package]] -name = "filetime" -version = "0.2.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ee447700ac8aa0b2f2bd7bc4462ad686ba06baa6727ac149a2d6277f0d240fd" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall 0.4.1", - "windows-sys 0.52.0", -] - -[[package]] -name = "fnv" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" - -[[package]] -name = "half" -version = "2.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dd08c532ae367adf81c312a4580bc67f1d0fe8bc9c460520283f4c0ff277888" -dependencies = [ - "cfg-if", - "crunchy", -] - -[[package]] -name = "hashbrown" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" - -[[package]] -name = "hashbrown" -version = "0.14.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "iana-time-zone" -version = "0.1.60" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" -dependencies = [ - "android_system_properties", - "core-foundation-sys", - "iana-time-zone-haiku", - "js-sys", - "wasm-bindgen", - "windows-core", -] - -[[package]] -name = "iana-time-zone-haiku" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" -dependencies = [ - "cc", -] - -[[package]] -name = "ident_case" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" - -[[package]] -name = "indexmap" -version = "1.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" -dependencies = [ - "autocfg", - "hashbrown 0.12.3", - "serde", -] - -[[package]] -name = "indexmap" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93ead53efc7ea8ed3cfb0c79fc8023fbb782a5432b52830b6518941cebe6505c" -dependencies = [ - "equivalent", - "hashbrown 0.14.5", - "serde", -] - -[[package]] -name = "itoa" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" - -[[package]] -name = "js-sys" -version = "0.3.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" -dependencies = [ - "wasm-bindgen", -] - -[[package]] -name = "json-strip-comments" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b271732a960335e715b6b2ae66a086f115c74eb97360e996d2bd809bfc063bba" -dependencies = [ - "memchr", -] - -[[package]] -name = "lazy_static" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" - -[[package]] -name = "libc" -version = "0.2.155" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" - -[[package]] -name = "libloading" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e310b3a6b5907f99202fcdb4960ff45b93735d7c7d96b760fcff8db2dc0e103d" -dependencies = [ - "cfg-if", - "windows-targets 0.52.6", -] - -[[package]] -name = "litrs" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4ce301924b7887e9d637144fdade93f9dfff9b60981d4ac161db09720d39aa5" - -[[package]] -name = "lock_api" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" -dependencies = [ - "autocfg", - "scopeguard", -] - -[[package]] -name = "log" -version = "0.4.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" - -[[package]] -name = "memchr" -version = "2.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" - -[[package]] -name = "miniz_oxide" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" -dependencies = [ - "adler", -] - -[[package]] -name = "napi" -version = "3.0.0-alpha.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ec04344cc540f5897e97c9821ab99e7eb276b4dca6f3e6e441dfa72e5bcde70" -dependencies = [ - "bitflags 2.6.0", - "ctor", - "napi-build", - "napi-sys", - "once_cell", - "serde", - "serde_json", -] - -[[package]] -name = "napi-build" -version = "2.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1c0f5d67ee408a4685b61f5ab7e58605c8ae3f2b4189f0127d804ff13d5560a" - -[[package]] -name = "napi-derive" -version = "3.0.0-alpha.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c6240c4ddca592cde608bbfa26e2af397c3596e413a0c65c9bbcb65c2f1e485" -dependencies = [ - "cfg-if", - "convert_case", - "napi-derive-backend", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "napi-derive-backend" -version = "2.0.0-alpha.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b32dcc50065508fe2f387076c17adbdf10e038d1c080d48b10196813d94ac6a8" -dependencies = [ - "convert_case", - "once_cell", - "proc-macro2", - "quote", - "regex", - "semver", - "syn", -] - -[[package]] -name = "napi-sys" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "427802e8ec3a734331fec1035594a210ce1ff4dc5bc1950530920ab717964ea3" -dependencies = [ - "libloading", -] - -[[package]] -name = "nibble_vec" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" -dependencies = [ - "smallvec", -] - -[[package]] -name = "normalize-path" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5438dd2b2ff4c6df6e1ce22d825ed2fa93ee2922235cc45186991717f0a892d" - -[[package]] -name = "num-conv" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" - -[[package]] -name = "num-traits" -version = "0.2.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" -dependencies = [ - "autocfg", -] - -[[package]] -name = "once_cell" -version = "1.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" - -[[package]] -name = "oorandom" -version = "11.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b410bbe7e14ab526a0e86877eb47c6996a2bd7746f027ba551028c925390e4e9" - -[[package]] -name = "oxc_napi_resolver" -version = "0.0.0" -dependencies = [ - "napi", - "napi-build", - "napi-derive", - "oxc_resolver", - "tracing-subscriber", -] - -[[package]] -name = "oxc_resolver" -version = "1.11.0" -dependencies = [ - "cfg-if", - "criterion2", - "dashmap", - "document-features", - "dunce", - "indexmap 2.4.0", - "json-strip-comments", - "normalize-path", - "once_cell", - "pnp", - "rayon", - "rustc-hash", - "serde", - "serde_json", - "simdutf8", - "thiserror", - "tracing", - "vfs", -] - -[[package]] -name = "parking_lot_core" -version = "0.9.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall 0.5.2", - "smallvec", - "windows-targets 0.52.6", -] - -[[package]] -name = "path-slash" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e91099d4268b0e11973f036e885d652fb0b21fedcf69738c627f94db6a44f42" - -[[package]] -name = "pathdiff" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8835116a5c179084a830efb3adc117ab007512b535bc1a21c991d3b32a6b44dd" - -[[package]] -name = "pin-project-lite" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" - -[[package]] -name = "pnp" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46770cee76a618023fea15411d0449dd066dc232cc17e4562f154da215f27af7" -dependencies = [ - "arca", - "byteorder", - "concurrent_lru", - "fancy-regex", - "lazy_static", - "miniz_oxide", - "pathdiff", - "regex", - "serde", - "serde_json", - "serde_with", - "thiserror", -] - -[[package]] -name = "powerfmt" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" - -[[package]] -name = "proc-macro2" -version = "1.0.86" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.36" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "radix_trie" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" -dependencies = [ - "endian-type", - "nibble_vec", -] - -[[package]] -name = "rayon" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" -dependencies = [ - "either", - "rayon-core", -] - -[[package]] -name = "rayon-core" -version = "1.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" -dependencies = [ - "crossbeam-deque", - "crossbeam-utils", -] - -[[package]] -name = "redox_syscall" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" -dependencies = [ - "bitflags 1.3.2", -] - -[[package]] -name = "redox_syscall" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c82cf8cff14456045f55ec4241383baeff27af886adb72ffb2162f99911de0fd" -dependencies = [ - "bitflags 2.6.0", -] - -[[package]] -name = "regex" -version = "1.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b91213439dad192326a0d7c6ee3955910425f441d7038e0d6933b0aec5c4517f" -dependencies = [ - "aho-corasick", - "memchr", - "regex-automata", - "regex-syntax", -] - -[[package]] -name = "regex-automata" -version = "0.4.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", -] - -[[package]] -name = "regex-syntax" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" - -[[package]] -name = "rustc-hash" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" - -[[package]] -name = "ryu" -version = "1.0.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" - -[[package]] -name = "same-file" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "scopeguard" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" - -[[package]] -name = "semver" -version = "1.0.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" - -[[package]] -name = "serde" -version = "1.0.209" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99fce0ffe7310761ca6bf9faf5115afbc19688edd00171d81b1bb1b116c63e09" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.209" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5831b979fd7b5439637af1752d535ff49f4860c0f341d1baeb6faf0f4242170" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "serde_json" -version = "1.0.127" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8043c06d9f82bd7271361ed64f415fe5e12a77fdb52e573e7f06a516dea329ad" -dependencies = [ - "indexmap 2.4.0", - "itoa", - "memchr", - "ryu", - "serde", -] - -[[package]] -name = "serde_with" -version = "3.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e73139bc5ec2d45e6c5fd85be5a46949c1c39a4c18e56915f5eb4c12f975e377" -dependencies = [ - "base64", - "chrono", - "hex", - "indexmap 1.9.3", - "indexmap 2.4.0", - "serde", - "serde_derive", - "serde_json", - "serde_with_macros", - "time", -] - -[[package]] -name = "serde_with_macros" -version = "3.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b80d3d6b56b64335c0180e5ffde23b3c5e08c14c585b51a15bd0e95393f46703" -dependencies = [ - "darling", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "sharded-slab" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" -dependencies = [ - "lazy_static", -] - -[[package]] -name = "simdutf8" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f27f6278552951f1f2b8cf9da965d10969b2efdea95a6ec47987ab46edfe263a" - -[[package]] -name = "smallvec" -version = "1.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" - -[[package]] -name = "strsim" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" - -[[package]] -name = "syn" -version = "2.0.70" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f0209b68b3613b093e0ec905354eccaedcfe83b8cb37cbdeae64026c3064c16" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "thiserror" -version = "1.0.63" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.63" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "thread_local" -version = "1.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" -dependencies = [ - "cfg-if", - "once_cell", -] - -[[package]] -name = "time" -version = "0.3.36" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" -dependencies = [ - "deranged", - "itoa", - "num-conv", - "powerfmt", - "serde", - "time-core", - "time-macros", -] - -[[package]] -name = "time-core" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" - -[[package]] -name = "time-macros" -version = "0.2.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" -dependencies = [ - "num-conv", - "time-core", -] - -[[package]] -name = "tracing" -version = "0.1.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" -dependencies = [ - "pin-project-lite", - "tracing-attributes", - "tracing-core", -] - -[[package]] -name = "tracing-attributes" -version = "0.1.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "tracing-core" -version = "0.1.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" -dependencies = [ - "once_cell", -] - -[[package]] -name = "tracing-subscriber" -version = "0.3.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" -dependencies = [ - "sharded-slab", - "thread_local", - "tracing-core", -] - -[[package]] -name = "unicode-ident" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" - -[[package]] -name = "unicode-segmentation" -version = "1.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" - -[[package]] -name = "vfs" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "654cd097e182a71dbf899178e6b5662c2157dd0b8afd5975de18008f6fc173d1" -dependencies = [ - "filetime", -] - -[[package]] -name = "walkdir" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" -dependencies = [ - "same-file", - "winapi-util", -] - -[[package]] -name = "wasm-bindgen" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" -dependencies = [ - "cfg-if", - "wasm-bindgen-macro", -] - -[[package]] -name = "wasm-bindgen-backend" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" -dependencies = [ - "bumpalo", - "log", - "once_cell", - "proc-macro2", - "quote", - "syn", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-macro" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" -dependencies = [ - "quote", - "wasm-bindgen-macro-support", -] - -[[package]] -name = "wasm-bindgen-macro-support" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" -dependencies = [ - "proc-macro2", - "quote", - "syn", - "wasm-bindgen-backend", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-shared" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" - -[[package]] -name = "winapi-util" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b" -dependencies = [ - "windows-sys 0.52.0", -] - -[[package]] -name = "windows-core" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" -dependencies = [ - "windows-targets 0.52.6", -] - -[[package]] -name = "windows-sys" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" -dependencies = [ - "windows-targets 0.48.5", -] - -[[package]] -name = "windows-sys" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" -dependencies = [ - "windows-targets 0.52.6", -] - -[[package]] -name = "windows-targets" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" -dependencies = [ - "windows_aarch64_gnullvm 0.48.5", - "windows_aarch64_msvc 0.48.5", - "windows_i686_gnu 0.48.5", - "windows_i686_msvc 0.48.5", - "windows_x86_64_gnu 0.48.5", - "windows_x86_64_gnullvm 0.48.5", - "windows_x86_64_msvc 0.48.5", -] - -[[package]] -name = "windows-targets" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" -dependencies = [ - "windows_aarch64_gnullvm 0.52.6", - "windows_aarch64_msvc 0.52.6", - "windows_i686_gnu 0.52.6", - "windows_i686_gnullvm", - "windows_i686_msvc 0.52.6", - "windows_x86_64_gnu 0.52.6", - "windows_x86_64_gnullvm 0.52.6", - "windows_x86_64_msvc 0.52.6", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" - -[[package]] -name = "windows_i686_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" - -[[package]] -name = "windows_i686_gnu" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" - -[[package]] -name = "windows_i686_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" - -[[package]] -name = "windows_i686_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" - -[[package]] -name = "windows_i686_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" diff --git a/fixtures/enhanced_resolve/lib/index.js b/fixtures/enhanced_resolve/lib/index.js deleted file mode 100644 index 1e872e8f..00000000 --- a/fixtures/enhanced_resolve/lib/index.js +++ /dev/null @@ -1 +0,0 @@ -// mimic enhanced-resolved root directory structure diff --git a/fixtures/enhanced_resolve/package.json b/fixtures/enhanced_resolve/package.json deleted file mode 100644 index d1b845b5..00000000 --- a/fixtures/enhanced_resolve/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "enhanced-resolve", - "main": "lib/index.js" -} diff --git a/fixtures/enhanced_resolve/test/.gitignore b/fixtures/enhanced_resolve/test/.gitignore deleted file mode 100644 index b021b4e4..00000000 --- a/fixtures/enhanced_resolve/test/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -# created by symlink.rs -/temp -/temp_symlinks \ No newline at end of file diff --git a/fixtures/enhanced_resolve/test/fixtures/#/a.js b/fixtures/enhanced_resolve/test/fixtures/#/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/a.js b/fixtures/enhanced_resolve/test/fixtures/a.js deleted file mode 100644 index 896ffc6d..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/abc.txt b/fixtures/enhanced_resolve/test/fixtures/abc.txt deleted file mode 100644 index f2ba8f84..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/abc.txt +++ /dev/null @@ -1 +0,0 @@ -abc \ No newline at end of file diff --git a/fixtures/enhanced_resolve/test/fixtures/alias/files/a.js b/fixtures/enhanced_resolve/test/fixtures/alias/files/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/b.js b/fixtures/enhanced_resolve/test/fixtures/b.js deleted file mode 100644 index 11476340..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/b.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function b() { - return "This is b"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/browser/module-a.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/browser/module-a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/browser.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/ignore.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/ignore.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/replaced.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/replaced.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/self.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/self.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/toString.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/toString.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-a.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-b.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-c.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-c.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/a.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/b.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/c.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/c.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/d.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/d.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json deleted file mode 100644 index c13fe23b..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "browser": { - "a.js": "./a", - "./b.js": "./b", - "c.js": "./d.js", - "./d.js": "./c.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/package.json b/fixtures/enhanced_resolve/test/fixtures/browser-module/package.json deleted file mode 100644 index 19ff7739..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/browser-module/package.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "exports": { - "./lib/index.js": "./lib/index.js" - }, - "browser": { - "./lib/ignore.js": false, - "./lib/replaced.js": "./lib/browser", - "module-a": "./browser/module-a.js", - "module-b": "module-c", - "module-c": "module-c", - "./toString": "./lib/toString.js", - "./lib/main.js": "./lib/main.js", - "./main.js": "./lib/main.js", - "./lib/xyz.js": "./xyz.js", - "./xyz.js": "./lib/xyz.js", - "./lib/non-existent.js": "./lib/non-existent.js", - ".": false, - "./number": 1, - "./foo": "./lib/replaced.js?query" - }, - "innerBrowser1": { - "field": { - "browser": { - "./lib/main1.js": "./lib/main.js" - } - } - }, - "innerBrowser2": { - "browser": { - "./lib/main2.js": "./lib/replaced.js" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/builtins/package.json b/fixtures/enhanced_resolve/test/fixtures/builtins/package.json deleted file mode 100644 index 4a54ea96..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/builtins/package.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "name": "builtins", - "private": true, - "imports": { - "#fs": { - "default": "fs" - }, - "#http": { - "node": "node:http" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/c.js b/fixtures/enhanced_resolve/test/fixtures/c.js deleted file mode 100644 index e3aca8aa..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/c.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = function b() { - require("./a"); - return "This is c"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/complex.js b/fixtures/enhanced_resolve/test/fixtures/complex.js deleted file mode 100644 index 1f62db84..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/complex.js +++ /dev/null @@ -1,13 +0,0 @@ -var 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); diff --git a/fixtures/enhanced_resolve/test/fixtures/crypto-js/index.js b/fixtures/enhanced_resolve/test/fixtures/crypto-js/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json b/fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json deleted file mode 100644 index 1d31aa8b..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "crypto-js", - "main": "index.js", - "browser": { - "crypto": false - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/decorated-fs/exists.js b/fixtures/enhanced_resolve/test/fixtures/decorated-fs/exists.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/dirOrFile.js b/fixtures/enhanced_resolve/test/fixtures/dirOrFile.js deleted file mode 100644 index c3cb885f..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/dirOrFile.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "file"; diff --git a/fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js b/fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js deleted file mode 100644 index 85e01cd4..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "dir"; diff --git a/fixtures/enhanced_resolve/test/fixtures/directory-default/directory-default.js b/fixtures/enhanced_resolve/test/fixtures/directory-default/directory-default.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js deleted file mode 100644 index d1007aae..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js +++ /dev/null @@ -1 +0,0 @@ -export default "string"; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts deleted file mode 100644 index cb0ff5c3..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json deleted file mode 100644 index b523a1e9..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "@org/pkg", - "exports": { - "./*.js": { - "types": "./dist/*.d.ts", - "default": "./dist/*.js" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js deleted file mode 100644 index d1007aae..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js +++ /dev/null @@ -1 +0,0 @@ -export default "string"; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts deleted file mode 100644 index cb0ff5c3..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json deleted file mode 100644 index 8e55fb46..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "@raviqqe/hidash", - "exports": { - "./*.js": { - "types": "./dist/*.d.ts", - "default": "./dist/*.js" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json deleted file mode 100644 index f0edf449..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "exports-field", - "version": "1.0.0", - "exports": { - ".": "./a/../b/../../pack1/index.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/pack1/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/pack1/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/a.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/a.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json deleted file mode 100644 index 6b105c08..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "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/": { - "webpack": ["./lib/lib2/", "./lib/"], - "node": "./lib/", - "default": "./lib/" - }, - "./dist/a.js": "./../../a.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json deleted file mode 100644 index 0012a3de..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "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" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/umd.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/umd.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field/package.json deleted file mode 100644 index 5fa72bb5..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "@exports-field/core", - "version": "1.0.0", - "exports": "./a.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json deleted file mode 100644 index e6f12074..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "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/lib2/", "./lib/"], - "node": "./lib/", - "default": "./lib/" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/index b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/index deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json deleted file mode 100644 index 1a838f49..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "name": "exports-field", - "exportsField": { - "exports": "./main.js" - }, - "ex": "./index", - "broken": { - ".": "./src" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/src/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/src/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.ts b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.mts b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.mts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mjs b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mjs deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mts.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mts.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.ts b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/app.module.js b/fixtures/enhanced_resolve/test/fixtures/extensions/app.module.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.js b/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/foo.js b/fixtures/enhanced_resolve/test/fixtures/extensions/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/foo.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/foo.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/index.js b/fixtures/enhanced_resolve/test/fixtures/extensions/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/index.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module.js b/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module/index.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/package.json b/fixtures/enhanced_resolve/test/fixtures/extensions/package.json deleted file mode 100644 index 5e55a1e8..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/extensions/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "./index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/file.load1 b/fixtures/enhanced_resolve/test/fixtures/file.load1 deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/file.load2 b/fixtures/enhanced_resolve/test/fixtures/file.load2 deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/foo/index.js b/fixtures/enhanced_resolve/test/fixtures/foo/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/foo/package.json b/fixtures/enhanced_resolve/test/fixtures/foo/package.json deleted file mode 100644 index da86787a..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/foo/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "foo", - "version": "1.0.0" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json deleted file mode 100644 index aa2be496..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "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" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/internal/file.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/internal/file.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/y/y.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/y/y.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/internal/i.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/internal/i.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/nested/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js deleted file mode 100644 index e5b70a86..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = { nested: "nested" } diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-3/nested/f/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-3/nested/f/nested/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-4/f/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-4/f/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f$/$.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f$/$.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f/$.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f/$.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/nested/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/a.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/a.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/b.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/dir/b.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/dir/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/index.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json deleted file mode 100644 index 8d8d3a46..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "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/lib2/", "./lib/"], - "node": "./lib/", - "default": "./lib/" - }, - "./dist/a.js": "./../../a.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/c/index.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/c/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/imports-field/package.json deleted file mode 100644 index 248351a9..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "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" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/a.js b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json deleted file mode 100644 index ded7faa2..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json +++ /dev/null @@ -1,2 +0,0 @@ -{ - "main": "./a.js", diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/a.js b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/package.json b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/package.json deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/issue-238/package.json b/fixtures/enhanced_resolve/test/fixtures/issue-238/package.json deleted file mode 100644 index 352055cd..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/issue-238/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "private": true -} diff --git a/fixtures/enhanced_resolve/test/fixtures/issue-238/src/a/config.js b/fixtures/enhanced_resolve/test/fixtures/issue-238/src/a/config.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/issue-238/src/common/config/myObjectFile.js b/fixtures/enhanced_resolve/test/fixtures/issue-238/src/common/config/myObjectFile.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/lib.js b/fixtures/enhanced_resolve/test/fixtures/lib.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/lib/complex1.js b/fixtures/enhanced_resolve/test/fixtures/lib/complex1.js deleted file mode 100644 index b3de3d70..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/lib/complex1.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "lib complex1"; diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self/index.js b/fixtures/enhanced_resolve/test/fixtures/main-field-self/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json b/fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json deleted file mode 100644 index a2b6f341..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "./" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self2/index.js b/fixtures/enhanced_resolve/test/fixtures/main-field-self2/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json b/fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json deleted file mode 100644 index 4fa6f730..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "." -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main1.js b/fixtures/enhanced_resolve/test/fixtures/main1.js deleted file mode 100644 index 168f2a1e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main1.js +++ /dev/null @@ -1,9 +0,0 @@ -var a = require("./a"); -if (x) { - for (var i = 0; i < 100; i++) { - while (true) require("./b"); - do { - i++; - } while (require("m1/a")()); - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main2.js b/fixtures/enhanced_resolve/test/fixtures/main2.js deleted file mode 100644 index 39f062b1..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main2.js +++ /dev/null @@ -1,12 +0,0 @@ -var 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"); - }); - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main3.js b/fixtures/enhanced_resolve/test/fixtures/main3.js deleted file mode 100644 index 1c180166..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main3.js +++ /dev/null @@ -1,4 +0,0 @@ -var a = require("./a"); -require.ensure([], function(require) { - require("./c.js"); -}); diff --git a/fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js b/fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js deleted file mode 100644 index 997c1051..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is nested m1/a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/no#fragment/#/#.js b/fixtures/enhanced_resolve/test/fixtures/no#fragment/#/#.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/no.js b/fixtures/enhanced_resolve/test/fixtures/no.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/browser.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/browser.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/main.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json deleted file mode 100644 index c469e1fd..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "main": "./main.js", - "browser": "./browser.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js deleted file mode 100644 index 549620a5..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "the correct a.js"; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js deleted file mode 100644 index 5db6632e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = " :) " + require("m2/b.js"); diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js deleted file mode 100644 index d308569d..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require("m1/a") + require("m1"); diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js deleted file mode 100644 index cb8127e8..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "Step2"; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json deleted file mode 100644 index 8d6dfa56..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "dash-name", - "exports": "./index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json deleted file mode 100644 index 4fd8706e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "dash", - "exports": "./index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/invalidPackageJson/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/invalidPackageJson/package.json deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js deleted file mode 100644 index 46fc8e6c..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is m1/a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js deleted file mode 100644 index 8565c244..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is m1/b"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js deleted file mode 100644 index 34faaaf5..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "This is m2/b"; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/file.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/file.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js b/fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js deleted file mode 100644 index 997c1051..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is nested m1/a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/dir/index.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/dir/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/index.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/main.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/browser.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/browser.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/index.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json deleted file mode 100644 index e20ceaeb..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "main": "main.js", - "browser": { - "./package-alias/index.js": "./package-alias/browser.js", - "module": "pkg/dir/index" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/typescript/index.ts b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/typescript/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json deleted file mode 100644 index 4a1f838e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "@exports-field/core", - "version": "1.0.0", - "exports": { - ".": "./a.js", - "./x": "./a.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/prefer-pnp/alternative-modules/m1/b.js b/fixtures/enhanced_resolve/test/fixtures/prefer-pnp/alternative-modules/m1/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.css b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.css deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.js b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json deleted file mode 100644 index 14ab704d..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/index.css b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/index.css deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/module.js b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/module.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json deleted file mode 100644 index ee0eb71b..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "main": "../../../c.js", - "module": "module.js", - "style": "index.css" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/roots_fall_through/index.js b/fixtures/enhanced_resolve/test/fixtures/roots_fall_through/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/main.js b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json deleted file mode 100644 index 70a0f20f..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "browser": { - "./index.js": "./main.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/lib/index.js b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/lib/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/main.js b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json deleted file mode 100644 index 2af9e0d1..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "./main.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/shortcutdir.js/a.js b/fixtures/enhanced_resolve/test/fixtures/shortcutdir.js/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/b b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/b deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/c b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/c deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/a b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/a deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/b b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/b deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/b/foo/a b/fixtures/enhanced_resolve/test/fixtures/yield/b/foo/a deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/a b/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/a deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json b/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json deleted file mode 100644 index 0acc4b4c..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "foo", - "version": "1.0.0", - "browser": { - "./a": false - } -} diff --git "a/fixtures/enhanced_resolve/test/fixtures/\346\265\213\350\257\225.js" "b/fixtures/enhanced_resolve/test/fixtures/\346\265\213\350\257\225.js" deleted file mode 100644 index e69de29b..00000000 diff --git "a/fixtures/misc/\344\270\255\346\226\207/\344\270\255\346\226\207.js" "b/fixtures/misc/\344\270\255\346\226\207/\344\270\255\346\226\207.js" deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/pnp/.gitignore b/fixtures/pnp/.gitignore deleted file mode 100644 index 1783c71a..00000000 --- a/fixtures/pnp/.gitignore +++ /dev/null @@ -1 +0,0 @@ -install_state.gz \ No newline at end of file diff --git a/fixtures/pnp/.pnp.cjs b/fixtures/pnp/.pnp.cjs deleted file mode 100755 index 2a8d1771..00000000 --- a/fixtures/pnp/.pnp.cjs +++ /dev/null @@ -1,7543 +0,0 @@ -#!/usr/bin/env node -/* eslint-disable */ -// @ts-nocheck -"use strict"; - -const RAW_RUNTIME_STATE = -'{\ - "__info": [\ - "This file is automatically generated. Do not touch it, or risk",\ - "your modifications being lost."\ - ],\ - "dependencyTreeRoots": [\ - {\ - "name": "pnp",\ - "reference": "workspace:."\ - }\ - ],\ - "enableTopLevelFallback": true,\ - "ignorePatternData": "(^(?:\\\\.yarn\\\\/sdks(?:\\\\/(?!\\\\.{1,2}(?:\\\\/|$))(?:(?:(?!(?:^|\\\\/)\\\\.{1,2}(?:\\\\/|$)).)*?)|$))$)",\ - "fallbackExclusionList": [\ - ["pnp", ["workspace:."]]\ - ],\ - "fallbackPool": [\ - ],\ - "packageRegistryData": [\ - [null, [\ - [null, {\ - "packageLocation": "./",\ - "packageDependencies": [\ - ["is-even", "npm:1.0.0"],\ - ["is-odd", "npm:3.0.1"]\ - ],\ - "linkType": "SOFT"\ - }]\ - ]],\ - ["is-buffer", [\ - ["npm:1.1.6", {\ - "packageLocation": "./.yarn/cache/is-buffer-npm-1.1.6-08199d9ccc-ae18aa0b6e.zip/node_modules/is-buffer/",\ - "packageDependencies": [\ - ["is-buffer", "npm:1.1.6"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["is-even", [\ - ["npm:1.0.0", {\ - "packageLocation": "./.yarn/cache/is-even-npm-1.0.0-9f726520dc-2728cc2f39.zip/node_modules/is-even/",\ - "packageDependencies": [\ - ["is-even", "npm:1.0.0"],\ - ["is-odd", "npm:0.1.2"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["is-number", [\ - ["npm:3.0.0", {\ - "packageLocation": "./.yarn/cache/is-number-npm-3.0.0-9088035ade-e639c54640.zip/node_modules/is-number/",\ - "packageDependencies": [\ - ["is-number", "npm:3.0.0"],\ - ["kind-of", "npm:3.2.2"]\ - ],\ - "linkType": "HARD"\ - }],\ - ["npm:6.0.0", {\ - "packageLocation": "./.yarn/cache/is-number-npm-6.0.0-30881e83e6-5da4c68401.zip/node_modules/is-number/",\ - "packageDependencies": [\ - ["is-number", "npm:6.0.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["is-odd", [\ - ["npm:0.1.2", {\ - "packageLocation": "./.yarn/cache/is-odd-npm-0.1.2-9d980a9da8-7dc6c6fd00.zip/node_modules/is-odd/",\ - "packageDependencies": [\ - ["is-odd", "npm:0.1.2"],\ - ["is-number", "npm:3.0.0"]\ - ],\ - "linkType": "HARD"\ - }],\ - ["npm:3.0.1", {\ - "packageLocation": "./.yarn/cache/is-odd-npm-3.0.1-93c3c3f41b-89ee2e353c.zip/node_modules/is-odd/",\ - "packageDependencies": [\ - ["is-odd", "npm:3.0.1"],\ - ["is-number", "npm:6.0.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["kind-of", [\ - ["npm:3.2.2", {\ - "packageLocation": "./.yarn/cache/kind-of-npm-3.2.2-7deaffa5f9-7e34bc29d4.zip/node_modules/kind-of/",\ - "packageDependencies": [\ - ["kind-of", "npm:3.2.2"],\ - ["is-buffer", "npm:1.1.6"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["pnp", [\ - ["workspace:.", {\ - "packageLocation": "./",\ - "packageDependencies": [\ - ["pnp", "workspace:."],\ - ["is-even", "npm:1.0.0"],\ - ["is-odd", "npm:3.0.1"]\ - ],\ - "linkType": "SOFT"\ - }]\ - ]]\ - ]\ -}'; - -function $$SETUP_STATE(hydrateRuntimeState, basePath) { - return hydrateRuntimeState(JSON.parse(RAW_RUNTIME_STATE), {basePath: basePath || __dirname}); -} - -const fs = require('fs'); -const path = require('path'); -const crypto = require('crypto'); -const os = require('os'); -const events = require('events'); -const nodeUtils = require('util'); -const stream = require('stream'); -const zlib = require('zlib'); -const require$$0 = require('module'); -const StringDecoder = require('string_decoder'); -const url = require('url'); -const buffer = require('buffer'); -const readline = require('readline'); -const assert = require('assert'); - -const _interopDefaultLegacy = e => e && typeof e === 'object' && 'default' in e ? e : { default: e }; - -function _interopNamespace(e) { - if (e && e.__esModule) return e; - const n = Object.create(null); - if (e) { - for (const k in e) { - if (k !== 'default') { - const d = Object.getOwnPropertyDescriptor(e, k); - Object.defineProperty(n, k, d.get ? d : { - enumerable: true, - get: () => e[k] - }); - } - } - } - n.default = e; - return Object.freeze(n); -} - -const fs__default = /*#__PURE__*/_interopDefaultLegacy(fs); -const path__default = /*#__PURE__*/_interopDefaultLegacy(path); -const nodeUtils__namespace = /*#__PURE__*/_interopNamespace(nodeUtils); -const zlib__default = /*#__PURE__*/_interopDefaultLegacy(zlib); -const require$$0__default = /*#__PURE__*/_interopDefaultLegacy(require$$0); -const StringDecoder__default = /*#__PURE__*/_interopDefaultLegacy(StringDecoder); -const buffer__default = /*#__PURE__*/_interopDefaultLegacy(buffer); -const assert__default = /*#__PURE__*/_interopDefaultLegacy(assert); - -const S_IFMT = 61440; -const S_IFDIR = 16384; -const S_IFREG = 32768; -const S_IFLNK = 40960; -const SAFE_TIME = 456789e3; - -function makeError$1(code, message) { - return Object.assign(new Error(`${code}: ${message}`), { code }); -} -function EBUSY(message) { - return makeError$1(`EBUSY`, message); -} -function ENOSYS(message, reason) { - return makeError$1(`ENOSYS`, `${message}, ${reason}`); -} -function EINVAL(reason) { - return makeError$1(`EINVAL`, `invalid argument, ${reason}`); -} -function EBADF(reason) { - return makeError$1(`EBADF`, `bad file descriptor, ${reason}`); -} -function ENOENT(reason) { - return makeError$1(`ENOENT`, `no such file or directory, ${reason}`); -} -function ENOTDIR(reason) { - return makeError$1(`ENOTDIR`, `not a directory, ${reason}`); -} -function EISDIR(reason) { - return makeError$1(`EISDIR`, `illegal operation on a directory, ${reason}`); -} -function EEXIST(reason) { - return makeError$1(`EEXIST`, `file already exists, ${reason}`); -} -function EROFS(reason) { - return makeError$1(`EROFS`, `read-only filesystem, ${reason}`); -} -function ENOTEMPTY(reason) { - return makeError$1(`ENOTEMPTY`, `directory not empty, ${reason}`); -} -function EOPNOTSUPP(reason) { - return makeError$1(`EOPNOTSUPP`, `operation not supported, ${reason}`); -} -function ERR_DIR_CLOSED() { - return makeError$1(`ERR_DIR_CLOSED`, `Directory handle was closed`); -} - -const DEFAULT_MODE = S_IFREG | 420; -class StatEntry { - constructor() { - this.uid = 0; - this.gid = 0; - this.size = 0; - this.blksize = 0; - this.atimeMs = 0; - this.mtimeMs = 0; - this.ctimeMs = 0; - this.birthtimeMs = 0; - this.atime = new Date(0); - this.mtime = new Date(0); - this.ctime = new Date(0); - this.birthtime = new Date(0); - this.dev = 0; - this.ino = 0; - this.mode = DEFAULT_MODE; - this.nlink = 1; - this.rdev = 0; - this.blocks = 1; - } - isBlockDevice() { - return false; - } - isCharacterDevice() { - return false; - } - isDirectory() { - return (this.mode & S_IFMT) === S_IFDIR; - } - isFIFO() { - return false; - } - isFile() { - return (this.mode & S_IFMT) === S_IFREG; - } - isSocket() { - return false; - } - isSymbolicLink() { - return (this.mode & S_IFMT) === S_IFLNK; - } -} -class BigIntStatsEntry { - constructor() { - this.uid = BigInt(0); - this.gid = BigInt(0); - this.size = BigInt(0); - this.blksize = BigInt(0); - this.atimeMs = BigInt(0); - this.mtimeMs = BigInt(0); - this.ctimeMs = BigInt(0); - this.birthtimeMs = BigInt(0); - this.atimeNs = BigInt(0); - this.mtimeNs = BigInt(0); - this.ctimeNs = BigInt(0); - this.birthtimeNs = BigInt(0); - this.atime = new Date(0); - this.mtime = new Date(0); - this.ctime = new Date(0); - this.birthtime = new Date(0); - this.dev = BigInt(0); - this.ino = BigInt(0); - this.mode = BigInt(DEFAULT_MODE); - this.nlink = BigInt(1); - this.rdev = BigInt(0); - this.blocks = BigInt(1); - } - isBlockDevice() { - return false; - } - isCharacterDevice() { - return false; - } - isDirectory() { - return (this.mode & BigInt(S_IFMT)) === BigInt(S_IFDIR); - } - isFIFO() { - return false; - } - isFile() { - return (this.mode & BigInt(S_IFMT)) === BigInt(S_IFREG); - } - isSocket() { - return false; - } - isSymbolicLink() { - return (this.mode & BigInt(S_IFMT)) === BigInt(S_IFLNK); - } -} -function makeDefaultStats() { - return new StatEntry(); -} -function clearStats(stats) { - for (const key in stats) { - if (Object.hasOwn(stats, key)) { - const element = stats[key]; - if (typeof element === `number`) { - stats[key] = 0; - } else if (typeof element === `bigint`) { - stats[key] = BigInt(0); - } else if (nodeUtils__namespace.types.isDate(element)) { - stats[key] = new Date(0); - } - } - } - return stats; -} -function convertToBigIntStats(stats) { - const bigintStats = new BigIntStatsEntry(); - for (const key in stats) { - if (Object.hasOwn(stats, key)) { - const element = stats[key]; - if (typeof element === `number`) { - bigintStats[key] = BigInt(element); - } else if (nodeUtils__namespace.types.isDate(element)) { - bigintStats[key] = new Date(element); - } - } - } - bigintStats.atimeNs = bigintStats.atimeMs * BigInt(1e6); - bigintStats.mtimeNs = bigintStats.mtimeMs * BigInt(1e6); - bigintStats.ctimeNs = bigintStats.ctimeMs * BigInt(1e6); - bigintStats.birthtimeNs = bigintStats.birthtimeMs * BigInt(1e6); - return bigintStats; -} -function areStatsEqual(a, b) { - if (a.atimeMs !== b.atimeMs) - return false; - if (a.birthtimeMs !== b.birthtimeMs) - return false; - if (a.blksize !== b.blksize) - return false; - if (a.blocks !== b.blocks) - return false; - if (a.ctimeMs !== b.ctimeMs) - return false; - if (a.dev !== b.dev) - return false; - if (a.gid !== b.gid) - return false; - if (a.ino !== b.ino) - return false; - if (a.isBlockDevice() !== b.isBlockDevice()) - return false; - if (a.isCharacterDevice() !== b.isCharacterDevice()) - return false; - if (a.isDirectory() !== b.isDirectory()) - return false; - if (a.isFIFO() !== b.isFIFO()) - return false; - if (a.isFile() !== b.isFile()) - return false; - if (a.isSocket() !== b.isSocket()) - return false; - if (a.isSymbolicLink() !== b.isSymbolicLink()) - return false; - if (a.mode !== b.mode) - return false; - if (a.mtimeMs !== b.mtimeMs) - return false; - if (a.nlink !== b.nlink) - return false; - if (a.rdev !== b.rdev) - return false; - if (a.size !== b.size) - return false; - if (a.uid !== b.uid) - return false; - const aN = a; - const bN = b; - if (aN.atimeNs !== bN.atimeNs) - return false; - if (aN.mtimeNs !== bN.mtimeNs) - return false; - if (aN.ctimeNs !== bN.ctimeNs) - return false; - if (aN.birthtimeNs !== bN.birthtimeNs) - return false; - return true; -} - -const PortablePath = { - root: `/`, - dot: `.`, - parent: `..` -}; -const Filename = { - home: `~`, - nodeModules: `node_modules`, - manifest: `package.json`, - lockfile: `yarn.lock`, - virtual: `__virtual__`, - pnpJs: `.pnp.js`, - pnpCjs: `.pnp.cjs`, - pnpData: `.pnp.data.json`, - pnpEsmLoader: `.pnp.loader.mjs`, - rc: `.yarnrc.yml`, - env: `.env` -}; -const npath = Object.create(path__default.default); -const ppath = Object.create(path__default.default.posix); -npath.cwd = () => process.cwd(); -ppath.cwd = process.platform === `win32` ? () => toPortablePath(process.cwd()) : process.cwd; -if (process.platform === `win32`) { - ppath.resolve = (...segments) => { - if (segments.length > 0 && ppath.isAbsolute(segments[0])) { - return path__default.default.posix.resolve(...segments); - } else { - return path__default.default.posix.resolve(ppath.cwd(), ...segments); - } - }; -} -const contains = function(pathUtils, from, to) { - from = pathUtils.normalize(from); - to = pathUtils.normalize(to); - if (from === to) - return `.`; - if (!from.endsWith(pathUtils.sep)) - from = from + pathUtils.sep; - if (to.startsWith(from)) { - return to.slice(from.length); - } else { - return null; - } -}; -npath.contains = (from, to) => contains(npath, from, to); -ppath.contains = (from, to) => contains(ppath, from, to); -const WINDOWS_PATH_REGEXP = /^([a-zA-Z]:.*)$/; -const UNC_WINDOWS_PATH_REGEXP = /^\/\/(\.\/)?(.*)$/; -const PORTABLE_PATH_REGEXP = /^\/([a-zA-Z]:.*)$/; -const UNC_PORTABLE_PATH_REGEXP = /^\/unc\/(\.dot\/)?(.*)$/; -function fromPortablePathWin32(p) { - let portablePathMatch, uncPortablePathMatch; - if (portablePathMatch = p.match(PORTABLE_PATH_REGEXP)) - p = portablePathMatch[1]; - else if (uncPortablePathMatch = p.match(UNC_PORTABLE_PATH_REGEXP)) - p = `\\\\${uncPortablePathMatch[1] ? `.\\` : ``}${uncPortablePathMatch[2]}`; - else - return p; - return p.replace(/\//g, `\\`); -} -function toPortablePathWin32(p) { - p = p.replace(/\\/g, `/`); - let windowsPathMatch, uncWindowsPathMatch; - if (windowsPathMatch = p.match(WINDOWS_PATH_REGEXP)) - p = `/${windowsPathMatch[1]}`; - else if (uncWindowsPathMatch = p.match(UNC_WINDOWS_PATH_REGEXP)) - p = `/unc/${uncWindowsPathMatch[1] ? `.dot/` : ``}${uncWindowsPathMatch[2]}`; - return p; -} -const toPortablePath = process.platform === `win32` ? toPortablePathWin32 : (p) => p; -const fromPortablePath = process.platform === `win32` ? fromPortablePathWin32 : (p) => p; -npath.fromPortablePath = fromPortablePath; -npath.toPortablePath = toPortablePath; -function convertPath(targetPathUtils, sourcePath) { - return targetPathUtils === npath ? fromPortablePath(sourcePath) : toPortablePath(sourcePath); -} - -const defaultTime = new Date(SAFE_TIME * 1e3); -const defaultTimeMs = defaultTime.getTime(); -async function copyPromise(destinationFs, destination, sourceFs, source, opts) { - const normalizedDestination = destinationFs.pathUtils.normalize(destination); - const normalizedSource = sourceFs.pathUtils.normalize(source); - const prelayout = []; - const postlayout = []; - const { atime, mtime } = opts.stableTime ? { atime: defaultTime, mtime: defaultTime } : await sourceFs.lstatPromise(normalizedSource); - await destinationFs.mkdirpPromise(destinationFs.pathUtils.dirname(destination), { utimes: [atime, mtime] }); - await copyImpl(prelayout, postlayout, destinationFs, normalizedDestination, sourceFs, normalizedSource, { ...opts, didParentExist: true }); - for (const operation of prelayout) - await operation(); - await Promise.all(postlayout.map((operation) => { - return operation(); - })); -} -async function copyImpl(prelayout, postlayout, destinationFs, destination, sourceFs, source, opts) { - const destinationStat = opts.didParentExist ? await maybeLStat(destinationFs, destination) : null; - const sourceStat = await sourceFs.lstatPromise(source); - const { atime, mtime } = opts.stableTime ? { atime: defaultTime, mtime: defaultTime } : sourceStat; - let updated; - switch (true) { - case sourceStat.isDirectory(): - { - updated = await copyFolder(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts); - } - break; - case sourceStat.isFile(): - { - updated = await copyFile(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts); - } - break; - case sourceStat.isSymbolicLink(): - { - updated = await copySymlink(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts); - } - break; - default: { - throw new Error(`Unsupported file type (${sourceStat.mode})`); - } - } - if (opts.linkStrategy?.type !== `HardlinkFromIndex` || !sourceStat.isFile()) { - if (updated || destinationStat?.mtime?.getTime() !== mtime.getTime() || destinationStat?.atime?.getTime() !== atime.getTime()) { - postlayout.push(() => destinationFs.lutimesPromise(destination, atime, mtime)); - updated = true; - } - if (destinationStat === null || (destinationStat.mode & 511) !== (sourceStat.mode & 511)) { - postlayout.push(() => destinationFs.chmodPromise(destination, sourceStat.mode & 511)); - updated = true; - } - } - return updated; -} -async function maybeLStat(baseFs, p) { - try { - return await baseFs.lstatPromise(p); - } catch (e) { - return null; - } -} -async function copyFolder(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts) { - if (destinationStat !== null && !destinationStat.isDirectory()) { - if (opts.overwrite) { - prelayout.push(async () => destinationFs.removePromise(destination)); - destinationStat = null; - } else { - return false; - } - } - let updated = false; - if (destinationStat === null) { - prelayout.push(async () => { - try { - await destinationFs.mkdirPromise(destination, { mode: sourceStat.mode }); - } catch (err) { - if (err.code !== `EEXIST`) { - throw err; - } - } - }); - updated = true; - } - const entries = await sourceFs.readdirPromise(source); - const nextOpts = opts.didParentExist && !destinationStat ? { ...opts, didParentExist: false } : opts; - if (opts.stableSort) { - for (const entry of entries.sort()) { - if (await copyImpl(prelayout, postlayout, destinationFs, destinationFs.pathUtils.join(destination, entry), sourceFs, sourceFs.pathUtils.join(source, entry), nextOpts)) { - updated = true; - } - } - } else { - const entriesUpdateStatus = await Promise.all(entries.map(async (entry) => { - await copyImpl(prelayout, postlayout, destinationFs, destinationFs.pathUtils.join(destination, entry), sourceFs, sourceFs.pathUtils.join(source, entry), nextOpts); - })); - if (entriesUpdateStatus.some((status) => status)) { - updated = true; - } - } - return updated; -} -async function copyFileViaIndex(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts, linkStrategy) { - const sourceHash = await sourceFs.checksumFilePromise(source, { algorithm: `sha1` }); - const defaultMode = 420; - const sourceMode = sourceStat.mode & 511; - const indexFileName = `${sourceHash}${sourceMode !== defaultMode ? sourceMode.toString(8) : ``}`; - const indexPath = destinationFs.pathUtils.join(linkStrategy.indexPath, sourceHash.slice(0, 2), `${indexFileName}.dat`); - let AtomicBehavior; - ((AtomicBehavior2) => { - AtomicBehavior2[AtomicBehavior2["Lock"] = 0] = "Lock"; - AtomicBehavior2[AtomicBehavior2["Rename"] = 1] = "Rename"; - })(AtomicBehavior || (AtomicBehavior = {})); - let atomicBehavior = 1 /* Rename */; - let indexStat = await maybeLStat(destinationFs, indexPath); - if (destinationStat) { - const isDestinationHardlinkedFromIndex = indexStat && destinationStat.dev === indexStat.dev && destinationStat.ino === indexStat.ino; - const isIndexModified = indexStat?.mtimeMs !== defaultTimeMs; - if (isDestinationHardlinkedFromIndex) { - if (isIndexModified && linkStrategy.autoRepair) { - atomicBehavior = 0 /* Lock */; - indexStat = null; - } - } - if (!isDestinationHardlinkedFromIndex) { - if (opts.overwrite) { - prelayout.push(async () => destinationFs.removePromise(destination)); - destinationStat = null; - } else { - return false; - } - } - } - const tempPath = !indexStat && atomicBehavior === 1 /* Rename */ ? `${indexPath}.${Math.floor(Math.random() * 4294967296).toString(16).padStart(8, `0`)}` : null; - let tempPathCleaned = false; - prelayout.push(async () => { - if (!indexStat) { - if (atomicBehavior === 0 /* Lock */) { - await destinationFs.lockPromise(indexPath, async () => { - const content = await sourceFs.readFilePromise(source); - await destinationFs.writeFilePromise(indexPath, content); - }); - } - if (atomicBehavior === 1 /* Rename */ && tempPath) { - const content = await sourceFs.readFilePromise(source); - await destinationFs.writeFilePromise(tempPath, content); - try { - await destinationFs.linkPromise(tempPath, indexPath); - } catch (err) { - if (err.code === `EEXIST`) { - tempPathCleaned = true; - await destinationFs.unlinkPromise(tempPath); - } else { - throw err; - } - } - } - } - if (!destinationStat) { - await destinationFs.linkPromise(indexPath, destination); - } - }); - postlayout.push(async () => { - if (!indexStat) { - await destinationFs.lutimesPromise(indexPath, defaultTime, defaultTime); - if (sourceMode !== defaultMode) { - await destinationFs.chmodPromise(indexPath, sourceMode); - } - } - if (tempPath && !tempPathCleaned) { - await destinationFs.unlinkPromise(tempPath); - } - }); - return false; -} -async function copyFileDirect(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts) { - if (destinationStat !== null) { - if (opts.overwrite) { - prelayout.push(async () => destinationFs.removePromise(destination)); - destinationStat = null; - } else { - return false; - } - } - prelayout.push(async () => { - const content = await sourceFs.readFilePromise(source); - await destinationFs.writeFilePromise(destination, content); - }); - return true; -} -async function copyFile(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts) { - if (opts.linkStrategy?.type === `HardlinkFromIndex`) { - return copyFileViaIndex(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts, opts.linkStrategy); - } else { - return copyFileDirect(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts); - } -} -async function copySymlink(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts) { - if (destinationStat !== null) { - if (opts.overwrite) { - prelayout.push(async () => destinationFs.removePromise(destination)); - destinationStat = null; - } else { - return false; - } - } - prelayout.push(async () => { - await destinationFs.symlinkPromise(convertPath(destinationFs.pathUtils, await sourceFs.readlinkPromise(source)), destination); - }); - return true; -} - -class CustomDir { - constructor(path, nextDirent, opts = {}) { - this.path = path; - this.nextDirent = nextDirent; - this.opts = opts; - this.closed = false; - } - throwIfClosed() { - if (this.closed) { - throw ERR_DIR_CLOSED(); - } - } - async *[Symbol.asyncIterator]() { - try { - let dirent; - while ((dirent = await this.read()) !== null) { - yield dirent; - } - } finally { - await this.close(); - } - } - read(cb) { - const dirent = this.readSync(); - if (typeof cb !== `undefined`) - return cb(null, dirent); - return Promise.resolve(dirent); - } - readSync() { - this.throwIfClosed(); - return this.nextDirent(); - } - close(cb) { - this.closeSync(); - if (typeof cb !== `undefined`) - return cb(null); - return Promise.resolve(); - } - closeSync() { - this.throwIfClosed(); - this.opts.onClose?.(); - this.closed = true; - } -} -function opendir(fakeFs, path, entries, opts) { - const nextDirent = () => { - const filename = entries.shift(); - if (typeof filename === `undefined`) - return null; - const entryPath = fakeFs.pathUtils.join(path, filename); - return Object.assign(fakeFs.statSync(entryPath), { - name: filename, - path: void 0 - }); - }; - return new CustomDir(path, nextDirent, opts); -} - -function assertStatus(current, expected) { - if (current !== expected) { - throw new Error(`Invalid StatWatcher status: expected '${expected}', got '${current}'`); - } -} -class CustomStatWatcher extends events.EventEmitter { - constructor(fakeFs, path, { bigint = false } = {}) { - super(); - this.status = "ready" /* Ready */; - this.changeListeners = /* @__PURE__ */ new Map(); - this.startTimeout = null; - this.fakeFs = fakeFs; - this.path = path; - this.bigint = bigint; - this.lastStats = this.stat(); - } - static create(fakeFs, path, opts) { - const statWatcher = new CustomStatWatcher(fakeFs, path, opts); - statWatcher.start(); - return statWatcher; - } - start() { - assertStatus(this.status, "ready" /* Ready */); - this.status = "running" /* Running */; - this.startTimeout = setTimeout(() => { - this.startTimeout = null; - if (!this.fakeFs.existsSync(this.path)) { - this.emit("change" /* Change */, this.lastStats, this.lastStats); - } - }, 3); - } - stop() { - assertStatus(this.status, "running" /* Running */); - this.status = "stopped" /* Stopped */; - if (this.startTimeout !== null) { - clearTimeout(this.startTimeout); - this.startTimeout = null; - } - this.emit("stop" /* Stop */); - } - stat() { - try { - return this.fakeFs.statSync(this.path, { bigint: this.bigint }); - } catch (error) { - const statInstance = this.bigint ? new BigIntStatsEntry() : new StatEntry(); - return clearStats(statInstance); - } - } - makeInterval(opts) { - const interval = setInterval(() => { - const currentStats = this.stat(); - const previousStats = this.lastStats; - if (areStatsEqual(currentStats, previousStats)) - return; - this.lastStats = currentStats; - this.emit("change" /* Change */, currentStats, previousStats); - }, opts.interval); - return opts.persistent ? interval : interval.unref(); - } - registerChangeListener(listener, opts) { - this.addListener("change" /* Change */, listener); - this.changeListeners.set(listener, this.makeInterval(opts)); - } - unregisterChangeListener(listener) { - this.removeListener("change" /* Change */, listener); - const interval = this.changeListeners.get(listener); - if (typeof interval !== `undefined`) - clearInterval(interval); - this.changeListeners.delete(listener); - } - unregisterAllChangeListeners() { - for (const listener of this.changeListeners.keys()) { - this.unregisterChangeListener(listener); - } - } - hasChangeListeners() { - return this.changeListeners.size > 0; - } - ref() { - for (const interval of this.changeListeners.values()) - interval.ref(); - return this; - } - unref() { - for (const interval of this.changeListeners.values()) - interval.unref(); - return this; - } -} - -const statWatchersByFakeFS = /* @__PURE__ */ new WeakMap(); -function watchFile(fakeFs, path, a, b) { - let bigint; - let persistent; - let interval; - let listener; - switch (typeof a) { - case `function`: - { - bigint = false; - persistent = true; - interval = 5007; - listener = a; - } - break; - default: - { - ({ - bigint = false, - persistent = true, - interval = 5007 - } = a); - listener = b; - } - break; - } - let statWatchers = statWatchersByFakeFS.get(fakeFs); - if (typeof statWatchers === `undefined`) - statWatchersByFakeFS.set(fakeFs, statWatchers = /* @__PURE__ */ new Map()); - let statWatcher = statWatchers.get(path); - if (typeof statWatcher === `undefined`) { - statWatcher = CustomStatWatcher.create(fakeFs, path, { bigint }); - statWatchers.set(path, statWatcher); - } - statWatcher.registerChangeListener(listener, { persistent, interval }); - return statWatcher; -} -function unwatchFile(fakeFs, path, cb) { - const statWatchers = statWatchersByFakeFS.get(fakeFs); - if (typeof statWatchers === `undefined`) - return; - const statWatcher = statWatchers.get(path); - if (typeof statWatcher === `undefined`) - return; - if (typeof cb === `undefined`) - statWatcher.unregisterAllChangeListeners(); - else - statWatcher.unregisterChangeListener(cb); - if (!statWatcher.hasChangeListeners()) { - statWatcher.stop(); - statWatchers.delete(path); - } -} -function unwatchAllFiles(fakeFs) { - const statWatchers = statWatchersByFakeFS.get(fakeFs); - if (typeof statWatchers === `undefined`) - return; - for (const path of statWatchers.keys()) { - unwatchFile(fakeFs, path); - } -} - -class FakeFS { - constructor(pathUtils) { - this.pathUtils = pathUtils; - } - async *genTraversePromise(init, { stableSort = false } = {}) { - const stack = [init]; - while (stack.length > 0) { - const p = stack.shift(); - const entry = await this.lstatPromise(p); - if (entry.isDirectory()) { - const entries = await this.readdirPromise(p); - if (stableSort) { - for (const entry2 of entries.sort()) { - stack.push(this.pathUtils.join(p, entry2)); - } - } else { - throw new Error(`Not supported`); - } - } else { - yield p; - } - } - } - async checksumFilePromise(path, { algorithm = `sha512` } = {}) { - const fd = await this.openPromise(path, `r`); - try { - const CHUNK_SIZE = 65536; - const chunk = Buffer.allocUnsafeSlow(CHUNK_SIZE); - const hash = crypto.createHash(algorithm); - let bytesRead = 0; - while ((bytesRead = await this.readPromise(fd, chunk, 0, CHUNK_SIZE)) !== 0) - hash.update(bytesRead === CHUNK_SIZE ? chunk : chunk.slice(0, bytesRead)); - return hash.digest(`hex`); - } finally { - await this.closePromise(fd); - } - } - async removePromise(p, { recursive = true, maxRetries = 5 } = {}) { - let stat; - try { - stat = await this.lstatPromise(p); - } catch (error) { - if (error.code === `ENOENT`) { - return; - } else { - throw error; - } - } - if (stat.isDirectory()) { - if (recursive) { - const entries = await this.readdirPromise(p); - await Promise.all(entries.map((entry) => { - return this.removePromise(this.pathUtils.resolve(p, entry)); - })); - } - for (let t = 0; t <= maxRetries; t++) { - try { - await this.rmdirPromise(p); - break; - } catch (error) { - if (error.code !== `EBUSY` && error.code !== `ENOTEMPTY`) { - throw error; - } else if (t < maxRetries) { - await new Promise((resolve) => setTimeout(resolve, t * 100)); - } - } - } - } else { - await this.unlinkPromise(p); - } - } - removeSync(p, { recursive = true } = {}) { - let stat; - try { - stat = this.lstatSync(p); - } catch (error) { - if (error.code === `ENOENT`) { - return; - } else { - throw error; - } - } - if (stat.isDirectory()) { - if (recursive) - for (const entry of this.readdirSync(p)) - this.removeSync(this.pathUtils.resolve(p, entry)); - this.rmdirSync(p); - } else { - this.unlinkSync(p); - } - } - async mkdirpPromise(p, { chmod, utimes } = {}) { - p = this.resolve(p); - if (p === this.pathUtils.dirname(p)) - return void 0; - const parts = p.split(this.pathUtils.sep); - let createdDirectory; - for (let u = 2; u <= parts.length; ++u) { - const subPath = parts.slice(0, u).join(this.pathUtils.sep); - if (!this.existsSync(subPath)) { - try { - await this.mkdirPromise(subPath); - } catch (error) { - if (error.code === `EEXIST`) { - continue; - } else { - throw error; - } - } - createdDirectory ??= subPath; - if (chmod != null) - await this.chmodPromise(subPath, chmod); - if (utimes != null) { - await this.utimesPromise(subPath, utimes[0], utimes[1]); - } else { - const parentStat = await this.statPromise(this.pathUtils.dirname(subPath)); - await this.utimesPromise(subPath, parentStat.atime, parentStat.mtime); - } - } - } - return createdDirectory; - } - mkdirpSync(p, { chmod, utimes } = {}) { - p = this.resolve(p); - if (p === this.pathUtils.dirname(p)) - return void 0; - const parts = p.split(this.pathUtils.sep); - let createdDirectory; - for (let u = 2; u <= parts.length; ++u) { - const subPath = parts.slice(0, u).join(this.pathUtils.sep); - if (!this.existsSync(subPath)) { - try { - this.mkdirSync(subPath); - } catch (error) { - if (error.code === `EEXIST`) { - continue; - } else { - throw error; - } - } - createdDirectory ??= subPath; - if (chmod != null) - this.chmodSync(subPath, chmod); - if (utimes != null) { - this.utimesSync(subPath, utimes[0], utimes[1]); - } else { - const parentStat = this.statSync(this.pathUtils.dirname(subPath)); - this.utimesSync(subPath, parentStat.atime, parentStat.mtime); - } - } - } - return createdDirectory; - } - async copyPromise(destination, source, { baseFs = this, overwrite = true, stableSort = false, stableTime = false, linkStrategy = null } = {}) { - return await copyPromise(this, destination, baseFs, source, { overwrite, stableSort, stableTime, linkStrategy }); - } - copySync(destination, source, { baseFs = this, overwrite = true } = {}) { - const stat = baseFs.lstatSync(source); - const exists = this.existsSync(destination); - if (stat.isDirectory()) { - this.mkdirpSync(destination); - const directoryListing = baseFs.readdirSync(source); - for (const entry of directoryListing) { - this.copySync(this.pathUtils.join(destination, entry), baseFs.pathUtils.join(source, entry), { baseFs, overwrite }); - } - } else if (stat.isFile()) { - if (!exists || overwrite) { - if (exists) - this.removeSync(destination); - const content = baseFs.readFileSync(source); - this.writeFileSync(destination, content); - } - } else if (stat.isSymbolicLink()) { - if (!exists || overwrite) { - if (exists) - this.removeSync(destination); - const target = baseFs.readlinkSync(source); - this.symlinkSync(convertPath(this.pathUtils, target), destination); - } - } else { - throw new Error(`Unsupported file type (file: ${source}, mode: 0o${stat.mode.toString(8).padStart(6, `0`)})`); - } - const mode = stat.mode & 511; - this.chmodSync(destination, mode); - } - async changeFilePromise(p, content, opts = {}) { - if (Buffer.isBuffer(content)) { - return this.changeFileBufferPromise(p, content, opts); - } else { - return this.changeFileTextPromise(p, content, opts); - } - } - async changeFileBufferPromise(p, content, { mode } = {}) { - let current = Buffer.alloc(0); - try { - current = await this.readFilePromise(p); - } catch (error) { - } - if (Buffer.compare(current, content) === 0) - return; - await this.writeFilePromise(p, content, { mode }); - } - async changeFileTextPromise(p, content, { automaticNewlines, mode } = {}) { - let current = ``; - try { - current = await this.readFilePromise(p, `utf8`); - } catch (error) { - } - const normalizedContent = automaticNewlines ? normalizeLineEndings(current, content) : content; - if (current === normalizedContent) - return; - await this.writeFilePromise(p, normalizedContent, { mode }); - } - changeFileSync(p, content, opts = {}) { - if (Buffer.isBuffer(content)) { - return this.changeFileBufferSync(p, content, opts); - } else { - return this.changeFileTextSync(p, content, opts); - } - } - changeFileBufferSync(p, content, { mode } = {}) { - let current = Buffer.alloc(0); - try { - current = this.readFileSync(p); - } catch (error) { - } - if (Buffer.compare(current, content) === 0) - return; - this.writeFileSync(p, content, { mode }); - } - changeFileTextSync(p, content, { automaticNewlines = false, mode } = {}) { - let current = ``; - try { - current = this.readFileSync(p, `utf8`); - } catch (error) { - } - const normalizedContent = automaticNewlines ? normalizeLineEndings(current, content) : content; - if (current === normalizedContent) - return; - this.writeFileSync(p, normalizedContent, { mode }); - } - async movePromise(fromP, toP) { - try { - await this.renamePromise(fromP, toP); - } catch (error) { - if (error.code === `EXDEV`) { - await this.copyPromise(toP, fromP); - await this.removePromise(fromP); - } else { - throw error; - } - } - } - moveSync(fromP, toP) { - try { - this.renameSync(fromP, toP); - } catch (error) { - if (error.code === `EXDEV`) { - this.copySync(toP, fromP); - this.removeSync(fromP); - } else { - throw error; - } - } - } - async lockPromise(affectedPath, callback) { - const lockPath = `${affectedPath}.flock`; - const interval = 1e3 / 60; - const startTime = Date.now(); - let fd = null; - const isAlive = async () => { - let pid; - try { - [pid] = await this.readJsonPromise(lockPath); - } catch (error) { - return Date.now() - startTime < 500; - } - try { - process.kill(pid, 0); - return true; - } catch (error) { - return false; - } - }; - while (fd === null) { - try { - fd = await this.openPromise(lockPath, `wx`); - } catch (error) { - if (error.code === `EEXIST`) { - if (!await isAlive()) { - try { - await this.unlinkPromise(lockPath); - continue; - } catch (error2) { - } - } - if (Date.now() - startTime < 60 * 1e3) { - await new Promise((resolve) => setTimeout(resolve, interval)); - } else { - throw new Error(`Couldn't acquire a lock in a reasonable time (via ${lockPath})`); - } - } else { - throw error; - } - } - } - await this.writePromise(fd, JSON.stringify([process.pid])); - try { - return await callback(); - } finally { - try { - await this.closePromise(fd); - await this.unlinkPromise(lockPath); - } catch (error) { - } - } - } - async readJsonPromise(p) { - const content = await this.readFilePromise(p, `utf8`); - try { - return JSON.parse(content); - } catch (error) { - error.message += ` (in ${p})`; - throw error; - } - } - readJsonSync(p) { - const content = this.readFileSync(p, `utf8`); - try { - return JSON.parse(content); - } catch (error) { - error.message += ` (in ${p})`; - throw error; - } - } - async writeJsonPromise(p, data, { compact = false } = {}) { - const space = compact ? 0 : 2; - return await this.writeFilePromise(p, `${JSON.stringify(data, null, space)} -`); - } - writeJsonSync(p, data, { compact = false } = {}) { - const space = compact ? 0 : 2; - return this.writeFileSync(p, `${JSON.stringify(data, null, space)} -`); - } - async preserveTimePromise(p, cb) { - const stat = await this.lstatPromise(p); - const result = await cb(); - if (typeof result !== `undefined`) - p = result; - await this.lutimesPromise(p, stat.atime, stat.mtime); - } - async preserveTimeSync(p, cb) { - const stat = this.lstatSync(p); - const result = cb(); - if (typeof result !== `undefined`) - p = result; - this.lutimesSync(p, stat.atime, stat.mtime); - } -} -class BasePortableFakeFS extends FakeFS { - constructor() { - super(ppath); - } -} -function getEndOfLine(content) { - const matches = content.match(/\r?\n/g); - if (matches === null) - return os.EOL; - const crlf = matches.filter((nl) => nl === `\r -`).length; - const lf = matches.length - crlf; - return crlf > lf ? `\r -` : ` -`; -} -function normalizeLineEndings(originalContent, newContent) { - return newContent.replace(/\r?\n/g, getEndOfLine(originalContent)); -} - -class ProxiedFS extends FakeFS { - getExtractHint(hints) { - return this.baseFs.getExtractHint(hints); - } - resolve(path) { - return this.mapFromBase(this.baseFs.resolve(this.mapToBase(path))); - } - getRealPath() { - return this.mapFromBase(this.baseFs.getRealPath()); - } - async openPromise(p, flags, mode) { - return this.baseFs.openPromise(this.mapToBase(p), flags, mode); - } - openSync(p, flags, mode) { - return this.baseFs.openSync(this.mapToBase(p), flags, mode); - } - async opendirPromise(p, opts) { - return Object.assign(await this.baseFs.opendirPromise(this.mapToBase(p), opts), { path: p }); - } - opendirSync(p, opts) { - return Object.assign(this.baseFs.opendirSync(this.mapToBase(p), opts), { path: p }); - } - async readPromise(fd, buffer, offset, length, position) { - return await this.baseFs.readPromise(fd, buffer, offset, length, position); - } - readSync(fd, buffer, offset, length, position) { - return this.baseFs.readSync(fd, buffer, offset, length, position); - } - async writePromise(fd, buffer, offset, length, position) { - if (typeof buffer === `string`) { - return await this.baseFs.writePromise(fd, buffer, offset); - } else { - return await this.baseFs.writePromise(fd, buffer, offset, length, position); - } - } - writeSync(fd, buffer, offset, length, position) { - if (typeof buffer === `string`) { - return this.baseFs.writeSync(fd, buffer, offset); - } else { - return this.baseFs.writeSync(fd, buffer, offset, length, position); - } - } - async closePromise(fd) { - return this.baseFs.closePromise(fd); - } - closeSync(fd) { - this.baseFs.closeSync(fd); - } - createReadStream(p, opts) { - return this.baseFs.createReadStream(p !== null ? this.mapToBase(p) : p, opts); - } - createWriteStream(p, opts) { - return this.baseFs.createWriteStream(p !== null ? this.mapToBase(p) : p, opts); - } - async realpathPromise(p) { - return this.mapFromBase(await this.baseFs.realpathPromise(this.mapToBase(p))); - } - realpathSync(p) { - return this.mapFromBase(this.baseFs.realpathSync(this.mapToBase(p))); - } - async existsPromise(p) { - return this.baseFs.existsPromise(this.mapToBase(p)); - } - existsSync(p) { - return this.baseFs.existsSync(this.mapToBase(p)); - } - accessSync(p, mode) { - return this.baseFs.accessSync(this.mapToBase(p), mode); - } - async accessPromise(p, mode) { - return this.baseFs.accessPromise(this.mapToBase(p), mode); - } - async statPromise(p, opts) { - return this.baseFs.statPromise(this.mapToBase(p), opts); - } - statSync(p, opts) { - return this.baseFs.statSync(this.mapToBase(p), opts); - } - async fstatPromise(fd, opts) { - return this.baseFs.fstatPromise(fd, opts); - } - fstatSync(fd, opts) { - return this.baseFs.fstatSync(fd, opts); - } - lstatPromise(p, opts) { - return this.baseFs.lstatPromise(this.mapToBase(p), opts); - } - lstatSync(p, opts) { - return this.baseFs.lstatSync(this.mapToBase(p), opts); - } - async fchmodPromise(fd, mask) { - return this.baseFs.fchmodPromise(fd, mask); - } - fchmodSync(fd, mask) { - return this.baseFs.fchmodSync(fd, mask); - } - async chmodPromise(p, mask) { - return this.baseFs.chmodPromise(this.mapToBase(p), mask); - } - chmodSync(p, mask) { - return this.baseFs.chmodSync(this.mapToBase(p), mask); - } - async fchownPromise(fd, uid, gid) { - return this.baseFs.fchownPromise(fd, uid, gid); - } - fchownSync(fd, uid, gid) { - return this.baseFs.fchownSync(fd, uid, gid); - } - async chownPromise(p, uid, gid) { - return this.baseFs.chownPromise(this.mapToBase(p), uid, gid); - } - chownSync(p, uid, gid) { - return this.baseFs.chownSync(this.mapToBase(p), uid, gid); - } - async renamePromise(oldP, newP) { - return this.baseFs.renamePromise(this.mapToBase(oldP), this.mapToBase(newP)); - } - renameSync(oldP, newP) { - return this.baseFs.renameSync(this.mapToBase(oldP), this.mapToBase(newP)); - } - async copyFilePromise(sourceP, destP, flags = 0) { - return this.baseFs.copyFilePromise(this.mapToBase(sourceP), this.mapToBase(destP), flags); - } - copyFileSync(sourceP, destP, flags = 0) { - return this.baseFs.copyFileSync(this.mapToBase(sourceP), this.mapToBase(destP), flags); - } - async appendFilePromise(p, content, opts) { - return this.baseFs.appendFilePromise(this.fsMapToBase(p), content, opts); - } - appendFileSync(p, content, opts) { - return this.baseFs.appendFileSync(this.fsMapToBase(p), content, opts); - } - async writeFilePromise(p, content, opts) { - return this.baseFs.writeFilePromise(this.fsMapToBase(p), content, opts); - } - writeFileSync(p, content, opts) { - return this.baseFs.writeFileSync(this.fsMapToBase(p), content, opts); - } - async unlinkPromise(p) { - return this.baseFs.unlinkPromise(this.mapToBase(p)); - } - unlinkSync(p) { - return this.baseFs.unlinkSync(this.mapToBase(p)); - } - async utimesPromise(p, atime, mtime) { - return this.baseFs.utimesPromise(this.mapToBase(p), atime, mtime); - } - utimesSync(p, atime, mtime) { - return this.baseFs.utimesSync(this.mapToBase(p), atime, mtime); - } - async lutimesPromise(p, atime, mtime) { - return this.baseFs.lutimesPromise(this.mapToBase(p), atime, mtime); - } - lutimesSync(p, atime, mtime) { - return this.baseFs.lutimesSync(this.mapToBase(p), atime, mtime); - } - async mkdirPromise(p, opts) { - return this.baseFs.mkdirPromise(this.mapToBase(p), opts); - } - mkdirSync(p, opts) { - return this.baseFs.mkdirSync(this.mapToBase(p), opts); - } - async rmdirPromise(p, opts) { - return this.baseFs.rmdirPromise(this.mapToBase(p), opts); - } - rmdirSync(p, opts) { - return this.baseFs.rmdirSync(this.mapToBase(p), opts); - } - async rmPromise(p, opts) { - return this.baseFs.rmPromise(this.mapToBase(p), opts); - } - rmSync(p, opts) { - return this.baseFs.rmSync(this.mapToBase(p), opts); - } - async linkPromise(existingP, newP) { - return this.baseFs.linkPromise(this.mapToBase(existingP), this.mapToBase(newP)); - } - linkSync(existingP, newP) { - return this.baseFs.linkSync(this.mapToBase(existingP), this.mapToBase(newP)); - } - async symlinkPromise(target, p, type) { - const mappedP = this.mapToBase(p); - if (this.pathUtils.isAbsolute(target)) - return this.baseFs.symlinkPromise(this.mapToBase(target), mappedP, type); - const mappedAbsoluteTarget = this.mapToBase(this.pathUtils.join(this.pathUtils.dirname(p), target)); - const mappedTarget = this.baseFs.pathUtils.relative(this.baseFs.pathUtils.dirname(mappedP), mappedAbsoluteTarget); - return this.baseFs.symlinkPromise(mappedTarget, mappedP, type); - } - symlinkSync(target, p, type) { - const mappedP = this.mapToBase(p); - if (this.pathUtils.isAbsolute(target)) - return this.baseFs.symlinkSync(this.mapToBase(target), mappedP, type); - const mappedAbsoluteTarget = this.mapToBase(this.pathUtils.join(this.pathUtils.dirname(p), target)); - const mappedTarget = this.baseFs.pathUtils.relative(this.baseFs.pathUtils.dirname(mappedP), mappedAbsoluteTarget); - return this.baseFs.symlinkSync(mappedTarget, mappedP, type); - } - async readFilePromise(p, encoding) { - return this.baseFs.readFilePromise(this.fsMapToBase(p), encoding); - } - readFileSync(p, encoding) { - return this.baseFs.readFileSync(this.fsMapToBase(p), encoding); - } - readdirPromise(p, opts) { - return this.baseFs.readdirPromise(this.mapToBase(p), opts); - } - readdirSync(p, opts) { - return this.baseFs.readdirSync(this.mapToBase(p), opts); - } - async readlinkPromise(p) { - return this.mapFromBase(await this.baseFs.readlinkPromise(this.mapToBase(p))); - } - readlinkSync(p) { - return this.mapFromBase(this.baseFs.readlinkSync(this.mapToBase(p))); - } - async truncatePromise(p, len) { - return this.baseFs.truncatePromise(this.mapToBase(p), len); - } - truncateSync(p, len) { - return this.baseFs.truncateSync(this.mapToBase(p), len); - } - async ftruncatePromise(fd, len) { - return this.baseFs.ftruncatePromise(fd, len); - } - ftruncateSync(fd, len) { - return this.baseFs.ftruncateSync(fd, len); - } - watch(p, a, b) { - return this.baseFs.watch( - this.mapToBase(p), - a, - b - ); - } - watchFile(p, a, b) { - return this.baseFs.watchFile( - this.mapToBase(p), - a, - b - ); - } - unwatchFile(p, cb) { - return this.baseFs.unwatchFile(this.mapToBase(p), cb); - } - fsMapToBase(p) { - if (typeof p === `number`) { - return p; - } else { - return this.mapToBase(p); - } - } -} - -function direntToPortable(dirent) { - const portableDirent = dirent; - if (typeof dirent.path === `string`) - portableDirent.path = npath.toPortablePath(dirent.path); - return portableDirent; -} -class NodeFS extends BasePortableFakeFS { - constructor(realFs = fs__default.default) { - super(); - this.realFs = realFs; - } - getExtractHint() { - return false; - } - getRealPath() { - return PortablePath.root; - } - resolve(p) { - return ppath.resolve(p); - } - async openPromise(p, flags, mode) { - return await new Promise((resolve, reject) => { - this.realFs.open(npath.fromPortablePath(p), flags, mode, this.makeCallback(resolve, reject)); - }); - } - openSync(p, flags, mode) { - return this.realFs.openSync(npath.fromPortablePath(p), flags, mode); - } - async opendirPromise(p, opts) { - return await new Promise((resolve, reject) => { - if (typeof opts !== `undefined`) { - this.realFs.opendir(npath.fromPortablePath(p), opts, this.makeCallback(resolve, reject)); - } else { - this.realFs.opendir(npath.fromPortablePath(p), this.makeCallback(resolve, reject)); - } - }).then((dir) => { - const dirWithFixedPath = dir; - Object.defineProperty(dirWithFixedPath, `path`, { - value: p, - configurable: true, - writable: true - }); - return dirWithFixedPath; - }); - } - opendirSync(p, opts) { - const dir = typeof opts !== `undefined` ? this.realFs.opendirSync(npath.fromPortablePath(p), opts) : this.realFs.opendirSync(npath.fromPortablePath(p)); - const dirWithFixedPath = dir; - Object.defineProperty(dirWithFixedPath, `path`, { - value: p, - configurable: true, - writable: true - }); - return dirWithFixedPath; - } - async readPromise(fd, buffer, offset = 0, length = 0, position = -1) { - return await new Promise((resolve, reject) => { - this.realFs.read(fd, buffer, offset, length, position, (error, bytesRead) => { - if (error) { - reject(error); - } else { - resolve(bytesRead); - } - }); - }); - } - readSync(fd, buffer, offset, length, position) { - return this.realFs.readSync(fd, buffer, offset, length, position); - } - async writePromise(fd, buffer, offset, length, position) { - return await new Promise((resolve, reject) => { - if (typeof buffer === `string`) { - return this.realFs.write(fd, buffer, offset, this.makeCallback(resolve, reject)); - } else { - return this.realFs.write(fd, buffer, offset, length, position, this.makeCallback(resolve, reject)); - } - }); - } - writeSync(fd, buffer, offset, length, position) { - if (typeof buffer === `string`) { - return this.realFs.writeSync(fd, buffer, offset); - } else { - return this.realFs.writeSync(fd, buffer, offset, length, position); - } - } - async closePromise(fd) { - await new Promise((resolve, reject) => { - this.realFs.close(fd, this.makeCallback(resolve, reject)); - }); - } - closeSync(fd) { - this.realFs.closeSync(fd); - } - createReadStream(p, opts) { - const realPath = p !== null ? npath.fromPortablePath(p) : p; - return this.realFs.createReadStream(realPath, opts); - } - createWriteStream(p, opts) { - const realPath = p !== null ? npath.fromPortablePath(p) : p; - return this.realFs.createWriteStream(realPath, opts); - } - async realpathPromise(p) { - return await new Promise((resolve, reject) => { - this.realFs.realpath(npath.fromPortablePath(p), {}, this.makeCallback(resolve, reject)); - }).then((path) => { - return npath.toPortablePath(path); - }); - } - realpathSync(p) { - return npath.toPortablePath(this.realFs.realpathSync(npath.fromPortablePath(p), {})); - } - async existsPromise(p) { - return await new Promise((resolve) => { - this.realFs.exists(npath.fromPortablePath(p), resolve); - }); - } - accessSync(p, mode) { - return this.realFs.accessSync(npath.fromPortablePath(p), mode); - } - async accessPromise(p, mode) { - return await new Promise((resolve, reject) => { - this.realFs.access(npath.fromPortablePath(p), mode, this.makeCallback(resolve, reject)); - }); - } - existsSync(p) { - return this.realFs.existsSync(npath.fromPortablePath(p)); - } - async statPromise(p, opts) { - return await new Promise((resolve, reject) => { - if (opts) { - this.realFs.stat(npath.fromPortablePath(p), opts, this.makeCallback(resolve, reject)); - } else { - this.realFs.stat(npath.fromPortablePath(p), this.makeCallback(resolve, reject)); - } - }); - } - statSync(p, opts) { - if (opts) { - return this.realFs.statSync(npath.fromPortablePath(p), opts); - } else { - return this.realFs.statSync(npath.fromPortablePath(p)); - } - } - async fstatPromise(fd, opts) { - return await new Promise((resolve, reject) => { - if (opts) { - this.realFs.fstat(fd, opts, this.makeCallback(resolve, reject)); - } else { - this.realFs.fstat(fd, this.makeCallback(resolve, reject)); - } - }); - } - fstatSync(fd, opts) { - if (opts) { - return this.realFs.fstatSync(fd, opts); - } else { - return this.realFs.fstatSync(fd); - } - } - async lstatPromise(p, opts) { - return await new Promise((resolve, reject) => { - if (opts) { - this.realFs.lstat(npath.fromPortablePath(p), opts, this.makeCallback(resolve, reject)); - } else { - this.realFs.lstat(npath.fromPortablePath(p), this.makeCallback(resolve, reject)); - } - }); - } - lstatSync(p, opts) { - if (opts) { - return this.realFs.lstatSync(npath.fromPortablePath(p), opts); - } else { - return this.realFs.lstatSync(npath.fromPortablePath(p)); - } - } - async fchmodPromise(fd, mask) { - return await new Promise((resolve, reject) => { - this.realFs.fchmod(fd, mask, this.makeCallback(resolve, reject)); - }); - } - fchmodSync(fd, mask) { - return this.realFs.fchmodSync(fd, mask); - } - async chmodPromise(p, mask) { - return await new Promise((resolve, reject) => { - this.realFs.chmod(npath.fromPortablePath(p), mask, this.makeCallback(resolve, reject)); - }); - } - chmodSync(p, mask) { - return this.realFs.chmodSync(npath.fromPortablePath(p), mask); - } - async fchownPromise(fd, uid, gid) { - return await new Promise((resolve, reject) => { - this.realFs.fchown(fd, uid, gid, this.makeCallback(resolve, reject)); - }); - } - fchownSync(fd, uid, gid) { - return this.realFs.fchownSync(fd, uid, gid); - } - async chownPromise(p, uid, gid) { - return await new Promise((resolve, reject) => { - this.realFs.chown(npath.fromPortablePath(p), uid, gid, this.makeCallback(resolve, reject)); - }); - } - chownSync(p, uid, gid) { - return this.realFs.chownSync(npath.fromPortablePath(p), uid, gid); - } - async renamePromise(oldP, newP) { - return await new Promise((resolve, reject) => { - this.realFs.rename(npath.fromPortablePath(oldP), npath.fromPortablePath(newP), this.makeCallback(resolve, reject)); - }); - } - renameSync(oldP, newP) { - return this.realFs.renameSync(npath.fromPortablePath(oldP), npath.fromPortablePath(newP)); - } - async copyFilePromise(sourceP, destP, flags = 0) { - return await new Promise((resolve, reject) => { - this.realFs.copyFile(npath.fromPortablePath(sourceP), npath.fromPortablePath(destP), flags, this.makeCallback(resolve, reject)); - }); - } - copyFileSync(sourceP, destP, flags = 0) { - return this.realFs.copyFileSync(npath.fromPortablePath(sourceP), npath.fromPortablePath(destP), flags); - } - async appendFilePromise(p, content, opts) { - return await new Promise((resolve, reject) => { - const fsNativePath = typeof p === `string` ? npath.fromPortablePath(p) : p; - if (opts) { - this.realFs.appendFile(fsNativePath, content, opts, this.makeCallback(resolve, reject)); - } else { - this.realFs.appendFile(fsNativePath, content, this.makeCallback(resolve, reject)); - } - }); - } - appendFileSync(p, content, opts) { - const fsNativePath = typeof p === `string` ? npath.fromPortablePath(p) : p; - if (opts) { - this.realFs.appendFileSync(fsNativePath, content, opts); - } else { - this.realFs.appendFileSync(fsNativePath, content); - } - } - async writeFilePromise(p, content, opts) { - return await new Promise((resolve, reject) => { - const fsNativePath = typeof p === `string` ? npath.fromPortablePath(p) : p; - if (opts) { - this.realFs.writeFile(fsNativePath, content, opts, this.makeCallback(resolve, reject)); - } else { - this.realFs.writeFile(fsNativePath, content, this.makeCallback(resolve, reject)); - } - }); - } - writeFileSync(p, content, opts) { - const fsNativePath = typeof p === `string` ? npath.fromPortablePath(p) : p; - if (opts) { - this.realFs.writeFileSync(fsNativePath, content, opts); - } else { - this.realFs.writeFileSync(fsNativePath, content); - } - } - async unlinkPromise(p) { - return await new Promise((resolve, reject) => { - this.realFs.unlink(npath.fromPortablePath(p), this.makeCallback(resolve, reject)); - }); - } - unlinkSync(p) { - return this.realFs.unlinkSync(npath.fromPortablePath(p)); - } - async utimesPromise(p, atime, mtime) { - return await new Promise((resolve, reject) => { - this.realFs.utimes(npath.fromPortablePath(p), atime, mtime, this.makeCallback(resolve, reject)); - }); - } - utimesSync(p, atime, mtime) { - this.realFs.utimesSync(npath.fromPortablePath(p), atime, mtime); - } - async lutimesPromise(p, atime, mtime) { - return await new Promise((resolve, reject) => { - this.realFs.lutimes(npath.fromPortablePath(p), atime, mtime, this.makeCallback(resolve, reject)); - }); - } - lutimesSync(p, atime, mtime) { - this.realFs.lutimesSync(npath.fromPortablePath(p), atime, mtime); - } - async mkdirPromise(p, opts) { - return await new Promise((resolve, reject) => { - this.realFs.mkdir(npath.fromPortablePath(p), opts, this.makeCallback(resolve, reject)); - }); - } - mkdirSync(p, opts) { - return this.realFs.mkdirSync(npath.fromPortablePath(p), opts); - } - async rmdirPromise(p, opts) { - return await new Promise((resolve, reject) => { - if (opts) { - this.realFs.rmdir(npath.fromPortablePath(p), opts, this.makeCallback(resolve, reject)); - } else { - this.realFs.rmdir(npath.fromPortablePath(p), this.makeCallback(resolve, reject)); - } - }); - } - rmdirSync(p, opts) { - return this.realFs.rmdirSync(npath.fromPortablePath(p), opts); - } - async rmPromise(p, opts) { - return await new Promise((resolve, reject) => { - if (opts) { - this.realFs.rm(npath.fromPortablePath(p), opts, this.makeCallback(resolve, reject)); - } else { - this.realFs.rm(npath.fromPortablePath(p), this.makeCallback(resolve, reject)); - } - }); - } - rmSync(p, opts) { - return this.realFs.rmSync(npath.fromPortablePath(p), opts); - } - async linkPromise(existingP, newP) { - return await new Promise((resolve, reject) => { - this.realFs.link(npath.fromPortablePath(existingP), npath.fromPortablePath(newP), this.makeCallback(resolve, reject)); - }); - } - linkSync(existingP, newP) { - return this.realFs.linkSync(npath.fromPortablePath(existingP), npath.fromPortablePath(newP)); - } - async symlinkPromise(target, p, type) { - return await new Promise((resolve, reject) => { - this.realFs.symlink(npath.fromPortablePath(target.replace(/\/+$/, ``)), npath.fromPortablePath(p), type, this.makeCallback(resolve, reject)); - }); - } - symlinkSync(target, p, type) { - return this.realFs.symlinkSync(npath.fromPortablePath(target.replace(/\/+$/, ``)), npath.fromPortablePath(p), type); - } - async readFilePromise(p, encoding) { - return await new Promise((resolve, reject) => { - const fsNativePath = typeof p === `string` ? npath.fromPortablePath(p) : p; - this.realFs.readFile(fsNativePath, encoding, this.makeCallback(resolve, reject)); - }); - } - readFileSync(p, encoding) { - const fsNativePath = typeof p === `string` ? npath.fromPortablePath(p) : p; - return this.realFs.readFileSync(fsNativePath, encoding); - } - async readdirPromise(p, opts) { - return await new Promise((resolve, reject) => { - if (opts) { - if (opts.recursive && process.platform === `win32`) { - if (opts.withFileTypes) { - this.realFs.readdir(npath.fromPortablePath(p), opts, this.makeCallback((results) => resolve(results.map(direntToPortable)), reject)); - } else { - this.realFs.readdir(npath.fromPortablePath(p), opts, this.makeCallback((results) => resolve(results.map(npath.toPortablePath)), reject)); - } - } else { - this.realFs.readdir(npath.fromPortablePath(p), opts, this.makeCallback(resolve, reject)); - } - } else { - this.realFs.readdir(npath.fromPortablePath(p), this.makeCallback(resolve, reject)); - } - }); - } - readdirSync(p, opts) { - if (opts) { - if (opts.recursive && process.platform === `win32`) { - if (opts.withFileTypes) { - return this.realFs.readdirSync(npath.fromPortablePath(p), opts).map(direntToPortable); - } else { - return this.realFs.readdirSync(npath.fromPortablePath(p), opts).map(npath.toPortablePath); - } - } else { - return this.realFs.readdirSync(npath.fromPortablePath(p), opts); - } - } else { - return this.realFs.readdirSync(npath.fromPortablePath(p)); - } - } - async readlinkPromise(p) { - return await new Promise((resolve, reject) => { - this.realFs.readlink(npath.fromPortablePath(p), this.makeCallback(resolve, reject)); - }).then((path) => { - return npath.toPortablePath(path); - }); - } - readlinkSync(p) { - return npath.toPortablePath(this.realFs.readlinkSync(npath.fromPortablePath(p))); - } - async truncatePromise(p, len) { - return await new Promise((resolve, reject) => { - this.realFs.truncate(npath.fromPortablePath(p), len, this.makeCallback(resolve, reject)); - }); - } - truncateSync(p, len) { - return this.realFs.truncateSync(npath.fromPortablePath(p), len); - } - async ftruncatePromise(fd, len) { - return await new Promise((resolve, reject) => { - this.realFs.ftruncate(fd, len, this.makeCallback(resolve, reject)); - }); - } - ftruncateSync(fd, len) { - return this.realFs.ftruncateSync(fd, len); - } - watch(p, a, b) { - return this.realFs.watch( - npath.fromPortablePath(p), - a, - b - ); - } - watchFile(p, a, b) { - return this.realFs.watchFile( - npath.fromPortablePath(p), - a, - b - ); - } - unwatchFile(p, cb) { - return this.realFs.unwatchFile(npath.fromPortablePath(p), cb); - } - makeCallback(resolve, reject) { - return (err, result) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }; - } -} - -const MOUNT_MASK = 4278190080; -class MountFS extends BasePortableFakeFS { - constructor({ baseFs = new NodeFS(), filter = null, magicByte = 42, maxOpenFiles = Infinity, useCache = true, maxAge = 5e3, typeCheck = fs.constants.S_IFREG, getMountPoint, factoryPromise, factorySync }) { - if (Math.floor(magicByte) !== magicByte || !(magicByte > 1 && magicByte <= 127)) - throw new Error(`The magic byte must be set to a round value between 1 and 127 included`); - super(); - this.fdMap = /* @__PURE__ */ new Map(); - this.nextFd = 3; - this.isMount = /* @__PURE__ */ new Set(); - this.notMount = /* @__PURE__ */ new Set(); - this.realPaths = /* @__PURE__ */ new Map(); - this.limitOpenFilesTimeout = null; - this.baseFs = baseFs; - this.mountInstances = useCache ? /* @__PURE__ */ new Map() : null; - this.factoryPromise = factoryPromise; - this.factorySync = factorySync; - this.filter = filter; - this.getMountPoint = getMountPoint; - this.magic = magicByte << 24; - this.maxAge = maxAge; - this.maxOpenFiles = maxOpenFiles; - this.typeCheck = typeCheck; - } - getExtractHint(hints) { - return this.baseFs.getExtractHint(hints); - } - getRealPath() { - return this.baseFs.getRealPath(); - } - saveAndClose() { - unwatchAllFiles(this); - if (this.mountInstances) { - for (const [path, { childFs }] of this.mountInstances.entries()) { - childFs.saveAndClose?.(); - this.mountInstances.delete(path); - } - } - } - discardAndClose() { - unwatchAllFiles(this); - if (this.mountInstances) { - for (const [path, { childFs }] of this.mountInstances.entries()) { - childFs.discardAndClose?.(); - this.mountInstances.delete(path); - } - } - } - resolve(p) { - return this.baseFs.resolve(p); - } - remapFd(mountFs, fd) { - const remappedFd = this.nextFd++ | this.magic; - this.fdMap.set(remappedFd, [mountFs, fd]); - return remappedFd; - } - async openPromise(p, flags, mode) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.openPromise(p, flags, mode); - }, async (mountFs, { subPath }) => { - return this.remapFd(mountFs, await mountFs.openPromise(subPath, flags, mode)); - }); - } - openSync(p, flags, mode) { - return this.makeCallSync(p, () => { - return this.baseFs.openSync(p, flags, mode); - }, (mountFs, { subPath }) => { - return this.remapFd(mountFs, mountFs.openSync(subPath, flags, mode)); - }); - } - async opendirPromise(p, opts) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.opendirPromise(p, opts); - }, async (mountFs, { subPath }) => { - return await mountFs.opendirPromise(subPath, opts); - }, { - requireSubpath: false - }); - } - opendirSync(p, opts) { - return this.makeCallSync(p, () => { - return this.baseFs.opendirSync(p, opts); - }, (mountFs, { subPath }) => { - return mountFs.opendirSync(subPath, opts); - }, { - requireSubpath: false - }); - } - async readPromise(fd, buffer, offset, length, position) { - if ((fd & MOUNT_MASK) !== this.magic) - return await this.baseFs.readPromise(fd, buffer, offset, length, position); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`read`); - const [mountFs, realFd] = entry; - return await mountFs.readPromise(realFd, buffer, offset, length, position); - } - readSync(fd, buffer, offset, length, position) { - if ((fd & MOUNT_MASK) !== this.magic) - return this.baseFs.readSync(fd, buffer, offset, length, position); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`readSync`); - const [mountFs, realFd] = entry; - return mountFs.readSync(realFd, buffer, offset, length, position); - } - async writePromise(fd, buffer, offset, length, position) { - if ((fd & MOUNT_MASK) !== this.magic) { - if (typeof buffer === `string`) { - return await this.baseFs.writePromise(fd, buffer, offset); - } else { - return await this.baseFs.writePromise(fd, buffer, offset, length, position); - } - } - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`write`); - const [mountFs, realFd] = entry; - if (typeof buffer === `string`) { - return await mountFs.writePromise(realFd, buffer, offset); - } else { - return await mountFs.writePromise(realFd, buffer, offset, length, position); - } - } - writeSync(fd, buffer, offset, length, position) { - if ((fd & MOUNT_MASK) !== this.magic) { - if (typeof buffer === `string`) { - return this.baseFs.writeSync(fd, buffer, offset); - } else { - return this.baseFs.writeSync(fd, buffer, offset, length, position); - } - } - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`writeSync`); - const [mountFs, realFd] = entry; - if (typeof buffer === `string`) { - return mountFs.writeSync(realFd, buffer, offset); - } else { - return mountFs.writeSync(realFd, buffer, offset, length, position); - } - } - async closePromise(fd) { - if ((fd & MOUNT_MASK) !== this.magic) - return await this.baseFs.closePromise(fd); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`close`); - this.fdMap.delete(fd); - const [mountFs, realFd] = entry; - return await mountFs.closePromise(realFd); - } - closeSync(fd) { - if ((fd & MOUNT_MASK) !== this.magic) - return this.baseFs.closeSync(fd); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`closeSync`); - this.fdMap.delete(fd); - const [mountFs, realFd] = entry; - return mountFs.closeSync(realFd); - } - createReadStream(p, opts) { - if (p === null) - return this.baseFs.createReadStream(p, opts); - return this.makeCallSync(p, () => { - return this.baseFs.createReadStream(p, opts); - }, (mountFs, { archivePath, subPath }) => { - const stream = mountFs.createReadStream(subPath, opts); - stream.path = npath.fromPortablePath(this.pathUtils.join(archivePath, subPath)); - return stream; - }); - } - createWriteStream(p, opts) { - if (p === null) - return this.baseFs.createWriteStream(p, opts); - return this.makeCallSync(p, () => { - return this.baseFs.createWriteStream(p, opts); - }, (mountFs, { subPath }) => { - return mountFs.createWriteStream(subPath, opts); - }); - } - async realpathPromise(p) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.realpathPromise(p); - }, async (mountFs, { archivePath, subPath }) => { - let realArchivePath = this.realPaths.get(archivePath); - if (typeof realArchivePath === `undefined`) { - realArchivePath = await this.baseFs.realpathPromise(archivePath); - this.realPaths.set(archivePath, realArchivePath); - } - return this.pathUtils.join(realArchivePath, this.pathUtils.relative(PortablePath.root, await mountFs.realpathPromise(subPath))); - }); - } - realpathSync(p) { - return this.makeCallSync(p, () => { - return this.baseFs.realpathSync(p); - }, (mountFs, { archivePath, subPath }) => { - let realArchivePath = this.realPaths.get(archivePath); - if (typeof realArchivePath === `undefined`) { - realArchivePath = this.baseFs.realpathSync(archivePath); - this.realPaths.set(archivePath, realArchivePath); - } - return this.pathUtils.join(realArchivePath, this.pathUtils.relative(PortablePath.root, mountFs.realpathSync(subPath))); - }); - } - async existsPromise(p) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.existsPromise(p); - }, async (mountFs, { subPath }) => { - return await mountFs.existsPromise(subPath); - }); - } - existsSync(p) { - return this.makeCallSync(p, () => { - return this.baseFs.existsSync(p); - }, (mountFs, { subPath }) => { - return mountFs.existsSync(subPath); - }); - } - async accessPromise(p, mode) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.accessPromise(p, mode); - }, async (mountFs, { subPath }) => { - return await mountFs.accessPromise(subPath, mode); - }); - } - accessSync(p, mode) { - return this.makeCallSync(p, () => { - return this.baseFs.accessSync(p, mode); - }, (mountFs, { subPath }) => { - return mountFs.accessSync(subPath, mode); - }); - } - async statPromise(p, opts) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.statPromise(p, opts); - }, async (mountFs, { subPath }) => { - return await mountFs.statPromise(subPath, opts); - }); - } - statSync(p, opts) { - return this.makeCallSync(p, () => { - return this.baseFs.statSync(p, opts); - }, (mountFs, { subPath }) => { - return mountFs.statSync(subPath, opts); - }); - } - async fstatPromise(fd, opts) { - if ((fd & MOUNT_MASK) !== this.magic) - return this.baseFs.fstatPromise(fd, opts); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`fstat`); - const [mountFs, realFd] = entry; - return mountFs.fstatPromise(realFd, opts); - } - fstatSync(fd, opts) { - if ((fd & MOUNT_MASK) !== this.magic) - return this.baseFs.fstatSync(fd, opts); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`fstatSync`); - const [mountFs, realFd] = entry; - return mountFs.fstatSync(realFd, opts); - } - async lstatPromise(p, opts) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.lstatPromise(p, opts); - }, async (mountFs, { subPath }) => { - return await mountFs.lstatPromise(subPath, opts); - }); - } - lstatSync(p, opts) { - return this.makeCallSync(p, () => { - return this.baseFs.lstatSync(p, opts); - }, (mountFs, { subPath }) => { - return mountFs.lstatSync(subPath, opts); - }); - } - async fchmodPromise(fd, mask) { - if ((fd & MOUNT_MASK) !== this.magic) - return this.baseFs.fchmodPromise(fd, mask); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`fchmod`); - const [mountFs, realFd] = entry; - return mountFs.fchmodPromise(realFd, mask); - } - fchmodSync(fd, mask) { - if ((fd & MOUNT_MASK) !== this.magic) - return this.baseFs.fchmodSync(fd, mask); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`fchmodSync`); - const [mountFs, realFd] = entry; - return mountFs.fchmodSync(realFd, mask); - } - async chmodPromise(p, mask) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.chmodPromise(p, mask); - }, async (mountFs, { subPath }) => { - return await mountFs.chmodPromise(subPath, mask); - }); - } - chmodSync(p, mask) { - return this.makeCallSync(p, () => { - return this.baseFs.chmodSync(p, mask); - }, (mountFs, { subPath }) => { - return mountFs.chmodSync(subPath, mask); - }); - } - async fchownPromise(fd, uid, gid) { - if ((fd & MOUNT_MASK) !== this.magic) - return this.baseFs.fchownPromise(fd, uid, gid); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`fchown`); - const [zipFs, realFd] = entry; - return zipFs.fchownPromise(realFd, uid, gid); - } - fchownSync(fd, uid, gid) { - if ((fd & MOUNT_MASK) !== this.magic) - return this.baseFs.fchownSync(fd, uid, gid); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`fchownSync`); - const [zipFs, realFd] = entry; - return zipFs.fchownSync(realFd, uid, gid); - } - async chownPromise(p, uid, gid) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.chownPromise(p, uid, gid); - }, async (mountFs, { subPath }) => { - return await mountFs.chownPromise(subPath, uid, gid); - }); - } - chownSync(p, uid, gid) { - return this.makeCallSync(p, () => { - return this.baseFs.chownSync(p, uid, gid); - }, (mountFs, { subPath }) => { - return mountFs.chownSync(subPath, uid, gid); - }); - } - async renamePromise(oldP, newP) { - return await this.makeCallPromise(oldP, async () => { - return await this.makeCallPromise(newP, async () => { - return await this.baseFs.renamePromise(oldP, newP); - }, async () => { - throw Object.assign(new Error(`EEXDEV: cross-device link not permitted`), { code: `EEXDEV` }); - }); - }, async (mountFsO, { subPath: subPathO }) => { - return await this.makeCallPromise(newP, async () => { - throw Object.assign(new Error(`EEXDEV: cross-device link not permitted`), { code: `EEXDEV` }); - }, async (mountFsN, { subPath: subPathN }) => { - if (mountFsO !== mountFsN) { - throw Object.assign(new Error(`EEXDEV: cross-device link not permitted`), { code: `EEXDEV` }); - } else { - return await mountFsO.renamePromise(subPathO, subPathN); - } - }); - }); - } - renameSync(oldP, newP) { - return this.makeCallSync(oldP, () => { - return this.makeCallSync(newP, () => { - return this.baseFs.renameSync(oldP, newP); - }, () => { - throw Object.assign(new Error(`EEXDEV: cross-device link not permitted`), { code: `EEXDEV` }); - }); - }, (mountFsO, { subPath: subPathO }) => { - return this.makeCallSync(newP, () => { - throw Object.assign(new Error(`EEXDEV: cross-device link not permitted`), { code: `EEXDEV` }); - }, (mountFsN, { subPath: subPathN }) => { - if (mountFsO !== mountFsN) { - throw Object.assign(new Error(`EEXDEV: cross-device link not permitted`), { code: `EEXDEV` }); - } else { - return mountFsO.renameSync(subPathO, subPathN); - } - }); - }); - } - async copyFilePromise(sourceP, destP, flags = 0) { - const fallback = async (sourceFs, sourceP2, destFs, destP2) => { - if ((flags & fs.constants.COPYFILE_FICLONE_FORCE) !== 0) - throw Object.assign(new Error(`EXDEV: cross-device clone not permitted, copyfile '${sourceP2}' -> ${destP2}'`), { code: `EXDEV` }); - if (flags & fs.constants.COPYFILE_EXCL && await this.existsPromise(sourceP2)) - throw Object.assign(new Error(`EEXIST: file already exists, copyfile '${sourceP2}' -> '${destP2}'`), { code: `EEXIST` }); - let content; - try { - content = await sourceFs.readFilePromise(sourceP2); - } catch (error) { - throw Object.assign(new Error(`EINVAL: invalid argument, copyfile '${sourceP2}' -> '${destP2}'`), { code: `EINVAL` }); - } - await destFs.writeFilePromise(destP2, content); - }; - return await this.makeCallPromise(sourceP, async () => { - return await this.makeCallPromise(destP, async () => { - return await this.baseFs.copyFilePromise(sourceP, destP, flags); - }, async (mountFsD, { subPath: subPathD }) => { - return await fallback(this.baseFs, sourceP, mountFsD, subPathD); - }); - }, async (mountFsS, { subPath: subPathS }) => { - return await this.makeCallPromise(destP, async () => { - return await fallback(mountFsS, subPathS, this.baseFs, destP); - }, async (mountFsD, { subPath: subPathD }) => { - if (mountFsS !== mountFsD) { - return await fallback(mountFsS, subPathS, mountFsD, subPathD); - } else { - return await mountFsS.copyFilePromise(subPathS, subPathD, flags); - } - }); - }); - } - copyFileSync(sourceP, destP, flags = 0) { - const fallback = (sourceFs, sourceP2, destFs, destP2) => { - if ((flags & fs.constants.COPYFILE_FICLONE_FORCE) !== 0) - throw Object.assign(new Error(`EXDEV: cross-device clone not permitted, copyfile '${sourceP2}' -> ${destP2}'`), { code: `EXDEV` }); - if (flags & fs.constants.COPYFILE_EXCL && this.existsSync(sourceP2)) - throw Object.assign(new Error(`EEXIST: file already exists, copyfile '${sourceP2}' -> '${destP2}'`), { code: `EEXIST` }); - let content; - try { - content = sourceFs.readFileSync(sourceP2); - } catch (error) { - throw Object.assign(new Error(`EINVAL: invalid argument, copyfile '${sourceP2}' -> '${destP2}'`), { code: `EINVAL` }); - } - destFs.writeFileSync(destP2, content); - }; - return this.makeCallSync(sourceP, () => { - return this.makeCallSync(destP, () => { - return this.baseFs.copyFileSync(sourceP, destP, flags); - }, (mountFsD, { subPath: subPathD }) => { - return fallback(this.baseFs, sourceP, mountFsD, subPathD); - }); - }, (mountFsS, { subPath: subPathS }) => { - return this.makeCallSync(destP, () => { - return fallback(mountFsS, subPathS, this.baseFs, destP); - }, (mountFsD, { subPath: subPathD }) => { - if (mountFsS !== mountFsD) { - return fallback(mountFsS, subPathS, mountFsD, subPathD); - } else { - return mountFsS.copyFileSync(subPathS, subPathD, flags); - } - }); - }); - } - async appendFilePromise(p, content, opts) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.appendFilePromise(p, content, opts); - }, async (mountFs, { subPath }) => { - return await mountFs.appendFilePromise(subPath, content, opts); - }); - } - appendFileSync(p, content, opts) { - return this.makeCallSync(p, () => { - return this.baseFs.appendFileSync(p, content, opts); - }, (mountFs, { subPath }) => { - return mountFs.appendFileSync(subPath, content, opts); - }); - } - async writeFilePromise(p, content, opts) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.writeFilePromise(p, content, opts); - }, async (mountFs, { subPath }) => { - return await mountFs.writeFilePromise(subPath, content, opts); - }); - } - writeFileSync(p, content, opts) { - return this.makeCallSync(p, () => { - return this.baseFs.writeFileSync(p, content, opts); - }, (mountFs, { subPath }) => { - return mountFs.writeFileSync(subPath, content, opts); - }); - } - async unlinkPromise(p) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.unlinkPromise(p); - }, async (mountFs, { subPath }) => { - return await mountFs.unlinkPromise(subPath); - }); - } - unlinkSync(p) { - return this.makeCallSync(p, () => { - return this.baseFs.unlinkSync(p); - }, (mountFs, { subPath }) => { - return mountFs.unlinkSync(subPath); - }); - } - async utimesPromise(p, atime, mtime) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.utimesPromise(p, atime, mtime); - }, async (mountFs, { subPath }) => { - return await mountFs.utimesPromise(subPath, atime, mtime); - }); - } - utimesSync(p, atime, mtime) { - return this.makeCallSync(p, () => { - return this.baseFs.utimesSync(p, atime, mtime); - }, (mountFs, { subPath }) => { - return mountFs.utimesSync(subPath, atime, mtime); - }); - } - async lutimesPromise(p, atime, mtime) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.lutimesPromise(p, atime, mtime); - }, async (mountFs, { subPath }) => { - return await mountFs.lutimesPromise(subPath, atime, mtime); - }); - } - lutimesSync(p, atime, mtime) { - return this.makeCallSync(p, () => { - return this.baseFs.lutimesSync(p, atime, mtime); - }, (mountFs, { subPath }) => { - return mountFs.lutimesSync(subPath, atime, mtime); - }); - } - async mkdirPromise(p, opts) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.mkdirPromise(p, opts); - }, async (mountFs, { subPath }) => { - return await mountFs.mkdirPromise(subPath, opts); - }); - } - mkdirSync(p, opts) { - return this.makeCallSync(p, () => { - return this.baseFs.mkdirSync(p, opts); - }, (mountFs, { subPath }) => { - return mountFs.mkdirSync(subPath, opts); - }); - } - async rmdirPromise(p, opts) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.rmdirPromise(p, opts); - }, async (mountFs, { subPath }) => { - return await mountFs.rmdirPromise(subPath, opts); - }); - } - rmdirSync(p, opts) { - return this.makeCallSync(p, () => { - return this.baseFs.rmdirSync(p, opts); - }, (mountFs, { subPath }) => { - return mountFs.rmdirSync(subPath, opts); - }); - } - async rmPromise(p, opts) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.rmPromise(p, opts); - }, async (mountFs, { subPath }) => { - return await mountFs.rmPromise(subPath, opts); - }); - } - rmSync(p, opts) { - return this.makeCallSync(p, () => { - return this.baseFs.rmSync(p, opts); - }, (mountFs, { subPath }) => { - return mountFs.rmSync(subPath, opts); - }); - } - async linkPromise(existingP, newP) { - return await this.makeCallPromise(newP, async () => { - return await this.baseFs.linkPromise(existingP, newP); - }, async (mountFs, { subPath }) => { - return await mountFs.linkPromise(existingP, subPath); - }); - } - linkSync(existingP, newP) { - return this.makeCallSync(newP, () => { - return this.baseFs.linkSync(existingP, newP); - }, (mountFs, { subPath }) => { - return mountFs.linkSync(existingP, subPath); - }); - } - async symlinkPromise(target, p, type) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.symlinkPromise(target, p, type); - }, async (mountFs, { subPath }) => { - return await mountFs.symlinkPromise(target, subPath); - }); - } - symlinkSync(target, p, type) { - return this.makeCallSync(p, () => { - return this.baseFs.symlinkSync(target, p, type); - }, (mountFs, { subPath }) => { - return mountFs.symlinkSync(target, subPath); - }); - } - async readFilePromise(p, encoding) { - return this.makeCallPromise(p, async () => { - return await this.baseFs.readFilePromise(p, encoding); - }, async (mountFs, { subPath }) => { - return await mountFs.readFilePromise(subPath, encoding); - }); - } - readFileSync(p, encoding) { - return this.makeCallSync(p, () => { - return this.baseFs.readFileSync(p, encoding); - }, (mountFs, { subPath }) => { - return mountFs.readFileSync(subPath, encoding); - }); - } - async readdirPromise(p, opts) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.readdirPromise(p, opts); - }, async (mountFs, { subPath }) => { - return await mountFs.readdirPromise(subPath, opts); - }, { - requireSubpath: false - }); - } - readdirSync(p, opts) { - return this.makeCallSync(p, () => { - return this.baseFs.readdirSync(p, opts); - }, (mountFs, { subPath }) => { - return mountFs.readdirSync(subPath, opts); - }, { - requireSubpath: false - }); - } - async readlinkPromise(p) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.readlinkPromise(p); - }, async (mountFs, { subPath }) => { - return await mountFs.readlinkPromise(subPath); - }); - } - readlinkSync(p) { - return this.makeCallSync(p, () => { - return this.baseFs.readlinkSync(p); - }, (mountFs, { subPath }) => { - return mountFs.readlinkSync(subPath); - }); - } - async truncatePromise(p, len) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.truncatePromise(p, len); - }, async (mountFs, { subPath }) => { - return await mountFs.truncatePromise(subPath, len); - }); - } - truncateSync(p, len) { - return this.makeCallSync(p, () => { - return this.baseFs.truncateSync(p, len); - }, (mountFs, { subPath }) => { - return mountFs.truncateSync(subPath, len); - }); - } - async ftruncatePromise(fd, len) { - if ((fd & MOUNT_MASK) !== this.magic) - return this.baseFs.ftruncatePromise(fd, len); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`ftruncate`); - const [mountFs, realFd] = entry; - return mountFs.ftruncatePromise(realFd, len); - } - ftruncateSync(fd, len) { - if ((fd & MOUNT_MASK) !== this.magic) - return this.baseFs.ftruncateSync(fd, len); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`ftruncateSync`); - const [mountFs, realFd] = entry; - return mountFs.ftruncateSync(realFd, len); - } - watch(p, a, b) { - return this.makeCallSync(p, () => { - return this.baseFs.watch( - p, - a, - b - ); - }, (mountFs, { subPath }) => { - return mountFs.watch( - subPath, - a, - b - ); - }); - } - watchFile(p, a, b) { - return this.makeCallSync(p, () => { - return this.baseFs.watchFile( - p, - a, - b - ); - }, () => { - return watchFile(this, p, a, b); - }); - } - unwatchFile(p, cb) { - return this.makeCallSync(p, () => { - return this.baseFs.unwatchFile(p, cb); - }, () => { - return unwatchFile(this, p, cb); - }); - } - async makeCallPromise(p, discard, accept, { requireSubpath = true } = {}) { - if (typeof p !== `string`) - return await discard(); - const normalizedP = this.resolve(p); - const mountInfo = this.findMount(normalizedP); - if (!mountInfo) - return await discard(); - if (requireSubpath && mountInfo.subPath === `/`) - return await discard(); - return await this.getMountPromise(mountInfo.archivePath, async (mountFs) => await accept(mountFs, mountInfo)); - } - makeCallSync(p, discard, accept, { requireSubpath = true } = {}) { - if (typeof p !== `string`) - return discard(); - const normalizedP = this.resolve(p); - const mountInfo = this.findMount(normalizedP); - if (!mountInfo) - return discard(); - if (requireSubpath && mountInfo.subPath === `/`) - return discard(); - return this.getMountSync(mountInfo.archivePath, (mountFs) => accept(mountFs, mountInfo)); - } - findMount(p) { - if (this.filter && !this.filter.test(p)) - return null; - let filePath = ``; - while (true) { - const pathPartWithArchive = p.substring(filePath.length); - const mountPoint = this.getMountPoint(pathPartWithArchive, filePath); - if (!mountPoint) - return null; - filePath = this.pathUtils.join(filePath, mountPoint); - if (!this.isMount.has(filePath)) { - if (this.notMount.has(filePath)) - continue; - try { - if (this.typeCheck !== null && (this.baseFs.lstatSync(filePath).mode & fs.constants.S_IFMT) !== this.typeCheck) { - this.notMount.add(filePath); - continue; - } - } catch { - return null; - } - this.isMount.add(filePath); - } - return { - archivePath: filePath, - subPath: this.pathUtils.join(PortablePath.root, p.substring(filePath.length)) - }; - } - } - limitOpenFiles(max) { - if (this.mountInstances === null) - return; - const now = Date.now(); - let nextExpiresAt = now + this.maxAge; - let closeCount = max === null ? 0 : this.mountInstances.size - max; - for (const [path, { childFs, expiresAt, refCount }] of this.mountInstances.entries()) { - if (refCount !== 0 || childFs.hasOpenFileHandles?.()) { - continue; - } else if (now >= expiresAt) { - childFs.saveAndClose?.(); - this.mountInstances.delete(path); - closeCount -= 1; - continue; - } else if (max === null || closeCount <= 0) { - nextExpiresAt = expiresAt; - break; - } - childFs.saveAndClose?.(); - this.mountInstances.delete(path); - closeCount -= 1; - } - if (this.limitOpenFilesTimeout === null && (max === null && this.mountInstances.size > 0 || max !== null) && isFinite(nextExpiresAt)) { - this.limitOpenFilesTimeout = setTimeout(() => { - this.limitOpenFilesTimeout = null; - this.limitOpenFiles(null); - }, nextExpiresAt - now).unref(); - } - } - async getMountPromise(p, accept) { - if (this.mountInstances) { - let cachedMountFs = this.mountInstances.get(p); - if (!cachedMountFs) { - const createFsInstance = await this.factoryPromise(this.baseFs, p); - cachedMountFs = this.mountInstances.get(p); - if (!cachedMountFs) { - cachedMountFs = { - childFs: createFsInstance(), - expiresAt: 0, - refCount: 0 - }; - } - } - this.mountInstances.delete(p); - this.limitOpenFiles(this.maxOpenFiles - 1); - this.mountInstances.set(p, cachedMountFs); - cachedMountFs.expiresAt = Date.now() + this.maxAge; - cachedMountFs.refCount += 1; - try { - return await accept(cachedMountFs.childFs); - } finally { - cachedMountFs.refCount -= 1; - } - } else { - const mountFs = (await this.factoryPromise(this.baseFs, p))(); - try { - return await accept(mountFs); - } finally { - mountFs.saveAndClose?.(); - } - } - } - getMountSync(p, accept) { - if (this.mountInstances) { - let cachedMountFs = this.mountInstances.get(p); - if (!cachedMountFs) { - cachedMountFs = { - childFs: this.factorySync(this.baseFs, p), - expiresAt: 0, - refCount: 0 - }; - } - this.mountInstances.delete(p); - this.limitOpenFiles(this.maxOpenFiles - 1); - this.mountInstances.set(p, cachedMountFs); - cachedMountFs.expiresAt = Date.now() + this.maxAge; - return accept(cachedMountFs.childFs); - } else { - const childFs = this.factorySync(this.baseFs, p); - try { - return accept(childFs); - } finally { - childFs.saveAndClose?.(); - } - } - } -} - -class PosixFS extends ProxiedFS { - constructor(baseFs) { - super(npath); - this.baseFs = baseFs; - } - mapFromBase(path) { - return npath.fromPortablePath(path); - } - mapToBase(path) { - return npath.toPortablePath(path); - } -} - -const NUMBER_REGEXP = /^[0-9]+$/; -const VIRTUAL_REGEXP = /^(\/(?:[^/]+\/)*?(?:\$\$virtual|__virtual__))((?:\/((?:[^/]+-)?[a-f0-9]+)(?:\/([^/]+))?)?((?:\/.*)?))$/; -const VALID_COMPONENT = /^([^/]+-)?[a-f0-9]+$/; -class VirtualFS extends ProxiedFS { - constructor({ baseFs = new NodeFS() } = {}) { - super(ppath); - this.baseFs = baseFs; - } - static makeVirtualPath(base, component, to) { - if (ppath.basename(base) !== `__virtual__`) - throw new Error(`Assertion failed: Virtual folders must be named "__virtual__"`); - if (!ppath.basename(component).match(VALID_COMPONENT)) - throw new Error(`Assertion failed: Virtual components must be ended by an hexadecimal hash`); - const target = ppath.relative(ppath.dirname(base), to); - const segments = target.split(`/`); - let depth = 0; - while (depth < segments.length && segments[depth] === `..`) - depth += 1; - const finalSegments = segments.slice(depth); - const fullVirtualPath = ppath.join(base, component, String(depth), ...finalSegments); - return fullVirtualPath; - } - static resolveVirtual(p) { - const match = p.match(VIRTUAL_REGEXP); - if (!match || !match[3] && match[5]) - return p; - const target = ppath.dirname(match[1]); - if (!match[3] || !match[4]) - return target; - const isnum = NUMBER_REGEXP.test(match[4]); - if (!isnum) - return p; - const depth = Number(match[4]); - const backstep = `../`.repeat(depth); - const subpath = match[5] || `.`; - return VirtualFS.resolveVirtual(ppath.join(target, backstep, subpath)); - } - getExtractHint(hints) { - return this.baseFs.getExtractHint(hints); - } - getRealPath() { - return this.baseFs.getRealPath(); - } - realpathSync(p) { - const match = p.match(VIRTUAL_REGEXP); - if (!match) - return this.baseFs.realpathSync(p); - if (!match[5]) - return p; - const realpath = this.baseFs.realpathSync(this.mapToBase(p)); - return VirtualFS.makeVirtualPath(match[1], match[3], realpath); - } - async realpathPromise(p) { - const match = p.match(VIRTUAL_REGEXP); - if (!match) - return await this.baseFs.realpathPromise(p); - if (!match[5]) - return p; - const realpath = await this.baseFs.realpathPromise(this.mapToBase(p)); - return VirtualFS.makeVirtualPath(match[1], match[3], realpath); - } - mapToBase(p) { - if (p === ``) - return p; - if (this.pathUtils.isAbsolute(p)) - return VirtualFS.resolveVirtual(p); - const resolvedRoot = VirtualFS.resolveVirtual(this.baseFs.resolve(PortablePath.dot)); - const resolvedP = VirtualFS.resolveVirtual(this.baseFs.resolve(p)); - return ppath.relative(resolvedRoot, resolvedP) || PortablePath.dot; - } - mapFromBase(p) { - return p; - } -} - -const URL = Number(process.versions.node.split('.', 1)[0]) < 20 ? url.URL : globalThis.URL; - -class NodePathFS extends ProxiedFS { - constructor(baseFs) { - super(npath); - this.baseFs = baseFs; - } - mapFromBase(path) { - return path; - } - mapToBase(path) { - if (typeof path === `string`) - return path; - if (path instanceof URL) - return url.fileURLToPath(path); - if (Buffer.isBuffer(path)) { - const str = path.toString(); - if (!isUtf8(path, str)) - throw new Error(`Non-utf8 buffers are not supported at the moment. Please upvote the following issue if you encounter this error: https://github.com/yarnpkg/berry/issues/4942`); - return str; - } - throw new Error(`Unsupported path type: ${nodeUtils.inspect(path)}`); - } -} -function isUtf8(buf, str) { - if (typeof buffer__default.default.isUtf8 !== `undefined`) - return buffer__default.default.isUtf8(buf); - return Buffer.byteLength(str) === buf.byteLength; -} - -var _a, _b, _c, _d; -const kBaseFs = Symbol(`kBaseFs`); -const kFd = Symbol(`kFd`); -const kClosePromise = Symbol(`kClosePromise`); -const kCloseResolve = Symbol(`kCloseResolve`); -const kCloseReject = Symbol(`kCloseReject`); -const kRefs = Symbol(`kRefs`); -const kRef = Symbol(`kRef`); -const kUnref = Symbol(`kUnref`); -class FileHandle { - constructor(fd, baseFs) { - this[_a] = 1; - this[_b] = void 0; - this[_c] = void 0; - this[_d] = void 0; - this[kBaseFs] = baseFs; - this[kFd] = fd; - } - get fd() { - return this[kFd]; - } - async appendFile(data, options) { - try { - this[kRef](this.appendFile); - const encoding = (typeof options === `string` ? options : options?.encoding) ?? void 0; - return await this[kBaseFs].appendFilePromise(this.fd, data, encoding ? { encoding } : void 0); - } finally { - this[kUnref](); - } - } - async chown(uid, gid) { - try { - this[kRef](this.chown); - return await this[kBaseFs].fchownPromise(this.fd, uid, gid); - } finally { - this[kUnref](); - } - } - async chmod(mode) { - try { - this[kRef](this.chmod); - return await this[kBaseFs].fchmodPromise(this.fd, mode); - } finally { - this[kUnref](); - } - } - createReadStream(options) { - return this[kBaseFs].createReadStream(null, { ...options, fd: this.fd }); - } - createWriteStream(options) { - return this[kBaseFs].createWriteStream(null, { ...options, fd: this.fd }); - } - datasync() { - throw new Error(`Method not implemented.`); - } - sync() { - throw new Error(`Method not implemented.`); - } - async read(bufferOrOptions, offset, length, position) { - try { - this[kRef](this.read); - let buffer; - if (!Buffer.isBuffer(bufferOrOptions)) { - bufferOrOptions ??= {}; - buffer = bufferOrOptions.buffer ?? Buffer.alloc(16384); - offset = bufferOrOptions.offset || 0; - length = bufferOrOptions.length ?? buffer.byteLength; - position = bufferOrOptions.position ?? null; - } else { - buffer = bufferOrOptions; - } - offset ??= 0; - length ??= 0; - if (length === 0) { - return { - bytesRead: length, - buffer - }; - } - const bytesRead = await this[kBaseFs].readPromise(this.fd, buffer, offset, length, position); - return { - bytesRead, - buffer - }; - } finally { - this[kUnref](); - } - } - async readFile(options) { - try { - this[kRef](this.readFile); - const encoding = (typeof options === `string` ? options : options?.encoding) ?? void 0; - return await this[kBaseFs].readFilePromise(this.fd, encoding); - } finally { - this[kUnref](); - } - } - readLines(options) { - return readline.createInterface({ - input: this.createReadStream(options), - crlfDelay: Infinity - }); - } - async stat(opts) { - try { - this[kRef](this.stat); - return await this[kBaseFs].fstatPromise(this.fd, opts); - } finally { - this[kUnref](); - } - } - async truncate(len) { - try { - this[kRef](this.truncate); - return await this[kBaseFs].ftruncatePromise(this.fd, len); - } finally { - this[kUnref](); - } - } - utimes(atime, mtime) { - throw new Error(`Method not implemented.`); - } - async writeFile(data, options) { - try { - this[kRef](this.writeFile); - const encoding = (typeof options === `string` ? options : options?.encoding) ?? void 0; - await this[kBaseFs].writeFilePromise(this.fd, data, encoding); - } finally { - this[kUnref](); - } - } - async write(...args) { - try { - this[kRef](this.write); - if (ArrayBuffer.isView(args[0])) { - const [buffer, offset, length, position] = args; - const bytesWritten = await this[kBaseFs].writePromise(this.fd, buffer, offset ?? void 0, length ?? void 0, position ?? void 0); - return { bytesWritten, buffer }; - } else { - const [data, position, encoding] = args; - const bytesWritten = await this[kBaseFs].writePromise(this.fd, data, position, encoding); - return { bytesWritten, buffer: data }; - } - } finally { - this[kUnref](); - } - } - async writev(buffers, position) { - try { - this[kRef](this.writev); - let bytesWritten = 0; - if (typeof position !== `undefined`) { - for (const buffer of buffers) { - const writeResult = await this.write(buffer, void 0, void 0, position); - bytesWritten += writeResult.bytesWritten; - position += writeResult.bytesWritten; - } - } else { - for (const buffer of buffers) { - const writeResult = await this.write(buffer); - bytesWritten += writeResult.bytesWritten; - } - } - return { - buffers, - bytesWritten - }; - } finally { - this[kUnref](); - } - } - readv(buffers, position) { - throw new Error(`Method not implemented.`); - } - close() { - if (this[kFd] === -1) - return Promise.resolve(); - if (this[kClosePromise]) - return this[kClosePromise]; - this[kRefs]--; - if (this[kRefs] === 0) { - const fd = this[kFd]; - this[kFd] = -1; - this[kClosePromise] = this[kBaseFs].closePromise(fd).finally(() => { - this[kClosePromise] = void 0; - }); - } else { - this[kClosePromise] = new Promise((resolve, reject) => { - this[kCloseResolve] = resolve; - this[kCloseReject] = reject; - }).finally(() => { - this[kClosePromise] = void 0; - this[kCloseReject] = void 0; - this[kCloseResolve] = void 0; - }); - } - return this[kClosePromise]; - } - [(_a = kRefs, _b = kClosePromise, _c = kCloseResolve, _d = kCloseReject, kRef)](caller) { - if (this[kFd] === -1) { - const err = new Error(`file closed`); - err.code = `EBADF`; - err.syscall = caller.name; - throw err; - } - this[kRefs]++; - } - [kUnref]() { - this[kRefs]--; - if (this[kRefs] === 0) { - const fd = this[kFd]; - this[kFd] = -1; - this[kBaseFs].closePromise(fd).then(this[kCloseResolve], this[kCloseReject]); - } - } -} - -const SYNC_IMPLEMENTATIONS = /* @__PURE__ */ new Set([ - `accessSync`, - `appendFileSync`, - `createReadStream`, - `createWriteStream`, - `chmodSync`, - `fchmodSync`, - `chownSync`, - `fchownSync`, - `closeSync`, - `copyFileSync`, - `linkSync`, - `lstatSync`, - `fstatSync`, - `lutimesSync`, - `mkdirSync`, - `openSync`, - `opendirSync`, - `readlinkSync`, - `readFileSync`, - `readdirSync`, - `readlinkSync`, - `realpathSync`, - `renameSync`, - `rmdirSync`, - `rmSync`, - `statSync`, - `symlinkSync`, - `truncateSync`, - `ftruncateSync`, - `unlinkSync`, - `unwatchFile`, - `utimesSync`, - `watch`, - `watchFile`, - `writeFileSync`, - `writeSync` -]); -const ASYNC_IMPLEMENTATIONS = /* @__PURE__ */ new Set([ - `accessPromise`, - `appendFilePromise`, - `fchmodPromise`, - `chmodPromise`, - `fchownPromise`, - `chownPromise`, - `closePromise`, - `copyFilePromise`, - `linkPromise`, - `fstatPromise`, - `lstatPromise`, - `lutimesPromise`, - `mkdirPromise`, - `openPromise`, - `opendirPromise`, - `readdirPromise`, - `realpathPromise`, - `readFilePromise`, - `readdirPromise`, - `readlinkPromise`, - `renamePromise`, - `rmdirPromise`, - `rmPromise`, - `statPromise`, - `symlinkPromise`, - `truncatePromise`, - `ftruncatePromise`, - `unlinkPromise`, - `utimesPromise`, - `writeFilePromise`, - `writeSync` -]); -function patchFs(patchedFs, fakeFs) { - fakeFs = new NodePathFS(fakeFs); - const setupFn = (target, name, replacement) => { - const orig = target[name]; - target[name] = replacement; - if (typeof orig?.[nodeUtils.promisify.custom] !== `undefined`) { - replacement[nodeUtils.promisify.custom] = orig[nodeUtils.promisify.custom]; - } - }; - { - setupFn(patchedFs, `exists`, (p, ...args) => { - const hasCallback = typeof args[args.length - 1] === `function`; - const callback = hasCallback ? args.pop() : () => { - }; - process.nextTick(() => { - fakeFs.existsPromise(p).then((exists) => { - callback(exists); - }, () => { - callback(false); - }); - }); - }); - setupFn(patchedFs, `read`, (...args) => { - let [fd, buffer, offset, length, position, callback] = args; - if (args.length <= 3) { - let options = {}; - if (args.length < 3) { - callback = args[1]; - } else { - options = args[1]; - callback = args[2]; - } - ({ - buffer = Buffer.alloc(16384), - offset = 0, - length = buffer.byteLength, - position - } = options); - } - if (offset == null) - offset = 0; - length |= 0; - if (length === 0) { - process.nextTick(() => { - callback(null, 0, buffer); - }); - return; - } - if (position == null) - position = -1; - process.nextTick(() => { - fakeFs.readPromise(fd, buffer, offset, length, position).then((bytesRead) => { - callback(null, bytesRead, buffer); - }, (error) => { - callback(error, 0, buffer); - }); - }); - }); - for (const fnName of ASYNC_IMPLEMENTATIONS) { - const origName = fnName.replace(/Promise$/, ``); - if (typeof patchedFs[origName] === `undefined`) - continue; - const fakeImpl = fakeFs[fnName]; - if (typeof fakeImpl === `undefined`) - continue; - const wrapper = (...args) => { - const hasCallback = typeof args[args.length - 1] === `function`; - const callback = hasCallback ? args.pop() : () => { - }; - process.nextTick(() => { - fakeImpl.apply(fakeFs, args).then((result) => { - callback(null, result); - }, (error) => { - callback(error); - }); - }); - }; - setupFn(patchedFs, origName, wrapper); - } - patchedFs.realpath.native = patchedFs.realpath; - } - { - setupFn(patchedFs, `existsSync`, (p) => { - try { - return fakeFs.existsSync(p); - } catch (error) { - return false; - } - }); - setupFn(patchedFs, `readSync`, (...args) => { - let [fd, buffer, offset, length, position] = args; - if (args.length <= 3) { - const options = args[2] || {}; - ({ offset = 0, length = buffer.byteLength, position } = options); - } - if (offset == null) - offset = 0; - length |= 0; - if (length === 0) - return 0; - if (position == null) - position = -1; - return fakeFs.readSync(fd, buffer, offset, length, position); - }); - for (const fnName of SYNC_IMPLEMENTATIONS) { - const origName = fnName; - if (typeof patchedFs[origName] === `undefined`) - continue; - const fakeImpl = fakeFs[fnName]; - if (typeof fakeImpl === `undefined`) - continue; - setupFn(patchedFs, origName, fakeImpl.bind(fakeFs)); - } - patchedFs.realpathSync.native = patchedFs.realpathSync; - } - { - const patchedFsPromises = patchedFs.promises; - for (const fnName of ASYNC_IMPLEMENTATIONS) { - const origName = fnName.replace(/Promise$/, ``); - if (typeof patchedFsPromises[origName] === `undefined`) - continue; - const fakeImpl = fakeFs[fnName]; - if (typeof fakeImpl === `undefined`) - continue; - if (fnName === `open`) - continue; - setupFn(patchedFsPromises, origName, (pathLike, ...args) => { - if (pathLike instanceof FileHandle) { - return pathLike[origName].apply(pathLike, args); - } else { - return fakeImpl.call(fakeFs, pathLike, ...args); - } - }); - } - setupFn(patchedFsPromises, `open`, async (...args) => { - const fd = await fakeFs.openPromise(...args); - return new FileHandle(fd, fakeFs); - }); - } - { - patchedFs.read[nodeUtils.promisify.custom] = async (fd, buffer, ...args) => { - const res = fakeFs.readPromise(fd, buffer, ...args); - return { bytesRead: await res, buffer }; - }; - patchedFs.write[nodeUtils.promisify.custom] = async (fd, buffer, ...args) => { - const res = fakeFs.writePromise(fd, buffer, ...args); - return { bytesWritten: await res, buffer }; - }; - } -} - -let cachedInstance; -let registeredFactory = () => { - throw new Error(`Assertion failed: No libzip instance is available, and no factory was configured`); -}; -function setFactory(factory) { - registeredFactory = factory; -} -function getInstance() { - if (typeof cachedInstance === `undefined`) - cachedInstance = registeredFactory(); - return cachedInstance; -} - -var libzipSync = {exports: {}}; - -(function (module, exports) { -var frozenFs = Object.assign({}, fs__default.default); -var createModule = function() { - var _scriptDir = void 0; - if (typeof __filename !== "undefined") - _scriptDir = _scriptDir || __filename; - return function(createModule2) { - createModule2 = createModule2 || {}; - var Module = typeof createModule2 !== "undefined" ? createModule2 : {}; - var readyPromiseResolve, readyPromiseReject; - Module["ready"] = new Promise(function(resolve, reject) { - readyPromiseResolve = resolve; - readyPromiseReject = reject; - }); - var moduleOverrides = {}; - var key; - for (key in Module) { - if (Module.hasOwnProperty(key)) { - moduleOverrides[key] = Module[key]; - } - } - var scriptDirectory = ""; - function locateFile(path) { - if (Module["locateFile"]) { - return Module["locateFile"](path, scriptDirectory); - } - return scriptDirectory + path; - } - var read_, readBinary; - var nodeFS; - var nodePath; - { - { - scriptDirectory = __dirname + "/"; - } - read_ = function shell_read(filename, binary) { - var ret = tryParseAsDataURI(filename); - if (ret) { - return binary ? ret : ret.toString(); - } - if (!nodeFS) - nodeFS = frozenFs; - if (!nodePath) - nodePath = path__default.default; - filename = nodePath["normalize"](filename); - return nodeFS["readFileSync"](filename, binary ? null : "utf8"); - }; - readBinary = function readBinary2(filename) { - var ret = read_(filename, true); - if (!ret.buffer) { - ret = new Uint8Array(ret); - } - assert(ret.buffer); - return ret; - }; - if (process["argv"].length > 1) { - process["argv"][1].replace(/\\/g, "/"); - } - process["argv"].slice(2); - Module["inspect"] = function() { - return "[Emscripten Module object]"; - }; - } - Module["print"] || console.log.bind(console); - var err = Module["printErr"] || console.warn.bind(console); - for (key in moduleOverrides) { - if (moduleOverrides.hasOwnProperty(key)) { - Module[key] = moduleOverrides[key]; - } - } - moduleOverrides = null; - if (Module["arguments"]) - ; - if (Module["thisProgram"]) - ; - if (Module["quit"]) - ; - var wasmBinary; - if (Module["wasmBinary"]) - wasmBinary = Module["wasmBinary"]; - Module["noExitRuntime"] || true; - if (typeof WebAssembly !== "object") { - abort("no native wasm support detected"); - } - function getValue(ptr, type, noSafe) { - type = type || "i8"; - if (type.charAt(type.length - 1) === "*") - type = "i32"; - switch (type) { - case "i1": - return HEAP8[ptr >> 0]; - case "i8": - return HEAP8[ptr >> 0]; - case "i16": - return LE_HEAP_LOAD_I16((ptr >> 1) * 2); - case "i32": - return LE_HEAP_LOAD_I32((ptr >> 2) * 4); - case "i64": - return LE_HEAP_LOAD_I32((ptr >> 2) * 4); - case "float": - return LE_HEAP_LOAD_F32((ptr >> 2) * 4); - case "double": - return LE_HEAP_LOAD_F64((ptr >> 3) * 8); - default: - abort("invalid type for getValue: " + type); - } - return null; - } - var wasmMemory; - var ABORT = false; - function assert(condition, text) { - if (!condition) { - abort("Assertion failed: " + text); - } - } - function getCFunc(ident) { - var func = Module["_" + ident]; - assert( - func, - "Cannot call unknown function " + ident + ", make sure it is exported" - ); - return func; - } - function ccall(ident, returnType, argTypes, args, opts) { - var toC = { - string: function(str) { - var ret2 = 0; - if (str !== null && str !== void 0 && str !== 0) { - var len = (str.length << 2) + 1; - ret2 = stackAlloc(len); - stringToUTF8(str, ret2, len); - } - return ret2; - }, - array: function(arr) { - var ret2 = stackAlloc(arr.length); - writeArrayToMemory(arr, ret2); - return ret2; - } - }; - function convertReturnValue(ret2) { - if (returnType === "string") - return UTF8ToString(ret2); - if (returnType === "boolean") - return Boolean(ret2); - return ret2; - } - var func = getCFunc(ident); - var cArgs = []; - var stack = 0; - if (args) { - for (var i = 0; i < args.length; i++) { - var converter = toC[argTypes[i]]; - if (converter) { - if (stack === 0) - stack = stackSave(); - cArgs[i] = converter(args[i]); - } else { - cArgs[i] = args[i]; - } - } - } - var ret = func.apply(null, cArgs); - ret = convertReturnValue(ret); - if (stack !== 0) - stackRestore(stack); - return ret; - } - function cwrap(ident, returnType, argTypes, opts) { - argTypes = argTypes || []; - var numericArgs = argTypes.every(function(type) { - return type === "number"; - }); - var numericRet = returnType !== "string"; - if (numericRet && numericArgs && !opts) { - return getCFunc(ident); - } - return function() { - return ccall(ident, returnType, argTypes, arguments); - }; - } - var UTF8Decoder = new TextDecoder("utf8"); - function UTF8ToString(ptr, maxBytesToRead) { - if (!ptr) - return ""; - var maxPtr = ptr + maxBytesToRead; - for (var end = ptr; !(end >= maxPtr) && HEAPU8[end]; ) - ++end; - return UTF8Decoder.decode(HEAPU8.subarray(ptr, end)); - } - function stringToUTF8Array(str, heap, outIdx, maxBytesToWrite) { - if (!(maxBytesToWrite > 0)) - return 0; - var startIdx = outIdx; - var endIdx = outIdx + maxBytesToWrite - 1; - for (var i = 0; i < str.length; ++i) { - var u = str.charCodeAt(i); - if (u >= 55296 && u <= 57343) { - var u1 = str.charCodeAt(++i); - u = 65536 + ((u & 1023) << 10) | u1 & 1023; - } - if (u <= 127) { - if (outIdx >= endIdx) - break; - heap[outIdx++] = u; - } else if (u <= 2047) { - if (outIdx + 1 >= endIdx) - break; - heap[outIdx++] = 192 | u >> 6; - heap[outIdx++] = 128 | u & 63; - } else if (u <= 65535) { - if (outIdx + 2 >= endIdx) - break; - heap[outIdx++] = 224 | u >> 12; - heap[outIdx++] = 128 | u >> 6 & 63; - heap[outIdx++] = 128 | u & 63; - } else { - if (outIdx + 3 >= endIdx) - break; - heap[outIdx++] = 240 | u >> 18; - heap[outIdx++] = 128 | u >> 12 & 63; - heap[outIdx++] = 128 | u >> 6 & 63; - heap[outIdx++] = 128 | u & 63; - } - } - heap[outIdx] = 0; - return outIdx - startIdx; - } - function stringToUTF8(str, outPtr, maxBytesToWrite) { - return stringToUTF8Array(str, HEAPU8, outPtr, maxBytesToWrite); - } - function lengthBytesUTF8(str) { - var len = 0; - for (var i = 0; i < str.length; ++i) { - var u = str.charCodeAt(i); - if (u >= 55296 && u <= 57343) - u = 65536 + ((u & 1023) << 10) | str.charCodeAt(++i) & 1023; - if (u <= 127) - ++len; - else if (u <= 2047) - len += 2; - else if (u <= 65535) - len += 3; - else - len += 4; - } - return len; - } - function allocateUTF8(str) { - var size = lengthBytesUTF8(str) + 1; - var ret = _malloc(size); - if (ret) - stringToUTF8Array(str, HEAP8, ret, size); - return ret; - } - function writeArrayToMemory(array, buffer2) { - HEAP8.set(array, buffer2); - } - function alignUp(x, multiple) { - if (x % multiple > 0) { - x += multiple - x % multiple; - } - return x; - } - var buffer, HEAP8, HEAPU8; - var HEAP_DATA_VIEW; - function updateGlobalBufferAndViews(buf) { - buffer = buf; - Module["HEAP_DATA_VIEW"] = HEAP_DATA_VIEW = new DataView(buf); - Module["HEAP8"] = HEAP8 = new Int8Array(buf); - Module["HEAP16"] = new Int16Array(buf); - Module["HEAP32"] = new Int32Array(buf); - Module["HEAPU8"] = HEAPU8 = new Uint8Array(buf); - Module["HEAPU16"] = new Uint16Array(buf); - Module["HEAPU32"] = new Uint32Array(buf); - Module["HEAPF32"] = new Float32Array(buf); - Module["HEAPF64"] = new Float64Array(buf); - } - Module["INITIAL_MEMORY"] || 16777216; - var wasmTable; - var __ATPRERUN__ = []; - var __ATINIT__ = []; - var __ATPOSTRUN__ = []; - function preRun() { - if (Module["preRun"]) { - if (typeof Module["preRun"] == "function") - Module["preRun"] = [Module["preRun"]]; - while (Module["preRun"].length) { - addOnPreRun(Module["preRun"].shift()); - } - } - callRuntimeCallbacks(__ATPRERUN__); - } - function initRuntime() { - callRuntimeCallbacks(__ATINIT__); - } - function postRun() { - if (Module["postRun"]) { - if (typeof Module["postRun"] == "function") - Module["postRun"] = [Module["postRun"]]; - while (Module["postRun"].length) { - addOnPostRun(Module["postRun"].shift()); - } - } - callRuntimeCallbacks(__ATPOSTRUN__); - } - function addOnPreRun(cb) { - __ATPRERUN__.unshift(cb); - } - function addOnInit(cb) { - __ATINIT__.unshift(cb); - } - function addOnPostRun(cb) { - __ATPOSTRUN__.unshift(cb); - } - var runDependencies = 0; - var dependenciesFulfilled = null; - function addRunDependency(id) { - runDependencies++; - if (Module["monitorRunDependencies"]) { - Module["monitorRunDependencies"](runDependencies); - } - } - function removeRunDependency(id) { - runDependencies--; - if (Module["monitorRunDependencies"]) { - Module["monitorRunDependencies"](runDependencies); - } - if (runDependencies == 0) { - if (dependenciesFulfilled) { - var callback = dependenciesFulfilled; - dependenciesFulfilled = null; - callback(); - } - } - } - Module["preloadedImages"] = {}; - Module["preloadedAudios"] = {}; - function abort(what) { - if (Module["onAbort"]) { - Module["onAbort"](what); - } - what += ""; - err(what); - ABORT = true; - what = "abort(" + what + "). Build with -s ASSERTIONS=1 for more info."; - var e = new WebAssembly.RuntimeError(what); - readyPromiseReject(e); - throw e; - } - var dataURIPrefix = "data:application/octet-stream;base64,"; - function isDataURI(filename) { - return filename.startsWith(dataURIPrefix); - } - var wasmBinaryFile = "data:application/octet-stream;base64,AGFzbQEAAAAB/wEkYAN/f38Bf2ABfwF/YAJ/fwF/YAF/AGAEf39/fwF/YAN/f38AYAV/f39/fwF/YAJ/fwBgBH9/f38AYAABf2AFf39/fn8BfmAEf35/fwF/YAR/f35/AX5gAn9+AX9gA398fwBgA39/fgF/YAF/AX5gBn9/f39/fwF/YAN/fn8Bf2AEf39/fwF+YAV/f35/fwF/YAR/f35/AX9gA39/fgF+YAJ/fgBgAn9/AX5gBX9/f39/AGADf35/AX5gBX5+f35/AX5gA39/fwF+YAZ/fH9/f38Bf2AAAGAHf35/f39+fwF/YAV/fn9/fwF/YAV/f39/fwF+YAJ+fwF/YAJ/fAACJQYBYQFhAAMBYQFiAAEBYQFjAAABYQFkAAEBYQFlAAIBYQFmAAED5wHlAQMAAwEDAwEHDAgDFgcNEgEDDRcFAQ8DEAUQAwIBAhgECxkEAQMBBQsFAwMDARACBAMAAggLBwEAAwADGgQDGwYGABwBBgMTFBEHBwcVCx4ABAgHBAICAgAfAQICAgIGFSAAIQAiAAIBBgIHAg0LEw0FAQUCACMDAQAUAAAGBQECBQUDCwsSAgEDBQIHAQEICAACCQQEAQABCAEBCQoBAwkBAQEBBgEGBgYABAIEBAQGEQQEAAARAAEDCQEJAQAJCQkBAQECCgoAAAMPAQEBAwACAgICBQIABwAKBgwHAAADAgICBQEEBQFwAT8/BQcBAYACgIACBgkBfwFBgInBAgsH+gEzAWcCAAFoAFQBaQDqAQFqALsBAWsAwQEBbACpAQFtAKgBAW4ApwEBbwClA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ABC/////w83AyggAEIANwMYIABCADcDIAulAQEBf0HYABAJIgFFBEBBAA8LAkAgAARAIAEgAEHYABAHGgwBCyABQgA3AyAgAUEANgIYIAFC/////w83AxAgAUEAOwEMIAFBv4YoNgIIIAFBAToABiABQQA6AAQgAUIANwNIIAFBgIDYjXg2AkQgAUIANwMoIAFCADcDMCABQgA3AzggAUFAa0EAOwEAIAFCADcDUAsgAUEBOgAFIAFBADYCACABC1gCAn4BfwJAAkAgAC0AAEUNACAAKQMQIgMgAq18IgQgA1QNACAEIAApAwhYDQELIABBADoAAA8LIAAoAgQiBUUEQA8LIAAgBDcDECAFIAOnaiABIAIQBxoLlgEBAn8CQAJAIAJFBEAgAacQCSIFRQ0BQRgQCSIEDQIgBRAGDAELIAIhBUEYEAkiBA0BCyADBEAgA0EANgIEIANBDjYCAAtBAA8LIARCADcDECAEIAE3AwggBCAFNgIEIARBAToAACAEIAJFOgABIAAgBSABIAMQZUEASAR/IAQtAAEEQCAEKAIEEAYLIAQQBkEABSAECwubAgEDfyAALQAAQSBxRQRAAkAgASEDAkAgAiAAIgEoAhAiAAR/IAAFAn8gASABLQBKIgBBAWsgAHI6AEogASgCACIAQQhxBEAgASAAQSByNgIAQX8MAQsgAUIANwIEIAEgASgCLCIANgIcIAEgADYCFCABIAAgASgCMGo2AhBBAAsNASABKAIQCyABKAIUIgVrSwRAIAEgAyACIAEoAiQRAAAaDAILAn8gASwAS0F/SgRAIAIhAANAIAIgACIERQ0CGiADIARBAWsiAGotAABBCkcNAAsgASADIAQgASgCJBEAACAESQ0CIAMgBGohAyABKAIUIQUgAiAEawwBCyACCyEAIAUgAyAAEAcaIAEgASgCFCAAajYCFAsLCwvNBQEGfyAAKAIwIgNBhgJrIQYgACgCPCECIAMhAQNAIAAoAkQgAiAAKAJoIgRqayECIAEgBmogBE0EQCAAKAJIIgEgASADaiADEAcaAkAgAyAAKAJsIgFNBEAgACABIANrNgJsDAELIABCADcCbAsgACAAKAJoIANrIgE2AmggACAAKAJYIANrNgJYIAEgACgChC5JBEAgACABNgKELgsgAEH8gAEoAgARAwAgAiADaiECCwJAIAAoAgAiASgCBCIERQ0AIAAoAjwhBSAAIAIgBCACIARJGyICBH8gACgCSCAAKAJoaiAFaiEFIAEgBCACazYCBAJAAkACQAJAIAEoAhwiBCgCFEEBaw4CAQACCyAEQaABaiAFIAEoAgAgAkHcgAEoAgARCAAMAgsgASABKAIwIAUgASgCACACQcSAASgCABEEADYCMAwBCyAFIAEoAgAgAhAHGgsgASABKAIAIAJqNgIAIAEgASgCCCACajYCCCAAKAI8BSAFCyACaiICNgI8AkAgACgChC4iASACakEDSQ0AIAAoAmggAWshAQJAIAAoAnRBgQhPBEAgACAAIAAoAkggAWoiAi0AACACLQABIAAoAnwRAAA2AlQMAQsgAUUNACAAIAFBAWsgACgChAERAgAaCyAAKAKELiAAKAI8IgJBAUZrIgRFDQAgACABIAQgACgCgAERBQAgACAAKAKELiAEazYChC4gACgCPCECCyACQYUCSw0AIAAoAgAoAgRFDQAgACgCMCEBDAELCwJAIAAoAkQiAiAAKAJAIgNNDQAgAAJ/IAAoAjwgACgCaGoiASADSwRAIAAoAkggAWpBACACIAFrIgNBggIgA0GCAkkbIgMQGSABIANqDAELIAFBggJqIgEgA00NASAAKAJIIANqQQAgAiADayICIAEgA2siAyACIANJGyIDEBkgACgCQCADags2AkALC50CAQF/AkAgAAJ/IAAoAqAuIgFBwABGBEAgACgCBCAAKAIQaiAAKQOYLjcAACAAQgA3A5guIAAgACgCEEEIajYCEEEADAELIAFBIE4EQCAAKAIEIAAoAhBqIAApA5guPgAAIAAgAEGcLmo1AgA3A5guIAAgACgCEEEEajYCECAAIAAoAqAuQSBrIgE2AqAuCyABQRBOBEAgACgCBCAAKAIQaiAAKQOYLj0AACAAIAAoAhBBAmo2AhAgACAAKQOYLkIQiDcDmC4gACAAKAKgLkEQayIBNgKgLgsgAUEISA0BIAAgACgCECIBQQFqNgIQIAEgACgCBGogACkDmC48AAAgACAAKQOYLkIIiDcDm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AIAAtAABBAnFFDQELIAAoAjAQECAAQQA2AjAgAC0ABUUNAQsgAC0AAEEIcUUNAQsgACgCNBAcIABBADYCNCAALQAFRQ0BCyAALQAAQQRxRQ0BCyAAKAI4EBAgAEEANgI4IAAtAAVFDQELIAAtAABBgAFxRQ0BCyAAKAJUIgEEfyABQQAgARAiEBkgACgCVAVBAAsQBiAAQQA2AlQLC9wMAgl/AX4jAEFAaiIGJAACQAJAAkACQAJAIAEoAjBBABAjIgVBAkZBACABKAI4QQAQIyIEQQFGGw0AIAVBAUZBACAEQQJGGw0AIAVBAkciAw0BIARBAkcNAQsgASABLwEMQYAQcjsBDEEAIQMMAQsgASABLwEMQf/vA3E7AQxBACEFIANFBEBB9eABIAEoAjAgAEEIahBpIgVFDQILIAJBgAJxBEAgBSEDDAELIARBAkcEQCAFIQMMAQtB9cYBIAEoAjggAEEIahBpIgNFBEAgBRAcDAILIAMgBTYCAAsgASABLwEMQf7/A3EgAS8BUiIFQQBHcjsBDAJAAkACQAJAAn8CQAJAIAEpAyhC/v///w9WDQAgASkDIEL+////D1YNACACQYAEcUUNASABKQNIQv////8PVA0BCyAFQYECa0H//wNxQQNJIQdBAQwBCyAFQYECa0H//wNxIQQgAkGACnFBgApHDQEgBEEDSSEHQQALIQkgBkIcEBciBEUEQCAAQQhqIgAEQCAAQQA2AgQgAEEONgIACyADEBwMBQsgAkGACHEhBQJAAkAgAkGAAnEEQAJAIAUNACABKQMgQv////8PVg0AIAEpAyhCgICAgBBUDQMLIAQgASkDKBAYIAEpAyAhDAwBCwJAAkACQCAFDQAgASkDIEL/////D1YNACABKQMoIgxC/////w9WDQEgASkDSEKAgICAEFQNBAsgASkDKCIMQv////8PVA0BCyAEIAwQGAsgASkDICIMQv////8PWgRAIAQgDBAYCyABKQNIIgxC/////w9UDQELIAQgDBAYCyAELQAARQRAIABBCGoiAARAIABBADYCBCAAQRQ2AgALIAQQCCADEBwMBQtBASEKQQEgBC0AAAR+IAQpAxAFQgALp0H//wNxIAY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UIPg4ghHSABIBdrIgYgAjMBAiAaQX8gA3RBf3Otg3ynIgRPDQIgBCAGayIGIBlNDQEgBygCjEdFDQEgB0HR/gA2AgQgAEG5DDYCGAsgASECIAshBQwFCwJAIA5FBEAgDCARIAZraiEDDAELIAYgDk0EQCAMIA4gBmtqIQMMAQsgDCARIAYgDmsiBmtqIQMgBSAGTQ0AIAUgBmshBQJAAkAgASADTSABIA8gAWusIhogBq0iGyAaIBtUGyIapyIGaiICIANLcQ0AIAMgBmogAUsgASADT3ENACABIAMgBhAHGiACIQEMAQsgASADIAMgAWsiASABQR91IgFqIAFzIgIQByACaiEBIBogAq0iHn0iHFANACACIANqIQIDQAJAIBwgHiAcIB5UGyIbQiBUBEAgGyEaDAELIBsiGkIgfSIgQgWIQgF8QgODIh9QRQRAA0AgASACKQAANwAAIAEgAikAGDcAGCABIAIpABA3ABAgASACKQAINwAIIBpCIH0hGiACQSBqIQIgAUEgaiEBIB9CAX0iH0IAUg0ACwsgIELgAFQNAANAIAEgAikAADcAACABIAIpABg3ABggASACKQAQNwAQIAEgAikACDcACCABIAIpADg3ADggASACKQAwNwAwIAEgAikAKDcAKCABIAIpACA3ACAgASACKQBYNwBYIAEgAikAUDcAUCABIAIpAEg3AEggASACKQBANwBAIAEgAikAYDcAYCABIAIpAGg3AGggASACKQBwNwBwIAEgAikAeDcAeCACQYABaiECIAFBgAFqIQEgGkKAAX0iGkIfVg0ACwsgGkIQWgRAIAEgAikAADcAACABIAIpAAg3AAggGkIQfSEaIAJBEGohAiABQRBqIQELIBpCCFoEQCABIAIpAAA3AAAgGkIIfSEaIAJBCGohAiABQQhqIQELIBpCBFoEQCABIAIoAAA2AAAgGkIEfSEaIAJBBGohAiABQQRqIQELIBpCAloEQCABIAIvAAA7AAAgGkICfSEaIAJBAmohAiABQQJqIQELIBwgG30hHCAaUEUEQCABIAItAAA6AAAgAkEBaiECIAFBAWohAQsgHEIAUg0ACwsgDiEGIAwhAwsgBSAGSwRAAkACQCABIANNIAEg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gwDCyACIAQgAyADQR91IgFqIAFzIgEQByABaiECIBogAa0iHn0iHFANAiABIARqIQEDQAJAIBwgHiAcIB5UGyIbQiBUBEAgGyEaDAELIBsiGkIgfSIgQgWIQgF8QgODIh9QRQRAA0AgAiABKQAANwAAIAIgASkAGDcAGCACIAEpABA3ABAgAiABKQAINwAIIBpCIH0hGiABQSBqIQEgAkEgaiECIB9CAX0iH0IAUg0ACwsgIELgAFQNAANAIAIgASkAADcAACACIAEpABg3ABggAiABKQAQNwAQIAIgASkACDcACCACIAEpADg3ADggAiABKQAwNwAwIAIgASkAKDcAKCACIAEpACA3ACAgAiABKQBYNwBYIAIgASkAUDcAUCACIAEpAEg3AEggAiABKQBANwBAIAIgASkAYDcAYCACIAEpAGg3AGggAiABKQBwNwBwIAIgASkAeDcAeCABQYABaiEBIAJBgAFqIQIgGkKAAX0iGkIfVg0ACwsgGkIQWgRAIAIgASkAADcAACACIAEpAAg3AAggGkIQfSEaIAJBEGohAiABQRBqIQELIBpCCFoEQCACIAEpAAA3AAAgGkIIfSEaIAJBCGohAiABQQhqIQELIBpCBFoEQCACIAEoAAA2AAAgGkIEfSEaIAJBBGohAiABQQRqIQELIBpCAloEQCACIAEvAAA7AAAgGkICfSEaIAJBAmohAiABQQJqIQELIBwgG30hHCAaUEUEQCACIAEtAAA6AAAgAkEBaiECIAFBAWohAQsgHFBFDQALDAILAkAgASADTSABIA8gAWusIhogBa0iGyAaIBtUGyIapyIEaiICIANLcQ0AIAMgBGogAUsgASADT3ENACABIAMgBBAHGgwCCyABIAMgAyABayIBIAFBH3UiAWogAXMiARAHIAFqIQIgGiABrSIefSIcUA0BIAEgA2ohAQNAAkAgHCAeIBwgHlQbIhtCIFQEQCAbIRoMAQsgGyIaQiB9IiBCBYhCAXxCA4MiH1BFBEADQCACIAEpAAA3AAAgAiABKQAYNwAYIAIgASkAEDcAECACIAEpAAg3AAggGkIgfSEaIAFBIGohASACQSBqIQIgH0IBfSIfQgBSDQALCyAgQuAAVA0AA0AgAiABKQAANwAAIAIgASkAGDcAGCACIAEpABA3ABAgAiABKQAINwAIIAIgASkAODcAOCACIAEpADA3ADAgAiABKQAoNwAoIAIgASkAIDcAICACIAEpAFg3AFggAiABKQBQNwBQIAIgASkASDcASCACIAEpAEA3AEAgAiABKQBgNwBgIAIgASkAaDcAaCACIAEpAHA3AHAgAiABKQB4NwB4IAFBgAFqIQEgAkGAAWohAiAaQoABfSIaQh9WDQALCyAaQhBaBEAgAiABKQAANwAAIAIgASkACDcACCAaQhB9IRogAkEQaiECIAFBEGohAQsgGkIIWgRAIAIgASkAADcAACAaQgh9IRogAkEIaiECIAFBCGohAQsgGkIEWgRAIAIgASgAADYAACAaQgR9IRogAkEEaiECIAFBBGohAQsgGkICWgRAIAIgAS8AADsAACAaQgJ9IRogAkECaiECIAFBAmohAQsgHCAbfSEcIBpQRQRAIAIgAS0AADoAACACQQFqIQIgAUEBaiEBCyAcUEUNAAsMAQsCQAJAIBYEQAJAIAQgBUkEQCAHKAKYRyAESw0BCyABIARrIQMCQEEAIARrIgVBf0ogDyABa6wiGiAbIBogG1QbIhqnIgIgBUpxDQAgBUEBSCACIANqIAFLcQ0AIAEgAyACEAcgAmohAgwFCyABIAMgBCAEQR91IgFqIAFzIgEQByABaiECIBogAa0iHn0iHFANBCABIANqIQEDQAJAIBwgHiAcIB5UGyIbQiBUBEAgGyEaDAELIBsiGkIgfSIgQgWIQgF8QgODIh9QRQRAA0AgAiABKQAANwAAIAIgASkAGDcAGCACIAEpABA3ABAgAiABKQAINwAIIBpCIH0hGiABQSBqIQEgAkEgaiECIB9CAX0iH0IAUg0ACwsgIELgAFQNAANAIAIgASkAADcAACACIAEpABg3ABggAiABKQAQNwAQIAIgASkACDcACCACIAEpADg3ADggAiABKQAwNwAwIAIgASkAKDcAKCACIAEpACA3ACAgAiABKQBYNwBYIAIgASkAUDcAUCACIAEpAEg3AEggAiABKQBANwBAIAIgASkAYDcAYCACIAEpAGg3AGggAiABKQBwNwBwIAIgASkA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IQEgBSEDDAQLIAohASAFIQMMAwsgCiEBIAUhAwwCCyAKIQEgBSEDDAELIAohASAFIQMLAkACQCAGQRdNBEAgA0UNASADQQFrIQUgA0EHcSIEBEADQCABIAItAAA6AAAgA0EBayEDIAFBAWohASACQQFqIQIgBEEBayIEDQALCyAFQQdJDQEDQCABIAItAAA6AAAgASACLQABOgABIAEgAi0AAjoAAiABIAItAAM6AAMgASACLQAEOgAEIAEgAi0ABToABSABIAItAAY6AAYgASACLQAHOgAHIAFBCGohASACQQhqIQIgA0EIayIDDQALDAELIAMNAQsgASECDAELIAEgBCADED8hAgsgCyEFDAELIAEgAy0AAjoAACABQQFqIQILIAUgFE8NACACIBNJDQELCyAAIAI2AgwgACAFIAhBA3ZrIgE2AgAgACATIAJrQYMCajYCECAAIBQgAWtBDmo2AgQgByAIQQdxIgA2AogBIAcgHUJ/IACthkJ/hYM+AoQBC+cFAQR/IAMgAiACIANLGyEEIAAgAWshAgJAIABBB3FFDQAgBEUNACAAIAItAAA6AAAgA0EBayEGIAJBAWohAiAAQQFqIgdBB3FBACAEQQFrIgUbRQRAIAchACAFIQQgBiEDDAELIAAgAi0AADoAASADQQJrIQYgBEECayEFIAJBAWohAgJAIABBAmoiB0EHcUUNACAFRQ0AIAAgAi0AADoAAiADQQNrIQYgBEEDayEFIAJBAWohAgJAIABBA2oiB0EHcUUNACAFRQ0AIAAgAi0AADoAAyADQQRrIQYgBEEEayEFIAJBAWohAgJAIABBBGoiB0EHcUUNACAFRQ0AIAAgAi0AADoABCADQQVrIQYgBEEFayEFIAJBAWohAgJAIABBBWoiB0EHcUUNACAFRQ0AIAAgAi0AADoABSADQQZrIQYgBEEGayEFIAJBAWohAgJAIABBBmoiB0EHcUUNACAFRQ0AIAAgAi0AADoABiADQQdrIQYgBEEHayEFIAJBAWohAgJAIABBB2oiB0EHcUUNACAFRQ0AIAAgAi0AADoAByADQQhrIQMgBEEIayEEIABBCGohACACQQFqIQIMBgsgByEAIAUhBCAGIQMMBQsgBy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IIAJBADYCACACQgA3AxAgAkIANwMYIAJCADcDICACQgA3ACUgAFAEQCACDwsCQCAAQv////8AVg0AIACnQQR0EAkiA0UNACACIAM2AgBBACEBQgEhBANAIAMgAUEEdGoiAUIANwIAIAFCADcABSAAIARSBEAgBKchASAEQgF8IQQMAQsLIAIgADcDCCACIAA3AxAgAg8LIAEEQCABQQA2AgQgAUEONgIAC0EAEBAgAhAGQQAL7gECA38BfiMAQRBrIgQkAAJAIARBDGpCBBAXIgNFBEBBfyECDAELAkAgAQRAIAJBgAZxIQUDQAJAIAUgASgCBHFFDQACQCADKQMIQgBUBEAgA0EAOgAADAELIANCADcDECADQQE6AAALIAMgAS8BCBANIAMgAS8BChANIAMtAABFBEAgAEEIaiIABEAgAEEANgIEIABBFDYCAAtBfyECDAQLQX8hAiAAIARBDGpCBBAbQQBIDQMgATMBCiIGUA0AIAAgASgCDCAGEBtBAEgNAwsgASgCACIBDQALC0EAIQILIAMQCAsgBEEQaiQAIAILPAEBfyAABEAgAUGABnEhAQNAIAEgACgCBHEEQCACIAAvAQpqQQRqIQILIAAoAgAiAA0ACwsgAkH//wNxC5wBAQN/IABFBEBBAA8LIAAhAwNAAn8CQAJAIAAvAQgiAUH04AFNBEAgAUEBRg0BIAFB9cYBRg0BDAILIAFBgbICRg0AIAFB9eABRw0BCyAAKAIAIQEgAEEANgIAIAAoAgwQBiAAEAYgASADIAAgA0YbIQMCQCACRQRAQQAhAgwBCyACIAE2AgALIAEMAQsgACICKAIACyIADQALIAMLsgQCBX8BfgJAAkACQCAAIAGtEBciAQRAIAEtAAANAUEAIQAMAgsgBARAIARBADYCBCAEQQ42AgALQQAPC0EAIQADQCABLQAABH4gASkDCCABKQMQfQVCAAtCBFQNASABEAwhByABIAEQDCIGrRATIghFBEBBACECIAQEQCAEQQA2AgQgBEEVNgIACyABEAggAEUNAwNAIAAoAgAhASAAKAIMEAYgABAGIAEiAA0ACwwDCwJAAkBBEBAJIgUEQCAFIAY7AQogBSAHOwEIIAUg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EAIAJBEGokACAAC9oDAQZ/IwBBEGsiBSQAIAUgAjYCDCMAQaABayIEJAAgBEEIakHA8ABBkAEQBxogBCAANgI0IAQgADYCHCAEQX4gAGsiA0H/////ByADQf////8HSRsiBjYCOCAEIAAgBmoiADYCJCAEIAA2AhggBEEIaiEAIwBB0AFrIgMkACADIAI2AswBIANBoAFqQQBBKBAZIAMgAygCzAE2AsgBAkBBACABIANByAFqIANB0ABqIANBoAFqEEpBAEgNACAAKAJMQQBOIQcgACgCACECIAAsAEpBAEwEQCAAIAJBX3E2AgALIAJBIHEhCAJ/IAAoAjAEQCAAIAEgA0HIAWogA0HQAGogA0GgAWoQSgwBCyAAQdAANgIwIAAgA0HQAGo2AhAgACADNgIcIAAgAzYCFCAAKAIsIQIgACADNgIsIAAgASADQcgBaiADQdAAaiADQaABahBKIAJFDQAaIABBAEEAIAAoAiQRAAAaIABBADYCMCAAIAI2AiwgAEEANgIcIABBADYCECAAKAIUGiAAQQA2AhRBAAsaIAAgACgCACAIcjYCACAHRQ0ACyADQdABaiQAIAYEQCAEKAIcIgAgACAEKAIYRmtBADoAAAsgBEGgAWokACAFQRBqJAALUwEDfwJAIAAoAgAsAABBMGtBCk8NAANAIAAoAgAiAiwAACEDIAAgAkEBajYCACABIANqQTBrIQEgAiwAAUEwa0EKTw0BIAFBCmwhAQwACwALIAELuwIAAkAgAUEUSw0AAkACQAJAAkACQAJAAkACQAJAAkAgAUEJaw4KAAECAwQFBgcICQoLIAIgAigCACIBQQRqNgIAIAAgASgCADYCAA8LIAIgAigCACIBQQRqNgIAIAAgATQCADcDAA8LIAIgAigCACIBQQRqNgIAIAAgATUCADcDAA8LIAIgAigCAEEHakF4cSIBQQhqNgIAIAAgASkDADcDAA8LIAIgAigCACIBQQRqNgIAIAAgATIBADcDAA8LIAIgAigCACIBQQRqNgIAIAAgATMBADcDAA8LIAIgAigCACIBQQRqNgIAIAAgATAAADcDAA8LIAIgAigCACIBQQRqNgIAIAAgATEAADcDAA8LIAIgA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ggFX0hEyAVQv////8PViAUQv//A1ZyIApyQQFxBEAgBkGZEkEEECwgBkIsEBggBkEtEA0gBkEtEA0gBkEAEBIgBkEAEBIgBiAUEBggBiAUEBggBiATEBggBiAVEBggBkGUEkEEECwgBkEAEBIgBiAYEBggBkEBEBILIAZBnhJBBBAsIAZBABASIAYgFEL//wMgFEL//wNUG6dB//8DcSIBEA0gBiABEA0gBkF/IBOnIBNC/v///w9WGxASIAZBfyAVpyAVQv7///8PVhsQEiAGIABBJEEgIAAtACgbaigCACIDBH8gAy8BBAVBAAtB//8DcRANIAYtAABFBEAgAEEIagRAIABBADYCDCAAQRQ2AggLIAYQCAwCCyAAIAYoAgQgBi0AAAR+IAYpAxAFQgALEBshASAGEAggAUEASA0BIAMEQCAAIAMoAgAgAzMBBBAbQQBIDQILIBMhFwwBCyAAKAIAIQEgAEEIagRAIAAgASgCDDYCCCAAIAEoAhA2AgwLQn8hFwsgEUHwAGokACAXQgBTDQAgACgCABAfQj+HpyECCyALEAYgAkEASA0BAn8gACgCACIBKAIkQQFHBEAgAUEMagRAIAFBADYCECABQRI2AgwLQX8MAQsgASgCICICQQJPBEAgAUEMagRAIAFBADYCECABQR02AgwLQX8MAQsCQCACQQFHDQAgARAaQQBODQBBfwwBCyABQQBCAEEJEA5Cf1cEQCABQQI2AiRBfwwBCyABQQA2AiRBAAtFDQIgACgCACECIAQEQCAEIAIoAgw2AgAgBCACKAIQNgIECwwBCyALEAYLIAAoAlQQfCAAKAIAEENBfyECDAILIAAoAlQQfAsgABBLQQAhAgsgB0HAwABqJAAgAgtFAEHwgwFCADcDAEHogwFCADcDAEHggwFCADcDAEHYgwFCADcDAEHQgwFCADcDAEHIgwFCADcDAEHAgwFCADcDAEHAgwELoQMBCH8jAEGgAWsiAiQAIAAQMQJAAn8CQCAAKAIAIgFBAE4EQCABQbATKAIASA0BCyACIAE2AhAgAkEgakH2ESACQRBqEHZBASEGIAJBIGohBCACQSBqECIhA0EADAELIAFBAnQiAUGwEmooAgA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kACQAJAIAhBAWsOAwADAQILIAFBAToADSABKQMgIgNCf1cEQCABBEAgAUEANgIEIAFBFDYCAAsMBQsgAS0ADkUNBCADIAVWDQQgASADNwMYIAFBAToADyACIAQgA6cQBxogASkDGCEFDAwLIAEtAAwNAyAAIARCgMAAEBEiBkJ/VwRAIAEEQCABIAAoAgw2AgAgASAAKAIQNgIECwwECyAGUARAIAFBAToADCABKAKsQCABKAKoQCgCGBEDACABKQMgQn9VDQEgAUIANwMgDAELAkAgASkDIEIAWQRAIAFBADoADgwBCyABIAY3AyALIAEoAqxAIAQgBiABKAKoQCgCFBEPABoLIAMgBVYNAQwCCwsgASgCAA0AIAEEQCABQQA2AgQgAUEUNgIACwsgBVBFBEAgAUEAOgAOIAEgASkDGCAFfDcDGAwIC0J/QgAgASgCABshBQwHCyABKAKsQCABKAKoQCgCEBEBAK1CAX0hBQwGCyABLQAQBEAgAS0ADQRAIAIgAS0ADwR/QQAFQQggASgCFCIAIABBfUsbCzsBMCACIAEpAxg3AyAgAiACKQMAQsgAhDcDAAwHCyACIAIpAwBCt////w+DNwMADAYLIAJBADsBMCACKQMAIQMgAS0ADQRAIAEpAxghBSACIANCxACENwMAIAIgBTcDGEIAIQUMBgsgAiADQrv///8Pg0LAAIQ3AwAMBQsgAS0ADw0EIAEoAqxAIAEoAqhAKAIIEQEArCEFDAQLIANCCFoEfiACIAEoAgA2AgAgAiABKAIENgIEQggFQn8LIQUMAwsgAUUNAiABKAKsQCABKAKoQCgCBBEDACABEDEgARAGDAILIAdBfzYCAEEQIAcQJEI/hCEFDAELIAEEQCABQQA2AgQgAUEUNgIAC0J/IQULIAdBEGokACAFC2MAQcgAEAkiAEUEQEGEhAEoAgAhASACBEAgAiABNgIEIAJBATYCAAsgAA8LIABBADoADCAAQQA6AAQgACACNgIAIABBADYCOCAAQgA3AzAgACABQQkgAUEBa0EJSRs2AgggAAu3fAIefwZ+IAIpAwAhIiAAIAE2AhwgACAiQv////8PICJC/////w9UGz4CICAAQRBqI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wAkAgBSgCECIEIAYoAhAiASABIARLGyIBRQ0AIAUoAgwgBigCCCABEAcaIAUgBSgCDCABajYCDCAGIAYoAgggAWo2AgggBSAFKAIUIAFqNgIUIAUgBSgCECABazYCECAGIAYoAhAgAWsiATYCECABDQAgBiAGKAIENgIIC0EAIQRBACEJIAMoAhBFDQAMCgsgAygCHCgCJCEGIAMgAygCGCIBQQFqNgIYIAEgBmotAAAhASADIARBAWo2AhAgAygCBCAEaiABOgAAIAEEQCADKAIQIQQMAQsLIAMoAhwoAixFDQAgAygCECIGIAlNDQAgBQJ/IAUoAjAhBEEAIAMoAgQgCWoiAUUNABogBCABIAYgCWtB1IABKAIAEQAACzYCMAsgA0HnADYCIAsCQCADKAIcKAIsBEAgAygCDCADKAIQIgFBAmpJBH8gBRAKIAMoAhANAkEABSABCyADKAIEaiAFKAIwOwAAIAMgAygCEEECajYCECADQaABakHkgAEoAgARAQAaCyADQfEANgIgIAUQCiADKAIQRQ0BDAcLDAYLIAUoAgQNAQsgAygCPA0AIApFDQEgAygCIEGaBUYNAQsCfyADKAKIASIBRQRAIAMgChCFAQwBCwJAAkACQCADKAKMAUECaw4CAAECCwJ/AkADQAJAAkAgAygCPA0AIAMQLyADKAI8DQAgCg0BQQAMBAsgAygCSCADKAJoai0AACEEIAMgAygC8C0iAUEBajYC8C0gASADKALsLWpBADoAACADIAMoAvAtIgFBAWo2AvAtIAEgAygC7C1qQQA6AAAgAyADKALwLSIBQQFqNgLwLSABIAMoAuwtaiAEOgAAIAMgBEECdGoiASABLwHkAUEBajsB5AEgAyADKAI8QQFrNgI8IAMgAygCaEEBaiIBNgJoIAMoAvAtIAMoAvQtRw0BQQAhBCADIAMoAlgiBkEATgR/IAMoAkggBmoFQQALIAEgBmtBABAPIAMgAygCaDYCWCADKAIAEAogAygCACgCEA0BDAILCyADQQA2AoQuIApBBEYEQCADIAMoAlgiAUEATgR/IAMoAkggAWoFQQALIAMoAmggAWtBARAPIAMgAygCaDYCWCADKAIAEApBA0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aiIENgJoCyADKALwLSADKAL0LUcNAUEAIQggAyADKAJYIgFBAE4EfyADKAJIIAFqBUEACyAEIAFrQQAQDyADIAMoAmg2AlggAygCABAKIAMoAgAoAhANAQwCCwsgA0EANgKELiAKQQRGBEAgAyADKAJYIgFBAE4EfyADKAJIIAFqBUEACyADKAJoIAFrQQEQDyADIAMoAmg2AlggAygCABAKQQNBAiADKAIAKAIQGwwCCyADKALwLQRAQQAhCCADIAMoAlgiAUEATgR/IAMoAkggAWoFQQALIAMoAmggAWtBABAPIAMgAygCaDYCWCADKAIAEAogAygCACgCEEUNAQtBASEICyAICwwBCyADIAogAUEMbEG42ABqKAIAEQIACyIBQX5xQQJGBEAgA0GaBTYCIAsgAUF9cUUEQEEAIQQgBSgCEA0CDAQLIAFBAUcNAAJAAkACQCAKQQFrDgUAAQEBAgELIAMpA5guISICfwJ+IAMoAqAuIgFBA2oiCUE/TQRAQgIgAa2GICKEDAELIAFBwABGBEAgAygCBCADKAIQaiAiNwAAIAMgAygCEEEIajYCEEICISJBCgwCCyADKAIEIAMoAhBqQgIgAa2GICKENwAAIAMgAygCEEEIajYCECABQT1rIQlCAkHAACABa62ICyEiIAlBB2ogCUE5SQ0AGiADKAIEIAMoAhBqICI3AAAgAyADKAIQQQhqNgIQQgAhIiAJQTlrCyEBIAMgIjcDmC4gAyABNgKgLiADEDAMAQsgA0EAQQBBABA5IApBA0cNACADKAJQQQBBgIAIEBkgAygCPA0AIANBADYChC4gA0EANgJYIANBADYCaAsgBRAKIAUoAhANAAwDC0EAIQQgCkEERw0AAkACfwJAAkAgAygCFEEBaw4CAQADCyAFIANBoAFqQeCAASgCABEBACIBNgIwIAMoAgQgAygCEGogATYAACADIAMoAhBBBGoiATYCECADKAIEIAFqIQQgBSgCCAwBCyADKAIEIAMoAhBqIQQgBSgCMCIBQRh0IAFBCHRBgID8B3FyIAFBCHZBgP4DcSABQRh2cnILIQEgBCABNgAAIAMgAygCEEEEajYCEAsgBRAKIAMoAhQiAUEBTg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IACNgLoLSABQQA2AkAgASADNgJQIAEgAigCICACKAIoQYCAAkEEECgiAzYCBCABIAEoAugtIgRBAnQ2AgwCQAJAIAEoAkhFDQAgASgCTEUNACABKAJQRQ0AIAMNAQsgAUGaBTYCICACQejAACgCADYCGCACEIQBGkF8DAILIAFBADYCjAEgASAFNgKIASABQgA3AyggASADIARqNgLsLSABIARBA2xBA2s2AvQtQX4hAwJAIAJFDQAgAigCIEUNACACKAIkRQ0AIAIoAhwiAUUNACABKAIAIAJHDQACQAJAIAEoAiAiBEE5aw45AQICAgICAgICAgICAQICAgECAgICAgICAgICAgICAgICAgECAgICAgICAgICAgECAgICAgICAgIBAAsgBEGaBUYNACAEQSpHDQELIAJBAjYCLCACQQA2AgggAkIANwIUIAFBADYCECABIAEoAgQ2AgggASgCFCIDQX9MBEAgAUEAIANrIgM2AhQLIAFBOUEqIANBAkYbNgIgIAIgA0ECRgR/IAFBoAFqQeSAASgCABEBAAVBAQs2AjAgAUF+NgIkIAFBADYCoC4gAUIANwOYLiABQYgXakGg0wA2AgAgASABQcwVajYCgBcgAUH8FmpBjNMANgIAIAEgAUHYE2o2AvQWIAFB8BZqQfjSADYCACABIAFB5AFqNgLoFiABEIgBQQAhAwsgAw0AIAIoAhwiAiACKAIwQQF0NgJEQQAhAyACKAJQQQBBgIAIEBkgAiACKAKIASIEQQxsIgFBtNgAai8BADYClAEgAiABQbDYAGovAQA2ApABIAIgAUGy2ABqLwEANgJ4IAIgAUG22ABqLwEANgJ0QfiAASgCACEFQeyAASgCACEGQYCBASgCACEBIAJCADcCbCACQgA3AmQgAkEANgI8IAJBADYChC4gAkIANwJUIAJBKSABIARBCUYiARs2AnwgAkEqIAYgARs2AoABIAJBKyAFIAEbNgKEAQsgAwsFQXoLDAELAn9BekHrDC0AAEExRw0AGkF+IAJFDQAaIAJBADYCGCACKAIgIgNFBEAgAkEANgIoIAJBJzYCIEEnIQMLIAIoAiRFBEAgAkEoNgIkC0F8IAMgAigCKEEBQaDHABAoIg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wOCyABQgA3AwAgACgCECIBBEACQCABKAIoIgpFBEAgASkDGCEEDAELIApBADYCKCABKAIoQgA3AyAgASABKQMYIgIgASkDICIFIAIgBVYbIgQ3AxgLIAEpAwggBFYEQANAIAEoAgAgBKdBBHRqKAIAEAYgBEIBfCIEIAEpAwhUDQALCyABKAIAEAYgASgCBBAGIAEQBgsgACADNgIQQgAhBAwNCyAAKAIUIgEEQAJAIAEoAigiA0UEQCABKQMYIQIMAQsgA0EANgIoIAEoAihCADcDICABIAEpAxgiAiABKQMgIgUgAiAFVhsiAjcDGAsgASkDCCACVgRAA0AgASgCACACp0EEdGooAgAQBiACQgF8IgIgASkDCFQNAAsLIAEoAgAQBiABKAIEEAYgARAGCyAAQQA2AhQMDAsgACgCECIDKQM4IAMpAzAgASACIAAQRCIHQgBTDQogAyAHNwM4AkAgAykDCCIGQgF9IgJQDQAgAygCBCEAA0ACQCAHIAAgAiAEfUIBiCAEfCIFp0EDdGopAwBUBEAgBUIBfSECDAELIAUgBlEEQCAGIQUMAwsgACAFQgF8IgSnQQN0aikDACAHVg0CCyAEIQUgAiAEVg0ACwsgAyAFNwNAQgAhBAwLCyAAKAIUIgMpAzggAykDMCABIAIgABBEIgdCAFMNCSADIAc3AzgCQCADKQMIIgZCAX0iAlANACADKAIEIQADQAJAIAcgACACIAR9QgGIIAR8IgWnQQN0aikDAFQEQCAFQgF9IQIMAQsgBSAGUQRAIAYhBQwDCyAAIAVCAXwiBKdBA3RqKQMAIAdWDQILIAQhBSACIARWDQALCyADIAU3A0BCACEEDAoLIAJCN1gEQCAABEAgAEEANgIEIABBEjYCAAsMCQsgARAqIAEgACgCDDYCKCAAKAIQKQMwIQIgAUEANgIwIAEgAjcDICABIAI3AxggAULcATcDAEI4IQQMCQsgACABKAIANgIMDAgLIAtBQGtBfzYCACALQouAgICwAjcDOCALQoyAgIDQATcDMCALQo+AgICgATcDKCALQpGAgICQATcDICALQoeAgICAATcDGCALQoWAgIDgADcDECALQoOAgIDAADcDCCAL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CDAQsQ/////////////////////w=="; - if (!isDataURI(wasmBinaryFile)) { - wasmBinaryFile = locateFile(wasmBinaryFile); - } - function getBinary(file) { - try { - if (file == wasmBinaryFile && wasmBinary) { - return new Uint8Array(wasmBinary); - } - var binary = tryParseAsDataURI(file); - if (binary) { - return binary; - } - if (readBinary) { - return readBinary(file); - } else { - throw "sync fetching of the wasm failed: you can preload it to Module['wasmBinary'] manually, or emcc.py will do that for you when generating HTML (but not JS)"; - } - } catch (err2) { - abort(err2); - } - } - function instantiateSync(file, info) { - var instance; - var module2; - var binary; - try { - binary = getBinary(file); - module2 = new WebAssembly.Module(binary); - instance = new WebAssembly.Instance(module2, info); - } catch (e) { - var str = e.toString(); - err("failed to compile wasm module: " + str); - if (str.includes("imported Memory") || str.includes("memory import")) { - err( - "Memory size incompatibility issues may be due to changing INITIAL_MEMORY at runtime to something too large. Use ALLOW_MEMORY_GROWTH to allow any size memory (and also make sure not to set INITIAL_MEMORY at runtime to something smaller than it was at compile time)." - ); - } - throw e; - } - return [instance, module2]; - } - function createWasm() { - var info = { a: asmLibraryArg }; - function receiveInstance(instance, module2) { - var exports3 = instance.exports; - Module["asm"] = exports3; - wasmMemory = Module["asm"]["g"]; - updateGlobalBufferAndViews(wasmMemory.buffer); - wasmTable = Module["asm"]["W"]; - addOnInit(Module["asm"]["h"]); - removeRunDependency(); - } - addRunDependency(); - if (Module["instantiateWasm"]) { - try { - var exports2 = Module["instantiateWasm"](info, receiveInstance); - return exports2; - } catch (e) { - err("Module.instantiateWasm callback failed with error: " + e); - return false; - } - } - var result = instantiateSync(wasmBinaryFile, info); - receiveInstance(result[0]); - return Module["asm"]; - } - function LE_HEAP_LOAD_F32(byteOffset) { - return HEAP_DATA_VIEW.getFloat32(byteOffset, true); - } - function LE_HEAP_LOAD_F64(byteOffset) { - return HEAP_DATA_VIEW.getFloat64(byteOffset, true); - } - function LE_HEAP_LOAD_I16(byteOffset) { - return HEAP_DATA_VIEW.getInt16(byteOffset, true); - } - function LE_HEAP_LOAD_I32(byteOffset) { - return HEAP_DATA_VIEW.getInt32(byteOffset, true); - } - function LE_HEAP_STORE_I32(byteOffset, value) { - HEAP_DATA_VIEW.setInt32(byteOffset, value, true); - } - function callRuntimeCallbacks(callbacks) { - while (callbacks.length > 0) { - var callback = callbacks.shift(); - if (typeof callback == "function") { - callback(Module); - continue; - } - var func = callback.func; - if (typeof func === "number") { - if (callback.arg === void 0) { - wasmTable.get(func)(); - } else { - wasmTable.get(func)(callback.arg); - } - } else { - func(callback.arg === void 0 ? null : callback.arg); - } - } - } - function _gmtime_r(time, tmPtr) { - var date = new Date(LE_HEAP_LOAD_I32((time >> 2) * 4) * 1e3); - LE_HEAP_STORE_I32((tmPtr >> 2) * 4, date.getUTCSeconds()); - LE_HEAP_STORE_I32((tmPtr + 4 >> 2) * 4, date.getUTCMinutes()); - LE_HEAP_STORE_I32((tmPtr + 8 >> 2) * 4, date.getUTCHours()); - LE_HEAP_STORE_I32((tmPtr + 12 >> 2) * 4, date.getUTCDate()); - LE_HEAP_STORE_I32((tmPtr + 16 >> 2) * 4, date.getUTCMonth()); - LE_HEAP_STORE_I32((tmPtr + 20 >> 2) * 4, date.getUTCFullYear() - 1900); - LE_HEAP_STORE_I32((tmPtr + 24 >> 2) * 4, date.getUTCDay()); - LE_HEAP_STORE_I32((tmPtr + 36 >> 2) * 4, 0); - LE_HEAP_STORE_I32((tmPtr + 32 >> 2) * 4, 0); - var start = Date.UTC(date.getUTCFullYear(), 0, 1, 0, 0, 0, 0); - var yday = (date.getTime() - start) / (1e3 * 60 * 60 * 24) | 0; - LE_HEAP_STORE_I32((tmPtr + 28 >> 2) * 4, yday); - if (!_gmtime_r.GMTString) - _gmtime_r.GMTString = allocateUTF8("GMT"); - LE_HEAP_STORE_I32((tmPtr + 40 >> 2) * 4, _gmtime_r.GMTString); - return tmPtr; - } - function ___gmtime_r(a0, a1) { - return _gmtime_r(a0, a1); - } - function _emscripten_memcpy_big(dest, src, num) { - HEAPU8.copyWithin(dest, src, src + num); - } - function emscripten_realloc_buffer(size) { - try { - wasmMemory.grow(size - buffer.byteLength + 65535 >>> 16); - updateGlobalBufferAndViews(wasmMemory.buffer); - return 1; - } catch (e) { - } - } - function _emscripten_resize_heap(requestedSize) { - var oldSize = HEAPU8.length; - requestedSize = requestedSize >>> 0; - var maxHeapSize = 2147483648; - if (requestedSize > maxHeapSize) { - return false; - } - for (var cutDown = 1; cutDown <= 4; cutDown *= 2) { - var overGrownHeapSize = oldSize * (1 + 0.2 / cutDown); - overGrownHeapSize = Math.min( - overGrownHeapSize, - requestedSize + 100663296 - ); - var newSize = Math.min( - maxHeapSize, - alignUp(Math.max(requestedSize, overGrownHeapSize), 65536) - ); - var replacement = emscripten_realloc_buffer(newSize); - if (replacement) { - return true; - } - } - return false; - } - function _setTempRet0(val) { - } - function _time(ptr) { - var ret = Date.now() / 1e3 | 0; - if (ptr) { - LE_HEAP_STORE_I32((ptr >> 2) * 4, ret); - } - return ret; - } - function _tzset() { - if (_tzset.called) - return; - _tzset.called = true; - var currentYear = new Date().getFullYear(); - var winter = new Date(currentYear, 0, 1); - var summer = new Date(currentYear, 6, 1); - var winterOffset = winter.getTimezoneOffset(); - var summerOffset = summer.getTimezoneOffset(); - var stdTimezoneOffset = Math.max(winterOffset, summerOffset); - LE_HEAP_STORE_I32((__get_timezone() >> 2) * 4, stdTimezoneOffset * 60); - LE_HEAP_STORE_I32( - (__get_daylight() >> 2) * 4, - Number(winterOffset != summerOffset) - ); - function extractZone(date) { - var match = date.toTimeString().match(/\(([A-Za-z ]+)\)$/); - return match ? match[1] : "GMT"; - } - var winterName = extractZone(winter); - var summerName = extractZone(summer); - var winterNamePtr = allocateUTF8(winterName); - var summerNamePtr = allocateUTF8(summerName); - if (summerOffset < winterOffset) { - LE_HEAP_STORE_I32((__get_tzname() >> 2) * 4, winterNamePtr); - LE_HEAP_STORE_I32((__get_tzname() + 4 >> 2) * 4, summerNamePtr); - } else { - LE_HEAP_STORE_I32((__get_tzname() >> 2) * 4, summerNamePtr); - LE_HEAP_STORE_I32((__get_tzname() + 4 >> 2) * 4, winterNamePtr); - } - } - function _timegm(tmPtr) { - _tzset(); - var time = Date.UTC( - LE_HEAP_LOAD_I32((tmPtr + 20 >> 2) * 4) + 1900, - LE_HEAP_LOAD_I32((tmPtr + 16 >> 2) * 4), - LE_HEAP_LOAD_I32((tmPtr + 12 >> 2) * 4), - LE_HEAP_LOAD_I32((tmPtr + 8 >> 2) * 4), - LE_HEAP_LOAD_I32((tmPtr + 4 >> 2) * 4), - LE_HEAP_LOAD_I32((tmPtr >> 2) * 4), - 0 - ); - var date = new Date(time); - LE_HEAP_STORE_I32((tmPtr + 24 >> 2) * 4, date.getUTCDay()); - var start = Date.UTC(date.getUTCFullYear(), 0, 1, 0, 0, 0, 0); - var yday = (date.getTime() - start) / (1e3 * 60 * 60 * 24) | 0; - LE_HEAP_STORE_I32((tmPtr + 28 >> 2) * 4, yday); - return date.getTime() / 1e3 | 0; - } - function intArrayFromBase64(s) { - { - var buf; - try { - buf = Buffer.from(s, "base64"); - } catch (_) { - buf = new Buffer(s, "base64"); - } - return new Uint8Array( - buf["buffer"], - buf["byteOffset"], - buf["byteLength"] - ); - } - } - function tryParseAsDataURI(filename) { - if (!isDataURI(filename)) { - return; - } - return intArrayFromBase64(filename.slice(dataURIPrefix.length)); - } - var asmLibraryArg = { - e: ___gmtime_r, - c: _emscripten_memcpy_big, - d: _emscripten_resize_heap, - a: _setTempRet0, - b: _time, - f: _timegm - }; - var asm = createWasm(); - Module["___wasm_call_ctors"] = asm["h"]; - Module["_zip_ext_count_symlinks"] = asm["i"]; - Module["_zip_file_get_external_attributes"] = asm["j"]; - Module["_zipstruct_statS"] = asm["k"]; - Module["_zipstruct_stat_size"] = asm["l"]; - Module["_zipstruct_stat_mtime"] = asm["m"]; - Module["_zipstruct_stat_crc"] = asm["n"]; - Module["_zipstruct_errorS"] = asm["o"]; - Module["_zipstruct_error_code_zip"] = asm["p"]; - Module["_zipstruct_stat_comp_size"] = asm["q"]; - Module["_zipstruct_stat_comp_method"] = asm["r"]; - Module["_zip_close"] = asm["s"]; - Module["_zip_delete"] = asm["t"]; - Module["_zip_dir_add"] = asm["u"]; - Module["_zip_discard"] = asm["v"]; - Module["_zip_error_init_with_code"] = asm["w"]; - Module["_zip_get_error"] = asm["x"]; - Module["_zip_file_get_error"] = asm["y"]; - Module["_zip_error_strerror"] = asm["z"]; - Module["_zip_fclose"] = asm["A"]; - Module["_zip_file_add"] = asm["B"]; - Module["_free"] = asm["C"]; - var _malloc = Module["_malloc"] = asm["D"]; - Module["_zip_source_error"] = asm["E"]; - Module["_zip_source_seek"] = asm["F"]; - Module["_zip_file_set_external_attributes"] = asm["G"]; - Module["_zip_file_set_mtime"] = asm["H"]; - Module["_zip_fopen_index"] = asm["I"]; - Module["_zip_fread"] = asm["J"]; - Module["_zip_get_name"] = asm["K"]; - Module["_zip_get_num_entries"] = asm["L"]; - Module["_zip_source_read"] = asm["M"]; - Module["_zip_name_locate"] = asm["N"]; - Module["_zip_open_from_source"] = asm["O"]; - Module["_zip_set_file_compression"] = asm["P"]; - Module["_zip_source_buffer"] = asm["Q"]; - Module["_zip_source_buffer_create"] = asm["R"]; - Module["_zip_source_close"] = asm["S"]; - Module["_zip_source_free"] = asm["T"]; - Module["_zip_source_keep"] = asm["U"]; - Module["_zip_source_open"] = asm["V"]; - Module["_zip_source_tell"] = asm["X"]; - Module["_zip_stat_index"] = asm["Y"]; - var __get_tzname = Module["__get_tzname"] = asm["Z"]; - var __get_daylight = Module["__get_daylight"] = asm["_"]; - var __get_timezone = Module["__get_timezone"] = asm["$"]; - var stackSave = Module["stackSave"] = asm["aa"]; - var stackRestore = Module["stackRestore"] = asm["ba"]; - var stackAlloc = Module["stackAlloc"] = asm["ca"]; - Module["cwrap"] = cwrap; - Module["getValue"] = getValue; - var calledRun; - dependenciesFulfilled = function runCaller() { - if (!calledRun) - run(); - if (!calledRun) - dependenciesFulfilled = runCaller; - }; - function run(args) { - if (runDependencies > 0) { - return; - } - preRun(); - if (runDependencies > 0) { - return; - } - function doRun() { - if (calledRun) - return; - calledRun = true; - Module["calledRun"] = true; - if (ABORT) - return; - initRuntime(); - readyPromiseResolve(Module); - if (Module["onRuntimeInitialized"]) - Module["onRuntimeInitialized"](); - postRun(); - } - if (Module["setStatus"]) { - Module["setStatus"]("Running..."); - setTimeout(function() { - setTimeout(function() { - Module["setStatus"](""); - }, 1); - doRun(); - }, 1); - } else { - doRun(); - } - } - Module["run"] = run; - if (Module["preInit"]) { - if (typeof Module["preInit"] == "function") - Module["preInit"] = [Module["preInit"]]; - while (Module["preInit"].length > 0) { - Module["preInit"].pop()(); - } - } - run(); - return createModule2; - }; -}(); -module.exports = createModule; -}(libzipSync)); - -const createModule = libzipSync.exports; - -const number64 = [ - `number`, - `number` -]; -var Errors = /* @__PURE__ */ ((Errors2) => { - Errors2[Errors2["ZIP_ER_OK"] = 0] = "ZIP_ER_OK"; - Errors2[Errors2["ZIP_ER_MULTIDISK"] = 1] = "ZIP_ER_MULTIDISK"; - Errors2[Errors2["ZIP_ER_RENAME"] = 2] = "ZIP_ER_RENAME"; - Errors2[Errors2["ZIP_ER_CLOSE"] = 3] = "ZIP_ER_CLOSE"; - Errors2[Errors2["ZIP_ER_SEEK"] = 4] = "ZIP_ER_SEEK"; - Errors2[Errors2["ZIP_ER_READ"] = 5] = "ZIP_ER_READ"; - Errors2[Errors2["ZIP_ER_WRITE"] = 6] = "ZIP_ER_WRITE"; - Errors2[Errors2["ZIP_ER_CRC"] = 7] = "ZIP_ER_CRC"; - Errors2[Errors2["ZIP_ER_ZIPCLOSED"] = 8] = "ZIP_ER_ZIPCLOSED"; - Errors2[Errors2["ZIP_ER_NOENT"] = 9] = "ZIP_ER_NOENT"; - Errors2[Errors2["ZIP_ER_EXISTS"] = 10] = "ZIP_ER_EXISTS"; - Errors2[Errors2["ZIP_ER_OPEN"] = 11] = "ZIP_ER_OPEN"; - Errors2[Errors2["ZIP_ER_TMPOPEN"] = 12] = "ZIP_ER_TMPOPEN"; - Errors2[Errors2["ZIP_ER_ZLIB"] = 13] = "ZIP_ER_ZLIB"; - Errors2[Errors2["ZIP_ER_MEMORY"] = 14] = "ZIP_ER_MEMORY"; - Errors2[Errors2["ZIP_ER_CHANGED"] = 15] = "ZIP_ER_CHANGED"; - Errors2[Errors2["ZIP_ER_COMPNOTSUPP"] = 16] = "ZIP_ER_COMPNOTSUPP"; - Errors2[Errors2["ZIP_ER_EOF"] = 17] = "ZIP_ER_EOF"; - Errors2[Errors2["ZIP_ER_INVAL"] = 18] = "ZIP_ER_INVAL"; - Errors2[Errors2["ZIP_ER_NOZIP"] = 19] = "ZIP_ER_NOZIP"; - Errors2[Errors2["ZIP_ER_INTERNAL"] = 20] = "ZIP_ER_INTERNAL"; - Errors2[Errors2["ZIP_ER_INCONS"] = 21] = "ZIP_ER_INCONS"; - Errors2[Errors2["ZIP_ER_REMOVE"] = 22] = "ZIP_ER_REMOVE"; - Errors2[Errors2["ZIP_ER_DELETED"] = 23] = "ZIP_ER_DELETED"; - Errors2[Errors2["ZIP_ER_ENCRNOTSUPP"] = 24] = "ZIP_ER_ENCRNOTSUPP"; - Errors2[Errors2["ZIP_ER_RDONLY"] = 25] = "ZIP_ER_RDONLY"; - Errors2[Errors2["ZIP_ER_NOPASSWD"] = 26] = "ZIP_ER_NOPASSWD"; - Errors2[Errors2["ZIP_ER_WRONGPASSWD"] = 27] = "ZIP_ER_WRONGPASSWD"; - Errors2[Errors2["ZIP_ER_OPNOTSUPP"] = 28] = "ZIP_ER_OPNOTSUPP"; - Errors2[Errors2["ZIP_ER_INUSE"] = 29] = "ZIP_ER_INUSE"; - Errors2[Errors2["ZIP_ER_TELL"] = 30] = "ZIP_ER_TELL"; - Errors2[Errors2["ZIP_ER_COMPRESSED_DATA"] = 31] = "ZIP_ER_COMPRESSED_DATA"; - return Errors2; -})(Errors || {}); -const makeInterface = (emZip) => ({ - get HEAPU8() { - return emZip.HEAPU8; - }, - errors: Errors, - SEEK_SET: 0, - SEEK_CUR: 1, - SEEK_END: 2, - ZIP_CHECKCONS: 4, - ZIP_EXCL: 2, - ZIP_RDONLY: 16, - ZIP_FL_OVERWRITE: 8192, - ZIP_FL_COMPRESSED: 4, - ZIP_OPSYS_DOS: 0, - ZIP_OPSYS_AMIGA: 1, - ZIP_OPSYS_OPENVMS: 2, - ZIP_OPSYS_UNIX: 3, - ZIP_OPSYS_VM_CMS: 4, - ZIP_OPSYS_ATARI_ST: 5, - ZIP_OPSYS_OS_2: 6, - ZIP_OPSYS_MACINTOSH: 7, - ZIP_OPSYS_Z_SYSTEM: 8, - ZIP_OPSYS_CPM: 9, - ZIP_OPSYS_WINDOWS_NTFS: 10, - ZIP_OPSYS_MVS: 11, - ZIP_OPSYS_VSE: 12, - ZIP_OPSYS_ACORN_RISC: 13, - ZIP_OPSYS_VFAT: 14, - ZIP_OPSYS_ALTERNATE_MVS: 15, - ZIP_OPSYS_BEOS: 16, - ZIP_OPSYS_TANDEM: 17, - ZIP_OPSYS_OS_400: 18, - ZIP_OPSYS_OS_X: 19, - ZIP_CM_DEFAULT: -1, - ZIP_CM_STORE: 0, - ZIP_CM_DEFLATE: 8, - uint08S: emZip._malloc(1), - uint32S: emZip._malloc(4), - malloc: emZip._malloc, - free: emZip._free, - getValue: emZip.getValue, - openFromSource: emZip.cwrap(`zip_open_from_source`, `number`, [`number`, `number`, `number`]), - close: emZip.cwrap(`zip_close`, `number`, [`number`]), - discard: emZip.cwrap(`zip_discard`, null, [`number`]), - getError: emZip.cwrap(`zip_get_error`, `number`, [`number`]), - getName: emZip.cwrap(`zip_get_name`, `string`, [`number`, `number`, `number`]), - getNumEntries: emZip.cwrap(`zip_get_num_entries`, `number`, [`number`, `number`]), - delete: emZip.cwrap(`zip_delete`, `number`, [`number`, `number`]), - statIndex: emZip.cwrap(`zip_stat_index`, `number`, [`number`, ...number64, `number`, `number`]), - fopenIndex: emZip.cwrap(`zip_fopen_index`, `number`, [`number`, ...number64, `number`]), - fread: emZip.cwrap(`zip_fread`, `number`, [`number`, `number`, `number`, `number`]), - fclose: emZip.cwrap(`zip_fclose`, `number`, [`number`]), - dir: { - add: emZip.cwrap(`zip_dir_add`, `number`, [`number`, `string`]) - }, - file: { - add: emZip.cwrap(`zip_file_add`, `number`, [`number`, `string`, `number`, `number`]), - getError: emZip.cwrap(`zip_file_get_error`, `number`, [`number`]), - getExternalAttributes: emZip.cwrap(`zip_file_get_external_attributes`, `number`, [`number`, ...number64, `number`, `number`, `number`]), - setExternalAttributes: emZip.cwrap(`zip_file_set_external_attributes`, `number`, [`number`, ...number64, `number`, `number`, `number`]), - setMtime: emZip.cwrap(`zip_file_set_mtime`, `number`, [`number`, ...number64, `number`, `number`]), - setCompression: emZip.cwrap(`zip_set_file_compression`, `number`, [`number`, ...number64, `number`, `number`]) - }, - ext: { - countSymlinks: emZip.cwrap(`zip_ext_count_symlinks`, `number`, [`number`]) - }, - error: { - initWithCode: emZip.cwrap(`zip_error_init_with_code`, null, [`number`, `number`]), - strerror: emZip.cwrap(`zip_error_strerror`, `string`, [`number`]) - }, - name: { - locate: emZip.cwrap(`zip_name_locate`, `number`, [`number`, `string`, `number`]) - }, - source: { - fromUnattachedBuffer: emZip.cwrap(`zip_source_buffer_create`, `number`, [`number`, ...number64, `number`, `number`]), - fromBuffer: emZip.cwrap(`zip_source_buffer`, `number`, [`number`, `number`, ...number64, `number`]), - free: emZip.cwrap(`zip_source_free`, null, [`number`]), - keep: emZip.cwrap(`zip_source_keep`, null, [`number`]), - open: emZip.cwrap(`zip_source_open`, `number`, [`number`]), - close: emZip.cwrap(`zip_source_close`, `number`, [`number`]), - seek: emZip.cwrap(`zip_source_seek`, `number`, [`number`, ...number64, `number`]), - tell: emZip.cwrap(`zip_source_tell`, `number`, [`number`]), - read: emZip.cwrap(`zip_source_read`, `number`, [`number`, `number`, `number`]), - error: emZip.cwrap(`zip_source_error`, `number`, [`number`]) - }, - struct: { - statS: emZip.cwrap(`zipstruct_statS`, `number`, []), - statSize: emZip.cwrap(`zipstruct_stat_size`, `number`, [`number`]), - statCompSize: emZip.cwrap(`zipstruct_stat_comp_size`, `number`, [`number`]), - statCompMethod: emZip.cwrap(`zipstruct_stat_comp_method`, `number`, [`number`]), - statMtime: emZip.cwrap(`zipstruct_stat_mtime`, `number`, [`number`]), - statCrc: emZip.cwrap(`zipstruct_stat_crc`, `number`, [`number`]), - errorS: emZip.cwrap(`zipstruct_errorS`, `number`, []), - errorCodeZip: emZip.cwrap(`zipstruct_error_code_zip`, `number`, [`number`]) - } -}); - -function getArchivePart(path, extension) { - let idx = path.indexOf(extension); - if (idx <= 0) - return null; - let nextCharIdx = idx; - while (idx >= 0) { - nextCharIdx = idx + extension.length; - if (path[nextCharIdx] === ppath.sep) - break; - if (path[idx - 1] === ppath.sep) - return null; - idx = path.indexOf(extension, nextCharIdx); - } - if (path.length > nextCharIdx && path[nextCharIdx] !== ppath.sep) - return null; - return path.slice(0, nextCharIdx); -} -class ZipOpenFS extends MountFS { - static async openPromise(fn, opts) { - const zipOpenFs = new ZipOpenFS(opts); - try { - return await fn(zipOpenFs); - } finally { - zipOpenFs.saveAndClose(); - } - } - constructor(opts = {}) { - const fileExtensions = opts.fileExtensions; - const readOnlyArchives = opts.readOnlyArchives; - const getMountPoint = typeof fileExtensions === `undefined` ? (path) => getArchivePart(path, `.zip`) : (path) => { - for (const extension of fileExtensions) { - const result = getArchivePart(path, extension); - if (result) { - return result; - } - } - return null; - }; - const factorySync = (baseFs, p) => { - return new ZipFS(p, { - baseFs, - readOnly: readOnlyArchives, - stats: baseFs.statSync(p) - }); - }; - const factoryPromise = async (baseFs, p) => { - const zipOptions = { - baseFs, - readOnly: readOnlyArchives, - stats: await baseFs.statPromise(p) - }; - return () => { - return new ZipFS(p, zipOptions); - }; - }; - super({ - ...opts, - factorySync, - factoryPromise, - getMountPoint - }); - } -} - -const DEFAULT_COMPRESSION_LEVEL = `mixed`; -function toUnixTimestamp(time) { - if (typeof time === `string` && String(+time) === time) - return +time; - if (typeof time === `number` && Number.isFinite(time)) { - if (time < 0) { - return Date.now() / 1e3; - } else { - return time; - } - } - if (nodeUtils.types.isDate(time)) - return time.getTime() / 1e3; - throw new Error(`Invalid time`); -} -function makeEmptyArchive() { - return Buffer.from([ - 80, - 75, - 5, - 6, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0 - ]); -} -class LibzipError extends Error { - constructor(message, code) { - super(message); - this.name = `Libzip Error`; - this.code = code; - } -} -class ZipFS extends BasePortableFakeFS { - constructor(source, opts = {}) { - super(); - this.listings = /* @__PURE__ */ new Map(); - this.entries = /* @__PURE__ */ new Map(); - this.fileSources = /* @__PURE__ */ new Map(); - this.fds = /* @__PURE__ */ new Map(); - this.nextFd = 0; - this.ready = false; - this.readOnly = false; - const pathOptions = opts; - this.level = typeof pathOptions.level !== `undefined` ? pathOptions.level : DEFAULT_COMPRESSION_LEVEL; - source ??= makeEmptyArchive(); - if (typeof source === `string`) { - const { baseFs = new NodeFS() } = pathOptions; - this.baseFs = baseFs; - this.path = source; - } else { - this.path = null; - this.baseFs = null; - } - if (opts.stats) { - this.stats = opts.stats; - } else { - if (typeof source === `string`) { - try { - this.stats = this.baseFs.statSync(source); - } catch (error) { - if (error.code === `ENOENT` && pathOptions.create) { - this.stats = makeDefaultStats(); - } else { - throw error; - } - } - } else { - this.stats = makeDefaultStats(); - } - } - this.libzip = getInstance(); - const errPtr = this.libzip.malloc(4); - try { - let flags = 0; - if (opts.readOnly) { - flags |= this.libzip.ZIP_RDONLY; - this.readOnly = true; - } - if (typeof source === `string`) - source = pathOptions.create ? makeEmptyArchive() : this.baseFs.readFileSync(source); - const lzSource = this.allocateUnattachedSource(source); - try { - this.zip = this.libzip.openFromSource(lzSource, flags, errPtr); - this.lzSource = lzSource; - } catch (error) { - this.libzip.source.free(lzSource); - throw error; - } - if (this.zip === 0) { - const error = this.libzip.struct.errorS(); - this.libzip.error.initWithCode(error, this.libzip.getValue(errPtr, `i32`)); - throw this.makeLibzipError(error); - } - } finally { - this.libzip.free(errPtr); - } - this.listings.set(PortablePath.root, /* @__PURE__ */ new Set()); - const entryCount = this.libzip.getNumEntries(this.zip, 0); - for (let t = 0; t < entryCount; ++t) { - const raw = this.libzip.getName(this.zip, t, 0); - if (ppath.isAbsolute(raw)) - continue; - const p = ppath.resolve(PortablePath.root, raw); - this.registerEntry(p, t); - if (raw.endsWith(`/`)) { - this.registerListing(p); - } - } - this.symlinkCount = this.libzip.ext.countSymlinks(this.zip); - if (this.symlinkCount === -1) - throw this.makeLibzipError(this.libzip.getError(this.zip)); - this.ready = true; - } - makeLibzipError(error) { - const errorCode = this.libzip.struct.errorCodeZip(error); - const strerror = this.libzip.error.strerror(error); - const libzipError = new LibzipError(strerror, this.libzip.errors[errorCode]); - if (errorCode === this.libzip.errors.ZIP_ER_CHANGED) - throw new Error(`Assertion failed: Unexpected libzip error: ${libzipError.message}`); - return libzipError; - } - getExtractHint(hints) { - for (const fileName of this.entries.keys()) { - const ext = this.pathUtils.extname(fileName); - if (hints.relevantExtensions.has(ext)) { - return true; - } - } - return false; - } - getAllFiles() { - return Array.from(this.entries.keys()); - } - getRealPath() { - if (!this.path) - throw new Error(`ZipFS don't have real paths when loaded from a buffer`); - return this.path; - } - prepareClose() { - if (!this.ready) - throw EBUSY(`archive closed, close`); - unwatchAllFiles(this); - } - getBufferAndClose() { - this.prepareClose(); - if (this.entries.size === 0) { - this.discardAndClose(); - return makeEmptyArchive(); - } - try { - this.libzip.source.keep(this.lzSource); - if (this.libzip.close(this.zip) === -1) - throw this.makeLibzipError(this.libzip.getError(this.zip)); - if (this.libzip.source.open(this.lzSource) === -1) - throw this.makeLibzipError(this.libzip.source.error(this.lzSource)); - if (this.libzip.source.seek(this.lzSource, 0, 0, this.libzip.SEEK_END) === -1) - throw this.makeLibzipError(this.libzip.source.error(this.lzSource)); - const size = this.libzip.source.tell(this.lzSource); - if (size === -1) - throw this.makeLibzipError(this.libzip.source.error(this.lzSource)); - if (this.libzip.source.seek(this.lzSource, 0, 0, this.libzip.SEEK_SET) === -1) - throw this.makeLibzipError(this.libzip.source.error(this.lzSource)); - const buffer = this.libzip.malloc(size); - if (!buffer) - throw new Error(`Couldn't allocate enough memory`); - try { - const rc = this.libzip.source.read(this.lzSource, buffer, size); - if (rc === -1) - throw this.makeLibzipError(this.libzip.source.error(this.lzSource)); - else if (rc < size) - throw new Error(`Incomplete read`); - else if (rc > size) - throw new Error(`Overread`); - let result = Buffer.from(this.libzip.HEAPU8.subarray(buffer, buffer + size)); - if (process.env.YARN_IS_TEST_ENV && process.env.YARN_ZIP_DATA_EPILOGUE) - result = Buffer.concat([result, Buffer.from(process.env.YARN_ZIP_DATA_EPILOGUE)]); - return result; - } finally { - this.libzip.free(buffer); - } - } finally { - this.libzip.source.close(this.lzSource); - this.libzip.source.free(this.lzSource); - this.ready = false; - } - } - discardAndClose() { - this.prepareClose(); - this.libzip.discard(this.zip); - this.ready = false; - } - saveAndClose() { - if (!this.path || !this.baseFs) - throw new Error(`ZipFS cannot be saved and must be discarded when loaded from a buffer`); - if (this.readOnly) { - this.discardAndClose(); - return; - } - const newMode = this.baseFs.existsSync(this.path) || this.stats.mode === DEFAULT_MODE ? void 0 : this.stats.mode; - this.baseFs.writeFileSync(this.path, this.getBufferAndClose(), { mode: newMode }); - this.ready = false; - } - resolve(p) { - return ppath.resolve(PortablePath.root, p); - } - async openPromise(p, flags, mode) { - return this.openSync(p, flags, mode); - } - openSync(p, flags, mode) { - const fd = this.nextFd++; - this.fds.set(fd, { cursor: 0, p }); - return fd; - } - hasOpenFileHandles() { - return !!this.fds.size; - } - async opendirPromise(p, opts) { - return this.opendirSync(p, opts); - } - opendirSync(p, opts = {}) { - const resolvedP = this.resolveFilename(`opendir '${p}'`, p); - if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) - throw ENOENT(`opendir '${p}'`); - const directoryListing = this.listings.get(resolvedP); - if (!directoryListing) - throw ENOTDIR(`opendir '${p}'`); - const entries = [...directoryListing]; - const fd = this.openSync(resolvedP, `r`); - const onClose = () => { - this.closeSync(fd); - }; - return opendir(this, resolvedP, entries, { onClose }); - } - async readPromise(fd, buffer, offset, length, position) { - return this.readSync(fd, buffer, offset, length, position); - } - readSync(fd, buffer, offset = 0, length = buffer.byteLength, position = -1) { - const entry = this.fds.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`read`); - const realPosition = position === -1 || position === null ? entry.cursor : position; - const source = this.readFileSync(entry.p); - source.copy(buffer, offset, realPosition, realPosition + length); - const bytesRead = Math.max(0, Math.min(source.length - realPosition, length)); - if (position === -1 || position === null) - entry.cursor += bytesRead; - return bytesRead; - } - async writePromise(fd, buffer, offset, length, position) { - if (typeof buffer === `string`) { - return this.writeSync(fd, buffer, position); - } else { - return this.writeSync(fd, buffer, offset, length, position); - } - } - writeSync(fd, buffer, offset, length, position) { - const entry = this.fds.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`read`); - throw new Error(`Unimplemented`); - } - async closePromise(fd) { - return this.closeSync(fd); - } - closeSync(fd) { - const entry = this.fds.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`read`); - this.fds.delete(fd); - } - createReadStream(p, { encoding } = {}) { - if (p === null) - throw new Error(`Unimplemented`); - const fd = this.openSync(p, `r`); - const stream$1 = Object.assign( - new stream.PassThrough({ - emitClose: true, - autoDestroy: true, - destroy: (error, callback) => { - clearImmediate(immediate); - this.closeSync(fd); - callback(error); - } - }), - { - close() { - stream$1.destroy(); - }, - bytesRead: 0, - path: p, - pending: false - } - ); - const immediate = setImmediate(async () => { - try { - const data = await this.readFilePromise(p, encoding); - stream$1.bytesRead = data.length; - stream$1.end(data); - } catch (error) { - stream$1.destroy(error); - } - }); - return stream$1; - } - createWriteStream(p, { encoding } = {}) { - if (this.readOnly) - throw EROFS(`open '${p}'`); - if (p === null) - throw new Error(`Unimplemented`); - const chunks = []; - const fd = this.openSync(p, `w`); - const stream$1 = Object.assign( - new stream.PassThrough({ - autoDestroy: true, - emitClose: true, - destroy: (error, callback) => { - try { - if (error) { - callback(error); - } else { - this.writeFileSync(p, Buffer.concat(chunks), encoding); - callback(null); - } - } catch (err) { - callback(err); - } finally { - this.closeSync(fd); - } - } - }), - { - close() { - stream$1.destroy(); - }, - bytesWritten: 0, - path: p, - pending: false - } - ); - stream$1.on(`data`, (chunk) => { - const chunkBuffer = Buffer.from(chunk); - stream$1.bytesWritten += chunkBuffer.length; - chunks.push(chunkBuffer); - }); - return stream$1; - } - async realpathPromise(p) { - return this.realpathSync(p); - } - realpathSync(p) { - const resolvedP = this.resolveFilename(`lstat '${p}'`, p); - if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) - throw ENOENT(`lstat '${p}'`); - return resolvedP; - } - async existsPromise(p) { - return this.existsSync(p); - } - existsSync(p) { - if (!this.ready) - throw EBUSY(`archive closed, existsSync '${p}'`); - if (this.symlinkCount === 0) { - const resolvedP2 = ppath.resolve(PortablePath.root, p); - return this.entries.has(resolvedP2) || this.listings.has(resolvedP2); - } - let resolvedP; - try { - resolvedP = this.resolveFilename(`stat '${p}'`, p, void 0, false); - } catch (error) { - return false; - } - if (resolvedP === void 0) - return false; - return this.entries.has(resolvedP) || this.listings.has(resolvedP); - } - async accessPromise(p, mode) { - return this.accessSync(p, mode); - } - accessSync(p, mode = fs.constants.F_OK) { - const resolvedP = this.resolveFilename(`access '${p}'`, p); - if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) - throw ENOENT(`access '${p}'`); - if (this.readOnly && mode & fs.constants.W_OK) { - throw EROFS(`access '${p}'`); - } - } - async statPromise(p, opts = { bigint: false }) { - if (opts.bigint) - return this.statSync(p, { bigint: true }); - return this.statSync(p); - } - statSync(p, opts = { bigint: false, throwIfNoEntry: true }) { - const resolvedP = this.resolveFilename(`stat '${p}'`, p, void 0, opts.throwIfNoEntry); - if (resolvedP === void 0) - return void 0; - if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) { - if (opts.throwIfNoEntry === false) - return void 0; - throw ENOENT(`stat '${p}'`); - } - if (p[p.length - 1] === `/` && !this.listings.has(resolvedP)) - throw ENOTDIR(`stat '${p}'`); - return this.statImpl(`stat '${p}'`, resolvedP, opts); - } - async fstatPromise(fd, opts) { - return this.fstatSync(fd, opts); - } - fstatSync(fd, opts) { - const entry = this.fds.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`fstatSync`); - const { p } = entry; - const resolvedP = this.resolveFilename(`stat '${p}'`, p); - if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) - throw ENOENT(`stat '${p}'`); - if (p[p.length - 1] === `/` && !this.listings.has(resolvedP)) - throw ENOTDIR(`stat '${p}'`); - return this.statImpl(`fstat '${p}'`, resolvedP, opts); - } - async lstatPromise(p, opts = { bigint: false }) { - if (opts.bigint) - return this.lstatSync(p, { bigint: true }); - return this.lstatSync(p); - } - lstatSync(p, opts = { bigint: false, throwIfNoEntry: true }) { - const resolvedP = this.resolveFilename(`lstat '${p}'`, p, false, opts.throwIfNoEntry); - if (resolvedP === void 0) - return void 0; - if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) { - if (opts.throwIfNoEntry === false) - return void 0; - throw ENOENT(`lstat '${p}'`); - } - if (p[p.length - 1] === `/` && !this.listings.has(resolvedP)) - throw ENOTDIR(`lstat '${p}'`); - return this.statImpl(`lstat '${p}'`, resolvedP, opts); - } - statImpl(reason, p, opts = {}) { - const entry = this.entries.get(p); - if (typeof entry !== `undefined`) { - const stat = this.libzip.struct.statS(); - const rc = this.libzip.statIndex(this.zip, entry, 0, 0, stat); - if (rc === -1) - throw this.makeLibzipError(this.libzip.getError(this.zip)); - const uid = this.stats.uid; - const gid = this.stats.gid; - const size = this.libzip.struct.statSize(stat) >>> 0; - const blksize = 512; - const blocks = Math.ceil(size / blksize); - const mtimeMs = (this.libzip.struct.statMtime(stat) >>> 0) * 1e3; - const atimeMs = mtimeMs; - const birthtimeMs = mtimeMs; - const ctimeMs = mtimeMs; - const atime = new Date(atimeMs); - const birthtime = new Date(birthtimeMs); - const ctime = new Date(ctimeMs); - const mtime = new Date(mtimeMs); - const type = this.listings.has(p) ? fs.constants.S_IFDIR : this.isSymbolicLink(entry) ? fs.constants.S_IFLNK : fs.constants.S_IFREG; - const defaultMode = type === fs.constants.S_IFDIR ? 493 : 420; - const mode = type | this.getUnixMode(entry, defaultMode) & 511; - const crc = this.libzip.struct.statCrc(stat); - const statInstance = Object.assign(new StatEntry(), { uid, gid, size, blksize, blocks, atime, birthtime, ctime, mtime, atimeMs, birthtimeMs, ctimeMs, mtimeMs, mode, crc }); - return opts.bigint === true ? convertToBigIntStats(statInstance) : statInstance; - } - if (this.listings.has(p)) { - const uid = this.stats.uid; - const gid = this.stats.gid; - const size = 0; - const blksize = 512; - const blocks = 0; - const atimeMs = this.stats.mtimeMs; - const birthtimeMs = this.stats.mtimeMs; - const ctimeMs = this.stats.mtimeMs; - const mtimeMs = this.stats.mtimeMs; - const atime = new Date(atimeMs); - const birthtime = new Date(birthtimeMs); - const ctime = new Date(ctimeMs); - const mtime = new Date(mtimeMs); - const mode = fs.constants.S_IFDIR | 493; - const crc = 0; - const statInstance = Object.assign(new StatEntry(), { uid, gid, size, blksize, blocks, atime, birthtime, ctime, mtime, atimeMs, birthtimeMs, ctimeMs, mtimeMs, mode, crc }); - return opts.bigint === true ? convertToBigIntStats(statInstance) : statInstance; - } - throw new Error(`Unreachable`); - } - getUnixMode(index, defaultMode) { - const rc = this.libzip.file.getExternalAttributes(this.zip, index, 0, 0, this.libzip.uint08S, this.libzip.uint32S); - if (rc === -1) - throw this.makeLibzipError(this.libzip.getError(this.zip)); - const opsys = this.libzip.getValue(this.libzip.uint08S, `i8`) >>> 0; - if (opsys !== this.libzip.ZIP_OPSYS_UNIX) - return defaultMode; - return this.libzip.getValue(this.libzip.uint32S, `i32`) >>> 16; - } - registerListing(p) { - const existingListing = this.listings.get(p); - if (existingListing) - return existingListing; - const parentListing = this.registerListing(ppath.dirname(p)); - parentListing.add(ppath.basename(p)); - const newListing = /* @__PURE__ */ new Set(); - this.listings.set(p, newListing); - return newListing; - } - registerEntry(p, index) { - const parentListing = this.registerListing(ppath.dirname(p)); - parentListing.add(ppath.basename(p)); - this.entries.set(p, index); - } - unregisterListing(p) { - this.listings.delete(p); - const parentListing = this.listings.get(ppath.dirname(p)); - parentListing?.delete(ppath.basename(p)); - } - unregisterEntry(p) { - this.unregisterListing(p); - const entry = this.entries.get(p); - this.entries.delete(p); - if (typeof entry === `undefined`) - return; - this.fileSources.delete(entry); - if (this.isSymbolicLink(entry)) { - this.symlinkCount--; - } - } - deleteEntry(p, index) { - this.unregisterEntry(p); - const rc = this.libzip.delete(this.zip, index); - if (rc === -1) { - throw this.makeLibzipError(this.libzip.getError(this.zip)); - } - } - resolveFilename(reason, p, resolveLastComponent = true, throwIfNoEntry = true) { - if (!this.ready) - throw EBUSY(`archive closed, ${reason}`); - let resolvedP = ppath.resolve(PortablePath.root, p); - if (resolvedP === `/`) - return PortablePath.root; - const fileIndex = this.entries.get(resolvedP); - if (resolveLastComponent && fileIndex !== void 0) { - if (this.symlinkCount !== 0 && this.isSymbolicLink(fileIndex)) { - const target = this.getFileSource(fileIndex).toString(); - return this.resolveFilename(reason, ppath.resolve(ppath.dirname(resolvedP), target), true, throwIfNoEntry); - } else { - return resolvedP; - } - } - while (true) { - const parentP = this.resolveFilename(reason, ppath.dirname(resolvedP), true, throwIfNoEntry); - if (parentP === void 0) - return parentP; - const isDir = this.listings.has(parentP); - const doesExist = this.entries.has(parentP); - if (!isDir && !doesExist) { - if (throwIfNoEntry === false) - return void 0; - throw ENOENT(reason); - } - if (!isDir) - throw ENOTDIR(reason); - resolvedP = ppath.resolve(parentP, ppath.basename(resolvedP)); - if (!resolveLastComponent || this.symlinkCount === 0) - break; - const index = this.libzip.name.locate(this.zip, resolvedP.slice(1), 0); - if (index === -1) - break; - if (this.isSymbolicLink(index)) { - const target = this.getFileSource(index).toString(); - resolvedP = ppath.resolve(ppath.dirname(resolvedP), target); - } else { - break; - } - } - return resolvedP; - } - allocateBuffer(content) { - if (!Buffer.isBuffer(content)) - content = Buffer.from(content); - const buffer = this.libzip.malloc(content.byteLength); - if (!buffer) - throw new Error(`Couldn't allocate enough memory`); - const heap = new Uint8Array(this.libzip.HEAPU8.buffer, buffer, content.byteLength); - heap.set(content); - return { buffer, byteLength: content.byteLength }; - } - allocateUnattachedSource(content) { - const error = this.libzip.struct.errorS(); - const { buffer, byteLength } = this.allocateBuffer(content); - const source = this.libzip.source.fromUnattachedBuffer(buffer, byteLength, 0, 1, error); - if (source === 0) { - this.libzip.free(error); - throw this.makeLibzipError(error); - } - return source; - } - allocateSource(content) { - const { buffer, byteLength } = this.allocateBuffer(content); - const source = this.libzip.source.fromBuffer(this.zip, buffer, byteLength, 0, 1); - if (source === 0) { - this.libzip.free(buffer); - throw this.makeLibzipError(this.libzip.getError(this.zip)); - } - return source; - } - setFileSource(p, content) { - const buffer = Buffer.isBuffer(content) ? content : Buffer.from(content); - const target = ppath.relative(PortablePath.root, p); - const lzSource = this.allocateSource(content); - try { - const newIndex = this.libzip.file.add(this.zip, target, lzSource, this.libzip.ZIP_FL_OVERWRITE); - if (newIndex === -1) - throw this.makeLibzipError(this.libzip.getError(this.zip)); - if (this.level !== `mixed`) { - const method = this.level === 0 ? this.libzip.ZIP_CM_STORE : this.libzip.ZIP_CM_DEFLATE; - const rc = this.libzip.file.setCompression(this.zip, newIndex, 0, method, this.level); - if (rc === -1) { - throw this.makeLibzipError(this.libzip.getError(this.zip)); - } - } - this.fileSources.set(newIndex, buffer); - return newIndex; - } catch (error) { - this.libzip.source.free(lzSource); - throw error; - } - } - isSymbolicLink(index) { - if (this.symlinkCount === 0) - return false; - const attrs = this.libzip.file.getExternalAttributes(this.zip, index, 0, 0, this.libzip.uint08S, this.libzip.uint32S); - if (attrs === -1) - throw this.makeLibzipError(this.libzip.getError(this.zip)); - const opsys = this.libzip.getValue(this.libzip.uint08S, `i8`) >>> 0; - if (opsys !== this.libzip.ZIP_OPSYS_UNIX) - return false; - const attributes = this.libzip.getValue(this.libzip.uint32S, `i32`) >>> 16; - return (attributes & fs.constants.S_IFMT) === fs.constants.S_IFLNK; - } - getFileSource(index, opts = { asyncDecompress: false }) { - const cachedFileSource = this.fileSources.get(index); - if (typeof cachedFileSource !== `undefined`) - return cachedFileSource; - const stat = this.libzip.struct.statS(); - const rc = this.libzip.statIndex(this.zip, index, 0, 0, stat); - if (rc === -1) - throw this.makeLibzipError(this.libzip.getError(this.zip)); - const size = this.libzip.struct.statCompSize(stat); - const compressionMethod = this.libzip.struct.statCompMethod(stat); - const buffer = this.libzip.malloc(size); - try { - const file = this.libzip.fopenIndex(this.zip, index, 0, this.libzip.ZIP_FL_COMPRESSED); - if (file === 0) - throw this.makeLibzipError(this.libzip.getError(this.zip)); - try { - const rc2 = this.libzip.fread(file, buffer, size, 0); - if (rc2 === -1) - throw this.makeLibzipError(this.libzip.file.getError(file)); - else if (rc2 < size) - throw new Error(`Incomplete read`); - else if (rc2 > size) - throw new Error(`Overread`); - const memory = this.libzip.HEAPU8.subarray(buffer, buffer + size); - const data = Buffer.from(memory); - if (compressionMethod === 0) { - this.fileSources.set(index, data); - return data; - } else if (opts.asyncDecompress) { - return new Promise((resolve, reject) => { - zlib__default.default.inflateRaw(data, (error, result) => { - if (error) { - reject(error); - } else { - this.fileSources.set(index, result); - resolve(result); - } - }); - }); - } else { - const decompressedData = zlib__default.default.inflateRawSync(data); - this.fileSources.set(index, decompressedData); - return decompressedData; - } - } finally { - this.libzip.fclose(file); - } - } finally { - this.libzip.free(buffer); - } - } - async fchmodPromise(fd, mask) { - return this.chmodPromise(this.fdToPath(fd, `fchmod`), mask); - } - fchmodSync(fd, mask) { - return this.chmodSync(this.fdToPath(fd, `fchmodSync`), mask); - } - async chmodPromise(p, mask) { - return this.chmodSync(p, mask); - } - chmodSync(p, mask) { - if (this.readOnly) - throw EROFS(`chmod '${p}'`); - mask &= 493; - const resolvedP = this.resolveFilename(`chmod '${p}'`, p, false); - const entry = this.entries.get(resolvedP); - if (typeof entry === `undefined`) - throw new Error(`Assertion failed: The entry should have been registered (${resolvedP})`); - const oldMod = this.getUnixMode(entry, fs.constants.S_IFREG | 0); - const newMod = oldMod & ~511 | mask; - const rc = this.libzip.file.setExternalAttributes(this.zip, entry, 0, 0, this.libzip.ZIP_OPSYS_UNIX, newMod << 16); - if (rc === -1) { - throw this.makeLibzipError(this.libzip.getError(this.zip)); - } - } - async fchownPromise(fd, uid, gid) { - return this.chownPromise(this.fdToPath(fd, `fchown`), uid, gid); - } - fchownSync(fd, uid, gid) { - return this.chownSync(this.fdToPath(fd, `fchownSync`), uid, gid); - } - async chownPromise(p, uid, gid) { - return this.chownSync(p, uid, gid); - } - chownSync(p, uid, gid) { - throw new Error(`Unimplemented`); - } - async renamePromise(oldP, newP) { - return this.renameSync(oldP, newP); - } - renameSync(oldP, newP) { - throw new Error(`Unimplemented`); - } - async copyFilePromise(sourceP, destP, flags) { - const { indexSource, indexDest, resolvedDestP } = this.prepareCopyFile(sourceP, destP, flags); - const source = await this.getFileSource(indexSource, { asyncDecompress: true }); - const newIndex = this.setFileSource(resolvedDestP, source); - if (newIndex !== indexDest) { - this.registerEntry(resolvedDestP, newIndex); - } - } - copyFileSync(sourceP, destP, flags = 0) { - const { indexSource, indexDest, resolvedDestP } = this.prepareCopyFile(sourceP, destP, flags); - const source = this.getFileSource(indexSource); - const newIndex = this.setFileSource(resolvedDestP, source); - if (newIndex !== indexDest) { - this.registerEntry(resolvedDestP, newIndex); - } - } - prepareCopyFile(sourceP, destP, flags = 0) { - if (this.readOnly) - throw EROFS(`copyfile '${sourceP} -> '${destP}'`); - if ((flags & fs.constants.COPYFILE_FICLONE_FORCE) !== 0) - throw ENOSYS(`unsupported clone operation`, `copyfile '${sourceP}' -> ${destP}'`); - const resolvedSourceP = this.resolveFilename(`copyfile '${sourceP} -> ${destP}'`, sourceP); - const indexSource = this.entries.get(resolvedSourceP); - if (typeof indexSource === `undefined`) - throw EINVAL(`copyfile '${sourceP}' -> '${destP}'`); - const resolvedDestP = this.resolveFilename(`copyfile '${sourceP}' -> ${destP}'`, destP); - const indexDest = this.entries.get(resolvedDestP); - if ((flags & (fs.constants.COPYFILE_EXCL | fs.constants.COPYFILE_FICLONE_FORCE)) !== 0 && typeof indexDest !== `undefined`) - throw EEXIST(`copyfile '${sourceP}' -> '${destP}'`); - return { - indexSource, - resolvedDestP, - indexDest - }; - } - async appendFilePromise(p, content, opts) { - if (this.readOnly) - throw EROFS(`open '${p}'`); - if (typeof opts === `undefined`) - opts = { flag: `a` }; - else if (typeof opts === `string`) - opts = { flag: `a`, encoding: opts }; - else if (typeof opts.flag === `undefined`) - opts = { flag: `a`, ...opts }; - return this.writeFilePromise(p, content, opts); - } - appendFileSync(p, content, opts = {}) { - if (this.readOnly) - throw EROFS(`open '${p}'`); - if (typeof opts === `undefined`) - opts = { flag: `a` }; - else if (typeof opts === `string`) - opts = { flag: `a`, encoding: opts }; - else if (typeof opts.flag === `undefined`) - opts = { flag: `a`, ...opts }; - return this.writeFileSync(p, content, opts); - } - fdToPath(fd, reason) { - const path = this.fds.get(fd)?.p; - if (typeof path === `undefined`) - throw EBADF(reason); - return path; - } - async writeFilePromise(p, content, opts) { - const { encoding, mode, index, resolvedP } = this.prepareWriteFile(p, opts); - if (index !== void 0 && typeof opts === `object` && opts.flag && opts.flag.includes(`a`)) - content = Buffer.concat([await this.getFileSource(index, { asyncDecompress: true }), Buffer.from(content)]); - if (encoding !== null) - content = content.toString(encoding); - const newIndex = this.setFileSource(resolvedP, content); - if (newIndex !== index) - this.registerEntry(resolvedP, newIndex); - if (mode !== null) { - await this.chmodPromise(resolvedP, mode); - } - } - writeFileSync(p, content, opts) { - const { encoding, mode, index, resolvedP } = this.prepareWriteFile(p, opts); - if (index !== void 0 && typeof opts === `object` && opts.flag && opts.flag.includes(`a`)) - content = Buffer.concat([this.getFileSource(index), Buffer.from(content)]); - if (encoding !== null) - content = content.toString(encoding); - const newIndex = this.setFileSource(resolvedP, content); - if (newIndex !== index) - this.registerEntry(resolvedP, newIndex); - if (mode !== null) { - this.chmodSync(resolvedP, mode); - } - } - prepareWriteFile(p, opts) { - if (typeof p === `number`) - p = this.fdToPath(p, `read`); - if (this.readOnly) - throw EROFS(`open '${p}'`); - const resolvedP = this.resolveFilename(`open '${p}'`, p); - if (this.listings.has(resolvedP)) - throw EISDIR(`open '${p}'`); - let encoding = null, mode = null; - if (typeof opts === `string`) { - encoding = opts; - } else if (typeof opts === `object`) { - ({ - encoding = null, - mode = null - } = opts); - } - const index = this.entries.get(resolvedP); - return { - encoding, - mode, - resolvedP, - index - }; - } - async unlinkPromise(p) { - return this.unlinkSync(p); - } - unlinkSync(p) { - if (this.readOnly) - throw EROFS(`unlink '${p}'`); - const resolvedP = this.resolveFilename(`unlink '${p}'`, p); - if (this.listings.has(resolvedP)) - throw EISDIR(`unlink '${p}'`); - const index = this.entries.get(resolvedP); - if (typeof index === `undefined`) - throw EINVAL(`unlink '${p}'`); - this.deleteEntry(resolvedP, index); - } - async utimesPromise(p, atime, mtime) { - return this.utimesSync(p, atime, mtime); - } - utimesSync(p, atime, mtime) { - if (this.readOnly) - throw EROFS(`utimes '${p}'`); - const resolvedP = this.resolveFilename(`utimes '${p}'`, p); - this.utimesImpl(resolvedP, mtime); - } - async lutimesPromise(p, atime, mtime) { - return this.lutimesSync(p, atime, mtime); - } - lutimesSync(p, atime, mtime) { - if (this.readOnly) - throw EROFS(`lutimes '${p}'`); - const resolvedP = this.resolveFilename(`utimes '${p}'`, p, false); - this.utimesImpl(resolvedP, mtime); - } - utimesImpl(resolvedP, mtime) { - if (this.listings.has(resolvedP)) { - if (!this.entries.has(resolvedP)) - this.hydrateDirectory(resolvedP); - } - const entry = this.entries.get(resolvedP); - if (entry === void 0) - throw new Error(`Unreachable`); - const rc = this.libzip.file.setMtime(this.zip, entry, 0, toUnixTimestamp(mtime), 0); - if (rc === -1) { - throw this.makeLibzipError(this.libzip.getError(this.zip)); - } - } - async mkdirPromise(p, opts) { - return this.mkdirSync(p, opts); - } - mkdirSync(p, { mode = 493, recursive = false } = {}) { - if (recursive) - return this.mkdirpSync(p, { chmod: mode }); - if (this.readOnly) - throw EROFS(`mkdir '${p}'`); - const resolvedP = this.resolveFilename(`mkdir '${p}'`, p); - if (this.entries.has(resolvedP) || this.listings.has(resolvedP)) - throw EEXIST(`mkdir '${p}'`); - this.hydrateDirectory(resolvedP); - this.chmodSync(resolvedP, mode); - return void 0; - } - async rmdirPromise(p, opts) { - return this.rmdirSync(p, opts); - } - rmdirSync(p, { recursive = false } = {}) { - if (this.readOnly) - throw EROFS(`rmdir '${p}'`); - if (recursive) { - this.removeSync(p); - return; - } - const resolvedP = this.resolveFilename(`rmdir '${p}'`, p); - const directoryListing = this.listings.get(resolvedP); - if (!directoryListing) - throw ENOTDIR(`rmdir '${p}'`); - if (directoryListing.size > 0) - throw ENOTEMPTY(`rmdir '${p}'`); - const index = this.entries.get(resolvedP); - if (typeof index === `undefined`) - throw EINVAL(`rmdir '${p}'`); - this.deleteEntry(p, index); - } - async rmPromise(p, opts) { - return this.rmSync(p, opts); - } - rmSync(p, { recursive = false } = {}) { - if (this.readOnly) - throw EROFS(`rm '${p}'`); - if (recursive) { - this.removeSync(p); - return; - } - const resolvedP = this.resolveFilename(`rm '${p}'`, p); - const directoryListing = this.listings.get(resolvedP); - if (!directoryListing) - throw ENOTDIR(`rm '${p}'`); - if (directoryListing.size > 0) - throw ENOTEMPTY(`rm '${p}'`); - const index = this.entries.get(resolvedP); - if (typeof index === `undefined`) - throw EINVAL(`rm '${p}'`); - this.deleteEntry(p, index); - } - hydrateDirectory(resolvedP) { - const index = this.libzip.dir.add(this.zip, ppath.relative(PortablePath.root, resolvedP)); - if (index === -1) - throw this.makeLibzipError(this.libzip.getError(this.zip)); - this.registerListing(resolvedP); - this.registerEntry(resolvedP, index); - return index; - } - async linkPromise(existingP, newP) { - return this.linkSync(existingP, newP); - } - linkSync(existingP, newP) { - throw EOPNOTSUPP(`link '${existingP}' -> '${newP}'`); - } - async symlinkPromise(target, p) { - return this.symlinkSync(target, p); - } - symlinkSync(target, p) { - if (this.readOnly) - throw EROFS(`symlink '${target}' -> '${p}'`); - const resolvedP = this.resolveFilename(`symlink '${target}' -> '${p}'`, p); - if (this.listings.has(resolvedP)) - throw EISDIR(`symlink '${target}' -> '${p}'`); - if (this.entries.has(resolvedP)) - throw EEXIST(`symlink '${target}' -> '${p}'`); - const index = this.setFileSource(resolvedP, target); - this.registerEntry(resolvedP, index); - const rc = this.libzip.file.setExternalAttributes(this.zip, index, 0, 0, this.libzip.ZIP_OPSYS_UNIX, (fs.constants.S_IFLNK | 511) << 16); - if (rc === -1) - throw this.makeLibzipError(this.libzip.getError(this.zip)); - this.symlinkCount += 1; - } - async readFilePromise(p, encoding) { - if (typeof encoding === `object`) - encoding = encoding ? encoding.encoding : void 0; - const data = await this.readFileBuffer(p, { asyncDecompress: true }); - return encoding ? data.toString(encoding) : data; - } - readFileSync(p, encoding) { - if (typeof encoding === `object`) - encoding = encoding ? encoding.encoding : void 0; - const data = this.readFileBuffer(p); - return encoding ? data.toString(encoding) : data; - } - readFileBuffer(p, opts = { asyncDecompress: false }) { - if (typeof p === `number`) - p = this.fdToPath(p, `read`); - const resolvedP = this.resolveFilename(`open '${p}'`, p); - if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) - throw ENOENT(`open '${p}'`); - if (p[p.length - 1] === `/` && !this.listings.has(resolvedP)) - throw ENOTDIR(`open '${p}'`); - if (this.listings.has(resolvedP)) - throw EISDIR(`read`); - const entry = this.entries.get(resolvedP); - if (entry === void 0) - throw new Error(`Unreachable`); - return this.getFileSource(entry, opts); - } - async readdirPromise(p, opts) { - return this.readdirSync(p, opts); - } - readdirSync(p, opts) { - const resolvedP = this.resolveFilename(`scandir '${p}'`, p); - if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) - throw ENOENT(`scandir '${p}'`); - const directoryListing = this.listings.get(resolvedP); - if (!directoryListing) - throw ENOTDIR(`scandir '${p}'`); - if (opts?.recursive) { - if (opts?.withFileTypes) { - const entries = Array.from(directoryListing, (name) => { - return Object.assign(this.statImpl(`lstat`, ppath.join(p, name)), { - name, - path: PortablePath.dot - }); - }); - for (const entry of entries) { - if (!entry.isDirectory()) - continue; - const subPath = ppath.join(entry.path, entry.name); - const subListing = this.listings.get(ppath.join(resolvedP, subPath)); - for (const child of subListing) { - entries.push(Object.assign(this.statImpl(`lstat`, ppath.join(p, subPath, child)), { - name: child, - path: subPath - })); - } - } - return entries; - } else { - const entries = [...directoryListing]; - for (const subPath of entries) { - const subListing = this.listings.get(ppath.join(resolvedP, subPath)); - if (typeof subListing === `undefined`) - continue; - for (const child of subListing) { - entries.push(ppath.join(subPath, child)); - } - } - return entries; - } - } else if (opts?.withFileTypes) { - return Array.from(directoryListing, (name) => { - return Object.assign(this.statImpl(`lstat`, ppath.join(p, name)), { - name, - path: void 0 - }); - }); - } else { - return [...directoryListing]; - } - } - async readlinkPromise(p) { - const entry = this.prepareReadlink(p); - return (await this.getFileSource(entry, { asyncDecompress: true })).toString(); - } - readlinkSync(p) { - const entry = this.prepareReadlink(p); - return this.getFileSource(entry).toString(); - } - prepareReadlink(p) { - const resolvedP = this.resolveFilename(`readlink '${p}'`, p, false); - if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) - throw ENOENT(`readlink '${p}'`); - if (p[p.length - 1] === `/` && !this.listings.has(resolvedP)) - throw ENOTDIR(`open '${p}'`); - if (this.listings.has(resolvedP)) - throw EINVAL(`readlink '${p}'`); - const entry = this.entries.get(resolvedP); - if (entry === void 0) - throw new Error(`Unreachable`); - if (!this.isSymbolicLink(entry)) - throw EINVAL(`readlink '${p}'`); - return entry; - } - async truncatePromise(p, len = 0) { - const resolvedP = this.resolveFilename(`open '${p}'`, p); - const index = this.entries.get(resolvedP); - if (typeof index === `undefined`) - throw EINVAL(`open '${p}'`); - const source = await this.getFileSource(index, { asyncDecompress: true }); - const truncated = Buffer.alloc(len, 0); - source.copy(truncated); - return await this.writeFilePromise(p, truncated); - } - truncateSync(p, len = 0) { - const resolvedP = this.resolveFilename(`open '${p}'`, p); - const index = this.entries.get(resolvedP); - if (typeof index === `undefined`) - throw EINVAL(`open '${p}'`); - const source = this.getFileSource(index); - const truncated = Buffer.alloc(len, 0); - source.copy(truncated); - return this.writeFileSync(p, truncated); - } - async ftruncatePromise(fd, len) { - return this.truncatePromise(this.fdToPath(fd, `ftruncate`), len); - } - ftruncateSync(fd, len) { - return this.truncateSync(this.fdToPath(fd, `ftruncateSync`), len); - } - watch(p, a, b) { - let persistent; - switch (typeof a) { - case `function`: - case `string`: - case `undefined`: - { - persistent = true; - } - break; - default: - { - ({ persistent = true } = a); - } - break; - } - if (!persistent) - return { on: () => { - }, close: () => { - } }; - const interval = setInterval(() => { - }, 24 * 60 * 60 * 1e3); - return { on: () => { - }, close: () => { - clearInterval(interval); - } }; - } - watchFile(p, a, b) { - const resolvedP = ppath.resolve(PortablePath.root, p); - return watchFile(this, resolvedP, a, b); - } - unwatchFile(p, cb) { - const resolvedP = ppath.resolve(PortablePath.root, p); - return unwatchFile(this, resolvedP, cb); - } -} - -setFactory(() => { - const emZip = createModule(); - return makeInterface(emZip); -}); - -var ErrorCode = /* @__PURE__ */ ((ErrorCode2) => { - ErrorCode2["API_ERROR"] = `API_ERROR`; - ErrorCode2["BUILTIN_NODE_RESOLUTION_FAILED"] = `BUILTIN_NODE_RESOLUTION_FAILED`; - ErrorCode2["EXPORTS_RESOLUTION_FAILED"] = `EXPORTS_RESOLUTION_FAILED`; - ErrorCode2["MISSING_DEPENDENCY"] = `MISSING_DEPENDENCY`; - ErrorCode2["MISSING_PEER_DEPENDENCY"] = `MISSING_PEER_DEPENDENCY`; - ErrorCode2["QUALIFIED_PATH_RESOLUTION_FAILED"] = `QUALIFIED_PATH_RESOLUTION_FAILED`; - ErrorCode2["INTERNAL"] = `INTERNAL`; - ErrorCode2["UNDECLARED_DEPENDENCY"] = `UNDECLARED_DEPENDENCY`; - ErrorCode2["UNSUPPORTED"] = `UNSUPPORTED`; - return ErrorCode2; -})(ErrorCode || {}); -const MODULE_NOT_FOUND_ERRORS = /* @__PURE__ */ new Set([ - "BUILTIN_NODE_RESOLUTION_FAILED" /* BUILTIN_NODE_RESOLUTION_FAILED */, - "MISSING_DEPENDENCY" /* MISSING_DEPENDENCY */, - "MISSING_PEER_DEPENDENCY" /* MISSING_PEER_DEPENDENCY */, - "QUALIFIED_PATH_RESOLUTION_FAILED" /* QUALIFIED_PATH_RESOLUTION_FAILED */, - "UNDECLARED_DEPENDENCY" /* UNDECLARED_DEPENDENCY */ -]); -function makeError(pnpCode, message, data = {}, code) { - code ??= MODULE_NOT_FOUND_ERRORS.has(pnpCode) ? `MODULE_NOT_FOUND` : pnpCode; - const propertySpec = { - configurable: true, - writable: true, - enumerable: false - }; - return Object.defineProperties(new Error(message), { - code: { - ...propertySpec, - value: code - }, - pnpCode: { - ...propertySpec, - value: pnpCode - }, - data: { - ...propertySpec, - value: data - } - }); -} -function getIssuerModule(parent) { - let issuer = parent; - while (issuer && (issuer.id === `[eval]` || issuer.id === `` || !issuer.filename)) - issuer = issuer.parent; - return issuer || null; -} -function getPathForDisplay(p) { - return npath.normalize(npath.fromPortablePath(p)); -} - -const [major, minor] = process.versions.node.split(`.`).map((value) => parseInt(value, 10)); -const WATCH_MODE_MESSAGE_USES_ARRAYS = major > 19 || major === 19 && minor >= 2 || major === 18 && minor >= 13; - -function readPackageScope(checkPath) { - const rootSeparatorIndex = checkPath.indexOf(npath.sep); - let separatorIndex; - do { - separatorIndex = checkPath.lastIndexOf(npath.sep); - checkPath = checkPath.slice(0, separatorIndex); - if (checkPath.endsWith(`${npath.sep}node_modules`)) - return false; - const pjson = readPackage(checkPath + npath.sep); - if (pjson) { - return { - data: pjson, - path: checkPath - }; - } - } while (separatorIndex > rootSeparatorIndex); - return false; -} -function readPackage(requestPath) { - const jsonPath = npath.resolve(requestPath, `package.json`); - if (!fs__default.default.existsSync(jsonPath)) - return null; - return JSON.parse(fs__default.default.readFileSync(jsonPath, `utf8`)); -} -function ERR_REQUIRE_ESM(filename, parentPath = null) { - const basename = parentPath && path__default.default.basename(filename) === path__default.default.basename(parentPath) ? filename : path__default.default.basename(filename); - const msg = `require() of ES Module ${filename}${parentPath ? ` from ${parentPath}` : ``} not supported. -Instead change the require of ${basename} in ${parentPath} to a dynamic import() which is available in all CommonJS modules.`; - const err = new Error(msg); - err.code = `ERR_REQUIRE_ESM`; - return err; -} -function reportRequiredFilesToWatchMode(files) { - if (process.env.WATCH_REPORT_DEPENDENCIES && process.send) { - files = files.map((filename) => npath.fromPortablePath(VirtualFS.resolveVirtual(npath.toPortablePath(filename)))); - if (WATCH_MODE_MESSAGE_USES_ARRAYS) { - process.send({ "watch:require": files }); - } else { - for (const filename of files) { - process.send({ "watch:require": filename }); - } - } - } -} - -function applyPatch(pnpapi, opts) { - let enableNativeHooks = true; - process.versions.pnp = String(pnpapi.VERSIONS.std); - const moduleExports = require$$0__default.default; - moduleExports.findPnpApi = (lookupSource) => { - const lookupPath = lookupSource instanceof URL ? url.fileURLToPath(lookupSource) : lookupSource; - const apiPath = opts.manager.findApiPathFor(lookupPath); - if (apiPath === null) - return null; - const apiEntry = opts.manager.getApiEntry(apiPath, true); - return apiEntry.instance.findPackageLocator(lookupPath) ? apiEntry.instance : null; - }; - function getRequireStack(parent) { - const requireStack = []; - for (let cursor = parent; cursor; cursor = cursor.parent) - requireStack.push(cursor.filename || cursor.id); - return requireStack; - } - const originalModuleLoad = require$$0.Module._load; - require$$0.Module._load = function(request, parent, isMain) { - if (request === `pnpapi`) { - const parentApiPath = opts.manager.getApiPathFromParent(parent); - if (parentApiPath) { - return opts.manager.getApiEntry(parentApiPath, true).instance; - } - } - return originalModuleLoad.call(require$$0.Module, request, parent, isMain); - }; - function getIssuerSpecsFromPaths(paths) { - return paths.map((path) => ({ - apiPath: opts.manager.findApiPathFor(path), - path, - module: null - })); - } - function getIssuerSpecsFromModule(module) { - if (module && module.id !== `` && module.id !== `internal/preload` && !module.parent && !module.filename && module.paths.length > 0) { - return [{ - apiPath: opts.manager.findApiPathFor(module.paths[0]), - path: module.paths[0], - module - }]; - } - const issuer = getIssuerModule(module); - if (issuer !== null) { - const path = npath.dirname(issuer.filename); - const apiPath = opts.manager.getApiPathFromParent(issuer); - return [{ apiPath, path, module }]; - } else { - const path = process.cwd(); - const apiPath = opts.manager.findApiPathFor(npath.join(path, `[file]`)) ?? opts.manager.getApiPathFromParent(null); - return [{ apiPath, path, module }]; - } - } - function makeFakeParent(path) { - const fakeParent = new require$$0.Module(``); - const fakeFilePath = npath.join(path, `[file]`); - fakeParent.paths = require$$0.Module._nodeModulePaths(fakeFilePath); - return fakeParent; - } - const pathRegExp = /^(?![a-zA-Z]:[\\/]|\\\\|\.{0,2}(?:\/|$))((?:@[^/]+\/)?[^/]+)\/*(.*|)$/; - const originalModuleResolveFilename = require$$0.Module._resolveFilename; - require$$0.Module._resolveFilename = function(request, parent, isMain, options) { - if (require$$0.isBuiltin(request)) - return request; - if (!enableNativeHooks) - return originalModuleResolveFilename.call(require$$0.Module, request, parent, isMain, options); - if (options && options.plugnplay === false) { - const { plugnplay, ...forwardedOptions } = options; - try { - enableNativeHooks = false; - return originalModuleResolveFilename.call(require$$0.Module, request, parent, isMain, forwardedOptions); - } finally { - enableNativeHooks = true; - } - } - if (options) { - const optionNames = new Set(Object.keys(options)); - optionNames.delete(`paths`); - optionNames.delete(`plugnplay`); - if (optionNames.size > 0) { - throw makeError( - ErrorCode.UNSUPPORTED, - `Some options passed to require() aren't supported by PnP yet (${Array.from(optionNames).join(`, `)})` - ); - } - } - const issuerSpecs = options && options.paths ? getIssuerSpecsFromPaths(options.paths) : getIssuerSpecsFromModule(parent); - if (request.match(pathRegExp) === null) { - const parentDirectory = parent?.filename != null ? npath.dirname(parent.filename) : null; - const absoluteRequest = npath.isAbsolute(request) ? request : parentDirectory !== null ? npath.resolve(parentDirectory, request) : null; - if (absoluteRequest !== null) { - const apiPath = parent && parentDirectory === npath.dirname(absoluteRequest) ? opts.manager.getApiPathFromParent(parent) : opts.manager.findApiPathFor(absoluteRequest); - if (apiPath !== null) { - issuerSpecs.unshift({ - apiPath, - path: parentDirectory, - module: null - }); - } - } - } - let firstError; - for (const { apiPath, path, module } of issuerSpecs) { - let resolution; - const issuerApi = apiPath !== null ? opts.manager.getApiEntry(apiPath, true).instance : null; - try { - if (issuerApi !== null) { - resolution = issuerApi.resolveRequest(request, path !== null ? `${path}/` : null); - } else { - if (path === null) - throw new Error(`Assertion failed: Expected the path to be set`); - resolution = originalModuleResolveFilename.call(require$$0.Module, request, module || makeFakeParent(path), isMain); - } - } catch (error) { - firstError = firstError || error; - continue; - } - if (resolution !== null) { - return resolution; - } - } - const requireStack = getRequireStack(parent); - Object.defineProperty(firstError, `requireStack`, { - configurable: true, - writable: true, - enumerable: false, - value: requireStack - }); - if (requireStack.length > 0) - firstError.message += ` -Require stack: -- ${requireStack.join(` -- `)}`; - if (typeof firstError.pnpCode === `string`) - Error.captureStackTrace(firstError); - throw firstError; - }; - const originalFindPath = require$$0.Module._findPath; - require$$0.Module._findPath = function(request, paths, isMain) { - if (request === `pnpapi`) - return false; - if (!enableNativeHooks) - return originalFindPath.call(require$$0.Module, request, paths, isMain); - const isAbsolute = npath.isAbsolute(request); - if (isAbsolute) - paths = [``]; - else if (!paths || paths.length === 0) - return false; - for (const path of paths) { - let resolution; - try { - const pnpApiPath = opts.manager.findApiPathFor(isAbsolute ? request : path); - if (pnpApiPath !== null) { - const api = opts.manager.getApiEntry(pnpApiPath, true).instance; - resolution = api.resolveRequest(request, path) || false; - } else { - resolution = originalFindPath.call(require$$0.Module, request, [path], isMain); - } - } catch (error) { - continue; - } - if (resolution) { - return resolution; - } - } - return false; - }; - const originalExtensionJSFunction = require$$0.Module._extensions[`.js`]; - require$$0.Module._extensions[`.js`] = function(module, filename) { - if (filename.endsWith(`.js`)) { - const pkg = readPackageScope(filename); - if (pkg && pkg.data?.type === `module`) { - const err = ERR_REQUIRE_ESM(filename, module.parent?.filename); - Error.captureStackTrace(err); - throw err; - } - } - originalExtensionJSFunction.call(this, module, filename); - }; - const originalDlopen = process.dlopen; - process.dlopen = function(...args) { - const [module, filename, ...rest] = args; - return originalDlopen.call( - this, - module, - npath.fromPortablePath(VirtualFS.resolveVirtual(npath.toPortablePath(filename))), - ...rest - ); - }; - const originalEmit = process.emit; - process.emit = function(name, data, ...args) { - if (name === `warning` && typeof data === `object` && data.name === `ExperimentalWarning` && (data.message.includes(`--experimental-loader`) || data.message.includes(`Custom ESM Loaders is an experimental feature`))) - return false; - return originalEmit.apply(process, arguments); - }; - patchFs(fs__default.default, new PosixFS(opts.fakeFs)); -} - -function hydrateRuntimeState(data, { basePath }) { - const portablePath = npath.toPortablePath(basePath); - const absolutePortablePath = ppath.resolve(portablePath); - const ignorePattern = data.ignorePatternData !== null ? new RegExp(data.ignorePatternData) : null; - const packageLocatorsByLocations = /* @__PURE__ */ new Map(); - const packageRegistry = new Map(data.packageRegistryData.map(([packageName, packageStoreData]) => { - return [packageName, new Map(packageStoreData.map(([packageReference, packageInformationData]) => { - if (packageName === null !== (packageReference === null)) - throw new Error(`Assertion failed: The name and reference should be null, or neither should`); - const discardFromLookup = packageInformationData.discardFromLookup ?? false; - const packageLocator = { name: packageName, reference: packageReference }; - const entry = packageLocatorsByLocations.get(packageInformationData.packageLocation); - if (!entry) { - packageLocatorsByLocations.set(packageInformationData.packageLocation, { locator: packageLocator, discardFromLookup }); - } else { - entry.discardFromLookup = entry.discardFromLookup && discardFromLookup; - if (!discardFromLookup) { - entry.locator = packageLocator; - } - } - let resolvedPackageLocation = null; - return [packageReference, { - packageDependencies: new Map(packageInformationData.packageDependencies), - packagePeers: new Set(packageInformationData.packagePeers), - linkType: packageInformationData.linkType, - discardFromLookup, - get packageLocation() { - return resolvedPackageLocation || (resolvedPackageLocation = ppath.join(absolutePortablePath, packageInformationData.packageLocation)); - } - }]; - }))]; - })); - const fallbackExclusionList = new Map(data.fallbackExclusionList.map(([packageName, packageReferences]) => { - return [packageName, new Set(packageReferences)]; - })); - const fallbackPool = new Map(data.fallbackPool); - const dependencyTreeRoots = data.dependencyTreeRoots; - const enableTopLevelFallback = data.enableTopLevelFallback; - return { - basePath: portablePath, - dependencyTreeRoots, - enableTopLevelFallback, - fallbackExclusionList, - fallbackPool, - ignorePattern, - packageLocatorsByLocations, - packageRegistry - }; -} - -const ArrayIsArray = Array.isArray; -const JSONStringify = JSON.stringify; -const ObjectGetOwnPropertyNames = Object.getOwnPropertyNames; -const ObjectPrototypeHasOwnProperty = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop); -const RegExpPrototypeExec = (obj, string) => RegExp.prototype.exec.call(obj, string); -const RegExpPrototypeSymbolReplace = (obj, ...rest) => RegExp.prototype[Symbol.replace].apply(obj, rest); -const StringPrototypeEndsWith = (str, ...rest) => String.prototype.endsWith.apply(str, rest); -const StringPrototypeIncludes = (str, ...rest) => String.prototype.includes.apply(str, rest); -const StringPrototypeLastIndexOf = (str, ...rest) => String.prototype.lastIndexOf.apply(str, rest); -const StringPrototypeIndexOf = (str, ...rest) => String.prototype.indexOf.apply(str, rest); -const StringPrototypeReplace = (str, ...rest) => String.prototype.replace.apply(str, rest); -const StringPrototypeSlice = (str, ...rest) => String.prototype.slice.apply(str, rest); -const StringPrototypeStartsWith = (str, ...rest) => String.prototype.startsWith.apply(str, rest); -const SafeMap = Map; -const JSONParse = JSON.parse; - -function createErrorType(code, messageCreator, errorType) { - return class extends errorType { - constructor(...args) { - super(messageCreator(...args)); - this.code = code; - this.name = `${errorType.name} [${code}]`; - } - }; -} -const ERR_PACKAGE_IMPORT_NOT_DEFINED = createErrorType( - `ERR_PACKAGE_IMPORT_NOT_DEFINED`, - (specifier, packagePath, base) => { - return `Package import specifier "${specifier}" is not defined${packagePath ? ` in package ${packagePath}package.json` : ``} imported from ${base}`; - }, - TypeError -); -const ERR_INVALID_MODULE_SPECIFIER = createErrorType( - `ERR_INVALID_MODULE_SPECIFIER`, - (request, reason, base = void 0) => { - return `Invalid module "${request}" ${reason}${base ? ` imported from ${base}` : ``}`; - }, - TypeError -); -const ERR_INVALID_PACKAGE_TARGET = createErrorType( - `ERR_INVALID_PACKAGE_TARGET`, - (pkgPath, key, target, isImport = false, base = void 0) => { - const relError = typeof target === `string` && !isImport && target.length && !StringPrototypeStartsWith(target, `./`); - if (key === `.`) { - assert__default.default(isImport === false); - return `Invalid "exports" main target ${JSONStringify(target)} defined in the package config ${pkgPath}package.json${base ? ` imported from ${base}` : ``}${relError ? `; targets must start with "./"` : ``}`; - } - return `Invalid "${isImport ? `imports` : `exports`}" target ${JSONStringify( - target - )} defined for '${key}' in the package config ${pkgPath}package.json${base ? ` imported from ${base}` : ``}${relError ? `; targets must start with "./"` : ``}`; - }, - Error -); -const ERR_INVALID_PACKAGE_CONFIG = createErrorType( - `ERR_INVALID_PACKAGE_CONFIG`, - (path, base, message) => { - return `Invalid package config ${path}${base ? ` while importing ${base}` : ``}${message ? `. ${message}` : ``}`; - }, - Error -); -const ERR_PACKAGE_PATH_NOT_EXPORTED = createErrorType( - "ERR_PACKAGE_PATH_NOT_EXPORTED", - (pkgPath, subpath, base = void 0) => { - if (subpath === ".") - return `No "exports" main defined in ${pkgPath}package.json${base ? ` imported from ${base}` : ""}`; - return `Package subpath '${subpath}' is not defined by "exports" in ${pkgPath}package.json${base ? ` imported from ${base}` : ""}`; - }, - Error -); - -function filterOwnProperties(source, keys) { - const filtered = /* @__PURE__ */ Object.create(null); - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - if (ObjectPrototypeHasOwnProperty(source, key)) { - filtered[key] = source[key]; - } - } - return filtered; -} - -const packageJSONCache = new SafeMap(); -function getPackageConfig(path, specifier, base, readFileSyncFn) { - const existing = packageJSONCache.get(path); - if (existing !== void 0) { - return existing; - } - const source = readFileSyncFn(path); - if (source === void 0) { - const packageConfig2 = { - pjsonPath: path, - exists: false, - main: void 0, - name: void 0, - type: "none", - exports: void 0, - imports: void 0 - }; - packageJSONCache.set(path, packageConfig2); - return packageConfig2; - } - let packageJSON; - try { - packageJSON = JSONParse(source); - } catch (error) { - throw new ERR_INVALID_PACKAGE_CONFIG( - path, - (base ? `"${specifier}" from ` : "") + url.fileURLToPath(base || specifier), - error.message - ); - } - let { imports, main, name, type } = filterOwnProperties(packageJSON, [ - "imports", - "main", - "name", - "type" - ]); - const exports = ObjectPrototypeHasOwnProperty(packageJSON, "exports") ? packageJSON.exports : void 0; - if (typeof imports !== "object" || imports === null) { - imports = void 0; - } - if (typeof main !== "string") { - main = void 0; - } - if (typeof name !== "string") { - name = void 0; - } - if (type !== "module" && type !== "commonjs") { - type = "none"; - } - const packageConfig = { - pjsonPath: path, - exists: true, - main, - name, - type, - exports, - imports - }; - packageJSONCache.set(path, packageConfig); - return packageConfig; -} -function getPackageScopeConfig(resolved, readFileSyncFn) { - let packageJSONUrl = new URL("./package.json", resolved); - while (true) { - const packageJSONPath2 = packageJSONUrl.pathname; - if (StringPrototypeEndsWith(packageJSONPath2, "node_modules/package.json")) { - break; - } - const packageConfig2 = getPackageConfig( - url.fileURLToPath(packageJSONUrl), - resolved, - void 0, - readFileSyncFn - ); - if (packageConfig2.exists) { - return packageConfig2; - } - const lastPackageJSONUrl = packageJSONUrl; - packageJSONUrl = new URL("../package.json", packageJSONUrl); - if (packageJSONUrl.pathname === lastPackageJSONUrl.pathname) { - break; - } - } - const packageJSONPath = url.fileURLToPath(packageJSONUrl); - const packageConfig = { - pjsonPath: packageJSONPath, - exists: false, - main: void 0, - name: void 0, - type: "none", - exports: void 0, - imports: void 0 - }; - packageJSONCache.set(packageJSONPath, packageConfig); - return packageConfig; -} - -function throwImportNotDefined(specifier, packageJSONUrl, base) { - throw new ERR_PACKAGE_IMPORT_NOT_DEFINED( - specifier, - packageJSONUrl && url.fileURLToPath(new URL(".", packageJSONUrl)), - url.fileURLToPath(base) - ); -} -function throwInvalidSubpath(subpath, packageJSONUrl, internal, base) { - const reason = `request is not a valid subpath for the "${internal ? "imports" : "exports"}" resolution of ${url.fileURLToPath(packageJSONUrl)}`; - throw new ERR_INVALID_MODULE_SPECIFIER( - subpath, - reason, - base && url.fileURLToPath(base) - ); -} -function throwInvalidPackageTarget(subpath, target, packageJSONUrl, internal, base) { - if (typeof target === "object" && target !== null) { - target = JSONStringify(target, null, ""); - } else { - target = `${target}`; - } - throw new ERR_INVALID_PACKAGE_TARGET( - url.fileURLToPath(new URL(".", packageJSONUrl)), - subpath, - target, - internal, - base && url.fileURLToPath(base) - ); -} -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; -const patternRegEx = /\*/g; -function resolvePackageTargetString(target, subpath, match, packageJSONUrl, base, pattern, internal, conditions) { - if (subpath !== "" && !pattern && target[target.length - 1] !== "/") - throwInvalidPackageTarget(match, target, packageJSONUrl, internal, base); - if (!StringPrototypeStartsWith(target, "./")) { - if (internal && !StringPrototypeStartsWith(target, "../") && !StringPrototypeStartsWith(target, "/")) { - let isURL = false; - try { - new URL(target); - isURL = true; - } catch { - } - if (!isURL) { - const exportTarget = pattern ? RegExpPrototypeSymbolReplace(patternRegEx, target, () => subpath) : target + subpath; - return exportTarget; - } - } - throwInvalidPackageTarget(match, target, packageJSONUrl, internal, base); - } - if (RegExpPrototypeExec( - invalidSegmentRegEx, - StringPrototypeSlice(target, 2) - ) !== null) - throwInvalidPackageTarget(match, target, packageJSONUrl, internal, base); - const resolved = new URL(target, packageJSONUrl); - const resolvedPath = resolved.pathname; - const packagePath = new URL(".", packageJSONUrl).pathname; - if (!StringPrototypeStartsWith(resolvedPath, packagePath)) - throwInvalidPackageTarget(match, target, packageJSONUrl, internal, base); - if (subpath === "") - return resolved; - if (RegExpPrototypeExec(invalidSegmentRegEx, subpath) !== null) { - const request = pattern ? StringPrototypeReplace(match, "*", () => subpath) : match + subpath; - throwInvalidSubpath(request, packageJSONUrl, internal, base); - } - if (pattern) { - return new URL( - RegExpPrototypeSymbolReplace(patternRegEx, resolved.href, () => subpath) - ); - } - return new URL(subpath, resolved); -} -function isArrayIndex(key) { - const keyNum = +key; - if (`${keyNum}` !== key) - return false; - return keyNum >= 0 && keyNum < 4294967295; -} -function resolvePackageTarget(packageJSONUrl, target, subpath, packageSubpath, base, pattern, internal, conditions) { - if (typeof target === "string") { - return resolvePackageTargetString( - target, - subpath, - packageSubpath, - packageJSONUrl, - base, - pattern, - internal); - } else if (ArrayIsArray(target)) { - if (target.length === 0) { - return null; - } - let lastException; - for (let i = 0; i < target.length; i++) { - const targetItem = target[i]; - let resolveResult; - try { - resolveResult = resolvePackageTarget( - packageJSONUrl, - targetItem, - subpath, - packageSubpath, - base, - pattern, - internal, - conditions - ); - } catch (e) { - lastException = e; - if (e.code === "ERR_INVALID_PACKAGE_TARGET") { - continue; - } - throw e; - } - if (resolveResult === void 0) { - continue; - } - if (resolveResult === null) { - lastException = null; - continue; - } - return resolveResult; - } - if (lastException === void 0 || lastException === null) - return lastException; - throw lastException; - } else if (typeof target === "object" && target !== null) { - const keys = ObjectGetOwnPropertyNames(target); - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - if (isArrayIndex(key)) { - throw new ERR_INVALID_PACKAGE_CONFIG( - url.fileURLToPath(packageJSONUrl), - base, - '"exports" cannot contain numeric property keys.' - ); - } - } - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - if (key === "default" || conditions.has(key)) { - const conditionalTarget = target[key]; - const resolveResult = resolvePackageTarget( - packageJSONUrl, - conditionalTarget, - subpath, - packageSubpath, - base, - pattern, - internal, - conditions - ); - if (resolveResult === void 0) - continue; - return resolveResult; - } - } - return void 0; - } else if (target === null) { - return null; - } - throwInvalidPackageTarget( - packageSubpath, - target, - packageJSONUrl, - internal, - base - ); -} -function patternKeyCompare(a, b) { - const aPatternIndex = StringPrototypeIndexOf(a, "*"); - const bPatternIndex = StringPrototypeIndexOf(b, "*"); - 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; -} -function isConditionalExportsMainSugar(exports, packageJSONUrl, base) { - if (typeof exports === "string" || ArrayIsArray(exports)) - return true; - if (typeof exports !== "object" || exports === null) - return false; - const keys = ObjectGetOwnPropertyNames(exports); - let isConditionalSugar = false; - let i = 0; - for (let j = 0; j < keys.length; j++) { - const key = keys[j]; - const curIsConditionalSugar = key === "" || key[0] !== "."; - if (i++ === 0) { - isConditionalSugar = curIsConditionalSugar; - } else if (isConditionalSugar !== curIsConditionalSugar) { - throw new ERR_INVALID_PACKAGE_CONFIG( - url.fileURLToPath(packageJSONUrl), - base, - `"exports" cannot contain some keys starting with '.' and some not. The exports object must either be an object of package subpath keys or an object of main entry condition name keys only.` - ); - } - } - return isConditionalSugar; -} -function throwExportsNotFound(subpath, packageJSONUrl, base) { - throw new ERR_PACKAGE_PATH_NOT_EXPORTED( - url.fileURLToPath(new URL(".", packageJSONUrl)), - subpath, - base && url.fileURLToPath(base) - ); -} -const emittedPackageWarnings = /* @__PURE__ */ new Set(); -function emitTrailingSlashPatternDeprecation(match, pjsonUrl, base) { - const pjsonPath = url.fileURLToPath(pjsonUrl); - if (emittedPackageWarnings.has(pjsonPath + "|" + match)) - return; - emittedPackageWarnings.add(pjsonPath + "|" + match); - process.emitWarning( - `Use of deprecated trailing slash pattern mapping "${match}" in the "exports" field module resolution of the package at ${pjsonPath}${base ? ` imported from ${url.fileURLToPath(base)}` : ""}. Mapping specifiers ending in "/" is no longer supported.`, - "DeprecationWarning", - "DEP0155" - ); -} -function packageExportsResolve({ - packageJSONUrl, - packageSubpath, - exports, - base, - conditions -}) { - if (isConditionalExportsMainSugar(exports, packageJSONUrl, base)) - exports = { ".": exports }; - if (ObjectPrototypeHasOwnProperty(exports, packageSubpath) && !StringPrototypeIncludes(packageSubpath, "*") && !StringPrototypeEndsWith(packageSubpath, "/")) { - const target = exports[packageSubpath]; - const resolveResult = resolvePackageTarget( - packageJSONUrl, - target, - "", - packageSubpath, - base, - false, - false, - conditions - ); - if (resolveResult == null) { - throwExportsNotFound(packageSubpath, packageJSONUrl, base); - } - return resolveResult; - } - let bestMatch = ""; - let bestMatchSubpath; - const keys = ObjectGetOwnPropertyNames(exports); - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - const patternIndex = StringPrototypeIndexOf(key, "*"); - if (patternIndex !== -1 && StringPrototypeStartsWith( - packageSubpath, - StringPrototypeSlice(key, 0, patternIndex) - )) { - if (StringPrototypeEndsWith(packageSubpath, "/")) - emitTrailingSlashPatternDeprecation( - packageSubpath, - packageJSONUrl, - base - ); - const patternTrailer = StringPrototypeSlice(key, patternIndex + 1); - if (packageSubpath.length >= key.length && StringPrototypeEndsWith(packageSubpath, patternTrailer) && patternKeyCompare(bestMatch, key) === 1 && StringPrototypeLastIndexOf(key, "*") === patternIndex) { - bestMatch = key; - bestMatchSubpath = StringPrototypeSlice( - packageSubpath, - patternIndex, - packageSubpath.length - patternTrailer.length - ); - } - } - } - if (bestMatch) { - const target = exports[bestMatch]; - const resolveResult = resolvePackageTarget( - packageJSONUrl, - target, - bestMatchSubpath, - bestMatch, - base, - true, - false, - conditions - ); - if (resolveResult == null) { - throwExportsNotFound(packageSubpath, packageJSONUrl, base); - } - return resolveResult; - } - throwExportsNotFound(packageSubpath, packageJSONUrl, base); -} -function packageImportsResolve({ name, base, conditions, readFileSyncFn }) { - if (name === "#" || StringPrototypeStartsWith(name, "#/") || StringPrototypeEndsWith(name, "/")) { - const reason = "is not a valid internal imports specifier name"; - throw new ERR_INVALID_MODULE_SPECIFIER(name, reason, url.fileURLToPath(base)); - } - let packageJSONUrl; - const packageConfig = getPackageScopeConfig(base, readFileSyncFn); - if (packageConfig.exists) { - packageJSONUrl = url.pathToFileURL(packageConfig.pjsonPath); - const imports = packageConfig.imports; - if (imports) { - if (ObjectPrototypeHasOwnProperty(imports, name) && !StringPrototypeIncludes(name, "*")) { - const resolveResult = resolvePackageTarget( - packageJSONUrl, - imports[name], - "", - name, - base, - false, - true, - conditions - ); - if (resolveResult != null) { - return resolveResult; - } - } else { - let bestMatch = ""; - let bestMatchSubpath; - const keys = ObjectGetOwnPropertyNames(imports); - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - const patternIndex = StringPrototypeIndexOf(key, "*"); - if (patternIndex !== -1 && StringPrototypeStartsWith( - name, - StringPrototypeSlice(key, 0, patternIndex) - )) { - const patternTrailer = StringPrototypeSlice(key, patternIndex + 1); - if (name.length >= key.length && StringPrototypeEndsWith(name, patternTrailer) && patternKeyCompare(bestMatch, key) === 1 && StringPrototypeLastIndexOf(key, "*") === patternIndex) { - bestMatch = key; - bestMatchSubpath = StringPrototypeSlice( - name, - patternIndex, - name.length - patternTrailer.length - ); - } - } - } - if (bestMatch) { - const target = imports[bestMatch]; - const resolveResult = resolvePackageTarget( - packageJSONUrl, - target, - bestMatchSubpath, - bestMatch, - base, - true, - true, - conditions - ); - if (resolveResult != null) { - return resolveResult; - } - } - } - } - } - throwImportNotDefined(name, packageJSONUrl, base); -} - -const flagSymbol = Symbol('arg flag'); - -class ArgError extends Error { - constructor(msg, code) { - super(msg); - this.name = 'ArgError'; - this.code = code; - - Object.setPrototypeOf(this, ArgError.prototype); - } -} - -function arg( - opts, - { - argv = process.argv.slice(2), - permissive = false, - stopAtPositional = false - } = {} -) { - if (!opts) { - throw new ArgError( - 'argument specification object is required', - 'ARG_CONFIG_NO_SPEC' - ); - } - - const result = { _: [] }; - - const aliases = {}; - const handlers = {}; - - for (const key of Object.keys(opts)) { - if (!key) { - throw new ArgError( - 'argument key cannot be an empty string', - 'ARG_CONFIG_EMPTY_KEY' - ); - } - - if (key[0] !== '-') { - throw new ArgError( - `argument key must start with '-' but found: '${key}'`, - 'ARG_CONFIG_NONOPT_KEY' - ); - } - - if (key.length === 1) { - throw new ArgError( - `argument key must have a name; singular '-' keys are not allowed: ${key}`, - 'ARG_CONFIG_NONAME_KEY' - ); - } - - if (typeof opts[key] === 'string') { - aliases[key] = opts[key]; - continue; - } - - let type = opts[key]; - let isFlag = false; - - if ( - Array.isArray(type) && - type.length === 1 && - typeof type[0] === 'function' - ) { - const [fn] = type; - type = (value, name, prev = []) => { - prev.push(fn(value, name, prev[prev.length - 1])); - return prev; - }; - isFlag = fn === Boolean || fn[flagSymbol] === true; - } else if (typeof type === 'function') { - isFlag = type === Boolean || type[flagSymbol] === true; - } else { - throw new ArgError( - `type missing or not a function or valid array type: ${key}`, - 'ARG_CONFIG_VAD_TYPE' - ); - } - - if (key[1] !== '-' && key.length > 2) { - throw new ArgError( - `short argument keys (with a single hyphen) must have only one character: ${key}`, - 'ARG_CONFIG_SHORTOPT_TOOLONG' - ); - } - - handlers[key] = [type, isFlag]; - } - - for (let i = 0, len = argv.length; i < len; i++) { - const wholeArg = argv[i]; - - if (stopAtPositional && result._.length > 0) { - result._ = result._.concat(argv.slice(i)); - break; - } - - if (wholeArg === '--') { - result._ = result._.concat(argv.slice(i + 1)); - break; - } - - if (wholeArg.length > 1 && wholeArg[0] === '-') { - /* eslint-disable operator-linebreak */ - const separatedArguments = - wholeArg[1] === '-' || wholeArg.length === 2 - ? [wholeArg] - : wholeArg - .slice(1) - .split('') - .map((a) => `-${a}`); - /* eslint-enable operator-linebreak */ - - for (let j = 0; j < separatedArguments.length; j++) { - const arg = separatedArguments[j]; - const [originalArgName, argStr] = - arg[1] === '-' ? arg.split(/=(.*)/, 2) : [arg, undefined]; - - let argName = originalArgName; - while (argName in aliases) { - argName = aliases[argName]; - } - - if (!(argName in handlers)) { - if (permissive) { - result._.push(arg); - continue; - } else { - throw new ArgError( - `unknown or unexpected option: ${originalArgName}`, - 'ARG_UNKNOWN_OPTION' - ); - } - } - - const [type, isFlag] = handlers[argName]; - - if (!isFlag && j + 1 < separatedArguments.length) { - throw new ArgError( - `option requires argument (but was followed by another short argument): ${originalArgName}`, - 'ARG_MISSING_REQUIRED_SHORTARG' - ); - } - - if (isFlag) { - result[argName] = type(true, argName, result[argName]); - } else if (argStr === undefined) { - if ( - argv.length < i + 2 || - (argv[i + 1].length > 1 && - argv[i + 1][0] === '-' && - !( - argv[i + 1].match(/^-?\d*(\.(?=\d))?\d*$/) && - (type === Number || - // eslint-disable-next-line no-undef - (typeof BigInt !== 'undefined' && type === BigInt)) - )) - ) { - const extended = - originalArgName === argName ? '' : ` (alias for ${argName})`; - throw new ArgError( - `option requires argument: ${originalArgName}${extended}`, - 'ARG_MISSING_REQUIRED_LONGARG' - ); - } - - result[argName] = type(argv[i + 1], argName, result[argName]); - ++i; - } else { - result[argName] = type(argStr, argName, result[argName]); - } - } - } else { - result._.push(wholeArg); - } - } - - return result; -} - -arg.flag = (fn) => { - fn[flagSymbol] = true; - return fn; -}; - -// Utility types -arg.COUNT = arg.flag((v, name, existingCount) => (existingCount || 0) + 1); - -// Expose error class -arg.ArgError = ArgError; - -var arg_1 = arg; - -/** - @license - The MIT License (MIT) - - Copyright (c) 2014 Blake Embrey (hello@blakeembrey.com) - - 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. -*/ -function getOptionValue(opt) { - parseOptions(); - return options[opt]; -} -let options; -function parseOptions() { - if (!options) { - options = { - "--conditions": [], - ...parseArgv(getNodeOptionsEnvArgv()), - ...parseArgv(process.execArgv) - }; - } -} -function parseArgv(argv) { - return arg_1( - { - "--conditions": [String], - "-C": "--conditions" - }, - { - argv, - permissive: true - } - ); -} -function getNodeOptionsEnvArgv() { - const errors = []; - const envArgv = ParseNodeOptionsEnvVar(process.env.NODE_OPTIONS || "", errors); - if (errors.length !== 0) ; - return envArgv; -} -function ParseNodeOptionsEnvVar(node_options, errors) { - const env_argv = []; - let is_in_string = false; - let will_start_new_arg = true; - for (let index = 0; index < node_options.length; ++index) { - let c = node_options[index]; - if (c === "\\" && is_in_string) { - if (index + 1 === node_options.length) { - errors.push("invalid value for NODE_OPTIONS (invalid escape)\n"); - return env_argv; - } else { - c = node_options[++index]; - } - } else if (c === " " && !is_in_string) { - will_start_new_arg = true; - continue; - } else if (c === '"') { - is_in_string = !is_in_string; - continue; - } - if (will_start_new_arg) { - env_argv.push(c); - will_start_new_arg = false; - } else { - env_argv[env_argv.length - 1] += c; - } - } - if (is_in_string) { - errors.push("invalid value for NODE_OPTIONS (unterminated string)\n"); - } - return env_argv; -} - -function makeApi(runtimeState, opts) { - const alwaysWarnOnFallback = Number(process.env.PNP_ALWAYS_WARN_ON_FALLBACK) > 0; - const debugLevel = Number(process.env.PNP_DEBUG_LEVEL); - const pathRegExp = /^(?![a-zA-Z]:[\\/]|\\\\|\.{0,2}(?:\/|$))((?:node:)?(?:@[^/]+\/)?[^/]+)\/*(.*|)$/; - const isStrictRegExp = /^(\/|\.{1,2}(\/|$))/; - const isDirRegExp = /\/$/; - const isRelativeRegexp = /^\.{0,2}\//; - const topLevelLocator = { name: null, reference: null }; - const fallbackLocators = []; - const emittedWarnings = /* @__PURE__ */ new Set(); - if (runtimeState.enableTopLevelFallback === true) - fallbackLocators.push(topLevelLocator); - if (opts.compatibilityMode !== false) { - for (const name of [`react-scripts`, `gatsby`]) { - const packageStore = runtimeState.packageRegistry.get(name); - if (packageStore) { - for (const reference of packageStore.keys()) { - if (reference === null) { - throw new Error(`Assertion failed: This reference shouldn't be null`); - } else { - fallbackLocators.push({ name, reference }); - } - } - } - } - } - const { - ignorePattern, - packageRegistry, - packageLocatorsByLocations - } = runtimeState; - function makeLogEntry(name, args) { - return { - fn: name, - args, - error: null, - result: null - }; - } - function trace(entry) { - const colors = process.stderr?.hasColors?.() ?? process.stdout.isTTY; - const c = (n, str) => `\x1B[${n}m${str}\x1B[0m`; - const error = entry.error; - if (error) - console.error(c(`31;1`, `\u2716 ${entry.error?.message.replace(/\n.*/s, ``)}`)); - else - console.error(c(`33;1`, `\u203C Resolution`)); - if (entry.args.length > 0) - console.error(); - for (const arg of entry.args) - console.error(` ${c(`37;1`, `In \u2190`)} ${nodeUtils.inspect(arg, { colors, compact: true })}`); - if (entry.result) { - console.error(); - console.error(` ${c(`37;1`, `Out \u2192`)} ${nodeUtils.inspect(entry.result, { colors, compact: true })}`); - } - const stack = new Error().stack.match(/(?<=^ +)at.*/gm)?.slice(2) ?? []; - if (stack.length > 0) { - console.error(); - for (const line of stack) { - console.error(` ${c(`38;5;244`, line)}`); - } - } - console.error(); - } - function maybeLog(name, fn) { - if (opts.allowDebug === false) - return fn; - if (Number.isFinite(debugLevel)) { - if (debugLevel >= 2) { - return (...args) => { - const logEntry = makeLogEntry(name, args); - try { - return logEntry.result = fn(...args); - } catch (error) { - throw logEntry.error = error; - } finally { - trace(logEntry); - } - }; - } else if (debugLevel >= 1) { - return (...args) => { - try { - return fn(...args); - } catch (error) { - const logEntry = makeLogEntry(name, args); - logEntry.error = error; - trace(logEntry); - throw error; - } - }; - } - } - return fn; - } - function getPackageInformationSafe(packageLocator) { - const packageInformation = getPackageInformation(packageLocator); - if (!packageInformation) { - throw makeError( - ErrorCode.INTERNAL, - `Couldn't find a matching entry in the dependency tree for the specified parent (this is probably an internal error)` - ); - } - return packageInformation; - } - function isDependencyTreeRoot(packageLocator) { - if (packageLocator.name === null) - return true; - for (const dependencyTreeRoot of runtimeState.dependencyTreeRoots) - if (dependencyTreeRoot.name === packageLocator.name && dependencyTreeRoot.reference === packageLocator.reference) - return true; - return false; - } - const defaultExportsConditions = /* @__PURE__ */ new Set([ - `node`, - `require`, - ...getOptionValue(`--conditions`) - ]); - function applyNodeExportsResolution(unqualifiedPath, conditions = defaultExportsConditions, issuer) { - const locator = findPackageLocator(ppath.join(unqualifiedPath, `internal.js`), { - resolveIgnored: true, - includeDiscardFromLookup: true - }); - if (locator === null) { - throw makeError( - ErrorCode.INTERNAL, - `The locator that owns the "${unqualifiedPath}" path can't be found inside the dependency tree (this is probably an internal error)` - ); - } - const { packageLocation } = getPackageInformationSafe(locator); - const manifestPath = ppath.join(packageLocation, Filename.manifest); - if (!opts.fakeFs.existsSync(manifestPath)) - return null; - const pkgJson = JSON.parse(opts.fakeFs.readFileSync(manifestPath, `utf8`)); - if (pkgJson.exports == null) - return null; - let subpath = ppath.contains(packageLocation, unqualifiedPath); - if (subpath === null) { - throw makeError( - ErrorCode.INTERNAL, - `unqualifiedPath doesn't contain the packageLocation (this is probably an internal error)` - ); - } - if (subpath !== `.` && !isRelativeRegexp.test(subpath)) - subpath = `./${subpath}`; - try { - const resolvedExport = packageExportsResolve({ - packageJSONUrl: url.pathToFileURL(npath.fromPortablePath(manifestPath)), - packageSubpath: subpath, - exports: pkgJson.exports, - base: issuer ? url.pathToFileURL(npath.fromPortablePath(issuer)) : null, - conditions - }); - return npath.toPortablePath(url.fileURLToPath(resolvedExport)); - } catch (error) { - throw makeError( - ErrorCode.EXPORTS_RESOLUTION_FAILED, - error.message, - { unqualifiedPath: getPathForDisplay(unqualifiedPath), locator, pkgJson, subpath: getPathForDisplay(subpath), conditions }, - error.code - ); - } - } - function applyNodeExtensionResolution(unqualifiedPath, candidates, { extensions }) { - let stat; - try { - candidates.push(unqualifiedPath); - stat = opts.fakeFs.statSync(unqualifiedPath); - } catch (error) { - } - if (stat && !stat.isDirectory()) - return opts.fakeFs.realpathSync(unqualifiedPath); - if (stat && stat.isDirectory()) { - let pkgJson; - try { - pkgJson = JSON.parse(opts.fakeFs.readFileSync(ppath.join(unqualifiedPath, Filename.manifest), `utf8`)); - } catch (error) { - } - let nextUnqualifiedPath; - if (pkgJson && pkgJson.main) - nextUnqualifiedPath = ppath.resolve(unqualifiedPath, pkgJson.main); - if (nextUnqualifiedPath && nextUnqualifiedPath !== unqualifiedPath) { - const resolution = applyNodeExtensionResolution(nextUnqualifiedPath, candidates, { extensions }); - if (resolution !== null) { - return resolution; - } - } - } - for (let i = 0, length = extensions.length; i < length; i++) { - const candidateFile = `${unqualifiedPath}${extensions[i]}`; - candidates.push(candidateFile); - if (opts.fakeFs.existsSync(candidateFile)) { - return candidateFile; - } - } - if (stat && stat.isDirectory()) { - for (let i = 0, length = extensions.length; i < length; i++) { - const candidateFile = ppath.format({ dir: unqualifiedPath, name: `index`, ext: extensions[i] }); - candidates.push(candidateFile); - if (opts.fakeFs.existsSync(candidateFile)) { - return candidateFile; - } - } - } - return null; - } - function makeFakeModule(path) { - const fakeModule = new require$$0.Module(path, null); - fakeModule.filename = path; - fakeModule.paths = require$$0.Module._nodeModulePaths(path); - return fakeModule; - } - function callNativeResolution(request, issuer) { - if (issuer.endsWith(`/`)) - issuer = ppath.join(issuer, `internal.js`); - return require$$0.Module._resolveFilename(npath.fromPortablePath(request), makeFakeModule(npath.fromPortablePath(issuer)), false, { plugnplay: false }); - } - function isPathIgnored(path) { - if (ignorePattern === null) - return false; - const subPath = ppath.contains(runtimeState.basePath, path); - if (subPath === null) - return false; - if (ignorePattern.test(subPath.replace(/\/$/, ``))) { - return true; - } else { - return false; - } - } - const VERSIONS = { std: 3, resolveVirtual: 1, getAllLocators: 1 }; - const topLevel = topLevelLocator; - function getPackageInformation({ name, reference }) { - const packageInformationStore = packageRegistry.get(name); - if (!packageInformationStore) - return null; - const packageInformation = packageInformationStore.get(reference); - if (!packageInformation) - return null; - return packageInformation; - } - function findPackageDependents({ name, reference }) { - const dependents = []; - for (const [dependentName, packageInformationStore] of packageRegistry) { - if (dependentName === null) - continue; - for (const [dependentReference, packageInformation] of packageInformationStore) { - if (dependentReference === null) - continue; - const dependencyReference = packageInformation.packageDependencies.get(name); - if (dependencyReference !== reference) - continue; - if (dependentName === name && dependentReference === reference) - continue; - dependents.push({ - name: dependentName, - reference: dependentReference - }); - } - } - return dependents; - } - function findBrokenPeerDependencies(dependency, initialPackage) { - const brokenPackages = /* @__PURE__ */ new Map(); - const alreadyVisited = /* @__PURE__ */ new Set(); - const traversal = (currentPackage) => { - const identifier = JSON.stringify(currentPackage.name); - if (alreadyVisited.has(identifier)) - return; - alreadyVisited.add(identifier); - const dependents = findPackageDependents(currentPackage); - for (const dependent of dependents) { - const dependentInformation = getPackageInformationSafe(dependent); - if (dependentInformation.packagePeers.has(dependency)) { - traversal(dependent); - } else { - let brokenSet = brokenPackages.get(dependent.name); - if (typeof brokenSet === `undefined`) - brokenPackages.set(dependent.name, brokenSet = /* @__PURE__ */ new Set()); - brokenSet.add(dependent.reference); - } - } - }; - traversal(initialPackage); - const brokenList = []; - for (const name of [...brokenPackages.keys()].sort()) - for (const reference of [...brokenPackages.get(name)].sort()) - brokenList.push({ name, reference }); - return brokenList; - } - function findPackageLocator(location, { resolveIgnored = false, includeDiscardFromLookup = false } = {}) { - if (isPathIgnored(location) && !resolveIgnored) - return null; - let relativeLocation = ppath.relative(runtimeState.basePath, location); - if (!relativeLocation.match(isStrictRegExp)) - relativeLocation = `./${relativeLocation}`; - if (!relativeLocation.endsWith(`/`)) - relativeLocation = `${relativeLocation}/`; - do { - const entry = packageLocatorsByLocations.get(relativeLocation); - if (typeof entry === `undefined` || entry.discardFromLookup && !includeDiscardFromLookup) { - relativeLocation = relativeLocation.substring(0, relativeLocation.lastIndexOf(`/`, relativeLocation.length - 2) + 1); - continue; - } - return entry.locator; - } while (relativeLocation !== ``); - return null; - } - function tryReadFile(filePath) { - try { - return opts.fakeFs.readFileSync(npath.toPortablePath(filePath), `utf8`); - } catch (err) { - if (err.code === `ENOENT`) - return void 0; - throw err; - } - } - function resolveToUnqualified(request, issuer, { considerBuiltins = true } = {}) { - if (request.startsWith(`#`)) - throw new Error(`resolveToUnqualified can not handle private import mappings`); - if (request === `pnpapi`) - return npath.toPortablePath(opts.pnpapiResolution); - if (considerBuiltins && require$$0.isBuiltin(request)) - return null; - const requestForDisplay = getPathForDisplay(request); - const issuerForDisplay = issuer && getPathForDisplay(issuer); - if (issuer && isPathIgnored(issuer)) { - if (!ppath.isAbsolute(request) || findPackageLocator(request) === null) { - const result = callNativeResolution(request, issuer); - if (result === false) { - throw makeError( - ErrorCode.BUILTIN_NODE_RESOLUTION_FAILED, - `The builtin node resolution algorithm was unable to resolve the requested module (it didn't go through the pnp resolver because the issuer was explicitely ignored by the regexp) - -Require request: "${requestForDisplay}" -Required by: ${issuerForDisplay} -`, - { request: requestForDisplay, issuer: issuerForDisplay } - ); - } - return npath.toPortablePath(result); - } - } - let unqualifiedPath; - const dependencyNameMatch = request.match(pathRegExp); - if (!dependencyNameMatch) { - if (ppath.isAbsolute(request)) { - unqualifiedPath = ppath.normalize(request); - } else { - if (!issuer) { - throw makeError( - ErrorCode.API_ERROR, - `The resolveToUnqualified function must be called with a valid issuer when the path isn't a builtin nor absolute`, - { request: requestForDisplay, issuer: issuerForDisplay } - ); - } - const absoluteIssuer = ppath.resolve(issuer); - if (issuer.match(isDirRegExp)) { - unqualifiedPath = ppath.normalize(ppath.join(absoluteIssuer, request)); - } else { - unqualifiedPath = ppath.normalize(ppath.join(ppath.dirname(absoluteIssuer), request)); - } - } - } else { - if (!issuer) { - throw makeError( - ErrorCode.API_ERROR, - `The resolveToUnqualified function must be called with a valid issuer when the path isn't a builtin nor absolute`, - { request: requestForDisplay, issuer: issuerForDisplay } - ); - } - const [, dependencyName, subPath] = dependencyNameMatch; - const issuerLocator = findPackageLocator(issuer); - if (!issuerLocator) { - const result = callNativeResolution(request, issuer); - if (result === false) { - throw makeError( - ErrorCode.BUILTIN_NODE_RESOLUTION_FAILED, - `The builtin node resolution algorithm was unable to resolve the requested module (it didn't go through the pnp resolver because the issuer doesn't seem to be part of the Yarn-managed dependency tree). - -Require path: "${requestForDisplay}" -Required by: ${issuerForDisplay} -`, - { request: requestForDisplay, issuer: issuerForDisplay } - ); - } - return npath.toPortablePath(result); - } - const issuerInformation = getPackageInformationSafe(issuerLocator); - let dependencyReference = issuerInformation.packageDependencies.get(dependencyName); - let fallbackReference = null; - if (dependencyReference == null) { - if (issuerLocator.name !== null) { - const exclusionEntry = runtimeState.fallbackExclusionList.get(issuerLocator.name); - const canUseFallbacks = !exclusionEntry || !exclusionEntry.has(issuerLocator.reference); - if (canUseFallbacks) { - for (let t = 0, T = fallbackLocators.length; t < T; ++t) { - const fallbackInformation = getPackageInformationSafe(fallbackLocators[t]); - const reference = fallbackInformation.packageDependencies.get(dependencyName); - if (reference == null) - continue; - if (alwaysWarnOnFallback) - fallbackReference = reference; - else - dependencyReference = reference; - break; - } - if (runtimeState.enableTopLevelFallback) { - if (dependencyReference == null && fallbackReference === null) { - const reference = runtimeState.fallbackPool.get(dependencyName); - if (reference != null) { - fallbackReference = reference; - } - } - } - } - } - } - let error = null; - if (dependencyReference === null) { - if (isDependencyTreeRoot(issuerLocator)) { - error = makeError( - ErrorCode.MISSING_PEER_DEPENDENCY, - `Your application tried to access ${dependencyName} (a peer dependency); this isn't allowed as there is no ancestor to satisfy the requirement. Use a devDependency if needed. - -Required package: ${dependencyName}${dependencyName !== requestForDisplay ? ` (via "${requestForDisplay}")` : ``} -Required by: ${issuerForDisplay} -`, - { request: requestForDisplay, issuer: issuerForDisplay, dependencyName } - ); - } else { - const brokenAncestors = findBrokenPeerDependencies(dependencyName, issuerLocator); - if (brokenAncestors.every((ancestor) => isDependencyTreeRoot(ancestor))) { - error = makeError( - ErrorCode.MISSING_PEER_DEPENDENCY, - `${issuerLocator.name} tried to access ${dependencyName} (a peer dependency) but it isn't provided by your application; this makes the require call ambiguous and unsound. - -Required package: ${dependencyName}${dependencyName !== requestForDisplay ? ` (via "${requestForDisplay}")` : ``} -Required by: ${issuerLocator.name}@${issuerLocator.reference} (via ${issuerForDisplay}) -${brokenAncestors.map((ancestorLocator) => `Ancestor breaking the chain: ${ancestorLocator.name}@${ancestorLocator.reference} -`).join(``)} -`, - { request: requestForDisplay, issuer: issuerForDisplay, issuerLocator: Object.assign({}, issuerLocator), dependencyName, brokenAncestors } - ); - } else { - error = makeError( - ErrorCode.MISSING_PEER_DEPENDENCY, - `${issuerLocator.name} tried to access ${dependencyName} (a peer dependency) but it isn't provided by its ancestors; this makes the require call ambiguous and unsound. - -Required package: ${dependencyName}${dependencyName !== requestForDisplay ? ` (via "${requestForDisplay}")` : ``} -Required by: ${issuerLocator.name}@${issuerLocator.reference} (via ${issuerForDisplay}) - -${brokenAncestors.map((ancestorLocator) => `Ancestor breaking the chain: ${ancestorLocator.name}@${ancestorLocator.reference} -`).join(``)} -`, - { request: requestForDisplay, issuer: issuerForDisplay, issuerLocator: Object.assign({}, issuerLocator), dependencyName, brokenAncestors } - ); - } - } - } else if (dependencyReference === void 0) { - if (!considerBuiltins && require$$0.isBuiltin(request)) { - if (isDependencyTreeRoot(issuerLocator)) { - error = makeError( - ErrorCode.UNDECLARED_DEPENDENCY, - `Your application tried to access ${dependencyName}. While this module is usually interpreted as a Node builtin, your resolver is running inside a non-Node resolution context where such builtins are ignored. Since ${dependencyName} isn't otherwise declared in your dependencies, this makes the require call ambiguous and unsound. - -Required package: ${dependencyName}${dependencyName !== requestForDisplay ? ` (via "${requestForDisplay}")` : ``} -Required by: ${issuerForDisplay} -`, - { request: requestForDisplay, issuer: issuerForDisplay, dependencyName } - ); - } else { - error = makeError( - ErrorCode.UNDECLARED_DEPENDENCY, - `${issuerLocator.name} tried to access ${dependencyName}. While this module is usually interpreted as a Node builtin, your resolver is running inside a non-Node resolution context where such builtins are ignored. Since ${dependencyName} isn't otherwise declared in ${issuerLocator.name}'s dependencies, this makes the require call ambiguous and unsound. - -Required package: ${dependencyName}${dependencyName !== requestForDisplay ? ` (via "${requestForDisplay}")` : ``} -Required by: ${issuerForDisplay} -`, - { request: requestForDisplay, issuer: issuerForDisplay, issuerLocator: Object.assign({}, issuerLocator), dependencyName } - ); - } - } else { - if (isDependencyTreeRoot(issuerLocator)) { - error = makeError( - ErrorCode.UNDECLARED_DEPENDENCY, - `Your application tried to access ${dependencyName}, but it isn't declared in your dependencies; this makes the require call ambiguous and unsound. - -Required package: ${dependencyName}${dependencyName !== requestForDisplay ? ` (via "${requestForDisplay}")` : ``} -Required by: ${issuerForDisplay} -`, - { request: requestForDisplay, issuer: issuerForDisplay, dependencyName } - ); - } else { - error = makeError( - ErrorCode.UNDECLARED_DEPENDENCY, - `${issuerLocator.name} tried to access ${dependencyName}, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound. - -Required package: ${dependencyName}${dependencyName !== requestForDisplay ? ` (via "${requestForDisplay}")` : ``} -Required by: ${issuerLocator.name}@${issuerLocator.reference} (via ${issuerForDisplay}) -`, - { request: requestForDisplay, issuer: issuerForDisplay, issuerLocator: Object.assign({}, issuerLocator), dependencyName } - ); - } - } - } - if (dependencyReference == null) { - if (fallbackReference === null || error === null) - throw error || new Error(`Assertion failed: Expected an error to have been set`); - dependencyReference = fallbackReference; - const message = error.message.replace(/\n.*/g, ``); - error.message = message; - if (!emittedWarnings.has(message) && debugLevel !== 0) { - emittedWarnings.add(message); - process.emitWarning(error); - } - } - const dependencyLocator = Array.isArray(dependencyReference) ? { name: dependencyReference[0], reference: dependencyReference[1] } : { name: dependencyName, reference: dependencyReference }; - const dependencyInformation = getPackageInformationSafe(dependencyLocator); - if (!dependencyInformation.packageLocation) { - throw makeError( - ErrorCode.MISSING_DEPENDENCY, - `A dependency seems valid but didn't get installed for some reason. This might be caused by a partial install, such as dev vs prod. - -Required package: ${dependencyLocator.name}@${dependencyLocator.reference}${dependencyLocator.name !== requestForDisplay ? ` (via "${requestForDisplay}")` : ``} -Required by: ${issuerLocator.name}@${issuerLocator.reference} (via ${issuerForDisplay}) -`, - { request: requestForDisplay, issuer: issuerForDisplay, dependencyLocator: Object.assign({}, dependencyLocator) } - ); - } - const dependencyLocation = dependencyInformation.packageLocation; - if (subPath) { - unqualifiedPath = ppath.join(dependencyLocation, subPath); - } else { - unqualifiedPath = dependencyLocation; - } - } - return ppath.normalize(unqualifiedPath); - } - function resolveUnqualifiedExport(request, unqualifiedPath, conditions = defaultExportsConditions, issuer) { - if (isStrictRegExp.test(request)) - return unqualifiedPath; - const unqualifiedExportPath = applyNodeExportsResolution(unqualifiedPath, conditions, issuer); - if (unqualifiedExportPath) { - return ppath.normalize(unqualifiedExportPath); - } else { - return unqualifiedPath; - } - } - function resolveUnqualified(unqualifiedPath, { extensions = Object.keys(require$$0.Module._extensions) } = {}) { - const candidates = []; - const qualifiedPath = applyNodeExtensionResolution(unqualifiedPath, candidates, { extensions }); - if (qualifiedPath) { - return ppath.normalize(qualifiedPath); - } else { - reportRequiredFilesToWatchMode(candidates.map((candidate) => npath.fromPortablePath(candidate))); - const unqualifiedPathForDisplay = getPathForDisplay(unqualifiedPath); - const containingPackage = findPackageLocator(unqualifiedPath); - if (containingPackage) { - const { packageLocation } = getPackageInformationSafe(containingPackage); - let exists = true; - try { - opts.fakeFs.accessSync(packageLocation); - } catch (err) { - if (err?.code === `ENOENT`) { - exists = false; - } else { - const readableError = (err?.message ?? err ?? `empty exception thrown`).replace(/^[A-Z]/, ($0) => $0.toLowerCase()); - throw makeError(ErrorCode.QUALIFIED_PATH_RESOLUTION_FAILED, `Required package exists but could not be accessed (${readableError}). - -Missing package: ${containingPackage.name}@${containingPackage.reference} -Expected package location: ${getPathForDisplay(packageLocation)} -`, { unqualifiedPath: unqualifiedPathForDisplay, extensions }); - } - } - if (!exists) { - const errorMessage = packageLocation.includes(`/unplugged/`) ? `Required unplugged package missing from disk. This may happen when switching branches without running installs (unplugged packages must be fully materialized on disk to work).` : `Required package missing from disk. If you keep your packages inside your repository then restarting the Node process may be enough. Otherwise, try to run an install first.`; - throw makeError( - ErrorCode.QUALIFIED_PATH_RESOLUTION_FAILED, - `${errorMessage} - -Missing package: ${containingPackage.name}@${containingPackage.reference} -Expected package location: ${getPathForDisplay(packageLocation)} -`, - { unqualifiedPath: unqualifiedPathForDisplay, extensions } - ); - } - } - throw makeError( - ErrorCode.QUALIFIED_PATH_RESOLUTION_FAILED, - `Qualified path resolution failed: we looked for the following paths, but none could be accessed. - -Source path: ${unqualifiedPathForDisplay} -${candidates.map((candidate) => `Not found: ${getPathForDisplay(candidate)} -`).join(``)}`, - { unqualifiedPath: unqualifiedPathForDisplay, extensions } - ); - } - } - function resolvePrivateRequest(request, issuer, opts2) { - if (!issuer) - throw new Error(`Assertion failed: An issuer is required to resolve private import mappings`); - const resolved = packageImportsResolve({ - name: request, - base: url.pathToFileURL(npath.fromPortablePath(issuer)), - conditions: opts2.conditions ?? defaultExportsConditions, - readFileSyncFn: tryReadFile - }); - if (resolved instanceof URL) { - return resolveUnqualified(npath.toPortablePath(url.fileURLToPath(resolved)), { extensions: opts2.extensions }); - } else { - if (resolved.startsWith(`#`)) - throw new Error(`Mapping from one private import to another isn't allowed`); - return resolveRequest(resolved, issuer, opts2); - } - } - function resolveRequest(request, issuer, opts2 = {}) { - try { - if (request.startsWith(`#`)) - return resolvePrivateRequest(request, issuer, opts2); - const { considerBuiltins, extensions, conditions } = opts2; - const unqualifiedPath = resolveToUnqualified(request, issuer, { considerBuiltins }); - if (request === `pnpapi`) - return unqualifiedPath; - if (unqualifiedPath === null) - return null; - const isIssuerIgnored = () => issuer !== null ? isPathIgnored(issuer) : false; - const remappedPath = (!considerBuiltins || !require$$0.isBuiltin(request)) && !isIssuerIgnored() ? resolveUnqualifiedExport(request, unqualifiedPath, conditions, issuer) : unqualifiedPath; - return resolveUnqualified(remappedPath, { extensions }); - } catch (error) { - if (Object.hasOwn(error, `pnpCode`)) - Object.assign(error.data, { request: getPathForDisplay(request), issuer: issuer && getPathForDisplay(issuer) }); - throw error; - } - } - function resolveVirtual(request) { - const normalized = ppath.normalize(request); - const resolved = VirtualFS.resolveVirtual(normalized); - return resolved !== normalized ? resolved : null; - } - return { - VERSIONS, - topLevel, - getLocator: (name, referencish) => { - if (Array.isArray(referencish)) { - return { name: referencish[0], reference: referencish[1] }; - } else { - return { name, reference: referencish }; - } - }, - getDependencyTreeRoots: () => { - return [...runtimeState.dependencyTreeRoots]; - }, - getAllLocators() { - const locators = []; - for (const [name, entry] of packageRegistry) - for (const reference of entry.keys()) - if (name !== null && reference !== null) - locators.push({ name, reference }); - return locators; - }, - getPackageInformation: (locator) => { - const info = getPackageInformation(locator); - if (info === null) - return null; - const packageLocation = npath.fromPortablePath(info.packageLocation); - const nativeInfo = { ...info, packageLocation }; - return nativeInfo; - }, - findPackageLocator: (path) => { - return findPackageLocator(npath.toPortablePath(path)); - }, - resolveToUnqualified: maybeLog(`resolveToUnqualified`, (request, issuer, opts2) => { - const portableIssuer = issuer !== null ? npath.toPortablePath(issuer) : null; - const resolution = resolveToUnqualified(npath.toPortablePath(request), portableIssuer, opts2); - if (resolution === null) - return null; - return npath.fromPortablePath(resolution); - }), - resolveUnqualified: maybeLog(`resolveUnqualified`, (unqualifiedPath, opts2) => { - return npath.fromPortablePath(resolveUnqualified(npath.toPortablePath(unqualifiedPath), opts2)); - }), - resolveRequest: maybeLog(`resolveRequest`, (request, issuer, opts2) => { - const portableIssuer = issuer !== null ? npath.toPortablePath(issuer) : null; - const resolution = resolveRequest(npath.toPortablePath(request), portableIssuer, opts2); - if (resolution === null) - return null; - return npath.fromPortablePath(resolution); - }), - resolveVirtual: maybeLog(`resolveVirtual`, (path) => { - const result = resolveVirtual(npath.toPortablePath(path)); - if (result !== null) { - return npath.fromPortablePath(result); - } else { - return null; - } - }) - }; -} - -function makeManager(pnpapi, opts) { - const initialApiPath = npath.toPortablePath(pnpapi.resolveToUnqualified(`pnpapi`, null)); - const initialApiStats = opts.fakeFs.statSync(npath.toPortablePath(initialApiPath)); - const apiMetadata = /* @__PURE__ */ new Map([ - [initialApiPath, { - instance: pnpapi, - stats: initialApiStats, - lastRefreshCheck: Date.now() - }] - ]); - function loadApiInstance(pnpApiPath) { - const nativePath = npath.fromPortablePath(pnpApiPath); - const module = new require$$0.Module(nativePath, null); - module.load(nativePath); - return module.exports; - } - function refreshApiEntry(pnpApiPath, apiEntry) { - const timeNow = Date.now(); - if (timeNow - apiEntry.lastRefreshCheck < 500) - return; - apiEntry.lastRefreshCheck = timeNow; - const stats = opts.fakeFs.statSync(pnpApiPath); - if (stats.mtime > apiEntry.stats.mtime) { - process.emitWarning(`[Warning] The runtime detected new information in a PnP file; reloading the API instance (${npath.fromPortablePath(pnpApiPath)})`); - apiEntry.stats = stats; - apiEntry.instance = loadApiInstance(pnpApiPath); - } - } - function getApiEntry(pnpApiPath, refresh = false) { - let apiEntry = apiMetadata.get(pnpApiPath); - if (typeof apiEntry !== `undefined`) { - if (refresh) { - refreshApiEntry(pnpApiPath, apiEntry); - } - } else { - apiMetadata.set(pnpApiPath, apiEntry = { - instance: loadApiInstance(pnpApiPath), - stats: opts.fakeFs.statSync(pnpApiPath), - lastRefreshCheck: Date.now() - }); - } - return apiEntry; - } - const findApiPathCache = /* @__PURE__ */ new Map(); - function addToCacheAndReturn(start, end, target) { - if (target !== null) { - target = VirtualFS.resolveVirtual(target); - target = opts.fakeFs.realpathSync(target); - } - let curr; - let next = start; - do { - curr = next; - findApiPathCache.set(curr, target); - next = ppath.dirname(curr); - } while (curr !== end); - return target; - } - function findApiPathFor(modulePath) { - let bestCandidate = null; - for (const [apiPath, apiEntry] of apiMetadata) { - const locator = apiEntry.instance.findPackageLocator(modulePath); - if (!locator) - continue; - if (apiMetadata.size === 1) - return apiPath; - const packageInformation = apiEntry.instance.getPackageInformation(locator); - if (!packageInformation) - throw new Error(`Assertion failed: Couldn't get package information for '${modulePath}'`); - if (!bestCandidate) - bestCandidate = { packageLocation: packageInformation.packageLocation, apiPaths: [] }; - if (packageInformation.packageLocation === bestCandidate.packageLocation) { - bestCandidate.apiPaths.push(apiPath); - } else if (packageInformation.packageLocation.length > bestCandidate.packageLocation.length) { - bestCandidate = { packageLocation: packageInformation.packageLocation, apiPaths: [apiPath] }; - } - } - if (bestCandidate) { - if (bestCandidate.apiPaths.length === 1) - return bestCandidate.apiPaths[0]; - const controlSegment = bestCandidate.apiPaths.map((apiPath) => ` ${npath.fromPortablePath(apiPath)}`).join(` -`); - throw new Error(`Unable to locate pnpapi, the module '${modulePath}' is controlled by multiple pnpapi instances. -This is usually caused by using the global cache (enableGlobalCache: true) - -Controlled by: -${controlSegment} -`); - } - const start = ppath.resolve(npath.toPortablePath(modulePath)); - let curr; - let next = start; - do { - curr = next; - const cached = findApiPathCache.get(curr); - if (cached !== void 0) - return addToCacheAndReturn(start, curr, cached); - const cjsCandidate = ppath.join(curr, Filename.pnpCjs); - if (opts.fakeFs.existsSync(cjsCandidate) && opts.fakeFs.statSync(cjsCandidate).isFile()) - return addToCacheAndReturn(start, curr, cjsCandidate); - const legacyCjsCandidate = ppath.join(curr, Filename.pnpJs); - if (opts.fakeFs.existsSync(legacyCjsCandidate) && opts.fakeFs.statSync(legacyCjsCandidate).isFile()) - return addToCacheAndReturn(start, curr, legacyCjsCandidate); - next = ppath.dirname(curr); - } while (curr !== PortablePath.root); - return addToCacheAndReturn(start, curr, null); - } - const moduleToApiPathCache = /* @__PURE__ */ new WeakMap(); - function getApiPathFromParent(parent) { - if (parent == null) - return initialApiPath; - let apiPath = moduleToApiPathCache.get(parent); - if (typeof apiPath !== `undefined`) - return apiPath; - apiPath = parent.filename ? findApiPathFor(parent.filename) : null; - moduleToApiPathCache.set(parent, apiPath); - return apiPath; - } - return { - getApiPathFromParent, - findApiPathFor, - getApiEntry - }; -} - -const localFs = { ...fs__default.default }; -const nodeFs = new NodeFS(localFs); -const defaultRuntimeState = $$SETUP_STATE(hydrateRuntimeState); -const defaultPnpapiResolution = __filename; -const defaultFsLayer = new VirtualFS({ - baseFs: new ZipOpenFS({ - baseFs: nodeFs, - maxOpenFiles: 80, - readOnlyArchives: true - }) -}); -class DynamicFS extends ProxiedFS { - constructor() { - super(ppath); - this.baseFs = defaultFsLayer; - } - mapToBase(p) { - return p; - } - mapFromBase(p) { - return p; - } -} -const dynamicFsLayer = new DynamicFS(); -let manager; -const defaultApi = Object.assign(makeApi(defaultRuntimeState, { - fakeFs: dynamicFsLayer, - pnpapiResolution: defaultPnpapiResolution -}), { - makeApi: ({ - basePath = void 0, - fakeFs = dynamicFsLayer, - pnpapiResolution = defaultPnpapiResolution, - ...rest - }) => { - const apiRuntimeState = typeof basePath !== `undefined` ? $$SETUP_STATE(hydrateRuntimeState, basePath) : defaultRuntimeState; - return makeApi(apiRuntimeState, { - fakeFs, - pnpapiResolution, - ...rest - }); - }, - setup: (api) => { - applyPatch(api || defaultApi, { - fakeFs: defaultFsLayer, - manager - }); - dynamicFsLayer.baseFs = new NodeFS(fs__default.default); - } -}); -manager = makeManager(defaultApi, { - fakeFs: dynamicFsLayer -}); -if (module.parent && module.parent.id === `internal/preload`) { - defaultApi.setup(); - if (module.filename) { - delete require$$0__default.default._cache[module.filename]; - } -} -if (process.mainModule === module) { - const reportError = (code, message, data) => { - process.stdout.write(`${JSON.stringify([{ code, message, data }, null])} -`); - }; - const reportSuccess = (resolution) => { - process.stdout.write(`${JSON.stringify([null, resolution])} -`); - }; - const processResolution = (request, issuer) => { - try { - reportSuccess(defaultApi.resolveRequest(request, issuer)); - } catch (error) { - reportError(error.code, error.message, error.data); - } - }; - const processRequest = (data) => { - try { - const [request, issuer] = JSON.parse(data); - processResolution(request, issuer); - } catch (error) { - reportError(`INVALID_JSON`, error.message, error.data); - } - }; - if (process.argv.length > 2) { - if (process.argv.length !== 4) { - process.stderr.write(`Usage: ${process.argv[0]} ${process.argv[1]} -`); - process.exitCode = 64; - } else { - processResolution(process.argv[2], process.argv[3]); - } - } else { - let buffer = ``; - const decoder = new StringDecoder__default.default.StringDecoder(); - process.stdin.on(`data`, (chunk) => { - buffer += decoder.write(chunk); - do { - const index = buffer.indexOf(` -`); - if (index === -1) - break; - const line = buffer.slice(0, index); - buffer = buffer.slice(index + 1); - processRequest(line); - } while (true); - }); - } -} - -module.exports = defaultApi; diff --git a/fixtures/pnp/.yarnrc.yml b/fixtures/pnp/.yarnrc.yml deleted file mode 100644 index 6a6b24d8..00000000 --- a/fixtures/pnp/.yarnrc.yml +++ /dev/null @@ -1 +0,0 @@ -enableGlobalCache: 0 diff --git a/fixtures/pnp/package.json b/fixtures/pnp/package.json deleted file mode 100644 index 5d119379..00000000 --- a/fixtures/pnp/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "pnp", - "packageManager": "yarn@4.3.1", - "dependencies": { - "is-even": "^1.0.0", - "is-odd": "^3.0.1" - } -} diff --git a/fixtures/pnp/yarn.lock b/fixtures/pnp/yarn.lock deleted file mode 100644 index ba89514d..00000000 --- a/fixtures/pnp/yarn.lock +++ /dev/null @@ -1,74 +0,0 @@ -# This file is generated by running "yarn install" inside your project. -# Manual changes might be lost - proceed with caution! - -__metadata: - version: 8 - cacheKey: 10c0 - -"is-buffer@npm:^1.1.5": - version: 1.1.6 - resolution: "is-buffer@npm:1.1.6" - checksum: 10c0/ae18aa0b6e113d6c490ad1db5e8df9bdb57758382b313f5a22c9c61084875c6396d50bbf49315f5b1926d142d74dfb8d31b40d993a383e0a158b15fea7a82234 - languageName: node - linkType: hard - -"is-even@npm:^1.0.0": - version: 1.0.0 - resolution: "is-even@npm:1.0.0" - dependencies: - is-odd: "npm:^0.1.2" - checksum: 10c0/2728cc2f390d07c6a44a054aa53ae6ce57c3a4adfd76a92df528e992b4a978fdec4eaa948e0de6e6431ef3c8deebf1c964fd870d4983044ec9f0f4e630dfb3a5 - languageName: node - linkType: hard - -"is-number@npm:^3.0.0": - version: 3.0.0 - resolution: "is-number@npm:3.0.0" - dependencies: - kind-of: "npm:^3.0.2" - checksum: 10c0/e639c54640b7f029623df24d3d103901e322c0c25ea5bde97cd723c2d0d4c05857a8364ab5c58d963089dbed6bf1d0ffe975cb6aef917e2ad0ccbca653d31b4f - languageName: node - linkType: hard - -"is-number@npm:^6.0.0": - version: 6.0.0 - resolution: "is-number@npm:6.0.0" - checksum: 10c0/5da4c68401529675c575878d2760d66f18eaef4b014858577f6003daf66488d7fe4eae684b1e8574e3fa1bb447c6c6c56b8491d2b4b3239da2d32e5f6f218008 - languageName: node - linkType: hard - -"is-odd@npm:^0.1.2": - version: 0.1.2 - resolution: "is-odd@npm:0.1.2" - dependencies: - is-number: "npm:^3.0.0" - checksum: 10c0/7dc6c6fd004861208ef9f324021c66f19b3dad209c2da3ef3720d4d76e141974fadb52c47b439fc8c52af579468640b554115395b5673f4558ef09719260e898 - languageName: node - linkType: hard - -"is-odd@npm:^3.0.1": - version: 3.0.1 - resolution: "is-odd@npm:3.0.1" - dependencies: - is-number: "npm:^6.0.0" - checksum: 10c0/89ee2e353c5a3f3bd400c79db1c307a5b3506198ee8169d521e533a9b1d8a08fc95f21a919c084e98845b4286d7ffe309778da03744dfe66c3c1763ab1a030c6 - languageName: node - linkType: hard - -"kind-of@npm:^3.0.2": - version: 3.2.2 - resolution: "kind-of@npm:3.2.2" - dependencies: - is-buffer: "npm:^1.1.5" - checksum: 10c0/7e34bc29d4b02c997f92f080de34ebb92033a96736bbb0bb2410e033a7e5ae6571f1fa37b2d7710018f95361473b816c604234197f4f203f9cf149d8ef1574d9 - languageName: node - linkType: hard - -"pnp@workspace:.": - version: 0.0.0-use.local - resolution: "pnp@workspace:." - dependencies: - is-even: "npm:^1.0.0" - is-odd: "npm:^3.0.1" - languageName: unknown - linkType: soft diff --git a/fixtures/pnpm/.gitignore b/fixtures/pnpm/.gitignore deleted file mode 100644 index 3c3629e6..00000000 --- a/fixtures/pnpm/.gitignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/fixtures/pnpm/package.json b/fixtures/pnpm/package.json deleted file mode 100644 index b763d74d..00000000 --- a/fixtures/pnpm/package.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "name": "pnpm", - "version": "1.0.0", - "private": true, - "devDependencies": { - "axios": "1.6.2", - "ipaddr.js": "2.2.0", - "postcss": "8.4.33", - "styled-components": "6.1.1" - } -} diff --git a/fixtures/pnpm/pnpm-lock.yaml b/fixtures/pnpm/pnpm-lock.yaml deleted file mode 100644 index e51dfd6a..00000000 --- a/fixtures/pnpm/pnpm-lock.yaml +++ /dev/null @@ -1,212 +0,0 @@ -lockfileVersion: '6.0' - -settings: - autoInstallPeers: true - excludeLinksFromLockfile: false - -devDependencies: - axios: - specifier: 1.6.2 - version: 1.6.2 - postcss: - specifier: 8.4.33 - version: 8.4.33 - styled-components: - specifier: 6.1.1 - version: 6.1.1(react-dom@18.2.0)(react@18.2.0) - -packages: - - /@emotion/is-prop-valid@1.2.1: - resolution: {integrity: sha512-61Mf7Ufx4aDxx1xlDeOm8aFFigGHE4z+0sKCa+IHCeZKiyP9RLD0Mmx7m8b9/Cf37f7NAvQOOJAbQQGVr5uERw==} - dependencies: - '@emotion/memoize': 0.8.1 - dev: true - - /@emotion/memoize@0.8.1: - resolution: {integrity: sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA==} - dev: true - - /@emotion/unitless@0.8.1: - resolution: {integrity: sha512-KOEGMu6dmJZtpadb476IsZBclKvILjopjUii3V+7MnXIQCYh8W3NgNcgwo21n9LXZX6EDIKvqfjYxXebDwxKmQ==} - dev: true - - /@types/stylis@4.2.4: - resolution: {integrity: sha512-36ZrGJ8fgtBr6nwNnuJ9jXIj+bn/pF6UoqmrQT7+Y99+tFFeHHsoR54+194dHdyhPjgbeoNz3Qru0oRt0l6ASQ==} - dev: true - - /asynckit@0.4.0: - resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} - dev: true - - /axios@1.6.2: - resolution: {integrity: sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A==} - dependencies: - follow-redirects: 1.15.3 - form-data: 4.0.0 - proxy-from-env: 1.1.0 - transitivePeerDependencies: - - debug - dev: true - - /camelize@1.0.1: - resolution: {integrity: sha512-dU+Tx2fsypxTgtLoE36npi3UqcjSSMNYfkqgmoEhtZrraP5VWq0K7FkWVTYa8eMPtnU/G2txVsfdCJTn9uzpuQ==} - dev: true - - /combined-stream@1.0.8: - resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} - engines: {node: '>= 0.8'} - dependencies: - delayed-stream: 1.0.0 - dev: true - - /css-color-keywords@1.0.0: - resolution: {integrity: sha512-FyyrDHZKEjXDpNJYvVsV960FiqQyXc/LlYmsxl2BcdMb2WPx0OGRVgTg55rPSyLSNMqP52R9r8geSp7apN3Ofg==} - engines: {node: '>=4'} - dev: true - - /css-to-react-native@3.2.0: - resolution: {integrity: sha512-e8RKaLXMOFii+02mOlqwjbD00KSEKqblnpO9e++1aXS1fPQOpS1YoqdVHBqPjHNoxeF2mimzVqawm2KCbEdtHQ==} - dependencies: - camelize: 1.0.1 - css-color-keywords: 1.0.0 - postcss-value-parser: 4.2.0 - dev: true - - /csstype@3.1.2: - resolution: {integrity: sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==} - dev: true - - /delayed-stream@1.0.0: - resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} - engines: {node: '>=0.4.0'} - dev: true - - /follow-redirects@1.15.3: - resolution: {integrity: sha512-1VzOtuEM8pC9SFU1E+8KfTjZyMztRsgEfwQl44z8A25uy13jSzTj6dyK2Df52iV0vgHCfBwLhDWevLn95w5v6Q==} - engines: {node: '>=4.0'} - peerDependencies: - debug: '*' - peerDependenciesMeta: - debug: - optional: true - dev: true - - /form-data@4.0.0: - resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==} - engines: {node: '>= 6'} - dependencies: - asynckit: 0.4.0 - combined-stream: 1.0.8 - mime-types: 2.1.35 - dev: true - - /js-tokens@4.0.0: - resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} - dev: true - - /loose-envify@1.4.0: - resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==} - hasBin: true - dependencies: - js-tokens: 4.0.0 - dev: true - - /mime-db@1.52.0: - resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} - engines: {node: '>= 0.6'} - dev: true - - /mime-types@2.1.35: - resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} - engines: {node: '>= 0.6'} - dependencies: - mime-db: 1.52.0 - dev: true - - /nanoid@3.3.7: - resolution: {integrity: sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==} - engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} - hasBin: true - dev: true - - /picocolors@1.0.0: - resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==} - dev: true - - /postcss-value-parser@4.2.0: - resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==} - dev: true - - /postcss@8.4.33: - resolution: {integrity: sha512-Kkpbhhdjw2qQs2O2DGX+8m5OVqEcbB9HRBvuYM9pgrjEFUg30A9LmXNlTAUj4S9kgtGyrMbTzVjH7E+s5Re2yg==} - engines: {node: ^10 || ^12 || >=14} - dependencies: - nanoid: 3.3.7 - picocolors: 1.0.0 - source-map-js: 1.0.2 - dev: true - - /proxy-from-env@1.1.0: - resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==} - dev: true - - /react-dom@18.2.0(react@18.2.0): - resolution: {integrity: sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==} - peerDependencies: - react: ^18.2.0 - dependencies: - loose-envify: 1.4.0 - react: 18.2.0 - scheduler: 0.23.0 - dev: true - - /react@18.2.0: - resolution: {integrity: sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==} - engines: {node: '>=0.10.0'} - dependencies: - loose-envify: 1.4.0 - dev: true - - /scheduler@0.23.0: - resolution: {integrity: sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw==} - dependencies: - loose-envify: 1.4.0 - dev: true - - /shallowequal@1.1.0: - resolution: {integrity: sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ==} - dev: true - - /source-map-js@1.0.2: - resolution: {integrity: sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==} - engines: {node: '>=0.10.0'} - dev: true - - /styled-components@6.1.1(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-cpZZP5RrKRIClBW5Eby4JM1wElLVP4NQrJbJ0h10TidTyJf4SIIwa3zLXOoPb4gJi8MsJ8mjq5mu2IrEhZIAcQ==} - engines: {node: '>= 16'} - peerDependencies: - react: '>= 16.8.0' - react-dom: '>= 16.8.0' - dependencies: - '@emotion/is-prop-valid': 1.2.1 - '@emotion/unitless': 0.8.1 - '@types/stylis': 4.2.4 - css-to-react-native: 3.2.0 - csstype: 3.1.2 - postcss: 8.4.33 - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - shallowequal: 1.1.0 - stylis: 4.3.0 - tslib: 2.6.2 - dev: true - - /stylis@4.3.0: - resolution: {integrity: sha512-E87pIogpwUsUwXw7dNyU4QDjdgVMy52m+XEOPEKUn161cCzWjjhPSQhByfd1CcNvrOLnXQ6OnnZDwnJrz/Z4YQ==} - dev: true - - /tslib@2.6.2: - resolution: {integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==} - dev: true diff --git a/fixtures/tsconfig/cases/builtins/thing.js b/fixtures/tsconfig/cases/builtins/thing.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/builtins/tsconfig.json b/fixtures/tsconfig/cases/builtins/tsconfig.json deleted file mode 100644 index 36aa1a4d..00000000 --- a/fixtures/tsconfig/cases/builtins/tsconfig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compilerOptions": { - "baseUrl": "." - } -} diff --git a/fixtures/tsconfig/cases/exports/index.js b/fixtures/tsconfig/cases/exports/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/exports/tsconfig.json b/fixtures/tsconfig/cases/exports/tsconfig.json deleted file mode 100644 index f0e3159b..00000000 --- a/fixtures/tsconfig/cases/exports/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-exports" -} diff --git a/fixtures/tsconfig/cases/extends-extension/base-tsconfig.json b/fixtures/tsconfig/cases/extends-extension/base-tsconfig.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/cases/extends-extension/base-tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/cases/extends-extension/foo.js b/fixtures/tsconfig/cases/extends-extension/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-extension/tsconfig.json b/fixtures/tsconfig/cases/extends-extension/tsconfig.json deleted file mode 100644 index 0ae4c6a3..00000000 --- a/fixtures/tsconfig/cases/extends-extension/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./base-tsconfig" -} diff --git a/fixtures/tsconfig/cases/extends-extensionless/foo.js b/fixtures/tsconfig/cases/extends-extensionless/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-extensionless/tsconfig.json b/fixtures/tsconfig/cases/extends-extensionless/tsconfig.json deleted file mode 100644 index c36cb7d4..00000000 --- a/fixtures/tsconfig/cases/extends-extensionless/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-field/conf" -} diff --git a/fixtures/tsconfig/cases/extends-multiple/foo.js b/fixtures/tsconfig/cases/extends-multiple/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-multiple/tsconfig.json b/fixtures/tsconfig/cases/extends-multiple/tsconfig.json deleted file mode 100644 index aa2ae783..00000000 --- a/fixtures/tsconfig/cases/extends-multiple/tsconfig.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": ["../extends-extension", "../extends-paths"], - "compilerOptions": { - "baseUrl": ".", - }, -} diff --git a/fixtures/tsconfig/cases/extends-not-found/index.js b/fixtures/tsconfig/cases/extends-not-found/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-not-found/tsconfig.json b/fixtures/tsconfig/cases/extends-not-found/tsconfig.json deleted file mode 100644 index 99df91da..00000000 --- a/fixtures/tsconfig/cases/extends-not-found/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./not-found" -} diff --git a/fixtures/tsconfig/cases/extends-paths/src/index.js b/fixtures/tsconfig/cases/extends-paths/src/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-paths/tsconfig.base.json b/fixtures/tsconfig/cases/extends-paths/tsconfig.base.json deleted file mode 100644 index 5c64b067..00000000 --- a/fixtures/tsconfig/cases/extends-paths/tsconfig.base.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "@/*": ["./*"] - } - } -} diff --git a/fixtures/tsconfig/cases/extends-paths/tsconfig.json b/fixtures/tsconfig/cases/extends-paths/tsconfig.json deleted file mode 100644 index 51086018..00000000 --- a/fixtures/tsconfig/cases/extends-paths/tsconfig.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": "./tsconfig.base.json", - "compilerOptions": { - "baseUrl": "src", - }, -} diff --git a/fixtures/tsconfig/cases/field/index.js b/fixtures/tsconfig/cases/field/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/field/tsconfig.json b/fixtures/tsconfig/cases/field/tsconfig.json deleted file mode 100644 index 9f86c3f4..00000000 --- a/fixtures/tsconfig/cases/field/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-field" -} diff --git a/fixtures/tsconfig/cases/index/index.js b/fixtures/tsconfig/cases/index/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/index/tsconfig.json b/fixtures/tsconfig/cases/index/tsconfig.json deleted file mode 100644 index d20b1774..00000000 --- a/fixtures/tsconfig/cases/index/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-index" -} diff --git a/fixtures/tsconfig/cases/paths_template_variable/foo.js b/fixtures/tsconfig/cases/paths_template_variable/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json b/fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json deleted file mode 100644 index a1a37bb6..00000000 --- a/fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "../../tsconfig_template_variable.json" -} diff --git a/fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json b/fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json deleted file mode 100644 index e7d8e5e5..00000000 --- a/fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "compilerOptions": { - "composite": true, - "paths": { - "foo": ["${configDir}/foo.js"] - } - } -} diff --git a/fixtures/tsconfig/cases/project_references/app/aliased/index.ts b/fixtures/tsconfig/cases/project_references/app/aliased/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/app/index.ts b/fixtures/tsconfig/cases/project_references/app/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/app/tsconfig.json b/fixtures/tsconfig/cases/project_references/app/tsconfig.json deleted file mode 100644 index 7036d2bb..00000000 --- a/fixtures/tsconfig/cases/project_references/app/tsconfig.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "extends": "../tsconfig.base.json", - "compilerOptions": { - "baseUrl": "./", - "paths": { - "@/*": ["./aliased/*"] - } - }, - "references": [ - { - "path": "../project_a/conf.json" - }, - { - "path": "../project_b" - }, - { - "path": "../project_c/tsconfig.json" - }, - { - "path": "../../paths_template_variable/tsconfig2.json" - } - ] -} diff --git a/fixtures/tsconfig/cases/project_references/project_a/aliased/index.ts b/fixtures/tsconfig/cases/project_references/project_a/aliased/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_a/conf.json b/fixtures/tsconfig/cases/project_references/project_a/conf.json deleted file mode 100644 index 4d389d7a..00000000 --- a/fixtures/tsconfig/cases/project_references/project_a/conf.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "compilerOptions": { - "composite": true, - "paths": { - "@/*": ["./aliased/*"] - } - } -} diff --git a/fixtures/tsconfig/cases/project_references/project_a/index.ts b/fixtures/tsconfig/cases/project_references/project_a/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_b/src/aliased/index.ts b/fixtures/tsconfig/cases/project_references/project_b/src/aliased/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_b/tsconfig.json b/fixtures/tsconfig/cases/project_references/project_b/tsconfig.json deleted file mode 100644 index 4ab05cd8..00000000 --- a/fixtures/tsconfig/cases/project_references/project_b/tsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "compilerOptions": { - "composite": true, - "baseUrl": "./src", - "paths": { - "@/*": ["./aliased/*"] - } - } -} diff --git a/fixtures/tsconfig/cases/project_references/project_c/index.ts b/fixtures/tsconfig/cases/project_references/project_c/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_c/tsconfig.json b/fixtures/tsconfig/cases/project_references/project_c/tsconfig.json deleted file mode 100644 index fe520939..00000000 --- a/fixtures/tsconfig/cases/project_references/project_c/tsconfig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compilerOptions": { - "composite": true - } -} diff --git a/fixtures/tsconfig/cases/project_references/tsconfig.base.json b/fixtures/tsconfig/cases/project_references/tsconfig.base.json deleted file mode 100644 index 88ccffe7..00000000 --- a/fixtures/tsconfig/cases/project_references/tsconfig.base.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "compilerOptions": { - } -} diff --git a/fixtures/tsconfig/cases/suffixes/a.ios.ts b/fixtures/tsconfig/cases/suffixes/a.ios.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/a.ts b/fixtures/tsconfig/cases/suffixes/a.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/b.ts b/fixtures/tsconfig/cases/suffixes/b.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/c-test.ts b/fixtures/tsconfig/cases/suffixes/c-test.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/index.ts b/fixtures/tsconfig/cases/suffixes/index.ts deleted file mode 100644 index b09939b9..00000000 --- a/fixtures/tsconfig/cases/suffixes/index.ts +++ /dev/null @@ -1 +0,0 @@ -import './a'; diff --git a/fixtures/tsconfig/cases/suffixes/tsconfig.json b/fixtures/tsconfig/cases/suffixes/tsconfig.json deleted file mode 100644 index 4c2ccc8f..00000000 --- a/fixtures/tsconfig/cases/suffixes/tsconfig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compilerOptions": { - "moduleSuffixes": [".ios", "-test", ""] - } -} diff --git a/fixtures/tsconfig/cases/trailing-comma/bar.js b/fixtures/tsconfig/cases/trailing-comma/bar.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/trailing-comma/index.js b/fixtures/tsconfig/cases/trailing-comma/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/trailing-comma/tsconfig.json b/fixtures/tsconfig/cases/trailing-comma/tsconfig.json deleted file mode 100644 index 6dc20ca5..00000000 --- a/fixtures/tsconfig/cases/trailing-comma/tsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "compilerOptions": { - "paths": { - /* some comment */ - "foo": ["bar.js"], - }, - }, - // another comment -} diff --git a/fixtures/tsconfig/foo.js b/fixtures/tsconfig/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/nested/index.js b/fixtures/tsconfig/nested/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/nested/test.js b/fixtures/tsconfig/nested/test.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/nested/tsconfig.json b/fixtures/tsconfig/nested/tsconfig.json deleted file mode 100644 index 6deb3011..00000000 --- a/fixtures/tsconfig/nested/tsconfig.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "extends": "..", - "compilerOptions": { - "paths": { - "ts-path": ["test.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-exports/conf.json b/fixtures/tsconfig/node_modules/tsconfig-exports/conf.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-exports/conf.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-exports/foo.js b/fixtures/tsconfig/node_modules/tsconfig-exports/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-exports/package.json b/fixtures/tsconfig/node_modules/tsconfig-exports/package.json deleted file mode 100644 index be0ddee6..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-exports/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "tsconfig-exports", - "private": true, - "exports": { - ".": "./conf.json" - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-field/conf.json b/fixtures/tsconfig/node_modules/tsconfig-field/conf.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-field/conf.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-field/foo.js b/fixtures/tsconfig/node_modules/tsconfig-field/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-field/package.json b/fixtures/tsconfig/node_modules/tsconfig-field/package.json deleted file mode 100644 index 7138fdde..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-field/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "tsconfig-field", - "private": true, - "tsconfig": "conf.json" -} \ No newline at end of file diff --git a/fixtures/tsconfig/node_modules/tsconfig-index/foo.js b/fixtures/tsconfig/node_modules/tsconfig-index/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-index/package.json b/fixtures/tsconfig/node_modules/tsconfig-index/package.json deleted file mode 100644 index eb2431e7..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-index/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "tsconfig-index", - "private": true -} \ No newline at end of file diff --git a/fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json b/fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-not-used/foo.js b/fixtures/tsconfig/node_modules/tsconfig-not-used/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json b/fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json deleted file mode 100644 index eb16d127..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "ts-path": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/package.json b/fixtures/tsconfig/package.json deleted file mode 100755 index f48acd1c..00000000 --- a/fixtures/tsconfig/package.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "name": "resolver", - "private": true, - "alias": { - "aliased": "foo", - "aliased-file": "./bar.js", - "something": "./nested/test.js", - "aliasedfolder": "./nested", - "aliasedabsolute": "/nested", - "foo/bar": "./bar.js", - "glob/*/*": "./nested/$2", - "./baz": "./bar.js", - "url": false - }, - "imports": { - "#test": "./bar.js" - }, - "dependencies": { - "foo": "^0.3.4" - }, - "peerDependencies": { - "bar": "*" - } -} diff --git a/fixtures/tsconfig/tsconfig.json b/fixtures/tsconfig/tsconfig.json deleted file mode 100644 index eb16d127..00000000 --- a/fixtures/tsconfig/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "ts-path": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/tsconfig_broken.json b/fixtures/tsconfig/tsconfig_broken.json deleted file mode 100644 index 98232c64..00000000 --- a/fixtures/tsconfig/tsconfig_broken.json +++ /dev/null @@ -1 +0,0 @@ -{ diff --git a/fixtures/tsconfig/tsconfig_template_variable.json b/fixtures/tsconfig/tsconfig_template_variable.json deleted file mode 100644 index 6f272344..00000000 --- a/fixtures/tsconfig/tsconfig_template_variable.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["${configDir}/foo.js"] - } - } -} diff --git a/napi/__test__/resolver.spec.mjs b/napi/__test__/resolver.spec.mjs deleted file mode 100644 index ac6ee0ef..00000000 --- a/napi/__test__/resolver.spec.mjs +++ /dev/null @@ -1,260 +0,0 @@ -import { join } from 'node:path' -import { fileURLToPath } from 'node:url' - -import test from 'ava' - -let ResolverFactory - -if (process.env.WASI_TEST) { - const wasi = await import('../resolver.wasi.cjs') - ResolverFactory = wasi.ResolverFactory -} else { - const napi = await import('../index.js') - ResolverFactory = napi.ResolverFactory -} - -const currentDir = join(fileURLToPath(import.meta.url), '..') - -const enhancedResolveRoot = join( - currentDir, - '..', - '..', - 'fixtures', - 'enhanced_resolve', - 'test', - 'fixtures' -) - -// https://github.com/webpack/enhanced-resolve/blob/main/test/resolve.test.js - -for (const [title, context, request, expected] of [ - [ - 'absolute path', - enhancedResolveRoot, - join(enhancedResolveRoot, 'main1.js'), - join(enhancedResolveRoot, 'main1.js'), - ], - [ - 'file with .js', - enhancedResolveRoot, - './main1.js', - join(enhancedResolveRoot, 'main1.js'), - ], - [ - 'file without extension', - enhancedResolveRoot, - './main1', - join(enhancedResolveRoot, 'main1.js'), - ], - [ - 'another file with .js', - enhancedResolveRoot, - './a.js', - join(enhancedResolveRoot, 'a.js'), - ], - [ - 'another file without extension', - enhancedResolveRoot, - './a', - join(enhancedResolveRoot, 'a.js'), - ], - [ - 'file in module with .js', - enhancedResolveRoot, - 'm1/a.js', - join(enhancedResolveRoot, 'node_modules/m1/a.js'), - ], - [ - 'file in module without extension', - enhancedResolveRoot, - 'm1/a', - join(enhancedResolveRoot, 'node_modules/m1/a.js'), - ], - [ - 'another file in module without extension', - enhancedResolveRoot, - 'complexm/step1', - join(enhancedResolveRoot, 'node_modules/complexm/step1.js'), - ], - [ - 'from submodule to file in sibling module', - join(enhancedResolveRoot, 'node_modules/complexm'), - 'm2/b.js', - join(enhancedResolveRoot, 'node_modules/m2/b.js'), - ], - [ - 'from nested directory to overwritten file in module', - join(enhancedResolveRoot, 'multiple_modules'), - 'm1/a.js', - join(enhancedResolveRoot, 'multiple_modules/node_modules/m1/a.js'), - ], - [ - 'from nested directory to not overwritten file in module', - join(enhancedResolveRoot, 'multiple_modules'), - 'm1/b.js', - join(enhancedResolveRoot, 'node_modules/m1/b.js'), - ], - [ - 'file with query', - enhancedResolveRoot, - './main1.js?query', - join(enhancedResolveRoot, 'main1.js?query'), - ], - [ - 'file with fragment', - enhancedResolveRoot, - './main1.js#fragment', - join(enhancedResolveRoot, 'main1.js#fragment'), - ], - [ - 'file with fragment and query', - enhancedResolveRoot, - './main1.js#fragment?query', - join(enhancedResolveRoot, 'main1.js#fragment?query'), - ], - [ - 'file with query and fragment', - enhancedResolveRoot, - './main1.js?#fragment', - join(enhancedResolveRoot, 'main1.js?#fragment'), - ], - - [ - 'file with query (unicode)', - enhancedResolveRoot, - './测试.js?query', - join(enhancedResolveRoot, '测试.js?query'), - ], - [ - 'file with fragment (unicode)', - enhancedResolveRoot, - './测试.js#fragment', - join(enhancedResolveRoot, '测试.js#fragment'), - ], - [ - 'file with fragment and query (unicode)', - enhancedResolveRoot, - './测试.js#fragment?query', - join(enhancedResolveRoot, '测试.js#fragment?query'), - ], - [ - 'file with query and fragment (unicode)', - enhancedResolveRoot, - './测试.js?#fragment', - join(enhancedResolveRoot, '测试.js?#fragment'), - ], - - [ - 'file in module with query', - enhancedResolveRoot, - 'm1/a?query', - join(enhancedResolveRoot, 'node_modules/m1/a.js?query'), - ], - [ - 'file in module with fragment', - enhancedResolveRoot, - 'm1/a#fragment', - join(enhancedResolveRoot, 'node_modules/m1/a.js#fragment'), - ], - [ - 'file in module with fragment and query', - enhancedResolveRoot, - 'm1/a#fragment?query', - join(enhancedResolveRoot, 'node_modules/m1/a.js#fragment?query'), - ], - [ - 'file in module with query and fragment', - enhancedResolveRoot, - 'm1/a?#fragment', - join(enhancedResolveRoot, 'node_modules/m1/a.js?#fragment'), - ], - [ - 'differ between directory and file, resolve file', - enhancedResolveRoot, - './dirOrFile', - join(enhancedResolveRoot, 'dirOrFile.js'), - ], - [ - 'differ between directory and file, resolve directory', - enhancedResolveRoot, - './dirOrFile/', - join(enhancedResolveRoot, 'dirOrFile/index.js'), - ], - [ - 'find node_modules outside of node_modules', - join(enhancedResolveRoot, 'browser-module/node_modules'), - 'm1/a', - join(enhancedResolveRoot, 'node_modules/m1/a.js'), - ], - [ - "don't crash on main field pointing to self", - enhancedResolveRoot, - './main-field-self', - join(enhancedResolveRoot, './main-field-self/index.js'), - ], - [ - "don't crash on main field pointing to self (2)", - enhancedResolveRoot, - './main-field-self2', - join(enhancedResolveRoot, './main-field-self2/index.js'), - ], - // enhanced-resolve has `#` prepended with a `\0`, they are removed from the - // following 3 expected test results. - // See https://github.com/webpack/enhanced-resolve#escaping - [ - 'handle fragment edge case (no fragment)', - enhancedResolveRoot, - './no#fragment/#/#', - join(enhancedResolveRoot, 'no#fragment', '#', '#.js'), - ], - [ - 'handle fragment edge case (fragment)', - enhancedResolveRoot, - './no#fragment/#/', - join(enhancedResolveRoot, 'no.js#fragment') + '/#/', - ], - [ - 'handle fragment escaping', - enhancedResolveRoot, - './no\0#fragment/\0#/\0##fragment', - join(enhancedResolveRoot, 'no#fragment', '#', '#.js#fragment'), - ], -]) { - test(title, (t) => { - const resolver = new ResolverFactory({ - modules: ['src/a', 'src/b', 'src/common', 'node_modules'], - extensions: ['.js', '.jsx', '.ts', '.tsx'], - }) - - t.is(resolver.sync(context, request).path, expected) - }) -} - -test('resolve pnpm package', (t) => { - const rootDir = join(currentDir, '..', '..'); - const pnpmProjectPath = join(rootDir, 'fixtures', 'pnpm') - const resolver = new ResolverFactory({ - aliasFields: ['browser'], - }) - t.deepEqual(resolver.sync(pnpmProjectPath, 'styled-components'), { - path: join( - rootDir, - 'node_modules/.pnpm/styled-components@6.1.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/styled-components/dist/styled-components.browser.cjs.js' - ), - }) - t.deepEqual( - resolver.sync( - join( - rootDir, - 'node_modules/.pnpm/styled-components@6.1.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/styled-components' - ), - 'react' - ), - { - path: join( - rootDir, - 'node_modules/.pnpm/react@18.3.1/node_modules/react/index.js' - ), - } - ) -}) diff --git a/napi/src/lib.rs b/napi/src/lib.rs deleted file mode 100644 index 7cd839c5..00000000 --- a/napi/src/lib.rs +++ /dev/null @@ -1,214 +0,0 @@ -extern crate napi; -extern crate napi_derive; -extern crate oxc_resolver; - -use std::{ - path::{Path, PathBuf}, - sync::Arc, -}; - -use napi::{bindgen_prelude::AsyncTask, Task}; -use napi_derive::napi; -use oxc_resolver::{ResolveOptions, Resolver}; - -use self::{ - options::{NapiResolveOptions, StrOrStrList}, - tracing::init_tracing, -}; - -mod options; -mod tracing; - -#[napi(object)] -pub struct ResolveResult { - pub path: Option, - pub error: Option, - /// "type" field in the package.json file - pub module_type: Option, -} - -fn resolve(resolver: &Resolver, path: &Path, request: &str) -> ResolveResult { - match resolver.resolve(path, request) { - Ok(resolution) => ResolveResult { - path: Some(resolution.full_path().to_string_lossy().to_string()), - error: None, - module_type: resolution - .package_json() - .and_then(|p| p.r#type.as_ref()) - .and_then(|t| t.as_str()) - .map(|t| t.to_string()), - }, - Err(err) => ResolveResult { path: None, module_type: None, error: Some(err.to_string()) }, - } -} - -#[allow(clippy::needless_pass_by_value)] -#[napi] -pub fn sync(path: String, request: String) -> ResolveResult { - let path = PathBuf::from(path); - let resolver = Resolver::new(ResolveOptions::default()); - resolve(&resolver, &path, &request) -} - -pub struct ResolveTask { - resolver: Arc, - directory: PathBuf, - request: String, -} - -#[napi] -impl Task for ResolveTask { - type Output = ResolveResult; - type JsValue = ResolveResult; - - fn compute(&mut self) -> napi::Result { - Ok(resolve(&self.resolver, &self.directory, &self.request)) - } - - fn resolve(&mut self, _: napi::Env, result: Self::Output) -> napi::Result { - Ok(result) - } -} - -#[napi] -pub struct ResolverFactory { - resolver: Arc, -} - -#[napi] -impl ResolverFactory { - #[napi(constructor)] - pub fn new(options: NapiResolveOptions) -> Self { - init_tracing(); - Self { resolver: Arc::new(Resolver::new(Self::normalize_options(options))) } - } - - #[napi] - pub fn default() -> Self { - let default_options = ResolveOptions::default(); - Self { resolver: Arc::new(Resolver::new(default_options)) } - } - - /// Clone the resolver using the same underlying cache. - #[napi] - pub fn clone_with_options(&self, options: NapiResolveOptions) -> Self { - Self { - resolver: Arc::new(self.resolver.clone_with_options(Self::normalize_options(options))), - } - } - - /// Clear the underlying cache. - #[napi] - pub fn clear_cache(&self) { - self.resolver.clear_cache(); - } - - /// Synchronously resolve `specifier` at an absolute path to a `directory`. - #[allow(clippy::needless_pass_by_value)] - #[napi] - pub fn sync(&self, directory: String, request: String) -> ResolveResult { - let path = PathBuf::from(directory); - resolve(&self.resolver, &path, &request) - } - - /// Asynchronously resolve `specifier` at an absolute path to a `directory`. - #[allow(clippy::needless_pass_by_value)] - #[napi(js_name = "async")] - pub fn resolve_async(&self, directory: String, request: String) -> AsyncTask { - let path = PathBuf::from(directory); - let resolver = self.resolver.clone(); - AsyncTask::new(ResolveTask { resolver, directory: path, request }) - } - - fn normalize_options(op: NapiResolveOptions) -> ResolveOptions { - let default = ResolveOptions::default(); - // merging options - ResolveOptions { - tsconfig: op.tsconfig.map(|tsconfig| tsconfig.into()), - alias: op - .alias - .map(|alias| { - alias - .into_iter() - .map(|(k, v)| { - let v = v - .into_iter() - .map(|item| match item { - Some(path) => oxc_resolver::AliasValue::from(path), - None => oxc_resolver::AliasValue::Ignore, - }) - .collect(); - (k, v) - }) - .collect::>() - }) - .unwrap_or(default.alias), - alias_fields: op - .alias_fields - .map(|o| o.into_iter().map(|x| StrOrStrList(x).into()).collect::>()) - .unwrap_or(default.alias_fields), - condition_names: op.condition_names.unwrap_or(default.condition_names), - description_files: op.description_files.unwrap_or(default.description_files), - enforce_extension: op - .enforce_extension - .map(|enforce_extension| enforce_extension.into()) - .unwrap_or(default.enforce_extension), - exports_fields: op - .exports_fields - .map(|o| o.into_iter().map(|x| StrOrStrList(x).into()).collect::>()) - .unwrap_or(default.exports_fields), - imports_fields: op - .imports_fields - .map(|o| o.into_iter().map(|x| StrOrStrList(x).into()).collect::>()) - .unwrap_or(default.imports_fields), - extension_alias: op - .extension_alias - .map(|extension_alias| extension_alias.into_iter().collect::>()) - .unwrap_or(default.extension_alias), - extensions: op.extensions.unwrap_or(default.extensions), - fallback: op - .fallback - .map(|fallback| { - fallback - .into_iter() - .map(|(k, v)| { - let v = v - .into_iter() - .map(|item| match item { - Some(path) => oxc_resolver::AliasValue::from(path), - None => oxc_resolver::AliasValue::Ignore, - }) - .collect(); - (k, v) - }) - .collect::>() - }) - .unwrap_or(default.fallback), - fully_specified: op.fully_specified.unwrap_or(default.fully_specified), - main_fields: op - .main_fields - .map(|o| StrOrStrList(o).into()) - .unwrap_or(default.main_fields), - main_files: op.main_files.unwrap_or(default.main_files), - modules: op.modules.map(|o| StrOrStrList(o).into()).unwrap_or(default.modules), - resolve_to_context: op.resolve_to_context.unwrap_or(default.resolve_to_context), - prefer_relative: op.prefer_relative.unwrap_or(default.prefer_relative), - prefer_absolute: op.prefer_absolute.unwrap_or(default.prefer_absolute), - restrictions: op - .restrictions - .map(|restrictions| { - restrictions - .into_iter() - .map(|restriction| restriction.into()) - .collect::>() - }) - .unwrap_or(default.restrictions), - roots: op - .roots - .map(|roots| roots.into_iter().map(PathBuf::from).collect::>()) - .unwrap_or(default.roots), - symlinks: op.symlinks.unwrap_or(default.symlinks), - builtin_modules: op.builtin_modules.unwrap_or(default.builtin_modules), - } - } -} diff --git a/napi/src/options.rs b/napi/src/options.rs deleted file mode 100644 index ea35672f..00000000 --- a/napi/src/options.rs +++ /dev/null @@ -1,261 +0,0 @@ -use std::path::PathBuf; - -use napi::Either; -use napi_derive::napi; -use std::collections::HashMap; - -/// Module Resolution Options -/// -/// Options are directly ported from [enhanced-resolve](https://github.com/webpack/enhanced-resolve#resolver-options). -/// -/// See [webpack resolve](https://webpack.js.org/configuration/resolve/) for information and examples -#[derive(Debug, Clone)] -#[napi(object)] -pub struct NapiResolveOptions { - /// Path to TypeScript configuration file. - /// - /// Default `None` - pub tsconfig: Option, - - /// Alias for [ResolveOptions::alias] and [ResolveOptions::fallback]. - /// - /// For the second value of the tuple, `None -> AliasValue::Ignore`, Some(String) -> - /// AliasValue::Path(String)` - /// Create aliases to import or require certain modules more easily. - /// A trailing $ can also be added to the given object's keys to signify an exact match. - pub alias: Option>>>, - - /// A list of alias fields in description files. - /// Specify a field, such as `browser`, to be parsed according to [this specification](https://github.com/defunctzombie/package-browser-field-spec). - /// Can be a path to json object such as `["path", "to", "exports"]`. - /// - /// Default `[]` - #[napi(ts_type = "(string | string[])[]")] - pub alias_fields: Option>, - - /// Condition names for exports field which defines entry points of a package. - /// The key order in the exports field is significant. During condition matching, earlier entries have higher priority and take precedence over later entries. - /// - /// Default `[]` - pub condition_names: Option>, - - /// The JSON files to use for descriptions. (There was once a `bower.json`.) - /// - /// Default `["package.json"]` - pub description_files: Option>, - - /// If true, it will not allow extension-less files. - /// So by default `require('./foo')` works if `./foo` has a `.js` extension, - /// but with this enabled only `require('./foo.js')` will work. - /// - /// Default to `true` when [ResolveOptions::extensions] contains an empty string. - /// Use `Some(false)` to disable the behavior. - /// See - /// - /// Default None, which is the same as `Some(false)` when the above empty rule is not applied. - pub enforce_extension: Option, - - /// A list of exports fields in description files. - /// Can be a path to json object such as `["path", "to", "exports"]`. - /// - /// Default `[["exports"]]`. - #[napi(ts_type = "(string | string[])[]")] - pub exports_fields: Option>, - - /// Fields from `package.json` which are used to provide the internal requests of a package - /// (requests starting with # are considered internal). - /// - /// Can be a path to a JSON object such as `["path", "to", "imports"]`. - /// - /// Default `[["imports"]]`. - #[napi(ts_type = "(string | string[])[]")] - pub imports_fields: Option>, - - /// An object which maps extension to extension aliases. - /// - /// Default `{}` - pub extension_alias: Option>>, - - /// Attempt to resolve these extensions in order. - /// If multiple files share the same name but have different extensions, - /// will resolve the one with the extension listed first in the array and skip the rest. - /// - /// Default `[".js", ".json", ".node"]` - pub extensions: Option>, - - /// Redirect module requests when normal resolving fails. - /// - /// Default `[]` - pub fallback: Option>>>, - - /// 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). - /// - /// See also webpack configuration [resolve.fullySpecified](https://webpack.js.org/configuration/module/#resolvefullyspecified) - /// - /// Default `false` - pub fully_specified: Option, - - /// A list of main fields in description files - /// - /// Default `["main"]`. - #[napi(ts_type = "string | string[]")] - pub main_fields: Option, - - /// The filename to be used while resolving directories. - /// - /// Default `["index"]` - pub main_files: Option>, - - /// A list of directories to resolve modules from, can be absolute path or folder name. - /// - /// Default `["node_modules"]` - #[napi(ts_type = "string | string[]")] - pub modules: Option, - - /// Resolve to a context instead of a file. - /// - /// Default `false` - pub resolve_to_context: Option, - - /// Prefer to resolve module requests as relative requests instead of using modules from node_modules directories. - /// - /// Default `false` - pub prefer_relative: Option, - - /// Prefer to resolve server-relative urls as absolute paths before falling back to resolve in ResolveOptions::roots. - /// - /// Default `false` - pub prefer_absolute: Option, - - /// A list of resolve restrictions to restrict the paths that a request can be resolved on. - /// - /// Default `[]` - pub restrictions: Option>, - - /// A list of directories where requests of server-relative URLs (starting with '/') are resolved. - /// On non-Windows systems these requests are resolved as an absolute path first. - /// - /// Default `[]` - pub roots: Option>, - - /// Whether to resolve symlinks to their symlinked location. - /// When enabled, symlinked resources are resolved to their real path, not their symlinked location. - /// Note that this may cause module resolution to fail when using tools that symlink packages (like npm link). - /// - /// Default `true` - pub symlinks: Option, - - /// Whether to parse [module.builtinModules](https://nodejs.org/api/module.html#modulebuiltinmodules) or not. - /// For example, "zlib" will throw [crate::ResolveError::Builtin] when set to true. - /// - /// Default `false` - pub builtin_modules: Option, -} - -#[napi] -#[derive(Debug, PartialEq, Eq)] -pub enum EnforceExtension { - Auto, - Enabled, - Disabled, -} - -impl EnforceExtension { - pub fn is_auto(&self) -> bool { - *self == Self::Auto - } - - pub fn is_enabled(&self) -> bool { - *self == Self::Enabled - } - - pub fn is_disabled(&self) -> bool { - *self == Self::Disabled - } -} - -/// Alias Value for [ResolveOptions::alias] and [ResolveOptions::fallback]. -/// Use struct because napi don't support structured union now -#[napi(object)] -#[derive(Debug, Clone)] -pub struct Restriction { - pub path: Option, - pub regex: Option, -} - -/// Tsconfig Options -/// -/// Derived from [tsconfig-paths-webpack-plugin](https://github.com/dividab/tsconfig-paths-webpack-plugin#options) -#[napi(object)] -#[derive(Debug, Clone)] -pub struct TsconfigOptions { - /// Allows you to specify where to find the TypeScript configuration file. - /// You may provide - /// * a relative path to the configuration file. It will be resolved relative to cwd. - /// * an absolute path to the configuration file. - pub config_file: String, - - /// Support for Typescript Project References. - /// - /// * `'auto'`: use the `references` field from tsconfig of `config_file`. - /// * `string[]`: manually provided relative or absolute path. - #[napi(ts_type = "'auto' | string[]")] - pub references: Option>>, -} - -impl Into for Restriction { - fn into(self) -> oxc_resolver::Restriction { - match (self.path, self.regex) { - (None, None) => { - panic!("Should specify path or regex") - } - (None, Some(regex)) => oxc_resolver::Restriction::RegExp(regex), - (Some(path), None) => oxc_resolver::Restriction::Path(PathBuf::from(path)), - (Some(_), Some(_)) => { - panic!("Restriction can't be path and regex at the same time") - } - } - } -} - -impl Into for EnforceExtension { - fn into(self) -> oxc_resolver::EnforceExtension { - match self { - EnforceExtension::Auto => oxc_resolver::EnforceExtension::Auto, - EnforceExtension::Enabled => oxc_resolver::EnforceExtension::Enabled, - EnforceExtension::Disabled => oxc_resolver::EnforceExtension::Disabled, - } - } -} - -impl Into for TsconfigOptions { - fn into(self) -> oxc_resolver::TsconfigOptions { - oxc_resolver::TsconfigOptions { - config_file: PathBuf::from(self.config_file), - references: match self.references { - Some(Either::A(string)) if string.as_str() == "auto" => { - oxc_resolver::TsconfigReferences::Auto - } - Some(Either::A(opt)) => { - panic!("`{}` is not a valid option for tsconfig references", opt) - } - Some(Either::B(paths)) => oxc_resolver::TsconfigReferences::Paths( - paths.into_iter().map(PathBuf::from).collect::>(), - ), - None => oxc_resolver::TsconfigReferences::Disabled, - }, - } - } -} - -type StrOrStrListType = Either>; -pub struct StrOrStrList(pub StrOrStrListType); - -impl Into> for StrOrStrList { - fn into(self) -> Vec { - match self { - StrOrStrList(Either::A(s)) => Vec::from([s]), - StrOrStrList(Either::B(a)) => a, - } - } -} diff --git a/napi/src/tracing.rs b/napi/src/tracing.rs deleted file mode 100644 index 88e4cd7e..00000000 --- a/napi/src/tracing.rs +++ /dev/null @@ -1,25 +0,0 @@ -use std::sync::OnceLock; - -use tracing_subscriber::filter::Targets; -use tracing_subscriber::prelude::__tracing_subscriber_SubscriberExt; -use tracing_subscriber::util::SubscriberInitExt; - -/// To debug `oxc_resolver`: -/// `OXC_LOG=DEBUG your program` -pub fn init_tracing() { - static TRACING: OnceLock<()> = OnceLock::new(); - TRACING.get_or_init(|| { - // Usage without the `regex` feature. - // - tracing_subscriber::registry() - .with(std::env::var("OXC_LOG").map_or_else( - |_| Targets::new(), - |env_var| { - use std::str::FromStr; - Targets::from_str(&env_var).unwrap() - }, - )) - .with(tracing_subscriber::fmt::layer()) - .init(); - }); -} diff --git a/napi/tests/options.test.mjs b/napi/tests/options.test.mjs deleted file mode 100644 index 4a93efff..00000000 --- a/napi/tests/options.test.mjs +++ /dev/null @@ -1,59 +0,0 @@ -import { describe, it } from "node:test"; -import { ResolverFactory } from "../index.js"; -import * as assert from "node:assert"; -import * as path from "node:path"; - -const fixtureDir = new URL( - "../../fixtures/enhanced_resolve/test/fixtures", - import.meta.url -).pathname; - -describe("option", () => { - describe("aliasFields", () => { - it("should allow field string ", () => { - const resolver = new ResolverFactory({ aliasFields: ["browser"] }); - assert.match( - resolver.sync(fixtureDir, "./browser-module/lib/replaced.js").path, - /browser-module\/lib\/browser\.js$/ - ); - }); - it("should allow json path array", () => { - const resolver = new ResolverFactory({ - aliasFields: [["innerBrowser1", "field", "browser"]], - }); - - assert.match( - resolver.sync(fixtureDir, "./browser-module/lib/main1.js").path, - /browser-module\/lib\/main\.js$/ - ); - }); - }); - - describe("exportsFields", () => { - const createTest = (exportsFields) => { - const resolver = new ResolverFactory({ exportsFields }); - assert.match( - resolver.sync( - path.resolve(fixtureDir, "./exports-field3"), - "exports-field" - ).path, - /\/exports-field\/src\/index\.js$/ - ); - }; - it("should allow string as field item", createTest(["broken"])); - it("should allow json path array as field item", createTest([["broken"]])); - }); - - describe("mainFields", () => { - const createTest = (mainFields) => { - const resolver = new ResolverFactory({ mainFields }); - assert.match( - resolver.sync(fixtureDir, "../..").path, - /\/lib\/index\.js$/ - ); - }; - it("should use `'main'` as default", createTest(undefined)); - it("should allow field string", createTest("main")); - it("should allow field array", createTest(["main"])); - }); -}); diff --git a/npm/package.json b/npm/package.json index 85422809..7136edb8 100644 --- a/npm/package.json +++ b/npm/package.json @@ -1,47 +1,36 @@ { - "name": "oxc-resolver", - "version": "1.11.0", - "description": "Oxc Resolver Node API", - "main": "index.js", - "browser": "browser.js", - "files": [ - "index.d.ts", - "index.js", - "browser.js" - ], - "license": "MIT", - "homepage": "https://oxc.rs", - "repository": { - "type": "git", - "url": "git+https://github.com/oxc-project/oxc-resolver.git" - }, - "publishConfig": { - "registry": "https://registry.npmjs.org/", - "access": "public" - }, - "napi": { - "binaryName": "resolver", - "packageName": "@oxc-resolver/binding", - "wasm": { - "browser": { - "fs": true - } - }, - "targets": [ - "x86_64-pc-windows-msvc", - "aarch64-pc-windows-msvc", - "x86_64-unknown-linux-gnu", - "x86_64-unknown-linux-musl", - "x86_64-unknown-freebsd", - "aarch64-unknown-linux-gnu", - "aarch64-unknown-linux-musl", - "armv7-unknown-linux-gnueabihf", - "x86_64-apple-darwin", - "aarch64-apple-darwin", - "wasm32-wasip1-threads" - ] - }, - "funding": { - "url": "https://github.com/sponsors/Boshen" - } + "browser": "browser.js", + "description": "Oxc Resolver Node API", + "files": [ + "index.d.ts", + "index.js", + "browser.js" + ], + "funding": { + "url": "https://github.com/sponsors/Boshen" + }, + "main": "index.js", + "name": "oxc-resolver", + "napi": { + "binaryName": "resolver", + "packageName": "@oxc-resolver/binding", + "targets": [ + "x86_64-pc-windows-msvc", + "aarch64-pc-windows-msvc", + "x86_64-unknown-linux-gnu", + "x86_64-unknown-linux-musl", + "x86_64-unknown-freebsd", + "aarch64-unknown-linux-gnu", + "aarch64-unknown-linux-musl", + "armv7-unknown-linux-gnueabihf", + "x86_64-apple-darwin", + "aarch64-apple-darwin", + "wasm32-wasip1-threads" + ], + "wasm": { + "browser": { + "fs": true + } + } + } } diff --git a/package.json b/package.json index 30892ca3..d0ee7633 100644 --- a/package.json +++ b/package.json @@ -1,33 +1,24 @@ { - "name": "@oxc-resolver/binding", - "private": true, - "version": "0.0.0", - "scripts": { - "build": "napi build --platform --release --package-json-path npm/package.json --manifest-path napi/Cargo.toml", - "build:debug": "napi build --platform --package-json-path npm/package.json --manifest-path napi/Cargo.toml", - "prepublishOnly": "napi pre-publish -t npm", - "test": "ava" - }, - "devDependencies": { - "@napi-rs/cli": "3.0.0-alpha.62", - "@napi-rs/wasm-runtime": "^0.2.4", - "@types/node": "^22.0.0", - "ava": "^6.1.3", - "emnapi": "^1.2.0", - "typescript": "^5.5.3" - }, - "ava": { - "files": [ - "napi/__test__/*.spec.mjs" - ], - "cache": false - }, - "packageManager": "pnpm@9.9.0", - "repository": { - "type": "git", - "url": "git+https://github.com/oxc-project/oxc-resolver.git" - }, - "funding": { - "url": "https://github.com/sponsors/Boshen" - } + "ava": { + "cache": false, + "files": [ + "napi/__test__/*.spec.mjs" + ] + }, + "devDependencies": { + "@napi-rs/cli": "3.0.0-alpha.62", + "@napi-rs/wasm-runtime": "^0.2.4", + "@types/node": "^22.0.0", + "ava": "^6.1.3", + "emnapi": "^1.2.0" + }, + "funding": { + "url": "https://github.com/sponsors/Boshen" + }, + "name": "@oxc-resolver/binding", + "scripts": { + "build": "napi build --platform --release --package-json-path npm/package.json --manifest-path napi/Cargo.toml", + "build:debug": "napi build --platform --package-json-path npm/package.json --manifest-path napi/Cargo.toml", + "prepublishOnly": "napi pre-publish -t npm" + } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml deleted file mode 100644 index db9e5b63..00000000 --- a/pnpm-lock.yaml +++ /dev/null @@ -1,2598 +0,0 @@ -lockfileVersion: '9.0' - -settings: - autoInstallPeers: true - excludeLinksFromLockfile: false - -importers: - - .: - devDependencies: - '@napi-rs/cli': - specifier: 3.0.0-alpha.62 - version: 3.0.0-alpha.62(@emnapi/runtime@1.2.0)(emnapi@1.2.0) - '@napi-rs/wasm-runtime': - specifier: ^0.2.4 - version: 0.2.4 - '@types/node': - specifier: ^22.0.0 - version: 22.5.4 - ava: - specifier: ^6.1.3 - version: 6.1.3 - emnapi: - specifier: ^1.2.0 - version: 1.2.0 - typescript: - specifier: ^5.5.3 - version: 5.5.4 - - fixtures/pnpm: - devDependencies: - axios: - specifier: 1.6.2 - version: 1.6.2 - ipaddr.js: - specifier: 2.2.0 - version: 2.2.0 - postcss: - specifier: 8.4.33 - version: 8.4.33 - styled-components: - specifier: 6.1.1 - version: 6.1.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - - npm: {} - -packages: - - '@emnapi/core@1.2.0': - resolution: {integrity: sha512-E7Vgw78I93we4ZWdYCb4DGAwRROGkMIXk7/y87UmANR+J6qsWusmC3gLt0H+O0KOt5e6O38U8oJamgbudrES/w==} - - '@emnapi/runtime@1.2.0': - resolution: {integrity: sha512-bV21/9LQmcQeCPEg3BDFtvwL6cwiTMksYNWQQ4KOxCZikEGalWtenoZ0wCiukJINlGCIi2KXx01g4FoH/LxpzQ==} - - '@emnapi/wasi-threads@1.0.1': - resolution: {integrity: sha512-iIBu7mwkq4UQGeMEM8bLwNK962nXdhodeScX4slfQnRhEMMzvYivHhutCIk8uojvmASXXPC2WNEjwxFWk72Oqw==} - - '@emotion/is-prop-valid@1.2.2': - resolution: {integrity: sha512-uNsoYd37AFmaCdXlg6EYD1KaPOaRWRByMCYzbKUX4+hhMfrxdVSelShywL4JVaAeM/eHUOSprYBQls+/neX3pw==} - - '@emotion/memoize@0.8.1': - resolution: {integrity: sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA==} - - '@emotion/unitless@0.8.1': - resolution: {integrity: sha512-KOEGMu6dmJZtpadb476IsZBclKvILjopjUii3V+7MnXIQCYh8W3NgNcgwo21n9LXZX6EDIKvqfjYxXebDwxKmQ==} - - '@inquirer/checkbox@2.3.10': - resolution: {integrity: sha512-CTc864M2/523rKc9AglIzAcUCuPXDZENgc5S2KZFVRbnMzpXcYTsUWmbqSeL0XLvtlvEtNevkkVbfVhJpruOyQ==} - engines: {node: '>=18'} - - '@inquirer/confirm@3.1.14': - resolution: {integrity: sha512-nbLSX37b2dGPtKWL3rPuR/5hOuD30S+pqJ/MuFiUEgN6GiMs8UMxiurKAMDzKt6C95ltjupa8zH6+3csXNHWpA==} - engines: {node: '>=18'} - - '@inquirer/core@9.0.2': - resolution: {integrity: sha512-nguvH3TZar3ACwbytZrraRTzGqyxJfYJwv+ZwqZNatAosdWQMP1GV8zvmkNlBe2JeZSaw0WYBHZk52pDpWC9qA==} - engines: {node: '>=18'} - - '@inquirer/editor@2.1.14': - resolution: {integrity: sha512-6nWpoJyVAKwAcv67bkbBmmi3f32xua79fP7TRmNUoR4K+B1GiOBsHO1YdvET/jvC+nTlBZL7puKAKyM7G+Lkzw==} - engines: {node: '>=18'} - - '@inquirer/expand@2.1.14': - resolution: {integrity: sha512-JcxsLajwPykF2kq6biIUdoOzTQ3LXqb8XMVrWkCprG/pFeU1SsxcSSFbF1T5jJGvvlTVcsE+JdGjbQ8ZRZ82RA==} - engines: {node: '>=18'} - - '@inquirer/figures@1.0.3': - resolution: {integrity: sha512-ErXXzENMH5pJt5/ssXV0DfWUZqly8nGzf0UcBV9xTnP+KyffE2mqyxIMBrZ8ijQck2nU0TQm40EQB53YreyWHw==} - engines: {node: '>=18'} - - '@inquirer/input@2.2.1': - resolution: {integrity: sha512-Yl1G6h7qWydzrJwqN777geeJVaAFL5Ly83aZlw4xHf8Z/BoTMfKRheyuMaQwOG7LQ4e5nQP7PxXdEg4SzQ+OKw==} - engines: {node: '>=18'} - - '@inquirer/number@1.0.2': - resolution: {integrity: sha512-GcoK+Phxcln0Qw9e73S5a8B2Ejg3HgSTvNfDegIcS5/BKwUm8t5rejja1l09WXjZM9vrVbRDf9RzWtSUiWVYRQ==} - engines: {node: '>=18'} - - '@inquirer/password@2.1.14': - resolution: {integrity: sha512-sPzOkXLhWJQ96K6nPZFnF8XB8tsDrcCRobd1d3EDz81F+4hp8BbdmsnsQcqZ7oYDIOVM/mWJyIUtJ35TrssJxQ==} - engines: {node: '>=18'} - - '@inquirer/prompts@5.1.2': - resolution: {integrity: sha512-E+ndnfwtVQtcmPt888Hc/HAxJUHSaA6OIvyvLAQ5BLQv+t20GbYdFSjXeLgb47OpMU+aRsKA/ys+Zoylw3kTVg==} - engines: {node: '>=18'} - - '@inquirer/rawlist@2.1.14': - resolution: {integrity: sha512-pLpEzhKNQ/ugFAFfgCNaXljB+dcCwmXwR1jOxAbVeFIdB3l02E5gjI+h1rb136tq0T8JO6P5KFR1oTeld/wdrA==} - engines: {node: '>=18'} - - '@inquirer/select@2.3.10': - resolution: {integrity: sha512-rr7iR0Zj1YFfgM8IUGimPD9Yukd+n/U63CnYT9kdum6DbRXtMxR45rrreP+EA9ixCnShr+W4xj7suRxC1+8t9g==} - engines: {node: '>=18'} - - '@inquirer/type@1.4.0': - resolution: {integrity: sha512-AjOqykVyjdJQvtfkNDGUyMYGF8xN50VUxftCQWsOyIo4DFRLr6VQhW0VItGI1JIyQGCGgIpKa7hMMwNhZb4OIw==} - engines: {node: '>=18'} - - '@mapbox/node-pre-gyp@1.0.11': - resolution: {integrity: sha512-Yhlar6v9WQgUp/He7BdgzOz8lqMQ8sU+jkCq7Wx8Myc5YFJLbEe7lgui/V7G1qB1DJykHSGwreceSaD60Y0PUQ==} - hasBin: true - - '@napi-rs/cli@3.0.0-alpha.62': - resolution: {integrity: sha512-IDUwHAEJZ9ad/s5oyhznrz5ZDcU+SJ6GdP5nb++Wx5MkS4FD9MeS3HfNZdsxkf10pOUPnmvCVFuG4xnLBQYmjw==} - engines: {node: '>= 16'} - hasBin: true - peerDependencies: - '@emnapi/runtime': ^1.1.0 - emnapi: ^1.1.0 - peerDependenciesMeta: - '@emnapi/runtime': - optional: true - emnapi: - optional: true - - '@napi-rs/cross-toolchain@0.0.16': - resolution: {integrity: sha512-jwdjHT5L0m9MH0CmzDwPp0ckn/UO7afHCsPeo7NugHUvYgvlgS7SWhdMVgIgJW2HHqhcW/2nhaLLGpAU1c7QRQ==} - peerDependencies: - '@napi-rs/cross-toolchain-arm64-target-aarch64': ^0.0.16 - '@napi-rs/cross-toolchain-arm64-target-armv7': ^0.0.16 - '@napi-rs/cross-toolchain-arm64-target-x86_64': ^0.0.16 - '@napi-rs/cross-toolchain-x64-target-aarch64': ^0.0.16 - '@napi-rs/cross-toolchain-x64-target-armv7': ^0.0.16 - '@napi-rs/cross-toolchain-x64-target-x86_64': ^0.0.16 - peerDependenciesMeta: - '@napi-rs/cross-toolchain-arm64-target-aarch64': - optional: true - '@napi-rs/cross-toolchain-arm64-target-armv7': - optional: true - '@napi-rs/cross-toolchain-arm64-target-x86_64': - optional: true - '@napi-rs/cross-toolchain-x64-target-aarch64': - optional: true - '@napi-rs/cross-toolchain-x64-target-armv7': - optional: true - '@napi-rs/cross-toolchain-x64-target-x86_64': - optional: true - - '@napi-rs/lzma-android-arm-eabi@1.3.1': - resolution: {integrity: sha512-mtGOg8jXlc+pTBI86cqohfndS9UmOAkk9d5CChKMb8btVks70yhUN1e7YYS3QFbmoxbPs2Ee+wmuH1Khdc7B2w==} - engines: {node: '>= 10'} - cpu: [arm] - os: [android] - - '@napi-rs/lzma-android-arm64@1.3.1': - resolution: {integrity: sha512-4uGkQgAv9Tnc/i0k2eIgbhZgyzs94+iECWxz4MFZNcZ1fNGvGbRL2j+SITE4OmwrUn3TuFK/uYWfgzooq8E1Qg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [android] - - '@napi-rs/lzma-darwin-arm64@1.3.1': - resolution: {integrity: sha512-MZBg4iwHTS8icjTiCMdzh8kYrMmKBCEglFPa+vjI91R2XDwuuwSzqmpATRpmMH8cWUUWtGPF4fnxKzjgkzhd4Q==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [darwin] - - '@napi-rs/lzma-darwin-x64@1.3.1': - resolution: {integrity: sha512-7vte+1lYV7xgZERKH/pjAeh4T16aQASKOzu4op70pK6VP/64Plr5rrvqxQqQmlAIe4pwyo/RkFl1n4LXDod3xg==} - engines: {node: '>= 10'} - cpu: [x64] - os: [darwin] - - '@napi-rs/lzma-freebsd-x64@1.3.1': - resolution: {integrity: sha512-uBS74fynTqLUC3catIxyezCafn8UDlr2yxVV47vz1T6Vop2PGDz/cMQdV6rnLSjPE08Rv66ihM36mgf/MmOkOg==} - engines: {node: '>= 10'} - cpu: [x64] - os: [freebsd] - - '@napi-rs/lzma-linux-arm-gnueabihf@1.3.1': - resolution: {integrity: sha512-rrVLyqBJeN29gPJCNkPbZ7dAzaseEcERKyhjwM+DfbFrDUvtkEcrYPvo+iwE/NmF+OkZQkzcanrVMGnq/mcJYQ==} - engines: {node: '>= 10'} - cpu: [arm] - os: [linux] - - '@napi-rs/lzma-linux-arm64-gnu@1.3.1': - resolution: {integrity: sha512-vDmVsthRbX2opkgRirJJGKQxUP/spvyVM2Y5CyCWZ7sadSID3hA97r38gf9ISn/sJ8/r93IPWLq+iycudNKi+Q==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/lzma-linux-arm64-musl@1.3.1': - resolution: {integrity: sha512-x4m/J3hRdFd3IoqKc+4aBcSUkcuDEP7hH6vdss8bKNLjPfXmnG/lcHJEQX3hNnNOULPP8xVRxgiY8jeL62cnsw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/lzma-linux-x64-gnu@1.3.1': - resolution: {integrity: sha512-riB+Xg72NfH8Kcpq07omshVu0QsLW0v2bhywBNYxvA+t2dGGWSIEN1U/zazUXys+IEA6pBQKqLVseurWE6Cl8g==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/lzma-linux-x64-musl@1.3.1': - resolution: {integrity: sha512-JXLgJFwoeysxdSg7rdVYP8wrliCQVJlU5JcLYjRVSCL4P0mQTjnYi7R7VdaOkDACw/Fvlji7oIJXt0KiaDTcOw==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/lzma-wasm32-wasi@1.3.1': - resolution: {integrity: sha512-XTA9XTUtj0KPKuzNS2oi3bWN6tJodk00wwMd/TiKoEqx9Fe/zu+OfDGuXAn+xs+P7S3YCDHqjYinuTQMZ0ucJw==} - engines: {node: '>=14.0.0'} - cpu: [wasm32] - - '@napi-rs/lzma-win32-arm64-msvc@1.3.1': - resolution: {integrity: sha512-qLDfs9UEtLPPTN/FdSz3gSdlx86VwFQBuLBrQtaiYQtUTKZCOYV1Z1fXqFt5Zqa1HKV2oyXnwGcTI7RpcyXxtg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [win32] - - '@napi-rs/lzma-win32-ia32-msvc@1.3.1': - resolution: {integrity: sha512-rWNlxLFMIfvxzfdQCfeQ3D/HEnQG3vfladFYrXUx6ePXO6r+BLCGn6/LWSSuKlw4vKkb1iHEWsAVaRLIcJEMIA==} - engines: {node: '>= 10'} - cpu: [ia32] - os: [win32] - - '@napi-rs/lzma-win32-x64-msvc@1.3.1': - resolution: {integrity: sha512-SNfHNqEjabXfTL1+KRi0qiAhwIlZHhQystvfSYX6p1g+2trSC/3WUpUQ4fbbR7KyE31g2AAnwjXivnlQ0af/pg==} - engines: {node: '>= 10'} - cpu: [x64] - os: [win32] - - '@napi-rs/lzma@1.3.1': - resolution: {integrity: sha512-XyZoBlYNMvCulK/RmVK/0nB3j7IdH7HpqcrMMg0U+HqQqKRLOQBwvnKNBocPC1bZQ7iZuKWYTLn1ayZwTyek8w==} - engines: {node: '>= 10'} - - '@napi-rs/tar-android-arm-eabi@0.1.1': - resolution: {integrity: sha512-Ufa0ahZvE5KGrC2WBux5svCe/jvC+e8IgtleiicwqnfgTfbDknYyq/QuqkP1AnMp/IvTmx2iutCZt6OFIG0zAg==} - engines: {node: '>= 10'} - cpu: [arm] - os: [android] - - '@napi-rs/tar-android-arm64@0.1.1': - resolution: {integrity: sha512-KUu5fHIiIObSuZ/crHxUrQ243+LiCRKPwdCVLHwjtftqFjzls+R2Mp6GrpM41XxexDMN00SUta3kazi93Xr19A==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [android] - - '@napi-rs/tar-darwin-arm64@0.1.1': - resolution: {integrity: sha512-jaqgdX20iIga+2gzotQ78eF00Cm8vECocUYeMY62WqyzJNv/jx1dlOfELWEccOjpmawFT9tjWebsS9F1QMvSUg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [darwin] - - '@napi-rs/tar-darwin-x64@0.1.1': - resolution: {integrity: sha512-80sa32IxfRso9x9sGTFpfLSx3BnruyJODpSkUzalOCz9i14n5gOKA8KR/JrnSWwDz0p5l5P9kfQD3pu8Voj7WA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [darwin] - - '@napi-rs/tar-freebsd-x64@0.1.1': - resolution: {integrity: sha512-P7V1zBjjC1dCrTwtUzuzYM4AeZduigeCtd8qQw2IUZowM5AsmhMd77oYuXjdU29cEpKUpyYjJRxjPCzFy+WbAQ==} - engines: {node: '>= 10'} - cpu: [x64] - os: [freebsd] - - '@napi-rs/tar-linux-arm-gnueabihf@0.1.1': - resolution: {integrity: sha512-qpC71ILPkWKt8k1iJCYt5gjwcOkd2VFSQIelTRr12t5CVNKV04rE/TMdwFoCP7kxbtb9Fl2cZzCRISw2BhMCmQ==} - engines: {node: '>= 10'} - cpu: [arm] - os: [linux] - - '@napi-rs/tar-linux-arm64-gnu@0.1.1': - resolution: {integrity: sha512-71QgxcFJCog6O4Tauoge8D0ILkDGJTRk3ru7zG8PUFG1QXJ1kkiRikdT77YmoVxtomc9FUOt+bdEdU5Yn+3QUQ==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/tar-linux-arm64-musl@0.1.1': - resolution: {integrity: sha512-R2e7YEILPKc447N1hUt1zQuyy0st83HX6nhmtFywS1aOj76/3hzxLVrebGiiS6kifyCrO82o66CNTYe7DixMZw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/tar-linux-x64-gnu@0.1.1': - resolution: {integrity: sha512-tmy9q2LXUB2GQ+IgUzJn3+us52leplMu96ORyFq1iHQEelGSqXt4xi5DzU07JhX3obJPqVqkybtcRS4enBfmBA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/tar-linux-x64-musl@0.1.1': - resolution: {integrity: sha512-j5ePbe6vihApl0cGPPDUVTWZbf2mF4NhxngAoG2jp7AeX3cWP2O4pjsvaOraW6QfvWEMFPeER7S0b6eBS7duvA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/tar-wasm32-wasi@0.1.1': - resolution: {integrity: sha512-se0+DlOiIRt7mcz7BeOJDoZtCrROpKLwiAOGmNgrjQ/SZS7TnOPuwm3wy9XN9WLoepttEjCEem6UP8yD5GJuQg==} - engines: {node: '>=14.0.0'} - cpu: [wasm32] - - '@napi-rs/tar-win32-arm64-msvc@0.1.1': - resolution: {integrity: sha512-FDZPi2wC7RwzvodogigLh/pJvhqCTVTUqOYuHlLkPSUbSAGiEkI55wk9RqH3y3EdJQaDuzyqC0QKz5ket2U+GA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [win32] - - '@napi-rs/tar-win32-ia32-msvc@0.1.1': - resolution: {integrity: sha512-OPR9Tou5z5M912G7Kc7gkf1ltinbOQx5dS/OeDIWHvPGOfdFDIxt0YVKhzSLRJi43+zIDp8/+cbeMD/cKXfX8w==} - engines: {node: '>= 10'} - cpu: [ia32] - os: [win32] - - '@napi-rs/tar-win32-x64-msvc@0.1.1': - resolution: {integrity: sha512-hiv5KfhrMSg8tTRC2oQXVckVg1h6ZVjwbd5aF9Esl0V3p2TaNFwwbqgnAN4Gm/PmSnHWNL/IRTHkk3cOzDWihQ==} - engines: {node: '>= 10'} - cpu: [x64] - os: [win32] - - '@napi-rs/tar@0.1.1': - resolution: {integrity: sha512-FOMhwwlvoYjHaDBxP26K3D92ltw1Y/CC4CIjgC6qXdzW4MYNwTlEyI58smCM3k+nCVJH3kpOYyH3sgbK4WZA4A==} - engines: {node: '>= 10'} - - '@napi-rs/wasm-runtime@0.2.4': - resolution: {integrity: sha512-9zESzOO5aDByvhIAsOy9TbpZ0Ur2AJbUI7UT73kcUTS2mxAMHOBaa1st/jAymNoCtvrit99kkzT1FZuXVcgfIQ==} - - '@napi-rs/wasm-tools-android-arm-eabi@0.0.2': - resolution: {integrity: sha512-/b+UU3suXjW4P0DzHRNdrnebQtFKcQf/YMeZJH+xUlKgvwli5kbmWjx8Wqqz0VETVkUTuPqJMBDIVLyc+14FGw==} - engines: {node: '>= 10'} - cpu: [arm] - os: [android] - - '@napi-rs/wasm-tools-android-arm64@0.0.2': - resolution: {integrity: sha512-j57GbDflwJdZtT8pZj5fOV4JAP+LdKN+wzsUYs+QRUoBqpWbbUANudolqfw63bkS9sD4z7fbCuz8iwtJqzxTVA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [android] - - '@napi-rs/wasm-tools-darwin-arm64@0.0.2': - resolution: {integrity: sha512-P2ChgWgVuv9GwmbxN89R84KzIImoTqXINteEixUvmkdnhyFiR+I8deNs89Yed+5w8QLC6MEfrtRqLP9YI+NoQA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [darwin] - - '@napi-rs/wasm-tools-darwin-x64@0.0.2': - resolution: {integrity: sha512-T/kQQ0gt8+wau1Z821PKVAD76QhmwVoLs2CT7Z9tTBs2pJvwSCP0C/kQiQAHcJIMi7A2E9Ab/Mez0BERy50EFA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [darwin] - - '@napi-rs/wasm-tools-freebsd-x64@0.0.2': - resolution: {integrity: sha512-GnnHu+r5sfzuxC/1J5UMF/h3BOZnHb3NQZ5hmbCfZYCKzpzRxrAJhzRunlbRN+v0x8M/49dztVTYR3s7K4ooAw==} - engines: {node: '>= 10'} - cpu: [x64] - os: [freebsd] - - '@napi-rs/wasm-tools-linux-arm64-gnu@0.0.2': - resolution: {integrity: sha512-KnZdLT0OnKb1CG2kdt3/WvM43vr9i+FEwXCvSOVC/6Tsifz7ynhMg7LAVESILd03HubzQJfg9nbRsk0bQ+IOwg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/wasm-tools-linux-arm64-musl@0.0.2': - resolution: {integrity: sha512-HkpZOID2U8P6pWqK3mqZ8bxU5xcuT3iA2fO+jrxn78h006iYgfNmdc5JaVhHnHazMmk32xKhSV4iV0VUh8UWDg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/wasm-tools-linux-x64-gnu@0.0.2': - resolution: {integrity: sha512-YksJWBCyOalB9ogtP9+/dZKP+vR6+h7BmzMXaXMT71WW/GvIsifMVgv+DY/FRSNJQupp5Y+ugjqVAOUOc/G65g==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/wasm-tools-linux-x64-musl@0.0.2': - resolution: {integrity: sha512-sPtRxPMdw05KdTcxgSPMmSXG2+PiK3vJ/l2+g9hvjnnKtvslJN2Hr7j8zgzuoKRAUFPaJVe6+D2xVh5cpdqhww==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/wasm-tools-wasm32-wasi@0.0.2': - resolution: {integrity: sha512-muRvZK7AIuo88G2AxYx3gA59rHMQgoN004saQkBvXnz3K/DVHKfTZ6TtUebss8zI3dURU6xExL8drxFWYxjEbQ==} - engines: {node: '>=14.0.0'} - cpu: [wasm32] - - '@napi-rs/wasm-tools-win32-arm64-msvc@0.0.2': - resolution: {integrity: sha512-Cn13WQ+tpFqdVwx0DIWKbsI9auFyzVZV4F5UNOUeDt6GgOL+NndgJul0Pc9bSU6fi03AylMPfF/nTCaDWO2Wgw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [win32] - - '@napi-rs/wasm-tools-win32-ia32-msvc@0.0.2': - resolution: {integrity: sha512-xsg5DkIQi82a8rcx6246Y3XC8TIqHamY+/C6sIlPLaZEuHctDkMECAw0AANwRf5vN//D2oo2oljOuoYtB1GOKw==} - engines: {node: '>= 10'} - cpu: [ia32] - os: [win32] - - '@napi-rs/wasm-tools-win32-x64-msvc@0.0.2': - resolution: {integrity: sha512-yHigltEt33eq8bappvKsIliz4MxfMPn1M+NWbIFRWN+IS1Z57mhmc1osuk+IRXrSlq0Tom0R6MYN1jpkZKz81Q==} - engines: {node: '>= 10'} - cpu: [x64] - os: [win32] - - '@napi-rs/wasm-tools@0.0.2': - resolution: {integrity: sha512-kBvDQCP5BLw2TxTENXLp3Of7vVEx0uyIye824JHE4dduzzOHVgSoOFVhVqAT3Fx/hLV445RVWfEqQbXMg4w/Mw==} - engines: {node: '>= 10'} - - '@nodelib/fs.scandir@2.1.5': - resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} - engines: {node: '>= 8'} - - '@nodelib/fs.stat@2.0.5': - resolution: {integrity: sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==} - engines: {node: '>= 8'} - - '@nodelib/fs.walk@1.2.8': - resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} - engines: {node: '>= 8'} - - '@octokit/auth-token@5.1.1': - resolution: {integrity: sha512-rh3G3wDO8J9wSjfI436JUKzHIxq8NaiL0tVeB2aXmG6p/9859aUOAjA9pmSPNGGZxfwmaJ9ozOJImuNVJdpvbA==} - engines: {node: '>= 18'} - - '@octokit/core@6.1.2': - resolution: {integrity: sha512-hEb7Ma4cGJGEUNOAVmyfdB/3WirWMg5hDuNFVejGEDFqupeOysLc2sG6HJxY2etBp5YQu5Wtxwi020jS9xlUwg==} - engines: {node: '>= 18'} - - '@octokit/endpoint@10.1.1': - resolution: {integrity: sha512-JYjh5rMOwXMJyUpj028cu0Gbp7qe/ihxfJMLc8VZBMMqSwLgOxDI1911gV4Enl1QSavAQNJcwmwBF9M0VvLh6Q==} - engines: {node: '>= 18'} - - '@octokit/graphql@8.1.1': - resolution: {integrity: sha512-ukiRmuHTi6ebQx/HFRCXKbDlOh/7xEV6QUXaE7MJEKGNAncGI/STSbOkl12qVXZrfZdpXctx5O9X1AIaebiDBg==} - engines: {node: '>= 18'} - - '@octokit/openapi-types@22.2.0': - resolution: {integrity: sha512-QBhVjcUa9W7Wwhm6DBFu6ZZ+1/t/oYxqc2tp81Pi41YNuJinbFRx8B133qVOrAaBbF7D/m0Et6f9/pZt9Rc+tg==} - - '@octokit/plugin-paginate-rest@11.3.3': - resolution: {integrity: sha512-o4WRoOJZlKqEEgj+i9CpcmnByvtzoUYC6I8PD2SA95M+BJ2x8h7oLcVOg9qcowWXBOdcTRsMZiwvM3EyLm9AfA==} - engines: {node: '>= 18'} - peerDependencies: - '@octokit/core': '>=6' - - '@octokit/plugin-request-log@5.3.0': - resolution: {integrity: sha512-FiGcyjdtYPlr03ExBk/0ysIlEFIFGJQAVoPPMxL19B24bVSEiZQnVGBunNtaAF1YnvE/EFoDpXmITtRnyCiypQ==} - engines: {node: '>= 18'} - peerDependencies: - '@octokit/core': '>=6' - - '@octokit/plugin-rest-endpoint-methods@13.2.4': - resolution: {integrity: sha512-gusyAVgTrPiuXOdfqOySMDztQHv6928PQ3E4dqVGEtOvRXAKRbJR4b1zQyniIT9waqaWk/UDaoJ2dyPr7Bk7Iw==} - engines: {node: '>= 18'} - peerDependencies: - '@octokit/core': '>=6' - - '@octokit/request-error@6.1.2': - resolution: {integrity: sha512-sA0oF7aL5wXbNfl+7zgLYJiFZctei9GaIMJlTraJrlQyFaoIYr4MCqPSakzxxGCfm8fET4vn0cQdRFmD7avlDg==} - engines: {node: '>= 18'} - - '@octokit/request@9.1.1': - resolution: {integrity: sha512-pyAguc0p+f+GbQho0uNetNQMmLG1e80WjkIaqqgUkihqUp0boRU6nKItXO4VWnr+nbZiLGEyy4TeKRwqaLvYgw==} - engines: {node: '>= 18'} - - '@octokit/rest@21.0.0': - resolution: {integrity: sha512-XudXXOmiIjivdjNZ+fN71NLrnDM00sxSZlhqmPR3v0dVoJwyP628tSlc12xqn8nX3N0965583RBw5GPo6r8u4Q==} - engines: {node: '>= 18'} - - '@octokit/types@13.5.0': - resolution: {integrity: sha512-HdqWTf5Z3qwDVlzCrP8UJquMwunpDiMPt5er+QjGzL4hqr/vBVY/MauQgS1xWxCDT1oMx1EULyqxncdCY/NVSQ==} - - '@rollup/pluginutils@4.2.1': - resolution: {integrity: sha512-iKnFXr7NkdZAIHiIWE+BX5ULi/ucVFYWD6TbAV+rZctiRTY2PL6tsIKhoIOaoskiWAkgu+VsbXgUVDNLHf+InQ==} - engines: {node: '>= 8.0.0'} - - '@sindresorhus/merge-streams@2.3.0': - resolution: {integrity: sha512-LtoMMhxAlorcGhmFYI+LhPgbPZCkgP6ra1YL604EeF6U98pLlQ3iWIGMdWSC+vWmPBWBNgmDBAhnAobLROJmwg==} - engines: {node: '>=18'} - - '@tybys/wasm-util@0.9.0': - resolution: {integrity: sha512-6+7nlbMVX/PVDCwaIQ8nTOPveOcFLSt8GcXdx8hD0bt39uWxYT88uXzqTd4fTvqta7oeUJqudepapKNt2DYJFw==} - - '@types/mute-stream@0.0.4': - resolution: {integrity: sha512-CPM9nzrCPPJHQNA9keH9CVkVI+WR5kMa+7XEs5jcGQ0VoAGnLv242w8lIVgwAEfmE4oufJRaTc9PNLQl0ioAow==} - - '@types/node@20.16.5': - resolution: {integrity: sha512-VwYCweNo3ERajwy0IUlqqcyZ8/A7Zwa9ZP3MnENWcB11AejO+tLy3pu850goUW2FC/IJMdZUfKpX/yxL1gymCA==} - - '@types/node@22.5.4': - resolution: {integrity: sha512-FDuKUJQm/ju9fT/SeX/6+gBzoPzlVCzfzmGkwKvRHQVxi4BntVbyIwf6a4Xn62mrvndLiml6z/UBXIdEVjQLXg==} - - '@types/stylis@4.2.6': - resolution: {integrity: sha512-4nebF2ZJGzQk0ka0O6+FZUWceyFv4vWq/0dXBMmrSeAwzOuOd/GxE5Pa64d/ndeNLG73dXoBsRzvtsVsYUv6Uw==} - - '@types/wrap-ansi@3.0.0': - resolution: {integrity: sha512-ltIpx+kM7g/MLRZfkbL7EsCEjfzCcScLpkg37eXEtx5kmrAKBkTJwd1GIAjDSL8wTpM6Hzn5YO4pSb91BEwu1g==} - - '@vercel/nft@0.26.5': - resolution: {integrity: sha512-NHxohEqad6Ra/r4lGknO52uc/GrWILXAMs1BB4401GTqww0fw1bAqzpG1XHuDO+dprg4GvsD9ZLLSsdo78p9hQ==} - engines: {node: '>=16'} - hasBin: true - - abbrev@1.1.1: - resolution: {integrity: sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==} - - acorn-import-attributes@1.9.5: - resolution: {integrity: sha512-n02Vykv5uA3eHGM/Z2dQrcD56kL8TyDb2p1+0P83PClMnC/nc+anbQRhIOWnSq4Ke/KvDPrY3C9hDtC/A3eHnQ==} - peerDependencies: - acorn: ^8 - - acorn-walk@8.3.3: - resolution: {integrity: sha512-MxXdReSRhGO7VlFe1bRG/oI7/mdLV9B9JJT0N8vZOhF7gFRR5l3M8W9G8JxmKV+JC5mGqJ0QvqfSOLsCPa4nUw==} - engines: {node: '>=0.4.0'} - - acorn@8.12.1: - resolution: {integrity: sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg==} - engines: {node: '>=0.4.0'} - hasBin: true - - agent-base@6.0.2: - resolution: {integrity: sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==} - engines: {node: '>= 6.0.0'} - - ansi-escapes@4.3.2: - resolution: {integrity: sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==} - engines: {node: '>=8'} - - ansi-regex@5.0.1: - resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} - engines: {node: '>=8'} - - ansi-regex@6.0.1: - resolution: {integrity: sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==} - engines: {node: '>=12'} - - ansi-styles@4.3.0: - resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} - engines: {node: '>=8'} - - ansi-styles@6.2.1: - resolution: {integrity: sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==} - engines: {node: '>=12'} - - aproba@2.0.0: - resolution: {integrity: sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==} - - are-we-there-yet@2.0.0: - resolution: {integrity: sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw==} - engines: {node: '>=10'} - deprecated: This package is no longer supported. - - argparse@1.0.10: - resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==} - - argparse@2.0.1: - resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} - - array-find-index@1.0.2: - resolution: {integrity: sha512-M1HQyIXcBGtVywBt8WVdim+lrNaK7VHp99Qt5pSNziXznKHViIBbXWtfRTpEFpF/c4FdfxNAsCCwPp5phBYJtw==} - engines: {node: '>=0.10.0'} - - arrgv@1.0.2: - resolution: {integrity: sha512-a4eg4yhp7mmruZDQFqVMlxNRFGi/i1r87pt8SDHy0/I8PqSXoUTlWZRdAZo0VXgvEARcujbtTk8kiZRi1uDGRw==} - engines: {node: '>=8.0.0'} - - arrify@3.0.0: - resolution: {integrity: sha512-tLkvA81vQG/XqE2mjDkGQHoOINtMHtysSnemrmoGe6PydDPMRbVugqyk4A6V/WDWEfm3l+0d8anA9r8cv/5Jaw==} - engines: {node: '>=12'} - - async-sema@3.1.1: - resolution: {integrity: sha512-tLRNUXati5MFePdAk8dw7Qt7DpxPB60ofAgn8WRhW6a2rcimZnYBP9oxHiv0OHy+Wz7kPMG+t4LGdt31+4EmGg==} - - asynckit@0.4.0: - resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} - - ava@6.1.3: - resolution: {integrity: sha512-tkKbpF1pIiC+q09wNU9OfyTDYZa8yuWvU2up3+lFJ3lr1RmnYh2GBpPwzYUEB0wvTPIUysGjcZLNZr7STDviRA==} - engines: {node: ^18.18 || ^20.8 || ^21 || ^22} - hasBin: true - peerDependencies: - '@ava/typescript': '*' - peerDependenciesMeta: - '@ava/typescript': - optional: true - - axios@1.6.2: - resolution: {integrity: sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A==} - - balanced-match@1.0.2: - resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} - - before-after-hook@3.0.2: - resolution: {integrity: sha512-Nik3Sc0ncrMK4UUdXQmAnRtzmNQTAAXmXIopizwZ1W1t8QmfJj+zL4OA2I7XPTPW5z5TDqv4hRo/JzouDJnX3A==} - - bindings@1.5.0: - resolution: {integrity: sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==} - - blueimp-md5@2.19.0: - resolution: {integrity: sha512-DRQrD6gJyy8FbiE4s+bDoXS9hiW3Vbx5uCdwvcCf3zLHL+Iv7LtGHLpr+GZV8rHG8tK766FGYBwRbu8pELTt+w==} - - brace-expansion@1.1.11: - resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} - - braces@3.0.3: - resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==} - engines: {node: '>=8'} - - callsites@4.2.0: - resolution: {integrity: sha512-kfzR4zzQtAE9PC7CzZsjl3aBNbXWuXiSeOCdLcPpBfGW8YuCqQHcRPFDbr/BPVmd3EEPVpuFzLyuT/cUhPr4OQ==} - engines: {node: '>=12.20'} - - camelize@1.0.1: - resolution: {integrity: sha512-dU+Tx2fsypxTgtLoE36npi3UqcjSSMNYfkqgmoEhtZrraP5VWq0K7FkWVTYa8eMPtnU/G2txVsfdCJTn9uzpuQ==} - - cbor@9.0.2: - resolution: {integrity: sha512-JPypkxsB10s9QOWwa6zwPzqE1Md3vqpPc+cai4sAecuCsRyAtAl/pMyhPlMbT/xtPnm2dznJZYRLui57qiRhaQ==} - engines: {node: '>=16'} - - chalk@5.3.0: - resolution: {integrity: sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==} - engines: {node: ^12.17.0 || ^14.13 || >=16.0.0} - - chardet@0.7.0: - resolution: {integrity: sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==} - - chownr@2.0.0: - resolution: {integrity: sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==} - engines: {node: '>=10'} - - chunkd@2.0.1: - resolution: {integrity: sha512-7d58XsFmOq0j6el67Ug9mHf9ELUXsQXYJBkyxhH/k+6Ke0qXRnv0kbemx+Twc6fRJ07C49lcbdgm9FL1Ei/6SQ==} - - ci-info@4.0.0: - resolution: {integrity: sha512-TdHqgGf9odd8SXNuxtUBVx8Nv+qZOejE6qyqiy5NtbYYQOeFa6zmHkxlPzmaLxWWHsU6nJmB7AETdVPi+2NBUg==} - engines: {node: '>=8'} - - ci-parallel-vars@1.0.1: - resolution: {integrity: sha512-uvzpYrpmidaoxvIQHM+rKSrigjOe9feHYbw4uOI2gdfe1C3xIlxO+kVXq83WQWNniTf8bAxVpy+cQeFQsMERKg==} - - cli-spinners@2.9.2: - resolution: {integrity: sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==} - engines: {node: '>=6'} - - cli-truncate@4.0.0: - resolution: {integrity: sha512-nPdaFdQ0h/GEigbPClz11D0v/ZJEwxmeVZGeMo3Z5StPtUTkA9o1lD6QwoirYiSDzbcwn2XcjwmCp68W1IS4TA==} - engines: {node: '>=18'} - - cli-width@4.1.0: - resolution: {integrity: sha512-ouuZd4/dm2Sw5Gmqy6bGyNNNe1qt9RpmxveLSO7KcgsTnU7RXfsw+/bukWGo1abgBiMAic068rclZsO4IWmmxQ==} - engines: {node: '>= 12'} - - clipanion@3.2.1: - resolution: {integrity: sha512-dYFdjLb7y1ajfxQopN05mylEpK9ZX0sO1/RfMXdfmwjlIsPkbh4p7A682x++zFPLDCo1x3p82dtljHf5cW2LKA==} - peerDependencies: - typanion: '*' - - cliui@8.0.1: - resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==} - engines: {node: '>=12'} - - code-excerpt@4.0.0: - resolution: {integrity: sha512-xxodCmBen3iy2i0WtAK8FlFNrRzjUqjRsMfho58xT/wvZU1YTM3fCnRjcy1gJPMepaRlgm/0e6w8SpWHpn3/cA==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - color-convert@2.0.1: - resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} - engines: {node: '>=7.0.0'} - - color-name@1.1.4: - resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} - - color-support@1.1.3: - resolution: {integrity: sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==} - hasBin: true - - colorette@2.0.20: - resolution: {integrity: sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==} - - combined-stream@1.0.8: - resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} - engines: {node: '>= 0.8'} - - common-path-prefix@3.0.0: - resolution: {integrity: sha512-QE33hToZseCH3jS0qN96O/bSh3kaw/h+Tq7ngyY9eWDUnTlTNUyqfqvCXioLe5Na5jFsL78ra/wuBU4iuEgd4w==} - - concat-map@0.0.1: - resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} - - concordance@5.0.4: - resolution: {integrity: sha512-OAcsnTEYu1ARJqWVGwf4zh4JDfHZEaSNlNccFmt8YjB2l/n19/PF2viLINHc57vO4FKIAFl2FWASIGZZWZ2Kxw==} - engines: {node: '>=10.18.0 <11 || >=12.14.0 <13 || >=14'} - - console-control-strings@1.1.0: - resolution: {integrity: sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==} - - convert-to-spaces@2.0.1: - resolution: {integrity: sha512-rcQ1bsQO9799wq24uE5AM2tAILy4gXGIK/njFWcVQkGNZ96edlpY+A7bjwvzjYvLDyzmG1MmMLZhpcsb+klNMQ==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - css-color-keywords@1.0.0: - resolution: {integrity: sha512-FyyrDHZKEjXDpNJYvVsV960FiqQyXc/LlYmsxl2BcdMb2WPx0OGRVgTg55rPSyLSNMqP52R9r8geSp7apN3Ofg==} - engines: {node: '>=4'} - - css-to-react-native@3.2.0: - resolution: {integrity: sha512-e8RKaLXMOFii+02mOlqwjbD00KSEKqblnpO9e++1aXS1fPQOpS1YoqdVHBqPjHNoxeF2mimzVqawm2KCbEdtHQ==} - - csstype@3.1.3: - resolution: {integrity: sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==} - - currently-unhandled@0.4.1: - resolution: {integrity: sha512-/fITjgjGU50vjQ4FH6eUoYu+iUoUKIXws2hL15JJpIR+BbTxaXQsMuuyjtNh2WqsSBS5nsaZHFsFecyw5CCAng==} - engines: {node: '>=0.10.0'} - - date-time@3.1.0: - resolution: {integrity: sha512-uqCUKXE5q1PNBXjPqvwhwJf9SwMoAHBgWJ6DcrnS5o+W2JOiIILl0JEdVD8SGujrNS02GGxgwAg2PN2zONgtjg==} - engines: {node: '>=6'} - - debug@4.3.5: - resolution: {integrity: sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg==} - engines: {node: '>=6.0'} - peerDependencies: - supports-color: '*' - peerDependenciesMeta: - supports-color: - optional: true - - delayed-stream@1.0.0: - resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} - engines: {node: '>=0.4.0'} - - delegates@1.0.0: - resolution: {integrity: sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==} - - detect-libc@2.0.3: - resolution: {integrity: sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw==} - engines: {node: '>=8'} - - emittery@1.0.3: - resolution: {integrity: sha512-tJdCJitoy2lrC2ldJcqN4vkqJ00lT+tOWNT1hBJjO/3FDMJa5TTIiYGCKGkn/WfCyOzUMObeohbVTj00fhiLiA==} - engines: {node: '>=14.16'} - - emnapi@1.2.0: - resolution: {integrity: sha512-rcq+dJCcfr08I0XM/57LPRqaUokGfni/+SvhO7NaJthTTjRdohhIy0FQwyC5rR1enAsjkldQg83th8J5hURv0Q==} - peerDependencies: - node-addon-api: '>= 6.1.0' - peerDependenciesMeta: - node-addon-api: - optional: true - - emoji-regex@10.3.0: - resolution: {integrity: sha512-QpLs9D9v9kArv4lfDEgg1X/gN5XLnf/A6l9cs8SPZLRZR3ZkY9+kwIQTxm+fsSej5UMYGE8fdoaZVIBlqG0XTw==} - - emoji-regex@8.0.0: - resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} - - escalade@3.1.2: - resolution: {integrity: sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==} - engines: {node: '>=6'} - - escape-string-regexp@2.0.0: - resolution: {integrity: sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==} - engines: {node: '>=8'} - - escape-string-regexp@5.0.0: - resolution: {integrity: sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==} - engines: {node: '>=12'} - - esprima@4.0.1: - resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==} - engines: {node: '>=4'} - hasBin: true - - estree-walker@2.0.2: - resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==} - - esutils@2.0.3: - resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} - engines: {node: '>=0.10.0'} - - external-editor@3.1.0: - resolution: {integrity: sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==} - engines: {node: '>=4'} - - fast-diff@1.3.0: - resolution: {integrity: sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==} - - fast-glob@3.3.2: - resolution: {integrity: sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==} - engines: {node: '>=8.6.0'} - - fastq@1.17.1: - resolution: {integrity: sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==} - - figures@6.1.0: - resolution: {integrity: sha512-d+l3qxjSesT4V7v2fh+QnmFnUWv9lSpjarhShNTgBOfA0ttejbQUAlHLitbjkoRiDulW0OPoQPYIGhIC8ohejg==} - engines: {node: '>=18'} - - file-uri-to-path@1.0.0: - resolution: {integrity: sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==} - - fill-range@7.1.1: - resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==} - engines: {node: '>=8'} - - find-up-simple@1.0.0: - resolution: {integrity: sha512-q7Us7kcjj2VMePAa02hDAF6d+MzsdsAWEwYyOpwUtlerRBkOEPBCRZrAV4XfcSN8fHAgaD0hP7miwoay6DCprw==} - engines: {node: '>=18'} - - follow-redirects@1.15.6: - resolution: {integrity: sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==} - engines: {node: '>=4.0'} - peerDependencies: - debug: '*' - peerDependenciesMeta: - debug: - optional: true - - form-data@4.0.0: - resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==} - engines: {node: '>= 6'} - - fs-minipass@2.1.0: - resolution: {integrity: sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==} - engines: {node: '>= 8'} - - fs.realpath@1.0.0: - resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} - - gauge@3.0.2: - resolution: {integrity: sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q==} - engines: {node: '>=10'} - deprecated: This package is no longer supported. - - get-caller-file@2.0.5: - resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} - engines: {node: 6.* || 8.* || >= 10.*} - - get-east-asian-width@1.2.0: - resolution: {integrity: sha512-2nk+7SIVb14QrgXFHcm84tD4bKQz0RxPuMT8Ag5KPOq7J5fEmAg0UbXdTOSHqNuHSU28k55qnceesxXRZGzKWA==} - engines: {node: '>=18'} - - glob-parent@5.1.2: - resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} - engines: {node: '>= 6'} - - glob@7.2.3: - resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} - deprecated: Glob versions prior to v9 are no longer supported - - globby@14.0.2: - resolution: {integrity: sha512-s3Fq41ZVh7vbbe2PN3nrW7yC7U7MFVc5c98/iTl9c2GawNMKx/J648KQRW6WKkuU8GIbbh2IXfIRQjOZnXcTnw==} - engines: {node: '>=18'} - - graceful-fs@4.2.11: - resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} - - has-unicode@2.0.1: - resolution: {integrity: sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==} - - https-proxy-agent@5.0.1: - resolution: {integrity: sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==} - engines: {node: '>= 6'} - - iconv-lite@0.4.24: - resolution: {integrity: sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==} - engines: {node: '>=0.10.0'} - - ignore-by-default@2.1.0: - resolution: {integrity: sha512-yiWd4GVmJp0Q6ghmM2B/V3oZGRmjrKLXvHR3TE1nfoXsmoggllfZUQe74EN0fJdPFZu2NIvNdrMMLm3OsV7Ohw==} - engines: {node: '>=10 <11 || >=12 <13 || >=14'} - - ignore@5.3.1: - resolution: {integrity: sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==} - engines: {node: '>= 4'} - - imurmurhash@0.1.4: - resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} - engines: {node: '>=0.8.19'} - - indent-string@5.0.0: - resolution: {integrity: sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==} - engines: {node: '>=12'} - - inflight@1.0.6: - resolution: {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. - - inherits@2.0.4: - resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} - - inquirer@10.0.1: - resolution: {integrity: sha512-XgthhRIn0Ci9JdGJpUo2EtpPfaczbooZbGTN+FTzSCyUb7YHJcPPnuSXfeG5903bJMy3OyEoVTQMnvO4Ly5tFg==} - engines: {node: '>=18'} - - ipaddr.js@2.2.0: - resolution: {integrity: sha512-Ag3wB2o37wslZS19hZqorUnrnzSkpOVy+IiiDEiTqNubEYpYuHWIf6K4psgN2ZWKExS4xhVCrRVfb/wfW8fWJA==} - engines: {node: '>= 10'} - - irregular-plurals@3.5.0: - resolution: {integrity: sha512-1ANGLZ+Nkv1ptFb2pa8oG8Lem4krflKuX/gINiHJHjJUKaJHk/SXk5x6K3J+39/p0h1RQ2saROclJJ+QLvETCQ==} - engines: {node: '>=8'} - - is-extglob@2.1.1: - resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} - engines: {node: '>=0.10.0'} - - is-fullwidth-code-point@3.0.0: - resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} - engines: {node: '>=8'} - - is-fullwidth-code-point@4.0.0: - resolution: {integrity: sha512-O4L094N2/dZ7xqVdrXhh9r1KODPJpFms8B5sGdJLPy664AgvXsreZUyCQQNItZRDlYug4xStLjNp/sz3HvBowQ==} - engines: {node: '>=12'} - - is-glob@4.0.3: - resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} - engines: {node: '>=0.10.0'} - - is-number@7.0.0: - resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} - engines: {node: '>=0.12.0'} - - is-plain-object@5.0.0: - resolution: {integrity: sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==} - engines: {node: '>=0.10.0'} - - is-promise@4.0.0: - resolution: {integrity: sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==} - - is-unicode-supported@2.0.0: - resolution: {integrity: sha512-FRdAyx5lusK1iHG0TWpVtk9+1i+GjrzRffhDg4ovQ7mcidMQ6mj+MhKPmvh7Xwyv5gIS06ns49CA7Sqg7lC22Q==} - engines: {node: '>=18'} - - js-string-escape@1.0.1: - resolution: {integrity: sha512-Smw4xcfIQ5LVjAOuJCvN/zIodzA/BBSsluuoSykP+lUvScIi4U6RJLfwHet5cxFnCswUjISV8oAXaqaJDY3chg==} - engines: {node: '>= 0.8'} - - js-tokens@4.0.0: - resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} - - js-yaml@3.14.1: - resolution: {integrity: sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==} - hasBin: true - - js-yaml@4.1.0: - resolution: {integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==} - hasBin: true - - load-json-file@7.0.1: - resolution: {integrity: sha512-Gnxj3ev3mB5TkVBGad0JM6dmLiQL+o0t23JPBZ9sd+yvSLk05mFoqKBw5N8gbbkU4TNXyqCgIrl/VM17OgUIgQ==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - lodash-es@4.17.21: - resolution: {integrity: sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==} - - lodash@4.17.21: - resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} - - loose-envify@1.4.0: - resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==} - hasBin: true - - make-dir@3.1.0: - resolution: {integrity: sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==} - engines: {node: '>=8'} - - matcher@5.0.0: - resolution: {integrity: sha512-s2EMBOWtXFc8dgqvoAzKJXxNHibcdJMV0gwqKUaw9E2JBJuGUK7DrNKrA6g/i+v72TT16+6sVm5mS3thaMLQUw==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - md5-hex@3.0.1: - resolution: {integrity: sha512-BUiRtTtV39LIJwinWBjqVsU9xhdnz7/i889V859IBFpuqGAj6LuOvHv5XLbgZ2R7ptJoJaEcxkv88/h25T7Ciw==} - engines: {node: '>=8'} - - memoize@10.0.0: - resolution: {integrity: sha512-H6cBLgsi6vMWOcCpvVCdFFnl3kerEXbrYh9q+lY6VXvQSmM6CkmV08VOwT+WE2tzIEqRPFfAq3fm4v/UIW6mSA==} - engines: {node: '>=18'} - - merge2@1.4.1: - resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} - engines: {node: '>= 8'} - - micromatch@4.0.7: - resolution: {integrity: sha512-LPP/3KorzCwBxfeUuZmaR6bG2kdeHSbe0P2tY3FLRU4vYrjYz5hI4QZwV0njUx3jeuKe67YukQ1LSPZBKDqO/Q==} - engines: {node: '>=8.6'} - - mime-db@1.52.0: - resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} - engines: {node: '>= 0.6'} - - mime-types@2.1.35: - resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} - engines: {node: '>= 0.6'} - - mimic-function@5.0.1: - resolution: {integrity: sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==} - engines: {node: '>=18'} - - minimatch@3.1.2: - resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} - - minipass@3.3.6: - resolution: {integrity: sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==} - engines: {node: '>=8'} - - minipass@5.0.0: - resolution: {integrity: sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==} - engines: {node: '>=8'} - - minizlib@2.1.2: - resolution: {integrity: sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==} - engines: {node: '>= 8'} - - mkdirp@1.0.4: - resolution: {integrity: sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==} - engines: {node: '>=10'} - hasBin: true - - ms@2.1.2: - resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} - - ms@2.1.3: - resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} - - mute-stream@1.0.0: - resolution: {integrity: sha512-avsJQhyd+680gKXyG/sQc0nXaC6rBkPOfyHYcFb9+hdkqQkR9bdnkJ0AMZhke0oesPqIO+mFFJ+IdBc7mst4IA==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - - nanoid@3.3.7: - resolution: {integrity: sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==} - engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} - hasBin: true - - node-fetch@2.7.0: - resolution: {integrity: sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==} - engines: {node: 4.x || >=6.0.0} - peerDependencies: - encoding: ^0.1.0 - peerDependenciesMeta: - encoding: - optional: true - - node-gyp-build@4.8.1: - resolution: {integrity: sha512-OSs33Z9yWr148JZcbZd5WiAXhh/n9z8TxQcdMhIOlpN9AhWpLfvVFO73+m77bBABQMaY9XSvIa+qk0jlI7Gcaw==} - hasBin: true - - nofilter@3.1.0: - resolution: {integrity: sha512-l2NNj07e9afPnhAhvgVrCD/oy2Ai1yfLpuo3EpiO1jFTsB4sFz6oIfAfSZyQzVpkZQ9xS8ZS5g1jCBgq4Hwo0g==} - engines: {node: '>=12.19'} - - nopt@5.0.0: - resolution: {integrity: sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==} - engines: {node: '>=6'} - hasBin: true - - npmlog@5.0.1: - resolution: {integrity: sha512-AqZtDUWOMKs1G/8lwylVjrdYgqA4d9nu8hc+0gzRxlDb1I10+FHBGMXs6aiQHFdCUUlqH99MUMuLfzWDNDtfxw==} - deprecated: This package is no longer supported. - - object-assign@4.1.1: - resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} - engines: {node: '>=0.10.0'} - - once@1.4.0: - resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} - - os-tmpdir@1.0.2: - resolution: {integrity: sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==} - engines: {node: '>=0.10.0'} - - p-map@7.0.2: - resolution: {integrity: sha512-z4cYYMMdKHzw4O5UkWJImbZynVIo0lSGTXc7bzB1e/rrDqkgGUNysK/o4bTr+0+xKvvLoTyGqYC4Fgljy9qe1Q==} - engines: {node: '>=18'} - - package-config@5.0.0: - resolution: {integrity: sha512-GYTTew2slBcYdvRHqjhwaaydVMvn/qrGC323+nKclYioNSLTDUM/lGgtGTgyHVtYcozb+XkE8CNhwcraOmZ9Mg==} - engines: {node: '>=18'} - - parse-ms@4.0.0: - resolution: {integrity: sha512-TXfryirbmq34y8QBwgqCVLi+8oA3oWx2eAnSn62ITyEhEYaWRlVZ2DvMM9eZbMs/RfxPu/PK/aBLyGj4IrqMHw==} - engines: {node: '>=18'} - - path-is-absolute@1.0.1: - resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==} - engines: {node: '>=0.10.0'} - - path-type@5.0.0: - resolution: {integrity: sha512-5HviZNaZcfqP95rwpv+1HDgUamezbqdSYTyzjTvwtJSnIH+3vnbmWsItli8OFEndS984VT55M3jduxZbX351gg==} - engines: {node: '>=12'} - - picocolors@1.0.1: - resolution: {integrity: sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==} - - picomatch@2.3.1: - resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} - engines: {node: '>=8.6'} - - picomatch@3.0.1: - resolution: {integrity: sha512-I3EurrIQMlRc9IaAZnqRR044Phh2DXY+55o7uJ0V+hYZAcQYSuFWsc9q5PvyDHUSCe1Qxn/iBz+78s86zWnGag==} - engines: {node: '>=10'} - - plur@5.1.0: - resolution: {integrity: sha512-VP/72JeXqak2KiOzjgKtQen5y3IZHn+9GOuLDafPv0eXa47xq0At93XahYBs26MsifCQ4enGKwbjBTKgb9QJXg==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - postcss-value-parser@4.2.0: - resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==} - - postcss@8.4.33: - resolution: {integrity: sha512-Kkpbhhdjw2qQs2O2DGX+8m5OVqEcbB9HRBvuYM9pgrjEFUg30A9LmXNlTAUj4S9kgtGyrMbTzVjH7E+s5Re2yg==} - engines: {node: ^10 || ^12 || >=14} - - pretty-ms@9.0.0: - resolution: {integrity: sha512-E9e9HJ9R9NasGOgPaPE8VMeiPKAyWR5jcFpNnwIejslIhWqdqOrb2wShBsncMPUb+BcCd2OPYfh7p2W6oemTng==} - engines: {node: '>=18'} - - proxy-from-env@1.1.0: - resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==} - - queue-microtask@1.2.3: - resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} - - react-dom@18.3.1: - resolution: {integrity: sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==} - peerDependencies: - react: ^18.3.1 - - react@18.3.1: - resolution: {integrity: sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==} - engines: {node: '>=0.10.0'} - - readable-stream@3.6.2: - resolution: {integrity: sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==} - engines: {node: '>= 6'} - - require-directory@2.1.1: - resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} - engines: {node: '>=0.10.0'} - - resolve-cwd@3.0.0: - resolution: {integrity: sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==} - engines: {node: '>=8'} - - resolve-from@5.0.0: - resolution: {integrity: sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==} - engines: {node: '>=8'} - - reusify@1.0.4: - resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==} - engines: {iojs: '>=1.0.0', node: '>=0.10.0'} - - rimraf@3.0.2: - resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==} - deprecated: Rimraf versions prior to v4 are no longer supported - hasBin: true - - run-async@3.0.0: - resolution: {integrity: sha512-540WwVDOMxA6dN6We19EcT9sc3hkXPw5mzRNGM3FkdN/vtE9NFvj5lFAPNwUDmJjXidm3v7TC1cTE7t17Ulm1Q==} - engines: {node: '>=0.12.0'} - - run-parallel@1.2.0: - resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} - - rxjs@7.8.1: - resolution: {integrity: sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==} - - safe-buffer@5.2.1: - resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} - - safer-buffer@2.1.2: - resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} - - scheduler@0.23.2: - resolution: {integrity: sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ==} - - semver@6.3.1: - resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} - hasBin: true - - semver@7.6.2: - resolution: {integrity: sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==} - engines: {node: '>=10'} - hasBin: true - - serialize-error@7.0.1: - resolution: {integrity: sha512-8I8TjW5KMOKsZQTvoxjuSIa7foAwPWGOts+6o7sgjz41/qMD9VQHEDxi6PBvK2l0MXUmqZyNpUK+T2tQaaElvw==} - engines: {node: '>=10'} - - set-blocking@2.0.0: - resolution: {integrity: sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==} - - shallowequal@1.1.0: - resolution: {integrity: sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ==} - - signal-exit@3.0.7: - resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} - - signal-exit@4.1.0: - resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} - engines: {node: '>=14'} - - slash@5.1.0: - resolution: {integrity: sha512-ZA6oR3T/pEyuqwMgAKT0/hAv8oAXckzbkmR0UkUosQ+Mc4RxGoJkRmwHgHufaenlyAgE1Mxgpdcrf75y6XcnDg==} - engines: {node: '>=14.16'} - - slice-ansi@5.0.0: - resolution: {integrity: sha512-FC+lgizVPfie0kkhqUScwRu1O/lF6NOgJmlCgK+/LYxDCTk8sGelYaHDhFcDN+Sn3Cv+3VSa4Byeo+IMCzpMgQ==} - engines: {node: '>=12'} - - source-map-js@1.2.0: - resolution: {integrity: sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==} - engines: {node: '>=0.10.0'} - - sprintf-js@1.0.3: - resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==} - - stack-utils@2.0.6: - resolution: {integrity: sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==} - engines: {node: '>=10'} - - string-width@4.2.3: - resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} - engines: {node: '>=8'} - - string-width@7.2.0: - resolution: {integrity: sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==} - engines: {node: '>=18'} - - string_decoder@1.3.0: - resolution: {integrity: sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==} - - strip-ansi@6.0.1: - resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} - engines: {node: '>=8'} - - strip-ansi@7.1.0: - resolution: {integrity: sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==} - engines: {node: '>=12'} - - styled-components@6.1.1: - resolution: {integrity: sha512-cpZZP5RrKRIClBW5Eby4JM1wElLVP4NQrJbJ0h10TidTyJf4SIIwa3zLXOoPb4gJi8MsJ8mjq5mu2IrEhZIAcQ==} - engines: {node: '>= 16'} - peerDependencies: - react: '>= 16.8.0' - react-dom: '>= 16.8.0' - - stylis@4.3.2: - resolution: {integrity: sha512-bhtUjWd/z6ltJiQwg0dUfxEJ+W+jdqQd8TbWLWyeIJHlnsqmGLRFFd8e5mA0AZi/zx90smXRlN66YMTcaSFifg==} - - supertap@3.0.1: - resolution: {integrity: sha512-u1ZpIBCawJnO+0QePsEiOknOfCRq0yERxiAchT0i4li0WHNUJbf0evXXSXOcCAR4M8iMDoajXYmstm/qO81Isw==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - tar@6.2.1: - resolution: {integrity: sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==} - engines: {node: '>=10'} - - temp-dir@3.0.0: - resolution: {integrity: sha512-nHc6S/bwIilKHNRgK/3jlhDoIHcp45YgyiwcAk46Tr0LfEqGBVpmiAyuiuxeVE44m3mXnEeVhaipLOEWmH+Njw==} - engines: {node: '>=14.16'} - - time-zone@1.0.0: - resolution: {integrity: sha512-TIsDdtKo6+XrPtiTm1ssmMngN1sAhyKnTO2kunQWqNPWIVvCm15Wmw4SWInwTVgJ5u/Tr04+8Ei9TNcw4x4ONA==} - engines: {node: '>=4'} - - tmp@0.0.33: - resolution: {integrity: sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==} - engines: {node: '>=0.6.0'} - - to-regex-range@5.0.1: - resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} - engines: {node: '>=8.0'} - - toml@3.0.0: - resolution: {integrity: sha512-y/mWCZinnvxjTKYhJ+pYxwD0mRLVvOtdS2Awbgxln6iEnt4rk0yBxeSBHkGJcPucRiG0e55mwWp+g/05rsrd6w==} - - tr46@0.0.3: - resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==} - - tslib@2.6.3: - resolution: {integrity: sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ==} - - typanion@3.14.0: - resolution: {integrity: sha512-ZW/lVMRabETuYCd9O9ZvMhAh8GslSqaUjxmK/JLPCh6l73CvLBiuXswj/+7LdnWOgYsQ130FqLzFz5aGT4I3Ug==} - - type-fest@0.13.1: - resolution: {integrity: sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==} - engines: {node: '>=10'} - - type-fest@0.21.3: - resolution: {integrity: sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==} - engines: {node: '>=10'} - - typescript@5.5.4: - resolution: {integrity: sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q==} - engines: {node: '>=14.17'} - hasBin: true - - undici-types@6.19.8: - resolution: {integrity: sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==} - - unicorn-magic@0.1.0: - resolution: {integrity: sha512-lRfVq8fE8gz6QMBuDM6a+LO3IAzTi05H6gCVaUpir2E1Rwpo4ZUog45KpNXKC/Mn3Yb9UDuHumeFTo9iV/D9FQ==} - engines: {node: '>=18'} - - universal-user-agent@7.0.2: - resolution: {integrity: sha512-0JCqzSKnStlRRQfCdowvqy3cy0Dvtlb8xecj/H8JFZuCze4rwjPZQOgvFvn0Ws/usCHQFGpyr+pB9adaGwXn4Q==} - - util-deprecate@1.0.2: - resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} - - wasm-sjlj@1.0.5: - resolution: {integrity: sha512-Z/MHJeOkAvJJVWnGX3/YZGYldGaawZbYHX4ldYG9kLhcdB8H31F5x66M7Zc4BP/7pg0aLsusQj1629m2B3Rilg==} - - webidl-conversions@3.0.1: - resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==} - - well-known-symbols@2.0.0: - resolution: {integrity: sha512-ZMjC3ho+KXo0BfJb7JgtQ5IBuvnShdlACNkKkdsqBmYw3bPAaJfPeYUo6tLUaT5tG/Gkh7xkpBhKRQ9e7pyg9Q==} - engines: {node: '>=6'} - - whatwg-url@5.0.0: - resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==} - - wide-align@1.1.5: - resolution: {integrity: sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==} - - wrap-ansi@6.2.0: - resolution: {integrity: sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==} - engines: {node: '>=8'} - - wrap-ansi@7.0.0: - resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==} - engines: {node: '>=10'} - - wrappy@1.0.2: - resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} - - write-file-atomic@5.0.1: - resolution: {integrity: sha512-+QU2zd6OTD8XWIJCbffaiQeH9U73qIqafo1x6V1snCWYGJf6cVE0cDR4D8xRzcEnfI21IFrUPzPGtcPf8AC+Rw==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - - y18n@5.0.8: - resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==} - engines: {node: '>=10'} - - yallist@4.0.0: - resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==} - - yargs-parser@21.1.1: - resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} - engines: {node: '>=12'} - - yargs@17.7.2: - resolution: {integrity: sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==} - engines: {node: '>=12'} - - yoctocolors-cjs@2.1.2: - resolution: {integrity: sha512-cYVsTjKl8b+FrnidjibDWskAv7UKOfcwaVZdp/it9n1s9fU3IkgDbhdIRKCW4JDsAlECJY0ytoVPT3sK6kideA==} - engines: {node: '>=18'} - -snapshots: - - '@emnapi/core@1.2.0': - dependencies: - '@emnapi/wasi-threads': 1.0.1 - tslib: 2.6.3 - - '@emnapi/runtime@1.2.0': - dependencies: - tslib: 2.6.3 - - '@emnapi/wasi-threads@1.0.1': - dependencies: - tslib: 2.6.3 - - '@emotion/is-prop-valid@1.2.2': - dependencies: - '@emotion/memoize': 0.8.1 - - '@emotion/memoize@0.8.1': {} - - '@emotion/unitless@0.8.1': {} - - '@inquirer/checkbox@2.3.10': - dependencies: - '@inquirer/core': 9.0.2 - '@inquirer/figures': 1.0.3 - '@inquirer/type': 1.4.0 - ansi-escapes: 4.3.2 - yoctocolors-cjs: 2.1.2 - - '@inquirer/confirm@3.1.14': - dependencies: - '@inquirer/core': 9.0.2 - '@inquirer/type': 1.4.0 - - '@inquirer/core@9.0.2': - dependencies: - '@inquirer/figures': 1.0.3 - '@inquirer/type': 1.4.0 - '@types/mute-stream': 0.0.4 - '@types/node': 20.16.5 - '@types/wrap-ansi': 3.0.0 - ansi-escapes: 4.3.2 - cli-spinners: 2.9.2 - cli-width: 4.1.0 - mute-stream: 1.0.0 - signal-exit: 4.1.0 - strip-ansi: 6.0.1 - wrap-ansi: 6.2.0 - yoctocolors-cjs: 2.1.2 - - '@inquirer/editor@2.1.14': - dependencies: - '@inquirer/core': 9.0.2 - '@inquirer/type': 1.4.0 - external-editor: 3.1.0 - - '@inquirer/expand@2.1.14': - dependencies: - '@inquirer/core': 9.0.2 - '@inquirer/type': 1.4.0 - yoctocolors-cjs: 2.1.2 - - '@inquirer/figures@1.0.3': {} - - '@inquirer/input@2.2.1': - dependencies: - '@inquirer/core': 9.0.2 - '@inquirer/type': 1.4.0 - - '@inquirer/number@1.0.2': - dependencies: - '@inquirer/core': 9.0.2 - '@inquirer/type': 1.4.0 - - '@inquirer/password@2.1.14': - dependencies: - '@inquirer/core': 9.0.2 - '@inquirer/type': 1.4.0 - ansi-escapes: 4.3.2 - - '@inquirer/prompts@5.1.2': - dependencies: - '@inquirer/checkbox': 2.3.10 - '@inquirer/confirm': 3.1.14 - '@inquirer/editor': 2.1.14 - '@inquirer/expand': 2.1.14 - '@inquirer/input': 2.2.1 - '@inquirer/number': 1.0.2 - '@inquirer/password': 2.1.14 - '@inquirer/rawlist': 2.1.14 - '@inquirer/select': 2.3.10 - - '@inquirer/rawlist@2.1.14': - dependencies: - '@inquirer/core': 9.0.2 - '@inquirer/type': 1.4.0 - yoctocolors-cjs: 2.1.2 - - '@inquirer/select@2.3.10': - dependencies: - '@inquirer/core': 9.0.2 - '@inquirer/figures': 1.0.3 - '@inquirer/type': 1.4.0 - ansi-escapes: 4.3.2 - yoctocolors-cjs: 2.1.2 - - '@inquirer/type@1.4.0': - dependencies: - mute-stream: 1.0.0 - - '@mapbox/node-pre-gyp@1.0.11': - dependencies: - detect-libc: 2.0.3 - https-proxy-agent: 5.0.1 - make-dir: 3.1.0 - node-fetch: 2.7.0 - nopt: 5.0.0 - npmlog: 5.0.1 - rimraf: 3.0.2 - semver: 7.6.2 - tar: 6.2.1 - transitivePeerDependencies: - - encoding - - supports-color - - '@napi-rs/cli@3.0.0-alpha.62(@emnapi/runtime@1.2.0)(emnapi@1.2.0)': - dependencies: - '@napi-rs/cross-toolchain': 0.0.16 - '@napi-rs/wasm-tools': 0.0.2 - '@octokit/rest': 21.0.0 - clipanion: 3.2.1(typanion@3.14.0) - colorette: 2.0.20 - debug: 4.3.5 - inquirer: 10.0.1 - js-yaml: 4.1.0 - lodash-es: 4.17.21 - semver: 7.6.2 - toml: 3.0.0 - typanion: 3.14.0 - wasm-sjlj: 1.0.5 - optionalDependencies: - '@emnapi/runtime': 1.2.0 - emnapi: 1.2.0 - transitivePeerDependencies: - - '@napi-rs/cross-toolchain-arm64-target-aarch64' - - '@napi-rs/cross-toolchain-arm64-target-armv7' - - '@napi-rs/cross-toolchain-arm64-target-x86_64' - - '@napi-rs/cross-toolchain-x64-target-aarch64' - - '@napi-rs/cross-toolchain-x64-target-armv7' - - '@napi-rs/cross-toolchain-x64-target-x86_64' - - supports-color - - '@napi-rs/cross-toolchain@0.0.16': - dependencies: - '@napi-rs/lzma': 1.3.1 - '@napi-rs/tar': 0.1.1 - debug: 4.3.5 - transitivePeerDependencies: - - supports-color - - '@napi-rs/lzma-android-arm-eabi@1.3.1': - optional: true - - '@napi-rs/lzma-android-arm64@1.3.1': - optional: true - - '@napi-rs/lzma-darwin-arm64@1.3.1': - optional: true - - '@napi-rs/lzma-darwin-x64@1.3.1': - optional: true - - '@napi-rs/lzma-freebsd-x64@1.3.1': - optional: true - - '@napi-rs/lzma-linux-arm-gnueabihf@1.3.1': - optional: true - - '@napi-rs/lzma-linux-arm64-gnu@1.3.1': - optional: true - - '@napi-rs/lzma-linux-arm64-musl@1.3.1': - optional: true - - '@napi-rs/lzma-linux-x64-gnu@1.3.1': - optional: true - - '@napi-rs/lzma-linux-x64-musl@1.3.1': - optional: true - - '@napi-rs/lzma-wasm32-wasi@1.3.1': - dependencies: - '@napi-rs/wasm-runtime': 0.2.4 - optional: true - - '@napi-rs/lzma-win32-arm64-msvc@1.3.1': - optional: true - - '@napi-rs/lzma-win32-ia32-msvc@1.3.1': - optional: true - - '@napi-rs/lzma-win32-x64-msvc@1.3.1': - optional: true - - '@napi-rs/lzma@1.3.1': - optionalDependencies: - '@napi-rs/lzma-android-arm-eabi': 1.3.1 - '@napi-rs/lzma-android-arm64': 1.3.1 - '@napi-rs/lzma-darwin-arm64': 1.3.1 - '@napi-rs/lzma-darwin-x64': 1.3.1 - '@napi-rs/lzma-freebsd-x64': 1.3.1 - '@napi-rs/lzma-linux-arm-gnueabihf': 1.3.1 - '@napi-rs/lzma-linux-arm64-gnu': 1.3.1 - '@napi-rs/lzma-linux-arm64-musl': 1.3.1 - '@napi-rs/lzma-linux-x64-gnu': 1.3.1 - '@napi-rs/lzma-linux-x64-musl': 1.3.1 - '@napi-rs/lzma-wasm32-wasi': 1.3.1 - '@napi-rs/lzma-win32-arm64-msvc': 1.3.1 - '@napi-rs/lzma-win32-ia32-msvc': 1.3.1 - '@napi-rs/lzma-win32-x64-msvc': 1.3.1 - - '@napi-rs/tar-android-arm-eabi@0.1.1': - optional: true - - '@napi-rs/tar-android-arm64@0.1.1': - optional: true - - '@napi-rs/tar-darwin-arm64@0.1.1': - optional: true - - '@napi-rs/tar-darwin-x64@0.1.1': - optional: true - - '@napi-rs/tar-freebsd-x64@0.1.1': - optional: true - - '@napi-rs/tar-linux-arm-gnueabihf@0.1.1': - optional: true - - '@napi-rs/tar-linux-arm64-gnu@0.1.1': - optional: true - - '@napi-rs/tar-linux-arm64-musl@0.1.1': - optional: true - - '@napi-rs/tar-linux-x64-gnu@0.1.1': - optional: true - - '@napi-rs/tar-linux-x64-musl@0.1.1': - optional: true - - '@napi-rs/tar-wasm32-wasi@0.1.1': - dependencies: - '@napi-rs/wasm-runtime': 0.2.4 - optional: true - - '@napi-rs/tar-win32-arm64-msvc@0.1.1': - optional: true - - '@napi-rs/tar-win32-ia32-msvc@0.1.1': - optional: true - - '@napi-rs/tar-win32-x64-msvc@0.1.1': - optional: true - - '@napi-rs/tar@0.1.1': - optionalDependencies: - '@napi-rs/tar-android-arm-eabi': 0.1.1 - '@napi-rs/tar-android-arm64': 0.1.1 - '@napi-rs/tar-darwin-arm64': 0.1.1 - '@napi-rs/tar-darwin-x64': 0.1.1 - '@napi-rs/tar-freebsd-x64': 0.1.1 - '@napi-rs/tar-linux-arm-gnueabihf': 0.1.1 - '@napi-rs/tar-linux-arm64-gnu': 0.1.1 - '@napi-rs/tar-linux-arm64-musl': 0.1.1 - '@napi-rs/tar-linux-x64-gnu': 0.1.1 - '@napi-rs/tar-linux-x64-musl': 0.1.1 - '@napi-rs/tar-wasm32-wasi': 0.1.1 - '@napi-rs/tar-win32-arm64-msvc': 0.1.1 - '@napi-rs/tar-win32-ia32-msvc': 0.1.1 - '@napi-rs/tar-win32-x64-msvc': 0.1.1 - - '@napi-rs/wasm-runtime@0.2.4': - dependencies: - '@emnapi/core': 1.2.0 - '@emnapi/runtime': 1.2.0 - '@tybys/wasm-util': 0.9.0 - - '@napi-rs/wasm-tools-android-arm-eabi@0.0.2': - optional: true - - '@napi-rs/wasm-tools-android-arm64@0.0.2': - optional: true - - '@napi-rs/wasm-tools-darwin-arm64@0.0.2': - optional: true - - '@napi-rs/wasm-tools-darwin-x64@0.0.2': - optional: true - - '@napi-rs/wasm-tools-freebsd-x64@0.0.2': - optional: true - - '@napi-rs/wasm-tools-linux-arm64-gnu@0.0.2': - optional: true - - '@napi-rs/wasm-tools-linux-arm64-musl@0.0.2': - optional: true - - '@napi-rs/wasm-tools-linux-x64-gnu@0.0.2': - optional: true - - '@napi-rs/wasm-tools-linux-x64-musl@0.0.2': - optional: true - - '@napi-rs/wasm-tools-wasm32-wasi@0.0.2': - dependencies: - '@napi-rs/wasm-runtime': 0.2.4 - optional: true - - '@napi-rs/wasm-tools-win32-arm64-msvc@0.0.2': - optional: true - - '@napi-rs/wasm-tools-win32-ia32-msvc@0.0.2': - optional: true - - '@napi-rs/wasm-tools-win32-x64-msvc@0.0.2': - optional: true - - '@napi-rs/wasm-tools@0.0.2': - optionalDependencies: - '@napi-rs/wasm-tools-android-arm-eabi': 0.0.2 - '@napi-rs/wasm-tools-android-arm64': 0.0.2 - '@napi-rs/wasm-tools-darwin-arm64': 0.0.2 - '@napi-rs/wasm-tools-darwin-x64': 0.0.2 - '@napi-rs/wasm-tools-freebsd-x64': 0.0.2 - '@napi-rs/wasm-tools-linux-arm64-gnu': 0.0.2 - '@napi-rs/wasm-tools-linux-arm64-musl': 0.0.2 - '@napi-rs/wasm-tools-linux-x64-gnu': 0.0.2 - '@napi-rs/wasm-tools-linux-x64-musl': 0.0.2 - '@napi-rs/wasm-tools-wasm32-wasi': 0.0.2 - '@napi-rs/wasm-tools-win32-arm64-msvc': 0.0.2 - '@napi-rs/wasm-tools-win32-ia32-msvc': 0.0.2 - '@napi-rs/wasm-tools-win32-x64-msvc': 0.0.2 - - '@nodelib/fs.scandir@2.1.5': - dependencies: - '@nodelib/fs.stat': 2.0.5 - run-parallel: 1.2.0 - - '@nodelib/fs.stat@2.0.5': {} - - '@nodelib/fs.walk@1.2.8': - dependencies: - '@nodelib/fs.scandir': 2.1.5 - fastq: 1.17.1 - - '@octokit/auth-token@5.1.1': {} - - '@octokit/core@6.1.2': - dependencies: - '@octokit/auth-token': 5.1.1 - '@octokit/graphql': 8.1.1 - '@octokit/request': 9.1.1 - '@octokit/request-error': 6.1.2 - '@octokit/types': 13.5.0 - before-after-hook: 3.0.2 - universal-user-agent: 7.0.2 - - '@octokit/endpoint@10.1.1': - dependencies: - '@octokit/types': 13.5.0 - universal-user-agent: 7.0.2 - - '@octokit/graphql@8.1.1': - dependencies: - '@octokit/request': 9.1.1 - '@octokit/types': 13.5.0 - universal-user-agent: 7.0.2 - - '@octokit/openapi-types@22.2.0': {} - - '@octokit/plugin-paginate-rest@11.3.3(@octokit/core@6.1.2)': - dependencies: - '@octokit/core': 6.1.2 - '@octokit/types': 13.5.0 - - '@octokit/plugin-request-log@5.3.0(@octokit/core@6.1.2)': - dependencies: - '@octokit/core': 6.1.2 - - '@octokit/plugin-rest-endpoint-methods@13.2.4(@octokit/core@6.1.2)': - dependencies: - '@octokit/core': 6.1.2 - '@octokit/types': 13.5.0 - - '@octokit/request-error@6.1.2': - dependencies: - '@octokit/types': 13.5.0 - - '@octokit/request@9.1.1': - dependencies: - '@octokit/endpoint': 10.1.1 - '@octokit/request-error': 6.1.2 - '@octokit/types': 13.5.0 - universal-user-agent: 7.0.2 - - '@octokit/rest@21.0.0': - dependencies: - '@octokit/core': 6.1.2 - '@octokit/plugin-paginate-rest': 11.3.3(@octokit/core@6.1.2) - '@octokit/plugin-request-log': 5.3.0(@octokit/core@6.1.2) - '@octokit/plugin-rest-endpoint-methods': 13.2.4(@octokit/core@6.1.2) - - '@octokit/types@13.5.0': - dependencies: - '@octokit/openapi-types': 22.2.0 - - '@rollup/pluginutils@4.2.1': - dependencies: - estree-walker: 2.0.2 - picomatch: 2.3.1 - - '@sindresorhus/merge-streams@2.3.0': {} - - '@tybys/wasm-util@0.9.0': - dependencies: - tslib: 2.6.3 - - '@types/mute-stream@0.0.4': - dependencies: - '@types/node': 22.5.4 - - '@types/node@20.16.5': - dependencies: - undici-types: 6.19.8 - - '@types/node@22.5.4': - dependencies: - undici-types: 6.19.8 - - '@types/stylis@4.2.6': {} - - '@types/wrap-ansi@3.0.0': {} - - '@vercel/nft@0.26.5': - dependencies: - '@mapbox/node-pre-gyp': 1.0.11 - '@rollup/pluginutils': 4.2.1 - acorn: 8.12.1 - acorn-import-attributes: 1.9.5(acorn@8.12.1) - async-sema: 3.1.1 - bindings: 1.5.0 - estree-walker: 2.0.2 - glob: 7.2.3 - graceful-fs: 4.2.11 - micromatch: 4.0.7 - node-gyp-build: 4.8.1 - resolve-from: 5.0.0 - transitivePeerDependencies: - - encoding - - supports-color - - abbrev@1.1.1: {} - - acorn-import-attributes@1.9.5(acorn@8.12.1): - dependencies: - acorn: 8.12.1 - - acorn-walk@8.3.3: - dependencies: - acorn: 8.12.1 - - acorn@8.12.1: {} - - agent-base@6.0.2: - dependencies: - debug: 4.3.5 - transitivePeerDependencies: - - supports-color - - ansi-escapes@4.3.2: - dependencies: - type-fest: 0.21.3 - - ansi-regex@5.0.1: {} - - ansi-regex@6.0.1: {} - - ansi-styles@4.3.0: - dependencies: - color-convert: 2.0.1 - - ansi-styles@6.2.1: {} - - aproba@2.0.0: {} - - are-we-there-yet@2.0.0: - dependencies: - delegates: 1.0.0 - readable-stream: 3.6.2 - - argparse@1.0.10: - dependencies: - sprintf-js: 1.0.3 - - argparse@2.0.1: {} - - array-find-index@1.0.2: {} - - arrgv@1.0.2: {} - - arrify@3.0.0: {} - - async-sema@3.1.1: {} - - asynckit@0.4.0: {} - - ava@6.1.3: - dependencies: - '@vercel/nft': 0.26.5 - acorn: 8.12.1 - acorn-walk: 8.3.3 - ansi-styles: 6.2.1 - arrgv: 1.0.2 - arrify: 3.0.0 - callsites: 4.2.0 - cbor: 9.0.2 - chalk: 5.3.0 - chunkd: 2.0.1 - ci-info: 4.0.0 - ci-parallel-vars: 1.0.1 - cli-truncate: 4.0.0 - code-excerpt: 4.0.0 - common-path-prefix: 3.0.0 - concordance: 5.0.4 - currently-unhandled: 0.4.1 - debug: 4.3.5 - emittery: 1.0.3 - figures: 6.1.0 - globby: 14.0.2 - ignore-by-default: 2.1.0 - indent-string: 5.0.0 - is-plain-object: 5.0.0 - is-promise: 4.0.0 - matcher: 5.0.0 - memoize: 10.0.0 - ms: 2.1.3 - p-map: 7.0.2 - package-config: 5.0.0 - picomatch: 3.0.1 - plur: 5.1.0 - pretty-ms: 9.0.0 - resolve-cwd: 3.0.0 - stack-utils: 2.0.6 - strip-ansi: 7.1.0 - supertap: 3.0.1 - temp-dir: 3.0.0 - write-file-atomic: 5.0.1 - yargs: 17.7.2 - transitivePeerDependencies: - - encoding - - supports-color - - axios@1.6.2: - dependencies: - follow-redirects: 1.15.6 - form-data: 4.0.0 - proxy-from-env: 1.1.0 - transitivePeerDependencies: - - debug - - balanced-match@1.0.2: {} - - before-after-hook@3.0.2: {} - - bindings@1.5.0: - dependencies: - file-uri-to-path: 1.0.0 - - blueimp-md5@2.19.0: {} - - brace-expansion@1.1.11: - dependencies: - balanced-match: 1.0.2 - concat-map: 0.0.1 - - braces@3.0.3: - dependencies: - fill-range: 7.1.1 - - callsites@4.2.0: {} - - camelize@1.0.1: {} - - cbor@9.0.2: - dependencies: - nofilter: 3.1.0 - - chalk@5.3.0: {} - - chardet@0.7.0: {} - - chownr@2.0.0: {} - - chunkd@2.0.1: {} - - ci-info@4.0.0: {} - - ci-parallel-vars@1.0.1: {} - - cli-spinners@2.9.2: {} - - cli-truncate@4.0.0: - dependencies: - slice-ansi: 5.0.0 - string-width: 7.2.0 - - cli-width@4.1.0: {} - - clipanion@3.2.1(typanion@3.14.0): - dependencies: - typanion: 3.14.0 - - cliui@8.0.1: - dependencies: - string-width: 4.2.3 - strip-ansi: 6.0.1 - wrap-ansi: 7.0.0 - - code-excerpt@4.0.0: - dependencies: - convert-to-spaces: 2.0.1 - - color-convert@2.0.1: - dependencies: - color-name: 1.1.4 - - color-name@1.1.4: {} - - color-support@1.1.3: {} - - colorette@2.0.20: {} - - combined-stream@1.0.8: - dependencies: - delayed-stream: 1.0.0 - - common-path-prefix@3.0.0: {} - - concat-map@0.0.1: {} - - concordance@5.0.4: - dependencies: - date-time: 3.1.0 - esutils: 2.0.3 - fast-diff: 1.3.0 - js-string-escape: 1.0.1 - lodash: 4.17.21 - md5-hex: 3.0.1 - semver: 7.6.2 - well-known-symbols: 2.0.0 - - console-control-strings@1.1.0: {} - - convert-to-spaces@2.0.1: {} - - css-color-keywords@1.0.0: {} - - css-to-react-native@3.2.0: - dependencies: - camelize: 1.0.1 - css-color-keywords: 1.0.0 - postcss-value-parser: 4.2.0 - - csstype@3.1.3: {} - - currently-unhandled@0.4.1: - dependencies: - array-find-index: 1.0.2 - - date-time@3.1.0: - dependencies: - time-zone: 1.0.0 - - debug@4.3.5: - dependencies: - ms: 2.1.2 - - delayed-stream@1.0.0: {} - - delegates@1.0.0: {} - - detect-libc@2.0.3: {} - - emittery@1.0.3: {} - - emnapi@1.2.0: {} - - emoji-regex@10.3.0: {} - - emoji-regex@8.0.0: {} - - escalade@3.1.2: {} - - escape-string-regexp@2.0.0: {} - - escape-string-regexp@5.0.0: {} - - esprima@4.0.1: {} - - estree-walker@2.0.2: {} - - esutils@2.0.3: {} - - external-editor@3.1.0: - dependencies: - chardet: 0.7.0 - iconv-lite: 0.4.24 - tmp: 0.0.33 - - fast-diff@1.3.0: {} - - fast-glob@3.3.2: - dependencies: - '@nodelib/fs.stat': 2.0.5 - '@nodelib/fs.walk': 1.2.8 - glob-parent: 5.1.2 - merge2: 1.4.1 - micromatch: 4.0.7 - - fastq@1.17.1: - dependencies: - reusify: 1.0.4 - - figures@6.1.0: - dependencies: - is-unicode-supported: 2.0.0 - - file-uri-to-path@1.0.0: {} - - fill-range@7.1.1: - dependencies: - to-regex-range: 5.0.1 - - find-up-simple@1.0.0: {} - - follow-redirects@1.15.6: {} - - form-data@4.0.0: - dependencies: - asynckit: 0.4.0 - combined-stream: 1.0.8 - mime-types: 2.1.35 - - fs-minipass@2.1.0: - dependencies: - minipass: 3.3.6 - - fs.realpath@1.0.0: {} - - gauge@3.0.2: - dependencies: - aproba: 2.0.0 - color-support: 1.1.3 - console-control-strings: 1.1.0 - has-unicode: 2.0.1 - object-assign: 4.1.1 - signal-exit: 3.0.7 - string-width: 4.2.3 - strip-ansi: 6.0.1 - wide-align: 1.1.5 - - get-caller-file@2.0.5: {} - - get-east-asian-width@1.2.0: {} - - glob-parent@5.1.2: - dependencies: - is-glob: 4.0.3 - - glob@7.2.3: - dependencies: - fs.realpath: 1.0.0 - inflight: 1.0.6 - inherits: 2.0.4 - minimatch: 3.1.2 - once: 1.4.0 - path-is-absolute: 1.0.1 - - globby@14.0.2: - dependencies: - '@sindresorhus/merge-streams': 2.3.0 - fast-glob: 3.3.2 - ignore: 5.3.1 - path-type: 5.0.0 - slash: 5.1.0 - unicorn-magic: 0.1.0 - - graceful-fs@4.2.11: {} - - has-unicode@2.0.1: {} - - https-proxy-agent@5.0.1: - dependencies: - agent-base: 6.0.2 - debug: 4.3.5 - transitivePeerDependencies: - - supports-color - - iconv-lite@0.4.24: - dependencies: - safer-buffer: 2.1.2 - - ignore-by-default@2.1.0: {} - - ignore@5.3.1: {} - - imurmurhash@0.1.4: {} - - indent-string@5.0.0: {} - - inflight@1.0.6: - dependencies: - once: 1.4.0 - wrappy: 1.0.2 - - inherits@2.0.4: {} - - inquirer@10.0.1: - dependencies: - '@inquirer/prompts': 5.1.2 - '@inquirer/type': 1.4.0 - '@types/mute-stream': 0.0.4 - ansi-escapes: 4.3.2 - mute-stream: 1.0.0 - run-async: 3.0.0 - rxjs: 7.8.1 - - ipaddr.js@2.2.0: {} - - irregular-plurals@3.5.0: {} - - is-extglob@2.1.1: {} - - is-fullwidth-code-point@3.0.0: {} - - is-fullwidth-code-point@4.0.0: {} - - is-glob@4.0.3: - dependencies: - is-extglob: 2.1.1 - - is-number@7.0.0: {} - - is-plain-object@5.0.0: {} - - is-promise@4.0.0: {} - - is-unicode-supported@2.0.0: {} - - js-string-escape@1.0.1: {} - - js-tokens@4.0.0: {} - - js-yaml@3.14.1: - dependencies: - argparse: 1.0.10 - esprima: 4.0.1 - - js-yaml@4.1.0: - dependencies: - argparse: 2.0.1 - - load-json-file@7.0.1: {} - - lodash-es@4.17.21: {} - - lodash@4.17.21: {} - - loose-envify@1.4.0: - dependencies: - js-tokens: 4.0.0 - - make-dir@3.1.0: - dependencies: - semver: 6.3.1 - - matcher@5.0.0: - dependencies: - escape-string-regexp: 5.0.0 - - md5-hex@3.0.1: - dependencies: - blueimp-md5: 2.19.0 - - memoize@10.0.0: - dependencies: - mimic-function: 5.0.1 - - merge2@1.4.1: {} - - micromatch@4.0.7: - dependencies: - braces: 3.0.3 - picomatch: 2.3.1 - - mime-db@1.52.0: {} - - mime-types@2.1.35: - dependencies: - mime-db: 1.52.0 - - mimic-function@5.0.1: {} - - minimatch@3.1.2: - dependencies: - brace-expansion: 1.1.11 - - minipass@3.3.6: - dependencies: - yallist: 4.0.0 - - minipass@5.0.0: {} - - minizlib@2.1.2: - dependencies: - minipass: 3.3.6 - yallist: 4.0.0 - - mkdirp@1.0.4: {} - - ms@2.1.2: {} - - ms@2.1.3: {} - - mute-stream@1.0.0: {} - - nanoid@3.3.7: {} - - node-fetch@2.7.0: - dependencies: - whatwg-url: 5.0.0 - - node-gyp-build@4.8.1: {} - - nofilter@3.1.0: {} - - nopt@5.0.0: - dependencies: - abbrev: 1.1.1 - - npmlog@5.0.1: - dependencies: - are-we-there-yet: 2.0.0 - console-control-strings: 1.1.0 - gauge: 3.0.2 - set-blocking: 2.0.0 - - object-assign@4.1.1: {} - - once@1.4.0: - dependencies: - wrappy: 1.0.2 - - os-tmpdir@1.0.2: {} - - p-map@7.0.2: {} - - package-config@5.0.0: - dependencies: - find-up-simple: 1.0.0 - load-json-file: 7.0.1 - - parse-ms@4.0.0: {} - - path-is-absolute@1.0.1: {} - - path-type@5.0.0: {} - - picocolors@1.0.1: {} - - picomatch@2.3.1: {} - - picomatch@3.0.1: {} - - plur@5.1.0: - dependencies: - irregular-plurals: 3.5.0 - - postcss-value-parser@4.2.0: {} - - postcss@8.4.33: - dependencies: - nanoid: 3.3.7 - picocolors: 1.0.1 - source-map-js: 1.2.0 - - pretty-ms@9.0.0: - dependencies: - parse-ms: 4.0.0 - - proxy-from-env@1.1.0: {} - - queue-microtask@1.2.3: {} - - react-dom@18.3.1(react@18.3.1): - dependencies: - loose-envify: 1.4.0 - react: 18.3.1 - scheduler: 0.23.2 - - react@18.3.1: - dependencies: - loose-envify: 1.4.0 - - readable-stream@3.6.2: - dependencies: - inherits: 2.0.4 - string_decoder: 1.3.0 - util-deprecate: 1.0.2 - - require-directory@2.1.1: {} - - resolve-cwd@3.0.0: - dependencies: - resolve-from: 5.0.0 - - resolve-from@5.0.0: {} - - reusify@1.0.4: {} - - rimraf@3.0.2: - dependencies: - glob: 7.2.3 - - run-async@3.0.0: {} - - run-parallel@1.2.0: - dependencies: - queue-microtask: 1.2.3 - - rxjs@7.8.1: - dependencies: - tslib: 2.6.3 - - safe-buffer@5.2.1: {} - - safer-buffer@2.1.2: {} - - scheduler@0.23.2: - dependencies: - loose-envify: 1.4.0 - - semver@6.3.1: {} - - semver@7.6.2: {} - - serialize-error@7.0.1: - dependencies: - type-fest: 0.13.1 - - set-blocking@2.0.0: {} - - shallowequal@1.1.0: {} - - signal-exit@3.0.7: {} - - signal-exit@4.1.0: {} - - slash@5.1.0: {} - - slice-ansi@5.0.0: - dependencies: - ansi-styles: 6.2.1 - is-fullwidth-code-point: 4.0.0 - - source-map-js@1.2.0: {} - - sprintf-js@1.0.3: {} - - stack-utils@2.0.6: - dependencies: - escape-string-regexp: 2.0.0 - - string-width@4.2.3: - dependencies: - emoji-regex: 8.0.0 - is-fullwidth-code-point: 3.0.0 - strip-ansi: 6.0.1 - - string-width@7.2.0: - dependencies: - emoji-regex: 10.3.0 - get-east-asian-width: 1.2.0 - strip-ansi: 7.1.0 - - string_decoder@1.3.0: - dependencies: - safe-buffer: 5.2.1 - - strip-ansi@6.0.1: - dependencies: - ansi-regex: 5.0.1 - - strip-ansi@7.1.0: - dependencies: - ansi-regex: 6.0.1 - - styled-components@6.1.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1): - dependencies: - '@emotion/is-prop-valid': 1.2.2 - '@emotion/unitless': 0.8.1 - '@types/stylis': 4.2.6 - css-to-react-native: 3.2.0 - csstype: 3.1.3 - postcss: 8.4.33 - react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) - shallowequal: 1.1.0 - stylis: 4.3.2 - tslib: 2.6.3 - - stylis@4.3.2: {} - - supertap@3.0.1: - dependencies: - indent-string: 5.0.0 - js-yaml: 3.14.1 - serialize-error: 7.0.1 - strip-ansi: 7.1.0 - - tar@6.2.1: - dependencies: - chownr: 2.0.0 - fs-minipass: 2.1.0 - minipass: 5.0.0 - minizlib: 2.1.2 - mkdirp: 1.0.4 - yallist: 4.0.0 - - temp-dir@3.0.0: {} - - time-zone@1.0.0: {} - - tmp@0.0.33: - dependencies: - os-tmpdir: 1.0.2 - - to-regex-range@5.0.1: - dependencies: - is-number: 7.0.0 - - toml@3.0.0: {} - - tr46@0.0.3: {} - - tslib@2.6.3: {} - - typanion@3.14.0: {} - - type-fest@0.13.1: {} - - type-fest@0.21.3: {} - - typescript@5.5.4: {} - - undici-types@6.19.8: {} - - unicorn-magic@0.1.0: {} - - universal-user-agent@7.0.2: {} - - util-deprecate@1.0.2: {} - - wasm-sjlj@1.0.5: {} - - webidl-conversions@3.0.1: {} - - well-known-symbols@2.0.0: {} - - whatwg-url@5.0.0: - dependencies: - tr46: 0.0.3 - webidl-conversions: 3.0.1 - - wide-align@1.1.5: - dependencies: - string-width: 4.2.3 - - wrap-ansi@6.2.0: - dependencies: - ansi-styles: 4.3.0 - string-width: 4.2.3 - strip-ansi: 6.0.1 - - wrap-ansi@7.0.0: - dependencies: - ansi-styles: 4.3.0 - string-width: 4.2.3 - strip-ansi: 6.0.1 - - wrappy@1.0.2: {} - - write-file-atomic@5.0.1: - dependencies: - imurmurhash: 0.1.4 - signal-exit: 4.1.0 - - y18n@5.0.8: {} - - yallist@4.0.0: {} - - yargs-parser@21.1.1: {} - - yargs@17.7.2: - dependencies: - cliui: 8.0.1 - escalade: 3.1.2 - get-caller-file: 2.0.5 - require-directory: 2.1.1 - string-width: 4.2.3 - y18n: 5.0.8 - yargs-parser: 21.1.1 - - yoctocolors-cjs@2.1.2: {} diff --git a/src/builtins.rs b/src/builtins.rs deleted file mode 100644 index 45a25117..00000000 --- a/src/builtins.rs +++ /dev/null @@ -1,71 +0,0 @@ -/// Node.js built-in modules -/// -/// `node -p "[...require('module').builtinModules].map(b => JSON.stringify(b)).join(',\n')"` -/// -pub const NODEJS_BUILTINS: &[&str] = &[ - "_http_agent", - "_http_client", - "_http_common", - "_http_incoming", - "_http_outgoing", - "_http_server", - "_stream_duplex", - "_stream_passthrough", - "_stream_readable", - "_stream_transform", - "_stream_wrap", - "_stream_writable", - "_tls_common", - "_tls_wrap", - "assert", - "assert/strict", - "async_hooks", - "buffer", - "child_process", - "cluster", - "console", - "constants", - "crypto", - "dgram", - "diagnostics_channel", - "dns", - "dns/promises", - "domain", - "events", - "fs", - "fs/promises", - "http", - "http2", - "https", - "inspector", - "module", - "net", - "os", - "path", - "path/posix", - "path/win32", - "perf_hooks", - "process", - "punycode", - "querystring", - "readline", - "repl", - "stream", - "stream/consumers", - "stream/promises", - "stream/web", - "string_decoder", - "sys", - "timers", - "timers/promises", - "tls", - "trace_events", - "tty", - "url", - "util", - "util/types", - "v8", - "vm", - "worker_threads", - "zlib", -]; diff --git a/src/cache.rs b/src/cache.rs deleted file mode 100644 index 6e600664..00000000 --- a/src/cache.rs +++ /dev/null @@ -1,354 +0,0 @@ -use once_cell::sync::OnceCell as OnceLock; -use std::{ - borrow::{Borrow, Cow}, - convert::AsRef, - hash::{BuildHasherDefault, Hash, Hasher}, - io, - ops::Deref, - path::{Path, PathBuf}, - sync::Arc, -}; - -use dashmap::{DashMap, DashSet}; -use rustc_hash::FxHasher; - -use crate::{ - context::ResolveContext as Ctx, package_json::PackageJson, path::PathUtil, FileMetadata, - FileSystem, ResolveError, ResolveOptions, TsConfig, -}; - -#[derive(Default)] -pub struct Cache { - pub(crate) fs: Fs, - paths: DashSet>, - tsconfigs: DashMap, BuildHasherDefault>, -} - -impl Cache { - pub fn new(fs: Fs) -> Self { - Self { fs, paths: DashSet::default(), tsconfigs: DashMap::default() } - } - - pub fn clear(&self) { - self.paths.clear(); - self.tsconfigs.clear(); - } - - pub fn value(&self, path: &Path) -> CachedPath { - let hash = { - let mut hasher = FxHasher::default(); - path.hash(&mut hasher); - hasher.finish() - }; - if let Some(cache_entry) = self.paths.get((hash, path).borrow() as &dyn CacheKey) { - return cache_entry.clone(); - } - let parent = path.parent().map(|p| self.value(p)); - let data = CachedPath(Arc::new(CachedPathImpl::new( - hash, - path.to_path_buf().into_boxed_path(), - parent, - ))); - self.paths.insert(data.clone()); - data - } - - pub fn tsconfig Result<(), ResolveError>>( - &self, - root: bool, - path: &Path, - callback: F, // callback for modifying tsconfig with `extends` - ) -> Result, ResolveError> { - if let Some(tsconfig_ref) = self.tsconfigs.get(path) { - return Ok(Arc::clone(tsconfig_ref.value())); - } - let meta = self.fs.metadata(path).ok(); - let tsconfig_path = if meta.is_some_and(|m| m.is_file) { - Cow::Borrowed(path) - } else if meta.is_some_and(|m| m.is_dir) { - Cow::Owned(path.join("tsconfig.json")) - } else { - let mut os_string = path.to_path_buf().into_os_string(); - os_string.push(".json"); - Cow::Owned(PathBuf::from(os_string)) - }; - let mut tsconfig_string = self - .fs - .read_to_string(&tsconfig_path) - .map_err(|_| ResolveError::TsconfigNotFound(path.to_path_buf()))?; - let mut tsconfig = - TsConfig::parse(root, &tsconfig_path, &mut tsconfig_string).map_err(|error| { - ResolveError::from_serde_json_error(tsconfig_path.to_path_buf(), &error) - })?; - callback(&mut tsconfig)?; - let tsconfig = Arc::new(tsconfig.build()); - self.tsconfigs.insert(path.to_path_buf(), Arc::clone(&tsconfig)); - Ok(tsconfig) - } -} - -#[derive(Clone)] -pub struct CachedPath(Arc); - -impl Hash for CachedPath { - fn hash(&self, state: &mut H) { - self.0.hash.hash(state); - } -} - -impl PartialEq for CachedPath { - fn eq(&self, other: &Self) -> bool { - self.0.path == other.0.path - } -} -impl Eq for CachedPath {} - -impl Deref for CachedPath { - type Target = CachedPathImpl; - - fn deref(&self) -> &Self::Target { - self.0.as_ref() - } -} - -impl<'a> Borrow for CachedPath { - fn borrow(&self) -> &(dyn CacheKey + 'a) { - self - } -} - -impl AsRef for CachedPath { - fn as_ref(&self) -> &CachedPathImpl { - self.0.as_ref() - } -} - -impl CacheKey for CachedPath { - fn tuple(&self) -> (u64, &Path) { - (self.hash, &self.path) - } -} - -pub struct CachedPathImpl { - hash: u64, - path: Box, - parent: Option, - meta: OnceLock>, - canonicalized: OnceLock>, - node_modules: OnceLock>, - package_json: OnceLock>>, -} - -impl CachedPathImpl { - fn new(hash: u64, path: Box, parent: Option) -> Self { - Self { - hash, - path, - parent, - meta: OnceLock::new(), - canonicalized: OnceLock::new(), - node_modules: OnceLock::new(), - package_json: OnceLock::new(), - } - } - - pub fn path(&self) -> &Path { - &self.path - } - - pub fn to_path_buf(&self) -> PathBuf { - self.path.to_path_buf() - } - - pub fn parent(&self) -> Option<&CachedPath> { - self.parent.as_ref() - } - - fn meta(&self, fs: &Fs) -> Option { - *self.meta.get_or_init(|| fs.metadata(&self.path).ok()) - } - - pub fn is_file(&self, fs: &Fs, ctx: &mut Ctx) -> bool { - if let Some(meta) = self.meta(fs) { - ctx.add_file_dependency(self.path()); - meta.is_file - } else { - ctx.add_missing_dependency(self.path()); - false - } - } - - pub fn is_dir(&self, fs: &Fs, ctx: &mut Ctx) -> bool { - self.meta(fs).map_or_else( - || { - ctx.add_missing_dependency(self.path()); - false - }, - |meta| meta.is_dir, - ) - } - - pub fn realpath(&self, fs: &Fs) -> io::Result { - self.canonicalized - .get_or_try_init(|| { - if fs.symlink_metadata(&self.path).is_ok_and(|m| m.is_symlink) { - return fs.canonicalize(&self.path).map(Some); - } - if let Some(parent) = self.parent() { - let parent_path = parent.realpath(fs)?; - return Ok(Some( - parent_path.normalize_with(self.path.strip_prefix(&parent.path).unwrap()), - )); - }; - Ok(None) - }) - .cloned() - .map(|r| r.unwrap_or_else(|| self.path.clone().to_path_buf())) - } - - pub fn module_directory( - &self, - module_name: &str, - cache: &Cache, - ctx: &mut Ctx, - ) -> Option { - let cached_path = cache.value(&self.path.join(module_name)); - cached_path.is_dir(&cache.fs, ctx).then_some(cached_path) - } - - pub fn cached_node_modules( - &self, - cache: &Cache, - ctx: &mut Ctx, - ) -> Option { - self.node_modules.get_or_init(|| self.module_directory("node_modules", cache, ctx)).clone() - } - - /// Find package.json of a path by traversing parent directories. - /// - /// # Errors - /// - /// * [ResolveError::JSON] - pub fn find_package_json( - &self, - fs: &Fs, - options: &ResolveOptions, - ctx: &mut Ctx, - ) -> Result>, ResolveError> { - let mut cache_value = self; - // Go up directories when the querying path is not a directory - while !cache_value.is_dir(fs, ctx) { - if let Some(cv) = &cache_value.parent { - cache_value = cv.as_ref(); - } else { - break; - } - } - let mut cache_value = Some(cache_value); - while let Some(cv) = cache_value { - if let Some(package_json) = cv.package_json(fs, options, ctx)? { - return Ok(Some(Arc::clone(&package_json))); - } - cache_value = cv.parent.as_deref(); - } - Ok(None) - } - - /// Get package.json of the given path. - /// - /// # Errors - /// - /// * [ResolveError::JSON] - pub fn package_json( - &self, - fs: &Fs, - options: &ResolveOptions, - ctx: &mut Ctx, - ) -> Result>, ResolveError> { - // Change to `std::sync::OnceLock::get_or_try_init` when it is stable. - let result = self - .package_json - .get_or_try_init(|| { - let package_json_path = self.path.join("package.json"); - let Ok(package_json_string) = fs.read_to_string(&package_json_path) else { - return Ok(None); - }; - let real_path = if options.symlinks { - self.realpath(fs)?.join("package.json") - } else { - package_json_path.clone() - }; - PackageJson::parse(package_json_path.clone(), real_path, &package_json_string) - .map(Arc::new) - .map(Some) - .map_err(|error| ResolveError::from_serde_json_error(package_json_path, &error)) - }) - .cloned(); - // https://github.com/webpack/enhanced-resolve/blob/58464fc7cb56673c9aa849e68e6300239601e615/lib/DescriptionFileUtils.js#L68-L82 - match &result { - Ok(Some(package_json)) => { - ctx.add_file_dependency(&package_json.path); - } - Ok(None) => { - // Avoid an allocation by making this lazy - if let Some(deps) = &mut ctx.missing_dependencies { - deps.push(self.path.join("package.json")); - } - } - Err(_) => { - if let Some(deps) = &mut ctx.file_dependencies { - deps.push(self.path.join("package.json")); - } - } - } - result - } -} - -/// Memoized cache key, code adapted from . -trait CacheKey { - fn tuple(&self) -> (u64, &Path); -} - -impl Hash for dyn CacheKey + '_ { - fn hash(&self, state: &mut H) { - self.tuple().0.hash(state); - } -} - -impl PartialEq for dyn CacheKey + '_ { - fn eq(&self, other: &Self) -> bool { - self.tuple().1 == other.tuple().1 - } -} - -impl Eq for dyn CacheKey + '_ {} - -impl<'a> CacheKey for (u64, &'a Path) { - fn tuple(&self) -> (u64, &Path) { - (self.0, self.1) - } -} - -impl<'a> Borrow for (u64, &'a Path) { - fn borrow(&self) -> &(dyn CacheKey + 'a) { - self - } -} - -/// Since the cache key is memoized, use an identity hasher -/// to avoid double cache. -#[derive(Default)] -struct IdentityHasher(u64); - -impl Hasher for IdentityHasher { - fn write(&mut self, _: &[u8]) { - unreachable!("Invalid use of IdentityHasher") - } - fn write_u64(&mut self, n: u64) { - self.0 = n; - } - fn finish(&self) -> u64 { - self.0 - } -} diff --git a/src/context.rs b/src/context.rs deleted file mode 100644 index 9349de30..00000000 --- a/src/context.rs +++ /dev/null @@ -1,89 +0,0 @@ -use std::{ - ops::{Deref, DerefMut}, - path::{Path, PathBuf}, -}; - -use crate::error::ResolveError; - -#[derive(Debug, Default, Clone)] -pub struct ResolveContext(ResolveContextImpl); - -#[derive(Debug, Default, Clone)] -pub struct ResolveContextImpl { - pub fully_specified: bool, - - pub query: Option, - - pub fragment: Option, - - /// Files that was found on file system - pub file_dependencies: Option>, - - /// Files that was found on file system - pub missing_dependencies: Option>, - - /// The current resolving alias for bailing recursion alias. - pub resolving_alias: Option, - - /// For avoiding infinite recursion, which will cause stack overflow. - depth: u8, -} - -impl Deref for ResolveContext { - type Target = ResolveContextImpl; - - fn deref(&self) -> &Self::Target { - &self.0 - } -} - -impl DerefMut for ResolveContext { - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} - -impl ResolveContext { - pub fn with_fully_specified(&mut self, yes: bool) { - self.fully_specified = yes; - } - - pub fn with_query_fragment(&mut self, query: Option<&str>, fragment: Option<&str>) { - if let Some(query) = query { - self.query.replace(query.to_string()); - } - if let Some(fragment) = fragment { - self.fragment.replace(fragment.to_string()); - } - } - - pub fn init_file_dependencies(&mut self) { - self.file_dependencies.replace(vec![]); - self.missing_dependencies.replace(vec![]); - } - - pub fn add_file_dependency(&mut self, dep: &Path) { - if let Some(deps) = &mut self.file_dependencies { - deps.push(dep.to_path_buf()); - } - } - - pub fn add_missing_dependency(&mut self, dep: &Path) { - if let Some(deps) = &mut self.missing_dependencies { - deps.push(dep.to_path_buf()); - } - } - - pub fn with_resolving_alias(&mut self, alias: String) { - self.resolving_alias = Some(alias); - } - - pub fn test_for_infinite_recursion(&mut self) -> Result<(), ResolveError> { - self.depth += 1; - // 64 should be more than enough for detecting infinite recursion. - if self.depth > 64 { - return Err(ResolveError::Recursion); - } - Ok(()) - } -} diff --git a/src/error.rs b/src/error.rs deleted file mode 100644 index b00a0ba8..00000000 --- a/src/error.rs +++ /dev/null @@ -1,182 +0,0 @@ -use std::{io, path::PathBuf, sync::Arc}; -use thiserror::Error; - -/// All resolution errors -/// -/// `thiserror` is used to display meaningful error messages. -#[derive(Debug, Clone, PartialEq, Error)] -pub enum ResolveError { - /// Ignored path - /// - /// Derived from ignored path (false value) from browser field in package.json - /// ```json - /// { - /// "browser": { - /// "./module": false - /// } - /// } - /// ``` - /// See - #[error("Path is ignored {0}")] - Ignored(PathBuf), - - /// Module not found - #[error("Cannot find module '{0}'")] - NotFound(/* specifier */ String), - - /// Matched alias value not found - #[error("Cannot find module '{0}' for matched aliased key '{1}'")] - MatchedAliasNotFound(/* specifier */ String, /* alias key */ String), - - /// Tsconfig not found - #[error("Tsconfig not found {0}")] - TsconfigNotFound(PathBuf), - - /// Tsconfig's project reference path points to it self - #[error("Tsconfig's project reference path points to this tsconfig {0}")] - TsconfigSelfReference(PathBuf), - - #[error("{0}")] - IOError(IOError), - - /// Node.js builtin modules - /// - /// This is an error due to not being a Node.js runtime. - /// The `alias` option can be used to resolve a builtin module to a polyfill. - #[error("Builtin module {0}")] - Builtin(String), - - /// All of the aliased extension are not found - #[error("All of the aliased extensions are not found for {0}")] - ExtensionAlias(PathBuf), - - /// The provided path specifier cannot be parsed - #[error("{0}")] - Specifier(SpecifierError), - - /// JSON parse error - #[error("{0:?}")] - JSON(JSONError), - - /// Restricted by `ResolveOptions::restrictions` - #[error(r#"Path "{0}" restricted by {0}"#)] - Restriction(PathBuf, PathBuf), - - #[error(r#"Invalid module "{0}" specifier is not a valid subpath for the "exports" resolution of {1}"#)] - InvalidModuleSpecifier(String, PathBuf), - - #[error(r#"Invalid "exports" target "{0}" defined for '{1}' in the package config {2}"#)] - InvalidPackageTarget(String, String, PathBuf), - - #[error(r#"Package subpath '{0}' is not defined by "exports" in {1}"#)] - PackagePathNotExported(String, PathBuf), - - #[error(r#"Invalid package config "{0}", "exports" cannot contain some keys starting with '.' and some not. The exports object must either be an object of package subpath keys or an object of main entry condition name keys only."#)] - InvalidPackageConfig(PathBuf), - - #[error(r#"Default condition should be last one in "{0}""#)] - InvalidPackageConfigDefault(PathBuf), - - #[error(r#"Expecting folder to folder mapping. "{0}" should end with "/"#)] - InvalidPackageConfigDirectory(PathBuf), - - #[error(r#"Package import specifier "{0}" is not defined in package {1}"#)] - PackageImportNotDefined(String, PathBuf), - - #[error("{0} is unimplemented")] - Unimplemented(&'static str), - - /// Occurs when alias paths reference each other. - #[error("Recursion in resolving")] - Recursion, -} - -impl ResolveError { - pub fn is_ignore(&self) -> bool { - matches!(self, Self::Ignored(_)) - } - - pub(crate) fn from_serde_json_error(path: PathBuf, error: &serde_json::Error) -> Self { - Self::JSON(JSONError { - path, - message: error.to_string(), - line: error.line(), - column: error.column(), - }) - } -} - -/// Error for [ResolveError::Specifier] -#[derive(Debug, Clone, Eq, PartialEq, Error)] -pub enum SpecifierError { - #[error("The specifiers must be a non-empty string. Received \"{0}\"")] - Empty(String), -} - -/// JSON error from [serde_json::Error] -#[derive(Debug, Clone, Eq, PartialEq)] -pub struct JSONError { - pub path: PathBuf, - pub message: String, - pub line: usize, - pub column: usize, -} - -#[derive(Debug, Clone, Error)] -#[error("{0}")] -pub struct IOError(Arc); - -impl PartialEq for IOError { - fn eq(&self, other: &Self) -> bool { - self.0.kind() == other.0.kind() - } -} - -impl From for io::Error { - fn from(error: IOError) -> Self { - let io_error = error.0.as_ref(); - Self::new(io_error.kind(), io_error.to_string()) - } -} - -impl From for ResolveError { - fn from(err: io::Error) -> Self { - Self::IOError(IOError(Arc::new(err))) - } -} - -#[test] -fn test_into_io_error() { - use std::io::{self, ErrorKind}; - let error_string = "IOError occurred"; - let string_error = io::Error::new(ErrorKind::Interrupted, error_string.to_string()); - let string_error2 = io::Error::new(ErrorKind::Interrupted, error_string.to_string()); - let resolve_io_error: ResolveError = ResolveError::from(string_error2); - - assert_eq!(resolve_io_error, ResolveError::from(string_error)); - assert_eq!(resolve_io_error.clone(), resolve_io_error); - let ResolveError::IOError(io_error) = resolve_io_error else { unreachable!() }; - assert_eq!( - format!("{io_error:?}"), - r#"IOError(Custom { kind: Interrupted, error: "IOError occurred" })"# - ); - // fix for https://github.com/web-infra-dev/rspack/issues/4564 - let std_io_error: io::Error = io_error.into(); - assert_eq!(std_io_error.kind(), ErrorKind::Interrupted); - assert_eq!(std_io_error.to_string(), error_string); - assert_eq!( - format!("{std_io_error:?}"), - r#"Custom { kind: Interrupted, error: "IOError occurred" }"# - ); -} - -#[test] -fn test_coverage() { - let error = ResolveError::NotFound("x".into()); - assert_eq!(format!("{error:?}"), r#"NotFound("x")"#); - assert_eq!(error.clone(), error); - - let error = ResolveError::Specifier(SpecifierError::Empty("x".into())); - assert_eq!(format!("{error:?}"), r#"Specifier(Empty("x"))"#); - assert_eq!(error.clone(), error); -} diff --git a/src/file_system.rs b/src/file_system.rs deleted file mode 100644 index d5f0ff8a..00000000 --- a/src/file_system.rs +++ /dev/null @@ -1,220 +0,0 @@ -use cfg_if::cfg_if; -use std::{ - fs, io, - path::{Path, PathBuf}, -}; - -#[cfg(feature = "yarn_pnp")] -use pnp::fs::{LruZipCache, VPath, VPathInfo, ZipCache}; - -/// File System abstraction used for `ResolverGeneric` -pub trait FileSystem: Send + Sync { - /// See [std::fs::read_to_string] - /// - /// # Errors - /// - /// * See [std::fs::read_to_string] - /// ## Warning - /// Use `&Path` instead of a generic `P: AsRef` here, - /// because object safety requirements, it is especially useful, when - /// you want to store multiple `dyn FileSystem` in a `Vec` or use a `ResolverGeneric` in - /// napi env. - fn read_to_string(&self, path: &Path) -> io::Result; - - /// See [std::fs::metadata] - /// - /// # Errors - /// See [std::fs::metadata] - /// ## Warning - /// Use `&Path` instead of a generic `P: AsRef` here, - /// because object safety requirements, it is especially useful, when - /// you want to store multiple `dyn FileSystem` in a `Vec` or use a `ResolverGeneric` in - /// napi env. - fn metadata(&self, path: &Path) -> io::Result; - - /// See [std::fs::symlink_metadata] - /// - /// # Errors - /// - /// See [std::fs::symlink_metadata] - /// ## Warning - /// Use `&Path` instead of a generic `P: AsRef` here, - /// because object safety requirements, it is especially useful, when - /// you want to store multiple `dyn FileSystem` in a `Vec` or use a `ResolverGeneric` in - /// napi env. - fn symlink_metadata(&self, path: &Path) -> io::Result; - - /// See [std::fs::canonicalize] - /// - /// # Errors - /// - /// See [std::fs::read_link] - /// ## Warning - /// Use `&Path` instead of a generic `P: AsRef` here, - /// because object safety requirements, it is especially useful, when - /// you want to store multiple `dyn FileSystem` in a `Vec` or use a `ResolverGeneric` in - /// napi env. - fn canonicalize(&self, path: &Path) -> io::Result; -} - -/// Metadata information about a file -#[derive(Debug, Clone, Copy)] -pub struct FileMetadata { - pub(crate) is_file: bool, - pub(crate) is_dir: bool, - pub(crate) is_symlink: bool, -} - -impl FileMetadata { - pub fn new(is_file: bool, is_dir: bool, is_symlink: bool) -> Self { - Self { is_file, is_dir, is_symlink } - } -} - -#[cfg(feature = "yarn_pnp")] -impl From for FileMetadata { - fn from(value: pnp::fs::FileType) -> Self { - Self::new(value == pnp::fs::FileType::File, value == pnp::fs::FileType::Directory, false) - } -} - -impl From for FileMetadata { - fn from(metadata: fs::Metadata) -> Self { - Self::new(metadata.is_file(), metadata.is_dir(), metadata.is_symlink()) - } -} - -/// Operating System -#[cfg(feature = "yarn_pnp")] -pub struct FileSystemOs { - pnp_lru: LruZipCache>, -} - -#[cfg(not(feature = "yarn_pnp"))] -pub struct FileSystemOs; - -impl Default for FileSystemOs { - fn default() -> Self { - cfg_if! { - if #[cfg(feature = "yarn_pnp")] { - Self { pnp_lru: LruZipCache::new(50, pnp::fs::open_zip_via_read_p) } - } else { - Self - } - } - } -} - -fn read_to_string(path: &Path) -> io::Result { - // `simdutf8` is faster than `std::str::from_utf8` which `fs::read_to_string` uses internally - let bytes = std::fs::read(path)?; - if simdutf8::basic::from_utf8(&bytes).is_err() { - // Same error as `fs::read_to_string` produces (`io::Error::INVALID_UTF8`) - return Err(io::Error::new( - io::ErrorKind::InvalidData, - "stream did not contain valid UTF-8", - )); - } - // SAFETY: `simdutf8` has ensured it's a valid UTF-8 string - Ok(unsafe { String::from_utf8_unchecked(bytes) }) -} - -impl FileSystem for FileSystemOs { - fn read_to_string(&self, path: &Path) -> io::Result { - cfg_if! { - if #[cfg(feature = "yarn_pnp")] { - match VPath::from(path)? { - VPath::Zip(info) => { - self.pnp_lru.read_to_string(info.physical_base_path(), info.zip_path) - } - VPath::Virtual(info) => read_to_string(&info.physical_base_path()), - VPath::Native(path) => read_to_string(&path), - } - } else { - read_to_string(path) - } - } - } - - fn metadata(&self, path: &Path) -> io::Result { - cfg_if! { - if #[cfg(feature = "yarn_pnp")] { - match VPath::from(path)? { - VPath::Zip(info) => self - .pnp_lru - .file_type(info.physical_base_path(), info.zip_path) - .map(FileMetadata::from), - VPath::Virtual(info) => { - fs::metadata(info.physical_base_path()).map(FileMetadata::from) - } - VPath::Native(path) => fs::metadata(path).map(FileMetadata::from), - } - } else { - fs::metadata(path).map(FileMetadata::from) - } - } - } - - fn symlink_metadata(&self, path: &Path) -> io::Result { - fs::symlink_metadata(path).map(FileMetadata::from) - } - - fn canonicalize(&self, path: &Path) -> io::Result { - cfg_if! { - if #[cfg(feature = "yarn_pnp")] { - match VPath::from(path)? { - VPath::Zip(info) => { - dunce::canonicalize(info.physical_base_path().join(info.zip_path)) - } - VPath::Virtual(info) => dunce::canonicalize(info.physical_base_path()), - VPath::Native(path) => dunce::canonicalize(path), - } - } else if #[cfg(windows)] { - dunce::canonicalize(path) - } else { - use std::path::Component; - let mut path_buf = path.to_path_buf(); - loop { - let link = fs::read_link(&path_buf)?; - path_buf.pop(); - for component in link.components() { - match component { - Component::ParentDir => { - path_buf.pop(); - } - Component::Normal(seg) => { - #[cfg(target_family = "wasm")] - // Need to trim the extra \0 introduces by https://github.com/nodejs/uvwasi/issues/262 - { - path_buf.push(seg.to_string_lossy().trim_end_matches('\0')); - } - #[cfg(not(target_family = "wasm"))] - { - path_buf.push(seg); - } - } - Component::RootDir => { - path_buf = PathBuf::from("/"); - } - Component::CurDir | Component::Prefix(_) => {} - } - } - if !fs::symlink_metadata(&path_buf)?.is_symlink() { - break; - } - } - Ok(path_buf) - } - } - } -} - -#[test] -fn metadata() { - let meta = FileMetadata { is_file: true, is_dir: true, is_symlink: true }; - assert_eq!( - format!("{meta:?}"), - "FileMetadata { is_file: true, is_dir: true, is_symlink: true }" - ); - let _ = meta; -} diff --git a/src/lib.rs b/src/lib.rs deleted file mode 100644 index e6cb2246..00000000 --- a/src/lib.rs +++ /dev/null @@ -1,1755 +0,0 @@ -//! # Oxc Resolver -//! -//! Node.js [CommonJS][cjs] and [ECMAScript][esm] Module Resolution. -//! -//! Released on [crates.io](https://crates.io/crates/oxc_resolver) and [npm](https://www.npmjs.com/package/oxc-resolver). -//! -//! A module resolution is the process of finding the file referenced by a module specifier in -//! `import "specifier"` or `require("specifier")`. -//! -//! All [configuration options](ResolveOptions) are aligned with webpack's [enhanced-resolve]. -//! -//! ## Terminology -//! -//! ### Specifier -//! -//! For [CommonJS modules][cjs], -//! the specifier is the string passed to the `require` function. e.g. `"id"` in `require("id")`. -//! -//! For [ECMAScript modules][esm], -//! the specifier of an `import` statement is the string after the `from` keyword, -//! e.g. `'specifier'` in `import 'specifier'` or `import { sep } from 'specifier'`. -//! Specifiers are also used in export from statements, and as the argument to an `import()` expression. -//! -//! This is also named "request" in some places. -//! -//! ## References: -//! -//! * Algorithm adapted from Node.js [CommonJS Module Resolution Algorithm] and [ECMAScript Module Resolution Algorithm]. -//! * Tests are ported from [enhanced-resolve]. -//! * Some code is adapted from [parcel-resolver]. -//! * The documentation is copied from [webpack's resolve configuration](https://webpack.js.org/configuration/resolve). -//! -//! [enhanced-resolve]: https://github.com/webpack/enhanced-resolve -//! [CommonJS Module Resolution Algorithm]: https://nodejs.org/api/modules.html#all-together -//! [ECMAScript Module Resolution Algorithm]: https://nodejs.org/api/esm.html#resolution-algorithm-specification -//! [parcel-resolver]: https://github.com/parcel-bundler/parcel/blob/v2/packages/utils/node-resolver-rs -//! [cjs]: https://nodejs.org/api/modules.html -//! [esm]: https://nodejs.org/api/esm.html -//! -//! ## Feature flags -#![cfg_attr(feature = "document-features", doc = document_features::document_features!())] -#![cfg_attr(docsrs, feature(doc_auto_cfg))] -//! -//! ## Example -//! -//! ```rust,ignore -#![doc = include_str!("../examples/resolver.rs")] -//! ``` - -mod builtins; -mod cache; -mod context; -mod error; -mod file_system; -mod options; -mod package_json; -mod path; -mod resolution; -mod specifier; -mod tsconfig; - -#[cfg(test)] -mod tests; - -use std::{ - borrow::Cow, - cmp::Ordering, - ffi::OsStr, - fmt, - path::{Component, Path, PathBuf}, - sync::Arc, -}; - -use rustc_hash::FxHashSet; -use serde_json::Value as JSONValue; - -pub use crate::{ - builtins::NODEJS_BUILTINS, - error::{JSONError, ResolveError, SpecifierError}, - file_system::{FileMetadata, FileSystem}, - options::{ - Alias, AliasValue, EnforceExtension, ResolveOptions, Restriction, TsconfigOptions, - TsconfigReferences, - }, - package_json::PackageJson, - resolution::Resolution, -}; -use crate::{ - cache::{Cache, CachedPath}, - context::ResolveContext as Ctx, - file_system::FileSystemOs, - package_json::JSONMap, - path::{PathUtil, SLASH_START}, - specifier::Specifier, - tsconfig::ExtendsField, - tsconfig::{ProjectReference, TsConfig}, -}; - -type ResolveResult = Result, ResolveError>; - -/// Context returned from the [Resolver::resolve_with_context] API -#[derive(Debug, Default, Clone)] -pub struct ResolveContext { - /// Files that was found on file system - pub file_dependencies: FxHashSet, - - /// Dependencies that was not found on file system - pub missing_dependencies: FxHashSet, -} - -/// Resolver with the current operating system as the file system -pub type Resolver = ResolverGeneric; - -/// Generic implementation of the resolver, can be configured by the [FileSystem] trait -pub struct ResolverGeneric { - options: ResolveOptions, - cache: Arc>, -} - -impl fmt::Debug for ResolverGeneric { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - self.options.fmt(f) - } -} - -impl Default for ResolverGeneric { - fn default() -> Self { - Self::new(ResolveOptions::default()) - } -} - -impl ResolverGeneric { - pub fn new(options: ResolveOptions) -> Self { - Self { options: options.sanitize(), cache: Arc::new(Cache::new(Fs::default())) } - } -} - -impl ResolverGeneric { - pub fn new_with_file_system(file_system: Fs, options: ResolveOptions) -> Self { - Self { cache: Arc::new(Cache::new(file_system)), options: options.sanitize() } - } - - /// Clone the resolver using the same underlying cache. - #[must_use] - pub fn clone_with_options(&self, options: ResolveOptions) -> Self { - Self { options: options.sanitize(), cache: Arc::clone(&self.cache) } - } - - /// Returns the options. - pub fn options(&self) -> &ResolveOptions { - &self.options - } - - /// Clear the underlying cache. - pub fn clear_cache(&self) { - self.cache.clear(); - } - - /// Resolve `specifier` at an absolute path to a `directory`. - /// - /// A specifier is the string passed to require or import, i.e. `require("specifier")` or `import "specifier"`. - /// - /// `directory` must be an **absolute** path to a directory where the specifier is resolved against. - /// For CommonJS modules, it is the `__dirname` variable that contains the absolute path to the folder containing current module. - /// For ECMAScript modules, it is the value of `import.meta.url`. - /// - /// # Errors - /// - /// * See [ResolveError] - pub fn resolve>( - &self, - directory: P, - specifier: &str, - ) -> Result { - let mut ctx = Ctx::default(); - self.resolve_tracing(directory.as_ref(), specifier, &mut ctx) - } - - /// Resolve `specifier` at absolute `path` with [ResolveContext] - /// - /// # Errors - /// - /// * See [ResolveError] - pub fn resolve_with_context>( - &self, - directory: P, - specifier: &str, - resolve_context: &mut ResolveContext, - ) -> Result { - let mut ctx = Ctx::default(); - ctx.init_file_dependencies(); - let result = self.resolve_tracing(directory.as_ref(), specifier, &mut ctx); - if let Some(deps) = &mut ctx.file_dependencies { - resolve_context.file_dependencies.extend(deps.drain(..)); - } - if let Some(deps) = &mut ctx.missing_dependencies { - resolve_context.missing_dependencies.extend(deps.drain(..)); - } - result - } - - /// Wrap `resolve_impl` with `tracing` information - fn resolve_tracing( - &self, - directory: &Path, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - let span = tracing::debug_span!("resolve", path = ?directory, specifier = specifier); - let _enter = span.enter(); - let r = self.resolve_impl(directory, specifier, ctx); - match &r { - Ok(r) => { - tracing::debug!(options = ?self.options, path = ?directory, specifier = specifier, ret = ?r.path); - } - Err(err) => { - tracing::debug!(options = ?self.options, path = ?directory, specifier = specifier, err = ?err); - } - }; - r - } - - fn resolve_impl( - &self, - path: &Path, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - ctx.with_fully_specified(self.options.fully_specified); - let cached_path = self.cache.value(path); - let cached_path = self.require(&cached_path, specifier, ctx)?; - let path = self.load_realpath(&cached_path)?; - // enhanced-resolve: restrictions - self.check_restrictions(&path)?; - let package_json = cached_path.find_package_json(&self.cache.fs, &self.options, ctx)?; - if let Some(package_json) = &package_json { - // path must be inside the package. - debug_assert!(path.starts_with(package_json.directory())); - } - Ok(Resolution { - path, - query: ctx.query.take(), - fragment: ctx.fragment.take(), - package_json, - }) - } - - /// require(X) from module at path Y - /// - /// X: specifier - /// Y: path - /// - /// - fn require( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - ctx.test_for_infinite_recursion()?; - - // enhanced-resolve: parse - let (parsed, try_fragment_as_path) = self.load_parse(cached_path, specifier, ctx)?; - if let Some(path) = try_fragment_as_path { - return Ok(path); - } - - self.require_without_parse(cached_path, parsed.path(), ctx) - } - - fn require_without_parse( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - // tsconfig-paths - if let Some(path) = self.load_tsconfig_paths(cached_path, specifier, &mut Ctx::default())? { - return Ok(path); - } - - // enhanced-resolve: try alias - if let Some(path) = self.load_alias(cached_path, specifier, &self.options.alias, ctx)? { - return Ok(path); - } - - let result = match Path::new(specifier).components().next() { - // 2. If X begins with '/' - Some(Component::RootDir | Component::Prefix(_)) => { - self.require_absolute(cached_path, specifier, ctx) - } - // 3. If X begins with './' or '/' or '../' - Some(Component::CurDir | Component::ParentDir) => { - self.require_relative(cached_path, specifier, ctx) - } - // 4. If X begins with '#' - Some(Component::Normal(_)) if specifier.as_bytes()[0] == b'#' => { - self.require_hash(cached_path, specifier, ctx) - } - _ => { - // 1. If X is a core module, - // a. return the core module - // b. STOP - self.require_core(specifier)?; - - // (ESM) 5. Otherwise, - // Note: specifier is now a bare specifier. - // Set resolved the result of PACKAGE_RESOLVE(specifier, parentURL). - self.require_bare(cached_path, specifier, ctx) - } - }; - - result.or_else(|err| { - if err.is_ignore() { - return Err(err); - } - // enhanced-resolve: try fallback - self.load_alias(cached_path, specifier, &self.options.fallback, ctx) - .and_then(|value| value.ok_or(err)) - }) - } - - // PACKAGE_RESOLVE(packageSpecifier, parentURL) - // 3. If packageSpecifier is a Node.js builtin module name, then - // 1. Return the string "node:" concatenated with packageSpecifier. - fn require_core(&self, specifier: &str) -> Result<(), ResolveError> { - if self.options.builtin_modules { - let starts_with_node = specifier.starts_with("node:"); - if starts_with_node || NODEJS_BUILTINS.binary_search(&specifier).is_ok() { - let mut specifier = specifier.to_string(); - if !starts_with_node { - specifier = format!("node:{specifier}"); - } - return Err(ResolveError::Builtin(specifier)); - } - } - Ok(()) - } - - fn require_absolute( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - // Make sure only path prefixes gets called - debug_assert!(Path::new(specifier) - .components() - .next() - .is_some_and(|c| matches!(c, Component::RootDir | Component::Prefix(_)))); - if !self.options.prefer_relative && self.options.prefer_absolute { - if let Ok(path) = self.load_package_self_or_node_modules(cached_path, specifier, ctx) { - return Ok(path); - } - } - if let Some(path) = self.load_roots(specifier, ctx) { - return Ok(path); - } - // 2. If X begins with '/' - // a. set Y to be the file system root - let path = self.cache.value(Path::new(specifier)); - if let Some(path) = self.load_as_file_or_directory(&path, specifier, ctx)? { - return Ok(path); - } - Err(ResolveError::NotFound(specifier.to_string())) - } - - // 3. If X begins with './' or '/' or '../' - fn require_relative( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - // Make sure only relative or normal paths gets called - debug_assert!(Path::new(specifier).components().next().is_some_and(|c| matches!( - c, - Component::CurDir | Component::ParentDir | Component::Normal(_) - ))); - let path = cached_path.path().normalize_with(specifier); - let cached_path = self.cache.value(&path); - // a. LOAD_AS_FILE(Y + X) - // b. LOAD_AS_DIRECTORY(Y + X) - if let Some(path) = self.load_as_file_or_directory(&cached_path, specifier, ctx)? { - return Ok(path); - } - // c. THROW "not found" - Err(ResolveError::NotFound(specifier.to_string())) - } - - fn require_hash( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - debug_assert_eq!(specifier.chars().next(), Some('#')); - // a. LOAD_PACKAGE_IMPORTS(X, dirname(Y)) - if let Some(path) = self.load_package_imports(cached_path, specifier, ctx)? { - return Ok(path); - } - self.load_package_self_or_node_modules(cached_path, specifier, ctx) - } - - fn require_bare( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - // Make sure no other path prefixes gets called - debug_assert!(Path::new(specifier) - .components() - .next() - .is_some_and(|c| matches!(c, Component::Normal(_)))); - if self.options.prefer_relative { - if let Ok(path) = self.require_relative(cached_path, specifier, ctx) { - return Ok(path); - } - } - self.load_package_self_or_node_modules(cached_path, specifier, ctx) - } - - /// enhanced-resolve: ParsePlugin. - /// - /// 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`. - /// - /// - fn load_parse<'s>( - &self, - cached_path: &CachedPath, - specifier: &'s str, - ctx: &mut Ctx, - ) -> Result<(Specifier<'s>, Option), ResolveError> { - let parsed = Specifier::parse(specifier).map_err(ResolveError::Specifier)?; - ctx.with_query_fragment(parsed.query, parsed.fragment); - - // There is an edge-case where a request with # can be a path or a fragment -> try both - if ctx.fragment.is_some() && ctx.query.is_none() { - let specifier = parsed.path(); - let fragment = ctx.fragment.take().unwrap(); - let path = format!("{specifier}{fragment}"); - if let Ok(path) = self.require_without_parse(cached_path, &path, ctx) { - return Ok((parsed, Some(path))); - } - ctx.fragment.replace(fragment); - } - Ok((parsed, None)) - } - - fn load_package_self_or_node_modules( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - let (_, subpath) = Self::parse_package_specifier(specifier); - if subpath.is_empty() { - ctx.with_fully_specified(false); - } - // 5. LOAD_PACKAGE_SELF(X, dirname(Y)) - if let Some(path) = self.load_package_self(cached_path, specifier, ctx)? { - return Ok(path); - } - // 6. LOAD_NODE_MODULES(X, dirname(Y)) - if let Some(path) = self.load_node_modules(cached_path, specifier, ctx)? { - return Ok(path); - } - // 7. THROW "not found" - Err(ResolveError::NotFound(specifier.to_string())) - } - - /// LOAD_PACKAGE_IMPORTS(X, DIR) - fn load_package_imports( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - // 1. Find the closest package scope SCOPE to DIR. - // 2. If no scope was found, return. - let Some(package_json) = - cached_path.find_package_json(&self.cache.fs, &self.options, ctx)? - else { - return Ok(None); - }; - // 3. If the SCOPE/package.json "imports" is null or undefined, return. - // 4. let MATCH = PACKAGE_IMPORTS_RESOLVE(X, pathToFileURL(SCOPE), ["node", "require"]) defined in the ESM resolver. - if let Some(path) = self.package_imports_resolve(specifier, &package_json, ctx)? { - // 5. RESOLVE_ESM_MATCH(MATCH). - return self.resolve_esm_match(specifier, &path, ctx); - } - Ok(None) - } - - fn load_as_file(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - // enhanced-resolve feature: extension_alias - if let Some(path) = self.load_extension_alias(cached_path, ctx)? { - return Ok(Some(path)); - } - if self.options.enforce_extension.is_disabled() { - // 1. If X is a file, load X as its file extension format. STOP - if let Some(path) = self.load_alias_or_file(cached_path, ctx)? { - return Ok(Some(path)); - } - } - // 2. If X.js is a file, load X.js as JavaScript text. STOP - // 3. If X.json is a file, parse X.json to a JavaScript Object. STOP - // 4. If X.node is a file, load X.node as binary addon. STOP - if let Some(path) = self.load_extensions(cached_path, &self.options.extensions, ctx)? { - return Ok(Some(path)); - } - Ok(None) - } - - fn load_as_directory(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - // TODO: Only package.json is supported, so warn about having other values - // Checking for empty files is needed for omitting checks on package.json - // 1. If X/package.json is a file, - if !self.options.description_files.is_empty() { - // a. Parse X/package.json, and look for "main" field. - if let Some(package_json) = - cached_path.package_json(&self.cache.fs, &self.options, ctx)? - { - // b. If "main" is a falsy value, GOTO 2. - for main_field in package_json.main_fields(&self.options.main_fields) { - // c. let M = X + (json main field) - let main_field_path = cached_path.path().normalize_with(main_field); - // d. LOAD_AS_FILE(M) - let cached_path = self.cache.value(&main_field_path); - if let Some(path) = self.load_as_file(&cached_path, ctx)? { - return Ok(Some(path)); - } - // e. LOAD_INDEX(M) - if let Some(path) = self.load_index(&cached_path, ctx)? { - return Ok(Some(path)); - } - } - // f. LOAD_INDEX(X) DEPRECATED - // g. THROW "not found" - } - } - // 2. LOAD_INDEX(X) - self.load_index(cached_path, ctx) - } - - fn load_as_file_or_directory( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - if self.options.resolve_to_context { - return Ok(cached_path.is_dir(&self.cache.fs, ctx).then(|| cached_path.clone())); - } - if !specifier.ends_with('/') { - if let Some(path) = self.load_as_file(cached_path, ctx)? { - return Ok(Some(path)); - } - } - if cached_path.is_dir(&self.cache.fs, ctx) { - if let Some(path) = self.load_as_directory(cached_path, ctx)? { - return Ok(Some(path)); - } - } - Ok(None) - } - - fn load_extensions( - &self, - path: &CachedPath, - extensions: &[String], - ctx: &mut Ctx, - ) -> ResolveResult { - if ctx.fully_specified { - return Ok(None); - } - let path = path.path().as_os_str(); - for extension in extensions { - let mut path_with_extension = path.to_os_string(); - path_with_extension.reserve_exact(extension.len()); - path_with_extension.push(extension); - let cached_path = self.cache.value(Path::new(&path_with_extension)); - if let Some(path) = self.load_alias_or_file(&cached_path, ctx)? { - return Ok(Some(path)); - } - } - Ok(None) - } - - fn load_realpath(&self, cached_path: &CachedPath) -> Result { - if self.options.symlinks { - cached_path.realpath(&self.cache.fs).map_err(ResolveError::from) - } else { - Ok(cached_path.to_path_buf()) - } - } - - fn check_restrictions(&self, path: &Path) -> Result<(), ResolveError> { - // https://github.com/webpack/enhanced-resolve/blob/a998c7d218b7a9ec2461fc4fddd1ad5dd7687485/lib/RestrictionsPlugin.js#L19-L24 - fn is_inside(path: &Path, parent: &Path) -> bool { - if !path.starts_with(parent) { - return false; - } - if path.as_os_str().len() == parent.as_os_str().len() { - return true; - } - path.strip_prefix(parent).is_ok_and(|p| p == Path::new("./")) - } - for restriction in &self.options.restrictions { - match restriction { - Restriction::Path(restricted_path) => { - if !is_inside(path, restricted_path) { - return Err(ResolveError::Restriction( - path.to_path_buf(), - restricted_path.clone(), - )); - } - } - Restriction::RegExp(_) => { - return Err(ResolveError::Unimplemented("Restriction with regex")) - } - } - } - Ok(()) - } - - fn load_index(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - for main_file in &self.options.main_files { - let main_path = cached_path.path().normalize_with(main_file); - let cached_path = self.cache.value(&main_path); - if self.options.enforce_extension.is_disabled() { - if let Some(path) = self.load_alias_or_file(&cached_path, ctx)? { - return Ok(Some(path)); - } - } - // 1. If X/index.js is a file, load X/index.js as JavaScript text. STOP - // 2. If X/index.json is a file, parse X/index.json to a JavaScript object. STOP - // 3. If X/index.node is a file, load X/index.node as binary addon. STOP - if let Some(path) = self.load_extensions(&cached_path, &self.options.extensions, ctx)? { - return Ok(Some(path)); - } - } - Ok(None) - } - - fn load_alias_or_file(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - if !self.options.alias_fields.is_empty() { - if let Some(package_json) = - cached_path.find_package_json(&self.cache.fs, &self.options, ctx)? - { - if let Some(path) = - self.load_browser_field(cached_path, None, &package_json, ctx)? - { - return Ok(Some(path)); - } - } - } - // enhanced-resolve: try file as alias - let alias_specifier = cached_path.path().to_string_lossy(); - if let Some(path) = - self.load_alias(cached_path, &alias_specifier, &self.options.alias, ctx)? - { - return Ok(Some(path)); - } - if cached_path.is_file(&self.cache.fs, ctx) { - return Ok(Some(cached_path.clone())); - } - Ok(None) - } - - fn load_node_modules( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - #[cfg(feature = "yarn_pnp")] - { - if let Some(resolved_path) = self.load_pnp(cached_path, specifier, ctx)? { - return Ok(Some(resolved_path)); - } - } - - let (package_name, subpath) = Self::parse_package_specifier(specifier); - // 1. let DIRS = NODE_MODULES_PATHS(START) - // 2. for each DIR in DIRS: - for module_name in &self.options.modules { - for cached_path in std::iter::successors(Some(cached_path), |p| p.parent()) { - // Skip if /path/to/node_modules does not exist - if !cached_path.is_dir(&self.cache.fs, ctx) { - continue; - } - - let Some(cached_path) = self.get_module_directory(cached_path, module_name, ctx) - else { - continue; - }; - // Optimize node_modules lookup by inspecting whether the package exists - // From LOAD_PACKAGE_EXPORTS(X, DIR) - // 1. Try to interpret X as a combination of NAME and SUBPATH where the name - // may have a @scope/ prefix and the subpath begins with a slash (`/`). - if !package_name.is_empty() { - let package_path = cached_path.path().normalize_with(package_name); - let cached_path = self.cache.value(&package_path); - // Try foo/node_modules/package_name - if cached_path.is_dir(&self.cache.fs, ctx) { - // a. LOAD_PACKAGE_EXPORTS(X, DIR) - if let Some(path) = - self.load_package_exports(specifier, subpath, &cached_path, ctx)? - { - return Ok(Some(path)); - } - } else { - // foo/node_modules/package_name is not a directory, so useless to check inside it - if !subpath.is_empty() { - continue; - } - // Skip if the directory lead to the scope package does not exist - // i.e. `foo/node_modules/@scope` is not a directory for `foo/node_modules/@scope/package` - if package_name.starts_with('@') { - if let Some(path) = cached_path.parent() { - if !path.is_dir(&self.cache.fs, ctx) { - continue; - } - } - } - } - } - - // Try as file or directory for all other cases - // b. LOAD_AS_FILE(DIR/X) - // c. LOAD_AS_DIRECTORY(DIR/X) - let node_module_file = cached_path.path().normalize_with(specifier); - let cached_path = self.cache.value(&node_module_file); - if let Some(path) = self.load_as_file_or_directory(&cached_path, specifier, ctx)? { - return Ok(Some(path)); - } - } - } - Ok(None) - } - - #[cfg(feature = "yarn_pnp")] - fn load_pnp( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result, ResolveError> { - let Some(pnp_manifest) = &self.options.pnp_manifest else { return Ok(None) }; - let resolution = - pnp::resolve_to_unqualified_via_manifest(pnp_manifest, specifier, cached_path.path()); - match resolution { - Ok(pnp::Resolution::Resolved(path, subpath)) => { - let cached_path = self.cache.value(&path); - let export_resolution = self.load_package_exports( - specifier, - &subpath.unwrap_or_default(), - &cached_path, - ctx, - )?; - if export_resolution.is_some() { - return Ok(export_resolution); - } - let file_or_directory_resolution = - self.load_as_file_or_directory(&cached_path, specifier, ctx)?; - if file_or_directory_resolution.is_some() { - return Ok(file_or_directory_resolution); - } - Err(ResolveError::NotFound(specifier.to_string())) - } - - Ok(pnp::Resolution::Skipped) => Ok(None), - - Err(_) => { - // Todo: Add a ResolveError::Pnp variant? - Err(ResolveError::NotFound(specifier.to_string())) - } - } - } - - fn get_module_directory( - &self, - cached_path: &CachedPath, - module_name: &str, - ctx: &mut Ctx, - ) -> Option { - if module_name == "node_modules" { - cached_path.cached_node_modules(&self.cache, ctx) - } else if cached_path.path().components().next_back() - == Some(Component::Normal(OsStr::new(module_name))) - { - Some(cached_path.clone()) - } else { - cached_path.module_directory(module_name, &self.cache, ctx) - } - } - - fn load_package_exports( - &self, - specifier: &str, - subpath: &str, - cached_path: &CachedPath, - ctx: &mut Ctx, - ) -> ResolveResult { - // 2. If X does not match this pattern or DIR/NAME/package.json is not a file, - // return. - let Some(package_json) = cached_path.package_json(&self.cache.fs, &self.options, ctx)? - else { - return Ok(None); - }; - // 3. Parse DIR/NAME/package.json, and look for "exports" field. - // 4. If "exports" is null or undefined, return. - // 5. let MATCH = PACKAGE_EXPORTS_RESOLVE(pathToFileURL(DIR/NAME), "." + SUBPATH, - // `package.json` "exports", ["node", "require"]) defined in the ESM resolver. - // Note: The subpath is not prepended with a dot on purpose - for exports in package_json.exports_fields(&self.options.exports_fields) { - if let Some(path) = self.package_exports_resolve( - cached_path.path(), - &format!(".{subpath}"), - exports, - ctx, - )? { - // 6. RESOLVE_ESM_MATCH(MATCH) - return self.resolve_esm_match(specifier, &path, ctx); - }; - } - Ok(None) - } - - fn load_package_self( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - // 1. Find the closest package scope SCOPE to DIR. - // 2. If no scope was found, return. - let Some(package_json) = - cached_path.find_package_json(&self.cache.fs, &self.options, ctx)? - else { - return Ok(None); - }; - // 3. If the SCOPE/package.json "exports" is null or undefined, return. - // 4. If the SCOPE/package.json "name" is not the first segment of X, return. - if let Some(subpath) = package_json - .name - .as_ref() - .and_then(|package_name| Self::strip_package_name(specifier, package_name)) - { - // 5. let MATCH = PACKAGE_EXPORTS_RESOLVE(pathToFileURL(SCOPE), - // "." + X.slice("name".length), `package.json` "exports", ["node", "require"]) - // defined in the ESM resolver. - let package_url = package_json.directory(); - // Note: The subpath is not prepended with a dot on purpose - // because `package_exports_resolve` matches subpath without the leading dot. - for exports in package_json.exports_fields(&self.options.exports_fields) { - if let Some(cached_path) = - self.package_exports_resolve(package_url, &format!(".{subpath}"), exports, ctx)? - { - // 6. RESOLVE_ESM_MATCH(MATCH) - return self.resolve_esm_match(specifier, &cached_path, ctx); - } - } - } - self.load_browser_field(cached_path, Some(specifier), &package_json, ctx) - } - - /// RESOLVE_ESM_MATCH(MATCH) - fn resolve_esm_match( - &self, - specifier: &str, - cached_path: &CachedPath, - ctx: &mut Ctx, - ) -> ResolveResult { - // 1. let RESOLVED_PATH = fileURLToPath(MATCH) - // 2. If the file at RESOLVED_PATH exists, load RESOLVED_PATH as its extension format. STOP - // - // Non-compliant ESM can result in a directory, so directory is tried as well. - if let Some(path) = self.load_as_file_or_directory(cached_path, "", ctx)? { - return Ok(Some(path)); - } - // 3. THROW "not found" - Err(ResolveError::NotFound(specifier.to_string())) - } - - /// enhanced-resolve: AliasFieldPlugin for [ResolveOptions::alias_fields] - fn load_browser_field( - &self, - cached_path: &CachedPath, - module_specifier: Option<&str>, - package_json: &PackageJson, - ctx: &mut Ctx, - ) -> ResolveResult { - let path = cached_path.path(); - let Some(new_specifier) = package_json.resolve_browser_field( - path, - module_specifier, - &self.options.alias_fields, - )? - else { - return Ok(None); - }; - // Abort when resolving recursive module - if module_specifier.is_some_and(|s| s == new_specifier) { - return Ok(None); - } - if ctx.resolving_alias.as_ref().is_some_and(|s| s == new_specifier) { - // Complete when resolving to self `{"./a.js": "./a.js"}` - if new_specifier.strip_prefix("./").filter(|s| path.ends_with(Path::new(s))).is_some() { - return if cached_path.is_file(&self.cache.fs, ctx) { - Ok(Some(cached_path.clone())) - } else { - Err(ResolveError::NotFound(new_specifier.to_string())) - }; - } - return Err(ResolveError::Recursion); - } - ctx.with_resolving_alias(new_specifier.to_string()); - ctx.with_fully_specified(false); - let cached_path = self.cache.value(package_json.directory()); - self.require(&cached_path, new_specifier, ctx).map(Some) - } - - /// enhanced-resolve: AliasPlugin for [ResolveOptions::alias] and [ResolveOptions::fallback]. - fn load_alias( - &self, - cached_path: &CachedPath, - specifier: &str, - aliases: &Alias, - ctx: &mut Ctx, - ) -> ResolveResult { - for (alias_key_raw, specifiers) in aliases { - let alias_key = if let Some(alias_key) = alias_key_raw.strip_suffix('$') { - if alias_key != specifier { - continue; - } - alias_key - } else { - let strip_package_name = Self::strip_package_name(specifier, alias_key_raw); - if strip_package_name.is_none() { - continue; - } - alias_key_raw - }; - // It should stop resolving when all of the tried alias values - // failed to resolve. - // - let mut should_stop = false; - for r in specifiers { - match r { - AliasValue::Path(alias_value) => { - if let Some(path) = self.load_alias_value( - cached_path, - alias_key, - alias_value, - specifier, - ctx, - &mut should_stop, - )? { - return Ok(Some(path)); - } - } - AliasValue::Ignore => { - let path = cached_path.path().normalize_with(alias_key); - return Err(ResolveError::Ignored(path)); - } - } - } - if should_stop { - return Err(ResolveError::MatchedAliasNotFound( - specifier.to_string(), - alias_key.to_string(), - )); - } - } - Ok(None) - } - - fn load_alias_value( - &self, - cached_path: &CachedPath, - alias_key: &str, - alias_value: &str, - request: &str, - ctx: &mut Ctx, - should_stop: &mut bool, - ) -> ResolveResult { - if request != alias_value - && !request.strip_prefix(alias_value).is_some_and(|prefix| prefix.starts_with('/')) - { - let tail = &request[alias_key.len()..]; - - let new_specifier = if tail.is_empty() { - Cow::Borrowed(alias_value) - } else { - let alias_value = Path::new(alias_value).normalize(); - // Must not append anything to alias_value if it is a file. - let alias_value_cached_path = self.cache.value(&alias_value); - if alias_value_cached_path.is_file(&self.cache.fs, ctx) { - return Ok(None); - } - - // Remove the leading slash so the final path is concatenated. - let tail = tail.trim_start_matches(SLASH_START); - let normalized = alias_value.normalize_with(tail); - Cow::Owned(normalized.to_string_lossy().to_string()) - }; - - *should_stop = true; - ctx.with_fully_specified(false); - return match self.require(cached_path, new_specifier.as_ref(), ctx) { - Err(ResolveError::NotFound(_) | ResolveError::MatchedAliasNotFound(_, _)) => { - Ok(None) - } - Ok(path) => return Ok(Some(path)), - Err(err) => return Err(err), - }; - } - Ok(None) - } - - /// Given an extension alias map `{".js": [".ts", ".js"]}`, - /// load the mapping instead of the provided extension - /// - /// This is an enhanced-resolve feature - /// - /// # Errors - /// - /// * [ResolveError::ExtensionAlias]: When all of the aliased extensions are not found - fn load_extension_alias(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - if self.options.extension_alias.is_empty() { - return Ok(None); - } - let Some(path_extension) = cached_path.path().extension() else { - return Ok(None); - }; - let Some((_, extensions)) = self - .options - .extension_alias - .iter() - .find(|(ext, _)| OsStr::new(ext.trim_start_matches('.')) == path_extension) - else { - return Ok(None); - }; - let path = cached_path.path().with_extension(""); - let path = path.as_os_str(); - ctx.with_fully_specified(true); - for extension in extensions { - let mut path_with_extension = path.to_os_string(); - path_with_extension.reserve_exact(extension.len()); - path_with_extension.push(extension); - let cached_path = self.cache.value(Path::new(&path_with_extension)); - // Bail if path is module directory such as `ipaddr.js` - if cached_path.is_dir(&self.cache.fs, ctx) { - ctx.with_fully_specified(false); - return Ok(None); - } - if let Some(path) = self.load_alias_or_file(&cached_path, ctx)? { - ctx.with_fully_specified(false); - return Ok(Some(path)); - } - } - Err(ResolveError::ExtensionAlias(cached_path.to_path_buf())) - } - - /// enhanced-resolve: RootsPlugin - /// - /// A list of directories where requests of server-relative URLs (starting with '/') are resolved, - /// defaults to context configuration option. - /// - /// On non-Windows systems these requests are resolved as an absolute path first. - fn load_roots(&self, specifier: &str, ctx: &mut Ctx) -> Option { - if self.options.roots.is_empty() { - return None; - } - if let Some(specifier) = specifier.strip_prefix(SLASH_START) { - for root in &self.options.roots { - let cached_path = self.cache.value(root); - if let Ok(path) = self.require_relative(&cached_path, specifier, ctx) { - return Some(path); - } - } - } - None - } - - fn load_tsconfig_paths( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - let Some(tsconfig_options) = &self.options.tsconfig else { - return Ok(None); - }; - let tsconfig = self.load_tsconfig( - /* root */ true, - &tsconfig_options.config_file, - &tsconfig_options.references, - )?; - let paths = tsconfig.resolve(cached_path.path(), specifier); - for path in paths { - let cached_path = self.cache.value(&path); - if let Ok(path) = self.require_relative(&cached_path, ".", ctx) { - return Ok(Some(path)); - } - } - Ok(None) - } - - fn load_tsconfig( - &self, - root: bool, - path: &Path, - references: &TsconfigReferences, - ) -> Result, ResolveError> { - self.cache.tsconfig(root, path, |tsconfig| { - let directory = self.cache.value(tsconfig.directory()); - tracing::trace!(tsconfig = ?tsconfig, "load_tsconfig"); - - // Extend tsconfig - if let Some(extends) = &tsconfig.extends { - let extended_tsconfig_paths = match extends { - ExtendsField::Single(s) => { - vec![self.get_extended_tsconfig_path(&directory, tsconfig, s)?] - } - ExtendsField::Multiple(specifiers) => specifiers - .iter() - .map(|s| self.get_extended_tsconfig_path(&directory, tsconfig, s)) - .collect::, ResolveError>>()?, - }; - for extended_tsconfig_path in extended_tsconfig_paths { - let extended_tsconfig = self.load_tsconfig( - /* root */ false, - &extended_tsconfig_path, - &TsconfigReferences::Disabled, - )?; - tsconfig.extend_tsconfig(&extended_tsconfig); - } - } - - // Load project references - match references { - TsconfigReferences::Disabled => { - tsconfig.references.drain(..); - } - TsconfigReferences::Auto => {} - TsconfigReferences::Paths(paths) => { - tsconfig.references = paths - .iter() - .map(|path| ProjectReference { path: path.clone(), tsconfig: None }) - .collect(); - } - } - if !tsconfig.references.is_empty() { - let directory = tsconfig.directory().to_path_buf(); - for reference in &mut tsconfig.references { - let reference_tsconfig_path = directory.normalize_with(&reference.path); - let tsconfig = self.cache.tsconfig( - /* root */ true, - &reference_tsconfig_path, - |reference_tsconfig| { - if reference_tsconfig.path == tsconfig.path { - return Err(ResolveError::TsconfigSelfReference( - reference_tsconfig.path.clone(), - )); - } - Ok(()) - }, - )?; - reference.tsconfig.replace(tsconfig); - } - } - Ok(()) - }) - } - - fn get_extended_tsconfig_path( - &self, - directory: &CachedPath, - tsconfig: &TsConfig, - specifier: &str, - ) -> Result { - match specifier.as_bytes().first() { - None => Err(ResolveError::Specifier(SpecifierError::Empty(specifier.to_string()))), - Some(b'/') => Ok(PathBuf::from(specifier)), - Some(b'.') => Ok(tsconfig.directory().normalize_with(specifier)), - _ => self - .clone_with_options(ResolveOptions { - description_files: vec![], - extensions: vec![".json".into()], - main_files: vec!["tsconfig.json".into()], - ..ResolveOptions::default() - }) - .load_package_self_or_node_modules(directory, specifier, &mut Ctx::default()) - .map(|p| p.to_path_buf()) - .map_err(|err| match err { - ResolveError::NotFound(_) => { - ResolveError::TsconfigNotFound(PathBuf::from(specifier)) - } - _ => err, - }), - } - } - - /// PACKAGE_RESOLVE(packageSpecifier, parentURL) - fn package_resolve( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - let (package_name, subpath) = Self::parse_package_specifier(specifier); - - // 3. If packageSpecifier is a Node.js builtin module name, then - // 1. Return the string "node:" concatenated with packageSpecifier. - self.require_core(package_name)?; - - // 11. While parentURL is not the file system root, - for module_name in &self.options.modules { - for cached_path in std::iter::successors(Some(cached_path), |p| p.parent()) { - // 1. Let packageURL be the URL resolution of "node_modules/" concatenated with packageSpecifier, relative to parentURL. - let Some(cached_path) = self.get_module_directory(cached_path, module_name, ctx) - else { - continue; - }; - // 2. Set parentURL to the parent folder URL of parentURL. - let package_path = cached_path.path().normalize_with(package_name); - let cached_path = self.cache.value(&package_path); - // 3. If the folder at packageURL does not exist, then - // 1. Continue the next loop iteration. - if cached_path.is_dir(&self.cache.fs, ctx) { - // 4. Let pjson be the result of READ_PACKAGE_JSON(packageURL). - if let Some(package_json) = - cached_path.package_json(&self.cache.fs, &self.options, ctx)? - { - // 5. If pjson is not null and pjson.exports is not null or undefined, then - // 1. Return the result of PACKAGE_EXPORTS_RESOLVE(packageURL, packageSubpath, pjson.exports, defaultConditions). - for exports in package_json.exports_fields(&self.options.exports_fields) { - if let Some(path) = self.package_exports_resolve( - cached_path.path(), - &format!(".{subpath}"), - exports, - ctx, - )? { - return Ok(Some(path)); - } - } - // 6. Otherwise, if packageSubpath is equal to ".", then - if subpath == "." { - // 1. If pjson.main is a string, then - for main_field in package_json.main_fields(&self.options.main_fields) { - // 1. Return the URL resolution of main in packageURL. - let path = cached_path.path().normalize_with(main_field); - let cached_path = self.cache.value(&path); - if cached_path.is_file(&self.cache.fs, ctx) { - return Ok(Some(cached_path)); - } - } - } - } - let subpath = format!(".{subpath}"); - ctx.with_fully_specified(false); - return self.require(&cached_path, &subpath, ctx).map(Some); - } - } - } - - Err(ResolveError::NotFound(specifier.to_string())) - } - - /// PACKAGE_EXPORTS_RESOLVE(packageURL, subpath, exports, conditions) - fn package_exports_resolve( - &self, - package_url: &Path, - subpath: &str, - exports: &JSONValue, - ctx: &mut Ctx, - ) -> ResolveResult { - let conditions = &self.options.condition_names; - // 1. If exports is an Object with both a key starting with "." and a key not starting with ".", throw an Invalid Package Configuration error. - if let JSONValue::Object(map) = exports { - let mut has_dot = false; - let mut without_dot = false; - for key in map.keys() { - let starts_with_dot_or_hash = key.starts_with(['.', '#']); - has_dot = has_dot || starts_with_dot_or_hash; - without_dot = without_dot || !starts_with_dot_or_hash; - if has_dot && without_dot { - return Err(ResolveError::InvalidPackageConfig( - package_url.join("package.json"), - )); - } - } - } - // 2. If subpath is equal to ".", then - // Note: subpath is not prepended with a dot when passed in. - if subpath == "." { - // enhanced-resolve appends query and fragment when resolving exports field - // https://github.com/webpack/enhanced-resolve/blob/a998c7d218b7a9ec2461fc4fddd1ad5dd7687485/lib/ExportsFieldPlugin.js#L57-L62 - // This is only need when querying the main export, otherwise ctx is passed through. - if ctx.query.is_some() || ctx.fragment.is_some() { - let query = ctx.query.clone().unwrap_or_default(); - let fragment = ctx.fragment.clone().unwrap_or_default(); - return Err(ResolveError::PackagePathNotExported( - format!("./{}{query}{fragment}", subpath.trim_start_matches('.')), - package_url.join("package.json"), - )); - } - // 1. Let mainExport be undefined. - let main_export = match exports { - // 2. If exports is a String or Array, or an Object containing no keys starting with ".", then - JSONValue::String(_) | JSONValue::Array(_) => { - // 1. Set mainExport to exports. - Some(exports) - } - // 3. Otherwise if exports is an Object containing a "." property, then - JSONValue::Object(map) => { - // 1. Set mainExport to exports["."]. - map.get(".").map_or_else( - || { - if map.keys().any(|key| key.starts_with("./") || key.starts_with('#')) { - None - } else { - Some(exports) - } - }, - Some, - ) - } - _ => None, - }; - // 4. If mainExport is not undefined, then - if let Some(main_export) = main_export { - // 1. Let resolved be the result of PACKAGE_TARGET_RESOLVE( packageURL, mainExport, null, false, conditions). - let resolved = self.package_target_resolve( - package_url, - ".", - main_export, - None, - /* is_imports */ false, - conditions, - ctx, - )?; - // 2. If resolved is not null or undefined, return resolved. - if let Some(path) = resolved { - return Ok(Some(path)); - } - } - } - // 3. Otherwise, if exports is an Object and all keys of exports start with ".", then - if let JSONValue::Object(exports) = exports { - // 1. Let matchKey be the string "./" concatenated with subpath. - // Note: `package_imports_exports_resolve` does not require the leading dot. - let match_key = &subpath; - // 2. Let resolved be the result of PACKAGE_IMPORTS_EXPORTS_RESOLVE( matchKey, exports, packageURL, false, conditions). - if let Some(path) = self.package_imports_exports_resolve( - match_key, - exports, - package_url, - /* is_imports */ false, - conditions, - ctx, - )? { - // 3. If resolved is not null or undefined, return resolved. - return Ok(Some(path)); - } - } - // 4. Throw a Package Path Not Exported error. - Err(ResolveError::PackagePathNotExported( - subpath.to_string(), - package_url.join("package.json"), - )) - } - - /// PACKAGE_IMPORTS_RESOLVE(specifier, parentURL, conditions) - fn package_imports_resolve( - &self, - specifier: &str, - package_json: &PackageJson, - ctx: &mut Ctx, - ) -> Result, ResolveError> { - // 1. Assert: specifier begins with "#". - debug_assert!(specifier.starts_with('#'), "{specifier}"); - // 2. If specifier is exactly equal to "#" or starts with "#/", then - // 1. Throw an Invalid Module Specifier error. - // 3. Let packageURL be the result of LOOKUP_PACKAGE_SCOPE(parentURL). - // 4. If packageURL is not null, then - - // 1. Let pjson be the result of READ_PACKAGE_JSON(packageURL). - // 2. If pjson.imports is a non-null Object, then - - // 1. Let resolved be the result of PACKAGE_IMPORTS_EXPORTS_RESOLVE( specifier, pjson.imports, packageURL, true, conditions). - let mut has_imports = false; - for imports in package_json.imports_fields(&self.options.imports_fields) { - if !has_imports { - has_imports = true; - // TODO: fill in test case for this case - if specifier == "#" || specifier.starts_with("#/") { - return Err(ResolveError::InvalidModuleSpecifier( - specifier.to_string(), - package_json.path.clone(), - )); - } - } - if let Some(path) = self.package_imports_exports_resolve( - specifier, - imports, - package_json.directory(), - /* is_imports */ true, - &self.options.condition_names, - ctx, - )? { - // 2. If resolved is not null or undefined, return resolved. - return Ok(Some(path)); - } - } - - // 5. Throw a Package Import Not Defined error. - if has_imports { - Err(ResolveError::PackageImportNotDefined( - specifier.to_string(), - package_json.path.clone(), - )) - } else { - Ok(None) - } - } - - /// PACKAGE_IMPORTS_EXPORTS_RESOLVE(matchKey, matchObj, packageURL, isImports, conditions) - fn package_imports_exports_resolve( - &self, - match_key: &str, - match_obj: &JSONMap, - package_url: &Path, - is_imports: bool, - conditions: &[String], - ctx: &mut Ctx, - ) -> ResolveResult { - // enhanced-resolve behaves differently, it throws - // Error: CachedPath to directories is not possible with the exports field (specifier was ./dist/) - if match_key.ends_with('/') { - return Ok(None); - } - // 1. If matchKey is a key of matchObj and does not contain "*", then - if !match_key.contains('*') { - // 1. Let target be the value of matchObj[matchKey]. - if let Some(target) = match_obj.get(match_key) { - // 2. Return the result of PACKAGE_TARGET_RESOLVE(packageURL, target, null, isImports, conditions). - return self.package_target_resolve( - package_url, - match_key, - target, - None, - is_imports, - conditions, - ctx, - ); - } - } - - let mut best_target = None; - let mut best_match = ""; - let mut best_key = ""; - // 2. Let expansionKeys be the list of keys of matchObj containing only a single "*", sorted by the sorting function PATTERN_KEY_COMPARE which orders in descending order of specificity. - // 3. For each key expansionKey in expansionKeys, do - for (expansion_key, target) in match_obj { - if expansion_key.starts_with("./") || expansion_key.starts_with('#') { - // 1. Let patternBase be the substring of expansionKey up to but excluding the first "*" character. - if let Some((pattern_base, pattern_trailer)) = expansion_key.split_once('*') { - // 2. If matchKey starts with but is not equal to patternBase, then - if match_key.starts_with(pattern_base) - // 1. Let patternTrailer be the substring of expansionKey from the index after the first "*" character. - && !pattern_trailer.contains('*') - // 2. If patternTrailer has zero length, or if matchKey ends with patternTrailer and the length of matchKey is greater than or equal to the length of expansionKey, then - && (pattern_trailer.is_empty() - || (match_key.len() >= expansion_key.len() - && match_key.ends_with(pattern_trailer))) - && Self::pattern_key_compare(best_key, expansion_key).is_gt() - { - // 1. Let target be the value of matchObj[expansionKey]. - best_target = Some(target); - // 2. Let patternMatch be the substring of matchKey starting at the index of the length of patternBase up to the length of matchKey minus the length of patternTrailer. - best_match = - &match_key[pattern_base.len()..match_key.len() - pattern_trailer.len()]; - best_key = expansion_key; - } - } else if expansion_key.ends_with('/') - && match_key.starts_with(expansion_key) - && Self::pattern_key_compare(best_key, expansion_key).is_gt() - { - // TODO: [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./dist/" in the "exports" field module resolution of the package at xxx/package.json. - best_target = Some(target); - best_match = &match_key[expansion_key.len()..]; - best_key = expansion_key; - } - } - } - if let Some(best_target) = best_target { - // 3. Return the result of PACKAGE_TARGET_RESOLVE(packageURL, target, patternMatch, isImports, conditions). - return self.package_target_resolve( - package_url, - best_key, - best_target, - Some(best_match), - is_imports, - conditions, - ctx, - ); - } - // 4. Return null. - Ok(None) - } - - /// PACKAGE_TARGET_RESOLVE(packageURL, target, patternMatch, isImports, conditions) - #[allow(clippy::too_many_arguments)] - fn package_target_resolve( - &self, - package_url: &Path, - target_key: &str, - target: &JSONValue, - pattern_match: Option<&str>, - is_imports: bool, - conditions: &[String], - ctx: &mut Ctx, - ) -> ResolveResult { - fn normalize_string_target<'a>( - target_key: &'a str, - target: &'a str, - pattern_match: Option<&'a str>, - package_url: &Path, - ) -> Result, ResolveError> { - let target = if let Some(pattern_match) = pattern_match { - if !target_key.contains('*') && !target.contains('*') { - // enhanced-resolve behaviour - // TODO: [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./dist/" in the "exports" field module resolution of the package at xxx/package.json. - if target_key.ends_with('/') && target.ends_with('/') { - Cow::Owned(format!("{target}{pattern_match}")) - } else { - return Err(ResolveError::InvalidPackageConfigDirectory( - package_url.join("package.json"), - )); - } - } else { - Cow::Owned(target.replace('*', pattern_match)) - } - } else { - Cow::Borrowed(target) - }; - Ok(target) - } - - match target { - // 1. If target is a String, then - JSONValue::String(target) => { - // 1. If target does not start with "./", then - if !target.starts_with("./") { - // 1. If isImports is false, or if target starts with "../" or "/", or if target is a valid URL, then - if !is_imports || target.starts_with("../") || target.starts_with('/') { - // 1. Throw an Invalid Package Target error. - return Err(ResolveError::InvalidPackageTarget( - target.to_string(), - target_key.to_string(), - package_url.join("package.json"), - )); - } - // 2. If patternMatch is a String, then - // 1. Return PACKAGE_RESOLVE(target with every instance of "*" replaced by patternMatch, packageURL + "/"). - let target = - normalize_string_target(target_key, target, pattern_match, package_url)?; - let package_url = self.cache.value(package_url); - // // 3. Return PACKAGE_RESOLVE(target, packageURL + "/"). - return self.package_resolve(&package_url, &target, ctx); - } - - // 2. If target split on "/" or "\" contains any "", ".", "..", or "node_modules" segments after the first "." segment, case insensitive and including percent encoded variants, throw an Invalid Package Target error. - // 3. Let resolvedTarget be the URL resolution of the concatenation of packageURL and target. - // 4. Assert: resolvedTarget is contained in packageURL. - // 5. If patternMatch is null, then - let target = - normalize_string_target(target_key, target, pattern_match, package_url)?; - if Path::new(target.as_ref()).is_invalid_exports_target() { - return Err(ResolveError::InvalidPackageTarget( - target.to_string(), - target_key.to_string(), - package_url.join("package.json"), - )); - } - let resolved_target = package_url.normalize_with(target.as_ref()); - // 6. If patternMatch split on "/" or "\" contains any "", ".", "..", or "node_modules" segments, case insensitive and including percent encoded variants, throw an Invalid Module Specifier error. - // 7. Return the URL resolution of resolvedTarget with every instance of "*" replaced with patternMatch. - let value = self.cache.value(&resolved_target); - return Ok(Some(value)); - } - // 2. Otherwise, if target is a non-null Object, then - JSONValue::Object(target) => { - // 1. If exports contains any index property keys, as defined in ECMA-262 6.1.7 Array Index, throw an Invalid Package Configuration error. - // 2. For each property p of target, in object insertion order as, - for (key, target_value) in target { - // 1. If p equals "default" or conditions contains an entry for p, then - if key == "default" || conditions.contains(key) { - // 1. Let targetValue be the value of the p property in target. - // 2. Let resolved be the result of PACKAGE_TARGET_RESOLVE( packageURL, targetValue, patternMatch, isImports, conditions). - let resolved = self.package_target_resolve( - package_url, - target_key, - target_value, - pattern_match, - is_imports, - conditions, - ctx, - ); - // 3. If resolved is equal to undefined, continue the loop. - if let Some(path) = resolved? { - // 4. Return resolved. - return Ok(Some(path)); - } - } - } - // 3. Return undefined. - return Ok(None); - } - // 3. Otherwise, if target is an Array, then - JSONValue::Array(targets) => { - // 1. If _target.length is zero, return null. - if targets.is_empty() { - // Note: return PackagePathNotExported has the same effect as return because there are no matches. - return Err(ResolveError::PackagePathNotExported( - pattern_match.unwrap_or(".").to_string(), - package_url.join("package.json"), - )); - } - // 2. For each item targetValue in target, do - for (i, target_value) in targets.iter().enumerate() { - // 1. Let resolved be the result of PACKAGE_TARGET_RESOLVE( packageURL, targetValue, patternMatch, isImports, conditions), continuing the loop on any Invalid Package Target error. - let resolved = self.package_target_resolve( - package_url, - target_key, - target_value, - pattern_match, - is_imports, - conditions, - ctx, - ); - - if resolved.is_err() && i == targets.len() { - return resolved; - } - - // 2. If resolved is undefined, continue the loop. - if let Ok(Some(path)) = resolved { - // 3. Return resolved. - return Ok(Some(path)); - } - } - // 3. Return or throw the last fallback resolution null return or error. - // Note: see `resolved.is_err() && i == targets.len()` - } - _ => {} - } - // 4. Otherwise, if target is null, return null. - Ok(None) - // 5. Otherwise throw an Invalid Package Target error. - } - - // Returns (module, subpath) - // https://github.com/nodejs/node/blob/8f0f17e1e3b6c4e58ce748e06343c5304062c491/lib/internal/modules/esm/resolve.js#L688 - fn parse_package_specifier(specifier: &str) -> (&str, &str) { - let mut separator_index = specifier.as_bytes().iter().position(|b| *b == b'/'); - // let mut valid_package_name = true; - // let mut is_scoped = false; - if specifier.starts_with('@') { - // is_scoped = true; - if separator_index.is_none() || specifier.is_empty() { - // valid_package_name = false; - } else if let Some(index) = &separator_index { - separator_index = specifier[*index + 1..] - .as_bytes() - .iter() - .position(|b| *b == b'/') - .map(|i| i + *index + 1); - } - } - let package_name = - separator_index.map_or(specifier, |separator_index| &specifier[..separator_index]); - - // TODO: https://github.com/nodejs/node/blob/8f0f17e1e3b6c4e58ce748e06343c5304062c491/lib/internal/modules/esm/resolve.js#L705C1-L714C1 - // Package name cannot have leading . and cannot have percent-encoding or - // \\ separators. - // if (RegExpPrototypeExec(invalidPackageNameRegEx, packageName) !== null) - // validPackageName = false; - - // if (!validPackageName) { - // throw new ERR_INVALID_MODULE_SPECIFIER( - // specifier, 'is not a valid package name', fileURLToPath(base)); - // } - let package_subpath = - separator_index.map_or("", |separator_index| &specifier[separator_index..]); - (package_name, package_subpath) - } - - /// PATTERN_KEY_COMPARE(keyA, keyB) - fn pattern_key_compare(key_a: &str, key_b: &str) -> Ordering { - if key_a.is_empty() { - return Ordering::Greater; - } - // 1. Assert: keyA ends with "/" or contains only a single "*". - debug_assert!(key_a.ends_with('/') || key_a.match_indices('*').count() == 1, "{key_a}"); - // 2. Assert: keyB ends with "/" or contains only a single "*". - debug_assert!(key_b.ends_with('/') || key_b.match_indices('*').count() == 1, "{key_b}"); - // 3. Let baseLengthA be the index of "*" in keyA plus one, if keyA contains "*", or the length of keyA otherwise. - let a_pos = key_a.chars().position(|c| c == '*'); - let base_length_a = a_pos.map_or(key_a.len(), |p| p + 1); - // 4. Let baseLengthB be the index of "*" in keyB plus one, if keyB contains "*", or the length of keyB otherwise. - let b_pos = key_b.chars().position(|c| c == '*'); - let base_length_b = b_pos.map_or(key_b.len(), |p| p + 1); - // 5. If baseLengthA is greater than baseLengthB, return -1. - if base_length_a > base_length_b { - return Ordering::Less; - } - // 6. If baseLengthB is greater than baseLengthA, return 1. - if base_length_b > base_length_a { - return Ordering::Greater; - } - // 7. If keyA does not contain "*", return 1. - if !key_a.contains('*') { - return Ordering::Greater; - } - // 8. If keyB does not contain "*", return -1. - if !key_b.contains('*') { - return Ordering::Less; - } - // 9. If the length of keyA is greater than the length of keyB, return -1. - if key_a.len() > key_b.len() { - return Ordering::Less; - } - // 10. If the length of keyB is greater than the length of keyA, return 1. - if key_b.len() > key_a.len() { - return Ordering::Greater; - } - // 11. Return 0. - Ordering::Equal - } - - fn strip_package_name<'a>(specifier: &'a str, package_name: &'a str) -> Option<&'a str> { - specifier - .strip_prefix(package_name) - .filter(|tail| tail.is_empty() || tail.starts_with(SLASH_START)) - } -} diff --git a/src/options.rs b/src/options.rs deleted file mode 100644 index 7893890e..00000000 --- a/src/options.rs +++ /dev/null @@ -1,633 +0,0 @@ -use std::path::Path; -use std::{fmt, path::PathBuf}; - -/// Module Resolution Options -/// -/// Options are directly ported from [enhanced-resolve](https://github.com/webpack/enhanced-resolve#resolver-options). -/// -/// See [webpack resolve](https://webpack.js.org/configuration/resolve/) for information and examples -#[derive(Debug, Clone)] -pub struct ResolveOptions { - /// Path to TypeScript configuration file. - /// - /// Default `None` - pub tsconfig: Option, - - /// Create aliases to import or require certain modules more easily. - /// - /// An alias is used to replace a whole path or part of a path. - /// For example, to alias a commonly used `src/` folders: `vec![("@/src"), vec![AliasValue::Path("/path/to/src")]]` - /// - /// A trailing $ can also be added to the given object's keys to signify an exact match. - /// - /// See [webpack's `resolve.alias` documentation](https://webpack.js.org/configuration/resolve/#resolvealias) for a list of use cases. - pub alias: Alias, - - /// A list of alias fields in description files. - /// - /// Specify a field, such as `browser`, to be parsed according to [this specification](https://github.com/defunctzombie/package-browser-field-spec). - /// Can be a path to json object such as `["path", "to", "exports"]`. - /// - /// Default `[]` - pub alias_fields: Vec>, - - /// Condition names for exports field which defines entry points of a package. - /// - /// The key order in the exports field is significant. During condition matching, earlier entries have higher priority and take precedence over later entries. - /// - /// Default `[]` - pub condition_names: Vec, - - /// The JSON files to use for descriptions. (There was once a `bower.json`.) - /// - /// Default `["package.json"]` - pub description_files: Vec, - - /// Set to [EnforceExtension::Enabled] for [ESM Mandatory file extensions](https://nodejs.org/api/esm.html#mandatory-file-extensions). - /// - /// If `enforce_extension` is set to [EnforceExtension::Enabled], resolution will not allow extension-less files. - /// This means `require('./foo.js')` will resolve, while `require('./foo')` will not. - /// - /// The default value for `enforce_extension` is [EnforceExtension::Auto], which is changed upon initialization. - /// - /// It changes to [EnforceExtension::Enabled] if [ResolveOptions::extensions] contains an empty string; - /// otherwise, this value changes to [EnforceExtension::Disabled]. - /// - /// Explicitly set the value to [EnforceExtension::Disabled] to disable this automatic behavior. - /// - /// For reference, this behavior is aligned with `enhanced-resolve`. See . - pub enforce_extension: EnforceExtension, - - /// A list of exports fields in description files. - /// - /// Can be a path to a JSON object such as `["path", "to", "exports"]`. - /// - /// Default `[["exports"]]`. - pub exports_fields: Vec>, - - /// Fields from `package.json` which are used to provide the internal requests of a package - /// (requests starting with # are considered internal). - /// - /// Can be a path to a JSON object such as `["path", "to", "imports"]`. - /// - /// Default `[["imports"]]`. - pub imports_fields: Vec>, - - /// An object which maps extension to extension aliases. - /// - /// Default `{}` - pub extension_alias: Vec<(String, Vec)>, - - /// Attempt to resolve these extensions in order. - /// - /// If multiple files share the same name but have different extensions, - /// will resolve the one with the extension listed first in the array and skip the rest. - /// - /// All extensions must have a leading dot. - /// - /// Default `[".js", ".json", ".node"]` - pub extensions: Vec, - - /// Redirect module requests when normal resolving fails. - /// - /// Default `[]` - pub fallback: Alias, - - /// 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). - /// - /// See also webpack configuration [resolve.fullySpecified](https://webpack.js.org/configuration/module/#resolvefullyspecified) - /// - /// Default `false` - pub fully_specified: bool, - - /// A list of main fields in description files - /// - /// Default `["main"]`. - pub main_fields: Vec, - - /// The filename to be used while resolving directories. - /// - /// Default `["index"]` - pub main_files: Vec, - - /// A list of directories to resolve modules from, can be absolute path or folder name. - /// - /// Default `["node_modules"]` - pub modules: Vec, - - /// A manifest loaded from pnp::load_pnp_manifest. - /// - /// Default `None` - #[cfg(feature = "yarn_pnp")] - pub pnp_manifest: Option, - - /// Resolve to a context instead of a file. - /// - /// Default `false` - pub resolve_to_context: bool, - - /// Prefer to resolve module requests as relative requests instead of using modules from node_modules directories. - /// - /// Default `false` - pub prefer_relative: bool, - - /// Prefer to resolve server-relative urls as absolute paths before falling back to resolve in ResolveOptions::roots. - /// - /// Default `false` - pub prefer_absolute: bool, - - /// A list of resolve restrictions to restrict the paths that a request can be resolved on. - /// - /// Default `[]` - pub restrictions: Vec, - - /// A list of directories where requests of server-relative URLs (starting with '/') are resolved. - /// On non-Windows systems these requests are resolved as an absolute path first. - /// - /// Default `[]` - pub roots: Vec, - - /// Whether to resolve symlinks to their symlinked location. - /// When enabled, symlinked resources are resolved to their real path, not their symlinked location. - /// Note that this may cause module resolution to fail when using tools that symlink packages (like npm link). - /// - /// Default `true` - pub symlinks: bool, - - /// Whether to parse [module.builtinModules](https://nodejs.org/api/module.html#modulebuiltinmodules) or not. - /// For example, "zlib" will throw [crate::ResolveError::Builtin] when set to true. - /// - /// Default `false` - pub builtin_modules: bool, -} - -impl ResolveOptions { - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// - /// let options = ResolveOptions::default().with_condition_names(&["bar"]); - /// assert_eq!(options.condition_names, vec!["bar".to_string()]) - /// ``` - #[must_use] - pub fn with_condition_names(mut self, names: &[&str]) -> Self { - self.condition_names = names.iter().map(ToString::to_string).collect::>(); - self - } - - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// - /// let options = ResolveOptions::default().with_builtin_modules(false); - /// assert_eq!(options.builtin_modules, false) - /// ``` - #[must_use] - pub fn with_builtin_modules(mut self, flag: bool) -> Self { - self.builtin_modules = flag; - self - } - - /// Adds a single root to the options - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_root("foo"); - /// assert_eq!(options.roots, vec![PathBuf::from("foo")]) - /// ``` - #[must_use] - pub fn with_root>(mut self, root: P) -> Self { - self.roots.push(root.as_ref().to_path_buf()); - self - } - - /// Adds a single extension to the list of extensions - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_extension("jsonc"); - /// assert!(options.extensions.contains(&"jsonc".to_string())); - /// ``` - #[must_use] - pub fn with_extension>(mut self, extension: S) -> Self { - self.extensions.push(extension.into()); - self - } - - /// Adds a single main field to the list of fields - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_main_field("something"); - /// assert!(options.main_fields.contains(&"something".to_string())); - /// ``` - #[must_use] - pub fn with_main_field>(mut self, field: S) -> Self { - self.main_fields.push(field.into()); - self - } - - /// Changes how the extension should be treated - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions, EnforceExtension}; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_force_extension(EnforceExtension::Enabled); - /// assert_eq!(options.enforce_extension, EnforceExtension::Enabled); - /// ``` - #[must_use] - pub fn with_force_extension(mut self, enforce_extension: EnforceExtension) -> Self { - self.enforce_extension = enforce_extension; - self - } - - /// Sets the value for [ResolveOptions::fully_specified] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_fully_specified(true); - /// assert_eq!(options.fully_specified, true); - /// ``` - #[must_use] - pub fn with_fully_specified(mut self, fully_specified: bool) -> Self { - self.fully_specified = fully_specified; - self - } - /// Sets the value for [ResolveOptions::prefer_relative] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_prefer_relative(true); - /// assert_eq!(options.prefer_relative, true); - /// ``` - #[must_use] - pub fn with_prefer_relative(mut self, flag: bool) -> Self { - self.prefer_relative = flag; - self - } - /// Sets the value for [ResolveOptions::prefer_absolute] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_prefer_absolute(true); - /// assert_eq!(options.prefer_absolute, true); - /// ``` - #[must_use] - pub fn with_prefer_absolute(mut self, flag: bool) -> Self { - self.prefer_absolute = flag; - self - } - - /// Changes the value of [ResolveOptions::symlinks] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// - /// let options = ResolveOptions::default().with_symbolic_link(false); - /// assert_eq!(options.symlinks, false); - /// ``` - #[must_use] - pub fn with_symbolic_link(mut self, flag: bool) -> Self { - self.symlinks = flag; - self - } - - /// Adds a module to [ResolveOptions::modules] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// - /// let options = ResolveOptions::default().with_module("module"); - /// assert!(options.modules.contains(&"module".to_string())); - /// ``` - #[must_use] - pub fn with_module>(mut self, module: M) -> Self { - self.modules.push(module.into()); - self - } - - /// Adds a main file to [ResolveOptions::main_files] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// - /// let options = ResolveOptions::default().with_main_file("foo"); - /// assert!(options.main_files.contains(&"foo".to_string())); - /// ``` - #[must_use] - pub fn with_main_file>(mut self, module: M) -> Self { - self.main_files.push(module.into()); - self - } - - pub(crate) fn sanitize(mut self) -> Self { - debug_assert!( - self.extensions.iter().filter(|e| !e.is_empty()).all(|e| e.starts_with('.')), - "All extensions must start with a leading dot" - ); - // Set `enforceExtension` to `true` when [ResolveOptions::extensions] contains an empty string. - // See - if self.enforce_extension == EnforceExtension::Auto { - if !self.extensions.is_empty() && self.extensions.iter().any(String::is_empty) { - self.enforce_extension = EnforceExtension::Enabled; - } else { - self.enforce_extension = EnforceExtension::Disabled; - } - } - self - } -} - -/// Value for [ResolveOptions::enforce_extension] -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -pub enum EnforceExtension { - Auto, - Enabled, - Disabled, -} - -impl EnforceExtension { - pub const fn is_auto(&self) -> bool { - matches!(self, Self::Auto) - } - - pub const fn is_enabled(&self) -> bool { - matches!(self, Self::Enabled) - } - - pub const fn is_disabled(&self) -> bool { - matches!(self, Self::Disabled) - } -} - -/// Alias for [ResolveOptions::alias] and [ResolveOptions::fallback] -pub type Alias = Vec<(String, Vec)>; - -/// Alias Value for [ResolveOptions::alias] and [ResolveOptions::fallback] -#[derive(Debug, Clone, Hash, PartialEq, Eq)] -pub enum AliasValue { - /// The path value - Path(String), - - /// The `false` value - Ignore, -} - -impl From for AliasValue -where - S: Into, -{ - fn from(value: S) -> Self { - Self::Path(value.into()) - } -} - -/// Value for [ResolveOptions::restrictions] -#[derive(Debug, Clone)] -pub enum Restriction { - Path(PathBuf), - RegExp(String), -} - -/// Tsconfig Options for [ResolveOptions::tsconfig] -/// -/// Derived from [tsconfig-paths-webpack-plugin](https://github.com/dividab/tsconfig-paths-webpack-plugin#options) -#[derive(Debug, Clone)] -pub struct TsconfigOptions { - /// Allows you to specify where to find the TypeScript configuration file. - /// You may provide - /// * a relative path to the configuration file. It will be resolved relative to cwd. - /// * an absolute path to the configuration file. - pub config_file: PathBuf, - - /// Support for Typescript Project References. - pub references: TsconfigReferences, -} - -/// Configuration for [TsconfigOptions::references] -#[derive(Debug, Clone)] -pub enum TsconfigReferences { - Disabled, - /// Use the `references` field from tsconfig of `config_file`. - Auto, - /// Manually provided relative or absolute path. - Paths(Vec), -} - -impl Default for ResolveOptions { - fn default() -> Self { - Self { - tsconfig: None, - alias: vec![], - alias_fields: vec![], - condition_names: vec![], - description_files: vec!["package.json".into()], - enforce_extension: EnforceExtension::Auto, - extension_alias: vec![], - exports_fields: vec![vec!["exports".into()]], - imports_fields: vec![vec!["imports".into()]], - extensions: vec![".js".into(), ".json".into(), ".node".into()], - fallback: vec![], - fully_specified: false, - main_fields: vec!["main".into()], - main_files: vec!["index".into()], - modules: vec!["node_modules".into()], - #[cfg(feature = "yarn_pnp")] - pnp_manifest: None, - resolve_to_context: false, - prefer_relative: false, - prefer_absolute: false, - restrictions: vec![], - roots: vec![], - symlinks: true, - builtin_modules: false, - } - } -} - -// For tracing -impl fmt::Display for ResolveOptions { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - if let Some(tsconfig) = &self.tsconfig { - write!(f, "tsconfig:{tsconfig:?},")?; - } - if !self.alias.is_empty() { - write!(f, "alias:{:?},", self.alias)?; - } - if !self.alias_fields.is_empty() { - write!(f, "alias_fields:{:?},", self.alias_fields)?; - } - if !self.condition_names.is_empty() { - write!(f, "condition_names:{:?},", self.condition_names)?; - } - if self.enforce_extension.is_enabled() { - write!(f, "enforce_extension:{:?},", self.enforce_extension)?; - } - if !self.exports_fields.is_empty() { - write!(f, "exports_fields:{:?},", self.exports_fields)?; - } - if !self.imports_fields.is_empty() { - write!(f, "imports_fields:{:?},", self.imports_fields)?; - } - if !self.extension_alias.is_empty() { - write!(f, "extension_alias:{:?},", self.extension_alias)?; - } - if !self.extensions.is_empty() { - write!(f, "extensions:{:?},", self.extensions)?; - } - if !self.fallback.is_empty() { - write!(f, "fallback:{:?},", self.fallback)?; - } - if self.fully_specified { - write!(f, "fully_specified:{:?},", self.fully_specified)?; - } - if !self.main_fields.is_empty() { - write!(f, "main_fields:{:?},", self.main_fields)?; - } - if !self.main_files.is_empty() { - write!(f, "main_files:{:?},", self.main_files)?; - } - if !self.modules.is_empty() { - write!(f, "modules:{:?},", self.modules)?; - } - if self.resolve_to_context { - write!(f, "resolve_to_context:{:?},", self.resolve_to_context)?; - } - if self.prefer_relative { - write!(f, "prefer_relative:{:?},", self.prefer_relative)?; - } - if self.prefer_absolute { - write!(f, "prefer_absolute:{:?},", self.prefer_absolute)?; - } - if !self.restrictions.is_empty() { - write!(f, "restrictions:{:?},", self.restrictions)?; - } - if !self.roots.is_empty() { - write!(f, "roots:{:?},", self.roots)?; - } - if self.symlinks { - write!(f, "symlinks:{:?},", self.symlinks)?; - } - if self.builtin_modules { - write!(f, "builtin_modules:{:?},", self.builtin_modules)?; - } - Ok(()) - } -} - -#[cfg(test)] -mod test { - use super::{ - AliasValue, EnforceExtension, ResolveOptions, Restriction, TsconfigOptions, - TsconfigReferences, - }; - use std::path::PathBuf; - - #[test] - fn enforce_extension() { - assert!(EnforceExtension::Auto.is_auto()); - assert!(!EnforceExtension::Enabled.is_auto()); - assert!(!EnforceExtension::Disabled.is_auto()); - - assert!(!EnforceExtension::Auto.is_enabled()); - assert!(EnforceExtension::Enabled.is_enabled()); - assert!(!EnforceExtension::Disabled.is_enabled()); - - assert!(!EnforceExtension::Auto.is_disabled()); - assert!(!EnforceExtension::Enabled.is_disabled()); - assert!(EnforceExtension::Disabled.is_disabled()); - } - - #[test] - fn display() { - let options = ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: PathBuf::from("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - alias: vec![("a".into(), vec![AliasValue::Ignore])], - alias_fields: vec![vec!["browser".into()]], - condition_names: vec!["require".into()], - enforce_extension: EnforceExtension::Enabled, - extension_alias: vec![(".js".into(), vec![".ts".into()])], - exports_fields: vec![vec!["exports".into()]], - imports_fields: vec![vec!["imports".into()]], - fallback: vec![("fallback".into(), vec![AliasValue::Ignore])], - fully_specified: true, - resolve_to_context: true, - prefer_relative: true, - prefer_absolute: true, - restrictions: vec![Restriction::Path(PathBuf::from("restrictions"))], - roots: vec![PathBuf::from("roots")], - builtin_modules: true, - ..ResolveOptions::default() - }; - - let expected = r#"tsconfig:TsconfigOptions { config_file: "tsconfig.json", references: Auto },alias:[("a", [Ignore])],alias_fields:[["browser"]],condition_names:["require"],enforce_extension:Enabled,exports_fields:[["exports"]],imports_fields:[["imports"]],extension_alias:[(".js", [".ts"])],extensions:[".js", ".json", ".node"],fallback:[("fallback", [Ignore])],fully_specified:true,main_fields:["main"],main_files:["index"],modules:["node_modules"],resolve_to_context:true,prefer_relative:true,prefer_absolute:true,restrictions:[Path("restrictions")],roots:["roots"],symlinks:true,builtin_modules:true,"#; - assert_eq!(format!("{options}"), expected); - - let options = ResolveOptions { - alias: vec![], - alias_fields: vec![], - builtin_modules: false, - condition_names: vec![], - description_files: vec![], - enforce_extension: EnforceExtension::Disabled, - exports_fields: vec![], - extension_alias: vec![], - extensions: vec![], - fallback: vec![], - fully_specified: false, - imports_fields: vec![], - main_fields: vec![], - main_files: vec![], - modules: vec![], - #[cfg(feature = "yarn_pnp")] - pnp_manifest: None, - prefer_absolute: false, - prefer_relative: false, - resolve_to_context: false, - restrictions: vec![], - roots: vec![], - symlinks: false, - tsconfig: None, - }; - - assert_eq!(format!("{options}"), ""); - } -} diff --git a/src/package_json.rs b/src/package_json.rs deleted file mode 100644 index 7e05d202..00000000 --- a/src/package_json.rs +++ /dev/null @@ -1,219 +0,0 @@ -//! package.json definitions -//! -//! Code related to export field are copied from [Parcel's resolver](https://github.com/parcel-bundler/parcel/blob/v2/packages/utils/node-resolver-rs/src/package_json.rs) -use std::path::{Path, PathBuf}; - -use serde_json::Value as JSONValue; - -use crate::{path::PathUtil, ResolveError}; - -pub type JSONMap = serde_json::Map; - -/// Deserialized package.json -#[derive(Debug, Default)] -pub struct PackageJson { - /// Path to `package.json`. Contains the `package.json` filename. - pub path: PathBuf, - - /// Realpath to `package.json`. Contains the `package.json` filename. - pub realpath: PathBuf, - - /// The "name" field defines your package's name. - /// The "name" field can be used in addition to the "exports" field to self-reference a package using its name. - /// - /// - pub name: Option, - - /// The "type" field. - /// - /// - pub r#type: Option, - - /// The "sideEffects" field. - /// - /// - pub side_effects: Option, - - raw_json: std::sync::Arc, -} - -impl PackageJson { - /// # Panics - /// # Errors - pub(crate) fn parse( - path: PathBuf, - realpath: PathBuf, - json: &str, - ) -> Result { - let mut raw_json: JSONValue = serde_json::from_str(json)?; - let mut package_json = Self::default(); - - if let Some(json_object) = raw_json.as_object_mut() { - // Remove large fields that are useless for pragmatic use. - #[cfg(feature = "package_json_raw_json_api")] - { - json_object.remove("description"); - json_object.remove("keywords"); - json_object.remove("scripts"); - json_object.remove("dependencies"); - json_object.remove("devDependencies"); - json_object.remove("peerDependencies"); - json_object.remove("optionalDependencies"); - } - - // Add name, type and sideEffects. - package_json.name = - json_object.get("name").and_then(|field| field.as_str()).map(ToString::to_string); - package_json.r#type = json_object.get("type").cloned(); - package_json.side_effects = json_object.get("sideEffects").cloned(); - } - - package_json.path = path; - package_json.realpath = realpath; - package_json.raw_json = std::sync::Arc::new(raw_json); - Ok(package_json) - } - - fn get_value_by_path<'a>( - fields: &'a serde_json::Map, - path: &[String], - ) -> Option<&'a JSONValue> { - if path.is_empty() { - return None; - } - let mut value = fields.get(&path[0])?; - for key in path.iter().skip(1) { - if let Some(inner_value) = value.as_object().and_then(|o| o.get(key)) { - value = inner_value; - } else { - return None; - } - } - Some(value) - } - - /// Raw serde json value of `package.json`. - /// - /// This is currently used in Rspack for: - /// * getting the `sideEffects` field - /// * query in - search on GitHub indicates query on the `type` field. - /// - /// To reduce overall memory consumption, large fields that useless for pragmatic use are removed. - /// They are: `description`, `keywords`, `scripts`, - /// `dependencies` and `devDependencies`, `peerDependencies`, `optionalDependencies`. - #[cfg(feature = "package_json_raw_json_api")] - pub fn raw_json(&self) -> &std::sync::Arc { - &self.raw_json - } - - /// Directory to `package.json` - /// - /// # Panics - /// - /// * When the package.json path is misconfigured. - pub fn directory(&self) -> &Path { - debug_assert!(self.realpath.file_name().is_some_and(|x| x == "package.json")); - self.realpath.parent().unwrap() - } - - /// The "main" field defines the entry point of a package when imported by name via a node_modules lookup. Its value is a path. - /// - /// When a package has an "exports" field, this will take precedence over the "main" field when importing the package by name. - /// - /// Values are dynamically retrieved from [ResolveOptions::main_fields]. - /// - /// - pub(crate) fn main_fields<'a>( - &'a self, - main_fields: &'a [String], - ) -> impl Iterator + '_ { - main_fields - .iter() - .filter_map(|main_field| self.raw_json.get(main_field)) - .filter_map(|value| value.as_str()) - } - - /// The "exports" field allows defining the entry points of a package when imported by name loaded either via a node_modules lookup or a self-reference to its own name. - /// - /// - pub(crate) fn exports_fields<'a>( - &'a self, - exports_fields: &'a [Vec], - ) -> impl Iterator + '_ { - exports_fields.iter().filter_map(|object_path| { - self.raw_json - .as_object() - .and_then(|json_object| Self::get_value_by_path(json_object, object_path)) - }) - } - - /// In addition to the "exports" field, there is a package "imports" field to create private mappings that only apply to import specifiers from within the package itself. - /// - /// - pub(crate) fn imports_fields<'a>( - &'a self, - imports_fields: &'a [Vec], - ) -> impl Iterator + '_ { - imports_fields.iter().filter_map(|object_path| { - self.raw_json - .as_object() - .and_then(|json_object| Self::get_value_by_path(json_object, object_path)) - .and_then(|value| value.as_object()) - }) - } - - /// The "browser" field is provided by a module author as a hint to javascript bundlers or component tools when packaging modules for client side use. - /// Multiple values are configured by [ResolveOptions::alias_fields]. - /// - /// - fn browser_fields<'a>( - &'a self, - alias_fields: &'a [Vec], - ) -> impl Iterator + '_ { - alias_fields.iter().filter_map(|object_path| { - self.raw_json - .as_object() - .and_then(|json_object| Self::get_value_by_path(json_object, object_path)) - // Only object is valid, all other types are invalid - // https://github.com/webpack/enhanced-resolve/blob/3a28f47788de794d9da4d1702a3a583d8422cd48/lib/AliasFieldPlugin.js#L44-L52 - .and_then(|value| value.as_object()) - }) - } - - /// Resolve the request string for this package.json by looking at the `browser` field. - /// - /// # Errors - /// - /// * Returns [ResolveError::Ignored] for `"path": false` in `browser` field. - pub(crate) fn resolve_browser_field<'a>( - &'a self, - path: &Path, - request: Option<&str>, - alias_fields: &'a [Vec], - ) -> Result, ResolveError> { - for object in self.browser_fields(alias_fields) { - if let Some(request) = request { - if let Some(value) = object.get(request) { - return Self::alias_value(path, value); - } - } else { - let dir = self.path.parent().unwrap(); - for (key, value) in object { - let joined = dir.normalize_with(key); - if joined == path { - return Self::alias_value(path, value); - } - } - } - } - Ok(None) - } - - fn alias_value<'a>(key: &Path, value: &'a JSONValue) -> Result, ResolveError> { - match value { - JSONValue::String(value) => Ok(Some(value.as_str())), - JSONValue::Bool(b) if !b => Err(ResolveError::Ignored(key.to_path_buf())), - _ => Ok(None), - } - } -} diff --git a/src/path.rs b/src/path.rs deleted file mode 100644 index f66fdd76..00000000 --- a/src/path.rs +++ /dev/null @@ -1,132 +0,0 @@ -//! Path Utilities -//! -//! Code adapted from the following libraries -//! * [path-absolutize](https://docs.rs/path-absolutize) -//! * [normalize_path](https://docs.rs/normalize-path) -use std::path::{Component, Path, PathBuf}; - -pub const SLASH_START: &[char; 2] = &['/', '\\']; - -/// Extension trait to add path normalization to std's [`Path`]. -pub trait PathUtil { - /// Normalize this path without performing I/O. - /// - /// All redundant separator and up-level references are collapsed. - /// - /// However, this does not resolve links. - fn normalize(&self) -> PathBuf; - - /// Normalize with subpath assuming this path is normalized without performing I/O. - /// - /// All redundant separator and up-level references are collapsed. - /// - /// However, this does not resolve links. - fn normalize_with>(&self, subpath: P) -> PathBuf; - - /// Defined in ESM PACKAGE_TARGET_RESOLVE - /// If target split on "/" or "\" contains any "", ".", "..", or "node_modules" segments after the first "." segment, case insensitive and including percent encoded variants - fn is_invalid_exports_target(&self) -> bool; -} - -impl PathUtil for Path { - // https://github.com/parcel-bundler/parcel/blob/e0b99c2a42e9109a9ecbd6f537844a1b33e7faf5/packages/utils/node-resolver-rs/src/path.rs#L7 - fn normalize(&self) -> PathBuf { - let mut components = self.components().peekable(); - let mut ret = if let Some(c @ Component::Prefix(..)) = components.peek() { - let buf = PathBuf::from(c.as_os_str()); - components.next(); - buf - } else { - PathBuf::new() - }; - - for component in components { - match component { - Component::Prefix(..) => unreachable!("Path {:?}", self), - Component::RootDir => { - ret.push(component.as_os_str()); - } - Component::CurDir => {} - Component::ParentDir => { - ret.pop(); - } - Component::Normal(c) => { - ret.push(c); - } - } - } - - ret - } - - // https://github.com/parcel-bundler/parcel/blob/e0b99c2a42e9109a9ecbd6f537844a1b33e7faf5/packages/utils/node-resolver-rs/src/path.rs#L37 - fn normalize_with>(&self, subpath: B) -> PathBuf { - let subpath = subpath.as_ref(); - - let mut components = subpath.components(); - - let Some(head) = components.next() else { return subpath.to_path_buf() }; - - if matches!(head, Component::Prefix(..) | Component::RootDir) { - return subpath.to_path_buf(); - } - - let mut ret = self.to_path_buf(); - for component in std::iter::once(head).chain(components) { - match component { - Component::CurDir => {} - Component::ParentDir => { - ret.pop(); - } - Component::Normal(c) => { - ret.push(c); - } - Component::Prefix(..) | Component::RootDir => { - unreachable!("Path {:?} Subpath {:?}", self, subpath) - } - } - } - - ret - } - - fn is_invalid_exports_target(&self) -> bool { - self.components().enumerate().any(|(index, c)| match c { - Component::ParentDir => true, - Component::CurDir => index > 0, - Component::Normal(c) => c.eq_ignore_ascii_case("node_modules"), - _ => false, - }) - } -} - -// https://github.com/webpack/enhanced-resolve/blob/main/test/path.test.js -#[test] -fn is_invalid_exports_target() { - let test_cases = [ - "../a.js", - "../", - "./a/b/../../../c.js", - "./a/b/../../../", - "./../../c.js", - "./../../", - "./a/../b/../../c.js", - "./a/../b/../../", - "./././../", - ]; - - for case in test_cases { - assert!(Path::new(case).is_invalid_exports_target(), "{case}"); - } - - assert!(!Path::new("C:").is_invalid_exports_target()); - assert!(!Path::new("/").is_invalid_exports_target()); -} - -#[test] -fn normalize() { - assert_eq!(Path::new("/foo/.././foo/").normalize(), Path::new("/foo")); - assert_eq!(Path::new("C://").normalize(), Path::new("C://")); - assert_eq!(Path::new("C:").normalize(), Path::new("C:")); - assert_eq!(Path::new(r"\\server\share").normalize(), Path::new(r"\\server\share")); -} diff --git a/src/resolution.rs b/src/resolution.rs deleted file mode 100644 index a3aaa2e7..00000000 --- a/src/resolution.rs +++ /dev/null @@ -1,92 +0,0 @@ -use crate::package_json::PackageJson; -use std::{ - fmt, - path::{Path, PathBuf}, - sync::Arc, -}; - -/// The final path resolution with optional `?query` and `#fragment` -#[derive(Clone)] -pub struct Resolution { - pub(crate) path: PathBuf, - - /// path query `?query`, contains `?`. - pub(crate) query: Option, - - /// path fragment `#query`, contains `#`. - pub(crate) fragment: Option, - - pub(crate) package_json: Option>, -} - -impl fmt::Debug for Resolution { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - f.debug_struct("Resolution") - .field("path", &self.path) - .field("query", &self.query) - .field("fragment", &self.fragment) - .field("package_json", &self.package_json.as_ref().map(|p| &p.path)) - .finish() - } -} - -impl PartialEq for Resolution { - fn eq(&self, other: &Self) -> bool { - self.path == other.path && self.query == other.query && self.fragment == other.fragment - } -} -impl Eq for Resolution {} - -impl Resolution { - /// Returns the path without query and fragment - pub fn path(&self) -> &Path { - &self.path - } - - /// Returns the path without query and fragment - pub fn into_path_buf(self) -> PathBuf { - self.path - } - - /// Returns the path query `?query`, contains the leading `?` - pub fn query(&self) -> Option<&str> { - self.query.as_deref() - } - - /// Returns the path fragment `#fragment`, contains the leading `#` - pub fn fragment(&self) -> Option<&str> { - self.fragment.as_deref() - } - - /// Returns serialized package_json - pub fn package_json(&self) -> Option<&Arc> { - self.package_json.as_ref() - } - - /// Returns the full path with query and fragment - pub fn full_path(&self) -> PathBuf { - let mut path = self.path.clone().into_os_string(); - if let Some(query) = &self.query { - path.push(query); - } - if let Some(fragment) = &self.fragment { - path.push(fragment); - } - PathBuf::from(path) - } -} - -#[test] -fn test() { - let resolution = Resolution { - path: PathBuf::from("foo"), - query: Some("?query".to_string()), - fragment: Some("#fragment".to_string()), - package_json: None, - }; - assert_eq!(resolution.path(), Path::new("foo")); - assert_eq!(resolution.query(), Some("?query")); - assert_eq!(resolution.fragment(), Some("#fragment")); - assert_eq!(resolution.full_path(), PathBuf::from("foo?query#fragment")); - assert_eq!(resolution.into_path_buf(), PathBuf::from("foo")); -} diff --git a/src/specifier.rs b/src/specifier.rs deleted file mode 100644 index 73ed038c..00000000 --- a/src/specifier.rs +++ /dev/null @@ -1,230 +0,0 @@ -use crate::error::SpecifierError; -use std::borrow::Cow; - -#[derive(Debug)] -pub struct Specifier<'a> { - path: Cow<'a, str>, - pub query: Option<&'a str>, - pub fragment: Option<&'a str>, -} - -impl<'a> Specifier<'a> { - pub fn path(&'a self) -> &'a str { - self.path.as_ref() - } - - pub fn parse(specifier: &'a str) -> Result { - if specifier.is_empty() { - return Err(SpecifierError::Empty(specifier.to_string())); - } - let offset = match specifier.as_bytes()[0] { - b'/' | b'.' | b'#' => 1, - _ => 0, - }; - let (path, query, fragment) = Self::parse_query_framgment(specifier, offset); - if path.is_empty() { - return Err(SpecifierError::Empty(specifier.to_string())); - } - Ok(Self { path, query, fragment }) - } - - fn parse_query_framgment( - specifier: &'a str, - skip: usize, - ) -> (Cow<'a, str>, Option<&str>, Option<&str>) { - let mut query_start: Option = None; - let mut fragment_start: Option = None; - - let mut prev = specifier.chars().next().unwrap(); - let mut escaped_indexes = vec![]; - for (i, c) in specifier.char_indices().skip(skip) { - if c == '?' && query_start.is_none() { - query_start = Some(i); - } - if c == '#' { - if prev == '\0' { - escaped_indexes.push(i - 1); - } else { - fragment_start = Some(i); - break; - } - } - prev = c; - } - - let (path, query, fragment) = match (query_start, fragment_start) { - (Some(i), Some(j)) => { - debug_assert!(i < j); - (&specifier[..i], Some(&specifier[i..j]), Some(&specifier[j..])) - } - (Some(i), None) => (&specifier[..i], Some(&specifier[i..]), None), - (None, Some(j)) => (&specifier[..j], None, Some(&specifier[j..])), - _ => (specifier, None, None), - }; - - let path = if escaped_indexes.is_empty() { - Cow::Borrowed(path) - } else { - // Remove the `\0` characters for a legal path. - Cow::Owned( - path.chars() - .enumerate() - .filter_map(|(i, c)| (!escaped_indexes.contains(&i)).then_some(c)) - .collect::(), - ) - }; - - (path, query, fragment) - } -} - -#[cfg(test)] -mod tests { - use super::{Specifier, SpecifierError}; - - #[test] - fn debug() { - let specifier = Specifier::parse("/").unwrap(); - assert_eq!( - format!("{specifier:?}"), - r#"Specifier { path: "/", query: None, fragment: None }"# - ); - } - - #[test] - fn empty() { - let specifiers = ["", "?"]; - for specifier in specifiers { - let error = Specifier::parse(specifier).unwrap_err(); - assert_eq!(error, SpecifierError::Empty(specifier.to_string())); - } - } - - #[test] - fn absolute() -> Result<(), SpecifierError> { - let specifier = "/test?#"; - let parsed = Specifier::parse(specifier)?; - assert_eq!(parsed.path, "/test"); - assert_eq!(parsed.query, Some("?")); - assert_eq!(parsed.fragment, Some("#")); - Ok(()) - } - - #[test] - fn relative() -> Result<(), SpecifierError> { - let specifiers = ["./test", "../test", "../../test"]; - for specifier in specifiers { - let mut r = specifier.to_string(); - r.push_str("?#"); - let parsed = Specifier::parse(&r)?; - assert_eq!(parsed.path, specifier); - assert_eq!(parsed.query, Some("?")); - assert_eq!(parsed.fragment, Some("#")); - } - Ok(()) - } - - #[test] - fn hash() -> Result<(), SpecifierError> { - let specifiers = ["#", "#path"]; - for specifier in specifiers { - let mut r = specifier.to_string(); - r.push_str("?#"); - let parsed = Specifier::parse(&r)?; - assert_eq!(parsed.path, specifier); - assert_eq!(parsed.query, Some("?")); - assert_eq!(parsed.fragment, Some("#")); - } - Ok(()) - } - - #[test] - fn module() -> Result<(), SpecifierError> { - let specifiers = ["module"]; - for specifier in specifiers { - let mut r = specifier.to_string(); - r.push_str("?#"); - let parsed = Specifier::parse(&r)?; - assert_eq!(parsed.path, specifier); - assert_eq!(parsed.query, Some("?")); - assert_eq!(parsed.fragment, Some("#")); - } - Ok(()) - } - - #[test] - fn query_fragment() -> Result<(), SpecifierError> { - let data = [ - ("a?", Some("?"), None), - ("a?query", Some("?query"), None), - ("a?query1?query2", Some("?query1?query2"), None), - ("a?query1?query2?query3", Some("?query1?query2?query3"), None), - ("a#", None, Some("#")), - ("a#b#c", None, Some("#b#c")), - ("a#fragment", None, Some("#fragment")), - ("a?#", Some("?"), Some("#")), - ("a?#fragment", Some("?"), Some("#fragment")), - ("a?query#", Some("?query"), Some("#")), - ("a?query#fragment", Some("?query"), Some("#fragment")), - ("a#fragment?", None, Some("#fragment?")), - ("a#fragment?query", None, Some("#fragment?query")), - ]; - - for (specifier_str, query, fragment) in data { - let specifier = Specifier::parse(specifier_str)?; - assert_eq!(specifier.path, "a", "{specifier_str}"); - assert_eq!(specifier.query, query, "{specifier_str}"); - assert_eq!(specifier.fragment, fragment, "{specifier_str}"); - } - - Ok(()) - } - - #[test] - // https://github.com/webpack/enhanced-resolve/blob/main/test/identifier.test.js - fn enhanced_resolve_edge_cases() -> Result<(), SpecifierError> { - let data = [ - ("path/#", "path/", "", "#"), - ("path/as/?", "path/as/", "?", ""), - ("path/#/?", "path/", "", "#/?"), - ("path/#repo#hash", "path/", "", "#repo#hash"), - ("path/#r#hash", "path/", "", "#r#hash"), - ("path/#repo/#repo2#hash", "path/", "", "#repo/#repo2#hash"), - ("path/#r/#r#hash", "path/", "", "#r/#r#hash"), - ("path/#/not/a/hash?not-a-query", "path/", "", "#/not/a/hash?not-a-query"), - ]; - - for (specifier_str, path, query, fragment) in data { - let specifier = Specifier::parse(specifier_str)?; - assert_eq!(specifier.path, path, "{specifier_str}"); - assert_eq!(specifier.query.unwrap_or(""), query, "{specifier_str}"); - assert_eq!(specifier.fragment.unwrap_or(""), fragment, "{specifier_str}"); - } - - Ok(()) - } - - // https://github.com/webpack/enhanced-resolve/blob/main/test/identifier.test.js - #[test] - fn enhanced_resolve_windows_like() -> Result<(), SpecifierError> { - let data = [ - ("path\\#", "path\\", "", "#"), - ("path\\as\\?", "path\\as\\", "?", ""), - ("path\\#\\?", "path\\", "", "#\\?"), - ("path\\#repo#hash", "path\\", "", "#repo#hash"), - ("path\\#r#hash", "path\\", "", "#r#hash"), - ("path\\#repo\\#repo2#hash", "path\\", "", "#repo\\#repo2#hash"), - ("path\\#r\\#r#hash", "path\\", "", "#r\\#r#hash"), - ("path\\#/not/a/hash?not-a-query", "path\\", "", "#/not/a/hash?not-a-query"), - ]; - - for (specifier_str, path, query, fragment) in data { - let specifier = Specifier::parse(specifier_str)?; - assert_eq!(specifier.path, path, "{specifier_str}"); - assert_eq!(specifier.query.unwrap_or(""), query, "{specifier_str}"); - assert_eq!(specifier.fragment.unwrap_or(""), fragment, "{specifier_str}"); - } - - Ok(()) - } -} diff --git a/src/tests/alias.rs b/src/tests/alias.rs deleted file mode 100644 index e5892066..00000000 --- a/src/tests/alias.rs +++ /dev/null @@ -1,283 +0,0 @@ -//! - -use normalize_path::NormalizePath; -use std::path::Path; - -use crate::{AliasValue, Resolution, ResolveContext, ResolveError, ResolveOptions, Resolver}; - -#[test] -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -fn alias() { - use super::memory_fs::MemoryFS; - use crate::ResolverGeneric; - use std::path::{Path, PathBuf}; - - let f = Path::new("/"); - - let file_system = MemoryFS::new(&[ - ("/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", ""), - ("/dashed-name", ""), - ]); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - alias: vec![ - ("aliasA".into(), vec![AliasValue::from("a")]), - ("b$".into(), vec![AliasValue::from("a/index")]), - ("c$".into(), vec![AliasValue::from("/a/index")]), - ( - "multiAlias".into(), - vec![ - AliasValue::from("b"), - AliasValue::from("c"), - AliasValue::from("d"), - AliasValue::from("e"), - AliasValue::from("a"), - ], - ), - ("recursive".into(), vec![AliasValue::from("recursive/dir")]), - ("/d/dir".into(), vec![AliasValue::from("/c/dir")]), - ("/d/index.js".into(), vec![AliasValue::from("/c/index")]), - ("#".into(), vec![AliasValue::from("/c/dir")]), - ("@".into(), vec![AliasValue::from("/c/dir")]), - ("ignored".into(), vec![AliasValue::Ignore]), - // not part of enhanced-resolve, added to make sure query in alias value works - ("alias_query".into(), vec![AliasValue::from("a?query_after")]), - ("alias_fragment".into(), vec![AliasValue::from("a#fragment_after")]), - ("dash".into(), vec![AliasValue::Ignore]), - ("@scope/package-name/file$".into(), vec![AliasValue::from("/c/dir")]), - ], - modules: vec!["/".into()], - ..ResolveOptions::default() - }, - ); - - #[rustfmt::skip] - let pass = [ - ("should resolve a not aliased module 1", "a", "/a/index"), - ("should resolve a not aliased module 2", "a/index", "/a/index"), - ("should resolve a not aliased module 3", "a/dir", "/a/dir/index"), - ("should resolve a not aliased module 4", "a/dir/index", "/a/dir/index"), - ("should resolve an aliased module 1", "aliasA", "/a/index"), - ("should resolve an aliased module 2", "aliasA/index", "/a/index"), - ("should resolve an aliased module 3", "aliasA/dir", "/a/dir/index"), - ("should resolve an aliased module 4", "aliasA/dir/index", "/a/dir/index"), - ("should resolve '#' alias 1", "#", "/c/dir/index"), - ("should resolve '#' alias 2", "#/index", "/c/dir/index"), - ("should resolve '@' alias 1", "@", "/c/dir/index"), - ("should resolve '@' alias 2", "@/index", "/c/dir/index"), - ("should resolve a recursive aliased module 1", "recursive", "/recursive/dir/index"), - ("should resolve a recursive aliased module 2", "recursive/index", "/recursive/dir/index"), - ("should resolve a recursive aliased module 3", "recursive/dir", "/recursive/dir/index"), - ("should resolve a recursive aliased module 4", "recursive/dir/index", "/recursive/dir/index"), - ("should resolve a file aliased module 1", "b", "/a/index"), - ("should resolve a file aliased module 2", "c", "/a/index"), - ("should resolve a file aliased module with a query 1", "b?query", "/a/index?query"), - ("should resolve a file aliased module with a query 2", "c?query", "/a/index?query"), - ("should resolve a path in a file aliased module 1", "b/index", "/b/index"), - ("should resolve a path in a file aliased module 2", "b/dir", "/b/dir/index"), - ("should resolve a path in a file aliased module 3", "b/dir/index", "/b/dir/index"), - ("should resolve a path in a file aliased module 4", "c/index", "/c/index"), - ("should resolve a path in a file aliased module 5", "c/dir", "/c/dir/index"), - ("should resolve a path in a file aliased module 6", "c/dir/index", "/c/dir/index"), - ("should resolve a file aliased file 1", "d", "/c/index"), - ("should resolve a file aliased file 2", "d/dir/index", "/c/dir/index"), - ("should resolve a file in multiple aliased dirs 1", "multiAlias/dir/file", "/e/dir/file"), - ("should resolve a file in multiple aliased dirs 2", "multiAlias/anotherDir", "/e/anotherDir/index"), - // not part of enhanced-resolve, added to make sure query in alias value works - ("should resolve query in alias value", "alias_query?query_before", "/a/index?query_after"), - ("should resolve query in alias value", "alias_fragment#fragment_before", "/a/index#fragment_after"), - ("should resolve dashed name", "dashed-name", "/dashed-name"), - ("should resolve scoped package name with sub dir", "@scope/package-name/file", "/c/dir/index"), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - - #[rustfmt::skip] - let ignore = [ - ("should resolve an ignore module", "ignored", ResolveError::Ignored(f.join("ignored"))) - ]; - - for (comment, request, expected) in ignore { - let resolution = resolver.resolve(f, request); - assert_eq!(resolution, Err(expected), "{comment} {request}"); - } -} - -// Not part of enhanced-resolve -#[test] -fn infinite_recursion() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![ - ("./a".into(), vec![AliasValue::from("./b")]), - ("./b".into(), vec![AliasValue::from("./a")]), - ], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(f, "./a"); - assert_eq!(resolution, Err(ResolveError::Recursion)); -} - -fn check_slash(path: &Path) { - let s = path.to_string_lossy().to_string(); - #[cfg(target_os = "windows")] - { - assert!(!s.contains('/'), "{s}"); - assert!(s.contains('\\'), "{s}"); - } - #[cfg(not(target_os = "windows"))] - { - assert!(s.contains('/'), "{s}"); - assert!(!s.contains('\\'), "{s}"); - } -} - -#[test] -fn absolute_path() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![(f.join("foo").to_str().unwrap().to_string(), vec![AliasValue::Ignore])], - modules: vec![f.clone().to_str().unwrap().to_string()], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(&f, "foo/index"); - assert_eq!(resolution, Err(ResolveError::Ignored(f.join("foo")))); -} - -#[test] -fn system_path() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![("@app".into(), vec![AliasValue::from(f.join("alias").to_string_lossy())])], - ..ResolveOptions::default() - }); - - let specifiers = ["@app/files/a", "@app/files/a.js"]; - - for specifier in specifiers { - let path = resolver.resolve(&f, specifier).map(Resolution::into_path_buf).unwrap(); - assert_eq!(path, f.join("alias/files/a.js")); - check_slash(&path); - } -} - -#[test] -fn alias_is_full_path() { - let f = super::fixture(); - let dir = f.join("foo"); - let dir_str = dir.to_string_lossy().to_string(); - - let resolver = Resolver::new(ResolveOptions { - alias: vec![("@".into(), vec![AliasValue::Path(dir_str.clone())])], - ..ResolveOptions::default() - }); - - let mut ctx = ResolveContext::default(); - - let specifiers = [ - "@/index".to_string(), - "@/index.js".to_string(), - // specifier has multiple `/` for reasons we'll never know - "@////index".to_string(), - // specifier is a full path - dir_str, - ]; - - for specifier in specifiers { - let resolution = resolver.resolve_with_context(&f, &specifier, &mut ctx); - assert_eq!(resolution.map(|r| r.full_path()), Ok(dir.join("index.js"))); - } - - for path in ctx.file_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - check_slash(&path); - } - - for path in ctx.missing_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - check_slash(&path); - if let Some(path) = path.parent() { - assert!(!path.is_file(), "{path:?} must not be a file"); - } - } -} - -// For the `should_stop` variable in `load_alias` -#[test] -fn all_alias_values_are_not_found() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![( - "m1".to_string(), - vec![AliasValue::Path(f.join("node_modules").join("m2").to_string_lossy().to_string())], - )], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(&f, "m1/a.js"); - assert_eq!( - resolution, - Err(ResolveError::MatchedAliasNotFound("m1/a.js".to_string(), "m1".to_string(),)) - ); -} - -#[test] -fn alias_fragment() { - let f = super::fixture(); - - let data = [ - // enhanced-resolve has `#` prepended with a `\0`, they are removed from the - // following 3 expected test results. - // See https://github.com/webpack/enhanced-resolve#escaping - ( - "handle fragment edge case (no fragment)", - "./no#fragment/#/#", - f.join("no#fragment/#/#.js"), - ), - ("handle fragment edge case (fragment)", "./no#fragment/#/", f.join("no.js#fragment/#/")), - ( - "handle fragment escaping", - "./no\0#fragment/\0#/\0##fragment", - f.join("no#fragment/#/#.js#fragment"), - ), - ]; - - for (comment, request, expected) in data { - let resolver = Resolver::new(ResolveOptions { - alias: vec![("foo".to_string(), vec![AliasValue::Path(request.to_string())])], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f, "foo").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } -} - -#[test] -fn alias_try_fragment_as_path() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![( - "#".to_string(), - vec![AliasValue::Path(f.join("#").to_string_lossy().to_string())], - )], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(&f, "#/a").map(|r| r.full_path()); - assert_eq!(resolution, Ok(f.join("#").join("a.js"))); -} diff --git a/src/tests/browser_field.rs b/src/tests/browser_field.rs deleted file mode 100644 index 171ee099..00000000 --- a/src/tests/browser_field.rs +++ /dev/null @@ -1,189 +0,0 @@ -//! - -use crate::{AliasValue, ResolveError, ResolveOptions, Resolver}; - -#[test] -fn ignore() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![ - vec!["browser".into()], - vec!["innerBrowser1".into()], - vec!["innerBrowser2".into()], - vec![], - ], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - (f.clone(), "./lib/ignore", f.join("lib/ignore.js")), - (f.clone(), "./lib/ignore.js", f.join("lib/ignore.js")), - (f.join("lib"), "./ignore", f.join("lib/ignore.js")), - (f.join("lib"), "./ignore.js", f.join("lib/ignore.js")), - ]; - - for (path, request, expected) in data { - let resolution = resolver.resolve(&path, request); - let expected = ResolveError::Ignored(expected); - assert_eq!(resolution, Err(expected), "{path:?} {request}"); - } -} - -#[test] -fn shared_resolvers() { - let f = super::fixture().join("browser-module"); - - let resolver1 = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["innerBrowser1".into(), "field".into(), "browser".into()]], - ..ResolveOptions::default() - }); - let resolved_path = resolver1.resolve(&f, "./lib/main1.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("lib/main.js"))); - - let resolver2 = resolver1.clone_with_options(ResolveOptions { - alias_fields: vec![vec!["innerBrowser2".into(), "browser".into()]], - ..ResolveOptions::default() - }); - let resolved_path = resolver2.resolve(&f, "./lib/main2.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("./lib/replaced.js"))); -} - -#[test] -fn replace_file() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![ - vec!["browser".into()], - vec!["innerBrowser1".into(), "field2".into(), "browser".into()], // not presented - vec!["innerBrowser1".into(), "field".into(), "browser".into()], - vec!["innerBrowser2".into(), "browser".into()], - ], - // Not part of enhanced-resolve. Added to make sure no interaction between these two fields. - main_fields: vec!["browser".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - ("should replace a file 1", f.clone(), "./lib/replaced", f.join("lib/browser.js")), - ("should replace a file 2", f.clone(), "./lib/replaced.js", f.join("lib/browser.js")), - ("should replace a file 3", f.join("lib"), "./replaced", f.join("lib/browser.js")), - ("should replace a file 4", f.join("lib"), "./replaced.js", f.join("lib/browser.js")), - ("should replace a module with a file 1", f.clone(), "module-a", f.join("browser/module-a.js")), - ("should replace a module with a file 2", f.join("lib"), "module-a", f.join("browser/module-a.js")), - ("should replace a module with a module 1", f.clone(), "module-b", f.join("node_modules/module-c.js")), - ("should replace a module with a module 2", f.join("lib"), "module-b", f.join("node_modules/module-c.js")), - ("should resolve in nested property 1", f.clone(), "./lib/main1.js", f.join("lib/main.js")), - ("should resolve in nested property 2", f.clone(), "./lib/main2.js", f.join("lib/browser.js")), - ("should check only alias field properties", f.clone(), "./toString", f.join("lib/toString.js")), - // not part of enhanced-resolve - ("recursion", f.clone(), "module-c", f.join("node_modules/module-c.js")), - ("resolve self 1", f.clone(), "./lib/main.js", f.join("lib/main.js")), - ("resolve self 2", f.clone(), "./main.js", f.join("lib/main.js")), - ]; - - for (comment, path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn recurse_fail() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - ("recurse non existent", f.clone(), "./lib/non-existent.js", ResolveError::NotFound("./lib/non-existent.js".into())), - ("path partial match 1", f.clone(), "./xyz.js", ResolveError::NotFound("./xyz.js".into())), - ("path partial match 2", f, "./lib/xyz.js", ResolveError::NotFound("./lib/xyz.js".into())), - ]; - - for (comment, path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Err(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn broken() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - // The browser field string value should be ignored - (f.clone(), "browser-module-broken", Ok(f.join("node_modules/browser-module-broken/main.js"))), - (f.join("browser-module"), "./number", Err(ResolveError::NotFound("./number".into()))), - ]; - - for (path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, expected, "{path:?} {request}"); - } -} - -#[test] -fn crypto_js() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - fallback: vec![( - "crypto".into(), - vec![AliasValue::from(f.join("lib.js").to_string_lossy())], - )], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(f.join("crypto-js"), "crypto").map(|r| r.full_path()); - assert_eq!(resolved_path, Err(ResolveError::Ignored(f.join("crypto-js")))); -} - -// https://github.com/webpack/webpack/blob/87660921808566ef3b8796f8df61bd79fc026108/test/cases/resolving/browser-field/index.js#L40-L43 -#[test] -fn recursive() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - let data = [ - ("should handle recursive file 1", f.clone(), "recursive-file/a"), - ("should handle recursive file 2", f.clone(), "recursive-file/b"), - ("should handle recursive file 3", f.clone(), "recursive-file/c"), - ("should handle recursive file 4", f, "recursive-file/d"), - ]; - - for (comment, path, request) in data { - let resolved_path = resolver.resolve(&path, request); - assert_eq!(resolved_path, Err(ResolveError::Recursion), "{comment} {path:?} {request}"); - } -} - -#[test] -fn with_query() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "./foo").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("lib").join("browser.js?query"))); -} diff --git a/src/tests/builtins.rs b/src/tests/builtins.rs deleted file mode 100644 index 5d6d14d9..00000000 --- a/src/tests/builtins.rs +++ /dev/null @@ -1,121 +0,0 @@ -use std::path::Path; - -use crate::{ResolveError, ResolveOptions, Resolver}; - -#[test] -fn builtins_off() { - let f = Path::new("/"); - let resolver = Resolver::default(); - let resolved_path = resolver.resolve(f, "zlib").map(|r| r.full_path()); - assert_eq!(resolved_path, Err(ResolveError::NotFound("zlib".into()))); -} - -#[test] -fn builtins() { - let f = Path::new("/"); - - let resolver = Resolver::new(ResolveOptions::default().with_builtin_modules(true)); - - let pass = [ - "_http_agent", - "_http_client", - "_http_common", - "_http_incoming", - "_http_outgoing", - "_http_server", - "_stream_duplex", - "_stream_passthrough", - "_stream_readable", - "_stream_transform", - "_stream_wrap", - "_stream_writable", - "_tls_common", - "_tls_wrap", - "assert", - "assert/strict", - "async_hooks", - "buffer", - "child_process", - "cluster", - "console", - "constants", - "crypto", - "dgram", - "diagnostics_channel", - "dns", - "dns/promises", - "domain", - "events", - "fs", - "fs/promises", - "http", - "http2", - "https", - "inspector", - "module", - "net", - "os", - "path", - "path/posix", - "path/win32", - "perf_hooks", - "process", - "punycode", - "querystring", - "readline", - "repl", - "stream", - "stream/consumers", - "stream/promises", - "stream/web", - "string_decoder", - "sys", - "timers", - "timers/promises", - "tls", - "trace_events", - "tty", - "url", - "util", - "util/types", - "v8", - "vm", - "worker_threads", - "zlib", - ]; - - for request in pass { - let prefixed_request = format!("node:{request}"); - for request in [prefixed_request.clone(), request.to_string()] { - let resolved_path = resolver.resolve(f, &request).map(|r| r.full_path()); - let err = ResolveError::Builtin(prefixed_request.clone()); - assert_eq!(resolved_path, Err(err), "{request}"); - } - } -} - -#[test] -fn fail() { - let f = Path::new("/"); - let resolver = Resolver::new(ResolveOptions::default().with_builtin_modules(true)); - let request = "xxx"; - let resolved_path = resolver.resolve(f, request); - let err = ResolveError::NotFound(request.to_string()); - assert_eq!(resolved_path, Err(err), "{request}"); -} - -#[test] -fn imports() { - let f = super::fixture().join("builtins"); - let resolver = Resolver::new(ResolveOptions { - builtin_modules: true, - condition_names: vec!["node".into()], - ..ResolveOptions::default() - }); - - for request in ["#fs", "#http"] { - let resolved_path = resolver.resolve(f.clone(), request).map(|r| r.full_path()); - let err = ResolveError::Builtin(format!("node:{}", request.trim_start_matches('#'))); - assert_eq!(resolved_path, Err(err)); - } -} diff --git a/src/tests/dependencies.rs b/src/tests/dependencies.rs deleted file mode 100644 index bcc2355b..00000000 --- a/src/tests/dependencies.rs +++ /dev/null @@ -1,110 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/dependencies.test.js - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows { - use rustc_hash::FxHashSet; - use std::path::PathBuf; - - use crate::{ResolveContext, ResolveOptions, ResolverGeneric}; - - use super::super::memory_fs::MemoryFS; - - fn file_system() -> MemoryFS { - MemoryFS::new(&[ - ("/a/b/node_modules/some-module/index.js", ""), - ("/a/node_modules/module/package.json", r#"{"main":"entry.js"}"#), - ("/a/node_modules/module/file.js", r#"{"main":"entry.js"}"#), - ("/modules/other-module/file.js", ""), - ]) - } - - #[test] - fn test() { - let file_system = file_system(); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - extensions: vec![".json".into(), ".js".into()], - modules: vec!["/modules".into(), "node_modules".into()], - ..ResolveOptions::default() - }, - ); - - let data = [ - ( - "middle module request", - "/a/b/c", - "module/file", - "/a/node_modules/module/file.js", - // These dependencies are different from enhanced-resolve due to different code path to - // querying the file system - vec![ - // 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", - // "/", - ], - vec![ - // missing package.jsons - // "/a/b/c/package.json", - "/a/b/package.json", - "/a/package.json", - "/package.json", - // missing modules directories - "/a/b/c", - // "/a/b/c/node_modules", - // missing single file modules - "/modules/module", - "/a/b/node_modules/module", - // missing files with alternative extensions - "/a/node_modules/module/file", - "/a/node_modules/module/file.json", - ], - ), - ( - "fast found module", - "/a/b/c", - "other-module/file.js", - "/modules/other-module/file.js", - // These dependencies are different from enhanced-resolve due to different code path to - // querying the file system - vec![ - // symlink checks - "/modules/other-module/file.js", - // "/modules/other-module", - // "/modules", - // "/", - ], - vec![ - // missing package.jsons - // "/a/b/c/package.json", - "/a/b/c", - "/a/b/package.json", - "/a/package.json", - "/package.json", - "/modules/other-module/package.json", - "/modules/package.json", - ], - ), - ]; - - for (name, context, request, result, file_dependencies, missing_dependencies) in data { - let mut ctx = ResolveContext::default(); - let path = PathBuf::from(context); - let resolved = - resolver.resolve_with_context(path, request, &mut ctx).map(|r| r.full_path()); - assert_eq!(resolved, Ok(PathBuf::from(result))); - let file_dependencies = - FxHashSet::from_iter(file_dependencies.iter().map(PathBuf::from)); - let missing_dependencies = - FxHashSet::from_iter(missing_dependencies.iter().map(PathBuf::from)); - assert_eq!(ctx.file_dependencies, file_dependencies, "{name}"); - assert_eq!(ctx.missing_dependencies, missing_dependencies, "{name}"); - } - } -} diff --git a/src/tests/exports_field.rs b/src/tests/exports_field.rs deleted file mode 100644 index 7ca73fbd..00000000 --- a/src/tests/exports_field.rs +++ /dev/null @@ -1,2546 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/exportsField.test.js -//! -//! The huge exports field test cases are at the bottom of this file. - -use crate::{Ctx, PathUtil, ResolveError, ResolveOptions, Resolver}; -use serde_json::json; -use std::path::Path; - -#[test] -fn test_simple() { - let f = super::fixture().join("exports-field"); - let f2 = super::fixture().join("exports-field2"); - let f4 = super::fixture().join("exports-field-error"); - let f5 = super::fixture().join("imports-exports-wildcard"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - fully_specified: true, - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("resolve root using exports field, not a main field", f.clone(), "exports-field", f.join("node_modules/exports-field/x.js")), - ("resolver should respect condition names", f.clone(), "exports-field/dist/main.js", f.join("node_modules/exports-field/lib/lib2/main.js")), - // enhanced_resolve behaves differently to node.js. enhanced_resolve fallbacks when an - // array item is unresolved, where as node.js fallbacks when an array has an - // InvalidPackageTarget error. - // ("resolver should respect fallback", f2.clone(), "exports-field/dist/browser.js", f2.join("node_modules/exports-field/lib/browser.js")), - // The following two tests require fallback from array values, the path is changed here to - // only test query and fragment. - ("resolver should respect query parameters #1", f2.clone(), "exports-field/dist/main.js?foo", f2.join("node_modules/exports-field/lib/lib2/main.js?foo")), - ("resolver should respect fragment parameters #1", f2.clone(), "exports-field/dist/main.js#foo", f2.join("node_modules/exports-field/lib/lib2/main.js#foo")), - ("relative path should work, if relative path as request is used", f.clone(), "./node_modules/exports-field/lib/main.js", f.join("node_modules/exports-field/lib/main.js")), - ("self-resolving root", f.clone(), "@exports-field/core", f.join("a.js")), - ("should resolve with wildcard pattern #1", f5.clone(), "m/features/f.js", f5.join("node_modules/m/src/features/f.js")), - ("should resolve with wildcard pattern #2", f5.clone(), "m/features/y/y.js", f5.join("node_modules/m/src/features/y/y.js")), - ("should resolve with wildcard pattern #3", f5.clone(), "m/features-no-ext/y/y.js", f5.join("node_modules/m/src/features/y/y.js")), - ("should resolve with wildcard pattern #4", f5.clone(), "m/middle/nested/f.js", f5.join("node_modules/m/src/middle/nested/f.js")), - ("should resolve with wildcard pattern #5", f5.clone(), "m/middle-1/nested/f.js", f5.join("node_modules/m/src/middle-1/nested/f.js")), - ("should resolve with wildcard pattern #6", f5.clone(), "m/middle-2/nested/f.js", f5.join("node_modules/m/src/middle-2/nested/f.js")), - ("should resolve with wildcard pattern #7", f5.clone(), "m/middle-3/nested/f", f5.join("node_modules/m/src/middle-3/nested/f/nested/f.js")), - ("should resolve with wildcard pattern #8", f5.clone(), "m/middle-4/f/nested", f5.join("node_modules/m/src/middle-4/f/f.js")), - ("should resolve with wildcard pattern #9", f5.clone(), "m/middle-5/f$/$", f5.join("node_modules/m/src/middle-5/f$/$.js")), - ]; - - // Not needed or snapshot: - // * should log the correct info - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } - - let p = f.join("node_modules/exports-field/package.json"); - let p2 = f2.join("node_modules/exports-field/package.json"); - let p4 = f4.join("node_modules/exports-field/package.json"); - let p5 = f5.join("node_modules/m/package.json"); - - #[rustfmt::skip] - let fail = [ - // ("throw error if extension not provided", f2.clone(), "exports-field/dist/main", ResolveError::NotFound(f2.join("node_modules/exports-field/lib/lib2/main"))), - ("resolver should respect query parameters #2. Direct matching", f2.clone(), "exports-field?foo", ResolveError::PackagePathNotExported("./?foo".into(), p2.clone())), - ("resolver should respect fragment parameters #2. Direct matching", f2, "exports-field#foo", ResolveError::PackagePathNotExported("./#foo".into(), p2)), - ("relative path should not work with exports field", f.clone(), "./node_modules/exports-field/dist/main.js", ResolveError::NotFound("./node_modules/exports-field/dist/main.js".into())), - ("backtracking should not work for request", f.clone(), "exports-field/dist/../../../a.js", ResolveError::InvalidPackageTarget("./lib/../../../a.js".to_string(), "./dist/".to_string(), p.clone())), - ("backtracking should not work for exports field target", f.clone(), "exports-field/dist/a.js", ResolveError::InvalidPackageTarget("./../../a.js".to_string(), "./dist/a.js".to_string(), p.clone())), - ("not exported error", f.clone(), "exports-field/anything/else", ResolveError::PackagePathNotExported("./anything/else".to_string(), p.clone())), - ("request ending with slash #1", f.clone(), "exports-field/", ResolveError::PackagePathNotExported("./".to_string(), p.clone())), - ("request ending with slash #2", f.clone(), "exports-field/dist/", ResolveError::PackagePathNotExported("./dist/".to_string(), p.clone())), - ("request ending with slash #3", f.clone(), "exports-field/lib/", ResolveError::PackagePathNotExported("./lib/".to_string(), p)), - ("should throw error if target is invalid", f4, "exports-field", ResolveError::InvalidPackageTarget("./a/../b/../../pack1/index.js".to_string(), ".".to_string(), p4)), - ("throw error if exports field is invalid", f.clone(), "invalid-exports-field", ResolveError::InvalidPackageConfig(f.join("node_modules/invalid-exports-field/package.json"))), - ("should throw error if target is 'null'", f5, "m/features/internal/file.js", ResolveError::PackagePathNotExported("./features/internal/file.js".to_string(), p5)), - ]; - - for (comment, path, request, error) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!(resolution, Err(error), "{comment} {path:?} {request}"); - } -} - -// resolve using exports field, not a browser field #1 -#[test] -fn exports_not_browser_field1() { - let f = super::fixture().join("exports-field"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - condition_names: vec!["webpack".into()], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "exports-field/dist/main.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("node_modules/exports-field/lib/lib2/main.js"))); -} - -// resolve using exports field and a browser alias field #2 -#[test] -fn exports_not_browser_field2() { - let f2 = super::fixture().join("exports-field2"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - extensions: vec![".js".into()], - condition_names: vec!["node".into()], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f2, "exports-field/dist/main.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f2.join("node_modules/exports-field/lib/browser.js"))); -} - -// should resolve extension without fullySpecified -#[test] -fn extension_without_fully_specified() { - let f2 = super::fixture().join("exports-field2"); - - let commonjs_resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - let resolved_path = - commonjs_resolver.resolve(&f2, "exports-field/dist/main").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f2.join("node_modules/exports-field/lib/lib2/main.js"))); -} - -#[test] -fn field_name_path() { - let f2 = super::fixture().join("exports-field2"); - let f3 = super::fixture().join("exports-field3"); - - // field name path #1 #2 #3 - let exports_fields = [ - vec![vec!["exportsField".into(), "exports".into()]], - vec![vec!["exportsField".into(), "exports".into()], vec!["exports".into()]], - vec![vec!["exports".into()], vec!["exportsField".into(), "exports".into()]], - ]; - - for exports_fields in exports_fields { - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - exports_fields, - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/main.js"))); - } - - // field name path #4 - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - exports_fields: vec![vec!["exports".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f2, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f2.join("node_modules/exports-field/index.js"))); - - // field name path #5 - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - exports_fields: vec![vec!["ex".into()], vec!["exports_field".into(), "exports".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/index"))); - - // non-compliant export targeting a directory - let resolver = Resolver::new(ResolveOptions { - exports_fields: vec![vec!["broken".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/src/index.js"))); -} - -#[test] -fn shared_resolvers() { - let f3 = super::fixture().join("exports-field3"); - - let resolver1 = Resolver::new(ResolveOptions { - exports_fields: vec![vec!["exportsField".into(), "exports".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver1.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/main.js"))); - - let resolver2 = resolver1.clone_with_options(ResolveOptions { - exports_fields: vec![vec!["ex".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver2.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/index"))); -} - -#[test] -fn extension_alias_1_2() { - let f = super::fixture().join("exports-field-and-extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - extension_alias: vec![(".js".into(), vec![".ts".into(), ".js".into()])], - fully_specified: true, - condition_names: vec!["webpack".into(), "default".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve with the `extensionAlias` option", f.clone(), "@org/pkg/string.js", f.join("node_modules/@org/pkg/dist/string.js")), - ("should resolve with the `extensionAlias` option #2", f.clone(), "pkg/string.js", f.join("node_modules/pkg/dist/string.js")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn extension_alias_3() { - let f = super::fixture().join("exports-field-and-extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - extension_alias: vec![( - ".js".into(), - vec![".foo".into(), ".baz".into(), ".baz".into(), ".ts".into(), ".js".into()], - )], - fully_specified: true, - condition_names: vec!["webpack".into(), "default".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve with the `extensionAlias` option #3", f.clone(), "pkg/string.js", f.join("node_modules/pkg/dist/string.js")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn extension_alias_throw_error() { - let f = super::fixture().join("exports-field-and-extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - extension_alias: vec![(".js".into(), vec![".ts".into()])], - fully_specified: true, - condition_names: vec!["webpack".into(), "default".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let fail = [ - // enhanced-resolve has two test cases that are exactly the same here - // https://github.com/webpack/enhanced-resolve/blob/a998c7d218b7a9ec2461fc4fddd1ad5dd7687485/test/exportsField.test.js#L2976-L3024 - ("should throw error with the `extensionAlias` option", f.clone(), "pkg/string.js", ResolveError::ExtensionAlias(f.join("node_modules/pkg/dist/string.js"))), - // TODO: The error is PackagePathNotExported in enhanced-resolve - // ("should throw error with the `extensionAlias` option", f.clone(), "pkg/string.js", ResolveError::PackagePathNotExported("node_modules/pkg/dist/string.ts".to_string())), - ]; - - for (comment, path, request, error) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!(resolution, Err(error), "{comment} {path:?} {request}"); - } -} - -// Small script for generating the test cases from enhanced-resolve -// for (c of testCases) { -// console.log("TestCase {") -// console.log(`name: ${JSON.stringify(c.name)},`) -// if (c.expect instanceof Error) { -// console.log(`expect: None,`) -// } else { -// console.log(`expect: Some(vec!${JSON.stringify(c.expect)}),`) -// } -// console.log(`exports_field: exports_field(json!(${JSON.stringify(c.suite[0], null, 2)})),`) -// console.log(`request: "${c.suite[1]}",`) -// console.log(`condition_names: vec!${JSON.stringify(c.suite[2])},`) -// console.log("},") -//} -struct TestCase { - name: &'static str, - expect: Option>, - exports_field: serde_json::Value, - request: &'static str, - condition_names: Vec<&'static str>, -} - -#[allow(clippy::needless_pass_by_value)] -fn exports_field(value: serde_json::Value) -> serde_json::Value { - value -} - -#[test] -fn test_cases() { - let test_cases = [ - TestCase { - name: "sample #1", - expect: Some(vec!["./dist/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/": { - "import": [ - "./dist/", - "./src/" - ], - "webpack": "./wp/" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "sample #1", - expect: Some(vec!["./src/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/": { - "import": [ - "./src/" - ], - "webpack": "./wp/" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - TestCase { - name: "sample #1 (wildcard)", - expect: Some(vec!["./dist/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/*": { - "import": [ - "./dist/*", - "./src/*" - ], - "webpack": "./wp/*" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "sample #1 (wildcard)", - expect: Some(vec!["./src/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/*": { - "import": [ - "./src/*" - ], - "webpack": "./wp/*" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - TestCase { - name: "sample #2", - expect: Some(vec!["./data/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./timezones/": "./data/timezones/" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #2 (wildcard)", - expect: Some(vec!["./data/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./timezones/*": "./data/timezones/*" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #3", - expect: Some(vec!["./data/timezones/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./": "./data/timezones/" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #3 (wildcard)", - expect: Some(vec!["./data/timezones/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./*": "./data/timezones/*.mjs" - })), - request: "./timezones/pdt", - condition_names: vec![], - }, - TestCase { - name: "sample #4", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./lib/": { - "browser": [ - "./browser/" - ] - }, - "./dist/index.js": { - "node": "./index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #4 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "node": "./index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #5", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/": { - "browser": [ - "./browser/" - ] - }, - "./dist/index.js": { - "node": "./index.js", - "default": "./browser/index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #5 (wildcard)", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "node": "./index.js", - "default": "./browser/index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./dist/a": "./dist/index.js" - })), - request: "./dist/aaa", - condition_names: vec![], - }, - TestCase { - name: "sample #7", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./dist/a/a/": "./dist/index.js" - })), - request: "./dist/a/a", - condition_names: vec![], - }, - TestCase { - name: "sample #7 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./dist/a/a/*": "./dist/index.js" - })), - request: "./dist/a/a", - condition_names: vec![], - }, - TestCase { - name: "sample #8", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": "./index.js" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #9", - expect: Some(vec!["./main.js"]), - exports_field: exports_field(json!({ - "./index.js": "./main.js" - })), - request: "./index.js", - condition_names: vec![], - }, - TestCase { - name: "sample #10", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #11", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./bar#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #12", - expect: Some(vec!["./ok.js#abc"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/ok.js#abc", - condition_names: vec![], - }, - TestCase { - name: "sample #12", - expect: Some(vec!["./ok.js#abc"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/ok.js#abc", - condition_names: vec![], - }, - TestCase { - name: "sample #13", - expect: Some(vec!["./ok.js?abc"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/ok.js?abc", - condition_names: vec![], - }, - TestCase { - name: "sample #14", - expect: Some(vec!["./🎉.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/🎉.js", - condition_names: vec![], - }, - TestCase { - name: "sample #15", - expect: Some(vec!["./%F0%9F%8E%89.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/%F0%9F%8E%89.js", - condition_names: vec![], - }, - TestCase { - name: "sample #16", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./🎉", - condition_names: vec![], - }, - TestCase { - name: "sample #17", - expect: Some(vec!["./other.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./%F0%9F%8E%89", - condition_names: vec![], - }, - TestCase { - name: "sample #18", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./module", - condition_names: vec![], - }, - TestCase { - name: "sample #19", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./module#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #20", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./module?foo", - condition_names: vec![], - }, - TestCase { - name: "sample #21", - expect: Some(vec!["./zizizi"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./z*z*z*" - })), - request: "./#zippi", - condition_names: vec![], - }, - TestCase { - name: "sample #22", - expect: Some(vec!["./d?e?f"]), - exports_field: exports_field(json!({ - "./a?b?c/": "./" - })), - request: "./a?b?c/d?e?f", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #1", - expect: Some(vec!["./dist/index.js"]), - exports_field: exports_field(json!({ - ".": "./dist/index.js" - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #2", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./": "./", - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #3", - expect: Some(vec!["./dist/a.js"]), - exports_field: exports_field(json!({ - "./dist/": "./dist/", - "./dist/*": "./dist/*", - "./dist*": "./dist*", - "./dist/index.js": "./dist/a.js" - })), - request: "./dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #4", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./": { - "browser": [ - "./browser/" - ] - }, - "./*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "browser": "./index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #5", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./": { - "browser": [ - "./browser/" - ] - }, - "./*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "node": "./node.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #6", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - ".": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #7", - expect: Some(vec!["./src/index.js"]), // `enhanced_resolve` is `None` - exports_field: exports_field(json!({ - ".": { - "default": "./src/index.js", - "browser": "./index.js", - "node": "./src/node/index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #8", - expect: Some(vec!["./src/index.js"]), - exports_field: exports_field(json!({ - ".": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #9", - expect: Some(vec!["./index"]), - exports_field: exports_field(json!({ - ".": "./index" - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #10", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./index": "./index.js" - })), - request: "./index", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #11", - expect: Some(vec!["./foo.js"]), - exports_field: exports_field(json!({ - "./": "./", - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #12", - expect: Some(vec!["./foo/bar/baz.js"]), - exports_field: exports_field(json!({ - "./": "./", - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo/bar/baz.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #13", - expect: Some(vec!["./foo/bar/baz.js"]), - exports_field: exports_field(json!({ - "./": "./", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo/bar/baz.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #14", - expect: Some(vec!["./foo/bar/baz.js"]), - exports_field: exports_field(json!({ - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo/bar/baz.js", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #1", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "require": "./require.js" - }, { - "import": "./import.mjs" - }] - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #2", - expect: Some(vec!["./import.mjs"]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "require": "./require.js" - }, { - "import": "./import.mjs" - }] - })), - request: ".", - condition_names: vec!["import"], - }, - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./require.js"]), - exports_field: exports_field(json!({ - ".": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./import.mjs"]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "import": "./import.mjs" - }] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./require.js"]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "require": [ - "./require.js" - ] - }, { - "import": [ - "./import.mjs", - "./import.js" - ] - }] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./import.mjs"]), - exports_field: exports_field(json!({ - ".": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "./import.mjs", - "./import.js" - ] - } - ] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./import.js"]), - exports_field: exports_field(json!({ - ".": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "./import.js" - ] - } - ] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "mapping to a folder root #1", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./timezones": "./data/timezones/" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #2", - expect: None, - exports_field: exports_field(json!({ - "./timezones/": "./data/timezones" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #3", - expect: Some(vec!["./data/timezones/pdt/index.mjs"]), - exports_field: exports_field(json!({ - "./timezones/pdt/": "./data/timezones/pdt/" - })), - request: "./timezones/pdt/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #3 (wildcard)", - expect: Some(vec!["./data/timezones/pdt/index.mjs"]), - exports_field: exports_field(json!({ - "./timezones/pdt/*": "./data/timezones/pdt/*" - })), - request: "./timezones/pdt/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #4", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./": "./timezones/" - })), - request: "./pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #4 (wildcard)", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./*": "./timezones/*" - })), - request: "./pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #5", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./": "./" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #5 (wildcard)", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./*": "./*" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #6", - expect: None, - exports_field: exports_field(json!({ - "./": "." - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #6 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "./*": "." - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #7", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": "./" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #7 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": "./*" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #1", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./": "./", - "./dist/": "./lib/" - })), - request: "./dist/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #1 (wildcard)", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./*": "./*", - "./dist/*": "./lib/*" - })), - request: "./dist/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #2", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/": "./dist/utils/", - "./dist/": "./lib/" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #2 (wildcard)", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/*": "./dist/utils/*", - "./dist/*": "./lib/*" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #3", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/index.js": "./dist/utils/index.js", - "./dist/utils/": "./dist/utils/index.mjs", - "./dist/": "./lib/" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #3 (wildcard)", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/index.js": "./dist/utils/index.js", - "./dist/utils/*": "./dist/utils/index.mjs", - "./dist/*": "./lib/*" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #4", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./": { - "browser": "./browser/" - }, - "./dist/": "./lib/" - })), - request: "./dist/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "the longest matching path prefix is prioritized #4 (wildcard)", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./*": { - "browser": "./browser/*" - }, - "./dist/*": "./lib/*" - })), - request: "./dist/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #1", - // `lodash/` does not start with './' so fallbacks to util - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "conditional mapping folder #1", - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": [ - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #1 (wildcard)", - // `lodash/` does not start with './' so fallbacks to util - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": [ - "lodash/*", - "./utils/*" - ], - "node": [ - "./utils-node/*" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "conditional mapping folder #1 (wildcard)", - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": [ - "./utils/*" - ], - "node": [ - "./utils-node/*" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #2", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./node/" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "conditional mapping folder #2 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "webpack": "./wpk/*", - "browser": [ - "lodash/*", - "./utils/*" - ], - "node": [ - "./node/*" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "conditional mapping folder #3", - expect: Some(vec!["./wpk/index.mjs"]), - exports_field: exports_field(json!({ - "./utils/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils/" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "conditional mapping folder #3 (wildcard)", - expect: Some(vec!["./wpk/index.mjs"]), - exports_field: exports_field(json!({ - "./utils/*": { - "webpack": "./wpk/*", - "browser": [ - "lodash/*", - "./utils/*" - ], - "node": [ - "./utils/*" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "incorrect exports field #1", - expect: None, - exports_field: exports_field(json!({ - "/utils/": "./a/" - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #2", - expect: None, - exports_field: exports_field(json!({ - "./utils/": "/a/" - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #3", - expect: None, - exports_field: exports_field(json!({ - "/utils/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #4", - expect: None, - exports_field: exports_field(json!({ - "./utils/": { - "browser": "/a/", - "default": "/b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #4 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "/a/", - "default": "/b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #5", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index": "./a/index.js" - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index.mjs": "./a/index.js" - })), - request: "./utils/index", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #7", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #8", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index.mjs": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - // Requests that are not `./` does not apply to `package_exports_resolve` - // TestCase { - // name: "incorrect request #1", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": "./a/" - // })), - // request: "/utils/index.mjs", - // condition_names: vec![], - // }, - // TestCase { - // name: "incorrect request #2", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": { - // "browser": "./a/", - // "default": "./b/" - // } - // })), - // request: "/utils/index.mjs", - // condition_names: vec!["browser"], - // }, - // TestCase { - // name: "incorrect request #3", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": { - // "browser": "./a/", - // "default": "./b/" - // } - // })), - // request: "../utils/index.mjs", - // condition_names: vec!["browser"], - // }, - // TestCase { - // name: "incorrect request #4", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": { - // "browser": "./a/", - // "default": "./b/" - // } - // })), - // request: "/utils/index.mjs/", - // condition_names: vec!["browser"], - // }, - TestCase { - name: "backtracking package base #1", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./../../utils/": "./dist/" - })), - request: "./../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #1 (wildcard)", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./../../utils/*": "./dist/*" - })), - request: "./../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #2", - expect: None, - exports_field: exports_field(json!({ - "../../utils/": "./dist/" - })), - request: "../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #2 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "../../utils/*": "./dist/*" - })), - request: "../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #3", - expect: None, - exports_field: exports_field(json!({ - "./utils/": "../src/" - })), - request: "./utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #3 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "./utils/*": "../src/*" - })), - request: "./utils/index", - condition_names: vec![], - }, - // enhanced-resolve does not handle backtracking here - // TestCase { - // name: "backtracking package base #4", - // expect: Some(vec!["./../src/index"]), - // exports_field: exports_field(json!({ - // "./utils/": "./../src/" - // })), - // request: "./utils/index", - // condition_names: vec![], - // }, - // TestCase { - // name: "backtracking package base #4 (wildcard)", - // expect: Some(vec!["./../src/index"]), - // exports_field: exports_field(json!({ - // "./utils/*": "./../src/*" - // })), - // request: "./utils/index", - // condition_names: vec![], - // }, - // TestCase { - // name: "backtracking package base #5", - // expect: Some(vec!["./src/../index.js"]), - // exports_field: exports_field(json!({ - // "./utils/index": "./src/../index.js" - // })), - // request: "./utils/index", - // condition_names: vec![], - // }, - TestCase { - name: "backtracking package base #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/../utils/index": "./src/../index.js" - })), - request: "./utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #7", - expect: None, - exports_field: exports_field(json!({ - "./utils/": { - "browser": "../this/" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #7", - expect: None, - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "../this/*" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #8", - // We throw "InvalidPackageTarget" - // expect: Some(vec!["./utils/../index"]), - expect: None, - exports_field: exports_field(json!({ - "./utils/": { - "browser": "./utils/../" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #8 (wildcard)", - // We throw "InvalidPackageTarget" - // expect: Some(vec!["./utils/../index"]), - expect: None, - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "./utils/../*" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #9", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./": "./src/../../", - "./dist/": "./dist/" - })), - request: "./dist/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #9 (wildcard)", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./*": "./src/../../*", - "./dist/*": "./dist/*" - })), - request: "./dist/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking target folder #1", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../../index"]), - exports_field: exports_field(json!({ - "./utils/": "./dist/" - })), - request: "./utils/timezone/../../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #1 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../../index"]), - exports_field: exports_field(json!({ - "./utils/*": "./dist/*" - })), - request: "./utils/timezone/../../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #2", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../index"]), - exports_field: exports_field(json!({ - "./utils/": "./dist/" - })), - request: "./utils/timezone/../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #2 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../index"]), - exports_field: exports_field(json!({ - "./utils/*": "./dist/*" - })), - request: "./utils/timezone/../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #3", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/target/../../index"]), - exports_field: exports_field(json!({ - "./utils/": "./dist/target/" - })), - request: "./utils/../../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #3 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/target/../../index"]), - exports_field: exports_field(json!({ - "./utils/*": "./dist/target/*" - })), - request: "./utils/../../index", - condition_names: vec![], - }, - // enhanced-resolve does not handle `node_modules` in target - TestCase { - name: "nested node_modules path #1", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": "./node_modules/" - } - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #1 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "./node_modules/*" - } - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #2", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./utils/../node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/": "./utils/../node_modules/" - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "nested node_modules path #2 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./utils/../node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": "./utils/../node_modules/*" - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "nested mapping #1", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": "./", - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested mapping #1 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": "./*", - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "nested mapping #2 (wildcard)", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #2 (wildcard)", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "nested mapping #3", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["webpack"], - }, - TestCase { - name: "nested mapping #3 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["webpack"], - }, - TestCase { - name: "nested mapping #4", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["node", "browser"], - }, - TestCase { - name: "nested mapping #4 (wildcard)", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["node", "browser"], - }, - TestCase { - name: "nested mapping #5", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node"], - }, - TestCase { - name: "nested mapping #5 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": { - "webpack": [ - "./wpck/*" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node"], - }, - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - TestCase { - name: "nested mapping #6 (wildcard)", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": { - "webpack": [ - "./wpck/*" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #6 (wildcard)", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./node/*" - ], - "default": { - "node": { - "webpack": [ - "./wpck/*" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - TestCase { - name: "nested mapping #7", - expect: Some(vec!["./y.js"]), - exports_field: exports_field(json!({ - "./a.js": { - "abc": { - "def": "./x.js" - }, - "ghi": "./y.js" - } - })), - request: "./a.js", - condition_names: vec!["abc", "ghi"], - }, - TestCase { - name: "nested mapping #8", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./a.js": { - "abc": { - "def": "./x.js", - "default": [] - }, - "ghi": "./y.js" - } - })), - request: "./a.js", - condition_names: vec!["abc", "ghi"], - }, - TestCase { - name: "syntax sugar #1", - expect: Some(vec!["./main.js"]), - exports_field: exports_field(json!("./main.js")), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #2", - expect: Some(vec![]), - exports_field: exports_field(json!("./main.js")), - request: "./lib.js", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #3", - expect: Some(vec!["./a.js"]), - exports_field: exports_field(json!(["./a.js", "./b.js"])), - request: ".", - condition_names: vec![], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "syntax sugar #3", - expect: Some(vec!["./b.js"]), - exports_field: exports_field(json!(["./b.js"])), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #4", - expect: Some(vec![]), - exports_field: exports_field(json!(["./a.js", "./b.js"])), - request: "./lib.js", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #5", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "browser": { - "default": "./index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "syntax sugar #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "browser": { - "default": "./index.js" - } - })), - request: "./lib.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "syntax sugar #7", - expect: None, - exports_field: exports_field(json!({ - "./node": "./node.js", - "browser": { - "default": "./index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "syntax sugar #8", - expect: None, - exports_field: exports_field(json!({ - "browser": { - "default": "./index.js" - }, - "./node": "./node.js" - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #1", - expect: Some(vec!["./abc/d"]), - exports_field: exports_field(json!({ - "./ab*": "./ab/*", - "./abc*": "./abc/*", - "./a*": "./a/*" - })), - request: "./abcd", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #2", - expect: Some(vec!["./abc/d/e"]), - exports_field: exports_field(json!({ - "./ab*": "./ab/*", - "./abc*": "./abc/*", - "./a*": "./a/*" - })), - request: "./abcd/e", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #3", - expect: Some(vec!["./abc/d"]), - exports_field: exports_field(json!({ - "./x/ab*": "./ab/*", - "./x/abc*": "./abc/*", - "./x/a*": "./a/*" - })), - request: "./x/abcd", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #4", - expect: Some(vec!["./abc/d/e"]), - exports_field: exports_field(json!({ - "./x/ab*": "./ab/*", - "./x/abc*": "./abc/*", - "./x/a*": "./a/*" - })), - request: "./x/abcd/e", - condition_names: vec!["browser"], - }, - TestCase { - name: "path tree edge case #1", - expect: Some(vec!["./A/b/d.js"]), - exports_field: exports_field(json!({ - "./a/": "./A/", - "./a/b/c": "./c.js" - })), - request: "./a/b/d.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #1 (wildcard)", - expect: Some(vec!["./A/b/d.js"]), - exports_field: exports_field(json!({ - "./a/*": "./A/*", - "./a/b/c": "./c.js" - })), - request: "./a/b/d.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #2", - expect: Some(vec!["./A/c.js"]), - exports_field: exports_field(json!({ - "./a/": "./A/", - "./a/b": "./b.js" - })), - request: "./a/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #2 (wildcard)", - expect: Some(vec!["./A/c.js"]), - exports_field: exports_field(json!({ - "./a/*": "./A/*", - "./a/b": "./b.js" - })), - request: "./a/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #3", - expect: Some(vec!["./A/b/d/c.js"]), - exports_field: exports_field(json!({ - "./a/": "./A/", - "./a/b/c/d": "./c.js" - })), - request: "./a/b/d/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #3 (wildcard)", - expect: Some(vec!["./A/b/d/c.js"]), - exports_field: exports_field(json!({ - "./a/*": "./A/*", - "./a/b/c/d": "./c.js" - })), - request: "./a/b/d/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #1", - expect: Some(vec!["./A/b.js"]), - exports_field: exports_field(json!({ - "./a/*.js": "./A/*.js" - })), - request: "./a/b.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #2", - expect: Some(vec!["./A/b/c.js"]), - exports_field: exports_field(json!({ - "./a/*.js": "./A/*.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #3", - expect: Some(vec!["./A/b/c.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": "./A/*/c.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #4", - expect: Some(vec!["./A/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": "./A/*/*.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #5", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/*.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #5", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/*.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./lib/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #6", - expect: Some(vec!["./browser/foo/bar.js"]), - exports_field: exports_field(json!({ - "./lib/*/bar.js": { - "browser": [ - "./browser/*/bar.js" - ] - }, - "./dist/*/bar.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./lib/foo/bar.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #6", - expect: Some(vec!["./browser/foo.js"]), - exports_field: exports_field(json!({ - "./lib/*/bar.js": { - "browser": [ - "./browser/*/bar.js" - ] - }, - "./dist/*/bar.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./dist/foo/bar.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #7", - expect: Some(vec!["./browser/foo/default.js"]), - exports_field: exports_field(json!({ - "./lib/*/bar.js": { - "browser": [ - "./browser/*/bar.js" - ] - }, - "./dist/*/bar.js": { - "node": "./*.js", - "default": "./browser/*/default.js" - } - })), - request: "./dist/foo/bar.js", - condition_names: vec!["default"], - }, - TestCase { - name: "wildcard pattern #8", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": "./A/*/*/*.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #9", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": [ - "./A/*/*/*.js", - "./B/*/*/*.js" - ] - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "wildcard pattern #9", - expect: Some(vec!["./B/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": [ - "./B/*/*/*.js" - ] - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #10", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/foo-*/c.js": "./A/*/*/*.js" - })), - request: "./a/foo-b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #11", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*-foo/c.js": "./A/*/*/*.js" - })), - request: "./a/b-foo/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #12", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/foo-*-foo/c.js": "./A/*/*/*.js" - })), - request: "./a/foo-b-foo/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #13", - expect: Some(vec!["./A/b/c/d.js"]), - exports_field: exports_field(json!({ - "./a/foo-*-foo/c.js": "./A/b/c/d.js" - })), - request: "./a/foo-b-foo/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #14", - expect: Some(vec!["./A/b/c/*.js"]), - exports_field: exports_field(json!({ - "./a/foo-foo/c.js": "./A/b/c/*.js" - })), - request: "./a/foo-foo/c.js", - condition_names: vec![], - }, - ]; - - for case in test_cases { - let resolved = Resolver::new(ResolveOptions { - condition_names: case - .condition_names - .iter() - .map(ToString::to_string) - .collect::>(), - ..ResolveOptions::default() - }) - .package_exports_resolve( - Path::new(""), - case.request, - &case.exports_field, - &mut Ctx::default(), - ) - .map(|p| p.map(|p| p.to_path_buf())); - if let Some(expect) = case.expect { - if expect.is_empty() { - assert!( - matches!(resolved, Err(ResolveError::PackagePathNotExported(_, _))), - "{} {:?}", - &case.name, - &resolved - ); - } else { - for expect in expect { - assert_eq!(resolved, Ok(Some(Path::new(expect).normalize())), "{}", &case.name); - } - } - } else { - assert!(resolved.is_err(), "{} {resolved:?}", &case.name); - } - } -} diff --git a/src/tests/extension_alias.rs b/src/tests/extension_alias.rs deleted file mode 100644 index cc6a906b..00000000 --- a/src/tests/extension_alias.rs +++ /dev/null @@ -1,70 +0,0 @@ -//! - -use crate::{ResolveError, ResolveOptions, Resolver}; - -#[test] -fn extension_alias() { - let f = super::fixture().join("extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - extension_alias: vec![ - (".js".into(), vec![".ts".into(), ".js".into()]), - (".mjs".into(), vec![".mts".into()]), - ], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should alias fully specified file", f.clone(), "./index.js", f.join("index.ts")), - ("should alias fully specified file when there are two alternatives", f.clone(), "./dir/index.js", f.join("dir/index.ts")), - ("should also allow the second alternative", f.clone(), "./dir2/index.js", f.join("dir2/index.js")), - ("should support alias option without an array", f.clone(), "./dir2/index.mjs", f.join("dir2/index.mts")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } - - #[rustfmt::skip] - let fail = [ - ("should not allow to fallback to the original extension or add extensions", f.clone(), "./index.mjs"), - ]; - - for (comment, path, request) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!( - resolution, - Err(ResolveError::ExtensionAlias(f.join(request))), - "{comment} {path:?} {request}" - ); - } -} - -// should not apply extension alias to extensions or mainFiles field -#[test] -fn not_apply_to_extension_nor_main_files() { - let f = super::fixture().join("extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - extension_alias: vec![(".js".into(), vec![])], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("directory", f.clone(), "./dir2", "dir2/index.js"), - ("file", f.clone(), "./dir2/index", "dir2/index.js"), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - let expected = f.join(expected); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} diff --git a/src/tests/extensions.rs b/src/tests/extensions.rs deleted file mode 100644 index 1ebd86f4..00000000 --- a/src/tests/extensions.rs +++ /dev/null @@ -1,125 +0,0 @@ -//! - -use crate::{EnforceExtension, Resolution, ResolveContext, ResolveError, ResolveOptions, Resolver}; -use rustc_hash::FxHashSet; - -#[test] -fn extensions() { - let f = super::fixture().join("extensions"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".ts".into(), ".js".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve according to order of provided extensions", "./foo", "foo.ts"), - ("should resolve according to order of provided extensions (dir index)", "./dir", "dir/index.ts"), - ("should resolve according to main field in module root", ".", "index.js"), - // This is a core module - // ("should resolve single file module before directory", "module", "node_modules/module.js"), - ("should resolve trailing slash directory before single file", "module/", "node_modules/module/index.ts"), - ]; - - for (comment, request, expected_path) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - let expected = f.join(expected_path); - assert_eq!(resolved_path, Ok(expected), "{comment} {request} {expected_path}"); - } - - #[rustfmt::skip] - let fail = [ - ("not resolve to file when request has a trailing slash (relative)", "./foo.js/", "./foo.js/".into()) - ]; - - for (comment, request, expected_error) in fail { - let resolution = resolver.resolve(&f, request); - let error = ResolveError::NotFound(expected_error); - assert_eq!(resolution, Err(error), "{comment} {request} {resolution:?}"); - } -} - -// should default enforceExtension to true when extensions includes an empty string -#[test] -fn default_enforce_extension() { - let f = super::fixture().join("extensions"); - - let mut ctx = ResolveContext::default(); - let resolved = Resolver::new(ResolveOptions { - extensions: vec![".ts".into(), String::new(), ".js".into()], - ..ResolveOptions::default() - }) - .resolve_with_context(&f, "./foo", &mut ctx); - - assert_eq!(resolved.map(Resolution::into_path_buf), Ok(f.join("foo.ts"))); - assert_eq!( - ctx.file_dependencies, - FxHashSet::from_iter([f.join("foo.ts"), f.join("package.json")]) - ); - assert!(ctx.missing_dependencies.is_empty()); -} - -// should respect enforceExtension when extensions includes an empty string -#[test] -fn respect_enforce_extension() { - let f = super::fixture().join("extensions"); - - let mut ctx = ResolveContext::default(); - let resolved = Resolver::new(ResolveOptions { - enforce_extension: EnforceExtension::Disabled, - extensions: vec![".ts".into(), String::new(), ".js".into()], - ..ResolveOptions::default() - }) - .resolve_with_context(&f, "./foo", &mut ctx); - - assert_eq!(resolved.map(Resolution::into_path_buf), Ok(f.join("foo.ts"))); - assert_eq!( - ctx.file_dependencies, - FxHashSet::from_iter([f.join("foo.ts"), f.join("package.json")]) - ); - assert_eq!(ctx.missing_dependencies, FxHashSet::from_iter([f.join("foo")])); -} - -#[test] -fn multi_dot_extension() { - let f = super::fixture().join("extensions"); - - let resolver = Resolver::new(ResolveOptions { - // Test for `.d.ts`, not part of enhanced-resolve. - extensions: vec![".a.b.c".into(), ".d.ts".into(), ".ts".into(), ".js".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve according to order of provided extensions", "./foo", "foo.ts"), - ("should resolve file with extension", "./app.module", "app.module.js") - ]; - - for (comment, request, expected_path) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - let expected = f.join(expected_path); - assert_eq!(resolved_path, Ok(expected), "{comment} {request} {expected_path}"); - } - - #[rustfmt::skip] - let fail = [ - ("not resolve to file", "./index.", "./index.".into()) - ]; - - for (comment, request, expected_error) in fail { - let resolution = resolver.resolve(&f, request); - let error = ResolveError::NotFound(expected_error); - assert_eq!(resolution, Err(error), "{comment} {request} {resolution:?}"); - } -} - -#[test] -#[should_panic = "All extensions must start with a leading dot"] -fn without_leading_dot() { - Resolver::new(ResolveOptions { - extensions: vec!["ts".into(), "js".into()], - ..ResolveOptions::default() - }); -} diff --git a/src/tests/fallback.rs b/src/tests/fallback.rs deleted file mode 100644 index 3da2d767..00000000 --- a/src/tests/fallback.rs +++ /dev/null @@ -1,100 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/fallback.test.js - -#[test] -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -fn fallback() { - use super::memory_fs::MemoryFS; - use crate::{AliasValue, ResolveError, ResolveOptions, ResolverGeneric}; - use std::path::{Path, PathBuf}; - - let f = Path::new("/"); - - let file_system = MemoryFS::new(&[ - ("/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", ""), - ]); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - fallback: vec![ - ("aliasA".into(), vec![AliasValue::Path("a".into())]), - ("b$".into(), vec![AliasValue::Path("a/index".into())]), - ("c$".into(), vec![AliasValue::Path("/a/index".into())]), - ( - "multiAlias".into(), - vec![ - AliasValue::Path("b".into()), - AliasValue::Path("c".into()), - AliasValue::Path("d".into()), - AliasValue::Path("e".into()), - AliasValue::Path("a".into()), - ], - ), - ("recursive".into(), vec![AliasValue::Path("recursive/dir".into())]), - ("/d/dir".into(), vec![AliasValue::Path("/c/dir".into())]), - ("/d/index.js".into(), vec![AliasValue::Path("/c/index".into())]), - ("ignored".into(), vec![AliasValue::Ignore]), - ("node:path".into(), vec![AliasValue::Ignore]), - ], - modules: vec!["/".into()], - ..ResolveOptions::default() - }, - ); - - #[rustfmt::skip] - let pass = [ - ("should resolve a not aliased module 1", "a", "/a/index"), - ("should resolve a not aliased module 2", "a/index", "/a/index"), - ("should resolve a not aliased module 3", "a/dir", "/a/dir/index"), - ("should resolve a not aliased module 4", "a/dir/index", "/a/dir/index"), - ("should resolve an fallback module 1", "aliasA", "/a/index"), - ("should resolve an fallback module 2", "aliasA/index", "/a/index"), - ("should resolve an fallback module 3", "aliasA/dir", "/a/dir/index"), - ("should resolve an fallback module 4", "aliasA/dir/index", "/a/dir/index"), - ("should resolve a recursive aliased module 1", "recursive", "/recursive/index"), - ("should resolve a recursive aliased module 2", "recursive/index", "/recursive/index"), - ("should resolve a recursive aliased module 3", "recursive/dir", "/recursive/dir/index"), - ("should resolve a recursive aliased module 4", "recursive/dir/index", "/recursive/dir/index"), - ("should resolve a recursive aliased module 5", "recursive/file", "/recursive/dir/file"), - ("should resolve a file aliased module with a query 1", "b?query", "/b/index?query"), - ("should resolve a file aliased module with a query 2", "c?query", "/c/index?query"), - ("should resolve a path in a file aliased module 1", "b/index", "/b/index"), - ("should resolve a path in a file aliased module 2", "b/dir", "/b/dir/index"), - ("should resolve a path in a file aliased module 3", "b/dir/index", "/b/dir/index"), - ("should resolve a path in a file aliased module 4", "c/index", "/c/index"), - ("should resolve a path in a file aliased module 5", "c/dir", "/c/dir/index"), - ("should resolve a path in a file aliased module 6", "c/dir/index", "/c/dir/index"), - ("should resolve a file in multiple aliased dirs 1", "multiAlias/dir/file", "/e/dir/file"), - ("should resolve a file in multiple aliased dirs 2", "multiAlias/anotherDir", "/e/anotherDir/index"), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - - #[rustfmt::skip] - let ignore = [ - ("should resolve an ignore module", "ignored", ResolveError::Ignored(f.join("ignored"))), - ("should resolve node: builtin module", "node:path", ResolveError::Ignored(PathBuf::from("/node:path"))), - ]; - - for (comment, request, expected) in ignore { - let resolution = resolver.resolve(f, request); - assert_eq!(resolution, Err(expected), "{comment} {request}"); - } -} diff --git a/src/tests/full_specified.rs b/src/tests/full_specified.rs deleted file mode 100644 index a70c0191..00000000 --- a/src/tests/full_specified.rs +++ /dev/null @@ -1,113 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/fullSpecified.test.js - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows { - use std::path::PathBuf; - - use crate::{AliasValue, ResolveOptions, ResolverGeneric}; - - use super::super::memory_fs::MemoryFS; - - fn file_system() -> MemoryFS { - MemoryFS::new(&[ - ("/a/node_modules/package1/index.js", ""), - ("/a/node_modules/package1/file.js", ""), - ("/a/node_modules/package2/package.json", r#"{"main":"a"}"#), - ("/a/node_modules/package2/a.js", ""), - ("/a/node_modules/package3/package.json", r#"{"main":"dir"}"#), - ("/a/node_modules/package3/dir/index.js", ""), - ("/a/node_modules/package4/package.json", r#"{"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", ""), - ]) - } - - #[test] - fn test() { - let file_system = file_system(); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - alias: vec![ - ("alias1".into(), vec![AliasValue::from("/a/abc")]), - ("alias2".into(), vec![AliasValue::from("/a")]), - ], - alias_fields: vec![vec!["browser".into()]], - fully_specified: true, - ..ResolveOptions::default() - }, - ); - - let failing_resolves = [ - ("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"), - ]; - - for (comment, request) in failing_resolves { - let resolution = resolver.resolve("/a", request); - assert!(resolution.is_err(), "{comment} {request}"); - } - - let successful_resolves = [ - ("fully relative", "./abc.js", "/a/abc.js"), - ("fully absolute", "/a/abc.js", "/a/abc.js"), - ("fully relative in package", "package1/file.js", "/a/node_modules/package1/file.js"), - ("extensions in mainFiles", "package1", "/a/node_modules/package1/index.js"), - ("extensions in mainFields", "package2", "/a/node_modules/package2/a.js"), - ("extensions in alias", "alias1", "/a/abc.js"), - ("directories in alias", "alias2", "/a/index.js"), - ("directories in packages", "package3", "/a/node_modules/package3/dir/index.js"), - ("extensions in aliasFields", "package4/a.js", "/a/node_modules/package4/b.js"), - ]; - - for (comment, request, expected) in successful_resolves { - let resolution = resolver.resolve("/a", request).map(|r| r.full_path()); - assert_eq!(resolution, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - } - - #[test] - #[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. - fn resolve_to_context() { - let file_system = file_system(); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - alias: vec![ - ("alias1".into(), vec![AliasValue::from("/a/abc")]), - ("alias2".into(), vec![AliasValue::from("/a")]), - ], - alias_fields: vec![vec!["browser".into()]], - fully_specified: true, - resolve_to_context: true, - ..ResolveOptions::default() - }, - ); - - let successful_resolves = [ - ("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", "/a/node_modules/package3/dir"), - ]; - - for (comment, request, expected) in successful_resolves { - let resolution = resolver.resolve("/a", request).map(|r| r.full_path()); - assert_eq!(resolution, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - } -} diff --git a/src/tests/imports_field.rs b/src/tests/imports_field.rs deleted file mode 100644 index c928627a..00000000 --- a/src/tests/imports_field.rs +++ /dev/null @@ -1,1320 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/importsField.test.js -//! -//! The huge imports field test cases are at the bottom of this file. - -use serde_json::json; - -use crate::{Ctx, JSONMap, PathUtil, ResolveError, ResolveOptions, Resolver}; -use std::path::Path; - -#[test] -fn test_simple() { - let f = super::fixture().join("imports-field"); - let f2 = super::fixture().join("imports-exports-wildcard/node_modules/m/"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve using imports field instead of self-referencing", f.clone(), "#imports-field", f.join("b.js")), - ("should resolve using imports field instead of self-referencing for a subpath", f.join("dir"), "#imports-field", f.join("b.js")), - ("should resolve package #1", f.clone(), "#a/dist/main.js", f.join("node_modules/a/lib/lib2/main.js")), - ("should resolve package #3", f.clone(), "#ccc/index.js", f.join("node_modules/c/index.js")), - ("should resolve package #4", f.clone(), "#c", f.join("node_modules/c/index.js")), - ("should resolve with wildcard pattern", f2.clone(), "#internal/i.js", f2.join("src/internal/i.js")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } - - // Note added: - // * should resolve absolute path as an imports field target - // * should log the correct info - - #[rustfmt::skip] - let fail = [ - ("should disallow resolve out of package scope", f.clone(), "#b", ResolveError::InvalidPackageTarget("../b.js".to_string(), "#b".to_string(), f.join("package.json"))), - ("should resolve package #2", f.clone(), "#a", ResolveError::PackageImportNotDefined("#a".to_string(), f.join("package.json"))), - ]; - - for (comment, path, request, error) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!(resolution, Err(error), "{comment} {path:?} {request}"); - } -} - -#[test] -fn shared_resolvers() { - let f = super::fixture().join("imports-field"); - - // field name #1 - let resolver1 = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - imports_fields: vec![vec!["imports".into()]], - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - let resolved_path = resolver1.resolve(&f, "#imports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("b.js"))); - - // field name #2 - let resolver2 = resolver1.clone_with_options(ResolveOptions { - imports_fields: vec![vec!["other".into(), "imports".into()]], - ..ResolveOptions::default() - }); - - let resolved_path = resolver2.resolve(&f, "#b").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("a.js"))); -} - -// Small script for generating the test cases from enhanced_resolve -// for (c of testCases) { -// console.log("TestCase {") -// console.log(`name: ${JSON.stringify(c.name)},`) -// if (c.expect instanceof Error) { -// console.log(`expect: None,`) -// } else { -// console.log(`expect: Some(vec!${JSON.stringify(c.expect)}),`) -// } -// console.log(`imports_field: imports_field(json!(${JSON.stringify(c.suite[0], null, 2)})),`) -// console.log(`request: "${c.suite[1]}",`) -// console.log(`condition_names: vec!${JSON.stringify(c.suite[2])},`) -// console.log("},") -// } - -struct TestCase { - name: &'static str, - expect: Option>, - imports_field: JSONMap, - request: &'static str, - condition_names: Vec<&'static str>, -} - -#[allow(clippy::needless_pass_by_value)] -fn imports_field(value: serde_json::Value) -> JSONMap { - let s = serde_json::to_string(&value).unwrap(); - serde_json::from_str(&s).unwrap() -} - -#[test] -fn test_cases() { - let test_cases = [ - TestCase { - name: "sample #1", - expect: Some(vec!["./dist/test/file.js"]), - imports_field: imports_field(json!({ - "#abc/": { - "import": [ - "./dist/", - "./src/" - ], - "webpack": "./wp/" - }, - "#abc": "./main.js" - })), - request: "#abc/test/file.js", - condition_names: vec!["import", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "sample #1", - expect: Some(vec!["./src/test/file.js"]), - imports_field: imports_field(json!({ - "#abc/": { - "import": [ - "./src/" - ], - "webpack": "./wp/" - }, - "#abc": "./main.js" - })), - request: "#abc/test/file.js", - condition_names: vec!["import", "webpack"], - }, - TestCase { - name: "sample #2", - expect: Some(vec!["./data/timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#1/timezones/": "./data/timezones/" - })), - request: "#1/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #3", - expect: Some(vec!["./data/timezones/timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#aaa/": "./data/timezones/", - "#a/": "./data/timezones/" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #4", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/lib/": { - "browser": [ - "./browser/" - ] - }, - "#a/dist/index.js": { - "node": "./index.js" - } - })), - request: "#a/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #5", - expect: Some(vec!["./browser/index.js"]), - imports_field: imports_field(json!({ - "#a/lib/": { - "browser": [ - "./browser/" - ] - }, - "#a/dist/index.js": { - "node": "./index.js", - "default": "./browser/index.js" - } - })), - request: "#a/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #6", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/dist/a": "./dist/index.js" - })), - request: "#a/dist/aaa", - condition_names: vec![], - }, - TestCase { - name: "sample #7", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/a/a/": "./dist/index.js" - })), - request: "#a/a/a", - condition_names: vec![], - }, - TestCase { - name: "sample #8", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": "./index.js" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #9", - expect: Some(vec!["./main.js"]), - imports_field: imports_field(json!({ - "#a/index.js": "./main.js" - })), - request: "#a/index.js", - condition_names: vec![], - }, - TestCase { - name: "sample #10", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #11", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/bar#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #12", - expect: Some(vec!["./ok.js#abc"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/ok.js#abc", - condition_names: vec![], - }, - TestCase { - name: "sample #13", - expect: Some(vec!["./ok.js?abc"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/ok.js?abc", - condition_names: vec![], - }, - TestCase { - name: "sample #14", - expect: Some(vec!["./🎉.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/🎉.js", - condition_names: vec![], - }, - TestCase { - name: "sample #15", - expect: Some(vec!["./%F0%9F%8E%89.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/%F0%9F%8E%89.js", - condition_names: vec![], - }, - TestCase { - name: "sample #16", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/🎉", - condition_names: vec![], - }, - TestCase { - name: "sample #17", - expect: Some(vec!["./other.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/%F0%9F%8E%89", - condition_names: vec![], - }, - TestCase { - name: "sample #18", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/module", - condition_names: vec![], - }, - TestCase { - name: "sample #19", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/module#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #20", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/module?foo", - condition_names: vec![], - }, - TestCase { - name: "sample #21", - expect: Some(vec!["./d?e?f"]), - imports_field: imports_field(json!({ - "#a/a?b?c/": "./" - })), - request: "#a/a?b?c/d?e?f", - condition_names: vec![], - }, - TestCase { - name: "sample #22", - // We throw InvalidPackageTarget - expect: None, - // expect: Some(vec!["/user/a/index"]), - imports_field: imports_field(json!({ - "#a/": "/user/a/" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #1", - expect: Some(vec!["./A/b/d.js"]), - imports_field: imports_field(json!({ - "#a/": "./A/", - "#a/b/c": "./c.js" - })), - request: "#a/b/d.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #2", - expect: Some(vec!["./A/c.js"]), - imports_field: imports_field(json!({ - "#a/": "./A/", - "#a/b": "./b.js" - })), - request: "#a/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #3", - expect: Some(vec!["./A/b/c/d.js"]), - imports_field: imports_field(json!({ - "#a/": "./A/", - "#a/b/c/d": "./c.js" - })), - request: "#a/b/c/d.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #1", - expect: Some(vec!["./dist/index.js"]), - imports_field: imports_field(json!({ - "#a": "./dist/index.js" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #2", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": "./" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #3", - expect: Some(vec!["./dist/a.js"]), - imports_field: imports_field(json!({ - "#a/": "./dist/", - "#a/index.js": "./dist/a.js" - })), - request: "#a/index.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #4", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "./browser/" - ] - }, - "#a/index.js": { - "browser": "./index.js" - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #5", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "./browser/" - ] - }, - "#a/index.js": { - "node": "./node.js" - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #6", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: "#a", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #7", - expect: Some(vec!["./src/index.js"]), // `enhanced_resolve` is `None` - imports_field: imports_field(json!({ - "#a": { - "default": "./src/index.js", - "browser": "./index.js", - "node": "./src/node/index.js" - } - })), - request: "#a", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #8", - expect: Some(vec!["./src/index.js"]), - imports_field: imports_field(json!({ - "#a": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #9", - expect: Some(vec!["./index"]), - imports_field: imports_field(json!({ - "#a": "./index" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #10", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/index": "./index.js" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #11", - // We throw InvalidPackageTarget - // expect: Some(vec!["b"]), - expect: None, - imports_field: imports_field(json!({ - "#a": "b" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #12", - // We throw InvalidPackageTarget - // expect: Some(vec!["b/index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "b/" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #13", - // We throw InvalidPackageTarget - // expect: Some(vec!["b#anotherhashishere"]), - expect: None, - imports_field: imports_field(json!({ - "#a?q=a#hashishere": "b#anotherhashishere" - })), - request: "#a?q=a#hashishere", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #1", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #2", - expect: Some(vec!["./import.mjs"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec!["import"], - }, - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./require.js"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./import.mjs"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./require.js"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": [ - "./require.js" - ] - }, - { - "import": [ - "./import.mjs", - "#b/import.js" - ] - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./import.mjs"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "./import.mjs", - "#b/import.js" - ] - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "#b/import.js" - ] - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "mapping to a folder root #1", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#timezones": "./data/timezones/" - })), - request: "#timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #2", - expect: None, - imports_field: imports_field(json!({ - "#timezones/": "./data/timezones" - })), - request: "#timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #3", - expect: Some(vec!["./data/timezones/pdt/index.mjs"]), - imports_field: imports_field(json!({ - "#timezones/pdt/": "./data/timezones/pdt/" - })), - request: "#timezones/pdt/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #4", - expect: Some(vec!["./timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#a/": "./timezones/" - })), - request: "#a/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #5", - expect: Some(vec!["./timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#a/": "./" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #6", - expect: None, - imports_field: imports_field(json!({ - "#a/": "." - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #7", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": "./" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #1", - expect: Some(vec!["./lib/index.mjs"]), - imports_field: imports_field(json!({ - "#a/": "./", - "#a/dist/": "./lib/" - })), - request: "#a/dist/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #2", - expect: Some(vec!["./dist/utils/index.js"]), - imports_field: imports_field(json!({ - "#a/dist/utils/": "./dist/utils/", - "#a/dist/": "./lib/" - })), - request: "#a/dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #3", - expect: Some(vec!["./dist/utils/index.js"]), - imports_field: imports_field(json!({ - "#a/dist/utils/index.js": "./dist/utils/index.js", - "#a/dist/utils/": "./dist/utils/index.mjs", - "#a/dist/": "./lib/" - })), - request: "#a/dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #4", - expect: Some(vec!["./lib/index.mjs"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./browser/" - }, - "#a/dist/": "./lib/" - })), - request: "#a/dist/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #1", - // This behaves differently from enhanced_resolve, because `lodash/` is an an InvalidPackageConfig - // expect: Some(vec!["lodash/index.js"]), - expect: Some(vec!["./utils/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "conditional mapping folder #1", - expect: Some(vec!["./utils/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #2", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./node/" - ] - } - })), - request: "#a/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "conditional mapping folder #3", - expect: Some(vec!["./wpk/index.mjs"]), - imports_field: imports_field(json!({ - "#a/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils/" - ] - } - })), - request: "#a/index.mjs", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "incorrect exports field #1", - // We throw `PackageImportNotDefined` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "/utils/": "./a/" - })), - request: "#a/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #2", - // We throw `PackageImportNotDefined` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "/utils/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#a/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #3", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index": "./a/index.js" - })), - request: "#a/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #4", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index.mjs": "./a/index.js" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #5", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "#a/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #6", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index.mjs": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "#a/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #1", - // We don't throw in `package_imports_exports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": "./a/" - })), - request: "/utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect request #2", - // We don't throw in `package_imports_exports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #3", - // We don't throw in `package_imports_exports_resolve`, it's thrown in `package_imports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #4", - // We don't throw in `package_imports_exports_resolve`, it's thrown in `package_imports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#/", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #5", - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#a/", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #1", - // expect: Some(vec!["./dist/index"]), - expect: Some(vec!["dist/index"]), - imports_field: imports_field(json!({ - "#a/../../utils/": "./dist/" - })), - request: "#a/../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #2", - // We throw InvalidPackageTarget - // expect: Some(vec!["./dist/../../utils/index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "./dist/" - })), - request: "#a/../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #3", - // We throw InvalidPackageTarget - // expect: Some(vec!["../src/index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "../src/" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #4", - // We throw InvalidPackageTarget - // expect: Some(vec!["./utils/../../../index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": { - "browser": "./utils/../../../" - } - })), - request: "#a/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #1", - // expect: Some(vec!["moment/node_modules/lodash/dist/index.js"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": { - "browser": "moment/node_modules/" - } - })), - request: "#a/lodash/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #2", - // We throw InvalidPackageTarget - // expect: Some(vec!["../node_modules/lodash/dist/index.js"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "../node_modules/" - })), - request: "#a/lodash/dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "nested mapping #1", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": "./", - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./node/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "nested mapping #3", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["webpack"], - }, - TestCase { - name: "nested mapping #4", - // We throw NotFound - // expect: Some(vec!["moment/node/index.js"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "moment/node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["node", "browser"], - }, - TestCase { - name: "nested mapping #5", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "node"], - }, - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./node/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - TestCase { - name: "nested mapping #7", - expect: Some(vec!["./y.js"]), - imports_field: imports_field(json!({ - "#a": { - "abc": { - "def": "./x.js" - }, - "ghi": "./y.js" - } - })), - request: "#a", - condition_names: vec!["abc", "ghi"], - }, - TestCase { - name: "nested mapping #8", - // We throw PackageImportNotDefined - // expect: Some(vec![]), - expect: None, - imports_field: imports_field(json!({ - "#a": { - "abc": { - "def": "./x.js", - "default": [] - }, - "ghi": "./y.js" - } - })), - request: "#a", - condition_names: vec!["abc", "ghi"], - }, - ]; - - for case in test_cases { - let resolved = Resolver::default() - .package_imports_exports_resolve( - case.request, - &case.imports_field, - Path::new(""), - true, - &case.condition_names.iter().map(ToString::to_string).collect::>(), - &mut Ctx::default(), - ) - .map(|p| p.map(|p| p.to_path_buf())); - if let Some(expect) = case.expect { - if expect.is_empty() { - assert!(matches!(resolved, Ok(None)), "{} {:?}", &case.name, &resolved); - } else { - for expect in expect { - assert_eq!(resolved, Ok(Some(Path::new(expect).normalize())), "{}", &case.name); - } - } - } else { - assert!(resolved.is_err(), "{} {resolved:?}", &case.name); - } - } -} diff --git a/src/tests/incorrect_description_file.rs b/src/tests/incorrect_description_file.rs deleted file mode 100644 index e2caecbb..00000000 --- a/src/tests/incorrect_description_file.rs +++ /dev/null @@ -1,65 +0,0 @@ -//! - -use rustc_hash::FxHashSet; - -use crate::{JSONError, Resolution, ResolveContext, ResolveError, ResolveOptions, Resolver}; - -// should not resolve main in incorrect description file #1 -#[test] -fn incorrect_description_file_1() { - let f = super::fixture().join("incorrect-package"); - let mut ctx = ResolveContext::default(); - let resolution = Resolver::default().resolve_with_context(f.join("pack1"), ".", &mut ctx); - let error = ResolveError::JSON(JSONError { - path: f.join("pack1/package.json"), - message: String::from("EOF while parsing a value at line 3 column 0"), - line: 3, - column: 0, - }); - assert_eq!(resolution, Err(error)); - assert_eq!( - ctx.file_dependencies, - FxHashSet::from_iter([f.join("pack1"), f.join("pack1/package.json")]) - ); - assert!(!ctx.missing_dependencies.is_empty()); -} - -// should not resolve main in incorrect description file #2 -#[test] -fn incorrect_description_file_2() { - let f = super::fixture().join("incorrect-package"); - let resolution = Resolver::default().resolve(f.join("pack2"), "."); - let error = ResolveError::JSON(JSONError { - path: f.join("pack2/package.json"), - message: String::from("EOF while parsing a value at line 1 column 0"), - line: 1, - column: 0, - }); - assert_eq!(resolution, Err(error)); -} - -// should not resolve main in incorrect description file #3 -#[test] -fn incorrect_description_file_3() { - let f = super::fixture().join("incorrect-package"); - let resolution = Resolver::default().resolve(f.join("pack2"), "."); - assert!(resolution.is_err()); -} - -// `enhanced_resolve` does not have this test case -#[test] -fn no_description_file() { - let f = super::fixture_root().join("enhanced_resolve"); - - // has description file - let resolver = Resolver::default(); - assert_eq!( - resolver.resolve(&f, ".").map(Resolution::into_path_buf), - Ok(f.join("lib/index.js")) - ); - - // without description file - let resolver = - Resolver::new(ResolveOptions { description_files: vec![], ..ResolveOptions::default() }); - assert_eq!(resolver.resolve(&f, "."), Err(ResolveError::NotFound(".".into()))); -} diff --git a/src/tests/main_field.rs b/src/tests/main_field.rs deleted file mode 100644 index 3cadc8ce..00000000 --- a/src/tests/main_field.rs +++ /dev/null @@ -1,24 +0,0 @@ -//! Not part of enhanced_resolve's test suite - -use crate::{ResolveOptions, Resolver}; - -#[test] -fn test() { - let f = super::fixture().join("restrictions"); - - let resolver1 = Resolver::new(ResolveOptions { - main_fields: vec!["style".into()], - ..ResolveOptions::default() - }); - - let resolution = resolver1.resolve(&f, "pck2").map(|r| r.full_path()); - assert_eq!(resolution, Ok(f.join("node_modules/pck2/index.css"))); - - let resolver2 = resolver1.clone_with_options(ResolveOptions { - main_fields: vec!["module".into(), "main".into()], - ..ResolveOptions::default() - }); - - let resolution = resolver2.resolve(&f, "pck2").map(|r| r.full_path()); - assert_eq!(resolution, Ok(f.join("node_modules/pck2/module.js"))); -} diff --git a/src/tests/memory_fs.rs b/src/tests/memory_fs.rs deleted file mode 100644 index e4116609..00000000 --- a/src/tests/memory_fs.rs +++ /dev/null @@ -1,74 +0,0 @@ -use std::{ - io, - path::{Path, PathBuf}, -}; - -use crate::{FileMetadata, FileSystem}; - -#[derive(Default)] -pub struct MemoryFS { - fs: vfs::MemoryFS, -} - -impl MemoryFS { - /// # Panics - /// - /// * Fails to create directory - /// * Fails to write file - #[allow(dead_code)] - pub fn new(data: &[(&'static str, &'static str)]) -> Self { - let mut fs = Self { fs: vfs::MemoryFS::default() }; - for (path, content) in data { - fs.add_file(Path::new(path), content); - } - fs - } - - #[allow(dead_code)] - pub fn add_file(&mut self, path: &Path, content: &str) { - use vfs::FileSystem; - let fs = &mut self.fs; - // Create all parent directories - for path in path.ancestors().collect::>().iter().rev() { - let path = path.to_string_lossy(); - if !fs.exists(path.as_ref()).unwrap() { - fs.create_dir(path.as_ref()).unwrap(); - } - } - // Create file - let mut file = fs.create_file(path.to_string_lossy().as_ref()).unwrap(); - file.write_all(content.as_bytes()).unwrap(); - } -} - -impl FileSystem for MemoryFS { - fn read_to_string(&self, path: &Path) -> io::Result { - use vfs::FileSystem; - let mut file = self - .fs - .open_file(path.to_string_lossy().as_ref()) - .map_err(|err| io::Error::new(io::ErrorKind::NotFound, err))?; - let mut buffer = String::new(); - file.read_to_string(&mut buffer).unwrap(); - Ok(buffer) - } - - fn metadata(&self, path: &Path) -> io::Result { - use vfs::FileSystem; - let metadata = self - .fs - .metadata(path.to_string_lossy().as_ref()) - .map_err(|err| io::Error::new(io::ErrorKind::NotFound, err))?; - let is_file = metadata.file_type == vfs::VfsFileType::File; - let is_dir = metadata.file_type == vfs::VfsFileType::Directory; - Ok(FileMetadata::new(is_file, is_dir, false)) - } - - fn symlink_metadata(&self, path: &Path) -> io::Result { - self.metadata(path) - } - - fn canonicalize(&self, _path: &Path) -> io::Result { - Err(io::Error::new(io::ErrorKind::NotFound, "not a symlink")) - } -} diff --git a/src/tests/missing.rs b/src/tests/missing.rs deleted file mode 100644 index 4bf611ef..00000000 --- a/src/tests/missing.rs +++ /dev/null @@ -1,106 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/missing.test.js - -use normalize_path::NormalizePath; - -use crate::{AliasValue, ResolveContext, ResolveOptions, Resolver}; - -#[test] -fn test() { - let f = super::fixture(); - - let data = [ - ( - "./missing-file", - vec![f.join("missing-file"), f.join("missing-file.js"), f.join("missing-file.node")], - ), - ( - "missing-module", - vec![ - f.join("node_modules/missing-module"), - f.parent().unwrap().join("node_modules"), // enhanced-resolve is "node_modules/missing-module" - ], - ), - ( - "missing-module/missing-file", - vec![ - f.join("node_modules/missing-module"), - // f.parent().unwrap().join("node_modules/missing-module"), // we don't report this - ], - ), - ( - "m1/missing-file", - vec![ - f.join("node_modules/m1/missing-file"), - f.join("node_modules/m1/missing-file.js"), - f.join("node_modules/m1/missing-file.node"), - // f.parent().unwrap().join("node_modules/m1"), // we don't report this - ], - ), - ( - "m1/", - vec![ - f.join("node_modules/m1/index"), - f.join("node_modules/m1/index.js"), - f.join("node_modules/m1/index.json"), - f.join("node_modules/m1/index.node"), - ], - ), - ("m1/a", vec![f.join("node_modules/m1/a")]), - ]; - - let resolver = Resolver::default(); - - for (specifier, missing_dependencies) in data { - let mut ctx = ResolveContext::default(); - let _ = resolver.resolve_with_context(&f, specifier, &mut ctx); - - for path in ctx.file_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - } - - for path in missing_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - assert!( - ctx.missing_dependencies.contains(&path), - "{specifier}: {path:?} not in {:?}", - &ctx.missing_dependencies - ); - } - } -} - -#[test] -fn alias_and_extensions() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias: vec![ - ( - "@scope-js/package-name/dir$".into(), - vec![AliasValue::Path(f.join("foo/index.js").to_string_lossy().to_string())], - ), - ( - "react-dom".into(), - vec![AliasValue::Path(f.join("foo/index.js").to_string_lossy().to_string())], - ), - ], - extensions: vec![".server.ts".into()], - - ..ResolveOptions::default() - }); - - let mut ctx = ResolveContext::default(); - let _ = resolver.resolve_with_context(&f, "@scope-js/package-name/dir/router", &mut ctx); - let _ = resolver.resolve_with_context(&f, "react-dom/client", &mut ctx); - - for path in ctx.file_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - } - - for path in ctx.missing_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - if let Some(path) = path.parent() { - assert!(!path.is_file(), "{path:?} must not be a file"); - } - } -} diff --git a/src/tests/mod.rs b/src/tests/mod.rs deleted file mode 100644 index e347dd1f..00000000 --- a/src/tests/mod.rs +++ /dev/null @@ -1,51 +0,0 @@ -mod alias; -mod browser_field; -mod builtins; -mod dependencies; -mod exports_field; -mod extension_alias; -mod extensions; -mod fallback; -mod full_specified; -mod imports_field; -mod incorrect_description_file; -mod main_field; -mod memory_fs; -mod missing; -#[cfg(feature = "yarn_pnp")] -mod pnp; -mod resolve; -mod restrictions; -mod roots; -mod scoped_packages; -mod simple; -mod symlink; -mod tsconfig_paths; -mod tsconfig_project_references; - -use crate::Resolver; -use std::{env, path::PathBuf, sync::Arc, thread}; - -pub fn fixture_root() -> PathBuf { - env::current_dir().unwrap().join("fixtures") -} - -pub fn fixture() -> PathBuf { - fixture_root().join("enhanced_resolve").join("test").join("fixtures") -} - -#[test] -fn threaded_environment() { - let cwd = env::current_dir().unwrap(); - let resolver = Arc::new(Resolver::default()); - for _ in 0..2 { - _ = thread::spawn({ - let cwd = cwd.clone(); - let resolver = Arc::clone(&resolver); - move || { - _ = resolver.resolve(cwd, "."); - } - }) - .join(); - } -} diff --git a/src/tests/pnp.rs b/src/tests/pnp.rs deleted file mode 100644 index 1562a009..00000000 --- a/src/tests/pnp.rs +++ /dev/null @@ -1,45 +0,0 @@ -//! Not part of enhanced_resolve's test suite -//! -//! enhanced_resolve's test -//! cannot be ported over because it uses mocks on `pnpApi` provided by the runtime. - -use crate::{ResolveOptions, Resolver}; - -#[test] -fn pnp1() { - let fixture = super::fixture_root().join("pnp"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - pnp_manifest: Some(pnp::load_pnp_manifest(fixture.join(".pnp.cjs")).unwrap()), - ..ResolveOptions::default() - }); - - assert_eq!( - resolver.resolve(&fixture, "is-even").map(|r| r.full_path()), - Ok(fixture.join( - ".yarn/cache/is-even-npm-1.0.0-9f726520dc-2728cc2f39.zip/node_modules/is-even/index.js" - )) - ); - - assert_eq!( - resolver - .resolve( - &fixture.join( - ".yarn/cache/is-even-npm-1.0.0-9f726520dc-2728cc2f39.zip/node_modules/is-even" - ), - "is-odd" - ) - .map(|r| r.full_path()), - Ok(fixture.join( - ".yarn/cache/is-odd-npm-0.1.2-9d980a9da8-7dc6c6fd00.zip/node_modules/is-odd/index.js" - )), - ); - - assert_eq!( - resolver.resolve(&fixture, "is-odd").map(|r| r.full_path()), - Ok(fixture.join( - ".yarn/cache/is-odd-npm-3.0.1-93c3c3f41b-89ee2e353c.zip/node_modules/is-odd/index.js" - )), - ); -} diff --git a/src/tests/resolve.rs b/src/tests/resolve.rs deleted file mode 100644 index f2dbb88e..00000000 --- a/src/tests/resolve.rs +++ /dev/null @@ -1,119 +0,0 @@ -//! - -use crate::{ResolveError, ResolveOptions, Resolver}; - -#[test] -fn resolve() { - let f = super::fixture(); - - let resolver = Resolver::default(); - - let main1_js_path = f.join("main1.js").to_string_lossy().to_string(); - - #[rustfmt::skip] - let pass = [ - ("absolute path", f.clone(), main1_js_path.as_str(), f.join("main1.js")), - ("file with .js", f.clone(), "./main1.js", f.join("main1.js")), - ("file without extension", f.clone(), "./main1", f.join("main1.js")), - ("another file with .js", f.clone(), "./a.js", f.join("a.js")), - ("another file without extension", f.clone(), "./a", f.join("a.js")), - ("file in module with .js", f.clone(), "m1/a.js", f.join("node_modules/m1/a.js")), - ("file in module without extension", f.clone(), "m1/a", f.join("node_modules/m1/a.js")), - ("another file in module without extension", f.clone(), "complexm/step1", f.join("node_modules/complexm/step1.js")), - ("from submodule to file in sibling module", f.join("node_modules/complexm"), "m2/b.js", f.join("node_modules/m2/b.js")), - ("from nested directory to overwritten file in module", f.join("multiple_modules"), "m1/a.js", f.join("multiple_modules/node_modules/m1/a.js")), - ("from nested directory to not overwritten file in module", f.join("multiple_modules"), "m1/b.js", f.join("node_modules/m1/b.js")), - ("file with query", f.clone(), "./main1.js?query", f.join("main1.js?query")), - ("file with fragment", f.clone(), "./main1.js#fragment", f.join("main1.js#fragment")), - ("file with fragment and query", f.clone(), "./main1.js#fragment?query", f.join("main1.js#fragment?query")), - ("file with query and fragment", f.clone(), "./main1.js?#fragment", f.join("main1.js?#fragment")), - - ("file with query (unicode)", f.clone(), "./测试.js?query", f.join("测试.js?query")), - ("file with fragment (unicode)", f.clone(), "./测试.js#fragment", f.join("测试.js#fragment")), - ("file with fragment and query (unicode)", f.clone(), "./测试.js#fragment?query", f.join("测试.js#fragment?query")), - ("file with query and fragment (unicode)", f.clone(), "./测试.js?#fragment", f.join("测试.js?#fragment")), - - ("file in module with query", f.clone(), "m1/a?query", f.join("node_modules/m1/a.js?query")), - ("file in module with fragment", f.clone(), "m1/a#fragment", f.join("node_modules/m1/a.js#fragment")), - ("file in module with fragment and query", f.clone(), "m1/a#fragment?query", f.join("node_modules/m1/a.js#fragment?query")), - ("file in module with query and fragment", f.clone(), "m1/a?#fragment", f.join("node_modules/m1/a.js?#fragment")), - ("file in module with query and fragment", f.clone(), "m1/a?#fragment", f.join("node_modules/m1/a.js?#fragment")), - ("differ between directory and file, resolve file", f.clone(), "./dirOrFile", f.join("dirOrFile.js")), - ("differ between directory and file, resolve directory", f.clone(), "./dirOrFile/", f.join("dirOrFile/index.js")), - ("find node_modules outside of node_modules", f.join("browser-module/node_modules"), "m1/a", f.join("node_modules/m1/a.js")), - ("don't crash on main field pointing to self", f.clone(), "./main-field-self", f.join("./main-field-self/index.js")), - ("don't crash on main field pointing to self (2)", f.clone(), "./main-field-self2", f.join("./main-field-self2/index.js")), - // enhanced-resolve has `#` prepended with a `\0`, they are removed from the - // following 3 expected test results. - // See https://github.com/webpack/enhanced-resolve#escaping - ("handle fragment edge case (no fragment)", f.clone(), "./no#fragment/#/#", f.join("no#fragment/#/#.js")), - ("handle fragment edge case (fragment)", f.clone(), "./no#fragment/#/", f.join("no.js#fragment/#/")), - ("handle fragment escaping", f.clone(), "./no\0#fragment/\0#/\0##fragment", f.join("no#fragment/#/#.js#fragment")), - - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn issue238_resolve() { - let f = super::fixture().join("issue-238"); - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into(), ".jsx".into(), ".ts".into(), ".tsx".into()], - modules: vec!["src/a".into(), "src/b".into(), "src/common".into(), "node_modules".into()], - ..ResolveOptions::default() - }); - let resolved_path = - resolver.resolve(f.join("src/common"), "config/myObjectFile").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("src/common/config/myObjectFile.js")),); -} - -#[test] -fn prefer_relative() { - let f = super::fixture(); - - let resolver = - Resolver::new(ResolveOptions { prefer_relative: true, ..ResolveOptions::default() }); - - #[rustfmt::skip] - let pass = [ - ("should correctly resolve with preferRelative 1", "main1.js", f.join("main1.js")), - ("should correctly resolve with preferRelative 2", "m1/a.js", f.join("node_modules/m1/a.js")), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } -} - -#[test] -fn resolve_to_context() { - let f = super::fixture(); - let resolver = - Resolver::new(ResolveOptions { resolve_to_context: true, ..ResolveOptions::default() }); - - #[rustfmt::skip] - let data = [ - ("context for fixtures", f.clone(), "./", f.clone()), - ("context for fixtures/lib", f.clone(), "./lib", f.join("lib")), - ("context for fixtures with ..", f.clone(), "./lib/../../fixtures/./lib/..", f.clone()), - ("context for fixtures with query", f.clone(), "./?query", f.clone().with_file_name("fixtures?query")), - ]; - - for (comment, path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn resolve_hash_as_module() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions::default()); - let resolution = resolver.resolve(f, "#a"); - assert_eq!(resolution, Err(ResolveError::NotFound("#a".into()))); -} diff --git a/src/tests/restrictions.rs b/src/tests/restrictions.rs deleted file mode 100644 index 5ba56596..00000000 --- a/src/tests/restrictions.rs +++ /dev/null @@ -1,25 +0,0 @@ -//! - -use crate::{ResolveError, ResolveOptions, Resolver, Restriction}; - -// TODO: regex -// * should respect RegExp restriction -// * should try to find alternative #1 -// * should try to find alternative #2 -// * should try to find alternative #3 - -// should respect string restriction -#[test] -fn restriction1() { - let fixture = super::fixture(); - let f = fixture.join("restrictions"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - restrictions: vec![Restriction::Path(f.clone())], - ..ResolveOptions::default() - }); - - let resolution = resolver.resolve(&f, "pck2"); - assert_eq!(resolution, Err(ResolveError::Restriction(fixture.join("c.js"), f))); -} diff --git a/src/tests/roots.rs b/src/tests/roots.rs deleted file mode 100644 index b50e2a07..00000000 --- a/src/tests/roots.rs +++ /dev/null @@ -1,92 +0,0 @@ -//! - -use std::path::PathBuf; - -use crate::{AliasValue, ResolveError, ResolveOptions, Resolver}; - -fn dirname() -> PathBuf { - super::fixture_root().join("enhanced_resolve").join("test") -} - -#[test] -fn roots() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - alias: vec![("foo".into(), vec![AliasValue::from("/fixtures")])], - roots: vec![dirname(), f.clone()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should respect roots option", "/fixtures/b.js", f.join("b.js")), - ("should try another root option, if it exists", "/b.js", f.join("b.js")), - ("should respect extension", "/fixtures/b", f.join("b.js")), - ("should resolve in directory", "/fixtures/extensions/dir", f.join("extensions/dir/index.js")), - ("should respect aliases", "foo/b", f.join("b.js")), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } - - #[rustfmt::skip] - let fail = [ - ("should not work with relative path", "fixtures/b.js", ResolveError::NotFound("fixtures/b.js".into())) - ]; - - for (comment, request, expected) in fail { - let resolution = resolver.resolve(&f, request); - assert_eq!(resolution, Err(expected), "{comment} {request}"); - } -} - -#[test] -fn resolve_to_context() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - roots: vec![dirname(), f.clone()], - resolve_to_context: true, - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f, "/fixtures/lib").map(|r| r.full_path()); - let expected = f.join("lib"); - assert_eq!(resolved_path, Ok(expected)); -} - -#[test] -fn prefer_absolute() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - alias: vec![("foo".into(), vec![AliasValue::from("/fixtures")])], - roots: vec![dirname(), f.clone()], - prefer_absolute: true, - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve an absolute path (prefer absolute)", f.join("b.js").to_string_lossy().to_string(), f.join("b.js")), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(&f, &request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } -} - -#[test] -fn roots_fall_through() { - let f = super::fixture(); - let absolute_path = f.join("roots_fall_through/index.js"); - let specifier = absolute_path.to_string_lossy(); - let resolution = Resolver::new(ResolveOptions::default().with_root(&f)).resolve(&f, &specifier); - assert_eq!( - resolution.map(super::super::resolution::Resolution::into_path_buf), - Ok(absolute_path) - ); -} diff --git a/src/tests/scoped_packages.rs b/src/tests/scoped_packages.rs deleted file mode 100644 index 8258f00f..00000000 --- a/src/tests/scoped_packages.rs +++ /dev/null @@ -1,25 +0,0 @@ -//! - -use crate::{ResolveOptions, Resolver}; - -#[test] -fn scoped_packages() { - let f = super::fixture().join("scoped"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("main field should work", f.clone(), "@scope/pack1", f.join("./node_modules/@scope/pack1/main.js")), - ("browser field should work", f.clone(), "@scope/pack2", f.join("./node_modules/@scope/pack2/main.js")), - ("folder request should work", f.clone(), "@scope/pack2/lib", f.join("./node_modules/@scope/pack2/lib/index.js")) - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} diff --git a/src/tests/simple.rs b/src/tests/simple.rs deleted file mode 100644 index 08e1238a..00000000 --- a/src/tests/simple.rs +++ /dev/null @@ -1,68 +0,0 @@ -//! - -use std::env; - -use crate::Resolver; - -#[test] -fn simple() { - // mimic `enhanced-resolve/test/simple.test.js` - let dirname = env::current_dir().unwrap().join("fixtures"); - let f = dirname.join("enhanced_resolve/test"); - - let resolver = Resolver::default(); - - let data = [ - ("direct", f.clone(), "../lib/index"), - ("as directory", f, ".."), - ("as module", dirname.clone(), "./enhanced_resolve"), - ]; - - for (comment, path, request) in data { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - let expected = dirname.join("enhanced_resolve/lib/index.js"); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn dashed_name() { - let f = super::fixture(); - - let resolver = Resolver::default(); - - let data = [ - (f.clone(), "dash", f.join("node_modules/dash/index.js")), - (f.clone(), "dash-name", f.join("node_modules/dash-name/index.js")), - (f.join("node_modules/dash"), "dash", f.join("node_modules/dash/index.js")), - (f.join("node_modules/dash"), "dash-name", f.join("node_modules/dash-name/index.js")), - (f.join("node_modules/dash-name"), "dash", f.join("node_modules/dash/index.js")), - (f.join("node_modules/dash-name"), "dash-name", f.join("node_modules/dash-name/index.js")), - ]; - - for (path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{path:?} {request}"); - } -} - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows { - use super::super::memory_fs::MemoryFS; - - use crate::ResolveOptions; - - #[test] - fn no_package() { - use crate::ResolverGeneric; - use std::path::Path; - let f = Path::new("/"); - let file_system = MemoryFS::new(&[]); - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions::default(), - ); - let resolved_path = resolver.resolve(f, "package"); - assert!(resolved_path.is_err()); - } -} diff --git a/src/tests/symlink.rs b/src/tests/symlink.rs deleted file mode 100644 index 7589b560..00000000 --- a/src/tests/symlink.rs +++ /dev/null @@ -1,121 +0,0 @@ -use std::{fs, io, path::Path}; - -use crate::{ResolveOptions, Resolver}; - -#[derive(Debug, Clone, Copy)] -enum FileType { - File, - Dir, -} - -#[allow(unused_variables)] -fn symlink, Q: AsRef>( - original: P, - link: Q, - file_type: FileType, -) -> io::Result<()> { - #[cfg(target_family = "unix")] - { - std::os::unix::fs::symlink(original, link) - } - - #[cfg(target_family = "windows")] - match file_type { - FileType::File => std::os::windows::fs::symlink_file(original, link), - FileType::Dir => std::os::windows::fs::symlink_dir(original, link), - } -} - -fn init(dirname: &Path, temp_path: &Path) -> io::Result<()> { - if temp_path.exists() { - _ = fs::remove_dir_all(temp_path); - } - fs::create_dir(temp_path)?; - symlink(dirname.join("../lib/index.js"), temp_path.join("test"), FileType::File)?; - symlink(dirname.join("../lib"), temp_path.join("test2"), FileType::Dir)?; - fs::remove_file(temp_path.join("test"))?; - fs::remove_file(temp_path.join("test2"))?; - fs::remove_dir(temp_path) -} - -fn create_symlinks(dirname: &Path, temp_path: &Path) -> io::Result<()> { - fs::create_dir(temp_path).unwrap(); - symlink( - dirname.join("../lib/index.js").canonicalize().unwrap(), - temp_path.join("index.js"), - FileType::File, - )?; - symlink(dirname.join("../lib").canonicalize().unwrap(), temp_path.join("lib"), FileType::Dir)?; - symlink(dirname.join("..").canonicalize().unwrap(), temp_path.join("this"), FileType::Dir)?; - symlink(temp_path.join("this"), temp_path.join("that"), FileType::Dir)?; - symlink(Path::new("../../lib/index.js"), temp_path.join("node.relative.js"), FileType::File)?; - symlink( - Path::new("./node.relative.js"), - temp_path.join("node.relative.sym.js"), - FileType::File, - )?; - Ok(()) -} - -fn cleanup_symlinks(temp_path: &Path) { - _ = fs::remove_dir_all(temp_path); -} - -#[test] -fn test() -> io::Result<()> { - let root = super::fixture_root().join("enhanced_resolve"); - let dirname = root.join("test"); - let temp_path = dirname.join("temp"); - if !temp_path.exists() { - let is_admin = init(&dirname, &temp_path).is_ok(); - if !is_admin { - return Ok(()); - } - if let Err(err) = create_symlinks(&dirname, &temp_path) { - cleanup_symlinks(&temp_path); - return Err(err); - } - } - - let resolver_without_symlinks = - Resolver::new(ResolveOptions { symlinks: false, ..ResolveOptions::default() }); - let resolver_with_symlinks = Resolver::default(); - - #[rustfmt::skip] - let pass = [ - ("with a symlink to a file", temp_path.clone(), "./index.js"), - ("with a relative symlink to a file", temp_path.clone(), "./node.relative.js"), - ("with a relative symlink to a symlink to a file", temp_path.clone(), "./node.relative.sym.js"), - ("with a symlink to a directory 1", temp_path.clone(), "./lib/index.js"), - ("with a symlink to a directory 2", temp_path.clone(), "./this/lib/index.js"), - ("with multiple symlinks in the path 1", temp_path.clone(), "./this/test/temp/index.js"), - ("with multiple symlinks in the path 2", temp_path.clone(), "./this/test/temp/lib/index.js"), - ("with multiple symlinks in the path 3", temp_path.clone(), "./this/test/temp/this/lib/index.js"), - ("with a symlink to a directory 2 (chained)", temp_path.clone(), "./that/lib/index.js"), - ("with multiple symlinks in the path 1 (chained)", temp_path.clone(), "./that/test/temp/index.js"), - ("with multiple symlinks in the path 2 (chained)", temp_path.clone(), "./that/test/temp/lib/index.js"), - ("with multiple symlinks in the path 3 (chained)", temp_path.clone(), "./that/test/temp/that/lib/index.js"), - ("with symlinked directory as context 1", temp_path.join( "lib"), "./index.js"), - ("with symlinked directory as context 2", temp_path.join( "this"), "./lib/index.js"), - ("with symlinked directory as context and in path", temp_path.join( "this"), "./test/temp/lib/index.js"), - ("with symlinked directory in context path", temp_path.join( "this/lib"), "./index.js"), - ("with symlinked directory in context path and symlinked file", temp_path.join( "this/test"), "./temp/index.js"), - ("with symlinked directory in context path and symlinked directory", temp_path.join( "this/test"), "./temp/lib/index.js"), - ("with symlinked directory as context 2 (chained)", temp_path.join( "that"), "./lib/index.js"), - ("with symlinked directory as context and in path (chained)", temp_path.join( "that"), "./test/temp/lib/index.js"), - ("with symlinked directory in context path (chained)", temp_path.join( "that/lib"), "./index.js"), - ("with symlinked directory in context path and symlinked file (chained)", temp_path.join( "that/test"), "./temp/index.js"), - ("with symlinked directory in context path and symlinked directory (chained)", temp_path.join( "that/test"), "./temp/lib/index.js") - ]; - - for (comment, path, request) in pass { - let filename = resolver_with_symlinks.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(filename, Ok(root.join("lib/index.js")), "{comment:?}"); - - let resolved_path = - resolver_without_symlinks.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(path.join(request))); - } - - Ok(()) -} diff --git a/src/tests/tsconfig_paths.rs b/src/tests/tsconfig_paths.rs deleted file mode 100644 index b85bf6be..00000000 --- a/src/tests/tsconfig_paths.rs +++ /dev/null @@ -1,530 +0,0 @@ -//! tests for tsconfig-paths -//! -//! Fixtures copied from . - -use std::path::{Path, PathBuf}; - -use crate::{ - JSONError, ResolveError, ResolveOptions, Resolver, TsConfig, TsconfigOptions, - TsconfigReferences, -}; - -// -#[test] -fn tsconfig() { - let f = super::fixture_root().join("tsconfig"); - - #[rustfmt::skip] - let pass = [ - (f.clone(), None, "ts-path", f.join("foo.js")), - (f.join("nested"), None, "ts-path", f.join("nested/test.js")), - (f.join("cases/index"), None, "foo", f.join("node_modules/tsconfig-index/foo.js")), - // This requires reading package.json.tsconfig field - // (f.join("cases/field"), "foo", f.join("node_modules/tsconfig-field/foo.js")) - (f.join("cases/exports"), None, "foo", f.join("node_modules/tsconfig-exports/foo.js")), - (f.join("cases/extends-extension"), None, "foo", f.join("cases/extends-extension/foo.js")), - (f.join("cases/extends-extensionless"), None, "foo", f.join("node_modules/tsconfig-field/foo.js")), - (f.join("cases/extends-paths"), Some("src"), "@/index", f.join("cases/extends-paths/src/index.js")), - (f.join("cases/extends-multiple"), None, "foo", f.join("cases/extends-multiple/foo.js")), - ]; - - for (dir, subdir, request, expected) in pass { - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: dir.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - let path = subdir.map_or(dir.clone(), |subdir| dir.join(subdir)); - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{request} {path:?}"); - } - - #[rustfmt::skip] - let data = [ - (f.join("node_modules/tsconfig-not-used"), "ts-path", Ok(f.join("foo.js"))), - ]; - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - for (path, request, expected) in data { - let resolution = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolution, expected, "{path:?} {request}"); - } -} - -#[test] -fn tsconfig_fallthrough() { - let f = super::fixture_root().join("tsconfig"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "/"); - assert_eq!(resolved_path, Err(ResolveError::NotFound("/".into()))); -} - -#[test] -fn json_with_comments() { - let f = super::fixture_root().join("tsconfig/cases/trailing-comma"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "foo").map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(f.join("bar.js"))); -} - -#[test] -fn broken() { - let f = super::fixture_root().join("tsconfig"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("tsconfig_broken.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "/"); - let error = ResolveError::JSON(JSONError { - path: f.join("tsconfig_broken.json"), - message: String::from("EOF while parsing an object at line 2 column 0"), - line: 2, - column: 0, - }); - assert_eq!(resolved_path, Err(error)); -} - -// -#[test] -fn test_paths() { - let path = Path::new("/foo/tsconfig.json"); - let mut tsconfig_json = serde_json::json!({ - "compilerOptions": { - "paths": { - "jquery": ["node_modules/jquery/dist/jquery"], - "*": ["generated/*"], - "bar/*": ["test/*"], - "bar/baz/*": ["baz/*", "yo/*"], - "@/components/*": ["components/*"], - "url": ["node_modules/my-url"], - } - } - }) - .to_string(); - let tsconfig = TsConfig::parse(true, path, &mut tsconfig_json).unwrap(); - - let data = [ - ("jquery", vec!["/foo/node_modules/jquery/dist/jquery"]), - ("test", vec!["/foo/generated/test"]), - ("test/hello", vec!["/foo/generated/test/hello"]), - ("bar/hi", vec!["/foo/test/hi"]), - ("bar/baz/hi", vec!["/foo/baz/hi", "/foo/yo/hi"]), - ("@/components/button", vec!["/foo/components/button"]), - ("./jquery", vec![]), - ("url", vec!["/foo/node_modules/my-url"]), - ]; - - for (specifier, expected) in data { - let paths = tsconfig.resolve_path_alias(specifier); - let expected = expected.into_iter().map(PathBuf::from).collect::>(); - assert_eq!(paths, expected, "{specifier}"); - } -} - -// -#[test] -fn test_base_url() { - let path = Path::new("/foo/tsconfig.json"); - let mut tsconfig_json = serde_json::json!({ - "compilerOptions": { - "baseUrl": "./src" - } - }) - .to_string(); - let tsconfig = TsConfig::parse(true, path, &mut tsconfig_json).unwrap(); - - let data = [ - ("foo", vec!["/foo/src/foo"]), - ("components/button", vec!["/foo/src/components/button"]), - ("./jquery", vec![]), - ]; - - for (specifier, expected) in data { - let paths = tsconfig.resolve_path_alias(specifier); - let expected = expected.into_iter().map(PathBuf::from).collect::>(); - assert_eq!(paths, expected, "{specifier}"); - } -} - -// -#[test] -fn test_paths_and_base_url() { - let path = Path::new("/foo/tsconfig.json"); - let mut tsconfig_json = serde_json::json!({ - "compilerOptions": { - "baseUrl": "./src", - "paths": { - "*": ["generated/*"], - "bar/*": ["test/*"], - "bar/baz/*": ["baz/*", "yo/*"], - "@/components/*": ["components/*"] - } - } - }) - .to_string(); - let tsconfig = TsConfig::parse(true, path, &mut tsconfig_json).unwrap(); - - let data = [ - ("test", vec!["/foo/src/generated/test", "/foo/src/test"]), - ("test/hello", vec!["/foo/src/generated/test/hello", "/foo/src/test/hello"]), - ("bar/hi", vec!["/foo/src/test/hi", "/foo/src/bar/hi"]), - ("bar/baz/hi", vec!["/foo/src/baz/hi", "/foo/src/yo/hi", "/foo/src/bar/baz/hi"]), - ("@/components/button", vec!["/foo/src/components/button", "/foo/src/@/components/button"]), - ("./jquery", vec![]), - ]; - - for (specifier, expected) in data { - let paths = tsconfig.resolve_path_alias(specifier); - let expected = expected.into_iter().map(PathBuf::from).collect::>(); - assert_eq!(paths, expected, "{specifier}"); - } -} - -// Template variable ${configDir} for substitution of config files directory path -// https://github.com/microsoft/TypeScript/pull/58042 -#[test] -fn test_template_variable() { - let f = super::fixture_root().join("tsconfig"); - let f2 = f.join("cases").join("paths_template_variable"); - - #[rustfmt::skip] - let pass = [ - (f2.clone(), "tsconfig1.json", "foo", f2.join("foo.js")), - (f2.clone(), "tsconfig2.json", "foo", f2.join("foo.js")), - (f.clone(), "tsconfig_template_variable.json", "foo", f.join("foo.js")), - ]; - - for (dir, tsconfig, request, expected) in pass { - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: dir.join(tsconfig), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&dir, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{request} {tsconfig} {dir:?}"); - } -} - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows_test { - use std::path::{Path, PathBuf}; - - use crate::{ - ResolveError, ResolveOptions, ResolverGeneric, TsconfigOptions, TsconfigReferences, - }; - - use super::super::memory_fs::MemoryFS; - - struct OneTest { - name: &'static str, - tsconfig: String, - package_json: Option<(PathBuf, String)>, - main_fields: Option>, - existing_files: Vec<&'static str>, - requested_module: &'static str, - expected_path: &'static str, - extensions: Vec, - } - - impl Default for OneTest { - fn default() -> Self { - Self { - name: "", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/*": ["location/*"] - } - } - }) - .to_string(), - package_json: None, - main_fields: None, - existing_files: vec![], - requested_module: "", - expected_path: "", - extensions: vec![ - ".js".into(), - ".json".into(), - ".node".into(), - ".ts".into(), - ".tsx".into(), - ], - } - } - } - - impl OneTest { - fn resolver(&self, root: &Path) -> ResolverGeneric { - let mut file_system = MemoryFS::default(); - - file_system.add_file(&root.join("tsconfig.json"), &self.tsconfig); - if let Some((path, package_json)) = &self.package_json { - file_system.add_file(&root.join(path).join("package.json"), package_json); - } - for path in &self.existing_files { - file_system.add_file(Path::new(path), ""); - } - - let mut options = ResolveOptions { - extensions: self.extensions.clone(), - tsconfig: Some(TsconfigOptions { - config_file: root.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }; - if let Some(main_fields) = &self.main_fields { - options.main_fields.clone_from(main_fields); - } - - ResolverGeneric::::new_with_file_system(file_system, options) - } - } - - // Path matching tests from tsconfig-paths - // * - // * - #[test] - fn match_path() { - let pass = [ - OneTest { - name: "should locate path that matches with star and exists", - existing_files: vec!["/root/location/mylib/index.ts"], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve to correct path when many are specified", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/*": ["foo1/*", "foo2/*", "location/*", "foo3/*"], - } - } - }) - .to_string(), - existing_files: vec!["/root/location/mylib/index.ts"], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should locate path that matches with star and prioritize pattern with longest prefix", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "*": ["location/*"], - "lib/*": ["location/*"], - } - } - }) - .to_string(), - existing_files: vec![ - "/root/location/lib/mylib/index.ts", - "/root/location/mylib/index.ts", - ], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should locate path that matches with star and exists with extension", - existing_files: vec![ - "/root/location/mylib.myext", - ], - requested_module: "lib/mylib", - extensions: vec![".js".into(), ".myext".into()], - expected_path: "/root/location/mylib.myext", - ..OneTest::default() - }, - OneTest { - name: "should resolve request with extension specified", - existing_files: vec![ - "/root/location/test.jpg", - ], - requested_module: "lib/test.jpg", - expected_path: "/root/location/test.jpg", - ..OneTest::default() - }, - OneTest { - name: "should locate path that matches without star and exists", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/foo": ["location/foo"] - } - } - }) - .to_string(), - existing_files: vec![ - "/root/location/foo.ts", - ], - requested_module: "lib/foo", - expected_path: "/root/location/foo.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve to parent folder when filename is in subfolder", - existing_files: vec![ - "/root/location/mylib/index.ts", - ], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve from main field in package.json", - package_json: Some((PathBuf::from("/root/location/mylib"), serde_json::json!({ - "main": "./kalle.ts" - }).to_string())), - existing_files: vec![ - "/root/location/mylib/kalle.ts", - ], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/kalle.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve from main field in package.json (js)", - package_json: Some((PathBuf::from("/root/location/mylib.js"), serde_json::json!({ - "main": "./kalle.js" - }).to_string())), - existing_files: vec![ - "/root/location/mylib.js/kalle.js", - ], - extensions: vec![".ts".into(), ".js".into()], - requested_module: "lib/mylib.js", - expected_path: "/root/location/mylib.js/kalle.js", - ..OneTest::default() - }, - OneTest { - name: "should resolve from list of fields by priority in package.json", - main_fields: Some(vec!["missing".into(), "browser".into(), "main".into()]), - package_json: Some((PathBuf::from("/root/location/mylibjs"), serde_json::json!({ - "main": "./main.js", - "browser": "./browser.js" - }).to_string())), - existing_files: vec![ - "/root/location/mylibjs/main.js", - "/root/location/mylibjs/browser.js", - ], - extensions: vec![".ts".into(), ".js".into()], - requested_module: "lib/mylibjs", - expected_path: "/root/location/mylibjs/browser.js", - ..OneTest::default() - }, -OneTest { - name: "should ignore field mappings to missing files in package.json", - main_fields: Some(vec!["browser".into(), "main".into()]), - package_json: Some((PathBuf::from("/root/location/mylibjs"), serde_json::json!({ - "main": "./kalle.js", - "browser": "./nope.js" - }).to_string())), - existing_files: vec![ - "/root/location/mylibjs/kalle.js", - ], - extensions: vec![".ts".into(), ".js".into()], - requested_module: "lib/mylibjs", - expected_path: "/root/location/mylibjs/kalle.js", - ..OneTest::default() - }, - // Tests that are not applicable: - // name: "should resolve nested main fields" - // name: "should ignore advanced field mappings in package.json" - // name: "should resolve to with the help of baseUrl when not explicitly set" - // name: "should not resolve with the help of baseUrl when asked not to" - // name: "should resolve main file with cjs file extension" - OneTest { - name: "should resolve .ts from .js alias", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "@/*": ["src/*"] - } - } - }).to_string(), - existing_files: vec![ - "/root/src/foo.ts", - ], - requested_module: "@/foo", // original data was "@/foo.ts" but I don't get why it is the case? - expected_path: "/root/src/foo.ts", // original data was "/root/src/foo" - ..OneTest::default() - }, - ]; - - let root = PathBuf::from("/root"); - - for test in pass { - let resolved_path = - test.resolver(&root).resolve(&root, test.requested_module).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(PathBuf::from(test.expected_path)), "{}", test.name); - } - - let fail = [ - OneTest { - name: "should not locate path that does not match", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/*": ["location/*"] - } - } - }) - .to_string(), - existing_files: vec!["/root/location/mylib"], - requested_module: "lib/mylibjs", - ..OneTest::default() - }, - OneTest { - name: "should not resolve typings file (index.d.ts)", - existing_files: vec!["/root/location/mylib/index.d.ts"], - requested_module: "lib/mylib", - ..OneTest::default() - }, - ]; - - for test in fail { - let resolved_path = - test.resolver(&root).resolve(&root, test.requested_module).map(|f| f.full_path()); - assert_eq!( - resolved_path, - Err(ResolveError::NotFound(test.requested_module.into())), - "{}", - test.name - ); - } - } -} diff --git a/src/tests/tsconfig_project_references.rs b/src/tests/tsconfig_project_references.rs deleted file mode 100644 index 0d019d27..00000000 --- a/src/tests/tsconfig_project_references.rs +++ /dev/null @@ -1,132 +0,0 @@ -//! Tests for tsconfig project references - -use crate::{ResolveError, ResolveOptions, Resolver, TsconfigOptions, TsconfigReferences}; - -#[test] -fn auto() { - let f = super::fixture_root().join("tsconfig/cases/project_references"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("app"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - // Test normal paths alias - (f.join("app"), "@/index.ts", f.join("app/aliased/index.ts")), - (f.join("app"), "@/../index.ts", f.join("app/index.ts")), - // Test project reference - (f.join("project_a"), "@/index.ts", f.join("project_a/aliased/index.ts")), - (f.join("project_b/src"), "@/index.ts", f.join("project_b/src/aliased/index.ts")), - // Does not have paths alias - (f.join("project_a"), "./index.ts", f.join("project_a/index.ts")), - (f.join("project_c"), "./index.ts", f.join("project_c/index.ts")), - // Template variable - { - let dir = f.parent().unwrap().join("paths_template_variable"); - (dir.clone(), "foo", dir.join("foo.js")) - } - ]; - - for (path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{request} {path:?}"); - } -} - -#[test] -fn disabled() { - let f = super::fixture_root().join("tsconfig/cases/project_references"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("app"), - references: TsconfigReferences::Disabled, - }), - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - // Test normal paths alias - (f.join("app"), "@/index.ts", Ok(f.join("app/aliased/index.ts"))), - (f.join("app"), "@/../index.ts", Ok(f.join("app/index.ts"))), - // Test project reference - (f.join("project_a"), "@/index.ts", Err(ResolveError::NotFound("@/index.ts".into()))), - (f.join("project_b/src"), "@/index.ts", Err(ResolveError::NotFound("@/index.ts".into()))), - // Does not have paths alias - (f.join("project_a"), "./index.ts", Ok(f.join("project_a/index.ts"))), - (f.join("project_c"), "./index.ts", Ok(f.join("project_c/index.ts"))), - ]; - - for (path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, expected, "{request} {path:?}"); - } -} - -#[test] -fn manual() { - let f = super::fixture_root().join("tsconfig/cases/project_references"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("app"), - references: TsconfigReferences::Paths(vec!["../project_a/conf.json".into()]), - }), - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - // Test normal paths alias - (f.join("app"), "@/index.ts", Ok(f.join("app/aliased/index.ts"))), - (f.join("app"), "@/../index.ts", Ok(f.join("app/index.ts"))), - // Test project reference - (f.join("project_a"), "@/index.ts", Ok(f.join("project_a/aliased/index.ts"))), - (f.join("project_b/src"), "@/index.ts", Err(ResolveError::NotFound("@/index.ts".into()))), - // Does not have paths alias - (f.join("project_a"), "./index.ts", Ok(f.join("project_a/index.ts"))), - (f.join("project_c"), "./index.ts", Ok(f.join("project_c/index.ts"))), - ]; - - for (path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, expected, "{request} {path:?}"); - } -} - -#[test] -fn self_reference() { - let f = super::fixture_root().join("tsconfig/cases/project_references"); - - #[rustfmt::skip] - let pass = [ - (f.join("app"), vec!["./tsconfig.json".into()]), - (f.join("app/tsconfig.json"), vec!["./tsconfig.json".into()]), - (f.join("app"), vec![f.join("app")]), - (f.join("app/tsconfig.json"), vec![f.join("app")]), - (f.join("app/tsconfig.json"), vec![f.join("project_b"), f.join("app")]), - ]; - - for (config_file, reference_paths) in pass { - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: config_file.clone(), - references: TsconfigReferences::Paths(reference_paths.clone()), - }), - ..ResolveOptions::default() - }); - let path = f.join("app"); - let resolved_path = resolver.resolve(&path, "@/index.ts").map(|f| f.full_path()); - assert_eq!( - resolved_path, - Err(ResolveError::TsconfigSelfReference(f.join("app/tsconfig.json"))), - "{config_file:?} {reference_paths:?}" - ); - } -} diff --git a/src/tsconfig.rs b/src/tsconfig.rs deleted file mode 100644 index 6a675442..00000000 --- a/src/tsconfig.rs +++ /dev/null @@ -1,223 +0,0 @@ -use std::{ - hash::BuildHasherDefault, - path::{Path, PathBuf}, - sync::Arc, -}; - -use indexmap::IndexMap; -use rustc_hash::FxHasher; -use serde::Deserialize; - -use crate::PathUtil; - -pub type CompilerOptionsPathsMap = IndexMap, BuildHasherDefault>; - -#[derive(Debug, Clone, Eq, PartialEq, Deserialize)] -#[serde(untagged)] -pub enum ExtendsField { - Single(String), - Multiple(Vec), -} - -#[derive(Debug, Deserialize)] -#[serde(rename_all = "camelCase")] -pub struct TsConfig { - /// Whether this is the caller tsconfig. - /// Used for final template variable substitution when all configs are extended and merged. - #[serde(skip)] - root: bool, - - /// Path to `tsconfig.json`. Contains the `tsconfig.json` filename. - #[serde(skip)] - pub(crate) path: PathBuf, - - #[serde(default)] - pub extends: Option, - - #[serde(default)] - pub compiler_options: CompilerOptions, - - /// Bubbled up project references with a reference to their tsconfig. - #[serde(default)] - pub references: Vec, -} - -/// Compiler Options -/// -/// -#[derive(Debug, Default, Deserialize)] -#[serde(rename_all = "camelCase")] -pub struct CompilerOptions { - base_url: Option, - - /// Path aliases - paths: Option, - - /// The actual base for where path aliases are resolved from. - #[serde(skip)] - paths_base: PathBuf, -} - -/// Project Reference -/// -/// -#[derive(Debug, Deserialize)] -pub struct ProjectReference { - /// The path property of each reference can point to a directory containing a tsconfig.json file, - /// or to the config file itself (which may have any name). - pub path: PathBuf, - - /// Reference to the resolved tsconfig - #[serde(skip)] - pub tsconfig: Option>, -} - -impl TsConfig { - pub fn parse(root: bool, path: &Path, json: &mut str) -> Result { - _ = json_strip_comments::strip(json); - let mut tsconfig: Self = serde_json::from_str(json)?; - tsconfig.root = root; - tsconfig.path = path.to_path_buf(); - let directory = tsconfig.directory().to_path_buf(); - if let Some(base_url) = tsconfig.compiler_options.base_url { - tsconfig.compiler_options.base_url = Some(directory.normalize_with(base_url)); - } - if tsconfig.compiler_options.paths.is_some() { - tsconfig.compiler_options.paths_base = - tsconfig.compiler_options.base_url.as_ref().map_or(directory, Clone::clone); - } - Ok(tsconfig) - } - - pub fn build(mut self) -> Self { - if self.root { - let dir = self.directory().to_path_buf(); - // Substitute template variable in `tsconfig.compilerOptions.paths` - if let Some(paths) = &mut self.compiler_options.paths { - for paths in paths.values_mut() { - for path in paths { - Self::substitute_template_variable(&dir, path); - } - } - } - } - self - } - - /// Directory to `tsconfig.json` - /// - /// # Panics - /// - /// * When the `tsconfig.json` path is misconfigured. - pub fn directory(&self) -> &Path { - debug_assert!(self.path.file_name().is_some()); - self.path.parent().unwrap() - } - - pub fn extend_tsconfig(&mut self, tsconfig: &Self) { - let compiler_options = &mut self.compiler_options; - if compiler_options.paths.is_none() { - compiler_options.paths_base = compiler_options - .base_url - .as_ref() - .map_or_else(|| tsconfig.compiler_options.paths_base.clone(), Clone::clone); - compiler_options.paths.clone_from(&tsconfig.compiler_options.paths); - } - if compiler_options.base_url.is_none() { - compiler_options.base_url.clone_from(&tsconfig.compiler_options.base_url); - } - } - - pub fn resolve(&self, path: &Path, specifier: &str) -> Vec { - if path.starts_with(self.base_path()) { - let paths = self.resolve_path_alias(specifier); - if !paths.is_empty() { - return paths; - } - } - for tsconfig in self.references.iter().filter_map(|reference| reference.tsconfig.as_ref()) { - if path.starts_with(tsconfig.base_path()) { - return tsconfig.resolve_path_alias(specifier); - } - } - vec![] - } - - // Copied from parcel - // - pub fn resolve_path_alias(&self, specifier: &str) -> Vec { - if specifier.starts_with(['/', '.']) { - return vec![]; - } - - let base_url_iter = self - .compiler_options - .base_url - .as_ref() - .map_or_else(Vec::new, |base_url| vec![base_url.normalize_with(specifier)]); - - let Some(paths_map) = &self.compiler_options.paths else { - return base_url_iter; - }; - - let paths = paths_map.get(specifier).map_or_else( - || { - let mut longest_prefix_length = 0; - let mut longest_suffix_length = 0; - let mut best_key: Option<&String> = None; - - for key in paths_map.keys() { - if let Some((prefix, suffix)) = key.split_once('*') { - if (best_key.is_none() || prefix.len() > longest_prefix_length) - && specifier.starts_with(prefix) - && specifier.ends_with(suffix) - { - longest_prefix_length = prefix.len(); - longest_suffix_length = suffix.len(); - best_key.replace(key); - } - } - } - - best_key.and_then(|key| paths_map.get(key)).map_or_else(Vec::new, |paths| { - paths - .iter() - .map(|path| { - path.replace( - '*', - &specifier[longest_prefix_length - ..specifier.len() - longest_suffix_length], - ) - }) - .collect::>() - }) - }, - Clone::clone, - ); - - paths - .into_iter() - .map(|p| self.compiler_options.paths_base.normalize_with(p)) - .chain(base_url_iter) - .collect() - } - - fn base_path(&self) -> &Path { - self.compiler_options - .base_url - .as_ref() - .map_or_else(|| self.directory(), |path| path.as_ref()) - } - - /// Template variable `${configDir}` for substitution of config files directory path - /// - /// NOTE: All tests cases are just a head replacement of `${configDir}`, so we are constrained as such. - /// - /// See - fn substitute_template_variable(directory: &Path, path: &mut String) { - const TEMPLATE_VARIABLE: &str = "${configDir}/"; - if let Some(stripped_path) = path.strip_prefix(TEMPLATE_VARIABLE) { - *path = directory.join(stripped_path).to_string_lossy().to_string(); - } - } -} diff --git a/tests/integration_test.rs b/tests/integration_test.rs deleted file mode 100644 index 0fc52887..00000000 --- a/tests/integration_test.rs +++ /dev/null @@ -1,103 +0,0 @@ -//! Test public APIs - -use std::{env, path::PathBuf}; - -use oxc_resolver::{EnforceExtension, Resolution, ResolveContext, ResolveOptions, Resolver}; - -fn dir() -> PathBuf { - env::current_dir().unwrap() -} - -fn resolve(specifier: &str) -> Resolution { - let path = dir(); - Resolver::new(ResolveOptions::default()).resolve(path, specifier).unwrap() -} - -#[test] -fn clone() { - let resolution = resolve("./tests/package.json"); - assert_eq!(resolution.clone(), resolution); -} - -#[test] -fn debug() { - let resolution = resolve("./tests/package.json"); - let s = format!("{resolution:?}"); - assert!(!s.is_empty()); -} - -#[test] -fn eq() { - let resolution = resolve("./tests/package.json"); - assert_eq!(resolution, resolution); -} - -#[test] -fn package_json() { - let resolution = resolve("./tests/package.json"); - let package_json = resolution.package_json().unwrap(); - assert_eq!(package_json.name.as_ref().unwrap(), "name"); - assert_eq!(package_json.r#type.as_ref().unwrap().as_str(), "module".into()); - assert!(package_json.side_effects.as_ref().unwrap().is_object()); -} - -#[cfg(feature = "package_json_raw_json_api")] -#[test] -fn package_json_raw_json_api() { - let resolution = resolve("./tests/package.json"); - assert!(resolution - .package_json() - .unwrap() - .raw_json() - .get("name") - .is_some_and(|name| name == "name")); -} - -#[test] -fn clear_cache() { - let resolver = Resolver::new(ResolveOptions::default()); - resolver.clear_cache(); // exists -} - -#[test] -fn options() { - let resolver = Resolver::new(ResolveOptions::default()); - let options = resolver.options(); - assert!(!format!("{options:?}").is_empty()); -} - -#[test] -fn debug_resolver() { - let resolver = Resolver::new(ResolveOptions::default()); - assert!(!format!("{resolver:?}").is_empty()); -} - -#[test] -fn dependencies() { - let path = dir(); - let mut ctx = ResolveContext::default(); - let _ = Resolver::new(ResolveOptions::default()).resolve_with_context( - path, - "./tests/package.json", - &mut ctx, - ); - assert!(!ctx.file_dependencies.is_empty()); - assert!(ctx.missing_dependencies.is_empty()); -} - -#[test] -fn options_api() { - _ = ResolveOptions::default() - .with_builtin_modules(true) - .with_condition_names(&[]) - .with_extension(".js") - .with_force_extension(EnforceExtension::Auto) - .with_fully_specified(true) - .with_main_field("asdf") - .with_main_file("main") - .with_module("module") - .with_prefer_absolute(true) - .with_prefer_relative(true) - .with_root(PathBuf::new()) - .with_symbolic_link(true); -} diff --git a/tests/package.json b/tests/package.json deleted file mode 100644 index 54f58b8c..00000000 --- a/tests/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "name", - "type": "module", - "sideEffects": {} -} diff --git a/tests/resolve_test.rs b/tests/resolve_test.rs deleted file mode 100644 index 45934cf8..00000000 --- a/tests/resolve_test.rs +++ /dev/null @@ -1,132 +0,0 @@ -use std::{env, path::PathBuf}; - -use oxc_resolver::{ResolveError, ResolveOptions, Resolver}; - -fn dir() -> PathBuf { - env::current_dir().unwrap() -} - -#[test] -fn chinese() { - let dir = dir(); - let specifier = "./fixtures/misc/中文/中文.js"; - let resolution = Resolver::new(ResolveOptions::default()).resolve(&dir, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(dir.join("fixtures/misc/中文/中文.js")) - ); -} - -#[test] -fn styled_components() { - let dir = dir(); - let path = dir.join("fixtures/pnpm"); - let module_path = dir.join("node_modules/.pnpm/styled-components@6.1.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/styled-components"); - let specifier = "styled-components"; - - // cjs - let options = - ResolveOptions { alias_fields: vec![vec!["browser".into()]], ..ResolveOptions::default() }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/styled-components.browser.cjs.js")) - ); - - // esm - let options = ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - main_fields: vec!["module".into()], - ..ResolveOptions::default() - }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/styled-components.browser.esm.js")) - ); -} - -#[test] -fn axios() { - let dir = dir(); - let path = dir.join("fixtures/pnpm"); - let module_path = dir.join("node_modules/.pnpm/axios@1.6.2/node_modules/axios"); - let specifier = "axios"; - - // default - let options = ResolveOptions::default(); - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("index.js")) - ); - - // browser - let options = ResolveOptions { - condition_names: vec!["browser".into(), "require".into()], - ..ResolveOptions::default() - }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/browser/axios.cjs")) - ); - - // cjs - let options = ResolveOptions { - condition_names: vec!["node".into(), "require".into()], - ..ResolveOptions::default() - }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/node/axios.cjs")) - ); -} - -#[test] -fn postcss() { - let dir = dir(); - let path = dir.join("fixtures/pnpm"); - let module_path = path.join("node_modules/postcss"); - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - // should ignore "path" - let resolution = resolver.resolve(&module_path, "path"); - assert_eq!(resolution, Err(ResolveError::Ignored(module_path.clone()))); - - // should ignore "./lib/terminal-highlight" - let resolution = resolver.resolve(&module_path, "./lib/terminal-highlight"); - assert_eq!(resolution, Err(ResolveError::Ignored(module_path.join("lib/terminal-highlight")))); -} - -#[test] -fn ipaddr_js() { - let dir = dir(); - let path = dir.join("fixtures/pnpm"); - let module_path = - dir.join("node_modules/.pnpm/ipaddr.js@2.2.0/node_modules/ipaddr.js/lib/ipaddr.js"); - - let resolvers = [ - // with `extension_alias` - Resolver::new(ResolveOptions { - extension_alias: vec![(".js".into(), vec![".js".into(), ".ts".into(), ".tsx".into()])], - ..ResolveOptions::default() - }), - // with `extensions` should still resolve to module main - Resolver::new(ResolveOptions { - extensions: vec![(".ts".into())], - ..ResolveOptions::default() - }), - // default - Resolver::default(), - ]; - - for resolver in resolvers { - let resolution = resolver.resolve(&path, "ipaddr.js").map(|r| r.full_path()); - assert_eq!(resolution, Ok(module_path.clone())); - } -} From 08357c2539c2cc15b603e2abfd5d3070de326343 Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Wed, 11 Sep 2024 00:00:25 +0300 Subject: [PATCH 75/82] --- .github/CODE_OF_CONDUCT.md | 127 - .github/SECURITY.md | 7 - .github/actions/pnpm/action.yml | 26 - .github/codecov.yml | 14 - .github/renovate.json | 5 - .github/workflows/benchmark.yml | 41 - .github/workflows/ci.yml | 196 - .github/workflows/codecov.yml | 69 - .github/workflows/release-napi.yml | 252 - .github/workflows/release-plz.yml | 55 - Cargo.lock | 1326 --- fixtures/enhanced_resolve/lib/index.js | 1 - fixtures/enhanced_resolve/package.json | 4 - fixtures/enhanced_resolve/test/.gitignore | 3 - .../enhanced_resolve/test/fixtures/#/a.js | 0 fixtures/enhanced_resolve/test/fixtures/a.js | 3 - .../enhanced_resolve/test/fixtures/abc.txt | 1 - .../test/fixtures/alias/files/a.js | 0 fixtures/enhanced_resolve/test/fixtures/b.js | 3 - .../browser-module/browser/module-a.js | 0 .../fixtures/browser-module/lib/browser.js | 0 .../fixtures/browser-module/lib/ignore.js | 0 .../test/fixtures/browser-module/lib/main.js | 0 .../fixtures/browser-module/lib/replaced.js | 0 .../test/fixtures/browser-module/lib/self.js | 0 .../fixtures/browser-module/lib/toString.js | 0 .../browser-module/node_modules/module-a.js | 0 .../browser-module/node_modules/module-b.js | 0 .../browser-module/node_modules/module-c.js | 0 .../node_modules/recursive-file/a.js | 0 .../node_modules/recursive-file/b.js | 0 .../node_modules/recursive-file/c.js | 0 .../node_modules/recursive-file/d.js | 0 .../node_modules/recursive-file/package.json | 8 - .../test/fixtures/browser-module/package.json | 33 - .../test/fixtures/builtins/package.json | 12 - fixtures/enhanced_resolve/test/fixtures/c.js | 4 - .../enhanced_resolve/test/fixtures/complex.js | 13 - .../test/fixtures/crypto-js/index.js | 0 .../test/fixtures/crypto-js/package.json | 7 - .../test/fixtures/decorated-fs/exists.js | 0 .../test/fixtures/dirOrFile.js | 1 - .../test/fixtures/dirOrFile/index.js | 1 - .../directory-default/directory-default.js | 0 .../node_modules/@org/pkg/dist/string.js | 1 - .../@org/pkg/dist/string.test.d.ts | 1 - .../node_modules/@org/pkg/package.json | 9 - .../node_modules/pkg/dist/string.js | 1 - .../node_modules/pkg/dist/string.test.d.ts | 1 - .../node_modules/pkg/package.json | 9 - .../node_modules/exports-field/package.json | 7 - .../node_modules/pack1/index.js | 0 .../test/fixtures/exports-field/a.js | 1 - .../node_modules/exports-field/lib/browser.js | 1 - .../node_modules/exports-field/lib/index.js | 0 .../exports-field/lib/lib2/main.js | 1 - .../node_modules/exports-field/lib/main.js | 1 - .../node_modules/exports-field/main.js | 1 - .../node_modules/exports-field/package.json | 18 - .../node_modules/exports-field/x.js | 1 - .../invalid-exports-field/index.js | 0 .../invalid-exports-field/package.json | 13 - .../node_modules/invalid-exports-field/umd.js | 0 .../test/fixtures/exports-field/package.json | 5 - .../node_modules/exports-field/index.js | 1 - .../node_modules/exports-field/lib/browser.js | 1 - .../exports-field/lib/lib2/main.js | 1 - .../node_modules/exports-field/lib/main.js | 1 - .../node_modules/exports-field/main.js | 1 - .../node_modules/exports-field/package.json | 17 - .../node_modules/exports-field/index | 0 .../node_modules/exports-field/main.js | 1 - .../node_modules/exports-field/package.json | 10 - .../node_modules/exports-field/src/index.js | 0 .../fixtures/extension-alias/dir/index.js | 0 .../fixtures/extension-alias/dir/index.ts | 0 .../fixtures/extension-alias/dir2/index.js | 0 .../fixtures/extension-alias/dir2/index.mts | 0 .../test/fixtures/extension-alias/index.js | 0 .../test/fixtures/extension-alias/index.mjs | 0 .../fixtures/extension-alias/index.mts.js | 0 .../test/fixtures/extension-alias/index.ts | 0 .../test/fixtures/extensions/app.module.js | 0 .../test/fixtures/extensions/dir/index.js | 0 .../test/fixtures/extensions/dir/index.ts | 0 .../test/fixtures/extensions/foo.js | 0 .../test/fixtures/extensions/foo.ts | 0 .../test/fixtures/extensions/index.js | 0 .../test/fixtures/extensions/index.ts | 0 .../extensions/node_modules/module.js | 0 .../extensions/node_modules/module/index.ts | 0 .../test/fixtures/extensions/package.json | 3 - .../enhanced_resolve/test/fixtures/file.load1 | 0 .../enhanced_resolve/test/fixtures/file.load2 | 0 .../test/fixtures/foo/index.js | 0 .../test/fixtures/foo/package.json | 4 - .../node_modules/m/package.json | 17 - .../node_modules/m/src/features/f.js | 0 .../m/src/features/internal/file.js | 0 .../node_modules/m/src/features/y/y.js | 0 .../node_modules/m/src/internal/i.js | 0 .../node_modules/m/src/middle-1/f.js | 0 .../node_modules/m/src/middle-1/nested/f.js | 0 .../node_modules/m/src/middle-2/nested/f.js | 1 - .../m/src/middle-3/nested/f/nested/f.js | 0 .../node_modules/m/src/middle-4/f/f.js | 0 .../node_modules/m/src/middle-5/f$/$.js | 0 .../node_modules/m/src/middle-5/f/$.js | 0 .../node_modules/m/src/middle/f.js | 0 .../node_modules/m/src/middle/nested/f.js | 0 .../test/fixtures/imports-field/a.js | 1 - .../test/fixtures/imports-field/b.js | 0 .../test/fixtures/imports-field/dir/b.js | 0 .../node_modules/a/lib/browser.js | 1 - .../imports-field/node_modules/a/lib/index.js | 0 .../node_modules/a/lib/lib2/main.js | 1 - .../imports-field/node_modules/a/lib/main.js | 1 - .../imports-field/node_modules/a/main.js | 1 - .../imports-field/node_modules/a/package.json | 18 - .../imports-field/node_modules/a/x.js | 1 - .../imports-field/node_modules/c/index.js | 0 .../test/fixtures/imports-field/package.json | 17 - .../fixtures/incorrect-package/pack1/a.js | 0 .../incorrect-package/pack1/package.json | 2 - .../fixtures/incorrect-package/pack2/a.js | 0 .../incorrect-package/pack2/package.json | 0 .../test/fixtures/issue-238/package.json | 3 - .../test/fixtures/issue-238/src/a/config.js | 0 .../src/common/config/myObjectFile.js | 0 .../enhanced_resolve/test/fixtures/lib.js | 0 .../test/fixtures/lib/complex1.js | 1 - .../test/fixtures/main-field-self/index.js | 0 .../fixtures/main-field-self/package.json | 3 - .../test/fixtures/main-field-self2/index.js | 0 .../fixtures/main-field-self2/package.json | 3 - .../enhanced_resolve/test/fixtures/main1.js | 9 - .../enhanced_resolve/test/fixtures/main2.js | 12 - .../enhanced_resolve/test/fixtures/main3.js | 4 - .../multiple_modules/node_modules/m1/a.js | 3 - .../test/fixtures/no#fragment/#/#.js | 0 fixtures/enhanced_resolve/test/fixtures/no.js | 0 .../browser-module-broken/browser.js | 0 .../browser-module-broken/main.js | 0 .../browser-module-broken/package.json | 4 - .../complexm/node_modules/m1/a.js | 1 - .../complexm/node_modules/m1/index.js | 1 - .../fixtures/node_modules/complexm/step1.js | 1 - .../fixtures/node_modules/complexm/step2.js | 1 - .../fixtures/node_modules/dash-name/index.js | 0 .../node_modules/dash-name/package.json | 4 - .../test/fixtures/node_modules/dash/index.js | 0 .../fixtures/node_modules/dash/package.json | 4 - .../invalidPackageJson/package.json | 0 .../test/fixtures/node_modules/m1/a.js | 3 - .../test/fixtures/node_modules/m1/b.js | 3 - .../test/fixtures/node_modules/m2/b.js | 1 - .../node_modules/recursive-module/file.js | 0 .../node_modules/recursive-module/index.js | 0 .../test/fixtures/pnp-a/m2/a.js | 3 - .../test/fixtures/pnp/pkg/dir/index.js | 0 .../test/fixtures/pnp/pkg/index.js | 0 .../test/fixtures/pnp/pkg/main.js | 0 .../fixtures/pnp/pkg/package-alias/browser.js | 0 .../fixtures/pnp/pkg/package-alias/index.js | 0 .../test/fixtures/pnp/pkg/package.json | 7 - .../test/fixtures/pnp/pkg/typescript/index.ts | 0 .../test/fixtures/pnp/pkg3/a.js | 1 - .../test/fixtures/pnp/pkg3/package.json | 8 - .../prefer-pnp/alternative-modules/m1/b.js | 0 .../restrictions/node_modules/pck1/index.css | 0 .../restrictions/node_modules/pck1/index.js | 0 .../node_modules/pck1/package.json | 3 - .../restrictions/node_modules/pck2/index.css | 0 .../restrictions/node_modules/pck2/module.js | 0 .../node_modules/pck2/package.json | 5 - .../test/fixtures/roots_fall_through/index.js | 0 .../scoped/node_modules/@scope/pack1/main.js | 0 .../node_modules/@scope/pack1/package.json | 5 - .../node_modules/@scope/pack2/lib/index.js | 0 .../scoped/node_modules/@scope/pack2/main.js | 0 .../node_modules/@scope/pack2/package.json | 3 - .../test/fixtures/shortcutdir.js/a.js | 0 .../test/fixtures/yield/a/foo-2/b | 0 .../test/fixtures/yield/a/foo-2/c | 0 .../test/fixtures/yield/a/foo/a | 0 .../test/fixtures/yield/a/foo/b | 0 .../test/fixtures/yield/b/foo/a | 0 .../test/fixtures/yield/c/foo/a | 0 .../test/fixtures/yield/c/foo/package.json | 7 - .../fixtures/\346\265\213\350\257\225.js" | 0 .../\344\270\255\346\226\207.js" | 0 fixtures/pnp/.gitignore | 1 - fixtures/pnp/.pnp.cjs | 7543 ----------------- fixtures/pnp/.yarnrc.yml | 1 - fixtures/pnp/package.json | 8 - fixtures/pnp/yarn.lock | 74 - fixtures/pnpm/.gitignore | 1 - fixtures/pnpm/package.json | 11 - fixtures/pnpm/pnpm-lock.yaml | 212 - fixtures/tsconfig/cases/builtins/thing.js | 0 .../tsconfig/cases/builtins/tsconfig.json | 5 - fixtures/tsconfig/cases/exports/index.js | 0 fixtures/tsconfig/cases/exports/tsconfig.json | 3 - .../extends-extension/base-tsconfig.json | 7 - .../tsconfig/cases/extends-extension/foo.js | 0 .../cases/extends-extension/tsconfig.json | 3 - .../cases/extends-extensionless/foo.js | 0 .../cases/extends-extensionless/tsconfig.json | 3 - .../tsconfig/cases/extends-multiple/foo.js | 0 .../cases/extends-multiple/tsconfig.json | 6 - .../tsconfig/cases/extends-not-found/index.js | 0 .../cases/extends-not-found/tsconfig.json | 3 - .../tsconfig/cases/extends-paths/src/index.js | 0 .../cases/extends-paths/tsconfig.base.json | 7 - .../cases/extends-paths/tsconfig.json | 6 - fixtures/tsconfig/cases/field/index.js | 0 fixtures/tsconfig/cases/field/tsconfig.json | 3 - fixtures/tsconfig/cases/index/index.js | 0 fixtures/tsconfig/cases/index/tsconfig.json | 3 - .../cases/paths_template_variable/foo.js | 0 .../paths_template_variable/tsconfig1.json | 3 - .../paths_template_variable/tsconfig2.json | 8 - .../project_references/app/aliased/index.ts | 0 .../cases/project_references/app/index.ts | 0 .../project_references/app/tsconfig.json | 23 - .../project_a/aliased/index.ts | 0 .../project_references/project_a/conf.json | 8 - .../project_references/project_a/index.ts | 0 .../project_b/src/aliased/index.ts | 0 .../project_b/tsconfig.json | 9 - .../project_references/project_c/index.ts | 0 .../project_c/tsconfig.json | 5 - .../project_references/tsconfig.base.json | 4 - fixtures/tsconfig/cases/suffixes/a.ios.ts | 0 fixtures/tsconfig/cases/suffixes/a.ts | 0 fixtures/tsconfig/cases/suffixes/b.ts | 0 fixtures/tsconfig/cases/suffixes/c-test.ts | 0 fixtures/tsconfig/cases/suffixes/index.ts | 1 - .../tsconfig/cases/suffixes/tsconfig.json | 5 - fixtures/tsconfig/cases/trailing-comma/bar.js | 0 .../tsconfig/cases/trailing-comma/index.js | 0 .../cases/trailing-comma/tsconfig.json | 9 - fixtures/tsconfig/foo.js | 0 fixtures/tsconfig/nested/index.js | 0 fixtures/tsconfig/nested/test.js | 0 fixtures/tsconfig/nested/tsconfig.json | 8 - .../node_modules/tsconfig-exports/conf.json | 7 - .../node_modules/tsconfig-exports/foo.js | 0 .../tsconfig-exports/package.json | 7 - .../node_modules/tsconfig-field/conf.json | 7 - .../node_modules/tsconfig-field/foo.js | 0 .../node_modules/tsconfig-field/package.json | 5 - .../node_modules/tsconfig-index/foo.js | 0 .../node_modules/tsconfig-index/package.json | 4 - .../node_modules/tsconfig-index/tsconfig.json | 7 - .../node_modules/tsconfig-not-used/foo.js | 0 .../tsconfig-not-used/tsconfig.json | 7 - fixtures/tsconfig/package.json | 24 - fixtures/tsconfig/tsconfig.json | 7 - fixtures/tsconfig/tsconfig_broken.json | 1 - .../tsconfig/tsconfig_template_variable.json | 7 - napi/__test__/resolver.spec.mjs | 260 - napi/src/lib.rs | 214 - napi/src/options.rs | 261 - napi/src/tracing.rs | 25 - napi/tests/options.test.mjs | 59 - npm/package.json | 79 +- package.json | 53 +- pnpm-lock.yaml | 2598 ------ src/builtins.rs | 71 - src/cache.rs | 354 - src/context.rs | 89 - src/error.rs | 182 - src/file_system.rs | 220 - src/lib.rs | 1755 ---- src/options.rs | 633 -- src/package_json.rs | 219 - src/path.rs | 132 - src/resolution.rs | 92 - src/specifier.rs | 230 - src/tests/alias.rs | 283 - src/tests/browser_field.rs | 189 - src/tests/builtins.rs | 121 - src/tests/dependencies.rs | 110 - src/tests/exports_field.rs | 2546 ------ src/tests/extension_alias.rs | 70 - src/tests/extensions.rs | 125 - src/tests/fallback.rs | 100 - src/tests/full_specified.rs | 113 - src/tests/imports_field.rs | 1320 --- src/tests/incorrect_description_file.rs | 65 - src/tests/main_field.rs | 24 - src/tests/memory_fs.rs | 74 - src/tests/missing.rs | 106 - src/tests/mod.rs | 51 - src/tests/pnp.rs | 45 - src/tests/resolve.rs | 119 - src/tests/restrictions.rs | 25 - src/tests/roots.rs | 92 - src/tests/scoped_packages.rs | 25 - src/tests/simple.rs | 68 - src/tests/symlink.rs | 121 - src/tests/tsconfig_paths.rs | 530 -- src/tests/tsconfig_project_references.rs | 132 - src/tsconfig.rs | 223 - tests/integration_test.rs | 103 - tests/package.json | 5 - tests/resolve_test.rs | 132 - 308 files changed, 56 insertions(+), 24940 deletions(-) delete mode 100644 .github/CODE_OF_CONDUCT.md delete mode 100644 .github/SECURITY.md delete mode 100644 .github/actions/pnpm/action.yml delete mode 100644 .github/codecov.yml delete mode 100644 .github/renovate.json delete mode 100644 .github/workflows/benchmark.yml delete mode 100644 .github/workflows/ci.yml delete mode 100644 .github/workflows/codecov.yml delete mode 100644 .github/workflows/release-napi.yml delete mode 100644 .github/workflows/release-plz.yml delete mode 100644 Cargo.lock delete mode 100644 fixtures/enhanced_resolve/lib/index.js delete mode 100644 fixtures/enhanced_resolve/package.json delete mode 100644 fixtures/enhanced_resolve/test/.gitignore delete mode 100644 fixtures/enhanced_resolve/test/fixtures/#/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/abc.txt delete mode 100644 fixtures/enhanced_resolve/test/fixtures/alias/files/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/browser/module-a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/ignore.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/replaced.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/self.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/toString.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-c.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/c.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/d.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/builtins/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/c.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/complex.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/crypto-js/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/decorated-fs/exists.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/dirOrFile.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/directory-default/directory-default.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/pack1/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/umd.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/index delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/src/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.mts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mjs delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mts.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/app.module.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/foo.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/foo.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/file.load1 delete mode 100644 fixtures/enhanced_resolve/test/fixtures/file.load2 delete mode 100644 fixtures/enhanced_resolve/test/fixtures/foo/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/foo/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/internal/file.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/y/y.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/internal/i.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-3/nested/f/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-4/f/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f$/$.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f/$.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/dir/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/c/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/issue-238/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/issue-238/src/a/config.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/issue-238/src/common/config/myObjectFile.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/lib.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/lib/complex1.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self2/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main1.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main2.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main3.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/no#fragment/#/#.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/no.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/invalidPackageJson/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/file.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/dir/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/typescript/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/prefer-pnp/alternative-modules/m1/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.css delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/index.css delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/module.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/roots_fall_through/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/lib/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/shortcutdir.js/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/b delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/c delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo/a delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo/b delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/b/foo/a delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/c/foo/a delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json delete mode 100644 "fixtures/enhanced_resolve/test/fixtures/\346\265\213\350\257\225.js" delete mode 100644 "fixtures/misc/\344\270\255\346\226\207/\344\270\255\346\226\207.js" delete mode 100644 fixtures/pnp/.gitignore delete mode 100755 fixtures/pnp/.pnp.cjs delete mode 100644 fixtures/pnp/.yarnrc.yml delete mode 100644 fixtures/pnp/package.json delete mode 100644 fixtures/pnp/yarn.lock delete mode 100644 fixtures/pnpm/.gitignore delete mode 100644 fixtures/pnpm/package.json delete mode 100644 fixtures/pnpm/pnpm-lock.yaml delete mode 100644 fixtures/tsconfig/cases/builtins/thing.js delete mode 100644 fixtures/tsconfig/cases/builtins/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/exports/index.js delete mode 100644 fixtures/tsconfig/cases/exports/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-extension/base-tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-extension/foo.js delete mode 100644 fixtures/tsconfig/cases/extends-extension/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-extensionless/foo.js delete mode 100644 fixtures/tsconfig/cases/extends-extensionless/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-multiple/foo.js delete mode 100644 fixtures/tsconfig/cases/extends-multiple/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-not-found/index.js delete mode 100644 fixtures/tsconfig/cases/extends-not-found/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-paths/src/index.js delete mode 100644 fixtures/tsconfig/cases/extends-paths/tsconfig.base.json delete mode 100644 fixtures/tsconfig/cases/extends-paths/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/field/index.js delete mode 100644 fixtures/tsconfig/cases/field/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/index/index.js delete mode 100644 fixtures/tsconfig/cases/index/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/paths_template_variable/foo.js delete mode 100644 fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json delete mode 100644 fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json delete mode 100644 fixtures/tsconfig/cases/project_references/app/aliased/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/app/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/app/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/project_references/project_a/aliased/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_a/conf.json delete mode 100644 fixtures/tsconfig/cases/project_references/project_a/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_b/src/aliased/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_b/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/project_references/project_c/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_c/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/project_references/tsconfig.base.json delete mode 100644 fixtures/tsconfig/cases/suffixes/a.ios.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/a.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/b.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/c-test.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/index.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/trailing-comma/bar.js delete mode 100644 fixtures/tsconfig/cases/trailing-comma/index.js delete mode 100644 fixtures/tsconfig/cases/trailing-comma/tsconfig.json delete mode 100644 fixtures/tsconfig/foo.js delete mode 100644 fixtures/tsconfig/nested/index.js delete mode 100644 fixtures/tsconfig/nested/test.js delete mode 100644 fixtures/tsconfig/nested/tsconfig.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-exports/conf.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-exports/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-exports/package.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-field/conf.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-field/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-field/package.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-index/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-index/package.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-not-used/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json delete mode 100755 fixtures/tsconfig/package.json delete mode 100644 fixtures/tsconfig/tsconfig.json delete mode 100644 fixtures/tsconfig/tsconfig_broken.json delete mode 100644 fixtures/tsconfig/tsconfig_template_variable.json delete mode 100644 napi/__test__/resolver.spec.mjs delete mode 100644 napi/src/lib.rs delete mode 100644 napi/src/options.rs delete mode 100644 napi/src/tracing.rs delete mode 100644 napi/tests/options.test.mjs delete mode 100644 pnpm-lock.yaml delete mode 100644 src/builtins.rs delete mode 100644 src/cache.rs delete mode 100644 src/context.rs delete mode 100644 src/error.rs delete mode 100644 src/file_system.rs delete mode 100644 src/lib.rs delete mode 100644 src/options.rs delete mode 100644 src/package_json.rs delete mode 100644 src/path.rs delete mode 100644 src/resolution.rs delete mode 100644 src/specifier.rs delete mode 100644 src/tests/alias.rs delete mode 100644 src/tests/browser_field.rs delete mode 100644 src/tests/builtins.rs delete mode 100644 src/tests/dependencies.rs delete mode 100644 src/tests/exports_field.rs delete mode 100644 src/tests/extension_alias.rs delete mode 100644 src/tests/extensions.rs delete mode 100644 src/tests/fallback.rs delete mode 100644 src/tests/full_specified.rs delete mode 100644 src/tests/imports_field.rs delete mode 100644 src/tests/incorrect_description_file.rs delete mode 100644 src/tests/main_field.rs delete mode 100644 src/tests/memory_fs.rs delete mode 100644 src/tests/missing.rs delete mode 100644 src/tests/mod.rs delete mode 100644 src/tests/pnp.rs delete mode 100644 src/tests/resolve.rs delete mode 100644 src/tests/restrictions.rs delete mode 100644 src/tests/roots.rs delete mode 100644 src/tests/scoped_packages.rs delete mode 100644 src/tests/simple.rs delete mode 100644 src/tests/symlink.rs delete mode 100644 src/tests/tsconfig_paths.rs delete mode 100644 src/tests/tsconfig_project_references.rs delete mode 100644 src/tsconfig.rs delete mode 100644 tests/integration_test.rs delete mode 100644 tests/package.json delete mode 100644 tests/resolve_test.rs diff --git a/.github/CODE_OF_CONDUCT.md b/.github/CODE_OF_CONDUCT.md deleted file mode 100644 index 41dd9ebe..00000000 --- a/.github/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,127 +0,0 @@ -# Contributor Covenant Code of Conduct - -## Our Pledge - -We as members, contributors, and leaders pledge to make participation in our -community a harassment-free experience for everyone, regardless of age, body -size, visible or invisible disability, ethnicity, sex characteristics, gender -identity and expression, level of experience, education, socio-economic status, -nationality, personal appearance, race, religion, or sexual identity -and orientation. - -We pledge to act and interact in ways that contribute to an open, welcoming, -diverse, inclusive, and healthy community. - -## Our Standards - -Examples of behavior that contributes to a positive environment for our -community include: - -* Demonstrating empathy and kindness toward other people -* Being respectful of differing opinions, viewpoints, and experiences -* Giving and gracefully accepting constructive feedback -* Accepting responsibility and apologizing to those affected by our mistakes, - and learning from the experience -* Focusing on what is best not just for us as individuals, but for the - overall community - -Examples of unacceptable behavior include: - -* The use of sexualized language or imagery, and sexual attention or - advances of any kind -* Trolling, insulting or derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or email - address, without their explicit permission -* Other conduct which could reasonably be considered inappropriate in a - professional setting - -## Enforcement Responsibilities - -Community leaders are responsible for clarifying and enforcing our standards of -acceptable behavior and will take appropriate and fair corrective action in -response to any behavior that they deem inappropriate, threatening, offensive, -or harmful. - -Community leaders have the right and responsibility to remove, edit, or reject -comments, commits, code, wiki edits, issues, and other contributions that are -not aligned to this Code of Conduct, and will communicate reasons for moderation -decisions when appropriate. - -## Scope - -This Code of Conduct applies within all community spaces, and also applies when -an individual is officially representing the community in public spaces. -Examples of representing our community include using an official e-mail address, -posting via an official social media account, or acting as an appointed -representative at an online or offline event. - -## Enforcement - -Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported to the community leaders responsible for enforcement. -All complaints will be reviewed and investigated promptly and fairly. - -All community leaders are obligated to respect the privacy and security of the -reporter of any incident. - -## Enforcement Guidelines - -Community leaders will follow these Community Impact Guidelines in determining -the consequences for any action they deem in violation of this Code of Conduct: - -### 1. Correction - -**Community Impact**: Use of inappropriate language or other behavior deemed -unprofessional or unwelcome in the community. - -**Consequence**: A private, written warning from community leaders, providing -clarity around the nature of the violation and an explanation of why the -behavior was inappropriate. A public apology may be requested. - -### 2. Warning - -**Community Impact**: A violation through a single incident or series -of actions. - -**Consequence**: A warning with consequences for continued behavior. No -interaction with the people involved, including unsolicited interaction with -those enforcing the Code of Conduct, for a specified period of time. This -includes avoiding interactions in community spaces as well as external channels -like social media. Violating these terms may lead to a temporary or -permanent ban. - -### 3. Temporary Ban - -**Community Impact**: A serious violation of community standards, including -sustained inappropriate behavior. - -**Consequence**: A temporary ban from any sort of interaction or public -communication with the community for a specified period of time. No public or -private interaction with the people involved, including unsolicited interaction -with those enforcing the Code of Conduct, is allowed during this period. -Violating these terms may lead to a permanent ban. - -### 4. Permanent Ban - -**Community Impact**: Demonstrating a pattern of violation of community -standards, including sustained inappropriate behavior, harassment of an -individual, or aggression toward or disparagement of classes of individuals. - -**Consequence**: A permanent ban from any sort of public interaction within -the community. - -## Attribution - -This Code of Conduct is adapted from the [Contributor Covenant][homepage], -version 2.0, available at -https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. - -Community Impact Guidelines were inspired by [Mozilla's code of conduct -enforcement ladder](https://github.com/mozilla/diversity). - -[homepage]: https://www.contributor-covenant.org - -For answers to common questions about this code of conduct, see the FAQ at -https://www.contributor-covenant.org/faq. Translations are available at -https://www.contributor-covenant.org/translations. diff --git a/.github/SECURITY.md b/.github/SECURITY.md deleted file mode 100644 index 63f5b072..00000000 --- a/.github/SECURITY.md +++ /dev/null @@ -1,7 +0,0 @@ -# Security Policy - -## Supported Versions - -## Reporting a Vulnerability - -If you find any potential vulnerability, join our [discord channel](https://discord.gg/9uXCAwqQZW) and contact Boshen. diff --git a/.github/actions/pnpm/action.yml b/.github/actions/pnpm/action.yml deleted file mode 100644 index ab4291c0..00000000 --- a/.github/actions/pnpm/action.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: Pnpm - -description: Install pnpm - -runs: - using: composite - steps: - - uses: pnpm/action-setup@v4 - - - uses: actions/setup-node@v4 - with: - node-version-file: .node-version - cache: pnpm - - - name: yarn - shell: bash - run: | - cd fixtures/pnp - corepack enable - yarn install - - - name: pnpm - shell: bash - run: | - corepack enable - pnpm install diff --git a/.github/codecov.yml b/.github/codecov.yml deleted file mode 100644 index 0610268a..00000000 --- a/.github/codecov.yml +++ /dev/null @@ -1,14 +0,0 @@ -coverage: - status: - project: - default: - informational: true - patch: - default: - informational: true - changes: - default: - informational: true - -ignore: - - "examples" diff --git a/.github/renovate.json b/.github/renovate.json deleted file mode 100644 index 2339df09..00000000 --- a/.github/renovate.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "$schema": "https://docs.renovatebot.com/renovate-schema.json", - "extends": ["github>Boshen/renovate"], - "ignorePaths": ["**/node_modules/**", "**/fixtures/**"] -} diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml deleted file mode 100644 index 7c25853b..00000000 --- a/.github/workflows/benchmark.yml +++ /dev/null @@ -1,41 +0,0 @@ -name: Benchmark - -on: - workflow_dispatch: - pull_request: - types: [opened, synchronize] - paths-ignore: - - '**/*.md' - push: - branches: - - main - paths-ignore: - - '**/*.md' - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} - cancel-in-progress: true - -jobs: - benchmark: - name: Benchmark - runs-on: ubuntu-latest - steps: - - name: Checkout Branch - uses: taiki-e/checkout-action@v1 - - - uses: Boshen/setup-rust@main - with: - cache-key: benchmark - save-cache: ${{ github.ref_name == 'main' }} - tools: cargo-codspeed - - uses: ./.github/actions/pnpm - - name: Build Benchmark - run: cargo codspeed build --features codspeed - - - name: Run benchmark - uses: CodSpeedHQ/action@v3 - timeout-minutes: 30 - with: - run: cargo codspeed run - token: ${{ secrets.CODSPEED_TOKEN }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index 3f629ffb..00000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,196 +0,0 @@ -name: CI - -on: - workflow_dispatch: - pull_request: - types: [opened, synchronize] - paths-ignore: - - '**/*.md' - - '!.github/workflows/ci.yml' - push: - branches: - - main - - "renovate/**" - paths-ignore: - - '**/*.md' - - '!.github/workflows/ci.yml' - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} - cancel-in-progress: ${{ github.ref_name != 'main' }} - -defaults: - run: - shell: bash - -jobs: - cache: # Warm cache factory for all other CI jobs - name: Check and Build - strategy: - fail-fast: true - matrix: - include: - - os: windows-latest - - os: ubuntu-latest - - os: macos-14 - runs-on: ${{ matrix.os }} - steps: - - uses: taiki-e/checkout-action@v1 - - - uses: Boshen/setup-rust@main - with: - save-cache: ${{ github.ref_name == 'main' }} - cache-key: warm - - - run: cargo check --all-features --locked - - # Only need to build the test to create a warm cache on the main branch - - name: Build cache by Cargo Check and Cargo Test - if: ${{ github.ref_name == 'main' }} - run: cargo test --all-features --no-run - - wasm: - name: Check Wasm - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - - uses: Boshen/setup-rust@main - with: - cache-key: wasm - save-cache: ${{ github.ref_name == 'main' }} - - - name: Check - run: | - rustup target add wasm32-unknown-unknown - cargo check --all-features --target wasm32-unknown-unknown - - wasi: - name: Test wasi target - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - - uses: Boshen/setup-rust@main - with: - cache-key: wasi - save-cache: ${{ github.ref_name == 'main' }} - - - uses: ./.github/actions/pnpm - - - name: Build - run: | - rustup target add wasm32-wasip1-threads - pnpm build --target wasm32-wasip1-threads - - - name: Test - run: pnpm test - env: - WASI_TEST: 1 - - typos: - name: Spell Check - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - - uses: crate-ci/typos@v1.24.5 - with: - files: . - - deny: - name: Cargo Deny - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - - uses: dorny/paths-filter@v3 - id: filter - with: - filters: | - src: - - 'Cargo.lock' - - - uses: Boshen/setup-rust@main - with: - restore-cache: false - tools: cargo-deny - - - if: steps.filter.outputs.src == 'true' - run: cargo deny check - - unused-deps: - name: Check Unused Dependencies - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - uses: dorny/paths-filter@v3 - id: filter - with: - filters: | - src: - - '**/*.rs' - - '**/Cargo.toml' - - 'Cargo.lock' - - uses: Boshen/setup-rust@main - with: - restore-cache: false - if: steps.filter.outputs.src == 'true' - - uses: cargo-bins/cargo-binstall@main - if: steps.filter.outputs.src == 'true' - - run: cargo binstall --no-confirm cargo-shear@1 - if: steps.filter.outputs.src == 'true' - - run: cargo shear - if: steps.filter.outputs.src == 'true' - - format: - name: Format - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - uses: Boshen/setup-rust@main - with: - components: rustfmt - restore-cache: false - - run: cargo fmt --all -- --check - - lint: - name: Clippy - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - uses: Boshen/setup-rust@main - with: - components: clippy - - run: cargo clippy --all-features -- -D warnings - - doc: - name: Doc - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - uses: Boshen/setup-rust@main - with: - components: rust-docs - - run: RUSTDOCFLAGS='-D warnings' cargo doc --no-deps --all-features - - test: - name: Test - strategy: - fail-fast: true - matrix: - include: - - os: windows-latest - - os: ubuntu-latest - - os: macos-14 - runs-on: ${{ matrix.os }} - env: - RUST_BACKTRACE: 1 - steps: - - uses: taiki-e/checkout-action@v1 - - uses: ./.github/actions/pnpm - - uses: Boshen/setup-rust@main - with: - cache-key: warm - - run: cargo test --doc - - run: cargo test --all-features diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml deleted file mode 100644 index 97302b03..00000000 --- a/.github/workflows/codecov.yml +++ /dev/null @@ -1,69 +0,0 @@ -name: Code Coverage # Run cargo-llvm-cov and upload to codecov.io - -on: - workflow_dispatch: - pull_request: - types: [opened, synchronize] - paths-ignore: - - '**/*.md' - push: - branches: - - main - paths-ignore: - - '**/*.md' - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: ${{ github.ref_name != 'main' }} - -jobs: - coverage: - name: Code Coverage - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: taiki-e/checkout-action@v1 - - - uses: ./.github/actions/pnpm - - - uses: Boshen/setup-rust@main - with: - cache-key: codecov - save-cache: ${{ github.ref_name == 'main' }} - tools: cargo-llvm-cov - components: llvm-tools-preview - - - run: cargo llvm-cov --lcov --output-path lcov.info - - - name: Upload Artifact - uses: actions/upload-artifact@v4 - with: - name: codecov - path: lcov.info - - # codecov often fails, use another workflow for retry - upload-codecov: - name: Upload coverage file - runs-on: ubuntu-latest - needs: coverage - # Check if the event is not triggered by a fork by checking whether CODECOV_TOKEN is set - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - steps: - - name: Checkout - if: env.CODECOV_TOKEN - uses: taiki-e/checkout-action@v1 - - - name: Download coverage file - if: env.CODECOV_TOKEN - uses: actions/download-artifact@v4 - with: - name: codecov - - - name: Upload to codecov.io - if: env.CODECOV_TOKEN - uses: codecov/codecov-action@v4 - with: - token: ${{ secrets.CODECOV_TOKEN }} - fail_ci_if_error: true - files: lcov.info diff --git a/.github/workflows/release-napi.yml b/.github/workflows/release-napi.yml deleted file mode 100644 index 1ea68db8..00000000 --- a/.github/workflows/release-napi.yml +++ /dev/null @@ -1,252 +0,0 @@ -name: Release NAPI - -on: - workflow_dispatch: - push: - branches: - - main - paths: - - npm/package.json # Please only commit this file, so we don't need to wait for test CI to pass. - -env: - DEBUG: 'napi:*' - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - check: - name: Check version - runs-on: ubuntu-latest - outputs: - version: ${{ env.version }} - version_changed: ${{ steps.version.outputs.changed }} - steps: - - uses: taiki-e/checkout-action@v1 - - - name: Check version changes - uses: EndBug/version-check@v2 - id: version - with: - static-checking: localIsNew - file-url: https://unpkg.com/oxc-resolver@latest/package.json - file-name: npm/package.json - - - name: Set version name - if: steps.version.outputs.changed == 'true' - run: | - echo "Version change found! New version: ${{ steps.version.outputs.version }} (${{ steps.version.outputs.version_type }})" - echo "version=${{ steps.version.outputs.version }}" >> $GITHUB_ENV - - build: - needs: check - if: needs.check.outputs.version_changed == 'true' - env: - version: ${{ needs.check.outputs.version }} - outputs: - version: ${{ env.version }} - strategy: - fail-fast: false - matrix: - include: - - os: windows-latest - target: x86_64-pc-windows-msvc - - - os: windows-latest - target: aarch64-pc-windows-msvc - - - os: ubuntu-latest - target: x86_64-unknown-linux-gnu - - - os: ubuntu-latest - target: x86_64-unknown-linux-musl - - - os: ubuntu-latest - target: aarch64-unknown-linux-gnu - - - os: ubuntu-latest - target: aarch64-unknown-linux-musl - - - os: ubuntu-latest - target: armv7-unknown-linux-gnueabihf - - - os: macos-latest - target: x86_64-apple-darwin - - - os: macos-latest - target: aarch64-apple-darwin - - - os: ubuntu-latest - target: wasm32-wasip1-threads - - name: Package ${{ matrix.target }} - runs-on: ${{ matrix.os }} - steps: - - uses: taiki-e/checkout-action@v1 - - - uses: ./.github/actions/pnpm - - - name: Add Rust Target - run: rustup target add ${{ matrix.target }} - - - uses: goto-bus-stop/setup-zig@v2 - if: ${{ contains(matrix.target, 'musl') }} - with: - version: 0.13.0 - - - name: Build with zig cross - if: ${{ contains(matrix.target, 'musl') }} - run: pnpm build -x --target ${{ matrix.target }} - - - name: Build with napi cross - if: ${{ contains(matrix.target, 'gnu') }} - run: pnpm build --use-napi-cross --target ${{ matrix.target }} - - - name: Build - if: ${{ !contains(matrix.target, 'gnu') && !contains(matrix.target, 'musl') }} - run: pnpm build --target ${{ matrix.target }} - - - name: Test - if: matrix.target == 'x86_64-pc-windows-msvc' || matrix.target == 'aarch64-apple-darwin' || matrix.target == 'wasm32-wasip1-threads' - run: pnpm test - - - name: Output docker params - if: ${{ contains(matrix.target, 'linux') }} - id: docker - run: | - node -e " - if ('${{ matrix.target }}'.startsWith('aarch64')) { - console.log('PLATFORM=linux/arm64') - } else if ('${{ matrix.target }}'.startsWith('armv7')) { - console.log('PLATFORM=linux/arm/v7') - } else { - console.log('PLATFORM=linux/amd64') - } - " >> $GITHUB_OUTPUT - node -e " - if ('${{ matrix.target }}'.endsWith('-musl')) { - console.log('IMAGE=node:lts-alpine') - } else { - console.log('IMAGE=node:lts-slim') - } - " >> $GITHUB_OUTPUT - echo "PNPM_STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_OUTPUT - - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - if: ${{ contains(matrix.target, 'linux') }} - with: - platforms: all - - - run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes - if: ${{ contains(matrix.target, 'linux') }} - - - name: Run linux test - uses: addnab/docker-run-action@v3 - if: ${{ contains(matrix.target, 'linux') }} - with: - image: ${{ steps.docker.outputs.IMAGE }} - options: -v ${{ steps.docker.outputs.PNPM_STORE_PATH }}:${{ steps.docker.outputs.PNPM_STORE_PATH }} -v ${{ github.workspace }}:/oxc_resolver -w /oxc_resolver --platform ${{ steps.docker.outputs.PLATFORM }} - run: | - corepack enable - pnpm test - - - name: Upload artifacts - uses: actions/upload-artifact@v4 - with: - name: bindings-${{ matrix.target }} - path: | - napi/*.node - napi/*.wasm - - build-freebsd: - needs: check - if: needs.check.outputs.version_changed == 'true' - name: Build FreeBSD - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Build - id: build - uses: cross-platform-actions/action@v0.25.0 - env: - DEBUG: napi:* - RUSTUP_IO_THREADS: 1 - with: - operating_system: freebsd - version: '14.0' - memory: 8G - cpu_count: 3 - environment_variables: 'DEBUG RUSTUP_IO_THREADS' - shell: bash - run: | - sudo pkg install -y -f curl node libnghttp2 npm - curl https://sh.rustup.rs -sSf --output rustup.sh - sh rustup.sh -y --profile minimal --default-toolchain stable - source "$HOME/.cargo/env" - echo "~~~~ rustc --version ~~~~" - rustc --version - echo "~~~~ node -v ~~~~" - node -v - pwd - ls -lah - whoami - env - sudo corepack enable - pnpm install - pnpm build --target x86_64-unknown-freebsd - rm -rf node_modules - rm -rf target - - name: Upload artifact - uses: actions/upload-artifact@v4 - with: - name: bindings-freebsd - path: napi/*.node - if-no-files-found: error - - publish: - name: Publish NAPI - runs-on: ubuntu-latest - permissions: - id-token: write # for `npm publish --provenance` - needs: - - build - - build-freebsd - steps: - - uses: taiki-e/checkout-action@v1 - - - name: corepack - run: corepack enable - - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version-file: .node-version - cache: pnpm - - - name: Install dependencies - run: pnpm install --frozen-lockfile - - - name: Download Artifacts - uses: actions/download-artifact@v4 - with: - path: artifacts - - - name: Prepare dirs and artifacts - run: | - pnpm napi create-npm-dirs --package-json-path npm/package.json - pnpm napi artifacts --package-json-path npm/package.json --build-output-dir napi - - - name: Publish npm packages as latest - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - shell: bash - run: | - cp napi/index.js npm/index.js - cp napi/index.d.ts npm/index.d.ts - cp napi/browser.js npm/browser.js - echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc - pnpm napi pre-publish --no-gh-release -t npm --package-json-path npm/package.json - npm publish npm/ --tag latest --provenance --access public diff --git a/.github/workflows/release-plz.yml b/.github/workflows/release-plz.yml deleted file mode 100644 index 121758ad..00000000 --- a/.github/workflows/release-plz.yml +++ /dev/null @@ -1,55 +0,0 @@ -name: Release Plz - -on: - workflow_dispatch: - push: - branches: - - main - -permissions: - pull-requests: write - contents: write - -jobs: - release-plz: - name: Release-plz - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - uses: Boshen/setup-rust@main - with: - save-cache: ${{ github.ref_name == 'main' }} - cache-key: warm - - - name: Run release-plz - id: release-plz - uses: MarcoIeni/release-plz-action@v0.5 - env: - GITHUB_TOKEN: ${{ secrets.RELEASE_PLZ_TOKEN }} - CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} - - - name: Bump package.json - if: ${{ steps.release-plz.outputs.prs_created }} - env: - GH_TOKEN: ${{ github.token }} - RELEASES: ${{ steps.release-plz.outputs.releases }} - PR: ${{ steps.release-plz.outputs.pr }} - run: | - set -e - - pr_number=${{ fromJSON(steps.release-plz.outputs.pr).number }} - if [[ -n "$pr_number" ]]; then - version=$(echo "$RELEASES" | jq -r '.[0].version') - echo "version: $version" - - jq --arg version "${version}" '.version = ($version)' npm/package.json > tmp - mv tmp npm/package.json - - gh pr checkout $pr_number - git add . - git commit -m "Update package.json" - git push - fi diff --git a/Cargo.lock b/Cargo.lock deleted file mode 100644 index 58c1e7ad..00000000 --- a/Cargo.lock +++ /dev/null @@ -1,1326 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "adler" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" - -[[package]] -name = "aho-corasick" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" -dependencies = [ - "memchr", -] - -[[package]] -name = "android-tzdata" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" - -[[package]] -name = "android_system_properties" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" -dependencies = [ - "libc", -] - -[[package]] -name = "anes" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "735d4f398ca57cfa2880225c2bf81c3b9af3be5bb22e44ae70118dad38713e84" - -[[package]] -name = "arca" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f915ddd863ef73f11c10c75170e86db1d4f539689bc6bfb9ce25d6528d6fe83" -dependencies = [ - "clean-path", - "path-slash", - "radix_trie", -] - -[[package]] -name = "autocfg" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" - -[[package]] -name = "base64" -version = "0.22.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" - -[[package]] -name = "bit-set" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1" -dependencies = [ - "bit-vec", -] - -[[package]] -name = "bit-vec" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "bitflags" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" - -[[package]] -name = "bpaf" -version = "0.9.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3280efcf6d66bc77c2cf9b67dc8acee47a217d9be67dd590b3230dffe663724d" - -[[package]] -name = "bumpalo" -version = "3.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" - -[[package]] -name = "byteorder" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" - -[[package]] -name = "cast" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" - -[[package]] -name = "cc" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eaff6f8ce506b9773fa786672d63fc7a191ffea1be33f72bbd4aeacefca9ffc8" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "chrono" -version = "0.4.38" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" -dependencies = [ - "android-tzdata", - "iana-time-zone", - "num-traits", - "serde", - "windows-targets 0.52.6", -] - -[[package]] -name = "ciborium" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42e69ffd6f0917f5c029256a24d0161db17cea3997d185db0d35926308770f0e" -dependencies = [ - "ciborium-io", - "ciborium-ll", - "serde", -] - -[[package]] -name = "ciborium-io" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05afea1e0a06c9be33d539b876f1ce3692f4afea2cb41f740e7743225ed1c757" - -[[package]] -name = "ciborium-ll" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57663b653d948a338bfb3eeba9bb2fd5fcfaecb9e199e87e1eda4d9e8b240fd9" -dependencies = [ - "ciborium-io", - "half", -] - -[[package]] -name = "clean-path" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aaa6b4b263a5d737e9bf6b7c09b72c41a5480aec4d7219af827f6564e950b6a5" - -[[package]] -name = "codspeed" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a104ac948e0188b921eb3fcbdd55dcf62e542df4c7ab7e660623f6288302089" -dependencies = [ - "colored", - "libc", - "serde_json", -] - -[[package]] -name = "colored" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbf2150cce219b664a8a70df7a1f933836724b503f8a413af9365b4dcc4d90b8" -dependencies = [ - "lazy_static", - "windows-sys 0.48.0", -] - -[[package]] -name = "concurrent_lru" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7feb5cb312f774e8a24540e27206db4e890f7d488563671d24a16389cf4c2e4e" -dependencies = [ - "once_cell", -] - -[[package]] -name = "convert_case" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec182b0ca2f35d8fc196cf3404988fd8b8c739a4d270ff118a398feb0cbec1ca" -dependencies = [ - "unicode-segmentation", -] - -[[package]] -name = "core-foundation-sys" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" - -[[package]] -name = "criterion2" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8df39381f28ced0ceebfb5611528d99aef14f8d75b43e9d4ceb6aba66e7b04d" -dependencies = [ - "anes", - "bpaf", - "cast", - "ciborium", - "codspeed", - "colored", - "num-traits", - "oorandom", - "serde", - "serde_json", - "walkdir", -] - -[[package]] -name = "crossbeam-deque" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" -dependencies = [ - "crossbeam-epoch", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.9.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" -dependencies = [ - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" - -[[package]] -name = "crunchy" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" - -[[package]] -name = "ctor" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edb49164822f3ee45b17acd4a208cfc1251410cf0cad9a833234c9890774dd9f" -dependencies = [ - "quote", - "syn", -] - -[[package]] -name = "darling" -version = "0.20.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" -dependencies = [ - "darling_core", - "darling_macro", -] - -[[package]] -name = "darling_core" -version = "0.20.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95133861a8032aaea082871032f5815eb9e98cef03fa916ab4500513994df9e5" -dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "strsim", - "syn", -] - -[[package]] -name = "darling_macro" -version = "0.20.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" -dependencies = [ - "darling_core", - "quote", - "syn", -] - -[[package]] -name = "dashmap" -version = "6.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "804c8821570c3f8b70230c2ba75ffa5c0f9a4189b9a432b6656c536712acae28" -dependencies = [ - "cfg-if", - "crossbeam-utils", - "hashbrown 0.14.5", - "lock_api", - "once_cell", - "parking_lot_core", -] - -[[package]] -name = "deranged" -version = "0.3.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" -dependencies = [ - "powerfmt", - "serde", -] - -[[package]] -name = "document-features" -version = "0.2.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb6969eaabd2421f8a2775cfd2471a2b634372b4a25d41e3bd647b79912850a0" -dependencies = [ - "litrs", -] - -[[package]] -name = "dunce" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" - -[[package]] -name = "either" -version = "1.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" - -[[package]] -name = "endian-type" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" - -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "fancy-regex" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "531e46835a22af56d1e3b66f04844bed63158bc094a628bec1d321d9b4c44bf2" -dependencies = [ - "bit-set", - "regex-automata", - "regex-syntax", -] - -[[package]] -name = "filetime" -version = "0.2.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ee447700ac8aa0b2f2bd7bc4462ad686ba06baa6727ac149a2d6277f0d240fd" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall 0.4.1", - "windows-sys 0.52.0", -] - -[[package]] -name = "fnv" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" - -[[package]] -name = "half" -version = "2.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dd08c532ae367adf81c312a4580bc67f1d0fe8bc9c460520283f4c0ff277888" -dependencies = [ - "cfg-if", - "crunchy", -] - -[[package]] -name = "hashbrown" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" - -[[package]] -name = "hashbrown" -version = "0.14.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "iana-time-zone" -version = "0.1.60" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" -dependencies = [ - "android_system_properties", - "core-foundation-sys", - "iana-time-zone-haiku", - "js-sys", - "wasm-bindgen", - "windows-core", -] - -[[package]] -name = "iana-time-zone-haiku" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" -dependencies = [ - "cc", -] - -[[package]] -name = "ident_case" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" - -[[package]] -name = "indexmap" -version = "1.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" -dependencies = [ - "autocfg", - "hashbrown 0.12.3", - "serde", -] - -[[package]] -name = "indexmap" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93ead53efc7ea8ed3cfb0c79fc8023fbb782a5432b52830b6518941cebe6505c" -dependencies = [ - "equivalent", - "hashbrown 0.14.5", - "serde", -] - -[[package]] -name = "itoa" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" - -[[package]] -name = "js-sys" -version = "0.3.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" -dependencies = [ - "wasm-bindgen", -] - -[[package]] -name = "json-strip-comments" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b271732a960335e715b6b2ae66a086f115c74eb97360e996d2bd809bfc063bba" -dependencies = [ - "memchr", -] - -[[package]] -name = "lazy_static" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" - -[[package]] -name = "libc" -version = "0.2.155" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" - -[[package]] -name = "libloading" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e310b3a6b5907f99202fcdb4960ff45b93735d7c7d96b760fcff8db2dc0e103d" -dependencies = [ - "cfg-if", - "windows-targets 0.52.6", -] - -[[package]] -name = "litrs" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4ce301924b7887e9d637144fdade93f9dfff9b60981d4ac161db09720d39aa5" - -[[package]] -name = "lock_api" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" -dependencies = [ - "autocfg", - "scopeguard", -] - -[[package]] -name = "log" -version = "0.4.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" - -[[package]] -name = "memchr" -version = "2.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" - -[[package]] -name = "miniz_oxide" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" -dependencies = [ - "adler", -] - -[[package]] -name = "napi" -version = "3.0.0-alpha.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ec04344cc540f5897e97c9821ab99e7eb276b4dca6f3e6e441dfa72e5bcde70" -dependencies = [ - "bitflags 2.6.0", - "ctor", - "napi-build", - "napi-sys", - "once_cell", - "serde", - "serde_json", -] - -[[package]] -name = "napi-build" -version = "2.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1c0f5d67ee408a4685b61f5ab7e58605c8ae3f2b4189f0127d804ff13d5560a" - -[[package]] -name = "napi-derive" -version = "3.0.0-alpha.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c6240c4ddca592cde608bbfa26e2af397c3596e413a0c65c9bbcb65c2f1e485" -dependencies = [ - "cfg-if", - "convert_case", - "napi-derive-backend", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "napi-derive-backend" -version = "2.0.0-alpha.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b32dcc50065508fe2f387076c17adbdf10e038d1c080d48b10196813d94ac6a8" -dependencies = [ - "convert_case", - "once_cell", - "proc-macro2", - "quote", - "regex", - "semver", - "syn", -] - -[[package]] -name = "napi-sys" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "427802e8ec3a734331fec1035594a210ce1ff4dc5bc1950530920ab717964ea3" -dependencies = [ - "libloading", -] - -[[package]] -name = "nibble_vec" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" -dependencies = [ - "smallvec", -] - -[[package]] -name = "normalize-path" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5438dd2b2ff4c6df6e1ce22d825ed2fa93ee2922235cc45186991717f0a892d" - -[[package]] -name = "num-conv" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" - -[[package]] -name = "num-traits" -version = "0.2.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" -dependencies = [ - "autocfg", -] - -[[package]] -name = "once_cell" -version = "1.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" - -[[package]] -name = "oorandom" -version = "11.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b410bbe7e14ab526a0e86877eb47c6996a2bd7746f027ba551028c925390e4e9" - -[[package]] -name = "oxc_napi_resolver" -version = "0.0.0" -dependencies = [ - "napi", - "napi-build", - "napi-derive", - "oxc_resolver", - "tracing-subscriber", -] - -[[package]] -name = "oxc_resolver" -version = "1.11.0" -dependencies = [ - "cfg-if", - "criterion2", - "dashmap", - "document-features", - "dunce", - "indexmap 2.4.0", - "json-strip-comments", - "normalize-path", - "once_cell", - "pnp", - "rayon", - "rustc-hash", - "serde", - "serde_json", - "simdutf8", - "thiserror", - "tracing", - "vfs", -] - -[[package]] -name = "parking_lot_core" -version = "0.9.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall 0.5.2", - "smallvec", - "windows-targets 0.52.6", -] - -[[package]] -name = "path-slash" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e91099d4268b0e11973f036e885d652fb0b21fedcf69738c627f94db6a44f42" - -[[package]] -name = "pathdiff" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8835116a5c179084a830efb3adc117ab007512b535bc1a21c991d3b32a6b44dd" - -[[package]] -name = "pin-project-lite" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" - -[[package]] -name = "pnp" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46770cee76a618023fea15411d0449dd066dc232cc17e4562f154da215f27af7" -dependencies = [ - "arca", - "byteorder", - "concurrent_lru", - "fancy-regex", - "lazy_static", - "miniz_oxide", - "pathdiff", - "regex", - "serde", - "serde_json", - "serde_with", - "thiserror", -] - -[[package]] -name = "powerfmt" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" - -[[package]] -name = "proc-macro2" -version = "1.0.86" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.36" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "radix_trie" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" -dependencies = [ - "endian-type", - "nibble_vec", -] - -[[package]] -name = "rayon" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" -dependencies = [ - "either", - "rayon-core", -] - -[[package]] -name = "rayon-core" -version = "1.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" -dependencies = [ - "crossbeam-deque", - "crossbeam-utils", -] - -[[package]] -name = "redox_syscall" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" -dependencies = [ - "bitflags 1.3.2", -] - -[[package]] -name = "redox_syscall" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c82cf8cff14456045f55ec4241383baeff27af886adb72ffb2162f99911de0fd" -dependencies = [ - "bitflags 2.6.0", -] - -[[package]] -name = "regex" -version = "1.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b91213439dad192326a0d7c6ee3955910425f441d7038e0d6933b0aec5c4517f" -dependencies = [ - "aho-corasick", - "memchr", - "regex-automata", - "regex-syntax", -] - -[[package]] -name = "regex-automata" -version = "0.4.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", -] - -[[package]] -name = "regex-syntax" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" - -[[package]] -name = "rustc-hash" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" - -[[package]] -name = "ryu" -version = "1.0.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" - -[[package]] -name = "same-file" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "scopeguard" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" - -[[package]] -name = "semver" -version = "1.0.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" - -[[package]] -name = "serde" -version = "1.0.209" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99fce0ffe7310761ca6bf9faf5115afbc19688edd00171d81b1bb1b116c63e09" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.209" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5831b979fd7b5439637af1752d535ff49f4860c0f341d1baeb6faf0f4242170" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "serde_json" -version = "1.0.127" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8043c06d9f82bd7271361ed64f415fe5e12a77fdb52e573e7f06a516dea329ad" -dependencies = [ - "indexmap 2.4.0", - "itoa", - "memchr", - "ryu", - "serde", -] - -[[package]] -name = "serde_with" -version = "3.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e73139bc5ec2d45e6c5fd85be5a46949c1c39a4c18e56915f5eb4c12f975e377" -dependencies = [ - "base64", - "chrono", - "hex", - "indexmap 1.9.3", - "indexmap 2.4.0", - "serde", - "serde_derive", - "serde_json", - "serde_with_macros", - "time", -] - -[[package]] -name = "serde_with_macros" -version = "3.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b80d3d6b56b64335c0180e5ffde23b3c5e08c14c585b51a15bd0e95393f46703" -dependencies = [ - "darling", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "sharded-slab" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" -dependencies = [ - "lazy_static", -] - -[[package]] -name = "simdutf8" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f27f6278552951f1f2b8cf9da965d10969b2efdea95a6ec47987ab46edfe263a" - -[[package]] -name = "smallvec" -version = "1.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" - -[[package]] -name = "strsim" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" - -[[package]] -name = "syn" -version = "2.0.70" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f0209b68b3613b093e0ec905354eccaedcfe83b8cb37cbdeae64026c3064c16" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "thiserror" -version = "1.0.63" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.63" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "thread_local" -version = "1.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" -dependencies = [ - "cfg-if", - "once_cell", -] - -[[package]] -name = "time" -version = "0.3.36" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" -dependencies = [ - "deranged", - "itoa", - "num-conv", - "powerfmt", - "serde", - "time-core", - "time-macros", -] - -[[package]] -name = "time-core" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" - -[[package]] -name = "time-macros" -version = "0.2.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" -dependencies = [ - "num-conv", - "time-core", -] - -[[package]] -name = "tracing" -version = "0.1.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" -dependencies = [ - "pin-project-lite", - "tracing-attributes", - "tracing-core", -] - -[[package]] -name = "tracing-attributes" -version = "0.1.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "tracing-core" -version = "0.1.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" -dependencies = [ - "once_cell", -] - -[[package]] -name = "tracing-subscriber" -version = "0.3.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" -dependencies = [ - "sharded-slab", - "thread_local", - "tracing-core", -] - -[[package]] -name = "unicode-ident" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" - -[[package]] -name = "unicode-segmentation" -version = "1.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" - -[[package]] -name = "vfs" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "654cd097e182a71dbf899178e6b5662c2157dd0b8afd5975de18008f6fc173d1" -dependencies = [ - "filetime", -] - -[[package]] -name = "walkdir" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" -dependencies = [ - "same-file", - "winapi-util", -] - -[[package]] -name = "wasm-bindgen" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" -dependencies = [ - "cfg-if", - "wasm-bindgen-macro", -] - -[[package]] -name = "wasm-bindgen-backend" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" -dependencies = [ - "bumpalo", - "log", - "once_cell", - "proc-macro2", - "quote", - "syn", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-macro" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" -dependencies = [ - "quote", - "wasm-bindgen-macro-support", -] - -[[package]] -name = "wasm-bindgen-macro-support" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" -dependencies = [ - "proc-macro2", - "quote", - "syn", - "wasm-bindgen-backend", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-shared" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" - -[[package]] -name = "winapi-util" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b" -dependencies = [ - "windows-sys 0.52.0", -] - -[[package]] -name = "windows-core" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" -dependencies = [ - "windows-targets 0.52.6", -] - -[[package]] -name = "windows-sys" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" -dependencies = [ - "windows-targets 0.48.5", -] - -[[package]] -name = "windows-sys" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" -dependencies = [ - "windows-targets 0.52.6", -] - -[[package]] -name = "windows-targets" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" -dependencies = [ - "windows_aarch64_gnullvm 0.48.5", - "windows_aarch64_msvc 0.48.5", - "windows_i686_gnu 0.48.5", - "windows_i686_msvc 0.48.5", - "windows_x86_64_gnu 0.48.5", - "windows_x86_64_gnullvm 0.48.5", - "windows_x86_64_msvc 0.48.5", -] - -[[package]] -name = "windows-targets" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" -dependencies = [ - "windows_aarch64_gnullvm 0.52.6", - "windows_aarch64_msvc 0.52.6", - "windows_i686_gnu 0.52.6", - "windows_i686_gnullvm", - "windows_i686_msvc 0.52.6", - "windows_x86_64_gnu 0.52.6", - "windows_x86_64_gnullvm 0.52.6", - "windows_x86_64_msvc 0.52.6", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" - -[[package]] -name = "windows_i686_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" - -[[package]] -name = "windows_i686_gnu" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" - -[[package]] -name = "windows_i686_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" - -[[package]] -name = "windows_i686_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" - -[[package]] -name = "windows_i686_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" diff --git a/fixtures/enhanced_resolve/lib/index.js b/fixtures/enhanced_resolve/lib/index.js deleted file mode 100644 index 1e872e8f..00000000 --- a/fixtures/enhanced_resolve/lib/index.js +++ /dev/null @@ -1 +0,0 @@ -// mimic enhanced-resolved root directory structure diff --git a/fixtures/enhanced_resolve/package.json b/fixtures/enhanced_resolve/package.json deleted file mode 100644 index d1b845b5..00000000 --- a/fixtures/enhanced_resolve/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "enhanced-resolve", - "main": "lib/index.js" -} diff --git a/fixtures/enhanced_resolve/test/.gitignore b/fixtures/enhanced_resolve/test/.gitignore deleted file mode 100644 index b021b4e4..00000000 --- a/fixtures/enhanced_resolve/test/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -# created by symlink.rs -/temp -/temp_symlinks \ No newline at end of file diff --git a/fixtures/enhanced_resolve/test/fixtures/#/a.js b/fixtures/enhanced_resolve/test/fixtures/#/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/a.js b/fixtures/enhanced_resolve/test/fixtures/a.js deleted file mode 100644 index 896ffc6d..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/abc.txt b/fixtures/enhanced_resolve/test/fixtures/abc.txt deleted file mode 100644 index f2ba8f84..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/abc.txt +++ /dev/null @@ -1 +0,0 @@ -abc \ No newline at end of file diff --git a/fixtures/enhanced_resolve/test/fixtures/alias/files/a.js b/fixtures/enhanced_resolve/test/fixtures/alias/files/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/b.js b/fixtures/enhanced_resolve/test/fixtures/b.js deleted file mode 100644 index 11476340..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/b.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function b() { - return "This is b"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/browser/module-a.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/browser/module-a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/browser.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/ignore.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/ignore.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/replaced.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/replaced.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/self.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/self.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/toString.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/toString.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-a.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-b.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-c.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-c.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/a.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/b.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/c.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/c.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/d.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/d.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json deleted file mode 100644 index c13fe23b..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "browser": { - "a.js": "./a", - "./b.js": "./b", - "c.js": "./d.js", - "./d.js": "./c.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/package.json b/fixtures/enhanced_resolve/test/fixtures/browser-module/package.json deleted file mode 100644 index 19ff7739..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/browser-module/package.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "exports": { - "./lib/index.js": "./lib/index.js" - }, - "browser": { - "./lib/ignore.js": false, - "./lib/replaced.js": "./lib/browser", - "module-a": "./browser/module-a.js", - "module-b": "module-c", - "module-c": "module-c", - "./toString": "./lib/toString.js", - "./lib/main.js": "./lib/main.js", - "./main.js": "./lib/main.js", - "./lib/xyz.js": "./xyz.js", - "./xyz.js": "./lib/xyz.js", - "./lib/non-existent.js": "./lib/non-existent.js", - ".": false, - "./number": 1, - "./foo": "./lib/replaced.js?query" - }, - "innerBrowser1": { - "field": { - "browser": { - "./lib/main1.js": "./lib/main.js" - } - } - }, - "innerBrowser2": { - "browser": { - "./lib/main2.js": "./lib/replaced.js" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/builtins/package.json b/fixtures/enhanced_resolve/test/fixtures/builtins/package.json deleted file mode 100644 index 4a54ea96..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/builtins/package.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "name": "builtins", - "private": true, - "imports": { - "#fs": { - "default": "fs" - }, - "#http": { - "node": "node:http" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/c.js b/fixtures/enhanced_resolve/test/fixtures/c.js deleted file mode 100644 index e3aca8aa..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/c.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = function b() { - require("./a"); - return "This is c"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/complex.js b/fixtures/enhanced_resolve/test/fixtures/complex.js deleted file mode 100644 index 1f62db84..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/complex.js +++ /dev/null @@ -1,13 +0,0 @@ -var 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); diff --git a/fixtures/enhanced_resolve/test/fixtures/crypto-js/index.js b/fixtures/enhanced_resolve/test/fixtures/crypto-js/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json b/fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json deleted file mode 100644 index 1d31aa8b..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "crypto-js", - "main": "index.js", - "browser": { - "crypto": false - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/decorated-fs/exists.js b/fixtures/enhanced_resolve/test/fixtures/decorated-fs/exists.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/dirOrFile.js b/fixtures/enhanced_resolve/test/fixtures/dirOrFile.js deleted file mode 100644 index c3cb885f..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/dirOrFile.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "file"; diff --git a/fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js b/fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js deleted file mode 100644 index 85e01cd4..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "dir"; diff --git a/fixtures/enhanced_resolve/test/fixtures/directory-default/directory-default.js b/fixtures/enhanced_resolve/test/fixtures/directory-default/directory-default.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js deleted file mode 100644 index d1007aae..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js +++ /dev/null @@ -1 +0,0 @@ -export default "string"; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts deleted file mode 100644 index cb0ff5c3..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json deleted file mode 100644 index b523a1e9..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "@org/pkg", - "exports": { - "./*.js": { - "types": "./dist/*.d.ts", - "default": "./dist/*.js" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js deleted file mode 100644 index d1007aae..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js +++ /dev/null @@ -1 +0,0 @@ -export default "string"; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts deleted file mode 100644 index cb0ff5c3..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json deleted file mode 100644 index 8e55fb46..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "@raviqqe/hidash", - "exports": { - "./*.js": { - "types": "./dist/*.d.ts", - "default": "./dist/*.js" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json deleted file mode 100644 index f0edf449..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "exports-field", - "version": "1.0.0", - "exports": { - ".": "./a/../b/../../pack1/index.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/pack1/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/pack1/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/a.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/a.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json deleted file mode 100644 index 6b105c08..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "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/": { - "webpack": ["./lib/lib2/", "./lib/"], - "node": "./lib/", - "default": "./lib/" - }, - "./dist/a.js": "./../../a.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json deleted file mode 100644 index 0012a3de..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "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" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/umd.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/umd.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field/package.json deleted file mode 100644 index 5fa72bb5..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "@exports-field/core", - "version": "1.0.0", - "exports": "./a.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json deleted file mode 100644 index e6f12074..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "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/lib2/", "./lib/"], - "node": "./lib/", - "default": "./lib/" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/index b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/index deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json deleted file mode 100644 index 1a838f49..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "name": "exports-field", - "exportsField": { - "exports": "./main.js" - }, - "ex": "./index", - "broken": { - ".": "./src" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/src/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/src/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.ts b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.mts b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.mts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mjs b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mjs deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mts.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mts.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.ts b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/app.module.js b/fixtures/enhanced_resolve/test/fixtures/extensions/app.module.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.js b/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/foo.js b/fixtures/enhanced_resolve/test/fixtures/extensions/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/foo.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/foo.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/index.js b/fixtures/enhanced_resolve/test/fixtures/extensions/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/index.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module.js b/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module/index.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/package.json b/fixtures/enhanced_resolve/test/fixtures/extensions/package.json deleted file mode 100644 index 5e55a1e8..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/extensions/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "./index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/file.load1 b/fixtures/enhanced_resolve/test/fixtures/file.load1 deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/file.load2 b/fixtures/enhanced_resolve/test/fixtures/file.load2 deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/foo/index.js b/fixtures/enhanced_resolve/test/fixtures/foo/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/foo/package.json b/fixtures/enhanced_resolve/test/fixtures/foo/package.json deleted file mode 100644 index da86787a..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/foo/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "foo", - "version": "1.0.0" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json deleted file mode 100644 index aa2be496..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "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" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/internal/file.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/internal/file.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/y/y.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/y/y.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/internal/i.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/internal/i.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/nested/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js deleted file mode 100644 index e5b70a86..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = { nested: "nested" } diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-3/nested/f/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-3/nested/f/nested/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-4/f/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-4/f/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f$/$.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f$/$.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f/$.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f/$.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/nested/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/a.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/a.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/b.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/dir/b.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/dir/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/index.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json deleted file mode 100644 index 8d8d3a46..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "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/lib2/", "./lib/"], - "node": "./lib/", - "default": "./lib/" - }, - "./dist/a.js": "./../../a.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/c/index.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/c/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/imports-field/package.json deleted file mode 100644 index 248351a9..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "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" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/a.js b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json deleted file mode 100644 index ded7faa2..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json +++ /dev/null @@ -1,2 +0,0 @@ -{ - "main": "./a.js", diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/a.js b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/package.json b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/package.json deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/issue-238/package.json b/fixtures/enhanced_resolve/test/fixtures/issue-238/package.json deleted file mode 100644 index 352055cd..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/issue-238/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "private": true -} diff --git a/fixtures/enhanced_resolve/test/fixtures/issue-238/src/a/config.js b/fixtures/enhanced_resolve/test/fixtures/issue-238/src/a/config.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/issue-238/src/common/config/myObjectFile.js b/fixtures/enhanced_resolve/test/fixtures/issue-238/src/common/config/myObjectFile.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/lib.js b/fixtures/enhanced_resolve/test/fixtures/lib.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/lib/complex1.js b/fixtures/enhanced_resolve/test/fixtures/lib/complex1.js deleted file mode 100644 index b3de3d70..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/lib/complex1.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "lib complex1"; diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self/index.js b/fixtures/enhanced_resolve/test/fixtures/main-field-self/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json b/fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json deleted file mode 100644 index a2b6f341..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "./" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self2/index.js b/fixtures/enhanced_resolve/test/fixtures/main-field-self2/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json b/fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json deleted file mode 100644 index 4fa6f730..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "." -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main1.js b/fixtures/enhanced_resolve/test/fixtures/main1.js deleted file mode 100644 index 168f2a1e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main1.js +++ /dev/null @@ -1,9 +0,0 @@ -var a = require("./a"); -if (x) { - for (var i = 0; i < 100; i++) { - while (true) require("./b"); - do { - i++; - } while (require("m1/a")()); - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main2.js b/fixtures/enhanced_resolve/test/fixtures/main2.js deleted file mode 100644 index 39f062b1..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main2.js +++ /dev/null @@ -1,12 +0,0 @@ -var 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"); - }); - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main3.js b/fixtures/enhanced_resolve/test/fixtures/main3.js deleted file mode 100644 index 1c180166..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main3.js +++ /dev/null @@ -1,4 +0,0 @@ -var a = require("./a"); -require.ensure([], function(require) { - require("./c.js"); -}); diff --git a/fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js b/fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js deleted file mode 100644 index 997c1051..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is nested m1/a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/no#fragment/#/#.js b/fixtures/enhanced_resolve/test/fixtures/no#fragment/#/#.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/no.js b/fixtures/enhanced_resolve/test/fixtures/no.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/browser.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/browser.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/main.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json deleted file mode 100644 index c469e1fd..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "main": "./main.js", - "browser": "./browser.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js deleted file mode 100644 index 549620a5..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "the correct a.js"; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js deleted file mode 100644 index 5db6632e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = " :) " + require("m2/b.js"); diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js deleted file mode 100644 index d308569d..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require("m1/a") + require("m1"); diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js deleted file mode 100644 index cb8127e8..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "Step2"; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json deleted file mode 100644 index 8d6dfa56..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "dash-name", - "exports": "./index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json deleted file mode 100644 index 4fd8706e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "dash", - "exports": "./index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/invalidPackageJson/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/invalidPackageJson/package.json deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js deleted file mode 100644 index 46fc8e6c..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is m1/a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js deleted file mode 100644 index 8565c244..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is m1/b"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js deleted file mode 100644 index 34faaaf5..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "This is m2/b"; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/file.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/file.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js b/fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js deleted file mode 100644 index 997c1051..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is nested m1/a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/dir/index.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/dir/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/index.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/main.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/browser.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/browser.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/index.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json deleted file mode 100644 index e20ceaeb..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "main": "main.js", - "browser": { - "./package-alias/index.js": "./package-alias/browser.js", - "module": "pkg/dir/index" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/typescript/index.ts b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/typescript/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json deleted file mode 100644 index 4a1f838e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "@exports-field/core", - "version": "1.0.0", - "exports": { - ".": "./a.js", - "./x": "./a.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/prefer-pnp/alternative-modules/m1/b.js b/fixtures/enhanced_resolve/test/fixtures/prefer-pnp/alternative-modules/m1/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.css b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.css deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.js b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json deleted file mode 100644 index 14ab704d..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/index.css b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/index.css deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/module.js b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/module.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json deleted file mode 100644 index ee0eb71b..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "main": "../../../c.js", - "module": "module.js", - "style": "index.css" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/roots_fall_through/index.js b/fixtures/enhanced_resolve/test/fixtures/roots_fall_through/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/main.js b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json deleted file mode 100644 index 70a0f20f..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "browser": { - "./index.js": "./main.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/lib/index.js b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/lib/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/main.js b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json deleted file mode 100644 index 2af9e0d1..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "./main.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/shortcutdir.js/a.js b/fixtures/enhanced_resolve/test/fixtures/shortcutdir.js/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/b b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/b deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/c b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/c deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/a b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/a deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/b b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/b deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/b/foo/a b/fixtures/enhanced_resolve/test/fixtures/yield/b/foo/a deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/a b/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/a deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json b/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json deleted file mode 100644 index 0acc4b4c..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "foo", - "version": "1.0.0", - "browser": { - "./a": false - } -} diff --git "a/fixtures/enhanced_resolve/test/fixtures/\346\265\213\350\257\225.js" "b/fixtures/enhanced_resolve/test/fixtures/\346\265\213\350\257\225.js" deleted file mode 100644 index e69de29b..00000000 diff --git "a/fixtures/misc/\344\270\255\346\226\207/\344\270\255\346\226\207.js" "b/fixtures/misc/\344\270\255\346\226\207/\344\270\255\346\226\207.js" deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/pnp/.gitignore b/fixtures/pnp/.gitignore deleted file mode 100644 index 1783c71a..00000000 --- a/fixtures/pnp/.gitignore +++ /dev/null @@ -1 +0,0 @@ -install_state.gz \ No newline at end of file diff --git a/fixtures/pnp/.pnp.cjs b/fixtures/pnp/.pnp.cjs deleted file mode 100755 index 2a8d1771..00000000 --- a/fixtures/pnp/.pnp.cjs +++ /dev/null @@ -1,7543 +0,0 @@ -#!/usr/bin/env node -/* eslint-disable */ -// @ts-nocheck -"use strict"; - -const RAW_RUNTIME_STATE = -'{\ - "__info": [\ - "This file is automatically generated. Do not touch it, or risk",\ - "your modifications being lost."\ - ],\ - "dependencyTreeRoots": [\ - {\ - "name": "pnp",\ - "reference": "workspace:."\ - }\ - ],\ - "enableTopLevelFallback": true,\ - "ignorePatternData": "(^(?:\\\\.yarn\\\\/sdks(?:\\\\/(?!\\\\.{1,2}(?:\\\\/|$))(?:(?:(?!(?:^|\\\\/)\\\\.{1,2}(?:\\\\/|$)).)*?)|$))$)",\ - "fallbackExclusionList": [\ - ["pnp", ["workspace:."]]\ - ],\ - "fallbackPool": [\ - ],\ - "packageRegistryData": [\ - [null, [\ - [null, {\ - "packageLocation": "./",\ - "packageDependencies": [\ - ["is-even", "npm:1.0.0"],\ - ["is-odd", "npm:3.0.1"]\ - ],\ - "linkType": "SOFT"\ - }]\ - ]],\ - ["is-buffer", [\ - ["npm:1.1.6", {\ - "packageLocation": "./.yarn/cache/is-buffer-npm-1.1.6-08199d9ccc-ae18aa0b6e.zip/node_modules/is-buffer/",\ - "packageDependencies": [\ - ["is-buffer", "npm:1.1.6"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["is-even", [\ - ["npm:1.0.0", {\ - "packageLocation": "./.yarn/cache/is-even-npm-1.0.0-9f726520dc-2728cc2f39.zip/node_modules/is-even/",\ - "packageDependencies": [\ - ["is-even", "npm:1.0.0"],\ - ["is-odd", "npm:0.1.2"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["is-number", [\ - ["npm:3.0.0", {\ - "packageLocation": "./.yarn/cache/is-number-npm-3.0.0-9088035ade-e639c54640.zip/node_modules/is-number/",\ - "packageDependencies": [\ - ["is-number", "npm:3.0.0"],\ - ["kind-of", "npm:3.2.2"]\ - ],\ - "linkType": "HARD"\ - }],\ - ["npm:6.0.0", {\ - "packageLocation": "./.yarn/cache/is-number-npm-6.0.0-30881e83e6-5da4c68401.zip/node_modules/is-number/",\ - "packageDependencies": [\ - ["is-number", "npm:6.0.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["is-odd", [\ - ["npm:0.1.2", {\ - "packageLocation": "./.yarn/cache/is-odd-npm-0.1.2-9d980a9da8-7dc6c6fd00.zip/node_modules/is-odd/",\ - "packageDependencies": [\ - ["is-odd", "npm:0.1.2"],\ - ["is-number", "npm:3.0.0"]\ - ],\ - "linkType": "HARD"\ - }],\ - ["npm:3.0.1", {\ - "packageLocation": "./.yarn/cache/is-odd-npm-3.0.1-93c3c3f41b-89ee2e353c.zip/node_modules/is-odd/",\ - "packageDependencies": [\ - ["is-odd", "npm:3.0.1"],\ - ["is-number", "npm:6.0.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["kind-of", [\ - ["npm:3.2.2", {\ - "packageLocation": "./.yarn/cache/kind-of-npm-3.2.2-7deaffa5f9-7e34bc29d4.zip/node_modules/kind-of/",\ - "packageDependencies": [\ - ["kind-of", "npm:3.2.2"],\ - ["is-buffer", "npm:1.1.6"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["pnp", [\ - ["workspace:.", {\ - "packageLocation": "./",\ - "packageDependencies": [\ - ["pnp", "workspace:."],\ - ["is-even", "npm:1.0.0"],\ - ["is-odd", "npm:3.0.1"]\ - ],\ - "linkType": "SOFT"\ - }]\ - ]]\ - ]\ -}'; - -function $$SETUP_STATE(hydrateRuntimeState, basePath) { - return hydrateRuntimeState(JSON.parse(RAW_RUNTIME_STATE), {basePath: basePath || __dirname}); -} - -const fs = require('fs'); -const path = require('path'); -const crypto = require('crypto'); -const os = require('os'); -const events = require('events'); -const nodeUtils = require('util'); -const stream = require('stream'); -const zlib = require('zlib'); -const require$$0 = require('module'); -const StringDecoder = require('string_decoder'); -const url = require('url'); -const buffer = require('buffer'); -const readline = require('readline'); -const assert = require('assert'); - -const _interopDefaultLegacy = e => e && typeof e === 'object' && 'default' in e ? e : { default: e }; - -function _interopNamespace(e) { - if (e && e.__esModule) return e; - const n = Object.create(null); - if (e) { - for (const k in e) { - if (k !== 'default') { - const d = Object.getOwnPropertyDescriptor(e, k); - Object.defineProperty(n, k, d.get ? d : { - enumerable: true, - get: () => e[k] - }); - } - } - } - n.default = e; - return Object.freeze(n); -} - -const fs__default = /*#__PURE__*/_interopDefaultLegacy(fs); -const path__default = /*#__PURE__*/_interopDefaultLegacy(path); -const nodeUtils__namespace = /*#__PURE__*/_interopNamespace(nodeUtils); -const zlib__default = /*#__PURE__*/_interopDefaultLegacy(zlib); -const require$$0__default = /*#__PURE__*/_interopDefaultLegacy(require$$0); -const StringDecoder__default = /*#__PURE__*/_interopDefaultLegacy(StringDecoder); -const buffer__default = /*#__PURE__*/_interopDefaultLegacy(buffer); -const assert__default = /*#__PURE__*/_interopDefaultLegacy(assert); - -const S_IFMT = 61440; -const S_IFDIR = 16384; -const S_IFREG = 32768; -const S_IFLNK = 40960; -const SAFE_TIME = 456789e3; - -function makeError$1(code, message) { - return Object.assign(new Error(`${code}: ${message}`), { code }); -} -function EBUSY(message) { - return makeError$1(`EBUSY`, message); -} -function ENOSYS(message, reason) { - return makeError$1(`ENOSYS`, `${message}, ${reason}`); -} -function EINVAL(reason) { - return makeError$1(`EINVAL`, `invalid argument, ${reason}`); -} -function EBADF(reason) { - return makeError$1(`EBADF`, `bad file descriptor, ${reason}`); -} -function ENOENT(reason) { - return makeError$1(`ENOENT`, `no such file or directory, ${reason}`); -} -function ENOTDIR(reason) { - return makeError$1(`ENOTDIR`, `not a directory, ${reason}`); -} -function EISDIR(reason) { - return makeError$1(`EISDIR`, `illegal operation on a directory, ${reason}`); -} -function EEXIST(reason) { - return makeError$1(`EEXIST`, `file already exists, ${reason}`); -} -function EROFS(reason) { - return makeError$1(`EROFS`, `read-only filesystem, ${reason}`); -} -function ENOTEMPTY(reason) { - return makeError$1(`ENOTEMPTY`, `directory not empty, ${reason}`); -} -function EOPNOTSUPP(reason) { - return makeError$1(`EOPNOTSUPP`, `operation not supported, ${reason}`); -} -function ERR_DIR_CLOSED() { - return makeError$1(`ERR_DIR_CLOSED`, `Directory handle was closed`); -} - -const DEFAULT_MODE = S_IFREG | 420; -class StatEntry { - constructor() { - this.uid = 0; - this.gid = 0; - this.size = 0; - this.blksize = 0; - this.atimeMs = 0; - this.mtimeMs = 0; - this.ctimeMs = 0; - this.birthtimeMs = 0; - this.atime = new Date(0); - this.mtime = new Date(0); - this.ctime = new Date(0); - this.birthtime = new Date(0); - this.dev = 0; - this.ino = 0; - this.mode = DEFAULT_MODE; - this.nlink = 1; - this.rdev = 0; - this.blocks = 1; - } - isBlockDevice() { - return false; - } - isCharacterDevice() { - return false; - } - isDirectory() { - return (this.mode & S_IFMT) === S_IFDIR; - } - isFIFO() { - return false; - } - isFile() { - return (this.mode & S_IFMT) === S_IFREG; - } - isSocket() { - return false; - } - isSymbolicLink() { - return (this.mode & S_IFMT) === S_IFLNK; - } -} -class BigIntStatsEntry { - constructor() { - this.uid = BigInt(0); - this.gid = BigInt(0); - this.size = BigInt(0); - this.blksize = BigInt(0); - this.atimeMs = BigInt(0); - this.mtimeMs = BigInt(0); - this.ctimeMs = BigInt(0); - this.birthtimeMs = BigInt(0); - this.atimeNs = BigInt(0); - this.mtimeNs = BigInt(0); - this.ctimeNs = BigInt(0); - this.birthtimeNs = BigInt(0); - this.atime = new Date(0); - this.mtime = new Date(0); - this.ctime = new Date(0); - this.birthtime = new Date(0); - this.dev = BigInt(0); - this.ino = BigInt(0); - this.mode = BigInt(DEFAULT_MODE); - this.nlink = BigInt(1); - this.rdev = BigInt(0); - this.blocks = BigInt(1); - } - isBlockDevice() { - return false; - } - isCharacterDevice() { - return false; - } - isDirectory() { - return (this.mode & BigInt(S_IFMT)) === BigInt(S_IFDIR); - } - isFIFO() { - return false; - } - isFile() { - return (this.mode & BigInt(S_IFMT)) === BigInt(S_IFREG); - } - isSocket() { - return false; - } - isSymbolicLink() { - return (this.mode & BigInt(S_IFMT)) === BigInt(S_IFLNK); - } -} -function makeDefaultStats() { - return new StatEntry(); -} -function clearStats(stats) { - for (const key in stats) { - if (Object.hasOwn(stats, key)) { - const element = stats[key]; - if (typeof element === `number`) { - stats[key] = 0; - } else if (typeof element === `bigint`) { - stats[key] = BigInt(0); - } else if (nodeUtils__namespace.types.isDate(element)) { - stats[key] = new Date(0); - } - } - } - return stats; -} -function convertToBigIntStats(stats) { - const bigintStats = new BigIntStatsEntry(); - for (const key in stats) { - if (Object.hasOwn(stats, key)) { - const element = stats[key]; - if (typeof element === `number`) { - bigintStats[key] = BigInt(element); - } else if (nodeUtils__namespace.types.isDate(element)) { - bigintStats[key] = new Date(element); - } - } - } - bigintStats.atimeNs = bigintStats.atimeMs * BigInt(1e6); - bigintStats.mtimeNs = bigintStats.mtimeMs * BigInt(1e6); - bigintStats.ctimeNs = bigintStats.ctimeMs * BigInt(1e6); - bigintStats.birthtimeNs = bigintStats.birthtimeMs * BigInt(1e6); - return bigintStats; -} -function areStatsEqual(a, b) { - if (a.atimeMs !== b.atimeMs) - return false; - if (a.birthtimeMs !== b.birthtimeMs) - return false; - if (a.blksize !== b.blksize) - return false; - if (a.blocks !== b.blocks) - return false; - if (a.ctimeMs !== b.ctimeMs) - return false; - if (a.dev !== b.dev) - return false; - if (a.gid !== b.gid) - return false; - if (a.ino !== b.ino) - return false; - if (a.isBlockDevice() !== b.isBlockDevice()) - return false; - if (a.isCharacterDevice() !== b.isCharacterDevice()) - return false; - if (a.isDirectory() !== b.isDirectory()) - return false; - if (a.isFIFO() !== b.isFIFO()) - return false; - if (a.isFile() !== b.isFile()) - return false; - if (a.isSocket() !== b.isSocket()) - return false; - if (a.isSymbolicLink() !== b.isSymbolicLink()) - return false; - if (a.mode !== b.mode) - return false; - if (a.mtimeMs !== b.mtimeMs) - return false; - if (a.nlink !== b.nlink) - return false; - if (a.rdev !== b.rdev) - return false; - if (a.size !== b.size) - return false; - if (a.uid !== b.uid) - return false; - const aN = a; - const bN = b; - if (aN.atimeNs !== bN.atimeNs) - return false; - if (aN.mtimeNs !== bN.mtimeNs) - return false; - if (aN.ctimeNs !== bN.ctimeNs) - return false; - if (aN.birthtimeNs !== bN.birthtimeNs) - return false; - return true; -} - -const PortablePath = { - root: `/`, - dot: `.`, - parent: `..` -}; -const Filename = { - home: `~`, - nodeModules: `node_modules`, - manifest: `package.json`, - lockfile: `yarn.lock`, - virtual: `__virtual__`, - pnpJs: `.pnp.js`, - pnpCjs: `.pnp.cjs`, - pnpData: `.pnp.data.json`, - pnpEsmLoader: `.pnp.loader.mjs`, - rc: `.yarnrc.yml`, - env: `.env` -}; -const npath = Object.create(path__default.default); -const ppath = Object.create(path__default.default.posix); -npath.cwd = () => process.cwd(); -ppath.cwd = process.platform === `win32` ? () => toPortablePath(process.cwd()) : process.cwd; -if (process.platform === `win32`) { - ppath.resolve = (...segments) => { - if (segments.length > 0 && ppath.isAbsolute(segments[0])) { - return path__default.default.posix.resolve(...segments); - } else { - return path__default.default.posix.resolve(ppath.cwd(), ...segments); - } - }; -} -const contains = function(pathUtils, from, to) { - from = pathUtils.normalize(from); - to = pathUtils.normalize(to); - if (from === to) - return `.`; - if (!from.endsWith(pathUtils.sep)) - from = from + pathUtils.sep; - if (to.startsWith(from)) { - return to.slice(from.length); - } else { - return null; - } -}; -npath.contains = (from, to) => contains(npath, from, to); -ppath.contains = (from, to) => contains(ppath, from, to); -const WINDOWS_PATH_REGEXP = /^([a-zA-Z]:.*)$/; -const UNC_WINDOWS_PATH_REGEXP = /^\/\/(\.\/)?(.*)$/; -const PORTABLE_PATH_REGEXP = /^\/([a-zA-Z]:.*)$/; -const UNC_PORTABLE_PATH_REGEXP = /^\/unc\/(\.dot\/)?(.*)$/; -function fromPortablePathWin32(p) { - let portablePathMatch, uncPortablePathMatch; - if (portablePathMatch = p.match(PORTABLE_PATH_REGEXP)) - p = portablePathMatch[1]; - else if (uncPortablePathMatch = p.match(UNC_PORTABLE_PATH_REGEXP)) - p = `\\\\${uncPortablePathMatch[1] ? `.\\` : ``}${uncPortablePathMatch[2]}`; - else - return p; - return p.replace(/\//g, `\\`); -} -function toPortablePathWin32(p) { - p = p.replace(/\\/g, `/`); - let windowsPathMatch, uncWindowsPathMatch; - if (windowsPathMatch = p.match(WINDOWS_PATH_REGEXP)) - p = `/${windowsPathMatch[1]}`; - else if (uncWindowsPathMatch = p.match(UNC_WINDOWS_PATH_REGEXP)) - p = `/unc/${uncWindowsPathMatch[1] ? `.dot/` : ``}${uncWindowsPathMatch[2]}`; - return p; -} -const toPortablePath = process.platform === `win32` ? toPortablePathWin32 : (p) => p; -const fromPortablePath = process.platform === `win32` ? fromPortablePathWin32 : (p) => p; -npath.fromPortablePath = fromPortablePath; -npath.toPortablePath = toPortablePath; -function convertPath(targetPathUtils, sourcePath) { - return targetPathUtils === npath ? fromPortablePath(sourcePath) : toPortablePath(sourcePath); -} - -const defaultTime = new Date(SAFE_TIME * 1e3); -const defaultTimeMs = defaultTime.getTime(); -async function copyPromise(destinationFs, destination, sourceFs, source, opts) { - const normalizedDestination = destinationFs.pathUtils.normalize(destination); - const normalizedSource = sourceFs.pathUtils.normalize(source); - const prelayout = []; - const postlayout = []; - const { atime, mtime } = opts.stableTime ? { atime: defaultTime, mtime: defaultTime } : await sourceFs.lstatPromise(normalizedSource); - await destinationFs.mkdirpPromise(destinationFs.pathUtils.dirname(destination), { utimes: [atime, mtime] }); - await copyImpl(prelayout, postlayout, destinationFs, normalizedDestination, sourceFs, normalizedSource, { ...opts, didParentExist: true }); - for (const operation of prelayout) - await operation(); - await Promise.all(postlayout.map((operation) => { - return operation(); - })); -} -async function copyImpl(prelayout, postlayout, destinationFs, destination, sourceFs, source, opts) { - const destinationStat = opts.didParentExist ? await maybeLStat(destinationFs, destination) : null; - const sourceStat = await sourceFs.lstatPromise(source); - const { atime, mtime } = opts.stableTime ? { atime: defaultTime, mtime: defaultTime } : sourceStat; - let updated; - switch (true) { - case sourceStat.isDirectory(): - { - updated = await copyFolder(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts); - } - break; - case sourceStat.isFile(): - { - updated = await copyFile(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts); - } - break; - case sourceStat.isSymbolicLink(): - { - updated = await copySymlink(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts); - } - break; - default: { - throw new Error(`Unsupported file type (${sourceStat.mode})`); - } - } - if (opts.linkStrategy?.type !== `HardlinkFromIndex` || !sourceStat.isFile()) { - if (updated || destinationStat?.mtime?.getTime() !== mtime.getTime() || destinationStat?.atime?.getTime() !== atime.getTime()) { - postlayout.push(() => destinationFs.lutimesPromise(destination, atime, mtime)); - updated = true; - } - if (destinationStat === null || (destinationStat.mode & 511) !== (sourceStat.mode & 511)) { - postlayout.push(() => destinationFs.chmodPromise(destination, sourceStat.mode & 511)); - updated = true; - } - } - return updated; -} -async function maybeLStat(baseFs, p) { - try { - return await baseFs.lstatPromise(p); - } catch (e) { - return null; - } -} -async function copyFolder(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts) { - if (destinationStat !== null && !destinationStat.isDirectory()) { - if (opts.overwrite) { - prelayout.push(async () => destinationFs.removePromise(destination)); - destinationStat = null; - } else { - return false; - } - } - let updated = false; - if (destinationStat === null) { - prelayout.push(async () => { - try { - await destinationFs.mkdirPromise(destination, { mode: sourceStat.mode }); - } catch (err) { - if (err.code !== `EEXIST`) { - throw err; - } - } - }); - updated = true; - } - const entries = await sourceFs.readdirPromise(source); - const nextOpts = opts.didParentExist && !destinationStat ? { ...opts, didParentExist: false } : opts; - if (opts.stableSort) { - for (const entry of entries.sort()) { - if (await copyImpl(prelayout, postlayout, destinationFs, destinationFs.pathUtils.join(destination, entry), sourceFs, sourceFs.pathUtils.join(source, entry), nextOpts)) { - updated = true; - } - } - } else { - const entriesUpdateStatus = await Promise.all(entries.map(async (entry) => { - await copyImpl(prelayout, postlayout, destinationFs, destinationFs.pathUtils.join(destination, entry), sourceFs, sourceFs.pathUtils.join(source, entry), nextOpts); - })); - if (entriesUpdateStatus.some((status) => status)) { - updated = true; - } - } - return updated; -} -async function copyFileViaIndex(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts, linkStrategy) { - const sourceHash = await sourceFs.checksumFilePromise(source, { algorithm: `sha1` }); - const defaultMode = 420; - const sourceMode = sourceStat.mode & 511; - const indexFileName = `${sourceHash}${sourceMode !== defaultMode ? sourceMode.toString(8) : ``}`; - const indexPath = destinationFs.pathUtils.join(linkStrategy.indexPath, sourceHash.slice(0, 2), `${indexFileName}.dat`); - let AtomicBehavior; - ((AtomicBehavior2) => { - AtomicBehavior2[AtomicBehavior2["Lock"] = 0] = "Lock"; - AtomicBehavior2[AtomicBehavior2["Rename"] = 1] = "Rename"; - })(AtomicBehavior || (AtomicBehavior = {})); - let atomicBehavior = 1 /* Rename */; - let indexStat = await maybeLStat(destinationFs, indexPath); - if (destinationStat) { - const isDestinationHardlinkedFromIndex = indexStat && destinationStat.dev === indexStat.dev && destinationStat.ino === indexStat.ino; - const isIndexModified = indexStat?.mtimeMs !== defaultTimeMs; - if (isDestinationHardlinkedFromIndex) { - if (isIndexModified && linkStrategy.autoRepair) { - atomicBehavior = 0 /* Lock */; - indexStat = null; - } - } - if (!isDestinationHardlinkedFromIndex) { - if (opts.overwrite) { - prelayout.push(async () => destinationFs.removePromise(destination)); - destinationStat = null; - } else { - return false; - } - } - } - const tempPath = !indexStat && atomicBehavior === 1 /* Rename */ ? `${indexPath}.${Math.floor(Math.random() * 4294967296).toString(16).padStart(8, `0`)}` : null; - let tempPathCleaned = false; - prelayout.push(async () => { - if (!indexStat) { - if (atomicBehavior === 0 /* Lock */) { - await destinationFs.lockPromise(indexPath, async () => { - const content = await sourceFs.readFilePromise(source); - await destinationFs.writeFilePromise(indexPath, content); - }); - } - if (atomicBehavior === 1 /* Rename */ && tempPath) { - const content = await sourceFs.readFilePromise(source); - await destinationFs.writeFilePromise(tempPath, content); - try { - await destinationFs.linkPromise(tempPath, indexPath); - } catch (err) { - if (err.code === `EEXIST`) { - tempPathCleaned = true; - await destinationFs.unlinkPromise(tempPath); - } else { - throw err; - } - } - } - } - if (!destinationStat) { - await destinationFs.linkPromise(indexPath, destination); - } - }); - postlayout.push(async () => { - if (!indexStat) { - await destinationFs.lutimesPromise(indexPath, defaultTime, defaultTime); - if (sourceMode !== defaultMode) { - await destinationFs.chmodPromise(indexPath, sourceMode); - } - } - if (tempPath && !tempPathCleaned) { - await destinationFs.unlinkPromise(tempPath); - } - }); - return false; -} -async function copyFileDirect(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts) { - if (destinationStat !== null) { - if (opts.overwrite) { - prelayout.push(async () => destinationFs.removePromise(destination)); - destinationStat = null; - } else { - return false; - } - } - prelayout.push(async () => { - const content = await sourceFs.readFilePromise(source); - await destinationFs.writeFilePromise(destination, content); - }); - return true; -} -async function copyFile(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts) { - if (opts.linkStrategy?.type === `HardlinkFromIndex`) { - return copyFileViaIndex(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts, opts.linkStrategy); - } else { - return copyFileDirect(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts); - } -} -async function copySymlink(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts) { - if (destinationStat !== null) { - if (opts.overwrite) { - prelayout.push(async () => destinationFs.removePromise(destination)); - destinationStat = null; - } else { - return false; - } - } - prelayout.push(async () => { - await destinationFs.symlinkPromise(convertPath(destinationFs.pathUtils, await sourceFs.readlinkPromise(source)), destination); - }); - return true; -} - -class CustomDir { - constructor(path, nextDirent, opts = {}) { - this.path = path; - this.nextDirent = nextDirent; - this.opts = opts; - this.closed = false; - } - throwIfClosed() { - if (this.closed) { - throw ERR_DIR_CLOSED(); - } - } - async *[Symbol.asyncIterator]() { - try { - let dirent; - while ((dirent = await this.read()) !== null) { - yield dirent; - } - } finally { - await this.close(); - } - } - read(cb) { - const dirent = this.readSync(); - if (typeof cb !== `undefined`) - return cb(null, dirent); - return Promise.resolve(dirent); - } - readSync() { - this.throwIfClosed(); - return this.nextDirent(); - } - close(cb) { - this.closeSync(); - if (typeof cb !== `undefined`) - return cb(null); - return Promise.resolve(); - } - closeSync() { - this.throwIfClosed(); - this.opts.onClose?.(); - this.closed = true; - } -} -function opendir(fakeFs, path, entries, opts) { - const nextDirent = () => { - const filename = entries.shift(); - if (typeof filename === `undefined`) - return null; - const entryPath = fakeFs.pathUtils.join(path, filename); - return Object.assign(fakeFs.statSync(entryPath), { - name: filename, - path: void 0 - }); - }; - return new CustomDir(path, nextDirent, opts); -} - -function assertStatus(current, expected) { - if (current !== expected) { - throw new Error(`Invalid StatWatcher status: expected '${expected}', got '${current}'`); - } -} -class CustomStatWatcher extends events.EventEmitter { - constructor(fakeFs, path, { bigint = false } = {}) { - super(); - this.status = "ready" /* Ready */; - this.changeListeners = /* @__PURE__ */ new Map(); - this.startTimeout = null; - this.fakeFs = fakeFs; - this.path = path; - this.bigint = bigint; - this.lastStats = this.stat(); - } - static create(fakeFs, path, opts) { - const statWatcher = new CustomStatWatcher(fakeFs, path, opts); - statWatcher.start(); - return statWatcher; - } - start() { - assertStatus(this.status, "ready" /* Ready */); - this.status = "running" /* Running */; - this.startTimeout = setTimeout(() => { - this.startTimeout = null; - if (!this.fakeFs.existsSync(this.path)) { - this.emit("change" /* Change */, this.lastStats, this.lastStats); - } - }, 3); - } - stop() { - assertStatus(this.status, "running" /* Running */); - this.status = "stopped" /* Stopped */; - if (this.startTimeout !== null) { - clearTimeout(this.startTimeout); - this.startTimeout = null; - } - this.emit("stop" /* Stop */); - } - stat() { - try { - return this.fakeFs.statSync(this.path, { bigint: this.bigint }); - } catch (error) { - const statInstance = this.bigint ? new BigIntStatsEntry() : new StatEntry(); - return clearStats(statInstance); - } - } - makeInterval(opts) { - const interval = setInterval(() => { - const currentStats = this.stat(); - const previousStats = this.lastStats; - if (areStatsEqual(currentStats, previousStats)) - return; - this.lastStats = currentStats; - this.emit("change" /* Change */, currentStats, previousStats); - }, opts.interval); - return opts.persistent ? interval : interval.unref(); - } - registerChangeListener(listener, opts) { - this.addListener("change" /* Change */, listener); - this.changeListeners.set(listener, this.makeInterval(opts)); - } - unregisterChangeListener(listener) { - this.removeListener("change" /* Change */, listener); - const interval = this.changeListeners.get(listener); - if (typeof interval !== `undefined`) - clearInterval(interval); - this.changeListeners.delete(listener); - } - unregisterAllChangeListeners() { - for (const listener of this.changeListeners.keys()) { - this.unregisterChangeListener(listener); - } - } - hasChangeListeners() { - return this.changeListeners.size > 0; - } - ref() { - for (const interval of this.changeListeners.values()) - interval.ref(); - return this; - } - unref() { - for (const interval of this.changeListeners.values()) - interval.unref(); - return this; - } -} - -const statWatchersByFakeFS = /* @__PURE__ */ new WeakMap(); -function watchFile(fakeFs, path, a, b) { - let bigint; - let persistent; - let interval; - let listener; - switch (typeof a) { - case `function`: - { - bigint = false; - persistent = true; - interval = 5007; - listener = a; - } - break; - default: - { - ({ - bigint = false, - persistent = true, - interval = 5007 - } = a); - listener = b; - } - break; - } - let statWatchers = statWatchersByFakeFS.get(fakeFs); - if (typeof statWatchers === `undefined`) - statWatchersByFakeFS.set(fakeFs, statWatchers = /* @__PURE__ */ new Map()); - let statWatcher = statWatchers.get(path); - if (typeof statWatcher === `undefined`) { - statWatcher = CustomStatWatcher.create(fakeFs, path, { bigint }); - statWatchers.set(path, statWatcher); - } - statWatcher.registerChangeListener(listener, { persistent, interval }); - return statWatcher; -} -function unwatchFile(fakeFs, path, cb) { - const statWatchers = statWatchersByFakeFS.get(fakeFs); - if (typeof statWatchers === `undefined`) - return; - const statWatcher = statWatchers.get(path); - if (typeof statWatcher === `undefined`) - return; - if (typeof cb === `undefined`) - statWatcher.unregisterAllChangeListeners(); - else - statWatcher.unregisterChangeListener(cb); - if (!statWatcher.hasChangeListeners()) { - statWatcher.stop(); - statWatchers.delete(path); - } -} -function unwatchAllFiles(fakeFs) { - const statWatchers = statWatchersByFakeFS.get(fakeFs); - if (typeof statWatchers === `undefined`) - return; - for (const path of statWatchers.keys()) { - unwatchFile(fakeFs, path); - } -} - -class FakeFS { - constructor(pathUtils) { - this.pathUtils = pathUtils; - } - async *genTraversePromise(init, { stableSort = false } = {}) { - const stack = [init]; - while (stack.length > 0) { - const p = stack.shift(); - const entry = await this.lstatPromise(p); - if (entry.isDirectory()) { - const entries = await this.readdirPromise(p); - if (stableSort) { - for (const entry2 of entries.sort()) { - stack.push(this.pathUtils.join(p, entry2)); - } - } else { - throw new Error(`Not supported`); - } - } else { - yield p; - } - } - } - async checksumFilePromise(path, { algorithm = `sha512` } = {}) { - const fd = await this.openPromise(path, `r`); - try { - const CHUNK_SIZE = 65536; - const chunk = Buffer.allocUnsafeSlow(CHUNK_SIZE); - const hash = crypto.createHash(algorithm); - let bytesRead = 0; - while ((bytesRead = await this.readPromise(fd, chunk, 0, CHUNK_SIZE)) !== 0) - hash.update(bytesRead === CHUNK_SIZE ? chunk : chunk.slice(0, bytesRead)); - return hash.digest(`hex`); - } finally { - await this.closePromise(fd); - } - } - async removePromise(p, { recursive = true, maxRetries = 5 } = {}) { - let stat; - try { - stat = await this.lstatPromise(p); - } catch (error) { - if (error.code === `ENOENT`) { - return; - } else { - throw error; - } - } - if (stat.isDirectory()) { - if (recursive) { - const entries = await this.readdirPromise(p); - await Promise.all(entries.map((entry) => { - return this.removePromise(this.pathUtils.resolve(p, entry)); - })); - } - for (let t = 0; t <= maxRetries; t++) { - try { - await this.rmdirPromise(p); - break; - } catch (error) { - if (error.code !== `EBUSY` && error.code !== `ENOTEMPTY`) { - throw error; - } else if (t < maxRetries) { - await new Promise((resolve) => setTimeout(resolve, t * 100)); - } - } - } - } else { - await this.unlinkPromise(p); - } - } - removeSync(p, { recursive = true } = {}) { - let stat; - try { - stat = this.lstatSync(p); - } catch (error) { - if (error.code === `ENOENT`) { - return; - } else { - throw error; - } - } - if (stat.isDirectory()) { - if (recursive) - for (const entry of this.readdirSync(p)) - this.removeSync(this.pathUtils.resolve(p, entry)); - this.rmdirSync(p); - } else { - this.unlinkSync(p); - } - } - async mkdirpPromise(p, { chmod, utimes } = {}) { - p = this.resolve(p); - if (p === this.pathUtils.dirname(p)) - return void 0; - const parts = p.split(this.pathUtils.sep); - let createdDirectory; - for (let u = 2; u <= parts.length; ++u) { - const subPath = parts.slice(0, u).join(this.pathUtils.sep); - if (!this.existsSync(subPath)) { - try { - await this.mkdirPromise(subPath); - } catch (error) { - if (error.code === `EEXIST`) { - continue; - } else { - throw error; - } - } - createdDirectory ??= subPath; - if (chmod != null) - await this.chmodPromise(subPath, chmod); - if (utimes != null) { - await this.utimesPromise(subPath, utimes[0], utimes[1]); - } else { - const parentStat = await this.statPromise(this.pathUtils.dirname(subPath)); - await this.utimesPromise(subPath, parentStat.atime, parentStat.mtime); - } - } - } - return createdDirectory; - } - mkdirpSync(p, { chmod, utimes } = {}) { - p = this.resolve(p); - if (p === this.pathUtils.dirname(p)) - return void 0; - const parts = p.split(this.pathUtils.sep); - let createdDirectory; - for (let u = 2; u <= parts.length; ++u) { - const subPath = parts.slice(0, u).join(this.pathUtils.sep); - if (!this.existsSync(subPath)) { - try { - this.mkdirSync(subPath); - } catch (error) { - if (error.code === `EEXIST`) { - continue; - } else { - throw error; - } - } - createdDirectory ??= subPath; - if (chmod != null) - this.chmodSync(subPath, chmod); - if (utimes != null) { - this.utimesSync(subPath, utimes[0], utimes[1]); - } else { - const parentStat = this.statSync(this.pathUtils.dirname(subPath)); - this.utimesSync(subPath, parentStat.atime, parentStat.mtime); - } - } - } - return createdDirectory; - } - async copyPromise(destination, source, { baseFs = this, overwrite = true, stableSort = false, stableTime = false, linkStrategy = null } = {}) { - return await copyPromise(this, destination, baseFs, source, { overwrite, stableSort, stableTime, linkStrategy }); - } - copySync(destination, source, { baseFs = this, overwrite = true } = {}) { - const stat = baseFs.lstatSync(source); - const exists = this.existsSync(destination); - if (stat.isDirectory()) { - this.mkdirpSync(destination); - const directoryListing = baseFs.readdirSync(source); - for (const entry of directoryListing) { - this.copySync(this.pathUtils.join(destination, entry), baseFs.pathUtils.join(source, entry), { baseFs, overwrite }); - } - } else if (stat.isFile()) { - if (!exists || overwrite) { - if (exists) - this.removeSync(destination); - const content = baseFs.readFileSync(source); - this.writeFileSync(destination, content); - } - } else if (stat.isSymbolicLink()) { - if (!exists || overwrite) { - if (exists) - this.removeSync(destination); - const target = baseFs.readlinkSync(source); - this.symlinkSync(convertPath(this.pathUtils, target), destination); - } - } else { - throw new Error(`Unsupported file type (file: ${source}, mode: 0o${stat.mode.toString(8).padStart(6, `0`)})`); - } - const mode = stat.mode & 511; - this.chmodSync(destination, mode); - } - async changeFilePromise(p, content, opts = {}) { - if (Buffer.isBuffer(content)) { - return this.changeFileBufferPromise(p, content, opts); - } else { - return this.changeFileTextPromise(p, content, opts); - } - } - async changeFileBufferPromise(p, content, { mode } = {}) { - let current = Buffer.alloc(0); - try { - current = await this.readFilePromise(p); - } catch (error) { - } - if (Buffer.compare(current, content) === 0) - return; - await this.writeFilePromise(p, content, { mode }); - } - async changeFileTextPromise(p, content, { automaticNewlines, mode } = {}) { - let current = ``; - try { - current = await this.readFilePromise(p, `utf8`); - } catch (error) { - } - const normalizedContent = automaticNewlines ? normalizeLineEndings(current, content) : content; - if (current === normalizedContent) - return; - await this.writeFilePromise(p, normalizedContent, { mode }); - } - changeFileSync(p, content, opts = {}) { - if (Buffer.isBuffer(content)) { - return this.changeFileBufferSync(p, content, opts); - } else { - return this.changeFileTextSync(p, content, opts); - } - } - changeFileBufferSync(p, content, { mode } = {}) { - let current = Buffer.alloc(0); - try { - current = this.readFileSync(p); - } catch (error) { - } - if (Buffer.compare(current, content) === 0) - return; - this.writeFileSync(p, content, { mode }); - } - changeFileTextSync(p, content, { automaticNewlines = false, mode } = {}) { - let current = ``; - try { - current = this.readFileSync(p, `utf8`); - } catch (error) { - } - const normalizedContent = automaticNewlines ? normalizeLineEndings(current, content) : content; - if (current === normalizedContent) - return; - this.writeFileSync(p, normalizedContent, { mode }); - } - async movePromise(fromP, toP) { - try { - await this.renamePromise(fromP, toP); - } catch (error) { - if (error.code === `EXDEV`) { - await this.copyPromise(toP, fromP); - await this.removePromise(fromP); - } else { - throw error; - } - } - } - moveSync(fromP, toP) { - try { - this.renameSync(fromP, toP); - } catch (error) { - if (error.code === `EXDEV`) { - this.copySync(toP, fromP); - this.removeSync(fromP); - } else { - throw error; - } - } - } - async lockPromise(affectedPath, callback) { - const lockPath = `${affectedPath}.flock`; - const interval = 1e3 / 60; - const startTime = Date.now(); - let fd = null; - const isAlive = async () => { - let pid; - try { - [pid] = await this.readJsonPromise(lockPath); - } catch (error) { - return Date.now() - startTime < 500; - } - try { - process.kill(pid, 0); - return true; - } catch (error) { - return false; - } - }; - while (fd === null) { - try { - fd = await this.openPromise(lockPath, `wx`); - } catch (error) { - if (error.code === `EEXIST`) { - if (!await isAlive()) { - try { - await this.unlinkPromise(lockPath); - continue; - } catch (error2) { - } - } - if (Date.now() - startTime < 60 * 1e3) { - await new Promise((resolve) => setTimeout(resolve, interval)); - } else { - throw new Error(`Couldn't acquire a lock in a reasonable time (via ${lockPath})`); - } - } else { - throw error; - } - } - } - await this.writePromise(fd, JSON.stringify([process.pid])); - try { - return await callback(); - } finally { - try { - await this.closePromise(fd); - await this.unlinkPromise(lockPath); - } catch (error) { - } - } - } - async readJsonPromise(p) { - const content = await this.readFilePromise(p, `utf8`); - try { - return JSON.parse(content); - } catch (error) { - error.message += ` (in ${p})`; - throw error; - } - } - readJsonSync(p) { - const content = this.readFileSync(p, `utf8`); - try { - return JSON.parse(content); - } catch (error) { - error.message += ` (in ${p})`; - throw error; - } - } - async writeJsonPromise(p, data, { compact = false } = {}) { - const space = compact ? 0 : 2; - return await this.writeFilePromise(p, `${JSON.stringify(data, null, space)} -`); - } - writeJsonSync(p, data, { compact = false } = {}) { - const space = compact ? 0 : 2; - return this.writeFileSync(p, `${JSON.stringify(data, null, space)} -`); - } - async preserveTimePromise(p, cb) { - const stat = await this.lstatPromise(p); - const result = await cb(); - if (typeof result !== `undefined`) - p = result; - await this.lutimesPromise(p, stat.atime, stat.mtime); - } - async preserveTimeSync(p, cb) { - const stat = this.lstatSync(p); - const result = cb(); - if (typeof result !== `undefined`) - p = result; - this.lutimesSync(p, stat.atime, stat.mtime); - } -} -class BasePortableFakeFS extends FakeFS { - constructor() { - super(ppath); - } -} -function getEndOfLine(content) { - const matches = content.match(/\r?\n/g); - if (matches === null) - return os.EOL; - const crlf = matches.filter((nl) => nl === `\r -`).length; - const lf = matches.length - crlf; - return crlf > lf ? `\r -` : ` -`; -} -function normalizeLineEndings(originalContent, newContent) { - return newContent.replace(/\r?\n/g, getEndOfLine(originalContent)); -} - -class ProxiedFS extends FakeFS { - getExtractHint(hints) { - return this.baseFs.getExtractHint(hints); - } - resolve(path) { - return this.mapFromBase(this.baseFs.resolve(this.mapToBase(path))); - } - getRealPath() { - return this.mapFromBase(this.baseFs.getRealPath()); - } - async openPromise(p, flags, mode) { - return this.baseFs.openPromise(this.mapToBase(p), flags, mode); - } - openSync(p, flags, mode) { - return this.baseFs.openSync(this.mapToBase(p), flags, mode); - } - async opendirPromise(p, opts) { - return Object.assign(await this.baseFs.opendirPromise(this.mapToBase(p), opts), { path: p }); - } - opendirSync(p, opts) { - return Object.assign(this.baseFs.opendirSync(this.mapToBase(p), opts), { path: p }); - } - async readPromise(fd, buffer, offset, length, position) { - return await this.baseFs.readPromise(fd, buffer, offset, length, position); - } - readSync(fd, buffer, offset, length, position) { - return this.baseFs.readSync(fd, buffer, offset, length, position); - } - async writePromise(fd, buffer, offset, length, position) { - if (typeof buffer === `string`) { - return await this.baseFs.writePromise(fd, buffer, offset); - } else { - return await this.baseFs.writePromise(fd, buffer, offset, length, position); - } - } - writeSync(fd, buffer, offset, length, position) { - if (typeof buffer === `string`) { - return this.baseFs.writeSync(fd, buffer, offset); - } else { - return this.baseFs.writeSync(fd, buffer, offset, length, position); - } - } - async closePromise(fd) { - return this.baseFs.closePromise(fd); - } - closeSync(fd) { - this.baseFs.closeSync(fd); - } - createReadStream(p, opts) { - return this.baseFs.createReadStream(p !== null ? this.mapToBase(p) : p, opts); - } - createWriteStream(p, opts) { - return this.baseFs.createWriteStream(p !== null ? this.mapToBase(p) : p, opts); - } - async realpathPromise(p) { - return this.mapFromBase(await this.baseFs.realpathPromise(this.mapToBase(p))); - } - realpathSync(p) { - return this.mapFromBase(this.baseFs.realpathSync(this.mapToBase(p))); - } - async existsPromise(p) { - return this.baseFs.existsPromise(this.mapToBase(p)); - } - existsSync(p) { - return this.baseFs.existsSync(this.mapToBase(p)); - } - accessSync(p, mode) { - return this.baseFs.accessSync(this.mapToBase(p), mode); - } - async accessPromise(p, mode) { - return this.baseFs.accessPromise(this.mapToBase(p), mode); - } - async statPromise(p, opts) { - return this.baseFs.statPromise(this.mapToBase(p), opts); - } - statSync(p, opts) { - return this.baseFs.statSync(this.mapToBase(p), opts); - } - async fstatPromise(fd, opts) { - return this.baseFs.fstatPromise(fd, opts); - } - fstatSync(fd, opts) { - return this.baseFs.fstatSync(fd, opts); - } - lstatPromise(p, opts) { - return this.baseFs.lstatPromise(this.mapToBase(p), opts); - } - lstatSync(p, opts) { - return this.baseFs.lstatSync(this.mapToBase(p), opts); - } - async fchmodPromise(fd, mask) { - return this.baseFs.fchmodPromise(fd, mask); - } - fchmodSync(fd, mask) { - return this.baseFs.fchmodSync(fd, mask); - } - async chmodPromise(p, mask) { - return this.baseFs.chmodPromise(this.mapToBase(p), mask); - } - chmodSync(p, mask) { - return this.baseFs.chmodSync(this.mapToBase(p), mask); - } - async fchownPromise(fd, uid, gid) { - return this.baseFs.fchownPromise(fd, uid, gid); - } - fchownSync(fd, uid, gid) { - return this.baseFs.fchownSync(fd, uid, gid); - } - async chownPromise(p, uid, gid) { - return this.baseFs.chownPromise(this.mapToBase(p), uid, gid); - } - chownSync(p, uid, gid) { - return this.baseFs.chownSync(this.mapToBase(p), uid, gid); - } - async renamePromise(oldP, newP) { - return this.baseFs.renamePromise(this.mapToBase(oldP), this.mapToBase(newP)); - } - renameSync(oldP, newP) { - return this.baseFs.renameSync(this.mapToBase(oldP), this.mapToBase(newP)); - } - async copyFilePromise(sourceP, destP, flags = 0) { - return this.baseFs.copyFilePromise(this.mapToBase(sourceP), this.mapToBase(destP), flags); - } - copyFileSync(sourceP, destP, flags = 0) { - return this.baseFs.copyFileSync(this.mapToBase(sourceP), this.mapToBase(destP), flags); - } - async appendFilePromise(p, content, opts) { - return this.baseFs.appendFilePromise(this.fsMapToBase(p), content, opts); - } - appendFileSync(p, content, opts) { - return this.baseFs.appendFileSync(this.fsMapToBase(p), content, opts); - } - async writeFilePromise(p, content, opts) { - return this.baseFs.writeFilePromise(this.fsMapToBase(p), content, opts); - } - writeFileSync(p, content, opts) { - return this.baseFs.writeFileSync(this.fsMapToBase(p), content, opts); - } - async unlinkPromise(p) { - return this.baseFs.unlinkPromise(this.mapToBase(p)); - } - unlinkSync(p) { - return this.baseFs.unlinkSync(this.mapToBase(p)); - } - async utimesPromise(p, atime, mtime) { - return this.baseFs.utimesPromise(this.mapToBase(p), atime, mtime); - } - utimesSync(p, atime, mtime) { - return this.baseFs.utimesSync(this.mapToBase(p), atime, mtime); - } - async lutimesPromise(p, atime, mtime) { - return this.baseFs.lutimesPromise(this.mapToBase(p), atime, mtime); - } - lutimesSync(p, atime, mtime) { - return this.baseFs.lutimesSync(this.mapToBase(p), atime, mtime); - } - async mkdirPromise(p, opts) { - return this.baseFs.mkdirPromise(this.mapToBase(p), opts); - } - mkdirSync(p, opts) { - return this.baseFs.mkdirSync(this.mapToBase(p), opts); - } - async rmdirPromise(p, opts) { - return this.baseFs.rmdirPromise(this.mapToBase(p), opts); - } - rmdirSync(p, opts) { - return this.baseFs.rmdirSync(this.mapToBase(p), opts); - } - async rmPromise(p, opts) { - return this.baseFs.rmPromise(this.mapToBase(p), opts); - } - rmSync(p, opts) { - return this.baseFs.rmSync(this.mapToBase(p), opts); - } - async linkPromise(existingP, newP) { - return this.baseFs.linkPromise(this.mapToBase(existingP), this.mapToBase(newP)); - } - linkSync(existingP, newP) { - return this.baseFs.linkSync(this.mapToBase(existingP), this.mapToBase(newP)); - } - async symlinkPromise(target, p, type) { - const mappedP = this.mapToBase(p); - if (this.pathUtils.isAbsolute(target)) - return this.baseFs.symlinkPromise(this.mapToBase(target), mappedP, type); - const mappedAbsoluteTarget = this.mapToBase(this.pathUtils.join(this.pathUtils.dirname(p), target)); - const mappedTarget = this.baseFs.pathUtils.relative(this.baseFs.pathUtils.dirname(mappedP), mappedAbsoluteTarget); - return this.baseFs.symlinkPromise(mappedTarget, mappedP, type); - } - symlinkSync(target, p, type) { - const mappedP = this.mapToBase(p); - if (this.pathUtils.isAbsolute(target)) - return this.baseFs.symlinkSync(this.mapToBase(target), mappedP, type); - const mappedAbsoluteTarget = this.mapToBase(this.pathUtils.join(this.pathUtils.dirname(p), target)); - const mappedTarget = this.baseFs.pathUtils.relative(this.baseFs.pathUtils.dirname(mappedP), mappedAbsoluteTarget); - return this.baseFs.symlinkSync(mappedTarget, mappedP, type); - } - async readFilePromise(p, encoding) { - return this.baseFs.readFilePromise(this.fsMapToBase(p), encoding); - } - readFileSync(p, encoding) { - return this.baseFs.readFileSync(this.fsMapToBase(p), encoding); - } - readdirPromise(p, opts) { - return this.baseFs.readdirPromise(this.mapToBase(p), opts); - } - readdirSync(p, opts) { - return this.baseFs.readdirSync(this.mapToBase(p), opts); - } - async readlinkPromise(p) { - return this.mapFromBase(await this.baseFs.readlinkPromise(this.mapToBase(p))); - } - readlinkSync(p) { - return this.mapFromBase(this.baseFs.readlinkSync(this.mapToBase(p))); - } - async truncatePromise(p, len) { - return this.baseFs.truncatePromise(this.mapToBase(p), len); - } - truncateSync(p, len) { - return this.baseFs.truncateSync(this.mapToBase(p), len); - } - async ftruncatePromise(fd, len) { - return this.baseFs.ftruncatePromise(fd, len); - } - ftruncateSync(fd, len) { - return this.baseFs.ftruncateSync(fd, len); - } - watch(p, a, b) { - return this.baseFs.watch( - this.mapToBase(p), - a, - b - ); - } - watchFile(p, a, b) { - return this.baseFs.watchFile( - this.mapToBase(p), - a, - b - ); - } - unwatchFile(p, cb) { - return this.baseFs.unwatchFile(this.mapToBase(p), cb); - } - fsMapToBase(p) { - if (typeof p === `number`) { - return p; - } else { - return this.mapToBase(p); - } - } -} - -function direntToPortable(dirent) { - const portableDirent = dirent; - if (typeof dirent.path === `string`) - portableDirent.path = npath.toPortablePath(dirent.path); - return portableDirent; -} -class NodeFS extends BasePortableFakeFS { - constructor(realFs = fs__default.default) { - super(); - this.realFs = realFs; - } - getExtractHint() { - return false; - } - getRealPath() { - return PortablePath.root; - } - resolve(p) { - return ppath.resolve(p); - } - async openPromise(p, flags, mode) { - return await new Promise((resolve, reject) => { - this.realFs.open(npath.fromPortablePath(p), flags, mode, this.makeCallback(resolve, reject)); - }); - } - openSync(p, flags, mode) { - return this.realFs.openSync(npath.fromPortablePath(p), flags, mode); - } - async opendirPromise(p, opts) { - return await new Promise((resolve, reject) => { - if (typeof opts !== `undefined`) { - this.realFs.opendir(npath.fromPortablePath(p), opts, this.makeCallback(resolve, reject)); - } else { - this.realFs.opendir(npath.fromPortablePath(p), this.makeCallback(resolve, reject)); - } - }).then((dir) => { - const dirWithFixedPath = dir; - Object.defineProperty(dirWithFixedPath, `path`, { - value: p, - configurable: true, - writable: true - }); - return dirWithFixedPath; - }); - } - opendirSync(p, opts) { - const dir = typeof opts !== `undefined` ? this.realFs.opendirSync(npath.fromPortablePath(p), opts) : this.realFs.opendirSync(npath.fromPortablePath(p)); - const dirWithFixedPath = dir; - Object.defineProperty(dirWithFixedPath, `path`, { - value: p, - configurable: true, - writable: true - }); - return dirWithFixedPath; - } - async readPromise(fd, buffer, offset = 0, length = 0, position = -1) { - return await new Promise((resolve, reject) => { - this.realFs.read(fd, buffer, offset, length, position, (error, bytesRead) => { - if (error) { - reject(error); - } else { - resolve(bytesRead); - } - }); - }); - } - readSync(fd, buffer, offset, length, position) { - return this.realFs.readSync(fd, buffer, offset, length, position); - } - async writePromise(fd, buffer, offset, length, position) { - return await new Promise((resolve, reject) => { - if (typeof buffer === `string`) { - return this.realFs.write(fd, buffer, offset, this.makeCallback(resolve, reject)); - } else { - return this.realFs.write(fd, buffer, offset, length, position, this.makeCallback(resolve, reject)); - } - }); - } - writeSync(fd, buffer, offset, length, position) { - if (typeof buffer === `string`) { - return this.realFs.writeSync(fd, buffer, offset); - } else { - return this.realFs.writeSync(fd, buffer, offset, length, position); - } - } - async closePromise(fd) { - await new Promise((resolve, reject) => { - this.realFs.close(fd, this.makeCallback(resolve, reject)); - }); - } - closeSync(fd) { - this.realFs.closeSync(fd); - } - createReadStream(p, opts) { - const realPath = p !== null ? npath.fromPortablePath(p) : p; - return this.realFs.createReadStream(realPath, opts); - } - createWriteStream(p, opts) { - const realPath = p !== null ? npath.fromPortablePath(p) : p; - return this.realFs.createWriteStream(realPath, opts); - } - async realpathPromise(p) { - return await new Promise((resolve, reject) => { - this.realFs.realpath(npath.fromPortablePath(p), {}, this.makeCallback(resolve, reject)); - }).then((path) => { - return npath.toPortablePath(path); - }); - } - realpathSync(p) { - return npath.toPortablePath(this.realFs.realpathSync(npath.fromPortablePath(p), {})); - } - async existsPromise(p) { - return await new Promise((resolve) => { - this.realFs.exists(npath.fromPortablePath(p), resolve); - }); - } - accessSync(p, mode) { - return this.realFs.accessSync(npath.fromPortablePath(p), mode); - } - async accessPromise(p, mode) { - return await new Promise((resolve, reject) => { - this.realFs.access(npath.fromPortablePath(p), mode, this.makeCallback(resolve, reject)); - }); - } - existsSync(p) { - return this.realFs.existsSync(npath.fromPortablePath(p)); - } - async statPromise(p, opts) { - return await new Promise((resolve, reject) => { - if (opts) { - this.realFs.stat(npath.fromPortablePath(p), opts, this.makeCallback(resolve, reject)); - } else { - this.realFs.stat(npath.fromPortablePath(p), this.makeCallback(resolve, reject)); - } - }); - } - statSync(p, opts) { - if (opts) { - return this.realFs.statSync(npath.fromPortablePath(p), opts); - } else { - return this.realFs.statSync(npath.fromPortablePath(p)); - } - } - async fstatPromise(fd, opts) { - return await new Promise((resolve, reject) => { - if (opts) { - this.realFs.fstat(fd, opts, this.makeCallback(resolve, reject)); - } else { - this.realFs.fstat(fd, this.makeCallback(resolve, reject)); - } - }); - } - fstatSync(fd, opts) { - if (opts) { - return this.realFs.fstatSync(fd, opts); - } else { - return this.realFs.fstatSync(fd); - } - } - async lstatPromise(p, opts) { - return await new Promise((resolve, reject) => { - if (opts) { - this.realFs.lstat(npath.fromPortablePath(p), opts, this.makeCallback(resolve, reject)); - } else { - this.realFs.lstat(npath.fromPortablePath(p), this.makeCallback(resolve, reject)); - } - }); - } - lstatSync(p, opts) { - if (opts) { - return this.realFs.lstatSync(npath.fromPortablePath(p), opts); - } else { - return this.realFs.lstatSync(npath.fromPortablePath(p)); - } - } - async fchmodPromise(fd, mask) { - return await new Promise((resolve, reject) => { - this.realFs.fchmod(fd, mask, this.makeCallback(resolve, reject)); - }); - } - fchmodSync(fd, mask) { - return this.realFs.fchmodSync(fd, mask); - } - async chmodPromise(p, mask) { - return await new Promise((resolve, reject) => { - this.realFs.chmod(npath.fromPortablePath(p), mask, this.makeCallback(resolve, reject)); - }); - } - chmodSync(p, mask) { - return this.realFs.chmodSync(npath.fromPortablePath(p), mask); - } - async fchownPromise(fd, uid, gid) { - return await new Promise((resolve, reject) => { - this.realFs.fchown(fd, uid, gid, this.makeCallback(resolve, reject)); - }); - } - fchownSync(fd, uid, gid) { - return this.realFs.fchownSync(fd, uid, gid); - } - async chownPromise(p, uid, gid) { - return await new Promise((resolve, reject) => { - this.realFs.chown(npath.fromPortablePath(p), uid, gid, this.makeCallback(resolve, reject)); - }); - } - chownSync(p, uid, gid) { - return this.realFs.chownSync(npath.fromPortablePath(p), uid, gid); - } - async renamePromise(oldP, newP) { - return await new Promise((resolve, reject) => { - this.realFs.rename(npath.fromPortablePath(oldP), npath.fromPortablePath(newP), this.makeCallback(resolve, reject)); - }); - } - renameSync(oldP, newP) { - return this.realFs.renameSync(npath.fromPortablePath(oldP), npath.fromPortablePath(newP)); - } - async copyFilePromise(sourceP, destP, flags = 0) { - return await new Promise((resolve, reject) => { - this.realFs.copyFile(npath.fromPortablePath(sourceP), npath.fromPortablePath(destP), flags, this.makeCallback(resolve, reject)); - }); - } - copyFileSync(sourceP, destP, flags = 0) { - return this.realFs.copyFileSync(npath.fromPortablePath(sourceP), npath.fromPortablePath(destP), flags); - } - async appendFilePromise(p, content, opts) { - return await new Promise((resolve, reject) => { - const fsNativePath = typeof p === `string` ? npath.fromPortablePath(p) : p; - if (opts) { - this.realFs.appendFile(fsNativePath, content, opts, this.makeCallback(resolve, reject)); - } else { - this.realFs.appendFile(fsNativePath, content, this.makeCallback(resolve, reject)); - } - }); - } - appendFileSync(p, content, opts) { - const fsNativePath = typeof p === `string` ? npath.fromPortablePath(p) : p; - if (opts) { - this.realFs.appendFileSync(fsNativePath, content, opts); - } else { - this.realFs.appendFileSync(fsNativePath, content); - } - } - async writeFilePromise(p, content, opts) { - return await new Promise((resolve, reject) => { - const fsNativePath = typeof p === `string` ? npath.fromPortablePath(p) : p; - if (opts) { - this.realFs.writeFile(fsNativePath, content, opts, this.makeCallback(resolve, reject)); - } else { - this.realFs.writeFile(fsNativePath, content, this.makeCallback(resolve, reject)); - } - }); - } - writeFileSync(p, content, opts) { - const fsNativePath = typeof p === `string` ? npath.fromPortablePath(p) : p; - if (opts) { - this.realFs.writeFileSync(fsNativePath, content, opts); - } else { - this.realFs.writeFileSync(fsNativePath, content); - } - } - async unlinkPromise(p) { - return await new Promise((resolve, reject) => { - this.realFs.unlink(npath.fromPortablePath(p), this.makeCallback(resolve, reject)); - }); - } - unlinkSync(p) { - return this.realFs.unlinkSync(npath.fromPortablePath(p)); - } - async utimesPromise(p, atime, mtime) { - return await new Promise((resolve, reject) => { - this.realFs.utimes(npath.fromPortablePath(p), atime, mtime, this.makeCallback(resolve, reject)); - }); - } - utimesSync(p, atime, mtime) { - this.realFs.utimesSync(npath.fromPortablePath(p), atime, mtime); - } - async lutimesPromise(p, atime, mtime) { - return await new Promise((resolve, reject) => { - this.realFs.lutimes(npath.fromPortablePath(p), atime, mtime, this.makeCallback(resolve, reject)); - }); - } - lutimesSync(p, atime, mtime) { - this.realFs.lutimesSync(npath.fromPortablePath(p), atime, mtime); - } - async mkdirPromise(p, opts) { - return await new Promise((resolve, reject) => { - this.realFs.mkdir(npath.fromPortablePath(p), opts, this.makeCallback(resolve, reject)); - }); - } - mkdirSync(p, opts) { - return this.realFs.mkdirSync(npath.fromPortablePath(p), opts); - } - async rmdirPromise(p, opts) { - return await new Promise((resolve, reject) => { - if (opts) { - this.realFs.rmdir(npath.fromPortablePath(p), opts, this.makeCallback(resolve, reject)); - } else { - this.realFs.rmdir(npath.fromPortablePath(p), this.makeCallback(resolve, reject)); - } - }); - } - rmdirSync(p, opts) { - return this.realFs.rmdirSync(npath.fromPortablePath(p), opts); - } - async rmPromise(p, opts) { - return await new Promise((resolve, reject) => { - if (opts) { - this.realFs.rm(npath.fromPortablePath(p), opts, this.makeCallback(resolve, reject)); - } else { - this.realFs.rm(npath.fromPortablePath(p), this.makeCallback(resolve, reject)); - } - }); - } - rmSync(p, opts) { - return this.realFs.rmSync(npath.fromPortablePath(p), opts); - } - async linkPromise(existingP, newP) { - return await new Promise((resolve, reject) => { - this.realFs.link(npath.fromPortablePath(existingP), npath.fromPortablePath(newP), this.makeCallback(resolve, reject)); - }); - } - linkSync(existingP, newP) { - return this.realFs.linkSync(npath.fromPortablePath(existingP), npath.fromPortablePath(newP)); - } - async symlinkPromise(target, p, type) { - return await new Promise((resolve, reject) => { - this.realFs.symlink(npath.fromPortablePath(target.replace(/\/+$/, ``)), npath.fromPortablePath(p), type, this.makeCallback(resolve, reject)); - }); - } - symlinkSync(target, p, type) { - return this.realFs.symlinkSync(npath.fromPortablePath(target.replace(/\/+$/, ``)), npath.fromPortablePath(p), type); - } - async readFilePromise(p, encoding) { - return await new Promise((resolve, reject) => { - const fsNativePath = typeof p === `string` ? npath.fromPortablePath(p) : p; - this.realFs.readFile(fsNativePath, encoding, this.makeCallback(resolve, reject)); - }); - } - readFileSync(p, encoding) { - const fsNativePath = typeof p === `string` ? npath.fromPortablePath(p) : p; - return this.realFs.readFileSync(fsNativePath, encoding); - } - async readdirPromise(p, opts) { - return await new Promise((resolve, reject) => { - if (opts) { - if (opts.recursive && process.platform === `win32`) { - if (opts.withFileTypes) { - this.realFs.readdir(npath.fromPortablePath(p), opts, this.makeCallback((results) => resolve(results.map(direntToPortable)), reject)); - } else { - this.realFs.readdir(npath.fromPortablePath(p), opts, this.makeCallback((results) => resolve(results.map(npath.toPortablePath)), reject)); - } - } else { - this.realFs.readdir(npath.fromPortablePath(p), opts, this.makeCallback(resolve, reject)); - } - } else { - this.realFs.readdir(npath.fromPortablePath(p), this.makeCallback(resolve, reject)); - } - }); - } - readdirSync(p, opts) { - if (opts) { - if (opts.recursive && process.platform === `win32`) { - if (opts.withFileTypes) { - return this.realFs.readdirSync(npath.fromPortablePath(p), opts).map(direntToPortable); - } else { - return this.realFs.readdirSync(npath.fromPortablePath(p), opts).map(npath.toPortablePath); - } - } else { - return this.realFs.readdirSync(npath.fromPortablePath(p), opts); - } - } else { - return this.realFs.readdirSync(npath.fromPortablePath(p)); - } - } - async readlinkPromise(p) { - return await new Promise((resolve, reject) => { - this.realFs.readlink(npath.fromPortablePath(p), this.makeCallback(resolve, reject)); - }).then((path) => { - return npath.toPortablePath(path); - }); - } - readlinkSync(p) { - return npath.toPortablePath(this.realFs.readlinkSync(npath.fromPortablePath(p))); - } - async truncatePromise(p, len) { - return await new Promise((resolve, reject) => { - this.realFs.truncate(npath.fromPortablePath(p), len, this.makeCallback(resolve, reject)); - }); - } - truncateSync(p, len) { - return this.realFs.truncateSync(npath.fromPortablePath(p), len); - } - async ftruncatePromise(fd, len) { - return await new Promise((resolve, reject) => { - this.realFs.ftruncate(fd, len, this.makeCallback(resolve, reject)); - }); - } - ftruncateSync(fd, len) { - return this.realFs.ftruncateSync(fd, len); - } - watch(p, a, b) { - return this.realFs.watch( - npath.fromPortablePath(p), - a, - b - ); - } - watchFile(p, a, b) { - return this.realFs.watchFile( - npath.fromPortablePath(p), - a, - b - ); - } - unwatchFile(p, cb) { - return this.realFs.unwatchFile(npath.fromPortablePath(p), cb); - } - makeCallback(resolve, reject) { - return (err, result) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }; - } -} - -const MOUNT_MASK = 4278190080; -class MountFS extends BasePortableFakeFS { - constructor({ baseFs = new NodeFS(), filter = null, magicByte = 42, maxOpenFiles = Infinity, useCache = true, maxAge = 5e3, typeCheck = fs.constants.S_IFREG, getMountPoint, factoryPromise, factorySync }) { - if (Math.floor(magicByte) !== magicByte || !(magicByte > 1 && magicByte <= 127)) - throw new Error(`The magic byte must be set to a round value between 1 and 127 included`); - super(); - this.fdMap = /* @__PURE__ */ new Map(); - this.nextFd = 3; - this.isMount = /* @__PURE__ */ new Set(); - this.notMount = /* @__PURE__ */ new Set(); - this.realPaths = /* @__PURE__ */ new Map(); - this.limitOpenFilesTimeout = null; - this.baseFs = baseFs; - this.mountInstances = useCache ? /* @__PURE__ */ new Map() : null; - this.factoryPromise = factoryPromise; - this.factorySync = factorySync; - this.filter = filter; - this.getMountPoint = getMountPoint; - this.magic = magicByte << 24; - this.maxAge = maxAge; - this.maxOpenFiles = maxOpenFiles; - this.typeCheck = typeCheck; - } - getExtractHint(hints) { - return this.baseFs.getExtractHint(hints); - } - getRealPath() { - return this.baseFs.getRealPath(); - } - saveAndClose() { - unwatchAllFiles(this); - if (this.mountInstances) { - for (const [path, { childFs }] of this.mountInstances.entries()) { - childFs.saveAndClose?.(); - this.mountInstances.delete(path); - } - } - } - discardAndClose() { - unwatchAllFiles(this); - if (this.mountInstances) { - for (const [path, { childFs }] of this.mountInstances.entries()) { - childFs.discardAndClose?.(); - this.mountInstances.delete(path); - } - } - } - resolve(p) { - return this.baseFs.resolve(p); - } - remapFd(mountFs, fd) { - const remappedFd = this.nextFd++ | this.magic; - this.fdMap.set(remappedFd, [mountFs, fd]); - return remappedFd; - } - async openPromise(p, flags, mode) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.openPromise(p, flags, mode); - }, async (mountFs, { subPath }) => { - return this.remapFd(mountFs, await mountFs.openPromise(subPath, flags, mode)); - }); - } - openSync(p, flags, mode) { - return this.makeCallSync(p, () => { - return this.baseFs.openSync(p, flags, mode); - }, (mountFs, { subPath }) => { - return this.remapFd(mountFs, mountFs.openSync(subPath, flags, mode)); - }); - } - async opendirPromise(p, opts) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.opendirPromise(p, opts); - }, async (mountFs, { subPath }) => { - return await mountFs.opendirPromise(subPath, opts); - }, { - requireSubpath: false - }); - } - opendirSync(p, opts) { - return this.makeCallSync(p, () => { - return this.baseFs.opendirSync(p, opts); - }, (mountFs, { subPath }) => { - return mountFs.opendirSync(subPath, opts); - }, { - requireSubpath: false - }); - } - async readPromise(fd, buffer, offset, length, position) { - if ((fd & MOUNT_MASK) !== this.magic) - return await this.baseFs.readPromise(fd, buffer, offset, length, position); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`read`); - const [mountFs, realFd] = entry; - return await mountFs.readPromise(realFd, buffer, offset, length, position); - } - readSync(fd, buffer, offset, length, position) { - if ((fd & MOUNT_MASK) !== this.magic) - return this.baseFs.readSync(fd, buffer, offset, length, position); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`readSync`); - const [mountFs, realFd] = entry; - return mountFs.readSync(realFd, buffer, offset, length, position); - } - async writePromise(fd, buffer, offset, length, position) { - if ((fd & MOUNT_MASK) !== this.magic) { - if (typeof buffer === `string`) { - return await this.baseFs.writePromise(fd, buffer, offset); - } else { - return await this.baseFs.writePromise(fd, buffer, offset, length, position); - } - } - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`write`); - const [mountFs, realFd] = entry; - if (typeof buffer === `string`) { - return await mountFs.writePromise(realFd, buffer, offset); - } else { - return await mountFs.writePromise(realFd, buffer, offset, length, position); - } - } - writeSync(fd, buffer, offset, length, position) { - if ((fd & MOUNT_MASK) !== this.magic) { - if (typeof buffer === `string`) { - return this.baseFs.writeSync(fd, buffer, offset); - } else { - return this.baseFs.writeSync(fd, buffer, offset, length, position); - } - } - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`writeSync`); - const [mountFs, realFd] = entry; - if (typeof buffer === `string`) { - return mountFs.writeSync(realFd, buffer, offset); - } else { - return mountFs.writeSync(realFd, buffer, offset, length, position); - } - } - async closePromise(fd) { - if ((fd & MOUNT_MASK) !== this.magic) - return await this.baseFs.closePromise(fd); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`close`); - this.fdMap.delete(fd); - const [mountFs, realFd] = entry; - return await mountFs.closePromise(realFd); - } - closeSync(fd) { - if ((fd & MOUNT_MASK) !== this.magic) - return this.baseFs.closeSync(fd); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`closeSync`); - this.fdMap.delete(fd); - const [mountFs, realFd] = entry; - return mountFs.closeSync(realFd); - } - createReadStream(p, opts) { - if (p === null) - return this.baseFs.createReadStream(p, opts); - return this.makeCallSync(p, () => { - return this.baseFs.createReadStream(p, opts); - }, (mountFs, { archivePath, subPath }) => { - const stream = mountFs.createReadStream(subPath, opts); - stream.path = npath.fromPortablePath(this.pathUtils.join(archivePath, subPath)); - return stream; - }); - } - createWriteStream(p, opts) { - if (p === null) - return this.baseFs.createWriteStream(p, opts); - return this.makeCallSync(p, () => { - return this.baseFs.createWriteStream(p, opts); - }, (mountFs, { subPath }) => { - return mountFs.createWriteStream(subPath, opts); - }); - } - async realpathPromise(p) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.realpathPromise(p); - }, async (mountFs, { archivePath, subPath }) => { - let realArchivePath = this.realPaths.get(archivePath); - if (typeof realArchivePath === `undefined`) { - realArchivePath = await this.baseFs.realpathPromise(archivePath); - this.realPaths.set(archivePath, realArchivePath); - } - return this.pathUtils.join(realArchivePath, this.pathUtils.relative(PortablePath.root, await mountFs.realpathPromise(subPath))); - }); - } - realpathSync(p) { - return this.makeCallSync(p, () => { - return this.baseFs.realpathSync(p); - }, (mountFs, { archivePath, subPath }) => { - let realArchivePath = this.realPaths.get(archivePath); - if (typeof realArchivePath === `undefined`) { - realArchivePath = this.baseFs.realpathSync(archivePath); - this.realPaths.set(archivePath, realArchivePath); - } - return this.pathUtils.join(realArchivePath, this.pathUtils.relative(PortablePath.root, mountFs.realpathSync(subPath))); - }); - } - async existsPromise(p) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.existsPromise(p); - }, async (mountFs, { subPath }) => { - return await mountFs.existsPromise(subPath); - }); - } - existsSync(p) { - return this.makeCallSync(p, () => { - return this.baseFs.existsSync(p); - }, (mountFs, { subPath }) => { - return mountFs.existsSync(subPath); - }); - } - async accessPromise(p, mode) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.accessPromise(p, mode); - }, async (mountFs, { subPath }) => { - return await mountFs.accessPromise(subPath, mode); - }); - } - accessSync(p, mode) { - return this.makeCallSync(p, () => { - return this.baseFs.accessSync(p, mode); - }, (mountFs, { subPath }) => { - return mountFs.accessSync(subPath, mode); - }); - } - async statPromise(p, opts) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.statPromise(p, opts); - }, async (mountFs, { subPath }) => { - return await mountFs.statPromise(subPath, opts); - }); - } - statSync(p, opts) { - return this.makeCallSync(p, () => { - return this.baseFs.statSync(p, opts); - }, (mountFs, { subPath }) => { - return mountFs.statSync(subPath, opts); - }); - } - async fstatPromise(fd, opts) { - if ((fd & MOUNT_MASK) !== this.magic) - return this.baseFs.fstatPromise(fd, opts); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`fstat`); - const [mountFs, realFd] = entry; - return mountFs.fstatPromise(realFd, opts); - } - fstatSync(fd, opts) { - if ((fd & MOUNT_MASK) !== this.magic) - return this.baseFs.fstatSync(fd, opts); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`fstatSync`); - const [mountFs, realFd] = entry; - return mountFs.fstatSync(realFd, opts); - } - async lstatPromise(p, opts) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.lstatPromise(p, opts); - }, async (mountFs, { subPath }) => { - return await mountFs.lstatPromise(subPath, opts); - }); - } - lstatSync(p, opts) { - return this.makeCallSync(p, () => { - return this.baseFs.lstatSync(p, opts); - }, (mountFs, { subPath }) => { - return mountFs.lstatSync(subPath, opts); - }); - } - async fchmodPromise(fd, mask) { - if ((fd & MOUNT_MASK) !== this.magic) - return this.baseFs.fchmodPromise(fd, mask); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`fchmod`); - const [mountFs, realFd] = entry; - return mountFs.fchmodPromise(realFd, mask); - } - fchmodSync(fd, mask) { - if ((fd & MOUNT_MASK) !== this.magic) - return this.baseFs.fchmodSync(fd, mask); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`fchmodSync`); - const [mountFs, realFd] = entry; - return mountFs.fchmodSync(realFd, mask); - } - async chmodPromise(p, mask) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.chmodPromise(p, mask); - }, async (mountFs, { subPath }) => { - return await mountFs.chmodPromise(subPath, mask); - }); - } - chmodSync(p, mask) { - return this.makeCallSync(p, () => { - return this.baseFs.chmodSync(p, mask); - }, (mountFs, { subPath }) => { - return mountFs.chmodSync(subPath, mask); - }); - } - async fchownPromise(fd, uid, gid) { - if ((fd & MOUNT_MASK) !== this.magic) - return this.baseFs.fchownPromise(fd, uid, gid); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`fchown`); - const [zipFs, realFd] = entry; - return zipFs.fchownPromise(realFd, uid, gid); - } - fchownSync(fd, uid, gid) { - if ((fd & MOUNT_MASK) !== this.magic) - return this.baseFs.fchownSync(fd, uid, gid); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`fchownSync`); - const [zipFs, realFd] = entry; - return zipFs.fchownSync(realFd, uid, gid); - } - async chownPromise(p, uid, gid) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.chownPromise(p, uid, gid); - }, async (mountFs, { subPath }) => { - return await mountFs.chownPromise(subPath, uid, gid); - }); - } - chownSync(p, uid, gid) { - return this.makeCallSync(p, () => { - return this.baseFs.chownSync(p, uid, gid); - }, (mountFs, { subPath }) => { - return mountFs.chownSync(subPath, uid, gid); - }); - } - async renamePromise(oldP, newP) { - return await this.makeCallPromise(oldP, async () => { - return await this.makeCallPromise(newP, async () => { - return await this.baseFs.renamePromise(oldP, newP); - }, async () => { - throw Object.assign(new Error(`EEXDEV: cross-device link not permitted`), { code: `EEXDEV` }); - }); - }, async (mountFsO, { subPath: subPathO }) => { - return await this.makeCallPromise(newP, async () => { - throw Object.assign(new Error(`EEXDEV: cross-device link not permitted`), { code: `EEXDEV` }); - }, async (mountFsN, { subPath: subPathN }) => { - if (mountFsO !== mountFsN) { - throw Object.assign(new Error(`EEXDEV: cross-device link not permitted`), { code: `EEXDEV` }); - } else { - return await mountFsO.renamePromise(subPathO, subPathN); - } - }); - }); - } - renameSync(oldP, newP) { - return this.makeCallSync(oldP, () => { - return this.makeCallSync(newP, () => { - return this.baseFs.renameSync(oldP, newP); - }, () => { - throw Object.assign(new Error(`EEXDEV: cross-device link not permitted`), { code: `EEXDEV` }); - }); - }, (mountFsO, { subPath: subPathO }) => { - return this.makeCallSync(newP, () => { - throw Object.assign(new Error(`EEXDEV: cross-device link not permitted`), { code: `EEXDEV` }); - }, (mountFsN, { subPath: subPathN }) => { - if (mountFsO !== mountFsN) { - throw Object.assign(new Error(`EEXDEV: cross-device link not permitted`), { code: `EEXDEV` }); - } else { - return mountFsO.renameSync(subPathO, subPathN); - } - }); - }); - } - async copyFilePromise(sourceP, destP, flags = 0) { - const fallback = async (sourceFs, sourceP2, destFs, destP2) => { - if ((flags & fs.constants.COPYFILE_FICLONE_FORCE) !== 0) - throw Object.assign(new Error(`EXDEV: cross-device clone not permitted, copyfile '${sourceP2}' -> ${destP2}'`), { code: `EXDEV` }); - if (flags & fs.constants.COPYFILE_EXCL && await this.existsPromise(sourceP2)) - throw Object.assign(new Error(`EEXIST: file already exists, copyfile '${sourceP2}' -> '${destP2}'`), { code: `EEXIST` }); - let content; - try { - content = await sourceFs.readFilePromise(sourceP2); - } catch (error) { - throw Object.assign(new Error(`EINVAL: invalid argument, copyfile '${sourceP2}' -> '${destP2}'`), { code: `EINVAL` }); - } - await destFs.writeFilePromise(destP2, content); - }; - return await this.makeCallPromise(sourceP, async () => { - return await this.makeCallPromise(destP, async () => { - return await this.baseFs.copyFilePromise(sourceP, destP, flags); - }, async (mountFsD, { subPath: subPathD }) => { - return await fallback(this.baseFs, sourceP, mountFsD, subPathD); - }); - }, async (mountFsS, { subPath: subPathS }) => { - return await this.makeCallPromise(destP, async () => { - return await fallback(mountFsS, subPathS, this.baseFs, destP); - }, async (mountFsD, { subPath: subPathD }) => { - if (mountFsS !== mountFsD) { - return await fallback(mountFsS, subPathS, mountFsD, subPathD); - } else { - return await mountFsS.copyFilePromise(subPathS, subPathD, flags); - } - }); - }); - } - copyFileSync(sourceP, destP, flags = 0) { - const fallback = (sourceFs, sourceP2, destFs, destP2) => { - if ((flags & fs.constants.COPYFILE_FICLONE_FORCE) !== 0) - throw Object.assign(new Error(`EXDEV: cross-device clone not permitted, copyfile '${sourceP2}' -> ${destP2}'`), { code: `EXDEV` }); - if (flags & fs.constants.COPYFILE_EXCL && this.existsSync(sourceP2)) - throw Object.assign(new Error(`EEXIST: file already exists, copyfile '${sourceP2}' -> '${destP2}'`), { code: `EEXIST` }); - let content; - try { - content = sourceFs.readFileSync(sourceP2); - } catch (error) { - throw Object.assign(new Error(`EINVAL: invalid argument, copyfile '${sourceP2}' -> '${destP2}'`), { code: `EINVAL` }); - } - destFs.writeFileSync(destP2, content); - }; - return this.makeCallSync(sourceP, () => { - return this.makeCallSync(destP, () => { - return this.baseFs.copyFileSync(sourceP, destP, flags); - }, (mountFsD, { subPath: subPathD }) => { - return fallback(this.baseFs, sourceP, mountFsD, subPathD); - }); - }, (mountFsS, { subPath: subPathS }) => { - return this.makeCallSync(destP, () => { - return fallback(mountFsS, subPathS, this.baseFs, destP); - }, (mountFsD, { subPath: subPathD }) => { - if (mountFsS !== mountFsD) { - return fallback(mountFsS, subPathS, mountFsD, subPathD); - } else { - return mountFsS.copyFileSync(subPathS, subPathD, flags); - } - }); - }); - } - async appendFilePromise(p, content, opts) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.appendFilePromise(p, content, opts); - }, async (mountFs, { subPath }) => { - return await mountFs.appendFilePromise(subPath, content, opts); - }); - } - appendFileSync(p, content, opts) { - return this.makeCallSync(p, () => { - return this.baseFs.appendFileSync(p, content, opts); - }, (mountFs, { subPath }) => { - return mountFs.appendFileSync(subPath, content, opts); - }); - } - async writeFilePromise(p, content, opts) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.writeFilePromise(p, content, opts); - }, async (mountFs, { subPath }) => { - return await mountFs.writeFilePromise(subPath, content, opts); - }); - } - writeFileSync(p, content, opts) { - return this.makeCallSync(p, () => { - return this.baseFs.writeFileSync(p, content, opts); - }, (mountFs, { subPath }) => { - return mountFs.writeFileSync(subPath, content, opts); - }); - } - async unlinkPromise(p) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.unlinkPromise(p); - }, async (mountFs, { subPath }) => { - return await mountFs.unlinkPromise(subPath); - }); - } - unlinkSync(p) { - return this.makeCallSync(p, () => { - return this.baseFs.unlinkSync(p); - }, (mountFs, { subPath }) => { - return mountFs.unlinkSync(subPath); - }); - } - async utimesPromise(p, atime, mtime) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.utimesPromise(p, atime, mtime); - }, async (mountFs, { subPath }) => { - return await mountFs.utimesPromise(subPath, atime, mtime); - }); - } - utimesSync(p, atime, mtime) { - return this.makeCallSync(p, () => { - return this.baseFs.utimesSync(p, atime, mtime); - }, (mountFs, { subPath }) => { - return mountFs.utimesSync(subPath, atime, mtime); - }); - } - async lutimesPromise(p, atime, mtime) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.lutimesPromise(p, atime, mtime); - }, async (mountFs, { subPath }) => { - return await mountFs.lutimesPromise(subPath, atime, mtime); - }); - } - lutimesSync(p, atime, mtime) { - return this.makeCallSync(p, () => { - return this.baseFs.lutimesSync(p, atime, mtime); - }, (mountFs, { subPath }) => { - return mountFs.lutimesSync(subPath, atime, mtime); - }); - } - async mkdirPromise(p, opts) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.mkdirPromise(p, opts); - }, async (mountFs, { subPath }) => { - return await mountFs.mkdirPromise(subPath, opts); - }); - } - mkdirSync(p, opts) { - return this.makeCallSync(p, () => { - return this.baseFs.mkdirSync(p, opts); - }, (mountFs, { subPath }) => { - return mountFs.mkdirSync(subPath, opts); - }); - } - async rmdirPromise(p, opts) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.rmdirPromise(p, opts); - }, async (mountFs, { subPath }) => { - return await mountFs.rmdirPromise(subPath, opts); - }); - } - rmdirSync(p, opts) { - return this.makeCallSync(p, () => { - return this.baseFs.rmdirSync(p, opts); - }, (mountFs, { subPath }) => { - return mountFs.rmdirSync(subPath, opts); - }); - } - async rmPromise(p, opts) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.rmPromise(p, opts); - }, async (mountFs, { subPath }) => { - return await mountFs.rmPromise(subPath, opts); - }); - } - rmSync(p, opts) { - return this.makeCallSync(p, () => { - return this.baseFs.rmSync(p, opts); - }, (mountFs, { subPath }) => { - return mountFs.rmSync(subPath, opts); - }); - } - async linkPromise(existingP, newP) { - return await this.makeCallPromise(newP, async () => { - return await this.baseFs.linkPromise(existingP, newP); - }, async (mountFs, { subPath }) => { - return await mountFs.linkPromise(existingP, subPath); - }); - } - linkSync(existingP, newP) { - return this.makeCallSync(newP, () => { - return this.baseFs.linkSync(existingP, newP); - }, (mountFs, { subPath }) => { - return mountFs.linkSync(existingP, subPath); - }); - } - async symlinkPromise(target, p, type) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.symlinkPromise(target, p, type); - }, async (mountFs, { subPath }) => { - return await mountFs.symlinkPromise(target, subPath); - }); - } - symlinkSync(target, p, type) { - return this.makeCallSync(p, () => { - return this.baseFs.symlinkSync(target, p, type); - }, (mountFs, { subPath }) => { - return mountFs.symlinkSync(target, subPath); - }); - } - async readFilePromise(p, encoding) { - return this.makeCallPromise(p, async () => { - return await this.baseFs.readFilePromise(p, encoding); - }, async (mountFs, { subPath }) => { - return await mountFs.readFilePromise(subPath, encoding); - }); - } - readFileSync(p, encoding) { - return this.makeCallSync(p, () => { - return this.baseFs.readFileSync(p, encoding); - }, (mountFs, { subPath }) => { - return mountFs.readFileSync(subPath, encoding); - }); - } - async readdirPromise(p, opts) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.readdirPromise(p, opts); - }, async (mountFs, { subPath }) => { - return await mountFs.readdirPromise(subPath, opts); - }, { - requireSubpath: false - }); - } - readdirSync(p, opts) { - return this.makeCallSync(p, () => { - return this.baseFs.readdirSync(p, opts); - }, (mountFs, { subPath }) => { - return mountFs.readdirSync(subPath, opts); - }, { - requireSubpath: false - }); - } - async readlinkPromise(p) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.readlinkPromise(p); - }, async (mountFs, { subPath }) => { - return await mountFs.readlinkPromise(subPath); - }); - } - readlinkSync(p) { - return this.makeCallSync(p, () => { - return this.baseFs.readlinkSync(p); - }, (mountFs, { subPath }) => { - return mountFs.readlinkSync(subPath); - }); - } - async truncatePromise(p, len) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.truncatePromise(p, len); - }, async (mountFs, { subPath }) => { - return await mountFs.truncatePromise(subPath, len); - }); - } - truncateSync(p, len) { - return this.makeCallSync(p, () => { - return this.baseFs.truncateSync(p, len); - }, (mountFs, { subPath }) => { - return mountFs.truncateSync(subPath, len); - }); - } - async ftruncatePromise(fd, len) { - if ((fd & MOUNT_MASK) !== this.magic) - return this.baseFs.ftruncatePromise(fd, len); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`ftruncate`); - const [mountFs, realFd] = entry; - return mountFs.ftruncatePromise(realFd, len); - } - ftruncateSync(fd, len) { - if ((fd & MOUNT_MASK) !== this.magic) - return this.baseFs.ftruncateSync(fd, len); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`ftruncateSync`); - const [mountFs, realFd] = entry; - return mountFs.ftruncateSync(realFd, len); - } - watch(p, a, b) { - return this.makeCallSync(p, () => { - return this.baseFs.watch( - p, - a, - b - ); - }, (mountFs, { subPath }) => { - return mountFs.watch( - subPath, - a, - b - ); - }); - } - watchFile(p, a, b) { - return this.makeCallSync(p, () => { - return this.baseFs.watchFile( - p, - a, - b - ); - }, () => { - return watchFile(this, p, a, b); - }); - } - unwatchFile(p, cb) { - return this.makeCallSync(p, () => { - return this.baseFs.unwatchFile(p, cb); - }, () => { - return unwatchFile(this, p, cb); - }); - } - async makeCallPromise(p, discard, accept, { requireSubpath = true } = {}) { - if (typeof p !== `string`) - return await discard(); - const normalizedP = this.resolve(p); - const mountInfo = this.findMount(normalizedP); - if (!mountInfo) - return await discard(); - if (requireSubpath && mountInfo.subPath === `/`) - return await discard(); - return await this.getMountPromise(mountInfo.archivePath, async (mountFs) => await accept(mountFs, mountInfo)); - } - makeCallSync(p, discard, accept, { requireSubpath = true } = {}) { - if (typeof p !== `string`) - return discard(); - const normalizedP = this.resolve(p); - const mountInfo = this.findMount(normalizedP); - if (!mountInfo) - return discard(); - if (requireSubpath && mountInfo.subPath === `/`) - return discard(); - return this.getMountSync(mountInfo.archivePath, (mountFs) => accept(mountFs, mountInfo)); - } - findMount(p) { - if (this.filter && !this.filter.test(p)) - return null; - let filePath = ``; - while (true) { - const pathPartWithArchive = p.substring(filePath.length); - const mountPoint = this.getMountPoint(pathPartWithArchive, filePath); - if (!mountPoint) - return null; - filePath = this.pathUtils.join(filePath, mountPoint); - if (!this.isMount.has(filePath)) { - if (this.notMount.has(filePath)) - continue; - try { - if (this.typeCheck !== null && (this.baseFs.lstatSync(filePath).mode & fs.constants.S_IFMT) !== this.typeCheck) { - this.notMount.add(filePath); - continue; - } - } catch { - return null; - } - this.isMount.add(filePath); - } - return { - archivePath: filePath, - subPath: this.pathUtils.join(PortablePath.root, p.substring(filePath.length)) - }; - } - } - limitOpenFiles(max) { - if (this.mountInstances === null) - return; - const now = Date.now(); - let nextExpiresAt = now + this.maxAge; - let closeCount = max === null ? 0 : this.mountInstances.size - max; - for (const [path, { childFs, expiresAt, refCount }] of this.mountInstances.entries()) { - if (refCount !== 0 || childFs.hasOpenFileHandles?.()) { - continue; - } else if (now >= expiresAt) { - childFs.saveAndClose?.(); - this.mountInstances.delete(path); - closeCount -= 1; - continue; - } else if (max === null || closeCount <= 0) { - nextExpiresAt = expiresAt; - break; - } - childFs.saveAndClose?.(); - this.mountInstances.delete(path); - closeCount -= 1; - } - if (this.limitOpenFilesTimeout === null && (max === null && this.mountInstances.size > 0 || max !== null) && isFinite(nextExpiresAt)) { - this.limitOpenFilesTimeout = setTimeout(() => { - this.limitOpenFilesTimeout = null; - this.limitOpenFiles(null); - }, nextExpiresAt - now).unref(); - } - } - async getMountPromise(p, accept) { - if (this.mountInstances) { - let cachedMountFs = this.mountInstances.get(p); - if (!cachedMountFs) { - const createFsInstance = await this.factoryPromise(this.baseFs, p); - cachedMountFs = this.mountInstances.get(p); - if (!cachedMountFs) { - cachedMountFs = { - childFs: createFsInstance(), - expiresAt: 0, - refCount: 0 - }; - } - } - this.mountInstances.delete(p); - this.limitOpenFiles(this.maxOpenFiles - 1); - this.mountInstances.set(p, cachedMountFs); - cachedMountFs.expiresAt = Date.now() + this.maxAge; - cachedMountFs.refCount += 1; - try { - return await accept(cachedMountFs.childFs); - } finally { - cachedMountFs.refCount -= 1; - } - } else { - const mountFs = (await this.factoryPromise(this.baseFs, p))(); - try { - return await accept(mountFs); - } finally { - mountFs.saveAndClose?.(); - } - } - } - getMountSync(p, accept) { - if (this.mountInstances) { - let cachedMountFs = this.mountInstances.get(p); - if (!cachedMountFs) { - cachedMountFs = { - childFs: this.factorySync(this.baseFs, p), - expiresAt: 0, - refCount: 0 - }; - } - this.mountInstances.delete(p); - this.limitOpenFiles(this.maxOpenFiles - 1); - this.mountInstances.set(p, cachedMountFs); - cachedMountFs.expiresAt = Date.now() + this.maxAge; - return accept(cachedMountFs.childFs); - } else { - const childFs = this.factorySync(this.baseFs, p); - try { - return accept(childFs); - } finally { - childFs.saveAndClose?.(); - } - } - } -} - -class PosixFS extends ProxiedFS { - constructor(baseFs) { - super(npath); - this.baseFs = baseFs; - } - mapFromBase(path) { - return npath.fromPortablePath(path); - } - mapToBase(path) { - return npath.toPortablePath(path); - } -} - -const NUMBER_REGEXP = /^[0-9]+$/; -const VIRTUAL_REGEXP = /^(\/(?:[^/]+\/)*?(?:\$\$virtual|__virtual__))((?:\/((?:[^/]+-)?[a-f0-9]+)(?:\/([^/]+))?)?((?:\/.*)?))$/; -const VALID_COMPONENT = /^([^/]+-)?[a-f0-9]+$/; -class VirtualFS extends ProxiedFS { - constructor({ baseFs = new NodeFS() } = {}) { - super(ppath); - this.baseFs = baseFs; - } - static makeVirtualPath(base, component, to) { - if (ppath.basename(base) !== `__virtual__`) - throw new Error(`Assertion failed: Virtual folders must be named "__virtual__"`); - if (!ppath.basename(component).match(VALID_COMPONENT)) - throw new Error(`Assertion failed: Virtual components must be ended by an hexadecimal hash`); - const target = ppath.relative(ppath.dirname(base), to); - const segments = target.split(`/`); - let depth = 0; - while (depth < segments.length && segments[depth] === `..`) - depth += 1; - const finalSegments = segments.slice(depth); - const fullVirtualPath = ppath.join(base, component, String(depth), ...finalSegments); - return fullVirtualPath; - } - static resolveVirtual(p) { - const match = p.match(VIRTUAL_REGEXP); - if (!match || !match[3] && match[5]) - return p; - const target = ppath.dirname(match[1]); - if (!match[3] || !match[4]) - return target; - const isnum = NUMBER_REGEXP.test(match[4]); - if (!isnum) - return p; - const depth = Number(match[4]); - const backstep = `../`.repeat(depth); - const subpath = match[5] || `.`; - return VirtualFS.resolveVirtual(ppath.join(target, backstep, subpath)); - } - getExtractHint(hints) { - return this.baseFs.getExtractHint(hints); - } - getRealPath() { - return this.baseFs.getRealPath(); - } - realpathSync(p) { - const match = p.match(VIRTUAL_REGEXP); - if (!match) - return this.baseFs.realpathSync(p); - if (!match[5]) - return p; - const realpath = this.baseFs.realpathSync(this.mapToBase(p)); - return VirtualFS.makeVirtualPath(match[1], match[3], realpath); - } - async realpathPromise(p) { - const match = p.match(VIRTUAL_REGEXP); - if (!match) - return await this.baseFs.realpathPromise(p); - if (!match[5]) - return p; - const realpath = await this.baseFs.realpathPromise(this.mapToBase(p)); - return VirtualFS.makeVirtualPath(match[1], match[3], realpath); - } - mapToBase(p) { - if (p === ``) - return p; - if (this.pathUtils.isAbsolute(p)) - return VirtualFS.resolveVirtual(p); - const resolvedRoot = VirtualFS.resolveVirtual(this.baseFs.resolve(PortablePath.dot)); - const resolvedP = VirtualFS.resolveVirtual(this.baseFs.resolve(p)); - return ppath.relative(resolvedRoot, resolvedP) || PortablePath.dot; - } - mapFromBase(p) { - return p; - } -} - -const URL = Number(process.versions.node.split('.', 1)[0]) < 20 ? url.URL : globalThis.URL; - -class NodePathFS extends ProxiedFS { - constructor(baseFs) { - super(npath); - this.baseFs = baseFs; - } - mapFromBase(path) { - return path; - } - mapToBase(path) { - if (typeof path === `string`) - return path; - if (path instanceof URL) - return url.fileURLToPath(path); - if (Buffer.isBuffer(path)) { - const str = path.toString(); - if (!isUtf8(path, str)) - throw new Error(`Non-utf8 buffers are not supported at the moment. Please upvote the following issue if you encounter this error: https://github.com/yarnpkg/berry/issues/4942`); - return str; - } - throw new Error(`Unsupported path type: ${nodeUtils.inspect(path)}`); - } -} -function isUtf8(buf, str) { - if (typeof buffer__default.default.isUtf8 !== `undefined`) - return buffer__default.default.isUtf8(buf); - return Buffer.byteLength(str) === buf.byteLength; -} - -var _a, _b, _c, _d; -const kBaseFs = Symbol(`kBaseFs`); -const kFd = Symbol(`kFd`); -const kClosePromise = Symbol(`kClosePromise`); -const kCloseResolve = Symbol(`kCloseResolve`); -const kCloseReject = Symbol(`kCloseReject`); -const kRefs = Symbol(`kRefs`); -const kRef = Symbol(`kRef`); -const kUnref = Symbol(`kUnref`); -class FileHandle { - constructor(fd, baseFs) { - this[_a] = 1; - this[_b] = void 0; - this[_c] = void 0; - this[_d] = void 0; - this[kBaseFs] = baseFs; - this[kFd] = fd; - } - get fd() { - return this[kFd]; - } - async appendFile(data, options) { - try { - this[kRef](this.appendFile); - const encoding = (typeof options === `string` ? options : options?.encoding) ?? void 0; - return await this[kBaseFs].appendFilePromise(this.fd, data, encoding ? { encoding } : void 0); - } finally { - this[kUnref](); - } - } - async chown(uid, gid) { - try { - this[kRef](this.chown); - return await this[kBaseFs].fchownPromise(this.fd, uid, gid); - } finally { - this[kUnref](); - } - } - async chmod(mode) { - try { - this[kRef](this.chmod); - return await this[kBaseFs].fchmodPromise(this.fd, mode); - } finally { - this[kUnref](); - } - } - createReadStream(options) { - return this[kBaseFs].createReadStream(null, { ...options, fd: this.fd }); - } - createWriteStream(options) { - return this[kBaseFs].createWriteStream(null, { ...options, fd: this.fd }); - } - datasync() { - throw new Error(`Method not implemented.`); - } - sync() { - throw new Error(`Method not implemented.`); - } - async read(bufferOrOptions, offset, length, position) { - try { - this[kRef](this.read); - let buffer; - if (!Buffer.isBuffer(bufferOrOptions)) { - bufferOrOptions ??= {}; - buffer = bufferOrOptions.buffer ?? Buffer.alloc(16384); - offset = bufferOrOptions.offset || 0; - length = bufferOrOptions.length ?? buffer.byteLength; - position = bufferOrOptions.position ?? null; - } else { - buffer = bufferOrOptions; - } - offset ??= 0; - length ??= 0; - if (length === 0) { - return { - bytesRead: length, - buffer - }; - } - const bytesRead = await this[kBaseFs].readPromise(this.fd, buffer, offset, length, position); - return { - bytesRead, - buffer - }; - } finally { - this[kUnref](); - } - } - async readFile(options) { - try { - this[kRef](this.readFile); - const encoding = (typeof options === `string` ? options : options?.encoding) ?? void 0; - return await this[kBaseFs].readFilePromise(this.fd, encoding); - } finally { - this[kUnref](); - } - } - readLines(options) { - return readline.createInterface({ - input: this.createReadStream(options), - crlfDelay: Infinity - }); - } - async stat(opts) { - try { - this[kRef](this.stat); - return await this[kBaseFs].fstatPromise(this.fd, opts); - } finally { - this[kUnref](); - } - } - async truncate(len) { - try { - this[kRef](this.truncate); - return await this[kBaseFs].ftruncatePromise(this.fd, len); - } finally { - this[kUnref](); - } - } - utimes(atime, mtime) { - throw new Error(`Method not implemented.`); - } - async writeFile(data, options) { - try { - this[kRef](this.writeFile); - const encoding = (typeof options === `string` ? options : options?.encoding) ?? void 0; - await this[kBaseFs].writeFilePromise(this.fd, data, encoding); - } finally { - this[kUnref](); - } - } - async write(...args) { - try { - this[kRef](this.write); - if (ArrayBuffer.isView(args[0])) { - const [buffer, offset, length, position] = args; - const bytesWritten = await this[kBaseFs].writePromise(this.fd, buffer, offset ?? void 0, length ?? void 0, position ?? void 0); - return { bytesWritten, buffer }; - } else { - const [data, position, encoding] = args; - const bytesWritten = await this[kBaseFs].writePromise(this.fd, data, position, encoding); - return { bytesWritten, buffer: data }; - } - } finally { - this[kUnref](); - } - } - async writev(buffers, position) { - try { - this[kRef](this.writev); - let bytesWritten = 0; - if (typeof position !== `undefined`) { - for (const buffer of buffers) { - const writeResult = await this.write(buffer, void 0, void 0, position); - bytesWritten += writeResult.bytesWritten; - position += writeResult.bytesWritten; - } - } else { - for (const buffer of buffers) { - const writeResult = await this.write(buffer); - bytesWritten += writeResult.bytesWritten; - } - } - return { - buffers, - bytesWritten - }; - } finally { - this[kUnref](); - } - } - readv(buffers, position) { - throw new Error(`Method not implemented.`); - } - close() { - if (this[kFd] === -1) - return Promise.resolve(); - if (this[kClosePromise]) - return this[kClosePromise]; - this[kRefs]--; - if (this[kRefs] === 0) { - const fd = this[kFd]; - this[kFd] = -1; - this[kClosePromise] = this[kBaseFs].closePromise(fd).finally(() => { - this[kClosePromise] = void 0; - }); - } else { - this[kClosePromise] = new Promise((resolve, reject) => { - this[kCloseResolve] = resolve; - this[kCloseReject] = reject; - }).finally(() => { - this[kClosePromise] = void 0; - this[kCloseReject] = void 0; - this[kCloseResolve] = void 0; - }); - } - return this[kClosePromise]; - } - [(_a = kRefs, _b = kClosePromise, _c = kCloseResolve, _d = kCloseReject, kRef)](caller) { - if (this[kFd] === -1) { - const err = new Error(`file closed`); - err.code = `EBADF`; - err.syscall = caller.name; - throw err; - } - this[kRefs]++; - } - [kUnref]() { - this[kRefs]--; - if (this[kRefs] === 0) { - const fd = this[kFd]; - this[kFd] = -1; - this[kBaseFs].closePromise(fd).then(this[kCloseResolve], this[kCloseReject]); - } - } -} - -const SYNC_IMPLEMENTATIONS = /* @__PURE__ */ new Set([ - `accessSync`, - `appendFileSync`, - `createReadStream`, - `createWriteStream`, - `chmodSync`, - `fchmodSync`, - `chownSync`, - `fchownSync`, - `closeSync`, - `copyFileSync`, - `linkSync`, - `lstatSync`, - `fstatSync`, - `lutimesSync`, - `mkdirSync`, - `openSync`, - `opendirSync`, - `readlinkSync`, - `readFileSync`, - `readdirSync`, - `readlinkSync`, - `realpathSync`, - `renameSync`, - `rmdirSync`, - `rmSync`, - `statSync`, - `symlinkSync`, - `truncateSync`, - `ftruncateSync`, - `unlinkSync`, - `unwatchFile`, - `utimesSync`, - `watch`, - `watchFile`, - `writeFileSync`, - `writeSync` -]); -const ASYNC_IMPLEMENTATIONS = /* @__PURE__ */ new Set([ - `accessPromise`, - `appendFilePromise`, - `fchmodPromise`, - `chmodPromise`, - `fchownPromise`, - `chownPromise`, - `closePromise`, - `copyFilePromise`, - `linkPromise`, - `fstatPromise`, - `lstatPromise`, - `lutimesPromise`, - `mkdirPromise`, - `openPromise`, - `opendirPromise`, - `readdirPromise`, - `realpathPromise`, - `readFilePromise`, - `readdirPromise`, - `readlinkPromise`, - `renamePromise`, - `rmdirPromise`, - `rmPromise`, - `statPromise`, - `symlinkPromise`, - `truncatePromise`, - `ftruncatePromise`, - `unlinkPromise`, - `utimesPromise`, - `writeFilePromise`, - `writeSync` -]); -function patchFs(patchedFs, fakeFs) { - fakeFs = new NodePathFS(fakeFs); - const setupFn = (target, name, replacement) => { - const orig = target[name]; - target[name] = replacement; - if (typeof orig?.[nodeUtils.promisify.custom] !== `undefined`) { - replacement[nodeUtils.promisify.custom] = orig[nodeUtils.promisify.custom]; - } - }; - { - setupFn(patchedFs, `exists`, (p, ...args) => { - const hasCallback = typeof args[args.length - 1] === `function`; - const callback = hasCallback ? args.pop() : () => { - }; - process.nextTick(() => { - fakeFs.existsPromise(p).then((exists) => { - callback(exists); - }, () => { - callback(false); - }); - }); - }); - setupFn(patchedFs, `read`, (...args) => { - let [fd, buffer, offset, length, position, callback] = args; - if (args.length <= 3) { - let options = {}; - if (args.length < 3) { - callback = args[1]; - } else { - options = args[1]; - callback = args[2]; - } - ({ - buffer = Buffer.alloc(16384), - offset = 0, - length = buffer.byteLength, - position - } = options); - } - if (offset == null) - offset = 0; - length |= 0; - if (length === 0) { - process.nextTick(() => { - callback(null, 0, buffer); - }); - return; - } - if (position == null) - position = -1; - process.nextTick(() => { - fakeFs.readPromise(fd, buffer, offset, length, position).then((bytesRead) => { - callback(null, bytesRead, buffer); - }, (error) => { - callback(error, 0, buffer); - }); - }); - }); - for (const fnName of ASYNC_IMPLEMENTATIONS) { - const origName = fnName.replace(/Promise$/, ``); - if (typeof patchedFs[origName] === `undefined`) - continue; - const fakeImpl = fakeFs[fnName]; - if (typeof fakeImpl === `undefined`) - continue; - const wrapper = (...args) => { - const hasCallback = typeof args[args.length - 1] === `function`; - const callback = hasCallback ? args.pop() : () => { - }; - process.nextTick(() => { - fakeImpl.apply(fakeFs, args).then((result) => { - callback(null, result); - }, (error) => { - callback(error); - }); - }); - }; - setupFn(patchedFs, origName, wrapper); - } - patchedFs.realpath.native = patchedFs.realpath; - } - { - setupFn(patchedFs, `existsSync`, (p) => { - try { - return fakeFs.existsSync(p); - } catch (error) { - return false; - } - }); - setupFn(patchedFs, `readSync`, (...args) => { - let [fd, buffer, offset, length, position] = args; - if (args.length <= 3) { - const options = args[2] || {}; - ({ offset = 0, length = buffer.byteLength, position } = options); - } - if (offset == null) - offset = 0; - length |= 0; - if (length === 0) - return 0; - if (position == null) - position = -1; - return fakeFs.readSync(fd, buffer, offset, length, position); - }); - for (const fnName of SYNC_IMPLEMENTATIONS) { - const origName = fnName; - if (typeof patchedFs[origName] === `undefined`) - continue; - const fakeImpl = fakeFs[fnName]; - if (typeof fakeImpl === `undefined`) - continue; - setupFn(patchedFs, origName, fakeImpl.bind(fakeFs)); - } - patchedFs.realpathSync.native = patchedFs.realpathSync; - } - { - const patchedFsPromises = patchedFs.promises; - for (const fnName of ASYNC_IMPLEMENTATIONS) { - const origName = fnName.replace(/Promise$/, ``); - if (typeof patchedFsPromises[origName] === `undefined`) - continue; - const fakeImpl = fakeFs[fnName]; - if (typeof fakeImpl === `undefined`) - continue; - if (fnName === `open`) - continue; - setupFn(patchedFsPromises, origName, (pathLike, ...args) => { - if (pathLike instanceof FileHandle) { - return pathLike[origName].apply(pathLike, args); - } else { - return fakeImpl.call(fakeFs, pathLike, ...args); - } - }); - } - setupFn(patchedFsPromises, `open`, async (...args) => { - const fd = await fakeFs.openPromise(...args); - return new FileHandle(fd, fakeFs); - }); - } - { - patchedFs.read[nodeUtils.promisify.custom] = async (fd, buffer, ...args) => { - const res = fakeFs.readPromise(fd, buffer, ...args); - return { bytesRead: await res, buffer }; - }; - patchedFs.write[nodeUtils.promisify.custom] = async (fd, buffer, ...args) => { - const res = fakeFs.writePromise(fd, buffer, ...args); - return { bytesWritten: await res, buffer }; - }; - } -} - -let cachedInstance; -let registeredFactory = () => { - throw new Error(`Assertion failed: No libzip instance is available, and no factory was configured`); -}; -function setFactory(factory) { - registeredFactory = factory; -} -function getInstance() { - if (typeof cachedInstance === `undefined`) - cachedInstance = registeredFactory(); - return cachedInstance; -} - -var libzipSync = {exports: {}}; - -(function (module, exports) { -var frozenFs = Object.assign({}, fs__default.default); -var createModule = function() { - var _scriptDir = void 0; - if (typeof __filename !== "undefined") - _scriptDir = _scriptDir || __filename; - return function(createModule2) { - createModule2 = createModule2 || {}; - var Module = typeof createModule2 !== "undefined" ? createModule2 : {}; - var readyPromiseResolve, readyPromiseReject; - Module["ready"] = new Promise(function(resolve, reject) { - readyPromiseResolve = resolve; - readyPromiseReject = reject; - }); - var moduleOverrides = {}; - var key; - for (key in Module) { - if (Module.hasOwnProperty(key)) { - moduleOverrides[key] = Module[key]; - } - } - var scriptDirectory = ""; - function locateFile(path) { - if (Module["locateFile"]) { - return Module["locateFile"](path, scriptDirectory); - } - return scriptDirectory + path; - } - var read_, readBinary; - var nodeFS; - var nodePath; - { - { - scriptDirectory = __dirname + "/"; - } - read_ = function shell_read(filename, binary) { - var ret = tryParseAsDataURI(filename); - if (ret) { - return binary ? ret : ret.toString(); - } - if (!nodeFS) - nodeFS = frozenFs; - if (!nodePath) - nodePath = path__default.default; - filename = nodePath["normalize"](filename); - return nodeFS["readFileSync"](filename, binary ? null : "utf8"); - }; - readBinary = function readBinary2(filename) { - var ret = read_(filename, true); - if (!ret.buffer) { - ret = new Uint8Array(ret); - } - assert(ret.buffer); - return ret; - }; - if (process["argv"].length > 1) { - process["argv"][1].replace(/\\/g, "/"); - } - process["argv"].slice(2); - Module["inspect"] = function() { - return "[Emscripten Module object]"; - }; - } - Module["print"] || console.log.bind(console); - var err = Module["printErr"] || console.warn.bind(console); - for (key in moduleOverrides) { - if (moduleOverrides.hasOwnProperty(key)) { - Module[key] = moduleOverrides[key]; - } - } - moduleOverrides = null; - if (Module["arguments"]) - ; - if (Module["thisProgram"]) - ; - if (Module["quit"]) - ; - var wasmBinary; - if (Module["wasmBinary"]) - wasmBinary = Module["wasmBinary"]; - Module["noExitRuntime"] || true; - if (typeof WebAssembly !== "object") { - abort("no native wasm support detected"); - } - function getValue(ptr, type, noSafe) { - type = type || "i8"; - if (type.charAt(type.length - 1) === "*") - type = "i32"; - switch (type) { - case "i1": - return HEAP8[ptr >> 0]; - case "i8": - return HEAP8[ptr >> 0]; - case "i16": - return LE_HEAP_LOAD_I16((ptr >> 1) * 2); - case "i32": - return LE_HEAP_LOAD_I32((ptr >> 2) * 4); - case "i64": - return LE_HEAP_LOAD_I32((ptr >> 2) * 4); - case "float": - return LE_HEAP_LOAD_F32((ptr >> 2) * 4); - case "double": - return LE_HEAP_LOAD_F64((ptr >> 3) * 8); - default: - abort("invalid type for getValue: " + type); - } - return null; - } - var wasmMemory; - var ABORT = false; - function assert(condition, text) { - if (!condition) { - abort("Assertion failed: " + text); - } - } - function getCFunc(ident) { - var func = Module["_" + ident]; - assert( - func, - "Cannot call unknown function " + ident + ", make sure it is exported" - ); - return func; - } - function ccall(ident, returnType, argTypes, args, opts) { - var toC = { - string: function(str) { - var ret2 = 0; - if (str !== null && str !== void 0 && str !== 0) { - var len = (str.length << 2) + 1; - ret2 = stackAlloc(len); - stringToUTF8(str, ret2, len); - } - return ret2; - }, - array: function(arr) { - var ret2 = stackAlloc(arr.length); - writeArrayToMemory(arr, ret2); - return ret2; - } - }; - function convertReturnValue(ret2) { - if (returnType === "string") - return UTF8ToString(ret2); - if (returnType === "boolean") - return Boolean(ret2); - return ret2; - } - var func = getCFunc(ident); - var cArgs = []; - var stack = 0; - if (args) { - for (var i = 0; i < args.length; i++) { - var converter = toC[argTypes[i]]; - if (converter) { - if (stack === 0) - stack = stackSave(); - cArgs[i] = converter(args[i]); - } else { - cArgs[i] = args[i]; - } - } - } - var ret = func.apply(null, cArgs); - ret = convertReturnValue(ret); - if (stack !== 0) - stackRestore(stack); - return ret; - } - function cwrap(ident, returnType, argTypes, opts) { - argTypes = argTypes || []; - var numericArgs = argTypes.every(function(type) { - return type === "number"; - }); - var numericRet = returnType !== "string"; - if (numericRet && numericArgs && !opts) { - return getCFunc(ident); - } - return function() { - return ccall(ident, returnType, argTypes, arguments); - }; - } - var UTF8Decoder = new TextDecoder("utf8"); - function UTF8ToString(ptr, maxBytesToRead) { - if (!ptr) - return ""; - var maxPtr = ptr + maxBytesToRead; - for (var end = ptr; !(end >= maxPtr) && HEAPU8[end]; ) - ++end; - return UTF8Decoder.decode(HEAPU8.subarray(ptr, end)); - } - function stringToUTF8Array(str, heap, outIdx, maxBytesToWrite) { - if (!(maxBytesToWrite > 0)) - return 0; - var startIdx = outIdx; - var endIdx = outIdx + maxBytesToWrite - 1; - for (var i = 0; i < str.length; ++i) { - var u = str.charCodeAt(i); - if (u >= 55296 && u <= 57343) { - var u1 = str.charCodeAt(++i); - u = 65536 + ((u & 1023) << 10) | u1 & 1023; - } - if (u <= 127) { - if (outIdx >= endIdx) - break; - heap[outIdx++] = u; - } else if (u <= 2047) { - if (outIdx + 1 >= endIdx) - break; - heap[outIdx++] = 192 | u >> 6; - heap[outIdx++] = 128 | u & 63; - } else if (u <= 65535) { - if (outIdx + 2 >= endIdx) - break; - heap[outIdx++] = 224 | u >> 12; - heap[outIdx++] = 128 | u >> 6 & 63; - heap[outIdx++] = 128 | u & 63; - } else { - if (outIdx + 3 >= endIdx) - break; - heap[outIdx++] = 240 | u >> 18; - heap[outIdx++] = 128 | u >> 12 & 63; - heap[outIdx++] = 128 | u >> 6 & 63; - heap[outIdx++] = 128 | u & 63; - } - } - heap[outIdx] = 0; - return outIdx - startIdx; - } - function stringToUTF8(str, outPtr, maxBytesToWrite) { - return stringToUTF8Array(str, HEAPU8, outPtr, maxBytesToWrite); - } - function lengthBytesUTF8(str) { - var len = 0; - for (var i = 0; i < str.length; ++i) { - var u = str.charCodeAt(i); - if (u >= 55296 && u <= 57343) - u = 65536 + ((u & 1023) << 10) | str.charCodeAt(++i) & 1023; - if (u <= 127) - ++len; - else if (u <= 2047) - len += 2; - else if (u <= 65535) - len += 3; - else - len += 4; - } - return len; - } - function allocateUTF8(str) { - var size = lengthBytesUTF8(str) + 1; - var ret = _malloc(size); - if (ret) - stringToUTF8Array(str, HEAP8, ret, size); - return ret; - } - function writeArrayToMemory(array, buffer2) { - HEAP8.set(array, buffer2); - } - function alignUp(x, multiple) { - if (x % multiple > 0) { - x += multiple - x % multiple; - } - return x; - } - var buffer, HEAP8, HEAPU8; - var HEAP_DATA_VIEW; - function updateGlobalBufferAndViews(buf) { - buffer = buf; - Module["HEAP_DATA_VIEW"] = HEAP_DATA_VIEW = new DataView(buf); - Module["HEAP8"] = HEAP8 = new Int8Array(buf); - Module["HEAP16"] = new Int16Array(buf); - Module["HEAP32"] = new Int32Array(buf); - Module["HEAPU8"] = HEAPU8 = new Uint8Array(buf); - Module["HEAPU16"] = new Uint16Array(buf); - Module["HEAPU32"] = new Uint32Array(buf); - Module["HEAPF32"] = new Float32Array(buf); - Module["HEAPF64"] = new Float64Array(buf); - } - Module["INITIAL_MEMORY"] || 16777216; - var wasmTable; - var __ATPRERUN__ = []; - var __ATINIT__ = []; - var __ATPOSTRUN__ = []; - function preRun() { - if (Module["preRun"]) { - if (typeof Module["preRun"] == "function") - Module["preRun"] = [Module["preRun"]]; - while (Module["preRun"].length) { - addOnPreRun(Module["preRun"].shift()); - } - } - callRuntimeCallbacks(__ATPRERUN__); - } - function initRuntime() { - callRuntimeCallbacks(__ATINIT__); - } - function postRun() { - if (Module["postRun"]) { - if (typeof Module["postRun"] == "function") - Module["postRun"] = [Module["postRun"]]; - while (Module["postRun"].length) { - addOnPostRun(Module["postRun"].shift()); - } - } - callRuntimeCallbacks(__ATPOSTRUN__); - } - function addOnPreRun(cb) { - __ATPRERUN__.unshift(cb); - } - function addOnInit(cb) { - __ATINIT__.unshift(cb); - } - function addOnPostRun(cb) { - __ATPOSTRUN__.unshift(cb); - } - var runDependencies = 0; - var dependenciesFulfilled = null; - function addRunDependency(id) { - runDependencies++; - if (Module["monitorRunDependencies"]) { - Module["monitorRunDependencies"](runDependencies); - } - } - function removeRunDependency(id) { - runDependencies--; - if (Module["monitorRunDependencies"]) { - Module["monitorRunDependencies"](runDependencies); - } - if (runDependencies == 0) { - if (dependenciesFulfilled) { - var callback = dependenciesFulfilled; - dependenciesFulfilled = null; - callback(); - } - } - } - Module["preloadedImages"] = {}; - Module["preloadedAudios"] = {}; - function abort(what) { - if (Module["onAbort"]) { - Module["onAbort"](what); - } - what += ""; - err(what); - ABORT = true; - what = "abort(" + what + "). Build with -s ASSERTIONS=1 for more info."; - var e = new WebAssembly.RuntimeError(what); - readyPromiseReject(e); - throw e; - } - var dataURIPrefix = "data:application/octet-stream;base64,"; - function isDataURI(filename) { - return filename.startsWith(dataURIPrefix); - } - var wasmBinaryFile = "data:application/octet-stream;base64,AGFzbQEAAAAB/wEkYAN/f38Bf2ABfwF/YAJ/fwF/YAF/AGAEf39/fwF/YAN/f38AYAV/f39/fwF/YAJ/fwBgBH9/f38AYAABf2AFf39/fn8BfmAEf35/fwF/YAR/f35/AX5gAn9+AX9gA398fwBgA39/fgF/YAF/AX5gBn9/f39/fwF/YAN/fn8Bf2AEf39/fwF+YAV/f35/fwF/YAR/f35/AX9gA39/fgF+YAJ/fgBgAn9/AX5gBX9/f39/AGADf35/AX5gBX5+f35/AX5gA39/fwF+YAZ/fH9/f38Bf2AAAGAHf35/f39+fwF/YAV/fn9/fwF/YAV/f39/fwF+YAJ+fwF/YAJ/fAACJQYBYQFhAAMBYQFiAAEBYQFjAAABYQFkAAEBYQFlAAIBYQFmAAED5wHlAQMAAwEDAwEHDAgDFgcNEgEDDRcFAQ8DEAUQAwIBAhgECxkEAQMBBQsFAwMDARACBAMAAggLBwEAAwADGgQDGwYGABwBBgMTFBEHBwcVCx4ABAgHBAICAgAfAQICAgIGFSAAIQAiAAIBBgIHAg0LEw0FAQUCACMDAQAUAAAGBQECBQUDCwsSAgEDBQIHAQEICAACCQQEAQABCAEBCQoBAwkBAQEBBgEGBgYABAIEBAQGEQQEAAARAAEDCQEJAQAJCQkBAQECCgoAAAMPAQEBAwACAgICBQIABwAKBgwHAAADAgICBQEEBQFwAT8/BQcBAYACgIACBgkBfwFBgInBAgsH+gEzAWcCAAFoAFQBaQDqAQFqALsBAWsAwQEBbACpAQFtAKgBAW4ApwEBbwClAQFwAKMBAXEAoAEBcgCbAQFzAMABAXQAugEBdQC5AQF2AEsBdwDiAQF4AMgBA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gAEHYABAHGgwBCyABQgA3AyAgAUEANgIYIAFC/////w83AxAgAUEAOwEMIAFBv4YoNgIIIAFBAToABiABQQA6AAQgAUIANwNIIAFBgIDYjXg2AkQgAUIANwMoIAFCADcDMCABQgA3AzggAUFAa0EAOwEAIAFCADcDUAsgAUEBOgAFIAFBADYCACABC1gCAn4BfwJAAkAgAC0AAEUNACAAKQMQIgMgAq18IgQgA1QNACAEIAApAwhYDQELIABBADoAAA8LIAAoAgQiBUUEQA8LIAAgBDcDECAFIAOnaiABIAIQBxoLlgEBAn8CQAJAIAJFBEAgAacQCSIFRQ0BQRgQCSIEDQIgBRAGDAELIAIhBUEYEAkiBA0BCyADBEAgA0EANgIEIANBDjYCAAtBAA8LIARCADcDECAEIAE3AwggBCAFNgIEIARBAToAACAEIAJFOgABIAAgBSABIAMQZUEASAR/IAQtAAEEQCAEKAIEEAYLIAQQBkEABSAECwubAgEDfyAALQAAQSBxRQRAAkAgASEDAkAgAiAAIgEoAhAiAAR/IAAFAn8gASABLQBKIgBBAWsgAHI6AEogASgCACIAQQhxBEAgASAAQSByNgIAQX8MAQsgAUIANwIEIAEgASgCLCIANgIcIAEgADYCFCABIAAgASgCMGo2AhBBAAsNASABKAIQCyABKAIUIgVrSwRAIAEgAyACIAEoAiQRAAAaDAILAn8gASwAS0F/SgRAIAIhAANAIAIgACIERQ0CGiADIARBAWsiAGotAABBCkcNAAsgASADIAQgASgCJBEAACAESQ0CIAMgBGohAyABKAIUIQUgAiAEawwBCyACCyEAIAUgAyAAEAcaIAEgASgCFCAAajYCFAsLCwvNBQEGfyAAKAIwIgNBhgJrIQYgACgCPCECIAMhAQNAIAAoAkQgAiAAKAJoIgRqayECIAEgBmogBE0EQCAAKAJIIgEgASADaiADEAcaAkAgAyAAKAJsIgFNBEAgACABIANrNgJsDAELIABCADcCbAsgACAAKAJoIANrIgE2AmggACAAKAJYIANrNgJYIAEgACgChC5JBEAgACABNgKELgsgAEH8gAEoAgARAwAgAiADaiECCwJAIAAoAgAiASgCBCIERQ0AIAAoAjwhBSAAIAIgBCACIARJGyICBH8gACgCSCAAKAJoaiAFaiEFIAEgBCACazYCBAJAAkACQAJAIAEoAhwiBCgCFEEBaw4CAQACCyAEQaABaiAFIAEoAgAgAkHcgAEoAgARCAAMAgsgASABKAIwIAUgASgCACACQcSAASgCABEEADYCMAwBCyAFIAEoAgAgAhAHGgsgASABKAIAIAJqNgIAIAEgASgCCCACajYCCCAAKAI8BSAFCyACaiICNgI8AkAgACgChC4iASACakEDSQ0AIAAoAmggAWshAQJAIAAoAnRBgQhPBEAgACAAIAAoAkggAWoiAi0AACACLQABIAAoAnwRAAA2AlQMAQsgAUUNACAAIAFBAWsgACgChAERAgAaCyAAKAKELiAAKAI8IgJBAUZrIgRFDQAgACABIAQgACgCgAERBQAgACAAKAKELiAEazYChC4gACgCPCECCyACQYUCSw0AIAAoAgAoAgRFDQAgACgCMCEBDAELCwJAIAAoAkQiAiAAKAJAIgNNDQAgAAJ/IAAoAjwgACgCaGoiASADSwRAIAAoAkggAWpBACACIAFrIgNBggIgA0GCAkkbIgMQGSABIANqDAELIAFBggJqIgEgA00NASAAKAJIIANqQQAgAiADayICIAEgA2siAyACIANJGyIDEBkgACgCQCADags2AkALC50CAQF/AkAgAAJ/IAAoAqAuIgFBwABGBEAgACgCBCAAKAIQaiAAKQOYLjcAACAAQgA3A5guIAAgACgCEEEIajYCEEEADAELIAFBIE4EQCAAKAIEIAAoAhBqIAApA5guPgAAIAAgAEGcLmo1AgA3A5guIAAgACgCEEEEajYCECAAIAAoAqAuQSBrIgE2AqAuCyABQRBOBEAgACgCBCAAKAIQaiAAKQOYLj0AACAAIAAoAhBBAmo2AhAgACAAKQOYLkIQiDcDmC4gACAAKAKgLkEQayIBNgKgLgsgAUEISA0BIAAgACgCECIBQQFqNgIQIAEgACgCBGogACkDmC48AAAgACAAKQOYLkIIiDcDmC4gACgCoC5BCGsLNgKgLgsLEAAgACgCCBAGIABBADYCCAvwAQECf0F/IQECQCAALQ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AQsgACgCNBAcIABBADYCNCAALQAFRQ0BCyAALQAAQQRxRQ0BCyAAKAI4EBAgAEEANgI4IAAtAAVFDQELIAAtAABBgAFxRQ0BCyAAKAJUIgEEfyABQQAgARAiEBkgACgCVAVBAAsQBiAAQQA2AlQLC9wMAgl/AX4jAEFAaiIGJAACQAJAAkACQAJAIAEoAjBBABAjIgVBAkZBACABKAI4QQAQIyIEQQFGGw0AIAVBAUZBACAEQQJGGw0AIAVBAkciAw0BIARBAkcNAQsgASABLwEMQYAQcjsBDEEAIQMMAQsgASABLwEMQf/vA3E7AQxBACEFIANFBEBB9eABIAEoAjAgAEEIahBpIgVFDQILIAJBgAJxBEAgBSEDDAELIARBAkcEQCAFIQMMAQtB9cYBIAEoAjggAEEIahBpIgNFBEAgBRAcDAILIAMgBTYCAAsgASABLwEMQf7/A3EgAS8BUiIFQQBHcjsBDAJAAkACQAJAAn8CQAJAIAEpAyhC/v///w9WDQAgASkDIEL+////D1YNACACQYAEcUUNASABKQNIQv////8PVA0BCyAFQYECa0H//wNxQQNJIQdBAQwBCyAFQYECa0H//wNxIQQgAkGACnFBgApHDQEgBEEDSSEHQQALIQkgBkIcEBciBEUEQCAAQQhqIgAEQCAAQQA2AgQgAEEONgIACyADEBwMBQsgAkGACHEhBQJAAkAgAkGAAnEEQAJAIAUNACABKQMgQv////8PVg0AIAEpAyhCgICAgBBUDQMLIAQgASkDKBAYIAEpAyAhDAwBCwJAAkACQCAFDQAgASkDIEL/////D1YNACABKQMoIgxC/////w9WDQEgASkDSEKAgICAEFQNBAsgASkDKCIMQv////8PVA0BCyAEIAwQGAsgASkDICIMQv////8PWgRAIAQgDBAYCyABKQNIIgxC/////w9UDQELIAQgDBAYCyAELQAARQRAIABBCGoiAARAIABBADYCBCAAQRQ2AgALIAQQCCADEBwMBQtBASEKQQEgBC0AAAR+IAQpAxAFQgALp0H//wNxIAYQRyEFIAQQCCAFIAM2AgAgBw0BDAILIAMhBSAEQQJLDQELIAZCBxAXIgRFBEA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BlNDQEgBygCjEdFDQEgB0HR/gA2AgQgAEG5DDYCGAsgASECIAshBQwFCwJAIA5FBEAgDCARIAZraiEDDAELIAYgDk0EQCAMIA4gBmtqIQMMAQsgDCARIAYgDmsiBmtqIQMgBSAGTQ0AIAUgBmshBQJAAkAgASADTSABIA8gAWusIhogBq0iGyAaIBtUGyIapyIGaiICIANLcQ0AIAMgBmogAUsgASADT3ENACABIAMgBhAHGiACIQEMAQsgASADIAMgAWsiASABQR91IgFqIAFzIgIQByACaiEBIBogAq0iHn0iHFANACACIANqIQIDQAJAIBwgHiAcIB5UGyIbQiBUBEAgGyEaDAELIBsiGkIgfSIgQgWIQgF8QgODIh9QRQRAA0AgASACKQAANwAAIAEgAikAGDcAGCABIAIpABA3ABAgASACKQAINwAIIBpCIH0hGiACQSBqIQIgAUEgaiEBIB9CAX0iH0IAUg0ACwsgIELgAFQNAANAIAEgAikAADcAACABIAIpABg3ABggASACKQAQNwAQIAEgAikACDcACCABIAIpADg3ADggASACKQAwNwAwIAEgAikAKDcAKCABIAIpACA3ACAgASACKQBYNwBYIAEgAikAUDcAUCABIAIpAEg3AEggASACKQBANwBAIAEgAikAYDcAYCABIAIpAGg3AGggASACKQBwNwBwIAEgAikAeDcAeCACQYABaiECIAFBgAFqIQEgGkKAAX0iGkIfVg0ACwsgGkIQWgRAIAEgAikAADcAACABIAIpAAg3AAggGkIQfSEaIAJBEGohAiABQRBqIQELIBpCCFoEQCABIAIpAAA3AAAgGkIIfSEaIAJBCGohAiABQQhqIQELIBpCBFoEQCABIAIoAAA2AAAgGkIEfSEaIAJBBGohAiABQQRqIQELIBpCAloEQCABIAIvAAA7AAAgGkICfSEaIAJBAmohAiABQQJqIQELIBwgG30hHCAaUEUEQCABIAItAAA6AAAgAkEBaiECIAFBAWohAQsgHEIAUg0ACwsgDiEGIAwhAwsgBSAGSwRAAkACQCABIANNIAEgDyABa6wiGiAGrSIbIBogG1QbIhqnIglqIgIgA0txDQAgAyAJaiABSyABIANPcQ0A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AJAIBwgHiAcIB5UGyIbQiBUBEAgGyEaDAELIBsiGkIgfSIgQgWIQgF8QgODIh9QRQRAA0AgAiABKQAANwAAIAIgASkAGDcAGCACIAEpABA3ABAgAiABKQAINwAIIBpCIH0hGiABQSBqIQEgAkEgaiECIB9CAX0iH0IAUg0ACwsgIELgAFQNAANAIAIgASkAADcAACACIAEpABg3ABggAiABKQAQNwAQIAIgASkACDcACCACIAEpADg3ADggAiABKQAwNwAwIAIgASkAKDcAKCACIAEpACA3ACAgAiABKQBYNwBYIAIgASkAUDcAUCACIAEpAEg3AEggAiABKQBANwBAIAIgASkAYDcAYCACIAEpAGg3AGggAiABKQBwNwBwIAIgASkAeDcAeCABQYABaiEBIAJBgAFqIQIgGkKAAX0iGkIfVg0ACwsgGkIQWgRAIAIgASkAADcAACACIAEpAAg3AAggGkIQfSEaIAJBEGohAiABQRBqIQELIBpCCFoEQCACIAEpAAA3AAAgGkIIfSEaIAJBCGohAiABQQhqIQELIBpCBFoEQCACIAEoAAA2AAAgGkIEfSEaIAJBBGohAiABQQRqIQELIBpCAloEQCACIAEvAAA7AAAgGkICfSEaIAJBAmohAiABQQJqIQELIBwgG30hHCAaUEUEQCACIAEtAAA6AAAgAkEBaiECIAFBAWohAQsgHFBFDQALDAILAkAgASADTSABIA8gAWusIhogBa0iGyAaIBtUGyIapyIEaiICIANLcQ0AIAMgBGogAUsgASADT3ENACABIAMgBBAHGgwCCyABIAMgAyABayIBIAFBH3UiAWogAXMiARAHIAFqIQIgGiABrSIefSIcUA0BIAEgA2ohAQNAAkAgHCAeIBwgHlQbIhtCIFQEQCAbIRoMAQsgGyIaQiB9IiBCBYhCAXxCA4MiH1BFBEADQCACIAEpAAA3AAAgAiABKQAYNwAYIAIgASkAEDcAECACIAEpAAg3AAggGkIgfSEaIAFBIGohASACQSBqIQIgH0IBfSIfQgBSDQALCyAgQuAAVA0AA0AgAiABKQAANwAAIAIgASkAGDcAGCACIAEpABA3ABAgAiABKQAINwAIIAIgASkAODcAOCACIAEpADA3ADAgAiABKQAoNwAoIAIgASkAIDcAICACIAEpAFg3AFggAiABKQBQNwBQIAIgASkASDcASCACIAEpAEA3AEAgAiABKQBgNwBgIAIgASkAaDcAaCACIAEpAHA3AHAgAiABKQB4NwB4IAFBgAFqIQEgAkGAAWohAiAaQoABfSIaQh9WDQALCyAaQhBaBEAgAiABKQAANwAAIAIgASkACDcACCAaQhB9IRogAkEQaiECIAFBEGohAQsgGkIIWgRAIAIgASkAADcAACAaQgh9IRogAkEIaiECIAFBCGohAQsgGkIEWgRAIAIgASgAADYAACAaQgR9IRogAkEEaiECIAFBBGohAQsgGkICWgRAIAIgAS8AADsAACAaQgJ9IRogAkECaiECIAFBAmohAQsgHCAbfSEcIBpQRQRAIAIgAS0AADoAACACQQFqIQIgAUEBaiEBCyAcUEUNAAsMAQsCQAJAIBYEQAJAIAQgBUkEQCAHKAKYRyAESw0BCyABIARrIQMCQEEAIARrIgVBf0ogDyABa6wiGiAbIBogG1QbIhqnIgIgBUpxDQAgBUEBSCACIANqIAFLcQ0AIAEgAyACEAcgAmohAgwFCyABIAMgBCAEQR91IgFqIAFzIgEQByABaiECIBogAa0iHn0iHFANBCABIANqIQEDQAJAIBwgHiAcIB5UGyIbQiBUBEAgGyEaDAELIBsiGkIgfSIgQgWIQgF8QgODIh9QRQRAA0AgAiABKQAANwAAIAIgASkAGDcAGCACIAEpABA3ABAgAiABKQAINwAIIBpCIH0hGiABQSBqIQEgAkEgaiECIB9CAX0iH0IAUg0ACwsgIELgAFQNAANAIAIgASkAADcAACACIAEpABg3ABggAiABKQAQNwAQIAIgASkACDcACCACIAEpADg3ADggAiABKQAwNwAwIAIgASkAKDcAKCACIAEpACA3ACAgAiABKQBYNwBYIAIgASkAUDcAUCACIAEpAEg3AEggAiABKQBANwBAIAIgASkAYDcAYCACIAEpAGg3AGggAiABKQBwNwBwIAIgASkAeDcAeCABQYABaiEBIAJBgAFqIQIgGkKAAX0iGkIfVg0ACwsgGkIQWgRAIAIg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FIQMLAkACQCAGQRdNBEAgA0UNASADQQFrIQUgA0EHcSIEBEADQCABIAItAAA6AAAgA0EBayEDIAFBAWohASACQQFqIQIgBEEBayIEDQALCyAFQQdJDQEDQCABIAItAAA6AAAgASACLQABOgABIAEgAi0AAjoAAiABIAItAAM6AAMgASACLQAEOgAEIAEgAi0ABToABSABIAItAAY6AAYgASACLQAHOgAHIAFBCGohASACQQhqIQIgA0EIayIDDQALDAELIAMNAQsgASECDAELIAEgBCADED8hAgsgCyEFDAELIAEgAy0AAjoAACABQQFqIQILIAUgFE8NACACIBNJDQELCyAAIAI2AgwgACAFIAhBA3ZrIgE2AgAgACATIAJrQYMCajYCECAAIBQgAWtBDmo2AgQgByAIQQdxIgA2AogBIAcgHUJ/IACthkJ/hYM+AoQBC+cFAQR/IAMgAiACIANLGyEEIAAgAWshAgJAIABBB3FFDQAgBEUNACAAIAItAAA6AAAgA0EBayEGIAJBAWohAiAAQQFqIgdBB3FBACAEQQFrIgUbRQRAIAchACAFIQQgBiEDDAELIAAgAi0AADoAASADQQJrIQYgBEECayEFIAJBAWohAgJAIABBAmoiB0EHcUUNACAFRQ0AIAAgAi0AADoAAiADQQNrIQYgBEEDayEFIAJBAWohAgJAIABBA2oiB0EHcUUNACAFRQ0AIAAgAi0AADoAAyADQQRrIQYgBEEEayEFIAJBAWohAgJAIABBBGoiB0EHcUUNACAFRQ0AIAAgAi0AADoABCADQQVrIQYgBEEFayEFIAJBAWohAgJAIABBBWoiB0EHcUUNACAFRQ0AIAAgAi0AADoABSADQQZrIQYgBEEGayEFIAJBAWohAgJAIABBBmoiB0EHcUUNACAFRQ0AIAAgAi0AADoABiADQQdrIQYgBEEHayEFIAJBAWohAgJAIABBB2oiB0EHcUUNACAFRQ0AIAAgAi0AADoAByADQQhrIQMgBEEIayEEIABBCGohACACQQFqIQIMBgsgByEAIAUhBCAGIQMMBQsgByEAIAUhBCAGIQMMBAsgByEAIAUhBCAGIQMMAwsgByEAIAUhBCAGIQMMAgsgByE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IakHA8ABBkAEQBxogBCAANgI0IAQgADYCHCAEQX4gAGsiA0H/////ByADQf////8HSRsiBjYCOCAEIAAgBmoiADYCJCAEIAA2AhggBEEIaiEAIwBB0AFrIgMkACADIAI2AswBIANBoAFqQQBBKBAZIAMgAygCzAE2AsgBAkBBACABIANByAFqIANB0ABqIANBoAFqEEpBAEgNACAAKAJMQQBOIQcgACgCACECIAAsAEpBAEwEQCAAIAJBX3E2AgALIAJBIHEhCAJ/IAAoAjAEQCAAIAEgA0HIAWogA0HQAGogA0GgAWoQSgwBCyAAQdAANgIwIAAgA0HQAGo2AhAgACADNgIcIAAgAzYCFCAAKAIsIQIgACADNgIsIAAgASADQcgBaiADQdAAaiADQaABahBKIAJFDQAaIABBAEEAIAAoAiQRAAAaIABBADYCMCAAIAI2AiwgAEEANgIcIABBADYCECAAKAIUGiAAQQA2AhRBAAsaIAAgACgCACAIcjYCACAHRQ0ACyADQdABaiQAIAYEQCAEKAIcIgAgACAEKAIYRmtBADoAAAsgBEGgAWokACAFQRBqJAALUwEDfwJAIAAoAgAsAABBMGtBCk8NAANAIAAoAgAiAiwAACEDIAAgAkEBajYCACABIANqQTBrIQEgAiwAAUEwa0EKTw0BIAFBCmwhAQwACwALIAELuwIAAkAgAUEUSw0AAkACQAJAAkACQAJAAkACQAJAAkAgAUEJaw4KAAECAwQFBgcICQoLIAIgAigCACIBQQRqNgIAIAAgASgCADYCAA8LIAIgAigCACIBQQRqNgIAIAAgATQCADcDAA8LIAIgAigCACIBQQRqNgIAIAAgATUCADcDAA8LIAIgAigCAEEHakF4cSIBQQhqNgIAIAAgASkDADcDAA8LIAIgAigCACIBQQRqNgIAIAAgATIBADcDAA8LIAIgAigCACIBQQRqNgIAIAAgATMBADcDAA8LIAIgAigCACIBQQRqNgIAIAAgATAAADcDAA8LIAIgAigCACIBQQRqNgIAIAAgATEAADcDAA8LIAIgAigCAEEHakF4cSIBQQhqNgIAIAAgASsDADkDAA8LIAAgAkEAEQcACwubAgAgAEUEQ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IIIAAgASgCEDYCDAsMAgsgEULiABAXIgZFBEAgAEEIagRAIABBADYCDCAAQQ42AggLDAILIBggFX0hEyAVQv////8PViAUQv//A1ZyIApyQQFxBEAgBkGZEkEEECwgBkIsEBggBkEtEA0gBkEtEA0gBkEAEBIgBkEAEBIgBiAUEBggBiAUEBggBiATEBggBiAVEBggBkGUEkEEECwgBkEAEBIgBiAYEBggBkEBEBILIAZBnhJBBBAsIAZBABASIAYgFEL//wMgFEL//wNUG6dB//8DcSIBEA0gBiABEA0gBkF/IBOnIBNC/v///w9WGxASIAZBfyAVpyAVQv7///8PVhsQEiAGIABBJEEgIAAtACgbaigCACIDBH8gAy8BBAVBAAtB//8DcRANIAYtAABFBEAgAEEIagRAIABBADYCDCAAQRQ2AggLIAYQCAwCCyAAIAYoAgQgBi0AAAR+IAYpAxAFQgALEBshASAGEAggAUEASA0BIAMEQCAAIAMoAgAgAzMBBBAbQQBIDQILIBMhFwwBCyAAKAIAIQEgAEEIagRAIAAgASgCDDYCCCAAIAEoAhA2AgwLQn8hFwsgEUHwAGokACAXQgBTDQAgACgCABAfQj+HpyECCyALEAYgAkEASA0BAn8gACgCACIBKAIkQQFHBEAgAUEMagRAIAFBADYCECABQRI2AgwLQX8MAQsgASgCICICQQJPBEAgAUEMagRAIAFBADYCECABQR02AgwLQX8MAQsCQCACQQFHDQAgARAaQQBODQBBfwwBCyABQQBCAEEJEA5Cf1cEQCABQQI2AiRBfwwBCyABQQA2AiRBAAtFDQIgACgCACECIAQEQCAEIAIoAgw2AgAgBCACKAIQNgIECwwBCyALEAYLIAAoAlQQfCAAKAIAEENBfyECDAILIAAoAlQQfAsgABBLQQAhAgsgB0HAwABqJAAgAgtFAEHwgwFCADcDAEHogwFCADcDAEHggwFCADcDAEHYgwFCADcDAEHQgwFCADcDAEHIgwFCADcDAEHAgwFCADcDAEHAgwELoQMBCH8jAEGgAWsiAiQAIAAQMQJAAn8CQCAAKAIAIgFBAE4EQCABQbATKAIASA0BCyACIAE2Ah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AIwIQZBACADKAIEIAlqIgFFDQAaIAYgASAEIAlrQdSAASgCABEAAAs2AjALIAUoAhwiBhAwAkAgBSgCECIEIAYoAhAiASABIARLGyIBRQ0AIAUoAgwgBigCCCABEAcaIAUgBSgCDCABajYCDCAGIAYoAgggAWo2AgggBSAFKAIUIAFqNgIUIAUgBSgCECABazYCECAGIAYoAhAgAWsiATYCECABDQAgBiAGKAIENgIIC0EAIQRBACEJIAMoAhBFDQAMCgsgAygCHCgCJCEGIAMgAygCGCIBQQFqNgIYIAEgBmotAAAhASADIARBAWo2AhAgAygCBCAEaiABOgAAIAEEQCADKAIQIQQMAQsLIAMoAhwoAixFDQAgAygCECIGIAlNDQAgBQJ/IAUoAjAhBEEAIAMoAgQgCWoiAUUNABogBCABIAYgCWtB1IABKAIAEQAACzYCMAsgA0HnADYCIAsCQCADKAIcKAIsBEAgAygCDCADKAIQIgFBAmpJBH8gBRAKIAMoAhANAkEABSABCyADKAIEaiAFKAIwOwAAIAMgAygCEEECajYCECADQaABakHkgAEoAgARAQAaCyADQfEANgIgIAUQCiADKAIQRQ0BDAcLDAYLIAUoAgQNAQsgAygCPA0AIApFDQEgAygCIEGaBUYNAQsCfyADKAKIASIBRQRAIAMgChCFAQwBCwJAAkACQCADKAKMAUECaw4CAAECCwJ/AkADQAJAAkAgAygCPA0AIAMQLyADKAI8DQAgCg0BQQAMBAsgAygCSCADKAJoai0AACEEIAMgAygC8C0iAUEBajYC8C0gASADKALsLWpBADoAACADIAMoAvAtIgFBAWo2AvAtIAEgAygC7C1qQQA6AAAgAyADKALwLSIBQQFqNgLwLSABIAMoAuwtaiAEOgAAIAMgBEECdGoiASABLwHkAUEBajsB5AEgAyADKAI8QQFrNgI8IAMgAygCaEEBaiIBNgJoIAMoAvAtIAMoAvQtRw0BQQAhBCADIAMoAlgiBkEATgR/IAMoAkggBmoFQQALIAEgBmtBABAPIAMgAygCaDYCWCADKAIAEAogAygCACgCEA0BDAILCyADQQA2AoQuIApBBEYEQCADIAM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gA0GAywAtAABBAnRqQdgTaiIBIAEvAQBBAWo7AQAgAyADKAI8IARrNgI8IAMgAygCaCAEaiIENgJoCyADKALwLSADKAL0LUcNAUEAIQggAyADKAJYIgFBAE4EfyADKAJIIAFqBUEACyAEIAFrQQAQDyADIAMoAmg2AlggAygCABAKIAMoAgAoAhANAQwCCwsgA0EANgKELiAKQQRGBEAgAyADKAJYIgFBAE4EfyADKAJIIAFqBUEACyADKAJoIAFrQQEQDyADIAMoAmg2AlggAygCABAKQQNBAiADKAIAKAIQGwwCCyADKALwLQRAQQAhCCADIAMoAlgiAUEATgR/IAMoAkggAWoFQQALIAMoAmggAWtBABAPIAMgAygCaDYCWCADKAIAEAogAygCACgCEEUNAQtBASEICyAICwwBCyADIAogAUEMbEG42ABqKAIAEQIACyIBQX5xQQJGBEAgA0GaBTYCIAsgAUF9cUUEQEEAIQQgBSgCEA0CDAQLIAFBAUcNAAJAAkACQCAKQQFrDgUAAQEBAgELIAMpA5guISICfwJ+IAMoAqAuIgFBA2oiCUE/TQRAQgIgAa2GICKEDAELIAFBwABGBEAgAygCBCADKAIQaiAiNwAAIAMgAygCEEEIajYCEEICISJBCgwCCyADKAIEIAMoAhBqQgIgAa2GICKENwAAIAMgAygCEEEIajYCECABQT1rIQlCAkHAACABa62ICyEiIAlBB2ogCUE5SQ0AGiADKAIEIAMoAhBqICI3AAAgAyADKAIQQQhqNgIQQgAhIiAJQTlrCyEBIAMgIjcDmC4gAyABNgKgLiADEDAMAQsgA0EAQQBBABA5IApBA0cNACADKAJQQQBBgIAIEBkgAygCPA0AIANBADYChC4gA0EANgJYIANBADYCaAsgBRAKIAUoAhANAAwDC0EAIQQgCkEERw0AAkACfwJAAkAgAygCFEEBaw4CAQADCyAFIANBoAFqQeCAASgCABEBACIBNgIwIAMoAgQgAygCEGogATYAACADIAMoAhBBBGoiATYCECADKAIEIAFqIQQgBSgCCAwBCyADKAIEIAMoAhBqIQQgBSgCMCIBQRh0IAFBCHRBgID8B3FyIAFBC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oAjBBAhAoIgM2AkwgA0EAIAEoAjBBAXQQGSACKAIgIAIoAihBgIAEQQIQKCEDIAFBgIACNgLoLSABQQA2AkAgASADNgJQIAEgAigCICACKAIoQYCAAkEEECgiAzYCBCABIAEoAugtIgRBAnQ2AgwCQAJAIAEoAkhFDQAgASgCTEUNACABKAJQRQ0AIAMNAQsgAUGaBTYCICACQejAACgCADYCGCACEIQBGkF8DAILIAFBADYCjAEgASAFNgKIASABQgA3AyggASADIARqNgLsLSABIARBA2xBA2s2AvQtQX4hAwJAIAJFDQAgAigCIEUNACACKAIkRQ0AIAIoAhwiAUUNACABKAIAIAJHDQACQAJAIAEoAiAiBEE5aw45AQICAgICAgICAgICAQICAgECAgICAgICAgICAgICAgICAgECAgICAgICAgICAgECAgICAgICAgIBAAsgBEGaBUYNACAEQSpHDQELIAJBAjYCLCACQQA2AgggAkIANwIUIAFBADYCECABIAEoAgQ2AgggASgCFCIDQX9MBEAgAUEAIANrIgM2AhQLIAFBOUEqIANBAkYbNgIgIAIgA0ECRgR/IAFBoAFqQeSAASgCABEBAAVBAQs2AjAgAUF+NgIkIAFBADYCoC4gAUIANwOYLiABQYgXakGg0wA2AgAgASABQcwVajYCgBcgAUH8FmpBjNMANgIAIAEgAUHYE2o2AvQWIAFB8BZqQfjSADYCACABIAFB5AFqNgLoFiABEIgBQQAhAwsgAw0AIAIoAhwiAiACKAIwQQF0NgJEQQAhAyACKAJQQQBBgIAIEBkgAiACKAKIASIEQQxsIgFBtNgAai8BADYClAEgAiABQbDYAGovAQA2ApABIAIgAUGy2ABqLwEANgJ4IAIgAUG22ABqLwEANgJ0QfiAASgCACEFQeyAASgCACEGQYCBASgCACEBIAJCADcCbCACQgA3AmQgAkEANgI8IAJBADYChC4gAkIANwJUIAJBKSABIARBCUYiARs2AnwgAkEqIAYgARs2AoABIAJBKyAFIAEbNgKEAQsgAwsFQXoLDAELAn9BekHrDC0AAEExRw0AGkF+IAJFDQAaIAJBADYCGCACKAIgIgNFBEAgAkE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ANgAAADcAAAA4AAAAOQAAADIAAAAzAAAANAAAADUAAAA2AAAANwAAADgAQfSCAQsCXEQAQbCDAQsQ/////////////////////w=="; - if (!isDataURI(wasmBinaryFile)) { - wasmBinaryFile = locateFile(wasmBinaryFile); - } - function getBinary(file) { - try { - if (file == wasmBinaryFile && wasmBinary) { - return new Uint8Array(wasmBinary); - } - var binary = tryParseAsDataURI(file); - if (binary) { - return binary; - } - if (readBinary) { - return readBinary(file); - } else { - throw "sync fetching of the wasm failed: you can preload it to Module['wasmBinary'] manually, or emcc.py will do that for you when generating HTML (but not JS)"; - } - } catch (err2) { - abort(err2); - } - } - function instantiateSync(file, info) { - var instance; - var module2; - var binary; - try { - binary = getBinary(file); - module2 = new WebAssembly.Module(binary); - instance = new WebAssembly.Instance(module2, info); - } catch (e) { - var str = e.toString(); - err("failed to compile wasm module: " + str); - if (str.includes("imported Memory") || str.includes("memory import")) { - err( - "Memory size incompatibility issues may be due to changing INITIAL_MEMORY at runtime to something too large. Use ALLOW_MEMORY_GROWTH to allow any size memory (and also make sure not to set INITIAL_MEMORY at runtime to something smaller than it was at compile time)." - ); - } - throw e; - } - return [instance, module2]; - } - function createWasm() { - var info = { a: asmLibraryArg }; - function receiveInstance(instance, module2) { - var exports3 = instance.exports; - Module["asm"] = exports3; - wasmMemory = Module["asm"]["g"]; - updateGlobalBufferAndViews(wasmMemory.buffer); - wasmTable = Module["asm"]["W"]; - addOnInit(Module["asm"]["h"]); - removeRunDependency(); - } - addRunDependency(); - if (Module["instantiateWasm"]) { - try { - var exports2 = Module["instantiateWasm"](info, receiveInstance); - return exports2; - } catch (e) { - err("Module.instantiateWasm callback failed with error: " + e); - return false; - } - } - var result = instantiateSync(wasmBinaryFile, info); - receiveInstance(result[0]); - return Module["asm"]; - } - function LE_HEAP_LOAD_F32(byteOffset) { - return HEAP_DATA_VIEW.getFloat32(byteOffset, true); - } - function LE_HEAP_LOAD_F64(byteOffset) { - return HEAP_DATA_VIEW.getFloat64(byteOffset, true); - } - function LE_HEAP_LOAD_I16(byteOffset) { - return HEAP_DATA_VIEW.getInt16(byteOffset, true); - } - function LE_HEAP_LOAD_I32(byteOffset) { - return HEAP_DATA_VIEW.getInt32(byteOffset, true); - } - function LE_HEAP_STORE_I32(byteOffset, value) { - HEAP_DATA_VIEW.setInt32(byteOffset, value, true); - } - function callRuntimeCallbacks(callbacks) { - while (callbacks.length > 0) { - var callback = callbacks.shift(); - if (typeof callback == "function") { - callback(Module); - continue; - } - var func = callback.func; - if (typeof func === "number") { - if (callback.arg === void 0) { - wasmTable.get(func)(); - } else { - wasmTable.get(func)(callback.arg); - } - } else { - func(callback.arg === void 0 ? null : callback.arg); - } - } - } - function _gmtime_r(time, tmPtr) { - var date = new Date(LE_HEAP_LOAD_I32((time >> 2) * 4) * 1e3); - LE_HEAP_STORE_I32((tmPtr >> 2) * 4, date.getUTCSeconds()); - LE_HEAP_STORE_I32((tmPtr + 4 >> 2) * 4, date.getUTCMinutes()); - LE_HEAP_STORE_I32((tmPtr + 8 >> 2) * 4, date.getUTCHours()); - LE_HEAP_STORE_I32((tmPtr + 12 >> 2) * 4, date.getUTCDate()); - LE_HEAP_STORE_I32((tmPtr + 16 >> 2) * 4, date.getUTCMonth()); - LE_HEAP_STORE_I32((tmPtr + 20 >> 2) * 4, date.getUTCFullYear() - 1900); - LE_HEAP_STORE_I32((tmPtr + 24 >> 2) * 4, date.getUTCDay()); - LE_HEAP_STORE_I32((tmPtr + 36 >> 2) * 4, 0); - LE_HEAP_STORE_I32((tmPtr + 32 >> 2) * 4, 0); - var start = Date.UTC(date.getUTCFullYear(), 0, 1, 0, 0, 0, 0); - var yday = (date.getTime() - start) / (1e3 * 60 * 60 * 24) | 0; - LE_HEAP_STORE_I32((tmPtr + 28 >> 2) * 4, yday); - if (!_gmtime_r.GMTString) - _gmtime_r.GMTString = allocateUTF8("GMT"); - LE_HEAP_STORE_I32((tmPtr + 40 >> 2) * 4, _gmtime_r.GMTString); - return tmPtr; - } - function ___gmtime_r(a0, a1) { - return _gmtime_r(a0, a1); - } - function _emscripten_memcpy_big(dest, src, num) { - HEAPU8.copyWithin(dest, src, src + num); - } - function emscripten_realloc_buffer(size) { - try { - wasmMemory.grow(size - buffer.byteLength + 65535 >>> 16); - updateGlobalBufferAndViews(wasmMemory.buffer); - return 1; - } catch (e) { - } - } - function _emscripten_resize_heap(requestedSize) { - var oldSize = HEAPU8.length; - requestedSize = requestedSize >>> 0; - var maxHeapSize = 2147483648; - if (requestedSize > maxHeapSize) { - return false; - } - for (var cutDown = 1; cutDown <= 4; cutDown *= 2) { - var overGrownHeapSize = oldSize * (1 + 0.2 / cutDown); - overGrownHeapSize = Math.min( - overGrownHeapSize, - requestedSize + 100663296 - ); - var newSize = Math.min( - maxHeapSize, - alignUp(Math.max(requestedSize, overGrownHeapSize), 65536) - ); - var replacement = emscripten_realloc_buffer(newSize); - if (replacement) { - return true; - } - } - return false; - } - function _setTempRet0(val) { - } - function _time(ptr) { - var ret = Date.now() / 1e3 | 0; - if (ptr) { - LE_HEAP_STORE_I32((ptr >> 2) * 4, ret); - } - return ret; - } - function _tzset() { - if (_tzset.called) - return; - _tzset.called = true; - var currentYear = new Date().getFullYear(); - var winter = new Date(currentYear, 0, 1); - var summer = new Date(currentYear, 6, 1); - var winterOffset = winter.getTimezoneOffset(); - var summerOffset = summer.getTimezoneOffset(); - var stdTimezoneOffset = Math.max(winterOffset, summerOffset); - LE_HEAP_STORE_I32((__get_timezone() >> 2) * 4, stdTimezoneOffset * 60); - LE_HEAP_STORE_I32( - (__get_daylight() >> 2) * 4, - Number(winterOffset != summerOffset) - ); - function extractZone(date) { - var match = date.toTimeString().match(/\(([A-Za-z ]+)\)$/); - return match ? match[1] : "GMT"; - } - var winterName = extractZone(winter); - var summerName = extractZone(summer); - var winterNamePtr = allocateUTF8(winterName); - var summerNamePtr = allocateUTF8(summerName); - if (summerOffset < winterOffset) { - LE_HEAP_STORE_I32((__get_tzname() >> 2) * 4, winterNamePtr); - LE_HEAP_STORE_I32((__get_tzname() + 4 >> 2) * 4, summerNamePtr); - } else { - LE_HEAP_STORE_I32((__get_tzname() >> 2) * 4, summerNamePtr); - LE_HEAP_STORE_I32((__get_tzname() + 4 >> 2) * 4, winterNamePtr); - } - } - function _timegm(tmPtr) { - _tzset(); - var time = Date.UTC( - LE_HEAP_LOAD_I32((tmPtr + 20 >> 2) * 4) + 1900, - LE_HEAP_LOAD_I32((tmPtr + 16 >> 2) * 4), - LE_HEAP_LOAD_I32((tmPtr + 12 >> 2) * 4), - LE_HEAP_LOAD_I32((tmPtr + 8 >> 2) * 4), - LE_HEAP_LOAD_I32((tmPtr + 4 >> 2) * 4), - LE_HEAP_LOAD_I32((tmPtr >> 2) * 4), - 0 - ); - var date = new Date(time); - LE_HEAP_STORE_I32((tmPtr + 24 >> 2) * 4, date.getUTCDay()); - var start = Date.UTC(date.getUTCFullYear(), 0, 1, 0, 0, 0, 0); - var yday = (date.getTime() - start) / (1e3 * 60 * 60 * 24) | 0; - LE_HEAP_STORE_I32((tmPtr + 28 >> 2) * 4, yday); - return date.getTime() / 1e3 | 0; - } - function intArrayFromBase64(s) { - { - var buf; - try { - buf = Buffer.from(s, "base64"); - } catch (_) { - buf = new Buffer(s, "base64"); - } - return new Uint8Array( - buf["buffer"], - buf["byteOffset"], - buf["byteLength"] - ); - } - } - function tryParseAsDataURI(filename) { - if (!isDataURI(filename)) { - return; - } - return intArrayFromBase64(filename.slice(dataURIPrefix.length)); - } - var asmLibraryArg = { - e: ___gmtime_r, - c: _emscripten_memcpy_big, - d: _emscripten_resize_heap, - a: _setTempRet0, - b: _time, - f: _timegm - }; - var asm = createWasm(); - Module["___wasm_call_ctors"] = asm["h"]; - Module["_zip_ext_count_symlinks"] = asm["i"]; - Module["_zip_file_get_external_attributes"] = asm["j"]; - Module["_zipstruct_statS"] = asm["k"]; - Module["_zipstruct_stat_size"] = asm["l"]; - Module["_zipstruct_stat_mtime"] = asm["m"]; - Module["_zipstruct_stat_crc"] = asm["n"]; - Module["_zipstruct_errorS"] = asm["o"]; - Module["_zipstruct_error_code_zip"] = asm["p"]; - Module["_zipstruct_stat_comp_size"] = asm["q"]; - Module["_zipstruct_stat_comp_method"] = asm["r"]; - Module["_zip_close"] = asm["s"]; - Module["_zip_delete"] = asm["t"]; - Module["_zip_dir_add"] = asm["u"]; - Module["_zip_discard"] = asm["v"]; - Module["_zip_error_init_with_code"] = asm["w"]; - Module["_zip_get_error"] = asm["x"]; - Module["_zip_file_get_error"] = asm["y"]; - Module["_zip_error_strerror"] = asm["z"]; - Module["_zip_fclose"] = asm["A"]; - Module["_zip_file_add"] = asm["B"]; - Module["_free"] = asm["C"]; - var _malloc = Module["_malloc"] = asm["D"]; - Module["_zip_source_error"] = asm["E"]; - Module["_zip_source_seek"] = asm["F"]; - Module["_zip_file_set_external_attributes"] = asm["G"]; - Module["_zip_file_set_mtime"] = asm["H"]; - Module["_zip_fopen_index"] = asm["I"]; - Module["_zip_fread"] = asm["J"]; - Module["_zip_get_name"] = asm["K"]; - Module["_zip_get_num_entries"] = asm["L"]; - Module["_zip_source_read"] = asm["M"]; - Module["_zip_name_locate"] = asm["N"]; - Module["_zip_open_from_source"] = asm["O"]; - Module["_zip_set_file_compression"] = asm["P"]; - Module["_zip_source_buffer"] = asm["Q"]; - Module["_zip_source_buffer_create"] = asm["R"]; - Module["_zip_source_close"] = asm["S"]; - Module["_zip_source_free"] = asm["T"]; - Module["_zip_source_keep"] = asm["U"]; - Module["_zip_source_open"] = asm["V"]; - Module["_zip_source_tell"] = asm["X"]; - Module["_zip_stat_index"] = asm["Y"]; - var __get_tzname = Module["__get_tzname"] = asm["Z"]; - var __get_daylight = Module["__get_daylight"] = asm["_"]; - var __get_timezone = Module["__get_timezone"] = asm["$"]; - var stackSave = Module["stackSave"] = asm["aa"]; - var stackRestore = Module["stackRestore"] = asm["ba"]; - var stackAlloc = Module["stackAlloc"] = asm["ca"]; - Module["cwrap"] = cwrap; - Module["getValue"] = getValue; - var calledRun; - dependenciesFulfilled = function runCaller() { - if (!calledRun) - run(); - if (!calledRun) - dependenciesFulfilled = runCaller; - }; - function run(args) { - if (runDependencies > 0) { - return; - } - preRun(); - if (runDependencies > 0) { - return; - } - function doRun() { - if (calledRun) - return; - calledRun = true; - Module["calledRun"] = true; - if (ABORT) - return; - initRuntime(); - readyPromiseResolve(Module); - if (Module["onRuntimeInitialized"]) - Module["onRuntimeInitialized"](); - postRun(); - } - if (Module["setStatus"]) { - Module["setStatus"]("Running..."); - setTimeout(function() { - setTimeout(function() { - Module["setStatus"](""); - }, 1); - doRun(); - }, 1); - } else { - doRun(); - } - } - Module["run"] = run; - if (Module["preInit"]) { - if (typeof Module["preInit"] == "function") - Module["preInit"] = [Module["preInit"]]; - while (Module["preInit"].length > 0) { - Module["preInit"].pop()(); - } - } - run(); - return createModule2; - }; -}(); -module.exports = createModule; -}(libzipSync)); - -const createModule = libzipSync.exports; - -const number64 = [ - `number`, - `number` -]; -var Errors = /* @__PURE__ */ ((Errors2) => { - Errors2[Errors2["ZIP_ER_OK"] = 0] = "ZIP_ER_OK"; - Errors2[Errors2["ZIP_ER_MULTIDISK"] = 1] = "ZIP_ER_MULTIDISK"; - Errors2[Errors2["ZIP_ER_RENAME"] = 2] = "ZIP_ER_RENAME"; - Errors2[Errors2["ZIP_ER_CLOSE"] = 3] = "ZIP_ER_CLOSE"; - Errors2[Errors2["ZIP_ER_SEEK"] = 4] = "ZIP_ER_SEEK"; - Errors2[Errors2["ZIP_ER_READ"] = 5] = "ZIP_ER_READ"; - Errors2[Errors2["ZIP_ER_WRITE"] = 6] = "ZIP_ER_WRITE"; - Errors2[Errors2["ZIP_ER_CRC"] = 7] = "ZIP_ER_CRC"; - Errors2[Errors2["ZIP_ER_ZIPCLOSED"] = 8] = "ZIP_ER_ZIPCLOSED"; - Errors2[Errors2["ZIP_ER_NOENT"] = 9] = "ZIP_ER_NOENT"; - Errors2[Errors2["ZIP_ER_EXISTS"] = 10] = "ZIP_ER_EXISTS"; - Errors2[Errors2["ZIP_ER_OPEN"] = 11] = "ZIP_ER_OPEN"; - Errors2[Errors2["ZIP_ER_TMPOPEN"] = 12] = "ZIP_ER_TMPOPEN"; - Errors2[Errors2["ZIP_ER_ZLIB"] = 13] = "ZIP_ER_ZLIB"; - Errors2[Errors2["ZIP_ER_MEMORY"] = 14] = "ZIP_ER_MEMORY"; - Errors2[Errors2["ZIP_ER_CHANGED"] = 15] = "ZIP_ER_CHANGED"; - Errors2[Errors2["ZIP_ER_COMPNOTSUPP"] = 16] = "ZIP_ER_COMPNOTSUPP"; - Errors2[Errors2["ZIP_ER_EOF"] = 17] = "ZIP_ER_EOF"; - Errors2[Errors2["ZIP_ER_INVAL"] = 18] = "ZIP_ER_INVAL"; - Errors2[Errors2["ZIP_ER_NOZIP"] = 19] = "ZIP_ER_NOZIP"; - Errors2[Errors2["ZIP_ER_INTERNAL"] = 20] = "ZIP_ER_INTERNAL"; - Errors2[Errors2["ZIP_ER_INCONS"] = 21] = "ZIP_ER_INCONS"; - Errors2[Errors2["ZIP_ER_REMOVE"] = 22] = "ZIP_ER_REMOVE"; - Errors2[Errors2["ZIP_ER_DELETED"] = 23] = "ZIP_ER_DELETED"; - Errors2[Errors2["ZIP_ER_ENCRNOTSUPP"] = 24] = "ZIP_ER_ENCRNOTSUPP"; - Errors2[Errors2["ZIP_ER_RDONLY"] = 25] = "ZIP_ER_RDONLY"; - Errors2[Errors2["ZIP_ER_NOPASSWD"] = 26] = "ZIP_ER_NOPASSWD"; - Errors2[Errors2["ZIP_ER_WRONGPASSWD"] = 27] = "ZIP_ER_WRONGPASSWD"; - Errors2[Errors2["ZIP_ER_OPNOTSUPP"] = 28] = "ZIP_ER_OPNOTSUPP"; - Errors2[Errors2["ZIP_ER_INUSE"] = 29] = "ZIP_ER_INUSE"; - Errors2[Errors2["ZIP_ER_TELL"] = 30] = "ZIP_ER_TELL"; - Errors2[Errors2["ZIP_ER_COMPRESSED_DATA"] = 31] = "ZIP_ER_COMPRESSED_DATA"; - return Errors2; -})(Errors || {}); -const makeInterface = (emZip) => ({ - get HEAPU8() { - return emZip.HEAPU8; - }, - errors: Errors, - SEEK_SET: 0, - SEEK_CUR: 1, - SEEK_END: 2, - ZIP_CHECKCONS: 4, - ZIP_EXCL: 2, - ZIP_RDONLY: 16, - ZIP_FL_OVERWRITE: 8192, - ZIP_FL_COMPRESSED: 4, - ZIP_OPSYS_DOS: 0, - ZIP_OPSYS_AMIGA: 1, - ZIP_OPSYS_OPENVMS: 2, - ZIP_OPSYS_UNIX: 3, - ZIP_OPSYS_VM_CMS: 4, - ZIP_OPSYS_ATARI_ST: 5, - ZIP_OPSYS_OS_2: 6, - ZIP_OPSYS_MACINTOSH: 7, - ZIP_OPSYS_Z_SYSTEM: 8, - ZIP_OPSYS_CPM: 9, - ZIP_OPSYS_WINDOWS_NTFS: 10, - ZIP_OPSYS_MVS: 11, - ZIP_OPSYS_VSE: 12, - ZIP_OPSYS_ACORN_RISC: 13, - ZIP_OPSYS_VFAT: 14, - ZIP_OPSYS_ALTERNATE_MVS: 15, - ZIP_OPSYS_BEOS: 16, - ZIP_OPSYS_TANDEM: 17, - ZIP_OPSYS_OS_400: 18, - ZIP_OPSYS_OS_X: 19, - ZIP_CM_DEFAULT: -1, - ZIP_CM_STORE: 0, - ZIP_CM_DEFLATE: 8, - uint08S: emZip._malloc(1), - uint32S: emZip._malloc(4), - malloc: emZip._malloc, - free: emZip._free, - getValue: emZip.getValue, - openFromSource: emZip.cwrap(`zip_open_from_source`, `number`, [`number`, `number`, `number`]), - close: emZip.cwrap(`zip_close`, `number`, [`number`]), - discard: emZip.cwrap(`zip_discard`, null, [`number`]), - getError: emZip.cwrap(`zip_get_error`, `number`, [`number`]), - getName: emZip.cwrap(`zip_get_name`, `string`, [`number`, `number`, `number`]), - getNumEntries: emZip.cwrap(`zip_get_num_entries`, `number`, [`number`, `number`]), - delete: emZip.cwrap(`zip_delete`, `number`, [`number`, `number`]), - statIndex: emZip.cwrap(`zip_stat_index`, `number`, [`number`, ...number64, `number`, `number`]), - fopenIndex: emZip.cwrap(`zip_fopen_index`, `number`, [`number`, ...number64, `number`]), - fread: emZip.cwrap(`zip_fread`, `number`, [`number`, `number`, `number`, `number`]), - fclose: emZip.cwrap(`zip_fclose`, `number`, [`number`]), - dir: { - add: emZip.cwrap(`zip_dir_add`, `number`, [`number`, `string`]) - }, - file: { - add: emZip.cwrap(`zip_file_add`, `number`, [`number`, `string`, `number`, `number`]), - getError: emZip.cwrap(`zip_file_get_error`, `number`, [`number`]), - getExternalAttributes: emZip.cwrap(`zip_file_get_external_attributes`, `number`, [`number`, ...number64, `number`, `number`, `number`]), - setExternalAttributes: emZip.cwrap(`zip_file_set_external_attributes`, `number`, [`number`, ...number64, `number`, `number`, `number`]), - setMtime: emZip.cwrap(`zip_file_set_mtime`, `number`, [`number`, ...number64, `number`, `number`]), - setCompression: emZip.cwrap(`zip_set_file_compression`, `number`, [`number`, ...number64, `number`, `number`]) - }, - ext: { - countSymlinks: emZip.cwrap(`zip_ext_count_symlinks`, `number`, [`number`]) - }, - error: { - initWithCode: emZip.cwrap(`zip_error_init_with_code`, null, [`number`, `number`]), - strerror: emZip.cwrap(`zip_error_strerror`, `string`, [`number`]) - }, - name: { - locate: emZip.cwrap(`zip_name_locate`, `number`, [`number`, `string`, `number`]) - }, - source: { - fromUnattachedBuffer: emZip.cwrap(`zip_source_buffer_create`, `number`, [`number`, ...number64, `number`, `number`]), - fromBuffer: emZip.cwrap(`zip_source_buffer`, `number`, [`number`, `number`, ...number64, `number`]), - free: emZip.cwrap(`zip_source_free`, null, [`number`]), - keep: emZip.cwrap(`zip_source_keep`, null, [`number`]), - open: emZip.cwrap(`zip_source_open`, `number`, [`number`]), - close: emZip.cwrap(`zip_source_close`, `number`, [`number`]), - seek: emZip.cwrap(`zip_source_seek`, `number`, [`number`, ...number64, `number`]), - tell: emZip.cwrap(`zip_source_tell`, `number`, [`number`]), - read: emZip.cwrap(`zip_source_read`, `number`, [`number`, `number`, `number`]), - error: emZip.cwrap(`zip_source_error`, `number`, [`number`]) - }, - struct: { - statS: emZip.cwrap(`zipstruct_statS`, `number`, []), - statSize: emZip.cwrap(`zipstruct_stat_size`, `number`, [`number`]), - statCompSize: emZip.cwrap(`zipstruct_stat_comp_size`, `number`, [`number`]), - statCompMethod: emZip.cwrap(`zipstruct_stat_comp_method`, `number`, [`number`]), - statMtime: emZip.cwrap(`zipstruct_stat_mtime`, `number`, [`number`]), - statCrc: emZip.cwrap(`zipstruct_stat_crc`, `number`, [`number`]), - errorS: emZip.cwrap(`zipstruct_errorS`, `number`, []), - errorCodeZip: emZip.cwrap(`zipstruct_error_code_zip`, `number`, [`number`]) - } -}); - -function getArchivePart(path, extension) { - let idx = path.indexOf(extension); - if (idx <= 0) - return null; - let nextCharIdx = idx; - while (idx >= 0) { - nextCharIdx = idx + extension.length; - if (path[nextCharIdx] === ppath.sep) - break; - if (path[idx - 1] === ppath.sep) - return null; - idx = path.indexOf(extension, nextCharIdx); - } - if (path.length > nextCharIdx && path[nextCharIdx] !== ppath.sep) - return null; - return path.slice(0, nextCharIdx); -} -class ZipOpenFS extends MountFS { - static async openPromise(fn, opts) { - const zipOpenFs = new ZipOpenFS(opts); - try { - return await fn(zipOpenFs); - } finally { - zipOpenFs.saveAndClose(); - } - } - constructor(opts = {}) { - const fileExtensions = opts.fileExtensions; - const readOnlyArchives = opts.readOnlyArchives; - const getMountPoint = typeof fileExtensions === `undefined` ? (path) => getArchivePart(path, `.zip`) : (path) => { - for (const extension of fileExtensions) { - const result = getArchivePart(path, extension); - if (result) { - return result; - } - } - return null; - }; - const factorySync = (baseFs, p) => { - return new ZipFS(p, { - baseFs, - readOnly: readOnlyArchives, - stats: baseFs.statSync(p) - }); - }; - const factoryPromise = async (baseFs, p) => { - const zipOptions = { - baseFs, - readOnly: readOnlyArchives, - stats: await baseFs.statPromise(p) - }; - return () => { - return new ZipFS(p, zipOptions); - }; - }; - super({ - ...opts, - factorySync, - factoryPromise, - getMountPoint - }); - } -} - -const DEFAULT_COMPRESSION_LEVEL = `mixed`; -function toUnixTimestamp(time) { - if (typeof time === `string` && String(+time) === time) - return +time; - if (typeof time === `number` && Number.isFinite(time)) { - if (time < 0) { - return Date.now() / 1e3; - } else { - return time; - } - } - if (nodeUtils.types.isDate(time)) - return time.getTime() / 1e3; - throw new Error(`Invalid time`); -} -function makeEmptyArchive() { - return Buffer.from([ - 80, - 75, - 5, - 6, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0 - ]); -} -class LibzipError extends Error { - constructor(message, code) { - super(message); - this.name = `Libzip Error`; - this.code = code; - } -} -class ZipFS extends BasePortableFakeFS { - constructor(source, opts = {}) { - super(); - this.listings = /* @__PURE__ */ new Map(); - this.entries = /* @__PURE__ */ new Map(); - this.fileSources = /* @__PURE__ */ new Map(); - this.fds = /* @__PURE__ */ new Map(); - this.nextFd = 0; - this.ready = false; - this.readOnly = false; - const pathOptions = opts; - this.level = typeof pathOptions.level !== `undefined` ? pathOptions.level : DEFAULT_COMPRESSION_LEVEL; - source ??= makeEmptyArchive(); - if (typeof source === `string`) { - const { baseFs = new NodeFS() } = pathOptions; - this.baseFs = baseFs; - this.path = source; - } else { - this.path = null; - this.baseFs = null; - } - if (opts.stats) { - this.stats = opts.stats; - } else { - if (typeof source === `string`) { - try { - this.stats = this.baseFs.statSync(source); - } catch (error) { - if (error.code === `ENOENT` && pathOptions.create) { - this.stats = makeDefaultStats(); - } else { - throw error; - } - } - } else { - this.stats = makeDefaultStats(); - } - } - this.libzip = getInstance(); - const errPtr = this.libzip.malloc(4); - try { - let flags = 0; - if (opts.readOnly) { - flags |= this.libzip.ZIP_RDONLY; - this.readOnly = true; - } - if (typeof source === `string`) - source = pathOptions.create ? makeEmptyArchive() : this.baseFs.readFileSync(source); - const lzSource = this.allocateUnattachedSource(source); - try { - this.zip = this.libzip.openFromSource(lzSource, flags, errPtr); - this.lzSource = lzSource; - } catch (error) { - this.libzip.source.free(lzSource); - throw error; - } - if (this.zip === 0) { - const error = this.libzip.struct.errorS(); - this.libzip.error.initWithCode(error, this.libzip.getValue(errPtr, `i32`)); - throw this.makeLibzipError(error); - } - } finally { - this.libzip.free(errPtr); - } - this.listings.set(PortablePath.root, /* @__PURE__ */ new Set()); - const entryCount = this.libzip.getNumEntries(this.zip, 0); - for (let t = 0; t < entryCount; ++t) { - const raw = this.libzip.getName(this.zip, t, 0); - if (ppath.isAbsolute(raw)) - continue; - const p = ppath.resolve(PortablePath.root, raw); - this.registerEntry(p, t); - if (raw.endsWith(`/`)) { - this.registerListing(p); - } - } - this.symlinkCount = this.libzip.ext.countSymlinks(this.zip); - if (this.symlinkCount === -1) - throw this.makeLibzipError(this.libzip.getError(this.zip)); - this.ready = true; - } - makeLibzipError(error) { - const errorCode = this.libzip.struct.errorCodeZip(error); - const strerror = this.libzip.error.strerror(error); - const libzipError = new LibzipError(strerror, this.libzip.errors[errorCode]); - if (errorCode === this.libzip.errors.ZIP_ER_CHANGED) - throw new Error(`Assertion failed: Unexpected libzip error: ${libzipError.message}`); - return libzipError; - } - getExtractHint(hints) { - for (const fileName of this.entries.keys()) { - const ext = this.pathUtils.extname(fileName); - if (hints.relevantExtensions.has(ext)) { - return true; - } - } - return false; - } - getAllFiles() { - return Array.from(this.entries.keys()); - } - getRealPath() { - if (!this.path) - throw new Error(`ZipFS don't have real paths when loaded from a buffer`); - return this.path; - } - prepareClose() { - if (!this.ready) - throw EBUSY(`archive closed, close`); - unwatchAllFiles(this); - } - getBufferAndClose() { - this.prepareClose(); - if (this.entries.size === 0) { - this.discardAndClose(); - return makeEmptyArchive(); - } - try { - this.libzip.source.keep(this.lzSource); - if (this.libzip.close(this.zip) === -1) - throw this.makeLibzipError(this.libzip.getError(this.zip)); - if (this.libzip.source.open(this.lzSource) === -1) - throw this.makeLibzipError(this.libzip.source.error(this.lzSource)); - if (this.libzip.source.seek(this.lzSource, 0, 0, this.libzip.SEEK_END) === -1) - throw this.makeLibzipError(this.libzip.source.error(this.lzSource)); - const size = this.libzip.source.tell(this.lzSource); - if (size === -1) - throw this.makeLibzipError(this.libzip.source.error(this.lzSource)); - if (this.libzip.source.seek(this.lzSource, 0, 0, this.libzip.SEEK_SET) === -1) - throw this.makeLibzipError(this.libzip.source.error(this.lzSource)); - const buffer = this.libzip.malloc(size); - if (!buffer) - throw new Error(`Couldn't allocate enough memory`); - try { - const rc = this.libzip.source.read(this.lzSource, buffer, size); - if (rc === -1) - throw this.makeLibzipError(this.libzip.source.error(this.lzSource)); - else if (rc < size) - throw new Error(`Incomplete read`); - else if (rc > size) - throw new Error(`Overread`); - let result = Buffer.from(this.libzip.HEAPU8.subarray(buffer, buffer + size)); - if (process.env.YARN_IS_TEST_ENV && process.env.YARN_ZIP_DATA_EPILOGUE) - result = Buffer.concat([result, Buffer.from(process.env.YARN_ZIP_DATA_EPILOGUE)]); - return result; - } finally { - this.libzip.free(buffer); - } - } finally { - this.libzip.source.close(this.lzSource); - this.libzip.source.free(this.lzSource); - this.ready = false; - } - } - discardAndClose() { - this.prepareClose(); - this.libzip.discard(this.zip); - this.ready = false; - } - saveAndClose() { - if (!this.path || !this.baseFs) - throw new Error(`ZipFS cannot be saved and must be discarded when loaded from a buffer`); - if (this.readOnly) { - this.discardAndClose(); - return; - } - const newMode = this.baseFs.existsSync(this.path) || this.stats.mode === DEFAULT_MODE ? void 0 : this.stats.mode; - this.baseFs.writeFileSync(this.path, this.getBufferAndClose(), { mode: newMode }); - this.ready = false; - } - resolve(p) { - return ppath.resolve(PortablePath.root, p); - } - async openPromise(p, flags, mode) { - return this.openSync(p, flags, mode); - } - openSync(p, flags, mode) { - const fd = this.nextFd++; - this.fds.set(fd, { cursor: 0, p }); - return fd; - } - hasOpenFileHandles() { - return !!this.fds.size; - } - async opendirPromise(p, opts) { - return this.opendirSync(p, opts); - } - opendirSync(p, opts = {}) { - const resolvedP = this.resolveFilename(`opendir '${p}'`, p); - if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) - throw ENOENT(`opendir '${p}'`); - const directoryListing = this.listings.get(resolvedP); - if (!directoryListing) - throw ENOTDIR(`opendir '${p}'`); - const entries = [...directoryListing]; - const fd = this.openSync(resolvedP, `r`); - const onClose = () => { - this.closeSync(fd); - }; - return opendir(this, resolvedP, entries, { onClose }); - } - async readPromise(fd, buffer, offset, length, position) { - return this.readSync(fd, buffer, offset, length, position); - } - readSync(fd, buffer, offset = 0, length = buffer.byteLength, position = -1) { - const entry = this.fds.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`read`); - const realPosition = position === -1 || position === null ? entry.cursor : position; - const source = this.readFileSync(entry.p); - source.copy(buffer, offset, realPosition, realPosition + length); - const bytesRead = Math.max(0, Math.min(source.length - realPosition, length)); - if (position === -1 || position === null) - entry.cursor += bytesRead; - return bytesRead; - } - async writePromise(fd, buffer, offset, length, position) { - if (typeof buffer === `string`) { - return this.writeSync(fd, buffer, position); - } else { - return this.writeSync(fd, buffer, offset, length, position); - } - } - writeSync(fd, buffer, offset, length, position) { - const entry = this.fds.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`read`); - throw new Error(`Unimplemented`); - } - async closePromise(fd) { - return this.closeSync(fd); - } - closeSync(fd) { - const entry = this.fds.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`read`); - this.fds.delete(fd); - } - createReadStream(p, { encoding } = {}) { - if (p === null) - throw new Error(`Unimplemented`); - const fd = this.openSync(p, `r`); - const stream$1 = Object.assign( - new stream.PassThrough({ - emitClose: true, - autoDestroy: true, - destroy: (error, callback) => { - clearImmediate(immediate); - this.closeSync(fd); - callback(error); - } - }), - { - close() { - stream$1.destroy(); - }, - bytesRead: 0, - path: p, - pending: false - } - ); - const immediate = setImmediate(async () => { - try { - const data = await this.readFilePromise(p, encoding); - stream$1.bytesRead = data.length; - stream$1.end(data); - } catch (error) { - stream$1.destroy(error); - } - }); - return stream$1; - } - createWriteStream(p, { encoding } = {}) { - if (this.readOnly) - throw EROFS(`open '${p}'`); - if (p === null) - throw new Error(`Unimplemented`); - const chunks = []; - const fd = this.openSync(p, `w`); - const stream$1 = Object.assign( - new stream.PassThrough({ - autoDestroy: true, - emitClose: true, - destroy: (error, callback) => { - try { - if (error) { - callback(error); - } else { - this.writeFileSync(p, Buffer.concat(chunks), encoding); - callback(null); - } - } catch (err) { - callback(err); - } finally { - this.closeSync(fd); - } - } - }), - { - close() { - stream$1.destroy(); - }, - bytesWritten: 0, - path: p, - pending: false - } - ); - stream$1.on(`data`, (chunk) => { - const chunkBuffer = Buffer.from(chunk); - stream$1.bytesWritten += chunkBuffer.length; - chunks.push(chunkBuffer); - }); - return stream$1; - } - async realpathPromise(p) { - return this.realpathSync(p); - } - realpathSync(p) { - const resolvedP = this.resolveFilename(`lstat '${p}'`, p); - if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) - throw ENOENT(`lstat '${p}'`); - return resolvedP; - } - async existsPromise(p) { - return this.existsSync(p); - } - existsSync(p) { - if (!this.ready) - throw EBUSY(`archive closed, existsSync '${p}'`); - if (this.symlinkCount === 0) { - const resolvedP2 = ppath.resolve(PortablePath.root, p); - return this.entries.has(resolvedP2) || this.listings.has(resolvedP2); - } - let resolvedP; - try { - resolvedP = this.resolveFilename(`stat '${p}'`, p, void 0, false); - } catch (error) { - return false; - } - if (resolvedP === void 0) - return false; - return this.entries.has(resolvedP) || this.listings.has(resolvedP); - } - async accessPromise(p, mode) { - return this.accessSync(p, mode); - } - accessSync(p, mode = fs.constants.F_OK) { - const resolvedP = this.resolveFilename(`access '${p}'`, p); - if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) - throw ENOENT(`access '${p}'`); - if (this.readOnly && mode & fs.constants.W_OK) { - throw EROFS(`access '${p}'`); - } - } - async statPromise(p, opts = { bigint: false }) { - if (opts.bigint) - return this.statSync(p, { bigint: true }); - return this.statSync(p); - } - statSync(p, opts = { bigint: false, throwIfNoEntry: true }) { - const resolvedP = this.resolveFilename(`stat '${p}'`, p, void 0, opts.throwIfNoEntry); - if (resolvedP === void 0) - return void 0; - if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) { - if (opts.throwIfNoEntry === false) - return void 0; - throw ENOENT(`stat '${p}'`); - } - if (p[p.length - 1] === `/` && !this.listings.has(resolvedP)) - throw ENOTDIR(`stat '${p}'`); - return this.statImpl(`stat '${p}'`, resolvedP, opts); - } - async fstatPromise(fd, opts) { - return this.fstatSync(fd, opts); - } - fstatSync(fd, opts) { - const entry = this.fds.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`fstatSync`); - const { p } = entry; - const resolvedP = this.resolveFilename(`stat '${p}'`, p); - if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) - throw ENOENT(`stat '${p}'`); - if (p[p.length - 1] === `/` && !this.listings.has(resolvedP)) - throw ENOTDIR(`stat '${p}'`); - return this.statImpl(`fstat '${p}'`, resolvedP, opts); - } - async lstatPromise(p, opts = { bigint: false }) { - if (opts.bigint) - return this.lstatSync(p, { bigint: true }); - return this.lstatSync(p); - } - lstatSync(p, opts = { bigint: false, throwIfNoEntry: true }) { - const resolvedP = this.resolveFilename(`lstat '${p}'`, p, false, opts.throwIfNoEntry); - if (resolvedP === void 0) - return void 0; - if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) { - if (opts.throwIfNoEntry === false) - return void 0; - throw ENOENT(`lstat '${p}'`); - } - if (p[p.length - 1] === `/` && !this.listings.has(resolvedP)) - throw ENOTDIR(`lstat '${p}'`); - return this.statImpl(`lstat '${p}'`, resolvedP, opts); - } - statImpl(reason, p, opts = {}) { - const entry = this.entries.get(p); - if (typeof entry !== `undefined`) { - const stat = this.libzip.struct.statS(); - const rc = this.libzip.statIndex(this.zip, entry, 0, 0, stat); - if (rc === -1) - throw this.makeLibzipError(this.libzip.getError(this.zip)); - const uid = this.stats.uid; - const gid = this.stats.gid; - const size = this.libzip.struct.statSize(stat) >>> 0; - const blksize = 512; - const blocks = Math.ceil(size / blksize); - const mtimeMs = (this.libzip.struct.statMtime(stat) >>> 0) * 1e3; - const atimeMs = mtimeMs; - const birthtimeMs = mtimeMs; - const ctimeMs = mtimeMs; - const atime = new Date(atimeMs); - const birthtime = new Date(birthtimeMs); - const ctime = new Date(ctimeMs); - const mtime = new Date(mtimeMs); - const type = this.listings.has(p) ? fs.constants.S_IFDIR : this.isSymbolicLink(entry) ? fs.constants.S_IFLNK : fs.constants.S_IFREG; - const defaultMode = type === fs.constants.S_IFDIR ? 493 : 420; - const mode = type | this.getUnixMode(entry, defaultMode) & 511; - const crc = this.libzip.struct.statCrc(stat); - const statInstance = Object.assign(new StatEntry(), { uid, gid, size, blksize, blocks, atime, birthtime, ctime, mtime, atimeMs, birthtimeMs, ctimeMs, mtimeMs, mode, crc }); - return opts.bigint === true ? convertToBigIntStats(statInstance) : statInstance; - } - if (this.listings.has(p)) { - const uid = this.stats.uid; - const gid = this.stats.gid; - const size = 0; - const blksize = 512; - const blocks = 0; - const atimeMs = this.stats.mtimeMs; - const birthtimeMs = this.stats.mtimeMs; - const ctimeMs = this.stats.mtimeMs; - const mtimeMs = this.stats.mtimeMs; - const atime = new Date(atimeMs); - const birthtime = new Date(birthtimeMs); - const ctime = new Date(ctimeMs); - const mtime = new Date(mtimeMs); - const mode = fs.constants.S_IFDIR | 493; - const crc = 0; - const statInstance = Object.assign(new StatEntry(), { uid, gid, size, blksize, blocks, atime, birthtime, ctime, mtime, atimeMs, birthtimeMs, ctimeMs, mtimeMs, mode, crc }); - return opts.bigint === true ? convertToBigIntStats(statInstance) : statInstance; - } - throw new Error(`Unreachable`); - } - getUnixMode(index, defaultMode) { - const rc = this.libzip.file.getExternalAttributes(this.zip, index, 0, 0, this.libzip.uint08S, this.libzip.uint32S); - if (rc === -1) - throw this.makeLibzipError(this.libzip.getError(this.zip)); - const opsys = this.libzip.getValue(this.libzip.uint08S, `i8`) >>> 0; - if (opsys !== this.libzip.ZIP_OPSYS_UNIX) - return defaultMode; - return this.libzip.getValue(this.libzip.uint32S, `i32`) >>> 16; - } - registerListing(p) { - const existingListing = this.listings.get(p); - if (existingListing) - return existingListing; - const parentListing = this.registerListing(ppath.dirname(p)); - parentListing.add(ppath.basename(p)); - const newListing = /* @__PURE__ */ new Set(); - this.listings.set(p, newListing); - return newListing; - } - registerEntry(p, index) { - const parentListing = this.registerListing(ppath.dirname(p)); - parentListing.add(ppath.basename(p)); - this.entries.set(p, index); - } - unregisterListing(p) { - this.listings.delete(p); - const parentListing = this.listings.get(ppath.dirname(p)); - parentListing?.delete(ppath.basename(p)); - } - unregisterEntry(p) { - this.unregisterListing(p); - const entry = this.entries.get(p); - this.entries.delete(p); - if (typeof entry === `undefined`) - return; - this.fileSources.delete(entry); - if (this.isSymbolicLink(entry)) { - this.symlinkCount--; - } - } - deleteEntry(p, index) { - this.unregisterEntry(p); - const rc = this.libzip.delete(this.zip, index); - if (rc === -1) { - throw this.makeLibzipError(this.libzip.getError(this.zip)); - } - } - resolveFilename(reason, p, resolveLastComponent = true, throwIfNoEntry = true) { - if (!this.ready) - throw EBUSY(`archive closed, ${reason}`); - let resolvedP = ppath.resolve(PortablePath.root, p); - if (resolvedP === `/`) - return PortablePath.root; - const fileIndex = this.entries.get(resolvedP); - if (resolveLastComponent && fileIndex !== void 0) { - if (this.symlinkCount !== 0 && this.isSymbolicLink(fileIndex)) { - const target = this.getFileSource(fileIndex).toString(); - return this.resolveFilename(reason, ppath.resolve(ppath.dirname(resolvedP), target), true, throwIfNoEntry); - } else { - return resolvedP; - } - } - while (true) { - const parentP = this.resolveFilename(reason, ppath.dirname(resolvedP), true, throwIfNoEntry); - if (parentP === void 0) - return parentP; - const isDir = this.listings.has(parentP); - const doesExist = this.entries.has(parentP); - if (!isDir && !doesExist) { - if (throwIfNoEntry === false) - return void 0; - throw ENOENT(reason); - } - if (!isDir) - throw ENOTDIR(reason); - resolvedP = ppath.resolve(parentP, ppath.basename(resolvedP)); - if (!resolveLastComponent || this.symlinkCount === 0) - break; - const index = this.libzip.name.locate(this.zip, resolvedP.slice(1), 0); - if (index === -1) - break; - if (this.isSymbolicLink(index)) { - const target = this.getFileSource(index).toString(); - resolvedP = ppath.resolve(ppath.dirname(resolvedP), target); - } else { - break; - } - } - return resolvedP; - } - allocateBuffer(content) { - if (!Buffer.isBuffer(content)) - content = Buffer.from(content); - const buffer = this.libzip.malloc(content.byteLength); - if (!buffer) - throw new Error(`Couldn't allocate enough memory`); - const heap = new Uint8Array(this.libzip.HEAPU8.buffer, buffer, content.byteLength); - heap.set(content); - return { buffer, byteLength: content.byteLength }; - } - allocateUnattachedSource(content) { - const error = this.libzip.struct.errorS(); - const { buffer, byteLength } = this.allocateBuffer(content); - const source = this.libzip.source.fromUnattachedBuffer(buffer, byteLength, 0, 1, error); - if (source === 0) { - this.libzip.free(error); - throw this.makeLibzipError(error); - } - return source; - } - allocateSource(content) { - const { buffer, byteLength } = this.allocateBuffer(content); - const source = this.libzip.source.fromBuffer(this.zip, buffer, byteLength, 0, 1); - if (source === 0) { - this.libzip.free(buffer); - throw this.makeLibzipError(this.libzip.getError(this.zip)); - } - return source; - } - setFileSource(p, content) { - const buffer = Buffer.isBuffer(content) ? content : Buffer.from(content); - const target = ppath.relative(PortablePath.root, p); - const lzSource = this.allocateSource(content); - try { - const newIndex = this.libzip.file.add(this.zip, target, lzSource, this.libzip.ZIP_FL_OVERWRITE); - if (newIndex === -1) - throw this.makeLibzipError(this.libzip.getError(this.zip)); - if (this.level !== `mixed`) { - const method = this.level === 0 ? this.libzip.ZIP_CM_STORE : this.libzip.ZIP_CM_DEFLATE; - const rc = this.libzip.file.setCompression(this.zip, newIndex, 0, method, this.level); - if (rc === -1) { - throw this.makeLibzipError(this.libzip.getError(this.zip)); - } - } - this.fileSources.set(newIndex, buffer); - return newIndex; - } catch (error) { - this.libzip.source.free(lzSource); - throw error; - } - } - isSymbolicLink(index) { - if (this.symlinkCount === 0) - return false; - const attrs = this.libzip.file.getExternalAttributes(this.zip, index, 0, 0, this.libzip.uint08S, this.libzip.uint32S); - if (attrs === -1) - throw this.makeLibzipError(this.libzip.getError(this.zip)); - const opsys = this.libzip.getValue(this.libzip.uint08S, `i8`) >>> 0; - if (opsys !== this.libzip.ZIP_OPSYS_UNIX) - return false; - const attributes = this.libzip.getValue(this.libzip.uint32S, `i32`) >>> 16; - return (attributes & fs.constants.S_IFMT) === fs.constants.S_IFLNK; - } - getFileSource(index, opts = { asyncDecompress: false }) { - const cachedFileSource = this.fileSources.get(index); - if (typeof cachedFileSource !== `undefined`) - return cachedFileSource; - const stat = this.libzip.struct.statS(); - const rc = this.libzip.statIndex(this.zip, index, 0, 0, stat); - if (rc === -1) - throw this.makeLibzipError(this.libzip.getError(this.zip)); - const size = this.libzip.struct.statCompSize(stat); - const compressionMethod = this.libzip.struct.statCompMethod(stat); - const buffer = this.libzip.malloc(size); - try { - const file = this.libzip.fopenIndex(this.zip, index, 0, this.libzip.ZIP_FL_COMPRESSED); - if (file === 0) - throw this.makeLibzipError(this.libzip.getError(this.zip)); - try { - const rc2 = this.libzip.fread(file, buffer, size, 0); - if (rc2 === -1) - throw this.makeLibzipError(this.libzip.file.getError(file)); - else if (rc2 < size) - throw new Error(`Incomplete read`); - else if (rc2 > size) - throw new Error(`Overread`); - const memory = this.libzip.HEAPU8.subarray(buffer, buffer + size); - const data = Buffer.from(memory); - if (compressionMethod === 0) { - this.fileSources.set(index, data); - return data; - } else if (opts.asyncDecompress) { - return new Promise((resolve, reject) => { - zlib__default.default.inflateRaw(data, (error, result) => { - if (error) { - reject(error); - } else { - this.fileSources.set(index, result); - resolve(result); - } - }); - }); - } else { - const decompressedData = zlib__default.default.inflateRawSync(data); - this.fileSources.set(index, decompressedData); - return decompressedData; - } - } finally { - this.libzip.fclose(file); - } - } finally { - this.libzip.free(buffer); - } - } - async fchmodPromise(fd, mask) { - return this.chmodPromise(this.fdToPath(fd, `fchmod`), mask); - } - fchmodSync(fd, mask) { - return this.chmodSync(this.fdToPath(fd, `fchmodSync`), mask); - } - async chmodPromise(p, mask) { - return this.chmodSync(p, mask); - } - chmodSync(p, mask) { - if (this.readOnly) - throw EROFS(`chmod '${p}'`); - mask &= 493; - const resolvedP = this.resolveFilename(`chmod '${p}'`, p, false); - const entry = this.entries.get(resolvedP); - if (typeof entry === `undefined`) - throw new Error(`Assertion failed: The entry should have been registered (${resolvedP})`); - const oldMod = this.getUnixMode(entry, fs.constants.S_IFREG | 0); - const newMod = oldMod & ~511 | mask; - const rc = this.libzip.file.setExternalAttributes(this.zip, entry, 0, 0, this.libzip.ZIP_OPSYS_UNIX, newMod << 16); - if (rc === -1) { - throw this.makeLibzipError(this.libzip.getError(this.zip)); - } - } - async fchownPromise(fd, uid, gid) { - return this.chownPromise(this.fdToPath(fd, `fchown`), uid, gid); - } - fchownSync(fd, uid, gid) { - return this.chownSync(this.fdToPath(fd, `fchownSync`), uid, gid); - } - async chownPromise(p, uid, gid) { - return this.chownSync(p, uid, gid); - } - chownSync(p, uid, gid) { - throw new Error(`Unimplemented`); - } - async renamePromise(oldP, newP) { - return this.renameSync(oldP, newP); - } - renameSync(oldP, newP) { - throw new Error(`Unimplemented`); - } - async copyFilePromise(sourceP, destP, flags) { - const { indexSource, indexDest, resolvedDestP } = this.prepareCopyFile(sourceP, destP, flags); - const source = await this.getFileSource(indexSource, { asyncDecompress: true }); - const newIndex = this.setFileSource(resolvedDestP, source); - if (newIndex !== indexDest) { - this.registerEntry(resolvedDestP, newIndex); - } - } - copyFileSync(sourceP, destP, flags = 0) { - const { indexSource, indexDest, resolvedDestP } = this.prepareCopyFile(sourceP, destP, flags); - const source = this.getFileSource(indexSource); - const newIndex = this.setFileSource(resolvedDestP, source); - if (newIndex !== indexDest) { - this.registerEntry(resolvedDestP, newIndex); - } - } - prepareCopyFile(sourceP, destP, flags = 0) { - if (this.readOnly) - throw EROFS(`copyfile '${sourceP} -> '${destP}'`); - if ((flags & fs.constants.COPYFILE_FICLONE_FORCE) !== 0) - throw ENOSYS(`unsupported clone operation`, `copyfile '${sourceP}' -> ${destP}'`); - const resolvedSourceP = this.resolveFilename(`copyfile '${sourceP} -> ${destP}'`, sourceP); - const indexSource = this.entries.get(resolvedSourceP); - if (typeof indexSource === `undefined`) - throw EINVAL(`copyfile '${sourceP}' -> '${destP}'`); - const resolvedDestP = this.resolveFilename(`copyfile '${sourceP}' -> ${destP}'`, destP); - const indexDest = this.entries.get(resolvedDestP); - if ((flags & (fs.constants.COPYFILE_EXCL | fs.constants.COPYFILE_FICLONE_FORCE)) !== 0 && typeof indexDest !== `undefined`) - throw EEXIST(`copyfile '${sourceP}' -> '${destP}'`); - return { - indexSource, - resolvedDestP, - indexDest - }; - } - async appendFilePromise(p, content, opts) { - if (this.readOnly) - throw EROFS(`open '${p}'`); - if (typeof opts === `undefined`) - opts = { flag: `a` }; - else if (typeof opts === `string`) - opts = { flag: `a`, encoding: opts }; - else if (typeof opts.flag === `undefined`) - opts = { flag: `a`, ...opts }; - return this.writeFilePromise(p, content, opts); - } - appendFileSync(p, content, opts = {}) { - if (this.readOnly) - throw EROFS(`open '${p}'`); - if (typeof opts === `undefined`) - opts = { flag: `a` }; - else if (typeof opts === `string`) - opts = { flag: `a`, encoding: opts }; - else if (typeof opts.flag === `undefined`) - opts = { flag: `a`, ...opts }; - return this.writeFileSync(p, content, opts); - } - fdToPath(fd, reason) { - const path = this.fds.get(fd)?.p; - if (typeof path === `undefined`) - throw EBADF(reason); - return path; - } - async writeFilePromise(p, content, opts) { - const { encoding, mode, index, resolvedP } = this.prepareWriteFile(p, opts); - if (index !== void 0 && typeof opts === `object` && opts.flag && opts.flag.includes(`a`)) - content = Buffer.concat([await this.getFileSource(index, { asyncDecompress: true }), Buffer.from(content)]); - if (encoding !== null) - content = content.toString(encoding); - const newIndex = this.setFileSource(resolvedP, content); - if (newIndex !== index) - this.registerEntry(resolvedP, newIndex); - if (mode !== null) { - await this.chmodPromise(resolvedP, mode); - } - } - writeFileSync(p, content, opts) { - const { encoding, mode, index, resolvedP } = this.prepareWriteFile(p, opts); - if (index !== void 0 && typeof opts === `object` && opts.flag && opts.flag.includes(`a`)) - content = Buffer.concat([this.getFileSource(index), Buffer.from(content)]); - if (encoding !== null) - content = content.toString(encoding); - const newIndex = this.setFileSource(resolvedP, content); - if (newIndex !== index) - this.registerEntry(resolvedP, newIndex); - if (mode !== null) { - this.chmodSync(resolvedP, mode); - } - } - prepareWriteFile(p, opts) { - if (typeof p === `number`) - p = this.fdToPath(p, `read`); - if (this.readOnly) - throw EROFS(`open '${p}'`); - const resolvedP = this.resolveFilename(`open '${p}'`, p); - if (this.listings.has(resolvedP)) - throw EISDIR(`open '${p}'`); - let encoding = null, mode = null; - if (typeof opts === `string`) { - encoding = opts; - } else if (typeof opts === `object`) { - ({ - encoding = null, - mode = null - } = opts); - } - const index = this.entries.get(resolvedP); - return { - encoding, - mode, - resolvedP, - index - }; - } - async unlinkPromise(p) { - return this.unlinkSync(p); - } - unlinkSync(p) { - if (this.readOnly) - throw EROFS(`unlink '${p}'`); - const resolvedP = this.resolveFilename(`unlink '${p}'`, p); - if (this.listings.has(resolvedP)) - throw EISDIR(`unlink '${p}'`); - const index = this.entries.get(resolvedP); - if (typeof index === `undefined`) - throw EINVAL(`unlink '${p}'`); - this.deleteEntry(resolvedP, index); - } - async utimesPromise(p, atime, mtime) { - return this.utimesSync(p, atime, mtime); - } - utimesSync(p, atime, mtime) { - if (this.readOnly) - throw EROFS(`utimes '${p}'`); - const resolvedP = this.resolveFilename(`utimes '${p}'`, p); - this.utimesImpl(resolvedP, mtime); - } - async lutimesPromise(p, atime, mtime) { - return this.lutimesSync(p, atime, mtime); - } - lutimesSync(p, atime, mtime) { - if (this.readOnly) - throw EROFS(`lutimes '${p}'`); - const resolvedP = this.resolveFilename(`utimes '${p}'`, p, false); - this.utimesImpl(resolvedP, mtime); - } - utimesImpl(resolvedP, mtime) { - if (this.listings.has(resolvedP)) { - if (!this.entries.has(resolvedP)) - this.hydrateDirectory(resolvedP); - } - const entry = this.entries.get(resolvedP); - if (entry === void 0) - throw new Error(`Unreachable`); - const rc = this.libzip.file.setMtime(this.zip, entry, 0, toUnixTimestamp(mtime), 0); - if (rc === -1) { - throw this.makeLibzipError(this.libzip.getError(this.zip)); - } - } - async mkdirPromise(p, opts) { - return this.mkdirSync(p, opts); - } - mkdirSync(p, { mode = 493, recursive = false } = {}) { - if (recursive) - return this.mkdirpSync(p, { chmod: mode }); - if (this.readOnly) - throw EROFS(`mkdir '${p}'`); - const resolvedP = this.resolveFilename(`mkdir '${p}'`, p); - if (this.entries.has(resolvedP) || this.listings.has(resolvedP)) - throw EEXIST(`mkdir '${p}'`); - this.hydrateDirectory(resolvedP); - this.chmodSync(resolvedP, mode); - return void 0; - } - async rmdirPromise(p, opts) { - return this.rmdirSync(p, opts); - } - rmdirSync(p, { recursive = false } = {}) { - if (this.readOnly) - throw EROFS(`rmdir '${p}'`); - if (recursive) { - this.removeSync(p); - return; - } - const resolvedP = this.resolveFilename(`rmdir '${p}'`, p); - const directoryListing = this.listings.get(resolvedP); - if (!directoryListing) - throw ENOTDIR(`rmdir '${p}'`); - if (directoryListing.size > 0) - throw ENOTEMPTY(`rmdir '${p}'`); - const index = this.entries.get(resolvedP); - if (typeof index === `undefined`) - throw EINVAL(`rmdir '${p}'`); - this.deleteEntry(p, index); - } - async rmPromise(p, opts) { - return this.rmSync(p, opts); - } - rmSync(p, { recursive = false } = {}) { - if (this.readOnly) - throw EROFS(`rm '${p}'`); - if (recursive) { - this.removeSync(p); - return; - } - const resolvedP = this.resolveFilename(`rm '${p}'`, p); - const directoryListing = this.listings.get(resolvedP); - if (!directoryListing) - throw ENOTDIR(`rm '${p}'`); - if (directoryListing.size > 0) - throw ENOTEMPTY(`rm '${p}'`); - const index = this.entries.get(resolvedP); - if (typeof index === `undefined`) - throw EINVAL(`rm '${p}'`); - this.deleteEntry(p, index); - } - hydrateDirectory(resolvedP) { - const index = this.libzip.dir.add(this.zip, ppath.relative(PortablePath.root, resolvedP)); - if (index === -1) - throw this.makeLibzipError(this.libzip.getError(this.zip)); - this.registerListing(resolvedP); - this.registerEntry(resolvedP, index); - return index; - } - async linkPromise(existingP, newP) { - return this.linkSync(existingP, newP); - } - linkSync(existingP, newP) { - throw EOPNOTSUPP(`link '${existingP}' -> '${newP}'`); - } - async symlinkPromise(target, p) { - return this.symlinkSync(target, p); - } - symlinkSync(target, p) { - if (this.readOnly) - throw EROFS(`symlink '${target}' -> '${p}'`); - const resolvedP = this.resolveFilename(`symlink '${target}' -> '${p}'`, p); - if (this.listings.has(resolvedP)) - throw EISDIR(`symlink '${target}' -> '${p}'`); - if (this.entries.has(resolvedP)) - throw EEXIST(`symlink '${target}' -> '${p}'`); - const index = this.setFileSource(resolvedP, target); - this.registerEntry(resolvedP, index); - const rc = this.libzip.file.setExternalAttributes(this.zip, index, 0, 0, this.libzip.ZIP_OPSYS_UNIX, (fs.constants.S_IFLNK | 511) << 16); - if (rc === -1) - throw this.makeLibzipError(this.libzip.getError(this.zip)); - this.symlinkCount += 1; - } - async readFilePromise(p, encoding) { - if (typeof encoding === `object`) - encoding = encoding ? encoding.encoding : void 0; - const data = await this.readFileBuffer(p, { asyncDecompress: true }); - return encoding ? data.toString(encoding) : data; - } - readFileSync(p, encoding) { - if (typeof encoding === `object`) - encoding = encoding ? encoding.encoding : void 0; - const data = this.readFileBuffer(p); - return encoding ? data.toString(encoding) : data; - } - readFileBuffer(p, opts = { asyncDecompress: false }) { - if (typeof p === `number`) - p = this.fdToPath(p, `read`); - const resolvedP = this.resolveFilename(`open '${p}'`, p); - if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) - throw ENOENT(`open '${p}'`); - if (p[p.length - 1] === `/` && !this.listings.has(resolvedP)) - throw ENOTDIR(`open '${p}'`); - if (this.listings.has(resolvedP)) - throw EISDIR(`read`); - const entry = this.entries.get(resolvedP); - if (entry === void 0) - throw new Error(`Unreachable`); - return this.getFileSource(entry, opts); - } - async readdirPromise(p, opts) { - return this.readdirSync(p, opts); - } - readdirSync(p, opts) { - const resolvedP = this.resolveFilename(`scandir '${p}'`, p); - if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) - throw ENOENT(`scandir '${p}'`); - const directoryListing = this.listings.get(resolvedP); - if (!directoryListing) - throw ENOTDIR(`scandir '${p}'`); - if (opts?.recursive) { - if (opts?.withFileTypes) { - const entries = Array.from(directoryListing, (name) => { - return Object.assign(this.statImpl(`lstat`, ppath.join(p, name)), { - name, - path: PortablePath.dot - }); - }); - for (const entry of entries) { - if (!entry.isDirectory()) - continue; - const subPath = ppath.join(entry.path, entry.name); - const subListing = this.listings.get(ppath.join(resolvedP, subPath)); - for (const child of subListing) { - entries.push(Object.assign(this.statImpl(`lstat`, ppath.join(p, subPath, child)), { - name: child, - path: subPath - })); - } - } - return entries; - } else { - const entries = [...directoryListing]; - for (const subPath of entries) { - const subListing = this.listings.get(ppath.join(resolvedP, subPath)); - if (typeof subListing === `undefined`) - continue; - for (const child of subListing) { - entries.push(ppath.join(subPath, child)); - } - } - return entries; - } - } else if (opts?.withFileTypes) { - return Array.from(directoryListing, (name) => { - return Object.assign(this.statImpl(`lstat`, ppath.join(p, name)), { - name, - path: void 0 - }); - }); - } else { - return [...directoryListing]; - } - } - async readlinkPromise(p) { - const entry = this.prepareReadlink(p); - return (await this.getFileSource(entry, { asyncDecompress: true })).toString(); - } - readlinkSync(p) { - const entry = this.prepareReadlink(p); - return this.getFileSource(entry).toString(); - } - prepareReadlink(p) { - const resolvedP = this.resolveFilename(`readlink '${p}'`, p, false); - if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) - throw ENOENT(`readlink '${p}'`); - if (p[p.length - 1] === `/` && !this.listings.has(resolvedP)) - throw ENOTDIR(`open '${p}'`); - if (this.listings.has(resolvedP)) - throw EINVAL(`readlink '${p}'`); - const entry = this.entries.get(resolvedP); - if (entry === void 0) - throw new Error(`Unreachable`); - if (!this.isSymbolicLink(entry)) - throw EINVAL(`readlink '${p}'`); - return entry; - } - async truncatePromise(p, len = 0) { - const resolvedP = this.resolveFilename(`open '${p}'`, p); - const index = this.entries.get(resolvedP); - if (typeof index === `undefined`) - throw EINVAL(`open '${p}'`); - const source = await this.getFileSource(index, { asyncDecompress: true }); - const truncated = Buffer.alloc(len, 0); - source.copy(truncated); - return await this.writeFilePromise(p, truncated); - } - truncateSync(p, len = 0) { - const resolvedP = this.resolveFilename(`open '${p}'`, p); - const index = this.entries.get(resolvedP); - if (typeof index === `undefined`) - throw EINVAL(`open '${p}'`); - const source = this.getFileSource(index); - const truncated = Buffer.alloc(len, 0); - source.copy(truncated); - return this.writeFileSync(p, truncated); - } - async ftruncatePromise(fd, len) { - return this.truncatePromise(this.fdToPath(fd, `ftruncate`), len); - } - ftruncateSync(fd, len) { - return this.truncateSync(this.fdToPath(fd, `ftruncateSync`), len); - } - watch(p, a, b) { - let persistent; - switch (typeof a) { - case `function`: - case `string`: - case `undefined`: - { - persistent = true; - } - break; - default: - { - ({ persistent = true } = a); - } - break; - } - if (!persistent) - return { on: () => { - }, close: () => { - } }; - const interval = setInterval(() => { - }, 24 * 60 * 60 * 1e3); - return { on: () => { - }, close: () => { - clearInterval(interval); - } }; - } - watchFile(p, a, b) { - const resolvedP = ppath.resolve(PortablePath.root, p); - return watchFile(this, resolvedP, a, b); - } - unwatchFile(p, cb) { - const resolvedP = ppath.resolve(PortablePath.root, p); - return unwatchFile(this, resolvedP, cb); - } -} - -setFactory(() => { - const emZip = createModule(); - return makeInterface(emZip); -}); - -var ErrorCode = /* @__PURE__ */ ((ErrorCode2) => { - ErrorCode2["API_ERROR"] = `API_ERROR`; - ErrorCode2["BUILTIN_NODE_RESOLUTION_FAILED"] = `BUILTIN_NODE_RESOLUTION_FAILED`; - ErrorCode2["EXPORTS_RESOLUTION_FAILED"] = `EXPORTS_RESOLUTION_FAILED`; - ErrorCode2["MISSING_DEPENDENCY"] = `MISSING_DEPENDENCY`; - ErrorCode2["MISSING_PEER_DEPENDENCY"] = `MISSING_PEER_DEPENDENCY`; - ErrorCode2["QUALIFIED_PATH_RESOLUTION_FAILED"] = `QUALIFIED_PATH_RESOLUTION_FAILED`; - ErrorCode2["INTERNAL"] = `INTERNAL`; - ErrorCode2["UNDECLARED_DEPENDENCY"] = `UNDECLARED_DEPENDENCY`; - ErrorCode2["UNSUPPORTED"] = `UNSUPPORTED`; - return ErrorCode2; -})(ErrorCode || {}); -const MODULE_NOT_FOUND_ERRORS = /* @__PURE__ */ new Set([ - "BUILTIN_NODE_RESOLUTION_FAILED" /* BUILTIN_NODE_RESOLUTION_FAILED */, - "MISSING_DEPENDENCY" /* MISSING_DEPENDENCY */, - "MISSING_PEER_DEPENDENCY" /* MISSING_PEER_DEPENDENCY */, - "QUALIFIED_PATH_RESOLUTION_FAILED" /* QUALIFIED_PATH_RESOLUTION_FAILED */, - "UNDECLARED_DEPENDENCY" /* UNDECLARED_DEPENDENCY */ -]); -function makeError(pnpCode, message, data = {}, code) { - code ??= MODULE_NOT_FOUND_ERRORS.has(pnpCode) ? `MODULE_NOT_FOUND` : pnpCode; - const propertySpec = { - configurable: true, - writable: true, - enumerable: false - }; - return Object.defineProperties(new Error(message), { - code: { - ...propertySpec, - value: code - }, - pnpCode: { - ...propertySpec, - value: pnpCode - }, - data: { - ...propertySpec, - value: data - } - }); -} -function getIssuerModule(parent) { - let issuer = parent; - while (issuer && (issuer.id === `[eval]` || issuer.id === `` || !issuer.filename)) - issuer = issuer.parent; - return issuer || null; -} -function getPathForDisplay(p) { - return npath.normalize(npath.fromPortablePath(p)); -} - -const [major, minor] = process.versions.node.split(`.`).map((value) => parseInt(value, 10)); -const WATCH_MODE_MESSAGE_USES_ARRAYS = major > 19 || major === 19 && minor >= 2 || major === 18 && minor >= 13; - -function readPackageScope(checkPath) { - const rootSeparatorIndex = checkPath.indexOf(npath.sep); - let separatorIndex; - do { - separatorIndex = checkPath.lastIndexOf(npath.sep); - checkPath = checkPath.slice(0, separatorIndex); - if (checkPath.endsWith(`${npath.sep}node_modules`)) - return false; - const pjson = readPackage(checkPath + npath.sep); - if (pjson) { - return { - data: pjson, - path: checkPath - }; - } - } while (separatorIndex > rootSeparatorIndex); - return false; -} -function readPackage(requestPath) { - const jsonPath = npath.resolve(requestPath, `package.json`); - if (!fs__default.default.existsSync(jsonPath)) - return null; - return JSON.parse(fs__default.default.readFileSync(jsonPath, `utf8`)); -} -function ERR_REQUIRE_ESM(filename, parentPath = null) { - const basename = parentPath && path__default.default.basename(filename) === path__default.default.basename(parentPath) ? filename : path__default.default.basename(filename); - const msg = `require() of ES Module ${filename}${parentPath ? ` from ${parentPath}` : ``} not supported. -Instead change the require of ${basename} in ${parentPath} to a dynamic import() which is available in all CommonJS modules.`; - const err = new Error(msg); - err.code = `ERR_REQUIRE_ESM`; - return err; -} -function reportRequiredFilesToWatchMode(files) { - if (process.env.WATCH_REPORT_DEPENDENCIES && process.send) { - files = files.map((filename) => npath.fromPortablePath(VirtualFS.resolveVirtual(npath.toPortablePath(filename)))); - if (WATCH_MODE_MESSAGE_USES_ARRAYS) { - process.send({ "watch:require": files }); - } else { - for (const filename of files) { - process.send({ "watch:require": filename }); - } - } - } -} - -function applyPatch(pnpapi, opts) { - let enableNativeHooks = true; - process.versions.pnp = String(pnpapi.VERSIONS.std); - const moduleExports = require$$0__default.default; - moduleExports.findPnpApi = (lookupSource) => { - const lookupPath = lookupSource instanceof URL ? url.fileURLToPath(lookupSource) : lookupSource; - const apiPath = opts.manager.findApiPathFor(lookupPath); - if (apiPath === null) - return null; - const apiEntry = opts.manager.getApiEntry(apiPath, true); - return apiEntry.instance.findPackageLocator(lookupPath) ? apiEntry.instance : null; - }; - function getRequireStack(parent) { - const requireStack = []; - for (let cursor = parent; cursor; cursor = cursor.parent) - requireStack.push(cursor.filename || cursor.id); - return requireStack; - } - const originalModuleLoad = require$$0.Module._load; - require$$0.Module._load = function(request, parent, isMain) { - if (request === `pnpapi`) { - const parentApiPath = opts.manager.getApiPathFromParent(parent); - if (parentApiPath) { - return opts.manager.getApiEntry(parentApiPath, true).instance; - } - } - return originalModuleLoad.call(require$$0.Module, request, parent, isMain); - }; - function getIssuerSpecsFromPaths(paths) { - return paths.map((path) => ({ - apiPath: opts.manager.findApiPathFor(path), - path, - module: null - })); - } - function getIssuerSpecsFromModule(module) { - if (module && module.id !== `` && module.id !== `internal/preload` && !module.parent && !module.filename && module.paths.length > 0) { - return [{ - apiPath: opts.manager.findApiPathFor(module.paths[0]), - path: module.paths[0], - module - }]; - } - const issuer = getIssuerModule(module); - if (issuer !== null) { - const path = npath.dirname(issuer.filename); - const apiPath = opts.manager.getApiPathFromParent(issuer); - return [{ apiPath, path, module }]; - } else { - const path = process.cwd(); - const apiPath = opts.manager.findApiPathFor(npath.join(path, `[file]`)) ?? opts.manager.getApiPathFromParent(null); - return [{ apiPath, path, module }]; - } - } - function makeFakeParent(path) { - const fakeParent = new require$$0.Module(``); - const fakeFilePath = npath.join(path, `[file]`); - fakeParent.paths = require$$0.Module._nodeModulePaths(fakeFilePath); - return fakeParent; - } - const pathRegExp = /^(?![a-zA-Z]:[\\/]|\\\\|\.{0,2}(?:\/|$))((?:@[^/]+\/)?[^/]+)\/*(.*|)$/; - const originalModuleResolveFilename = require$$0.Module._resolveFilename; - require$$0.Module._resolveFilename = function(request, parent, isMain, options) { - if (require$$0.isBuiltin(request)) - return request; - if (!enableNativeHooks) - return originalModuleResolveFilename.call(require$$0.Module, request, parent, isMain, options); - if (options && options.plugnplay === false) { - const { plugnplay, ...forwardedOptions } = options; - try { - enableNativeHooks = false; - return originalModuleResolveFilename.call(require$$0.Module, request, parent, isMain, forwardedOptions); - } finally { - enableNativeHooks = true; - } - } - if (options) { - const optionNames = new Set(Object.keys(options)); - optionNames.delete(`paths`); - optionNames.delete(`plugnplay`); - if (optionNames.size > 0) { - throw makeError( - ErrorCode.UNSUPPORTED, - `Some options passed to require() aren't supported by PnP yet (${Array.from(optionNames).join(`, `)})` - ); - } - } - const issuerSpecs = options && options.paths ? getIssuerSpecsFromPaths(options.paths) : getIssuerSpecsFromModule(parent); - if (request.match(pathRegExp) === null) { - const parentDirectory = parent?.filename != null ? npath.dirname(parent.filename) : null; - const absoluteRequest = npath.isAbsolute(request) ? request : parentDirectory !== null ? npath.resolve(parentDirectory, request) : null; - if (absoluteRequest !== null) { - const apiPath = parent && parentDirectory === npath.dirname(absoluteRequest) ? opts.manager.getApiPathFromParent(parent) : opts.manager.findApiPathFor(absoluteRequest); - if (apiPath !== null) { - issuerSpecs.unshift({ - apiPath, - path: parentDirectory, - module: null - }); - } - } - } - let firstError; - for (const { apiPath, path, module } of issuerSpecs) { - let resolution; - const issuerApi = apiPath !== null ? opts.manager.getApiEntry(apiPath, true).instance : null; - try { - if (issuerApi !== null) { - resolution = issuerApi.resolveRequest(request, path !== null ? `${path}/` : null); - } else { - if (path === null) - throw new Error(`Assertion failed: Expected the path to be set`); - resolution = originalModuleResolveFilename.call(require$$0.Module, request, module || makeFakeParent(path), isMain); - } - } catch (error) { - firstError = firstError || error; - continue; - } - if (resolution !== null) { - return resolution; - } - } - const requireStack = getRequireStack(parent); - Object.defineProperty(firstError, `requireStack`, { - configurable: true, - writable: true, - enumerable: false, - value: requireStack - }); - if (requireStack.length > 0) - firstError.message += ` -Require stack: -- ${requireStack.join(` -- `)}`; - if (typeof firstError.pnpCode === `string`) - Error.captureStackTrace(firstError); - throw firstError; - }; - const originalFindPath = require$$0.Module._findPath; - require$$0.Module._findPath = function(request, paths, isMain) { - if (request === `pnpapi`) - return false; - if (!enableNativeHooks) - return originalFindPath.call(require$$0.Module, request, paths, isMain); - const isAbsolute = npath.isAbsolute(request); - if (isAbsolute) - paths = [``]; - else if (!paths || paths.length === 0) - return false; - for (const path of paths) { - let resolution; - try { - const pnpApiPath = opts.manager.findApiPathFor(isAbsolute ? request : path); - if (pnpApiPath !== null) { - const api = opts.manager.getApiEntry(pnpApiPath, true).instance; - resolution = api.resolveRequest(request, path) || false; - } else { - resolution = originalFindPath.call(require$$0.Module, request, [path], isMain); - } - } catch (error) { - continue; - } - if (resolution) { - return resolution; - } - } - return false; - }; - const originalExtensionJSFunction = require$$0.Module._extensions[`.js`]; - require$$0.Module._extensions[`.js`] = function(module, filename) { - if (filename.endsWith(`.js`)) { - const pkg = readPackageScope(filename); - if (pkg && pkg.data?.type === `module`) { - const err = ERR_REQUIRE_ESM(filename, module.parent?.filename); - Error.captureStackTrace(err); - throw err; - } - } - originalExtensionJSFunction.call(this, module, filename); - }; - const originalDlopen = process.dlopen; - process.dlopen = function(...args) { - const [module, filename, ...rest] = args; - return originalDlopen.call( - this, - module, - npath.fromPortablePath(VirtualFS.resolveVirtual(npath.toPortablePath(filename))), - ...rest - ); - }; - const originalEmit = process.emit; - process.emit = function(name, data, ...args) { - if (name === `warning` && typeof data === `object` && data.name === `ExperimentalWarning` && (data.message.includes(`--experimental-loader`) || data.message.includes(`Custom ESM Loaders is an experimental feature`))) - return false; - return originalEmit.apply(process, arguments); - }; - patchFs(fs__default.default, new PosixFS(opts.fakeFs)); -} - -function hydrateRuntimeState(data, { basePath }) { - const portablePath = npath.toPortablePath(basePath); - const absolutePortablePath = ppath.resolve(portablePath); - const ignorePattern = data.ignorePatternData !== null ? new RegExp(data.ignorePatternData) : null; - const packageLocatorsByLocations = /* @__PURE__ */ new Map(); - const packageRegistry = new Map(data.packageRegistryData.map(([packageName, packageStoreData]) => { - return [packageName, new Map(packageStoreData.map(([packageReference, packageInformationData]) => { - if (packageName === null !== (packageReference === null)) - throw new Error(`Assertion failed: The name and reference should be null, or neither should`); - const discardFromLookup = packageInformationData.discardFromLookup ?? false; - const packageLocator = { name: packageName, reference: packageReference }; - const entry = packageLocatorsByLocations.get(packageInformationData.packageLocation); - if (!entry) { - packageLocatorsByLocations.set(packageInformationData.packageLocation, { locator: packageLocator, discardFromLookup }); - } else { - entry.discardFromLookup = entry.discardFromLookup && discardFromLookup; - if (!discardFromLookup) { - entry.locator = packageLocator; - } - } - let resolvedPackageLocation = null; - return [packageReference, { - packageDependencies: new Map(packageInformationData.packageDependencies), - packagePeers: new Set(packageInformationData.packagePeers), - linkType: packageInformationData.linkType, - discardFromLookup, - get packageLocation() { - return resolvedPackageLocation || (resolvedPackageLocation = ppath.join(absolutePortablePath, packageInformationData.packageLocation)); - } - }]; - }))]; - })); - const fallbackExclusionList = new Map(data.fallbackExclusionList.map(([packageName, packageReferences]) => { - return [packageName, new Set(packageReferences)]; - })); - const fallbackPool = new Map(data.fallbackPool); - const dependencyTreeRoots = data.dependencyTreeRoots; - const enableTopLevelFallback = data.enableTopLevelFallback; - return { - basePath: portablePath, - dependencyTreeRoots, - enableTopLevelFallback, - fallbackExclusionList, - fallbackPool, - ignorePattern, - packageLocatorsByLocations, - packageRegistry - }; -} - -const ArrayIsArray = Array.isArray; -const JSONStringify = JSON.stringify; -const ObjectGetOwnPropertyNames = Object.getOwnPropertyNames; -const ObjectPrototypeHasOwnProperty = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop); -const RegExpPrototypeExec = (obj, string) => RegExp.prototype.exec.call(obj, string); -const RegExpPrototypeSymbolReplace = (obj, ...rest) => RegExp.prototype[Symbol.replace].apply(obj, rest); -const StringPrototypeEndsWith = (str, ...rest) => String.prototype.endsWith.apply(str, rest); -const StringPrototypeIncludes = (str, ...rest) => String.prototype.includes.apply(str, rest); -const StringPrototypeLastIndexOf = (str, ...rest) => String.prototype.lastIndexOf.apply(str, rest); -const StringPrototypeIndexOf = (str, ...rest) => String.prototype.indexOf.apply(str, rest); -const StringPrototypeReplace = (str, ...rest) => String.prototype.replace.apply(str, rest); -const StringPrototypeSlice = (str, ...rest) => String.prototype.slice.apply(str, rest); -const StringPrototypeStartsWith = (str, ...rest) => String.prototype.startsWith.apply(str, rest); -const SafeMap = Map; -const JSONParse = JSON.parse; - -function createErrorType(code, messageCreator, errorType) { - return class extends errorType { - constructor(...args) { - super(messageCreator(...args)); - this.code = code; - this.name = `${errorType.name} [${code}]`; - } - }; -} -const ERR_PACKAGE_IMPORT_NOT_DEFINED = createErrorType( - `ERR_PACKAGE_IMPORT_NOT_DEFINED`, - (specifier, packagePath, base) => { - return `Package import specifier "${specifier}" is not defined${packagePath ? ` in package ${packagePath}package.json` : ``} imported from ${base}`; - }, - TypeError -); -const ERR_INVALID_MODULE_SPECIFIER = createErrorType( - `ERR_INVALID_MODULE_SPECIFIER`, - (request, reason, base = void 0) => { - return `Invalid module "${request}" ${reason}${base ? ` imported from ${base}` : ``}`; - }, - TypeError -); -const ERR_INVALID_PACKAGE_TARGET = createErrorType( - `ERR_INVALID_PACKAGE_TARGET`, - (pkgPath, key, target, isImport = false, base = void 0) => { - const relError = typeof target === `string` && !isImport && target.length && !StringPrototypeStartsWith(target, `./`); - if (key === `.`) { - assert__default.default(isImport === false); - return `Invalid "exports" main target ${JSONStringify(target)} defined in the package config ${pkgPath}package.json${base ? ` imported from ${base}` : ``}${relError ? `; targets must start with "./"` : ``}`; - } - return `Invalid "${isImport ? `imports` : `exports`}" target ${JSONStringify( - target - )} defined for '${key}' in the package config ${pkgPath}package.json${base ? ` imported from ${base}` : ``}${relError ? `; targets must start with "./"` : ``}`; - }, - Error -); -const ERR_INVALID_PACKAGE_CONFIG = createErrorType( - `ERR_INVALID_PACKAGE_CONFIG`, - (path, base, message) => { - return `Invalid package config ${path}${base ? ` while importing ${base}` : ``}${message ? `. ${message}` : ``}`; - }, - Error -); -const ERR_PACKAGE_PATH_NOT_EXPORTED = createErrorType( - "ERR_PACKAGE_PATH_NOT_EXPORTED", - (pkgPath, subpath, base = void 0) => { - if (subpath === ".") - return `No "exports" main defined in ${pkgPath}package.json${base ? ` imported from ${base}` : ""}`; - return `Package subpath '${subpath}' is not defined by "exports" in ${pkgPath}package.json${base ? ` imported from ${base}` : ""}`; - }, - Error -); - -function filterOwnProperties(source, keys) { - const filtered = /* @__PURE__ */ Object.create(null); - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - if (ObjectPrototypeHasOwnProperty(source, key)) { - filtered[key] = source[key]; - } - } - return filtered; -} - -const packageJSONCache = new SafeMap(); -function getPackageConfig(path, specifier, base, readFileSyncFn) { - const existing = packageJSONCache.get(path); - if (existing !== void 0) { - return existing; - } - const source = readFileSyncFn(path); - if (source === void 0) { - const packageConfig2 = { - pjsonPath: path, - exists: false, - main: void 0, - name: void 0, - type: "none", - exports: void 0, - imports: void 0 - }; - packageJSONCache.set(path, packageConfig2); - return packageConfig2; - } - let packageJSON; - try { - packageJSON = JSONParse(source); - } catch (error) { - throw new ERR_INVALID_PACKAGE_CONFIG( - path, - (base ? `"${specifier}" from ` : "") + url.fileURLToPath(base || specifier), - error.message - ); - } - let { imports, main, name, type } = filterOwnProperties(packageJSON, [ - "imports", - "main", - "name", - "type" - ]); - const exports = ObjectPrototypeHasOwnProperty(packageJSON, "exports") ? packageJSON.exports : void 0; - if (typeof imports !== "object" || imports === null) { - imports = void 0; - } - if (typeof main !== "string") { - main = void 0; - } - if (typeof name !== "string") { - name = void 0; - } - if (type !== "module" && type !== "commonjs") { - type = "none"; - } - const packageConfig = { - pjsonPath: path, - exists: true, - main, - name, - type, - exports, - imports - }; - packageJSONCache.set(path, packageConfig); - return packageConfig; -} -function getPackageScopeConfig(resolved, readFileSyncFn) { - let packageJSONUrl = new URL("./package.json", resolved); - while (true) { - const packageJSONPath2 = packageJSONUrl.pathname; - if (StringPrototypeEndsWith(packageJSONPath2, "node_modules/package.json")) { - break; - } - const packageConfig2 = getPackageConfig( - url.fileURLToPath(packageJSONUrl), - resolved, - void 0, - readFileSyncFn - ); - if (packageConfig2.exists) { - return packageConfig2; - } - const lastPackageJSONUrl = packageJSONUrl; - packageJSONUrl = new URL("../package.json", packageJSONUrl); - if (packageJSONUrl.pathname === lastPackageJSONUrl.pathname) { - break; - } - } - const packageJSONPath = url.fileURLToPath(packageJSONUrl); - const packageConfig = { - pjsonPath: packageJSONPath, - exists: false, - main: void 0, - name: void 0, - type: "none", - exports: void 0, - imports: void 0 - }; - packageJSONCache.set(packageJSONPath, packageConfig); - return packageConfig; -} - -function throwImportNotDefined(specifier, packageJSONUrl, base) { - throw new ERR_PACKAGE_IMPORT_NOT_DEFINED( - specifier, - packageJSONUrl && url.fileURLToPath(new URL(".", packageJSONUrl)), - url.fileURLToPath(base) - ); -} -function throwInvalidSubpath(subpath, packageJSONUrl, internal, base) { - const reason = `request is not a valid subpath for the "${internal ? "imports" : "exports"}" resolution of ${url.fileURLToPath(packageJSONUrl)}`; - throw new ERR_INVALID_MODULE_SPECIFIER( - subpath, - reason, - base && url.fileURLToPath(base) - ); -} -function throwInvalidPackageTarget(subpath, target, packageJSONUrl, internal, base) { - if (typeof target === "object" && target !== null) { - target = JSONStringify(target, null, ""); - } else { - target = `${target}`; - } - throw new ERR_INVALID_PACKAGE_TARGET( - url.fileURLToPath(new URL(".", packageJSONUrl)), - subpath, - target, - internal, - base && url.fileURLToPath(base) - ); -} -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; -const patternRegEx = /\*/g; -function resolvePackageTargetString(target, subpath, match, packageJSONUrl, base, pattern, internal, conditions) { - if (subpath !== "" && !pattern && target[target.length - 1] !== "/") - throwInvalidPackageTarget(match, target, packageJSONUrl, internal, base); - if (!StringPrototypeStartsWith(target, "./")) { - if (internal && !StringPrototypeStartsWith(target, "../") && !StringPrototypeStartsWith(target, "/")) { - let isURL = false; - try { - new URL(target); - isURL = true; - } catch { - } - if (!isURL) { - const exportTarget = pattern ? RegExpPrototypeSymbolReplace(patternRegEx, target, () => subpath) : target + subpath; - return exportTarget; - } - } - throwInvalidPackageTarget(match, target, packageJSONUrl, internal, base); - } - if (RegExpPrototypeExec( - invalidSegmentRegEx, - StringPrototypeSlice(target, 2) - ) !== null) - throwInvalidPackageTarget(match, target, packageJSONUrl, internal, base); - const resolved = new URL(target, packageJSONUrl); - const resolvedPath = resolved.pathname; - const packagePath = new URL(".", packageJSONUrl).pathname; - if (!StringPrototypeStartsWith(resolvedPath, packagePath)) - throwInvalidPackageTarget(match, target, packageJSONUrl, internal, base); - if (subpath === "") - return resolved; - if (RegExpPrototypeExec(invalidSegmentRegEx, subpath) !== null) { - const request = pattern ? StringPrototypeReplace(match, "*", () => subpath) : match + subpath; - throwInvalidSubpath(request, packageJSONUrl, internal, base); - } - if (pattern) { - return new URL( - RegExpPrototypeSymbolReplace(patternRegEx, resolved.href, () => subpath) - ); - } - return new URL(subpath, resolved); -} -function isArrayIndex(key) { - const keyNum = +key; - if (`${keyNum}` !== key) - return false; - return keyNum >= 0 && keyNum < 4294967295; -} -function resolvePackageTarget(packageJSONUrl, target, subpath, packageSubpath, base, pattern, internal, conditions) { - if (typeof target === "string") { - return resolvePackageTargetString( - target, - subpath, - packageSubpath, - packageJSONUrl, - base, - pattern, - internal); - } else if (ArrayIsArray(target)) { - if (target.length === 0) { - return null; - } - let lastException; - for (let i = 0; i < target.length; i++) { - const targetItem = target[i]; - let resolveResult; - try { - resolveResult = resolvePackageTarget( - packageJSONUrl, - targetItem, - subpath, - packageSubpath, - base, - pattern, - internal, - conditions - ); - } catch (e) { - lastException = e; - if (e.code === "ERR_INVALID_PACKAGE_TARGET") { - continue; - } - throw e; - } - if (resolveResult === void 0) { - continue; - } - if (resolveResult === null) { - lastException = null; - continue; - } - return resolveResult; - } - if (lastException === void 0 || lastException === null) - return lastException; - throw lastException; - } else if (typeof target === "object" && target !== null) { - const keys = ObjectGetOwnPropertyNames(target); - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - if (isArrayIndex(key)) { - throw new ERR_INVALID_PACKAGE_CONFIG( - url.fileURLToPath(packageJSONUrl), - base, - '"exports" cannot contain numeric property keys.' - ); - } - } - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - if (key === "default" || conditions.has(key)) { - const conditionalTarget = target[key]; - const resolveResult = resolvePackageTarget( - packageJSONUrl, - conditionalTarget, - subpath, - packageSubpath, - base, - pattern, - internal, - conditions - ); - if (resolveResult === void 0) - continue; - return resolveResult; - } - } - return void 0; - } else if (target === null) { - return null; - } - throwInvalidPackageTarget( - packageSubpath, - target, - packageJSONUrl, - internal, - base - ); -} -function patternKeyCompare(a, b) { - const aPatternIndex = StringPrototypeIndexOf(a, "*"); - const bPatternIndex = StringPrototypeIndexOf(b, "*"); - 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; -} -function isConditionalExportsMainSugar(exports, packageJSONUrl, base) { - if (typeof exports === "string" || ArrayIsArray(exports)) - return true; - if (typeof exports !== "object" || exports === null) - return false; - const keys = ObjectGetOwnPropertyNames(exports); - let isConditionalSugar = false; - let i = 0; - for (let j = 0; j < keys.length; j++) { - const key = keys[j]; - const curIsConditionalSugar = key === "" || key[0] !== "."; - if (i++ === 0) { - isConditionalSugar = curIsConditionalSugar; - } else if (isConditionalSugar !== curIsConditionalSugar) { - throw new ERR_INVALID_PACKAGE_CONFIG( - url.fileURLToPath(packageJSONUrl), - base, - `"exports" cannot contain some keys starting with '.' and some not. The exports object must either be an object of package subpath keys or an object of main entry condition name keys only.` - ); - } - } - return isConditionalSugar; -} -function throwExportsNotFound(subpath, packageJSONUrl, base) { - throw new ERR_PACKAGE_PATH_NOT_EXPORTED( - url.fileURLToPath(new URL(".", packageJSONUrl)), - subpath, - base && url.fileURLToPath(base) - ); -} -const emittedPackageWarnings = /* @__PURE__ */ new Set(); -function emitTrailingSlashPatternDeprecation(match, pjsonUrl, base) { - const pjsonPath = url.fileURLToPath(pjsonUrl); - if (emittedPackageWarnings.has(pjsonPath + "|" + match)) - return; - emittedPackageWarnings.add(pjsonPath + "|" + match); - process.emitWarning( - `Use of deprecated trailing slash pattern mapping "${match}" in the "exports" field module resolution of the package at ${pjsonPath}${base ? ` imported from ${url.fileURLToPath(base)}` : ""}. Mapping specifiers ending in "/" is no longer supported.`, - "DeprecationWarning", - "DEP0155" - ); -} -function packageExportsResolve({ - packageJSONUrl, - packageSubpath, - exports, - base, - conditions -}) { - if (isConditionalExportsMainSugar(exports, packageJSONUrl, base)) - exports = { ".": exports }; - if (ObjectPrototypeHasOwnProperty(exports, packageSubpath) && !StringPrototypeIncludes(packageSubpath, "*") && !StringPrototypeEndsWith(packageSubpath, "/")) { - const target = exports[packageSubpath]; - const resolveResult = resolvePackageTarget( - packageJSONUrl, - target, - "", - packageSubpath, - base, - false, - false, - conditions - ); - if (resolveResult == null) { - throwExportsNotFound(packageSubpath, packageJSONUrl, base); - } - return resolveResult; - } - let bestMatch = ""; - let bestMatchSubpath; - const keys = ObjectGetOwnPropertyNames(exports); - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - const patternIndex = StringPrototypeIndexOf(key, "*"); - if (patternIndex !== -1 && StringPrototypeStartsWith( - packageSubpath, - StringPrototypeSlice(key, 0, patternIndex) - )) { - if (StringPrototypeEndsWith(packageSubpath, "/")) - emitTrailingSlashPatternDeprecation( - packageSubpath, - packageJSONUrl, - base - ); - const patternTrailer = StringPrototypeSlice(key, patternIndex + 1); - if (packageSubpath.length >= key.length && StringPrototypeEndsWith(packageSubpath, patternTrailer) && patternKeyCompare(bestMatch, key) === 1 && StringPrototypeLastIndexOf(key, "*") === patternIndex) { - bestMatch = key; - bestMatchSubpath = StringPrototypeSlice( - packageSubpath, - patternIndex, - packageSubpath.length - patternTrailer.length - ); - } - } - } - if (bestMatch) { - const target = exports[bestMatch]; - const resolveResult = resolvePackageTarget( - packageJSONUrl, - target, - bestMatchSubpath, - bestMatch, - base, - true, - false, - conditions - ); - if (resolveResult == null) { - throwExportsNotFound(packageSubpath, packageJSONUrl, base); - } - return resolveResult; - } - throwExportsNotFound(packageSubpath, packageJSONUrl, base); -} -function packageImportsResolve({ name, base, conditions, readFileSyncFn }) { - if (name === "#" || StringPrototypeStartsWith(name, "#/") || StringPrototypeEndsWith(name, "/")) { - const reason = "is not a valid internal imports specifier name"; - throw new ERR_INVALID_MODULE_SPECIFIER(name, reason, url.fileURLToPath(base)); - } - let packageJSONUrl; - const packageConfig = getPackageScopeConfig(base, readFileSyncFn); - if (packageConfig.exists) { - packageJSONUrl = url.pathToFileURL(packageConfig.pjsonPath); - const imports = packageConfig.imports; - if (imports) { - if (ObjectPrototypeHasOwnProperty(imports, name) && !StringPrototypeIncludes(name, "*")) { - const resolveResult = resolvePackageTarget( - packageJSONUrl, - imports[name], - "", - name, - base, - false, - true, - conditions - ); - if (resolveResult != null) { - return resolveResult; - } - } else { - let bestMatch = ""; - let bestMatchSubpath; - const keys = ObjectGetOwnPropertyNames(imports); - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - const patternIndex = StringPrototypeIndexOf(key, "*"); - if (patternIndex !== -1 && StringPrototypeStartsWith( - name, - StringPrototypeSlice(key, 0, patternIndex) - )) { - const patternTrailer = StringPrototypeSlice(key, patternIndex + 1); - if (name.length >= key.length && StringPrototypeEndsWith(name, patternTrailer) && patternKeyCompare(bestMatch, key) === 1 && StringPrototypeLastIndexOf(key, "*") === patternIndex) { - bestMatch = key; - bestMatchSubpath = StringPrototypeSlice( - name, - patternIndex, - name.length - patternTrailer.length - ); - } - } - } - if (bestMatch) { - const target = imports[bestMatch]; - const resolveResult = resolvePackageTarget( - packageJSONUrl, - target, - bestMatchSubpath, - bestMatch, - base, - true, - true, - conditions - ); - if (resolveResult != null) { - return resolveResult; - } - } - } - } - } - throwImportNotDefined(name, packageJSONUrl, base); -} - -const flagSymbol = Symbol('arg flag'); - -class ArgError extends Error { - constructor(msg, code) { - super(msg); - this.name = 'ArgError'; - this.code = code; - - Object.setPrototypeOf(this, ArgError.prototype); - } -} - -function arg( - opts, - { - argv = process.argv.slice(2), - permissive = false, - stopAtPositional = false - } = {} -) { - if (!opts) { - throw new ArgError( - 'argument specification object is required', - 'ARG_CONFIG_NO_SPEC' - ); - } - - const result = { _: [] }; - - const aliases = {}; - const handlers = {}; - - for (const key of Object.keys(opts)) { - if (!key) { - throw new ArgError( - 'argument key cannot be an empty string', - 'ARG_CONFIG_EMPTY_KEY' - ); - } - - if (key[0] !== '-') { - throw new ArgError( - `argument key must start with '-' but found: '${key}'`, - 'ARG_CONFIG_NONOPT_KEY' - ); - } - - if (key.length === 1) { - throw new ArgError( - `argument key must have a name; singular '-' keys are not allowed: ${key}`, - 'ARG_CONFIG_NONAME_KEY' - ); - } - - if (typeof opts[key] === 'string') { - aliases[key] = opts[key]; - continue; - } - - let type = opts[key]; - let isFlag = false; - - if ( - Array.isArray(type) && - type.length === 1 && - typeof type[0] === 'function' - ) { - const [fn] = type; - type = (value, name, prev = []) => { - prev.push(fn(value, name, prev[prev.length - 1])); - return prev; - }; - isFlag = fn === Boolean || fn[flagSymbol] === true; - } else if (typeof type === 'function') { - isFlag = type === Boolean || type[flagSymbol] === true; - } else { - throw new ArgError( - `type missing or not a function or valid array type: ${key}`, - 'ARG_CONFIG_VAD_TYPE' - ); - } - - if (key[1] !== '-' && key.length > 2) { - throw new ArgError( - `short argument keys (with a single hyphen) must have only one character: ${key}`, - 'ARG_CONFIG_SHORTOPT_TOOLONG' - ); - } - - handlers[key] = [type, isFlag]; - } - - for (let i = 0, len = argv.length; i < len; i++) { - const wholeArg = argv[i]; - - if (stopAtPositional && result._.length > 0) { - result._ = result._.concat(argv.slice(i)); - break; - } - - if (wholeArg === '--') { - result._ = result._.concat(argv.slice(i + 1)); - break; - } - - if (wholeArg.length > 1 && wholeArg[0] === '-') { - /* eslint-disable operator-linebreak */ - const separatedArguments = - wholeArg[1] === '-' || wholeArg.length === 2 - ? [wholeArg] - : wholeArg - .slice(1) - .split('') - .map((a) => `-${a}`); - /* eslint-enable operator-linebreak */ - - for (let j = 0; j < separatedArguments.length; j++) { - const arg = separatedArguments[j]; - const [originalArgName, argStr] = - arg[1] === '-' ? arg.split(/=(.*)/, 2) : [arg, undefined]; - - let argName = originalArgName; - while (argName in aliases) { - argName = aliases[argName]; - } - - if (!(argName in handlers)) { - if (permissive) { - result._.push(arg); - continue; - } else { - throw new ArgError( - `unknown or unexpected option: ${originalArgName}`, - 'ARG_UNKNOWN_OPTION' - ); - } - } - - const [type, isFlag] = handlers[argName]; - - if (!isFlag && j + 1 < separatedArguments.length) { - throw new ArgError( - `option requires argument (but was followed by another short argument): ${originalArgName}`, - 'ARG_MISSING_REQUIRED_SHORTARG' - ); - } - - if (isFlag) { - result[argName] = type(true, argName, result[argName]); - } else if (argStr === undefined) { - if ( - argv.length < i + 2 || - (argv[i + 1].length > 1 && - argv[i + 1][0] === '-' && - !( - argv[i + 1].match(/^-?\d*(\.(?=\d))?\d*$/) && - (type === Number || - // eslint-disable-next-line no-undef - (typeof BigInt !== 'undefined' && type === BigInt)) - )) - ) { - const extended = - originalArgName === argName ? '' : ` (alias for ${argName})`; - throw new ArgError( - `option requires argument: ${originalArgName}${extended}`, - 'ARG_MISSING_REQUIRED_LONGARG' - ); - } - - result[argName] = type(argv[i + 1], argName, result[argName]); - ++i; - } else { - result[argName] = type(argStr, argName, result[argName]); - } - } - } else { - result._.push(wholeArg); - } - } - - return result; -} - -arg.flag = (fn) => { - fn[flagSymbol] = true; - return fn; -}; - -// Utility types -arg.COUNT = arg.flag((v, name, existingCount) => (existingCount || 0) + 1); - -// Expose error class -arg.ArgError = ArgError; - -var arg_1 = arg; - -/** - @license - The MIT License (MIT) - - Copyright (c) 2014 Blake Embrey (hello@blakeembrey.com) - - 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. -*/ -function getOptionValue(opt) { - parseOptions(); - return options[opt]; -} -let options; -function parseOptions() { - if (!options) { - options = { - "--conditions": [], - ...parseArgv(getNodeOptionsEnvArgv()), - ...parseArgv(process.execArgv) - }; - } -} -function parseArgv(argv) { - return arg_1( - { - "--conditions": [String], - "-C": "--conditions" - }, - { - argv, - permissive: true - } - ); -} -function getNodeOptionsEnvArgv() { - const errors = []; - const envArgv = ParseNodeOptionsEnvVar(process.env.NODE_OPTIONS || "", errors); - if (errors.length !== 0) ; - return envArgv; -} -function ParseNodeOptionsEnvVar(node_options, errors) { - const env_argv = []; - let is_in_string = false; - let will_start_new_arg = true; - for (let index = 0; index < node_options.length; ++index) { - let c = node_options[index]; - if (c === "\\" && is_in_string) { - if (index + 1 === node_options.length) { - errors.push("invalid value for NODE_OPTIONS (invalid escape)\n"); - return env_argv; - } else { - c = node_options[++index]; - } - } else if (c === " " && !is_in_string) { - will_start_new_arg = true; - continue; - } else if (c === '"') { - is_in_string = !is_in_string; - continue; - } - if (will_start_new_arg) { - env_argv.push(c); - will_start_new_arg = false; - } else { - env_argv[env_argv.length - 1] += c; - } - } - if (is_in_string) { - errors.push("invalid value for NODE_OPTIONS (unterminated string)\n"); - } - return env_argv; -} - -function makeApi(runtimeState, opts) { - const alwaysWarnOnFallback = Number(process.env.PNP_ALWAYS_WARN_ON_FALLBACK) > 0; - const debugLevel = Number(process.env.PNP_DEBUG_LEVEL); - const pathRegExp = /^(?![a-zA-Z]:[\\/]|\\\\|\.{0,2}(?:\/|$))((?:node:)?(?:@[^/]+\/)?[^/]+)\/*(.*|)$/; - const isStrictRegExp = /^(\/|\.{1,2}(\/|$))/; - const isDirRegExp = /\/$/; - const isRelativeRegexp = /^\.{0,2}\//; - const topLevelLocator = { name: null, reference: null }; - const fallbackLocators = []; - const emittedWarnings = /* @__PURE__ */ new Set(); - if (runtimeState.enableTopLevelFallback === true) - fallbackLocators.push(topLevelLocator); - if (opts.compatibilityMode !== false) { - for (const name of [`react-scripts`, `gatsby`]) { - const packageStore = runtimeState.packageRegistry.get(name); - if (packageStore) { - for (const reference of packageStore.keys()) { - if (reference === null) { - throw new Error(`Assertion failed: This reference shouldn't be null`); - } else { - fallbackLocators.push({ name, reference }); - } - } - } - } - } - const { - ignorePattern, - packageRegistry, - packageLocatorsByLocations - } = runtimeState; - function makeLogEntry(name, args) { - return { - fn: name, - args, - error: null, - result: null - }; - } - function trace(entry) { - const colors = process.stderr?.hasColors?.() ?? process.stdout.isTTY; - const c = (n, str) => `\x1B[${n}m${str}\x1B[0m`; - const error = entry.error; - if (error) - console.error(c(`31;1`, `\u2716 ${entry.error?.message.replace(/\n.*/s, ``)}`)); - else - console.error(c(`33;1`, `\u203C Resolution`)); - if (entry.args.length > 0) - console.error(); - for (const arg of entry.args) - console.error(` ${c(`37;1`, `In \u2190`)} ${nodeUtils.inspect(arg, { colors, compact: true })}`); - if (entry.result) { - console.error(); - console.error(` ${c(`37;1`, `Out \u2192`)} ${nodeUtils.inspect(entry.result, { colors, compact: true })}`); - } - const stack = new Error().stack.match(/(?<=^ +)at.*/gm)?.slice(2) ?? []; - if (stack.length > 0) { - console.error(); - for (const line of stack) { - console.error(` ${c(`38;5;244`, line)}`); - } - } - console.error(); - } - function maybeLog(name, fn) { - if (opts.allowDebug === false) - return fn; - if (Number.isFinite(debugLevel)) { - if (debugLevel >= 2) { - return (...args) => { - const logEntry = makeLogEntry(name, args); - try { - return logEntry.result = fn(...args); - } catch (error) { - throw logEntry.error = error; - } finally { - trace(logEntry); - } - }; - } else if (debugLevel >= 1) { - return (...args) => { - try { - return fn(...args); - } catch (error) { - const logEntry = makeLogEntry(name, args); - logEntry.error = error; - trace(logEntry); - throw error; - } - }; - } - } - return fn; - } - function getPackageInformationSafe(packageLocator) { - const packageInformation = getPackageInformation(packageLocator); - if (!packageInformation) { - throw makeError( - ErrorCode.INTERNAL, - `Couldn't find a matching entry in the dependency tree for the specified parent (this is probably an internal error)` - ); - } - return packageInformation; - } - function isDependencyTreeRoot(packageLocator) { - if (packageLocator.name === null) - return true; - for (const dependencyTreeRoot of runtimeState.dependencyTreeRoots) - if (dependencyTreeRoot.name === packageLocator.name && dependencyTreeRoot.reference === packageLocator.reference) - return true; - return false; - } - const defaultExportsConditions = /* @__PURE__ */ new Set([ - `node`, - `require`, - ...getOptionValue(`--conditions`) - ]); - function applyNodeExportsResolution(unqualifiedPath, conditions = defaultExportsConditions, issuer) { - const locator = findPackageLocator(ppath.join(unqualifiedPath, `internal.js`), { - resolveIgnored: true, - includeDiscardFromLookup: true - }); - if (locator === null) { - throw makeError( - ErrorCode.INTERNAL, - `The locator that owns the "${unqualifiedPath}" path can't be found inside the dependency tree (this is probably an internal error)` - ); - } - const { packageLocation } = getPackageInformationSafe(locator); - const manifestPath = ppath.join(packageLocation, Filename.manifest); - if (!opts.fakeFs.existsSync(manifestPath)) - return null; - const pkgJson = JSON.parse(opts.fakeFs.readFileSync(manifestPath, `utf8`)); - if (pkgJson.exports == null) - return null; - let subpath = ppath.contains(packageLocation, unqualifiedPath); - if (subpath === null) { - throw makeError( - ErrorCode.INTERNAL, - `unqualifiedPath doesn't contain the packageLocation (this is probably an internal error)` - ); - } - if (subpath !== `.` && !isRelativeRegexp.test(subpath)) - subpath = `./${subpath}`; - try { - const resolvedExport = packageExportsResolve({ - packageJSONUrl: url.pathToFileURL(npath.fromPortablePath(manifestPath)), - packageSubpath: subpath, - exports: pkgJson.exports, - base: issuer ? url.pathToFileURL(npath.fromPortablePath(issuer)) : null, - conditions - }); - return npath.toPortablePath(url.fileURLToPath(resolvedExport)); - } catch (error) { - throw makeError( - ErrorCode.EXPORTS_RESOLUTION_FAILED, - error.message, - { unqualifiedPath: getPathForDisplay(unqualifiedPath), locator, pkgJson, subpath: getPathForDisplay(subpath), conditions }, - error.code - ); - } - } - function applyNodeExtensionResolution(unqualifiedPath, candidates, { extensions }) { - let stat; - try { - candidates.push(unqualifiedPath); - stat = opts.fakeFs.statSync(unqualifiedPath); - } catch (error) { - } - if (stat && !stat.isDirectory()) - return opts.fakeFs.realpathSync(unqualifiedPath); - if (stat && stat.isDirectory()) { - let pkgJson; - try { - pkgJson = JSON.parse(opts.fakeFs.readFileSync(ppath.join(unqualifiedPath, Filename.manifest), `utf8`)); - } catch (error) { - } - let nextUnqualifiedPath; - if (pkgJson && pkgJson.main) - nextUnqualifiedPath = ppath.resolve(unqualifiedPath, pkgJson.main); - if (nextUnqualifiedPath && nextUnqualifiedPath !== unqualifiedPath) { - const resolution = applyNodeExtensionResolution(nextUnqualifiedPath, candidates, { extensions }); - if (resolution !== null) { - return resolution; - } - } - } - for (let i = 0, length = extensions.length; i < length; i++) { - const candidateFile = `${unqualifiedPath}${extensions[i]}`; - candidates.push(candidateFile); - if (opts.fakeFs.existsSync(candidateFile)) { - return candidateFile; - } - } - if (stat && stat.isDirectory()) { - for (let i = 0, length = extensions.length; i < length; i++) { - const candidateFile = ppath.format({ dir: unqualifiedPath, name: `index`, ext: extensions[i] }); - candidates.push(candidateFile); - if (opts.fakeFs.existsSync(candidateFile)) { - return candidateFile; - } - } - } - return null; - } - function makeFakeModule(path) { - const fakeModule = new require$$0.Module(path, null); - fakeModule.filename = path; - fakeModule.paths = require$$0.Module._nodeModulePaths(path); - return fakeModule; - } - function callNativeResolution(request, issuer) { - if (issuer.endsWith(`/`)) - issuer = ppath.join(issuer, `internal.js`); - return require$$0.Module._resolveFilename(npath.fromPortablePath(request), makeFakeModule(npath.fromPortablePath(issuer)), false, { plugnplay: false }); - } - function isPathIgnored(path) { - if (ignorePattern === null) - return false; - const subPath = ppath.contains(runtimeState.basePath, path); - if (subPath === null) - return false; - if (ignorePattern.test(subPath.replace(/\/$/, ``))) { - return true; - } else { - return false; - } - } - const VERSIONS = { std: 3, resolveVirtual: 1, getAllLocators: 1 }; - const topLevel = topLevelLocator; - function getPackageInformation({ name, reference }) { - const packageInformationStore = packageRegistry.get(name); - if (!packageInformationStore) - return null; - const packageInformation = packageInformationStore.get(reference); - if (!packageInformation) - return null; - return packageInformation; - } - function findPackageDependents({ name, reference }) { - const dependents = []; - for (const [dependentName, packageInformationStore] of packageRegistry) { - if (dependentName === null) - continue; - for (const [dependentReference, packageInformation] of packageInformationStore) { - if (dependentReference === null) - continue; - const dependencyReference = packageInformation.packageDependencies.get(name); - if (dependencyReference !== reference) - continue; - if (dependentName === name && dependentReference === reference) - continue; - dependents.push({ - name: dependentName, - reference: dependentReference - }); - } - } - return dependents; - } - function findBrokenPeerDependencies(dependency, initialPackage) { - const brokenPackages = /* @__PURE__ */ new Map(); - const alreadyVisited = /* @__PURE__ */ new Set(); - const traversal = (currentPackage) => { - const identifier = JSON.stringify(currentPackage.name); - if (alreadyVisited.has(identifier)) - return; - alreadyVisited.add(identifier); - const dependents = findPackageDependents(currentPackage); - for (const dependent of dependents) { - const dependentInformation = getPackageInformationSafe(dependent); - if (dependentInformation.packagePeers.has(dependency)) { - traversal(dependent); - } else { - let brokenSet = brokenPackages.get(dependent.name); - if (typeof brokenSet === `undefined`) - brokenPackages.set(dependent.name, brokenSet = /* @__PURE__ */ new Set()); - brokenSet.add(dependent.reference); - } - } - }; - traversal(initialPackage); - const brokenList = []; - for (const name of [...brokenPackages.keys()].sort()) - for (const reference of [...brokenPackages.get(name)].sort()) - brokenList.push({ name, reference }); - return brokenList; - } - function findPackageLocator(location, { resolveIgnored = false, includeDiscardFromLookup = false } = {}) { - if (isPathIgnored(location) && !resolveIgnored) - return null; - let relativeLocation = ppath.relative(runtimeState.basePath, location); - if (!relativeLocation.match(isStrictRegExp)) - relativeLocation = `./${relativeLocation}`; - if (!relativeLocation.endsWith(`/`)) - relativeLocation = `${relativeLocation}/`; - do { - const entry = packageLocatorsByLocations.get(relativeLocation); - if (typeof entry === `undefined` || entry.discardFromLookup && !includeDiscardFromLookup) { - relativeLocation = relativeLocation.substring(0, relativeLocation.lastIndexOf(`/`, relativeLocation.length - 2) + 1); - continue; - } - return entry.locator; - } while (relativeLocation !== ``); - return null; - } - function tryReadFile(filePath) { - try { - return opts.fakeFs.readFileSync(npath.toPortablePath(filePath), `utf8`); - } catch (err) { - if (err.code === `ENOENT`) - return void 0; - throw err; - } - } - function resolveToUnqualified(request, issuer, { considerBuiltins = true } = {}) { - if (request.startsWith(`#`)) - throw new Error(`resolveToUnqualified can not handle private import mappings`); - if (request === `pnpapi`) - return npath.toPortablePath(opts.pnpapiResolution); - if (considerBuiltins && require$$0.isBuiltin(request)) - return null; - const requestForDisplay = getPathForDisplay(request); - const issuerForDisplay = issuer && getPathForDisplay(issuer); - if (issuer && isPathIgnored(issuer)) { - if (!ppath.isAbsolute(request) || findPackageLocator(request) === null) { - const result = callNativeResolution(request, issuer); - if (result === false) { - throw makeError( - ErrorCode.BUILTIN_NODE_RESOLUTION_FAILED, - `The builtin node resolution algorithm was unable to resolve the requested module (it didn't go through the pnp resolver because the issuer was explicitely ignored by the regexp) - -Require request: "${requestForDisplay}" -Required by: ${issuerForDisplay} -`, - { request: requestForDisplay, issuer: issuerForDisplay } - ); - } - return npath.toPortablePath(result); - } - } - let unqualifiedPath; - const dependencyNameMatch = request.match(pathRegExp); - if (!dependencyNameMatch) { - if (ppath.isAbsolute(request)) { - unqualifiedPath = ppath.normalize(request); - } else { - if (!issuer) { - throw makeError( - ErrorCode.API_ERROR, - `The resolveToUnqualified function must be called with a valid issuer when the path isn't a builtin nor absolute`, - { request: requestForDisplay, issuer: issuerForDisplay } - ); - } - const absoluteIssuer = ppath.resolve(issuer); - if (issuer.match(isDirRegExp)) { - unqualifiedPath = ppath.normalize(ppath.join(absoluteIssuer, request)); - } else { - unqualifiedPath = ppath.normalize(ppath.join(ppath.dirname(absoluteIssuer), request)); - } - } - } else { - if (!issuer) { - throw makeError( - ErrorCode.API_ERROR, - `The resolveToUnqualified function must be called with a valid issuer when the path isn't a builtin nor absolute`, - { request: requestForDisplay, issuer: issuerForDisplay } - ); - } - const [, dependencyName, subPath] = dependencyNameMatch; - const issuerLocator = findPackageLocator(issuer); - if (!issuerLocator) { - const result = callNativeResolution(request, issuer); - if (result === false) { - throw makeError( - ErrorCode.BUILTIN_NODE_RESOLUTION_FAILED, - `The builtin node resolution algorithm was unable to resolve the requested module (it didn't go through the pnp resolver because the issuer doesn't seem to be part of the Yarn-managed dependency tree). - -Require path: "${requestForDisplay}" -Required by: ${issuerForDisplay} -`, - { request: requestForDisplay, issuer: issuerForDisplay } - ); - } - return npath.toPortablePath(result); - } - const issuerInformation = getPackageInformationSafe(issuerLocator); - let dependencyReference = issuerInformation.packageDependencies.get(dependencyName); - let fallbackReference = null; - if (dependencyReference == null) { - if (issuerLocator.name !== null) { - const exclusionEntry = runtimeState.fallbackExclusionList.get(issuerLocator.name); - const canUseFallbacks = !exclusionEntry || !exclusionEntry.has(issuerLocator.reference); - if (canUseFallbacks) { - for (let t = 0, T = fallbackLocators.length; t < T; ++t) { - const fallbackInformation = getPackageInformationSafe(fallbackLocators[t]); - const reference = fallbackInformation.packageDependencies.get(dependencyName); - if (reference == null) - continue; - if (alwaysWarnOnFallback) - fallbackReference = reference; - else - dependencyReference = reference; - break; - } - if (runtimeState.enableTopLevelFallback) { - if (dependencyReference == null && fallbackReference === null) { - const reference = runtimeState.fallbackPool.get(dependencyName); - if (reference != null) { - fallbackReference = reference; - } - } - } - } - } - } - let error = null; - if (dependencyReference === null) { - if (isDependencyTreeRoot(issuerLocator)) { - error = makeError( - ErrorCode.MISSING_PEER_DEPENDENCY, - `Your application tried to access ${dependencyName} (a peer dependency); this isn't allowed as there is no ancestor to satisfy the requirement. Use a devDependency if needed. - -Required package: ${dependencyName}${dependencyName !== requestForDisplay ? ` (via "${requestForDisplay}")` : ``} -Required by: ${issuerForDisplay} -`, - { request: requestForDisplay, issuer: issuerForDisplay, dependencyName } - ); - } else { - const brokenAncestors = findBrokenPeerDependencies(dependencyName, issuerLocator); - if (brokenAncestors.every((ancestor) => isDependencyTreeRoot(ancestor))) { - error = makeError( - ErrorCode.MISSING_PEER_DEPENDENCY, - `${issuerLocator.name} tried to access ${dependencyName} (a peer dependency) but it isn't provided by your application; this makes the require call ambiguous and unsound. - -Required package: ${dependencyName}${dependencyName !== requestForDisplay ? ` (via "${requestForDisplay}")` : ``} -Required by: ${issuerLocator.name}@${issuerLocator.reference} (via ${issuerForDisplay}) -${brokenAncestors.map((ancestorLocator) => `Ancestor breaking the chain: ${ancestorLocator.name}@${ancestorLocator.reference} -`).join(``)} -`, - { request: requestForDisplay, issuer: issuerForDisplay, issuerLocator: Object.assign({}, issuerLocator), dependencyName, brokenAncestors } - ); - } else { - error = makeError( - ErrorCode.MISSING_PEER_DEPENDENCY, - `${issuerLocator.name} tried to access ${dependencyName} (a peer dependency) but it isn't provided by its ancestors; this makes the require call ambiguous and unsound. - -Required package: ${dependencyName}${dependencyName !== requestForDisplay ? ` (via "${requestForDisplay}")` : ``} -Required by: ${issuerLocator.name}@${issuerLocator.reference} (via ${issuerForDisplay}) - -${brokenAncestors.map((ancestorLocator) => `Ancestor breaking the chain: ${ancestorLocator.name}@${ancestorLocator.reference} -`).join(``)} -`, - { request: requestForDisplay, issuer: issuerForDisplay, issuerLocator: Object.assign({}, issuerLocator), dependencyName, brokenAncestors } - ); - } - } - } else if (dependencyReference === void 0) { - if (!considerBuiltins && require$$0.isBuiltin(request)) { - if (isDependencyTreeRoot(issuerLocator)) { - error = makeError( - ErrorCode.UNDECLARED_DEPENDENCY, - `Your application tried to access ${dependencyName}. While this module is usually interpreted as a Node builtin, your resolver is running inside a non-Node resolution context where such builtins are ignored. Since ${dependencyName} isn't otherwise declared in your dependencies, this makes the require call ambiguous and unsound. - -Required package: ${dependencyName}${dependencyName !== requestForDisplay ? ` (via "${requestForDisplay}")` : ``} -Required by: ${issuerForDisplay} -`, - { request: requestForDisplay, issuer: issuerForDisplay, dependencyName } - ); - } else { - error = makeError( - ErrorCode.UNDECLARED_DEPENDENCY, - `${issuerLocator.name} tried to access ${dependencyName}. While this module is usually interpreted as a Node builtin, your resolver is running inside a non-Node resolution context where such builtins are ignored. Since ${dependencyName} isn't otherwise declared in ${issuerLocator.name}'s dependencies, this makes the require call ambiguous and unsound. - -Required package: ${dependencyName}${dependencyName !== requestForDisplay ? ` (via "${requestForDisplay}")` : ``} -Required by: ${issuerForDisplay} -`, - { request: requestForDisplay, issuer: issuerForDisplay, issuerLocator: Object.assign({}, issuerLocator), dependencyName } - ); - } - } else { - if (isDependencyTreeRoot(issuerLocator)) { - error = makeError( - ErrorCode.UNDECLARED_DEPENDENCY, - `Your application tried to access ${dependencyName}, but it isn't declared in your dependencies; this makes the require call ambiguous and unsound. - -Required package: ${dependencyName}${dependencyName !== requestForDisplay ? ` (via "${requestForDisplay}")` : ``} -Required by: ${issuerForDisplay} -`, - { request: requestForDisplay, issuer: issuerForDisplay, dependencyName } - ); - } else { - error = makeError( - ErrorCode.UNDECLARED_DEPENDENCY, - `${issuerLocator.name} tried to access ${dependencyName}, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound. - -Required package: ${dependencyName}${dependencyName !== requestForDisplay ? ` (via "${requestForDisplay}")` : ``} -Required by: ${issuerLocator.name}@${issuerLocator.reference} (via ${issuerForDisplay}) -`, - { request: requestForDisplay, issuer: issuerForDisplay, issuerLocator: Object.assign({}, issuerLocator), dependencyName } - ); - } - } - } - if (dependencyReference == null) { - if (fallbackReference === null || error === null) - throw error || new Error(`Assertion failed: Expected an error to have been set`); - dependencyReference = fallbackReference; - const message = error.message.replace(/\n.*/g, ``); - error.message = message; - if (!emittedWarnings.has(message) && debugLevel !== 0) { - emittedWarnings.add(message); - process.emitWarning(error); - } - } - const dependencyLocator = Array.isArray(dependencyReference) ? { name: dependencyReference[0], reference: dependencyReference[1] } : { name: dependencyName, reference: dependencyReference }; - const dependencyInformation = getPackageInformationSafe(dependencyLocator); - if (!dependencyInformation.packageLocation) { - throw makeError( - ErrorCode.MISSING_DEPENDENCY, - `A dependency seems valid but didn't get installed for some reason. This might be caused by a partial install, such as dev vs prod. - -Required package: ${dependencyLocator.name}@${dependencyLocator.reference}${dependencyLocator.name !== requestForDisplay ? ` (via "${requestForDisplay}")` : ``} -Required by: ${issuerLocator.name}@${issuerLocator.reference} (via ${issuerForDisplay}) -`, - { request: requestForDisplay, issuer: issuerForDisplay, dependencyLocator: Object.assign({}, dependencyLocator) } - ); - } - const dependencyLocation = dependencyInformation.packageLocation; - if (subPath) { - unqualifiedPath = ppath.join(dependencyLocation, subPath); - } else { - unqualifiedPath = dependencyLocation; - } - } - return ppath.normalize(unqualifiedPath); - } - function resolveUnqualifiedExport(request, unqualifiedPath, conditions = defaultExportsConditions, issuer) { - if (isStrictRegExp.test(request)) - return unqualifiedPath; - const unqualifiedExportPath = applyNodeExportsResolution(unqualifiedPath, conditions, issuer); - if (unqualifiedExportPath) { - return ppath.normalize(unqualifiedExportPath); - } else { - return unqualifiedPath; - } - } - function resolveUnqualified(unqualifiedPath, { extensions = Object.keys(require$$0.Module._extensions) } = {}) { - const candidates = []; - const qualifiedPath = applyNodeExtensionResolution(unqualifiedPath, candidates, { extensions }); - if (qualifiedPath) { - return ppath.normalize(qualifiedPath); - } else { - reportRequiredFilesToWatchMode(candidates.map((candidate) => npath.fromPortablePath(candidate))); - const unqualifiedPathForDisplay = getPathForDisplay(unqualifiedPath); - const containingPackage = findPackageLocator(unqualifiedPath); - if (containingPackage) { - const { packageLocation } = getPackageInformationSafe(containingPackage); - let exists = true; - try { - opts.fakeFs.accessSync(packageLocation); - } catch (err) { - if (err?.code === `ENOENT`) { - exists = false; - } else { - const readableError = (err?.message ?? err ?? `empty exception thrown`).replace(/^[A-Z]/, ($0) => $0.toLowerCase()); - throw makeError(ErrorCode.QUALIFIED_PATH_RESOLUTION_FAILED, `Required package exists but could not be accessed (${readableError}). - -Missing package: ${containingPackage.name}@${containingPackage.reference} -Expected package location: ${getPathForDisplay(packageLocation)} -`, { unqualifiedPath: unqualifiedPathForDisplay, extensions }); - } - } - if (!exists) { - const errorMessage = packageLocation.includes(`/unplugged/`) ? `Required unplugged package missing from disk. This may happen when switching branches without running installs (unplugged packages must be fully materialized on disk to work).` : `Required package missing from disk. If you keep your packages inside your repository then restarting the Node process may be enough. Otherwise, try to run an install first.`; - throw makeError( - ErrorCode.QUALIFIED_PATH_RESOLUTION_FAILED, - `${errorMessage} - -Missing package: ${containingPackage.name}@${containingPackage.reference} -Expected package location: ${getPathForDisplay(packageLocation)} -`, - { unqualifiedPath: unqualifiedPathForDisplay, extensions } - ); - } - } - throw makeError( - ErrorCode.QUALIFIED_PATH_RESOLUTION_FAILED, - `Qualified path resolution failed: we looked for the following paths, but none could be accessed. - -Source path: ${unqualifiedPathForDisplay} -${candidates.map((candidate) => `Not found: ${getPathForDisplay(candidate)} -`).join(``)}`, - { unqualifiedPath: unqualifiedPathForDisplay, extensions } - ); - } - } - function resolvePrivateRequest(request, issuer, opts2) { - if (!issuer) - throw new Error(`Assertion failed: An issuer is required to resolve private import mappings`); - const resolved = packageImportsResolve({ - name: request, - base: url.pathToFileURL(npath.fromPortablePath(issuer)), - conditions: opts2.conditions ?? defaultExportsConditions, - readFileSyncFn: tryReadFile - }); - if (resolved instanceof URL) { - return resolveUnqualified(npath.toPortablePath(url.fileURLToPath(resolved)), { extensions: opts2.extensions }); - } else { - if (resolved.startsWith(`#`)) - throw new Error(`Mapping from one private import to another isn't allowed`); - return resolveRequest(resolved, issuer, opts2); - } - } - function resolveRequest(request, issuer, opts2 = {}) { - try { - if (request.startsWith(`#`)) - return resolvePrivateRequest(request, issuer, opts2); - const { considerBuiltins, extensions, conditions } = opts2; - const unqualifiedPath = resolveToUnqualified(request, issuer, { considerBuiltins }); - if (request === `pnpapi`) - return unqualifiedPath; - if (unqualifiedPath === null) - return null; - const isIssuerIgnored = () => issuer !== null ? isPathIgnored(issuer) : false; - const remappedPath = (!considerBuiltins || !require$$0.isBuiltin(request)) && !isIssuerIgnored() ? resolveUnqualifiedExport(request, unqualifiedPath, conditions, issuer) : unqualifiedPath; - return resolveUnqualified(remappedPath, { extensions }); - } catch (error) { - if (Object.hasOwn(error, `pnpCode`)) - Object.assign(error.data, { request: getPathForDisplay(request), issuer: issuer && getPathForDisplay(issuer) }); - throw error; - } - } - function resolveVirtual(request) { - const normalized = ppath.normalize(request); - const resolved = VirtualFS.resolveVirtual(normalized); - return resolved !== normalized ? resolved : null; - } - return { - VERSIONS, - topLevel, - getLocator: (name, referencish) => { - if (Array.isArray(referencish)) { - return { name: referencish[0], reference: referencish[1] }; - } else { - return { name, reference: referencish }; - } - }, - getDependencyTreeRoots: () => { - return [...runtimeState.dependencyTreeRoots]; - }, - getAllLocators() { - const locators = []; - for (const [name, entry] of packageRegistry) - for (const reference of entry.keys()) - if (name !== null && reference !== null) - locators.push({ name, reference }); - return locators; - }, - getPackageInformation: (locator) => { - const info = getPackageInformation(locator); - if (info === null) - return null; - const packageLocation = npath.fromPortablePath(info.packageLocation); - const nativeInfo = { ...info, packageLocation }; - return nativeInfo; - }, - findPackageLocator: (path) => { - return findPackageLocator(npath.toPortablePath(path)); - }, - resolveToUnqualified: maybeLog(`resolveToUnqualified`, (request, issuer, opts2) => { - const portableIssuer = issuer !== null ? npath.toPortablePath(issuer) : null; - const resolution = resolveToUnqualified(npath.toPortablePath(request), portableIssuer, opts2); - if (resolution === null) - return null; - return npath.fromPortablePath(resolution); - }), - resolveUnqualified: maybeLog(`resolveUnqualified`, (unqualifiedPath, opts2) => { - return npath.fromPortablePath(resolveUnqualified(npath.toPortablePath(unqualifiedPath), opts2)); - }), - resolveRequest: maybeLog(`resolveRequest`, (request, issuer, opts2) => { - const portableIssuer = issuer !== null ? npath.toPortablePath(issuer) : null; - const resolution = resolveRequest(npath.toPortablePath(request), portableIssuer, opts2); - if (resolution === null) - return null; - return npath.fromPortablePath(resolution); - }), - resolveVirtual: maybeLog(`resolveVirtual`, (path) => { - const result = resolveVirtual(npath.toPortablePath(path)); - if (result !== null) { - return npath.fromPortablePath(result); - } else { - return null; - } - }) - }; -} - -function makeManager(pnpapi, opts) { - const initialApiPath = npath.toPortablePath(pnpapi.resolveToUnqualified(`pnpapi`, null)); - const initialApiStats = opts.fakeFs.statSync(npath.toPortablePath(initialApiPath)); - const apiMetadata = /* @__PURE__ */ new Map([ - [initialApiPath, { - instance: pnpapi, - stats: initialApiStats, - lastRefreshCheck: Date.now() - }] - ]); - function loadApiInstance(pnpApiPath) { - const nativePath = npath.fromPortablePath(pnpApiPath); - const module = new require$$0.Module(nativePath, null); - module.load(nativePath); - return module.exports; - } - function refreshApiEntry(pnpApiPath, apiEntry) { - const timeNow = Date.now(); - if (timeNow - apiEntry.lastRefreshCheck < 500) - return; - apiEntry.lastRefreshCheck = timeNow; - const stats = opts.fakeFs.statSync(pnpApiPath); - if (stats.mtime > apiEntry.stats.mtime) { - process.emitWarning(`[Warning] The runtime detected new information in a PnP file; reloading the API instance (${npath.fromPortablePath(pnpApiPath)})`); - apiEntry.stats = stats; - apiEntry.instance = loadApiInstance(pnpApiPath); - } - } - function getApiEntry(pnpApiPath, refresh = false) { - let apiEntry = apiMetadata.get(pnpApiPath); - if (typeof apiEntry !== `undefined`) { - if (refresh) { - refreshApiEntry(pnpApiPath, apiEntry); - } - } else { - apiMetadata.set(pnpApiPath, apiEntry = { - instance: loadApiInstance(pnpApiPath), - stats: opts.fakeFs.statSync(pnpApiPath), - lastRefreshCheck: Date.now() - }); - } - return apiEntry; - } - const findApiPathCache = /* @__PURE__ */ new Map(); - function addToCacheAndReturn(start, end, target) { - if (target !== null) { - target = VirtualFS.resolveVirtual(target); - target = opts.fakeFs.realpathSync(target); - } - let curr; - let next = start; - do { - curr = next; - findApiPathCache.set(curr, target); - next = ppath.dirname(curr); - } while (curr !== end); - return target; - } - function findApiPathFor(modulePath) { - let bestCandidate = null; - for (const [apiPath, apiEntry] of apiMetadata) { - const locator = apiEntry.instance.findPackageLocator(modulePath); - if (!locator) - continue; - if (apiMetadata.size === 1) - return apiPath; - const packageInformation = apiEntry.instance.getPackageInformation(locator); - if (!packageInformation) - throw new Error(`Assertion failed: Couldn't get package information for '${modulePath}'`); - if (!bestCandidate) - bestCandidate = { packageLocation: packageInformation.packageLocation, apiPaths: [] }; - if (packageInformation.packageLocation === bestCandidate.packageLocation) { - bestCandidate.apiPaths.push(apiPath); - } else if (packageInformation.packageLocation.length > bestCandidate.packageLocation.length) { - bestCandidate = { packageLocation: packageInformation.packageLocation, apiPaths: [apiPath] }; - } - } - if (bestCandidate) { - if (bestCandidate.apiPaths.length === 1) - return bestCandidate.apiPaths[0]; - const controlSegment = bestCandidate.apiPaths.map((apiPath) => ` ${npath.fromPortablePath(apiPath)}`).join(` -`); - throw new Error(`Unable to locate pnpapi, the module '${modulePath}' is controlled by multiple pnpapi instances. -This is usually caused by using the global cache (enableGlobalCache: true) - -Controlled by: -${controlSegment} -`); - } - const start = ppath.resolve(npath.toPortablePath(modulePath)); - let curr; - let next = start; - do { - curr = next; - const cached = findApiPathCache.get(curr); - if (cached !== void 0) - return addToCacheAndReturn(start, curr, cached); - const cjsCandidate = ppath.join(curr, Filename.pnpCjs); - if (opts.fakeFs.existsSync(cjsCandidate) && opts.fakeFs.statSync(cjsCandidate).isFile()) - return addToCacheAndReturn(start, curr, cjsCandidate); - const legacyCjsCandidate = ppath.join(curr, Filename.pnpJs); - if (opts.fakeFs.existsSync(legacyCjsCandidate) && opts.fakeFs.statSync(legacyCjsCandidate).isFile()) - return addToCacheAndReturn(start, curr, legacyCjsCandidate); - next = ppath.dirname(curr); - } while (curr !== PortablePath.root); - return addToCacheAndReturn(start, curr, null); - } - const moduleToApiPathCache = /* @__PURE__ */ new WeakMap(); - function getApiPathFromParent(parent) { - if (parent == null) - return initialApiPath; - let apiPath = moduleToApiPathCache.get(parent); - if (typeof apiPath !== `undefined`) - return apiPath; - apiPath = parent.filename ? findApiPathFor(parent.filename) : null; - moduleToApiPathCache.set(parent, apiPath); - return apiPath; - } - return { - getApiPathFromParent, - findApiPathFor, - getApiEntry - }; -} - -const localFs = { ...fs__default.default }; -const nodeFs = new NodeFS(localFs); -const defaultRuntimeState = $$SETUP_STATE(hydrateRuntimeState); -const defaultPnpapiResolution = __filename; -const defaultFsLayer = new VirtualFS({ - baseFs: new ZipOpenFS({ - baseFs: nodeFs, - maxOpenFiles: 80, - readOnlyArchives: true - }) -}); -class DynamicFS extends ProxiedFS { - constructor() { - super(ppath); - this.baseFs = defaultFsLayer; - } - mapToBase(p) { - return p; - } - mapFromBase(p) { - return p; - } -} -const dynamicFsLayer = new DynamicFS(); -let manager; -const defaultApi = Object.assign(makeApi(defaultRuntimeState, { - fakeFs: dynamicFsLayer, - pnpapiResolution: defaultPnpapiResolution -}), { - makeApi: ({ - basePath = void 0, - fakeFs = dynamicFsLayer, - pnpapiResolution = defaultPnpapiResolution, - ...rest - }) => { - const apiRuntimeState = typeof basePath !== `undefined` ? $$SETUP_STATE(hydrateRuntimeState, basePath) : defaultRuntimeState; - return makeApi(apiRuntimeState, { - fakeFs, - pnpapiResolution, - ...rest - }); - }, - setup: (api) => { - applyPatch(api || defaultApi, { - fakeFs: defaultFsLayer, - manager - }); - dynamicFsLayer.baseFs = new NodeFS(fs__default.default); - } -}); -manager = makeManager(defaultApi, { - fakeFs: dynamicFsLayer -}); -if (module.parent && module.parent.id === `internal/preload`) { - defaultApi.setup(); - if (module.filename) { - delete require$$0__default.default._cache[module.filename]; - } -} -if (process.mainModule === module) { - const reportError = (code, message, data) => { - process.stdout.write(`${JSON.stringify([{ code, message, data }, null])} -`); - }; - const reportSuccess = (resolution) => { - process.stdout.write(`${JSON.stringify([null, resolution])} -`); - }; - const processResolution = (request, issuer) => { - try { - reportSuccess(defaultApi.resolveRequest(request, issuer)); - } catch (error) { - reportError(error.code, error.message, error.data); - } - }; - const processRequest = (data) => { - try { - const [request, issuer] = JSON.parse(data); - processResolution(request, issuer); - } catch (error) { - reportError(`INVALID_JSON`, error.message, error.data); - } - }; - if (process.argv.length > 2) { - if (process.argv.length !== 4) { - process.stderr.write(`Usage: ${process.argv[0]} ${process.argv[1]} -`); - process.exitCode = 64; - } else { - processResolution(process.argv[2], process.argv[3]); - } - } else { - let buffer = ``; - const decoder = new StringDecoder__default.default.StringDecoder(); - process.stdin.on(`data`, (chunk) => { - buffer += decoder.write(chunk); - do { - const index = buffer.indexOf(` -`); - if (index === -1) - break; - const line = buffer.slice(0, index); - buffer = buffer.slice(index + 1); - processRequest(line); - } while (true); - }); - } -} - -module.exports = defaultApi; diff --git a/fixtures/pnp/.yarnrc.yml b/fixtures/pnp/.yarnrc.yml deleted file mode 100644 index 6a6b24d8..00000000 --- a/fixtures/pnp/.yarnrc.yml +++ /dev/null @@ -1 +0,0 @@ -enableGlobalCache: 0 diff --git a/fixtures/pnp/package.json b/fixtures/pnp/package.json deleted file mode 100644 index 5d119379..00000000 --- a/fixtures/pnp/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "pnp", - "packageManager": "yarn@4.3.1", - "dependencies": { - "is-even": "^1.0.0", - "is-odd": "^3.0.1" - } -} diff --git a/fixtures/pnp/yarn.lock b/fixtures/pnp/yarn.lock deleted file mode 100644 index ba89514d..00000000 --- a/fixtures/pnp/yarn.lock +++ /dev/null @@ -1,74 +0,0 @@ -# This file is generated by running "yarn install" inside your project. -# Manual changes might be lost - proceed with caution! - -__metadata: - version: 8 - cacheKey: 10c0 - -"is-buffer@npm:^1.1.5": - version: 1.1.6 - resolution: "is-buffer@npm:1.1.6" - checksum: 10c0/ae18aa0b6e113d6c490ad1db5e8df9bdb57758382b313f5a22c9c61084875c6396d50bbf49315f5b1926d142d74dfb8d31b40d993a383e0a158b15fea7a82234 - languageName: node - linkType: hard - -"is-even@npm:^1.0.0": - version: 1.0.0 - resolution: "is-even@npm:1.0.0" - dependencies: - is-odd: "npm:^0.1.2" - checksum: 10c0/2728cc2f390d07c6a44a054aa53ae6ce57c3a4adfd76a92df528e992b4a978fdec4eaa948e0de6e6431ef3c8deebf1c964fd870d4983044ec9f0f4e630dfb3a5 - languageName: node - linkType: hard - -"is-number@npm:^3.0.0": - version: 3.0.0 - resolution: "is-number@npm:3.0.0" - dependencies: - kind-of: "npm:^3.0.2" - checksum: 10c0/e639c54640b7f029623df24d3d103901e322c0c25ea5bde97cd723c2d0d4c05857a8364ab5c58d963089dbed6bf1d0ffe975cb6aef917e2ad0ccbca653d31b4f - languageName: node - linkType: hard - -"is-number@npm:^6.0.0": - version: 6.0.0 - resolution: "is-number@npm:6.0.0" - checksum: 10c0/5da4c68401529675c575878d2760d66f18eaef4b014858577f6003daf66488d7fe4eae684b1e8574e3fa1bb447c6c6c56b8491d2b4b3239da2d32e5f6f218008 - languageName: node - linkType: hard - -"is-odd@npm:^0.1.2": - version: 0.1.2 - resolution: "is-odd@npm:0.1.2" - dependencies: - is-number: "npm:^3.0.0" - checksum: 10c0/7dc6c6fd004861208ef9f324021c66f19b3dad209c2da3ef3720d4d76e141974fadb52c47b439fc8c52af579468640b554115395b5673f4558ef09719260e898 - languageName: node - linkType: hard - -"is-odd@npm:^3.0.1": - version: 3.0.1 - resolution: "is-odd@npm:3.0.1" - dependencies: - is-number: "npm:^6.0.0" - checksum: 10c0/89ee2e353c5a3f3bd400c79db1c307a5b3506198ee8169d521e533a9b1d8a08fc95f21a919c084e98845b4286d7ffe309778da03744dfe66c3c1763ab1a030c6 - languageName: node - linkType: hard - -"kind-of@npm:^3.0.2": - version: 3.2.2 - resolution: "kind-of@npm:3.2.2" - dependencies: - is-buffer: "npm:^1.1.5" - checksum: 10c0/7e34bc29d4b02c997f92f080de34ebb92033a96736bbb0bb2410e033a7e5ae6571f1fa37b2d7710018f95361473b816c604234197f4f203f9cf149d8ef1574d9 - languageName: node - linkType: hard - -"pnp@workspace:.": - version: 0.0.0-use.local - resolution: "pnp@workspace:." - dependencies: - is-even: "npm:^1.0.0" - is-odd: "npm:^3.0.1" - languageName: unknown - linkType: soft diff --git a/fixtures/pnpm/.gitignore b/fixtures/pnpm/.gitignore deleted file mode 100644 index 3c3629e6..00000000 --- a/fixtures/pnpm/.gitignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/fixtures/pnpm/package.json b/fixtures/pnpm/package.json deleted file mode 100644 index b763d74d..00000000 --- a/fixtures/pnpm/package.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "name": "pnpm", - "version": "1.0.0", - "private": true, - "devDependencies": { - "axios": "1.6.2", - "ipaddr.js": "2.2.0", - "postcss": "8.4.33", - "styled-components": "6.1.1" - } -} diff --git a/fixtures/pnpm/pnpm-lock.yaml b/fixtures/pnpm/pnpm-lock.yaml deleted file mode 100644 index e51dfd6a..00000000 --- a/fixtures/pnpm/pnpm-lock.yaml +++ /dev/null @@ -1,212 +0,0 @@ -lockfileVersion: '6.0' - -settings: - autoInstallPeers: true - excludeLinksFromLockfile: false - -devDependencies: - axios: - specifier: 1.6.2 - version: 1.6.2 - postcss: - specifier: 8.4.33 - version: 8.4.33 - styled-components: - specifier: 6.1.1 - version: 6.1.1(react-dom@18.2.0)(react@18.2.0) - -packages: - - /@emotion/is-prop-valid@1.2.1: - resolution: {integrity: sha512-61Mf7Ufx4aDxx1xlDeOm8aFFigGHE4z+0sKCa+IHCeZKiyP9RLD0Mmx7m8b9/Cf37f7NAvQOOJAbQQGVr5uERw==} - dependencies: - '@emotion/memoize': 0.8.1 - dev: true - - /@emotion/memoize@0.8.1: - resolution: {integrity: sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA==} - dev: true - - /@emotion/unitless@0.8.1: - resolution: {integrity: sha512-KOEGMu6dmJZtpadb476IsZBclKvILjopjUii3V+7MnXIQCYh8W3NgNcgwo21n9LXZX6EDIKvqfjYxXebDwxKmQ==} - dev: true - - /@types/stylis@4.2.4: - resolution: {integrity: sha512-36ZrGJ8fgtBr6nwNnuJ9jXIj+bn/pF6UoqmrQT7+Y99+tFFeHHsoR54+194dHdyhPjgbeoNz3Qru0oRt0l6ASQ==} - dev: true - - /asynckit@0.4.0: - resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} - dev: true - - /axios@1.6.2: - resolution: {integrity: sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A==} - dependencies: - follow-redirects: 1.15.3 - form-data: 4.0.0 - proxy-from-env: 1.1.0 - transitivePeerDependencies: - - debug - dev: true - - /camelize@1.0.1: - resolution: {integrity: sha512-dU+Tx2fsypxTgtLoE36npi3UqcjSSMNYfkqgmoEhtZrraP5VWq0K7FkWVTYa8eMPtnU/G2txVsfdCJTn9uzpuQ==} - dev: true - - /combined-stream@1.0.8: - resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} - engines: {node: '>= 0.8'} - dependencies: - delayed-stream: 1.0.0 - dev: true - - /css-color-keywords@1.0.0: - resolution: {integrity: sha512-FyyrDHZKEjXDpNJYvVsV960FiqQyXc/LlYmsxl2BcdMb2WPx0OGRVgTg55rPSyLSNMqP52R9r8geSp7apN3Ofg==} - engines: {node: '>=4'} - dev: true - - /css-to-react-native@3.2.0: - resolution: {integrity: sha512-e8RKaLXMOFii+02mOlqwjbD00KSEKqblnpO9e++1aXS1fPQOpS1YoqdVHBqPjHNoxeF2mimzVqawm2KCbEdtHQ==} - dependencies: - camelize: 1.0.1 - css-color-keywords: 1.0.0 - postcss-value-parser: 4.2.0 - dev: true - - /csstype@3.1.2: - resolution: {integrity: sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==} - dev: true - - /delayed-stream@1.0.0: - resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} - engines: {node: '>=0.4.0'} - dev: true - - /follow-redirects@1.15.3: - resolution: {integrity: sha512-1VzOtuEM8pC9SFU1E+8KfTjZyMztRsgEfwQl44z8A25uy13jSzTj6dyK2Df52iV0vgHCfBwLhDWevLn95w5v6Q==} - engines: {node: '>=4.0'} - peerDependencies: - debug: '*' - peerDependenciesMeta: - debug: - optional: true - dev: true - - /form-data@4.0.0: - resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==} - engines: {node: '>= 6'} - dependencies: - asynckit: 0.4.0 - combined-stream: 1.0.8 - mime-types: 2.1.35 - dev: true - - /js-tokens@4.0.0: - resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} - dev: true - - /loose-envify@1.4.0: - resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==} - hasBin: true - dependencies: - js-tokens: 4.0.0 - dev: true - - /mime-db@1.52.0: - resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} - engines: {node: '>= 0.6'} - dev: true - - /mime-types@2.1.35: - resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} - engines: {node: '>= 0.6'} - dependencies: - mime-db: 1.52.0 - dev: true - - /nanoid@3.3.7: - resolution: {integrity: sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==} - engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} - hasBin: true - dev: true - - /picocolors@1.0.0: - resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==} - dev: true - - /postcss-value-parser@4.2.0: - resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==} - dev: true - - /postcss@8.4.33: - resolution: {integrity: sha512-Kkpbhhdjw2qQs2O2DGX+8m5OVqEcbB9HRBvuYM9pgrjEFUg30A9LmXNlTAUj4S9kgtGyrMbTzVjH7E+s5Re2yg==} - engines: {node: ^10 || ^12 || >=14} - dependencies: - nanoid: 3.3.7 - picocolors: 1.0.0 - source-map-js: 1.0.2 - dev: true - - /proxy-from-env@1.1.0: - resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==} - dev: true - - /react-dom@18.2.0(react@18.2.0): - resolution: {integrity: sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==} - peerDependencies: - react: ^18.2.0 - dependencies: - loose-envify: 1.4.0 - react: 18.2.0 - scheduler: 0.23.0 - dev: true - - /react@18.2.0: - resolution: {integrity: sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==} - engines: {node: '>=0.10.0'} - dependencies: - loose-envify: 1.4.0 - dev: true - - /scheduler@0.23.0: - resolution: {integrity: sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw==} - dependencies: - loose-envify: 1.4.0 - dev: true - - /shallowequal@1.1.0: - resolution: {integrity: sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ==} - dev: true - - /source-map-js@1.0.2: - resolution: {integrity: sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==} - engines: {node: '>=0.10.0'} - dev: true - - /styled-components@6.1.1(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-cpZZP5RrKRIClBW5Eby4JM1wElLVP4NQrJbJ0h10TidTyJf4SIIwa3zLXOoPb4gJi8MsJ8mjq5mu2IrEhZIAcQ==} - engines: {node: '>= 16'} - peerDependencies: - react: '>= 16.8.0' - react-dom: '>= 16.8.0' - dependencies: - '@emotion/is-prop-valid': 1.2.1 - '@emotion/unitless': 0.8.1 - '@types/stylis': 4.2.4 - css-to-react-native: 3.2.0 - csstype: 3.1.2 - postcss: 8.4.33 - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - shallowequal: 1.1.0 - stylis: 4.3.0 - tslib: 2.6.2 - dev: true - - /stylis@4.3.0: - resolution: {integrity: sha512-E87pIogpwUsUwXw7dNyU4QDjdgVMy52m+XEOPEKUn161cCzWjjhPSQhByfd1CcNvrOLnXQ6OnnZDwnJrz/Z4YQ==} - dev: true - - /tslib@2.6.2: - resolution: {integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==} - dev: true diff --git a/fixtures/tsconfig/cases/builtins/thing.js b/fixtures/tsconfig/cases/builtins/thing.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/builtins/tsconfig.json b/fixtures/tsconfig/cases/builtins/tsconfig.json deleted file mode 100644 index 36aa1a4d..00000000 --- a/fixtures/tsconfig/cases/builtins/tsconfig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compilerOptions": { - "baseUrl": "." - } -} diff --git a/fixtures/tsconfig/cases/exports/index.js b/fixtures/tsconfig/cases/exports/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/exports/tsconfig.json b/fixtures/tsconfig/cases/exports/tsconfig.json deleted file mode 100644 index f0e3159b..00000000 --- a/fixtures/tsconfig/cases/exports/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-exports" -} diff --git a/fixtures/tsconfig/cases/extends-extension/base-tsconfig.json b/fixtures/tsconfig/cases/extends-extension/base-tsconfig.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/cases/extends-extension/base-tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/cases/extends-extension/foo.js b/fixtures/tsconfig/cases/extends-extension/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-extension/tsconfig.json b/fixtures/tsconfig/cases/extends-extension/tsconfig.json deleted file mode 100644 index 0ae4c6a3..00000000 --- a/fixtures/tsconfig/cases/extends-extension/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./base-tsconfig" -} diff --git a/fixtures/tsconfig/cases/extends-extensionless/foo.js b/fixtures/tsconfig/cases/extends-extensionless/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-extensionless/tsconfig.json b/fixtures/tsconfig/cases/extends-extensionless/tsconfig.json deleted file mode 100644 index c36cb7d4..00000000 --- a/fixtures/tsconfig/cases/extends-extensionless/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-field/conf" -} diff --git a/fixtures/tsconfig/cases/extends-multiple/foo.js b/fixtures/tsconfig/cases/extends-multiple/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-multiple/tsconfig.json b/fixtures/tsconfig/cases/extends-multiple/tsconfig.json deleted file mode 100644 index aa2ae783..00000000 --- a/fixtures/tsconfig/cases/extends-multiple/tsconfig.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": ["../extends-extension", "../extends-paths"], - "compilerOptions": { - "baseUrl": ".", - }, -} diff --git a/fixtures/tsconfig/cases/extends-not-found/index.js b/fixtures/tsconfig/cases/extends-not-found/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-not-found/tsconfig.json b/fixtures/tsconfig/cases/extends-not-found/tsconfig.json deleted file mode 100644 index 99df91da..00000000 --- a/fixtures/tsconfig/cases/extends-not-found/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./not-found" -} diff --git a/fixtures/tsconfig/cases/extends-paths/src/index.js b/fixtures/tsconfig/cases/extends-paths/src/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-paths/tsconfig.base.json b/fixtures/tsconfig/cases/extends-paths/tsconfig.base.json deleted file mode 100644 index 5c64b067..00000000 --- a/fixtures/tsconfig/cases/extends-paths/tsconfig.base.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "@/*": ["./*"] - } - } -} diff --git a/fixtures/tsconfig/cases/extends-paths/tsconfig.json b/fixtures/tsconfig/cases/extends-paths/tsconfig.json deleted file mode 100644 index 51086018..00000000 --- a/fixtures/tsconfig/cases/extends-paths/tsconfig.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": "./tsconfig.base.json", - "compilerOptions": { - "baseUrl": "src", - }, -} diff --git a/fixtures/tsconfig/cases/field/index.js b/fixtures/tsconfig/cases/field/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/field/tsconfig.json b/fixtures/tsconfig/cases/field/tsconfig.json deleted file mode 100644 index 9f86c3f4..00000000 --- a/fixtures/tsconfig/cases/field/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-field" -} diff --git a/fixtures/tsconfig/cases/index/index.js b/fixtures/tsconfig/cases/index/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/index/tsconfig.json b/fixtures/tsconfig/cases/index/tsconfig.json deleted file mode 100644 index d20b1774..00000000 --- a/fixtures/tsconfig/cases/index/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-index" -} diff --git a/fixtures/tsconfig/cases/paths_template_variable/foo.js b/fixtures/tsconfig/cases/paths_template_variable/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json b/fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json deleted file mode 100644 index a1a37bb6..00000000 --- a/fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "../../tsconfig_template_variable.json" -} diff --git a/fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json b/fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json deleted file mode 100644 index e7d8e5e5..00000000 --- a/fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "compilerOptions": { - "composite": true, - "paths": { - "foo": ["${configDir}/foo.js"] - } - } -} diff --git a/fixtures/tsconfig/cases/project_references/app/aliased/index.ts b/fixtures/tsconfig/cases/project_references/app/aliased/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/app/index.ts b/fixtures/tsconfig/cases/project_references/app/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/app/tsconfig.json b/fixtures/tsconfig/cases/project_references/app/tsconfig.json deleted file mode 100644 index 7036d2bb..00000000 --- a/fixtures/tsconfig/cases/project_references/app/tsconfig.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "extends": "../tsconfig.base.json", - "compilerOptions": { - "baseUrl": "./", - "paths": { - "@/*": ["./aliased/*"] - } - }, - "references": [ - { - "path": "../project_a/conf.json" - }, - { - "path": "../project_b" - }, - { - "path": "../project_c/tsconfig.json" - }, - { - "path": "../../paths_template_variable/tsconfig2.json" - } - ] -} diff --git a/fixtures/tsconfig/cases/project_references/project_a/aliased/index.ts b/fixtures/tsconfig/cases/project_references/project_a/aliased/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_a/conf.json b/fixtures/tsconfig/cases/project_references/project_a/conf.json deleted file mode 100644 index 4d389d7a..00000000 --- a/fixtures/tsconfig/cases/project_references/project_a/conf.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "compilerOptions": { - "composite": true, - "paths": { - "@/*": ["./aliased/*"] - } - } -} diff --git a/fixtures/tsconfig/cases/project_references/project_a/index.ts b/fixtures/tsconfig/cases/project_references/project_a/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_b/src/aliased/index.ts b/fixtures/tsconfig/cases/project_references/project_b/src/aliased/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_b/tsconfig.json b/fixtures/tsconfig/cases/project_references/project_b/tsconfig.json deleted file mode 100644 index 4ab05cd8..00000000 --- a/fixtures/tsconfig/cases/project_references/project_b/tsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "compilerOptions": { - "composite": true, - "baseUrl": "./src", - "paths": { - "@/*": ["./aliased/*"] - } - } -} diff --git a/fixtures/tsconfig/cases/project_references/project_c/index.ts b/fixtures/tsconfig/cases/project_references/project_c/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_c/tsconfig.json b/fixtures/tsconfig/cases/project_references/project_c/tsconfig.json deleted file mode 100644 index fe520939..00000000 --- a/fixtures/tsconfig/cases/project_references/project_c/tsconfig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compilerOptions": { - "composite": true - } -} diff --git a/fixtures/tsconfig/cases/project_references/tsconfig.base.json b/fixtures/tsconfig/cases/project_references/tsconfig.base.json deleted file mode 100644 index 88ccffe7..00000000 --- a/fixtures/tsconfig/cases/project_references/tsconfig.base.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "compilerOptions": { - } -} diff --git a/fixtures/tsconfig/cases/suffixes/a.ios.ts b/fixtures/tsconfig/cases/suffixes/a.ios.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/a.ts b/fixtures/tsconfig/cases/suffixes/a.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/b.ts b/fixtures/tsconfig/cases/suffixes/b.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/c-test.ts b/fixtures/tsconfig/cases/suffixes/c-test.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/index.ts b/fixtures/tsconfig/cases/suffixes/index.ts deleted file mode 100644 index b09939b9..00000000 --- a/fixtures/tsconfig/cases/suffixes/index.ts +++ /dev/null @@ -1 +0,0 @@ -import './a'; diff --git a/fixtures/tsconfig/cases/suffixes/tsconfig.json b/fixtures/tsconfig/cases/suffixes/tsconfig.json deleted file mode 100644 index 4c2ccc8f..00000000 --- a/fixtures/tsconfig/cases/suffixes/tsconfig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compilerOptions": { - "moduleSuffixes": [".ios", "-test", ""] - } -} diff --git a/fixtures/tsconfig/cases/trailing-comma/bar.js b/fixtures/tsconfig/cases/trailing-comma/bar.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/trailing-comma/index.js b/fixtures/tsconfig/cases/trailing-comma/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/trailing-comma/tsconfig.json b/fixtures/tsconfig/cases/trailing-comma/tsconfig.json deleted file mode 100644 index 6dc20ca5..00000000 --- a/fixtures/tsconfig/cases/trailing-comma/tsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "compilerOptions": { - "paths": { - /* some comment */ - "foo": ["bar.js"], - }, - }, - // another comment -} diff --git a/fixtures/tsconfig/foo.js b/fixtures/tsconfig/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/nested/index.js b/fixtures/tsconfig/nested/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/nested/test.js b/fixtures/tsconfig/nested/test.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/nested/tsconfig.json b/fixtures/tsconfig/nested/tsconfig.json deleted file mode 100644 index 6deb3011..00000000 --- a/fixtures/tsconfig/nested/tsconfig.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "extends": "..", - "compilerOptions": { - "paths": { - "ts-path": ["test.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-exports/conf.json b/fixtures/tsconfig/node_modules/tsconfig-exports/conf.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-exports/conf.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-exports/foo.js b/fixtures/tsconfig/node_modules/tsconfig-exports/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-exports/package.json b/fixtures/tsconfig/node_modules/tsconfig-exports/package.json deleted file mode 100644 index be0ddee6..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-exports/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "tsconfig-exports", - "private": true, - "exports": { - ".": "./conf.json" - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-field/conf.json b/fixtures/tsconfig/node_modules/tsconfig-field/conf.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-field/conf.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-field/foo.js b/fixtures/tsconfig/node_modules/tsconfig-field/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-field/package.json b/fixtures/tsconfig/node_modules/tsconfig-field/package.json deleted file mode 100644 index 7138fdde..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-field/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "tsconfig-field", - "private": true, - "tsconfig": "conf.json" -} \ No newline at end of file diff --git a/fixtures/tsconfig/node_modules/tsconfig-index/foo.js b/fixtures/tsconfig/node_modules/tsconfig-index/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-index/package.json b/fixtures/tsconfig/node_modules/tsconfig-index/package.json deleted file mode 100644 index eb2431e7..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-index/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "tsconfig-index", - "private": true -} \ No newline at end of file diff --git a/fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json b/fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-not-used/foo.js b/fixtures/tsconfig/node_modules/tsconfig-not-used/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json b/fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json deleted file mode 100644 index eb16d127..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "ts-path": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/package.json b/fixtures/tsconfig/package.json deleted file mode 100755 index f48acd1c..00000000 --- a/fixtures/tsconfig/package.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "name": "resolver", - "private": true, - "alias": { - "aliased": "foo", - "aliased-file": "./bar.js", - "something": "./nested/test.js", - "aliasedfolder": "./nested", - "aliasedabsolute": "/nested", - "foo/bar": "./bar.js", - "glob/*/*": "./nested/$2", - "./baz": "./bar.js", - "url": false - }, - "imports": { - "#test": "./bar.js" - }, - "dependencies": { - "foo": "^0.3.4" - }, - "peerDependencies": { - "bar": "*" - } -} diff --git a/fixtures/tsconfig/tsconfig.json b/fixtures/tsconfig/tsconfig.json deleted file mode 100644 index eb16d127..00000000 --- a/fixtures/tsconfig/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "ts-path": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/tsconfig_broken.json b/fixtures/tsconfig/tsconfig_broken.json deleted file mode 100644 index 98232c64..00000000 --- a/fixtures/tsconfig/tsconfig_broken.json +++ /dev/null @@ -1 +0,0 @@ -{ diff --git a/fixtures/tsconfig/tsconfig_template_variable.json b/fixtures/tsconfig/tsconfig_template_variable.json deleted file mode 100644 index 6f272344..00000000 --- a/fixtures/tsconfig/tsconfig_template_variable.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["${configDir}/foo.js"] - } - } -} diff --git a/napi/__test__/resolver.spec.mjs b/napi/__test__/resolver.spec.mjs deleted file mode 100644 index ac6ee0ef..00000000 --- a/napi/__test__/resolver.spec.mjs +++ /dev/null @@ -1,260 +0,0 @@ -import { join } from 'node:path' -import { fileURLToPath } from 'node:url' - -import test from 'ava' - -let ResolverFactory - -if (process.env.WASI_TEST) { - const wasi = await import('../resolver.wasi.cjs') - ResolverFactory = wasi.ResolverFactory -} else { - const napi = await import('../index.js') - ResolverFactory = napi.ResolverFactory -} - -const currentDir = join(fileURLToPath(import.meta.url), '..') - -const enhancedResolveRoot = join( - currentDir, - '..', - '..', - 'fixtures', - 'enhanced_resolve', - 'test', - 'fixtures' -) - -// https://github.com/webpack/enhanced-resolve/blob/main/test/resolve.test.js - -for (const [title, context, request, expected] of [ - [ - 'absolute path', - enhancedResolveRoot, - join(enhancedResolveRoot, 'main1.js'), - join(enhancedResolveRoot, 'main1.js'), - ], - [ - 'file with .js', - enhancedResolveRoot, - './main1.js', - join(enhancedResolveRoot, 'main1.js'), - ], - [ - 'file without extension', - enhancedResolveRoot, - './main1', - join(enhancedResolveRoot, 'main1.js'), - ], - [ - 'another file with .js', - enhancedResolveRoot, - './a.js', - join(enhancedResolveRoot, 'a.js'), - ], - [ - 'another file without extension', - enhancedResolveRoot, - './a', - join(enhancedResolveRoot, 'a.js'), - ], - [ - 'file in module with .js', - enhancedResolveRoot, - 'm1/a.js', - join(enhancedResolveRoot, 'node_modules/m1/a.js'), - ], - [ - 'file in module without extension', - enhancedResolveRoot, - 'm1/a', - join(enhancedResolveRoot, 'node_modules/m1/a.js'), - ], - [ - 'another file in module without extension', - enhancedResolveRoot, - 'complexm/step1', - join(enhancedResolveRoot, 'node_modules/complexm/step1.js'), - ], - [ - 'from submodule to file in sibling module', - join(enhancedResolveRoot, 'node_modules/complexm'), - 'm2/b.js', - join(enhancedResolveRoot, 'node_modules/m2/b.js'), - ], - [ - 'from nested directory to overwritten file in module', - join(enhancedResolveRoot, 'multiple_modules'), - 'm1/a.js', - join(enhancedResolveRoot, 'multiple_modules/node_modules/m1/a.js'), - ], - [ - 'from nested directory to not overwritten file in module', - join(enhancedResolveRoot, 'multiple_modules'), - 'm1/b.js', - join(enhancedResolveRoot, 'node_modules/m1/b.js'), - ], - [ - 'file with query', - enhancedResolveRoot, - './main1.js?query', - join(enhancedResolveRoot, 'main1.js?query'), - ], - [ - 'file with fragment', - enhancedResolveRoot, - './main1.js#fragment', - join(enhancedResolveRoot, 'main1.js#fragment'), - ], - [ - 'file with fragment and query', - enhancedResolveRoot, - './main1.js#fragment?query', - join(enhancedResolveRoot, 'main1.js#fragment?query'), - ], - [ - 'file with query and fragment', - enhancedResolveRoot, - './main1.js?#fragment', - join(enhancedResolveRoot, 'main1.js?#fragment'), - ], - - [ - 'file with query (unicode)', - enhancedResolveRoot, - './测试.js?query', - join(enhancedResolveRoot, '测试.js?query'), - ], - [ - 'file with fragment (unicode)', - enhancedResolveRoot, - './测试.js#fragment', - join(enhancedResolveRoot, '测试.js#fragment'), - ], - [ - 'file with fragment and query (unicode)', - enhancedResolveRoot, - './测试.js#fragment?query', - join(enhancedResolveRoot, '测试.js#fragment?query'), - ], - [ - 'file with query and fragment (unicode)', - enhancedResolveRoot, - './测试.js?#fragment', - join(enhancedResolveRoot, '测试.js?#fragment'), - ], - - [ - 'file in module with query', - enhancedResolveRoot, - 'm1/a?query', - join(enhancedResolveRoot, 'node_modules/m1/a.js?query'), - ], - [ - 'file in module with fragment', - enhancedResolveRoot, - 'm1/a#fragment', - join(enhancedResolveRoot, 'node_modules/m1/a.js#fragment'), - ], - [ - 'file in module with fragment and query', - enhancedResolveRoot, - 'm1/a#fragment?query', - join(enhancedResolveRoot, 'node_modules/m1/a.js#fragment?query'), - ], - [ - 'file in module with query and fragment', - enhancedResolveRoot, - 'm1/a?#fragment', - join(enhancedResolveRoot, 'node_modules/m1/a.js?#fragment'), - ], - [ - 'differ between directory and file, resolve file', - enhancedResolveRoot, - './dirOrFile', - join(enhancedResolveRoot, 'dirOrFile.js'), - ], - [ - 'differ between directory and file, resolve directory', - enhancedResolveRoot, - './dirOrFile/', - join(enhancedResolveRoot, 'dirOrFile/index.js'), - ], - [ - 'find node_modules outside of node_modules', - join(enhancedResolveRoot, 'browser-module/node_modules'), - 'm1/a', - join(enhancedResolveRoot, 'node_modules/m1/a.js'), - ], - [ - "don't crash on main field pointing to self", - enhancedResolveRoot, - './main-field-self', - join(enhancedResolveRoot, './main-field-self/index.js'), - ], - [ - "don't crash on main field pointing to self (2)", - enhancedResolveRoot, - './main-field-self2', - join(enhancedResolveRoot, './main-field-self2/index.js'), - ], - // enhanced-resolve has `#` prepended with a `\0`, they are removed from the - // following 3 expected test results. - // See https://github.com/webpack/enhanced-resolve#escaping - [ - 'handle fragment edge case (no fragment)', - enhancedResolveRoot, - './no#fragment/#/#', - join(enhancedResolveRoot, 'no#fragment', '#', '#.js'), - ], - [ - 'handle fragment edge case (fragment)', - enhancedResolveRoot, - './no#fragment/#/', - join(enhancedResolveRoot, 'no.js#fragment') + '/#/', - ], - [ - 'handle fragment escaping', - enhancedResolveRoot, - './no\0#fragment/\0#/\0##fragment', - join(enhancedResolveRoot, 'no#fragment', '#', '#.js#fragment'), - ], -]) { - test(title, (t) => { - const resolver = new ResolverFactory({ - modules: ['src/a', 'src/b', 'src/common', 'node_modules'], - extensions: ['.js', '.jsx', '.ts', '.tsx'], - }) - - t.is(resolver.sync(context, request).path, expected) - }) -} - -test('resolve pnpm package', (t) => { - const rootDir = join(currentDir, '..', '..'); - const pnpmProjectPath = join(rootDir, 'fixtures', 'pnpm') - const resolver = new ResolverFactory({ - aliasFields: ['browser'], - }) - t.deepEqual(resolver.sync(pnpmProjectPath, 'styled-components'), { - path: join( - rootDir, - 'node_modules/.pnpm/styled-components@6.1.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/styled-components/dist/styled-components.browser.cjs.js' - ), - }) - t.deepEqual( - resolver.sync( - join( - rootDir, - 'node_modules/.pnpm/styled-components@6.1.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/styled-components' - ), - 'react' - ), - { - path: join( - rootDir, - 'node_modules/.pnpm/react@18.3.1/node_modules/react/index.js' - ), - } - ) -}) diff --git a/napi/src/lib.rs b/napi/src/lib.rs deleted file mode 100644 index 7cd839c5..00000000 --- a/napi/src/lib.rs +++ /dev/null @@ -1,214 +0,0 @@ -extern crate napi; -extern crate napi_derive; -extern crate oxc_resolver; - -use std::{ - path::{Path, PathBuf}, - sync::Arc, -}; - -use napi::{bindgen_prelude::AsyncTask, Task}; -use napi_derive::napi; -use oxc_resolver::{ResolveOptions, Resolver}; - -use self::{ - options::{NapiResolveOptions, StrOrStrList}, - tracing::init_tracing, -}; - -mod options; -mod tracing; - -#[napi(object)] -pub struct ResolveResult { - pub path: Option, - pub error: Option, - /// "type" field in the package.json file - pub module_type: Option, -} - -fn resolve(resolver: &Resolver, path: &Path, request: &str) -> ResolveResult { - match resolver.resolve(path, request) { - Ok(resolution) => ResolveResult { - path: Some(resolution.full_path().to_string_lossy().to_string()), - error: None, - module_type: resolution - .package_json() - .and_then(|p| p.r#type.as_ref()) - .and_then(|t| t.as_str()) - .map(|t| t.to_string()), - }, - Err(err) => ResolveResult { path: None, module_type: None, error: Some(err.to_string()) }, - } -} - -#[allow(clippy::needless_pass_by_value)] -#[napi] -pub fn sync(path: String, request: String) -> ResolveResult { - let path = PathBuf::from(path); - let resolver = Resolver::new(ResolveOptions::default()); - resolve(&resolver, &path, &request) -} - -pub struct ResolveTask { - resolver: Arc, - directory: PathBuf, - request: String, -} - -#[napi] -impl Task for ResolveTask { - type Output = ResolveResult; - type JsValue = ResolveResult; - - fn compute(&mut self) -> napi::Result { - Ok(resolve(&self.resolver, &self.directory, &self.request)) - } - - fn resolve(&mut self, _: napi::Env, result: Self::Output) -> napi::Result { - Ok(result) - } -} - -#[napi] -pub struct ResolverFactory { - resolver: Arc, -} - -#[napi] -impl ResolverFactory { - #[napi(constructor)] - pub fn new(options: NapiResolveOptions) -> Self { - init_tracing(); - Self { resolver: Arc::new(Resolver::new(Self::normalize_options(options))) } - } - - #[napi] - pub fn default() -> Self { - let default_options = ResolveOptions::default(); - Self { resolver: Arc::new(Resolver::new(default_options)) } - } - - /// Clone the resolver using the same underlying cache. - #[napi] - pub fn clone_with_options(&self, options: NapiResolveOptions) -> Self { - Self { - resolver: Arc::new(self.resolver.clone_with_options(Self::normalize_options(options))), - } - } - - /// Clear the underlying cache. - #[napi] - pub fn clear_cache(&self) { - self.resolver.clear_cache(); - } - - /// Synchronously resolve `specifier` at an absolute path to a `directory`. - #[allow(clippy::needless_pass_by_value)] - #[napi] - pub fn sync(&self, directory: String, request: String) -> ResolveResult { - let path = PathBuf::from(directory); - resolve(&self.resolver, &path, &request) - } - - /// Asynchronously resolve `specifier` at an absolute path to a `directory`. - #[allow(clippy::needless_pass_by_value)] - #[napi(js_name = "async")] - pub fn resolve_async(&self, directory: String, request: String) -> AsyncTask { - let path = PathBuf::from(directory); - let resolver = self.resolver.clone(); - AsyncTask::new(ResolveTask { resolver, directory: path, request }) - } - - fn normalize_options(op: NapiResolveOptions) -> ResolveOptions { - let default = ResolveOptions::default(); - // merging options - ResolveOptions { - tsconfig: op.tsconfig.map(|tsconfig| tsconfig.into()), - alias: op - .alias - .map(|alias| { - alias - .into_iter() - .map(|(k, v)| { - let v = v - .into_iter() - .map(|item| match item { - Some(path) => oxc_resolver::AliasValue::from(path), - None => oxc_resolver::AliasValue::Ignore, - }) - .collect(); - (k, v) - }) - .collect::>() - }) - .unwrap_or(default.alias), - alias_fields: op - .alias_fields - .map(|o| o.into_iter().map(|x| StrOrStrList(x).into()).collect::>()) - .unwrap_or(default.alias_fields), - condition_names: op.condition_names.unwrap_or(default.condition_names), - description_files: op.description_files.unwrap_or(default.description_files), - enforce_extension: op - .enforce_extension - .map(|enforce_extension| enforce_extension.into()) - .unwrap_or(default.enforce_extension), - exports_fields: op - .exports_fields - .map(|o| o.into_iter().map(|x| StrOrStrList(x).into()).collect::>()) - .unwrap_or(default.exports_fields), - imports_fields: op - .imports_fields - .map(|o| o.into_iter().map(|x| StrOrStrList(x).into()).collect::>()) - .unwrap_or(default.imports_fields), - extension_alias: op - .extension_alias - .map(|extension_alias| extension_alias.into_iter().collect::>()) - .unwrap_or(default.extension_alias), - extensions: op.extensions.unwrap_or(default.extensions), - fallback: op - .fallback - .map(|fallback| { - fallback - .into_iter() - .map(|(k, v)| { - let v = v - .into_iter() - .map(|item| match item { - Some(path) => oxc_resolver::AliasValue::from(path), - None => oxc_resolver::AliasValue::Ignore, - }) - .collect(); - (k, v) - }) - .collect::>() - }) - .unwrap_or(default.fallback), - fully_specified: op.fully_specified.unwrap_or(default.fully_specified), - main_fields: op - .main_fields - .map(|o| StrOrStrList(o).into()) - .unwrap_or(default.main_fields), - main_files: op.main_files.unwrap_or(default.main_files), - modules: op.modules.map(|o| StrOrStrList(o).into()).unwrap_or(default.modules), - resolve_to_context: op.resolve_to_context.unwrap_or(default.resolve_to_context), - prefer_relative: op.prefer_relative.unwrap_or(default.prefer_relative), - prefer_absolute: op.prefer_absolute.unwrap_or(default.prefer_absolute), - restrictions: op - .restrictions - .map(|restrictions| { - restrictions - .into_iter() - .map(|restriction| restriction.into()) - .collect::>() - }) - .unwrap_or(default.restrictions), - roots: op - .roots - .map(|roots| roots.into_iter().map(PathBuf::from).collect::>()) - .unwrap_or(default.roots), - symlinks: op.symlinks.unwrap_or(default.symlinks), - builtin_modules: op.builtin_modules.unwrap_or(default.builtin_modules), - } - } -} diff --git a/napi/src/options.rs b/napi/src/options.rs deleted file mode 100644 index ea35672f..00000000 --- a/napi/src/options.rs +++ /dev/null @@ -1,261 +0,0 @@ -use std::path::PathBuf; - -use napi::Either; -use napi_derive::napi; -use std::collections::HashMap; - -/// Module Resolution Options -/// -/// Options are directly ported from [enhanced-resolve](https://github.com/webpack/enhanced-resolve#resolver-options). -/// -/// See [webpack resolve](https://webpack.js.org/configuration/resolve/) for information and examples -#[derive(Debug, Clone)] -#[napi(object)] -pub struct NapiResolveOptions { - /// Path to TypeScript configuration file. - /// - /// Default `None` - pub tsconfig: Option, - - /// Alias for [ResolveOptions::alias] and [ResolveOptions::fallback]. - /// - /// For the second value of the tuple, `None -> AliasValue::Ignore`, Some(String) -> - /// AliasValue::Path(String)` - /// Create aliases to import or require certain modules more easily. - /// A trailing $ can also be added to the given object's keys to signify an exact match. - pub alias: Option>>>, - - /// A list of alias fields in description files. - /// Specify a field, such as `browser`, to be parsed according to [this specification](https://github.com/defunctzombie/package-browser-field-spec). - /// Can be a path to json object such as `["path", "to", "exports"]`. - /// - /// Default `[]` - #[napi(ts_type = "(string | string[])[]")] - pub alias_fields: Option>, - - /// Condition names for exports field which defines entry points of a package. - /// The key order in the exports field is significant. During condition matching, earlier entries have higher priority and take precedence over later entries. - /// - /// Default `[]` - pub condition_names: Option>, - - /// The JSON files to use for descriptions. (There was once a `bower.json`.) - /// - /// Default `["package.json"]` - pub description_files: Option>, - - /// If true, it will not allow extension-less files. - /// So by default `require('./foo')` works if `./foo` has a `.js` extension, - /// but with this enabled only `require('./foo.js')` will work. - /// - /// Default to `true` when [ResolveOptions::extensions] contains an empty string. - /// Use `Some(false)` to disable the behavior. - /// See - /// - /// Default None, which is the same as `Some(false)` when the above empty rule is not applied. - pub enforce_extension: Option, - - /// A list of exports fields in description files. - /// Can be a path to json object such as `["path", "to", "exports"]`. - /// - /// Default `[["exports"]]`. - #[napi(ts_type = "(string | string[])[]")] - pub exports_fields: Option>, - - /// Fields from `package.json` which are used to provide the internal requests of a package - /// (requests starting with # are considered internal). - /// - /// Can be a path to a JSON object such as `["path", "to", "imports"]`. - /// - /// Default `[["imports"]]`. - #[napi(ts_type = "(string | string[])[]")] - pub imports_fields: Option>, - - /// An object which maps extension to extension aliases. - /// - /// Default `{}` - pub extension_alias: Option>>, - - /// Attempt to resolve these extensions in order. - /// If multiple files share the same name but have different extensions, - /// will resolve the one with the extension listed first in the array and skip the rest. - /// - /// Default `[".js", ".json", ".node"]` - pub extensions: Option>, - - /// Redirect module requests when normal resolving fails. - /// - /// Default `[]` - pub fallback: Option>>>, - - /// 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). - /// - /// See also webpack configuration [resolve.fullySpecified](https://webpack.js.org/configuration/module/#resolvefullyspecified) - /// - /// Default `false` - pub fully_specified: Option, - - /// A list of main fields in description files - /// - /// Default `["main"]`. - #[napi(ts_type = "string | string[]")] - pub main_fields: Option, - - /// The filename to be used while resolving directories. - /// - /// Default `["index"]` - pub main_files: Option>, - - /// A list of directories to resolve modules from, can be absolute path or folder name. - /// - /// Default `["node_modules"]` - #[napi(ts_type = "string | string[]")] - pub modules: Option, - - /// Resolve to a context instead of a file. - /// - /// Default `false` - pub resolve_to_context: Option, - - /// Prefer to resolve module requests as relative requests instead of using modules from node_modules directories. - /// - /// Default `false` - pub prefer_relative: Option, - - /// Prefer to resolve server-relative urls as absolute paths before falling back to resolve in ResolveOptions::roots. - /// - /// Default `false` - pub prefer_absolute: Option, - - /// A list of resolve restrictions to restrict the paths that a request can be resolved on. - /// - /// Default `[]` - pub restrictions: Option>, - - /// A list of directories where requests of server-relative URLs (starting with '/') are resolved. - /// On non-Windows systems these requests are resolved as an absolute path first. - /// - /// Default `[]` - pub roots: Option>, - - /// Whether to resolve symlinks to their symlinked location. - /// When enabled, symlinked resources are resolved to their real path, not their symlinked location. - /// Note that this may cause module resolution to fail when using tools that symlink packages (like npm link). - /// - /// Default `true` - pub symlinks: Option, - - /// Whether to parse [module.builtinModules](https://nodejs.org/api/module.html#modulebuiltinmodules) or not. - /// For example, "zlib" will throw [crate::ResolveError::Builtin] when set to true. - /// - /// Default `false` - pub builtin_modules: Option, -} - -#[napi] -#[derive(Debug, PartialEq, Eq)] -pub enum EnforceExtension { - Auto, - Enabled, - Disabled, -} - -impl EnforceExtension { - pub fn is_auto(&self) -> bool { - *self == Self::Auto - } - - pub fn is_enabled(&self) -> bool { - *self == Self::Enabled - } - - pub fn is_disabled(&self) -> bool { - *self == Self::Disabled - } -} - -/// Alias Value for [ResolveOptions::alias] and [ResolveOptions::fallback]. -/// Use struct because napi don't support structured union now -#[napi(object)] -#[derive(Debug, Clone)] -pub struct Restriction { - pub path: Option, - pub regex: Option, -} - -/// Tsconfig Options -/// -/// Derived from [tsconfig-paths-webpack-plugin](https://github.com/dividab/tsconfig-paths-webpack-plugin#options) -#[napi(object)] -#[derive(Debug, Clone)] -pub struct TsconfigOptions { - /// Allows you to specify where to find the TypeScript configuration file. - /// You may provide - /// * a relative path to the configuration file. It will be resolved relative to cwd. - /// * an absolute path to the configuration file. - pub config_file: String, - - /// Support for Typescript Project References. - /// - /// * `'auto'`: use the `references` field from tsconfig of `config_file`. - /// * `string[]`: manually provided relative or absolute path. - #[napi(ts_type = "'auto' | string[]")] - pub references: Option>>, -} - -impl Into for Restriction { - fn into(self) -> oxc_resolver::Restriction { - match (self.path, self.regex) { - (None, None) => { - panic!("Should specify path or regex") - } - (None, Some(regex)) => oxc_resolver::Restriction::RegExp(regex), - (Some(path), None) => oxc_resolver::Restriction::Path(PathBuf::from(path)), - (Some(_), Some(_)) => { - panic!("Restriction can't be path and regex at the same time") - } - } - } -} - -impl Into for EnforceExtension { - fn into(self) -> oxc_resolver::EnforceExtension { - match self { - EnforceExtension::Auto => oxc_resolver::EnforceExtension::Auto, - EnforceExtension::Enabled => oxc_resolver::EnforceExtension::Enabled, - EnforceExtension::Disabled => oxc_resolver::EnforceExtension::Disabled, - } - } -} - -impl Into for TsconfigOptions { - fn into(self) -> oxc_resolver::TsconfigOptions { - oxc_resolver::TsconfigOptions { - config_file: PathBuf::from(self.config_file), - references: match self.references { - Some(Either::A(string)) if string.as_str() == "auto" => { - oxc_resolver::TsconfigReferences::Auto - } - Some(Either::A(opt)) => { - panic!("`{}` is not a valid option for tsconfig references", opt) - } - Some(Either::B(paths)) => oxc_resolver::TsconfigReferences::Paths( - paths.into_iter().map(PathBuf::from).collect::>(), - ), - None => oxc_resolver::TsconfigReferences::Disabled, - }, - } - } -} - -type StrOrStrListType = Either>; -pub struct StrOrStrList(pub StrOrStrListType); - -impl Into> for StrOrStrList { - fn into(self) -> Vec { - match self { - StrOrStrList(Either::A(s)) => Vec::from([s]), - StrOrStrList(Either::B(a)) => a, - } - } -} diff --git a/napi/src/tracing.rs b/napi/src/tracing.rs deleted file mode 100644 index 88e4cd7e..00000000 --- a/napi/src/tracing.rs +++ /dev/null @@ -1,25 +0,0 @@ -use std::sync::OnceLock; - -use tracing_subscriber::filter::Targets; -use tracing_subscriber::prelude::__tracing_subscriber_SubscriberExt; -use tracing_subscriber::util::SubscriberInitExt; - -/// To debug `oxc_resolver`: -/// `OXC_LOG=DEBUG your program` -pub fn init_tracing() { - static TRACING: OnceLock<()> = OnceLock::new(); - TRACING.get_or_init(|| { - // Usage without the `regex` feature. - // - tracing_subscriber::registry() - .with(std::env::var("OXC_LOG").map_or_else( - |_| Targets::new(), - |env_var| { - use std::str::FromStr; - Targets::from_str(&env_var).unwrap() - }, - )) - .with(tracing_subscriber::fmt::layer()) - .init(); - }); -} diff --git a/napi/tests/options.test.mjs b/napi/tests/options.test.mjs deleted file mode 100644 index 4a93efff..00000000 --- a/napi/tests/options.test.mjs +++ /dev/null @@ -1,59 +0,0 @@ -import { describe, it } from "node:test"; -import { ResolverFactory } from "../index.js"; -import * as assert from "node:assert"; -import * as path from "node:path"; - -const fixtureDir = new URL( - "../../fixtures/enhanced_resolve/test/fixtures", - import.meta.url -).pathname; - -describe("option", () => { - describe("aliasFields", () => { - it("should allow field string ", () => { - const resolver = new ResolverFactory({ aliasFields: ["browser"] }); - assert.match( - resolver.sync(fixtureDir, "./browser-module/lib/replaced.js").path, - /browser-module\/lib\/browser\.js$/ - ); - }); - it("should allow json path array", () => { - const resolver = new ResolverFactory({ - aliasFields: [["innerBrowser1", "field", "browser"]], - }); - - assert.match( - resolver.sync(fixtureDir, "./browser-module/lib/main1.js").path, - /browser-module\/lib\/main\.js$/ - ); - }); - }); - - describe("exportsFields", () => { - const createTest = (exportsFields) => { - const resolver = new ResolverFactory({ exportsFields }); - assert.match( - resolver.sync( - path.resolve(fixtureDir, "./exports-field3"), - "exports-field" - ).path, - /\/exports-field\/src\/index\.js$/ - ); - }; - it("should allow string as field item", createTest(["broken"])); - it("should allow json path array as field item", createTest([["broken"]])); - }); - - describe("mainFields", () => { - const createTest = (mainFields) => { - const resolver = new ResolverFactory({ mainFields }); - assert.match( - resolver.sync(fixtureDir, "../..").path, - /\/lib\/index\.js$/ - ); - }; - it("should use `'main'` as default", createTest(undefined)); - it("should allow field string", createTest("main")); - it("should allow field array", createTest(["main"])); - }); -}); diff --git a/npm/package.json b/npm/package.json index 85422809..7136edb8 100644 --- a/npm/package.json +++ b/npm/package.json @@ -1,47 +1,36 @@ { - "name": "oxc-resolver", - "version": "1.11.0", - "description": "Oxc Resolver Node API", - "main": "index.js", - "browser": "browser.js", - "files": [ - "index.d.ts", - "index.js", - "browser.js" - ], - "license": "MIT", - "homepage": "https://oxc.rs", - "repository": { - "type": "git", - "url": "git+https://github.com/oxc-project/oxc-resolver.git" - }, - "publishConfig": { - "registry": "https://registry.npmjs.org/", - "access": "public" - }, - "napi": { - "binaryName": "resolver", - "packageName": "@oxc-resolver/binding", - "wasm": { - "browser": { - "fs": true - } - }, - "targets": [ - "x86_64-pc-windows-msvc", - "aarch64-pc-windows-msvc", - "x86_64-unknown-linux-gnu", - "x86_64-unknown-linux-musl", - "x86_64-unknown-freebsd", - "aarch64-unknown-linux-gnu", - "aarch64-unknown-linux-musl", - "armv7-unknown-linux-gnueabihf", - "x86_64-apple-darwin", - "aarch64-apple-darwin", - "wasm32-wasip1-threads" - ] - }, - "funding": { - "url": "https://github.com/sponsors/Boshen" - } + "browser": "browser.js", + "description": "Oxc Resolver Node API", + "files": [ + "index.d.ts", + "index.js", + "browser.js" + ], + "funding": { + "url": "https://github.com/sponsors/Boshen" + }, + "main": "index.js", + "name": "oxc-resolver", + "napi": { + "binaryName": "resolver", + "packageName": "@oxc-resolver/binding", + "targets": [ + "x86_64-pc-windows-msvc", + "aarch64-pc-windows-msvc", + "x86_64-unknown-linux-gnu", + "x86_64-unknown-linux-musl", + "x86_64-unknown-freebsd", + "aarch64-unknown-linux-gnu", + "aarch64-unknown-linux-musl", + "armv7-unknown-linux-gnueabihf", + "x86_64-apple-darwin", + "aarch64-apple-darwin", + "wasm32-wasip1-threads" + ], + "wasm": { + "browser": { + "fs": true + } + } + } } diff --git a/package.json b/package.json index 30892ca3..d0ee7633 100644 --- a/package.json +++ b/package.json @@ -1,33 +1,24 @@ { - "name": "@oxc-resolver/binding", - "private": true, - "version": "0.0.0", - "scripts": { - "build": "napi build --platform --release --package-json-path npm/package.json --manifest-path napi/Cargo.toml", - "build:debug": "napi build --platform --package-json-path npm/package.json --manifest-path napi/Cargo.toml", - "prepublishOnly": "napi pre-publish -t npm", - "test": "ava" - }, - "devDependencies": { - "@napi-rs/cli": "3.0.0-alpha.62", - "@napi-rs/wasm-runtime": "^0.2.4", - "@types/node": "^22.0.0", - "ava": "^6.1.3", - "emnapi": "^1.2.0", - "typescript": "^5.5.3" - }, - "ava": { - "files": [ - "napi/__test__/*.spec.mjs" - ], - "cache": false - }, - "packageManager": "pnpm@9.9.0", - "repository": { - "type": "git", - "url": "git+https://github.com/oxc-project/oxc-resolver.git" - }, - "funding": { - "url": "https://github.com/sponsors/Boshen" - } + "ava": { + "cache": false, + "files": [ + "napi/__test__/*.spec.mjs" + ] + }, + "devDependencies": { + "@napi-rs/cli": "3.0.0-alpha.62", + "@napi-rs/wasm-runtime": "^0.2.4", + "@types/node": "^22.0.0", + "ava": "^6.1.3", + "emnapi": "^1.2.0" + }, + "funding": { + "url": "https://github.com/sponsors/Boshen" + }, + "name": "@oxc-resolver/binding", + "scripts": { + "build": "napi build --platform --release --package-json-path npm/package.json --manifest-path napi/Cargo.toml", + "build:debug": "napi build --platform --package-json-path npm/package.json --manifest-path napi/Cargo.toml", + "prepublishOnly": "napi pre-publish -t npm" + } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml deleted file mode 100644 index db9e5b63..00000000 --- a/pnpm-lock.yaml +++ /dev/null @@ -1,2598 +0,0 @@ -lockfileVersion: '9.0' - -settings: - autoInstallPeers: true - excludeLinksFromLockfile: false - -importers: - - .: - devDependencies: - '@napi-rs/cli': - specifier: 3.0.0-alpha.62 - version: 3.0.0-alpha.62(@emnapi/runtime@1.2.0)(emnapi@1.2.0) - '@napi-rs/wasm-runtime': - specifier: ^0.2.4 - version: 0.2.4 - '@types/node': - specifier: ^22.0.0 - version: 22.5.4 - ava: - specifier: ^6.1.3 - version: 6.1.3 - emnapi: - specifier: ^1.2.0 - version: 1.2.0 - typescript: - specifier: ^5.5.3 - version: 5.5.4 - - fixtures/pnpm: - devDependencies: - axios: - specifier: 1.6.2 - version: 1.6.2 - ipaddr.js: - specifier: 2.2.0 - version: 2.2.0 - postcss: - specifier: 8.4.33 - version: 8.4.33 - styled-components: - specifier: 6.1.1 - version: 6.1.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - - npm: {} - -packages: - - '@emnapi/core@1.2.0': - resolution: {integrity: sha512-E7Vgw78I93we4ZWdYCb4DGAwRROGkMIXk7/y87UmANR+J6qsWusmC3gLt0H+O0KOt5e6O38U8oJamgbudrES/w==} - - '@emnapi/runtime@1.2.0': - resolution: {integrity: sha512-bV21/9LQmcQeCPEg3BDFtvwL6cwiTMksYNWQQ4KOxCZikEGalWtenoZ0wCiukJINlGCIi2KXx01g4FoH/LxpzQ==} - - '@emnapi/wasi-threads@1.0.1': - resolution: {integrity: sha512-iIBu7mwkq4UQGeMEM8bLwNK962nXdhodeScX4slfQnRhEMMzvYivHhutCIk8uojvmASXXPC2WNEjwxFWk72Oqw==} - - '@emotion/is-prop-valid@1.2.2': - resolution: {integrity: sha512-uNsoYd37AFmaCdXlg6EYD1KaPOaRWRByMCYzbKUX4+hhMfrxdVSelShywL4JVaAeM/eHUOSprYBQls+/neX3pw==} - - '@emotion/memoize@0.8.1': - resolution: {integrity: sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA==} - - '@emotion/unitless@0.8.1': - resolution: {integrity: sha512-KOEGMu6dmJZtpadb476IsZBclKvILjopjUii3V+7MnXIQCYh8W3NgNcgwo21n9LXZX6EDIKvqfjYxXebDwxKmQ==} - - '@inquirer/checkbox@2.3.10': - resolution: {integrity: sha512-CTc864M2/523rKc9AglIzAcUCuPXDZENgc5S2KZFVRbnMzpXcYTsUWmbqSeL0XLvtlvEtNevkkVbfVhJpruOyQ==} - engines: {node: '>=18'} - - '@inquirer/confirm@3.1.14': - resolution: {integrity: sha512-nbLSX37b2dGPtKWL3rPuR/5hOuD30S+pqJ/MuFiUEgN6GiMs8UMxiurKAMDzKt6C95ltjupa8zH6+3csXNHWpA==} - engines: {node: '>=18'} - - '@inquirer/core@9.0.2': - resolution: {integrity: sha512-nguvH3TZar3ACwbytZrraRTzGqyxJfYJwv+ZwqZNatAosdWQMP1GV8zvmkNlBe2JeZSaw0WYBHZk52pDpWC9qA==} - engines: {node: '>=18'} - - '@inquirer/editor@2.1.14': - resolution: {integrity: sha512-6nWpoJyVAKwAcv67bkbBmmi3f32xua79fP7TRmNUoR4K+B1GiOBsHO1YdvET/jvC+nTlBZL7puKAKyM7G+Lkzw==} - engines: {node: '>=18'} - - '@inquirer/expand@2.1.14': - resolution: {integrity: sha512-JcxsLajwPykF2kq6biIUdoOzTQ3LXqb8XMVrWkCprG/pFeU1SsxcSSFbF1T5jJGvvlTVcsE+JdGjbQ8ZRZ82RA==} - engines: {node: '>=18'} - - '@inquirer/figures@1.0.3': - resolution: {integrity: sha512-ErXXzENMH5pJt5/ssXV0DfWUZqly8nGzf0UcBV9xTnP+KyffE2mqyxIMBrZ8ijQck2nU0TQm40EQB53YreyWHw==} - engines: {node: '>=18'} - - '@inquirer/input@2.2.1': - resolution: {integrity: sha512-Yl1G6h7qWydzrJwqN777geeJVaAFL5Ly83aZlw4xHf8Z/BoTMfKRheyuMaQwOG7LQ4e5nQP7PxXdEg4SzQ+OKw==} - engines: {node: '>=18'} - - '@inquirer/number@1.0.2': - resolution: {integrity: sha512-GcoK+Phxcln0Qw9e73S5a8B2Ejg3HgSTvNfDegIcS5/BKwUm8t5rejja1l09WXjZM9vrVbRDf9RzWtSUiWVYRQ==} - engines: {node: '>=18'} - - '@inquirer/password@2.1.14': - resolution: {integrity: sha512-sPzOkXLhWJQ96K6nPZFnF8XB8tsDrcCRobd1d3EDz81F+4hp8BbdmsnsQcqZ7oYDIOVM/mWJyIUtJ35TrssJxQ==} - engines: {node: '>=18'} - - '@inquirer/prompts@5.1.2': - resolution: {integrity: sha512-E+ndnfwtVQtcmPt888Hc/HAxJUHSaA6OIvyvLAQ5BLQv+t20GbYdFSjXeLgb47OpMU+aRsKA/ys+Zoylw3kTVg==} - engines: {node: '>=18'} - - '@inquirer/rawlist@2.1.14': - resolution: {integrity: sha512-pLpEzhKNQ/ugFAFfgCNaXljB+dcCwmXwR1jOxAbVeFIdB3l02E5gjI+h1rb136tq0T8JO6P5KFR1oTeld/wdrA==} - engines: {node: '>=18'} - - '@inquirer/select@2.3.10': - resolution: {integrity: sha512-rr7iR0Zj1YFfgM8IUGimPD9Yukd+n/U63CnYT9kdum6DbRXtMxR45rrreP+EA9ixCnShr+W4xj7suRxC1+8t9g==} - engines: {node: '>=18'} - - '@inquirer/type@1.4.0': - resolution: {integrity: sha512-AjOqykVyjdJQvtfkNDGUyMYGF8xN50VUxftCQWsOyIo4DFRLr6VQhW0VItGI1JIyQGCGgIpKa7hMMwNhZb4OIw==} - engines: {node: '>=18'} - - '@mapbox/node-pre-gyp@1.0.11': - resolution: {integrity: sha512-Yhlar6v9WQgUp/He7BdgzOz8lqMQ8sU+jkCq7Wx8Myc5YFJLbEe7lgui/V7G1qB1DJykHSGwreceSaD60Y0PUQ==} - hasBin: true - - '@napi-rs/cli@3.0.0-alpha.62': - resolution: {integrity: sha512-IDUwHAEJZ9ad/s5oyhznrz5ZDcU+SJ6GdP5nb++Wx5MkS4FD9MeS3HfNZdsxkf10pOUPnmvCVFuG4xnLBQYmjw==} - engines: {node: '>= 16'} - hasBin: true - peerDependencies: - '@emnapi/runtime': ^1.1.0 - emnapi: ^1.1.0 - peerDependenciesMeta: - '@emnapi/runtime': - optional: true - emnapi: - optional: true - - '@napi-rs/cross-toolchain@0.0.16': - resolution: {integrity: sha512-jwdjHT5L0m9MH0CmzDwPp0ckn/UO7afHCsPeo7NugHUvYgvlgS7SWhdMVgIgJW2HHqhcW/2nhaLLGpAU1c7QRQ==} - peerDependencies: - '@napi-rs/cross-toolchain-arm64-target-aarch64': ^0.0.16 - '@napi-rs/cross-toolchain-arm64-target-armv7': ^0.0.16 - '@napi-rs/cross-toolchain-arm64-target-x86_64': ^0.0.16 - '@napi-rs/cross-toolchain-x64-target-aarch64': ^0.0.16 - '@napi-rs/cross-toolchain-x64-target-armv7': ^0.0.16 - '@napi-rs/cross-toolchain-x64-target-x86_64': ^0.0.16 - peerDependenciesMeta: - '@napi-rs/cross-toolchain-arm64-target-aarch64': - optional: true - '@napi-rs/cross-toolchain-arm64-target-armv7': - optional: true - '@napi-rs/cross-toolchain-arm64-target-x86_64': - optional: true - '@napi-rs/cross-toolchain-x64-target-aarch64': - optional: true - '@napi-rs/cross-toolchain-x64-target-armv7': - optional: true - '@napi-rs/cross-toolchain-x64-target-x86_64': - optional: true - - '@napi-rs/lzma-android-arm-eabi@1.3.1': - resolution: {integrity: sha512-mtGOg8jXlc+pTBI86cqohfndS9UmOAkk9d5CChKMb8btVks70yhUN1e7YYS3QFbmoxbPs2Ee+wmuH1Khdc7B2w==} - engines: {node: '>= 10'} - cpu: [arm] - os: [android] - - '@napi-rs/lzma-android-arm64@1.3.1': - resolution: {integrity: sha512-4uGkQgAv9Tnc/i0k2eIgbhZgyzs94+iECWxz4MFZNcZ1fNGvGbRL2j+SITE4OmwrUn3TuFK/uYWfgzooq8E1Qg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [android] - - '@napi-rs/lzma-darwin-arm64@1.3.1': - resolution: {integrity: sha512-MZBg4iwHTS8icjTiCMdzh8kYrMmKBCEglFPa+vjI91R2XDwuuwSzqmpATRpmMH8cWUUWtGPF4fnxKzjgkzhd4Q==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [darwin] - - '@napi-rs/lzma-darwin-x64@1.3.1': - resolution: {integrity: sha512-7vte+1lYV7xgZERKH/pjAeh4T16aQASKOzu4op70pK6VP/64Plr5rrvqxQqQmlAIe4pwyo/RkFl1n4LXDod3xg==} - engines: {node: '>= 10'} - cpu: [x64] - os: [darwin] - - '@napi-rs/lzma-freebsd-x64@1.3.1': - resolution: {integrity: sha512-uBS74fynTqLUC3catIxyezCafn8UDlr2yxVV47vz1T6Vop2PGDz/cMQdV6rnLSjPE08Rv66ihM36mgf/MmOkOg==} - engines: {node: '>= 10'} - cpu: [x64] - os: [freebsd] - - '@napi-rs/lzma-linux-arm-gnueabihf@1.3.1': - resolution: {integrity: sha512-rrVLyqBJeN29gPJCNkPbZ7dAzaseEcERKyhjwM+DfbFrDUvtkEcrYPvo+iwE/NmF+OkZQkzcanrVMGnq/mcJYQ==} - engines: {node: '>= 10'} - cpu: [arm] - os: [linux] - - '@napi-rs/lzma-linux-arm64-gnu@1.3.1': - resolution: {integrity: sha512-vDmVsthRbX2opkgRirJJGKQxUP/spvyVM2Y5CyCWZ7sadSID3hA97r38gf9ISn/sJ8/r93IPWLq+iycudNKi+Q==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/lzma-linux-arm64-musl@1.3.1': - resolution: {integrity: sha512-x4m/J3hRdFd3IoqKc+4aBcSUkcuDEP7hH6vdss8bKNLjPfXmnG/lcHJEQX3hNnNOULPP8xVRxgiY8jeL62cnsw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/lzma-linux-x64-gnu@1.3.1': - resolution: {integrity: sha512-riB+Xg72NfH8Kcpq07omshVu0QsLW0v2bhywBNYxvA+t2dGGWSIEN1U/zazUXys+IEA6pBQKqLVseurWE6Cl8g==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/lzma-linux-x64-musl@1.3.1': - resolution: {integrity: sha512-JXLgJFwoeysxdSg7rdVYP8wrliCQVJlU5JcLYjRVSCL4P0mQTjnYi7R7VdaOkDACw/Fvlji7oIJXt0KiaDTcOw==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/lzma-wasm32-wasi@1.3.1': - resolution: {integrity: sha512-XTA9XTUtj0KPKuzNS2oi3bWN6tJodk00wwMd/TiKoEqx9Fe/zu+OfDGuXAn+xs+P7S3YCDHqjYinuTQMZ0ucJw==} - engines: {node: '>=14.0.0'} - cpu: [wasm32] - - '@napi-rs/lzma-win32-arm64-msvc@1.3.1': - resolution: {integrity: sha512-qLDfs9UEtLPPTN/FdSz3gSdlx86VwFQBuLBrQtaiYQtUTKZCOYV1Z1fXqFt5Zqa1HKV2oyXnwGcTI7RpcyXxtg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [win32] - - '@napi-rs/lzma-win32-ia32-msvc@1.3.1': - resolution: {integrity: sha512-rWNlxLFMIfvxzfdQCfeQ3D/HEnQG3vfladFYrXUx6ePXO6r+BLCGn6/LWSSuKlw4vKkb1iHEWsAVaRLIcJEMIA==} - engines: {node: '>= 10'} - cpu: [ia32] - os: [win32] - - '@napi-rs/lzma-win32-x64-msvc@1.3.1': - resolution: {integrity: sha512-SNfHNqEjabXfTL1+KRi0qiAhwIlZHhQystvfSYX6p1g+2trSC/3WUpUQ4fbbR7KyE31g2AAnwjXivnlQ0af/pg==} - engines: {node: '>= 10'} - cpu: [x64] - os: [win32] - - '@napi-rs/lzma@1.3.1': - resolution: {integrity: sha512-XyZoBlYNMvCulK/RmVK/0nB3j7IdH7HpqcrMMg0U+HqQqKRLOQBwvnKNBocPC1bZQ7iZuKWYTLn1ayZwTyek8w==} - engines: {node: '>= 10'} - - '@napi-rs/tar-android-arm-eabi@0.1.1': - resolution: {integrity: sha512-Ufa0ahZvE5KGrC2WBux5svCe/jvC+e8IgtleiicwqnfgTfbDknYyq/QuqkP1AnMp/IvTmx2iutCZt6OFIG0zAg==} - engines: {node: '>= 10'} - cpu: [arm] - os: [android] - - '@napi-rs/tar-android-arm64@0.1.1': - resolution: {integrity: sha512-KUu5fHIiIObSuZ/crHxUrQ243+LiCRKPwdCVLHwjtftqFjzls+R2Mp6GrpM41XxexDMN00SUta3kazi93Xr19A==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [android] - - '@napi-rs/tar-darwin-arm64@0.1.1': - resolution: {integrity: sha512-jaqgdX20iIga+2gzotQ78eF00Cm8vECocUYeMY62WqyzJNv/jx1dlOfELWEccOjpmawFT9tjWebsS9F1QMvSUg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [darwin] - - '@napi-rs/tar-darwin-x64@0.1.1': - resolution: {integrity: sha512-80sa32IxfRso9x9sGTFpfLSx3BnruyJODpSkUzalOCz9i14n5gOKA8KR/JrnSWwDz0p5l5P9kfQD3pu8Voj7WA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [darwin] - - '@napi-rs/tar-freebsd-x64@0.1.1': - resolution: {integrity: sha512-P7V1zBjjC1dCrTwtUzuzYM4AeZduigeCtd8qQw2IUZowM5AsmhMd77oYuXjdU29cEpKUpyYjJRxjPCzFy+WbAQ==} - engines: {node: '>= 10'} - cpu: [x64] - os: [freebsd] - - '@napi-rs/tar-linux-arm-gnueabihf@0.1.1': - resolution: {integrity: sha512-qpC71ILPkWKt8k1iJCYt5gjwcOkd2VFSQIelTRr12t5CVNKV04rE/TMdwFoCP7kxbtb9Fl2cZzCRISw2BhMCmQ==} - engines: {node: '>= 10'} - cpu: [arm] - os: [linux] - - '@napi-rs/tar-linux-arm64-gnu@0.1.1': - resolution: {integrity: sha512-71QgxcFJCog6O4Tauoge8D0ILkDGJTRk3ru7zG8PUFG1QXJ1kkiRikdT77YmoVxtomc9FUOt+bdEdU5Yn+3QUQ==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/tar-linux-arm64-musl@0.1.1': - resolution: {integrity: sha512-R2e7YEILPKc447N1hUt1zQuyy0st83HX6nhmtFywS1aOj76/3hzxLVrebGiiS6kifyCrO82o66CNTYe7DixMZw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/tar-linux-x64-gnu@0.1.1': - resolution: {integrity: sha512-tmy9q2LXUB2GQ+IgUzJn3+us52leplMu96ORyFq1iHQEelGSqXt4xi5DzU07JhX3obJPqVqkybtcRS4enBfmBA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/tar-linux-x64-musl@0.1.1': - resolution: {integrity: sha512-j5ePbe6vihApl0cGPPDUVTWZbf2mF4NhxngAoG2jp7AeX3cWP2O4pjsvaOraW6QfvWEMFPeER7S0b6eBS7duvA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/tar-wasm32-wasi@0.1.1': - resolution: {integrity: sha512-se0+DlOiIRt7mcz7BeOJDoZtCrROpKLwiAOGmNgrjQ/SZS7TnOPuwm3wy9XN9WLoepttEjCEem6UP8yD5GJuQg==} - engines: {node: '>=14.0.0'} - cpu: [wasm32] - - '@napi-rs/tar-win32-arm64-msvc@0.1.1': - resolution: {integrity: sha512-FDZPi2wC7RwzvodogigLh/pJvhqCTVTUqOYuHlLkPSUbSAGiEkI55wk9RqH3y3EdJQaDuzyqC0QKz5ket2U+GA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [win32] - - '@napi-rs/tar-win32-ia32-msvc@0.1.1': - resolution: {integrity: sha512-OPR9Tou5z5M912G7Kc7gkf1ltinbOQx5dS/OeDIWHvPGOfdFDIxt0YVKhzSLRJi43+zIDp8/+cbeMD/cKXfX8w==} - engines: {node: '>= 10'} - cpu: [ia32] - os: [win32] - - '@napi-rs/tar-win32-x64-msvc@0.1.1': - resolution: {integrity: sha512-hiv5KfhrMSg8tTRC2oQXVckVg1h6ZVjwbd5aF9Esl0V3p2TaNFwwbqgnAN4Gm/PmSnHWNL/IRTHkk3cOzDWihQ==} - engines: {node: '>= 10'} - cpu: [x64] - os: [win32] - - '@napi-rs/tar@0.1.1': - resolution: {integrity: sha512-FOMhwwlvoYjHaDBxP26K3D92ltw1Y/CC4CIjgC6qXdzW4MYNwTlEyI58smCM3k+nCVJH3kpOYyH3sgbK4WZA4A==} - engines: {node: '>= 10'} - - '@napi-rs/wasm-runtime@0.2.4': - resolution: {integrity: sha512-9zESzOO5aDByvhIAsOy9TbpZ0Ur2AJbUI7UT73kcUTS2mxAMHOBaa1st/jAymNoCtvrit99kkzT1FZuXVcgfIQ==} - - '@napi-rs/wasm-tools-android-arm-eabi@0.0.2': - resolution: {integrity: sha512-/b+UU3suXjW4P0DzHRNdrnebQtFKcQf/YMeZJH+xUlKgvwli5kbmWjx8Wqqz0VETVkUTuPqJMBDIVLyc+14FGw==} - engines: {node: '>= 10'} - cpu: [arm] - os: [android] - - '@napi-rs/wasm-tools-android-arm64@0.0.2': - resolution: {integrity: sha512-j57GbDflwJdZtT8pZj5fOV4JAP+LdKN+wzsUYs+QRUoBqpWbbUANudolqfw63bkS9sD4z7fbCuz8iwtJqzxTVA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [android] - - '@napi-rs/wasm-tools-darwin-arm64@0.0.2': - resolution: {integrity: sha512-P2ChgWgVuv9GwmbxN89R84KzIImoTqXINteEixUvmkdnhyFiR+I8deNs89Yed+5w8QLC6MEfrtRqLP9YI+NoQA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [darwin] - - '@napi-rs/wasm-tools-darwin-x64@0.0.2': - resolution: {integrity: sha512-T/kQQ0gt8+wau1Z821PKVAD76QhmwVoLs2CT7Z9tTBs2pJvwSCP0C/kQiQAHcJIMi7A2E9Ab/Mez0BERy50EFA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [darwin] - - '@napi-rs/wasm-tools-freebsd-x64@0.0.2': - resolution: {integrity: sha512-GnnHu+r5sfzuxC/1J5UMF/h3BOZnHb3NQZ5hmbCfZYCKzpzRxrAJhzRunlbRN+v0x8M/49dztVTYR3s7K4ooAw==} - engines: {node: '>= 10'} - cpu: [x64] - os: [freebsd] - - '@napi-rs/wasm-tools-linux-arm64-gnu@0.0.2': - resolution: {integrity: sha512-KnZdLT0OnKb1CG2kdt3/WvM43vr9i+FEwXCvSOVC/6Tsifz7ynhMg7LAVESILd03HubzQJfg9nbRsk0bQ+IOwg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/wasm-tools-linux-arm64-musl@0.0.2': - resolution: {integrity: sha512-HkpZOID2U8P6pWqK3mqZ8bxU5xcuT3iA2fO+jrxn78h006iYgfNmdc5JaVhHnHazMmk32xKhSV4iV0VUh8UWDg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/wasm-tools-linux-x64-gnu@0.0.2': - resolution: {integrity: sha512-YksJWBCyOalB9ogtP9+/dZKP+vR6+h7BmzMXaXMT71WW/GvIsifMVgv+DY/FRSNJQupp5Y+ugjqVAOUOc/G65g==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/wasm-tools-linux-x64-musl@0.0.2': - resolution: {integrity: sha512-sPtRxPMdw05KdTcxgSPMmSXG2+PiK3vJ/l2+g9hvjnnKtvslJN2Hr7j8zgzuoKRAUFPaJVe6+D2xVh5cpdqhww==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/wasm-tools-wasm32-wasi@0.0.2': - resolution: {integrity: sha512-muRvZK7AIuo88G2AxYx3gA59rHMQgoN004saQkBvXnz3K/DVHKfTZ6TtUebss8zI3dURU6xExL8drxFWYxjEbQ==} - engines: {node: '>=14.0.0'} - cpu: [wasm32] - - '@napi-rs/wasm-tools-win32-arm64-msvc@0.0.2': - resolution: {integrity: sha512-Cn13WQ+tpFqdVwx0DIWKbsI9auFyzVZV4F5UNOUeDt6GgOL+NndgJul0Pc9bSU6fi03AylMPfF/nTCaDWO2Wgw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [win32] - - '@napi-rs/wasm-tools-win32-ia32-msvc@0.0.2': - resolution: {integrity: sha512-xsg5DkIQi82a8rcx6246Y3XC8TIqHamY+/C6sIlPLaZEuHctDkMECAw0AANwRf5vN//D2oo2oljOuoYtB1GOKw==} - engines: {node: '>= 10'} - cpu: [ia32] - os: [win32] - - '@napi-rs/wasm-tools-win32-x64-msvc@0.0.2': - resolution: {integrity: sha512-yHigltEt33eq8bappvKsIliz4MxfMPn1M+NWbIFRWN+IS1Z57mhmc1osuk+IRXrSlq0Tom0R6MYN1jpkZKz81Q==} - engines: {node: '>= 10'} - cpu: [x64] - os: [win32] - - '@napi-rs/wasm-tools@0.0.2': - resolution: {integrity: sha512-kBvDQCP5BLw2TxTENXLp3Of7vVEx0uyIye824JHE4dduzzOHVgSoOFVhVqAT3Fx/hLV445RVWfEqQbXMg4w/Mw==} - engines: {node: '>= 10'} - - '@nodelib/fs.scandir@2.1.5': - resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} - engines: {node: '>= 8'} - - '@nodelib/fs.stat@2.0.5': - resolution: {integrity: sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==} - engines: {node: '>= 8'} - - '@nodelib/fs.walk@1.2.8': - resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} - engines: {node: '>= 8'} - - '@octokit/auth-token@5.1.1': - resolution: {integrity: sha512-rh3G3wDO8J9wSjfI436JUKzHIxq8NaiL0tVeB2aXmG6p/9859aUOAjA9pmSPNGGZxfwmaJ9ozOJImuNVJdpvbA==} - engines: {node: '>= 18'} - - '@octokit/core@6.1.2': - resolution: {integrity: sha512-hEb7Ma4cGJGEUNOAVmyfdB/3WirWMg5hDuNFVejGEDFqupeOysLc2sG6HJxY2etBp5YQu5Wtxwi020jS9xlUwg==} - engines: {node: '>= 18'} - - '@octokit/endpoint@10.1.1': - resolution: {integrity: sha512-JYjh5rMOwXMJyUpj028cu0Gbp7qe/ihxfJMLc8VZBMMqSwLgOxDI1911gV4Enl1QSavAQNJcwmwBF9M0VvLh6Q==} - engines: {node: '>= 18'} - - '@octokit/graphql@8.1.1': - resolution: {integrity: sha512-ukiRmuHTi6ebQx/HFRCXKbDlOh/7xEV6QUXaE7MJEKGNAncGI/STSbOkl12qVXZrfZdpXctx5O9X1AIaebiDBg==} - engines: {node: '>= 18'} - - '@octokit/openapi-types@22.2.0': - resolution: {integrity: sha512-QBhVjcUa9W7Wwhm6DBFu6ZZ+1/t/oYxqc2tp81Pi41YNuJinbFRx8B133qVOrAaBbF7D/m0Et6f9/pZt9Rc+tg==} - - '@octokit/plugin-paginate-rest@11.3.3': - resolution: {integrity: sha512-o4WRoOJZlKqEEgj+i9CpcmnByvtzoUYC6I8PD2SA95M+BJ2x8h7oLcVOg9qcowWXBOdcTRsMZiwvM3EyLm9AfA==} - engines: {node: '>= 18'} - peerDependencies: - '@octokit/core': '>=6' - - '@octokit/plugin-request-log@5.3.0': - resolution: {integrity: sha512-FiGcyjdtYPlr03ExBk/0ysIlEFIFGJQAVoPPMxL19B24bVSEiZQnVGBunNtaAF1YnvE/EFoDpXmITtRnyCiypQ==} - engines: {node: '>= 18'} - peerDependencies: - '@octokit/core': '>=6' - - '@octokit/plugin-rest-endpoint-methods@13.2.4': - resolution: {integrity: sha512-gusyAVgTrPiuXOdfqOySMDztQHv6928PQ3E4dqVGEtOvRXAKRbJR4b1zQyniIT9waqaWk/UDaoJ2dyPr7Bk7Iw==} - engines: {node: '>= 18'} - peerDependencies: - '@octokit/core': '>=6' - - '@octokit/request-error@6.1.2': - resolution: {integrity: sha512-sA0oF7aL5wXbNfl+7zgLYJiFZctei9GaIMJlTraJrlQyFaoIYr4MCqPSakzxxGCfm8fET4vn0cQdRFmD7avlDg==} - engines: {node: '>= 18'} - - '@octokit/request@9.1.1': - resolution: {integrity: sha512-pyAguc0p+f+GbQho0uNetNQMmLG1e80WjkIaqqgUkihqUp0boRU6nKItXO4VWnr+nbZiLGEyy4TeKRwqaLvYgw==} - engines: {node: '>= 18'} - - '@octokit/rest@21.0.0': - resolution: {integrity: sha512-XudXXOmiIjivdjNZ+fN71NLrnDM00sxSZlhqmPR3v0dVoJwyP628tSlc12xqn8nX3N0965583RBw5GPo6r8u4Q==} - engines: {node: '>= 18'} - - '@octokit/types@13.5.0': - resolution: {integrity: sha512-HdqWTf5Z3qwDVlzCrP8UJquMwunpDiMPt5er+QjGzL4hqr/vBVY/MauQgS1xWxCDT1oMx1EULyqxncdCY/NVSQ==} - - '@rollup/pluginutils@4.2.1': - resolution: {integrity: sha512-iKnFXr7NkdZAIHiIWE+BX5ULi/ucVFYWD6TbAV+rZctiRTY2PL6tsIKhoIOaoskiWAkgu+VsbXgUVDNLHf+InQ==} - engines: {node: '>= 8.0.0'} - - '@sindresorhus/merge-streams@2.3.0': - resolution: {integrity: sha512-LtoMMhxAlorcGhmFYI+LhPgbPZCkgP6ra1YL604EeF6U98pLlQ3iWIGMdWSC+vWmPBWBNgmDBAhnAobLROJmwg==} - engines: {node: '>=18'} - - '@tybys/wasm-util@0.9.0': - resolution: {integrity: sha512-6+7nlbMVX/PVDCwaIQ8nTOPveOcFLSt8GcXdx8hD0bt39uWxYT88uXzqTd4fTvqta7oeUJqudepapKNt2DYJFw==} - - '@types/mute-stream@0.0.4': - resolution: {integrity: sha512-CPM9nzrCPPJHQNA9keH9CVkVI+WR5kMa+7XEs5jcGQ0VoAGnLv242w8lIVgwAEfmE4oufJRaTc9PNLQl0ioAow==} - - '@types/node@20.16.5': - resolution: {integrity: sha512-VwYCweNo3ERajwy0IUlqqcyZ8/A7Zwa9ZP3MnENWcB11AejO+tLy3pu850goUW2FC/IJMdZUfKpX/yxL1gymCA==} - - '@types/node@22.5.4': - resolution: {integrity: sha512-FDuKUJQm/ju9fT/SeX/6+gBzoPzlVCzfzmGkwKvRHQVxi4BntVbyIwf6a4Xn62mrvndLiml6z/UBXIdEVjQLXg==} - - '@types/stylis@4.2.6': - resolution: {integrity: sha512-4nebF2ZJGzQk0ka0O6+FZUWceyFv4vWq/0dXBMmrSeAwzOuOd/GxE5Pa64d/ndeNLG73dXoBsRzvtsVsYUv6Uw==} - - '@types/wrap-ansi@3.0.0': - resolution: {integrity: sha512-ltIpx+kM7g/MLRZfkbL7EsCEjfzCcScLpkg37eXEtx5kmrAKBkTJwd1GIAjDSL8wTpM6Hzn5YO4pSb91BEwu1g==} - - '@vercel/nft@0.26.5': - resolution: {integrity: sha512-NHxohEqad6Ra/r4lGknO52uc/GrWILXAMs1BB4401GTqww0fw1bAqzpG1XHuDO+dprg4GvsD9ZLLSsdo78p9hQ==} - engines: {node: '>=16'} - hasBin: true - - abbrev@1.1.1: - resolution: {integrity: sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==} - - acorn-import-attributes@1.9.5: - resolution: {integrity: sha512-n02Vykv5uA3eHGM/Z2dQrcD56kL8TyDb2p1+0P83PClMnC/nc+anbQRhIOWnSq4Ke/KvDPrY3C9hDtC/A3eHnQ==} - peerDependencies: - acorn: ^8 - - acorn-walk@8.3.3: - resolution: {integrity: sha512-MxXdReSRhGO7VlFe1bRG/oI7/mdLV9B9JJT0N8vZOhF7gFRR5l3M8W9G8JxmKV+JC5mGqJ0QvqfSOLsCPa4nUw==} - engines: {node: '>=0.4.0'} - - acorn@8.12.1: - resolution: {integrity: sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg==} - engines: {node: '>=0.4.0'} - hasBin: true - - agent-base@6.0.2: - resolution: {integrity: sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==} - engines: {node: '>= 6.0.0'} - - ansi-escapes@4.3.2: - resolution: {integrity: sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==} - engines: {node: '>=8'} - - ansi-regex@5.0.1: - resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} - engines: {node: '>=8'} - - ansi-regex@6.0.1: - resolution: {integrity: sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==} - engines: {node: '>=12'} - - ansi-styles@4.3.0: - resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} - engines: {node: '>=8'} - - ansi-styles@6.2.1: - resolution: {integrity: sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==} - engines: {node: '>=12'} - - aproba@2.0.0: - resolution: {integrity: sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==} - - are-we-there-yet@2.0.0: - resolution: {integrity: sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw==} - engines: {node: '>=10'} - deprecated: This package is no longer supported. - - argparse@1.0.10: - resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==} - - argparse@2.0.1: - resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} - - array-find-index@1.0.2: - resolution: {integrity: sha512-M1HQyIXcBGtVywBt8WVdim+lrNaK7VHp99Qt5pSNziXznKHViIBbXWtfRTpEFpF/c4FdfxNAsCCwPp5phBYJtw==} - engines: {node: '>=0.10.0'} - - arrgv@1.0.2: - resolution: {integrity: sha512-a4eg4yhp7mmruZDQFqVMlxNRFGi/i1r87pt8SDHy0/I8PqSXoUTlWZRdAZo0VXgvEARcujbtTk8kiZRi1uDGRw==} - engines: {node: '>=8.0.0'} - - arrify@3.0.0: - resolution: {integrity: sha512-tLkvA81vQG/XqE2mjDkGQHoOINtMHtysSnemrmoGe6PydDPMRbVugqyk4A6V/WDWEfm3l+0d8anA9r8cv/5Jaw==} - engines: {node: '>=12'} - - async-sema@3.1.1: - resolution: {integrity: sha512-tLRNUXati5MFePdAk8dw7Qt7DpxPB60ofAgn8WRhW6a2rcimZnYBP9oxHiv0OHy+Wz7kPMG+t4LGdt31+4EmGg==} - - asynckit@0.4.0: - resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} - - ava@6.1.3: - resolution: {integrity: sha512-tkKbpF1pIiC+q09wNU9OfyTDYZa8yuWvU2up3+lFJ3lr1RmnYh2GBpPwzYUEB0wvTPIUysGjcZLNZr7STDviRA==} - engines: {node: ^18.18 || ^20.8 || ^21 || ^22} - hasBin: true - peerDependencies: - '@ava/typescript': '*' - peerDependenciesMeta: - '@ava/typescript': - optional: true - - axios@1.6.2: - resolution: {integrity: sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A==} - - balanced-match@1.0.2: - resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} - - before-after-hook@3.0.2: - resolution: {integrity: sha512-Nik3Sc0ncrMK4UUdXQmAnRtzmNQTAAXmXIopizwZ1W1t8QmfJj+zL4OA2I7XPTPW5z5TDqv4hRo/JzouDJnX3A==} - - bindings@1.5.0: - resolution: {integrity: sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==} - - blueimp-md5@2.19.0: - resolution: {integrity: sha512-DRQrD6gJyy8FbiE4s+bDoXS9hiW3Vbx5uCdwvcCf3zLHL+Iv7LtGHLpr+GZV8rHG8tK766FGYBwRbu8pELTt+w==} - - brace-expansion@1.1.11: - resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} - - braces@3.0.3: - resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==} - engines: {node: '>=8'} - - callsites@4.2.0: - resolution: {integrity: sha512-kfzR4zzQtAE9PC7CzZsjl3aBNbXWuXiSeOCdLcPpBfGW8YuCqQHcRPFDbr/BPVmd3EEPVpuFzLyuT/cUhPr4OQ==} - engines: {node: '>=12.20'} - - camelize@1.0.1: - resolution: {integrity: sha512-dU+Tx2fsypxTgtLoE36npi3UqcjSSMNYfkqgmoEhtZrraP5VWq0K7FkWVTYa8eMPtnU/G2txVsfdCJTn9uzpuQ==} - - cbor@9.0.2: - resolution: {integrity: sha512-JPypkxsB10s9QOWwa6zwPzqE1Md3vqpPc+cai4sAecuCsRyAtAl/pMyhPlMbT/xtPnm2dznJZYRLui57qiRhaQ==} - engines: {node: '>=16'} - - chalk@5.3.0: - resolution: {integrity: sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==} - engines: {node: ^12.17.0 || ^14.13 || >=16.0.0} - - chardet@0.7.0: - resolution: {integrity: sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==} - - chownr@2.0.0: - resolution: {integrity: sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==} - engines: {node: '>=10'} - - chunkd@2.0.1: - resolution: {integrity: sha512-7d58XsFmOq0j6el67Ug9mHf9ELUXsQXYJBkyxhH/k+6Ke0qXRnv0kbemx+Twc6fRJ07C49lcbdgm9FL1Ei/6SQ==} - - ci-info@4.0.0: - resolution: {integrity: sha512-TdHqgGf9odd8SXNuxtUBVx8Nv+qZOejE6qyqiy5NtbYYQOeFa6zmHkxlPzmaLxWWHsU6nJmB7AETdVPi+2NBUg==} - engines: {node: '>=8'} - - ci-parallel-vars@1.0.1: - resolution: {integrity: sha512-uvzpYrpmidaoxvIQHM+rKSrigjOe9feHYbw4uOI2gdfe1C3xIlxO+kVXq83WQWNniTf8bAxVpy+cQeFQsMERKg==} - - cli-spinners@2.9.2: - resolution: {integrity: sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==} - engines: {node: '>=6'} - - cli-truncate@4.0.0: - resolution: {integrity: sha512-nPdaFdQ0h/GEigbPClz11D0v/ZJEwxmeVZGeMo3Z5StPtUTkA9o1lD6QwoirYiSDzbcwn2XcjwmCp68W1IS4TA==} - engines: {node: '>=18'} - - cli-width@4.1.0: - resolution: {integrity: sha512-ouuZd4/dm2Sw5Gmqy6bGyNNNe1qt9RpmxveLSO7KcgsTnU7RXfsw+/bukWGo1abgBiMAic068rclZsO4IWmmxQ==} - engines: {node: '>= 12'} - - clipanion@3.2.1: - resolution: {integrity: sha512-dYFdjLb7y1ajfxQopN05mylEpK9ZX0sO1/RfMXdfmwjlIsPkbh4p7A682x++zFPLDCo1x3p82dtljHf5cW2LKA==} - peerDependencies: - typanion: '*' - - cliui@8.0.1: - resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==} - engines: {node: '>=12'} - - code-excerpt@4.0.0: - resolution: {integrity: sha512-xxodCmBen3iy2i0WtAK8FlFNrRzjUqjRsMfho58xT/wvZU1YTM3fCnRjcy1gJPMepaRlgm/0e6w8SpWHpn3/cA==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - color-convert@2.0.1: - resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} - engines: {node: '>=7.0.0'} - - color-name@1.1.4: - resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} - - color-support@1.1.3: - resolution: {integrity: sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==} - hasBin: true - - colorette@2.0.20: - resolution: {integrity: sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==} - - combined-stream@1.0.8: - resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} - engines: {node: '>= 0.8'} - - common-path-prefix@3.0.0: - resolution: {integrity: sha512-QE33hToZseCH3jS0qN96O/bSh3kaw/h+Tq7ngyY9eWDUnTlTNUyqfqvCXioLe5Na5jFsL78ra/wuBU4iuEgd4w==} - - concat-map@0.0.1: - resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} - - concordance@5.0.4: - resolution: {integrity: sha512-OAcsnTEYu1ARJqWVGwf4zh4JDfHZEaSNlNccFmt8YjB2l/n19/PF2viLINHc57vO4FKIAFl2FWASIGZZWZ2Kxw==} - engines: {node: '>=10.18.0 <11 || >=12.14.0 <13 || >=14'} - - console-control-strings@1.1.0: - resolution: {integrity: sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==} - - convert-to-spaces@2.0.1: - resolution: {integrity: sha512-rcQ1bsQO9799wq24uE5AM2tAILy4gXGIK/njFWcVQkGNZ96edlpY+A7bjwvzjYvLDyzmG1MmMLZhpcsb+klNMQ==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - css-color-keywords@1.0.0: - resolution: {integrity: sha512-FyyrDHZKEjXDpNJYvVsV960FiqQyXc/LlYmsxl2BcdMb2WPx0OGRVgTg55rPSyLSNMqP52R9r8geSp7apN3Ofg==} - engines: {node: '>=4'} - - css-to-react-native@3.2.0: - resolution: {integrity: sha512-e8RKaLXMOFii+02mOlqwjbD00KSEKqblnpO9e++1aXS1fPQOpS1YoqdVHBqPjHNoxeF2mimzVqawm2KCbEdtHQ==} - - csstype@3.1.3: - resolution: {integrity: sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==} - - currently-unhandled@0.4.1: - resolution: {integrity: sha512-/fITjgjGU50vjQ4FH6eUoYu+iUoUKIXws2hL15JJpIR+BbTxaXQsMuuyjtNh2WqsSBS5nsaZHFsFecyw5CCAng==} - engines: {node: '>=0.10.0'} - - date-time@3.1.0: - resolution: {integrity: sha512-uqCUKXE5q1PNBXjPqvwhwJf9SwMoAHBgWJ6DcrnS5o+W2JOiIILl0JEdVD8SGujrNS02GGxgwAg2PN2zONgtjg==} - engines: {node: '>=6'} - - debug@4.3.5: - resolution: {integrity: sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg==} - engines: {node: '>=6.0'} - peerDependencies: - supports-color: '*' - peerDependenciesMeta: - supports-color: - optional: true - - delayed-stream@1.0.0: - resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} - engines: {node: '>=0.4.0'} - - delegates@1.0.0: - resolution: {integrity: sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==} - - detect-libc@2.0.3: - resolution: {integrity: sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw==} - engines: {node: '>=8'} - - emittery@1.0.3: - resolution: {integrity: sha512-tJdCJitoy2lrC2ldJcqN4vkqJ00lT+tOWNT1hBJjO/3FDMJa5TTIiYGCKGkn/WfCyOzUMObeohbVTj00fhiLiA==} - engines: {node: '>=14.16'} - - emnapi@1.2.0: - resolution: {integrity: sha512-rcq+dJCcfr08I0XM/57LPRqaUokGfni/+SvhO7NaJthTTjRdohhIy0FQwyC5rR1enAsjkldQg83th8J5hURv0Q==} - peerDependencies: - node-addon-api: '>= 6.1.0' - peerDependenciesMeta: - node-addon-api: - optional: true - - emoji-regex@10.3.0: - resolution: {integrity: sha512-QpLs9D9v9kArv4lfDEgg1X/gN5XLnf/A6l9cs8SPZLRZR3ZkY9+kwIQTxm+fsSej5UMYGE8fdoaZVIBlqG0XTw==} - - emoji-regex@8.0.0: - resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} - - escalade@3.1.2: - resolution: {integrity: sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==} - engines: {node: '>=6'} - - escape-string-regexp@2.0.0: - resolution: {integrity: sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==} - engines: {node: '>=8'} - - escape-string-regexp@5.0.0: - resolution: {integrity: sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==} - engines: {node: '>=12'} - - esprima@4.0.1: - resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==} - engines: {node: '>=4'} - hasBin: true - - estree-walker@2.0.2: - resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==} - - esutils@2.0.3: - resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} - engines: {node: '>=0.10.0'} - - external-editor@3.1.0: - resolution: {integrity: sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==} - engines: {node: '>=4'} - - fast-diff@1.3.0: - resolution: {integrity: sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==} - - fast-glob@3.3.2: - resolution: {integrity: sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==} - engines: {node: '>=8.6.0'} - - fastq@1.17.1: - resolution: {integrity: sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==} - - figures@6.1.0: - resolution: {integrity: sha512-d+l3qxjSesT4V7v2fh+QnmFnUWv9lSpjarhShNTgBOfA0ttejbQUAlHLitbjkoRiDulW0OPoQPYIGhIC8ohejg==} - engines: {node: '>=18'} - - file-uri-to-path@1.0.0: - resolution: {integrity: sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==} - - fill-range@7.1.1: - resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==} - engines: {node: '>=8'} - - find-up-simple@1.0.0: - resolution: {integrity: sha512-q7Us7kcjj2VMePAa02hDAF6d+MzsdsAWEwYyOpwUtlerRBkOEPBCRZrAV4XfcSN8fHAgaD0hP7miwoay6DCprw==} - engines: {node: '>=18'} - - follow-redirects@1.15.6: - resolution: {integrity: sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==} - engines: {node: '>=4.0'} - peerDependencies: - debug: '*' - peerDependenciesMeta: - debug: - optional: true - - form-data@4.0.0: - resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==} - engines: {node: '>= 6'} - - fs-minipass@2.1.0: - resolution: {integrity: sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==} - engines: {node: '>= 8'} - - fs.realpath@1.0.0: - resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} - - gauge@3.0.2: - resolution: {integrity: sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q==} - engines: {node: '>=10'} - deprecated: This package is no longer supported. - - get-caller-file@2.0.5: - resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} - engines: {node: 6.* || 8.* || >= 10.*} - - get-east-asian-width@1.2.0: - resolution: {integrity: sha512-2nk+7SIVb14QrgXFHcm84tD4bKQz0RxPuMT8Ag5KPOq7J5fEmAg0UbXdTOSHqNuHSU28k55qnceesxXRZGzKWA==} - engines: {node: '>=18'} - - glob-parent@5.1.2: - resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} - engines: {node: '>= 6'} - - glob@7.2.3: - resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} - deprecated: Glob versions prior to v9 are no longer supported - - globby@14.0.2: - resolution: {integrity: sha512-s3Fq41ZVh7vbbe2PN3nrW7yC7U7MFVc5c98/iTl9c2GawNMKx/J648KQRW6WKkuU8GIbbh2IXfIRQjOZnXcTnw==} - engines: {node: '>=18'} - - graceful-fs@4.2.11: - resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} - - has-unicode@2.0.1: - resolution: {integrity: sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==} - - https-proxy-agent@5.0.1: - resolution: {integrity: sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==} - engines: {node: '>= 6'} - - iconv-lite@0.4.24: - resolution: {integrity: sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==} - engines: {node: '>=0.10.0'} - - ignore-by-default@2.1.0: - resolution: {integrity: sha512-yiWd4GVmJp0Q6ghmM2B/V3oZGRmjrKLXvHR3TE1nfoXsmoggllfZUQe74EN0fJdPFZu2NIvNdrMMLm3OsV7Ohw==} - engines: {node: '>=10 <11 || >=12 <13 || >=14'} - - ignore@5.3.1: - resolution: {integrity: sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==} - engines: {node: '>= 4'} - - imurmurhash@0.1.4: - resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} - engines: {node: '>=0.8.19'} - - indent-string@5.0.0: - resolution: {integrity: sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==} - engines: {node: '>=12'} - - inflight@1.0.6: - resolution: {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. - - inherits@2.0.4: - resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} - - inquirer@10.0.1: - resolution: {integrity: sha512-XgthhRIn0Ci9JdGJpUo2EtpPfaczbooZbGTN+FTzSCyUb7YHJcPPnuSXfeG5903bJMy3OyEoVTQMnvO4Ly5tFg==} - engines: {node: '>=18'} - - ipaddr.js@2.2.0: - resolution: {integrity: sha512-Ag3wB2o37wslZS19hZqorUnrnzSkpOVy+IiiDEiTqNubEYpYuHWIf6K4psgN2ZWKExS4xhVCrRVfb/wfW8fWJA==} - engines: {node: '>= 10'} - - irregular-plurals@3.5.0: - resolution: {integrity: sha512-1ANGLZ+Nkv1ptFb2pa8oG8Lem4krflKuX/gINiHJHjJUKaJHk/SXk5x6K3J+39/p0h1RQ2saROclJJ+QLvETCQ==} - engines: {node: '>=8'} - - is-extglob@2.1.1: - resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} - engines: {node: '>=0.10.0'} - - is-fullwidth-code-point@3.0.0: - resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} - engines: {node: '>=8'} - - is-fullwidth-code-point@4.0.0: - resolution: {integrity: sha512-O4L094N2/dZ7xqVdrXhh9r1KODPJpFms8B5sGdJLPy664AgvXsreZUyCQQNItZRDlYug4xStLjNp/sz3HvBowQ==} - engines: {node: '>=12'} - - is-glob@4.0.3: - resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} - engines: {node: '>=0.10.0'} - - is-number@7.0.0: - resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} - engines: {node: '>=0.12.0'} - - is-plain-object@5.0.0: - resolution: {integrity: sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==} - engines: {node: '>=0.10.0'} - - is-promise@4.0.0: - resolution: {integrity: sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==} - - is-unicode-supported@2.0.0: - resolution: {integrity: sha512-FRdAyx5lusK1iHG0TWpVtk9+1i+GjrzRffhDg4ovQ7mcidMQ6mj+MhKPmvh7Xwyv5gIS06ns49CA7Sqg7lC22Q==} - engines: {node: '>=18'} - - js-string-escape@1.0.1: - resolution: {integrity: sha512-Smw4xcfIQ5LVjAOuJCvN/zIodzA/BBSsluuoSykP+lUvScIi4U6RJLfwHet5cxFnCswUjISV8oAXaqaJDY3chg==} - engines: {node: '>= 0.8'} - - js-tokens@4.0.0: - resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} - - js-yaml@3.14.1: - resolution: {integrity: sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==} - hasBin: true - - js-yaml@4.1.0: - resolution: {integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==} - hasBin: true - - load-json-file@7.0.1: - resolution: {integrity: sha512-Gnxj3ev3mB5TkVBGad0JM6dmLiQL+o0t23JPBZ9sd+yvSLk05mFoqKBw5N8gbbkU4TNXyqCgIrl/VM17OgUIgQ==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - lodash-es@4.17.21: - resolution: {integrity: sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==} - - lodash@4.17.21: - resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} - - loose-envify@1.4.0: - resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==} - hasBin: true - - make-dir@3.1.0: - resolution: {integrity: sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==} - engines: {node: '>=8'} - - matcher@5.0.0: - resolution: {integrity: sha512-s2EMBOWtXFc8dgqvoAzKJXxNHibcdJMV0gwqKUaw9E2JBJuGUK7DrNKrA6g/i+v72TT16+6sVm5mS3thaMLQUw==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - md5-hex@3.0.1: - resolution: {integrity: sha512-BUiRtTtV39LIJwinWBjqVsU9xhdnz7/i889V859IBFpuqGAj6LuOvHv5XLbgZ2R7ptJoJaEcxkv88/h25T7Ciw==} - engines: {node: '>=8'} - - memoize@10.0.0: - resolution: {integrity: sha512-H6cBLgsi6vMWOcCpvVCdFFnl3kerEXbrYh9q+lY6VXvQSmM6CkmV08VOwT+WE2tzIEqRPFfAq3fm4v/UIW6mSA==} - engines: {node: '>=18'} - - merge2@1.4.1: - resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} - engines: {node: '>= 8'} - - micromatch@4.0.7: - resolution: {integrity: sha512-LPP/3KorzCwBxfeUuZmaR6bG2kdeHSbe0P2tY3FLRU4vYrjYz5hI4QZwV0njUx3jeuKe67YukQ1LSPZBKDqO/Q==} - engines: {node: '>=8.6'} - - mime-db@1.52.0: - resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} - engines: {node: '>= 0.6'} - - mime-types@2.1.35: - resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} - engines: {node: '>= 0.6'} - - mimic-function@5.0.1: - resolution: {integrity: sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==} - engines: {node: '>=18'} - - minimatch@3.1.2: - resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} - - minipass@3.3.6: - resolution: {integrity: sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==} - engines: {node: '>=8'} - - minipass@5.0.0: - resolution: {integrity: sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==} - engines: {node: '>=8'} - - minizlib@2.1.2: - resolution: {integrity: sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==} - engines: {node: '>= 8'} - - mkdirp@1.0.4: - resolution: {integrity: sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==} - engines: {node: '>=10'} - hasBin: true - - ms@2.1.2: - resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} - - ms@2.1.3: - resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} - - mute-stream@1.0.0: - resolution: {integrity: sha512-avsJQhyd+680gKXyG/sQc0nXaC6rBkPOfyHYcFb9+hdkqQkR9bdnkJ0AMZhke0oesPqIO+mFFJ+IdBc7mst4IA==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - - nanoid@3.3.7: - resolution: {integrity: sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==} - engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} - hasBin: true - - node-fetch@2.7.0: - resolution: {integrity: sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==} - engines: {node: 4.x || >=6.0.0} - peerDependencies: - encoding: ^0.1.0 - peerDependenciesMeta: - encoding: - optional: true - - node-gyp-build@4.8.1: - resolution: {integrity: sha512-OSs33Z9yWr148JZcbZd5WiAXhh/n9z8TxQcdMhIOlpN9AhWpLfvVFO73+m77bBABQMaY9XSvIa+qk0jlI7Gcaw==} - hasBin: true - - nofilter@3.1.0: - resolution: {integrity: sha512-l2NNj07e9afPnhAhvgVrCD/oy2Ai1yfLpuo3EpiO1jFTsB4sFz6oIfAfSZyQzVpkZQ9xS8ZS5g1jCBgq4Hwo0g==} - engines: {node: '>=12.19'} - - nopt@5.0.0: - resolution: {integrity: sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==} - engines: {node: '>=6'} - hasBin: true - - npmlog@5.0.1: - resolution: {integrity: sha512-AqZtDUWOMKs1G/8lwylVjrdYgqA4d9nu8hc+0gzRxlDb1I10+FHBGMXs6aiQHFdCUUlqH99MUMuLfzWDNDtfxw==} - deprecated: This package is no longer supported. - - object-assign@4.1.1: - resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} - engines: {node: '>=0.10.0'} - - once@1.4.0: - resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} - - os-tmpdir@1.0.2: - resolution: {integrity: sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==} - engines: {node: '>=0.10.0'} - - p-map@7.0.2: - resolution: {integrity: sha512-z4cYYMMdKHzw4O5UkWJImbZynVIo0lSGTXc7bzB1e/rrDqkgGUNysK/o4bTr+0+xKvvLoTyGqYC4Fgljy9qe1Q==} - engines: {node: '>=18'} - - package-config@5.0.0: - resolution: {integrity: sha512-GYTTew2slBcYdvRHqjhwaaydVMvn/qrGC323+nKclYioNSLTDUM/lGgtGTgyHVtYcozb+XkE8CNhwcraOmZ9Mg==} - engines: {node: '>=18'} - - parse-ms@4.0.0: - resolution: {integrity: sha512-TXfryirbmq34y8QBwgqCVLi+8oA3oWx2eAnSn62ITyEhEYaWRlVZ2DvMM9eZbMs/RfxPu/PK/aBLyGj4IrqMHw==} - engines: {node: '>=18'} - - path-is-absolute@1.0.1: - resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==} - engines: {node: '>=0.10.0'} - - path-type@5.0.0: - resolution: {integrity: sha512-5HviZNaZcfqP95rwpv+1HDgUamezbqdSYTyzjTvwtJSnIH+3vnbmWsItli8OFEndS984VT55M3jduxZbX351gg==} - engines: {node: '>=12'} - - picocolors@1.0.1: - resolution: {integrity: sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==} - - picomatch@2.3.1: - resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} - engines: {node: '>=8.6'} - - picomatch@3.0.1: - resolution: {integrity: sha512-I3EurrIQMlRc9IaAZnqRR044Phh2DXY+55o7uJ0V+hYZAcQYSuFWsc9q5PvyDHUSCe1Qxn/iBz+78s86zWnGag==} - engines: {node: '>=10'} - - plur@5.1.0: - resolution: {integrity: sha512-VP/72JeXqak2KiOzjgKtQen5y3IZHn+9GOuLDafPv0eXa47xq0At93XahYBs26MsifCQ4enGKwbjBTKgb9QJXg==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - postcss-value-parser@4.2.0: - resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==} - - postcss@8.4.33: - resolution: {integrity: sha512-Kkpbhhdjw2qQs2O2DGX+8m5OVqEcbB9HRBvuYM9pgrjEFUg30A9LmXNlTAUj4S9kgtGyrMbTzVjH7E+s5Re2yg==} - engines: {node: ^10 || ^12 || >=14} - - pretty-ms@9.0.0: - resolution: {integrity: sha512-E9e9HJ9R9NasGOgPaPE8VMeiPKAyWR5jcFpNnwIejslIhWqdqOrb2wShBsncMPUb+BcCd2OPYfh7p2W6oemTng==} - engines: {node: '>=18'} - - proxy-from-env@1.1.0: - resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==} - - queue-microtask@1.2.3: - resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} - - react-dom@18.3.1: - resolution: {integrity: sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==} - peerDependencies: - react: ^18.3.1 - - react@18.3.1: - resolution: {integrity: sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==} - engines: {node: '>=0.10.0'} - - readable-stream@3.6.2: - resolution: {integrity: sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==} - engines: {node: '>= 6'} - - require-directory@2.1.1: - resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} - engines: {node: '>=0.10.0'} - - resolve-cwd@3.0.0: - resolution: {integrity: sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==} - engines: {node: '>=8'} - - resolve-from@5.0.0: - resolution: {integrity: sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==} - engines: {node: '>=8'} - - reusify@1.0.4: - resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==} - engines: {iojs: '>=1.0.0', node: '>=0.10.0'} - - rimraf@3.0.2: - resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==} - deprecated: Rimraf versions prior to v4 are no longer supported - hasBin: true - - run-async@3.0.0: - resolution: {integrity: sha512-540WwVDOMxA6dN6We19EcT9sc3hkXPw5mzRNGM3FkdN/vtE9NFvj5lFAPNwUDmJjXidm3v7TC1cTE7t17Ulm1Q==} - engines: {node: '>=0.12.0'} - - run-parallel@1.2.0: - resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} - - rxjs@7.8.1: - resolution: {integrity: sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==} - - safe-buffer@5.2.1: - resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} - - safer-buffer@2.1.2: - resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} - - scheduler@0.23.2: - resolution: {integrity: sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ==} - - semver@6.3.1: - resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} - hasBin: true - - semver@7.6.2: - resolution: {integrity: sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==} - engines: {node: '>=10'} - hasBin: true - - serialize-error@7.0.1: - resolution: {integrity: sha512-8I8TjW5KMOKsZQTvoxjuSIa7foAwPWGOts+6o7sgjz41/qMD9VQHEDxi6PBvK2l0MXUmqZyNpUK+T2tQaaElvw==} - engines: {node: '>=10'} - - set-blocking@2.0.0: - resolution: {integrity: sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==} - - shallowequal@1.1.0: - resolution: {integrity: sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ==} - - signal-exit@3.0.7: - resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} - - signal-exit@4.1.0: - resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} - engines: {node: '>=14'} - - slash@5.1.0: - resolution: {integrity: sha512-ZA6oR3T/pEyuqwMgAKT0/hAv8oAXckzbkmR0UkUosQ+Mc4RxGoJkRmwHgHufaenlyAgE1Mxgpdcrf75y6XcnDg==} - engines: {node: '>=14.16'} - - slice-ansi@5.0.0: - resolution: {integrity: sha512-FC+lgizVPfie0kkhqUScwRu1O/lF6NOgJmlCgK+/LYxDCTk8sGelYaHDhFcDN+Sn3Cv+3VSa4Byeo+IMCzpMgQ==} - engines: {node: '>=12'} - - source-map-js@1.2.0: - resolution: {integrity: sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==} - engines: {node: '>=0.10.0'} - - sprintf-js@1.0.3: - resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==} - - stack-utils@2.0.6: - resolution: {integrity: sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==} - engines: {node: '>=10'} - - string-width@4.2.3: - resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} - engines: {node: '>=8'} - - string-width@7.2.0: - resolution: {integrity: sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==} - engines: {node: '>=18'} - - string_decoder@1.3.0: - resolution: {integrity: sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==} - - strip-ansi@6.0.1: - resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} - engines: {node: '>=8'} - - strip-ansi@7.1.0: - resolution: {integrity: sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==} - engines: {node: '>=12'} - - styled-components@6.1.1: - resolution: {integrity: sha512-cpZZP5RrKRIClBW5Eby4JM1wElLVP4NQrJbJ0h10TidTyJf4SIIwa3zLXOoPb4gJi8MsJ8mjq5mu2IrEhZIAcQ==} - engines: {node: '>= 16'} - peerDependencies: - react: '>= 16.8.0' - react-dom: '>= 16.8.0' - - stylis@4.3.2: - resolution: {integrity: sha512-bhtUjWd/z6ltJiQwg0dUfxEJ+W+jdqQd8TbWLWyeIJHlnsqmGLRFFd8e5mA0AZi/zx90smXRlN66YMTcaSFifg==} - - supertap@3.0.1: - resolution: {integrity: sha512-u1ZpIBCawJnO+0QePsEiOknOfCRq0yERxiAchT0i4li0WHNUJbf0evXXSXOcCAR4M8iMDoajXYmstm/qO81Isw==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - tar@6.2.1: - resolution: {integrity: sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==} - engines: {node: '>=10'} - - temp-dir@3.0.0: - resolution: {integrity: sha512-nHc6S/bwIilKHNRgK/3jlhDoIHcp45YgyiwcAk46Tr0LfEqGBVpmiAyuiuxeVE44m3mXnEeVhaipLOEWmH+Njw==} - engines: {node: '>=14.16'} - - time-zone@1.0.0: - resolution: {integrity: sha512-TIsDdtKo6+XrPtiTm1ssmMngN1sAhyKnTO2kunQWqNPWIVvCm15Wmw4SWInwTVgJ5u/Tr04+8Ei9TNcw4x4ONA==} - engines: {node: '>=4'} - - tmp@0.0.33: - resolution: {integrity: sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==} - engines: {node: '>=0.6.0'} - - to-regex-range@5.0.1: - resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} - engines: {node: '>=8.0'} - - toml@3.0.0: - resolution: {integrity: sha512-y/mWCZinnvxjTKYhJ+pYxwD0mRLVvOtdS2Awbgxln6iEnt4rk0yBxeSBHkGJcPucRiG0e55mwWp+g/05rsrd6w==} - - tr46@0.0.3: - resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==} - - tslib@2.6.3: - resolution: {integrity: sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ==} - - typanion@3.14.0: - resolution: {integrity: sha512-ZW/lVMRabETuYCd9O9ZvMhAh8GslSqaUjxmK/JLPCh6l73CvLBiuXswj/+7LdnWOgYsQ130FqLzFz5aGT4I3Ug==} - - type-fest@0.13.1: - resolution: {integrity: sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==} - engines: {node: '>=10'} - - type-fest@0.21.3: - resolution: {integrity: sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==} - engines: {node: '>=10'} - - typescript@5.5.4: - resolution: {integrity: sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q==} - engines: {node: '>=14.17'} - hasBin: true - - undici-types@6.19.8: - resolution: {integrity: sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==} - - unicorn-magic@0.1.0: - resolution: {integrity: sha512-lRfVq8fE8gz6QMBuDM6a+LO3IAzTi05H6gCVaUpir2E1Rwpo4ZUog45KpNXKC/Mn3Yb9UDuHumeFTo9iV/D9FQ==} - engines: {node: '>=18'} - - universal-user-agent@7.0.2: - resolution: {integrity: sha512-0JCqzSKnStlRRQfCdowvqy3cy0Dvtlb8xecj/H8JFZuCze4rwjPZQOgvFvn0Ws/usCHQFGpyr+pB9adaGwXn4Q==} - - util-deprecate@1.0.2: - resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} - - wasm-sjlj@1.0.5: - resolution: {integrity: sha512-Z/MHJeOkAvJJVWnGX3/YZGYldGaawZbYHX4ldYG9kLhcdB8H31F5x66M7Zc4BP/7pg0aLsusQj1629m2B3Rilg==} - - webidl-conversions@3.0.1: - resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==} - - well-known-symbols@2.0.0: - resolution: {integrity: sha512-ZMjC3ho+KXo0BfJb7JgtQ5IBuvnShdlACNkKkdsqBmYw3bPAaJfPeYUo6tLUaT5tG/Gkh7xkpBhKRQ9e7pyg9Q==} - engines: {node: '>=6'} - - whatwg-url@5.0.0: - resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==} - - wide-align@1.1.5: - resolution: {integrity: sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==} - - wrap-ansi@6.2.0: - resolution: {integrity: sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==} - engines: {node: '>=8'} - - wrap-ansi@7.0.0: - resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==} - engines: {node: '>=10'} - - wrappy@1.0.2: - resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} - - write-file-atomic@5.0.1: - resolution: {integrity: sha512-+QU2zd6OTD8XWIJCbffaiQeH9U73qIqafo1x6V1snCWYGJf6cVE0cDR4D8xRzcEnfI21IFrUPzPGtcPf8AC+Rw==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - - y18n@5.0.8: - resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==} - engines: {node: '>=10'} - - yallist@4.0.0: - resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==} - - yargs-parser@21.1.1: - resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} - engines: {node: '>=12'} - - yargs@17.7.2: - resolution: {integrity: sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==} - engines: {node: '>=12'} - - yoctocolors-cjs@2.1.2: - resolution: {integrity: sha512-cYVsTjKl8b+FrnidjibDWskAv7UKOfcwaVZdp/it9n1s9fU3IkgDbhdIRKCW4JDsAlECJY0ytoVPT3sK6kideA==} - engines: {node: '>=18'} - -snapshots: - - '@emnapi/core@1.2.0': - dependencies: - '@emnapi/wasi-threads': 1.0.1 - tslib: 2.6.3 - - '@emnapi/runtime@1.2.0': - dependencies: - tslib: 2.6.3 - - '@emnapi/wasi-threads@1.0.1': - dependencies: - tslib: 2.6.3 - - '@emotion/is-prop-valid@1.2.2': - dependencies: - '@emotion/memoize': 0.8.1 - - '@emotion/memoize@0.8.1': {} - - '@emotion/unitless@0.8.1': {} - - '@inquirer/checkbox@2.3.10': - dependencies: - '@inquirer/core': 9.0.2 - '@inquirer/figures': 1.0.3 - '@inquirer/type': 1.4.0 - ansi-escapes: 4.3.2 - yoctocolors-cjs: 2.1.2 - - '@inquirer/confirm@3.1.14': - dependencies: - '@inquirer/core': 9.0.2 - '@inquirer/type': 1.4.0 - - '@inquirer/core@9.0.2': - dependencies: - '@inquirer/figures': 1.0.3 - '@inquirer/type': 1.4.0 - '@types/mute-stream': 0.0.4 - '@types/node': 20.16.5 - '@types/wrap-ansi': 3.0.0 - ansi-escapes: 4.3.2 - cli-spinners: 2.9.2 - cli-width: 4.1.0 - mute-stream: 1.0.0 - signal-exit: 4.1.0 - strip-ansi: 6.0.1 - wrap-ansi: 6.2.0 - yoctocolors-cjs: 2.1.2 - - '@inquirer/editor@2.1.14': - dependencies: - '@inquirer/core': 9.0.2 - '@inquirer/type': 1.4.0 - external-editor: 3.1.0 - - '@inquirer/expand@2.1.14': - dependencies: - '@inquirer/core': 9.0.2 - '@inquirer/type': 1.4.0 - yoctocolors-cjs: 2.1.2 - - '@inquirer/figures@1.0.3': {} - - '@inquirer/input@2.2.1': - dependencies: - '@inquirer/core': 9.0.2 - '@inquirer/type': 1.4.0 - - '@inquirer/number@1.0.2': - dependencies: - '@inquirer/core': 9.0.2 - '@inquirer/type': 1.4.0 - - '@inquirer/password@2.1.14': - dependencies: - '@inquirer/core': 9.0.2 - '@inquirer/type': 1.4.0 - ansi-escapes: 4.3.2 - - '@inquirer/prompts@5.1.2': - dependencies: - '@inquirer/checkbox': 2.3.10 - '@inquirer/confirm': 3.1.14 - '@inquirer/editor': 2.1.14 - '@inquirer/expand': 2.1.14 - '@inquirer/input': 2.2.1 - '@inquirer/number': 1.0.2 - '@inquirer/password': 2.1.14 - '@inquirer/rawlist': 2.1.14 - '@inquirer/select': 2.3.10 - - '@inquirer/rawlist@2.1.14': - dependencies: - '@inquirer/core': 9.0.2 - '@inquirer/type': 1.4.0 - yoctocolors-cjs: 2.1.2 - - '@inquirer/select@2.3.10': - dependencies: - '@inquirer/core': 9.0.2 - '@inquirer/figures': 1.0.3 - '@inquirer/type': 1.4.0 - ansi-escapes: 4.3.2 - yoctocolors-cjs: 2.1.2 - - '@inquirer/type@1.4.0': - dependencies: - mute-stream: 1.0.0 - - '@mapbox/node-pre-gyp@1.0.11': - dependencies: - detect-libc: 2.0.3 - https-proxy-agent: 5.0.1 - make-dir: 3.1.0 - node-fetch: 2.7.0 - nopt: 5.0.0 - npmlog: 5.0.1 - rimraf: 3.0.2 - semver: 7.6.2 - tar: 6.2.1 - transitivePeerDependencies: - - encoding - - supports-color - - '@napi-rs/cli@3.0.0-alpha.62(@emnapi/runtime@1.2.0)(emnapi@1.2.0)': - dependencies: - '@napi-rs/cross-toolchain': 0.0.16 - '@napi-rs/wasm-tools': 0.0.2 - '@octokit/rest': 21.0.0 - clipanion: 3.2.1(typanion@3.14.0) - colorette: 2.0.20 - debug: 4.3.5 - inquirer: 10.0.1 - js-yaml: 4.1.0 - lodash-es: 4.17.21 - semver: 7.6.2 - toml: 3.0.0 - typanion: 3.14.0 - wasm-sjlj: 1.0.5 - optionalDependencies: - '@emnapi/runtime': 1.2.0 - emnapi: 1.2.0 - transitivePeerDependencies: - - '@napi-rs/cross-toolchain-arm64-target-aarch64' - - '@napi-rs/cross-toolchain-arm64-target-armv7' - - '@napi-rs/cross-toolchain-arm64-target-x86_64' - - '@napi-rs/cross-toolchain-x64-target-aarch64' - - '@napi-rs/cross-toolchain-x64-target-armv7' - - '@napi-rs/cross-toolchain-x64-target-x86_64' - - supports-color - - '@napi-rs/cross-toolchain@0.0.16': - dependencies: - '@napi-rs/lzma': 1.3.1 - '@napi-rs/tar': 0.1.1 - debug: 4.3.5 - transitivePeerDependencies: - - supports-color - - '@napi-rs/lzma-android-arm-eabi@1.3.1': - optional: true - - '@napi-rs/lzma-android-arm64@1.3.1': - optional: true - - '@napi-rs/lzma-darwin-arm64@1.3.1': - optional: true - - '@napi-rs/lzma-darwin-x64@1.3.1': - optional: true - - '@napi-rs/lzma-freebsd-x64@1.3.1': - optional: true - - '@napi-rs/lzma-linux-arm-gnueabihf@1.3.1': - optional: true - - '@napi-rs/lzma-linux-arm64-gnu@1.3.1': - optional: true - - '@napi-rs/lzma-linux-arm64-musl@1.3.1': - optional: true - - '@napi-rs/lzma-linux-x64-gnu@1.3.1': - optional: true - - '@napi-rs/lzma-linux-x64-musl@1.3.1': - optional: true - - '@napi-rs/lzma-wasm32-wasi@1.3.1': - dependencies: - '@napi-rs/wasm-runtime': 0.2.4 - optional: true - - '@napi-rs/lzma-win32-arm64-msvc@1.3.1': - optional: true - - '@napi-rs/lzma-win32-ia32-msvc@1.3.1': - optional: true - - '@napi-rs/lzma-win32-x64-msvc@1.3.1': - optional: true - - '@napi-rs/lzma@1.3.1': - optionalDependencies: - '@napi-rs/lzma-android-arm-eabi': 1.3.1 - '@napi-rs/lzma-android-arm64': 1.3.1 - '@napi-rs/lzma-darwin-arm64': 1.3.1 - '@napi-rs/lzma-darwin-x64': 1.3.1 - '@napi-rs/lzma-freebsd-x64': 1.3.1 - '@napi-rs/lzma-linux-arm-gnueabihf': 1.3.1 - '@napi-rs/lzma-linux-arm64-gnu': 1.3.1 - '@napi-rs/lzma-linux-arm64-musl': 1.3.1 - '@napi-rs/lzma-linux-x64-gnu': 1.3.1 - '@napi-rs/lzma-linux-x64-musl': 1.3.1 - '@napi-rs/lzma-wasm32-wasi': 1.3.1 - '@napi-rs/lzma-win32-arm64-msvc': 1.3.1 - '@napi-rs/lzma-win32-ia32-msvc': 1.3.1 - '@napi-rs/lzma-win32-x64-msvc': 1.3.1 - - '@napi-rs/tar-android-arm-eabi@0.1.1': - optional: true - - '@napi-rs/tar-android-arm64@0.1.1': - optional: true - - '@napi-rs/tar-darwin-arm64@0.1.1': - optional: true - - '@napi-rs/tar-darwin-x64@0.1.1': - optional: true - - '@napi-rs/tar-freebsd-x64@0.1.1': - optional: true - - '@napi-rs/tar-linux-arm-gnueabihf@0.1.1': - optional: true - - '@napi-rs/tar-linux-arm64-gnu@0.1.1': - optional: true - - '@napi-rs/tar-linux-arm64-musl@0.1.1': - optional: true - - '@napi-rs/tar-linux-x64-gnu@0.1.1': - optional: true - - '@napi-rs/tar-linux-x64-musl@0.1.1': - optional: true - - '@napi-rs/tar-wasm32-wasi@0.1.1': - dependencies: - '@napi-rs/wasm-runtime': 0.2.4 - optional: true - - '@napi-rs/tar-win32-arm64-msvc@0.1.1': - optional: true - - '@napi-rs/tar-win32-ia32-msvc@0.1.1': - optional: true - - '@napi-rs/tar-win32-x64-msvc@0.1.1': - optional: true - - '@napi-rs/tar@0.1.1': - optionalDependencies: - '@napi-rs/tar-android-arm-eabi': 0.1.1 - '@napi-rs/tar-android-arm64': 0.1.1 - '@napi-rs/tar-darwin-arm64': 0.1.1 - '@napi-rs/tar-darwin-x64': 0.1.1 - '@napi-rs/tar-freebsd-x64': 0.1.1 - '@napi-rs/tar-linux-arm-gnueabihf': 0.1.1 - '@napi-rs/tar-linux-arm64-gnu': 0.1.1 - '@napi-rs/tar-linux-arm64-musl': 0.1.1 - '@napi-rs/tar-linux-x64-gnu': 0.1.1 - '@napi-rs/tar-linux-x64-musl': 0.1.1 - '@napi-rs/tar-wasm32-wasi': 0.1.1 - '@napi-rs/tar-win32-arm64-msvc': 0.1.1 - '@napi-rs/tar-win32-ia32-msvc': 0.1.1 - '@napi-rs/tar-win32-x64-msvc': 0.1.1 - - '@napi-rs/wasm-runtime@0.2.4': - dependencies: - '@emnapi/core': 1.2.0 - '@emnapi/runtime': 1.2.0 - '@tybys/wasm-util': 0.9.0 - - '@napi-rs/wasm-tools-android-arm-eabi@0.0.2': - optional: true - - '@napi-rs/wasm-tools-android-arm64@0.0.2': - optional: true - - '@napi-rs/wasm-tools-darwin-arm64@0.0.2': - optional: true - - '@napi-rs/wasm-tools-darwin-x64@0.0.2': - optional: true - - '@napi-rs/wasm-tools-freebsd-x64@0.0.2': - optional: true - - '@napi-rs/wasm-tools-linux-arm64-gnu@0.0.2': - optional: true - - '@napi-rs/wasm-tools-linux-arm64-musl@0.0.2': - optional: true - - '@napi-rs/wasm-tools-linux-x64-gnu@0.0.2': - optional: true - - '@napi-rs/wasm-tools-linux-x64-musl@0.0.2': - optional: true - - '@napi-rs/wasm-tools-wasm32-wasi@0.0.2': - dependencies: - '@napi-rs/wasm-runtime': 0.2.4 - optional: true - - '@napi-rs/wasm-tools-win32-arm64-msvc@0.0.2': - optional: true - - '@napi-rs/wasm-tools-win32-ia32-msvc@0.0.2': - optional: true - - '@napi-rs/wasm-tools-win32-x64-msvc@0.0.2': - optional: true - - '@napi-rs/wasm-tools@0.0.2': - optionalDependencies: - '@napi-rs/wasm-tools-android-arm-eabi': 0.0.2 - '@napi-rs/wasm-tools-android-arm64': 0.0.2 - '@napi-rs/wasm-tools-darwin-arm64': 0.0.2 - '@napi-rs/wasm-tools-darwin-x64': 0.0.2 - '@napi-rs/wasm-tools-freebsd-x64': 0.0.2 - '@napi-rs/wasm-tools-linux-arm64-gnu': 0.0.2 - '@napi-rs/wasm-tools-linux-arm64-musl': 0.0.2 - '@napi-rs/wasm-tools-linux-x64-gnu': 0.0.2 - '@napi-rs/wasm-tools-linux-x64-musl': 0.0.2 - '@napi-rs/wasm-tools-wasm32-wasi': 0.0.2 - '@napi-rs/wasm-tools-win32-arm64-msvc': 0.0.2 - '@napi-rs/wasm-tools-win32-ia32-msvc': 0.0.2 - '@napi-rs/wasm-tools-win32-x64-msvc': 0.0.2 - - '@nodelib/fs.scandir@2.1.5': - dependencies: - '@nodelib/fs.stat': 2.0.5 - run-parallel: 1.2.0 - - '@nodelib/fs.stat@2.0.5': {} - - '@nodelib/fs.walk@1.2.8': - dependencies: - '@nodelib/fs.scandir': 2.1.5 - fastq: 1.17.1 - - '@octokit/auth-token@5.1.1': {} - - '@octokit/core@6.1.2': - dependencies: - '@octokit/auth-token': 5.1.1 - '@octokit/graphql': 8.1.1 - '@octokit/request': 9.1.1 - '@octokit/request-error': 6.1.2 - '@octokit/types': 13.5.0 - before-after-hook: 3.0.2 - universal-user-agent: 7.0.2 - - '@octokit/endpoint@10.1.1': - dependencies: - '@octokit/types': 13.5.0 - universal-user-agent: 7.0.2 - - '@octokit/graphql@8.1.1': - dependencies: - '@octokit/request': 9.1.1 - '@octokit/types': 13.5.0 - universal-user-agent: 7.0.2 - - '@octokit/openapi-types@22.2.0': {} - - '@octokit/plugin-paginate-rest@11.3.3(@octokit/core@6.1.2)': - dependencies: - '@octokit/core': 6.1.2 - '@octokit/types': 13.5.0 - - '@octokit/plugin-request-log@5.3.0(@octokit/core@6.1.2)': - dependencies: - '@octokit/core': 6.1.2 - - '@octokit/plugin-rest-endpoint-methods@13.2.4(@octokit/core@6.1.2)': - dependencies: - '@octokit/core': 6.1.2 - '@octokit/types': 13.5.0 - - '@octokit/request-error@6.1.2': - dependencies: - '@octokit/types': 13.5.0 - - '@octokit/request@9.1.1': - dependencies: - '@octokit/endpoint': 10.1.1 - '@octokit/request-error': 6.1.2 - '@octokit/types': 13.5.0 - universal-user-agent: 7.0.2 - - '@octokit/rest@21.0.0': - dependencies: - '@octokit/core': 6.1.2 - '@octokit/plugin-paginate-rest': 11.3.3(@octokit/core@6.1.2) - '@octokit/plugin-request-log': 5.3.0(@octokit/core@6.1.2) - '@octokit/plugin-rest-endpoint-methods': 13.2.4(@octokit/core@6.1.2) - - '@octokit/types@13.5.0': - dependencies: - '@octokit/openapi-types': 22.2.0 - - '@rollup/pluginutils@4.2.1': - dependencies: - estree-walker: 2.0.2 - picomatch: 2.3.1 - - '@sindresorhus/merge-streams@2.3.0': {} - - '@tybys/wasm-util@0.9.0': - dependencies: - tslib: 2.6.3 - - '@types/mute-stream@0.0.4': - dependencies: - '@types/node': 22.5.4 - - '@types/node@20.16.5': - dependencies: - undici-types: 6.19.8 - - '@types/node@22.5.4': - dependencies: - undici-types: 6.19.8 - - '@types/stylis@4.2.6': {} - - '@types/wrap-ansi@3.0.0': {} - - '@vercel/nft@0.26.5': - dependencies: - '@mapbox/node-pre-gyp': 1.0.11 - '@rollup/pluginutils': 4.2.1 - acorn: 8.12.1 - acorn-import-attributes: 1.9.5(acorn@8.12.1) - async-sema: 3.1.1 - bindings: 1.5.0 - estree-walker: 2.0.2 - glob: 7.2.3 - graceful-fs: 4.2.11 - micromatch: 4.0.7 - node-gyp-build: 4.8.1 - resolve-from: 5.0.0 - transitivePeerDependencies: - - encoding - - supports-color - - abbrev@1.1.1: {} - - acorn-import-attributes@1.9.5(acorn@8.12.1): - dependencies: - acorn: 8.12.1 - - acorn-walk@8.3.3: - dependencies: - acorn: 8.12.1 - - acorn@8.12.1: {} - - agent-base@6.0.2: - dependencies: - debug: 4.3.5 - transitivePeerDependencies: - - supports-color - - ansi-escapes@4.3.2: - dependencies: - type-fest: 0.21.3 - - ansi-regex@5.0.1: {} - - ansi-regex@6.0.1: {} - - ansi-styles@4.3.0: - dependencies: - color-convert: 2.0.1 - - ansi-styles@6.2.1: {} - - aproba@2.0.0: {} - - are-we-there-yet@2.0.0: - dependencies: - delegates: 1.0.0 - readable-stream: 3.6.2 - - argparse@1.0.10: - dependencies: - sprintf-js: 1.0.3 - - argparse@2.0.1: {} - - array-find-index@1.0.2: {} - - arrgv@1.0.2: {} - - arrify@3.0.0: {} - - async-sema@3.1.1: {} - - asynckit@0.4.0: {} - - ava@6.1.3: - dependencies: - '@vercel/nft': 0.26.5 - acorn: 8.12.1 - acorn-walk: 8.3.3 - ansi-styles: 6.2.1 - arrgv: 1.0.2 - arrify: 3.0.0 - callsites: 4.2.0 - cbor: 9.0.2 - chalk: 5.3.0 - chunkd: 2.0.1 - ci-info: 4.0.0 - ci-parallel-vars: 1.0.1 - cli-truncate: 4.0.0 - code-excerpt: 4.0.0 - common-path-prefix: 3.0.0 - concordance: 5.0.4 - currently-unhandled: 0.4.1 - debug: 4.3.5 - emittery: 1.0.3 - figures: 6.1.0 - globby: 14.0.2 - ignore-by-default: 2.1.0 - indent-string: 5.0.0 - is-plain-object: 5.0.0 - is-promise: 4.0.0 - matcher: 5.0.0 - memoize: 10.0.0 - ms: 2.1.3 - p-map: 7.0.2 - package-config: 5.0.0 - picomatch: 3.0.1 - plur: 5.1.0 - pretty-ms: 9.0.0 - resolve-cwd: 3.0.0 - stack-utils: 2.0.6 - strip-ansi: 7.1.0 - supertap: 3.0.1 - temp-dir: 3.0.0 - write-file-atomic: 5.0.1 - yargs: 17.7.2 - transitivePeerDependencies: - - encoding - - supports-color - - axios@1.6.2: - dependencies: - follow-redirects: 1.15.6 - form-data: 4.0.0 - proxy-from-env: 1.1.0 - transitivePeerDependencies: - - debug - - balanced-match@1.0.2: {} - - before-after-hook@3.0.2: {} - - bindings@1.5.0: - dependencies: - file-uri-to-path: 1.0.0 - - blueimp-md5@2.19.0: {} - - brace-expansion@1.1.11: - dependencies: - balanced-match: 1.0.2 - concat-map: 0.0.1 - - braces@3.0.3: - dependencies: - fill-range: 7.1.1 - - callsites@4.2.0: {} - - camelize@1.0.1: {} - - cbor@9.0.2: - dependencies: - nofilter: 3.1.0 - - chalk@5.3.0: {} - - chardet@0.7.0: {} - - chownr@2.0.0: {} - - chunkd@2.0.1: {} - - ci-info@4.0.0: {} - - ci-parallel-vars@1.0.1: {} - - cli-spinners@2.9.2: {} - - cli-truncate@4.0.0: - dependencies: - slice-ansi: 5.0.0 - string-width: 7.2.0 - - cli-width@4.1.0: {} - - clipanion@3.2.1(typanion@3.14.0): - dependencies: - typanion: 3.14.0 - - cliui@8.0.1: - dependencies: - string-width: 4.2.3 - strip-ansi: 6.0.1 - wrap-ansi: 7.0.0 - - code-excerpt@4.0.0: - dependencies: - convert-to-spaces: 2.0.1 - - color-convert@2.0.1: - dependencies: - color-name: 1.1.4 - - color-name@1.1.4: {} - - color-support@1.1.3: {} - - colorette@2.0.20: {} - - combined-stream@1.0.8: - dependencies: - delayed-stream: 1.0.0 - - common-path-prefix@3.0.0: {} - - concat-map@0.0.1: {} - - concordance@5.0.4: - dependencies: - date-time: 3.1.0 - esutils: 2.0.3 - fast-diff: 1.3.0 - js-string-escape: 1.0.1 - lodash: 4.17.21 - md5-hex: 3.0.1 - semver: 7.6.2 - well-known-symbols: 2.0.0 - - console-control-strings@1.1.0: {} - - convert-to-spaces@2.0.1: {} - - css-color-keywords@1.0.0: {} - - css-to-react-native@3.2.0: - dependencies: - camelize: 1.0.1 - css-color-keywords: 1.0.0 - postcss-value-parser: 4.2.0 - - csstype@3.1.3: {} - - currently-unhandled@0.4.1: - dependencies: - array-find-index: 1.0.2 - - date-time@3.1.0: - dependencies: - time-zone: 1.0.0 - - debug@4.3.5: - dependencies: - ms: 2.1.2 - - delayed-stream@1.0.0: {} - - delegates@1.0.0: {} - - detect-libc@2.0.3: {} - - emittery@1.0.3: {} - - emnapi@1.2.0: {} - - emoji-regex@10.3.0: {} - - emoji-regex@8.0.0: {} - - escalade@3.1.2: {} - - escape-string-regexp@2.0.0: {} - - escape-string-regexp@5.0.0: {} - - esprima@4.0.1: {} - - estree-walker@2.0.2: {} - - esutils@2.0.3: {} - - external-editor@3.1.0: - dependencies: - chardet: 0.7.0 - iconv-lite: 0.4.24 - tmp: 0.0.33 - - fast-diff@1.3.0: {} - - fast-glob@3.3.2: - dependencies: - '@nodelib/fs.stat': 2.0.5 - '@nodelib/fs.walk': 1.2.8 - glob-parent: 5.1.2 - merge2: 1.4.1 - micromatch: 4.0.7 - - fastq@1.17.1: - dependencies: - reusify: 1.0.4 - - figures@6.1.0: - dependencies: - is-unicode-supported: 2.0.0 - - file-uri-to-path@1.0.0: {} - - fill-range@7.1.1: - dependencies: - to-regex-range: 5.0.1 - - find-up-simple@1.0.0: {} - - follow-redirects@1.15.6: {} - - form-data@4.0.0: - dependencies: - asynckit: 0.4.0 - combined-stream: 1.0.8 - mime-types: 2.1.35 - - fs-minipass@2.1.0: - dependencies: - minipass: 3.3.6 - - fs.realpath@1.0.0: {} - - gauge@3.0.2: - dependencies: - aproba: 2.0.0 - color-support: 1.1.3 - console-control-strings: 1.1.0 - has-unicode: 2.0.1 - object-assign: 4.1.1 - signal-exit: 3.0.7 - string-width: 4.2.3 - strip-ansi: 6.0.1 - wide-align: 1.1.5 - - get-caller-file@2.0.5: {} - - get-east-asian-width@1.2.0: {} - - glob-parent@5.1.2: - dependencies: - is-glob: 4.0.3 - - glob@7.2.3: - dependencies: - fs.realpath: 1.0.0 - inflight: 1.0.6 - inherits: 2.0.4 - minimatch: 3.1.2 - once: 1.4.0 - path-is-absolute: 1.0.1 - - globby@14.0.2: - dependencies: - '@sindresorhus/merge-streams': 2.3.0 - fast-glob: 3.3.2 - ignore: 5.3.1 - path-type: 5.0.0 - slash: 5.1.0 - unicorn-magic: 0.1.0 - - graceful-fs@4.2.11: {} - - has-unicode@2.0.1: {} - - https-proxy-agent@5.0.1: - dependencies: - agent-base: 6.0.2 - debug: 4.3.5 - transitivePeerDependencies: - - supports-color - - iconv-lite@0.4.24: - dependencies: - safer-buffer: 2.1.2 - - ignore-by-default@2.1.0: {} - - ignore@5.3.1: {} - - imurmurhash@0.1.4: {} - - indent-string@5.0.0: {} - - inflight@1.0.6: - dependencies: - once: 1.4.0 - wrappy: 1.0.2 - - inherits@2.0.4: {} - - inquirer@10.0.1: - dependencies: - '@inquirer/prompts': 5.1.2 - '@inquirer/type': 1.4.0 - '@types/mute-stream': 0.0.4 - ansi-escapes: 4.3.2 - mute-stream: 1.0.0 - run-async: 3.0.0 - rxjs: 7.8.1 - - ipaddr.js@2.2.0: {} - - irregular-plurals@3.5.0: {} - - is-extglob@2.1.1: {} - - is-fullwidth-code-point@3.0.0: {} - - is-fullwidth-code-point@4.0.0: {} - - is-glob@4.0.3: - dependencies: - is-extglob: 2.1.1 - - is-number@7.0.0: {} - - is-plain-object@5.0.0: {} - - is-promise@4.0.0: {} - - is-unicode-supported@2.0.0: {} - - js-string-escape@1.0.1: {} - - js-tokens@4.0.0: {} - - js-yaml@3.14.1: - dependencies: - argparse: 1.0.10 - esprima: 4.0.1 - - js-yaml@4.1.0: - dependencies: - argparse: 2.0.1 - - load-json-file@7.0.1: {} - - lodash-es@4.17.21: {} - - lodash@4.17.21: {} - - loose-envify@1.4.0: - dependencies: - js-tokens: 4.0.0 - - make-dir@3.1.0: - dependencies: - semver: 6.3.1 - - matcher@5.0.0: - dependencies: - escape-string-regexp: 5.0.0 - - md5-hex@3.0.1: - dependencies: - blueimp-md5: 2.19.0 - - memoize@10.0.0: - dependencies: - mimic-function: 5.0.1 - - merge2@1.4.1: {} - - micromatch@4.0.7: - dependencies: - braces: 3.0.3 - picomatch: 2.3.1 - - mime-db@1.52.0: {} - - mime-types@2.1.35: - dependencies: - mime-db: 1.52.0 - - mimic-function@5.0.1: {} - - minimatch@3.1.2: - dependencies: - brace-expansion: 1.1.11 - - minipass@3.3.6: - dependencies: - yallist: 4.0.0 - - minipass@5.0.0: {} - - minizlib@2.1.2: - dependencies: - minipass: 3.3.6 - yallist: 4.0.0 - - mkdirp@1.0.4: {} - - ms@2.1.2: {} - - ms@2.1.3: {} - - mute-stream@1.0.0: {} - - nanoid@3.3.7: {} - - node-fetch@2.7.0: - dependencies: - whatwg-url: 5.0.0 - - node-gyp-build@4.8.1: {} - - nofilter@3.1.0: {} - - nopt@5.0.0: - dependencies: - abbrev: 1.1.1 - - npmlog@5.0.1: - dependencies: - are-we-there-yet: 2.0.0 - console-control-strings: 1.1.0 - gauge: 3.0.2 - set-blocking: 2.0.0 - - object-assign@4.1.1: {} - - once@1.4.0: - dependencies: - wrappy: 1.0.2 - - os-tmpdir@1.0.2: {} - - p-map@7.0.2: {} - - package-config@5.0.0: - dependencies: - find-up-simple: 1.0.0 - load-json-file: 7.0.1 - - parse-ms@4.0.0: {} - - path-is-absolute@1.0.1: {} - - path-type@5.0.0: {} - - picocolors@1.0.1: {} - - picomatch@2.3.1: {} - - picomatch@3.0.1: {} - - plur@5.1.0: - dependencies: - irregular-plurals: 3.5.0 - - postcss-value-parser@4.2.0: {} - - postcss@8.4.33: - dependencies: - nanoid: 3.3.7 - picocolors: 1.0.1 - source-map-js: 1.2.0 - - pretty-ms@9.0.0: - dependencies: - parse-ms: 4.0.0 - - proxy-from-env@1.1.0: {} - - queue-microtask@1.2.3: {} - - react-dom@18.3.1(react@18.3.1): - dependencies: - loose-envify: 1.4.0 - react: 18.3.1 - scheduler: 0.23.2 - - react@18.3.1: - dependencies: - loose-envify: 1.4.0 - - readable-stream@3.6.2: - dependencies: - inherits: 2.0.4 - string_decoder: 1.3.0 - util-deprecate: 1.0.2 - - require-directory@2.1.1: {} - - resolve-cwd@3.0.0: - dependencies: - resolve-from: 5.0.0 - - resolve-from@5.0.0: {} - - reusify@1.0.4: {} - - rimraf@3.0.2: - dependencies: - glob: 7.2.3 - - run-async@3.0.0: {} - - run-parallel@1.2.0: - dependencies: - queue-microtask: 1.2.3 - - rxjs@7.8.1: - dependencies: - tslib: 2.6.3 - - safe-buffer@5.2.1: {} - - safer-buffer@2.1.2: {} - - scheduler@0.23.2: - dependencies: - loose-envify: 1.4.0 - - semver@6.3.1: {} - - semver@7.6.2: {} - - serialize-error@7.0.1: - dependencies: - type-fest: 0.13.1 - - set-blocking@2.0.0: {} - - shallowequal@1.1.0: {} - - signal-exit@3.0.7: {} - - signal-exit@4.1.0: {} - - slash@5.1.0: {} - - slice-ansi@5.0.0: - dependencies: - ansi-styles: 6.2.1 - is-fullwidth-code-point: 4.0.0 - - source-map-js@1.2.0: {} - - sprintf-js@1.0.3: {} - - stack-utils@2.0.6: - dependencies: - escape-string-regexp: 2.0.0 - - string-width@4.2.3: - dependencies: - emoji-regex: 8.0.0 - is-fullwidth-code-point: 3.0.0 - strip-ansi: 6.0.1 - - string-width@7.2.0: - dependencies: - emoji-regex: 10.3.0 - get-east-asian-width: 1.2.0 - strip-ansi: 7.1.0 - - string_decoder@1.3.0: - dependencies: - safe-buffer: 5.2.1 - - strip-ansi@6.0.1: - dependencies: - ansi-regex: 5.0.1 - - strip-ansi@7.1.0: - dependencies: - ansi-regex: 6.0.1 - - styled-components@6.1.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1): - dependencies: - '@emotion/is-prop-valid': 1.2.2 - '@emotion/unitless': 0.8.1 - '@types/stylis': 4.2.6 - css-to-react-native: 3.2.0 - csstype: 3.1.3 - postcss: 8.4.33 - react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) - shallowequal: 1.1.0 - stylis: 4.3.2 - tslib: 2.6.3 - - stylis@4.3.2: {} - - supertap@3.0.1: - dependencies: - indent-string: 5.0.0 - js-yaml: 3.14.1 - serialize-error: 7.0.1 - strip-ansi: 7.1.0 - - tar@6.2.1: - dependencies: - chownr: 2.0.0 - fs-minipass: 2.1.0 - minipass: 5.0.0 - minizlib: 2.1.2 - mkdirp: 1.0.4 - yallist: 4.0.0 - - temp-dir@3.0.0: {} - - time-zone@1.0.0: {} - - tmp@0.0.33: - dependencies: - os-tmpdir: 1.0.2 - - to-regex-range@5.0.1: - dependencies: - is-number: 7.0.0 - - toml@3.0.0: {} - - tr46@0.0.3: {} - - tslib@2.6.3: {} - - typanion@3.14.0: {} - - type-fest@0.13.1: {} - - type-fest@0.21.3: {} - - typescript@5.5.4: {} - - undici-types@6.19.8: {} - - unicorn-magic@0.1.0: {} - - universal-user-agent@7.0.2: {} - - util-deprecate@1.0.2: {} - - wasm-sjlj@1.0.5: {} - - webidl-conversions@3.0.1: {} - - well-known-symbols@2.0.0: {} - - whatwg-url@5.0.0: - dependencies: - tr46: 0.0.3 - webidl-conversions: 3.0.1 - - wide-align@1.1.5: - dependencies: - string-width: 4.2.3 - - wrap-ansi@6.2.0: - dependencies: - ansi-styles: 4.3.0 - string-width: 4.2.3 - strip-ansi: 6.0.1 - - wrap-ansi@7.0.0: - dependencies: - ansi-styles: 4.3.0 - string-width: 4.2.3 - strip-ansi: 6.0.1 - - wrappy@1.0.2: {} - - write-file-atomic@5.0.1: - dependencies: - imurmurhash: 0.1.4 - signal-exit: 4.1.0 - - y18n@5.0.8: {} - - yallist@4.0.0: {} - - yargs-parser@21.1.1: {} - - yargs@17.7.2: - dependencies: - cliui: 8.0.1 - escalade: 3.1.2 - get-caller-file: 2.0.5 - require-directory: 2.1.1 - string-width: 4.2.3 - y18n: 5.0.8 - yargs-parser: 21.1.1 - - yoctocolors-cjs@2.1.2: {} diff --git a/src/builtins.rs b/src/builtins.rs deleted file mode 100644 index 45a25117..00000000 --- a/src/builtins.rs +++ /dev/null @@ -1,71 +0,0 @@ -/// Node.js built-in modules -/// -/// `node -p "[...require('module').builtinModules].map(b => JSON.stringify(b)).join(',\n')"` -/// -pub const NODEJS_BUILTINS: &[&str] = &[ - "_http_agent", - "_http_client", - "_http_common", - "_http_incoming", - "_http_outgoing", - "_http_server", - "_stream_duplex", - "_stream_passthrough", - "_stream_readable", - "_stream_transform", - "_stream_wrap", - "_stream_writable", - "_tls_common", - "_tls_wrap", - "assert", - "assert/strict", - "async_hooks", - "buffer", - "child_process", - "cluster", - "console", - "constants", - "crypto", - "dgram", - "diagnostics_channel", - "dns", - "dns/promises", - "domain", - "events", - "fs", - "fs/promises", - "http", - "http2", - "https", - "inspector", - "module", - "net", - "os", - "path", - "path/posix", - "path/win32", - "perf_hooks", - "process", - "punycode", - "querystring", - "readline", - "repl", - "stream", - "stream/consumers", - "stream/promises", - "stream/web", - "string_decoder", - "sys", - "timers", - "timers/promises", - "tls", - "trace_events", - "tty", - "url", - "util", - "util/types", - "v8", - "vm", - "worker_threads", - "zlib", -]; diff --git a/src/cache.rs b/src/cache.rs deleted file mode 100644 index 6e600664..00000000 --- a/src/cache.rs +++ /dev/null @@ -1,354 +0,0 @@ -use once_cell::sync::OnceCell as OnceLock; -use std::{ - borrow::{Borrow, Cow}, - convert::AsRef, - hash::{BuildHasherDefault, Hash, Hasher}, - io, - ops::Deref, - path::{Path, PathBuf}, - sync::Arc, -}; - -use dashmap::{DashMap, DashSet}; -use rustc_hash::FxHasher; - -use crate::{ - context::ResolveContext as Ctx, package_json::PackageJson, path::PathUtil, FileMetadata, - FileSystem, ResolveError, ResolveOptions, TsConfig, -}; - -#[derive(Default)] -pub struct Cache { - pub(crate) fs: Fs, - paths: DashSet>, - tsconfigs: DashMap, BuildHasherDefault>, -} - -impl Cache { - pub fn new(fs: Fs) -> Self { - Self { fs, paths: DashSet::default(), tsconfigs: DashMap::default() } - } - - pub fn clear(&self) { - self.paths.clear(); - self.tsconfigs.clear(); - } - - pub fn value(&self, path: &Path) -> CachedPath { - let hash = { - let mut hasher = FxHasher::default(); - path.hash(&mut hasher); - hasher.finish() - }; - if let Some(cache_entry) = self.paths.get((hash, path).borrow() as &dyn CacheKey) { - return cache_entry.clone(); - } - let parent = path.parent().map(|p| self.value(p)); - let data = CachedPath(Arc::new(CachedPathImpl::new( - hash, - path.to_path_buf().into_boxed_path(), - parent, - ))); - self.paths.insert(data.clone()); - data - } - - pub fn tsconfig Result<(), ResolveError>>( - &self, - root: bool, - path: &Path, - callback: F, // callback for modifying tsconfig with `extends` - ) -> Result, ResolveError> { - if let Some(tsconfig_ref) = self.tsconfigs.get(path) { - return Ok(Arc::clone(tsconfig_ref.value())); - } - let meta = self.fs.metadata(path).ok(); - let tsconfig_path = if meta.is_some_and(|m| m.is_file) { - Cow::Borrowed(path) - } else if meta.is_some_and(|m| m.is_dir) { - Cow::Owned(path.join("tsconfig.json")) - } else { - let mut os_string = path.to_path_buf().into_os_string(); - os_string.push(".json"); - Cow::Owned(PathBuf::from(os_string)) - }; - let mut tsconfig_string = self - .fs - .read_to_string(&tsconfig_path) - .map_err(|_| ResolveError::TsconfigNotFound(path.to_path_buf()))?; - let mut tsconfig = - TsConfig::parse(root, &tsconfig_path, &mut tsconfig_string).map_err(|error| { - ResolveError::from_serde_json_error(tsconfig_path.to_path_buf(), &error) - })?; - callback(&mut tsconfig)?; - let tsconfig = Arc::new(tsconfig.build()); - self.tsconfigs.insert(path.to_path_buf(), Arc::clone(&tsconfig)); - Ok(tsconfig) - } -} - -#[derive(Clone)] -pub struct CachedPath(Arc); - -impl Hash for CachedPath { - fn hash(&self, state: &mut H) { - self.0.hash.hash(state); - } -} - -impl PartialEq for CachedPath { - fn eq(&self, other: &Self) -> bool { - self.0.path == other.0.path - } -} -impl Eq for CachedPath {} - -impl Deref for CachedPath { - type Target = CachedPathImpl; - - fn deref(&self) -> &Self::Target { - self.0.as_ref() - } -} - -impl<'a> Borrow for CachedPath { - fn borrow(&self) -> &(dyn CacheKey + 'a) { - self - } -} - -impl AsRef for CachedPath { - fn as_ref(&self) -> &CachedPathImpl { - self.0.as_ref() - } -} - -impl CacheKey for CachedPath { - fn tuple(&self) -> (u64, &Path) { - (self.hash, &self.path) - } -} - -pub struct CachedPathImpl { - hash: u64, - path: Box, - parent: Option, - meta: OnceLock>, - canonicalized: OnceLock>, - node_modules: OnceLock>, - package_json: OnceLock>>, -} - -impl CachedPathImpl { - fn new(hash: u64, path: Box, parent: Option) -> Self { - Self { - hash, - path, - parent, - meta: OnceLock::new(), - canonicalized: OnceLock::new(), - node_modules: OnceLock::new(), - package_json: OnceLock::new(), - } - } - - pub fn path(&self) -> &Path { - &self.path - } - - pub fn to_path_buf(&self) -> PathBuf { - self.path.to_path_buf() - } - - pub fn parent(&self) -> Option<&CachedPath> { - self.parent.as_ref() - } - - fn meta(&self, fs: &Fs) -> Option { - *self.meta.get_or_init(|| fs.metadata(&self.path).ok()) - } - - pub fn is_file(&self, fs: &Fs, ctx: &mut Ctx) -> bool { - if let Some(meta) = self.meta(fs) { - ctx.add_file_dependency(self.path()); - meta.is_file - } else { - ctx.add_missing_dependency(self.path()); - false - } - } - - pub fn is_dir(&self, fs: &Fs, ctx: &mut Ctx) -> bool { - self.meta(fs).map_or_else( - || { - ctx.add_missing_dependency(self.path()); - false - }, - |meta| meta.is_dir, - ) - } - - pub fn realpath(&self, fs: &Fs) -> io::Result { - self.canonicalized - .get_or_try_init(|| { - if fs.symlink_metadata(&self.path).is_ok_and(|m| m.is_symlink) { - return fs.canonicalize(&self.path).map(Some); - } - if let Some(parent) = self.parent() { - let parent_path = parent.realpath(fs)?; - return Ok(Some( - parent_path.normalize_with(self.path.strip_prefix(&parent.path).unwrap()), - )); - }; - Ok(None) - }) - .cloned() - .map(|r| r.unwrap_or_else(|| self.path.clone().to_path_buf())) - } - - pub fn module_directory( - &self, - module_name: &str, - cache: &Cache, - ctx: &mut Ctx, - ) -> Option { - let cached_path = cache.value(&self.path.join(module_name)); - cached_path.is_dir(&cache.fs, ctx).then_some(cached_path) - } - - pub fn cached_node_modules( - &self, - cache: &Cache, - ctx: &mut Ctx, - ) -> Option { - self.node_modules.get_or_init(|| self.module_directory("node_modules", cache, ctx)).clone() - } - - /// Find package.json of a path by traversing parent directories. - /// - /// # Errors - /// - /// * [ResolveError::JSON] - pub fn find_package_json( - &self, - fs: &Fs, - options: &ResolveOptions, - ctx: &mut Ctx, - ) -> Result>, ResolveError> { - let mut cache_value = self; - // Go up directories when the querying path is not a directory - while !cache_value.is_dir(fs, ctx) { - if let Some(cv) = &cache_value.parent { - cache_value = cv.as_ref(); - } else { - break; - } - } - let mut cache_value = Some(cache_value); - while let Some(cv) = cache_value { - if let Some(package_json) = cv.package_json(fs, options, ctx)? { - return Ok(Some(Arc::clone(&package_json))); - } - cache_value = cv.parent.as_deref(); - } - Ok(None) - } - - /// Get package.json of the given path. - /// - /// # Errors - /// - /// * [ResolveError::JSON] - pub fn package_json( - &self, - fs: &Fs, - options: &ResolveOptions, - ctx: &mut Ctx, - ) -> Result>, ResolveError> { - // Change to `std::sync::OnceLock::get_or_try_init` when it is stable. - let result = self - .package_json - .get_or_try_init(|| { - let package_json_path = self.path.join("package.json"); - let Ok(package_json_string) = fs.read_to_string(&package_json_path) else { - return Ok(None); - }; - let real_path = if options.symlinks { - self.realpath(fs)?.join("package.json") - } else { - package_json_path.clone() - }; - PackageJson::parse(package_json_path.clone(), real_path, &package_json_string) - .map(Arc::new) - .map(Some) - .map_err(|error| ResolveError::from_serde_json_error(package_json_path, &error)) - }) - .cloned(); - // https://github.com/webpack/enhanced-resolve/blob/58464fc7cb56673c9aa849e68e6300239601e615/lib/DescriptionFileUtils.js#L68-L82 - match &result { - Ok(Some(package_json)) => { - ctx.add_file_dependency(&package_json.path); - } - Ok(None) => { - // Avoid an allocation by making this lazy - if let Some(deps) = &mut ctx.missing_dependencies { - deps.push(self.path.join("package.json")); - } - } - Err(_) => { - if let Some(deps) = &mut ctx.file_dependencies { - deps.push(self.path.join("package.json")); - } - } - } - result - } -} - -/// Memoized cache key, code adapted from . -trait CacheKey { - fn tuple(&self) -> (u64, &Path); -} - -impl Hash for dyn CacheKey + '_ { - fn hash(&self, state: &mut H) { - self.tuple().0.hash(state); - } -} - -impl PartialEq for dyn CacheKey + '_ { - fn eq(&self, other: &Self) -> bool { - self.tuple().1 == other.tuple().1 - } -} - -impl Eq for dyn CacheKey + '_ {} - -impl<'a> CacheKey for (u64, &'a Path) { - fn tuple(&self) -> (u64, &Path) { - (self.0, self.1) - } -} - -impl<'a> Borrow for (u64, &'a Path) { - fn borrow(&self) -> &(dyn CacheKey + 'a) { - self - } -} - -/// Since the cache key is memoized, use an identity hasher -/// to avoid double cache. -#[derive(Default)] -struct IdentityHasher(u64); - -impl Hasher for IdentityHasher { - fn write(&mut self, _: &[u8]) { - unreachable!("Invalid use of IdentityHasher") - } - fn write_u64(&mut self, n: u64) { - self.0 = n; - } - fn finish(&self) -> u64 { - self.0 - } -} diff --git a/src/context.rs b/src/context.rs deleted file mode 100644 index 9349de30..00000000 --- a/src/context.rs +++ /dev/null @@ -1,89 +0,0 @@ -use std::{ - ops::{Deref, DerefMut}, - path::{Path, PathBuf}, -}; - -use crate::error::ResolveError; - -#[derive(Debug, Default, Clone)] -pub struct ResolveContext(ResolveContextImpl); - -#[derive(Debug, Default, Clone)] -pub struct ResolveContextImpl { - pub fully_specified: bool, - - pub query: Option, - - pub fragment: Option, - - /// Files that was found on file system - pub file_dependencies: Option>, - - /// Files that was found on file system - pub missing_dependencies: Option>, - - /// The current resolving alias for bailing recursion alias. - pub resolving_alias: Option, - - /// For avoiding infinite recursion, which will cause stack overflow. - depth: u8, -} - -impl Deref for ResolveContext { - type Target = ResolveContextImpl; - - fn deref(&self) -> &Self::Target { - &self.0 - } -} - -impl DerefMut for ResolveContext { - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} - -impl ResolveContext { - pub fn with_fully_specified(&mut self, yes: bool) { - self.fully_specified = yes; - } - - pub fn with_query_fragment(&mut self, query: Option<&str>, fragment: Option<&str>) { - if let Some(query) = query { - self.query.replace(query.to_string()); - } - if let Some(fragment) = fragment { - self.fragment.replace(fragment.to_string()); - } - } - - pub fn init_file_dependencies(&mut self) { - self.file_dependencies.replace(vec![]); - self.missing_dependencies.replace(vec![]); - } - - pub fn add_file_dependency(&mut self, dep: &Path) { - if let Some(deps) = &mut self.file_dependencies { - deps.push(dep.to_path_buf()); - } - } - - pub fn add_missing_dependency(&mut self, dep: &Path) { - if let Some(deps) = &mut self.missing_dependencies { - deps.push(dep.to_path_buf()); - } - } - - pub fn with_resolving_alias(&mut self, alias: String) { - self.resolving_alias = Some(alias); - } - - pub fn test_for_infinite_recursion(&mut self) -> Result<(), ResolveError> { - self.depth += 1; - // 64 should be more than enough for detecting infinite recursion. - if self.depth > 64 { - return Err(ResolveError::Recursion); - } - Ok(()) - } -} diff --git a/src/error.rs b/src/error.rs deleted file mode 100644 index b00a0ba8..00000000 --- a/src/error.rs +++ /dev/null @@ -1,182 +0,0 @@ -use std::{io, path::PathBuf, sync::Arc}; -use thiserror::Error; - -/// All resolution errors -/// -/// `thiserror` is used to display meaningful error messages. -#[derive(Debug, Clone, PartialEq, Error)] -pub enum ResolveError { - /// Ignored path - /// - /// Derived from ignored path (false value) from browser field in package.json - /// ```json - /// { - /// "browser": { - /// "./module": false - /// } - /// } - /// ``` - /// See - #[error("Path is ignored {0}")] - Ignored(PathBuf), - - /// Module not found - #[error("Cannot find module '{0}'")] - NotFound(/* specifier */ String), - - /// Matched alias value not found - #[error("Cannot find module '{0}' for matched aliased key '{1}'")] - MatchedAliasNotFound(/* specifier */ String, /* alias key */ String), - - /// Tsconfig not found - #[error("Tsconfig not found {0}")] - TsconfigNotFound(PathBuf), - - /// Tsconfig's project reference path points to it self - #[error("Tsconfig's project reference path points to this tsconfig {0}")] - TsconfigSelfReference(PathBuf), - - #[error("{0}")] - IOError(IOError), - - /// Node.js builtin modules - /// - /// This is an error due to not being a Node.js runtime. - /// The `alias` option can be used to resolve a builtin module to a polyfill. - #[error("Builtin module {0}")] - Builtin(String), - - /// All of the aliased extension are not found - #[error("All of the aliased extensions are not found for {0}")] - ExtensionAlias(PathBuf), - - /// The provided path specifier cannot be parsed - #[error("{0}")] - Specifier(SpecifierError), - - /// JSON parse error - #[error("{0:?}")] - JSON(JSONError), - - /// Restricted by `ResolveOptions::restrictions` - #[error(r#"Path "{0}" restricted by {0}"#)] - Restriction(PathBuf, PathBuf), - - #[error(r#"Invalid module "{0}" specifier is not a valid subpath for the "exports" resolution of {1}"#)] - InvalidModuleSpecifier(String, PathBuf), - - #[error(r#"Invalid "exports" target "{0}" defined for '{1}' in the package config {2}"#)] - InvalidPackageTarget(String, String, PathBuf), - - #[error(r#"Package subpath '{0}' is not defined by "exports" in {1}"#)] - PackagePathNotExported(String, PathBuf), - - #[error(r#"Invalid package config "{0}", "exports" cannot contain some keys starting with '.' and some not. The exports object must either be an object of package subpath keys or an object of main entry condition name keys only."#)] - InvalidPackageConfig(PathBuf), - - #[error(r#"Default condition should be last one in "{0}""#)] - InvalidPackageConfigDefault(PathBuf), - - #[error(r#"Expecting folder to folder mapping. "{0}" should end with "/"#)] - InvalidPackageConfigDirectory(PathBuf), - - #[error(r#"Package import specifier "{0}" is not defined in package {1}"#)] - PackageImportNotDefined(String, PathBuf), - - #[error("{0} is unimplemented")] - Unimplemented(&'static str), - - /// Occurs when alias paths reference each other. - #[error("Recursion in resolving")] - Recursion, -} - -impl ResolveError { - pub fn is_ignore(&self) -> bool { - matches!(self, Self::Ignored(_)) - } - - pub(crate) fn from_serde_json_error(path: PathBuf, error: &serde_json::Error) -> Self { - Self::JSON(JSONError { - path, - message: error.to_string(), - line: error.line(), - column: error.column(), - }) - } -} - -/// Error for [ResolveError::Specifier] -#[derive(Debug, Clone, Eq, PartialEq, Error)] -pub enum SpecifierError { - #[error("The specifiers must be a non-empty string. Received \"{0}\"")] - Empty(String), -} - -/// JSON error from [serde_json::Error] -#[derive(Debug, Clone, Eq, PartialEq)] -pub struct JSONError { - pub path: PathBuf, - pub message: String, - pub line: usize, - pub column: usize, -} - -#[derive(Debug, Clone, Error)] -#[error("{0}")] -pub struct IOError(Arc); - -impl PartialEq for IOError { - fn eq(&self, other: &Self) -> bool { - self.0.kind() == other.0.kind() - } -} - -impl From for io::Error { - fn from(error: IOError) -> Self { - let io_error = error.0.as_ref(); - Self::new(io_error.kind(), io_error.to_string()) - } -} - -impl From for ResolveError { - fn from(err: io::Error) -> Self { - Self::IOError(IOError(Arc::new(err))) - } -} - -#[test] -fn test_into_io_error() { - use std::io::{self, ErrorKind}; - let error_string = "IOError occurred"; - let string_error = io::Error::new(ErrorKind::Interrupted, error_string.to_string()); - let string_error2 = io::Error::new(ErrorKind::Interrupted, error_string.to_string()); - let resolve_io_error: ResolveError = ResolveError::from(string_error2); - - assert_eq!(resolve_io_error, ResolveError::from(string_error)); - assert_eq!(resolve_io_error.clone(), resolve_io_error); - let ResolveError::IOError(io_error) = resolve_io_error else { unreachable!() }; - assert_eq!( - format!("{io_error:?}"), - r#"IOError(Custom { kind: Interrupted, error: "IOError occurred" })"# - ); - // fix for https://github.com/web-infra-dev/rspack/issues/4564 - let std_io_error: io::Error = io_error.into(); - assert_eq!(std_io_error.kind(), ErrorKind::Interrupted); - assert_eq!(std_io_error.to_string(), error_string); - assert_eq!( - format!("{std_io_error:?}"), - r#"Custom { kind: Interrupted, error: "IOError occurred" }"# - ); -} - -#[test] -fn test_coverage() { - let error = ResolveError::NotFound("x".into()); - assert_eq!(format!("{error:?}"), r#"NotFound("x")"#); - assert_eq!(error.clone(), error); - - let error = ResolveError::Specifier(SpecifierError::Empty("x".into())); - assert_eq!(format!("{error:?}"), r#"Specifier(Empty("x"))"#); - assert_eq!(error.clone(), error); -} diff --git a/src/file_system.rs b/src/file_system.rs deleted file mode 100644 index d5f0ff8a..00000000 --- a/src/file_system.rs +++ /dev/null @@ -1,220 +0,0 @@ -use cfg_if::cfg_if; -use std::{ - fs, io, - path::{Path, PathBuf}, -}; - -#[cfg(feature = "yarn_pnp")] -use pnp::fs::{LruZipCache, VPath, VPathInfo, ZipCache}; - -/// File System abstraction used for `ResolverGeneric` -pub trait FileSystem: Send + Sync { - /// See [std::fs::read_to_string] - /// - /// # Errors - /// - /// * See [std::fs::read_to_string] - /// ## Warning - /// Use `&Path` instead of a generic `P: AsRef` here, - /// because object safety requirements, it is especially useful, when - /// you want to store multiple `dyn FileSystem` in a `Vec` or use a `ResolverGeneric` in - /// napi env. - fn read_to_string(&self, path: &Path) -> io::Result; - - /// See [std::fs::metadata] - /// - /// # Errors - /// See [std::fs::metadata] - /// ## Warning - /// Use `&Path` instead of a generic `P: AsRef` here, - /// because object safety requirements, it is especially useful, when - /// you want to store multiple `dyn FileSystem` in a `Vec` or use a `ResolverGeneric` in - /// napi env. - fn metadata(&self, path: &Path) -> io::Result; - - /// See [std::fs::symlink_metadata] - /// - /// # Errors - /// - /// See [std::fs::symlink_metadata] - /// ## Warning - /// Use `&Path` instead of a generic `P: AsRef` here, - /// because object safety requirements, it is especially useful, when - /// you want to store multiple `dyn FileSystem` in a `Vec` or use a `ResolverGeneric` in - /// napi env. - fn symlink_metadata(&self, path: &Path) -> io::Result; - - /// See [std::fs::canonicalize] - /// - /// # Errors - /// - /// See [std::fs::read_link] - /// ## Warning - /// Use `&Path` instead of a generic `P: AsRef` here, - /// because object safety requirements, it is especially useful, when - /// you want to store multiple `dyn FileSystem` in a `Vec` or use a `ResolverGeneric` in - /// napi env. - fn canonicalize(&self, path: &Path) -> io::Result; -} - -/// Metadata information about a file -#[derive(Debug, Clone, Copy)] -pub struct FileMetadata { - pub(crate) is_file: bool, - pub(crate) is_dir: bool, - pub(crate) is_symlink: bool, -} - -impl FileMetadata { - pub fn new(is_file: bool, is_dir: bool, is_symlink: bool) -> Self { - Self { is_file, is_dir, is_symlink } - } -} - -#[cfg(feature = "yarn_pnp")] -impl From for FileMetadata { - fn from(value: pnp::fs::FileType) -> Self { - Self::new(value == pnp::fs::FileType::File, value == pnp::fs::FileType::Directory, false) - } -} - -impl From for FileMetadata { - fn from(metadata: fs::Metadata) -> Self { - Self::new(metadata.is_file(), metadata.is_dir(), metadata.is_symlink()) - } -} - -/// Operating System -#[cfg(feature = "yarn_pnp")] -pub struct FileSystemOs { - pnp_lru: LruZipCache>, -} - -#[cfg(not(feature = "yarn_pnp"))] -pub struct FileSystemOs; - -impl Default for FileSystemOs { - fn default() -> Self { - cfg_if! { - if #[cfg(feature = "yarn_pnp")] { - Self { pnp_lru: LruZipCache::new(50, pnp::fs::open_zip_via_read_p) } - } else { - Self - } - } - } -} - -fn read_to_string(path: &Path) -> io::Result { - // `simdutf8` is faster than `std::str::from_utf8` which `fs::read_to_string` uses internally - let bytes = std::fs::read(path)?; - if simdutf8::basic::from_utf8(&bytes).is_err() { - // Same error as `fs::read_to_string` produces (`io::Error::INVALID_UTF8`) - return Err(io::Error::new( - io::ErrorKind::InvalidData, - "stream did not contain valid UTF-8", - )); - } - // SAFETY: `simdutf8` has ensured it's a valid UTF-8 string - Ok(unsafe { String::from_utf8_unchecked(bytes) }) -} - -impl FileSystem for FileSystemOs { - fn read_to_string(&self, path: &Path) -> io::Result { - cfg_if! { - if #[cfg(feature = "yarn_pnp")] { - match VPath::from(path)? { - VPath::Zip(info) => { - self.pnp_lru.read_to_string(info.physical_base_path(), info.zip_path) - } - VPath::Virtual(info) => read_to_string(&info.physical_base_path()), - VPath::Native(path) => read_to_string(&path), - } - } else { - read_to_string(path) - } - } - } - - fn metadata(&self, path: &Path) -> io::Result { - cfg_if! { - if #[cfg(feature = "yarn_pnp")] { - match VPath::from(path)? { - VPath::Zip(info) => self - .pnp_lru - .file_type(info.physical_base_path(), info.zip_path) - .map(FileMetadata::from), - VPath::Virtual(info) => { - fs::metadata(info.physical_base_path()).map(FileMetadata::from) - } - VPath::Native(path) => fs::metadata(path).map(FileMetadata::from), - } - } else { - fs::metadata(path).map(FileMetadata::from) - } - } - } - - fn symlink_metadata(&self, path: &Path) -> io::Result { - fs::symlink_metadata(path).map(FileMetadata::from) - } - - fn canonicalize(&self, path: &Path) -> io::Result { - cfg_if! { - if #[cfg(feature = "yarn_pnp")] { - match VPath::from(path)? { - VPath::Zip(info) => { - dunce::canonicalize(info.physical_base_path().join(info.zip_path)) - } - VPath::Virtual(info) => dunce::canonicalize(info.physical_base_path()), - VPath::Native(path) => dunce::canonicalize(path), - } - } else if #[cfg(windows)] { - dunce::canonicalize(path) - } else { - use std::path::Component; - let mut path_buf = path.to_path_buf(); - loop { - let link = fs::read_link(&path_buf)?; - path_buf.pop(); - for component in link.components() { - match component { - Component::ParentDir => { - path_buf.pop(); - } - Component::Normal(seg) => { - #[cfg(target_family = "wasm")] - // Need to trim the extra \0 introduces by https://github.com/nodejs/uvwasi/issues/262 - { - path_buf.push(seg.to_string_lossy().trim_end_matches('\0')); - } - #[cfg(not(target_family = "wasm"))] - { - path_buf.push(seg); - } - } - Component::RootDir => { - path_buf = PathBuf::from("/"); - } - Component::CurDir | Component::Prefix(_) => {} - } - } - if !fs::symlink_metadata(&path_buf)?.is_symlink() { - break; - } - } - Ok(path_buf) - } - } - } -} - -#[test] -fn metadata() { - let meta = FileMetadata { is_file: true, is_dir: true, is_symlink: true }; - assert_eq!( - format!("{meta:?}"), - "FileMetadata { is_file: true, is_dir: true, is_symlink: true }" - ); - let _ = meta; -} diff --git a/src/lib.rs b/src/lib.rs deleted file mode 100644 index e6cb2246..00000000 --- a/src/lib.rs +++ /dev/null @@ -1,1755 +0,0 @@ -//! # Oxc Resolver -//! -//! Node.js [CommonJS][cjs] and [ECMAScript][esm] Module Resolution. -//! -//! Released on [crates.io](https://crates.io/crates/oxc_resolver) and [npm](https://www.npmjs.com/package/oxc-resolver). -//! -//! A module resolution is the process of finding the file referenced by a module specifier in -//! `import "specifier"` or `require("specifier")`. -//! -//! All [configuration options](ResolveOptions) are aligned with webpack's [enhanced-resolve]. -//! -//! ## Terminology -//! -//! ### Specifier -//! -//! For [CommonJS modules][cjs], -//! the specifier is the string passed to the `require` function. e.g. `"id"` in `require("id")`. -//! -//! For [ECMAScript modules][esm], -//! the specifier of an `import` statement is the string after the `from` keyword, -//! e.g. `'specifier'` in `import 'specifier'` or `import { sep } from 'specifier'`. -//! Specifiers are also used in export from statements, and as the argument to an `import()` expression. -//! -//! This is also named "request" in some places. -//! -//! ## References: -//! -//! * Algorithm adapted from Node.js [CommonJS Module Resolution Algorithm] and [ECMAScript Module Resolution Algorithm]. -//! * Tests are ported from [enhanced-resolve]. -//! * Some code is adapted from [parcel-resolver]. -//! * The documentation is copied from [webpack's resolve configuration](https://webpack.js.org/configuration/resolve). -//! -//! [enhanced-resolve]: https://github.com/webpack/enhanced-resolve -//! [CommonJS Module Resolution Algorithm]: https://nodejs.org/api/modules.html#all-together -//! [ECMAScript Module Resolution Algorithm]: https://nodejs.org/api/esm.html#resolution-algorithm-specification -//! [parcel-resolver]: https://github.com/parcel-bundler/parcel/blob/v2/packages/utils/node-resolver-rs -//! [cjs]: https://nodejs.org/api/modules.html -//! [esm]: https://nodejs.org/api/esm.html -//! -//! ## Feature flags -#![cfg_attr(feature = "document-features", doc = document_features::document_features!())] -#![cfg_attr(docsrs, feature(doc_auto_cfg))] -//! -//! ## Example -//! -//! ```rust,ignore -#![doc = include_str!("../examples/resolver.rs")] -//! ``` - -mod builtins; -mod cache; -mod context; -mod error; -mod file_system; -mod options; -mod package_json; -mod path; -mod resolution; -mod specifier; -mod tsconfig; - -#[cfg(test)] -mod tests; - -use std::{ - borrow::Cow, - cmp::Ordering, - ffi::OsStr, - fmt, - path::{Component, Path, PathBuf}, - sync::Arc, -}; - -use rustc_hash::FxHashSet; -use serde_json::Value as JSONValue; - -pub use crate::{ - builtins::NODEJS_BUILTINS, - error::{JSONError, ResolveError, SpecifierError}, - file_system::{FileMetadata, FileSystem}, - options::{ - Alias, AliasValue, EnforceExtension, ResolveOptions, Restriction, TsconfigOptions, - TsconfigReferences, - }, - package_json::PackageJson, - resolution::Resolution, -}; -use crate::{ - cache::{Cache, CachedPath}, - context::ResolveContext as Ctx, - file_system::FileSystemOs, - package_json::JSONMap, - path::{PathUtil, SLASH_START}, - specifier::Specifier, - tsconfig::ExtendsField, - tsconfig::{ProjectReference, TsConfig}, -}; - -type ResolveResult = Result, ResolveError>; - -/// Context returned from the [Resolver::resolve_with_context] API -#[derive(Debug, Default, Clone)] -pub struct ResolveContext { - /// Files that was found on file system - pub file_dependencies: FxHashSet, - - /// Dependencies that was not found on file system - pub missing_dependencies: FxHashSet, -} - -/// Resolver with the current operating system as the file system -pub type Resolver = ResolverGeneric; - -/// Generic implementation of the resolver, can be configured by the [FileSystem] trait -pub struct ResolverGeneric { - options: ResolveOptions, - cache: Arc>, -} - -impl fmt::Debug for ResolverGeneric { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - self.options.fmt(f) - } -} - -impl Default for ResolverGeneric { - fn default() -> Self { - Self::new(ResolveOptions::default()) - } -} - -impl ResolverGeneric { - pub fn new(options: ResolveOptions) -> Self { - Self { options: options.sanitize(), cache: Arc::new(Cache::new(Fs::default())) } - } -} - -impl ResolverGeneric { - pub fn new_with_file_system(file_system: Fs, options: ResolveOptions) -> Self { - Self { cache: Arc::new(Cache::new(file_system)), options: options.sanitize() } - } - - /// Clone the resolver using the same underlying cache. - #[must_use] - pub fn clone_with_options(&self, options: ResolveOptions) -> Self { - Self { options: options.sanitize(), cache: Arc::clone(&self.cache) } - } - - /// Returns the options. - pub fn options(&self) -> &ResolveOptions { - &self.options - } - - /// Clear the underlying cache. - pub fn clear_cache(&self) { - self.cache.clear(); - } - - /// Resolve `specifier` at an absolute path to a `directory`. - /// - /// A specifier is the string passed to require or import, i.e. `require("specifier")` or `import "specifier"`. - /// - /// `directory` must be an **absolute** path to a directory where the specifier is resolved against. - /// For CommonJS modules, it is the `__dirname` variable that contains the absolute path to the folder containing current module. - /// For ECMAScript modules, it is the value of `import.meta.url`. - /// - /// # Errors - /// - /// * See [ResolveError] - pub fn resolve>( - &self, - directory: P, - specifier: &str, - ) -> Result { - let mut ctx = Ctx::default(); - self.resolve_tracing(directory.as_ref(), specifier, &mut ctx) - } - - /// Resolve `specifier` at absolute `path` with [ResolveContext] - /// - /// # Errors - /// - /// * See [ResolveError] - pub fn resolve_with_context>( - &self, - directory: P, - specifier: &str, - resolve_context: &mut ResolveContext, - ) -> Result { - let mut ctx = Ctx::default(); - ctx.init_file_dependencies(); - let result = self.resolve_tracing(directory.as_ref(), specifier, &mut ctx); - if let Some(deps) = &mut ctx.file_dependencies { - resolve_context.file_dependencies.extend(deps.drain(..)); - } - if let Some(deps) = &mut ctx.missing_dependencies { - resolve_context.missing_dependencies.extend(deps.drain(..)); - } - result - } - - /// Wrap `resolve_impl` with `tracing` information - fn resolve_tracing( - &self, - directory: &Path, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - let span = tracing::debug_span!("resolve", path = ?directory, specifier = specifier); - let _enter = span.enter(); - let r = self.resolve_impl(directory, specifier, ctx); - match &r { - Ok(r) => { - tracing::debug!(options = ?self.options, path = ?directory, specifier = specifier, ret = ?r.path); - } - Err(err) => { - tracing::debug!(options = ?self.options, path = ?directory, specifier = specifier, err = ?err); - } - }; - r - } - - fn resolve_impl( - &self, - path: &Path, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - ctx.with_fully_specified(self.options.fully_specified); - let cached_path = self.cache.value(path); - let cached_path = self.require(&cached_path, specifier, ctx)?; - let path = self.load_realpath(&cached_path)?; - // enhanced-resolve: restrictions - self.check_restrictions(&path)?; - let package_json = cached_path.find_package_json(&self.cache.fs, &self.options, ctx)?; - if let Some(package_json) = &package_json { - // path must be inside the package. - debug_assert!(path.starts_with(package_json.directory())); - } - Ok(Resolution { - path, - query: ctx.query.take(), - fragment: ctx.fragment.take(), - package_json, - }) - } - - /// require(X) from module at path Y - /// - /// X: specifier - /// Y: path - /// - /// - fn require( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - ctx.test_for_infinite_recursion()?; - - // enhanced-resolve: parse - let (parsed, try_fragment_as_path) = self.load_parse(cached_path, specifier, ctx)?; - if let Some(path) = try_fragment_as_path { - return Ok(path); - } - - self.require_without_parse(cached_path, parsed.path(), ctx) - } - - fn require_without_parse( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - // tsconfig-paths - if let Some(path) = self.load_tsconfig_paths(cached_path, specifier, &mut Ctx::default())? { - return Ok(path); - } - - // enhanced-resolve: try alias - if let Some(path) = self.load_alias(cached_path, specifier, &self.options.alias, ctx)? { - return Ok(path); - } - - let result = match Path::new(specifier).components().next() { - // 2. If X begins with '/' - Some(Component::RootDir | Component::Prefix(_)) => { - self.require_absolute(cached_path, specifier, ctx) - } - // 3. If X begins with './' or '/' or '../' - Some(Component::CurDir | Component::ParentDir) => { - self.require_relative(cached_path, specifier, ctx) - } - // 4. If X begins with '#' - Some(Component::Normal(_)) if specifier.as_bytes()[0] == b'#' => { - self.require_hash(cached_path, specifier, ctx) - } - _ => { - // 1. If X is a core module, - // a. return the core module - // b. STOP - self.require_core(specifier)?; - - // (ESM) 5. Otherwise, - // Note: specifier is now a bare specifier. - // Set resolved the result of PACKAGE_RESOLVE(specifier, parentURL). - self.require_bare(cached_path, specifier, ctx) - } - }; - - result.or_else(|err| { - if err.is_ignore() { - return Err(err); - } - // enhanced-resolve: try fallback - self.load_alias(cached_path, specifier, &self.options.fallback, ctx) - .and_then(|value| value.ok_or(err)) - }) - } - - // PACKAGE_RESOLVE(packageSpecifier, parentURL) - // 3. If packageSpecifier is a Node.js builtin module name, then - // 1. Return the string "node:" concatenated with packageSpecifier. - fn require_core(&self, specifier: &str) -> Result<(), ResolveError> { - if self.options.builtin_modules { - let starts_with_node = specifier.starts_with("node:"); - if starts_with_node || NODEJS_BUILTINS.binary_search(&specifier).is_ok() { - let mut specifier = specifier.to_string(); - if !starts_with_node { - specifier = format!("node:{specifier}"); - } - return Err(ResolveError::Builtin(specifier)); - } - } - Ok(()) - } - - fn require_absolute( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - // Make sure only path prefixes gets called - debug_assert!(Path::new(specifier) - .components() - .next() - .is_some_and(|c| matches!(c, Component::RootDir | Component::Prefix(_)))); - if !self.options.prefer_relative && self.options.prefer_absolute { - if let Ok(path) = self.load_package_self_or_node_modules(cached_path, specifier, ctx) { - return Ok(path); - } - } - if let Some(path) = self.load_roots(specifier, ctx) { - return Ok(path); - } - // 2. If X begins with '/' - // a. set Y to be the file system root - let path = self.cache.value(Path::new(specifier)); - if let Some(path) = self.load_as_file_or_directory(&path, specifier, ctx)? { - return Ok(path); - } - Err(ResolveError::NotFound(specifier.to_string())) - } - - // 3. If X begins with './' or '/' or '../' - fn require_relative( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - // Make sure only relative or normal paths gets called - debug_assert!(Path::new(specifier).components().next().is_some_and(|c| matches!( - c, - Component::CurDir | Component::ParentDir | Component::Normal(_) - ))); - let path = cached_path.path().normalize_with(specifier); - let cached_path = self.cache.value(&path); - // a. LOAD_AS_FILE(Y + X) - // b. LOAD_AS_DIRECTORY(Y + X) - if let Some(path) = self.load_as_file_or_directory(&cached_path, specifier, ctx)? { - return Ok(path); - } - // c. THROW "not found" - Err(ResolveError::NotFound(specifier.to_string())) - } - - fn require_hash( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - debug_assert_eq!(specifier.chars().next(), Some('#')); - // a. LOAD_PACKAGE_IMPORTS(X, dirname(Y)) - if let Some(path) = self.load_package_imports(cached_path, specifier, ctx)? { - return Ok(path); - } - self.load_package_self_or_node_modules(cached_path, specifier, ctx) - } - - fn require_bare( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - // Make sure no other path prefixes gets called - debug_assert!(Path::new(specifier) - .components() - .next() - .is_some_and(|c| matches!(c, Component::Normal(_)))); - if self.options.prefer_relative { - if let Ok(path) = self.require_relative(cached_path, specifier, ctx) { - return Ok(path); - } - } - self.load_package_self_or_node_modules(cached_path, specifier, ctx) - } - - /// enhanced-resolve: ParsePlugin. - /// - /// 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`. - /// - /// - fn load_parse<'s>( - &self, - cached_path: &CachedPath, - specifier: &'s str, - ctx: &mut Ctx, - ) -> Result<(Specifier<'s>, Option), ResolveError> { - let parsed = Specifier::parse(specifier).map_err(ResolveError::Specifier)?; - ctx.with_query_fragment(parsed.query, parsed.fragment); - - // There is an edge-case where a request with # can be a path or a fragment -> try both - if ctx.fragment.is_some() && ctx.query.is_none() { - let specifier = parsed.path(); - let fragment = ctx.fragment.take().unwrap(); - let path = format!("{specifier}{fragment}"); - if let Ok(path) = self.require_without_parse(cached_path, &path, ctx) { - return Ok((parsed, Some(path))); - } - ctx.fragment.replace(fragment); - } - Ok((parsed, None)) - } - - fn load_package_self_or_node_modules( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - let (_, subpath) = Self::parse_package_specifier(specifier); - if subpath.is_empty() { - ctx.with_fully_specified(false); - } - // 5. LOAD_PACKAGE_SELF(X, dirname(Y)) - if let Some(path) = self.load_package_self(cached_path, specifier, ctx)? { - return Ok(path); - } - // 6. LOAD_NODE_MODULES(X, dirname(Y)) - if let Some(path) = self.load_node_modules(cached_path, specifier, ctx)? { - return Ok(path); - } - // 7. THROW "not found" - Err(ResolveError::NotFound(specifier.to_string())) - } - - /// LOAD_PACKAGE_IMPORTS(X, DIR) - fn load_package_imports( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - // 1. Find the closest package scope SCOPE to DIR. - // 2. If no scope was found, return. - let Some(package_json) = - cached_path.find_package_json(&self.cache.fs, &self.options, ctx)? - else { - return Ok(None); - }; - // 3. If the SCOPE/package.json "imports" is null or undefined, return. - // 4. let MATCH = PACKAGE_IMPORTS_RESOLVE(X, pathToFileURL(SCOPE), ["node", "require"]) defined in the ESM resolver. - if let Some(path) = self.package_imports_resolve(specifier, &package_json, ctx)? { - // 5. RESOLVE_ESM_MATCH(MATCH). - return self.resolve_esm_match(specifier, &path, ctx); - } - Ok(None) - } - - fn load_as_file(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - // enhanced-resolve feature: extension_alias - if let Some(path) = self.load_extension_alias(cached_path, ctx)? { - return Ok(Some(path)); - } - if self.options.enforce_extension.is_disabled() { - // 1. If X is a file, load X as its file extension format. STOP - if let Some(path) = self.load_alias_or_file(cached_path, ctx)? { - return Ok(Some(path)); - } - } - // 2. If X.js is a file, load X.js as JavaScript text. STOP - // 3. If X.json is a file, parse X.json to a JavaScript Object. STOP - // 4. If X.node is a file, load X.node as binary addon. STOP - if let Some(path) = self.load_extensions(cached_path, &self.options.extensions, ctx)? { - return Ok(Some(path)); - } - Ok(None) - } - - fn load_as_directory(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - // TODO: Only package.json is supported, so warn about having other values - // Checking for empty files is needed for omitting checks on package.json - // 1. If X/package.json is a file, - if !self.options.description_files.is_empty() { - // a. Parse X/package.json, and look for "main" field. - if let Some(package_json) = - cached_path.package_json(&self.cache.fs, &self.options, ctx)? - { - // b. If "main" is a falsy value, GOTO 2. - for main_field in package_json.main_fields(&self.options.main_fields) { - // c. let M = X + (json main field) - let main_field_path = cached_path.path().normalize_with(main_field); - // d. LOAD_AS_FILE(M) - let cached_path = self.cache.value(&main_field_path); - if let Some(path) = self.load_as_file(&cached_path, ctx)? { - return Ok(Some(path)); - } - // e. LOAD_INDEX(M) - if let Some(path) = self.load_index(&cached_path, ctx)? { - return Ok(Some(path)); - } - } - // f. LOAD_INDEX(X) DEPRECATED - // g. THROW "not found" - } - } - // 2. LOAD_INDEX(X) - self.load_index(cached_path, ctx) - } - - fn load_as_file_or_directory( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - if self.options.resolve_to_context { - return Ok(cached_path.is_dir(&self.cache.fs, ctx).then(|| cached_path.clone())); - } - if !specifier.ends_with('/') { - if let Some(path) = self.load_as_file(cached_path, ctx)? { - return Ok(Some(path)); - } - } - if cached_path.is_dir(&self.cache.fs, ctx) { - if let Some(path) = self.load_as_directory(cached_path, ctx)? { - return Ok(Some(path)); - } - } - Ok(None) - } - - fn load_extensions( - &self, - path: &CachedPath, - extensions: &[String], - ctx: &mut Ctx, - ) -> ResolveResult { - if ctx.fully_specified { - return Ok(None); - } - let path = path.path().as_os_str(); - for extension in extensions { - let mut path_with_extension = path.to_os_string(); - path_with_extension.reserve_exact(extension.len()); - path_with_extension.push(extension); - let cached_path = self.cache.value(Path::new(&path_with_extension)); - if let Some(path) = self.load_alias_or_file(&cached_path, ctx)? { - return Ok(Some(path)); - } - } - Ok(None) - } - - fn load_realpath(&self, cached_path: &CachedPath) -> Result { - if self.options.symlinks { - cached_path.realpath(&self.cache.fs).map_err(ResolveError::from) - } else { - Ok(cached_path.to_path_buf()) - } - } - - fn check_restrictions(&self, path: &Path) -> Result<(), ResolveError> { - // https://github.com/webpack/enhanced-resolve/blob/a998c7d218b7a9ec2461fc4fddd1ad5dd7687485/lib/RestrictionsPlugin.js#L19-L24 - fn is_inside(path: &Path, parent: &Path) -> bool { - if !path.starts_with(parent) { - return false; - } - if path.as_os_str().len() == parent.as_os_str().len() { - return true; - } - path.strip_prefix(parent).is_ok_and(|p| p == Path::new("./")) - } - for restriction in &self.options.restrictions { - match restriction { - Restriction::Path(restricted_path) => { - if !is_inside(path, restricted_path) { - return Err(ResolveError::Restriction( - path.to_path_buf(), - restricted_path.clone(), - )); - } - } - Restriction::RegExp(_) => { - return Err(ResolveError::Unimplemented("Restriction with regex")) - } - } - } - Ok(()) - } - - fn load_index(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - for main_file in &self.options.main_files { - let main_path = cached_path.path().normalize_with(main_file); - let cached_path = self.cache.value(&main_path); - if self.options.enforce_extension.is_disabled() { - if let Some(path) = self.load_alias_or_file(&cached_path, ctx)? { - return Ok(Some(path)); - } - } - // 1. If X/index.js is a file, load X/index.js as JavaScript text. STOP - // 2. If X/index.json is a file, parse X/index.json to a JavaScript object. STOP - // 3. If X/index.node is a file, load X/index.node as binary addon. STOP - if let Some(path) = self.load_extensions(&cached_path, &self.options.extensions, ctx)? { - return Ok(Some(path)); - } - } - Ok(None) - } - - fn load_alias_or_file(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - if !self.options.alias_fields.is_empty() { - if let Some(package_json) = - cached_path.find_package_json(&self.cache.fs, &self.options, ctx)? - { - if let Some(path) = - self.load_browser_field(cached_path, None, &package_json, ctx)? - { - return Ok(Some(path)); - } - } - } - // enhanced-resolve: try file as alias - let alias_specifier = cached_path.path().to_string_lossy(); - if let Some(path) = - self.load_alias(cached_path, &alias_specifier, &self.options.alias, ctx)? - { - return Ok(Some(path)); - } - if cached_path.is_file(&self.cache.fs, ctx) { - return Ok(Some(cached_path.clone())); - } - Ok(None) - } - - fn load_node_modules( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - #[cfg(feature = "yarn_pnp")] - { - if let Some(resolved_path) = self.load_pnp(cached_path, specifier, ctx)? { - return Ok(Some(resolved_path)); - } - } - - let (package_name, subpath) = Self::parse_package_specifier(specifier); - // 1. let DIRS = NODE_MODULES_PATHS(START) - // 2. for each DIR in DIRS: - for module_name in &self.options.modules { - for cached_path in std::iter::successors(Some(cached_path), |p| p.parent()) { - // Skip if /path/to/node_modules does not exist - if !cached_path.is_dir(&self.cache.fs, ctx) { - continue; - } - - let Some(cached_path) = self.get_module_directory(cached_path, module_name, ctx) - else { - continue; - }; - // Optimize node_modules lookup by inspecting whether the package exists - // From LOAD_PACKAGE_EXPORTS(X, DIR) - // 1. Try to interpret X as a combination of NAME and SUBPATH where the name - // may have a @scope/ prefix and the subpath begins with a slash (`/`). - if !package_name.is_empty() { - let package_path = cached_path.path().normalize_with(package_name); - let cached_path = self.cache.value(&package_path); - // Try foo/node_modules/package_name - if cached_path.is_dir(&self.cache.fs, ctx) { - // a. LOAD_PACKAGE_EXPORTS(X, DIR) - if let Some(path) = - self.load_package_exports(specifier, subpath, &cached_path, ctx)? - { - return Ok(Some(path)); - } - } else { - // foo/node_modules/package_name is not a directory, so useless to check inside it - if !subpath.is_empty() { - continue; - } - // Skip if the directory lead to the scope package does not exist - // i.e. `foo/node_modules/@scope` is not a directory for `foo/node_modules/@scope/package` - if package_name.starts_with('@') { - if let Some(path) = cached_path.parent() { - if !path.is_dir(&self.cache.fs, ctx) { - continue; - } - } - } - } - } - - // Try as file or directory for all other cases - // b. LOAD_AS_FILE(DIR/X) - // c. LOAD_AS_DIRECTORY(DIR/X) - let node_module_file = cached_path.path().normalize_with(specifier); - let cached_path = self.cache.value(&node_module_file); - if let Some(path) = self.load_as_file_or_directory(&cached_path, specifier, ctx)? { - return Ok(Some(path)); - } - } - } - Ok(None) - } - - #[cfg(feature = "yarn_pnp")] - fn load_pnp( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result, ResolveError> { - let Some(pnp_manifest) = &self.options.pnp_manifest else { return Ok(None) }; - let resolution = - pnp::resolve_to_unqualified_via_manifest(pnp_manifest, specifier, cached_path.path()); - match resolution { - Ok(pnp::Resolution::Resolved(path, subpath)) => { - let cached_path = self.cache.value(&path); - let export_resolution = self.load_package_exports( - specifier, - &subpath.unwrap_or_default(), - &cached_path, - ctx, - )?; - if export_resolution.is_some() { - return Ok(export_resolution); - } - let file_or_directory_resolution = - self.load_as_file_or_directory(&cached_path, specifier, ctx)?; - if file_or_directory_resolution.is_some() { - return Ok(file_or_directory_resolution); - } - Err(ResolveError::NotFound(specifier.to_string())) - } - - Ok(pnp::Resolution::Skipped) => Ok(None), - - Err(_) => { - // Todo: Add a ResolveError::Pnp variant? - Err(ResolveError::NotFound(specifier.to_string())) - } - } - } - - fn get_module_directory( - &self, - cached_path: &CachedPath, - module_name: &str, - ctx: &mut Ctx, - ) -> Option { - if module_name == "node_modules" { - cached_path.cached_node_modules(&self.cache, ctx) - } else if cached_path.path().components().next_back() - == Some(Component::Normal(OsStr::new(module_name))) - { - Some(cached_path.clone()) - } else { - cached_path.module_directory(module_name, &self.cache, ctx) - } - } - - fn load_package_exports( - &self, - specifier: &str, - subpath: &str, - cached_path: &CachedPath, - ctx: &mut Ctx, - ) -> ResolveResult { - // 2. If X does not match this pattern or DIR/NAME/package.json is not a file, - // return. - let Some(package_json) = cached_path.package_json(&self.cache.fs, &self.options, ctx)? - else { - return Ok(None); - }; - // 3. Parse DIR/NAME/package.json, and look for "exports" field. - // 4. If "exports" is null or undefined, return. - // 5. let MATCH = PACKAGE_EXPORTS_RESOLVE(pathToFileURL(DIR/NAME), "." + SUBPATH, - // `package.json` "exports", ["node", "require"]) defined in the ESM resolver. - // Note: The subpath is not prepended with a dot on purpose - for exports in package_json.exports_fields(&self.options.exports_fields) { - if let Some(path) = self.package_exports_resolve( - cached_path.path(), - &format!(".{subpath}"), - exports, - ctx, - )? { - // 6. RESOLVE_ESM_MATCH(MATCH) - return self.resolve_esm_match(specifier, &path, ctx); - }; - } - Ok(None) - } - - fn load_package_self( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - // 1. Find the closest package scope SCOPE to DIR. - // 2. If no scope was found, return. - let Some(package_json) = - cached_path.find_package_json(&self.cache.fs, &self.options, ctx)? - else { - return Ok(None); - }; - // 3. If the SCOPE/package.json "exports" is null or undefined, return. - // 4. If the SCOPE/package.json "name" is not the first segment of X, return. - if let Some(subpath) = package_json - .name - .as_ref() - .and_then(|package_name| Self::strip_package_name(specifier, package_name)) - { - // 5. let MATCH = PACKAGE_EXPORTS_RESOLVE(pathToFileURL(SCOPE), - // "." + X.slice("name".length), `package.json` "exports", ["node", "require"]) - // defined in the ESM resolver. - let package_url = package_json.directory(); - // Note: The subpath is not prepended with a dot on purpose - // because `package_exports_resolve` matches subpath without the leading dot. - for exports in package_json.exports_fields(&self.options.exports_fields) { - if let Some(cached_path) = - self.package_exports_resolve(package_url, &format!(".{subpath}"), exports, ctx)? - { - // 6. RESOLVE_ESM_MATCH(MATCH) - return self.resolve_esm_match(specifier, &cached_path, ctx); - } - } - } - self.load_browser_field(cached_path, Some(specifier), &package_json, ctx) - } - - /// RESOLVE_ESM_MATCH(MATCH) - fn resolve_esm_match( - &self, - specifier: &str, - cached_path: &CachedPath, - ctx: &mut Ctx, - ) -> ResolveResult { - // 1. let RESOLVED_PATH = fileURLToPath(MATCH) - // 2. If the file at RESOLVED_PATH exists, load RESOLVED_PATH as its extension format. STOP - // - // Non-compliant ESM can result in a directory, so directory is tried as well. - if let Some(path) = self.load_as_file_or_directory(cached_path, "", ctx)? { - return Ok(Some(path)); - } - // 3. THROW "not found" - Err(ResolveError::NotFound(specifier.to_string())) - } - - /// enhanced-resolve: AliasFieldPlugin for [ResolveOptions::alias_fields] - fn load_browser_field( - &self, - cached_path: &CachedPath, - module_specifier: Option<&str>, - package_json: &PackageJson, - ctx: &mut Ctx, - ) -> ResolveResult { - let path = cached_path.path(); - let Some(new_specifier) = package_json.resolve_browser_field( - path, - module_specifier, - &self.options.alias_fields, - )? - else { - return Ok(None); - }; - // Abort when resolving recursive module - if module_specifier.is_some_and(|s| s == new_specifier) { - return Ok(None); - } - if ctx.resolving_alias.as_ref().is_some_and(|s| s == new_specifier) { - // Complete when resolving to self `{"./a.js": "./a.js"}` - if new_specifier.strip_prefix("./").filter(|s| path.ends_with(Path::new(s))).is_some() { - return if cached_path.is_file(&self.cache.fs, ctx) { - Ok(Some(cached_path.clone())) - } else { - Err(ResolveError::NotFound(new_specifier.to_string())) - }; - } - return Err(ResolveError::Recursion); - } - ctx.with_resolving_alias(new_specifier.to_string()); - ctx.with_fully_specified(false); - let cached_path = self.cache.value(package_json.directory()); - self.require(&cached_path, new_specifier, ctx).map(Some) - } - - /// enhanced-resolve: AliasPlugin for [ResolveOptions::alias] and [ResolveOptions::fallback]. - fn load_alias( - &self, - cached_path: &CachedPath, - specifier: &str, - aliases: &Alias, - ctx: &mut Ctx, - ) -> ResolveResult { - for (alias_key_raw, specifiers) in aliases { - let alias_key = if let Some(alias_key) = alias_key_raw.strip_suffix('$') { - if alias_key != specifier { - continue; - } - alias_key - } else { - let strip_package_name = Self::strip_package_name(specifier, alias_key_raw); - if strip_package_name.is_none() { - continue; - } - alias_key_raw - }; - // It should stop resolving when all of the tried alias values - // failed to resolve. - // - let mut should_stop = false; - for r in specifiers { - match r { - AliasValue::Path(alias_value) => { - if let Some(path) = self.load_alias_value( - cached_path, - alias_key, - alias_value, - specifier, - ctx, - &mut should_stop, - )? { - return Ok(Some(path)); - } - } - AliasValue::Ignore => { - let path = cached_path.path().normalize_with(alias_key); - return Err(ResolveError::Ignored(path)); - } - } - } - if should_stop { - return Err(ResolveError::MatchedAliasNotFound( - specifier.to_string(), - alias_key.to_string(), - )); - } - } - Ok(None) - } - - fn load_alias_value( - &self, - cached_path: &CachedPath, - alias_key: &str, - alias_value: &str, - request: &str, - ctx: &mut Ctx, - should_stop: &mut bool, - ) -> ResolveResult { - if request != alias_value - && !request.strip_prefix(alias_value).is_some_and(|prefix| prefix.starts_with('/')) - { - let tail = &request[alias_key.len()..]; - - let new_specifier = if tail.is_empty() { - Cow::Borrowed(alias_value) - } else { - let alias_value = Path::new(alias_value).normalize(); - // Must not append anything to alias_value if it is a file. - let alias_value_cached_path = self.cache.value(&alias_value); - if alias_value_cached_path.is_file(&self.cache.fs, ctx) { - return Ok(None); - } - - // Remove the leading slash so the final path is concatenated. - let tail = tail.trim_start_matches(SLASH_START); - let normalized = alias_value.normalize_with(tail); - Cow::Owned(normalized.to_string_lossy().to_string()) - }; - - *should_stop = true; - ctx.with_fully_specified(false); - return match self.require(cached_path, new_specifier.as_ref(), ctx) { - Err(ResolveError::NotFound(_) | ResolveError::MatchedAliasNotFound(_, _)) => { - Ok(None) - } - Ok(path) => return Ok(Some(path)), - Err(err) => return Err(err), - }; - } - Ok(None) - } - - /// Given an extension alias map `{".js": [".ts", ".js"]}`, - /// load the mapping instead of the provided extension - /// - /// This is an enhanced-resolve feature - /// - /// # Errors - /// - /// * [ResolveError::ExtensionAlias]: When all of the aliased extensions are not found - fn load_extension_alias(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - if self.options.extension_alias.is_empty() { - return Ok(None); - } - let Some(path_extension) = cached_path.path().extension() else { - return Ok(None); - }; - let Some((_, extensions)) = self - .options - .extension_alias - .iter() - .find(|(ext, _)| OsStr::new(ext.trim_start_matches('.')) == path_extension) - else { - return Ok(None); - }; - let path = cached_path.path().with_extension(""); - let path = path.as_os_str(); - ctx.with_fully_specified(true); - for extension in extensions { - let mut path_with_extension = path.to_os_string(); - path_with_extension.reserve_exact(extension.len()); - path_with_extension.push(extension); - let cached_path = self.cache.value(Path::new(&path_with_extension)); - // Bail if path is module directory such as `ipaddr.js` - if cached_path.is_dir(&self.cache.fs, ctx) { - ctx.with_fully_specified(false); - return Ok(None); - } - if let Some(path) = self.load_alias_or_file(&cached_path, ctx)? { - ctx.with_fully_specified(false); - return Ok(Some(path)); - } - } - Err(ResolveError::ExtensionAlias(cached_path.to_path_buf())) - } - - /// enhanced-resolve: RootsPlugin - /// - /// A list of directories where requests of server-relative URLs (starting with '/') are resolved, - /// defaults to context configuration option. - /// - /// On non-Windows systems these requests are resolved as an absolute path first. - fn load_roots(&self, specifier: &str, ctx: &mut Ctx) -> Option { - if self.options.roots.is_empty() { - return None; - } - if let Some(specifier) = specifier.strip_prefix(SLASH_START) { - for root in &self.options.roots { - let cached_path = self.cache.value(root); - if let Ok(path) = self.require_relative(&cached_path, specifier, ctx) { - return Some(path); - } - } - } - None - } - - fn load_tsconfig_paths( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - let Some(tsconfig_options) = &self.options.tsconfig else { - return Ok(None); - }; - let tsconfig = self.load_tsconfig( - /* root */ true, - &tsconfig_options.config_file, - &tsconfig_options.references, - )?; - let paths = tsconfig.resolve(cached_path.path(), specifier); - for path in paths { - let cached_path = self.cache.value(&path); - if let Ok(path) = self.require_relative(&cached_path, ".", ctx) { - return Ok(Some(path)); - } - } - Ok(None) - } - - fn load_tsconfig( - &self, - root: bool, - path: &Path, - references: &TsconfigReferences, - ) -> Result, ResolveError> { - self.cache.tsconfig(root, path, |tsconfig| { - let directory = self.cache.value(tsconfig.directory()); - tracing::trace!(tsconfig = ?tsconfig, "load_tsconfig"); - - // Extend tsconfig - if let Some(extends) = &tsconfig.extends { - let extended_tsconfig_paths = match extends { - ExtendsField::Single(s) => { - vec![self.get_extended_tsconfig_path(&directory, tsconfig, s)?] - } - ExtendsField::Multiple(specifiers) => specifiers - .iter() - .map(|s| self.get_extended_tsconfig_path(&directory, tsconfig, s)) - .collect::, ResolveError>>()?, - }; - for extended_tsconfig_path in extended_tsconfig_paths { - let extended_tsconfig = self.load_tsconfig( - /* root */ false, - &extended_tsconfig_path, - &TsconfigReferences::Disabled, - )?; - tsconfig.extend_tsconfig(&extended_tsconfig); - } - } - - // Load project references - match references { - TsconfigReferences::Disabled => { - tsconfig.references.drain(..); - } - TsconfigReferences::Auto => {} - TsconfigReferences::Paths(paths) => { - tsconfig.references = paths - .iter() - .map(|path| ProjectReference { path: path.clone(), tsconfig: None }) - .collect(); - } - } - if !tsconfig.references.is_empty() { - let directory = tsconfig.directory().to_path_buf(); - for reference in &mut tsconfig.references { - let reference_tsconfig_path = directory.normalize_with(&reference.path); - let tsconfig = self.cache.tsconfig( - /* root */ true, - &reference_tsconfig_path, - |reference_tsconfig| { - if reference_tsconfig.path == tsconfig.path { - return Err(ResolveError::TsconfigSelfReference( - reference_tsconfig.path.clone(), - )); - } - Ok(()) - }, - )?; - reference.tsconfig.replace(tsconfig); - } - } - Ok(()) - }) - } - - fn get_extended_tsconfig_path( - &self, - directory: &CachedPath, - tsconfig: &TsConfig, - specifier: &str, - ) -> Result { - match specifier.as_bytes().first() { - None => Err(ResolveError::Specifier(SpecifierError::Empty(specifier.to_string()))), - Some(b'/') => Ok(PathBuf::from(specifier)), - Some(b'.') => Ok(tsconfig.directory().normalize_with(specifier)), - _ => self - .clone_with_options(ResolveOptions { - description_files: vec![], - extensions: vec![".json".into()], - main_files: vec!["tsconfig.json".into()], - ..ResolveOptions::default() - }) - .load_package_self_or_node_modules(directory, specifier, &mut Ctx::default()) - .map(|p| p.to_path_buf()) - .map_err(|err| match err { - ResolveError::NotFound(_) => { - ResolveError::TsconfigNotFound(PathBuf::from(specifier)) - } - _ => err, - }), - } - } - - /// PACKAGE_RESOLVE(packageSpecifier, parentURL) - fn package_resolve( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - let (package_name, subpath) = Self::parse_package_specifier(specifier); - - // 3. If packageSpecifier is a Node.js builtin module name, then - // 1. Return the string "node:" concatenated with packageSpecifier. - self.require_core(package_name)?; - - // 11. While parentURL is not the file system root, - for module_name in &self.options.modules { - for cached_path in std::iter::successors(Some(cached_path), |p| p.parent()) { - // 1. Let packageURL be the URL resolution of "node_modules/" concatenated with packageSpecifier, relative to parentURL. - let Some(cached_path) = self.get_module_directory(cached_path, module_name, ctx) - else { - continue; - }; - // 2. Set parentURL to the parent folder URL of parentURL. - let package_path = cached_path.path().normalize_with(package_name); - let cached_path = self.cache.value(&package_path); - // 3. If the folder at packageURL does not exist, then - // 1. Continue the next loop iteration. - if cached_path.is_dir(&self.cache.fs, ctx) { - // 4. Let pjson be the result of READ_PACKAGE_JSON(packageURL). - if let Some(package_json) = - cached_path.package_json(&self.cache.fs, &self.options, ctx)? - { - // 5. If pjson is not null and pjson.exports is not null or undefined, then - // 1. Return the result of PACKAGE_EXPORTS_RESOLVE(packageURL, packageSubpath, pjson.exports, defaultConditions). - for exports in package_json.exports_fields(&self.options.exports_fields) { - if let Some(path) = self.package_exports_resolve( - cached_path.path(), - &format!(".{subpath}"), - exports, - ctx, - )? { - return Ok(Some(path)); - } - } - // 6. Otherwise, if packageSubpath is equal to ".", then - if subpath == "." { - // 1. If pjson.main is a string, then - for main_field in package_json.main_fields(&self.options.main_fields) { - // 1. Return the URL resolution of main in packageURL. - let path = cached_path.path().normalize_with(main_field); - let cached_path = self.cache.value(&path); - if cached_path.is_file(&self.cache.fs, ctx) { - return Ok(Some(cached_path)); - } - } - } - } - let subpath = format!(".{subpath}"); - ctx.with_fully_specified(false); - return self.require(&cached_path, &subpath, ctx).map(Some); - } - } - } - - Err(ResolveError::NotFound(specifier.to_string())) - } - - /// PACKAGE_EXPORTS_RESOLVE(packageURL, subpath, exports, conditions) - fn package_exports_resolve( - &self, - package_url: &Path, - subpath: &str, - exports: &JSONValue, - ctx: &mut Ctx, - ) -> ResolveResult { - let conditions = &self.options.condition_names; - // 1. If exports is an Object with both a key starting with "." and a key not starting with ".", throw an Invalid Package Configuration error. - if let JSONValue::Object(map) = exports { - let mut has_dot = false; - let mut without_dot = false; - for key in map.keys() { - let starts_with_dot_or_hash = key.starts_with(['.', '#']); - has_dot = has_dot || starts_with_dot_or_hash; - without_dot = without_dot || !starts_with_dot_or_hash; - if has_dot && without_dot { - return Err(ResolveError::InvalidPackageConfig( - package_url.join("package.json"), - )); - } - } - } - // 2. If subpath is equal to ".", then - // Note: subpath is not prepended with a dot when passed in. - if subpath == "." { - // enhanced-resolve appends query and fragment when resolving exports field - // https://github.com/webpack/enhanced-resolve/blob/a998c7d218b7a9ec2461fc4fddd1ad5dd7687485/lib/ExportsFieldPlugin.js#L57-L62 - // This is only need when querying the main export, otherwise ctx is passed through. - if ctx.query.is_some() || ctx.fragment.is_some() { - let query = ctx.query.clone().unwrap_or_default(); - let fragment = ctx.fragment.clone().unwrap_or_default(); - return Err(ResolveError::PackagePathNotExported( - format!("./{}{query}{fragment}", subpath.trim_start_matches('.')), - package_url.join("package.json"), - )); - } - // 1. Let mainExport be undefined. - let main_export = match exports { - // 2. If exports is a String or Array, or an Object containing no keys starting with ".", then - JSONValue::String(_) | JSONValue::Array(_) => { - // 1. Set mainExport to exports. - Some(exports) - } - // 3. Otherwise if exports is an Object containing a "." property, then - JSONValue::Object(map) => { - // 1. Set mainExport to exports["."]. - map.get(".").map_or_else( - || { - if map.keys().any(|key| key.starts_with("./") || key.starts_with('#')) { - None - } else { - Some(exports) - } - }, - Some, - ) - } - _ => None, - }; - // 4. If mainExport is not undefined, then - if let Some(main_export) = main_export { - // 1. Let resolved be the result of PACKAGE_TARGET_RESOLVE( packageURL, mainExport, null, false, conditions). - let resolved = self.package_target_resolve( - package_url, - ".", - main_export, - None, - /* is_imports */ false, - conditions, - ctx, - )?; - // 2. If resolved is not null or undefined, return resolved. - if let Some(path) = resolved { - return Ok(Some(path)); - } - } - } - // 3. Otherwise, if exports is an Object and all keys of exports start with ".", then - if let JSONValue::Object(exports) = exports { - // 1. Let matchKey be the string "./" concatenated with subpath. - // Note: `package_imports_exports_resolve` does not require the leading dot. - let match_key = &subpath; - // 2. Let resolved be the result of PACKAGE_IMPORTS_EXPORTS_RESOLVE( matchKey, exports, packageURL, false, conditions). - if let Some(path) = self.package_imports_exports_resolve( - match_key, - exports, - package_url, - /* is_imports */ false, - conditions, - ctx, - )? { - // 3. If resolved is not null or undefined, return resolved. - return Ok(Some(path)); - } - } - // 4. Throw a Package Path Not Exported error. - Err(ResolveError::PackagePathNotExported( - subpath.to_string(), - package_url.join("package.json"), - )) - } - - /// PACKAGE_IMPORTS_RESOLVE(specifier, parentURL, conditions) - fn package_imports_resolve( - &self, - specifier: &str, - package_json: &PackageJson, - ctx: &mut Ctx, - ) -> Result, ResolveError> { - // 1. Assert: specifier begins with "#". - debug_assert!(specifier.starts_with('#'), "{specifier}"); - // 2. If specifier is exactly equal to "#" or starts with "#/", then - // 1. Throw an Invalid Module Specifier error. - // 3. Let packageURL be the result of LOOKUP_PACKAGE_SCOPE(parentURL). - // 4. If packageURL is not null, then - - // 1. Let pjson be the result of READ_PACKAGE_JSON(packageURL). - // 2. If pjson.imports is a non-null Object, then - - // 1. Let resolved be the result of PACKAGE_IMPORTS_EXPORTS_RESOLVE( specifier, pjson.imports, packageURL, true, conditions). - let mut has_imports = false; - for imports in package_json.imports_fields(&self.options.imports_fields) { - if !has_imports { - has_imports = true; - // TODO: fill in test case for this case - if specifier == "#" || specifier.starts_with("#/") { - return Err(ResolveError::InvalidModuleSpecifier( - specifier.to_string(), - package_json.path.clone(), - )); - } - } - if let Some(path) = self.package_imports_exports_resolve( - specifier, - imports, - package_json.directory(), - /* is_imports */ true, - &self.options.condition_names, - ctx, - )? { - // 2. If resolved is not null or undefined, return resolved. - return Ok(Some(path)); - } - } - - // 5. Throw a Package Import Not Defined error. - if has_imports { - Err(ResolveError::PackageImportNotDefined( - specifier.to_string(), - package_json.path.clone(), - )) - } else { - Ok(None) - } - } - - /// PACKAGE_IMPORTS_EXPORTS_RESOLVE(matchKey, matchObj, packageURL, isImports, conditions) - fn package_imports_exports_resolve( - &self, - match_key: &str, - match_obj: &JSONMap, - package_url: &Path, - is_imports: bool, - conditions: &[String], - ctx: &mut Ctx, - ) -> ResolveResult { - // enhanced-resolve behaves differently, it throws - // Error: CachedPath to directories is not possible with the exports field (specifier was ./dist/) - if match_key.ends_with('/') { - return Ok(None); - } - // 1. If matchKey is a key of matchObj and does not contain "*", then - if !match_key.contains('*') { - // 1. Let target be the value of matchObj[matchKey]. - if let Some(target) = match_obj.get(match_key) { - // 2. Return the result of PACKAGE_TARGET_RESOLVE(packageURL, target, null, isImports, conditions). - return self.package_target_resolve( - package_url, - match_key, - target, - None, - is_imports, - conditions, - ctx, - ); - } - } - - let mut best_target = None; - let mut best_match = ""; - let mut best_key = ""; - // 2. Let expansionKeys be the list of keys of matchObj containing only a single "*", sorted by the sorting function PATTERN_KEY_COMPARE which orders in descending order of specificity. - // 3. For each key expansionKey in expansionKeys, do - for (expansion_key, target) in match_obj { - if expansion_key.starts_with("./") || expansion_key.starts_with('#') { - // 1. Let patternBase be the substring of expansionKey up to but excluding the first "*" character. - if let Some((pattern_base, pattern_trailer)) = expansion_key.split_once('*') { - // 2. If matchKey starts with but is not equal to patternBase, then - if match_key.starts_with(pattern_base) - // 1. Let patternTrailer be the substring of expansionKey from the index after the first "*" character. - && !pattern_trailer.contains('*') - // 2. If patternTrailer has zero length, or if matchKey ends with patternTrailer and the length of matchKey is greater than or equal to the length of expansionKey, then - && (pattern_trailer.is_empty() - || (match_key.len() >= expansion_key.len() - && match_key.ends_with(pattern_trailer))) - && Self::pattern_key_compare(best_key, expansion_key).is_gt() - { - // 1. Let target be the value of matchObj[expansionKey]. - best_target = Some(target); - // 2. Let patternMatch be the substring of matchKey starting at the index of the length of patternBase up to the length of matchKey minus the length of patternTrailer. - best_match = - &match_key[pattern_base.len()..match_key.len() - pattern_trailer.len()]; - best_key = expansion_key; - } - } else if expansion_key.ends_with('/') - && match_key.starts_with(expansion_key) - && Self::pattern_key_compare(best_key, expansion_key).is_gt() - { - // TODO: [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./dist/" in the "exports" field module resolution of the package at xxx/package.json. - best_target = Some(target); - best_match = &match_key[expansion_key.len()..]; - best_key = expansion_key; - } - } - } - if let Some(best_target) = best_target { - // 3. Return the result of PACKAGE_TARGET_RESOLVE(packageURL, target, patternMatch, isImports, conditions). - return self.package_target_resolve( - package_url, - best_key, - best_target, - Some(best_match), - is_imports, - conditions, - ctx, - ); - } - // 4. Return null. - Ok(None) - } - - /// PACKAGE_TARGET_RESOLVE(packageURL, target, patternMatch, isImports, conditions) - #[allow(clippy::too_many_arguments)] - fn package_target_resolve( - &self, - package_url: &Path, - target_key: &str, - target: &JSONValue, - pattern_match: Option<&str>, - is_imports: bool, - conditions: &[String], - ctx: &mut Ctx, - ) -> ResolveResult { - fn normalize_string_target<'a>( - target_key: &'a str, - target: &'a str, - pattern_match: Option<&'a str>, - package_url: &Path, - ) -> Result, ResolveError> { - let target = if let Some(pattern_match) = pattern_match { - if !target_key.contains('*') && !target.contains('*') { - // enhanced-resolve behaviour - // TODO: [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./dist/" in the "exports" field module resolution of the package at xxx/package.json. - if target_key.ends_with('/') && target.ends_with('/') { - Cow::Owned(format!("{target}{pattern_match}")) - } else { - return Err(ResolveError::InvalidPackageConfigDirectory( - package_url.join("package.json"), - )); - } - } else { - Cow::Owned(target.replace('*', pattern_match)) - } - } else { - Cow::Borrowed(target) - }; - Ok(target) - } - - match target { - // 1. If target is a String, then - JSONValue::String(target) => { - // 1. If target does not start with "./", then - if !target.starts_with("./") { - // 1. If isImports is false, or if target starts with "../" or "/", or if target is a valid URL, then - if !is_imports || target.starts_with("../") || target.starts_with('/') { - // 1. Throw an Invalid Package Target error. - return Err(ResolveError::InvalidPackageTarget( - target.to_string(), - target_key.to_string(), - package_url.join("package.json"), - )); - } - // 2. If patternMatch is a String, then - // 1. Return PACKAGE_RESOLVE(target with every instance of "*" replaced by patternMatch, packageURL + "/"). - let target = - normalize_string_target(target_key, target, pattern_match, package_url)?; - let package_url = self.cache.value(package_url); - // // 3. Return PACKAGE_RESOLVE(target, packageURL + "/"). - return self.package_resolve(&package_url, &target, ctx); - } - - // 2. If target split on "/" or "\" contains any "", ".", "..", or "node_modules" segments after the first "." segment, case insensitive and including percent encoded variants, throw an Invalid Package Target error. - // 3. Let resolvedTarget be the URL resolution of the concatenation of packageURL and target. - // 4. Assert: resolvedTarget is contained in packageURL. - // 5. If patternMatch is null, then - let target = - normalize_string_target(target_key, target, pattern_match, package_url)?; - if Path::new(target.as_ref()).is_invalid_exports_target() { - return Err(ResolveError::InvalidPackageTarget( - target.to_string(), - target_key.to_string(), - package_url.join("package.json"), - )); - } - let resolved_target = package_url.normalize_with(target.as_ref()); - // 6. If patternMatch split on "/" or "\" contains any "", ".", "..", or "node_modules" segments, case insensitive and including percent encoded variants, throw an Invalid Module Specifier error. - // 7. Return the URL resolution of resolvedTarget with every instance of "*" replaced with patternMatch. - let value = self.cache.value(&resolved_target); - return Ok(Some(value)); - } - // 2. Otherwise, if target is a non-null Object, then - JSONValue::Object(target) => { - // 1. If exports contains any index property keys, as defined in ECMA-262 6.1.7 Array Index, throw an Invalid Package Configuration error. - // 2. For each property p of target, in object insertion order as, - for (key, target_value) in target { - // 1. If p equals "default" or conditions contains an entry for p, then - if key == "default" || conditions.contains(key) { - // 1. Let targetValue be the value of the p property in target. - // 2. Let resolved be the result of PACKAGE_TARGET_RESOLVE( packageURL, targetValue, patternMatch, isImports, conditions). - let resolved = self.package_target_resolve( - package_url, - target_key, - target_value, - pattern_match, - is_imports, - conditions, - ctx, - ); - // 3. If resolved is equal to undefined, continue the loop. - if let Some(path) = resolved? { - // 4. Return resolved. - return Ok(Some(path)); - } - } - } - // 3. Return undefined. - return Ok(None); - } - // 3. Otherwise, if target is an Array, then - JSONValue::Array(targets) => { - // 1. If _target.length is zero, return null. - if targets.is_empty() { - // Note: return PackagePathNotExported has the same effect as return because there are no matches. - return Err(ResolveError::PackagePathNotExported( - pattern_match.unwrap_or(".").to_string(), - package_url.join("package.json"), - )); - } - // 2. For each item targetValue in target, do - for (i, target_value) in targets.iter().enumerate() { - // 1. Let resolved be the result of PACKAGE_TARGET_RESOLVE( packageURL, targetValue, patternMatch, isImports, conditions), continuing the loop on any Invalid Package Target error. - let resolved = self.package_target_resolve( - package_url, - target_key, - target_value, - pattern_match, - is_imports, - conditions, - ctx, - ); - - if resolved.is_err() && i == targets.len() { - return resolved; - } - - // 2. If resolved is undefined, continue the loop. - if let Ok(Some(path)) = resolved { - // 3. Return resolved. - return Ok(Some(path)); - } - } - // 3. Return or throw the last fallback resolution null return or error. - // Note: see `resolved.is_err() && i == targets.len()` - } - _ => {} - } - // 4. Otherwise, if target is null, return null. - Ok(None) - // 5. Otherwise throw an Invalid Package Target error. - } - - // Returns (module, subpath) - // https://github.com/nodejs/node/blob/8f0f17e1e3b6c4e58ce748e06343c5304062c491/lib/internal/modules/esm/resolve.js#L688 - fn parse_package_specifier(specifier: &str) -> (&str, &str) { - let mut separator_index = specifier.as_bytes().iter().position(|b| *b == b'/'); - // let mut valid_package_name = true; - // let mut is_scoped = false; - if specifier.starts_with('@') { - // is_scoped = true; - if separator_index.is_none() || specifier.is_empty() { - // valid_package_name = false; - } else if let Some(index) = &separator_index { - separator_index = specifier[*index + 1..] - .as_bytes() - .iter() - .position(|b| *b == b'/') - .map(|i| i + *index + 1); - } - } - let package_name = - separator_index.map_or(specifier, |separator_index| &specifier[..separator_index]); - - // TODO: https://github.com/nodejs/node/blob/8f0f17e1e3b6c4e58ce748e06343c5304062c491/lib/internal/modules/esm/resolve.js#L705C1-L714C1 - // Package name cannot have leading . and cannot have percent-encoding or - // \\ separators. - // if (RegExpPrototypeExec(invalidPackageNameRegEx, packageName) !== null) - // validPackageName = false; - - // if (!validPackageName) { - // throw new ERR_INVALID_MODULE_SPECIFIER( - // specifier, 'is not a valid package name', fileURLToPath(base)); - // } - let package_subpath = - separator_index.map_or("", |separator_index| &specifier[separator_index..]); - (package_name, package_subpath) - } - - /// PATTERN_KEY_COMPARE(keyA, keyB) - fn pattern_key_compare(key_a: &str, key_b: &str) -> Ordering { - if key_a.is_empty() { - return Ordering::Greater; - } - // 1. Assert: keyA ends with "/" or contains only a single "*". - debug_assert!(key_a.ends_with('/') || key_a.match_indices('*').count() == 1, "{key_a}"); - // 2. Assert: keyB ends with "/" or contains only a single "*". - debug_assert!(key_b.ends_with('/') || key_b.match_indices('*').count() == 1, "{key_b}"); - // 3. Let baseLengthA be the index of "*" in keyA plus one, if keyA contains "*", or the length of keyA otherwise. - let a_pos = key_a.chars().position(|c| c == '*'); - let base_length_a = a_pos.map_or(key_a.len(), |p| p + 1); - // 4. Let baseLengthB be the index of "*" in keyB plus one, if keyB contains "*", or the length of keyB otherwise. - let b_pos = key_b.chars().position(|c| c == '*'); - let base_length_b = b_pos.map_or(key_b.len(), |p| p + 1); - // 5. If baseLengthA is greater than baseLengthB, return -1. - if base_length_a > base_length_b { - return Ordering::Less; - } - // 6. If baseLengthB is greater than baseLengthA, return 1. - if base_length_b > base_length_a { - return Ordering::Greater; - } - // 7. If keyA does not contain "*", return 1. - if !key_a.contains('*') { - return Ordering::Greater; - } - // 8. If keyB does not contain "*", return -1. - if !key_b.contains('*') { - return Ordering::Less; - } - // 9. If the length of keyA is greater than the length of keyB, return -1. - if key_a.len() > key_b.len() { - return Ordering::Less; - } - // 10. If the length of keyB is greater than the length of keyA, return 1. - if key_b.len() > key_a.len() { - return Ordering::Greater; - } - // 11. Return 0. - Ordering::Equal - } - - fn strip_package_name<'a>(specifier: &'a str, package_name: &'a str) -> Option<&'a str> { - specifier - .strip_prefix(package_name) - .filter(|tail| tail.is_empty() || tail.starts_with(SLASH_START)) - } -} diff --git a/src/options.rs b/src/options.rs deleted file mode 100644 index 7893890e..00000000 --- a/src/options.rs +++ /dev/null @@ -1,633 +0,0 @@ -use std::path::Path; -use std::{fmt, path::PathBuf}; - -/// Module Resolution Options -/// -/// Options are directly ported from [enhanced-resolve](https://github.com/webpack/enhanced-resolve#resolver-options). -/// -/// See [webpack resolve](https://webpack.js.org/configuration/resolve/) for information and examples -#[derive(Debug, Clone)] -pub struct ResolveOptions { - /// Path to TypeScript configuration file. - /// - /// Default `None` - pub tsconfig: Option, - - /// Create aliases to import or require certain modules more easily. - /// - /// An alias is used to replace a whole path or part of a path. - /// For example, to alias a commonly used `src/` folders: `vec![("@/src"), vec![AliasValue::Path("/path/to/src")]]` - /// - /// A trailing $ can also be added to the given object's keys to signify an exact match. - /// - /// See [webpack's `resolve.alias` documentation](https://webpack.js.org/configuration/resolve/#resolvealias) for a list of use cases. - pub alias: Alias, - - /// A list of alias fields in description files. - /// - /// Specify a field, such as `browser`, to be parsed according to [this specification](https://github.com/defunctzombie/package-browser-field-spec). - /// Can be a path to json object such as `["path", "to", "exports"]`. - /// - /// Default `[]` - pub alias_fields: Vec>, - - /// Condition names for exports field which defines entry points of a package. - /// - /// The key order in the exports field is significant. During condition matching, earlier entries have higher priority and take precedence over later entries. - /// - /// Default `[]` - pub condition_names: Vec, - - /// The JSON files to use for descriptions. (There was once a `bower.json`.) - /// - /// Default `["package.json"]` - pub description_files: Vec, - - /// Set to [EnforceExtension::Enabled] for [ESM Mandatory file extensions](https://nodejs.org/api/esm.html#mandatory-file-extensions). - /// - /// If `enforce_extension` is set to [EnforceExtension::Enabled], resolution will not allow extension-less files. - /// This means `require('./foo.js')` will resolve, while `require('./foo')` will not. - /// - /// The default value for `enforce_extension` is [EnforceExtension::Auto], which is changed upon initialization. - /// - /// It changes to [EnforceExtension::Enabled] if [ResolveOptions::extensions] contains an empty string; - /// otherwise, this value changes to [EnforceExtension::Disabled]. - /// - /// Explicitly set the value to [EnforceExtension::Disabled] to disable this automatic behavior. - /// - /// For reference, this behavior is aligned with `enhanced-resolve`. See . - pub enforce_extension: EnforceExtension, - - /// A list of exports fields in description files. - /// - /// Can be a path to a JSON object such as `["path", "to", "exports"]`. - /// - /// Default `[["exports"]]`. - pub exports_fields: Vec>, - - /// Fields from `package.json` which are used to provide the internal requests of a package - /// (requests starting with # are considered internal). - /// - /// Can be a path to a JSON object such as `["path", "to", "imports"]`. - /// - /// Default `[["imports"]]`. - pub imports_fields: Vec>, - - /// An object which maps extension to extension aliases. - /// - /// Default `{}` - pub extension_alias: Vec<(String, Vec)>, - - /// Attempt to resolve these extensions in order. - /// - /// If multiple files share the same name but have different extensions, - /// will resolve the one with the extension listed first in the array and skip the rest. - /// - /// All extensions must have a leading dot. - /// - /// Default `[".js", ".json", ".node"]` - pub extensions: Vec, - - /// Redirect module requests when normal resolving fails. - /// - /// Default `[]` - pub fallback: Alias, - - /// 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). - /// - /// See also webpack configuration [resolve.fullySpecified](https://webpack.js.org/configuration/module/#resolvefullyspecified) - /// - /// Default `false` - pub fully_specified: bool, - - /// A list of main fields in description files - /// - /// Default `["main"]`. - pub main_fields: Vec, - - /// The filename to be used while resolving directories. - /// - /// Default `["index"]` - pub main_files: Vec, - - /// A list of directories to resolve modules from, can be absolute path or folder name. - /// - /// Default `["node_modules"]` - pub modules: Vec, - - /// A manifest loaded from pnp::load_pnp_manifest. - /// - /// Default `None` - #[cfg(feature = "yarn_pnp")] - pub pnp_manifest: Option, - - /// Resolve to a context instead of a file. - /// - /// Default `false` - pub resolve_to_context: bool, - - /// Prefer to resolve module requests as relative requests instead of using modules from node_modules directories. - /// - /// Default `false` - pub prefer_relative: bool, - - /// Prefer to resolve server-relative urls as absolute paths before falling back to resolve in ResolveOptions::roots. - /// - /// Default `false` - pub prefer_absolute: bool, - - /// A list of resolve restrictions to restrict the paths that a request can be resolved on. - /// - /// Default `[]` - pub restrictions: Vec, - - /// A list of directories where requests of server-relative URLs (starting with '/') are resolved. - /// On non-Windows systems these requests are resolved as an absolute path first. - /// - /// Default `[]` - pub roots: Vec, - - /// Whether to resolve symlinks to their symlinked location. - /// When enabled, symlinked resources are resolved to their real path, not their symlinked location. - /// Note that this may cause module resolution to fail when using tools that symlink packages (like npm link). - /// - /// Default `true` - pub symlinks: bool, - - /// Whether to parse [module.builtinModules](https://nodejs.org/api/module.html#modulebuiltinmodules) or not. - /// For example, "zlib" will throw [crate::ResolveError::Builtin] when set to true. - /// - /// Default `false` - pub builtin_modules: bool, -} - -impl ResolveOptions { - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// - /// let options = ResolveOptions::default().with_condition_names(&["bar"]); - /// assert_eq!(options.condition_names, vec!["bar".to_string()]) - /// ``` - #[must_use] - pub fn with_condition_names(mut self, names: &[&str]) -> Self { - self.condition_names = names.iter().map(ToString::to_string).collect::>(); - self - } - - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// - /// let options = ResolveOptions::default().with_builtin_modules(false); - /// assert_eq!(options.builtin_modules, false) - /// ``` - #[must_use] - pub fn with_builtin_modules(mut self, flag: bool) -> Self { - self.builtin_modules = flag; - self - } - - /// Adds a single root to the options - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_root("foo"); - /// assert_eq!(options.roots, vec![PathBuf::from("foo")]) - /// ``` - #[must_use] - pub fn with_root>(mut self, root: P) -> Self { - self.roots.push(root.as_ref().to_path_buf()); - self - } - - /// Adds a single extension to the list of extensions - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_extension("jsonc"); - /// assert!(options.extensions.contains(&"jsonc".to_string())); - /// ``` - #[must_use] - pub fn with_extension>(mut self, extension: S) -> Self { - self.extensions.push(extension.into()); - self - } - - /// Adds a single main field to the list of fields - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_main_field("something"); - /// assert!(options.main_fields.contains(&"something".to_string())); - /// ``` - #[must_use] - pub fn with_main_field>(mut self, field: S) -> Self { - self.main_fields.push(field.into()); - self - } - - /// Changes how the extension should be treated - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions, EnforceExtension}; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_force_extension(EnforceExtension::Enabled); - /// assert_eq!(options.enforce_extension, EnforceExtension::Enabled); - /// ``` - #[must_use] - pub fn with_force_extension(mut self, enforce_extension: EnforceExtension) -> Self { - self.enforce_extension = enforce_extension; - self - } - - /// Sets the value for [ResolveOptions::fully_specified] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_fully_specified(true); - /// assert_eq!(options.fully_specified, true); - /// ``` - #[must_use] - pub fn with_fully_specified(mut self, fully_specified: bool) -> Self { - self.fully_specified = fully_specified; - self - } - /// Sets the value for [ResolveOptions::prefer_relative] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_prefer_relative(true); - /// assert_eq!(options.prefer_relative, true); - /// ``` - #[must_use] - pub fn with_prefer_relative(mut self, flag: bool) -> Self { - self.prefer_relative = flag; - self - } - /// Sets the value for [ResolveOptions::prefer_absolute] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_prefer_absolute(true); - /// assert_eq!(options.prefer_absolute, true); - /// ``` - #[must_use] - pub fn with_prefer_absolute(mut self, flag: bool) -> Self { - self.prefer_absolute = flag; - self - } - - /// Changes the value of [ResolveOptions::symlinks] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// - /// let options = ResolveOptions::default().with_symbolic_link(false); - /// assert_eq!(options.symlinks, false); - /// ``` - #[must_use] - pub fn with_symbolic_link(mut self, flag: bool) -> Self { - self.symlinks = flag; - self - } - - /// Adds a module to [ResolveOptions::modules] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// - /// let options = ResolveOptions::default().with_module("module"); - /// assert!(options.modules.contains(&"module".to_string())); - /// ``` - #[must_use] - pub fn with_module>(mut self, module: M) -> Self { - self.modules.push(module.into()); - self - } - - /// Adds a main file to [ResolveOptions::main_files] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// - /// let options = ResolveOptions::default().with_main_file("foo"); - /// assert!(options.main_files.contains(&"foo".to_string())); - /// ``` - #[must_use] - pub fn with_main_file>(mut self, module: M) -> Self { - self.main_files.push(module.into()); - self - } - - pub(crate) fn sanitize(mut self) -> Self { - debug_assert!( - self.extensions.iter().filter(|e| !e.is_empty()).all(|e| e.starts_with('.')), - "All extensions must start with a leading dot" - ); - // Set `enforceExtension` to `true` when [ResolveOptions::extensions] contains an empty string. - // See - if self.enforce_extension == EnforceExtension::Auto { - if !self.extensions.is_empty() && self.extensions.iter().any(String::is_empty) { - self.enforce_extension = EnforceExtension::Enabled; - } else { - self.enforce_extension = EnforceExtension::Disabled; - } - } - self - } -} - -/// Value for [ResolveOptions::enforce_extension] -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -pub enum EnforceExtension { - Auto, - Enabled, - Disabled, -} - -impl EnforceExtension { - pub const fn is_auto(&self) -> bool { - matches!(self, Self::Auto) - } - - pub const fn is_enabled(&self) -> bool { - matches!(self, Self::Enabled) - } - - pub const fn is_disabled(&self) -> bool { - matches!(self, Self::Disabled) - } -} - -/// Alias for [ResolveOptions::alias] and [ResolveOptions::fallback] -pub type Alias = Vec<(String, Vec)>; - -/// Alias Value for [ResolveOptions::alias] and [ResolveOptions::fallback] -#[derive(Debug, Clone, Hash, PartialEq, Eq)] -pub enum AliasValue { - /// The path value - Path(String), - - /// The `false` value - Ignore, -} - -impl From for AliasValue -where - S: Into, -{ - fn from(value: S) -> Self { - Self::Path(value.into()) - } -} - -/// Value for [ResolveOptions::restrictions] -#[derive(Debug, Clone)] -pub enum Restriction { - Path(PathBuf), - RegExp(String), -} - -/// Tsconfig Options for [ResolveOptions::tsconfig] -/// -/// Derived from [tsconfig-paths-webpack-plugin](https://github.com/dividab/tsconfig-paths-webpack-plugin#options) -#[derive(Debug, Clone)] -pub struct TsconfigOptions { - /// Allows you to specify where to find the TypeScript configuration file. - /// You may provide - /// * a relative path to the configuration file. It will be resolved relative to cwd. - /// * an absolute path to the configuration file. - pub config_file: PathBuf, - - /// Support for Typescript Project References. - pub references: TsconfigReferences, -} - -/// Configuration for [TsconfigOptions::references] -#[derive(Debug, Clone)] -pub enum TsconfigReferences { - Disabled, - /// Use the `references` field from tsconfig of `config_file`. - Auto, - /// Manually provided relative or absolute path. - Paths(Vec), -} - -impl Default for ResolveOptions { - fn default() -> Self { - Self { - tsconfig: None, - alias: vec![], - alias_fields: vec![], - condition_names: vec![], - description_files: vec!["package.json".into()], - enforce_extension: EnforceExtension::Auto, - extension_alias: vec![], - exports_fields: vec![vec!["exports".into()]], - imports_fields: vec![vec!["imports".into()]], - extensions: vec![".js".into(), ".json".into(), ".node".into()], - fallback: vec![], - fully_specified: false, - main_fields: vec!["main".into()], - main_files: vec!["index".into()], - modules: vec!["node_modules".into()], - #[cfg(feature = "yarn_pnp")] - pnp_manifest: None, - resolve_to_context: false, - prefer_relative: false, - prefer_absolute: false, - restrictions: vec![], - roots: vec![], - symlinks: true, - builtin_modules: false, - } - } -} - -// For tracing -impl fmt::Display for ResolveOptions { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - if let Some(tsconfig) = &self.tsconfig { - write!(f, "tsconfig:{tsconfig:?},")?; - } - if !self.alias.is_empty() { - write!(f, "alias:{:?},", self.alias)?; - } - if !self.alias_fields.is_empty() { - write!(f, "alias_fields:{:?},", self.alias_fields)?; - } - if !self.condition_names.is_empty() { - write!(f, "condition_names:{:?},", self.condition_names)?; - } - if self.enforce_extension.is_enabled() { - write!(f, "enforce_extension:{:?},", self.enforce_extension)?; - } - if !self.exports_fields.is_empty() { - write!(f, "exports_fields:{:?},", self.exports_fields)?; - } - if !self.imports_fields.is_empty() { - write!(f, "imports_fields:{:?},", self.imports_fields)?; - } - if !self.extension_alias.is_empty() { - write!(f, "extension_alias:{:?},", self.extension_alias)?; - } - if !self.extensions.is_empty() { - write!(f, "extensions:{:?},", self.extensions)?; - } - if !self.fallback.is_empty() { - write!(f, "fallback:{:?},", self.fallback)?; - } - if self.fully_specified { - write!(f, "fully_specified:{:?},", self.fully_specified)?; - } - if !self.main_fields.is_empty() { - write!(f, "main_fields:{:?},", self.main_fields)?; - } - if !self.main_files.is_empty() { - write!(f, "main_files:{:?},", self.main_files)?; - } - if !self.modules.is_empty() { - write!(f, "modules:{:?},", self.modules)?; - } - if self.resolve_to_context { - write!(f, "resolve_to_context:{:?},", self.resolve_to_context)?; - } - if self.prefer_relative { - write!(f, "prefer_relative:{:?},", self.prefer_relative)?; - } - if self.prefer_absolute { - write!(f, "prefer_absolute:{:?},", self.prefer_absolute)?; - } - if !self.restrictions.is_empty() { - write!(f, "restrictions:{:?},", self.restrictions)?; - } - if !self.roots.is_empty() { - write!(f, "roots:{:?},", self.roots)?; - } - if self.symlinks { - write!(f, "symlinks:{:?},", self.symlinks)?; - } - if self.builtin_modules { - write!(f, "builtin_modules:{:?},", self.builtin_modules)?; - } - Ok(()) - } -} - -#[cfg(test)] -mod test { - use super::{ - AliasValue, EnforceExtension, ResolveOptions, Restriction, TsconfigOptions, - TsconfigReferences, - }; - use std::path::PathBuf; - - #[test] - fn enforce_extension() { - assert!(EnforceExtension::Auto.is_auto()); - assert!(!EnforceExtension::Enabled.is_auto()); - assert!(!EnforceExtension::Disabled.is_auto()); - - assert!(!EnforceExtension::Auto.is_enabled()); - assert!(EnforceExtension::Enabled.is_enabled()); - assert!(!EnforceExtension::Disabled.is_enabled()); - - assert!(!EnforceExtension::Auto.is_disabled()); - assert!(!EnforceExtension::Enabled.is_disabled()); - assert!(EnforceExtension::Disabled.is_disabled()); - } - - #[test] - fn display() { - let options = ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: PathBuf::from("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - alias: vec![("a".into(), vec![AliasValue::Ignore])], - alias_fields: vec![vec!["browser".into()]], - condition_names: vec!["require".into()], - enforce_extension: EnforceExtension::Enabled, - extension_alias: vec![(".js".into(), vec![".ts".into()])], - exports_fields: vec![vec!["exports".into()]], - imports_fields: vec![vec!["imports".into()]], - fallback: vec![("fallback".into(), vec![AliasValue::Ignore])], - fully_specified: true, - resolve_to_context: true, - prefer_relative: true, - prefer_absolute: true, - restrictions: vec![Restriction::Path(PathBuf::from("restrictions"))], - roots: vec![PathBuf::from("roots")], - builtin_modules: true, - ..ResolveOptions::default() - }; - - let expected = r#"tsconfig:TsconfigOptions { config_file: "tsconfig.json", references: Auto },alias:[("a", [Ignore])],alias_fields:[["browser"]],condition_names:["require"],enforce_extension:Enabled,exports_fields:[["exports"]],imports_fields:[["imports"]],extension_alias:[(".js", [".ts"])],extensions:[".js", ".json", ".node"],fallback:[("fallback", [Ignore])],fully_specified:true,main_fields:["main"],main_files:["index"],modules:["node_modules"],resolve_to_context:true,prefer_relative:true,prefer_absolute:true,restrictions:[Path("restrictions")],roots:["roots"],symlinks:true,builtin_modules:true,"#; - assert_eq!(format!("{options}"), expected); - - let options = ResolveOptions { - alias: vec![], - alias_fields: vec![], - builtin_modules: false, - condition_names: vec![], - description_files: vec![], - enforce_extension: EnforceExtension::Disabled, - exports_fields: vec![], - extension_alias: vec![], - extensions: vec![], - fallback: vec![], - fully_specified: false, - imports_fields: vec![], - main_fields: vec![], - main_files: vec![], - modules: vec![], - #[cfg(feature = "yarn_pnp")] - pnp_manifest: None, - prefer_absolute: false, - prefer_relative: false, - resolve_to_context: false, - restrictions: vec![], - roots: vec![], - symlinks: false, - tsconfig: None, - }; - - assert_eq!(format!("{options}"), ""); - } -} diff --git a/src/package_json.rs b/src/package_json.rs deleted file mode 100644 index 7e05d202..00000000 --- a/src/package_json.rs +++ /dev/null @@ -1,219 +0,0 @@ -//! package.json definitions -//! -//! Code related to export field are copied from [Parcel's resolver](https://github.com/parcel-bundler/parcel/blob/v2/packages/utils/node-resolver-rs/src/package_json.rs) -use std::path::{Path, PathBuf}; - -use serde_json::Value as JSONValue; - -use crate::{path::PathUtil, ResolveError}; - -pub type JSONMap = serde_json::Map; - -/// Deserialized package.json -#[derive(Debug, Default)] -pub struct PackageJson { - /// Path to `package.json`. Contains the `package.json` filename. - pub path: PathBuf, - - /// Realpath to `package.json`. Contains the `package.json` filename. - pub realpath: PathBuf, - - /// The "name" field defines your package's name. - /// The "name" field can be used in addition to the "exports" field to self-reference a package using its name. - /// - /// - pub name: Option, - - /// The "type" field. - /// - /// - pub r#type: Option, - - /// The "sideEffects" field. - /// - /// - pub side_effects: Option, - - raw_json: std::sync::Arc, -} - -impl PackageJson { - /// # Panics - /// # Errors - pub(crate) fn parse( - path: PathBuf, - realpath: PathBuf, - json: &str, - ) -> Result { - let mut raw_json: JSONValue = serde_json::from_str(json)?; - let mut package_json = Self::default(); - - if let Some(json_object) = raw_json.as_object_mut() { - // Remove large fields that are useless for pragmatic use. - #[cfg(feature = "package_json_raw_json_api")] - { - json_object.remove("description"); - json_object.remove("keywords"); - json_object.remove("scripts"); - json_object.remove("dependencies"); - json_object.remove("devDependencies"); - json_object.remove("peerDependencies"); - json_object.remove("optionalDependencies"); - } - - // Add name, type and sideEffects. - package_json.name = - json_object.get("name").and_then(|field| field.as_str()).map(ToString::to_string); - package_json.r#type = json_object.get("type").cloned(); - package_json.side_effects = json_object.get("sideEffects").cloned(); - } - - package_json.path = path; - package_json.realpath = realpath; - package_json.raw_json = std::sync::Arc::new(raw_json); - Ok(package_json) - } - - fn get_value_by_path<'a>( - fields: &'a serde_json::Map, - path: &[String], - ) -> Option<&'a JSONValue> { - if path.is_empty() { - return None; - } - let mut value = fields.get(&path[0])?; - for key in path.iter().skip(1) { - if let Some(inner_value) = value.as_object().and_then(|o| o.get(key)) { - value = inner_value; - } else { - return None; - } - } - Some(value) - } - - /// Raw serde json value of `package.json`. - /// - /// This is currently used in Rspack for: - /// * getting the `sideEffects` field - /// * query in - search on GitHub indicates query on the `type` field. - /// - /// To reduce overall memory consumption, large fields that useless for pragmatic use are removed. - /// They are: `description`, `keywords`, `scripts`, - /// `dependencies` and `devDependencies`, `peerDependencies`, `optionalDependencies`. - #[cfg(feature = "package_json_raw_json_api")] - pub fn raw_json(&self) -> &std::sync::Arc { - &self.raw_json - } - - /// Directory to `package.json` - /// - /// # Panics - /// - /// * When the package.json path is misconfigured. - pub fn directory(&self) -> &Path { - debug_assert!(self.realpath.file_name().is_some_and(|x| x == "package.json")); - self.realpath.parent().unwrap() - } - - /// The "main" field defines the entry point of a package when imported by name via a node_modules lookup. Its value is a path. - /// - /// When a package has an "exports" field, this will take precedence over the "main" field when importing the package by name. - /// - /// Values are dynamically retrieved from [ResolveOptions::main_fields]. - /// - /// - pub(crate) fn main_fields<'a>( - &'a self, - main_fields: &'a [String], - ) -> impl Iterator + '_ { - main_fields - .iter() - .filter_map(|main_field| self.raw_json.get(main_field)) - .filter_map(|value| value.as_str()) - } - - /// The "exports" field allows defining the entry points of a package when imported by name loaded either via a node_modules lookup or a self-reference to its own name. - /// - /// - pub(crate) fn exports_fields<'a>( - &'a self, - exports_fields: &'a [Vec], - ) -> impl Iterator + '_ { - exports_fields.iter().filter_map(|object_path| { - self.raw_json - .as_object() - .and_then(|json_object| Self::get_value_by_path(json_object, object_path)) - }) - } - - /// In addition to the "exports" field, there is a package "imports" field to create private mappings that only apply to import specifiers from within the package itself. - /// - /// - pub(crate) fn imports_fields<'a>( - &'a self, - imports_fields: &'a [Vec], - ) -> impl Iterator + '_ { - imports_fields.iter().filter_map(|object_path| { - self.raw_json - .as_object() - .and_then(|json_object| Self::get_value_by_path(json_object, object_path)) - .and_then(|value| value.as_object()) - }) - } - - /// The "browser" field is provided by a module author as a hint to javascript bundlers or component tools when packaging modules for client side use. - /// Multiple values are configured by [ResolveOptions::alias_fields]. - /// - /// - fn browser_fields<'a>( - &'a self, - alias_fields: &'a [Vec], - ) -> impl Iterator + '_ { - alias_fields.iter().filter_map(|object_path| { - self.raw_json - .as_object() - .and_then(|json_object| Self::get_value_by_path(json_object, object_path)) - // Only object is valid, all other types are invalid - // https://github.com/webpack/enhanced-resolve/blob/3a28f47788de794d9da4d1702a3a583d8422cd48/lib/AliasFieldPlugin.js#L44-L52 - .and_then(|value| value.as_object()) - }) - } - - /// Resolve the request string for this package.json by looking at the `browser` field. - /// - /// # Errors - /// - /// * Returns [ResolveError::Ignored] for `"path": false` in `browser` field. - pub(crate) fn resolve_browser_field<'a>( - &'a self, - path: &Path, - request: Option<&str>, - alias_fields: &'a [Vec], - ) -> Result, ResolveError> { - for object in self.browser_fields(alias_fields) { - if let Some(request) = request { - if let Some(value) = object.get(request) { - return Self::alias_value(path, value); - } - } else { - let dir = self.path.parent().unwrap(); - for (key, value) in object { - let joined = dir.normalize_with(key); - if joined == path { - return Self::alias_value(path, value); - } - } - } - } - Ok(None) - } - - fn alias_value<'a>(key: &Path, value: &'a JSONValue) -> Result, ResolveError> { - match value { - JSONValue::String(value) => Ok(Some(value.as_str())), - JSONValue::Bool(b) if !b => Err(ResolveError::Ignored(key.to_path_buf())), - _ => Ok(None), - } - } -} diff --git a/src/path.rs b/src/path.rs deleted file mode 100644 index f66fdd76..00000000 --- a/src/path.rs +++ /dev/null @@ -1,132 +0,0 @@ -//! Path Utilities -//! -//! Code adapted from the following libraries -//! * [path-absolutize](https://docs.rs/path-absolutize) -//! * [normalize_path](https://docs.rs/normalize-path) -use std::path::{Component, Path, PathBuf}; - -pub const SLASH_START: &[char; 2] = &['/', '\\']; - -/// Extension trait to add path normalization to std's [`Path`]. -pub trait PathUtil { - /// Normalize this path without performing I/O. - /// - /// All redundant separator and up-level references are collapsed. - /// - /// However, this does not resolve links. - fn normalize(&self) -> PathBuf; - - /// Normalize with subpath assuming this path is normalized without performing I/O. - /// - /// All redundant separator and up-level references are collapsed. - /// - /// However, this does not resolve links. - fn normalize_with>(&self, subpath: P) -> PathBuf; - - /// Defined in ESM PACKAGE_TARGET_RESOLVE - /// If target split on "/" or "\" contains any "", ".", "..", or "node_modules" segments after the first "." segment, case insensitive and including percent encoded variants - fn is_invalid_exports_target(&self) -> bool; -} - -impl PathUtil for Path { - // https://github.com/parcel-bundler/parcel/blob/e0b99c2a42e9109a9ecbd6f537844a1b33e7faf5/packages/utils/node-resolver-rs/src/path.rs#L7 - fn normalize(&self) -> PathBuf { - let mut components = self.components().peekable(); - let mut ret = if let Some(c @ Component::Prefix(..)) = components.peek() { - let buf = PathBuf::from(c.as_os_str()); - components.next(); - buf - } else { - PathBuf::new() - }; - - for component in components { - match component { - Component::Prefix(..) => unreachable!("Path {:?}", self), - Component::RootDir => { - ret.push(component.as_os_str()); - } - Component::CurDir => {} - Component::ParentDir => { - ret.pop(); - } - Component::Normal(c) => { - ret.push(c); - } - } - } - - ret - } - - // https://github.com/parcel-bundler/parcel/blob/e0b99c2a42e9109a9ecbd6f537844a1b33e7faf5/packages/utils/node-resolver-rs/src/path.rs#L37 - fn normalize_with>(&self, subpath: B) -> PathBuf { - let subpath = subpath.as_ref(); - - let mut components = subpath.components(); - - let Some(head) = components.next() else { return subpath.to_path_buf() }; - - if matches!(head, Component::Prefix(..) | Component::RootDir) { - return subpath.to_path_buf(); - } - - let mut ret = self.to_path_buf(); - for component in std::iter::once(head).chain(components) { - match component { - Component::CurDir => {} - Component::ParentDir => { - ret.pop(); - } - Component::Normal(c) => { - ret.push(c); - } - Component::Prefix(..) | Component::RootDir => { - unreachable!("Path {:?} Subpath {:?}", self, subpath) - } - } - } - - ret - } - - fn is_invalid_exports_target(&self) -> bool { - self.components().enumerate().any(|(index, c)| match c { - Component::ParentDir => true, - Component::CurDir => index > 0, - Component::Normal(c) => c.eq_ignore_ascii_case("node_modules"), - _ => false, - }) - } -} - -// https://github.com/webpack/enhanced-resolve/blob/main/test/path.test.js -#[test] -fn is_invalid_exports_target() { - let test_cases = [ - "../a.js", - "../", - "./a/b/../../../c.js", - "./a/b/../../../", - "./../../c.js", - "./../../", - "./a/../b/../../c.js", - "./a/../b/../../", - "./././../", - ]; - - for case in test_cases { - assert!(Path::new(case).is_invalid_exports_target(), "{case}"); - } - - assert!(!Path::new("C:").is_invalid_exports_target()); - assert!(!Path::new("/").is_invalid_exports_target()); -} - -#[test] -fn normalize() { - assert_eq!(Path::new("/foo/.././foo/").normalize(), Path::new("/foo")); - assert_eq!(Path::new("C://").normalize(), Path::new("C://")); - assert_eq!(Path::new("C:").normalize(), Path::new("C:")); - assert_eq!(Path::new(r"\\server\share").normalize(), Path::new(r"\\server\share")); -} diff --git a/src/resolution.rs b/src/resolution.rs deleted file mode 100644 index a3aaa2e7..00000000 --- a/src/resolution.rs +++ /dev/null @@ -1,92 +0,0 @@ -use crate::package_json::PackageJson; -use std::{ - fmt, - path::{Path, PathBuf}, - sync::Arc, -}; - -/// The final path resolution with optional `?query` and `#fragment` -#[derive(Clone)] -pub struct Resolution { - pub(crate) path: PathBuf, - - /// path query `?query`, contains `?`. - pub(crate) query: Option, - - /// path fragment `#query`, contains `#`. - pub(crate) fragment: Option, - - pub(crate) package_json: Option>, -} - -impl fmt::Debug for Resolution { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - f.debug_struct("Resolution") - .field("path", &self.path) - .field("query", &self.query) - .field("fragment", &self.fragment) - .field("package_json", &self.package_json.as_ref().map(|p| &p.path)) - .finish() - } -} - -impl PartialEq for Resolution { - fn eq(&self, other: &Self) -> bool { - self.path == other.path && self.query == other.query && self.fragment == other.fragment - } -} -impl Eq for Resolution {} - -impl Resolution { - /// Returns the path without query and fragment - pub fn path(&self) -> &Path { - &self.path - } - - /// Returns the path without query and fragment - pub fn into_path_buf(self) -> PathBuf { - self.path - } - - /// Returns the path query `?query`, contains the leading `?` - pub fn query(&self) -> Option<&str> { - self.query.as_deref() - } - - /// Returns the path fragment `#fragment`, contains the leading `#` - pub fn fragment(&self) -> Option<&str> { - self.fragment.as_deref() - } - - /// Returns serialized package_json - pub fn package_json(&self) -> Option<&Arc> { - self.package_json.as_ref() - } - - /// Returns the full path with query and fragment - pub fn full_path(&self) -> PathBuf { - let mut path = self.path.clone().into_os_string(); - if let Some(query) = &self.query { - path.push(query); - } - if let Some(fragment) = &self.fragment { - path.push(fragment); - } - PathBuf::from(path) - } -} - -#[test] -fn test() { - let resolution = Resolution { - path: PathBuf::from("foo"), - query: Some("?query".to_string()), - fragment: Some("#fragment".to_string()), - package_json: None, - }; - assert_eq!(resolution.path(), Path::new("foo")); - assert_eq!(resolution.query(), Some("?query")); - assert_eq!(resolution.fragment(), Some("#fragment")); - assert_eq!(resolution.full_path(), PathBuf::from("foo?query#fragment")); - assert_eq!(resolution.into_path_buf(), PathBuf::from("foo")); -} diff --git a/src/specifier.rs b/src/specifier.rs deleted file mode 100644 index 73ed038c..00000000 --- a/src/specifier.rs +++ /dev/null @@ -1,230 +0,0 @@ -use crate::error::SpecifierError; -use std::borrow::Cow; - -#[derive(Debug)] -pub struct Specifier<'a> { - path: Cow<'a, str>, - pub query: Option<&'a str>, - pub fragment: Option<&'a str>, -} - -impl<'a> Specifier<'a> { - pub fn path(&'a self) -> &'a str { - self.path.as_ref() - } - - pub fn parse(specifier: &'a str) -> Result { - if specifier.is_empty() { - return Err(SpecifierError::Empty(specifier.to_string())); - } - let offset = match specifier.as_bytes()[0] { - b'/' | b'.' | b'#' => 1, - _ => 0, - }; - let (path, query, fragment) = Self::parse_query_framgment(specifier, offset); - if path.is_empty() { - return Err(SpecifierError::Empty(specifier.to_string())); - } - Ok(Self { path, query, fragment }) - } - - fn parse_query_framgment( - specifier: &'a str, - skip: usize, - ) -> (Cow<'a, str>, Option<&str>, Option<&str>) { - let mut query_start: Option = None; - let mut fragment_start: Option = None; - - let mut prev = specifier.chars().next().unwrap(); - let mut escaped_indexes = vec![]; - for (i, c) in specifier.char_indices().skip(skip) { - if c == '?' && query_start.is_none() { - query_start = Some(i); - } - if c == '#' { - if prev == '\0' { - escaped_indexes.push(i - 1); - } else { - fragment_start = Some(i); - break; - } - } - prev = c; - } - - let (path, query, fragment) = match (query_start, fragment_start) { - (Some(i), Some(j)) => { - debug_assert!(i < j); - (&specifier[..i], Some(&specifier[i..j]), Some(&specifier[j..])) - } - (Some(i), None) => (&specifier[..i], Some(&specifier[i..]), None), - (None, Some(j)) => (&specifier[..j], None, Some(&specifier[j..])), - _ => (specifier, None, None), - }; - - let path = if escaped_indexes.is_empty() { - Cow::Borrowed(path) - } else { - // Remove the `\0` characters for a legal path. - Cow::Owned( - path.chars() - .enumerate() - .filter_map(|(i, c)| (!escaped_indexes.contains(&i)).then_some(c)) - .collect::(), - ) - }; - - (path, query, fragment) - } -} - -#[cfg(test)] -mod tests { - use super::{Specifier, SpecifierError}; - - #[test] - fn debug() { - let specifier = Specifier::parse("/").unwrap(); - assert_eq!( - format!("{specifier:?}"), - r#"Specifier { path: "/", query: None, fragment: None }"# - ); - } - - #[test] - fn empty() { - let specifiers = ["", "?"]; - for specifier in specifiers { - let error = Specifier::parse(specifier).unwrap_err(); - assert_eq!(error, SpecifierError::Empty(specifier.to_string())); - } - } - - #[test] - fn absolute() -> Result<(), SpecifierError> { - let specifier = "/test?#"; - let parsed = Specifier::parse(specifier)?; - assert_eq!(parsed.path, "/test"); - assert_eq!(parsed.query, Some("?")); - assert_eq!(parsed.fragment, Some("#")); - Ok(()) - } - - #[test] - fn relative() -> Result<(), SpecifierError> { - let specifiers = ["./test", "../test", "../../test"]; - for specifier in specifiers { - let mut r = specifier.to_string(); - r.push_str("?#"); - let parsed = Specifier::parse(&r)?; - assert_eq!(parsed.path, specifier); - assert_eq!(parsed.query, Some("?")); - assert_eq!(parsed.fragment, Some("#")); - } - Ok(()) - } - - #[test] - fn hash() -> Result<(), SpecifierError> { - let specifiers = ["#", "#path"]; - for specifier in specifiers { - let mut r = specifier.to_string(); - r.push_str("?#"); - let parsed = Specifier::parse(&r)?; - assert_eq!(parsed.path, specifier); - assert_eq!(parsed.query, Some("?")); - assert_eq!(parsed.fragment, Some("#")); - } - Ok(()) - } - - #[test] - fn module() -> Result<(), SpecifierError> { - let specifiers = ["module"]; - for specifier in specifiers { - let mut r = specifier.to_string(); - r.push_str("?#"); - let parsed = Specifier::parse(&r)?; - assert_eq!(parsed.path, specifier); - assert_eq!(parsed.query, Some("?")); - assert_eq!(parsed.fragment, Some("#")); - } - Ok(()) - } - - #[test] - fn query_fragment() -> Result<(), SpecifierError> { - let data = [ - ("a?", Some("?"), None), - ("a?query", Some("?query"), None), - ("a?query1?query2", Some("?query1?query2"), None), - ("a?query1?query2?query3", Some("?query1?query2?query3"), None), - ("a#", None, Some("#")), - ("a#b#c", None, Some("#b#c")), - ("a#fragment", None, Some("#fragment")), - ("a?#", Some("?"), Some("#")), - ("a?#fragment", Some("?"), Some("#fragment")), - ("a?query#", Some("?query"), Some("#")), - ("a?query#fragment", Some("?query"), Some("#fragment")), - ("a#fragment?", None, Some("#fragment?")), - ("a#fragment?query", None, Some("#fragment?query")), - ]; - - for (specifier_str, query, fragment) in data { - let specifier = Specifier::parse(specifier_str)?; - assert_eq!(specifier.path, "a", "{specifier_str}"); - assert_eq!(specifier.query, query, "{specifier_str}"); - assert_eq!(specifier.fragment, fragment, "{specifier_str}"); - } - - Ok(()) - } - - #[test] - // https://github.com/webpack/enhanced-resolve/blob/main/test/identifier.test.js - fn enhanced_resolve_edge_cases() -> Result<(), SpecifierError> { - let data = [ - ("path/#", "path/", "", "#"), - ("path/as/?", "path/as/", "?", ""), - ("path/#/?", "path/", "", "#/?"), - ("path/#repo#hash", "path/", "", "#repo#hash"), - ("path/#r#hash", "path/", "", "#r#hash"), - ("path/#repo/#repo2#hash", "path/", "", "#repo/#repo2#hash"), - ("path/#r/#r#hash", "path/", "", "#r/#r#hash"), - ("path/#/not/a/hash?not-a-query", "path/", "", "#/not/a/hash?not-a-query"), - ]; - - for (specifier_str, path, query, fragment) in data { - let specifier = Specifier::parse(specifier_str)?; - assert_eq!(specifier.path, path, "{specifier_str}"); - assert_eq!(specifier.query.unwrap_or(""), query, "{specifier_str}"); - assert_eq!(specifier.fragment.unwrap_or(""), fragment, "{specifier_str}"); - } - - Ok(()) - } - - // https://github.com/webpack/enhanced-resolve/blob/main/test/identifier.test.js - #[test] - fn enhanced_resolve_windows_like() -> Result<(), SpecifierError> { - let data = [ - ("path\\#", "path\\", "", "#"), - ("path\\as\\?", "path\\as\\", "?", ""), - ("path\\#\\?", "path\\", "", "#\\?"), - ("path\\#repo#hash", "path\\", "", "#repo#hash"), - ("path\\#r#hash", "path\\", "", "#r#hash"), - ("path\\#repo\\#repo2#hash", "path\\", "", "#repo\\#repo2#hash"), - ("path\\#r\\#r#hash", "path\\", "", "#r\\#r#hash"), - ("path\\#/not/a/hash?not-a-query", "path\\", "", "#/not/a/hash?not-a-query"), - ]; - - for (specifier_str, path, query, fragment) in data { - let specifier = Specifier::parse(specifier_str)?; - assert_eq!(specifier.path, path, "{specifier_str}"); - assert_eq!(specifier.query.unwrap_or(""), query, "{specifier_str}"); - assert_eq!(specifier.fragment.unwrap_or(""), fragment, "{specifier_str}"); - } - - Ok(()) - } -} diff --git a/src/tests/alias.rs b/src/tests/alias.rs deleted file mode 100644 index e5892066..00000000 --- a/src/tests/alias.rs +++ /dev/null @@ -1,283 +0,0 @@ -//! - -use normalize_path::NormalizePath; -use std::path::Path; - -use crate::{AliasValue, Resolution, ResolveContext, ResolveError, ResolveOptions, Resolver}; - -#[test] -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -fn alias() { - use super::memory_fs::MemoryFS; - use crate::ResolverGeneric; - use std::path::{Path, PathBuf}; - - let f = Path::new("/"); - - let file_system = MemoryFS::new(&[ - ("/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", ""), - ("/dashed-name", ""), - ]); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - alias: vec![ - ("aliasA".into(), vec![AliasValue::from("a")]), - ("b$".into(), vec![AliasValue::from("a/index")]), - ("c$".into(), vec![AliasValue::from("/a/index")]), - ( - "multiAlias".into(), - vec![ - AliasValue::from("b"), - AliasValue::from("c"), - AliasValue::from("d"), - AliasValue::from("e"), - AliasValue::from("a"), - ], - ), - ("recursive".into(), vec![AliasValue::from("recursive/dir")]), - ("/d/dir".into(), vec![AliasValue::from("/c/dir")]), - ("/d/index.js".into(), vec![AliasValue::from("/c/index")]), - ("#".into(), vec![AliasValue::from("/c/dir")]), - ("@".into(), vec![AliasValue::from("/c/dir")]), - ("ignored".into(), vec![AliasValue::Ignore]), - // not part of enhanced-resolve, added to make sure query in alias value works - ("alias_query".into(), vec![AliasValue::from("a?query_after")]), - ("alias_fragment".into(), vec![AliasValue::from("a#fragment_after")]), - ("dash".into(), vec![AliasValue::Ignore]), - ("@scope/package-name/file$".into(), vec![AliasValue::from("/c/dir")]), - ], - modules: vec!["/".into()], - ..ResolveOptions::default() - }, - ); - - #[rustfmt::skip] - let pass = [ - ("should resolve a not aliased module 1", "a", "/a/index"), - ("should resolve a not aliased module 2", "a/index", "/a/index"), - ("should resolve a not aliased module 3", "a/dir", "/a/dir/index"), - ("should resolve a not aliased module 4", "a/dir/index", "/a/dir/index"), - ("should resolve an aliased module 1", "aliasA", "/a/index"), - ("should resolve an aliased module 2", "aliasA/index", "/a/index"), - ("should resolve an aliased module 3", "aliasA/dir", "/a/dir/index"), - ("should resolve an aliased module 4", "aliasA/dir/index", "/a/dir/index"), - ("should resolve '#' alias 1", "#", "/c/dir/index"), - ("should resolve '#' alias 2", "#/index", "/c/dir/index"), - ("should resolve '@' alias 1", "@", "/c/dir/index"), - ("should resolve '@' alias 2", "@/index", "/c/dir/index"), - ("should resolve a recursive aliased module 1", "recursive", "/recursive/dir/index"), - ("should resolve a recursive aliased module 2", "recursive/index", "/recursive/dir/index"), - ("should resolve a recursive aliased module 3", "recursive/dir", "/recursive/dir/index"), - ("should resolve a recursive aliased module 4", "recursive/dir/index", "/recursive/dir/index"), - ("should resolve a file aliased module 1", "b", "/a/index"), - ("should resolve a file aliased module 2", "c", "/a/index"), - ("should resolve a file aliased module with a query 1", "b?query", "/a/index?query"), - ("should resolve a file aliased module with a query 2", "c?query", "/a/index?query"), - ("should resolve a path in a file aliased module 1", "b/index", "/b/index"), - ("should resolve a path in a file aliased module 2", "b/dir", "/b/dir/index"), - ("should resolve a path in a file aliased module 3", "b/dir/index", "/b/dir/index"), - ("should resolve a path in a file aliased module 4", "c/index", "/c/index"), - ("should resolve a path in a file aliased module 5", "c/dir", "/c/dir/index"), - ("should resolve a path in a file aliased module 6", "c/dir/index", "/c/dir/index"), - ("should resolve a file aliased file 1", "d", "/c/index"), - ("should resolve a file aliased file 2", "d/dir/index", "/c/dir/index"), - ("should resolve a file in multiple aliased dirs 1", "multiAlias/dir/file", "/e/dir/file"), - ("should resolve a file in multiple aliased dirs 2", "multiAlias/anotherDir", "/e/anotherDir/index"), - // not part of enhanced-resolve, added to make sure query in alias value works - ("should resolve query in alias value", "alias_query?query_before", "/a/index?query_after"), - ("should resolve query in alias value", "alias_fragment#fragment_before", "/a/index#fragment_after"), - ("should resolve dashed name", "dashed-name", "/dashed-name"), - ("should resolve scoped package name with sub dir", "@scope/package-name/file", "/c/dir/index"), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - - #[rustfmt::skip] - let ignore = [ - ("should resolve an ignore module", "ignored", ResolveError::Ignored(f.join("ignored"))) - ]; - - for (comment, request, expected) in ignore { - let resolution = resolver.resolve(f, request); - assert_eq!(resolution, Err(expected), "{comment} {request}"); - } -} - -// Not part of enhanced-resolve -#[test] -fn infinite_recursion() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![ - ("./a".into(), vec![AliasValue::from("./b")]), - ("./b".into(), vec![AliasValue::from("./a")]), - ], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(f, "./a"); - assert_eq!(resolution, Err(ResolveError::Recursion)); -} - -fn check_slash(path: &Path) { - let s = path.to_string_lossy().to_string(); - #[cfg(target_os = "windows")] - { - assert!(!s.contains('/'), "{s}"); - assert!(s.contains('\\'), "{s}"); - } - #[cfg(not(target_os = "windows"))] - { - assert!(s.contains('/'), "{s}"); - assert!(!s.contains('\\'), "{s}"); - } -} - -#[test] -fn absolute_path() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![(f.join("foo").to_str().unwrap().to_string(), vec![AliasValue::Ignore])], - modules: vec![f.clone().to_str().unwrap().to_string()], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(&f, "foo/index"); - assert_eq!(resolution, Err(ResolveError::Ignored(f.join("foo")))); -} - -#[test] -fn system_path() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![("@app".into(), vec![AliasValue::from(f.join("alias").to_string_lossy())])], - ..ResolveOptions::default() - }); - - let specifiers = ["@app/files/a", "@app/files/a.js"]; - - for specifier in specifiers { - let path = resolver.resolve(&f, specifier).map(Resolution::into_path_buf).unwrap(); - assert_eq!(path, f.join("alias/files/a.js")); - check_slash(&path); - } -} - -#[test] -fn alias_is_full_path() { - let f = super::fixture(); - let dir = f.join("foo"); - let dir_str = dir.to_string_lossy().to_string(); - - let resolver = Resolver::new(ResolveOptions { - alias: vec![("@".into(), vec![AliasValue::Path(dir_str.clone())])], - ..ResolveOptions::default() - }); - - let mut ctx = ResolveContext::default(); - - let specifiers = [ - "@/index".to_string(), - "@/index.js".to_string(), - // specifier has multiple `/` for reasons we'll never know - "@////index".to_string(), - // specifier is a full path - dir_str, - ]; - - for specifier in specifiers { - let resolution = resolver.resolve_with_context(&f, &specifier, &mut ctx); - assert_eq!(resolution.map(|r| r.full_path()), Ok(dir.join("index.js"))); - } - - for path in ctx.file_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - check_slash(&path); - } - - for path in ctx.missing_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - check_slash(&path); - if let Some(path) = path.parent() { - assert!(!path.is_file(), "{path:?} must not be a file"); - } - } -} - -// For the `should_stop` variable in `load_alias` -#[test] -fn all_alias_values_are_not_found() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![( - "m1".to_string(), - vec![AliasValue::Path(f.join("node_modules").join("m2").to_string_lossy().to_string())], - )], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(&f, "m1/a.js"); - assert_eq!( - resolution, - Err(ResolveError::MatchedAliasNotFound("m1/a.js".to_string(), "m1".to_string(),)) - ); -} - -#[test] -fn alias_fragment() { - let f = super::fixture(); - - let data = [ - // enhanced-resolve has `#` prepended with a `\0`, they are removed from the - // following 3 expected test results. - // See https://github.com/webpack/enhanced-resolve#escaping - ( - "handle fragment edge case (no fragment)", - "./no#fragment/#/#", - f.join("no#fragment/#/#.js"), - ), - ("handle fragment edge case (fragment)", "./no#fragment/#/", f.join("no.js#fragment/#/")), - ( - "handle fragment escaping", - "./no\0#fragment/\0#/\0##fragment", - f.join("no#fragment/#/#.js#fragment"), - ), - ]; - - for (comment, request, expected) in data { - let resolver = Resolver::new(ResolveOptions { - alias: vec![("foo".to_string(), vec![AliasValue::Path(request.to_string())])], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f, "foo").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } -} - -#[test] -fn alias_try_fragment_as_path() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![( - "#".to_string(), - vec![AliasValue::Path(f.join("#").to_string_lossy().to_string())], - )], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(&f, "#/a").map(|r| r.full_path()); - assert_eq!(resolution, Ok(f.join("#").join("a.js"))); -} diff --git a/src/tests/browser_field.rs b/src/tests/browser_field.rs deleted file mode 100644 index 171ee099..00000000 --- a/src/tests/browser_field.rs +++ /dev/null @@ -1,189 +0,0 @@ -//! - -use crate::{AliasValue, ResolveError, ResolveOptions, Resolver}; - -#[test] -fn ignore() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![ - vec!["browser".into()], - vec!["innerBrowser1".into()], - vec!["innerBrowser2".into()], - vec![], - ], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - (f.clone(), "./lib/ignore", f.join("lib/ignore.js")), - (f.clone(), "./lib/ignore.js", f.join("lib/ignore.js")), - (f.join("lib"), "./ignore", f.join("lib/ignore.js")), - (f.join("lib"), "./ignore.js", f.join("lib/ignore.js")), - ]; - - for (path, request, expected) in data { - let resolution = resolver.resolve(&path, request); - let expected = ResolveError::Ignored(expected); - assert_eq!(resolution, Err(expected), "{path:?} {request}"); - } -} - -#[test] -fn shared_resolvers() { - let f = super::fixture().join("browser-module"); - - let resolver1 = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["innerBrowser1".into(), "field".into(), "browser".into()]], - ..ResolveOptions::default() - }); - let resolved_path = resolver1.resolve(&f, "./lib/main1.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("lib/main.js"))); - - let resolver2 = resolver1.clone_with_options(ResolveOptions { - alias_fields: vec![vec!["innerBrowser2".into(), "browser".into()]], - ..ResolveOptions::default() - }); - let resolved_path = resolver2.resolve(&f, "./lib/main2.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("./lib/replaced.js"))); -} - -#[test] -fn replace_file() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![ - vec!["browser".into()], - vec!["innerBrowser1".into(), "field2".into(), "browser".into()], // not presented - vec!["innerBrowser1".into(), "field".into(), "browser".into()], - vec!["innerBrowser2".into(), "browser".into()], - ], - // Not part of enhanced-resolve. Added to make sure no interaction between these two fields. - main_fields: vec!["browser".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - ("should replace a file 1", f.clone(), "./lib/replaced", f.join("lib/browser.js")), - ("should replace a file 2", f.clone(), "./lib/replaced.js", f.join("lib/browser.js")), - ("should replace a file 3", f.join("lib"), "./replaced", f.join("lib/browser.js")), - ("should replace a file 4", f.join("lib"), "./replaced.js", f.join("lib/browser.js")), - ("should replace a module with a file 1", f.clone(), "module-a", f.join("browser/module-a.js")), - ("should replace a module with a file 2", f.join("lib"), "module-a", f.join("browser/module-a.js")), - ("should replace a module with a module 1", f.clone(), "module-b", f.join("node_modules/module-c.js")), - ("should replace a module with a module 2", f.join("lib"), "module-b", f.join("node_modules/module-c.js")), - ("should resolve in nested property 1", f.clone(), "./lib/main1.js", f.join("lib/main.js")), - ("should resolve in nested property 2", f.clone(), "./lib/main2.js", f.join("lib/browser.js")), - ("should check only alias field properties", f.clone(), "./toString", f.join("lib/toString.js")), - // not part of enhanced-resolve - ("recursion", f.clone(), "module-c", f.join("node_modules/module-c.js")), - ("resolve self 1", f.clone(), "./lib/main.js", f.join("lib/main.js")), - ("resolve self 2", f.clone(), "./main.js", f.join("lib/main.js")), - ]; - - for (comment, path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn recurse_fail() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - ("recurse non existent", f.clone(), "./lib/non-existent.js", ResolveError::NotFound("./lib/non-existent.js".into())), - ("path partial match 1", f.clone(), "./xyz.js", ResolveError::NotFound("./xyz.js".into())), - ("path partial match 2", f, "./lib/xyz.js", ResolveError::NotFound("./lib/xyz.js".into())), - ]; - - for (comment, path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Err(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn broken() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - // The browser field string value should be ignored - (f.clone(), "browser-module-broken", Ok(f.join("node_modules/browser-module-broken/main.js"))), - (f.join("browser-module"), "./number", Err(ResolveError::NotFound("./number".into()))), - ]; - - for (path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, expected, "{path:?} {request}"); - } -} - -#[test] -fn crypto_js() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - fallback: vec![( - "crypto".into(), - vec![AliasValue::from(f.join("lib.js").to_string_lossy())], - )], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(f.join("crypto-js"), "crypto").map(|r| r.full_path()); - assert_eq!(resolved_path, Err(ResolveError::Ignored(f.join("crypto-js")))); -} - -// https://github.com/webpack/webpack/blob/87660921808566ef3b8796f8df61bd79fc026108/test/cases/resolving/browser-field/index.js#L40-L43 -#[test] -fn recursive() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - let data = [ - ("should handle recursive file 1", f.clone(), "recursive-file/a"), - ("should handle recursive file 2", f.clone(), "recursive-file/b"), - ("should handle recursive file 3", f.clone(), "recursive-file/c"), - ("should handle recursive file 4", f, "recursive-file/d"), - ]; - - for (comment, path, request) in data { - let resolved_path = resolver.resolve(&path, request); - assert_eq!(resolved_path, Err(ResolveError::Recursion), "{comment} {path:?} {request}"); - } -} - -#[test] -fn with_query() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "./foo").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("lib").join("browser.js?query"))); -} diff --git a/src/tests/builtins.rs b/src/tests/builtins.rs deleted file mode 100644 index 5d6d14d9..00000000 --- a/src/tests/builtins.rs +++ /dev/null @@ -1,121 +0,0 @@ -use std::path::Path; - -use crate::{ResolveError, ResolveOptions, Resolver}; - -#[test] -fn builtins_off() { - let f = Path::new("/"); - let resolver = Resolver::default(); - let resolved_path = resolver.resolve(f, "zlib").map(|r| r.full_path()); - assert_eq!(resolved_path, Err(ResolveError::NotFound("zlib".into()))); -} - -#[test] -fn builtins() { - let f = Path::new("/"); - - let resolver = Resolver::new(ResolveOptions::default().with_builtin_modules(true)); - - let pass = [ - "_http_agent", - "_http_client", - "_http_common", - "_http_incoming", - "_http_outgoing", - "_http_server", - "_stream_duplex", - "_stream_passthrough", - "_stream_readable", - "_stream_transform", - "_stream_wrap", - "_stream_writable", - "_tls_common", - "_tls_wrap", - "assert", - "assert/strict", - "async_hooks", - "buffer", - "child_process", - "cluster", - "console", - "constants", - "crypto", - "dgram", - "diagnostics_channel", - "dns", - "dns/promises", - "domain", - "events", - "fs", - "fs/promises", - "http", - "http2", - "https", - "inspector", - "module", - "net", - "os", - "path", - "path/posix", - "path/win32", - "perf_hooks", - "process", - "punycode", - "querystring", - "readline", - "repl", - "stream", - "stream/consumers", - "stream/promises", - "stream/web", - "string_decoder", - "sys", - "timers", - "timers/promises", - "tls", - "trace_events", - "tty", - "url", - "util", - "util/types", - "v8", - "vm", - "worker_threads", - "zlib", - ]; - - for request in pass { - let prefixed_request = format!("node:{request}"); - for request in [prefixed_request.clone(), request.to_string()] { - let resolved_path = resolver.resolve(f, &request).map(|r| r.full_path()); - let err = ResolveError::Builtin(prefixed_request.clone()); - assert_eq!(resolved_path, Err(err), "{request}"); - } - } -} - -#[test] -fn fail() { - let f = Path::new("/"); - let resolver = Resolver::new(ResolveOptions::default().with_builtin_modules(true)); - let request = "xxx"; - let resolved_path = resolver.resolve(f, request); - let err = ResolveError::NotFound(request.to_string()); - assert_eq!(resolved_path, Err(err), "{request}"); -} - -#[test] -fn imports() { - let f = super::fixture().join("builtins"); - let resolver = Resolver::new(ResolveOptions { - builtin_modules: true, - condition_names: vec!["node".into()], - ..ResolveOptions::default() - }); - - for request in ["#fs", "#http"] { - let resolved_path = resolver.resolve(f.clone(), request).map(|r| r.full_path()); - let err = ResolveError::Builtin(format!("node:{}", request.trim_start_matches('#'))); - assert_eq!(resolved_path, Err(err)); - } -} diff --git a/src/tests/dependencies.rs b/src/tests/dependencies.rs deleted file mode 100644 index bcc2355b..00000000 --- a/src/tests/dependencies.rs +++ /dev/null @@ -1,110 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/dependencies.test.js - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows { - use rustc_hash::FxHashSet; - use std::path::PathBuf; - - use crate::{ResolveContext, ResolveOptions, ResolverGeneric}; - - use super::super::memory_fs::MemoryFS; - - fn file_system() -> MemoryFS { - MemoryFS::new(&[ - ("/a/b/node_modules/some-module/index.js", ""), - ("/a/node_modules/module/package.json", r#"{"main":"entry.js"}"#), - ("/a/node_modules/module/file.js", r#"{"main":"entry.js"}"#), - ("/modules/other-module/file.js", ""), - ]) - } - - #[test] - fn test() { - let file_system = file_system(); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - extensions: vec![".json".into(), ".js".into()], - modules: vec!["/modules".into(), "node_modules".into()], - ..ResolveOptions::default() - }, - ); - - let data = [ - ( - "middle module request", - "/a/b/c", - "module/file", - "/a/node_modules/module/file.js", - // These dependencies are different from enhanced-resolve due to different code path to - // querying the file system - vec![ - // 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", - // "/", - ], - vec![ - // missing package.jsons - // "/a/b/c/package.json", - "/a/b/package.json", - "/a/package.json", - "/package.json", - // missing modules directories - "/a/b/c", - // "/a/b/c/node_modules", - // missing single file modules - "/modules/module", - "/a/b/node_modules/module", - // missing files with alternative extensions - "/a/node_modules/module/file", - "/a/node_modules/module/file.json", - ], - ), - ( - "fast found module", - "/a/b/c", - "other-module/file.js", - "/modules/other-module/file.js", - // These dependencies are different from enhanced-resolve due to different code path to - // querying the file system - vec![ - // symlink checks - "/modules/other-module/file.js", - // "/modules/other-module", - // "/modules", - // "/", - ], - vec![ - // missing package.jsons - // "/a/b/c/package.json", - "/a/b/c", - "/a/b/package.json", - "/a/package.json", - "/package.json", - "/modules/other-module/package.json", - "/modules/package.json", - ], - ), - ]; - - for (name, context, request, result, file_dependencies, missing_dependencies) in data { - let mut ctx = ResolveContext::default(); - let path = PathBuf::from(context); - let resolved = - resolver.resolve_with_context(path, request, &mut ctx).map(|r| r.full_path()); - assert_eq!(resolved, Ok(PathBuf::from(result))); - let file_dependencies = - FxHashSet::from_iter(file_dependencies.iter().map(PathBuf::from)); - let missing_dependencies = - FxHashSet::from_iter(missing_dependencies.iter().map(PathBuf::from)); - assert_eq!(ctx.file_dependencies, file_dependencies, "{name}"); - assert_eq!(ctx.missing_dependencies, missing_dependencies, "{name}"); - } - } -} diff --git a/src/tests/exports_field.rs b/src/tests/exports_field.rs deleted file mode 100644 index 7ca73fbd..00000000 --- a/src/tests/exports_field.rs +++ /dev/null @@ -1,2546 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/exportsField.test.js -//! -//! The huge exports field test cases are at the bottom of this file. - -use crate::{Ctx, PathUtil, ResolveError, ResolveOptions, Resolver}; -use serde_json::json; -use std::path::Path; - -#[test] -fn test_simple() { - let f = super::fixture().join("exports-field"); - let f2 = super::fixture().join("exports-field2"); - let f4 = super::fixture().join("exports-field-error"); - let f5 = super::fixture().join("imports-exports-wildcard"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - fully_specified: true, - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("resolve root using exports field, not a main field", f.clone(), "exports-field", f.join("node_modules/exports-field/x.js")), - ("resolver should respect condition names", f.clone(), "exports-field/dist/main.js", f.join("node_modules/exports-field/lib/lib2/main.js")), - // enhanced_resolve behaves differently to node.js. enhanced_resolve fallbacks when an - // array item is unresolved, where as node.js fallbacks when an array has an - // InvalidPackageTarget error. - // ("resolver should respect fallback", f2.clone(), "exports-field/dist/browser.js", f2.join("node_modules/exports-field/lib/browser.js")), - // The following two tests require fallback from array values, the path is changed here to - // only test query and fragment. - ("resolver should respect query parameters #1", f2.clone(), "exports-field/dist/main.js?foo", f2.join("node_modules/exports-field/lib/lib2/main.js?foo")), - ("resolver should respect fragment parameters #1", f2.clone(), "exports-field/dist/main.js#foo", f2.join("node_modules/exports-field/lib/lib2/main.js#foo")), - ("relative path should work, if relative path as request is used", f.clone(), "./node_modules/exports-field/lib/main.js", f.join("node_modules/exports-field/lib/main.js")), - ("self-resolving root", f.clone(), "@exports-field/core", f.join("a.js")), - ("should resolve with wildcard pattern #1", f5.clone(), "m/features/f.js", f5.join("node_modules/m/src/features/f.js")), - ("should resolve with wildcard pattern #2", f5.clone(), "m/features/y/y.js", f5.join("node_modules/m/src/features/y/y.js")), - ("should resolve with wildcard pattern #3", f5.clone(), "m/features-no-ext/y/y.js", f5.join("node_modules/m/src/features/y/y.js")), - ("should resolve with wildcard pattern #4", f5.clone(), "m/middle/nested/f.js", f5.join("node_modules/m/src/middle/nested/f.js")), - ("should resolve with wildcard pattern #5", f5.clone(), "m/middle-1/nested/f.js", f5.join("node_modules/m/src/middle-1/nested/f.js")), - ("should resolve with wildcard pattern #6", f5.clone(), "m/middle-2/nested/f.js", f5.join("node_modules/m/src/middle-2/nested/f.js")), - ("should resolve with wildcard pattern #7", f5.clone(), "m/middle-3/nested/f", f5.join("node_modules/m/src/middle-3/nested/f/nested/f.js")), - ("should resolve with wildcard pattern #8", f5.clone(), "m/middle-4/f/nested", f5.join("node_modules/m/src/middle-4/f/f.js")), - ("should resolve with wildcard pattern #9", f5.clone(), "m/middle-5/f$/$", f5.join("node_modules/m/src/middle-5/f$/$.js")), - ]; - - // Not needed or snapshot: - // * should log the correct info - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } - - let p = f.join("node_modules/exports-field/package.json"); - let p2 = f2.join("node_modules/exports-field/package.json"); - let p4 = f4.join("node_modules/exports-field/package.json"); - let p5 = f5.join("node_modules/m/package.json"); - - #[rustfmt::skip] - let fail = [ - // ("throw error if extension not provided", f2.clone(), "exports-field/dist/main", ResolveError::NotFound(f2.join("node_modules/exports-field/lib/lib2/main"))), - ("resolver should respect query parameters #2. Direct matching", f2.clone(), "exports-field?foo", ResolveError::PackagePathNotExported("./?foo".into(), p2.clone())), - ("resolver should respect fragment parameters #2. Direct matching", f2, "exports-field#foo", ResolveError::PackagePathNotExported("./#foo".into(), p2)), - ("relative path should not work with exports field", f.clone(), "./node_modules/exports-field/dist/main.js", ResolveError::NotFound("./node_modules/exports-field/dist/main.js".into())), - ("backtracking should not work for request", f.clone(), "exports-field/dist/../../../a.js", ResolveError::InvalidPackageTarget("./lib/../../../a.js".to_string(), "./dist/".to_string(), p.clone())), - ("backtracking should not work for exports field target", f.clone(), "exports-field/dist/a.js", ResolveError::InvalidPackageTarget("./../../a.js".to_string(), "./dist/a.js".to_string(), p.clone())), - ("not exported error", f.clone(), "exports-field/anything/else", ResolveError::PackagePathNotExported("./anything/else".to_string(), p.clone())), - ("request ending with slash #1", f.clone(), "exports-field/", ResolveError::PackagePathNotExported("./".to_string(), p.clone())), - ("request ending with slash #2", f.clone(), "exports-field/dist/", ResolveError::PackagePathNotExported("./dist/".to_string(), p.clone())), - ("request ending with slash #3", f.clone(), "exports-field/lib/", ResolveError::PackagePathNotExported("./lib/".to_string(), p)), - ("should throw error if target is invalid", f4, "exports-field", ResolveError::InvalidPackageTarget("./a/../b/../../pack1/index.js".to_string(), ".".to_string(), p4)), - ("throw error if exports field is invalid", f.clone(), "invalid-exports-field", ResolveError::InvalidPackageConfig(f.join("node_modules/invalid-exports-field/package.json"))), - ("should throw error if target is 'null'", f5, "m/features/internal/file.js", ResolveError::PackagePathNotExported("./features/internal/file.js".to_string(), p5)), - ]; - - for (comment, path, request, error) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!(resolution, Err(error), "{comment} {path:?} {request}"); - } -} - -// resolve using exports field, not a browser field #1 -#[test] -fn exports_not_browser_field1() { - let f = super::fixture().join("exports-field"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - condition_names: vec!["webpack".into()], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "exports-field/dist/main.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("node_modules/exports-field/lib/lib2/main.js"))); -} - -// resolve using exports field and a browser alias field #2 -#[test] -fn exports_not_browser_field2() { - let f2 = super::fixture().join("exports-field2"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - extensions: vec![".js".into()], - condition_names: vec!["node".into()], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f2, "exports-field/dist/main.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f2.join("node_modules/exports-field/lib/browser.js"))); -} - -// should resolve extension without fullySpecified -#[test] -fn extension_without_fully_specified() { - let f2 = super::fixture().join("exports-field2"); - - let commonjs_resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - let resolved_path = - commonjs_resolver.resolve(&f2, "exports-field/dist/main").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f2.join("node_modules/exports-field/lib/lib2/main.js"))); -} - -#[test] -fn field_name_path() { - let f2 = super::fixture().join("exports-field2"); - let f3 = super::fixture().join("exports-field3"); - - // field name path #1 #2 #3 - let exports_fields = [ - vec![vec!["exportsField".into(), "exports".into()]], - vec![vec!["exportsField".into(), "exports".into()], vec!["exports".into()]], - vec![vec!["exports".into()], vec!["exportsField".into(), "exports".into()]], - ]; - - for exports_fields in exports_fields { - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - exports_fields, - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/main.js"))); - } - - // field name path #4 - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - exports_fields: vec![vec!["exports".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f2, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f2.join("node_modules/exports-field/index.js"))); - - // field name path #5 - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - exports_fields: vec![vec!["ex".into()], vec!["exports_field".into(), "exports".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/index"))); - - // non-compliant export targeting a directory - let resolver = Resolver::new(ResolveOptions { - exports_fields: vec![vec!["broken".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/src/index.js"))); -} - -#[test] -fn shared_resolvers() { - let f3 = super::fixture().join("exports-field3"); - - let resolver1 = Resolver::new(ResolveOptions { - exports_fields: vec![vec!["exportsField".into(), "exports".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver1.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/main.js"))); - - let resolver2 = resolver1.clone_with_options(ResolveOptions { - exports_fields: vec![vec!["ex".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver2.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/index"))); -} - -#[test] -fn extension_alias_1_2() { - let f = super::fixture().join("exports-field-and-extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - extension_alias: vec![(".js".into(), vec![".ts".into(), ".js".into()])], - fully_specified: true, - condition_names: vec!["webpack".into(), "default".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve with the `extensionAlias` option", f.clone(), "@org/pkg/string.js", f.join("node_modules/@org/pkg/dist/string.js")), - ("should resolve with the `extensionAlias` option #2", f.clone(), "pkg/string.js", f.join("node_modules/pkg/dist/string.js")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn extension_alias_3() { - let f = super::fixture().join("exports-field-and-extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - extension_alias: vec![( - ".js".into(), - vec![".foo".into(), ".baz".into(), ".baz".into(), ".ts".into(), ".js".into()], - )], - fully_specified: true, - condition_names: vec!["webpack".into(), "default".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve with the `extensionAlias` option #3", f.clone(), "pkg/string.js", f.join("node_modules/pkg/dist/string.js")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn extension_alias_throw_error() { - let f = super::fixture().join("exports-field-and-extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - extension_alias: vec![(".js".into(), vec![".ts".into()])], - fully_specified: true, - condition_names: vec!["webpack".into(), "default".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let fail = [ - // enhanced-resolve has two test cases that are exactly the same here - // https://github.com/webpack/enhanced-resolve/blob/a998c7d218b7a9ec2461fc4fddd1ad5dd7687485/test/exportsField.test.js#L2976-L3024 - ("should throw error with the `extensionAlias` option", f.clone(), "pkg/string.js", ResolveError::ExtensionAlias(f.join("node_modules/pkg/dist/string.js"))), - // TODO: The error is PackagePathNotExported in enhanced-resolve - // ("should throw error with the `extensionAlias` option", f.clone(), "pkg/string.js", ResolveError::PackagePathNotExported("node_modules/pkg/dist/string.ts".to_string())), - ]; - - for (comment, path, request, error) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!(resolution, Err(error), "{comment} {path:?} {request}"); - } -} - -// Small script for generating the test cases from enhanced-resolve -// for (c of testCases) { -// console.log("TestCase {") -// console.log(`name: ${JSON.stringify(c.name)},`) -// if (c.expect instanceof Error) { -// console.log(`expect: None,`) -// } else { -// console.log(`expect: Some(vec!${JSON.stringify(c.expect)}),`) -// } -// console.log(`exports_field: exports_field(json!(${JSON.stringify(c.suite[0], null, 2)})),`) -// console.log(`request: "${c.suite[1]}",`) -// console.log(`condition_names: vec!${JSON.stringify(c.suite[2])},`) -// console.log("},") -//} -struct TestCase { - name: &'static str, - expect: Option>, - exports_field: serde_json::Value, - request: &'static str, - condition_names: Vec<&'static str>, -} - -#[allow(clippy::needless_pass_by_value)] -fn exports_field(value: serde_json::Value) -> serde_json::Value { - value -} - -#[test] -fn test_cases() { - let test_cases = [ - TestCase { - name: "sample #1", - expect: Some(vec!["./dist/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/": { - "import": [ - "./dist/", - "./src/" - ], - "webpack": "./wp/" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "sample #1", - expect: Some(vec!["./src/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/": { - "import": [ - "./src/" - ], - "webpack": "./wp/" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - TestCase { - name: "sample #1 (wildcard)", - expect: Some(vec!["./dist/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/*": { - "import": [ - "./dist/*", - "./src/*" - ], - "webpack": "./wp/*" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "sample #1 (wildcard)", - expect: Some(vec!["./src/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/*": { - "import": [ - "./src/*" - ], - "webpack": "./wp/*" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - TestCase { - name: "sample #2", - expect: Some(vec!["./data/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./timezones/": "./data/timezones/" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #2 (wildcard)", - expect: Some(vec!["./data/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./timezones/*": "./data/timezones/*" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #3", - expect: Some(vec!["./data/timezones/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./": "./data/timezones/" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #3 (wildcard)", - expect: Some(vec!["./data/timezones/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./*": "./data/timezones/*.mjs" - })), - request: "./timezones/pdt", - condition_names: vec![], - }, - TestCase { - name: "sample #4", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./lib/": { - "browser": [ - "./browser/" - ] - }, - "./dist/index.js": { - "node": "./index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #4 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "node": "./index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #5", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/": { - "browser": [ - "./browser/" - ] - }, - "./dist/index.js": { - "node": "./index.js", - "default": "./browser/index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #5 (wildcard)", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "node": "./index.js", - "default": "./browser/index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./dist/a": "./dist/index.js" - })), - request: "./dist/aaa", - condition_names: vec![], - }, - TestCase { - name: "sample #7", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./dist/a/a/": "./dist/index.js" - })), - request: "./dist/a/a", - condition_names: vec![], - }, - TestCase { - name: "sample #7 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./dist/a/a/*": "./dist/index.js" - })), - request: "./dist/a/a", - condition_names: vec![], - }, - TestCase { - name: "sample #8", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": "./index.js" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #9", - expect: Some(vec!["./main.js"]), - exports_field: exports_field(json!({ - "./index.js": "./main.js" - })), - request: "./index.js", - condition_names: vec![], - }, - TestCase { - name: "sample #10", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #11", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./bar#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #12", - expect: Some(vec!["./ok.js#abc"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/ok.js#abc", - condition_names: vec![], - }, - TestCase { - name: "sample #12", - expect: Some(vec!["./ok.js#abc"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/ok.js#abc", - condition_names: vec![], - }, - TestCase { - name: "sample #13", - expect: Some(vec!["./ok.js?abc"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/ok.js?abc", - condition_names: vec![], - }, - TestCase { - name: "sample #14", - expect: Some(vec!["./🎉.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/🎉.js", - condition_names: vec![], - }, - TestCase { - name: "sample #15", - expect: Some(vec!["./%F0%9F%8E%89.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/%F0%9F%8E%89.js", - condition_names: vec![], - }, - TestCase { - name: "sample #16", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./🎉", - condition_names: vec![], - }, - TestCase { - name: "sample #17", - expect: Some(vec!["./other.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./%F0%9F%8E%89", - condition_names: vec![], - }, - TestCase { - name: "sample #18", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./module", - condition_names: vec![], - }, - TestCase { - name: "sample #19", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./module#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #20", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./module?foo", - condition_names: vec![], - }, - TestCase { - name: "sample #21", - expect: Some(vec!["./zizizi"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./z*z*z*" - })), - request: "./#zippi", - condition_names: vec![], - }, - TestCase { - name: "sample #22", - expect: Some(vec!["./d?e?f"]), - exports_field: exports_field(json!({ - "./a?b?c/": "./" - })), - request: "./a?b?c/d?e?f", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #1", - expect: Some(vec!["./dist/index.js"]), - exports_field: exports_field(json!({ - ".": "./dist/index.js" - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #2", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./": "./", - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #3", - expect: Some(vec!["./dist/a.js"]), - exports_field: exports_field(json!({ - "./dist/": "./dist/", - "./dist/*": "./dist/*", - "./dist*": "./dist*", - "./dist/index.js": "./dist/a.js" - })), - request: "./dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #4", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./": { - "browser": [ - "./browser/" - ] - }, - "./*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "browser": "./index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #5", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./": { - "browser": [ - "./browser/" - ] - }, - "./*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "node": "./node.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #6", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - ".": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #7", - expect: Some(vec!["./src/index.js"]), // `enhanced_resolve` is `None` - exports_field: exports_field(json!({ - ".": { - "default": "./src/index.js", - "browser": "./index.js", - "node": "./src/node/index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #8", - expect: Some(vec!["./src/index.js"]), - exports_field: exports_field(json!({ - ".": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #9", - expect: Some(vec!["./index"]), - exports_field: exports_field(json!({ - ".": "./index" - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #10", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./index": "./index.js" - })), - request: "./index", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #11", - expect: Some(vec!["./foo.js"]), - exports_field: exports_field(json!({ - "./": "./", - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #12", - expect: Some(vec!["./foo/bar/baz.js"]), - exports_field: exports_field(json!({ - "./": "./", - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo/bar/baz.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #13", - expect: Some(vec!["./foo/bar/baz.js"]), - exports_field: exports_field(json!({ - "./": "./", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo/bar/baz.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #14", - expect: Some(vec!["./foo/bar/baz.js"]), - exports_field: exports_field(json!({ - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo/bar/baz.js", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #1", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "require": "./require.js" - }, { - "import": "./import.mjs" - }] - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #2", - expect: Some(vec!["./import.mjs"]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "require": "./require.js" - }, { - "import": "./import.mjs" - }] - })), - request: ".", - condition_names: vec!["import"], - }, - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./require.js"]), - exports_field: exports_field(json!({ - ".": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./import.mjs"]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "import": "./import.mjs" - }] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./require.js"]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "require": [ - "./require.js" - ] - }, { - "import": [ - "./import.mjs", - "./import.js" - ] - }] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./import.mjs"]), - exports_field: exports_field(json!({ - ".": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "./import.mjs", - "./import.js" - ] - } - ] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./import.js"]), - exports_field: exports_field(json!({ - ".": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "./import.js" - ] - } - ] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "mapping to a folder root #1", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./timezones": "./data/timezones/" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #2", - expect: None, - exports_field: exports_field(json!({ - "./timezones/": "./data/timezones" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #3", - expect: Some(vec!["./data/timezones/pdt/index.mjs"]), - exports_field: exports_field(json!({ - "./timezones/pdt/": "./data/timezones/pdt/" - })), - request: "./timezones/pdt/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #3 (wildcard)", - expect: Some(vec!["./data/timezones/pdt/index.mjs"]), - exports_field: exports_field(json!({ - "./timezones/pdt/*": "./data/timezones/pdt/*" - })), - request: "./timezones/pdt/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #4", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./": "./timezones/" - })), - request: "./pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #4 (wildcard)", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./*": "./timezones/*" - })), - request: "./pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #5", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./": "./" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #5 (wildcard)", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./*": "./*" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #6", - expect: None, - exports_field: exports_field(json!({ - "./": "." - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #6 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "./*": "." - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #7", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": "./" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #7 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": "./*" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #1", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./": "./", - "./dist/": "./lib/" - })), - request: "./dist/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #1 (wildcard)", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./*": "./*", - "./dist/*": "./lib/*" - })), - request: "./dist/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #2", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/": "./dist/utils/", - "./dist/": "./lib/" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #2 (wildcard)", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/*": "./dist/utils/*", - "./dist/*": "./lib/*" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #3", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/index.js": "./dist/utils/index.js", - "./dist/utils/": "./dist/utils/index.mjs", - "./dist/": "./lib/" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #3 (wildcard)", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/index.js": "./dist/utils/index.js", - "./dist/utils/*": "./dist/utils/index.mjs", - "./dist/*": "./lib/*" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #4", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./": { - "browser": "./browser/" - }, - "./dist/": "./lib/" - })), - request: "./dist/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "the longest matching path prefix is prioritized #4 (wildcard)", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./*": { - "browser": "./browser/*" - }, - "./dist/*": "./lib/*" - })), - request: "./dist/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #1", - // `lodash/` does not start with './' so fallbacks to util - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "conditional mapping folder #1", - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": [ - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #1 (wildcard)", - // `lodash/` does not start with './' so fallbacks to util - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": [ - "lodash/*", - "./utils/*" - ], - "node": [ - "./utils-node/*" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "conditional mapping folder #1 (wildcard)", - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": [ - "./utils/*" - ], - "node": [ - "./utils-node/*" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #2", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./node/" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "conditional mapping folder #2 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "webpack": "./wpk/*", - "browser": [ - "lodash/*", - "./utils/*" - ], - "node": [ - "./node/*" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "conditional mapping folder #3", - expect: Some(vec!["./wpk/index.mjs"]), - exports_field: exports_field(json!({ - "./utils/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils/" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "conditional mapping folder #3 (wildcard)", - expect: Some(vec!["./wpk/index.mjs"]), - exports_field: exports_field(json!({ - "./utils/*": { - "webpack": "./wpk/*", - "browser": [ - "lodash/*", - "./utils/*" - ], - "node": [ - "./utils/*" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "incorrect exports field #1", - expect: None, - exports_field: exports_field(json!({ - "/utils/": "./a/" - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #2", - expect: None, - exports_field: exports_field(json!({ - "./utils/": "/a/" - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #3", - expect: None, - exports_field: exports_field(json!({ - "/utils/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #4", - expect: None, - exports_field: exports_field(json!({ - "./utils/": { - "browser": "/a/", - "default": "/b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #4 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "/a/", - "default": "/b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #5", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index": "./a/index.js" - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index.mjs": "./a/index.js" - })), - request: "./utils/index", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #7", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #8", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index.mjs": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - // Requests that are not `./` does not apply to `package_exports_resolve` - // TestCase { - // name: "incorrect request #1", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": "./a/" - // })), - // request: "/utils/index.mjs", - // condition_names: vec![], - // }, - // TestCase { - // name: "incorrect request #2", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": { - // "browser": "./a/", - // "default": "./b/" - // } - // })), - // request: "/utils/index.mjs", - // condition_names: vec!["browser"], - // }, - // TestCase { - // name: "incorrect request #3", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": { - // "browser": "./a/", - // "default": "./b/" - // } - // })), - // request: "../utils/index.mjs", - // condition_names: vec!["browser"], - // }, - // TestCase { - // name: "incorrect request #4", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": { - // "browser": "./a/", - // "default": "./b/" - // } - // })), - // request: "/utils/index.mjs/", - // condition_names: vec!["browser"], - // }, - TestCase { - name: "backtracking package base #1", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./../../utils/": "./dist/" - })), - request: "./../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #1 (wildcard)", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./../../utils/*": "./dist/*" - })), - request: "./../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #2", - expect: None, - exports_field: exports_field(json!({ - "../../utils/": "./dist/" - })), - request: "../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #2 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "../../utils/*": "./dist/*" - })), - request: "../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #3", - expect: None, - exports_field: exports_field(json!({ - "./utils/": "../src/" - })), - request: "./utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #3 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "./utils/*": "../src/*" - })), - request: "./utils/index", - condition_names: vec![], - }, - // enhanced-resolve does not handle backtracking here - // TestCase { - // name: "backtracking package base #4", - // expect: Some(vec!["./../src/index"]), - // exports_field: exports_field(json!({ - // "./utils/": "./../src/" - // })), - // request: "./utils/index", - // condition_names: vec![], - // }, - // TestCase { - // name: "backtracking package base #4 (wildcard)", - // expect: Some(vec!["./../src/index"]), - // exports_field: exports_field(json!({ - // "./utils/*": "./../src/*" - // })), - // request: "./utils/index", - // condition_names: vec![], - // }, - // TestCase { - // name: "backtracking package base #5", - // expect: Some(vec!["./src/../index.js"]), - // exports_field: exports_field(json!({ - // "./utils/index": "./src/../index.js" - // })), - // request: "./utils/index", - // condition_names: vec![], - // }, - TestCase { - name: "backtracking package base #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/../utils/index": "./src/../index.js" - })), - request: "./utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #7", - expect: None, - exports_field: exports_field(json!({ - "./utils/": { - "browser": "../this/" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #7", - expect: None, - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "../this/*" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #8", - // We throw "InvalidPackageTarget" - // expect: Some(vec!["./utils/../index"]), - expect: None, - exports_field: exports_field(json!({ - "./utils/": { - "browser": "./utils/../" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #8 (wildcard)", - // We throw "InvalidPackageTarget" - // expect: Some(vec!["./utils/../index"]), - expect: None, - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "./utils/../*" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #9", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./": "./src/../../", - "./dist/": "./dist/" - })), - request: "./dist/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #9 (wildcard)", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./*": "./src/../../*", - "./dist/*": "./dist/*" - })), - request: "./dist/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking target folder #1", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../../index"]), - exports_field: exports_field(json!({ - "./utils/": "./dist/" - })), - request: "./utils/timezone/../../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #1 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../../index"]), - exports_field: exports_field(json!({ - "./utils/*": "./dist/*" - })), - request: "./utils/timezone/../../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #2", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../index"]), - exports_field: exports_field(json!({ - "./utils/": "./dist/" - })), - request: "./utils/timezone/../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #2 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../index"]), - exports_field: exports_field(json!({ - "./utils/*": "./dist/*" - })), - request: "./utils/timezone/../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #3", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/target/../../index"]), - exports_field: exports_field(json!({ - "./utils/": "./dist/target/" - })), - request: "./utils/../../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #3 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/target/../../index"]), - exports_field: exports_field(json!({ - "./utils/*": "./dist/target/*" - })), - request: "./utils/../../index", - condition_names: vec![], - }, - // enhanced-resolve does not handle `node_modules` in target - TestCase { - name: "nested node_modules path #1", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": "./node_modules/" - } - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #1 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "./node_modules/*" - } - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #2", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./utils/../node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/": "./utils/../node_modules/" - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "nested node_modules path #2 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./utils/../node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": "./utils/../node_modules/*" - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "nested mapping #1", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": "./", - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested mapping #1 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": "./*", - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "nested mapping #2 (wildcard)", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #2 (wildcard)", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "nested mapping #3", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["webpack"], - }, - TestCase { - name: "nested mapping #3 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["webpack"], - }, - TestCase { - name: "nested mapping #4", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["node", "browser"], - }, - TestCase { - name: "nested mapping #4 (wildcard)", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["node", "browser"], - }, - TestCase { - name: "nested mapping #5", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node"], - }, - TestCase { - name: "nested mapping #5 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": { - "webpack": [ - "./wpck/*" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node"], - }, - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - TestCase { - name: "nested mapping #6 (wildcard)", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": { - "webpack": [ - "./wpck/*" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #6 (wildcard)", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./node/*" - ], - "default": { - "node": { - "webpack": [ - "./wpck/*" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - TestCase { - name: "nested mapping #7", - expect: Some(vec!["./y.js"]), - exports_field: exports_field(json!({ - "./a.js": { - "abc": { - "def": "./x.js" - }, - "ghi": "./y.js" - } - })), - request: "./a.js", - condition_names: vec!["abc", "ghi"], - }, - TestCase { - name: "nested mapping #8", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./a.js": { - "abc": { - "def": "./x.js", - "default": [] - }, - "ghi": "./y.js" - } - })), - request: "./a.js", - condition_names: vec!["abc", "ghi"], - }, - TestCase { - name: "syntax sugar #1", - expect: Some(vec!["./main.js"]), - exports_field: exports_field(json!("./main.js")), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #2", - expect: Some(vec![]), - exports_field: exports_field(json!("./main.js")), - request: "./lib.js", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #3", - expect: Some(vec!["./a.js"]), - exports_field: exports_field(json!(["./a.js", "./b.js"])), - request: ".", - condition_names: vec![], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "syntax sugar #3", - expect: Some(vec!["./b.js"]), - exports_field: exports_field(json!(["./b.js"])), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #4", - expect: Some(vec![]), - exports_field: exports_field(json!(["./a.js", "./b.js"])), - request: "./lib.js", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #5", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "browser": { - "default": "./index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "syntax sugar #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "browser": { - "default": "./index.js" - } - })), - request: "./lib.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "syntax sugar #7", - expect: None, - exports_field: exports_field(json!({ - "./node": "./node.js", - "browser": { - "default": "./index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "syntax sugar #8", - expect: None, - exports_field: exports_field(json!({ - "browser": { - "default": "./index.js" - }, - "./node": "./node.js" - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #1", - expect: Some(vec!["./abc/d"]), - exports_field: exports_field(json!({ - "./ab*": "./ab/*", - "./abc*": "./abc/*", - "./a*": "./a/*" - })), - request: "./abcd", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #2", - expect: Some(vec!["./abc/d/e"]), - exports_field: exports_field(json!({ - "./ab*": "./ab/*", - "./abc*": "./abc/*", - "./a*": "./a/*" - })), - request: "./abcd/e", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #3", - expect: Some(vec!["./abc/d"]), - exports_field: exports_field(json!({ - "./x/ab*": "./ab/*", - "./x/abc*": "./abc/*", - "./x/a*": "./a/*" - })), - request: "./x/abcd", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #4", - expect: Some(vec!["./abc/d/e"]), - exports_field: exports_field(json!({ - "./x/ab*": "./ab/*", - "./x/abc*": "./abc/*", - "./x/a*": "./a/*" - })), - request: "./x/abcd/e", - condition_names: vec!["browser"], - }, - TestCase { - name: "path tree edge case #1", - expect: Some(vec!["./A/b/d.js"]), - exports_field: exports_field(json!({ - "./a/": "./A/", - "./a/b/c": "./c.js" - })), - request: "./a/b/d.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #1 (wildcard)", - expect: Some(vec!["./A/b/d.js"]), - exports_field: exports_field(json!({ - "./a/*": "./A/*", - "./a/b/c": "./c.js" - })), - request: "./a/b/d.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #2", - expect: Some(vec!["./A/c.js"]), - exports_field: exports_field(json!({ - "./a/": "./A/", - "./a/b": "./b.js" - })), - request: "./a/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #2 (wildcard)", - expect: Some(vec!["./A/c.js"]), - exports_field: exports_field(json!({ - "./a/*": "./A/*", - "./a/b": "./b.js" - })), - request: "./a/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #3", - expect: Some(vec!["./A/b/d/c.js"]), - exports_field: exports_field(json!({ - "./a/": "./A/", - "./a/b/c/d": "./c.js" - })), - request: "./a/b/d/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #3 (wildcard)", - expect: Some(vec!["./A/b/d/c.js"]), - exports_field: exports_field(json!({ - "./a/*": "./A/*", - "./a/b/c/d": "./c.js" - })), - request: "./a/b/d/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #1", - expect: Some(vec!["./A/b.js"]), - exports_field: exports_field(json!({ - "./a/*.js": "./A/*.js" - })), - request: "./a/b.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #2", - expect: Some(vec!["./A/b/c.js"]), - exports_field: exports_field(json!({ - "./a/*.js": "./A/*.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #3", - expect: Some(vec!["./A/b/c.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": "./A/*/c.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #4", - expect: Some(vec!["./A/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": "./A/*/*.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #5", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/*.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #5", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/*.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./lib/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #6", - expect: Some(vec!["./browser/foo/bar.js"]), - exports_field: exports_field(json!({ - "./lib/*/bar.js": { - "browser": [ - "./browser/*/bar.js" - ] - }, - "./dist/*/bar.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./lib/foo/bar.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #6", - expect: Some(vec!["./browser/foo.js"]), - exports_field: exports_field(json!({ - "./lib/*/bar.js": { - "browser": [ - "./browser/*/bar.js" - ] - }, - "./dist/*/bar.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./dist/foo/bar.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #7", - expect: Some(vec!["./browser/foo/default.js"]), - exports_field: exports_field(json!({ - "./lib/*/bar.js": { - "browser": [ - "./browser/*/bar.js" - ] - }, - "./dist/*/bar.js": { - "node": "./*.js", - "default": "./browser/*/default.js" - } - })), - request: "./dist/foo/bar.js", - condition_names: vec!["default"], - }, - TestCase { - name: "wildcard pattern #8", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": "./A/*/*/*.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #9", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": [ - "./A/*/*/*.js", - "./B/*/*/*.js" - ] - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "wildcard pattern #9", - expect: Some(vec!["./B/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": [ - "./B/*/*/*.js" - ] - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #10", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/foo-*/c.js": "./A/*/*/*.js" - })), - request: "./a/foo-b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #11", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*-foo/c.js": "./A/*/*/*.js" - })), - request: "./a/b-foo/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #12", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/foo-*-foo/c.js": "./A/*/*/*.js" - })), - request: "./a/foo-b-foo/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #13", - expect: Some(vec!["./A/b/c/d.js"]), - exports_field: exports_field(json!({ - "./a/foo-*-foo/c.js": "./A/b/c/d.js" - })), - request: "./a/foo-b-foo/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #14", - expect: Some(vec!["./A/b/c/*.js"]), - exports_field: exports_field(json!({ - "./a/foo-foo/c.js": "./A/b/c/*.js" - })), - request: "./a/foo-foo/c.js", - condition_names: vec![], - }, - ]; - - for case in test_cases { - let resolved = Resolver::new(ResolveOptions { - condition_names: case - .condition_names - .iter() - .map(ToString::to_string) - .collect::>(), - ..ResolveOptions::default() - }) - .package_exports_resolve( - Path::new(""), - case.request, - &case.exports_field, - &mut Ctx::default(), - ) - .map(|p| p.map(|p| p.to_path_buf())); - if let Some(expect) = case.expect { - if expect.is_empty() { - assert!( - matches!(resolved, Err(ResolveError::PackagePathNotExported(_, _))), - "{} {:?}", - &case.name, - &resolved - ); - } else { - for expect in expect { - assert_eq!(resolved, Ok(Some(Path::new(expect).normalize())), "{}", &case.name); - } - } - } else { - assert!(resolved.is_err(), "{} {resolved:?}", &case.name); - } - } -} diff --git a/src/tests/extension_alias.rs b/src/tests/extension_alias.rs deleted file mode 100644 index cc6a906b..00000000 --- a/src/tests/extension_alias.rs +++ /dev/null @@ -1,70 +0,0 @@ -//! - -use crate::{ResolveError, ResolveOptions, Resolver}; - -#[test] -fn extension_alias() { - let f = super::fixture().join("extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - extension_alias: vec![ - (".js".into(), vec![".ts".into(), ".js".into()]), - (".mjs".into(), vec![".mts".into()]), - ], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should alias fully specified file", f.clone(), "./index.js", f.join("index.ts")), - ("should alias fully specified file when there are two alternatives", f.clone(), "./dir/index.js", f.join("dir/index.ts")), - ("should also allow the second alternative", f.clone(), "./dir2/index.js", f.join("dir2/index.js")), - ("should support alias option without an array", f.clone(), "./dir2/index.mjs", f.join("dir2/index.mts")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } - - #[rustfmt::skip] - let fail = [ - ("should not allow to fallback to the original extension or add extensions", f.clone(), "./index.mjs"), - ]; - - for (comment, path, request) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!( - resolution, - Err(ResolveError::ExtensionAlias(f.join(request))), - "{comment} {path:?} {request}" - ); - } -} - -// should not apply extension alias to extensions or mainFiles field -#[test] -fn not_apply_to_extension_nor_main_files() { - let f = super::fixture().join("extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - extension_alias: vec![(".js".into(), vec![])], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("directory", f.clone(), "./dir2", "dir2/index.js"), - ("file", f.clone(), "./dir2/index", "dir2/index.js"), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - let expected = f.join(expected); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} diff --git a/src/tests/extensions.rs b/src/tests/extensions.rs deleted file mode 100644 index 1ebd86f4..00000000 --- a/src/tests/extensions.rs +++ /dev/null @@ -1,125 +0,0 @@ -//! - -use crate::{EnforceExtension, Resolution, ResolveContext, ResolveError, ResolveOptions, Resolver}; -use rustc_hash::FxHashSet; - -#[test] -fn extensions() { - let f = super::fixture().join("extensions"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".ts".into(), ".js".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve according to order of provided extensions", "./foo", "foo.ts"), - ("should resolve according to order of provided extensions (dir index)", "./dir", "dir/index.ts"), - ("should resolve according to main field in module root", ".", "index.js"), - // This is a core module - // ("should resolve single file module before directory", "module", "node_modules/module.js"), - ("should resolve trailing slash directory before single file", "module/", "node_modules/module/index.ts"), - ]; - - for (comment, request, expected_path) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - let expected = f.join(expected_path); - assert_eq!(resolved_path, Ok(expected), "{comment} {request} {expected_path}"); - } - - #[rustfmt::skip] - let fail = [ - ("not resolve to file when request has a trailing slash (relative)", "./foo.js/", "./foo.js/".into()) - ]; - - for (comment, request, expected_error) in fail { - let resolution = resolver.resolve(&f, request); - let error = ResolveError::NotFound(expected_error); - assert_eq!(resolution, Err(error), "{comment} {request} {resolution:?}"); - } -} - -// should default enforceExtension to true when extensions includes an empty string -#[test] -fn default_enforce_extension() { - let f = super::fixture().join("extensions"); - - let mut ctx = ResolveContext::default(); - let resolved = Resolver::new(ResolveOptions { - extensions: vec![".ts".into(), String::new(), ".js".into()], - ..ResolveOptions::default() - }) - .resolve_with_context(&f, "./foo", &mut ctx); - - assert_eq!(resolved.map(Resolution::into_path_buf), Ok(f.join("foo.ts"))); - assert_eq!( - ctx.file_dependencies, - FxHashSet::from_iter([f.join("foo.ts"), f.join("package.json")]) - ); - assert!(ctx.missing_dependencies.is_empty()); -} - -// should respect enforceExtension when extensions includes an empty string -#[test] -fn respect_enforce_extension() { - let f = super::fixture().join("extensions"); - - let mut ctx = ResolveContext::default(); - let resolved = Resolver::new(ResolveOptions { - enforce_extension: EnforceExtension::Disabled, - extensions: vec![".ts".into(), String::new(), ".js".into()], - ..ResolveOptions::default() - }) - .resolve_with_context(&f, "./foo", &mut ctx); - - assert_eq!(resolved.map(Resolution::into_path_buf), Ok(f.join("foo.ts"))); - assert_eq!( - ctx.file_dependencies, - FxHashSet::from_iter([f.join("foo.ts"), f.join("package.json")]) - ); - assert_eq!(ctx.missing_dependencies, FxHashSet::from_iter([f.join("foo")])); -} - -#[test] -fn multi_dot_extension() { - let f = super::fixture().join("extensions"); - - let resolver = Resolver::new(ResolveOptions { - // Test for `.d.ts`, not part of enhanced-resolve. - extensions: vec![".a.b.c".into(), ".d.ts".into(), ".ts".into(), ".js".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve according to order of provided extensions", "./foo", "foo.ts"), - ("should resolve file with extension", "./app.module", "app.module.js") - ]; - - for (comment, request, expected_path) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - let expected = f.join(expected_path); - assert_eq!(resolved_path, Ok(expected), "{comment} {request} {expected_path}"); - } - - #[rustfmt::skip] - let fail = [ - ("not resolve to file", "./index.", "./index.".into()) - ]; - - for (comment, request, expected_error) in fail { - let resolution = resolver.resolve(&f, request); - let error = ResolveError::NotFound(expected_error); - assert_eq!(resolution, Err(error), "{comment} {request} {resolution:?}"); - } -} - -#[test] -#[should_panic = "All extensions must start with a leading dot"] -fn without_leading_dot() { - Resolver::new(ResolveOptions { - extensions: vec!["ts".into(), "js".into()], - ..ResolveOptions::default() - }); -} diff --git a/src/tests/fallback.rs b/src/tests/fallback.rs deleted file mode 100644 index 3da2d767..00000000 --- a/src/tests/fallback.rs +++ /dev/null @@ -1,100 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/fallback.test.js - -#[test] -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -fn fallback() { - use super::memory_fs::MemoryFS; - use crate::{AliasValue, ResolveError, ResolveOptions, ResolverGeneric}; - use std::path::{Path, PathBuf}; - - let f = Path::new("/"); - - let file_system = MemoryFS::new(&[ - ("/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", ""), - ]); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - fallback: vec![ - ("aliasA".into(), vec![AliasValue::Path("a".into())]), - ("b$".into(), vec![AliasValue::Path("a/index".into())]), - ("c$".into(), vec![AliasValue::Path("/a/index".into())]), - ( - "multiAlias".into(), - vec![ - AliasValue::Path("b".into()), - AliasValue::Path("c".into()), - AliasValue::Path("d".into()), - AliasValue::Path("e".into()), - AliasValue::Path("a".into()), - ], - ), - ("recursive".into(), vec![AliasValue::Path("recursive/dir".into())]), - ("/d/dir".into(), vec![AliasValue::Path("/c/dir".into())]), - ("/d/index.js".into(), vec![AliasValue::Path("/c/index".into())]), - ("ignored".into(), vec![AliasValue::Ignore]), - ("node:path".into(), vec![AliasValue::Ignore]), - ], - modules: vec!["/".into()], - ..ResolveOptions::default() - }, - ); - - #[rustfmt::skip] - let pass = [ - ("should resolve a not aliased module 1", "a", "/a/index"), - ("should resolve a not aliased module 2", "a/index", "/a/index"), - ("should resolve a not aliased module 3", "a/dir", "/a/dir/index"), - ("should resolve a not aliased module 4", "a/dir/index", "/a/dir/index"), - ("should resolve an fallback module 1", "aliasA", "/a/index"), - ("should resolve an fallback module 2", "aliasA/index", "/a/index"), - ("should resolve an fallback module 3", "aliasA/dir", "/a/dir/index"), - ("should resolve an fallback module 4", "aliasA/dir/index", "/a/dir/index"), - ("should resolve a recursive aliased module 1", "recursive", "/recursive/index"), - ("should resolve a recursive aliased module 2", "recursive/index", "/recursive/index"), - ("should resolve a recursive aliased module 3", "recursive/dir", "/recursive/dir/index"), - ("should resolve a recursive aliased module 4", "recursive/dir/index", "/recursive/dir/index"), - ("should resolve a recursive aliased module 5", "recursive/file", "/recursive/dir/file"), - ("should resolve a file aliased module with a query 1", "b?query", "/b/index?query"), - ("should resolve a file aliased module with a query 2", "c?query", "/c/index?query"), - ("should resolve a path in a file aliased module 1", "b/index", "/b/index"), - ("should resolve a path in a file aliased module 2", "b/dir", "/b/dir/index"), - ("should resolve a path in a file aliased module 3", "b/dir/index", "/b/dir/index"), - ("should resolve a path in a file aliased module 4", "c/index", "/c/index"), - ("should resolve a path in a file aliased module 5", "c/dir", "/c/dir/index"), - ("should resolve a path in a file aliased module 6", "c/dir/index", "/c/dir/index"), - ("should resolve a file in multiple aliased dirs 1", "multiAlias/dir/file", "/e/dir/file"), - ("should resolve a file in multiple aliased dirs 2", "multiAlias/anotherDir", "/e/anotherDir/index"), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - - #[rustfmt::skip] - let ignore = [ - ("should resolve an ignore module", "ignored", ResolveError::Ignored(f.join("ignored"))), - ("should resolve node: builtin module", "node:path", ResolveError::Ignored(PathBuf::from("/node:path"))), - ]; - - for (comment, request, expected) in ignore { - let resolution = resolver.resolve(f, request); - assert_eq!(resolution, Err(expected), "{comment} {request}"); - } -} diff --git a/src/tests/full_specified.rs b/src/tests/full_specified.rs deleted file mode 100644 index a70c0191..00000000 --- a/src/tests/full_specified.rs +++ /dev/null @@ -1,113 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/fullSpecified.test.js - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows { - use std::path::PathBuf; - - use crate::{AliasValue, ResolveOptions, ResolverGeneric}; - - use super::super::memory_fs::MemoryFS; - - fn file_system() -> MemoryFS { - MemoryFS::new(&[ - ("/a/node_modules/package1/index.js", ""), - ("/a/node_modules/package1/file.js", ""), - ("/a/node_modules/package2/package.json", r#"{"main":"a"}"#), - ("/a/node_modules/package2/a.js", ""), - ("/a/node_modules/package3/package.json", r#"{"main":"dir"}"#), - ("/a/node_modules/package3/dir/index.js", ""), - ("/a/node_modules/package4/package.json", r#"{"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", ""), - ]) - } - - #[test] - fn test() { - let file_system = file_system(); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - alias: vec![ - ("alias1".into(), vec![AliasValue::from("/a/abc")]), - ("alias2".into(), vec![AliasValue::from("/a")]), - ], - alias_fields: vec![vec!["browser".into()]], - fully_specified: true, - ..ResolveOptions::default() - }, - ); - - let failing_resolves = [ - ("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"), - ]; - - for (comment, request) in failing_resolves { - let resolution = resolver.resolve("/a", request); - assert!(resolution.is_err(), "{comment} {request}"); - } - - let successful_resolves = [ - ("fully relative", "./abc.js", "/a/abc.js"), - ("fully absolute", "/a/abc.js", "/a/abc.js"), - ("fully relative in package", "package1/file.js", "/a/node_modules/package1/file.js"), - ("extensions in mainFiles", "package1", "/a/node_modules/package1/index.js"), - ("extensions in mainFields", "package2", "/a/node_modules/package2/a.js"), - ("extensions in alias", "alias1", "/a/abc.js"), - ("directories in alias", "alias2", "/a/index.js"), - ("directories in packages", "package3", "/a/node_modules/package3/dir/index.js"), - ("extensions in aliasFields", "package4/a.js", "/a/node_modules/package4/b.js"), - ]; - - for (comment, request, expected) in successful_resolves { - let resolution = resolver.resolve("/a", request).map(|r| r.full_path()); - assert_eq!(resolution, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - } - - #[test] - #[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. - fn resolve_to_context() { - let file_system = file_system(); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - alias: vec![ - ("alias1".into(), vec![AliasValue::from("/a/abc")]), - ("alias2".into(), vec![AliasValue::from("/a")]), - ], - alias_fields: vec![vec!["browser".into()]], - fully_specified: true, - resolve_to_context: true, - ..ResolveOptions::default() - }, - ); - - let successful_resolves = [ - ("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", "/a/node_modules/package3/dir"), - ]; - - for (comment, request, expected) in successful_resolves { - let resolution = resolver.resolve("/a", request).map(|r| r.full_path()); - assert_eq!(resolution, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - } -} diff --git a/src/tests/imports_field.rs b/src/tests/imports_field.rs deleted file mode 100644 index c928627a..00000000 --- a/src/tests/imports_field.rs +++ /dev/null @@ -1,1320 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/importsField.test.js -//! -//! The huge imports field test cases are at the bottom of this file. - -use serde_json::json; - -use crate::{Ctx, JSONMap, PathUtil, ResolveError, ResolveOptions, Resolver}; -use std::path::Path; - -#[test] -fn test_simple() { - let f = super::fixture().join("imports-field"); - let f2 = super::fixture().join("imports-exports-wildcard/node_modules/m/"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve using imports field instead of self-referencing", f.clone(), "#imports-field", f.join("b.js")), - ("should resolve using imports field instead of self-referencing for a subpath", f.join("dir"), "#imports-field", f.join("b.js")), - ("should resolve package #1", f.clone(), "#a/dist/main.js", f.join("node_modules/a/lib/lib2/main.js")), - ("should resolve package #3", f.clone(), "#ccc/index.js", f.join("node_modules/c/index.js")), - ("should resolve package #4", f.clone(), "#c", f.join("node_modules/c/index.js")), - ("should resolve with wildcard pattern", f2.clone(), "#internal/i.js", f2.join("src/internal/i.js")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } - - // Note added: - // * should resolve absolute path as an imports field target - // * should log the correct info - - #[rustfmt::skip] - let fail = [ - ("should disallow resolve out of package scope", f.clone(), "#b", ResolveError::InvalidPackageTarget("../b.js".to_string(), "#b".to_string(), f.join("package.json"))), - ("should resolve package #2", f.clone(), "#a", ResolveError::PackageImportNotDefined("#a".to_string(), f.join("package.json"))), - ]; - - for (comment, path, request, error) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!(resolution, Err(error), "{comment} {path:?} {request}"); - } -} - -#[test] -fn shared_resolvers() { - let f = super::fixture().join("imports-field"); - - // field name #1 - let resolver1 = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - imports_fields: vec![vec!["imports".into()]], - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - let resolved_path = resolver1.resolve(&f, "#imports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("b.js"))); - - // field name #2 - let resolver2 = resolver1.clone_with_options(ResolveOptions { - imports_fields: vec![vec!["other".into(), "imports".into()]], - ..ResolveOptions::default() - }); - - let resolved_path = resolver2.resolve(&f, "#b").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("a.js"))); -} - -// Small script for generating the test cases from enhanced_resolve -// for (c of testCases) { -// console.log("TestCase {") -// console.log(`name: ${JSON.stringify(c.name)},`) -// if (c.expect instanceof Error) { -// console.log(`expect: None,`) -// } else { -// console.log(`expect: Some(vec!${JSON.stringify(c.expect)}),`) -// } -// console.log(`imports_field: imports_field(json!(${JSON.stringify(c.suite[0], null, 2)})),`) -// console.log(`request: "${c.suite[1]}",`) -// console.log(`condition_names: vec!${JSON.stringify(c.suite[2])},`) -// console.log("},") -// } - -struct TestCase { - name: &'static str, - expect: Option>, - imports_field: JSONMap, - request: &'static str, - condition_names: Vec<&'static str>, -} - -#[allow(clippy::needless_pass_by_value)] -fn imports_field(value: serde_json::Value) -> JSONMap { - let s = serde_json::to_string(&value).unwrap(); - serde_json::from_str(&s).unwrap() -} - -#[test] -fn test_cases() { - let test_cases = [ - TestCase { - name: "sample #1", - expect: Some(vec!["./dist/test/file.js"]), - imports_field: imports_field(json!({ - "#abc/": { - "import": [ - "./dist/", - "./src/" - ], - "webpack": "./wp/" - }, - "#abc": "./main.js" - })), - request: "#abc/test/file.js", - condition_names: vec!["import", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "sample #1", - expect: Some(vec!["./src/test/file.js"]), - imports_field: imports_field(json!({ - "#abc/": { - "import": [ - "./src/" - ], - "webpack": "./wp/" - }, - "#abc": "./main.js" - })), - request: "#abc/test/file.js", - condition_names: vec!["import", "webpack"], - }, - TestCase { - name: "sample #2", - expect: Some(vec!["./data/timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#1/timezones/": "./data/timezones/" - })), - request: "#1/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #3", - expect: Some(vec!["./data/timezones/timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#aaa/": "./data/timezones/", - "#a/": "./data/timezones/" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #4", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/lib/": { - "browser": [ - "./browser/" - ] - }, - "#a/dist/index.js": { - "node": "./index.js" - } - })), - request: "#a/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #5", - expect: Some(vec!["./browser/index.js"]), - imports_field: imports_field(json!({ - "#a/lib/": { - "browser": [ - "./browser/" - ] - }, - "#a/dist/index.js": { - "node": "./index.js", - "default": "./browser/index.js" - } - })), - request: "#a/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #6", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/dist/a": "./dist/index.js" - })), - request: "#a/dist/aaa", - condition_names: vec![], - }, - TestCase { - name: "sample #7", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/a/a/": "./dist/index.js" - })), - request: "#a/a/a", - condition_names: vec![], - }, - TestCase { - name: "sample #8", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": "./index.js" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #9", - expect: Some(vec!["./main.js"]), - imports_field: imports_field(json!({ - "#a/index.js": "./main.js" - })), - request: "#a/index.js", - condition_names: vec![], - }, - TestCase { - name: "sample #10", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #11", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/bar#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #12", - expect: Some(vec!["./ok.js#abc"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/ok.js#abc", - condition_names: vec![], - }, - TestCase { - name: "sample #13", - expect: Some(vec!["./ok.js?abc"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/ok.js?abc", - condition_names: vec![], - }, - TestCase { - name: "sample #14", - expect: Some(vec!["./🎉.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/🎉.js", - condition_names: vec![], - }, - TestCase { - name: "sample #15", - expect: Some(vec!["./%F0%9F%8E%89.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/%F0%9F%8E%89.js", - condition_names: vec![], - }, - TestCase { - name: "sample #16", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/🎉", - condition_names: vec![], - }, - TestCase { - name: "sample #17", - expect: Some(vec!["./other.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/%F0%9F%8E%89", - condition_names: vec![], - }, - TestCase { - name: "sample #18", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/module", - condition_names: vec![], - }, - TestCase { - name: "sample #19", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/module#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #20", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/module?foo", - condition_names: vec![], - }, - TestCase { - name: "sample #21", - expect: Some(vec!["./d?e?f"]), - imports_field: imports_field(json!({ - "#a/a?b?c/": "./" - })), - request: "#a/a?b?c/d?e?f", - condition_names: vec![], - }, - TestCase { - name: "sample #22", - // We throw InvalidPackageTarget - expect: None, - // expect: Some(vec!["/user/a/index"]), - imports_field: imports_field(json!({ - "#a/": "/user/a/" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #1", - expect: Some(vec!["./A/b/d.js"]), - imports_field: imports_field(json!({ - "#a/": "./A/", - "#a/b/c": "./c.js" - })), - request: "#a/b/d.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #2", - expect: Some(vec!["./A/c.js"]), - imports_field: imports_field(json!({ - "#a/": "./A/", - "#a/b": "./b.js" - })), - request: "#a/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #3", - expect: Some(vec!["./A/b/c/d.js"]), - imports_field: imports_field(json!({ - "#a/": "./A/", - "#a/b/c/d": "./c.js" - })), - request: "#a/b/c/d.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #1", - expect: Some(vec!["./dist/index.js"]), - imports_field: imports_field(json!({ - "#a": "./dist/index.js" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #2", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": "./" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #3", - expect: Some(vec!["./dist/a.js"]), - imports_field: imports_field(json!({ - "#a/": "./dist/", - "#a/index.js": "./dist/a.js" - })), - request: "#a/index.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #4", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "./browser/" - ] - }, - "#a/index.js": { - "browser": "./index.js" - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #5", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "./browser/" - ] - }, - "#a/index.js": { - "node": "./node.js" - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #6", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: "#a", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #7", - expect: Some(vec!["./src/index.js"]), // `enhanced_resolve` is `None` - imports_field: imports_field(json!({ - "#a": { - "default": "./src/index.js", - "browser": "./index.js", - "node": "./src/node/index.js" - } - })), - request: "#a", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #8", - expect: Some(vec!["./src/index.js"]), - imports_field: imports_field(json!({ - "#a": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #9", - expect: Some(vec!["./index"]), - imports_field: imports_field(json!({ - "#a": "./index" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #10", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/index": "./index.js" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #11", - // We throw InvalidPackageTarget - // expect: Some(vec!["b"]), - expect: None, - imports_field: imports_field(json!({ - "#a": "b" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #12", - // We throw InvalidPackageTarget - // expect: Some(vec!["b/index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "b/" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #13", - // We throw InvalidPackageTarget - // expect: Some(vec!["b#anotherhashishere"]), - expect: None, - imports_field: imports_field(json!({ - "#a?q=a#hashishere": "b#anotherhashishere" - })), - request: "#a?q=a#hashishere", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #1", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #2", - expect: Some(vec!["./import.mjs"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec!["import"], - }, - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./require.js"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./import.mjs"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./require.js"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": [ - "./require.js" - ] - }, - { - "import": [ - "./import.mjs", - "#b/import.js" - ] - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./import.mjs"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "./import.mjs", - "#b/import.js" - ] - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "#b/import.js" - ] - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "mapping to a folder root #1", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#timezones": "./data/timezones/" - })), - request: "#timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #2", - expect: None, - imports_field: imports_field(json!({ - "#timezones/": "./data/timezones" - })), - request: "#timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #3", - expect: Some(vec!["./data/timezones/pdt/index.mjs"]), - imports_field: imports_field(json!({ - "#timezones/pdt/": "./data/timezones/pdt/" - })), - request: "#timezones/pdt/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #4", - expect: Some(vec!["./timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#a/": "./timezones/" - })), - request: "#a/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #5", - expect: Some(vec!["./timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#a/": "./" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #6", - expect: None, - imports_field: imports_field(json!({ - "#a/": "." - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #7", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": "./" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #1", - expect: Some(vec!["./lib/index.mjs"]), - imports_field: imports_field(json!({ - "#a/": "./", - "#a/dist/": "./lib/" - })), - request: "#a/dist/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #2", - expect: Some(vec!["./dist/utils/index.js"]), - imports_field: imports_field(json!({ - "#a/dist/utils/": "./dist/utils/", - "#a/dist/": "./lib/" - })), - request: "#a/dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #3", - expect: Some(vec!["./dist/utils/index.js"]), - imports_field: imports_field(json!({ - "#a/dist/utils/index.js": "./dist/utils/index.js", - "#a/dist/utils/": "./dist/utils/index.mjs", - "#a/dist/": "./lib/" - })), - request: "#a/dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #4", - expect: Some(vec!["./lib/index.mjs"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./browser/" - }, - "#a/dist/": "./lib/" - })), - request: "#a/dist/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #1", - // This behaves differently from enhanced_resolve, because `lodash/` is an an InvalidPackageConfig - // expect: Some(vec!["lodash/index.js"]), - expect: Some(vec!["./utils/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "conditional mapping folder #1", - expect: Some(vec!["./utils/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #2", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./node/" - ] - } - })), - request: "#a/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "conditional mapping folder #3", - expect: Some(vec!["./wpk/index.mjs"]), - imports_field: imports_field(json!({ - "#a/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils/" - ] - } - })), - request: "#a/index.mjs", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "incorrect exports field #1", - // We throw `PackageImportNotDefined` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "/utils/": "./a/" - })), - request: "#a/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #2", - // We throw `PackageImportNotDefined` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "/utils/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#a/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #3", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index": "./a/index.js" - })), - request: "#a/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #4", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index.mjs": "./a/index.js" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #5", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "#a/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #6", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index.mjs": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "#a/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #1", - // We don't throw in `package_imports_exports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": "./a/" - })), - request: "/utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect request #2", - // We don't throw in `package_imports_exports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #3", - // We don't throw in `package_imports_exports_resolve`, it's thrown in `package_imports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #4", - // We don't throw in `package_imports_exports_resolve`, it's thrown in `package_imports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#/", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #5", - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#a/", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #1", - // expect: Some(vec!["./dist/index"]), - expect: Some(vec!["dist/index"]), - imports_field: imports_field(json!({ - "#a/../../utils/": "./dist/" - })), - request: "#a/../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #2", - // We throw InvalidPackageTarget - // expect: Some(vec!["./dist/../../utils/index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "./dist/" - })), - request: "#a/../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #3", - // We throw InvalidPackageTarget - // expect: Some(vec!["../src/index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "../src/" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #4", - // We throw InvalidPackageTarget - // expect: Some(vec!["./utils/../../../index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": { - "browser": "./utils/../../../" - } - })), - request: "#a/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #1", - // expect: Some(vec!["moment/node_modules/lodash/dist/index.js"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": { - "browser": "moment/node_modules/" - } - })), - request: "#a/lodash/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #2", - // We throw InvalidPackageTarget - // expect: Some(vec!["../node_modules/lodash/dist/index.js"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "../node_modules/" - })), - request: "#a/lodash/dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "nested mapping #1", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": "./", - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./node/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "nested mapping #3", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["webpack"], - }, - TestCase { - name: "nested mapping #4", - // We throw NotFound - // expect: Some(vec!["moment/node/index.js"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "moment/node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["node", "browser"], - }, - TestCase { - name: "nested mapping #5", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "node"], - }, - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./node/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - TestCase { - name: "nested mapping #7", - expect: Some(vec!["./y.js"]), - imports_field: imports_field(json!({ - "#a": { - "abc": { - "def": "./x.js" - }, - "ghi": "./y.js" - } - })), - request: "#a", - condition_names: vec!["abc", "ghi"], - }, - TestCase { - name: "nested mapping #8", - // We throw PackageImportNotDefined - // expect: Some(vec![]), - expect: None, - imports_field: imports_field(json!({ - "#a": { - "abc": { - "def": "./x.js", - "default": [] - }, - "ghi": "./y.js" - } - })), - request: "#a", - condition_names: vec!["abc", "ghi"], - }, - ]; - - for case in test_cases { - let resolved = Resolver::default() - .package_imports_exports_resolve( - case.request, - &case.imports_field, - Path::new(""), - true, - &case.condition_names.iter().map(ToString::to_string).collect::>(), - &mut Ctx::default(), - ) - .map(|p| p.map(|p| p.to_path_buf())); - if let Some(expect) = case.expect { - if expect.is_empty() { - assert!(matches!(resolved, Ok(None)), "{} {:?}", &case.name, &resolved); - } else { - for expect in expect { - assert_eq!(resolved, Ok(Some(Path::new(expect).normalize())), "{}", &case.name); - } - } - } else { - assert!(resolved.is_err(), "{} {resolved:?}", &case.name); - } - } -} diff --git a/src/tests/incorrect_description_file.rs b/src/tests/incorrect_description_file.rs deleted file mode 100644 index e2caecbb..00000000 --- a/src/tests/incorrect_description_file.rs +++ /dev/null @@ -1,65 +0,0 @@ -//! - -use rustc_hash::FxHashSet; - -use crate::{JSONError, Resolution, ResolveContext, ResolveError, ResolveOptions, Resolver}; - -// should not resolve main in incorrect description file #1 -#[test] -fn incorrect_description_file_1() { - let f = super::fixture().join("incorrect-package"); - let mut ctx = ResolveContext::default(); - let resolution = Resolver::default().resolve_with_context(f.join("pack1"), ".", &mut ctx); - let error = ResolveError::JSON(JSONError { - path: f.join("pack1/package.json"), - message: String::from("EOF while parsing a value at line 3 column 0"), - line: 3, - column: 0, - }); - assert_eq!(resolution, Err(error)); - assert_eq!( - ctx.file_dependencies, - FxHashSet::from_iter([f.join("pack1"), f.join("pack1/package.json")]) - ); - assert!(!ctx.missing_dependencies.is_empty()); -} - -// should not resolve main in incorrect description file #2 -#[test] -fn incorrect_description_file_2() { - let f = super::fixture().join("incorrect-package"); - let resolution = Resolver::default().resolve(f.join("pack2"), "."); - let error = ResolveError::JSON(JSONError { - path: f.join("pack2/package.json"), - message: String::from("EOF while parsing a value at line 1 column 0"), - line: 1, - column: 0, - }); - assert_eq!(resolution, Err(error)); -} - -// should not resolve main in incorrect description file #3 -#[test] -fn incorrect_description_file_3() { - let f = super::fixture().join("incorrect-package"); - let resolution = Resolver::default().resolve(f.join("pack2"), "."); - assert!(resolution.is_err()); -} - -// `enhanced_resolve` does not have this test case -#[test] -fn no_description_file() { - let f = super::fixture_root().join("enhanced_resolve"); - - // has description file - let resolver = Resolver::default(); - assert_eq!( - resolver.resolve(&f, ".").map(Resolution::into_path_buf), - Ok(f.join("lib/index.js")) - ); - - // without description file - let resolver = - Resolver::new(ResolveOptions { description_files: vec![], ..ResolveOptions::default() }); - assert_eq!(resolver.resolve(&f, "."), Err(ResolveError::NotFound(".".into()))); -} diff --git a/src/tests/main_field.rs b/src/tests/main_field.rs deleted file mode 100644 index 3cadc8ce..00000000 --- a/src/tests/main_field.rs +++ /dev/null @@ -1,24 +0,0 @@ -//! Not part of enhanced_resolve's test suite - -use crate::{ResolveOptions, Resolver}; - -#[test] -fn test() { - let f = super::fixture().join("restrictions"); - - let resolver1 = Resolver::new(ResolveOptions { - main_fields: vec!["style".into()], - ..ResolveOptions::default() - }); - - let resolution = resolver1.resolve(&f, "pck2").map(|r| r.full_path()); - assert_eq!(resolution, Ok(f.join("node_modules/pck2/index.css"))); - - let resolver2 = resolver1.clone_with_options(ResolveOptions { - main_fields: vec!["module".into(), "main".into()], - ..ResolveOptions::default() - }); - - let resolution = resolver2.resolve(&f, "pck2").map(|r| r.full_path()); - assert_eq!(resolution, Ok(f.join("node_modules/pck2/module.js"))); -} diff --git a/src/tests/memory_fs.rs b/src/tests/memory_fs.rs deleted file mode 100644 index e4116609..00000000 --- a/src/tests/memory_fs.rs +++ /dev/null @@ -1,74 +0,0 @@ -use std::{ - io, - path::{Path, PathBuf}, -}; - -use crate::{FileMetadata, FileSystem}; - -#[derive(Default)] -pub struct MemoryFS { - fs: vfs::MemoryFS, -} - -impl MemoryFS { - /// # Panics - /// - /// * Fails to create directory - /// * Fails to write file - #[allow(dead_code)] - pub fn new(data: &[(&'static str, &'static str)]) -> Self { - let mut fs = Self { fs: vfs::MemoryFS::default() }; - for (path, content) in data { - fs.add_file(Path::new(path), content); - } - fs - } - - #[allow(dead_code)] - pub fn add_file(&mut self, path: &Path, content: &str) { - use vfs::FileSystem; - let fs = &mut self.fs; - // Create all parent directories - for path in path.ancestors().collect::>().iter().rev() { - let path = path.to_string_lossy(); - if !fs.exists(path.as_ref()).unwrap() { - fs.create_dir(path.as_ref()).unwrap(); - } - } - // Create file - let mut file = fs.create_file(path.to_string_lossy().as_ref()).unwrap(); - file.write_all(content.as_bytes()).unwrap(); - } -} - -impl FileSystem for MemoryFS { - fn read_to_string(&self, path: &Path) -> io::Result { - use vfs::FileSystem; - let mut file = self - .fs - .open_file(path.to_string_lossy().as_ref()) - .map_err(|err| io::Error::new(io::ErrorKind::NotFound, err))?; - let mut buffer = String::new(); - file.read_to_string(&mut buffer).unwrap(); - Ok(buffer) - } - - fn metadata(&self, path: &Path) -> io::Result { - use vfs::FileSystem; - let metadata = self - .fs - .metadata(path.to_string_lossy().as_ref()) - .map_err(|err| io::Error::new(io::ErrorKind::NotFound, err))?; - let is_file = metadata.file_type == vfs::VfsFileType::File; - let is_dir = metadata.file_type == vfs::VfsFileType::Directory; - Ok(FileMetadata::new(is_file, is_dir, false)) - } - - fn symlink_metadata(&self, path: &Path) -> io::Result { - self.metadata(path) - } - - fn canonicalize(&self, _path: &Path) -> io::Result { - Err(io::Error::new(io::ErrorKind::NotFound, "not a symlink")) - } -} diff --git a/src/tests/missing.rs b/src/tests/missing.rs deleted file mode 100644 index 4bf611ef..00000000 --- a/src/tests/missing.rs +++ /dev/null @@ -1,106 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/missing.test.js - -use normalize_path::NormalizePath; - -use crate::{AliasValue, ResolveContext, ResolveOptions, Resolver}; - -#[test] -fn test() { - let f = super::fixture(); - - let data = [ - ( - "./missing-file", - vec![f.join("missing-file"), f.join("missing-file.js"), f.join("missing-file.node")], - ), - ( - "missing-module", - vec![ - f.join("node_modules/missing-module"), - f.parent().unwrap().join("node_modules"), // enhanced-resolve is "node_modules/missing-module" - ], - ), - ( - "missing-module/missing-file", - vec![ - f.join("node_modules/missing-module"), - // f.parent().unwrap().join("node_modules/missing-module"), // we don't report this - ], - ), - ( - "m1/missing-file", - vec![ - f.join("node_modules/m1/missing-file"), - f.join("node_modules/m1/missing-file.js"), - f.join("node_modules/m1/missing-file.node"), - // f.parent().unwrap().join("node_modules/m1"), // we don't report this - ], - ), - ( - "m1/", - vec![ - f.join("node_modules/m1/index"), - f.join("node_modules/m1/index.js"), - f.join("node_modules/m1/index.json"), - f.join("node_modules/m1/index.node"), - ], - ), - ("m1/a", vec![f.join("node_modules/m1/a")]), - ]; - - let resolver = Resolver::default(); - - for (specifier, missing_dependencies) in data { - let mut ctx = ResolveContext::default(); - let _ = resolver.resolve_with_context(&f, specifier, &mut ctx); - - for path in ctx.file_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - } - - for path in missing_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - assert!( - ctx.missing_dependencies.contains(&path), - "{specifier}: {path:?} not in {:?}", - &ctx.missing_dependencies - ); - } - } -} - -#[test] -fn alias_and_extensions() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias: vec![ - ( - "@scope-js/package-name/dir$".into(), - vec![AliasValue::Path(f.join("foo/index.js").to_string_lossy().to_string())], - ), - ( - "react-dom".into(), - vec![AliasValue::Path(f.join("foo/index.js").to_string_lossy().to_string())], - ), - ], - extensions: vec![".server.ts".into()], - - ..ResolveOptions::default() - }); - - let mut ctx = ResolveContext::default(); - let _ = resolver.resolve_with_context(&f, "@scope-js/package-name/dir/router", &mut ctx); - let _ = resolver.resolve_with_context(&f, "react-dom/client", &mut ctx); - - for path in ctx.file_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - } - - for path in ctx.missing_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - if let Some(path) = path.parent() { - assert!(!path.is_file(), "{path:?} must not be a file"); - } - } -} diff --git a/src/tests/mod.rs b/src/tests/mod.rs deleted file mode 100644 index e347dd1f..00000000 --- a/src/tests/mod.rs +++ /dev/null @@ -1,51 +0,0 @@ -mod alias; -mod browser_field; -mod builtins; -mod dependencies; -mod exports_field; -mod extension_alias; -mod extensions; -mod fallback; -mod full_specified; -mod imports_field; -mod incorrect_description_file; -mod main_field; -mod memory_fs; -mod missing; -#[cfg(feature = "yarn_pnp")] -mod pnp; -mod resolve; -mod restrictions; -mod roots; -mod scoped_packages; -mod simple; -mod symlink; -mod tsconfig_paths; -mod tsconfig_project_references; - -use crate::Resolver; -use std::{env, path::PathBuf, sync::Arc, thread}; - -pub fn fixture_root() -> PathBuf { - env::current_dir().unwrap().join("fixtures") -} - -pub fn fixture() -> PathBuf { - fixture_root().join("enhanced_resolve").join("test").join("fixtures") -} - -#[test] -fn threaded_environment() { - let cwd = env::current_dir().unwrap(); - let resolver = Arc::new(Resolver::default()); - for _ in 0..2 { - _ = thread::spawn({ - let cwd = cwd.clone(); - let resolver = Arc::clone(&resolver); - move || { - _ = resolver.resolve(cwd, "."); - } - }) - .join(); - } -} diff --git a/src/tests/pnp.rs b/src/tests/pnp.rs deleted file mode 100644 index 1562a009..00000000 --- a/src/tests/pnp.rs +++ /dev/null @@ -1,45 +0,0 @@ -//! Not part of enhanced_resolve's test suite -//! -//! enhanced_resolve's test -//! cannot be ported over because it uses mocks on `pnpApi` provided by the runtime. - -use crate::{ResolveOptions, Resolver}; - -#[test] -fn pnp1() { - let fixture = super::fixture_root().join("pnp"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - pnp_manifest: Some(pnp::load_pnp_manifest(fixture.join(".pnp.cjs")).unwrap()), - ..ResolveOptions::default() - }); - - assert_eq!( - resolver.resolve(&fixture, "is-even").map(|r| r.full_path()), - Ok(fixture.join( - ".yarn/cache/is-even-npm-1.0.0-9f726520dc-2728cc2f39.zip/node_modules/is-even/index.js" - )) - ); - - assert_eq!( - resolver - .resolve( - &fixture.join( - ".yarn/cache/is-even-npm-1.0.0-9f726520dc-2728cc2f39.zip/node_modules/is-even" - ), - "is-odd" - ) - .map(|r| r.full_path()), - Ok(fixture.join( - ".yarn/cache/is-odd-npm-0.1.2-9d980a9da8-7dc6c6fd00.zip/node_modules/is-odd/index.js" - )), - ); - - assert_eq!( - resolver.resolve(&fixture, "is-odd").map(|r| r.full_path()), - Ok(fixture.join( - ".yarn/cache/is-odd-npm-3.0.1-93c3c3f41b-89ee2e353c.zip/node_modules/is-odd/index.js" - )), - ); -} diff --git a/src/tests/resolve.rs b/src/tests/resolve.rs deleted file mode 100644 index f2dbb88e..00000000 --- a/src/tests/resolve.rs +++ /dev/null @@ -1,119 +0,0 @@ -//! - -use crate::{ResolveError, ResolveOptions, Resolver}; - -#[test] -fn resolve() { - let f = super::fixture(); - - let resolver = Resolver::default(); - - let main1_js_path = f.join("main1.js").to_string_lossy().to_string(); - - #[rustfmt::skip] - let pass = [ - ("absolute path", f.clone(), main1_js_path.as_str(), f.join("main1.js")), - ("file with .js", f.clone(), "./main1.js", f.join("main1.js")), - ("file without extension", f.clone(), "./main1", f.join("main1.js")), - ("another file with .js", f.clone(), "./a.js", f.join("a.js")), - ("another file without extension", f.clone(), "./a", f.join("a.js")), - ("file in module with .js", f.clone(), "m1/a.js", f.join("node_modules/m1/a.js")), - ("file in module without extension", f.clone(), "m1/a", f.join("node_modules/m1/a.js")), - ("another file in module without extension", f.clone(), "complexm/step1", f.join("node_modules/complexm/step1.js")), - ("from submodule to file in sibling module", f.join("node_modules/complexm"), "m2/b.js", f.join("node_modules/m2/b.js")), - ("from nested directory to overwritten file in module", f.join("multiple_modules"), "m1/a.js", f.join("multiple_modules/node_modules/m1/a.js")), - ("from nested directory to not overwritten file in module", f.join("multiple_modules"), "m1/b.js", f.join("node_modules/m1/b.js")), - ("file with query", f.clone(), "./main1.js?query", f.join("main1.js?query")), - ("file with fragment", f.clone(), "./main1.js#fragment", f.join("main1.js#fragment")), - ("file with fragment and query", f.clone(), "./main1.js#fragment?query", f.join("main1.js#fragment?query")), - ("file with query and fragment", f.clone(), "./main1.js?#fragment", f.join("main1.js?#fragment")), - - ("file with query (unicode)", f.clone(), "./测试.js?query", f.join("测试.js?query")), - ("file with fragment (unicode)", f.clone(), "./测试.js#fragment", f.join("测试.js#fragment")), - ("file with fragment and query (unicode)", f.clone(), "./测试.js#fragment?query", f.join("测试.js#fragment?query")), - ("file with query and fragment (unicode)", f.clone(), "./测试.js?#fragment", f.join("测试.js?#fragment")), - - ("file in module with query", f.clone(), "m1/a?query", f.join("node_modules/m1/a.js?query")), - ("file in module with fragment", f.clone(), "m1/a#fragment", f.join("node_modules/m1/a.js#fragment")), - ("file in module with fragment and query", f.clone(), "m1/a#fragment?query", f.join("node_modules/m1/a.js#fragment?query")), - ("file in module with query and fragment", f.clone(), "m1/a?#fragment", f.join("node_modules/m1/a.js?#fragment")), - ("file in module with query and fragment", f.clone(), "m1/a?#fragment", f.join("node_modules/m1/a.js?#fragment")), - ("differ between directory and file, resolve file", f.clone(), "./dirOrFile", f.join("dirOrFile.js")), - ("differ between directory and file, resolve directory", f.clone(), "./dirOrFile/", f.join("dirOrFile/index.js")), - ("find node_modules outside of node_modules", f.join("browser-module/node_modules"), "m1/a", f.join("node_modules/m1/a.js")), - ("don't crash on main field pointing to self", f.clone(), "./main-field-self", f.join("./main-field-self/index.js")), - ("don't crash on main field pointing to self (2)", f.clone(), "./main-field-self2", f.join("./main-field-self2/index.js")), - // enhanced-resolve has `#` prepended with a `\0`, they are removed from the - // following 3 expected test results. - // See https://github.com/webpack/enhanced-resolve#escaping - ("handle fragment edge case (no fragment)", f.clone(), "./no#fragment/#/#", f.join("no#fragment/#/#.js")), - ("handle fragment edge case (fragment)", f.clone(), "./no#fragment/#/", f.join("no.js#fragment/#/")), - ("handle fragment escaping", f.clone(), "./no\0#fragment/\0#/\0##fragment", f.join("no#fragment/#/#.js#fragment")), - - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn issue238_resolve() { - let f = super::fixture().join("issue-238"); - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into(), ".jsx".into(), ".ts".into(), ".tsx".into()], - modules: vec!["src/a".into(), "src/b".into(), "src/common".into(), "node_modules".into()], - ..ResolveOptions::default() - }); - let resolved_path = - resolver.resolve(f.join("src/common"), "config/myObjectFile").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("src/common/config/myObjectFile.js")),); -} - -#[test] -fn prefer_relative() { - let f = super::fixture(); - - let resolver = - Resolver::new(ResolveOptions { prefer_relative: true, ..ResolveOptions::default() }); - - #[rustfmt::skip] - let pass = [ - ("should correctly resolve with preferRelative 1", "main1.js", f.join("main1.js")), - ("should correctly resolve with preferRelative 2", "m1/a.js", f.join("node_modules/m1/a.js")), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } -} - -#[test] -fn resolve_to_context() { - let f = super::fixture(); - let resolver = - Resolver::new(ResolveOptions { resolve_to_context: true, ..ResolveOptions::default() }); - - #[rustfmt::skip] - let data = [ - ("context for fixtures", f.clone(), "./", f.clone()), - ("context for fixtures/lib", f.clone(), "./lib", f.join("lib")), - ("context for fixtures with ..", f.clone(), "./lib/../../fixtures/./lib/..", f.clone()), - ("context for fixtures with query", f.clone(), "./?query", f.clone().with_file_name("fixtures?query")), - ]; - - for (comment, path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn resolve_hash_as_module() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions::default()); - let resolution = resolver.resolve(f, "#a"); - assert_eq!(resolution, Err(ResolveError::NotFound("#a".into()))); -} diff --git a/src/tests/restrictions.rs b/src/tests/restrictions.rs deleted file mode 100644 index 5ba56596..00000000 --- a/src/tests/restrictions.rs +++ /dev/null @@ -1,25 +0,0 @@ -//! - -use crate::{ResolveError, ResolveOptions, Resolver, Restriction}; - -// TODO: regex -// * should respect RegExp restriction -// * should try to find alternative #1 -// * should try to find alternative #2 -// * should try to find alternative #3 - -// should respect string restriction -#[test] -fn restriction1() { - let fixture = super::fixture(); - let f = fixture.join("restrictions"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - restrictions: vec![Restriction::Path(f.clone())], - ..ResolveOptions::default() - }); - - let resolution = resolver.resolve(&f, "pck2"); - assert_eq!(resolution, Err(ResolveError::Restriction(fixture.join("c.js"), f))); -} diff --git a/src/tests/roots.rs b/src/tests/roots.rs deleted file mode 100644 index b50e2a07..00000000 --- a/src/tests/roots.rs +++ /dev/null @@ -1,92 +0,0 @@ -//! - -use std::path::PathBuf; - -use crate::{AliasValue, ResolveError, ResolveOptions, Resolver}; - -fn dirname() -> PathBuf { - super::fixture_root().join("enhanced_resolve").join("test") -} - -#[test] -fn roots() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - alias: vec![("foo".into(), vec![AliasValue::from("/fixtures")])], - roots: vec![dirname(), f.clone()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should respect roots option", "/fixtures/b.js", f.join("b.js")), - ("should try another root option, if it exists", "/b.js", f.join("b.js")), - ("should respect extension", "/fixtures/b", f.join("b.js")), - ("should resolve in directory", "/fixtures/extensions/dir", f.join("extensions/dir/index.js")), - ("should respect aliases", "foo/b", f.join("b.js")), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } - - #[rustfmt::skip] - let fail = [ - ("should not work with relative path", "fixtures/b.js", ResolveError::NotFound("fixtures/b.js".into())) - ]; - - for (comment, request, expected) in fail { - let resolution = resolver.resolve(&f, request); - assert_eq!(resolution, Err(expected), "{comment} {request}"); - } -} - -#[test] -fn resolve_to_context() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - roots: vec![dirname(), f.clone()], - resolve_to_context: true, - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f, "/fixtures/lib").map(|r| r.full_path()); - let expected = f.join("lib"); - assert_eq!(resolved_path, Ok(expected)); -} - -#[test] -fn prefer_absolute() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - alias: vec![("foo".into(), vec![AliasValue::from("/fixtures")])], - roots: vec![dirname(), f.clone()], - prefer_absolute: true, - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve an absolute path (prefer absolute)", f.join("b.js").to_string_lossy().to_string(), f.join("b.js")), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(&f, &request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } -} - -#[test] -fn roots_fall_through() { - let f = super::fixture(); - let absolute_path = f.join("roots_fall_through/index.js"); - let specifier = absolute_path.to_string_lossy(); - let resolution = Resolver::new(ResolveOptions::default().with_root(&f)).resolve(&f, &specifier); - assert_eq!( - resolution.map(super::super::resolution::Resolution::into_path_buf), - Ok(absolute_path) - ); -} diff --git a/src/tests/scoped_packages.rs b/src/tests/scoped_packages.rs deleted file mode 100644 index 8258f00f..00000000 --- a/src/tests/scoped_packages.rs +++ /dev/null @@ -1,25 +0,0 @@ -//! - -use crate::{ResolveOptions, Resolver}; - -#[test] -fn scoped_packages() { - let f = super::fixture().join("scoped"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("main field should work", f.clone(), "@scope/pack1", f.join("./node_modules/@scope/pack1/main.js")), - ("browser field should work", f.clone(), "@scope/pack2", f.join("./node_modules/@scope/pack2/main.js")), - ("folder request should work", f.clone(), "@scope/pack2/lib", f.join("./node_modules/@scope/pack2/lib/index.js")) - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} diff --git a/src/tests/simple.rs b/src/tests/simple.rs deleted file mode 100644 index 08e1238a..00000000 --- a/src/tests/simple.rs +++ /dev/null @@ -1,68 +0,0 @@ -//! - -use std::env; - -use crate::Resolver; - -#[test] -fn simple() { - // mimic `enhanced-resolve/test/simple.test.js` - let dirname = env::current_dir().unwrap().join("fixtures"); - let f = dirname.join("enhanced_resolve/test"); - - let resolver = Resolver::default(); - - let data = [ - ("direct", f.clone(), "../lib/index"), - ("as directory", f, ".."), - ("as module", dirname.clone(), "./enhanced_resolve"), - ]; - - for (comment, path, request) in data { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - let expected = dirname.join("enhanced_resolve/lib/index.js"); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn dashed_name() { - let f = super::fixture(); - - let resolver = Resolver::default(); - - let data = [ - (f.clone(), "dash", f.join("node_modules/dash/index.js")), - (f.clone(), "dash-name", f.join("node_modules/dash-name/index.js")), - (f.join("node_modules/dash"), "dash", f.join("node_modules/dash/index.js")), - (f.join("node_modules/dash"), "dash-name", f.join("node_modules/dash-name/index.js")), - (f.join("node_modules/dash-name"), "dash", f.join("node_modules/dash/index.js")), - (f.join("node_modules/dash-name"), "dash-name", f.join("node_modules/dash-name/index.js")), - ]; - - for (path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{path:?} {request}"); - } -} - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows { - use super::super::memory_fs::MemoryFS; - - use crate::ResolveOptions; - - #[test] - fn no_package() { - use crate::ResolverGeneric; - use std::path::Path; - let f = Path::new("/"); - let file_system = MemoryFS::new(&[]); - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions::default(), - ); - let resolved_path = resolver.resolve(f, "package"); - assert!(resolved_path.is_err()); - } -} diff --git a/src/tests/symlink.rs b/src/tests/symlink.rs deleted file mode 100644 index 7589b560..00000000 --- a/src/tests/symlink.rs +++ /dev/null @@ -1,121 +0,0 @@ -use std::{fs, io, path::Path}; - -use crate::{ResolveOptions, Resolver}; - -#[derive(Debug, Clone, Copy)] -enum FileType { - File, - Dir, -} - -#[allow(unused_variables)] -fn symlink, Q: AsRef>( - original: P, - link: Q, - file_type: FileType, -) -> io::Result<()> { - #[cfg(target_family = "unix")] - { - std::os::unix::fs::symlink(original, link) - } - - #[cfg(target_family = "windows")] - match file_type { - FileType::File => std::os::windows::fs::symlink_file(original, link), - FileType::Dir => std::os::windows::fs::symlink_dir(original, link), - } -} - -fn init(dirname: &Path, temp_path: &Path) -> io::Result<()> { - if temp_path.exists() { - _ = fs::remove_dir_all(temp_path); - } - fs::create_dir(temp_path)?; - symlink(dirname.join("../lib/index.js"), temp_path.join("test"), FileType::File)?; - symlink(dirname.join("../lib"), temp_path.join("test2"), FileType::Dir)?; - fs::remove_file(temp_path.join("test"))?; - fs::remove_file(temp_path.join("test2"))?; - fs::remove_dir(temp_path) -} - -fn create_symlinks(dirname: &Path, temp_path: &Path) -> io::Result<()> { - fs::create_dir(temp_path).unwrap(); - symlink( - dirname.join("../lib/index.js").canonicalize().unwrap(), - temp_path.join("index.js"), - FileType::File, - )?; - symlink(dirname.join("../lib").canonicalize().unwrap(), temp_path.join("lib"), FileType::Dir)?; - symlink(dirname.join("..").canonicalize().unwrap(), temp_path.join("this"), FileType::Dir)?; - symlink(temp_path.join("this"), temp_path.join("that"), FileType::Dir)?; - symlink(Path::new("../../lib/index.js"), temp_path.join("node.relative.js"), FileType::File)?; - symlink( - Path::new("./node.relative.js"), - temp_path.join("node.relative.sym.js"), - FileType::File, - )?; - Ok(()) -} - -fn cleanup_symlinks(temp_path: &Path) { - _ = fs::remove_dir_all(temp_path); -} - -#[test] -fn test() -> io::Result<()> { - let root = super::fixture_root().join("enhanced_resolve"); - let dirname = root.join("test"); - let temp_path = dirname.join("temp"); - if !temp_path.exists() { - let is_admin = init(&dirname, &temp_path).is_ok(); - if !is_admin { - return Ok(()); - } - if let Err(err) = create_symlinks(&dirname, &temp_path) { - cleanup_symlinks(&temp_path); - return Err(err); - } - } - - let resolver_without_symlinks = - Resolver::new(ResolveOptions { symlinks: false, ..ResolveOptions::default() }); - let resolver_with_symlinks = Resolver::default(); - - #[rustfmt::skip] - let pass = [ - ("with a symlink to a file", temp_path.clone(), "./index.js"), - ("with a relative symlink to a file", temp_path.clone(), "./node.relative.js"), - ("with a relative symlink to a symlink to a file", temp_path.clone(), "./node.relative.sym.js"), - ("with a symlink to a directory 1", temp_path.clone(), "./lib/index.js"), - ("with a symlink to a directory 2", temp_path.clone(), "./this/lib/index.js"), - ("with multiple symlinks in the path 1", temp_path.clone(), "./this/test/temp/index.js"), - ("with multiple symlinks in the path 2", temp_path.clone(), "./this/test/temp/lib/index.js"), - ("with multiple symlinks in the path 3", temp_path.clone(), "./this/test/temp/this/lib/index.js"), - ("with a symlink to a directory 2 (chained)", temp_path.clone(), "./that/lib/index.js"), - ("with multiple symlinks in the path 1 (chained)", temp_path.clone(), "./that/test/temp/index.js"), - ("with multiple symlinks in the path 2 (chained)", temp_path.clone(), "./that/test/temp/lib/index.js"), - ("with multiple symlinks in the path 3 (chained)", temp_path.clone(), "./that/test/temp/that/lib/index.js"), - ("with symlinked directory as context 1", temp_path.join( "lib"), "./index.js"), - ("with symlinked directory as context 2", temp_path.join( "this"), "./lib/index.js"), - ("with symlinked directory as context and in path", temp_path.join( "this"), "./test/temp/lib/index.js"), - ("with symlinked directory in context path", temp_path.join( "this/lib"), "./index.js"), - ("with symlinked directory in context path and symlinked file", temp_path.join( "this/test"), "./temp/index.js"), - ("with symlinked directory in context path and symlinked directory", temp_path.join( "this/test"), "./temp/lib/index.js"), - ("with symlinked directory as context 2 (chained)", temp_path.join( "that"), "./lib/index.js"), - ("with symlinked directory as context and in path (chained)", temp_path.join( "that"), "./test/temp/lib/index.js"), - ("with symlinked directory in context path (chained)", temp_path.join( "that/lib"), "./index.js"), - ("with symlinked directory in context path and symlinked file (chained)", temp_path.join( "that/test"), "./temp/index.js"), - ("with symlinked directory in context path and symlinked directory (chained)", temp_path.join( "that/test"), "./temp/lib/index.js") - ]; - - for (comment, path, request) in pass { - let filename = resolver_with_symlinks.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(filename, Ok(root.join("lib/index.js")), "{comment:?}"); - - let resolved_path = - resolver_without_symlinks.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(path.join(request))); - } - - Ok(()) -} diff --git a/src/tests/tsconfig_paths.rs b/src/tests/tsconfig_paths.rs deleted file mode 100644 index b85bf6be..00000000 --- a/src/tests/tsconfig_paths.rs +++ /dev/null @@ -1,530 +0,0 @@ -//! tests for tsconfig-paths -//! -//! Fixtures copied from . - -use std::path::{Path, PathBuf}; - -use crate::{ - JSONError, ResolveError, ResolveOptions, Resolver, TsConfig, TsconfigOptions, - TsconfigReferences, -}; - -// -#[test] -fn tsconfig() { - let f = super::fixture_root().join("tsconfig"); - - #[rustfmt::skip] - let pass = [ - (f.clone(), None, "ts-path", f.join("foo.js")), - (f.join("nested"), None, "ts-path", f.join("nested/test.js")), - (f.join("cases/index"), None, "foo", f.join("node_modules/tsconfig-index/foo.js")), - // This requires reading package.json.tsconfig field - // (f.join("cases/field"), "foo", f.join("node_modules/tsconfig-field/foo.js")) - (f.join("cases/exports"), None, "foo", f.join("node_modules/tsconfig-exports/foo.js")), - (f.join("cases/extends-extension"), None, "foo", f.join("cases/extends-extension/foo.js")), - (f.join("cases/extends-extensionless"), None, "foo", f.join("node_modules/tsconfig-field/foo.js")), - (f.join("cases/extends-paths"), Some("src"), "@/index", f.join("cases/extends-paths/src/index.js")), - (f.join("cases/extends-multiple"), None, "foo", f.join("cases/extends-multiple/foo.js")), - ]; - - for (dir, subdir, request, expected) in pass { - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: dir.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - let path = subdir.map_or(dir.clone(), |subdir| dir.join(subdir)); - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{request} {path:?}"); - } - - #[rustfmt::skip] - let data = [ - (f.join("node_modules/tsconfig-not-used"), "ts-path", Ok(f.join("foo.js"))), - ]; - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - for (path, request, expected) in data { - let resolution = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolution, expected, "{path:?} {request}"); - } -} - -#[test] -fn tsconfig_fallthrough() { - let f = super::fixture_root().join("tsconfig"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "/"); - assert_eq!(resolved_path, Err(ResolveError::NotFound("/".into()))); -} - -#[test] -fn json_with_comments() { - let f = super::fixture_root().join("tsconfig/cases/trailing-comma"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "foo").map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(f.join("bar.js"))); -} - -#[test] -fn broken() { - let f = super::fixture_root().join("tsconfig"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("tsconfig_broken.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "/"); - let error = ResolveError::JSON(JSONError { - path: f.join("tsconfig_broken.json"), - message: String::from("EOF while parsing an object at line 2 column 0"), - line: 2, - column: 0, - }); - assert_eq!(resolved_path, Err(error)); -} - -// -#[test] -fn test_paths() { - let path = Path::new("/foo/tsconfig.json"); - let mut tsconfig_json = serde_json::json!({ - "compilerOptions": { - "paths": { - "jquery": ["node_modules/jquery/dist/jquery"], - "*": ["generated/*"], - "bar/*": ["test/*"], - "bar/baz/*": ["baz/*", "yo/*"], - "@/components/*": ["components/*"], - "url": ["node_modules/my-url"], - } - } - }) - .to_string(); - let tsconfig = TsConfig::parse(true, path, &mut tsconfig_json).unwrap(); - - let data = [ - ("jquery", vec!["/foo/node_modules/jquery/dist/jquery"]), - ("test", vec!["/foo/generated/test"]), - ("test/hello", vec!["/foo/generated/test/hello"]), - ("bar/hi", vec!["/foo/test/hi"]), - ("bar/baz/hi", vec!["/foo/baz/hi", "/foo/yo/hi"]), - ("@/components/button", vec!["/foo/components/button"]), - ("./jquery", vec![]), - ("url", vec!["/foo/node_modules/my-url"]), - ]; - - for (specifier, expected) in data { - let paths = tsconfig.resolve_path_alias(specifier); - let expected = expected.into_iter().map(PathBuf::from).collect::>(); - assert_eq!(paths, expected, "{specifier}"); - } -} - -// -#[test] -fn test_base_url() { - let path = Path::new("/foo/tsconfig.json"); - let mut tsconfig_json = serde_json::json!({ - "compilerOptions": { - "baseUrl": "./src" - } - }) - .to_string(); - let tsconfig = TsConfig::parse(true, path, &mut tsconfig_json).unwrap(); - - let data = [ - ("foo", vec!["/foo/src/foo"]), - ("components/button", vec!["/foo/src/components/button"]), - ("./jquery", vec![]), - ]; - - for (specifier, expected) in data { - let paths = tsconfig.resolve_path_alias(specifier); - let expected = expected.into_iter().map(PathBuf::from).collect::>(); - assert_eq!(paths, expected, "{specifier}"); - } -} - -// -#[test] -fn test_paths_and_base_url() { - let path = Path::new("/foo/tsconfig.json"); - let mut tsconfig_json = serde_json::json!({ - "compilerOptions": { - "baseUrl": "./src", - "paths": { - "*": ["generated/*"], - "bar/*": ["test/*"], - "bar/baz/*": ["baz/*", "yo/*"], - "@/components/*": ["components/*"] - } - } - }) - .to_string(); - let tsconfig = TsConfig::parse(true, path, &mut tsconfig_json).unwrap(); - - let data = [ - ("test", vec!["/foo/src/generated/test", "/foo/src/test"]), - ("test/hello", vec!["/foo/src/generated/test/hello", "/foo/src/test/hello"]), - ("bar/hi", vec!["/foo/src/test/hi", "/foo/src/bar/hi"]), - ("bar/baz/hi", vec!["/foo/src/baz/hi", "/foo/src/yo/hi", "/foo/src/bar/baz/hi"]), - ("@/components/button", vec!["/foo/src/components/button", "/foo/src/@/components/button"]), - ("./jquery", vec![]), - ]; - - for (specifier, expected) in data { - let paths = tsconfig.resolve_path_alias(specifier); - let expected = expected.into_iter().map(PathBuf::from).collect::>(); - assert_eq!(paths, expected, "{specifier}"); - } -} - -// Template variable ${configDir} for substitution of config files directory path -// https://github.com/microsoft/TypeScript/pull/58042 -#[test] -fn test_template_variable() { - let f = super::fixture_root().join("tsconfig"); - let f2 = f.join("cases").join("paths_template_variable"); - - #[rustfmt::skip] - let pass = [ - (f2.clone(), "tsconfig1.json", "foo", f2.join("foo.js")), - (f2.clone(), "tsconfig2.json", "foo", f2.join("foo.js")), - (f.clone(), "tsconfig_template_variable.json", "foo", f.join("foo.js")), - ]; - - for (dir, tsconfig, request, expected) in pass { - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: dir.join(tsconfig), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&dir, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{request} {tsconfig} {dir:?}"); - } -} - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows_test { - use std::path::{Path, PathBuf}; - - use crate::{ - ResolveError, ResolveOptions, ResolverGeneric, TsconfigOptions, TsconfigReferences, - }; - - use super::super::memory_fs::MemoryFS; - - struct OneTest { - name: &'static str, - tsconfig: String, - package_json: Option<(PathBuf, String)>, - main_fields: Option>, - existing_files: Vec<&'static str>, - requested_module: &'static str, - expected_path: &'static str, - extensions: Vec, - } - - impl Default for OneTest { - fn default() -> Self { - Self { - name: "", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/*": ["location/*"] - } - } - }) - .to_string(), - package_json: None, - main_fields: None, - existing_files: vec![], - requested_module: "", - expected_path: "", - extensions: vec![ - ".js".into(), - ".json".into(), - ".node".into(), - ".ts".into(), - ".tsx".into(), - ], - } - } - } - - impl OneTest { - fn resolver(&self, root: &Path) -> ResolverGeneric { - let mut file_system = MemoryFS::default(); - - file_system.add_file(&root.join("tsconfig.json"), &self.tsconfig); - if let Some((path, package_json)) = &self.package_json { - file_system.add_file(&root.join(path).join("package.json"), package_json); - } - for path in &self.existing_files { - file_system.add_file(Path::new(path), ""); - } - - let mut options = ResolveOptions { - extensions: self.extensions.clone(), - tsconfig: Some(TsconfigOptions { - config_file: root.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }; - if let Some(main_fields) = &self.main_fields { - options.main_fields.clone_from(main_fields); - } - - ResolverGeneric::::new_with_file_system(file_system, options) - } - } - - // Path matching tests from tsconfig-paths - // * - // * - #[test] - fn match_path() { - let pass = [ - OneTest { - name: "should locate path that matches with star and exists", - existing_files: vec!["/root/location/mylib/index.ts"], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve to correct path when many are specified", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/*": ["foo1/*", "foo2/*", "location/*", "foo3/*"], - } - } - }) - .to_string(), - existing_files: vec!["/root/location/mylib/index.ts"], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should locate path that matches with star and prioritize pattern with longest prefix", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "*": ["location/*"], - "lib/*": ["location/*"], - } - } - }) - .to_string(), - existing_files: vec![ - "/root/location/lib/mylib/index.ts", - "/root/location/mylib/index.ts", - ], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should locate path that matches with star and exists with extension", - existing_files: vec![ - "/root/location/mylib.myext", - ], - requested_module: "lib/mylib", - extensions: vec![".js".into(), ".myext".into()], - expected_path: "/root/location/mylib.myext", - ..OneTest::default() - }, - OneTest { - name: "should resolve request with extension specified", - existing_files: vec![ - "/root/location/test.jpg", - ], - requested_module: "lib/test.jpg", - expected_path: "/root/location/test.jpg", - ..OneTest::default() - }, - OneTest { - name: "should locate path that matches without star and exists", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/foo": ["location/foo"] - } - } - }) - .to_string(), - existing_files: vec![ - "/root/location/foo.ts", - ], - requested_module: "lib/foo", - expected_path: "/root/location/foo.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve to parent folder when filename is in subfolder", - existing_files: vec![ - "/root/location/mylib/index.ts", - ], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve from main field in package.json", - package_json: Some((PathBuf::from("/root/location/mylib"), serde_json::json!({ - "main": "./kalle.ts" - }).to_string())), - existing_files: vec![ - "/root/location/mylib/kalle.ts", - ], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/kalle.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve from main field in package.json (js)", - package_json: Some((PathBuf::from("/root/location/mylib.js"), serde_json::json!({ - "main": "./kalle.js" - }).to_string())), - existing_files: vec![ - "/root/location/mylib.js/kalle.js", - ], - extensions: vec![".ts".into(), ".js".into()], - requested_module: "lib/mylib.js", - expected_path: "/root/location/mylib.js/kalle.js", - ..OneTest::default() - }, - OneTest { - name: "should resolve from list of fields by priority in package.json", - main_fields: Some(vec!["missing".into(), "browser".into(), "main".into()]), - package_json: Some((PathBuf::from("/root/location/mylibjs"), serde_json::json!({ - "main": "./main.js", - "browser": "./browser.js" - }).to_string())), - existing_files: vec![ - "/root/location/mylibjs/main.js", - "/root/location/mylibjs/browser.js", - ], - extensions: vec![".ts".into(), ".js".into()], - requested_module: "lib/mylibjs", - expected_path: "/root/location/mylibjs/browser.js", - ..OneTest::default() - }, -OneTest { - name: "should ignore field mappings to missing files in package.json", - main_fields: Some(vec!["browser".into(), "main".into()]), - package_json: Some((PathBuf::from("/root/location/mylibjs"), serde_json::json!({ - "main": "./kalle.js", - "browser": "./nope.js" - }).to_string())), - existing_files: vec![ - "/root/location/mylibjs/kalle.js", - ], - extensions: vec![".ts".into(), ".js".into()], - requested_module: "lib/mylibjs", - expected_path: "/root/location/mylibjs/kalle.js", - ..OneTest::default() - }, - // Tests that are not applicable: - // name: "should resolve nested main fields" - // name: "should ignore advanced field mappings in package.json" - // name: "should resolve to with the help of baseUrl when not explicitly set" - // name: "should not resolve with the help of baseUrl when asked not to" - // name: "should resolve main file with cjs file extension" - OneTest { - name: "should resolve .ts from .js alias", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "@/*": ["src/*"] - } - } - }).to_string(), - existing_files: vec![ - "/root/src/foo.ts", - ], - requested_module: "@/foo", // original data was "@/foo.ts" but I don't get why it is the case? - expected_path: "/root/src/foo.ts", // original data was "/root/src/foo" - ..OneTest::default() - }, - ]; - - let root = PathBuf::from("/root"); - - for test in pass { - let resolved_path = - test.resolver(&root).resolve(&root, test.requested_module).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(PathBuf::from(test.expected_path)), "{}", test.name); - } - - let fail = [ - OneTest { - name: "should not locate path that does not match", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/*": ["location/*"] - } - } - }) - .to_string(), - existing_files: vec!["/root/location/mylib"], - requested_module: "lib/mylibjs", - ..OneTest::default() - }, - OneTest { - name: "should not resolve typings file (index.d.ts)", - existing_files: vec!["/root/location/mylib/index.d.ts"], - requested_module: "lib/mylib", - ..OneTest::default() - }, - ]; - - for test in fail { - let resolved_path = - test.resolver(&root).resolve(&root, test.requested_module).map(|f| f.full_path()); - assert_eq!( - resolved_path, - Err(ResolveError::NotFound(test.requested_module.into())), - "{}", - test.name - ); - } - } -} diff --git a/src/tests/tsconfig_project_references.rs b/src/tests/tsconfig_project_references.rs deleted file mode 100644 index 0d019d27..00000000 --- a/src/tests/tsconfig_project_references.rs +++ /dev/null @@ -1,132 +0,0 @@ -//! Tests for tsconfig project references - -use crate::{ResolveError, ResolveOptions, Resolver, TsconfigOptions, TsconfigReferences}; - -#[test] -fn auto() { - let f = super::fixture_root().join("tsconfig/cases/project_references"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("app"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - // Test normal paths alias - (f.join("app"), "@/index.ts", f.join("app/aliased/index.ts")), - (f.join("app"), "@/../index.ts", f.join("app/index.ts")), - // Test project reference - (f.join("project_a"), "@/index.ts", f.join("project_a/aliased/index.ts")), - (f.join("project_b/src"), "@/index.ts", f.join("project_b/src/aliased/index.ts")), - // Does not have paths alias - (f.join("project_a"), "./index.ts", f.join("project_a/index.ts")), - (f.join("project_c"), "./index.ts", f.join("project_c/index.ts")), - // Template variable - { - let dir = f.parent().unwrap().join("paths_template_variable"); - (dir.clone(), "foo", dir.join("foo.js")) - } - ]; - - for (path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{request} {path:?}"); - } -} - -#[test] -fn disabled() { - let f = super::fixture_root().join("tsconfig/cases/project_references"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("app"), - references: TsconfigReferences::Disabled, - }), - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - // Test normal paths alias - (f.join("app"), "@/index.ts", Ok(f.join("app/aliased/index.ts"))), - (f.join("app"), "@/../index.ts", Ok(f.join("app/index.ts"))), - // Test project reference - (f.join("project_a"), "@/index.ts", Err(ResolveError::NotFound("@/index.ts".into()))), - (f.join("project_b/src"), "@/index.ts", Err(ResolveError::NotFound("@/index.ts".into()))), - // Does not have paths alias - (f.join("project_a"), "./index.ts", Ok(f.join("project_a/index.ts"))), - (f.join("project_c"), "./index.ts", Ok(f.join("project_c/index.ts"))), - ]; - - for (path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, expected, "{request} {path:?}"); - } -} - -#[test] -fn manual() { - let f = super::fixture_root().join("tsconfig/cases/project_references"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("app"), - references: TsconfigReferences::Paths(vec!["../project_a/conf.json".into()]), - }), - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - // Test normal paths alias - (f.join("app"), "@/index.ts", Ok(f.join("app/aliased/index.ts"))), - (f.join("app"), "@/../index.ts", Ok(f.join("app/index.ts"))), - // Test project reference - (f.join("project_a"), "@/index.ts", Ok(f.join("project_a/aliased/index.ts"))), - (f.join("project_b/src"), "@/index.ts", Err(ResolveError::NotFound("@/index.ts".into()))), - // Does not have paths alias - (f.join("project_a"), "./index.ts", Ok(f.join("project_a/index.ts"))), - (f.join("project_c"), "./index.ts", Ok(f.join("project_c/index.ts"))), - ]; - - for (path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, expected, "{request} {path:?}"); - } -} - -#[test] -fn self_reference() { - let f = super::fixture_root().join("tsconfig/cases/project_references"); - - #[rustfmt::skip] - let pass = [ - (f.join("app"), vec!["./tsconfig.json".into()]), - (f.join("app/tsconfig.json"), vec!["./tsconfig.json".into()]), - (f.join("app"), vec![f.join("app")]), - (f.join("app/tsconfig.json"), vec![f.join("app")]), - (f.join("app/tsconfig.json"), vec![f.join("project_b"), f.join("app")]), - ]; - - for (config_file, reference_paths) in pass { - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: config_file.clone(), - references: TsconfigReferences::Paths(reference_paths.clone()), - }), - ..ResolveOptions::default() - }); - let path = f.join("app"); - let resolved_path = resolver.resolve(&path, "@/index.ts").map(|f| f.full_path()); - assert_eq!( - resolved_path, - Err(ResolveError::TsconfigSelfReference(f.join("app/tsconfig.json"))), - "{config_file:?} {reference_paths:?}" - ); - } -} diff --git a/src/tsconfig.rs b/src/tsconfig.rs deleted file mode 100644 index 6a675442..00000000 --- a/src/tsconfig.rs +++ /dev/null @@ -1,223 +0,0 @@ -use std::{ - hash::BuildHasherDefault, - path::{Path, PathBuf}, - sync::Arc, -}; - -use indexmap::IndexMap; -use rustc_hash::FxHasher; -use serde::Deserialize; - -use crate::PathUtil; - -pub type CompilerOptionsPathsMap = IndexMap, BuildHasherDefault>; - -#[derive(Debug, Clone, Eq, PartialEq, Deserialize)] -#[serde(untagged)] -pub enum ExtendsField { - Single(String), - Multiple(Vec), -} - -#[derive(Debug, Deserialize)] -#[serde(rename_all = "camelCase")] -pub struct TsConfig { - /// Whether this is the caller tsconfig. - /// Used for final template variable substitution when all configs are extended and merged. - #[serde(skip)] - root: bool, - - /// Path to `tsconfig.json`. Contains the `tsconfig.json` filename. - #[serde(skip)] - pub(crate) path: PathBuf, - - #[serde(default)] - pub extends: Option, - - #[serde(default)] - pub compiler_options: CompilerOptions, - - /// Bubbled up project references with a reference to their tsconfig. - #[serde(default)] - pub references: Vec, -} - -/// Compiler Options -/// -/// -#[derive(Debug, Default, Deserialize)] -#[serde(rename_all = "camelCase")] -pub struct CompilerOptions { - base_url: Option, - - /// Path aliases - paths: Option, - - /// The actual base for where path aliases are resolved from. - #[serde(skip)] - paths_base: PathBuf, -} - -/// Project Reference -/// -/// -#[derive(Debug, Deserialize)] -pub struct ProjectReference { - /// The path property of each reference can point to a directory containing a tsconfig.json file, - /// or to the config file itself (which may have any name). - pub path: PathBuf, - - /// Reference to the resolved tsconfig - #[serde(skip)] - pub tsconfig: Option>, -} - -impl TsConfig { - pub fn parse(root: bool, path: &Path, json: &mut str) -> Result { - _ = json_strip_comments::strip(json); - let mut tsconfig: Self = serde_json::from_str(json)?; - tsconfig.root = root; - tsconfig.path = path.to_path_buf(); - let directory = tsconfig.directory().to_path_buf(); - if let Some(base_url) = tsconfig.compiler_options.base_url { - tsconfig.compiler_options.base_url = Some(directory.normalize_with(base_url)); - } - if tsconfig.compiler_options.paths.is_some() { - tsconfig.compiler_options.paths_base = - tsconfig.compiler_options.base_url.as_ref().map_or(directory, Clone::clone); - } - Ok(tsconfig) - } - - pub fn build(mut self) -> Self { - if self.root { - let dir = self.directory().to_path_buf(); - // Substitute template variable in `tsconfig.compilerOptions.paths` - if let Some(paths) = &mut self.compiler_options.paths { - for paths in paths.values_mut() { - for path in paths { - Self::substitute_template_variable(&dir, path); - } - } - } - } - self - } - - /// Directory to `tsconfig.json` - /// - /// # Panics - /// - /// * When the `tsconfig.json` path is misconfigured. - pub fn directory(&self) -> &Path { - debug_assert!(self.path.file_name().is_some()); - self.path.parent().unwrap() - } - - pub fn extend_tsconfig(&mut self, tsconfig: &Self) { - let compiler_options = &mut self.compiler_options; - if compiler_options.paths.is_none() { - compiler_options.paths_base = compiler_options - .base_url - .as_ref() - .map_or_else(|| tsconfig.compiler_options.paths_base.clone(), Clone::clone); - compiler_options.paths.clone_from(&tsconfig.compiler_options.paths); - } - if compiler_options.base_url.is_none() { - compiler_options.base_url.clone_from(&tsconfig.compiler_options.base_url); - } - } - - pub fn resolve(&self, path: &Path, specifier: &str) -> Vec { - if path.starts_with(self.base_path()) { - let paths = self.resolve_path_alias(specifier); - if !paths.is_empty() { - return paths; - } - } - for tsconfig in self.references.iter().filter_map(|reference| reference.tsconfig.as_ref()) { - if path.starts_with(tsconfig.base_path()) { - return tsconfig.resolve_path_alias(specifier); - } - } - vec![] - } - - // Copied from parcel - // - pub fn resolve_path_alias(&self, specifier: &str) -> Vec { - if specifier.starts_with(['/', '.']) { - return vec![]; - } - - let base_url_iter = self - .compiler_options - .base_url - .as_ref() - .map_or_else(Vec::new, |base_url| vec![base_url.normalize_with(specifier)]); - - let Some(paths_map) = &self.compiler_options.paths else { - return base_url_iter; - }; - - let paths = paths_map.get(specifier).map_or_else( - || { - let mut longest_prefix_length = 0; - let mut longest_suffix_length = 0; - let mut best_key: Option<&String> = None; - - for key in paths_map.keys() { - if let Some((prefix, suffix)) = key.split_once('*') { - if (best_key.is_none() || prefix.len() > longest_prefix_length) - && specifier.starts_with(prefix) - && specifier.ends_with(suffix) - { - longest_prefix_length = prefix.len(); - longest_suffix_length = suffix.len(); - best_key.replace(key); - } - } - } - - best_key.and_then(|key| paths_map.get(key)).map_or_else(Vec::new, |paths| { - paths - .iter() - .map(|path| { - path.replace( - '*', - &specifier[longest_prefix_length - ..specifier.len() - longest_suffix_length], - ) - }) - .collect::>() - }) - }, - Clone::clone, - ); - - paths - .into_iter() - .map(|p| self.compiler_options.paths_base.normalize_with(p)) - .chain(base_url_iter) - .collect() - } - - fn base_path(&self) -> &Path { - self.compiler_options - .base_url - .as_ref() - .map_or_else(|| self.directory(), |path| path.as_ref()) - } - - /// Template variable `${configDir}` for substitution of config files directory path - /// - /// NOTE: All tests cases are just a head replacement of `${configDir}`, so we are constrained as such. - /// - /// See - fn substitute_template_variable(directory: &Path, path: &mut String) { - const TEMPLATE_VARIABLE: &str = "${configDir}/"; - if let Some(stripped_path) = path.strip_prefix(TEMPLATE_VARIABLE) { - *path = directory.join(stripped_path).to_string_lossy().to_string(); - } - } -} diff --git a/tests/integration_test.rs b/tests/integration_test.rs deleted file mode 100644 index 0fc52887..00000000 --- a/tests/integration_test.rs +++ /dev/null @@ -1,103 +0,0 @@ -//! Test public APIs - -use std::{env, path::PathBuf}; - -use oxc_resolver::{EnforceExtension, Resolution, ResolveContext, ResolveOptions, Resolver}; - -fn dir() -> PathBuf { - env::current_dir().unwrap() -} - -fn resolve(specifier: &str) -> Resolution { - let path = dir(); - Resolver::new(ResolveOptions::default()).resolve(path, specifier).unwrap() -} - -#[test] -fn clone() { - let resolution = resolve("./tests/package.json"); - assert_eq!(resolution.clone(), resolution); -} - -#[test] -fn debug() { - let resolution = resolve("./tests/package.json"); - let s = format!("{resolution:?}"); - assert!(!s.is_empty()); -} - -#[test] -fn eq() { - let resolution = resolve("./tests/package.json"); - assert_eq!(resolution, resolution); -} - -#[test] -fn package_json() { - let resolution = resolve("./tests/package.json"); - let package_json = resolution.package_json().unwrap(); - assert_eq!(package_json.name.as_ref().unwrap(), "name"); - assert_eq!(package_json.r#type.as_ref().unwrap().as_str(), "module".into()); - assert!(package_json.side_effects.as_ref().unwrap().is_object()); -} - -#[cfg(feature = "package_json_raw_json_api")] -#[test] -fn package_json_raw_json_api() { - let resolution = resolve("./tests/package.json"); - assert!(resolution - .package_json() - .unwrap() - .raw_json() - .get("name") - .is_some_and(|name| name == "name")); -} - -#[test] -fn clear_cache() { - let resolver = Resolver::new(ResolveOptions::default()); - resolver.clear_cache(); // exists -} - -#[test] -fn options() { - let resolver = Resolver::new(ResolveOptions::default()); - let options = resolver.options(); - assert!(!format!("{options:?}").is_empty()); -} - -#[test] -fn debug_resolver() { - let resolver = Resolver::new(ResolveOptions::default()); - assert!(!format!("{resolver:?}").is_empty()); -} - -#[test] -fn dependencies() { - let path = dir(); - let mut ctx = ResolveContext::default(); - let _ = Resolver::new(ResolveOptions::default()).resolve_with_context( - path, - "./tests/package.json", - &mut ctx, - ); - assert!(!ctx.file_dependencies.is_empty()); - assert!(ctx.missing_dependencies.is_empty()); -} - -#[test] -fn options_api() { - _ = ResolveOptions::default() - .with_builtin_modules(true) - .with_condition_names(&[]) - .with_extension(".js") - .with_force_extension(EnforceExtension::Auto) - .with_fully_specified(true) - .with_main_field("asdf") - .with_main_file("main") - .with_module("module") - .with_prefer_absolute(true) - .with_prefer_relative(true) - .with_root(PathBuf::new()) - .with_symbolic_link(true); -} diff --git a/tests/package.json b/tests/package.json deleted file mode 100644 index 54f58b8c..00000000 --- a/tests/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "name", - "type": "module", - "sideEffects": {} -} diff --git a/tests/resolve_test.rs b/tests/resolve_test.rs deleted file mode 100644 index 45934cf8..00000000 --- a/tests/resolve_test.rs +++ /dev/null @@ -1,132 +0,0 @@ -use std::{env, path::PathBuf}; - -use oxc_resolver::{ResolveError, ResolveOptions, Resolver}; - -fn dir() -> PathBuf { - env::current_dir().unwrap() -} - -#[test] -fn chinese() { - let dir = dir(); - let specifier = "./fixtures/misc/中文/中文.js"; - let resolution = Resolver::new(ResolveOptions::default()).resolve(&dir, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(dir.join("fixtures/misc/中文/中文.js")) - ); -} - -#[test] -fn styled_components() { - let dir = dir(); - let path = dir.join("fixtures/pnpm"); - let module_path = dir.join("node_modules/.pnpm/styled-components@6.1.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/styled-components"); - let specifier = "styled-components"; - - // cjs - let options = - ResolveOptions { alias_fields: vec![vec!["browser".into()]], ..ResolveOptions::default() }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/styled-components.browser.cjs.js")) - ); - - // esm - let options = ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - main_fields: vec!["module".into()], - ..ResolveOptions::default() - }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/styled-components.browser.esm.js")) - ); -} - -#[test] -fn axios() { - let dir = dir(); - let path = dir.join("fixtures/pnpm"); - let module_path = dir.join("node_modules/.pnpm/axios@1.6.2/node_modules/axios"); - let specifier = "axios"; - - // default - let options = ResolveOptions::default(); - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("index.js")) - ); - - // browser - let options = ResolveOptions { - condition_names: vec!["browser".into(), "require".into()], - ..ResolveOptions::default() - }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/browser/axios.cjs")) - ); - - // cjs - let options = ResolveOptions { - condition_names: vec!["node".into(), "require".into()], - ..ResolveOptions::default() - }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/node/axios.cjs")) - ); -} - -#[test] -fn postcss() { - let dir = dir(); - let path = dir.join("fixtures/pnpm"); - let module_path = path.join("node_modules/postcss"); - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - // should ignore "path" - let resolution = resolver.resolve(&module_path, "path"); - assert_eq!(resolution, Err(ResolveError::Ignored(module_path.clone()))); - - // should ignore "./lib/terminal-highlight" - let resolution = resolver.resolve(&module_path, "./lib/terminal-highlight"); - assert_eq!(resolution, Err(ResolveError::Ignored(module_path.join("lib/terminal-highlight")))); -} - -#[test] -fn ipaddr_js() { - let dir = dir(); - let path = dir.join("fixtures/pnpm"); - let module_path = - dir.join("node_modules/.pnpm/ipaddr.js@2.2.0/node_modules/ipaddr.js/lib/ipaddr.js"); - - let resolvers = [ - // with `extension_alias` - Resolver::new(ResolveOptions { - extension_alias: vec![(".js".into(), vec![".js".into(), ".ts".into(), ".tsx".into()])], - ..ResolveOptions::default() - }), - // with `extensions` should still resolve to module main - Resolver::new(ResolveOptions { - extensions: vec![(".ts".into())], - ..ResolveOptions::default() - }), - // default - Resolver::default(), - ]; - - for resolver in resolvers { - let resolution = resolver.resolve(&path, "ipaddr.js").map(|r| r.full_path()); - assert_eq!(resolution, Ok(module_path.clone())); - } -} From 579359f727850f5c3e38907dd55158631897d19b Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Thu, 12 Sep 2024 04:20:21 +0300 Subject: [PATCH 76/82] --- .github/CODE_OF_CONDUCT.md | 127 - .github/SECURITY.md | 7 - .github/actions/pnpm/action.yml | 26 - .github/codecov.yml | 14 - .github/renovate.json | 5 - .github/workflows/benchmark.yml | 41 - .github/workflows/ci.yml | 196 - .github/workflows/codecov.yml | 69 - .github/workflows/release-napi.yml | 252 - .github/workflows/release-plz.yml | 55 - Cargo.lock | 1326 --- fixtures/enhanced_resolve/lib/index.js | 1 - fixtures/enhanced_resolve/package.json | 4 - fixtures/enhanced_resolve/test/.gitignore | 3 - .../enhanced_resolve/test/fixtures/#/a.js | 0 fixtures/enhanced_resolve/test/fixtures/a.js | 3 - .../enhanced_resolve/test/fixtures/abc.txt | 1 - .../test/fixtures/alias/files/a.js | 0 fixtures/enhanced_resolve/test/fixtures/b.js | 3 - .../browser-module/browser/module-a.js | 0 .../fixtures/browser-module/lib/browser.js | 0 .../fixtures/browser-module/lib/ignore.js | 0 .../test/fixtures/browser-module/lib/main.js | 0 .../fixtures/browser-module/lib/replaced.js | 0 .../test/fixtures/browser-module/lib/self.js | 0 .../fixtures/browser-module/lib/toString.js | 0 .../browser-module/node_modules/module-a.js | 0 .../browser-module/node_modules/module-b.js | 0 .../browser-module/node_modules/module-c.js | 0 .../node_modules/recursive-file/a.js | 0 .../node_modules/recursive-file/b.js | 0 .../node_modules/recursive-file/c.js | 0 .../node_modules/recursive-file/d.js | 0 .../node_modules/recursive-file/package.json | 8 - .../test/fixtures/browser-module/package.json | 33 - .../test/fixtures/builtins/package.json | 12 - fixtures/enhanced_resolve/test/fixtures/c.js | 4 - .../enhanced_resolve/test/fixtures/complex.js | 13 - .../test/fixtures/crypto-js/index.js | 0 .../test/fixtures/crypto-js/package.json | 7 - .../test/fixtures/decorated-fs/exists.js | 0 .../test/fixtures/dirOrFile.js | 1 - .../test/fixtures/dirOrFile/index.js | 1 - .../directory-default/directory-default.js | 0 .../node_modules/@org/pkg/dist/string.js | 1 - .../@org/pkg/dist/string.test.d.ts | 1 - .../node_modules/@org/pkg/package.json | 9 - .../node_modules/pkg/dist/string.js | 1 - .../node_modules/pkg/dist/string.test.d.ts | 1 - .../node_modules/pkg/package.json | 9 - .../node_modules/exports-field/package.json | 7 - .../node_modules/pack1/index.js | 0 .../test/fixtures/exports-field/a.js | 1 - .../node_modules/exports-field/lib/browser.js | 1 - .../node_modules/exports-field/lib/index.js | 0 .../exports-field/lib/lib2/main.js | 1 - .../node_modules/exports-field/lib/main.js | 1 - .../node_modules/exports-field/main.js | 1 - .../node_modules/exports-field/package.json | 18 - .../node_modules/exports-field/x.js | 1 - .../invalid-exports-field/index.js | 0 .../invalid-exports-field/package.json | 13 - .../node_modules/invalid-exports-field/umd.js | 0 .../test/fixtures/exports-field/package.json | 5 - .../node_modules/exports-field/index.js | 1 - .../node_modules/exports-field/lib/browser.js | 1 - .../exports-field/lib/lib2/main.js | 1 - .../node_modules/exports-field/lib/main.js | 1 - .../node_modules/exports-field/main.js | 1 - .../node_modules/exports-field/package.json | 17 - .../node_modules/exports-field/index | 0 .../node_modules/exports-field/main.js | 1 - .../node_modules/exports-field/package.json | 10 - .../node_modules/exports-field/src/index.js | 0 .../fixtures/extension-alias/dir/index.js | 0 .../fixtures/extension-alias/dir/index.ts | 0 .../fixtures/extension-alias/dir2/index.js | 0 .../fixtures/extension-alias/dir2/index.mts | 0 .../test/fixtures/extension-alias/index.js | 0 .../test/fixtures/extension-alias/index.mjs | 0 .../fixtures/extension-alias/index.mts.js | 0 .../test/fixtures/extension-alias/index.ts | 0 .../test/fixtures/extensions/app.module.js | 0 .../test/fixtures/extensions/dir/index.js | 0 .../test/fixtures/extensions/dir/index.ts | 0 .../test/fixtures/extensions/foo.js | 0 .../test/fixtures/extensions/foo.ts | 0 .../test/fixtures/extensions/index.js | 0 .../test/fixtures/extensions/index.ts | 0 .../extensions/node_modules/module.js | 0 .../extensions/node_modules/module/index.ts | 0 .../test/fixtures/extensions/package.json | 3 - .../enhanced_resolve/test/fixtures/file.load1 | 0 .../enhanced_resolve/test/fixtures/file.load2 | 0 .../test/fixtures/foo/index.js | 0 .../test/fixtures/foo/package.json | 4 - .../node_modules/m/package.json | 17 - .../node_modules/m/src/features/f.js | 0 .../m/src/features/internal/file.js | 0 .../node_modules/m/src/features/y/y.js | 0 .../node_modules/m/src/internal/i.js | 0 .../node_modules/m/src/middle-1/f.js | 0 .../node_modules/m/src/middle-1/nested/f.js | 0 .../node_modules/m/src/middle-2/nested/f.js | 1 - .../m/src/middle-3/nested/f/nested/f.js | 0 .../node_modules/m/src/middle-4/f/f.js | 0 .../node_modules/m/src/middle-5/f$/$.js | 0 .../node_modules/m/src/middle-5/f/$.js | 0 .../node_modules/m/src/middle/f.js | 0 .../node_modules/m/src/middle/nested/f.js | 0 .../test/fixtures/imports-field/a.js | 1 - .../test/fixtures/imports-field/b.js | 0 .../test/fixtures/imports-field/dir/b.js | 0 .../node_modules/a/lib/browser.js | 1 - .../imports-field/node_modules/a/lib/index.js | 0 .../node_modules/a/lib/lib2/main.js | 1 - .../imports-field/node_modules/a/lib/main.js | 1 - .../imports-field/node_modules/a/main.js | 1 - .../imports-field/node_modules/a/package.json | 18 - .../imports-field/node_modules/a/x.js | 1 - .../imports-field/node_modules/c/index.js | 0 .../test/fixtures/imports-field/package.json | 17 - .../fixtures/incorrect-package/pack1/a.js | 0 .../incorrect-package/pack1/package.json | 2 - .../fixtures/incorrect-package/pack2/a.js | 0 .../incorrect-package/pack2/package.json | 0 .../test/fixtures/issue-238/package.json | 3 - .../test/fixtures/issue-238/src/a/config.js | 0 .../src/common/config/myObjectFile.js | 0 .../enhanced_resolve/test/fixtures/lib.js | 0 .../test/fixtures/lib/complex1.js | 1 - .../test/fixtures/main-field-self/index.js | 0 .../fixtures/main-field-self/package.json | 3 - .../test/fixtures/main-field-self2/index.js | 0 .../fixtures/main-field-self2/package.json | 3 - .../enhanced_resolve/test/fixtures/main1.js | 9 - .../enhanced_resolve/test/fixtures/main2.js | 12 - .../enhanced_resolve/test/fixtures/main3.js | 4 - .../multiple_modules/node_modules/m1/a.js | 3 - .../test/fixtures/no#fragment/#/#.js | 0 fixtures/enhanced_resolve/test/fixtures/no.js | 0 .../browser-module-broken/browser.js | 0 .../browser-module-broken/main.js | 0 .../browser-module-broken/package.json | 4 - .../complexm/node_modules/m1/a.js | 1 - .../complexm/node_modules/m1/index.js | 1 - .../fixtures/node_modules/complexm/step1.js | 1 - .../fixtures/node_modules/complexm/step2.js | 1 - .../fixtures/node_modules/dash-name/index.js | 0 .../node_modules/dash-name/package.json | 4 - .../test/fixtures/node_modules/dash/index.js | 0 .../fixtures/node_modules/dash/package.json | 4 - .../invalidPackageJson/package.json | 0 .../test/fixtures/node_modules/m1/a.js | 3 - .../test/fixtures/node_modules/m1/b.js | 3 - .../test/fixtures/node_modules/m2/b.js | 1 - .../node_modules/recursive-module/file.js | 0 .../node_modules/recursive-module/index.js | 0 .../test/fixtures/pnp-a/m2/a.js | 3 - .../test/fixtures/pnp/pkg/dir/index.js | 0 .../test/fixtures/pnp/pkg/index.js | 0 .../test/fixtures/pnp/pkg/main.js | 0 .../fixtures/pnp/pkg/package-alias/browser.js | 0 .../fixtures/pnp/pkg/package-alias/index.js | 0 .../test/fixtures/pnp/pkg/package.json | 7 - .../test/fixtures/pnp/pkg/typescript/index.ts | 0 .../test/fixtures/pnp/pkg3/a.js | 1 - .../test/fixtures/pnp/pkg3/package.json | 8 - .../prefer-pnp/alternative-modules/m1/b.js | 0 .../restrictions/node_modules/pck1/index.css | 0 .../restrictions/node_modules/pck1/index.js | 0 .../node_modules/pck1/package.json | 3 - .../restrictions/node_modules/pck2/index.css | 0 .../restrictions/node_modules/pck2/module.js | 0 .../node_modules/pck2/package.json | 5 - .../test/fixtures/roots_fall_through/index.js | 0 .../scoped/node_modules/@scope/pack1/main.js | 0 .../node_modules/@scope/pack1/package.json | 5 - .../node_modules/@scope/pack2/lib/index.js | 0 .../scoped/node_modules/@scope/pack2/main.js | 0 .../node_modules/@scope/pack2/package.json | 3 - .../test/fixtures/shortcutdir.js/a.js | 0 .../test/fixtures/yield/a/foo-2/b | 0 .../test/fixtures/yield/a/foo-2/c | 0 .../test/fixtures/yield/a/foo/a | 0 .../test/fixtures/yield/a/foo/b | 0 .../test/fixtures/yield/b/foo/a | 0 .../test/fixtures/yield/c/foo/a | 0 .../test/fixtures/yield/c/foo/package.json | 7 - .../fixtures/\346\265\213\350\257\225.js" | 0 .../\344\270\255\346\226\207.js" | 0 fixtures/pnp/.gitignore | 1 - fixtures/pnp/.pnp.cjs | 7543 ----------------- fixtures/pnp/.yarnrc.yml | 1 - fixtures/pnp/package.json | 8 - fixtures/pnp/yarn.lock | 74 - fixtures/pnpm/.gitignore | 1 - fixtures/pnpm/package.json | 11 - fixtures/pnpm/pnpm-lock.yaml | 212 - fixtures/tsconfig/cases/builtins/thing.js | 0 .../tsconfig/cases/builtins/tsconfig.json | 5 - fixtures/tsconfig/cases/exports/index.js | 0 fixtures/tsconfig/cases/exports/tsconfig.json | 3 - .../extends-extension/base-tsconfig.json | 7 - .../tsconfig/cases/extends-extension/foo.js | 0 .../cases/extends-extension/tsconfig.json | 3 - .../cases/extends-extensionless/foo.js | 0 .../cases/extends-extensionless/tsconfig.json | 3 - .../tsconfig/cases/extends-multiple/foo.js | 0 .../cases/extends-multiple/tsconfig.json | 6 - .../tsconfig/cases/extends-not-found/index.js | 0 .../cases/extends-not-found/tsconfig.json | 3 - .../tsconfig/cases/extends-paths/src/index.js | 0 .../cases/extends-paths/tsconfig.base.json | 7 - .../cases/extends-paths/tsconfig.json | 6 - fixtures/tsconfig/cases/field/index.js | 0 fixtures/tsconfig/cases/field/tsconfig.json | 3 - fixtures/tsconfig/cases/index/index.js | 0 fixtures/tsconfig/cases/index/tsconfig.json | 3 - .../cases/paths_template_variable/foo.js | 0 .../paths_template_variable/tsconfig1.json | 3 - .../paths_template_variable/tsconfig2.json | 8 - .../project_references/app/aliased/index.ts | 0 .../cases/project_references/app/index.ts | 0 .../project_references/app/tsconfig.json | 23 - .../project_a/aliased/index.ts | 0 .../project_references/project_a/conf.json | 8 - .../project_references/project_a/index.ts | 0 .../project_b/src/aliased/index.ts | 0 .../project_b/tsconfig.json | 9 - .../project_references/project_c/index.ts | 0 .../project_c/tsconfig.json | 5 - .../project_references/tsconfig.base.json | 4 - fixtures/tsconfig/cases/suffixes/a.ios.ts | 0 fixtures/tsconfig/cases/suffixes/a.ts | 0 fixtures/tsconfig/cases/suffixes/b.ts | 0 fixtures/tsconfig/cases/suffixes/c-test.ts | 0 fixtures/tsconfig/cases/suffixes/index.ts | 1 - .../tsconfig/cases/suffixes/tsconfig.json | 5 - fixtures/tsconfig/cases/trailing-comma/bar.js | 0 .../tsconfig/cases/trailing-comma/index.js | 0 .../cases/trailing-comma/tsconfig.json | 9 - fixtures/tsconfig/foo.js | 0 fixtures/tsconfig/nested/index.js | 0 fixtures/tsconfig/nested/test.js | 0 fixtures/tsconfig/nested/tsconfig.json | 8 - .../node_modules/tsconfig-exports/conf.json | 7 - .../node_modules/tsconfig-exports/foo.js | 0 .../tsconfig-exports/package.json | 7 - .../node_modules/tsconfig-field/conf.json | 7 - .../node_modules/tsconfig-field/foo.js | 0 .../node_modules/tsconfig-field/package.json | 5 - .../node_modules/tsconfig-index/foo.js | 0 .../node_modules/tsconfig-index/package.json | 4 - .../node_modules/tsconfig-index/tsconfig.json | 7 - .../node_modules/tsconfig-not-used/foo.js | 0 .../tsconfig-not-used/tsconfig.json | 7 - fixtures/tsconfig/package.json | 24 - fixtures/tsconfig/tsconfig.json | 7 - fixtures/tsconfig/tsconfig_broken.json | 1 - .../tsconfig/tsconfig_template_variable.json | 7 - napi/__test__/resolver.spec.mjs | 260 - napi/src/lib.rs | 214 - napi/src/options.rs | 261 - napi/src/tracing.rs | 25 - napi/tests/options.test.mjs | 59 - npm/package.json | 79 +- package.json | 53 +- pnpm-lock.yaml | 2598 ------ src/builtins.rs | 71 - src/cache.rs | 354 - src/context.rs | 89 - src/error.rs | 182 - src/file_system.rs | 220 - src/lib.rs | 1755 ---- src/options.rs | 633 -- src/package_json.rs | 219 - src/path.rs | 132 - src/resolution.rs | 92 - src/specifier.rs | 230 - src/tests/alias.rs | 283 - src/tests/browser_field.rs | 189 - src/tests/builtins.rs | 121 - src/tests/dependencies.rs | 110 - src/tests/exports_field.rs | 2546 ------ src/tests/extension_alias.rs | 70 - src/tests/extensions.rs | 125 - src/tests/fallback.rs | 100 - src/tests/full_specified.rs | 113 - src/tests/imports_field.rs | 1320 --- src/tests/incorrect_description_file.rs | 65 - src/tests/main_field.rs | 24 - src/tests/memory_fs.rs | 74 - src/tests/missing.rs | 106 - src/tests/mod.rs | 51 - src/tests/pnp.rs | 45 - src/tests/resolve.rs | 119 - src/tests/restrictions.rs | 25 - src/tests/roots.rs | 92 - src/tests/scoped_packages.rs | 25 - src/tests/simple.rs | 68 - src/tests/symlink.rs | 121 - src/tests/tsconfig_paths.rs | 530 -- src/tests/tsconfig_project_references.rs | 132 - src/tsconfig.rs | 223 - tests/integration_test.rs | 103 - tests/package.json | 5 - tests/resolve_test.rs | 132 - 308 files changed, 56 insertions(+), 24940 deletions(-) delete mode 100644 .github/CODE_OF_CONDUCT.md delete mode 100644 .github/SECURITY.md delete mode 100644 .github/actions/pnpm/action.yml delete mode 100644 .github/codecov.yml delete mode 100644 .github/renovate.json delete mode 100644 .github/workflows/benchmark.yml delete mode 100644 .github/workflows/ci.yml delete mode 100644 .github/workflows/codecov.yml delete mode 100644 .github/workflows/release-napi.yml delete mode 100644 .github/workflows/release-plz.yml delete mode 100644 Cargo.lock delete mode 100644 fixtures/enhanced_resolve/lib/index.js delete mode 100644 fixtures/enhanced_resolve/package.json delete mode 100644 fixtures/enhanced_resolve/test/.gitignore delete mode 100644 fixtures/enhanced_resolve/test/fixtures/#/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/abc.txt delete mode 100644 fixtures/enhanced_resolve/test/fixtures/alias/files/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/browser/module-a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/ignore.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/replaced.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/self.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/toString.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-c.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/c.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/d.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/builtins/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/c.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/complex.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/crypto-js/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/decorated-fs/exists.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/dirOrFile.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/directory-default/directory-default.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/pack1/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/umd.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/index delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/src/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.mts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mjs delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mts.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/app.module.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/foo.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/foo.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/file.load1 delete mode 100644 fixtures/enhanced_resolve/test/fixtures/file.load2 delete mode 100644 fixtures/enhanced_resolve/test/fixtures/foo/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/foo/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/internal/file.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/y/y.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/internal/i.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-3/nested/f/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-4/f/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f$/$.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f/$.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/dir/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/c/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/issue-238/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/issue-238/src/a/config.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/issue-238/src/common/config/myObjectFile.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/lib.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/lib/complex1.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self2/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main1.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main2.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main3.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/no#fragment/#/#.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/no.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/invalidPackageJson/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/file.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/dir/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/typescript/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/prefer-pnp/alternative-modules/m1/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.css delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/index.css delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/module.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/roots_fall_through/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/lib/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/shortcutdir.js/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/b delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/c delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo/a delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo/b delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/b/foo/a delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/c/foo/a delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json delete mode 100644 "fixtures/enhanced_resolve/test/fixtures/\346\265\213\350\257\225.js" delete mode 100644 "fixtures/misc/\344\270\255\346\226\207/\344\270\255\346\226\207.js" delete mode 100644 fixtures/pnp/.gitignore delete mode 100755 fixtures/pnp/.pnp.cjs delete mode 100644 fixtures/pnp/.yarnrc.yml delete mode 100644 fixtures/pnp/package.json delete mode 100644 fixtures/pnp/yarn.lock delete mode 100644 fixtures/pnpm/.gitignore delete mode 100644 fixtures/pnpm/package.json delete mode 100644 fixtures/pnpm/pnpm-lock.yaml delete mode 100644 fixtures/tsconfig/cases/builtins/thing.js delete mode 100644 fixtures/tsconfig/cases/builtins/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/exports/index.js delete mode 100644 fixtures/tsconfig/cases/exports/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-extension/base-tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-extension/foo.js delete mode 100644 fixtures/tsconfig/cases/extends-extension/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-extensionless/foo.js delete mode 100644 fixtures/tsconfig/cases/extends-extensionless/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-multiple/foo.js delete mode 100644 fixtures/tsconfig/cases/extends-multiple/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-not-found/index.js delete mode 100644 fixtures/tsconfig/cases/extends-not-found/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-paths/src/index.js delete mode 100644 fixtures/tsconfig/cases/extends-paths/tsconfig.base.json delete mode 100644 fixtures/tsconfig/cases/extends-paths/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/field/index.js delete mode 100644 fixtures/tsconfig/cases/field/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/index/index.js delete mode 100644 fixtures/tsconfig/cases/index/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/paths_template_variable/foo.js delete mode 100644 fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json delete mode 100644 fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json delete mode 100644 fixtures/tsconfig/cases/project_references/app/aliased/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/app/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/app/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/project_references/project_a/aliased/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_a/conf.json delete mode 100644 fixtures/tsconfig/cases/project_references/project_a/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_b/src/aliased/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_b/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/project_references/project_c/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_c/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/project_references/tsconfig.base.json delete mode 100644 fixtures/tsconfig/cases/suffixes/a.ios.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/a.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/b.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/c-test.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/index.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/trailing-comma/bar.js delete mode 100644 fixtures/tsconfig/cases/trailing-comma/index.js delete mode 100644 fixtures/tsconfig/cases/trailing-comma/tsconfig.json delete mode 100644 fixtures/tsconfig/foo.js delete mode 100644 fixtures/tsconfig/nested/index.js delete mode 100644 fixtures/tsconfig/nested/test.js delete mode 100644 fixtures/tsconfig/nested/tsconfig.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-exports/conf.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-exports/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-exports/package.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-field/conf.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-field/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-field/package.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-index/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-index/package.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-not-used/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json delete mode 100755 fixtures/tsconfig/package.json delete mode 100644 fixtures/tsconfig/tsconfig.json delete mode 100644 fixtures/tsconfig/tsconfig_broken.json delete mode 100644 fixtures/tsconfig/tsconfig_template_variable.json delete mode 100644 napi/__test__/resolver.spec.mjs delete mode 100644 napi/src/lib.rs delete mode 100644 napi/src/options.rs delete mode 100644 napi/src/tracing.rs delete mode 100644 napi/tests/options.test.mjs delete mode 100644 pnpm-lock.yaml delete mode 100644 src/builtins.rs delete mode 100644 src/cache.rs delete mode 100644 src/context.rs delete mode 100644 src/error.rs delete mode 100644 src/file_system.rs delete mode 100644 src/lib.rs delete mode 100644 src/options.rs delete mode 100644 src/package_json.rs delete mode 100644 src/path.rs delete mode 100644 src/resolution.rs delete mode 100644 src/specifier.rs delete mode 100644 src/tests/alias.rs delete mode 100644 src/tests/browser_field.rs delete mode 100644 src/tests/builtins.rs delete mode 100644 src/tests/dependencies.rs delete mode 100644 src/tests/exports_field.rs delete mode 100644 src/tests/extension_alias.rs delete mode 100644 src/tests/extensions.rs delete mode 100644 src/tests/fallback.rs delete mode 100644 src/tests/full_specified.rs delete mode 100644 src/tests/imports_field.rs delete mode 100644 src/tests/incorrect_description_file.rs delete mode 100644 src/tests/main_field.rs delete mode 100644 src/tests/memory_fs.rs delete mode 100644 src/tests/missing.rs delete mode 100644 src/tests/mod.rs delete mode 100644 src/tests/pnp.rs delete mode 100644 src/tests/resolve.rs delete mode 100644 src/tests/restrictions.rs delete mode 100644 src/tests/roots.rs delete mode 100644 src/tests/scoped_packages.rs delete mode 100644 src/tests/simple.rs delete mode 100644 src/tests/symlink.rs delete mode 100644 src/tests/tsconfig_paths.rs delete mode 100644 src/tests/tsconfig_project_references.rs delete mode 100644 src/tsconfig.rs delete mode 100644 tests/integration_test.rs delete mode 100644 tests/package.json delete mode 100644 tests/resolve_test.rs diff --git a/.github/CODE_OF_CONDUCT.md b/.github/CODE_OF_CONDUCT.md deleted file mode 100644 index 41dd9ebe..00000000 --- a/.github/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,127 +0,0 @@ -# Contributor Covenant Code of Conduct - -## Our Pledge - -We as members, contributors, and leaders pledge to make participation in our -community a harassment-free experience for everyone, regardless of age, body -size, visible or invisible disability, ethnicity, sex characteristics, gender -identity and expression, level of experience, education, socio-economic status, -nationality, personal appearance, race, religion, or sexual identity -and orientation. - -We pledge to act and interact in ways that contribute to an open, welcoming, -diverse, inclusive, and healthy community. - -## Our Standards - -Examples of behavior that contributes to a positive environment for our -community include: - -* Demonstrating empathy and kindness toward other people -* Being respectful of differing opinions, viewpoints, and experiences -* Giving and gracefully accepting constructive feedback -* Accepting responsibility and apologizing to those affected by our mistakes, - and learning from the experience -* Focusing on what is best not just for us as individuals, but for the - overall community - -Examples of unacceptable behavior include: - -* The use of sexualized language or imagery, and sexual attention or - advances of any kind -* Trolling, insulting or derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or email - address, without their explicit permission -* Other conduct which could reasonably be considered inappropriate in a - professional setting - -## Enforcement Responsibilities - -Community leaders are responsible for clarifying and enforcing our standards of -acceptable behavior and will take appropriate and fair corrective action in -response to any behavior that they deem inappropriate, threatening, offensive, -or harmful. - -Community leaders have the right and responsibility to remove, edit, or reject -comments, commits, code, wiki edits, issues, and other contributions that are -not aligned to this Code of Conduct, and will communicate reasons for moderation -decisions when appropriate. - -## Scope - -This Code of Conduct applies within all community spaces, and also applies when -an individual is officially representing the community in public spaces. -Examples of representing our community include using an official e-mail address, -posting via an official social media account, or acting as an appointed -representative at an online or offline event. - -## Enforcement - -Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported to the community leaders responsible for enforcement. -All complaints will be reviewed and investigated promptly and fairly. - -All community leaders are obligated to respect the privacy and security of the -reporter of any incident. - -## Enforcement Guidelines - -Community leaders will follow these Community Impact Guidelines in determining -the consequences for any action they deem in violation of this Code of Conduct: - -### 1. Correction - -**Community Impact**: Use of inappropriate language or other behavior deemed -unprofessional or unwelcome in the community. - -**Consequence**: A private, written warning from community leaders, providing -clarity around the nature of the violation and an explanation of why the -behavior was inappropriate. A public apology may be requested. - -### 2. Warning - -**Community Impact**: A violation through a single incident or series -of actions. - -**Consequence**: A warning with consequences for continued behavior. No -interaction with the people involved, including unsolicited interaction with -those enforcing the Code of Conduct, for a specified period of time. This -includes avoiding interactions in community spaces as well as external channels -like social media. Violating these terms may lead to a temporary or -permanent ban. - -### 3. Temporary Ban - -**Community Impact**: A serious violation of community standards, including -sustained inappropriate behavior. - -**Consequence**: A temporary ban from any sort of interaction or public -communication with the community for a specified period of time. No public or -private interaction with the people involved, including unsolicited interaction -with those enforcing the Code of Conduct, is allowed during this period. -Violating these terms may lead to a permanent ban. - -### 4. Permanent Ban - -**Community Impact**: Demonstrating a pattern of violation of community -standards, including sustained inappropriate behavior, harassment of an -individual, or aggression toward or disparagement of classes of individuals. - -**Consequence**: A permanent ban from any sort of public interaction within -the community. - -## Attribution - -This Code of Conduct is adapted from the [Contributor Covenant][homepage], -version 2.0, available at -https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. - -Community Impact Guidelines were inspired by [Mozilla's code of conduct -enforcement ladder](https://github.com/mozilla/diversity). - -[homepage]: https://www.contributor-covenant.org - -For answers to common questions about this code of conduct, see the FAQ at -https://www.contributor-covenant.org/faq. Translations are available at -https://www.contributor-covenant.org/translations. diff --git a/.github/SECURITY.md b/.github/SECURITY.md deleted file mode 100644 index 63f5b072..00000000 --- a/.github/SECURITY.md +++ /dev/null @@ -1,7 +0,0 @@ -# Security Policy - -## Supported Versions - -## Reporting a Vulnerability - -If you find any potential vulnerability, join our [discord channel](https://discord.gg/9uXCAwqQZW) and contact Boshen. diff --git a/.github/actions/pnpm/action.yml b/.github/actions/pnpm/action.yml deleted file mode 100644 index ab4291c0..00000000 --- a/.github/actions/pnpm/action.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: Pnpm - -description: Install pnpm - -runs: - using: composite - steps: - - uses: pnpm/action-setup@v4 - - - uses: actions/setup-node@v4 - with: - node-version-file: .node-version - cache: pnpm - - - name: yarn - shell: bash - run: | - cd fixtures/pnp - corepack enable - yarn install - - - name: pnpm - shell: bash - run: | - corepack enable - pnpm install diff --git a/.github/codecov.yml b/.github/codecov.yml deleted file mode 100644 index 0610268a..00000000 --- a/.github/codecov.yml +++ /dev/null @@ -1,14 +0,0 @@ -coverage: - status: - project: - default: - informational: true - patch: - default: - informational: true - changes: - default: - informational: true - -ignore: - - "examples" diff --git a/.github/renovate.json b/.github/renovate.json deleted file mode 100644 index 2339df09..00000000 --- a/.github/renovate.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "$schema": "https://docs.renovatebot.com/renovate-schema.json", - "extends": ["github>Boshen/renovate"], - "ignorePaths": ["**/node_modules/**", "**/fixtures/**"] -} diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml deleted file mode 100644 index 7c25853b..00000000 --- a/.github/workflows/benchmark.yml +++ /dev/null @@ -1,41 +0,0 @@ -name: Benchmark - -on: - workflow_dispatch: - pull_request: - types: [opened, synchronize] - paths-ignore: - - '**/*.md' - push: - branches: - - main - paths-ignore: - - '**/*.md' - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} - cancel-in-progress: true - -jobs: - benchmark: - name: Benchmark - runs-on: ubuntu-latest - steps: - - name: Checkout Branch - uses: taiki-e/checkout-action@v1 - - - uses: Boshen/setup-rust@main - with: - cache-key: benchmark - save-cache: ${{ github.ref_name == 'main' }} - tools: cargo-codspeed - - uses: ./.github/actions/pnpm - - name: Build Benchmark - run: cargo codspeed build --features codspeed - - - name: Run benchmark - uses: CodSpeedHQ/action@v3 - timeout-minutes: 30 - with: - run: cargo codspeed run - token: ${{ secrets.CODSPEED_TOKEN }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index 3f629ffb..00000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,196 +0,0 @@ -name: CI - -on: - workflow_dispatch: - pull_request: - types: [opened, synchronize] - paths-ignore: - - '**/*.md' - - '!.github/workflows/ci.yml' - push: - branches: - - main - - "renovate/**" - paths-ignore: - - '**/*.md' - - '!.github/workflows/ci.yml' - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} - cancel-in-progress: ${{ github.ref_name != 'main' }} - -defaults: - run: - shell: bash - -jobs: - cache: # Warm cache factory for all other CI jobs - name: Check and Build - strategy: - fail-fast: true - matrix: - include: - - os: windows-latest - - os: ubuntu-latest - - os: macos-14 - runs-on: ${{ matrix.os }} - steps: - - uses: taiki-e/checkout-action@v1 - - - uses: Boshen/setup-rust@main - with: - save-cache: ${{ github.ref_name == 'main' }} - cache-key: warm - - - run: cargo check --all-features --locked - - # Only need to build the test to create a warm cache on the main branch - - name: Build cache by Cargo Check and Cargo Test - if: ${{ github.ref_name == 'main' }} - run: cargo test --all-features --no-run - - wasm: - name: Check Wasm - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - - uses: Boshen/setup-rust@main - with: - cache-key: wasm - save-cache: ${{ github.ref_name == 'main' }} - - - name: Check - run: | - rustup target add wasm32-unknown-unknown - cargo check --all-features --target wasm32-unknown-unknown - - wasi: - name: Test wasi target - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - - uses: Boshen/setup-rust@main - with: - cache-key: wasi - save-cache: ${{ github.ref_name == 'main' }} - - - uses: ./.github/actions/pnpm - - - name: Build - run: | - rustup target add wasm32-wasip1-threads - pnpm build --target wasm32-wasip1-threads - - - name: Test - run: pnpm test - env: - WASI_TEST: 1 - - typos: - name: Spell Check - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - - uses: crate-ci/typos@v1.24.5 - with: - files: . - - deny: - name: Cargo Deny - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - - uses: dorny/paths-filter@v3 - id: filter - with: - filters: | - src: - - 'Cargo.lock' - - - uses: Boshen/setup-rust@main - with: - restore-cache: false - tools: cargo-deny - - - if: steps.filter.outputs.src == 'true' - run: cargo deny check - - unused-deps: - name: Check Unused Dependencies - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - uses: dorny/paths-filter@v3 - id: filter - with: - filters: | - src: - - '**/*.rs' - - '**/Cargo.toml' - - 'Cargo.lock' - - uses: Boshen/setup-rust@main - with: - restore-cache: false - if: steps.filter.outputs.src == 'true' - - uses: cargo-bins/cargo-binstall@main - if: steps.filter.outputs.src == 'true' - - run: cargo binstall --no-confirm cargo-shear@1 - if: steps.filter.outputs.src == 'true' - - run: cargo shear - if: steps.filter.outputs.src == 'true' - - format: - name: Format - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - uses: Boshen/setup-rust@main - with: - components: rustfmt - restore-cache: false - - run: cargo fmt --all -- --check - - lint: - name: Clippy - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - uses: Boshen/setup-rust@main - with: - components: clippy - - run: cargo clippy --all-features -- -D warnings - - doc: - name: Doc - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - uses: Boshen/setup-rust@main - with: - components: rust-docs - - run: RUSTDOCFLAGS='-D warnings' cargo doc --no-deps --all-features - - test: - name: Test - strategy: - fail-fast: true - matrix: - include: - - os: windows-latest - - os: ubuntu-latest - - os: macos-14 - runs-on: ${{ matrix.os }} - env: - RUST_BACKTRACE: 1 - steps: - - uses: taiki-e/checkout-action@v1 - - uses: ./.github/actions/pnpm - - uses: Boshen/setup-rust@main - with: - cache-key: warm - - run: cargo test --doc - - run: cargo test --all-features diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml deleted file mode 100644 index 97302b03..00000000 --- a/.github/workflows/codecov.yml +++ /dev/null @@ -1,69 +0,0 @@ -name: Code Coverage # Run cargo-llvm-cov and upload to codecov.io - -on: - workflow_dispatch: - pull_request: - types: [opened, synchronize] - paths-ignore: - - '**/*.md' - push: - branches: - - main - paths-ignore: - - '**/*.md' - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: ${{ github.ref_name != 'main' }} - -jobs: - coverage: - name: Code Coverage - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: taiki-e/checkout-action@v1 - - - uses: ./.github/actions/pnpm - - - uses: Boshen/setup-rust@main - with: - cache-key: codecov - save-cache: ${{ github.ref_name == 'main' }} - tools: cargo-llvm-cov - components: llvm-tools-preview - - - run: cargo llvm-cov --lcov --output-path lcov.info - - - name: Upload Artifact - uses: actions/upload-artifact@v4 - with: - name: codecov - path: lcov.info - - # codecov often fails, use another workflow for retry - upload-codecov: - name: Upload coverage file - runs-on: ubuntu-latest - needs: coverage - # Check if the event is not triggered by a fork by checking whether CODECOV_TOKEN is set - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - steps: - - name: Checkout - if: env.CODECOV_TOKEN - uses: taiki-e/checkout-action@v1 - - - name: Download coverage file - if: env.CODECOV_TOKEN - uses: actions/download-artifact@v4 - with: - name: codecov - - - name: Upload to codecov.io - if: env.CODECOV_TOKEN - uses: codecov/codecov-action@v4 - with: - token: ${{ secrets.CODECOV_TOKEN }} - fail_ci_if_error: true - files: lcov.info diff --git a/.github/workflows/release-napi.yml b/.github/workflows/release-napi.yml deleted file mode 100644 index 1ea68db8..00000000 --- a/.github/workflows/release-napi.yml +++ /dev/null @@ -1,252 +0,0 @@ -name: Release NAPI - -on: - workflow_dispatch: - push: - branches: - - main - paths: - - npm/package.json # Please only commit this file, so we don't need to wait for test CI to pass. - -env: - DEBUG: 'napi:*' - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - check: - name: Check version - runs-on: ubuntu-latest - outputs: - version: ${{ env.version }} - version_changed: ${{ steps.version.outputs.changed }} - steps: - - uses: taiki-e/checkout-action@v1 - - - name: Check version changes - uses: EndBug/version-check@v2 - id: version - with: - static-checking: localIsNew - file-url: https://unpkg.com/oxc-resolver@latest/package.json - file-name: npm/package.json - - - name: Set version name - if: steps.version.outputs.changed == 'true' - run: | - echo "Version change found! New version: ${{ steps.version.outputs.version }} (${{ steps.version.outputs.version_type }})" - echo "version=${{ steps.version.outputs.version }}" >> $GITHUB_ENV - - build: - needs: check - if: needs.check.outputs.version_changed == 'true' - env: - version: ${{ needs.check.outputs.version }} - outputs: - version: ${{ env.version }} - strategy: - fail-fast: false - matrix: - include: - - os: windows-latest - target: x86_64-pc-windows-msvc - - - os: windows-latest - target: aarch64-pc-windows-msvc - - - os: ubuntu-latest - target: x86_64-unknown-linux-gnu - - - os: ubuntu-latest - target: x86_64-unknown-linux-musl - - - os: ubuntu-latest - target: aarch64-unknown-linux-gnu - - - os: ubuntu-latest - target: aarch64-unknown-linux-musl - - - os: ubuntu-latest - target: armv7-unknown-linux-gnueabihf - - - os: macos-latest - target: x86_64-apple-darwin - - - os: macos-latest - target: aarch64-apple-darwin - - - os: ubuntu-latest - target: wasm32-wasip1-threads - - name: Package ${{ matrix.target }} - runs-on: ${{ matrix.os }} - steps: - - uses: taiki-e/checkout-action@v1 - - - uses: ./.github/actions/pnpm - - - name: Add Rust Target - run: rustup target add ${{ matrix.target }} - - - uses: goto-bus-stop/setup-zig@v2 - if: ${{ contains(matrix.target, 'musl') }} - with: - version: 0.13.0 - - - name: Build with zig cross - if: ${{ contains(matrix.target, 'musl') }} - run: pnpm build -x --target ${{ matrix.target }} - - - name: Build with napi cross - if: ${{ contains(matrix.target, 'gnu') }} - run: pnpm build --use-napi-cross --target ${{ matrix.target }} - - - name: Build - if: ${{ !contains(matrix.target, 'gnu') && !contains(matrix.target, 'musl') }} - run: pnpm build --target ${{ matrix.target }} - - - name: Test - if: matrix.target == 'x86_64-pc-windows-msvc' || matrix.target == 'aarch64-apple-darwin' || matrix.target == 'wasm32-wasip1-threads' - run: pnpm test - - - name: Output docker params - if: ${{ contains(matrix.target, 'linux') }} - id: docker - run: | - node -e " - if ('${{ matrix.target }}'.startsWith('aarch64')) { - console.log('PLATFORM=linux/arm64') - } else if ('${{ matrix.target }}'.startsWith('armv7')) { - console.log('PLATFORM=linux/arm/v7') - } else { - console.log('PLATFORM=linux/amd64') - } - " >> $GITHUB_OUTPUT - node -e " - if ('${{ matrix.target }}'.endsWith('-musl')) { - console.log('IMAGE=node:lts-alpine') - } else { - console.log('IMAGE=node:lts-slim') - } - " >> $GITHUB_OUTPUT - echo "PNPM_STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_OUTPUT - - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - if: ${{ contains(matrix.target, 'linux') }} - with: - platforms: all - - - run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes - if: ${{ contains(matrix.target, 'linux') }} - - - name: Run linux test - uses: addnab/docker-run-action@v3 - if: ${{ contains(matrix.target, 'linux') }} - with: - image: ${{ steps.docker.outputs.IMAGE }} - options: -v ${{ steps.docker.outputs.PNPM_STORE_PATH }}:${{ steps.docker.outputs.PNPM_STORE_PATH }} -v ${{ github.workspace }}:/oxc_resolver -w /oxc_resolver --platform ${{ steps.docker.outputs.PLATFORM }} - run: | - corepack enable - pnpm test - - - name: Upload artifacts - uses: actions/upload-artifact@v4 - with: - name: bindings-${{ matrix.target }} - path: | - napi/*.node - napi/*.wasm - - build-freebsd: - needs: check - if: needs.check.outputs.version_changed == 'true' - name: Build FreeBSD - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Build - id: build - uses: cross-platform-actions/action@v0.25.0 - env: - DEBUG: napi:* - RUSTUP_IO_THREADS: 1 - with: - operating_system: freebsd - version: '14.0' - memory: 8G - cpu_count: 3 - environment_variables: 'DEBUG RUSTUP_IO_THREADS' - shell: bash - run: | - sudo pkg install -y -f curl node libnghttp2 npm - curl https://sh.rustup.rs -sSf --output rustup.sh - sh rustup.sh -y --profile minimal --default-toolchain stable - source "$HOME/.cargo/env" - echo "~~~~ rustc --version ~~~~" - rustc --version - echo "~~~~ node -v ~~~~" - node -v - pwd - ls -lah - whoami - env - sudo corepack enable - pnpm install - pnpm build --target x86_64-unknown-freebsd - rm -rf node_modules - rm -rf target - - name: Upload artifact - uses: actions/upload-artifact@v4 - with: - name: bindings-freebsd - path: napi/*.node - if-no-files-found: error - - publish: - name: Publish NAPI - runs-on: ubuntu-latest - permissions: - id-token: write # for `npm publish --provenance` - needs: - - build - - build-freebsd - steps: - - uses: taiki-e/checkout-action@v1 - - - name: corepack - run: corepack enable - - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version-file: .node-version - cache: pnpm - - - name: Install dependencies - run: pnpm install --frozen-lockfile - - - name: Download Artifacts - uses: actions/download-artifact@v4 - with: - path: artifacts - - - name: Prepare dirs and artifacts - run: | - pnpm napi create-npm-dirs --package-json-path npm/package.json - pnpm napi artifacts --package-json-path npm/package.json --build-output-dir napi - - - name: Publish npm packages as latest - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - shell: bash - run: | - cp napi/index.js npm/index.js - cp napi/index.d.ts npm/index.d.ts - cp napi/browser.js npm/browser.js - echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc - pnpm napi pre-publish --no-gh-release -t npm --package-json-path npm/package.json - npm publish npm/ --tag latest --provenance --access public diff --git a/.github/workflows/release-plz.yml b/.github/workflows/release-plz.yml deleted file mode 100644 index 121758ad..00000000 --- a/.github/workflows/release-plz.yml +++ /dev/null @@ -1,55 +0,0 @@ -name: Release Plz - -on: - workflow_dispatch: - push: - branches: - - main - -permissions: - pull-requests: write - contents: write - -jobs: - release-plz: - name: Release-plz - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - uses: Boshen/setup-rust@main - with: - save-cache: ${{ github.ref_name == 'main' }} - cache-key: warm - - - name: Run release-plz - id: release-plz - uses: MarcoIeni/release-plz-action@v0.5 - env: - GITHUB_TOKEN: ${{ secrets.RELEASE_PLZ_TOKEN }} - CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} - - - name: Bump package.json - if: ${{ steps.release-plz.outputs.prs_created }} - env: - GH_TOKEN: ${{ github.token }} - RELEASES: ${{ steps.release-plz.outputs.releases }} - PR: ${{ steps.release-plz.outputs.pr }} - run: | - set -e - - pr_number=${{ fromJSON(steps.release-plz.outputs.pr).number }} - if [[ -n "$pr_number" ]]; then - version=$(echo "$RELEASES" | jq -r '.[0].version') - echo "version: $version" - - jq --arg version "${version}" '.version = ($version)' npm/package.json > tmp - mv tmp npm/package.json - - gh pr checkout $pr_number - git add . - git commit -m "Update package.json" - git push - fi diff --git a/Cargo.lock b/Cargo.lock deleted file mode 100644 index 58c1e7ad..00000000 --- a/Cargo.lock +++ /dev/null @@ -1,1326 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "adler" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" - -[[package]] -name = "aho-corasick" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" -dependencies = [ - "memchr", -] - -[[package]] -name = "android-tzdata" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" - -[[package]] -name = "android_system_properties" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" -dependencies = [ - "libc", -] - -[[package]] -name = "anes" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "735d4f398ca57cfa2880225c2bf81c3b9af3be5bb22e44ae70118dad38713e84" - -[[package]] -name = "arca" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f915ddd863ef73f11c10c75170e86db1d4f539689bc6bfb9ce25d6528d6fe83" -dependencies = [ - "clean-path", - "path-slash", - "radix_trie", -] - -[[package]] -name = "autocfg" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" - -[[package]] -name = "base64" -version = "0.22.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" - -[[package]] -name = "bit-set" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1" -dependencies = [ - "bit-vec", -] - -[[package]] -name = "bit-vec" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "bitflags" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" - -[[package]] -name = "bpaf" -version = "0.9.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3280efcf6d66bc77c2cf9b67dc8acee47a217d9be67dd590b3230dffe663724d" - -[[package]] -name = "bumpalo" -version = "3.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" - -[[package]] -name = "byteorder" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" - -[[package]] -name = "cast" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" - -[[package]] -name = "cc" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eaff6f8ce506b9773fa786672d63fc7a191ffea1be33f72bbd4aeacefca9ffc8" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "chrono" -version = "0.4.38" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" -dependencies = [ - "android-tzdata", - "iana-time-zone", - "num-traits", - "serde", - "windows-targets 0.52.6", -] - -[[package]] -name = "ciborium" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42e69ffd6f0917f5c029256a24d0161db17cea3997d185db0d35926308770f0e" -dependencies = [ - "ciborium-io", - "ciborium-ll", - "serde", -] - -[[package]] -name = "ciborium-io" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05afea1e0a06c9be33d539b876f1ce3692f4afea2cb41f740e7743225ed1c757" - -[[package]] -name = "ciborium-ll" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57663b653d948a338bfb3eeba9bb2fd5fcfaecb9e199e87e1eda4d9e8b240fd9" -dependencies = [ - "ciborium-io", - "half", -] - -[[package]] -name = "clean-path" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aaa6b4b263a5d737e9bf6b7c09b72c41a5480aec4d7219af827f6564e950b6a5" - -[[package]] -name = "codspeed" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a104ac948e0188b921eb3fcbdd55dcf62e542df4c7ab7e660623f6288302089" -dependencies = [ - "colored", - "libc", - "serde_json", -] - -[[package]] -name = "colored" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbf2150cce219b664a8a70df7a1f933836724b503f8a413af9365b4dcc4d90b8" -dependencies = [ - "lazy_static", - "windows-sys 0.48.0", -] - -[[package]] -name = "concurrent_lru" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7feb5cb312f774e8a24540e27206db4e890f7d488563671d24a16389cf4c2e4e" -dependencies = [ - "once_cell", -] - -[[package]] -name = "convert_case" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec182b0ca2f35d8fc196cf3404988fd8b8c739a4d270ff118a398feb0cbec1ca" -dependencies = [ - "unicode-segmentation", -] - -[[package]] -name = "core-foundation-sys" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" - -[[package]] -name = "criterion2" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8df39381f28ced0ceebfb5611528d99aef14f8d75b43e9d4ceb6aba66e7b04d" -dependencies = [ - "anes", - "bpaf", - "cast", - "ciborium", - "codspeed", - "colored", - "num-traits", - "oorandom", - "serde", - "serde_json", - "walkdir", -] - -[[package]] -name = "crossbeam-deque" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" -dependencies = [ - "crossbeam-epoch", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.9.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" -dependencies = [ - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" - -[[package]] -name = "crunchy" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" - -[[package]] -name = "ctor" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edb49164822f3ee45b17acd4a208cfc1251410cf0cad9a833234c9890774dd9f" -dependencies = [ - "quote", - "syn", -] - -[[package]] -name = "darling" -version = "0.20.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" -dependencies = [ - "darling_core", - "darling_macro", -] - -[[package]] -name = "darling_core" -version = "0.20.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95133861a8032aaea082871032f5815eb9e98cef03fa916ab4500513994df9e5" -dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "strsim", - "syn", -] - -[[package]] -name = "darling_macro" -version = "0.20.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" -dependencies = [ - "darling_core", - "quote", - "syn", -] - -[[package]] -name = "dashmap" -version = "6.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "804c8821570c3f8b70230c2ba75ffa5c0f9a4189b9a432b6656c536712acae28" -dependencies = [ - "cfg-if", - "crossbeam-utils", - "hashbrown 0.14.5", - "lock_api", - "once_cell", - "parking_lot_core", -] - -[[package]] -name = "deranged" -version = "0.3.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" -dependencies = [ - "powerfmt", - "serde", -] - -[[package]] -name = "document-features" -version = "0.2.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb6969eaabd2421f8a2775cfd2471a2b634372b4a25d41e3bd647b79912850a0" -dependencies = [ - "litrs", -] - -[[package]] -name = "dunce" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" - -[[package]] -name = "either" -version = "1.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" - -[[package]] -name = "endian-type" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" - -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "fancy-regex" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "531e46835a22af56d1e3b66f04844bed63158bc094a628bec1d321d9b4c44bf2" -dependencies = [ - "bit-set", - "regex-automata", - "regex-syntax", -] - -[[package]] -name = "filetime" -version = "0.2.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ee447700ac8aa0b2f2bd7bc4462ad686ba06baa6727ac149a2d6277f0d240fd" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall 0.4.1", - "windows-sys 0.52.0", -] - -[[package]] -name = "fnv" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" - -[[package]] -name = "half" -version = "2.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dd08c532ae367adf81c312a4580bc67f1d0fe8bc9c460520283f4c0ff277888" -dependencies = [ - "cfg-if", - "crunchy", -] - -[[package]] -name = "hashbrown" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" - -[[package]] -name = "hashbrown" -version = "0.14.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "iana-time-zone" -version = "0.1.60" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" -dependencies = [ - "android_system_properties", - "core-foundation-sys", - "iana-time-zone-haiku", - "js-sys", - "wasm-bindgen", - "windows-core", -] - -[[package]] -name = "iana-time-zone-haiku" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" -dependencies = [ - "cc", -] - -[[package]] -name = "ident_case" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" - -[[package]] -name = "indexmap" -version = "1.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" -dependencies = [ - "autocfg", - "hashbrown 0.12.3", - "serde", -] - -[[package]] -name = "indexmap" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93ead53efc7ea8ed3cfb0c79fc8023fbb782a5432b52830b6518941cebe6505c" -dependencies = [ - "equivalent", - "hashbrown 0.14.5", - "serde", -] - -[[package]] -name = "itoa" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" - -[[package]] -name = "js-sys" -version = "0.3.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" -dependencies = [ - "wasm-bindgen", -] - -[[package]] -name = "json-strip-comments" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b271732a960335e715b6b2ae66a086f115c74eb97360e996d2bd809bfc063bba" -dependencies = [ - "memchr", -] - -[[package]] -name = "lazy_static" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" - -[[package]] -name = "libc" -version = "0.2.155" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" - -[[package]] -name = "libloading" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e310b3a6b5907f99202fcdb4960ff45b93735d7c7d96b760fcff8db2dc0e103d" -dependencies = [ - "cfg-if", - "windows-targets 0.52.6", -] - -[[package]] -name = "litrs" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4ce301924b7887e9d637144fdade93f9dfff9b60981d4ac161db09720d39aa5" - -[[package]] -name = "lock_api" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" -dependencies = [ - "autocfg", - "scopeguard", -] - -[[package]] -name = "log" -version = "0.4.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" - -[[package]] -name = "memchr" -version = "2.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" - -[[package]] -name = "miniz_oxide" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" -dependencies = [ - "adler", -] - -[[package]] -name = "napi" -version = "3.0.0-alpha.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ec04344cc540f5897e97c9821ab99e7eb276b4dca6f3e6e441dfa72e5bcde70" -dependencies = [ - "bitflags 2.6.0", - "ctor", - "napi-build", - "napi-sys", - "once_cell", - "serde", - "serde_json", -] - -[[package]] -name = "napi-build" -version = "2.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1c0f5d67ee408a4685b61f5ab7e58605c8ae3f2b4189f0127d804ff13d5560a" - -[[package]] -name = "napi-derive" -version = "3.0.0-alpha.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c6240c4ddca592cde608bbfa26e2af397c3596e413a0c65c9bbcb65c2f1e485" -dependencies = [ - "cfg-if", - "convert_case", - "napi-derive-backend", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "napi-derive-backend" -version = "2.0.0-alpha.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b32dcc50065508fe2f387076c17adbdf10e038d1c080d48b10196813d94ac6a8" -dependencies = [ - "convert_case", - "once_cell", - "proc-macro2", - "quote", - "regex", - "semver", - "syn", -] - -[[package]] -name = "napi-sys" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "427802e8ec3a734331fec1035594a210ce1ff4dc5bc1950530920ab717964ea3" -dependencies = [ - "libloading", -] - -[[package]] -name = "nibble_vec" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" -dependencies = [ - "smallvec", -] - -[[package]] -name = "normalize-path" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5438dd2b2ff4c6df6e1ce22d825ed2fa93ee2922235cc45186991717f0a892d" - -[[package]] -name = "num-conv" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" - -[[package]] -name = "num-traits" -version = "0.2.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" -dependencies = [ - "autocfg", -] - -[[package]] -name = "once_cell" -version = "1.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" - -[[package]] -name = "oorandom" -version = "11.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b410bbe7e14ab526a0e86877eb47c6996a2bd7746f027ba551028c925390e4e9" - -[[package]] -name = "oxc_napi_resolver" -version = "0.0.0" -dependencies = [ - "napi", - "napi-build", - "napi-derive", - "oxc_resolver", - "tracing-subscriber", -] - -[[package]] -name = "oxc_resolver" -version = "1.11.0" -dependencies = [ - "cfg-if", - "criterion2", - "dashmap", - "document-features", - "dunce", - "indexmap 2.4.0", - "json-strip-comments", - "normalize-path", - "once_cell", - "pnp", - "rayon", - "rustc-hash", - "serde", - "serde_json", - "simdutf8", - "thiserror", - "tracing", - "vfs", -] - -[[package]] -name = "parking_lot_core" -version = "0.9.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall 0.5.2", - "smallvec", - "windows-targets 0.52.6", -] - -[[package]] -name = "path-slash" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e91099d4268b0e11973f036e885d652fb0b21fedcf69738c627f94db6a44f42" - -[[package]] -name = "pathdiff" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8835116a5c179084a830efb3adc117ab007512b535bc1a21c991d3b32a6b44dd" - -[[package]] -name = "pin-project-lite" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" - -[[package]] -name = "pnp" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46770cee76a618023fea15411d0449dd066dc232cc17e4562f154da215f27af7" -dependencies = [ - "arca", - "byteorder", - "concurrent_lru", - "fancy-regex", - "lazy_static", - "miniz_oxide", - "pathdiff", - "regex", - "serde", - "serde_json", - "serde_with", - "thiserror", -] - -[[package]] -name = "powerfmt" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" - -[[package]] -name = "proc-macro2" -version = "1.0.86" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.36" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "radix_trie" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" -dependencies = [ - "endian-type", - "nibble_vec", -] - -[[package]] -name = "rayon" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" -dependencies = [ - "either", - "rayon-core", -] - -[[package]] -name = "rayon-core" -version = "1.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" -dependencies = [ - "crossbeam-deque", - "crossbeam-utils", -] - -[[package]] -name = "redox_syscall" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" -dependencies = [ - "bitflags 1.3.2", -] - -[[package]] -name = "redox_syscall" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c82cf8cff14456045f55ec4241383baeff27af886adb72ffb2162f99911de0fd" -dependencies = [ - "bitflags 2.6.0", -] - -[[package]] -name = "regex" -version = "1.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b91213439dad192326a0d7c6ee3955910425f441d7038e0d6933b0aec5c4517f" -dependencies = [ - "aho-corasick", - "memchr", - "regex-automata", - "regex-syntax", -] - -[[package]] -name = "regex-automata" -version = "0.4.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", -] - -[[package]] -name = "regex-syntax" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" - -[[package]] -name = "rustc-hash" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" - -[[package]] -name = "ryu" -version = "1.0.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" - -[[package]] -name = "same-file" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "scopeguard" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" - -[[package]] -name = "semver" -version = "1.0.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" - -[[package]] -name = "serde" -version = "1.0.209" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99fce0ffe7310761ca6bf9faf5115afbc19688edd00171d81b1bb1b116c63e09" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.209" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5831b979fd7b5439637af1752d535ff49f4860c0f341d1baeb6faf0f4242170" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "serde_json" -version = "1.0.127" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8043c06d9f82bd7271361ed64f415fe5e12a77fdb52e573e7f06a516dea329ad" -dependencies = [ - "indexmap 2.4.0", - "itoa", - "memchr", - "ryu", - "serde", -] - -[[package]] -name = "serde_with" -version = "3.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e73139bc5ec2d45e6c5fd85be5a46949c1c39a4c18e56915f5eb4c12f975e377" -dependencies = [ - "base64", - "chrono", - "hex", - "indexmap 1.9.3", - "indexmap 2.4.0", - "serde", - "serde_derive", - "serde_json", - "serde_with_macros", - "time", -] - -[[package]] -name = "serde_with_macros" -version = "3.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b80d3d6b56b64335c0180e5ffde23b3c5e08c14c585b51a15bd0e95393f46703" -dependencies = [ - "darling", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "sharded-slab" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" -dependencies = [ - "lazy_static", -] - -[[package]] -name = "simdutf8" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f27f6278552951f1f2b8cf9da965d10969b2efdea95a6ec47987ab46edfe263a" - -[[package]] -name = "smallvec" -version = "1.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" - -[[package]] -name = "strsim" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" - -[[package]] -name = "syn" -version = "2.0.70" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f0209b68b3613b093e0ec905354eccaedcfe83b8cb37cbdeae64026c3064c16" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "thiserror" -version = "1.0.63" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.63" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "thread_local" -version = "1.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" -dependencies = [ - "cfg-if", - "once_cell", -] - -[[package]] -name = "time" -version = "0.3.36" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" -dependencies = [ - "deranged", - "itoa", - "num-conv", - "powerfmt", - "serde", - "time-core", - "time-macros", -] - -[[package]] -name = "time-core" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" - -[[package]] -name = "time-macros" -version = "0.2.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" -dependencies = [ - "num-conv", - "time-core", -] - -[[package]] -name = "tracing" -version = "0.1.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" -dependencies = [ - "pin-project-lite", - "tracing-attributes", - "tracing-core", -] - -[[package]] -name = "tracing-attributes" -version = "0.1.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "tracing-core" -version = "0.1.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" -dependencies = [ - "once_cell", -] - -[[package]] -name = "tracing-subscriber" -version = "0.3.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" -dependencies = [ - "sharded-slab", - "thread_local", - "tracing-core", -] - -[[package]] -name = "unicode-ident" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" - -[[package]] -name = "unicode-segmentation" -version = "1.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" - -[[package]] -name = "vfs" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "654cd097e182a71dbf899178e6b5662c2157dd0b8afd5975de18008f6fc173d1" -dependencies = [ - "filetime", -] - -[[package]] -name = "walkdir" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" -dependencies = [ - "same-file", - "winapi-util", -] - -[[package]] -name = "wasm-bindgen" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" -dependencies = [ - "cfg-if", - "wasm-bindgen-macro", -] - -[[package]] -name = "wasm-bindgen-backend" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" -dependencies = [ - "bumpalo", - "log", - "once_cell", - "proc-macro2", - "quote", - "syn", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-macro" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" -dependencies = [ - "quote", - "wasm-bindgen-macro-support", -] - -[[package]] -name = "wasm-bindgen-macro-support" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" -dependencies = [ - "proc-macro2", - "quote", - "syn", - "wasm-bindgen-backend", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-shared" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" - -[[package]] -name = "winapi-util" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b" -dependencies = [ - "windows-sys 0.52.0", -] - -[[package]] -name = "windows-core" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" -dependencies = [ - "windows-targets 0.52.6", -] - -[[package]] -name = "windows-sys" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" -dependencies = [ - "windows-targets 0.48.5", -] - -[[package]] -name = "windows-sys" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" -dependencies = [ - "windows-targets 0.52.6", -] - -[[package]] -name = "windows-targets" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" -dependencies = [ - "windows_aarch64_gnullvm 0.48.5", - "windows_aarch64_msvc 0.48.5", - "windows_i686_gnu 0.48.5", - "windows_i686_msvc 0.48.5", - "windows_x86_64_gnu 0.48.5", - "windows_x86_64_gnullvm 0.48.5", - "windows_x86_64_msvc 0.48.5", -] - -[[package]] -name = "windows-targets" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" -dependencies = [ - "windows_aarch64_gnullvm 0.52.6", - "windows_aarch64_msvc 0.52.6", - "windows_i686_gnu 0.52.6", - "windows_i686_gnullvm", - "windows_i686_msvc 0.52.6", - "windows_x86_64_gnu 0.52.6", - "windows_x86_64_gnullvm 0.52.6", - "windows_x86_64_msvc 0.52.6", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" - -[[package]] -name = "windows_i686_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" - -[[package]] -name = "windows_i686_gnu" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" - -[[package]] -name = "windows_i686_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" - -[[package]] -name = "windows_i686_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" - -[[package]] -name = "windows_i686_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" diff --git a/fixtures/enhanced_resolve/lib/index.js b/fixtures/enhanced_resolve/lib/index.js deleted file mode 100644 index 1e872e8f..00000000 --- a/fixtures/enhanced_resolve/lib/index.js +++ /dev/null @@ -1 +0,0 @@ -// mimic enhanced-resolved root directory structure diff --git a/fixtures/enhanced_resolve/package.json b/fixtures/enhanced_resolve/package.json deleted file mode 100644 index d1b845b5..00000000 --- a/fixtures/enhanced_resolve/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "enhanced-resolve", - "main": "lib/index.js" -} diff --git a/fixtures/enhanced_resolve/test/.gitignore b/fixtures/enhanced_resolve/test/.gitignore deleted file mode 100644 index b021b4e4..00000000 --- a/fixtures/enhanced_resolve/test/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -# created by symlink.rs -/temp -/temp_symlinks \ No newline at end of file diff --git a/fixtures/enhanced_resolve/test/fixtures/#/a.js b/fixtures/enhanced_resolve/test/fixtures/#/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/a.js b/fixtures/enhanced_resolve/test/fixtures/a.js deleted file mode 100644 index 896ffc6d..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/abc.txt b/fixtures/enhanced_resolve/test/fixtures/abc.txt deleted file mode 100644 index f2ba8f84..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/abc.txt +++ /dev/null @@ -1 +0,0 @@ -abc \ No newline at end of file diff --git a/fixtures/enhanced_resolve/test/fixtures/alias/files/a.js b/fixtures/enhanced_resolve/test/fixtures/alias/files/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/b.js b/fixtures/enhanced_resolve/test/fixtures/b.js deleted file mode 100644 index 11476340..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/b.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function b() { - return "This is b"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/browser/module-a.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/browser/module-a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/browser.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/ignore.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/ignore.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/replaced.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/replaced.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/self.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/self.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/toString.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/toString.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-a.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-b.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-c.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-c.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/a.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/b.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/c.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/c.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/d.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/d.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json deleted file mode 100644 index c13fe23b..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "browser": { - "a.js": "./a", - "./b.js": "./b", - "c.js": "./d.js", - "./d.js": "./c.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/package.json b/fixtures/enhanced_resolve/test/fixtures/browser-module/package.json deleted file mode 100644 index 19ff7739..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/browser-module/package.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "exports": { - "./lib/index.js": "./lib/index.js" - }, - "browser": { - "./lib/ignore.js": false, - "./lib/replaced.js": "./lib/browser", - "module-a": "./browser/module-a.js", - "module-b": "module-c", - "module-c": "module-c", - "./toString": "./lib/toString.js", - "./lib/main.js": "./lib/main.js", - "./main.js": "./lib/main.js", - "./lib/xyz.js": "./xyz.js", - "./xyz.js": "./lib/xyz.js", - "./lib/non-existent.js": "./lib/non-existent.js", - ".": false, - "./number": 1, - "./foo": "./lib/replaced.js?query" - }, - "innerBrowser1": { - "field": { - "browser": { - "./lib/main1.js": "./lib/main.js" - } - } - }, - "innerBrowser2": { - "browser": { - "./lib/main2.js": "./lib/replaced.js" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/builtins/package.json b/fixtures/enhanced_resolve/test/fixtures/builtins/package.json deleted file mode 100644 index 4a54ea96..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/builtins/package.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "name": "builtins", - "private": true, - "imports": { - "#fs": { - "default": "fs" - }, - "#http": { - "node": "node:http" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/c.js b/fixtures/enhanced_resolve/test/fixtures/c.js deleted file mode 100644 index e3aca8aa..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/c.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = function b() { - require("./a"); - return "This is c"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/complex.js b/fixtures/enhanced_resolve/test/fixtures/complex.js deleted file mode 100644 index 1f62db84..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/complex.js +++ /dev/null @@ -1,13 +0,0 @@ -var 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); diff --git a/fixtures/enhanced_resolve/test/fixtures/crypto-js/index.js b/fixtures/enhanced_resolve/test/fixtures/crypto-js/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json b/fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json deleted file mode 100644 index 1d31aa8b..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "crypto-js", - "main": "index.js", - "browser": { - "crypto": false - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/decorated-fs/exists.js b/fixtures/enhanced_resolve/test/fixtures/decorated-fs/exists.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/dirOrFile.js b/fixtures/enhanced_resolve/test/fixtures/dirOrFile.js deleted file mode 100644 index c3cb885f..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/dirOrFile.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "file"; diff --git a/fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js b/fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js deleted file mode 100644 index 85e01cd4..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "dir"; diff --git a/fixtures/enhanced_resolve/test/fixtures/directory-default/directory-default.js b/fixtures/enhanced_resolve/test/fixtures/directory-default/directory-default.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js deleted file mode 100644 index d1007aae..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js +++ /dev/null @@ -1 +0,0 @@ -export default "string"; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts deleted file mode 100644 index cb0ff5c3..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json deleted file mode 100644 index b523a1e9..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "@org/pkg", - "exports": { - "./*.js": { - "types": "./dist/*.d.ts", - "default": "./dist/*.js" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js deleted file mode 100644 index d1007aae..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js +++ /dev/null @@ -1 +0,0 @@ -export default "string"; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts deleted file mode 100644 index cb0ff5c3..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json deleted file mode 100644 index 8e55fb46..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "@raviqqe/hidash", - "exports": { - "./*.js": { - "types": "./dist/*.d.ts", - "default": "./dist/*.js" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json deleted file mode 100644 index f0edf449..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "exports-field", - "version": "1.0.0", - "exports": { - ".": "./a/../b/../../pack1/index.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/pack1/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/pack1/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/a.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/a.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json deleted file mode 100644 index 6b105c08..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "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/": { - "webpack": ["./lib/lib2/", "./lib/"], - "node": "./lib/", - "default": "./lib/" - }, - "./dist/a.js": "./../../a.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json deleted file mode 100644 index 0012a3de..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "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" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/umd.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/umd.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field/package.json deleted file mode 100644 index 5fa72bb5..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "@exports-field/core", - "version": "1.0.0", - "exports": "./a.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json deleted file mode 100644 index e6f12074..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "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/lib2/", "./lib/"], - "node": "./lib/", - "default": "./lib/" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/index b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/index deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json deleted file mode 100644 index 1a838f49..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "name": "exports-field", - "exportsField": { - "exports": "./main.js" - }, - "ex": "./index", - "broken": { - ".": "./src" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/src/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/src/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.ts b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.mts b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.mts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mjs b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mjs deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mts.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mts.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.ts b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/app.module.js b/fixtures/enhanced_resolve/test/fixtures/extensions/app.module.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.js b/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/foo.js b/fixtures/enhanced_resolve/test/fixtures/extensions/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/foo.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/foo.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/index.js b/fixtures/enhanced_resolve/test/fixtures/extensions/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/index.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module.js b/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module/index.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/package.json b/fixtures/enhanced_resolve/test/fixtures/extensions/package.json deleted file mode 100644 index 5e55a1e8..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/extensions/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "./index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/file.load1 b/fixtures/enhanced_resolve/test/fixtures/file.load1 deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/file.load2 b/fixtures/enhanced_resolve/test/fixtures/file.load2 deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/foo/index.js b/fixtures/enhanced_resolve/test/fixtures/foo/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/foo/package.json b/fixtures/enhanced_resolve/test/fixtures/foo/package.json deleted file mode 100644 index da86787a..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/foo/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "foo", - "version": "1.0.0" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json deleted file mode 100644 index aa2be496..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "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" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/internal/file.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/internal/file.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/y/y.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/y/y.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/internal/i.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/internal/i.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/nested/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js deleted file mode 100644 index e5b70a86..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = { nested: "nested" } diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-3/nested/f/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-3/nested/f/nested/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-4/f/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-4/f/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f$/$.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f$/$.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f/$.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f/$.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/nested/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/a.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/a.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/b.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/dir/b.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/dir/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/index.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json deleted file mode 100644 index 8d8d3a46..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "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/lib2/", "./lib/"], - "node": "./lib/", - "default": "./lib/" - }, - "./dist/a.js": "./../../a.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/c/index.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/c/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/imports-field/package.json deleted file mode 100644 index 248351a9..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "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" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/a.js b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json deleted file mode 100644 index ded7faa2..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json +++ /dev/null @@ -1,2 +0,0 @@ -{ - "main": "./a.js", diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/a.js b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/package.json b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/package.json deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/issue-238/package.json b/fixtures/enhanced_resolve/test/fixtures/issue-238/package.json deleted file mode 100644 index 352055cd..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/issue-238/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "private": true -} diff --git a/fixtures/enhanced_resolve/test/fixtures/issue-238/src/a/config.js b/fixtures/enhanced_resolve/test/fixtures/issue-238/src/a/config.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/issue-238/src/common/config/myObjectFile.js b/fixtures/enhanced_resolve/test/fixtures/issue-238/src/common/config/myObjectFile.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/lib.js b/fixtures/enhanced_resolve/test/fixtures/lib.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/lib/complex1.js b/fixtures/enhanced_resolve/test/fixtures/lib/complex1.js deleted file mode 100644 index b3de3d70..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/lib/complex1.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "lib complex1"; diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self/index.js b/fixtures/enhanced_resolve/test/fixtures/main-field-self/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json b/fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json deleted file mode 100644 index a2b6f341..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "./" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self2/index.js b/fixtures/enhanced_resolve/test/fixtures/main-field-self2/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json b/fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json deleted file mode 100644 index 4fa6f730..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "." -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main1.js b/fixtures/enhanced_resolve/test/fixtures/main1.js deleted file mode 100644 index 168f2a1e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main1.js +++ /dev/null @@ -1,9 +0,0 @@ -var a = require("./a"); -if (x) { - for (var i = 0; i < 100; i++) { - while (true) require("./b"); - do { - i++; - } while (require("m1/a")()); - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main2.js b/fixtures/enhanced_resolve/test/fixtures/main2.js deleted file mode 100644 index 39f062b1..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main2.js +++ /dev/null @@ -1,12 +0,0 @@ -var 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"); - }); - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main3.js b/fixtures/enhanced_resolve/test/fixtures/main3.js deleted file mode 100644 index 1c180166..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main3.js +++ /dev/null @@ -1,4 +0,0 @@ -var a = require("./a"); -require.ensure([], function(require) { - require("./c.js"); -}); diff --git a/fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js b/fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js deleted file mode 100644 index 997c1051..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is nested m1/a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/no#fragment/#/#.js b/fixtures/enhanced_resolve/test/fixtures/no#fragment/#/#.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/no.js b/fixtures/enhanced_resolve/test/fixtures/no.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/browser.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/browser.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/main.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json deleted file mode 100644 index c469e1fd..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "main": "./main.js", - "browser": "./browser.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js deleted file mode 100644 index 549620a5..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "the correct a.js"; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js deleted file mode 100644 index 5db6632e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = " :) " + require("m2/b.js"); diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js deleted file mode 100644 index d308569d..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require("m1/a") + require("m1"); diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js deleted file mode 100644 index cb8127e8..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "Step2"; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json deleted file mode 100644 index 8d6dfa56..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "dash-name", - "exports": "./index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json deleted file mode 100644 index 4fd8706e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "dash", - "exports": "./index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/invalidPackageJson/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/invalidPackageJson/package.json deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js deleted file mode 100644 index 46fc8e6c..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is m1/a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js deleted file mode 100644 index 8565c244..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is m1/b"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js deleted file mode 100644 index 34faaaf5..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "This is m2/b"; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/file.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/file.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js b/fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js deleted file mode 100644 index 997c1051..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is nested m1/a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/dir/index.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/dir/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/index.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/main.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/browser.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/browser.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/index.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json deleted file mode 100644 index e20ceaeb..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "main": "main.js", - "browser": { - "./package-alias/index.js": "./package-alias/browser.js", - "module": "pkg/dir/index" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/typescript/index.ts b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/typescript/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json deleted file mode 100644 index 4a1f838e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "@exports-field/core", - "version": "1.0.0", - "exports": { - ".": "./a.js", - "./x": "./a.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/prefer-pnp/alternative-modules/m1/b.js b/fixtures/enhanced_resolve/test/fixtures/prefer-pnp/alternative-modules/m1/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.css b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.css deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.js b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json deleted file mode 100644 index 14ab704d..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/index.css b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/index.css deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/module.js b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/module.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json deleted file mode 100644 index ee0eb71b..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "main": "../../../c.js", - "module": "module.js", - "style": "index.css" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/roots_fall_through/index.js b/fixtures/enhanced_resolve/test/fixtures/roots_fall_through/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/main.js b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json deleted file mode 100644 index 70a0f20f..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "browser": { - "./index.js": "./main.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/lib/index.js b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/lib/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/main.js b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json deleted file mode 100644 index 2af9e0d1..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "./main.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/shortcutdir.js/a.js b/fixtures/enhanced_resolve/test/fixtures/shortcutdir.js/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/b b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/b deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/c b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/c deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/a b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/a deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/b b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/b deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/b/foo/a b/fixtures/enhanced_resolve/test/fixtures/yield/b/foo/a deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/a b/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/a deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json b/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json deleted file mode 100644 index 0acc4b4c..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "foo", - "version": "1.0.0", - "browser": { - "./a": false - } -} diff --git "a/fixtures/enhanced_resolve/test/fixtures/\346\265\213\350\257\225.js" "b/fixtures/enhanced_resolve/test/fixtures/\346\265\213\350\257\225.js" deleted file mode 100644 index e69de29b..00000000 diff --git "a/fixtures/misc/\344\270\255\346\226\207/\344\270\255\346\226\207.js" "b/fixtures/misc/\344\270\255\346\226\207/\344\270\255\346\226\207.js" deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/pnp/.gitignore b/fixtures/pnp/.gitignore deleted file mode 100644 index 1783c71a..00000000 --- a/fixtures/pnp/.gitignore +++ /dev/null @@ -1 +0,0 @@ -install_state.gz \ No newline at end of file diff --git a/fixtures/pnp/.pnp.cjs b/fixtures/pnp/.pnp.cjs deleted file mode 100755 index 2a8d1771..00000000 --- a/fixtures/pnp/.pnp.cjs +++ /dev/null @@ -1,7543 +0,0 @@ -#!/usr/bin/env node -/* eslint-disable */ -// @ts-nocheck -"use strict"; - -const RAW_RUNTIME_STATE = -'{\ - "__info": [\ - "This file is automatically generated. Do not touch it, or risk",\ - "your modifications being lost."\ - ],\ - "dependencyTreeRoots": [\ - {\ - "name": "pnp",\ - "reference": "workspace:."\ - }\ - ],\ - "enableTopLevelFallback": true,\ - "ignorePatternData": "(^(?:\\\\.yarn\\\\/sdks(?:\\\\/(?!\\\\.{1,2}(?:\\\\/|$))(?:(?:(?!(?:^|\\\\/)\\\\.{1,2}(?:\\\\/|$)).)*?)|$))$)",\ - "fallbackExclusionList": [\ - ["pnp", ["workspace:."]]\ - ],\ - "fallbackPool": [\ - ],\ - "packageRegistryData": [\ - [null, [\ - [null, {\ - "packageLocation": "./",\ - "packageDependencies": [\ - ["is-even", "npm:1.0.0"],\ - ["is-odd", "npm:3.0.1"]\ - ],\ - "linkType": "SOFT"\ - }]\ - ]],\ - ["is-buffer", [\ - ["npm:1.1.6", {\ - "packageLocation": "./.yarn/cache/is-buffer-npm-1.1.6-08199d9ccc-ae18aa0b6e.zip/node_modules/is-buffer/",\ - "packageDependencies": [\ - ["is-buffer", "npm:1.1.6"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["is-even", [\ - ["npm:1.0.0", {\ - "packageLocation": "./.yarn/cache/is-even-npm-1.0.0-9f726520dc-2728cc2f39.zip/node_modules/is-even/",\ - "packageDependencies": [\ - ["is-even", "npm:1.0.0"],\ - ["is-odd", "npm:0.1.2"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["is-number", [\ - ["npm:3.0.0", {\ - "packageLocation": "./.yarn/cache/is-number-npm-3.0.0-9088035ade-e639c54640.zip/node_modules/is-number/",\ - "packageDependencies": [\ - ["is-number", "npm:3.0.0"],\ - ["kind-of", "npm:3.2.2"]\ - ],\ - "linkType": "HARD"\ - }],\ - ["npm:6.0.0", {\ - "packageLocation": "./.yarn/cache/is-number-npm-6.0.0-30881e83e6-5da4c68401.zip/node_modules/is-number/",\ - "packageDependencies": [\ - ["is-number", "npm:6.0.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["is-odd", [\ - ["npm:0.1.2", {\ - "packageLocation": "./.yarn/cache/is-odd-npm-0.1.2-9d980a9da8-7dc6c6fd00.zip/node_modules/is-odd/",\ - "packageDependencies": [\ - ["is-odd", "npm:0.1.2"],\ - ["is-number", "npm:3.0.0"]\ - ],\ - "linkType": "HARD"\ - }],\ - ["npm:3.0.1", {\ - "packageLocation": "./.yarn/cache/is-odd-npm-3.0.1-93c3c3f41b-89ee2e353c.zip/node_modules/is-odd/",\ - "packageDependencies": [\ - ["is-odd", "npm:3.0.1"],\ - ["is-number", "npm:6.0.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["kind-of", [\ - ["npm:3.2.2", {\ - "packageLocation": "./.yarn/cache/kind-of-npm-3.2.2-7deaffa5f9-7e34bc29d4.zip/node_modules/kind-of/",\ - "packageDependencies": [\ - ["kind-of", "npm:3.2.2"],\ - ["is-buffer", "npm:1.1.6"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["pnp", [\ - ["workspace:.", {\ - "packageLocation": "./",\ - "packageDependencies": [\ - ["pnp", "workspace:."],\ - ["is-even", "npm:1.0.0"],\ - ["is-odd", "npm:3.0.1"]\ - ],\ - "linkType": "SOFT"\ - }]\ - ]]\ - ]\ -}'; - -function $$SETUP_STATE(hydrateRuntimeState, basePath) { - return hydrateRuntimeState(JSON.parse(RAW_RUNTIME_STATE), {basePath: basePath || __dirname}); -} - -const fs = require('fs'); -const path = require('path'); -const crypto = require('crypto'); -const os = require('os'); -const events = require('events'); -const nodeUtils = require('util'); -const stream = require('stream'); -const zlib = require('zlib'); -const require$$0 = require('module'); -const StringDecoder = require('string_decoder'); -const url = require('url'); -const buffer = require('buffer'); -const readline = require('readline'); -const assert = require('assert'); - -const _interopDefaultLegacy = e => e && typeof e === 'object' && 'default' in e ? e : { default: e }; - -function _interopNamespace(e) { - if (e && e.__esModule) return e; - const n = Object.create(null); - if (e) { - for (const k in e) { - if (k !== 'default') { - const d = Object.getOwnPropertyDescriptor(e, k); - Object.defineProperty(n, k, d.get ? d : { - enumerable: true, - get: () => e[k] - }); - } - } - } - n.default = e; - return Object.freeze(n); -} - -const fs__default = /*#__PURE__*/_interopDefaultLegacy(fs); -const path__default = /*#__PURE__*/_interopDefaultLegacy(path); -const nodeUtils__namespace = /*#__PURE__*/_interopNamespace(nodeUtils); -const zlib__default = /*#__PURE__*/_interopDefaultLegacy(zlib); -const require$$0__default = /*#__PURE__*/_interopDefaultLegacy(require$$0); -const StringDecoder__default = /*#__PURE__*/_interopDefaultLegacy(StringDecoder); -const buffer__default = /*#__PURE__*/_interopDefaultLegacy(buffer); -const assert__default = /*#__PURE__*/_interopDefaultLegacy(assert); - -const S_IFMT = 61440; -const S_IFDIR = 16384; -const S_IFREG = 32768; -const S_IFLNK = 40960; -const SAFE_TIME = 456789e3; - -function makeError$1(code, message) { - return Object.assign(new Error(`${code}: ${message}`), { code }); -} -function EBUSY(message) { - return makeError$1(`EBUSY`, message); -} -function ENOSYS(message, reason) { - return makeError$1(`ENOSYS`, `${message}, ${reason}`); -} -function EINVAL(reason) { - return makeError$1(`EINVAL`, `invalid argument, ${reason}`); -} -function EBADF(reason) { - return makeError$1(`EBADF`, `bad file descriptor, ${reason}`); -} -function ENOENT(reason) { - return makeError$1(`ENOENT`, `no such file or directory, ${reason}`); -} -function ENOTDIR(reason) { - return makeError$1(`ENOTDIR`, `not a directory, ${reason}`); -} -function EISDIR(reason) { - return makeError$1(`EISDIR`, `illegal operation on a directory, ${reason}`); -} -function EEXIST(reason) { - return makeError$1(`EEXIST`, `file already exists, ${reason}`); -} -function EROFS(reason) { - return makeError$1(`EROFS`, `read-only filesystem, ${reason}`); -} -function ENOTEMPTY(reason) { - return makeError$1(`ENOTEMPTY`, `directory not empty, ${reason}`); -} -function EOPNOTSUPP(reason) { - return makeError$1(`EOPNOTSUPP`, `operation not supported, ${reason}`); -} -function ERR_DIR_CLOSED() { - return makeError$1(`ERR_DIR_CLOSED`, `Directory handle was closed`); -} - -const DEFAULT_MODE = S_IFREG | 420; -class StatEntry { - constructor() { - this.uid = 0; - this.gid = 0; - this.size = 0; - this.blksize = 0; - this.atimeMs = 0; - this.mtimeMs = 0; - this.ctimeMs = 0; - this.birthtimeMs = 0; - this.atime = new Date(0); - this.mtime = new Date(0); - this.ctime = new Date(0); - this.birthtime = new Date(0); - this.dev = 0; - this.ino = 0; - this.mode = DEFAULT_MODE; - this.nlink = 1; - this.rdev = 0; - this.blocks = 1; - } - isBlockDevice() { - return false; - } - isCharacterDevice() { - return false; - } - isDirectory() { - return (this.mode & S_IFMT) === S_IFDIR; - } - isFIFO() { - return false; - } - isFile() { - return (this.mode & S_IFMT) === S_IFREG; - } - isSocket() { - return false; - } - isSymbolicLink() { - return (this.mode & S_IFMT) === S_IFLNK; - } -} -class BigIntStatsEntry { - constructor() { - this.uid = BigInt(0); - this.gid = BigInt(0); - this.size = BigInt(0); - this.blksize = BigInt(0); - this.atimeMs = BigInt(0); - this.mtimeMs = BigInt(0); - this.ctimeMs = BigInt(0); - this.birthtimeMs = BigInt(0); - this.atimeNs = BigInt(0); - this.mtimeNs = BigInt(0); - this.ctimeNs = BigInt(0); - this.birthtimeNs = BigInt(0); - this.atime = new Date(0); - this.mtime = new Date(0); - this.ctime = new Date(0); - this.birthtime = new Date(0); - this.dev = BigInt(0); - this.ino = BigInt(0); - this.mode = BigInt(DEFAULT_MODE); - this.nlink = BigInt(1); - this.rdev = BigInt(0); - this.blocks = BigInt(1); - } - isBlockDevice() { - return false; - } - isCharacterDevice() { - return false; - } - isDirectory() { - return (this.mode & BigInt(S_IFMT)) === BigInt(S_IFDIR); - } - isFIFO() { - return false; - } - isFile() { - return (this.mode & BigInt(S_IFMT)) === BigInt(S_IFREG); - } - isSocket() { - return false; - } - isSymbolicLink() { - return (this.mode & BigInt(S_IFMT)) === BigInt(S_IFLNK); - } -} -function makeDefaultStats() { - return new StatEntry(); -} -function clearStats(stats) { - for (const key in stats) { - if (Object.hasOwn(stats, key)) { - const element = stats[key]; - if (typeof element === `number`) { - stats[key] = 0; - } else if (typeof element === `bigint`) { - stats[key] = BigInt(0); - } else if (nodeUtils__namespace.types.isDate(element)) { - stats[key] = new Date(0); - } - } - } - return stats; -} -function convertToBigIntStats(stats) { - const bigintStats = new BigIntStatsEntry(); - for (const key in stats) { - if (Object.hasOwn(stats, key)) { - const element = stats[key]; - if (typeof element === `number`) { - bigintStats[key] = BigInt(element); - } else if (nodeUtils__namespace.types.isDate(element)) { - bigintStats[key] = new Date(element); - } - } - } - bigintStats.atimeNs = bigintStats.atimeMs * BigInt(1e6); - bigintStats.mtimeNs = bigintStats.mtimeMs * BigInt(1e6); - bigintStats.ctimeNs = bigintStats.ctimeMs * BigInt(1e6); - bigintStats.birthtimeNs = bigintStats.birthtimeMs * BigInt(1e6); - return bigintStats; -} -function areStatsEqual(a, b) { - if (a.atimeMs !== b.atimeMs) - return false; - if (a.birthtimeMs !== b.birthtimeMs) - return false; - if (a.blksize !== b.blksize) - return false; - if (a.blocks !== b.blocks) - return false; - if (a.ctimeMs !== b.ctimeMs) - return false; - if (a.dev !== b.dev) - return false; - if (a.gid !== b.gid) - return false; - if (a.ino !== b.ino) - return false; - if (a.isBlockDevice() !== b.isBlockDevice()) - return false; - if (a.isCharacterDevice() !== b.isCharacterDevice()) - return false; - if (a.isDirectory() !== b.isDirectory()) - return false; - if (a.isFIFO() !== b.isFIFO()) - return false; - if (a.isFile() !== b.isFile()) - return false; - if (a.isSocket() !== b.isSocket()) - return false; - if (a.isSymbolicLink() !== b.isSymbolicLink()) - return false; - if (a.mode !== b.mode) - return false; - if (a.mtimeMs !== b.mtimeMs) - return false; - if (a.nlink !== b.nlink) - return false; - if (a.rdev !== b.rdev) - return false; - if (a.size !== b.size) - return false; - if (a.uid !== b.uid) - return false; - const aN = a; - const bN = b; - if (aN.atimeNs !== bN.atimeNs) - return false; - if (aN.mtimeNs !== bN.mtimeNs) - return false; - if (aN.ctimeNs !== bN.ctimeNs) - return false; - if (aN.birthtimeNs !== bN.birthtimeNs) - return false; - return true; -} - -const PortablePath = { - root: `/`, - dot: `.`, - parent: `..` -}; -const Filename = { - home: `~`, - nodeModules: `node_modules`, - manifest: `package.json`, - lockfile: `yarn.lock`, - virtual: `__virtual__`, - pnpJs: `.pnp.js`, - pnpCjs: `.pnp.cjs`, - pnpData: `.pnp.data.json`, - pnpEsmLoader: `.pnp.loader.mjs`, - rc: `.yarnrc.yml`, - env: `.env` -}; -const npath = Object.create(path__default.default); -const ppath = Object.create(path__default.default.posix); -npath.cwd = () => process.cwd(); -ppath.cwd = process.platform === `win32` ? () => toPortablePath(process.cwd()) : process.cwd; -if (process.platform === `win32`) { - ppath.resolve = (...segments) => { - if (segments.length > 0 && ppath.isAbsolute(segments[0])) { - return path__default.default.posix.resolve(...segments); - } else { - return path__default.default.posix.resolve(ppath.cwd(), ...segments); - } - }; -} -const contains = function(pathUtils, from, to) { - from = pathUtils.normalize(from); - to = pathUtils.normalize(to); - if (from === to) - return `.`; - if (!from.endsWith(pathUtils.sep)) - from = from + pathUtils.sep; - if (to.startsWith(from)) { - return to.slice(from.length); - } else { - return null; - } -}; -npath.contains = (from, to) => contains(npath, from, to); -ppath.contains = (from, to) => contains(ppath, from, to); -const WINDOWS_PATH_REGEXP = /^([a-zA-Z]:.*)$/; -const UNC_WINDOWS_PATH_REGEXP = /^\/\/(\.\/)?(.*)$/; -const PORTABLE_PATH_REGEXP = /^\/([a-zA-Z]:.*)$/; -const UNC_PORTABLE_PATH_REGEXP = /^\/unc\/(\.dot\/)?(.*)$/; -function fromPortablePathWin32(p) { - let portablePathMatch, uncPortablePathMatch; - if (portablePathMatch = p.match(PORTABLE_PATH_REGEXP)) - p = portablePathMatch[1]; - else if (uncPortablePathMatch = p.match(UNC_PORTABLE_PATH_REGEXP)) - p = `\\\\${uncPortablePathMatch[1] ? `.\\` : ``}${uncPortablePathMatch[2]}`; - else - return p; - return p.replace(/\//g, `\\`); -} -function toPortablePathWin32(p) { - p = p.replace(/\\/g, `/`); - let windowsPathMatch, uncWindowsPathMatch; - if (windowsPathMatch = p.match(WINDOWS_PATH_REGEXP)) - p = `/${windowsPathMatch[1]}`; - else if (uncWindowsPathMatch = p.match(UNC_WINDOWS_PATH_REGEXP)) - p = `/unc/${uncWindowsPathMatch[1] ? `.dot/` : ``}${uncWindowsPathMatch[2]}`; - return p; -} -const toPortablePath = process.platform === `win32` ? toPortablePathWin32 : (p) => p; -const fromPortablePath = process.platform === `win32` ? fromPortablePathWin32 : (p) => p; -npath.fromPortablePath = fromPortablePath; -npath.toPortablePath = toPortablePath; -function convertPath(targetPathUtils, sourcePath) { - return targetPathUtils === npath ? fromPortablePath(sourcePath) : toPortablePath(sourcePath); -} - -const defaultTime = new Date(SAFE_TIME * 1e3); -const defaultTimeMs = defaultTime.getTime(); -async function copyPromise(destinationFs, destination, sourceFs, source, opts) { - const normalizedDestination = destinationFs.pathUtils.normalize(destination); - const normalizedSource = sourceFs.pathUtils.normalize(source); - const prelayout = []; - const postlayout = []; - const { atime, mtime } = opts.stableTime ? { atime: defaultTime, mtime: defaultTime } : await sourceFs.lstatPromise(normalizedSource); - await destinationFs.mkdirpPromise(destinationFs.pathUtils.dirname(destination), { utimes: [atime, mtime] }); - await copyImpl(prelayout, postlayout, destinationFs, normalizedDestination, sourceFs, normalizedSource, { ...opts, didParentExist: true }); - for (const operation of prelayout) - await operation(); - await Promise.all(postlayout.map((operation) => { - return operation(); - })); -} -async function copyImpl(prelayout, postlayout, destinationFs, destination, sourceFs, source, opts) { - const destinationStat = opts.didParentExist ? await maybeLStat(destinationFs, destination) : null; - const sourceStat = await sourceFs.lstatPromise(source); - const { atime, mtime } = opts.stableTime ? { atime: defaultTime, mtime: defaultTime } : sourceStat; - let updated; - switch (true) { - case sourceStat.isDirectory(): - { - updated = await copyFolder(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts); - } - break; - case sourceStat.isFile(): - { - updated = await copyFile(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts); - } - break; - case sourceStat.isSymbolicLink(): - { - updated = await copySymlink(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts); - } - break; - default: { - throw new Error(`Unsupported file type (${sourceStat.mode})`); - } - } - if (opts.linkStrategy?.type !== `HardlinkFromIndex` || !sourceStat.isFile()) { - if (updated || destinationStat?.mtime?.getTime() !== mtime.getTime() || destinationStat?.atime?.getTime() !== atime.getTime()) { - postlayout.push(() => destinationFs.lutimesPromise(destination, atime, mtime)); - updated = true; - } - if (destinationStat === null || (destinationStat.mode & 511) !== (sourceStat.mode & 511)) { - postlayout.push(() => destinationFs.chmodPromise(destination, sourceStat.mode & 511)); - updated = true; - } - } - return updated; -} -async function maybeLStat(baseFs, p) { - try { - return await baseFs.lstatPromise(p); - } catch (e) { - return null; - } -} -async function copyFolder(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts) { - if (destinationStat !== null && !destinationStat.isDirectory()) { - if (opts.overwrite) { - prelayout.push(async () => destinationFs.removePromise(destination)); - destinationStat = null; - } else { - return false; - } - } - let updated = false; - if (destinationStat === null) { - prelayout.push(async () => { - try { - await destinationFs.mkdirPromise(destination, { mode: sourceStat.mode }); - } catch (err) { - if (err.code !== `EEXIST`) { - throw err; - } - } - }); - updated = true; - } - const entries = await sourceFs.readdirPromise(source); - const nextOpts = opts.didParentExist && !destinationStat ? { ...opts, didParentExist: false } : opts; - if (opts.stableSort) { - for (const entry of entries.sort()) { - if (await copyImpl(prelayout, postlayout, destinationFs, destinationFs.pathUtils.join(destination, entry), sourceFs, sourceFs.pathUtils.join(source, entry), nextOpts)) { - updated = true; - } - } - } else { - const entriesUpdateStatus = await Promise.all(entries.map(async (entry) => { - await copyImpl(prelayout, postlayout, destinationFs, destinationFs.pathUtils.join(destination, entry), sourceFs, sourceFs.pathUtils.join(source, entry), nextOpts); - })); - if (entriesUpdateStatus.some((status) => status)) { - updated = true; - } - } - return updated; -} -async function copyFileViaIndex(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts, linkStrategy) { - const sourceHash = await sourceFs.checksumFilePromise(source, { algorithm: `sha1` }); - const defaultMode = 420; - const sourceMode = sourceStat.mode & 511; - const indexFileName = `${sourceHash}${sourceMode !== defaultMode ? sourceMode.toString(8) : ``}`; - const indexPath = destinationFs.pathUtils.join(linkStrategy.indexPath, sourceHash.slice(0, 2), `${indexFileName}.dat`); - let AtomicBehavior; - ((AtomicBehavior2) => { - AtomicBehavior2[AtomicBehavior2["Lock"] = 0] = "Lock"; - AtomicBehavior2[AtomicBehavior2["Rename"] = 1] = "Rename"; - })(AtomicBehavior || (AtomicBehavior = {})); - let atomicBehavior = 1 /* Rename */; - let indexStat = await maybeLStat(destinationFs, indexPath); - if (destinationStat) { - const isDestinationHardlinkedFromIndex = indexStat && destinationStat.dev === indexStat.dev && destinationStat.ino === indexStat.ino; - const isIndexModified = indexStat?.mtimeMs !== defaultTimeMs; - if (isDestinationHardlinkedFromIndex) { - if (isIndexModified && linkStrategy.autoRepair) { - atomicBehavior = 0 /* Lock */; - indexStat = null; - } - } - if (!isDestinationHardlinkedFromIndex) { - if (opts.overwrite) { - prelayout.push(async () => destinationFs.removePromise(destination)); - destinationStat = null; - } else { - return false; - } - } - } - const tempPath = !indexStat && atomicBehavior === 1 /* Rename */ ? `${indexPath}.${Math.floor(Math.random() * 4294967296).toString(16).padStart(8, `0`)}` : null; - let tempPathCleaned = false; - prelayout.push(async () => { - if (!indexStat) { - if (atomicBehavior === 0 /* Lock */) { - await destinationFs.lockPromise(indexPath, async () => { - const content = await sourceFs.readFilePromise(source); - await destinationFs.writeFilePromise(indexPath, content); - }); - } - if (atomicBehavior === 1 /* Rename */ && tempPath) { - const content = await sourceFs.readFilePromise(source); - await destinationFs.writeFilePromise(tempPath, content); - try { - await destinationFs.linkPromise(tempPath, indexPath); - } catch (err) { - if (err.code === `EEXIST`) { - tempPathCleaned = true; - await destinationFs.unlinkPromise(tempPath); - } else { - throw err; - } - } - } - } - if (!destinationStat) { - await destinationFs.linkPromise(indexPath, destination); - } - }); - postlayout.push(async () => { - if (!indexStat) { - await destinationFs.lutimesPromise(indexPath, defaultTime, defaultTime); - if (sourceMode !== defaultMode) { - await destinationFs.chmodPromise(indexPath, sourceMode); - } - } - if (tempPath && !tempPathCleaned) { - await destinationFs.unlinkPromise(tempPath); - } - }); - return false; -} -async function copyFileDirect(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts) { - if (destinationStat !== null) { - if (opts.overwrite) { - prelayout.push(async () => destinationFs.removePromise(destination)); - destinationStat = null; - } else { - return false; - } - } - prelayout.push(async () => { - const content = await sourceFs.readFilePromise(source); - await destinationFs.writeFilePromise(destination, content); - }); - return true; -} -async function copyFile(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts) { - if (opts.linkStrategy?.type === `HardlinkFromIndex`) { - return copyFileViaIndex(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts, opts.linkStrategy); - } else { - return copyFileDirect(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts); - } -} -async function copySymlink(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts) { - if (destinationStat !== null) { - if (opts.overwrite) { - prelayout.push(async () => destinationFs.removePromise(destination)); - destinationStat = null; - } else { - return false; - } - } - prelayout.push(async () => { - await destinationFs.symlinkPromise(convertPath(destinationFs.pathUtils, await sourceFs.readlinkPromise(source)), destination); - }); - return true; -} - -class CustomDir { - constructor(path, nextDirent, opts = {}) { - this.path = path; - this.nextDirent = nextDirent; - this.opts = opts; - this.closed = false; - } - throwIfClosed() { - if (this.closed) { - throw ERR_DIR_CLOSED(); - } - } - async *[Symbol.asyncIterator]() { - try { - let dirent; - while ((dirent = await this.read()) !== null) { - yield dirent; - } - } finally { - await this.close(); - } - } - read(cb) { - const dirent = this.readSync(); - if (typeof cb !== `undefined`) - return cb(null, dirent); - return Promise.resolve(dirent); - } - readSync() { - this.throwIfClosed(); - return this.nextDirent(); - } - close(cb) { - this.closeSync(); - if (typeof cb !== `undefined`) - return cb(null); - return Promise.resolve(); - } - closeSync() { - this.throwIfClosed(); - this.opts.onClose?.(); - this.closed = true; - } -} -function opendir(fakeFs, path, entries, opts) { - const nextDirent = () => { - const filename = entries.shift(); - if (typeof filename === `undefined`) - return null; - const entryPath = fakeFs.pathUtils.join(path, filename); - return Object.assign(fakeFs.statSync(entryPath), { - name: filename, - path: void 0 - }); - }; - return new CustomDir(path, nextDirent, opts); -} - -function assertStatus(current, expected) { - if (current !== expected) { - throw new Error(`Invalid StatWatcher status: expected '${expected}', got '${current}'`); - } -} -class CustomStatWatcher extends events.EventEmitter { - constructor(fakeFs, path, { bigint = false } = {}) { - super(); - this.status = "ready" /* Ready */; - this.changeListeners = /* @__PURE__ */ new Map(); - this.startTimeout = null; - this.fakeFs = fakeFs; - this.path = path; - this.bigint = bigint; - this.lastStats = this.stat(); - } - static create(fakeFs, path, opts) { - const statWatcher = new CustomStatWatcher(fakeFs, path, opts); - statWatcher.start(); - return statWatcher; - } - start() { - assertStatus(this.status, "ready" /* Ready */); - this.status = "running" /* Running */; - this.startTimeout = setTimeout(() => { - this.startTimeout = null; - if (!this.fakeFs.existsSync(this.path)) { - this.emit("change" /* Change */, this.lastStats, this.lastStats); - } - }, 3); - } - stop() { - assertStatus(this.status, "running" /* Running */); - this.status = "stopped" /* Stopped */; - if (this.startTimeout !== null) { - clearTimeout(this.startTimeout); - this.startTimeout = null; - } - this.emit("stop" /* Stop */); - } - stat() { - try { - return this.fakeFs.statSync(this.path, { bigint: this.bigint }); - } catch (error) { - const statInstance = this.bigint ? new BigIntStatsEntry() : new StatEntry(); - return clearStats(statInstance); - } - } - makeInterval(opts) { - const interval = setInterval(() => { - const currentStats = this.stat(); - const previousStats = this.lastStats; - if (areStatsEqual(currentStats, previousStats)) - return; - this.lastStats = currentStats; - this.emit("change" /* Change */, currentStats, previousStats); - }, opts.interval); - return opts.persistent ? interval : interval.unref(); - } - registerChangeListener(listener, opts) { - this.addListener("change" /* Change */, listener); - this.changeListeners.set(listener, this.makeInterval(opts)); - } - unregisterChangeListener(listener) { - this.removeListener("change" /* Change */, listener); - const interval = this.changeListeners.get(listener); - if (typeof interval !== `undefined`) - clearInterval(interval); - this.changeListeners.delete(listener); - } - unregisterAllChangeListeners() { - for (const listener of this.changeListeners.keys()) { - this.unregisterChangeListener(listener); - } - } - hasChangeListeners() { - return this.changeListeners.size > 0; - } - ref() { - for (const interval of this.changeListeners.values()) - interval.ref(); - return this; - } - unref() { - for (const interval of this.changeListeners.values()) - interval.unref(); - return this; - } -} - -const statWatchersByFakeFS = /* @__PURE__ */ new WeakMap(); -function watchFile(fakeFs, path, a, b) { - let bigint; - let persistent; - let interval; - let listener; - switch (typeof a) { - case `function`: - { - bigint = false; - persistent = true; - interval = 5007; - listener = a; - } - break; - default: - { - ({ - bigint = false, - persistent = true, - interval = 5007 - } = a); - listener = b; - } - break; - } - let statWatchers = statWatchersByFakeFS.get(fakeFs); - if (typeof statWatchers === `undefined`) - statWatchersByFakeFS.set(fakeFs, statWatchers = /* @__PURE__ */ new Map()); - let statWatcher = statWatchers.get(path); - if (typeof statWatcher === `undefined`) { - statWatcher = CustomStatWatcher.create(fakeFs, path, { bigint }); - statWatchers.set(path, statWatcher); - } - statWatcher.registerChangeListener(listener, { persistent, interval }); - return statWatcher; -} -function unwatchFile(fakeFs, path, cb) { - const statWatchers = statWatchersByFakeFS.get(fakeFs); - if (typeof statWatchers === `undefined`) - return; - const statWatcher = statWatchers.get(path); - if (typeof statWatcher === `undefined`) - return; - if (typeof cb === `undefined`) - statWatcher.unregisterAllChangeListeners(); - else - statWatcher.unregisterChangeListener(cb); - if (!statWatcher.hasChangeListeners()) { - statWatcher.stop(); - statWatchers.delete(path); - } -} -function unwatchAllFiles(fakeFs) { - const statWatchers = statWatchersByFakeFS.get(fakeFs); - if (typeof statWatchers === `undefined`) - return; - for (const path of statWatchers.keys()) { - unwatchFile(fakeFs, path); - } -} - -class FakeFS { - constructor(pathUtils) { - this.pathUtils = pathUtils; - } - async *genTraversePromise(init, { stableSort = false } = {}) { - const stack = [init]; - while (stack.length > 0) { - const p = stack.shift(); - const entry = await this.lstatPromise(p); - if (entry.isDirectory()) { - const entries = await this.readdirPromise(p); - if (stableSort) { - for (const entry2 of entries.sort()) { - stack.push(this.pathUtils.join(p, entry2)); - } - } else { - throw new Error(`Not supported`); - } - } else { - yield p; - } - } - } - async checksumFilePromise(path, { algorithm = `sha512` } = {}) { - const fd = await this.openPromise(path, `r`); - try { - const CHUNK_SIZE = 65536; - const chunk = Buffer.allocUnsafeSlow(CHUNK_SIZE); - const hash = crypto.createHash(algorithm); - let bytesRead = 0; - while ((bytesRead = await this.readPromise(fd, chunk, 0, CHUNK_SIZE)) !== 0) - hash.update(bytesRead === CHUNK_SIZE ? chunk : chunk.slice(0, bytesRead)); - return hash.digest(`hex`); - } finally { - await this.closePromise(fd); - } - } - async removePromise(p, { recursive = true, maxRetries = 5 } = {}) { - let stat; - try { - stat = await this.lstatPromise(p); - } catch (error) { - if (error.code === `ENOENT`) { - return; - } else { - throw error; - } - } - if (stat.isDirectory()) { - if (recursive) { - const entries = await this.readdirPromise(p); - await Promise.all(entries.map((entry) => { - return this.removePromise(this.pathUtils.resolve(p, entry)); - })); - } - for (let t = 0; t <= maxRetries; t++) { - try { - await this.rmdirPromise(p); - break; - } catch (error) { - if (error.code !== `EBUSY` && error.code !== `ENOTEMPTY`) { - throw error; - } else if (t < maxRetries) { - await new Promise((resolve) => setTimeout(resolve, t * 100)); - } - } - } - } else { - await this.unlinkPromise(p); - } - } - removeSync(p, { recursive = true } = {}) { - let stat; - try { - stat = this.lstatSync(p); - } catch (error) { - if (error.code === `ENOENT`) { - return; - } else { - throw error; - } - } - if (stat.isDirectory()) { - if (recursive) - for (const entry of this.readdirSync(p)) - this.removeSync(this.pathUtils.resolve(p, entry)); - this.rmdirSync(p); - } else { - this.unlinkSync(p); - } - } - async mkdirpPromise(p, { chmod, utimes } = {}) { - p = this.resolve(p); - if (p === this.pathUtils.dirname(p)) - return void 0; - const parts = p.split(this.pathUtils.sep); - let createdDirectory; - for (let u = 2; u <= parts.length; ++u) { - const subPath = parts.slice(0, u).join(this.pathUtils.sep); - if (!this.existsSync(subPath)) { - try { - await this.mkdirPromise(subPath); - } catch (error) { - if (error.code === `EEXIST`) { - continue; - } else { - throw error; - } - } - createdDirectory ??= subPath; - if (chmod != null) - await this.chmodPromise(subPath, chmod); - if (utimes != null) { - await this.utimesPromise(subPath, utimes[0], utimes[1]); - } else { - const parentStat = await this.statPromise(this.pathUtils.dirname(subPath)); - await this.utimesPromise(subPath, parentStat.atime, parentStat.mtime); - } - } - } - return createdDirectory; - } - mkdirpSync(p, { chmod, utimes } = {}) { - p = this.resolve(p); - if (p === this.pathUtils.dirname(p)) - return void 0; - const parts = p.split(this.pathUtils.sep); - let createdDirectory; - for (let u = 2; u <= parts.length; ++u) { - const subPath = parts.slice(0, u).join(this.pathUtils.sep); - if (!this.existsSync(subPath)) { - try { - this.mkdirSync(subPath); - } catch (error) { - if (error.code === `EEXIST`) { - continue; - } else { - throw error; - } - } - createdDirectory ??= subPath; - if (chmod != null) - this.chmodSync(subPath, chmod); - if (utimes != null) { - this.utimesSync(subPath, utimes[0], utimes[1]); - } else { - const parentStat = this.statSync(this.pathUtils.dirname(subPath)); - this.utimesSync(subPath, parentStat.atime, parentStat.mtime); - } - } - } - return createdDirectory; - } - async copyPromise(destination, source, { baseFs = this, overwrite = true, stableSort = false, stableTime = false, linkStrategy = null } = {}) { - return await copyPromise(this, destination, baseFs, source, { overwrite, stableSort, stableTime, linkStrategy }); - } - copySync(destination, source, { baseFs = this, overwrite = true } = {}) { - const stat = baseFs.lstatSync(source); - const exists = this.existsSync(destination); - if (stat.isDirectory()) { - this.mkdirpSync(destination); - const directoryListing = baseFs.readdirSync(source); - for (const entry of directoryListing) { - this.copySync(this.pathUtils.join(destination, entry), baseFs.pathUtils.join(source, entry), { baseFs, overwrite }); - } - } else if (stat.isFile()) { - if (!exists || overwrite) { - if (exists) - this.removeSync(destination); - const content = baseFs.readFileSync(source); - this.writeFileSync(destination, content); - } - } else if (stat.isSymbolicLink()) { - if (!exists || overwrite) { - if (exists) - this.removeSync(destination); - const target = baseFs.readlinkSync(source); - this.symlinkSync(convertPath(this.pathUtils, target), destination); - } - } else { - throw new Error(`Unsupported file type (file: ${source}, mode: 0o${stat.mode.toString(8).padStart(6, `0`)})`); - } - const mode = stat.mode & 511; - this.chmodSync(destination, mode); - } - async changeFilePromise(p, content, opts = {}) { - if (Buffer.isBuffer(content)) { - return this.changeFileBufferPromise(p, content, opts); - } else { - return this.changeFileTextPromise(p, content, opts); - } - } - async changeFileBufferPromise(p, content, { mode } = {}) { - let current = Buffer.alloc(0); - try { - current = await this.readFilePromise(p); - } catch (error) { - } - if (Buffer.compare(current, content) === 0) - return; - await this.writeFilePromise(p, content, { mode }); - } - async changeFileTextPromise(p, content, { automaticNewlines, mode } = {}) { - let current = ``; - try { - current = await this.readFilePromise(p, `utf8`); - } catch (error) { - } - const normalizedContent = automaticNewlines ? normalizeLineEndings(current, content) : content; - if (current === normalizedContent) - return; - await this.writeFilePromise(p, normalizedContent, { mode }); - } - changeFileSync(p, content, opts = {}) { - if (Buffer.isBuffer(content)) { - return this.changeFileBufferSync(p, content, opts); - } else { - return this.changeFileTextSync(p, content, opts); - } - } - changeFileBufferSync(p, content, { mode } = {}) { - let current = Buffer.alloc(0); - try { - current = this.readFileSync(p); - } catch (error) { - } - if (Buffer.compare(current, content) === 0) - return; - this.writeFileSync(p, content, { mode }); - } - changeFileTextSync(p, content, { automaticNewlines = false, mode } = {}) { - let current = ``; - try { - current = this.readFileSync(p, `utf8`); - } catch (error) { - } - const normalizedContent = automaticNewlines ? normalizeLineEndings(current, content) : content; - if (current === normalizedContent) - return; - this.writeFileSync(p, normalizedContent, { mode }); - } - async movePromise(fromP, toP) { - try { - await this.renamePromise(fromP, toP); - } catch (error) { - if (error.code === `EXDEV`) { - await this.copyPromise(toP, fromP); - await this.removePromise(fromP); - } else { - throw error; - } - } - } - moveSync(fromP, toP) { - try { - this.renameSync(fromP, toP); - } catch (error) { - if (error.code === `EXDEV`) { - this.copySync(toP, fromP); - this.removeSync(fromP); - } else { - throw error; - } - } - } - async lockPromise(affectedPath, callback) { - const lockPath = `${affectedPath}.flock`; - const interval = 1e3 / 60; - const startTime = Date.now(); - let fd = null; - const isAlive = async () => { - let pid; - try { - [pid] = await this.readJsonPromise(lockPath); - } catch (error) { - return Date.now() - startTime < 500; - } - try { - process.kill(pid, 0); - return true; - } catch (error) { - return false; - } - }; - while (fd === null) { - try { - fd = await this.openPromise(lockPath, `wx`); - } catch (error) { - if (error.code === `EEXIST`) { - if (!await isAlive()) { - try { - await this.unlinkPromise(lockPath); - continue; - } catch (error2) { - } - } - if (Date.now() - startTime < 60 * 1e3) { - await new Promise((resolve) => setTimeout(resolve, interval)); - } else { - throw new Error(`Couldn't acquire a lock in a reasonable time (via ${lockPath})`); - } - } else { - throw error; - } - } - } - await this.writePromise(fd, JSON.stringify([process.pid])); - try { - return await callback(); - } finally { - try { - await this.closePromise(fd); - await this.unlinkPromise(lockPath); - } catch (error) { - } - } - } - async readJsonPromise(p) { - const content = await this.readFilePromise(p, `utf8`); - try { - return JSON.parse(content); - } catch (error) { - error.message += ` (in ${p})`; - throw error; - } - } - readJsonSync(p) { - const content = this.readFileSync(p, `utf8`); - try { - return JSON.parse(content); - } catch (error) { - error.message += ` (in ${p})`; - throw error; - } - } - async writeJsonPromise(p, data, { compact = false } = {}) { - const space = compact ? 0 : 2; - return await this.writeFilePromise(p, `${JSON.stringify(data, null, space)} -`); - } - writeJsonSync(p, data, { compact = false } = {}) { - const space = compact ? 0 : 2; - return this.writeFileSync(p, `${JSON.stringify(data, null, space)} -`); - } - async preserveTimePromise(p, cb) { - const stat = await this.lstatPromise(p); - const result = await cb(); - if (typeof result !== `undefined`) - p = result; - await this.lutimesPromise(p, stat.atime, stat.mtime); - } - async preserveTimeSync(p, cb) { - const stat = this.lstatSync(p); - const result = cb(); - if (typeof result !== `undefined`) - p = result; - this.lutimesSync(p, stat.atime, stat.mtime); - } -} -class BasePortableFakeFS extends FakeFS { - constructor() { - super(ppath); - } -} -function getEndOfLine(content) { - const matches = content.match(/\r?\n/g); - if (matches === null) - return os.EOL; - const crlf = matches.filter((nl) => nl === `\r -`).length; - const lf = matches.length - crlf; - return crlf > lf ? `\r -` : ` -`; -} -function normalizeLineEndings(originalContent, newContent) { - return newContent.replace(/\r?\n/g, getEndOfLine(originalContent)); -} - -class ProxiedFS extends FakeFS { - getExtractHint(hints) { - return this.baseFs.getExtractHint(hints); - } - resolve(path) { - return this.mapFromBase(this.baseFs.resolve(this.mapToBase(path))); - } - getRealPath() { - return this.mapFromBase(this.baseFs.getRealPath()); - } - async openPromise(p, flags, mode) { - return this.baseFs.openPromise(this.mapToBase(p), flags, mode); - } - openSync(p, flags, mode) { - return this.baseFs.openSync(this.mapToBase(p), flags, mode); - } - async opendirPromise(p, opts) { - return Object.assign(await this.baseFs.opendirPromise(this.mapToBase(p), opts), { path: p }); - } - opendirSync(p, opts) { - return Object.assign(this.baseFs.opendirSync(this.mapToBase(p), opts), { path: p }); - } - async readPromise(fd, buffer, offset, length, position) { - return await this.baseFs.readPromise(fd, buffer, offset, length, position); - } - readSync(fd, buffer, offset, length, position) { - return this.baseFs.readSync(fd, buffer, offset, length, position); - } - async writePromise(fd, buffer, offset, length, position) { - if (typeof buffer === `string`) { - return await this.baseFs.writePromise(fd, buffer, offset); - } else { - return await this.baseFs.writePromise(fd, buffer, offset, length, position); - } - } - writeSync(fd, buffer, offset, length, position) { - if (typeof buffer === `string`) { - return this.baseFs.writeSync(fd, buffer, offset); - } else { - return this.baseFs.writeSync(fd, buffer, offset, length, position); - } - } - async closePromise(fd) { - return this.baseFs.closePromise(fd); - } - closeSync(fd) { - this.baseFs.closeSync(fd); - } - createReadStream(p, opts) { - return this.baseFs.createReadStream(p !== null ? this.mapToBase(p) : p, opts); - } - createWriteStream(p, opts) { - return this.baseFs.createWriteStream(p !== null ? this.mapToBase(p) : p, opts); - } - async realpathPromise(p) { - return this.mapFromBase(await this.baseFs.realpathPromise(this.mapToBase(p))); - } - realpathSync(p) { - return this.mapFromBase(this.baseFs.realpathSync(this.mapToBase(p))); - } - async existsPromise(p) { - return this.baseFs.existsPromise(this.mapToBase(p)); - } - existsSync(p) { - return this.baseFs.existsSync(this.mapToBase(p)); - } - accessSync(p, mode) { - return this.baseFs.accessSync(this.mapToBase(p), mode); - } - async accessPromise(p, mode) { - return this.baseFs.accessPromise(this.mapToBase(p), mode); - } - async statPromise(p, opts) { - return this.baseFs.statPromise(this.mapToBase(p), opts); - } - statSync(p, opts) { - return this.baseFs.statSync(this.mapToBase(p), opts); - } - async fstatPromise(fd, opts) { - return this.baseFs.fstatPromise(fd, opts); - } - fstatSync(fd, opts) { - return this.baseFs.fstatSync(fd, opts); - } - lstatPromise(p, opts) { - return this.baseFs.lstatPromise(this.mapToBase(p), opts); - } - lstatSync(p, opts) { - return this.baseFs.lstatSync(this.mapToBase(p), opts); - } - async fchmodPromise(fd, mask) { - return this.baseFs.fchmodPromise(fd, mask); - } - fchmodSync(fd, mask) { - return this.baseFs.fchmodSync(fd, mask); - } - async chmodPromise(p, mask) { - return this.baseFs.chmodPromise(this.mapToBase(p), mask); - } - chmodSync(p, mask) { - return this.baseFs.chmodSync(this.mapToBase(p), mask); - } - async fchownPromise(fd, uid, gid) { - return this.baseFs.fchownPromise(fd, uid, gid); - } - fchownSync(fd, uid, gid) { - return this.baseFs.fchownSync(fd, uid, gid); - } - async chownPromise(p, uid, gid) { - return this.baseFs.chownPromise(this.mapToBase(p), uid, gid); - } - chownSync(p, uid, gid) { - return this.baseFs.chownSync(this.mapToBase(p), uid, gid); - } - async renamePromise(oldP, newP) { - return this.baseFs.renamePromise(this.mapToBase(oldP), this.mapToBase(newP)); - } - renameSync(oldP, newP) { - return this.baseFs.renameSync(this.mapToBase(oldP), this.mapToBase(newP)); - } - async copyFilePromise(sourceP, destP, flags = 0) { - return this.baseFs.copyFilePromise(this.mapToBase(sourceP), this.mapToBase(destP), flags); - } - copyFileSync(sourceP, destP, flags = 0) { - return this.baseFs.copyFileSync(this.mapToBase(sourceP), this.mapToBase(destP), flags); - } - async appendFilePromise(p, content, opts) { - return this.baseFs.appendFilePromise(this.fsMapToBase(p), content, opts); - } - appendFileSync(p, content, opts) { - return this.baseFs.appendFileSync(this.fsMapToBase(p), content, opts); - } - async writeFilePromise(p, content, opts) { - return this.baseFs.writeFilePromise(this.fsMapToBase(p), content, opts); - } - writeFileSync(p, content, opts) { - return this.baseFs.writeFileSync(this.fsMapToBase(p), content, opts); - } - async unlinkPromise(p) { - return this.baseFs.unlinkPromise(this.mapToBase(p)); - } - unlinkSync(p) { - return this.baseFs.unlinkSync(this.mapToBase(p)); - } - async utimesPromise(p, atime, mtime) { - return this.baseFs.utimesPromise(this.mapToBase(p), atime, mtime); - } - utimesSync(p, atime, mtime) { - return this.baseFs.utimesSync(this.mapToBase(p), atime, mtime); - } - async lutimesPromise(p, atime, mtime) { - return this.baseFs.lutimesPromise(this.mapToBase(p), atime, mtime); - } - lutimesSync(p, atime, mtime) { - return this.baseFs.lutimesSync(this.mapToBase(p), atime, mtime); - } - async mkdirPromise(p, opts) { - return this.baseFs.mkdirPromise(this.mapToBase(p), opts); - } - mkdirSync(p, opts) { - return this.baseFs.mkdirSync(this.mapToBase(p), opts); - } - async rmdirPromise(p, opts) { - return this.baseFs.rmdirPromise(this.mapToBase(p), opts); - } - rmdirSync(p, opts) { - return this.baseFs.rmdirSync(this.mapToBase(p), opts); - } - async rmPromise(p, opts) { - return this.baseFs.rmPromise(this.mapToBase(p), opts); - } - rmSync(p, opts) { - return this.baseFs.rmSync(this.mapToBase(p), opts); - } - async linkPromise(existingP, newP) { - return this.baseFs.linkPromise(this.mapToBase(existingP), this.mapToBase(newP)); - } - linkSync(existingP, newP) { - return this.baseFs.linkSync(this.mapToBase(existingP), this.mapToBase(newP)); - } - async symlinkPromise(target, p, type) { - const mappedP = this.mapToBase(p); - if (this.pathUtils.isAbsolute(target)) - return this.baseFs.symlinkPromise(this.mapToBase(target), mappedP, type); - const mappedAbsoluteTarget = this.mapToBase(this.pathUtils.join(this.pathUtils.dirname(p), target)); - const mappedTarget = this.baseFs.pathUtils.relative(this.baseFs.pathUtils.dirname(mappedP), mappedAbsoluteTarget); - return this.baseFs.symlinkPromise(mappedTarget, mappedP, type); - } - symlinkSync(target, p, type) { - const mappedP = this.mapToBase(p); - if (this.pathUtils.isAbsolute(target)) - return this.baseFs.symlinkSync(this.mapToBase(target), mappedP, type); - const mappedAbsoluteTarget = this.mapToBase(this.pathUtils.join(this.pathUtils.dirname(p), target)); - const mappedTarget = this.baseFs.pathUtils.relative(this.baseFs.pathUtils.dirname(mappedP), mappedAbsoluteTarget); - return this.baseFs.symlinkSync(mappedTarget, mappedP, type); - } - async readFilePromise(p, encoding) { - return this.baseFs.readFilePromise(this.fsMapToBase(p), encoding); - } - readFileSync(p, encoding) { - return this.baseFs.readFileSync(this.fsMapToBase(p), encoding); - } - readdirPromise(p, opts) { - return this.baseFs.readdirPromise(this.mapToBase(p), opts); - } - readdirSync(p, opts) { - return this.baseFs.readdirSync(this.mapToBase(p), opts); - } - async readlinkPromise(p) { - return this.mapFromBase(await this.baseFs.readlinkPromise(this.mapToBase(p))); - } - readlinkSync(p) { - return this.mapFromBase(this.baseFs.readlinkSync(this.mapToBase(p))); - } - async truncatePromise(p, len) { - return this.baseFs.truncatePromise(this.mapToBase(p), len); - } - truncateSync(p, len) { - return this.baseFs.truncateSync(this.mapToBase(p), len); - } - async ftruncatePromise(fd, len) { - return this.baseFs.ftruncatePromise(fd, len); - } - ftruncateSync(fd, len) { - return this.baseFs.ftruncateSync(fd, len); - } - watch(p, a, b) { - return this.baseFs.watch( - this.mapToBase(p), - a, - b - ); - } - watchFile(p, a, b) { - return this.baseFs.watchFile( - this.mapToBase(p), - a, - b - ); - } - unwatchFile(p, cb) { - return this.baseFs.unwatchFile(this.mapToBase(p), cb); - } - fsMapToBase(p) { - if (typeof p === `number`) { - return p; - } else { - return this.mapToBase(p); - } - } -} - -function direntToPortable(dirent) { - const portableDirent = dirent; - if (typeof dirent.path === `string`) - portableDirent.path = npath.toPortablePath(dirent.path); - return portableDirent; -} -class NodeFS extends BasePortableFakeFS { - constructor(realFs = fs__default.default) { - super(); - this.realFs = realFs; - } - getExtractHint() { - return false; - } - getRealPath() { - return PortablePath.root; - } - resolve(p) { - return ppath.resolve(p); - } - async openPromise(p, flags, mode) { - return await new Promise((resolve, reject) => { - this.realFs.open(npath.fromPortablePath(p), flags, mode, this.makeCallback(resolve, reject)); - }); - } - openSync(p, flags, mode) { - return this.realFs.openSync(npath.fromPortablePath(p), flags, mode); - } - async opendirPromise(p, opts) { - return await new Promise((resolve, reject) => { - if (typeof opts !== `undefined`) { - this.realFs.opendir(npath.fromPortablePath(p), opts, this.makeCallback(resolve, reject)); - } else { - this.realFs.opendir(npath.fromPortablePath(p), this.makeCallback(resolve, reject)); - } - }).then((dir) => { - const dirWithFixedPath = dir; - Object.defineProperty(dirWithFixedPath, `path`, { - value: p, - configurable: true, - writable: true - }); - return dirWithFixedPath; - }); - } - opendirSync(p, opts) { - const dir = typeof opts !== `undefined` ? this.realFs.opendirSync(npath.fromPortablePath(p), opts) : this.realFs.opendirSync(npath.fromPortablePath(p)); - const dirWithFixedPath = dir; - Object.defineProperty(dirWithFixedPath, `path`, { - value: p, - configurable: true, - writable: true - }); - return dirWithFixedPath; - } - async readPromise(fd, buffer, offset = 0, length = 0, position = -1) { - return await new Promise((resolve, reject) => { - this.realFs.read(fd, buffer, offset, length, position, (error, bytesRead) => { - if (error) { - reject(error); - } else { - resolve(bytesRead); - } - }); - }); - } - readSync(fd, buffer, offset, length, position) { - return this.realFs.readSync(fd, buffer, offset, length, position); - } - async writePromise(fd, buffer, offset, length, position) { - return await new Promise((resolve, reject) => { - if (typeof buffer === `string`) { - return this.realFs.write(fd, buffer, offset, this.makeCallback(resolve, reject)); - } else { - return this.realFs.write(fd, buffer, offset, length, position, this.makeCallback(resolve, reject)); - } - }); - } - writeSync(fd, buffer, offset, length, position) { - if (typeof buffer === `string`) { - return this.realFs.writeSync(fd, buffer, offset); - } else { - return this.realFs.writeSync(fd, buffer, offset, length, position); - } - } - async closePromise(fd) { - await new Promise((resolve, reject) => { - this.realFs.close(fd, this.makeCallback(resolve, reject)); - }); - } - closeSync(fd) { - this.realFs.closeSync(fd); - } - createReadStream(p, opts) { - const realPath = p !== null ? npath.fromPortablePath(p) : p; - return this.realFs.createReadStream(realPath, opts); - } - createWriteStream(p, opts) { - const realPath = p !== null ? npath.fromPortablePath(p) : p; - return this.realFs.createWriteStream(realPath, opts); - } - async realpathPromise(p) { - return await new Promise((resolve, reject) => { - this.realFs.realpath(npath.fromPortablePath(p), {}, this.makeCallback(resolve, reject)); - }).then((path) => { - return npath.toPortablePath(path); - }); - } - realpathSync(p) { - return npath.toPortablePath(this.realFs.realpathSync(npath.fromPortablePath(p), {})); - } - async existsPromise(p) { - return await new Promise((resolve) => { - this.realFs.exists(npath.fromPortablePath(p), resolve); - }); - } - accessSync(p, mode) { - return this.realFs.accessSync(npath.fromPortablePath(p), mode); - } - async accessPromise(p, mode) { - return await new Promise((resolve, reject) => { - this.realFs.access(npath.fromPortablePath(p), mode, this.makeCallback(resolve, reject)); - }); - } - existsSync(p) { - return this.realFs.existsSync(npath.fromPortablePath(p)); - } - async statPromise(p, opts) { - return await new Promise((resolve, reject) => { - if (opts) { - this.realFs.stat(npath.fromPortablePath(p), opts, this.makeCallback(resolve, reject)); - } else { - this.realFs.stat(npath.fromPortablePath(p), this.makeCallback(resolve, reject)); - } - }); - } - statSync(p, opts) { - if (opts) { - return this.realFs.statSync(npath.fromPortablePath(p), opts); - } else { - return this.realFs.statSync(npath.fromPortablePath(p)); - } - } - async fstatPromise(fd, opts) { - return await new Promise((resolve, reject) => { - if (opts) { - this.realFs.fstat(fd, opts, this.makeCallback(resolve, reject)); - } else { - this.realFs.fstat(fd, this.makeCallback(resolve, reject)); - } - }); - } - fstatSync(fd, opts) { - if (opts) { - return this.realFs.fstatSync(fd, opts); - } else { - return this.realFs.fstatSync(fd); - } - } - async lstatPromise(p, opts) { - return await new Promise((resolve, reject) => { - if (opts) { - this.realFs.lstat(npath.fromPortablePath(p), opts, this.makeCallback(resolve, reject)); - } else { - this.realFs.lstat(npath.fromPortablePath(p), this.makeCallback(resolve, reject)); - } - }); - } - lstatSync(p, opts) { - if (opts) { - return this.realFs.lstatSync(npath.fromPortablePath(p), opts); - } else { - return this.realFs.lstatSync(npath.fromPortablePath(p)); - } - } - async fchmodPromise(fd, mask) { - return await new Promise((resolve, reject) => { - this.realFs.fchmod(fd, mask, this.makeCallback(resolve, reject)); - }); - } - fchmodSync(fd, mask) { - return this.realFs.fchmodSync(fd, mask); - } - async chmodPromise(p, mask) { - return await new Promise((resolve, reject) => { - this.realFs.chmod(npath.fromPortablePath(p), mask, this.makeCallback(resolve, reject)); - }); - } - chmodSync(p, mask) { - return this.realFs.chmodSync(npath.fromPortablePath(p), mask); - } - async fchownPromise(fd, uid, gid) { - return await new Promise((resolve, reject) => { - this.realFs.fchown(fd, uid, gid, this.makeCallback(resolve, reject)); - }); - } - fchownSync(fd, uid, gid) { - return this.realFs.fchownSync(fd, uid, gid); - } - async chownPromise(p, uid, gid) { - return await new Promise((resolve, reject) => { - this.realFs.chown(npath.fromPortablePath(p), uid, gid, this.makeCallback(resolve, reject)); - }); - } - chownSync(p, uid, gid) { - return this.realFs.chownSync(npath.fromPortablePath(p), uid, gid); - } - async renamePromise(oldP, newP) { - return await new Promise((resolve, reject) => { - this.realFs.rename(npath.fromPortablePath(oldP), npath.fromPortablePath(newP), this.makeCallback(resolve, reject)); - }); - } - renameSync(oldP, newP) { - return this.realFs.renameSync(npath.fromPortablePath(oldP), npath.fromPortablePath(newP)); - } - async copyFilePromise(sourceP, destP, flags = 0) { - return await new Promise((resolve, reject) => { - this.realFs.copyFile(npath.fromPortablePath(sourceP), npath.fromPortablePath(destP), flags, this.makeCallback(resolve, reject)); - }); - } - copyFileSync(sourceP, destP, flags = 0) { - return this.realFs.copyFileSync(npath.fromPortablePath(sourceP), npath.fromPortablePath(destP), flags); - } - async appendFilePromise(p, content, opts) { - return await new Promise((resolve, reject) => { - const fsNativePath = typeof p === `string` ? npath.fromPortablePath(p) : p; - if (opts) { - this.realFs.appendFile(fsNativePath, content, opts, this.makeCallback(resolve, reject)); - } else { - this.realFs.appendFile(fsNativePath, content, this.makeCallback(resolve, reject)); - } - }); - } - appendFileSync(p, content, opts) { - const fsNativePath = typeof p === `string` ? npath.fromPortablePath(p) : p; - if (opts) { - this.realFs.appendFileSync(fsNativePath, content, opts); - } else { - this.realFs.appendFileSync(fsNativePath, content); - } - } - async writeFilePromise(p, content, opts) { - return await new Promise((resolve, reject) => { - const fsNativePath = typeof p === `string` ? npath.fromPortablePath(p) : p; - if (opts) { - this.realFs.writeFile(fsNativePath, content, opts, this.makeCallback(resolve, reject)); - } else { - this.realFs.writeFile(fsNativePath, content, this.makeCallback(resolve, reject)); - } - }); - } - writeFileSync(p, content, opts) { - const fsNativePath = typeof p === `string` ? npath.fromPortablePath(p) : p; - if (opts) { - this.realFs.writeFileSync(fsNativePath, content, opts); - } else { - this.realFs.writeFileSync(fsNativePath, content); - } - } - async unlinkPromise(p) { - return await new Promise((resolve, reject) => { - this.realFs.unlink(npath.fromPortablePath(p), this.makeCallback(resolve, reject)); - }); - } - unlinkSync(p) { - return this.realFs.unlinkSync(npath.fromPortablePath(p)); - } - async utimesPromise(p, atime, mtime) { - return await new Promise((resolve, reject) => { - this.realFs.utimes(npath.fromPortablePath(p), atime, mtime, this.makeCallback(resolve, reject)); - }); - } - utimesSync(p, atime, mtime) { - this.realFs.utimesSync(npath.fromPortablePath(p), atime, mtime); - } - async lutimesPromise(p, atime, mtime) { - return await new Promise((resolve, reject) => { - this.realFs.lutimes(npath.fromPortablePath(p), atime, mtime, this.makeCallback(resolve, reject)); - }); - } - lutimesSync(p, atime, mtime) { - this.realFs.lutimesSync(npath.fromPortablePath(p), atime, mtime); - } - async mkdirPromise(p, opts) { - return await new Promise((resolve, reject) => { - this.realFs.mkdir(npath.fromPortablePath(p), opts, this.makeCallback(resolve, reject)); - }); - } - mkdirSync(p, opts) { - return this.realFs.mkdirSync(npath.fromPortablePath(p), opts); - } - async rmdirPromise(p, opts) { - return await new Promise((resolve, reject) => { - if (opts) { - this.realFs.rmdir(npath.fromPortablePath(p), opts, this.makeCallback(resolve, reject)); - } else { - this.realFs.rmdir(npath.fromPortablePath(p), this.makeCallback(resolve, reject)); - } - }); - } - rmdirSync(p, opts) { - return this.realFs.rmdirSync(npath.fromPortablePath(p), opts); - } - async rmPromise(p, opts) { - return await new Promise((resolve, reject) => { - if (opts) { - this.realFs.rm(npath.fromPortablePath(p), opts, this.makeCallback(resolve, reject)); - } else { - this.realFs.rm(npath.fromPortablePath(p), this.makeCallback(resolve, reject)); - } - }); - } - rmSync(p, opts) { - return this.realFs.rmSync(npath.fromPortablePath(p), opts); - } - async linkPromise(existingP, newP) { - return await new Promise((resolve, reject) => { - this.realFs.link(npath.fromPortablePath(existingP), npath.fromPortablePath(newP), this.makeCallback(resolve, reject)); - }); - } - linkSync(existingP, newP) { - return this.realFs.linkSync(npath.fromPortablePath(existingP), npath.fromPortablePath(newP)); - } - async symlinkPromise(target, p, type) { - return await new Promise((resolve, reject) => { - this.realFs.symlink(npath.fromPortablePath(target.replace(/\/+$/, ``)), npath.fromPortablePath(p), type, this.makeCallback(resolve, reject)); - }); - } - symlinkSync(target, p, type) { - return this.realFs.symlinkSync(npath.fromPortablePath(target.replace(/\/+$/, ``)), npath.fromPortablePath(p), type); - } - async readFilePromise(p, encoding) { - return await new Promise((resolve, reject) => { - const fsNativePath = typeof p === `string` ? npath.fromPortablePath(p) : p; - this.realFs.readFile(fsNativePath, encoding, this.makeCallback(resolve, reject)); - }); - } - readFileSync(p, encoding) { - const fsNativePath = typeof p === `string` ? npath.fromPortablePath(p) : p; - return this.realFs.readFileSync(fsNativePath, encoding); - } - async readdirPromise(p, opts) { - return await new Promise((resolve, reject) => { - if (opts) { - if (opts.recursive && process.platform === `win32`) { - if (opts.withFileTypes) { - this.realFs.readdir(npath.fromPortablePath(p), opts, this.makeCallback((results) => resolve(results.map(direntToPortable)), reject)); - } else { - this.realFs.readdir(npath.fromPortablePath(p), opts, this.makeCallback((results) => resolve(results.map(npath.toPortablePath)), reject)); - } - } else { - this.realFs.readdir(npath.fromPortablePath(p), opts, this.makeCallback(resolve, reject)); - } - } else { - this.realFs.readdir(npath.fromPortablePath(p), this.makeCallback(resolve, reject)); - } - }); - } - readdirSync(p, opts) { - if (opts) { - if (opts.recursive && process.platform === `win32`) { - if (opts.withFileTypes) { - return this.realFs.readdirSync(npath.fromPortablePath(p), opts).map(direntToPortable); - } else { - return this.realFs.readdirSync(npath.fromPortablePath(p), opts).map(npath.toPortablePath); - } - } else { - return this.realFs.readdirSync(npath.fromPortablePath(p), opts); - } - } else { - return this.realFs.readdirSync(npath.fromPortablePath(p)); - } - } - async readlinkPromise(p) { - return await new Promise((resolve, reject) => { - this.realFs.readlink(npath.fromPortablePath(p), this.makeCallback(resolve, reject)); - }).then((path) => { - return npath.toPortablePath(path); - }); - } - readlinkSync(p) { - return npath.toPortablePath(this.realFs.readlinkSync(npath.fromPortablePath(p))); - } - async truncatePromise(p, len) { - return await new Promise((resolve, reject) => { - this.realFs.truncate(npath.fromPortablePath(p), len, this.makeCallback(resolve, reject)); - }); - } - truncateSync(p, len) { - return this.realFs.truncateSync(npath.fromPortablePath(p), len); - } - async ftruncatePromise(fd, len) { - return await new Promise((resolve, reject) => { - this.realFs.ftruncate(fd, len, this.makeCallback(resolve, reject)); - }); - } - ftruncateSync(fd, len) { - return this.realFs.ftruncateSync(fd, len); - } - watch(p, a, b) { - return this.realFs.watch( - npath.fromPortablePath(p), - a, - b - ); - } - watchFile(p, a, b) { - return this.realFs.watchFile( - npath.fromPortablePath(p), - a, - b - ); - } - unwatchFile(p, cb) { - return this.realFs.unwatchFile(npath.fromPortablePath(p), cb); - } - makeCallback(resolve, reject) { - return (err, result) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }; - } -} - -const MOUNT_MASK = 4278190080; -class MountFS extends BasePortableFakeFS { - constructor({ baseFs = new NodeFS(), filter = null, magicByte = 42, maxOpenFiles = Infinity, useCache = true, maxAge = 5e3, typeCheck = fs.constants.S_IFREG, getMountPoint, factoryPromise, factorySync }) { - if (Math.floor(magicByte) !== magicByte || !(magicByte > 1 && magicByte <= 127)) - throw new Error(`The magic byte must be set to a round value between 1 and 127 included`); - super(); - this.fdMap = /* @__PURE__ */ new Map(); - this.nextFd = 3; - this.isMount = /* @__PURE__ */ new Set(); - this.notMount = /* @__PURE__ */ new Set(); - this.realPaths = /* @__PURE__ */ new Map(); - this.limitOpenFilesTimeout = null; - this.baseFs = baseFs; - this.mountInstances = useCache ? /* @__PURE__ */ new Map() : null; - this.factoryPromise = factoryPromise; - this.factorySync = factorySync; - this.filter = filter; - this.getMountPoint = getMountPoint; - this.magic = magicByte << 24; - this.maxAge = maxAge; - this.maxOpenFiles = maxOpenFiles; - this.typeCheck = typeCheck; - } - getExtractHint(hints) { - return this.baseFs.getExtractHint(hints); - } - getRealPath() { - return this.baseFs.getRealPath(); - } - saveAndClose() { - unwatchAllFiles(this); - if (this.mountInstances) { - for (const [path, { childFs }] of this.mountInstances.entries()) { - childFs.saveAndClose?.(); - this.mountInstances.delete(path); - } - } - } - discardAndClose() { - unwatchAllFiles(this); - if (this.mountInstances) { - for (const [path, { childFs }] of this.mountInstances.entries()) { - childFs.discardAndClose?.(); - this.mountInstances.delete(path); - } - } - } - resolve(p) { - return this.baseFs.resolve(p); - } - remapFd(mountFs, fd) { - const remappedFd = this.nextFd++ | this.magic; - this.fdMap.set(remappedFd, [mountFs, fd]); - return remappedFd; - } - async openPromise(p, flags, mode) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.openPromise(p, flags, mode); - }, async (mountFs, { subPath }) => { - return this.remapFd(mountFs, await mountFs.openPromise(subPath, flags, mode)); - }); - } - openSync(p, flags, mode) { - return this.makeCallSync(p, () => { - return this.baseFs.openSync(p, flags, mode); - }, (mountFs, { subPath }) => { - return this.remapFd(mountFs, mountFs.openSync(subPath, flags, mode)); - }); - } - async opendirPromise(p, opts) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.opendirPromise(p, opts); - }, async (mountFs, { subPath }) => { - return await mountFs.opendirPromise(subPath, opts); - }, { - requireSubpath: false - }); - } - opendirSync(p, opts) { - return this.makeCallSync(p, () => { - return this.baseFs.opendirSync(p, opts); - }, (mountFs, { subPath }) => { - return mountFs.opendirSync(subPath, opts); - }, { - requireSubpath: false - }); - } - async readPromise(fd, buffer, offset, length, position) { - if ((fd & MOUNT_MASK) !== this.magic) - return await this.baseFs.readPromise(fd, buffer, offset, length, position); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`read`); - const [mountFs, realFd] = entry; - return await mountFs.readPromise(realFd, buffer, offset, length, position); - } - readSync(fd, buffer, offset, length, position) { - if ((fd & MOUNT_MASK) !== this.magic) - return this.baseFs.readSync(fd, buffer, offset, length, position); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`readSync`); - const [mountFs, realFd] = entry; - return mountFs.readSync(realFd, buffer, offset, length, position); - } - async writePromise(fd, buffer, offset, length, position) { - if ((fd & MOUNT_MASK) !== this.magic) { - if (typeof buffer === `string`) { - return await this.baseFs.writePromise(fd, buffer, offset); - } else { - return await this.baseFs.writePromise(fd, buffer, offset, length, position); - } - } - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`write`); - const [mountFs, realFd] = entry; - if (typeof buffer === `string`) { - return await mountFs.writePromise(realFd, buffer, offset); - } else { - return await mountFs.writePromise(realFd, buffer, offset, length, position); - } - } - writeSync(fd, buffer, offset, length, position) { - if ((fd & MOUNT_MASK) !== this.magic) { - if (typeof buffer === `string`) { - return this.baseFs.writeSync(fd, buffer, offset); - } else { - return this.baseFs.writeSync(fd, buffer, offset, length, position); - } - } - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`writeSync`); - const [mountFs, realFd] = entry; - if (typeof buffer === `string`) { - return mountFs.writeSync(realFd, buffer, offset); - } else { - return mountFs.writeSync(realFd, buffer, offset, length, position); - } - } - async closePromise(fd) { - if ((fd & MOUNT_MASK) !== this.magic) - return await this.baseFs.closePromise(fd); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`close`); - this.fdMap.delete(fd); - const [mountFs, realFd] = entry; - return await mountFs.closePromise(realFd); - } - closeSync(fd) { - if ((fd & MOUNT_MASK) !== this.magic) - return this.baseFs.closeSync(fd); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`closeSync`); - this.fdMap.delete(fd); - const [mountFs, realFd] = entry; - return mountFs.closeSync(realFd); - } - createReadStream(p, opts) { - if (p === null) - return this.baseFs.createReadStream(p, opts); - return this.makeCallSync(p, () => { - return this.baseFs.createReadStream(p, opts); - }, (mountFs, { archivePath, subPath }) => { - const stream = mountFs.createReadStream(subPath, opts); - stream.path = npath.fromPortablePath(this.pathUtils.join(archivePath, subPath)); - return stream; - }); - } - createWriteStream(p, opts) { - if (p === null) - return this.baseFs.createWriteStream(p, opts); - return this.makeCallSync(p, () => { - return this.baseFs.createWriteStream(p, opts); - }, (mountFs, { subPath }) => { - return mountFs.createWriteStream(subPath, opts); - }); - } - async realpathPromise(p) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.realpathPromise(p); - }, async (mountFs, { archivePath, subPath }) => { - let realArchivePath = this.realPaths.get(archivePath); - if (typeof realArchivePath === `undefined`) { - realArchivePath = await this.baseFs.realpathPromise(archivePath); - this.realPaths.set(archivePath, realArchivePath); - } - return this.pathUtils.join(realArchivePath, this.pathUtils.relative(PortablePath.root, await mountFs.realpathPromise(subPath))); - }); - } - realpathSync(p) { - return this.makeCallSync(p, () => { - return this.baseFs.realpathSync(p); - }, (mountFs, { archivePath, subPath }) => { - let realArchivePath = this.realPaths.get(archivePath); - if (typeof realArchivePath === `undefined`) { - realArchivePath = this.baseFs.realpathSync(archivePath); - this.realPaths.set(archivePath, realArchivePath); - } - return this.pathUtils.join(realArchivePath, this.pathUtils.relative(PortablePath.root, mountFs.realpathSync(subPath))); - }); - } - async existsPromise(p) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.existsPromise(p); - }, async (mountFs, { subPath }) => { - return await mountFs.existsPromise(subPath); - }); - } - existsSync(p) { - return this.makeCallSync(p, () => { - return this.baseFs.existsSync(p); - }, (mountFs, { subPath }) => { - return mountFs.existsSync(subPath); - }); - } - async accessPromise(p, mode) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.accessPromise(p, mode); - }, async (mountFs, { subPath }) => { - return await mountFs.accessPromise(subPath, mode); - }); - } - accessSync(p, mode) { - return this.makeCallSync(p, () => { - return this.baseFs.accessSync(p, mode); - }, (mountFs, { subPath }) => { - return mountFs.accessSync(subPath, mode); - }); - } - async statPromise(p, opts) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.statPromise(p, opts); - }, async (mountFs, { subPath }) => { - return await mountFs.statPromise(subPath, opts); - }); - } - statSync(p, opts) { - return this.makeCallSync(p, () => { - return this.baseFs.statSync(p, opts); - }, (mountFs, { subPath }) => { - return mountFs.statSync(subPath, opts); - }); - } - async fstatPromise(fd, opts) { - if ((fd & MOUNT_MASK) !== this.magic) - return this.baseFs.fstatPromise(fd, opts); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`fstat`); - const [mountFs, realFd] = entry; - return mountFs.fstatPromise(realFd, opts); - } - fstatSync(fd, opts) { - if ((fd & MOUNT_MASK) !== this.magic) - return this.baseFs.fstatSync(fd, opts); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`fstatSync`); - const [mountFs, realFd] = entry; - return mountFs.fstatSync(realFd, opts); - } - async lstatPromise(p, opts) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.lstatPromise(p, opts); - }, async (mountFs, { subPath }) => { - return await mountFs.lstatPromise(subPath, opts); - }); - } - lstatSync(p, opts) { - return this.makeCallSync(p, () => { - return this.baseFs.lstatSync(p, opts); - }, (mountFs, { subPath }) => { - return mountFs.lstatSync(subPath, opts); - }); - } - async fchmodPromise(fd, mask) { - if ((fd & MOUNT_MASK) !== this.magic) - return this.baseFs.fchmodPromise(fd, mask); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`fchmod`); - const [mountFs, realFd] = entry; - return mountFs.fchmodPromise(realFd, mask); - } - fchmodSync(fd, mask) { - if ((fd & MOUNT_MASK) !== this.magic) - return this.baseFs.fchmodSync(fd, mask); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`fchmodSync`); - const [mountFs, realFd] = entry; - return mountFs.fchmodSync(realFd, mask); - } - async chmodPromise(p, mask) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.chmodPromise(p, mask); - }, async (mountFs, { subPath }) => { - return await mountFs.chmodPromise(subPath, mask); - }); - } - chmodSync(p, mask) { - return this.makeCallSync(p, () => { - return this.baseFs.chmodSync(p, mask); - }, (mountFs, { subPath }) => { - return mountFs.chmodSync(subPath, mask); - }); - } - async fchownPromise(fd, uid, gid) { - if ((fd & MOUNT_MASK) !== this.magic) - return this.baseFs.fchownPromise(fd, uid, gid); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`fchown`); - const [zipFs, realFd] = entry; - return zipFs.fchownPromise(realFd, uid, gid); - } - fchownSync(fd, uid, gid) { - if ((fd & MOUNT_MASK) !== this.magic) - return this.baseFs.fchownSync(fd, uid, gid); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`fchownSync`); - const [zipFs, realFd] = entry; - return zipFs.fchownSync(realFd, uid, gid); - } - async chownPromise(p, uid, gid) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.chownPromise(p, uid, gid); - }, async (mountFs, { subPath }) => { - return await mountFs.chownPromise(subPath, uid, gid); - }); - } - chownSync(p, uid, gid) { - return this.makeCallSync(p, () => { - return this.baseFs.chownSync(p, uid, gid); - }, (mountFs, { subPath }) => { - return mountFs.chownSync(subPath, uid, gid); - }); - } - async renamePromise(oldP, newP) { - return await this.makeCallPromise(oldP, async () => { - return await this.makeCallPromise(newP, async () => { - return await this.baseFs.renamePromise(oldP, newP); - }, async () => { - throw Object.assign(new Error(`EEXDEV: cross-device link not permitted`), { code: `EEXDEV` }); - }); - }, async (mountFsO, { subPath: subPathO }) => { - return await this.makeCallPromise(newP, async () => { - throw Object.assign(new Error(`EEXDEV: cross-device link not permitted`), { code: `EEXDEV` }); - }, async (mountFsN, { subPath: subPathN }) => { - if (mountFsO !== mountFsN) { - throw Object.assign(new Error(`EEXDEV: cross-device link not permitted`), { code: `EEXDEV` }); - } else { - return await mountFsO.renamePromise(subPathO, subPathN); - } - }); - }); - } - renameSync(oldP, newP) { - return this.makeCallSync(oldP, () => { - return this.makeCallSync(newP, () => { - return this.baseFs.renameSync(oldP, newP); - }, () => { - throw Object.assign(new Error(`EEXDEV: cross-device link not permitted`), { code: `EEXDEV` }); - }); - }, (mountFsO, { subPath: subPathO }) => { - return this.makeCallSync(newP, () => { - throw Object.assign(new Error(`EEXDEV: cross-device link not permitted`), { code: `EEXDEV` }); - }, (mountFsN, { subPath: subPathN }) => { - if (mountFsO !== mountFsN) { - throw Object.assign(new Error(`EEXDEV: cross-device link not permitted`), { code: `EEXDEV` }); - } else { - return mountFsO.renameSync(subPathO, subPathN); - } - }); - }); - } - async copyFilePromise(sourceP, destP, flags = 0) { - const fallback = async (sourceFs, sourceP2, destFs, destP2) => { - if ((flags & fs.constants.COPYFILE_FICLONE_FORCE) !== 0) - throw Object.assign(new Error(`EXDEV: cross-device clone not permitted, copyfile '${sourceP2}' -> ${destP2}'`), { code: `EXDEV` }); - if (flags & fs.constants.COPYFILE_EXCL && await this.existsPromise(sourceP2)) - throw Object.assign(new Error(`EEXIST: file already exists, copyfile '${sourceP2}' -> '${destP2}'`), { code: `EEXIST` }); - let content; - try { - content = await sourceFs.readFilePromise(sourceP2); - } catch (error) { - throw Object.assign(new Error(`EINVAL: invalid argument, copyfile '${sourceP2}' -> '${destP2}'`), { code: `EINVAL` }); - } - await destFs.writeFilePromise(destP2, content); - }; - return await this.makeCallPromise(sourceP, async () => { - return await this.makeCallPromise(destP, async () => { - return await this.baseFs.copyFilePromise(sourceP, destP, flags); - }, async (mountFsD, { subPath: subPathD }) => { - return await fallback(this.baseFs, sourceP, mountFsD, subPathD); - }); - }, async (mountFsS, { subPath: subPathS }) => { - return await this.makeCallPromise(destP, async () => { - return await fallback(mountFsS, subPathS, this.baseFs, destP); - }, async (mountFsD, { subPath: subPathD }) => { - if (mountFsS !== mountFsD) { - return await fallback(mountFsS, subPathS, mountFsD, subPathD); - } else { - return await mountFsS.copyFilePromise(subPathS, subPathD, flags); - } - }); - }); - } - copyFileSync(sourceP, destP, flags = 0) { - const fallback = (sourceFs, sourceP2, destFs, destP2) => { - if ((flags & fs.constants.COPYFILE_FICLONE_FORCE) !== 0) - throw Object.assign(new Error(`EXDEV: cross-device clone not permitted, copyfile '${sourceP2}' -> ${destP2}'`), { code: `EXDEV` }); - if (flags & fs.constants.COPYFILE_EXCL && this.existsSync(sourceP2)) - throw Object.assign(new Error(`EEXIST: file already exists, copyfile '${sourceP2}' -> '${destP2}'`), { code: `EEXIST` }); - let content; - try { - content = sourceFs.readFileSync(sourceP2); - } catch (error) { - throw Object.assign(new Error(`EINVAL: invalid argument, copyfile '${sourceP2}' -> '${destP2}'`), { code: `EINVAL` }); - } - destFs.writeFileSync(destP2, content); - }; - return this.makeCallSync(sourceP, () => { - return this.makeCallSync(destP, () => { - return this.baseFs.copyFileSync(sourceP, destP, flags); - }, (mountFsD, { subPath: subPathD }) => { - return fallback(this.baseFs, sourceP, mountFsD, subPathD); - }); - }, (mountFsS, { subPath: subPathS }) => { - return this.makeCallSync(destP, () => { - return fallback(mountFsS, subPathS, this.baseFs, destP); - }, (mountFsD, { subPath: subPathD }) => { - if (mountFsS !== mountFsD) { - return fallback(mountFsS, subPathS, mountFsD, subPathD); - } else { - return mountFsS.copyFileSync(subPathS, subPathD, flags); - } - }); - }); - } - async appendFilePromise(p, content, opts) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.appendFilePromise(p, content, opts); - }, async (mountFs, { subPath }) => { - return await mountFs.appendFilePromise(subPath, content, opts); - }); - } - appendFileSync(p, content, opts) { - return this.makeCallSync(p, () => { - return this.baseFs.appendFileSync(p, content, opts); - }, (mountFs, { subPath }) => { - return mountFs.appendFileSync(subPath, content, opts); - }); - } - async writeFilePromise(p, content, opts) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.writeFilePromise(p, content, opts); - }, async (mountFs, { subPath }) => { - return await mountFs.writeFilePromise(subPath, content, opts); - }); - } - writeFileSync(p, content, opts) { - return this.makeCallSync(p, () => { - return this.baseFs.writeFileSync(p, content, opts); - }, (mountFs, { subPath }) => { - return mountFs.writeFileSync(subPath, content, opts); - }); - } - async unlinkPromise(p) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.unlinkPromise(p); - }, async (mountFs, { subPath }) => { - return await mountFs.unlinkPromise(subPath); - }); - } - unlinkSync(p) { - return this.makeCallSync(p, () => { - return this.baseFs.unlinkSync(p); - }, (mountFs, { subPath }) => { - return mountFs.unlinkSync(subPath); - }); - } - async utimesPromise(p, atime, mtime) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.utimesPromise(p, atime, mtime); - }, async (mountFs, { subPath }) => { - return await mountFs.utimesPromise(subPath, atime, mtime); - }); - } - utimesSync(p, atime, mtime) { - return this.makeCallSync(p, () => { - return this.baseFs.utimesSync(p, atime, mtime); - }, (mountFs, { subPath }) => { - return mountFs.utimesSync(subPath, atime, mtime); - }); - } - async lutimesPromise(p, atime, mtime) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.lutimesPromise(p, atime, mtime); - }, async (mountFs, { subPath }) => { - return await mountFs.lutimesPromise(subPath, atime, mtime); - }); - } - lutimesSync(p, atime, mtime) { - return this.makeCallSync(p, () => { - return this.baseFs.lutimesSync(p, atime, mtime); - }, (mountFs, { subPath }) => { - return mountFs.lutimesSync(subPath, atime, mtime); - }); - } - async mkdirPromise(p, opts) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.mkdirPromise(p, opts); - }, async (mountFs, { subPath }) => { - return await mountFs.mkdirPromise(subPath, opts); - }); - } - mkdirSync(p, opts) { - return this.makeCallSync(p, () => { - return this.baseFs.mkdirSync(p, opts); - }, (mountFs, { subPath }) => { - return mountFs.mkdirSync(subPath, opts); - }); - } - async rmdirPromise(p, opts) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.rmdirPromise(p, opts); - }, async (mountFs, { subPath }) => { - return await mountFs.rmdirPromise(subPath, opts); - }); - } - rmdirSync(p, opts) { - return this.makeCallSync(p, () => { - return this.baseFs.rmdirSync(p, opts); - }, (mountFs, { subPath }) => { - return mountFs.rmdirSync(subPath, opts); - }); - } - async rmPromise(p, opts) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.rmPromise(p, opts); - }, async (mountFs, { subPath }) => { - return await mountFs.rmPromise(subPath, opts); - }); - } - rmSync(p, opts) { - return this.makeCallSync(p, () => { - return this.baseFs.rmSync(p, opts); - }, (mountFs, { subPath }) => { - return mountFs.rmSync(subPath, opts); - }); - } - async linkPromise(existingP, newP) { - return await this.makeCallPromise(newP, async () => { - return await this.baseFs.linkPromise(existingP, newP); - }, async (mountFs, { subPath }) => { - return await mountFs.linkPromise(existingP, subPath); - }); - } - linkSync(existingP, newP) { - return this.makeCallSync(newP, () => { - return this.baseFs.linkSync(existingP, newP); - }, (mountFs, { subPath }) => { - return mountFs.linkSync(existingP, subPath); - }); - } - async symlinkPromise(target, p, type) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.symlinkPromise(target, p, type); - }, async (mountFs, { subPath }) => { - return await mountFs.symlinkPromise(target, subPath); - }); - } - symlinkSync(target, p, type) { - return this.makeCallSync(p, () => { - return this.baseFs.symlinkSync(target, p, type); - }, (mountFs, { subPath }) => { - return mountFs.symlinkSync(target, subPath); - }); - } - async readFilePromise(p, encoding) { - return this.makeCallPromise(p, async () => { - return await this.baseFs.readFilePromise(p, encoding); - }, async (mountFs, { subPath }) => { - return await mountFs.readFilePromise(subPath, encoding); - }); - } - readFileSync(p, encoding) { - return this.makeCallSync(p, () => { - return this.baseFs.readFileSync(p, encoding); - }, (mountFs, { subPath }) => { - return mountFs.readFileSync(subPath, encoding); - }); - } - async readdirPromise(p, opts) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.readdirPromise(p, opts); - }, async (mountFs, { subPath }) => { - return await mountFs.readdirPromise(subPath, opts); - }, { - requireSubpath: false - }); - } - readdirSync(p, opts) { - return this.makeCallSync(p, () => { - return this.baseFs.readdirSync(p, opts); - }, (mountFs, { subPath }) => { - return mountFs.readdirSync(subPath, opts); - }, { - requireSubpath: false - }); - } - async readlinkPromise(p) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.readlinkPromise(p); - }, async (mountFs, { subPath }) => { - return await mountFs.readlinkPromise(subPath); - }); - } - readlinkSync(p) { - return this.makeCallSync(p, () => { - return this.baseFs.readlinkSync(p); - }, (mountFs, { subPath }) => { - return mountFs.readlinkSync(subPath); - }); - } - async truncatePromise(p, len) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.truncatePromise(p, len); - }, async (mountFs, { subPath }) => { - return await mountFs.truncatePromise(subPath, len); - }); - } - truncateSync(p, len) { - return this.makeCallSync(p, () => { - return this.baseFs.truncateSync(p, len); - }, (mountFs, { subPath }) => { - return mountFs.truncateSync(subPath, len); - }); - } - async ftruncatePromise(fd, len) { - if ((fd & MOUNT_MASK) !== this.magic) - return this.baseFs.ftruncatePromise(fd, len); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`ftruncate`); - const [mountFs, realFd] = entry; - return mountFs.ftruncatePromise(realFd, len); - } - ftruncateSync(fd, len) { - if ((fd & MOUNT_MASK) !== this.magic) - return this.baseFs.ftruncateSync(fd, len); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`ftruncateSync`); - const [mountFs, realFd] = entry; - return mountFs.ftruncateSync(realFd, len); - } - watch(p, a, b) { - return this.makeCallSync(p, () => { - return this.baseFs.watch( - p, - a, - b - ); - }, (mountFs, { subPath }) => { - return mountFs.watch( - subPath, - a, - b - ); - }); - } - watchFile(p, a, b) { - return this.makeCallSync(p, () => { - return this.baseFs.watchFile( - p, - a, - b - ); - }, () => { - return watchFile(this, p, a, b); - }); - } - unwatchFile(p, cb) { - return this.makeCallSync(p, () => { - return this.baseFs.unwatchFile(p, cb); - }, () => { - return unwatchFile(this, p, cb); - }); - } - async makeCallPromise(p, discard, accept, { requireSubpath = true } = {}) { - if (typeof p !== `string`) - return await discard(); - const normalizedP = this.resolve(p); - const mountInfo = this.findMount(normalizedP); - if (!mountInfo) - return await discard(); - if (requireSubpath && mountInfo.subPath === `/`) - return await discard(); - return await this.getMountPromise(mountInfo.archivePath, async (mountFs) => await accept(mountFs, mountInfo)); - } - makeCallSync(p, discard, accept, { requireSubpath = true } = {}) { - if (typeof p !== `string`) - return discard(); - const normalizedP = this.resolve(p); - const mountInfo = this.findMount(normalizedP); - if (!mountInfo) - return discard(); - if (requireSubpath && mountInfo.subPath === `/`) - return discard(); - return this.getMountSync(mountInfo.archivePath, (mountFs) => accept(mountFs, mountInfo)); - } - findMount(p) { - if (this.filter && !this.filter.test(p)) - return null; - let filePath = ``; - while (true) { - const pathPartWithArchive = p.substring(filePath.length); - const mountPoint = this.getMountPoint(pathPartWithArchive, filePath); - if (!mountPoint) - return null; - filePath = this.pathUtils.join(filePath, mountPoint); - if (!this.isMount.has(filePath)) { - if (this.notMount.has(filePath)) - continue; - try { - if (this.typeCheck !== null && (this.baseFs.lstatSync(filePath).mode & fs.constants.S_IFMT) !== this.typeCheck) { - this.notMount.add(filePath); - continue; - } - } catch { - return null; - } - this.isMount.add(filePath); - } - return { - archivePath: filePath, - subPath: this.pathUtils.join(PortablePath.root, p.substring(filePath.length)) - }; - } - } - limitOpenFiles(max) { - if (this.mountInstances === null) - return; - const now = Date.now(); - let nextExpiresAt = now + this.maxAge; - let closeCount = max === null ? 0 : this.mountInstances.size - max; - for (const [path, { childFs, expiresAt, refCount }] of this.mountInstances.entries()) { - if (refCount !== 0 || childFs.hasOpenFileHandles?.()) { - continue; - } else if (now >= expiresAt) { - childFs.saveAndClose?.(); - this.mountInstances.delete(path); - closeCount -= 1; - continue; - } else if (max === null || closeCount <= 0) { - nextExpiresAt = expiresAt; - break; - } - childFs.saveAndClose?.(); - this.mountInstances.delete(path); - closeCount -= 1; - } - if (this.limitOpenFilesTimeout === null && (max === null && this.mountInstances.size > 0 || max !== null) && isFinite(nextExpiresAt)) { - this.limitOpenFilesTimeout = setTimeout(() => { - this.limitOpenFilesTimeout = null; - this.limitOpenFiles(null); - }, nextExpiresAt - now).unref(); - } - } - async getMountPromise(p, accept) { - if (this.mountInstances) { - let cachedMountFs = this.mountInstances.get(p); - if (!cachedMountFs) { - const createFsInstance = await this.factoryPromise(this.baseFs, p); - cachedMountFs = this.mountInstances.get(p); - if (!cachedMountFs) { - cachedMountFs = { - childFs: createFsInstance(), - expiresAt: 0, - refCount: 0 - }; - } - } - this.mountInstances.delete(p); - this.limitOpenFiles(this.maxOpenFiles - 1); - this.mountInstances.set(p, cachedMountFs); - cachedMountFs.expiresAt = Date.now() + this.maxAge; - cachedMountFs.refCount += 1; - try { - return await accept(cachedMountFs.childFs); - } finally { - cachedMountFs.refCount -= 1; - } - } else { - const mountFs = (await this.factoryPromise(this.baseFs, p))(); - try { - return await accept(mountFs); - } finally { - mountFs.saveAndClose?.(); - } - } - } - getMountSync(p, accept) { - if (this.mountInstances) { - let cachedMountFs = this.mountInstances.get(p); - if (!cachedMountFs) { - cachedMountFs = { - childFs: this.factorySync(this.baseFs, p), - expiresAt: 0, - refCount: 0 - }; - } - this.mountInstances.delete(p); - this.limitOpenFiles(this.maxOpenFiles - 1); - this.mountInstances.set(p, cachedMountFs); - cachedMountFs.expiresAt = Date.now() + this.maxAge; - return accept(cachedMountFs.childFs); - } else { - const childFs = this.factorySync(this.baseFs, p); - try { - return accept(childFs); - } finally { - childFs.saveAndClose?.(); - } - } - } -} - -class PosixFS extends ProxiedFS { - constructor(baseFs) { - super(npath); - this.baseFs = baseFs; - } - mapFromBase(path) { - return npath.fromPortablePath(path); - } - mapToBase(path) { - return npath.toPortablePath(path); - } -} - -const NUMBER_REGEXP = /^[0-9]+$/; -const VIRTUAL_REGEXP = /^(\/(?:[^/]+\/)*?(?:\$\$virtual|__virtual__))((?:\/((?:[^/]+-)?[a-f0-9]+)(?:\/([^/]+))?)?((?:\/.*)?))$/; -const VALID_COMPONENT = /^([^/]+-)?[a-f0-9]+$/; -class VirtualFS extends ProxiedFS { - constructor({ baseFs = new NodeFS() } = {}) { - super(ppath); - this.baseFs = baseFs; - } - static makeVirtualPath(base, component, to) { - if (ppath.basename(base) !== `__virtual__`) - throw new Error(`Assertion failed: Virtual folders must be named "__virtual__"`); - if (!ppath.basename(component).match(VALID_COMPONENT)) - throw new Error(`Assertion failed: Virtual components must be ended by an hexadecimal hash`); - const target = ppath.relative(ppath.dirname(base), to); - const segments = target.split(`/`); - let depth = 0; - while (depth < segments.length && segments[depth] === `..`) - depth += 1; - const finalSegments = segments.slice(depth); - const fullVirtualPath = ppath.join(base, component, String(depth), ...finalSegments); - return fullVirtualPath; - } - static resolveVirtual(p) { - const match = p.match(VIRTUAL_REGEXP); - if (!match || !match[3] && match[5]) - return p; - const target = ppath.dirname(match[1]); - if (!match[3] || !match[4]) - return target; - const isnum = NUMBER_REGEXP.test(match[4]); - if (!isnum) - return p; - const depth = Number(match[4]); - const backstep = `../`.repeat(depth); - const subpath = match[5] || `.`; - return VirtualFS.resolveVirtual(ppath.join(target, backstep, subpath)); - } - getExtractHint(hints) { - return this.baseFs.getExtractHint(hints); - } - getRealPath() { - return this.baseFs.getRealPath(); - } - realpathSync(p) { - const match = p.match(VIRTUAL_REGEXP); - if (!match) - return this.baseFs.realpathSync(p); - if (!match[5]) - return p; - const realpath = this.baseFs.realpathSync(this.mapToBase(p)); - return VirtualFS.makeVirtualPath(match[1], match[3], realpath); - } - async realpathPromise(p) { - const match = p.match(VIRTUAL_REGEXP); - if (!match) - return await this.baseFs.realpathPromise(p); - if (!match[5]) - return p; - const realpath = await this.baseFs.realpathPromise(this.mapToBase(p)); - return VirtualFS.makeVirtualPath(match[1], match[3], realpath); - } - mapToBase(p) { - if (p === ``) - return p; - if (this.pathUtils.isAbsolute(p)) - return VirtualFS.resolveVirtual(p); - const resolvedRoot = VirtualFS.resolveVirtual(this.baseFs.resolve(PortablePath.dot)); - const resolvedP = VirtualFS.resolveVirtual(this.baseFs.resolve(p)); - return ppath.relative(resolvedRoot, resolvedP) || PortablePath.dot; - } - mapFromBase(p) { - return p; - } -} - -const URL = Number(process.versions.node.split('.', 1)[0]) < 20 ? url.URL : globalThis.URL; - -class NodePathFS extends ProxiedFS { - constructor(baseFs) { - super(npath); - this.baseFs = baseFs; - } - mapFromBase(path) { - return path; - } - mapToBase(path) { - if (typeof path === `string`) - return path; - if (path instanceof URL) - return url.fileURLToPath(path); - if (Buffer.isBuffer(path)) { - const str = path.toString(); - if (!isUtf8(path, str)) - throw new Error(`Non-utf8 buffers are not supported at the moment. Please upvote the following issue if you encounter this error: https://github.com/yarnpkg/berry/issues/4942`); - return str; - } - throw new Error(`Unsupported path type: ${nodeUtils.inspect(path)}`); - } -} -function isUtf8(buf, str) { - if (typeof buffer__default.default.isUtf8 !== `undefined`) - return buffer__default.default.isUtf8(buf); - return Buffer.byteLength(str) === buf.byteLength; -} - -var _a, _b, _c, _d; -const kBaseFs = Symbol(`kBaseFs`); -const kFd = Symbol(`kFd`); -const kClosePromise = Symbol(`kClosePromise`); -const kCloseResolve = Symbol(`kCloseResolve`); -const kCloseReject = Symbol(`kCloseReject`); -const kRefs = Symbol(`kRefs`); -const kRef = Symbol(`kRef`); -const kUnref = Symbol(`kUnref`); -class FileHandle { - constructor(fd, baseFs) { - this[_a] = 1; - this[_b] = void 0; - this[_c] = void 0; - this[_d] = void 0; - this[kBaseFs] = baseFs; - this[kFd] = fd; - } - get fd() { - return this[kFd]; - } - async appendFile(data, options) { - try { - this[kRef](this.appendFile); - const encoding = (typeof options === `string` ? options : options?.encoding) ?? void 0; - return await this[kBaseFs].appendFilePromise(this.fd, data, encoding ? { encoding } : void 0); - } finally { - this[kUnref](); - } - } - async chown(uid, gid) { - try { - this[kRef](this.chown); - return await this[kBaseFs].fchownPromise(this.fd, uid, gid); - } finally { - this[kUnref](); - } - } - async chmod(mode) { - try { - this[kRef](this.chmod); - return await this[kBaseFs].fchmodPromise(this.fd, mode); - } finally { - this[kUnref](); - } - } - createReadStream(options) { - return this[kBaseFs].createReadStream(null, { ...options, fd: this.fd }); - } - createWriteStream(options) { - return this[kBaseFs].createWriteStream(null, { ...options, fd: this.fd }); - } - datasync() { - throw new Error(`Method not implemented.`); - } - sync() { - throw new Error(`Method not implemented.`); - } - async read(bufferOrOptions, offset, length, position) { - try { - this[kRef](this.read); - let buffer; - if (!Buffer.isBuffer(bufferOrOptions)) { - bufferOrOptions ??= {}; - buffer = bufferOrOptions.buffer ?? Buffer.alloc(16384); - offset = bufferOrOptions.offset || 0; - length = bufferOrOptions.length ?? buffer.byteLength; - position = bufferOrOptions.position ?? null; - } else { - buffer = bufferOrOptions; - } - offset ??= 0; - length ??= 0; - if (length === 0) { - return { - bytesRead: length, - buffer - }; - } - const bytesRead = await this[kBaseFs].readPromise(this.fd, buffer, offset, length, position); - return { - bytesRead, - buffer - }; - } finally { - this[kUnref](); - } - } - async readFile(options) { - try { - this[kRef](this.readFile); - const encoding = (typeof options === `string` ? options : options?.encoding) ?? void 0; - return await this[kBaseFs].readFilePromise(this.fd, encoding); - } finally { - this[kUnref](); - } - } - readLines(options) { - return readline.createInterface({ - input: this.createReadStream(options), - crlfDelay: Infinity - }); - } - async stat(opts) { - try { - this[kRef](this.stat); - return await this[kBaseFs].fstatPromise(this.fd, opts); - } finally { - this[kUnref](); - } - } - async truncate(len) { - try { - this[kRef](this.truncate); - return await this[kBaseFs].ftruncatePromise(this.fd, len); - } finally { - this[kUnref](); - } - } - utimes(atime, mtime) { - throw new Error(`Method not implemented.`); - } - async writeFile(data, options) { - try { - this[kRef](this.writeFile); - const encoding = (typeof options === `string` ? options : options?.encoding) ?? void 0; - await this[kBaseFs].writeFilePromise(this.fd, data, encoding); - } finally { - this[kUnref](); - } - } - async write(...args) { - try { - this[kRef](this.write); - if (ArrayBuffer.isView(args[0])) { - const [buffer, offset, length, position] = args; - const bytesWritten = await this[kBaseFs].writePromise(this.fd, buffer, offset ?? void 0, length ?? void 0, position ?? void 0); - return { bytesWritten, buffer }; - } else { - const [data, position, encoding] = args; - const bytesWritten = await this[kBaseFs].writePromise(this.fd, data, position, encoding); - return { bytesWritten, buffer: data }; - } - } finally { - this[kUnref](); - } - } - async writev(buffers, position) { - try { - this[kRef](this.writev); - let bytesWritten = 0; - if (typeof position !== `undefined`) { - for (const buffer of buffers) { - const writeResult = await this.write(buffer, void 0, void 0, position); - bytesWritten += writeResult.bytesWritten; - position += writeResult.bytesWritten; - } - } else { - for (const buffer of buffers) { - const writeResult = await this.write(buffer); - bytesWritten += writeResult.bytesWritten; - } - } - return { - buffers, - bytesWritten - }; - } finally { - this[kUnref](); - } - } - readv(buffers, position) { - throw new Error(`Method not implemented.`); - } - close() { - if (this[kFd] === -1) - return Promise.resolve(); - if (this[kClosePromise]) - return this[kClosePromise]; - this[kRefs]--; - if (this[kRefs] === 0) { - const fd = this[kFd]; - this[kFd] = -1; - this[kClosePromise] = this[kBaseFs].closePromise(fd).finally(() => { - this[kClosePromise] = void 0; - }); - } else { - this[kClosePromise] = new Promise((resolve, reject) => { - this[kCloseResolve] = resolve; - this[kCloseReject] = reject; - }).finally(() => { - this[kClosePromise] = void 0; - this[kCloseReject] = void 0; - this[kCloseResolve] = void 0; - }); - } - return this[kClosePromise]; - } - [(_a = kRefs, _b = kClosePromise, _c = kCloseResolve, _d = kCloseReject, kRef)](caller) { - if (this[kFd] === -1) { - const err = new Error(`file closed`); - err.code = `EBADF`; - err.syscall = caller.name; - throw err; - } - this[kRefs]++; - } - [kUnref]() { - this[kRefs]--; - if (this[kRefs] === 0) { - const fd = this[kFd]; - this[kFd] = -1; - this[kBaseFs].closePromise(fd).then(this[kCloseResolve], this[kCloseReject]); - } - } -} - -const SYNC_IMPLEMENTATIONS = /* @__PURE__ */ new Set([ - `accessSync`, - `appendFileSync`, - `createReadStream`, - `createWriteStream`, - `chmodSync`, - `fchmodSync`, - `chownSync`, - `fchownSync`, - `closeSync`, - `copyFileSync`, - `linkSync`, - `lstatSync`, - `fstatSync`, - `lutimesSync`, - `mkdirSync`, - `openSync`, - `opendirSync`, - `readlinkSync`, - `readFileSync`, - `readdirSync`, - `readlinkSync`, - `realpathSync`, - `renameSync`, - `rmdirSync`, - `rmSync`, - `statSync`, - `symlinkSync`, - `truncateSync`, - `ftruncateSync`, - `unlinkSync`, - `unwatchFile`, - `utimesSync`, - `watch`, - `watchFile`, - `writeFileSync`, - `writeSync` -]); -const ASYNC_IMPLEMENTATIONS = /* @__PURE__ */ new Set([ - `accessPromise`, - `appendFilePromise`, - `fchmodPromise`, - `chmodPromise`, - `fchownPromise`, - `chownPromise`, - `closePromise`, - `copyFilePromise`, - `linkPromise`, - `fstatPromise`, - `lstatPromise`, - `lutimesPromise`, - `mkdirPromise`, - `openPromise`, - `opendirPromise`, - `readdirPromise`, - `realpathPromise`, - `readFilePromise`, - `readdirPromise`, - `readlinkPromise`, - `renamePromise`, - `rmdirPromise`, - `rmPromise`, - `statPromise`, - `symlinkPromise`, - `truncatePromise`, - `ftruncatePromise`, - `unlinkPromise`, - `utimesPromise`, - `writeFilePromise`, - `writeSync` -]); -function patchFs(patchedFs, fakeFs) { - fakeFs = new NodePathFS(fakeFs); - const setupFn = (target, name, replacement) => { - const orig = target[name]; - target[name] = replacement; - if (typeof orig?.[nodeUtils.promisify.custom] !== `undefined`) { - replacement[nodeUtils.promisify.custom] = orig[nodeUtils.promisify.custom]; - } - }; - { - setupFn(patchedFs, `exists`, (p, ...args) => { - const hasCallback = typeof args[args.length - 1] === `function`; - const callback = hasCallback ? args.pop() : () => { - }; - process.nextTick(() => { - fakeFs.existsPromise(p).then((exists) => { - callback(exists); - }, () => { - callback(false); - }); - }); - }); - setupFn(patchedFs, `read`, (...args) => { - let [fd, buffer, offset, length, position, callback] = args; - if (args.length <= 3) { - let options = {}; - if (args.length < 3) { - callback = args[1]; - } else { - options = args[1]; - callback = args[2]; - } - ({ - buffer = Buffer.alloc(16384), - offset = 0, - length = buffer.byteLength, - position - } = options); - } - if (offset == null) - offset = 0; - length |= 0; - if (length === 0) { - process.nextTick(() => { - callback(null, 0, buffer); - }); - return; - } - if (position == null) - position = -1; - process.nextTick(() => { - fakeFs.readPromise(fd, buffer, offset, length, position).then((bytesRead) => { - callback(null, bytesRead, buffer); - }, (error) => { - callback(error, 0, buffer); - }); - }); - }); - for (const fnName of ASYNC_IMPLEMENTATIONS) { - const origName = fnName.replace(/Promise$/, ``); - if (typeof patchedFs[origName] === `undefined`) - continue; - const fakeImpl = fakeFs[fnName]; - if (typeof fakeImpl === `undefined`) - continue; - const wrapper = (...args) => { - const hasCallback = typeof args[args.length - 1] === `function`; - const callback = hasCallback ? args.pop() : () => { - }; - process.nextTick(() => { - fakeImpl.apply(fakeFs, args).then((result) => { - callback(null, result); - }, (error) => { - callback(error); - }); - }); - }; - setupFn(patchedFs, origName, wrapper); - } - patchedFs.realpath.native = patchedFs.realpath; - } - { - setupFn(patchedFs, `existsSync`, (p) => { - try { - return fakeFs.existsSync(p); - } catch (error) { - return false; - } - }); - setupFn(patchedFs, `readSync`, (...args) => { - let [fd, buffer, offset, length, position] = args; - if (args.length <= 3) { - const options = args[2] || {}; - ({ offset = 0, length = buffer.byteLength, position } = options); - } - if (offset == null) - offset = 0; - length |= 0; - if (length === 0) - return 0; - if (position == null) - position = -1; - return fakeFs.readSync(fd, buffer, offset, length, position); - }); - for (const fnName of SYNC_IMPLEMENTATIONS) { - const origName = fnName; - if (typeof patchedFs[origName] === `undefined`) - continue; - const fakeImpl = fakeFs[fnName]; - if (typeof fakeImpl === `undefined`) - continue; - setupFn(patchedFs, origName, fakeImpl.bind(fakeFs)); - } - patchedFs.realpathSync.native = patchedFs.realpathSync; - } - { - const patchedFsPromises = patchedFs.promises; - for (const fnName of ASYNC_IMPLEMENTATIONS) { - const origName = fnName.replace(/Promise$/, ``); - if (typeof patchedFsPromises[origName] === `undefined`) - continue; - const fakeImpl = fakeFs[fnName]; - if (typeof fakeImpl === `undefined`) - continue; - if (fnName === `open`) - continue; - setupFn(patchedFsPromises, origName, (pathLike, ...args) => { - if (pathLike instanceof FileHandle) { - return pathLike[origName].apply(pathLike, args); - } else { - return fakeImpl.call(fakeFs, pathLike, ...args); - } - }); - } - setupFn(patchedFsPromises, `open`, async (...args) => { - const fd = await fakeFs.openPromise(...args); - return new FileHandle(fd, fakeFs); - }); - } - { - patchedFs.read[nodeUtils.promisify.custom] = async (fd, buffer, ...args) => { - const res = fakeFs.readPromise(fd, buffer, ...args); - return { bytesRead: await res, buffer }; - }; - patchedFs.write[nodeUtils.promisify.custom] = async (fd, buffer, ...args) => { - const res = fakeFs.writePromise(fd, buffer, ...args); - return { bytesWritten: await res, buffer }; - }; - } -} - -let cachedInstance; -let registeredFactory = () => { - throw new Error(`Assertion failed: No libzip instance is available, and no factory was configured`); -}; -function setFactory(factory) { - registeredFactory = factory; -} -function getInstance() { - if (typeof cachedInstance === `undefined`) - cachedInstance = registeredFactory(); - return cachedInstance; -} - -var libzipSync = {exports: {}}; - -(function (module, exports) { -var frozenFs = Object.assign({}, fs__default.default); -var createModule = function() { - var _scriptDir = void 0; - if (typeof __filename !== "undefined") - _scriptDir = _scriptDir || __filename; - return function(createModule2) { - createModule2 = createModule2 || {}; - var Module = typeof createModule2 !== "undefined" ? createModule2 : {}; - var readyPromiseResolve, readyPromiseReject; - Module["ready"] = new Promise(function(resolve, reject) { - readyPromiseResolve = resolve; - readyPromiseReject = reject; - }); - var moduleOverrides = {}; - var key; - for (key in Module) { - if (Module.hasOwnProperty(key)) { - moduleOverrides[key] = Module[key]; - } - } - var scriptDirectory = ""; - function locateFile(path) { - if (Module["locateFile"]) { - return Module["locateFile"](path, scriptDirectory); - } - return scriptDirectory + path; - } - var read_, readBinary; - var nodeFS; - var nodePath; - { - { - scriptDirectory = __dirname + "/"; - } - read_ = function shell_read(filename, binary) { - var ret = tryParseAsDataURI(filename); - if (ret) { - return binary ? ret : ret.toString(); - } - if (!nodeFS) - nodeFS = frozenFs; - if (!nodePath) - nodePath = path__default.default; - filename = nodePath["normalize"](filename); - return nodeFS["readFileSync"](filename, binary ? null : "utf8"); - }; - readBinary = function readBinary2(filename) { - var ret = read_(filename, true); - if (!ret.buffer) { - ret = new Uint8Array(ret); - } - assert(ret.buffer); - return ret; - }; - if (process["argv"].length > 1) { - process["argv"][1].replace(/\\/g, "/"); - } - process["argv"].slice(2); - Module["inspect"] = function() { - return "[Emscripten Module object]"; - }; - } - Module["print"] || console.log.bind(console); - var err = Module["printErr"] || console.warn.bind(console); - for (key in moduleOverrides) { - if (moduleOverrides.hasOwnProperty(key)) { - Module[key] = moduleOverrides[key]; - } - } - moduleOverrides = null; - if (Module["arguments"]) - ; - if (Module["thisProgram"]) - ; - if (Module["quit"]) - ; - var wasmBinary; - if (Module["wasmBinary"]) - wasmBinary = Module["wasmBinary"]; - Module["noExitRuntime"] || true; - if (typeof WebAssembly !== "object") { - abort("no native wasm support detected"); - } - function getValue(ptr, type, noSafe) { - type = type || "i8"; - if (type.charAt(type.length - 1) === "*") - type = "i32"; - switch (type) { - case "i1": - return HEAP8[ptr >> 0]; - case "i8": - return HEAP8[ptr >> 0]; - case "i16": - return LE_HEAP_LOAD_I16((ptr >> 1) * 2); - case "i32": - return LE_HEAP_LOAD_I32((ptr >> 2) * 4); - case "i64": - return LE_HEAP_LOAD_I32((ptr >> 2) * 4); - case "float": - return LE_HEAP_LOAD_F32((ptr >> 2) * 4); - case "double": - return LE_HEAP_LOAD_F64((ptr >> 3) * 8); - default: - abort("invalid type for getValue: " + type); - } - return null; - } - var wasmMemory; - var ABORT = false; - function assert(condition, text) { - if (!condition) { - abort("Assertion failed: " + text); - } - } - function getCFunc(ident) { - var func = Module["_" + ident]; - assert( - func, - "Cannot call unknown function " + ident + ", make sure it is exported" - ); - return func; - } - function ccall(ident, returnType, argTypes, args, opts) { - var toC = { - string: function(str) { - var ret2 = 0; - if (str !== null && str !== void 0 && str !== 0) { - var len = (str.length << 2) + 1; - ret2 = stackAlloc(len); - stringToUTF8(str, ret2, len); - } - return ret2; - }, - array: function(arr) { - var ret2 = stackAlloc(arr.length); - writeArrayToMemory(arr, ret2); - return ret2; - } - }; - function convertReturnValue(ret2) { - if (returnType === "string") - return UTF8ToString(ret2); - if (returnType === "boolean") - return Boolean(ret2); - return ret2; - } - var func = getCFunc(ident); - var cArgs = []; - var stack = 0; - if (args) { - for (var i = 0; i < args.length; i++) { - var converter = toC[argTypes[i]]; - if (converter) { - if (stack === 0) - stack = stackSave(); - cArgs[i] = converter(args[i]); - } else { - cArgs[i] = args[i]; - } - } - } - var ret = func.apply(null, cArgs); - ret = convertReturnValue(ret); - if (stack !== 0) - stackRestore(stack); - return ret; - } - function cwrap(ident, returnType, argTypes, opts) { - argTypes = argTypes || []; - var numericArgs = argTypes.every(function(type) { - return type === "number"; - }); - var numericRet = returnType !== "string"; - if (numericRet && numericArgs && !opts) { - return getCFunc(ident); - } - return function() { - return ccall(ident, returnType, argTypes, arguments); - }; - } - var UTF8Decoder = new TextDecoder("utf8"); - function UTF8ToString(ptr, maxBytesToRead) { - if (!ptr) - return ""; - var maxPtr = ptr + maxBytesToRead; - for (var end = ptr; !(end >= maxPtr) && HEAPU8[end]; ) - ++end; - return UTF8Decoder.decode(HEAPU8.subarray(ptr, end)); - } - function stringToUTF8Array(str, heap, outIdx, maxBytesToWrite) { - if (!(maxBytesToWrite > 0)) - return 0; - var startIdx = outIdx; - var endIdx = outIdx + maxBytesToWrite - 1; - for (var i = 0; i < str.length; ++i) { - var u = str.charCodeAt(i); - if (u >= 55296 && u <= 57343) { - var u1 = str.charCodeAt(++i); - u = 65536 + ((u & 1023) << 10) | u1 & 1023; - } - if (u <= 127) { - if (outIdx >= endIdx) - break; - heap[outIdx++] = u; - } else if (u <= 2047) { - if (outIdx + 1 >= endIdx) - break; - heap[outIdx++] = 192 | u >> 6; - heap[outIdx++] = 128 | u & 63; - } else if (u <= 65535) { - if (outIdx + 2 >= endIdx) - break; - heap[outIdx++] = 224 | u >> 12; - heap[outIdx++] = 128 | u >> 6 & 63; - heap[outIdx++] = 128 | u & 63; - } else { - if (outIdx + 3 >= endIdx) - break; - heap[outIdx++] = 240 | u >> 18; - heap[outIdx++] = 128 | u >> 12 & 63; - heap[outIdx++] = 128 | u >> 6 & 63; - heap[outIdx++] = 128 | u & 63; - } - } - heap[outIdx] = 0; - return outIdx - startIdx; - } - function stringToUTF8(str, outPtr, maxBytesToWrite) { - return stringToUTF8Array(str, HEAPU8, outPtr, maxBytesToWrite); - } - function lengthBytesUTF8(str) { - var len = 0; - for (var i = 0; i < str.length; ++i) { - var u = str.charCodeAt(i); - if (u >= 55296 && u <= 57343) - u = 65536 + ((u & 1023) << 10) | str.charCodeAt(++i) & 1023; - if (u <= 127) - ++len; - else if (u <= 2047) - len += 2; - else if (u <= 65535) - len += 3; - else - len += 4; - } - return len; - } - function allocateUTF8(str) { - var size = lengthBytesUTF8(str) + 1; - var ret = _malloc(size); - if (ret) - stringToUTF8Array(str, HEAP8, ret, size); - return ret; - } - function writeArrayToMemory(array, buffer2) { - HEAP8.set(array, buffer2); - } - function alignUp(x, multiple) { - if (x % multiple > 0) { - x += multiple - x % multiple; - } - return x; - } - var buffer, HEAP8, HEAPU8; - var HEAP_DATA_VIEW; - function updateGlobalBufferAndViews(buf) { - buffer = buf; - Module["HEAP_DATA_VIEW"] = HEAP_DATA_VIEW = new DataView(buf); - Module["HEAP8"] = HEAP8 = new Int8Array(buf); - Module["HEAP16"] = new Int16Array(buf); - Module["HEAP32"] = new Int32Array(buf); - Module["HEAPU8"] = HEAPU8 = new Uint8Array(buf); - Module["HEAPU16"] = new Uint16Array(buf); - Module["HEAPU32"] = new Uint32Array(buf); - Module["HEAPF32"] = new Float32Array(buf); - Module["HEAPF64"] = new Float64Array(buf); - } - Module["INITIAL_MEMORY"] || 16777216; - var wasmTable; - var __ATPRERUN__ = []; - var __ATINIT__ = []; - var __ATPOSTRUN__ = []; - function preRun() { - if (Module["preRun"]) { - if (typeof Module["preRun"] == "function") - Module["preRun"] = [Module["preRun"]]; - while (Module["preRun"].length) { - addOnPreRun(Module["preRun"].shift()); - } - } - callRuntimeCallbacks(__ATPRERUN__); - } - function initRuntime() { - callRuntimeCallbacks(__ATINIT__); - } - function postRun() { - if (Module["postRun"]) { - if (typeof Module["postRun"] == "function") - Module["postRun"] = [Module["postRun"]]; - while (Module["postRun"].length) { - addOnPostRun(Module["postRun"].shift()); - } - } - callRuntimeCallbacks(__ATPOSTRUN__); - } - function addOnPreRun(cb) { - __ATPRERUN__.unshift(cb); - } - function addOnInit(cb) { - __ATINIT__.unshift(cb); - } - function addOnPostRun(cb) { - __ATPOSTRUN__.unshift(cb); - } - var runDependencies = 0; - var dependenciesFulfilled = null; - function addRunDependency(id) { - runDependencies++; - if (Module["monitorRunDependencies"]) { - Module["monitorRunDependencies"](runDependencies); - } - } - function removeRunDependency(id) { - runDependencies--; - if (Module["monitorRunDependencies"]) { - Module["monitorRunDependencies"](runDependencies); - } - if (runDependencies == 0) { - if (dependenciesFulfilled) { - var callback = dependenciesFulfilled; - dependenciesFulfilled = null; - callback(); - } - } - } - Module["preloadedImages"] = {}; - Module["preloadedAudios"] = {}; - function abort(what) { - if (Module["onAbort"]) { - Module["onAbort"](what); - } - what += ""; - err(what); - ABORT = true; - what = "abort(" + what + "). Build with -s ASSERTIONS=1 for more info."; - var e = new WebAssembly.RuntimeError(what); - readyPromiseReject(e); - throw e; - } - var dataURIPrefix = "data:application/octet-stream;base64,"; - function isDataURI(filename) { - return filename.startsWith(dataURIPrefix); - } - var wasmBinaryFile = "data:application/octet-stream;base64,AGFzbQEAAAAB/wEkYAN/f38Bf2ABfwF/YAJ/fwF/YAF/AGAEf39/fwF/YAN/f38AYAV/f39/fwF/YAJ/fwBgBH9/f38AYAABf2AFf39/fn8BfmAEf35/fwF/YAR/f35/AX5gAn9+AX9gA398fwBgA39/fgF/YAF/AX5gBn9/f39/fwF/YAN/fn8Bf2AEf39/fwF+YAV/f35/fwF/YAR/f35/AX9gA39/fgF+YAJ/fgBgAn9/AX5gBX9/f39/AGADf35/AX5gBX5+f35/AX5gA39/fwF+YAZ/fH9/f38Bf2AAAGAHf35/f39+fwF/YAV/fn9/fwF/YAV/f39/fwF+YAJ+fwF/YAJ/fAACJQYBYQFhAAMBYQFiAAEBYQFjAAABYQFkAAEBYQFlAAIBYQFmAAED5wHlAQMAAwEDAwEHDAgDFgcNEgEDDRcFAQ8DEAUQAwIBAhgECxkEAQMBBQsFAwMDARACBAMAAggLBwEAAwADGgQDGwYGABwBBgMTFBEHBwcVCx4ABAgHBAICAgAfAQICAgIGFSAAIQAiAAIBBgIHAg0LEw0FAQUCACMDAQAUAAAGBQECBQUDCwsSAgEDBQIHAQEICAACCQQEAQABCAEBCQoBAwkBAQEBBgEGBgYABAIEBAQGEQQEAAARAAEDCQEJAQAJCQkBAQECCgoAAAMPAQEBAwACAgICBQIABwAKBgwHAAADAgICBQEEBQFwAT8/BQcBAYACgIACBgkBfwFBgInBAgsH+gEzAWcCAAFoAFQBaQDqAQFqALsBAWsAwQEBbACpAQFtAKgBAW4ApwEBbw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wIABC/////w83AyggAEIANwMYIABCADcDIAulAQEBf0HYABAJIgFFBEBBAA8LAkAgAARAIAEgAEHYABAHGgwBCyABQgA3AyAgAUEANgIYIAFC/////w83AxAgAUEAOwEMIAFBv4YoNgIIIAFBAToABiABQQA6AAQgAUIANwNIIAFBgIDYjXg2AkQgAUIANwMoIAFCADcDMCABQgA3AzggAUFAa0EAOwEAIAFCADcDUAsgAUEBOgAFIAFBADYCACABC1gCAn4BfwJAAkAgAC0AAEUNACAAKQMQIgMgAq18IgQgA1QNACAEIAApAwhYDQELIABBADoAAA8LIAAoAgQiBUUEQA8LIAAgBDcDECAFIAOnaiABIAIQBxoLlgEBAn8CQAJAIAJFBEAgAacQCSIFRQ0BQRgQCSIEDQIgBRAGDAELIAIhBUEYEAkiBA0BCyADBEAgA0EANgIEIANBDjYCAAtBAA8LIARCADcDECAEIAE3AwggBCAFNgIEIARBAToAACAEIAJFOgABIAAgBSABIAMQZUEASAR/IAQtAAEEQCAEKAIEEAYLIAQQBkEABSAECwubAgEDfyAALQAAQSBxRQRAAkAgASEDAkAgAiAAIgEoAhAiAAR/IAAFAn8gASABLQBKIgBBAWsgAHI6AEogASgCACIAQQhxBEAgASAAQSByNgIAQX8MAQsgAUIANwIEIAEgASgCLCIANgIcIAEgADYCFCABIAAgASgCMGo2AhBBAAsNASABKAIQCyABKAIUIgVrSwRAIAEgAyACIAEoAiQRAAAaDAILAn8gASwAS0F/SgRAIAIhAANAIAIgACIERQ0CGiADIARBAWsiAGotAABBCkcNAAsgASADIAQgASgCJBEAACAESQ0CIAMgBGohAyABKAIUIQUgAiAEawwBCyACCyEAIAUgAyAAEAcaIAEgASgCFCAAajYCFAsLCwvNBQEGfyAAKAIwIgNBhgJrIQYgACgCPCECIAMhAQNAIAAoAkQgAiAAKAJoIgRqayECIAEgBmogBE0EQCAAKAJIIgEgASADaiADEAcaAkAgAyAAKAJsIgFNBEAgACABIANrNgJsDAELIABCADcCbAsgACAAKAJoIANrIgE2AmggACAAKAJYIANrNgJYIAEgACgChC5JBEAgACABNgKELgsgAEH8gAEoAgARAwAgAiADaiECCwJAIAAoAgAiASgCBCIERQ0AIAAoAjwhBSAAIAIgBCACIARJGyICBH8gACgCSCAAKAJoaiAFaiEFIAEgBCACazYCBAJAAkACQAJAIAEoAhwiBCgCFEEBaw4CAQACCyAEQaABaiAFIAEoAgAgAkHcgAEoAgARCAAMAgsgASABKAIwIAUgASgCACACQcSAASgCABEEADYCMAwBCyAFIAEoAgAgAhAHGgsgASABKAIAIAJqNgIAIAEgASgCCCACajYCCCAAKAI8BSAFCyACaiICNgI8AkAgACgChC4iASACakEDSQ0AIAAoAmggAWshAQJAIAAoAnRBgQhPBEAgACAAIAAoAkggAWoiAi0AACACLQABIAAoAnwRAAA2AlQMAQsgAUUNACAAIAFBAWsgACgChAERAgAaCyAAKAKELiAAKAI8IgJBAUZrIgRFDQAgACABIAQgACgCgAERBQAgACAAKAKELiAEazYChC4gACgCPCECCyACQYUCSw0AIAAoAgAoAgRFDQAgACgCMCEBDAELCwJAIAAoAkQiAiAAKAJAIgNNDQAgAAJ/IAAoAjwgACgCaGoiASADSwRAIAAoAkggAWpBACACIAFrIgNBggIgA0GCAkkbIgMQGSABIANqDAELIAFBggJqIgEgA00NASAAKAJIIANqQQAgAiADayICIAEgA2siAyACIANJGyIDEBkgACgCQCADags2AkALC50CAQF/AkAgAAJ/IAAoAqAuIgFBwABGBEAgACgCBCAAKAIQaiAAKQOYLjcAACAAQgA3A5guIAAgACgCEEEIajYCEEEADAELIAFBIE4EQCAAKAIEIAAoAhBqIAApA5guPgAAIAAgAEGcLmo1AgA3A5guIAAgACgCEEEEajYCECAAIAAoAqAuQSBrIgE2AqAuCyABQRBOBEAgACgCBCAAKAIQaiAAKQOYLj0AACAAIAAoAhBBAmo2AhAgACAAKQOYLkIQiDcDmC4gACAAKAKgLkEQayIBNgKgLgsgAUEISA0BIAAgACgCECIBQQFqNgIQIAEgACgCBGogACkDmC48AAAgACAAKQOYLkIIiDc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QRAIAAtAABBAnFFDQELIAAoAjAQECAAQQA2AjAgAC0ABUUNAQsgAC0AAEEIcUUNAQsgACgCNBAcIABBADYCNCAALQAFRQ0BCyAALQAAQQRxRQ0BCyAAKAI4EBAgAEEANgI4IAAtAAVFDQELIAAtAABBgAFxRQ0BCyAAKAJUIgEEfyABQQAgARAiEBkgACgCVAVBAAsQBiAAQQA2AlQLC9wMAgl/AX4jAEFAaiIGJAACQAJAAkACQAJAIAEoAjBBABAjIgVBAkZBACABKAI4QQAQIyIEQQFGGw0AIAVBAUZBACAEQQJGGw0AIAVBAkciAw0BIARBAkcNAQsgASABLwEMQYAQcjsBDEEAIQMMAQsgASABLwEMQf/vA3E7AQxBACEFIANFBEBB9eABIAEoAjAgAEEIahBpIgVFDQILIAJBgAJxBEAgBSEDDAELIARBAkcEQCAFIQMMAQtB9cYBIAEoAjggAEEIahBpIgNFBEAgBRAcDAILIAMgBTYCAAsgASABLwEMQf7/A3EgAS8BUiIFQQBHcjsBDAJAAkACQAJAAn8CQAJAIAEpAyhC/v///w9WDQAgASkDIEL+////D1YNACACQYAEcUUNASABKQNIQv////8PVA0BCyAFQYECa0H//wNxQQNJIQdBAQwBCyAFQYECa0H//wNxIQQgAkGACnFBgApHDQEgBEEDSSEHQQALIQkgBkIcEBciBEUEQCAAQQhqIgAEQCAAQQA2AgQgAEEONgIACyADEBwMBQsgAkGACHEhBQJAAkAgAkGAAnEEQAJAIAUNACABKQMgQv////8PVg0AIAEpAyhCgICAgBBUDQMLIAQgASkDKBAYIAEpAyAhDAwBCwJAAkACQCAFDQAgASkDIEL/////D1YNACABKQMoIgxC/////w9WDQEgASkDSEKAgICAEFQNBAsgASkDKCIMQv////8PVA0BCyAEIAwQGAsgASkDICIMQv////8PWgRAIAQgDBAYCyABKQNIIgxC/////w9UDQELIAQgDBAYCyAELQAARQRAIABBCGoiAARAIABBADYCBCAAQRQ2AgALIAQQCCADEBwMBQtBASEKQQEgBC0AAAR+IAQpAxAFQgALp0H//wNxI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AErUIPg4ghHSABIBdrIgYgAjMBAiAaQX8gA3RBf3Otg3ynIgRPDQIgBCAGayIGIBlNDQEgBygCjEdFDQEgB0HR/gA2AgQgAEG5DDYCGAsgASECIAshBQwFCwJAIA5FBEAgDCARIAZraiEDDAELIAYgDk0EQCAMIA4gBmtqIQMMAQsgDCARIAYgDmsiBmtqIQMgBSAGTQ0AIAUgBmshBQJAAkAgASADTSABIA8gAWusIhogBq0iGyAaIBtUGyIapyIGaiICIANLcQ0AIAMgBmogAUsgASADT3ENACABIAMgBhAHGiACIQEMAQsgASADIAMgAWsiASABQR91IgFqIAFzIgIQByACaiEBIBogAq0iHn0iHFANACACIANqIQIDQAJAIBwgHiAcIB5UGyIbQiBUBEAgGyEaDAELIBsiGkIgfSIgQgWIQgF8QgODIh9QRQRAA0AgASACKQAANwAAIAEgAikAGDcAGCABIAIpABA3ABAgASACKQAINwAIIBpCIH0hGiACQSBqIQIgAUEgaiEBIB9CAX0iH0IAUg0ACwsgIELgAFQNAANAIAEgAikAADcAACABIAIpABg3ABggASACKQAQNwAQIAEgAikACDcACCABIAIpADg3ADggASACKQAwNwAwIAEgAikAKDcAKCABIAIpACA3ACAgASACKQBYNwBYIAEgAikAUDcAUCABIAIpAEg3AEggASACKQBANwBAIAEgAikAYDcAYCABIAIpAGg3AGggASACKQBwNwBwIAEgAikAeDcAeCACQYABaiECIAFBgAFqIQEgGkKAAX0iGkIfVg0ACwsgGkIQWgRAIAEgAikAADcAACABIAIpAAg3AAggGkIQfSEaIAJBEGohAiABQRBqIQELIBpCCFoEQCABIAIpAAA3AAAgGkIIfSEaIAJBCGohAiABQQhqIQELIBpCBFoEQCABIAIoAAA2AAAgGkIEfSEaIAJBBGohAiABQQRqIQELIBpCAloEQCABIAIvAAA7AAAgGkICfSEaIAJBAmohAiABQQJqIQELIBwgG30hHCAaUEUEQCABIAItAAA6AAAgAkEBaiECIAFBAWohAQsgHEIAUg0ACwsgDiEGIAwhAwsgBSAGSwRAAkACQCABIANNIA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ohAgwDCyACIAQgAyADQR91IgFqIAFzIgEQByABaiECIBogAa0iHn0iHFANAiABIARqIQEDQAJAIBwgHiAcIB5UGyIbQiBUBEAgGyEaDAELIBsiGkIgfSIgQgWIQgF8QgODIh9QRQRAA0AgAiABKQAANwAAIAIgASkAGDcAGCACIAEpABA3ABAgAiABKQAINwAIIBpCIH0hGiABQSBqIQEgAkEgaiECIB9CAX0iH0IAUg0ACwsgIELgAFQNAANAIAIgASkAADcAACACIAEpABg3ABggAiABKQAQNwAQIAIgASkACDcACCACIAEpADg3ADggAiABKQAwNwAwIAIgASkAKDcAKCACIAEpACA3ACAgAiABKQBYNwBYIAIgASkAUDcAUCACIAEpAEg3AEggAiABKQBANwBAIAIgASkAYDcAYCACIAEpAGg3AGggAiABKQBwNwBwIAIgASkAeDcAeCABQYABaiEBIAJBgAFqIQIgGkKAAX0iGkIfVg0ACwsgGkIQWgRAIAIgASkAADcAACACIAEpAAg3AAggGkIQfSEaIAJBEGohAiABQRBqIQELIBpCCFoEQCACIAEpAAA3AAAgGkIIfSEaIAJBCGohAiABQQhqIQELIBpCBFoEQCACIAEoAAA2AAAgGkIEfSEaIAJBBGohAiABQQRqIQELIBpCAloEQCACIAEvAAA7AAAgGkICfSEaIAJBAmohAiABQQJqIQELIBwgG30hHCAaUEUEQCACIAEtAAA6AAAgAkEBaiECIAFBAWohAQsgHFBFDQALDAILAkAgASADTSABIA8gAWusIhogBa0iGyAaIBtUGyIapyIEaiICIANLcQ0AIAMgBGogAUsgASADT3ENACABIAMgBBAHGgwCCyABIAMgAyABayIBIAFBH3UiAWogAXMiARAHIAFqIQIgGiABrSIefSIcUA0BIAEgA2ohAQNAAkAgHCAeIBwgHlQbIhtCIFQEQCAbIRoMAQsgGyIaQiB9IiBCBYhCAXxCA4MiH1BFBEADQCACIAEpAAA3AAAgAiABKQAYNwAYIAIgASkAEDcAECACIAEpAAg3AAggGkIgfSEaIAFBIGohASACQSBqIQIgH0IBfSIfQgBSDQALCyAgQuAAVA0AA0AgAiABKQAANwAAIAIgASkAGDcAGCACIAEpABA3ABAgAiABKQAINwAIIAIgASkAODcAOCACIAEpADA3ADAgAiABKQAoNwAoIAIgASkAIDcAICACIAEpAFg3AFggAiABKQBQNwBQIAIgASkASDcASCACIAEpAEA3AEAgAiABKQBgNwBgIAIgASkAaDcAaCACIAEpAHA3AHAgAiABKQB4NwB4IAFBgAFqIQEgAkGAAWohAiAaQoABfSIaQh9WDQALCyAaQhBaBEAgAiABKQAANwAAIAIgASkACDcACCAaQhB9IRogAkEQaiECIAFBEGohAQsgGkIIWgRAIAIgASkAADcAACAaQgh9IRogAkEIaiECIAFBCGohAQsgGkIEWgRAIAIgASgAADYAACAaQgR9IRogAkEEaiECIAFBBGohAQsgGkICWgRAIAIgAS8AADsAACAaQgJ9IRogAkECaiECIAFBAmohAQsgHCAbfSEcIBpQRQRAIAIgAS0AADoAACACQQFqIQIgAUEBaiEBCyAcUEUNAAsMAQsCQAJAIBYEQAJAIAQgBUkEQCAHKAKYRyAESw0BCyABIARrIQMCQEEAIARrIgVBf0ogDyABa6wiGiAbIBogG1QbIhqnIgIgBUpxDQAgBUEBSCACIANqIAFLcQ0AIAEgAyACEAcgAmohAgwFCyABIAMgBCAEQR91IgFqIAFzIgEQByABaiECIBogAa0iHn0iHFANBCABIANqIQEDQAJAIBwgHiAcIB5UGyIbQiBUBEAgGyEaDAELIBsiGkIgfSIgQgWIQgF8QgODIh9QRQRAA0AgAiABKQAANwAAIAIgASkAGDcAGCACIAEpABA3ABAgAiABKQAINwAIIBpCIH0hGiABQSBqIQEgAkEgaiECIB9CAX0iH0IAUg0ACwsgIELgAFQNAANAIAIgASkAADcAACACIAEpABg3ABggAiABKQAQNwAQIAIgASkACDcACCACIAEpADg3ADggAiABKQAwNwAwIAIgASkAKDcAKCACIAEpACA3ACAgAiABKQBYNwBYIAIgASkAUDcAUCACIAEpAEg3AEggAiABKQBANwBAIAIgASkAYDcAYCACIAEpAGg3AGggAiABKQBwNwBwIAIgAS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AKIQEgBSEDDAQLIAohASAFIQMMAwsgCiEBIAUhAwwCCyAKIQEgBSEDDAELIAohASAFIQMLAkACQCAGQRdNBEAgA0UNASADQQFrIQUgA0EHcSIEBEADQCABIAItAAA6AAAgA0EBayEDIAFBAWohASACQQFqIQIgBEEBayIEDQALCyAFQQdJDQEDQCABIAItAAA6AAAgASACLQABOgABIAEgAi0AAjoAAiABIAItAAM6AAMgASACLQAEOgAEIAEgAi0ABToABSABIAItAAY6AAYgASACLQAHOgAHIAFBCGohASACQQhqIQIgA0EIayIDDQALDAELIAMNAQsgASECDAELIAEgBCADED8hAgsgCyEFDAELIAEgAy0AAjoAACABQQFqIQILIAUgFE8NACACIBNJDQELCyAAIAI2AgwgACAFIAhBA3ZrIgE2AgAgACATIAJrQYMCajYCECAAIBQgAWtBDmo2AgQgByAIQQdxIgA2AogBIAcgHUJ/IACthkJ/hYM+AoQBC+cFAQR/IAMgAiACIANLGyEEIAAgAWshAgJAIABBB3FFDQAgBEUNACAAIAItAAA6AAAgA0EBayEGIAJBAWohAiAAQQFqIgdBB3FBACAEQQFrIgUbRQRAIAchACAFIQQgBiEDDAELIAAgAi0AADoAASADQQJrIQYgBEECayEFIAJBAWohAgJAIABBAmoiB0EHcUUNACAFRQ0AIAAgAi0AADoAAiADQQNrIQYgBEEDayEFIAJBAWohAgJAIABBA2oiB0EHcUUNACAFRQ0AIAAgAi0AADoAAyADQQRrIQYgBEEEayEFIAJBAWohAgJAIABBBGoiB0EHcUUNACAFRQ0AIAAgAi0AADoABCADQQVrIQYgBEEFayEFIAJBAWohAgJAIABBBWoiB0EHcUUNACAFRQ0AIAAgAi0AADoABSADQQZrIQYgBEEGayEFIAJBAWohAgJAIABBBmoiB0EHcUUNACAFRQ0AIAAgAi0AADoABiADQQdrIQYgBEEHayEFIAJBAWohAgJAIABBB2oiB0EHcUUNACAFRQ0AIAAgAi0AADoAByADQQhrIQMgBEEIayEEIABBCGohACACQQFqIQIMBgsgByEAIAUhBCAGIQMMBQs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wMIIAJBADYCACACQgA3AxAgAkIANwMYIAJCADcDICACQgA3ACUgAFAEQCACDwsCQCAAQv////8AVg0AIACnQQR0EAkiA0UNACACIAM2AgBBACEBQgEhBANAIAMgAUEEdGoiAUIANwIAIAFCADcABSAAIARSBEAgBKchASAEQgF8IQQMAQsLIAIgADcDCCACIAA3AxAgAg8LIAEEQCABQQA2AgQgAUEONgIAC0EAEBAgAhAGQQAL7gECA38BfiMAQRBrIgQkAAJAIARBDGpCBBAXIgNFBEBBfyECDAELAkAgAQRAIAJBgAZxIQUDQAJAIAUgASgCBHFFDQACQCADKQMIQgBUBEAgA0EAOgAADAELIANCADcDECADQQE6AAALIAMgAS8BCBANIAMgAS8BChANIAMtAABFBEAgAEEIaiIABEAgAEEANgIEIABBFDYCAAtBfyECDAQLQX8hAiAAIARBDGpCBBAbQQBIDQMgATMBCiIGUA0AIAAgASgCDCAGEBtBAEgNAwsgASgCACIBDQALC0EAIQILIAMQCAsgBEEQaiQAIAILPAEBfyAABEAgAUGABnEhAQNAIAEgACgCBHEEQCACIAAvAQpqQQRqIQILIAAoAgAiAA0ACwsgAkH//wNxC5wBAQN/IABFBEBBAA8LIAAhAwNAAn8CQAJAIAAvAQgiAUH04AFNBEAgAUEBRg0BIAFB9cYBRg0BDAILIAFBgbICRg0AIAFB9eABRw0BCyAAKAIAIQEgAEEANgIAIAAoAgwQBiAAEAYgASADIAAgA0YbIQMCQCACRQRAQQAhAgwBCyACIAE2AgALIAEMAQsgACICKAIACyIADQALIAMLsgQCBX8BfgJAAkACQCAAIAGtEBciAQRAIAEtAAANAUEAIQAMAgsgBARAIARBADYCBCAEQQ42AgALQQAPC0EAIQADQCABLQAABH4gASkDCCABKQMQfQVCAAtCBFQNASABEAwhByABIAEQDCIGrRATIghFBEBBACECIAQEQCAEQQA2AgQgBEEVNgIACyABEAggAEUNAwNAIAAoAgAhASAAKAIMEAYgABAGIAEiAA0ACwwDCwJAAkBBEBAJIgUEQCAFIAY7AQogBSAHOwEIIA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CyEAIAJBEGokACAAC9oDAQZ/IwBBEGsiBSQAIAUgAjYCDCMAQaABayIEJAAgBEEIakHA8ABBkAEQBxogBCAANgI0IAQgADYCHCAEQX4gAGsiA0H/////ByADQf////8HSRsiBjYCOCAEIAAgBmoiADYCJCAEIAA2AhggBEEIaiEAIwBB0AFrIgMkACADIAI2AswBIANBoAFqQQBBKBAZIAMgAygCzAE2AsgBAkBBACABIANByAFqIANB0ABqIANBoAFqEEpBAEgNACAAKAJMQQBOIQcgACgCACECIAAsAEpBAEwEQCAAIAJBX3E2AgALIAJBIHEhCAJ/IAAoAjAEQCAAIAEgA0HIAWogA0HQAGogA0GgAWoQSgwBCyAAQdAANgIwIAAgA0HQAGo2AhAgACADNgIcIAAgAzYCFCAAKAIsIQIgACADNgIsIAAgASADQcgBaiADQdAAaiADQaABahBKIAJFDQAaIABBAEEAIAAoAiQRAAAaIABBADYCMCAAIAI2AiwgAEEANgIcIABBADYCECAAKAIUGiAAQQA2AhRBAAsaIAAgACgCACAIcjYCACAHRQ0ACyADQdABaiQAIAYEQCAEKAIcIgAgACAEKAIYRmtBADoAAAsgBEGgAWokACAFQRBqJAALUwEDfwJAIAAoAgAsAABBMGtBCk8NAANAIAAoAgAiAiwAACEDIAAgAkEBajYCACABIANqQTBrIQEgAiwAAUEwa0EKTw0BIAFBCmwhAQwACwALIAELuwIAAkAgAUEUSw0AAkACQAJAAkACQAJAAkACQAJAAkAgAUEJaw4KAAECAwQFBgcICQoLIAIgAigCACIBQQRqNgIAIAAgASgCADYCAA8LIAIgAigCACIBQQRqNgIAIAAgATQCADcDAA8LIAIgAigCACIBQQRqNgIAIAAgATUCADcDAA8LIAIgAigCAEEHakF4cSIBQQhqNgIAIAAgASkDADcDAA8LIAIgAigCACIBQQRqNgIAIAAgATIBADcDAA8LIAIgAigCACIBQQRqNgIAIAAgATMBADcDAA8LIAIgAigCACIBQQRqNgIAIAAgATAAADcDAA8LIAIgAigCACIBQQRqNgIAIAAgATEAADcDAA8LIAI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IBggFX0hEyAVQv////8PViAUQv//A1ZyIApyQQFxBEAgBkGZEkEEECwgBkIsEBggBkEtEA0gBkEtEA0gBkEAEBIgBkEAEBIgBiAUEBggBiAUEBggBiATEBggBiAVEBggBkGUEkEEECwgBkEAEBIgBiAYEBggBkEBEBILIAZBnhJBBBAsIAZBABASIAYgFEL//wMgFEL//wNUG6dB//8DcSIBEA0gBiABEA0gBkF/IBOnIBNC/v///w9WGxASIAZBfyAVpyAVQv7///8PVhsQEiAGIABBJEEgIAAtACgbaigCACIDBH8gAy8BBAVBAAtB//8DcRANIAYtAABFBEAgAEEIagRAIABBADYCDCAAQRQ2AggLIAYQCAwCCyAAIAYoAgQgBi0AAAR+IAYpAxAFQgALEBshASAGEAggAUEASA0BIAMEQCAAIAMoAgAgAzMBBBAbQQBIDQILIBMhFwwBCyAAKAIAIQEgAEEIagRAIAAgASgCDDYCCCAAIAEoAhA2AgwLQn8hFwsgEUHwAGokACAXQgBTDQAgACgCABAfQj+HpyECCyALEAYgAkEASA0BAn8gACgCACIBKAIkQQFHBEAgAUEMagRAIAFBADYCECABQRI2AgwLQX8MAQsgASgCICICQQJPBEAgAUEMagRAIAFBADYCECABQR02AgwLQX8MAQsCQCACQQFHDQAgARAaQQBODQBBfwwBCyABQQBCAEEJEA5Cf1cEQCABQQI2AiRBfwwBCyABQQA2AiRBAAtFDQIgACgCACECIAQEQCAEIAIoAgw2AgAgBCACKAIQNgIECwwBCyALEAYLIAAoAlQQfCAAKAIAEENBfyECDAILIAAoAlQQfAsgABBLQQAhAgsgB0HAwABqJAAgAgtFAEHwgwFCADcDAEHogwFCADcDAEHggwFCADcDAEHYgwFCADcDAEHQgwFCADcDAEHIgwFCADcDAEHAgwFCADcDAEHAgwELoQMBCH8jAEGgAWsiAiQAIAAQMQJAAn8CQCAAKAIAIgFBAE4EQCABQbATKAIASA0BCyACIAE2AhAgAkEgakH2ESACQRBqEHZBASEGIAJBIGohBCACQSBqECIhA0EADAELIAFBAnQiAUGwEmooA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FAkACQAJAIAhBAWsOAwADAQILIAFBAToADSABKQMgIgNCf1cEQCABBEAgAUEANgIEIAFBFDYCAAsMBQsgAS0ADkUNBCADIAVWDQQgASADNwMYIAFBAToADyACIAQgA6cQBxogASkDGCEFDAwLIAEtAAwNAyAAIARCgMAAEBEiBkJ/VwRAIAEEQCABIAAoAgw2AgAgASAAKAIQNgIECwwECyAGUARAIAFBAToADCABKAKsQCABKAKoQCgCGBEDACABKQMgQn9VDQEgAUIANwMgDAELAkAgASkDIEIAWQRAIAFBADoADgwBCyABIAY3AyALIAEoAqxAIAQgBiABKAKoQCgCFBEPABoLIAMgBVYNAQwCCwsgASgCAA0AIAEEQCABQQA2AgQgAUEUNgIACwsgBVBFBEAgAUEAOgAOIAEgASkDGCAFfDcDGAwIC0J/QgAgASgCABshBQwHCyABKAKsQCABKAKoQCgCEBEBAK1CAX0hBQwGCyABLQAQBEAgAS0ADQRAIAIgAS0ADwR/QQAFQQggASgCFCIAIABBfUsbCzsBMCACIAEpAxg3AyAgAiACKQMAQsgAhDcDAAwHCyACIAIpAwBCt////w+DNwMADAYLIAJBADsBMCACKQMAIQMgAS0ADQRAIAEpAxghBSACIANCxACENwMAIAIgBTcDGEIAIQUMBgsgAiADQrv///8Pg0LAAIQ3AwAMBQsgAS0ADw0EIAEoAqxAIAEoAqhAKAIIEQEArCEFDAQLIANCCFoEfiACIAEoAgA2AgAgAiABKAIENgIEQggFQn8LIQUMAwsgAUUNAiABKAKsQCABKAKoQCgCBBEDACABEDEgARAGDAILIAdBfzYCAEEQIAcQJEI/hCEFDAELIAEEQCABQQA2AgQgAUEUNgIAC0J/IQULIAdBEGokACAFC2MAQcgAEAkiAEUEQEGEhAEoAgAhASACBEAgAiABNgIEIAJBATYCAAsgAA8LIABBADoADCAAQQA6AAQgACACNgIAIABBADYCOCAAQgA3AzAgACABQQkgAUEBa0EJSRs2AgggAAu3fAIefwZ+IAIpAwAhIiAAIAE2AhwgACAiQv////8PICJC/////w9UGz4CICAAQRB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hAwAkAgBSgCECIEIAYoAhAiASABIARLGyIBRQ0AIAUoAgwgBigCCCABEAcaIAUgBSgCDCABajYCDCAGIAYoAgggAWo2AgggBSAFKAIUIAFqNgIUIAUgBSgCECABazYCECAGIAYoAhAgAWsiATYCECABDQAgBiAGKAIENgIIC0EAIQRBACEJIAMoAhBFDQAMCgsgAygCHCgCJCEGIAMgAygCGCIBQQFqNgIYIAEgBmotAAAhASADIARBAWo2AhAgAygCBCAEaiABOgAAIAEEQCADKAIQIQQMAQsLIAMoAhwoAixFDQAgAygCECIGIAlNDQAgBQJ/IAUoAjAhBEEAIAMoAgQgCWoiAUUNABogBCABIAYgCWtB1IABKAIAEQAACzYCMAsgA0HnADYCIAsCQCADKAIcKAIsBEAgAygCDCADKAIQIgFBAmpJBH8gBRAKIAMoAhANAkEABSABCyADKAIEaiAFKAIwOwAAIAMgAygCEEECajYCECADQaABakHkgAEoAgARAQAaCyADQfEANgIgIAUQCiADKAIQRQ0BDAcLDAYLIAUoAgQNAQsgAygCPA0AIApFDQEgAygCIEGaBUYNAQsCfyADKAKIASIBRQRAIAMgChCFAQwBCwJAAkACQCADKAKMAUECaw4CAAECCwJ/AkADQAJAAkAgAygCPA0AIAMQLyADKAI8DQAgCg0BQQAMBAsgAygCSCADKAJoai0AACEEIAMgAygC8C0iAUEBajYC8C0gASADKALsLWpBADoAACADIAMoAvAtIgFBAWo2AvAtIAEgAygC7C1qQQA6AAAgAyADKALwLSIBQQFqNgLwLSABIAMoAuwtaiAEOgAAIAMgBEECdGoiASABLwHkAUEBajsB5AEgAyADKAI8QQFrNgI8IAMgAygCaEEBaiIBNgJoIAMoAvAtIAMoAvQtRw0BQQAhBCADIAMoAlgiBkEATgR/IAMoAkggBmoFQQALIAEgBmtBABAPIAMgAygCaDYCWCADKAIAEAogAygCACgCEA0BDAILCyADQQA2AoQuIApBBEYEQCADIAMoAlgiAUEATgR/IAMoAkggAWoFQQALIAMoAmggAWtBARAPIAMgAygCaDYCWCADKAIAEApBA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AEaiIENgJoCyADKALwLSADKAL0LUcNAUEAIQggAyADKAJYIgFBAE4EfyADKAJIIAFqBUEACyAEIAFrQQAQDyADIAMoAmg2AlggAygCABAKIAMoAgAoAhANAQwCCwsgA0EANgKELiAKQQRGBEAgAyADKAJYIgFBAE4EfyADKAJIIAFqBUEACyADKAJoIAFrQQEQDyADIAMoAmg2AlggAygCABAKQQNBAiADKAIAKAIQGwwCCyADKALwLQRAQQAhCCADIAMoAlgiAUEATgR/IAMoAkggAWoFQQALIAMoAmggAWtBABAPIAMgAygCaDYCWCADKAIAEAogAygCACgCEEUNAQtBASEICyAICwwBCyADIAogAUEMbEG42ABqKAIAEQIACyIBQX5xQQJGBEAgA0GaBTYCIAsgAUF9cUUEQEEAIQQgBSgCEA0CDAQLIAFBAUcNAAJAAkACQCAKQQFrDgUAAQEBAgELIAMpA5guISICfwJ+IAMoAqAuIgFBA2oiCUE/TQRAQgIgAa2GICKEDAELIAFBwABGBEAgAygCBCADKAIQaiAiNwAAIAMgAygCEEEIajYCEEICISJBCgwCCyADKAIEIAMoAhBqQgIgAa2GICKENwAAIAMgAygCEEEIajYCECABQT1rIQlCAkHAACABa62ICyEiIAlBB2ogCUE5SQ0AGiADKAIEIAMoAhBqICI3AAAgAyADKAIQQQhqNgIQQgAhIiAJQTlrCyEBIAMgIjcDmC4gAyABNgKgLiADEDAMAQsgA0EAQQBBABA5IApBA0cNACADKAJQQQBBgIAIEBkgAygCPA0AIANBADYChC4gA0EANgJYIANBADYCaAsgBRAKIAUoAhANAAwDC0EAIQQgCkEERw0AAkACfwJAAkAgAygCFEEBaw4CAQADCyAFIANBoAFqQeCAASgCABEBACIBNgIwIAMoAgQgAygCEGogATYAACADIAMoAhBBBGoiATYCECADKAIEIAFqIQQgBSgCCAwBCyADKAIEIAMoAhBqIQQgBSgCMCIBQRh0IAFBCHRBgID8B3FyIAFBCHZBgP4DcSABQRh2cnILIQEgBCABNgAAIAMgAygCEEEEajYCEAsgBRAKIAMoAhQiAUEB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BgIACNgLoLSABQQA2AkAgASADNgJQIAEgAigCICACKAIoQYCAAkEEECgiAzYCBCABIAEoAugtIgRBAnQ2AgwCQAJAIAEoAkhFDQAgASgCTEUNACABKAJQRQ0AIAMNAQsgAUGaBTYCICACQejAACgCADYCGCACEIQBGkF8DAILIAFBADYCjAEgASAFNgKIASABQgA3AyggASADIARqNgLsLSABIARBA2xBA2s2AvQtQX4hAwJAIAJFDQAgAigCIEUNACACKAIkRQ0AIAIoAhwiAUUNACABKAIAIAJHDQACQAJAIAEoAiAiBEE5aw45AQICAgICAgICAgICAQICAgECAgICAgICAgICAgICAgICAgECAgICAgICAgICAgECAgICAgICAgIBAAsgBEGaBUYNACAEQSpHDQELIAJBAjYCLCACQQA2AgggAkIANwIUIAFBADYCECABIAEoAgQ2AgggASgCFCIDQX9MBEAgAUEAIANrIgM2AhQLIAFBOUEqIANBAkYbNgIgIAIgA0ECRgR/IAFBoAFqQeSAASgCABEBAAVBAQs2AjAgAUF+NgIkIAFBADYCoC4gAUIANwOYLiABQYgXakGg0wA2AgAgASABQcwVajYCgBcgAUH8FmpBjNMANgIAIAEgAUHYE2o2AvQWIAFB8BZqQfjSADYCACABIAFB5AFqNgLoFiABEIgBQQAhAwsgAw0AIAIoAhwiAiACKAIwQQF0NgJEQQAhAyACKAJQQQBBgIAIEBkgAiACKAKIASIEQQxsIgFBtNgAai8BADYClAEgAiABQbDYAGovAQA2ApABIAIgAUGy2ABqLwEANgJ4IAIgAUG22ABqLwEANgJ0QfiAASgCACEFQeyAASgCACEGQYCBASgCACEBIAJCADcCbCACQgA3AmQgAkEANgI8IAJBADYChC4gAkIANwJUIAJBKSABIARBCUYiARs2AnwgAkEqIAYgARs2AoABIAJBKyAFIAEbNgKEAQsgAwsFQXoLDAELAn9BekHrDC0AAEExRw0AGkF+IAJFDQAaIAJBADYCGCACKAIgIgNFBEAgAkEANgIoIAJBJzYCIEEnIQMLIAIoAiRFBEAgAkEoNgIkC0F8IAMgAigCKEEBQaDHABAo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ACwwOCyABQgA3AwAgACgCECIBBEACQCABKAIoIgpFBEAgASkDGCEEDAELIApBADYCKCABKAIoQgA3AyAgASABKQMYIgIgASkDICIFIAIgBVYbIgQ3AxgLIAEpAwggBFYEQANAIAEoAgAgBKdBBHRqKAIAEAYgBEIBfCIEIAEpAwhUDQALCyABKAIAEAYgASgCBBAGIAEQBgsgACADNgIQQgAhBAwNCyAAKAIUIgEEQAJAIAEoAigiA0UEQCABKQMYIQIMAQsgA0EANgIoIAEoAihCADcDICABIAEpAxgiAiABKQMgIgUgAiAFVhsiAjcDGAsgASkDCCACVgRAA0AgASgCACACp0EEdGooAgAQBiACQgF8IgIgASkDCFQNAAsLIAEoAgAQBiABKAIEEAYgARAGCyAAQQA2AhQMDAsgACgCECIDKQM4IAMpAzAgASACIAAQRCIHQgBTDQogAyAHNwM4AkAgAykDCCIGQgF9IgJQDQAgAygCBCEAA0ACQCAHIAAgAiAEfUIBiCAEfCIFp0EDdGopAwBUBEAgBUIBfSECDAELIAUgBlEEQCAGIQUMAwsgACAFQgF8IgSnQQN0aikDACAHVg0CCyAEIQUgAiAEVg0ACwsgAyAFNwNAQgAhBAwLCyAAKAIUIgMpAzggAykDMCABIAIgABBEIgdCAFMNCSADIAc3AzgCQCADKQMIIgZCAX0iAlANACADKAIEIQADQAJAIAcgACACIAR9QgGIIAR8IgWnQQN0aikDAFQEQCAFQgF9IQIMAQsgBSAGUQRAIAYhBQwDCyAAIAVCAXwiBKdBA3RqKQMAIAdWDQILIAQhBSACIARWDQALCyADIAU3A0BCACEEDAoLIAJCN1gEQCAABEAgAEEANgIEIABBEjYCAAsMCQsgARAqIAEgACgCDDYCKCAAKAIQKQMwIQIgAUEANgIwIAEgAjcDICABIAI3AxggAULcATcDAEI4IQQMCQsgACABKAIANgIMDAgLIAtBQGtBfzYCACALQouAgICwAjcDOCALQoyAgIDQATcDMCALQo+AgICgATcDKCALQpGAgICQATcDICALQoeAgICAATcDGCALQoWAgIDgADcDECALQoOAgIDAADcDC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QbCDAQsQ/////////////////////w=="; - if (!isDataURI(wasmBinaryFile)) { - wasmBinaryFile = locateFile(wasmBinaryFile); - } - function getBinary(file) { - try { - if (file == wasmBinaryFile && wasmBinary) { - return new Uint8Array(wasmBinary); - } - var binary = tryParseAsDataURI(file); - if (binary) { - return binary; - } - if (readBinary) { - return readBinary(file); - } else { - throw "sync fetching of the wasm failed: you can preload it to Module['wasmBinary'] manually, or emcc.py will do that for you when generating HTML (but not JS)"; - } - } catch (err2) { - abort(err2); - } - } - function instantiateSync(file, info) { - var instance; - var module2; - var binary; - try { - binary = getBinary(file); - module2 = new WebAssembly.Module(binary); - instance = new WebAssembly.Instance(module2, info); - } catch (e) { - var str = e.toString(); - err("failed to compile wasm module: " + str); - if (str.includes("imported Memory") || str.includes("memory import")) { - err( - "Memory size incompatibility issues may be due to changing INITIAL_MEMORY at runtime to something too large. Use ALLOW_MEMORY_GROWTH to allow any size memory (and also make sure not to set INITIAL_MEMORY at runtime to something smaller than it was at compile time)." - ); - } - throw e; - } - return [instance, module2]; - } - function createWasm() { - var info = { a: asmLibraryArg }; - function receiveInstance(instance, module2) { - var exports3 = instance.exports; - Module["asm"] = exports3; - wasmMemory = Module["asm"]["g"]; - updateGlobalBufferAndViews(wasmMemory.buffer); - wasmTable = Module["asm"]["W"]; - addOnInit(Module["asm"]["h"]); - removeRunDependency(); - } - addRunDependency(); - if (Module["instantiateWasm"]) { - try { - var exports2 = Module["instantiateWasm"](info, receiveInstance); - return exports2; - } catch (e) { - err("Module.instantiateWasm callback failed with error: " + e); - return false; - } - } - var result = instantiateSync(wasmBinaryFile, info); - receiveInstance(result[0]); - return Module["asm"]; - } - function LE_HEAP_LOAD_F32(byteOffset) { - return HEAP_DATA_VIEW.getFloat32(byteOffset, true); - } - function LE_HEAP_LOAD_F64(byteOffset) { - return HEAP_DATA_VIEW.getFloat64(byteOffset, true); - } - function LE_HEAP_LOAD_I16(byteOffset) { - return HEAP_DATA_VIEW.getInt16(byteOffset, true); - } - function LE_HEAP_LOAD_I32(byteOffset) { - return HEAP_DATA_VIEW.getInt32(byteOffset, true); - } - function LE_HEAP_STORE_I32(byteOffset, value) { - HEAP_DATA_VIEW.setInt32(byteOffset, value, true); - } - function callRuntimeCallbacks(callbacks) { - while (callbacks.length > 0) { - var callback = callbacks.shift(); - if (typeof callback == "function") { - callback(Module); - continue; - } - var func = callback.func; - if (typeof func === "number") { - if (callback.arg === void 0) { - wasmTable.get(func)(); - } else { - wasmTable.get(func)(callback.arg); - } - } else { - func(callback.arg === void 0 ? null : callback.arg); - } - } - } - function _gmtime_r(time, tmPtr) { - var date = new Date(LE_HEAP_LOAD_I32((time >> 2) * 4) * 1e3); - LE_HEAP_STORE_I32((tmPtr >> 2) * 4, date.getUTCSeconds()); - LE_HEAP_STORE_I32((tmPtr + 4 >> 2) * 4, date.getUTCMinutes()); - LE_HEAP_STORE_I32((tmPtr + 8 >> 2) * 4, date.getUTCHours()); - LE_HEAP_STORE_I32((tmPtr + 12 >> 2) * 4, date.getUTCDate()); - LE_HEAP_STORE_I32((tmPtr + 16 >> 2) * 4, date.getUTCMonth()); - LE_HEAP_STORE_I32((tmPtr + 20 >> 2) * 4, date.getUTCFullYear() - 1900); - LE_HEAP_STORE_I32((tmPtr + 24 >> 2) * 4, date.getUTCDay()); - LE_HEAP_STORE_I32((tmPtr + 36 >> 2) * 4, 0); - LE_HEAP_STORE_I32((tmPtr + 32 >> 2) * 4, 0); - var start = Date.UTC(date.getUTCFullYear(), 0, 1, 0, 0, 0, 0); - var yday = (date.getTime() - start) / (1e3 * 60 * 60 * 24) | 0; - LE_HEAP_STORE_I32((tmPtr + 28 >> 2) * 4, yday); - if (!_gmtime_r.GMTString) - _gmtime_r.GMTString = allocateUTF8("GMT"); - LE_HEAP_STORE_I32((tmPtr + 40 >> 2) * 4, _gmtime_r.GMTString); - return tmPtr; - } - function ___gmtime_r(a0, a1) { - return _gmtime_r(a0, a1); - } - function _emscripten_memcpy_big(dest, src, num) { - HEAPU8.copyWithin(dest, src, src + num); - } - function emscripten_realloc_buffer(size) { - try { - wasmMemory.grow(size - buffer.byteLength + 65535 >>> 16); - updateGlobalBufferAndViews(wasmMemory.buffer); - return 1; - } catch (e) { - } - } - function _emscripten_resize_heap(requestedSize) { - var oldSize = HEAPU8.length; - requestedSize = requestedSize >>> 0; - var maxHeapSize = 2147483648; - if (requestedSize > maxHeapSize) { - return false; - } - for (var cutDown = 1; cutDown <= 4; cutDown *= 2) { - var overGrownHeapSize = oldSize * (1 + 0.2 / cutDown); - overGrownHeapSize = Math.min( - overGrownHeapSize, - requestedSize + 100663296 - ); - var newSize = Math.min( - maxHeapSize, - alignUp(Math.max(requestedSize, overGrownHeapSize), 65536) - ); - var replacement = emscripten_realloc_buffer(newSize); - if (replacement) { - return true; - } - } - return false; - } - function _setTempRet0(val) { - } - function _time(ptr) { - var ret = Date.now() / 1e3 | 0; - if (ptr) { - LE_HEAP_STORE_I32((ptr >> 2) * 4, ret); - } - return ret; - } - function _tzset() { - if (_tzset.called) - return; - _tzset.called = true; - var currentYear = new Date().getFullYear(); - var winter = new Date(currentYear, 0, 1); - var summer = new Date(currentYear, 6, 1); - var winterOffset = winter.getTimezoneOffset(); - var summerOffset = summer.getTimezoneOffset(); - var stdTimezoneOffset = Math.max(winterOffset, summerOffset); - LE_HEAP_STORE_I32((__get_timezone() >> 2) * 4, stdTimezoneOffset * 60); - LE_HEAP_STORE_I32( - (__get_daylight() >> 2) * 4, - Number(winterOffset != summerOffset) - ); - function extractZone(date) { - var match = date.toTimeString().match(/\(([A-Za-z ]+)\)$/); - return match ? match[1] : "GMT"; - } - var winterName = extractZone(winter); - var summerName = extractZone(summer); - var winterNamePtr = allocateUTF8(winterName); - var summerNamePtr = allocateUTF8(summerName); - if (summerOffset < winterOffset) { - LE_HEAP_STORE_I32((__get_tzname() >> 2) * 4, winterNamePtr); - LE_HEAP_STORE_I32((__get_tzname() + 4 >> 2) * 4, summerNamePtr); - } else { - LE_HEAP_STORE_I32((__get_tzname() >> 2) * 4, summerNamePtr); - LE_HEAP_STORE_I32((__get_tzname() + 4 >> 2) * 4, winterNamePtr); - } - } - function _timegm(tmPtr) { - _tzset(); - var time = Date.UTC( - LE_HEAP_LOAD_I32((tmPtr + 20 >> 2) * 4) + 1900, - LE_HEAP_LOAD_I32((tmPtr + 16 >> 2) * 4), - LE_HEAP_LOAD_I32((tmPtr + 12 >> 2) * 4), - LE_HEAP_LOAD_I32((tmPtr + 8 >> 2) * 4), - LE_HEAP_LOAD_I32((tmPtr + 4 >> 2) * 4), - LE_HEAP_LOAD_I32((tmPtr >> 2) * 4), - 0 - ); - var date = new Date(time); - LE_HEAP_STORE_I32((tmPtr + 24 >> 2) * 4, date.getUTCDay()); - var start = Date.UTC(date.getUTCFullYear(), 0, 1, 0, 0, 0, 0); - var yday = (date.getTime() - start) / (1e3 * 60 * 60 * 24) | 0; - LE_HEAP_STORE_I32((tmPtr + 28 >> 2) * 4, yday); - return date.getTime() / 1e3 | 0; - } - function intArrayFromBase64(s) { - { - var buf; - try { - buf = Buffer.from(s, "base64"); - } catch (_) { - buf = new Buffer(s, "base64"); - } - return new Uint8Array( - buf["buffer"], - buf["byteOffset"], - buf["byteLength"] - ); - } - } - function tryParseAsDataURI(filename) { - if (!isDataURI(filename)) { - return; - } - return intArrayFromBase64(filename.slice(dataURIPrefix.length)); - } - var asmLibraryArg = { - e: ___gmtime_r, - c: _emscripten_memcpy_big, - d: _emscripten_resize_heap, - a: _setTempRet0, - b: _time, - f: _timegm - }; - var asm = createWasm(); - Module["___wasm_call_ctors"] = asm["h"]; - Module["_zip_ext_count_symlinks"] = asm["i"]; - Module["_zip_file_get_external_attributes"] = asm["j"]; - Module["_zipstruct_statS"] = asm["k"]; - Module["_zipstruct_stat_size"] = asm["l"]; - Module["_zipstruct_stat_mtime"] = asm["m"]; - Module["_zipstruct_stat_crc"] = asm["n"]; - Module["_zipstruct_errorS"] = asm["o"]; - Module["_zipstruct_error_code_zip"] = asm["p"]; - Module["_zipstruct_stat_comp_size"] = asm["q"]; - Module["_zipstruct_stat_comp_method"] = asm["r"]; - Module["_zip_close"] = asm["s"]; - Module["_zip_delete"] = asm["t"]; - Module["_zip_dir_add"] = asm["u"]; - Module["_zip_discard"] = asm["v"]; - Module["_zip_error_init_with_code"] = asm["w"]; - Module["_zip_get_error"] = asm["x"]; - Module["_zip_file_get_error"] = asm["y"]; - Module["_zip_error_strerror"] = asm["z"]; - Module["_zip_fclose"] = asm["A"]; - Module["_zip_file_add"] = asm["B"]; - Module["_free"] = asm["C"]; - var _malloc = Module["_malloc"] = asm["D"]; - Module["_zip_source_error"] = asm["E"]; - Module["_zip_source_seek"] = asm["F"]; - Module["_zip_file_set_external_attributes"] = asm["G"]; - Module["_zip_file_set_mtime"] = asm["H"]; - Module["_zip_fopen_index"] = asm["I"]; - Module["_zip_fread"] = asm["J"]; - Module["_zip_get_name"] = asm["K"]; - Module["_zip_get_num_entries"] = asm["L"]; - Module["_zip_source_read"] = asm["M"]; - Module["_zip_name_locate"] = asm["N"]; - Module["_zip_open_from_source"] = asm["O"]; - Module["_zip_set_file_compression"] = asm["P"]; - Module["_zip_source_buffer"] = asm["Q"]; - Module["_zip_source_buffer_create"] = asm["R"]; - Module["_zip_source_close"] = asm["S"]; - Module["_zip_source_free"] = asm["T"]; - Module["_zip_source_keep"] = asm["U"]; - Module["_zip_source_open"] = asm["V"]; - Module["_zip_source_tell"] = asm["X"]; - Module["_zip_stat_index"] = asm["Y"]; - var __get_tzname = Module["__get_tzname"] = asm["Z"]; - var __get_daylight = Module["__get_daylight"] = asm["_"]; - var __get_timezone = Module["__get_timezone"] = asm["$"]; - var stackSave = Module["stackSave"] = asm["aa"]; - var stackRestore = Module["stackRestore"] = asm["ba"]; - var stackAlloc = Module["stackAlloc"] = asm["ca"]; - Module["cwrap"] = cwrap; - Module["getValue"] = getValue; - var calledRun; - dependenciesFulfilled = function runCaller() { - if (!calledRun) - run(); - if (!calledRun) - dependenciesFulfilled = runCaller; - }; - function run(args) { - if (runDependencies > 0) { - return; - } - preRun(); - if (runDependencies > 0) { - return; - } - function doRun() { - if (calledRun) - return; - calledRun = true; - Module["calledRun"] = true; - if (ABORT) - return; - initRuntime(); - readyPromiseResolve(Module); - if (Module["onRuntimeInitialized"]) - Module["onRuntimeInitialized"](); - postRun(); - } - if (Module["setStatus"]) { - Module["setStatus"]("Running..."); - setTimeout(function() { - setTimeout(function() { - Module["setStatus"](""); - }, 1); - doRun(); - }, 1); - } else { - doRun(); - } - } - Module["run"] = run; - if (Module["preInit"]) { - if (typeof Module["preInit"] == "function") - Module["preInit"] = [Module["preInit"]]; - while (Module["preInit"].length > 0) { - Module["preInit"].pop()(); - } - } - run(); - return createModule2; - }; -}(); -module.exports = createModule; -}(libzipSync)); - -const createModule = libzipSync.exports; - -const number64 = [ - `number`, - `number` -]; -var Errors = /* @__PURE__ */ ((Errors2) => { - Errors2[Errors2["ZIP_ER_OK"] = 0] = "ZIP_ER_OK"; - Errors2[Errors2["ZIP_ER_MULTIDISK"] = 1] = "ZIP_ER_MULTIDISK"; - Errors2[Errors2["ZIP_ER_RENAME"] = 2] = "ZIP_ER_RENAME"; - Errors2[Errors2["ZIP_ER_CLOSE"] = 3] = "ZIP_ER_CLOSE"; - Errors2[Errors2["ZIP_ER_SEEK"] = 4] = "ZIP_ER_SEEK"; - Errors2[Errors2["ZIP_ER_READ"] = 5] = "ZIP_ER_READ"; - Errors2[Errors2["ZIP_ER_WRITE"] = 6] = "ZIP_ER_WRITE"; - Errors2[Errors2["ZIP_ER_CRC"] = 7] = "ZIP_ER_CRC"; - Errors2[Errors2["ZIP_ER_ZIPCLOSED"] = 8] = "ZIP_ER_ZIPCLOSED"; - Errors2[Errors2["ZIP_ER_NOENT"] = 9] = "ZIP_ER_NOENT"; - Errors2[Errors2["ZIP_ER_EXISTS"] = 10] = "ZIP_ER_EXISTS"; - Errors2[Errors2["ZIP_ER_OPEN"] = 11] = "ZIP_ER_OPEN"; - Errors2[Errors2["ZIP_ER_TMPOPEN"] = 12] = "ZIP_ER_TMPOPEN"; - Errors2[Errors2["ZIP_ER_ZLIB"] = 13] = "ZIP_ER_ZLIB"; - Errors2[Errors2["ZIP_ER_MEMORY"] = 14] = "ZIP_ER_MEMORY"; - Errors2[Errors2["ZIP_ER_CHANGED"] = 15] = "ZIP_ER_CHANGED"; - Errors2[Errors2["ZIP_ER_COMPNOTSUPP"] = 16] = "ZIP_ER_COMPNOTSUPP"; - Errors2[Errors2["ZIP_ER_EOF"] = 17] = "ZIP_ER_EOF"; - Errors2[Errors2["ZIP_ER_INVAL"] = 18] = "ZIP_ER_INVAL"; - Errors2[Errors2["ZIP_ER_NOZIP"] = 19] = "ZIP_ER_NOZIP"; - Errors2[Errors2["ZIP_ER_INTERNAL"] = 20] = "ZIP_ER_INTERNAL"; - Errors2[Errors2["ZIP_ER_INCONS"] = 21] = "ZIP_ER_INCONS"; - Errors2[Errors2["ZIP_ER_REMOVE"] = 22] = "ZIP_ER_REMOVE"; - Errors2[Errors2["ZIP_ER_DELETED"] = 23] = "ZIP_ER_DELETED"; - Errors2[Errors2["ZIP_ER_ENCRNOTSUPP"] = 24] = "ZIP_ER_ENCRNOTSUPP"; - Errors2[Errors2["ZIP_ER_RDONLY"] = 25] = "ZIP_ER_RDONLY"; - Errors2[Errors2["ZIP_ER_NOPASSWD"] = 26] = "ZIP_ER_NOPASSWD"; - Errors2[Errors2["ZIP_ER_WRONGPASSWD"] = 27] = "ZIP_ER_WRONGPASSWD"; - Errors2[Errors2["ZIP_ER_OPNOTSUPP"] = 28] = "ZIP_ER_OPNOTSUPP"; - Errors2[Errors2["ZIP_ER_INUSE"] = 29] = "ZIP_ER_INUSE"; - Errors2[Errors2["ZIP_ER_TELL"] = 30] = "ZIP_ER_TELL"; - Errors2[Errors2["ZIP_ER_COMPRESSED_DATA"] = 31] = "ZIP_ER_COMPRESSED_DATA"; - return Errors2; -})(Errors || {}); -const makeInterface = (emZip) => ({ - get HEAPU8() { - return emZip.HEAPU8; - }, - errors: Errors, - SEEK_SET: 0, - SEEK_CUR: 1, - SEEK_END: 2, - ZIP_CHECKCONS: 4, - ZIP_EXCL: 2, - ZIP_RDONLY: 16, - ZIP_FL_OVERWRITE: 8192, - ZIP_FL_COMPRESSED: 4, - ZIP_OPSYS_DOS: 0, - ZIP_OPSYS_AMIGA: 1, - ZIP_OPSYS_OPENVMS: 2, - ZIP_OPSYS_UNIX: 3, - ZIP_OPSYS_VM_CMS: 4, - ZIP_OPSYS_ATARI_ST: 5, - ZIP_OPSYS_OS_2: 6, - ZIP_OPSYS_MACINTOSH: 7, - ZIP_OPSYS_Z_SYSTEM: 8, - ZIP_OPSYS_CPM: 9, - ZIP_OPSYS_WINDOWS_NTFS: 10, - ZIP_OPSYS_MVS: 11, - ZIP_OPSYS_VSE: 12, - ZIP_OPSYS_ACORN_RISC: 13, - ZIP_OPSYS_VFAT: 14, - ZIP_OPSYS_ALTERNATE_MVS: 15, - ZIP_OPSYS_BEOS: 16, - ZIP_OPSYS_TANDEM: 17, - ZIP_OPSYS_OS_400: 18, - ZIP_OPSYS_OS_X: 19, - ZIP_CM_DEFAULT: -1, - ZIP_CM_STORE: 0, - ZIP_CM_DEFLATE: 8, - uint08S: emZip._malloc(1), - uint32S: emZip._malloc(4), - malloc: emZip._malloc, - free: emZip._free, - getValue: emZip.getValue, - openFromSource: emZip.cwrap(`zip_open_from_source`, `number`, [`number`, `number`, `number`]), - close: emZip.cwrap(`zip_close`, `number`, [`number`]), - discard: emZip.cwrap(`zip_discard`, null, [`number`]), - getError: emZip.cwrap(`zip_get_error`, `number`, [`number`]), - getName: emZip.cwrap(`zip_get_name`, `string`, [`number`, `number`, `number`]), - getNumEntries: emZip.cwrap(`zip_get_num_entries`, `number`, [`number`, `number`]), - delete: emZip.cwrap(`zip_delete`, `number`, [`number`, `number`]), - statIndex: emZip.cwrap(`zip_stat_index`, `number`, [`number`, ...number64, `number`, `number`]), - fopenIndex: emZip.cwrap(`zip_fopen_index`, `number`, [`number`, ...number64, `number`]), - fread: emZip.cwrap(`zip_fread`, `number`, [`number`, `number`, `number`, `number`]), - fclose: emZip.cwrap(`zip_fclose`, `number`, [`number`]), - dir: { - add: emZip.cwrap(`zip_dir_add`, `number`, [`number`, `string`]) - }, - file: { - add: emZip.cwrap(`zip_file_add`, `number`, [`number`, `string`, `number`, `number`]), - getError: emZip.cwrap(`zip_file_get_error`, `number`, [`number`]), - getExternalAttributes: emZip.cwrap(`zip_file_get_external_attributes`, `number`, [`number`, ...number64, `number`, `number`, `number`]), - setExternalAttributes: emZip.cwrap(`zip_file_set_external_attributes`, `number`, [`number`, ...number64, `number`, `number`, `number`]), - setMtime: emZip.cwrap(`zip_file_set_mtime`, `number`, [`number`, ...number64, `number`, `number`]), - setCompression: emZip.cwrap(`zip_set_file_compression`, `number`, [`number`, ...number64, `number`, `number`]) - }, - ext: { - countSymlinks: emZip.cwrap(`zip_ext_count_symlinks`, `number`, [`number`]) - }, - error: { - initWithCode: emZip.cwrap(`zip_error_init_with_code`, null, [`number`, `number`]), - strerror: emZip.cwrap(`zip_error_strerror`, `string`, [`number`]) - }, - name: { - locate: emZip.cwrap(`zip_name_locate`, `number`, [`number`, `string`, `number`]) - }, - source: { - fromUnattachedBuffer: emZip.cwrap(`zip_source_buffer_create`, `number`, [`number`, ...number64, `number`, `number`]), - fromBuffer: emZip.cwrap(`zip_source_buffer`, `number`, [`number`, `number`, ...number64, `number`]), - free: emZip.cwrap(`zip_source_free`, null, [`number`]), - keep: emZip.cwrap(`zip_source_keep`, null, [`number`]), - open: emZip.cwrap(`zip_source_open`, `number`, [`number`]), - close: emZip.cwrap(`zip_source_close`, `number`, [`number`]), - seek: emZip.cwrap(`zip_source_seek`, `number`, [`number`, ...number64, `number`]), - tell: emZip.cwrap(`zip_source_tell`, `number`, [`number`]), - read: emZip.cwrap(`zip_source_read`, `number`, [`number`, `number`, `number`]), - error: emZip.cwrap(`zip_source_error`, `number`, [`number`]) - }, - struct: { - statS: emZip.cwrap(`zipstruct_statS`, `number`, []), - statSize: emZip.cwrap(`zipstruct_stat_size`, `number`, [`number`]), - statCompSize: emZip.cwrap(`zipstruct_stat_comp_size`, `number`, [`number`]), - statCompMethod: emZip.cwrap(`zipstruct_stat_comp_method`, `number`, [`number`]), - statMtime: emZip.cwrap(`zipstruct_stat_mtime`, `number`, [`number`]), - statCrc: emZip.cwrap(`zipstruct_stat_crc`, `number`, [`number`]), - errorS: emZip.cwrap(`zipstruct_errorS`, `number`, []), - errorCodeZip: emZip.cwrap(`zipstruct_error_code_zip`, `number`, [`number`]) - } -}); - -function getArchivePart(path, extension) { - let idx = path.indexOf(extension); - if (idx <= 0) - return null; - let nextCharIdx = idx; - while (idx >= 0) { - nextCharIdx = idx + extension.length; - if (path[nextCharIdx] === ppath.sep) - break; - if (path[idx - 1] === ppath.sep) - return null; - idx = path.indexOf(extension, nextCharIdx); - } - if (path.length > nextCharIdx && path[nextCharIdx] !== ppath.sep) - return null; - return path.slice(0, nextCharIdx); -} -class ZipOpenFS extends MountFS { - static async openPromise(fn, opts) { - const zipOpenFs = new ZipOpenFS(opts); - try { - return await fn(zipOpenFs); - } finally { - zipOpenFs.saveAndClose(); - } - } - constructor(opts = {}) { - const fileExtensions = opts.fileExtensions; - const readOnlyArchives = opts.readOnlyArchives; - const getMountPoint = typeof fileExtensions === `undefined` ? (path) => getArchivePart(path, `.zip`) : (path) => { - for (const extension of fileExtensions) { - const result = getArchivePart(path, extension); - if (result) { - return result; - } - } - return null; - }; - const factorySync = (baseFs, p) => { - return new ZipFS(p, { - baseFs, - readOnly: readOnlyArchives, - stats: baseFs.statSync(p) - }); - }; - const factoryPromise = async (baseFs, p) => { - const zipOptions = { - baseFs, - readOnly: readOnlyArchives, - stats: await baseFs.statPromise(p) - }; - return () => { - return new ZipFS(p, zipOptions); - }; - }; - super({ - ...opts, - factorySync, - factoryPromise, - getMountPoint - }); - } -} - -const DEFAULT_COMPRESSION_LEVEL = `mixed`; -function toUnixTimestamp(time) { - if (typeof time === `string` && String(+time) === time) - return +time; - if (typeof time === `number` && Number.isFinite(time)) { - if (time < 0) { - return Date.now() / 1e3; - } else { - return time; - } - } - if (nodeUtils.types.isDate(time)) - return time.getTime() / 1e3; - throw new Error(`Invalid time`); -} -function makeEmptyArchive() { - return Buffer.from([ - 80, - 75, - 5, - 6, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0 - ]); -} -class LibzipError extends Error { - constructor(message, code) { - super(message); - this.name = `Libzip Error`; - this.code = code; - } -} -class ZipFS extends BasePortableFakeFS { - constructor(source, opts = {}) { - super(); - this.listings = /* @__PURE__ */ new Map(); - this.entries = /* @__PURE__ */ new Map(); - this.fileSources = /* @__PURE__ */ new Map(); - this.fds = /* @__PURE__ */ new Map(); - this.nextFd = 0; - this.ready = false; - this.readOnly = false; - const pathOptions = opts; - this.level = typeof pathOptions.level !== `undefined` ? pathOptions.level : DEFAULT_COMPRESSION_LEVEL; - source ??= makeEmptyArchive(); - if (typeof source === `string`) { - const { baseFs = new NodeFS() } = pathOptions; - this.baseFs = baseFs; - this.path = source; - } else { - this.path = null; - this.baseFs = null; - } - if (opts.stats) { - this.stats = opts.stats; - } else { - if (typeof source === `string`) { - try { - this.stats = this.baseFs.statSync(source); - } catch (error) { - if (error.code === `ENOENT` && pathOptions.create) { - this.stats = makeDefaultStats(); - } else { - throw error; - } - } - } else { - this.stats = makeDefaultStats(); - } - } - this.libzip = getInstance(); - const errPtr = this.libzip.malloc(4); - try { - let flags = 0; - if (opts.readOnly) { - flags |= this.libzip.ZIP_RDONLY; - this.readOnly = true; - } - if (typeof source === `string`) - source = pathOptions.create ? makeEmptyArchive() : this.baseFs.readFileSync(source); - const lzSource = this.allocateUnattachedSource(source); - try { - this.zip = this.libzip.openFromSource(lzSource, flags, errPtr); - this.lzSource = lzSource; - } catch (error) { - this.libzip.source.free(lzSource); - throw error; - } - if (this.zip === 0) { - const error = this.libzip.struct.errorS(); - this.libzip.error.initWithCode(error, this.libzip.getValue(errPtr, `i32`)); - throw this.makeLibzipError(error); - } - } finally { - this.libzip.free(errPtr); - } - this.listings.set(PortablePath.root, /* @__PURE__ */ new Set()); - const entryCount = this.libzip.getNumEntries(this.zip, 0); - for (let t = 0; t < entryCount; ++t) { - const raw = this.libzip.getName(this.zip, t, 0); - if (ppath.isAbsolute(raw)) - continue; - const p = ppath.resolve(PortablePath.root, raw); - this.registerEntry(p, t); - if (raw.endsWith(`/`)) { - this.registerListing(p); - } - } - this.symlinkCount = this.libzip.ext.countSymlinks(this.zip); - if (this.symlinkCount === -1) - throw this.makeLibzipError(this.libzip.getError(this.zip)); - this.ready = true; - } - makeLibzipError(error) { - const errorCode = this.libzip.struct.errorCodeZip(error); - const strerror = this.libzip.error.strerror(error); - const libzipError = new LibzipError(strerror, this.libzip.errors[errorCode]); - if (errorCode === this.libzip.errors.ZIP_ER_CHANGED) - throw new Error(`Assertion failed: Unexpected libzip error: ${libzipError.message}`); - return libzipError; - } - getExtractHint(hints) { - for (const fileName of this.entries.keys()) { - const ext = this.pathUtils.extname(fileName); - if (hints.relevantExtensions.has(ext)) { - return true; - } - } - return false; - } - getAllFiles() { - return Array.from(this.entries.keys()); - } - getRealPath() { - if (!this.path) - throw new Error(`ZipFS don't have real paths when loaded from a buffer`); - return this.path; - } - prepareClose() { - if (!this.ready) - throw EBUSY(`archive closed, close`); - unwatchAllFiles(this); - } - getBufferAndClose() { - this.prepareClose(); - if (this.entries.size === 0) { - this.discardAndClose(); - return makeEmptyArchive(); - } - try { - this.libzip.source.keep(this.lzSource); - if (this.libzip.close(this.zip) === -1) - throw this.makeLibzipError(this.libzip.getError(this.zip)); - if (this.libzip.source.open(this.lzSource) === -1) - throw this.makeLibzipError(this.libzip.source.error(this.lzSource)); - if (this.libzip.source.seek(this.lzSource, 0, 0, this.libzip.SEEK_END) === -1) - throw this.makeLibzipError(this.libzip.source.error(this.lzSource)); - const size = this.libzip.source.tell(this.lzSource); - if (size === -1) - throw this.makeLibzipError(this.libzip.source.error(this.lzSource)); - if (this.libzip.source.seek(this.lzSource, 0, 0, this.libzip.SEEK_SET) === -1) - throw this.makeLibzipError(this.libzip.source.error(this.lzSource)); - const buffer = this.libzip.malloc(size); - if (!buffer) - throw new Error(`Couldn't allocate enough memory`); - try { - const rc = this.libzip.source.read(this.lzSource, buffer, size); - if (rc === -1) - throw this.makeLibzipError(this.libzip.source.error(this.lzSource)); - else if (rc < size) - throw new Error(`Incomplete read`); - else if (rc > size) - throw new Error(`Overread`); - let result = Buffer.from(this.libzip.HEAPU8.subarray(buffer, buffer + size)); - if (process.env.YARN_IS_TEST_ENV && process.env.YARN_ZIP_DATA_EPILOGUE) - result = Buffer.concat([result, Buffer.from(process.env.YARN_ZIP_DATA_EPILOGUE)]); - return result; - } finally { - this.libzip.free(buffer); - } - } finally { - this.libzip.source.close(this.lzSource); - this.libzip.source.free(this.lzSource); - this.ready = false; - } - } - discardAndClose() { - this.prepareClose(); - this.libzip.discard(this.zip); - this.ready = false; - } - saveAndClose() { - if (!this.path || !this.baseFs) - throw new Error(`ZipFS cannot be saved and must be discarded when loaded from a buffer`); - if (this.readOnly) { - this.discardAndClose(); - return; - } - const newMode = this.baseFs.existsSync(this.path) || this.stats.mode === DEFAULT_MODE ? void 0 : this.stats.mode; - this.baseFs.writeFileSync(this.path, this.getBufferAndClose(), { mode: newMode }); - this.ready = false; - } - resolve(p) { - return ppath.resolve(PortablePath.root, p); - } - async openPromise(p, flags, mode) { - return this.openSync(p, flags, mode); - } - openSync(p, flags, mode) { - const fd = this.nextFd++; - this.fds.set(fd, { cursor: 0, p }); - return fd; - } - hasOpenFileHandles() { - return !!this.fds.size; - } - async opendirPromise(p, opts) { - return this.opendirSync(p, opts); - } - opendirSync(p, opts = {}) { - const resolvedP = this.resolveFilename(`opendir '${p}'`, p); - if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) - throw ENOENT(`opendir '${p}'`); - const directoryListing = this.listings.get(resolvedP); - if (!directoryListing) - throw ENOTDIR(`opendir '${p}'`); - const entries = [...directoryListing]; - const fd = this.openSync(resolvedP, `r`); - const onClose = () => { - this.closeSync(fd); - }; - return opendir(this, resolvedP, entries, { onClose }); - } - async readPromise(fd, buffer, offset, length, position) { - return this.readSync(fd, buffer, offset, length, position); - } - readSync(fd, buffer, offset = 0, length = buffer.byteLength, position = -1) { - const entry = this.fds.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`read`); - const realPosition = position === -1 || position === null ? entry.cursor : position; - const source = this.readFileSync(entry.p); - source.copy(buffer, offset, realPosition, realPosition + length); - const bytesRead = Math.max(0, Math.min(source.length - realPosition, length)); - if (position === -1 || position === null) - entry.cursor += bytesRead; - return bytesRead; - } - async writePromise(fd, buffer, offset, length, position) { - if (typeof buffer === `string`) { - return this.writeSync(fd, buffer, position); - } else { - return this.writeSync(fd, buffer, offset, length, position); - } - } - writeSync(fd, buffer, offset, length, position) { - const entry = this.fds.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`read`); - throw new Error(`Unimplemented`); - } - async closePromise(fd) { - return this.closeSync(fd); - } - closeSync(fd) { - const entry = this.fds.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`read`); - this.fds.delete(fd); - } - createReadStream(p, { encoding } = {}) { - if (p === null) - throw new Error(`Unimplemented`); - const fd = this.openSync(p, `r`); - const stream$1 = Object.assign( - new stream.PassThrough({ - emitClose: true, - autoDestroy: true, - destroy: (error, callback) => { - clearImmediate(immediate); - this.closeSync(fd); - callback(error); - } - }), - { - close() { - stream$1.destroy(); - }, - bytesRead: 0, - path: p, - pending: false - } - ); - const immediate = setImmediate(async () => { - try { - const data = await this.readFilePromise(p, encoding); - stream$1.bytesRead = data.length; - stream$1.end(data); - } catch (error) { - stream$1.destroy(error); - } - }); - return stream$1; - } - createWriteStream(p, { encoding } = {}) { - if (this.readOnly) - throw EROFS(`open '${p}'`); - if (p === null) - throw new Error(`Unimplemented`); - const chunks = []; - const fd = this.openSync(p, `w`); - const stream$1 = Object.assign( - new stream.PassThrough({ - autoDestroy: true, - emitClose: true, - destroy: (error, callback) => { - try { - if (error) { - callback(error); - } else { - this.writeFileSync(p, Buffer.concat(chunks), encoding); - callback(null); - } - } catch (err) { - callback(err); - } finally { - this.closeSync(fd); - } - } - }), - { - close() { - stream$1.destroy(); - }, - bytesWritten: 0, - path: p, - pending: false - } - ); - stream$1.on(`data`, (chunk) => { - const chunkBuffer = Buffer.from(chunk); - stream$1.bytesWritten += chunkBuffer.length; - chunks.push(chunkBuffer); - }); - return stream$1; - } - async realpathPromise(p) { - return this.realpathSync(p); - } - realpathSync(p) { - const resolvedP = this.resolveFilename(`lstat '${p}'`, p); - if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) - throw ENOENT(`lstat '${p}'`); - return resolvedP; - } - async existsPromise(p) { - return this.existsSync(p); - } - existsSync(p) { - if (!this.ready) - throw EBUSY(`archive closed, existsSync '${p}'`); - if (this.symlinkCount === 0) { - const resolvedP2 = ppath.resolve(PortablePath.root, p); - return this.entries.has(resolvedP2) || this.listings.has(resolvedP2); - } - let resolvedP; - try { - resolvedP = this.resolveFilename(`stat '${p}'`, p, void 0, false); - } catch (error) { - return false; - } - if (resolvedP === void 0) - return false; - return this.entries.has(resolvedP) || this.listings.has(resolvedP); - } - async accessPromise(p, mode) { - return this.accessSync(p, mode); - } - accessSync(p, mode = fs.constants.F_OK) { - const resolvedP = this.resolveFilename(`access '${p}'`, p); - if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) - throw ENOENT(`access '${p}'`); - if (this.readOnly && mode & fs.constants.W_OK) { - throw EROFS(`access '${p}'`); - } - } - async statPromise(p, opts = { bigint: false }) { - if (opts.bigint) - return this.statSync(p, { bigint: true }); - return this.statSync(p); - } - statSync(p, opts = { bigint: false, throwIfNoEntry: true }) { - const resolvedP = this.resolveFilename(`stat '${p}'`, p, void 0, opts.throwIfNoEntry); - if (resolvedP === void 0) - return void 0; - if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) { - if (opts.throwIfNoEntry === false) - return void 0; - throw ENOENT(`stat '${p}'`); - } - if (p[p.length - 1] === `/` && !this.listings.has(resolvedP)) - throw ENOTDIR(`stat '${p}'`); - return this.statImpl(`stat '${p}'`, resolvedP, opts); - } - async fstatPromise(fd, opts) { - return this.fstatSync(fd, opts); - } - fstatSync(fd, opts) { - const entry = this.fds.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`fstatSync`); - const { p } = entry; - const resolvedP = this.resolveFilename(`stat '${p}'`, p); - if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) - throw ENOENT(`stat '${p}'`); - if (p[p.length - 1] === `/` && !this.listings.has(resolvedP)) - throw ENOTDIR(`stat '${p}'`); - return this.statImpl(`fstat '${p}'`, resolvedP, opts); - } - async lstatPromise(p, opts = { bigint: false }) { - if (opts.bigint) - return this.lstatSync(p, { bigint: true }); - return this.lstatSync(p); - } - lstatSync(p, opts = { bigint: false, throwIfNoEntry: true }) { - const resolvedP = this.resolveFilename(`lstat '${p}'`, p, false, opts.throwIfNoEntry); - if (resolvedP === void 0) - return void 0; - if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) { - if (opts.throwIfNoEntry === false) - return void 0; - throw ENOENT(`lstat '${p}'`); - } - if (p[p.length - 1] === `/` && !this.listings.has(resolvedP)) - throw ENOTDIR(`lstat '${p}'`); - return this.statImpl(`lstat '${p}'`, resolvedP, opts); - } - statImpl(reason, p, opts = {}) { - const entry = this.entries.get(p); - if (typeof entry !== `undefined`) { - const stat = this.libzip.struct.statS(); - const rc = this.libzip.statIndex(this.zip, entry, 0, 0, stat); - if (rc === -1) - throw this.makeLibzipError(this.libzip.getError(this.zip)); - const uid = this.stats.uid; - const gid = this.stats.gid; - const size = this.libzip.struct.statSize(stat) >>> 0; - const blksize = 512; - const blocks = Math.ceil(size / blksize); - const mtimeMs = (this.libzip.struct.statMtime(stat) >>> 0) * 1e3; - const atimeMs = mtimeMs; - const birthtimeMs = mtimeMs; - const ctimeMs = mtimeMs; - const atime = new Date(atimeMs); - const birthtime = new Date(birthtimeMs); - const ctime = new Date(ctimeMs); - const mtime = new Date(mtimeMs); - const type = this.listings.has(p) ? fs.constants.S_IFDIR : this.isSymbolicLink(entry) ? fs.constants.S_IFLNK : fs.constants.S_IFREG; - const defaultMode = type === fs.constants.S_IFDIR ? 493 : 420; - const mode = type | this.getUnixMode(entry, defaultMode) & 511; - const crc = this.libzip.struct.statCrc(stat); - const statInstance = Object.assign(new StatEntry(), { uid, gid, size, blksize, blocks, atime, birthtime, ctime, mtime, atimeMs, birthtimeMs, ctimeMs, mtimeMs, mode, crc }); - return opts.bigint === true ? convertToBigIntStats(statInstance) : statInstance; - } - if (this.listings.has(p)) { - const uid = this.stats.uid; - const gid = this.stats.gid; - const size = 0; - const blksize = 512; - const blocks = 0; - const atimeMs = this.stats.mtimeMs; - const birthtimeMs = this.stats.mtimeMs; - const ctimeMs = this.stats.mtimeMs; - const mtimeMs = this.stats.mtimeMs; - const atime = new Date(atimeMs); - const birthtime = new Date(birthtimeMs); - const ctime = new Date(ctimeMs); - const mtime = new Date(mtimeMs); - const mode = fs.constants.S_IFDIR | 493; - const crc = 0; - const statInstance = Object.assign(new StatEntry(), { uid, gid, size, blksize, blocks, atime, birthtime, ctime, mtime, atimeMs, birthtimeMs, ctimeMs, mtimeMs, mode, crc }); - return opts.bigint === true ? convertToBigIntStats(statInstance) : statInstance; - } - throw new Error(`Unreachable`); - } - getUnixMode(index, defaultMode) { - const rc = this.libzip.file.getExternalAttributes(this.zip, index, 0, 0, this.libzip.uint08S, this.libzip.uint32S); - if (rc === -1) - throw this.makeLibzipError(this.libzip.getError(this.zip)); - const opsys = this.libzip.getValue(this.libzip.uint08S, `i8`) >>> 0; - if (opsys !== this.libzip.ZIP_OPSYS_UNIX) - return defaultMode; - return this.libzip.getValue(this.libzip.uint32S, `i32`) >>> 16; - } - registerListing(p) { - const existingListing = this.listings.get(p); - if (existingListing) - return existingListing; - const parentListing = this.registerListing(ppath.dirname(p)); - parentListing.add(ppath.basename(p)); - const newListing = /* @__PURE__ */ new Set(); - this.listings.set(p, newListing); - return newListing; - } - registerEntry(p, index) { - const parentListing = this.registerListing(ppath.dirname(p)); - parentListing.add(ppath.basename(p)); - this.entries.set(p, index); - } - unregisterListing(p) { - this.listings.delete(p); - const parentListing = this.listings.get(ppath.dirname(p)); - parentListing?.delete(ppath.basename(p)); - } - unregisterEntry(p) { - this.unregisterListing(p); - const entry = this.entries.get(p); - this.entries.delete(p); - if (typeof entry === `undefined`) - return; - this.fileSources.delete(entry); - if (this.isSymbolicLink(entry)) { - this.symlinkCount--; - } - } - deleteEntry(p, index) { - this.unregisterEntry(p); - const rc = this.libzip.delete(this.zip, index); - if (rc === -1) { - throw this.makeLibzipError(this.libzip.getError(this.zip)); - } - } - resolveFilename(reason, p, resolveLastComponent = true, throwIfNoEntry = true) { - if (!this.ready) - throw EBUSY(`archive closed, ${reason}`); - let resolvedP = ppath.resolve(PortablePath.root, p); - if (resolvedP === `/`) - return PortablePath.root; - const fileIndex = this.entries.get(resolvedP); - if (resolveLastComponent && fileIndex !== void 0) { - if (this.symlinkCount !== 0 && this.isSymbolicLink(fileIndex)) { - const target = this.getFileSource(fileIndex).toString(); - return this.resolveFilename(reason, ppath.resolve(ppath.dirname(resolvedP), target), true, throwIfNoEntry); - } else { - return resolvedP; - } - } - while (true) { - const parentP = this.resolveFilename(reason, ppath.dirname(resolvedP), true, throwIfNoEntry); - if (parentP === void 0) - return parentP; - const isDir = this.listings.has(parentP); - const doesExist = this.entries.has(parentP); - if (!isDir && !doesExist) { - if (throwIfNoEntry === false) - return void 0; - throw ENOENT(reason); - } - if (!isDir) - throw ENOTDIR(reason); - resolvedP = ppath.resolve(parentP, ppath.basename(resolvedP)); - if (!resolveLastComponent || this.symlinkCount === 0) - break; - const index = this.libzip.name.locate(this.zip, resolvedP.slice(1), 0); - if (index === -1) - break; - if (this.isSymbolicLink(index)) { - const target = this.getFileSource(index).toString(); - resolvedP = ppath.resolve(ppath.dirname(resolvedP), target); - } else { - break; - } - } - return resolvedP; - } - allocateBuffer(content) { - if (!Buffer.isBuffer(content)) - content = Buffer.from(content); - const buffer = this.libzip.malloc(content.byteLength); - if (!buffer) - throw new Error(`Couldn't allocate enough memory`); - const heap = new Uint8Array(this.libzip.HEAPU8.buffer, buffer, content.byteLength); - heap.set(content); - return { buffer, byteLength: content.byteLength }; - } - allocateUnattachedSource(content) { - const error = this.libzip.struct.errorS(); - const { buffer, byteLength } = this.allocateBuffer(content); - const source = this.libzip.source.fromUnattachedBuffer(buffer, byteLength, 0, 1, error); - if (source === 0) { - this.libzip.free(error); - throw this.makeLibzipError(error); - } - return source; - } - allocateSource(content) { - const { buffer, byteLength } = this.allocateBuffer(content); - const source = this.libzip.source.fromBuffer(this.zip, buffer, byteLength, 0, 1); - if (source === 0) { - this.libzip.free(buffer); - throw this.makeLibzipError(this.libzip.getError(this.zip)); - } - return source; - } - setFileSource(p, content) { - const buffer = Buffer.isBuffer(content) ? content : Buffer.from(content); - const target = ppath.relative(PortablePath.root, p); - const lzSource = this.allocateSource(content); - try { - const newIndex = this.libzip.file.add(this.zip, target, lzSource, this.libzip.ZIP_FL_OVERWRITE); - if (newIndex === -1) - throw this.makeLibzipError(this.libzip.getError(this.zip)); - if (this.level !== `mixed`) { - const method = this.level === 0 ? this.libzip.ZIP_CM_STORE : this.libzip.ZIP_CM_DEFLATE; - const rc = this.libzip.file.setCompression(this.zip, newIndex, 0, method, this.level); - if (rc === -1) { - throw this.makeLibzipError(this.libzip.getError(this.zip)); - } - } - this.fileSources.set(newIndex, buffer); - return newIndex; - } catch (error) { - this.libzip.source.free(lzSource); - throw error; - } - } - isSymbolicLink(index) { - if (this.symlinkCount === 0) - return false; - const attrs = this.libzip.file.getExternalAttributes(this.zip, index, 0, 0, this.libzip.uint08S, this.libzip.uint32S); - if (attrs === -1) - throw this.makeLibzipError(this.libzip.getError(this.zip)); - const opsys = this.libzip.getValue(this.libzip.uint08S, `i8`) >>> 0; - if (opsys !== this.libzip.ZIP_OPSYS_UNIX) - return false; - const attributes = this.libzip.getValue(this.libzip.uint32S, `i32`) >>> 16; - return (attributes & fs.constants.S_IFMT) === fs.constants.S_IFLNK; - } - getFileSource(index, opts = { asyncDecompress: false }) { - const cachedFileSource = this.fileSources.get(index); - if (typeof cachedFileSource !== `undefined`) - return cachedFileSource; - const stat = this.libzip.struct.statS(); - const rc = this.libzip.statIndex(this.zip, index, 0, 0, stat); - if (rc === -1) - throw this.makeLibzipError(this.libzip.getError(this.zip)); - const size = this.libzip.struct.statCompSize(stat); - const compressionMethod = this.libzip.struct.statCompMethod(stat); - const buffer = this.libzip.malloc(size); - try { - const file = this.libzip.fopenIndex(this.zip, index, 0, this.libzip.ZIP_FL_COMPRESSED); - if (file === 0) - throw this.makeLibzipError(this.libzip.getError(this.zip)); - try { - const rc2 = this.libzip.fread(file, buffer, size, 0); - if (rc2 === -1) - throw this.makeLibzipError(this.libzip.file.getError(file)); - else if (rc2 < size) - throw new Error(`Incomplete read`); - else if (rc2 > size) - throw new Error(`Overread`); - const memory = this.libzip.HEAPU8.subarray(buffer, buffer + size); - const data = Buffer.from(memory); - if (compressionMethod === 0) { - this.fileSources.set(index, data); - return data; - } else if (opts.asyncDecompress) { - return new Promise((resolve, reject) => { - zlib__default.default.inflateRaw(data, (error, result) => { - if (error) { - reject(error); - } else { - this.fileSources.set(index, result); - resolve(result); - } - }); - }); - } else { - const decompressedData = zlib__default.default.inflateRawSync(data); - this.fileSources.set(index, decompressedData); - return decompressedData; - } - } finally { - this.libzip.fclose(file); - } - } finally { - this.libzip.free(buffer); - } - } - async fchmodPromise(fd, mask) { - return this.chmodPromise(this.fdToPath(fd, `fchmod`), mask); - } - fchmodSync(fd, mask) { - return this.chmodSync(this.fdToPath(fd, `fchmodSync`), mask); - } - async chmodPromise(p, mask) { - return this.chmodSync(p, mask); - } - chmodSync(p, mask) { - if (this.readOnly) - throw EROFS(`chmod '${p}'`); - mask &= 493; - const resolvedP = this.resolveFilename(`chmod '${p}'`, p, false); - const entry = this.entries.get(resolvedP); - if (typeof entry === `undefined`) - throw new Error(`Assertion failed: The entry should have been registered (${resolvedP})`); - const oldMod = this.getUnixMode(entry, fs.constants.S_IFREG | 0); - const newMod = oldMod & ~511 | mask; - const rc = this.libzip.file.setExternalAttributes(this.zip, entry, 0, 0, this.libzip.ZIP_OPSYS_UNIX, newMod << 16); - if (rc === -1) { - throw this.makeLibzipError(this.libzip.getError(this.zip)); - } - } - async fchownPromise(fd, uid, gid) { - return this.chownPromise(this.fdToPath(fd, `fchown`), uid, gid); - } - fchownSync(fd, uid, gid) { - return this.chownSync(this.fdToPath(fd, `fchownSync`), uid, gid); - } - async chownPromise(p, uid, gid) { - return this.chownSync(p, uid, gid); - } - chownSync(p, uid, gid) { - throw new Error(`Unimplemented`); - } - async renamePromise(oldP, newP) { - return this.renameSync(oldP, newP); - } - renameSync(oldP, newP) { - throw new Error(`Unimplemented`); - } - async copyFilePromise(sourceP, destP, flags) { - const { indexSource, indexDest, resolvedDestP } = this.prepareCopyFile(sourceP, destP, flags); - const source = await this.getFileSource(indexSource, { asyncDecompress: true }); - const newIndex = this.setFileSource(resolvedDestP, source); - if (newIndex !== indexDest) { - this.registerEntry(resolvedDestP, newIndex); - } - } - copyFileSync(sourceP, destP, flags = 0) { - const { indexSource, indexDest, resolvedDestP } = this.prepareCopyFile(sourceP, destP, flags); - const source = this.getFileSource(indexSource); - const newIndex = this.setFileSource(resolvedDestP, source); - if (newIndex !== indexDest) { - this.registerEntry(resolvedDestP, newIndex); - } - } - prepareCopyFile(sourceP, destP, flags = 0) { - if (this.readOnly) - throw EROFS(`copyfile '${sourceP} -> '${destP}'`); - if ((flags & fs.constants.COPYFILE_FICLONE_FORCE) !== 0) - throw ENOSYS(`unsupported clone operation`, `copyfile '${sourceP}' -> ${destP}'`); - const resolvedSourceP = this.resolveFilename(`copyfile '${sourceP} -> ${destP}'`, sourceP); - const indexSource = this.entries.get(resolvedSourceP); - if (typeof indexSource === `undefined`) - throw EINVAL(`copyfile '${sourceP}' -> '${destP}'`); - const resolvedDestP = this.resolveFilename(`copyfile '${sourceP}' -> ${destP}'`, destP); - const indexDest = this.entries.get(resolvedDestP); - if ((flags & (fs.constants.COPYFILE_EXCL | fs.constants.COPYFILE_FICLONE_FORCE)) !== 0 && typeof indexDest !== `undefined`) - throw EEXIST(`copyfile '${sourceP}' -> '${destP}'`); - return { - indexSource, - resolvedDestP, - indexDest - }; - } - async appendFilePromise(p, content, opts) { - if (this.readOnly) - throw EROFS(`open '${p}'`); - if (typeof opts === `undefined`) - opts = { flag: `a` }; - else if (typeof opts === `string`) - opts = { flag: `a`, encoding: opts }; - else if (typeof opts.flag === `undefined`) - opts = { flag: `a`, ...opts }; - return this.writeFilePromise(p, content, opts); - } - appendFileSync(p, content, opts = {}) { - if (this.readOnly) - throw EROFS(`open '${p}'`); - if (typeof opts === `undefined`) - opts = { flag: `a` }; - else if (typeof opts === `string`) - opts = { flag: `a`, encoding: opts }; - else if (typeof opts.flag === `undefined`) - opts = { flag: `a`, ...opts }; - return this.writeFileSync(p, content, opts); - } - fdToPath(fd, reason) { - const path = this.fds.get(fd)?.p; - if (typeof path === `undefined`) - throw EBADF(reason); - return path; - } - async writeFilePromise(p, content, opts) { - const { encoding, mode, index, resolvedP } = this.prepareWriteFile(p, opts); - if (index !== void 0 && typeof opts === `object` && opts.flag && opts.flag.includes(`a`)) - content = Buffer.concat([await this.getFileSource(index, { asyncDecompress: true }), Buffer.from(content)]); - if (encoding !== null) - content = content.toString(encoding); - const newIndex = this.setFileSource(resolvedP, content); - if (newIndex !== index) - this.registerEntry(resolvedP, newIndex); - if (mode !== null) { - await this.chmodPromise(resolvedP, mode); - } - } - writeFileSync(p, content, opts) { - const { encoding, mode, index, resolvedP } = this.prepareWriteFile(p, opts); - if (index !== void 0 && typeof opts === `object` && opts.flag && opts.flag.includes(`a`)) - content = Buffer.concat([this.getFileSource(index), Buffer.from(content)]); - if (encoding !== null) - content = content.toString(encoding); - const newIndex = this.setFileSource(resolvedP, content); - if (newIndex !== index) - this.registerEntry(resolvedP, newIndex); - if (mode !== null) { - this.chmodSync(resolvedP, mode); - } - } - prepareWriteFile(p, opts) { - if (typeof p === `number`) - p = this.fdToPath(p, `read`); - if (this.readOnly) - throw EROFS(`open '${p}'`); - const resolvedP = this.resolveFilename(`open '${p}'`, p); - if (this.listings.has(resolvedP)) - throw EISDIR(`open '${p}'`); - let encoding = null, mode = null; - if (typeof opts === `string`) { - encoding = opts; - } else if (typeof opts === `object`) { - ({ - encoding = null, - mode = null - } = opts); - } - const index = this.entries.get(resolvedP); - return { - encoding, - mode, - resolvedP, - index - }; - } - async unlinkPromise(p) { - return this.unlinkSync(p); - } - unlinkSync(p) { - if (this.readOnly) - throw EROFS(`unlink '${p}'`); - const resolvedP = this.resolveFilename(`unlink '${p}'`, p); - if (this.listings.has(resolvedP)) - throw EISDIR(`unlink '${p}'`); - const index = this.entries.get(resolvedP); - if (typeof index === `undefined`) - throw EINVAL(`unlink '${p}'`); - this.deleteEntry(resolvedP, index); - } - async utimesPromise(p, atime, mtime) { - return this.utimesSync(p, atime, mtime); - } - utimesSync(p, atime, mtime) { - if (this.readOnly) - throw EROFS(`utimes '${p}'`); - const resolvedP = this.resolveFilename(`utimes '${p}'`, p); - this.utimesImpl(resolvedP, mtime); - } - async lutimesPromise(p, atime, mtime) { - return this.lutimesSync(p, atime, mtime); - } - lutimesSync(p, atime, mtime) { - if (this.readOnly) - throw EROFS(`lutimes '${p}'`); - const resolvedP = this.resolveFilename(`utimes '${p}'`, p, false); - this.utimesImpl(resolvedP, mtime); - } - utimesImpl(resolvedP, mtime) { - if (this.listings.has(resolvedP)) { - if (!this.entries.has(resolvedP)) - this.hydrateDirectory(resolvedP); - } - const entry = this.entries.get(resolvedP); - if (entry === void 0) - throw new Error(`Unreachable`); - const rc = this.libzip.file.setMtime(this.zip, entry, 0, toUnixTimestamp(mtime), 0); - if (rc === -1) { - throw this.makeLibzipError(this.libzip.getError(this.zip)); - } - } - async mkdirPromise(p, opts) { - return this.mkdirSync(p, opts); - } - mkdirSync(p, { mode = 493, recursive = false } = {}) { - if (recursive) - return this.mkdirpSync(p, { chmod: mode }); - if (this.readOnly) - throw EROFS(`mkdir '${p}'`); - const resolvedP = this.resolveFilename(`mkdir '${p}'`, p); - if (this.entries.has(resolvedP) || this.listings.has(resolvedP)) - throw EEXIST(`mkdir '${p}'`); - this.hydrateDirectory(resolvedP); - this.chmodSync(resolvedP, mode); - return void 0; - } - async rmdirPromise(p, opts) { - return this.rmdirSync(p, opts); - } - rmdirSync(p, { recursive = false } = {}) { - if (this.readOnly) - throw EROFS(`rmdir '${p}'`); - if (recursive) { - this.removeSync(p); - return; - } - const resolvedP = this.resolveFilename(`rmdir '${p}'`, p); - const directoryListing = this.listings.get(resolvedP); - if (!directoryListing) - throw ENOTDIR(`rmdir '${p}'`); - if (directoryListing.size > 0) - throw ENOTEMPTY(`rmdir '${p}'`); - const index = this.entries.get(resolvedP); - if (typeof index === `undefined`) - throw EINVAL(`rmdir '${p}'`); - this.deleteEntry(p, index); - } - async rmPromise(p, opts) { - return this.rmSync(p, opts); - } - rmSync(p, { recursive = false } = {}) { - if (this.readOnly) - throw EROFS(`rm '${p}'`); - if (recursive) { - this.removeSync(p); - return; - } - const resolvedP = this.resolveFilename(`rm '${p}'`, p); - const directoryListing = this.listings.get(resolvedP); - if (!directoryListing) - throw ENOTDIR(`rm '${p}'`); - if (directoryListing.size > 0) - throw ENOTEMPTY(`rm '${p}'`); - const index = this.entries.get(resolvedP); - if (typeof index === `undefined`) - throw EINVAL(`rm '${p}'`); - this.deleteEntry(p, index); - } - hydrateDirectory(resolvedP) { - const index = this.libzip.dir.add(this.zip, ppath.relative(PortablePath.root, resolvedP)); - if (index === -1) - throw this.makeLibzipError(this.libzip.getError(this.zip)); - this.registerListing(resolvedP); - this.registerEntry(resolvedP, index); - return index; - } - async linkPromise(existingP, newP) { - return this.linkSync(existingP, newP); - } - linkSync(existingP, newP) { - throw EOPNOTSUPP(`link '${existingP}' -> '${newP}'`); - } - async symlinkPromise(target, p) { - return this.symlinkSync(target, p); - } - symlinkSync(target, p) { - if (this.readOnly) - throw EROFS(`symlink '${target}' -> '${p}'`); - const resolvedP = this.resolveFilename(`symlink '${target}' -> '${p}'`, p); - if (this.listings.has(resolvedP)) - throw EISDIR(`symlink '${target}' -> '${p}'`); - if (this.entries.has(resolvedP)) - throw EEXIST(`symlink '${target}' -> '${p}'`); - const index = this.setFileSource(resolvedP, target); - this.registerEntry(resolvedP, index); - const rc = this.libzip.file.setExternalAttributes(this.zip, index, 0, 0, this.libzip.ZIP_OPSYS_UNIX, (fs.constants.S_IFLNK | 511) << 16); - if (rc === -1) - throw this.makeLibzipError(this.libzip.getError(this.zip)); - this.symlinkCount += 1; - } - async readFilePromise(p, encoding) { - if (typeof encoding === `object`) - encoding = encoding ? encoding.encoding : void 0; - const data = await this.readFileBuffer(p, { asyncDecompress: true }); - return encoding ? data.toString(encoding) : data; - } - readFileSync(p, encoding) { - if (typeof encoding === `object`) - encoding = encoding ? encoding.encoding : void 0; - const data = this.readFileBuffer(p); - return encoding ? data.toString(encoding) : data; - } - readFileBuffer(p, opts = { asyncDecompress: false }) { - if (typeof p === `number`) - p = this.fdToPath(p, `read`); - const resolvedP = this.resolveFilename(`open '${p}'`, p); - if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) - throw ENOENT(`open '${p}'`); - if (p[p.length - 1] === `/` && !this.listings.has(resolvedP)) - throw ENOTDIR(`open '${p}'`); - if (this.listings.has(resolvedP)) - throw EISDIR(`read`); - const entry = this.entries.get(resolvedP); - if (entry === void 0) - throw new Error(`Unreachable`); - return this.getFileSource(entry, opts); - } - async readdirPromise(p, opts) { - return this.readdirSync(p, opts); - } - readdirSync(p, opts) { - const resolvedP = this.resolveFilename(`scandir '${p}'`, p); - if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) - throw ENOENT(`scandir '${p}'`); - const directoryListing = this.listings.get(resolvedP); - if (!directoryListing) - throw ENOTDIR(`scandir '${p}'`); - if (opts?.recursive) { - if (opts?.withFileTypes) { - const entries = Array.from(directoryListing, (name) => { - return Object.assign(this.statImpl(`lstat`, ppath.join(p, name)), { - name, - path: PortablePath.dot - }); - }); - for (const entry of entries) { - if (!entry.isDirectory()) - continue; - const subPath = ppath.join(entry.path, entry.name); - const subListing = this.listings.get(ppath.join(resolvedP, subPath)); - for (const child of subListing) { - entries.push(Object.assign(this.statImpl(`lstat`, ppath.join(p, subPath, child)), { - name: child, - path: subPath - })); - } - } - return entries; - } else { - const entries = [...directoryListing]; - for (const subPath of entries) { - const subListing = this.listings.get(ppath.join(resolvedP, subPath)); - if (typeof subListing === `undefined`) - continue; - for (const child of subListing) { - entries.push(ppath.join(subPath, child)); - } - } - return entries; - } - } else if (opts?.withFileTypes) { - return Array.from(directoryListing, (name) => { - return Object.assign(this.statImpl(`lstat`, ppath.join(p, name)), { - name, - path: void 0 - }); - }); - } else { - return [...directoryListing]; - } - } - async readlinkPromise(p) { - const entry = this.prepareReadlink(p); - return (await this.getFileSource(entry, { asyncDecompress: true })).toString(); - } - readlinkSync(p) { - const entry = this.prepareReadlink(p); - return this.getFileSource(entry).toString(); - } - prepareReadlink(p) { - const resolvedP = this.resolveFilename(`readlink '${p}'`, p, false); - if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) - throw ENOENT(`readlink '${p}'`); - if (p[p.length - 1] === `/` && !this.listings.has(resolvedP)) - throw ENOTDIR(`open '${p}'`); - if (this.listings.has(resolvedP)) - throw EINVAL(`readlink '${p}'`); - const entry = this.entries.get(resolvedP); - if (entry === void 0) - throw new Error(`Unreachable`); - if (!this.isSymbolicLink(entry)) - throw EINVAL(`readlink '${p}'`); - return entry; - } - async truncatePromise(p, len = 0) { - const resolvedP = this.resolveFilename(`open '${p}'`, p); - const index = this.entries.get(resolvedP); - if (typeof index === `undefined`) - throw EINVAL(`open '${p}'`); - const source = await this.getFileSource(index, { asyncDecompress: true }); - const truncated = Buffer.alloc(len, 0); - source.copy(truncated); - return await this.writeFilePromise(p, truncated); - } - truncateSync(p, len = 0) { - const resolvedP = this.resolveFilename(`open '${p}'`, p); - const index = this.entries.get(resolvedP); - if (typeof index === `undefined`) - throw EINVAL(`open '${p}'`); - const source = this.getFileSource(index); - const truncated = Buffer.alloc(len, 0); - source.copy(truncated); - return this.writeFileSync(p, truncated); - } - async ftruncatePromise(fd, len) { - return this.truncatePromise(this.fdToPath(fd, `ftruncate`), len); - } - ftruncateSync(fd, len) { - return this.truncateSync(this.fdToPath(fd, `ftruncateSync`), len); - } - watch(p, a, b) { - let persistent; - switch (typeof a) { - case `function`: - case `string`: - case `undefined`: - { - persistent = true; - } - break; - default: - { - ({ persistent = true } = a); - } - break; - } - if (!persistent) - return { on: () => { - }, close: () => { - } }; - const interval = setInterval(() => { - }, 24 * 60 * 60 * 1e3); - return { on: () => { - }, close: () => { - clearInterval(interval); - } }; - } - watchFile(p, a, b) { - const resolvedP = ppath.resolve(PortablePath.root, p); - return watchFile(this, resolvedP, a, b); - } - unwatchFile(p, cb) { - const resolvedP = ppath.resolve(PortablePath.root, p); - return unwatchFile(this, resolvedP, cb); - } -} - -setFactory(() => { - const emZip = createModule(); - return makeInterface(emZip); -}); - -var ErrorCode = /* @__PURE__ */ ((ErrorCode2) => { - ErrorCode2["API_ERROR"] = `API_ERROR`; - ErrorCode2["BUILTIN_NODE_RESOLUTION_FAILED"] = `BUILTIN_NODE_RESOLUTION_FAILED`; - ErrorCode2["EXPORTS_RESOLUTION_FAILED"] = `EXPORTS_RESOLUTION_FAILED`; - ErrorCode2["MISSING_DEPENDENCY"] = `MISSING_DEPENDENCY`; - ErrorCode2["MISSING_PEER_DEPENDENCY"] = `MISSING_PEER_DEPENDENCY`; - ErrorCode2["QUALIFIED_PATH_RESOLUTION_FAILED"] = `QUALIFIED_PATH_RESOLUTION_FAILED`; - ErrorCode2["INTERNAL"] = `INTERNAL`; - ErrorCode2["UNDECLARED_DEPENDENCY"] = `UNDECLARED_DEPENDENCY`; - ErrorCode2["UNSUPPORTED"] = `UNSUPPORTED`; - return ErrorCode2; -})(ErrorCode || {}); -const MODULE_NOT_FOUND_ERRORS = /* @__PURE__ */ new Set([ - "BUILTIN_NODE_RESOLUTION_FAILED" /* BUILTIN_NODE_RESOLUTION_FAILED */, - "MISSING_DEPENDENCY" /* MISSING_DEPENDENCY */, - "MISSING_PEER_DEPENDENCY" /* MISSING_PEER_DEPENDENCY */, - "QUALIFIED_PATH_RESOLUTION_FAILED" /* QUALIFIED_PATH_RESOLUTION_FAILED */, - "UNDECLARED_DEPENDENCY" /* UNDECLARED_DEPENDENCY */ -]); -function makeError(pnpCode, message, data = {}, code) { - code ??= MODULE_NOT_FOUND_ERRORS.has(pnpCode) ? `MODULE_NOT_FOUND` : pnpCode; - const propertySpec = { - configurable: true, - writable: true, - enumerable: false - }; - return Object.defineProperties(new Error(message), { - code: { - ...propertySpec, - value: code - }, - pnpCode: { - ...propertySpec, - value: pnpCode - }, - data: { - ...propertySpec, - value: data - } - }); -} -function getIssuerModule(parent) { - let issuer = parent; - while (issuer && (issuer.id === `[eval]` || issuer.id === `` || !issuer.filename)) - issuer = issuer.parent; - return issuer || null; -} -function getPathForDisplay(p) { - return npath.normalize(npath.fromPortablePath(p)); -} - -const [major, minor] = process.versions.node.split(`.`).map((value) => parseInt(value, 10)); -const WATCH_MODE_MESSAGE_USES_ARRAYS = major > 19 || major === 19 && minor >= 2 || major === 18 && minor >= 13; - -function readPackageScope(checkPath) { - const rootSeparatorIndex = checkPath.indexOf(npath.sep); - let separatorIndex; - do { - separatorIndex = checkPath.lastIndexOf(npath.sep); - checkPath = checkPath.slice(0, separatorIndex); - if (checkPath.endsWith(`${npath.sep}node_modules`)) - return false; - const pjson = readPackage(checkPath + npath.sep); - if (pjson) { - return { - data: pjson, - path: checkPath - }; - } - } while (separatorIndex > rootSeparatorIndex); - return false; -} -function readPackage(requestPath) { - const jsonPath = npath.resolve(requestPath, `package.json`); - if (!fs__default.default.existsSync(jsonPath)) - return null; - return JSON.parse(fs__default.default.readFileSync(jsonPath, `utf8`)); -} -function ERR_REQUIRE_ESM(filename, parentPath = null) { - const basename = parentPath && path__default.default.basename(filename) === path__default.default.basename(parentPath) ? filename : path__default.default.basename(filename); - const msg = `require() of ES Module ${filename}${parentPath ? ` from ${parentPath}` : ``} not supported. -Instead change the require of ${basename} in ${parentPath} to a dynamic import() which is available in all CommonJS modules.`; - const err = new Error(msg); - err.code = `ERR_REQUIRE_ESM`; - return err; -} -function reportRequiredFilesToWatchMode(files) { - if (process.env.WATCH_REPORT_DEPENDENCIES && process.send) { - files = files.map((filename) => npath.fromPortablePath(VirtualFS.resolveVirtual(npath.toPortablePath(filename)))); - if (WATCH_MODE_MESSAGE_USES_ARRAYS) { - process.send({ "watch:require": files }); - } else { - for (const filename of files) { - process.send({ "watch:require": filename }); - } - } - } -} - -function applyPatch(pnpapi, opts) { - let enableNativeHooks = true; - process.versions.pnp = String(pnpapi.VERSIONS.std); - const moduleExports = require$$0__default.default; - moduleExports.findPnpApi = (lookupSource) => { - const lookupPath = lookupSource instanceof URL ? url.fileURLToPath(lookupSource) : lookupSource; - const apiPath = opts.manager.findApiPathFor(lookupPath); - if (apiPath === null) - return null; - const apiEntry = opts.manager.getApiEntry(apiPath, true); - return apiEntry.instance.findPackageLocator(lookupPath) ? apiEntry.instance : null; - }; - function getRequireStack(parent) { - const requireStack = []; - for (let cursor = parent; cursor; cursor = cursor.parent) - requireStack.push(cursor.filename || cursor.id); - return requireStack; - } - const originalModuleLoad = require$$0.Module._load; - require$$0.Module._load = function(request, parent, isMain) { - if (request === `pnpapi`) { - const parentApiPath = opts.manager.getApiPathFromParent(parent); - if (parentApiPath) { - return opts.manager.getApiEntry(parentApiPath, true).instance; - } - } - return originalModuleLoad.call(require$$0.Module, request, parent, isMain); - }; - function getIssuerSpecsFromPaths(paths) { - return paths.map((path) => ({ - apiPath: opts.manager.findApiPathFor(path), - path, - module: null - })); - } - function getIssuerSpecsFromModule(module) { - if (module && module.id !== `` && module.id !== `internal/preload` && !module.parent && !module.filename && module.paths.length > 0) { - return [{ - apiPath: opts.manager.findApiPathFor(module.paths[0]), - path: module.paths[0], - module - }]; - } - const issuer = getIssuerModule(module); - if (issuer !== null) { - const path = npath.dirname(issuer.filename); - const apiPath = opts.manager.getApiPathFromParent(issuer); - return [{ apiPath, path, module }]; - } else { - const path = process.cwd(); - const apiPath = opts.manager.findApiPathFor(npath.join(path, `[file]`)) ?? opts.manager.getApiPathFromParent(null); - return [{ apiPath, path, module }]; - } - } - function makeFakeParent(path) { - const fakeParent = new require$$0.Module(``); - const fakeFilePath = npath.join(path, `[file]`); - fakeParent.paths = require$$0.Module._nodeModulePaths(fakeFilePath); - return fakeParent; - } - const pathRegExp = /^(?![a-zA-Z]:[\\/]|\\\\|\.{0,2}(?:\/|$))((?:@[^/]+\/)?[^/]+)\/*(.*|)$/; - const originalModuleResolveFilename = require$$0.Module._resolveFilename; - require$$0.Module._resolveFilename = function(request, parent, isMain, options) { - if (require$$0.isBuiltin(request)) - return request; - if (!enableNativeHooks) - return originalModuleResolveFilename.call(require$$0.Module, request, parent, isMain, options); - if (options && options.plugnplay === false) { - const { plugnplay, ...forwardedOptions } = options; - try { - enableNativeHooks = false; - return originalModuleResolveFilename.call(require$$0.Module, request, parent, isMain, forwardedOptions); - } finally { - enableNativeHooks = true; - } - } - if (options) { - const optionNames = new Set(Object.keys(options)); - optionNames.delete(`paths`); - optionNames.delete(`plugnplay`); - if (optionNames.size > 0) { - throw makeError( - ErrorCode.UNSUPPORTED, - `Some options passed to require() aren't supported by PnP yet (${Array.from(optionNames).join(`, `)})` - ); - } - } - const issuerSpecs = options && options.paths ? getIssuerSpecsFromPaths(options.paths) : getIssuerSpecsFromModule(parent); - if (request.match(pathRegExp) === null) { - const parentDirectory = parent?.filename != null ? npath.dirname(parent.filename) : null; - const absoluteRequest = npath.isAbsolute(request) ? request : parentDirectory !== null ? npath.resolve(parentDirectory, request) : null; - if (absoluteRequest !== null) { - const apiPath = parent && parentDirectory === npath.dirname(absoluteRequest) ? opts.manager.getApiPathFromParent(parent) : opts.manager.findApiPathFor(absoluteRequest); - if (apiPath !== null) { - issuerSpecs.unshift({ - apiPath, - path: parentDirectory, - module: null - }); - } - } - } - let firstError; - for (const { apiPath, path, module } of issuerSpecs) { - let resolution; - const issuerApi = apiPath !== null ? opts.manager.getApiEntry(apiPath, true).instance : null; - try { - if (issuerApi !== null) { - resolution = issuerApi.resolveRequest(request, path !== null ? `${path}/` : null); - } else { - if (path === null) - throw new Error(`Assertion failed: Expected the path to be set`); - resolution = originalModuleResolveFilename.call(require$$0.Module, request, module || makeFakeParent(path), isMain); - } - } catch (error) { - firstError = firstError || error; - continue; - } - if (resolution !== null) { - return resolution; - } - } - const requireStack = getRequireStack(parent); - Object.defineProperty(firstError, `requireStack`, { - configurable: true, - writable: true, - enumerable: false, - value: requireStack - }); - if (requireStack.length > 0) - firstError.message += ` -Require stack: -- ${requireStack.join(` -- `)}`; - if (typeof firstError.pnpCode === `string`) - Error.captureStackTrace(firstError); - throw firstError; - }; - const originalFindPath = require$$0.Module._findPath; - require$$0.Module._findPath = function(request, paths, isMain) { - if (request === `pnpapi`) - return false; - if (!enableNativeHooks) - return originalFindPath.call(require$$0.Module, request, paths, isMain); - const isAbsolute = npath.isAbsolute(request); - if (isAbsolute) - paths = [``]; - else if (!paths || paths.length === 0) - return false; - for (const path of paths) { - let resolution; - try { - const pnpApiPath = opts.manager.findApiPathFor(isAbsolute ? request : path); - if (pnpApiPath !== null) { - const api = opts.manager.getApiEntry(pnpApiPath, true).instance; - resolution = api.resolveRequest(request, path) || false; - } else { - resolution = originalFindPath.call(require$$0.Module, request, [path], isMain); - } - } catch (error) { - continue; - } - if (resolution) { - return resolution; - } - } - return false; - }; - const originalExtensionJSFunction = require$$0.Module._extensions[`.js`]; - require$$0.Module._extensions[`.js`] = function(module, filename) { - if (filename.endsWith(`.js`)) { - const pkg = readPackageScope(filename); - if (pkg && pkg.data?.type === `module`) { - const err = ERR_REQUIRE_ESM(filename, module.parent?.filename); - Error.captureStackTrace(err); - throw err; - } - } - originalExtensionJSFunction.call(this, module, filename); - }; - const originalDlopen = process.dlopen; - process.dlopen = function(...args) { - const [module, filename, ...rest] = args; - return originalDlopen.call( - this, - module, - npath.fromPortablePath(VirtualFS.resolveVirtual(npath.toPortablePath(filename))), - ...rest - ); - }; - const originalEmit = process.emit; - process.emit = function(name, data, ...args) { - if (name === `warning` && typeof data === `object` && data.name === `ExperimentalWarning` && (data.message.includes(`--experimental-loader`) || data.message.includes(`Custom ESM Loaders is an experimental feature`))) - return false; - return originalEmit.apply(process, arguments); - }; - patchFs(fs__default.default, new PosixFS(opts.fakeFs)); -} - -function hydrateRuntimeState(data, { basePath }) { - const portablePath = npath.toPortablePath(basePath); - const absolutePortablePath = ppath.resolve(portablePath); - const ignorePattern = data.ignorePatternData !== null ? new RegExp(data.ignorePatternData) : null; - const packageLocatorsByLocations = /* @__PURE__ */ new Map(); - const packageRegistry = new Map(data.packageRegistryData.map(([packageName, packageStoreData]) => { - return [packageName, new Map(packageStoreData.map(([packageReference, packageInformationData]) => { - if (packageName === null !== (packageReference === null)) - throw new Error(`Assertion failed: The name and reference should be null, or neither should`); - const discardFromLookup = packageInformationData.discardFromLookup ?? false; - const packageLocator = { name: packageName, reference: packageReference }; - const entry = packageLocatorsByLocations.get(packageInformationData.packageLocation); - if (!entry) { - packageLocatorsByLocations.set(packageInformationData.packageLocation, { locator: packageLocator, discardFromLookup }); - } else { - entry.discardFromLookup = entry.discardFromLookup && discardFromLookup; - if (!discardFromLookup) { - entry.locator = packageLocator; - } - } - let resolvedPackageLocation = null; - return [packageReference, { - packageDependencies: new Map(packageInformationData.packageDependencies), - packagePeers: new Set(packageInformationData.packagePeers), - linkType: packageInformationData.linkType, - discardFromLookup, - get packageLocation() { - return resolvedPackageLocation || (resolvedPackageLocation = ppath.join(absolutePortablePath, packageInformationData.packageLocation)); - } - }]; - }))]; - })); - const fallbackExclusionList = new Map(data.fallbackExclusionList.map(([packageName, packageReferences]) => { - return [packageName, new Set(packageReferences)]; - })); - const fallbackPool = new Map(data.fallbackPool); - const dependencyTreeRoots = data.dependencyTreeRoots; - const enableTopLevelFallback = data.enableTopLevelFallback; - return { - basePath: portablePath, - dependencyTreeRoots, - enableTopLevelFallback, - fallbackExclusionList, - fallbackPool, - ignorePattern, - packageLocatorsByLocations, - packageRegistry - }; -} - -const ArrayIsArray = Array.isArray; -const JSONStringify = JSON.stringify; -const ObjectGetOwnPropertyNames = Object.getOwnPropertyNames; -const ObjectPrototypeHasOwnProperty = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop); -const RegExpPrototypeExec = (obj, string) => RegExp.prototype.exec.call(obj, string); -const RegExpPrototypeSymbolReplace = (obj, ...rest) => RegExp.prototype[Symbol.replace].apply(obj, rest); -const StringPrototypeEndsWith = (str, ...rest) => String.prototype.endsWith.apply(str, rest); -const StringPrototypeIncludes = (str, ...rest) => String.prototype.includes.apply(str, rest); -const StringPrototypeLastIndexOf = (str, ...rest) => String.prototype.lastIndexOf.apply(str, rest); -const StringPrototypeIndexOf = (str, ...rest) => String.prototype.indexOf.apply(str, rest); -const StringPrototypeReplace = (str, ...rest) => String.prototype.replace.apply(str, rest); -const StringPrototypeSlice = (str, ...rest) => String.prototype.slice.apply(str, rest); -const StringPrototypeStartsWith = (str, ...rest) => String.prototype.startsWith.apply(str, rest); -const SafeMap = Map; -const JSONParse = JSON.parse; - -function createErrorType(code, messageCreator, errorType) { - return class extends errorType { - constructor(...args) { - super(messageCreator(...args)); - this.code = code; - this.name = `${errorType.name} [${code}]`; - } - }; -} -const ERR_PACKAGE_IMPORT_NOT_DEFINED = createErrorType( - `ERR_PACKAGE_IMPORT_NOT_DEFINED`, - (specifier, packagePath, base) => { - return `Package import specifier "${specifier}" is not defined${packagePath ? ` in package ${packagePath}package.json` : ``} imported from ${base}`; - }, - TypeError -); -const ERR_INVALID_MODULE_SPECIFIER = createErrorType( - `ERR_INVALID_MODULE_SPECIFIER`, - (request, reason, base = void 0) => { - return `Invalid module "${request}" ${reason}${base ? ` imported from ${base}` : ``}`; - }, - TypeError -); -const ERR_INVALID_PACKAGE_TARGET = createErrorType( - `ERR_INVALID_PACKAGE_TARGET`, - (pkgPath, key, target, isImport = false, base = void 0) => { - const relError = typeof target === `string` && !isImport && target.length && !StringPrototypeStartsWith(target, `./`); - if (key === `.`) { - assert__default.default(isImport === false); - return `Invalid "exports" main target ${JSONStringify(target)} defined in the package config ${pkgPath}package.json${base ? ` imported from ${base}` : ``}${relError ? `; targets must start with "./"` : ``}`; - } - return `Invalid "${isImport ? `imports` : `exports`}" target ${JSONStringify( - target - )} defined for '${key}' in the package config ${pkgPath}package.json${base ? ` imported from ${base}` : ``}${relError ? `; targets must start with "./"` : ``}`; - }, - Error -); -const ERR_INVALID_PACKAGE_CONFIG = createErrorType( - `ERR_INVALID_PACKAGE_CONFIG`, - (path, base, message) => { - return `Invalid package config ${path}${base ? ` while importing ${base}` : ``}${message ? `. ${message}` : ``}`; - }, - Error -); -const ERR_PACKAGE_PATH_NOT_EXPORTED = createErrorType( - "ERR_PACKAGE_PATH_NOT_EXPORTED", - (pkgPath, subpath, base = void 0) => { - if (subpath === ".") - return `No "exports" main defined in ${pkgPath}package.json${base ? ` imported from ${base}` : ""}`; - return `Package subpath '${subpath}' is not defined by "exports" in ${pkgPath}package.json${base ? ` imported from ${base}` : ""}`; - }, - Error -); - -function filterOwnProperties(source, keys) { - const filtered = /* @__PURE__ */ Object.create(null); - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - if (ObjectPrototypeHasOwnProperty(source, key)) { - filtered[key] = source[key]; - } - } - return filtered; -} - -const packageJSONCache = new SafeMap(); -function getPackageConfig(path, specifier, base, readFileSyncFn) { - const existing = packageJSONCache.get(path); - if (existing !== void 0) { - return existing; - } - const source = readFileSyncFn(path); - if (source === void 0) { - const packageConfig2 = { - pjsonPath: path, - exists: false, - main: void 0, - name: void 0, - type: "none", - exports: void 0, - imports: void 0 - }; - packageJSONCache.set(path, packageConfig2); - return packageConfig2; - } - let packageJSON; - try { - packageJSON = JSONParse(source); - } catch (error) { - throw new ERR_INVALID_PACKAGE_CONFIG( - path, - (base ? `"${specifier}" from ` : "") + url.fileURLToPath(base || specifier), - error.message - ); - } - let { imports, main, name, type } = filterOwnProperties(packageJSON, [ - "imports", - "main", - "name", - "type" - ]); - const exports = ObjectPrototypeHasOwnProperty(packageJSON, "exports") ? packageJSON.exports : void 0; - if (typeof imports !== "object" || imports === null) { - imports = void 0; - } - if (typeof main !== "string") { - main = void 0; - } - if (typeof name !== "string") { - name = void 0; - } - if (type !== "module" && type !== "commonjs") { - type = "none"; - } - const packageConfig = { - pjsonPath: path, - exists: true, - main, - name, - type, - exports, - imports - }; - packageJSONCache.set(path, packageConfig); - return packageConfig; -} -function getPackageScopeConfig(resolved, readFileSyncFn) { - let packageJSONUrl = new URL("./package.json", resolved); - while (true) { - const packageJSONPath2 = packageJSONUrl.pathname; - if (StringPrototypeEndsWith(packageJSONPath2, "node_modules/package.json")) { - break; - } - const packageConfig2 = getPackageConfig( - url.fileURLToPath(packageJSONUrl), - resolved, - void 0, - readFileSyncFn - ); - if (packageConfig2.exists) { - return packageConfig2; - } - const lastPackageJSONUrl = packageJSONUrl; - packageJSONUrl = new URL("../package.json", packageJSONUrl); - if (packageJSONUrl.pathname === lastPackageJSONUrl.pathname) { - break; - } - } - const packageJSONPath = url.fileURLToPath(packageJSONUrl); - const packageConfig = { - pjsonPath: packageJSONPath, - exists: false, - main: void 0, - name: void 0, - type: "none", - exports: void 0, - imports: void 0 - }; - packageJSONCache.set(packageJSONPath, packageConfig); - return packageConfig; -} - -function throwImportNotDefined(specifier, packageJSONUrl, base) { - throw new ERR_PACKAGE_IMPORT_NOT_DEFINED( - specifier, - packageJSONUrl && url.fileURLToPath(new URL(".", packageJSONUrl)), - url.fileURLToPath(base) - ); -} -function throwInvalidSubpath(subpath, packageJSONUrl, internal, base) { - const reason = `request is not a valid subpath for the "${internal ? "imports" : "exports"}" resolution of ${url.fileURLToPath(packageJSONUrl)}`; - throw new ERR_INVALID_MODULE_SPECIFIER( - subpath, - reason, - base && url.fileURLToPath(base) - ); -} -function throwInvalidPackageTarget(subpath, target, packageJSONUrl, internal, base) { - if (typeof target === "object" && target !== null) { - target = JSONStringify(target, null, ""); - } else { - target = `${target}`; - } - throw new ERR_INVALID_PACKAGE_TARGET( - url.fileURLToPath(new URL(".", packageJSONUrl)), - subpath, - target, - internal, - base && url.fileURLToPath(base) - ); -} -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; -const patternRegEx = /\*/g; -function resolvePackageTargetString(target, subpath, match, packageJSONUrl, base, pattern, internal, conditions) { - if (subpath !== "" && !pattern && target[target.length - 1] !== "/") - throwInvalidPackageTarget(match, target, packageJSONUrl, internal, base); - if (!StringPrototypeStartsWith(target, "./")) { - if (internal && !StringPrototypeStartsWith(target, "../") && !StringPrototypeStartsWith(target, "/")) { - let isURL = false; - try { - new URL(target); - isURL = true; - } catch { - } - if (!isURL) { - const exportTarget = pattern ? RegExpPrototypeSymbolReplace(patternRegEx, target, () => subpath) : target + subpath; - return exportTarget; - } - } - throwInvalidPackageTarget(match, target, packageJSONUrl, internal, base); - } - if (RegExpPrototypeExec( - invalidSegmentRegEx, - StringPrototypeSlice(target, 2) - ) !== null) - throwInvalidPackageTarget(match, target, packageJSONUrl, internal, base); - const resolved = new URL(target, packageJSONUrl); - const resolvedPath = resolved.pathname; - const packagePath = new URL(".", packageJSONUrl).pathname; - if (!StringPrototypeStartsWith(resolvedPath, packagePath)) - throwInvalidPackageTarget(match, target, packageJSONUrl, internal, base); - if (subpath === "") - return resolved; - if (RegExpPrototypeExec(invalidSegmentRegEx, subpath) !== null) { - const request = pattern ? StringPrototypeReplace(match, "*", () => subpath) : match + subpath; - throwInvalidSubpath(request, packageJSONUrl, internal, base); - } - if (pattern) { - return new URL( - RegExpPrototypeSymbolReplace(patternRegEx, resolved.href, () => subpath) - ); - } - return new URL(subpath, resolved); -} -function isArrayIndex(key) { - const keyNum = +key; - if (`${keyNum}` !== key) - return false; - return keyNum >= 0 && keyNum < 4294967295; -} -function resolvePackageTarget(packageJSONUrl, target, subpath, packageSubpath, base, pattern, internal, conditions) { - if (typeof target === "string") { - return resolvePackageTargetString( - target, - subpath, - packageSubpath, - packageJSONUrl, - base, - pattern, - internal); - } else if (ArrayIsArray(target)) { - if (target.length === 0) { - return null; - } - let lastException; - for (let i = 0; i < target.length; i++) { - const targetItem = target[i]; - let resolveResult; - try { - resolveResult = resolvePackageTarget( - packageJSONUrl, - targetItem, - subpath, - packageSubpath, - base, - pattern, - internal, - conditions - ); - } catch (e) { - lastException = e; - if (e.code === "ERR_INVALID_PACKAGE_TARGET") { - continue; - } - throw e; - } - if (resolveResult === void 0) { - continue; - } - if (resolveResult === null) { - lastException = null; - continue; - } - return resolveResult; - } - if (lastException === void 0 || lastException === null) - return lastException; - throw lastException; - } else if (typeof target === "object" && target !== null) { - const keys = ObjectGetOwnPropertyNames(target); - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - if (isArrayIndex(key)) { - throw new ERR_INVALID_PACKAGE_CONFIG( - url.fileURLToPath(packageJSONUrl), - base, - '"exports" cannot contain numeric property keys.' - ); - } - } - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - if (key === "default" || conditions.has(key)) { - const conditionalTarget = target[key]; - const resolveResult = resolvePackageTarget( - packageJSONUrl, - conditionalTarget, - subpath, - packageSubpath, - base, - pattern, - internal, - conditions - ); - if (resolveResult === void 0) - continue; - return resolveResult; - } - } - return void 0; - } else if (target === null) { - return null; - } - throwInvalidPackageTarget( - packageSubpath, - target, - packageJSONUrl, - internal, - base - ); -} -function patternKeyCompare(a, b) { - const aPatternIndex = StringPrototypeIndexOf(a, "*"); - const bPatternIndex = StringPrototypeIndexOf(b, "*"); - 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; -} -function isConditionalExportsMainSugar(exports, packageJSONUrl, base) { - if (typeof exports === "string" || ArrayIsArray(exports)) - return true; - if (typeof exports !== "object" || exports === null) - return false; - const keys = ObjectGetOwnPropertyNames(exports); - let isConditionalSugar = false; - let i = 0; - for (let j = 0; j < keys.length; j++) { - const key = keys[j]; - const curIsConditionalSugar = key === "" || key[0] !== "."; - if (i++ === 0) { - isConditionalSugar = curIsConditionalSugar; - } else if (isConditionalSugar !== curIsConditionalSugar) { - throw new ERR_INVALID_PACKAGE_CONFIG( - url.fileURLToPath(packageJSONUrl), - base, - `"exports" cannot contain some keys starting with '.' and some not. The exports object must either be an object of package subpath keys or an object of main entry condition name keys only.` - ); - } - } - return isConditionalSugar; -} -function throwExportsNotFound(subpath, packageJSONUrl, base) { - throw new ERR_PACKAGE_PATH_NOT_EXPORTED( - url.fileURLToPath(new URL(".", packageJSONUrl)), - subpath, - base && url.fileURLToPath(base) - ); -} -const emittedPackageWarnings = /* @__PURE__ */ new Set(); -function emitTrailingSlashPatternDeprecation(match, pjsonUrl, base) { - const pjsonPath = url.fileURLToPath(pjsonUrl); - if (emittedPackageWarnings.has(pjsonPath + "|" + match)) - return; - emittedPackageWarnings.add(pjsonPath + "|" + match); - process.emitWarning( - `Use of deprecated trailing slash pattern mapping "${match}" in the "exports" field module resolution of the package at ${pjsonPath}${base ? ` imported from ${url.fileURLToPath(base)}` : ""}. Mapping specifiers ending in "/" is no longer supported.`, - "DeprecationWarning", - "DEP0155" - ); -} -function packageExportsResolve({ - packageJSONUrl, - packageSubpath, - exports, - base, - conditions -}) { - if (isConditionalExportsMainSugar(exports, packageJSONUrl, base)) - exports = { ".": exports }; - if (ObjectPrototypeHasOwnProperty(exports, packageSubpath) && !StringPrototypeIncludes(packageSubpath, "*") && !StringPrototypeEndsWith(packageSubpath, "/")) { - const target = exports[packageSubpath]; - const resolveResult = resolvePackageTarget( - packageJSONUrl, - target, - "", - packageSubpath, - base, - false, - false, - conditions - ); - if (resolveResult == null) { - throwExportsNotFound(packageSubpath, packageJSONUrl, base); - } - return resolveResult; - } - let bestMatch = ""; - let bestMatchSubpath; - const keys = ObjectGetOwnPropertyNames(exports); - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - const patternIndex = StringPrototypeIndexOf(key, "*"); - if (patternIndex !== -1 && StringPrototypeStartsWith( - packageSubpath, - StringPrototypeSlice(key, 0, patternIndex) - )) { - if (StringPrototypeEndsWith(packageSubpath, "/")) - emitTrailingSlashPatternDeprecation( - packageSubpath, - packageJSONUrl, - base - ); - const patternTrailer = StringPrototypeSlice(key, patternIndex + 1); - if (packageSubpath.length >= key.length && StringPrototypeEndsWith(packageSubpath, patternTrailer) && patternKeyCompare(bestMatch, key) === 1 && StringPrototypeLastIndexOf(key, "*") === patternIndex) { - bestMatch = key; - bestMatchSubpath = StringPrototypeSlice( - packageSubpath, - patternIndex, - packageSubpath.length - patternTrailer.length - ); - } - } - } - if (bestMatch) { - const target = exports[bestMatch]; - const resolveResult = resolvePackageTarget( - packageJSONUrl, - target, - bestMatchSubpath, - bestMatch, - base, - true, - false, - conditions - ); - if (resolveResult == null) { - throwExportsNotFound(packageSubpath, packageJSONUrl, base); - } - return resolveResult; - } - throwExportsNotFound(packageSubpath, packageJSONUrl, base); -} -function packageImportsResolve({ name, base, conditions, readFileSyncFn }) { - if (name === "#" || StringPrototypeStartsWith(name, "#/") || StringPrototypeEndsWith(name, "/")) { - const reason = "is not a valid internal imports specifier name"; - throw new ERR_INVALID_MODULE_SPECIFIER(name, reason, url.fileURLToPath(base)); - } - let packageJSONUrl; - const packageConfig = getPackageScopeConfig(base, readFileSyncFn); - if (packageConfig.exists) { - packageJSONUrl = url.pathToFileURL(packageConfig.pjsonPath); - const imports = packageConfig.imports; - if (imports) { - if (ObjectPrototypeHasOwnProperty(imports, name) && !StringPrototypeIncludes(name, "*")) { - const resolveResult = resolvePackageTarget( - packageJSONUrl, - imports[name], - "", - name, - base, - false, - true, - conditions - ); - if (resolveResult != null) { - return resolveResult; - } - } else { - let bestMatch = ""; - let bestMatchSubpath; - const keys = ObjectGetOwnPropertyNames(imports); - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - const patternIndex = StringPrototypeIndexOf(key, "*"); - if (patternIndex !== -1 && StringPrototypeStartsWith( - name, - StringPrototypeSlice(key, 0, patternIndex) - )) { - const patternTrailer = StringPrototypeSlice(key, patternIndex + 1); - if (name.length >= key.length && StringPrototypeEndsWith(name, patternTrailer) && patternKeyCompare(bestMatch, key) === 1 && StringPrototypeLastIndexOf(key, "*") === patternIndex) { - bestMatch = key; - bestMatchSubpath = StringPrototypeSlice( - name, - patternIndex, - name.length - patternTrailer.length - ); - } - } - } - if (bestMatch) { - const target = imports[bestMatch]; - const resolveResult = resolvePackageTarget( - packageJSONUrl, - target, - bestMatchSubpath, - bestMatch, - base, - true, - true, - conditions - ); - if (resolveResult != null) { - return resolveResult; - } - } - } - } - } - throwImportNotDefined(name, packageJSONUrl, base); -} - -const flagSymbol = Symbol('arg flag'); - -class ArgError extends Error { - constructor(msg, code) { - super(msg); - this.name = 'ArgError'; - this.code = code; - - Object.setPrototypeOf(this, ArgError.prototype); - } -} - -function arg( - opts, - { - argv = process.argv.slice(2), - permissive = false, - stopAtPositional = false - } = {} -) { - if (!opts) { - throw new ArgError( - 'argument specification object is required', - 'ARG_CONFIG_NO_SPEC' - ); - } - - const result = { _: [] }; - - const aliases = {}; - const handlers = {}; - - for (const key of Object.keys(opts)) { - if (!key) { - throw new ArgError( - 'argument key cannot be an empty string', - 'ARG_CONFIG_EMPTY_KEY' - ); - } - - if (key[0] !== '-') { - throw new ArgError( - `argument key must start with '-' but found: '${key}'`, - 'ARG_CONFIG_NONOPT_KEY' - ); - } - - if (key.length === 1) { - throw new ArgError( - `argument key must have a name; singular '-' keys are not allowed: ${key}`, - 'ARG_CONFIG_NONAME_KEY' - ); - } - - if (typeof opts[key] === 'string') { - aliases[key] = opts[key]; - continue; - } - - let type = opts[key]; - let isFlag = false; - - if ( - Array.isArray(type) && - type.length === 1 && - typeof type[0] === 'function' - ) { - const [fn] = type; - type = (value, name, prev = []) => { - prev.push(fn(value, name, prev[prev.length - 1])); - return prev; - }; - isFlag = fn === Boolean || fn[flagSymbol] === true; - } else if (typeof type === 'function') { - isFlag = type === Boolean || type[flagSymbol] === true; - } else { - throw new ArgError( - `type missing or not a function or valid array type: ${key}`, - 'ARG_CONFIG_VAD_TYPE' - ); - } - - if (key[1] !== '-' && key.length > 2) { - throw new ArgError( - `short argument keys (with a single hyphen) must have only one character: ${key}`, - 'ARG_CONFIG_SHORTOPT_TOOLONG' - ); - } - - handlers[key] = [type, isFlag]; - } - - for (let i = 0, len = argv.length; i < len; i++) { - const wholeArg = argv[i]; - - if (stopAtPositional && result._.length > 0) { - result._ = result._.concat(argv.slice(i)); - break; - } - - if (wholeArg === '--') { - result._ = result._.concat(argv.slice(i + 1)); - break; - } - - if (wholeArg.length > 1 && wholeArg[0] === '-') { - /* eslint-disable operator-linebreak */ - const separatedArguments = - wholeArg[1] === '-' || wholeArg.length === 2 - ? [wholeArg] - : wholeArg - .slice(1) - .split('') - .map((a) => `-${a}`); - /* eslint-enable operator-linebreak */ - - for (let j = 0; j < separatedArguments.length; j++) { - const arg = separatedArguments[j]; - const [originalArgName, argStr] = - arg[1] === '-' ? arg.split(/=(.*)/, 2) : [arg, undefined]; - - let argName = originalArgName; - while (argName in aliases) { - argName = aliases[argName]; - } - - if (!(argName in handlers)) { - if (permissive) { - result._.push(arg); - continue; - } else { - throw new ArgError( - `unknown or unexpected option: ${originalArgName}`, - 'ARG_UNKNOWN_OPTION' - ); - } - } - - const [type, isFlag] = handlers[argName]; - - if (!isFlag && j + 1 < separatedArguments.length) { - throw new ArgError( - `option requires argument (but was followed by another short argument): ${originalArgName}`, - 'ARG_MISSING_REQUIRED_SHORTARG' - ); - } - - if (isFlag) { - result[argName] = type(true, argName, result[argName]); - } else if (argStr === undefined) { - if ( - argv.length < i + 2 || - (argv[i + 1].length > 1 && - argv[i + 1][0] === '-' && - !( - argv[i + 1].match(/^-?\d*(\.(?=\d))?\d*$/) && - (type === Number || - // eslint-disable-next-line no-undef - (typeof BigInt !== 'undefined' && type === BigInt)) - )) - ) { - const extended = - originalArgName === argName ? '' : ` (alias for ${argName})`; - throw new ArgError( - `option requires argument: ${originalArgName}${extended}`, - 'ARG_MISSING_REQUIRED_LONGARG' - ); - } - - result[argName] = type(argv[i + 1], argName, result[argName]); - ++i; - } else { - result[argName] = type(argStr, argName, result[argName]); - } - } - } else { - result._.push(wholeArg); - } - } - - return result; -} - -arg.flag = (fn) => { - fn[flagSymbol] = true; - return fn; -}; - -// Utility types -arg.COUNT = arg.flag((v, name, existingCount) => (existingCount || 0) + 1); - -// Expose error class -arg.ArgError = ArgError; - -var arg_1 = arg; - -/** - @license - The MIT License (MIT) - - Copyright (c) 2014 Blake Embrey (hello@blakeembrey.com) - - 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. -*/ -function getOptionValue(opt) { - parseOptions(); - return options[opt]; -} -let options; -function parseOptions() { - if (!options) { - options = { - "--conditions": [], - ...parseArgv(getNodeOptionsEnvArgv()), - ...parseArgv(process.execArgv) - }; - } -} -function parseArgv(argv) { - return arg_1( - { - "--conditions": [String], - "-C": "--conditions" - }, - { - argv, - permissive: true - } - ); -} -function getNodeOptionsEnvArgv() { - const errors = []; - const envArgv = ParseNodeOptionsEnvVar(process.env.NODE_OPTIONS || "", errors); - if (errors.length !== 0) ; - return envArgv; -} -function ParseNodeOptionsEnvVar(node_options, errors) { - const env_argv = []; - let is_in_string = false; - let will_start_new_arg = true; - for (let index = 0; index < node_options.length; ++index) { - let c = node_options[index]; - if (c === "\\" && is_in_string) { - if (index + 1 === node_options.length) { - errors.push("invalid value for NODE_OPTIONS (invalid escape)\n"); - return env_argv; - } else { - c = node_options[++index]; - } - } else if (c === " " && !is_in_string) { - will_start_new_arg = true; - continue; - } else if (c === '"') { - is_in_string = !is_in_string; - continue; - } - if (will_start_new_arg) { - env_argv.push(c); - will_start_new_arg = false; - } else { - env_argv[env_argv.length - 1] += c; - } - } - if (is_in_string) { - errors.push("invalid value for NODE_OPTIONS (unterminated string)\n"); - } - return env_argv; -} - -function makeApi(runtimeState, opts) { - const alwaysWarnOnFallback = Number(process.env.PNP_ALWAYS_WARN_ON_FALLBACK) > 0; - const debugLevel = Number(process.env.PNP_DEBUG_LEVEL); - const pathRegExp = /^(?![a-zA-Z]:[\\/]|\\\\|\.{0,2}(?:\/|$))((?:node:)?(?:@[^/]+\/)?[^/]+)\/*(.*|)$/; - const isStrictRegExp = /^(\/|\.{1,2}(\/|$))/; - const isDirRegExp = /\/$/; - const isRelativeRegexp = /^\.{0,2}\//; - const topLevelLocator = { name: null, reference: null }; - const fallbackLocators = []; - const emittedWarnings = /* @__PURE__ */ new Set(); - if (runtimeState.enableTopLevelFallback === true) - fallbackLocators.push(topLevelLocator); - if (opts.compatibilityMode !== false) { - for (const name of [`react-scripts`, `gatsby`]) { - const packageStore = runtimeState.packageRegistry.get(name); - if (packageStore) { - for (const reference of packageStore.keys()) { - if (reference === null) { - throw new Error(`Assertion failed: This reference shouldn't be null`); - } else { - fallbackLocators.push({ name, reference }); - } - } - } - } - } - const { - ignorePattern, - packageRegistry, - packageLocatorsByLocations - } = runtimeState; - function makeLogEntry(name, args) { - return { - fn: name, - args, - error: null, - result: null - }; - } - function trace(entry) { - const colors = process.stderr?.hasColors?.() ?? process.stdout.isTTY; - const c = (n, str) => `\x1B[${n}m${str}\x1B[0m`; - const error = entry.error; - if (error) - console.error(c(`31;1`, `\u2716 ${entry.error?.message.replace(/\n.*/s, ``)}`)); - else - console.error(c(`33;1`, `\u203C Resolution`)); - if (entry.args.length > 0) - console.error(); - for (const arg of entry.args) - console.error(` ${c(`37;1`, `In \u2190`)} ${nodeUtils.inspect(arg, { colors, compact: true })}`); - if (entry.result) { - console.error(); - console.error(` ${c(`37;1`, `Out \u2192`)} ${nodeUtils.inspect(entry.result, { colors, compact: true })}`); - } - const stack = new Error().stack.match(/(?<=^ +)at.*/gm)?.slice(2) ?? []; - if (stack.length > 0) { - console.error(); - for (const line of stack) { - console.error(` ${c(`38;5;244`, line)}`); - } - } - console.error(); - } - function maybeLog(name, fn) { - if (opts.allowDebug === false) - return fn; - if (Number.isFinite(debugLevel)) { - if (debugLevel >= 2) { - return (...args) => { - const logEntry = makeLogEntry(name, args); - try { - return logEntry.result = fn(...args); - } catch (error) { - throw logEntry.error = error; - } finally { - trace(logEntry); - } - }; - } else if (debugLevel >= 1) { - return (...args) => { - try { - return fn(...args); - } catch (error) { - const logEntry = makeLogEntry(name, args); - logEntry.error = error; - trace(logEntry); - throw error; - } - }; - } - } - return fn; - } - function getPackageInformationSafe(packageLocator) { - const packageInformation = getPackageInformation(packageLocator); - if (!packageInformation) { - throw makeError( - ErrorCode.INTERNAL, - `Couldn't find a matching entry in the dependency tree for the specified parent (this is probably an internal error)` - ); - } - return packageInformation; - } - function isDependencyTreeRoot(packageLocator) { - if (packageLocator.name === null) - return true; - for (const dependencyTreeRoot of runtimeState.dependencyTreeRoots) - if (dependencyTreeRoot.name === packageLocator.name && dependencyTreeRoot.reference === packageLocator.reference) - return true; - return false; - } - const defaultExportsConditions = /* @__PURE__ */ new Set([ - `node`, - `require`, - ...getOptionValue(`--conditions`) - ]); - function applyNodeExportsResolution(unqualifiedPath, conditions = defaultExportsConditions, issuer) { - const locator = findPackageLocator(ppath.join(unqualifiedPath, `internal.js`), { - resolveIgnored: true, - includeDiscardFromLookup: true - }); - if (locator === null) { - throw makeError( - ErrorCode.INTERNAL, - `The locator that owns the "${unqualifiedPath}" path can't be found inside the dependency tree (this is probably an internal error)` - ); - } - const { packageLocation } = getPackageInformationSafe(locator); - const manifestPath = ppath.join(packageLocation, Filename.manifest); - if (!opts.fakeFs.existsSync(manifestPath)) - return null; - const pkgJson = JSON.parse(opts.fakeFs.readFileSync(manifestPath, `utf8`)); - if (pkgJson.exports == null) - return null; - let subpath = ppath.contains(packageLocation, unqualifiedPath); - if (subpath === null) { - throw makeError( - ErrorCode.INTERNAL, - `unqualifiedPath doesn't contain the packageLocation (this is probably an internal error)` - ); - } - if (subpath !== `.` && !isRelativeRegexp.test(subpath)) - subpath = `./${subpath}`; - try { - const resolvedExport = packageExportsResolve({ - packageJSONUrl: url.pathToFileURL(npath.fromPortablePath(manifestPath)), - packageSubpath: subpath, - exports: pkgJson.exports, - base: issuer ? url.pathToFileURL(npath.fromPortablePath(issuer)) : null, - conditions - }); - return npath.toPortablePath(url.fileURLToPath(resolvedExport)); - } catch (error) { - throw makeError( - ErrorCode.EXPORTS_RESOLUTION_FAILED, - error.message, - { unqualifiedPath: getPathForDisplay(unqualifiedPath), locator, pkgJson, subpath: getPathForDisplay(subpath), conditions }, - error.code - ); - } - } - function applyNodeExtensionResolution(unqualifiedPath, candidates, { extensions }) { - let stat; - try { - candidates.push(unqualifiedPath); - stat = opts.fakeFs.statSync(unqualifiedPath); - } catch (error) { - } - if (stat && !stat.isDirectory()) - return opts.fakeFs.realpathSync(unqualifiedPath); - if (stat && stat.isDirectory()) { - let pkgJson; - try { - pkgJson = JSON.parse(opts.fakeFs.readFileSync(ppath.join(unqualifiedPath, Filename.manifest), `utf8`)); - } catch (error) { - } - let nextUnqualifiedPath; - if (pkgJson && pkgJson.main) - nextUnqualifiedPath = ppath.resolve(unqualifiedPath, pkgJson.main); - if (nextUnqualifiedPath && nextUnqualifiedPath !== unqualifiedPath) { - const resolution = applyNodeExtensionResolution(nextUnqualifiedPath, candidates, { extensions }); - if (resolution !== null) { - return resolution; - } - } - } - for (let i = 0, length = extensions.length; i < length; i++) { - const candidateFile = `${unqualifiedPath}${extensions[i]}`; - candidates.push(candidateFile); - if (opts.fakeFs.existsSync(candidateFile)) { - return candidateFile; - } - } - if (stat && stat.isDirectory()) { - for (let i = 0, length = extensions.length; i < length; i++) { - const candidateFile = ppath.format({ dir: unqualifiedPath, name: `index`, ext: extensions[i] }); - candidates.push(candidateFile); - if (opts.fakeFs.existsSync(candidateFile)) { - return candidateFile; - } - } - } - return null; - } - function makeFakeModule(path) { - const fakeModule = new require$$0.Module(path, null); - fakeModule.filename = path; - fakeModule.paths = require$$0.Module._nodeModulePaths(path); - return fakeModule; - } - function callNativeResolution(request, issuer) { - if (issuer.endsWith(`/`)) - issuer = ppath.join(issuer, `internal.js`); - return require$$0.Module._resolveFilename(npath.fromPortablePath(request), makeFakeModule(npath.fromPortablePath(issuer)), false, { plugnplay: false }); - } - function isPathIgnored(path) { - if (ignorePattern === null) - return false; - const subPath = ppath.contains(runtimeState.basePath, path); - if (subPath === null) - return false; - if (ignorePattern.test(subPath.replace(/\/$/, ``))) { - return true; - } else { - return false; - } - } - const VERSIONS = { std: 3, resolveVirtual: 1, getAllLocators: 1 }; - const topLevel = topLevelLocator; - function getPackageInformation({ name, reference }) { - const packageInformationStore = packageRegistry.get(name); - if (!packageInformationStore) - return null; - const packageInformation = packageInformationStore.get(reference); - if (!packageInformation) - return null; - return packageInformation; - } - function findPackageDependents({ name, reference }) { - const dependents = []; - for (const [dependentName, packageInformationStore] of packageRegistry) { - if (dependentName === null) - continue; - for (const [dependentReference, packageInformation] of packageInformationStore) { - if (dependentReference === null) - continue; - const dependencyReference = packageInformation.packageDependencies.get(name); - if (dependencyReference !== reference) - continue; - if (dependentName === name && dependentReference === reference) - continue; - dependents.push({ - name: dependentName, - reference: dependentReference - }); - } - } - return dependents; - } - function findBrokenPeerDependencies(dependency, initialPackage) { - const brokenPackages = /* @__PURE__ */ new Map(); - const alreadyVisited = /* @__PURE__ */ new Set(); - const traversal = (currentPackage) => { - const identifier = JSON.stringify(currentPackage.name); - if (alreadyVisited.has(identifier)) - return; - alreadyVisited.add(identifier); - const dependents = findPackageDependents(currentPackage); - for (const dependent of dependents) { - const dependentInformation = getPackageInformationSafe(dependent); - if (dependentInformation.packagePeers.has(dependency)) { - traversal(dependent); - } else { - let brokenSet = brokenPackages.get(dependent.name); - if (typeof brokenSet === `undefined`) - brokenPackages.set(dependent.name, brokenSet = /* @__PURE__ */ new Set()); - brokenSet.add(dependent.reference); - } - } - }; - traversal(initialPackage); - const brokenList = []; - for (const name of [...brokenPackages.keys()].sort()) - for (const reference of [...brokenPackages.get(name)].sort()) - brokenList.push({ name, reference }); - return brokenList; - } - function findPackageLocator(location, { resolveIgnored = false, includeDiscardFromLookup = false } = {}) { - if (isPathIgnored(location) && !resolveIgnored) - return null; - let relativeLocation = ppath.relative(runtimeState.basePath, location); - if (!relativeLocation.match(isStrictRegExp)) - relativeLocation = `./${relativeLocation}`; - if (!relativeLocation.endsWith(`/`)) - relativeLocation = `${relativeLocation}/`; - do { - const entry = packageLocatorsByLocations.get(relativeLocation); - if (typeof entry === `undefined` || entry.discardFromLookup && !includeDiscardFromLookup) { - relativeLocation = relativeLocation.substring(0, relativeLocation.lastIndexOf(`/`, relativeLocation.length - 2) + 1); - continue; - } - return entry.locator; - } while (relativeLocation !== ``); - return null; - } - function tryReadFile(filePath) { - try { - return opts.fakeFs.readFileSync(npath.toPortablePath(filePath), `utf8`); - } catch (err) { - if (err.code === `ENOENT`) - return void 0; - throw err; - } - } - function resolveToUnqualified(request, issuer, { considerBuiltins = true } = {}) { - if (request.startsWith(`#`)) - throw new Error(`resolveToUnqualified can not handle private import mappings`); - if (request === `pnpapi`) - return npath.toPortablePath(opts.pnpapiResolution); - if (considerBuiltins && require$$0.isBuiltin(request)) - return null; - const requestForDisplay = getPathForDisplay(request); - const issuerForDisplay = issuer && getPathForDisplay(issuer); - if (issuer && isPathIgnored(issuer)) { - if (!ppath.isAbsolute(request) || findPackageLocator(request) === null) { - const result = callNativeResolution(request, issuer); - if (result === false) { - throw makeError( - ErrorCode.BUILTIN_NODE_RESOLUTION_FAILED, - `The builtin node resolution algorithm was unable to resolve the requested module (it didn't go through the pnp resolver because the issuer was explicitely ignored by the regexp) - -Require request: "${requestForDisplay}" -Required by: ${issuerForDisplay} -`, - { request: requestForDisplay, issuer: issuerForDisplay } - ); - } - return npath.toPortablePath(result); - } - } - let unqualifiedPath; - const dependencyNameMatch = request.match(pathRegExp); - if (!dependencyNameMatch) { - if (ppath.isAbsolute(request)) { - unqualifiedPath = ppath.normalize(request); - } else { - if (!issuer) { - throw makeError( - ErrorCode.API_ERROR, - `The resolveToUnqualified function must be called with a valid issuer when the path isn't a builtin nor absolute`, - { request: requestForDisplay, issuer: issuerForDisplay } - ); - } - const absoluteIssuer = ppath.resolve(issuer); - if (issuer.match(isDirRegExp)) { - unqualifiedPath = ppath.normalize(ppath.join(absoluteIssuer, request)); - } else { - unqualifiedPath = ppath.normalize(ppath.join(ppath.dirname(absoluteIssuer), request)); - } - } - } else { - if (!issuer) { - throw makeError( - ErrorCode.API_ERROR, - `The resolveToUnqualified function must be called with a valid issuer when the path isn't a builtin nor absolute`, - { request: requestForDisplay, issuer: issuerForDisplay } - ); - } - const [, dependencyName, subPath] = dependencyNameMatch; - const issuerLocator = findPackageLocator(issuer); - if (!issuerLocator) { - const result = callNativeResolution(request, issuer); - if (result === false) { - throw makeError( - ErrorCode.BUILTIN_NODE_RESOLUTION_FAILED, - `The builtin node resolution algorithm was unable to resolve the requested module (it didn't go through the pnp resolver because the issuer doesn't seem to be part of the Yarn-managed dependency tree). - -Require path: "${requestForDisplay}" -Required by: ${issuerForDisplay} -`, - { request: requestForDisplay, issuer: issuerForDisplay } - ); - } - return npath.toPortablePath(result); - } - const issuerInformation = getPackageInformationSafe(issuerLocator); - let dependencyReference = issuerInformation.packageDependencies.get(dependencyName); - let fallbackReference = null; - if (dependencyReference == null) { - if (issuerLocator.name !== null) { - const exclusionEntry = runtimeState.fallbackExclusionList.get(issuerLocator.name); - const canUseFallbacks = !exclusionEntry || !exclusionEntry.has(issuerLocator.reference); - if (canUseFallbacks) { - for (let t = 0, T = fallbackLocators.length; t < T; ++t) { - const fallbackInformation = getPackageInformationSafe(fallbackLocators[t]); - const reference = fallbackInformation.packageDependencies.get(dependencyName); - if (reference == null) - continue; - if (alwaysWarnOnFallback) - fallbackReference = reference; - else - dependencyReference = reference; - break; - } - if (runtimeState.enableTopLevelFallback) { - if (dependencyReference == null && fallbackReference === null) { - const reference = runtimeState.fallbackPool.get(dependencyName); - if (reference != null) { - fallbackReference = reference; - } - } - } - } - } - } - let error = null; - if (dependencyReference === null) { - if (isDependencyTreeRoot(issuerLocator)) { - error = makeError( - ErrorCode.MISSING_PEER_DEPENDENCY, - `Your application tried to access ${dependencyName} (a peer dependency); this isn't allowed as there is no ancestor to satisfy the requirement. Use a devDependency if needed. - -Required package: ${dependencyName}${dependencyName !== requestForDisplay ? ` (via "${requestForDisplay}")` : ``} -Required by: ${issuerForDisplay} -`, - { request: requestForDisplay, issuer: issuerForDisplay, dependencyName } - ); - } else { - const brokenAncestors = findBrokenPeerDependencies(dependencyName, issuerLocator); - if (brokenAncestors.every((ancestor) => isDependencyTreeRoot(ancestor))) { - error = makeError( - ErrorCode.MISSING_PEER_DEPENDENCY, - `${issuerLocator.name} tried to access ${dependencyName} (a peer dependency) but it isn't provided by your application; this makes the require call ambiguous and unsound. - -Required package: ${dependencyName}${dependencyName !== requestForDisplay ? ` (via "${requestForDisplay}")` : ``} -Required by: ${issuerLocator.name}@${issuerLocator.reference} (via ${issuerForDisplay}) -${brokenAncestors.map((ancestorLocator) => `Ancestor breaking the chain: ${ancestorLocator.name}@${ancestorLocator.reference} -`).join(``)} -`, - { request: requestForDisplay, issuer: issuerForDisplay, issuerLocator: Object.assign({}, issuerLocator), dependencyName, brokenAncestors } - ); - } else { - error = makeError( - ErrorCode.MISSING_PEER_DEPENDENCY, - `${issuerLocator.name} tried to access ${dependencyName} (a peer dependency) but it isn't provided by its ancestors; this makes the require call ambiguous and unsound. - -Required package: ${dependencyName}${dependencyName !== requestForDisplay ? ` (via "${requestForDisplay}")` : ``} -Required by: ${issuerLocator.name}@${issuerLocator.reference} (via ${issuerForDisplay}) - -${brokenAncestors.map((ancestorLocator) => `Ancestor breaking the chain: ${ancestorLocator.name}@${ancestorLocator.reference} -`).join(``)} -`, - { request: requestForDisplay, issuer: issuerForDisplay, issuerLocator: Object.assign({}, issuerLocator), dependencyName, brokenAncestors } - ); - } - } - } else if (dependencyReference === void 0) { - if (!considerBuiltins && require$$0.isBuiltin(request)) { - if (isDependencyTreeRoot(issuerLocator)) { - error = makeError( - ErrorCode.UNDECLARED_DEPENDENCY, - `Your application tried to access ${dependencyName}. While this module is usually interpreted as a Node builtin, your resolver is running inside a non-Node resolution context where such builtins are ignored. Since ${dependencyName} isn't otherwise declared in your dependencies, this makes the require call ambiguous and unsound. - -Required package: ${dependencyName}${dependencyName !== requestForDisplay ? ` (via "${requestForDisplay}")` : ``} -Required by: ${issuerForDisplay} -`, - { request: requestForDisplay, issuer: issuerForDisplay, dependencyName } - ); - } else { - error = makeError( - ErrorCode.UNDECLARED_DEPENDENCY, - `${issuerLocator.name} tried to access ${dependencyName}. While this module is usually interpreted as a Node builtin, your resolver is running inside a non-Node resolution context where such builtins are ignored. Since ${dependencyName} isn't otherwise declared in ${issuerLocator.name}'s dependencies, this makes the require call ambiguous and unsound. - -Required package: ${dependencyName}${dependencyName !== requestForDisplay ? ` (via "${requestForDisplay}")` : ``} -Required by: ${issuerForDisplay} -`, - { request: requestForDisplay, issuer: issuerForDisplay, issuerLocator: Object.assign({}, issuerLocator), dependencyName } - ); - } - } else { - if (isDependencyTreeRoot(issuerLocator)) { - error = makeError( - ErrorCode.UNDECLARED_DEPENDENCY, - `Your application tried to access ${dependencyName}, but it isn't declared in your dependencies; this makes the require call ambiguous and unsound. - -Required package: ${dependencyName}${dependencyName !== requestForDisplay ? ` (via "${requestForDisplay}")` : ``} -Required by: ${issuerForDisplay} -`, - { request: requestForDisplay, issuer: issuerForDisplay, dependencyName } - ); - } else { - error = makeError( - ErrorCode.UNDECLARED_DEPENDENCY, - `${issuerLocator.name} tried to access ${dependencyName}, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound. - -Required package: ${dependencyName}${dependencyName !== requestForDisplay ? ` (via "${requestForDisplay}")` : ``} -Required by: ${issuerLocator.name}@${issuerLocator.reference} (via ${issuerForDisplay}) -`, - { request: requestForDisplay, issuer: issuerForDisplay, issuerLocator: Object.assign({}, issuerLocator), dependencyName } - ); - } - } - } - if (dependencyReference == null) { - if (fallbackReference === null || error === null) - throw error || new Error(`Assertion failed: Expected an error to have been set`); - dependencyReference = fallbackReference; - const message = error.message.replace(/\n.*/g, ``); - error.message = message; - if (!emittedWarnings.has(message) && debugLevel !== 0) { - emittedWarnings.add(message); - process.emitWarning(error); - } - } - const dependencyLocator = Array.isArray(dependencyReference) ? { name: dependencyReference[0], reference: dependencyReference[1] } : { name: dependencyName, reference: dependencyReference }; - const dependencyInformation = getPackageInformationSafe(dependencyLocator); - if (!dependencyInformation.packageLocation) { - throw makeError( - ErrorCode.MISSING_DEPENDENCY, - `A dependency seems valid but didn't get installed for some reason. This might be caused by a partial install, such as dev vs prod. - -Required package: ${dependencyLocator.name}@${dependencyLocator.reference}${dependencyLocator.name !== requestForDisplay ? ` (via "${requestForDisplay}")` : ``} -Required by: ${issuerLocator.name}@${issuerLocator.reference} (via ${issuerForDisplay}) -`, - { request: requestForDisplay, issuer: issuerForDisplay, dependencyLocator: Object.assign({}, dependencyLocator) } - ); - } - const dependencyLocation = dependencyInformation.packageLocation; - if (subPath) { - unqualifiedPath = ppath.join(dependencyLocation, subPath); - } else { - unqualifiedPath = dependencyLocation; - } - } - return ppath.normalize(unqualifiedPath); - } - function resolveUnqualifiedExport(request, unqualifiedPath, conditions = defaultExportsConditions, issuer) { - if (isStrictRegExp.test(request)) - return unqualifiedPath; - const unqualifiedExportPath = applyNodeExportsResolution(unqualifiedPath, conditions, issuer); - if (unqualifiedExportPath) { - return ppath.normalize(unqualifiedExportPath); - } else { - return unqualifiedPath; - } - } - function resolveUnqualified(unqualifiedPath, { extensions = Object.keys(require$$0.Module._extensions) } = {}) { - const candidates = []; - const qualifiedPath = applyNodeExtensionResolution(unqualifiedPath, candidates, { extensions }); - if (qualifiedPath) { - return ppath.normalize(qualifiedPath); - } else { - reportRequiredFilesToWatchMode(candidates.map((candidate) => npath.fromPortablePath(candidate))); - const unqualifiedPathForDisplay = getPathForDisplay(unqualifiedPath); - const containingPackage = findPackageLocator(unqualifiedPath); - if (containingPackage) { - const { packageLocation } = getPackageInformationSafe(containingPackage); - let exists = true; - try { - opts.fakeFs.accessSync(packageLocation); - } catch (err) { - if (err?.code === `ENOENT`) { - exists = false; - } else { - const readableError = (err?.message ?? err ?? `empty exception thrown`).replace(/^[A-Z]/, ($0) => $0.toLowerCase()); - throw makeError(ErrorCode.QUALIFIED_PATH_RESOLUTION_FAILED, `Required package exists but could not be accessed (${readableError}). - -Missing package: ${containingPackage.name}@${containingPackage.reference} -Expected package location: ${getPathForDisplay(packageLocation)} -`, { unqualifiedPath: unqualifiedPathForDisplay, extensions }); - } - } - if (!exists) { - const errorMessage = packageLocation.includes(`/unplugged/`) ? `Required unplugged package missing from disk. This may happen when switching branches without running installs (unplugged packages must be fully materialized on disk to work).` : `Required package missing from disk. If you keep your packages inside your repository then restarting the Node process may be enough. Otherwise, try to run an install first.`; - throw makeError( - ErrorCode.QUALIFIED_PATH_RESOLUTION_FAILED, - `${errorMessage} - -Missing package: ${containingPackage.name}@${containingPackage.reference} -Expected package location: ${getPathForDisplay(packageLocation)} -`, - { unqualifiedPath: unqualifiedPathForDisplay, extensions } - ); - } - } - throw makeError( - ErrorCode.QUALIFIED_PATH_RESOLUTION_FAILED, - `Qualified path resolution failed: we looked for the following paths, but none could be accessed. - -Source path: ${unqualifiedPathForDisplay} -${candidates.map((candidate) => `Not found: ${getPathForDisplay(candidate)} -`).join(``)}`, - { unqualifiedPath: unqualifiedPathForDisplay, extensions } - ); - } - } - function resolvePrivateRequest(request, issuer, opts2) { - if (!issuer) - throw new Error(`Assertion failed: An issuer is required to resolve private import mappings`); - const resolved = packageImportsResolve({ - name: request, - base: url.pathToFileURL(npath.fromPortablePath(issuer)), - conditions: opts2.conditions ?? defaultExportsConditions, - readFileSyncFn: tryReadFile - }); - if (resolved instanceof URL) { - return resolveUnqualified(npath.toPortablePath(url.fileURLToPath(resolved)), { extensions: opts2.extensions }); - } else { - if (resolved.startsWith(`#`)) - throw new Error(`Mapping from one private import to another isn't allowed`); - return resolveRequest(resolved, issuer, opts2); - } - } - function resolveRequest(request, issuer, opts2 = {}) { - try { - if (request.startsWith(`#`)) - return resolvePrivateRequest(request, issuer, opts2); - const { considerBuiltins, extensions, conditions } = opts2; - const unqualifiedPath = resolveToUnqualified(request, issuer, { considerBuiltins }); - if (request === `pnpapi`) - return unqualifiedPath; - if (unqualifiedPath === null) - return null; - const isIssuerIgnored = () => issuer !== null ? isPathIgnored(issuer) : false; - const remappedPath = (!considerBuiltins || !require$$0.isBuiltin(request)) && !isIssuerIgnored() ? resolveUnqualifiedExport(request, unqualifiedPath, conditions, issuer) : unqualifiedPath; - return resolveUnqualified(remappedPath, { extensions }); - } catch (error) { - if (Object.hasOwn(error, `pnpCode`)) - Object.assign(error.data, { request: getPathForDisplay(request), issuer: issuer && getPathForDisplay(issuer) }); - throw error; - } - } - function resolveVirtual(request) { - const normalized = ppath.normalize(request); - const resolved = VirtualFS.resolveVirtual(normalized); - return resolved !== normalized ? resolved : null; - } - return { - VERSIONS, - topLevel, - getLocator: (name, referencish) => { - if (Array.isArray(referencish)) { - return { name: referencish[0], reference: referencish[1] }; - } else { - return { name, reference: referencish }; - } - }, - getDependencyTreeRoots: () => { - return [...runtimeState.dependencyTreeRoots]; - }, - getAllLocators() { - const locators = []; - for (const [name, entry] of packageRegistry) - for (const reference of entry.keys()) - if (name !== null && reference !== null) - locators.push({ name, reference }); - return locators; - }, - getPackageInformation: (locator) => { - const info = getPackageInformation(locator); - if (info === null) - return null; - const packageLocation = npath.fromPortablePath(info.packageLocation); - const nativeInfo = { ...info, packageLocation }; - return nativeInfo; - }, - findPackageLocator: (path) => { - return findPackageLocator(npath.toPortablePath(path)); - }, - resolveToUnqualified: maybeLog(`resolveToUnqualified`, (request, issuer, opts2) => { - const portableIssuer = issuer !== null ? npath.toPortablePath(issuer) : null; - const resolution = resolveToUnqualified(npath.toPortablePath(request), portableIssuer, opts2); - if (resolution === null) - return null; - return npath.fromPortablePath(resolution); - }), - resolveUnqualified: maybeLog(`resolveUnqualified`, (unqualifiedPath, opts2) => { - return npath.fromPortablePath(resolveUnqualified(npath.toPortablePath(unqualifiedPath), opts2)); - }), - resolveRequest: maybeLog(`resolveRequest`, (request, issuer, opts2) => { - const portableIssuer = issuer !== null ? npath.toPortablePath(issuer) : null; - const resolution = resolveRequest(npath.toPortablePath(request), portableIssuer, opts2); - if (resolution === null) - return null; - return npath.fromPortablePath(resolution); - }), - resolveVirtual: maybeLog(`resolveVirtual`, (path) => { - const result = resolveVirtual(npath.toPortablePath(path)); - if (result !== null) { - return npath.fromPortablePath(result); - } else { - return null; - } - }) - }; -} - -function makeManager(pnpapi, opts) { - const initialApiPath = npath.toPortablePath(pnpapi.resolveToUnqualified(`pnpapi`, null)); - const initialApiStats = opts.fakeFs.statSync(npath.toPortablePath(initialApiPath)); - const apiMetadata = /* @__PURE__ */ new Map([ - [initialApiPath, { - instance: pnpapi, - stats: initialApiStats, - lastRefreshCheck: Date.now() - }] - ]); - function loadApiInstance(pnpApiPath) { - const nativePath = npath.fromPortablePath(pnpApiPath); - const module = new require$$0.Module(nativePath, null); - module.load(nativePath); - return module.exports; - } - function refreshApiEntry(pnpApiPath, apiEntry) { - const timeNow = Date.now(); - if (timeNow - apiEntry.lastRefreshCheck < 500) - return; - apiEntry.lastRefreshCheck = timeNow; - const stats = opts.fakeFs.statSync(pnpApiPath); - if (stats.mtime > apiEntry.stats.mtime) { - process.emitWarning(`[Warning] The runtime detected new information in a PnP file; reloading the API instance (${npath.fromPortablePath(pnpApiPath)})`); - apiEntry.stats = stats; - apiEntry.instance = loadApiInstance(pnpApiPath); - } - } - function getApiEntry(pnpApiPath, refresh = false) { - let apiEntry = apiMetadata.get(pnpApiPath); - if (typeof apiEntry !== `undefined`) { - if (refresh) { - refreshApiEntry(pnpApiPath, apiEntry); - } - } else { - apiMetadata.set(pnpApiPath, apiEntry = { - instance: loadApiInstance(pnpApiPath), - stats: opts.fakeFs.statSync(pnpApiPath), - lastRefreshCheck: Date.now() - }); - } - return apiEntry; - } - const findApiPathCache = /* @__PURE__ */ new Map(); - function addToCacheAndReturn(start, end, target) { - if (target !== null) { - target = VirtualFS.resolveVirtual(target); - target = opts.fakeFs.realpathSync(target); - } - let curr; - let next = start; - do { - curr = next; - findApiPathCache.set(curr, target); - next = ppath.dirname(curr); - } while (curr !== end); - return target; - } - function findApiPathFor(modulePath) { - let bestCandidate = null; - for (const [apiPath, apiEntry] of apiMetadata) { - const locator = apiEntry.instance.findPackageLocator(modulePath); - if (!locator) - continue; - if (apiMetadata.size === 1) - return apiPath; - const packageInformation = apiEntry.instance.getPackageInformation(locator); - if (!packageInformation) - throw new Error(`Assertion failed: Couldn't get package information for '${modulePath}'`); - if (!bestCandidate) - bestCandidate = { packageLocation: packageInformation.packageLocation, apiPaths: [] }; - if (packageInformation.packageLocation === bestCandidate.packageLocation) { - bestCandidate.apiPaths.push(apiPath); - } else if (packageInformation.packageLocation.length > bestCandidate.packageLocation.length) { - bestCandidate = { packageLocation: packageInformation.packageLocation, apiPaths: [apiPath] }; - } - } - if (bestCandidate) { - if (bestCandidate.apiPaths.length === 1) - return bestCandidate.apiPaths[0]; - const controlSegment = bestCandidate.apiPaths.map((apiPath) => ` ${npath.fromPortablePath(apiPath)}`).join(` -`); - throw new Error(`Unable to locate pnpapi, the module '${modulePath}' is controlled by multiple pnpapi instances. -This is usually caused by using the global cache (enableGlobalCache: true) - -Controlled by: -${controlSegment} -`); - } - const start = ppath.resolve(npath.toPortablePath(modulePath)); - let curr; - let next = start; - do { - curr = next; - const cached = findApiPathCache.get(curr); - if (cached !== void 0) - return addToCacheAndReturn(start, curr, cached); - const cjsCandidate = ppath.join(curr, Filename.pnpCjs); - if (opts.fakeFs.existsSync(cjsCandidate) && opts.fakeFs.statSync(cjsCandidate).isFile()) - return addToCacheAndReturn(start, curr, cjsCandidate); - const legacyCjsCandidate = ppath.join(curr, Filename.pnpJs); - if (opts.fakeFs.existsSync(legacyCjsCandidate) && opts.fakeFs.statSync(legacyCjsCandidate).isFile()) - return addToCacheAndReturn(start, curr, legacyCjsCandidate); - next = ppath.dirname(curr); - } while (curr !== PortablePath.root); - return addToCacheAndReturn(start, curr, null); - } - const moduleToApiPathCache = /* @__PURE__ */ new WeakMap(); - function getApiPathFromParent(parent) { - if (parent == null) - return initialApiPath; - let apiPath = moduleToApiPathCache.get(parent); - if (typeof apiPath !== `undefined`) - return apiPath; - apiPath = parent.filename ? findApiPathFor(parent.filename) : null; - moduleToApiPathCache.set(parent, apiPath); - return apiPath; - } - return { - getApiPathFromParent, - findApiPathFor, - getApiEntry - }; -} - -const localFs = { ...fs__default.default }; -const nodeFs = new NodeFS(localFs); -const defaultRuntimeState = $$SETUP_STATE(hydrateRuntimeState); -const defaultPnpapiResolution = __filename; -const defaultFsLayer = new VirtualFS({ - baseFs: new ZipOpenFS({ - baseFs: nodeFs, - maxOpenFiles: 80, - readOnlyArchives: true - }) -}); -class DynamicFS extends ProxiedFS { - constructor() { - super(ppath); - this.baseFs = defaultFsLayer; - } - mapToBase(p) { - return p; - } - mapFromBase(p) { - return p; - } -} -const dynamicFsLayer = new DynamicFS(); -let manager; -const defaultApi = Object.assign(makeApi(defaultRuntimeState, { - fakeFs: dynamicFsLayer, - pnpapiResolution: defaultPnpapiResolution -}), { - makeApi: ({ - basePath = void 0, - fakeFs = dynamicFsLayer, - pnpapiResolution = defaultPnpapiResolution, - ...rest - }) => { - const apiRuntimeState = typeof basePath !== `undefined` ? $$SETUP_STATE(hydrateRuntimeState, basePath) : defaultRuntimeState; - return makeApi(apiRuntimeState, { - fakeFs, - pnpapiResolution, - ...rest - }); - }, - setup: (api) => { - applyPatch(api || defaultApi, { - fakeFs: defaultFsLayer, - manager - }); - dynamicFsLayer.baseFs = new NodeFS(fs__default.default); - } -}); -manager = makeManager(defaultApi, { - fakeFs: dynamicFsLayer -}); -if (module.parent && module.parent.id === `internal/preload`) { - defaultApi.setup(); - if (module.filename) { - delete require$$0__default.default._cache[module.filename]; - } -} -if (process.mainModule === module) { - const reportError = (code, message, data) => { - process.stdout.write(`${JSON.stringify([{ code, message, data }, null])} -`); - }; - const reportSuccess = (resolution) => { - process.stdout.write(`${JSON.stringify([null, resolution])} -`); - }; - const processResolution = (request, issuer) => { - try { - reportSuccess(defaultApi.resolveRequest(request, issuer)); - } catch (error) { - reportError(error.code, error.message, error.data); - } - }; - const processRequest = (data) => { - try { - const [request, issuer] = JSON.parse(data); - processResolution(request, issuer); - } catch (error) { - reportError(`INVALID_JSON`, error.message, error.data); - } - }; - if (process.argv.length > 2) { - if (process.argv.length !== 4) { - process.stderr.write(`Usage: ${process.argv[0]} ${process.argv[1]} -`); - process.exitCode = 64; - } else { - processResolution(process.argv[2], process.argv[3]); - } - } else { - let buffer = ``; - const decoder = new StringDecoder__default.default.StringDecoder(); - process.stdin.on(`data`, (chunk) => { - buffer += decoder.write(chunk); - do { - const index = buffer.indexOf(` -`); - if (index === -1) - break; - const line = buffer.slice(0, index); - buffer = buffer.slice(index + 1); - processRequest(line); - } while (true); - }); - } -} - -module.exports = defaultApi; diff --git a/fixtures/pnp/.yarnrc.yml b/fixtures/pnp/.yarnrc.yml deleted file mode 100644 index 6a6b24d8..00000000 --- a/fixtures/pnp/.yarnrc.yml +++ /dev/null @@ -1 +0,0 @@ -enableGlobalCache: 0 diff --git a/fixtures/pnp/package.json b/fixtures/pnp/package.json deleted file mode 100644 index 5d119379..00000000 --- a/fixtures/pnp/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "pnp", - "packageManager": "yarn@4.3.1", - "dependencies": { - "is-even": "^1.0.0", - "is-odd": "^3.0.1" - } -} diff --git a/fixtures/pnp/yarn.lock b/fixtures/pnp/yarn.lock deleted file mode 100644 index ba89514d..00000000 --- a/fixtures/pnp/yarn.lock +++ /dev/null @@ -1,74 +0,0 @@ -# This file is generated by running "yarn install" inside your project. -# Manual changes might be lost - proceed with caution! - -__metadata: - version: 8 - cacheKey: 10c0 - -"is-buffer@npm:^1.1.5": - version: 1.1.6 - resolution: "is-buffer@npm:1.1.6" - checksum: 10c0/ae18aa0b6e113d6c490ad1db5e8df9bdb57758382b313f5a22c9c61084875c6396d50bbf49315f5b1926d142d74dfb8d31b40d993a383e0a158b15fea7a82234 - languageName: node - linkType: hard - -"is-even@npm:^1.0.0": - version: 1.0.0 - resolution: "is-even@npm:1.0.0" - dependencies: - is-odd: "npm:^0.1.2" - checksum: 10c0/2728cc2f390d07c6a44a054aa53ae6ce57c3a4adfd76a92df528e992b4a978fdec4eaa948e0de6e6431ef3c8deebf1c964fd870d4983044ec9f0f4e630dfb3a5 - languageName: node - linkType: hard - -"is-number@npm:^3.0.0": - version: 3.0.0 - resolution: "is-number@npm:3.0.0" - dependencies: - kind-of: "npm:^3.0.2" - checksum: 10c0/e639c54640b7f029623df24d3d103901e322c0c25ea5bde97cd723c2d0d4c05857a8364ab5c58d963089dbed6bf1d0ffe975cb6aef917e2ad0ccbca653d31b4f - languageName: node - linkType: hard - -"is-number@npm:^6.0.0": - version: 6.0.0 - resolution: "is-number@npm:6.0.0" - checksum: 10c0/5da4c68401529675c575878d2760d66f18eaef4b014858577f6003daf66488d7fe4eae684b1e8574e3fa1bb447c6c6c56b8491d2b4b3239da2d32e5f6f218008 - languageName: node - linkType: hard - -"is-odd@npm:^0.1.2": - version: 0.1.2 - resolution: "is-odd@npm:0.1.2" - dependencies: - is-number: "npm:^3.0.0" - checksum: 10c0/7dc6c6fd004861208ef9f324021c66f19b3dad209c2da3ef3720d4d76e141974fadb52c47b439fc8c52af579468640b554115395b5673f4558ef09719260e898 - languageName: node - linkType: hard - -"is-odd@npm:^3.0.1": - version: 3.0.1 - resolution: "is-odd@npm:3.0.1" - dependencies: - is-number: "npm:^6.0.0" - checksum: 10c0/89ee2e353c5a3f3bd400c79db1c307a5b3506198ee8169d521e533a9b1d8a08fc95f21a919c084e98845b4286d7ffe309778da03744dfe66c3c1763ab1a030c6 - languageName: node - linkType: hard - -"kind-of@npm:^3.0.2": - version: 3.2.2 - resolution: "kind-of@npm:3.2.2" - dependencies: - is-buffer: "npm:^1.1.5" - checksum: 10c0/7e34bc29d4b02c997f92f080de34ebb92033a96736bbb0bb2410e033a7e5ae6571f1fa37b2d7710018f95361473b816c604234197f4f203f9cf149d8ef1574d9 - languageName: node - linkType: hard - -"pnp@workspace:.": - version: 0.0.0-use.local - resolution: "pnp@workspace:." - dependencies: - is-even: "npm:^1.0.0" - is-odd: "npm:^3.0.1" - languageName: unknown - linkType: soft diff --git a/fixtures/pnpm/.gitignore b/fixtures/pnpm/.gitignore deleted file mode 100644 index 3c3629e6..00000000 --- a/fixtures/pnpm/.gitignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/fixtures/pnpm/package.json b/fixtures/pnpm/package.json deleted file mode 100644 index b763d74d..00000000 --- a/fixtures/pnpm/package.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "name": "pnpm", - "version": "1.0.0", - "private": true, - "devDependencies": { - "axios": "1.6.2", - "ipaddr.js": "2.2.0", - "postcss": "8.4.33", - "styled-components": "6.1.1" - } -} diff --git a/fixtures/pnpm/pnpm-lock.yaml b/fixtures/pnpm/pnpm-lock.yaml deleted file mode 100644 index e51dfd6a..00000000 --- a/fixtures/pnpm/pnpm-lock.yaml +++ /dev/null @@ -1,212 +0,0 @@ -lockfileVersion: '6.0' - -settings: - autoInstallPeers: true - excludeLinksFromLockfile: false - -devDependencies: - axios: - specifier: 1.6.2 - version: 1.6.2 - postcss: - specifier: 8.4.33 - version: 8.4.33 - styled-components: - specifier: 6.1.1 - version: 6.1.1(react-dom@18.2.0)(react@18.2.0) - -packages: - - /@emotion/is-prop-valid@1.2.1: - resolution: {integrity: sha512-61Mf7Ufx4aDxx1xlDeOm8aFFigGHE4z+0sKCa+IHCeZKiyP9RLD0Mmx7m8b9/Cf37f7NAvQOOJAbQQGVr5uERw==} - dependencies: - '@emotion/memoize': 0.8.1 - dev: true - - /@emotion/memoize@0.8.1: - resolution: {integrity: sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA==} - dev: true - - /@emotion/unitless@0.8.1: - resolution: {integrity: sha512-KOEGMu6dmJZtpadb476IsZBclKvILjopjUii3V+7MnXIQCYh8W3NgNcgwo21n9LXZX6EDIKvqfjYxXebDwxKmQ==} - dev: true - - /@types/stylis@4.2.4: - resolution: {integrity: sha512-36ZrGJ8fgtBr6nwNnuJ9jXIj+bn/pF6UoqmrQT7+Y99+tFFeHHsoR54+194dHdyhPjgbeoNz3Qru0oRt0l6ASQ==} - dev: true - - /asynckit@0.4.0: - resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} - dev: true - - /axios@1.6.2: - resolution: {integrity: sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A==} - dependencies: - follow-redirects: 1.15.3 - form-data: 4.0.0 - proxy-from-env: 1.1.0 - transitivePeerDependencies: - - debug - dev: true - - /camelize@1.0.1: - resolution: {integrity: sha512-dU+Tx2fsypxTgtLoE36npi3UqcjSSMNYfkqgmoEhtZrraP5VWq0K7FkWVTYa8eMPtnU/G2txVsfdCJTn9uzpuQ==} - dev: true - - /combined-stream@1.0.8: - resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} - engines: {node: '>= 0.8'} - dependencies: - delayed-stream: 1.0.0 - dev: true - - /css-color-keywords@1.0.0: - resolution: {integrity: sha512-FyyrDHZKEjXDpNJYvVsV960FiqQyXc/LlYmsxl2BcdMb2WPx0OGRVgTg55rPSyLSNMqP52R9r8geSp7apN3Ofg==} - engines: {node: '>=4'} - dev: true - - /css-to-react-native@3.2.0: - resolution: {integrity: sha512-e8RKaLXMOFii+02mOlqwjbD00KSEKqblnpO9e++1aXS1fPQOpS1YoqdVHBqPjHNoxeF2mimzVqawm2KCbEdtHQ==} - dependencies: - camelize: 1.0.1 - css-color-keywords: 1.0.0 - postcss-value-parser: 4.2.0 - dev: true - - /csstype@3.1.2: - resolution: {integrity: sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==} - dev: true - - /delayed-stream@1.0.0: - resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} - engines: {node: '>=0.4.0'} - dev: true - - /follow-redirects@1.15.3: - resolution: {integrity: sha512-1VzOtuEM8pC9SFU1E+8KfTjZyMztRsgEfwQl44z8A25uy13jSzTj6dyK2Df52iV0vgHCfBwLhDWevLn95w5v6Q==} - engines: {node: '>=4.0'} - peerDependencies: - debug: '*' - peerDependenciesMeta: - debug: - optional: true - dev: true - - /form-data@4.0.0: - resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==} - engines: {node: '>= 6'} - dependencies: - asynckit: 0.4.0 - combined-stream: 1.0.8 - mime-types: 2.1.35 - dev: true - - /js-tokens@4.0.0: - resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} - dev: true - - /loose-envify@1.4.0: - resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==} - hasBin: true - dependencies: - js-tokens: 4.0.0 - dev: true - - /mime-db@1.52.0: - resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} - engines: {node: '>= 0.6'} - dev: true - - /mime-types@2.1.35: - resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} - engines: {node: '>= 0.6'} - dependencies: - mime-db: 1.52.0 - dev: true - - /nanoid@3.3.7: - resolution: {integrity: sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==} - engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} - hasBin: true - dev: true - - /picocolors@1.0.0: - resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==} - dev: true - - /postcss-value-parser@4.2.0: - resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==} - dev: true - - /postcss@8.4.33: - resolution: {integrity: sha512-Kkpbhhdjw2qQs2O2DGX+8m5OVqEcbB9HRBvuYM9pgrjEFUg30A9LmXNlTAUj4S9kgtGyrMbTzVjH7E+s5Re2yg==} - engines: {node: ^10 || ^12 || >=14} - dependencies: - nanoid: 3.3.7 - picocolors: 1.0.0 - source-map-js: 1.0.2 - dev: true - - /proxy-from-env@1.1.0: - resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==} - dev: true - - /react-dom@18.2.0(react@18.2.0): - resolution: {integrity: sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==} - peerDependencies: - react: ^18.2.0 - dependencies: - loose-envify: 1.4.0 - react: 18.2.0 - scheduler: 0.23.0 - dev: true - - /react@18.2.0: - resolution: {integrity: sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==} - engines: {node: '>=0.10.0'} - dependencies: - loose-envify: 1.4.0 - dev: true - - /scheduler@0.23.0: - resolution: {integrity: sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw==} - dependencies: - loose-envify: 1.4.0 - dev: true - - /shallowequal@1.1.0: - resolution: {integrity: sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ==} - dev: true - - /source-map-js@1.0.2: - resolution: {integrity: sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==} - engines: {node: '>=0.10.0'} - dev: true - - /styled-components@6.1.1(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-cpZZP5RrKRIClBW5Eby4JM1wElLVP4NQrJbJ0h10TidTyJf4SIIwa3zLXOoPb4gJi8MsJ8mjq5mu2IrEhZIAcQ==} - engines: {node: '>= 16'} - peerDependencies: - react: '>= 16.8.0' - react-dom: '>= 16.8.0' - dependencies: - '@emotion/is-prop-valid': 1.2.1 - '@emotion/unitless': 0.8.1 - '@types/stylis': 4.2.4 - css-to-react-native: 3.2.0 - csstype: 3.1.2 - postcss: 8.4.33 - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - shallowequal: 1.1.0 - stylis: 4.3.0 - tslib: 2.6.2 - dev: true - - /stylis@4.3.0: - resolution: {integrity: sha512-E87pIogpwUsUwXw7dNyU4QDjdgVMy52m+XEOPEKUn161cCzWjjhPSQhByfd1CcNvrOLnXQ6OnnZDwnJrz/Z4YQ==} - dev: true - - /tslib@2.6.2: - resolution: {integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==} - dev: true diff --git a/fixtures/tsconfig/cases/builtins/thing.js b/fixtures/tsconfig/cases/builtins/thing.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/builtins/tsconfig.json b/fixtures/tsconfig/cases/builtins/tsconfig.json deleted file mode 100644 index 36aa1a4d..00000000 --- a/fixtures/tsconfig/cases/builtins/tsconfig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compilerOptions": { - "baseUrl": "." - } -} diff --git a/fixtures/tsconfig/cases/exports/index.js b/fixtures/tsconfig/cases/exports/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/exports/tsconfig.json b/fixtures/tsconfig/cases/exports/tsconfig.json deleted file mode 100644 index f0e3159b..00000000 --- a/fixtures/tsconfig/cases/exports/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-exports" -} diff --git a/fixtures/tsconfig/cases/extends-extension/base-tsconfig.json b/fixtures/tsconfig/cases/extends-extension/base-tsconfig.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/cases/extends-extension/base-tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/cases/extends-extension/foo.js b/fixtures/tsconfig/cases/extends-extension/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-extension/tsconfig.json b/fixtures/tsconfig/cases/extends-extension/tsconfig.json deleted file mode 100644 index 0ae4c6a3..00000000 --- a/fixtures/tsconfig/cases/extends-extension/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./base-tsconfig" -} diff --git a/fixtures/tsconfig/cases/extends-extensionless/foo.js b/fixtures/tsconfig/cases/extends-extensionless/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-extensionless/tsconfig.json b/fixtures/tsconfig/cases/extends-extensionless/tsconfig.json deleted file mode 100644 index c36cb7d4..00000000 --- a/fixtures/tsconfig/cases/extends-extensionless/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-field/conf" -} diff --git a/fixtures/tsconfig/cases/extends-multiple/foo.js b/fixtures/tsconfig/cases/extends-multiple/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-multiple/tsconfig.json b/fixtures/tsconfig/cases/extends-multiple/tsconfig.json deleted file mode 100644 index aa2ae783..00000000 --- a/fixtures/tsconfig/cases/extends-multiple/tsconfig.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": ["../extends-extension", "../extends-paths"], - "compilerOptions": { - "baseUrl": ".", - }, -} diff --git a/fixtures/tsconfig/cases/extends-not-found/index.js b/fixtures/tsconfig/cases/extends-not-found/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-not-found/tsconfig.json b/fixtures/tsconfig/cases/extends-not-found/tsconfig.json deleted file mode 100644 index 99df91da..00000000 --- a/fixtures/tsconfig/cases/extends-not-found/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./not-found" -} diff --git a/fixtures/tsconfig/cases/extends-paths/src/index.js b/fixtures/tsconfig/cases/extends-paths/src/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-paths/tsconfig.base.json b/fixtures/tsconfig/cases/extends-paths/tsconfig.base.json deleted file mode 100644 index 5c64b067..00000000 --- a/fixtures/tsconfig/cases/extends-paths/tsconfig.base.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "@/*": ["./*"] - } - } -} diff --git a/fixtures/tsconfig/cases/extends-paths/tsconfig.json b/fixtures/tsconfig/cases/extends-paths/tsconfig.json deleted file mode 100644 index 51086018..00000000 --- a/fixtures/tsconfig/cases/extends-paths/tsconfig.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": "./tsconfig.base.json", - "compilerOptions": { - "baseUrl": "src", - }, -} diff --git a/fixtures/tsconfig/cases/field/index.js b/fixtures/tsconfig/cases/field/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/field/tsconfig.json b/fixtures/tsconfig/cases/field/tsconfig.json deleted file mode 100644 index 9f86c3f4..00000000 --- a/fixtures/tsconfig/cases/field/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-field" -} diff --git a/fixtures/tsconfig/cases/index/index.js b/fixtures/tsconfig/cases/index/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/index/tsconfig.json b/fixtures/tsconfig/cases/index/tsconfig.json deleted file mode 100644 index d20b1774..00000000 --- a/fixtures/tsconfig/cases/index/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-index" -} diff --git a/fixtures/tsconfig/cases/paths_template_variable/foo.js b/fixtures/tsconfig/cases/paths_template_variable/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json b/fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json deleted file mode 100644 index a1a37bb6..00000000 --- a/fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "../../tsconfig_template_variable.json" -} diff --git a/fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json b/fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json deleted file mode 100644 index e7d8e5e5..00000000 --- a/fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "compilerOptions": { - "composite": true, - "paths": { - "foo": ["${configDir}/foo.js"] - } - } -} diff --git a/fixtures/tsconfig/cases/project_references/app/aliased/index.ts b/fixtures/tsconfig/cases/project_references/app/aliased/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/app/index.ts b/fixtures/tsconfig/cases/project_references/app/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/app/tsconfig.json b/fixtures/tsconfig/cases/project_references/app/tsconfig.json deleted file mode 100644 index 7036d2bb..00000000 --- a/fixtures/tsconfig/cases/project_references/app/tsconfig.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "extends": "../tsconfig.base.json", - "compilerOptions": { - "baseUrl": "./", - "paths": { - "@/*": ["./aliased/*"] - } - }, - "references": [ - { - "path": "../project_a/conf.json" - }, - { - "path": "../project_b" - }, - { - "path": "../project_c/tsconfig.json" - }, - { - "path": "../../paths_template_variable/tsconfig2.json" - } - ] -} diff --git a/fixtures/tsconfig/cases/project_references/project_a/aliased/index.ts b/fixtures/tsconfig/cases/project_references/project_a/aliased/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_a/conf.json b/fixtures/tsconfig/cases/project_references/project_a/conf.json deleted file mode 100644 index 4d389d7a..00000000 --- a/fixtures/tsconfig/cases/project_references/project_a/conf.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "compilerOptions": { - "composite": true, - "paths": { - "@/*": ["./aliased/*"] - } - } -} diff --git a/fixtures/tsconfig/cases/project_references/project_a/index.ts b/fixtures/tsconfig/cases/project_references/project_a/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_b/src/aliased/index.ts b/fixtures/tsconfig/cases/project_references/project_b/src/aliased/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_b/tsconfig.json b/fixtures/tsconfig/cases/project_references/project_b/tsconfig.json deleted file mode 100644 index 4ab05cd8..00000000 --- a/fixtures/tsconfig/cases/project_references/project_b/tsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "compilerOptions": { - "composite": true, - "baseUrl": "./src", - "paths": { - "@/*": ["./aliased/*"] - } - } -} diff --git a/fixtures/tsconfig/cases/project_references/project_c/index.ts b/fixtures/tsconfig/cases/project_references/project_c/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_c/tsconfig.json b/fixtures/tsconfig/cases/project_references/project_c/tsconfig.json deleted file mode 100644 index fe520939..00000000 --- a/fixtures/tsconfig/cases/project_references/project_c/tsconfig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compilerOptions": { - "composite": true - } -} diff --git a/fixtures/tsconfig/cases/project_references/tsconfig.base.json b/fixtures/tsconfig/cases/project_references/tsconfig.base.json deleted file mode 100644 index 88ccffe7..00000000 --- a/fixtures/tsconfig/cases/project_references/tsconfig.base.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "compilerOptions": { - } -} diff --git a/fixtures/tsconfig/cases/suffixes/a.ios.ts b/fixtures/tsconfig/cases/suffixes/a.ios.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/a.ts b/fixtures/tsconfig/cases/suffixes/a.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/b.ts b/fixtures/tsconfig/cases/suffixes/b.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/c-test.ts b/fixtures/tsconfig/cases/suffixes/c-test.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/index.ts b/fixtures/tsconfig/cases/suffixes/index.ts deleted file mode 100644 index b09939b9..00000000 --- a/fixtures/tsconfig/cases/suffixes/index.ts +++ /dev/null @@ -1 +0,0 @@ -import './a'; diff --git a/fixtures/tsconfig/cases/suffixes/tsconfig.json b/fixtures/tsconfig/cases/suffixes/tsconfig.json deleted file mode 100644 index 4c2ccc8f..00000000 --- a/fixtures/tsconfig/cases/suffixes/tsconfig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compilerOptions": { - "moduleSuffixes": [".ios", "-test", ""] - } -} diff --git a/fixtures/tsconfig/cases/trailing-comma/bar.js b/fixtures/tsconfig/cases/trailing-comma/bar.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/trailing-comma/index.js b/fixtures/tsconfig/cases/trailing-comma/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/trailing-comma/tsconfig.json b/fixtures/tsconfig/cases/trailing-comma/tsconfig.json deleted file mode 100644 index 6dc20ca5..00000000 --- a/fixtures/tsconfig/cases/trailing-comma/tsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "compilerOptions": { - "paths": { - /* some comment */ - "foo": ["bar.js"], - }, - }, - // another comment -} diff --git a/fixtures/tsconfig/foo.js b/fixtures/tsconfig/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/nested/index.js b/fixtures/tsconfig/nested/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/nested/test.js b/fixtures/tsconfig/nested/test.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/nested/tsconfig.json b/fixtures/tsconfig/nested/tsconfig.json deleted file mode 100644 index 6deb3011..00000000 --- a/fixtures/tsconfig/nested/tsconfig.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "extends": "..", - "compilerOptions": { - "paths": { - "ts-path": ["test.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-exports/conf.json b/fixtures/tsconfig/node_modules/tsconfig-exports/conf.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-exports/conf.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-exports/foo.js b/fixtures/tsconfig/node_modules/tsconfig-exports/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-exports/package.json b/fixtures/tsconfig/node_modules/tsconfig-exports/package.json deleted file mode 100644 index be0ddee6..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-exports/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "tsconfig-exports", - "private": true, - "exports": { - ".": "./conf.json" - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-field/conf.json b/fixtures/tsconfig/node_modules/tsconfig-field/conf.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-field/conf.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-field/foo.js b/fixtures/tsconfig/node_modules/tsconfig-field/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-field/package.json b/fixtures/tsconfig/node_modules/tsconfig-field/package.json deleted file mode 100644 index 7138fdde..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-field/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "tsconfig-field", - "private": true, - "tsconfig": "conf.json" -} \ No newline at end of file diff --git a/fixtures/tsconfig/node_modules/tsconfig-index/foo.js b/fixtures/tsconfig/node_modules/tsconfig-index/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-index/package.json b/fixtures/tsconfig/node_modules/tsconfig-index/package.json deleted file mode 100644 index eb2431e7..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-index/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "tsconfig-index", - "private": true -} \ No newline at end of file diff --git a/fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json b/fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-not-used/foo.js b/fixtures/tsconfig/node_modules/tsconfig-not-used/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json b/fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json deleted file mode 100644 index eb16d127..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "ts-path": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/package.json b/fixtures/tsconfig/package.json deleted file mode 100755 index f48acd1c..00000000 --- a/fixtures/tsconfig/package.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "name": "resolver", - "private": true, - "alias": { - "aliased": "foo", - "aliased-file": "./bar.js", - "something": "./nested/test.js", - "aliasedfolder": "./nested", - "aliasedabsolute": "/nested", - "foo/bar": "./bar.js", - "glob/*/*": "./nested/$2", - "./baz": "./bar.js", - "url": false - }, - "imports": { - "#test": "./bar.js" - }, - "dependencies": { - "foo": "^0.3.4" - }, - "peerDependencies": { - "bar": "*" - } -} diff --git a/fixtures/tsconfig/tsconfig.json b/fixtures/tsconfig/tsconfig.json deleted file mode 100644 index eb16d127..00000000 --- a/fixtures/tsconfig/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "ts-path": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/tsconfig_broken.json b/fixtures/tsconfig/tsconfig_broken.json deleted file mode 100644 index 98232c64..00000000 --- a/fixtures/tsconfig/tsconfig_broken.json +++ /dev/null @@ -1 +0,0 @@ -{ diff --git a/fixtures/tsconfig/tsconfig_template_variable.json b/fixtures/tsconfig/tsconfig_template_variable.json deleted file mode 100644 index 6f272344..00000000 --- a/fixtures/tsconfig/tsconfig_template_variable.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["${configDir}/foo.js"] - } - } -} diff --git a/napi/__test__/resolver.spec.mjs b/napi/__test__/resolver.spec.mjs deleted file mode 100644 index ac6ee0ef..00000000 --- a/napi/__test__/resolver.spec.mjs +++ /dev/null @@ -1,260 +0,0 @@ -import { join } from 'node:path' -import { fileURLToPath } from 'node:url' - -import test from 'ava' - -let ResolverFactory - -if (process.env.WASI_TEST) { - const wasi = await import('../resolver.wasi.cjs') - ResolverFactory = wasi.ResolverFactory -} else { - const napi = await import('../index.js') - ResolverFactory = napi.ResolverFactory -} - -const currentDir = join(fileURLToPath(import.meta.url), '..') - -const enhancedResolveRoot = join( - currentDir, - '..', - '..', - 'fixtures', - 'enhanced_resolve', - 'test', - 'fixtures' -) - -// https://github.com/webpack/enhanced-resolve/blob/main/test/resolve.test.js - -for (const [title, context, request, expected] of [ - [ - 'absolute path', - enhancedResolveRoot, - join(enhancedResolveRoot, 'main1.js'), - join(enhancedResolveRoot, 'main1.js'), - ], - [ - 'file with .js', - enhancedResolveRoot, - './main1.js', - join(enhancedResolveRoot, 'main1.js'), - ], - [ - 'file without extension', - enhancedResolveRoot, - './main1', - join(enhancedResolveRoot, 'main1.js'), - ], - [ - 'another file with .js', - enhancedResolveRoot, - './a.js', - join(enhancedResolveRoot, 'a.js'), - ], - [ - 'another file without extension', - enhancedResolveRoot, - './a', - join(enhancedResolveRoot, 'a.js'), - ], - [ - 'file in module with .js', - enhancedResolveRoot, - 'm1/a.js', - join(enhancedResolveRoot, 'node_modules/m1/a.js'), - ], - [ - 'file in module without extension', - enhancedResolveRoot, - 'm1/a', - join(enhancedResolveRoot, 'node_modules/m1/a.js'), - ], - [ - 'another file in module without extension', - enhancedResolveRoot, - 'complexm/step1', - join(enhancedResolveRoot, 'node_modules/complexm/step1.js'), - ], - [ - 'from submodule to file in sibling module', - join(enhancedResolveRoot, 'node_modules/complexm'), - 'm2/b.js', - join(enhancedResolveRoot, 'node_modules/m2/b.js'), - ], - [ - 'from nested directory to overwritten file in module', - join(enhancedResolveRoot, 'multiple_modules'), - 'm1/a.js', - join(enhancedResolveRoot, 'multiple_modules/node_modules/m1/a.js'), - ], - [ - 'from nested directory to not overwritten file in module', - join(enhancedResolveRoot, 'multiple_modules'), - 'm1/b.js', - join(enhancedResolveRoot, 'node_modules/m1/b.js'), - ], - [ - 'file with query', - enhancedResolveRoot, - './main1.js?query', - join(enhancedResolveRoot, 'main1.js?query'), - ], - [ - 'file with fragment', - enhancedResolveRoot, - './main1.js#fragment', - join(enhancedResolveRoot, 'main1.js#fragment'), - ], - [ - 'file with fragment and query', - enhancedResolveRoot, - './main1.js#fragment?query', - join(enhancedResolveRoot, 'main1.js#fragment?query'), - ], - [ - 'file with query and fragment', - enhancedResolveRoot, - './main1.js?#fragment', - join(enhancedResolveRoot, 'main1.js?#fragment'), - ], - - [ - 'file with query (unicode)', - enhancedResolveRoot, - './测试.js?query', - join(enhancedResolveRoot, '测试.js?query'), - ], - [ - 'file with fragment (unicode)', - enhancedResolveRoot, - './测试.js#fragment', - join(enhancedResolveRoot, '测试.js#fragment'), - ], - [ - 'file with fragment and query (unicode)', - enhancedResolveRoot, - './测试.js#fragment?query', - join(enhancedResolveRoot, '测试.js#fragment?query'), - ], - [ - 'file with query and fragment (unicode)', - enhancedResolveRoot, - './测试.js?#fragment', - join(enhancedResolveRoot, '测试.js?#fragment'), - ], - - [ - 'file in module with query', - enhancedResolveRoot, - 'm1/a?query', - join(enhancedResolveRoot, 'node_modules/m1/a.js?query'), - ], - [ - 'file in module with fragment', - enhancedResolveRoot, - 'm1/a#fragment', - join(enhancedResolveRoot, 'node_modules/m1/a.js#fragment'), - ], - [ - 'file in module with fragment and query', - enhancedResolveRoot, - 'm1/a#fragment?query', - join(enhancedResolveRoot, 'node_modules/m1/a.js#fragment?query'), - ], - [ - 'file in module with query and fragment', - enhancedResolveRoot, - 'm1/a?#fragment', - join(enhancedResolveRoot, 'node_modules/m1/a.js?#fragment'), - ], - [ - 'differ between directory and file, resolve file', - enhancedResolveRoot, - './dirOrFile', - join(enhancedResolveRoot, 'dirOrFile.js'), - ], - [ - 'differ between directory and file, resolve directory', - enhancedResolveRoot, - './dirOrFile/', - join(enhancedResolveRoot, 'dirOrFile/index.js'), - ], - [ - 'find node_modules outside of node_modules', - join(enhancedResolveRoot, 'browser-module/node_modules'), - 'm1/a', - join(enhancedResolveRoot, 'node_modules/m1/a.js'), - ], - [ - "don't crash on main field pointing to self", - enhancedResolveRoot, - './main-field-self', - join(enhancedResolveRoot, './main-field-self/index.js'), - ], - [ - "don't crash on main field pointing to self (2)", - enhancedResolveRoot, - './main-field-self2', - join(enhancedResolveRoot, './main-field-self2/index.js'), - ], - // enhanced-resolve has `#` prepended with a `\0`, they are removed from the - // following 3 expected test results. - // See https://github.com/webpack/enhanced-resolve#escaping - [ - 'handle fragment edge case (no fragment)', - enhancedResolveRoot, - './no#fragment/#/#', - join(enhancedResolveRoot, 'no#fragment', '#', '#.js'), - ], - [ - 'handle fragment edge case (fragment)', - enhancedResolveRoot, - './no#fragment/#/', - join(enhancedResolveRoot, 'no.js#fragment') + '/#/', - ], - [ - 'handle fragment escaping', - enhancedResolveRoot, - './no\0#fragment/\0#/\0##fragment', - join(enhancedResolveRoot, 'no#fragment', '#', '#.js#fragment'), - ], -]) { - test(title, (t) => { - const resolver = new ResolverFactory({ - modules: ['src/a', 'src/b', 'src/common', 'node_modules'], - extensions: ['.js', '.jsx', '.ts', '.tsx'], - }) - - t.is(resolver.sync(context, request).path, expected) - }) -} - -test('resolve pnpm package', (t) => { - const rootDir = join(currentDir, '..', '..'); - const pnpmProjectPath = join(rootDir, 'fixtures', 'pnpm') - const resolver = new ResolverFactory({ - aliasFields: ['browser'], - }) - t.deepEqual(resolver.sync(pnpmProjectPath, 'styled-components'), { - path: join( - rootDir, - 'node_modules/.pnpm/styled-components@6.1.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/styled-components/dist/styled-components.browser.cjs.js' - ), - }) - t.deepEqual( - resolver.sync( - join( - rootDir, - 'node_modules/.pnpm/styled-components@6.1.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/styled-components' - ), - 'react' - ), - { - path: join( - rootDir, - 'node_modules/.pnpm/react@18.3.1/node_modules/react/index.js' - ), - } - ) -}) diff --git a/napi/src/lib.rs b/napi/src/lib.rs deleted file mode 100644 index 7cd839c5..00000000 --- a/napi/src/lib.rs +++ /dev/null @@ -1,214 +0,0 @@ -extern crate napi; -extern crate napi_derive; -extern crate oxc_resolver; - -use std::{ - path::{Path, PathBuf}, - sync::Arc, -}; - -use napi::{bindgen_prelude::AsyncTask, Task}; -use napi_derive::napi; -use oxc_resolver::{ResolveOptions, Resolver}; - -use self::{ - options::{NapiResolveOptions, StrOrStrList}, - tracing::init_tracing, -}; - -mod options; -mod tracing; - -#[napi(object)] -pub struct ResolveResult { - pub path: Option, - pub error: Option, - /// "type" field in the package.json file - pub module_type: Option, -} - -fn resolve(resolver: &Resolver, path: &Path, request: &str) -> ResolveResult { - match resolver.resolve(path, request) { - Ok(resolution) => ResolveResult { - path: Some(resolution.full_path().to_string_lossy().to_string()), - error: None, - module_type: resolution - .package_json() - .and_then(|p| p.r#type.as_ref()) - .and_then(|t| t.as_str()) - .map(|t| t.to_string()), - }, - Err(err) => ResolveResult { path: None, module_type: None, error: Some(err.to_string()) }, - } -} - -#[allow(clippy::needless_pass_by_value)] -#[napi] -pub fn sync(path: String, request: String) -> ResolveResult { - let path = PathBuf::from(path); - let resolver = Resolver::new(ResolveOptions::default()); - resolve(&resolver, &path, &request) -} - -pub struct ResolveTask { - resolver: Arc, - directory: PathBuf, - request: String, -} - -#[napi] -impl Task for ResolveTask { - type Output = ResolveResult; - type JsValue = ResolveResult; - - fn compute(&mut self) -> napi::Result { - Ok(resolve(&self.resolver, &self.directory, &self.request)) - } - - fn resolve(&mut self, _: napi::Env, result: Self::Output) -> napi::Result { - Ok(result) - } -} - -#[napi] -pub struct ResolverFactory { - resolver: Arc, -} - -#[napi] -impl ResolverFactory { - #[napi(constructor)] - pub fn new(options: NapiResolveOptions) -> Self { - init_tracing(); - Self { resolver: Arc::new(Resolver::new(Self::normalize_options(options))) } - } - - #[napi] - pub fn default() -> Self { - let default_options = ResolveOptions::default(); - Self { resolver: Arc::new(Resolver::new(default_options)) } - } - - /// Clone the resolver using the same underlying cache. - #[napi] - pub fn clone_with_options(&self, options: NapiResolveOptions) -> Self { - Self { - resolver: Arc::new(self.resolver.clone_with_options(Self::normalize_options(options))), - } - } - - /// Clear the underlying cache. - #[napi] - pub fn clear_cache(&self) { - self.resolver.clear_cache(); - } - - /// Synchronously resolve `specifier` at an absolute path to a `directory`. - #[allow(clippy::needless_pass_by_value)] - #[napi] - pub fn sync(&self, directory: String, request: String) -> ResolveResult { - let path = PathBuf::from(directory); - resolve(&self.resolver, &path, &request) - } - - /// Asynchronously resolve `specifier` at an absolute path to a `directory`. - #[allow(clippy::needless_pass_by_value)] - #[napi(js_name = "async")] - pub fn resolve_async(&self, directory: String, request: String) -> AsyncTask { - let path = PathBuf::from(directory); - let resolver = self.resolver.clone(); - AsyncTask::new(ResolveTask { resolver, directory: path, request }) - } - - fn normalize_options(op: NapiResolveOptions) -> ResolveOptions { - let default = ResolveOptions::default(); - // merging options - ResolveOptions { - tsconfig: op.tsconfig.map(|tsconfig| tsconfig.into()), - alias: op - .alias - .map(|alias| { - alias - .into_iter() - .map(|(k, v)| { - let v = v - .into_iter() - .map(|item| match item { - Some(path) => oxc_resolver::AliasValue::from(path), - None => oxc_resolver::AliasValue::Ignore, - }) - .collect(); - (k, v) - }) - .collect::>() - }) - .unwrap_or(default.alias), - alias_fields: op - .alias_fields - .map(|o| o.into_iter().map(|x| StrOrStrList(x).into()).collect::>()) - .unwrap_or(default.alias_fields), - condition_names: op.condition_names.unwrap_or(default.condition_names), - description_files: op.description_files.unwrap_or(default.description_files), - enforce_extension: op - .enforce_extension - .map(|enforce_extension| enforce_extension.into()) - .unwrap_or(default.enforce_extension), - exports_fields: op - .exports_fields - .map(|o| o.into_iter().map(|x| StrOrStrList(x).into()).collect::>()) - .unwrap_or(default.exports_fields), - imports_fields: op - .imports_fields - .map(|o| o.into_iter().map(|x| StrOrStrList(x).into()).collect::>()) - .unwrap_or(default.imports_fields), - extension_alias: op - .extension_alias - .map(|extension_alias| extension_alias.into_iter().collect::>()) - .unwrap_or(default.extension_alias), - extensions: op.extensions.unwrap_or(default.extensions), - fallback: op - .fallback - .map(|fallback| { - fallback - .into_iter() - .map(|(k, v)| { - let v = v - .into_iter() - .map(|item| match item { - Some(path) => oxc_resolver::AliasValue::from(path), - None => oxc_resolver::AliasValue::Ignore, - }) - .collect(); - (k, v) - }) - .collect::>() - }) - .unwrap_or(default.fallback), - fully_specified: op.fully_specified.unwrap_or(default.fully_specified), - main_fields: op - .main_fields - .map(|o| StrOrStrList(o).into()) - .unwrap_or(default.main_fields), - main_files: op.main_files.unwrap_or(default.main_files), - modules: op.modules.map(|o| StrOrStrList(o).into()).unwrap_or(default.modules), - resolve_to_context: op.resolve_to_context.unwrap_or(default.resolve_to_context), - prefer_relative: op.prefer_relative.unwrap_or(default.prefer_relative), - prefer_absolute: op.prefer_absolute.unwrap_or(default.prefer_absolute), - restrictions: op - .restrictions - .map(|restrictions| { - restrictions - .into_iter() - .map(|restriction| restriction.into()) - .collect::>() - }) - .unwrap_or(default.restrictions), - roots: op - .roots - .map(|roots| roots.into_iter().map(PathBuf::from).collect::>()) - .unwrap_or(default.roots), - symlinks: op.symlinks.unwrap_or(default.symlinks), - builtin_modules: op.builtin_modules.unwrap_or(default.builtin_modules), - } - } -} diff --git a/napi/src/options.rs b/napi/src/options.rs deleted file mode 100644 index ea35672f..00000000 --- a/napi/src/options.rs +++ /dev/null @@ -1,261 +0,0 @@ -use std::path::PathBuf; - -use napi::Either; -use napi_derive::napi; -use std::collections::HashMap; - -/// Module Resolution Options -/// -/// Options are directly ported from [enhanced-resolve](https://github.com/webpack/enhanced-resolve#resolver-options). -/// -/// See [webpack resolve](https://webpack.js.org/configuration/resolve/) for information and examples -#[derive(Debug, Clone)] -#[napi(object)] -pub struct NapiResolveOptions { - /// Path to TypeScript configuration file. - /// - /// Default `None` - pub tsconfig: Option, - - /// Alias for [ResolveOptions::alias] and [ResolveOptions::fallback]. - /// - /// For the second value of the tuple, `None -> AliasValue::Ignore`, Some(String) -> - /// AliasValue::Path(String)` - /// Create aliases to import or require certain modules more easily. - /// A trailing $ can also be added to the given object's keys to signify an exact match. - pub alias: Option>>>, - - /// A list of alias fields in description files. - /// Specify a field, such as `browser`, to be parsed according to [this specification](https://github.com/defunctzombie/package-browser-field-spec). - /// Can be a path to json object such as `["path", "to", "exports"]`. - /// - /// Default `[]` - #[napi(ts_type = "(string | string[])[]")] - pub alias_fields: Option>, - - /// Condition names for exports field which defines entry points of a package. - /// The key order in the exports field is significant. During condition matching, earlier entries have higher priority and take precedence over later entries. - /// - /// Default `[]` - pub condition_names: Option>, - - /// The JSON files to use for descriptions. (There was once a `bower.json`.) - /// - /// Default `["package.json"]` - pub description_files: Option>, - - /// If true, it will not allow extension-less files. - /// So by default `require('./foo')` works if `./foo` has a `.js` extension, - /// but with this enabled only `require('./foo.js')` will work. - /// - /// Default to `true` when [ResolveOptions::extensions] contains an empty string. - /// Use `Some(false)` to disable the behavior. - /// See - /// - /// Default None, which is the same as `Some(false)` when the above empty rule is not applied. - pub enforce_extension: Option, - - /// A list of exports fields in description files. - /// Can be a path to json object such as `["path", "to", "exports"]`. - /// - /// Default `[["exports"]]`. - #[napi(ts_type = "(string | string[])[]")] - pub exports_fields: Option>, - - /// Fields from `package.json` which are used to provide the internal requests of a package - /// (requests starting with # are considered internal). - /// - /// Can be a path to a JSON object such as `["path", "to", "imports"]`. - /// - /// Default `[["imports"]]`. - #[napi(ts_type = "(string | string[])[]")] - pub imports_fields: Option>, - - /// An object which maps extension to extension aliases. - /// - /// Default `{}` - pub extension_alias: Option>>, - - /// Attempt to resolve these extensions in order. - /// If multiple files share the same name but have different extensions, - /// will resolve the one with the extension listed first in the array and skip the rest. - /// - /// Default `[".js", ".json", ".node"]` - pub extensions: Option>, - - /// Redirect module requests when normal resolving fails. - /// - /// Default `[]` - pub fallback: Option>>>, - - /// 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). - /// - /// See also webpack configuration [resolve.fullySpecified](https://webpack.js.org/configuration/module/#resolvefullyspecified) - /// - /// Default `false` - pub fully_specified: Option, - - /// A list of main fields in description files - /// - /// Default `["main"]`. - #[napi(ts_type = "string | string[]")] - pub main_fields: Option, - - /// The filename to be used while resolving directories. - /// - /// Default `["index"]` - pub main_files: Option>, - - /// A list of directories to resolve modules from, can be absolute path or folder name. - /// - /// Default `["node_modules"]` - #[napi(ts_type = "string | string[]")] - pub modules: Option, - - /// Resolve to a context instead of a file. - /// - /// Default `false` - pub resolve_to_context: Option, - - /// Prefer to resolve module requests as relative requests instead of using modules from node_modules directories. - /// - /// Default `false` - pub prefer_relative: Option, - - /// Prefer to resolve server-relative urls as absolute paths before falling back to resolve in ResolveOptions::roots. - /// - /// Default `false` - pub prefer_absolute: Option, - - /// A list of resolve restrictions to restrict the paths that a request can be resolved on. - /// - /// Default `[]` - pub restrictions: Option>, - - /// A list of directories where requests of server-relative URLs (starting with '/') are resolved. - /// On non-Windows systems these requests are resolved as an absolute path first. - /// - /// Default `[]` - pub roots: Option>, - - /// Whether to resolve symlinks to their symlinked location. - /// When enabled, symlinked resources are resolved to their real path, not their symlinked location. - /// Note that this may cause module resolution to fail when using tools that symlink packages (like npm link). - /// - /// Default `true` - pub symlinks: Option, - - /// Whether to parse [module.builtinModules](https://nodejs.org/api/module.html#modulebuiltinmodules) or not. - /// For example, "zlib" will throw [crate::ResolveError::Builtin] when set to true. - /// - /// Default `false` - pub builtin_modules: Option, -} - -#[napi] -#[derive(Debug, PartialEq, Eq)] -pub enum EnforceExtension { - Auto, - Enabled, - Disabled, -} - -impl EnforceExtension { - pub fn is_auto(&self) -> bool { - *self == Self::Auto - } - - pub fn is_enabled(&self) -> bool { - *self == Self::Enabled - } - - pub fn is_disabled(&self) -> bool { - *self == Self::Disabled - } -} - -/// Alias Value for [ResolveOptions::alias] and [ResolveOptions::fallback]. -/// Use struct because napi don't support structured union now -#[napi(object)] -#[derive(Debug, Clone)] -pub struct Restriction { - pub path: Option, - pub regex: Option, -} - -/// Tsconfig Options -/// -/// Derived from [tsconfig-paths-webpack-plugin](https://github.com/dividab/tsconfig-paths-webpack-plugin#options) -#[napi(object)] -#[derive(Debug, Clone)] -pub struct TsconfigOptions { - /// Allows you to specify where to find the TypeScript configuration file. - /// You may provide - /// * a relative path to the configuration file. It will be resolved relative to cwd. - /// * an absolute path to the configuration file. - pub config_file: String, - - /// Support for Typescript Project References. - /// - /// * `'auto'`: use the `references` field from tsconfig of `config_file`. - /// * `string[]`: manually provided relative or absolute path. - #[napi(ts_type = "'auto' | string[]")] - pub references: Option>>, -} - -impl Into for Restriction { - fn into(self) -> oxc_resolver::Restriction { - match (self.path, self.regex) { - (None, None) => { - panic!("Should specify path or regex") - } - (None, Some(regex)) => oxc_resolver::Restriction::RegExp(regex), - (Some(path), None) => oxc_resolver::Restriction::Path(PathBuf::from(path)), - (Some(_), Some(_)) => { - panic!("Restriction can't be path and regex at the same time") - } - } - } -} - -impl Into for EnforceExtension { - fn into(self) -> oxc_resolver::EnforceExtension { - match self { - EnforceExtension::Auto => oxc_resolver::EnforceExtension::Auto, - EnforceExtension::Enabled => oxc_resolver::EnforceExtension::Enabled, - EnforceExtension::Disabled => oxc_resolver::EnforceExtension::Disabled, - } - } -} - -impl Into for TsconfigOptions { - fn into(self) -> oxc_resolver::TsconfigOptions { - oxc_resolver::TsconfigOptions { - config_file: PathBuf::from(self.config_file), - references: match self.references { - Some(Either::A(string)) if string.as_str() == "auto" => { - oxc_resolver::TsconfigReferences::Auto - } - Some(Either::A(opt)) => { - panic!("`{}` is not a valid option for tsconfig references", opt) - } - Some(Either::B(paths)) => oxc_resolver::TsconfigReferences::Paths( - paths.into_iter().map(PathBuf::from).collect::>(), - ), - None => oxc_resolver::TsconfigReferences::Disabled, - }, - } - } -} - -type StrOrStrListType = Either>; -pub struct StrOrStrList(pub StrOrStrListType); - -impl Into> for StrOrStrList { - fn into(self) -> Vec { - match self { - StrOrStrList(Either::A(s)) => Vec::from([s]), - StrOrStrList(Either::B(a)) => a, - } - } -} diff --git a/napi/src/tracing.rs b/napi/src/tracing.rs deleted file mode 100644 index 88e4cd7e..00000000 --- a/napi/src/tracing.rs +++ /dev/null @@ -1,25 +0,0 @@ -use std::sync::OnceLock; - -use tracing_subscriber::filter::Targets; -use tracing_subscriber::prelude::__tracing_subscriber_SubscriberExt; -use tracing_subscriber::util::SubscriberInitExt; - -/// To debug `oxc_resolver`: -/// `OXC_LOG=DEBUG your program` -pub fn init_tracing() { - static TRACING: OnceLock<()> = OnceLock::new(); - TRACING.get_or_init(|| { - // Usage without the `regex` feature. - // - tracing_subscriber::registry() - .with(std::env::var("OXC_LOG").map_or_else( - |_| Targets::new(), - |env_var| { - use std::str::FromStr; - Targets::from_str(&env_var).unwrap() - }, - )) - .with(tracing_subscriber::fmt::layer()) - .init(); - }); -} diff --git a/napi/tests/options.test.mjs b/napi/tests/options.test.mjs deleted file mode 100644 index 4a93efff..00000000 --- a/napi/tests/options.test.mjs +++ /dev/null @@ -1,59 +0,0 @@ -import { describe, it } from "node:test"; -import { ResolverFactory } from "../index.js"; -import * as assert from "node:assert"; -import * as path from "node:path"; - -const fixtureDir = new URL( - "../../fixtures/enhanced_resolve/test/fixtures", - import.meta.url -).pathname; - -describe("option", () => { - describe("aliasFields", () => { - it("should allow field string ", () => { - const resolver = new ResolverFactory({ aliasFields: ["browser"] }); - assert.match( - resolver.sync(fixtureDir, "./browser-module/lib/replaced.js").path, - /browser-module\/lib\/browser\.js$/ - ); - }); - it("should allow json path array", () => { - const resolver = new ResolverFactory({ - aliasFields: [["innerBrowser1", "field", "browser"]], - }); - - assert.match( - resolver.sync(fixtureDir, "./browser-module/lib/main1.js").path, - /browser-module\/lib\/main\.js$/ - ); - }); - }); - - describe("exportsFields", () => { - const createTest = (exportsFields) => { - const resolver = new ResolverFactory({ exportsFields }); - assert.match( - resolver.sync( - path.resolve(fixtureDir, "./exports-field3"), - "exports-field" - ).path, - /\/exports-field\/src\/index\.js$/ - ); - }; - it("should allow string as field item", createTest(["broken"])); - it("should allow json path array as field item", createTest([["broken"]])); - }); - - describe("mainFields", () => { - const createTest = (mainFields) => { - const resolver = new ResolverFactory({ mainFields }); - assert.match( - resolver.sync(fixtureDir, "../..").path, - /\/lib\/index\.js$/ - ); - }; - it("should use `'main'` as default", createTest(undefined)); - it("should allow field string", createTest("main")); - it("should allow field array", createTest(["main"])); - }); -}); diff --git a/npm/package.json b/npm/package.json index 85422809..7136edb8 100644 --- a/npm/package.json +++ b/npm/package.json @@ -1,47 +1,36 @@ { - "name": "oxc-resolver", - "version": "1.11.0", - "description": "Oxc Resolver Node API", - "main": "index.js", - "browser": "browser.js", - "files": [ - "index.d.ts", - "index.js", - "browser.js" - ], - "license": "MIT", - "homepage": "https://oxc.rs", - "repository": { - "type": "git", - "url": "git+https://github.com/oxc-project/oxc-resolver.git" - }, - "publishConfig": { - "registry": "https://registry.npmjs.org/", - "access": "public" - }, - "napi": { - "binaryName": "resolver", - "packageName": "@oxc-resolver/binding", - "wasm": { - "browser": { - "fs": true - } - }, - "targets": [ - "x86_64-pc-windows-msvc", - "aarch64-pc-windows-msvc", - "x86_64-unknown-linux-gnu", - "x86_64-unknown-linux-musl", - "x86_64-unknown-freebsd", - "aarch64-unknown-linux-gnu", - "aarch64-unknown-linux-musl", - "armv7-unknown-linux-gnueabihf", - "x86_64-apple-darwin", - "aarch64-apple-darwin", - "wasm32-wasip1-threads" - ] - }, - "funding": { - "url": "https://github.com/sponsors/Boshen" - } + "browser": "browser.js", + "description": "Oxc Resolver Node API", + "files": [ + "index.d.ts", + "index.js", + "browser.js" + ], + "funding": { + "url": "https://github.com/sponsors/Boshen" + }, + "main": "index.js", + "name": "oxc-resolver", + "napi": { + "binaryName": "resolver", + "packageName": "@oxc-resolver/binding", + "targets": [ + "x86_64-pc-windows-msvc", + "aarch64-pc-windows-msvc", + "x86_64-unknown-linux-gnu", + "x86_64-unknown-linux-musl", + "x86_64-unknown-freebsd", + "aarch64-unknown-linux-gnu", + "aarch64-unknown-linux-musl", + "armv7-unknown-linux-gnueabihf", + "x86_64-apple-darwin", + "aarch64-apple-darwin", + "wasm32-wasip1-threads" + ], + "wasm": { + "browser": { + "fs": true + } + } + } } diff --git a/package.json b/package.json index 30892ca3..d0ee7633 100644 --- a/package.json +++ b/package.json @@ -1,33 +1,24 @@ { - "name": "@oxc-resolver/binding", - "private": true, - "version": "0.0.0", - "scripts": { - "build": "napi build --platform --release --package-json-path npm/package.json --manifest-path napi/Cargo.toml", - "build:debug": "napi build --platform --package-json-path npm/package.json --manifest-path napi/Cargo.toml", - "prepublishOnly": "napi pre-publish -t npm", - "test": "ava" - }, - "devDependencies": { - "@napi-rs/cli": "3.0.0-alpha.62", - "@napi-rs/wasm-runtime": "^0.2.4", - "@types/node": "^22.0.0", - "ava": "^6.1.3", - "emnapi": "^1.2.0", - "typescript": "^5.5.3" - }, - "ava": { - "files": [ - "napi/__test__/*.spec.mjs" - ], - "cache": false - }, - "packageManager": "pnpm@9.9.0", - "repository": { - "type": "git", - "url": "git+https://github.com/oxc-project/oxc-resolver.git" - }, - "funding": { - "url": "https://github.com/sponsors/Boshen" - } + "ava": { + "cache": false, + "files": [ + "napi/__test__/*.spec.mjs" + ] + }, + "devDependencies": { + "@napi-rs/cli": "3.0.0-alpha.62", + "@napi-rs/wasm-runtime": "^0.2.4", + "@types/node": "^22.0.0", + "ava": "^6.1.3", + "emnapi": "^1.2.0" + }, + "funding": { + "url": "https://github.com/sponsors/Boshen" + }, + "name": "@oxc-resolver/binding", + "scripts": { + "build": "napi build --platform --release --package-json-path npm/package.json --manifest-path napi/Cargo.toml", + "build:debug": "napi build --platform --package-json-path npm/package.json --manifest-path napi/Cargo.toml", + "prepublishOnly": "napi pre-publish -t npm" + } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml deleted file mode 100644 index db9e5b63..00000000 --- a/pnpm-lock.yaml +++ /dev/null @@ -1,2598 +0,0 @@ -lockfileVersion: '9.0' - -settings: - autoInstallPeers: true - excludeLinksFromLockfile: false - -importers: - - .: - devDependencies: - '@napi-rs/cli': - specifier: 3.0.0-alpha.62 - version: 3.0.0-alpha.62(@emnapi/runtime@1.2.0)(emnapi@1.2.0) - '@napi-rs/wasm-runtime': - specifier: ^0.2.4 - version: 0.2.4 - '@types/node': - specifier: ^22.0.0 - version: 22.5.4 - ava: - specifier: ^6.1.3 - version: 6.1.3 - emnapi: - specifier: ^1.2.0 - version: 1.2.0 - typescript: - specifier: ^5.5.3 - version: 5.5.4 - - fixtures/pnpm: - devDependencies: - axios: - specifier: 1.6.2 - version: 1.6.2 - ipaddr.js: - specifier: 2.2.0 - version: 2.2.0 - postcss: - specifier: 8.4.33 - version: 8.4.33 - styled-components: - specifier: 6.1.1 - version: 6.1.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - - npm: {} - -packages: - - '@emnapi/core@1.2.0': - resolution: {integrity: sha512-E7Vgw78I93we4ZWdYCb4DGAwRROGkMIXk7/y87UmANR+J6qsWusmC3gLt0H+O0KOt5e6O38U8oJamgbudrES/w==} - - '@emnapi/runtime@1.2.0': - resolution: {integrity: sha512-bV21/9LQmcQeCPEg3BDFtvwL6cwiTMksYNWQQ4KOxCZikEGalWtenoZ0wCiukJINlGCIi2KXx01g4FoH/LxpzQ==} - - '@emnapi/wasi-threads@1.0.1': - resolution: {integrity: sha512-iIBu7mwkq4UQGeMEM8bLwNK962nXdhodeScX4slfQnRhEMMzvYivHhutCIk8uojvmASXXPC2WNEjwxFWk72Oqw==} - - '@emotion/is-prop-valid@1.2.2': - resolution: {integrity: sha512-uNsoYd37AFmaCdXlg6EYD1KaPOaRWRByMCYzbKUX4+hhMfrxdVSelShywL4JVaAeM/eHUOSprYBQls+/neX3pw==} - - '@emotion/memoize@0.8.1': - resolution: {integrity: sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA==} - - '@emotion/unitless@0.8.1': - resolution: {integrity: sha512-KOEGMu6dmJZtpadb476IsZBclKvILjopjUii3V+7MnXIQCYh8W3NgNcgwo21n9LXZX6EDIKvqfjYxXebDwxKmQ==} - - '@inquirer/checkbox@2.3.10': - resolution: {integrity: sha512-CTc864M2/523rKc9AglIzAcUCuPXDZENgc5S2KZFVRbnMzpXcYTsUWmbqSeL0XLvtlvEtNevkkVbfVhJpruOyQ==} - engines: {node: '>=18'} - - '@inquirer/confirm@3.1.14': - resolution: {integrity: sha512-nbLSX37b2dGPtKWL3rPuR/5hOuD30S+pqJ/MuFiUEgN6GiMs8UMxiurKAMDzKt6C95ltjupa8zH6+3csXNHWpA==} - engines: {node: '>=18'} - - '@inquirer/core@9.0.2': - resolution: {integrity: sha512-nguvH3TZar3ACwbytZrraRTzGqyxJfYJwv+ZwqZNatAosdWQMP1GV8zvmkNlBe2JeZSaw0WYBHZk52pDpWC9qA==} - engines: {node: '>=18'} - - '@inquirer/editor@2.1.14': - resolution: {integrity: sha512-6nWpoJyVAKwAcv67bkbBmmi3f32xua79fP7TRmNUoR4K+B1GiOBsHO1YdvET/jvC+nTlBZL7puKAKyM7G+Lkzw==} - engines: {node: '>=18'} - - '@inquirer/expand@2.1.14': - resolution: {integrity: sha512-JcxsLajwPykF2kq6biIUdoOzTQ3LXqb8XMVrWkCprG/pFeU1SsxcSSFbF1T5jJGvvlTVcsE+JdGjbQ8ZRZ82RA==} - engines: {node: '>=18'} - - '@inquirer/figures@1.0.3': - resolution: {integrity: sha512-ErXXzENMH5pJt5/ssXV0DfWUZqly8nGzf0UcBV9xTnP+KyffE2mqyxIMBrZ8ijQck2nU0TQm40EQB53YreyWHw==} - engines: {node: '>=18'} - - '@inquirer/input@2.2.1': - resolution: {integrity: sha512-Yl1G6h7qWydzrJwqN777geeJVaAFL5Ly83aZlw4xHf8Z/BoTMfKRheyuMaQwOG7LQ4e5nQP7PxXdEg4SzQ+OKw==} - engines: {node: '>=18'} - - '@inquirer/number@1.0.2': - resolution: {integrity: sha512-GcoK+Phxcln0Qw9e73S5a8B2Ejg3HgSTvNfDegIcS5/BKwUm8t5rejja1l09WXjZM9vrVbRDf9RzWtSUiWVYRQ==} - engines: {node: '>=18'} - - '@inquirer/password@2.1.14': - resolution: {integrity: sha512-sPzOkXLhWJQ96K6nPZFnF8XB8tsDrcCRobd1d3EDz81F+4hp8BbdmsnsQcqZ7oYDIOVM/mWJyIUtJ35TrssJxQ==} - engines: {node: '>=18'} - - '@inquirer/prompts@5.1.2': - resolution: {integrity: sha512-E+ndnfwtVQtcmPt888Hc/HAxJUHSaA6OIvyvLAQ5BLQv+t20GbYdFSjXeLgb47OpMU+aRsKA/ys+Zoylw3kTVg==} - engines: {node: '>=18'} - - '@inquirer/rawlist@2.1.14': - resolution: {integrity: sha512-pLpEzhKNQ/ugFAFfgCNaXljB+dcCwmXwR1jOxAbVeFIdB3l02E5gjI+h1rb136tq0T8JO6P5KFR1oTeld/wdrA==} - engines: {node: '>=18'} - - '@inquirer/select@2.3.10': - resolution: {integrity: sha512-rr7iR0Zj1YFfgM8IUGimPD9Yukd+n/U63CnYT9kdum6DbRXtMxR45rrreP+EA9ixCnShr+W4xj7suRxC1+8t9g==} - engines: {node: '>=18'} - - '@inquirer/type@1.4.0': - resolution: {integrity: sha512-AjOqykVyjdJQvtfkNDGUyMYGF8xN50VUxftCQWsOyIo4DFRLr6VQhW0VItGI1JIyQGCGgIpKa7hMMwNhZb4OIw==} - engines: {node: '>=18'} - - '@mapbox/node-pre-gyp@1.0.11': - resolution: {integrity: sha512-Yhlar6v9WQgUp/He7BdgzOz8lqMQ8sU+jkCq7Wx8Myc5YFJLbEe7lgui/V7G1qB1DJykHSGwreceSaD60Y0PUQ==} - hasBin: true - - '@napi-rs/cli@3.0.0-alpha.62': - resolution: {integrity: sha512-IDUwHAEJZ9ad/s5oyhznrz5ZDcU+SJ6GdP5nb++Wx5MkS4FD9MeS3HfNZdsxkf10pOUPnmvCVFuG4xnLBQYmjw==} - engines: {node: '>= 16'} - hasBin: true - peerDependencies: - '@emnapi/runtime': ^1.1.0 - emnapi: ^1.1.0 - peerDependenciesMeta: - '@emnapi/runtime': - optional: true - emnapi: - optional: true - - '@napi-rs/cross-toolchain@0.0.16': - resolution: {integrity: sha512-jwdjHT5L0m9MH0CmzDwPp0ckn/UO7afHCsPeo7NugHUvYgvlgS7SWhdMVgIgJW2HHqhcW/2nhaLLGpAU1c7QRQ==} - peerDependencies: - '@napi-rs/cross-toolchain-arm64-target-aarch64': ^0.0.16 - '@napi-rs/cross-toolchain-arm64-target-armv7': ^0.0.16 - '@napi-rs/cross-toolchain-arm64-target-x86_64': ^0.0.16 - '@napi-rs/cross-toolchain-x64-target-aarch64': ^0.0.16 - '@napi-rs/cross-toolchain-x64-target-armv7': ^0.0.16 - '@napi-rs/cross-toolchain-x64-target-x86_64': ^0.0.16 - peerDependenciesMeta: - '@napi-rs/cross-toolchain-arm64-target-aarch64': - optional: true - '@napi-rs/cross-toolchain-arm64-target-armv7': - optional: true - '@napi-rs/cross-toolchain-arm64-target-x86_64': - optional: true - '@napi-rs/cross-toolchain-x64-target-aarch64': - optional: true - '@napi-rs/cross-toolchain-x64-target-armv7': - optional: true - '@napi-rs/cross-toolchain-x64-target-x86_64': - optional: true - - '@napi-rs/lzma-android-arm-eabi@1.3.1': - resolution: {integrity: sha512-mtGOg8jXlc+pTBI86cqohfndS9UmOAkk9d5CChKMb8btVks70yhUN1e7YYS3QFbmoxbPs2Ee+wmuH1Khdc7B2w==} - engines: {node: '>= 10'} - cpu: [arm] - os: [android] - - '@napi-rs/lzma-android-arm64@1.3.1': - resolution: {integrity: sha512-4uGkQgAv9Tnc/i0k2eIgbhZgyzs94+iECWxz4MFZNcZ1fNGvGbRL2j+SITE4OmwrUn3TuFK/uYWfgzooq8E1Qg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [android] - - '@napi-rs/lzma-darwin-arm64@1.3.1': - resolution: {integrity: sha512-MZBg4iwHTS8icjTiCMdzh8kYrMmKBCEglFPa+vjI91R2XDwuuwSzqmpATRpmMH8cWUUWtGPF4fnxKzjgkzhd4Q==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [darwin] - - '@napi-rs/lzma-darwin-x64@1.3.1': - resolution: {integrity: sha512-7vte+1lYV7xgZERKH/pjAeh4T16aQASKOzu4op70pK6VP/64Plr5rrvqxQqQmlAIe4pwyo/RkFl1n4LXDod3xg==} - engines: {node: '>= 10'} - cpu: [x64] - os: [darwin] - - '@napi-rs/lzma-freebsd-x64@1.3.1': - resolution: {integrity: sha512-uBS74fynTqLUC3catIxyezCafn8UDlr2yxVV47vz1T6Vop2PGDz/cMQdV6rnLSjPE08Rv66ihM36mgf/MmOkOg==} - engines: {node: '>= 10'} - cpu: [x64] - os: [freebsd] - - '@napi-rs/lzma-linux-arm-gnueabihf@1.3.1': - resolution: {integrity: sha512-rrVLyqBJeN29gPJCNkPbZ7dAzaseEcERKyhjwM+DfbFrDUvtkEcrYPvo+iwE/NmF+OkZQkzcanrVMGnq/mcJYQ==} - engines: {node: '>= 10'} - cpu: [arm] - os: [linux] - - '@napi-rs/lzma-linux-arm64-gnu@1.3.1': - resolution: {integrity: sha512-vDmVsthRbX2opkgRirJJGKQxUP/spvyVM2Y5CyCWZ7sadSID3hA97r38gf9ISn/sJ8/r93IPWLq+iycudNKi+Q==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/lzma-linux-arm64-musl@1.3.1': - resolution: {integrity: sha512-x4m/J3hRdFd3IoqKc+4aBcSUkcuDEP7hH6vdss8bKNLjPfXmnG/lcHJEQX3hNnNOULPP8xVRxgiY8jeL62cnsw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/lzma-linux-x64-gnu@1.3.1': - resolution: {integrity: sha512-riB+Xg72NfH8Kcpq07omshVu0QsLW0v2bhywBNYxvA+t2dGGWSIEN1U/zazUXys+IEA6pBQKqLVseurWE6Cl8g==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/lzma-linux-x64-musl@1.3.1': - resolution: {integrity: sha512-JXLgJFwoeysxdSg7rdVYP8wrliCQVJlU5JcLYjRVSCL4P0mQTjnYi7R7VdaOkDACw/Fvlji7oIJXt0KiaDTcOw==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/lzma-wasm32-wasi@1.3.1': - resolution: {integrity: sha512-XTA9XTUtj0KPKuzNS2oi3bWN6tJodk00wwMd/TiKoEqx9Fe/zu+OfDGuXAn+xs+P7S3YCDHqjYinuTQMZ0ucJw==} - engines: {node: '>=14.0.0'} - cpu: [wasm32] - - '@napi-rs/lzma-win32-arm64-msvc@1.3.1': - resolution: {integrity: sha512-qLDfs9UEtLPPTN/FdSz3gSdlx86VwFQBuLBrQtaiYQtUTKZCOYV1Z1fXqFt5Zqa1HKV2oyXnwGcTI7RpcyXxtg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [win32] - - '@napi-rs/lzma-win32-ia32-msvc@1.3.1': - resolution: {integrity: sha512-rWNlxLFMIfvxzfdQCfeQ3D/HEnQG3vfladFYrXUx6ePXO6r+BLCGn6/LWSSuKlw4vKkb1iHEWsAVaRLIcJEMIA==} - engines: {node: '>= 10'} - cpu: [ia32] - os: [win32] - - '@napi-rs/lzma-win32-x64-msvc@1.3.1': - resolution: {integrity: sha512-SNfHNqEjabXfTL1+KRi0qiAhwIlZHhQystvfSYX6p1g+2trSC/3WUpUQ4fbbR7KyE31g2AAnwjXivnlQ0af/pg==} - engines: {node: '>= 10'} - cpu: [x64] - os: [win32] - - '@napi-rs/lzma@1.3.1': - resolution: {integrity: sha512-XyZoBlYNMvCulK/RmVK/0nB3j7IdH7HpqcrMMg0U+HqQqKRLOQBwvnKNBocPC1bZQ7iZuKWYTLn1ayZwTyek8w==} - engines: {node: '>= 10'} - - '@napi-rs/tar-android-arm-eabi@0.1.1': - resolution: {integrity: sha512-Ufa0ahZvE5KGrC2WBux5svCe/jvC+e8IgtleiicwqnfgTfbDknYyq/QuqkP1AnMp/IvTmx2iutCZt6OFIG0zAg==} - engines: {node: '>= 10'} - cpu: [arm] - os: [android] - - '@napi-rs/tar-android-arm64@0.1.1': - resolution: {integrity: sha512-KUu5fHIiIObSuZ/crHxUrQ243+LiCRKPwdCVLHwjtftqFjzls+R2Mp6GrpM41XxexDMN00SUta3kazi93Xr19A==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [android] - - '@napi-rs/tar-darwin-arm64@0.1.1': - resolution: {integrity: sha512-jaqgdX20iIga+2gzotQ78eF00Cm8vECocUYeMY62WqyzJNv/jx1dlOfELWEccOjpmawFT9tjWebsS9F1QMvSUg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [darwin] - - '@napi-rs/tar-darwin-x64@0.1.1': - resolution: {integrity: sha512-80sa32IxfRso9x9sGTFpfLSx3BnruyJODpSkUzalOCz9i14n5gOKA8KR/JrnSWwDz0p5l5P9kfQD3pu8Voj7WA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [darwin] - - '@napi-rs/tar-freebsd-x64@0.1.1': - resolution: {integrity: sha512-P7V1zBjjC1dCrTwtUzuzYM4AeZduigeCtd8qQw2IUZowM5AsmhMd77oYuXjdU29cEpKUpyYjJRxjPCzFy+WbAQ==} - engines: {node: '>= 10'} - cpu: [x64] - os: [freebsd] - - '@napi-rs/tar-linux-arm-gnueabihf@0.1.1': - resolution: {integrity: sha512-qpC71ILPkWKt8k1iJCYt5gjwcOkd2VFSQIelTRr12t5CVNKV04rE/TMdwFoCP7kxbtb9Fl2cZzCRISw2BhMCmQ==} - engines: {node: '>= 10'} - cpu: [arm] - os: [linux] - - '@napi-rs/tar-linux-arm64-gnu@0.1.1': - resolution: {integrity: sha512-71QgxcFJCog6O4Tauoge8D0ILkDGJTRk3ru7zG8PUFG1QXJ1kkiRikdT77YmoVxtomc9FUOt+bdEdU5Yn+3QUQ==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/tar-linux-arm64-musl@0.1.1': - resolution: {integrity: sha512-R2e7YEILPKc447N1hUt1zQuyy0st83HX6nhmtFywS1aOj76/3hzxLVrebGiiS6kifyCrO82o66CNTYe7DixMZw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/tar-linux-x64-gnu@0.1.1': - resolution: {integrity: sha512-tmy9q2LXUB2GQ+IgUzJn3+us52leplMu96ORyFq1iHQEelGSqXt4xi5DzU07JhX3obJPqVqkybtcRS4enBfmBA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/tar-linux-x64-musl@0.1.1': - resolution: {integrity: sha512-j5ePbe6vihApl0cGPPDUVTWZbf2mF4NhxngAoG2jp7AeX3cWP2O4pjsvaOraW6QfvWEMFPeER7S0b6eBS7duvA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/tar-wasm32-wasi@0.1.1': - resolution: {integrity: sha512-se0+DlOiIRt7mcz7BeOJDoZtCrROpKLwiAOGmNgrjQ/SZS7TnOPuwm3wy9XN9WLoepttEjCEem6UP8yD5GJuQg==} - engines: {node: '>=14.0.0'} - cpu: [wasm32] - - '@napi-rs/tar-win32-arm64-msvc@0.1.1': - resolution: {integrity: sha512-FDZPi2wC7RwzvodogigLh/pJvhqCTVTUqOYuHlLkPSUbSAGiEkI55wk9RqH3y3EdJQaDuzyqC0QKz5ket2U+GA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [win32] - - '@napi-rs/tar-win32-ia32-msvc@0.1.1': - resolution: {integrity: sha512-OPR9Tou5z5M912G7Kc7gkf1ltinbOQx5dS/OeDIWHvPGOfdFDIxt0YVKhzSLRJi43+zIDp8/+cbeMD/cKXfX8w==} - engines: {node: '>= 10'} - cpu: [ia32] - os: [win32] - - '@napi-rs/tar-win32-x64-msvc@0.1.1': - resolution: {integrity: sha512-hiv5KfhrMSg8tTRC2oQXVckVg1h6ZVjwbd5aF9Esl0V3p2TaNFwwbqgnAN4Gm/PmSnHWNL/IRTHkk3cOzDWihQ==} - engines: {node: '>= 10'} - cpu: [x64] - os: [win32] - - '@napi-rs/tar@0.1.1': - resolution: {integrity: sha512-FOMhwwlvoYjHaDBxP26K3D92ltw1Y/CC4CIjgC6qXdzW4MYNwTlEyI58smCM3k+nCVJH3kpOYyH3sgbK4WZA4A==} - engines: {node: '>= 10'} - - '@napi-rs/wasm-runtime@0.2.4': - resolution: {integrity: sha512-9zESzOO5aDByvhIAsOy9TbpZ0Ur2AJbUI7UT73kcUTS2mxAMHOBaa1st/jAymNoCtvrit99kkzT1FZuXVcgfIQ==} - - '@napi-rs/wasm-tools-android-arm-eabi@0.0.2': - resolution: {integrity: sha512-/b+UU3suXjW4P0DzHRNdrnebQtFKcQf/YMeZJH+xUlKgvwli5kbmWjx8Wqqz0VETVkUTuPqJMBDIVLyc+14FGw==} - engines: {node: '>= 10'} - cpu: [arm] - os: [android] - - '@napi-rs/wasm-tools-android-arm64@0.0.2': - resolution: {integrity: sha512-j57GbDflwJdZtT8pZj5fOV4JAP+LdKN+wzsUYs+QRUoBqpWbbUANudolqfw63bkS9sD4z7fbCuz8iwtJqzxTVA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [android] - - '@napi-rs/wasm-tools-darwin-arm64@0.0.2': - resolution: {integrity: sha512-P2ChgWgVuv9GwmbxN89R84KzIImoTqXINteEixUvmkdnhyFiR+I8deNs89Yed+5w8QLC6MEfrtRqLP9YI+NoQA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [darwin] - - '@napi-rs/wasm-tools-darwin-x64@0.0.2': - resolution: {integrity: sha512-T/kQQ0gt8+wau1Z821PKVAD76QhmwVoLs2CT7Z9tTBs2pJvwSCP0C/kQiQAHcJIMi7A2E9Ab/Mez0BERy50EFA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [darwin] - - '@napi-rs/wasm-tools-freebsd-x64@0.0.2': - resolution: {integrity: sha512-GnnHu+r5sfzuxC/1J5UMF/h3BOZnHb3NQZ5hmbCfZYCKzpzRxrAJhzRunlbRN+v0x8M/49dztVTYR3s7K4ooAw==} - engines: {node: '>= 10'} - cpu: [x64] - os: [freebsd] - - '@napi-rs/wasm-tools-linux-arm64-gnu@0.0.2': - resolution: {integrity: sha512-KnZdLT0OnKb1CG2kdt3/WvM43vr9i+FEwXCvSOVC/6Tsifz7ynhMg7LAVESILd03HubzQJfg9nbRsk0bQ+IOwg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/wasm-tools-linux-arm64-musl@0.0.2': - resolution: {integrity: sha512-HkpZOID2U8P6pWqK3mqZ8bxU5xcuT3iA2fO+jrxn78h006iYgfNmdc5JaVhHnHazMmk32xKhSV4iV0VUh8UWDg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/wasm-tools-linux-x64-gnu@0.0.2': - resolution: {integrity: sha512-YksJWBCyOalB9ogtP9+/dZKP+vR6+h7BmzMXaXMT71WW/GvIsifMVgv+DY/FRSNJQupp5Y+ugjqVAOUOc/G65g==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/wasm-tools-linux-x64-musl@0.0.2': - resolution: {integrity: sha512-sPtRxPMdw05KdTcxgSPMmSXG2+PiK3vJ/l2+g9hvjnnKtvslJN2Hr7j8zgzuoKRAUFPaJVe6+D2xVh5cpdqhww==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/wasm-tools-wasm32-wasi@0.0.2': - resolution: {integrity: sha512-muRvZK7AIuo88G2AxYx3gA59rHMQgoN004saQkBvXnz3K/DVHKfTZ6TtUebss8zI3dURU6xExL8drxFWYxjEbQ==} - engines: {node: '>=14.0.0'} - cpu: [wasm32] - - '@napi-rs/wasm-tools-win32-arm64-msvc@0.0.2': - resolution: {integrity: sha512-Cn13WQ+tpFqdVwx0DIWKbsI9auFyzVZV4F5UNOUeDt6GgOL+NndgJul0Pc9bSU6fi03AylMPfF/nTCaDWO2Wgw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [win32] - - '@napi-rs/wasm-tools-win32-ia32-msvc@0.0.2': - resolution: {integrity: sha512-xsg5DkIQi82a8rcx6246Y3XC8TIqHamY+/C6sIlPLaZEuHctDkMECAw0AANwRf5vN//D2oo2oljOuoYtB1GOKw==} - engines: {node: '>= 10'} - cpu: [ia32] - os: [win32] - - '@napi-rs/wasm-tools-win32-x64-msvc@0.0.2': - resolution: {integrity: sha512-yHigltEt33eq8bappvKsIliz4MxfMPn1M+NWbIFRWN+IS1Z57mhmc1osuk+IRXrSlq0Tom0R6MYN1jpkZKz81Q==} - engines: {node: '>= 10'} - cpu: [x64] - os: [win32] - - '@napi-rs/wasm-tools@0.0.2': - resolution: {integrity: sha512-kBvDQCP5BLw2TxTENXLp3Of7vVEx0uyIye824JHE4dduzzOHVgSoOFVhVqAT3Fx/hLV445RVWfEqQbXMg4w/Mw==} - engines: {node: '>= 10'} - - '@nodelib/fs.scandir@2.1.5': - resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} - engines: {node: '>= 8'} - - '@nodelib/fs.stat@2.0.5': - resolution: {integrity: sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==} - engines: {node: '>= 8'} - - '@nodelib/fs.walk@1.2.8': - resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} - engines: {node: '>= 8'} - - '@octokit/auth-token@5.1.1': - resolution: {integrity: sha512-rh3G3wDO8J9wSjfI436JUKzHIxq8NaiL0tVeB2aXmG6p/9859aUOAjA9pmSPNGGZxfwmaJ9ozOJImuNVJdpvbA==} - engines: {node: '>= 18'} - - '@octokit/core@6.1.2': - resolution: {integrity: sha512-hEb7Ma4cGJGEUNOAVmyfdB/3WirWMg5hDuNFVejGEDFqupeOysLc2sG6HJxY2etBp5YQu5Wtxwi020jS9xlUwg==} - engines: {node: '>= 18'} - - '@octokit/endpoint@10.1.1': - resolution: {integrity: sha512-JYjh5rMOwXMJyUpj028cu0Gbp7qe/ihxfJMLc8VZBMMqSwLgOxDI1911gV4Enl1QSavAQNJcwmwBF9M0VvLh6Q==} - engines: {node: '>= 18'} - - '@octokit/graphql@8.1.1': - resolution: {integrity: sha512-ukiRmuHTi6ebQx/HFRCXKbDlOh/7xEV6QUXaE7MJEKGNAncGI/STSbOkl12qVXZrfZdpXctx5O9X1AIaebiDBg==} - engines: {node: '>= 18'} - - '@octokit/openapi-types@22.2.0': - resolution: {integrity: sha512-QBhVjcUa9W7Wwhm6DBFu6ZZ+1/t/oYxqc2tp81Pi41YNuJinbFRx8B133qVOrAaBbF7D/m0Et6f9/pZt9Rc+tg==} - - '@octokit/plugin-paginate-rest@11.3.3': - resolution: {integrity: sha512-o4WRoOJZlKqEEgj+i9CpcmnByvtzoUYC6I8PD2SA95M+BJ2x8h7oLcVOg9qcowWXBOdcTRsMZiwvM3EyLm9AfA==} - engines: {node: '>= 18'} - peerDependencies: - '@octokit/core': '>=6' - - '@octokit/plugin-request-log@5.3.0': - resolution: {integrity: sha512-FiGcyjdtYPlr03ExBk/0ysIlEFIFGJQAVoPPMxL19B24bVSEiZQnVGBunNtaAF1YnvE/EFoDpXmITtRnyCiypQ==} - engines: {node: '>= 18'} - peerDependencies: - '@octokit/core': '>=6' - - '@octokit/plugin-rest-endpoint-methods@13.2.4': - resolution: {integrity: sha512-gusyAVgTrPiuXOdfqOySMDztQHv6928PQ3E4dqVGEtOvRXAKRbJR4b1zQyniIT9waqaWk/UDaoJ2dyPr7Bk7Iw==} - engines: {node: '>= 18'} - peerDependencies: - '@octokit/core': '>=6' - - '@octokit/request-error@6.1.2': - resolution: {integrity: sha512-sA0oF7aL5wXbNfl+7zgLYJiFZctei9GaIMJlTraJrlQyFaoIYr4MCqPSakzxxGCfm8fET4vn0cQdRFmD7avlDg==} - engines: {node: '>= 18'} - - '@octokit/request@9.1.1': - resolution: {integrity: sha512-pyAguc0p+f+GbQho0uNetNQMmLG1e80WjkIaqqgUkihqUp0boRU6nKItXO4VWnr+nbZiLGEyy4TeKRwqaLvYgw==} - engines: {node: '>= 18'} - - '@octokit/rest@21.0.0': - resolution: {integrity: sha512-XudXXOmiIjivdjNZ+fN71NLrnDM00sxSZlhqmPR3v0dVoJwyP628tSlc12xqn8nX3N0965583RBw5GPo6r8u4Q==} - engines: {node: '>= 18'} - - '@octokit/types@13.5.0': - resolution: {integrity: sha512-HdqWTf5Z3qwDVlzCrP8UJquMwunpDiMPt5er+QjGzL4hqr/vBVY/MauQgS1xWxCDT1oMx1EULyqxncdCY/NVSQ==} - - '@rollup/pluginutils@4.2.1': - resolution: {integrity: sha512-iKnFXr7NkdZAIHiIWE+BX5ULi/ucVFYWD6TbAV+rZctiRTY2PL6tsIKhoIOaoskiWAkgu+VsbXgUVDNLHf+InQ==} - engines: {node: '>= 8.0.0'} - - '@sindresorhus/merge-streams@2.3.0': - resolution: {integrity: sha512-LtoMMhxAlorcGhmFYI+LhPgbPZCkgP6ra1YL604EeF6U98pLlQ3iWIGMdWSC+vWmPBWBNgmDBAhnAobLROJmwg==} - engines: {node: '>=18'} - - '@tybys/wasm-util@0.9.0': - resolution: {integrity: sha512-6+7nlbMVX/PVDCwaIQ8nTOPveOcFLSt8GcXdx8hD0bt39uWxYT88uXzqTd4fTvqta7oeUJqudepapKNt2DYJFw==} - - '@types/mute-stream@0.0.4': - resolution: {integrity: sha512-CPM9nzrCPPJHQNA9keH9CVkVI+WR5kMa+7XEs5jcGQ0VoAGnLv242w8lIVgwAEfmE4oufJRaTc9PNLQl0ioAow==} - - '@types/node@20.16.5': - resolution: {integrity: sha512-VwYCweNo3ERajwy0IUlqqcyZ8/A7Zwa9ZP3MnENWcB11AejO+tLy3pu850goUW2FC/IJMdZUfKpX/yxL1gymCA==} - - '@types/node@22.5.4': - resolution: {integrity: sha512-FDuKUJQm/ju9fT/SeX/6+gBzoPzlVCzfzmGkwKvRHQVxi4BntVbyIwf6a4Xn62mrvndLiml6z/UBXIdEVjQLXg==} - - '@types/stylis@4.2.6': - resolution: {integrity: sha512-4nebF2ZJGzQk0ka0O6+FZUWceyFv4vWq/0dXBMmrSeAwzOuOd/GxE5Pa64d/ndeNLG73dXoBsRzvtsVsYUv6Uw==} - - '@types/wrap-ansi@3.0.0': - resolution: {integrity: sha512-ltIpx+kM7g/MLRZfkbL7EsCEjfzCcScLpkg37eXEtx5kmrAKBkTJwd1GIAjDSL8wTpM6Hzn5YO4pSb91BEwu1g==} - - '@vercel/nft@0.26.5': - resolution: {integrity: sha512-NHxohEqad6Ra/r4lGknO52uc/GrWILXAMs1BB4401GTqww0fw1bAqzpG1XHuDO+dprg4GvsD9ZLLSsdo78p9hQ==} - engines: {node: '>=16'} - hasBin: true - - abbrev@1.1.1: - resolution: {integrity: sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==} - - acorn-import-attributes@1.9.5: - resolution: {integrity: sha512-n02Vykv5uA3eHGM/Z2dQrcD56kL8TyDb2p1+0P83PClMnC/nc+anbQRhIOWnSq4Ke/KvDPrY3C9hDtC/A3eHnQ==} - peerDependencies: - acorn: ^8 - - acorn-walk@8.3.3: - resolution: {integrity: sha512-MxXdReSRhGO7VlFe1bRG/oI7/mdLV9B9JJT0N8vZOhF7gFRR5l3M8W9G8JxmKV+JC5mGqJ0QvqfSOLsCPa4nUw==} - engines: {node: '>=0.4.0'} - - acorn@8.12.1: - resolution: {integrity: sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg==} - engines: {node: '>=0.4.0'} - hasBin: true - - agent-base@6.0.2: - resolution: {integrity: sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==} - engines: {node: '>= 6.0.0'} - - ansi-escapes@4.3.2: - resolution: {integrity: sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==} - engines: {node: '>=8'} - - ansi-regex@5.0.1: - resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} - engines: {node: '>=8'} - - ansi-regex@6.0.1: - resolution: {integrity: sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==} - engines: {node: '>=12'} - - ansi-styles@4.3.0: - resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} - engines: {node: '>=8'} - - ansi-styles@6.2.1: - resolution: {integrity: sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==} - engines: {node: '>=12'} - - aproba@2.0.0: - resolution: {integrity: sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==} - - are-we-there-yet@2.0.0: - resolution: {integrity: sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw==} - engines: {node: '>=10'} - deprecated: This package is no longer supported. - - argparse@1.0.10: - resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==} - - argparse@2.0.1: - resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} - - array-find-index@1.0.2: - resolution: {integrity: sha512-M1HQyIXcBGtVywBt8WVdim+lrNaK7VHp99Qt5pSNziXznKHViIBbXWtfRTpEFpF/c4FdfxNAsCCwPp5phBYJtw==} - engines: {node: '>=0.10.0'} - - arrgv@1.0.2: - resolution: {integrity: sha512-a4eg4yhp7mmruZDQFqVMlxNRFGi/i1r87pt8SDHy0/I8PqSXoUTlWZRdAZo0VXgvEARcujbtTk8kiZRi1uDGRw==} - engines: {node: '>=8.0.0'} - - arrify@3.0.0: - resolution: {integrity: sha512-tLkvA81vQG/XqE2mjDkGQHoOINtMHtysSnemrmoGe6PydDPMRbVugqyk4A6V/WDWEfm3l+0d8anA9r8cv/5Jaw==} - engines: {node: '>=12'} - - async-sema@3.1.1: - resolution: {integrity: sha512-tLRNUXati5MFePdAk8dw7Qt7DpxPB60ofAgn8WRhW6a2rcimZnYBP9oxHiv0OHy+Wz7kPMG+t4LGdt31+4EmGg==} - - asynckit@0.4.0: - resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} - - ava@6.1.3: - resolution: {integrity: sha512-tkKbpF1pIiC+q09wNU9OfyTDYZa8yuWvU2up3+lFJ3lr1RmnYh2GBpPwzYUEB0wvTPIUysGjcZLNZr7STDviRA==} - engines: {node: ^18.18 || ^20.8 || ^21 || ^22} - hasBin: true - peerDependencies: - '@ava/typescript': '*' - peerDependenciesMeta: - '@ava/typescript': - optional: true - - axios@1.6.2: - resolution: {integrity: sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A==} - - balanced-match@1.0.2: - resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} - - before-after-hook@3.0.2: - resolution: {integrity: sha512-Nik3Sc0ncrMK4UUdXQmAnRtzmNQTAAXmXIopizwZ1W1t8QmfJj+zL4OA2I7XPTPW5z5TDqv4hRo/JzouDJnX3A==} - - bindings@1.5.0: - resolution: {integrity: sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==} - - blueimp-md5@2.19.0: - resolution: {integrity: sha512-DRQrD6gJyy8FbiE4s+bDoXS9hiW3Vbx5uCdwvcCf3zLHL+Iv7LtGHLpr+GZV8rHG8tK766FGYBwRbu8pELTt+w==} - - brace-expansion@1.1.11: - resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} - - braces@3.0.3: - resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==} - engines: {node: '>=8'} - - callsites@4.2.0: - resolution: {integrity: sha512-kfzR4zzQtAE9PC7CzZsjl3aBNbXWuXiSeOCdLcPpBfGW8YuCqQHcRPFDbr/BPVmd3EEPVpuFzLyuT/cUhPr4OQ==} - engines: {node: '>=12.20'} - - camelize@1.0.1: - resolution: {integrity: sha512-dU+Tx2fsypxTgtLoE36npi3UqcjSSMNYfkqgmoEhtZrraP5VWq0K7FkWVTYa8eMPtnU/G2txVsfdCJTn9uzpuQ==} - - cbor@9.0.2: - resolution: {integrity: sha512-JPypkxsB10s9QOWwa6zwPzqE1Md3vqpPc+cai4sAecuCsRyAtAl/pMyhPlMbT/xtPnm2dznJZYRLui57qiRhaQ==} - engines: {node: '>=16'} - - chalk@5.3.0: - resolution: {integrity: sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==} - engines: {node: ^12.17.0 || ^14.13 || >=16.0.0} - - chardet@0.7.0: - resolution: {integrity: sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==} - - chownr@2.0.0: - resolution: {integrity: sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==} - engines: {node: '>=10'} - - chunkd@2.0.1: - resolution: {integrity: sha512-7d58XsFmOq0j6el67Ug9mHf9ELUXsQXYJBkyxhH/k+6Ke0qXRnv0kbemx+Twc6fRJ07C49lcbdgm9FL1Ei/6SQ==} - - ci-info@4.0.0: - resolution: {integrity: sha512-TdHqgGf9odd8SXNuxtUBVx8Nv+qZOejE6qyqiy5NtbYYQOeFa6zmHkxlPzmaLxWWHsU6nJmB7AETdVPi+2NBUg==} - engines: {node: '>=8'} - - ci-parallel-vars@1.0.1: - resolution: {integrity: sha512-uvzpYrpmidaoxvIQHM+rKSrigjOe9feHYbw4uOI2gdfe1C3xIlxO+kVXq83WQWNniTf8bAxVpy+cQeFQsMERKg==} - - cli-spinners@2.9.2: - resolution: {integrity: sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==} - engines: {node: '>=6'} - - cli-truncate@4.0.0: - resolution: {integrity: sha512-nPdaFdQ0h/GEigbPClz11D0v/ZJEwxmeVZGeMo3Z5StPtUTkA9o1lD6QwoirYiSDzbcwn2XcjwmCp68W1IS4TA==} - engines: {node: '>=18'} - - cli-width@4.1.0: - resolution: {integrity: sha512-ouuZd4/dm2Sw5Gmqy6bGyNNNe1qt9RpmxveLSO7KcgsTnU7RXfsw+/bukWGo1abgBiMAic068rclZsO4IWmmxQ==} - engines: {node: '>= 12'} - - clipanion@3.2.1: - resolution: {integrity: sha512-dYFdjLb7y1ajfxQopN05mylEpK9ZX0sO1/RfMXdfmwjlIsPkbh4p7A682x++zFPLDCo1x3p82dtljHf5cW2LKA==} - peerDependencies: - typanion: '*' - - cliui@8.0.1: - resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==} - engines: {node: '>=12'} - - code-excerpt@4.0.0: - resolution: {integrity: sha512-xxodCmBen3iy2i0WtAK8FlFNrRzjUqjRsMfho58xT/wvZU1YTM3fCnRjcy1gJPMepaRlgm/0e6w8SpWHpn3/cA==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - color-convert@2.0.1: - resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} - engines: {node: '>=7.0.0'} - - color-name@1.1.4: - resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} - - color-support@1.1.3: - resolution: {integrity: sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==} - hasBin: true - - colorette@2.0.20: - resolution: {integrity: sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==} - - combined-stream@1.0.8: - resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} - engines: {node: '>= 0.8'} - - common-path-prefix@3.0.0: - resolution: {integrity: sha512-QE33hToZseCH3jS0qN96O/bSh3kaw/h+Tq7ngyY9eWDUnTlTNUyqfqvCXioLe5Na5jFsL78ra/wuBU4iuEgd4w==} - - concat-map@0.0.1: - resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} - - concordance@5.0.4: - resolution: {integrity: sha512-OAcsnTEYu1ARJqWVGwf4zh4JDfHZEaSNlNccFmt8YjB2l/n19/PF2viLINHc57vO4FKIAFl2FWASIGZZWZ2Kxw==} - engines: {node: '>=10.18.0 <11 || >=12.14.0 <13 || >=14'} - - console-control-strings@1.1.0: - resolution: {integrity: sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==} - - convert-to-spaces@2.0.1: - resolution: {integrity: sha512-rcQ1bsQO9799wq24uE5AM2tAILy4gXGIK/njFWcVQkGNZ96edlpY+A7bjwvzjYvLDyzmG1MmMLZhpcsb+klNMQ==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - css-color-keywords@1.0.0: - resolution: {integrity: sha512-FyyrDHZKEjXDpNJYvVsV960FiqQyXc/LlYmsxl2BcdMb2WPx0OGRVgTg55rPSyLSNMqP52R9r8geSp7apN3Ofg==} - engines: {node: '>=4'} - - css-to-react-native@3.2.0: - resolution: {integrity: sha512-e8RKaLXMOFii+02mOlqwjbD00KSEKqblnpO9e++1aXS1fPQOpS1YoqdVHBqPjHNoxeF2mimzVqawm2KCbEdtHQ==} - - csstype@3.1.3: - resolution: {integrity: sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==} - - currently-unhandled@0.4.1: - resolution: {integrity: sha512-/fITjgjGU50vjQ4FH6eUoYu+iUoUKIXws2hL15JJpIR+BbTxaXQsMuuyjtNh2WqsSBS5nsaZHFsFecyw5CCAng==} - engines: {node: '>=0.10.0'} - - date-time@3.1.0: - resolution: {integrity: sha512-uqCUKXE5q1PNBXjPqvwhwJf9SwMoAHBgWJ6DcrnS5o+W2JOiIILl0JEdVD8SGujrNS02GGxgwAg2PN2zONgtjg==} - engines: {node: '>=6'} - - debug@4.3.5: - resolution: {integrity: sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg==} - engines: {node: '>=6.0'} - peerDependencies: - supports-color: '*' - peerDependenciesMeta: - supports-color: - optional: true - - delayed-stream@1.0.0: - resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} - engines: {node: '>=0.4.0'} - - delegates@1.0.0: - resolution: {integrity: sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==} - - detect-libc@2.0.3: - resolution: {integrity: sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw==} - engines: {node: '>=8'} - - emittery@1.0.3: - resolution: {integrity: sha512-tJdCJitoy2lrC2ldJcqN4vkqJ00lT+tOWNT1hBJjO/3FDMJa5TTIiYGCKGkn/WfCyOzUMObeohbVTj00fhiLiA==} - engines: {node: '>=14.16'} - - emnapi@1.2.0: - resolution: {integrity: sha512-rcq+dJCcfr08I0XM/57LPRqaUokGfni/+SvhO7NaJthTTjRdohhIy0FQwyC5rR1enAsjkldQg83th8J5hURv0Q==} - peerDependencies: - node-addon-api: '>= 6.1.0' - peerDependenciesMeta: - node-addon-api: - optional: true - - emoji-regex@10.3.0: - resolution: {integrity: sha512-QpLs9D9v9kArv4lfDEgg1X/gN5XLnf/A6l9cs8SPZLRZR3ZkY9+kwIQTxm+fsSej5UMYGE8fdoaZVIBlqG0XTw==} - - emoji-regex@8.0.0: - resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} - - escalade@3.1.2: - resolution: {integrity: sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==} - engines: {node: '>=6'} - - escape-string-regexp@2.0.0: - resolution: {integrity: sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==} - engines: {node: '>=8'} - - escape-string-regexp@5.0.0: - resolution: {integrity: sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==} - engines: {node: '>=12'} - - esprima@4.0.1: - resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==} - engines: {node: '>=4'} - hasBin: true - - estree-walker@2.0.2: - resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==} - - esutils@2.0.3: - resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} - engines: {node: '>=0.10.0'} - - external-editor@3.1.0: - resolution: {integrity: sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==} - engines: {node: '>=4'} - - fast-diff@1.3.0: - resolution: {integrity: sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==} - - fast-glob@3.3.2: - resolution: {integrity: sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==} - engines: {node: '>=8.6.0'} - - fastq@1.17.1: - resolution: {integrity: sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==} - - figures@6.1.0: - resolution: {integrity: sha512-d+l3qxjSesT4V7v2fh+QnmFnUWv9lSpjarhShNTgBOfA0ttejbQUAlHLitbjkoRiDulW0OPoQPYIGhIC8ohejg==} - engines: {node: '>=18'} - - file-uri-to-path@1.0.0: - resolution: {integrity: sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==} - - fill-range@7.1.1: - resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==} - engines: {node: '>=8'} - - find-up-simple@1.0.0: - resolution: {integrity: sha512-q7Us7kcjj2VMePAa02hDAF6d+MzsdsAWEwYyOpwUtlerRBkOEPBCRZrAV4XfcSN8fHAgaD0hP7miwoay6DCprw==} - engines: {node: '>=18'} - - follow-redirects@1.15.6: - resolution: {integrity: sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==} - engines: {node: '>=4.0'} - peerDependencies: - debug: '*' - peerDependenciesMeta: - debug: - optional: true - - form-data@4.0.0: - resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==} - engines: {node: '>= 6'} - - fs-minipass@2.1.0: - resolution: {integrity: sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==} - engines: {node: '>= 8'} - - fs.realpath@1.0.0: - resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} - - gauge@3.0.2: - resolution: {integrity: sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q==} - engines: {node: '>=10'} - deprecated: This package is no longer supported. - - get-caller-file@2.0.5: - resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} - engines: {node: 6.* || 8.* || >= 10.*} - - get-east-asian-width@1.2.0: - resolution: {integrity: sha512-2nk+7SIVb14QrgXFHcm84tD4bKQz0RxPuMT8Ag5KPOq7J5fEmAg0UbXdTOSHqNuHSU28k55qnceesxXRZGzKWA==} - engines: {node: '>=18'} - - glob-parent@5.1.2: - resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} - engines: {node: '>= 6'} - - glob@7.2.3: - resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} - deprecated: Glob versions prior to v9 are no longer supported - - globby@14.0.2: - resolution: {integrity: sha512-s3Fq41ZVh7vbbe2PN3nrW7yC7U7MFVc5c98/iTl9c2GawNMKx/J648KQRW6WKkuU8GIbbh2IXfIRQjOZnXcTnw==} - engines: {node: '>=18'} - - graceful-fs@4.2.11: - resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} - - has-unicode@2.0.1: - resolution: {integrity: sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==} - - https-proxy-agent@5.0.1: - resolution: {integrity: sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==} - engines: {node: '>= 6'} - - iconv-lite@0.4.24: - resolution: {integrity: sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==} - engines: {node: '>=0.10.0'} - - ignore-by-default@2.1.0: - resolution: {integrity: sha512-yiWd4GVmJp0Q6ghmM2B/V3oZGRmjrKLXvHR3TE1nfoXsmoggllfZUQe74EN0fJdPFZu2NIvNdrMMLm3OsV7Ohw==} - engines: {node: '>=10 <11 || >=12 <13 || >=14'} - - ignore@5.3.1: - resolution: {integrity: sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==} - engines: {node: '>= 4'} - - imurmurhash@0.1.4: - resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} - engines: {node: '>=0.8.19'} - - indent-string@5.0.0: - resolution: {integrity: sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==} - engines: {node: '>=12'} - - inflight@1.0.6: - resolution: {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. - - inherits@2.0.4: - resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} - - inquirer@10.0.1: - resolution: {integrity: sha512-XgthhRIn0Ci9JdGJpUo2EtpPfaczbooZbGTN+FTzSCyUb7YHJcPPnuSXfeG5903bJMy3OyEoVTQMnvO4Ly5tFg==} - engines: {node: '>=18'} - - ipaddr.js@2.2.0: - resolution: {integrity: sha512-Ag3wB2o37wslZS19hZqorUnrnzSkpOVy+IiiDEiTqNubEYpYuHWIf6K4psgN2ZWKExS4xhVCrRVfb/wfW8fWJA==} - engines: {node: '>= 10'} - - irregular-plurals@3.5.0: - resolution: {integrity: sha512-1ANGLZ+Nkv1ptFb2pa8oG8Lem4krflKuX/gINiHJHjJUKaJHk/SXk5x6K3J+39/p0h1RQ2saROclJJ+QLvETCQ==} - engines: {node: '>=8'} - - is-extglob@2.1.1: - resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} - engines: {node: '>=0.10.0'} - - is-fullwidth-code-point@3.0.0: - resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} - engines: {node: '>=8'} - - is-fullwidth-code-point@4.0.0: - resolution: {integrity: sha512-O4L094N2/dZ7xqVdrXhh9r1KODPJpFms8B5sGdJLPy664AgvXsreZUyCQQNItZRDlYug4xStLjNp/sz3HvBowQ==} - engines: {node: '>=12'} - - is-glob@4.0.3: - resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} - engines: {node: '>=0.10.0'} - - is-number@7.0.0: - resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} - engines: {node: '>=0.12.0'} - - is-plain-object@5.0.0: - resolution: {integrity: sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==} - engines: {node: '>=0.10.0'} - - is-promise@4.0.0: - resolution: {integrity: sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==} - - is-unicode-supported@2.0.0: - resolution: {integrity: sha512-FRdAyx5lusK1iHG0TWpVtk9+1i+GjrzRffhDg4ovQ7mcidMQ6mj+MhKPmvh7Xwyv5gIS06ns49CA7Sqg7lC22Q==} - engines: {node: '>=18'} - - js-string-escape@1.0.1: - resolution: {integrity: sha512-Smw4xcfIQ5LVjAOuJCvN/zIodzA/BBSsluuoSykP+lUvScIi4U6RJLfwHet5cxFnCswUjISV8oAXaqaJDY3chg==} - engines: {node: '>= 0.8'} - - js-tokens@4.0.0: - resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} - - js-yaml@3.14.1: - resolution: {integrity: sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==} - hasBin: true - - js-yaml@4.1.0: - resolution: {integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==} - hasBin: true - - load-json-file@7.0.1: - resolution: {integrity: sha512-Gnxj3ev3mB5TkVBGad0JM6dmLiQL+o0t23JPBZ9sd+yvSLk05mFoqKBw5N8gbbkU4TNXyqCgIrl/VM17OgUIgQ==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - lodash-es@4.17.21: - resolution: {integrity: sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==} - - lodash@4.17.21: - resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} - - loose-envify@1.4.0: - resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==} - hasBin: true - - make-dir@3.1.0: - resolution: {integrity: sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==} - engines: {node: '>=8'} - - matcher@5.0.0: - resolution: {integrity: sha512-s2EMBOWtXFc8dgqvoAzKJXxNHibcdJMV0gwqKUaw9E2JBJuGUK7DrNKrA6g/i+v72TT16+6sVm5mS3thaMLQUw==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - md5-hex@3.0.1: - resolution: {integrity: sha512-BUiRtTtV39LIJwinWBjqVsU9xhdnz7/i889V859IBFpuqGAj6LuOvHv5XLbgZ2R7ptJoJaEcxkv88/h25T7Ciw==} - engines: {node: '>=8'} - - memoize@10.0.0: - resolution: {integrity: sha512-H6cBLgsi6vMWOcCpvVCdFFnl3kerEXbrYh9q+lY6VXvQSmM6CkmV08VOwT+WE2tzIEqRPFfAq3fm4v/UIW6mSA==} - engines: {node: '>=18'} - - merge2@1.4.1: - resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} - engines: {node: '>= 8'} - - micromatch@4.0.7: - resolution: {integrity: sha512-LPP/3KorzCwBxfeUuZmaR6bG2kdeHSbe0P2tY3FLRU4vYrjYz5hI4QZwV0njUx3jeuKe67YukQ1LSPZBKDqO/Q==} - engines: {node: '>=8.6'} - - mime-db@1.52.0: - resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} - engines: {node: '>= 0.6'} - - mime-types@2.1.35: - resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} - engines: {node: '>= 0.6'} - - mimic-function@5.0.1: - resolution: {integrity: sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==} - engines: {node: '>=18'} - - minimatch@3.1.2: - resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} - - minipass@3.3.6: - resolution: {integrity: sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==} - engines: {node: '>=8'} - - minipass@5.0.0: - resolution: {integrity: sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==} - engines: {node: '>=8'} - - minizlib@2.1.2: - resolution: {integrity: sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==} - engines: {node: '>= 8'} - - mkdirp@1.0.4: - resolution: {integrity: sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==} - engines: {node: '>=10'} - hasBin: true - - ms@2.1.2: - resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} - - ms@2.1.3: - resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} - - mute-stream@1.0.0: - resolution: {integrity: sha512-avsJQhyd+680gKXyG/sQc0nXaC6rBkPOfyHYcFb9+hdkqQkR9bdnkJ0AMZhke0oesPqIO+mFFJ+IdBc7mst4IA==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - - nanoid@3.3.7: - resolution: {integrity: sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==} - engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} - hasBin: true - - node-fetch@2.7.0: - resolution: {integrity: sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==} - engines: {node: 4.x || >=6.0.0} - peerDependencies: - encoding: ^0.1.0 - peerDependenciesMeta: - encoding: - optional: true - - node-gyp-build@4.8.1: - resolution: {integrity: sha512-OSs33Z9yWr148JZcbZd5WiAXhh/n9z8TxQcdMhIOlpN9AhWpLfvVFO73+m77bBABQMaY9XSvIa+qk0jlI7Gcaw==} - hasBin: true - - nofilter@3.1.0: - resolution: {integrity: sha512-l2NNj07e9afPnhAhvgVrCD/oy2Ai1yfLpuo3EpiO1jFTsB4sFz6oIfAfSZyQzVpkZQ9xS8ZS5g1jCBgq4Hwo0g==} - engines: {node: '>=12.19'} - - nopt@5.0.0: - resolution: {integrity: sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==} - engines: {node: '>=6'} - hasBin: true - - npmlog@5.0.1: - resolution: {integrity: sha512-AqZtDUWOMKs1G/8lwylVjrdYgqA4d9nu8hc+0gzRxlDb1I10+FHBGMXs6aiQHFdCUUlqH99MUMuLfzWDNDtfxw==} - deprecated: This package is no longer supported. - - object-assign@4.1.1: - resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} - engines: {node: '>=0.10.0'} - - once@1.4.0: - resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} - - os-tmpdir@1.0.2: - resolution: {integrity: sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==} - engines: {node: '>=0.10.0'} - - p-map@7.0.2: - resolution: {integrity: sha512-z4cYYMMdKHzw4O5UkWJImbZynVIo0lSGTXc7bzB1e/rrDqkgGUNysK/o4bTr+0+xKvvLoTyGqYC4Fgljy9qe1Q==} - engines: {node: '>=18'} - - package-config@5.0.0: - resolution: {integrity: sha512-GYTTew2slBcYdvRHqjhwaaydVMvn/qrGC323+nKclYioNSLTDUM/lGgtGTgyHVtYcozb+XkE8CNhwcraOmZ9Mg==} - engines: {node: '>=18'} - - parse-ms@4.0.0: - resolution: {integrity: sha512-TXfryirbmq34y8QBwgqCVLi+8oA3oWx2eAnSn62ITyEhEYaWRlVZ2DvMM9eZbMs/RfxPu/PK/aBLyGj4IrqMHw==} - engines: {node: '>=18'} - - path-is-absolute@1.0.1: - resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==} - engines: {node: '>=0.10.0'} - - path-type@5.0.0: - resolution: {integrity: sha512-5HviZNaZcfqP95rwpv+1HDgUamezbqdSYTyzjTvwtJSnIH+3vnbmWsItli8OFEndS984VT55M3jduxZbX351gg==} - engines: {node: '>=12'} - - picocolors@1.0.1: - resolution: {integrity: sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==} - - picomatch@2.3.1: - resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} - engines: {node: '>=8.6'} - - picomatch@3.0.1: - resolution: {integrity: sha512-I3EurrIQMlRc9IaAZnqRR044Phh2DXY+55o7uJ0V+hYZAcQYSuFWsc9q5PvyDHUSCe1Qxn/iBz+78s86zWnGag==} - engines: {node: '>=10'} - - plur@5.1.0: - resolution: {integrity: sha512-VP/72JeXqak2KiOzjgKtQen5y3IZHn+9GOuLDafPv0eXa47xq0At93XahYBs26MsifCQ4enGKwbjBTKgb9QJXg==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - postcss-value-parser@4.2.0: - resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==} - - postcss@8.4.33: - resolution: {integrity: sha512-Kkpbhhdjw2qQs2O2DGX+8m5OVqEcbB9HRBvuYM9pgrjEFUg30A9LmXNlTAUj4S9kgtGyrMbTzVjH7E+s5Re2yg==} - engines: {node: ^10 || ^12 || >=14} - - pretty-ms@9.0.0: - resolution: {integrity: sha512-E9e9HJ9R9NasGOgPaPE8VMeiPKAyWR5jcFpNnwIejslIhWqdqOrb2wShBsncMPUb+BcCd2OPYfh7p2W6oemTng==} - engines: {node: '>=18'} - - proxy-from-env@1.1.0: - resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==} - - queue-microtask@1.2.3: - resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} - - react-dom@18.3.1: - resolution: {integrity: sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==} - peerDependencies: - react: ^18.3.1 - - react@18.3.1: - resolution: {integrity: sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==} - engines: {node: '>=0.10.0'} - - readable-stream@3.6.2: - resolution: {integrity: sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==} - engines: {node: '>= 6'} - - require-directory@2.1.1: - resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} - engines: {node: '>=0.10.0'} - - resolve-cwd@3.0.0: - resolution: {integrity: sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==} - engines: {node: '>=8'} - - resolve-from@5.0.0: - resolution: {integrity: sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==} - engines: {node: '>=8'} - - reusify@1.0.4: - resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==} - engines: {iojs: '>=1.0.0', node: '>=0.10.0'} - - rimraf@3.0.2: - resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==} - deprecated: Rimraf versions prior to v4 are no longer supported - hasBin: true - - run-async@3.0.0: - resolution: {integrity: sha512-540WwVDOMxA6dN6We19EcT9sc3hkXPw5mzRNGM3FkdN/vtE9NFvj5lFAPNwUDmJjXidm3v7TC1cTE7t17Ulm1Q==} - engines: {node: '>=0.12.0'} - - run-parallel@1.2.0: - resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} - - rxjs@7.8.1: - resolution: {integrity: sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==} - - safe-buffer@5.2.1: - resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} - - safer-buffer@2.1.2: - resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} - - scheduler@0.23.2: - resolution: {integrity: sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ==} - - semver@6.3.1: - resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} - hasBin: true - - semver@7.6.2: - resolution: {integrity: sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==} - engines: {node: '>=10'} - hasBin: true - - serialize-error@7.0.1: - resolution: {integrity: sha512-8I8TjW5KMOKsZQTvoxjuSIa7foAwPWGOts+6o7sgjz41/qMD9VQHEDxi6PBvK2l0MXUmqZyNpUK+T2tQaaElvw==} - engines: {node: '>=10'} - - set-blocking@2.0.0: - resolution: {integrity: sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==} - - shallowequal@1.1.0: - resolution: {integrity: sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ==} - - signal-exit@3.0.7: - resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} - - signal-exit@4.1.0: - resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} - engines: {node: '>=14'} - - slash@5.1.0: - resolution: {integrity: sha512-ZA6oR3T/pEyuqwMgAKT0/hAv8oAXckzbkmR0UkUosQ+Mc4RxGoJkRmwHgHufaenlyAgE1Mxgpdcrf75y6XcnDg==} - engines: {node: '>=14.16'} - - slice-ansi@5.0.0: - resolution: {integrity: sha512-FC+lgizVPfie0kkhqUScwRu1O/lF6NOgJmlCgK+/LYxDCTk8sGelYaHDhFcDN+Sn3Cv+3VSa4Byeo+IMCzpMgQ==} - engines: {node: '>=12'} - - source-map-js@1.2.0: - resolution: {integrity: sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==} - engines: {node: '>=0.10.0'} - - sprintf-js@1.0.3: - resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==} - - stack-utils@2.0.6: - resolution: {integrity: sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==} - engines: {node: '>=10'} - - string-width@4.2.3: - resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} - engines: {node: '>=8'} - - string-width@7.2.0: - resolution: {integrity: sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==} - engines: {node: '>=18'} - - string_decoder@1.3.0: - resolution: {integrity: sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==} - - strip-ansi@6.0.1: - resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} - engines: {node: '>=8'} - - strip-ansi@7.1.0: - resolution: {integrity: sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==} - engines: {node: '>=12'} - - styled-components@6.1.1: - resolution: {integrity: sha512-cpZZP5RrKRIClBW5Eby4JM1wElLVP4NQrJbJ0h10TidTyJf4SIIwa3zLXOoPb4gJi8MsJ8mjq5mu2IrEhZIAcQ==} - engines: {node: '>= 16'} - peerDependencies: - react: '>= 16.8.0' - react-dom: '>= 16.8.0' - - stylis@4.3.2: - resolution: {integrity: sha512-bhtUjWd/z6ltJiQwg0dUfxEJ+W+jdqQd8TbWLWyeIJHlnsqmGLRFFd8e5mA0AZi/zx90smXRlN66YMTcaSFifg==} - - supertap@3.0.1: - resolution: {integrity: sha512-u1ZpIBCawJnO+0QePsEiOknOfCRq0yERxiAchT0i4li0WHNUJbf0evXXSXOcCAR4M8iMDoajXYmstm/qO81Isw==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - tar@6.2.1: - resolution: {integrity: sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==} - engines: {node: '>=10'} - - temp-dir@3.0.0: - resolution: {integrity: sha512-nHc6S/bwIilKHNRgK/3jlhDoIHcp45YgyiwcAk46Tr0LfEqGBVpmiAyuiuxeVE44m3mXnEeVhaipLOEWmH+Njw==} - engines: {node: '>=14.16'} - - time-zone@1.0.0: - resolution: {integrity: sha512-TIsDdtKo6+XrPtiTm1ssmMngN1sAhyKnTO2kunQWqNPWIVvCm15Wmw4SWInwTVgJ5u/Tr04+8Ei9TNcw4x4ONA==} - engines: {node: '>=4'} - - tmp@0.0.33: - resolution: {integrity: sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==} - engines: {node: '>=0.6.0'} - - to-regex-range@5.0.1: - resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} - engines: {node: '>=8.0'} - - toml@3.0.0: - resolution: {integrity: sha512-y/mWCZinnvxjTKYhJ+pYxwD0mRLVvOtdS2Awbgxln6iEnt4rk0yBxeSBHkGJcPucRiG0e55mwWp+g/05rsrd6w==} - - tr46@0.0.3: - resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==} - - tslib@2.6.3: - resolution: {integrity: sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ==} - - typanion@3.14.0: - resolution: {integrity: sha512-ZW/lVMRabETuYCd9O9ZvMhAh8GslSqaUjxmK/JLPCh6l73CvLBiuXswj/+7LdnWOgYsQ130FqLzFz5aGT4I3Ug==} - - type-fest@0.13.1: - resolution: {integrity: sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==} - engines: {node: '>=10'} - - type-fest@0.21.3: - resolution: {integrity: sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==} - engines: {node: '>=10'} - - typescript@5.5.4: - resolution: {integrity: sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q==} - engines: {node: '>=14.17'} - hasBin: true - - undici-types@6.19.8: - resolution: {integrity: sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==} - - unicorn-magic@0.1.0: - resolution: {integrity: sha512-lRfVq8fE8gz6QMBuDM6a+LO3IAzTi05H6gCVaUpir2E1Rwpo4ZUog45KpNXKC/Mn3Yb9UDuHumeFTo9iV/D9FQ==} - engines: {node: '>=18'} - - universal-user-agent@7.0.2: - resolution: {integrity: sha512-0JCqzSKnStlRRQfCdowvqy3cy0Dvtlb8xecj/H8JFZuCze4rwjPZQOgvFvn0Ws/usCHQFGpyr+pB9adaGwXn4Q==} - - util-deprecate@1.0.2: - resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} - - wasm-sjlj@1.0.5: - resolution: {integrity: sha512-Z/MHJeOkAvJJVWnGX3/YZGYldGaawZbYHX4ldYG9kLhcdB8H31F5x66M7Zc4BP/7pg0aLsusQj1629m2B3Rilg==} - - webidl-conversions@3.0.1: - resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==} - - well-known-symbols@2.0.0: - resolution: {integrity: sha512-ZMjC3ho+KXo0BfJb7JgtQ5IBuvnShdlACNkKkdsqBmYw3bPAaJfPeYUo6tLUaT5tG/Gkh7xkpBhKRQ9e7pyg9Q==} - engines: {node: '>=6'} - - whatwg-url@5.0.0: - resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==} - - wide-align@1.1.5: - resolution: {integrity: sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==} - - wrap-ansi@6.2.0: - resolution: {integrity: sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==} - engines: {node: '>=8'} - - wrap-ansi@7.0.0: - resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==} - engines: {node: '>=10'} - - wrappy@1.0.2: - resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} - - write-file-atomic@5.0.1: - resolution: {integrity: sha512-+QU2zd6OTD8XWIJCbffaiQeH9U73qIqafo1x6V1snCWYGJf6cVE0cDR4D8xRzcEnfI21IFrUPzPGtcPf8AC+Rw==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - - y18n@5.0.8: - resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==} - engines: {node: '>=10'} - - yallist@4.0.0: - resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==} - - yargs-parser@21.1.1: - resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} - engines: {node: '>=12'} - - yargs@17.7.2: - resolution: {integrity: sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==} - engines: {node: '>=12'} - - yoctocolors-cjs@2.1.2: - resolution: {integrity: sha512-cYVsTjKl8b+FrnidjibDWskAv7UKOfcwaVZdp/it9n1s9fU3IkgDbhdIRKCW4JDsAlECJY0ytoVPT3sK6kideA==} - engines: {node: '>=18'} - -snapshots: - - '@emnapi/core@1.2.0': - dependencies: - '@emnapi/wasi-threads': 1.0.1 - tslib: 2.6.3 - - '@emnapi/runtime@1.2.0': - dependencies: - tslib: 2.6.3 - - '@emnapi/wasi-threads@1.0.1': - dependencies: - tslib: 2.6.3 - - '@emotion/is-prop-valid@1.2.2': - dependencies: - '@emotion/memoize': 0.8.1 - - '@emotion/memoize@0.8.1': {} - - '@emotion/unitless@0.8.1': {} - - '@inquirer/checkbox@2.3.10': - dependencies: - '@inquirer/core': 9.0.2 - '@inquirer/figures': 1.0.3 - '@inquirer/type': 1.4.0 - ansi-escapes: 4.3.2 - yoctocolors-cjs: 2.1.2 - - '@inquirer/confirm@3.1.14': - dependencies: - '@inquirer/core': 9.0.2 - '@inquirer/type': 1.4.0 - - '@inquirer/core@9.0.2': - dependencies: - '@inquirer/figures': 1.0.3 - '@inquirer/type': 1.4.0 - '@types/mute-stream': 0.0.4 - '@types/node': 20.16.5 - '@types/wrap-ansi': 3.0.0 - ansi-escapes: 4.3.2 - cli-spinners: 2.9.2 - cli-width: 4.1.0 - mute-stream: 1.0.0 - signal-exit: 4.1.0 - strip-ansi: 6.0.1 - wrap-ansi: 6.2.0 - yoctocolors-cjs: 2.1.2 - - '@inquirer/editor@2.1.14': - dependencies: - '@inquirer/core': 9.0.2 - '@inquirer/type': 1.4.0 - external-editor: 3.1.0 - - '@inquirer/expand@2.1.14': - dependencies: - '@inquirer/core': 9.0.2 - '@inquirer/type': 1.4.0 - yoctocolors-cjs: 2.1.2 - - '@inquirer/figures@1.0.3': {} - - '@inquirer/input@2.2.1': - dependencies: - '@inquirer/core': 9.0.2 - '@inquirer/type': 1.4.0 - - '@inquirer/number@1.0.2': - dependencies: - '@inquirer/core': 9.0.2 - '@inquirer/type': 1.4.0 - - '@inquirer/password@2.1.14': - dependencies: - '@inquirer/core': 9.0.2 - '@inquirer/type': 1.4.0 - ansi-escapes: 4.3.2 - - '@inquirer/prompts@5.1.2': - dependencies: - '@inquirer/checkbox': 2.3.10 - '@inquirer/confirm': 3.1.14 - '@inquirer/editor': 2.1.14 - '@inquirer/expand': 2.1.14 - '@inquirer/input': 2.2.1 - '@inquirer/number': 1.0.2 - '@inquirer/password': 2.1.14 - '@inquirer/rawlist': 2.1.14 - '@inquirer/select': 2.3.10 - - '@inquirer/rawlist@2.1.14': - dependencies: - '@inquirer/core': 9.0.2 - '@inquirer/type': 1.4.0 - yoctocolors-cjs: 2.1.2 - - '@inquirer/select@2.3.10': - dependencies: - '@inquirer/core': 9.0.2 - '@inquirer/figures': 1.0.3 - '@inquirer/type': 1.4.0 - ansi-escapes: 4.3.2 - yoctocolors-cjs: 2.1.2 - - '@inquirer/type@1.4.0': - dependencies: - mute-stream: 1.0.0 - - '@mapbox/node-pre-gyp@1.0.11': - dependencies: - detect-libc: 2.0.3 - https-proxy-agent: 5.0.1 - make-dir: 3.1.0 - node-fetch: 2.7.0 - nopt: 5.0.0 - npmlog: 5.0.1 - rimraf: 3.0.2 - semver: 7.6.2 - tar: 6.2.1 - transitivePeerDependencies: - - encoding - - supports-color - - '@napi-rs/cli@3.0.0-alpha.62(@emnapi/runtime@1.2.0)(emnapi@1.2.0)': - dependencies: - '@napi-rs/cross-toolchain': 0.0.16 - '@napi-rs/wasm-tools': 0.0.2 - '@octokit/rest': 21.0.0 - clipanion: 3.2.1(typanion@3.14.0) - colorette: 2.0.20 - debug: 4.3.5 - inquirer: 10.0.1 - js-yaml: 4.1.0 - lodash-es: 4.17.21 - semver: 7.6.2 - toml: 3.0.0 - typanion: 3.14.0 - wasm-sjlj: 1.0.5 - optionalDependencies: - '@emnapi/runtime': 1.2.0 - emnapi: 1.2.0 - transitivePeerDependencies: - - '@napi-rs/cross-toolchain-arm64-target-aarch64' - - '@napi-rs/cross-toolchain-arm64-target-armv7' - - '@napi-rs/cross-toolchain-arm64-target-x86_64' - - '@napi-rs/cross-toolchain-x64-target-aarch64' - - '@napi-rs/cross-toolchain-x64-target-armv7' - - '@napi-rs/cross-toolchain-x64-target-x86_64' - - supports-color - - '@napi-rs/cross-toolchain@0.0.16': - dependencies: - '@napi-rs/lzma': 1.3.1 - '@napi-rs/tar': 0.1.1 - debug: 4.3.5 - transitivePeerDependencies: - - supports-color - - '@napi-rs/lzma-android-arm-eabi@1.3.1': - optional: true - - '@napi-rs/lzma-android-arm64@1.3.1': - optional: true - - '@napi-rs/lzma-darwin-arm64@1.3.1': - optional: true - - '@napi-rs/lzma-darwin-x64@1.3.1': - optional: true - - '@napi-rs/lzma-freebsd-x64@1.3.1': - optional: true - - '@napi-rs/lzma-linux-arm-gnueabihf@1.3.1': - optional: true - - '@napi-rs/lzma-linux-arm64-gnu@1.3.1': - optional: true - - '@napi-rs/lzma-linux-arm64-musl@1.3.1': - optional: true - - '@napi-rs/lzma-linux-x64-gnu@1.3.1': - optional: true - - '@napi-rs/lzma-linux-x64-musl@1.3.1': - optional: true - - '@napi-rs/lzma-wasm32-wasi@1.3.1': - dependencies: - '@napi-rs/wasm-runtime': 0.2.4 - optional: true - - '@napi-rs/lzma-win32-arm64-msvc@1.3.1': - optional: true - - '@napi-rs/lzma-win32-ia32-msvc@1.3.1': - optional: true - - '@napi-rs/lzma-win32-x64-msvc@1.3.1': - optional: true - - '@napi-rs/lzma@1.3.1': - optionalDependencies: - '@napi-rs/lzma-android-arm-eabi': 1.3.1 - '@napi-rs/lzma-android-arm64': 1.3.1 - '@napi-rs/lzma-darwin-arm64': 1.3.1 - '@napi-rs/lzma-darwin-x64': 1.3.1 - '@napi-rs/lzma-freebsd-x64': 1.3.1 - '@napi-rs/lzma-linux-arm-gnueabihf': 1.3.1 - '@napi-rs/lzma-linux-arm64-gnu': 1.3.1 - '@napi-rs/lzma-linux-arm64-musl': 1.3.1 - '@napi-rs/lzma-linux-x64-gnu': 1.3.1 - '@napi-rs/lzma-linux-x64-musl': 1.3.1 - '@napi-rs/lzma-wasm32-wasi': 1.3.1 - '@napi-rs/lzma-win32-arm64-msvc': 1.3.1 - '@napi-rs/lzma-win32-ia32-msvc': 1.3.1 - '@napi-rs/lzma-win32-x64-msvc': 1.3.1 - - '@napi-rs/tar-android-arm-eabi@0.1.1': - optional: true - - '@napi-rs/tar-android-arm64@0.1.1': - optional: true - - '@napi-rs/tar-darwin-arm64@0.1.1': - optional: true - - '@napi-rs/tar-darwin-x64@0.1.1': - optional: true - - '@napi-rs/tar-freebsd-x64@0.1.1': - optional: true - - '@napi-rs/tar-linux-arm-gnueabihf@0.1.1': - optional: true - - '@napi-rs/tar-linux-arm64-gnu@0.1.1': - optional: true - - '@napi-rs/tar-linux-arm64-musl@0.1.1': - optional: true - - '@napi-rs/tar-linux-x64-gnu@0.1.1': - optional: true - - '@napi-rs/tar-linux-x64-musl@0.1.1': - optional: true - - '@napi-rs/tar-wasm32-wasi@0.1.1': - dependencies: - '@napi-rs/wasm-runtime': 0.2.4 - optional: true - - '@napi-rs/tar-win32-arm64-msvc@0.1.1': - optional: true - - '@napi-rs/tar-win32-ia32-msvc@0.1.1': - optional: true - - '@napi-rs/tar-win32-x64-msvc@0.1.1': - optional: true - - '@napi-rs/tar@0.1.1': - optionalDependencies: - '@napi-rs/tar-android-arm-eabi': 0.1.1 - '@napi-rs/tar-android-arm64': 0.1.1 - '@napi-rs/tar-darwin-arm64': 0.1.1 - '@napi-rs/tar-darwin-x64': 0.1.1 - '@napi-rs/tar-freebsd-x64': 0.1.1 - '@napi-rs/tar-linux-arm-gnueabihf': 0.1.1 - '@napi-rs/tar-linux-arm64-gnu': 0.1.1 - '@napi-rs/tar-linux-arm64-musl': 0.1.1 - '@napi-rs/tar-linux-x64-gnu': 0.1.1 - '@napi-rs/tar-linux-x64-musl': 0.1.1 - '@napi-rs/tar-wasm32-wasi': 0.1.1 - '@napi-rs/tar-win32-arm64-msvc': 0.1.1 - '@napi-rs/tar-win32-ia32-msvc': 0.1.1 - '@napi-rs/tar-win32-x64-msvc': 0.1.1 - - '@napi-rs/wasm-runtime@0.2.4': - dependencies: - '@emnapi/core': 1.2.0 - '@emnapi/runtime': 1.2.0 - '@tybys/wasm-util': 0.9.0 - - '@napi-rs/wasm-tools-android-arm-eabi@0.0.2': - optional: true - - '@napi-rs/wasm-tools-android-arm64@0.0.2': - optional: true - - '@napi-rs/wasm-tools-darwin-arm64@0.0.2': - optional: true - - '@napi-rs/wasm-tools-darwin-x64@0.0.2': - optional: true - - '@napi-rs/wasm-tools-freebsd-x64@0.0.2': - optional: true - - '@napi-rs/wasm-tools-linux-arm64-gnu@0.0.2': - optional: true - - '@napi-rs/wasm-tools-linux-arm64-musl@0.0.2': - optional: true - - '@napi-rs/wasm-tools-linux-x64-gnu@0.0.2': - optional: true - - '@napi-rs/wasm-tools-linux-x64-musl@0.0.2': - optional: true - - '@napi-rs/wasm-tools-wasm32-wasi@0.0.2': - dependencies: - '@napi-rs/wasm-runtime': 0.2.4 - optional: true - - '@napi-rs/wasm-tools-win32-arm64-msvc@0.0.2': - optional: true - - '@napi-rs/wasm-tools-win32-ia32-msvc@0.0.2': - optional: true - - '@napi-rs/wasm-tools-win32-x64-msvc@0.0.2': - optional: true - - '@napi-rs/wasm-tools@0.0.2': - optionalDependencies: - '@napi-rs/wasm-tools-android-arm-eabi': 0.0.2 - '@napi-rs/wasm-tools-android-arm64': 0.0.2 - '@napi-rs/wasm-tools-darwin-arm64': 0.0.2 - '@napi-rs/wasm-tools-darwin-x64': 0.0.2 - '@napi-rs/wasm-tools-freebsd-x64': 0.0.2 - '@napi-rs/wasm-tools-linux-arm64-gnu': 0.0.2 - '@napi-rs/wasm-tools-linux-arm64-musl': 0.0.2 - '@napi-rs/wasm-tools-linux-x64-gnu': 0.0.2 - '@napi-rs/wasm-tools-linux-x64-musl': 0.0.2 - '@napi-rs/wasm-tools-wasm32-wasi': 0.0.2 - '@napi-rs/wasm-tools-win32-arm64-msvc': 0.0.2 - '@napi-rs/wasm-tools-win32-ia32-msvc': 0.0.2 - '@napi-rs/wasm-tools-win32-x64-msvc': 0.0.2 - - '@nodelib/fs.scandir@2.1.5': - dependencies: - '@nodelib/fs.stat': 2.0.5 - run-parallel: 1.2.0 - - '@nodelib/fs.stat@2.0.5': {} - - '@nodelib/fs.walk@1.2.8': - dependencies: - '@nodelib/fs.scandir': 2.1.5 - fastq: 1.17.1 - - '@octokit/auth-token@5.1.1': {} - - '@octokit/core@6.1.2': - dependencies: - '@octokit/auth-token': 5.1.1 - '@octokit/graphql': 8.1.1 - '@octokit/request': 9.1.1 - '@octokit/request-error': 6.1.2 - '@octokit/types': 13.5.0 - before-after-hook: 3.0.2 - universal-user-agent: 7.0.2 - - '@octokit/endpoint@10.1.1': - dependencies: - '@octokit/types': 13.5.0 - universal-user-agent: 7.0.2 - - '@octokit/graphql@8.1.1': - dependencies: - '@octokit/request': 9.1.1 - '@octokit/types': 13.5.0 - universal-user-agent: 7.0.2 - - '@octokit/openapi-types@22.2.0': {} - - '@octokit/plugin-paginate-rest@11.3.3(@octokit/core@6.1.2)': - dependencies: - '@octokit/core': 6.1.2 - '@octokit/types': 13.5.0 - - '@octokit/plugin-request-log@5.3.0(@octokit/core@6.1.2)': - dependencies: - '@octokit/core': 6.1.2 - - '@octokit/plugin-rest-endpoint-methods@13.2.4(@octokit/core@6.1.2)': - dependencies: - '@octokit/core': 6.1.2 - '@octokit/types': 13.5.0 - - '@octokit/request-error@6.1.2': - dependencies: - '@octokit/types': 13.5.0 - - '@octokit/request@9.1.1': - dependencies: - '@octokit/endpoint': 10.1.1 - '@octokit/request-error': 6.1.2 - '@octokit/types': 13.5.0 - universal-user-agent: 7.0.2 - - '@octokit/rest@21.0.0': - dependencies: - '@octokit/core': 6.1.2 - '@octokit/plugin-paginate-rest': 11.3.3(@octokit/core@6.1.2) - '@octokit/plugin-request-log': 5.3.0(@octokit/core@6.1.2) - '@octokit/plugin-rest-endpoint-methods': 13.2.4(@octokit/core@6.1.2) - - '@octokit/types@13.5.0': - dependencies: - '@octokit/openapi-types': 22.2.0 - - '@rollup/pluginutils@4.2.1': - dependencies: - estree-walker: 2.0.2 - picomatch: 2.3.1 - - '@sindresorhus/merge-streams@2.3.0': {} - - '@tybys/wasm-util@0.9.0': - dependencies: - tslib: 2.6.3 - - '@types/mute-stream@0.0.4': - dependencies: - '@types/node': 22.5.4 - - '@types/node@20.16.5': - dependencies: - undici-types: 6.19.8 - - '@types/node@22.5.4': - dependencies: - undici-types: 6.19.8 - - '@types/stylis@4.2.6': {} - - '@types/wrap-ansi@3.0.0': {} - - '@vercel/nft@0.26.5': - dependencies: - '@mapbox/node-pre-gyp': 1.0.11 - '@rollup/pluginutils': 4.2.1 - acorn: 8.12.1 - acorn-import-attributes: 1.9.5(acorn@8.12.1) - async-sema: 3.1.1 - bindings: 1.5.0 - estree-walker: 2.0.2 - glob: 7.2.3 - graceful-fs: 4.2.11 - micromatch: 4.0.7 - node-gyp-build: 4.8.1 - resolve-from: 5.0.0 - transitivePeerDependencies: - - encoding - - supports-color - - abbrev@1.1.1: {} - - acorn-import-attributes@1.9.5(acorn@8.12.1): - dependencies: - acorn: 8.12.1 - - acorn-walk@8.3.3: - dependencies: - acorn: 8.12.1 - - acorn@8.12.1: {} - - agent-base@6.0.2: - dependencies: - debug: 4.3.5 - transitivePeerDependencies: - - supports-color - - ansi-escapes@4.3.2: - dependencies: - type-fest: 0.21.3 - - ansi-regex@5.0.1: {} - - ansi-regex@6.0.1: {} - - ansi-styles@4.3.0: - dependencies: - color-convert: 2.0.1 - - ansi-styles@6.2.1: {} - - aproba@2.0.0: {} - - are-we-there-yet@2.0.0: - dependencies: - delegates: 1.0.0 - readable-stream: 3.6.2 - - argparse@1.0.10: - dependencies: - sprintf-js: 1.0.3 - - argparse@2.0.1: {} - - array-find-index@1.0.2: {} - - arrgv@1.0.2: {} - - arrify@3.0.0: {} - - async-sema@3.1.1: {} - - asynckit@0.4.0: {} - - ava@6.1.3: - dependencies: - '@vercel/nft': 0.26.5 - acorn: 8.12.1 - acorn-walk: 8.3.3 - ansi-styles: 6.2.1 - arrgv: 1.0.2 - arrify: 3.0.0 - callsites: 4.2.0 - cbor: 9.0.2 - chalk: 5.3.0 - chunkd: 2.0.1 - ci-info: 4.0.0 - ci-parallel-vars: 1.0.1 - cli-truncate: 4.0.0 - code-excerpt: 4.0.0 - common-path-prefix: 3.0.0 - concordance: 5.0.4 - currently-unhandled: 0.4.1 - debug: 4.3.5 - emittery: 1.0.3 - figures: 6.1.0 - globby: 14.0.2 - ignore-by-default: 2.1.0 - indent-string: 5.0.0 - is-plain-object: 5.0.0 - is-promise: 4.0.0 - matcher: 5.0.0 - memoize: 10.0.0 - ms: 2.1.3 - p-map: 7.0.2 - package-config: 5.0.0 - picomatch: 3.0.1 - plur: 5.1.0 - pretty-ms: 9.0.0 - resolve-cwd: 3.0.0 - stack-utils: 2.0.6 - strip-ansi: 7.1.0 - supertap: 3.0.1 - temp-dir: 3.0.0 - write-file-atomic: 5.0.1 - yargs: 17.7.2 - transitivePeerDependencies: - - encoding - - supports-color - - axios@1.6.2: - dependencies: - follow-redirects: 1.15.6 - form-data: 4.0.0 - proxy-from-env: 1.1.0 - transitivePeerDependencies: - - debug - - balanced-match@1.0.2: {} - - before-after-hook@3.0.2: {} - - bindings@1.5.0: - dependencies: - file-uri-to-path: 1.0.0 - - blueimp-md5@2.19.0: {} - - brace-expansion@1.1.11: - dependencies: - balanced-match: 1.0.2 - concat-map: 0.0.1 - - braces@3.0.3: - dependencies: - fill-range: 7.1.1 - - callsites@4.2.0: {} - - camelize@1.0.1: {} - - cbor@9.0.2: - dependencies: - nofilter: 3.1.0 - - chalk@5.3.0: {} - - chardet@0.7.0: {} - - chownr@2.0.0: {} - - chunkd@2.0.1: {} - - ci-info@4.0.0: {} - - ci-parallel-vars@1.0.1: {} - - cli-spinners@2.9.2: {} - - cli-truncate@4.0.0: - dependencies: - slice-ansi: 5.0.0 - string-width: 7.2.0 - - cli-width@4.1.0: {} - - clipanion@3.2.1(typanion@3.14.0): - dependencies: - typanion: 3.14.0 - - cliui@8.0.1: - dependencies: - string-width: 4.2.3 - strip-ansi: 6.0.1 - wrap-ansi: 7.0.0 - - code-excerpt@4.0.0: - dependencies: - convert-to-spaces: 2.0.1 - - color-convert@2.0.1: - dependencies: - color-name: 1.1.4 - - color-name@1.1.4: {} - - color-support@1.1.3: {} - - colorette@2.0.20: {} - - combined-stream@1.0.8: - dependencies: - delayed-stream: 1.0.0 - - common-path-prefix@3.0.0: {} - - concat-map@0.0.1: {} - - concordance@5.0.4: - dependencies: - date-time: 3.1.0 - esutils: 2.0.3 - fast-diff: 1.3.0 - js-string-escape: 1.0.1 - lodash: 4.17.21 - md5-hex: 3.0.1 - semver: 7.6.2 - well-known-symbols: 2.0.0 - - console-control-strings@1.1.0: {} - - convert-to-spaces@2.0.1: {} - - css-color-keywords@1.0.0: {} - - css-to-react-native@3.2.0: - dependencies: - camelize: 1.0.1 - css-color-keywords: 1.0.0 - postcss-value-parser: 4.2.0 - - csstype@3.1.3: {} - - currently-unhandled@0.4.1: - dependencies: - array-find-index: 1.0.2 - - date-time@3.1.0: - dependencies: - time-zone: 1.0.0 - - debug@4.3.5: - dependencies: - ms: 2.1.2 - - delayed-stream@1.0.0: {} - - delegates@1.0.0: {} - - detect-libc@2.0.3: {} - - emittery@1.0.3: {} - - emnapi@1.2.0: {} - - emoji-regex@10.3.0: {} - - emoji-regex@8.0.0: {} - - escalade@3.1.2: {} - - escape-string-regexp@2.0.0: {} - - escape-string-regexp@5.0.0: {} - - esprima@4.0.1: {} - - estree-walker@2.0.2: {} - - esutils@2.0.3: {} - - external-editor@3.1.0: - dependencies: - chardet: 0.7.0 - iconv-lite: 0.4.24 - tmp: 0.0.33 - - fast-diff@1.3.0: {} - - fast-glob@3.3.2: - dependencies: - '@nodelib/fs.stat': 2.0.5 - '@nodelib/fs.walk': 1.2.8 - glob-parent: 5.1.2 - merge2: 1.4.1 - micromatch: 4.0.7 - - fastq@1.17.1: - dependencies: - reusify: 1.0.4 - - figures@6.1.0: - dependencies: - is-unicode-supported: 2.0.0 - - file-uri-to-path@1.0.0: {} - - fill-range@7.1.1: - dependencies: - to-regex-range: 5.0.1 - - find-up-simple@1.0.0: {} - - follow-redirects@1.15.6: {} - - form-data@4.0.0: - dependencies: - asynckit: 0.4.0 - combined-stream: 1.0.8 - mime-types: 2.1.35 - - fs-minipass@2.1.0: - dependencies: - minipass: 3.3.6 - - fs.realpath@1.0.0: {} - - gauge@3.0.2: - dependencies: - aproba: 2.0.0 - color-support: 1.1.3 - console-control-strings: 1.1.0 - has-unicode: 2.0.1 - object-assign: 4.1.1 - signal-exit: 3.0.7 - string-width: 4.2.3 - strip-ansi: 6.0.1 - wide-align: 1.1.5 - - get-caller-file@2.0.5: {} - - get-east-asian-width@1.2.0: {} - - glob-parent@5.1.2: - dependencies: - is-glob: 4.0.3 - - glob@7.2.3: - dependencies: - fs.realpath: 1.0.0 - inflight: 1.0.6 - inherits: 2.0.4 - minimatch: 3.1.2 - once: 1.4.0 - path-is-absolute: 1.0.1 - - globby@14.0.2: - dependencies: - '@sindresorhus/merge-streams': 2.3.0 - fast-glob: 3.3.2 - ignore: 5.3.1 - path-type: 5.0.0 - slash: 5.1.0 - unicorn-magic: 0.1.0 - - graceful-fs@4.2.11: {} - - has-unicode@2.0.1: {} - - https-proxy-agent@5.0.1: - dependencies: - agent-base: 6.0.2 - debug: 4.3.5 - transitivePeerDependencies: - - supports-color - - iconv-lite@0.4.24: - dependencies: - safer-buffer: 2.1.2 - - ignore-by-default@2.1.0: {} - - ignore@5.3.1: {} - - imurmurhash@0.1.4: {} - - indent-string@5.0.0: {} - - inflight@1.0.6: - dependencies: - once: 1.4.0 - wrappy: 1.0.2 - - inherits@2.0.4: {} - - inquirer@10.0.1: - dependencies: - '@inquirer/prompts': 5.1.2 - '@inquirer/type': 1.4.0 - '@types/mute-stream': 0.0.4 - ansi-escapes: 4.3.2 - mute-stream: 1.0.0 - run-async: 3.0.0 - rxjs: 7.8.1 - - ipaddr.js@2.2.0: {} - - irregular-plurals@3.5.0: {} - - is-extglob@2.1.1: {} - - is-fullwidth-code-point@3.0.0: {} - - is-fullwidth-code-point@4.0.0: {} - - is-glob@4.0.3: - dependencies: - is-extglob: 2.1.1 - - is-number@7.0.0: {} - - is-plain-object@5.0.0: {} - - is-promise@4.0.0: {} - - is-unicode-supported@2.0.0: {} - - js-string-escape@1.0.1: {} - - js-tokens@4.0.0: {} - - js-yaml@3.14.1: - dependencies: - argparse: 1.0.10 - esprima: 4.0.1 - - js-yaml@4.1.0: - dependencies: - argparse: 2.0.1 - - load-json-file@7.0.1: {} - - lodash-es@4.17.21: {} - - lodash@4.17.21: {} - - loose-envify@1.4.0: - dependencies: - js-tokens: 4.0.0 - - make-dir@3.1.0: - dependencies: - semver: 6.3.1 - - matcher@5.0.0: - dependencies: - escape-string-regexp: 5.0.0 - - md5-hex@3.0.1: - dependencies: - blueimp-md5: 2.19.0 - - memoize@10.0.0: - dependencies: - mimic-function: 5.0.1 - - merge2@1.4.1: {} - - micromatch@4.0.7: - dependencies: - braces: 3.0.3 - picomatch: 2.3.1 - - mime-db@1.52.0: {} - - mime-types@2.1.35: - dependencies: - mime-db: 1.52.0 - - mimic-function@5.0.1: {} - - minimatch@3.1.2: - dependencies: - brace-expansion: 1.1.11 - - minipass@3.3.6: - dependencies: - yallist: 4.0.0 - - minipass@5.0.0: {} - - minizlib@2.1.2: - dependencies: - minipass: 3.3.6 - yallist: 4.0.0 - - mkdirp@1.0.4: {} - - ms@2.1.2: {} - - ms@2.1.3: {} - - mute-stream@1.0.0: {} - - nanoid@3.3.7: {} - - node-fetch@2.7.0: - dependencies: - whatwg-url: 5.0.0 - - node-gyp-build@4.8.1: {} - - nofilter@3.1.0: {} - - nopt@5.0.0: - dependencies: - abbrev: 1.1.1 - - npmlog@5.0.1: - dependencies: - are-we-there-yet: 2.0.0 - console-control-strings: 1.1.0 - gauge: 3.0.2 - set-blocking: 2.0.0 - - object-assign@4.1.1: {} - - once@1.4.0: - dependencies: - wrappy: 1.0.2 - - os-tmpdir@1.0.2: {} - - p-map@7.0.2: {} - - package-config@5.0.0: - dependencies: - find-up-simple: 1.0.0 - load-json-file: 7.0.1 - - parse-ms@4.0.0: {} - - path-is-absolute@1.0.1: {} - - path-type@5.0.0: {} - - picocolors@1.0.1: {} - - picomatch@2.3.1: {} - - picomatch@3.0.1: {} - - plur@5.1.0: - dependencies: - irregular-plurals: 3.5.0 - - postcss-value-parser@4.2.0: {} - - postcss@8.4.33: - dependencies: - nanoid: 3.3.7 - picocolors: 1.0.1 - source-map-js: 1.2.0 - - pretty-ms@9.0.0: - dependencies: - parse-ms: 4.0.0 - - proxy-from-env@1.1.0: {} - - queue-microtask@1.2.3: {} - - react-dom@18.3.1(react@18.3.1): - dependencies: - loose-envify: 1.4.0 - react: 18.3.1 - scheduler: 0.23.2 - - react@18.3.1: - dependencies: - loose-envify: 1.4.0 - - readable-stream@3.6.2: - dependencies: - inherits: 2.0.4 - string_decoder: 1.3.0 - util-deprecate: 1.0.2 - - require-directory@2.1.1: {} - - resolve-cwd@3.0.0: - dependencies: - resolve-from: 5.0.0 - - resolve-from@5.0.0: {} - - reusify@1.0.4: {} - - rimraf@3.0.2: - dependencies: - glob: 7.2.3 - - run-async@3.0.0: {} - - run-parallel@1.2.0: - dependencies: - queue-microtask: 1.2.3 - - rxjs@7.8.1: - dependencies: - tslib: 2.6.3 - - safe-buffer@5.2.1: {} - - safer-buffer@2.1.2: {} - - scheduler@0.23.2: - dependencies: - loose-envify: 1.4.0 - - semver@6.3.1: {} - - semver@7.6.2: {} - - serialize-error@7.0.1: - dependencies: - type-fest: 0.13.1 - - set-blocking@2.0.0: {} - - shallowequal@1.1.0: {} - - signal-exit@3.0.7: {} - - signal-exit@4.1.0: {} - - slash@5.1.0: {} - - slice-ansi@5.0.0: - dependencies: - ansi-styles: 6.2.1 - is-fullwidth-code-point: 4.0.0 - - source-map-js@1.2.0: {} - - sprintf-js@1.0.3: {} - - stack-utils@2.0.6: - dependencies: - escape-string-regexp: 2.0.0 - - string-width@4.2.3: - dependencies: - emoji-regex: 8.0.0 - is-fullwidth-code-point: 3.0.0 - strip-ansi: 6.0.1 - - string-width@7.2.0: - dependencies: - emoji-regex: 10.3.0 - get-east-asian-width: 1.2.0 - strip-ansi: 7.1.0 - - string_decoder@1.3.0: - dependencies: - safe-buffer: 5.2.1 - - strip-ansi@6.0.1: - dependencies: - ansi-regex: 5.0.1 - - strip-ansi@7.1.0: - dependencies: - ansi-regex: 6.0.1 - - styled-components@6.1.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1): - dependencies: - '@emotion/is-prop-valid': 1.2.2 - '@emotion/unitless': 0.8.1 - '@types/stylis': 4.2.6 - css-to-react-native: 3.2.0 - csstype: 3.1.3 - postcss: 8.4.33 - react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) - shallowequal: 1.1.0 - stylis: 4.3.2 - tslib: 2.6.3 - - stylis@4.3.2: {} - - supertap@3.0.1: - dependencies: - indent-string: 5.0.0 - js-yaml: 3.14.1 - serialize-error: 7.0.1 - strip-ansi: 7.1.0 - - tar@6.2.1: - dependencies: - chownr: 2.0.0 - fs-minipass: 2.1.0 - minipass: 5.0.0 - minizlib: 2.1.2 - mkdirp: 1.0.4 - yallist: 4.0.0 - - temp-dir@3.0.0: {} - - time-zone@1.0.0: {} - - tmp@0.0.33: - dependencies: - os-tmpdir: 1.0.2 - - to-regex-range@5.0.1: - dependencies: - is-number: 7.0.0 - - toml@3.0.0: {} - - tr46@0.0.3: {} - - tslib@2.6.3: {} - - typanion@3.14.0: {} - - type-fest@0.13.1: {} - - type-fest@0.21.3: {} - - typescript@5.5.4: {} - - undici-types@6.19.8: {} - - unicorn-magic@0.1.0: {} - - universal-user-agent@7.0.2: {} - - util-deprecate@1.0.2: {} - - wasm-sjlj@1.0.5: {} - - webidl-conversions@3.0.1: {} - - well-known-symbols@2.0.0: {} - - whatwg-url@5.0.0: - dependencies: - tr46: 0.0.3 - webidl-conversions: 3.0.1 - - wide-align@1.1.5: - dependencies: - string-width: 4.2.3 - - wrap-ansi@6.2.0: - dependencies: - ansi-styles: 4.3.0 - string-width: 4.2.3 - strip-ansi: 6.0.1 - - wrap-ansi@7.0.0: - dependencies: - ansi-styles: 4.3.0 - string-width: 4.2.3 - strip-ansi: 6.0.1 - - wrappy@1.0.2: {} - - write-file-atomic@5.0.1: - dependencies: - imurmurhash: 0.1.4 - signal-exit: 4.1.0 - - y18n@5.0.8: {} - - yallist@4.0.0: {} - - yargs-parser@21.1.1: {} - - yargs@17.7.2: - dependencies: - cliui: 8.0.1 - escalade: 3.1.2 - get-caller-file: 2.0.5 - require-directory: 2.1.1 - string-width: 4.2.3 - y18n: 5.0.8 - yargs-parser: 21.1.1 - - yoctocolors-cjs@2.1.2: {} diff --git a/src/builtins.rs b/src/builtins.rs deleted file mode 100644 index 45a25117..00000000 --- a/src/builtins.rs +++ /dev/null @@ -1,71 +0,0 @@ -/// Node.js built-in modules -/// -/// `node -p "[...require('module').builtinModules].map(b => JSON.stringify(b)).join(',\n')"` -/// -pub const NODEJS_BUILTINS: &[&str] = &[ - "_http_agent", - "_http_client", - "_http_common", - "_http_incoming", - "_http_outgoing", - "_http_server", - "_stream_duplex", - "_stream_passthrough", - "_stream_readable", - "_stream_transform", - "_stream_wrap", - "_stream_writable", - "_tls_common", - "_tls_wrap", - "assert", - "assert/strict", - "async_hooks", - "buffer", - "child_process", - "cluster", - "console", - "constants", - "crypto", - "dgram", - "diagnostics_channel", - "dns", - "dns/promises", - "domain", - "events", - "fs", - "fs/promises", - "http", - "http2", - "https", - "inspector", - "module", - "net", - "os", - "path", - "path/posix", - "path/win32", - "perf_hooks", - "process", - "punycode", - "querystring", - "readline", - "repl", - "stream", - "stream/consumers", - "stream/promises", - "stream/web", - "string_decoder", - "sys", - "timers", - "timers/promises", - "tls", - "trace_events", - "tty", - "url", - "util", - "util/types", - "v8", - "vm", - "worker_threads", - "zlib", -]; diff --git a/src/cache.rs b/src/cache.rs deleted file mode 100644 index 6e600664..00000000 --- a/src/cache.rs +++ /dev/null @@ -1,354 +0,0 @@ -use once_cell::sync::OnceCell as OnceLock; -use std::{ - borrow::{Borrow, Cow}, - convert::AsRef, - hash::{BuildHasherDefault, Hash, Hasher}, - io, - ops::Deref, - path::{Path, PathBuf}, - sync::Arc, -}; - -use dashmap::{DashMap, DashSet}; -use rustc_hash::FxHasher; - -use crate::{ - context::ResolveContext as Ctx, package_json::PackageJson, path::PathUtil, FileMetadata, - FileSystem, ResolveError, ResolveOptions, TsConfig, -}; - -#[derive(Default)] -pub struct Cache { - pub(crate) fs: Fs, - paths: DashSet>, - tsconfigs: DashMap, BuildHasherDefault>, -} - -impl Cache { - pub fn new(fs: Fs) -> Self { - Self { fs, paths: DashSet::default(), tsconfigs: DashMap::default() } - } - - pub fn clear(&self) { - self.paths.clear(); - self.tsconfigs.clear(); - } - - pub fn value(&self, path: &Path) -> CachedPath { - let hash = { - let mut hasher = FxHasher::default(); - path.hash(&mut hasher); - hasher.finish() - }; - if let Some(cache_entry) = self.paths.get((hash, path).borrow() as &dyn CacheKey) { - return cache_entry.clone(); - } - let parent = path.parent().map(|p| self.value(p)); - let data = CachedPath(Arc::new(CachedPathImpl::new( - hash, - path.to_path_buf().into_boxed_path(), - parent, - ))); - self.paths.insert(data.clone()); - data - } - - pub fn tsconfig Result<(), ResolveError>>( - &self, - root: bool, - path: &Path, - callback: F, // callback for modifying tsconfig with `extends` - ) -> Result, ResolveError> { - if let Some(tsconfig_ref) = self.tsconfigs.get(path) { - return Ok(Arc::clone(tsconfig_ref.value())); - } - let meta = self.fs.metadata(path).ok(); - let tsconfig_path = if meta.is_some_and(|m| m.is_file) { - Cow::Borrowed(path) - } else if meta.is_some_and(|m| m.is_dir) { - Cow::Owned(path.join("tsconfig.json")) - } else { - let mut os_string = path.to_path_buf().into_os_string(); - os_string.push(".json"); - Cow::Owned(PathBuf::from(os_string)) - }; - let mut tsconfig_string = self - .fs - .read_to_string(&tsconfig_path) - .map_err(|_| ResolveError::TsconfigNotFound(path.to_path_buf()))?; - let mut tsconfig = - TsConfig::parse(root, &tsconfig_path, &mut tsconfig_string).map_err(|error| { - ResolveError::from_serde_json_error(tsconfig_path.to_path_buf(), &error) - })?; - callback(&mut tsconfig)?; - let tsconfig = Arc::new(tsconfig.build()); - self.tsconfigs.insert(path.to_path_buf(), Arc::clone(&tsconfig)); - Ok(tsconfig) - } -} - -#[derive(Clone)] -pub struct CachedPath(Arc); - -impl Hash for CachedPath { - fn hash(&self, state: &mut H) { - self.0.hash.hash(state); - } -} - -impl PartialEq for CachedPath { - fn eq(&self, other: &Self) -> bool { - self.0.path == other.0.path - } -} -impl Eq for CachedPath {} - -impl Deref for CachedPath { - type Target = CachedPathImpl; - - fn deref(&self) -> &Self::Target { - self.0.as_ref() - } -} - -impl<'a> Borrow for CachedPath { - fn borrow(&self) -> &(dyn CacheKey + 'a) { - self - } -} - -impl AsRef for CachedPath { - fn as_ref(&self) -> &CachedPathImpl { - self.0.as_ref() - } -} - -impl CacheKey for CachedPath { - fn tuple(&self) -> (u64, &Path) { - (self.hash, &self.path) - } -} - -pub struct CachedPathImpl { - hash: u64, - path: Box, - parent: Option, - meta: OnceLock>, - canonicalized: OnceLock>, - node_modules: OnceLock>, - package_json: OnceLock>>, -} - -impl CachedPathImpl { - fn new(hash: u64, path: Box, parent: Option) -> Self { - Self { - hash, - path, - parent, - meta: OnceLock::new(), - canonicalized: OnceLock::new(), - node_modules: OnceLock::new(), - package_json: OnceLock::new(), - } - } - - pub fn path(&self) -> &Path { - &self.path - } - - pub fn to_path_buf(&self) -> PathBuf { - self.path.to_path_buf() - } - - pub fn parent(&self) -> Option<&CachedPath> { - self.parent.as_ref() - } - - fn meta(&self, fs: &Fs) -> Option { - *self.meta.get_or_init(|| fs.metadata(&self.path).ok()) - } - - pub fn is_file(&self, fs: &Fs, ctx: &mut Ctx) -> bool { - if let Some(meta) = self.meta(fs) { - ctx.add_file_dependency(self.path()); - meta.is_file - } else { - ctx.add_missing_dependency(self.path()); - false - } - } - - pub fn is_dir(&self, fs: &Fs, ctx: &mut Ctx) -> bool { - self.meta(fs).map_or_else( - || { - ctx.add_missing_dependency(self.path()); - false - }, - |meta| meta.is_dir, - ) - } - - pub fn realpath(&self, fs: &Fs) -> io::Result { - self.canonicalized - .get_or_try_init(|| { - if fs.symlink_metadata(&self.path).is_ok_and(|m| m.is_symlink) { - return fs.canonicalize(&self.path).map(Some); - } - if let Some(parent) = self.parent() { - let parent_path = parent.realpath(fs)?; - return Ok(Some( - parent_path.normalize_with(self.path.strip_prefix(&parent.path).unwrap()), - )); - }; - Ok(None) - }) - .cloned() - .map(|r| r.unwrap_or_else(|| self.path.clone().to_path_buf())) - } - - pub fn module_directory( - &self, - module_name: &str, - cache: &Cache, - ctx: &mut Ctx, - ) -> Option { - let cached_path = cache.value(&self.path.join(module_name)); - cached_path.is_dir(&cache.fs, ctx).then_some(cached_path) - } - - pub fn cached_node_modules( - &self, - cache: &Cache, - ctx: &mut Ctx, - ) -> Option { - self.node_modules.get_or_init(|| self.module_directory("node_modules", cache, ctx)).clone() - } - - /// Find package.json of a path by traversing parent directories. - /// - /// # Errors - /// - /// * [ResolveError::JSON] - pub fn find_package_json( - &self, - fs: &Fs, - options: &ResolveOptions, - ctx: &mut Ctx, - ) -> Result>, ResolveError> { - let mut cache_value = self; - // Go up directories when the querying path is not a directory - while !cache_value.is_dir(fs, ctx) { - if let Some(cv) = &cache_value.parent { - cache_value = cv.as_ref(); - } else { - break; - } - } - let mut cache_value = Some(cache_value); - while let Some(cv) = cache_value { - if let Some(package_json) = cv.package_json(fs, options, ctx)? { - return Ok(Some(Arc::clone(&package_json))); - } - cache_value = cv.parent.as_deref(); - } - Ok(None) - } - - /// Get package.json of the given path. - /// - /// # Errors - /// - /// * [ResolveError::JSON] - pub fn package_json( - &self, - fs: &Fs, - options: &ResolveOptions, - ctx: &mut Ctx, - ) -> Result>, ResolveError> { - // Change to `std::sync::OnceLock::get_or_try_init` when it is stable. - let result = self - .package_json - .get_or_try_init(|| { - let package_json_path = self.path.join("package.json"); - let Ok(package_json_string) = fs.read_to_string(&package_json_path) else { - return Ok(None); - }; - let real_path = if options.symlinks { - self.realpath(fs)?.join("package.json") - } else { - package_json_path.clone() - }; - PackageJson::parse(package_json_path.clone(), real_path, &package_json_string) - .map(Arc::new) - .map(Some) - .map_err(|error| ResolveError::from_serde_json_error(package_json_path, &error)) - }) - .cloned(); - // https://github.com/webpack/enhanced-resolve/blob/58464fc7cb56673c9aa849e68e6300239601e615/lib/DescriptionFileUtils.js#L68-L82 - match &result { - Ok(Some(package_json)) => { - ctx.add_file_dependency(&package_json.path); - } - Ok(None) => { - // Avoid an allocation by making this lazy - if let Some(deps) = &mut ctx.missing_dependencies { - deps.push(self.path.join("package.json")); - } - } - Err(_) => { - if let Some(deps) = &mut ctx.file_dependencies { - deps.push(self.path.join("package.json")); - } - } - } - result - } -} - -/// Memoized cache key, code adapted from . -trait CacheKey { - fn tuple(&self) -> (u64, &Path); -} - -impl Hash for dyn CacheKey + '_ { - fn hash(&self, state: &mut H) { - self.tuple().0.hash(state); - } -} - -impl PartialEq for dyn CacheKey + '_ { - fn eq(&self, other: &Self) -> bool { - self.tuple().1 == other.tuple().1 - } -} - -impl Eq for dyn CacheKey + '_ {} - -impl<'a> CacheKey for (u64, &'a Path) { - fn tuple(&self) -> (u64, &Path) { - (self.0, self.1) - } -} - -impl<'a> Borrow for (u64, &'a Path) { - fn borrow(&self) -> &(dyn CacheKey + 'a) { - self - } -} - -/// Since the cache key is memoized, use an identity hasher -/// to avoid double cache. -#[derive(Default)] -struct IdentityHasher(u64); - -impl Hasher for IdentityHasher { - fn write(&mut self, _: &[u8]) { - unreachable!("Invalid use of IdentityHasher") - } - fn write_u64(&mut self, n: u64) { - self.0 = n; - } - fn finish(&self) -> u64 { - self.0 - } -} diff --git a/src/context.rs b/src/context.rs deleted file mode 100644 index 9349de30..00000000 --- a/src/context.rs +++ /dev/null @@ -1,89 +0,0 @@ -use std::{ - ops::{Deref, DerefMut}, - path::{Path, PathBuf}, -}; - -use crate::error::ResolveError; - -#[derive(Debug, Default, Clone)] -pub struct ResolveContext(ResolveContextImpl); - -#[derive(Debug, Default, Clone)] -pub struct ResolveContextImpl { - pub fully_specified: bool, - - pub query: Option, - - pub fragment: Option, - - /// Files that was found on file system - pub file_dependencies: Option>, - - /// Files that was found on file system - pub missing_dependencies: Option>, - - /// The current resolving alias for bailing recursion alias. - pub resolving_alias: Option, - - /// For avoiding infinite recursion, which will cause stack overflow. - depth: u8, -} - -impl Deref for ResolveContext { - type Target = ResolveContextImpl; - - fn deref(&self) -> &Self::Target { - &self.0 - } -} - -impl DerefMut for ResolveContext { - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} - -impl ResolveContext { - pub fn with_fully_specified(&mut self, yes: bool) { - self.fully_specified = yes; - } - - pub fn with_query_fragment(&mut self, query: Option<&str>, fragment: Option<&str>) { - if let Some(query) = query { - self.query.replace(query.to_string()); - } - if let Some(fragment) = fragment { - self.fragment.replace(fragment.to_string()); - } - } - - pub fn init_file_dependencies(&mut self) { - self.file_dependencies.replace(vec![]); - self.missing_dependencies.replace(vec![]); - } - - pub fn add_file_dependency(&mut self, dep: &Path) { - if let Some(deps) = &mut self.file_dependencies { - deps.push(dep.to_path_buf()); - } - } - - pub fn add_missing_dependency(&mut self, dep: &Path) { - if let Some(deps) = &mut self.missing_dependencies { - deps.push(dep.to_path_buf()); - } - } - - pub fn with_resolving_alias(&mut self, alias: String) { - self.resolving_alias = Some(alias); - } - - pub fn test_for_infinite_recursion(&mut self) -> Result<(), ResolveError> { - self.depth += 1; - // 64 should be more than enough for detecting infinite recursion. - if self.depth > 64 { - return Err(ResolveError::Recursion); - } - Ok(()) - } -} diff --git a/src/error.rs b/src/error.rs deleted file mode 100644 index b00a0ba8..00000000 --- a/src/error.rs +++ /dev/null @@ -1,182 +0,0 @@ -use std::{io, path::PathBuf, sync::Arc}; -use thiserror::Error; - -/// All resolution errors -/// -/// `thiserror` is used to display meaningful error messages. -#[derive(Debug, Clone, PartialEq, Error)] -pub enum ResolveError { - /// Ignored path - /// - /// Derived from ignored path (false value) from browser field in package.json - /// ```json - /// { - /// "browser": { - /// "./module": false - /// } - /// } - /// ``` - /// See - #[error("Path is ignored {0}")] - Ignored(PathBuf), - - /// Module not found - #[error("Cannot find module '{0}'")] - NotFound(/* specifier */ String), - - /// Matched alias value not found - #[error("Cannot find module '{0}' for matched aliased key '{1}'")] - MatchedAliasNotFound(/* specifier */ String, /* alias key */ String), - - /// Tsconfig not found - #[error("Tsconfig not found {0}")] - TsconfigNotFound(PathBuf), - - /// Tsconfig's project reference path points to it self - #[error("Tsconfig's project reference path points to this tsconfig {0}")] - TsconfigSelfReference(PathBuf), - - #[error("{0}")] - IOError(IOError), - - /// Node.js builtin modules - /// - /// This is an error due to not being a Node.js runtime. - /// The `alias` option can be used to resolve a builtin module to a polyfill. - #[error("Builtin module {0}")] - Builtin(String), - - /// All of the aliased extension are not found - #[error("All of the aliased extensions are not found for {0}")] - ExtensionAlias(PathBuf), - - /// The provided path specifier cannot be parsed - #[error("{0}")] - Specifier(SpecifierError), - - /// JSON parse error - #[error("{0:?}")] - JSON(JSONError), - - /// Restricted by `ResolveOptions::restrictions` - #[error(r#"Path "{0}" restricted by {0}"#)] - Restriction(PathBuf, PathBuf), - - #[error(r#"Invalid module "{0}" specifier is not a valid subpath for the "exports" resolution of {1}"#)] - InvalidModuleSpecifier(String, PathBuf), - - #[error(r#"Invalid "exports" target "{0}" defined for '{1}' in the package config {2}"#)] - InvalidPackageTarget(String, String, PathBuf), - - #[error(r#"Package subpath '{0}' is not defined by "exports" in {1}"#)] - PackagePathNotExported(String, PathBuf), - - #[error(r#"Invalid package config "{0}", "exports" cannot contain some keys starting with '.' and some not. The exports object must either be an object of package subpath keys or an object of main entry condition name keys only."#)] - InvalidPackageConfig(PathBuf), - - #[error(r#"Default condition should be last one in "{0}""#)] - InvalidPackageConfigDefault(PathBuf), - - #[error(r#"Expecting folder to folder mapping. "{0}" should end with "/"#)] - InvalidPackageConfigDirectory(PathBuf), - - #[error(r#"Package import specifier "{0}" is not defined in package {1}"#)] - PackageImportNotDefined(String, PathBuf), - - #[error("{0} is unimplemented")] - Unimplemented(&'static str), - - /// Occurs when alias paths reference each other. - #[error("Recursion in resolving")] - Recursion, -} - -impl ResolveError { - pub fn is_ignore(&self) -> bool { - matches!(self, Self::Ignored(_)) - } - - pub(crate) fn from_serde_json_error(path: PathBuf, error: &serde_json::Error) -> Self { - Self::JSON(JSONError { - path, - message: error.to_string(), - line: error.line(), - column: error.column(), - }) - } -} - -/// Error for [ResolveError::Specifier] -#[derive(Debug, Clone, Eq, PartialEq, Error)] -pub enum SpecifierError { - #[error("The specifiers must be a non-empty string. Received \"{0}\"")] - Empty(String), -} - -/// JSON error from [serde_json::Error] -#[derive(Debug, Clone, Eq, PartialEq)] -pub struct JSONError { - pub path: PathBuf, - pub message: String, - pub line: usize, - pub column: usize, -} - -#[derive(Debug, Clone, Error)] -#[error("{0}")] -pub struct IOError(Arc); - -impl PartialEq for IOError { - fn eq(&self, other: &Self) -> bool { - self.0.kind() == other.0.kind() - } -} - -impl From for io::Error { - fn from(error: IOError) -> Self { - let io_error = error.0.as_ref(); - Self::new(io_error.kind(), io_error.to_string()) - } -} - -impl From for ResolveError { - fn from(err: io::Error) -> Self { - Self::IOError(IOError(Arc::new(err))) - } -} - -#[test] -fn test_into_io_error() { - use std::io::{self, ErrorKind}; - let error_string = "IOError occurred"; - let string_error = io::Error::new(ErrorKind::Interrupted, error_string.to_string()); - let string_error2 = io::Error::new(ErrorKind::Interrupted, error_string.to_string()); - let resolve_io_error: ResolveError = ResolveError::from(string_error2); - - assert_eq!(resolve_io_error, ResolveError::from(string_error)); - assert_eq!(resolve_io_error.clone(), resolve_io_error); - let ResolveError::IOError(io_error) = resolve_io_error else { unreachable!() }; - assert_eq!( - format!("{io_error:?}"), - r#"IOError(Custom { kind: Interrupted, error: "IOError occurred" })"# - ); - // fix for https://github.com/web-infra-dev/rspack/issues/4564 - let std_io_error: io::Error = io_error.into(); - assert_eq!(std_io_error.kind(), ErrorKind::Interrupted); - assert_eq!(std_io_error.to_string(), error_string); - assert_eq!( - format!("{std_io_error:?}"), - r#"Custom { kind: Interrupted, error: "IOError occurred" }"# - ); -} - -#[test] -fn test_coverage() { - let error = ResolveError::NotFound("x".into()); - assert_eq!(format!("{error:?}"), r#"NotFound("x")"#); - assert_eq!(error.clone(), error); - - let error = ResolveError::Specifier(SpecifierError::Empty("x".into())); - assert_eq!(format!("{error:?}"), r#"Specifier(Empty("x"))"#); - assert_eq!(error.clone(), error); -} diff --git a/src/file_system.rs b/src/file_system.rs deleted file mode 100644 index d5f0ff8a..00000000 --- a/src/file_system.rs +++ /dev/null @@ -1,220 +0,0 @@ -use cfg_if::cfg_if; -use std::{ - fs, io, - path::{Path, PathBuf}, -}; - -#[cfg(feature = "yarn_pnp")] -use pnp::fs::{LruZipCache, VPath, VPathInfo, ZipCache}; - -/// File System abstraction used for `ResolverGeneric` -pub trait FileSystem: Send + Sync { - /// See [std::fs::read_to_string] - /// - /// # Errors - /// - /// * See [std::fs::read_to_string] - /// ## Warning - /// Use `&Path` instead of a generic `P: AsRef` here, - /// because object safety requirements, it is especially useful, when - /// you want to store multiple `dyn FileSystem` in a `Vec` or use a `ResolverGeneric` in - /// napi env. - fn read_to_string(&self, path: &Path) -> io::Result; - - /// See [std::fs::metadata] - /// - /// # Errors - /// See [std::fs::metadata] - /// ## Warning - /// Use `&Path` instead of a generic `P: AsRef` here, - /// because object safety requirements, it is especially useful, when - /// you want to store multiple `dyn FileSystem` in a `Vec` or use a `ResolverGeneric` in - /// napi env. - fn metadata(&self, path: &Path) -> io::Result; - - /// See [std::fs::symlink_metadata] - /// - /// # Errors - /// - /// See [std::fs::symlink_metadata] - /// ## Warning - /// Use `&Path` instead of a generic `P: AsRef` here, - /// because object safety requirements, it is especially useful, when - /// you want to store multiple `dyn FileSystem` in a `Vec` or use a `ResolverGeneric` in - /// napi env. - fn symlink_metadata(&self, path: &Path) -> io::Result; - - /// See [std::fs::canonicalize] - /// - /// # Errors - /// - /// See [std::fs::read_link] - /// ## Warning - /// Use `&Path` instead of a generic `P: AsRef` here, - /// because object safety requirements, it is especially useful, when - /// you want to store multiple `dyn FileSystem` in a `Vec` or use a `ResolverGeneric` in - /// napi env. - fn canonicalize(&self, path: &Path) -> io::Result; -} - -/// Metadata information about a file -#[derive(Debug, Clone, Copy)] -pub struct FileMetadata { - pub(crate) is_file: bool, - pub(crate) is_dir: bool, - pub(crate) is_symlink: bool, -} - -impl FileMetadata { - pub fn new(is_file: bool, is_dir: bool, is_symlink: bool) -> Self { - Self { is_file, is_dir, is_symlink } - } -} - -#[cfg(feature = "yarn_pnp")] -impl From for FileMetadata { - fn from(value: pnp::fs::FileType) -> Self { - Self::new(value == pnp::fs::FileType::File, value == pnp::fs::FileType::Directory, false) - } -} - -impl From for FileMetadata { - fn from(metadata: fs::Metadata) -> Self { - Self::new(metadata.is_file(), metadata.is_dir(), metadata.is_symlink()) - } -} - -/// Operating System -#[cfg(feature = "yarn_pnp")] -pub struct FileSystemOs { - pnp_lru: LruZipCache>, -} - -#[cfg(not(feature = "yarn_pnp"))] -pub struct FileSystemOs; - -impl Default for FileSystemOs { - fn default() -> Self { - cfg_if! { - if #[cfg(feature = "yarn_pnp")] { - Self { pnp_lru: LruZipCache::new(50, pnp::fs::open_zip_via_read_p) } - } else { - Self - } - } - } -} - -fn read_to_string(path: &Path) -> io::Result { - // `simdutf8` is faster than `std::str::from_utf8` which `fs::read_to_string` uses internally - let bytes = std::fs::read(path)?; - if simdutf8::basic::from_utf8(&bytes).is_err() { - // Same error as `fs::read_to_string` produces (`io::Error::INVALID_UTF8`) - return Err(io::Error::new( - io::ErrorKind::InvalidData, - "stream did not contain valid UTF-8", - )); - } - // SAFETY: `simdutf8` has ensured it's a valid UTF-8 string - Ok(unsafe { String::from_utf8_unchecked(bytes) }) -} - -impl FileSystem for FileSystemOs { - fn read_to_string(&self, path: &Path) -> io::Result { - cfg_if! { - if #[cfg(feature = "yarn_pnp")] { - match VPath::from(path)? { - VPath::Zip(info) => { - self.pnp_lru.read_to_string(info.physical_base_path(), info.zip_path) - } - VPath::Virtual(info) => read_to_string(&info.physical_base_path()), - VPath::Native(path) => read_to_string(&path), - } - } else { - read_to_string(path) - } - } - } - - fn metadata(&self, path: &Path) -> io::Result { - cfg_if! { - if #[cfg(feature = "yarn_pnp")] { - match VPath::from(path)? { - VPath::Zip(info) => self - .pnp_lru - .file_type(info.physical_base_path(), info.zip_path) - .map(FileMetadata::from), - VPath::Virtual(info) => { - fs::metadata(info.physical_base_path()).map(FileMetadata::from) - } - VPath::Native(path) => fs::metadata(path).map(FileMetadata::from), - } - } else { - fs::metadata(path).map(FileMetadata::from) - } - } - } - - fn symlink_metadata(&self, path: &Path) -> io::Result { - fs::symlink_metadata(path).map(FileMetadata::from) - } - - fn canonicalize(&self, path: &Path) -> io::Result { - cfg_if! { - if #[cfg(feature = "yarn_pnp")] { - match VPath::from(path)? { - VPath::Zip(info) => { - dunce::canonicalize(info.physical_base_path().join(info.zip_path)) - } - VPath::Virtual(info) => dunce::canonicalize(info.physical_base_path()), - VPath::Native(path) => dunce::canonicalize(path), - } - } else if #[cfg(windows)] { - dunce::canonicalize(path) - } else { - use std::path::Component; - let mut path_buf = path.to_path_buf(); - loop { - let link = fs::read_link(&path_buf)?; - path_buf.pop(); - for component in link.components() { - match component { - Component::ParentDir => { - path_buf.pop(); - } - Component::Normal(seg) => { - #[cfg(target_family = "wasm")] - // Need to trim the extra \0 introduces by https://github.com/nodejs/uvwasi/issues/262 - { - path_buf.push(seg.to_string_lossy().trim_end_matches('\0')); - } - #[cfg(not(target_family = "wasm"))] - { - path_buf.push(seg); - } - } - Component::RootDir => { - path_buf = PathBuf::from("/"); - } - Component::CurDir | Component::Prefix(_) => {} - } - } - if !fs::symlink_metadata(&path_buf)?.is_symlink() { - break; - } - } - Ok(path_buf) - } - } - } -} - -#[test] -fn metadata() { - let meta = FileMetadata { is_file: true, is_dir: true, is_symlink: true }; - assert_eq!( - format!("{meta:?}"), - "FileMetadata { is_file: true, is_dir: true, is_symlink: true }" - ); - let _ = meta; -} diff --git a/src/lib.rs b/src/lib.rs deleted file mode 100644 index e6cb2246..00000000 --- a/src/lib.rs +++ /dev/null @@ -1,1755 +0,0 @@ -//! # Oxc Resolver -//! -//! Node.js [CommonJS][cjs] and [ECMAScript][esm] Module Resolution. -//! -//! Released on [crates.io](https://crates.io/crates/oxc_resolver) and [npm](https://www.npmjs.com/package/oxc-resolver). -//! -//! A module resolution is the process of finding the file referenced by a module specifier in -//! `import "specifier"` or `require("specifier")`. -//! -//! All [configuration options](ResolveOptions) are aligned with webpack's [enhanced-resolve]. -//! -//! ## Terminology -//! -//! ### Specifier -//! -//! For [CommonJS modules][cjs], -//! the specifier is the string passed to the `require` function. e.g. `"id"` in `require("id")`. -//! -//! For [ECMAScript modules][esm], -//! the specifier of an `import` statement is the string after the `from` keyword, -//! e.g. `'specifier'` in `import 'specifier'` or `import { sep } from 'specifier'`. -//! Specifiers are also used in export from statements, and as the argument to an `import()` expression. -//! -//! This is also named "request" in some places. -//! -//! ## References: -//! -//! * Algorithm adapted from Node.js [CommonJS Module Resolution Algorithm] and [ECMAScript Module Resolution Algorithm]. -//! * Tests are ported from [enhanced-resolve]. -//! * Some code is adapted from [parcel-resolver]. -//! * The documentation is copied from [webpack's resolve configuration](https://webpack.js.org/configuration/resolve). -//! -//! [enhanced-resolve]: https://github.com/webpack/enhanced-resolve -//! [CommonJS Module Resolution Algorithm]: https://nodejs.org/api/modules.html#all-together -//! [ECMAScript Module Resolution Algorithm]: https://nodejs.org/api/esm.html#resolution-algorithm-specification -//! [parcel-resolver]: https://github.com/parcel-bundler/parcel/blob/v2/packages/utils/node-resolver-rs -//! [cjs]: https://nodejs.org/api/modules.html -//! [esm]: https://nodejs.org/api/esm.html -//! -//! ## Feature flags -#![cfg_attr(feature = "document-features", doc = document_features::document_features!())] -#![cfg_attr(docsrs, feature(doc_auto_cfg))] -//! -//! ## Example -//! -//! ```rust,ignore -#![doc = include_str!("../examples/resolver.rs")] -//! ``` - -mod builtins; -mod cache; -mod context; -mod error; -mod file_system; -mod options; -mod package_json; -mod path; -mod resolution; -mod specifier; -mod tsconfig; - -#[cfg(test)] -mod tests; - -use std::{ - borrow::Cow, - cmp::Ordering, - ffi::OsStr, - fmt, - path::{Component, Path, PathBuf}, - sync::Arc, -}; - -use rustc_hash::FxHashSet; -use serde_json::Value as JSONValue; - -pub use crate::{ - builtins::NODEJS_BUILTINS, - error::{JSONError, ResolveError, SpecifierError}, - file_system::{FileMetadata, FileSystem}, - options::{ - Alias, AliasValue, EnforceExtension, ResolveOptions, Restriction, TsconfigOptions, - TsconfigReferences, - }, - package_json::PackageJson, - resolution::Resolution, -}; -use crate::{ - cache::{Cache, CachedPath}, - context::ResolveContext as Ctx, - file_system::FileSystemOs, - package_json::JSONMap, - path::{PathUtil, SLASH_START}, - specifier::Specifier, - tsconfig::ExtendsField, - tsconfig::{ProjectReference, TsConfig}, -}; - -type ResolveResult = Result, ResolveError>; - -/// Context returned from the [Resolver::resolve_with_context] API -#[derive(Debug, Default, Clone)] -pub struct ResolveContext { - /// Files that was found on file system - pub file_dependencies: FxHashSet, - - /// Dependencies that was not found on file system - pub missing_dependencies: FxHashSet, -} - -/// Resolver with the current operating system as the file system -pub type Resolver = ResolverGeneric; - -/// Generic implementation of the resolver, can be configured by the [FileSystem] trait -pub struct ResolverGeneric { - options: ResolveOptions, - cache: Arc>, -} - -impl fmt::Debug for ResolverGeneric { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - self.options.fmt(f) - } -} - -impl Default for ResolverGeneric { - fn default() -> Self { - Self::new(ResolveOptions::default()) - } -} - -impl ResolverGeneric { - pub fn new(options: ResolveOptions) -> Self { - Self { options: options.sanitize(), cache: Arc::new(Cache::new(Fs::default())) } - } -} - -impl ResolverGeneric { - pub fn new_with_file_system(file_system: Fs, options: ResolveOptions) -> Self { - Self { cache: Arc::new(Cache::new(file_system)), options: options.sanitize() } - } - - /// Clone the resolver using the same underlying cache. - #[must_use] - pub fn clone_with_options(&self, options: ResolveOptions) -> Self { - Self { options: options.sanitize(), cache: Arc::clone(&self.cache) } - } - - /// Returns the options. - pub fn options(&self) -> &ResolveOptions { - &self.options - } - - /// Clear the underlying cache. - pub fn clear_cache(&self) { - self.cache.clear(); - } - - /// Resolve `specifier` at an absolute path to a `directory`. - /// - /// A specifier is the string passed to require or import, i.e. `require("specifier")` or `import "specifier"`. - /// - /// `directory` must be an **absolute** path to a directory where the specifier is resolved against. - /// For CommonJS modules, it is the `__dirname` variable that contains the absolute path to the folder containing current module. - /// For ECMAScript modules, it is the value of `import.meta.url`. - /// - /// # Errors - /// - /// * See [ResolveError] - pub fn resolve>( - &self, - directory: P, - specifier: &str, - ) -> Result { - let mut ctx = Ctx::default(); - self.resolve_tracing(directory.as_ref(), specifier, &mut ctx) - } - - /// Resolve `specifier` at absolute `path` with [ResolveContext] - /// - /// # Errors - /// - /// * See [ResolveError] - pub fn resolve_with_context>( - &self, - directory: P, - specifier: &str, - resolve_context: &mut ResolveContext, - ) -> Result { - let mut ctx = Ctx::default(); - ctx.init_file_dependencies(); - let result = self.resolve_tracing(directory.as_ref(), specifier, &mut ctx); - if let Some(deps) = &mut ctx.file_dependencies { - resolve_context.file_dependencies.extend(deps.drain(..)); - } - if let Some(deps) = &mut ctx.missing_dependencies { - resolve_context.missing_dependencies.extend(deps.drain(..)); - } - result - } - - /// Wrap `resolve_impl` with `tracing` information - fn resolve_tracing( - &self, - directory: &Path, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - let span = tracing::debug_span!("resolve", path = ?directory, specifier = specifier); - let _enter = span.enter(); - let r = self.resolve_impl(directory, specifier, ctx); - match &r { - Ok(r) => { - tracing::debug!(options = ?self.options, path = ?directory, specifier = specifier, ret = ?r.path); - } - Err(err) => { - tracing::debug!(options = ?self.options, path = ?directory, specifier = specifier, err = ?err); - } - }; - r - } - - fn resolve_impl( - &self, - path: &Path, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - ctx.with_fully_specified(self.options.fully_specified); - let cached_path = self.cache.value(path); - let cached_path = self.require(&cached_path, specifier, ctx)?; - let path = self.load_realpath(&cached_path)?; - // enhanced-resolve: restrictions - self.check_restrictions(&path)?; - let package_json = cached_path.find_package_json(&self.cache.fs, &self.options, ctx)?; - if let Some(package_json) = &package_json { - // path must be inside the package. - debug_assert!(path.starts_with(package_json.directory())); - } - Ok(Resolution { - path, - query: ctx.query.take(), - fragment: ctx.fragment.take(), - package_json, - }) - } - - /// require(X) from module at path Y - /// - /// X: specifier - /// Y: path - /// - /// - fn require( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - ctx.test_for_infinite_recursion()?; - - // enhanced-resolve: parse - let (parsed, try_fragment_as_path) = self.load_parse(cached_path, specifier, ctx)?; - if let Some(path) = try_fragment_as_path { - return Ok(path); - } - - self.require_without_parse(cached_path, parsed.path(), ctx) - } - - fn require_without_parse( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - // tsconfig-paths - if let Some(path) = self.load_tsconfig_paths(cached_path, specifier, &mut Ctx::default())? { - return Ok(path); - } - - // enhanced-resolve: try alias - if let Some(path) = self.load_alias(cached_path, specifier, &self.options.alias, ctx)? { - return Ok(path); - } - - let result = match Path::new(specifier).components().next() { - // 2. If X begins with '/' - Some(Component::RootDir | Component::Prefix(_)) => { - self.require_absolute(cached_path, specifier, ctx) - } - // 3. If X begins with './' or '/' or '../' - Some(Component::CurDir | Component::ParentDir) => { - self.require_relative(cached_path, specifier, ctx) - } - // 4. If X begins with '#' - Some(Component::Normal(_)) if specifier.as_bytes()[0] == b'#' => { - self.require_hash(cached_path, specifier, ctx) - } - _ => { - // 1. If X is a core module, - // a. return the core module - // b. STOP - self.require_core(specifier)?; - - // (ESM) 5. Otherwise, - // Note: specifier is now a bare specifier. - // Set resolved the result of PACKAGE_RESOLVE(specifier, parentURL). - self.require_bare(cached_path, specifier, ctx) - } - }; - - result.or_else(|err| { - if err.is_ignore() { - return Err(err); - } - // enhanced-resolve: try fallback - self.load_alias(cached_path, specifier, &self.options.fallback, ctx) - .and_then(|value| value.ok_or(err)) - }) - } - - // PACKAGE_RESOLVE(packageSpecifier, parentURL) - // 3. If packageSpecifier is a Node.js builtin module name, then - // 1. Return the string "node:" concatenated with packageSpecifier. - fn require_core(&self, specifier: &str) -> Result<(), ResolveError> { - if self.options.builtin_modules { - let starts_with_node = specifier.starts_with("node:"); - if starts_with_node || NODEJS_BUILTINS.binary_search(&specifier).is_ok() { - let mut specifier = specifier.to_string(); - if !starts_with_node { - specifier = format!("node:{specifier}"); - } - return Err(ResolveError::Builtin(specifier)); - } - } - Ok(()) - } - - fn require_absolute( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - // Make sure only path prefixes gets called - debug_assert!(Path::new(specifier) - .components() - .next() - .is_some_and(|c| matches!(c, Component::RootDir | Component::Prefix(_)))); - if !self.options.prefer_relative && self.options.prefer_absolute { - if let Ok(path) = self.load_package_self_or_node_modules(cached_path, specifier, ctx) { - return Ok(path); - } - } - if let Some(path) = self.load_roots(specifier, ctx) { - return Ok(path); - } - // 2. If X begins with '/' - // a. set Y to be the file system root - let path = self.cache.value(Path::new(specifier)); - if let Some(path) = self.load_as_file_or_directory(&path, specifier, ctx)? { - return Ok(path); - } - Err(ResolveError::NotFound(specifier.to_string())) - } - - // 3. If X begins with './' or '/' or '../' - fn require_relative( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - // Make sure only relative or normal paths gets called - debug_assert!(Path::new(specifier).components().next().is_some_and(|c| matches!( - c, - Component::CurDir | Component::ParentDir | Component::Normal(_) - ))); - let path = cached_path.path().normalize_with(specifier); - let cached_path = self.cache.value(&path); - // a. LOAD_AS_FILE(Y + X) - // b. LOAD_AS_DIRECTORY(Y + X) - if let Some(path) = self.load_as_file_or_directory(&cached_path, specifier, ctx)? { - return Ok(path); - } - // c. THROW "not found" - Err(ResolveError::NotFound(specifier.to_string())) - } - - fn require_hash( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - debug_assert_eq!(specifier.chars().next(), Some('#')); - // a. LOAD_PACKAGE_IMPORTS(X, dirname(Y)) - if let Some(path) = self.load_package_imports(cached_path, specifier, ctx)? { - return Ok(path); - } - self.load_package_self_or_node_modules(cached_path, specifier, ctx) - } - - fn require_bare( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - // Make sure no other path prefixes gets called - debug_assert!(Path::new(specifier) - .components() - .next() - .is_some_and(|c| matches!(c, Component::Normal(_)))); - if self.options.prefer_relative { - if let Ok(path) = self.require_relative(cached_path, specifier, ctx) { - return Ok(path); - } - } - self.load_package_self_or_node_modules(cached_path, specifier, ctx) - } - - /// enhanced-resolve: ParsePlugin. - /// - /// 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`. - /// - /// - fn load_parse<'s>( - &self, - cached_path: &CachedPath, - specifier: &'s str, - ctx: &mut Ctx, - ) -> Result<(Specifier<'s>, Option), ResolveError> { - let parsed = Specifier::parse(specifier).map_err(ResolveError::Specifier)?; - ctx.with_query_fragment(parsed.query, parsed.fragment); - - // There is an edge-case where a request with # can be a path or a fragment -> try both - if ctx.fragment.is_some() && ctx.query.is_none() { - let specifier = parsed.path(); - let fragment = ctx.fragment.take().unwrap(); - let path = format!("{specifier}{fragment}"); - if let Ok(path) = self.require_without_parse(cached_path, &path, ctx) { - return Ok((parsed, Some(path))); - } - ctx.fragment.replace(fragment); - } - Ok((parsed, None)) - } - - fn load_package_self_or_node_modules( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - let (_, subpath) = Self::parse_package_specifier(specifier); - if subpath.is_empty() { - ctx.with_fully_specified(false); - } - // 5. LOAD_PACKAGE_SELF(X, dirname(Y)) - if let Some(path) = self.load_package_self(cached_path, specifier, ctx)? { - return Ok(path); - } - // 6. LOAD_NODE_MODULES(X, dirname(Y)) - if let Some(path) = self.load_node_modules(cached_path, specifier, ctx)? { - return Ok(path); - } - // 7. THROW "not found" - Err(ResolveError::NotFound(specifier.to_string())) - } - - /// LOAD_PACKAGE_IMPORTS(X, DIR) - fn load_package_imports( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - // 1. Find the closest package scope SCOPE to DIR. - // 2. If no scope was found, return. - let Some(package_json) = - cached_path.find_package_json(&self.cache.fs, &self.options, ctx)? - else { - return Ok(None); - }; - // 3. If the SCOPE/package.json "imports" is null or undefined, return. - // 4. let MATCH = PACKAGE_IMPORTS_RESOLVE(X, pathToFileURL(SCOPE), ["node", "require"]) defined in the ESM resolver. - if let Some(path) = self.package_imports_resolve(specifier, &package_json, ctx)? { - // 5. RESOLVE_ESM_MATCH(MATCH). - return self.resolve_esm_match(specifier, &path, ctx); - } - Ok(None) - } - - fn load_as_file(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - // enhanced-resolve feature: extension_alias - if let Some(path) = self.load_extension_alias(cached_path, ctx)? { - return Ok(Some(path)); - } - if self.options.enforce_extension.is_disabled() { - // 1. If X is a file, load X as its file extension format. STOP - if let Some(path) = self.load_alias_or_file(cached_path, ctx)? { - return Ok(Some(path)); - } - } - // 2. If X.js is a file, load X.js as JavaScript text. STOP - // 3. If X.json is a file, parse X.json to a JavaScript Object. STOP - // 4. If X.node is a file, load X.node as binary addon. STOP - if let Some(path) = self.load_extensions(cached_path, &self.options.extensions, ctx)? { - return Ok(Some(path)); - } - Ok(None) - } - - fn load_as_directory(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - // TODO: Only package.json is supported, so warn about having other values - // Checking for empty files is needed for omitting checks on package.json - // 1. If X/package.json is a file, - if !self.options.description_files.is_empty() { - // a. Parse X/package.json, and look for "main" field. - if let Some(package_json) = - cached_path.package_json(&self.cache.fs, &self.options, ctx)? - { - // b. If "main" is a falsy value, GOTO 2. - for main_field in package_json.main_fields(&self.options.main_fields) { - // c. let M = X + (json main field) - let main_field_path = cached_path.path().normalize_with(main_field); - // d. LOAD_AS_FILE(M) - let cached_path = self.cache.value(&main_field_path); - if let Some(path) = self.load_as_file(&cached_path, ctx)? { - return Ok(Some(path)); - } - // e. LOAD_INDEX(M) - if let Some(path) = self.load_index(&cached_path, ctx)? { - return Ok(Some(path)); - } - } - // f. LOAD_INDEX(X) DEPRECATED - // g. THROW "not found" - } - } - // 2. LOAD_INDEX(X) - self.load_index(cached_path, ctx) - } - - fn load_as_file_or_directory( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - if self.options.resolve_to_context { - return Ok(cached_path.is_dir(&self.cache.fs, ctx).then(|| cached_path.clone())); - } - if !specifier.ends_with('/') { - if let Some(path) = self.load_as_file(cached_path, ctx)? { - return Ok(Some(path)); - } - } - if cached_path.is_dir(&self.cache.fs, ctx) { - if let Some(path) = self.load_as_directory(cached_path, ctx)? { - return Ok(Some(path)); - } - } - Ok(None) - } - - fn load_extensions( - &self, - path: &CachedPath, - extensions: &[String], - ctx: &mut Ctx, - ) -> ResolveResult { - if ctx.fully_specified { - return Ok(None); - } - let path = path.path().as_os_str(); - for extension in extensions { - let mut path_with_extension = path.to_os_string(); - path_with_extension.reserve_exact(extension.len()); - path_with_extension.push(extension); - let cached_path = self.cache.value(Path::new(&path_with_extension)); - if let Some(path) = self.load_alias_or_file(&cached_path, ctx)? { - return Ok(Some(path)); - } - } - Ok(None) - } - - fn load_realpath(&self, cached_path: &CachedPath) -> Result { - if self.options.symlinks { - cached_path.realpath(&self.cache.fs).map_err(ResolveError::from) - } else { - Ok(cached_path.to_path_buf()) - } - } - - fn check_restrictions(&self, path: &Path) -> Result<(), ResolveError> { - // https://github.com/webpack/enhanced-resolve/blob/a998c7d218b7a9ec2461fc4fddd1ad5dd7687485/lib/RestrictionsPlugin.js#L19-L24 - fn is_inside(path: &Path, parent: &Path) -> bool { - if !path.starts_with(parent) { - return false; - } - if path.as_os_str().len() == parent.as_os_str().len() { - return true; - } - path.strip_prefix(parent).is_ok_and(|p| p == Path::new("./")) - } - for restriction in &self.options.restrictions { - match restriction { - Restriction::Path(restricted_path) => { - if !is_inside(path, restricted_path) { - return Err(ResolveError::Restriction( - path.to_path_buf(), - restricted_path.clone(), - )); - } - } - Restriction::RegExp(_) => { - return Err(ResolveError::Unimplemented("Restriction with regex")) - } - } - } - Ok(()) - } - - fn load_index(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - for main_file in &self.options.main_files { - let main_path = cached_path.path().normalize_with(main_file); - let cached_path = self.cache.value(&main_path); - if self.options.enforce_extension.is_disabled() { - if let Some(path) = self.load_alias_or_file(&cached_path, ctx)? { - return Ok(Some(path)); - } - } - // 1. If X/index.js is a file, load X/index.js as JavaScript text. STOP - // 2. If X/index.json is a file, parse X/index.json to a JavaScript object. STOP - // 3. If X/index.node is a file, load X/index.node as binary addon. STOP - if let Some(path) = self.load_extensions(&cached_path, &self.options.extensions, ctx)? { - return Ok(Some(path)); - } - } - Ok(None) - } - - fn load_alias_or_file(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - if !self.options.alias_fields.is_empty() { - if let Some(package_json) = - cached_path.find_package_json(&self.cache.fs, &self.options, ctx)? - { - if let Some(path) = - self.load_browser_field(cached_path, None, &package_json, ctx)? - { - return Ok(Some(path)); - } - } - } - // enhanced-resolve: try file as alias - let alias_specifier = cached_path.path().to_string_lossy(); - if let Some(path) = - self.load_alias(cached_path, &alias_specifier, &self.options.alias, ctx)? - { - return Ok(Some(path)); - } - if cached_path.is_file(&self.cache.fs, ctx) { - return Ok(Some(cached_path.clone())); - } - Ok(None) - } - - fn load_node_modules( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - #[cfg(feature = "yarn_pnp")] - { - if let Some(resolved_path) = self.load_pnp(cached_path, specifier, ctx)? { - return Ok(Some(resolved_path)); - } - } - - let (package_name, subpath) = Self::parse_package_specifier(specifier); - // 1. let DIRS = NODE_MODULES_PATHS(START) - // 2. for each DIR in DIRS: - for module_name in &self.options.modules { - for cached_path in std::iter::successors(Some(cached_path), |p| p.parent()) { - // Skip if /path/to/node_modules does not exist - if !cached_path.is_dir(&self.cache.fs, ctx) { - continue; - } - - let Some(cached_path) = self.get_module_directory(cached_path, module_name, ctx) - else { - continue; - }; - // Optimize node_modules lookup by inspecting whether the package exists - // From LOAD_PACKAGE_EXPORTS(X, DIR) - // 1. Try to interpret X as a combination of NAME and SUBPATH where the name - // may have a @scope/ prefix and the subpath begins with a slash (`/`). - if !package_name.is_empty() { - let package_path = cached_path.path().normalize_with(package_name); - let cached_path = self.cache.value(&package_path); - // Try foo/node_modules/package_name - if cached_path.is_dir(&self.cache.fs, ctx) { - // a. LOAD_PACKAGE_EXPORTS(X, DIR) - if let Some(path) = - self.load_package_exports(specifier, subpath, &cached_path, ctx)? - { - return Ok(Some(path)); - } - } else { - // foo/node_modules/package_name is not a directory, so useless to check inside it - if !subpath.is_empty() { - continue; - } - // Skip if the directory lead to the scope package does not exist - // i.e. `foo/node_modules/@scope` is not a directory for `foo/node_modules/@scope/package` - if package_name.starts_with('@') { - if let Some(path) = cached_path.parent() { - if !path.is_dir(&self.cache.fs, ctx) { - continue; - } - } - } - } - } - - // Try as file or directory for all other cases - // b. LOAD_AS_FILE(DIR/X) - // c. LOAD_AS_DIRECTORY(DIR/X) - let node_module_file = cached_path.path().normalize_with(specifier); - let cached_path = self.cache.value(&node_module_file); - if let Some(path) = self.load_as_file_or_directory(&cached_path, specifier, ctx)? { - return Ok(Some(path)); - } - } - } - Ok(None) - } - - #[cfg(feature = "yarn_pnp")] - fn load_pnp( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result, ResolveError> { - let Some(pnp_manifest) = &self.options.pnp_manifest else { return Ok(None) }; - let resolution = - pnp::resolve_to_unqualified_via_manifest(pnp_manifest, specifier, cached_path.path()); - match resolution { - Ok(pnp::Resolution::Resolved(path, subpath)) => { - let cached_path = self.cache.value(&path); - let export_resolution = self.load_package_exports( - specifier, - &subpath.unwrap_or_default(), - &cached_path, - ctx, - )?; - if export_resolution.is_some() { - return Ok(export_resolution); - } - let file_or_directory_resolution = - self.load_as_file_or_directory(&cached_path, specifier, ctx)?; - if file_or_directory_resolution.is_some() { - return Ok(file_or_directory_resolution); - } - Err(ResolveError::NotFound(specifier.to_string())) - } - - Ok(pnp::Resolution::Skipped) => Ok(None), - - Err(_) => { - // Todo: Add a ResolveError::Pnp variant? - Err(ResolveError::NotFound(specifier.to_string())) - } - } - } - - fn get_module_directory( - &self, - cached_path: &CachedPath, - module_name: &str, - ctx: &mut Ctx, - ) -> Option { - if module_name == "node_modules" { - cached_path.cached_node_modules(&self.cache, ctx) - } else if cached_path.path().components().next_back() - == Some(Component::Normal(OsStr::new(module_name))) - { - Some(cached_path.clone()) - } else { - cached_path.module_directory(module_name, &self.cache, ctx) - } - } - - fn load_package_exports( - &self, - specifier: &str, - subpath: &str, - cached_path: &CachedPath, - ctx: &mut Ctx, - ) -> ResolveResult { - // 2. If X does not match this pattern or DIR/NAME/package.json is not a file, - // return. - let Some(package_json) = cached_path.package_json(&self.cache.fs, &self.options, ctx)? - else { - return Ok(None); - }; - // 3. Parse DIR/NAME/package.json, and look for "exports" field. - // 4. If "exports" is null or undefined, return. - // 5. let MATCH = PACKAGE_EXPORTS_RESOLVE(pathToFileURL(DIR/NAME), "." + SUBPATH, - // `package.json` "exports", ["node", "require"]) defined in the ESM resolver. - // Note: The subpath is not prepended with a dot on purpose - for exports in package_json.exports_fields(&self.options.exports_fields) { - if let Some(path) = self.package_exports_resolve( - cached_path.path(), - &format!(".{subpath}"), - exports, - ctx, - )? { - // 6. RESOLVE_ESM_MATCH(MATCH) - return self.resolve_esm_match(specifier, &path, ctx); - }; - } - Ok(None) - } - - fn load_package_self( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - // 1. Find the closest package scope SCOPE to DIR. - // 2. If no scope was found, return. - let Some(package_json) = - cached_path.find_package_json(&self.cache.fs, &self.options, ctx)? - else { - return Ok(None); - }; - // 3. If the SCOPE/package.json "exports" is null or undefined, return. - // 4. If the SCOPE/package.json "name" is not the first segment of X, return. - if let Some(subpath) = package_json - .name - .as_ref() - .and_then(|package_name| Self::strip_package_name(specifier, package_name)) - { - // 5. let MATCH = PACKAGE_EXPORTS_RESOLVE(pathToFileURL(SCOPE), - // "." + X.slice("name".length), `package.json` "exports", ["node", "require"]) - // defined in the ESM resolver. - let package_url = package_json.directory(); - // Note: The subpath is not prepended with a dot on purpose - // because `package_exports_resolve` matches subpath without the leading dot. - for exports in package_json.exports_fields(&self.options.exports_fields) { - if let Some(cached_path) = - self.package_exports_resolve(package_url, &format!(".{subpath}"), exports, ctx)? - { - // 6. RESOLVE_ESM_MATCH(MATCH) - return self.resolve_esm_match(specifier, &cached_path, ctx); - } - } - } - self.load_browser_field(cached_path, Some(specifier), &package_json, ctx) - } - - /// RESOLVE_ESM_MATCH(MATCH) - fn resolve_esm_match( - &self, - specifier: &str, - cached_path: &CachedPath, - ctx: &mut Ctx, - ) -> ResolveResult { - // 1. let RESOLVED_PATH = fileURLToPath(MATCH) - // 2. If the file at RESOLVED_PATH exists, load RESOLVED_PATH as its extension format. STOP - // - // Non-compliant ESM can result in a directory, so directory is tried as well. - if let Some(path) = self.load_as_file_or_directory(cached_path, "", ctx)? { - return Ok(Some(path)); - } - // 3. THROW "not found" - Err(ResolveError::NotFound(specifier.to_string())) - } - - /// enhanced-resolve: AliasFieldPlugin for [ResolveOptions::alias_fields] - fn load_browser_field( - &self, - cached_path: &CachedPath, - module_specifier: Option<&str>, - package_json: &PackageJson, - ctx: &mut Ctx, - ) -> ResolveResult { - let path = cached_path.path(); - let Some(new_specifier) = package_json.resolve_browser_field( - path, - module_specifier, - &self.options.alias_fields, - )? - else { - return Ok(None); - }; - // Abort when resolving recursive module - if module_specifier.is_some_and(|s| s == new_specifier) { - return Ok(None); - } - if ctx.resolving_alias.as_ref().is_some_and(|s| s == new_specifier) { - // Complete when resolving to self `{"./a.js": "./a.js"}` - if new_specifier.strip_prefix("./").filter(|s| path.ends_with(Path::new(s))).is_some() { - return if cached_path.is_file(&self.cache.fs, ctx) { - Ok(Some(cached_path.clone())) - } else { - Err(ResolveError::NotFound(new_specifier.to_string())) - }; - } - return Err(ResolveError::Recursion); - } - ctx.with_resolving_alias(new_specifier.to_string()); - ctx.with_fully_specified(false); - let cached_path = self.cache.value(package_json.directory()); - self.require(&cached_path, new_specifier, ctx).map(Some) - } - - /// enhanced-resolve: AliasPlugin for [ResolveOptions::alias] and [ResolveOptions::fallback]. - fn load_alias( - &self, - cached_path: &CachedPath, - specifier: &str, - aliases: &Alias, - ctx: &mut Ctx, - ) -> ResolveResult { - for (alias_key_raw, specifiers) in aliases { - let alias_key = if let Some(alias_key) = alias_key_raw.strip_suffix('$') { - if alias_key != specifier { - continue; - } - alias_key - } else { - let strip_package_name = Self::strip_package_name(specifier, alias_key_raw); - if strip_package_name.is_none() { - continue; - } - alias_key_raw - }; - // It should stop resolving when all of the tried alias values - // failed to resolve. - // - let mut should_stop = false; - for r in specifiers { - match r { - AliasValue::Path(alias_value) => { - if let Some(path) = self.load_alias_value( - cached_path, - alias_key, - alias_value, - specifier, - ctx, - &mut should_stop, - )? { - return Ok(Some(path)); - } - } - AliasValue::Ignore => { - let path = cached_path.path().normalize_with(alias_key); - return Err(ResolveError::Ignored(path)); - } - } - } - if should_stop { - return Err(ResolveError::MatchedAliasNotFound( - specifier.to_string(), - alias_key.to_string(), - )); - } - } - Ok(None) - } - - fn load_alias_value( - &self, - cached_path: &CachedPath, - alias_key: &str, - alias_value: &str, - request: &str, - ctx: &mut Ctx, - should_stop: &mut bool, - ) -> ResolveResult { - if request != alias_value - && !request.strip_prefix(alias_value).is_some_and(|prefix| prefix.starts_with('/')) - { - let tail = &request[alias_key.len()..]; - - let new_specifier = if tail.is_empty() { - Cow::Borrowed(alias_value) - } else { - let alias_value = Path::new(alias_value).normalize(); - // Must not append anything to alias_value if it is a file. - let alias_value_cached_path = self.cache.value(&alias_value); - if alias_value_cached_path.is_file(&self.cache.fs, ctx) { - return Ok(None); - } - - // Remove the leading slash so the final path is concatenated. - let tail = tail.trim_start_matches(SLASH_START); - let normalized = alias_value.normalize_with(tail); - Cow::Owned(normalized.to_string_lossy().to_string()) - }; - - *should_stop = true; - ctx.with_fully_specified(false); - return match self.require(cached_path, new_specifier.as_ref(), ctx) { - Err(ResolveError::NotFound(_) | ResolveError::MatchedAliasNotFound(_, _)) => { - Ok(None) - } - Ok(path) => return Ok(Some(path)), - Err(err) => return Err(err), - }; - } - Ok(None) - } - - /// Given an extension alias map `{".js": [".ts", ".js"]}`, - /// load the mapping instead of the provided extension - /// - /// This is an enhanced-resolve feature - /// - /// # Errors - /// - /// * [ResolveError::ExtensionAlias]: When all of the aliased extensions are not found - fn load_extension_alias(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - if self.options.extension_alias.is_empty() { - return Ok(None); - } - let Some(path_extension) = cached_path.path().extension() else { - return Ok(None); - }; - let Some((_, extensions)) = self - .options - .extension_alias - .iter() - .find(|(ext, _)| OsStr::new(ext.trim_start_matches('.')) == path_extension) - else { - return Ok(None); - }; - let path = cached_path.path().with_extension(""); - let path = path.as_os_str(); - ctx.with_fully_specified(true); - for extension in extensions { - let mut path_with_extension = path.to_os_string(); - path_with_extension.reserve_exact(extension.len()); - path_with_extension.push(extension); - let cached_path = self.cache.value(Path::new(&path_with_extension)); - // Bail if path is module directory such as `ipaddr.js` - if cached_path.is_dir(&self.cache.fs, ctx) { - ctx.with_fully_specified(false); - return Ok(None); - } - if let Some(path) = self.load_alias_or_file(&cached_path, ctx)? { - ctx.with_fully_specified(false); - return Ok(Some(path)); - } - } - Err(ResolveError::ExtensionAlias(cached_path.to_path_buf())) - } - - /// enhanced-resolve: RootsPlugin - /// - /// A list of directories where requests of server-relative URLs (starting with '/') are resolved, - /// defaults to context configuration option. - /// - /// On non-Windows systems these requests are resolved as an absolute path first. - fn load_roots(&self, specifier: &str, ctx: &mut Ctx) -> Option { - if self.options.roots.is_empty() { - return None; - } - if let Some(specifier) = specifier.strip_prefix(SLASH_START) { - for root in &self.options.roots { - let cached_path = self.cache.value(root); - if let Ok(path) = self.require_relative(&cached_path, specifier, ctx) { - return Some(path); - } - } - } - None - } - - fn load_tsconfig_paths( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - let Some(tsconfig_options) = &self.options.tsconfig else { - return Ok(None); - }; - let tsconfig = self.load_tsconfig( - /* root */ true, - &tsconfig_options.config_file, - &tsconfig_options.references, - )?; - let paths = tsconfig.resolve(cached_path.path(), specifier); - for path in paths { - let cached_path = self.cache.value(&path); - if let Ok(path) = self.require_relative(&cached_path, ".", ctx) { - return Ok(Some(path)); - } - } - Ok(None) - } - - fn load_tsconfig( - &self, - root: bool, - path: &Path, - references: &TsconfigReferences, - ) -> Result, ResolveError> { - self.cache.tsconfig(root, path, |tsconfig| { - let directory = self.cache.value(tsconfig.directory()); - tracing::trace!(tsconfig = ?tsconfig, "load_tsconfig"); - - // Extend tsconfig - if let Some(extends) = &tsconfig.extends { - let extended_tsconfig_paths = match extends { - ExtendsField::Single(s) => { - vec![self.get_extended_tsconfig_path(&directory, tsconfig, s)?] - } - ExtendsField::Multiple(specifiers) => specifiers - .iter() - .map(|s| self.get_extended_tsconfig_path(&directory, tsconfig, s)) - .collect::, ResolveError>>()?, - }; - for extended_tsconfig_path in extended_tsconfig_paths { - let extended_tsconfig = self.load_tsconfig( - /* root */ false, - &extended_tsconfig_path, - &TsconfigReferences::Disabled, - )?; - tsconfig.extend_tsconfig(&extended_tsconfig); - } - } - - // Load project references - match references { - TsconfigReferences::Disabled => { - tsconfig.references.drain(..); - } - TsconfigReferences::Auto => {} - TsconfigReferences::Paths(paths) => { - tsconfig.references = paths - .iter() - .map(|path| ProjectReference { path: path.clone(), tsconfig: None }) - .collect(); - } - } - if !tsconfig.references.is_empty() { - let directory = tsconfig.directory().to_path_buf(); - for reference in &mut tsconfig.references { - let reference_tsconfig_path = directory.normalize_with(&reference.path); - let tsconfig = self.cache.tsconfig( - /* root */ true, - &reference_tsconfig_path, - |reference_tsconfig| { - if reference_tsconfig.path == tsconfig.path { - return Err(ResolveError::TsconfigSelfReference( - reference_tsconfig.path.clone(), - )); - } - Ok(()) - }, - )?; - reference.tsconfig.replace(tsconfig); - } - } - Ok(()) - }) - } - - fn get_extended_tsconfig_path( - &self, - directory: &CachedPath, - tsconfig: &TsConfig, - specifier: &str, - ) -> Result { - match specifier.as_bytes().first() { - None => Err(ResolveError::Specifier(SpecifierError::Empty(specifier.to_string()))), - Some(b'/') => Ok(PathBuf::from(specifier)), - Some(b'.') => Ok(tsconfig.directory().normalize_with(specifier)), - _ => self - .clone_with_options(ResolveOptions { - description_files: vec![], - extensions: vec![".json".into()], - main_files: vec!["tsconfig.json".into()], - ..ResolveOptions::default() - }) - .load_package_self_or_node_modules(directory, specifier, &mut Ctx::default()) - .map(|p| p.to_path_buf()) - .map_err(|err| match err { - ResolveError::NotFound(_) => { - ResolveError::TsconfigNotFound(PathBuf::from(specifier)) - } - _ => err, - }), - } - } - - /// PACKAGE_RESOLVE(packageSpecifier, parentURL) - fn package_resolve( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - let (package_name, subpath) = Self::parse_package_specifier(specifier); - - // 3. If packageSpecifier is a Node.js builtin module name, then - // 1. Return the string "node:" concatenated with packageSpecifier. - self.require_core(package_name)?; - - // 11. While parentURL is not the file system root, - for module_name in &self.options.modules { - for cached_path in std::iter::successors(Some(cached_path), |p| p.parent()) { - // 1. Let packageURL be the URL resolution of "node_modules/" concatenated with packageSpecifier, relative to parentURL. - let Some(cached_path) = self.get_module_directory(cached_path, module_name, ctx) - else { - continue; - }; - // 2. Set parentURL to the parent folder URL of parentURL. - let package_path = cached_path.path().normalize_with(package_name); - let cached_path = self.cache.value(&package_path); - // 3. If the folder at packageURL does not exist, then - // 1. Continue the next loop iteration. - if cached_path.is_dir(&self.cache.fs, ctx) { - // 4. Let pjson be the result of READ_PACKAGE_JSON(packageURL). - if let Some(package_json) = - cached_path.package_json(&self.cache.fs, &self.options, ctx)? - { - // 5. If pjson is not null and pjson.exports is not null or undefined, then - // 1. Return the result of PACKAGE_EXPORTS_RESOLVE(packageURL, packageSubpath, pjson.exports, defaultConditions). - for exports in package_json.exports_fields(&self.options.exports_fields) { - if let Some(path) = self.package_exports_resolve( - cached_path.path(), - &format!(".{subpath}"), - exports, - ctx, - )? { - return Ok(Some(path)); - } - } - // 6. Otherwise, if packageSubpath is equal to ".", then - if subpath == "." { - // 1. If pjson.main is a string, then - for main_field in package_json.main_fields(&self.options.main_fields) { - // 1. Return the URL resolution of main in packageURL. - let path = cached_path.path().normalize_with(main_field); - let cached_path = self.cache.value(&path); - if cached_path.is_file(&self.cache.fs, ctx) { - return Ok(Some(cached_path)); - } - } - } - } - let subpath = format!(".{subpath}"); - ctx.with_fully_specified(false); - return self.require(&cached_path, &subpath, ctx).map(Some); - } - } - } - - Err(ResolveError::NotFound(specifier.to_string())) - } - - /// PACKAGE_EXPORTS_RESOLVE(packageURL, subpath, exports, conditions) - fn package_exports_resolve( - &self, - package_url: &Path, - subpath: &str, - exports: &JSONValue, - ctx: &mut Ctx, - ) -> ResolveResult { - let conditions = &self.options.condition_names; - // 1. If exports is an Object with both a key starting with "." and a key not starting with ".", throw an Invalid Package Configuration error. - if let JSONValue::Object(map) = exports { - let mut has_dot = false; - let mut without_dot = false; - for key in map.keys() { - let starts_with_dot_or_hash = key.starts_with(['.', '#']); - has_dot = has_dot || starts_with_dot_or_hash; - without_dot = without_dot || !starts_with_dot_or_hash; - if has_dot && without_dot { - return Err(ResolveError::InvalidPackageConfig( - package_url.join("package.json"), - )); - } - } - } - // 2. If subpath is equal to ".", then - // Note: subpath is not prepended with a dot when passed in. - if subpath == "." { - // enhanced-resolve appends query and fragment when resolving exports field - // https://github.com/webpack/enhanced-resolve/blob/a998c7d218b7a9ec2461fc4fddd1ad5dd7687485/lib/ExportsFieldPlugin.js#L57-L62 - // This is only need when querying the main export, otherwise ctx is passed through. - if ctx.query.is_some() || ctx.fragment.is_some() { - let query = ctx.query.clone().unwrap_or_default(); - let fragment = ctx.fragment.clone().unwrap_or_default(); - return Err(ResolveError::PackagePathNotExported( - format!("./{}{query}{fragment}", subpath.trim_start_matches('.')), - package_url.join("package.json"), - )); - } - // 1. Let mainExport be undefined. - let main_export = match exports { - // 2. If exports is a String or Array, or an Object containing no keys starting with ".", then - JSONValue::String(_) | JSONValue::Array(_) => { - // 1. Set mainExport to exports. - Some(exports) - } - // 3. Otherwise if exports is an Object containing a "." property, then - JSONValue::Object(map) => { - // 1. Set mainExport to exports["."]. - map.get(".").map_or_else( - || { - if map.keys().any(|key| key.starts_with("./") || key.starts_with('#')) { - None - } else { - Some(exports) - } - }, - Some, - ) - } - _ => None, - }; - // 4. If mainExport is not undefined, then - if let Some(main_export) = main_export { - // 1. Let resolved be the result of PACKAGE_TARGET_RESOLVE( packageURL, mainExport, null, false, conditions). - let resolved = self.package_target_resolve( - package_url, - ".", - main_export, - None, - /* is_imports */ false, - conditions, - ctx, - )?; - // 2. If resolved is not null or undefined, return resolved. - if let Some(path) = resolved { - return Ok(Some(path)); - } - } - } - // 3. Otherwise, if exports is an Object and all keys of exports start with ".", then - if let JSONValue::Object(exports) = exports { - // 1. Let matchKey be the string "./" concatenated with subpath. - // Note: `package_imports_exports_resolve` does not require the leading dot. - let match_key = &subpath; - // 2. Let resolved be the result of PACKAGE_IMPORTS_EXPORTS_RESOLVE( matchKey, exports, packageURL, false, conditions). - if let Some(path) = self.package_imports_exports_resolve( - match_key, - exports, - package_url, - /* is_imports */ false, - conditions, - ctx, - )? { - // 3. If resolved is not null or undefined, return resolved. - return Ok(Some(path)); - } - } - // 4. Throw a Package Path Not Exported error. - Err(ResolveError::PackagePathNotExported( - subpath.to_string(), - package_url.join("package.json"), - )) - } - - /// PACKAGE_IMPORTS_RESOLVE(specifier, parentURL, conditions) - fn package_imports_resolve( - &self, - specifier: &str, - package_json: &PackageJson, - ctx: &mut Ctx, - ) -> Result, ResolveError> { - // 1. Assert: specifier begins with "#". - debug_assert!(specifier.starts_with('#'), "{specifier}"); - // 2. If specifier is exactly equal to "#" or starts with "#/", then - // 1. Throw an Invalid Module Specifier error. - // 3. Let packageURL be the result of LOOKUP_PACKAGE_SCOPE(parentURL). - // 4. If packageURL is not null, then - - // 1. Let pjson be the result of READ_PACKAGE_JSON(packageURL). - // 2. If pjson.imports is a non-null Object, then - - // 1. Let resolved be the result of PACKAGE_IMPORTS_EXPORTS_RESOLVE( specifier, pjson.imports, packageURL, true, conditions). - let mut has_imports = false; - for imports in package_json.imports_fields(&self.options.imports_fields) { - if !has_imports { - has_imports = true; - // TODO: fill in test case for this case - if specifier == "#" || specifier.starts_with("#/") { - return Err(ResolveError::InvalidModuleSpecifier( - specifier.to_string(), - package_json.path.clone(), - )); - } - } - if let Some(path) = self.package_imports_exports_resolve( - specifier, - imports, - package_json.directory(), - /* is_imports */ true, - &self.options.condition_names, - ctx, - )? { - // 2. If resolved is not null or undefined, return resolved. - return Ok(Some(path)); - } - } - - // 5. Throw a Package Import Not Defined error. - if has_imports { - Err(ResolveError::PackageImportNotDefined( - specifier.to_string(), - package_json.path.clone(), - )) - } else { - Ok(None) - } - } - - /// PACKAGE_IMPORTS_EXPORTS_RESOLVE(matchKey, matchObj, packageURL, isImports, conditions) - fn package_imports_exports_resolve( - &self, - match_key: &str, - match_obj: &JSONMap, - package_url: &Path, - is_imports: bool, - conditions: &[String], - ctx: &mut Ctx, - ) -> ResolveResult { - // enhanced-resolve behaves differently, it throws - // Error: CachedPath to directories is not possible with the exports field (specifier was ./dist/) - if match_key.ends_with('/') { - return Ok(None); - } - // 1. If matchKey is a key of matchObj and does not contain "*", then - if !match_key.contains('*') { - // 1. Let target be the value of matchObj[matchKey]. - if let Some(target) = match_obj.get(match_key) { - // 2. Return the result of PACKAGE_TARGET_RESOLVE(packageURL, target, null, isImports, conditions). - return self.package_target_resolve( - package_url, - match_key, - target, - None, - is_imports, - conditions, - ctx, - ); - } - } - - let mut best_target = None; - let mut best_match = ""; - let mut best_key = ""; - // 2. Let expansionKeys be the list of keys of matchObj containing only a single "*", sorted by the sorting function PATTERN_KEY_COMPARE which orders in descending order of specificity. - // 3. For each key expansionKey in expansionKeys, do - for (expansion_key, target) in match_obj { - if expansion_key.starts_with("./") || expansion_key.starts_with('#') { - // 1. Let patternBase be the substring of expansionKey up to but excluding the first "*" character. - if let Some((pattern_base, pattern_trailer)) = expansion_key.split_once('*') { - // 2. If matchKey starts with but is not equal to patternBase, then - if match_key.starts_with(pattern_base) - // 1. Let patternTrailer be the substring of expansionKey from the index after the first "*" character. - && !pattern_trailer.contains('*') - // 2. If patternTrailer has zero length, or if matchKey ends with patternTrailer and the length of matchKey is greater than or equal to the length of expansionKey, then - && (pattern_trailer.is_empty() - || (match_key.len() >= expansion_key.len() - && match_key.ends_with(pattern_trailer))) - && Self::pattern_key_compare(best_key, expansion_key).is_gt() - { - // 1. Let target be the value of matchObj[expansionKey]. - best_target = Some(target); - // 2. Let patternMatch be the substring of matchKey starting at the index of the length of patternBase up to the length of matchKey minus the length of patternTrailer. - best_match = - &match_key[pattern_base.len()..match_key.len() - pattern_trailer.len()]; - best_key = expansion_key; - } - } else if expansion_key.ends_with('/') - && match_key.starts_with(expansion_key) - && Self::pattern_key_compare(best_key, expansion_key).is_gt() - { - // TODO: [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./dist/" in the "exports" field module resolution of the package at xxx/package.json. - best_target = Some(target); - best_match = &match_key[expansion_key.len()..]; - best_key = expansion_key; - } - } - } - if let Some(best_target) = best_target { - // 3. Return the result of PACKAGE_TARGET_RESOLVE(packageURL, target, patternMatch, isImports, conditions). - return self.package_target_resolve( - package_url, - best_key, - best_target, - Some(best_match), - is_imports, - conditions, - ctx, - ); - } - // 4. Return null. - Ok(None) - } - - /// PACKAGE_TARGET_RESOLVE(packageURL, target, patternMatch, isImports, conditions) - #[allow(clippy::too_many_arguments)] - fn package_target_resolve( - &self, - package_url: &Path, - target_key: &str, - target: &JSONValue, - pattern_match: Option<&str>, - is_imports: bool, - conditions: &[String], - ctx: &mut Ctx, - ) -> ResolveResult { - fn normalize_string_target<'a>( - target_key: &'a str, - target: &'a str, - pattern_match: Option<&'a str>, - package_url: &Path, - ) -> Result, ResolveError> { - let target = if let Some(pattern_match) = pattern_match { - if !target_key.contains('*') && !target.contains('*') { - // enhanced-resolve behaviour - // TODO: [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./dist/" in the "exports" field module resolution of the package at xxx/package.json. - if target_key.ends_with('/') && target.ends_with('/') { - Cow::Owned(format!("{target}{pattern_match}")) - } else { - return Err(ResolveError::InvalidPackageConfigDirectory( - package_url.join("package.json"), - )); - } - } else { - Cow::Owned(target.replace('*', pattern_match)) - } - } else { - Cow::Borrowed(target) - }; - Ok(target) - } - - match target { - // 1. If target is a String, then - JSONValue::String(target) => { - // 1. If target does not start with "./", then - if !target.starts_with("./") { - // 1. If isImports is false, or if target starts with "../" or "/", or if target is a valid URL, then - if !is_imports || target.starts_with("../") || target.starts_with('/') { - // 1. Throw an Invalid Package Target error. - return Err(ResolveError::InvalidPackageTarget( - target.to_string(), - target_key.to_string(), - package_url.join("package.json"), - )); - } - // 2. If patternMatch is a String, then - // 1. Return PACKAGE_RESOLVE(target with every instance of "*" replaced by patternMatch, packageURL + "/"). - let target = - normalize_string_target(target_key, target, pattern_match, package_url)?; - let package_url = self.cache.value(package_url); - // // 3. Return PACKAGE_RESOLVE(target, packageURL + "/"). - return self.package_resolve(&package_url, &target, ctx); - } - - // 2. If target split on "/" or "\" contains any "", ".", "..", or "node_modules" segments after the first "." segment, case insensitive and including percent encoded variants, throw an Invalid Package Target error. - // 3. Let resolvedTarget be the URL resolution of the concatenation of packageURL and target. - // 4. Assert: resolvedTarget is contained in packageURL. - // 5. If patternMatch is null, then - let target = - normalize_string_target(target_key, target, pattern_match, package_url)?; - if Path::new(target.as_ref()).is_invalid_exports_target() { - return Err(ResolveError::InvalidPackageTarget( - target.to_string(), - target_key.to_string(), - package_url.join("package.json"), - )); - } - let resolved_target = package_url.normalize_with(target.as_ref()); - // 6. If patternMatch split on "/" or "\" contains any "", ".", "..", or "node_modules" segments, case insensitive and including percent encoded variants, throw an Invalid Module Specifier error. - // 7. Return the URL resolution of resolvedTarget with every instance of "*" replaced with patternMatch. - let value = self.cache.value(&resolved_target); - return Ok(Some(value)); - } - // 2. Otherwise, if target is a non-null Object, then - JSONValue::Object(target) => { - // 1. If exports contains any index property keys, as defined in ECMA-262 6.1.7 Array Index, throw an Invalid Package Configuration error. - // 2. For each property p of target, in object insertion order as, - for (key, target_value) in target { - // 1. If p equals "default" or conditions contains an entry for p, then - if key == "default" || conditions.contains(key) { - // 1. Let targetValue be the value of the p property in target. - // 2. Let resolved be the result of PACKAGE_TARGET_RESOLVE( packageURL, targetValue, patternMatch, isImports, conditions). - let resolved = self.package_target_resolve( - package_url, - target_key, - target_value, - pattern_match, - is_imports, - conditions, - ctx, - ); - // 3. If resolved is equal to undefined, continue the loop. - if let Some(path) = resolved? { - // 4. Return resolved. - return Ok(Some(path)); - } - } - } - // 3. Return undefined. - return Ok(None); - } - // 3. Otherwise, if target is an Array, then - JSONValue::Array(targets) => { - // 1. If _target.length is zero, return null. - if targets.is_empty() { - // Note: return PackagePathNotExported has the same effect as return because there are no matches. - return Err(ResolveError::PackagePathNotExported( - pattern_match.unwrap_or(".").to_string(), - package_url.join("package.json"), - )); - } - // 2. For each item targetValue in target, do - for (i, target_value) in targets.iter().enumerate() { - // 1. Let resolved be the result of PACKAGE_TARGET_RESOLVE( packageURL, targetValue, patternMatch, isImports, conditions), continuing the loop on any Invalid Package Target error. - let resolved = self.package_target_resolve( - package_url, - target_key, - target_value, - pattern_match, - is_imports, - conditions, - ctx, - ); - - if resolved.is_err() && i == targets.len() { - return resolved; - } - - // 2. If resolved is undefined, continue the loop. - if let Ok(Some(path)) = resolved { - // 3. Return resolved. - return Ok(Some(path)); - } - } - // 3. Return or throw the last fallback resolution null return or error. - // Note: see `resolved.is_err() && i == targets.len()` - } - _ => {} - } - // 4. Otherwise, if target is null, return null. - Ok(None) - // 5. Otherwise throw an Invalid Package Target error. - } - - // Returns (module, subpath) - // https://github.com/nodejs/node/blob/8f0f17e1e3b6c4e58ce748e06343c5304062c491/lib/internal/modules/esm/resolve.js#L688 - fn parse_package_specifier(specifier: &str) -> (&str, &str) { - let mut separator_index = specifier.as_bytes().iter().position(|b| *b == b'/'); - // let mut valid_package_name = true; - // let mut is_scoped = false; - if specifier.starts_with('@') { - // is_scoped = true; - if separator_index.is_none() || specifier.is_empty() { - // valid_package_name = false; - } else if let Some(index) = &separator_index { - separator_index = specifier[*index + 1..] - .as_bytes() - .iter() - .position(|b| *b == b'/') - .map(|i| i + *index + 1); - } - } - let package_name = - separator_index.map_or(specifier, |separator_index| &specifier[..separator_index]); - - // TODO: https://github.com/nodejs/node/blob/8f0f17e1e3b6c4e58ce748e06343c5304062c491/lib/internal/modules/esm/resolve.js#L705C1-L714C1 - // Package name cannot have leading . and cannot have percent-encoding or - // \\ separators. - // if (RegExpPrototypeExec(invalidPackageNameRegEx, packageName) !== null) - // validPackageName = false; - - // if (!validPackageName) { - // throw new ERR_INVALID_MODULE_SPECIFIER( - // specifier, 'is not a valid package name', fileURLToPath(base)); - // } - let package_subpath = - separator_index.map_or("", |separator_index| &specifier[separator_index..]); - (package_name, package_subpath) - } - - /// PATTERN_KEY_COMPARE(keyA, keyB) - fn pattern_key_compare(key_a: &str, key_b: &str) -> Ordering { - if key_a.is_empty() { - return Ordering::Greater; - } - // 1. Assert: keyA ends with "/" or contains only a single "*". - debug_assert!(key_a.ends_with('/') || key_a.match_indices('*').count() == 1, "{key_a}"); - // 2. Assert: keyB ends with "/" or contains only a single "*". - debug_assert!(key_b.ends_with('/') || key_b.match_indices('*').count() == 1, "{key_b}"); - // 3. Let baseLengthA be the index of "*" in keyA plus one, if keyA contains "*", or the length of keyA otherwise. - let a_pos = key_a.chars().position(|c| c == '*'); - let base_length_a = a_pos.map_or(key_a.len(), |p| p + 1); - // 4. Let baseLengthB be the index of "*" in keyB plus one, if keyB contains "*", or the length of keyB otherwise. - let b_pos = key_b.chars().position(|c| c == '*'); - let base_length_b = b_pos.map_or(key_b.len(), |p| p + 1); - // 5. If baseLengthA is greater than baseLengthB, return -1. - if base_length_a > base_length_b { - return Ordering::Less; - } - // 6. If baseLengthB is greater than baseLengthA, return 1. - if base_length_b > base_length_a { - return Ordering::Greater; - } - // 7. If keyA does not contain "*", return 1. - if !key_a.contains('*') { - return Ordering::Greater; - } - // 8. If keyB does not contain "*", return -1. - if !key_b.contains('*') { - return Ordering::Less; - } - // 9. If the length of keyA is greater than the length of keyB, return -1. - if key_a.len() > key_b.len() { - return Ordering::Less; - } - // 10. If the length of keyB is greater than the length of keyA, return 1. - if key_b.len() > key_a.len() { - return Ordering::Greater; - } - // 11. Return 0. - Ordering::Equal - } - - fn strip_package_name<'a>(specifier: &'a str, package_name: &'a str) -> Option<&'a str> { - specifier - .strip_prefix(package_name) - .filter(|tail| tail.is_empty() || tail.starts_with(SLASH_START)) - } -} diff --git a/src/options.rs b/src/options.rs deleted file mode 100644 index 7893890e..00000000 --- a/src/options.rs +++ /dev/null @@ -1,633 +0,0 @@ -use std::path::Path; -use std::{fmt, path::PathBuf}; - -/// Module Resolution Options -/// -/// Options are directly ported from [enhanced-resolve](https://github.com/webpack/enhanced-resolve#resolver-options). -/// -/// See [webpack resolve](https://webpack.js.org/configuration/resolve/) for information and examples -#[derive(Debug, Clone)] -pub struct ResolveOptions { - /// Path to TypeScript configuration file. - /// - /// Default `None` - pub tsconfig: Option, - - /// Create aliases to import or require certain modules more easily. - /// - /// An alias is used to replace a whole path or part of a path. - /// For example, to alias a commonly used `src/` folders: `vec![("@/src"), vec![AliasValue::Path("/path/to/src")]]` - /// - /// A trailing $ can also be added to the given object's keys to signify an exact match. - /// - /// See [webpack's `resolve.alias` documentation](https://webpack.js.org/configuration/resolve/#resolvealias) for a list of use cases. - pub alias: Alias, - - /// A list of alias fields in description files. - /// - /// Specify a field, such as `browser`, to be parsed according to [this specification](https://github.com/defunctzombie/package-browser-field-spec). - /// Can be a path to json object such as `["path", "to", "exports"]`. - /// - /// Default `[]` - pub alias_fields: Vec>, - - /// Condition names for exports field which defines entry points of a package. - /// - /// The key order in the exports field is significant. During condition matching, earlier entries have higher priority and take precedence over later entries. - /// - /// Default `[]` - pub condition_names: Vec, - - /// The JSON files to use for descriptions. (There was once a `bower.json`.) - /// - /// Default `["package.json"]` - pub description_files: Vec, - - /// Set to [EnforceExtension::Enabled] for [ESM Mandatory file extensions](https://nodejs.org/api/esm.html#mandatory-file-extensions). - /// - /// If `enforce_extension` is set to [EnforceExtension::Enabled], resolution will not allow extension-less files. - /// This means `require('./foo.js')` will resolve, while `require('./foo')` will not. - /// - /// The default value for `enforce_extension` is [EnforceExtension::Auto], which is changed upon initialization. - /// - /// It changes to [EnforceExtension::Enabled] if [ResolveOptions::extensions] contains an empty string; - /// otherwise, this value changes to [EnforceExtension::Disabled]. - /// - /// Explicitly set the value to [EnforceExtension::Disabled] to disable this automatic behavior. - /// - /// For reference, this behavior is aligned with `enhanced-resolve`. See . - pub enforce_extension: EnforceExtension, - - /// A list of exports fields in description files. - /// - /// Can be a path to a JSON object such as `["path", "to", "exports"]`. - /// - /// Default `[["exports"]]`. - pub exports_fields: Vec>, - - /// Fields from `package.json` which are used to provide the internal requests of a package - /// (requests starting with # are considered internal). - /// - /// Can be a path to a JSON object such as `["path", "to", "imports"]`. - /// - /// Default `[["imports"]]`. - pub imports_fields: Vec>, - - /// An object which maps extension to extension aliases. - /// - /// Default `{}` - pub extension_alias: Vec<(String, Vec)>, - - /// Attempt to resolve these extensions in order. - /// - /// If multiple files share the same name but have different extensions, - /// will resolve the one with the extension listed first in the array and skip the rest. - /// - /// All extensions must have a leading dot. - /// - /// Default `[".js", ".json", ".node"]` - pub extensions: Vec, - - /// Redirect module requests when normal resolving fails. - /// - /// Default `[]` - pub fallback: Alias, - - /// 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). - /// - /// See also webpack configuration [resolve.fullySpecified](https://webpack.js.org/configuration/module/#resolvefullyspecified) - /// - /// Default `false` - pub fully_specified: bool, - - /// A list of main fields in description files - /// - /// Default `["main"]`. - pub main_fields: Vec, - - /// The filename to be used while resolving directories. - /// - /// Default `["index"]` - pub main_files: Vec, - - /// A list of directories to resolve modules from, can be absolute path or folder name. - /// - /// Default `["node_modules"]` - pub modules: Vec, - - /// A manifest loaded from pnp::load_pnp_manifest. - /// - /// Default `None` - #[cfg(feature = "yarn_pnp")] - pub pnp_manifest: Option, - - /// Resolve to a context instead of a file. - /// - /// Default `false` - pub resolve_to_context: bool, - - /// Prefer to resolve module requests as relative requests instead of using modules from node_modules directories. - /// - /// Default `false` - pub prefer_relative: bool, - - /// Prefer to resolve server-relative urls as absolute paths before falling back to resolve in ResolveOptions::roots. - /// - /// Default `false` - pub prefer_absolute: bool, - - /// A list of resolve restrictions to restrict the paths that a request can be resolved on. - /// - /// Default `[]` - pub restrictions: Vec, - - /// A list of directories where requests of server-relative URLs (starting with '/') are resolved. - /// On non-Windows systems these requests are resolved as an absolute path first. - /// - /// Default `[]` - pub roots: Vec, - - /// Whether to resolve symlinks to their symlinked location. - /// When enabled, symlinked resources are resolved to their real path, not their symlinked location. - /// Note that this may cause module resolution to fail when using tools that symlink packages (like npm link). - /// - /// Default `true` - pub symlinks: bool, - - /// Whether to parse [module.builtinModules](https://nodejs.org/api/module.html#modulebuiltinmodules) or not. - /// For example, "zlib" will throw [crate::ResolveError::Builtin] when set to true. - /// - /// Default `false` - pub builtin_modules: bool, -} - -impl ResolveOptions { - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// - /// let options = ResolveOptions::default().with_condition_names(&["bar"]); - /// assert_eq!(options.condition_names, vec!["bar".to_string()]) - /// ``` - #[must_use] - pub fn with_condition_names(mut self, names: &[&str]) -> Self { - self.condition_names = names.iter().map(ToString::to_string).collect::>(); - self - } - - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// - /// let options = ResolveOptions::default().with_builtin_modules(false); - /// assert_eq!(options.builtin_modules, false) - /// ``` - #[must_use] - pub fn with_builtin_modules(mut self, flag: bool) -> Self { - self.builtin_modules = flag; - self - } - - /// Adds a single root to the options - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_root("foo"); - /// assert_eq!(options.roots, vec![PathBuf::from("foo")]) - /// ``` - #[must_use] - pub fn with_root>(mut self, root: P) -> Self { - self.roots.push(root.as_ref().to_path_buf()); - self - } - - /// Adds a single extension to the list of extensions - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_extension("jsonc"); - /// assert!(options.extensions.contains(&"jsonc".to_string())); - /// ``` - #[must_use] - pub fn with_extension>(mut self, extension: S) -> Self { - self.extensions.push(extension.into()); - self - } - - /// Adds a single main field to the list of fields - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_main_field("something"); - /// assert!(options.main_fields.contains(&"something".to_string())); - /// ``` - #[must_use] - pub fn with_main_field>(mut self, field: S) -> Self { - self.main_fields.push(field.into()); - self - } - - /// Changes how the extension should be treated - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions, EnforceExtension}; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_force_extension(EnforceExtension::Enabled); - /// assert_eq!(options.enforce_extension, EnforceExtension::Enabled); - /// ``` - #[must_use] - pub fn with_force_extension(mut self, enforce_extension: EnforceExtension) -> Self { - self.enforce_extension = enforce_extension; - self - } - - /// Sets the value for [ResolveOptions::fully_specified] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_fully_specified(true); - /// assert_eq!(options.fully_specified, true); - /// ``` - #[must_use] - pub fn with_fully_specified(mut self, fully_specified: bool) -> Self { - self.fully_specified = fully_specified; - self - } - /// Sets the value for [ResolveOptions::prefer_relative] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_prefer_relative(true); - /// assert_eq!(options.prefer_relative, true); - /// ``` - #[must_use] - pub fn with_prefer_relative(mut self, flag: bool) -> Self { - self.prefer_relative = flag; - self - } - /// Sets the value for [ResolveOptions::prefer_absolute] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_prefer_absolute(true); - /// assert_eq!(options.prefer_absolute, true); - /// ``` - #[must_use] - pub fn with_prefer_absolute(mut self, flag: bool) -> Self { - self.prefer_absolute = flag; - self - } - - /// Changes the value of [ResolveOptions::symlinks] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// - /// let options = ResolveOptions::default().with_symbolic_link(false); - /// assert_eq!(options.symlinks, false); - /// ``` - #[must_use] - pub fn with_symbolic_link(mut self, flag: bool) -> Self { - self.symlinks = flag; - self - } - - /// Adds a module to [ResolveOptions::modules] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// - /// let options = ResolveOptions::default().with_module("module"); - /// assert!(options.modules.contains(&"module".to_string())); - /// ``` - #[must_use] - pub fn with_module>(mut self, module: M) -> Self { - self.modules.push(module.into()); - self - } - - /// Adds a main file to [ResolveOptions::main_files] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// - /// let options = ResolveOptions::default().with_main_file("foo"); - /// assert!(options.main_files.contains(&"foo".to_string())); - /// ``` - #[must_use] - pub fn with_main_file>(mut self, module: M) -> Self { - self.main_files.push(module.into()); - self - } - - pub(crate) fn sanitize(mut self) -> Self { - debug_assert!( - self.extensions.iter().filter(|e| !e.is_empty()).all(|e| e.starts_with('.')), - "All extensions must start with a leading dot" - ); - // Set `enforceExtension` to `true` when [ResolveOptions::extensions] contains an empty string. - // See - if self.enforce_extension == EnforceExtension::Auto { - if !self.extensions.is_empty() && self.extensions.iter().any(String::is_empty) { - self.enforce_extension = EnforceExtension::Enabled; - } else { - self.enforce_extension = EnforceExtension::Disabled; - } - } - self - } -} - -/// Value for [ResolveOptions::enforce_extension] -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -pub enum EnforceExtension { - Auto, - Enabled, - Disabled, -} - -impl EnforceExtension { - pub const fn is_auto(&self) -> bool { - matches!(self, Self::Auto) - } - - pub const fn is_enabled(&self) -> bool { - matches!(self, Self::Enabled) - } - - pub const fn is_disabled(&self) -> bool { - matches!(self, Self::Disabled) - } -} - -/// Alias for [ResolveOptions::alias] and [ResolveOptions::fallback] -pub type Alias = Vec<(String, Vec)>; - -/// Alias Value for [ResolveOptions::alias] and [ResolveOptions::fallback] -#[derive(Debug, Clone, Hash, PartialEq, Eq)] -pub enum AliasValue { - /// The path value - Path(String), - - /// The `false` value - Ignore, -} - -impl From for AliasValue -where - S: Into, -{ - fn from(value: S) -> Self { - Self::Path(value.into()) - } -} - -/// Value for [ResolveOptions::restrictions] -#[derive(Debug, Clone)] -pub enum Restriction { - Path(PathBuf), - RegExp(String), -} - -/// Tsconfig Options for [ResolveOptions::tsconfig] -/// -/// Derived from [tsconfig-paths-webpack-plugin](https://github.com/dividab/tsconfig-paths-webpack-plugin#options) -#[derive(Debug, Clone)] -pub struct TsconfigOptions { - /// Allows you to specify where to find the TypeScript configuration file. - /// You may provide - /// * a relative path to the configuration file. It will be resolved relative to cwd. - /// * an absolute path to the configuration file. - pub config_file: PathBuf, - - /// Support for Typescript Project References. - pub references: TsconfigReferences, -} - -/// Configuration for [TsconfigOptions::references] -#[derive(Debug, Clone)] -pub enum TsconfigReferences { - Disabled, - /// Use the `references` field from tsconfig of `config_file`. - Auto, - /// Manually provided relative or absolute path. - Paths(Vec), -} - -impl Default for ResolveOptions { - fn default() -> Self { - Self { - tsconfig: None, - alias: vec![], - alias_fields: vec![], - condition_names: vec![], - description_files: vec!["package.json".into()], - enforce_extension: EnforceExtension::Auto, - extension_alias: vec![], - exports_fields: vec![vec!["exports".into()]], - imports_fields: vec![vec!["imports".into()]], - extensions: vec![".js".into(), ".json".into(), ".node".into()], - fallback: vec![], - fully_specified: false, - main_fields: vec!["main".into()], - main_files: vec!["index".into()], - modules: vec!["node_modules".into()], - #[cfg(feature = "yarn_pnp")] - pnp_manifest: None, - resolve_to_context: false, - prefer_relative: false, - prefer_absolute: false, - restrictions: vec![], - roots: vec![], - symlinks: true, - builtin_modules: false, - } - } -} - -// For tracing -impl fmt::Display for ResolveOptions { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - if let Some(tsconfig) = &self.tsconfig { - write!(f, "tsconfig:{tsconfig:?},")?; - } - if !self.alias.is_empty() { - write!(f, "alias:{:?},", self.alias)?; - } - if !self.alias_fields.is_empty() { - write!(f, "alias_fields:{:?},", self.alias_fields)?; - } - if !self.condition_names.is_empty() { - write!(f, "condition_names:{:?},", self.condition_names)?; - } - if self.enforce_extension.is_enabled() { - write!(f, "enforce_extension:{:?},", self.enforce_extension)?; - } - if !self.exports_fields.is_empty() { - write!(f, "exports_fields:{:?},", self.exports_fields)?; - } - if !self.imports_fields.is_empty() { - write!(f, "imports_fields:{:?},", self.imports_fields)?; - } - if !self.extension_alias.is_empty() { - write!(f, "extension_alias:{:?},", self.extension_alias)?; - } - if !self.extensions.is_empty() { - write!(f, "extensions:{:?},", self.extensions)?; - } - if !self.fallback.is_empty() { - write!(f, "fallback:{:?},", self.fallback)?; - } - if self.fully_specified { - write!(f, "fully_specified:{:?},", self.fully_specified)?; - } - if !self.main_fields.is_empty() { - write!(f, "main_fields:{:?},", self.main_fields)?; - } - if !self.main_files.is_empty() { - write!(f, "main_files:{:?},", self.main_files)?; - } - if !self.modules.is_empty() { - write!(f, "modules:{:?},", self.modules)?; - } - if self.resolve_to_context { - write!(f, "resolve_to_context:{:?},", self.resolve_to_context)?; - } - if self.prefer_relative { - write!(f, "prefer_relative:{:?},", self.prefer_relative)?; - } - if self.prefer_absolute { - write!(f, "prefer_absolute:{:?},", self.prefer_absolute)?; - } - if !self.restrictions.is_empty() { - write!(f, "restrictions:{:?},", self.restrictions)?; - } - if !self.roots.is_empty() { - write!(f, "roots:{:?},", self.roots)?; - } - if self.symlinks { - write!(f, "symlinks:{:?},", self.symlinks)?; - } - if self.builtin_modules { - write!(f, "builtin_modules:{:?},", self.builtin_modules)?; - } - Ok(()) - } -} - -#[cfg(test)] -mod test { - use super::{ - AliasValue, EnforceExtension, ResolveOptions, Restriction, TsconfigOptions, - TsconfigReferences, - }; - use std::path::PathBuf; - - #[test] - fn enforce_extension() { - assert!(EnforceExtension::Auto.is_auto()); - assert!(!EnforceExtension::Enabled.is_auto()); - assert!(!EnforceExtension::Disabled.is_auto()); - - assert!(!EnforceExtension::Auto.is_enabled()); - assert!(EnforceExtension::Enabled.is_enabled()); - assert!(!EnforceExtension::Disabled.is_enabled()); - - assert!(!EnforceExtension::Auto.is_disabled()); - assert!(!EnforceExtension::Enabled.is_disabled()); - assert!(EnforceExtension::Disabled.is_disabled()); - } - - #[test] - fn display() { - let options = ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: PathBuf::from("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - alias: vec![("a".into(), vec![AliasValue::Ignore])], - alias_fields: vec![vec!["browser".into()]], - condition_names: vec!["require".into()], - enforce_extension: EnforceExtension::Enabled, - extension_alias: vec![(".js".into(), vec![".ts".into()])], - exports_fields: vec![vec!["exports".into()]], - imports_fields: vec![vec!["imports".into()]], - fallback: vec![("fallback".into(), vec![AliasValue::Ignore])], - fully_specified: true, - resolve_to_context: true, - prefer_relative: true, - prefer_absolute: true, - restrictions: vec![Restriction::Path(PathBuf::from("restrictions"))], - roots: vec![PathBuf::from("roots")], - builtin_modules: true, - ..ResolveOptions::default() - }; - - let expected = r#"tsconfig:TsconfigOptions { config_file: "tsconfig.json", references: Auto },alias:[("a", [Ignore])],alias_fields:[["browser"]],condition_names:["require"],enforce_extension:Enabled,exports_fields:[["exports"]],imports_fields:[["imports"]],extension_alias:[(".js", [".ts"])],extensions:[".js", ".json", ".node"],fallback:[("fallback", [Ignore])],fully_specified:true,main_fields:["main"],main_files:["index"],modules:["node_modules"],resolve_to_context:true,prefer_relative:true,prefer_absolute:true,restrictions:[Path("restrictions")],roots:["roots"],symlinks:true,builtin_modules:true,"#; - assert_eq!(format!("{options}"), expected); - - let options = ResolveOptions { - alias: vec![], - alias_fields: vec![], - builtin_modules: false, - condition_names: vec![], - description_files: vec![], - enforce_extension: EnforceExtension::Disabled, - exports_fields: vec![], - extension_alias: vec![], - extensions: vec![], - fallback: vec![], - fully_specified: false, - imports_fields: vec![], - main_fields: vec![], - main_files: vec![], - modules: vec![], - #[cfg(feature = "yarn_pnp")] - pnp_manifest: None, - prefer_absolute: false, - prefer_relative: false, - resolve_to_context: false, - restrictions: vec![], - roots: vec![], - symlinks: false, - tsconfig: None, - }; - - assert_eq!(format!("{options}"), ""); - } -} diff --git a/src/package_json.rs b/src/package_json.rs deleted file mode 100644 index 7e05d202..00000000 --- a/src/package_json.rs +++ /dev/null @@ -1,219 +0,0 @@ -//! package.json definitions -//! -//! Code related to export field are copied from [Parcel's resolver](https://github.com/parcel-bundler/parcel/blob/v2/packages/utils/node-resolver-rs/src/package_json.rs) -use std::path::{Path, PathBuf}; - -use serde_json::Value as JSONValue; - -use crate::{path::PathUtil, ResolveError}; - -pub type JSONMap = serde_json::Map; - -/// Deserialized package.json -#[derive(Debug, Default)] -pub struct PackageJson { - /// Path to `package.json`. Contains the `package.json` filename. - pub path: PathBuf, - - /// Realpath to `package.json`. Contains the `package.json` filename. - pub realpath: PathBuf, - - /// The "name" field defines your package's name. - /// The "name" field can be used in addition to the "exports" field to self-reference a package using its name. - /// - /// - pub name: Option, - - /// The "type" field. - /// - /// - pub r#type: Option, - - /// The "sideEffects" field. - /// - /// - pub side_effects: Option, - - raw_json: std::sync::Arc, -} - -impl PackageJson { - /// # Panics - /// # Errors - pub(crate) fn parse( - path: PathBuf, - realpath: PathBuf, - json: &str, - ) -> Result { - let mut raw_json: JSONValue = serde_json::from_str(json)?; - let mut package_json = Self::default(); - - if let Some(json_object) = raw_json.as_object_mut() { - // Remove large fields that are useless for pragmatic use. - #[cfg(feature = "package_json_raw_json_api")] - { - json_object.remove("description"); - json_object.remove("keywords"); - json_object.remove("scripts"); - json_object.remove("dependencies"); - json_object.remove("devDependencies"); - json_object.remove("peerDependencies"); - json_object.remove("optionalDependencies"); - } - - // Add name, type and sideEffects. - package_json.name = - json_object.get("name").and_then(|field| field.as_str()).map(ToString::to_string); - package_json.r#type = json_object.get("type").cloned(); - package_json.side_effects = json_object.get("sideEffects").cloned(); - } - - package_json.path = path; - package_json.realpath = realpath; - package_json.raw_json = std::sync::Arc::new(raw_json); - Ok(package_json) - } - - fn get_value_by_path<'a>( - fields: &'a serde_json::Map, - path: &[String], - ) -> Option<&'a JSONValue> { - if path.is_empty() { - return None; - } - let mut value = fields.get(&path[0])?; - for key in path.iter().skip(1) { - if let Some(inner_value) = value.as_object().and_then(|o| o.get(key)) { - value = inner_value; - } else { - return None; - } - } - Some(value) - } - - /// Raw serde json value of `package.json`. - /// - /// This is currently used in Rspack for: - /// * getting the `sideEffects` field - /// * query in - search on GitHub indicates query on the `type` field. - /// - /// To reduce overall memory consumption, large fields that useless for pragmatic use are removed. - /// They are: `description`, `keywords`, `scripts`, - /// `dependencies` and `devDependencies`, `peerDependencies`, `optionalDependencies`. - #[cfg(feature = "package_json_raw_json_api")] - pub fn raw_json(&self) -> &std::sync::Arc { - &self.raw_json - } - - /// Directory to `package.json` - /// - /// # Panics - /// - /// * When the package.json path is misconfigured. - pub fn directory(&self) -> &Path { - debug_assert!(self.realpath.file_name().is_some_and(|x| x == "package.json")); - self.realpath.parent().unwrap() - } - - /// The "main" field defines the entry point of a package when imported by name via a node_modules lookup. Its value is a path. - /// - /// When a package has an "exports" field, this will take precedence over the "main" field when importing the package by name. - /// - /// Values are dynamically retrieved from [ResolveOptions::main_fields]. - /// - /// - pub(crate) fn main_fields<'a>( - &'a self, - main_fields: &'a [String], - ) -> impl Iterator + '_ { - main_fields - .iter() - .filter_map(|main_field| self.raw_json.get(main_field)) - .filter_map(|value| value.as_str()) - } - - /// The "exports" field allows defining the entry points of a package when imported by name loaded either via a node_modules lookup or a self-reference to its own name. - /// - /// - pub(crate) fn exports_fields<'a>( - &'a self, - exports_fields: &'a [Vec], - ) -> impl Iterator + '_ { - exports_fields.iter().filter_map(|object_path| { - self.raw_json - .as_object() - .and_then(|json_object| Self::get_value_by_path(json_object, object_path)) - }) - } - - /// In addition to the "exports" field, there is a package "imports" field to create private mappings that only apply to import specifiers from within the package itself. - /// - /// - pub(crate) fn imports_fields<'a>( - &'a self, - imports_fields: &'a [Vec], - ) -> impl Iterator + '_ { - imports_fields.iter().filter_map(|object_path| { - self.raw_json - .as_object() - .and_then(|json_object| Self::get_value_by_path(json_object, object_path)) - .and_then(|value| value.as_object()) - }) - } - - /// The "browser" field is provided by a module author as a hint to javascript bundlers or component tools when packaging modules for client side use. - /// Multiple values are configured by [ResolveOptions::alias_fields]. - /// - /// - fn browser_fields<'a>( - &'a self, - alias_fields: &'a [Vec], - ) -> impl Iterator + '_ { - alias_fields.iter().filter_map(|object_path| { - self.raw_json - .as_object() - .and_then(|json_object| Self::get_value_by_path(json_object, object_path)) - // Only object is valid, all other types are invalid - // https://github.com/webpack/enhanced-resolve/blob/3a28f47788de794d9da4d1702a3a583d8422cd48/lib/AliasFieldPlugin.js#L44-L52 - .and_then(|value| value.as_object()) - }) - } - - /// Resolve the request string for this package.json by looking at the `browser` field. - /// - /// # Errors - /// - /// * Returns [ResolveError::Ignored] for `"path": false` in `browser` field. - pub(crate) fn resolve_browser_field<'a>( - &'a self, - path: &Path, - request: Option<&str>, - alias_fields: &'a [Vec], - ) -> Result, ResolveError> { - for object in self.browser_fields(alias_fields) { - if let Some(request) = request { - if let Some(value) = object.get(request) { - return Self::alias_value(path, value); - } - } else { - let dir = self.path.parent().unwrap(); - for (key, value) in object { - let joined = dir.normalize_with(key); - if joined == path { - return Self::alias_value(path, value); - } - } - } - } - Ok(None) - } - - fn alias_value<'a>(key: &Path, value: &'a JSONValue) -> Result, ResolveError> { - match value { - JSONValue::String(value) => Ok(Some(value.as_str())), - JSONValue::Bool(b) if !b => Err(ResolveError::Ignored(key.to_path_buf())), - _ => Ok(None), - } - } -} diff --git a/src/path.rs b/src/path.rs deleted file mode 100644 index f66fdd76..00000000 --- a/src/path.rs +++ /dev/null @@ -1,132 +0,0 @@ -//! Path Utilities -//! -//! Code adapted from the following libraries -//! * [path-absolutize](https://docs.rs/path-absolutize) -//! * [normalize_path](https://docs.rs/normalize-path) -use std::path::{Component, Path, PathBuf}; - -pub const SLASH_START: &[char; 2] = &['/', '\\']; - -/// Extension trait to add path normalization to std's [`Path`]. -pub trait PathUtil { - /// Normalize this path without performing I/O. - /// - /// All redundant separator and up-level references are collapsed. - /// - /// However, this does not resolve links. - fn normalize(&self) -> PathBuf; - - /// Normalize with subpath assuming this path is normalized without performing I/O. - /// - /// All redundant separator and up-level references are collapsed. - /// - /// However, this does not resolve links. - fn normalize_with>(&self, subpath: P) -> PathBuf; - - /// Defined in ESM PACKAGE_TARGET_RESOLVE - /// If target split on "/" or "\" contains any "", ".", "..", or "node_modules" segments after the first "." segment, case insensitive and including percent encoded variants - fn is_invalid_exports_target(&self) -> bool; -} - -impl PathUtil for Path { - // https://github.com/parcel-bundler/parcel/blob/e0b99c2a42e9109a9ecbd6f537844a1b33e7faf5/packages/utils/node-resolver-rs/src/path.rs#L7 - fn normalize(&self) -> PathBuf { - let mut components = self.components().peekable(); - let mut ret = if let Some(c @ Component::Prefix(..)) = components.peek() { - let buf = PathBuf::from(c.as_os_str()); - components.next(); - buf - } else { - PathBuf::new() - }; - - for component in components { - match component { - Component::Prefix(..) => unreachable!("Path {:?}", self), - Component::RootDir => { - ret.push(component.as_os_str()); - } - Component::CurDir => {} - Component::ParentDir => { - ret.pop(); - } - Component::Normal(c) => { - ret.push(c); - } - } - } - - ret - } - - // https://github.com/parcel-bundler/parcel/blob/e0b99c2a42e9109a9ecbd6f537844a1b33e7faf5/packages/utils/node-resolver-rs/src/path.rs#L37 - fn normalize_with>(&self, subpath: B) -> PathBuf { - let subpath = subpath.as_ref(); - - let mut components = subpath.components(); - - let Some(head) = components.next() else { return subpath.to_path_buf() }; - - if matches!(head, Component::Prefix(..) | Component::RootDir) { - return subpath.to_path_buf(); - } - - let mut ret = self.to_path_buf(); - for component in std::iter::once(head).chain(components) { - match component { - Component::CurDir => {} - Component::ParentDir => { - ret.pop(); - } - Component::Normal(c) => { - ret.push(c); - } - Component::Prefix(..) | Component::RootDir => { - unreachable!("Path {:?} Subpath {:?}", self, subpath) - } - } - } - - ret - } - - fn is_invalid_exports_target(&self) -> bool { - self.components().enumerate().any(|(index, c)| match c { - Component::ParentDir => true, - Component::CurDir => index > 0, - Component::Normal(c) => c.eq_ignore_ascii_case("node_modules"), - _ => false, - }) - } -} - -// https://github.com/webpack/enhanced-resolve/blob/main/test/path.test.js -#[test] -fn is_invalid_exports_target() { - let test_cases = [ - "../a.js", - "../", - "./a/b/../../../c.js", - "./a/b/../../../", - "./../../c.js", - "./../../", - "./a/../b/../../c.js", - "./a/../b/../../", - "./././../", - ]; - - for case in test_cases { - assert!(Path::new(case).is_invalid_exports_target(), "{case}"); - } - - assert!(!Path::new("C:").is_invalid_exports_target()); - assert!(!Path::new("/").is_invalid_exports_target()); -} - -#[test] -fn normalize() { - assert_eq!(Path::new("/foo/.././foo/").normalize(), Path::new("/foo")); - assert_eq!(Path::new("C://").normalize(), Path::new("C://")); - assert_eq!(Path::new("C:").normalize(), Path::new("C:")); - assert_eq!(Path::new(r"\\server\share").normalize(), Path::new(r"\\server\share")); -} diff --git a/src/resolution.rs b/src/resolution.rs deleted file mode 100644 index a3aaa2e7..00000000 --- a/src/resolution.rs +++ /dev/null @@ -1,92 +0,0 @@ -use crate::package_json::PackageJson; -use std::{ - fmt, - path::{Path, PathBuf}, - sync::Arc, -}; - -/// The final path resolution with optional `?query` and `#fragment` -#[derive(Clone)] -pub struct Resolution { - pub(crate) path: PathBuf, - - /// path query `?query`, contains `?`. - pub(crate) query: Option, - - /// path fragment `#query`, contains `#`. - pub(crate) fragment: Option, - - pub(crate) package_json: Option>, -} - -impl fmt::Debug for Resolution { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - f.debug_struct("Resolution") - .field("path", &self.path) - .field("query", &self.query) - .field("fragment", &self.fragment) - .field("package_json", &self.package_json.as_ref().map(|p| &p.path)) - .finish() - } -} - -impl PartialEq for Resolution { - fn eq(&self, other: &Self) -> bool { - self.path == other.path && self.query == other.query && self.fragment == other.fragment - } -} -impl Eq for Resolution {} - -impl Resolution { - /// Returns the path without query and fragment - pub fn path(&self) -> &Path { - &self.path - } - - /// Returns the path without query and fragment - pub fn into_path_buf(self) -> PathBuf { - self.path - } - - /// Returns the path query `?query`, contains the leading `?` - pub fn query(&self) -> Option<&str> { - self.query.as_deref() - } - - /// Returns the path fragment `#fragment`, contains the leading `#` - pub fn fragment(&self) -> Option<&str> { - self.fragment.as_deref() - } - - /// Returns serialized package_json - pub fn package_json(&self) -> Option<&Arc> { - self.package_json.as_ref() - } - - /// Returns the full path with query and fragment - pub fn full_path(&self) -> PathBuf { - let mut path = self.path.clone().into_os_string(); - if let Some(query) = &self.query { - path.push(query); - } - if let Some(fragment) = &self.fragment { - path.push(fragment); - } - PathBuf::from(path) - } -} - -#[test] -fn test() { - let resolution = Resolution { - path: PathBuf::from("foo"), - query: Some("?query".to_string()), - fragment: Some("#fragment".to_string()), - package_json: None, - }; - assert_eq!(resolution.path(), Path::new("foo")); - assert_eq!(resolution.query(), Some("?query")); - assert_eq!(resolution.fragment(), Some("#fragment")); - assert_eq!(resolution.full_path(), PathBuf::from("foo?query#fragment")); - assert_eq!(resolution.into_path_buf(), PathBuf::from("foo")); -} diff --git a/src/specifier.rs b/src/specifier.rs deleted file mode 100644 index 73ed038c..00000000 --- a/src/specifier.rs +++ /dev/null @@ -1,230 +0,0 @@ -use crate::error::SpecifierError; -use std::borrow::Cow; - -#[derive(Debug)] -pub struct Specifier<'a> { - path: Cow<'a, str>, - pub query: Option<&'a str>, - pub fragment: Option<&'a str>, -} - -impl<'a> Specifier<'a> { - pub fn path(&'a self) -> &'a str { - self.path.as_ref() - } - - pub fn parse(specifier: &'a str) -> Result { - if specifier.is_empty() { - return Err(SpecifierError::Empty(specifier.to_string())); - } - let offset = match specifier.as_bytes()[0] { - b'/' | b'.' | b'#' => 1, - _ => 0, - }; - let (path, query, fragment) = Self::parse_query_framgment(specifier, offset); - if path.is_empty() { - return Err(SpecifierError::Empty(specifier.to_string())); - } - Ok(Self { path, query, fragment }) - } - - fn parse_query_framgment( - specifier: &'a str, - skip: usize, - ) -> (Cow<'a, str>, Option<&str>, Option<&str>) { - let mut query_start: Option = None; - let mut fragment_start: Option = None; - - let mut prev = specifier.chars().next().unwrap(); - let mut escaped_indexes = vec![]; - for (i, c) in specifier.char_indices().skip(skip) { - if c == '?' && query_start.is_none() { - query_start = Some(i); - } - if c == '#' { - if prev == '\0' { - escaped_indexes.push(i - 1); - } else { - fragment_start = Some(i); - break; - } - } - prev = c; - } - - let (path, query, fragment) = match (query_start, fragment_start) { - (Some(i), Some(j)) => { - debug_assert!(i < j); - (&specifier[..i], Some(&specifier[i..j]), Some(&specifier[j..])) - } - (Some(i), None) => (&specifier[..i], Some(&specifier[i..]), None), - (None, Some(j)) => (&specifier[..j], None, Some(&specifier[j..])), - _ => (specifier, None, None), - }; - - let path = if escaped_indexes.is_empty() { - Cow::Borrowed(path) - } else { - // Remove the `\0` characters for a legal path. - Cow::Owned( - path.chars() - .enumerate() - .filter_map(|(i, c)| (!escaped_indexes.contains(&i)).then_some(c)) - .collect::(), - ) - }; - - (path, query, fragment) - } -} - -#[cfg(test)] -mod tests { - use super::{Specifier, SpecifierError}; - - #[test] - fn debug() { - let specifier = Specifier::parse("/").unwrap(); - assert_eq!( - format!("{specifier:?}"), - r#"Specifier { path: "/", query: None, fragment: None }"# - ); - } - - #[test] - fn empty() { - let specifiers = ["", "?"]; - for specifier in specifiers { - let error = Specifier::parse(specifier).unwrap_err(); - assert_eq!(error, SpecifierError::Empty(specifier.to_string())); - } - } - - #[test] - fn absolute() -> Result<(), SpecifierError> { - let specifier = "/test?#"; - let parsed = Specifier::parse(specifier)?; - assert_eq!(parsed.path, "/test"); - assert_eq!(parsed.query, Some("?")); - assert_eq!(parsed.fragment, Some("#")); - Ok(()) - } - - #[test] - fn relative() -> Result<(), SpecifierError> { - let specifiers = ["./test", "../test", "../../test"]; - for specifier in specifiers { - let mut r = specifier.to_string(); - r.push_str("?#"); - let parsed = Specifier::parse(&r)?; - assert_eq!(parsed.path, specifier); - assert_eq!(parsed.query, Some("?")); - assert_eq!(parsed.fragment, Some("#")); - } - Ok(()) - } - - #[test] - fn hash() -> Result<(), SpecifierError> { - let specifiers = ["#", "#path"]; - for specifier in specifiers { - let mut r = specifier.to_string(); - r.push_str("?#"); - let parsed = Specifier::parse(&r)?; - assert_eq!(parsed.path, specifier); - assert_eq!(parsed.query, Some("?")); - assert_eq!(parsed.fragment, Some("#")); - } - Ok(()) - } - - #[test] - fn module() -> Result<(), SpecifierError> { - let specifiers = ["module"]; - for specifier in specifiers { - let mut r = specifier.to_string(); - r.push_str("?#"); - let parsed = Specifier::parse(&r)?; - assert_eq!(parsed.path, specifier); - assert_eq!(parsed.query, Some("?")); - assert_eq!(parsed.fragment, Some("#")); - } - Ok(()) - } - - #[test] - fn query_fragment() -> Result<(), SpecifierError> { - let data = [ - ("a?", Some("?"), None), - ("a?query", Some("?query"), None), - ("a?query1?query2", Some("?query1?query2"), None), - ("a?query1?query2?query3", Some("?query1?query2?query3"), None), - ("a#", None, Some("#")), - ("a#b#c", None, Some("#b#c")), - ("a#fragment", None, Some("#fragment")), - ("a?#", Some("?"), Some("#")), - ("a?#fragment", Some("?"), Some("#fragment")), - ("a?query#", Some("?query"), Some("#")), - ("a?query#fragment", Some("?query"), Some("#fragment")), - ("a#fragment?", None, Some("#fragment?")), - ("a#fragment?query", None, Some("#fragment?query")), - ]; - - for (specifier_str, query, fragment) in data { - let specifier = Specifier::parse(specifier_str)?; - assert_eq!(specifier.path, "a", "{specifier_str}"); - assert_eq!(specifier.query, query, "{specifier_str}"); - assert_eq!(specifier.fragment, fragment, "{specifier_str}"); - } - - Ok(()) - } - - #[test] - // https://github.com/webpack/enhanced-resolve/blob/main/test/identifier.test.js - fn enhanced_resolve_edge_cases() -> Result<(), SpecifierError> { - let data = [ - ("path/#", "path/", "", "#"), - ("path/as/?", "path/as/", "?", ""), - ("path/#/?", "path/", "", "#/?"), - ("path/#repo#hash", "path/", "", "#repo#hash"), - ("path/#r#hash", "path/", "", "#r#hash"), - ("path/#repo/#repo2#hash", "path/", "", "#repo/#repo2#hash"), - ("path/#r/#r#hash", "path/", "", "#r/#r#hash"), - ("path/#/not/a/hash?not-a-query", "path/", "", "#/not/a/hash?not-a-query"), - ]; - - for (specifier_str, path, query, fragment) in data { - let specifier = Specifier::parse(specifier_str)?; - assert_eq!(specifier.path, path, "{specifier_str}"); - assert_eq!(specifier.query.unwrap_or(""), query, "{specifier_str}"); - assert_eq!(specifier.fragment.unwrap_or(""), fragment, "{specifier_str}"); - } - - Ok(()) - } - - // https://github.com/webpack/enhanced-resolve/blob/main/test/identifier.test.js - #[test] - fn enhanced_resolve_windows_like() -> Result<(), SpecifierError> { - let data = [ - ("path\\#", "path\\", "", "#"), - ("path\\as\\?", "path\\as\\", "?", ""), - ("path\\#\\?", "path\\", "", "#\\?"), - ("path\\#repo#hash", "path\\", "", "#repo#hash"), - ("path\\#r#hash", "path\\", "", "#r#hash"), - ("path\\#repo\\#repo2#hash", "path\\", "", "#repo\\#repo2#hash"), - ("path\\#r\\#r#hash", "path\\", "", "#r\\#r#hash"), - ("path\\#/not/a/hash?not-a-query", "path\\", "", "#/not/a/hash?not-a-query"), - ]; - - for (specifier_str, path, query, fragment) in data { - let specifier = Specifier::parse(specifier_str)?; - assert_eq!(specifier.path, path, "{specifier_str}"); - assert_eq!(specifier.query.unwrap_or(""), query, "{specifier_str}"); - assert_eq!(specifier.fragment.unwrap_or(""), fragment, "{specifier_str}"); - } - - Ok(()) - } -} diff --git a/src/tests/alias.rs b/src/tests/alias.rs deleted file mode 100644 index e5892066..00000000 --- a/src/tests/alias.rs +++ /dev/null @@ -1,283 +0,0 @@ -//! - -use normalize_path::NormalizePath; -use std::path::Path; - -use crate::{AliasValue, Resolution, ResolveContext, ResolveError, ResolveOptions, Resolver}; - -#[test] -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -fn alias() { - use super::memory_fs::MemoryFS; - use crate::ResolverGeneric; - use std::path::{Path, PathBuf}; - - let f = Path::new("/"); - - let file_system = MemoryFS::new(&[ - ("/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", ""), - ("/dashed-name", ""), - ]); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - alias: vec![ - ("aliasA".into(), vec![AliasValue::from("a")]), - ("b$".into(), vec![AliasValue::from("a/index")]), - ("c$".into(), vec![AliasValue::from("/a/index")]), - ( - "multiAlias".into(), - vec![ - AliasValue::from("b"), - AliasValue::from("c"), - AliasValue::from("d"), - AliasValue::from("e"), - AliasValue::from("a"), - ], - ), - ("recursive".into(), vec![AliasValue::from("recursive/dir")]), - ("/d/dir".into(), vec![AliasValue::from("/c/dir")]), - ("/d/index.js".into(), vec![AliasValue::from("/c/index")]), - ("#".into(), vec![AliasValue::from("/c/dir")]), - ("@".into(), vec![AliasValue::from("/c/dir")]), - ("ignored".into(), vec![AliasValue::Ignore]), - // not part of enhanced-resolve, added to make sure query in alias value works - ("alias_query".into(), vec![AliasValue::from("a?query_after")]), - ("alias_fragment".into(), vec![AliasValue::from("a#fragment_after")]), - ("dash".into(), vec![AliasValue::Ignore]), - ("@scope/package-name/file$".into(), vec![AliasValue::from("/c/dir")]), - ], - modules: vec!["/".into()], - ..ResolveOptions::default() - }, - ); - - #[rustfmt::skip] - let pass = [ - ("should resolve a not aliased module 1", "a", "/a/index"), - ("should resolve a not aliased module 2", "a/index", "/a/index"), - ("should resolve a not aliased module 3", "a/dir", "/a/dir/index"), - ("should resolve a not aliased module 4", "a/dir/index", "/a/dir/index"), - ("should resolve an aliased module 1", "aliasA", "/a/index"), - ("should resolve an aliased module 2", "aliasA/index", "/a/index"), - ("should resolve an aliased module 3", "aliasA/dir", "/a/dir/index"), - ("should resolve an aliased module 4", "aliasA/dir/index", "/a/dir/index"), - ("should resolve '#' alias 1", "#", "/c/dir/index"), - ("should resolve '#' alias 2", "#/index", "/c/dir/index"), - ("should resolve '@' alias 1", "@", "/c/dir/index"), - ("should resolve '@' alias 2", "@/index", "/c/dir/index"), - ("should resolve a recursive aliased module 1", "recursive", "/recursive/dir/index"), - ("should resolve a recursive aliased module 2", "recursive/index", "/recursive/dir/index"), - ("should resolve a recursive aliased module 3", "recursive/dir", "/recursive/dir/index"), - ("should resolve a recursive aliased module 4", "recursive/dir/index", "/recursive/dir/index"), - ("should resolve a file aliased module 1", "b", "/a/index"), - ("should resolve a file aliased module 2", "c", "/a/index"), - ("should resolve a file aliased module with a query 1", "b?query", "/a/index?query"), - ("should resolve a file aliased module with a query 2", "c?query", "/a/index?query"), - ("should resolve a path in a file aliased module 1", "b/index", "/b/index"), - ("should resolve a path in a file aliased module 2", "b/dir", "/b/dir/index"), - ("should resolve a path in a file aliased module 3", "b/dir/index", "/b/dir/index"), - ("should resolve a path in a file aliased module 4", "c/index", "/c/index"), - ("should resolve a path in a file aliased module 5", "c/dir", "/c/dir/index"), - ("should resolve a path in a file aliased module 6", "c/dir/index", "/c/dir/index"), - ("should resolve a file aliased file 1", "d", "/c/index"), - ("should resolve a file aliased file 2", "d/dir/index", "/c/dir/index"), - ("should resolve a file in multiple aliased dirs 1", "multiAlias/dir/file", "/e/dir/file"), - ("should resolve a file in multiple aliased dirs 2", "multiAlias/anotherDir", "/e/anotherDir/index"), - // not part of enhanced-resolve, added to make sure query in alias value works - ("should resolve query in alias value", "alias_query?query_before", "/a/index?query_after"), - ("should resolve query in alias value", "alias_fragment#fragment_before", "/a/index#fragment_after"), - ("should resolve dashed name", "dashed-name", "/dashed-name"), - ("should resolve scoped package name with sub dir", "@scope/package-name/file", "/c/dir/index"), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - - #[rustfmt::skip] - let ignore = [ - ("should resolve an ignore module", "ignored", ResolveError::Ignored(f.join("ignored"))) - ]; - - for (comment, request, expected) in ignore { - let resolution = resolver.resolve(f, request); - assert_eq!(resolution, Err(expected), "{comment} {request}"); - } -} - -// Not part of enhanced-resolve -#[test] -fn infinite_recursion() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![ - ("./a".into(), vec![AliasValue::from("./b")]), - ("./b".into(), vec![AliasValue::from("./a")]), - ], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(f, "./a"); - assert_eq!(resolution, Err(ResolveError::Recursion)); -} - -fn check_slash(path: &Path) { - let s = path.to_string_lossy().to_string(); - #[cfg(target_os = "windows")] - { - assert!(!s.contains('/'), "{s}"); - assert!(s.contains('\\'), "{s}"); - } - #[cfg(not(target_os = "windows"))] - { - assert!(s.contains('/'), "{s}"); - assert!(!s.contains('\\'), "{s}"); - } -} - -#[test] -fn absolute_path() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![(f.join("foo").to_str().unwrap().to_string(), vec![AliasValue::Ignore])], - modules: vec![f.clone().to_str().unwrap().to_string()], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(&f, "foo/index"); - assert_eq!(resolution, Err(ResolveError::Ignored(f.join("foo")))); -} - -#[test] -fn system_path() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![("@app".into(), vec![AliasValue::from(f.join("alias").to_string_lossy())])], - ..ResolveOptions::default() - }); - - let specifiers = ["@app/files/a", "@app/files/a.js"]; - - for specifier in specifiers { - let path = resolver.resolve(&f, specifier).map(Resolution::into_path_buf).unwrap(); - assert_eq!(path, f.join("alias/files/a.js")); - check_slash(&path); - } -} - -#[test] -fn alias_is_full_path() { - let f = super::fixture(); - let dir = f.join("foo"); - let dir_str = dir.to_string_lossy().to_string(); - - let resolver = Resolver::new(ResolveOptions { - alias: vec![("@".into(), vec![AliasValue::Path(dir_str.clone())])], - ..ResolveOptions::default() - }); - - let mut ctx = ResolveContext::default(); - - let specifiers = [ - "@/index".to_string(), - "@/index.js".to_string(), - // specifier has multiple `/` for reasons we'll never know - "@////index".to_string(), - // specifier is a full path - dir_str, - ]; - - for specifier in specifiers { - let resolution = resolver.resolve_with_context(&f, &specifier, &mut ctx); - assert_eq!(resolution.map(|r| r.full_path()), Ok(dir.join("index.js"))); - } - - for path in ctx.file_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - check_slash(&path); - } - - for path in ctx.missing_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - check_slash(&path); - if let Some(path) = path.parent() { - assert!(!path.is_file(), "{path:?} must not be a file"); - } - } -} - -// For the `should_stop` variable in `load_alias` -#[test] -fn all_alias_values_are_not_found() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![( - "m1".to_string(), - vec![AliasValue::Path(f.join("node_modules").join("m2").to_string_lossy().to_string())], - )], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(&f, "m1/a.js"); - assert_eq!( - resolution, - Err(ResolveError::MatchedAliasNotFound("m1/a.js".to_string(), "m1".to_string(),)) - ); -} - -#[test] -fn alias_fragment() { - let f = super::fixture(); - - let data = [ - // enhanced-resolve has `#` prepended with a `\0`, they are removed from the - // following 3 expected test results. - // See https://github.com/webpack/enhanced-resolve#escaping - ( - "handle fragment edge case (no fragment)", - "./no#fragment/#/#", - f.join("no#fragment/#/#.js"), - ), - ("handle fragment edge case (fragment)", "./no#fragment/#/", f.join("no.js#fragment/#/")), - ( - "handle fragment escaping", - "./no\0#fragment/\0#/\0##fragment", - f.join("no#fragment/#/#.js#fragment"), - ), - ]; - - for (comment, request, expected) in data { - let resolver = Resolver::new(ResolveOptions { - alias: vec![("foo".to_string(), vec![AliasValue::Path(request.to_string())])], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f, "foo").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } -} - -#[test] -fn alias_try_fragment_as_path() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![( - "#".to_string(), - vec![AliasValue::Path(f.join("#").to_string_lossy().to_string())], - )], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(&f, "#/a").map(|r| r.full_path()); - assert_eq!(resolution, Ok(f.join("#").join("a.js"))); -} diff --git a/src/tests/browser_field.rs b/src/tests/browser_field.rs deleted file mode 100644 index 171ee099..00000000 --- a/src/tests/browser_field.rs +++ /dev/null @@ -1,189 +0,0 @@ -//! - -use crate::{AliasValue, ResolveError, ResolveOptions, Resolver}; - -#[test] -fn ignore() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![ - vec!["browser".into()], - vec!["innerBrowser1".into()], - vec!["innerBrowser2".into()], - vec![], - ], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - (f.clone(), "./lib/ignore", f.join("lib/ignore.js")), - (f.clone(), "./lib/ignore.js", f.join("lib/ignore.js")), - (f.join("lib"), "./ignore", f.join("lib/ignore.js")), - (f.join("lib"), "./ignore.js", f.join("lib/ignore.js")), - ]; - - for (path, request, expected) in data { - let resolution = resolver.resolve(&path, request); - let expected = ResolveError::Ignored(expected); - assert_eq!(resolution, Err(expected), "{path:?} {request}"); - } -} - -#[test] -fn shared_resolvers() { - let f = super::fixture().join("browser-module"); - - let resolver1 = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["innerBrowser1".into(), "field".into(), "browser".into()]], - ..ResolveOptions::default() - }); - let resolved_path = resolver1.resolve(&f, "./lib/main1.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("lib/main.js"))); - - let resolver2 = resolver1.clone_with_options(ResolveOptions { - alias_fields: vec![vec!["innerBrowser2".into(), "browser".into()]], - ..ResolveOptions::default() - }); - let resolved_path = resolver2.resolve(&f, "./lib/main2.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("./lib/replaced.js"))); -} - -#[test] -fn replace_file() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![ - vec!["browser".into()], - vec!["innerBrowser1".into(), "field2".into(), "browser".into()], // not presented - vec!["innerBrowser1".into(), "field".into(), "browser".into()], - vec!["innerBrowser2".into(), "browser".into()], - ], - // Not part of enhanced-resolve. Added to make sure no interaction between these two fields. - main_fields: vec!["browser".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - ("should replace a file 1", f.clone(), "./lib/replaced", f.join("lib/browser.js")), - ("should replace a file 2", f.clone(), "./lib/replaced.js", f.join("lib/browser.js")), - ("should replace a file 3", f.join("lib"), "./replaced", f.join("lib/browser.js")), - ("should replace a file 4", f.join("lib"), "./replaced.js", f.join("lib/browser.js")), - ("should replace a module with a file 1", f.clone(), "module-a", f.join("browser/module-a.js")), - ("should replace a module with a file 2", f.join("lib"), "module-a", f.join("browser/module-a.js")), - ("should replace a module with a module 1", f.clone(), "module-b", f.join("node_modules/module-c.js")), - ("should replace a module with a module 2", f.join("lib"), "module-b", f.join("node_modules/module-c.js")), - ("should resolve in nested property 1", f.clone(), "./lib/main1.js", f.join("lib/main.js")), - ("should resolve in nested property 2", f.clone(), "./lib/main2.js", f.join("lib/browser.js")), - ("should check only alias field properties", f.clone(), "./toString", f.join("lib/toString.js")), - // not part of enhanced-resolve - ("recursion", f.clone(), "module-c", f.join("node_modules/module-c.js")), - ("resolve self 1", f.clone(), "./lib/main.js", f.join("lib/main.js")), - ("resolve self 2", f.clone(), "./main.js", f.join("lib/main.js")), - ]; - - for (comment, path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn recurse_fail() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - ("recurse non existent", f.clone(), "./lib/non-existent.js", ResolveError::NotFound("./lib/non-existent.js".into())), - ("path partial match 1", f.clone(), "./xyz.js", ResolveError::NotFound("./xyz.js".into())), - ("path partial match 2", f, "./lib/xyz.js", ResolveError::NotFound("./lib/xyz.js".into())), - ]; - - for (comment, path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Err(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn broken() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - // The browser field string value should be ignored - (f.clone(), "browser-module-broken", Ok(f.join("node_modules/browser-module-broken/main.js"))), - (f.join("browser-module"), "./number", Err(ResolveError::NotFound("./number".into()))), - ]; - - for (path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, expected, "{path:?} {request}"); - } -} - -#[test] -fn crypto_js() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - fallback: vec![( - "crypto".into(), - vec![AliasValue::from(f.join("lib.js").to_string_lossy())], - )], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(f.join("crypto-js"), "crypto").map(|r| r.full_path()); - assert_eq!(resolved_path, Err(ResolveError::Ignored(f.join("crypto-js")))); -} - -// https://github.com/webpack/webpack/blob/87660921808566ef3b8796f8df61bd79fc026108/test/cases/resolving/browser-field/index.js#L40-L43 -#[test] -fn recursive() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - let data = [ - ("should handle recursive file 1", f.clone(), "recursive-file/a"), - ("should handle recursive file 2", f.clone(), "recursive-file/b"), - ("should handle recursive file 3", f.clone(), "recursive-file/c"), - ("should handle recursive file 4", f, "recursive-file/d"), - ]; - - for (comment, path, request) in data { - let resolved_path = resolver.resolve(&path, request); - assert_eq!(resolved_path, Err(ResolveError::Recursion), "{comment} {path:?} {request}"); - } -} - -#[test] -fn with_query() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "./foo").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("lib").join("browser.js?query"))); -} diff --git a/src/tests/builtins.rs b/src/tests/builtins.rs deleted file mode 100644 index 5d6d14d9..00000000 --- a/src/tests/builtins.rs +++ /dev/null @@ -1,121 +0,0 @@ -use std::path::Path; - -use crate::{ResolveError, ResolveOptions, Resolver}; - -#[test] -fn builtins_off() { - let f = Path::new("/"); - let resolver = Resolver::default(); - let resolved_path = resolver.resolve(f, "zlib").map(|r| r.full_path()); - assert_eq!(resolved_path, Err(ResolveError::NotFound("zlib".into()))); -} - -#[test] -fn builtins() { - let f = Path::new("/"); - - let resolver = Resolver::new(ResolveOptions::default().with_builtin_modules(true)); - - let pass = [ - "_http_agent", - "_http_client", - "_http_common", - "_http_incoming", - "_http_outgoing", - "_http_server", - "_stream_duplex", - "_stream_passthrough", - "_stream_readable", - "_stream_transform", - "_stream_wrap", - "_stream_writable", - "_tls_common", - "_tls_wrap", - "assert", - "assert/strict", - "async_hooks", - "buffer", - "child_process", - "cluster", - "console", - "constants", - "crypto", - "dgram", - "diagnostics_channel", - "dns", - "dns/promises", - "domain", - "events", - "fs", - "fs/promises", - "http", - "http2", - "https", - "inspector", - "module", - "net", - "os", - "path", - "path/posix", - "path/win32", - "perf_hooks", - "process", - "punycode", - "querystring", - "readline", - "repl", - "stream", - "stream/consumers", - "stream/promises", - "stream/web", - "string_decoder", - "sys", - "timers", - "timers/promises", - "tls", - "trace_events", - "tty", - "url", - "util", - "util/types", - "v8", - "vm", - "worker_threads", - "zlib", - ]; - - for request in pass { - let prefixed_request = format!("node:{request}"); - for request in [prefixed_request.clone(), request.to_string()] { - let resolved_path = resolver.resolve(f, &request).map(|r| r.full_path()); - let err = ResolveError::Builtin(prefixed_request.clone()); - assert_eq!(resolved_path, Err(err), "{request}"); - } - } -} - -#[test] -fn fail() { - let f = Path::new("/"); - let resolver = Resolver::new(ResolveOptions::default().with_builtin_modules(true)); - let request = "xxx"; - let resolved_path = resolver.resolve(f, request); - let err = ResolveError::NotFound(request.to_string()); - assert_eq!(resolved_path, Err(err), "{request}"); -} - -#[test] -fn imports() { - let f = super::fixture().join("builtins"); - let resolver = Resolver::new(ResolveOptions { - builtin_modules: true, - condition_names: vec!["node".into()], - ..ResolveOptions::default() - }); - - for request in ["#fs", "#http"] { - let resolved_path = resolver.resolve(f.clone(), request).map(|r| r.full_path()); - let err = ResolveError::Builtin(format!("node:{}", request.trim_start_matches('#'))); - assert_eq!(resolved_path, Err(err)); - } -} diff --git a/src/tests/dependencies.rs b/src/tests/dependencies.rs deleted file mode 100644 index bcc2355b..00000000 --- a/src/tests/dependencies.rs +++ /dev/null @@ -1,110 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/dependencies.test.js - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows { - use rustc_hash::FxHashSet; - use std::path::PathBuf; - - use crate::{ResolveContext, ResolveOptions, ResolverGeneric}; - - use super::super::memory_fs::MemoryFS; - - fn file_system() -> MemoryFS { - MemoryFS::new(&[ - ("/a/b/node_modules/some-module/index.js", ""), - ("/a/node_modules/module/package.json", r#"{"main":"entry.js"}"#), - ("/a/node_modules/module/file.js", r#"{"main":"entry.js"}"#), - ("/modules/other-module/file.js", ""), - ]) - } - - #[test] - fn test() { - let file_system = file_system(); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - extensions: vec![".json".into(), ".js".into()], - modules: vec!["/modules".into(), "node_modules".into()], - ..ResolveOptions::default() - }, - ); - - let data = [ - ( - "middle module request", - "/a/b/c", - "module/file", - "/a/node_modules/module/file.js", - // These dependencies are different from enhanced-resolve due to different code path to - // querying the file system - vec![ - // 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", - // "/", - ], - vec![ - // missing package.jsons - // "/a/b/c/package.json", - "/a/b/package.json", - "/a/package.json", - "/package.json", - // missing modules directories - "/a/b/c", - // "/a/b/c/node_modules", - // missing single file modules - "/modules/module", - "/a/b/node_modules/module", - // missing files with alternative extensions - "/a/node_modules/module/file", - "/a/node_modules/module/file.json", - ], - ), - ( - "fast found module", - "/a/b/c", - "other-module/file.js", - "/modules/other-module/file.js", - // These dependencies are different from enhanced-resolve due to different code path to - // querying the file system - vec![ - // symlink checks - "/modules/other-module/file.js", - // "/modules/other-module", - // "/modules", - // "/", - ], - vec![ - // missing package.jsons - // "/a/b/c/package.json", - "/a/b/c", - "/a/b/package.json", - "/a/package.json", - "/package.json", - "/modules/other-module/package.json", - "/modules/package.json", - ], - ), - ]; - - for (name, context, request, result, file_dependencies, missing_dependencies) in data { - let mut ctx = ResolveContext::default(); - let path = PathBuf::from(context); - let resolved = - resolver.resolve_with_context(path, request, &mut ctx).map(|r| r.full_path()); - assert_eq!(resolved, Ok(PathBuf::from(result))); - let file_dependencies = - FxHashSet::from_iter(file_dependencies.iter().map(PathBuf::from)); - let missing_dependencies = - FxHashSet::from_iter(missing_dependencies.iter().map(PathBuf::from)); - assert_eq!(ctx.file_dependencies, file_dependencies, "{name}"); - assert_eq!(ctx.missing_dependencies, missing_dependencies, "{name}"); - } - } -} diff --git a/src/tests/exports_field.rs b/src/tests/exports_field.rs deleted file mode 100644 index 7ca73fbd..00000000 --- a/src/tests/exports_field.rs +++ /dev/null @@ -1,2546 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/exportsField.test.js -//! -//! The huge exports field test cases are at the bottom of this file. - -use crate::{Ctx, PathUtil, ResolveError, ResolveOptions, Resolver}; -use serde_json::json; -use std::path::Path; - -#[test] -fn test_simple() { - let f = super::fixture().join("exports-field"); - let f2 = super::fixture().join("exports-field2"); - let f4 = super::fixture().join("exports-field-error"); - let f5 = super::fixture().join("imports-exports-wildcard"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - fully_specified: true, - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("resolve root using exports field, not a main field", f.clone(), "exports-field", f.join("node_modules/exports-field/x.js")), - ("resolver should respect condition names", f.clone(), "exports-field/dist/main.js", f.join("node_modules/exports-field/lib/lib2/main.js")), - // enhanced_resolve behaves differently to node.js. enhanced_resolve fallbacks when an - // array item is unresolved, where as node.js fallbacks when an array has an - // InvalidPackageTarget error. - // ("resolver should respect fallback", f2.clone(), "exports-field/dist/browser.js", f2.join("node_modules/exports-field/lib/browser.js")), - // The following two tests require fallback from array values, the path is changed here to - // only test query and fragment. - ("resolver should respect query parameters #1", f2.clone(), "exports-field/dist/main.js?foo", f2.join("node_modules/exports-field/lib/lib2/main.js?foo")), - ("resolver should respect fragment parameters #1", f2.clone(), "exports-field/dist/main.js#foo", f2.join("node_modules/exports-field/lib/lib2/main.js#foo")), - ("relative path should work, if relative path as request is used", f.clone(), "./node_modules/exports-field/lib/main.js", f.join("node_modules/exports-field/lib/main.js")), - ("self-resolving root", f.clone(), "@exports-field/core", f.join("a.js")), - ("should resolve with wildcard pattern #1", f5.clone(), "m/features/f.js", f5.join("node_modules/m/src/features/f.js")), - ("should resolve with wildcard pattern #2", f5.clone(), "m/features/y/y.js", f5.join("node_modules/m/src/features/y/y.js")), - ("should resolve with wildcard pattern #3", f5.clone(), "m/features-no-ext/y/y.js", f5.join("node_modules/m/src/features/y/y.js")), - ("should resolve with wildcard pattern #4", f5.clone(), "m/middle/nested/f.js", f5.join("node_modules/m/src/middle/nested/f.js")), - ("should resolve with wildcard pattern #5", f5.clone(), "m/middle-1/nested/f.js", f5.join("node_modules/m/src/middle-1/nested/f.js")), - ("should resolve with wildcard pattern #6", f5.clone(), "m/middle-2/nested/f.js", f5.join("node_modules/m/src/middle-2/nested/f.js")), - ("should resolve with wildcard pattern #7", f5.clone(), "m/middle-3/nested/f", f5.join("node_modules/m/src/middle-3/nested/f/nested/f.js")), - ("should resolve with wildcard pattern #8", f5.clone(), "m/middle-4/f/nested", f5.join("node_modules/m/src/middle-4/f/f.js")), - ("should resolve with wildcard pattern #9", f5.clone(), "m/middle-5/f$/$", f5.join("node_modules/m/src/middle-5/f$/$.js")), - ]; - - // Not needed or snapshot: - // * should log the correct info - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } - - let p = f.join("node_modules/exports-field/package.json"); - let p2 = f2.join("node_modules/exports-field/package.json"); - let p4 = f4.join("node_modules/exports-field/package.json"); - let p5 = f5.join("node_modules/m/package.json"); - - #[rustfmt::skip] - let fail = [ - // ("throw error if extension not provided", f2.clone(), "exports-field/dist/main", ResolveError::NotFound(f2.join("node_modules/exports-field/lib/lib2/main"))), - ("resolver should respect query parameters #2. Direct matching", f2.clone(), "exports-field?foo", ResolveError::PackagePathNotExported("./?foo".into(), p2.clone())), - ("resolver should respect fragment parameters #2. Direct matching", f2, "exports-field#foo", ResolveError::PackagePathNotExported("./#foo".into(), p2)), - ("relative path should not work with exports field", f.clone(), "./node_modules/exports-field/dist/main.js", ResolveError::NotFound("./node_modules/exports-field/dist/main.js".into())), - ("backtracking should not work for request", f.clone(), "exports-field/dist/../../../a.js", ResolveError::InvalidPackageTarget("./lib/../../../a.js".to_string(), "./dist/".to_string(), p.clone())), - ("backtracking should not work for exports field target", f.clone(), "exports-field/dist/a.js", ResolveError::InvalidPackageTarget("./../../a.js".to_string(), "./dist/a.js".to_string(), p.clone())), - ("not exported error", f.clone(), "exports-field/anything/else", ResolveError::PackagePathNotExported("./anything/else".to_string(), p.clone())), - ("request ending with slash #1", f.clone(), "exports-field/", ResolveError::PackagePathNotExported("./".to_string(), p.clone())), - ("request ending with slash #2", f.clone(), "exports-field/dist/", ResolveError::PackagePathNotExported("./dist/".to_string(), p.clone())), - ("request ending with slash #3", f.clone(), "exports-field/lib/", ResolveError::PackagePathNotExported("./lib/".to_string(), p)), - ("should throw error if target is invalid", f4, "exports-field", ResolveError::InvalidPackageTarget("./a/../b/../../pack1/index.js".to_string(), ".".to_string(), p4)), - ("throw error if exports field is invalid", f.clone(), "invalid-exports-field", ResolveError::InvalidPackageConfig(f.join("node_modules/invalid-exports-field/package.json"))), - ("should throw error if target is 'null'", f5, "m/features/internal/file.js", ResolveError::PackagePathNotExported("./features/internal/file.js".to_string(), p5)), - ]; - - for (comment, path, request, error) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!(resolution, Err(error), "{comment} {path:?} {request}"); - } -} - -// resolve using exports field, not a browser field #1 -#[test] -fn exports_not_browser_field1() { - let f = super::fixture().join("exports-field"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - condition_names: vec!["webpack".into()], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "exports-field/dist/main.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("node_modules/exports-field/lib/lib2/main.js"))); -} - -// resolve using exports field and a browser alias field #2 -#[test] -fn exports_not_browser_field2() { - let f2 = super::fixture().join("exports-field2"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - extensions: vec![".js".into()], - condition_names: vec!["node".into()], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f2, "exports-field/dist/main.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f2.join("node_modules/exports-field/lib/browser.js"))); -} - -// should resolve extension without fullySpecified -#[test] -fn extension_without_fully_specified() { - let f2 = super::fixture().join("exports-field2"); - - let commonjs_resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - let resolved_path = - commonjs_resolver.resolve(&f2, "exports-field/dist/main").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f2.join("node_modules/exports-field/lib/lib2/main.js"))); -} - -#[test] -fn field_name_path() { - let f2 = super::fixture().join("exports-field2"); - let f3 = super::fixture().join("exports-field3"); - - // field name path #1 #2 #3 - let exports_fields = [ - vec![vec!["exportsField".into(), "exports".into()]], - vec![vec!["exportsField".into(), "exports".into()], vec!["exports".into()]], - vec![vec!["exports".into()], vec!["exportsField".into(), "exports".into()]], - ]; - - for exports_fields in exports_fields { - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - exports_fields, - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/main.js"))); - } - - // field name path #4 - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - exports_fields: vec![vec!["exports".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f2, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f2.join("node_modules/exports-field/index.js"))); - - // field name path #5 - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - exports_fields: vec![vec!["ex".into()], vec!["exports_field".into(), "exports".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/index"))); - - // non-compliant export targeting a directory - let resolver = Resolver::new(ResolveOptions { - exports_fields: vec![vec!["broken".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/src/index.js"))); -} - -#[test] -fn shared_resolvers() { - let f3 = super::fixture().join("exports-field3"); - - let resolver1 = Resolver::new(ResolveOptions { - exports_fields: vec![vec!["exportsField".into(), "exports".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver1.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/main.js"))); - - let resolver2 = resolver1.clone_with_options(ResolveOptions { - exports_fields: vec![vec!["ex".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver2.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/index"))); -} - -#[test] -fn extension_alias_1_2() { - let f = super::fixture().join("exports-field-and-extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - extension_alias: vec![(".js".into(), vec![".ts".into(), ".js".into()])], - fully_specified: true, - condition_names: vec!["webpack".into(), "default".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve with the `extensionAlias` option", f.clone(), "@org/pkg/string.js", f.join("node_modules/@org/pkg/dist/string.js")), - ("should resolve with the `extensionAlias` option #2", f.clone(), "pkg/string.js", f.join("node_modules/pkg/dist/string.js")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn extension_alias_3() { - let f = super::fixture().join("exports-field-and-extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - extension_alias: vec![( - ".js".into(), - vec![".foo".into(), ".baz".into(), ".baz".into(), ".ts".into(), ".js".into()], - )], - fully_specified: true, - condition_names: vec!["webpack".into(), "default".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve with the `extensionAlias` option #3", f.clone(), "pkg/string.js", f.join("node_modules/pkg/dist/string.js")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn extension_alias_throw_error() { - let f = super::fixture().join("exports-field-and-extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - extension_alias: vec![(".js".into(), vec![".ts".into()])], - fully_specified: true, - condition_names: vec!["webpack".into(), "default".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let fail = [ - // enhanced-resolve has two test cases that are exactly the same here - // https://github.com/webpack/enhanced-resolve/blob/a998c7d218b7a9ec2461fc4fddd1ad5dd7687485/test/exportsField.test.js#L2976-L3024 - ("should throw error with the `extensionAlias` option", f.clone(), "pkg/string.js", ResolveError::ExtensionAlias(f.join("node_modules/pkg/dist/string.js"))), - // TODO: The error is PackagePathNotExported in enhanced-resolve - // ("should throw error with the `extensionAlias` option", f.clone(), "pkg/string.js", ResolveError::PackagePathNotExported("node_modules/pkg/dist/string.ts".to_string())), - ]; - - for (comment, path, request, error) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!(resolution, Err(error), "{comment} {path:?} {request}"); - } -} - -// Small script for generating the test cases from enhanced-resolve -// for (c of testCases) { -// console.log("TestCase {") -// console.log(`name: ${JSON.stringify(c.name)},`) -// if (c.expect instanceof Error) { -// console.log(`expect: None,`) -// } else { -// console.log(`expect: Some(vec!${JSON.stringify(c.expect)}),`) -// } -// console.log(`exports_field: exports_field(json!(${JSON.stringify(c.suite[0], null, 2)})),`) -// console.log(`request: "${c.suite[1]}",`) -// console.log(`condition_names: vec!${JSON.stringify(c.suite[2])},`) -// console.log("},") -//} -struct TestCase { - name: &'static str, - expect: Option>, - exports_field: serde_json::Value, - request: &'static str, - condition_names: Vec<&'static str>, -} - -#[allow(clippy::needless_pass_by_value)] -fn exports_field(value: serde_json::Value) -> serde_json::Value { - value -} - -#[test] -fn test_cases() { - let test_cases = [ - TestCase { - name: "sample #1", - expect: Some(vec!["./dist/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/": { - "import": [ - "./dist/", - "./src/" - ], - "webpack": "./wp/" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "sample #1", - expect: Some(vec!["./src/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/": { - "import": [ - "./src/" - ], - "webpack": "./wp/" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - TestCase { - name: "sample #1 (wildcard)", - expect: Some(vec!["./dist/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/*": { - "import": [ - "./dist/*", - "./src/*" - ], - "webpack": "./wp/*" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "sample #1 (wildcard)", - expect: Some(vec!["./src/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/*": { - "import": [ - "./src/*" - ], - "webpack": "./wp/*" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - TestCase { - name: "sample #2", - expect: Some(vec!["./data/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./timezones/": "./data/timezones/" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #2 (wildcard)", - expect: Some(vec!["./data/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./timezones/*": "./data/timezones/*" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #3", - expect: Some(vec!["./data/timezones/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./": "./data/timezones/" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #3 (wildcard)", - expect: Some(vec!["./data/timezones/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./*": "./data/timezones/*.mjs" - })), - request: "./timezones/pdt", - condition_names: vec![], - }, - TestCase { - name: "sample #4", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./lib/": { - "browser": [ - "./browser/" - ] - }, - "./dist/index.js": { - "node": "./index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #4 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "node": "./index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #5", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/": { - "browser": [ - "./browser/" - ] - }, - "./dist/index.js": { - "node": "./index.js", - "default": "./browser/index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #5 (wildcard)", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "node": "./index.js", - "default": "./browser/index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./dist/a": "./dist/index.js" - })), - request: "./dist/aaa", - condition_names: vec![], - }, - TestCase { - name: "sample #7", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./dist/a/a/": "./dist/index.js" - })), - request: "./dist/a/a", - condition_names: vec![], - }, - TestCase { - name: "sample #7 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./dist/a/a/*": "./dist/index.js" - })), - request: "./dist/a/a", - condition_names: vec![], - }, - TestCase { - name: "sample #8", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": "./index.js" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #9", - expect: Some(vec!["./main.js"]), - exports_field: exports_field(json!({ - "./index.js": "./main.js" - })), - request: "./index.js", - condition_names: vec![], - }, - TestCase { - name: "sample #10", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #11", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./bar#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #12", - expect: Some(vec!["./ok.js#abc"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/ok.js#abc", - condition_names: vec![], - }, - TestCase { - name: "sample #12", - expect: Some(vec!["./ok.js#abc"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/ok.js#abc", - condition_names: vec![], - }, - TestCase { - name: "sample #13", - expect: Some(vec!["./ok.js?abc"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/ok.js?abc", - condition_names: vec![], - }, - TestCase { - name: "sample #14", - expect: Some(vec!["./🎉.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/🎉.js", - condition_names: vec![], - }, - TestCase { - name: "sample #15", - expect: Some(vec!["./%F0%9F%8E%89.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/%F0%9F%8E%89.js", - condition_names: vec![], - }, - TestCase { - name: "sample #16", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./🎉", - condition_names: vec![], - }, - TestCase { - name: "sample #17", - expect: Some(vec!["./other.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./%F0%9F%8E%89", - condition_names: vec![], - }, - TestCase { - name: "sample #18", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./module", - condition_names: vec![], - }, - TestCase { - name: "sample #19", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./module#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #20", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./module?foo", - condition_names: vec![], - }, - TestCase { - name: "sample #21", - expect: Some(vec!["./zizizi"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./z*z*z*" - })), - request: "./#zippi", - condition_names: vec![], - }, - TestCase { - name: "sample #22", - expect: Some(vec!["./d?e?f"]), - exports_field: exports_field(json!({ - "./a?b?c/": "./" - })), - request: "./a?b?c/d?e?f", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #1", - expect: Some(vec!["./dist/index.js"]), - exports_field: exports_field(json!({ - ".": "./dist/index.js" - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #2", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./": "./", - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #3", - expect: Some(vec!["./dist/a.js"]), - exports_field: exports_field(json!({ - "./dist/": "./dist/", - "./dist/*": "./dist/*", - "./dist*": "./dist*", - "./dist/index.js": "./dist/a.js" - })), - request: "./dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #4", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./": { - "browser": [ - "./browser/" - ] - }, - "./*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "browser": "./index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #5", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./": { - "browser": [ - "./browser/" - ] - }, - "./*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "node": "./node.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #6", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - ".": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #7", - expect: Some(vec!["./src/index.js"]), // `enhanced_resolve` is `None` - exports_field: exports_field(json!({ - ".": { - "default": "./src/index.js", - "browser": "./index.js", - "node": "./src/node/index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #8", - expect: Some(vec!["./src/index.js"]), - exports_field: exports_field(json!({ - ".": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #9", - expect: Some(vec!["./index"]), - exports_field: exports_field(json!({ - ".": "./index" - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #10", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./index": "./index.js" - })), - request: "./index", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #11", - expect: Some(vec!["./foo.js"]), - exports_field: exports_field(json!({ - "./": "./", - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #12", - expect: Some(vec!["./foo/bar/baz.js"]), - exports_field: exports_field(json!({ - "./": "./", - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo/bar/baz.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #13", - expect: Some(vec!["./foo/bar/baz.js"]), - exports_field: exports_field(json!({ - "./": "./", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo/bar/baz.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #14", - expect: Some(vec!["./foo/bar/baz.js"]), - exports_field: exports_field(json!({ - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo/bar/baz.js", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #1", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "require": "./require.js" - }, { - "import": "./import.mjs" - }] - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #2", - expect: Some(vec!["./import.mjs"]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "require": "./require.js" - }, { - "import": "./import.mjs" - }] - })), - request: ".", - condition_names: vec!["import"], - }, - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./require.js"]), - exports_field: exports_field(json!({ - ".": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./import.mjs"]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "import": "./import.mjs" - }] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./require.js"]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "require": [ - "./require.js" - ] - }, { - "import": [ - "./import.mjs", - "./import.js" - ] - }] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./import.mjs"]), - exports_field: exports_field(json!({ - ".": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "./import.mjs", - "./import.js" - ] - } - ] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./import.js"]), - exports_field: exports_field(json!({ - ".": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "./import.js" - ] - } - ] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "mapping to a folder root #1", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./timezones": "./data/timezones/" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #2", - expect: None, - exports_field: exports_field(json!({ - "./timezones/": "./data/timezones" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #3", - expect: Some(vec!["./data/timezones/pdt/index.mjs"]), - exports_field: exports_field(json!({ - "./timezones/pdt/": "./data/timezones/pdt/" - })), - request: "./timezones/pdt/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #3 (wildcard)", - expect: Some(vec!["./data/timezones/pdt/index.mjs"]), - exports_field: exports_field(json!({ - "./timezones/pdt/*": "./data/timezones/pdt/*" - })), - request: "./timezones/pdt/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #4", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./": "./timezones/" - })), - request: "./pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #4 (wildcard)", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./*": "./timezones/*" - })), - request: "./pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #5", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./": "./" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #5 (wildcard)", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./*": "./*" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #6", - expect: None, - exports_field: exports_field(json!({ - "./": "." - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #6 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "./*": "." - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #7", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": "./" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #7 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": "./*" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #1", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./": "./", - "./dist/": "./lib/" - })), - request: "./dist/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #1 (wildcard)", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./*": "./*", - "./dist/*": "./lib/*" - })), - request: "./dist/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #2", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/": "./dist/utils/", - "./dist/": "./lib/" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #2 (wildcard)", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/*": "./dist/utils/*", - "./dist/*": "./lib/*" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #3", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/index.js": "./dist/utils/index.js", - "./dist/utils/": "./dist/utils/index.mjs", - "./dist/": "./lib/" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #3 (wildcard)", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/index.js": "./dist/utils/index.js", - "./dist/utils/*": "./dist/utils/index.mjs", - "./dist/*": "./lib/*" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #4", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./": { - "browser": "./browser/" - }, - "./dist/": "./lib/" - })), - request: "./dist/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "the longest matching path prefix is prioritized #4 (wildcard)", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./*": { - "browser": "./browser/*" - }, - "./dist/*": "./lib/*" - })), - request: "./dist/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #1", - // `lodash/` does not start with './' so fallbacks to util - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "conditional mapping folder #1", - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": [ - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #1 (wildcard)", - // `lodash/` does not start with './' so fallbacks to util - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": [ - "lodash/*", - "./utils/*" - ], - "node": [ - "./utils-node/*" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "conditional mapping folder #1 (wildcard)", - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": [ - "./utils/*" - ], - "node": [ - "./utils-node/*" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #2", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./node/" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "conditional mapping folder #2 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "webpack": "./wpk/*", - "browser": [ - "lodash/*", - "./utils/*" - ], - "node": [ - "./node/*" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "conditional mapping folder #3", - expect: Some(vec!["./wpk/index.mjs"]), - exports_field: exports_field(json!({ - "./utils/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils/" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "conditional mapping folder #3 (wildcard)", - expect: Some(vec!["./wpk/index.mjs"]), - exports_field: exports_field(json!({ - "./utils/*": { - "webpack": "./wpk/*", - "browser": [ - "lodash/*", - "./utils/*" - ], - "node": [ - "./utils/*" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "incorrect exports field #1", - expect: None, - exports_field: exports_field(json!({ - "/utils/": "./a/" - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #2", - expect: None, - exports_field: exports_field(json!({ - "./utils/": "/a/" - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #3", - expect: None, - exports_field: exports_field(json!({ - "/utils/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #4", - expect: None, - exports_field: exports_field(json!({ - "./utils/": { - "browser": "/a/", - "default": "/b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #4 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "/a/", - "default": "/b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #5", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index": "./a/index.js" - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index.mjs": "./a/index.js" - })), - request: "./utils/index", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #7", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #8", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index.mjs": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - // Requests that are not `./` does not apply to `package_exports_resolve` - // TestCase { - // name: "incorrect request #1", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": "./a/" - // })), - // request: "/utils/index.mjs", - // condition_names: vec![], - // }, - // TestCase { - // name: "incorrect request #2", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": { - // "browser": "./a/", - // "default": "./b/" - // } - // })), - // request: "/utils/index.mjs", - // condition_names: vec!["browser"], - // }, - // TestCase { - // name: "incorrect request #3", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": { - // "browser": "./a/", - // "default": "./b/" - // } - // })), - // request: "../utils/index.mjs", - // condition_names: vec!["browser"], - // }, - // TestCase { - // name: "incorrect request #4", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": { - // "browser": "./a/", - // "default": "./b/" - // } - // })), - // request: "/utils/index.mjs/", - // condition_names: vec!["browser"], - // }, - TestCase { - name: "backtracking package base #1", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./../../utils/": "./dist/" - })), - request: "./../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #1 (wildcard)", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./../../utils/*": "./dist/*" - })), - request: "./../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #2", - expect: None, - exports_field: exports_field(json!({ - "../../utils/": "./dist/" - })), - request: "../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #2 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "../../utils/*": "./dist/*" - })), - request: "../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #3", - expect: None, - exports_field: exports_field(json!({ - "./utils/": "../src/" - })), - request: "./utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #3 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "./utils/*": "../src/*" - })), - request: "./utils/index", - condition_names: vec![], - }, - // enhanced-resolve does not handle backtracking here - // TestCase { - // name: "backtracking package base #4", - // expect: Some(vec!["./../src/index"]), - // exports_field: exports_field(json!({ - // "./utils/": "./../src/" - // })), - // request: "./utils/index", - // condition_names: vec![], - // }, - // TestCase { - // name: "backtracking package base #4 (wildcard)", - // expect: Some(vec!["./../src/index"]), - // exports_field: exports_field(json!({ - // "./utils/*": "./../src/*" - // })), - // request: "./utils/index", - // condition_names: vec![], - // }, - // TestCase { - // name: "backtracking package base #5", - // expect: Some(vec!["./src/../index.js"]), - // exports_field: exports_field(json!({ - // "./utils/index": "./src/../index.js" - // })), - // request: "./utils/index", - // condition_names: vec![], - // }, - TestCase { - name: "backtracking package base #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/../utils/index": "./src/../index.js" - })), - request: "./utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #7", - expect: None, - exports_field: exports_field(json!({ - "./utils/": { - "browser": "../this/" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #7", - expect: None, - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "../this/*" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #8", - // We throw "InvalidPackageTarget" - // expect: Some(vec!["./utils/../index"]), - expect: None, - exports_field: exports_field(json!({ - "./utils/": { - "browser": "./utils/../" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #8 (wildcard)", - // We throw "InvalidPackageTarget" - // expect: Some(vec!["./utils/../index"]), - expect: None, - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "./utils/../*" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #9", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./": "./src/../../", - "./dist/": "./dist/" - })), - request: "./dist/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #9 (wildcard)", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./*": "./src/../../*", - "./dist/*": "./dist/*" - })), - request: "./dist/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking target folder #1", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../../index"]), - exports_field: exports_field(json!({ - "./utils/": "./dist/" - })), - request: "./utils/timezone/../../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #1 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../../index"]), - exports_field: exports_field(json!({ - "./utils/*": "./dist/*" - })), - request: "./utils/timezone/../../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #2", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../index"]), - exports_field: exports_field(json!({ - "./utils/": "./dist/" - })), - request: "./utils/timezone/../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #2 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../index"]), - exports_field: exports_field(json!({ - "./utils/*": "./dist/*" - })), - request: "./utils/timezone/../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #3", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/target/../../index"]), - exports_field: exports_field(json!({ - "./utils/": "./dist/target/" - })), - request: "./utils/../../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #3 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/target/../../index"]), - exports_field: exports_field(json!({ - "./utils/*": "./dist/target/*" - })), - request: "./utils/../../index", - condition_names: vec![], - }, - // enhanced-resolve does not handle `node_modules` in target - TestCase { - name: "nested node_modules path #1", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": "./node_modules/" - } - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #1 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "./node_modules/*" - } - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #2", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./utils/../node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/": "./utils/../node_modules/" - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "nested node_modules path #2 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./utils/../node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": "./utils/../node_modules/*" - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "nested mapping #1", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": "./", - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested mapping #1 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": "./*", - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "nested mapping #2 (wildcard)", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #2 (wildcard)", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "nested mapping #3", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["webpack"], - }, - TestCase { - name: "nested mapping #3 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["webpack"], - }, - TestCase { - name: "nested mapping #4", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["node", "browser"], - }, - TestCase { - name: "nested mapping #4 (wildcard)", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["node", "browser"], - }, - TestCase { - name: "nested mapping #5", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node"], - }, - TestCase { - name: "nested mapping #5 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": { - "webpack": [ - "./wpck/*" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node"], - }, - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - TestCase { - name: "nested mapping #6 (wildcard)", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": { - "webpack": [ - "./wpck/*" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #6 (wildcard)", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./node/*" - ], - "default": { - "node": { - "webpack": [ - "./wpck/*" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - TestCase { - name: "nested mapping #7", - expect: Some(vec!["./y.js"]), - exports_field: exports_field(json!({ - "./a.js": { - "abc": { - "def": "./x.js" - }, - "ghi": "./y.js" - } - })), - request: "./a.js", - condition_names: vec!["abc", "ghi"], - }, - TestCase { - name: "nested mapping #8", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./a.js": { - "abc": { - "def": "./x.js", - "default": [] - }, - "ghi": "./y.js" - } - })), - request: "./a.js", - condition_names: vec!["abc", "ghi"], - }, - TestCase { - name: "syntax sugar #1", - expect: Some(vec!["./main.js"]), - exports_field: exports_field(json!("./main.js")), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #2", - expect: Some(vec![]), - exports_field: exports_field(json!("./main.js")), - request: "./lib.js", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #3", - expect: Some(vec!["./a.js"]), - exports_field: exports_field(json!(["./a.js", "./b.js"])), - request: ".", - condition_names: vec![], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "syntax sugar #3", - expect: Some(vec!["./b.js"]), - exports_field: exports_field(json!(["./b.js"])), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #4", - expect: Some(vec![]), - exports_field: exports_field(json!(["./a.js", "./b.js"])), - request: "./lib.js", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #5", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "browser": { - "default": "./index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "syntax sugar #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "browser": { - "default": "./index.js" - } - })), - request: "./lib.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "syntax sugar #7", - expect: None, - exports_field: exports_field(json!({ - "./node": "./node.js", - "browser": { - "default": "./index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "syntax sugar #8", - expect: None, - exports_field: exports_field(json!({ - "browser": { - "default": "./index.js" - }, - "./node": "./node.js" - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #1", - expect: Some(vec!["./abc/d"]), - exports_field: exports_field(json!({ - "./ab*": "./ab/*", - "./abc*": "./abc/*", - "./a*": "./a/*" - })), - request: "./abcd", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #2", - expect: Some(vec!["./abc/d/e"]), - exports_field: exports_field(json!({ - "./ab*": "./ab/*", - "./abc*": "./abc/*", - "./a*": "./a/*" - })), - request: "./abcd/e", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #3", - expect: Some(vec!["./abc/d"]), - exports_field: exports_field(json!({ - "./x/ab*": "./ab/*", - "./x/abc*": "./abc/*", - "./x/a*": "./a/*" - })), - request: "./x/abcd", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #4", - expect: Some(vec!["./abc/d/e"]), - exports_field: exports_field(json!({ - "./x/ab*": "./ab/*", - "./x/abc*": "./abc/*", - "./x/a*": "./a/*" - })), - request: "./x/abcd/e", - condition_names: vec!["browser"], - }, - TestCase { - name: "path tree edge case #1", - expect: Some(vec!["./A/b/d.js"]), - exports_field: exports_field(json!({ - "./a/": "./A/", - "./a/b/c": "./c.js" - })), - request: "./a/b/d.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #1 (wildcard)", - expect: Some(vec!["./A/b/d.js"]), - exports_field: exports_field(json!({ - "./a/*": "./A/*", - "./a/b/c": "./c.js" - })), - request: "./a/b/d.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #2", - expect: Some(vec!["./A/c.js"]), - exports_field: exports_field(json!({ - "./a/": "./A/", - "./a/b": "./b.js" - })), - request: "./a/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #2 (wildcard)", - expect: Some(vec!["./A/c.js"]), - exports_field: exports_field(json!({ - "./a/*": "./A/*", - "./a/b": "./b.js" - })), - request: "./a/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #3", - expect: Some(vec!["./A/b/d/c.js"]), - exports_field: exports_field(json!({ - "./a/": "./A/", - "./a/b/c/d": "./c.js" - })), - request: "./a/b/d/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #3 (wildcard)", - expect: Some(vec!["./A/b/d/c.js"]), - exports_field: exports_field(json!({ - "./a/*": "./A/*", - "./a/b/c/d": "./c.js" - })), - request: "./a/b/d/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #1", - expect: Some(vec!["./A/b.js"]), - exports_field: exports_field(json!({ - "./a/*.js": "./A/*.js" - })), - request: "./a/b.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #2", - expect: Some(vec!["./A/b/c.js"]), - exports_field: exports_field(json!({ - "./a/*.js": "./A/*.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #3", - expect: Some(vec!["./A/b/c.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": "./A/*/c.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #4", - expect: Some(vec!["./A/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": "./A/*/*.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #5", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/*.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #5", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/*.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./lib/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #6", - expect: Some(vec!["./browser/foo/bar.js"]), - exports_field: exports_field(json!({ - "./lib/*/bar.js": { - "browser": [ - "./browser/*/bar.js" - ] - }, - "./dist/*/bar.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./lib/foo/bar.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #6", - expect: Some(vec!["./browser/foo.js"]), - exports_field: exports_field(json!({ - "./lib/*/bar.js": { - "browser": [ - "./browser/*/bar.js" - ] - }, - "./dist/*/bar.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./dist/foo/bar.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #7", - expect: Some(vec!["./browser/foo/default.js"]), - exports_field: exports_field(json!({ - "./lib/*/bar.js": { - "browser": [ - "./browser/*/bar.js" - ] - }, - "./dist/*/bar.js": { - "node": "./*.js", - "default": "./browser/*/default.js" - } - })), - request: "./dist/foo/bar.js", - condition_names: vec!["default"], - }, - TestCase { - name: "wildcard pattern #8", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": "./A/*/*/*.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #9", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": [ - "./A/*/*/*.js", - "./B/*/*/*.js" - ] - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "wildcard pattern #9", - expect: Some(vec!["./B/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": [ - "./B/*/*/*.js" - ] - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #10", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/foo-*/c.js": "./A/*/*/*.js" - })), - request: "./a/foo-b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #11", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*-foo/c.js": "./A/*/*/*.js" - })), - request: "./a/b-foo/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #12", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/foo-*-foo/c.js": "./A/*/*/*.js" - })), - request: "./a/foo-b-foo/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #13", - expect: Some(vec!["./A/b/c/d.js"]), - exports_field: exports_field(json!({ - "./a/foo-*-foo/c.js": "./A/b/c/d.js" - })), - request: "./a/foo-b-foo/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #14", - expect: Some(vec!["./A/b/c/*.js"]), - exports_field: exports_field(json!({ - "./a/foo-foo/c.js": "./A/b/c/*.js" - })), - request: "./a/foo-foo/c.js", - condition_names: vec![], - }, - ]; - - for case in test_cases { - let resolved = Resolver::new(ResolveOptions { - condition_names: case - .condition_names - .iter() - .map(ToString::to_string) - .collect::>(), - ..ResolveOptions::default() - }) - .package_exports_resolve( - Path::new(""), - case.request, - &case.exports_field, - &mut Ctx::default(), - ) - .map(|p| p.map(|p| p.to_path_buf())); - if let Some(expect) = case.expect { - if expect.is_empty() { - assert!( - matches!(resolved, Err(ResolveError::PackagePathNotExported(_, _))), - "{} {:?}", - &case.name, - &resolved - ); - } else { - for expect in expect { - assert_eq!(resolved, Ok(Some(Path::new(expect).normalize())), "{}", &case.name); - } - } - } else { - assert!(resolved.is_err(), "{} {resolved:?}", &case.name); - } - } -} diff --git a/src/tests/extension_alias.rs b/src/tests/extension_alias.rs deleted file mode 100644 index cc6a906b..00000000 --- a/src/tests/extension_alias.rs +++ /dev/null @@ -1,70 +0,0 @@ -//! - -use crate::{ResolveError, ResolveOptions, Resolver}; - -#[test] -fn extension_alias() { - let f = super::fixture().join("extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - extension_alias: vec![ - (".js".into(), vec![".ts".into(), ".js".into()]), - (".mjs".into(), vec![".mts".into()]), - ], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should alias fully specified file", f.clone(), "./index.js", f.join("index.ts")), - ("should alias fully specified file when there are two alternatives", f.clone(), "./dir/index.js", f.join("dir/index.ts")), - ("should also allow the second alternative", f.clone(), "./dir2/index.js", f.join("dir2/index.js")), - ("should support alias option without an array", f.clone(), "./dir2/index.mjs", f.join("dir2/index.mts")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } - - #[rustfmt::skip] - let fail = [ - ("should not allow to fallback to the original extension or add extensions", f.clone(), "./index.mjs"), - ]; - - for (comment, path, request) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!( - resolution, - Err(ResolveError::ExtensionAlias(f.join(request))), - "{comment} {path:?} {request}" - ); - } -} - -// should not apply extension alias to extensions or mainFiles field -#[test] -fn not_apply_to_extension_nor_main_files() { - let f = super::fixture().join("extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - extension_alias: vec![(".js".into(), vec![])], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("directory", f.clone(), "./dir2", "dir2/index.js"), - ("file", f.clone(), "./dir2/index", "dir2/index.js"), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - let expected = f.join(expected); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} diff --git a/src/tests/extensions.rs b/src/tests/extensions.rs deleted file mode 100644 index 1ebd86f4..00000000 --- a/src/tests/extensions.rs +++ /dev/null @@ -1,125 +0,0 @@ -//! - -use crate::{EnforceExtension, Resolution, ResolveContext, ResolveError, ResolveOptions, Resolver}; -use rustc_hash::FxHashSet; - -#[test] -fn extensions() { - let f = super::fixture().join("extensions"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".ts".into(), ".js".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve according to order of provided extensions", "./foo", "foo.ts"), - ("should resolve according to order of provided extensions (dir index)", "./dir", "dir/index.ts"), - ("should resolve according to main field in module root", ".", "index.js"), - // This is a core module - // ("should resolve single file module before directory", "module", "node_modules/module.js"), - ("should resolve trailing slash directory before single file", "module/", "node_modules/module/index.ts"), - ]; - - for (comment, request, expected_path) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - let expected = f.join(expected_path); - assert_eq!(resolved_path, Ok(expected), "{comment} {request} {expected_path}"); - } - - #[rustfmt::skip] - let fail = [ - ("not resolve to file when request has a trailing slash (relative)", "./foo.js/", "./foo.js/".into()) - ]; - - for (comment, request, expected_error) in fail { - let resolution = resolver.resolve(&f, request); - let error = ResolveError::NotFound(expected_error); - assert_eq!(resolution, Err(error), "{comment} {request} {resolution:?}"); - } -} - -// should default enforceExtension to true when extensions includes an empty string -#[test] -fn default_enforce_extension() { - let f = super::fixture().join("extensions"); - - let mut ctx = ResolveContext::default(); - let resolved = Resolver::new(ResolveOptions { - extensions: vec![".ts".into(), String::new(), ".js".into()], - ..ResolveOptions::default() - }) - .resolve_with_context(&f, "./foo", &mut ctx); - - assert_eq!(resolved.map(Resolution::into_path_buf), Ok(f.join("foo.ts"))); - assert_eq!( - ctx.file_dependencies, - FxHashSet::from_iter([f.join("foo.ts"), f.join("package.json")]) - ); - assert!(ctx.missing_dependencies.is_empty()); -} - -// should respect enforceExtension when extensions includes an empty string -#[test] -fn respect_enforce_extension() { - let f = super::fixture().join("extensions"); - - let mut ctx = ResolveContext::default(); - let resolved = Resolver::new(ResolveOptions { - enforce_extension: EnforceExtension::Disabled, - extensions: vec![".ts".into(), String::new(), ".js".into()], - ..ResolveOptions::default() - }) - .resolve_with_context(&f, "./foo", &mut ctx); - - assert_eq!(resolved.map(Resolution::into_path_buf), Ok(f.join("foo.ts"))); - assert_eq!( - ctx.file_dependencies, - FxHashSet::from_iter([f.join("foo.ts"), f.join("package.json")]) - ); - assert_eq!(ctx.missing_dependencies, FxHashSet::from_iter([f.join("foo")])); -} - -#[test] -fn multi_dot_extension() { - let f = super::fixture().join("extensions"); - - let resolver = Resolver::new(ResolveOptions { - // Test for `.d.ts`, not part of enhanced-resolve. - extensions: vec![".a.b.c".into(), ".d.ts".into(), ".ts".into(), ".js".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve according to order of provided extensions", "./foo", "foo.ts"), - ("should resolve file with extension", "./app.module", "app.module.js") - ]; - - for (comment, request, expected_path) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - let expected = f.join(expected_path); - assert_eq!(resolved_path, Ok(expected), "{comment} {request} {expected_path}"); - } - - #[rustfmt::skip] - let fail = [ - ("not resolve to file", "./index.", "./index.".into()) - ]; - - for (comment, request, expected_error) in fail { - let resolution = resolver.resolve(&f, request); - let error = ResolveError::NotFound(expected_error); - assert_eq!(resolution, Err(error), "{comment} {request} {resolution:?}"); - } -} - -#[test] -#[should_panic = "All extensions must start with a leading dot"] -fn without_leading_dot() { - Resolver::new(ResolveOptions { - extensions: vec!["ts".into(), "js".into()], - ..ResolveOptions::default() - }); -} diff --git a/src/tests/fallback.rs b/src/tests/fallback.rs deleted file mode 100644 index 3da2d767..00000000 --- a/src/tests/fallback.rs +++ /dev/null @@ -1,100 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/fallback.test.js - -#[test] -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -fn fallback() { - use super::memory_fs::MemoryFS; - use crate::{AliasValue, ResolveError, ResolveOptions, ResolverGeneric}; - use std::path::{Path, PathBuf}; - - let f = Path::new("/"); - - let file_system = MemoryFS::new(&[ - ("/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", ""), - ]); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - fallback: vec![ - ("aliasA".into(), vec![AliasValue::Path("a".into())]), - ("b$".into(), vec![AliasValue::Path("a/index".into())]), - ("c$".into(), vec![AliasValue::Path("/a/index".into())]), - ( - "multiAlias".into(), - vec![ - AliasValue::Path("b".into()), - AliasValue::Path("c".into()), - AliasValue::Path("d".into()), - AliasValue::Path("e".into()), - AliasValue::Path("a".into()), - ], - ), - ("recursive".into(), vec![AliasValue::Path("recursive/dir".into())]), - ("/d/dir".into(), vec![AliasValue::Path("/c/dir".into())]), - ("/d/index.js".into(), vec![AliasValue::Path("/c/index".into())]), - ("ignored".into(), vec![AliasValue::Ignore]), - ("node:path".into(), vec![AliasValue::Ignore]), - ], - modules: vec!["/".into()], - ..ResolveOptions::default() - }, - ); - - #[rustfmt::skip] - let pass = [ - ("should resolve a not aliased module 1", "a", "/a/index"), - ("should resolve a not aliased module 2", "a/index", "/a/index"), - ("should resolve a not aliased module 3", "a/dir", "/a/dir/index"), - ("should resolve a not aliased module 4", "a/dir/index", "/a/dir/index"), - ("should resolve an fallback module 1", "aliasA", "/a/index"), - ("should resolve an fallback module 2", "aliasA/index", "/a/index"), - ("should resolve an fallback module 3", "aliasA/dir", "/a/dir/index"), - ("should resolve an fallback module 4", "aliasA/dir/index", "/a/dir/index"), - ("should resolve a recursive aliased module 1", "recursive", "/recursive/index"), - ("should resolve a recursive aliased module 2", "recursive/index", "/recursive/index"), - ("should resolve a recursive aliased module 3", "recursive/dir", "/recursive/dir/index"), - ("should resolve a recursive aliased module 4", "recursive/dir/index", "/recursive/dir/index"), - ("should resolve a recursive aliased module 5", "recursive/file", "/recursive/dir/file"), - ("should resolve a file aliased module with a query 1", "b?query", "/b/index?query"), - ("should resolve a file aliased module with a query 2", "c?query", "/c/index?query"), - ("should resolve a path in a file aliased module 1", "b/index", "/b/index"), - ("should resolve a path in a file aliased module 2", "b/dir", "/b/dir/index"), - ("should resolve a path in a file aliased module 3", "b/dir/index", "/b/dir/index"), - ("should resolve a path in a file aliased module 4", "c/index", "/c/index"), - ("should resolve a path in a file aliased module 5", "c/dir", "/c/dir/index"), - ("should resolve a path in a file aliased module 6", "c/dir/index", "/c/dir/index"), - ("should resolve a file in multiple aliased dirs 1", "multiAlias/dir/file", "/e/dir/file"), - ("should resolve a file in multiple aliased dirs 2", "multiAlias/anotherDir", "/e/anotherDir/index"), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - - #[rustfmt::skip] - let ignore = [ - ("should resolve an ignore module", "ignored", ResolveError::Ignored(f.join("ignored"))), - ("should resolve node: builtin module", "node:path", ResolveError::Ignored(PathBuf::from("/node:path"))), - ]; - - for (comment, request, expected) in ignore { - let resolution = resolver.resolve(f, request); - assert_eq!(resolution, Err(expected), "{comment} {request}"); - } -} diff --git a/src/tests/full_specified.rs b/src/tests/full_specified.rs deleted file mode 100644 index a70c0191..00000000 --- a/src/tests/full_specified.rs +++ /dev/null @@ -1,113 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/fullSpecified.test.js - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows { - use std::path::PathBuf; - - use crate::{AliasValue, ResolveOptions, ResolverGeneric}; - - use super::super::memory_fs::MemoryFS; - - fn file_system() -> MemoryFS { - MemoryFS::new(&[ - ("/a/node_modules/package1/index.js", ""), - ("/a/node_modules/package1/file.js", ""), - ("/a/node_modules/package2/package.json", r#"{"main":"a"}"#), - ("/a/node_modules/package2/a.js", ""), - ("/a/node_modules/package3/package.json", r#"{"main":"dir"}"#), - ("/a/node_modules/package3/dir/index.js", ""), - ("/a/node_modules/package4/package.json", r#"{"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", ""), - ]) - } - - #[test] - fn test() { - let file_system = file_system(); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - alias: vec![ - ("alias1".into(), vec![AliasValue::from("/a/abc")]), - ("alias2".into(), vec![AliasValue::from("/a")]), - ], - alias_fields: vec![vec!["browser".into()]], - fully_specified: true, - ..ResolveOptions::default() - }, - ); - - let failing_resolves = [ - ("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"), - ]; - - for (comment, request) in failing_resolves { - let resolution = resolver.resolve("/a", request); - assert!(resolution.is_err(), "{comment} {request}"); - } - - let successful_resolves = [ - ("fully relative", "./abc.js", "/a/abc.js"), - ("fully absolute", "/a/abc.js", "/a/abc.js"), - ("fully relative in package", "package1/file.js", "/a/node_modules/package1/file.js"), - ("extensions in mainFiles", "package1", "/a/node_modules/package1/index.js"), - ("extensions in mainFields", "package2", "/a/node_modules/package2/a.js"), - ("extensions in alias", "alias1", "/a/abc.js"), - ("directories in alias", "alias2", "/a/index.js"), - ("directories in packages", "package3", "/a/node_modules/package3/dir/index.js"), - ("extensions in aliasFields", "package4/a.js", "/a/node_modules/package4/b.js"), - ]; - - for (comment, request, expected) in successful_resolves { - let resolution = resolver.resolve("/a", request).map(|r| r.full_path()); - assert_eq!(resolution, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - } - - #[test] - #[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. - fn resolve_to_context() { - let file_system = file_system(); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - alias: vec![ - ("alias1".into(), vec![AliasValue::from("/a/abc")]), - ("alias2".into(), vec![AliasValue::from("/a")]), - ], - alias_fields: vec![vec!["browser".into()]], - fully_specified: true, - resolve_to_context: true, - ..ResolveOptions::default() - }, - ); - - let successful_resolves = [ - ("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", "/a/node_modules/package3/dir"), - ]; - - for (comment, request, expected) in successful_resolves { - let resolution = resolver.resolve("/a", request).map(|r| r.full_path()); - assert_eq!(resolution, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - } -} diff --git a/src/tests/imports_field.rs b/src/tests/imports_field.rs deleted file mode 100644 index c928627a..00000000 --- a/src/tests/imports_field.rs +++ /dev/null @@ -1,1320 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/importsField.test.js -//! -//! The huge imports field test cases are at the bottom of this file. - -use serde_json::json; - -use crate::{Ctx, JSONMap, PathUtil, ResolveError, ResolveOptions, Resolver}; -use std::path::Path; - -#[test] -fn test_simple() { - let f = super::fixture().join("imports-field"); - let f2 = super::fixture().join("imports-exports-wildcard/node_modules/m/"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve using imports field instead of self-referencing", f.clone(), "#imports-field", f.join("b.js")), - ("should resolve using imports field instead of self-referencing for a subpath", f.join("dir"), "#imports-field", f.join("b.js")), - ("should resolve package #1", f.clone(), "#a/dist/main.js", f.join("node_modules/a/lib/lib2/main.js")), - ("should resolve package #3", f.clone(), "#ccc/index.js", f.join("node_modules/c/index.js")), - ("should resolve package #4", f.clone(), "#c", f.join("node_modules/c/index.js")), - ("should resolve with wildcard pattern", f2.clone(), "#internal/i.js", f2.join("src/internal/i.js")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } - - // Note added: - // * should resolve absolute path as an imports field target - // * should log the correct info - - #[rustfmt::skip] - let fail = [ - ("should disallow resolve out of package scope", f.clone(), "#b", ResolveError::InvalidPackageTarget("../b.js".to_string(), "#b".to_string(), f.join("package.json"))), - ("should resolve package #2", f.clone(), "#a", ResolveError::PackageImportNotDefined("#a".to_string(), f.join("package.json"))), - ]; - - for (comment, path, request, error) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!(resolution, Err(error), "{comment} {path:?} {request}"); - } -} - -#[test] -fn shared_resolvers() { - let f = super::fixture().join("imports-field"); - - // field name #1 - let resolver1 = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - imports_fields: vec![vec!["imports".into()]], - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - let resolved_path = resolver1.resolve(&f, "#imports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("b.js"))); - - // field name #2 - let resolver2 = resolver1.clone_with_options(ResolveOptions { - imports_fields: vec![vec!["other".into(), "imports".into()]], - ..ResolveOptions::default() - }); - - let resolved_path = resolver2.resolve(&f, "#b").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("a.js"))); -} - -// Small script for generating the test cases from enhanced_resolve -// for (c of testCases) { -// console.log("TestCase {") -// console.log(`name: ${JSON.stringify(c.name)},`) -// if (c.expect instanceof Error) { -// console.log(`expect: None,`) -// } else { -// console.log(`expect: Some(vec!${JSON.stringify(c.expect)}),`) -// } -// console.log(`imports_field: imports_field(json!(${JSON.stringify(c.suite[0], null, 2)})),`) -// console.log(`request: "${c.suite[1]}",`) -// console.log(`condition_names: vec!${JSON.stringify(c.suite[2])},`) -// console.log("},") -// } - -struct TestCase { - name: &'static str, - expect: Option>, - imports_field: JSONMap, - request: &'static str, - condition_names: Vec<&'static str>, -} - -#[allow(clippy::needless_pass_by_value)] -fn imports_field(value: serde_json::Value) -> JSONMap { - let s = serde_json::to_string(&value).unwrap(); - serde_json::from_str(&s).unwrap() -} - -#[test] -fn test_cases() { - let test_cases = [ - TestCase { - name: "sample #1", - expect: Some(vec!["./dist/test/file.js"]), - imports_field: imports_field(json!({ - "#abc/": { - "import": [ - "./dist/", - "./src/" - ], - "webpack": "./wp/" - }, - "#abc": "./main.js" - })), - request: "#abc/test/file.js", - condition_names: vec!["import", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "sample #1", - expect: Some(vec!["./src/test/file.js"]), - imports_field: imports_field(json!({ - "#abc/": { - "import": [ - "./src/" - ], - "webpack": "./wp/" - }, - "#abc": "./main.js" - })), - request: "#abc/test/file.js", - condition_names: vec!["import", "webpack"], - }, - TestCase { - name: "sample #2", - expect: Some(vec!["./data/timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#1/timezones/": "./data/timezones/" - })), - request: "#1/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #3", - expect: Some(vec!["./data/timezones/timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#aaa/": "./data/timezones/", - "#a/": "./data/timezones/" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #4", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/lib/": { - "browser": [ - "./browser/" - ] - }, - "#a/dist/index.js": { - "node": "./index.js" - } - })), - request: "#a/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #5", - expect: Some(vec!["./browser/index.js"]), - imports_field: imports_field(json!({ - "#a/lib/": { - "browser": [ - "./browser/" - ] - }, - "#a/dist/index.js": { - "node": "./index.js", - "default": "./browser/index.js" - } - })), - request: "#a/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #6", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/dist/a": "./dist/index.js" - })), - request: "#a/dist/aaa", - condition_names: vec![], - }, - TestCase { - name: "sample #7", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/a/a/": "./dist/index.js" - })), - request: "#a/a/a", - condition_names: vec![], - }, - TestCase { - name: "sample #8", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": "./index.js" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #9", - expect: Some(vec!["./main.js"]), - imports_field: imports_field(json!({ - "#a/index.js": "./main.js" - })), - request: "#a/index.js", - condition_names: vec![], - }, - TestCase { - name: "sample #10", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #11", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/bar#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #12", - expect: Some(vec!["./ok.js#abc"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/ok.js#abc", - condition_names: vec![], - }, - TestCase { - name: "sample #13", - expect: Some(vec!["./ok.js?abc"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/ok.js?abc", - condition_names: vec![], - }, - TestCase { - name: "sample #14", - expect: Some(vec!["./🎉.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/🎉.js", - condition_names: vec![], - }, - TestCase { - name: "sample #15", - expect: Some(vec!["./%F0%9F%8E%89.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/%F0%9F%8E%89.js", - condition_names: vec![], - }, - TestCase { - name: "sample #16", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/🎉", - condition_names: vec![], - }, - TestCase { - name: "sample #17", - expect: Some(vec!["./other.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/%F0%9F%8E%89", - condition_names: vec![], - }, - TestCase { - name: "sample #18", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/module", - condition_names: vec![], - }, - TestCase { - name: "sample #19", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/module#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #20", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/module?foo", - condition_names: vec![], - }, - TestCase { - name: "sample #21", - expect: Some(vec!["./d?e?f"]), - imports_field: imports_field(json!({ - "#a/a?b?c/": "./" - })), - request: "#a/a?b?c/d?e?f", - condition_names: vec![], - }, - TestCase { - name: "sample #22", - // We throw InvalidPackageTarget - expect: None, - // expect: Some(vec!["/user/a/index"]), - imports_field: imports_field(json!({ - "#a/": "/user/a/" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #1", - expect: Some(vec!["./A/b/d.js"]), - imports_field: imports_field(json!({ - "#a/": "./A/", - "#a/b/c": "./c.js" - })), - request: "#a/b/d.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #2", - expect: Some(vec!["./A/c.js"]), - imports_field: imports_field(json!({ - "#a/": "./A/", - "#a/b": "./b.js" - })), - request: "#a/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #3", - expect: Some(vec!["./A/b/c/d.js"]), - imports_field: imports_field(json!({ - "#a/": "./A/", - "#a/b/c/d": "./c.js" - })), - request: "#a/b/c/d.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #1", - expect: Some(vec!["./dist/index.js"]), - imports_field: imports_field(json!({ - "#a": "./dist/index.js" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #2", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": "./" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #3", - expect: Some(vec!["./dist/a.js"]), - imports_field: imports_field(json!({ - "#a/": "./dist/", - "#a/index.js": "./dist/a.js" - })), - request: "#a/index.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #4", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "./browser/" - ] - }, - "#a/index.js": { - "browser": "./index.js" - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #5", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "./browser/" - ] - }, - "#a/index.js": { - "node": "./node.js" - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #6", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: "#a", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #7", - expect: Some(vec!["./src/index.js"]), // `enhanced_resolve` is `None` - imports_field: imports_field(json!({ - "#a": { - "default": "./src/index.js", - "browser": "./index.js", - "node": "./src/node/index.js" - } - })), - request: "#a", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #8", - expect: Some(vec!["./src/index.js"]), - imports_field: imports_field(json!({ - "#a": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #9", - expect: Some(vec!["./index"]), - imports_field: imports_field(json!({ - "#a": "./index" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #10", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/index": "./index.js" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #11", - // We throw InvalidPackageTarget - // expect: Some(vec!["b"]), - expect: None, - imports_field: imports_field(json!({ - "#a": "b" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #12", - // We throw InvalidPackageTarget - // expect: Some(vec!["b/index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "b/" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #13", - // We throw InvalidPackageTarget - // expect: Some(vec!["b#anotherhashishere"]), - expect: None, - imports_field: imports_field(json!({ - "#a?q=a#hashishere": "b#anotherhashishere" - })), - request: "#a?q=a#hashishere", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #1", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #2", - expect: Some(vec!["./import.mjs"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec!["import"], - }, - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./require.js"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./import.mjs"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./require.js"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": [ - "./require.js" - ] - }, - { - "import": [ - "./import.mjs", - "#b/import.js" - ] - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./import.mjs"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "./import.mjs", - "#b/import.js" - ] - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "#b/import.js" - ] - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "mapping to a folder root #1", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#timezones": "./data/timezones/" - })), - request: "#timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #2", - expect: None, - imports_field: imports_field(json!({ - "#timezones/": "./data/timezones" - })), - request: "#timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #3", - expect: Some(vec!["./data/timezones/pdt/index.mjs"]), - imports_field: imports_field(json!({ - "#timezones/pdt/": "./data/timezones/pdt/" - })), - request: "#timezones/pdt/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #4", - expect: Some(vec!["./timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#a/": "./timezones/" - })), - request: "#a/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #5", - expect: Some(vec!["./timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#a/": "./" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #6", - expect: None, - imports_field: imports_field(json!({ - "#a/": "." - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #7", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": "./" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #1", - expect: Some(vec!["./lib/index.mjs"]), - imports_field: imports_field(json!({ - "#a/": "./", - "#a/dist/": "./lib/" - })), - request: "#a/dist/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #2", - expect: Some(vec!["./dist/utils/index.js"]), - imports_field: imports_field(json!({ - "#a/dist/utils/": "./dist/utils/", - "#a/dist/": "./lib/" - })), - request: "#a/dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #3", - expect: Some(vec!["./dist/utils/index.js"]), - imports_field: imports_field(json!({ - "#a/dist/utils/index.js": "./dist/utils/index.js", - "#a/dist/utils/": "./dist/utils/index.mjs", - "#a/dist/": "./lib/" - })), - request: "#a/dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #4", - expect: Some(vec!["./lib/index.mjs"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./browser/" - }, - "#a/dist/": "./lib/" - })), - request: "#a/dist/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #1", - // This behaves differently from enhanced_resolve, because `lodash/` is an an InvalidPackageConfig - // expect: Some(vec!["lodash/index.js"]), - expect: Some(vec!["./utils/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "conditional mapping folder #1", - expect: Some(vec!["./utils/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #2", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./node/" - ] - } - })), - request: "#a/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "conditional mapping folder #3", - expect: Some(vec!["./wpk/index.mjs"]), - imports_field: imports_field(json!({ - "#a/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils/" - ] - } - })), - request: "#a/index.mjs", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "incorrect exports field #1", - // We throw `PackageImportNotDefined` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "/utils/": "./a/" - })), - request: "#a/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #2", - // We throw `PackageImportNotDefined` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "/utils/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#a/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #3", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index": "./a/index.js" - })), - request: "#a/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #4", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index.mjs": "./a/index.js" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #5", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "#a/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #6", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index.mjs": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "#a/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #1", - // We don't throw in `package_imports_exports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": "./a/" - })), - request: "/utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect request #2", - // We don't throw in `package_imports_exports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #3", - // We don't throw in `package_imports_exports_resolve`, it's thrown in `package_imports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #4", - // We don't throw in `package_imports_exports_resolve`, it's thrown in `package_imports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#/", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #5", - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#a/", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #1", - // expect: Some(vec!["./dist/index"]), - expect: Some(vec!["dist/index"]), - imports_field: imports_field(json!({ - "#a/../../utils/": "./dist/" - })), - request: "#a/../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #2", - // We throw InvalidPackageTarget - // expect: Some(vec!["./dist/../../utils/index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "./dist/" - })), - request: "#a/../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #3", - // We throw InvalidPackageTarget - // expect: Some(vec!["../src/index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "../src/" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #4", - // We throw InvalidPackageTarget - // expect: Some(vec!["./utils/../../../index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": { - "browser": "./utils/../../../" - } - })), - request: "#a/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #1", - // expect: Some(vec!["moment/node_modules/lodash/dist/index.js"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": { - "browser": "moment/node_modules/" - } - })), - request: "#a/lodash/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #2", - // We throw InvalidPackageTarget - // expect: Some(vec!["../node_modules/lodash/dist/index.js"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "../node_modules/" - })), - request: "#a/lodash/dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "nested mapping #1", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": "./", - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./node/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "nested mapping #3", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["webpack"], - }, - TestCase { - name: "nested mapping #4", - // We throw NotFound - // expect: Some(vec!["moment/node/index.js"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "moment/node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["node", "browser"], - }, - TestCase { - name: "nested mapping #5", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "node"], - }, - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./node/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - TestCase { - name: "nested mapping #7", - expect: Some(vec!["./y.js"]), - imports_field: imports_field(json!({ - "#a": { - "abc": { - "def": "./x.js" - }, - "ghi": "./y.js" - } - })), - request: "#a", - condition_names: vec!["abc", "ghi"], - }, - TestCase { - name: "nested mapping #8", - // We throw PackageImportNotDefined - // expect: Some(vec![]), - expect: None, - imports_field: imports_field(json!({ - "#a": { - "abc": { - "def": "./x.js", - "default": [] - }, - "ghi": "./y.js" - } - })), - request: "#a", - condition_names: vec!["abc", "ghi"], - }, - ]; - - for case in test_cases { - let resolved = Resolver::default() - .package_imports_exports_resolve( - case.request, - &case.imports_field, - Path::new(""), - true, - &case.condition_names.iter().map(ToString::to_string).collect::>(), - &mut Ctx::default(), - ) - .map(|p| p.map(|p| p.to_path_buf())); - if let Some(expect) = case.expect { - if expect.is_empty() { - assert!(matches!(resolved, Ok(None)), "{} {:?}", &case.name, &resolved); - } else { - for expect in expect { - assert_eq!(resolved, Ok(Some(Path::new(expect).normalize())), "{}", &case.name); - } - } - } else { - assert!(resolved.is_err(), "{} {resolved:?}", &case.name); - } - } -} diff --git a/src/tests/incorrect_description_file.rs b/src/tests/incorrect_description_file.rs deleted file mode 100644 index e2caecbb..00000000 --- a/src/tests/incorrect_description_file.rs +++ /dev/null @@ -1,65 +0,0 @@ -//! - -use rustc_hash::FxHashSet; - -use crate::{JSONError, Resolution, ResolveContext, ResolveError, ResolveOptions, Resolver}; - -// should not resolve main in incorrect description file #1 -#[test] -fn incorrect_description_file_1() { - let f = super::fixture().join("incorrect-package"); - let mut ctx = ResolveContext::default(); - let resolution = Resolver::default().resolve_with_context(f.join("pack1"), ".", &mut ctx); - let error = ResolveError::JSON(JSONError { - path: f.join("pack1/package.json"), - message: String::from("EOF while parsing a value at line 3 column 0"), - line: 3, - column: 0, - }); - assert_eq!(resolution, Err(error)); - assert_eq!( - ctx.file_dependencies, - FxHashSet::from_iter([f.join("pack1"), f.join("pack1/package.json")]) - ); - assert!(!ctx.missing_dependencies.is_empty()); -} - -// should not resolve main in incorrect description file #2 -#[test] -fn incorrect_description_file_2() { - let f = super::fixture().join("incorrect-package"); - let resolution = Resolver::default().resolve(f.join("pack2"), "."); - let error = ResolveError::JSON(JSONError { - path: f.join("pack2/package.json"), - message: String::from("EOF while parsing a value at line 1 column 0"), - line: 1, - column: 0, - }); - assert_eq!(resolution, Err(error)); -} - -// should not resolve main in incorrect description file #3 -#[test] -fn incorrect_description_file_3() { - let f = super::fixture().join("incorrect-package"); - let resolution = Resolver::default().resolve(f.join("pack2"), "."); - assert!(resolution.is_err()); -} - -// `enhanced_resolve` does not have this test case -#[test] -fn no_description_file() { - let f = super::fixture_root().join("enhanced_resolve"); - - // has description file - let resolver = Resolver::default(); - assert_eq!( - resolver.resolve(&f, ".").map(Resolution::into_path_buf), - Ok(f.join("lib/index.js")) - ); - - // without description file - let resolver = - Resolver::new(ResolveOptions { description_files: vec![], ..ResolveOptions::default() }); - assert_eq!(resolver.resolve(&f, "."), Err(ResolveError::NotFound(".".into()))); -} diff --git a/src/tests/main_field.rs b/src/tests/main_field.rs deleted file mode 100644 index 3cadc8ce..00000000 --- a/src/tests/main_field.rs +++ /dev/null @@ -1,24 +0,0 @@ -//! Not part of enhanced_resolve's test suite - -use crate::{ResolveOptions, Resolver}; - -#[test] -fn test() { - let f = super::fixture().join("restrictions"); - - let resolver1 = Resolver::new(ResolveOptions { - main_fields: vec!["style".into()], - ..ResolveOptions::default() - }); - - let resolution = resolver1.resolve(&f, "pck2").map(|r| r.full_path()); - assert_eq!(resolution, Ok(f.join("node_modules/pck2/index.css"))); - - let resolver2 = resolver1.clone_with_options(ResolveOptions { - main_fields: vec!["module".into(), "main".into()], - ..ResolveOptions::default() - }); - - let resolution = resolver2.resolve(&f, "pck2").map(|r| r.full_path()); - assert_eq!(resolution, Ok(f.join("node_modules/pck2/module.js"))); -} diff --git a/src/tests/memory_fs.rs b/src/tests/memory_fs.rs deleted file mode 100644 index e4116609..00000000 --- a/src/tests/memory_fs.rs +++ /dev/null @@ -1,74 +0,0 @@ -use std::{ - io, - path::{Path, PathBuf}, -}; - -use crate::{FileMetadata, FileSystem}; - -#[derive(Default)] -pub struct MemoryFS { - fs: vfs::MemoryFS, -} - -impl MemoryFS { - /// # Panics - /// - /// * Fails to create directory - /// * Fails to write file - #[allow(dead_code)] - pub fn new(data: &[(&'static str, &'static str)]) -> Self { - let mut fs = Self { fs: vfs::MemoryFS::default() }; - for (path, content) in data { - fs.add_file(Path::new(path), content); - } - fs - } - - #[allow(dead_code)] - pub fn add_file(&mut self, path: &Path, content: &str) { - use vfs::FileSystem; - let fs = &mut self.fs; - // Create all parent directories - for path in path.ancestors().collect::>().iter().rev() { - let path = path.to_string_lossy(); - if !fs.exists(path.as_ref()).unwrap() { - fs.create_dir(path.as_ref()).unwrap(); - } - } - // Create file - let mut file = fs.create_file(path.to_string_lossy().as_ref()).unwrap(); - file.write_all(content.as_bytes()).unwrap(); - } -} - -impl FileSystem for MemoryFS { - fn read_to_string(&self, path: &Path) -> io::Result { - use vfs::FileSystem; - let mut file = self - .fs - .open_file(path.to_string_lossy().as_ref()) - .map_err(|err| io::Error::new(io::ErrorKind::NotFound, err))?; - let mut buffer = String::new(); - file.read_to_string(&mut buffer).unwrap(); - Ok(buffer) - } - - fn metadata(&self, path: &Path) -> io::Result { - use vfs::FileSystem; - let metadata = self - .fs - .metadata(path.to_string_lossy().as_ref()) - .map_err(|err| io::Error::new(io::ErrorKind::NotFound, err))?; - let is_file = metadata.file_type == vfs::VfsFileType::File; - let is_dir = metadata.file_type == vfs::VfsFileType::Directory; - Ok(FileMetadata::new(is_file, is_dir, false)) - } - - fn symlink_metadata(&self, path: &Path) -> io::Result { - self.metadata(path) - } - - fn canonicalize(&self, _path: &Path) -> io::Result { - Err(io::Error::new(io::ErrorKind::NotFound, "not a symlink")) - } -} diff --git a/src/tests/missing.rs b/src/tests/missing.rs deleted file mode 100644 index 4bf611ef..00000000 --- a/src/tests/missing.rs +++ /dev/null @@ -1,106 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/missing.test.js - -use normalize_path::NormalizePath; - -use crate::{AliasValue, ResolveContext, ResolveOptions, Resolver}; - -#[test] -fn test() { - let f = super::fixture(); - - let data = [ - ( - "./missing-file", - vec![f.join("missing-file"), f.join("missing-file.js"), f.join("missing-file.node")], - ), - ( - "missing-module", - vec![ - f.join("node_modules/missing-module"), - f.parent().unwrap().join("node_modules"), // enhanced-resolve is "node_modules/missing-module" - ], - ), - ( - "missing-module/missing-file", - vec![ - f.join("node_modules/missing-module"), - // f.parent().unwrap().join("node_modules/missing-module"), // we don't report this - ], - ), - ( - "m1/missing-file", - vec![ - f.join("node_modules/m1/missing-file"), - f.join("node_modules/m1/missing-file.js"), - f.join("node_modules/m1/missing-file.node"), - // f.parent().unwrap().join("node_modules/m1"), // we don't report this - ], - ), - ( - "m1/", - vec![ - f.join("node_modules/m1/index"), - f.join("node_modules/m1/index.js"), - f.join("node_modules/m1/index.json"), - f.join("node_modules/m1/index.node"), - ], - ), - ("m1/a", vec![f.join("node_modules/m1/a")]), - ]; - - let resolver = Resolver::default(); - - for (specifier, missing_dependencies) in data { - let mut ctx = ResolveContext::default(); - let _ = resolver.resolve_with_context(&f, specifier, &mut ctx); - - for path in ctx.file_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - } - - for path in missing_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - assert!( - ctx.missing_dependencies.contains(&path), - "{specifier}: {path:?} not in {:?}", - &ctx.missing_dependencies - ); - } - } -} - -#[test] -fn alias_and_extensions() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias: vec![ - ( - "@scope-js/package-name/dir$".into(), - vec![AliasValue::Path(f.join("foo/index.js").to_string_lossy().to_string())], - ), - ( - "react-dom".into(), - vec![AliasValue::Path(f.join("foo/index.js").to_string_lossy().to_string())], - ), - ], - extensions: vec![".server.ts".into()], - - ..ResolveOptions::default() - }); - - let mut ctx = ResolveContext::default(); - let _ = resolver.resolve_with_context(&f, "@scope-js/package-name/dir/router", &mut ctx); - let _ = resolver.resolve_with_context(&f, "react-dom/client", &mut ctx); - - for path in ctx.file_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - } - - for path in ctx.missing_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - if let Some(path) = path.parent() { - assert!(!path.is_file(), "{path:?} must not be a file"); - } - } -} diff --git a/src/tests/mod.rs b/src/tests/mod.rs deleted file mode 100644 index e347dd1f..00000000 --- a/src/tests/mod.rs +++ /dev/null @@ -1,51 +0,0 @@ -mod alias; -mod browser_field; -mod builtins; -mod dependencies; -mod exports_field; -mod extension_alias; -mod extensions; -mod fallback; -mod full_specified; -mod imports_field; -mod incorrect_description_file; -mod main_field; -mod memory_fs; -mod missing; -#[cfg(feature = "yarn_pnp")] -mod pnp; -mod resolve; -mod restrictions; -mod roots; -mod scoped_packages; -mod simple; -mod symlink; -mod tsconfig_paths; -mod tsconfig_project_references; - -use crate::Resolver; -use std::{env, path::PathBuf, sync::Arc, thread}; - -pub fn fixture_root() -> PathBuf { - env::current_dir().unwrap().join("fixtures") -} - -pub fn fixture() -> PathBuf { - fixture_root().join("enhanced_resolve").join("test").join("fixtures") -} - -#[test] -fn threaded_environment() { - let cwd = env::current_dir().unwrap(); - let resolver = Arc::new(Resolver::default()); - for _ in 0..2 { - _ = thread::spawn({ - let cwd = cwd.clone(); - let resolver = Arc::clone(&resolver); - move || { - _ = resolver.resolve(cwd, "."); - } - }) - .join(); - } -} diff --git a/src/tests/pnp.rs b/src/tests/pnp.rs deleted file mode 100644 index 1562a009..00000000 --- a/src/tests/pnp.rs +++ /dev/null @@ -1,45 +0,0 @@ -//! Not part of enhanced_resolve's test suite -//! -//! enhanced_resolve's test -//! cannot be ported over because it uses mocks on `pnpApi` provided by the runtime. - -use crate::{ResolveOptions, Resolver}; - -#[test] -fn pnp1() { - let fixture = super::fixture_root().join("pnp"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - pnp_manifest: Some(pnp::load_pnp_manifest(fixture.join(".pnp.cjs")).unwrap()), - ..ResolveOptions::default() - }); - - assert_eq!( - resolver.resolve(&fixture, "is-even").map(|r| r.full_path()), - Ok(fixture.join( - ".yarn/cache/is-even-npm-1.0.0-9f726520dc-2728cc2f39.zip/node_modules/is-even/index.js" - )) - ); - - assert_eq!( - resolver - .resolve( - &fixture.join( - ".yarn/cache/is-even-npm-1.0.0-9f726520dc-2728cc2f39.zip/node_modules/is-even" - ), - "is-odd" - ) - .map(|r| r.full_path()), - Ok(fixture.join( - ".yarn/cache/is-odd-npm-0.1.2-9d980a9da8-7dc6c6fd00.zip/node_modules/is-odd/index.js" - )), - ); - - assert_eq!( - resolver.resolve(&fixture, "is-odd").map(|r| r.full_path()), - Ok(fixture.join( - ".yarn/cache/is-odd-npm-3.0.1-93c3c3f41b-89ee2e353c.zip/node_modules/is-odd/index.js" - )), - ); -} diff --git a/src/tests/resolve.rs b/src/tests/resolve.rs deleted file mode 100644 index f2dbb88e..00000000 --- a/src/tests/resolve.rs +++ /dev/null @@ -1,119 +0,0 @@ -//! - -use crate::{ResolveError, ResolveOptions, Resolver}; - -#[test] -fn resolve() { - let f = super::fixture(); - - let resolver = Resolver::default(); - - let main1_js_path = f.join("main1.js").to_string_lossy().to_string(); - - #[rustfmt::skip] - let pass = [ - ("absolute path", f.clone(), main1_js_path.as_str(), f.join("main1.js")), - ("file with .js", f.clone(), "./main1.js", f.join("main1.js")), - ("file without extension", f.clone(), "./main1", f.join("main1.js")), - ("another file with .js", f.clone(), "./a.js", f.join("a.js")), - ("another file without extension", f.clone(), "./a", f.join("a.js")), - ("file in module with .js", f.clone(), "m1/a.js", f.join("node_modules/m1/a.js")), - ("file in module without extension", f.clone(), "m1/a", f.join("node_modules/m1/a.js")), - ("another file in module without extension", f.clone(), "complexm/step1", f.join("node_modules/complexm/step1.js")), - ("from submodule to file in sibling module", f.join("node_modules/complexm"), "m2/b.js", f.join("node_modules/m2/b.js")), - ("from nested directory to overwritten file in module", f.join("multiple_modules"), "m1/a.js", f.join("multiple_modules/node_modules/m1/a.js")), - ("from nested directory to not overwritten file in module", f.join("multiple_modules"), "m1/b.js", f.join("node_modules/m1/b.js")), - ("file with query", f.clone(), "./main1.js?query", f.join("main1.js?query")), - ("file with fragment", f.clone(), "./main1.js#fragment", f.join("main1.js#fragment")), - ("file with fragment and query", f.clone(), "./main1.js#fragment?query", f.join("main1.js#fragment?query")), - ("file with query and fragment", f.clone(), "./main1.js?#fragment", f.join("main1.js?#fragment")), - - ("file with query (unicode)", f.clone(), "./测试.js?query", f.join("测试.js?query")), - ("file with fragment (unicode)", f.clone(), "./测试.js#fragment", f.join("测试.js#fragment")), - ("file with fragment and query (unicode)", f.clone(), "./测试.js#fragment?query", f.join("测试.js#fragment?query")), - ("file with query and fragment (unicode)", f.clone(), "./测试.js?#fragment", f.join("测试.js?#fragment")), - - ("file in module with query", f.clone(), "m1/a?query", f.join("node_modules/m1/a.js?query")), - ("file in module with fragment", f.clone(), "m1/a#fragment", f.join("node_modules/m1/a.js#fragment")), - ("file in module with fragment and query", f.clone(), "m1/a#fragment?query", f.join("node_modules/m1/a.js#fragment?query")), - ("file in module with query and fragment", f.clone(), "m1/a?#fragment", f.join("node_modules/m1/a.js?#fragment")), - ("file in module with query and fragment", f.clone(), "m1/a?#fragment", f.join("node_modules/m1/a.js?#fragment")), - ("differ between directory and file, resolve file", f.clone(), "./dirOrFile", f.join("dirOrFile.js")), - ("differ between directory and file, resolve directory", f.clone(), "./dirOrFile/", f.join("dirOrFile/index.js")), - ("find node_modules outside of node_modules", f.join("browser-module/node_modules"), "m1/a", f.join("node_modules/m1/a.js")), - ("don't crash on main field pointing to self", f.clone(), "./main-field-self", f.join("./main-field-self/index.js")), - ("don't crash on main field pointing to self (2)", f.clone(), "./main-field-self2", f.join("./main-field-self2/index.js")), - // enhanced-resolve has `#` prepended with a `\0`, they are removed from the - // following 3 expected test results. - // See https://github.com/webpack/enhanced-resolve#escaping - ("handle fragment edge case (no fragment)", f.clone(), "./no#fragment/#/#", f.join("no#fragment/#/#.js")), - ("handle fragment edge case (fragment)", f.clone(), "./no#fragment/#/", f.join("no.js#fragment/#/")), - ("handle fragment escaping", f.clone(), "./no\0#fragment/\0#/\0##fragment", f.join("no#fragment/#/#.js#fragment")), - - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn issue238_resolve() { - let f = super::fixture().join("issue-238"); - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into(), ".jsx".into(), ".ts".into(), ".tsx".into()], - modules: vec!["src/a".into(), "src/b".into(), "src/common".into(), "node_modules".into()], - ..ResolveOptions::default() - }); - let resolved_path = - resolver.resolve(f.join("src/common"), "config/myObjectFile").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("src/common/config/myObjectFile.js")),); -} - -#[test] -fn prefer_relative() { - let f = super::fixture(); - - let resolver = - Resolver::new(ResolveOptions { prefer_relative: true, ..ResolveOptions::default() }); - - #[rustfmt::skip] - let pass = [ - ("should correctly resolve with preferRelative 1", "main1.js", f.join("main1.js")), - ("should correctly resolve with preferRelative 2", "m1/a.js", f.join("node_modules/m1/a.js")), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } -} - -#[test] -fn resolve_to_context() { - let f = super::fixture(); - let resolver = - Resolver::new(ResolveOptions { resolve_to_context: true, ..ResolveOptions::default() }); - - #[rustfmt::skip] - let data = [ - ("context for fixtures", f.clone(), "./", f.clone()), - ("context for fixtures/lib", f.clone(), "./lib", f.join("lib")), - ("context for fixtures with ..", f.clone(), "./lib/../../fixtures/./lib/..", f.clone()), - ("context for fixtures with query", f.clone(), "./?query", f.clone().with_file_name("fixtures?query")), - ]; - - for (comment, path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn resolve_hash_as_module() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions::default()); - let resolution = resolver.resolve(f, "#a"); - assert_eq!(resolution, Err(ResolveError::NotFound("#a".into()))); -} diff --git a/src/tests/restrictions.rs b/src/tests/restrictions.rs deleted file mode 100644 index 5ba56596..00000000 --- a/src/tests/restrictions.rs +++ /dev/null @@ -1,25 +0,0 @@ -//! - -use crate::{ResolveError, ResolveOptions, Resolver, Restriction}; - -// TODO: regex -// * should respect RegExp restriction -// * should try to find alternative #1 -// * should try to find alternative #2 -// * should try to find alternative #3 - -// should respect string restriction -#[test] -fn restriction1() { - let fixture = super::fixture(); - let f = fixture.join("restrictions"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - restrictions: vec![Restriction::Path(f.clone())], - ..ResolveOptions::default() - }); - - let resolution = resolver.resolve(&f, "pck2"); - assert_eq!(resolution, Err(ResolveError::Restriction(fixture.join("c.js"), f))); -} diff --git a/src/tests/roots.rs b/src/tests/roots.rs deleted file mode 100644 index b50e2a07..00000000 --- a/src/tests/roots.rs +++ /dev/null @@ -1,92 +0,0 @@ -//! - -use std::path::PathBuf; - -use crate::{AliasValue, ResolveError, ResolveOptions, Resolver}; - -fn dirname() -> PathBuf { - super::fixture_root().join("enhanced_resolve").join("test") -} - -#[test] -fn roots() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - alias: vec![("foo".into(), vec![AliasValue::from("/fixtures")])], - roots: vec![dirname(), f.clone()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should respect roots option", "/fixtures/b.js", f.join("b.js")), - ("should try another root option, if it exists", "/b.js", f.join("b.js")), - ("should respect extension", "/fixtures/b", f.join("b.js")), - ("should resolve in directory", "/fixtures/extensions/dir", f.join("extensions/dir/index.js")), - ("should respect aliases", "foo/b", f.join("b.js")), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } - - #[rustfmt::skip] - let fail = [ - ("should not work with relative path", "fixtures/b.js", ResolveError::NotFound("fixtures/b.js".into())) - ]; - - for (comment, request, expected) in fail { - let resolution = resolver.resolve(&f, request); - assert_eq!(resolution, Err(expected), "{comment} {request}"); - } -} - -#[test] -fn resolve_to_context() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - roots: vec![dirname(), f.clone()], - resolve_to_context: true, - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f, "/fixtures/lib").map(|r| r.full_path()); - let expected = f.join("lib"); - assert_eq!(resolved_path, Ok(expected)); -} - -#[test] -fn prefer_absolute() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - alias: vec![("foo".into(), vec![AliasValue::from("/fixtures")])], - roots: vec![dirname(), f.clone()], - prefer_absolute: true, - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve an absolute path (prefer absolute)", f.join("b.js").to_string_lossy().to_string(), f.join("b.js")), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(&f, &request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } -} - -#[test] -fn roots_fall_through() { - let f = super::fixture(); - let absolute_path = f.join("roots_fall_through/index.js"); - let specifier = absolute_path.to_string_lossy(); - let resolution = Resolver::new(ResolveOptions::default().with_root(&f)).resolve(&f, &specifier); - assert_eq!( - resolution.map(super::super::resolution::Resolution::into_path_buf), - Ok(absolute_path) - ); -} diff --git a/src/tests/scoped_packages.rs b/src/tests/scoped_packages.rs deleted file mode 100644 index 8258f00f..00000000 --- a/src/tests/scoped_packages.rs +++ /dev/null @@ -1,25 +0,0 @@ -//! - -use crate::{ResolveOptions, Resolver}; - -#[test] -fn scoped_packages() { - let f = super::fixture().join("scoped"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("main field should work", f.clone(), "@scope/pack1", f.join("./node_modules/@scope/pack1/main.js")), - ("browser field should work", f.clone(), "@scope/pack2", f.join("./node_modules/@scope/pack2/main.js")), - ("folder request should work", f.clone(), "@scope/pack2/lib", f.join("./node_modules/@scope/pack2/lib/index.js")) - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} diff --git a/src/tests/simple.rs b/src/tests/simple.rs deleted file mode 100644 index 08e1238a..00000000 --- a/src/tests/simple.rs +++ /dev/null @@ -1,68 +0,0 @@ -//! - -use std::env; - -use crate::Resolver; - -#[test] -fn simple() { - // mimic `enhanced-resolve/test/simple.test.js` - let dirname = env::current_dir().unwrap().join("fixtures"); - let f = dirname.join("enhanced_resolve/test"); - - let resolver = Resolver::default(); - - let data = [ - ("direct", f.clone(), "../lib/index"), - ("as directory", f, ".."), - ("as module", dirname.clone(), "./enhanced_resolve"), - ]; - - for (comment, path, request) in data { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - let expected = dirname.join("enhanced_resolve/lib/index.js"); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn dashed_name() { - let f = super::fixture(); - - let resolver = Resolver::default(); - - let data = [ - (f.clone(), "dash", f.join("node_modules/dash/index.js")), - (f.clone(), "dash-name", f.join("node_modules/dash-name/index.js")), - (f.join("node_modules/dash"), "dash", f.join("node_modules/dash/index.js")), - (f.join("node_modules/dash"), "dash-name", f.join("node_modules/dash-name/index.js")), - (f.join("node_modules/dash-name"), "dash", f.join("node_modules/dash/index.js")), - (f.join("node_modules/dash-name"), "dash-name", f.join("node_modules/dash-name/index.js")), - ]; - - for (path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{path:?} {request}"); - } -} - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows { - use super::super::memory_fs::MemoryFS; - - use crate::ResolveOptions; - - #[test] - fn no_package() { - use crate::ResolverGeneric; - use std::path::Path; - let f = Path::new("/"); - let file_system = MemoryFS::new(&[]); - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions::default(), - ); - let resolved_path = resolver.resolve(f, "package"); - assert!(resolved_path.is_err()); - } -} diff --git a/src/tests/symlink.rs b/src/tests/symlink.rs deleted file mode 100644 index 7589b560..00000000 --- a/src/tests/symlink.rs +++ /dev/null @@ -1,121 +0,0 @@ -use std::{fs, io, path::Path}; - -use crate::{ResolveOptions, Resolver}; - -#[derive(Debug, Clone, Copy)] -enum FileType { - File, - Dir, -} - -#[allow(unused_variables)] -fn symlink, Q: AsRef>( - original: P, - link: Q, - file_type: FileType, -) -> io::Result<()> { - #[cfg(target_family = "unix")] - { - std::os::unix::fs::symlink(original, link) - } - - #[cfg(target_family = "windows")] - match file_type { - FileType::File => std::os::windows::fs::symlink_file(original, link), - FileType::Dir => std::os::windows::fs::symlink_dir(original, link), - } -} - -fn init(dirname: &Path, temp_path: &Path) -> io::Result<()> { - if temp_path.exists() { - _ = fs::remove_dir_all(temp_path); - } - fs::create_dir(temp_path)?; - symlink(dirname.join("../lib/index.js"), temp_path.join("test"), FileType::File)?; - symlink(dirname.join("../lib"), temp_path.join("test2"), FileType::Dir)?; - fs::remove_file(temp_path.join("test"))?; - fs::remove_file(temp_path.join("test2"))?; - fs::remove_dir(temp_path) -} - -fn create_symlinks(dirname: &Path, temp_path: &Path) -> io::Result<()> { - fs::create_dir(temp_path).unwrap(); - symlink( - dirname.join("../lib/index.js").canonicalize().unwrap(), - temp_path.join("index.js"), - FileType::File, - )?; - symlink(dirname.join("../lib").canonicalize().unwrap(), temp_path.join("lib"), FileType::Dir)?; - symlink(dirname.join("..").canonicalize().unwrap(), temp_path.join("this"), FileType::Dir)?; - symlink(temp_path.join("this"), temp_path.join("that"), FileType::Dir)?; - symlink(Path::new("../../lib/index.js"), temp_path.join("node.relative.js"), FileType::File)?; - symlink( - Path::new("./node.relative.js"), - temp_path.join("node.relative.sym.js"), - FileType::File, - )?; - Ok(()) -} - -fn cleanup_symlinks(temp_path: &Path) { - _ = fs::remove_dir_all(temp_path); -} - -#[test] -fn test() -> io::Result<()> { - let root = super::fixture_root().join("enhanced_resolve"); - let dirname = root.join("test"); - let temp_path = dirname.join("temp"); - if !temp_path.exists() { - let is_admin = init(&dirname, &temp_path).is_ok(); - if !is_admin { - return Ok(()); - } - if let Err(err) = create_symlinks(&dirname, &temp_path) { - cleanup_symlinks(&temp_path); - return Err(err); - } - } - - let resolver_without_symlinks = - Resolver::new(ResolveOptions { symlinks: false, ..ResolveOptions::default() }); - let resolver_with_symlinks = Resolver::default(); - - #[rustfmt::skip] - let pass = [ - ("with a symlink to a file", temp_path.clone(), "./index.js"), - ("with a relative symlink to a file", temp_path.clone(), "./node.relative.js"), - ("with a relative symlink to a symlink to a file", temp_path.clone(), "./node.relative.sym.js"), - ("with a symlink to a directory 1", temp_path.clone(), "./lib/index.js"), - ("with a symlink to a directory 2", temp_path.clone(), "./this/lib/index.js"), - ("with multiple symlinks in the path 1", temp_path.clone(), "./this/test/temp/index.js"), - ("with multiple symlinks in the path 2", temp_path.clone(), "./this/test/temp/lib/index.js"), - ("with multiple symlinks in the path 3", temp_path.clone(), "./this/test/temp/this/lib/index.js"), - ("with a symlink to a directory 2 (chained)", temp_path.clone(), "./that/lib/index.js"), - ("with multiple symlinks in the path 1 (chained)", temp_path.clone(), "./that/test/temp/index.js"), - ("with multiple symlinks in the path 2 (chained)", temp_path.clone(), "./that/test/temp/lib/index.js"), - ("with multiple symlinks in the path 3 (chained)", temp_path.clone(), "./that/test/temp/that/lib/index.js"), - ("with symlinked directory as context 1", temp_path.join( "lib"), "./index.js"), - ("with symlinked directory as context 2", temp_path.join( "this"), "./lib/index.js"), - ("with symlinked directory as context and in path", temp_path.join( "this"), "./test/temp/lib/index.js"), - ("with symlinked directory in context path", temp_path.join( "this/lib"), "./index.js"), - ("with symlinked directory in context path and symlinked file", temp_path.join( "this/test"), "./temp/index.js"), - ("with symlinked directory in context path and symlinked directory", temp_path.join( "this/test"), "./temp/lib/index.js"), - ("with symlinked directory as context 2 (chained)", temp_path.join( "that"), "./lib/index.js"), - ("with symlinked directory as context and in path (chained)", temp_path.join( "that"), "./test/temp/lib/index.js"), - ("with symlinked directory in context path (chained)", temp_path.join( "that/lib"), "./index.js"), - ("with symlinked directory in context path and symlinked file (chained)", temp_path.join( "that/test"), "./temp/index.js"), - ("with symlinked directory in context path and symlinked directory (chained)", temp_path.join( "that/test"), "./temp/lib/index.js") - ]; - - for (comment, path, request) in pass { - let filename = resolver_with_symlinks.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(filename, Ok(root.join("lib/index.js")), "{comment:?}"); - - let resolved_path = - resolver_without_symlinks.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(path.join(request))); - } - - Ok(()) -} diff --git a/src/tests/tsconfig_paths.rs b/src/tests/tsconfig_paths.rs deleted file mode 100644 index b85bf6be..00000000 --- a/src/tests/tsconfig_paths.rs +++ /dev/null @@ -1,530 +0,0 @@ -//! tests for tsconfig-paths -//! -//! Fixtures copied from . - -use std::path::{Path, PathBuf}; - -use crate::{ - JSONError, ResolveError, ResolveOptions, Resolver, TsConfig, TsconfigOptions, - TsconfigReferences, -}; - -// -#[test] -fn tsconfig() { - let f = super::fixture_root().join("tsconfig"); - - #[rustfmt::skip] - let pass = [ - (f.clone(), None, "ts-path", f.join("foo.js")), - (f.join("nested"), None, "ts-path", f.join("nested/test.js")), - (f.join("cases/index"), None, "foo", f.join("node_modules/tsconfig-index/foo.js")), - // This requires reading package.json.tsconfig field - // (f.join("cases/field"), "foo", f.join("node_modules/tsconfig-field/foo.js")) - (f.join("cases/exports"), None, "foo", f.join("node_modules/tsconfig-exports/foo.js")), - (f.join("cases/extends-extension"), None, "foo", f.join("cases/extends-extension/foo.js")), - (f.join("cases/extends-extensionless"), None, "foo", f.join("node_modules/tsconfig-field/foo.js")), - (f.join("cases/extends-paths"), Some("src"), "@/index", f.join("cases/extends-paths/src/index.js")), - (f.join("cases/extends-multiple"), None, "foo", f.join("cases/extends-multiple/foo.js")), - ]; - - for (dir, subdir, request, expected) in pass { - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: dir.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - let path = subdir.map_or(dir.clone(), |subdir| dir.join(subdir)); - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{request} {path:?}"); - } - - #[rustfmt::skip] - let data = [ - (f.join("node_modules/tsconfig-not-used"), "ts-path", Ok(f.join("foo.js"))), - ]; - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - for (path, request, expected) in data { - let resolution = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolution, expected, "{path:?} {request}"); - } -} - -#[test] -fn tsconfig_fallthrough() { - let f = super::fixture_root().join("tsconfig"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "/"); - assert_eq!(resolved_path, Err(ResolveError::NotFound("/".into()))); -} - -#[test] -fn json_with_comments() { - let f = super::fixture_root().join("tsconfig/cases/trailing-comma"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "foo").map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(f.join("bar.js"))); -} - -#[test] -fn broken() { - let f = super::fixture_root().join("tsconfig"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("tsconfig_broken.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "/"); - let error = ResolveError::JSON(JSONError { - path: f.join("tsconfig_broken.json"), - message: String::from("EOF while parsing an object at line 2 column 0"), - line: 2, - column: 0, - }); - assert_eq!(resolved_path, Err(error)); -} - -// -#[test] -fn test_paths() { - let path = Path::new("/foo/tsconfig.json"); - let mut tsconfig_json = serde_json::json!({ - "compilerOptions": { - "paths": { - "jquery": ["node_modules/jquery/dist/jquery"], - "*": ["generated/*"], - "bar/*": ["test/*"], - "bar/baz/*": ["baz/*", "yo/*"], - "@/components/*": ["components/*"], - "url": ["node_modules/my-url"], - } - } - }) - .to_string(); - let tsconfig = TsConfig::parse(true, path, &mut tsconfig_json).unwrap(); - - let data = [ - ("jquery", vec!["/foo/node_modules/jquery/dist/jquery"]), - ("test", vec!["/foo/generated/test"]), - ("test/hello", vec!["/foo/generated/test/hello"]), - ("bar/hi", vec!["/foo/test/hi"]), - ("bar/baz/hi", vec!["/foo/baz/hi", "/foo/yo/hi"]), - ("@/components/button", vec!["/foo/components/button"]), - ("./jquery", vec![]), - ("url", vec!["/foo/node_modules/my-url"]), - ]; - - for (specifier, expected) in data { - let paths = tsconfig.resolve_path_alias(specifier); - let expected = expected.into_iter().map(PathBuf::from).collect::>(); - assert_eq!(paths, expected, "{specifier}"); - } -} - -// -#[test] -fn test_base_url() { - let path = Path::new("/foo/tsconfig.json"); - let mut tsconfig_json = serde_json::json!({ - "compilerOptions": { - "baseUrl": "./src" - } - }) - .to_string(); - let tsconfig = TsConfig::parse(true, path, &mut tsconfig_json).unwrap(); - - let data = [ - ("foo", vec!["/foo/src/foo"]), - ("components/button", vec!["/foo/src/components/button"]), - ("./jquery", vec![]), - ]; - - for (specifier, expected) in data { - let paths = tsconfig.resolve_path_alias(specifier); - let expected = expected.into_iter().map(PathBuf::from).collect::>(); - assert_eq!(paths, expected, "{specifier}"); - } -} - -// -#[test] -fn test_paths_and_base_url() { - let path = Path::new("/foo/tsconfig.json"); - let mut tsconfig_json = serde_json::json!({ - "compilerOptions": { - "baseUrl": "./src", - "paths": { - "*": ["generated/*"], - "bar/*": ["test/*"], - "bar/baz/*": ["baz/*", "yo/*"], - "@/components/*": ["components/*"] - } - } - }) - .to_string(); - let tsconfig = TsConfig::parse(true, path, &mut tsconfig_json).unwrap(); - - let data = [ - ("test", vec!["/foo/src/generated/test", "/foo/src/test"]), - ("test/hello", vec!["/foo/src/generated/test/hello", "/foo/src/test/hello"]), - ("bar/hi", vec!["/foo/src/test/hi", "/foo/src/bar/hi"]), - ("bar/baz/hi", vec!["/foo/src/baz/hi", "/foo/src/yo/hi", "/foo/src/bar/baz/hi"]), - ("@/components/button", vec!["/foo/src/components/button", "/foo/src/@/components/button"]), - ("./jquery", vec![]), - ]; - - for (specifier, expected) in data { - let paths = tsconfig.resolve_path_alias(specifier); - let expected = expected.into_iter().map(PathBuf::from).collect::>(); - assert_eq!(paths, expected, "{specifier}"); - } -} - -// Template variable ${configDir} for substitution of config files directory path -// https://github.com/microsoft/TypeScript/pull/58042 -#[test] -fn test_template_variable() { - let f = super::fixture_root().join("tsconfig"); - let f2 = f.join("cases").join("paths_template_variable"); - - #[rustfmt::skip] - let pass = [ - (f2.clone(), "tsconfig1.json", "foo", f2.join("foo.js")), - (f2.clone(), "tsconfig2.json", "foo", f2.join("foo.js")), - (f.clone(), "tsconfig_template_variable.json", "foo", f.join("foo.js")), - ]; - - for (dir, tsconfig, request, expected) in pass { - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: dir.join(tsconfig), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&dir, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{request} {tsconfig} {dir:?}"); - } -} - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows_test { - use std::path::{Path, PathBuf}; - - use crate::{ - ResolveError, ResolveOptions, ResolverGeneric, TsconfigOptions, TsconfigReferences, - }; - - use super::super::memory_fs::MemoryFS; - - struct OneTest { - name: &'static str, - tsconfig: String, - package_json: Option<(PathBuf, String)>, - main_fields: Option>, - existing_files: Vec<&'static str>, - requested_module: &'static str, - expected_path: &'static str, - extensions: Vec, - } - - impl Default for OneTest { - fn default() -> Self { - Self { - name: "", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/*": ["location/*"] - } - } - }) - .to_string(), - package_json: None, - main_fields: None, - existing_files: vec![], - requested_module: "", - expected_path: "", - extensions: vec![ - ".js".into(), - ".json".into(), - ".node".into(), - ".ts".into(), - ".tsx".into(), - ], - } - } - } - - impl OneTest { - fn resolver(&self, root: &Path) -> ResolverGeneric { - let mut file_system = MemoryFS::default(); - - file_system.add_file(&root.join("tsconfig.json"), &self.tsconfig); - if let Some((path, package_json)) = &self.package_json { - file_system.add_file(&root.join(path).join("package.json"), package_json); - } - for path in &self.existing_files { - file_system.add_file(Path::new(path), ""); - } - - let mut options = ResolveOptions { - extensions: self.extensions.clone(), - tsconfig: Some(TsconfigOptions { - config_file: root.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }; - if let Some(main_fields) = &self.main_fields { - options.main_fields.clone_from(main_fields); - } - - ResolverGeneric::::new_with_file_system(file_system, options) - } - } - - // Path matching tests from tsconfig-paths - // * - // * - #[test] - fn match_path() { - let pass = [ - OneTest { - name: "should locate path that matches with star and exists", - existing_files: vec!["/root/location/mylib/index.ts"], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve to correct path when many are specified", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/*": ["foo1/*", "foo2/*", "location/*", "foo3/*"], - } - } - }) - .to_string(), - existing_files: vec!["/root/location/mylib/index.ts"], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should locate path that matches with star and prioritize pattern with longest prefix", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "*": ["location/*"], - "lib/*": ["location/*"], - } - } - }) - .to_string(), - existing_files: vec![ - "/root/location/lib/mylib/index.ts", - "/root/location/mylib/index.ts", - ], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should locate path that matches with star and exists with extension", - existing_files: vec![ - "/root/location/mylib.myext", - ], - requested_module: "lib/mylib", - extensions: vec![".js".into(), ".myext".into()], - expected_path: "/root/location/mylib.myext", - ..OneTest::default() - }, - OneTest { - name: "should resolve request with extension specified", - existing_files: vec![ - "/root/location/test.jpg", - ], - requested_module: "lib/test.jpg", - expected_path: "/root/location/test.jpg", - ..OneTest::default() - }, - OneTest { - name: "should locate path that matches without star and exists", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/foo": ["location/foo"] - } - } - }) - .to_string(), - existing_files: vec![ - "/root/location/foo.ts", - ], - requested_module: "lib/foo", - expected_path: "/root/location/foo.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve to parent folder when filename is in subfolder", - existing_files: vec![ - "/root/location/mylib/index.ts", - ], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve from main field in package.json", - package_json: Some((PathBuf::from("/root/location/mylib"), serde_json::json!({ - "main": "./kalle.ts" - }).to_string())), - existing_files: vec![ - "/root/location/mylib/kalle.ts", - ], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/kalle.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve from main field in package.json (js)", - package_json: Some((PathBuf::from("/root/location/mylib.js"), serde_json::json!({ - "main": "./kalle.js" - }).to_string())), - existing_files: vec![ - "/root/location/mylib.js/kalle.js", - ], - extensions: vec![".ts".into(), ".js".into()], - requested_module: "lib/mylib.js", - expected_path: "/root/location/mylib.js/kalle.js", - ..OneTest::default() - }, - OneTest { - name: "should resolve from list of fields by priority in package.json", - main_fields: Some(vec!["missing".into(), "browser".into(), "main".into()]), - package_json: Some((PathBuf::from("/root/location/mylibjs"), serde_json::json!({ - "main": "./main.js", - "browser": "./browser.js" - }).to_string())), - existing_files: vec![ - "/root/location/mylibjs/main.js", - "/root/location/mylibjs/browser.js", - ], - extensions: vec![".ts".into(), ".js".into()], - requested_module: "lib/mylibjs", - expected_path: "/root/location/mylibjs/browser.js", - ..OneTest::default() - }, -OneTest { - name: "should ignore field mappings to missing files in package.json", - main_fields: Some(vec!["browser".into(), "main".into()]), - package_json: Some((PathBuf::from("/root/location/mylibjs"), serde_json::json!({ - "main": "./kalle.js", - "browser": "./nope.js" - }).to_string())), - existing_files: vec![ - "/root/location/mylibjs/kalle.js", - ], - extensions: vec![".ts".into(), ".js".into()], - requested_module: "lib/mylibjs", - expected_path: "/root/location/mylibjs/kalle.js", - ..OneTest::default() - }, - // Tests that are not applicable: - // name: "should resolve nested main fields" - // name: "should ignore advanced field mappings in package.json" - // name: "should resolve to with the help of baseUrl when not explicitly set" - // name: "should not resolve with the help of baseUrl when asked not to" - // name: "should resolve main file with cjs file extension" - OneTest { - name: "should resolve .ts from .js alias", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "@/*": ["src/*"] - } - } - }).to_string(), - existing_files: vec![ - "/root/src/foo.ts", - ], - requested_module: "@/foo", // original data was "@/foo.ts" but I don't get why it is the case? - expected_path: "/root/src/foo.ts", // original data was "/root/src/foo" - ..OneTest::default() - }, - ]; - - let root = PathBuf::from("/root"); - - for test in pass { - let resolved_path = - test.resolver(&root).resolve(&root, test.requested_module).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(PathBuf::from(test.expected_path)), "{}", test.name); - } - - let fail = [ - OneTest { - name: "should not locate path that does not match", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/*": ["location/*"] - } - } - }) - .to_string(), - existing_files: vec!["/root/location/mylib"], - requested_module: "lib/mylibjs", - ..OneTest::default() - }, - OneTest { - name: "should not resolve typings file (index.d.ts)", - existing_files: vec!["/root/location/mylib/index.d.ts"], - requested_module: "lib/mylib", - ..OneTest::default() - }, - ]; - - for test in fail { - let resolved_path = - test.resolver(&root).resolve(&root, test.requested_module).map(|f| f.full_path()); - assert_eq!( - resolved_path, - Err(ResolveError::NotFound(test.requested_module.into())), - "{}", - test.name - ); - } - } -} diff --git a/src/tests/tsconfig_project_references.rs b/src/tests/tsconfig_project_references.rs deleted file mode 100644 index 0d019d27..00000000 --- a/src/tests/tsconfig_project_references.rs +++ /dev/null @@ -1,132 +0,0 @@ -//! Tests for tsconfig project references - -use crate::{ResolveError, ResolveOptions, Resolver, TsconfigOptions, TsconfigReferences}; - -#[test] -fn auto() { - let f = super::fixture_root().join("tsconfig/cases/project_references"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("app"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - // Test normal paths alias - (f.join("app"), "@/index.ts", f.join("app/aliased/index.ts")), - (f.join("app"), "@/../index.ts", f.join("app/index.ts")), - // Test project reference - (f.join("project_a"), "@/index.ts", f.join("project_a/aliased/index.ts")), - (f.join("project_b/src"), "@/index.ts", f.join("project_b/src/aliased/index.ts")), - // Does not have paths alias - (f.join("project_a"), "./index.ts", f.join("project_a/index.ts")), - (f.join("project_c"), "./index.ts", f.join("project_c/index.ts")), - // Template variable - { - let dir = f.parent().unwrap().join("paths_template_variable"); - (dir.clone(), "foo", dir.join("foo.js")) - } - ]; - - for (path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{request} {path:?}"); - } -} - -#[test] -fn disabled() { - let f = super::fixture_root().join("tsconfig/cases/project_references"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("app"), - references: TsconfigReferences::Disabled, - }), - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - // Test normal paths alias - (f.join("app"), "@/index.ts", Ok(f.join("app/aliased/index.ts"))), - (f.join("app"), "@/../index.ts", Ok(f.join("app/index.ts"))), - // Test project reference - (f.join("project_a"), "@/index.ts", Err(ResolveError::NotFound("@/index.ts".into()))), - (f.join("project_b/src"), "@/index.ts", Err(ResolveError::NotFound("@/index.ts".into()))), - // Does not have paths alias - (f.join("project_a"), "./index.ts", Ok(f.join("project_a/index.ts"))), - (f.join("project_c"), "./index.ts", Ok(f.join("project_c/index.ts"))), - ]; - - for (path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, expected, "{request} {path:?}"); - } -} - -#[test] -fn manual() { - let f = super::fixture_root().join("tsconfig/cases/project_references"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("app"), - references: TsconfigReferences::Paths(vec!["../project_a/conf.json".into()]), - }), - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - // Test normal paths alias - (f.join("app"), "@/index.ts", Ok(f.join("app/aliased/index.ts"))), - (f.join("app"), "@/../index.ts", Ok(f.join("app/index.ts"))), - // Test project reference - (f.join("project_a"), "@/index.ts", Ok(f.join("project_a/aliased/index.ts"))), - (f.join("project_b/src"), "@/index.ts", Err(ResolveError::NotFound("@/index.ts".into()))), - // Does not have paths alias - (f.join("project_a"), "./index.ts", Ok(f.join("project_a/index.ts"))), - (f.join("project_c"), "./index.ts", Ok(f.join("project_c/index.ts"))), - ]; - - for (path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, expected, "{request} {path:?}"); - } -} - -#[test] -fn self_reference() { - let f = super::fixture_root().join("tsconfig/cases/project_references"); - - #[rustfmt::skip] - let pass = [ - (f.join("app"), vec!["./tsconfig.json".into()]), - (f.join("app/tsconfig.json"), vec!["./tsconfig.json".into()]), - (f.join("app"), vec![f.join("app")]), - (f.join("app/tsconfig.json"), vec![f.join("app")]), - (f.join("app/tsconfig.json"), vec![f.join("project_b"), f.join("app")]), - ]; - - for (config_file, reference_paths) in pass { - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: config_file.clone(), - references: TsconfigReferences::Paths(reference_paths.clone()), - }), - ..ResolveOptions::default() - }); - let path = f.join("app"); - let resolved_path = resolver.resolve(&path, "@/index.ts").map(|f| f.full_path()); - assert_eq!( - resolved_path, - Err(ResolveError::TsconfigSelfReference(f.join("app/tsconfig.json"))), - "{config_file:?} {reference_paths:?}" - ); - } -} diff --git a/src/tsconfig.rs b/src/tsconfig.rs deleted file mode 100644 index 6a675442..00000000 --- a/src/tsconfig.rs +++ /dev/null @@ -1,223 +0,0 @@ -use std::{ - hash::BuildHasherDefault, - path::{Path, PathBuf}, - sync::Arc, -}; - -use indexmap::IndexMap; -use rustc_hash::FxHasher; -use serde::Deserialize; - -use crate::PathUtil; - -pub type CompilerOptionsPathsMap = IndexMap, BuildHasherDefault>; - -#[derive(Debug, Clone, Eq, PartialEq, Deserialize)] -#[serde(untagged)] -pub enum ExtendsField { - Single(String), - Multiple(Vec), -} - -#[derive(Debug, Deserialize)] -#[serde(rename_all = "camelCase")] -pub struct TsConfig { - /// Whether this is the caller tsconfig. - /// Used for final template variable substitution when all configs are extended and merged. - #[serde(skip)] - root: bool, - - /// Path to `tsconfig.json`. Contains the `tsconfig.json` filename. - #[serde(skip)] - pub(crate) path: PathBuf, - - #[serde(default)] - pub extends: Option, - - #[serde(default)] - pub compiler_options: CompilerOptions, - - /// Bubbled up project references with a reference to their tsconfig. - #[serde(default)] - pub references: Vec, -} - -/// Compiler Options -/// -/// -#[derive(Debug, Default, Deserialize)] -#[serde(rename_all = "camelCase")] -pub struct CompilerOptions { - base_url: Option, - - /// Path aliases - paths: Option, - - /// The actual base for where path aliases are resolved from. - #[serde(skip)] - paths_base: PathBuf, -} - -/// Project Reference -/// -/// -#[derive(Debug, Deserialize)] -pub struct ProjectReference { - /// The path property of each reference can point to a directory containing a tsconfig.json file, - /// or to the config file itself (which may have any name). - pub path: PathBuf, - - /// Reference to the resolved tsconfig - #[serde(skip)] - pub tsconfig: Option>, -} - -impl TsConfig { - pub fn parse(root: bool, path: &Path, json: &mut str) -> Result { - _ = json_strip_comments::strip(json); - let mut tsconfig: Self = serde_json::from_str(json)?; - tsconfig.root = root; - tsconfig.path = path.to_path_buf(); - let directory = tsconfig.directory().to_path_buf(); - if let Some(base_url) = tsconfig.compiler_options.base_url { - tsconfig.compiler_options.base_url = Some(directory.normalize_with(base_url)); - } - if tsconfig.compiler_options.paths.is_some() { - tsconfig.compiler_options.paths_base = - tsconfig.compiler_options.base_url.as_ref().map_or(directory, Clone::clone); - } - Ok(tsconfig) - } - - pub fn build(mut self) -> Self { - if self.root { - let dir = self.directory().to_path_buf(); - // Substitute template variable in `tsconfig.compilerOptions.paths` - if let Some(paths) = &mut self.compiler_options.paths { - for paths in paths.values_mut() { - for path in paths { - Self::substitute_template_variable(&dir, path); - } - } - } - } - self - } - - /// Directory to `tsconfig.json` - /// - /// # Panics - /// - /// * When the `tsconfig.json` path is misconfigured. - pub fn directory(&self) -> &Path { - debug_assert!(self.path.file_name().is_some()); - self.path.parent().unwrap() - } - - pub fn extend_tsconfig(&mut self, tsconfig: &Self) { - let compiler_options = &mut self.compiler_options; - if compiler_options.paths.is_none() { - compiler_options.paths_base = compiler_options - .base_url - .as_ref() - .map_or_else(|| tsconfig.compiler_options.paths_base.clone(), Clone::clone); - compiler_options.paths.clone_from(&tsconfig.compiler_options.paths); - } - if compiler_options.base_url.is_none() { - compiler_options.base_url.clone_from(&tsconfig.compiler_options.base_url); - } - } - - pub fn resolve(&self, path: &Path, specifier: &str) -> Vec { - if path.starts_with(self.base_path()) { - let paths = self.resolve_path_alias(specifier); - if !paths.is_empty() { - return paths; - } - } - for tsconfig in self.references.iter().filter_map(|reference| reference.tsconfig.as_ref()) { - if path.starts_with(tsconfig.base_path()) { - return tsconfig.resolve_path_alias(specifier); - } - } - vec![] - } - - // Copied from parcel - // - pub fn resolve_path_alias(&self, specifier: &str) -> Vec { - if specifier.starts_with(['/', '.']) { - return vec![]; - } - - let base_url_iter = self - .compiler_options - .base_url - .as_ref() - .map_or_else(Vec::new, |base_url| vec![base_url.normalize_with(specifier)]); - - let Some(paths_map) = &self.compiler_options.paths else { - return base_url_iter; - }; - - let paths = paths_map.get(specifier).map_or_else( - || { - let mut longest_prefix_length = 0; - let mut longest_suffix_length = 0; - let mut best_key: Option<&String> = None; - - for key in paths_map.keys() { - if let Some((prefix, suffix)) = key.split_once('*') { - if (best_key.is_none() || prefix.len() > longest_prefix_length) - && specifier.starts_with(prefix) - && specifier.ends_with(suffix) - { - longest_prefix_length = prefix.len(); - longest_suffix_length = suffix.len(); - best_key.replace(key); - } - } - } - - best_key.and_then(|key| paths_map.get(key)).map_or_else(Vec::new, |paths| { - paths - .iter() - .map(|path| { - path.replace( - '*', - &specifier[longest_prefix_length - ..specifier.len() - longest_suffix_length], - ) - }) - .collect::>() - }) - }, - Clone::clone, - ); - - paths - .into_iter() - .map(|p| self.compiler_options.paths_base.normalize_with(p)) - .chain(base_url_iter) - .collect() - } - - fn base_path(&self) -> &Path { - self.compiler_options - .base_url - .as_ref() - .map_or_else(|| self.directory(), |path| path.as_ref()) - } - - /// Template variable `${configDir}` for substitution of config files directory path - /// - /// NOTE: All tests cases are just a head replacement of `${configDir}`, so we are constrained as such. - /// - /// See - fn substitute_template_variable(directory: &Path, path: &mut String) { - const TEMPLATE_VARIABLE: &str = "${configDir}/"; - if let Some(stripped_path) = path.strip_prefix(TEMPLATE_VARIABLE) { - *path = directory.join(stripped_path).to_string_lossy().to_string(); - } - } -} diff --git a/tests/integration_test.rs b/tests/integration_test.rs deleted file mode 100644 index 0fc52887..00000000 --- a/tests/integration_test.rs +++ /dev/null @@ -1,103 +0,0 @@ -//! Test public APIs - -use std::{env, path::PathBuf}; - -use oxc_resolver::{EnforceExtension, Resolution, ResolveContext, ResolveOptions, Resolver}; - -fn dir() -> PathBuf { - env::current_dir().unwrap() -} - -fn resolve(specifier: &str) -> Resolution { - let path = dir(); - Resolver::new(ResolveOptions::default()).resolve(path, specifier).unwrap() -} - -#[test] -fn clone() { - let resolution = resolve("./tests/package.json"); - assert_eq!(resolution.clone(), resolution); -} - -#[test] -fn debug() { - let resolution = resolve("./tests/package.json"); - let s = format!("{resolution:?}"); - assert!(!s.is_empty()); -} - -#[test] -fn eq() { - let resolution = resolve("./tests/package.json"); - assert_eq!(resolution, resolution); -} - -#[test] -fn package_json() { - let resolution = resolve("./tests/package.json"); - let package_json = resolution.package_json().unwrap(); - assert_eq!(package_json.name.as_ref().unwrap(), "name"); - assert_eq!(package_json.r#type.as_ref().unwrap().as_str(), "module".into()); - assert!(package_json.side_effects.as_ref().unwrap().is_object()); -} - -#[cfg(feature = "package_json_raw_json_api")] -#[test] -fn package_json_raw_json_api() { - let resolution = resolve("./tests/package.json"); - assert!(resolution - .package_json() - .unwrap() - .raw_json() - .get("name") - .is_some_and(|name| name == "name")); -} - -#[test] -fn clear_cache() { - let resolver = Resolver::new(ResolveOptions::default()); - resolver.clear_cache(); // exists -} - -#[test] -fn options() { - let resolver = Resolver::new(ResolveOptions::default()); - let options = resolver.options(); - assert!(!format!("{options:?}").is_empty()); -} - -#[test] -fn debug_resolver() { - let resolver = Resolver::new(ResolveOptions::default()); - assert!(!format!("{resolver:?}").is_empty()); -} - -#[test] -fn dependencies() { - let path = dir(); - let mut ctx = ResolveContext::default(); - let _ = Resolver::new(ResolveOptions::default()).resolve_with_context( - path, - "./tests/package.json", - &mut ctx, - ); - assert!(!ctx.file_dependencies.is_empty()); - assert!(ctx.missing_dependencies.is_empty()); -} - -#[test] -fn options_api() { - _ = ResolveOptions::default() - .with_builtin_modules(true) - .with_condition_names(&[]) - .with_extension(".js") - .with_force_extension(EnforceExtension::Auto) - .with_fully_specified(true) - .with_main_field("asdf") - .with_main_file("main") - .with_module("module") - .with_prefer_absolute(true) - .with_prefer_relative(true) - .with_root(PathBuf::new()) - .with_symbolic_link(true); -} diff --git a/tests/package.json b/tests/package.json deleted file mode 100644 index 54f58b8c..00000000 --- a/tests/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "name", - "type": "module", - "sideEffects": {} -} diff --git a/tests/resolve_test.rs b/tests/resolve_test.rs deleted file mode 100644 index 45934cf8..00000000 --- a/tests/resolve_test.rs +++ /dev/null @@ -1,132 +0,0 @@ -use std::{env, path::PathBuf}; - -use oxc_resolver::{ResolveError, ResolveOptions, Resolver}; - -fn dir() -> PathBuf { - env::current_dir().unwrap() -} - -#[test] -fn chinese() { - let dir = dir(); - let specifier = "./fixtures/misc/中文/中文.js"; - let resolution = Resolver::new(ResolveOptions::default()).resolve(&dir, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(dir.join("fixtures/misc/中文/中文.js")) - ); -} - -#[test] -fn styled_components() { - let dir = dir(); - let path = dir.join("fixtures/pnpm"); - let module_path = dir.join("node_modules/.pnpm/styled-components@6.1.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/styled-components"); - let specifier = "styled-components"; - - // cjs - let options = - ResolveOptions { alias_fields: vec![vec!["browser".into()]], ..ResolveOptions::default() }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/styled-components.browser.cjs.js")) - ); - - // esm - let options = ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - main_fields: vec!["module".into()], - ..ResolveOptions::default() - }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/styled-components.browser.esm.js")) - ); -} - -#[test] -fn axios() { - let dir = dir(); - let path = dir.join("fixtures/pnpm"); - let module_path = dir.join("node_modules/.pnpm/axios@1.6.2/node_modules/axios"); - let specifier = "axios"; - - // default - let options = ResolveOptions::default(); - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("index.js")) - ); - - // browser - let options = ResolveOptions { - condition_names: vec!["browser".into(), "require".into()], - ..ResolveOptions::default() - }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/browser/axios.cjs")) - ); - - // cjs - let options = ResolveOptions { - condition_names: vec!["node".into(), "require".into()], - ..ResolveOptions::default() - }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/node/axios.cjs")) - ); -} - -#[test] -fn postcss() { - let dir = dir(); - let path = dir.join("fixtures/pnpm"); - let module_path = path.join("node_modules/postcss"); - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - // should ignore "path" - let resolution = resolver.resolve(&module_path, "path"); - assert_eq!(resolution, Err(ResolveError::Ignored(module_path.clone()))); - - // should ignore "./lib/terminal-highlight" - let resolution = resolver.resolve(&module_path, "./lib/terminal-highlight"); - assert_eq!(resolution, Err(ResolveError::Ignored(module_path.join("lib/terminal-highlight")))); -} - -#[test] -fn ipaddr_js() { - let dir = dir(); - let path = dir.join("fixtures/pnpm"); - let module_path = - dir.join("node_modules/.pnpm/ipaddr.js@2.2.0/node_modules/ipaddr.js/lib/ipaddr.js"); - - let resolvers = [ - // with `extension_alias` - Resolver::new(ResolveOptions { - extension_alias: vec![(".js".into(), vec![".js".into(), ".ts".into(), ".tsx".into()])], - ..ResolveOptions::default() - }), - // with `extensions` should still resolve to module main - Resolver::new(ResolveOptions { - extensions: vec![(".ts".into())], - ..ResolveOptions::default() - }), - // default - Resolver::default(), - ]; - - for resolver in resolvers { - let resolution = resolver.resolve(&path, "ipaddr.js").map(|r| r.full_path()); - assert_eq!(resolution, Ok(module_path.clone())); - } -} From 5b4d4583592db478e26b994dc3f7ae76f678c16a Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Thu, 12 Sep 2024 04:31:26 +0300 Subject: [PATCH 77/82] --- .github/CODE_OF_CONDUCT.md | 127 - .github/SECURITY.md | 7 - .github/actions/pnpm/action.yml | 26 - .github/codecov.yml | 14 - .github/renovate.json | 5 - .github/workflows/benchmark.yml | 41 - .github/workflows/ci.yml | 196 - .github/workflows/codecov.yml | 69 - .github/workflows/release-napi.yml | 252 - .github/workflows/release-plz.yml | 55 - Cargo.lock | 1326 --- fixtures/enhanced_resolve/lib/index.js | 1 - fixtures/enhanced_resolve/package.json | 4 - fixtures/enhanced_resolve/test/.gitignore | 3 - .../enhanced_resolve/test/fixtures/#/a.js | 0 fixtures/enhanced_resolve/test/fixtures/a.js | 3 - .../enhanced_resolve/test/fixtures/abc.txt | 1 - .../test/fixtures/alias/files/a.js | 0 fixtures/enhanced_resolve/test/fixtures/b.js | 3 - .../browser-module/browser/module-a.js | 0 .../fixtures/browser-module/lib/browser.js | 0 .../fixtures/browser-module/lib/ignore.js | 0 .../test/fixtures/browser-module/lib/main.js | 0 .../fixtures/browser-module/lib/replaced.js | 0 .../test/fixtures/browser-module/lib/self.js | 0 .../fixtures/browser-module/lib/toString.js | 0 .../browser-module/node_modules/module-a.js | 0 .../browser-module/node_modules/module-b.js | 0 .../browser-module/node_modules/module-c.js | 0 .../node_modules/recursive-file/a.js | 0 .../node_modules/recursive-file/b.js | 0 .../node_modules/recursive-file/c.js | 0 .../node_modules/recursive-file/d.js | 0 .../node_modules/recursive-file/package.json | 8 - .../test/fixtures/browser-module/package.json | 33 - .../test/fixtures/builtins/package.json | 12 - fixtures/enhanced_resolve/test/fixtures/c.js | 4 - .../enhanced_resolve/test/fixtures/complex.js | 13 - .../test/fixtures/crypto-js/index.js | 0 .../test/fixtures/crypto-js/package.json | 7 - .../test/fixtures/decorated-fs/exists.js | 0 .../test/fixtures/dirOrFile.js | 1 - .../test/fixtures/dirOrFile/index.js | 1 - .../directory-default/directory-default.js | 0 .../node_modules/@org/pkg/dist/string.js | 1 - .../@org/pkg/dist/string.test.d.ts | 1 - .../node_modules/@org/pkg/package.json | 9 - .../node_modules/pkg/dist/string.js | 1 - .../node_modules/pkg/dist/string.test.d.ts | 1 - .../node_modules/pkg/package.json | 9 - .../node_modules/exports-field/package.json | 7 - .../node_modules/pack1/index.js | 0 .../test/fixtures/exports-field/a.js | 1 - .../node_modules/exports-field/lib/browser.js | 1 - .../node_modules/exports-field/lib/index.js | 0 .../exports-field/lib/lib2/main.js | 1 - .../node_modules/exports-field/lib/main.js | 1 - .../node_modules/exports-field/main.js | 1 - .../node_modules/exports-field/package.json | 18 - .../node_modules/exports-field/x.js | 1 - .../invalid-exports-field/index.js | 0 .../invalid-exports-field/package.json | 13 - .../node_modules/invalid-exports-field/umd.js | 0 .../test/fixtures/exports-field/package.json | 5 - .../node_modules/exports-field/index.js | 1 - .../node_modules/exports-field/lib/browser.js | 1 - .../exports-field/lib/lib2/main.js | 1 - .../node_modules/exports-field/lib/main.js | 1 - .../node_modules/exports-field/main.js | 1 - .../node_modules/exports-field/package.json | 17 - .../node_modules/exports-field/index | 0 .../node_modules/exports-field/main.js | 1 - .../node_modules/exports-field/package.json | 10 - .../node_modules/exports-field/src/index.js | 0 .../fixtures/extension-alias/dir/index.js | 0 .../fixtures/extension-alias/dir/index.ts | 0 .../fixtures/extension-alias/dir2/index.js | 0 .../fixtures/extension-alias/dir2/index.mts | 0 .../test/fixtures/extension-alias/index.js | 0 .../test/fixtures/extension-alias/index.mjs | 0 .../fixtures/extension-alias/index.mts.js | 0 .../test/fixtures/extension-alias/index.ts | 0 .../test/fixtures/extensions/app.module.js | 0 .../test/fixtures/extensions/dir/index.js | 0 .../test/fixtures/extensions/dir/index.ts | 0 .../test/fixtures/extensions/foo.js | 0 .../test/fixtures/extensions/foo.ts | 0 .../test/fixtures/extensions/index.js | 0 .../test/fixtures/extensions/index.ts | 0 .../extensions/node_modules/module.js | 0 .../extensions/node_modules/module/index.ts | 0 .../test/fixtures/extensions/package.json | 3 - .../enhanced_resolve/test/fixtures/file.load1 | 0 .../enhanced_resolve/test/fixtures/file.load2 | 0 .../test/fixtures/foo/index.js | 0 .../test/fixtures/foo/package.json | 4 - .../node_modules/m/package.json | 17 - .../node_modules/m/src/features/f.js | 0 .../m/src/features/internal/file.js | 0 .../node_modules/m/src/features/y/y.js | 0 .../node_modules/m/src/internal/i.js | 0 .../node_modules/m/src/middle-1/f.js | 0 .../node_modules/m/src/middle-1/nested/f.js | 0 .../node_modules/m/src/middle-2/nested/f.js | 1 - .../m/src/middle-3/nested/f/nested/f.js | 0 .../node_modules/m/src/middle-4/f/f.js | 0 .../node_modules/m/src/middle-5/f$/$.js | 0 .../node_modules/m/src/middle-5/f/$.js | 0 .../node_modules/m/src/middle/f.js | 0 .../node_modules/m/src/middle/nested/f.js | 0 .../test/fixtures/imports-field/a.js | 1 - .../test/fixtures/imports-field/b.js | 0 .../test/fixtures/imports-field/dir/b.js | 0 .../node_modules/a/lib/browser.js | 1 - .../imports-field/node_modules/a/lib/index.js | 0 .../node_modules/a/lib/lib2/main.js | 1 - .../imports-field/node_modules/a/lib/main.js | 1 - .../imports-field/node_modules/a/main.js | 1 - .../imports-field/node_modules/a/package.json | 18 - .../imports-field/node_modules/a/x.js | 1 - .../imports-field/node_modules/c/index.js | 0 .../test/fixtures/imports-field/package.json | 17 - .../fixtures/incorrect-package/pack1/a.js | 0 .../incorrect-package/pack1/package.json | 2 - .../fixtures/incorrect-package/pack2/a.js | 0 .../incorrect-package/pack2/package.json | 0 .../test/fixtures/issue-238/package.json | 3 - .../test/fixtures/issue-238/src/a/config.js | 0 .../src/common/config/myObjectFile.js | 0 .../enhanced_resolve/test/fixtures/lib.js | 0 .../test/fixtures/lib/complex1.js | 1 - .../test/fixtures/main-field-self/index.js | 0 .../fixtures/main-field-self/package.json | 3 - .../test/fixtures/main-field-self2/index.js | 0 .../fixtures/main-field-self2/package.json | 3 - .../enhanced_resolve/test/fixtures/main1.js | 9 - .../enhanced_resolve/test/fixtures/main2.js | 12 - .../enhanced_resolve/test/fixtures/main3.js | 4 - .../multiple_modules/node_modules/m1/a.js | 3 - .../test/fixtures/no#fragment/#/#.js | 0 fixtures/enhanced_resolve/test/fixtures/no.js | 0 .../browser-module-broken/browser.js | 0 .../browser-module-broken/main.js | 0 .../browser-module-broken/package.json | 4 - .../complexm/node_modules/m1/a.js | 1 - .../complexm/node_modules/m1/index.js | 1 - .../fixtures/node_modules/complexm/step1.js | 1 - .../fixtures/node_modules/complexm/step2.js | 1 - .../fixtures/node_modules/dash-name/index.js | 0 .../node_modules/dash-name/package.json | 4 - .../test/fixtures/node_modules/dash/index.js | 0 .../fixtures/node_modules/dash/package.json | 4 - .../invalidPackageJson/package.json | 0 .../test/fixtures/node_modules/m1/a.js | 3 - .../test/fixtures/node_modules/m1/b.js | 3 - .../test/fixtures/node_modules/m2/b.js | 1 - .../node_modules/recursive-module/file.js | 0 .../node_modules/recursive-module/index.js | 0 .../test/fixtures/pnp-a/m2/a.js | 3 - .../test/fixtures/pnp/pkg/dir/index.js | 0 .../test/fixtures/pnp/pkg/index.js | 0 .../test/fixtures/pnp/pkg/main.js | 0 .../fixtures/pnp/pkg/package-alias/browser.js | 0 .../fixtures/pnp/pkg/package-alias/index.js | 0 .../test/fixtures/pnp/pkg/package.json | 7 - .../test/fixtures/pnp/pkg/typescript/index.ts | 0 .../test/fixtures/pnp/pkg3/a.js | 1 - .../test/fixtures/pnp/pkg3/package.json | 8 - .../prefer-pnp/alternative-modules/m1/b.js | 0 .../restrictions/node_modules/pck1/index.css | 0 .../restrictions/node_modules/pck1/index.js | 0 .../node_modules/pck1/package.json | 3 - .../restrictions/node_modules/pck2/index.css | 0 .../restrictions/node_modules/pck2/module.js | 0 .../node_modules/pck2/package.json | 5 - .../test/fixtures/roots_fall_through/index.js | 0 .../scoped/node_modules/@scope/pack1/main.js | 0 .../node_modules/@scope/pack1/package.json | 5 - .../node_modules/@scope/pack2/lib/index.js | 0 .../scoped/node_modules/@scope/pack2/main.js | 0 .../node_modules/@scope/pack2/package.json | 3 - .../test/fixtures/shortcutdir.js/a.js | 0 .../test/fixtures/yield/a/foo-2/b | 0 .../test/fixtures/yield/a/foo-2/c | 0 .../test/fixtures/yield/a/foo/a | 0 .../test/fixtures/yield/a/foo/b | 0 .../test/fixtures/yield/b/foo/a | 0 .../test/fixtures/yield/c/foo/a | 0 .../test/fixtures/yield/c/foo/package.json | 7 - .../fixtures/\346\265\213\350\257\225.js" | 0 .../\344\270\255\346\226\207.js" | 0 fixtures/pnp/.gitignore | 1 - fixtures/pnp/.pnp.cjs | 7543 ----------------- fixtures/pnp/.yarnrc.yml | 1 - fixtures/pnp/package.json | 8 - fixtures/pnp/yarn.lock | 74 - fixtures/pnpm/.gitignore | 1 - fixtures/pnpm/package.json | 11 - fixtures/pnpm/pnpm-lock.yaml | 212 - fixtures/tsconfig/cases/builtins/thing.js | 0 .../tsconfig/cases/builtins/tsconfig.json | 5 - fixtures/tsconfig/cases/exports/index.js | 0 fixtures/tsconfig/cases/exports/tsconfig.json | 3 - .../extends-extension/base-tsconfig.json | 7 - .../tsconfig/cases/extends-extension/foo.js | 0 .../cases/extends-extension/tsconfig.json | 3 - .../cases/extends-extensionless/foo.js | 0 .../cases/extends-extensionless/tsconfig.json | 3 - .../tsconfig/cases/extends-multiple/foo.js | 0 .../cases/extends-multiple/tsconfig.json | 6 - .../tsconfig/cases/extends-not-found/index.js | 0 .../cases/extends-not-found/tsconfig.json | 3 - .../tsconfig/cases/extends-paths/src/index.js | 0 .../cases/extends-paths/tsconfig.base.json | 7 - .../cases/extends-paths/tsconfig.json | 6 - fixtures/tsconfig/cases/field/index.js | 0 fixtures/tsconfig/cases/field/tsconfig.json | 3 - fixtures/tsconfig/cases/index/index.js | 0 fixtures/tsconfig/cases/index/tsconfig.json | 3 - .../cases/paths_template_variable/foo.js | 0 .../paths_template_variable/tsconfig1.json | 3 - .../paths_template_variable/tsconfig2.json | 8 - .../project_references/app/aliased/index.ts | 0 .../cases/project_references/app/index.ts | 0 .../project_references/app/tsconfig.json | 23 - .../project_a/aliased/index.ts | 0 .../project_references/project_a/conf.json | 8 - .../project_references/project_a/index.ts | 0 .../project_b/src/aliased/index.ts | 0 .../project_b/tsconfig.json | 9 - .../project_references/project_c/index.ts | 0 .../project_c/tsconfig.json | 5 - .../project_references/tsconfig.base.json | 4 - fixtures/tsconfig/cases/suffixes/a.ios.ts | 0 fixtures/tsconfig/cases/suffixes/a.ts | 0 fixtures/tsconfig/cases/suffixes/b.ts | 0 fixtures/tsconfig/cases/suffixes/c-test.ts | 0 fixtures/tsconfig/cases/suffixes/index.ts | 1 - .../tsconfig/cases/suffixes/tsconfig.json | 5 - fixtures/tsconfig/cases/trailing-comma/bar.js | 0 .../tsconfig/cases/trailing-comma/index.js | 0 .../cases/trailing-comma/tsconfig.json | 9 - fixtures/tsconfig/foo.js | 0 fixtures/tsconfig/nested/index.js | 0 fixtures/tsconfig/nested/test.js | 0 fixtures/tsconfig/nested/tsconfig.json | 8 - .../node_modules/tsconfig-exports/conf.json | 7 - .../node_modules/tsconfig-exports/foo.js | 0 .../tsconfig-exports/package.json | 7 - .../node_modules/tsconfig-field/conf.json | 7 - .../node_modules/tsconfig-field/foo.js | 0 .../node_modules/tsconfig-field/package.json | 5 - .../node_modules/tsconfig-index/foo.js | 0 .../node_modules/tsconfig-index/package.json | 4 - .../node_modules/tsconfig-index/tsconfig.json | 7 - .../node_modules/tsconfig-not-used/foo.js | 0 .../tsconfig-not-used/tsconfig.json | 7 - fixtures/tsconfig/package.json | 24 - fixtures/tsconfig/tsconfig.json | 7 - fixtures/tsconfig/tsconfig_broken.json | 1 - .../tsconfig/tsconfig_template_variable.json | 7 - napi/__test__/resolver.spec.mjs | 260 - napi/src/lib.rs | 214 - napi/src/options.rs | 261 - napi/src/tracing.rs | 25 - napi/tests/options.test.mjs | 59 - npm/package.json | 79 +- package.json | 53 +- pnpm-lock.yaml | 2598 ------ src/builtins.rs | 71 - src/cache.rs | 354 - src/context.rs | 89 - src/error.rs | 182 - src/file_system.rs | 220 - src/lib.rs | 1755 ---- src/options.rs | 633 -- src/package_json.rs | 219 - src/path.rs | 132 - src/resolution.rs | 92 - src/specifier.rs | 230 - src/tests/alias.rs | 283 - src/tests/browser_field.rs | 189 - src/tests/builtins.rs | 121 - src/tests/dependencies.rs | 110 - src/tests/exports_field.rs | 2546 ------ src/tests/extension_alias.rs | 70 - src/tests/extensions.rs | 125 - src/tests/fallback.rs | 100 - src/tests/full_specified.rs | 113 - src/tests/imports_field.rs | 1320 --- src/tests/incorrect_description_file.rs | 65 - src/tests/main_field.rs | 24 - src/tests/memory_fs.rs | 74 - src/tests/missing.rs | 106 - src/tests/mod.rs | 51 - src/tests/pnp.rs | 45 - src/tests/resolve.rs | 119 - src/tests/restrictions.rs | 25 - src/tests/roots.rs | 92 - src/tests/scoped_packages.rs | 25 - src/tests/simple.rs | 68 - src/tests/symlink.rs | 121 - src/tests/tsconfig_paths.rs | 530 -- src/tests/tsconfig_project_references.rs | 132 - src/tsconfig.rs | 223 - tests/integration_test.rs | 103 - tests/package.json | 5 - tests/resolve_test.rs | 132 - 308 files changed, 56 insertions(+), 24940 deletions(-) delete mode 100644 .github/CODE_OF_CONDUCT.md delete mode 100644 .github/SECURITY.md delete mode 100644 .github/actions/pnpm/action.yml delete mode 100644 .github/codecov.yml delete mode 100644 .github/renovate.json delete mode 100644 .github/workflows/benchmark.yml delete mode 100644 .github/workflows/ci.yml delete mode 100644 .github/workflows/codecov.yml delete mode 100644 .github/workflows/release-napi.yml delete mode 100644 .github/workflows/release-plz.yml delete mode 100644 Cargo.lock delete mode 100644 fixtures/enhanced_resolve/lib/index.js delete mode 100644 fixtures/enhanced_resolve/package.json delete mode 100644 fixtures/enhanced_resolve/test/.gitignore delete mode 100644 fixtures/enhanced_resolve/test/fixtures/#/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/abc.txt delete mode 100644 fixtures/enhanced_resolve/test/fixtures/alias/files/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/browser/module-a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/ignore.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/replaced.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/self.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/toString.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-c.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/c.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/d.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/builtins/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/c.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/complex.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/crypto-js/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/decorated-fs/exists.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/dirOrFile.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/directory-default/directory-default.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/pack1/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/umd.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/index delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/src/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.mts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mjs delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mts.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/app.module.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/foo.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/foo.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/file.load1 delete mode 100644 fixtures/enhanced_resolve/test/fixtures/file.load2 delete mode 100644 fixtures/enhanced_resolve/test/fixtures/foo/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/foo/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/internal/file.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/y/y.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/internal/i.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-3/nested/f/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-4/f/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f$/$.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f/$.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/dir/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/c/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/issue-238/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/issue-238/src/a/config.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/issue-238/src/common/config/myObjectFile.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/lib.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/lib/complex1.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self2/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main1.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main2.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main3.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/no#fragment/#/#.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/no.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/invalidPackageJson/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/file.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/dir/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/typescript/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/prefer-pnp/alternative-modules/m1/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.css delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/index.css delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/module.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/roots_fall_through/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/lib/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/shortcutdir.js/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/b delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/c delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo/a delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo/b delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/b/foo/a delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/c/foo/a delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json delete mode 100644 "fixtures/enhanced_resolve/test/fixtures/\346\265\213\350\257\225.js" delete mode 100644 "fixtures/misc/\344\270\255\346\226\207/\344\270\255\346\226\207.js" delete mode 100644 fixtures/pnp/.gitignore delete mode 100755 fixtures/pnp/.pnp.cjs delete mode 100644 fixtures/pnp/.yarnrc.yml delete mode 100644 fixtures/pnp/package.json delete mode 100644 fixtures/pnp/yarn.lock delete mode 100644 fixtures/pnpm/.gitignore delete mode 100644 fixtures/pnpm/package.json delete mode 100644 fixtures/pnpm/pnpm-lock.yaml delete mode 100644 fixtures/tsconfig/cases/builtins/thing.js delete mode 100644 fixtures/tsconfig/cases/builtins/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/exports/index.js delete mode 100644 fixtures/tsconfig/cases/exports/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-extension/base-tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-extension/foo.js delete mode 100644 fixtures/tsconfig/cases/extends-extension/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-extensionless/foo.js delete mode 100644 fixtures/tsconfig/cases/extends-extensionless/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-multiple/foo.js delete mode 100644 fixtures/tsconfig/cases/extends-multiple/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-not-found/index.js delete mode 100644 fixtures/tsconfig/cases/extends-not-found/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-paths/src/index.js delete mode 100644 fixtures/tsconfig/cases/extends-paths/tsconfig.base.json delete mode 100644 fixtures/tsconfig/cases/extends-paths/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/field/index.js delete mode 100644 fixtures/tsconfig/cases/field/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/index/index.js delete mode 100644 fixtures/tsconfig/cases/index/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/paths_template_variable/foo.js delete mode 100644 fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json delete mode 100644 fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json delete mode 100644 fixtures/tsconfig/cases/project_references/app/aliased/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/app/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/app/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/project_references/project_a/aliased/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_a/conf.json delete mode 100644 fixtures/tsconfig/cases/project_references/project_a/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_b/src/aliased/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_b/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/project_references/project_c/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_c/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/project_references/tsconfig.base.json delete mode 100644 fixtures/tsconfig/cases/suffixes/a.ios.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/a.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/b.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/c-test.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/index.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/trailing-comma/bar.js delete mode 100644 fixtures/tsconfig/cases/trailing-comma/index.js delete mode 100644 fixtures/tsconfig/cases/trailing-comma/tsconfig.json delete mode 100644 fixtures/tsconfig/foo.js delete mode 100644 fixtures/tsconfig/nested/index.js delete mode 100644 fixtures/tsconfig/nested/test.js delete mode 100644 fixtures/tsconfig/nested/tsconfig.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-exports/conf.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-exports/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-exports/package.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-field/conf.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-field/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-field/package.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-index/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-index/package.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-not-used/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json delete mode 100755 fixtures/tsconfig/package.json delete mode 100644 fixtures/tsconfig/tsconfig.json delete mode 100644 fixtures/tsconfig/tsconfig_broken.json delete mode 100644 fixtures/tsconfig/tsconfig_template_variable.json delete mode 100644 napi/__test__/resolver.spec.mjs delete mode 100644 napi/src/lib.rs delete mode 100644 napi/src/options.rs delete mode 100644 napi/src/tracing.rs delete mode 100644 napi/tests/options.test.mjs delete mode 100644 pnpm-lock.yaml delete mode 100644 src/builtins.rs delete mode 100644 src/cache.rs delete mode 100644 src/context.rs delete mode 100644 src/error.rs delete mode 100644 src/file_system.rs delete mode 100644 src/lib.rs delete mode 100644 src/options.rs delete mode 100644 src/package_json.rs delete mode 100644 src/path.rs delete mode 100644 src/resolution.rs delete mode 100644 src/specifier.rs delete mode 100644 src/tests/alias.rs delete mode 100644 src/tests/browser_field.rs delete mode 100644 src/tests/builtins.rs delete mode 100644 src/tests/dependencies.rs delete mode 100644 src/tests/exports_field.rs delete mode 100644 src/tests/extension_alias.rs delete mode 100644 src/tests/extensions.rs delete mode 100644 src/tests/fallback.rs delete mode 100644 src/tests/full_specified.rs delete mode 100644 src/tests/imports_field.rs delete mode 100644 src/tests/incorrect_description_file.rs delete mode 100644 src/tests/main_field.rs delete mode 100644 src/tests/memory_fs.rs delete mode 100644 src/tests/missing.rs delete mode 100644 src/tests/mod.rs delete mode 100644 src/tests/pnp.rs delete mode 100644 src/tests/resolve.rs delete mode 100644 src/tests/restrictions.rs delete mode 100644 src/tests/roots.rs delete mode 100644 src/tests/scoped_packages.rs delete mode 100644 src/tests/simple.rs delete mode 100644 src/tests/symlink.rs delete mode 100644 src/tests/tsconfig_paths.rs delete mode 100644 src/tests/tsconfig_project_references.rs delete mode 100644 src/tsconfig.rs delete mode 100644 tests/integration_test.rs delete mode 100644 tests/package.json delete mode 100644 tests/resolve_test.rs diff --git a/.github/CODE_OF_CONDUCT.md b/.github/CODE_OF_CONDUCT.md deleted file mode 100644 index 41dd9ebe..00000000 --- a/.github/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,127 +0,0 @@ -# Contributor Covenant Code of Conduct - -## Our Pledge - -We as members, contributors, and leaders pledge to make participation in our -community a harassment-free experience for everyone, regardless of age, body -size, visible or invisible disability, ethnicity, sex characteristics, gender -identity and expression, level of experience, education, socio-economic status, -nationality, personal appearance, race, religion, or sexual identity -and orientation. - -We pledge to act and interact in ways that contribute to an open, welcoming, -diverse, inclusive, and healthy community. - -## Our Standards - -Examples of behavior that contributes to a positive environment for our -community include: - -* Demonstrating empathy and kindness toward other people -* Being respectful of differing opinions, viewpoints, and experiences -* Giving and gracefully accepting constructive feedback -* Accepting responsibility and apologizing to those affected by our mistakes, - and learning from the experience -* Focusing on what is best not just for us as individuals, but for the - overall community - -Examples of unacceptable behavior include: - -* The use of sexualized language or imagery, and sexual attention or - advances of any kind -* Trolling, insulting or derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or email - address, without their explicit permission -* Other conduct which could reasonably be considered inappropriate in a - professional setting - -## Enforcement Responsibilities - -Community leaders are responsible for clarifying and enforcing our standards of -acceptable behavior and will take appropriate and fair corrective action in -response to any behavior that they deem inappropriate, threatening, offensive, -or harmful. - -Community leaders have the right and responsibility to remove, edit, or reject -comments, commits, code, wiki edits, issues, and other contributions that are -not aligned to this Code of Conduct, and will communicate reasons for moderation -decisions when appropriate. - -## Scope - -This Code of Conduct applies within all community spaces, and also applies when -an individual is officially representing the community in public spaces. -Examples of representing our community include using an official e-mail address, -posting via an official social media account, or acting as an appointed -representative at an online or offline event. - -## Enforcement - -Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported to the community leaders responsible for enforcement. -All complaints will be reviewed and investigated promptly and fairly. - -All community leaders are obligated to respect the privacy and security of the -reporter of any incident. - -## Enforcement Guidelines - -Community leaders will follow these Community Impact Guidelines in determining -the consequences for any action they deem in violation of this Code of Conduct: - -### 1. Correction - -**Community Impact**: Use of inappropriate language or other behavior deemed -unprofessional or unwelcome in the community. - -**Consequence**: A private, written warning from community leaders, providing -clarity around the nature of the violation and an explanation of why the -behavior was inappropriate. A public apology may be requested. - -### 2. Warning - -**Community Impact**: A violation through a single incident or series -of actions. - -**Consequence**: A warning with consequences for continued behavior. No -interaction with the people involved, including unsolicited interaction with -those enforcing the Code of Conduct, for a specified period of time. This -includes avoiding interactions in community spaces as well as external channels -like social media. Violating these terms may lead to a temporary or -permanent ban. - -### 3. Temporary Ban - -**Community Impact**: A serious violation of community standards, including -sustained inappropriate behavior. - -**Consequence**: A temporary ban from any sort of interaction or public -communication with the community for a specified period of time. No public or -private interaction with the people involved, including unsolicited interaction -with those enforcing the Code of Conduct, is allowed during this period. -Violating these terms may lead to a permanent ban. - -### 4. Permanent Ban - -**Community Impact**: Demonstrating a pattern of violation of community -standards, including sustained inappropriate behavior, harassment of an -individual, or aggression toward or disparagement of classes of individuals. - -**Consequence**: A permanent ban from any sort of public interaction within -the community. - -## Attribution - -This Code of Conduct is adapted from the [Contributor Covenant][homepage], -version 2.0, available at -https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. - -Community Impact Guidelines were inspired by [Mozilla's code of conduct -enforcement ladder](https://github.com/mozilla/diversity). - -[homepage]: https://www.contributor-covenant.org - -For answers to common questions about this code of conduct, see the FAQ at -https://www.contributor-covenant.org/faq. Translations are available at -https://www.contributor-covenant.org/translations. diff --git a/.github/SECURITY.md b/.github/SECURITY.md deleted file mode 100644 index 63f5b072..00000000 --- a/.github/SECURITY.md +++ /dev/null @@ -1,7 +0,0 @@ -# Security Policy - -## Supported Versions - -## Reporting a Vulnerability - -If you find any potential vulnerability, join our [discord channel](https://discord.gg/9uXCAwqQZW) and contact Boshen. diff --git a/.github/actions/pnpm/action.yml b/.github/actions/pnpm/action.yml deleted file mode 100644 index ab4291c0..00000000 --- a/.github/actions/pnpm/action.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: Pnpm - -description: Install pnpm - -runs: - using: composite - steps: - - uses: pnpm/action-setup@v4 - - - uses: actions/setup-node@v4 - with: - node-version-file: .node-version - cache: pnpm - - - name: yarn - shell: bash - run: | - cd fixtures/pnp - corepack enable - yarn install - - - name: pnpm - shell: bash - run: | - corepack enable - pnpm install diff --git a/.github/codecov.yml b/.github/codecov.yml deleted file mode 100644 index 0610268a..00000000 --- a/.github/codecov.yml +++ /dev/null @@ -1,14 +0,0 @@ -coverage: - status: - project: - default: - informational: true - patch: - default: - informational: true - changes: - default: - informational: true - -ignore: - - "examples" diff --git a/.github/renovate.json b/.github/renovate.json deleted file mode 100644 index 2339df09..00000000 --- a/.github/renovate.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "$schema": "https://docs.renovatebot.com/renovate-schema.json", - "extends": ["github>Boshen/renovate"], - "ignorePaths": ["**/node_modules/**", "**/fixtures/**"] -} diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml deleted file mode 100644 index 7c25853b..00000000 --- a/.github/workflows/benchmark.yml +++ /dev/null @@ -1,41 +0,0 @@ -name: Benchmark - -on: - workflow_dispatch: - pull_request: - types: [opened, synchronize] - paths-ignore: - - '**/*.md' - push: - branches: - - main - paths-ignore: - - '**/*.md' - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} - cancel-in-progress: true - -jobs: - benchmark: - name: Benchmark - runs-on: ubuntu-latest - steps: - - name: Checkout Branch - uses: taiki-e/checkout-action@v1 - - - uses: Boshen/setup-rust@main - with: - cache-key: benchmark - save-cache: ${{ github.ref_name == 'main' }} - tools: cargo-codspeed - - uses: ./.github/actions/pnpm - - name: Build Benchmark - run: cargo codspeed build --features codspeed - - - name: Run benchmark - uses: CodSpeedHQ/action@v3 - timeout-minutes: 30 - with: - run: cargo codspeed run - token: ${{ secrets.CODSPEED_TOKEN }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index 3f629ffb..00000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,196 +0,0 @@ -name: CI - -on: - workflow_dispatch: - pull_request: - types: [opened, synchronize] - paths-ignore: - - '**/*.md' - - '!.github/workflows/ci.yml' - push: - branches: - - main - - "renovate/**" - paths-ignore: - - '**/*.md' - - '!.github/workflows/ci.yml' - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} - cancel-in-progress: ${{ github.ref_name != 'main' }} - -defaults: - run: - shell: bash - -jobs: - cache: # Warm cache factory for all other CI jobs - name: Check and Build - strategy: - fail-fast: true - matrix: - include: - - os: windows-latest - - os: ubuntu-latest - - os: macos-14 - runs-on: ${{ matrix.os }} - steps: - - uses: taiki-e/checkout-action@v1 - - - uses: Boshen/setup-rust@main - with: - save-cache: ${{ github.ref_name == 'main' }} - cache-key: warm - - - run: cargo check --all-features --locked - - # Only need to build the test to create a warm cache on the main branch - - name: Build cache by Cargo Check and Cargo Test - if: ${{ github.ref_name == 'main' }} - run: cargo test --all-features --no-run - - wasm: - name: Check Wasm - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - - uses: Boshen/setup-rust@main - with: - cache-key: wasm - save-cache: ${{ github.ref_name == 'main' }} - - - name: Check - run: | - rustup target add wasm32-unknown-unknown - cargo check --all-features --target wasm32-unknown-unknown - - wasi: - name: Test wasi target - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - - uses: Boshen/setup-rust@main - with: - cache-key: wasi - save-cache: ${{ github.ref_name == 'main' }} - - - uses: ./.github/actions/pnpm - - - name: Build - run: | - rustup target add wasm32-wasip1-threads - pnpm build --target wasm32-wasip1-threads - - - name: Test - run: pnpm test - env: - WASI_TEST: 1 - - typos: - name: Spell Check - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - - uses: crate-ci/typos@v1.24.5 - with: - files: . - - deny: - name: Cargo Deny - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - - uses: dorny/paths-filter@v3 - id: filter - with: - filters: | - src: - - 'Cargo.lock' - - - uses: Boshen/setup-rust@main - with: - restore-cache: false - tools: cargo-deny - - - if: steps.filter.outputs.src == 'true' - run: cargo deny check - - unused-deps: - name: Check Unused Dependencies - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - uses: dorny/paths-filter@v3 - id: filter - with: - filters: | - src: - - '**/*.rs' - - '**/Cargo.toml' - - 'Cargo.lock' - - uses: Boshen/setup-rust@main - with: - restore-cache: false - if: steps.filter.outputs.src == 'true' - - uses: cargo-bins/cargo-binstall@main - if: steps.filter.outputs.src == 'true' - - run: cargo binstall --no-confirm cargo-shear@1 - if: steps.filter.outputs.src == 'true' - - run: cargo shear - if: steps.filter.outputs.src == 'true' - - format: - name: Format - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - uses: Boshen/setup-rust@main - with: - components: rustfmt - restore-cache: false - - run: cargo fmt --all -- --check - - lint: - name: Clippy - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - uses: Boshen/setup-rust@main - with: - components: clippy - - run: cargo clippy --all-features -- -D warnings - - doc: - name: Doc - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - uses: Boshen/setup-rust@main - with: - components: rust-docs - - run: RUSTDOCFLAGS='-D warnings' cargo doc --no-deps --all-features - - test: - name: Test - strategy: - fail-fast: true - matrix: - include: - - os: windows-latest - - os: ubuntu-latest - - os: macos-14 - runs-on: ${{ matrix.os }} - env: - RUST_BACKTRACE: 1 - steps: - - uses: taiki-e/checkout-action@v1 - - uses: ./.github/actions/pnpm - - uses: Boshen/setup-rust@main - with: - cache-key: warm - - run: cargo test --doc - - run: cargo test --all-features diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml deleted file mode 100644 index 97302b03..00000000 --- a/.github/workflows/codecov.yml +++ /dev/null @@ -1,69 +0,0 @@ -name: Code Coverage # Run cargo-llvm-cov and upload to codecov.io - -on: - workflow_dispatch: - pull_request: - types: [opened, synchronize] - paths-ignore: - - '**/*.md' - push: - branches: - - main - paths-ignore: - - '**/*.md' - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: ${{ github.ref_name != 'main' }} - -jobs: - coverage: - name: Code Coverage - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: taiki-e/checkout-action@v1 - - - uses: ./.github/actions/pnpm - - - uses: Boshen/setup-rust@main - with: - cache-key: codecov - save-cache: ${{ github.ref_name == 'main' }} - tools: cargo-llvm-cov - components: llvm-tools-preview - - - run: cargo llvm-cov --lcov --output-path lcov.info - - - name: Upload Artifact - uses: actions/upload-artifact@v4 - with: - name: codecov - path: lcov.info - - # codecov often fails, use another workflow for retry - upload-codecov: - name: Upload coverage file - runs-on: ubuntu-latest - needs: coverage - # Check if the event is not triggered by a fork by checking whether CODECOV_TOKEN is set - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - steps: - - name: Checkout - if: env.CODECOV_TOKEN - uses: taiki-e/checkout-action@v1 - - - name: Download coverage file - if: env.CODECOV_TOKEN - uses: actions/download-artifact@v4 - with: - name: codecov - - - name: Upload to codecov.io - if: env.CODECOV_TOKEN - uses: codecov/codecov-action@v4 - with: - token: ${{ secrets.CODECOV_TOKEN }} - fail_ci_if_error: true - files: lcov.info diff --git a/.github/workflows/release-napi.yml b/.github/workflows/release-napi.yml deleted file mode 100644 index 1ea68db8..00000000 --- a/.github/workflows/release-napi.yml +++ /dev/null @@ -1,252 +0,0 @@ -name: Release NAPI - -on: - workflow_dispatch: - push: - branches: - - main - paths: - - npm/package.json # Please only commit this file, so we don't need to wait for test CI to pass. - -env: - DEBUG: 'napi:*' - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - check: - name: Check version - runs-on: ubuntu-latest - outputs: - version: ${{ env.version }} - version_changed: ${{ steps.version.outputs.changed }} - steps: - - uses: taiki-e/checkout-action@v1 - - - name: Check version changes - uses: EndBug/version-check@v2 - id: version - with: - static-checking: localIsNew - file-url: https://unpkg.com/oxc-resolver@latest/package.json - file-name: npm/package.json - - - name: Set version name - if: steps.version.outputs.changed == 'true' - run: | - echo "Version change found! New version: ${{ steps.version.outputs.version }} (${{ steps.version.outputs.version_type }})" - echo "version=${{ steps.version.outputs.version }}" >> $GITHUB_ENV - - build: - needs: check - if: needs.check.outputs.version_changed == 'true' - env: - version: ${{ needs.check.outputs.version }} - outputs: - version: ${{ env.version }} - strategy: - fail-fast: false - matrix: - include: - - os: windows-latest - target: x86_64-pc-windows-msvc - - - os: windows-latest - target: aarch64-pc-windows-msvc - - - os: ubuntu-latest - target: x86_64-unknown-linux-gnu - - - os: ubuntu-latest - target: x86_64-unknown-linux-musl - - - os: ubuntu-latest - target: aarch64-unknown-linux-gnu - - - os: ubuntu-latest - target: aarch64-unknown-linux-musl - - - os: ubuntu-latest - target: armv7-unknown-linux-gnueabihf - - - os: macos-latest - target: x86_64-apple-darwin - - - os: macos-latest - target: aarch64-apple-darwin - - - os: ubuntu-latest - target: wasm32-wasip1-threads - - name: Package ${{ matrix.target }} - runs-on: ${{ matrix.os }} - steps: - - uses: taiki-e/checkout-action@v1 - - - uses: ./.github/actions/pnpm - - - name: Add Rust Target - run: rustup target add ${{ matrix.target }} - - - uses: goto-bus-stop/setup-zig@v2 - if: ${{ contains(matrix.target, 'musl') }} - with: - version: 0.13.0 - - - name: Build with zig cross - if: ${{ contains(matrix.target, 'musl') }} - run: pnpm build -x --target ${{ matrix.target }} - - - name: Build with napi cross - if: ${{ contains(matrix.target, 'gnu') }} - run: pnpm build --use-napi-cross --target ${{ matrix.target }} - - - name: Build - if: ${{ !contains(matrix.target, 'gnu') && !contains(matrix.target, 'musl') }} - run: pnpm build --target ${{ matrix.target }} - - - name: Test - if: matrix.target == 'x86_64-pc-windows-msvc' || matrix.target == 'aarch64-apple-darwin' || matrix.target == 'wasm32-wasip1-threads' - run: pnpm test - - - name: Output docker params - if: ${{ contains(matrix.target, 'linux') }} - id: docker - run: | - node -e " - if ('${{ matrix.target }}'.startsWith('aarch64')) { - console.log('PLATFORM=linux/arm64') - } else if ('${{ matrix.target }}'.startsWith('armv7')) { - console.log('PLATFORM=linux/arm/v7') - } else { - console.log('PLATFORM=linux/amd64') - } - " >> $GITHUB_OUTPUT - node -e " - if ('${{ matrix.target }}'.endsWith('-musl')) { - console.log('IMAGE=node:lts-alpine') - } else { - console.log('IMAGE=node:lts-slim') - } - " >> $GITHUB_OUTPUT - echo "PNPM_STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_OUTPUT - - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - if: ${{ contains(matrix.target, 'linux') }} - with: - platforms: all - - - run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes - if: ${{ contains(matrix.target, 'linux') }} - - - name: Run linux test - uses: addnab/docker-run-action@v3 - if: ${{ contains(matrix.target, 'linux') }} - with: - image: ${{ steps.docker.outputs.IMAGE }} - options: -v ${{ steps.docker.outputs.PNPM_STORE_PATH }}:${{ steps.docker.outputs.PNPM_STORE_PATH }} -v ${{ github.workspace }}:/oxc_resolver -w /oxc_resolver --platform ${{ steps.docker.outputs.PLATFORM }} - run: | - corepack enable - pnpm test - - - name: Upload artifacts - uses: actions/upload-artifact@v4 - with: - name: bindings-${{ matrix.target }} - path: | - napi/*.node - napi/*.wasm - - build-freebsd: - needs: check - if: needs.check.outputs.version_changed == 'true' - name: Build FreeBSD - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Build - id: build - uses: cross-platform-actions/action@v0.25.0 - env: - DEBUG: napi:* - RUSTUP_IO_THREADS: 1 - with: - operating_system: freebsd - version: '14.0' - memory: 8G - cpu_count: 3 - environment_variables: 'DEBUG RUSTUP_IO_THREADS' - shell: bash - run: | - sudo pkg install -y -f curl node libnghttp2 npm - curl https://sh.rustup.rs -sSf --output rustup.sh - sh rustup.sh -y --profile minimal --default-toolchain stable - source "$HOME/.cargo/env" - echo "~~~~ rustc --version ~~~~" - rustc --version - echo "~~~~ node -v ~~~~" - node -v - pwd - ls -lah - whoami - env - sudo corepack enable - pnpm install - pnpm build --target x86_64-unknown-freebsd - rm -rf node_modules - rm -rf target - - name: Upload artifact - uses: actions/upload-artifact@v4 - with: - name: bindings-freebsd - path: napi/*.node - if-no-files-found: error - - publish: - name: Publish NAPI - runs-on: ubuntu-latest - permissions: - id-token: write # for `npm publish --provenance` - needs: - - build - - build-freebsd - steps: - - uses: taiki-e/checkout-action@v1 - - - name: corepack - run: corepack enable - - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version-file: .node-version - cache: pnpm - - - name: Install dependencies - run: pnpm install --frozen-lockfile - - - name: Download Artifacts - uses: actions/download-artifact@v4 - with: - path: artifacts - - - name: Prepare dirs and artifacts - run: | - pnpm napi create-npm-dirs --package-json-path npm/package.json - pnpm napi artifacts --package-json-path npm/package.json --build-output-dir napi - - - name: Publish npm packages as latest - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - shell: bash - run: | - cp napi/index.js npm/index.js - cp napi/index.d.ts npm/index.d.ts - cp napi/browser.js npm/browser.js - echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc - pnpm napi pre-publish --no-gh-release -t npm --package-json-path npm/package.json - npm publish npm/ --tag latest --provenance --access public diff --git a/.github/workflows/release-plz.yml b/.github/workflows/release-plz.yml deleted file mode 100644 index 121758ad..00000000 --- a/.github/workflows/release-plz.yml +++ /dev/null @@ -1,55 +0,0 @@ -name: Release Plz - -on: - workflow_dispatch: - push: - branches: - - main - -permissions: - pull-requests: write - contents: write - -jobs: - release-plz: - name: Release-plz - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - uses: Boshen/setup-rust@main - with: - save-cache: ${{ github.ref_name == 'main' }} - cache-key: warm - - - name: Run release-plz - id: release-plz - uses: MarcoIeni/release-plz-action@v0.5 - env: - GITHUB_TOKEN: ${{ secrets.RELEASE_PLZ_TOKEN }} - CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} - - - name: Bump package.json - if: ${{ steps.release-plz.outputs.prs_created }} - env: - GH_TOKEN: ${{ github.token }} - RELEASES: ${{ steps.release-plz.outputs.releases }} - PR: ${{ steps.release-plz.outputs.pr }} - run: | - set -e - - pr_number=${{ fromJSON(steps.release-plz.outputs.pr).number }} - if [[ -n "$pr_number" ]]; then - version=$(echo "$RELEASES" | jq -r '.[0].version') - echo "version: $version" - - jq --arg version "${version}" '.version = ($version)' npm/package.json > tmp - mv tmp npm/package.json - - gh pr checkout $pr_number - git add . - git commit -m "Update package.json" - git push - fi diff --git a/Cargo.lock b/Cargo.lock deleted file mode 100644 index 58c1e7ad..00000000 --- a/Cargo.lock +++ /dev/null @@ -1,1326 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "adler" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" - -[[package]] -name = "aho-corasick" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" -dependencies = [ - "memchr", -] - -[[package]] -name = "android-tzdata" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" - -[[package]] -name = "android_system_properties" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" -dependencies = [ - "libc", -] - -[[package]] -name = "anes" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "735d4f398ca57cfa2880225c2bf81c3b9af3be5bb22e44ae70118dad38713e84" - -[[package]] -name = "arca" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f915ddd863ef73f11c10c75170e86db1d4f539689bc6bfb9ce25d6528d6fe83" -dependencies = [ - "clean-path", - "path-slash", - "radix_trie", -] - -[[package]] -name = "autocfg" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" - -[[package]] -name = "base64" -version = "0.22.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" - -[[package]] -name = "bit-set" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1" -dependencies = [ - "bit-vec", -] - -[[package]] -name = "bit-vec" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "bitflags" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" - -[[package]] -name = "bpaf" -version = "0.9.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3280efcf6d66bc77c2cf9b67dc8acee47a217d9be67dd590b3230dffe663724d" - -[[package]] -name = "bumpalo" -version = "3.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" - -[[package]] -name = "byteorder" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" - -[[package]] -name = "cast" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" - -[[package]] -name = "cc" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eaff6f8ce506b9773fa786672d63fc7a191ffea1be33f72bbd4aeacefca9ffc8" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "chrono" -version = "0.4.38" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" -dependencies = [ - "android-tzdata", - "iana-time-zone", - "num-traits", - "serde", - "windows-targets 0.52.6", -] - -[[package]] -name = "ciborium" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42e69ffd6f0917f5c029256a24d0161db17cea3997d185db0d35926308770f0e" -dependencies = [ - "ciborium-io", - "ciborium-ll", - "serde", -] - -[[package]] -name = "ciborium-io" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05afea1e0a06c9be33d539b876f1ce3692f4afea2cb41f740e7743225ed1c757" - -[[package]] -name = "ciborium-ll" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57663b653d948a338bfb3eeba9bb2fd5fcfaecb9e199e87e1eda4d9e8b240fd9" -dependencies = [ - "ciborium-io", - "half", -] - -[[package]] -name = "clean-path" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aaa6b4b263a5d737e9bf6b7c09b72c41a5480aec4d7219af827f6564e950b6a5" - -[[package]] -name = "codspeed" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a104ac948e0188b921eb3fcbdd55dcf62e542df4c7ab7e660623f6288302089" -dependencies = [ - "colored", - "libc", - "serde_json", -] - -[[package]] -name = "colored" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbf2150cce219b664a8a70df7a1f933836724b503f8a413af9365b4dcc4d90b8" -dependencies = [ - "lazy_static", - "windows-sys 0.48.0", -] - -[[package]] -name = "concurrent_lru" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7feb5cb312f774e8a24540e27206db4e890f7d488563671d24a16389cf4c2e4e" -dependencies = [ - "once_cell", -] - -[[package]] -name = "convert_case" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec182b0ca2f35d8fc196cf3404988fd8b8c739a4d270ff118a398feb0cbec1ca" -dependencies = [ - "unicode-segmentation", -] - -[[package]] -name = "core-foundation-sys" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" - -[[package]] -name = "criterion2" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8df39381f28ced0ceebfb5611528d99aef14f8d75b43e9d4ceb6aba66e7b04d" -dependencies = [ - "anes", - "bpaf", - "cast", - "ciborium", - "codspeed", - "colored", - "num-traits", - "oorandom", - "serde", - "serde_json", - "walkdir", -] - -[[package]] -name = "crossbeam-deque" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" -dependencies = [ - "crossbeam-epoch", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.9.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" -dependencies = [ - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" - -[[package]] -name = "crunchy" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" - -[[package]] -name = "ctor" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edb49164822f3ee45b17acd4a208cfc1251410cf0cad9a833234c9890774dd9f" -dependencies = [ - "quote", - "syn", -] - -[[package]] -name = "darling" -version = "0.20.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" -dependencies = [ - "darling_core", - "darling_macro", -] - -[[package]] -name = "darling_core" -version = "0.20.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95133861a8032aaea082871032f5815eb9e98cef03fa916ab4500513994df9e5" -dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "strsim", - "syn", -] - -[[package]] -name = "darling_macro" -version = "0.20.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" -dependencies = [ - "darling_core", - "quote", - "syn", -] - -[[package]] -name = "dashmap" -version = "6.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "804c8821570c3f8b70230c2ba75ffa5c0f9a4189b9a432b6656c536712acae28" -dependencies = [ - "cfg-if", - "crossbeam-utils", - "hashbrown 0.14.5", - "lock_api", - "once_cell", - "parking_lot_core", -] - -[[package]] -name = "deranged" -version = "0.3.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" -dependencies = [ - "powerfmt", - "serde", -] - -[[package]] -name = "document-features" -version = "0.2.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb6969eaabd2421f8a2775cfd2471a2b634372b4a25d41e3bd647b79912850a0" -dependencies = [ - "litrs", -] - -[[package]] -name = "dunce" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" - -[[package]] -name = "either" -version = "1.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" - -[[package]] -name = "endian-type" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" - -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "fancy-regex" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "531e46835a22af56d1e3b66f04844bed63158bc094a628bec1d321d9b4c44bf2" -dependencies = [ - "bit-set", - "regex-automata", - "regex-syntax", -] - -[[package]] -name = "filetime" -version = "0.2.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ee447700ac8aa0b2f2bd7bc4462ad686ba06baa6727ac149a2d6277f0d240fd" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall 0.4.1", - "windows-sys 0.52.0", -] - -[[package]] -name = "fnv" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" - -[[package]] -name = "half" -version = "2.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dd08c532ae367adf81c312a4580bc67f1d0fe8bc9c460520283f4c0ff277888" -dependencies = [ - "cfg-if", - "crunchy", -] - -[[package]] -name = "hashbrown" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" - -[[package]] -name = "hashbrown" -version = "0.14.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "iana-time-zone" -version = "0.1.60" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" -dependencies = [ - "android_system_properties", - "core-foundation-sys", - "iana-time-zone-haiku", - "js-sys", - "wasm-bindgen", - "windows-core", -] - -[[package]] -name = "iana-time-zone-haiku" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" -dependencies = [ - "cc", -] - -[[package]] -name = "ident_case" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" - -[[package]] -name = "indexmap" -version = "1.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" -dependencies = [ - "autocfg", - "hashbrown 0.12.3", - "serde", -] - -[[package]] -name = "indexmap" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93ead53efc7ea8ed3cfb0c79fc8023fbb782a5432b52830b6518941cebe6505c" -dependencies = [ - "equivalent", - "hashbrown 0.14.5", - "serde", -] - -[[package]] -name = "itoa" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" - -[[package]] -name = "js-sys" -version = "0.3.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" -dependencies = [ - "wasm-bindgen", -] - -[[package]] -name = "json-strip-comments" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b271732a960335e715b6b2ae66a086f115c74eb97360e996d2bd809bfc063bba" -dependencies = [ - "memchr", -] - -[[package]] -name = "lazy_static" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" - -[[package]] -name = "libc" -version = "0.2.155" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" - -[[package]] -name = "libloading" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e310b3a6b5907f99202fcdb4960ff45b93735d7c7d96b760fcff8db2dc0e103d" -dependencies = [ - "cfg-if", - "windows-targets 0.52.6", -] - -[[package]] -name = "litrs" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4ce301924b7887e9d637144fdade93f9dfff9b60981d4ac161db09720d39aa5" - -[[package]] -name = "lock_api" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" -dependencies = [ - "autocfg", - "scopeguard", -] - -[[package]] -name = "log" -version = "0.4.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" - -[[package]] -name = "memchr" -version = "2.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" - -[[package]] -name = "miniz_oxide" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" -dependencies = [ - "adler", -] - -[[package]] -name = "napi" -version = "3.0.0-alpha.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ec04344cc540f5897e97c9821ab99e7eb276b4dca6f3e6e441dfa72e5bcde70" -dependencies = [ - "bitflags 2.6.0", - "ctor", - "napi-build", - "napi-sys", - "once_cell", - "serde", - "serde_json", -] - -[[package]] -name = "napi-build" -version = "2.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1c0f5d67ee408a4685b61f5ab7e58605c8ae3f2b4189f0127d804ff13d5560a" - -[[package]] -name = "napi-derive" -version = "3.0.0-alpha.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c6240c4ddca592cde608bbfa26e2af397c3596e413a0c65c9bbcb65c2f1e485" -dependencies = [ - "cfg-if", - "convert_case", - "napi-derive-backend", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "napi-derive-backend" -version = "2.0.0-alpha.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b32dcc50065508fe2f387076c17adbdf10e038d1c080d48b10196813d94ac6a8" -dependencies = [ - "convert_case", - "once_cell", - "proc-macro2", - "quote", - "regex", - "semver", - "syn", -] - -[[package]] -name = "napi-sys" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "427802e8ec3a734331fec1035594a210ce1ff4dc5bc1950530920ab717964ea3" -dependencies = [ - "libloading", -] - -[[package]] -name = "nibble_vec" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" -dependencies = [ - "smallvec", -] - -[[package]] -name = "normalize-path" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5438dd2b2ff4c6df6e1ce22d825ed2fa93ee2922235cc45186991717f0a892d" - -[[package]] -name = "num-conv" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" - -[[package]] -name = "num-traits" -version = "0.2.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" -dependencies = [ - "autocfg", -] - -[[package]] -name = "once_cell" -version = "1.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" - -[[package]] -name = "oorandom" -version = "11.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b410bbe7e14ab526a0e86877eb47c6996a2bd7746f027ba551028c925390e4e9" - -[[package]] -name = "oxc_napi_resolver" -version = "0.0.0" -dependencies = [ - "napi", - "napi-build", - "napi-derive", - "oxc_resolver", - "tracing-subscriber", -] - -[[package]] -name = "oxc_resolver" -version = "1.11.0" -dependencies = [ - "cfg-if", - "criterion2", - "dashmap", - "document-features", - "dunce", - "indexmap 2.4.0", - "json-strip-comments", - "normalize-path", - "once_cell", - "pnp", - "rayon", - "rustc-hash", - "serde", - "serde_json", - "simdutf8", - "thiserror", - "tracing", - "vfs", -] - -[[package]] -name = "parking_lot_core" -version = "0.9.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall 0.5.2", - "smallvec", - "windows-targets 0.52.6", -] - -[[package]] -name = "path-slash" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e91099d4268b0e11973f036e885d652fb0b21fedcf69738c627f94db6a44f42" - -[[package]] -name = "pathdiff" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8835116a5c179084a830efb3adc117ab007512b535bc1a21c991d3b32a6b44dd" - -[[package]] -name = "pin-project-lite" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" - -[[package]] -name = "pnp" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46770cee76a618023fea15411d0449dd066dc232cc17e4562f154da215f27af7" -dependencies = [ - "arca", - "byteorder", - "concurrent_lru", - "fancy-regex", - "lazy_static", - "miniz_oxide", - "pathdiff", - "regex", - "serde", - "serde_json", - "serde_with", - "thiserror", -] - -[[package]] -name = "powerfmt" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" - -[[package]] -name = "proc-macro2" -version = "1.0.86" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.36" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "radix_trie" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" -dependencies = [ - "endian-type", - "nibble_vec", -] - -[[package]] -name = "rayon" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" -dependencies = [ - "either", - "rayon-core", -] - -[[package]] -name = "rayon-core" -version = "1.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" -dependencies = [ - "crossbeam-deque", - "crossbeam-utils", -] - -[[package]] -name = "redox_syscall" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" -dependencies = [ - "bitflags 1.3.2", -] - -[[package]] -name = "redox_syscall" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c82cf8cff14456045f55ec4241383baeff27af886adb72ffb2162f99911de0fd" -dependencies = [ - "bitflags 2.6.0", -] - -[[package]] -name = "regex" -version = "1.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b91213439dad192326a0d7c6ee3955910425f441d7038e0d6933b0aec5c4517f" -dependencies = [ - "aho-corasick", - "memchr", - "regex-automata", - "regex-syntax", -] - -[[package]] -name = "regex-automata" -version = "0.4.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", -] - -[[package]] -name = "regex-syntax" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" - -[[package]] -name = "rustc-hash" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" - -[[package]] -name = "ryu" -version = "1.0.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" - -[[package]] -name = "same-file" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "scopeguard" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" - -[[package]] -name = "semver" -version = "1.0.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" - -[[package]] -name = "serde" -version = "1.0.209" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99fce0ffe7310761ca6bf9faf5115afbc19688edd00171d81b1bb1b116c63e09" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.209" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5831b979fd7b5439637af1752d535ff49f4860c0f341d1baeb6faf0f4242170" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "serde_json" -version = "1.0.127" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8043c06d9f82bd7271361ed64f415fe5e12a77fdb52e573e7f06a516dea329ad" -dependencies = [ - "indexmap 2.4.0", - "itoa", - "memchr", - "ryu", - "serde", -] - -[[package]] -name = "serde_with" -version = "3.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e73139bc5ec2d45e6c5fd85be5a46949c1c39a4c18e56915f5eb4c12f975e377" -dependencies = [ - "base64", - "chrono", - "hex", - "indexmap 1.9.3", - "indexmap 2.4.0", - "serde", - "serde_derive", - "serde_json", - "serde_with_macros", - "time", -] - -[[package]] -name = "serde_with_macros" -version = "3.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b80d3d6b56b64335c0180e5ffde23b3c5e08c14c585b51a15bd0e95393f46703" -dependencies = [ - "darling", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "sharded-slab" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" -dependencies = [ - "lazy_static", -] - -[[package]] -name = "simdutf8" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f27f6278552951f1f2b8cf9da965d10969b2efdea95a6ec47987ab46edfe263a" - -[[package]] -name = "smallvec" -version = "1.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" - -[[package]] -name = "strsim" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" - -[[package]] -name = "syn" -version = "2.0.70" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f0209b68b3613b093e0ec905354eccaedcfe83b8cb37cbdeae64026c3064c16" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "thiserror" -version = "1.0.63" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.63" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "thread_local" -version = "1.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" -dependencies = [ - "cfg-if", - "once_cell", -] - -[[package]] -name = "time" -version = "0.3.36" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" -dependencies = [ - "deranged", - "itoa", - "num-conv", - "powerfmt", - "serde", - "time-core", - "time-macros", -] - -[[package]] -name = "time-core" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" - -[[package]] -name = "time-macros" -version = "0.2.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" -dependencies = [ - "num-conv", - "time-core", -] - -[[package]] -name = "tracing" -version = "0.1.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" -dependencies = [ - "pin-project-lite", - "tracing-attributes", - "tracing-core", -] - -[[package]] -name = "tracing-attributes" -version = "0.1.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "tracing-core" -version = "0.1.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" -dependencies = [ - "once_cell", -] - -[[package]] -name = "tracing-subscriber" -version = "0.3.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" -dependencies = [ - "sharded-slab", - "thread_local", - "tracing-core", -] - -[[package]] -name = "unicode-ident" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" - -[[package]] -name = "unicode-segmentation" -version = "1.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" - -[[package]] -name = "vfs" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "654cd097e182a71dbf899178e6b5662c2157dd0b8afd5975de18008f6fc173d1" -dependencies = [ - "filetime", -] - -[[package]] -name = "walkdir" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" -dependencies = [ - "same-file", - "winapi-util", -] - -[[package]] -name = "wasm-bindgen" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" -dependencies = [ - "cfg-if", - "wasm-bindgen-macro", -] - -[[package]] -name = "wasm-bindgen-backend" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" -dependencies = [ - "bumpalo", - "log", - "once_cell", - "proc-macro2", - "quote", - "syn", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-macro" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" -dependencies = [ - "quote", - "wasm-bindgen-macro-support", -] - -[[package]] -name = "wasm-bindgen-macro-support" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" -dependencies = [ - "proc-macro2", - "quote", - "syn", - "wasm-bindgen-backend", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-shared" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" - -[[package]] -name = "winapi-util" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b" -dependencies = [ - "windows-sys 0.52.0", -] - -[[package]] -name = "windows-core" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" -dependencies = [ - "windows-targets 0.52.6", -] - -[[package]] -name = "windows-sys" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" -dependencies = [ - "windows-targets 0.48.5", -] - -[[package]] -name = "windows-sys" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" -dependencies = [ - "windows-targets 0.52.6", -] - -[[package]] -name = "windows-targets" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" -dependencies = [ - "windows_aarch64_gnullvm 0.48.5", - "windows_aarch64_msvc 0.48.5", - "windows_i686_gnu 0.48.5", - "windows_i686_msvc 0.48.5", - "windows_x86_64_gnu 0.48.5", - "windows_x86_64_gnullvm 0.48.5", - "windows_x86_64_msvc 0.48.5", -] - -[[package]] -name = "windows-targets" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" -dependencies = [ - "windows_aarch64_gnullvm 0.52.6", - "windows_aarch64_msvc 0.52.6", - "windows_i686_gnu 0.52.6", - "windows_i686_gnullvm", - "windows_i686_msvc 0.52.6", - "windows_x86_64_gnu 0.52.6", - "windows_x86_64_gnullvm 0.52.6", - "windows_x86_64_msvc 0.52.6", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" - -[[package]] -name = "windows_i686_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" - -[[package]] -name = "windows_i686_gnu" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" - -[[package]] -name = "windows_i686_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" - -[[package]] -name = "windows_i686_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" - -[[package]] -name = "windows_i686_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" diff --git a/fixtures/enhanced_resolve/lib/index.js b/fixtures/enhanced_resolve/lib/index.js deleted file mode 100644 index 1e872e8f..00000000 --- a/fixtures/enhanced_resolve/lib/index.js +++ /dev/null @@ -1 +0,0 @@ -// mimic enhanced-resolved root directory structure diff --git a/fixtures/enhanced_resolve/package.json b/fixtures/enhanced_resolve/package.json deleted file mode 100644 index d1b845b5..00000000 --- a/fixtures/enhanced_resolve/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "enhanced-resolve", - "main": "lib/index.js" -} diff --git a/fixtures/enhanced_resolve/test/.gitignore b/fixtures/enhanced_resolve/test/.gitignore deleted file mode 100644 index b021b4e4..00000000 --- a/fixtures/enhanced_resolve/test/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -# created by symlink.rs -/temp -/temp_symlinks \ No newline at end of file diff --git a/fixtures/enhanced_resolve/test/fixtures/#/a.js b/fixtures/enhanced_resolve/test/fixtures/#/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/a.js b/fixtures/enhanced_resolve/test/fixtures/a.js deleted file mode 100644 index 896ffc6d..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/abc.txt b/fixtures/enhanced_resolve/test/fixtures/abc.txt deleted file mode 100644 index f2ba8f84..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/abc.txt +++ /dev/null @@ -1 +0,0 @@ -abc \ No newline at end of file diff --git a/fixtures/enhanced_resolve/test/fixtures/alias/files/a.js b/fixtures/enhanced_resolve/test/fixtures/alias/files/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/b.js b/fixtures/enhanced_resolve/test/fixtures/b.js deleted file mode 100644 index 11476340..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/b.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function b() { - return "This is b"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/browser/module-a.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/browser/module-a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/browser.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/ignore.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/ignore.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/replaced.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/replaced.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/self.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/self.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/toString.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/toString.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-a.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-b.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-c.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-c.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/a.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/b.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/c.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/c.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/d.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/d.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json deleted file mode 100644 index c13fe23b..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "browser": { - "a.js": "./a", - "./b.js": "./b", - "c.js": "./d.js", - "./d.js": "./c.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/package.json b/fixtures/enhanced_resolve/test/fixtures/browser-module/package.json deleted file mode 100644 index 19ff7739..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/browser-module/package.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "exports": { - "./lib/index.js": "./lib/index.js" - }, - "browser": { - "./lib/ignore.js": false, - "./lib/replaced.js": "./lib/browser", - "module-a": "./browser/module-a.js", - "module-b": "module-c", - "module-c": "module-c", - "./toString": "./lib/toString.js", - "./lib/main.js": "./lib/main.js", - "./main.js": "./lib/main.js", - "./lib/xyz.js": "./xyz.js", - "./xyz.js": "./lib/xyz.js", - "./lib/non-existent.js": "./lib/non-existent.js", - ".": false, - "./number": 1, - "./foo": "./lib/replaced.js?query" - }, - "innerBrowser1": { - "field": { - "browser": { - "./lib/main1.js": "./lib/main.js" - } - } - }, - "innerBrowser2": { - "browser": { - "./lib/main2.js": "./lib/replaced.js" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/builtins/package.json b/fixtures/enhanced_resolve/test/fixtures/builtins/package.json deleted file mode 100644 index 4a54ea96..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/builtins/package.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "name": "builtins", - "private": true, - "imports": { - "#fs": { - "default": "fs" - }, - "#http": { - "node": "node:http" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/c.js b/fixtures/enhanced_resolve/test/fixtures/c.js deleted file mode 100644 index e3aca8aa..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/c.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = function b() { - require("./a"); - return "This is c"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/complex.js b/fixtures/enhanced_resolve/test/fixtures/complex.js deleted file mode 100644 index 1f62db84..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/complex.js +++ /dev/null @@ -1,13 +0,0 @@ -var 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); diff --git a/fixtures/enhanced_resolve/test/fixtures/crypto-js/index.js b/fixtures/enhanced_resolve/test/fixtures/crypto-js/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json b/fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json deleted file mode 100644 index 1d31aa8b..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "crypto-js", - "main": "index.js", - "browser": { - "crypto": false - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/decorated-fs/exists.js b/fixtures/enhanced_resolve/test/fixtures/decorated-fs/exists.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/dirOrFile.js b/fixtures/enhanced_resolve/test/fixtures/dirOrFile.js deleted file mode 100644 index c3cb885f..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/dirOrFile.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "file"; diff --git a/fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js b/fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js deleted file mode 100644 index 85e01cd4..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "dir"; diff --git a/fixtures/enhanced_resolve/test/fixtures/directory-default/directory-default.js b/fixtures/enhanced_resolve/test/fixtures/directory-default/directory-default.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js deleted file mode 100644 index d1007aae..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js +++ /dev/null @@ -1 +0,0 @@ -export default "string"; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts deleted file mode 100644 index cb0ff5c3..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json deleted file mode 100644 index b523a1e9..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "@org/pkg", - "exports": { - "./*.js": { - "types": "./dist/*.d.ts", - "default": "./dist/*.js" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js deleted file mode 100644 index d1007aae..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js +++ /dev/null @@ -1 +0,0 @@ -export default "string"; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts deleted file mode 100644 index cb0ff5c3..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json deleted file mode 100644 index 8e55fb46..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "@raviqqe/hidash", - "exports": { - "./*.js": { - "types": "./dist/*.d.ts", - "default": "./dist/*.js" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json deleted file mode 100644 index f0edf449..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "exports-field", - "version": "1.0.0", - "exports": { - ".": "./a/../b/../../pack1/index.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/pack1/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/pack1/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/a.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/a.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json deleted file mode 100644 index 6b105c08..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "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/": { - "webpack": ["./lib/lib2/", "./lib/"], - "node": "./lib/", - "default": "./lib/" - }, - "./dist/a.js": "./../../a.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json deleted file mode 100644 index 0012a3de..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "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" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/umd.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/umd.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field/package.json deleted file mode 100644 index 5fa72bb5..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "@exports-field/core", - "version": "1.0.0", - "exports": "./a.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json deleted file mode 100644 index e6f12074..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "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/lib2/", "./lib/"], - "node": "./lib/", - "default": "./lib/" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/index b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/index deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json deleted file mode 100644 index 1a838f49..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "name": "exports-field", - "exportsField": { - "exports": "./main.js" - }, - "ex": "./index", - "broken": { - ".": "./src" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/src/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/src/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.ts b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.mts b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.mts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mjs b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mjs deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mts.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mts.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.ts b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/app.module.js b/fixtures/enhanced_resolve/test/fixtures/extensions/app.module.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.js b/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/foo.js b/fixtures/enhanced_resolve/test/fixtures/extensions/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/foo.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/foo.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/index.js b/fixtures/enhanced_resolve/test/fixtures/extensions/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/index.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module.js b/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module/index.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/package.json b/fixtures/enhanced_resolve/test/fixtures/extensions/package.json deleted file mode 100644 index 5e55a1e8..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/extensions/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "./index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/file.load1 b/fixtures/enhanced_resolve/test/fixtures/file.load1 deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/file.load2 b/fixtures/enhanced_resolve/test/fixtures/file.load2 deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/foo/index.js b/fixtures/enhanced_resolve/test/fixtures/foo/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/foo/package.json b/fixtures/enhanced_resolve/test/fixtures/foo/package.json deleted file mode 100644 index da86787a..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/foo/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "foo", - "version": "1.0.0" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json deleted file mode 100644 index aa2be496..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "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" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/internal/file.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/internal/file.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/y/y.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/y/y.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/internal/i.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/internal/i.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/nested/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js deleted file mode 100644 index e5b70a86..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = { nested: "nested" } diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-3/nested/f/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-3/nested/f/nested/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-4/f/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-4/f/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f$/$.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f$/$.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f/$.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f/$.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/nested/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/a.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/a.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/b.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/dir/b.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/dir/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/index.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json deleted file mode 100644 index 8d8d3a46..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "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/lib2/", "./lib/"], - "node": "./lib/", - "default": "./lib/" - }, - "./dist/a.js": "./../../a.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/c/index.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/c/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/imports-field/package.json deleted file mode 100644 index 248351a9..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "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" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/a.js b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json deleted file mode 100644 index ded7faa2..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json +++ /dev/null @@ -1,2 +0,0 @@ -{ - "main": "./a.js", diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/a.js b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/package.json b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/package.json deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/issue-238/package.json b/fixtures/enhanced_resolve/test/fixtures/issue-238/package.json deleted file mode 100644 index 352055cd..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/issue-238/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "private": true -} diff --git a/fixtures/enhanced_resolve/test/fixtures/issue-238/src/a/config.js b/fixtures/enhanced_resolve/test/fixtures/issue-238/src/a/config.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/issue-238/src/common/config/myObjectFile.js b/fixtures/enhanced_resolve/test/fixtures/issue-238/src/common/config/myObjectFile.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/lib.js b/fixtures/enhanced_resolve/test/fixtures/lib.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/lib/complex1.js b/fixtures/enhanced_resolve/test/fixtures/lib/complex1.js deleted file mode 100644 index b3de3d70..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/lib/complex1.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "lib complex1"; diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self/index.js b/fixtures/enhanced_resolve/test/fixtures/main-field-self/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json b/fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json deleted file mode 100644 index a2b6f341..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "./" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self2/index.js b/fixtures/enhanced_resolve/test/fixtures/main-field-self2/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json b/fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json deleted file mode 100644 index 4fa6f730..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "." -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main1.js b/fixtures/enhanced_resolve/test/fixtures/main1.js deleted file mode 100644 index 168f2a1e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main1.js +++ /dev/null @@ -1,9 +0,0 @@ -var a = require("./a"); -if (x) { - for (var i = 0; i < 100; i++) { - while (true) require("./b"); - do { - i++; - } while (require("m1/a")()); - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main2.js b/fixtures/enhanced_resolve/test/fixtures/main2.js deleted file mode 100644 index 39f062b1..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main2.js +++ /dev/null @@ -1,12 +0,0 @@ -var 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"); - }); - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main3.js b/fixtures/enhanced_resolve/test/fixtures/main3.js deleted file mode 100644 index 1c180166..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main3.js +++ /dev/null @@ -1,4 +0,0 @@ -var a = require("./a"); -require.ensure([], function(require) { - require("./c.js"); -}); diff --git a/fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js b/fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js deleted file mode 100644 index 997c1051..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is nested m1/a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/no#fragment/#/#.js b/fixtures/enhanced_resolve/test/fixtures/no#fragment/#/#.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/no.js b/fixtures/enhanced_resolve/test/fixtures/no.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/browser.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/browser.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/main.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json deleted file mode 100644 index c469e1fd..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "main": "./main.js", - "browser": "./browser.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js deleted file mode 100644 index 549620a5..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "the correct a.js"; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js deleted file mode 100644 index 5db6632e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = " :) " + require("m2/b.js"); diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js deleted file mode 100644 index d308569d..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require("m1/a") + require("m1"); diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js deleted file mode 100644 index cb8127e8..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "Step2"; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json deleted file mode 100644 index 8d6dfa56..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "dash-name", - "exports": "./index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json deleted file mode 100644 index 4fd8706e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "dash", - "exports": "./index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/invalidPackageJson/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/invalidPackageJson/package.json deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js deleted file mode 100644 index 46fc8e6c..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is m1/a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js deleted file mode 100644 index 8565c244..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is m1/b"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js deleted file mode 100644 index 34faaaf5..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "This is m2/b"; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/file.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/file.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js b/fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js deleted file mode 100644 index 997c1051..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is nested m1/a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/dir/index.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/dir/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/index.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/main.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/browser.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/browser.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/index.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json deleted file mode 100644 index e20ceaeb..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "main": "main.js", - "browser": { - "./package-alias/index.js": "./package-alias/browser.js", - "module": "pkg/dir/index" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/typescript/index.ts b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/typescript/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json deleted file mode 100644 index 4a1f838e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "@exports-field/core", - "version": "1.0.0", - "exports": { - ".": "./a.js", - "./x": "./a.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/prefer-pnp/alternative-modules/m1/b.js b/fixtures/enhanced_resolve/test/fixtures/prefer-pnp/alternative-modules/m1/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.css b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.css deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.js b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json deleted file mode 100644 index 14ab704d..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/index.css b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/index.css deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/module.js b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/module.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json deleted file mode 100644 index ee0eb71b..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "main": "../../../c.js", - "module": "module.js", - "style": "index.css" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/roots_fall_through/index.js b/fixtures/enhanced_resolve/test/fixtures/roots_fall_through/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/main.js b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json deleted file mode 100644 index 70a0f20f..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "browser": { - "./index.js": "./main.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/lib/index.js b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/lib/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/main.js b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json deleted file mode 100644 index 2af9e0d1..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "./main.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/shortcutdir.js/a.js b/fixtures/enhanced_resolve/test/fixtures/shortcutdir.js/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/b b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/b deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/c b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/c deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/a b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/a deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/b b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/b deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/b/foo/a b/fixtures/enhanced_resolve/test/fixtures/yield/b/foo/a deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/a b/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/a deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json b/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json deleted file mode 100644 index 0acc4b4c..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "foo", - "version": "1.0.0", - "browser": { - "./a": false - } -} diff --git "a/fixtures/enhanced_resolve/test/fixtures/\346\265\213\350\257\225.js" "b/fixtures/enhanced_resolve/test/fixtures/\346\265\213\350\257\225.js" deleted file mode 100644 index e69de29b..00000000 diff --git "a/fixtures/misc/\344\270\255\346\226\207/\344\270\255\346\226\207.js" "b/fixtures/misc/\344\270\255\346\226\207/\344\270\255\346\226\207.js" deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/pnp/.gitignore b/fixtures/pnp/.gitignore deleted file mode 100644 index 1783c71a..00000000 --- a/fixtures/pnp/.gitignore +++ /dev/null @@ -1 +0,0 @@ -install_state.gz \ No newline at end of file diff --git a/fixtures/pnp/.pnp.cjs b/fixtures/pnp/.pnp.cjs deleted file mode 100755 index 2a8d1771..00000000 --- a/fixtures/pnp/.pnp.cjs +++ /dev/null @@ -1,7543 +0,0 @@ -#!/usr/bin/env node -/* eslint-disable */ -// @ts-nocheck -"use strict"; - -const RAW_RUNTIME_STATE = -'{\ - "__info": [\ - "This file is automatically generated. Do not touch it, or risk",\ - "your modifications being lost."\ - ],\ - "dependencyTreeRoots": [\ - {\ - "name": "pnp",\ - "reference": "workspace:."\ - }\ - ],\ - "enableTopLevelFallback": true,\ - "ignorePatternData": "(^(?:\\\\.yarn\\\\/sdks(?:\\\\/(?!\\\\.{1,2}(?:\\\\/|$))(?:(?:(?!(?:^|\\\\/)\\\\.{1,2}(?:\\\\/|$)).)*?)|$))$)",\ - "fallbackExclusionList": [\ - ["pnp", ["workspace:."]]\ - ],\ - "fallbackPool": [\ - ],\ - "packageRegistryData": [\ - [null, [\ - [null, {\ - "packageLocation": "./",\ - "packageDependencies": [\ - ["is-even", "npm:1.0.0"],\ - ["is-odd", "npm:3.0.1"]\ - ],\ - "linkType": "SOFT"\ - }]\ - ]],\ - ["is-buffer", [\ - ["npm:1.1.6", {\ - "packageLocation": "./.yarn/cache/is-buffer-npm-1.1.6-08199d9ccc-ae18aa0b6e.zip/node_modules/is-buffer/",\ - "packageDependencies": [\ - ["is-buffer", "npm:1.1.6"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["is-even", [\ - ["npm:1.0.0", {\ - "packageLocation": "./.yarn/cache/is-even-npm-1.0.0-9f726520dc-2728cc2f39.zip/node_modules/is-even/",\ - "packageDependencies": [\ - ["is-even", "npm:1.0.0"],\ - ["is-odd", "npm:0.1.2"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["is-number", [\ - ["npm:3.0.0", {\ - "packageLocation": "./.yarn/cache/is-number-npm-3.0.0-9088035ade-e639c54640.zip/node_modules/is-number/",\ - "packageDependencies": [\ - ["is-number", "npm:3.0.0"],\ - ["kind-of", "npm:3.2.2"]\ - ],\ - "linkType": "HARD"\ - }],\ - ["npm:6.0.0", {\ - "packageLocation": "./.yarn/cache/is-number-npm-6.0.0-30881e83e6-5da4c68401.zip/node_modules/is-number/",\ - "packageDependencies": [\ - ["is-number", "npm:6.0.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["is-odd", [\ - ["npm:0.1.2", {\ - "packageLocation": "./.yarn/cache/is-odd-npm-0.1.2-9d980a9da8-7dc6c6fd00.zip/node_modules/is-odd/",\ - "packageDependencies": [\ - ["is-odd", "npm:0.1.2"],\ - ["is-number", "npm:3.0.0"]\ - ],\ - "linkType": "HARD"\ - }],\ - ["npm:3.0.1", {\ - "packageLocation": "./.yarn/cache/is-odd-npm-3.0.1-93c3c3f41b-89ee2e353c.zip/node_modules/is-odd/",\ - "packageDependencies": [\ - ["is-odd", "npm:3.0.1"],\ - ["is-number", "npm:6.0.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["kind-of", [\ - ["npm:3.2.2", {\ - "packageLocation": "./.yarn/cache/kind-of-npm-3.2.2-7deaffa5f9-7e34bc29d4.zip/node_modules/kind-of/",\ - "packageDependencies": [\ - ["kind-of", "npm:3.2.2"],\ - ["is-buffer", "npm:1.1.6"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["pnp", [\ - ["workspace:.", {\ - "packageLocation": "./",\ - "packageDependencies": [\ - ["pnp", "workspace:."],\ - ["is-even", "npm:1.0.0"],\ - ["is-odd", "npm:3.0.1"]\ - ],\ - "linkType": "SOFT"\ - }]\ - ]]\ - ]\ -}'; - -function $$SETUP_STATE(hydrateRuntimeState, basePath) { - return hydrateRuntimeState(JSON.parse(RAW_RUNTIME_STATE), {basePath: basePath || __dirname}); -} - -const fs = require('fs'); -const path = require('path'); -const crypto = require('crypto'); -const os = require('os'); -const events = require('events'); -const nodeUtils = require('util'); -const stream = require('stream'); -const zlib = require('zlib'); -const require$$0 = require('module'); -const StringDecoder = require('string_decoder'); -const url = require('url'); -const buffer = require('buffer'); -const readline = require('readline'); -const assert = require('assert'); - -const _interopDefaultLegacy = e => e && typeof e === 'object' && 'default' in e ? e : { default: e }; - -function _interopNamespace(e) { - if (e && e.__esModule) return e; - const n = Object.create(null); - if (e) { - for (const k in e) { - if (k !== 'default') { - const d = Object.getOwnPropertyDescriptor(e, k); - Object.defineProperty(n, k, d.get ? d : { - enumerable: true, - get: () => e[k] - }); - } - } - } - n.default = e; - return Object.freeze(n); -} - -const fs__default = /*#__PURE__*/_interopDefaultLegacy(fs); -const path__default = /*#__PURE__*/_interopDefaultLegacy(path); -const nodeUtils__namespace = /*#__PURE__*/_interopNamespace(nodeUtils); -const zlib__default = /*#__PURE__*/_interopDefaultLegacy(zlib); -const require$$0__default = /*#__PURE__*/_interopDefaultLegacy(require$$0); -const StringDecoder__default = /*#__PURE__*/_interopDefaultLegacy(StringDecoder); -const buffer__default = /*#__PURE__*/_interopDefaultLegacy(buffer); -const assert__default = /*#__PURE__*/_interopDefaultLegacy(assert); - -const S_IFMT = 61440; -const S_IFDIR = 16384; -const S_IFREG = 32768; -const S_IFLNK = 40960; -const SAFE_TIME = 456789e3; - -function makeError$1(code, message) { - return Object.assign(new Error(`${code}: ${message}`), { code }); -} -function EBUSY(message) { - return makeError$1(`EBUSY`, message); -} -function ENOSYS(message, reason) { - return makeError$1(`ENOSYS`, `${message}, ${reason}`); -} -function EINVAL(reason) { - return makeError$1(`EINVAL`, `invalid argument, ${reason}`); -} -function EBADF(reason) { - return makeError$1(`EBADF`, `bad file descriptor, ${reason}`); -} -function ENOENT(reason) { - return makeError$1(`ENOENT`, `no such file or directory, ${reason}`); -} -function ENOTDIR(reason) { - return makeError$1(`ENOTDIR`, `not a directory, ${reason}`); -} -function EISDIR(reason) { - return makeError$1(`EISDIR`, `illegal operation on a directory, ${reason}`); -} -function EEXIST(reason) { - return makeError$1(`EEXIST`, `file already exists, ${reason}`); -} -function EROFS(reason) { - return makeError$1(`EROFS`, `read-only filesystem, ${reason}`); -} -function ENOTEMPTY(reason) { - return makeError$1(`ENOTEMPTY`, `directory not empty, ${reason}`); -} -function EOPNOTSUPP(reason) { - return makeError$1(`EOPNOTSUPP`, `operation not supported, ${reason}`); -} -function ERR_DIR_CLOSED() { - return makeError$1(`ERR_DIR_CLOSED`, `Directory handle was closed`); -} - -const DEFAULT_MODE = S_IFREG | 420; -class StatEntry { - constructor() { - this.uid = 0; - this.gid = 0; - this.size = 0; - this.blksize = 0; - this.atimeMs = 0; - this.mtimeMs = 0; - this.ctimeMs = 0; - this.birthtimeMs = 0; - this.atime = new Date(0); - this.mtime = new Date(0); - this.ctime = new Date(0); - this.birthtime = new Date(0); - this.dev = 0; - this.ino = 0; - this.mode = DEFAULT_MODE; - this.nlink = 1; - this.rdev = 0; - this.blocks = 1; - } - isBlockDevice() { - return false; - } - isCharacterDevice() { - return false; - } - isDirectory() { - return (this.mode & S_IFMT) === S_IFDIR; - } - isFIFO() { - return false; - } - isFile() { - return (this.mode & S_IFMT) === S_IFREG; - } - isSocket() { - return false; - } - isSymbolicLink() { - return (this.mode & S_IFMT) === S_IFLNK; - } -} -class BigIntStatsEntry { - constructor() { - this.uid = BigInt(0); - this.gid = BigInt(0); - this.size = BigInt(0); - this.blksize = BigInt(0); - this.atimeMs = BigInt(0); - this.mtimeMs = BigInt(0); - this.ctimeMs = BigInt(0); - this.birthtimeMs = BigInt(0); - this.atimeNs = BigInt(0); - this.mtimeNs = BigInt(0); - this.ctimeNs = BigInt(0); - this.birthtimeNs = BigInt(0); - this.atime = new Date(0); - this.mtime = new Date(0); - this.ctime = new Date(0); - this.birthtime = new Date(0); - this.dev = BigInt(0); - this.ino = BigInt(0); - this.mode = BigInt(DEFAULT_MODE); - this.nlink = BigInt(1); - this.rdev = BigInt(0); - this.blocks = BigInt(1); - } - isBlockDevice() { - return false; - } - isCharacterDevice() { - return false; - } - isDirectory() { - return (this.mode & BigInt(S_IFMT)) === BigInt(S_IFDIR); - } - isFIFO() { - return false; - } - isFile() { - return (this.mode & BigInt(S_IFMT)) === BigInt(S_IFREG); - } - isSocket() { - return false; - } - isSymbolicLink() { - return (this.mode & BigInt(S_IFMT)) === BigInt(S_IFLNK); - } -} -function makeDefaultStats() { - return new StatEntry(); -} -function clearStats(stats) { - for (const key in stats) { - if (Object.hasOwn(stats, key)) { - const element = stats[key]; - if (typeof element === `number`) { - stats[key] = 0; - } else if (typeof element === `bigint`) { - stats[key] = BigInt(0); - } else if (nodeUtils__namespace.types.isDate(element)) { - stats[key] = new Date(0); - } - } - } - return stats; -} -function convertToBigIntStats(stats) { - const bigintStats = new BigIntStatsEntry(); - for (const key in stats) { - if (Object.hasOwn(stats, key)) { - const element = stats[key]; - if (typeof element === `number`) { - bigintStats[key] = BigInt(element); - } else if (nodeUtils__namespace.types.isDate(element)) { - bigintStats[key] = new Date(element); - } - } - } - bigintStats.atimeNs = bigintStats.atimeMs * BigInt(1e6); - bigintStats.mtimeNs = bigintStats.mtimeMs * BigInt(1e6); - bigintStats.ctimeNs = bigintStats.ctimeMs * BigInt(1e6); - bigintStats.birthtimeNs = bigintStats.birthtimeMs * BigInt(1e6); - return bigintStats; -} -function areStatsEqual(a, b) { - if (a.atimeMs !== b.atimeMs) - return false; - if (a.birthtimeMs !== b.birthtimeMs) - return false; - if (a.blksize !== b.blksize) - return false; - if (a.blocks !== b.blocks) - return false; - if (a.ctimeMs !== b.ctimeMs) - return false; - if (a.dev !== b.dev) - return false; - if (a.gid !== b.gid) - return false; - if (a.ino !== b.ino) - return false; - if (a.isBlockDevice() !== b.isBlockDevice()) - return false; - if (a.isCharacterDevice() !== b.isCharacterDevice()) - return false; - if (a.isDirectory() !== b.isDirectory()) - return false; - if (a.isFIFO() !== b.isFIFO()) - return false; - if (a.isFile() !== b.isFile()) - return false; - if (a.isSocket() !== b.isSocket()) - return false; - if (a.isSymbolicLink() !== b.isSymbolicLink()) - return false; - if (a.mode !== b.mode) - return false; - if (a.mtimeMs !== b.mtimeMs) - return false; - if (a.nlink !== b.nlink) - return false; - if (a.rdev !== b.rdev) - return false; - if (a.size !== b.size) - return false; - if (a.uid !== b.uid) - return false; - const aN = a; - const bN = b; - if (aN.atimeNs !== bN.atimeNs) - return false; - if (aN.mtimeNs !== bN.mtimeNs) - return false; - if (aN.ctimeNs !== bN.ctimeNs) - return false; - if (aN.birthtimeNs !== bN.birthtimeNs) - return false; - return true; -} - -const PortablePath = { - root: `/`, - dot: `.`, - parent: `..` -}; -const Filename = { - home: `~`, - nodeModules: `node_modules`, - manifest: `package.json`, - lockfile: `yarn.lock`, - virtual: `__virtual__`, - pnpJs: `.pnp.js`, - pnpCjs: `.pnp.cjs`, - pnpData: `.pnp.data.json`, - pnpEsmLoader: `.pnp.loader.mjs`, - rc: `.yarnrc.yml`, - env: `.env` -}; -const npath = Object.create(path__default.default); -const ppath = Object.create(path__default.default.posix); -npath.cwd = () => process.cwd(); -ppath.cwd = process.platform === `win32` ? () => toPortablePath(process.cwd()) : process.cwd; -if (process.platform === `win32`) { - ppath.resolve = (...segments) => { - if (segments.length > 0 && ppath.isAbsolute(segments[0])) { - return path__default.default.posix.resolve(...segments); - } else { - return path__default.default.posix.resolve(ppath.cwd(), ...segments); - } - }; -} -const contains = function(pathUtils, from, to) { - from = pathUtils.normalize(from); - to = pathUtils.normalize(to); - if (from === to) - return `.`; - if (!from.endsWith(pathUtils.sep)) - from = from + pathUtils.sep; - if (to.startsWith(from)) { - return to.slice(from.length); - } else { - return null; - } -}; -npath.contains = (from, to) => contains(npath, from, to); -ppath.contains = (from, to) => contains(ppath, from, to); -const WINDOWS_PATH_REGEXP = /^([a-zA-Z]:.*)$/; -const UNC_WINDOWS_PATH_REGEXP = /^\/\/(\.\/)?(.*)$/; -const PORTABLE_PATH_REGEXP = /^\/([a-zA-Z]:.*)$/; -const UNC_PORTABLE_PATH_REGEXP = /^\/unc\/(\.dot\/)?(.*)$/; -function fromPortablePathWin32(p) { - let portablePathMatch, uncPortablePathMatch; - if (portablePathMatch = p.match(PORTABLE_PATH_REGEXP)) - p = portablePathMatch[1]; - else if (uncPortablePathMatch = p.match(UNC_PORTABLE_PATH_REGEXP)) - p = `\\\\${uncPortablePathMatch[1] ? `.\\` : ``}${uncPortablePathMatch[2]}`; - else - return p; - return p.replace(/\//g, `\\`); -} -function toPortablePathWin32(p) { - p = p.replace(/\\/g, `/`); - let windowsPathMatch, uncWindowsPathMatch; - if (windowsPathMatch = p.match(WINDOWS_PATH_REGEXP)) - p = `/${windowsPathMatch[1]}`; - else if (uncWindowsPathMatch = p.match(UNC_WINDOWS_PATH_REGEXP)) - p = `/unc/${uncWindowsPathMatch[1] ? `.dot/` : ``}${uncWindowsPathMatch[2]}`; - return p; -} -const toPortablePath = process.platform === `win32` ? toPortablePathWin32 : (p) => p; -const fromPortablePath = process.platform === `win32` ? fromPortablePathWin32 : (p) => p; -npath.fromPortablePath = fromPortablePath; -npath.toPortablePath = toPortablePath; -function convertPath(targetPathUtils, sourcePath) { - return targetPathUtils === npath ? fromPortablePath(sourcePath) : toPortablePath(sourcePath); -} - -const defaultTime = new Date(SAFE_TIME * 1e3); -const defaultTimeMs = defaultTime.getTime(); -async function copyPromise(destinationFs, destination, sourceFs, source, opts) { - const normalizedDestination = destinationFs.pathUtils.normalize(destination); - const normalizedSource = sourceFs.pathUtils.normalize(source); - const prelayout = []; - const postlayout = []; - const { atime, mtime } = opts.stableTime ? { atime: defaultTime, mtime: defaultTime } : await sourceFs.lstatPromise(normalizedSource); - await destinationFs.mkdirpPromise(destinationFs.pathUtils.dirname(destination), { utimes: [atime, mtime] }); - await copyImpl(prelayout, postlayout, destinationFs, normalizedDestination, sourceFs, normalizedSource, { ...opts, didParentExist: true }); - for (const operation of prelayout) - await operation(); - await Promise.all(postlayout.map((operation) => { - return operation(); - })); -} -async function copyImpl(prelayout, postlayout, destinationFs, destination, sourceFs, source, opts) { - const destinationStat = opts.didParentExist ? await maybeLStat(destinationFs, destination) : null; - const sourceStat = await sourceFs.lstatPromise(source); - const { atime, mtime } = opts.stableTime ? { atime: defaultTime, mtime: defaultTime } : sourceStat; - let updated; - switch (true) { - case sourceStat.isDirectory(): - { - updated = await copyFolder(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts); - } - break; - case sourceStat.isFile(): - { - updated = await copyFile(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts); - } - break; - case sourceStat.isSymbolicLink(): - { - updated = await copySymlink(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts); - } - break; - default: { - throw new Error(`Unsupported file type (${sourceStat.mode})`); - } - } - if (opts.linkStrategy?.type !== `HardlinkFromIndex` || !sourceStat.isFile()) { - if (updated || destinationStat?.mtime?.getTime() !== mtime.getTime() || destinationStat?.atime?.getTime() !== atime.getTime()) { - postlayout.push(() => destinationFs.lutimesPromise(destination, atime, mtime)); - updated = true; - } - if (destinationStat === null || (destinationStat.mode & 511) !== (sourceStat.mode & 511)) { - postlayout.push(() => destinationFs.chmodPromise(destination, sourceStat.mode & 511)); - updated = true; - } - } - return updated; -} -async function maybeLStat(baseFs, p) { - try { - return await baseFs.lstatPromise(p); - } catch (e) { - return null; - } -} -async function copyFolder(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts) { - if (destinationStat !== null && !destinationStat.isDirectory()) { - if (opts.overwrite) { - prelayout.push(async () => destinationFs.removePromise(destination)); - destinationStat = null; - } else { - return false; - } - } - let updated = false; - if (destinationStat === null) { - prelayout.push(async () => { - try { - await destinationFs.mkdirPromise(destination, { mode: sourceStat.mode }); - } catch (err) { - if (err.code !== `EEXIST`) { - throw err; - } - } - }); - updated = true; - } - const entries = await sourceFs.readdirPromise(source); - const nextOpts = opts.didParentExist && !destinationStat ? { ...opts, didParentExist: false } : opts; - if (opts.stableSort) { - for (const entry of entries.sort()) { - if (await copyImpl(prelayout, postlayout, destinationFs, destinationFs.pathUtils.join(destination, entry), sourceFs, sourceFs.pathUtils.join(source, entry), nextOpts)) { - updated = true; - } - } - } else { - const entriesUpdateStatus = await Promise.all(entries.map(async (entry) => { - await copyImpl(prelayout, postlayout, destinationFs, destinationFs.pathUtils.join(destination, entry), sourceFs, sourceFs.pathUtils.join(source, entry), nextOpts); - })); - if (entriesUpdateStatus.some((status) => status)) { - updated = true; - } - } - return updated; -} -async function copyFileViaIndex(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts, linkStrategy) { - const sourceHash = await sourceFs.checksumFilePromise(source, { algorithm: `sha1` }); - const defaultMode = 420; - const sourceMode = sourceStat.mode & 511; - const indexFileName = `${sourceHash}${sourceMode !== defaultMode ? sourceMode.toString(8) : ``}`; - const indexPath = destinationFs.pathUtils.join(linkStrategy.indexPath, sourceHash.slice(0, 2), `${indexFileName}.dat`); - let AtomicBehavior; - ((AtomicBehavior2) => { - AtomicBehavior2[AtomicBehavior2["Lock"] = 0] = "Lock"; - AtomicBehavior2[AtomicBehavior2["Rename"] = 1] = "Rename"; - })(AtomicBehavior || (AtomicBehavior = {})); - let atomicBehavior = 1 /* Rename */; - let indexStat = await maybeLStat(destinationFs, indexPath); - if (destinationStat) { - const isDestinationHardlinkedFromIndex = indexStat && destinationStat.dev === indexStat.dev && destinationStat.ino === indexStat.ino; - const isIndexModified = indexStat?.mtimeMs !== defaultTimeMs; - if (isDestinationHardlinkedFromIndex) { - if (isIndexModified && linkStrategy.autoRepair) { - atomicBehavior = 0 /* Lock */; - indexStat = null; - } - } - if (!isDestinationHardlinkedFromIndex) { - if (opts.overwrite) { - prelayout.push(async () => destinationFs.removePromise(destination)); - destinationStat = null; - } else { - return false; - } - } - } - const tempPath = !indexStat && atomicBehavior === 1 /* Rename */ ? `${indexPath}.${Math.floor(Math.random() * 4294967296).toString(16).padStart(8, `0`)}` : null; - let tempPathCleaned = false; - prelayout.push(async () => { - if (!indexStat) { - if (atomicBehavior === 0 /* Lock */) { - await destinationFs.lockPromise(indexPath, async () => { - const content = await sourceFs.readFilePromise(source); - await destinationFs.writeFilePromise(indexPath, content); - }); - } - if (atomicBehavior === 1 /* Rename */ && tempPath) { - const content = await sourceFs.readFilePromise(source); - await destinationFs.writeFilePromise(tempPath, content); - try { - await destinationFs.linkPromise(tempPath, indexPath); - } catch (err) { - if (err.code === `EEXIST`) { - tempPathCleaned = true; - await destinationFs.unlinkPromise(tempPath); - } else { - throw err; - } - } - } - } - if (!destinationStat) { - await destinationFs.linkPromise(indexPath, destination); - } - }); - postlayout.push(async () => { - if (!indexStat) { - await destinationFs.lutimesPromise(indexPath, defaultTime, defaultTime); - if (sourceMode !== defaultMode) { - await destinationFs.chmodPromise(indexPath, sourceMode); - } - } - if (tempPath && !tempPathCleaned) { - await destinationFs.unlinkPromise(tempPath); - } - }); - return false; -} -async function copyFileDirect(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts) { - if (destinationStat !== null) { - if (opts.overwrite) { - prelayout.push(async () => destinationFs.removePromise(destination)); - destinationStat = null; - } else { - return false; - } - } - prelayout.push(async () => { - const content = await sourceFs.readFilePromise(source); - await destinationFs.writeFilePromise(destination, content); - }); - return true; -} -async function copyFile(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts) { - if (opts.linkStrategy?.type === `HardlinkFromIndex`) { - return copyFileViaIndex(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts, opts.linkStrategy); - } else { - return copyFileDirect(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts); - } -} -async function copySymlink(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts) { - if (destinationStat !== null) { - if (opts.overwrite) { - prelayout.push(async () => destinationFs.removePromise(destination)); - destinationStat = null; - } else { - return false; - } - } - prelayout.push(async () => { - await destinationFs.symlinkPromise(convertPath(destinationFs.pathUtils, await sourceFs.readlinkPromise(source)), destination); - }); - return true; -} - -class CustomDir { - constructor(path, nextDirent, opts = {}) { - this.path = path; - this.nextDirent = nextDirent; - this.opts = opts; - this.closed = false; - } - throwIfClosed() { - if (this.closed) { - throw ERR_DIR_CLOSED(); - } - } - async *[Symbol.asyncIterator]() { - try { - let dirent; - while ((dirent = await this.read()) !== null) { - yield dirent; - } - } finally { - await this.close(); - } - } - read(cb) { - const dirent = this.readSync(); - if (typeof cb !== `undefined`) - return cb(null, dirent); - return Promise.resolve(dirent); - } - readSync() { - this.throwIfClosed(); - return this.nextDirent(); - } - close(cb) { - this.closeSync(); - if (typeof cb !== `undefined`) - return cb(null); - return Promise.resolve(); - } - closeSync() { - this.throwIfClosed(); - this.opts.onClose?.(); - this.closed = true; - } -} -function opendir(fakeFs, path, entries, opts) { - const nextDirent = () => { - const filename = entries.shift(); - if (typeof filename === `undefined`) - return null; - const entryPath = fakeFs.pathUtils.join(path, filename); - return Object.assign(fakeFs.statSync(entryPath), { - name: filename, - path: void 0 - }); - }; - return new CustomDir(path, nextDirent, opts); -} - -function assertStatus(current, expected) { - if (current !== expected) { - throw new Error(`Invalid StatWatcher status: expected '${expected}', got '${current}'`); - } -} -class CustomStatWatcher extends events.EventEmitter { - constructor(fakeFs, path, { bigint = false } = {}) { - super(); - this.status = "ready" /* Ready */; - this.changeListeners = /* @__PURE__ */ new Map(); - this.startTimeout = null; - this.fakeFs = fakeFs; - this.path = path; - this.bigint = bigint; - this.lastStats = this.stat(); - } - static create(fakeFs, path, opts) { - const statWatcher = new CustomStatWatcher(fakeFs, path, opts); - statWatcher.start(); - return statWatcher; - } - start() { - assertStatus(this.status, "ready" /* Ready */); - this.status = "running" /* Running */; - this.startTimeout = setTimeout(() => { - this.startTimeout = null; - if (!this.fakeFs.existsSync(this.path)) { - this.emit("change" /* Change */, this.lastStats, this.lastStats); - } - }, 3); - } - stop() { - assertStatus(this.status, "running" /* Running */); - this.status = "stopped" /* Stopped */; - if (this.startTimeout !== null) { - clearTimeout(this.startTimeout); - this.startTimeout = null; - } - this.emit("stop" /* Stop */); - } - stat() { - try { - return this.fakeFs.statSync(this.path, { bigint: this.bigint }); - } catch (error) { - const statInstance = this.bigint ? new BigIntStatsEntry() : new StatEntry(); - return clearStats(statInstance); - } - } - makeInterval(opts) { - const interval = setInterval(() => { - const currentStats = this.stat(); - const previousStats = this.lastStats; - if (areStatsEqual(currentStats, previousStats)) - return; - this.lastStats = currentStats; - this.emit("change" /* Change */, currentStats, previousStats); - }, opts.interval); - return opts.persistent ? interval : interval.unref(); - } - registerChangeListener(listener, opts) { - this.addListener("change" /* Change */, listener); - this.changeListeners.set(listener, this.makeInterval(opts)); - } - unregisterChangeListener(listener) { - this.removeListener("change" /* Change */, listener); - const interval = this.changeListeners.get(listener); - if (typeof interval !== `undefined`) - clearInterval(interval); - this.changeListeners.delete(listener); - } - unregisterAllChangeListeners() { - for (const listener of this.changeListeners.keys()) { - this.unregisterChangeListener(listener); - } - } - hasChangeListeners() { - return this.changeListeners.size > 0; - } - ref() { - for (const interval of this.changeListeners.values()) - interval.ref(); - return this; - } - unref() { - for (const interval of this.changeListeners.values()) - interval.unref(); - return this; - } -} - -const statWatchersByFakeFS = /* @__PURE__ */ new WeakMap(); -function watchFile(fakeFs, path, a, b) { - let bigint; - let persistent; - let interval; - let listener; - switch (typeof a) { - case `function`: - { - bigint = false; - persistent = true; - interval = 5007; - listener = a; - } - break; - default: - { - ({ - bigint = false, - persistent = true, - interval = 5007 - } = a); - listener = b; - } - break; - } - let statWatchers = statWatchersByFakeFS.get(fakeFs); - if (typeof statWatchers === `undefined`) - statWatchersByFakeFS.set(fakeFs, statWatchers = /* @__PURE__ */ new Map()); - let statWatcher = statWatchers.get(path); - if (typeof statWatcher === `undefined`) { - statWatcher = CustomStatWatcher.create(fakeFs, path, { bigint }); - statWatchers.set(path, statWatcher); - } - statWatcher.registerChangeListener(listener, { persistent, interval }); - return statWatcher; -} -function unwatchFile(fakeFs, path, cb) { - const statWatchers = statWatchersByFakeFS.get(fakeFs); - if (typeof statWatchers === `undefined`) - return; - const statWatcher = statWatchers.get(path); - if (typeof statWatcher === `undefined`) - return; - if (typeof cb === `undefined`) - statWatcher.unregisterAllChangeListeners(); - else - statWatcher.unregisterChangeListener(cb); - if (!statWatcher.hasChangeListeners()) { - statWatcher.stop(); - statWatchers.delete(path); - } -} -function unwatchAllFiles(fakeFs) { - const statWatchers = statWatchersByFakeFS.get(fakeFs); - if (typeof statWatchers === `undefined`) - return; - for (const path of statWatchers.keys()) { - unwatchFile(fakeFs, path); - } -} - -class FakeFS { - constructor(pathUtils) { - this.pathUtils = pathUtils; - } - async *genTraversePromise(init, { stableSort = false } = {}) { - const stack = [init]; - while (stack.length > 0) { - const p = stack.shift(); - const entry = await this.lstatPromise(p); - if (entry.isDirectory()) { - const entries = await this.readdirPromise(p); - if (stableSort) { - for (const entry2 of entries.sort()) { - stack.push(this.pathUtils.join(p, entry2)); - } - } else { - throw new Error(`Not supported`); - } - } else { - yield p; - } - } - } - async checksumFilePromise(path, { algorithm = `sha512` } = {}) { - const fd = await this.openPromise(path, `r`); - try { - const CHUNK_SIZE = 65536; - const chunk = Buffer.allocUnsafeSlow(CHUNK_SIZE); - const hash = crypto.createHash(algorithm); - let bytesRead = 0; - while ((bytesRead = await this.readPromise(fd, chunk, 0, CHUNK_SIZE)) !== 0) - hash.update(bytesRead === CHUNK_SIZE ? chunk : chunk.slice(0, bytesRead)); - return hash.digest(`hex`); - } finally { - await this.closePromise(fd); - } - } - async removePromise(p, { recursive = true, maxRetries = 5 } = {}) { - let stat; - try { - stat = await this.lstatPromise(p); - } catch (error) { - if (error.code === `ENOENT`) { - return; - } else { - throw error; - } - } - if (stat.isDirectory()) { - if (recursive) { - const entries = await this.readdirPromise(p); - await Promise.all(entries.map((entry) => { - return this.removePromise(this.pathUtils.resolve(p, entry)); - })); - } - for (let t = 0; t <= maxRetries; t++) { - try { - await this.rmdirPromise(p); - break; - } catch (error) { - if (error.code !== `EBUSY` && error.code !== `ENOTEMPTY`) { - throw error; - } else if (t < maxRetries) { - await new Promise((resolve) => setTimeout(resolve, t * 100)); - } - } - } - } else { - await this.unlinkPromise(p); - } - } - removeSync(p, { recursive = true } = {}) { - let stat; - try { - stat = this.lstatSync(p); - } catch (error) { - if (error.code === `ENOENT`) { - return; - } else { - throw error; - } - } - if (stat.isDirectory()) { - if (recursive) - for (const entry of this.readdirSync(p)) - this.removeSync(this.pathUtils.resolve(p, entry)); - this.rmdirSync(p); - } else { - this.unlinkSync(p); - } - } - async mkdirpPromise(p, { chmod, utimes } = {}) { - p = this.resolve(p); - if (p === this.pathUtils.dirname(p)) - return void 0; - const parts = p.split(this.pathUtils.sep); - let createdDirectory; - for (let u = 2; u <= parts.length; ++u) { - const subPath = parts.slice(0, u).join(this.pathUtils.sep); - if (!this.existsSync(subPath)) { - try { - await this.mkdirPromise(subPath); - } catch (error) { - if (error.code === `EEXIST`) { - continue; - } else { - throw error; - } - } - createdDirectory ??= subPath; - if (chmod != null) - await this.chmodPromise(subPath, chmod); - if (utimes != null) { - await this.utimesPromise(subPath, utimes[0], utimes[1]); - } else { - const parentStat = await this.statPromise(this.pathUtils.dirname(subPath)); - await this.utimesPromise(subPath, parentStat.atime, parentStat.mtime); - } - } - } - return createdDirectory; - } - mkdirpSync(p, { chmod, utimes } = {}) { - p = this.resolve(p); - if (p === this.pathUtils.dirname(p)) - return void 0; - const parts = p.split(this.pathUtils.sep); - let createdDirectory; - for (let u = 2; u <= parts.length; ++u) { - const subPath = parts.slice(0, u).join(this.pathUtils.sep); - if (!this.existsSync(subPath)) { - try { - this.mkdirSync(subPath); - } catch (error) { - if (error.code === `EEXIST`) { - continue; - } else { - throw error; - } - } - createdDirectory ??= subPath; - if (chmod != null) - this.chmodSync(subPath, chmod); - if (utimes != null) { - this.utimesSync(subPath, utimes[0], utimes[1]); - } else { - const parentStat = this.statSync(this.pathUtils.dirname(subPath)); - this.utimesSync(subPath, parentStat.atime, parentStat.mtime); - } - } - } - return createdDirectory; - } - async copyPromise(destination, source, { baseFs = this, overwrite = true, stableSort = false, stableTime = false, linkStrategy = null } = {}) { - return await copyPromise(this, destination, baseFs, source, { overwrite, stableSort, stableTime, linkStrategy }); - } - copySync(destination, source, { baseFs = this, overwrite = true } = {}) { - const stat = baseFs.lstatSync(source); - const exists = this.existsSync(destination); - if (stat.isDirectory()) { - this.mkdirpSync(destination); - const directoryListing = baseFs.readdirSync(source); - for (const entry of directoryListing) { - this.copySync(this.pathUtils.join(destination, entry), baseFs.pathUtils.join(source, entry), { baseFs, overwrite }); - } - } else if (stat.isFile()) { - if (!exists || overwrite) { - if (exists) - this.removeSync(destination); - const content = baseFs.readFileSync(source); - this.writeFileSync(destination, content); - } - } else if (stat.isSymbolicLink()) { - if (!exists || overwrite) { - if (exists) - this.removeSync(destination); - const target = baseFs.readlinkSync(source); - this.symlinkSync(convertPath(this.pathUtils, target), destination); - } - } else { - throw new Error(`Unsupported file type (file: ${source}, mode: 0o${stat.mode.toString(8).padStart(6, `0`)})`); - } - const mode = stat.mode & 511; - this.chmodSync(destination, mode); - } - async changeFilePromise(p, content, opts = {}) { - if (Buffer.isBuffer(content)) { - return this.changeFileBufferPromise(p, content, opts); - } else { - return this.changeFileTextPromise(p, content, opts); - } - } - async changeFileBufferPromise(p, content, { mode } = {}) { - let current = Buffer.alloc(0); - try { - current = await this.readFilePromise(p); - } catch (error) { - } - if (Buffer.compare(current, content) === 0) - return; - await this.writeFilePromise(p, content, { mode }); - } - async changeFileTextPromise(p, content, { automaticNewlines, mode } = {}) { - let current = ``; - try { - current = await this.readFilePromise(p, `utf8`); - } catch (error) { - } - const normalizedContent = automaticNewlines ? normalizeLineEndings(current, content) : content; - if (current === normalizedContent) - return; - await this.writeFilePromise(p, normalizedContent, { mode }); - } - changeFileSync(p, content, opts = {}) { - if (Buffer.isBuffer(content)) { - return this.changeFileBufferSync(p, content, opts); - } else { - return this.changeFileTextSync(p, content, opts); - } - } - changeFileBufferSync(p, content, { mode } = {}) { - let current = Buffer.alloc(0); - try { - current = this.readFileSync(p); - } catch (error) { - } - if (Buffer.compare(current, content) === 0) - return; - this.writeFileSync(p, content, { mode }); - } - changeFileTextSync(p, content, { automaticNewlines = false, mode } = {}) { - let current = ``; - try { - current = this.readFileSync(p, `utf8`); - } catch (error) { - } - const normalizedContent = automaticNewlines ? normalizeLineEndings(current, content) : content; - if (current === normalizedContent) - return; - this.writeFileSync(p, normalizedContent, { mode }); - } - async movePromise(fromP, toP) { - try { - await this.renamePromise(fromP, toP); - } catch (error) { - if (error.code === `EXDEV`) { - await this.copyPromise(toP, fromP); - await this.removePromise(fromP); - } else { - throw error; - } - } - } - moveSync(fromP, toP) { - try { - this.renameSync(fromP, toP); - } catch (error) { - if (error.code === `EXDEV`) { - this.copySync(toP, fromP); - this.removeSync(fromP); - } else { - throw error; - } - } - } - async lockPromise(affectedPath, callback) { - const lockPath = `${affectedPath}.flock`; - const interval = 1e3 / 60; - const startTime = Date.now(); - let fd = null; - const isAlive = async () => { - let pid; - try { - [pid] = await this.readJsonPromise(lockPath); - } catch (error) { - return Date.now() - startTime < 500; - } - try { - process.kill(pid, 0); - return true; - } catch (error) { - return false; - } - }; - while (fd === null) { - try { - fd = await this.openPromise(lockPath, `wx`); - } catch (error) { - if (error.code === `EEXIST`) { - if (!await isAlive()) { - try { - await this.unlinkPromise(lockPath); - continue; - } catch (error2) { - } - } - if (Date.now() - startTime < 60 * 1e3) { - await new Promise((resolve) => setTimeout(resolve, interval)); - } else { - throw new Error(`Couldn't acquire a lock in a reasonable time (via ${lockPath})`); - } - } else { - throw error; - } - } - } - await this.writePromise(fd, JSON.stringify([process.pid])); - try { - return await callback(); - } finally { - try { - await this.closePromise(fd); - await this.unlinkPromise(lockPath); - } catch (error) { - } - } - } - async readJsonPromise(p) { - const content = await this.readFilePromise(p, `utf8`); - try { - return JSON.parse(content); - } catch (error) { - error.message += ` (in ${p})`; - throw error; - } - } - readJsonSync(p) { - const content = this.readFileSync(p, `utf8`); - try { - return JSON.parse(content); - } catch (error) { - error.message += ` (in ${p})`; - throw error; - } - } - async writeJsonPromise(p, data, { compact = false } = {}) { - const space = compact ? 0 : 2; - return await this.writeFilePromise(p, `${JSON.stringify(data, null, space)} -`); - } - writeJsonSync(p, data, { compact = false } = {}) { - const space = compact ? 0 : 2; - return this.writeFileSync(p, `${JSON.stringify(data, null, space)} -`); - } - async preserveTimePromise(p, cb) { - const stat = await this.lstatPromise(p); - const result = await cb(); - if (typeof result !== `undefined`) - p = result; - await this.lutimesPromise(p, stat.atime, stat.mtime); - } - async preserveTimeSync(p, cb) { - const stat = this.lstatSync(p); - const result = cb(); - if (typeof result !== `undefined`) - p = result; - this.lutimesSync(p, stat.atime, stat.mtime); - } -} -class BasePortableFakeFS extends FakeFS { - constructor() { - super(ppath); - } -} -function getEndOfLine(content) { - const matches = content.match(/\r?\n/g); - if (matches === null) - return os.EOL; - const crlf = matches.filter((nl) => nl === `\r -`).length; - const lf = matches.length - crlf; - return crlf > lf ? `\r -` : ` -`; -} -function normalizeLineEndings(originalContent, newContent) { - return newContent.replace(/\r?\n/g, getEndOfLine(originalContent)); -} - -class ProxiedFS extends FakeFS { - getExtractHint(hints) { - return this.baseFs.getExtractHint(hints); - } - resolve(path) { - return this.mapFromBase(this.baseFs.resolve(this.mapToBase(path))); - } - getRealPath() { - return this.mapFromBase(this.baseFs.getRealPath()); - } - async openPromise(p, flags, mode) { - return this.baseFs.openPromise(this.mapToBase(p), flags, mode); - } - openSync(p, flags, mode) { - return this.baseFs.openSync(this.mapToBase(p), flags, mode); - } - async opendirPromise(p, opts) { - return Object.assign(await this.baseFs.opendirPromise(this.mapToBase(p), opts), { path: p }); - } - opendirSync(p, opts) { - return Object.assign(this.baseFs.opendirSync(this.mapToBase(p), opts), { path: p }); - } - async readPromise(fd, buffer, offset, length, position) { - return await this.baseFs.readPromise(fd, buffer, offset, length, position); - } - readSync(fd, buffer, offset, length, position) { - return this.baseFs.readSync(fd, buffer, offset, length, position); - } - async writePromise(fd, buffer, offset, length, position) { - if (typeof buffer === `string`) { - return await this.baseFs.writePromise(fd, buffer, offset); - } else { - return await this.baseFs.writePromise(fd, buffer, offset, length, position); - } - } - writeSync(fd, buffer, offset, length, position) { - if (typeof buffer === `string`) { - return this.baseFs.writeSync(fd, buffer, offset); - } else { - return this.baseFs.writeSync(fd, buffer, offset, length, position); - } - } - async closePromise(fd) { - return this.baseFs.closePromise(fd); - } - closeSync(fd) { - this.baseFs.closeSync(fd); - } - createReadStream(p, opts) { - return this.baseFs.createReadStream(p !== null ? this.mapToBase(p) : p, opts); - } - createWriteStream(p, opts) { - return this.baseFs.createWriteStream(p !== null ? this.mapToBase(p) : p, opts); - } - async realpathPromise(p) { - return this.mapFromBase(await this.baseFs.realpathPromise(this.mapToBase(p))); - } - realpathSync(p) { - return this.mapFromBase(this.baseFs.realpathSync(this.mapToBase(p))); - } - async existsPromise(p) { - return this.baseFs.existsPromise(this.mapToBase(p)); - } - existsSync(p) { - return this.baseFs.existsSync(this.mapToBase(p)); - } - accessSync(p, mode) { - return this.baseFs.accessSync(this.mapToBase(p), mode); - } - async accessPromise(p, mode) { - return this.baseFs.accessPromise(this.mapToBase(p), mode); - } - async statPromise(p, opts) { - return this.baseFs.statPromise(this.mapToBase(p), opts); - } - statSync(p, opts) { - return this.baseFs.statSync(this.mapToBase(p), opts); - } - async fstatPromise(fd, opts) { - return this.baseFs.fstatPromise(fd, opts); - } - fstatSync(fd, opts) { - return this.baseFs.fstatSync(fd, opts); - } - lstatPromise(p, opts) { - return this.baseFs.lstatPromise(this.mapToBase(p), opts); - } - lstatSync(p, opts) { - return this.baseFs.lstatSync(this.mapToBase(p), opts); - } - async fchmodPromise(fd, mask) { - return this.baseFs.fchmodPromise(fd, mask); - } - fchmodSync(fd, mask) { - return this.baseFs.fchmodSync(fd, mask); - } - async chmodPromise(p, mask) { - return this.baseFs.chmodPromise(this.mapToBase(p), mask); - } - chmodSync(p, mask) { - return this.baseFs.chmodSync(this.mapToBase(p), mask); - } - async fchownPromise(fd, uid, gid) { - return this.baseFs.fchownPromise(fd, uid, gid); - } - fchownSync(fd, uid, gid) { - return this.baseFs.fchownSync(fd, uid, gid); - } - async chownPromise(p, uid, gid) { - return this.baseFs.chownPromise(this.mapToBase(p), uid, gid); - } - chownSync(p, uid, gid) { - return this.baseFs.chownSync(this.mapToBase(p), uid, gid); - } - async renamePromise(oldP, newP) { - return this.baseFs.renamePromise(this.mapToBase(oldP), this.mapToBase(newP)); - } - renameSync(oldP, newP) { - return this.baseFs.renameSync(this.mapToBase(oldP), this.mapToBase(newP)); - } - async copyFilePromise(sourceP, destP, flags = 0) { - return this.baseFs.copyFilePromise(this.mapToBase(sourceP), this.mapToBase(destP), flags); - } - copyFileSync(sourceP, destP, flags = 0) { - return this.baseFs.copyFileSync(this.mapToBase(sourceP), this.mapToBase(destP), flags); - } - async appendFilePromise(p, content, opts) { - return this.baseFs.appendFilePromise(this.fsMapToBase(p), content, opts); - } - appendFileSync(p, content, opts) { - return this.baseFs.appendFileSync(this.fsMapToBase(p), content, opts); - } - async writeFilePromise(p, content, opts) { - return this.baseFs.writeFilePromise(this.fsMapToBase(p), content, opts); - } - writeFileSync(p, content, opts) { - return this.baseFs.writeFileSync(this.fsMapToBase(p), content, opts); - } - async unlinkPromise(p) { - return this.baseFs.unlinkPromise(this.mapToBase(p)); - } - unlinkSync(p) { - return this.baseFs.unlinkSync(this.mapToBase(p)); - } - async utimesPromise(p, atime, mtime) { - return this.baseFs.utimesPromise(this.mapToBase(p), atime, mtime); - } - utimesSync(p, atime, mtime) { - return this.baseFs.utimesSync(this.mapToBase(p), atime, mtime); - } - async lutimesPromise(p, atime, mtime) { - return this.baseFs.lutimesPromise(this.mapToBase(p), atime, mtime); - } - lutimesSync(p, atime, mtime) { - return this.baseFs.lutimesSync(this.mapToBase(p), atime, mtime); - } - async mkdirPromise(p, opts) { - return this.baseFs.mkdirPromise(this.mapToBase(p), opts); - } - mkdirSync(p, opts) { - return this.baseFs.mkdirSync(this.mapToBase(p), opts); - } - async rmdirPromise(p, opts) { - return this.baseFs.rmdirPromise(this.mapToBase(p), opts); - } - rmdirSync(p, opts) { - return this.baseFs.rmdirSync(this.mapToBase(p), opts); - } - async rmPromise(p, opts) { - return this.baseFs.rmPromise(this.mapToBase(p), opts); - } - rmSync(p, opts) { - return this.baseFs.rmSync(this.mapToBase(p), opts); - } - async linkPromise(existingP, newP) { - return this.baseFs.linkPromise(this.mapToBase(existingP), this.mapToBase(newP)); - } - linkSync(existingP, newP) { - return this.baseFs.linkSync(this.mapToBase(existingP), this.mapToBase(newP)); - } - async symlinkPromise(target, p, type) { - const mappedP = this.mapToBase(p); - if (this.pathUtils.isAbsolute(target)) - return this.baseFs.symlinkPromise(this.mapToBase(target), mappedP, type); - const mappedAbsoluteTarget = this.mapToBase(this.pathUtils.join(this.pathUtils.dirname(p), target)); - const mappedTarget = this.baseFs.pathUtils.relative(this.baseFs.pathUtils.dirname(mappedP), mappedAbsoluteTarget); - return this.baseFs.symlinkPromise(mappedTarget, mappedP, type); - } - symlinkSync(target, p, type) { - const mappedP = this.mapToBase(p); - if (this.pathUtils.isAbsolute(target)) - return this.baseFs.symlinkSync(this.mapToBase(target), mappedP, type); - const mappedAbsoluteTarget = this.mapToBase(this.pathUtils.join(this.pathUtils.dirname(p), target)); - const mappedTarget = this.baseFs.pathUtils.relative(this.baseFs.pathUtils.dirname(mappedP), mappedAbsoluteTarget); - return this.baseFs.symlinkSync(mappedTarget, mappedP, type); - } - async readFilePromise(p, encoding) { - return this.baseFs.readFilePromise(this.fsMapToBase(p), encoding); - } - readFileSync(p, encoding) { - return this.baseFs.readFileSync(this.fsMapToBase(p), encoding); - } - readdirPromise(p, opts) { - return this.baseFs.readdirPromise(this.mapToBase(p), opts); - } - readdirSync(p, opts) { - return this.baseFs.readdirSync(this.mapToBase(p), opts); - } - async readlinkPromise(p) { - return this.mapFromBase(await this.baseFs.readlinkPromise(this.mapToBase(p))); - } - readlinkSync(p) { - return this.mapFromBase(this.baseFs.readlinkSync(this.mapToBase(p))); - } - async truncatePromise(p, len) { - return this.baseFs.truncatePromise(this.mapToBase(p), len); - } - truncateSync(p, len) { - return this.baseFs.truncateSync(this.mapToBase(p), len); - } - async ftruncatePromise(fd, len) { - return this.baseFs.ftruncatePromise(fd, len); - } - ftruncateSync(fd, len) { - return this.baseFs.ftruncateSync(fd, len); - } - watch(p, a, b) { - return this.baseFs.watch( - this.mapToBase(p), - a, - b - ); - } - watchFile(p, a, b) { - return this.baseFs.watchFile( - this.mapToBase(p), - a, - b - ); - } - unwatchFile(p, cb) { - return this.baseFs.unwatchFile(this.mapToBase(p), cb); - } - fsMapToBase(p) { - if (typeof p === `number`) { - return p; - } else { - return this.mapToBase(p); - } - } -} - -function direntToPortable(dirent) { - const portableDirent = dirent; - if (typeof dirent.path === `string`) - portableDirent.path = npath.toPortablePath(dirent.path); - return portableDirent; -} -class NodeFS extends BasePortableFakeFS { - constructor(realFs = fs__default.default) { - super(); - this.realFs = realFs; - } - getExtractHint() { - return false; - } - getRealPath() { - return PortablePath.root; - } - resolve(p) { - return ppath.resolve(p); - } - async openPromise(p, flags, mode) { - return await new Promise((resolve, reject) => { - this.realFs.open(npath.fromPortablePath(p), flags, mode, this.makeCallback(resolve, reject)); - }); - } - openSync(p, flags, mode) { - return this.realFs.openSync(npath.fromPortablePath(p), flags, mode); - } - async opendirPromise(p, opts) { - return await new Promise((resolve, reject) => { - if (typeof opts !== `undefined`) { - this.realFs.opendir(npath.fromPortablePath(p), opts, this.makeCallback(resolve, reject)); - } else { - this.realFs.opendir(npath.fromPortablePath(p), this.makeCallback(resolve, reject)); - } - }).then((dir) => { - const dirWithFixedPath = dir; - Object.defineProperty(dirWithFixedPath, `path`, { - value: p, - configurable: true, - writable: true - }); - return dirWithFixedPath; - }); - } - opendirSync(p, opts) { - const dir = typeof opts !== `undefined` ? this.realFs.opendirSync(npath.fromPortablePath(p), opts) : this.realFs.opendirSync(npath.fromPortablePath(p)); - const dirWithFixedPath = dir; - Object.defineProperty(dirWithFixedPath, `path`, { - value: p, - configurable: true, - writable: true - }); - return dirWithFixedPath; - } - async readPromise(fd, buffer, offset = 0, length = 0, position = -1) { - return await new Promise((resolve, reject) => { - this.realFs.read(fd, buffer, offset, length, position, (error, bytesRead) => { - if (error) { - reject(error); - } else { - resolve(bytesRead); - } - }); - }); - } - readSync(fd, buffer, offset, length, position) { - return this.realFs.readSync(fd, buffer, offset, length, position); - } - async writePromise(fd, buffer, offset, length, position) { - return await new Promise((resolve, reject) => { - if (typeof buffer === `string`) { - return this.realFs.write(fd, buffer, offset, this.makeCallback(resolve, reject)); - } else { - return this.realFs.write(fd, buffer, offset, length, position, this.makeCallback(resolve, reject)); - } - }); - } - writeSync(fd, buffer, offset, length, position) { - if (typeof buffer === `string`) { - return this.realFs.writeSync(fd, buffer, offset); - } else { - return this.realFs.writeSync(fd, buffer, offset, length, position); - } - } - async closePromise(fd) { - await new Promise((resolve, reject) => { - this.realFs.close(fd, this.makeCallback(resolve, reject)); - }); - } - closeSync(fd) { - this.realFs.closeSync(fd); - } - createReadStream(p, opts) { - const realPath = p !== null ? npath.fromPortablePath(p) : p; - return this.realFs.createReadStream(realPath, opts); - } - createWriteStream(p, opts) { - const realPath = p !== null ? npath.fromPortablePath(p) : p; - return this.realFs.createWriteStream(realPath, opts); - } - async realpathPromise(p) { - return await new Promise((resolve, reject) => { - this.realFs.realpath(npath.fromPortablePath(p), {}, this.makeCallback(resolve, reject)); - }).then((path) => { - return npath.toPortablePath(path); - }); - } - realpathSync(p) { - return npath.toPortablePath(this.realFs.realpathSync(npath.fromPortablePath(p), {})); - } - async existsPromise(p) { - return await new Promise((resolve) => { - this.realFs.exists(npath.fromPortablePath(p), resolve); - }); - } - accessSync(p, mode) { - return this.realFs.accessSync(npath.fromPortablePath(p), mode); - } - async accessPromise(p, mode) { - return await new Promise((resolve, reject) => { - this.realFs.access(npath.fromPortablePath(p), mode, this.makeCallback(resolve, reject)); - }); - } - existsSync(p) { - return this.realFs.existsSync(npath.fromPortablePath(p)); - } - async statPromise(p, opts) { - return await new Promise((resolve, reject) => { - if (opts) { - this.realFs.stat(npath.fromPortablePath(p), opts, this.makeCallback(resolve, reject)); - } else { - this.realFs.stat(npath.fromPortablePath(p), this.makeCallback(resolve, reject)); - } - }); - } - statSync(p, opts) { - if (opts) { - return this.realFs.statSync(npath.fromPortablePath(p), opts); - } else { - return this.realFs.statSync(npath.fromPortablePath(p)); - } - } - async fstatPromise(fd, opts) { - return await new Promise((resolve, reject) => { - if (opts) { - this.realFs.fstat(fd, opts, this.makeCallback(resolve, reject)); - } else { - this.realFs.fstat(fd, this.makeCallback(resolve, reject)); - } - }); - } - fstatSync(fd, opts) { - if (opts) { - return this.realFs.fstatSync(fd, opts); - } else { - return this.realFs.fstatSync(fd); - } - } - async lstatPromise(p, opts) { - return await new Promise((resolve, reject) => { - if (opts) { - this.realFs.lstat(npath.fromPortablePath(p), opts, this.makeCallback(resolve, reject)); - } else { - this.realFs.lstat(npath.fromPortablePath(p), this.makeCallback(resolve, reject)); - } - }); - } - lstatSync(p, opts) { - if (opts) { - return this.realFs.lstatSync(npath.fromPortablePath(p), opts); - } else { - return this.realFs.lstatSync(npath.fromPortablePath(p)); - } - } - async fchmodPromise(fd, mask) { - return await new Promise((resolve, reject) => { - this.realFs.fchmod(fd, mask, this.makeCallback(resolve, reject)); - }); - } - fchmodSync(fd, mask) { - return this.realFs.fchmodSync(fd, mask); - } - async chmodPromise(p, mask) { - return await new Promise((resolve, reject) => { - this.realFs.chmod(npath.fromPortablePath(p), mask, this.makeCallback(resolve, reject)); - }); - } - chmodSync(p, mask) { - return this.realFs.chmodSync(npath.fromPortablePath(p), mask); - } - async fchownPromise(fd, uid, gid) { - return await new Promise((resolve, reject) => { - this.realFs.fchown(fd, uid, gid, this.makeCallback(resolve, reject)); - }); - } - fchownSync(fd, uid, gid) { - return this.realFs.fchownSync(fd, uid, gid); - } - async chownPromise(p, uid, gid) { - return await new Promise((resolve, reject) => { - this.realFs.chown(npath.fromPortablePath(p), uid, gid, this.makeCallback(resolve, reject)); - }); - } - chownSync(p, uid, gid) { - return this.realFs.chownSync(npath.fromPortablePath(p), uid, gid); - } - async renamePromise(oldP, newP) { - return await new Promise((resolve, reject) => { - this.realFs.rename(npath.fromPortablePath(oldP), npath.fromPortablePath(newP), this.makeCallback(resolve, reject)); - }); - } - renameSync(oldP, newP) { - return this.realFs.renameSync(npath.fromPortablePath(oldP), npath.fromPortablePath(newP)); - } - async copyFilePromise(sourceP, destP, flags = 0) { - return await new Promise((resolve, reject) => { - this.realFs.copyFile(npath.fromPortablePath(sourceP), npath.fromPortablePath(destP), flags, this.makeCallback(resolve, reject)); - }); - } - copyFileSync(sourceP, destP, flags = 0) { - return this.realFs.copyFileSync(npath.fromPortablePath(sourceP), npath.fromPortablePath(destP), flags); - } - async appendFilePromise(p, content, opts) { - return await new Promise((resolve, reject) => { - const fsNativePath = typeof p === `string` ? npath.fromPortablePath(p) : p; - if (opts) { - this.realFs.appendFile(fsNativePath, content, opts, this.makeCallback(resolve, reject)); - } else { - this.realFs.appendFile(fsNativePath, content, this.makeCallback(resolve, reject)); - } - }); - } - appendFileSync(p, content, opts) { - const fsNativePath = typeof p === `string` ? npath.fromPortablePath(p) : p; - if (opts) { - this.realFs.appendFileSync(fsNativePath, content, opts); - } else { - this.realFs.appendFileSync(fsNativePath, content); - } - } - async writeFilePromise(p, content, opts) { - return await new Promise((resolve, reject) => { - const fsNativePath = typeof p === `string` ? npath.fromPortablePath(p) : p; - if (opts) { - this.realFs.writeFile(fsNativePath, content, opts, this.makeCallback(resolve, reject)); - } else { - this.realFs.writeFile(fsNativePath, content, this.makeCallback(resolve, reject)); - } - }); - } - writeFileSync(p, content, opts) { - const fsNativePath = typeof p === `string` ? npath.fromPortablePath(p) : p; - if (opts) { - this.realFs.writeFileSync(fsNativePath, content, opts); - } else { - this.realFs.writeFileSync(fsNativePath, content); - } - } - async unlinkPromise(p) { - return await new Promise((resolve, reject) => { - this.realFs.unlink(npath.fromPortablePath(p), this.makeCallback(resolve, reject)); - }); - } - unlinkSync(p) { - return this.realFs.unlinkSync(npath.fromPortablePath(p)); - } - async utimesPromise(p, atime, mtime) { - return await new Promise((resolve, reject) => { - this.realFs.utimes(npath.fromPortablePath(p), atime, mtime, this.makeCallback(resolve, reject)); - }); - } - utimesSync(p, atime, mtime) { - this.realFs.utimesSync(npath.fromPortablePath(p), atime, mtime); - } - async lutimesPromise(p, atime, mtime) { - return await new Promise((resolve, reject) => { - this.realFs.lutimes(npath.fromPortablePath(p), atime, mtime, this.makeCallback(resolve, reject)); - }); - } - lutimesSync(p, atime, mtime) { - this.realFs.lutimesSync(npath.fromPortablePath(p), atime, mtime); - } - async mkdirPromise(p, opts) { - return await new Promise((resolve, reject) => { - this.realFs.mkdir(npath.fromPortablePath(p), opts, this.makeCallback(resolve, reject)); - }); - } - mkdirSync(p, opts) { - return this.realFs.mkdirSync(npath.fromPortablePath(p), opts); - } - async rmdirPromise(p, opts) { - return await new Promise((resolve, reject) => { - if (opts) { - this.realFs.rmdir(npath.fromPortablePath(p), opts, this.makeCallback(resolve, reject)); - } else { - this.realFs.rmdir(npath.fromPortablePath(p), this.makeCallback(resolve, reject)); - } - }); - } - rmdirSync(p, opts) { - return this.realFs.rmdirSync(npath.fromPortablePath(p), opts); - } - async rmPromise(p, opts) { - return await new Promise((resolve, reject) => { - if (opts) { - this.realFs.rm(npath.fromPortablePath(p), opts, this.makeCallback(resolve, reject)); - } else { - this.realFs.rm(npath.fromPortablePath(p), this.makeCallback(resolve, reject)); - } - }); - } - rmSync(p, opts) { - return this.realFs.rmSync(npath.fromPortablePath(p), opts); - } - async linkPromise(existingP, newP) { - return await new Promise((resolve, reject) => { - this.realFs.link(npath.fromPortablePath(existingP), npath.fromPortablePath(newP), this.makeCallback(resolve, reject)); - }); - } - linkSync(existingP, newP) { - return this.realFs.linkSync(npath.fromPortablePath(existingP), npath.fromPortablePath(newP)); - } - async symlinkPromise(target, p, type) { - return await new Promise((resolve, reject) => { - this.realFs.symlink(npath.fromPortablePath(target.replace(/\/+$/, ``)), npath.fromPortablePath(p), type, this.makeCallback(resolve, reject)); - }); - } - symlinkSync(target, p, type) { - return this.realFs.symlinkSync(npath.fromPortablePath(target.replace(/\/+$/, ``)), npath.fromPortablePath(p), type); - } - async readFilePromise(p, encoding) { - return await new Promise((resolve, reject) => { - const fsNativePath = typeof p === `string` ? npath.fromPortablePath(p) : p; - this.realFs.readFile(fsNativePath, encoding, this.makeCallback(resolve, reject)); - }); - } - readFileSync(p, encoding) { - const fsNativePath = typeof p === `string` ? npath.fromPortablePath(p) : p; - return this.realFs.readFileSync(fsNativePath, encoding); - } - async readdirPromise(p, opts) { - return await new Promise((resolve, reject) => { - if (opts) { - if (opts.recursive && process.platform === `win32`) { - if (opts.withFileTypes) { - this.realFs.readdir(npath.fromPortablePath(p), opts, this.makeCallback((results) => resolve(results.map(direntToPortable)), reject)); - } else { - this.realFs.readdir(npath.fromPortablePath(p), opts, this.makeCallback((results) => resolve(results.map(npath.toPortablePath)), reject)); - } - } else { - this.realFs.readdir(npath.fromPortablePath(p), opts, this.makeCallback(resolve, reject)); - } - } else { - this.realFs.readdir(npath.fromPortablePath(p), this.makeCallback(resolve, reject)); - } - }); - } - readdirSync(p, opts) { - if (opts) { - if (opts.recursive && process.platform === `win32`) { - if (opts.withFileTypes) { - return this.realFs.readdirSync(npath.fromPortablePath(p), opts).map(direntToPortable); - } else { - return this.realFs.readdirSync(npath.fromPortablePath(p), opts).map(npath.toPortablePath); - } - } else { - return this.realFs.readdirSync(npath.fromPortablePath(p), opts); - } - } else { - return this.realFs.readdirSync(npath.fromPortablePath(p)); - } - } - async readlinkPromise(p) { - return await new Promise((resolve, reject) => { - this.realFs.readlink(npath.fromPortablePath(p), this.makeCallback(resolve, reject)); - }).then((path) => { - return npath.toPortablePath(path); - }); - } - readlinkSync(p) { - return npath.toPortablePath(this.realFs.readlinkSync(npath.fromPortablePath(p))); - } - async truncatePromise(p, len) { - return await new Promise((resolve, reject) => { - this.realFs.truncate(npath.fromPortablePath(p), len, this.makeCallback(resolve, reject)); - }); - } - truncateSync(p, len) { - return this.realFs.truncateSync(npath.fromPortablePath(p), len); - } - async ftruncatePromise(fd, len) { - return await new Promise((resolve, reject) => { - this.realFs.ftruncate(fd, len, this.makeCallback(resolve, reject)); - }); - } - ftruncateSync(fd, len) { - return this.realFs.ftruncateSync(fd, len); - } - watch(p, a, b) { - return this.realFs.watch( - npath.fromPortablePath(p), - a, - b - ); - } - watchFile(p, a, b) { - return this.realFs.watchFile( - npath.fromPortablePath(p), - a, - b - ); - } - unwatchFile(p, cb) { - return this.realFs.unwatchFile(npath.fromPortablePath(p), cb); - } - makeCallback(resolve, reject) { - return (err, result) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }; - } -} - -const MOUNT_MASK = 4278190080; -class MountFS extends BasePortableFakeFS { - constructor({ baseFs = new NodeFS(), filter = null, magicByte = 42, maxOpenFiles = Infinity, useCache = true, maxAge = 5e3, typeCheck = fs.constants.S_IFREG, getMountPoint, factoryPromise, factorySync }) { - if (Math.floor(magicByte) !== magicByte || !(magicByte > 1 && magicByte <= 127)) - throw new Error(`The magic byte must be set to a round value between 1 and 127 included`); - super(); - this.fdMap = /* @__PURE__ */ new Map(); - this.nextFd = 3; - this.isMount = /* @__PURE__ */ new Set(); - this.notMount = /* @__PURE__ */ new Set(); - this.realPaths = /* @__PURE__ */ new Map(); - this.limitOpenFilesTimeout = null; - this.baseFs = baseFs; - this.mountInstances = useCache ? /* @__PURE__ */ new Map() : null; - this.factoryPromise = factoryPromise; - this.factorySync = factorySync; - this.filter = filter; - this.getMountPoint = getMountPoint; - this.magic = magicByte << 24; - this.maxAge = maxAge; - this.maxOpenFiles = maxOpenFiles; - this.typeCheck = typeCheck; - } - getExtractHint(hints) { - return this.baseFs.getExtractHint(hints); - } - getRealPath() { - return this.baseFs.getRealPath(); - } - saveAndClose() { - unwatchAllFiles(this); - if (this.mountInstances) { - for (const [path, { childFs }] of this.mountInstances.entries()) { - childFs.saveAndClose?.(); - this.mountInstances.delete(path); - } - } - } - discardAndClose() { - unwatchAllFiles(this); - if (this.mountInstances) { - for (const [path, { childFs }] of this.mountInstances.entries()) { - childFs.discardAndClose?.(); - this.mountInstances.delete(path); - } - } - } - resolve(p) { - return this.baseFs.resolve(p); - } - remapFd(mountFs, fd) { - const remappedFd = this.nextFd++ | this.magic; - this.fdMap.set(remappedFd, [mountFs, fd]); - return remappedFd; - } - async openPromise(p, flags, mode) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.openPromise(p, flags, mode); - }, async (mountFs, { subPath }) => { - return this.remapFd(mountFs, await mountFs.openPromise(subPath, flags, mode)); - }); - } - openSync(p, flags, mode) { - return this.makeCallSync(p, () => { - return this.baseFs.openSync(p, flags, mode); - }, (mountFs, { subPath }) => { - return this.remapFd(mountFs, mountFs.openSync(subPath, flags, mode)); - }); - } - async opendirPromise(p, opts) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.opendirPromise(p, opts); - }, async (mountFs, { subPath }) => { - return await mountFs.opendirPromise(subPath, opts); - }, { - requireSubpath: false - }); - } - opendirSync(p, opts) { - return this.makeCallSync(p, () => { - return this.baseFs.opendirSync(p, opts); - }, (mountFs, { subPath }) => { - return mountFs.opendirSync(subPath, opts); - }, { - requireSubpath: false - }); - } - async readPromise(fd, buffer, offset, length, position) { - if ((fd & MOUNT_MASK) !== this.magic) - return await this.baseFs.readPromise(fd, buffer, offset, length, position); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`read`); - const [mountFs, realFd] = entry; - return await mountFs.readPromise(realFd, buffer, offset, length, position); - } - readSync(fd, buffer, offset, length, position) { - if ((fd & MOUNT_MASK) !== this.magic) - return this.baseFs.readSync(fd, buffer, offset, length, position); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`readSync`); - const [mountFs, realFd] = entry; - return mountFs.readSync(realFd, buffer, offset, length, position); - } - async writePromise(fd, buffer, offset, length, position) { - if ((fd & MOUNT_MASK) !== this.magic) { - if (typeof buffer === `string`) { - return await this.baseFs.writePromise(fd, buffer, offset); - } else { - return await this.baseFs.writePromise(fd, buffer, offset, length, position); - } - } - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`write`); - const [mountFs, realFd] = entry; - if (typeof buffer === `string`) { - return await mountFs.writePromise(realFd, buffer, offset); - } else { - return await mountFs.writePromise(realFd, buffer, offset, length, position); - } - } - writeSync(fd, buffer, offset, length, position) { - if ((fd & MOUNT_MASK) !== this.magic) { - if (typeof buffer === `string`) { - return this.baseFs.writeSync(fd, buffer, offset); - } else { - return this.baseFs.writeSync(fd, buffer, offset, length, position); - } - } - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`writeSync`); - const [mountFs, realFd] = entry; - if (typeof buffer === `string`) { - return mountFs.writeSync(realFd, buffer, offset); - } else { - return mountFs.writeSync(realFd, buffer, offset, length, position); - } - } - async closePromise(fd) { - if ((fd & MOUNT_MASK) !== this.magic) - return await this.baseFs.closePromise(fd); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`close`); - this.fdMap.delete(fd); - const [mountFs, realFd] = entry; - return await mountFs.closePromise(realFd); - } - closeSync(fd) { - if ((fd & MOUNT_MASK) !== this.magic) - return this.baseFs.closeSync(fd); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`closeSync`); - this.fdMap.delete(fd); - const [mountFs, realFd] = entry; - return mountFs.closeSync(realFd); - } - createReadStream(p, opts) { - if (p === null) - return this.baseFs.createReadStream(p, opts); - return this.makeCallSync(p, () => { - return this.baseFs.createReadStream(p, opts); - }, (mountFs, { archivePath, subPath }) => { - const stream = mountFs.createReadStream(subPath, opts); - stream.path = npath.fromPortablePath(this.pathUtils.join(archivePath, subPath)); - return stream; - }); - } - createWriteStream(p, opts) { - if (p === null) - return this.baseFs.createWriteStream(p, opts); - return this.makeCallSync(p, () => { - return this.baseFs.createWriteStream(p, opts); - }, (mountFs, { subPath }) => { - return mountFs.createWriteStream(subPath, opts); - }); - } - async realpathPromise(p) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.realpathPromise(p); - }, async (mountFs, { archivePath, subPath }) => { - let realArchivePath = this.realPaths.get(archivePath); - if (typeof realArchivePath === `undefined`) { - realArchivePath = await this.baseFs.realpathPromise(archivePath); - this.realPaths.set(archivePath, realArchivePath); - } - return this.pathUtils.join(realArchivePath, this.pathUtils.relative(PortablePath.root, await mountFs.realpathPromise(subPath))); - }); - } - realpathSync(p) { - return this.makeCallSync(p, () => { - return this.baseFs.realpathSync(p); - }, (mountFs, { archivePath, subPath }) => { - let realArchivePath = this.realPaths.get(archivePath); - if (typeof realArchivePath === `undefined`) { - realArchivePath = this.baseFs.realpathSync(archivePath); - this.realPaths.set(archivePath, realArchivePath); - } - return this.pathUtils.join(realArchivePath, this.pathUtils.relative(PortablePath.root, mountFs.realpathSync(subPath))); - }); - } - async existsPromise(p) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.existsPromise(p); - }, async (mountFs, { subPath }) => { - return await mountFs.existsPromise(subPath); - }); - } - existsSync(p) { - return this.makeCallSync(p, () => { - return this.baseFs.existsSync(p); - }, (mountFs, { subPath }) => { - return mountFs.existsSync(subPath); - }); - } - async accessPromise(p, mode) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.accessPromise(p, mode); - }, async (mountFs, { subPath }) => { - return await mountFs.accessPromise(subPath, mode); - }); - } - accessSync(p, mode) { - return this.makeCallSync(p, () => { - return this.baseFs.accessSync(p, mode); - }, (mountFs, { subPath }) => { - return mountFs.accessSync(subPath, mode); - }); - } - async statPromise(p, opts) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.statPromise(p, opts); - }, async (mountFs, { subPath }) => { - return await mountFs.statPromise(subPath, opts); - }); - } - statSync(p, opts) { - return this.makeCallSync(p, () => { - return this.baseFs.statSync(p, opts); - }, (mountFs, { subPath }) => { - return mountFs.statSync(subPath, opts); - }); - } - async fstatPromise(fd, opts) { - if ((fd & MOUNT_MASK) !== this.magic) - return this.baseFs.fstatPromise(fd, opts); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`fstat`); - const [mountFs, realFd] = entry; - return mountFs.fstatPromise(realFd, opts); - } - fstatSync(fd, opts) { - if ((fd & MOUNT_MASK) !== this.magic) - return this.baseFs.fstatSync(fd, opts); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`fstatSync`); - const [mountFs, realFd] = entry; - return mountFs.fstatSync(realFd, opts); - } - async lstatPromise(p, opts) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.lstatPromise(p, opts); - }, async (mountFs, { subPath }) => { - return await mountFs.lstatPromise(subPath, opts); - }); - } - lstatSync(p, opts) { - return this.makeCallSync(p, () => { - return this.baseFs.lstatSync(p, opts); - }, (mountFs, { subPath }) => { - return mountFs.lstatSync(subPath, opts); - }); - } - async fchmodPromise(fd, mask) { - if ((fd & MOUNT_MASK) !== this.magic) - return this.baseFs.fchmodPromise(fd, mask); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`fchmod`); - const [mountFs, realFd] = entry; - return mountFs.fchmodPromise(realFd, mask); - } - fchmodSync(fd, mask) { - if ((fd & MOUNT_MASK) !== this.magic) - return this.baseFs.fchmodSync(fd, mask); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`fchmodSync`); - const [mountFs, realFd] = entry; - return mountFs.fchmodSync(realFd, mask); - } - async chmodPromise(p, mask) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.chmodPromise(p, mask); - }, async (mountFs, { subPath }) => { - return await mountFs.chmodPromise(subPath, mask); - }); - } - chmodSync(p, mask) { - return this.makeCallSync(p, () => { - return this.baseFs.chmodSync(p, mask); - }, (mountFs, { subPath }) => { - return mountFs.chmodSync(subPath, mask); - }); - } - async fchownPromise(fd, uid, gid) { - if ((fd & MOUNT_MASK) !== this.magic) - return this.baseFs.fchownPromise(fd, uid, gid); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`fchown`); - const [zipFs, realFd] = entry; - return zipFs.fchownPromise(realFd, uid, gid); - } - fchownSync(fd, uid, gid) { - if ((fd & MOUNT_MASK) !== this.magic) - return this.baseFs.fchownSync(fd, uid, gid); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`fchownSync`); - const [zipFs, realFd] = entry; - return zipFs.fchownSync(realFd, uid, gid); - } - async chownPromise(p, uid, gid) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.chownPromise(p, uid, gid); - }, async (mountFs, { subPath }) => { - return await mountFs.chownPromise(subPath, uid, gid); - }); - } - chownSync(p, uid, gid) { - return this.makeCallSync(p, () => { - return this.baseFs.chownSync(p, uid, gid); - }, (mountFs, { subPath }) => { - return mountFs.chownSync(subPath, uid, gid); - }); - } - async renamePromise(oldP, newP) { - return await this.makeCallPromise(oldP, async () => { - return await this.makeCallPromise(newP, async () => { - return await this.baseFs.renamePromise(oldP, newP); - }, async () => { - throw Object.assign(new Error(`EEXDEV: cross-device link not permitted`), { code: `EEXDEV` }); - }); - }, async (mountFsO, { subPath: subPathO }) => { - return await this.makeCallPromise(newP, async () => { - throw Object.assign(new Error(`EEXDEV: cross-device link not permitted`), { code: `EEXDEV` }); - }, async (mountFsN, { subPath: subPathN }) => { - if (mountFsO !== mountFsN) { - throw Object.assign(new Error(`EEXDEV: cross-device link not permitted`), { code: `EEXDEV` }); - } else { - return await mountFsO.renamePromise(subPathO, subPathN); - } - }); - }); - } - renameSync(oldP, newP) { - return this.makeCallSync(oldP, () => { - return this.makeCallSync(newP, () => { - return this.baseFs.renameSync(oldP, newP); - }, () => { - throw Object.assign(new Error(`EEXDEV: cross-device link not permitted`), { code: `EEXDEV` }); - }); - }, (mountFsO, { subPath: subPathO }) => { - return this.makeCallSync(newP, () => { - throw Object.assign(new Error(`EEXDEV: cross-device link not permitted`), { code: `EEXDEV` }); - }, (mountFsN, { subPath: subPathN }) => { - if (mountFsO !== mountFsN) { - throw Object.assign(new Error(`EEXDEV: cross-device link not permitted`), { code: `EEXDEV` }); - } else { - return mountFsO.renameSync(subPathO, subPathN); - } - }); - }); - } - async copyFilePromise(sourceP, destP, flags = 0) { - const fallback = async (sourceFs, sourceP2, destFs, destP2) => { - if ((flags & fs.constants.COPYFILE_FICLONE_FORCE) !== 0) - throw Object.assign(new Error(`EXDEV: cross-device clone not permitted, copyfile '${sourceP2}' -> ${destP2}'`), { code: `EXDEV` }); - if (flags & fs.constants.COPYFILE_EXCL && await this.existsPromise(sourceP2)) - throw Object.assign(new Error(`EEXIST: file already exists, copyfile '${sourceP2}' -> '${destP2}'`), { code: `EEXIST` }); - let content; - try { - content = await sourceFs.readFilePromise(sourceP2); - } catch (error) { - throw Object.assign(new Error(`EINVAL: invalid argument, copyfile '${sourceP2}' -> '${destP2}'`), { code: `EINVAL` }); - } - await destFs.writeFilePromise(destP2, content); - }; - return await this.makeCallPromise(sourceP, async () => { - return await this.makeCallPromise(destP, async () => { - return await this.baseFs.copyFilePromise(sourceP, destP, flags); - }, async (mountFsD, { subPath: subPathD }) => { - return await fallback(this.baseFs, sourceP, mountFsD, subPathD); - }); - }, async (mountFsS, { subPath: subPathS }) => { - return await this.makeCallPromise(destP, async () => { - return await fallback(mountFsS, subPathS, this.baseFs, destP); - }, async (mountFsD, { subPath: subPathD }) => { - if (mountFsS !== mountFsD) { - return await fallback(mountFsS, subPathS, mountFsD, subPathD); - } else { - return await mountFsS.copyFilePromise(subPathS, subPathD, flags); - } - }); - }); - } - copyFileSync(sourceP, destP, flags = 0) { - const fallback = (sourceFs, sourceP2, destFs, destP2) => { - if ((flags & fs.constants.COPYFILE_FICLONE_FORCE) !== 0) - throw Object.assign(new Error(`EXDEV: cross-device clone not permitted, copyfile '${sourceP2}' -> ${destP2}'`), { code: `EXDEV` }); - if (flags & fs.constants.COPYFILE_EXCL && this.existsSync(sourceP2)) - throw Object.assign(new Error(`EEXIST: file already exists, copyfile '${sourceP2}' -> '${destP2}'`), { code: `EEXIST` }); - let content; - try { - content = sourceFs.readFileSync(sourceP2); - } catch (error) { - throw Object.assign(new Error(`EINVAL: invalid argument, copyfile '${sourceP2}' -> '${destP2}'`), { code: `EINVAL` }); - } - destFs.writeFileSync(destP2, content); - }; - return this.makeCallSync(sourceP, () => { - return this.makeCallSync(destP, () => { - return this.baseFs.copyFileSync(sourceP, destP, flags); - }, (mountFsD, { subPath: subPathD }) => { - return fallback(this.baseFs, sourceP, mountFsD, subPathD); - }); - }, (mountFsS, { subPath: subPathS }) => { - return this.makeCallSync(destP, () => { - return fallback(mountFsS, subPathS, this.baseFs, destP); - }, (mountFsD, { subPath: subPathD }) => { - if (mountFsS !== mountFsD) { - return fallback(mountFsS, subPathS, mountFsD, subPathD); - } else { - return mountFsS.copyFileSync(subPathS, subPathD, flags); - } - }); - }); - } - async appendFilePromise(p, content, opts) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.appendFilePromise(p, content, opts); - }, async (mountFs, { subPath }) => { - return await mountFs.appendFilePromise(subPath, content, opts); - }); - } - appendFileSync(p, content, opts) { - return this.makeCallSync(p, () => { - return this.baseFs.appendFileSync(p, content, opts); - }, (mountFs, { subPath }) => { - return mountFs.appendFileSync(subPath, content, opts); - }); - } - async writeFilePromise(p, content, opts) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.writeFilePromise(p, content, opts); - }, async (mountFs, { subPath }) => { - return await mountFs.writeFilePromise(subPath, content, opts); - }); - } - writeFileSync(p, content, opts) { - return this.makeCallSync(p, () => { - return this.baseFs.writeFileSync(p, content, opts); - }, (mountFs, { subPath }) => { - return mountFs.writeFileSync(subPath, content, opts); - }); - } - async unlinkPromise(p) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.unlinkPromise(p); - }, async (mountFs, { subPath }) => { - return await mountFs.unlinkPromise(subPath); - }); - } - unlinkSync(p) { - return this.makeCallSync(p, () => { - return this.baseFs.unlinkSync(p); - }, (mountFs, { subPath }) => { - return mountFs.unlinkSync(subPath); - }); - } - async utimesPromise(p, atime, mtime) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.utimesPromise(p, atime, mtime); - }, async (mountFs, { subPath }) => { - return await mountFs.utimesPromise(subPath, atime, mtime); - }); - } - utimesSync(p, atime, mtime) { - return this.makeCallSync(p, () => { - return this.baseFs.utimesSync(p, atime, mtime); - }, (mountFs, { subPath }) => { - return mountFs.utimesSync(subPath, atime, mtime); - }); - } - async lutimesPromise(p, atime, mtime) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.lutimesPromise(p, atime, mtime); - }, async (mountFs, { subPath }) => { - return await mountFs.lutimesPromise(subPath, atime, mtime); - }); - } - lutimesSync(p, atime, mtime) { - return this.makeCallSync(p, () => { - return this.baseFs.lutimesSync(p, atime, mtime); - }, (mountFs, { subPath }) => { - return mountFs.lutimesSync(subPath, atime, mtime); - }); - } - async mkdirPromise(p, opts) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.mkdirPromise(p, opts); - }, async (mountFs, { subPath }) => { - return await mountFs.mkdirPromise(subPath, opts); - }); - } - mkdirSync(p, opts) { - return this.makeCallSync(p, () => { - return this.baseFs.mkdirSync(p, opts); - }, (mountFs, { subPath }) => { - return mountFs.mkdirSync(subPath, opts); - }); - } - async rmdirPromise(p, opts) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.rmdirPromise(p, opts); - }, async (mountFs, { subPath }) => { - return await mountFs.rmdirPromise(subPath, opts); - }); - } - rmdirSync(p, opts) { - return this.makeCallSync(p, () => { - return this.baseFs.rmdirSync(p, opts); - }, (mountFs, { subPath }) => { - return mountFs.rmdirSync(subPath, opts); - }); - } - async rmPromise(p, opts) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.rmPromise(p, opts); - }, async (mountFs, { subPath }) => { - return await mountFs.rmPromise(subPath, opts); - }); - } - rmSync(p, opts) { - return this.makeCallSync(p, () => { - return this.baseFs.rmSync(p, opts); - }, (mountFs, { subPath }) => { - return mountFs.rmSync(subPath, opts); - }); - } - async linkPromise(existingP, newP) { - return await this.makeCallPromise(newP, async () => { - return await this.baseFs.linkPromise(existingP, newP); - }, async (mountFs, { subPath }) => { - return await mountFs.linkPromise(existingP, subPath); - }); - } - linkSync(existingP, newP) { - return this.makeCallSync(newP, () => { - return this.baseFs.linkSync(existingP, newP); - }, (mountFs, { subPath }) => { - return mountFs.linkSync(existingP, subPath); - }); - } - async symlinkPromise(target, p, type) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.symlinkPromise(target, p, type); - }, async (mountFs, { subPath }) => { - return await mountFs.symlinkPromise(target, subPath); - }); - } - symlinkSync(target, p, type) { - return this.makeCallSync(p, () => { - return this.baseFs.symlinkSync(target, p, type); - }, (mountFs, { subPath }) => { - return mountFs.symlinkSync(target, subPath); - }); - } - async readFilePromise(p, encoding) { - return this.makeCallPromise(p, async () => { - return await this.baseFs.readFilePromise(p, encoding); - }, async (mountFs, { subPath }) => { - return await mountFs.readFilePromise(subPath, encoding); - }); - } - readFileSync(p, encoding) { - return this.makeCallSync(p, () => { - return this.baseFs.readFileSync(p, encoding); - }, (mountFs, { subPath }) => { - return mountFs.readFileSync(subPath, encoding); - }); - } - async readdirPromise(p, opts) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.readdirPromise(p, opts); - }, async (mountFs, { subPath }) => { - return await mountFs.readdirPromise(subPath, opts); - }, { - requireSubpath: false - }); - } - readdirSync(p, opts) { - return this.makeCallSync(p, () => { - return this.baseFs.readdirSync(p, opts); - }, (mountFs, { subPath }) => { - return mountFs.readdirSync(subPath, opts); - }, { - requireSubpath: false - }); - } - async readlinkPromise(p) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.readlinkPromise(p); - }, async (mountFs, { subPath }) => { - return await mountFs.readlinkPromise(subPath); - }); - } - readlinkSync(p) { - return this.makeCallSync(p, () => { - return this.baseFs.readlinkSync(p); - }, (mountFs, { subPath }) => { - return mountFs.readlinkSync(subPath); - }); - } - async truncatePromise(p, len) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.truncatePromise(p, len); - }, async (mountFs, { subPath }) => { - return await mountFs.truncatePromise(subPath, len); - }); - } - truncateSync(p, len) { - return this.makeCallSync(p, () => { - return this.baseFs.truncateSync(p, len); - }, (mountFs, { subPath }) => { - return mountFs.truncateSync(subPath, len); - }); - } - async ftruncatePromise(fd, len) { - if ((fd & MOUNT_MASK) !== this.magic) - return this.baseFs.ftruncatePromise(fd, len); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`ftruncate`); - const [mountFs, realFd] = entry; - return mountFs.ftruncatePromise(realFd, len); - } - ftruncateSync(fd, len) { - if ((fd & MOUNT_MASK) !== this.magic) - return this.baseFs.ftruncateSync(fd, len); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`ftruncateSync`); - const [mountFs, realFd] = entry; - return mountFs.ftruncateSync(realFd, len); - } - watch(p, a, b) { - return this.makeCallSync(p, () => { - return this.baseFs.watch( - p, - a, - b - ); - }, (mountFs, { subPath }) => { - return mountFs.watch( - subPath, - a, - b - ); - }); - } - watchFile(p, a, b) { - return this.makeCallSync(p, () => { - return this.baseFs.watchFile( - p, - a, - b - ); - }, () => { - return watchFile(this, p, a, b); - }); - } - unwatchFile(p, cb) { - return this.makeCallSync(p, () => { - return this.baseFs.unwatchFile(p, cb); - }, () => { - return unwatchFile(this, p, cb); - }); - } - async makeCallPromise(p, discard, accept, { requireSubpath = true } = {}) { - if (typeof p !== `string`) - return await discard(); - const normalizedP = this.resolve(p); - const mountInfo = this.findMount(normalizedP); - if (!mountInfo) - return await discard(); - if (requireSubpath && mountInfo.subPath === `/`) - return await discard(); - return await this.getMountPromise(mountInfo.archivePath, async (mountFs) => await accept(mountFs, mountInfo)); - } - makeCallSync(p, discard, accept, { requireSubpath = true } = {}) { - if (typeof p !== `string`) - return discard(); - const normalizedP = this.resolve(p); - const mountInfo = this.findMount(normalizedP); - if (!mountInfo) - return discard(); - if (requireSubpath && mountInfo.subPath === `/`) - return discard(); - return this.getMountSync(mountInfo.archivePath, (mountFs) => accept(mountFs, mountInfo)); - } - findMount(p) { - if (this.filter && !this.filter.test(p)) - return null; - let filePath = ``; - while (true) { - const pathPartWithArchive = p.substring(filePath.length); - const mountPoint = this.getMountPoint(pathPartWithArchive, filePath); - if (!mountPoint) - return null; - filePath = this.pathUtils.join(filePath, mountPoint); - if (!this.isMount.has(filePath)) { - if (this.notMount.has(filePath)) - continue; - try { - if (this.typeCheck !== null && (this.baseFs.lstatSync(filePath).mode & fs.constants.S_IFMT) !== this.typeCheck) { - this.notMount.add(filePath); - continue; - } - } catch { - return null; - } - this.isMount.add(filePath); - } - return { - archivePath: filePath, - subPath: this.pathUtils.join(PortablePath.root, p.substring(filePath.length)) - }; - } - } - limitOpenFiles(max) { - if (this.mountInstances === null) - return; - const now = Date.now(); - let nextExpiresAt = now + this.maxAge; - let closeCount = max === null ? 0 : this.mountInstances.size - max; - for (const [path, { childFs, expiresAt, refCount }] of this.mountInstances.entries()) { - if (refCount !== 0 || childFs.hasOpenFileHandles?.()) { - continue; - } else if (now >= expiresAt) { - childFs.saveAndClose?.(); - this.mountInstances.delete(path); - closeCount -= 1; - continue; - } else if (max === null || closeCount <= 0) { - nextExpiresAt = expiresAt; - break; - } - childFs.saveAndClose?.(); - this.mountInstances.delete(path); - closeCount -= 1; - } - if (this.limitOpenFilesTimeout === null && (max === null && this.mountInstances.size > 0 || max !== null) && isFinite(nextExpiresAt)) { - this.limitOpenFilesTimeout = setTimeout(() => { - this.limitOpenFilesTimeout = null; - this.limitOpenFiles(null); - }, nextExpiresAt - now).unref(); - } - } - async getMountPromise(p, accept) { - if (this.mountInstances) { - let cachedMountFs = this.mountInstances.get(p); - if (!cachedMountFs) { - const createFsInstance = await this.factoryPromise(this.baseFs, p); - cachedMountFs = this.mountInstances.get(p); - if (!cachedMountFs) { - cachedMountFs = { - childFs: createFsInstance(), - expiresAt: 0, - refCount: 0 - }; - } - } - this.mountInstances.delete(p); - this.limitOpenFiles(this.maxOpenFiles - 1); - this.mountInstances.set(p, cachedMountFs); - cachedMountFs.expiresAt = Date.now() + this.maxAge; - cachedMountFs.refCount += 1; - try { - return await accept(cachedMountFs.childFs); - } finally { - cachedMountFs.refCount -= 1; - } - } else { - const mountFs = (await this.factoryPromise(this.baseFs, p))(); - try { - return await accept(mountFs); - } finally { - mountFs.saveAndClose?.(); - } - } - } - getMountSync(p, accept) { - if (this.mountInstances) { - let cachedMountFs = this.mountInstances.get(p); - if (!cachedMountFs) { - cachedMountFs = { - childFs: this.factorySync(this.baseFs, p), - expiresAt: 0, - refCount: 0 - }; - } - this.mountInstances.delete(p); - this.limitOpenFiles(this.maxOpenFiles - 1); - this.mountInstances.set(p, cachedMountFs); - cachedMountFs.expiresAt = Date.now() + this.maxAge; - return accept(cachedMountFs.childFs); - } else { - const childFs = this.factorySync(this.baseFs, p); - try { - return accept(childFs); - } finally { - childFs.saveAndClose?.(); - } - } - } -} - -class PosixFS extends ProxiedFS { - constructor(baseFs) { - super(npath); - this.baseFs = baseFs; - } - mapFromBase(path) { - return npath.fromPortablePath(path); - } - mapToBase(path) { - return npath.toPortablePath(path); - } -} - -const NUMBER_REGEXP = /^[0-9]+$/; -const VIRTUAL_REGEXP = /^(\/(?:[^/]+\/)*?(?:\$\$virtual|__virtual__))((?:\/((?:[^/]+-)?[a-f0-9]+)(?:\/([^/]+))?)?((?:\/.*)?))$/; -const VALID_COMPONENT = /^([^/]+-)?[a-f0-9]+$/; -class VirtualFS extends ProxiedFS { - constructor({ baseFs = new NodeFS() } = {}) { - super(ppath); - this.baseFs = baseFs; - } - static makeVirtualPath(base, component, to) { - if (ppath.basename(base) !== `__virtual__`) - throw new Error(`Assertion failed: Virtual folders must be named "__virtual__"`); - if (!ppath.basename(component).match(VALID_COMPONENT)) - throw new Error(`Assertion failed: Virtual components must be ended by an hexadecimal hash`); - const target = ppath.relative(ppath.dirname(base), to); - const segments = target.split(`/`); - let depth = 0; - while (depth < segments.length && segments[depth] === `..`) - depth += 1; - const finalSegments = segments.slice(depth); - const fullVirtualPath = ppath.join(base, component, String(depth), ...finalSegments); - return fullVirtualPath; - } - static resolveVirtual(p) { - const match = p.match(VIRTUAL_REGEXP); - if (!match || !match[3] && match[5]) - return p; - const target = ppath.dirname(match[1]); - if (!match[3] || !match[4]) - return target; - const isnum = NUMBER_REGEXP.test(match[4]); - if (!isnum) - return p; - const depth = Number(match[4]); - const backstep = `../`.repeat(depth); - const subpath = match[5] || `.`; - return VirtualFS.resolveVirtual(ppath.join(target, backstep, subpath)); - } - getExtractHint(hints) { - return this.baseFs.getExtractHint(hints); - } - getRealPath() { - return this.baseFs.getRealPath(); - } - realpathSync(p) { - const match = p.match(VIRTUAL_REGEXP); - if (!match) - return this.baseFs.realpathSync(p); - if (!match[5]) - return p; - const realpath = this.baseFs.realpathSync(this.mapToBase(p)); - return VirtualFS.makeVirtualPath(match[1], match[3], realpath); - } - async realpathPromise(p) { - const match = p.match(VIRTUAL_REGEXP); - if (!match) - return await this.baseFs.realpathPromise(p); - if (!match[5]) - return p; - const realpath = await this.baseFs.realpathPromise(this.mapToBase(p)); - return VirtualFS.makeVirtualPath(match[1], match[3], realpath); - } - mapToBase(p) { - if (p === ``) - return p; - if (this.pathUtils.isAbsolute(p)) - return VirtualFS.resolveVirtual(p); - const resolvedRoot = VirtualFS.resolveVirtual(this.baseFs.resolve(PortablePath.dot)); - const resolvedP = VirtualFS.resolveVirtual(this.baseFs.resolve(p)); - return ppath.relative(resolvedRoot, resolvedP) || PortablePath.dot; - } - mapFromBase(p) { - return p; - } -} - -const URL = Number(process.versions.node.split('.', 1)[0]) < 20 ? url.URL : globalThis.URL; - -class NodePathFS extends ProxiedFS { - constructor(baseFs) { - super(npath); - this.baseFs = baseFs; - } - mapFromBase(path) { - return path; - } - mapToBase(path) { - if (typeof path === `string`) - return path; - if (path instanceof URL) - return url.fileURLToPath(path); - if (Buffer.isBuffer(path)) { - const str = path.toString(); - if (!isUtf8(path, str)) - throw new Error(`Non-utf8 buffers are not supported at the moment. Please upvote the following issue if you encounter this error: https://github.com/yarnpkg/berry/issues/4942`); - return str; - } - throw new Error(`Unsupported path type: ${nodeUtils.inspect(path)}`); - } -} -function isUtf8(buf, str) { - if (typeof buffer__default.default.isUtf8 !== `undefined`) - return buffer__default.default.isUtf8(buf); - return Buffer.byteLength(str) === buf.byteLength; -} - -var _a, _b, _c, _d; -const kBaseFs = Symbol(`kBaseFs`); -const kFd = Symbol(`kFd`); -const kClosePromise = Symbol(`kClosePromise`); -const kCloseResolve = Symbol(`kCloseResolve`); -const kCloseReject = Symbol(`kCloseReject`); -const kRefs = Symbol(`kRefs`); -const kRef = Symbol(`kRef`); -const kUnref = Symbol(`kUnref`); -class FileHandle { - constructor(fd, baseFs) { - this[_a] = 1; - this[_b] = void 0; - this[_c] = void 0; - this[_d] = void 0; - this[kBaseFs] = baseFs; - this[kFd] = fd; - } - get fd() { - return this[kFd]; - } - async appendFile(data, options) { - try { - this[kRef](this.appendFile); - const encoding = (typeof options === `string` ? options : options?.encoding) ?? void 0; - return await this[kBaseFs].appendFilePromise(this.fd, data, encoding ? { encoding } : void 0); - } finally { - this[kUnref](); - } - } - async chown(uid, gid) { - try { - this[kRef](this.chown); - return await this[kBaseFs].fchownPromise(this.fd, uid, gid); - } finally { - this[kUnref](); - } - } - async chmod(mode) { - try { - this[kRef](this.chmod); - return await this[kBaseFs].fchmodPromise(this.fd, mode); - } finally { - this[kUnref](); - } - } - createReadStream(options) { - return this[kBaseFs].createReadStream(null, { ...options, fd: this.fd }); - } - createWriteStream(options) { - return this[kBaseFs].createWriteStream(null, { ...options, fd: this.fd }); - } - datasync() { - throw new Error(`Method not implemented.`); - } - sync() { - throw new Error(`Method not implemented.`); - } - async read(bufferOrOptions, offset, length, position) { - try { - this[kRef](this.read); - let buffer; - if (!Buffer.isBuffer(bufferOrOptions)) { - bufferOrOptions ??= {}; - buffer = bufferOrOptions.buffer ?? Buffer.alloc(16384); - offset = bufferOrOptions.offset || 0; - length = bufferOrOptions.length ?? buffer.byteLength; - position = bufferOrOptions.position ?? null; - } else { - buffer = bufferOrOptions; - } - offset ??= 0; - length ??= 0; - if (length === 0) { - return { - bytesRead: length, - buffer - }; - } - const bytesRead = await this[kBaseFs].readPromise(this.fd, buffer, offset, length, position); - return { - bytesRead, - buffer - }; - } finally { - this[kUnref](); - } - } - async readFile(options) { - try { - this[kRef](this.readFile); - const encoding = (typeof options === `string` ? options : options?.encoding) ?? void 0; - return await this[kBaseFs].readFilePromise(this.fd, encoding); - } finally { - this[kUnref](); - } - } - readLines(options) { - return readline.createInterface({ - input: this.createReadStream(options), - crlfDelay: Infinity - }); - } - async stat(opts) { - try { - this[kRef](this.stat); - return await this[kBaseFs].fstatPromise(this.fd, opts); - } finally { - this[kUnref](); - } - } - async truncate(len) { - try { - this[kRef](this.truncate); - return await this[kBaseFs].ftruncatePromise(this.fd, len); - } finally { - this[kUnref](); - } - } - utimes(atime, mtime) { - throw new Error(`Method not implemented.`); - } - async writeFile(data, options) { - try { - this[kRef](this.writeFile); - const encoding = (typeof options === `string` ? options : options?.encoding) ?? void 0; - await this[kBaseFs].writeFilePromise(this.fd, data, encoding); - } finally { - this[kUnref](); - } - } - async write(...args) { - try { - this[kRef](this.write); - if (ArrayBuffer.isView(args[0])) { - const [buffer, offset, length, position] = args; - const bytesWritten = await this[kBaseFs].writePromise(this.fd, buffer, offset ?? void 0, length ?? void 0, position ?? void 0); - return { bytesWritten, buffer }; - } else { - const [data, position, encoding] = args; - const bytesWritten = await this[kBaseFs].writePromise(this.fd, data, position, encoding); - return { bytesWritten, buffer: data }; - } - } finally { - this[kUnref](); - } - } - async writev(buffers, position) { - try { - this[kRef](this.writev); - let bytesWritten = 0; - if (typeof position !== `undefined`) { - for (const buffer of buffers) { - const writeResult = await this.write(buffer, void 0, void 0, position); - bytesWritten += writeResult.bytesWritten; - position += writeResult.bytesWritten; - } - } else { - for (const buffer of buffers) { - const writeResult = await this.write(buffer); - bytesWritten += writeResult.bytesWritten; - } - } - return { - buffers, - bytesWritten - }; - } finally { - this[kUnref](); - } - } - readv(buffers, position) { - throw new Error(`Method not implemented.`); - } - close() { - if (this[kFd] === -1) - return Promise.resolve(); - if (this[kClosePromise]) - return this[kClosePromise]; - this[kRefs]--; - if (this[kRefs] === 0) { - const fd = this[kFd]; - this[kFd] = -1; - this[kClosePromise] = this[kBaseFs].closePromise(fd).finally(() => { - this[kClosePromise] = void 0; - }); - } else { - this[kClosePromise] = new Promise((resolve, reject) => { - this[kCloseResolve] = resolve; - this[kCloseReject] = reject; - }).finally(() => { - this[kClosePromise] = void 0; - this[kCloseReject] = void 0; - this[kCloseResolve] = void 0; - }); - } - return this[kClosePromise]; - } - [(_a = kRefs, _b = kClosePromise, _c = kCloseResolve, _d = kCloseReject, kRef)](caller) { - if (this[kFd] === -1) { - const err = new Error(`file closed`); - err.code = `EBADF`; - err.syscall = caller.name; - throw err; - } - this[kRefs]++; - } - [kUnref]() { - this[kRefs]--; - if (this[kRefs] === 0) { - const fd = this[kFd]; - this[kFd] = -1; - this[kBaseFs].closePromise(fd).then(this[kCloseResolve], this[kCloseReject]); - } - } -} - -const SYNC_IMPLEMENTATIONS = /* @__PURE__ */ new Set([ - `accessSync`, - `appendFileSync`, - `createReadStream`, - `createWriteStream`, - `chmodSync`, - `fchmodSync`, - `chownSync`, - `fchownSync`, - `closeSync`, - `copyFileSync`, - `linkSync`, - `lstatSync`, - `fstatSync`, - `lutimesSync`, - `mkdirSync`, - `openSync`, - `opendirSync`, - `readlinkSync`, - `readFileSync`, - `readdirSync`, - `readlinkSync`, - `realpathSync`, - `renameSync`, - `rmdirSync`, - `rmSync`, - `statSync`, - `symlinkSync`, - `truncateSync`, - `ftruncateSync`, - `unlinkSync`, - `unwatchFile`, - `utimesSync`, - `watch`, - `watchFile`, - `writeFileSync`, - `writeSync` -]); -const ASYNC_IMPLEMENTATIONS = /* @__PURE__ */ new Set([ - `accessPromise`, - `appendFilePromise`, - `fchmodPromise`, - `chmodPromise`, - `fchownPromise`, - `chownPromise`, - `closePromise`, - `copyFilePromise`, - `linkPromise`, - `fstatPromise`, - `lstatPromise`, - `lutimesPromise`, - `mkdirPromise`, - `openPromise`, - `opendirPromise`, - `readdirPromise`, - `realpathPromise`, - `readFilePromise`, - `readdirPromise`, - `readlinkPromise`, - `renamePromise`, - `rmdirPromise`, - `rmPromise`, - `statPromise`, - `symlinkPromise`, - `truncatePromise`, - `ftruncatePromise`, - `unlinkPromise`, - `utimesPromise`, - `writeFilePromise`, - `writeSync` -]); -function patchFs(patchedFs, fakeFs) { - fakeFs = new NodePathFS(fakeFs); - const setupFn = (target, name, replacement) => { - const orig = target[name]; - target[name] = replacement; - if (typeof orig?.[nodeUtils.promisify.custom] !== `undefined`) { - replacement[nodeUtils.promisify.custom] = orig[nodeUtils.promisify.custom]; - } - }; - { - setupFn(patchedFs, `exists`, (p, ...args) => { - const hasCallback = typeof args[args.length - 1] === `function`; - const callback = hasCallback ? args.pop() : () => { - }; - process.nextTick(() => { - fakeFs.existsPromise(p).then((exists) => { - callback(exists); - }, () => { - callback(false); - }); - }); - }); - setupFn(patchedFs, `read`, (...args) => { - let [fd, buffer, offset, length, position, callback] = args; - if (args.length <= 3) { - let options = {}; - if (args.length < 3) { - callback = args[1]; - } else { - options = args[1]; - callback = args[2]; - } - ({ - buffer = Buffer.alloc(16384), - offset = 0, - length = buffer.byteLength, - position - } = options); - } - if (offset == null) - offset = 0; - length |= 0; - if (length === 0) { - process.nextTick(() => { - callback(null, 0, buffer); - }); - return; - } - if (position == null) - position = -1; - process.nextTick(() => { - fakeFs.readPromise(fd, buffer, offset, length, position).then((bytesRead) => { - callback(null, bytesRead, buffer); - }, (error) => { - callback(error, 0, buffer); - }); - }); - }); - for (const fnName of ASYNC_IMPLEMENTATIONS) { - const origName = fnName.replace(/Promise$/, ``); - if (typeof patchedFs[origName] === `undefined`) - continue; - const fakeImpl = fakeFs[fnName]; - if (typeof fakeImpl === `undefined`) - continue; - const wrapper = (...args) => { - const hasCallback = typeof args[args.length - 1] === `function`; - const callback = hasCallback ? args.pop() : () => { - }; - process.nextTick(() => { - fakeImpl.apply(fakeFs, args).then((result) => { - callback(null, result); - }, (error) => { - callback(error); - }); - }); - }; - setupFn(patchedFs, origName, wrapper); - } - patchedFs.realpath.native = patchedFs.realpath; - } - { - setupFn(patchedFs, `existsSync`, (p) => { - try { - return fakeFs.existsSync(p); - } catch (error) { - return false; - } - }); - setupFn(patchedFs, `readSync`, (...args) => { - let [fd, buffer, offset, length, position] = args; - if (args.length <= 3) { - const options = args[2] || {}; - ({ offset = 0, length = buffer.byteLength, position } = options); - } - if (offset == null) - offset = 0; - length |= 0; - if (length === 0) - return 0; - if (position == null) - position = -1; - return fakeFs.readSync(fd, buffer, offset, length, position); - }); - for (const fnName of SYNC_IMPLEMENTATIONS) { - const origName = fnName; - if (typeof patchedFs[origName] === `undefined`) - continue; - const fakeImpl = fakeFs[fnName]; - if (typeof fakeImpl === `undefined`) - continue; - setupFn(patchedFs, origName, fakeImpl.bind(fakeFs)); - } - patchedFs.realpathSync.native = patchedFs.realpathSync; - } - { - const patchedFsPromises = patchedFs.promises; - for (const fnName of ASYNC_IMPLEMENTATIONS) { - const origName = fnName.replace(/Promise$/, ``); - if (typeof patchedFsPromises[origName] === `undefined`) - continue; - const fakeImpl = fakeFs[fnName]; - if (typeof fakeImpl === `undefined`) - continue; - if (fnName === `open`) - continue; - setupFn(patchedFsPromises, origName, (pathLike, ...args) => { - if (pathLike instanceof FileHandle) { - return pathLike[origName].apply(pathLike, args); - } else { - return fakeImpl.call(fakeFs, pathLike, ...args); - } - }); - } - setupFn(patchedFsPromises, `open`, async (...args) => { - const fd = await fakeFs.openPromise(...args); - return new FileHandle(fd, fakeFs); - }); - } - { - patchedFs.read[nodeUtils.promisify.custom] = async (fd, buffer, ...args) => { - const res = fakeFs.readPromise(fd, buffer, ...args); - return { bytesRead: await res, buffer }; - }; - patchedFs.write[nodeUtils.promisify.custom] = async (fd, buffer, ...args) => { - const res = fakeFs.writePromise(fd, buffer, ...args); - return { bytesWritten: await res, buffer }; - }; - } -} - -let cachedInstance; -let registeredFactory = () => { - throw new Error(`Assertion failed: No libzip instance is available, and no factory was configured`); -}; -function setFactory(factory) { - registeredFactory = factory; -} -function getInstance() { - if (typeof cachedInstance === `undefined`) - cachedInstance = registeredFactory(); - return cachedInstance; -} - -var libzipSync = {exports: {}}; - -(function (module, exports) { -var frozenFs = Object.assign({}, fs__default.default); -var createModule = function() { - var _scriptDir = void 0; - if (typeof __filename !== "undefined") - _scriptDir = _scriptDir || __filename; - return function(createModule2) { - createModule2 = createModule2 || {}; - var Module = typeof createModule2 !== "undefined" ? createModule2 : {}; - var readyPromiseResolve, readyPromiseReject; - Module["ready"] = new Promise(function(resolve, reject) { - readyPromiseResolve = resolve; - readyPromiseReject = reject; - }); - var moduleOverrides = {}; - var key; - for (key in Module) { - if (Module.hasOwnProperty(key)) { - moduleOverrides[key] = Module[key]; - } - } - var scriptDirectory = ""; - function locateFile(path) { - if (Module["locateFile"]) { - return Module["locateFile"](path, scriptDirectory); - } - return scriptDirectory + path; - } - var read_, readBinary; - var nodeFS; - var nodePath; - { - { - scriptDirectory = __dirname + "/"; - } - read_ = function shell_read(filename, binary) { - var ret = tryParseAsDataURI(filename); - if (ret) { - return binary ? ret : ret.toString(); - } - if (!nodeFS) - nodeFS = frozenFs; - if (!nodePath) - nodePath = path__default.default; - filename = nodePath["normalize"](filename); - return nodeFS["readFileSync"](filename, binary ? null : "utf8"); - }; - readBinary = function readBinary2(filename) { - var ret = read_(filename, true); - if (!ret.buffer) { - ret = new Uint8Array(ret); - } - assert(ret.buffer); - return ret; - }; - if (process["argv"].length > 1) { - process["argv"][1].replace(/\\/g, "/"); - } - process["argv"].slice(2); - Module["inspect"] = function() { - return "[Emscripten Module object]"; - }; - } - Module["print"] || console.log.bind(console); - var err = Module["printErr"] || console.warn.bind(console); - for (key in moduleOverrides) { - if (moduleOverrides.hasOwnProperty(key)) { - Module[key] = moduleOverrides[key]; - } - } - moduleOverrides = null; - if (Module["arguments"]) - ; - if (Module["thisProgram"]) - ; - if (Module["quit"]) - ; - var wasmBinary; - if (Module["wasmBinary"]) - wasmBinary = Module["wasmBinary"]; - Module["noExitRuntime"] || true; - if (typeof WebAssembly !== "object") { - abort("no native wasm support detected"); - } - function getValue(ptr, type, noSafe) { - type = type || "i8"; - if (type.charAt(type.length - 1) === "*") - type = "i32"; - switch (type) { - case "i1": - return HEAP8[ptr >> 0]; - case "i8": - return HEAP8[ptr >> 0]; - case "i16": - return LE_HEAP_LOAD_I16((ptr >> 1) * 2); - case "i32": - return LE_HEAP_LOAD_I32((ptr >> 2) * 4); - case "i64": - return LE_HEAP_LOAD_I32((ptr >> 2) * 4); - case "float": - return LE_HEAP_LOAD_F32((ptr >> 2) * 4); - case "double": - return LE_HEAP_LOAD_F64((ptr >> 3) * 8); - default: - abort("invalid type for getValue: " + type); - } - return null; - } - var wasmMemory; - var ABORT = false; - function assert(condition, text) { - if (!condition) { - abort("Assertion failed: " + text); - } - } - function getCFunc(ident) { - var func = Module["_" + ident]; - assert( - func, - "Cannot call unknown function " + ident + ", make sure it is exported" - ); - return func; - } - function ccall(ident, returnType, argTypes, args, opts) { - var toC = { - string: function(str) { - var ret2 = 0; - if (str !== null && str !== void 0 && str !== 0) { - var len = (str.length << 2) + 1; - ret2 = stackAlloc(len); - stringToUTF8(str, ret2, len); - } - return ret2; - }, - array: function(arr) { - var ret2 = stackAlloc(arr.length); - writeArrayToMemory(arr, ret2); - return ret2; - } - }; - function convertReturnValue(ret2) { - if (returnType === "string") - return UTF8ToString(ret2); - if (returnType === "boolean") - return Boolean(ret2); - return ret2; - } - var func = getCFunc(ident); - var cArgs = []; - var stack = 0; - if (args) { - for (var i = 0; i < args.length; i++) { - var converter = toC[argTypes[i]]; - if (converter) { - if (stack === 0) - stack = stackSave(); - cArgs[i] = converter(args[i]); - } else { - cArgs[i] = args[i]; - } - } - } - var ret = func.apply(null, cArgs); - ret = convertReturnValue(ret); - if (stack !== 0) - stackRestore(stack); - return ret; - } - function cwrap(ident, returnType, argTypes, opts) { - argTypes = argTypes || []; - var numericArgs = argTypes.every(function(type) { - return type === "number"; - }); - var numericRet = returnType !== "string"; - if (numericRet && numericArgs && !opts) { - return getCFunc(ident); - } - return function() { - return ccall(ident, returnType, argTypes, arguments); - }; - } - var UTF8Decoder = new TextDecoder("utf8"); - function UTF8ToString(ptr, maxBytesToRead) { - if (!ptr) - return ""; - var maxPtr = ptr + maxBytesToRead; - for (var end = ptr; !(end >= maxPtr) && HEAPU8[end]; ) - ++end; - return UTF8Decoder.decode(HEAPU8.subarray(ptr, end)); - } - function stringToUTF8Array(str, heap, outIdx, maxBytesToWrite) { - if (!(maxBytesToWrite > 0)) - return 0; - var startIdx = outIdx; - var endIdx = outIdx + maxBytesToWrite - 1; - for (var i = 0; i < str.length; ++i) { - var u = str.charCodeAt(i); - if (u >= 55296 && u <= 57343) { - var u1 = str.charCodeAt(++i); - u = 65536 + ((u & 1023) << 10) | u1 & 1023; - } - if (u <= 127) { - if (outIdx >= endIdx) - break; - heap[outIdx++] = u; - } else if (u <= 2047) { - if (outIdx + 1 >= endIdx) - break; - heap[outIdx++] = 192 | u >> 6; - heap[outIdx++] = 128 | u & 63; - } else if (u <= 65535) { - if (outIdx + 2 >= endIdx) - break; - heap[outIdx++] = 224 | u >> 12; - heap[outIdx++] = 128 | u >> 6 & 63; - heap[outIdx++] = 128 | u & 63; - } else { - if (outIdx + 3 >= endIdx) - break; - heap[outIdx++] = 240 | u >> 18; - heap[outIdx++] = 128 | u >> 12 & 63; - heap[outIdx++] = 128 | u >> 6 & 63; - heap[outIdx++] = 128 | u & 63; - } - } - heap[outIdx] = 0; - return outIdx - startIdx; - } - function stringToUTF8(str, outPtr, maxBytesToWrite) { - return stringToUTF8Array(str, HEAPU8, outPtr, maxBytesToWrite); - } - function lengthBytesUTF8(str) { - var len = 0; - for (var i = 0; i < str.length; ++i) { - var u = str.charCodeAt(i); - if (u >= 55296 && u <= 57343) - u = 65536 + ((u & 1023) << 10) | str.charCodeAt(++i) & 1023; - if (u <= 127) - ++len; - else if (u <= 2047) - len += 2; - else if (u <= 65535) - len += 3; - else - len += 4; - } - return len; - } - function allocateUTF8(str) { - var size = lengthBytesUTF8(str) + 1; - var ret = _malloc(size); - if (ret) - stringToUTF8Array(str, HEAP8, ret, size); - return ret; - } - function writeArrayToMemory(array, buffer2) { - HEAP8.set(array, buffer2); - } - function alignUp(x, multiple) { - if (x % multiple > 0) { - x += multiple - x % multiple; - } - return x; - } - var buffer, HEAP8, HEAPU8; - var HEAP_DATA_VIEW; - function updateGlobalBufferAndViews(buf) { - buffer = buf; - Module["HEAP_DATA_VIEW"] = HEAP_DATA_VIEW = new DataView(buf); - Module["HEAP8"] = HEAP8 = new Int8Array(buf); - Module["HEAP16"] = new Int16Array(buf); - Module["HEAP32"] = new Int32Array(buf); - Module["HEAPU8"] = HEAPU8 = new Uint8Array(buf); - Module["HEAPU16"] = new Uint16Array(buf); - Module["HEAPU32"] = new Uint32Array(buf); - Module["HEAPF32"] = new Float32Array(buf); - Module["HEAPF64"] = new Float64Array(buf); - } - Module["INITIAL_MEMORY"] || 16777216; - var wasmTable; - var __ATPRERUN__ = []; - var __ATINIT__ = []; - var __ATPOSTRUN__ = []; - function preRun() { - if (Module["preRun"]) { - if (typeof Module["preRun"] == "function") - Module["preRun"] = [Module["preRun"]]; - while (Module["preRun"].length) { - addOnPreRun(Module["preRun"].shift()); - } - } - callRuntimeCallbacks(__ATPRERUN__); - } - function initRuntime() { - callRuntimeCallbacks(__ATINIT__); - } - function postRun() { - if (Module["postRun"]) { - if (typeof Module["postRun"] == "function") - Module["postRun"] = [Module["postRun"]]; - while (Module["postRun"].length) { - addOnPostRun(Module["postRun"].shift()); - } - } - callRuntimeCallbacks(__ATPOSTRUN__); - } - function addOnPreRun(cb) { - __ATPRERUN__.unshift(cb); - } - function addOnInit(cb) { - __ATINIT__.unshift(cb); - } - function addOnPostRun(cb) { - __ATPOSTRUN__.unshift(cb); - } - var runDependencies = 0; - var dependenciesFulfilled = null; - function addRunDependency(id) { - runDependencies++; - if (Module["monitorRunDependencies"]) { - Module["monitorRunDependencies"](runDependencies); - } - } - function removeRunDependency(id) { - runDependencies--; - if (Module["monitorRunDependencies"]) { - Module["monitorRunDependencies"](runDependencies); - } - if (runDependencies == 0) { - if (dependenciesFulfilled) { - var callback = dependenciesFulfilled; - dependenciesFulfilled = null; - callback(); - } - } - } - Module["preloadedImages"] = {}; - Module["preloadedAudios"] = {}; - function abort(what) { - if (Module["onAbort"]) { - Module["onAbort"](what); - } - what += ""; - err(what); - ABORT = true; - what = "abort(" + what + "). Build with -s ASSERTIONS=1 for more info."; - var e = new WebAssembly.RuntimeError(what); - readyPromiseReject(e); - throw e; - } - var dataURIPrefix = "data:application/octet-stream;base64,"; - function isDataURI(filename) { - return filename.startsWith(dataURIPrefix); - } - var wasmBinaryFile = "data:application/octet-stream;base64,AGFzbQEAAAAB/wEkYAN/f38Bf2ABfwF/YAJ/fwF/YAF/AGAEf39/fwF/YAN/f38AYAV/f39/fwF/YAJ/fwBgBH9/f38AYAABf2AFf39/fn8BfmAEf35/fwF/YAR/f35/AX5gAn9+AX9gA398fwBgA39/fgF/YAF/AX5gBn9/f39/fwF/YAN/fn8Bf2AEf39/fwF+YAV/f35/fwF/YAR/f35/AX9gA39/fgF+YAJ/fgBgAn9/AX5gBX9/f39/AGADf35/AX5gBX5+f35/AX5gA39/fwF+YAZ/fH9/f38Bf2AAAGAHf35/f39+fwF/YAV/fn9/fwF/YAV/f39/fwF+YAJ+fwF/YAJ/fAACJQYBYQFhAAMBYQFiAAEBYQFjAAABYQFkAAEBYQFlAAIBYQFmAAED5wHlAQMAAwEDAwEHDAgDFgcNEgEDDRcFAQ8DEAUQAwIBAhgECxkEAQMBBQsFAwMDARACBAMAAggLBwEAAwADGgQDGwYGABwBBgMTFBEHBwcVCx4ABAgHBAICAgAfAQICAgIGFSAAIQAiAAIBBgIHAg0LEw0FAQUCACMDAQAUAAAGBQECBQUDCwsSAgEDBQIHAQEICAACCQQEAQABCAEBCQoBAwkBAQEBBgEGBgYABAIEBAQGEQQEAAARAAEDCQEJAQAJCQkBAQECCgoAAAMPAQEBAwACAgICBQIABwAKBgwHAAADAgICBQEEBQFwAT8/BQcBAYACgIACBgkBfwFBgInBAgsH+gEzAWcCAAFoAFQBaQDqAQFqALsBAWsAwQEBbACpAQFtAKgBAW4ApwEBbwClAQFwAKMBAXEAoAEBcgCbAQFzAMABAXQAugEBdQC5AQF2AEsBdwDiAQF4AM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IAEgAEHYABAHGgwBCyABQgA3AyAgAUEANgIYIAFC/////w83AxAgAUEAOwEMIAFBv4YoNgIIIAFBAToABiABQQA6AAQgAUIANwNIIAFBgIDYjXg2AkQgAUIANwMoIAFCADcDMCABQgA3AzggAUFAa0EAOwEAIAFCADcDUAsgAUEBOgAFIAFBADYCACABC1gCAn4BfwJAAkAgAC0AAEUNACAAKQMQIgMgAq18IgQgA1QNACAEIAApAwhYDQELIABBADoAAA8LIAAoAgQiBUUEQA8LIAAgBDcDECAFIAOnaiABIAIQBxoLlgEBAn8CQAJAIAJFBEAgAacQCSIFRQ0BQRgQCSIEDQIgBRAGDAELIAIhBUEYEAkiBA0BCyADBEAgA0EANgIEIANBDjYCAAtBAA8LIARCADcDECAEIAE3AwggBCAFNgIEIARBAToAACAEIAJFOgABIAAgBSABIAMQZUEASAR/IAQtAAEEQCAEKAIEEAYLIAQQBkEABSAECwubAgEDfyAALQAAQSBxRQRAAkAgASEDAkAgAiAAIgEoAhAiAAR/IAAFAn8gASABLQBKIgBBAWsgAHI6AEogASgCACIAQQhxBEAgASAAQSByNgIAQX8MAQsgAUIANwIEIAEgASgCLCIANgIcIAEgADYCFCABIAAgASgCMGo2AhBBAAsNASABKAIQCyABKAIUIgVrSwRAIAEgAyACIAEoAiQRAAAaDAILAn8gASwAS0F/SgRAIAIhAANAIAIgACIERQ0CGiADIARBAWsiAGotAABBCkcNAAsgASADIAQgASgCJBEAACAESQ0CIAMgBGohAyABKAIUIQUgAiAEawwBCyACCyEAIAUgAyAAEAcaIAEgASgCFCAAajYCFAsLCwvNBQEGfyAAKAIwIgNBhgJrIQYgACgCPCECIAMhAQNAIAAoAkQgAiAAKAJoIgRqayECIAEgBmogBE0EQCAAKAJIIgEgASADaiADEAcaAkAgAyAAKAJsIgFNBEAgACABIANrNgJsDAELIABCADcCbAsgACAAKAJoIANrIgE2AmggACAAKAJYIANrNgJYIAEgACgChC5JBEAgACABNgKELgsgAEH8gAEoAgARAwAgAiADaiECCwJAIAAoAgAiASgCBCIERQ0AIAAoAjwhBSAAIAIgBCACIARJGyICBH8gACgCSCAAKAJoaiAFaiEFIAEgBCACazYCBAJAAkACQAJAIAEoAhwiBCgCFEEBaw4CAQACCyAEQaABaiAFIAEoAgAgAkHcgAEoAgARCAAMAgsgASABKAIwIAUgASgCACACQcSAASgCABEEADYCMAwBCyAFIAEoAgAgAhAHGgsgASABKAIAIAJqNgIAIAEgASgCCCACajYCCCAAKAI8BSAFCyACaiICNgI8AkAgACgChC4iASACakEDSQ0AIAAoAmggAWshAQJAIAAoAnRBgQhPBEAgACAAIAAoAkggAWoiAi0AACACLQABIAAoAnwRAAA2AlQMAQsgAUUNACAAIAFBAWsgACgChAERAgAaCyAAKAKELiAAKAI8IgJBAUZrIgRFDQAgACABIAQgACgCgAERBQAgACAAKAKELiAEazYChC4gACgCPCECCyACQYUCSw0AIAAoAgAoAgRFDQAgACgCMCEBDAELCwJAIAAoAkQiAiAAKAJAIgNNDQAgAAJ/IAAoAjwgACgCaGoiASADSwRAIAAoAkggAWpBACACIAFrIgNBggIgA0GCAkkbIgMQGSABIANqDAELIAFBggJqIgEgA00NASAAKAJIIANqQQAgAiADayICIAEgA2siAyACIANJGyIDEBkgACgCQCADags2AkALC50CAQF/AkAgAAJ/IAAoAqAuIgFBwABGBEAgACgCBCAAKAIQaiAAKQOYLjcAACAAQgA3A5guIAAgACgCEEEIajYCEEEADAELIAFBIE4EQCAAKAIEIAAoAhBqIAApA5guPgAAIAAgAEGcLmo1AgA3A5guIAAgACgCEEEEajYCECAAIAAoAqAuQSBrIgE2AqAuCyABQRBOBEAgACgCBCAAKAIQaiAAKQOYLj0AACAAIAAoAhBBAmo2AhAgACAAKQOYLkIQiDcDmC4gACAAKAKgLkEQayIBNgKgLgsgAUEISA0BIAAgACgCECIBQQFqNgIQIAEgACgCBGogACkDmC48AAAgACAAKQOYLkIIiDcDmC4gACgCoC5BCGsLNgKgLgsLEAAgACgCCBAGIABBADYCCAvwAQECf0F/IQECQC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UUNAQsgACgCNBAcIABBADYCNCAALQAFRQ0BCyAALQAAQQRxRQ0BCyAAKAI4EBAgAEEANgI4IAAtAAVFDQELIAAtAABBgAFxRQ0BCyAAKAJUIgEEfyABQQAgARAiEBkgACgCVAVBAAsQBiAAQQA2AlQLC9wMAgl/AX4jAEFAaiIGJAACQAJAAkACQAJAIAEoAjBBABAjIgVBAkZBACABKAI4QQAQIyIEQQFGGw0AIAVBAUZBACAEQQJGGw0AIAVBAkciAw0BIARBAkcNAQsgASABLwEMQYAQcjsBDEEAIQMMAQsgASABLwEMQf/vA3E7AQxBACEFIANFBEBB9eABIAEoAjAgAEEIahBpIgVFDQILIAJBgAJxBEAgBSEDDAELIARBAkcEQCAFIQMMAQtB9cYBIAEoAjggAEEIahBpIgNFBEAgBRAcDAILIAMgBTYCAAsgASABLwEMQf7/A3EgAS8BUiIFQQBHcjsBDAJAAkACQAJAAn8CQAJAIAEpAyhC/v///w9WDQAgASkDIEL+////D1YNACACQYAEcUUNASABKQNIQv////8PVA0BCyAFQYECa0H//wNxQQNJIQdBAQwBCyAFQYECa0H//wNxIQQgAkGACnFBgApHDQEgBEEDSSEHQQALIQkgBkIcEBciBEUEQCAAQQhqIgAEQCAAQQA2AgQgAEEONgIACyADEBwMBQsgAkGACHEhBQJAAkAgAkGAAnEEQAJAIAUNACABKQMgQv////8PVg0AIAEpAyhCgICAgBBUDQMLIAQgASkDKBAYIAEpAyAhDAwBCwJAAkACQCAFDQAgASkDIEL/////D1YNACABKQMoIgxC/////w9WDQEgASkDSEKAgICAEFQNBAsgASkDKCIMQv////8PVA0BCyAEIAwQGAsgASkDICIMQv////8PWgRAIAQgDBAYCyABKQNIIgxC/////w9UDQELIAQgDBAYCyAELQAARQRAIABBCGoiAARAIABBADYCBCAAQRQ2AgALIAQQCCADEBwMBQtBASEKQQEgBC0AAAR+IAQpAxAFQgALp0H//wNxIAYQRyEFIAQQCCAFIAM2AgAgBw0BDAILIAMhBSAEQQJLDQELIAZCBxAXIgRF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IGIBlNDQEgBygCjEdFDQEgB0HR/gA2AgQgAEG5DDYCGAsgASECIAshBQwFCwJAIA5FBEAgDCARIAZraiEDDAELIAYgDk0EQCAMIA4gBmtqIQMMAQsgDCARIAYgDmsiBmtqIQMgBSAGTQ0AIAUgBmshBQJAAkAgASADTSABIA8gAWusIhogBq0iGyAaIBtUGyIapyIGaiICIANLcQ0AIAMgBmogAUsgASADT3ENACABIAMgBhAHGiACIQEMAQsgASADIAMgAWsiASABQR91IgFqIAFzIgIQByACaiEBIBogAq0iHn0iHFANACACIANqIQIDQAJAIBwgHiAcIB5UGyIbQiBUBEAgGyEaDAELIBsiGkIgfSIgQgWIQgF8QgODIh9QRQRAA0AgASACKQAANwAAIAEgAikAGDcAGCABIAIpABA3ABAgASACKQAINwAIIBpCIH0hGiACQSBqIQIgAUEgaiEBIB9CAX0iH0IAUg0ACwsgIELgAFQNAANAIAEgAikAADcAACABIAIpABg3ABggASACKQAQNwAQIAEgAikACDcACCABIAIpADg3ADggASACKQAwNwAwIAEgAikAKDcAKCABIAIpACA3ACAgASACKQBYNwBYIAEgAikAUDcAUCABIAIpAEg3AEggASACKQBANwBAIAEgAikAYDcAYCABIAIpAGg3AGggASACKQBwNwBwIAEgAikAeDcAeCACQYABaiECIAFBgAFqIQEgGkKAAX0iGkIfVg0ACwsgGkIQWgRAIAEgAikAADcAACABIAIpAAg3AAggGkIQfSEaIAJBEGohAiABQRBqIQELIBpCCFoEQCABIAIpAAA3AAAgGkIIfSEaIAJBCGohAiABQQhqIQELIBpCBFoEQCABIAIoAAA2AAAgGkIEfSEaIAJBBGohAiABQQRqIQELIBpCAloEQCABIAIvAAA7AAAgGkICfSEaIAJBAmohAiABQQJqIQELIBwgG30hHCAaUEUEQCABIAItAAA6AAAgAkEBaiECIAFBAWohAQsgHEIAUg0ACwsgDiEGIAwhAwsgBSAGSwRAAkACQCABIANNIAEgDyABa6wiGiAGrSIbIBogG1QbIhqnIglqIgIgA0txDQAgAyAJaiABSyABIANPcQ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EDQAJAIBwgHiAcIB5UGyIbQiBUBEAgGyEaDAELIBsiGkIgfSIgQgWIQgF8QgODIh9QRQRAA0AgAiABKQAANwAAIAIgASkAGDcAGCACIAEpABA3ABAgAiABKQAINwAIIBpCIH0hGiABQSBqIQEgAkEgaiECIB9CAX0iH0IAUg0ACwsgIELgAFQNAANAIAIgASkAADcAACACIAEpABg3ABggAiABKQAQNwAQIAIgASkACDcACCACIAEpADg3ADggAiABKQAwNwAwIAIgASkAKDcAKCACIAEpACA3ACAgAiABKQBYNwBYIAIgASkAUDcAUCACIAEpAEg3AEggAiABKQBANwBAIAIgASkAYDcAYCACIAEpAGg3AGggAiABKQBwNwBwIAIgASkAeDcAeCABQYABaiEBIAJBgAFqIQIgGkKAAX0iGkIfVg0ACwsgGkIQWgRAIAIgASkAADcAACACIAEpAAg3AAggGkIQfSEaIAJBEGohAiABQRBqIQELIBpCCFoEQCACIAEpAAA3AAAgGkIIfSEaIAJBCGohAiABQQhqIQELIBpCBFoEQCACIAEoAAA2AAAgGkIEfSEaIAJBBGohAiABQQRqIQELIBpCAloEQCACIAEvAAA7AAAgGkICfSEaIAJBAmohAiABQQJqIQELIBwgG30hHCAaUEUEQCACIAEtAAA6AAAgAkEBaiECIAFBAWohAQsgHFBFDQALDAILAkAgASADTSABIA8gAWusIhogBa0iGyAaIBtUGyIapyIEaiICIANLcQ0AIAMgBGogAUsgASADT3ENACABIAMgBBAHGgwCCyABIAMgAyABayIBIAFBH3UiAWogAXMiARAHIAFqIQIgGiABrSIefSIcUA0BIAEgA2ohAQNAAkAgHCAeIBwgHlQbIhtCIFQEQCAbIRoMAQsgGyIaQiB9IiBCBYhCAXxCA4MiH1BFBEADQCACIAEpAAA3AAAgAiABKQAYNwAYIAIgASkAEDcAECACIAEpAAg3AAggGkIgfSEaIAFBIGohASACQSBqIQIgH0IBfSIfQgBSDQALCyAgQuAAVA0AA0AgAiABKQAANwAAIAIgASkAGDcAGCACIAEpABA3ABAgAiABKQAINwAIIAIgASkAODcAOCACIAEpADA3ADAgAiABKQAoNwAoIAIgASkAIDcAICACIAEpAFg3AFggAiABKQBQNwBQIAIgASkASDcASCACIAEpAEA3AEAgAiABKQBgNwBgIAIgASkAaDcAaCACIAEpAHA3AHAgAiABKQB4NwB4IAFBgAFqIQEgAkGAAWohAiAaQoABfSIaQh9WDQALCyAaQhBaBEAgAiABKQAANwAAIAIgASkACDcACCAaQhB9IRogAkEQaiECIAFBEGohAQsgGkIIWgRAIAIgASkAADcAACAaQgh9IRogAkEIaiECIAFBCGohAQsgGkIEWgRAIAIgASgAADYAACAaQgR9IRogAkEEaiECIAFBBGohAQsgGkICWgRAIAIgAS8AADsAACAaQgJ9IRogAkECaiECIAFBAmohAQsgHCAbfSEcIBpQRQRAIAIgAS0AADoAACACQQFqIQIgAUEBaiEBCyAcUEUNAAsMAQsCQAJAIBYEQAJAIAQgBUkEQCAHKAKYRyAESw0BCyABIARrIQMCQEEAIARrIgVBf0ogDyABa6wiGiAbIBogG1QbIhqnIgIgBUpxDQAgBUEBSCACIANqIAFLcQ0AIAEgAyACEAcgAmohAgwFCyABIAMgBCAEQR91IgFqIAFzIgEQByABaiECIBogAa0iHn0iHFANBCABIANqIQEDQAJAIBwgHiAcIB5UGyIbQiBUBEAgGyEaDAELIBsiGkIgfSIgQgWIQgF8QgODIh9QRQRAA0AgAiABKQAANwAAIAIgASkAGDcAGCACIAEpABA3ABAgAiABKQAINwAIIBpCIH0hGiABQSBqIQEgAkEgaiECIB9CAX0iH0IAUg0ACwsgIELgAFQNAANAIAIgASkAADcAACACIAEpABg3ABggAiABKQAQNwAQIAIgASkACDcACCACIAEpADg3ADggAiABKQAwNwAwIAIgASkAKDcAKCACIAEpACA3ACAgAiABKQBYNwBYIAIgASkAUDcAUCACIAEpAEg3AEggAiABKQBANwBAIAIgASkAYDcAYCACIAEpAGg3AGggAiABKQBwNwBwIAIgASkAeDcAeCABQYABaiEBIAJBgAFqIQIgGkKAAX0iGkIfVg0ACwsgGkIQWgRAI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ohASAFIQMLAkACQCAGQRdNBEAgA0UNASADQQFrIQUgA0EHcSIEBEADQCABIAItAAA6AAAgA0EBayEDIAFBAWohASACQQFqIQIgBEEBayIEDQALCyAFQQdJDQEDQCABIAItAAA6AAAgASACLQABOgABIAEgAi0AAjoAAiABIAItAAM6AAMgASACLQAEOgAEIAEgAi0ABToABSABIAItAAY6AAYgASACLQAHOgAHIAFBCGohASACQQhqIQIgA0EIayIDDQALDAELIAMNAQsgASECDAELIAEgBCADED8hAgsgCyEFDAELIAEgAy0AAjoAACABQQFqIQILIAUgFE8NACACIBNJDQELCyAAIAI2AgwgACAFIAhBA3ZrIgE2AgAgACATIAJrQYMCajYCECAAIBQgAWtBDmo2AgQgByAIQQdxIgA2AogBIAcgHUJ/IACthkJ/hYM+AoQBC+cFAQR/IAMgAiACIANLGyEEIAAgAWshAgJAIABBB3FFDQAgBEUNACAAIAItAAA6AAAgA0EBayEGIAJBAWohAiAAQQFqIgdBB3FBACAEQQFrIgUbRQRAIAchACAFIQQgBiEDDAELIAAgAi0AADoAASADQQJrIQYgBEECayEFIAJBAWohAgJAIABBAmoiB0EHcUUNACAFRQ0AIAAgAi0AADoAAiADQQNrIQYgBEEDayEFIAJBAWohAgJAIABBA2oiB0EHcUUNACAFRQ0AIAAgAi0AADoAAyADQQRrIQYgBEEEayEFIAJBAWohAgJAIABBBGoiB0EHcUUNACAFRQ0AIAAgAi0AADoABCADQQVrIQYgBEEFayEFIAJBAWohAgJAIABBBWoiB0EHcUUNACAFRQ0AIAAgAi0AADoABSADQQZrIQYgBEEGayEFIAJBAWohAgJAIABBBmoiB0EHcUUNACAFRQ0AIAAgAi0AADoABiADQQdrIQYgBEEHayEFIAJBAWohAgJAIABBB2oiB0EHcUUNACAFRQ0AIAAgAi0AADoAByADQQhrIQMgBEEIayEEIABBCGohACACQQFqIQIMBgsgByEAIAUhBCAGIQMMBQsgByEAIAUhBCAGIQMMBAsgByEAIAUhBCAGIQMMAwsgByEAIAUhBCAGIQMMAgs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BEEIakHA8ABBkAEQBxogBCAANgI0IAQgADYCHCAEQX4gAGsiA0H/////ByADQf////8HSRsiBjYCOCAEIAAgBmoiADYCJCAEIAA2AhggBEEIaiEAIwBB0AFrIgMkACADIAI2AswBIANBoAFqQQBBKBAZIAMgAygCzAE2AsgBAkBBACABIANByAFqIANB0ABqIANBoAFqEEpBAEgNACAAKAJMQQBOIQcgACgCACECIAAsAEpBAEwEQCAAIAJBX3E2AgALIAJBIHEhCAJ/IAAoAjAEQCAAIAEgA0HIAWogA0HQAGogA0GgAWoQSgwBCyAAQdAANgIwIAAgA0HQAGo2AhAgACADNgIcIAAgAzYCFCAAKAIsIQIgACADNgIsIAAgASADQcgBaiADQdAAaiADQaABahBKIAJFDQAaIABBAEEAIAAoAiQRAAAaIABBADYCMCAAIAI2AiwgAEEANgIcIABBADYCECAAKAIUGiAAQQA2AhRBAAsaIAAgACgCACAIcjYCACAHRQ0ACyADQdABaiQAIAYEQCAEKAIcIgAgACAEKAIYRmtBADoAAAsgBEGgAWokACAFQRBqJAALUwEDfwJAIAAoAgAsAABBMGtBCk8NAANAIAAoAgAiAiwAACEDIAAgAkEBajYCACABIANqQTBrIQEgAiwAAUEwa0EKTw0BIAFBCmwhAQwACwALIAELuwIAAkAgAUEUSw0AAkACQAJAAkACQAJAAkACQAJAAkAgAUEJaw4KAAECAwQFBgcICQoLIAIgAigCACIBQQRqNgIAIAAgASgCADYCAA8LIAIgAigCACIBQQRqNgIAIAAgATQCADcDAA8LIAIgAigCACIBQQRqNgIAIAAgATUCADcDAA8LIAIgAigCAEEHakF4cSIBQQhqNgIAIAAgASkDADcDAA8LIAIgAigCACIBQQRqNgIAIAAgATIBADcDAA8LIAIgAigCACIBQQRqNgIAIAAgATMBADcDAA8LIAIgAigCACIBQQRqNgIAIAAgATAAADcDAA8LIAIgAigCACIBQQRqNgIAIAAgATEAADcDAA8LIAIgAigCAEEHakF4cSIBQQhqNgIAIAAgASsDADkDAA8LIAAgAkEAEQcACwubAgAgAE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gBSgCDCABajYCDCAGIAYoAgggAWo2AgggBSAFKAIUIAFqNgIUIAUgBSgCECABazYCECAGIAYoAhAgAWsiATYCECABDQAgBiAGKAIENgIIC0EAIQRBACEJIAMoAhBFDQAMCgsgAygCHCgCJCEGIAMgAygCGCIBQQFqNgIYIAEgBmotAAAhASADIARBAWo2AhAgAygCBCAEaiABOgAAIAEEQCADKAIQIQQMAQsLIAMoAhwoAixFDQAgAygCECIGIAlNDQAgBQJ/IAUoAjAhBEEAIAMoAgQgCWoiAUUNABogBCABIAYgCWtB1IABKAIAEQAACzYCMAsgA0HnADYCIAsCQCADKAIcKAIsBEAgAygCDCADKAIQIgFBAmpJBH8gBRAKIAMoAhANAkEABSABCyADKAIEaiAFKAIwOwAAIAMgAygCEEECajYCECADQaABakHkgAEoAgARAQAaCyADQfEANgIgIAUQCiADKAIQRQ0BDAcLDAYLIAUoAgQNAQsgAygCPA0AIApFDQEgAygCIEGaBUYNAQsCfyADKAKIASIBRQRAIAMgChCFAQwBCwJAAkACQCADKAKMAUECaw4CAAECCwJ/AkADQAJAAkAgAygCPA0AIAMQLyADKAI8DQAgCg0BQQAMBAsgAygCSCADKAJoai0AACEEIAMgAygC8C0iAUEBajYC8C0gASADKALsLWpBADoAACADIAMoAvAtIgFBAWo2AvAtIAEgAygC7C1qQQA6AAAgAyADKALwLSIBQQFqNgLwLSABIAMoAuwtaiAEOgAAIAMgBEECdGoiASABLwHkAUEBajsB5AEgAyADKAI8QQFrNgI8IAMgAygCaEEBaiIBNgJoIAMoAvAtIAMoAvQtRw0BQQAhBCADIAMoAlgiBkEATgR/IAMoAkggBmoFQQALIAEgBmtBABAPIAMgAygCaDYCWCADKAIAEAogAygCACgCEA0BDAILCyADQQA2AoQuIApBBEYEQCADIAMoAlgiAUEATgR/IAMoAkggAWoFQQALIAMoAmggAWtBARAPIAMgAygCaDYCWCADKAIAEApBA0ECIAMoAgAoAhAbDAILIAMoAvAtBEBBACEEIAMgAygCWCIBQQBOBH8gAygCSC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FqBUEACyAEIAFrQQAQDyADIAMoAmg2AlggAygCABAKIAMoAgAoAhANAQwCCwsgA0EANgKELiAKQQRGBEAgAyADKAJYIgFBAE4EfyADKAJIIAFqBUEACyADKAJoIAFrQQEQDyADIAMoAmg2AlggAygCABAKQQNBAiADKAIAKAIQGwwCCyADKALwLQRAQQAhCCADIAMoAlgiAUEATgR/IAMoAkggAWoFQQALIAMoAmggAWtBABAPIAMgAygCaDYCWCADKAIAEAogAygCACgCEEUNAQtBASEICyAICwwBCyADIAogAUEMbEG42ABqKAIAEQIACyIBQX5xQQJGBEAgA0GaBTYCIAsgAUF9cUUEQEEAIQQgBSgCEA0CDAQLIAFBAUcNAAJAAkACQCAKQQFrDgUAAQEBAgELIAMpA5guISICfwJ+IAMoAqAuIgFBA2oiCUE/TQRAQgIgAa2GICKEDAELIAFBwABGBEAgAygCBCADKAIQaiAiNwAAIAMgAygCEEEIajYCEEICISJBCgwCCyADKAIEIAMoAhBqQgIgAa2GICKENwAAIAMgAygCEEEIajYCECABQT1rIQlCAkHAACABa62ICyEiIAlBB2ogCUE5SQ0AGiADKAIEIAMoAhBqICI3AAAgAyADKAIQQQhqNgIQQgAhIiAJQTlrCyEBIAMgIjcDmC4gAyABNgKgLiADEDAMAQsgA0EAQQBBABA5IApBA0cNACADKAJQQQBBgIAIEBkgAygCPA0AIANBADYChC4gA0EANgJYIANBADYCaAsgBRAKIAUoAhANAAwDC0EAIQQgCkEERw0AAkACfwJAAkAgAygCFEEBaw4CAQADCyAFIANBoAFqQeCAASgCABEBACIBNgIwIAMoAgQgAygCEGogATYAACADIAMoAhBBBGoiATYCECADKAIEIAFqIQQgBSgCCAwBCyADKAIEIAMoAhBqIQQgBSgCMCIBQRh0IAFBCHRBgID8B3FyIAFBCHZBgP4DcSABQRh2cnILIQEgBCABNgAAIAMgAygCEEEEajYCEAsgBRAKIAMoAhQiAUEBTgRAIANBACABazYCFAsgAygCEEUhBAsgBAwCCyAFQezAACgCADYCGEF7DAELIANBfzY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AEoAugtIgRBAnQ2AgwCQAJAIAEoAkhFDQAgASgCTEUNACABKAJQRQ0AIAMNAQsgAUGaBTYCICACQejAACgCADYCGCACEIQBGkF8DAILIAFBADYCjAEgASAFNgKIASABQgA3AyggASADIARqNgLsLSABIARBA2xBA2s2AvQtQX4hAwJAIAJFDQAgAigCIEUNACACKAIkRQ0AIAIoAhwiAUUNACABKAIAIAJHDQACQAJAIAEoAiAiBEE5aw45AQICAgICAgICAgICAQICAgECAgICAgICAgICAgICAgICAgECAgICAgICAgICAgECAgICAgICAgIBAAsgBEGaBUYNACAEQSpHDQELIAJBAjYCLCACQQA2AgggAkIANwIUIAFBADYCECABIAEoAgQ2AgggASgCFCIDQX9MBEAgAUEAIANrIgM2AhQLIAFBOUEqIANBAkYbNgIgIAIgA0ECRgR/IAFBoAFqQeSAASgCABEBAAVBAQs2AjAgAUF+NgIkIAFBADYCoC4gAUIANwOYLiABQYgXakGg0wA2AgAgASABQcwVajYCgBcgAUH8FmpBjNMANgIAIAEgAUHYE2o2AvQWIAFB8BZqQfjSADYCACABIAFB5AFqNgLoFiABEIgBQQAhAwsgAw0AIAIoAhwiAiACKAIwQQF0NgJEQQAhAyACKAJQQQBBgIAIEBkgAiACKAKIASIEQQxsIgFBtNgAai8BADYClAEgAiABQbDYAGovAQA2ApABIAIgAUGy2ABqLwEANgJ4IAIgAUG22ABqLwEANgJ0QfiAASgCACEFQeyAASgCACEGQYCBASgCACEBIAJCADcCbCACQgA3AmQgAkEANgI8IAJBADYChC4gAkIANwJUIAJBKSABIARBCUYiARs2AnwgAkEqIAYgARs2AoABIAJBKyAFIAEbNgKEAQsgAwsFQXoLDAELAn9BekHrDC0AAEExRw0AGkF+IAJFDQAaIAJBADYCGCACKAIgIgNFBEAgAkEANgIoIAJBJzYCIEEnIQMLIAIoAiRFBEAgAkEoNgIkC0F8IAMgAigCKEEBQaDHABAoIgRFDQAaIAIgBDYCHCAEQQA2AjggBCACNgIAIARBtP4ANgIEIARBzIABKAIAEQ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wasmBinaryFile); - } - function getBinary(file) { - try { - if (file == wasmBinaryFile && wasmBinary) { - return new Uint8Array(wasmBinary); - } - var binary = tryParseAsDataURI(file); - if (binary) { - return binary; - } - if (readBinary) { - return readBinary(file); - } else { - throw "sync fetching of the wasm failed: you can preload it to Module['wasmBinary'] manually, or emcc.py will do that for you when generating HTML (but not JS)"; - } - } catch (err2) { - abort(err2); - } - } - function instantiateSync(file, info) { - var instance; - var module2; - var binary; - try { - binary = getBinary(file); - module2 = new WebAssembly.Module(binary); - instance = new WebAssembly.Instance(module2, info); - } catch (e) { - var str = e.toString(); - err("failed to compile wasm module: " + str); - if (str.includes("imported Memory") || str.includes("memory import")) { - err( - "Memory size incompatibility issues may be due to changing INITIAL_MEMORY at runtime to something too large. Use ALLOW_MEMORY_GROWTH to allow any size memory (and also make sure not to set INITIAL_MEMORY at runtime to something smaller than it was at compile time)." - ); - } - throw e; - } - return [instance, module2]; - } - function createWasm() { - var info = { a: asmLibraryArg }; - function receiveInstance(instance, module2) { - var exports3 = instance.exports; - Module["asm"] = exports3; - wasmMemory = Module["asm"]["g"]; - updateGlobalBufferAndViews(wasmMemory.buffer); - wasmTable = Module["asm"]["W"]; - addOnInit(Module["asm"]["h"]); - removeRunDependency(); - } - addRunDependency(); - if (Module["instantiateWasm"]) { - try { - var exports2 = Module["instantiateWasm"](info, receiveInstance); - return exports2; - } catch (e) { - err("Module.instantiateWasm callback failed with error: " + e); - return false; - } - } - var result = instantiateSync(wasmBinaryFile, info); - receiveInstance(result[0]); - return Module["asm"]; - } - function LE_HEAP_LOAD_F32(byteOffset) { - return HEAP_DATA_VIEW.getFloat32(byteOffset, true); - } - function LE_HEAP_LOAD_F64(byteOffset) { - return HEAP_DATA_VIEW.getFloat64(byteOffset, true); - } - function LE_HEAP_LOAD_I16(byteOffset) { - return HEAP_DATA_VIEW.getInt16(byteOffset, true); - } - function LE_HEAP_LOAD_I32(byteOffset) { - return HEAP_DATA_VIEW.getInt32(byteOffset, true); - } - function LE_HEAP_STORE_I32(byteOffset, value) { - HEAP_DATA_VIEW.setInt32(byteOffset, value, true); - } - function callRuntimeCallbacks(callbacks) { - while (callbacks.length > 0) { - var callback = callbacks.shift(); - if (typeof callback == "function") { - callback(Module); - continue; - } - var func = callback.func; - if (typeof func === "number") { - if (callback.arg === void 0) { - wasmTable.get(func)(); - } else { - wasmTable.get(func)(callback.arg); - } - } else { - func(callback.arg === void 0 ? null : callback.arg); - } - } - } - function _gmtime_r(time, tmPtr) { - var date = new Date(LE_HEAP_LOAD_I32((time >> 2) * 4) * 1e3); - LE_HEAP_STORE_I32((tmPtr >> 2) * 4, date.getUTCSeconds()); - LE_HEAP_STORE_I32((tmPtr + 4 >> 2) * 4, date.getUTCMinutes()); - LE_HEAP_STORE_I32((tmPtr + 8 >> 2) * 4, date.getUTCHours()); - LE_HEAP_STORE_I32((tmPtr + 12 >> 2) * 4, date.getUTCDate()); - LE_HEAP_STORE_I32((tmPtr + 16 >> 2) * 4, date.getUTCMonth()); - LE_HEAP_STORE_I32((tmPtr + 20 >> 2) * 4, date.getUTCFullYear() - 1900); - LE_HEAP_STORE_I32((tmPtr + 24 >> 2) * 4, date.getUTCDay()); - LE_HEAP_STORE_I32((tmPtr + 36 >> 2) * 4, 0); - LE_HEAP_STORE_I32((tmPtr + 32 >> 2) * 4, 0); - var start = Date.UTC(date.getUTCFullYear(), 0, 1, 0, 0, 0, 0); - var yday = (date.getTime() - start) / (1e3 * 60 * 60 * 24) | 0; - LE_HEAP_STORE_I32((tmPtr + 28 >> 2) * 4, yday); - if (!_gmtime_r.GMTString) - _gmtime_r.GMTString = allocateUTF8("GMT"); - LE_HEAP_STORE_I32((tmPtr + 40 >> 2) * 4, _gmtime_r.GMTString); - return tmPtr; - } - function ___gmtime_r(a0, a1) { - return _gmtime_r(a0, a1); - } - function _emscripten_memcpy_big(dest, src, num) { - HEAPU8.copyWithin(dest, src, src + num); - } - function emscripten_realloc_buffer(size) { - try { - wasmMemory.grow(size - buffer.byteLength + 65535 >>> 16); - updateGlobalBufferAndViews(wasmMemory.buffer); - return 1; - } catch (e) { - } - } - function _emscripten_resize_heap(requestedSize) { - var oldSize = HEAPU8.length; - requestedSize = requestedSize >>> 0; - var maxHeapSize = 2147483648; - if (requestedSize > maxHeapSize) { - return false; - } - for (var cutDown = 1; cutDown <= 4; cutDown *= 2) { - var overGrownHeapSize = oldSize * (1 + 0.2 / cutDown); - overGrownHeapSize = Math.min( - overGrownHeapSize, - requestedSize + 100663296 - ); - var newSize = Math.min( - maxHeapSize, - alignUp(Math.max(requestedSize, overGrownHeapSize), 65536) - ); - var replacement = emscripten_realloc_buffer(newSize); - if (replacement) { - return true; - } - } - return false; - } - function _setTempRet0(val) { - } - function _time(ptr) { - var ret = Date.now() / 1e3 | 0; - if (ptr) { - LE_HEAP_STORE_I32((ptr >> 2) * 4, ret); - } - return ret; - } - function _tzset() { - if (_tzset.called) - return; - _tzset.called = true; - var currentYear = new Date().getFullYear(); - var winter = new Date(currentYear, 0, 1); - var summer = new Date(currentYear, 6, 1); - var winterOffset = winter.getTimezoneOffset(); - var summerOffset = summer.getTimezoneOffset(); - var stdTimezoneOffset = Math.max(winterOffset, summerOffset); - LE_HEAP_STORE_I32((__get_timezone() >> 2) * 4, stdTimezoneOffset * 60); - LE_HEAP_STORE_I32( - (__get_daylight() >> 2) * 4, - Number(winterOffset != summerOffset) - ); - function extractZone(date) { - var match = date.toTimeString().match(/\(([A-Za-z ]+)\)$/); - return match ? match[1] : "GMT"; - } - var winterName = extractZone(winter); - var summerName = extractZone(summer); - var winterNamePtr = allocateUTF8(winterName); - var summerNamePtr = allocateUTF8(summerName); - if (summerOffset < winterOffset) { - LE_HEAP_STORE_I32((__get_tzname() >> 2) * 4, winterNamePtr); - LE_HEAP_STORE_I32((__get_tzname() + 4 >> 2) * 4, summerNamePtr); - } else { - LE_HEAP_STORE_I32((__get_tzname() >> 2) * 4, summerNamePtr); - LE_HEAP_STORE_I32((__get_tzname() + 4 >> 2) * 4, winterNamePtr); - } - } - function _timegm(tmPtr) { - _tzset(); - var time = Date.UTC( - LE_HEAP_LOAD_I32((tmPtr + 20 >> 2) * 4) + 1900, - LE_HEAP_LOAD_I32((tmPtr + 16 >> 2) * 4), - LE_HEAP_LOAD_I32((tmPtr + 12 >> 2) * 4), - LE_HEAP_LOAD_I32((tmPtr + 8 >> 2) * 4), - LE_HEAP_LOAD_I32((tmPtr + 4 >> 2) * 4), - LE_HEAP_LOAD_I32((tmPtr >> 2) * 4), - 0 - ); - var date = new Date(time); - LE_HEAP_STORE_I32((tmPtr + 24 >> 2) * 4, date.getUTCDay()); - var start = Date.UTC(date.getUTCFullYear(), 0, 1, 0, 0, 0, 0); - var yday = (date.getTime() - start) / (1e3 * 60 * 60 * 24) | 0; - LE_HEAP_STORE_I32((tmPtr + 28 >> 2) * 4, yday); - return date.getTime() / 1e3 | 0; - } - function intArrayFromBase64(s) { - { - var buf; - try { - buf = Buffer.from(s, "base64"); - } catch (_) { - buf = new Buffer(s, "base64"); - } - return new Uint8Array( - buf["buffer"], - buf["byteOffset"], - buf["byteLength"] - ); - } - } - function tryParseAsDataURI(filename) { - if (!isDataURI(filename)) { - return; - } - return intArrayFromBase64(filename.slice(dataURIPrefix.length)); - } - var asmLibraryArg = { - e: ___gmtime_r, - c: _emscripten_memcpy_big, - d: _emscripten_resize_heap, - a: _setTempRet0, - b: _time, - f: _timegm - }; - var asm = createWasm(); - Module["___wasm_call_ctors"] = asm["h"]; - Module["_zip_ext_count_symlinks"] = asm["i"]; - Module["_zip_file_get_external_attributes"] = asm["j"]; - Module["_zipstruct_statS"] = asm["k"]; - Module["_zipstruct_stat_size"] = asm["l"]; - Module["_zipstruct_stat_mtime"] = asm["m"]; - Module["_zipstruct_stat_crc"] = asm["n"]; - Module["_zipstruct_errorS"] = asm["o"]; - Module["_zipstruct_error_code_zip"] = asm["p"]; - Module["_zipstruct_stat_comp_size"] = asm["q"]; - Module["_zipstruct_stat_comp_method"] = asm["r"]; - Module["_zip_close"] = asm["s"]; - Module["_zip_delete"] = asm["t"]; - Module["_zip_dir_add"] = asm["u"]; - Module["_zip_discard"] = asm["v"]; - Module["_zip_error_init_with_code"] = asm["w"]; - Module["_zip_get_error"] = asm["x"]; - Module["_zip_file_get_error"] = asm["y"]; - Module["_zip_error_strerror"] = asm["z"]; - Module["_zip_fclose"] = asm["A"]; - Module["_zip_file_add"] = asm["B"]; - Module["_free"] = asm["C"]; - var _malloc = Module["_malloc"] = asm["D"]; - Module["_zip_source_error"] = asm["E"]; - Module["_zip_source_seek"] = asm["F"]; - Module["_zip_file_set_external_attributes"] = asm["G"]; - Module["_zip_file_set_mtime"] = asm["H"]; - Module["_zip_fopen_index"] = asm["I"]; - Module["_zip_fread"] = asm["J"]; - Module["_zip_get_name"] = asm["K"]; - Module["_zip_get_num_entries"] = asm["L"]; - Module["_zip_source_read"] = asm["M"]; - Module["_zip_name_locate"] = asm["N"]; - Module["_zip_open_from_source"] = asm["O"]; - Module["_zip_set_file_compression"] = asm["P"]; - Module["_zip_source_buffer"] = asm["Q"]; - Module["_zip_source_buffer_create"] = asm["R"]; - Module["_zip_source_close"] = asm["S"]; - Module["_zip_source_free"] = asm["T"]; - Module["_zip_source_keep"] = asm["U"]; - Module["_zip_source_open"] = asm["V"]; - Module["_zip_source_tell"] = asm["X"]; - Module["_zip_stat_index"] = asm["Y"]; - var __get_tzname = Module["__get_tzname"] = asm["Z"]; - var __get_daylight = Module["__get_daylight"] = asm["_"]; - var __get_timezone = Module["__get_timezone"] = asm["$"]; - var stackSave = Module["stackSave"] = asm["aa"]; - var stackRestore = Module["stackRestore"] = asm["ba"]; - var stackAlloc = Module["stackAlloc"] = asm["ca"]; - Module["cwrap"] = cwrap; - Module["getValue"] = getValue; - var calledRun; - dependenciesFulfilled = function runCaller() { - if (!calledRun) - run(); - if (!calledRun) - dependenciesFulfilled = runCaller; - }; - function run(args) { - if (runDependencies > 0) { - return; - } - preRun(); - if (runDependencies > 0) { - return; - } - function doRun() { - if (calledRun) - return; - calledRun = true; - Module["calledRun"] = true; - if (ABORT) - return; - initRuntime(); - readyPromiseResolve(Module); - if (Module["onRuntimeInitialized"]) - Module["onRuntimeInitialized"](); - postRun(); - } - if (Module["setStatus"]) { - Module["setStatus"]("Running..."); - setTimeout(function() { - setTimeout(function() { - Module["setStatus"](""); - }, 1); - doRun(); - }, 1); - } else { - doRun(); - } - } - Module["run"] = run; - if (Module["preInit"]) { - if (typeof Module["preInit"] == "function") - Module["preInit"] = [Module["preInit"]]; - while (Module["preInit"].length > 0) { - Module["preInit"].pop()(); - } - } - run(); - return createModule2; - }; -}(); -module.exports = createModule; -}(libzipSync)); - -const createModule = libzipSync.exports; - -const number64 = [ - `number`, - `number` -]; -var Errors = /* @__PURE__ */ ((Errors2) => { - Errors2[Errors2["ZIP_ER_OK"] = 0] = "ZIP_ER_OK"; - Errors2[Errors2["ZIP_ER_MULTIDISK"] = 1] = "ZIP_ER_MULTIDISK"; - Errors2[Errors2["ZIP_ER_RENAME"] = 2] = "ZIP_ER_RENAME"; - Errors2[Errors2["ZIP_ER_CLOSE"] = 3] = "ZIP_ER_CLOSE"; - Errors2[Errors2["ZIP_ER_SEEK"] = 4] = "ZIP_ER_SEEK"; - Errors2[Errors2["ZIP_ER_READ"] = 5] = "ZIP_ER_READ"; - Errors2[Errors2["ZIP_ER_WRITE"] = 6] = "ZIP_ER_WRITE"; - Errors2[Errors2["ZIP_ER_CRC"] = 7] = "ZIP_ER_CRC"; - Errors2[Errors2["ZIP_ER_ZIPCLOSED"] = 8] = "ZIP_ER_ZIPCLOSED"; - Errors2[Errors2["ZIP_ER_NOENT"] = 9] = "ZIP_ER_NOENT"; - Errors2[Errors2["ZIP_ER_EXISTS"] = 10] = "ZIP_ER_EXISTS"; - Errors2[Errors2["ZIP_ER_OPEN"] = 11] = "ZIP_ER_OPEN"; - Errors2[Errors2["ZIP_ER_TMPOPEN"] = 12] = "ZIP_ER_TMPOPEN"; - Errors2[Errors2["ZIP_ER_ZLIB"] = 13] = "ZIP_ER_ZLIB"; - Errors2[Errors2["ZIP_ER_MEMORY"] = 14] = "ZIP_ER_MEMORY"; - Errors2[Errors2["ZIP_ER_CHANGED"] = 15] = "ZIP_ER_CHANGED"; - Errors2[Errors2["ZIP_ER_COMPNOTSUPP"] = 16] = "ZIP_ER_COMPNOTSUPP"; - Errors2[Errors2["ZIP_ER_EOF"] = 17] = "ZIP_ER_EOF"; - Errors2[Errors2["ZIP_ER_INVAL"] = 18] = "ZIP_ER_INVAL"; - Errors2[Errors2["ZIP_ER_NOZIP"] = 19] = "ZIP_ER_NOZIP"; - Errors2[Errors2["ZIP_ER_INTERNAL"] = 20] = "ZIP_ER_INTERNAL"; - Errors2[Errors2["ZIP_ER_INCONS"] = 21] = "ZIP_ER_INCONS"; - Errors2[Errors2["ZIP_ER_REMOVE"] = 22] = "ZIP_ER_REMOVE"; - Errors2[Errors2["ZIP_ER_DELETED"] = 23] = "ZIP_ER_DELETED"; - Errors2[Errors2["ZIP_ER_ENCRNOTSUPP"] = 24] = "ZIP_ER_ENCRNOTSUPP"; - Errors2[Errors2["ZIP_ER_RDONLY"] = 25] = "ZIP_ER_RDONLY"; - Errors2[Errors2["ZIP_ER_NOPASSWD"] = 26] = "ZIP_ER_NOPASSWD"; - Errors2[Errors2["ZIP_ER_WRONGPASSWD"] = 27] = "ZIP_ER_WRONGPASSWD"; - Errors2[Errors2["ZIP_ER_OPNOTSUPP"] = 28] = "ZIP_ER_OPNOTSUPP"; - Errors2[Errors2["ZIP_ER_INUSE"] = 29] = "ZIP_ER_INUSE"; - Errors2[Errors2["ZIP_ER_TELL"] = 30] = "ZIP_ER_TELL"; - Errors2[Errors2["ZIP_ER_COMPRESSED_DATA"] = 31] = "ZIP_ER_COMPRESSED_DATA"; - return Errors2; -})(Errors || {}); -const makeInterface = (emZip) => ({ - get HEAPU8() { - return emZip.HEAPU8; - }, - errors: Errors, - SEEK_SET: 0, - SEEK_CUR: 1, - SEEK_END: 2, - ZIP_CHECKCONS: 4, - ZIP_EXCL: 2, - ZIP_RDONLY: 16, - ZIP_FL_OVERWRITE: 8192, - ZIP_FL_COMPRESSED: 4, - ZIP_OPSYS_DOS: 0, - ZIP_OPSYS_AMIGA: 1, - ZIP_OPSYS_OPENVMS: 2, - ZIP_OPSYS_UNIX: 3, - ZIP_OPSYS_VM_CMS: 4, - ZIP_OPSYS_ATARI_ST: 5, - ZIP_OPSYS_OS_2: 6, - ZIP_OPSYS_MACINTOSH: 7, - ZIP_OPSYS_Z_SYSTEM: 8, - ZIP_OPSYS_CPM: 9, - ZIP_OPSYS_WINDOWS_NTFS: 10, - ZIP_OPSYS_MVS: 11, - ZIP_OPSYS_VSE: 12, - ZIP_OPSYS_ACORN_RISC: 13, - ZIP_OPSYS_VFAT: 14, - ZIP_OPSYS_ALTERNATE_MVS: 15, - ZIP_OPSYS_BEOS: 16, - ZIP_OPSYS_TANDEM: 17, - ZIP_OPSYS_OS_400: 18, - ZIP_OPSYS_OS_X: 19, - ZIP_CM_DEFAULT: -1, - ZIP_CM_STORE: 0, - ZIP_CM_DEFLATE: 8, - uint08S: emZip._malloc(1), - uint32S: emZip._malloc(4), - malloc: emZip._malloc, - free: emZip._free, - getValue: emZip.getValue, - openFromSource: emZip.cwrap(`zip_open_from_source`, `number`, [`number`, `number`, `number`]), - close: emZip.cwrap(`zip_close`, `number`, [`number`]), - discard: emZip.cwrap(`zip_discard`, null, [`number`]), - getError: emZip.cwrap(`zip_get_error`, `number`, [`number`]), - getName: emZip.cwrap(`zip_get_name`, `string`, [`number`, `number`, `number`]), - getNumEntries: emZip.cwrap(`zip_get_num_entries`, `number`, [`number`, `number`]), - delete: emZip.cwrap(`zip_delete`, `number`, [`number`, `number`]), - statIndex: emZip.cwrap(`zip_stat_index`, `number`, [`number`, ...number64, `number`, `number`]), - fopenIndex: emZip.cwrap(`zip_fopen_index`, `number`, [`number`, ...number64, `number`]), - fread: emZip.cwrap(`zip_fread`, `number`, [`number`, `number`, `number`, `number`]), - fclose: emZip.cwrap(`zip_fclose`, `number`, [`number`]), - dir: { - add: emZip.cwrap(`zip_dir_add`, `number`, [`number`, `string`]) - }, - file: { - add: emZip.cwrap(`zip_file_add`, `number`, [`number`, `string`, `number`, `number`]), - getError: emZip.cwrap(`zip_file_get_error`, `number`, [`number`]), - getExternalAttributes: emZip.cwrap(`zip_file_get_external_attributes`, `number`, [`number`, ...number64, `number`, `number`, `number`]), - setExternalAttributes: emZip.cwrap(`zip_file_set_external_attributes`, `number`, [`number`, ...number64, `number`, `number`, `number`]), - setMtime: emZip.cwrap(`zip_file_set_mtime`, `number`, [`number`, ...number64, `number`, `number`]), - setCompression: emZip.cwrap(`zip_set_file_compression`, `number`, [`number`, ...number64, `number`, `number`]) - }, - ext: { - countSymlinks: emZip.cwrap(`zip_ext_count_symlinks`, `number`, [`number`]) - }, - error: { - initWithCode: emZip.cwrap(`zip_error_init_with_code`, null, [`number`, `number`]), - strerror: emZip.cwrap(`zip_error_strerror`, `string`, [`number`]) - }, - name: { - locate: emZip.cwrap(`zip_name_locate`, `number`, [`number`, `string`, `number`]) - }, - source: { - fromUnattachedBuffer: emZip.cwrap(`zip_source_buffer_create`, `number`, [`number`, ...number64, `number`, `number`]), - fromBuffer: emZip.cwrap(`zip_source_buffer`, `number`, [`number`, `number`, ...number64, `number`]), - free: emZip.cwrap(`zip_source_free`, null, [`number`]), - keep: emZip.cwrap(`zip_source_keep`, null, [`number`]), - open: emZip.cwrap(`zip_source_open`, `number`, [`number`]), - close: emZip.cwrap(`zip_source_close`, `number`, [`number`]), - seek: emZip.cwrap(`zip_source_seek`, `number`, [`number`, ...number64, `number`]), - tell: emZip.cwrap(`zip_source_tell`, `number`, [`number`]), - read: emZip.cwrap(`zip_source_read`, `number`, [`number`, `number`, `number`]), - error: emZip.cwrap(`zip_source_error`, `number`, [`number`]) - }, - struct: { - statS: emZip.cwrap(`zipstruct_statS`, `number`, []), - statSize: emZip.cwrap(`zipstruct_stat_size`, `number`, [`number`]), - statCompSize: emZip.cwrap(`zipstruct_stat_comp_size`, `number`, [`number`]), - statCompMethod: emZip.cwrap(`zipstruct_stat_comp_method`, `number`, [`number`]), - statMtime: emZip.cwrap(`zipstruct_stat_mtime`, `number`, [`number`]), - statCrc: emZip.cwrap(`zipstruct_stat_crc`, `number`, [`number`]), - errorS: emZip.cwrap(`zipstruct_errorS`, `number`, []), - errorCodeZip: emZip.cwrap(`zipstruct_error_code_zip`, `number`, [`number`]) - } -}); - -function getArchivePart(path, extension) { - let idx = path.indexOf(extension); - if (idx <= 0) - return null; - let nextCharIdx = idx; - while (idx >= 0) { - nextCharIdx = idx + extension.length; - if (path[nextCharIdx] === ppath.sep) - break; - if (path[idx - 1] === ppath.sep) - return null; - idx = path.indexOf(extension, nextCharIdx); - } - if (path.length > nextCharIdx && path[nextCharIdx] !== ppath.sep) - return null; - return path.slice(0, nextCharIdx); -} -class ZipOpenFS extends MountFS { - static async openPromise(fn, opts) { - const zipOpenFs = new ZipOpenFS(opts); - try { - return await fn(zipOpenFs); - } finally { - zipOpenFs.saveAndClose(); - } - } - constructor(opts = {}) { - const fileExtensions = opts.fileExtensions; - const readOnlyArchives = opts.readOnlyArchives; - const getMountPoint = typeof fileExtensions === `undefined` ? (path) => getArchivePart(path, `.zip`) : (path) => { - for (const extension of fileExtensions) { - const result = getArchivePart(path, extension); - if (result) { - return result; - } - } - return null; - }; - const factorySync = (baseFs, p) => { - return new ZipFS(p, { - baseFs, - readOnly: readOnlyArchives, - stats: baseFs.statSync(p) - }); - }; - const factoryPromise = async (baseFs, p) => { - const zipOptions = { - baseFs, - readOnly: readOnlyArchives, - stats: await baseFs.statPromise(p) - }; - return () => { - return new ZipFS(p, zipOptions); - }; - }; - super({ - ...opts, - factorySync, - factoryPromise, - getMountPoint - }); - } -} - -const DEFAULT_COMPRESSION_LEVEL = `mixed`; -function toUnixTimestamp(time) { - if (typeof time === `string` && String(+time) === time) - return +time; - if (typeof time === `number` && Number.isFinite(time)) { - if (time < 0) { - return Date.now() / 1e3; - } else { - return time; - } - } - if (nodeUtils.types.isDate(time)) - return time.getTime() / 1e3; - throw new Error(`Invalid time`); -} -function makeEmptyArchive() { - return Buffer.from([ - 80, - 75, - 5, - 6, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0 - ]); -} -class LibzipError extends Error { - constructor(message, code) { - super(message); - this.name = `Libzip Error`; - this.code = code; - } -} -class ZipFS extends BasePortableFakeFS { - constructor(source, opts = {}) { - super(); - this.listings = /* @__PURE__ */ new Map(); - this.entries = /* @__PURE__ */ new Map(); - this.fileSources = /* @__PURE__ */ new Map(); - this.fds = /* @__PURE__ */ new Map(); - this.nextFd = 0; - this.ready = false; - this.readOnly = false; - const pathOptions = opts; - this.level = typeof pathOptions.level !== `undefined` ? pathOptions.level : DEFAULT_COMPRESSION_LEVEL; - source ??= makeEmptyArchive(); - if (typeof source === `string`) { - const { baseFs = new NodeFS() } = pathOptions; - this.baseFs = baseFs; - this.path = source; - } else { - this.path = null; - this.baseFs = null; - } - if (opts.stats) { - this.stats = opts.stats; - } else { - if (typeof source === `string`) { - try { - this.stats = this.baseFs.statSync(source); - } catch (error) { - if (error.code === `ENOENT` && pathOptions.create) { - this.stats = makeDefaultStats(); - } else { - throw error; - } - } - } else { - this.stats = makeDefaultStats(); - } - } - this.libzip = getInstance(); - const errPtr = this.libzip.malloc(4); - try { - let flags = 0; - if (opts.readOnly) { - flags |= this.libzip.ZIP_RDONLY; - this.readOnly = true; - } - if (typeof source === `string`) - source = pathOptions.create ? makeEmptyArchive() : this.baseFs.readFileSync(source); - const lzSource = this.allocateUnattachedSource(source); - try { - this.zip = this.libzip.openFromSource(lzSource, flags, errPtr); - this.lzSource = lzSource; - } catch (error) { - this.libzip.source.free(lzSource); - throw error; - } - if (this.zip === 0) { - const error = this.libzip.struct.errorS(); - this.libzip.error.initWithCode(error, this.libzip.getValue(errPtr, `i32`)); - throw this.makeLibzipError(error); - } - } finally { - this.libzip.free(errPtr); - } - this.listings.set(PortablePath.root, /* @__PURE__ */ new Set()); - const entryCount = this.libzip.getNumEntries(this.zip, 0); - for (let t = 0; t < entryCount; ++t) { - const raw = this.libzip.getName(this.zip, t, 0); - if (ppath.isAbsolute(raw)) - continue; - const p = ppath.resolve(PortablePath.root, raw); - this.registerEntry(p, t); - if (raw.endsWith(`/`)) { - this.registerListing(p); - } - } - this.symlinkCount = this.libzip.ext.countSymlinks(this.zip); - if (this.symlinkCount === -1) - throw this.makeLibzipError(this.libzip.getError(this.zip)); - this.ready = true; - } - makeLibzipError(error) { - const errorCode = this.libzip.struct.errorCodeZip(error); - const strerror = this.libzip.error.strerror(error); - const libzipError = new LibzipError(strerror, this.libzip.errors[errorCode]); - if (errorCode === this.libzip.errors.ZIP_ER_CHANGED) - throw new Error(`Assertion failed: Unexpected libzip error: ${libzipError.message}`); - return libzipError; - } - getExtractHint(hints) { - for (const fileName of this.entries.keys()) { - const ext = this.pathUtils.extname(fileName); - if (hints.relevantExtensions.has(ext)) { - return true; - } - } - return false; - } - getAllFiles() { - return Array.from(this.entries.keys()); - } - getRealPath() { - if (!this.path) - throw new Error(`ZipFS don't have real paths when loaded from a buffer`); - return this.path; - } - prepareClose() { - if (!this.ready) - throw EBUSY(`archive closed, close`); - unwatchAllFiles(this); - } - getBufferAndClose() { - this.prepareClose(); - if (this.entries.size === 0) { - this.discardAndClose(); - return makeEmptyArchive(); - } - try { - this.libzip.source.keep(this.lzSource); - if (this.libzip.close(this.zip) === -1) - throw this.makeLibzipError(this.libzip.getError(this.zip)); - if (this.libzip.source.open(this.lzSource) === -1) - throw this.makeLibzipError(this.libzip.source.error(this.lzSource)); - if (this.libzip.source.seek(this.lzSource, 0, 0, this.libzip.SEEK_END) === -1) - throw this.makeLibzipError(this.libzip.source.error(this.lzSource)); - const size = this.libzip.source.tell(this.lzSource); - if (size === -1) - throw this.makeLibzipError(this.libzip.source.error(this.lzSource)); - if (this.libzip.source.seek(this.lzSource, 0, 0, this.libzip.SEEK_SET) === -1) - throw this.makeLibzipError(this.libzip.source.error(this.lzSource)); - const buffer = this.libzip.malloc(size); - if (!buffer) - throw new Error(`Couldn't allocate enough memory`); - try { - const rc = this.libzip.source.read(this.lzSource, buffer, size); - if (rc === -1) - throw this.makeLibzipError(this.libzip.source.error(this.lzSource)); - else if (rc < size) - throw new Error(`Incomplete read`); - else if (rc > size) - throw new Error(`Overread`); - let result = Buffer.from(this.libzip.HEAPU8.subarray(buffer, buffer + size)); - if (process.env.YARN_IS_TEST_ENV && process.env.YARN_ZIP_DATA_EPILOGUE) - result = Buffer.concat([result, Buffer.from(process.env.YARN_ZIP_DATA_EPILOGUE)]); - return result; - } finally { - this.libzip.free(buffer); - } - } finally { - this.libzip.source.close(this.lzSource); - this.libzip.source.free(this.lzSource); - this.ready = false; - } - } - discardAndClose() { - this.prepareClose(); - this.libzip.discard(this.zip); - this.ready = false; - } - saveAndClose() { - if (!this.path || !this.baseFs) - throw new Error(`ZipFS cannot be saved and must be discarded when loaded from a buffer`); - if (this.readOnly) { - this.discardAndClose(); - return; - } - const newMode = this.baseFs.existsSync(this.path) || this.stats.mode === DEFAULT_MODE ? void 0 : this.stats.mode; - this.baseFs.writeFileSync(this.path, this.getBufferAndClose(), { mode: newMode }); - this.ready = false; - } - resolve(p) { - return ppath.resolve(PortablePath.root, p); - } - async openPromise(p, flags, mode) { - return this.openSync(p, flags, mode); - } - openSync(p, flags, mode) { - const fd = this.nextFd++; - this.fds.set(fd, { cursor: 0, p }); - return fd; - } - hasOpenFileHandles() { - return !!this.fds.size; - } - async opendirPromise(p, opts) { - return this.opendirSync(p, opts); - } - opendirSync(p, opts = {}) { - const resolvedP = this.resolveFilename(`opendir '${p}'`, p); - if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) - throw ENOENT(`opendir '${p}'`); - const directoryListing = this.listings.get(resolvedP); - if (!directoryListing) - throw ENOTDIR(`opendir '${p}'`); - const entries = [...directoryListing]; - const fd = this.openSync(resolvedP, `r`); - const onClose = () => { - this.closeSync(fd); - }; - return opendir(this, resolvedP, entries, { onClose }); - } - async readPromise(fd, buffer, offset, length, position) { - return this.readSync(fd, buffer, offset, length, position); - } - readSync(fd, buffer, offset = 0, length = buffer.byteLength, position = -1) { - const entry = this.fds.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`read`); - const realPosition = position === -1 || position === null ? entry.cursor : position; - const source = this.readFileSync(entry.p); - source.copy(buffer, offset, realPosition, realPosition + length); - const bytesRead = Math.max(0, Math.min(source.length - realPosition, length)); - if (position === -1 || position === null) - entry.cursor += bytesRead; - return bytesRead; - } - async writePromise(fd, buffer, offset, length, position) { - if (typeof buffer === `string`) { - return this.writeSync(fd, buffer, position); - } else { - return this.writeSync(fd, buffer, offset, length, position); - } - } - writeSync(fd, buffer, offset, length, position) { - const entry = this.fds.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`read`); - throw new Error(`Unimplemented`); - } - async closePromise(fd) { - return this.closeSync(fd); - } - closeSync(fd) { - const entry = this.fds.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`read`); - this.fds.delete(fd); - } - createReadStream(p, { encoding } = {}) { - if (p === null) - throw new Error(`Unimplemented`); - const fd = this.openSync(p, `r`); - const stream$1 = Object.assign( - new stream.PassThrough({ - emitClose: true, - autoDestroy: true, - destroy: (error, callback) => { - clearImmediate(immediate); - this.closeSync(fd); - callback(error); - } - }), - { - close() { - stream$1.destroy(); - }, - bytesRead: 0, - path: p, - pending: false - } - ); - const immediate = setImmediate(async () => { - try { - const data = await this.readFilePromise(p, encoding); - stream$1.bytesRead = data.length; - stream$1.end(data); - } catch (error) { - stream$1.destroy(error); - } - }); - return stream$1; - } - createWriteStream(p, { encoding } = {}) { - if (this.readOnly) - throw EROFS(`open '${p}'`); - if (p === null) - throw new Error(`Unimplemented`); - const chunks = []; - const fd = this.openSync(p, `w`); - const stream$1 = Object.assign( - new stream.PassThrough({ - autoDestroy: true, - emitClose: true, - destroy: (error, callback) => { - try { - if (error) { - callback(error); - } else { - this.writeFileSync(p, Buffer.concat(chunks), encoding); - callback(null); - } - } catch (err) { - callback(err); - } finally { - this.closeSync(fd); - } - } - }), - { - close() { - stream$1.destroy(); - }, - bytesWritten: 0, - path: p, - pending: false - } - ); - stream$1.on(`data`, (chunk) => { - const chunkBuffer = Buffer.from(chunk); - stream$1.bytesWritten += chunkBuffer.length; - chunks.push(chunkBuffer); - }); - return stream$1; - } - async realpathPromise(p) { - return this.realpathSync(p); - } - realpathSync(p) { - const resolvedP = this.resolveFilename(`lstat '${p}'`, p); - if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) - throw ENOENT(`lstat '${p}'`); - return resolvedP; - } - async existsPromise(p) { - return this.existsSync(p); - } - existsSync(p) { - if (!this.ready) - throw EBUSY(`archive closed, existsSync '${p}'`); - if (this.symlinkCount === 0) { - const resolvedP2 = ppath.resolve(PortablePath.root, p); - return this.entries.has(resolvedP2) || this.listings.has(resolvedP2); - } - let resolvedP; - try { - resolvedP = this.resolveFilename(`stat '${p}'`, p, void 0, false); - } catch (error) { - return false; - } - if (resolvedP === void 0) - return false; - return this.entries.has(resolvedP) || this.listings.has(resolvedP); - } - async accessPromise(p, mode) { - return this.accessSync(p, mode); - } - accessSync(p, mode = fs.constants.F_OK) { - const resolvedP = this.resolveFilename(`access '${p}'`, p); - if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) - throw ENOENT(`access '${p}'`); - if (this.readOnly && mode & fs.constants.W_OK) { - throw EROFS(`access '${p}'`); - } - } - async statPromise(p, opts = { bigint: false }) { - if (opts.bigint) - return this.statSync(p, { bigint: true }); - return this.statSync(p); - } - statSync(p, opts = { bigint: false, throwIfNoEntry: true }) { - const resolvedP = this.resolveFilename(`stat '${p}'`, p, void 0, opts.throwIfNoEntry); - if (resolvedP === void 0) - return void 0; - if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) { - if (opts.throwIfNoEntry === false) - return void 0; - throw ENOENT(`stat '${p}'`); - } - if (p[p.length - 1] === `/` && !this.listings.has(resolvedP)) - throw ENOTDIR(`stat '${p}'`); - return this.statImpl(`stat '${p}'`, resolvedP, opts); - } - async fstatPromise(fd, opts) { - return this.fstatSync(fd, opts); - } - fstatSync(fd, opts) { - const entry = this.fds.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`fstatSync`); - const { p } = entry; - const resolvedP = this.resolveFilename(`stat '${p}'`, p); - if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) - throw ENOENT(`stat '${p}'`); - if (p[p.length - 1] === `/` && !this.listings.has(resolvedP)) - throw ENOTDIR(`stat '${p}'`); - return this.statImpl(`fstat '${p}'`, resolvedP, opts); - } - async lstatPromise(p, opts = { bigint: false }) { - if (opts.bigint) - return this.lstatSync(p, { bigint: true }); - return this.lstatSync(p); - } - lstatSync(p, opts = { bigint: false, throwIfNoEntry: true }) { - const resolvedP = this.resolveFilename(`lstat '${p}'`, p, false, opts.throwIfNoEntry); - if (resolvedP === void 0) - return void 0; - if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) { - if (opts.throwIfNoEntry === false) - return void 0; - throw ENOENT(`lstat '${p}'`); - } - if (p[p.length - 1] === `/` && !this.listings.has(resolvedP)) - throw ENOTDIR(`lstat '${p}'`); - return this.statImpl(`lstat '${p}'`, resolvedP, opts); - } - statImpl(reason, p, opts = {}) { - const entry = this.entries.get(p); - if (typeof entry !== `undefined`) { - const stat = this.libzip.struct.statS(); - const rc = this.libzip.statIndex(this.zip, entry, 0, 0, stat); - if (rc === -1) - throw this.makeLibzipError(this.libzip.getError(this.zip)); - const uid = this.stats.uid; - const gid = this.stats.gid; - const size = this.libzip.struct.statSize(stat) >>> 0; - const blksize = 512; - const blocks = Math.ceil(size / blksize); - const mtimeMs = (this.libzip.struct.statMtime(stat) >>> 0) * 1e3; - const atimeMs = mtimeMs; - const birthtimeMs = mtimeMs; - const ctimeMs = mtimeMs; - const atime = new Date(atimeMs); - const birthtime = new Date(birthtimeMs); - const ctime = new Date(ctimeMs); - const mtime = new Date(mtimeMs); - const type = this.listings.has(p) ? fs.constants.S_IFDIR : this.isSymbolicLink(entry) ? fs.constants.S_IFLNK : fs.constants.S_IFREG; - const defaultMode = type === fs.constants.S_IFDIR ? 493 : 420; - const mode = type | this.getUnixMode(entry, defaultMode) & 511; - const crc = this.libzip.struct.statCrc(stat); - const statInstance = Object.assign(new StatEntry(), { uid, gid, size, blksize, blocks, atime, birthtime, ctime, mtime, atimeMs, birthtimeMs, ctimeMs, mtimeMs, mode, crc }); - return opts.bigint === true ? convertToBigIntStats(statInstance) : statInstance; - } - if (this.listings.has(p)) { - const uid = this.stats.uid; - const gid = this.stats.gid; - const size = 0; - const blksize = 512; - const blocks = 0; - const atimeMs = this.stats.mtimeMs; - const birthtimeMs = this.stats.mtimeMs; - const ctimeMs = this.stats.mtimeMs; - const mtimeMs = this.stats.mtimeMs; - const atime = new Date(atimeMs); - const birthtime = new Date(birthtimeMs); - const ctime = new Date(ctimeMs); - const mtime = new Date(mtimeMs); - const mode = fs.constants.S_IFDIR | 493; - const crc = 0; - const statInstance = Object.assign(new StatEntry(), { uid, gid, size, blksize, blocks, atime, birthtime, ctime, mtime, atimeMs, birthtimeMs, ctimeMs, mtimeMs, mode, crc }); - return opts.bigint === true ? convertToBigIntStats(statInstance) : statInstance; - } - throw new Error(`Unreachable`); - } - getUnixMode(index, defaultMode) { - const rc = this.libzip.file.getExternalAttributes(this.zip, index, 0, 0, this.libzip.uint08S, this.libzip.uint32S); - if (rc === -1) - throw this.makeLibzipError(this.libzip.getError(this.zip)); - const opsys = this.libzip.getValue(this.libzip.uint08S, `i8`) >>> 0; - if (opsys !== this.libzip.ZIP_OPSYS_UNIX) - return defaultMode; - return this.libzip.getValue(this.libzip.uint32S, `i32`) >>> 16; - } - registerListing(p) { - const existingListing = this.listings.get(p); - if (existingListing) - return existingListing; - const parentListing = this.registerListing(ppath.dirname(p)); - parentListing.add(ppath.basename(p)); - const newListing = /* @__PURE__ */ new Set(); - this.listings.set(p, newListing); - return newListing; - } - registerEntry(p, index) { - const parentListing = this.registerListing(ppath.dirname(p)); - parentListing.add(ppath.basename(p)); - this.entries.set(p, index); - } - unregisterListing(p) { - this.listings.delete(p); - const parentListing = this.listings.get(ppath.dirname(p)); - parentListing?.delete(ppath.basename(p)); - } - unregisterEntry(p) { - this.unregisterListing(p); - const entry = this.entries.get(p); - this.entries.delete(p); - if (typeof entry === `undefined`) - return; - this.fileSources.delete(entry); - if (this.isSymbolicLink(entry)) { - this.symlinkCount--; - } - } - deleteEntry(p, index) { - this.unregisterEntry(p); - const rc = this.libzip.delete(this.zip, index); - if (rc === -1) { - throw this.makeLibzipError(this.libzip.getError(this.zip)); - } - } - resolveFilename(reason, p, resolveLastComponent = true, throwIfNoEntry = true) { - if (!this.ready) - throw EBUSY(`archive closed, ${reason}`); - let resolvedP = ppath.resolve(PortablePath.root, p); - if (resolvedP === `/`) - return PortablePath.root; - const fileIndex = this.entries.get(resolvedP); - if (resolveLastComponent && fileIndex !== void 0) { - if (this.symlinkCount !== 0 && this.isSymbolicLink(fileIndex)) { - const target = this.getFileSource(fileIndex).toString(); - return this.resolveFilename(reason, ppath.resolve(ppath.dirname(resolvedP), target), true, throwIfNoEntry); - } else { - return resolvedP; - } - } - while (true) { - const parentP = this.resolveFilename(reason, ppath.dirname(resolvedP), true, throwIfNoEntry); - if (parentP === void 0) - return parentP; - const isDir = this.listings.has(parentP); - const doesExist = this.entries.has(parentP); - if (!isDir && !doesExist) { - if (throwIfNoEntry === false) - return void 0; - throw ENOENT(reason); - } - if (!isDir) - throw ENOTDIR(reason); - resolvedP = ppath.resolve(parentP, ppath.basename(resolvedP)); - if (!resolveLastComponent || this.symlinkCount === 0) - break; - const index = this.libzip.name.locate(this.zip, resolvedP.slice(1), 0); - if (index === -1) - break; - if (this.isSymbolicLink(index)) { - const target = this.getFileSource(index).toString(); - resolvedP = ppath.resolve(ppath.dirname(resolvedP), target); - } else { - break; - } - } - return resolvedP; - } - allocateBuffer(content) { - if (!Buffer.isBuffer(content)) - content = Buffer.from(content); - const buffer = this.libzip.malloc(content.byteLength); - if (!buffer) - throw new Error(`Couldn't allocate enough memory`); - const heap = new Uint8Array(this.libzip.HEAPU8.buffer, buffer, content.byteLength); - heap.set(content); - return { buffer, byteLength: content.byteLength }; - } - allocateUnattachedSource(content) { - const error = this.libzip.struct.errorS(); - const { buffer, byteLength } = this.allocateBuffer(content); - const source = this.libzip.source.fromUnattachedBuffer(buffer, byteLength, 0, 1, error); - if (source === 0) { - this.libzip.free(error); - throw this.makeLibzipError(error); - } - return source; - } - allocateSource(content) { - const { buffer, byteLength } = this.allocateBuffer(content); - const source = this.libzip.source.fromBuffer(this.zip, buffer, byteLength, 0, 1); - if (source === 0) { - this.libzip.free(buffer); - throw this.makeLibzipError(this.libzip.getError(this.zip)); - } - return source; - } - setFileSource(p, content) { - const buffer = Buffer.isBuffer(content) ? content : Buffer.from(content); - const target = ppath.relative(PortablePath.root, p); - const lzSource = this.allocateSource(content); - try { - const newIndex = this.libzip.file.add(this.zip, target, lzSource, this.libzip.ZIP_FL_OVERWRITE); - if (newIndex === -1) - throw this.makeLibzipError(this.libzip.getError(this.zip)); - if (this.level !== `mixed`) { - const method = this.level === 0 ? this.libzip.ZIP_CM_STORE : this.libzip.ZIP_CM_DEFLATE; - const rc = this.libzip.file.setCompression(this.zip, newIndex, 0, method, this.level); - if (rc === -1) { - throw this.makeLibzipError(this.libzip.getError(this.zip)); - } - } - this.fileSources.set(newIndex, buffer); - return newIndex; - } catch (error) { - this.libzip.source.free(lzSource); - throw error; - } - } - isSymbolicLink(index) { - if (this.symlinkCount === 0) - return false; - const attrs = this.libzip.file.getExternalAttributes(this.zip, index, 0, 0, this.libzip.uint08S, this.libzip.uint32S); - if (attrs === -1) - throw this.makeLibzipError(this.libzip.getError(this.zip)); - const opsys = this.libzip.getValue(this.libzip.uint08S, `i8`) >>> 0; - if (opsys !== this.libzip.ZIP_OPSYS_UNIX) - return false; - const attributes = this.libzip.getValue(this.libzip.uint32S, `i32`) >>> 16; - return (attributes & fs.constants.S_IFMT) === fs.constants.S_IFLNK; - } - getFileSource(index, opts = { asyncDecompress: false }) { - const cachedFileSource = this.fileSources.get(index); - if (typeof cachedFileSource !== `undefined`) - return cachedFileSource; - const stat = this.libzip.struct.statS(); - const rc = this.libzip.statIndex(this.zip, index, 0, 0, stat); - if (rc === -1) - throw this.makeLibzipError(this.libzip.getError(this.zip)); - const size = this.libzip.struct.statCompSize(stat); - const compressionMethod = this.libzip.struct.statCompMethod(stat); - const buffer = this.libzip.malloc(size); - try { - const file = this.libzip.fopenIndex(this.zip, index, 0, this.libzip.ZIP_FL_COMPRESSED); - if (file === 0) - throw this.makeLibzipError(this.libzip.getError(this.zip)); - try { - const rc2 = this.libzip.fread(file, buffer, size, 0); - if (rc2 === -1) - throw this.makeLibzipError(this.libzip.file.getError(file)); - else if (rc2 < size) - throw new Error(`Incomplete read`); - else if (rc2 > size) - throw new Error(`Overread`); - const memory = this.libzip.HEAPU8.subarray(buffer, buffer + size); - const data = Buffer.from(memory); - if (compressionMethod === 0) { - this.fileSources.set(index, data); - return data; - } else if (opts.asyncDecompress) { - return new Promise((resolve, reject) => { - zlib__default.default.inflateRaw(data, (error, result) => { - if (error) { - reject(error); - } else { - this.fileSources.set(index, result); - resolve(result); - } - }); - }); - } else { - const decompressedData = zlib__default.default.inflateRawSync(data); - this.fileSources.set(index, decompressedData); - return decompressedData; - } - } finally { - this.libzip.fclose(file); - } - } finally { - this.libzip.free(buffer); - } - } - async fchmodPromise(fd, mask) { - return this.chmodPromise(this.fdToPath(fd, `fchmod`), mask); - } - fchmodSync(fd, mask) { - return this.chmodSync(this.fdToPath(fd, `fchmodSync`), mask); - } - async chmodPromise(p, mask) { - return this.chmodSync(p, mask); - } - chmodSync(p, mask) { - if (this.readOnly) - throw EROFS(`chmod '${p}'`); - mask &= 493; - const resolvedP = this.resolveFilename(`chmod '${p}'`, p, false); - const entry = this.entries.get(resolvedP); - if (typeof entry === `undefined`) - throw new Error(`Assertion failed: The entry should have been registered (${resolvedP})`); - const oldMod = this.getUnixMode(entry, fs.constants.S_IFREG | 0); - const newMod = oldMod & ~511 | mask; - const rc = this.libzip.file.setExternalAttributes(this.zip, entry, 0, 0, this.libzip.ZIP_OPSYS_UNIX, newMod << 16); - if (rc === -1) { - throw this.makeLibzipError(this.libzip.getError(this.zip)); - } - } - async fchownPromise(fd, uid, gid) { - return this.chownPromise(this.fdToPath(fd, `fchown`), uid, gid); - } - fchownSync(fd, uid, gid) { - return this.chownSync(this.fdToPath(fd, `fchownSync`), uid, gid); - } - async chownPromise(p, uid, gid) { - return this.chownSync(p, uid, gid); - } - chownSync(p, uid, gid) { - throw new Error(`Unimplemented`); - } - async renamePromise(oldP, newP) { - return this.renameSync(oldP, newP); - } - renameSync(oldP, newP) { - throw new Error(`Unimplemented`); - } - async copyFilePromise(sourceP, destP, flags) { - const { indexSource, indexDest, resolvedDestP } = this.prepareCopyFile(sourceP, destP, flags); - const source = await this.getFileSource(indexSource, { asyncDecompress: true }); - const newIndex = this.setFileSource(resolvedDestP, source); - if (newIndex !== indexDest) { - this.registerEntry(resolvedDestP, newIndex); - } - } - copyFileSync(sourceP, destP, flags = 0) { - const { indexSource, indexDest, resolvedDestP } = this.prepareCopyFile(sourceP, destP, flags); - const source = this.getFileSource(indexSource); - const newIndex = this.setFileSource(resolvedDestP, source); - if (newIndex !== indexDest) { - this.registerEntry(resolvedDestP, newIndex); - } - } - prepareCopyFile(sourceP, destP, flags = 0) { - if (this.readOnly) - throw EROFS(`copyfile '${sourceP} -> '${destP}'`); - if ((flags & fs.constants.COPYFILE_FICLONE_FORCE) !== 0) - throw ENOSYS(`unsupported clone operation`, `copyfile '${sourceP}' -> ${destP}'`); - const resolvedSourceP = this.resolveFilename(`copyfile '${sourceP} -> ${destP}'`, sourceP); - const indexSource = this.entries.get(resolvedSourceP); - if (typeof indexSource === `undefined`) - throw EINVAL(`copyfile '${sourceP}' -> '${destP}'`); - const resolvedDestP = this.resolveFilename(`copyfile '${sourceP}' -> ${destP}'`, destP); - const indexDest = this.entries.get(resolvedDestP); - if ((flags & (fs.constants.COPYFILE_EXCL | fs.constants.COPYFILE_FICLONE_FORCE)) !== 0 && typeof indexDest !== `undefined`) - throw EEXIST(`copyfile '${sourceP}' -> '${destP}'`); - return { - indexSource, - resolvedDestP, - indexDest - }; - } - async appendFilePromise(p, content, opts) { - if (this.readOnly) - throw EROFS(`open '${p}'`); - if (typeof opts === `undefined`) - opts = { flag: `a` }; - else if (typeof opts === `string`) - opts = { flag: `a`, encoding: opts }; - else if (typeof opts.flag === `undefined`) - opts = { flag: `a`, ...opts }; - return this.writeFilePromise(p, content, opts); - } - appendFileSync(p, content, opts = {}) { - if (this.readOnly) - throw EROFS(`open '${p}'`); - if (typeof opts === `undefined`) - opts = { flag: `a` }; - else if (typeof opts === `string`) - opts = { flag: `a`, encoding: opts }; - else if (typeof opts.flag === `undefined`) - opts = { flag: `a`, ...opts }; - return this.writeFileSync(p, content, opts); - } - fdToPath(fd, reason) { - const path = this.fds.get(fd)?.p; - if (typeof path === `undefined`) - throw EBADF(reason); - return path; - } - async writeFilePromise(p, content, opts) { - const { encoding, mode, index, resolvedP } = this.prepareWriteFile(p, opts); - if (index !== void 0 && typeof opts === `object` && opts.flag && opts.flag.includes(`a`)) - content = Buffer.concat([await this.getFileSource(index, { asyncDecompress: true }), Buffer.from(content)]); - if (encoding !== null) - content = content.toString(encoding); - const newIndex = this.setFileSource(resolvedP, content); - if (newIndex !== index) - this.registerEntry(resolvedP, newIndex); - if (mode !== null) { - await this.chmodPromise(resolvedP, mode); - } - } - writeFileSync(p, content, opts) { - const { encoding, mode, index, resolvedP } = this.prepareWriteFile(p, opts); - if (index !== void 0 && typeof opts === `object` && opts.flag && opts.flag.includes(`a`)) - content = Buffer.concat([this.getFileSource(index), Buffer.from(content)]); - if (encoding !== null) - content = content.toString(encoding); - const newIndex = this.setFileSource(resolvedP, content); - if (newIndex !== index) - this.registerEntry(resolvedP, newIndex); - if (mode !== null) { - this.chmodSync(resolvedP, mode); - } - } - prepareWriteFile(p, opts) { - if (typeof p === `number`) - p = this.fdToPath(p, `read`); - if (this.readOnly) - throw EROFS(`open '${p}'`); - const resolvedP = this.resolveFilename(`open '${p}'`, p); - if (this.listings.has(resolvedP)) - throw EISDIR(`open '${p}'`); - let encoding = null, mode = null; - if (typeof opts === `string`) { - encoding = opts; - } else if (typeof opts === `object`) { - ({ - encoding = null, - mode = null - } = opts); - } - const index = this.entries.get(resolvedP); - return { - encoding, - mode, - resolvedP, - index - }; - } - async unlinkPromise(p) { - return this.unlinkSync(p); - } - unlinkSync(p) { - if (this.readOnly) - throw EROFS(`unlink '${p}'`); - const resolvedP = this.resolveFilename(`unlink '${p}'`, p); - if (this.listings.has(resolvedP)) - throw EISDIR(`unlink '${p}'`); - const index = this.entries.get(resolvedP); - if (typeof index === `undefined`) - throw EINVAL(`unlink '${p}'`); - this.deleteEntry(resolvedP, index); - } - async utimesPromise(p, atime, mtime) { - return this.utimesSync(p, atime, mtime); - } - utimesSync(p, atime, mtime) { - if (this.readOnly) - throw EROFS(`utimes '${p}'`); - const resolvedP = this.resolveFilename(`utimes '${p}'`, p); - this.utimesImpl(resolvedP, mtime); - } - async lutimesPromise(p, atime, mtime) { - return this.lutimesSync(p, atime, mtime); - } - lutimesSync(p, atime, mtime) { - if (this.readOnly) - throw EROFS(`lutimes '${p}'`); - const resolvedP = this.resolveFilename(`utimes '${p}'`, p, false); - this.utimesImpl(resolvedP, mtime); - } - utimesImpl(resolvedP, mtime) { - if (this.listings.has(resolvedP)) { - if (!this.entries.has(resolvedP)) - this.hydrateDirectory(resolvedP); - } - const entry = this.entries.get(resolvedP); - if (entry === void 0) - throw new Error(`Unreachable`); - const rc = this.libzip.file.setMtime(this.zip, entry, 0, toUnixTimestamp(mtime), 0); - if (rc === -1) { - throw this.makeLibzipError(this.libzip.getError(this.zip)); - } - } - async mkdirPromise(p, opts) { - return this.mkdirSync(p, opts); - } - mkdirSync(p, { mode = 493, recursive = false } = {}) { - if (recursive) - return this.mkdirpSync(p, { chmod: mode }); - if (this.readOnly) - throw EROFS(`mkdir '${p}'`); - const resolvedP = this.resolveFilename(`mkdir '${p}'`, p); - if (this.entries.has(resolvedP) || this.listings.has(resolvedP)) - throw EEXIST(`mkdir '${p}'`); - this.hydrateDirectory(resolvedP); - this.chmodSync(resolvedP, mode); - return void 0; - } - async rmdirPromise(p, opts) { - return this.rmdirSync(p, opts); - } - rmdirSync(p, { recursive = false } = {}) { - if (this.readOnly) - throw EROFS(`rmdir '${p}'`); - if (recursive) { - this.removeSync(p); - return; - } - const resolvedP = this.resolveFilename(`rmdir '${p}'`, p); - const directoryListing = this.listings.get(resolvedP); - if (!directoryListing) - throw ENOTDIR(`rmdir '${p}'`); - if (directoryListing.size > 0) - throw ENOTEMPTY(`rmdir '${p}'`); - const index = this.entries.get(resolvedP); - if (typeof index === `undefined`) - throw EINVAL(`rmdir '${p}'`); - this.deleteEntry(p, index); - } - async rmPromise(p, opts) { - return this.rmSync(p, opts); - } - rmSync(p, { recursive = false } = {}) { - if (this.readOnly) - throw EROFS(`rm '${p}'`); - if (recursive) { - this.removeSync(p); - return; - } - const resolvedP = this.resolveFilename(`rm '${p}'`, p); - const directoryListing = this.listings.get(resolvedP); - if (!directoryListing) - throw ENOTDIR(`rm '${p}'`); - if (directoryListing.size > 0) - throw ENOTEMPTY(`rm '${p}'`); - const index = this.entries.get(resolvedP); - if (typeof index === `undefined`) - throw EINVAL(`rm '${p}'`); - this.deleteEntry(p, index); - } - hydrateDirectory(resolvedP) { - const index = this.libzip.dir.add(this.zip, ppath.relative(PortablePath.root, resolvedP)); - if (index === -1) - throw this.makeLibzipError(this.libzip.getError(this.zip)); - this.registerListing(resolvedP); - this.registerEntry(resolvedP, index); - return index; - } - async linkPromise(existingP, newP) { - return this.linkSync(existingP, newP); - } - linkSync(existingP, newP) { - throw EOPNOTSUPP(`link '${existingP}' -> '${newP}'`); - } - async symlinkPromise(target, p) { - return this.symlinkSync(target, p); - } - symlinkSync(target, p) { - if (this.readOnly) - throw EROFS(`symlink '${target}' -> '${p}'`); - const resolvedP = this.resolveFilename(`symlink '${target}' -> '${p}'`, p); - if (this.listings.has(resolvedP)) - throw EISDIR(`symlink '${target}' -> '${p}'`); - if (this.entries.has(resolvedP)) - throw EEXIST(`symlink '${target}' -> '${p}'`); - const index = this.setFileSource(resolvedP, target); - this.registerEntry(resolvedP, index); - const rc = this.libzip.file.setExternalAttributes(this.zip, index, 0, 0, this.libzip.ZIP_OPSYS_UNIX, (fs.constants.S_IFLNK | 511) << 16); - if (rc === -1) - throw this.makeLibzipError(this.libzip.getError(this.zip)); - this.symlinkCount += 1; - } - async readFilePromise(p, encoding) { - if (typeof encoding === `object`) - encoding = encoding ? encoding.encoding : void 0; - const data = await this.readFileBuffer(p, { asyncDecompress: true }); - return encoding ? data.toString(encoding) : data; - } - readFileSync(p, encoding) { - if (typeof encoding === `object`) - encoding = encoding ? encoding.encoding : void 0; - const data = this.readFileBuffer(p); - return encoding ? data.toString(encoding) : data; - } - readFileBuffer(p, opts = { asyncDecompress: false }) { - if (typeof p === `number`) - p = this.fdToPath(p, `read`); - const resolvedP = this.resolveFilename(`open '${p}'`, p); - if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) - throw ENOENT(`open '${p}'`); - if (p[p.length - 1] === `/` && !this.listings.has(resolvedP)) - throw ENOTDIR(`open '${p}'`); - if (this.listings.has(resolvedP)) - throw EISDIR(`read`); - const entry = this.entries.get(resolvedP); - if (entry === void 0) - throw new Error(`Unreachable`); - return this.getFileSource(entry, opts); - } - async readdirPromise(p, opts) { - return this.readdirSync(p, opts); - } - readdirSync(p, opts) { - const resolvedP = this.resolveFilename(`scandir '${p}'`, p); - if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) - throw ENOENT(`scandir '${p}'`); - const directoryListing = this.listings.get(resolvedP); - if (!directoryListing) - throw ENOTDIR(`scandir '${p}'`); - if (opts?.recursive) { - if (opts?.withFileTypes) { - const entries = Array.from(directoryListing, (name) => { - return Object.assign(this.statImpl(`lstat`, ppath.join(p, name)), { - name, - path: PortablePath.dot - }); - }); - for (const entry of entries) { - if (!entry.isDirectory()) - continue; - const subPath = ppath.join(entry.path, entry.name); - const subListing = this.listings.get(ppath.join(resolvedP, subPath)); - for (const child of subListing) { - entries.push(Object.assign(this.statImpl(`lstat`, ppath.join(p, subPath, child)), { - name: child, - path: subPath - })); - } - } - return entries; - } else { - const entries = [...directoryListing]; - for (const subPath of entries) { - const subListing = this.listings.get(ppath.join(resolvedP, subPath)); - if (typeof subListing === `undefined`) - continue; - for (const child of subListing) { - entries.push(ppath.join(subPath, child)); - } - } - return entries; - } - } else if (opts?.withFileTypes) { - return Array.from(directoryListing, (name) => { - return Object.assign(this.statImpl(`lstat`, ppath.join(p, name)), { - name, - path: void 0 - }); - }); - } else { - return [...directoryListing]; - } - } - async readlinkPromise(p) { - const entry = this.prepareReadlink(p); - return (await this.getFileSource(entry, { asyncDecompress: true })).toString(); - } - readlinkSync(p) { - const entry = this.prepareReadlink(p); - return this.getFileSource(entry).toString(); - } - prepareReadlink(p) { - const resolvedP = this.resolveFilename(`readlink '${p}'`, p, false); - if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) - throw ENOENT(`readlink '${p}'`); - if (p[p.length - 1] === `/` && !this.listings.has(resolvedP)) - throw ENOTDIR(`open '${p}'`); - if (this.listings.has(resolvedP)) - throw EINVAL(`readlink '${p}'`); - const entry = this.entries.get(resolvedP); - if (entry === void 0) - throw new Error(`Unreachable`); - if (!this.isSymbolicLink(entry)) - throw EINVAL(`readlink '${p}'`); - return entry; - } - async truncatePromise(p, len = 0) { - const resolvedP = this.resolveFilename(`open '${p}'`, p); - const index = this.entries.get(resolvedP); - if (typeof index === `undefined`) - throw EINVAL(`open '${p}'`); - const source = await this.getFileSource(index, { asyncDecompress: true }); - const truncated = Buffer.alloc(len, 0); - source.copy(truncated); - return await this.writeFilePromise(p, truncated); - } - truncateSync(p, len = 0) { - const resolvedP = this.resolveFilename(`open '${p}'`, p); - const index = this.entries.get(resolvedP); - if (typeof index === `undefined`) - throw EINVAL(`open '${p}'`); - const source = this.getFileSource(index); - const truncated = Buffer.alloc(len, 0); - source.copy(truncated); - return this.writeFileSync(p, truncated); - } - async ftruncatePromise(fd, len) { - return this.truncatePromise(this.fdToPath(fd, `ftruncate`), len); - } - ftruncateSync(fd, len) { - return this.truncateSync(this.fdToPath(fd, `ftruncateSync`), len); - } - watch(p, a, b) { - let persistent; - switch (typeof a) { - case `function`: - case `string`: - case `undefined`: - { - persistent = true; - } - break; - default: - { - ({ persistent = true } = a); - } - break; - } - if (!persistent) - return { on: () => { - }, close: () => { - } }; - const interval = setInterval(() => { - }, 24 * 60 * 60 * 1e3); - return { on: () => { - }, close: () => { - clearInterval(interval); - } }; - } - watchFile(p, a, b) { - const resolvedP = ppath.resolve(PortablePath.root, p); - return watchFile(this, resolvedP, a, b); - } - unwatchFile(p, cb) { - const resolvedP = ppath.resolve(PortablePath.root, p); - return unwatchFile(this, resolvedP, cb); - } -} - -setFactory(() => { - const emZip = createModule(); - return makeInterface(emZip); -}); - -var ErrorCode = /* @__PURE__ */ ((ErrorCode2) => { - ErrorCode2["API_ERROR"] = `API_ERROR`; - ErrorCode2["BUILTIN_NODE_RESOLUTION_FAILED"] = `BUILTIN_NODE_RESOLUTION_FAILED`; - ErrorCode2["EXPORTS_RESOLUTION_FAILED"] = `EXPORTS_RESOLUTION_FAILED`; - ErrorCode2["MISSING_DEPENDENCY"] = `MISSING_DEPENDENCY`; - ErrorCode2["MISSING_PEER_DEPENDENCY"] = `MISSING_PEER_DEPENDENCY`; - ErrorCode2["QUALIFIED_PATH_RESOLUTION_FAILED"] = `QUALIFIED_PATH_RESOLUTION_FAILED`; - ErrorCode2["INTERNAL"] = `INTERNAL`; - ErrorCode2["UNDECLARED_DEPENDENCY"] = `UNDECLARED_DEPENDENCY`; - ErrorCode2["UNSUPPORTED"] = `UNSUPPORTED`; - return ErrorCode2; -})(ErrorCode || {}); -const MODULE_NOT_FOUND_ERRORS = /* @__PURE__ */ new Set([ - "BUILTIN_NODE_RESOLUTION_FAILED" /* BUILTIN_NODE_RESOLUTION_FAILED */, - "MISSING_DEPENDENCY" /* MISSING_DEPENDENCY */, - "MISSING_PEER_DEPENDENCY" /* MISSING_PEER_DEPENDENCY */, - "QUALIFIED_PATH_RESOLUTION_FAILED" /* QUALIFIED_PATH_RESOLUTION_FAILED */, - "UNDECLARED_DEPENDENCY" /* UNDECLARED_DEPENDENCY */ -]); -function makeError(pnpCode, message, data = {}, code) { - code ??= MODULE_NOT_FOUND_ERRORS.has(pnpCode) ? `MODULE_NOT_FOUND` : pnpCode; - const propertySpec = { - configurable: true, - writable: true, - enumerable: false - }; - return Object.defineProperties(new Error(message), { - code: { - ...propertySpec, - value: code - }, - pnpCode: { - ...propertySpec, - value: pnpCode - }, - data: { - ...propertySpec, - value: data - } - }); -} -function getIssuerModule(parent) { - let issuer = parent; - while (issuer && (issuer.id === `[eval]` || issuer.id === `` || !issuer.filename)) - issuer = issuer.parent; - return issuer || null; -} -function getPathForDisplay(p) { - return npath.normalize(npath.fromPortablePath(p)); -} - -const [major, minor] = process.versions.node.split(`.`).map((value) => parseInt(value, 10)); -const WATCH_MODE_MESSAGE_USES_ARRAYS = major > 19 || major === 19 && minor >= 2 || major === 18 && minor >= 13; - -function readPackageScope(checkPath) { - const rootSeparatorIndex = checkPath.indexOf(npath.sep); - let separatorIndex; - do { - separatorIndex = checkPath.lastIndexOf(npath.sep); - checkPath = checkPath.slice(0, separatorIndex); - if (checkPath.endsWith(`${npath.sep}node_modules`)) - return false; - const pjson = readPackage(checkPath + npath.sep); - if (pjson) { - return { - data: pjson, - path: checkPath - }; - } - } while (separatorIndex > rootSeparatorIndex); - return false; -} -function readPackage(requestPath) { - const jsonPath = npath.resolve(requestPath, `package.json`); - if (!fs__default.default.existsSync(jsonPath)) - return null; - return JSON.parse(fs__default.default.readFileSync(jsonPath, `utf8`)); -} -function ERR_REQUIRE_ESM(filename, parentPath = null) { - const basename = parentPath && path__default.default.basename(filename) === path__default.default.basename(parentPath) ? filename : path__default.default.basename(filename); - const msg = `require() of ES Module ${filename}${parentPath ? ` from ${parentPath}` : ``} not supported. -Instead change the require of ${basename} in ${parentPath} to a dynamic import() which is available in all CommonJS modules.`; - const err = new Error(msg); - err.code = `ERR_REQUIRE_ESM`; - return err; -} -function reportRequiredFilesToWatchMode(files) { - if (process.env.WATCH_REPORT_DEPENDENCIES && process.send) { - files = files.map((filename) => npath.fromPortablePath(VirtualFS.resolveVirtual(npath.toPortablePath(filename)))); - if (WATCH_MODE_MESSAGE_USES_ARRAYS) { - process.send({ "watch:require": files }); - } else { - for (const filename of files) { - process.send({ "watch:require": filename }); - } - } - } -} - -function applyPatch(pnpapi, opts) { - let enableNativeHooks = true; - process.versions.pnp = String(pnpapi.VERSIONS.std); - const moduleExports = require$$0__default.default; - moduleExports.findPnpApi = (lookupSource) => { - const lookupPath = lookupSource instanceof URL ? url.fileURLToPath(lookupSource) : lookupSource; - const apiPath = opts.manager.findApiPathFor(lookupPath); - if (apiPath === null) - return null; - const apiEntry = opts.manager.getApiEntry(apiPath, true); - return apiEntry.instance.findPackageLocator(lookupPath) ? apiEntry.instance : null; - }; - function getRequireStack(parent) { - const requireStack = []; - for (let cursor = parent; cursor; cursor = cursor.parent) - requireStack.push(cursor.filename || cursor.id); - return requireStack; - } - const originalModuleLoad = require$$0.Module._load; - require$$0.Module._load = function(request, parent, isMain) { - if (request === `pnpapi`) { - const parentApiPath = opts.manager.getApiPathFromParent(parent); - if (parentApiPath) { - return opts.manager.getApiEntry(parentApiPath, true).instance; - } - } - return originalModuleLoad.call(require$$0.Module, request, parent, isMain); - }; - function getIssuerSpecsFromPaths(paths) { - return paths.map((path) => ({ - apiPath: opts.manager.findApiPathFor(path), - path, - module: null - })); - } - function getIssuerSpecsFromModule(module) { - if (module && module.id !== `` && module.id !== `internal/preload` && !module.parent && !module.filename && module.paths.length > 0) { - return [{ - apiPath: opts.manager.findApiPathFor(module.paths[0]), - path: module.paths[0], - module - }]; - } - const issuer = getIssuerModule(module); - if (issuer !== null) { - const path = npath.dirname(issuer.filename); - const apiPath = opts.manager.getApiPathFromParent(issuer); - return [{ apiPath, path, module }]; - } else { - const path = process.cwd(); - const apiPath = opts.manager.findApiPathFor(npath.join(path, `[file]`)) ?? opts.manager.getApiPathFromParent(null); - return [{ apiPath, path, module }]; - } - } - function makeFakeParent(path) { - const fakeParent = new require$$0.Module(``); - const fakeFilePath = npath.join(path, `[file]`); - fakeParent.paths = require$$0.Module._nodeModulePaths(fakeFilePath); - return fakeParent; - } - const pathRegExp = /^(?![a-zA-Z]:[\\/]|\\\\|\.{0,2}(?:\/|$))((?:@[^/]+\/)?[^/]+)\/*(.*|)$/; - const originalModuleResolveFilename = require$$0.Module._resolveFilename; - require$$0.Module._resolveFilename = function(request, parent, isMain, options) { - if (require$$0.isBuiltin(request)) - return request; - if (!enableNativeHooks) - return originalModuleResolveFilename.call(require$$0.Module, request, parent, isMain, options); - if (options && options.plugnplay === false) { - const { plugnplay, ...forwardedOptions } = options; - try { - enableNativeHooks = false; - return originalModuleResolveFilename.call(require$$0.Module, request, parent, isMain, forwardedOptions); - } finally { - enableNativeHooks = true; - } - } - if (options) { - const optionNames = new Set(Object.keys(options)); - optionNames.delete(`paths`); - optionNames.delete(`plugnplay`); - if (optionNames.size > 0) { - throw makeError( - ErrorCode.UNSUPPORTED, - `Some options passed to require() aren't supported by PnP yet (${Array.from(optionNames).join(`, `)})` - ); - } - } - const issuerSpecs = options && options.paths ? getIssuerSpecsFromPaths(options.paths) : getIssuerSpecsFromModule(parent); - if (request.match(pathRegExp) === null) { - const parentDirectory = parent?.filename != null ? npath.dirname(parent.filename) : null; - const absoluteRequest = npath.isAbsolute(request) ? request : parentDirectory !== null ? npath.resolve(parentDirectory, request) : null; - if (absoluteRequest !== null) { - const apiPath = parent && parentDirectory === npath.dirname(absoluteRequest) ? opts.manager.getApiPathFromParent(parent) : opts.manager.findApiPathFor(absoluteRequest); - if (apiPath !== null) { - issuerSpecs.unshift({ - apiPath, - path: parentDirectory, - module: null - }); - } - } - } - let firstError; - for (const { apiPath, path, module } of issuerSpecs) { - let resolution; - const issuerApi = apiPath !== null ? opts.manager.getApiEntry(apiPath, true).instance : null; - try { - if (issuerApi !== null) { - resolution = issuerApi.resolveRequest(request, path !== null ? `${path}/` : null); - } else { - if (path === null) - throw new Error(`Assertion failed: Expected the path to be set`); - resolution = originalModuleResolveFilename.call(require$$0.Module, request, module || makeFakeParent(path), isMain); - } - } catch (error) { - firstError = firstError || error; - continue; - } - if (resolution !== null) { - return resolution; - } - } - const requireStack = getRequireStack(parent); - Object.defineProperty(firstError, `requireStack`, { - configurable: true, - writable: true, - enumerable: false, - value: requireStack - }); - if (requireStack.length > 0) - firstError.message += ` -Require stack: -- ${requireStack.join(` -- `)}`; - if (typeof firstError.pnpCode === `string`) - Error.captureStackTrace(firstError); - throw firstError; - }; - const originalFindPath = require$$0.Module._findPath; - require$$0.Module._findPath = function(request, paths, isMain) { - if (request === `pnpapi`) - return false; - if (!enableNativeHooks) - return originalFindPath.call(require$$0.Module, request, paths, isMain); - const isAbsolute = npath.isAbsolute(request); - if (isAbsolute) - paths = [``]; - else if (!paths || paths.length === 0) - return false; - for (const path of paths) { - let resolution; - try { - const pnpApiPath = opts.manager.findApiPathFor(isAbsolute ? request : path); - if (pnpApiPath !== null) { - const api = opts.manager.getApiEntry(pnpApiPath, true).instance; - resolution = api.resolveRequest(request, path) || false; - } else { - resolution = originalFindPath.call(require$$0.Module, request, [path], isMain); - } - } catch (error) { - continue; - } - if (resolution) { - return resolution; - } - } - return false; - }; - const originalExtensionJSFunction = require$$0.Module._extensions[`.js`]; - require$$0.Module._extensions[`.js`] = function(module, filename) { - if (filename.endsWith(`.js`)) { - const pkg = readPackageScope(filename); - if (pkg && pkg.data?.type === `module`) { - const err = ERR_REQUIRE_ESM(filename, module.parent?.filename); - Error.captureStackTrace(err); - throw err; - } - } - originalExtensionJSFunction.call(this, module, filename); - }; - const originalDlopen = process.dlopen; - process.dlopen = function(...args) { - const [module, filename, ...rest] = args; - return originalDlopen.call( - this, - module, - npath.fromPortablePath(VirtualFS.resolveVirtual(npath.toPortablePath(filename))), - ...rest - ); - }; - const originalEmit = process.emit; - process.emit = function(name, data, ...args) { - if (name === `warning` && typeof data === `object` && data.name === `ExperimentalWarning` && (data.message.includes(`--experimental-loader`) || data.message.includes(`Custom ESM Loaders is an experimental feature`))) - return false; - return originalEmit.apply(process, arguments); - }; - patchFs(fs__default.default, new PosixFS(opts.fakeFs)); -} - -function hydrateRuntimeState(data, { basePath }) { - const portablePath = npath.toPortablePath(basePath); - const absolutePortablePath = ppath.resolve(portablePath); - const ignorePattern = data.ignorePatternData !== null ? new RegExp(data.ignorePatternData) : null; - const packageLocatorsByLocations = /* @__PURE__ */ new Map(); - const packageRegistry = new Map(data.packageRegistryData.map(([packageName, packageStoreData]) => { - return [packageName, new Map(packageStoreData.map(([packageReference, packageInformationData]) => { - if (packageName === null !== (packageReference === null)) - throw new Error(`Assertion failed: The name and reference should be null, or neither should`); - const discardFromLookup = packageInformationData.discardFromLookup ?? false; - const packageLocator = { name: packageName, reference: packageReference }; - const entry = packageLocatorsByLocations.get(packageInformationData.packageLocation); - if (!entry) { - packageLocatorsByLocations.set(packageInformationData.packageLocation, { locator: packageLocator, discardFromLookup }); - } else { - entry.discardFromLookup = entry.discardFromLookup && discardFromLookup; - if (!discardFromLookup) { - entry.locator = packageLocator; - } - } - let resolvedPackageLocation = null; - return [packageReference, { - packageDependencies: new Map(packageInformationData.packageDependencies), - packagePeers: new Set(packageInformationData.packagePeers), - linkType: packageInformationData.linkType, - discardFromLookup, - get packageLocation() { - return resolvedPackageLocation || (resolvedPackageLocation = ppath.join(absolutePortablePath, packageInformationData.packageLocation)); - } - }]; - }))]; - })); - const fallbackExclusionList = new Map(data.fallbackExclusionList.map(([packageName, packageReferences]) => { - return [packageName, new Set(packageReferences)]; - })); - const fallbackPool = new Map(data.fallbackPool); - const dependencyTreeRoots = data.dependencyTreeRoots; - const enableTopLevelFallback = data.enableTopLevelFallback; - return { - basePath: portablePath, - dependencyTreeRoots, - enableTopLevelFallback, - fallbackExclusionList, - fallbackPool, - ignorePattern, - packageLocatorsByLocations, - packageRegistry - }; -} - -const ArrayIsArray = Array.isArray; -const JSONStringify = JSON.stringify; -const ObjectGetOwnPropertyNames = Object.getOwnPropertyNames; -const ObjectPrototypeHasOwnProperty = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop); -const RegExpPrototypeExec = (obj, string) => RegExp.prototype.exec.call(obj, string); -const RegExpPrototypeSymbolReplace = (obj, ...rest) => RegExp.prototype[Symbol.replace].apply(obj, rest); -const StringPrototypeEndsWith = (str, ...rest) => String.prototype.endsWith.apply(str, rest); -const StringPrototypeIncludes = (str, ...rest) => String.prototype.includes.apply(str, rest); -const StringPrototypeLastIndexOf = (str, ...rest) => String.prototype.lastIndexOf.apply(str, rest); -const StringPrototypeIndexOf = (str, ...rest) => String.prototype.indexOf.apply(str, rest); -const StringPrototypeReplace = (str, ...rest) => String.prototype.replace.apply(str, rest); -const StringPrototypeSlice = (str, ...rest) => String.prototype.slice.apply(str, rest); -const StringPrototypeStartsWith = (str, ...rest) => String.prototype.startsWith.apply(str, rest); -const SafeMap = Map; -const JSONParse = JSON.parse; - -function createErrorType(code, messageCreator, errorType) { - return class extends errorType { - constructor(...args) { - super(messageCreator(...args)); - this.code = code; - this.name = `${errorType.name} [${code}]`; - } - }; -} -const ERR_PACKAGE_IMPORT_NOT_DEFINED = createErrorType( - `ERR_PACKAGE_IMPORT_NOT_DEFINED`, - (specifier, packagePath, base) => { - return `Package import specifier "${specifier}" is not defined${packagePath ? ` in package ${packagePath}package.json` : ``} imported from ${base}`; - }, - TypeError -); -const ERR_INVALID_MODULE_SPECIFIER = createErrorType( - `ERR_INVALID_MODULE_SPECIFIER`, - (request, reason, base = void 0) => { - return `Invalid module "${request}" ${reason}${base ? ` imported from ${base}` : ``}`; - }, - TypeError -); -const ERR_INVALID_PACKAGE_TARGET = createErrorType( - `ERR_INVALID_PACKAGE_TARGET`, - (pkgPath, key, target, isImport = false, base = void 0) => { - const relError = typeof target === `string` && !isImport && target.length && !StringPrototypeStartsWith(target, `./`); - if (key === `.`) { - assert__default.default(isImport === false); - return `Invalid "exports" main target ${JSONStringify(target)} defined in the package config ${pkgPath}package.json${base ? ` imported from ${base}` : ``}${relError ? `; targets must start with "./"` : ``}`; - } - return `Invalid "${isImport ? `imports` : `exports`}" target ${JSONStringify( - target - )} defined for '${key}' in the package config ${pkgPath}package.json${base ? ` imported from ${base}` : ``}${relError ? `; targets must start with "./"` : ``}`; - }, - Error -); -const ERR_INVALID_PACKAGE_CONFIG = createErrorType( - `ERR_INVALID_PACKAGE_CONFIG`, - (path, base, message) => { - return `Invalid package config ${path}${base ? ` while importing ${base}` : ``}${message ? `. ${message}` : ``}`; - }, - Error -); -const ERR_PACKAGE_PATH_NOT_EXPORTED = createErrorType( - "ERR_PACKAGE_PATH_NOT_EXPORTED", - (pkgPath, subpath, base = void 0) => { - if (subpath === ".") - return `No "exports" main defined in ${pkgPath}package.json${base ? ` imported from ${base}` : ""}`; - return `Package subpath '${subpath}' is not defined by "exports" in ${pkgPath}package.json${base ? ` imported from ${base}` : ""}`; - }, - Error -); - -function filterOwnProperties(source, keys) { - const filtered = /* @__PURE__ */ Object.create(null); - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - if (ObjectPrototypeHasOwnProperty(source, key)) { - filtered[key] = source[key]; - } - } - return filtered; -} - -const packageJSONCache = new SafeMap(); -function getPackageConfig(path, specifier, base, readFileSyncFn) { - const existing = packageJSONCache.get(path); - if (existing !== void 0) { - return existing; - } - const source = readFileSyncFn(path); - if (source === void 0) { - const packageConfig2 = { - pjsonPath: path, - exists: false, - main: void 0, - name: void 0, - type: "none", - exports: void 0, - imports: void 0 - }; - packageJSONCache.set(path, packageConfig2); - return packageConfig2; - } - let packageJSON; - try { - packageJSON = JSONParse(source); - } catch (error) { - throw new ERR_INVALID_PACKAGE_CONFIG( - path, - (base ? `"${specifier}" from ` : "") + url.fileURLToPath(base || specifier), - error.message - ); - } - let { imports, main, name, type } = filterOwnProperties(packageJSON, [ - "imports", - "main", - "name", - "type" - ]); - const exports = ObjectPrototypeHasOwnProperty(packageJSON, "exports") ? packageJSON.exports : void 0; - if (typeof imports !== "object" || imports === null) { - imports = void 0; - } - if (typeof main !== "string") { - main = void 0; - } - if (typeof name !== "string") { - name = void 0; - } - if (type !== "module" && type !== "commonjs") { - type = "none"; - } - const packageConfig = { - pjsonPath: path, - exists: true, - main, - name, - type, - exports, - imports - }; - packageJSONCache.set(path, packageConfig); - return packageConfig; -} -function getPackageScopeConfig(resolved, readFileSyncFn) { - let packageJSONUrl = new URL("./package.json", resolved); - while (true) { - const packageJSONPath2 = packageJSONUrl.pathname; - if (StringPrototypeEndsWith(packageJSONPath2, "node_modules/package.json")) { - break; - } - const packageConfig2 = getPackageConfig( - url.fileURLToPath(packageJSONUrl), - resolved, - void 0, - readFileSyncFn - ); - if (packageConfig2.exists) { - return packageConfig2; - } - const lastPackageJSONUrl = packageJSONUrl; - packageJSONUrl = new URL("../package.json", packageJSONUrl); - if (packageJSONUrl.pathname === lastPackageJSONUrl.pathname) { - break; - } - } - const packageJSONPath = url.fileURLToPath(packageJSONUrl); - const packageConfig = { - pjsonPath: packageJSONPath, - exists: false, - main: void 0, - name: void 0, - type: "none", - exports: void 0, - imports: void 0 - }; - packageJSONCache.set(packageJSONPath, packageConfig); - return packageConfig; -} - -function throwImportNotDefined(specifier, packageJSONUrl, base) { - throw new ERR_PACKAGE_IMPORT_NOT_DEFINED( - specifier, - packageJSONUrl && url.fileURLToPath(new URL(".", packageJSONUrl)), - url.fileURLToPath(base) - ); -} -function throwInvalidSubpath(subpath, packageJSONUrl, internal, base) { - const reason = `request is not a valid subpath for the "${internal ? "imports" : "exports"}" resolution of ${url.fileURLToPath(packageJSONUrl)}`; - throw new ERR_INVALID_MODULE_SPECIFIER( - subpath, - reason, - base && url.fileURLToPath(base) - ); -} -function throwInvalidPackageTarget(subpath, target, packageJSONUrl, internal, base) { - if (typeof target === "object" && target !== null) { - target = JSONStringify(target, null, ""); - } else { - target = `${target}`; - } - throw new ERR_INVALID_PACKAGE_TARGET( - url.fileURLToPath(new URL(".", packageJSONUrl)), - subpath, - target, - internal, - base && url.fileURLToPath(base) - ); -} -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; -const patternRegEx = /\*/g; -function resolvePackageTargetString(target, subpath, match, packageJSONUrl, base, pattern, internal, conditions) { - if (subpath !== "" && !pattern && target[target.length - 1] !== "/") - throwInvalidPackageTarget(match, target, packageJSONUrl, internal, base); - if (!StringPrototypeStartsWith(target, "./")) { - if (internal && !StringPrototypeStartsWith(target, "../") && !StringPrototypeStartsWith(target, "/")) { - let isURL = false; - try { - new URL(target); - isURL = true; - } catch { - } - if (!isURL) { - const exportTarget = pattern ? RegExpPrototypeSymbolReplace(patternRegEx, target, () => subpath) : target + subpath; - return exportTarget; - } - } - throwInvalidPackageTarget(match, target, packageJSONUrl, internal, base); - } - if (RegExpPrototypeExec( - invalidSegmentRegEx, - StringPrototypeSlice(target, 2) - ) !== null) - throwInvalidPackageTarget(match, target, packageJSONUrl, internal, base); - const resolved = new URL(target, packageJSONUrl); - const resolvedPath = resolved.pathname; - const packagePath = new URL(".", packageJSONUrl).pathname; - if (!StringPrototypeStartsWith(resolvedPath, packagePath)) - throwInvalidPackageTarget(match, target, packageJSONUrl, internal, base); - if (subpath === "") - return resolved; - if (RegExpPrototypeExec(invalidSegmentRegEx, subpath) !== null) { - const request = pattern ? StringPrototypeReplace(match, "*", () => subpath) : match + subpath; - throwInvalidSubpath(request, packageJSONUrl, internal, base); - } - if (pattern) { - return new URL( - RegExpPrototypeSymbolReplace(patternRegEx, resolved.href, () => subpath) - ); - } - return new URL(subpath, resolved); -} -function isArrayIndex(key) { - const keyNum = +key; - if (`${keyNum}` !== key) - return false; - return keyNum >= 0 && keyNum < 4294967295; -} -function resolvePackageTarget(packageJSONUrl, target, subpath, packageSubpath, base, pattern, internal, conditions) { - if (typeof target === "string") { - return resolvePackageTargetString( - target, - subpath, - packageSubpath, - packageJSONUrl, - base, - pattern, - internal); - } else if (ArrayIsArray(target)) { - if (target.length === 0) { - return null; - } - let lastException; - for (let i = 0; i < target.length; i++) { - const targetItem = target[i]; - let resolveResult; - try { - resolveResult = resolvePackageTarget( - packageJSONUrl, - targetItem, - subpath, - packageSubpath, - base, - pattern, - internal, - conditions - ); - } catch (e) { - lastException = e; - if (e.code === "ERR_INVALID_PACKAGE_TARGET") { - continue; - } - throw e; - } - if (resolveResult === void 0) { - continue; - } - if (resolveResult === null) { - lastException = null; - continue; - } - return resolveResult; - } - if (lastException === void 0 || lastException === null) - return lastException; - throw lastException; - } else if (typeof target === "object" && target !== null) { - const keys = ObjectGetOwnPropertyNames(target); - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - if (isArrayIndex(key)) { - throw new ERR_INVALID_PACKAGE_CONFIG( - url.fileURLToPath(packageJSONUrl), - base, - '"exports" cannot contain numeric property keys.' - ); - } - } - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - if (key === "default" || conditions.has(key)) { - const conditionalTarget = target[key]; - const resolveResult = resolvePackageTarget( - packageJSONUrl, - conditionalTarget, - subpath, - packageSubpath, - base, - pattern, - internal, - conditions - ); - if (resolveResult === void 0) - continue; - return resolveResult; - } - } - return void 0; - } else if (target === null) { - return null; - } - throwInvalidPackageTarget( - packageSubpath, - target, - packageJSONUrl, - internal, - base - ); -} -function patternKeyCompare(a, b) { - const aPatternIndex = StringPrototypeIndexOf(a, "*"); - const bPatternIndex = StringPrototypeIndexOf(b, "*"); - 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; -} -function isConditionalExportsMainSugar(exports, packageJSONUrl, base) { - if (typeof exports === "string" || ArrayIsArray(exports)) - return true; - if (typeof exports !== "object" || exports === null) - return false; - const keys = ObjectGetOwnPropertyNames(exports); - let isConditionalSugar = false; - let i = 0; - for (let j = 0; j < keys.length; j++) { - const key = keys[j]; - const curIsConditionalSugar = key === "" || key[0] !== "."; - if (i++ === 0) { - isConditionalSugar = curIsConditionalSugar; - } else if (isConditionalSugar !== curIsConditionalSugar) { - throw new ERR_INVALID_PACKAGE_CONFIG( - url.fileURLToPath(packageJSONUrl), - base, - `"exports" cannot contain some keys starting with '.' and some not. The exports object must either be an object of package subpath keys or an object of main entry condition name keys only.` - ); - } - } - return isConditionalSugar; -} -function throwExportsNotFound(subpath, packageJSONUrl, base) { - throw new ERR_PACKAGE_PATH_NOT_EXPORTED( - url.fileURLToPath(new URL(".", packageJSONUrl)), - subpath, - base && url.fileURLToPath(base) - ); -} -const emittedPackageWarnings = /* @__PURE__ */ new Set(); -function emitTrailingSlashPatternDeprecation(match, pjsonUrl, base) { - const pjsonPath = url.fileURLToPath(pjsonUrl); - if (emittedPackageWarnings.has(pjsonPath + "|" + match)) - return; - emittedPackageWarnings.add(pjsonPath + "|" + match); - process.emitWarning( - `Use of deprecated trailing slash pattern mapping "${match}" in the "exports" field module resolution of the package at ${pjsonPath}${base ? ` imported from ${url.fileURLToPath(base)}` : ""}. Mapping specifiers ending in "/" is no longer supported.`, - "DeprecationWarning", - "DEP0155" - ); -} -function packageExportsResolve({ - packageJSONUrl, - packageSubpath, - exports, - base, - conditions -}) { - if (isConditionalExportsMainSugar(exports, packageJSONUrl, base)) - exports = { ".": exports }; - if (ObjectPrototypeHasOwnProperty(exports, packageSubpath) && !StringPrototypeIncludes(packageSubpath, "*") && !StringPrototypeEndsWith(packageSubpath, "/")) { - const target = exports[packageSubpath]; - const resolveResult = resolvePackageTarget( - packageJSONUrl, - target, - "", - packageSubpath, - base, - false, - false, - conditions - ); - if (resolveResult == null) { - throwExportsNotFound(packageSubpath, packageJSONUrl, base); - } - return resolveResult; - } - let bestMatch = ""; - let bestMatchSubpath; - const keys = ObjectGetOwnPropertyNames(exports); - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - const patternIndex = StringPrototypeIndexOf(key, "*"); - if (patternIndex !== -1 && StringPrototypeStartsWith( - packageSubpath, - StringPrototypeSlice(key, 0, patternIndex) - )) { - if (StringPrototypeEndsWith(packageSubpath, "/")) - emitTrailingSlashPatternDeprecation( - packageSubpath, - packageJSONUrl, - base - ); - const patternTrailer = StringPrototypeSlice(key, patternIndex + 1); - if (packageSubpath.length >= key.length && StringPrototypeEndsWith(packageSubpath, patternTrailer) && patternKeyCompare(bestMatch, key) === 1 && StringPrototypeLastIndexOf(key, "*") === patternIndex) { - bestMatch = key; - bestMatchSubpath = StringPrototypeSlice( - packageSubpath, - patternIndex, - packageSubpath.length - patternTrailer.length - ); - } - } - } - if (bestMatch) { - const target = exports[bestMatch]; - const resolveResult = resolvePackageTarget( - packageJSONUrl, - target, - bestMatchSubpath, - bestMatch, - base, - true, - false, - conditions - ); - if (resolveResult == null) { - throwExportsNotFound(packageSubpath, packageJSONUrl, base); - } - return resolveResult; - } - throwExportsNotFound(packageSubpath, packageJSONUrl, base); -} -function packageImportsResolve({ name, base, conditions, readFileSyncFn }) { - if (name === "#" || StringPrototypeStartsWith(name, "#/") || StringPrototypeEndsWith(name, "/")) { - const reason = "is not a valid internal imports specifier name"; - throw new ERR_INVALID_MODULE_SPECIFIER(name, reason, url.fileURLToPath(base)); - } - let packageJSONUrl; - const packageConfig = getPackageScopeConfig(base, readFileSyncFn); - if (packageConfig.exists) { - packageJSONUrl = url.pathToFileURL(packageConfig.pjsonPath); - const imports = packageConfig.imports; - if (imports) { - if (ObjectPrototypeHasOwnProperty(imports, name) && !StringPrototypeIncludes(name, "*")) { - const resolveResult = resolvePackageTarget( - packageJSONUrl, - imports[name], - "", - name, - base, - false, - true, - conditions - ); - if (resolveResult != null) { - return resolveResult; - } - } else { - let bestMatch = ""; - let bestMatchSubpath; - const keys = ObjectGetOwnPropertyNames(imports); - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - const patternIndex = StringPrototypeIndexOf(key, "*"); - if (patternIndex !== -1 && StringPrototypeStartsWith( - name, - StringPrototypeSlice(key, 0, patternIndex) - )) { - const patternTrailer = StringPrototypeSlice(key, patternIndex + 1); - if (name.length >= key.length && StringPrototypeEndsWith(name, patternTrailer) && patternKeyCompare(bestMatch, key) === 1 && StringPrototypeLastIndexOf(key, "*") === patternIndex) { - bestMatch = key; - bestMatchSubpath = StringPrototypeSlice( - name, - patternIndex, - name.length - patternTrailer.length - ); - } - } - } - if (bestMatch) { - const target = imports[bestMatch]; - const resolveResult = resolvePackageTarget( - packageJSONUrl, - target, - bestMatchSubpath, - bestMatch, - base, - true, - true, - conditions - ); - if (resolveResult != null) { - return resolveResult; - } - } - } - } - } - throwImportNotDefined(name, packageJSONUrl, base); -} - -const flagSymbol = Symbol('arg flag'); - -class ArgError extends Error { - constructor(msg, code) { - super(msg); - this.name = 'ArgError'; - this.code = code; - - Object.setPrototypeOf(this, ArgError.prototype); - } -} - -function arg( - opts, - { - argv = process.argv.slice(2), - permissive = false, - stopAtPositional = false - } = {} -) { - if (!opts) { - throw new ArgError( - 'argument specification object is required', - 'ARG_CONFIG_NO_SPEC' - ); - } - - const result = { _: [] }; - - const aliases = {}; - const handlers = {}; - - for (const key of Object.keys(opts)) { - if (!key) { - throw new ArgError( - 'argument key cannot be an empty string', - 'ARG_CONFIG_EMPTY_KEY' - ); - } - - if (key[0] !== '-') { - throw new ArgError( - `argument key must start with '-' but found: '${key}'`, - 'ARG_CONFIG_NONOPT_KEY' - ); - } - - if (key.length === 1) { - throw new ArgError( - `argument key must have a name; singular '-' keys are not allowed: ${key}`, - 'ARG_CONFIG_NONAME_KEY' - ); - } - - if (typeof opts[key] === 'string') { - aliases[key] = opts[key]; - continue; - } - - let type = opts[key]; - let isFlag = false; - - if ( - Array.isArray(type) && - type.length === 1 && - typeof type[0] === 'function' - ) { - const [fn] = type; - type = (value, name, prev = []) => { - prev.push(fn(value, name, prev[prev.length - 1])); - return prev; - }; - isFlag = fn === Boolean || fn[flagSymbol] === true; - } else if (typeof type === 'function') { - isFlag = type === Boolean || type[flagSymbol] === true; - } else { - throw new ArgError( - `type missing or not a function or valid array type: ${key}`, - 'ARG_CONFIG_VAD_TYPE' - ); - } - - if (key[1] !== '-' && key.length > 2) { - throw new ArgError( - `short argument keys (with a single hyphen) must have only one character: ${key}`, - 'ARG_CONFIG_SHORTOPT_TOOLONG' - ); - } - - handlers[key] = [type, isFlag]; - } - - for (let i = 0, len = argv.length; i < len; i++) { - const wholeArg = argv[i]; - - if (stopAtPositional && result._.length > 0) { - result._ = result._.concat(argv.slice(i)); - break; - } - - if (wholeArg === '--') { - result._ = result._.concat(argv.slice(i + 1)); - break; - } - - if (wholeArg.length > 1 && wholeArg[0] === '-') { - /* eslint-disable operator-linebreak */ - const separatedArguments = - wholeArg[1] === '-' || wholeArg.length === 2 - ? [wholeArg] - : wholeArg - .slice(1) - .split('') - .map((a) => `-${a}`); - /* eslint-enable operator-linebreak */ - - for (let j = 0; j < separatedArguments.length; j++) { - const arg = separatedArguments[j]; - const [originalArgName, argStr] = - arg[1] === '-' ? arg.split(/=(.*)/, 2) : [arg, undefined]; - - let argName = originalArgName; - while (argName in aliases) { - argName = aliases[argName]; - } - - if (!(argName in handlers)) { - if (permissive) { - result._.push(arg); - continue; - } else { - throw new ArgError( - `unknown or unexpected option: ${originalArgName}`, - 'ARG_UNKNOWN_OPTION' - ); - } - } - - const [type, isFlag] = handlers[argName]; - - if (!isFlag && j + 1 < separatedArguments.length) { - throw new ArgError( - `option requires argument (but was followed by another short argument): ${originalArgName}`, - 'ARG_MISSING_REQUIRED_SHORTARG' - ); - } - - if (isFlag) { - result[argName] = type(true, argName, result[argName]); - } else if (argStr === undefined) { - if ( - argv.length < i + 2 || - (argv[i + 1].length > 1 && - argv[i + 1][0] === '-' && - !( - argv[i + 1].match(/^-?\d*(\.(?=\d))?\d*$/) && - (type === Number || - // eslint-disable-next-line no-undef - (typeof BigInt !== 'undefined' && type === BigInt)) - )) - ) { - const extended = - originalArgName === argName ? '' : ` (alias for ${argName})`; - throw new ArgError( - `option requires argument: ${originalArgName}${extended}`, - 'ARG_MISSING_REQUIRED_LONGARG' - ); - } - - result[argName] = type(argv[i + 1], argName, result[argName]); - ++i; - } else { - result[argName] = type(argStr, argName, result[argName]); - } - } - } else { - result._.push(wholeArg); - } - } - - return result; -} - -arg.flag = (fn) => { - fn[flagSymbol] = true; - return fn; -}; - -// Utility types -arg.COUNT = arg.flag((v, name, existingCount) => (existingCount || 0) + 1); - -// Expose error class -arg.ArgError = ArgError; - -var arg_1 = arg; - -/** - @license - The MIT License (MIT) - - Copyright (c) 2014 Blake Embrey (hello@blakeembrey.com) - - 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. -*/ -function getOptionValue(opt) { - parseOptions(); - return options[opt]; -} -let options; -function parseOptions() { - if (!options) { - options = { - "--conditions": [], - ...parseArgv(getNodeOptionsEnvArgv()), - ...parseArgv(process.execArgv) - }; - } -} -function parseArgv(argv) { - return arg_1( - { - "--conditions": [String], - "-C": "--conditions" - }, - { - argv, - permissive: true - } - ); -} -function getNodeOptionsEnvArgv() { - const errors = []; - const envArgv = ParseNodeOptionsEnvVar(process.env.NODE_OPTIONS || "", errors); - if (errors.length !== 0) ; - return envArgv; -} -function ParseNodeOptionsEnvVar(node_options, errors) { - const env_argv = []; - let is_in_string = false; - let will_start_new_arg = true; - for (let index = 0; index < node_options.length; ++index) { - let c = node_options[index]; - if (c === "\\" && is_in_string) { - if (index + 1 === node_options.length) { - errors.push("invalid value for NODE_OPTIONS (invalid escape)\n"); - return env_argv; - } else { - c = node_options[++index]; - } - } else if (c === " " && !is_in_string) { - will_start_new_arg = true; - continue; - } else if (c === '"') { - is_in_string = !is_in_string; - continue; - } - if (will_start_new_arg) { - env_argv.push(c); - will_start_new_arg = false; - } else { - env_argv[env_argv.length - 1] += c; - } - } - if (is_in_string) { - errors.push("invalid value for NODE_OPTIONS (unterminated string)\n"); - } - return env_argv; -} - -function makeApi(runtimeState, opts) { - const alwaysWarnOnFallback = Number(process.env.PNP_ALWAYS_WARN_ON_FALLBACK) > 0; - const debugLevel = Number(process.env.PNP_DEBUG_LEVEL); - const pathRegExp = /^(?![a-zA-Z]:[\\/]|\\\\|\.{0,2}(?:\/|$))((?:node:)?(?:@[^/]+\/)?[^/]+)\/*(.*|)$/; - const isStrictRegExp = /^(\/|\.{1,2}(\/|$))/; - const isDirRegExp = /\/$/; - const isRelativeRegexp = /^\.{0,2}\//; - const topLevelLocator = { name: null, reference: null }; - const fallbackLocators = []; - const emittedWarnings = /* @__PURE__ */ new Set(); - if (runtimeState.enableTopLevelFallback === true) - fallbackLocators.push(topLevelLocator); - if (opts.compatibilityMode !== false) { - for (const name of [`react-scripts`, `gatsby`]) { - const packageStore = runtimeState.packageRegistry.get(name); - if (packageStore) { - for (const reference of packageStore.keys()) { - if (reference === null) { - throw new Error(`Assertion failed: This reference shouldn't be null`); - } else { - fallbackLocators.push({ name, reference }); - } - } - } - } - } - const { - ignorePattern, - packageRegistry, - packageLocatorsByLocations - } = runtimeState; - function makeLogEntry(name, args) { - return { - fn: name, - args, - error: null, - result: null - }; - } - function trace(entry) { - const colors = process.stderr?.hasColors?.() ?? process.stdout.isTTY; - const c = (n, str) => `\x1B[${n}m${str}\x1B[0m`; - const error = entry.error; - if (error) - console.error(c(`31;1`, `\u2716 ${entry.error?.message.replace(/\n.*/s, ``)}`)); - else - console.error(c(`33;1`, `\u203C Resolution`)); - if (entry.args.length > 0) - console.error(); - for (const arg of entry.args) - console.error(` ${c(`37;1`, `In \u2190`)} ${nodeUtils.inspect(arg, { colors, compact: true })}`); - if (entry.result) { - console.error(); - console.error(` ${c(`37;1`, `Out \u2192`)} ${nodeUtils.inspect(entry.result, { colors, compact: true })}`); - } - const stack = new Error().stack.match(/(?<=^ +)at.*/gm)?.slice(2) ?? []; - if (stack.length > 0) { - console.error(); - for (const line of stack) { - console.error(` ${c(`38;5;244`, line)}`); - } - } - console.error(); - } - function maybeLog(name, fn) { - if (opts.allowDebug === false) - return fn; - if (Number.isFinite(debugLevel)) { - if (debugLevel >= 2) { - return (...args) => { - const logEntry = makeLogEntry(name, args); - try { - return logEntry.result = fn(...args); - } catch (error) { - throw logEntry.error = error; - } finally { - trace(logEntry); - } - }; - } else if (debugLevel >= 1) { - return (...args) => { - try { - return fn(...args); - } catch (error) { - const logEntry = makeLogEntry(name, args); - logEntry.error = error; - trace(logEntry); - throw error; - } - }; - } - } - return fn; - } - function getPackageInformationSafe(packageLocator) { - const packageInformation = getPackageInformation(packageLocator); - if (!packageInformation) { - throw makeError( - ErrorCode.INTERNAL, - `Couldn't find a matching entry in the dependency tree for the specified parent (this is probably an internal error)` - ); - } - return packageInformation; - } - function isDependencyTreeRoot(packageLocator) { - if (packageLocator.name === null) - return true; - for (const dependencyTreeRoot of runtimeState.dependencyTreeRoots) - if (dependencyTreeRoot.name === packageLocator.name && dependencyTreeRoot.reference === packageLocator.reference) - return true; - return false; - } - const defaultExportsConditions = /* @__PURE__ */ new Set([ - `node`, - `require`, - ...getOptionValue(`--conditions`) - ]); - function applyNodeExportsResolution(unqualifiedPath, conditions = defaultExportsConditions, issuer) { - const locator = findPackageLocator(ppath.join(unqualifiedPath, `internal.js`), { - resolveIgnored: true, - includeDiscardFromLookup: true - }); - if (locator === null) { - throw makeError( - ErrorCode.INTERNAL, - `The locator that owns the "${unqualifiedPath}" path can't be found inside the dependency tree (this is probably an internal error)` - ); - } - const { packageLocation } = getPackageInformationSafe(locator); - const manifestPath = ppath.join(packageLocation, Filename.manifest); - if (!opts.fakeFs.existsSync(manifestPath)) - return null; - const pkgJson = JSON.parse(opts.fakeFs.readFileSync(manifestPath, `utf8`)); - if (pkgJson.exports == null) - return null; - let subpath = ppath.contains(packageLocation, unqualifiedPath); - if (subpath === null) { - throw makeError( - ErrorCode.INTERNAL, - `unqualifiedPath doesn't contain the packageLocation (this is probably an internal error)` - ); - } - if (subpath !== `.` && !isRelativeRegexp.test(subpath)) - subpath = `./${subpath}`; - try { - const resolvedExport = packageExportsResolve({ - packageJSONUrl: url.pathToFileURL(npath.fromPortablePath(manifestPath)), - packageSubpath: subpath, - exports: pkgJson.exports, - base: issuer ? url.pathToFileURL(npath.fromPortablePath(issuer)) : null, - conditions - }); - return npath.toPortablePath(url.fileURLToPath(resolvedExport)); - } catch (error) { - throw makeError( - ErrorCode.EXPORTS_RESOLUTION_FAILED, - error.message, - { unqualifiedPath: getPathForDisplay(unqualifiedPath), locator, pkgJson, subpath: getPathForDisplay(subpath), conditions }, - error.code - ); - } - } - function applyNodeExtensionResolution(unqualifiedPath, candidates, { extensions }) { - let stat; - try { - candidates.push(unqualifiedPath); - stat = opts.fakeFs.statSync(unqualifiedPath); - } catch (error) { - } - if (stat && !stat.isDirectory()) - return opts.fakeFs.realpathSync(unqualifiedPath); - if (stat && stat.isDirectory()) { - let pkgJson; - try { - pkgJson = JSON.parse(opts.fakeFs.readFileSync(ppath.join(unqualifiedPath, Filename.manifest), `utf8`)); - } catch (error) { - } - let nextUnqualifiedPath; - if (pkgJson && pkgJson.main) - nextUnqualifiedPath = ppath.resolve(unqualifiedPath, pkgJson.main); - if (nextUnqualifiedPath && nextUnqualifiedPath !== unqualifiedPath) { - const resolution = applyNodeExtensionResolution(nextUnqualifiedPath, candidates, { extensions }); - if (resolution !== null) { - return resolution; - } - } - } - for (let i = 0, length = extensions.length; i < length; i++) { - const candidateFile = `${unqualifiedPath}${extensions[i]}`; - candidates.push(candidateFile); - if (opts.fakeFs.existsSync(candidateFile)) { - return candidateFile; - } - } - if (stat && stat.isDirectory()) { - for (let i = 0, length = extensions.length; i < length; i++) { - const candidateFile = ppath.format({ dir: unqualifiedPath, name: `index`, ext: extensions[i] }); - candidates.push(candidateFile); - if (opts.fakeFs.existsSync(candidateFile)) { - return candidateFile; - } - } - } - return null; - } - function makeFakeModule(path) { - const fakeModule = new require$$0.Module(path, null); - fakeModule.filename = path; - fakeModule.paths = require$$0.Module._nodeModulePaths(path); - return fakeModule; - } - function callNativeResolution(request, issuer) { - if (issuer.endsWith(`/`)) - issuer = ppath.join(issuer, `internal.js`); - return require$$0.Module._resolveFilename(npath.fromPortablePath(request), makeFakeModule(npath.fromPortablePath(issuer)), false, { plugnplay: false }); - } - function isPathIgnored(path) { - if (ignorePattern === null) - return false; - const subPath = ppath.contains(runtimeState.basePath, path); - if (subPath === null) - return false; - if (ignorePattern.test(subPath.replace(/\/$/, ``))) { - return true; - } else { - return false; - } - } - const VERSIONS = { std: 3, resolveVirtual: 1, getAllLocators: 1 }; - const topLevel = topLevelLocator; - function getPackageInformation({ name, reference }) { - const packageInformationStore = packageRegistry.get(name); - if (!packageInformationStore) - return null; - const packageInformation = packageInformationStore.get(reference); - if (!packageInformation) - return null; - return packageInformation; - } - function findPackageDependents({ name, reference }) { - const dependents = []; - for (const [dependentName, packageInformationStore] of packageRegistry) { - if (dependentName === null) - continue; - for (const [dependentReference, packageInformation] of packageInformationStore) { - if (dependentReference === null) - continue; - const dependencyReference = packageInformation.packageDependencies.get(name); - if (dependencyReference !== reference) - continue; - if (dependentName === name && dependentReference === reference) - continue; - dependents.push({ - name: dependentName, - reference: dependentReference - }); - } - } - return dependents; - } - function findBrokenPeerDependencies(dependency, initialPackage) { - const brokenPackages = /* @__PURE__ */ new Map(); - const alreadyVisited = /* @__PURE__ */ new Set(); - const traversal = (currentPackage) => { - const identifier = JSON.stringify(currentPackage.name); - if (alreadyVisited.has(identifier)) - return; - alreadyVisited.add(identifier); - const dependents = findPackageDependents(currentPackage); - for (const dependent of dependents) { - const dependentInformation = getPackageInformationSafe(dependent); - if (dependentInformation.packagePeers.has(dependency)) { - traversal(dependent); - } else { - let brokenSet = brokenPackages.get(dependent.name); - if (typeof brokenSet === `undefined`) - brokenPackages.set(dependent.name, brokenSet = /* @__PURE__ */ new Set()); - brokenSet.add(dependent.reference); - } - } - }; - traversal(initialPackage); - const brokenList = []; - for (const name of [...brokenPackages.keys()].sort()) - for (const reference of [...brokenPackages.get(name)].sort()) - brokenList.push({ name, reference }); - return brokenList; - } - function findPackageLocator(location, { resolveIgnored = false, includeDiscardFromLookup = false } = {}) { - if (isPathIgnored(location) && !resolveIgnored) - return null; - let relativeLocation = ppath.relative(runtimeState.basePath, location); - if (!relativeLocation.match(isStrictRegExp)) - relativeLocation = `./${relativeLocation}`; - if (!relativeLocation.endsWith(`/`)) - relativeLocation = `${relativeLocation}/`; - do { - const entry = packageLocatorsByLocations.get(relativeLocation); - if (typeof entry === `undefined` || entry.discardFromLookup && !includeDiscardFromLookup) { - relativeLocation = relativeLocation.substring(0, relativeLocation.lastIndexOf(`/`, relativeLocation.length - 2) + 1); - continue; - } - return entry.locator; - } while (relativeLocation !== ``); - return null; - } - function tryReadFile(filePath) { - try { - return opts.fakeFs.readFileSync(npath.toPortablePath(filePath), `utf8`); - } catch (err) { - if (err.code === `ENOENT`) - return void 0; - throw err; - } - } - function resolveToUnqualified(request, issuer, { considerBuiltins = true } = {}) { - if (request.startsWith(`#`)) - throw new Error(`resolveToUnqualified can not handle private import mappings`); - if (request === `pnpapi`) - return npath.toPortablePath(opts.pnpapiResolution); - if (considerBuiltins && require$$0.isBuiltin(request)) - return null; - const requestForDisplay = getPathForDisplay(request); - const issuerForDisplay = issuer && getPathForDisplay(issuer); - if (issuer && isPathIgnored(issuer)) { - if (!ppath.isAbsolute(request) || findPackageLocator(request) === null) { - const result = callNativeResolution(request, issuer); - if (result === false) { - throw makeError( - ErrorCode.BUILTIN_NODE_RESOLUTION_FAILED, - `The builtin node resolution algorithm was unable to resolve the requested module (it didn't go through the pnp resolver because the issuer was explicitely ignored by the regexp) - -Require request: "${requestForDisplay}" -Required by: ${issuerForDisplay} -`, - { request: requestForDisplay, issuer: issuerForDisplay } - ); - } - return npath.toPortablePath(result); - } - } - let unqualifiedPath; - const dependencyNameMatch = request.match(pathRegExp); - if (!dependencyNameMatch) { - if (ppath.isAbsolute(request)) { - unqualifiedPath = ppath.normalize(request); - } else { - if (!issuer) { - throw makeError( - ErrorCode.API_ERROR, - `The resolveToUnqualified function must be called with a valid issuer when the path isn't a builtin nor absolute`, - { request: requestForDisplay, issuer: issuerForDisplay } - ); - } - const absoluteIssuer = ppath.resolve(issuer); - if (issuer.match(isDirRegExp)) { - unqualifiedPath = ppath.normalize(ppath.join(absoluteIssuer, request)); - } else { - unqualifiedPath = ppath.normalize(ppath.join(ppath.dirname(absoluteIssuer), request)); - } - } - } else { - if (!issuer) { - throw makeError( - ErrorCode.API_ERROR, - `The resolveToUnqualified function must be called with a valid issuer when the path isn't a builtin nor absolute`, - { request: requestForDisplay, issuer: issuerForDisplay } - ); - } - const [, dependencyName, subPath] = dependencyNameMatch; - const issuerLocator = findPackageLocator(issuer); - if (!issuerLocator) { - const result = callNativeResolution(request, issuer); - if (result === false) { - throw makeError( - ErrorCode.BUILTIN_NODE_RESOLUTION_FAILED, - `The builtin node resolution algorithm was unable to resolve the requested module (it didn't go through the pnp resolver because the issuer doesn't seem to be part of the Yarn-managed dependency tree). - -Require path: "${requestForDisplay}" -Required by: ${issuerForDisplay} -`, - { request: requestForDisplay, issuer: issuerForDisplay } - ); - } - return npath.toPortablePath(result); - } - const issuerInformation = getPackageInformationSafe(issuerLocator); - let dependencyReference = issuerInformation.packageDependencies.get(dependencyName); - let fallbackReference = null; - if (dependencyReference == null) { - if (issuerLocator.name !== null) { - const exclusionEntry = runtimeState.fallbackExclusionList.get(issuerLocator.name); - const canUseFallbacks = !exclusionEntry || !exclusionEntry.has(issuerLocator.reference); - if (canUseFallbacks) { - for (let t = 0, T = fallbackLocators.length; t < T; ++t) { - const fallbackInformation = getPackageInformationSafe(fallbackLocators[t]); - const reference = fallbackInformation.packageDependencies.get(dependencyName); - if (reference == null) - continue; - if (alwaysWarnOnFallback) - fallbackReference = reference; - else - dependencyReference = reference; - break; - } - if (runtimeState.enableTopLevelFallback) { - if (dependencyReference == null && fallbackReference === null) { - const reference = runtimeState.fallbackPool.get(dependencyName); - if (reference != null) { - fallbackReference = reference; - } - } - } - } - } - } - let error = null; - if (dependencyReference === null) { - if (isDependencyTreeRoot(issuerLocator)) { - error = makeError( - ErrorCode.MISSING_PEER_DEPENDENCY, - `Your application tried to access ${dependencyName} (a peer dependency); this isn't allowed as there is no ancestor to satisfy the requirement. Use a devDependency if needed. - -Required package: ${dependencyName}${dependencyName !== requestForDisplay ? ` (via "${requestForDisplay}")` : ``} -Required by: ${issuerForDisplay} -`, - { request: requestForDisplay, issuer: issuerForDisplay, dependencyName } - ); - } else { - const brokenAncestors = findBrokenPeerDependencies(dependencyName, issuerLocator); - if (brokenAncestors.every((ancestor) => isDependencyTreeRoot(ancestor))) { - error = makeError( - ErrorCode.MISSING_PEER_DEPENDENCY, - `${issuerLocator.name} tried to access ${dependencyName} (a peer dependency) but it isn't provided by your application; this makes the require call ambiguous and unsound. - -Required package: ${dependencyName}${dependencyName !== requestForDisplay ? ` (via "${requestForDisplay}")` : ``} -Required by: ${issuerLocator.name}@${issuerLocator.reference} (via ${issuerForDisplay}) -${brokenAncestors.map((ancestorLocator) => `Ancestor breaking the chain: ${ancestorLocator.name}@${ancestorLocator.reference} -`).join(``)} -`, - { request: requestForDisplay, issuer: issuerForDisplay, issuerLocator: Object.assign({}, issuerLocator), dependencyName, brokenAncestors } - ); - } else { - error = makeError( - ErrorCode.MISSING_PEER_DEPENDENCY, - `${issuerLocator.name} tried to access ${dependencyName} (a peer dependency) but it isn't provided by its ancestors; this makes the require call ambiguous and unsound. - -Required package: ${dependencyName}${dependencyName !== requestForDisplay ? ` (via "${requestForDisplay}")` : ``} -Required by: ${issuerLocator.name}@${issuerLocator.reference} (via ${issuerForDisplay}) - -${brokenAncestors.map((ancestorLocator) => `Ancestor breaking the chain: ${ancestorLocator.name}@${ancestorLocator.reference} -`).join(``)} -`, - { request: requestForDisplay, issuer: issuerForDisplay, issuerLocator: Object.assign({}, issuerLocator), dependencyName, brokenAncestors } - ); - } - } - } else if (dependencyReference === void 0) { - if (!considerBuiltins && require$$0.isBuiltin(request)) { - if (isDependencyTreeRoot(issuerLocator)) { - error = makeError( - ErrorCode.UNDECLARED_DEPENDENCY, - `Your application tried to access ${dependencyName}. While this module is usually interpreted as a Node builtin, your resolver is running inside a non-Node resolution context where such builtins are ignored. Since ${dependencyName} isn't otherwise declared in your dependencies, this makes the require call ambiguous and unsound. - -Required package: ${dependencyName}${dependencyName !== requestForDisplay ? ` (via "${requestForDisplay}")` : ``} -Required by: ${issuerForDisplay} -`, - { request: requestForDisplay, issuer: issuerForDisplay, dependencyName } - ); - } else { - error = makeError( - ErrorCode.UNDECLARED_DEPENDENCY, - `${issuerLocator.name} tried to access ${dependencyName}. While this module is usually interpreted as a Node builtin, your resolver is running inside a non-Node resolution context where such builtins are ignored. Since ${dependencyName} isn't otherwise declared in ${issuerLocator.name}'s dependencies, this makes the require call ambiguous and unsound. - -Required package: ${dependencyName}${dependencyName !== requestForDisplay ? ` (via "${requestForDisplay}")` : ``} -Required by: ${issuerForDisplay} -`, - { request: requestForDisplay, issuer: issuerForDisplay, issuerLocator: Object.assign({}, issuerLocator), dependencyName } - ); - } - } else { - if (isDependencyTreeRoot(issuerLocator)) { - error = makeError( - ErrorCode.UNDECLARED_DEPENDENCY, - `Your application tried to access ${dependencyName}, but it isn't declared in your dependencies; this makes the require call ambiguous and unsound. - -Required package: ${dependencyName}${dependencyName !== requestForDisplay ? ` (via "${requestForDisplay}")` : ``} -Required by: ${issuerForDisplay} -`, - { request: requestForDisplay, issuer: issuerForDisplay, dependencyName } - ); - } else { - error = makeError( - ErrorCode.UNDECLARED_DEPENDENCY, - `${issuerLocator.name} tried to access ${dependencyName}, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound. - -Required package: ${dependencyName}${dependencyName !== requestForDisplay ? ` (via "${requestForDisplay}")` : ``} -Required by: ${issuerLocator.name}@${issuerLocator.reference} (via ${issuerForDisplay}) -`, - { request: requestForDisplay, issuer: issuerForDisplay, issuerLocator: Object.assign({}, issuerLocator), dependencyName } - ); - } - } - } - if (dependencyReference == null) { - if (fallbackReference === null || error === null) - throw error || new Error(`Assertion failed: Expected an error to have been set`); - dependencyReference = fallbackReference; - const message = error.message.replace(/\n.*/g, ``); - error.message = message; - if (!emittedWarnings.has(message) && debugLevel !== 0) { - emittedWarnings.add(message); - process.emitWarning(error); - } - } - const dependencyLocator = Array.isArray(dependencyReference) ? { name: dependencyReference[0], reference: dependencyReference[1] } : { name: dependencyName, reference: dependencyReference }; - const dependencyInformation = getPackageInformationSafe(dependencyLocator); - if (!dependencyInformation.packageLocation) { - throw makeError( - ErrorCode.MISSING_DEPENDENCY, - `A dependency seems valid but didn't get installed for some reason. This might be caused by a partial install, such as dev vs prod. - -Required package: ${dependencyLocator.name}@${dependencyLocator.reference}${dependencyLocator.name !== requestForDisplay ? ` (via "${requestForDisplay}")` : ``} -Required by: ${issuerLocator.name}@${issuerLocator.reference} (via ${issuerForDisplay}) -`, - { request: requestForDisplay, issuer: issuerForDisplay, dependencyLocator: Object.assign({}, dependencyLocator) } - ); - } - const dependencyLocation = dependencyInformation.packageLocation; - if (subPath) { - unqualifiedPath = ppath.join(dependencyLocation, subPath); - } else { - unqualifiedPath = dependencyLocation; - } - } - return ppath.normalize(unqualifiedPath); - } - function resolveUnqualifiedExport(request, unqualifiedPath, conditions = defaultExportsConditions, issuer) { - if (isStrictRegExp.test(request)) - return unqualifiedPath; - const unqualifiedExportPath = applyNodeExportsResolution(unqualifiedPath, conditions, issuer); - if (unqualifiedExportPath) { - return ppath.normalize(unqualifiedExportPath); - } else { - return unqualifiedPath; - } - } - function resolveUnqualified(unqualifiedPath, { extensions = Object.keys(require$$0.Module._extensions) } = {}) { - const candidates = []; - const qualifiedPath = applyNodeExtensionResolution(unqualifiedPath, candidates, { extensions }); - if (qualifiedPath) { - return ppath.normalize(qualifiedPath); - } else { - reportRequiredFilesToWatchMode(candidates.map((candidate) => npath.fromPortablePath(candidate))); - const unqualifiedPathForDisplay = getPathForDisplay(unqualifiedPath); - const containingPackage = findPackageLocator(unqualifiedPath); - if (containingPackage) { - const { packageLocation } = getPackageInformationSafe(containingPackage); - let exists = true; - try { - opts.fakeFs.accessSync(packageLocation); - } catch (err) { - if (err?.code === `ENOENT`) { - exists = false; - } else { - const readableError = (err?.message ?? err ?? `empty exception thrown`).replace(/^[A-Z]/, ($0) => $0.toLowerCase()); - throw makeError(ErrorCode.QUALIFIED_PATH_RESOLUTION_FAILED, `Required package exists but could not be accessed (${readableError}). - -Missing package: ${containingPackage.name}@${containingPackage.reference} -Expected package location: ${getPathForDisplay(packageLocation)} -`, { unqualifiedPath: unqualifiedPathForDisplay, extensions }); - } - } - if (!exists) { - const errorMessage = packageLocation.includes(`/unplugged/`) ? `Required unplugged package missing from disk. This may happen when switching branches without running installs (unplugged packages must be fully materialized on disk to work).` : `Required package missing from disk. If you keep your packages inside your repository then restarting the Node process may be enough. Otherwise, try to run an install first.`; - throw makeError( - ErrorCode.QUALIFIED_PATH_RESOLUTION_FAILED, - `${errorMessage} - -Missing package: ${containingPackage.name}@${containingPackage.reference} -Expected package location: ${getPathForDisplay(packageLocation)} -`, - { unqualifiedPath: unqualifiedPathForDisplay, extensions } - ); - } - } - throw makeError( - ErrorCode.QUALIFIED_PATH_RESOLUTION_FAILED, - `Qualified path resolution failed: we looked for the following paths, but none could be accessed. - -Source path: ${unqualifiedPathForDisplay} -${candidates.map((candidate) => `Not found: ${getPathForDisplay(candidate)} -`).join(``)}`, - { unqualifiedPath: unqualifiedPathForDisplay, extensions } - ); - } - } - function resolvePrivateRequest(request, issuer, opts2) { - if (!issuer) - throw new Error(`Assertion failed: An issuer is required to resolve private import mappings`); - const resolved = packageImportsResolve({ - name: request, - base: url.pathToFileURL(npath.fromPortablePath(issuer)), - conditions: opts2.conditions ?? defaultExportsConditions, - readFileSyncFn: tryReadFile - }); - if (resolved instanceof URL) { - return resolveUnqualified(npath.toPortablePath(url.fileURLToPath(resolved)), { extensions: opts2.extensions }); - } else { - if (resolved.startsWith(`#`)) - throw new Error(`Mapping from one private import to another isn't allowed`); - return resolveRequest(resolved, issuer, opts2); - } - } - function resolveRequest(request, issuer, opts2 = {}) { - try { - if (request.startsWith(`#`)) - return resolvePrivateRequest(request, issuer, opts2); - const { considerBuiltins, extensions, conditions } = opts2; - const unqualifiedPath = resolveToUnqualified(request, issuer, { considerBuiltins }); - if (request === `pnpapi`) - return unqualifiedPath; - if (unqualifiedPath === null) - return null; - const isIssuerIgnored = () => issuer !== null ? isPathIgnored(issuer) : false; - const remappedPath = (!considerBuiltins || !require$$0.isBuiltin(request)) && !isIssuerIgnored() ? resolveUnqualifiedExport(request, unqualifiedPath, conditions, issuer) : unqualifiedPath; - return resolveUnqualified(remappedPath, { extensions }); - } catch (error) { - if (Object.hasOwn(error, `pnpCode`)) - Object.assign(error.data, { request: getPathForDisplay(request), issuer: issuer && getPathForDisplay(issuer) }); - throw error; - } - } - function resolveVirtual(request) { - const normalized = ppath.normalize(request); - const resolved = VirtualFS.resolveVirtual(normalized); - return resolved !== normalized ? resolved : null; - } - return { - VERSIONS, - topLevel, - getLocator: (name, referencish) => { - if (Array.isArray(referencish)) { - return { name: referencish[0], reference: referencish[1] }; - } else { - return { name, reference: referencish }; - } - }, - getDependencyTreeRoots: () => { - return [...runtimeState.dependencyTreeRoots]; - }, - getAllLocators() { - const locators = []; - for (const [name, entry] of packageRegistry) - for (const reference of entry.keys()) - if (name !== null && reference !== null) - locators.push({ name, reference }); - return locators; - }, - getPackageInformation: (locator) => { - const info = getPackageInformation(locator); - if (info === null) - return null; - const packageLocation = npath.fromPortablePath(info.packageLocation); - const nativeInfo = { ...info, packageLocation }; - return nativeInfo; - }, - findPackageLocator: (path) => { - return findPackageLocator(npath.toPortablePath(path)); - }, - resolveToUnqualified: maybeLog(`resolveToUnqualified`, (request, issuer, opts2) => { - const portableIssuer = issuer !== null ? npath.toPortablePath(issuer) : null; - const resolution = resolveToUnqualified(npath.toPortablePath(request), portableIssuer, opts2); - if (resolution === null) - return null; - return npath.fromPortablePath(resolution); - }), - resolveUnqualified: maybeLog(`resolveUnqualified`, (unqualifiedPath, opts2) => { - return npath.fromPortablePath(resolveUnqualified(npath.toPortablePath(unqualifiedPath), opts2)); - }), - resolveRequest: maybeLog(`resolveRequest`, (request, issuer, opts2) => { - const portableIssuer = issuer !== null ? npath.toPortablePath(issuer) : null; - const resolution = resolveRequest(npath.toPortablePath(request), portableIssuer, opts2); - if (resolution === null) - return null; - return npath.fromPortablePath(resolution); - }), - resolveVirtual: maybeLog(`resolveVirtual`, (path) => { - const result = resolveVirtual(npath.toPortablePath(path)); - if (result !== null) { - return npath.fromPortablePath(result); - } else { - return null; - } - }) - }; -} - -function makeManager(pnpapi, opts) { - const initialApiPath = npath.toPortablePath(pnpapi.resolveToUnqualified(`pnpapi`, null)); - const initialApiStats = opts.fakeFs.statSync(npath.toPortablePath(initialApiPath)); - const apiMetadata = /* @__PURE__ */ new Map([ - [initialApiPath, { - instance: pnpapi, - stats: initialApiStats, - lastRefreshCheck: Date.now() - }] - ]); - function loadApiInstance(pnpApiPath) { - const nativePath = npath.fromPortablePath(pnpApiPath); - const module = new require$$0.Module(nativePath, null); - module.load(nativePath); - return module.exports; - } - function refreshApiEntry(pnpApiPath, apiEntry) { - const timeNow = Date.now(); - if (timeNow - apiEntry.lastRefreshCheck < 500) - return; - apiEntry.lastRefreshCheck = timeNow; - const stats = opts.fakeFs.statSync(pnpApiPath); - if (stats.mtime > apiEntry.stats.mtime) { - process.emitWarning(`[Warning] The runtime detected new information in a PnP file; reloading the API instance (${npath.fromPortablePath(pnpApiPath)})`); - apiEntry.stats = stats; - apiEntry.instance = loadApiInstance(pnpApiPath); - } - } - function getApiEntry(pnpApiPath, refresh = false) { - let apiEntry = apiMetadata.get(pnpApiPath); - if (typeof apiEntry !== `undefined`) { - if (refresh) { - refreshApiEntry(pnpApiPath, apiEntry); - } - } else { - apiMetadata.set(pnpApiPath, apiEntry = { - instance: loadApiInstance(pnpApiPath), - stats: opts.fakeFs.statSync(pnpApiPath), - lastRefreshCheck: Date.now() - }); - } - return apiEntry; - } - const findApiPathCache = /* @__PURE__ */ new Map(); - function addToCacheAndReturn(start, end, target) { - if (target !== null) { - target = VirtualFS.resolveVirtual(target); - target = opts.fakeFs.realpathSync(target); - } - let curr; - let next = start; - do { - curr = next; - findApiPathCache.set(curr, target); - next = ppath.dirname(curr); - } while (curr !== end); - return target; - } - function findApiPathFor(modulePath) { - let bestCandidate = null; - for (const [apiPath, apiEntry] of apiMetadata) { - const locator = apiEntry.instance.findPackageLocator(modulePath); - if (!locator) - continue; - if (apiMetadata.size === 1) - return apiPath; - const packageInformation = apiEntry.instance.getPackageInformation(locator); - if (!packageInformation) - throw new Error(`Assertion failed: Couldn't get package information for '${modulePath}'`); - if (!bestCandidate) - bestCandidate = { packageLocation: packageInformation.packageLocation, apiPaths: [] }; - if (packageInformation.packageLocation === bestCandidate.packageLocation) { - bestCandidate.apiPaths.push(apiPath); - } else if (packageInformation.packageLocation.length > bestCandidate.packageLocation.length) { - bestCandidate = { packageLocation: packageInformation.packageLocation, apiPaths: [apiPath] }; - } - } - if (bestCandidate) { - if (bestCandidate.apiPaths.length === 1) - return bestCandidate.apiPaths[0]; - const controlSegment = bestCandidate.apiPaths.map((apiPath) => ` ${npath.fromPortablePath(apiPath)}`).join(` -`); - throw new Error(`Unable to locate pnpapi, the module '${modulePath}' is controlled by multiple pnpapi instances. -This is usually caused by using the global cache (enableGlobalCache: true) - -Controlled by: -${controlSegment} -`); - } - const start = ppath.resolve(npath.toPortablePath(modulePath)); - let curr; - let next = start; - do { - curr = next; - const cached = findApiPathCache.get(curr); - if (cached !== void 0) - return addToCacheAndReturn(start, curr, cached); - const cjsCandidate = ppath.join(curr, Filename.pnpCjs); - if (opts.fakeFs.existsSync(cjsCandidate) && opts.fakeFs.statSync(cjsCandidate).isFile()) - return addToCacheAndReturn(start, curr, cjsCandidate); - const legacyCjsCandidate = ppath.join(curr, Filename.pnpJs); - if (opts.fakeFs.existsSync(legacyCjsCandidate) && opts.fakeFs.statSync(legacyCjsCandidate).isFile()) - return addToCacheAndReturn(start, curr, legacyCjsCandidate); - next = ppath.dirname(curr); - } while (curr !== PortablePath.root); - return addToCacheAndReturn(start, curr, null); - } - const moduleToApiPathCache = /* @__PURE__ */ new WeakMap(); - function getApiPathFromParent(parent) { - if (parent == null) - return initialApiPath; - let apiPath = moduleToApiPathCache.get(parent); - if (typeof apiPath !== `undefined`) - return apiPath; - apiPath = parent.filename ? findApiPathFor(parent.filename) : null; - moduleToApiPathCache.set(parent, apiPath); - return apiPath; - } - return { - getApiPathFromParent, - findApiPathFor, - getApiEntry - }; -} - -const localFs = { ...fs__default.default }; -const nodeFs = new NodeFS(localFs); -const defaultRuntimeState = $$SETUP_STATE(hydrateRuntimeState); -const defaultPnpapiResolution = __filename; -const defaultFsLayer = new VirtualFS({ - baseFs: new ZipOpenFS({ - baseFs: nodeFs, - maxOpenFiles: 80, - readOnlyArchives: true - }) -}); -class DynamicFS extends ProxiedFS { - constructor() { - super(ppath); - this.baseFs = defaultFsLayer; - } - mapToBase(p) { - return p; - } - mapFromBase(p) { - return p; - } -} -const dynamicFsLayer = new DynamicFS(); -let manager; -const defaultApi = Object.assign(makeApi(defaultRuntimeState, { - fakeFs: dynamicFsLayer, - pnpapiResolution: defaultPnpapiResolution -}), { - makeApi: ({ - basePath = void 0, - fakeFs = dynamicFsLayer, - pnpapiResolution = defaultPnpapiResolution, - ...rest - }) => { - const apiRuntimeState = typeof basePath !== `undefined` ? $$SETUP_STATE(hydrateRuntimeState, basePath) : defaultRuntimeState; - return makeApi(apiRuntimeState, { - fakeFs, - pnpapiResolution, - ...rest - }); - }, - setup: (api) => { - applyPatch(api || defaultApi, { - fakeFs: defaultFsLayer, - manager - }); - dynamicFsLayer.baseFs = new NodeFS(fs__default.default); - } -}); -manager = makeManager(defaultApi, { - fakeFs: dynamicFsLayer -}); -if (module.parent && module.parent.id === `internal/preload`) { - defaultApi.setup(); - if (module.filename) { - delete require$$0__default.default._cache[module.filename]; - } -} -if (process.mainModule === module) { - const reportError = (code, message, data) => { - process.stdout.write(`${JSON.stringify([{ code, message, data }, null])} -`); - }; - const reportSuccess = (resolution) => { - process.stdout.write(`${JSON.stringify([null, resolution])} -`); - }; - const processResolution = (request, issuer) => { - try { - reportSuccess(defaultApi.resolveRequest(request, issuer)); - } catch (error) { - reportError(error.code, error.message, error.data); - } - }; - const processRequest = (data) => { - try { - const [request, issuer] = JSON.parse(data); - processResolution(request, issuer); - } catch (error) { - reportError(`INVALID_JSON`, error.message, error.data); - } - }; - if (process.argv.length > 2) { - if (process.argv.length !== 4) { - process.stderr.write(`Usage: ${process.argv[0]} ${process.argv[1]} -`); - process.exitCode = 64; - } else { - processResolution(process.argv[2], process.argv[3]); - } - } else { - let buffer = ``; - const decoder = new StringDecoder__default.default.StringDecoder(); - process.stdin.on(`data`, (chunk) => { - buffer += decoder.write(chunk); - do { - const index = buffer.indexOf(` -`); - if (index === -1) - break; - const line = buffer.slice(0, index); - buffer = buffer.slice(index + 1); - processRequest(line); - } while (true); - }); - } -} - -module.exports = defaultApi; diff --git a/fixtures/pnp/.yarnrc.yml b/fixtures/pnp/.yarnrc.yml deleted file mode 100644 index 6a6b24d8..00000000 --- a/fixtures/pnp/.yarnrc.yml +++ /dev/null @@ -1 +0,0 @@ -enableGlobalCache: 0 diff --git a/fixtures/pnp/package.json b/fixtures/pnp/package.json deleted file mode 100644 index 5d119379..00000000 --- a/fixtures/pnp/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "pnp", - "packageManager": "yarn@4.3.1", - "dependencies": { - "is-even": "^1.0.0", - "is-odd": "^3.0.1" - } -} diff --git a/fixtures/pnp/yarn.lock b/fixtures/pnp/yarn.lock deleted file mode 100644 index ba89514d..00000000 --- a/fixtures/pnp/yarn.lock +++ /dev/null @@ -1,74 +0,0 @@ -# This file is generated by running "yarn install" inside your project. -# Manual changes might be lost - proceed with caution! - -__metadata: - version: 8 - cacheKey: 10c0 - -"is-buffer@npm:^1.1.5": - version: 1.1.6 - resolution: "is-buffer@npm:1.1.6" - checksum: 10c0/ae18aa0b6e113d6c490ad1db5e8df9bdb57758382b313f5a22c9c61084875c6396d50bbf49315f5b1926d142d74dfb8d31b40d993a383e0a158b15fea7a82234 - languageName: node - linkType: hard - -"is-even@npm:^1.0.0": - version: 1.0.0 - resolution: "is-even@npm:1.0.0" - dependencies: - is-odd: "npm:^0.1.2" - checksum: 10c0/2728cc2f390d07c6a44a054aa53ae6ce57c3a4adfd76a92df528e992b4a978fdec4eaa948e0de6e6431ef3c8deebf1c964fd870d4983044ec9f0f4e630dfb3a5 - languageName: node - linkType: hard - -"is-number@npm:^3.0.0": - version: 3.0.0 - resolution: "is-number@npm:3.0.0" - dependencies: - kind-of: "npm:^3.0.2" - checksum: 10c0/e639c54640b7f029623df24d3d103901e322c0c25ea5bde97cd723c2d0d4c05857a8364ab5c58d963089dbed6bf1d0ffe975cb6aef917e2ad0ccbca653d31b4f - languageName: node - linkType: hard - -"is-number@npm:^6.0.0": - version: 6.0.0 - resolution: "is-number@npm:6.0.0" - checksum: 10c0/5da4c68401529675c575878d2760d66f18eaef4b014858577f6003daf66488d7fe4eae684b1e8574e3fa1bb447c6c6c56b8491d2b4b3239da2d32e5f6f218008 - languageName: node - linkType: hard - -"is-odd@npm:^0.1.2": - version: 0.1.2 - resolution: "is-odd@npm:0.1.2" - dependencies: - is-number: "npm:^3.0.0" - checksum: 10c0/7dc6c6fd004861208ef9f324021c66f19b3dad209c2da3ef3720d4d76e141974fadb52c47b439fc8c52af579468640b554115395b5673f4558ef09719260e898 - languageName: node - linkType: hard - -"is-odd@npm:^3.0.1": - version: 3.0.1 - resolution: "is-odd@npm:3.0.1" - dependencies: - is-number: "npm:^6.0.0" - checksum: 10c0/89ee2e353c5a3f3bd400c79db1c307a5b3506198ee8169d521e533a9b1d8a08fc95f21a919c084e98845b4286d7ffe309778da03744dfe66c3c1763ab1a030c6 - languageName: node - linkType: hard - -"kind-of@npm:^3.0.2": - version: 3.2.2 - resolution: "kind-of@npm:3.2.2" - dependencies: - is-buffer: "npm:^1.1.5" - checksum: 10c0/7e34bc29d4b02c997f92f080de34ebb92033a96736bbb0bb2410e033a7e5ae6571f1fa37b2d7710018f95361473b816c604234197f4f203f9cf149d8ef1574d9 - languageName: node - linkType: hard - -"pnp@workspace:.": - version: 0.0.0-use.local - resolution: "pnp@workspace:." - dependencies: - is-even: "npm:^1.0.0" - is-odd: "npm:^3.0.1" - languageName: unknown - linkType: soft diff --git a/fixtures/pnpm/.gitignore b/fixtures/pnpm/.gitignore deleted file mode 100644 index 3c3629e6..00000000 --- a/fixtures/pnpm/.gitignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/fixtures/pnpm/package.json b/fixtures/pnpm/package.json deleted file mode 100644 index b763d74d..00000000 --- a/fixtures/pnpm/package.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "name": "pnpm", - "version": "1.0.0", - "private": true, - "devDependencies": { - "axios": "1.6.2", - "ipaddr.js": "2.2.0", - "postcss": "8.4.33", - "styled-components": "6.1.1" - } -} diff --git a/fixtures/pnpm/pnpm-lock.yaml b/fixtures/pnpm/pnpm-lock.yaml deleted file mode 100644 index e51dfd6a..00000000 --- a/fixtures/pnpm/pnpm-lock.yaml +++ /dev/null @@ -1,212 +0,0 @@ -lockfileVersion: '6.0' - -settings: - autoInstallPeers: true - excludeLinksFromLockfile: false - -devDependencies: - axios: - specifier: 1.6.2 - version: 1.6.2 - postcss: - specifier: 8.4.33 - version: 8.4.33 - styled-components: - specifier: 6.1.1 - version: 6.1.1(react-dom@18.2.0)(react@18.2.0) - -packages: - - /@emotion/is-prop-valid@1.2.1: - resolution: {integrity: sha512-61Mf7Ufx4aDxx1xlDeOm8aFFigGHE4z+0sKCa+IHCeZKiyP9RLD0Mmx7m8b9/Cf37f7NAvQOOJAbQQGVr5uERw==} - dependencies: - '@emotion/memoize': 0.8.1 - dev: true - - /@emotion/memoize@0.8.1: - resolution: {integrity: sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA==} - dev: true - - /@emotion/unitless@0.8.1: - resolution: {integrity: sha512-KOEGMu6dmJZtpadb476IsZBclKvILjopjUii3V+7MnXIQCYh8W3NgNcgwo21n9LXZX6EDIKvqfjYxXebDwxKmQ==} - dev: true - - /@types/stylis@4.2.4: - resolution: {integrity: sha512-36ZrGJ8fgtBr6nwNnuJ9jXIj+bn/pF6UoqmrQT7+Y99+tFFeHHsoR54+194dHdyhPjgbeoNz3Qru0oRt0l6ASQ==} - dev: true - - /asynckit@0.4.0: - resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} - dev: true - - /axios@1.6.2: - resolution: {integrity: sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A==} - dependencies: - follow-redirects: 1.15.3 - form-data: 4.0.0 - proxy-from-env: 1.1.0 - transitivePeerDependencies: - - debug - dev: true - - /camelize@1.0.1: - resolution: {integrity: sha512-dU+Tx2fsypxTgtLoE36npi3UqcjSSMNYfkqgmoEhtZrraP5VWq0K7FkWVTYa8eMPtnU/G2txVsfdCJTn9uzpuQ==} - dev: true - - /combined-stream@1.0.8: - resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} - engines: {node: '>= 0.8'} - dependencies: - delayed-stream: 1.0.0 - dev: true - - /css-color-keywords@1.0.0: - resolution: {integrity: sha512-FyyrDHZKEjXDpNJYvVsV960FiqQyXc/LlYmsxl2BcdMb2WPx0OGRVgTg55rPSyLSNMqP52R9r8geSp7apN3Ofg==} - engines: {node: '>=4'} - dev: true - - /css-to-react-native@3.2.0: - resolution: {integrity: sha512-e8RKaLXMOFii+02mOlqwjbD00KSEKqblnpO9e++1aXS1fPQOpS1YoqdVHBqPjHNoxeF2mimzVqawm2KCbEdtHQ==} - dependencies: - camelize: 1.0.1 - css-color-keywords: 1.0.0 - postcss-value-parser: 4.2.0 - dev: true - - /csstype@3.1.2: - resolution: {integrity: sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==} - dev: true - - /delayed-stream@1.0.0: - resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} - engines: {node: '>=0.4.0'} - dev: true - - /follow-redirects@1.15.3: - resolution: {integrity: sha512-1VzOtuEM8pC9SFU1E+8KfTjZyMztRsgEfwQl44z8A25uy13jSzTj6dyK2Df52iV0vgHCfBwLhDWevLn95w5v6Q==} - engines: {node: '>=4.0'} - peerDependencies: - debug: '*' - peerDependenciesMeta: - debug: - optional: true - dev: true - - /form-data@4.0.0: - resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==} - engines: {node: '>= 6'} - dependencies: - asynckit: 0.4.0 - combined-stream: 1.0.8 - mime-types: 2.1.35 - dev: true - - /js-tokens@4.0.0: - resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} - dev: true - - /loose-envify@1.4.0: - resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==} - hasBin: true - dependencies: - js-tokens: 4.0.0 - dev: true - - /mime-db@1.52.0: - resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} - engines: {node: '>= 0.6'} - dev: true - - /mime-types@2.1.35: - resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} - engines: {node: '>= 0.6'} - dependencies: - mime-db: 1.52.0 - dev: true - - /nanoid@3.3.7: - resolution: {integrity: sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==} - engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} - hasBin: true - dev: true - - /picocolors@1.0.0: - resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==} - dev: true - - /postcss-value-parser@4.2.0: - resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==} - dev: true - - /postcss@8.4.33: - resolution: {integrity: sha512-Kkpbhhdjw2qQs2O2DGX+8m5OVqEcbB9HRBvuYM9pgrjEFUg30A9LmXNlTAUj4S9kgtGyrMbTzVjH7E+s5Re2yg==} - engines: {node: ^10 || ^12 || >=14} - dependencies: - nanoid: 3.3.7 - picocolors: 1.0.0 - source-map-js: 1.0.2 - dev: true - - /proxy-from-env@1.1.0: - resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==} - dev: true - - /react-dom@18.2.0(react@18.2.0): - resolution: {integrity: sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==} - peerDependencies: - react: ^18.2.0 - dependencies: - loose-envify: 1.4.0 - react: 18.2.0 - scheduler: 0.23.0 - dev: true - - /react@18.2.0: - resolution: {integrity: sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==} - engines: {node: '>=0.10.0'} - dependencies: - loose-envify: 1.4.0 - dev: true - - /scheduler@0.23.0: - resolution: {integrity: sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw==} - dependencies: - loose-envify: 1.4.0 - dev: true - - /shallowequal@1.1.0: - resolution: {integrity: sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ==} - dev: true - - /source-map-js@1.0.2: - resolution: {integrity: sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==} - engines: {node: '>=0.10.0'} - dev: true - - /styled-components@6.1.1(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-cpZZP5RrKRIClBW5Eby4JM1wElLVP4NQrJbJ0h10TidTyJf4SIIwa3zLXOoPb4gJi8MsJ8mjq5mu2IrEhZIAcQ==} - engines: {node: '>= 16'} - peerDependencies: - react: '>= 16.8.0' - react-dom: '>= 16.8.0' - dependencies: - '@emotion/is-prop-valid': 1.2.1 - '@emotion/unitless': 0.8.1 - '@types/stylis': 4.2.4 - css-to-react-native: 3.2.0 - csstype: 3.1.2 - postcss: 8.4.33 - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - shallowequal: 1.1.0 - stylis: 4.3.0 - tslib: 2.6.2 - dev: true - - /stylis@4.3.0: - resolution: {integrity: sha512-E87pIogpwUsUwXw7dNyU4QDjdgVMy52m+XEOPEKUn161cCzWjjhPSQhByfd1CcNvrOLnXQ6OnnZDwnJrz/Z4YQ==} - dev: true - - /tslib@2.6.2: - resolution: {integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==} - dev: true diff --git a/fixtures/tsconfig/cases/builtins/thing.js b/fixtures/tsconfig/cases/builtins/thing.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/builtins/tsconfig.json b/fixtures/tsconfig/cases/builtins/tsconfig.json deleted file mode 100644 index 36aa1a4d..00000000 --- a/fixtures/tsconfig/cases/builtins/tsconfig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compilerOptions": { - "baseUrl": "." - } -} diff --git a/fixtures/tsconfig/cases/exports/index.js b/fixtures/tsconfig/cases/exports/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/exports/tsconfig.json b/fixtures/tsconfig/cases/exports/tsconfig.json deleted file mode 100644 index f0e3159b..00000000 --- a/fixtures/tsconfig/cases/exports/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-exports" -} diff --git a/fixtures/tsconfig/cases/extends-extension/base-tsconfig.json b/fixtures/tsconfig/cases/extends-extension/base-tsconfig.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/cases/extends-extension/base-tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/cases/extends-extension/foo.js b/fixtures/tsconfig/cases/extends-extension/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-extension/tsconfig.json b/fixtures/tsconfig/cases/extends-extension/tsconfig.json deleted file mode 100644 index 0ae4c6a3..00000000 --- a/fixtures/tsconfig/cases/extends-extension/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./base-tsconfig" -} diff --git a/fixtures/tsconfig/cases/extends-extensionless/foo.js b/fixtures/tsconfig/cases/extends-extensionless/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-extensionless/tsconfig.json b/fixtures/tsconfig/cases/extends-extensionless/tsconfig.json deleted file mode 100644 index c36cb7d4..00000000 --- a/fixtures/tsconfig/cases/extends-extensionless/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-field/conf" -} diff --git a/fixtures/tsconfig/cases/extends-multiple/foo.js b/fixtures/tsconfig/cases/extends-multiple/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-multiple/tsconfig.json b/fixtures/tsconfig/cases/extends-multiple/tsconfig.json deleted file mode 100644 index aa2ae783..00000000 --- a/fixtures/tsconfig/cases/extends-multiple/tsconfig.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": ["../extends-extension", "../extends-paths"], - "compilerOptions": { - "baseUrl": ".", - }, -} diff --git a/fixtures/tsconfig/cases/extends-not-found/index.js b/fixtures/tsconfig/cases/extends-not-found/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-not-found/tsconfig.json b/fixtures/tsconfig/cases/extends-not-found/tsconfig.json deleted file mode 100644 index 99df91da..00000000 --- a/fixtures/tsconfig/cases/extends-not-found/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./not-found" -} diff --git a/fixtures/tsconfig/cases/extends-paths/src/index.js b/fixtures/tsconfig/cases/extends-paths/src/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-paths/tsconfig.base.json b/fixtures/tsconfig/cases/extends-paths/tsconfig.base.json deleted file mode 100644 index 5c64b067..00000000 --- a/fixtures/tsconfig/cases/extends-paths/tsconfig.base.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "@/*": ["./*"] - } - } -} diff --git a/fixtures/tsconfig/cases/extends-paths/tsconfig.json b/fixtures/tsconfig/cases/extends-paths/tsconfig.json deleted file mode 100644 index 51086018..00000000 --- a/fixtures/tsconfig/cases/extends-paths/tsconfig.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": "./tsconfig.base.json", - "compilerOptions": { - "baseUrl": "src", - }, -} diff --git a/fixtures/tsconfig/cases/field/index.js b/fixtures/tsconfig/cases/field/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/field/tsconfig.json b/fixtures/tsconfig/cases/field/tsconfig.json deleted file mode 100644 index 9f86c3f4..00000000 --- a/fixtures/tsconfig/cases/field/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-field" -} diff --git a/fixtures/tsconfig/cases/index/index.js b/fixtures/tsconfig/cases/index/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/index/tsconfig.json b/fixtures/tsconfig/cases/index/tsconfig.json deleted file mode 100644 index d20b1774..00000000 --- a/fixtures/tsconfig/cases/index/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-index" -} diff --git a/fixtures/tsconfig/cases/paths_template_variable/foo.js b/fixtures/tsconfig/cases/paths_template_variable/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json b/fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json deleted file mode 100644 index a1a37bb6..00000000 --- a/fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "../../tsconfig_template_variable.json" -} diff --git a/fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json b/fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json deleted file mode 100644 index e7d8e5e5..00000000 --- a/fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "compilerOptions": { - "composite": true, - "paths": { - "foo": ["${configDir}/foo.js"] - } - } -} diff --git a/fixtures/tsconfig/cases/project_references/app/aliased/index.ts b/fixtures/tsconfig/cases/project_references/app/aliased/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/app/index.ts b/fixtures/tsconfig/cases/project_references/app/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/app/tsconfig.json b/fixtures/tsconfig/cases/project_references/app/tsconfig.json deleted file mode 100644 index 7036d2bb..00000000 --- a/fixtures/tsconfig/cases/project_references/app/tsconfig.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "extends": "../tsconfig.base.json", - "compilerOptions": { - "baseUrl": "./", - "paths": { - "@/*": ["./aliased/*"] - } - }, - "references": [ - { - "path": "../project_a/conf.json" - }, - { - "path": "../project_b" - }, - { - "path": "../project_c/tsconfig.json" - }, - { - "path": "../../paths_template_variable/tsconfig2.json" - } - ] -} diff --git a/fixtures/tsconfig/cases/project_references/project_a/aliased/index.ts b/fixtures/tsconfig/cases/project_references/project_a/aliased/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_a/conf.json b/fixtures/tsconfig/cases/project_references/project_a/conf.json deleted file mode 100644 index 4d389d7a..00000000 --- a/fixtures/tsconfig/cases/project_references/project_a/conf.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "compilerOptions": { - "composite": true, - "paths": { - "@/*": ["./aliased/*"] - } - } -} diff --git a/fixtures/tsconfig/cases/project_references/project_a/index.ts b/fixtures/tsconfig/cases/project_references/project_a/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_b/src/aliased/index.ts b/fixtures/tsconfig/cases/project_references/project_b/src/aliased/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_b/tsconfig.json b/fixtures/tsconfig/cases/project_references/project_b/tsconfig.json deleted file mode 100644 index 4ab05cd8..00000000 --- a/fixtures/tsconfig/cases/project_references/project_b/tsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "compilerOptions": { - "composite": true, - "baseUrl": "./src", - "paths": { - "@/*": ["./aliased/*"] - } - } -} diff --git a/fixtures/tsconfig/cases/project_references/project_c/index.ts b/fixtures/tsconfig/cases/project_references/project_c/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_c/tsconfig.json b/fixtures/tsconfig/cases/project_references/project_c/tsconfig.json deleted file mode 100644 index fe520939..00000000 --- a/fixtures/tsconfig/cases/project_references/project_c/tsconfig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compilerOptions": { - "composite": true - } -} diff --git a/fixtures/tsconfig/cases/project_references/tsconfig.base.json b/fixtures/tsconfig/cases/project_references/tsconfig.base.json deleted file mode 100644 index 88ccffe7..00000000 --- a/fixtures/tsconfig/cases/project_references/tsconfig.base.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "compilerOptions": { - } -} diff --git a/fixtures/tsconfig/cases/suffixes/a.ios.ts b/fixtures/tsconfig/cases/suffixes/a.ios.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/a.ts b/fixtures/tsconfig/cases/suffixes/a.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/b.ts b/fixtures/tsconfig/cases/suffixes/b.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/c-test.ts b/fixtures/tsconfig/cases/suffixes/c-test.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/index.ts b/fixtures/tsconfig/cases/suffixes/index.ts deleted file mode 100644 index b09939b9..00000000 --- a/fixtures/tsconfig/cases/suffixes/index.ts +++ /dev/null @@ -1 +0,0 @@ -import './a'; diff --git a/fixtures/tsconfig/cases/suffixes/tsconfig.json b/fixtures/tsconfig/cases/suffixes/tsconfig.json deleted file mode 100644 index 4c2ccc8f..00000000 --- a/fixtures/tsconfig/cases/suffixes/tsconfig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compilerOptions": { - "moduleSuffixes": [".ios", "-test", ""] - } -} diff --git a/fixtures/tsconfig/cases/trailing-comma/bar.js b/fixtures/tsconfig/cases/trailing-comma/bar.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/trailing-comma/index.js b/fixtures/tsconfig/cases/trailing-comma/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/trailing-comma/tsconfig.json b/fixtures/tsconfig/cases/trailing-comma/tsconfig.json deleted file mode 100644 index 6dc20ca5..00000000 --- a/fixtures/tsconfig/cases/trailing-comma/tsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "compilerOptions": { - "paths": { - /* some comment */ - "foo": ["bar.js"], - }, - }, - // another comment -} diff --git a/fixtures/tsconfig/foo.js b/fixtures/tsconfig/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/nested/index.js b/fixtures/tsconfig/nested/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/nested/test.js b/fixtures/tsconfig/nested/test.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/nested/tsconfig.json b/fixtures/tsconfig/nested/tsconfig.json deleted file mode 100644 index 6deb3011..00000000 --- a/fixtures/tsconfig/nested/tsconfig.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "extends": "..", - "compilerOptions": { - "paths": { - "ts-path": ["test.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-exports/conf.json b/fixtures/tsconfig/node_modules/tsconfig-exports/conf.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-exports/conf.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-exports/foo.js b/fixtures/tsconfig/node_modules/tsconfig-exports/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-exports/package.json b/fixtures/tsconfig/node_modules/tsconfig-exports/package.json deleted file mode 100644 index be0ddee6..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-exports/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "tsconfig-exports", - "private": true, - "exports": { - ".": "./conf.json" - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-field/conf.json b/fixtures/tsconfig/node_modules/tsconfig-field/conf.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-field/conf.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-field/foo.js b/fixtures/tsconfig/node_modules/tsconfig-field/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-field/package.json b/fixtures/tsconfig/node_modules/tsconfig-field/package.json deleted file mode 100644 index 7138fdde..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-field/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "tsconfig-field", - "private": true, - "tsconfig": "conf.json" -} \ No newline at end of file diff --git a/fixtures/tsconfig/node_modules/tsconfig-index/foo.js b/fixtures/tsconfig/node_modules/tsconfig-index/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-index/package.json b/fixtures/tsconfig/node_modules/tsconfig-index/package.json deleted file mode 100644 index eb2431e7..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-index/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "tsconfig-index", - "private": true -} \ No newline at end of file diff --git a/fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json b/fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-not-used/foo.js b/fixtures/tsconfig/node_modules/tsconfig-not-used/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json b/fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json deleted file mode 100644 index eb16d127..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "ts-path": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/package.json b/fixtures/tsconfig/package.json deleted file mode 100755 index f48acd1c..00000000 --- a/fixtures/tsconfig/package.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "name": "resolver", - "private": true, - "alias": { - "aliased": "foo", - "aliased-file": "./bar.js", - "something": "./nested/test.js", - "aliasedfolder": "./nested", - "aliasedabsolute": "/nested", - "foo/bar": "./bar.js", - "glob/*/*": "./nested/$2", - "./baz": "./bar.js", - "url": false - }, - "imports": { - "#test": "./bar.js" - }, - "dependencies": { - "foo": "^0.3.4" - }, - "peerDependencies": { - "bar": "*" - } -} diff --git a/fixtures/tsconfig/tsconfig.json b/fixtures/tsconfig/tsconfig.json deleted file mode 100644 index eb16d127..00000000 --- a/fixtures/tsconfig/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "ts-path": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/tsconfig_broken.json b/fixtures/tsconfig/tsconfig_broken.json deleted file mode 100644 index 98232c64..00000000 --- a/fixtures/tsconfig/tsconfig_broken.json +++ /dev/null @@ -1 +0,0 @@ -{ diff --git a/fixtures/tsconfig/tsconfig_template_variable.json b/fixtures/tsconfig/tsconfig_template_variable.json deleted file mode 100644 index 6f272344..00000000 --- a/fixtures/tsconfig/tsconfig_template_variable.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["${configDir}/foo.js"] - } - } -} diff --git a/napi/__test__/resolver.spec.mjs b/napi/__test__/resolver.spec.mjs deleted file mode 100644 index ac6ee0ef..00000000 --- a/napi/__test__/resolver.spec.mjs +++ /dev/null @@ -1,260 +0,0 @@ -import { join } from 'node:path' -import { fileURLToPath } from 'node:url' - -import test from 'ava' - -let ResolverFactory - -if (process.env.WASI_TEST) { - const wasi = await import('../resolver.wasi.cjs') - ResolverFactory = wasi.ResolverFactory -} else { - const napi = await import('../index.js') - ResolverFactory = napi.ResolverFactory -} - -const currentDir = join(fileURLToPath(import.meta.url), '..') - -const enhancedResolveRoot = join( - currentDir, - '..', - '..', - 'fixtures', - 'enhanced_resolve', - 'test', - 'fixtures' -) - -// https://github.com/webpack/enhanced-resolve/blob/main/test/resolve.test.js - -for (const [title, context, request, expected] of [ - [ - 'absolute path', - enhancedResolveRoot, - join(enhancedResolveRoot, 'main1.js'), - join(enhancedResolveRoot, 'main1.js'), - ], - [ - 'file with .js', - enhancedResolveRoot, - './main1.js', - join(enhancedResolveRoot, 'main1.js'), - ], - [ - 'file without extension', - enhancedResolveRoot, - './main1', - join(enhancedResolveRoot, 'main1.js'), - ], - [ - 'another file with .js', - enhancedResolveRoot, - './a.js', - join(enhancedResolveRoot, 'a.js'), - ], - [ - 'another file without extension', - enhancedResolveRoot, - './a', - join(enhancedResolveRoot, 'a.js'), - ], - [ - 'file in module with .js', - enhancedResolveRoot, - 'm1/a.js', - join(enhancedResolveRoot, 'node_modules/m1/a.js'), - ], - [ - 'file in module without extension', - enhancedResolveRoot, - 'm1/a', - join(enhancedResolveRoot, 'node_modules/m1/a.js'), - ], - [ - 'another file in module without extension', - enhancedResolveRoot, - 'complexm/step1', - join(enhancedResolveRoot, 'node_modules/complexm/step1.js'), - ], - [ - 'from submodule to file in sibling module', - join(enhancedResolveRoot, 'node_modules/complexm'), - 'm2/b.js', - join(enhancedResolveRoot, 'node_modules/m2/b.js'), - ], - [ - 'from nested directory to overwritten file in module', - join(enhancedResolveRoot, 'multiple_modules'), - 'm1/a.js', - join(enhancedResolveRoot, 'multiple_modules/node_modules/m1/a.js'), - ], - [ - 'from nested directory to not overwritten file in module', - join(enhancedResolveRoot, 'multiple_modules'), - 'm1/b.js', - join(enhancedResolveRoot, 'node_modules/m1/b.js'), - ], - [ - 'file with query', - enhancedResolveRoot, - './main1.js?query', - join(enhancedResolveRoot, 'main1.js?query'), - ], - [ - 'file with fragment', - enhancedResolveRoot, - './main1.js#fragment', - join(enhancedResolveRoot, 'main1.js#fragment'), - ], - [ - 'file with fragment and query', - enhancedResolveRoot, - './main1.js#fragment?query', - join(enhancedResolveRoot, 'main1.js#fragment?query'), - ], - [ - 'file with query and fragment', - enhancedResolveRoot, - './main1.js?#fragment', - join(enhancedResolveRoot, 'main1.js?#fragment'), - ], - - [ - 'file with query (unicode)', - enhancedResolveRoot, - './测试.js?query', - join(enhancedResolveRoot, '测试.js?query'), - ], - [ - 'file with fragment (unicode)', - enhancedResolveRoot, - './测试.js#fragment', - join(enhancedResolveRoot, '测试.js#fragment'), - ], - [ - 'file with fragment and query (unicode)', - enhancedResolveRoot, - './测试.js#fragment?query', - join(enhancedResolveRoot, '测试.js#fragment?query'), - ], - [ - 'file with query and fragment (unicode)', - enhancedResolveRoot, - './测试.js?#fragment', - join(enhancedResolveRoot, '测试.js?#fragment'), - ], - - [ - 'file in module with query', - enhancedResolveRoot, - 'm1/a?query', - join(enhancedResolveRoot, 'node_modules/m1/a.js?query'), - ], - [ - 'file in module with fragment', - enhancedResolveRoot, - 'm1/a#fragment', - join(enhancedResolveRoot, 'node_modules/m1/a.js#fragment'), - ], - [ - 'file in module with fragment and query', - enhancedResolveRoot, - 'm1/a#fragment?query', - join(enhancedResolveRoot, 'node_modules/m1/a.js#fragment?query'), - ], - [ - 'file in module with query and fragment', - enhancedResolveRoot, - 'm1/a?#fragment', - join(enhancedResolveRoot, 'node_modules/m1/a.js?#fragment'), - ], - [ - 'differ between directory and file, resolve file', - enhancedResolveRoot, - './dirOrFile', - join(enhancedResolveRoot, 'dirOrFile.js'), - ], - [ - 'differ between directory and file, resolve directory', - enhancedResolveRoot, - './dirOrFile/', - join(enhancedResolveRoot, 'dirOrFile/index.js'), - ], - [ - 'find node_modules outside of node_modules', - join(enhancedResolveRoot, 'browser-module/node_modules'), - 'm1/a', - join(enhancedResolveRoot, 'node_modules/m1/a.js'), - ], - [ - "don't crash on main field pointing to self", - enhancedResolveRoot, - './main-field-self', - join(enhancedResolveRoot, './main-field-self/index.js'), - ], - [ - "don't crash on main field pointing to self (2)", - enhancedResolveRoot, - './main-field-self2', - join(enhancedResolveRoot, './main-field-self2/index.js'), - ], - // enhanced-resolve has `#` prepended with a `\0`, they are removed from the - // following 3 expected test results. - // See https://github.com/webpack/enhanced-resolve#escaping - [ - 'handle fragment edge case (no fragment)', - enhancedResolveRoot, - './no#fragment/#/#', - join(enhancedResolveRoot, 'no#fragment', '#', '#.js'), - ], - [ - 'handle fragment edge case (fragment)', - enhancedResolveRoot, - './no#fragment/#/', - join(enhancedResolveRoot, 'no.js#fragment') + '/#/', - ], - [ - 'handle fragment escaping', - enhancedResolveRoot, - './no\0#fragment/\0#/\0##fragment', - join(enhancedResolveRoot, 'no#fragment', '#', '#.js#fragment'), - ], -]) { - test(title, (t) => { - const resolver = new ResolverFactory({ - modules: ['src/a', 'src/b', 'src/common', 'node_modules'], - extensions: ['.js', '.jsx', '.ts', '.tsx'], - }) - - t.is(resolver.sync(context, request).path, expected) - }) -} - -test('resolve pnpm package', (t) => { - const rootDir = join(currentDir, '..', '..'); - const pnpmProjectPath = join(rootDir, 'fixtures', 'pnpm') - const resolver = new ResolverFactory({ - aliasFields: ['browser'], - }) - t.deepEqual(resolver.sync(pnpmProjectPath, 'styled-components'), { - path: join( - rootDir, - 'node_modules/.pnpm/styled-components@6.1.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/styled-components/dist/styled-components.browser.cjs.js' - ), - }) - t.deepEqual( - resolver.sync( - join( - rootDir, - 'node_modules/.pnpm/styled-components@6.1.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/styled-components' - ), - 'react' - ), - { - path: join( - rootDir, - 'node_modules/.pnpm/react@18.3.1/node_modules/react/index.js' - ), - } - ) -}) diff --git a/napi/src/lib.rs b/napi/src/lib.rs deleted file mode 100644 index 7cd839c5..00000000 --- a/napi/src/lib.rs +++ /dev/null @@ -1,214 +0,0 @@ -extern crate napi; -extern crate napi_derive; -extern crate oxc_resolver; - -use std::{ - path::{Path, PathBuf}, - sync::Arc, -}; - -use napi::{bindgen_prelude::AsyncTask, Task}; -use napi_derive::napi; -use oxc_resolver::{ResolveOptions, Resolver}; - -use self::{ - options::{NapiResolveOptions, StrOrStrList}, - tracing::init_tracing, -}; - -mod options; -mod tracing; - -#[napi(object)] -pub struct ResolveResult { - pub path: Option, - pub error: Option, - /// "type" field in the package.json file - pub module_type: Option, -} - -fn resolve(resolver: &Resolver, path: &Path, request: &str) -> ResolveResult { - match resolver.resolve(path, request) { - Ok(resolution) => ResolveResult { - path: Some(resolution.full_path().to_string_lossy().to_string()), - error: None, - module_type: resolution - .package_json() - .and_then(|p| p.r#type.as_ref()) - .and_then(|t| t.as_str()) - .map(|t| t.to_string()), - }, - Err(err) => ResolveResult { path: None, module_type: None, error: Some(err.to_string()) }, - } -} - -#[allow(clippy::needless_pass_by_value)] -#[napi] -pub fn sync(path: String, request: String) -> ResolveResult { - let path = PathBuf::from(path); - let resolver = Resolver::new(ResolveOptions::default()); - resolve(&resolver, &path, &request) -} - -pub struct ResolveTask { - resolver: Arc, - directory: PathBuf, - request: String, -} - -#[napi] -impl Task for ResolveTask { - type Output = ResolveResult; - type JsValue = ResolveResult; - - fn compute(&mut self) -> napi::Result { - Ok(resolve(&self.resolver, &self.directory, &self.request)) - } - - fn resolve(&mut self, _: napi::Env, result: Self::Output) -> napi::Result { - Ok(result) - } -} - -#[napi] -pub struct ResolverFactory { - resolver: Arc, -} - -#[napi] -impl ResolverFactory { - #[napi(constructor)] - pub fn new(options: NapiResolveOptions) -> Self { - init_tracing(); - Self { resolver: Arc::new(Resolver::new(Self::normalize_options(options))) } - } - - #[napi] - pub fn default() -> Self { - let default_options = ResolveOptions::default(); - Self { resolver: Arc::new(Resolver::new(default_options)) } - } - - /// Clone the resolver using the same underlying cache. - #[napi] - pub fn clone_with_options(&self, options: NapiResolveOptions) -> Self { - Self { - resolver: Arc::new(self.resolver.clone_with_options(Self::normalize_options(options))), - } - } - - /// Clear the underlying cache. - #[napi] - pub fn clear_cache(&self) { - self.resolver.clear_cache(); - } - - /// Synchronously resolve `specifier` at an absolute path to a `directory`. - #[allow(clippy::needless_pass_by_value)] - #[napi] - pub fn sync(&self, directory: String, request: String) -> ResolveResult { - let path = PathBuf::from(directory); - resolve(&self.resolver, &path, &request) - } - - /// Asynchronously resolve `specifier` at an absolute path to a `directory`. - #[allow(clippy::needless_pass_by_value)] - #[napi(js_name = "async")] - pub fn resolve_async(&self, directory: String, request: String) -> AsyncTask { - let path = PathBuf::from(directory); - let resolver = self.resolver.clone(); - AsyncTask::new(ResolveTask { resolver, directory: path, request }) - } - - fn normalize_options(op: NapiResolveOptions) -> ResolveOptions { - let default = ResolveOptions::default(); - // merging options - ResolveOptions { - tsconfig: op.tsconfig.map(|tsconfig| tsconfig.into()), - alias: op - .alias - .map(|alias| { - alias - .into_iter() - .map(|(k, v)| { - let v = v - .into_iter() - .map(|item| match item { - Some(path) => oxc_resolver::AliasValue::from(path), - None => oxc_resolver::AliasValue::Ignore, - }) - .collect(); - (k, v) - }) - .collect::>() - }) - .unwrap_or(default.alias), - alias_fields: op - .alias_fields - .map(|o| o.into_iter().map(|x| StrOrStrList(x).into()).collect::>()) - .unwrap_or(default.alias_fields), - condition_names: op.condition_names.unwrap_or(default.condition_names), - description_files: op.description_files.unwrap_or(default.description_files), - enforce_extension: op - .enforce_extension - .map(|enforce_extension| enforce_extension.into()) - .unwrap_or(default.enforce_extension), - exports_fields: op - .exports_fields - .map(|o| o.into_iter().map(|x| StrOrStrList(x).into()).collect::>()) - .unwrap_or(default.exports_fields), - imports_fields: op - .imports_fields - .map(|o| o.into_iter().map(|x| StrOrStrList(x).into()).collect::>()) - .unwrap_or(default.imports_fields), - extension_alias: op - .extension_alias - .map(|extension_alias| extension_alias.into_iter().collect::>()) - .unwrap_or(default.extension_alias), - extensions: op.extensions.unwrap_or(default.extensions), - fallback: op - .fallback - .map(|fallback| { - fallback - .into_iter() - .map(|(k, v)| { - let v = v - .into_iter() - .map(|item| match item { - Some(path) => oxc_resolver::AliasValue::from(path), - None => oxc_resolver::AliasValue::Ignore, - }) - .collect(); - (k, v) - }) - .collect::>() - }) - .unwrap_or(default.fallback), - fully_specified: op.fully_specified.unwrap_or(default.fully_specified), - main_fields: op - .main_fields - .map(|o| StrOrStrList(o).into()) - .unwrap_or(default.main_fields), - main_files: op.main_files.unwrap_or(default.main_files), - modules: op.modules.map(|o| StrOrStrList(o).into()).unwrap_or(default.modules), - resolve_to_context: op.resolve_to_context.unwrap_or(default.resolve_to_context), - prefer_relative: op.prefer_relative.unwrap_or(default.prefer_relative), - prefer_absolute: op.prefer_absolute.unwrap_or(default.prefer_absolute), - restrictions: op - .restrictions - .map(|restrictions| { - restrictions - .into_iter() - .map(|restriction| restriction.into()) - .collect::>() - }) - .unwrap_or(default.restrictions), - roots: op - .roots - .map(|roots| roots.into_iter().map(PathBuf::from).collect::>()) - .unwrap_or(default.roots), - symlinks: op.symlinks.unwrap_or(default.symlinks), - builtin_modules: op.builtin_modules.unwrap_or(default.builtin_modules), - } - } -} diff --git a/napi/src/options.rs b/napi/src/options.rs deleted file mode 100644 index ea35672f..00000000 --- a/napi/src/options.rs +++ /dev/null @@ -1,261 +0,0 @@ -use std::path::PathBuf; - -use napi::Either; -use napi_derive::napi; -use std::collections::HashMap; - -/// Module Resolution Options -/// -/// Options are directly ported from [enhanced-resolve](https://github.com/webpack/enhanced-resolve#resolver-options). -/// -/// See [webpack resolve](https://webpack.js.org/configuration/resolve/) for information and examples -#[derive(Debug, Clone)] -#[napi(object)] -pub struct NapiResolveOptions { - /// Path to TypeScript configuration file. - /// - /// Default `None` - pub tsconfig: Option, - - /// Alias for [ResolveOptions::alias] and [ResolveOptions::fallback]. - /// - /// For the second value of the tuple, `None -> AliasValue::Ignore`, Some(String) -> - /// AliasValue::Path(String)` - /// Create aliases to import or require certain modules more easily. - /// A trailing $ can also be added to the given object's keys to signify an exact match. - pub alias: Option>>>, - - /// A list of alias fields in description files. - /// Specify a field, such as `browser`, to be parsed according to [this specification](https://github.com/defunctzombie/package-browser-field-spec). - /// Can be a path to json object such as `["path", "to", "exports"]`. - /// - /// Default `[]` - #[napi(ts_type = "(string | string[])[]")] - pub alias_fields: Option>, - - /// Condition names for exports field which defines entry points of a package. - /// The key order in the exports field is significant. During condition matching, earlier entries have higher priority and take precedence over later entries. - /// - /// Default `[]` - pub condition_names: Option>, - - /// The JSON files to use for descriptions. (There was once a `bower.json`.) - /// - /// Default `["package.json"]` - pub description_files: Option>, - - /// If true, it will not allow extension-less files. - /// So by default `require('./foo')` works if `./foo` has a `.js` extension, - /// but with this enabled only `require('./foo.js')` will work. - /// - /// Default to `true` when [ResolveOptions::extensions] contains an empty string. - /// Use `Some(false)` to disable the behavior. - /// See - /// - /// Default None, which is the same as `Some(false)` when the above empty rule is not applied. - pub enforce_extension: Option, - - /// A list of exports fields in description files. - /// Can be a path to json object such as `["path", "to", "exports"]`. - /// - /// Default `[["exports"]]`. - #[napi(ts_type = "(string | string[])[]")] - pub exports_fields: Option>, - - /// Fields from `package.json` which are used to provide the internal requests of a package - /// (requests starting with # are considered internal). - /// - /// Can be a path to a JSON object such as `["path", "to", "imports"]`. - /// - /// Default `[["imports"]]`. - #[napi(ts_type = "(string | string[])[]")] - pub imports_fields: Option>, - - /// An object which maps extension to extension aliases. - /// - /// Default `{}` - pub extension_alias: Option>>, - - /// Attempt to resolve these extensions in order. - /// If multiple files share the same name but have different extensions, - /// will resolve the one with the extension listed first in the array and skip the rest. - /// - /// Default `[".js", ".json", ".node"]` - pub extensions: Option>, - - /// Redirect module requests when normal resolving fails. - /// - /// Default `[]` - pub fallback: Option>>>, - - /// 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). - /// - /// See also webpack configuration [resolve.fullySpecified](https://webpack.js.org/configuration/module/#resolvefullyspecified) - /// - /// Default `false` - pub fully_specified: Option, - - /// A list of main fields in description files - /// - /// Default `["main"]`. - #[napi(ts_type = "string | string[]")] - pub main_fields: Option, - - /// The filename to be used while resolving directories. - /// - /// Default `["index"]` - pub main_files: Option>, - - /// A list of directories to resolve modules from, can be absolute path or folder name. - /// - /// Default `["node_modules"]` - #[napi(ts_type = "string | string[]")] - pub modules: Option, - - /// Resolve to a context instead of a file. - /// - /// Default `false` - pub resolve_to_context: Option, - - /// Prefer to resolve module requests as relative requests instead of using modules from node_modules directories. - /// - /// Default `false` - pub prefer_relative: Option, - - /// Prefer to resolve server-relative urls as absolute paths before falling back to resolve in ResolveOptions::roots. - /// - /// Default `false` - pub prefer_absolute: Option, - - /// A list of resolve restrictions to restrict the paths that a request can be resolved on. - /// - /// Default `[]` - pub restrictions: Option>, - - /// A list of directories where requests of server-relative URLs (starting with '/') are resolved. - /// On non-Windows systems these requests are resolved as an absolute path first. - /// - /// Default `[]` - pub roots: Option>, - - /// Whether to resolve symlinks to their symlinked location. - /// When enabled, symlinked resources are resolved to their real path, not their symlinked location. - /// Note that this may cause module resolution to fail when using tools that symlink packages (like npm link). - /// - /// Default `true` - pub symlinks: Option, - - /// Whether to parse [module.builtinModules](https://nodejs.org/api/module.html#modulebuiltinmodules) or not. - /// For example, "zlib" will throw [crate::ResolveError::Builtin] when set to true. - /// - /// Default `false` - pub builtin_modules: Option, -} - -#[napi] -#[derive(Debug, PartialEq, Eq)] -pub enum EnforceExtension { - Auto, - Enabled, - Disabled, -} - -impl EnforceExtension { - pub fn is_auto(&self) -> bool { - *self == Self::Auto - } - - pub fn is_enabled(&self) -> bool { - *self == Self::Enabled - } - - pub fn is_disabled(&self) -> bool { - *self == Self::Disabled - } -} - -/// Alias Value for [ResolveOptions::alias] and [ResolveOptions::fallback]. -/// Use struct because napi don't support structured union now -#[napi(object)] -#[derive(Debug, Clone)] -pub struct Restriction { - pub path: Option, - pub regex: Option, -} - -/// Tsconfig Options -/// -/// Derived from [tsconfig-paths-webpack-plugin](https://github.com/dividab/tsconfig-paths-webpack-plugin#options) -#[napi(object)] -#[derive(Debug, Clone)] -pub struct TsconfigOptions { - /// Allows you to specify where to find the TypeScript configuration file. - /// You may provide - /// * a relative path to the configuration file. It will be resolved relative to cwd. - /// * an absolute path to the configuration file. - pub config_file: String, - - /// Support for Typescript Project References. - /// - /// * `'auto'`: use the `references` field from tsconfig of `config_file`. - /// * `string[]`: manually provided relative or absolute path. - #[napi(ts_type = "'auto' | string[]")] - pub references: Option>>, -} - -impl Into for Restriction { - fn into(self) -> oxc_resolver::Restriction { - match (self.path, self.regex) { - (None, None) => { - panic!("Should specify path or regex") - } - (None, Some(regex)) => oxc_resolver::Restriction::RegExp(regex), - (Some(path), None) => oxc_resolver::Restriction::Path(PathBuf::from(path)), - (Some(_), Some(_)) => { - panic!("Restriction can't be path and regex at the same time") - } - } - } -} - -impl Into for EnforceExtension { - fn into(self) -> oxc_resolver::EnforceExtension { - match self { - EnforceExtension::Auto => oxc_resolver::EnforceExtension::Auto, - EnforceExtension::Enabled => oxc_resolver::EnforceExtension::Enabled, - EnforceExtension::Disabled => oxc_resolver::EnforceExtension::Disabled, - } - } -} - -impl Into for TsconfigOptions { - fn into(self) -> oxc_resolver::TsconfigOptions { - oxc_resolver::TsconfigOptions { - config_file: PathBuf::from(self.config_file), - references: match self.references { - Some(Either::A(string)) if string.as_str() == "auto" => { - oxc_resolver::TsconfigReferences::Auto - } - Some(Either::A(opt)) => { - panic!("`{}` is not a valid option for tsconfig references", opt) - } - Some(Either::B(paths)) => oxc_resolver::TsconfigReferences::Paths( - paths.into_iter().map(PathBuf::from).collect::>(), - ), - None => oxc_resolver::TsconfigReferences::Disabled, - }, - } - } -} - -type StrOrStrListType = Either>; -pub struct StrOrStrList(pub StrOrStrListType); - -impl Into> for StrOrStrList { - fn into(self) -> Vec { - match self { - StrOrStrList(Either::A(s)) => Vec::from([s]), - StrOrStrList(Either::B(a)) => a, - } - } -} diff --git a/napi/src/tracing.rs b/napi/src/tracing.rs deleted file mode 100644 index 88e4cd7e..00000000 --- a/napi/src/tracing.rs +++ /dev/null @@ -1,25 +0,0 @@ -use std::sync::OnceLock; - -use tracing_subscriber::filter::Targets; -use tracing_subscriber::prelude::__tracing_subscriber_SubscriberExt; -use tracing_subscriber::util::SubscriberInitExt; - -/// To debug `oxc_resolver`: -/// `OXC_LOG=DEBUG your program` -pub fn init_tracing() { - static TRACING: OnceLock<()> = OnceLock::new(); - TRACING.get_or_init(|| { - // Usage without the `regex` feature. - // - tracing_subscriber::registry() - .with(std::env::var("OXC_LOG").map_or_else( - |_| Targets::new(), - |env_var| { - use std::str::FromStr; - Targets::from_str(&env_var).unwrap() - }, - )) - .with(tracing_subscriber::fmt::layer()) - .init(); - }); -} diff --git a/napi/tests/options.test.mjs b/napi/tests/options.test.mjs deleted file mode 100644 index 4a93efff..00000000 --- a/napi/tests/options.test.mjs +++ /dev/null @@ -1,59 +0,0 @@ -import { describe, it } from "node:test"; -import { ResolverFactory } from "../index.js"; -import * as assert from "node:assert"; -import * as path from "node:path"; - -const fixtureDir = new URL( - "../../fixtures/enhanced_resolve/test/fixtures", - import.meta.url -).pathname; - -describe("option", () => { - describe("aliasFields", () => { - it("should allow field string ", () => { - const resolver = new ResolverFactory({ aliasFields: ["browser"] }); - assert.match( - resolver.sync(fixtureDir, "./browser-module/lib/replaced.js").path, - /browser-module\/lib\/browser\.js$/ - ); - }); - it("should allow json path array", () => { - const resolver = new ResolverFactory({ - aliasFields: [["innerBrowser1", "field", "browser"]], - }); - - assert.match( - resolver.sync(fixtureDir, "./browser-module/lib/main1.js").path, - /browser-module\/lib\/main\.js$/ - ); - }); - }); - - describe("exportsFields", () => { - const createTest = (exportsFields) => { - const resolver = new ResolverFactory({ exportsFields }); - assert.match( - resolver.sync( - path.resolve(fixtureDir, "./exports-field3"), - "exports-field" - ).path, - /\/exports-field\/src\/index\.js$/ - ); - }; - it("should allow string as field item", createTest(["broken"])); - it("should allow json path array as field item", createTest([["broken"]])); - }); - - describe("mainFields", () => { - const createTest = (mainFields) => { - const resolver = new ResolverFactory({ mainFields }); - assert.match( - resolver.sync(fixtureDir, "../..").path, - /\/lib\/index\.js$/ - ); - }; - it("should use `'main'` as default", createTest(undefined)); - it("should allow field string", createTest("main")); - it("should allow field array", createTest(["main"])); - }); -}); diff --git a/npm/package.json b/npm/package.json index 85422809..7136edb8 100644 --- a/npm/package.json +++ b/npm/package.json @@ -1,47 +1,36 @@ { - "name": "oxc-resolver", - "version": "1.11.0", - "description": "Oxc Resolver Node API", - "main": "index.js", - "browser": "browser.js", - "files": [ - "index.d.ts", - "index.js", - "browser.js" - ], - "license": "MIT", - "homepage": "https://oxc.rs", - "repository": { - "type": "git", - "url": "git+https://github.com/oxc-project/oxc-resolver.git" - }, - "publishConfig": { - "registry": "https://registry.npmjs.org/", - "access": "public" - }, - "napi": { - "binaryName": "resolver", - "packageName": "@oxc-resolver/binding", - "wasm": { - "browser": { - "fs": true - } - }, - "targets": [ - "x86_64-pc-windows-msvc", - "aarch64-pc-windows-msvc", - "x86_64-unknown-linux-gnu", - "x86_64-unknown-linux-musl", - "x86_64-unknown-freebsd", - "aarch64-unknown-linux-gnu", - "aarch64-unknown-linux-musl", - "armv7-unknown-linux-gnueabihf", - "x86_64-apple-darwin", - "aarch64-apple-darwin", - "wasm32-wasip1-threads" - ] - }, - "funding": { - "url": "https://github.com/sponsors/Boshen" - } + "browser": "browser.js", + "description": "Oxc Resolver Node API", + "files": [ + "index.d.ts", + "index.js", + "browser.js" + ], + "funding": { + "url": "https://github.com/sponsors/Boshen" + }, + "main": "index.js", + "name": "oxc-resolver", + "napi": { + "binaryName": "resolver", + "packageName": "@oxc-resolver/binding", + "targets": [ + "x86_64-pc-windows-msvc", + "aarch64-pc-windows-msvc", + "x86_64-unknown-linux-gnu", + "x86_64-unknown-linux-musl", + "x86_64-unknown-freebsd", + "aarch64-unknown-linux-gnu", + "aarch64-unknown-linux-musl", + "armv7-unknown-linux-gnueabihf", + "x86_64-apple-darwin", + "aarch64-apple-darwin", + "wasm32-wasip1-threads" + ], + "wasm": { + "browser": { + "fs": true + } + } + } } diff --git a/package.json b/package.json index 30892ca3..d0ee7633 100644 --- a/package.json +++ b/package.json @@ -1,33 +1,24 @@ { - "name": "@oxc-resolver/binding", - "private": true, - "version": "0.0.0", - "scripts": { - "build": "napi build --platform --release --package-json-path npm/package.json --manifest-path napi/Cargo.toml", - "build:debug": "napi build --platform --package-json-path npm/package.json --manifest-path napi/Cargo.toml", - "prepublishOnly": "napi pre-publish -t npm", - "test": "ava" - }, - "devDependencies": { - "@napi-rs/cli": "3.0.0-alpha.62", - "@napi-rs/wasm-runtime": "^0.2.4", - "@types/node": "^22.0.0", - "ava": "^6.1.3", - "emnapi": "^1.2.0", - "typescript": "^5.5.3" - }, - "ava": { - "files": [ - "napi/__test__/*.spec.mjs" - ], - "cache": false - }, - "packageManager": "pnpm@9.9.0", - "repository": { - "type": "git", - "url": "git+https://github.com/oxc-project/oxc-resolver.git" - }, - "funding": { - "url": "https://github.com/sponsors/Boshen" - } + "ava": { + "cache": false, + "files": [ + "napi/__test__/*.spec.mjs" + ] + }, + "devDependencies": { + "@napi-rs/cli": "3.0.0-alpha.62", + "@napi-rs/wasm-runtime": "^0.2.4", + "@types/node": "^22.0.0", + "ava": "^6.1.3", + "emnapi": "^1.2.0" + }, + "funding": { + "url": "https://github.com/sponsors/Boshen" + }, + "name": "@oxc-resolver/binding", + "scripts": { + "build": "napi build --platform --release --package-json-path npm/package.json --manifest-path napi/Cargo.toml", + "build:debug": "napi build --platform --package-json-path npm/package.json --manifest-path napi/Cargo.toml", + "prepublishOnly": "napi pre-publish -t npm" + } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml deleted file mode 100644 index db9e5b63..00000000 --- a/pnpm-lock.yaml +++ /dev/null @@ -1,2598 +0,0 @@ -lockfileVersion: '9.0' - -settings: - autoInstallPeers: true - excludeLinksFromLockfile: false - -importers: - - .: - devDependencies: - '@napi-rs/cli': - specifier: 3.0.0-alpha.62 - version: 3.0.0-alpha.62(@emnapi/runtime@1.2.0)(emnapi@1.2.0) - '@napi-rs/wasm-runtime': - specifier: ^0.2.4 - version: 0.2.4 - '@types/node': - specifier: ^22.0.0 - version: 22.5.4 - ava: - specifier: ^6.1.3 - version: 6.1.3 - emnapi: - specifier: ^1.2.0 - version: 1.2.0 - typescript: - specifier: ^5.5.3 - version: 5.5.4 - - fixtures/pnpm: - devDependencies: - axios: - specifier: 1.6.2 - version: 1.6.2 - ipaddr.js: - specifier: 2.2.0 - version: 2.2.0 - postcss: - specifier: 8.4.33 - version: 8.4.33 - styled-components: - specifier: 6.1.1 - version: 6.1.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - - npm: {} - -packages: - - '@emnapi/core@1.2.0': - resolution: {integrity: sha512-E7Vgw78I93we4ZWdYCb4DGAwRROGkMIXk7/y87UmANR+J6qsWusmC3gLt0H+O0KOt5e6O38U8oJamgbudrES/w==} - - '@emnapi/runtime@1.2.0': - resolution: {integrity: sha512-bV21/9LQmcQeCPEg3BDFtvwL6cwiTMksYNWQQ4KOxCZikEGalWtenoZ0wCiukJINlGCIi2KXx01g4FoH/LxpzQ==} - - '@emnapi/wasi-threads@1.0.1': - resolution: {integrity: sha512-iIBu7mwkq4UQGeMEM8bLwNK962nXdhodeScX4slfQnRhEMMzvYivHhutCIk8uojvmASXXPC2WNEjwxFWk72Oqw==} - - '@emotion/is-prop-valid@1.2.2': - resolution: {integrity: sha512-uNsoYd37AFmaCdXlg6EYD1KaPOaRWRByMCYzbKUX4+hhMfrxdVSelShywL4JVaAeM/eHUOSprYBQls+/neX3pw==} - - '@emotion/memoize@0.8.1': - resolution: {integrity: sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA==} - - '@emotion/unitless@0.8.1': - resolution: {integrity: sha512-KOEGMu6dmJZtpadb476IsZBclKvILjopjUii3V+7MnXIQCYh8W3NgNcgwo21n9LXZX6EDIKvqfjYxXebDwxKmQ==} - - '@inquirer/checkbox@2.3.10': - resolution: {integrity: sha512-CTc864M2/523rKc9AglIzAcUCuPXDZENgc5S2KZFVRbnMzpXcYTsUWmbqSeL0XLvtlvEtNevkkVbfVhJpruOyQ==} - engines: {node: '>=18'} - - '@inquirer/confirm@3.1.14': - resolution: {integrity: sha512-nbLSX37b2dGPtKWL3rPuR/5hOuD30S+pqJ/MuFiUEgN6GiMs8UMxiurKAMDzKt6C95ltjupa8zH6+3csXNHWpA==} - engines: {node: '>=18'} - - '@inquirer/core@9.0.2': - resolution: {integrity: sha512-nguvH3TZar3ACwbytZrraRTzGqyxJfYJwv+ZwqZNatAosdWQMP1GV8zvmkNlBe2JeZSaw0WYBHZk52pDpWC9qA==} - engines: {node: '>=18'} - - '@inquirer/editor@2.1.14': - resolution: {integrity: sha512-6nWpoJyVAKwAcv67bkbBmmi3f32xua79fP7TRmNUoR4K+B1GiOBsHO1YdvET/jvC+nTlBZL7puKAKyM7G+Lkzw==} - engines: {node: '>=18'} - - '@inquirer/expand@2.1.14': - resolution: {integrity: sha512-JcxsLajwPykF2kq6biIUdoOzTQ3LXqb8XMVrWkCprG/pFeU1SsxcSSFbF1T5jJGvvlTVcsE+JdGjbQ8ZRZ82RA==} - engines: {node: '>=18'} - - '@inquirer/figures@1.0.3': - resolution: {integrity: sha512-ErXXzENMH5pJt5/ssXV0DfWUZqly8nGzf0UcBV9xTnP+KyffE2mqyxIMBrZ8ijQck2nU0TQm40EQB53YreyWHw==} - engines: {node: '>=18'} - - '@inquirer/input@2.2.1': - resolution: {integrity: sha512-Yl1G6h7qWydzrJwqN777geeJVaAFL5Ly83aZlw4xHf8Z/BoTMfKRheyuMaQwOG7LQ4e5nQP7PxXdEg4SzQ+OKw==} - engines: {node: '>=18'} - - '@inquirer/number@1.0.2': - resolution: {integrity: sha512-GcoK+Phxcln0Qw9e73S5a8B2Ejg3HgSTvNfDegIcS5/BKwUm8t5rejja1l09WXjZM9vrVbRDf9RzWtSUiWVYRQ==} - engines: {node: '>=18'} - - '@inquirer/password@2.1.14': - resolution: {integrity: sha512-sPzOkXLhWJQ96K6nPZFnF8XB8tsDrcCRobd1d3EDz81F+4hp8BbdmsnsQcqZ7oYDIOVM/mWJyIUtJ35TrssJxQ==} - engines: {node: '>=18'} - - '@inquirer/prompts@5.1.2': - resolution: {integrity: sha512-E+ndnfwtVQtcmPt888Hc/HAxJUHSaA6OIvyvLAQ5BLQv+t20GbYdFSjXeLgb47OpMU+aRsKA/ys+Zoylw3kTVg==} - engines: {node: '>=18'} - - '@inquirer/rawlist@2.1.14': - resolution: {integrity: sha512-pLpEzhKNQ/ugFAFfgCNaXljB+dcCwmXwR1jOxAbVeFIdB3l02E5gjI+h1rb136tq0T8JO6P5KFR1oTeld/wdrA==} - engines: {node: '>=18'} - - '@inquirer/select@2.3.10': - resolution: {integrity: sha512-rr7iR0Zj1YFfgM8IUGimPD9Yukd+n/U63CnYT9kdum6DbRXtMxR45rrreP+EA9ixCnShr+W4xj7suRxC1+8t9g==} - engines: {node: '>=18'} - - '@inquirer/type@1.4.0': - resolution: {integrity: sha512-AjOqykVyjdJQvtfkNDGUyMYGF8xN50VUxftCQWsOyIo4DFRLr6VQhW0VItGI1JIyQGCGgIpKa7hMMwNhZb4OIw==} - engines: {node: '>=18'} - - '@mapbox/node-pre-gyp@1.0.11': - resolution: {integrity: sha512-Yhlar6v9WQgUp/He7BdgzOz8lqMQ8sU+jkCq7Wx8Myc5YFJLbEe7lgui/V7G1qB1DJykHSGwreceSaD60Y0PUQ==} - hasBin: true - - '@napi-rs/cli@3.0.0-alpha.62': - resolution: {integrity: sha512-IDUwHAEJZ9ad/s5oyhznrz5ZDcU+SJ6GdP5nb++Wx5MkS4FD9MeS3HfNZdsxkf10pOUPnmvCVFuG4xnLBQYmjw==} - engines: {node: '>= 16'} - hasBin: true - peerDependencies: - '@emnapi/runtime': ^1.1.0 - emnapi: ^1.1.0 - peerDependenciesMeta: - '@emnapi/runtime': - optional: true - emnapi: - optional: true - - '@napi-rs/cross-toolchain@0.0.16': - resolution: {integrity: sha512-jwdjHT5L0m9MH0CmzDwPp0ckn/UO7afHCsPeo7NugHUvYgvlgS7SWhdMVgIgJW2HHqhcW/2nhaLLGpAU1c7QRQ==} - peerDependencies: - '@napi-rs/cross-toolchain-arm64-target-aarch64': ^0.0.16 - '@napi-rs/cross-toolchain-arm64-target-armv7': ^0.0.16 - '@napi-rs/cross-toolchain-arm64-target-x86_64': ^0.0.16 - '@napi-rs/cross-toolchain-x64-target-aarch64': ^0.0.16 - '@napi-rs/cross-toolchain-x64-target-armv7': ^0.0.16 - '@napi-rs/cross-toolchain-x64-target-x86_64': ^0.0.16 - peerDependenciesMeta: - '@napi-rs/cross-toolchain-arm64-target-aarch64': - optional: true - '@napi-rs/cross-toolchain-arm64-target-armv7': - optional: true - '@napi-rs/cross-toolchain-arm64-target-x86_64': - optional: true - '@napi-rs/cross-toolchain-x64-target-aarch64': - optional: true - '@napi-rs/cross-toolchain-x64-target-armv7': - optional: true - '@napi-rs/cross-toolchain-x64-target-x86_64': - optional: true - - '@napi-rs/lzma-android-arm-eabi@1.3.1': - resolution: {integrity: sha512-mtGOg8jXlc+pTBI86cqohfndS9UmOAkk9d5CChKMb8btVks70yhUN1e7YYS3QFbmoxbPs2Ee+wmuH1Khdc7B2w==} - engines: {node: '>= 10'} - cpu: [arm] - os: [android] - - '@napi-rs/lzma-android-arm64@1.3.1': - resolution: {integrity: sha512-4uGkQgAv9Tnc/i0k2eIgbhZgyzs94+iECWxz4MFZNcZ1fNGvGbRL2j+SITE4OmwrUn3TuFK/uYWfgzooq8E1Qg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [android] - - '@napi-rs/lzma-darwin-arm64@1.3.1': - resolution: {integrity: sha512-MZBg4iwHTS8icjTiCMdzh8kYrMmKBCEglFPa+vjI91R2XDwuuwSzqmpATRpmMH8cWUUWtGPF4fnxKzjgkzhd4Q==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [darwin] - - '@napi-rs/lzma-darwin-x64@1.3.1': - resolution: {integrity: sha512-7vte+1lYV7xgZERKH/pjAeh4T16aQASKOzu4op70pK6VP/64Plr5rrvqxQqQmlAIe4pwyo/RkFl1n4LXDod3xg==} - engines: {node: '>= 10'} - cpu: [x64] - os: [darwin] - - '@napi-rs/lzma-freebsd-x64@1.3.1': - resolution: {integrity: sha512-uBS74fynTqLUC3catIxyezCafn8UDlr2yxVV47vz1T6Vop2PGDz/cMQdV6rnLSjPE08Rv66ihM36mgf/MmOkOg==} - engines: {node: '>= 10'} - cpu: [x64] - os: [freebsd] - - '@napi-rs/lzma-linux-arm-gnueabihf@1.3.1': - resolution: {integrity: sha512-rrVLyqBJeN29gPJCNkPbZ7dAzaseEcERKyhjwM+DfbFrDUvtkEcrYPvo+iwE/NmF+OkZQkzcanrVMGnq/mcJYQ==} - engines: {node: '>= 10'} - cpu: [arm] - os: [linux] - - '@napi-rs/lzma-linux-arm64-gnu@1.3.1': - resolution: {integrity: sha512-vDmVsthRbX2opkgRirJJGKQxUP/spvyVM2Y5CyCWZ7sadSID3hA97r38gf9ISn/sJ8/r93IPWLq+iycudNKi+Q==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/lzma-linux-arm64-musl@1.3.1': - resolution: {integrity: sha512-x4m/J3hRdFd3IoqKc+4aBcSUkcuDEP7hH6vdss8bKNLjPfXmnG/lcHJEQX3hNnNOULPP8xVRxgiY8jeL62cnsw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/lzma-linux-x64-gnu@1.3.1': - resolution: {integrity: sha512-riB+Xg72NfH8Kcpq07omshVu0QsLW0v2bhywBNYxvA+t2dGGWSIEN1U/zazUXys+IEA6pBQKqLVseurWE6Cl8g==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/lzma-linux-x64-musl@1.3.1': - resolution: {integrity: sha512-JXLgJFwoeysxdSg7rdVYP8wrliCQVJlU5JcLYjRVSCL4P0mQTjnYi7R7VdaOkDACw/Fvlji7oIJXt0KiaDTcOw==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/lzma-wasm32-wasi@1.3.1': - resolution: {integrity: sha512-XTA9XTUtj0KPKuzNS2oi3bWN6tJodk00wwMd/TiKoEqx9Fe/zu+OfDGuXAn+xs+P7S3YCDHqjYinuTQMZ0ucJw==} - engines: {node: '>=14.0.0'} - cpu: [wasm32] - - '@napi-rs/lzma-win32-arm64-msvc@1.3.1': - resolution: {integrity: sha512-qLDfs9UEtLPPTN/FdSz3gSdlx86VwFQBuLBrQtaiYQtUTKZCOYV1Z1fXqFt5Zqa1HKV2oyXnwGcTI7RpcyXxtg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [win32] - - '@napi-rs/lzma-win32-ia32-msvc@1.3.1': - resolution: {integrity: sha512-rWNlxLFMIfvxzfdQCfeQ3D/HEnQG3vfladFYrXUx6ePXO6r+BLCGn6/LWSSuKlw4vKkb1iHEWsAVaRLIcJEMIA==} - engines: {node: '>= 10'} - cpu: [ia32] - os: [win32] - - '@napi-rs/lzma-win32-x64-msvc@1.3.1': - resolution: {integrity: sha512-SNfHNqEjabXfTL1+KRi0qiAhwIlZHhQystvfSYX6p1g+2trSC/3WUpUQ4fbbR7KyE31g2AAnwjXivnlQ0af/pg==} - engines: {node: '>= 10'} - cpu: [x64] - os: [win32] - - '@napi-rs/lzma@1.3.1': - resolution: {integrity: sha512-XyZoBlYNMvCulK/RmVK/0nB3j7IdH7HpqcrMMg0U+HqQqKRLOQBwvnKNBocPC1bZQ7iZuKWYTLn1ayZwTyek8w==} - engines: {node: '>= 10'} - - '@napi-rs/tar-android-arm-eabi@0.1.1': - resolution: {integrity: sha512-Ufa0ahZvE5KGrC2WBux5svCe/jvC+e8IgtleiicwqnfgTfbDknYyq/QuqkP1AnMp/IvTmx2iutCZt6OFIG0zAg==} - engines: {node: '>= 10'} - cpu: [arm] - os: [android] - - '@napi-rs/tar-android-arm64@0.1.1': - resolution: {integrity: sha512-KUu5fHIiIObSuZ/crHxUrQ243+LiCRKPwdCVLHwjtftqFjzls+R2Mp6GrpM41XxexDMN00SUta3kazi93Xr19A==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [android] - - '@napi-rs/tar-darwin-arm64@0.1.1': - resolution: {integrity: sha512-jaqgdX20iIga+2gzotQ78eF00Cm8vECocUYeMY62WqyzJNv/jx1dlOfELWEccOjpmawFT9tjWebsS9F1QMvSUg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [darwin] - - '@napi-rs/tar-darwin-x64@0.1.1': - resolution: {integrity: sha512-80sa32IxfRso9x9sGTFpfLSx3BnruyJODpSkUzalOCz9i14n5gOKA8KR/JrnSWwDz0p5l5P9kfQD3pu8Voj7WA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [darwin] - - '@napi-rs/tar-freebsd-x64@0.1.1': - resolution: {integrity: sha512-P7V1zBjjC1dCrTwtUzuzYM4AeZduigeCtd8qQw2IUZowM5AsmhMd77oYuXjdU29cEpKUpyYjJRxjPCzFy+WbAQ==} - engines: {node: '>= 10'} - cpu: [x64] - os: [freebsd] - - '@napi-rs/tar-linux-arm-gnueabihf@0.1.1': - resolution: {integrity: sha512-qpC71ILPkWKt8k1iJCYt5gjwcOkd2VFSQIelTRr12t5CVNKV04rE/TMdwFoCP7kxbtb9Fl2cZzCRISw2BhMCmQ==} - engines: {node: '>= 10'} - cpu: [arm] - os: [linux] - - '@napi-rs/tar-linux-arm64-gnu@0.1.1': - resolution: {integrity: sha512-71QgxcFJCog6O4Tauoge8D0ILkDGJTRk3ru7zG8PUFG1QXJ1kkiRikdT77YmoVxtomc9FUOt+bdEdU5Yn+3QUQ==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/tar-linux-arm64-musl@0.1.1': - resolution: {integrity: sha512-R2e7YEILPKc447N1hUt1zQuyy0st83HX6nhmtFywS1aOj76/3hzxLVrebGiiS6kifyCrO82o66CNTYe7DixMZw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/tar-linux-x64-gnu@0.1.1': - resolution: {integrity: sha512-tmy9q2LXUB2GQ+IgUzJn3+us52leplMu96ORyFq1iHQEelGSqXt4xi5DzU07JhX3obJPqVqkybtcRS4enBfmBA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/tar-linux-x64-musl@0.1.1': - resolution: {integrity: sha512-j5ePbe6vihApl0cGPPDUVTWZbf2mF4NhxngAoG2jp7AeX3cWP2O4pjsvaOraW6QfvWEMFPeER7S0b6eBS7duvA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/tar-wasm32-wasi@0.1.1': - resolution: {integrity: sha512-se0+DlOiIRt7mcz7BeOJDoZtCrROpKLwiAOGmNgrjQ/SZS7TnOPuwm3wy9XN9WLoepttEjCEem6UP8yD5GJuQg==} - engines: {node: '>=14.0.0'} - cpu: [wasm32] - - '@napi-rs/tar-win32-arm64-msvc@0.1.1': - resolution: {integrity: sha512-FDZPi2wC7RwzvodogigLh/pJvhqCTVTUqOYuHlLkPSUbSAGiEkI55wk9RqH3y3EdJQaDuzyqC0QKz5ket2U+GA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [win32] - - '@napi-rs/tar-win32-ia32-msvc@0.1.1': - resolution: {integrity: sha512-OPR9Tou5z5M912G7Kc7gkf1ltinbOQx5dS/OeDIWHvPGOfdFDIxt0YVKhzSLRJi43+zIDp8/+cbeMD/cKXfX8w==} - engines: {node: '>= 10'} - cpu: [ia32] - os: [win32] - - '@napi-rs/tar-win32-x64-msvc@0.1.1': - resolution: {integrity: sha512-hiv5KfhrMSg8tTRC2oQXVckVg1h6ZVjwbd5aF9Esl0V3p2TaNFwwbqgnAN4Gm/PmSnHWNL/IRTHkk3cOzDWihQ==} - engines: {node: '>= 10'} - cpu: [x64] - os: [win32] - - '@napi-rs/tar@0.1.1': - resolution: {integrity: sha512-FOMhwwlvoYjHaDBxP26K3D92ltw1Y/CC4CIjgC6qXdzW4MYNwTlEyI58smCM3k+nCVJH3kpOYyH3sgbK4WZA4A==} - engines: {node: '>= 10'} - - '@napi-rs/wasm-runtime@0.2.4': - resolution: {integrity: sha512-9zESzOO5aDByvhIAsOy9TbpZ0Ur2AJbUI7UT73kcUTS2mxAMHOBaa1st/jAymNoCtvrit99kkzT1FZuXVcgfIQ==} - - '@napi-rs/wasm-tools-android-arm-eabi@0.0.2': - resolution: {integrity: sha512-/b+UU3suXjW4P0DzHRNdrnebQtFKcQf/YMeZJH+xUlKgvwli5kbmWjx8Wqqz0VETVkUTuPqJMBDIVLyc+14FGw==} - engines: {node: '>= 10'} - cpu: [arm] - os: [android] - - '@napi-rs/wasm-tools-android-arm64@0.0.2': - resolution: {integrity: sha512-j57GbDflwJdZtT8pZj5fOV4JAP+LdKN+wzsUYs+QRUoBqpWbbUANudolqfw63bkS9sD4z7fbCuz8iwtJqzxTVA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [android] - - '@napi-rs/wasm-tools-darwin-arm64@0.0.2': - resolution: {integrity: sha512-P2ChgWgVuv9GwmbxN89R84KzIImoTqXINteEixUvmkdnhyFiR+I8deNs89Yed+5w8QLC6MEfrtRqLP9YI+NoQA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [darwin] - - '@napi-rs/wasm-tools-darwin-x64@0.0.2': - resolution: {integrity: sha512-T/kQQ0gt8+wau1Z821PKVAD76QhmwVoLs2CT7Z9tTBs2pJvwSCP0C/kQiQAHcJIMi7A2E9Ab/Mez0BERy50EFA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [darwin] - - '@napi-rs/wasm-tools-freebsd-x64@0.0.2': - resolution: {integrity: sha512-GnnHu+r5sfzuxC/1J5UMF/h3BOZnHb3NQZ5hmbCfZYCKzpzRxrAJhzRunlbRN+v0x8M/49dztVTYR3s7K4ooAw==} - engines: {node: '>= 10'} - cpu: [x64] - os: [freebsd] - - '@napi-rs/wasm-tools-linux-arm64-gnu@0.0.2': - resolution: {integrity: sha512-KnZdLT0OnKb1CG2kdt3/WvM43vr9i+FEwXCvSOVC/6Tsifz7ynhMg7LAVESILd03HubzQJfg9nbRsk0bQ+IOwg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/wasm-tools-linux-arm64-musl@0.0.2': - resolution: {integrity: sha512-HkpZOID2U8P6pWqK3mqZ8bxU5xcuT3iA2fO+jrxn78h006iYgfNmdc5JaVhHnHazMmk32xKhSV4iV0VUh8UWDg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/wasm-tools-linux-x64-gnu@0.0.2': - resolution: {integrity: sha512-YksJWBCyOalB9ogtP9+/dZKP+vR6+h7BmzMXaXMT71WW/GvIsifMVgv+DY/FRSNJQupp5Y+ugjqVAOUOc/G65g==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/wasm-tools-linux-x64-musl@0.0.2': - resolution: {integrity: sha512-sPtRxPMdw05KdTcxgSPMmSXG2+PiK3vJ/l2+g9hvjnnKtvslJN2Hr7j8zgzuoKRAUFPaJVe6+D2xVh5cpdqhww==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/wasm-tools-wasm32-wasi@0.0.2': - resolution: {integrity: sha512-muRvZK7AIuo88G2AxYx3gA59rHMQgoN004saQkBvXnz3K/DVHKfTZ6TtUebss8zI3dURU6xExL8drxFWYxjEbQ==} - engines: {node: '>=14.0.0'} - cpu: [wasm32] - - '@napi-rs/wasm-tools-win32-arm64-msvc@0.0.2': - resolution: {integrity: sha512-Cn13WQ+tpFqdVwx0DIWKbsI9auFyzVZV4F5UNOUeDt6GgOL+NndgJul0Pc9bSU6fi03AylMPfF/nTCaDWO2Wgw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [win32] - - '@napi-rs/wasm-tools-win32-ia32-msvc@0.0.2': - resolution: {integrity: sha512-xsg5DkIQi82a8rcx6246Y3XC8TIqHamY+/C6sIlPLaZEuHctDkMECAw0AANwRf5vN//D2oo2oljOuoYtB1GOKw==} - engines: {node: '>= 10'} - cpu: [ia32] - os: [win32] - - '@napi-rs/wasm-tools-win32-x64-msvc@0.0.2': - resolution: {integrity: sha512-yHigltEt33eq8bappvKsIliz4MxfMPn1M+NWbIFRWN+IS1Z57mhmc1osuk+IRXrSlq0Tom0R6MYN1jpkZKz81Q==} - engines: {node: '>= 10'} - cpu: [x64] - os: [win32] - - '@napi-rs/wasm-tools@0.0.2': - resolution: {integrity: sha512-kBvDQCP5BLw2TxTENXLp3Of7vVEx0uyIye824JHE4dduzzOHVgSoOFVhVqAT3Fx/hLV445RVWfEqQbXMg4w/Mw==} - engines: {node: '>= 10'} - - '@nodelib/fs.scandir@2.1.5': - resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} - engines: {node: '>= 8'} - - '@nodelib/fs.stat@2.0.5': - resolution: {integrity: sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==} - engines: {node: '>= 8'} - - '@nodelib/fs.walk@1.2.8': - resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} - engines: {node: '>= 8'} - - '@octokit/auth-token@5.1.1': - resolution: {integrity: sha512-rh3G3wDO8J9wSjfI436JUKzHIxq8NaiL0tVeB2aXmG6p/9859aUOAjA9pmSPNGGZxfwmaJ9ozOJImuNVJdpvbA==} - engines: {node: '>= 18'} - - '@octokit/core@6.1.2': - resolution: {integrity: sha512-hEb7Ma4cGJGEUNOAVmyfdB/3WirWMg5hDuNFVejGEDFqupeOysLc2sG6HJxY2etBp5YQu5Wtxwi020jS9xlUwg==} - engines: {node: '>= 18'} - - '@octokit/endpoint@10.1.1': - resolution: {integrity: sha512-JYjh5rMOwXMJyUpj028cu0Gbp7qe/ihxfJMLc8VZBMMqSwLgOxDI1911gV4Enl1QSavAQNJcwmwBF9M0VvLh6Q==} - engines: {node: '>= 18'} - - '@octokit/graphql@8.1.1': - resolution: {integrity: sha512-ukiRmuHTi6ebQx/HFRCXKbDlOh/7xEV6QUXaE7MJEKGNAncGI/STSbOkl12qVXZrfZdpXctx5O9X1AIaebiDBg==} - engines: {node: '>= 18'} - - '@octokit/openapi-types@22.2.0': - resolution: {integrity: sha512-QBhVjcUa9W7Wwhm6DBFu6ZZ+1/t/oYxqc2tp81Pi41YNuJinbFRx8B133qVOrAaBbF7D/m0Et6f9/pZt9Rc+tg==} - - '@octokit/plugin-paginate-rest@11.3.3': - resolution: {integrity: sha512-o4WRoOJZlKqEEgj+i9CpcmnByvtzoUYC6I8PD2SA95M+BJ2x8h7oLcVOg9qcowWXBOdcTRsMZiwvM3EyLm9AfA==} - engines: {node: '>= 18'} - peerDependencies: - '@octokit/core': '>=6' - - '@octokit/plugin-request-log@5.3.0': - resolution: {integrity: sha512-FiGcyjdtYPlr03ExBk/0ysIlEFIFGJQAVoPPMxL19B24bVSEiZQnVGBunNtaAF1YnvE/EFoDpXmITtRnyCiypQ==} - engines: {node: '>= 18'} - peerDependencies: - '@octokit/core': '>=6' - - '@octokit/plugin-rest-endpoint-methods@13.2.4': - resolution: {integrity: sha512-gusyAVgTrPiuXOdfqOySMDztQHv6928PQ3E4dqVGEtOvRXAKRbJR4b1zQyniIT9waqaWk/UDaoJ2dyPr7Bk7Iw==} - engines: {node: '>= 18'} - peerDependencies: - '@octokit/core': '>=6' - - '@octokit/request-error@6.1.2': - resolution: {integrity: sha512-sA0oF7aL5wXbNfl+7zgLYJiFZctei9GaIMJlTraJrlQyFaoIYr4MCqPSakzxxGCfm8fET4vn0cQdRFmD7avlDg==} - engines: {node: '>= 18'} - - '@octokit/request@9.1.1': - resolution: {integrity: sha512-pyAguc0p+f+GbQho0uNetNQMmLG1e80WjkIaqqgUkihqUp0boRU6nKItXO4VWnr+nbZiLGEyy4TeKRwqaLvYgw==} - engines: {node: '>= 18'} - - '@octokit/rest@21.0.0': - resolution: {integrity: sha512-XudXXOmiIjivdjNZ+fN71NLrnDM00sxSZlhqmPR3v0dVoJwyP628tSlc12xqn8nX3N0965583RBw5GPo6r8u4Q==} - engines: {node: '>= 18'} - - '@octokit/types@13.5.0': - resolution: {integrity: sha512-HdqWTf5Z3qwDVlzCrP8UJquMwunpDiMPt5er+QjGzL4hqr/vBVY/MauQgS1xWxCDT1oMx1EULyqxncdCY/NVSQ==} - - '@rollup/pluginutils@4.2.1': - resolution: {integrity: sha512-iKnFXr7NkdZAIHiIWE+BX5ULi/ucVFYWD6TbAV+rZctiRTY2PL6tsIKhoIOaoskiWAkgu+VsbXgUVDNLHf+InQ==} - engines: {node: '>= 8.0.0'} - - '@sindresorhus/merge-streams@2.3.0': - resolution: {integrity: sha512-LtoMMhxAlorcGhmFYI+LhPgbPZCkgP6ra1YL604EeF6U98pLlQ3iWIGMdWSC+vWmPBWBNgmDBAhnAobLROJmwg==} - engines: {node: '>=18'} - - '@tybys/wasm-util@0.9.0': - resolution: {integrity: sha512-6+7nlbMVX/PVDCwaIQ8nTOPveOcFLSt8GcXdx8hD0bt39uWxYT88uXzqTd4fTvqta7oeUJqudepapKNt2DYJFw==} - - '@types/mute-stream@0.0.4': - resolution: {integrity: sha512-CPM9nzrCPPJHQNA9keH9CVkVI+WR5kMa+7XEs5jcGQ0VoAGnLv242w8lIVgwAEfmE4oufJRaTc9PNLQl0ioAow==} - - '@types/node@20.16.5': - resolution: {integrity: sha512-VwYCweNo3ERajwy0IUlqqcyZ8/A7Zwa9ZP3MnENWcB11AejO+tLy3pu850goUW2FC/IJMdZUfKpX/yxL1gymCA==} - - '@types/node@22.5.4': - resolution: {integrity: sha512-FDuKUJQm/ju9fT/SeX/6+gBzoPzlVCzfzmGkwKvRHQVxi4BntVbyIwf6a4Xn62mrvndLiml6z/UBXIdEVjQLXg==} - - '@types/stylis@4.2.6': - resolution: {integrity: sha512-4nebF2ZJGzQk0ka0O6+FZUWceyFv4vWq/0dXBMmrSeAwzOuOd/GxE5Pa64d/ndeNLG73dXoBsRzvtsVsYUv6Uw==} - - '@types/wrap-ansi@3.0.0': - resolution: {integrity: sha512-ltIpx+kM7g/MLRZfkbL7EsCEjfzCcScLpkg37eXEtx5kmrAKBkTJwd1GIAjDSL8wTpM6Hzn5YO4pSb91BEwu1g==} - - '@vercel/nft@0.26.5': - resolution: {integrity: sha512-NHxohEqad6Ra/r4lGknO52uc/GrWILXAMs1BB4401GTqww0fw1bAqzpG1XHuDO+dprg4GvsD9ZLLSsdo78p9hQ==} - engines: {node: '>=16'} - hasBin: true - - abbrev@1.1.1: - resolution: {integrity: sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==} - - acorn-import-attributes@1.9.5: - resolution: {integrity: sha512-n02Vykv5uA3eHGM/Z2dQrcD56kL8TyDb2p1+0P83PClMnC/nc+anbQRhIOWnSq4Ke/KvDPrY3C9hDtC/A3eHnQ==} - peerDependencies: - acorn: ^8 - - acorn-walk@8.3.3: - resolution: {integrity: sha512-MxXdReSRhGO7VlFe1bRG/oI7/mdLV9B9JJT0N8vZOhF7gFRR5l3M8W9G8JxmKV+JC5mGqJ0QvqfSOLsCPa4nUw==} - engines: {node: '>=0.4.0'} - - acorn@8.12.1: - resolution: {integrity: sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg==} - engines: {node: '>=0.4.0'} - hasBin: true - - agent-base@6.0.2: - resolution: {integrity: sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==} - engines: {node: '>= 6.0.0'} - - ansi-escapes@4.3.2: - resolution: {integrity: sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==} - engines: {node: '>=8'} - - ansi-regex@5.0.1: - resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} - engines: {node: '>=8'} - - ansi-regex@6.0.1: - resolution: {integrity: sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==} - engines: {node: '>=12'} - - ansi-styles@4.3.0: - resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} - engines: {node: '>=8'} - - ansi-styles@6.2.1: - resolution: {integrity: sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==} - engines: {node: '>=12'} - - aproba@2.0.0: - resolution: {integrity: sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==} - - are-we-there-yet@2.0.0: - resolution: {integrity: sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw==} - engines: {node: '>=10'} - deprecated: This package is no longer supported. - - argparse@1.0.10: - resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==} - - argparse@2.0.1: - resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} - - array-find-index@1.0.2: - resolution: {integrity: sha512-M1HQyIXcBGtVywBt8WVdim+lrNaK7VHp99Qt5pSNziXznKHViIBbXWtfRTpEFpF/c4FdfxNAsCCwPp5phBYJtw==} - engines: {node: '>=0.10.0'} - - arrgv@1.0.2: - resolution: {integrity: sha512-a4eg4yhp7mmruZDQFqVMlxNRFGi/i1r87pt8SDHy0/I8PqSXoUTlWZRdAZo0VXgvEARcujbtTk8kiZRi1uDGRw==} - engines: {node: '>=8.0.0'} - - arrify@3.0.0: - resolution: {integrity: sha512-tLkvA81vQG/XqE2mjDkGQHoOINtMHtysSnemrmoGe6PydDPMRbVugqyk4A6V/WDWEfm3l+0d8anA9r8cv/5Jaw==} - engines: {node: '>=12'} - - async-sema@3.1.1: - resolution: {integrity: sha512-tLRNUXati5MFePdAk8dw7Qt7DpxPB60ofAgn8WRhW6a2rcimZnYBP9oxHiv0OHy+Wz7kPMG+t4LGdt31+4EmGg==} - - asynckit@0.4.0: - resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} - - ava@6.1.3: - resolution: {integrity: sha512-tkKbpF1pIiC+q09wNU9OfyTDYZa8yuWvU2up3+lFJ3lr1RmnYh2GBpPwzYUEB0wvTPIUysGjcZLNZr7STDviRA==} - engines: {node: ^18.18 || ^20.8 || ^21 || ^22} - hasBin: true - peerDependencies: - '@ava/typescript': '*' - peerDependenciesMeta: - '@ava/typescript': - optional: true - - axios@1.6.2: - resolution: {integrity: sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A==} - - balanced-match@1.0.2: - resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} - - before-after-hook@3.0.2: - resolution: {integrity: sha512-Nik3Sc0ncrMK4UUdXQmAnRtzmNQTAAXmXIopizwZ1W1t8QmfJj+zL4OA2I7XPTPW5z5TDqv4hRo/JzouDJnX3A==} - - bindings@1.5.0: - resolution: {integrity: sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==} - - blueimp-md5@2.19.0: - resolution: {integrity: sha512-DRQrD6gJyy8FbiE4s+bDoXS9hiW3Vbx5uCdwvcCf3zLHL+Iv7LtGHLpr+GZV8rHG8tK766FGYBwRbu8pELTt+w==} - - brace-expansion@1.1.11: - resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} - - braces@3.0.3: - resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==} - engines: {node: '>=8'} - - callsites@4.2.0: - resolution: {integrity: sha512-kfzR4zzQtAE9PC7CzZsjl3aBNbXWuXiSeOCdLcPpBfGW8YuCqQHcRPFDbr/BPVmd3EEPVpuFzLyuT/cUhPr4OQ==} - engines: {node: '>=12.20'} - - camelize@1.0.1: - resolution: {integrity: sha512-dU+Tx2fsypxTgtLoE36npi3UqcjSSMNYfkqgmoEhtZrraP5VWq0K7FkWVTYa8eMPtnU/G2txVsfdCJTn9uzpuQ==} - - cbor@9.0.2: - resolution: {integrity: sha512-JPypkxsB10s9QOWwa6zwPzqE1Md3vqpPc+cai4sAecuCsRyAtAl/pMyhPlMbT/xtPnm2dznJZYRLui57qiRhaQ==} - engines: {node: '>=16'} - - chalk@5.3.0: - resolution: {integrity: sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==} - engines: {node: ^12.17.0 || ^14.13 || >=16.0.0} - - chardet@0.7.0: - resolution: {integrity: sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==} - - chownr@2.0.0: - resolution: {integrity: sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==} - engines: {node: '>=10'} - - chunkd@2.0.1: - resolution: {integrity: sha512-7d58XsFmOq0j6el67Ug9mHf9ELUXsQXYJBkyxhH/k+6Ke0qXRnv0kbemx+Twc6fRJ07C49lcbdgm9FL1Ei/6SQ==} - - ci-info@4.0.0: - resolution: {integrity: sha512-TdHqgGf9odd8SXNuxtUBVx8Nv+qZOejE6qyqiy5NtbYYQOeFa6zmHkxlPzmaLxWWHsU6nJmB7AETdVPi+2NBUg==} - engines: {node: '>=8'} - - ci-parallel-vars@1.0.1: - resolution: {integrity: sha512-uvzpYrpmidaoxvIQHM+rKSrigjOe9feHYbw4uOI2gdfe1C3xIlxO+kVXq83WQWNniTf8bAxVpy+cQeFQsMERKg==} - - cli-spinners@2.9.2: - resolution: {integrity: sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==} - engines: {node: '>=6'} - - cli-truncate@4.0.0: - resolution: {integrity: sha512-nPdaFdQ0h/GEigbPClz11D0v/ZJEwxmeVZGeMo3Z5StPtUTkA9o1lD6QwoirYiSDzbcwn2XcjwmCp68W1IS4TA==} - engines: {node: '>=18'} - - cli-width@4.1.0: - resolution: {integrity: sha512-ouuZd4/dm2Sw5Gmqy6bGyNNNe1qt9RpmxveLSO7KcgsTnU7RXfsw+/bukWGo1abgBiMAic068rclZsO4IWmmxQ==} - engines: {node: '>= 12'} - - clipanion@3.2.1: - resolution: {integrity: sha512-dYFdjLb7y1ajfxQopN05mylEpK9ZX0sO1/RfMXdfmwjlIsPkbh4p7A682x++zFPLDCo1x3p82dtljHf5cW2LKA==} - peerDependencies: - typanion: '*' - - cliui@8.0.1: - resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==} - engines: {node: '>=12'} - - code-excerpt@4.0.0: - resolution: {integrity: sha512-xxodCmBen3iy2i0WtAK8FlFNrRzjUqjRsMfho58xT/wvZU1YTM3fCnRjcy1gJPMepaRlgm/0e6w8SpWHpn3/cA==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - color-convert@2.0.1: - resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} - engines: {node: '>=7.0.0'} - - color-name@1.1.4: - resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} - - color-support@1.1.3: - resolution: {integrity: sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==} - hasBin: true - - colorette@2.0.20: - resolution: {integrity: sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==} - - combined-stream@1.0.8: - resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} - engines: {node: '>= 0.8'} - - common-path-prefix@3.0.0: - resolution: {integrity: sha512-QE33hToZseCH3jS0qN96O/bSh3kaw/h+Tq7ngyY9eWDUnTlTNUyqfqvCXioLe5Na5jFsL78ra/wuBU4iuEgd4w==} - - concat-map@0.0.1: - resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} - - concordance@5.0.4: - resolution: {integrity: sha512-OAcsnTEYu1ARJqWVGwf4zh4JDfHZEaSNlNccFmt8YjB2l/n19/PF2viLINHc57vO4FKIAFl2FWASIGZZWZ2Kxw==} - engines: {node: '>=10.18.0 <11 || >=12.14.0 <13 || >=14'} - - console-control-strings@1.1.0: - resolution: {integrity: sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==} - - convert-to-spaces@2.0.1: - resolution: {integrity: sha512-rcQ1bsQO9799wq24uE5AM2tAILy4gXGIK/njFWcVQkGNZ96edlpY+A7bjwvzjYvLDyzmG1MmMLZhpcsb+klNMQ==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - css-color-keywords@1.0.0: - resolution: {integrity: sha512-FyyrDHZKEjXDpNJYvVsV960FiqQyXc/LlYmsxl2BcdMb2WPx0OGRVgTg55rPSyLSNMqP52R9r8geSp7apN3Ofg==} - engines: {node: '>=4'} - - css-to-react-native@3.2.0: - resolution: {integrity: sha512-e8RKaLXMOFii+02mOlqwjbD00KSEKqblnpO9e++1aXS1fPQOpS1YoqdVHBqPjHNoxeF2mimzVqawm2KCbEdtHQ==} - - csstype@3.1.3: - resolution: {integrity: sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==} - - currently-unhandled@0.4.1: - resolution: {integrity: sha512-/fITjgjGU50vjQ4FH6eUoYu+iUoUKIXws2hL15JJpIR+BbTxaXQsMuuyjtNh2WqsSBS5nsaZHFsFecyw5CCAng==} - engines: {node: '>=0.10.0'} - - date-time@3.1.0: - resolution: {integrity: sha512-uqCUKXE5q1PNBXjPqvwhwJf9SwMoAHBgWJ6DcrnS5o+W2JOiIILl0JEdVD8SGujrNS02GGxgwAg2PN2zONgtjg==} - engines: {node: '>=6'} - - debug@4.3.5: - resolution: {integrity: sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg==} - engines: {node: '>=6.0'} - peerDependencies: - supports-color: '*' - peerDependenciesMeta: - supports-color: - optional: true - - delayed-stream@1.0.0: - resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} - engines: {node: '>=0.4.0'} - - delegates@1.0.0: - resolution: {integrity: sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==} - - detect-libc@2.0.3: - resolution: {integrity: sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw==} - engines: {node: '>=8'} - - emittery@1.0.3: - resolution: {integrity: sha512-tJdCJitoy2lrC2ldJcqN4vkqJ00lT+tOWNT1hBJjO/3FDMJa5TTIiYGCKGkn/WfCyOzUMObeohbVTj00fhiLiA==} - engines: {node: '>=14.16'} - - emnapi@1.2.0: - resolution: {integrity: sha512-rcq+dJCcfr08I0XM/57LPRqaUokGfni/+SvhO7NaJthTTjRdohhIy0FQwyC5rR1enAsjkldQg83th8J5hURv0Q==} - peerDependencies: - node-addon-api: '>= 6.1.0' - peerDependenciesMeta: - node-addon-api: - optional: true - - emoji-regex@10.3.0: - resolution: {integrity: sha512-QpLs9D9v9kArv4lfDEgg1X/gN5XLnf/A6l9cs8SPZLRZR3ZkY9+kwIQTxm+fsSej5UMYGE8fdoaZVIBlqG0XTw==} - - emoji-regex@8.0.0: - resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} - - escalade@3.1.2: - resolution: {integrity: sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==} - engines: {node: '>=6'} - - escape-string-regexp@2.0.0: - resolution: {integrity: sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==} - engines: {node: '>=8'} - - escape-string-regexp@5.0.0: - resolution: {integrity: sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==} - engines: {node: '>=12'} - - esprima@4.0.1: - resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==} - engines: {node: '>=4'} - hasBin: true - - estree-walker@2.0.2: - resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==} - - esutils@2.0.3: - resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} - engines: {node: '>=0.10.0'} - - external-editor@3.1.0: - resolution: {integrity: sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==} - engines: {node: '>=4'} - - fast-diff@1.3.0: - resolution: {integrity: sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==} - - fast-glob@3.3.2: - resolution: {integrity: sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==} - engines: {node: '>=8.6.0'} - - fastq@1.17.1: - resolution: {integrity: sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==} - - figures@6.1.0: - resolution: {integrity: sha512-d+l3qxjSesT4V7v2fh+QnmFnUWv9lSpjarhShNTgBOfA0ttejbQUAlHLitbjkoRiDulW0OPoQPYIGhIC8ohejg==} - engines: {node: '>=18'} - - file-uri-to-path@1.0.0: - resolution: {integrity: sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==} - - fill-range@7.1.1: - resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==} - engines: {node: '>=8'} - - find-up-simple@1.0.0: - resolution: {integrity: sha512-q7Us7kcjj2VMePAa02hDAF6d+MzsdsAWEwYyOpwUtlerRBkOEPBCRZrAV4XfcSN8fHAgaD0hP7miwoay6DCprw==} - engines: {node: '>=18'} - - follow-redirects@1.15.6: - resolution: {integrity: sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==} - engines: {node: '>=4.0'} - peerDependencies: - debug: '*' - peerDependenciesMeta: - debug: - optional: true - - form-data@4.0.0: - resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==} - engines: {node: '>= 6'} - - fs-minipass@2.1.0: - resolution: {integrity: sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==} - engines: {node: '>= 8'} - - fs.realpath@1.0.0: - resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} - - gauge@3.0.2: - resolution: {integrity: sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q==} - engines: {node: '>=10'} - deprecated: This package is no longer supported. - - get-caller-file@2.0.5: - resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} - engines: {node: 6.* || 8.* || >= 10.*} - - get-east-asian-width@1.2.0: - resolution: {integrity: sha512-2nk+7SIVb14QrgXFHcm84tD4bKQz0RxPuMT8Ag5KPOq7J5fEmAg0UbXdTOSHqNuHSU28k55qnceesxXRZGzKWA==} - engines: {node: '>=18'} - - glob-parent@5.1.2: - resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} - engines: {node: '>= 6'} - - glob@7.2.3: - resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} - deprecated: Glob versions prior to v9 are no longer supported - - globby@14.0.2: - resolution: {integrity: sha512-s3Fq41ZVh7vbbe2PN3nrW7yC7U7MFVc5c98/iTl9c2GawNMKx/J648KQRW6WKkuU8GIbbh2IXfIRQjOZnXcTnw==} - engines: {node: '>=18'} - - graceful-fs@4.2.11: - resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} - - has-unicode@2.0.1: - resolution: {integrity: sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==} - - https-proxy-agent@5.0.1: - resolution: {integrity: sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==} - engines: {node: '>= 6'} - - iconv-lite@0.4.24: - resolution: {integrity: sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==} - engines: {node: '>=0.10.0'} - - ignore-by-default@2.1.0: - resolution: {integrity: sha512-yiWd4GVmJp0Q6ghmM2B/V3oZGRmjrKLXvHR3TE1nfoXsmoggllfZUQe74EN0fJdPFZu2NIvNdrMMLm3OsV7Ohw==} - engines: {node: '>=10 <11 || >=12 <13 || >=14'} - - ignore@5.3.1: - resolution: {integrity: sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==} - engines: {node: '>= 4'} - - imurmurhash@0.1.4: - resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} - engines: {node: '>=0.8.19'} - - indent-string@5.0.0: - resolution: {integrity: sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==} - engines: {node: '>=12'} - - inflight@1.0.6: - resolution: {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. - - inherits@2.0.4: - resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} - - inquirer@10.0.1: - resolution: {integrity: sha512-XgthhRIn0Ci9JdGJpUo2EtpPfaczbooZbGTN+FTzSCyUb7YHJcPPnuSXfeG5903bJMy3OyEoVTQMnvO4Ly5tFg==} - engines: {node: '>=18'} - - ipaddr.js@2.2.0: - resolution: {integrity: sha512-Ag3wB2o37wslZS19hZqorUnrnzSkpOVy+IiiDEiTqNubEYpYuHWIf6K4psgN2ZWKExS4xhVCrRVfb/wfW8fWJA==} - engines: {node: '>= 10'} - - irregular-plurals@3.5.0: - resolution: {integrity: sha512-1ANGLZ+Nkv1ptFb2pa8oG8Lem4krflKuX/gINiHJHjJUKaJHk/SXk5x6K3J+39/p0h1RQ2saROclJJ+QLvETCQ==} - engines: {node: '>=8'} - - is-extglob@2.1.1: - resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} - engines: {node: '>=0.10.0'} - - is-fullwidth-code-point@3.0.0: - resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} - engines: {node: '>=8'} - - is-fullwidth-code-point@4.0.0: - resolution: {integrity: sha512-O4L094N2/dZ7xqVdrXhh9r1KODPJpFms8B5sGdJLPy664AgvXsreZUyCQQNItZRDlYug4xStLjNp/sz3HvBowQ==} - engines: {node: '>=12'} - - is-glob@4.0.3: - resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} - engines: {node: '>=0.10.0'} - - is-number@7.0.0: - resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} - engines: {node: '>=0.12.0'} - - is-plain-object@5.0.0: - resolution: {integrity: sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==} - engines: {node: '>=0.10.0'} - - is-promise@4.0.0: - resolution: {integrity: sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==} - - is-unicode-supported@2.0.0: - resolution: {integrity: sha512-FRdAyx5lusK1iHG0TWpVtk9+1i+GjrzRffhDg4ovQ7mcidMQ6mj+MhKPmvh7Xwyv5gIS06ns49CA7Sqg7lC22Q==} - engines: {node: '>=18'} - - js-string-escape@1.0.1: - resolution: {integrity: sha512-Smw4xcfIQ5LVjAOuJCvN/zIodzA/BBSsluuoSykP+lUvScIi4U6RJLfwHet5cxFnCswUjISV8oAXaqaJDY3chg==} - engines: {node: '>= 0.8'} - - js-tokens@4.0.0: - resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} - - js-yaml@3.14.1: - resolution: {integrity: sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==} - hasBin: true - - js-yaml@4.1.0: - resolution: {integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==} - hasBin: true - - load-json-file@7.0.1: - resolution: {integrity: sha512-Gnxj3ev3mB5TkVBGad0JM6dmLiQL+o0t23JPBZ9sd+yvSLk05mFoqKBw5N8gbbkU4TNXyqCgIrl/VM17OgUIgQ==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - lodash-es@4.17.21: - resolution: {integrity: sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==} - - lodash@4.17.21: - resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} - - loose-envify@1.4.0: - resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==} - hasBin: true - - make-dir@3.1.0: - resolution: {integrity: sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==} - engines: {node: '>=8'} - - matcher@5.0.0: - resolution: {integrity: sha512-s2EMBOWtXFc8dgqvoAzKJXxNHibcdJMV0gwqKUaw9E2JBJuGUK7DrNKrA6g/i+v72TT16+6sVm5mS3thaMLQUw==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - md5-hex@3.0.1: - resolution: {integrity: sha512-BUiRtTtV39LIJwinWBjqVsU9xhdnz7/i889V859IBFpuqGAj6LuOvHv5XLbgZ2R7ptJoJaEcxkv88/h25T7Ciw==} - engines: {node: '>=8'} - - memoize@10.0.0: - resolution: {integrity: sha512-H6cBLgsi6vMWOcCpvVCdFFnl3kerEXbrYh9q+lY6VXvQSmM6CkmV08VOwT+WE2tzIEqRPFfAq3fm4v/UIW6mSA==} - engines: {node: '>=18'} - - merge2@1.4.1: - resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} - engines: {node: '>= 8'} - - micromatch@4.0.7: - resolution: {integrity: sha512-LPP/3KorzCwBxfeUuZmaR6bG2kdeHSbe0P2tY3FLRU4vYrjYz5hI4QZwV0njUx3jeuKe67YukQ1LSPZBKDqO/Q==} - engines: {node: '>=8.6'} - - mime-db@1.52.0: - resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} - engines: {node: '>= 0.6'} - - mime-types@2.1.35: - resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} - engines: {node: '>= 0.6'} - - mimic-function@5.0.1: - resolution: {integrity: sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==} - engines: {node: '>=18'} - - minimatch@3.1.2: - resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} - - minipass@3.3.6: - resolution: {integrity: sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==} - engines: {node: '>=8'} - - minipass@5.0.0: - resolution: {integrity: sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==} - engines: {node: '>=8'} - - minizlib@2.1.2: - resolution: {integrity: sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==} - engines: {node: '>= 8'} - - mkdirp@1.0.4: - resolution: {integrity: sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==} - engines: {node: '>=10'} - hasBin: true - - ms@2.1.2: - resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} - - ms@2.1.3: - resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} - - mute-stream@1.0.0: - resolution: {integrity: sha512-avsJQhyd+680gKXyG/sQc0nXaC6rBkPOfyHYcFb9+hdkqQkR9bdnkJ0AMZhke0oesPqIO+mFFJ+IdBc7mst4IA==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - - nanoid@3.3.7: - resolution: {integrity: sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==} - engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} - hasBin: true - - node-fetch@2.7.0: - resolution: {integrity: sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==} - engines: {node: 4.x || >=6.0.0} - peerDependencies: - encoding: ^0.1.0 - peerDependenciesMeta: - encoding: - optional: true - - node-gyp-build@4.8.1: - resolution: {integrity: sha512-OSs33Z9yWr148JZcbZd5WiAXhh/n9z8TxQcdMhIOlpN9AhWpLfvVFO73+m77bBABQMaY9XSvIa+qk0jlI7Gcaw==} - hasBin: true - - nofilter@3.1.0: - resolution: {integrity: sha512-l2NNj07e9afPnhAhvgVrCD/oy2Ai1yfLpuo3EpiO1jFTsB4sFz6oIfAfSZyQzVpkZQ9xS8ZS5g1jCBgq4Hwo0g==} - engines: {node: '>=12.19'} - - nopt@5.0.0: - resolution: {integrity: sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==} - engines: {node: '>=6'} - hasBin: true - - npmlog@5.0.1: - resolution: {integrity: sha512-AqZtDUWOMKs1G/8lwylVjrdYgqA4d9nu8hc+0gzRxlDb1I10+FHBGMXs6aiQHFdCUUlqH99MUMuLfzWDNDtfxw==} - deprecated: This package is no longer supported. - - object-assign@4.1.1: - resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} - engines: {node: '>=0.10.0'} - - once@1.4.0: - resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} - - os-tmpdir@1.0.2: - resolution: {integrity: sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==} - engines: {node: '>=0.10.0'} - - p-map@7.0.2: - resolution: {integrity: sha512-z4cYYMMdKHzw4O5UkWJImbZynVIo0lSGTXc7bzB1e/rrDqkgGUNysK/o4bTr+0+xKvvLoTyGqYC4Fgljy9qe1Q==} - engines: {node: '>=18'} - - package-config@5.0.0: - resolution: {integrity: sha512-GYTTew2slBcYdvRHqjhwaaydVMvn/qrGC323+nKclYioNSLTDUM/lGgtGTgyHVtYcozb+XkE8CNhwcraOmZ9Mg==} - engines: {node: '>=18'} - - parse-ms@4.0.0: - resolution: {integrity: sha512-TXfryirbmq34y8QBwgqCVLi+8oA3oWx2eAnSn62ITyEhEYaWRlVZ2DvMM9eZbMs/RfxPu/PK/aBLyGj4IrqMHw==} - engines: {node: '>=18'} - - path-is-absolute@1.0.1: - resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==} - engines: {node: '>=0.10.0'} - - path-type@5.0.0: - resolution: {integrity: sha512-5HviZNaZcfqP95rwpv+1HDgUamezbqdSYTyzjTvwtJSnIH+3vnbmWsItli8OFEndS984VT55M3jduxZbX351gg==} - engines: {node: '>=12'} - - picocolors@1.0.1: - resolution: {integrity: sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==} - - picomatch@2.3.1: - resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} - engines: {node: '>=8.6'} - - picomatch@3.0.1: - resolution: {integrity: sha512-I3EurrIQMlRc9IaAZnqRR044Phh2DXY+55o7uJ0V+hYZAcQYSuFWsc9q5PvyDHUSCe1Qxn/iBz+78s86zWnGag==} - engines: {node: '>=10'} - - plur@5.1.0: - resolution: {integrity: sha512-VP/72JeXqak2KiOzjgKtQen5y3IZHn+9GOuLDafPv0eXa47xq0At93XahYBs26MsifCQ4enGKwbjBTKgb9QJXg==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - postcss-value-parser@4.2.0: - resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==} - - postcss@8.4.33: - resolution: {integrity: sha512-Kkpbhhdjw2qQs2O2DGX+8m5OVqEcbB9HRBvuYM9pgrjEFUg30A9LmXNlTAUj4S9kgtGyrMbTzVjH7E+s5Re2yg==} - engines: {node: ^10 || ^12 || >=14} - - pretty-ms@9.0.0: - resolution: {integrity: sha512-E9e9HJ9R9NasGOgPaPE8VMeiPKAyWR5jcFpNnwIejslIhWqdqOrb2wShBsncMPUb+BcCd2OPYfh7p2W6oemTng==} - engines: {node: '>=18'} - - proxy-from-env@1.1.0: - resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==} - - queue-microtask@1.2.3: - resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} - - react-dom@18.3.1: - resolution: {integrity: sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==} - peerDependencies: - react: ^18.3.1 - - react@18.3.1: - resolution: {integrity: sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==} - engines: {node: '>=0.10.0'} - - readable-stream@3.6.2: - resolution: {integrity: sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==} - engines: {node: '>= 6'} - - require-directory@2.1.1: - resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} - engines: {node: '>=0.10.0'} - - resolve-cwd@3.0.0: - resolution: {integrity: sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==} - engines: {node: '>=8'} - - resolve-from@5.0.0: - resolution: {integrity: sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==} - engines: {node: '>=8'} - - reusify@1.0.4: - resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==} - engines: {iojs: '>=1.0.0', node: '>=0.10.0'} - - rimraf@3.0.2: - resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==} - deprecated: Rimraf versions prior to v4 are no longer supported - hasBin: true - - run-async@3.0.0: - resolution: {integrity: sha512-540WwVDOMxA6dN6We19EcT9sc3hkXPw5mzRNGM3FkdN/vtE9NFvj5lFAPNwUDmJjXidm3v7TC1cTE7t17Ulm1Q==} - engines: {node: '>=0.12.0'} - - run-parallel@1.2.0: - resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} - - rxjs@7.8.1: - resolution: {integrity: sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==} - - safe-buffer@5.2.1: - resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} - - safer-buffer@2.1.2: - resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} - - scheduler@0.23.2: - resolution: {integrity: sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ==} - - semver@6.3.1: - resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} - hasBin: true - - semver@7.6.2: - resolution: {integrity: sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==} - engines: {node: '>=10'} - hasBin: true - - serialize-error@7.0.1: - resolution: {integrity: sha512-8I8TjW5KMOKsZQTvoxjuSIa7foAwPWGOts+6o7sgjz41/qMD9VQHEDxi6PBvK2l0MXUmqZyNpUK+T2tQaaElvw==} - engines: {node: '>=10'} - - set-blocking@2.0.0: - resolution: {integrity: sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==} - - shallowequal@1.1.0: - resolution: {integrity: sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ==} - - signal-exit@3.0.7: - resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} - - signal-exit@4.1.0: - resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} - engines: {node: '>=14'} - - slash@5.1.0: - resolution: {integrity: sha512-ZA6oR3T/pEyuqwMgAKT0/hAv8oAXckzbkmR0UkUosQ+Mc4RxGoJkRmwHgHufaenlyAgE1Mxgpdcrf75y6XcnDg==} - engines: {node: '>=14.16'} - - slice-ansi@5.0.0: - resolution: {integrity: sha512-FC+lgizVPfie0kkhqUScwRu1O/lF6NOgJmlCgK+/LYxDCTk8sGelYaHDhFcDN+Sn3Cv+3VSa4Byeo+IMCzpMgQ==} - engines: {node: '>=12'} - - source-map-js@1.2.0: - resolution: {integrity: sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==} - engines: {node: '>=0.10.0'} - - sprintf-js@1.0.3: - resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==} - - stack-utils@2.0.6: - resolution: {integrity: sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==} - engines: {node: '>=10'} - - string-width@4.2.3: - resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} - engines: {node: '>=8'} - - string-width@7.2.0: - resolution: {integrity: sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==} - engines: {node: '>=18'} - - string_decoder@1.3.0: - resolution: {integrity: sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==} - - strip-ansi@6.0.1: - resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} - engines: {node: '>=8'} - - strip-ansi@7.1.0: - resolution: {integrity: sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==} - engines: {node: '>=12'} - - styled-components@6.1.1: - resolution: {integrity: sha512-cpZZP5RrKRIClBW5Eby4JM1wElLVP4NQrJbJ0h10TidTyJf4SIIwa3zLXOoPb4gJi8MsJ8mjq5mu2IrEhZIAcQ==} - engines: {node: '>= 16'} - peerDependencies: - react: '>= 16.8.0' - react-dom: '>= 16.8.0' - - stylis@4.3.2: - resolution: {integrity: sha512-bhtUjWd/z6ltJiQwg0dUfxEJ+W+jdqQd8TbWLWyeIJHlnsqmGLRFFd8e5mA0AZi/zx90smXRlN66YMTcaSFifg==} - - supertap@3.0.1: - resolution: {integrity: sha512-u1ZpIBCawJnO+0QePsEiOknOfCRq0yERxiAchT0i4li0WHNUJbf0evXXSXOcCAR4M8iMDoajXYmstm/qO81Isw==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - tar@6.2.1: - resolution: {integrity: sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==} - engines: {node: '>=10'} - - temp-dir@3.0.0: - resolution: {integrity: sha512-nHc6S/bwIilKHNRgK/3jlhDoIHcp45YgyiwcAk46Tr0LfEqGBVpmiAyuiuxeVE44m3mXnEeVhaipLOEWmH+Njw==} - engines: {node: '>=14.16'} - - time-zone@1.0.0: - resolution: {integrity: sha512-TIsDdtKo6+XrPtiTm1ssmMngN1sAhyKnTO2kunQWqNPWIVvCm15Wmw4SWInwTVgJ5u/Tr04+8Ei9TNcw4x4ONA==} - engines: {node: '>=4'} - - tmp@0.0.33: - resolution: {integrity: sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==} - engines: {node: '>=0.6.0'} - - to-regex-range@5.0.1: - resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} - engines: {node: '>=8.0'} - - toml@3.0.0: - resolution: {integrity: sha512-y/mWCZinnvxjTKYhJ+pYxwD0mRLVvOtdS2Awbgxln6iEnt4rk0yBxeSBHkGJcPucRiG0e55mwWp+g/05rsrd6w==} - - tr46@0.0.3: - resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==} - - tslib@2.6.3: - resolution: {integrity: sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ==} - - typanion@3.14.0: - resolution: {integrity: sha512-ZW/lVMRabETuYCd9O9ZvMhAh8GslSqaUjxmK/JLPCh6l73CvLBiuXswj/+7LdnWOgYsQ130FqLzFz5aGT4I3Ug==} - - type-fest@0.13.1: - resolution: {integrity: sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==} - engines: {node: '>=10'} - - type-fest@0.21.3: - resolution: {integrity: sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==} - engines: {node: '>=10'} - - typescript@5.5.4: - resolution: {integrity: sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q==} - engines: {node: '>=14.17'} - hasBin: true - - undici-types@6.19.8: - resolution: {integrity: sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==} - - unicorn-magic@0.1.0: - resolution: {integrity: sha512-lRfVq8fE8gz6QMBuDM6a+LO3IAzTi05H6gCVaUpir2E1Rwpo4ZUog45KpNXKC/Mn3Yb9UDuHumeFTo9iV/D9FQ==} - engines: {node: '>=18'} - - universal-user-agent@7.0.2: - resolution: {integrity: sha512-0JCqzSKnStlRRQfCdowvqy3cy0Dvtlb8xecj/H8JFZuCze4rwjPZQOgvFvn0Ws/usCHQFGpyr+pB9adaGwXn4Q==} - - util-deprecate@1.0.2: - resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} - - wasm-sjlj@1.0.5: - resolution: {integrity: sha512-Z/MHJeOkAvJJVWnGX3/YZGYldGaawZbYHX4ldYG9kLhcdB8H31F5x66M7Zc4BP/7pg0aLsusQj1629m2B3Rilg==} - - webidl-conversions@3.0.1: - resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==} - - well-known-symbols@2.0.0: - resolution: {integrity: sha512-ZMjC3ho+KXo0BfJb7JgtQ5IBuvnShdlACNkKkdsqBmYw3bPAaJfPeYUo6tLUaT5tG/Gkh7xkpBhKRQ9e7pyg9Q==} - engines: {node: '>=6'} - - whatwg-url@5.0.0: - resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==} - - wide-align@1.1.5: - resolution: {integrity: sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==} - - wrap-ansi@6.2.0: - resolution: {integrity: sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==} - engines: {node: '>=8'} - - wrap-ansi@7.0.0: - resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==} - engines: {node: '>=10'} - - wrappy@1.0.2: - resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} - - write-file-atomic@5.0.1: - resolution: {integrity: sha512-+QU2zd6OTD8XWIJCbffaiQeH9U73qIqafo1x6V1snCWYGJf6cVE0cDR4D8xRzcEnfI21IFrUPzPGtcPf8AC+Rw==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - - y18n@5.0.8: - resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==} - engines: {node: '>=10'} - - yallist@4.0.0: - resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==} - - yargs-parser@21.1.1: - resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} - engines: {node: '>=12'} - - yargs@17.7.2: - resolution: {integrity: sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==} - engines: {node: '>=12'} - - yoctocolors-cjs@2.1.2: - resolution: {integrity: sha512-cYVsTjKl8b+FrnidjibDWskAv7UKOfcwaVZdp/it9n1s9fU3IkgDbhdIRKCW4JDsAlECJY0ytoVPT3sK6kideA==} - engines: {node: '>=18'} - -snapshots: - - '@emnapi/core@1.2.0': - dependencies: - '@emnapi/wasi-threads': 1.0.1 - tslib: 2.6.3 - - '@emnapi/runtime@1.2.0': - dependencies: - tslib: 2.6.3 - - '@emnapi/wasi-threads@1.0.1': - dependencies: - tslib: 2.6.3 - - '@emotion/is-prop-valid@1.2.2': - dependencies: - '@emotion/memoize': 0.8.1 - - '@emotion/memoize@0.8.1': {} - - '@emotion/unitless@0.8.1': {} - - '@inquirer/checkbox@2.3.10': - dependencies: - '@inquirer/core': 9.0.2 - '@inquirer/figures': 1.0.3 - '@inquirer/type': 1.4.0 - ansi-escapes: 4.3.2 - yoctocolors-cjs: 2.1.2 - - '@inquirer/confirm@3.1.14': - dependencies: - '@inquirer/core': 9.0.2 - '@inquirer/type': 1.4.0 - - '@inquirer/core@9.0.2': - dependencies: - '@inquirer/figures': 1.0.3 - '@inquirer/type': 1.4.0 - '@types/mute-stream': 0.0.4 - '@types/node': 20.16.5 - '@types/wrap-ansi': 3.0.0 - ansi-escapes: 4.3.2 - cli-spinners: 2.9.2 - cli-width: 4.1.0 - mute-stream: 1.0.0 - signal-exit: 4.1.0 - strip-ansi: 6.0.1 - wrap-ansi: 6.2.0 - yoctocolors-cjs: 2.1.2 - - '@inquirer/editor@2.1.14': - dependencies: - '@inquirer/core': 9.0.2 - '@inquirer/type': 1.4.0 - external-editor: 3.1.0 - - '@inquirer/expand@2.1.14': - dependencies: - '@inquirer/core': 9.0.2 - '@inquirer/type': 1.4.0 - yoctocolors-cjs: 2.1.2 - - '@inquirer/figures@1.0.3': {} - - '@inquirer/input@2.2.1': - dependencies: - '@inquirer/core': 9.0.2 - '@inquirer/type': 1.4.0 - - '@inquirer/number@1.0.2': - dependencies: - '@inquirer/core': 9.0.2 - '@inquirer/type': 1.4.0 - - '@inquirer/password@2.1.14': - dependencies: - '@inquirer/core': 9.0.2 - '@inquirer/type': 1.4.0 - ansi-escapes: 4.3.2 - - '@inquirer/prompts@5.1.2': - dependencies: - '@inquirer/checkbox': 2.3.10 - '@inquirer/confirm': 3.1.14 - '@inquirer/editor': 2.1.14 - '@inquirer/expand': 2.1.14 - '@inquirer/input': 2.2.1 - '@inquirer/number': 1.0.2 - '@inquirer/password': 2.1.14 - '@inquirer/rawlist': 2.1.14 - '@inquirer/select': 2.3.10 - - '@inquirer/rawlist@2.1.14': - dependencies: - '@inquirer/core': 9.0.2 - '@inquirer/type': 1.4.0 - yoctocolors-cjs: 2.1.2 - - '@inquirer/select@2.3.10': - dependencies: - '@inquirer/core': 9.0.2 - '@inquirer/figures': 1.0.3 - '@inquirer/type': 1.4.0 - ansi-escapes: 4.3.2 - yoctocolors-cjs: 2.1.2 - - '@inquirer/type@1.4.0': - dependencies: - mute-stream: 1.0.0 - - '@mapbox/node-pre-gyp@1.0.11': - dependencies: - detect-libc: 2.0.3 - https-proxy-agent: 5.0.1 - make-dir: 3.1.0 - node-fetch: 2.7.0 - nopt: 5.0.0 - npmlog: 5.0.1 - rimraf: 3.0.2 - semver: 7.6.2 - tar: 6.2.1 - transitivePeerDependencies: - - encoding - - supports-color - - '@napi-rs/cli@3.0.0-alpha.62(@emnapi/runtime@1.2.0)(emnapi@1.2.0)': - dependencies: - '@napi-rs/cross-toolchain': 0.0.16 - '@napi-rs/wasm-tools': 0.0.2 - '@octokit/rest': 21.0.0 - clipanion: 3.2.1(typanion@3.14.0) - colorette: 2.0.20 - debug: 4.3.5 - inquirer: 10.0.1 - js-yaml: 4.1.0 - lodash-es: 4.17.21 - semver: 7.6.2 - toml: 3.0.0 - typanion: 3.14.0 - wasm-sjlj: 1.0.5 - optionalDependencies: - '@emnapi/runtime': 1.2.0 - emnapi: 1.2.0 - transitivePeerDependencies: - - '@napi-rs/cross-toolchain-arm64-target-aarch64' - - '@napi-rs/cross-toolchain-arm64-target-armv7' - - '@napi-rs/cross-toolchain-arm64-target-x86_64' - - '@napi-rs/cross-toolchain-x64-target-aarch64' - - '@napi-rs/cross-toolchain-x64-target-armv7' - - '@napi-rs/cross-toolchain-x64-target-x86_64' - - supports-color - - '@napi-rs/cross-toolchain@0.0.16': - dependencies: - '@napi-rs/lzma': 1.3.1 - '@napi-rs/tar': 0.1.1 - debug: 4.3.5 - transitivePeerDependencies: - - supports-color - - '@napi-rs/lzma-android-arm-eabi@1.3.1': - optional: true - - '@napi-rs/lzma-android-arm64@1.3.1': - optional: true - - '@napi-rs/lzma-darwin-arm64@1.3.1': - optional: true - - '@napi-rs/lzma-darwin-x64@1.3.1': - optional: true - - '@napi-rs/lzma-freebsd-x64@1.3.1': - optional: true - - '@napi-rs/lzma-linux-arm-gnueabihf@1.3.1': - optional: true - - '@napi-rs/lzma-linux-arm64-gnu@1.3.1': - optional: true - - '@napi-rs/lzma-linux-arm64-musl@1.3.1': - optional: true - - '@napi-rs/lzma-linux-x64-gnu@1.3.1': - optional: true - - '@napi-rs/lzma-linux-x64-musl@1.3.1': - optional: true - - '@napi-rs/lzma-wasm32-wasi@1.3.1': - dependencies: - '@napi-rs/wasm-runtime': 0.2.4 - optional: true - - '@napi-rs/lzma-win32-arm64-msvc@1.3.1': - optional: true - - '@napi-rs/lzma-win32-ia32-msvc@1.3.1': - optional: true - - '@napi-rs/lzma-win32-x64-msvc@1.3.1': - optional: true - - '@napi-rs/lzma@1.3.1': - optionalDependencies: - '@napi-rs/lzma-android-arm-eabi': 1.3.1 - '@napi-rs/lzma-android-arm64': 1.3.1 - '@napi-rs/lzma-darwin-arm64': 1.3.1 - '@napi-rs/lzma-darwin-x64': 1.3.1 - '@napi-rs/lzma-freebsd-x64': 1.3.1 - '@napi-rs/lzma-linux-arm-gnueabihf': 1.3.1 - '@napi-rs/lzma-linux-arm64-gnu': 1.3.1 - '@napi-rs/lzma-linux-arm64-musl': 1.3.1 - '@napi-rs/lzma-linux-x64-gnu': 1.3.1 - '@napi-rs/lzma-linux-x64-musl': 1.3.1 - '@napi-rs/lzma-wasm32-wasi': 1.3.1 - '@napi-rs/lzma-win32-arm64-msvc': 1.3.1 - '@napi-rs/lzma-win32-ia32-msvc': 1.3.1 - '@napi-rs/lzma-win32-x64-msvc': 1.3.1 - - '@napi-rs/tar-android-arm-eabi@0.1.1': - optional: true - - '@napi-rs/tar-android-arm64@0.1.1': - optional: true - - '@napi-rs/tar-darwin-arm64@0.1.1': - optional: true - - '@napi-rs/tar-darwin-x64@0.1.1': - optional: true - - '@napi-rs/tar-freebsd-x64@0.1.1': - optional: true - - '@napi-rs/tar-linux-arm-gnueabihf@0.1.1': - optional: true - - '@napi-rs/tar-linux-arm64-gnu@0.1.1': - optional: true - - '@napi-rs/tar-linux-arm64-musl@0.1.1': - optional: true - - '@napi-rs/tar-linux-x64-gnu@0.1.1': - optional: true - - '@napi-rs/tar-linux-x64-musl@0.1.1': - optional: true - - '@napi-rs/tar-wasm32-wasi@0.1.1': - dependencies: - '@napi-rs/wasm-runtime': 0.2.4 - optional: true - - '@napi-rs/tar-win32-arm64-msvc@0.1.1': - optional: true - - '@napi-rs/tar-win32-ia32-msvc@0.1.1': - optional: true - - '@napi-rs/tar-win32-x64-msvc@0.1.1': - optional: true - - '@napi-rs/tar@0.1.1': - optionalDependencies: - '@napi-rs/tar-android-arm-eabi': 0.1.1 - '@napi-rs/tar-android-arm64': 0.1.1 - '@napi-rs/tar-darwin-arm64': 0.1.1 - '@napi-rs/tar-darwin-x64': 0.1.1 - '@napi-rs/tar-freebsd-x64': 0.1.1 - '@napi-rs/tar-linux-arm-gnueabihf': 0.1.1 - '@napi-rs/tar-linux-arm64-gnu': 0.1.1 - '@napi-rs/tar-linux-arm64-musl': 0.1.1 - '@napi-rs/tar-linux-x64-gnu': 0.1.1 - '@napi-rs/tar-linux-x64-musl': 0.1.1 - '@napi-rs/tar-wasm32-wasi': 0.1.1 - '@napi-rs/tar-win32-arm64-msvc': 0.1.1 - '@napi-rs/tar-win32-ia32-msvc': 0.1.1 - '@napi-rs/tar-win32-x64-msvc': 0.1.1 - - '@napi-rs/wasm-runtime@0.2.4': - dependencies: - '@emnapi/core': 1.2.0 - '@emnapi/runtime': 1.2.0 - '@tybys/wasm-util': 0.9.0 - - '@napi-rs/wasm-tools-android-arm-eabi@0.0.2': - optional: true - - '@napi-rs/wasm-tools-android-arm64@0.0.2': - optional: true - - '@napi-rs/wasm-tools-darwin-arm64@0.0.2': - optional: true - - '@napi-rs/wasm-tools-darwin-x64@0.0.2': - optional: true - - '@napi-rs/wasm-tools-freebsd-x64@0.0.2': - optional: true - - '@napi-rs/wasm-tools-linux-arm64-gnu@0.0.2': - optional: true - - '@napi-rs/wasm-tools-linux-arm64-musl@0.0.2': - optional: true - - '@napi-rs/wasm-tools-linux-x64-gnu@0.0.2': - optional: true - - '@napi-rs/wasm-tools-linux-x64-musl@0.0.2': - optional: true - - '@napi-rs/wasm-tools-wasm32-wasi@0.0.2': - dependencies: - '@napi-rs/wasm-runtime': 0.2.4 - optional: true - - '@napi-rs/wasm-tools-win32-arm64-msvc@0.0.2': - optional: true - - '@napi-rs/wasm-tools-win32-ia32-msvc@0.0.2': - optional: true - - '@napi-rs/wasm-tools-win32-x64-msvc@0.0.2': - optional: true - - '@napi-rs/wasm-tools@0.0.2': - optionalDependencies: - '@napi-rs/wasm-tools-android-arm-eabi': 0.0.2 - '@napi-rs/wasm-tools-android-arm64': 0.0.2 - '@napi-rs/wasm-tools-darwin-arm64': 0.0.2 - '@napi-rs/wasm-tools-darwin-x64': 0.0.2 - '@napi-rs/wasm-tools-freebsd-x64': 0.0.2 - '@napi-rs/wasm-tools-linux-arm64-gnu': 0.0.2 - '@napi-rs/wasm-tools-linux-arm64-musl': 0.0.2 - '@napi-rs/wasm-tools-linux-x64-gnu': 0.0.2 - '@napi-rs/wasm-tools-linux-x64-musl': 0.0.2 - '@napi-rs/wasm-tools-wasm32-wasi': 0.0.2 - '@napi-rs/wasm-tools-win32-arm64-msvc': 0.0.2 - '@napi-rs/wasm-tools-win32-ia32-msvc': 0.0.2 - '@napi-rs/wasm-tools-win32-x64-msvc': 0.0.2 - - '@nodelib/fs.scandir@2.1.5': - dependencies: - '@nodelib/fs.stat': 2.0.5 - run-parallel: 1.2.0 - - '@nodelib/fs.stat@2.0.5': {} - - '@nodelib/fs.walk@1.2.8': - dependencies: - '@nodelib/fs.scandir': 2.1.5 - fastq: 1.17.1 - - '@octokit/auth-token@5.1.1': {} - - '@octokit/core@6.1.2': - dependencies: - '@octokit/auth-token': 5.1.1 - '@octokit/graphql': 8.1.1 - '@octokit/request': 9.1.1 - '@octokit/request-error': 6.1.2 - '@octokit/types': 13.5.0 - before-after-hook: 3.0.2 - universal-user-agent: 7.0.2 - - '@octokit/endpoint@10.1.1': - dependencies: - '@octokit/types': 13.5.0 - universal-user-agent: 7.0.2 - - '@octokit/graphql@8.1.1': - dependencies: - '@octokit/request': 9.1.1 - '@octokit/types': 13.5.0 - universal-user-agent: 7.0.2 - - '@octokit/openapi-types@22.2.0': {} - - '@octokit/plugin-paginate-rest@11.3.3(@octokit/core@6.1.2)': - dependencies: - '@octokit/core': 6.1.2 - '@octokit/types': 13.5.0 - - '@octokit/plugin-request-log@5.3.0(@octokit/core@6.1.2)': - dependencies: - '@octokit/core': 6.1.2 - - '@octokit/plugin-rest-endpoint-methods@13.2.4(@octokit/core@6.1.2)': - dependencies: - '@octokit/core': 6.1.2 - '@octokit/types': 13.5.0 - - '@octokit/request-error@6.1.2': - dependencies: - '@octokit/types': 13.5.0 - - '@octokit/request@9.1.1': - dependencies: - '@octokit/endpoint': 10.1.1 - '@octokit/request-error': 6.1.2 - '@octokit/types': 13.5.0 - universal-user-agent: 7.0.2 - - '@octokit/rest@21.0.0': - dependencies: - '@octokit/core': 6.1.2 - '@octokit/plugin-paginate-rest': 11.3.3(@octokit/core@6.1.2) - '@octokit/plugin-request-log': 5.3.0(@octokit/core@6.1.2) - '@octokit/plugin-rest-endpoint-methods': 13.2.4(@octokit/core@6.1.2) - - '@octokit/types@13.5.0': - dependencies: - '@octokit/openapi-types': 22.2.0 - - '@rollup/pluginutils@4.2.1': - dependencies: - estree-walker: 2.0.2 - picomatch: 2.3.1 - - '@sindresorhus/merge-streams@2.3.0': {} - - '@tybys/wasm-util@0.9.0': - dependencies: - tslib: 2.6.3 - - '@types/mute-stream@0.0.4': - dependencies: - '@types/node': 22.5.4 - - '@types/node@20.16.5': - dependencies: - undici-types: 6.19.8 - - '@types/node@22.5.4': - dependencies: - undici-types: 6.19.8 - - '@types/stylis@4.2.6': {} - - '@types/wrap-ansi@3.0.0': {} - - '@vercel/nft@0.26.5': - dependencies: - '@mapbox/node-pre-gyp': 1.0.11 - '@rollup/pluginutils': 4.2.1 - acorn: 8.12.1 - acorn-import-attributes: 1.9.5(acorn@8.12.1) - async-sema: 3.1.1 - bindings: 1.5.0 - estree-walker: 2.0.2 - glob: 7.2.3 - graceful-fs: 4.2.11 - micromatch: 4.0.7 - node-gyp-build: 4.8.1 - resolve-from: 5.0.0 - transitivePeerDependencies: - - encoding - - supports-color - - abbrev@1.1.1: {} - - acorn-import-attributes@1.9.5(acorn@8.12.1): - dependencies: - acorn: 8.12.1 - - acorn-walk@8.3.3: - dependencies: - acorn: 8.12.1 - - acorn@8.12.1: {} - - agent-base@6.0.2: - dependencies: - debug: 4.3.5 - transitivePeerDependencies: - - supports-color - - ansi-escapes@4.3.2: - dependencies: - type-fest: 0.21.3 - - ansi-regex@5.0.1: {} - - ansi-regex@6.0.1: {} - - ansi-styles@4.3.0: - dependencies: - color-convert: 2.0.1 - - ansi-styles@6.2.1: {} - - aproba@2.0.0: {} - - are-we-there-yet@2.0.0: - dependencies: - delegates: 1.0.0 - readable-stream: 3.6.2 - - argparse@1.0.10: - dependencies: - sprintf-js: 1.0.3 - - argparse@2.0.1: {} - - array-find-index@1.0.2: {} - - arrgv@1.0.2: {} - - arrify@3.0.0: {} - - async-sema@3.1.1: {} - - asynckit@0.4.0: {} - - ava@6.1.3: - dependencies: - '@vercel/nft': 0.26.5 - acorn: 8.12.1 - acorn-walk: 8.3.3 - ansi-styles: 6.2.1 - arrgv: 1.0.2 - arrify: 3.0.0 - callsites: 4.2.0 - cbor: 9.0.2 - chalk: 5.3.0 - chunkd: 2.0.1 - ci-info: 4.0.0 - ci-parallel-vars: 1.0.1 - cli-truncate: 4.0.0 - code-excerpt: 4.0.0 - common-path-prefix: 3.0.0 - concordance: 5.0.4 - currently-unhandled: 0.4.1 - debug: 4.3.5 - emittery: 1.0.3 - figures: 6.1.0 - globby: 14.0.2 - ignore-by-default: 2.1.0 - indent-string: 5.0.0 - is-plain-object: 5.0.0 - is-promise: 4.0.0 - matcher: 5.0.0 - memoize: 10.0.0 - ms: 2.1.3 - p-map: 7.0.2 - package-config: 5.0.0 - picomatch: 3.0.1 - plur: 5.1.0 - pretty-ms: 9.0.0 - resolve-cwd: 3.0.0 - stack-utils: 2.0.6 - strip-ansi: 7.1.0 - supertap: 3.0.1 - temp-dir: 3.0.0 - write-file-atomic: 5.0.1 - yargs: 17.7.2 - transitivePeerDependencies: - - encoding - - supports-color - - axios@1.6.2: - dependencies: - follow-redirects: 1.15.6 - form-data: 4.0.0 - proxy-from-env: 1.1.0 - transitivePeerDependencies: - - debug - - balanced-match@1.0.2: {} - - before-after-hook@3.0.2: {} - - bindings@1.5.0: - dependencies: - file-uri-to-path: 1.0.0 - - blueimp-md5@2.19.0: {} - - brace-expansion@1.1.11: - dependencies: - balanced-match: 1.0.2 - concat-map: 0.0.1 - - braces@3.0.3: - dependencies: - fill-range: 7.1.1 - - callsites@4.2.0: {} - - camelize@1.0.1: {} - - cbor@9.0.2: - dependencies: - nofilter: 3.1.0 - - chalk@5.3.0: {} - - chardet@0.7.0: {} - - chownr@2.0.0: {} - - chunkd@2.0.1: {} - - ci-info@4.0.0: {} - - ci-parallel-vars@1.0.1: {} - - cli-spinners@2.9.2: {} - - cli-truncate@4.0.0: - dependencies: - slice-ansi: 5.0.0 - string-width: 7.2.0 - - cli-width@4.1.0: {} - - clipanion@3.2.1(typanion@3.14.0): - dependencies: - typanion: 3.14.0 - - cliui@8.0.1: - dependencies: - string-width: 4.2.3 - strip-ansi: 6.0.1 - wrap-ansi: 7.0.0 - - code-excerpt@4.0.0: - dependencies: - convert-to-spaces: 2.0.1 - - color-convert@2.0.1: - dependencies: - color-name: 1.1.4 - - color-name@1.1.4: {} - - color-support@1.1.3: {} - - colorette@2.0.20: {} - - combined-stream@1.0.8: - dependencies: - delayed-stream: 1.0.0 - - common-path-prefix@3.0.0: {} - - concat-map@0.0.1: {} - - concordance@5.0.4: - dependencies: - date-time: 3.1.0 - esutils: 2.0.3 - fast-diff: 1.3.0 - js-string-escape: 1.0.1 - lodash: 4.17.21 - md5-hex: 3.0.1 - semver: 7.6.2 - well-known-symbols: 2.0.0 - - console-control-strings@1.1.0: {} - - convert-to-spaces@2.0.1: {} - - css-color-keywords@1.0.0: {} - - css-to-react-native@3.2.0: - dependencies: - camelize: 1.0.1 - css-color-keywords: 1.0.0 - postcss-value-parser: 4.2.0 - - csstype@3.1.3: {} - - currently-unhandled@0.4.1: - dependencies: - array-find-index: 1.0.2 - - date-time@3.1.0: - dependencies: - time-zone: 1.0.0 - - debug@4.3.5: - dependencies: - ms: 2.1.2 - - delayed-stream@1.0.0: {} - - delegates@1.0.0: {} - - detect-libc@2.0.3: {} - - emittery@1.0.3: {} - - emnapi@1.2.0: {} - - emoji-regex@10.3.0: {} - - emoji-regex@8.0.0: {} - - escalade@3.1.2: {} - - escape-string-regexp@2.0.0: {} - - escape-string-regexp@5.0.0: {} - - esprima@4.0.1: {} - - estree-walker@2.0.2: {} - - esutils@2.0.3: {} - - external-editor@3.1.0: - dependencies: - chardet: 0.7.0 - iconv-lite: 0.4.24 - tmp: 0.0.33 - - fast-diff@1.3.0: {} - - fast-glob@3.3.2: - dependencies: - '@nodelib/fs.stat': 2.0.5 - '@nodelib/fs.walk': 1.2.8 - glob-parent: 5.1.2 - merge2: 1.4.1 - micromatch: 4.0.7 - - fastq@1.17.1: - dependencies: - reusify: 1.0.4 - - figures@6.1.0: - dependencies: - is-unicode-supported: 2.0.0 - - file-uri-to-path@1.0.0: {} - - fill-range@7.1.1: - dependencies: - to-regex-range: 5.0.1 - - find-up-simple@1.0.0: {} - - follow-redirects@1.15.6: {} - - form-data@4.0.0: - dependencies: - asynckit: 0.4.0 - combined-stream: 1.0.8 - mime-types: 2.1.35 - - fs-minipass@2.1.0: - dependencies: - minipass: 3.3.6 - - fs.realpath@1.0.0: {} - - gauge@3.0.2: - dependencies: - aproba: 2.0.0 - color-support: 1.1.3 - console-control-strings: 1.1.0 - has-unicode: 2.0.1 - object-assign: 4.1.1 - signal-exit: 3.0.7 - string-width: 4.2.3 - strip-ansi: 6.0.1 - wide-align: 1.1.5 - - get-caller-file@2.0.5: {} - - get-east-asian-width@1.2.0: {} - - glob-parent@5.1.2: - dependencies: - is-glob: 4.0.3 - - glob@7.2.3: - dependencies: - fs.realpath: 1.0.0 - inflight: 1.0.6 - inherits: 2.0.4 - minimatch: 3.1.2 - once: 1.4.0 - path-is-absolute: 1.0.1 - - globby@14.0.2: - dependencies: - '@sindresorhus/merge-streams': 2.3.0 - fast-glob: 3.3.2 - ignore: 5.3.1 - path-type: 5.0.0 - slash: 5.1.0 - unicorn-magic: 0.1.0 - - graceful-fs@4.2.11: {} - - has-unicode@2.0.1: {} - - https-proxy-agent@5.0.1: - dependencies: - agent-base: 6.0.2 - debug: 4.3.5 - transitivePeerDependencies: - - supports-color - - iconv-lite@0.4.24: - dependencies: - safer-buffer: 2.1.2 - - ignore-by-default@2.1.0: {} - - ignore@5.3.1: {} - - imurmurhash@0.1.4: {} - - indent-string@5.0.0: {} - - inflight@1.0.6: - dependencies: - once: 1.4.0 - wrappy: 1.0.2 - - inherits@2.0.4: {} - - inquirer@10.0.1: - dependencies: - '@inquirer/prompts': 5.1.2 - '@inquirer/type': 1.4.0 - '@types/mute-stream': 0.0.4 - ansi-escapes: 4.3.2 - mute-stream: 1.0.0 - run-async: 3.0.0 - rxjs: 7.8.1 - - ipaddr.js@2.2.0: {} - - irregular-plurals@3.5.0: {} - - is-extglob@2.1.1: {} - - is-fullwidth-code-point@3.0.0: {} - - is-fullwidth-code-point@4.0.0: {} - - is-glob@4.0.3: - dependencies: - is-extglob: 2.1.1 - - is-number@7.0.0: {} - - is-plain-object@5.0.0: {} - - is-promise@4.0.0: {} - - is-unicode-supported@2.0.0: {} - - js-string-escape@1.0.1: {} - - js-tokens@4.0.0: {} - - js-yaml@3.14.1: - dependencies: - argparse: 1.0.10 - esprima: 4.0.1 - - js-yaml@4.1.0: - dependencies: - argparse: 2.0.1 - - load-json-file@7.0.1: {} - - lodash-es@4.17.21: {} - - lodash@4.17.21: {} - - loose-envify@1.4.0: - dependencies: - js-tokens: 4.0.0 - - make-dir@3.1.0: - dependencies: - semver: 6.3.1 - - matcher@5.0.0: - dependencies: - escape-string-regexp: 5.0.0 - - md5-hex@3.0.1: - dependencies: - blueimp-md5: 2.19.0 - - memoize@10.0.0: - dependencies: - mimic-function: 5.0.1 - - merge2@1.4.1: {} - - micromatch@4.0.7: - dependencies: - braces: 3.0.3 - picomatch: 2.3.1 - - mime-db@1.52.0: {} - - mime-types@2.1.35: - dependencies: - mime-db: 1.52.0 - - mimic-function@5.0.1: {} - - minimatch@3.1.2: - dependencies: - brace-expansion: 1.1.11 - - minipass@3.3.6: - dependencies: - yallist: 4.0.0 - - minipass@5.0.0: {} - - minizlib@2.1.2: - dependencies: - minipass: 3.3.6 - yallist: 4.0.0 - - mkdirp@1.0.4: {} - - ms@2.1.2: {} - - ms@2.1.3: {} - - mute-stream@1.0.0: {} - - nanoid@3.3.7: {} - - node-fetch@2.7.0: - dependencies: - whatwg-url: 5.0.0 - - node-gyp-build@4.8.1: {} - - nofilter@3.1.0: {} - - nopt@5.0.0: - dependencies: - abbrev: 1.1.1 - - npmlog@5.0.1: - dependencies: - are-we-there-yet: 2.0.0 - console-control-strings: 1.1.0 - gauge: 3.0.2 - set-blocking: 2.0.0 - - object-assign@4.1.1: {} - - once@1.4.0: - dependencies: - wrappy: 1.0.2 - - os-tmpdir@1.0.2: {} - - p-map@7.0.2: {} - - package-config@5.0.0: - dependencies: - find-up-simple: 1.0.0 - load-json-file: 7.0.1 - - parse-ms@4.0.0: {} - - path-is-absolute@1.0.1: {} - - path-type@5.0.0: {} - - picocolors@1.0.1: {} - - picomatch@2.3.1: {} - - picomatch@3.0.1: {} - - plur@5.1.0: - dependencies: - irregular-plurals: 3.5.0 - - postcss-value-parser@4.2.0: {} - - postcss@8.4.33: - dependencies: - nanoid: 3.3.7 - picocolors: 1.0.1 - source-map-js: 1.2.0 - - pretty-ms@9.0.0: - dependencies: - parse-ms: 4.0.0 - - proxy-from-env@1.1.0: {} - - queue-microtask@1.2.3: {} - - react-dom@18.3.1(react@18.3.1): - dependencies: - loose-envify: 1.4.0 - react: 18.3.1 - scheduler: 0.23.2 - - react@18.3.1: - dependencies: - loose-envify: 1.4.0 - - readable-stream@3.6.2: - dependencies: - inherits: 2.0.4 - string_decoder: 1.3.0 - util-deprecate: 1.0.2 - - require-directory@2.1.1: {} - - resolve-cwd@3.0.0: - dependencies: - resolve-from: 5.0.0 - - resolve-from@5.0.0: {} - - reusify@1.0.4: {} - - rimraf@3.0.2: - dependencies: - glob: 7.2.3 - - run-async@3.0.0: {} - - run-parallel@1.2.0: - dependencies: - queue-microtask: 1.2.3 - - rxjs@7.8.1: - dependencies: - tslib: 2.6.3 - - safe-buffer@5.2.1: {} - - safer-buffer@2.1.2: {} - - scheduler@0.23.2: - dependencies: - loose-envify: 1.4.0 - - semver@6.3.1: {} - - semver@7.6.2: {} - - serialize-error@7.0.1: - dependencies: - type-fest: 0.13.1 - - set-blocking@2.0.0: {} - - shallowequal@1.1.0: {} - - signal-exit@3.0.7: {} - - signal-exit@4.1.0: {} - - slash@5.1.0: {} - - slice-ansi@5.0.0: - dependencies: - ansi-styles: 6.2.1 - is-fullwidth-code-point: 4.0.0 - - source-map-js@1.2.0: {} - - sprintf-js@1.0.3: {} - - stack-utils@2.0.6: - dependencies: - escape-string-regexp: 2.0.0 - - string-width@4.2.3: - dependencies: - emoji-regex: 8.0.0 - is-fullwidth-code-point: 3.0.0 - strip-ansi: 6.0.1 - - string-width@7.2.0: - dependencies: - emoji-regex: 10.3.0 - get-east-asian-width: 1.2.0 - strip-ansi: 7.1.0 - - string_decoder@1.3.0: - dependencies: - safe-buffer: 5.2.1 - - strip-ansi@6.0.1: - dependencies: - ansi-regex: 5.0.1 - - strip-ansi@7.1.0: - dependencies: - ansi-regex: 6.0.1 - - styled-components@6.1.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1): - dependencies: - '@emotion/is-prop-valid': 1.2.2 - '@emotion/unitless': 0.8.1 - '@types/stylis': 4.2.6 - css-to-react-native: 3.2.0 - csstype: 3.1.3 - postcss: 8.4.33 - react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) - shallowequal: 1.1.0 - stylis: 4.3.2 - tslib: 2.6.3 - - stylis@4.3.2: {} - - supertap@3.0.1: - dependencies: - indent-string: 5.0.0 - js-yaml: 3.14.1 - serialize-error: 7.0.1 - strip-ansi: 7.1.0 - - tar@6.2.1: - dependencies: - chownr: 2.0.0 - fs-minipass: 2.1.0 - minipass: 5.0.0 - minizlib: 2.1.2 - mkdirp: 1.0.4 - yallist: 4.0.0 - - temp-dir@3.0.0: {} - - time-zone@1.0.0: {} - - tmp@0.0.33: - dependencies: - os-tmpdir: 1.0.2 - - to-regex-range@5.0.1: - dependencies: - is-number: 7.0.0 - - toml@3.0.0: {} - - tr46@0.0.3: {} - - tslib@2.6.3: {} - - typanion@3.14.0: {} - - type-fest@0.13.1: {} - - type-fest@0.21.3: {} - - typescript@5.5.4: {} - - undici-types@6.19.8: {} - - unicorn-magic@0.1.0: {} - - universal-user-agent@7.0.2: {} - - util-deprecate@1.0.2: {} - - wasm-sjlj@1.0.5: {} - - webidl-conversions@3.0.1: {} - - well-known-symbols@2.0.0: {} - - whatwg-url@5.0.0: - dependencies: - tr46: 0.0.3 - webidl-conversions: 3.0.1 - - wide-align@1.1.5: - dependencies: - string-width: 4.2.3 - - wrap-ansi@6.2.0: - dependencies: - ansi-styles: 4.3.0 - string-width: 4.2.3 - strip-ansi: 6.0.1 - - wrap-ansi@7.0.0: - dependencies: - ansi-styles: 4.3.0 - string-width: 4.2.3 - strip-ansi: 6.0.1 - - wrappy@1.0.2: {} - - write-file-atomic@5.0.1: - dependencies: - imurmurhash: 0.1.4 - signal-exit: 4.1.0 - - y18n@5.0.8: {} - - yallist@4.0.0: {} - - yargs-parser@21.1.1: {} - - yargs@17.7.2: - dependencies: - cliui: 8.0.1 - escalade: 3.1.2 - get-caller-file: 2.0.5 - require-directory: 2.1.1 - string-width: 4.2.3 - y18n: 5.0.8 - yargs-parser: 21.1.1 - - yoctocolors-cjs@2.1.2: {} diff --git a/src/builtins.rs b/src/builtins.rs deleted file mode 100644 index 45a25117..00000000 --- a/src/builtins.rs +++ /dev/null @@ -1,71 +0,0 @@ -/// Node.js built-in modules -/// -/// `node -p "[...require('module').builtinModules].map(b => JSON.stringify(b)).join(',\n')"` -/// -pub const NODEJS_BUILTINS: &[&str] = &[ - "_http_agent", - "_http_client", - "_http_common", - "_http_incoming", - "_http_outgoing", - "_http_server", - "_stream_duplex", - "_stream_passthrough", - "_stream_readable", - "_stream_transform", - "_stream_wrap", - "_stream_writable", - "_tls_common", - "_tls_wrap", - "assert", - "assert/strict", - "async_hooks", - "buffer", - "child_process", - "cluster", - "console", - "constants", - "crypto", - "dgram", - "diagnostics_channel", - "dns", - "dns/promises", - "domain", - "events", - "fs", - "fs/promises", - "http", - "http2", - "https", - "inspector", - "module", - "net", - "os", - "path", - "path/posix", - "path/win32", - "perf_hooks", - "process", - "punycode", - "querystring", - "readline", - "repl", - "stream", - "stream/consumers", - "stream/promises", - "stream/web", - "string_decoder", - "sys", - "timers", - "timers/promises", - "tls", - "trace_events", - "tty", - "url", - "util", - "util/types", - "v8", - "vm", - "worker_threads", - "zlib", -]; diff --git a/src/cache.rs b/src/cache.rs deleted file mode 100644 index 6e600664..00000000 --- a/src/cache.rs +++ /dev/null @@ -1,354 +0,0 @@ -use once_cell::sync::OnceCell as OnceLock; -use std::{ - borrow::{Borrow, Cow}, - convert::AsRef, - hash::{BuildHasherDefault, Hash, Hasher}, - io, - ops::Deref, - path::{Path, PathBuf}, - sync::Arc, -}; - -use dashmap::{DashMap, DashSet}; -use rustc_hash::FxHasher; - -use crate::{ - context::ResolveContext as Ctx, package_json::PackageJson, path::PathUtil, FileMetadata, - FileSystem, ResolveError, ResolveOptions, TsConfig, -}; - -#[derive(Default)] -pub struct Cache { - pub(crate) fs: Fs, - paths: DashSet>, - tsconfigs: DashMap, BuildHasherDefault>, -} - -impl Cache { - pub fn new(fs: Fs) -> Self { - Self { fs, paths: DashSet::default(), tsconfigs: DashMap::default() } - } - - pub fn clear(&self) { - self.paths.clear(); - self.tsconfigs.clear(); - } - - pub fn value(&self, path: &Path) -> CachedPath { - let hash = { - let mut hasher = FxHasher::default(); - path.hash(&mut hasher); - hasher.finish() - }; - if let Some(cache_entry) = self.paths.get((hash, path).borrow() as &dyn CacheKey) { - return cache_entry.clone(); - } - let parent = path.parent().map(|p| self.value(p)); - let data = CachedPath(Arc::new(CachedPathImpl::new( - hash, - path.to_path_buf().into_boxed_path(), - parent, - ))); - self.paths.insert(data.clone()); - data - } - - pub fn tsconfig Result<(), ResolveError>>( - &self, - root: bool, - path: &Path, - callback: F, // callback for modifying tsconfig with `extends` - ) -> Result, ResolveError> { - if let Some(tsconfig_ref) = self.tsconfigs.get(path) { - return Ok(Arc::clone(tsconfig_ref.value())); - } - let meta = self.fs.metadata(path).ok(); - let tsconfig_path = if meta.is_some_and(|m| m.is_file) { - Cow::Borrowed(path) - } else if meta.is_some_and(|m| m.is_dir) { - Cow::Owned(path.join("tsconfig.json")) - } else { - let mut os_string = path.to_path_buf().into_os_string(); - os_string.push(".json"); - Cow::Owned(PathBuf::from(os_string)) - }; - let mut tsconfig_string = self - .fs - .read_to_string(&tsconfig_path) - .map_err(|_| ResolveError::TsconfigNotFound(path.to_path_buf()))?; - let mut tsconfig = - TsConfig::parse(root, &tsconfig_path, &mut tsconfig_string).map_err(|error| { - ResolveError::from_serde_json_error(tsconfig_path.to_path_buf(), &error) - })?; - callback(&mut tsconfig)?; - let tsconfig = Arc::new(tsconfig.build()); - self.tsconfigs.insert(path.to_path_buf(), Arc::clone(&tsconfig)); - Ok(tsconfig) - } -} - -#[derive(Clone)] -pub struct CachedPath(Arc); - -impl Hash for CachedPath { - fn hash(&self, state: &mut H) { - self.0.hash.hash(state); - } -} - -impl PartialEq for CachedPath { - fn eq(&self, other: &Self) -> bool { - self.0.path == other.0.path - } -} -impl Eq for CachedPath {} - -impl Deref for CachedPath { - type Target = CachedPathImpl; - - fn deref(&self) -> &Self::Target { - self.0.as_ref() - } -} - -impl<'a> Borrow for CachedPath { - fn borrow(&self) -> &(dyn CacheKey + 'a) { - self - } -} - -impl AsRef for CachedPath { - fn as_ref(&self) -> &CachedPathImpl { - self.0.as_ref() - } -} - -impl CacheKey for CachedPath { - fn tuple(&self) -> (u64, &Path) { - (self.hash, &self.path) - } -} - -pub struct CachedPathImpl { - hash: u64, - path: Box, - parent: Option, - meta: OnceLock>, - canonicalized: OnceLock>, - node_modules: OnceLock>, - package_json: OnceLock>>, -} - -impl CachedPathImpl { - fn new(hash: u64, path: Box, parent: Option) -> Self { - Self { - hash, - path, - parent, - meta: OnceLock::new(), - canonicalized: OnceLock::new(), - node_modules: OnceLock::new(), - package_json: OnceLock::new(), - } - } - - pub fn path(&self) -> &Path { - &self.path - } - - pub fn to_path_buf(&self) -> PathBuf { - self.path.to_path_buf() - } - - pub fn parent(&self) -> Option<&CachedPath> { - self.parent.as_ref() - } - - fn meta(&self, fs: &Fs) -> Option { - *self.meta.get_or_init(|| fs.metadata(&self.path).ok()) - } - - pub fn is_file(&self, fs: &Fs, ctx: &mut Ctx) -> bool { - if let Some(meta) = self.meta(fs) { - ctx.add_file_dependency(self.path()); - meta.is_file - } else { - ctx.add_missing_dependency(self.path()); - false - } - } - - pub fn is_dir(&self, fs: &Fs, ctx: &mut Ctx) -> bool { - self.meta(fs).map_or_else( - || { - ctx.add_missing_dependency(self.path()); - false - }, - |meta| meta.is_dir, - ) - } - - pub fn realpath(&self, fs: &Fs) -> io::Result { - self.canonicalized - .get_or_try_init(|| { - if fs.symlink_metadata(&self.path).is_ok_and(|m| m.is_symlink) { - return fs.canonicalize(&self.path).map(Some); - } - if let Some(parent) = self.parent() { - let parent_path = parent.realpath(fs)?; - return Ok(Some( - parent_path.normalize_with(self.path.strip_prefix(&parent.path).unwrap()), - )); - }; - Ok(None) - }) - .cloned() - .map(|r| r.unwrap_or_else(|| self.path.clone().to_path_buf())) - } - - pub fn module_directory( - &self, - module_name: &str, - cache: &Cache, - ctx: &mut Ctx, - ) -> Option { - let cached_path = cache.value(&self.path.join(module_name)); - cached_path.is_dir(&cache.fs, ctx).then_some(cached_path) - } - - pub fn cached_node_modules( - &self, - cache: &Cache, - ctx: &mut Ctx, - ) -> Option { - self.node_modules.get_or_init(|| self.module_directory("node_modules", cache, ctx)).clone() - } - - /// Find package.json of a path by traversing parent directories. - /// - /// # Errors - /// - /// * [ResolveError::JSON] - pub fn find_package_json( - &self, - fs: &Fs, - options: &ResolveOptions, - ctx: &mut Ctx, - ) -> Result>, ResolveError> { - let mut cache_value = self; - // Go up directories when the querying path is not a directory - while !cache_value.is_dir(fs, ctx) { - if let Some(cv) = &cache_value.parent { - cache_value = cv.as_ref(); - } else { - break; - } - } - let mut cache_value = Some(cache_value); - while let Some(cv) = cache_value { - if let Some(package_json) = cv.package_json(fs, options, ctx)? { - return Ok(Some(Arc::clone(&package_json))); - } - cache_value = cv.parent.as_deref(); - } - Ok(None) - } - - /// Get package.json of the given path. - /// - /// # Errors - /// - /// * [ResolveError::JSON] - pub fn package_json( - &self, - fs: &Fs, - options: &ResolveOptions, - ctx: &mut Ctx, - ) -> Result>, ResolveError> { - // Change to `std::sync::OnceLock::get_or_try_init` when it is stable. - let result = self - .package_json - .get_or_try_init(|| { - let package_json_path = self.path.join("package.json"); - let Ok(package_json_string) = fs.read_to_string(&package_json_path) else { - return Ok(None); - }; - let real_path = if options.symlinks { - self.realpath(fs)?.join("package.json") - } else { - package_json_path.clone() - }; - PackageJson::parse(package_json_path.clone(), real_path, &package_json_string) - .map(Arc::new) - .map(Some) - .map_err(|error| ResolveError::from_serde_json_error(package_json_path, &error)) - }) - .cloned(); - // https://github.com/webpack/enhanced-resolve/blob/58464fc7cb56673c9aa849e68e6300239601e615/lib/DescriptionFileUtils.js#L68-L82 - match &result { - Ok(Some(package_json)) => { - ctx.add_file_dependency(&package_json.path); - } - Ok(None) => { - // Avoid an allocation by making this lazy - if let Some(deps) = &mut ctx.missing_dependencies { - deps.push(self.path.join("package.json")); - } - } - Err(_) => { - if let Some(deps) = &mut ctx.file_dependencies { - deps.push(self.path.join("package.json")); - } - } - } - result - } -} - -/// Memoized cache key, code adapted from . -trait CacheKey { - fn tuple(&self) -> (u64, &Path); -} - -impl Hash for dyn CacheKey + '_ { - fn hash(&self, state: &mut H) { - self.tuple().0.hash(state); - } -} - -impl PartialEq for dyn CacheKey + '_ { - fn eq(&self, other: &Self) -> bool { - self.tuple().1 == other.tuple().1 - } -} - -impl Eq for dyn CacheKey + '_ {} - -impl<'a> CacheKey for (u64, &'a Path) { - fn tuple(&self) -> (u64, &Path) { - (self.0, self.1) - } -} - -impl<'a> Borrow for (u64, &'a Path) { - fn borrow(&self) -> &(dyn CacheKey + 'a) { - self - } -} - -/// Since the cache key is memoized, use an identity hasher -/// to avoid double cache. -#[derive(Default)] -struct IdentityHasher(u64); - -impl Hasher for IdentityHasher { - fn write(&mut self, _: &[u8]) { - unreachable!("Invalid use of IdentityHasher") - } - fn write_u64(&mut self, n: u64) { - self.0 = n; - } - fn finish(&self) -> u64 { - self.0 - } -} diff --git a/src/context.rs b/src/context.rs deleted file mode 100644 index 9349de30..00000000 --- a/src/context.rs +++ /dev/null @@ -1,89 +0,0 @@ -use std::{ - ops::{Deref, DerefMut}, - path::{Path, PathBuf}, -}; - -use crate::error::ResolveError; - -#[derive(Debug, Default, Clone)] -pub struct ResolveContext(ResolveContextImpl); - -#[derive(Debug, Default, Clone)] -pub struct ResolveContextImpl { - pub fully_specified: bool, - - pub query: Option, - - pub fragment: Option, - - /// Files that was found on file system - pub file_dependencies: Option>, - - /// Files that was found on file system - pub missing_dependencies: Option>, - - /// The current resolving alias for bailing recursion alias. - pub resolving_alias: Option, - - /// For avoiding infinite recursion, which will cause stack overflow. - depth: u8, -} - -impl Deref for ResolveContext { - type Target = ResolveContextImpl; - - fn deref(&self) -> &Self::Target { - &self.0 - } -} - -impl DerefMut for ResolveContext { - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} - -impl ResolveContext { - pub fn with_fully_specified(&mut self, yes: bool) { - self.fully_specified = yes; - } - - pub fn with_query_fragment(&mut self, query: Option<&str>, fragment: Option<&str>) { - if let Some(query) = query { - self.query.replace(query.to_string()); - } - if let Some(fragment) = fragment { - self.fragment.replace(fragment.to_string()); - } - } - - pub fn init_file_dependencies(&mut self) { - self.file_dependencies.replace(vec![]); - self.missing_dependencies.replace(vec![]); - } - - pub fn add_file_dependency(&mut self, dep: &Path) { - if let Some(deps) = &mut self.file_dependencies { - deps.push(dep.to_path_buf()); - } - } - - pub fn add_missing_dependency(&mut self, dep: &Path) { - if let Some(deps) = &mut self.missing_dependencies { - deps.push(dep.to_path_buf()); - } - } - - pub fn with_resolving_alias(&mut self, alias: String) { - self.resolving_alias = Some(alias); - } - - pub fn test_for_infinite_recursion(&mut self) -> Result<(), ResolveError> { - self.depth += 1; - // 64 should be more than enough for detecting infinite recursion. - if self.depth > 64 { - return Err(ResolveError::Recursion); - } - Ok(()) - } -} diff --git a/src/error.rs b/src/error.rs deleted file mode 100644 index b00a0ba8..00000000 --- a/src/error.rs +++ /dev/null @@ -1,182 +0,0 @@ -use std::{io, path::PathBuf, sync::Arc}; -use thiserror::Error; - -/// All resolution errors -/// -/// `thiserror` is used to display meaningful error messages. -#[derive(Debug, Clone, PartialEq, Error)] -pub enum ResolveError { - /// Ignored path - /// - /// Derived from ignored path (false value) from browser field in package.json - /// ```json - /// { - /// "browser": { - /// "./module": false - /// } - /// } - /// ``` - /// See - #[error("Path is ignored {0}")] - Ignored(PathBuf), - - /// Module not found - #[error("Cannot find module '{0}'")] - NotFound(/* specifier */ String), - - /// Matched alias value not found - #[error("Cannot find module '{0}' for matched aliased key '{1}'")] - MatchedAliasNotFound(/* specifier */ String, /* alias key */ String), - - /// Tsconfig not found - #[error("Tsconfig not found {0}")] - TsconfigNotFound(PathBuf), - - /// Tsconfig's project reference path points to it self - #[error("Tsconfig's project reference path points to this tsconfig {0}")] - TsconfigSelfReference(PathBuf), - - #[error("{0}")] - IOError(IOError), - - /// Node.js builtin modules - /// - /// This is an error due to not being a Node.js runtime. - /// The `alias` option can be used to resolve a builtin module to a polyfill. - #[error("Builtin module {0}")] - Builtin(String), - - /// All of the aliased extension are not found - #[error("All of the aliased extensions are not found for {0}")] - ExtensionAlias(PathBuf), - - /// The provided path specifier cannot be parsed - #[error("{0}")] - Specifier(SpecifierError), - - /// JSON parse error - #[error("{0:?}")] - JSON(JSONError), - - /// Restricted by `ResolveOptions::restrictions` - #[error(r#"Path "{0}" restricted by {0}"#)] - Restriction(PathBuf, PathBuf), - - #[error(r#"Invalid module "{0}" specifier is not a valid subpath for the "exports" resolution of {1}"#)] - InvalidModuleSpecifier(String, PathBuf), - - #[error(r#"Invalid "exports" target "{0}" defined for '{1}' in the package config {2}"#)] - InvalidPackageTarget(String, String, PathBuf), - - #[error(r#"Package subpath '{0}' is not defined by "exports" in {1}"#)] - PackagePathNotExported(String, PathBuf), - - #[error(r#"Invalid package config "{0}", "exports" cannot contain some keys starting with '.' and some not. The exports object must either be an object of package subpath keys or an object of main entry condition name keys only."#)] - InvalidPackageConfig(PathBuf), - - #[error(r#"Default condition should be last one in "{0}""#)] - InvalidPackageConfigDefault(PathBuf), - - #[error(r#"Expecting folder to folder mapping. "{0}" should end with "/"#)] - InvalidPackageConfigDirectory(PathBuf), - - #[error(r#"Package import specifier "{0}" is not defined in package {1}"#)] - PackageImportNotDefined(String, PathBuf), - - #[error("{0} is unimplemented")] - Unimplemented(&'static str), - - /// Occurs when alias paths reference each other. - #[error("Recursion in resolving")] - Recursion, -} - -impl ResolveError { - pub fn is_ignore(&self) -> bool { - matches!(self, Self::Ignored(_)) - } - - pub(crate) fn from_serde_json_error(path: PathBuf, error: &serde_json::Error) -> Self { - Self::JSON(JSONError { - path, - message: error.to_string(), - line: error.line(), - column: error.column(), - }) - } -} - -/// Error for [ResolveError::Specifier] -#[derive(Debug, Clone, Eq, PartialEq, Error)] -pub enum SpecifierError { - #[error("The specifiers must be a non-empty string. Received \"{0}\"")] - Empty(String), -} - -/// JSON error from [serde_json::Error] -#[derive(Debug, Clone, Eq, PartialEq)] -pub struct JSONError { - pub path: PathBuf, - pub message: String, - pub line: usize, - pub column: usize, -} - -#[derive(Debug, Clone, Error)] -#[error("{0}")] -pub struct IOError(Arc); - -impl PartialEq for IOError { - fn eq(&self, other: &Self) -> bool { - self.0.kind() == other.0.kind() - } -} - -impl From for io::Error { - fn from(error: IOError) -> Self { - let io_error = error.0.as_ref(); - Self::new(io_error.kind(), io_error.to_string()) - } -} - -impl From for ResolveError { - fn from(err: io::Error) -> Self { - Self::IOError(IOError(Arc::new(err))) - } -} - -#[test] -fn test_into_io_error() { - use std::io::{self, ErrorKind}; - let error_string = "IOError occurred"; - let string_error = io::Error::new(ErrorKind::Interrupted, error_string.to_string()); - let string_error2 = io::Error::new(ErrorKind::Interrupted, error_string.to_string()); - let resolve_io_error: ResolveError = ResolveError::from(string_error2); - - assert_eq!(resolve_io_error, ResolveError::from(string_error)); - assert_eq!(resolve_io_error.clone(), resolve_io_error); - let ResolveError::IOError(io_error) = resolve_io_error else { unreachable!() }; - assert_eq!( - format!("{io_error:?}"), - r#"IOError(Custom { kind: Interrupted, error: "IOError occurred" })"# - ); - // fix for https://github.com/web-infra-dev/rspack/issues/4564 - let std_io_error: io::Error = io_error.into(); - assert_eq!(std_io_error.kind(), ErrorKind::Interrupted); - assert_eq!(std_io_error.to_string(), error_string); - assert_eq!( - format!("{std_io_error:?}"), - r#"Custom { kind: Interrupted, error: "IOError occurred" }"# - ); -} - -#[test] -fn test_coverage() { - let error = ResolveError::NotFound("x".into()); - assert_eq!(format!("{error:?}"), r#"NotFound("x")"#); - assert_eq!(error.clone(), error); - - let error = ResolveError::Specifier(SpecifierError::Empty("x".into())); - assert_eq!(format!("{error:?}"), r#"Specifier(Empty("x"))"#); - assert_eq!(error.clone(), error); -} diff --git a/src/file_system.rs b/src/file_system.rs deleted file mode 100644 index d5f0ff8a..00000000 --- a/src/file_system.rs +++ /dev/null @@ -1,220 +0,0 @@ -use cfg_if::cfg_if; -use std::{ - fs, io, - path::{Path, PathBuf}, -}; - -#[cfg(feature = "yarn_pnp")] -use pnp::fs::{LruZipCache, VPath, VPathInfo, ZipCache}; - -/// File System abstraction used for `ResolverGeneric` -pub trait FileSystem: Send + Sync { - /// See [std::fs::read_to_string] - /// - /// # Errors - /// - /// * See [std::fs::read_to_string] - /// ## Warning - /// Use `&Path` instead of a generic `P: AsRef` here, - /// because object safety requirements, it is especially useful, when - /// you want to store multiple `dyn FileSystem` in a `Vec` or use a `ResolverGeneric` in - /// napi env. - fn read_to_string(&self, path: &Path) -> io::Result; - - /// See [std::fs::metadata] - /// - /// # Errors - /// See [std::fs::metadata] - /// ## Warning - /// Use `&Path` instead of a generic `P: AsRef` here, - /// because object safety requirements, it is especially useful, when - /// you want to store multiple `dyn FileSystem` in a `Vec` or use a `ResolverGeneric` in - /// napi env. - fn metadata(&self, path: &Path) -> io::Result; - - /// See [std::fs::symlink_metadata] - /// - /// # Errors - /// - /// See [std::fs::symlink_metadata] - /// ## Warning - /// Use `&Path` instead of a generic `P: AsRef` here, - /// because object safety requirements, it is especially useful, when - /// you want to store multiple `dyn FileSystem` in a `Vec` or use a `ResolverGeneric` in - /// napi env. - fn symlink_metadata(&self, path: &Path) -> io::Result; - - /// See [std::fs::canonicalize] - /// - /// # Errors - /// - /// See [std::fs::read_link] - /// ## Warning - /// Use `&Path` instead of a generic `P: AsRef` here, - /// because object safety requirements, it is especially useful, when - /// you want to store multiple `dyn FileSystem` in a `Vec` or use a `ResolverGeneric` in - /// napi env. - fn canonicalize(&self, path: &Path) -> io::Result; -} - -/// Metadata information about a file -#[derive(Debug, Clone, Copy)] -pub struct FileMetadata { - pub(crate) is_file: bool, - pub(crate) is_dir: bool, - pub(crate) is_symlink: bool, -} - -impl FileMetadata { - pub fn new(is_file: bool, is_dir: bool, is_symlink: bool) -> Self { - Self { is_file, is_dir, is_symlink } - } -} - -#[cfg(feature = "yarn_pnp")] -impl From for FileMetadata { - fn from(value: pnp::fs::FileType) -> Self { - Self::new(value == pnp::fs::FileType::File, value == pnp::fs::FileType::Directory, false) - } -} - -impl From for FileMetadata { - fn from(metadata: fs::Metadata) -> Self { - Self::new(metadata.is_file(), metadata.is_dir(), metadata.is_symlink()) - } -} - -/// Operating System -#[cfg(feature = "yarn_pnp")] -pub struct FileSystemOs { - pnp_lru: LruZipCache>, -} - -#[cfg(not(feature = "yarn_pnp"))] -pub struct FileSystemOs; - -impl Default for FileSystemOs { - fn default() -> Self { - cfg_if! { - if #[cfg(feature = "yarn_pnp")] { - Self { pnp_lru: LruZipCache::new(50, pnp::fs::open_zip_via_read_p) } - } else { - Self - } - } - } -} - -fn read_to_string(path: &Path) -> io::Result { - // `simdutf8` is faster than `std::str::from_utf8` which `fs::read_to_string` uses internally - let bytes = std::fs::read(path)?; - if simdutf8::basic::from_utf8(&bytes).is_err() { - // Same error as `fs::read_to_string` produces (`io::Error::INVALID_UTF8`) - return Err(io::Error::new( - io::ErrorKind::InvalidData, - "stream did not contain valid UTF-8", - )); - } - // SAFETY: `simdutf8` has ensured it's a valid UTF-8 string - Ok(unsafe { String::from_utf8_unchecked(bytes) }) -} - -impl FileSystem for FileSystemOs { - fn read_to_string(&self, path: &Path) -> io::Result { - cfg_if! { - if #[cfg(feature = "yarn_pnp")] { - match VPath::from(path)? { - VPath::Zip(info) => { - self.pnp_lru.read_to_string(info.physical_base_path(), info.zip_path) - } - VPath::Virtual(info) => read_to_string(&info.physical_base_path()), - VPath::Native(path) => read_to_string(&path), - } - } else { - read_to_string(path) - } - } - } - - fn metadata(&self, path: &Path) -> io::Result { - cfg_if! { - if #[cfg(feature = "yarn_pnp")] { - match VPath::from(path)? { - VPath::Zip(info) => self - .pnp_lru - .file_type(info.physical_base_path(), info.zip_path) - .map(FileMetadata::from), - VPath::Virtual(info) => { - fs::metadata(info.physical_base_path()).map(FileMetadata::from) - } - VPath::Native(path) => fs::metadata(path).map(FileMetadata::from), - } - } else { - fs::metadata(path).map(FileMetadata::from) - } - } - } - - fn symlink_metadata(&self, path: &Path) -> io::Result { - fs::symlink_metadata(path).map(FileMetadata::from) - } - - fn canonicalize(&self, path: &Path) -> io::Result { - cfg_if! { - if #[cfg(feature = "yarn_pnp")] { - match VPath::from(path)? { - VPath::Zip(info) => { - dunce::canonicalize(info.physical_base_path().join(info.zip_path)) - } - VPath::Virtual(info) => dunce::canonicalize(info.physical_base_path()), - VPath::Native(path) => dunce::canonicalize(path), - } - } else if #[cfg(windows)] { - dunce::canonicalize(path) - } else { - use std::path::Component; - let mut path_buf = path.to_path_buf(); - loop { - let link = fs::read_link(&path_buf)?; - path_buf.pop(); - for component in link.components() { - match component { - Component::ParentDir => { - path_buf.pop(); - } - Component::Normal(seg) => { - #[cfg(target_family = "wasm")] - // Need to trim the extra \0 introduces by https://github.com/nodejs/uvwasi/issues/262 - { - path_buf.push(seg.to_string_lossy().trim_end_matches('\0')); - } - #[cfg(not(target_family = "wasm"))] - { - path_buf.push(seg); - } - } - Component::RootDir => { - path_buf = PathBuf::from("/"); - } - Component::CurDir | Component::Prefix(_) => {} - } - } - if !fs::symlink_metadata(&path_buf)?.is_symlink() { - break; - } - } - Ok(path_buf) - } - } - } -} - -#[test] -fn metadata() { - let meta = FileMetadata { is_file: true, is_dir: true, is_symlink: true }; - assert_eq!( - format!("{meta:?}"), - "FileMetadata { is_file: true, is_dir: true, is_symlink: true }" - ); - let _ = meta; -} diff --git a/src/lib.rs b/src/lib.rs deleted file mode 100644 index e6cb2246..00000000 --- a/src/lib.rs +++ /dev/null @@ -1,1755 +0,0 @@ -//! # Oxc Resolver -//! -//! Node.js [CommonJS][cjs] and [ECMAScript][esm] Module Resolution. -//! -//! Released on [crates.io](https://crates.io/crates/oxc_resolver) and [npm](https://www.npmjs.com/package/oxc-resolver). -//! -//! A module resolution is the process of finding the file referenced by a module specifier in -//! `import "specifier"` or `require("specifier")`. -//! -//! All [configuration options](ResolveOptions) are aligned with webpack's [enhanced-resolve]. -//! -//! ## Terminology -//! -//! ### Specifier -//! -//! For [CommonJS modules][cjs], -//! the specifier is the string passed to the `require` function. e.g. `"id"` in `require("id")`. -//! -//! For [ECMAScript modules][esm], -//! the specifier of an `import` statement is the string after the `from` keyword, -//! e.g. `'specifier'` in `import 'specifier'` or `import { sep } from 'specifier'`. -//! Specifiers are also used in export from statements, and as the argument to an `import()` expression. -//! -//! This is also named "request" in some places. -//! -//! ## References: -//! -//! * Algorithm adapted from Node.js [CommonJS Module Resolution Algorithm] and [ECMAScript Module Resolution Algorithm]. -//! * Tests are ported from [enhanced-resolve]. -//! * Some code is adapted from [parcel-resolver]. -//! * The documentation is copied from [webpack's resolve configuration](https://webpack.js.org/configuration/resolve). -//! -//! [enhanced-resolve]: https://github.com/webpack/enhanced-resolve -//! [CommonJS Module Resolution Algorithm]: https://nodejs.org/api/modules.html#all-together -//! [ECMAScript Module Resolution Algorithm]: https://nodejs.org/api/esm.html#resolution-algorithm-specification -//! [parcel-resolver]: https://github.com/parcel-bundler/parcel/blob/v2/packages/utils/node-resolver-rs -//! [cjs]: https://nodejs.org/api/modules.html -//! [esm]: https://nodejs.org/api/esm.html -//! -//! ## Feature flags -#![cfg_attr(feature = "document-features", doc = document_features::document_features!())] -#![cfg_attr(docsrs, feature(doc_auto_cfg))] -//! -//! ## Example -//! -//! ```rust,ignore -#![doc = include_str!("../examples/resolver.rs")] -//! ``` - -mod builtins; -mod cache; -mod context; -mod error; -mod file_system; -mod options; -mod package_json; -mod path; -mod resolution; -mod specifier; -mod tsconfig; - -#[cfg(test)] -mod tests; - -use std::{ - borrow::Cow, - cmp::Ordering, - ffi::OsStr, - fmt, - path::{Component, Path, PathBuf}, - sync::Arc, -}; - -use rustc_hash::FxHashSet; -use serde_json::Value as JSONValue; - -pub use crate::{ - builtins::NODEJS_BUILTINS, - error::{JSONError, ResolveError, SpecifierError}, - file_system::{FileMetadata, FileSystem}, - options::{ - Alias, AliasValue, EnforceExtension, ResolveOptions, Restriction, TsconfigOptions, - TsconfigReferences, - }, - package_json::PackageJson, - resolution::Resolution, -}; -use crate::{ - cache::{Cache, CachedPath}, - context::ResolveContext as Ctx, - file_system::FileSystemOs, - package_json::JSONMap, - path::{PathUtil, SLASH_START}, - specifier::Specifier, - tsconfig::ExtendsField, - tsconfig::{ProjectReference, TsConfig}, -}; - -type ResolveResult = Result, ResolveError>; - -/// Context returned from the [Resolver::resolve_with_context] API -#[derive(Debug, Default, Clone)] -pub struct ResolveContext { - /// Files that was found on file system - pub file_dependencies: FxHashSet, - - /// Dependencies that was not found on file system - pub missing_dependencies: FxHashSet, -} - -/// Resolver with the current operating system as the file system -pub type Resolver = ResolverGeneric; - -/// Generic implementation of the resolver, can be configured by the [FileSystem] trait -pub struct ResolverGeneric { - options: ResolveOptions, - cache: Arc>, -} - -impl fmt::Debug for ResolverGeneric { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - self.options.fmt(f) - } -} - -impl Default for ResolverGeneric { - fn default() -> Self { - Self::new(ResolveOptions::default()) - } -} - -impl ResolverGeneric { - pub fn new(options: ResolveOptions) -> Self { - Self { options: options.sanitize(), cache: Arc::new(Cache::new(Fs::default())) } - } -} - -impl ResolverGeneric { - pub fn new_with_file_system(file_system: Fs, options: ResolveOptions) -> Self { - Self { cache: Arc::new(Cache::new(file_system)), options: options.sanitize() } - } - - /// Clone the resolver using the same underlying cache. - #[must_use] - pub fn clone_with_options(&self, options: ResolveOptions) -> Self { - Self { options: options.sanitize(), cache: Arc::clone(&self.cache) } - } - - /// Returns the options. - pub fn options(&self) -> &ResolveOptions { - &self.options - } - - /// Clear the underlying cache. - pub fn clear_cache(&self) { - self.cache.clear(); - } - - /// Resolve `specifier` at an absolute path to a `directory`. - /// - /// A specifier is the string passed to require or import, i.e. `require("specifier")` or `import "specifier"`. - /// - /// `directory` must be an **absolute** path to a directory where the specifier is resolved against. - /// For CommonJS modules, it is the `__dirname` variable that contains the absolute path to the folder containing current module. - /// For ECMAScript modules, it is the value of `import.meta.url`. - /// - /// # Errors - /// - /// * See [ResolveError] - pub fn resolve>( - &self, - directory: P, - specifier: &str, - ) -> Result { - let mut ctx = Ctx::default(); - self.resolve_tracing(directory.as_ref(), specifier, &mut ctx) - } - - /// Resolve `specifier` at absolute `path` with [ResolveContext] - /// - /// # Errors - /// - /// * See [ResolveError] - pub fn resolve_with_context>( - &self, - directory: P, - specifier: &str, - resolve_context: &mut ResolveContext, - ) -> Result { - let mut ctx = Ctx::default(); - ctx.init_file_dependencies(); - let result = self.resolve_tracing(directory.as_ref(), specifier, &mut ctx); - if let Some(deps) = &mut ctx.file_dependencies { - resolve_context.file_dependencies.extend(deps.drain(..)); - } - if let Some(deps) = &mut ctx.missing_dependencies { - resolve_context.missing_dependencies.extend(deps.drain(..)); - } - result - } - - /// Wrap `resolve_impl` with `tracing` information - fn resolve_tracing( - &self, - directory: &Path, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - let span = tracing::debug_span!("resolve", path = ?directory, specifier = specifier); - let _enter = span.enter(); - let r = self.resolve_impl(directory, specifier, ctx); - match &r { - Ok(r) => { - tracing::debug!(options = ?self.options, path = ?directory, specifier = specifier, ret = ?r.path); - } - Err(err) => { - tracing::debug!(options = ?self.options, path = ?directory, specifier = specifier, err = ?err); - } - }; - r - } - - fn resolve_impl( - &self, - path: &Path, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - ctx.with_fully_specified(self.options.fully_specified); - let cached_path = self.cache.value(path); - let cached_path = self.require(&cached_path, specifier, ctx)?; - let path = self.load_realpath(&cached_path)?; - // enhanced-resolve: restrictions - self.check_restrictions(&path)?; - let package_json = cached_path.find_package_json(&self.cache.fs, &self.options, ctx)?; - if let Some(package_json) = &package_json { - // path must be inside the package. - debug_assert!(path.starts_with(package_json.directory())); - } - Ok(Resolution { - path, - query: ctx.query.take(), - fragment: ctx.fragment.take(), - package_json, - }) - } - - /// require(X) from module at path Y - /// - /// X: specifier - /// Y: path - /// - /// - fn require( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - ctx.test_for_infinite_recursion()?; - - // enhanced-resolve: parse - let (parsed, try_fragment_as_path) = self.load_parse(cached_path, specifier, ctx)?; - if let Some(path) = try_fragment_as_path { - return Ok(path); - } - - self.require_without_parse(cached_path, parsed.path(), ctx) - } - - fn require_without_parse( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - // tsconfig-paths - if let Some(path) = self.load_tsconfig_paths(cached_path, specifier, &mut Ctx::default())? { - return Ok(path); - } - - // enhanced-resolve: try alias - if let Some(path) = self.load_alias(cached_path, specifier, &self.options.alias, ctx)? { - return Ok(path); - } - - let result = match Path::new(specifier).components().next() { - // 2. If X begins with '/' - Some(Component::RootDir | Component::Prefix(_)) => { - self.require_absolute(cached_path, specifier, ctx) - } - // 3. If X begins with './' or '/' or '../' - Some(Component::CurDir | Component::ParentDir) => { - self.require_relative(cached_path, specifier, ctx) - } - // 4. If X begins with '#' - Some(Component::Normal(_)) if specifier.as_bytes()[0] == b'#' => { - self.require_hash(cached_path, specifier, ctx) - } - _ => { - // 1. If X is a core module, - // a. return the core module - // b. STOP - self.require_core(specifier)?; - - // (ESM) 5. Otherwise, - // Note: specifier is now a bare specifier. - // Set resolved the result of PACKAGE_RESOLVE(specifier, parentURL). - self.require_bare(cached_path, specifier, ctx) - } - }; - - result.or_else(|err| { - if err.is_ignore() { - return Err(err); - } - // enhanced-resolve: try fallback - self.load_alias(cached_path, specifier, &self.options.fallback, ctx) - .and_then(|value| value.ok_or(err)) - }) - } - - // PACKAGE_RESOLVE(packageSpecifier, parentURL) - // 3. If packageSpecifier is a Node.js builtin module name, then - // 1. Return the string "node:" concatenated with packageSpecifier. - fn require_core(&self, specifier: &str) -> Result<(), ResolveError> { - if self.options.builtin_modules { - let starts_with_node = specifier.starts_with("node:"); - if starts_with_node || NODEJS_BUILTINS.binary_search(&specifier).is_ok() { - let mut specifier = specifier.to_string(); - if !starts_with_node { - specifier = format!("node:{specifier}"); - } - return Err(ResolveError::Builtin(specifier)); - } - } - Ok(()) - } - - fn require_absolute( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - // Make sure only path prefixes gets called - debug_assert!(Path::new(specifier) - .components() - .next() - .is_some_and(|c| matches!(c, Component::RootDir | Component::Prefix(_)))); - if !self.options.prefer_relative && self.options.prefer_absolute { - if let Ok(path) = self.load_package_self_or_node_modules(cached_path, specifier, ctx) { - return Ok(path); - } - } - if let Some(path) = self.load_roots(specifier, ctx) { - return Ok(path); - } - // 2. If X begins with '/' - // a. set Y to be the file system root - let path = self.cache.value(Path::new(specifier)); - if let Some(path) = self.load_as_file_or_directory(&path, specifier, ctx)? { - return Ok(path); - } - Err(ResolveError::NotFound(specifier.to_string())) - } - - // 3. If X begins with './' or '/' or '../' - fn require_relative( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - // Make sure only relative or normal paths gets called - debug_assert!(Path::new(specifier).components().next().is_some_and(|c| matches!( - c, - Component::CurDir | Component::ParentDir | Component::Normal(_) - ))); - let path = cached_path.path().normalize_with(specifier); - let cached_path = self.cache.value(&path); - // a. LOAD_AS_FILE(Y + X) - // b. LOAD_AS_DIRECTORY(Y + X) - if let Some(path) = self.load_as_file_or_directory(&cached_path, specifier, ctx)? { - return Ok(path); - } - // c. THROW "not found" - Err(ResolveError::NotFound(specifier.to_string())) - } - - fn require_hash( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - debug_assert_eq!(specifier.chars().next(), Some('#')); - // a. LOAD_PACKAGE_IMPORTS(X, dirname(Y)) - if let Some(path) = self.load_package_imports(cached_path, specifier, ctx)? { - return Ok(path); - } - self.load_package_self_or_node_modules(cached_path, specifier, ctx) - } - - fn require_bare( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - // Make sure no other path prefixes gets called - debug_assert!(Path::new(specifier) - .components() - .next() - .is_some_and(|c| matches!(c, Component::Normal(_)))); - if self.options.prefer_relative { - if let Ok(path) = self.require_relative(cached_path, specifier, ctx) { - return Ok(path); - } - } - self.load_package_self_or_node_modules(cached_path, specifier, ctx) - } - - /// enhanced-resolve: ParsePlugin. - /// - /// 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`. - /// - /// - fn load_parse<'s>( - &self, - cached_path: &CachedPath, - specifier: &'s str, - ctx: &mut Ctx, - ) -> Result<(Specifier<'s>, Option), ResolveError> { - let parsed = Specifier::parse(specifier).map_err(ResolveError::Specifier)?; - ctx.with_query_fragment(parsed.query, parsed.fragment); - - // There is an edge-case where a request with # can be a path or a fragment -> try both - if ctx.fragment.is_some() && ctx.query.is_none() { - let specifier = parsed.path(); - let fragment = ctx.fragment.take().unwrap(); - let path = format!("{specifier}{fragment}"); - if let Ok(path) = self.require_without_parse(cached_path, &path, ctx) { - return Ok((parsed, Some(path))); - } - ctx.fragment.replace(fragment); - } - Ok((parsed, None)) - } - - fn load_package_self_or_node_modules( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - let (_, subpath) = Self::parse_package_specifier(specifier); - if subpath.is_empty() { - ctx.with_fully_specified(false); - } - // 5. LOAD_PACKAGE_SELF(X, dirname(Y)) - if let Some(path) = self.load_package_self(cached_path, specifier, ctx)? { - return Ok(path); - } - // 6. LOAD_NODE_MODULES(X, dirname(Y)) - if let Some(path) = self.load_node_modules(cached_path, specifier, ctx)? { - return Ok(path); - } - // 7. THROW "not found" - Err(ResolveError::NotFound(specifier.to_string())) - } - - /// LOAD_PACKAGE_IMPORTS(X, DIR) - fn load_package_imports( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - // 1. Find the closest package scope SCOPE to DIR. - // 2. If no scope was found, return. - let Some(package_json) = - cached_path.find_package_json(&self.cache.fs, &self.options, ctx)? - else { - return Ok(None); - }; - // 3. If the SCOPE/package.json "imports" is null or undefined, return. - // 4. let MATCH = PACKAGE_IMPORTS_RESOLVE(X, pathToFileURL(SCOPE), ["node", "require"]) defined in the ESM resolver. - if let Some(path) = self.package_imports_resolve(specifier, &package_json, ctx)? { - // 5. RESOLVE_ESM_MATCH(MATCH). - return self.resolve_esm_match(specifier, &path, ctx); - } - Ok(None) - } - - fn load_as_file(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - // enhanced-resolve feature: extension_alias - if let Some(path) = self.load_extension_alias(cached_path, ctx)? { - return Ok(Some(path)); - } - if self.options.enforce_extension.is_disabled() { - // 1. If X is a file, load X as its file extension format. STOP - if let Some(path) = self.load_alias_or_file(cached_path, ctx)? { - return Ok(Some(path)); - } - } - // 2. If X.js is a file, load X.js as JavaScript text. STOP - // 3. If X.json is a file, parse X.json to a JavaScript Object. STOP - // 4. If X.node is a file, load X.node as binary addon. STOP - if let Some(path) = self.load_extensions(cached_path, &self.options.extensions, ctx)? { - return Ok(Some(path)); - } - Ok(None) - } - - fn load_as_directory(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - // TODO: Only package.json is supported, so warn about having other values - // Checking for empty files is needed for omitting checks on package.json - // 1. If X/package.json is a file, - if !self.options.description_files.is_empty() { - // a. Parse X/package.json, and look for "main" field. - if let Some(package_json) = - cached_path.package_json(&self.cache.fs, &self.options, ctx)? - { - // b. If "main" is a falsy value, GOTO 2. - for main_field in package_json.main_fields(&self.options.main_fields) { - // c. let M = X + (json main field) - let main_field_path = cached_path.path().normalize_with(main_field); - // d. LOAD_AS_FILE(M) - let cached_path = self.cache.value(&main_field_path); - if let Some(path) = self.load_as_file(&cached_path, ctx)? { - return Ok(Some(path)); - } - // e. LOAD_INDEX(M) - if let Some(path) = self.load_index(&cached_path, ctx)? { - return Ok(Some(path)); - } - } - // f. LOAD_INDEX(X) DEPRECATED - // g. THROW "not found" - } - } - // 2. LOAD_INDEX(X) - self.load_index(cached_path, ctx) - } - - fn load_as_file_or_directory( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - if self.options.resolve_to_context { - return Ok(cached_path.is_dir(&self.cache.fs, ctx).then(|| cached_path.clone())); - } - if !specifier.ends_with('/') { - if let Some(path) = self.load_as_file(cached_path, ctx)? { - return Ok(Some(path)); - } - } - if cached_path.is_dir(&self.cache.fs, ctx) { - if let Some(path) = self.load_as_directory(cached_path, ctx)? { - return Ok(Some(path)); - } - } - Ok(None) - } - - fn load_extensions( - &self, - path: &CachedPath, - extensions: &[String], - ctx: &mut Ctx, - ) -> ResolveResult { - if ctx.fully_specified { - return Ok(None); - } - let path = path.path().as_os_str(); - for extension in extensions { - let mut path_with_extension = path.to_os_string(); - path_with_extension.reserve_exact(extension.len()); - path_with_extension.push(extension); - let cached_path = self.cache.value(Path::new(&path_with_extension)); - if let Some(path) = self.load_alias_or_file(&cached_path, ctx)? { - return Ok(Some(path)); - } - } - Ok(None) - } - - fn load_realpath(&self, cached_path: &CachedPath) -> Result { - if self.options.symlinks { - cached_path.realpath(&self.cache.fs).map_err(ResolveError::from) - } else { - Ok(cached_path.to_path_buf()) - } - } - - fn check_restrictions(&self, path: &Path) -> Result<(), ResolveError> { - // https://github.com/webpack/enhanced-resolve/blob/a998c7d218b7a9ec2461fc4fddd1ad5dd7687485/lib/RestrictionsPlugin.js#L19-L24 - fn is_inside(path: &Path, parent: &Path) -> bool { - if !path.starts_with(parent) { - return false; - } - if path.as_os_str().len() == parent.as_os_str().len() { - return true; - } - path.strip_prefix(parent).is_ok_and(|p| p == Path::new("./")) - } - for restriction in &self.options.restrictions { - match restriction { - Restriction::Path(restricted_path) => { - if !is_inside(path, restricted_path) { - return Err(ResolveError::Restriction( - path.to_path_buf(), - restricted_path.clone(), - )); - } - } - Restriction::RegExp(_) => { - return Err(ResolveError::Unimplemented("Restriction with regex")) - } - } - } - Ok(()) - } - - fn load_index(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - for main_file in &self.options.main_files { - let main_path = cached_path.path().normalize_with(main_file); - let cached_path = self.cache.value(&main_path); - if self.options.enforce_extension.is_disabled() { - if let Some(path) = self.load_alias_or_file(&cached_path, ctx)? { - return Ok(Some(path)); - } - } - // 1. If X/index.js is a file, load X/index.js as JavaScript text. STOP - // 2. If X/index.json is a file, parse X/index.json to a JavaScript object. STOP - // 3. If X/index.node is a file, load X/index.node as binary addon. STOP - if let Some(path) = self.load_extensions(&cached_path, &self.options.extensions, ctx)? { - return Ok(Some(path)); - } - } - Ok(None) - } - - fn load_alias_or_file(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - if !self.options.alias_fields.is_empty() { - if let Some(package_json) = - cached_path.find_package_json(&self.cache.fs, &self.options, ctx)? - { - if let Some(path) = - self.load_browser_field(cached_path, None, &package_json, ctx)? - { - return Ok(Some(path)); - } - } - } - // enhanced-resolve: try file as alias - let alias_specifier = cached_path.path().to_string_lossy(); - if let Some(path) = - self.load_alias(cached_path, &alias_specifier, &self.options.alias, ctx)? - { - return Ok(Some(path)); - } - if cached_path.is_file(&self.cache.fs, ctx) { - return Ok(Some(cached_path.clone())); - } - Ok(None) - } - - fn load_node_modules( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - #[cfg(feature = "yarn_pnp")] - { - if let Some(resolved_path) = self.load_pnp(cached_path, specifier, ctx)? { - return Ok(Some(resolved_path)); - } - } - - let (package_name, subpath) = Self::parse_package_specifier(specifier); - // 1. let DIRS = NODE_MODULES_PATHS(START) - // 2. for each DIR in DIRS: - for module_name in &self.options.modules { - for cached_path in std::iter::successors(Some(cached_path), |p| p.parent()) { - // Skip if /path/to/node_modules does not exist - if !cached_path.is_dir(&self.cache.fs, ctx) { - continue; - } - - let Some(cached_path) = self.get_module_directory(cached_path, module_name, ctx) - else { - continue; - }; - // Optimize node_modules lookup by inspecting whether the package exists - // From LOAD_PACKAGE_EXPORTS(X, DIR) - // 1. Try to interpret X as a combination of NAME and SUBPATH where the name - // may have a @scope/ prefix and the subpath begins with a slash (`/`). - if !package_name.is_empty() { - let package_path = cached_path.path().normalize_with(package_name); - let cached_path = self.cache.value(&package_path); - // Try foo/node_modules/package_name - if cached_path.is_dir(&self.cache.fs, ctx) { - // a. LOAD_PACKAGE_EXPORTS(X, DIR) - if let Some(path) = - self.load_package_exports(specifier, subpath, &cached_path, ctx)? - { - return Ok(Some(path)); - } - } else { - // foo/node_modules/package_name is not a directory, so useless to check inside it - if !subpath.is_empty() { - continue; - } - // Skip if the directory lead to the scope package does not exist - // i.e. `foo/node_modules/@scope` is not a directory for `foo/node_modules/@scope/package` - if package_name.starts_with('@') { - if let Some(path) = cached_path.parent() { - if !path.is_dir(&self.cache.fs, ctx) { - continue; - } - } - } - } - } - - // Try as file or directory for all other cases - // b. LOAD_AS_FILE(DIR/X) - // c. LOAD_AS_DIRECTORY(DIR/X) - let node_module_file = cached_path.path().normalize_with(specifier); - let cached_path = self.cache.value(&node_module_file); - if let Some(path) = self.load_as_file_or_directory(&cached_path, specifier, ctx)? { - return Ok(Some(path)); - } - } - } - Ok(None) - } - - #[cfg(feature = "yarn_pnp")] - fn load_pnp( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result, ResolveError> { - let Some(pnp_manifest) = &self.options.pnp_manifest else { return Ok(None) }; - let resolution = - pnp::resolve_to_unqualified_via_manifest(pnp_manifest, specifier, cached_path.path()); - match resolution { - Ok(pnp::Resolution::Resolved(path, subpath)) => { - let cached_path = self.cache.value(&path); - let export_resolution = self.load_package_exports( - specifier, - &subpath.unwrap_or_default(), - &cached_path, - ctx, - )?; - if export_resolution.is_some() { - return Ok(export_resolution); - } - let file_or_directory_resolution = - self.load_as_file_or_directory(&cached_path, specifier, ctx)?; - if file_or_directory_resolution.is_some() { - return Ok(file_or_directory_resolution); - } - Err(ResolveError::NotFound(specifier.to_string())) - } - - Ok(pnp::Resolution::Skipped) => Ok(None), - - Err(_) => { - // Todo: Add a ResolveError::Pnp variant? - Err(ResolveError::NotFound(specifier.to_string())) - } - } - } - - fn get_module_directory( - &self, - cached_path: &CachedPath, - module_name: &str, - ctx: &mut Ctx, - ) -> Option { - if module_name == "node_modules" { - cached_path.cached_node_modules(&self.cache, ctx) - } else if cached_path.path().components().next_back() - == Some(Component::Normal(OsStr::new(module_name))) - { - Some(cached_path.clone()) - } else { - cached_path.module_directory(module_name, &self.cache, ctx) - } - } - - fn load_package_exports( - &self, - specifier: &str, - subpath: &str, - cached_path: &CachedPath, - ctx: &mut Ctx, - ) -> ResolveResult { - // 2. If X does not match this pattern or DIR/NAME/package.json is not a file, - // return. - let Some(package_json) = cached_path.package_json(&self.cache.fs, &self.options, ctx)? - else { - return Ok(None); - }; - // 3. Parse DIR/NAME/package.json, and look for "exports" field. - // 4. If "exports" is null or undefined, return. - // 5. let MATCH = PACKAGE_EXPORTS_RESOLVE(pathToFileURL(DIR/NAME), "." + SUBPATH, - // `package.json` "exports", ["node", "require"]) defined in the ESM resolver. - // Note: The subpath is not prepended with a dot on purpose - for exports in package_json.exports_fields(&self.options.exports_fields) { - if let Some(path) = self.package_exports_resolve( - cached_path.path(), - &format!(".{subpath}"), - exports, - ctx, - )? { - // 6. RESOLVE_ESM_MATCH(MATCH) - return self.resolve_esm_match(specifier, &path, ctx); - }; - } - Ok(None) - } - - fn load_package_self( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - // 1. Find the closest package scope SCOPE to DIR. - // 2. If no scope was found, return. - let Some(package_json) = - cached_path.find_package_json(&self.cache.fs, &self.options, ctx)? - else { - return Ok(None); - }; - // 3. If the SCOPE/package.json "exports" is null or undefined, return. - // 4. If the SCOPE/package.json "name" is not the first segment of X, return. - if let Some(subpath) = package_json - .name - .as_ref() - .and_then(|package_name| Self::strip_package_name(specifier, package_name)) - { - // 5. let MATCH = PACKAGE_EXPORTS_RESOLVE(pathToFileURL(SCOPE), - // "." + X.slice("name".length), `package.json` "exports", ["node", "require"]) - // defined in the ESM resolver. - let package_url = package_json.directory(); - // Note: The subpath is not prepended with a dot on purpose - // because `package_exports_resolve` matches subpath without the leading dot. - for exports in package_json.exports_fields(&self.options.exports_fields) { - if let Some(cached_path) = - self.package_exports_resolve(package_url, &format!(".{subpath}"), exports, ctx)? - { - // 6. RESOLVE_ESM_MATCH(MATCH) - return self.resolve_esm_match(specifier, &cached_path, ctx); - } - } - } - self.load_browser_field(cached_path, Some(specifier), &package_json, ctx) - } - - /// RESOLVE_ESM_MATCH(MATCH) - fn resolve_esm_match( - &self, - specifier: &str, - cached_path: &CachedPath, - ctx: &mut Ctx, - ) -> ResolveResult { - // 1. let RESOLVED_PATH = fileURLToPath(MATCH) - // 2. If the file at RESOLVED_PATH exists, load RESOLVED_PATH as its extension format. STOP - // - // Non-compliant ESM can result in a directory, so directory is tried as well. - if let Some(path) = self.load_as_file_or_directory(cached_path, "", ctx)? { - return Ok(Some(path)); - } - // 3. THROW "not found" - Err(ResolveError::NotFound(specifier.to_string())) - } - - /// enhanced-resolve: AliasFieldPlugin for [ResolveOptions::alias_fields] - fn load_browser_field( - &self, - cached_path: &CachedPath, - module_specifier: Option<&str>, - package_json: &PackageJson, - ctx: &mut Ctx, - ) -> ResolveResult { - let path = cached_path.path(); - let Some(new_specifier) = package_json.resolve_browser_field( - path, - module_specifier, - &self.options.alias_fields, - )? - else { - return Ok(None); - }; - // Abort when resolving recursive module - if module_specifier.is_some_and(|s| s == new_specifier) { - return Ok(None); - } - if ctx.resolving_alias.as_ref().is_some_and(|s| s == new_specifier) { - // Complete when resolving to self `{"./a.js": "./a.js"}` - if new_specifier.strip_prefix("./").filter(|s| path.ends_with(Path::new(s))).is_some() { - return if cached_path.is_file(&self.cache.fs, ctx) { - Ok(Some(cached_path.clone())) - } else { - Err(ResolveError::NotFound(new_specifier.to_string())) - }; - } - return Err(ResolveError::Recursion); - } - ctx.with_resolving_alias(new_specifier.to_string()); - ctx.with_fully_specified(false); - let cached_path = self.cache.value(package_json.directory()); - self.require(&cached_path, new_specifier, ctx).map(Some) - } - - /// enhanced-resolve: AliasPlugin for [ResolveOptions::alias] and [ResolveOptions::fallback]. - fn load_alias( - &self, - cached_path: &CachedPath, - specifier: &str, - aliases: &Alias, - ctx: &mut Ctx, - ) -> ResolveResult { - for (alias_key_raw, specifiers) in aliases { - let alias_key = if let Some(alias_key) = alias_key_raw.strip_suffix('$') { - if alias_key != specifier { - continue; - } - alias_key - } else { - let strip_package_name = Self::strip_package_name(specifier, alias_key_raw); - if strip_package_name.is_none() { - continue; - } - alias_key_raw - }; - // It should stop resolving when all of the tried alias values - // failed to resolve. - // - let mut should_stop = false; - for r in specifiers { - match r { - AliasValue::Path(alias_value) => { - if let Some(path) = self.load_alias_value( - cached_path, - alias_key, - alias_value, - specifier, - ctx, - &mut should_stop, - )? { - return Ok(Some(path)); - } - } - AliasValue::Ignore => { - let path = cached_path.path().normalize_with(alias_key); - return Err(ResolveError::Ignored(path)); - } - } - } - if should_stop { - return Err(ResolveError::MatchedAliasNotFound( - specifier.to_string(), - alias_key.to_string(), - )); - } - } - Ok(None) - } - - fn load_alias_value( - &self, - cached_path: &CachedPath, - alias_key: &str, - alias_value: &str, - request: &str, - ctx: &mut Ctx, - should_stop: &mut bool, - ) -> ResolveResult { - if request != alias_value - && !request.strip_prefix(alias_value).is_some_and(|prefix| prefix.starts_with('/')) - { - let tail = &request[alias_key.len()..]; - - let new_specifier = if tail.is_empty() { - Cow::Borrowed(alias_value) - } else { - let alias_value = Path::new(alias_value).normalize(); - // Must not append anything to alias_value if it is a file. - let alias_value_cached_path = self.cache.value(&alias_value); - if alias_value_cached_path.is_file(&self.cache.fs, ctx) { - return Ok(None); - } - - // Remove the leading slash so the final path is concatenated. - let tail = tail.trim_start_matches(SLASH_START); - let normalized = alias_value.normalize_with(tail); - Cow::Owned(normalized.to_string_lossy().to_string()) - }; - - *should_stop = true; - ctx.with_fully_specified(false); - return match self.require(cached_path, new_specifier.as_ref(), ctx) { - Err(ResolveError::NotFound(_) | ResolveError::MatchedAliasNotFound(_, _)) => { - Ok(None) - } - Ok(path) => return Ok(Some(path)), - Err(err) => return Err(err), - }; - } - Ok(None) - } - - /// Given an extension alias map `{".js": [".ts", ".js"]}`, - /// load the mapping instead of the provided extension - /// - /// This is an enhanced-resolve feature - /// - /// # Errors - /// - /// * [ResolveError::ExtensionAlias]: When all of the aliased extensions are not found - fn load_extension_alias(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - if self.options.extension_alias.is_empty() { - return Ok(None); - } - let Some(path_extension) = cached_path.path().extension() else { - return Ok(None); - }; - let Some((_, extensions)) = self - .options - .extension_alias - .iter() - .find(|(ext, _)| OsStr::new(ext.trim_start_matches('.')) == path_extension) - else { - return Ok(None); - }; - let path = cached_path.path().with_extension(""); - let path = path.as_os_str(); - ctx.with_fully_specified(true); - for extension in extensions { - let mut path_with_extension = path.to_os_string(); - path_with_extension.reserve_exact(extension.len()); - path_with_extension.push(extension); - let cached_path = self.cache.value(Path::new(&path_with_extension)); - // Bail if path is module directory such as `ipaddr.js` - if cached_path.is_dir(&self.cache.fs, ctx) { - ctx.with_fully_specified(false); - return Ok(None); - } - if let Some(path) = self.load_alias_or_file(&cached_path, ctx)? { - ctx.with_fully_specified(false); - return Ok(Some(path)); - } - } - Err(ResolveError::ExtensionAlias(cached_path.to_path_buf())) - } - - /// enhanced-resolve: RootsPlugin - /// - /// A list of directories where requests of server-relative URLs (starting with '/') are resolved, - /// defaults to context configuration option. - /// - /// On non-Windows systems these requests are resolved as an absolute path first. - fn load_roots(&self, specifier: &str, ctx: &mut Ctx) -> Option { - if self.options.roots.is_empty() { - return None; - } - if let Some(specifier) = specifier.strip_prefix(SLASH_START) { - for root in &self.options.roots { - let cached_path = self.cache.value(root); - if let Ok(path) = self.require_relative(&cached_path, specifier, ctx) { - return Some(path); - } - } - } - None - } - - fn load_tsconfig_paths( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - let Some(tsconfig_options) = &self.options.tsconfig else { - return Ok(None); - }; - let tsconfig = self.load_tsconfig( - /* root */ true, - &tsconfig_options.config_file, - &tsconfig_options.references, - )?; - let paths = tsconfig.resolve(cached_path.path(), specifier); - for path in paths { - let cached_path = self.cache.value(&path); - if let Ok(path) = self.require_relative(&cached_path, ".", ctx) { - return Ok(Some(path)); - } - } - Ok(None) - } - - fn load_tsconfig( - &self, - root: bool, - path: &Path, - references: &TsconfigReferences, - ) -> Result, ResolveError> { - self.cache.tsconfig(root, path, |tsconfig| { - let directory = self.cache.value(tsconfig.directory()); - tracing::trace!(tsconfig = ?tsconfig, "load_tsconfig"); - - // Extend tsconfig - if let Some(extends) = &tsconfig.extends { - let extended_tsconfig_paths = match extends { - ExtendsField::Single(s) => { - vec![self.get_extended_tsconfig_path(&directory, tsconfig, s)?] - } - ExtendsField::Multiple(specifiers) => specifiers - .iter() - .map(|s| self.get_extended_tsconfig_path(&directory, tsconfig, s)) - .collect::, ResolveError>>()?, - }; - for extended_tsconfig_path in extended_tsconfig_paths { - let extended_tsconfig = self.load_tsconfig( - /* root */ false, - &extended_tsconfig_path, - &TsconfigReferences::Disabled, - )?; - tsconfig.extend_tsconfig(&extended_tsconfig); - } - } - - // Load project references - match references { - TsconfigReferences::Disabled => { - tsconfig.references.drain(..); - } - TsconfigReferences::Auto => {} - TsconfigReferences::Paths(paths) => { - tsconfig.references = paths - .iter() - .map(|path| ProjectReference { path: path.clone(), tsconfig: None }) - .collect(); - } - } - if !tsconfig.references.is_empty() { - let directory = tsconfig.directory().to_path_buf(); - for reference in &mut tsconfig.references { - let reference_tsconfig_path = directory.normalize_with(&reference.path); - let tsconfig = self.cache.tsconfig( - /* root */ true, - &reference_tsconfig_path, - |reference_tsconfig| { - if reference_tsconfig.path == tsconfig.path { - return Err(ResolveError::TsconfigSelfReference( - reference_tsconfig.path.clone(), - )); - } - Ok(()) - }, - )?; - reference.tsconfig.replace(tsconfig); - } - } - Ok(()) - }) - } - - fn get_extended_tsconfig_path( - &self, - directory: &CachedPath, - tsconfig: &TsConfig, - specifier: &str, - ) -> Result { - match specifier.as_bytes().first() { - None => Err(ResolveError::Specifier(SpecifierError::Empty(specifier.to_string()))), - Some(b'/') => Ok(PathBuf::from(specifier)), - Some(b'.') => Ok(tsconfig.directory().normalize_with(specifier)), - _ => self - .clone_with_options(ResolveOptions { - description_files: vec![], - extensions: vec![".json".into()], - main_files: vec!["tsconfig.json".into()], - ..ResolveOptions::default() - }) - .load_package_self_or_node_modules(directory, specifier, &mut Ctx::default()) - .map(|p| p.to_path_buf()) - .map_err(|err| match err { - ResolveError::NotFound(_) => { - ResolveError::TsconfigNotFound(PathBuf::from(specifier)) - } - _ => err, - }), - } - } - - /// PACKAGE_RESOLVE(packageSpecifier, parentURL) - fn package_resolve( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - let (package_name, subpath) = Self::parse_package_specifier(specifier); - - // 3. If packageSpecifier is a Node.js builtin module name, then - // 1. Return the string "node:" concatenated with packageSpecifier. - self.require_core(package_name)?; - - // 11. While parentURL is not the file system root, - for module_name in &self.options.modules { - for cached_path in std::iter::successors(Some(cached_path), |p| p.parent()) { - // 1. Let packageURL be the URL resolution of "node_modules/" concatenated with packageSpecifier, relative to parentURL. - let Some(cached_path) = self.get_module_directory(cached_path, module_name, ctx) - else { - continue; - }; - // 2. Set parentURL to the parent folder URL of parentURL. - let package_path = cached_path.path().normalize_with(package_name); - let cached_path = self.cache.value(&package_path); - // 3. If the folder at packageURL does not exist, then - // 1. Continue the next loop iteration. - if cached_path.is_dir(&self.cache.fs, ctx) { - // 4. Let pjson be the result of READ_PACKAGE_JSON(packageURL). - if let Some(package_json) = - cached_path.package_json(&self.cache.fs, &self.options, ctx)? - { - // 5. If pjson is not null and pjson.exports is not null or undefined, then - // 1. Return the result of PACKAGE_EXPORTS_RESOLVE(packageURL, packageSubpath, pjson.exports, defaultConditions). - for exports in package_json.exports_fields(&self.options.exports_fields) { - if let Some(path) = self.package_exports_resolve( - cached_path.path(), - &format!(".{subpath}"), - exports, - ctx, - )? { - return Ok(Some(path)); - } - } - // 6. Otherwise, if packageSubpath is equal to ".", then - if subpath == "." { - // 1. If pjson.main is a string, then - for main_field in package_json.main_fields(&self.options.main_fields) { - // 1. Return the URL resolution of main in packageURL. - let path = cached_path.path().normalize_with(main_field); - let cached_path = self.cache.value(&path); - if cached_path.is_file(&self.cache.fs, ctx) { - return Ok(Some(cached_path)); - } - } - } - } - let subpath = format!(".{subpath}"); - ctx.with_fully_specified(false); - return self.require(&cached_path, &subpath, ctx).map(Some); - } - } - } - - Err(ResolveError::NotFound(specifier.to_string())) - } - - /// PACKAGE_EXPORTS_RESOLVE(packageURL, subpath, exports, conditions) - fn package_exports_resolve( - &self, - package_url: &Path, - subpath: &str, - exports: &JSONValue, - ctx: &mut Ctx, - ) -> ResolveResult { - let conditions = &self.options.condition_names; - // 1. If exports is an Object with both a key starting with "." and a key not starting with ".", throw an Invalid Package Configuration error. - if let JSONValue::Object(map) = exports { - let mut has_dot = false; - let mut without_dot = false; - for key in map.keys() { - let starts_with_dot_or_hash = key.starts_with(['.', '#']); - has_dot = has_dot || starts_with_dot_or_hash; - without_dot = without_dot || !starts_with_dot_or_hash; - if has_dot && without_dot { - return Err(ResolveError::InvalidPackageConfig( - package_url.join("package.json"), - )); - } - } - } - // 2. If subpath is equal to ".", then - // Note: subpath is not prepended with a dot when passed in. - if subpath == "." { - // enhanced-resolve appends query and fragment when resolving exports field - // https://github.com/webpack/enhanced-resolve/blob/a998c7d218b7a9ec2461fc4fddd1ad5dd7687485/lib/ExportsFieldPlugin.js#L57-L62 - // This is only need when querying the main export, otherwise ctx is passed through. - if ctx.query.is_some() || ctx.fragment.is_some() { - let query = ctx.query.clone().unwrap_or_default(); - let fragment = ctx.fragment.clone().unwrap_or_default(); - return Err(ResolveError::PackagePathNotExported( - format!("./{}{query}{fragment}", subpath.trim_start_matches('.')), - package_url.join("package.json"), - )); - } - // 1. Let mainExport be undefined. - let main_export = match exports { - // 2. If exports is a String or Array, or an Object containing no keys starting with ".", then - JSONValue::String(_) | JSONValue::Array(_) => { - // 1. Set mainExport to exports. - Some(exports) - } - // 3. Otherwise if exports is an Object containing a "." property, then - JSONValue::Object(map) => { - // 1. Set mainExport to exports["."]. - map.get(".").map_or_else( - || { - if map.keys().any(|key| key.starts_with("./") || key.starts_with('#')) { - None - } else { - Some(exports) - } - }, - Some, - ) - } - _ => None, - }; - // 4. If mainExport is not undefined, then - if let Some(main_export) = main_export { - // 1. Let resolved be the result of PACKAGE_TARGET_RESOLVE( packageURL, mainExport, null, false, conditions). - let resolved = self.package_target_resolve( - package_url, - ".", - main_export, - None, - /* is_imports */ false, - conditions, - ctx, - )?; - // 2. If resolved is not null or undefined, return resolved. - if let Some(path) = resolved { - return Ok(Some(path)); - } - } - } - // 3. Otherwise, if exports is an Object and all keys of exports start with ".", then - if let JSONValue::Object(exports) = exports { - // 1. Let matchKey be the string "./" concatenated with subpath. - // Note: `package_imports_exports_resolve` does not require the leading dot. - let match_key = &subpath; - // 2. Let resolved be the result of PACKAGE_IMPORTS_EXPORTS_RESOLVE( matchKey, exports, packageURL, false, conditions). - if let Some(path) = self.package_imports_exports_resolve( - match_key, - exports, - package_url, - /* is_imports */ false, - conditions, - ctx, - )? { - // 3. If resolved is not null or undefined, return resolved. - return Ok(Some(path)); - } - } - // 4. Throw a Package Path Not Exported error. - Err(ResolveError::PackagePathNotExported( - subpath.to_string(), - package_url.join("package.json"), - )) - } - - /// PACKAGE_IMPORTS_RESOLVE(specifier, parentURL, conditions) - fn package_imports_resolve( - &self, - specifier: &str, - package_json: &PackageJson, - ctx: &mut Ctx, - ) -> Result, ResolveError> { - // 1. Assert: specifier begins with "#". - debug_assert!(specifier.starts_with('#'), "{specifier}"); - // 2. If specifier is exactly equal to "#" or starts with "#/", then - // 1. Throw an Invalid Module Specifier error. - // 3. Let packageURL be the result of LOOKUP_PACKAGE_SCOPE(parentURL). - // 4. If packageURL is not null, then - - // 1. Let pjson be the result of READ_PACKAGE_JSON(packageURL). - // 2. If pjson.imports is a non-null Object, then - - // 1. Let resolved be the result of PACKAGE_IMPORTS_EXPORTS_RESOLVE( specifier, pjson.imports, packageURL, true, conditions). - let mut has_imports = false; - for imports in package_json.imports_fields(&self.options.imports_fields) { - if !has_imports { - has_imports = true; - // TODO: fill in test case for this case - if specifier == "#" || specifier.starts_with("#/") { - return Err(ResolveError::InvalidModuleSpecifier( - specifier.to_string(), - package_json.path.clone(), - )); - } - } - if let Some(path) = self.package_imports_exports_resolve( - specifier, - imports, - package_json.directory(), - /* is_imports */ true, - &self.options.condition_names, - ctx, - )? { - // 2. If resolved is not null or undefined, return resolved. - return Ok(Some(path)); - } - } - - // 5. Throw a Package Import Not Defined error. - if has_imports { - Err(ResolveError::PackageImportNotDefined( - specifier.to_string(), - package_json.path.clone(), - )) - } else { - Ok(None) - } - } - - /// PACKAGE_IMPORTS_EXPORTS_RESOLVE(matchKey, matchObj, packageURL, isImports, conditions) - fn package_imports_exports_resolve( - &self, - match_key: &str, - match_obj: &JSONMap, - package_url: &Path, - is_imports: bool, - conditions: &[String], - ctx: &mut Ctx, - ) -> ResolveResult { - // enhanced-resolve behaves differently, it throws - // Error: CachedPath to directories is not possible with the exports field (specifier was ./dist/) - if match_key.ends_with('/') { - return Ok(None); - } - // 1. If matchKey is a key of matchObj and does not contain "*", then - if !match_key.contains('*') { - // 1. Let target be the value of matchObj[matchKey]. - if let Some(target) = match_obj.get(match_key) { - // 2. Return the result of PACKAGE_TARGET_RESOLVE(packageURL, target, null, isImports, conditions). - return self.package_target_resolve( - package_url, - match_key, - target, - None, - is_imports, - conditions, - ctx, - ); - } - } - - let mut best_target = None; - let mut best_match = ""; - let mut best_key = ""; - // 2. Let expansionKeys be the list of keys of matchObj containing only a single "*", sorted by the sorting function PATTERN_KEY_COMPARE which orders in descending order of specificity. - // 3. For each key expansionKey in expansionKeys, do - for (expansion_key, target) in match_obj { - if expansion_key.starts_with("./") || expansion_key.starts_with('#') { - // 1. Let patternBase be the substring of expansionKey up to but excluding the first "*" character. - if let Some((pattern_base, pattern_trailer)) = expansion_key.split_once('*') { - // 2. If matchKey starts with but is not equal to patternBase, then - if match_key.starts_with(pattern_base) - // 1. Let patternTrailer be the substring of expansionKey from the index after the first "*" character. - && !pattern_trailer.contains('*') - // 2. If patternTrailer has zero length, or if matchKey ends with patternTrailer and the length of matchKey is greater than or equal to the length of expansionKey, then - && (pattern_trailer.is_empty() - || (match_key.len() >= expansion_key.len() - && match_key.ends_with(pattern_trailer))) - && Self::pattern_key_compare(best_key, expansion_key).is_gt() - { - // 1. Let target be the value of matchObj[expansionKey]. - best_target = Some(target); - // 2. Let patternMatch be the substring of matchKey starting at the index of the length of patternBase up to the length of matchKey minus the length of patternTrailer. - best_match = - &match_key[pattern_base.len()..match_key.len() - pattern_trailer.len()]; - best_key = expansion_key; - } - } else if expansion_key.ends_with('/') - && match_key.starts_with(expansion_key) - && Self::pattern_key_compare(best_key, expansion_key).is_gt() - { - // TODO: [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./dist/" in the "exports" field module resolution of the package at xxx/package.json. - best_target = Some(target); - best_match = &match_key[expansion_key.len()..]; - best_key = expansion_key; - } - } - } - if let Some(best_target) = best_target { - // 3. Return the result of PACKAGE_TARGET_RESOLVE(packageURL, target, patternMatch, isImports, conditions). - return self.package_target_resolve( - package_url, - best_key, - best_target, - Some(best_match), - is_imports, - conditions, - ctx, - ); - } - // 4. Return null. - Ok(None) - } - - /// PACKAGE_TARGET_RESOLVE(packageURL, target, patternMatch, isImports, conditions) - #[allow(clippy::too_many_arguments)] - fn package_target_resolve( - &self, - package_url: &Path, - target_key: &str, - target: &JSONValue, - pattern_match: Option<&str>, - is_imports: bool, - conditions: &[String], - ctx: &mut Ctx, - ) -> ResolveResult { - fn normalize_string_target<'a>( - target_key: &'a str, - target: &'a str, - pattern_match: Option<&'a str>, - package_url: &Path, - ) -> Result, ResolveError> { - let target = if let Some(pattern_match) = pattern_match { - if !target_key.contains('*') && !target.contains('*') { - // enhanced-resolve behaviour - // TODO: [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./dist/" in the "exports" field module resolution of the package at xxx/package.json. - if target_key.ends_with('/') && target.ends_with('/') { - Cow::Owned(format!("{target}{pattern_match}")) - } else { - return Err(ResolveError::InvalidPackageConfigDirectory( - package_url.join("package.json"), - )); - } - } else { - Cow::Owned(target.replace('*', pattern_match)) - } - } else { - Cow::Borrowed(target) - }; - Ok(target) - } - - match target { - // 1. If target is a String, then - JSONValue::String(target) => { - // 1. If target does not start with "./", then - if !target.starts_with("./") { - // 1. If isImports is false, or if target starts with "../" or "/", or if target is a valid URL, then - if !is_imports || target.starts_with("../") || target.starts_with('/') { - // 1. Throw an Invalid Package Target error. - return Err(ResolveError::InvalidPackageTarget( - target.to_string(), - target_key.to_string(), - package_url.join("package.json"), - )); - } - // 2. If patternMatch is a String, then - // 1. Return PACKAGE_RESOLVE(target with every instance of "*" replaced by patternMatch, packageURL + "/"). - let target = - normalize_string_target(target_key, target, pattern_match, package_url)?; - let package_url = self.cache.value(package_url); - // // 3. Return PACKAGE_RESOLVE(target, packageURL + "/"). - return self.package_resolve(&package_url, &target, ctx); - } - - // 2. If target split on "/" or "\" contains any "", ".", "..", or "node_modules" segments after the first "." segment, case insensitive and including percent encoded variants, throw an Invalid Package Target error. - // 3. Let resolvedTarget be the URL resolution of the concatenation of packageURL and target. - // 4. Assert: resolvedTarget is contained in packageURL. - // 5. If patternMatch is null, then - let target = - normalize_string_target(target_key, target, pattern_match, package_url)?; - if Path::new(target.as_ref()).is_invalid_exports_target() { - return Err(ResolveError::InvalidPackageTarget( - target.to_string(), - target_key.to_string(), - package_url.join("package.json"), - )); - } - let resolved_target = package_url.normalize_with(target.as_ref()); - // 6. If patternMatch split on "/" or "\" contains any "", ".", "..", or "node_modules" segments, case insensitive and including percent encoded variants, throw an Invalid Module Specifier error. - // 7. Return the URL resolution of resolvedTarget with every instance of "*" replaced with patternMatch. - let value = self.cache.value(&resolved_target); - return Ok(Some(value)); - } - // 2. Otherwise, if target is a non-null Object, then - JSONValue::Object(target) => { - // 1. If exports contains any index property keys, as defined in ECMA-262 6.1.7 Array Index, throw an Invalid Package Configuration error. - // 2. For each property p of target, in object insertion order as, - for (key, target_value) in target { - // 1. If p equals "default" or conditions contains an entry for p, then - if key == "default" || conditions.contains(key) { - // 1. Let targetValue be the value of the p property in target. - // 2. Let resolved be the result of PACKAGE_TARGET_RESOLVE( packageURL, targetValue, patternMatch, isImports, conditions). - let resolved = self.package_target_resolve( - package_url, - target_key, - target_value, - pattern_match, - is_imports, - conditions, - ctx, - ); - // 3. If resolved is equal to undefined, continue the loop. - if let Some(path) = resolved? { - // 4. Return resolved. - return Ok(Some(path)); - } - } - } - // 3. Return undefined. - return Ok(None); - } - // 3. Otherwise, if target is an Array, then - JSONValue::Array(targets) => { - // 1. If _target.length is zero, return null. - if targets.is_empty() { - // Note: return PackagePathNotExported has the same effect as return because there are no matches. - return Err(ResolveError::PackagePathNotExported( - pattern_match.unwrap_or(".").to_string(), - package_url.join("package.json"), - )); - } - // 2. For each item targetValue in target, do - for (i, target_value) in targets.iter().enumerate() { - // 1. Let resolved be the result of PACKAGE_TARGET_RESOLVE( packageURL, targetValue, patternMatch, isImports, conditions), continuing the loop on any Invalid Package Target error. - let resolved = self.package_target_resolve( - package_url, - target_key, - target_value, - pattern_match, - is_imports, - conditions, - ctx, - ); - - if resolved.is_err() && i == targets.len() { - return resolved; - } - - // 2. If resolved is undefined, continue the loop. - if let Ok(Some(path)) = resolved { - // 3. Return resolved. - return Ok(Some(path)); - } - } - // 3. Return or throw the last fallback resolution null return or error. - // Note: see `resolved.is_err() && i == targets.len()` - } - _ => {} - } - // 4. Otherwise, if target is null, return null. - Ok(None) - // 5. Otherwise throw an Invalid Package Target error. - } - - // Returns (module, subpath) - // https://github.com/nodejs/node/blob/8f0f17e1e3b6c4e58ce748e06343c5304062c491/lib/internal/modules/esm/resolve.js#L688 - fn parse_package_specifier(specifier: &str) -> (&str, &str) { - let mut separator_index = specifier.as_bytes().iter().position(|b| *b == b'/'); - // let mut valid_package_name = true; - // let mut is_scoped = false; - if specifier.starts_with('@') { - // is_scoped = true; - if separator_index.is_none() || specifier.is_empty() { - // valid_package_name = false; - } else if let Some(index) = &separator_index { - separator_index = specifier[*index + 1..] - .as_bytes() - .iter() - .position(|b| *b == b'/') - .map(|i| i + *index + 1); - } - } - let package_name = - separator_index.map_or(specifier, |separator_index| &specifier[..separator_index]); - - // TODO: https://github.com/nodejs/node/blob/8f0f17e1e3b6c4e58ce748e06343c5304062c491/lib/internal/modules/esm/resolve.js#L705C1-L714C1 - // Package name cannot have leading . and cannot have percent-encoding or - // \\ separators. - // if (RegExpPrototypeExec(invalidPackageNameRegEx, packageName) !== null) - // validPackageName = false; - - // if (!validPackageName) { - // throw new ERR_INVALID_MODULE_SPECIFIER( - // specifier, 'is not a valid package name', fileURLToPath(base)); - // } - let package_subpath = - separator_index.map_or("", |separator_index| &specifier[separator_index..]); - (package_name, package_subpath) - } - - /// PATTERN_KEY_COMPARE(keyA, keyB) - fn pattern_key_compare(key_a: &str, key_b: &str) -> Ordering { - if key_a.is_empty() { - return Ordering::Greater; - } - // 1. Assert: keyA ends with "/" or contains only a single "*". - debug_assert!(key_a.ends_with('/') || key_a.match_indices('*').count() == 1, "{key_a}"); - // 2. Assert: keyB ends with "/" or contains only a single "*". - debug_assert!(key_b.ends_with('/') || key_b.match_indices('*').count() == 1, "{key_b}"); - // 3. Let baseLengthA be the index of "*" in keyA plus one, if keyA contains "*", or the length of keyA otherwise. - let a_pos = key_a.chars().position(|c| c == '*'); - let base_length_a = a_pos.map_or(key_a.len(), |p| p + 1); - // 4. Let baseLengthB be the index of "*" in keyB plus one, if keyB contains "*", or the length of keyB otherwise. - let b_pos = key_b.chars().position(|c| c == '*'); - let base_length_b = b_pos.map_or(key_b.len(), |p| p + 1); - // 5. If baseLengthA is greater than baseLengthB, return -1. - if base_length_a > base_length_b { - return Ordering::Less; - } - // 6. If baseLengthB is greater than baseLengthA, return 1. - if base_length_b > base_length_a { - return Ordering::Greater; - } - // 7. If keyA does not contain "*", return 1. - if !key_a.contains('*') { - return Ordering::Greater; - } - // 8. If keyB does not contain "*", return -1. - if !key_b.contains('*') { - return Ordering::Less; - } - // 9. If the length of keyA is greater than the length of keyB, return -1. - if key_a.len() > key_b.len() { - return Ordering::Less; - } - // 10. If the length of keyB is greater than the length of keyA, return 1. - if key_b.len() > key_a.len() { - return Ordering::Greater; - } - // 11. Return 0. - Ordering::Equal - } - - fn strip_package_name<'a>(specifier: &'a str, package_name: &'a str) -> Option<&'a str> { - specifier - .strip_prefix(package_name) - .filter(|tail| tail.is_empty() || tail.starts_with(SLASH_START)) - } -} diff --git a/src/options.rs b/src/options.rs deleted file mode 100644 index 7893890e..00000000 --- a/src/options.rs +++ /dev/null @@ -1,633 +0,0 @@ -use std::path::Path; -use std::{fmt, path::PathBuf}; - -/// Module Resolution Options -/// -/// Options are directly ported from [enhanced-resolve](https://github.com/webpack/enhanced-resolve#resolver-options). -/// -/// See [webpack resolve](https://webpack.js.org/configuration/resolve/) for information and examples -#[derive(Debug, Clone)] -pub struct ResolveOptions { - /// Path to TypeScript configuration file. - /// - /// Default `None` - pub tsconfig: Option, - - /// Create aliases to import or require certain modules more easily. - /// - /// An alias is used to replace a whole path or part of a path. - /// For example, to alias a commonly used `src/` folders: `vec![("@/src"), vec![AliasValue::Path("/path/to/src")]]` - /// - /// A trailing $ can also be added to the given object's keys to signify an exact match. - /// - /// See [webpack's `resolve.alias` documentation](https://webpack.js.org/configuration/resolve/#resolvealias) for a list of use cases. - pub alias: Alias, - - /// A list of alias fields in description files. - /// - /// Specify a field, such as `browser`, to be parsed according to [this specification](https://github.com/defunctzombie/package-browser-field-spec). - /// Can be a path to json object such as `["path", "to", "exports"]`. - /// - /// Default `[]` - pub alias_fields: Vec>, - - /// Condition names for exports field which defines entry points of a package. - /// - /// The key order in the exports field is significant. During condition matching, earlier entries have higher priority and take precedence over later entries. - /// - /// Default `[]` - pub condition_names: Vec, - - /// The JSON files to use for descriptions. (There was once a `bower.json`.) - /// - /// Default `["package.json"]` - pub description_files: Vec, - - /// Set to [EnforceExtension::Enabled] for [ESM Mandatory file extensions](https://nodejs.org/api/esm.html#mandatory-file-extensions). - /// - /// If `enforce_extension` is set to [EnforceExtension::Enabled], resolution will not allow extension-less files. - /// This means `require('./foo.js')` will resolve, while `require('./foo')` will not. - /// - /// The default value for `enforce_extension` is [EnforceExtension::Auto], which is changed upon initialization. - /// - /// It changes to [EnforceExtension::Enabled] if [ResolveOptions::extensions] contains an empty string; - /// otherwise, this value changes to [EnforceExtension::Disabled]. - /// - /// Explicitly set the value to [EnforceExtension::Disabled] to disable this automatic behavior. - /// - /// For reference, this behavior is aligned with `enhanced-resolve`. See . - pub enforce_extension: EnforceExtension, - - /// A list of exports fields in description files. - /// - /// Can be a path to a JSON object such as `["path", "to", "exports"]`. - /// - /// Default `[["exports"]]`. - pub exports_fields: Vec>, - - /// Fields from `package.json` which are used to provide the internal requests of a package - /// (requests starting with # are considered internal). - /// - /// Can be a path to a JSON object such as `["path", "to", "imports"]`. - /// - /// Default `[["imports"]]`. - pub imports_fields: Vec>, - - /// An object which maps extension to extension aliases. - /// - /// Default `{}` - pub extension_alias: Vec<(String, Vec)>, - - /// Attempt to resolve these extensions in order. - /// - /// If multiple files share the same name but have different extensions, - /// will resolve the one with the extension listed first in the array and skip the rest. - /// - /// All extensions must have a leading dot. - /// - /// Default `[".js", ".json", ".node"]` - pub extensions: Vec, - - /// Redirect module requests when normal resolving fails. - /// - /// Default `[]` - pub fallback: Alias, - - /// 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). - /// - /// See also webpack configuration [resolve.fullySpecified](https://webpack.js.org/configuration/module/#resolvefullyspecified) - /// - /// Default `false` - pub fully_specified: bool, - - /// A list of main fields in description files - /// - /// Default `["main"]`. - pub main_fields: Vec, - - /// The filename to be used while resolving directories. - /// - /// Default `["index"]` - pub main_files: Vec, - - /// A list of directories to resolve modules from, can be absolute path or folder name. - /// - /// Default `["node_modules"]` - pub modules: Vec, - - /// A manifest loaded from pnp::load_pnp_manifest. - /// - /// Default `None` - #[cfg(feature = "yarn_pnp")] - pub pnp_manifest: Option, - - /// Resolve to a context instead of a file. - /// - /// Default `false` - pub resolve_to_context: bool, - - /// Prefer to resolve module requests as relative requests instead of using modules from node_modules directories. - /// - /// Default `false` - pub prefer_relative: bool, - - /// Prefer to resolve server-relative urls as absolute paths before falling back to resolve in ResolveOptions::roots. - /// - /// Default `false` - pub prefer_absolute: bool, - - /// A list of resolve restrictions to restrict the paths that a request can be resolved on. - /// - /// Default `[]` - pub restrictions: Vec, - - /// A list of directories where requests of server-relative URLs (starting with '/') are resolved. - /// On non-Windows systems these requests are resolved as an absolute path first. - /// - /// Default `[]` - pub roots: Vec, - - /// Whether to resolve symlinks to their symlinked location. - /// When enabled, symlinked resources are resolved to their real path, not their symlinked location. - /// Note that this may cause module resolution to fail when using tools that symlink packages (like npm link). - /// - /// Default `true` - pub symlinks: bool, - - /// Whether to parse [module.builtinModules](https://nodejs.org/api/module.html#modulebuiltinmodules) or not. - /// For example, "zlib" will throw [crate::ResolveError::Builtin] when set to true. - /// - /// Default `false` - pub builtin_modules: bool, -} - -impl ResolveOptions { - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// - /// let options = ResolveOptions::default().with_condition_names(&["bar"]); - /// assert_eq!(options.condition_names, vec!["bar".to_string()]) - /// ``` - #[must_use] - pub fn with_condition_names(mut self, names: &[&str]) -> Self { - self.condition_names = names.iter().map(ToString::to_string).collect::>(); - self - } - - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// - /// let options = ResolveOptions::default().with_builtin_modules(false); - /// assert_eq!(options.builtin_modules, false) - /// ``` - #[must_use] - pub fn with_builtin_modules(mut self, flag: bool) -> Self { - self.builtin_modules = flag; - self - } - - /// Adds a single root to the options - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_root("foo"); - /// assert_eq!(options.roots, vec![PathBuf::from("foo")]) - /// ``` - #[must_use] - pub fn with_root>(mut self, root: P) -> Self { - self.roots.push(root.as_ref().to_path_buf()); - self - } - - /// Adds a single extension to the list of extensions - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_extension("jsonc"); - /// assert!(options.extensions.contains(&"jsonc".to_string())); - /// ``` - #[must_use] - pub fn with_extension>(mut self, extension: S) -> Self { - self.extensions.push(extension.into()); - self - } - - /// Adds a single main field to the list of fields - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_main_field("something"); - /// assert!(options.main_fields.contains(&"something".to_string())); - /// ``` - #[must_use] - pub fn with_main_field>(mut self, field: S) -> Self { - self.main_fields.push(field.into()); - self - } - - /// Changes how the extension should be treated - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions, EnforceExtension}; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_force_extension(EnforceExtension::Enabled); - /// assert_eq!(options.enforce_extension, EnforceExtension::Enabled); - /// ``` - #[must_use] - pub fn with_force_extension(mut self, enforce_extension: EnforceExtension) -> Self { - self.enforce_extension = enforce_extension; - self - } - - /// Sets the value for [ResolveOptions::fully_specified] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_fully_specified(true); - /// assert_eq!(options.fully_specified, true); - /// ``` - #[must_use] - pub fn with_fully_specified(mut self, fully_specified: bool) -> Self { - self.fully_specified = fully_specified; - self - } - /// Sets the value for [ResolveOptions::prefer_relative] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_prefer_relative(true); - /// assert_eq!(options.prefer_relative, true); - /// ``` - #[must_use] - pub fn with_prefer_relative(mut self, flag: bool) -> Self { - self.prefer_relative = flag; - self - } - /// Sets the value for [ResolveOptions::prefer_absolute] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_prefer_absolute(true); - /// assert_eq!(options.prefer_absolute, true); - /// ``` - #[must_use] - pub fn with_prefer_absolute(mut self, flag: bool) -> Self { - self.prefer_absolute = flag; - self - } - - /// Changes the value of [ResolveOptions::symlinks] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// - /// let options = ResolveOptions::default().with_symbolic_link(false); - /// assert_eq!(options.symlinks, false); - /// ``` - #[must_use] - pub fn with_symbolic_link(mut self, flag: bool) -> Self { - self.symlinks = flag; - self - } - - /// Adds a module to [ResolveOptions::modules] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// - /// let options = ResolveOptions::default().with_module("module"); - /// assert!(options.modules.contains(&"module".to_string())); - /// ``` - #[must_use] - pub fn with_module>(mut self, module: M) -> Self { - self.modules.push(module.into()); - self - } - - /// Adds a main file to [ResolveOptions::main_files] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// - /// let options = ResolveOptions::default().with_main_file("foo"); - /// assert!(options.main_files.contains(&"foo".to_string())); - /// ``` - #[must_use] - pub fn with_main_file>(mut self, module: M) -> Self { - self.main_files.push(module.into()); - self - } - - pub(crate) fn sanitize(mut self) -> Self { - debug_assert!( - self.extensions.iter().filter(|e| !e.is_empty()).all(|e| e.starts_with('.')), - "All extensions must start with a leading dot" - ); - // Set `enforceExtension` to `true` when [ResolveOptions::extensions] contains an empty string. - // See - if self.enforce_extension == EnforceExtension::Auto { - if !self.extensions.is_empty() && self.extensions.iter().any(String::is_empty) { - self.enforce_extension = EnforceExtension::Enabled; - } else { - self.enforce_extension = EnforceExtension::Disabled; - } - } - self - } -} - -/// Value for [ResolveOptions::enforce_extension] -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -pub enum EnforceExtension { - Auto, - Enabled, - Disabled, -} - -impl EnforceExtension { - pub const fn is_auto(&self) -> bool { - matches!(self, Self::Auto) - } - - pub const fn is_enabled(&self) -> bool { - matches!(self, Self::Enabled) - } - - pub const fn is_disabled(&self) -> bool { - matches!(self, Self::Disabled) - } -} - -/// Alias for [ResolveOptions::alias] and [ResolveOptions::fallback] -pub type Alias = Vec<(String, Vec)>; - -/// Alias Value for [ResolveOptions::alias] and [ResolveOptions::fallback] -#[derive(Debug, Clone, Hash, PartialEq, Eq)] -pub enum AliasValue { - /// The path value - Path(String), - - /// The `false` value - Ignore, -} - -impl From for AliasValue -where - S: Into, -{ - fn from(value: S) -> Self { - Self::Path(value.into()) - } -} - -/// Value for [ResolveOptions::restrictions] -#[derive(Debug, Clone)] -pub enum Restriction { - Path(PathBuf), - RegExp(String), -} - -/// Tsconfig Options for [ResolveOptions::tsconfig] -/// -/// Derived from [tsconfig-paths-webpack-plugin](https://github.com/dividab/tsconfig-paths-webpack-plugin#options) -#[derive(Debug, Clone)] -pub struct TsconfigOptions { - /// Allows you to specify where to find the TypeScript configuration file. - /// You may provide - /// * a relative path to the configuration file. It will be resolved relative to cwd. - /// * an absolute path to the configuration file. - pub config_file: PathBuf, - - /// Support for Typescript Project References. - pub references: TsconfigReferences, -} - -/// Configuration for [TsconfigOptions::references] -#[derive(Debug, Clone)] -pub enum TsconfigReferences { - Disabled, - /// Use the `references` field from tsconfig of `config_file`. - Auto, - /// Manually provided relative or absolute path. - Paths(Vec), -} - -impl Default for ResolveOptions { - fn default() -> Self { - Self { - tsconfig: None, - alias: vec![], - alias_fields: vec![], - condition_names: vec![], - description_files: vec!["package.json".into()], - enforce_extension: EnforceExtension::Auto, - extension_alias: vec![], - exports_fields: vec![vec!["exports".into()]], - imports_fields: vec![vec!["imports".into()]], - extensions: vec![".js".into(), ".json".into(), ".node".into()], - fallback: vec![], - fully_specified: false, - main_fields: vec!["main".into()], - main_files: vec!["index".into()], - modules: vec!["node_modules".into()], - #[cfg(feature = "yarn_pnp")] - pnp_manifest: None, - resolve_to_context: false, - prefer_relative: false, - prefer_absolute: false, - restrictions: vec![], - roots: vec![], - symlinks: true, - builtin_modules: false, - } - } -} - -// For tracing -impl fmt::Display for ResolveOptions { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - if let Some(tsconfig) = &self.tsconfig { - write!(f, "tsconfig:{tsconfig:?},")?; - } - if !self.alias.is_empty() { - write!(f, "alias:{:?},", self.alias)?; - } - if !self.alias_fields.is_empty() { - write!(f, "alias_fields:{:?},", self.alias_fields)?; - } - if !self.condition_names.is_empty() { - write!(f, "condition_names:{:?},", self.condition_names)?; - } - if self.enforce_extension.is_enabled() { - write!(f, "enforce_extension:{:?},", self.enforce_extension)?; - } - if !self.exports_fields.is_empty() { - write!(f, "exports_fields:{:?},", self.exports_fields)?; - } - if !self.imports_fields.is_empty() { - write!(f, "imports_fields:{:?},", self.imports_fields)?; - } - if !self.extension_alias.is_empty() { - write!(f, "extension_alias:{:?},", self.extension_alias)?; - } - if !self.extensions.is_empty() { - write!(f, "extensions:{:?},", self.extensions)?; - } - if !self.fallback.is_empty() { - write!(f, "fallback:{:?},", self.fallback)?; - } - if self.fully_specified { - write!(f, "fully_specified:{:?},", self.fully_specified)?; - } - if !self.main_fields.is_empty() { - write!(f, "main_fields:{:?},", self.main_fields)?; - } - if !self.main_files.is_empty() { - write!(f, "main_files:{:?},", self.main_files)?; - } - if !self.modules.is_empty() { - write!(f, "modules:{:?},", self.modules)?; - } - if self.resolve_to_context { - write!(f, "resolve_to_context:{:?},", self.resolve_to_context)?; - } - if self.prefer_relative { - write!(f, "prefer_relative:{:?},", self.prefer_relative)?; - } - if self.prefer_absolute { - write!(f, "prefer_absolute:{:?},", self.prefer_absolute)?; - } - if !self.restrictions.is_empty() { - write!(f, "restrictions:{:?},", self.restrictions)?; - } - if !self.roots.is_empty() { - write!(f, "roots:{:?},", self.roots)?; - } - if self.symlinks { - write!(f, "symlinks:{:?},", self.symlinks)?; - } - if self.builtin_modules { - write!(f, "builtin_modules:{:?},", self.builtin_modules)?; - } - Ok(()) - } -} - -#[cfg(test)] -mod test { - use super::{ - AliasValue, EnforceExtension, ResolveOptions, Restriction, TsconfigOptions, - TsconfigReferences, - }; - use std::path::PathBuf; - - #[test] - fn enforce_extension() { - assert!(EnforceExtension::Auto.is_auto()); - assert!(!EnforceExtension::Enabled.is_auto()); - assert!(!EnforceExtension::Disabled.is_auto()); - - assert!(!EnforceExtension::Auto.is_enabled()); - assert!(EnforceExtension::Enabled.is_enabled()); - assert!(!EnforceExtension::Disabled.is_enabled()); - - assert!(!EnforceExtension::Auto.is_disabled()); - assert!(!EnforceExtension::Enabled.is_disabled()); - assert!(EnforceExtension::Disabled.is_disabled()); - } - - #[test] - fn display() { - let options = ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: PathBuf::from("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - alias: vec![("a".into(), vec![AliasValue::Ignore])], - alias_fields: vec![vec!["browser".into()]], - condition_names: vec!["require".into()], - enforce_extension: EnforceExtension::Enabled, - extension_alias: vec![(".js".into(), vec![".ts".into()])], - exports_fields: vec![vec!["exports".into()]], - imports_fields: vec![vec!["imports".into()]], - fallback: vec![("fallback".into(), vec![AliasValue::Ignore])], - fully_specified: true, - resolve_to_context: true, - prefer_relative: true, - prefer_absolute: true, - restrictions: vec![Restriction::Path(PathBuf::from("restrictions"))], - roots: vec![PathBuf::from("roots")], - builtin_modules: true, - ..ResolveOptions::default() - }; - - let expected = r#"tsconfig:TsconfigOptions { config_file: "tsconfig.json", references: Auto },alias:[("a", [Ignore])],alias_fields:[["browser"]],condition_names:["require"],enforce_extension:Enabled,exports_fields:[["exports"]],imports_fields:[["imports"]],extension_alias:[(".js", [".ts"])],extensions:[".js", ".json", ".node"],fallback:[("fallback", [Ignore])],fully_specified:true,main_fields:["main"],main_files:["index"],modules:["node_modules"],resolve_to_context:true,prefer_relative:true,prefer_absolute:true,restrictions:[Path("restrictions")],roots:["roots"],symlinks:true,builtin_modules:true,"#; - assert_eq!(format!("{options}"), expected); - - let options = ResolveOptions { - alias: vec![], - alias_fields: vec![], - builtin_modules: false, - condition_names: vec![], - description_files: vec![], - enforce_extension: EnforceExtension::Disabled, - exports_fields: vec![], - extension_alias: vec![], - extensions: vec![], - fallback: vec![], - fully_specified: false, - imports_fields: vec![], - main_fields: vec![], - main_files: vec![], - modules: vec![], - #[cfg(feature = "yarn_pnp")] - pnp_manifest: None, - prefer_absolute: false, - prefer_relative: false, - resolve_to_context: false, - restrictions: vec![], - roots: vec![], - symlinks: false, - tsconfig: None, - }; - - assert_eq!(format!("{options}"), ""); - } -} diff --git a/src/package_json.rs b/src/package_json.rs deleted file mode 100644 index 7e05d202..00000000 --- a/src/package_json.rs +++ /dev/null @@ -1,219 +0,0 @@ -//! package.json definitions -//! -//! Code related to export field are copied from [Parcel's resolver](https://github.com/parcel-bundler/parcel/blob/v2/packages/utils/node-resolver-rs/src/package_json.rs) -use std::path::{Path, PathBuf}; - -use serde_json::Value as JSONValue; - -use crate::{path::PathUtil, ResolveError}; - -pub type JSONMap = serde_json::Map; - -/// Deserialized package.json -#[derive(Debug, Default)] -pub struct PackageJson { - /// Path to `package.json`. Contains the `package.json` filename. - pub path: PathBuf, - - /// Realpath to `package.json`. Contains the `package.json` filename. - pub realpath: PathBuf, - - /// The "name" field defines your package's name. - /// The "name" field can be used in addition to the "exports" field to self-reference a package using its name. - /// - /// - pub name: Option, - - /// The "type" field. - /// - /// - pub r#type: Option, - - /// The "sideEffects" field. - /// - /// - pub side_effects: Option, - - raw_json: std::sync::Arc, -} - -impl PackageJson { - /// # Panics - /// # Errors - pub(crate) fn parse( - path: PathBuf, - realpath: PathBuf, - json: &str, - ) -> Result { - let mut raw_json: JSONValue = serde_json::from_str(json)?; - let mut package_json = Self::default(); - - if let Some(json_object) = raw_json.as_object_mut() { - // Remove large fields that are useless for pragmatic use. - #[cfg(feature = "package_json_raw_json_api")] - { - json_object.remove("description"); - json_object.remove("keywords"); - json_object.remove("scripts"); - json_object.remove("dependencies"); - json_object.remove("devDependencies"); - json_object.remove("peerDependencies"); - json_object.remove("optionalDependencies"); - } - - // Add name, type and sideEffects. - package_json.name = - json_object.get("name").and_then(|field| field.as_str()).map(ToString::to_string); - package_json.r#type = json_object.get("type").cloned(); - package_json.side_effects = json_object.get("sideEffects").cloned(); - } - - package_json.path = path; - package_json.realpath = realpath; - package_json.raw_json = std::sync::Arc::new(raw_json); - Ok(package_json) - } - - fn get_value_by_path<'a>( - fields: &'a serde_json::Map, - path: &[String], - ) -> Option<&'a JSONValue> { - if path.is_empty() { - return None; - } - let mut value = fields.get(&path[0])?; - for key in path.iter().skip(1) { - if let Some(inner_value) = value.as_object().and_then(|o| o.get(key)) { - value = inner_value; - } else { - return None; - } - } - Some(value) - } - - /// Raw serde json value of `package.json`. - /// - /// This is currently used in Rspack for: - /// * getting the `sideEffects` field - /// * query in - search on GitHub indicates query on the `type` field. - /// - /// To reduce overall memory consumption, large fields that useless for pragmatic use are removed. - /// They are: `description`, `keywords`, `scripts`, - /// `dependencies` and `devDependencies`, `peerDependencies`, `optionalDependencies`. - #[cfg(feature = "package_json_raw_json_api")] - pub fn raw_json(&self) -> &std::sync::Arc { - &self.raw_json - } - - /// Directory to `package.json` - /// - /// # Panics - /// - /// * When the package.json path is misconfigured. - pub fn directory(&self) -> &Path { - debug_assert!(self.realpath.file_name().is_some_and(|x| x == "package.json")); - self.realpath.parent().unwrap() - } - - /// The "main" field defines the entry point of a package when imported by name via a node_modules lookup. Its value is a path. - /// - /// When a package has an "exports" field, this will take precedence over the "main" field when importing the package by name. - /// - /// Values are dynamically retrieved from [ResolveOptions::main_fields]. - /// - /// - pub(crate) fn main_fields<'a>( - &'a self, - main_fields: &'a [String], - ) -> impl Iterator + '_ { - main_fields - .iter() - .filter_map(|main_field| self.raw_json.get(main_field)) - .filter_map(|value| value.as_str()) - } - - /// The "exports" field allows defining the entry points of a package when imported by name loaded either via a node_modules lookup or a self-reference to its own name. - /// - /// - pub(crate) fn exports_fields<'a>( - &'a self, - exports_fields: &'a [Vec], - ) -> impl Iterator + '_ { - exports_fields.iter().filter_map(|object_path| { - self.raw_json - .as_object() - .and_then(|json_object| Self::get_value_by_path(json_object, object_path)) - }) - } - - /// In addition to the "exports" field, there is a package "imports" field to create private mappings that only apply to import specifiers from within the package itself. - /// - /// - pub(crate) fn imports_fields<'a>( - &'a self, - imports_fields: &'a [Vec], - ) -> impl Iterator + '_ { - imports_fields.iter().filter_map(|object_path| { - self.raw_json - .as_object() - .and_then(|json_object| Self::get_value_by_path(json_object, object_path)) - .and_then(|value| value.as_object()) - }) - } - - /// The "browser" field is provided by a module author as a hint to javascript bundlers or component tools when packaging modules for client side use. - /// Multiple values are configured by [ResolveOptions::alias_fields]. - /// - /// - fn browser_fields<'a>( - &'a self, - alias_fields: &'a [Vec], - ) -> impl Iterator + '_ { - alias_fields.iter().filter_map(|object_path| { - self.raw_json - .as_object() - .and_then(|json_object| Self::get_value_by_path(json_object, object_path)) - // Only object is valid, all other types are invalid - // https://github.com/webpack/enhanced-resolve/blob/3a28f47788de794d9da4d1702a3a583d8422cd48/lib/AliasFieldPlugin.js#L44-L52 - .and_then(|value| value.as_object()) - }) - } - - /// Resolve the request string for this package.json by looking at the `browser` field. - /// - /// # Errors - /// - /// * Returns [ResolveError::Ignored] for `"path": false` in `browser` field. - pub(crate) fn resolve_browser_field<'a>( - &'a self, - path: &Path, - request: Option<&str>, - alias_fields: &'a [Vec], - ) -> Result, ResolveError> { - for object in self.browser_fields(alias_fields) { - if let Some(request) = request { - if let Some(value) = object.get(request) { - return Self::alias_value(path, value); - } - } else { - let dir = self.path.parent().unwrap(); - for (key, value) in object { - let joined = dir.normalize_with(key); - if joined == path { - return Self::alias_value(path, value); - } - } - } - } - Ok(None) - } - - fn alias_value<'a>(key: &Path, value: &'a JSONValue) -> Result, ResolveError> { - match value { - JSONValue::String(value) => Ok(Some(value.as_str())), - JSONValue::Bool(b) if !b => Err(ResolveError::Ignored(key.to_path_buf())), - _ => Ok(None), - } - } -} diff --git a/src/path.rs b/src/path.rs deleted file mode 100644 index f66fdd76..00000000 --- a/src/path.rs +++ /dev/null @@ -1,132 +0,0 @@ -//! Path Utilities -//! -//! Code adapted from the following libraries -//! * [path-absolutize](https://docs.rs/path-absolutize) -//! * [normalize_path](https://docs.rs/normalize-path) -use std::path::{Component, Path, PathBuf}; - -pub const SLASH_START: &[char; 2] = &['/', '\\']; - -/// Extension trait to add path normalization to std's [`Path`]. -pub trait PathUtil { - /// Normalize this path without performing I/O. - /// - /// All redundant separator and up-level references are collapsed. - /// - /// However, this does not resolve links. - fn normalize(&self) -> PathBuf; - - /// Normalize with subpath assuming this path is normalized without performing I/O. - /// - /// All redundant separator and up-level references are collapsed. - /// - /// However, this does not resolve links. - fn normalize_with>(&self, subpath: P) -> PathBuf; - - /// Defined in ESM PACKAGE_TARGET_RESOLVE - /// If target split on "/" or "\" contains any "", ".", "..", or "node_modules" segments after the first "." segment, case insensitive and including percent encoded variants - fn is_invalid_exports_target(&self) -> bool; -} - -impl PathUtil for Path { - // https://github.com/parcel-bundler/parcel/blob/e0b99c2a42e9109a9ecbd6f537844a1b33e7faf5/packages/utils/node-resolver-rs/src/path.rs#L7 - fn normalize(&self) -> PathBuf { - let mut components = self.components().peekable(); - let mut ret = if let Some(c @ Component::Prefix(..)) = components.peek() { - let buf = PathBuf::from(c.as_os_str()); - components.next(); - buf - } else { - PathBuf::new() - }; - - for component in components { - match component { - Component::Prefix(..) => unreachable!("Path {:?}", self), - Component::RootDir => { - ret.push(component.as_os_str()); - } - Component::CurDir => {} - Component::ParentDir => { - ret.pop(); - } - Component::Normal(c) => { - ret.push(c); - } - } - } - - ret - } - - // https://github.com/parcel-bundler/parcel/blob/e0b99c2a42e9109a9ecbd6f537844a1b33e7faf5/packages/utils/node-resolver-rs/src/path.rs#L37 - fn normalize_with>(&self, subpath: B) -> PathBuf { - let subpath = subpath.as_ref(); - - let mut components = subpath.components(); - - let Some(head) = components.next() else { return subpath.to_path_buf() }; - - if matches!(head, Component::Prefix(..) | Component::RootDir) { - return subpath.to_path_buf(); - } - - let mut ret = self.to_path_buf(); - for component in std::iter::once(head).chain(components) { - match component { - Component::CurDir => {} - Component::ParentDir => { - ret.pop(); - } - Component::Normal(c) => { - ret.push(c); - } - Component::Prefix(..) | Component::RootDir => { - unreachable!("Path {:?} Subpath {:?}", self, subpath) - } - } - } - - ret - } - - fn is_invalid_exports_target(&self) -> bool { - self.components().enumerate().any(|(index, c)| match c { - Component::ParentDir => true, - Component::CurDir => index > 0, - Component::Normal(c) => c.eq_ignore_ascii_case("node_modules"), - _ => false, - }) - } -} - -// https://github.com/webpack/enhanced-resolve/blob/main/test/path.test.js -#[test] -fn is_invalid_exports_target() { - let test_cases = [ - "../a.js", - "../", - "./a/b/../../../c.js", - "./a/b/../../../", - "./../../c.js", - "./../../", - "./a/../b/../../c.js", - "./a/../b/../../", - "./././../", - ]; - - for case in test_cases { - assert!(Path::new(case).is_invalid_exports_target(), "{case}"); - } - - assert!(!Path::new("C:").is_invalid_exports_target()); - assert!(!Path::new("/").is_invalid_exports_target()); -} - -#[test] -fn normalize() { - assert_eq!(Path::new("/foo/.././foo/").normalize(), Path::new("/foo")); - assert_eq!(Path::new("C://").normalize(), Path::new("C://")); - assert_eq!(Path::new("C:").normalize(), Path::new("C:")); - assert_eq!(Path::new(r"\\server\share").normalize(), Path::new(r"\\server\share")); -} diff --git a/src/resolution.rs b/src/resolution.rs deleted file mode 100644 index a3aaa2e7..00000000 --- a/src/resolution.rs +++ /dev/null @@ -1,92 +0,0 @@ -use crate::package_json::PackageJson; -use std::{ - fmt, - path::{Path, PathBuf}, - sync::Arc, -}; - -/// The final path resolution with optional `?query` and `#fragment` -#[derive(Clone)] -pub struct Resolution { - pub(crate) path: PathBuf, - - /// path query `?query`, contains `?`. - pub(crate) query: Option, - - /// path fragment `#query`, contains `#`. - pub(crate) fragment: Option, - - pub(crate) package_json: Option>, -} - -impl fmt::Debug for Resolution { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - f.debug_struct("Resolution") - .field("path", &self.path) - .field("query", &self.query) - .field("fragment", &self.fragment) - .field("package_json", &self.package_json.as_ref().map(|p| &p.path)) - .finish() - } -} - -impl PartialEq for Resolution { - fn eq(&self, other: &Self) -> bool { - self.path == other.path && self.query == other.query && self.fragment == other.fragment - } -} -impl Eq for Resolution {} - -impl Resolution { - /// Returns the path without query and fragment - pub fn path(&self) -> &Path { - &self.path - } - - /// Returns the path without query and fragment - pub fn into_path_buf(self) -> PathBuf { - self.path - } - - /// Returns the path query `?query`, contains the leading `?` - pub fn query(&self) -> Option<&str> { - self.query.as_deref() - } - - /// Returns the path fragment `#fragment`, contains the leading `#` - pub fn fragment(&self) -> Option<&str> { - self.fragment.as_deref() - } - - /// Returns serialized package_json - pub fn package_json(&self) -> Option<&Arc> { - self.package_json.as_ref() - } - - /// Returns the full path with query and fragment - pub fn full_path(&self) -> PathBuf { - let mut path = self.path.clone().into_os_string(); - if let Some(query) = &self.query { - path.push(query); - } - if let Some(fragment) = &self.fragment { - path.push(fragment); - } - PathBuf::from(path) - } -} - -#[test] -fn test() { - let resolution = Resolution { - path: PathBuf::from("foo"), - query: Some("?query".to_string()), - fragment: Some("#fragment".to_string()), - package_json: None, - }; - assert_eq!(resolution.path(), Path::new("foo")); - assert_eq!(resolution.query(), Some("?query")); - assert_eq!(resolution.fragment(), Some("#fragment")); - assert_eq!(resolution.full_path(), PathBuf::from("foo?query#fragment")); - assert_eq!(resolution.into_path_buf(), PathBuf::from("foo")); -} diff --git a/src/specifier.rs b/src/specifier.rs deleted file mode 100644 index 73ed038c..00000000 --- a/src/specifier.rs +++ /dev/null @@ -1,230 +0,0 @@ -use crate::error::SpecifierError; -use std::borrow::Cow; - -#[derive(Debug)] -pub struct Specifier<'a> { - path: Cow<'a, str>, - pub query: Option<&'a str>, - pub fragment: Option<&'a str>, -} - -impl<'a> Specifier<'a> { - pub fn path(&'a self) -> &'a str { - self.path.as_ref() - } - - pub fn parse(specifier: &'a str) -> Result { - if specifier.is_empty() { - return Err(SpecifierError::Empty(specifier.to_string())); - } - let offset = match specifier.as_bytes()[0] { - b'/' | b'.' | b'#' => 1, - _ => 0, - }; - let (path, query, fragment) = Self::parse_query_framgment(specifier, offset); - if path.is_empty() { - return Err(SpecifierError::Empty(specifier.to_string())); - } - Ok(Self { path, query, fragment }) - } - - fn parse_query_framgment( - specifier: &'a str, - skip: usize, - ) -> (Cow<'a, str>, Option<&str>, Option<&str>) { - let mut query_start: Option = None; - let mut fragment_start: Option = None; - - let mut prev = specifier.chars().next().unwrap(); - let mut escaped_indexes = vec![]; - for (i, c) in specifier.char_indices().skip(skip) { - if c == '?' && query_start.is_none() { - query_start = Some(i); - } - if c == '#' { - if prev == '\0' { - escaped_indexes.push(i - 1); - } else { - fragment_start = Some(i); - break; - } - } - prev = c; - } - - let (path, query, fragment) = match (query_start, fragment_start) { - (Some(i), Some(j)) => { - debug_assert!(i < j); - (&specifier[..i], Some(&specifier[i..j]), Some(&specifier[j..])) - } - (Some(i), None) => (&specifier[..i], Some(&specifier[i..]), None), - (None, Some(j)) => (&specifier[..j], None, Some(&specifier[j..])), - _ => (specifier, None, None), - }; - - let path = if escaped_indexes.is_empty() { - Cow::Borrowed(path) - } else { - // Remove the `\0` characters for a legal path. - Cow::Owned( - path.chars() - .enumerate() - .filter_map(|(i, c)| (!escaped_indexes.contains(&i)).then_some(c)) - .collect::(), - ) - }; - - (path, query, fragment) - } -} - -#[cfg(test)] -mod tests { - use super::{Specifier, SpecifierError}; - - #[test] - fn debug() { - let specifier = Specifier::parse("/").unwrap(); - assert_eq!( - format!("{specifier:?}"), - r#"Specifier { path: "/", query: None, fragment: None }"# - ); - } - - #[test] - fn empty() { - let specifiers = ["", "?"]; - for specifier in specifiers { - let error = Specifier::parse(specifier).unwrap_err(); - assert_eq!(error, SpecifierError::Empty(specifier.to_string())); - } - } - - #[test] - fn absolute() -> Result<(), SpecifierError> { - let specifier = "/test?#"; - let parsed = Specifier::parse(specifier)?; - assert_eq!(parsed.path, "/test"); - assert_eq!(parsed.query, Some("?")); - assert_eq!(parsed.fragment, Some("#")); - Ok(()) - } - - #[test] - fn relative() -> Result<(), SpecifierError> { - let specifiers = ["./test", "../test", "../../test"]; - for specifier in specifiers { - let mut r = specifier.to_string(); - r.push_str("?#"); - let parsed = Specifier::parse(&r)?; - assert_eq!(parsed.path, specifier); - assert_eq!(parsed.query, Some("?")); - assert_eq!(parsed.fragment, Some("#")); - } - Ok(()) - } - - #[test] - fn hash() -> Result<(), SpecifierError> { - let specifiers = ["#", "#path"]; - for specifier in specifiers { - let mut r = specifier.to_string(); - r.push_str("?#"); - let parsed = Specifier::parse(&r)?; - assert_eq!(parsed.path, specifier); - assert_eq!(parsed.query, Some("?")); - assert_eq!(parsed.fragment, Some("#")); - } - Ok(()) - } - - #[test] - fn module() -> Result<(), SpecifierError> { - let specifiers = ["module"]; - for specifier in specifiers { - let mut r = specifier.to_string(); - r.push_str("?#"); - let parsed = Specifier::parse(&r)?; - assert_eq!(parsed.path, specifier); - assert_eq!(parsed.query, Some("?")); - assert_eq!(parsed.fragment, Some("#")); - } - Ok(()) - } - - #[test] - fn query_fragment() -> Result<(), SpecifierError> { - let data = [ - ("a?", Some("?"), None), - ("a?query", Some("?query"), None), - ("a?query1?query2", Some("?query1?query2"), None), - ("a?query1?query2?query3", Some("?query1?query2?query3"), None), - ("a#", None, Some("#")), - ("a#b#c", None, Some("#b#c")), - ("a#fragment", None, Some("#fragment")), - ("a?#", Some("?"), Some("#")), - ("a?#fragment", Some("?"), Some("#fragment")), - ("a?query#", Some("?query"), Some("#")), - ("a?query#fragment", Some("?query"), Some("#fragment")), - ("a#fragment?", None, Some("#fragment?")), - ("a#fragment?query", None, Some("#fragment?query")), - ]; - - for (specifier_str, query, fragment) in data { - let specifier = Specifier::parse(specifier_str)?; - assert_eq!(specifier.path, "a", "{specifier_str}"); - assert_eq!(specifier.query, query, "{specifier_str}"); - assert_eq!(specifier.fragment, fragment, "{specifier_str}"); - } - - Ok(()) - } - - #[test] - // https://github.com/webpack/enhanced-resolve/blob/main/test/identifier.test.js - fn enhanced_resolve_edge_cases() -> Result<(), SpecifierError> { - let data = [ - ("path/#", "path/", "", "#"), - ("path/as/?", "path/as/", "?", ""), - ("path/#/?", "path/", "", "#/?"), - ("path/#repo#hash", "path/", "", "#repo#hash"), - ("path/#r#hash", "path/", "", "#r#hash"), - ("path/#repo/#repo2#hash", "path/", "", "#repo/#repo2#hash"), - ("path/#r/#r#hash", "path/", "", "#r/#r#hash"), - ("path/#/not/a/hash?not-a-query", "path/", "", "#/not/a/hash?not-a-query"), - ]; - - for (specifier_str, path, query, fragment) in data { - let specifier = Specifier::parse(specifier_str)?; - assert_eq!(specifier.path, path, "{specifier_str}"); - assert_eq!(specifier.query.unwrap_or(""), query, "{specifier_str}"); - assert_eq!(specifier.fragment.unwrap_or(""), fragment, "{specifier_str}"); - } - - Ok(()) - } - - // https://github.com/webpack/enhanced-resolve/blob/main/test/identifier.test.js - #[test] - fn enhanced_resolve_windows_like() -> Result<(), SpecifierError> { - let data = [ - ("path\\#", "path\\", "", "#"), - ("path\\as\\?", "path\\as\\", "?", ""), - ("path\\#\\?", "path\\", "", "#\\?"), - ("path\\#repo#hash", "path\\", "", "#repo#hash"), - ("path\\#r#hash", "path\\", "", "#r#hash"), - ("path\\#repo\\#repo2#hash", "path\\", "", "#repo\\#repo2#hash"), - ("path\\#r\\#r#hash", "path\\", "", "#r\\#r#hash"), - ("path\\#/not/a/hash?not-a-query", "path\\", "", "#/not/a/hash?not-a-query"), - ]; - - for (specifier_str, path, query, fragment) in data { - let specifier = Specifier::parse(specifier_str)?; - assert_eq!(specifier.path, path, "{specifier_str}"); - assert_eq!(specifier.query.unwrap_or(""), query, "{specifier_str}"); - assert_eq!(specifier.fragment.unwrap_or(""), fragment, "{specifier_str}"); - } - - Ok(()) - } -} diff --git a/src/tests/alias.rs b/src/tests/alias.rs deleted file mode 100644 index e5892066..00000000 --- a/src/tests/alias.rs +++ /dev/null @@ -1,283 +0,0 @@ -//! - -use normalize_path::NormalizePath; -use std::path::Path; - -use crate::{AliasValue, Resolution, ResolveContext, ResolveError, ResolveOptions, Resolver}; - -#[test] -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -fn alias() { - use super::memory_fs::MemoryFS; - use crate::ResolverGeneric; - use std::path::{Path, PathBuf}; - - let f = Path::new("/"); - - let file_system = MemoryFS::new(&[ - ("/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", ""), - ("/dashed-name", ""), - ]); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - alias: vec![ - ("aliasA".into(), vec![AliasValue::from("a")]), - ("b$".into(), vec![AliasValue::from("a/index")]), - ("c$".into(), vec![AliasValue::from("/a/index")]), - ( - "multiAlias".into(), - vec![ - AliasValue::from("b"), - AliasValue::from("c"), - AliasValue::from("d"), - AliasValue::from("e"), - AliasValue::from("a"), - ], - ), - ("recursive".into(), vec![AliasValue::from("recursive/dir")]), - ("/d/dir".into(), vec![AliasValue::from("/c/dir")]), - ("/d/index.js".into(), vec![AliasValue::from("/c/index")]), - ("#".into(), vec![AliasValue::from("/c/dir")]), - ("@".into(), vec![AliasValue::from("/c/dir")]), - ("ignored".into(), vec![AliasValue::Ignore]), - // not part of enhanced-resolve, added to make sure query in alias value works - ("alias_query".into(), vec![AliasValue::from("a?query_after")]), - ("alias_fragment".into(), vec![AliasValue::from("a#fragment_after")]), - ("dash".into(), vec![AliasValue::Ignore]), - ("@scope/package-name/file$".into(), vec![AliasValue::from("/c/dir")]), - ], - modules: vec!["/".into()], - ..ResolveOptions::default() - }, - ); - - #[rustfmt::skip] - let pass = [ - ("should resolve a not aliased module 1", "a", "/a/index"), - ("should resolve a not aliased module 2", "a/index", "/a/index"), - ("should resolve a not aliased module 3", "a/dir", "/a/dir/index"), - ("should resolve a not aliased module 4", "a/dir/index", "/a/dir/index"), - ("should resolve an aliased module 1", "aliasA", "/a/index"), - ("should resolve an aliased module 2", "aliasA/index", "/a/index"), - ("should resolve an aliased module 3", "aliasA/dir", "/a/dir/index"), - ("should resolve an aliased module 4", "aliasA/dir/index", "/a/dir/index"), - ("should resolve '#' alias 1", "#", "/c/dir/index"), - ("should resolve '#' alias 2", "#/index", "/c/dir/index"), - ("should resolve '@' alias 1", "@", "/c/dir/index"), - ("should resolve '@' alias 2", "@/index", "/c/dir/index"), - ("should resolve a recursive aliased module 1", "recursive", "/recursive/dir/index"), - ("should resolve a recursive aliased module 2", "recursive/index", "/recursive/dir/index"), - ("should resolve a recursive aliased module 3", "recursive/dir", "/recursive/dir/index"), - ("should resolve a recursive aliased module 4", "recursive/dir/index", "/recursive/dir/index"), - ("should resolve a file aliased module 1", "b", "/a/index"), - ("should resolve a file aliased module 2", "c", "/a/index"), - ("should resolve a file aliased module with a query 1", "b?query", "/a/index?query"), - ("should resolve a file aliased module with a query 2", "c?query", "/a/index?query"), - ("should resolve a path in a file aliased module 1", "b/index", "/b/index"), - ("should resolve a path in a file aliased module 2", "b/dir", "/b/dir/index"), - ("should resolve a path in a file aliased module 3", "b/dir/index", "/b/dir/index"), - ("should resolve a path in a file aliased module 4", "c/index", "/c/index"), - ("should resolve a path in a file aliased module 5", "c/dir", "/c/dir/index"), - ("should resolve a path in a file aliased module 6", "c/dir/index", "/c/dir/index"), - ("should resolve a file aliased file 1", "d", "/c/index"), - ("should resolve a file aliased file 2", "d/dir/index", "/c/dir/index"), - ("should resolve a file in multiple aliased dirs 1", "multiAlias/dir/file", "/e/dir/file"), - ("should resolve a file in multiple aliased dirs 2", "multiAlias/anotherDir", "/e/anotherDir/index"), - // not part of enhanced-resolve, added to make sure query in alias value works - ("should resolve query in alias value", "alias_query?query_before", "/a/index?query_after"), - ("should resolve query in alias value", "alias_fragment#fragment_before", "/a/index#fragment_after"), - ("should resolve dashed name", "dashed-name", "/dashed-name"), - ("should resolve scoped package name with sub dir", "@scope/package-name/file", "/c/dir/index"), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - - #[rustfmt::skip] - let ignore = [ - ("should resolve an ignore module", "ignored", ResolveError::Ignored(f.join("ignored"))) - ]; - - for (comment, request, expected) in ignore { - let resolution = resolver.resolve(f, request); - assert_eq!(resolution, Err(expected), "{comment} {request}"); - } -} - -// Not part of enhanced-resolve -#[test] -fn infinite_recursion() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![ - ("./a".into(), vec![AliasValue::from("./b")]), - ("./b".into(), vec![AliasValue::from("./a")]), - ], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(f, "./a"); - assert_eq!(resolution, Err(ResolveError::Recursion)); -} - -fn check_slash(path: &Path) { - let s = path.to_string_lossy().to_string(); - #[cfg(target_os = "windows")] - { - assert!(!s.contains('/'), "{s}"); - assert!(s.contains('\\'), "{s}"); - } - #[cfg(not(target_os = "windows"))] - { - assert!(s.contains('/'), "{s}"); - assert!(!s.contains('\\'), "{s}"); - } -} - -#[test] -fn absolute_path() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![(f.join("foo").to_str().unwrap().to_string(), vec![AliasValue::Ignore])], - modules: vec![f.clone().to_str().unwrap().to_string()], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(&f, "foo/index"); - assert_eq!(resolution, Err(ResolveError::Ignored(f.join("foo")))); -} - -#[test] -fn system_path() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![("@app".into(), vec![AliasValue::from(f.join("alias").to_string_lossy())])], - ..ResolveOptions::default() - }); - - let specifiers = ["@app/files/a", "@app/files/a.js"]; - - for specifier in specifiers { - let path = resolver.resolve(&f, specifier).map(Resolution::into_path_buf).unwrap(); - assert_eq!(path, f.join("alias/files/a.js")); - check_slash(&path); - } -} - -#[test] -fn alias_is_full_path() { - let f = super::fixture(); - let dir = f.join("foo"); - let dir_str = dir.to_string_lossy().to_string(); - - let resolver = Resolver::new(ResolveOptions { - alias: vec![("@".into(), vec![AliasValue::Path(dir_str.clone())])], - ..ResolveOptions::default() - }); - - let mut ctx = ResolveContext::default(); - - let specifiers = [ - "@/index".to_string(), - "@/index.js".to_string(), - // specifier has multiple `/` for reasons we'll never know - "@////index".to_string(), - // specifier is a full path - dir_str, - ]; - - for specifier in specifiers { - let resolution = resolver.resolve_with_context(&f, &specifier, &mut ctx); - assert_eq!(resolution.map(|r| r.full_path()), Ok(dir.join("index.js"))); - } - - for path in ctx.file_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - check_slash(&path); - } - - for path in ctx.missing_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - check_slash(&path); - if let Some(path) = path.parent() { - assert!(!path.is_file(), "{path:?} must not be a file"); - } - } -} - -// For the `should_stop` variable in `load_alias` -#[test] -fn all_alias_values_are_not_found() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![( - "m1".to_string(), - vec![AliasValue::Path(f.join("node_modules").join("m2").to_string_lossy().to_string())], - )], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(&f, "m1/a.js"); - assert_eq!( - resolution, - Err(ResolveError::MatchedAliasNotFound("m1/a.js".to_string(), "m1".to_string(),)) - ); -} - -#[test] -fn alias_fragment() { - let f = super::fixture(); - - let data = [ - // enhanced-resolve has `#` prepended with a `\0`, they are removed from the - // following 3 expected test results. - // See https://github.com/webpack/enhanced-resolve#escaping - ( - "handle fragment edge case (no fragment)", - "./no#fragment/#/#", - f.join("no#fragment/#/#.js"), - ), - ("handle fragment edge case (fragment)", "./no#fragment/#/", f.join("no.js#fragment/#/")), - ( - "handle fragment escaping", - "./no\0#fragment/\0#/\0##fragment", - f.join("no#fragment/#/#.js#fragment"), - ), - ]; - - for (comment, request, expected) in data { - let resolver = Resolver::new(ResolveOptions { - alias: vec![("foo".to_string(), vec![AliasValue::Path(request.to_string())])], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f, "foo").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } -} - -#[test] -fn alias_try_fragment_as_path() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![( - "#".to_string(), - vec![AliasValue::Path(f.join("#").to_string_lossy().to_string())], - )], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(&f, "#/a").map(|r| r.full_path()); - assert_eq!(resolution, Ok(f.join("#").join("a.js"))); -} diff --git a/src/tests/browser_field.rs b/src/tests/browser_field.rs deleted file mode 100644 index 171ee099..00000000 --- a/src/tests/browser_field.rs +++ /dev/null @@ -1,189 +0,0 @@ -//! - -use crate::{AliasValue, ResolveError, ResolveOptions, Resolver}; - -#[test] -fn ignore() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![ - vec!["browser".into()], - vec!["innerBrowser1".into()], - vec!["innerBrowser2".into()], - vec![], - ], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - (f.clone(), "./lib/ignore", f.join("lib/ignore.js")), - (f.clone(), "./lib/ignore.js", f.join("lib/ignore.js")), - (f.join("lib"), "./ignore", f.join("lib/ignore.js")), - (f.join("lib"), "./ignore.js", f.join("lib/ignore.js")), - ]; - - for (path, request, expected) in data { - let resolution = resolver.resolve(&path, request); - let expected = ResolveError::Ignored(expected); - assert_eq!(resolution, Err(expected), "{path:?} {request}"); - } -} - -#[test] -fn shared_resolvers() { - let f = super::fixture().join("browser-module"); - - let resolver1 = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["innerBrowser1".into(), "field".into(), "browser".into()]], - ..ResolveOptions::default() - }); - let resolved_path = resolver1.resolve(&f, "./lib/main1.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("lib/main.js"))); - - let resolver2 = resolver1.clone_with_options(ResolveOptions { - alias_fields: vec![vec!["innerBrowser2".into(), "browser".into()]], - ..ResolveOptions::default() - }); - let resolved_path = resolver2.resolve(&f, "./lib/main2.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("./lib/replaced.js"))); -} - -#[test] -fn replace_file() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![ - vec!["browser".into()], - vec!["innerBrowser1".into(), "field2".into(), "browser".into()], // not presented - vec!["innerBrowser1".into(), "field".into(), "browser".into()], - vec!["innerBrowser2".into(), "browser".into()], - ], - // Not part of enhanced-resolve. Added to make sure no interaction between these two fields. - main_fields: vec!["browser".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - ("should replace a file 1", f.clone(), "./lib/replaced", f.join("lib/browser.js")), - ("should replace a file 2", f.clone(), "./lib/replaced.js", f.join("lib/browser.js")), - ("should replace a file 3", f.join("lib"), "./replaced", f.join("lib/browser.js")), - ("should replace a file 4", f.join("lib"), "./replaced.js", f.join("lib/browser.js")), - ("should replace a module with a file 1", f.clone(), "module-a", f.join("browser/module-a.js")), - ("should replace a module with a file 2", f.join("lib"), "module-a", f.join("browser/module-a.js")), - ("should replace a module with a module 1", f.clone(), "module-b", f.join("node_modules/module-c.js")), - ("should replace a module with a module 2", f.join("lib"), "module-b", f.join("node_modules/module-c.js")), - ("should resolve in nested property 1", f.clone(), "./lib/main1.js", f.join("lib/main.js")), - ("should resolve in nested property 2", f.clone(), "./lib/main2.js", f.join("lib/browser.js")), - ("should check only alias field properties", f.clone(), "./toString", f.join("lib/toString.js")), - // not part of enhanced-resolve - ("recursion", f.clone(), "module-c", f.join("node_modules/module-c.js")), - ("resolve self 1", f.clone(), "./lib/main.js", f.join("lib/main.js")), - ("resolve self 2", f.clone(), "./main.js", f.join("lib/main.js")), - ]; - - for (comment, path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn recurse_fail() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - ("recurse non existent", f.clone(), "./lib/non-existent.js", ResolveError::NotFound("./lib/non-existent.js".into())), - ("path partial match 1", f.clone(), "./xyz.js", ResolveError::NotFound("./xyz.js".into())), - ("path partial match 2", f, "./lib/xyz.js", ResolveError::NotFound("./lib/xyz.js".into())), - ]; - - for (comment, path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Err(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn broken() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - // The browser field string value should be ignored - (f.clone(), "browser-module-broken", Ok(f.join("node_modules/browser-module-broken/main.js"))), - (f.join("browser-module"), "./number", Err(ResolveError::NotFound("./number".into()))), - ]; - - for (path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, expected, "{path:?} {request}"); - } -} - -#[test] -fn crypto_js() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - fallback: vec![( - "crypto".into(), - vec![AliasValue::from(f.join("lib.js").to_string_lossy())], - )], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(f.join("crypto-js"), "crypto").map(|r| r.full_path()); - assert_eq!(resolved_path, Err(ResolveError::Ignored(f.join("crypto-js")))); -} - -// https://github.com/webpack/webpack/blob/87660921808566ef3b8796f8df61bd79fc026108/test/cases/resolving/browser-field/index.js#L40-L43 -#[test] -fn recursive() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - let data = [ - ("should handle recursive file 1", f.clone(), "recursive-file/a"), - ("should handle recursive file 2", f.clone(), "recursive-file/b"), - ("should handle recursive file 3", f.clone(), "recursive-file/c"), - ("should handle recursive file 4", f, "recursive-file/d"), - ]; - - for (comment, path, request) in data { - let resolved_path = resolver.resolve(&path, request); - assert_eq!(resolved_path, Err(ResolveError::Recursion), "{comment} {path:?} {request}"); - } -} - -#[test] -fn with_query() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "./foo").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("lib").join("browser.js?query"))); -} diff --git a/src/tests/builtins.rs b/src/tests/builtins.rs deleted file mode 100644 index 5d6d14d9..00000000 --- a/src/tests/builtins.rs +++ /dev/null @@ -1,121 +0,0 @@ -use std::path::Path; - -use crate::{ResolveError, ResolveOptions, Resolver}; - -#[test] -fn builtins_off() { - let f = Path::new("/"); - let resolver = Resolver::default(); - let resolved_path = resolver.resolve(f, "zlib").map(|r| r.full_path()); - assert_eq!(resolved_path, Err(ResolveError::NotFound("zlib".into()))); -} - -#[test] -fn builtins() { - let f = Path::new("/"); - - let resolver = Resolver::new(ResolveOptions::default().with_builtin_modules(true)); - - let pass = [ - "_http_agent", - "_http_client", - "_http_common", - "_http_incoming", - "_http_outgoing", - "_http_server", - "_stream_duplex", - "_stream_passthrough", - "_stream_readable", - "_stream_transform", - "_stream_wrap", - "_stream_writable", - "_tls_common", - "_tls_wrap", - "assert", - "assert/strict", - "async_hooks", - "buffer", - "child_process", - "cluster", - "console", - "constants", - "crypto", - "dgram", - "diagnostics_channel", - "dns", - "dns/promises", - "domain", - "events", - "fs", - "fs/promises", - "http", - "http2", - "https", - "inspector", - "module", - "net", - "os", - "path", - "path/posix", - "path/win32", - "perf_hooks", - "process", - "punycode", - "querystring", - "readline", - "repl", - "stream", - "stream/consumers", - "stream/promises", - "stream/web", - "string_decoder", - "sys", - "timers", - "timers/promises", - "tls", - "trace_events", - "tty", - "url", - "util", - "util/types", - "v8", - "vm", - "worker_threads", - "zlib", - ]; - - for request in pass { - let prefixed_request = format!("node:{request}"); - for request in [prefixed_request.clone(), request.to_string()] { - let resolved_path = resolver.resolve(f, &request).map(|r| r.full_path()); - let err = ResolveError::Builtin(prefixed_request.clone()); - assert_eq!(resolved_path, Err(err), "{request}"); - } - } -} - -#[test] -fn fail() { - let f = Path::new("/"); - let resolver = Resolver::new(ResolveOptions::default().with_builtin_modules(true)); - let request = "xxx"; - let resolved_path = resolver.resolve(f, request); - let err = ResolveError::NotFound(request.to_string()); - assert_eq!(resolved_path, Err(err), "{request}"); -} - -#[test] -fn imports() { - let f = super::fixture().join("builtins"); - let resolver = Resolver::new(ResolveOptions { - builtin_modules: true, - condition_names: vec!["node".into()], - ..ResolveOptions::default() - }); - - for request in ["#fs", "#http"] { - let resolved_path = resolver.resolve(f.clone(), request).map(|r| r.full_path()); - let err = ResolveError::Builtin(format!("node:{}", request.trim_start_matches('#'))); - assert_eq!(resolved_path, Err(err)); - } -} diff --git a/src/tests/dependencies.rs b/src/tests/dependencies.rs deleted file mode 100644 index bcc2355b..00000000 --- a/src/tests/dependencies.rs +++ /dev/null @@ -1,110 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/dependencies.test.js - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows { - use rustc_hash::FxHashSet; - use std::path::PathBuf; - - use crate::{ResolveContext, ResolveOptions, ResolverGeneric}; - - use super::super::memory_fs::MemoryFS; - - fn file_system() -> MemoryFS { - MemoryFS::new(&[ - ("/a/b/node_modules/some-module/index.js", ""), - ("/a/node_modules/module/package.json", r#"{"main":"entry.js"}"#), - ("/a/node_modules/module/file.js", r#"{"main":"entry.js"}"#), - ("/modules/other-module/file.js", ""), - ]) - } - - #[test] - fn test() { - let file_system = file_system(); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - extensions: vec![".json".into(), ".js".into()], - modules: vec!["/modules".into(), "node_modules".into()], - ..ResolveOptions::default() - }, - ); - - let data = [ - ( - "middle module request", - "/a/b/c", - "module/file", - "/a/node_modules/module/file.js", - // These dependencies are different from enhanced-resolve due to different code path to - // querying the file system - vec![ - // 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", - // "/", - ], - vec![ - // missing package.jsons - // "/a/b/c/package.json", - "/a/b/package.json", - "/a/package.json", - "/package.json", - // missing modules directories - "/a/b/c", - // "/a/b/c/node_modules", - // missing single file modules - "/modules/module", - "/a/b/node_modules/module", - // missing files with alternative extensions - "/a/node_modules/module/file", - "/a/node_modules/module/file.json", - ], - ), - ( - "fast found module", - "/a/b/c", - "other-module/file.js", - "/modules/other-module/file.js", - // These dependencies are different from enhanced-resolve due to different code path to - // querying the file system - vec![ - // symlink checks - "/modules/other-module/file.js", - // "/modules/other-module", - // "/modules", - // "/", - ], - vec![ - // missing package.jsons - // "/a/b/c/package.json", - "/a/b/c", - "/a/b/package.json", - "/a/package.json", - "/package.json", - "/modules/other-module/package.json", - "/modules/package.json", - ], - ), - ]; - - for (name, context, request, result, file_dependencies, missing_dependencies) in data { - let mut ctx = ResolveContext::default(); - let path = PathBuf::from(context); - let resolved = - resolver.resolve_with_context(path, request, &mut ctx).map(|r| r.full_path()); - assert_eq!(resolved, Ok(PathBuf::from(result))); - let file_dependencies = - FxHashSet::from_iter(file_dependencies.iter().map(PathBuf::from)); - let missing_dependencies = - FxHashSet::from_iter(missing_dependencies.iter().map(PathBuf::from)); - assert_eq!(ctx.file_dependencies, file_dependencies, "{name}"); - assert_eq!(ctx.missing_dependencies, missing_dependencies, "{name}"); - } - } -} diff --git a/src/tests/exports_field.rs b/src/tests/exports_field.rs deleted file mode 100644 index 7ca73fbd..00000000 --- a/src/tests/exports_field.rs +++ /dev/null @@ -1,2546 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/exportsField.test.js -//! -//! The huge exports field test cases are at the bottom of this file. - -use crate::{Ctx, PathUtil, ResolveError, ResolveOptions, Resolver}; -use serde_json::json; -use std::path::Path; - -#[test] -fn test_simple() { - let f = super::fixture().join("exports-field"); - let f2 = super::fixture().join("exports-field2"); - let f4 = super::fixture().join("exports-field-error"); - let f5 = super::fixture().join("imports-exports-wildcard"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - fully_specified: true, - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("resolve root using exports field, not a main field", f.clone(), "exports-field", f.join("node_modules/exports-field/x.js")), - ("resolver should respect condition names", f.clone(), "exports-field/dist/main.js", f.join("node_modules/exports-field/lib/lib2/main.js")), - // enhanced_resolve behaves differently to node.js. enhanced_resolve fallbacks when an - // array item is unresolved, where as node.js fallbacks when an array has an - // InvalidPackageTarget error. - // ("resolver should respect fallback", f2.clone(), "exports-field/dist/browser.js", f2.join("node_modules/exports-field/lib/browser.js")), - // The following two tests require fallback from array values, the path is changed here to - // only test query and fragment. - ("resolver should respect query parameters #1", f2.clone(), "exports-field/dist/main.js?foo", f2.join("node_modules/exports-field/lib/lib2/main.js?foo")), - ("resolver should respect fragment parameters #1", f2.clone(), "exports-field/dist/main.js#foo", f2.join("node_modules/exports-field/lib/lib2/main.js#foo")), - ("relative path should work, if relative path as request is used", f.clone(), "./node_modules/exports-field/lib/main.js", f.join("node_modules/exports-field/lib/main.js")), - ("self-resolving root", f.clone(), "@exports-field/core", f.join("a.js")), - ("should resolve with wildcard pattern #1", f5.clone(), "m/features/f.js", f5.join("node_modules/m/src/features/f.js")), - ("should resolve with wildcard pattern #2", f5.clone(), "m/features/y/y.js", f5.join("node_modules/m/src/features/y/y.js")), - ("should resolve with wildcard pattern #3", f5.clone(), "m/features-no-ext/y/y.js", f5.join("node_modules/m/src/features/y/y.js")), - ("should resolve with wildcard pattern #4", f5.clone(), "m/middle/nested/f.js", f5.join("node_modules/m/src/middle/nested/f.js")), - ("should resolve with wildcard pattern #5", f5.clone(), "m/middle-1/nested/f.js", f5.join("node_modules/m/src/middle-1/nested/f.js")), - ("should resolve with wildcard pattern #6", f5.clone(), "m/middle-2/nested/f.js", f5.join("node_modules/m/src/middle-2/nested/f.js")), - ("should resolve with wildcard pattern #7", f5.clone(), "m/middle-3/nested/f", f5.join("node_modules/m/src/middle-3/nested/f/nested/f.js")), - ("should resolve with wildcard pattern #8", f5.clone(), "m/middle-4/f/nested", f5.join("node_modules/m/src/middle-4/f/f.js")), - ("should resolve with wildcard pattern #9", f5.clone(), "m/middle-5/f$/$", f5.join("node_modules/m/src/middle-5/f$/$.js")), - ]; - - // Not needed or snapshot: - // * should log the correct info - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } - - let p = f.join("node_modules/exports-field/package.json"); - let p2 = f2.join("node_modules/exports-field/package.json"); - let p4 = f4.join("node_modules/exports-field/package.json"); - let p5 = f5.join("node_modules/m/package.json"); - - #[rustfmt::skip] - let fail = [ - // ("throw error if extension not provided", f2.clone(), "exports-field/dist/main", ResolveError::NotFound(f2.join("node_modules/exports-field/lib/lib2/main"))), - ("resolver should respect query parameters #2. Direct matching", f2.clone(), "exports-field?foo", ResolveError::PackagePathNotExported("./?foo".into(), p2.clone())), - ("resolver should respect fragment parameters #2. Direct matching", f2, "exports-field#foo", ResolveError::PackagePathNotExported("./#foo".into(), p2)), - ("relative path should not work with exports field", f.clone(), "./node_modules/exports-field/dist/main.js", ResolveError::NotFound("./node_modules/exports-field/dist/main.js".into())), - ("backtracking should not work for request", f.clone(), "exports-field/dist/../../../a.js", ResolveError::InvalidPackageTarget("./lib/../../../a.js".to_string(), "./dist/".to_string(), p.clone())), - ("backtracking should not work for exports field target", f.clone(), "exports-field/dist/a.js", ResolveError::InvalidPackageTarget("./../../a.js".to_string(), "./dist/a.js".to_string(), p.clone())), - ("not exported error", f.clone(), "exports-field/anything/else", ResolveError::PackagePathNotExported("./anything/else".to_string(), p.clone())), - ("request ending with slash #1", f.clone(), "exports-field/", ResolveError::PackagePathNotExported("./".to_string(), p.clone())), - ("request ending with slash #2", f.clone(), "exports-field/dist/", ResolveError::PackagePathNotExported("./dist/".to_string(), p.clone())), - ("request ending with slash #3", f.clone(), "exports-field/lib/", ResolveError::PackagePathNotExported("./lib/".to_string(), p)), - ("should throw error if target is invalid", f4, "exports-field", ResolveError::InvalidPackageTarget("./a/../b/../../pack1/index.js".to_string(), ".".to_string(), p4)), - ("throw error if exports field is invalid", f.clone(), "invalid-exports-field", ResolveError::InvalidPackageConfig(f.join("node_modules/invalid-exports-field/package.json"))), - ("should throw error if target is 'null'", f5, "m/features/internal/file.js", ResolveError::PackagePathNotExported("./features/internal/file.js".to_string(), p5)), - ]; - - for (comment, path, request, error) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!(resolution, Err(error), "{comment} {path:?} {request}"); - } -} - -// resolve using exports field, not a browser field #1 -#[test] -fn exports_not_browser_field1() { - let f = super::fixture().join("exports-field"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - condition_names: vec!["webpack".into()], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "exports-field/dist/main.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("node_modules/exports-field/lib/lib2/main.js"))); -} - -// resolve using exports field and a browser alias field #2 -#[test] -fn exports_not_browser_field2() { - let f2 = super::fixture().join("exports-field2"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - extensions: vec![".js".into()], - condition_names: vec!["node".into()], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f2, "exports-field/dist/main.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f2.join("node_modules/exports-field/lib/browser.js"))); -} - -// should resolve extension without fullySpecified -#[test] -fn extension_without_fully_specified() { - let f2 = super::fixture().join("exports-field2"); - - let commonjs_resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - let resolved_path = - commonjs_resolver.resolve(&f2, "exports-field/dist/main").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f2.join("node_modules/exports-field/lib/lib2/main.js"))); -} - -#[test] -fn field_name_path() { - let f2 = super::fixture().join("exports-field2"); - let f3 = super::fixture().join("exports-field3"); - - // field name path #1 #2 #3 - let exports_fields = [ - vec![vec!["exportsField".into(), "exports".into()]], - vec![vec!["exportsField".into(), "exports".into()], vec!["exports".into()]], - vec![vec!["exports".into()], vec!["exportsField".into(), "exports".into()]], - ]; - - for exports_fields in exports_fields { - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - exports_fields, - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/main.js"))); - } - - // field name path #4 - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - exports_fields: vec![vec!["exports".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f2, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f2.join("node_modules/exports-field/index.js"))); - - // field name path #5 - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - exports_fields: vec![vec!["ex".into()], vec!["exports_field".into(), "exports".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/index"))); - - // non-compliant export targeting a directory - let resolver = Resolver::new(ResolveOptions { - exports_fields: vec![vec!["broken".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/src/index.js"))); -} - -#[test] -fn shared_resolvers() { - let f3 = super::fixture().join("exports-field3"); - - let resolver1 = Resolver::new(ResolveOptions { - exports_fields: vec![vec!["exportsField".into(), "exports".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver1.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/main.js"))); - - let resolver2 = resolver1.clone_with_options(ResolveOptions { - exports_fields: vec![vec!["ex".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver2.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/index"))); -} - -#[test] -fn extension_alias_1_2() { - let f = super::fixture().join("exports-field-and-extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - extension_alias: vec![(".js".into(), vec![".ts".into(), ".js".into()])], - fully_specified: true, - condition_names: vec!["webpack".into(), "default".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve with the `extensionAlias` option", f.clone(), "@org/pkg/string.js", f.join("node_modules/@org/pkg/dist/string.js")), - ("should resolve with the `extensionAlias` option #2", f.clone(), "pkg/string.js", f.join("node_modules/pkg/dist/string.js")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn extension_alias_3() { - let f = super::fixture().join("exports-field-and-extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - extension_alias: vec![( - ".js".into(), - vec![".foo".into(), ".baz".into(), ".baz".into(), ".ts".into(), ".js".into()], - )], - fully_specified: true, - condition_names: vec!["webpack".into(), "default".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve with the `extensionAlias` option #3", f.clone(), "pkg/string.js", f.join("node_modules/pkg/dist/string.js")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn extension_alias_throw_error() { - let f = super::fixture().join("exports-field-and-extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - extension_alias: vec![(".js".into(), vec![".ts".into()])], - fully_specified: true, - condition_names: vec!["webpack".into(), "default".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let fail = [ - // enhanced-resolve has two test cases that are exactly the same here - // https://github.com/webpack/enhanced-resolve/blob/a998c7d218b7a9ec2461fc4fddd1ad5dd7687485/test/exportsField.test.js#L2976-L3024 - ("should throw error with the `extensionAlias` option", f.clone(), "pkg/string.js", ResolveError::ExtensionAlias(f.join("node_modules/pkg/dist/string.js"))), - // TODO: The error is PackagePathNotExported in enhanced-resolve - // ("should throw error with the `extensionAlias` option", f.clone(), "pkg/string.js", ResolveError::PackagePathNotExported("node_modules/pkg/dist/string.ts".to_string())), - ]; - - for (comment, path, request, error) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!(resolution, Err(error), "{comment} {path:?} {request}"); - } -} - -// Small script for generating the test cases from enhanced-resolve -// for (c of testCases) { -// console.log("TestCase {") -// console.log(`name: ${JSON.stringify(c.name)},`) -// if (c.expect instanceof Error) { -// console.log(`expect: None,`) -// } else { -// console.log(`expect: Some(vec!${JSON.stringify(c.expect)}),`) -// } -// console.log(`exports_field: exports_field(json!(${JSON.stringify(c.suite[0], null, 2)})),`) -// console.log(`request: "${c.suite[1]}",`) -// console.log(`condition_names: vec!${JSON.stringify(c.suite[2])},`) -// console.log("},") -//} -struct TestCase { - name: &'static str, - expect: Option>, - exports_field: serde_json::Value, - request: &'static str, - condition_names: Vec<&'static str>, -} - -#[allow(clippy::needless_pass_by_value)] -fn exports_field(value: serde_json::Value) -> serde_json::Value { - value -} - -#[test] -fn test_cases() { - let test_cases = [ - TestCase { - name: "sample #1", - expect: Some(vec!["./dist/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/": { - "import": [ - "./dist/", - "./src/" - ], - "webpack": "./wp/" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "sample #1", - expect: Some(vec!["./src/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/": { - "import": [ - "./src/" - ], - "webpack": "./wp/" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - TestCase { - name: "sample #1 (wildcard)", - expect: Some(vec!["./dist/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/*": { - "import": [ - "./dist/*", - "./src/*" - ], - "webpack": "./wp/*" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "sample #1 (wildcard)", - expect: Some(vec!["./src/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/*": { - "import": [ - "./src/*" - ], - "webpack": "./wp/*" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - TestCase { - name: "sample #2", - expect: Some(vec!["./data/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./timezones/": "./data/timezones/" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #2 (wildcard)", - expect: Some(vec!["./data/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./timezones/*": "./data/timezones/*" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #3", - expect: Some(vec!["./data/timezones/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./": "./data/timezones/" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #3 (wildcard)", - expect: Some(vec!["./data/timezones/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./*": "./data/timezones/*.mjs" - })), - request: "./timezones/pdt", - condition_names: vec![], - }, - TestCase { - name: "sample #4", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./lib/": { - "browser": [ - "./browser/" - ] - }, - "./dist/index.js": { - "node": "./index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #4 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "node": "./index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #5", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/": { - "browser": [ - "./browser/" - ] - }, - "./dist/index.js": { - "node": "./index.js", - "default": "./browser/index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #5 (wildcard)", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "node": "./index.js", - "default": "./browser/index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./dist/a": "./dist/index.js" - })), - request: "./dist/aaa", - condition_names: vec![], - }, - TestCase { - name: "sample #7", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./dist/a/a/": "./dist/index.js" - })), - request: "./dist/a/a", - condition_names: vec![], - }, - TestCase { - name: "sample #7 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./dist/a/a/*": "./dist/index.js" - })), - request: "./dist/a/a", - condition_names: vec![], - }, - TestCase { - name: "sample #8", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": "./index.js" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #9", - expect: Some(vec!["./main.js"]), - exports_field: exports_field(json!({ - "./index.js": "./main.js" - })), - request: "./index.js", - condition_names: vec![], - }, - TestCase { - name: "sample #10", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #11", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./bar#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #12", - expect: Some(vec!["./ok.js#abc"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/ok.js#abc", - condition_names: vec![], - }, - TestCase { - name: "sample #12", - expect: Some(vec!["./ok.js#abc"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/ok.js#abc", - condition_names: vec![], - }, - TestCase { - name: "sample #13", - expect: Some(vec!["./ok.js?abc"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/ok.js?abc", - condition_names: vec![], - }, - TestCase { - name: "sample #14", - expect: Some(vec!["./🎉.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/🎉.js", - condition_names: vec![], - }, - TestCase { - name: "sample #15", - expect: Some(vec!["./%F0%9F%8E%89.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/%F0%9F%8E%89.js", - condition_names: vec![], - }, - TestCase { - name: "sample #16", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./🎉", - condition_names: vec![], - }, - TestCase { - name: "sample #17", - expect: Some(vec!["./other.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./%F0%9F%8E%89", - condition_names: vec![], - }, - TestCase { - name: "sample #18", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./module", - condition_names: vec![], - }, - TestCase { - name: "sample #19", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./module#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #20", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./module?foo", - condition_names: vec![], - }, - TestCase { - name: "sample #21", - expect: Some(vec!["./zizizi"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./z*z*z*" - })), - request: "./#zippi", - condition_names: vec![], - }, - TestCase { - name: "sample #22", - expect: Some(vec!["./d?e?f"]), - exports_field: exports_field(json!({ - "./a?b?c/": "./" - })), - request: "./a?b?c/d?e?f", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #1", - expect: Some(vec!["./dist/index.js"]), - exports_field: exports_field(json!({ - ".": "./dist/index.js" - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #2", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./": "./", - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #3", - expect: Some(vec!["./dist/a.js"]), - exports_field: exports_field(json!({ - "./dist/": "./dist/", - "./dist/*": "./dist/*", - "./dist*": "./dist*", - "./dist/index.js": "./dist/a.js" - })), - request: "./dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #4", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./": { - "browser": [ - "./browser/" - ] - }, - "./*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "browser": "./index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #5", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./": { - "browser": [ - "./browser/" - ] - }, - "./*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "node": "./node.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #6", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - ".": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #7", - expect: Some(vec!["./src/index.js"]), // `enhanced_resolve` is `None` - exports_field: exports_field(json!({ - ".": { - "default": "./src/index.js", - "browser": "./index.js", - "node": "./src/node/index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #8", - expect: Some(vec!["./src/index.js"]), - exports_field: exports_field(json!({ - ".": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #9", - expect: Some(vec!["./index"]), - exports_field: exports_field(json!({ - ".": "./index" - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #10", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./index": "./index.js" - })), - request: "./index", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #11", - expect: Some(vec!["./foo.js"]), - exports_field: exports_field(json!({ - "./": "./", - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #12", - expect: Some(vec!["./foo/bar/baz.js"]), - exports_field: exports_field(json!({ - "./": "./", - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo/bar/baz.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #13", - expect: Some(vec!["./foo/bar/baz.js"]), - exports_field: exports_field(json!({ - "./": "./", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo/bar/baz.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #14", - expect: Some(vec!["./foo/bar/baz.js"]), - exports_field: exports_field(json!({ - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo/bar/baz.js", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #1", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "require": "./require.js" - }, { - "import": "./import.mjs" - }] - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #2", - expect: Some(vec!["./import.mjs"]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "require": "./require.js" - }, { - "import": "./import.mjs" - }] - })), - request: ".", - condition_names: vec!["import"], - }, - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./require.js"]), - exports_field: exports_field(json!({ - ".": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./import.mjs"]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "import": "./import.mjs" - }] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./require.js"]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "require": [ - "./require.js" - ] - }, { - "import": [ - "./import.mjs", - "./import.js" - ] - }] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./import.mjs"]), - exports_field: exports_field(json!({ - ".": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "./import.mjs", - "./import.js" - ] - } - ] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./import.js"]), - exports_field: exports_field(json!({ - ".": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "./import.js" - ] - } - ] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "mapping to a folder root #1", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./timezones": "./data/timezones/" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #2", - expect: None, - exports_field: exports_field(json!({ - "./timezones/": "./data/timezones" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #3", - expect: Some(vec!["./data/timezones/pdt/index.mjs"]), - exports_field: exports_field(json!({ - "./timezones/pdt/": "./data/timezones/pdt/" - })), - request: "./timezones/pdt/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #3 (wildcard)", - expect: Some(vec!["./data/timezones/pdt/index.mjs"]), - exports_field: exports_field(json!({ - "./timezones/pdt/*": "./data/timezones/pdt/*" - })), - request: "./timezones/pdt/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #4", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./": "./timezones/" - })), - request: "./pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #4 (wildcard)", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./*": "./timezones/*" - })), - request: "./pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #5", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./": "./" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #5 (wildcard)", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./*": "./*" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #6", - expect: None, - exports_field: exports_field(json!({ - "./": "." - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #6 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "./*": "." - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #7", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": "./" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #7 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": "./*" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #1", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./": "./", - "./dist/": "./lib/" - })), - request: "./dist/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #1 (wildcard)", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./*": "./*", - "./dist/*": "./lib/*" - })), - request: "./dist/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #2", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/": "./dist/utils/", - "./dist/": "./lib/" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #2 (wildcard)", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/*": "./dist/utils/*", - "./dist/*": "./lib/*" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #3", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/index.js": "./dist/utils/index.js", - "./dist/utils/": "./dist/utils/index.mjs", - "./dist/": "./lib/" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #3 (wildcard)", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/index.js": "./dist/utils/index.js", - "./dist/utils/*": "./dist/utils/index.mjs", - "./dist/*": "./lib/*" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #4", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./": { - "browser": "./browser/" - }, - "./dist/": "./lib/" - })), - request: "./dist/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "the longest matching path prefix is prioritized #4 (wildcard)", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./*": { - "browser": "./browser/*" - }, - "./dist/*": "./lib/*" - })), - request: "./dist/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #1", - // `lodash/` does not start with './' so fallbacks to util - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "conditional mapping folder #1", - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": [ - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #1 (wildcard)", - // `lodash/` does not start with './' so fallbacks to util - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": [ - "lodash/*", - "./utils/*" - ], - "node": [ - "./utils-node/*" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "conditional mapping folder #1 (wildcard)", - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": [ - "./utils/*" - ], - "node": [ - "./utils-node/*" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #2", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./node/" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "conditional mapping folder #2 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "webpack": "./wpk/*", - "browser": [ - "lodash/*", - "./utils/*" - ], - "node": [ - "./node/*" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "conditional mapping folder #3", - expect: Some(vec!["./wpk/index.mjs"]), - exports_field: exports_field(json!({ - "./utils/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils/" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "conditional mapping folder #3 (wildcard)", - expect: Some(vec!["./wpk/index.mjs"]), - exports_field: exports_field(json!({ - "./utils/*": { - "webpack": "./wpk/*", - "browser": [ - "lodash/*", - "./utils/*" - ], - "node": [ - "./utils/*" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "incorrect exports field #1", - expect: None, - exports_field: exports_field(json!({ - "/utils/": "./a/" - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #2", - expect: None, - exports_field: exports_field(json!({ - "./utils/": "/a/" - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #3", - expect: None, - exports_field: exports_field(json!({ - "/utils/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #4", - expect: None, - exports_field: exports_field(json!({ - "./utils/": { - "browser": "/a/", - "default": "/b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #4 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "/a/", - "default": "/b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #5", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index": "./a/index.js" - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index.mjs": "./a/index.js" - })), - request: "./utils/index", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #7", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #8", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index.mjs": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - // Requests that are not `./` does not apply to `package_exports_resolve` - // TestCase { - // name: "incorrect request #1", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": "./a/" - // })), - // request: "/utils/index.mjs", - // condition_names: vec![], - // }, - // TestCase { - // name: "incorrect request #2", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": { - // "browser": "./a/", - // "default": "./b/" - // } - // })), - // request: "/utils/index.mjs", - // condition_names: vec!["browser"], - // }, - // TestCase { - // name: "incorrect request #3", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": { - // "browser": "./a/", - // "default": "./b/" - // } - // })), - // request: "../utils/index.mjs", - // condition_names: vec!["browser"], - // }, - // TestCase { - // name: "incorrect request #4", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": { - // "browser": "./a/", - // "default": "./b/" - // } - // })), - // request: "/utils/index.mjs/", - // condition_names: vec!["browser"], - // }, - TestCase { - name: "backtracking package base #1", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./../../utils/": "./dist/" - })), - request: "./../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #1 (wildcard)", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./../../utils/*": "./dist/*" - })), - request: "./../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #2", - expect: None, - exports_field: exports_field(json!({ - "../../utils/": "./dist/" - })), - request: "../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #2 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "../../utils/*": "./dist/*" - })), - request: "../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #3", - expect: None, - exports_field: exports_field(json!({ - "./utils/": "../src/" - })), - request: "./utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #3 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "./utils/*": "../src/*" - })), - request: "./utils/index", - condition_names: vec![], - }, - // enhanced-resolve does not handle backtracking here - // TestCase { - // name: "backtracking package base #4", - // expect: Some(vec!["./../src/index"]), - // exports_field: exports_field(json!({ - // "./utils/": "./../src/" - // })), - // request: "./utils/index", - // condition_names: vec![], - // }, - // TestCase { - // name: "backtracking package base #4 (wildcard)", - // expect: Some(vec!["./../src/index"]), - // exports_field: exports_field(json!({ - // "./utils/*": "./../src/*" - // })), - // request: "./utils/index", - // condition_names: vec![], - // }, - // TestCase { - // name: "backtracking package base #5", - // expect: Some(vec!["./src/../index.js"]), - // exports_field: exports_field(json!({ - // "./utils/index": "./src/../index.js" - // })), - // request: "./utils/index", - // condition_names: vec![], - // }, - TestCase { - name: "backtracking package base #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/../utils/index": "./src/../index.js" - })), - request: "./utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #7", - expect: None, - exports_field: exports_field(json!({ - "./utils/": { - "browser": "../this/" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #7", - expect: None, - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "../this/*" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #8", - // We throw "InvalidPackageTarget" - // expect: Some(vec!["./utils/../index"]), - expect: None, - exports_field: exports_field(json!({ - "./utils/": { - "browser": "./utils/../" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #8 (wildcard)", - // We throw "InvalidPackageTarget" - // expect: Some(vec!["./utils/../index"]), - expect: None, - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "./utils/../*" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #9", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./": "./src/../../", - "./dist/": "./dist/" - })), - request: "./dist/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #9 (wildcard)", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./*": "./src/../../*", - "./dist/*": "./dist/*" - })), - request: "./dist/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking target folder #1", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../../index"]), - exports_field: exports_field(json!({ - "./utils/": "./dist/" - })), - request: "./utils/timezone/../../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #1 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../../index"]), - exports_field: exports_field(json!({ - "./utils/*": "./dist/*" - })), - request: "./utils/timezone/../../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #2", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../index"]), - exports_field: exports_field(json!({ - "./utils/": "./dist/" - })), - request: "./utils/timezone/../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #2 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../index"]), - exports_field: exports_field(json!({ - "./utils/*": "./dist/*" - })), - request: "./utils/timezone/../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #3", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/target/../../index"]), - exports_field: exports_field(json!({ - "./utils/": "./dist/target/" - })), - request: "./utils/../../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #3 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/target/../../index"]), - exports_field: exports_field(json!({ - "./utils/*": "./dist/target/*" - })), - request: "./utils/../../index", - condition_names: vec![], - }, - // enhanced-resolve does not handle `node_modules` in target - TestCase { - name: "nested node_modules path #1", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": "./node_modules/" - } - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #1 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "./node_modules/*" - } - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #2", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./utils/../node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/": "./utils/../node_modules/" - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "nested node_modules path #2 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./utils/../node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": "./utils/../node_modules/*" - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "nested mapping #1", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": "./", - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested mapping #1 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": "./*", - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "nested mapping #2 (wildcard)", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #2 (wildcard)", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "nested mapping #3", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["webpack"], - }, - TestCase { - name: "nested mapping #3 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["webpack"], - }, - TestCase { - name: "nested mapping #4", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["node", "browser"], - }, - TestCase { - name: "nested mapping #4 (wildcard)", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["node", "browser"], - }, - TestCase { - name: "nested mapping #5", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node"], - }, - TestCase { - name: "nested mapping #5 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": { - "webpack": [ - "./wpck/*" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node"], - }, - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - TestCase { - name: "nested mapping #6 (wildcard)", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": { - "webpack": [ - "./wpck/*" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #6 (wildcard)", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./node/*" - ], - "default": { - "node": { - "webpack": [ - "./wpck/*" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - TestCase { - name: "nested mapping #7", - expect: Some(vec!["./y.js"]), - exports_field: exports_field(json!({ - "./a.js": { - "abc": { - "def": "./x.js" - }, - "ghi": "./y.js" - } - })), - request: "./a.js", - condition_names: vec!["abc", "ghi"], - }, - TestCase { - name: "nested mapping #8", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./a.js": { - "abc": { - "def": "./x.js", - "default": [] - }, - "ghi": "./y.js" - } - })), - request: "./a.js", - condition_names: vec!["abc", "ghi"], - }, - TestCase { - name: "syntax sugar #1", - expect: Some(vec!["./main.js"]), - exports_field: exports_field(json!("./main.js")), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #2", - expect: Some(vec![]), - exports_field: exports_field(json!("./main.js")), - request: "./lib.js", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #3", - expect: Some(vec!["./a.js"]), - exports_field: exports_field(json!(["./a.js", "./b.js"])), - request: ".", - condition_names: vec![], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "syntax sugar #3", - expect: Some(vec!["./b.js"]), - exports_field: exports_field(json!(["./b.js"])), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #4", - expect: Some(vec![]), - exports_field: exports_field(json!(["./a.js", "./b.js"])), - request: "./lib.js", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #5", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "browser": { - "default": "./index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "syntax sugar #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "browser": { - "default": "./index.js" - } - })), - request: "./lib.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "syntax sugar #7", - expect: None, - exports_field: exports_field(json!({ - "./node": "./node.js", - "browser": { - "default": "./index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "syntax sugar #8", - expect: None, - exports_field: exports_field(json!({ - "browser": { - "default": "./index.js" - }, - "./node": "./node.js" - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #1", - expect: Some(vec!["./abc/d"]), - exports_field: exports_field(json!({ - "./ab*": "./ab/*", - "./abc*": "./abc/*", - "./a*": "./a/*" - })), - request: "./abcd", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #2", - expect: Some(vec!["./abc/d/e"]), - exports_field: exports_field(json!({ - "./ab*": "./ab/*", - "./abc*": "./abc/*", - "./a*": "./a/*" - })), - request: "./abcd/e", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #3", - expect: Some(vec!["./abc/d"]), - exports_field: exports_field(json!({ - "./x/ab*": "./ab/*", - "./x/abc*": "./abc/*", - "./x/a*": "./a/*" - })), - request: "./x/abcd", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #4", - expect: Some(vec!["./abc/d/e"]), - exports_field: exports_field(json!({ - "./x/ab*": "./ab/*", - "./x/abc*": "./abc/*", - "./x/a*": "./a/*" - })), - request: "./x/abcd/e", - condition_names: vec!["browser"], - }, - TestCase { - name: "path tree edge case #1", - expect: Some(vec!["./A/b/d.js"]), - exports_field: exports_field(json!({ - "./a/": "./A/", - "./a/b/c": "./c.js" - })), - request: "./a/b/d.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #1 (wildcard)", - expect: Some(vec!["./A/b/d.js"]), - exports_field: exports_field(json!({ - "./a/*": "./A/*", - "./a/b/c": "./c.js" - })), - request: "./a/b/d.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #2", - expect: Some(vec!["./A/c.js"]), - exports_field: exports_field(json!({ - "./a/": "./A/", - "./a/b": "./b.js" - })), - request: "./a/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #2 (wildcard)", - expect: Some(vec!["./A/c.js"]), - exports_field: exports_field(json!({ - "./a/*": "./A/*", - "./a/b": "./b.js" - })), - request: "./a/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #3", - expect: Some(vec!["./A/b/d/c.js"]), - exports_field: exports_field(json!({ - "./a/": "./A/", - "./a/b/c/d": "./c.js" - })), - request: "./a/b/d/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #3 (wildcard)", - expect: Some(vec!["./A/b/d/c.js"]), - exports_field: exports_field(json!({ - "./a/*": "./A/*", - "./a/b/c/d": "./c.js" - })), - request: "./a/b/d/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #1", - expect: Some(vec!["./A/b.js"]), - exports_field: exports_field(json!({ - "./a/*.js": "./A/*.js" - })), - request: "./a/b.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #2", - expect: Some(vec!["./A/b/c.js"]), - exports_field: exports_field(json!({ - "./a/*.js": "./A/*.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #3", - expect: Some(vec!["./A/b/c.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": "./A/*/c.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #4", - expect: Some(vec!["./A/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": "./A/*/*.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #5", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/*.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #5", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/*.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./lib/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #6", - expect: Some(vec!["./browser/foo/bar.js"]), - exports_field: exports_field(json!({ - "./lib/*/bar.js": { - "browser": [ - "./browser/*/bar.js" - ] - }, - "./dist/*/bar.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./lib/foo/bar.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #6", - expect: Some(vec!["./browser/foo.js"]), - exports_field: exports_field(json!({ - "./lib/*/bar.js": { - "browser": [ - "./browser/*/bar.js" - ] - }, - "./dist/*/bar.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./dist/foo/bar.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #7", - expect: Some(vec!["./browser/foo/default.js"]), - exports_field: exports_field(json!({ - "./lib/*/bar.js": { - "browser": [ - "./browser/*/bar.js" - ] - }, - "./dist/*/bar.js": { - "node": "./*.js", - "default": "./browser/*/default.js" - } - })), - request: "./dist/foo/bar.js", - condition_names: vec!["default"], - }, - TestCase { - name: "wildcard pattern #8", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": "./A/*/*/*.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #9", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": [ - "./A/*/*/*.js", - "./B/*/*/*.js" - ] - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "wildcard pattern #9", - expect: Some(vec!["./B/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": [ - "./B/*/*/*.js" - ] - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #10", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/foo-*/c.js": "./A/*/*/*.js" - })), - request: "./a/foo-b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #11", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*-foo/c.js": "./A/*/*/*.js" - })), - request: "./a/b-foo/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #12", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/foo-*-foo/c.js": "./A/*/*/*.js" - })), - request: "./a/foo-b-foo/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #13", - expect: Some(vec!["./A/b/c/d.js"]), - exports_field: exports_field(json!({ - "./a/foo-*-foo/c.js": "./A/b/c/d.js" - })), - request: "./a/foo-b-foo/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #14", - expect: Some(vec!["./A/b/c/*.js"]), - exports_field: exports_field(json!({ - "./a/foo-foo/c.js": "./A/b/c/*.js" - })), - request: "./a/foo-foo/c.js", - condition_names: vec![], - }, - ]; - - for case in test_cases { - let resolved = Resolver::new(ResolveOptions { - condition_names: case - .condition_names - .iter() - .map(ToString::to_string) - .collect::>(), - ..ResolveOptions::default() - }) - .package_exports_resolve( - Path::new(""), - case.request, - &case.exports_field, - &mut Ctx::default(), - ) - .map(|p| p.map(|p| p.to_path_buf())); - if let Some(expect) = case.expect { - if expect.is_empty() { - assert!( - matches!(resolved, Err(ResolveError::PackagePathNotExported(_, _))), - "{} {:?}", - &case.name, - &resolved - ); - } else { - for expect in expect { - assert_eq!(resolved, Ok(Some(Path::new(expect).normalize())), "{}", &case.name); - } - } - } else { - assert!(resolved.is_err(), "{} {resolved:?}", &case.name); - } - } -} diff --git a/src/tests/extension_alias.rs b/src/tests/extension_alias.rs deleted file mode 100644 index cc6a906b..00000000 --- a/src/tests/extension_alias.rs +++ /dev/null @@ -1,70 +0,0 @@ -//! - -use crate::{ResolveError, ResolveOptions, Resolver}; - -#[test] -fn extension_alias() { - let f = super::fixture().join("extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - extension_alias: vec![ - (".js".into(), vec![".ts".into(), ".js".into()]), - (".mjs".into(), vec![".mts".into()]), - ], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should alias fully specified file", f.clone(), "./index.js", f.join("index.ts")), - ("should alias fully specified file when there are two alternatives", f.clone(), "./dir/index.js", f.join("dir/index.ts")), - ("should also allow the second alternative", f.clone(), "./dir2/index.js", f.join("dir2/index.js")), - ("should support alias option without an array", f.clone(), "./dir2/index.mjs", f.join("dir2/index.mts")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } - - #[rustfmt::skip] - let fail = [ - ("should not allow to fallback to the original extension or add extensions", f.clone(), "./index.mjs"), - ]; - - for (comment, path, request) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!( - resolution, - Err(ResolveError::ExtensionAlias(f.join(request))), - "{comment} {path:?} {request}" - ); - } -} - -// should not apply extension alias to extensions or mainFiles field -#[test] -fn not_apply_to_extension_nor_main_files() { - let f = super::fixture().join("extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - extension_alias: vec![(".js".into(), vec![])], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("directory", f.clone(), "./dir2", "dir2/index.js"), - ("file", f.clone(), "./dir2/index", "dir2/index.js"), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - let expected = f.join(expected); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} diff --git a/src/tests/extensions.rs b/src/tests/extensions.rs deleted file mode 100644 index 1ebd86f4..00000000 --- a/src/tests/extensions.rs +++ /dev/null @@ -1,125 +0,0 @@ -//! - -use crate::{EnforceExtension, Resolution, ResolveContext, ResolveError, ResolveOptions, Resolver}; -use rustc_hash::FxHashSet; - -#[test] -fn extensions() { - let f = super::fixture().join("extensions"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".ts".into(), ".js".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve according to order of provided extensions", "./foo", "foo.ts"), - ("should resolve according to order of provided extensions (dir index)", "./dir", "dir/index.ts"), - ("should resolve according to main field in module root", ".", "index.js"), - // This is a core module - // ("should resolve single file module before directory", "module", "node_modules/module.js"), - ("should resolve trailing slash directory before single file", "module/", "node_modules/module/index.ts"), - ]; - - for (comment, request, expected_path) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - let expected = f.join(expected_path); - assert_eq!(resolved_path, Ok(expected), "{comment} {request} {expected_path}"); - } - - #[rustfmt::skip] - let fail = [ - ("not resolve to file when request has a trailing slash (relative)", "./foo.js/", "./foo.js/".into()) - ]; - - for (comment, request, expected_error) in fail { - let resolution = resolver.resolve(&f, request); - let error = ResolveError::NotFound(expected_error); - assert_eq!(resolution, Err(error), "{comment} {request} {resolution:?}"); - } -} - -// should default enforceExtension to true when extensions includes an empty string -#[test] -fn default_enforce_extension() { - let f = super::fixture().join("extensions"); - - let mut ctx = ResolveContext::default(); - let resolved = Resolver::new(ResolveOptions { - extensions: vec![".ts".into(), String::new(), ".js".into()], - ..ResolveOptions::default() - }) - .resolve_with_context(&f, "./foo", &mut ctx); - - assert_eq!(resolved.map(Resolution::into_path_buf), Ok(f.join("foo.ts"))); - assert_eq!( - ctx.file_dependencies, - FxHashSet::from_iter([f.join("foo.ts"), f.join("package.json")]) - ); - assert!(ctx.missing_dependencies.is_empty()); -} - -// should respect enforceExtension when extensions includes an empty string -#[test] -fn respect_enforce_extension() { - let f = super::fixture().join("extensions"); - - let mut ctx = ResolveContext::default(); - let resolved = Resolver::new(ResolveOptions { - enforce_extension: EnforceExtension::Disabled, - extensions: vec![".ts".into(), String::new(), ".js".into()], - ..ResolveOptions::default() - }) - .resolve_with_context(&f, "./foo", &mut ctx); - - assert_eq!(resolved.map(Resolution::into_path_buf), Ok(f.join("foo.ts"))); - assert_eq!( - ctx.file_dependencies, - FxHashSet::from_iter([f.join("foo.ts"), f.join("package.json")]) - ); - assert_eq!(ctx.missing_dependencies, FxHashSet::from_iter([f.join("foo")])); -} - -#[test] -fn multi_dot_extension() { - let f = super::fixture().join("extensions"); - - let resolver = Resolver::new(ResolveOptions { - // Test for `.d.ts`, not part of enhanced-resolve. - extensions: vec![".a.b.c".into(), ".d.ts".into(), ".ts".into(), ".js".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve according to order of provided extensions", "./foo", "foo.ts"), - ("should resolve file with extension", "./app.module", "app.module.js") - ]; - - for (comment, request, expected_path) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - let expected = f.join(expected_path); - assert_eq!(resolved_path, Ok(expected), "{comment} {request} {expected_path}"); - } - - #[rustfmt::skip] - let fail = [ - ("not resolve to file", "./index.", "./index.".into()) - ]; - - for (comment, request, expected_error) in fail { - let resolution = resolver.resolve(&f, request); - let error = ResolveError::NotFound(expected_error); - assert_eq!(resolution, Err(error), "{comment} {request} {resolution:?}"); - } -} - -#[test] -#[should_panic = "All extensions must start with a leading dot"] -fn without_leading_dot() { - Resolver::new(ResolveOptions { - extensions: vec!["ts".into(), "js".into()], - ..ResolveOptions::default() - }); -} diff --git a/src/tests/fallback.rs b/src/tests/fallback.rs deleted file mode 100644 index 3da2d767..00000000 --- a/src/tests/fallback.rs +++ /dev/null @@ -1,100 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/fallback.test.js - -#[test] -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -fn fallback() { - use super::memory_fs::MemoryFS; - use crate::{AliasValue, ResolveError, ResolveOptions, ResolverGeneric}; - use std::path::{Path, PathBuf}; - - let f = Path::new("/"); - - let file_system = MemoryFS::new(&[ - ("/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", ""), - ]); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - fallback: vec![ - ("aliasA".into(), vec![AliasValue::Path("a".into())]), - ("b$".into(), vec![AliasValue::Path("a/index".into())]), - ("c$".into(), vec![AliasValue::Path("/a/index".into())]), - ( - "multiAlias".into(), - vec![ - AliasValue::Path("b".into()), - AliasValue::Path("c".into()), - AliasValue::Path("d".into()), - AliasValue::Path("e".into()), - AliasValue::Path("a".into()), - ], - ), - ("recursive".into(), vec![AliasValue::Path("recursive/dir".into())]), - ("/d/dir".into(), vec![AliasValue::Path("/c/dir".into())]), - ("/d/index.js".into(), vec![AliasValue::Path("/c/index".into())]), - ("ignored".into(), vec![AliasValue::Ignore]), - ("node:path".into(), vec![AliasValue::Ignore]), - ], - modules: vec!["/".into()], - ..ResolveOptions::default() - }, - ); - - #[rustfmt::skip] - let pass = [ - ("should resolve a not aliased module 1", "a", "/a/index"), - ("should resolve a not aliased module 2", "a/index", "/a/index"), - ("should resolve a not aliased module 3", "a/dir", "/a/dir/index"), - ("should resolve a not aliased module 4", "a/dir/index", "/a/dir/index"), - ("should resolve an fallback module 1", "aliasA", "/a/index"), - ("should resolve an fallback module 2", "aliasA/index", "/a/index"), - ("should resolve an fallback module 3", "aliasA/dir", "/a/dir/index"), - ("should resolve an fallback module 4", "aliasA/dir/index", "/a/dir/index"), - ("should resolve a recursive aliased module 1", "recursive", "/recursive/index"), - ("should resolve a recursive aliased module 2", "recursive/index", "/recursive/index"), - ("should resolve a recursive aliased module 3", "recursive/dir", "/recursive/dir/index"), - ("should resolve a recursive aliased module 4", "recursive/dir/index", "/recursive/dir/index"), - ("should resolve a recursive aliased module 5", "recursive/file", "/recursive/dir/file"), - ("should resolve a file aliased module with a query 1", "b?query", "/b/index?query"), - ("should resolve a file aliased module with a query 2", "c?query", "/c/index?query"), - ("should resolve a path in a file aliased module 1", "b/index", "/b/index"), - ("should resolve a path in a file aliased module 2", "b/dir", "/b/dir/index"), - ("should resolve a path in a file aliased module 3", "b/dir/index", "/b/dir/index"), - ("should resolve a path in a file aliased module 4", "c/index", "/c/index"), - ("should resolve a path in a file aliased module 5", "c/dir", "/c/dir/index"), - ("should resolve a path in a file aliased module 6", "c/dir/index", "/c/dir/index"), - ("should resolve a file in multiple aliased dirs 1", "multiAlias/dir/file", "/e/dir/file"), - ("should resolve a file in multiple aliased dirs 2", "multiAlias/anotherDir", "/e/anotherDir/index"), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - - #[rustfmt::skip] - let ignore = [ - ("should resolve an ignore module", "ignored", ResolveError::Ignored(f.join("ignored"))), - ("should resolve node: builtin module", "node:path", ResolveError::Ignored(PathBuf::from("/node:path"))), - ]; - - for (comment, request, expected) in ignore { - let resolution = resolver.resolve(f, request); - assert_eq!(resolution, Err(expected), "{comment} {request}"); - } -} diff --git a/src/tests/full_specified.rs b/src/tests/full_specified.rs deleted file mode 100644 index a70c0191..00000000 --- a/src/tests/full_specified.rs +++ /dev/null @@ -1,113 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/fullSpecified.test.js - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows { - use std::path::PathBuf; - - use crate::{AliasValue, ResolveOptions, ResolverGeneric}; - - use super::super::memory_fs::MemoryFS; - - fn file_system() -> MemoryFS { - MemoryFS::new(&[ - ("/a/node_modules/package1/index.js", ""), - ("/a/node_modules/package1/file.js", ""), - ("/a/node_modules/package2/package.json", r#"{"main":"a"}"#), - ("/a/node_modules/package2/a.js", ""), - ("/a/node_modules/package3/package.json", r#"{"main":"dir"}"#), - ("/a/node_modules/package3/dir/index.js", ""), - ("/a/node_modules/package4/package.json", r#"{"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", ""), - ]) - } - - #[test] - fn test() { - let file_system = file_system(); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - alias: vec![ - ("alias1".into(), vec![AliasValue::from("/a/abc")]), - ("alias2".into(), vec![AliasValue::from("/a")]), - ], - alias_fields: vec![vec!["browser".into()]], - fully_specified: true, - ..ResolveOptions::default() - }, - ); - - let failing_resolves = [ - ("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"), - ]; - - for (comment, request) in failing_resolves { - let resolution = resolver.resolve("/a", request); - assert!(resolution.is_err(), "{comment} {request}"); - } - - let successful_resolves = [ - ("fully relative", "./abc.js", "/a/abc.js"), - ("fully absolute", "/a/abc.js", "/a/abc.js"), - ("fully relative in package", "package1/file.js", "/a/node_modules/package1/file.js"), - ("extensions in mainFiles", "package1", "/a/node_modules/package1/index.js"), - ("extensions in mainFields", "package2", "/a/node_modules/package2/a.js"), - ("extensions in alias", "alias1", "/a/abc.js"), - ("directories in alias", "alias2", "/a/index.js"), - ("directories in packages", "package3", "/a/node_modules/package3/dir/index.js"), - ("extensions in aliasFields", "package4/a.js", "/a/node_modules/package4/b.js"), - ]; - - for (comment, request, expected) in successful_resolves { - let resolution = resolver.resolve("/a", request).map(|r| r.full_path()); - assert_eq!(resolution, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - } - - #[test] - #[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. - fn resolve_to_context() { - let file_system = file_system(); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - alias: vec![ - ("alias1".into(), vec![AliasValue::from("/a/abc")]), - ("alias2".into(), vec![AliasValue::from("/a")]), - ], - alias_fields: vec![vec!["browser".into()]], - fully_specified: true, - resolve_to_context: true, - ..ResolveOptions::default() - }, - ); - - let successful_resolves = [ - ("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", "/a/node_modules/package3/dir"), - ]; - - for (comment, request, expected) in successful_resolves { - let resolution = resolver.resolve("/a", request).map(|r| r.full_path()); - assert_eq!(resolution, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - } -} diff --git a/src/tests/imports_field.rs b/src/tests/imports_field.rs deleted file mode 100644 index c928627a..00000000 --- a/src/tests/imports_field.rs +++ /dev/null @@ -1,1320 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/importsField.test.js -//! -//! The huge imports field test cases are at the bottom of this file. - -use serde_json::json; - -use crate::{Ctx, JSONMap, PathUtil, ResolveError, ResolveOptions, Resolver}; -use std::path::Path; - -#[test] -fn test_simple() { - let f = super::fixture().join("imports-field"); - let f2 = super::fixture().join("imports-exports-wildcard/node_modules/m/"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve using imports field instead of self-referencing", f.clone(), "#imports-field", f.join("b.js")), - ("should resolve using imports field instead of self-referencing for a subpath", f.join("dir"), "#imports-field", f.join("b.js")), - ("should resolve package #1", f.clone(), "#a/dist/main.js", f.join("node_modules/a/lib/lib2/main.js")), - ("should resolve package #3", f.clone(), "#ccc/index.js", f.join("node_modules/c/index.js")), - ("should resolve package #4", f.clone(), "#c", f.join("node_modules/c/index.js")), - ("should resolve with wildcard pattern", f2.clone(), "#internal/i.js", f2.join("src/internal/i.js")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } - - // Note added: - // * should resolve absolute path as an imports field target - // * should log the correct info - - #[rustfmt::skip] - let fail = [ - ("should disallow resolve out of package scope", f.clone(), "#b", ResolveError::InvalidPackageTarget("../b.js".to_string(), "#b".to_string(), f.join("package.json"))), - ("should resolve package #2", f.clone(), "#a", ResolveError::PackageImportNotDefined("#a".to_string(), f.join("package.json"))), - ]; - - for (comment, path, request, error) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!(resolution, Err(error), "{comment} {path:?} {request}"); - } -} - -#[test] -fn shared_resolvers() { - let f = super::fixture().join("imports-field"); - - // field name #1 - let resolver1 = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - imports_fields: vec![vec!["imports".into()]], - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - let resolved_path = resolver1.resolve(&f, "#imports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("b.js"))); - - // field name #2 - let resolver2 = resolver1.clone_with_options(ResolveOptions { - imports_fields: vec![vec!["other".into(), "imports".into()]], - ..ResolveOptions::default() - }); - - let resolved_path = resolver2.resolve(&f, "#b").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("a.js"))); -} - -// Small script for generating the test cases from enhanced_resolve -// for (c of testCases) { -// console.log("TestCase {") -// console.log(`name: ${JSON.stringify(c.name)},`) -// if (c.expect instanceof Error) { -// console.log(`expect: None,`) -// } else { -// console.log(`expect: Some(vec!${JSON.stringify(c.expect)}),`) -// } -// console.log(`imports_field: imports_field(json!(${JSON.stringify(c.suite[0], null, 2)})),`) -// console.log(`request: "${c.suite[1]}",`) -// console.log(`condition_names: vec!${JSON.stringify(c.suite[2])},`) -// console.log("},") -// } - -struct TestCase { - name: &'static str, - expect: Option>, - imports_field: JSONMap, - request: &'static str, - condition_names: Vec<&'static str>, -} - -#[allow(clippy::needless_pass_by_value)] -fn imports_field(value: serde_json::Value) -> JSONMap { - let s = serde_json::to_string(&value).unwrap(); - serde_json::from_str(&s).unwrap() -} - -#[test] -fn test_cases() { - let test_cases = [ - TestCase { - name: "sample #1", - expect: Some(vec!["./dist/test/file.js"]), - imports_field: imports_field(json!({ - "#abc/": { - "import": [ - "./dist/", - "./src/" - ], - "webpack": "./wp/" - }, - "#abc": "./main.js" - })), - request: "#abc/test/file.js", - condition_names: vec!["import", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "sample #1", - expect: Some(vec!["./src/test/file.js"]), - imports_field: imports_field(json!({ - "#abc/": { - "import": [ - "./src/" - ], - "webpack": "./wp/" - }, - "#abc": "./main.js" - })), - request: "#abc/test/file.js", - condition_names: vec!["import", "webpack"], - }, - TestCase { - name: "sample #2", - expect: Some(vec!["./data/timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#1/timezones/": "./data/timezones/" - })), - request: "#1/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #3", - expect: Some(vec!["./data/timezones/timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#aaa/": "./data/timezones/", - "#a/": "./data/timezones/" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #4", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/lib/": { - "browser": [ - "./browser/" - ] - }, - "#a/dist/index.js": { - "node": "./index.js" - } - })), - request: "#a/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #5", - expect: Some(vec!["./browser/index.js"]), - imports_field: imports_field(json!({ - "#a/lib/": { - "browser": [ - "./browser/" - ] - }, - "#a/dist/index.js": { - "node": "./index.js", - "default": "./browser/index.js" - } - })), - request: "#a/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #6", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/dist/a": "./dist/index.js" - })), - request: "#a/dist/aaa", - condition_names: vec![], - }, - TestCase { - name: "sample #7", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/a/a/": "./dist/index.js" - })), - request: "#a/a/a", - condition_names: vec![], - }, - TestCase { - name: "sample #8", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": "./index.js" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #9", - expect: Some(vec!["./main.js"]), - imports_field: imports_field(json!({ - "#a/index.js": "./main.js" - })), - request: "#a/index.js", - condition_names: vec![], - }, - TestCase { - name: "sample #10", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #11", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/bar#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #12", - expect: Some(vec!["./ok.js#abc"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/ok.js#abc", - condition_names: vec![], - }, - TestCase { - name: "sample #13", - expect: Some(vec!["./ok.js?abc"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/ok.js?abc", - condition_names: vec![], - }, - TestCase { - name: "sample #14", - expect: Some(vec!["./🎉.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/🎉.js", - condition_names: vec![], - }, - TestCase { - name: "sample #15", - expect: Some(vec!["./%F0%9F%8E%89.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/%F0%9F%8E%89.js", - condition_names: vec![], - }, - TestCase { - name: "sample #16", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/🎉", - condition_names: vec![], - }, - TestCase { - name: "sample #17", - expect: Some(vec!["./other.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/%F0%9F%8E%89", - condition_names: vec![], - }, - TestCase { - name: "sample #18", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/module", - condition_names: vec![], - }, - TestCase { - name: "sample #19", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/module#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #20", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/module?foo", - condition_names: vec![], - }, - TestCase { - name: "sample #21", - expect: Some(vec!["./d?e?f"]), - imports_field: imports_field(json!({ - "#a/a?b?c/": "./" - })), - request: "#a/a?b?c/d?e?f", - condition_names: vec![], - }, - TestCase { - name: "sample #22", - // We throw InvalidPackageTarget - expect: None, - // expect: Some(vec!["/user/a/index"]), - imports_field: imports_field(json!({ - "#a/": "/user/a/" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #1", - expect: Some(vec!["./A/b/d.js"]), - imports_field: imports_field(json!({ - "#a/": "./A/", - "#a/b/c": "./c.js" - })), - request: "#a/b/d.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #2", - expect: Some(vec!["./A/c.js"]), - imports_field: imports_field(json!({ - "#a/": "./A/", - "#a/b": "./b.js" - })), - request: "#a/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #3", - expect: Some(vec!["./A/b/c/d.js"]), - imports_field: imports_field(json!({ - "#a/": "./A/", - "#a/b/c/d": "./c.js" - })), - request: "#a/b/c/d.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #1", - expect: Some(vec!["./dist/index.js"]), - imports_field: imports_field(json!({ - "#a": "./dist/index.js" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #2", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": "./" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #3", - expect: Some(vec!["./dist/a.js"]), - imports_field: imports_field(json!({ - "#a/": "./dist/", - "#a/index.js": "./dist/a.js" - })), - request: "#a/index.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #4", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "./browser/" - ] - }, - "#a/index.js": { - "browser": "./index.js" - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #5", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "./browser/" - ] - }, - "#a/index.js": { - "node": "./node.js" - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #6", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: "#a", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #7", - expect: Some(vec!["./src/index.js"]), // `enhanced_resolve` is `None` - imports_field: imports_field(json!({ - "#a": { - "default": "./src/index.js", - "browser": "./index.js", - "node": "./src/node/index.js" - } - })), - request: "#a", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #8", - expect: Some(vec!["./src/index.js"]), - imports_field: imports_field(json!({ - "#a": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #9", - expect: Some(vec!["./index"]), - imports_field: imports_field(json!({ - "#a": "./index" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #10", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/index": "./index.js" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #11", - // We throw InvalidPackageTarget - // expect: Some(vec!["b"]), - expect: None, - imports_field: imports_field(json!({ - "#a": "b" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #12", - // We throw InvalidPackageTarget - // expect: Some(vec!["b/index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "b/" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #13", - // We throw InvalidPackageTarget - // expect: Some(vec!["b#anotherhashishere"]), - expect: None, - imports_field: imports_field(json!({ - "#a?q=a#hashishere": "b#anotherhashishere" - })), - request: "#a?q=a#hashishere", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #1", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #2", - expect: Some(vec!["./import.mjs"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec!["import"], - }, - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./require.js"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./import.mjs"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./require.js"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": [ - "./require.js" - ] - }, - { - "import": [ - "./import.mjs", - "#b/import.js" - ] - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./import.mjs"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "./import.mjs", - "#b/import.js" - ] - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "#b/import.js" - ] - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "mapping to a folder root #1", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#timezones": "./data/timezones/" - })), - request: "#timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #2", - expect: None, - imports_field: imports_field(json!({ - "#timezones/": "./data/timezones" - })), - request: "#timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #3", - expect: Some(vec!["./data/timezones/pdt/index.mjs"]), - imports_field: imports_field(json!({ - "#timezones/pdt/": "./data/timezones/pdt/" - })), - request: "#timezones/pdt/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #4", - expect: Some(vec!["./timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#a/": "./timezones/" - })), - request: "#a/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #5", - expect: Some(vec!["./timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#a/": "./" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #6", - expect: None, - imports_field: imports_field(json!({ - "#a/": "." - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #7", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": "./" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #1", - expect: Some(vec!["./lib/index.mjs"]), - imports_field: imports_field(json!({ - "#a/": "./", - "#a/dist/": "./lib/" - })), - request: "#a/dist/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #2", - expect: Some(vec!["./dist/utils/index.js"]), - imports_field: imports_field(json!({ - "#a/dist/utils/": "./dist/utils/", - "#a/dist/": "./lib/" - })), - request: "#a/dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #3", - expect: Some(vec!["./dist/utils/index.js"]), - imports_field: imports_field(json!({ - "#a/dist/utils/index.js": "./dist/utils/index.js", - "#a/dist/utils/": "./dist/utils/index.mjs", - "#a/dist/": "./lib/" - })), - request: "#a/dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #4", - expect: Some(vec!["./lib/index.mjs"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./browser/" - }, - "#a/dist/": "./lib/" - })), - request: "#a/dist/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #1", - // This behaves differently from enhanced_resolve, because `lodash/` is an an InvalidPackageConfig - // expect: Some(vec!["lodash/index.js"]), - expect: Some(vec!["./utils/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "conditional mapping folder #1", - expect: Some(vec!["./utils/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #2", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./node/" - ] - } - })), - request: "#a/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "conditional mapping folder #3", - expect: Some(vec!["./wpk/index.mjs"]), - imports_field: imports_field(json!({ - "#a/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils/" - ] - } - })), - request: "#a/index.mjs", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "incorrect exports field #1", - // We throw `PackageImportNotDefined` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "/utils/": "./a/" - })), - request: "#a/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #2", - // We throw `PackageImportNotDefined` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "/utils/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#a/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #3", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index": "./a/index.js" - })), - request: "#a/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #4", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index.mjs": "./a/index.js" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #5", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "#a/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #6", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index.mjs": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "#a/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #1", - // We don't throw in `package_imports_exports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": "./a/" - })), - request: "/utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect request #2", - // We don't throw in `package_imports_exports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #3", - // We don't throw in `package_imports_exports_resolve`, it's thrown in `package_imports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #4", - // We don't throw in `package_imports_exports_resolve`, it's thrown in `package_imports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#/", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #5", - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#a/", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #1", - // expect: Some(vec!["./dist/index"]), - expect: Some(vec!["dist/index"]), - imports_field: imports_field(json!({ - "#a/../../utils/": "./dist/" - })), - request: "#a/../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #2", - // We throw InvalidPackageTarget - // expect: Some(vec!["./dist/../../utils/index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "./dist/" - })), - request: "#a/../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #3", - // We throw InvalidPackageTarget - // expect: Some(vec!["../src/index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "../src/" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #4", - // We throw InvalidPackageTarget - // expect: Some(vec!["./utils/../../../index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": { - "browser": "./utils/../../../" - } - })), - request: "#a/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #1", - // expect: Some(vec!["moment/node_modules/lodash/dist/index.js"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": { - "browser": "moment/node_modules/" - } - })), - request: "#a/lodash/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #2", - // We throw InvalidPackageTarget - // expect: Some(vec!["../node_modules/lodash/dist/index.js"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "../node_modules/" - })), - request: "#a/lodash/dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "nested mapping #1", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": "./", - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./node/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "nested mapping #3", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["webpack"], - }, - TestCase { - name: "nested mapping #4", - // We throw NotFound - // expect: Some(vec!["moment/node/index.js"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "moment/node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["node", "browser"], - }, - TestCase { - name: "nested mapping #5", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "node"], - }, - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./node/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - TestCase { - name: "nested mapping #7", - expect: Some(vec!["./y.js"]), - imports_field: imports_field(json!({ - "#a": { - "abc": { - "def": "./x.js" - }, - "ghi": "./y.js" - } - })), - request: "#a", - condition_names: vec!["abc", "ghi"], - }, - TestCase { - name: "nested mapping #8", - // We throw PackageImportNotDefined - // expect: Some(vec![]), - expect: None, - imports_field: imports_field(json!({ - "#a": { - "abc": { - "def": "./x.js", - "default": [] - }, - "ghi": "./y.js" - } - })), - request: "#a", - condition_names: vec!["abc", "ghi"], - }, - ]; - - for case in test_cases { - let resolved = Resolver::default() - .package_imports_exports_resolve( - case.request, - &case.imports_field, - Path::new(""), - true, - &case.condition_names.iter().map(ToString::to_string).collect::>(), - &mut Ctx::default(), - ) - .map(|p| p.map(|p| p.to_path_buf())); - if let Some(expect) = case.expect { - if expect.is_empty() { - assert!(matches!(resolved, Ok(None)), "{} {:?}", &case.name, &resolved); - } else { - for expect in expect { - assert_eq!(resolved, Ok(Some(Path::new(expect).normalize())), "{}", &case.name); - } - } - } else { - assert!(resolved.is_err(), "{} {resolved:?}", &case.name); - } - } -} diff --git a/src/tests/incorrect_description_file.rs b/src/tests/incorrect_description_file.rs deleted file mode 100644 index e2caecbb..00000000 --- a/src/tests/incorrect_description_file.rs +++ /dev/null @@ -1,65 +0,0 @@ -//! - -use rustc_hash::FxHashSet; - -use crate::{JSONError, Resolution, ResolveContext, ResolveError, ResolveOptions, Resolver}; - -// should not resolve main in incorrect description file #1 -#[test] -fn incorrect_description_file_1() { - let f = super::fixture().join("incorrect-package"); - let mut ctx = ResolveContext::default(); - let resolution = Resolver::default().resolve_with_context(f.join("pack1"), ".", &mut ctx); - let error = ResolveError::JSON(JSONError { - path: f.join("pack1/package.json"), - message: String::from("EOF while parsing a value at line 3 column 0"), - line: 3, - column: 0, - }); - assert_eq!(resolution, Err(error)); - assert_eq!( - ctx.file_dependencies, - FxHashSet::from_iter([f.join("pack1"), f.join("pack1/package.json")]) - ); - assert!(!ctx.missing_dependencies.is_empty()); -} - -// should not resolve main in incorrect description file #2 -#[test] -fn incorrect_description_file_2() { - let f = super::fixture().join("incorrect-package"); - let resolution = Resolver::default().resolve(f.join("pack2"), "."); - let error = ResolveError::JSON(JSONError { - path: f.join("pack2/package.json"), - message: String::from("EOF while parsing a value at line 1 column 0"), - line: 1, - column: 0, - }); - assert_eq!(resolution, Err(error)); -} - -// should not resolve main in incorrect description file #3 -#[test] -fn incorrect_description_file_3() { - let f = super::fixture().join("incorrect-package"); - let resolution = Resolver::default().resolve(f.join("pack2"), "."); - assert!(resolution.is_err()); -} - -// `enhanced_resolve` does not have this test case -#[test] -fn no_description_file() { - let f = super::fixture_root().join("enhanced_resolve"); - - // has description file - let resolver = Resolver::default(); - assert_eq!( - resolver.resolve(&f, ".").map(Resolution::into_path_buf), - Ok(f.join("lib/index.js")) - ); - - // without description file - let resolver = - Resolver::new(ResolveOptions { description_files: vec![], ..ResolveOptions::default() }); - assert_eq!(resolver.resolve(&f, "."), Err(ResolveError::NotFound(".".into()))); -} diff --git a/src/tests/main_field.rs b/src/tests/main_field.rs deleted file mode 100644 index 3cadc8ce..00000000 --- a/src/tests/main_field.rs +++ /dev/null @@ -1,24 +0,0 @@ -//! Not part of enhanced_resolve's test suite - -use crate::{ResolveOptions, Resolver}; - -#[test] -fn test() { - let f = super::fixture().join("restrictions"); - - let resolver1 = Resolver::new(ResolveOptions { - main_fields: vec!["style".into()], - ..ResolveOptions::default() - }); - - let resolution = resolver1.resolve(&f, "pck2").map(|r| r.full_path()); - assert_eq!(resolution, Ok(f.join("node_modules/pck2/index.css"))); - - let resolver2 = resolver1.clone_with_options(ResolveOptions { - main_fields: vec!["module".into(), "main".into()], - ..ResolveOptions::default() - }); - - let resolution = resolver2.resolve(&f, "pck2").map(|r| r.full_path()); - assert_eq!(resolution, Ok(f.join("node_modules/pck2/module.js"))); -} diff --git a/src/tests/memory_fs.rs b/src/tests/memory_fs.rs deleted file mode 100644 index e4116609..00000000 --- a/src/tests/memory_fs.rs +++ /dev/null @@ -1,74 +0,0 @@ -use std::{ - io, - path::{Path, PathBuf}, -}; - -use crate::{FileMetadata, FileSystem}; - -#[derive(Default)] -pub struct MemoryFS { - fs: vfs::MemoryFS, -} - -impl MemoryFS { - /// # Panics - /// - /// * Fails to create directory - /// * Fails to write file - #[allow(dead_code)] - pub fn new(data: &[(&'static str, &'static str)]) -> Self { - let mut fs = Self { fs: vfs::MemoryFS::default() }; - for (path, content) in data { - fs.add_file(Path::new(path), content); - } - fs - } - - #[allow(dead_code)] - pub fn add_file(&mut self, path: &Path, content: &str) { - use vfs::FileSystem; - let fs = &mut self.fs; - // Create all parent directories - for path in path.ancestors().collect::>().iter().rev() { - let path = path.to_string_lossy(); - if !fs.exists(path.as_ref()).unwrap() { - fs.create_dir(path.as_ref()).unwrap(); - } - } - // Create file - let mut file = fs.create_file(path.to_string_lossy().as_ref()).unwrap(); - file.write_all(content.as_bytes()).unwrap(); - } -} - -impl FileSystem for MemoryFS { - fn read_to_string(&self, path: &Path) -> io::Result { - use vfs::FileSystem; - let mut file = self - .fs - .open_file(path.to_string_lossy().as_ref()) - .map_err(|err| io::Error::new(io::ErrorKind::NotFound, err))?; - let mut buffer = String::new(); - file.read_to_string(&mut buffer).unwrap(); - Ok(buffer) - } - - fn metadata(&self, path: &Path) -> io::Result { - use vfs::FileSystem; - let metadata = self - .fs - .metadata(path.to_string_lossy().as_ref()) - .map_err(|err| io::Error::new(io::ErrorKind::NotFound, err))?; - let is_file = metadata.file_type == vfs::VfsFileType::File; - let is_dir = metadata.file_type == vfs::VfsFileType::Directory; - Ok(FileMetadata::new(is_file, is_dir, false)) - } - - fn symlink_metadata(&self, path: &Path) -> io::Result { - self.metadata(path) - } - - fn canonicalize(&self, _path: &Path) -> io::Result { - Err(io::Error::new(io::ErrorKind::NotFound, "not a symlink")) - } -} diff --git a/src/tests/missing.rs b/src/tests/missing.rs deleted file mode 100644 index 4bf611ef..00000000 --- a/src/tests/missing.rs +++ /dev/null @@ -1,106 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/missing.test.js - -use normalize_path::NormalizePath; - -use crate::{AliasValue, ResolveContext, ResolveOptions, Resolver}; - -#[test] -fn test() { - let f = super::fixture(); - - let data = [ - ( - "./missing-file", - vec![f.join("missing-file"), f.join("missing-file.js"), f.join("missing-file.node")], - ), - ( - "missing-module", - vec![ - f.join("node_modules/missing-module"), - f.parent().unwrap().join("node_modules"), // enhanced-resolve is "node_modules/missing-module" - ], - ), - ( - "missing-module/missing-file", - vec![ - f.join("node_modules/missing-module"), - // f.parent().unwrap().join("node_modules/missing-module"), // we don't report this - ], - ), - ( - "m1/missing-file", - vec![ - f.join("node_modules/m1/missing-file"), - f.join("node_modules/m1/missing-file.js"), - f.join("node_modules/m1/missing-file.node"), - // f.parent().unwrap().join("node_modules/m1"), // we don't report this - ], - ), - ( - "m1/", - vec![ - f.join("node_modules/m1/index"), - f.join("node_modules/m1/index.js"), - f.join("node_modules/m1/index.json"), - f.join("node_modules/m1/index.node"), - ], - ), - ("m1/a", vec![f.join("node_modules/m1/a")]), - ]; - - let resolver = Resolver::default(); - - for (specifier, missing_dependencies) in data { - let mut ctx = ResolveContext::default(); - let _ = resolver.resolve_with_context(&f, specifier, &mut ctx); - - for path in ctx.file_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - } - - for path in missing_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - assert!( - ctx.missing_dependencies.contains(&path), - "{specifier}: {path:?} not in {:?}", - &ctx.missing_dependencies - ); - } - } -} - -#[test] -fn alias_and_extensions() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias: vec![ - ( - "@scope-js/package-name/dir$".into(), - vec![AliasValue::Path(f.join("foo/index.js").to_string_lossy().to_string())], - ), - ( - "react-dom".into(), - vec![AliasValue::Path(f.join("foo/index.js").to_string_lossy().to_string())], - ), - ], - extensions: vec![".server.ts".into()], - - ..ResolveOptions::default() - }); - - let mut ctx = ResolveContext::default(); - let _ = resolver.resolve_with_context(&f, "@scope-js/package-name/dir/router", &mut ctx); - let _ = resolver.resolve_with_context(&f, "react-dom/client", &mut ctx); - - for path in ctx.file_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - } - - for path in ctx.missing_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - if let Some(path) = path.parent() { - assert!(!path.is_file(), "{path:?} must not be a file"); - } - } -} diff --git a/src/tests/mod.rs b/src/tests/mod.rs deleted file mode 100644 index e347dd1f..00000000 --- a/src/tests/mod.rs +++ /dev/null @@ -1,51 +0,0 @@ -mod alias; -mod browser_field; -mod builtins; -mod dependencies; -mod exports_field; -mod extension_alias; -mod extensions; -mod fallback; -mod full_specified; -mod imports_field; -mod incorrect_description_file; -mod main_field; -mod memory_fs; -mod missing; -#[cfg(feature = "yarn_pnp")] -mod pnp; -mod resolve; -mod restrictions; -mod roots; -mod scoped_packages; -mod simple; -mod symlink; -mod tsconfig_paths; -mod tsconfig_project_references; - -use crate::Resolver; -use std::{env, path::PathBuf, sync::Arc, thread}; - -pub fn fixture_root() -> PathBuf { - env::current_dir().unwrap().join("fixtures") -} - -pub fn fixture() -> PathBuf { - fixture_root().join("enhanced_resolve").join("test").join("fixtures") -} - -#[test] -fn threaded_environment() { - let cwd = env::current_dir().unwrap(); - let resolver = Arc::new(Resolver::default()); - for _ in 0..2 { - _ = thread::spawn({ - let cwd = cwd.clone(); - let resolver = Arc::clone(&resolver); - move || { - _ = resolver.resolve(cwd, "."); - } - }) - .join(); - } -} diff --git a/src/tests/pnp.rs b/src/tests/pnp.rs deleted file mode 100644 index 1562a009..00000000 --- a/src/tests/pnp.rs +++ /dev/null @@ -1,45 +0,0 @@ -//! Not part of enhanced_resolve's test suite -//! -//! enhanced_resolve's test -//! cannot be ported over because it uses mocks on `pnpApi` provided by the runtime. - -use crate::{ResolveOptions, Resolver}; - -#[test] -fn pnp1() { - let fixture = super::fixture_root().join("pnp"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - pnp_manifest: Some(pnp::load_pnp_manifest(fixture.join(".pnp.cjs")).unwrap()), - ..ResolveOptions::default() - }); - - assert_eq!( - resolver.resolve(&fixture, "is-even").map(|r| r.full_path()), - Ok(fixture.join( - ".yarn/cache/is-even-npm-1.0.0-9f726520dc-2728cc2f39.zip/node_modules/is-even/index.js" - )) - ); - - assert_eq!( - resolver - .resolve( - &fixture.join( - ".yarn/cache/is-even-npm-1.0.0-9f726520dc-2728cc2f39.zip/node_modules/is-even" - ), - "is-odd" - ) - .map(|r| r.full_path()), - Ok(fixture.join( - ".yarn/cache/is-odd-npm-0.1.2-9d980a9da8-7dc6c6fd00.zip/node_modules/is-odd/index.js" - )), - ); - - assert_eq!( - resolver.resolve(&fixture, "is-odd").map(|r| r.full_path()), - Ok(fixture.join( - ".yarn/cache/is-odd-npm-3.0.1-93c3c3f41b-89ee2e353c.zip/node_modules/is-odd/index.js" - )), - ); -} diff --git a/src/tests/resolve.rs b/src/tests/resolve.rs deleted file mode 100644 index f2dbb88e..00000000 --- a/src/tests/resolve.rs +++ /dev/null @@ -1,119 +0,0 @@ -//! - -use crate::{ResolveError, ResolveOptions, Resolver}; - -#[test] -fn resolve() { - let f = super::fixture(); - - let resolver = Resolver::default(); - - let main1_js_path = f.join("main1.js").to_string_lossy().to_string(); - - #[rustfmt::skip] - let pass = [ - ("absolute path", f.clone(), main1_js_path.as_str(), f.join("main1.js")), - ("file with .js", f.clone(), "./main1.js", f.join("main1.js")), - ("file without extension", f.clone(), "./main1", f.join("main1.js")), - ("another file with .js", f.clone(), "./a.js", f.join("a.js")), - ("another file without extension", f.clone(), "./a", f.join("a.js")), - ("file in module with .js", f.clone(), "m1/a.js", f.join("node_modules/m1/a.js")), - ("file in module without extension", f.clone(), "m1/a", f.join("node_modules/m1/a.js")), - ("another file in module without extension", f.clone(), "complexm/step1", f.join("node_modules/complexm/step1.js")), - ("from submodule to file in sibling module", f.join("node_modules/complexm"), "m2/b.js", f.join("node_modules/m2/b.js")), - ("from nested directory to overwritten file in module", f.join("multiple_modules"), "m1/a.js", f.join("multiple_modules/node_modules/m1/a.js")), - ("from nested directory to not overwritten file in module", f.join("multiple_modules"), "m1/b.js", f.join("node_modules/m1/b.js")), - ("file with query", f.clone(), "./main1.js?query", f.join("main1.js?query")), - ("file with fragment", f.clone(), "./main1.js#fragment", f.join("main1.js#fragment")), - ("file with fragment and query", f.clone(), "./main1.js#fragment?query", f.join("main1.js#fragment?query")), - ("file with query and fragment", f.clone(), "./main1.js?#fragment", f.join("main1.js?#fragment")), - - ("file with query (unicode)", f.clone(), "./测试.js?query", f.join("测试.js?query")), - ("file with fragment (unicode)", f.clone(), "./测试.js#fragment", f.join("测试.js#fragment")), - ("file with fragment and query (unicode)", f.clone(), "./测试.js#fragment?query", f.join("测试.js#fragment?query")), - ("file with query and fragment (unicode)", f.clone(), "./测试.js?#fragment", f.join("测试.js?#fragment")), - - ("file in module with query", f.clone(), "m1/a?query", f.join("node_modules/m1/a.js?query")), - ("file in module with fragment", f.clone(), "m1/a#fragment", f.join("node_modules/m1/a.js#fragment")), - ("file in module with fragment and query", f.clone(), "m1/a#fragment?query", f.join("node_modules/m1/a.js#fragment?query")), - ("file in module with query and fragment", f.clone(), "m1/a?#fragment", f.join("node_modules/m1/a.js?#fragment")), - ("file in module with query and fragment", f.clone(), "m1/a?#fragment", f.join("node_modules/m1/a.js?#fragment")), - ("differ between directory and file, resolve file", f.clone(), "./dirOrFile", f.join("dirOrFile.js")), - ("differ between directory and file, resolve directory", f.clone(), "./dirOrFile/", f.join("dirOrFile/index.js")), - ("find node_modules outside of node_modules", f.join("browser-module/node_modules"), "m1/a", f.join("node_modules/m1/a.js")), - ("don't crash on main field pointing to self", f.clone(), "./main-field-self", f.join("./main-field-self/index.js")), - ("don't crash on main field pointing to self (2)", f.clone(), "./main-field-self2", f.join("./main-field-self2/index.js")), - // enhanced-resolve has `#` prepended with a `\0`, they are removed from the - // following 3 expected test results. - // See https://github.com/webpack/enhanced-resolve#escaping - ("handle fragment edge case (no fragment)", f.clone(), "./no#fragment/#/#", f.join("no#fragment/#/#.js")), - ("handle fragment edge case (fragment)", f.clone(), "./no#fragment/#/", f.join("no.js#fragment/#/")), - ("handle fragment escaping", f.clone(), "./no\0#fragment/\0#/\0##fragment", f.join("no#fragment/#/#.js#fragment")), - - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn issue238_resolve() { - let f = super::fixture().join("issue-238"); - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into(), ".jsx".into(), ".ts".into(), ".tsx".into()], - modules: vec!["src/a".into(), "src/b".into(), "src/common".into(), "node_modules".into()], - ..ResolveOptions::default() - }); - let resolved_path = - resolver.resolve(f.join("src/common"), "config/myObjectFile").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("src/common/config/myObjectFile.js")),); -} - -#[test] -fn prefer_relative() { - let f = super::fixture(); - - let resolver = - Resolver::new(ResolveOptions { prefer_relative: true, ..ResolveOptions::default() }); - - #[rustfmt::skip] - let pass = [ - ("should correctly resolve with preferRelative 1", "main1.js", f.join("main1.js")), - ("should correctly resolve with preferRelative 2", "m1/a.js", f.join("node_modules/m1/a.js")), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } -} - -#[test] -fn resolve_to_context() { - let f = super::fixture(); - let resolver = - Resolver::new(ResolveOptions { resolve_to_context: true, ..ResolveOptions::default() }); - - #[rustfmt::skip] - let data = [ - ("context for fixtures", f.clone(), "./", f.clone()), - ("context for fixtures/lib", f.clone(), "./lib", f.join("lib")), - ("context for fixtures with ..", f.clone(), "./lib/../../fixtures/./lib/..", f.clone()), - ("context for fixtures with query", f.clone(), "./?query", f.clone().with_file_name("fixtures?query")), - ]; - - for (comment, path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn resolve_hash_as_module() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions::default()); - let resolution = resolver.resolve(f, "#a"); - assert_eq!(resolution, Err(ResolveError::NotFound("#a".into()))); -} diff --git a/src/tests/restrictions.rs b/src/tests/restrictions.rs deleted file mode 100644 index 5ba56596..00000000 --- a/src/tests/restrictions.rs +++ /dev/null @@ -1,25 +0,0 @@ -//! - -use crate::{ResolveError, ResolveOptions, Resolver, Restriction}; - -// TODO: regex -// * should respect RegExp restriction -// * should try to find alternative #1 -// * should try to find alternative #2 -// * should try to find alternative #3 - -// should respect string restriction -#[test] -fn restriction1() { - let fixture = super::fixture(); - let f = fixture.join("restrictions"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - restrictions: vec![Restriction::Path(f.clone())], - ..ResolveOptions::default() - }); - - let resolution = resolver.resolve(&f, "pck2"); - assert_eq!(resolution, Err(ResolveError::Restriction(fixture.join("c.js"), f))); -} diff --git a/src/tests/roots.rs b/src/tests/roots.rs deleted file mode 100644 index b50e2a07..00000000 --- a/src/tests/roots.rs +++ /dev/null @@ -1,92 +0,0 @@ -//! - -use std::path::PathBuf; - -use crate::{AliasValue, ResolveError, ResolveOptions, Resolver}; - -fn dirname() -> PathBuf { - super::fixture_root().join("enhanced_resolve").join("test") -} - -#[test] -fn roots() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - alias: vec![("foo".into(), vec![AliasValue::from("/fixtures")])], - roots: vec![dirname(), f.clone()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should respect roots option", "/fixtures/b.js", f.join("b.js")), - ("should try another root option, if it exists", "/b.js", f.join("b.js")), - ("should respect extension", "/fixtures/b", f.join("b.js")), - ("should resolve in directory", "/fixtures/extensions/dir", f.join("extensions/dir/index.js")), - ("should respect aliases", "foo/b", f.join("b.js")), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } - - #[rustfmt::skip] - let fail = [ - ("should not work with relative path", "fixtures/b.js", ResolveError::NotFound("fixtures/b.js".into())) - ]; - - for (comment, request, expected) in fail { - let resolution = resolver.resolve(&f, request); - assert_eq!(resolution, Err(expected), "{comment} {request}"); - } -} - -#[test] -fn resolve_to_context() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - roots: vec![dirname(), f.clone()], - resolve_to_context: true, - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f, "/fixtures/lib").map(|r| r.full_path()); - let expected = f.join("lib"); - assert_eq!(resolved_path, Ok(expected)); -} - -#[test] -fn prefer_absolute() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - alias: vec![("foo".into(), vec![AliasValue::from("/fixtures")])], - roots: vec![dirname(), f.clone()], - prefer_absolute: true, - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve an absolute path (prefer absolute)", f.join("b.js").to_string_lossy().to_string(), f.join("b.js")), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(&f, &request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } -} - -#[test] -fn roots_fall_through() { - let f = super::fixture(); - let absolute_path = f.join("roots_fall_through/index.js"); - let specifier = absolute_path.to_string_lossy(); - let resolution = Resolver::new(ResolveOptions::default().with_root(&f)).resolve(&f, &specifier); - assert_eq!( - resolution.map(super::super::resolution::Resolution::into_path_buf), - Ok(absolute_path) - ); -} diff --git a/src/tests/scoped_packages.rs b/src/tests/scoped_packages.rs deleted file mode 100644 index 8258f00f..00000000 --- a/src/tests/scoped_packages.rs +++ /dev/null @@ -1,25 +0,0 @@ -//! - -use crate::{ResolveOptions, Resolver}; - -#[test] -fn scoped_packages() { - let f = super::fixture().join("scoped"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("main field should work", f.clone(), "@scope/pack1", f.join("./node_modules/@scope/pack1/main.js")), - ("browser field should work", f.clone(), "@scope/pack2", f.join("./node_modules/@scope/pack2/main.js")), - ("folder request should work", f.clone(), "@scope/pack2/lib", f.join("./node_modules/@scope/pack2/lib/index.js")) - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} diff --git a/src/tests/simple.rs b/src/tests/simple.rs deleted file mode 100644 index 08e1238a..00000000 --- a/src/tests/simple.rs +++ /dev/null @@ -1,68 +0,0 @@ -//! - -use std::env; - -use crate::Resolver; - -#[test] -fn simple() { - // mimic `enhanced-resolve/test/simple.test.js` - let dirname = env::current_dir().unwrap().join("fixtures"); - let f = dirname.join("enhanced_resolve/test"); - - let resolver = Resolver::default(); - - let data = [ - ("direct", f.clone(), "../lib/index"), - ("as directory", f, ".."), - ("as module", dirname.clone(), "./enhanced_resolve"), - ]; - - for (comment, path, request) in data { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - let expected = dirname.join("enhanced_resolve/lib/index.js"); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn dashed_name() { - let f = super::fixture(); - - let resolver = Resolver::default(); - - let data = [ - (f.clone(), "dash", f.join("node_modules/dash/index.js")), - (f.clone(), "dash-name", f.join("node_modules/dash-name/index.js")), - (f.join("node_modules/dash"), "dash", f.join("node_modules/dash/index.js")), - (f.join("node_modules/dash"), "dash-name", f.join("node_modules/dash-name/index.js")), - (f.join("node_modules/dash-name"), "dash", f.join("node_modules/dash/index.js")), - (f.join("node_modules/dash-name"), "dash-name", f.join("node_modules/dash-name/index.js")), - ]; - - for (path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{path:?} {request}"); - } -} - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows { - use super::super::memory_fs::MemoryFS; - - use crate::ResolveOptions; - - #[test] - fn no_package() { - use crate::ResolverGeneric; - use std::path::Path; - let f = Path::new("/"); - let file_system = MemoryFS::new(&[]); - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions::default(), - ); - let resolved_path = resolver.resolve(f, "package"); - assert!(resolved_path.is_err()); - } -} diff --git a/src/tests/symlink.rs b/src/tests/symlink.rs deleted file mode 100644 index 7589b560..00000000 --- a/src/tests/symlink.rs +++ /dev/null @@ -1,121 +0,0 @@ -use std::{fs, io, path::Path}; - -use crate::{ResolveOptions, Resolver}; - -#[derive(Debug, Clone, Copy)] -enum FileType { - File, - Dir, -} - -#[allow(unused_variables)] -fn symlink, Q: AsRef>( - original: P, - link: Q, - file_type: FileType, -) -> io::Result<()> { - #[cfg(target_family = "unix")] - { - std::os::unix::fs::symlink(original, link) - } - - #[cfg(target_family = "windows")] - match file_type { - FileType::File => std::os::windows::fs::symlink_file(original, link), - FileType::Dir => std::os::windows::fs::symlink_dir(original, link), - } -} - -fn init(dirname: &Path, temp_path: &Path) -> io::Result<()> { - if temp_path.exists() { - _ = fs::remove_dir_all(temp_path); - } - fs::create_dir(temp_path)?; - symlink(dirname.join("../lib/index.js"), temp_path.join("test"), FileType::File)?; - symlink(dirname.join("../lib"), temp_path.join("test2"), FileType::Dir)?; - fs::remove_file(temp_path.join("test"))?; - fs::remove_file(temp_path.join("test2"))?; - fs::remove_dir(temp_path) -} - -fn create_symlinks(dirname: &Path, temp_path: &Path) -> io::Result<()> { - fs::create_dir(temp_path).unwrap(); - symlink( - dirname.join("../lib/index.js").canonicalize().unwrap(), - temp_path.join("index.js"), - FileType::File, - )?; - symlink(dirname.join("../lib").canonicalize().unwrap(), temp_path.join("lib"), FileType::Dir)?; - symlink(dirname.join("..").canonicalize().unwrap(), temp_path.join("this"), FileType::Dir)?; - symlink(temp_path.join("this"), temp_path.join("that"), FileType::Dir)?; - symlink(Path::new("../../lib/index.js"), temp_path.join("node.relative.js"), FileType::File)?; - symlink( - Path::new("./node.relative.js"), - temp_path.join("node.relative.sym.js"), - FileType::File, - )?; - Ok(()) -} - -fn cleanup_symlinks(temp_path: &Path) { - _ = fs::remove_dir_all(temp_path); -} - -#[test] -fn test() -> io::Result<()> { - let root = super::fixture_root().join("enhanced_resolve"); - let dirname = root.join("test"); - let temp_path = dirname.join("temp"); - if !temp_path.exists() { - let is_admin = init(&dirname, &temp_path).is_ok(); - if !is_admin { - return Ok(()); - } - if let Err(err) = create_symlinks(&dirname, &temp_path) { - cleanup_symlinks(&temp_path); - return Err(err); - } - } - - let resolver_without_symlinks = - Resolver::new(ResolveOptions { symlinks: false, ..ResolveOptions::default() }); - let resolver_with_symlinks = Resolver::default(); - - #[rustfmt::skip] - let pass = [ - ("with a symlink to a file", temp_path.clone(), "./index.js"), - ("with a relative symlink to a file", temp_path.clone(), "./node.relative.js"), - ("with a relative symlink to a symlink to a file", temp_path.clone(), "./node.relative.sym.js"), - ("with a symlink to a directory 1", temp_path.clone(), "./lib/index.js"), - ("with a symlink to a directory 2", temp_path.clone(), "./this/lib/index.js"), - ("with multiple symlinks in the path 1", temp_path.clone(), "./this/test/temp/index.js"), - ("with multiple symlinks in the path 2", temp_path.clone(), "./this/test/temp/lib/index.js"), - ("with multiple symlinks in the path 3", temp_path.clone(), "./this/test/temp/this/lib/index.js"), - ("with a symlink to a directory 2 (chained)", temp_path.clone(), "./that/lib/index.js"), - ("with multiple symlinks in the path 1 (chained)", temp_path.clone(), "./that/test/temp/index.js"), - ("with multiple symlinks in the path 2 (chained)", temp_path.clone(), "./that/test/temp/lib/index.js"), - ("with multiple symlinks in the path 3 (chained)", temp_path.clone(), "./that/test/temp/that/lib/index.js"), - ("with symlinked directory as context 1", temp_path.join( "lib"), "./index.js"), - ("with symlinked directory as context 2", temp_path.join( "this"), "./lib/index.js"), - ("with symlinked directory as context and in path", temp_path.join( "this"), "./test/temp/lib/index.js"), - ("with symlinked directory in context path", temp_path.join( "this/lib"), "./index.js"), - ("with symlinked directory in context path and symlinked file", temp_path.join( "this/test"), "./temp/index.js"), - ("with symlinked directory in context path and symlinked directory", temp_path.join( "this/test"), "./temp/lib/index.js"), - ("with symlinked directory as context 2 (chained)", temp_path.join( "that"), "./lib/index.js"), - ("with symlinked directory as context and in path (chained)", temp_path.join( "that"), "./test/temp/lib/index.js"), - ("with symlinked directory in context path (chained)", temp_path.join( "that/lib"), "./index.js"), - ("with symlinked directory in context path and symlinked file (chained)", temp_path.join( "that/test"), "./temp/index.js"), - ("with symlinked directory in context path and symlinked directory (chained)", temp_path.join( "that/test"), "./temp/lib/index.js") - ]; - - for (comment, path, request) in pass { - let filename = resolver_with_symlinks.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(filename, Ok(root.join("lib/index.js")), "{comment:?}"); - - let resolved_path = - resolver_without_symlinks.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(path.join(request))); - } - - Ok(()) -} diff --git a/src/tests/tsconfig_paths.rs b/src/tests/tsconfig_paths.rs deleted file mode 100644 index b85bf6be..00000000 --- a/src/tests/tsconfig_paths.rs +++ /dev/null @@ -1,530 +0,0 @@ -//! tests for tsconfig-paths -//! -//! Fixtures copied from . - -use std::path::{Path, PathBuf}; - -use crate::{ - JSONError, ResolveError, ResolveOptions, Resolver, TsConfig, TsconfigOptions, - TsconfigReferences, -}; - -// -#[test] -fn tsconfig() { - let f = super::fixture_root().join("tsconfig"); - - #[rustfmt::skip] - let pass = [ - (f.clone(), None, "ts-path", f.join("foo.js")), - (f.join("nested"), None, "ts-path", f.join("nested/test.js")), - (f.join("cases/index"), None, "foo", f.join("node_modules/tsconfig-index/foo.js")), - // This requires reading package.json.tsconfig field - // (f.join("cases/field"), "foo", f.join("node_modules/tsconfig-field/foo.js")) - (f.join("cases/exports"), None, "foo", f.join("node_modules/tsconfig-exports/foo.js")), - (f.join("cases/extends-extension"), None, "foo", f.join("cases/extends-extension/foo.js")), - (f.join("cases/extends-extensionless"), None, "foo", f.join("node_modules/tsconfig-field/foo.js")), - (f.join("cases/extends-paths"), Some("src"), "@/index", f.join("cases/extends-paths/src/index.js")), - (f.join("cases/extends-multiple"), None, "foo", f.join("cases/extends-multiple/foo.js")), - ]; - - for (dir, subdir, request, expected) in pass { - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: dir.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - let path = subdir.map_or(dir.clone(), |subdir| dir.join(subdir)); - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{request} {path:?}"); - } - - #[rustfmt::skip] - let data = [ - (f.join("node_modules/tsconfig-not-used"), "ts-path", Ok(f.join("foo.js"))), - ]; - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - for (path, request, expected) in data { - let resolution = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolution, expected, "{path:?} {request}"); - } -} - -#[test] -fn tsconfig_fallthrough() { - let f = super::fixture_root().join("tsconfig"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "/"); - assert_eq!(resolved_path, Err(ResolveError::NotFound("/".into()))); -} - -#[test] -fn json_with_comments() { - let f = super::fixture_root().join("tsconfig/cases/trailing-comma"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "foo").map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(f.join("bar.js"))); -} - -#[test] -fn broken() { - let f = super::fixture_root().join("tsconfig"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("tsconfig_broken.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "/"); - let error = ResolveError::JSON(JSONError { - path: f.join("tsconfig_broken.json"), - message: String::from("EOF while parsing an object at line 2 column 0"), - line: 2, - column: 0, - }); - assert_eq!(resolved_path, Err(error)); -} - -// -#[test] -fn test_paths() { - let path = Path::new("/foo/tsconfig.json"); - let mut tsconfig_json = serde_json::json!({ - "compilerOptions": { - "paths": { - "jquery": ["node_modules/jquery/dist/jquery"], - "*": ["generated/*"], - "bar/*": ["test/*"], - "bar/baz/*": ["baz/*", "yo/*"], - "@/components/*": ["components/*"], - "url": ["node_modules/my-url"], - } - } - }) - .to_string(); - let tsconfig = TsConfig::parse(true, path, &mut tsconfig_json).unwrap(); - - let data = [ - ("jquery", vec!["/foo/node_modules/jquery/dist/jquery"]), - ("test", vec!["/foo/generated/test"]), - ("test/hello", vec!["/foo/generated/test/hello"]), - ("bar/hi", vec!["/foo/test/hi"]), - ("bar/baz/hi", vec!["/foo/baz/hi", "/foo/yo/hi"]), - ("@/components/button", vec!["/foo/components/button"]), - ("./jquery", vec![]), - ("url", vec!["/foo/node_modules/my-url"]), - ]; - - for (specifier, expected) in data { - let paths = tsconfig.resolve_path_alias(specifier); - let expected = expected.into_iter().map(PathBuf::from).collect::>(); - assert_eq!(paths, expected, "{specifier}"); - } -} - -// -#[test] -fn test_base_url() { - let path = Path::new("/foo/tsconfig.json"); - let mut tsconfig_json = serde_json::json!({ - "compilerOptions": { - "baseUrl": "./src" - } - }) - .to_string(); - let tsconfig = TsConfig::parse(true, path, &mut tsconfig_json).unwrap(); - - let data = [ - ("foo", vec!["/foo/src/foo"]), - ("components/button", vec!["/foo/src/components/button"]), - ("./jquery", vec![]), - ]; - - for (specifier, expected) in data { - let paths = tsconfig.resolve_path_alias(specifier); - let expected = expected.into_iter().map(PathBuf::from).collect::>(); - assert_eq!(paths, expected, "{specifier}"); - } -} - -// -#[test] -fn test_paths_and_base_url() { - let path = Path::new("/foo/tsconfig.json"); - let mut tsconfig_json = serde_json::json!({ - "compilerOptions": { - "baseUrl": "./src", - "paths": { - "*": ["generated/*"], - "bar/*": ["test/*"], - "bar/baz/*": ["baz/*", "yo/*"], - "@/components/*": ["components/*"] - } - } - }) - .to_string(); - let tsconfig = TsConfig::parse(true, path, &mut tsconfig_json).unwrap(); - - let data = [ - ("test", vec!["/foo/src/generated/test", "/foo/src/test"]), - ("test/hello", vec!["/foo/src/generated/test/hello", "/foo/src/test/hello"]), - ("bar/hi", vec!["/foo/src/test/hi", "/foo/src/bar/hi"]), - ("bar/baz/hi", vec!["/foo/src/baz/hi", "/foo/src/yo/hi", "/foo/src/bar/baz/hi"]), - ("@/components/button", vec!["/foo/src/components/button", "/foo/src/@/components/button"]), - ("./jquery", vec![]), - ]; - - for (specifier, expected) in data { - let paths = tsconfig.resolve_path_alias(specifier); - let expected = expected.into_iter().map(PathBuf::from).collect::>(); - assert_eq!(paths, expected, "{specifier}"); - } -} - -// Template variable ${configDir} for substitution of config files directory path -// https://github.com/microsoft/TypeScript/pull/58042 -#[test] -fn test_template_variable() { - let f = super::fixture_root().join("tsconfig"); - let f2 = f.join("cases").join("paths_template_variable"); - - #[rustfmt::skip] - let pass = [ - (f2.clone(), "tsconfig1.json", "foo", f2.join("foo.js")), - (f2.clone(), "tsconfig2.json", "foo", f2.join("foo.js")), - (f.clone(), "tsconfig_template_variable.json", "foo", f.join("foo.js")), - ]; - - for (dir, tsconfig, request, expected) in pass { - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: dir.join(tsconfig), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&dir, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{request} {tsconfig} {dir:?}"); - } -} - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows_test { - use std::path::{Path, PathBuf}; - - use crate::{ - ResolveError, ResolveOptions, ResolverGeneric, TsconfigOptions, TsconfigReferences, - }; - - use super::super::memory_fs::MemoryFS; - - struct OneTest { - name: &'static str, - tsconfig: String, - package_json: Option<(PathBuf, String)>, - main_fields: Option>, - existing_files: Vec<&'static str>, - requested_module: &'static str, - expected_path: &'static str, - extensions: Vec, - } - - impl Default for OneTest { - fn default() -> Self { - Self { - name: "", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/*": ["location/*"] - } - } - }) - .to_string(), - package_json: None, - main_fields: None, - existing_files: vec![], - requested_module: "", - expected_path: "", - extensions: vec![ - ".js".into(), - ".json".into(), - ".node".into(), - ".ts".into(), - ".tsx".into(), - ], - } - } - } - - impl OneTest { - fn resolver(&self, root: &Path) -> ResolverGeneric { - let mut file_system = MemoryFS::default(); - - file_system.add_file(&root.join("tsconfig.json"), &self.tsconfig); - if let Some((path, package_json)) = &self.package_json { - file_system.add_file(&root.join(path).join("package.json"), package_json); - } - for path in &self.existing_files { - file_system.add_file(Path::new(path), ""); - } - - let mut options = ResolveOptions { - extensions: self.extensions.clone(), - tsconfig: Some(TsconfigOptions { - config_file: root.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }; - if let Some(main_fields) = &self.main_fields { - options.main_fields.clone_from(main_fields); - } - - ResolverGeneric::::new_with_file_system(file_system, options) - } - } - - // Path matching tests from tsconfig-paths - // * - // * - #[test] - fn match_path() { - let pass = [ - OneTest { - name: "should locate path that matches with star and exists", - existing_files: vec!["/root/location/mylib/index.ts"], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve to correct path when many are specified", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/*": ["foo1/*", "foo2/*", "location/*", "foo3/*"], - } - } - }) - .to_string(), - existing_files: vec!["/root/location/mylib/index.ts"], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should locate path that matches with star and prioritize pattern with longest prefix", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "*": ["location/*"], - "lib/*": ["location/*"], - } - } - }) - .to_string(), - existing_files: vec![ - "/root/location/lib/mylib/index.ts", - "/root/location/mylib/index.ts", - ], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should locate path that matches with star and exists with extension", - existing_files: vec![ - "/root/location/mylib.myext", - ], - requested_module: "lib/mylib", - extensions: vec![".js".into(), ".myext".into()], - expected_path: "/root/location/mylib.myext", - ..OneTest::default() - }, - OneTest { - name: "should resolve request with extension specified", - existing_files: vec![ - "/root/location/test.jpg", - ], - requested_module: "lib/test.jpg", - expected_path: "/root/location/test.jpg", - ..OneTest::default() - }, - OneTest { - name: "should locate path that matches without star and exists", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/foo": ["location/foo"] - } - } - }) - .to_string(), - existing_files: vec![ - "/root/location/foo.ts", - ], - requested_module: "lib/foo", - expected_path: "/root/location/foo.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve to parent folder when filename is in subfolder", - existing_files: vec![ - "/root/location/mylib/index.ts", - ], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve from main field in package.json", - package_json: Some((PathBuf::from("/root/location/mylib"), serde_json::json!({ - "main": "./kalle.ts" - }).to_string())), - existing_files: vec![ - "/root/location/mylib/kalle.ts", - ], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/kalle.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve from main field in package.json (js)", - package_json: Some((PathBuf::from("/root/location/mylib.js"), serde_json::json!({ - "main": "./kalle.js" - }).to_string())), - existing_files: vec![ - "/root/location/mylib.js/kalle.js", - ], - extensions: vec![".ts".into(), ".js".into()], - requested_module: "lib/mylib.js", - expected_path: "/root/location/mylib.js/kalle.js", - ..OneTest::default() - }, - OneTest { - name: "should resolve from list of fields by priority in package.json", - main_fields: Some(vec!["missing".into(), "browser".into(), "main".into()]), - package_json: Some((PathBuf::from("/root/location/mylibjs"), serde_json::json!({ - "main": "./main.js", - "browser": "./browser.js" - }).to_string())), - existing_files: vec![ - "/root/location/mylibjs/main.js", - "/root/location/mylibjs/browser.js", - ], - extensions: vec![".ts".into(), ".js".into()], - requested_module: "lib/mylibjs", - expected_path: "/root/location/mylibjs/browser.js", - ..OneTest::default() - }, -OneTest { - name: "should ignore field mappings to missing files in package.json", - main_fields: Some(vec!["browser".into(), "main".into()]), - package_json: Some((PathBuf::from("/root/location/mylibjs"), serde_json::json!({ - "main": "./kalle.js", - "browser": "./nope.js" - }).to_string())), - existing_files: vec![ - "/root/location/mylibjs/kalle.js", - ], - extensions: vec![".ts".into(), ".js".into()], - requested_module: "lib/mylibjs", - expected_path: "/root/location/mylibjs/kalle.js", - ..OneTest::default() - }, - // Tests that are not applicable: - // name: "should resolve nested main fields" - // name: "should ignore advanced field mappings in package.json" - // name: "should resolve to with the help of baseUrl when not explicitly set" - // name: "should not resolve with the help of baseUrl when asked not to" - // name: "should resolve main file with cjs file extension" - OneTest { - name: "should resolve .ts from .js alias", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "@/*": ["src/*"] - } - } - }).to_string(), - existing_files: vec![ - "/root/src/foo.ts", - ], - requested_module: "@/foo", // original data was "@/foo.ts" but I don't get why it is the case? - expected_path: "/root/src/foo.ts", // original data was "/root/src/foo" - ..OneTest::default() - }, - ]; - - let root = PathBuf::from("/root"); - - for test in pass { - let resolved_path = - test.resolver(&root).resolve(&root, test.requested_module).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(PathBuf::from(test.expected_path)), "{}", test.name); - } - - let fail = [ - OneTest { - name: "should not locate path that does not match", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/*": ["location/*"] - } - } - }) - .to_string(), - existing_files: vec!["/root/location/mylib"], - requested_module: "lib/mylibjs", - ..OneTest::default() - }, - OneTest { - name: "should not resolve typings file (index.d.ts)", - existing_files: vec!["/root/location/mylib/index.d.ts"], - requested_module: "lib/mylib", - ..OneTest::default() - }, - ]; - - for test in fail { - let resolved_path = - test.resolver(&root).resolve(&root, test.requested_module).map(|f| f.full_path()); - assert_eq!( - resolved_path, - Err(ResolveError::NotFound(test.requested_module.into())), - "{}", - test.name - ); - } - } -} diff --git a/src/tests/tsconfig_project_references.rs b/src/tests/tsconfig_project_references.rs deleted file mode 100644 index 0d019d27..00000000 --- a/src/tests/tsconfig_project_references.rs +++ /dev/null @@ -1,132 +0,0 @@ -//! Tests for tsconfig project references - -use crate::{ResolveError, ResolveOptions, Resolver, TsconfigOptions, TsconfigReferences}; - -#[test] -fn auto() { - let f = super::fixture_root().join("tsconfig/cases/project_references"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("app"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - // Test normal paths alias - (f.join("app"), "@/index.ts", f.join("app/aliased/index.ts")), - (f.join("app"), "@/../index.ts", f.join("app/index.ts")), - // Test project reference - (f.join("project_a"), "@/index.ts", f.join("project_a/aliased/index.ts")), - (f.join("project_b/src"), "@/index.ts", f.join("project_b/src/aliased/index.ts")), - // Does not have paths alias - (f.join("project_a"), "./index.ts", f.join("project_a/index.ts")), - (f.join("project_c"), "./index.ts", f.join("project_c/index.ts")), - // Template variable - { - let dir = f.parent().unwrap().join("paths_template_variable"); - (dir.clone(), "foo", dir.join("foo.js")) - } - ]; - - for (path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{request} {path:?}"); - } -} - -#[test] -fn disabled() { - let f = super::fixture_root().join("tsconfig/cases/project_references"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("app"), - references: TsconfigReferences::Disabled, - }), - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - // Test normal paths alias - (f.join("app"), "@/index.ts", Ok(f.join("app/aliased/index.ts"))), - (f.join("app"), "@/../index.ts", Ok(f.join("app/index.ts"))), - // Test project reference - (f.join("project_a"), "@/index.ts", Err(ResolveError::NotFound("@/index.ts".into()))), - (f.join("project_b/src"), "@/index.ts", Err(ResolveError::NotFound("@/index.ts".into()))), - // Does not have paths alias - (f.join("project_a"), "./index.ts", Ok(f.join("project_a/index.ts"))), - (f.join("project_c"), "./index.ts", Ok(f.join("project_c/index.ts"))), - ]; - - for (path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, expected, "{request} {path:?}"); - } -} - -#[test] -fn manual() { - let f = super::fixture_root().join("tsconfig/cases/project_references"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("app"), - references: TsconfigReferences::Paths(vec!["../project_a/conf.json".into()]), - }), - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - // Test normal paths alias - (f.join("app"), "@/index.ts", Ok(f.join("app/aliased/index.ts"))), - (f.join("app"), "@/../index.ts", Ok(f.join("app/index.ts"))), - // Test project reference - (f.join("project_a"), "@/index.ts", Ok(f.join("project_a/aliased/index.ts"))), - (f.join("project_b/src"), "@/index.ts", Err(ResolveError::NotFound("@/index.ts".into()))), - // Does not have paths alias - (f.join("project_a"), "./index.ts", Ok(f.join("project_a/index.ts"))), - (f.join("project_c"), "./index.ts", Ok(f.join("project_c/index.ts"))), - ]; - - for (path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, expected, "{request} {path:?}"); - } -} - -#[test] -fn self_reference() { - let f = super::fixture_root().join("tsconfig/cases/project_references"); - - #[rustfmt::skip] - let pass = [ - (f.join("app"), vec!["./tsconfig.json".into()]), - (f.join("app/tsconfig.json"), vec!["./tsconfig.json".into()]), - (f.join("app"), vec![f.join("app")]), - (f.join("app/tsconfig.json"), vec![f.join("app")]), - (f.join("app/tsconfig.json"), vec![f.join("project_b"), f.join("app")]), - ]; - - for (config_file, reference_paths) in pass { - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: config_file.clone(), - references: TsconfigReferences::Paths(reference_paths.clone()), - }), - ..ResolveOptions::default() - }); - let path = f.join("app"); - let resolved_path = resolver.resolve(&path, "@/index.ts").map(|f| f.full_path()); - assert_eq!( - resolved_path, - Err(ResolveError::TsconfigSelfReference(f.join("app/tsconfig.json"))), - "{config_file:?} {reference_paths:?}" - ); - } -} diff --git a/src/tsconfig.rs b/src/tsconfig.rs deleted file mode 100644 index 6a675442..00000000 --- a/src/tsconfig.rs +++ /dev/null @@ -1,223 +0,0 @@ -use std::{ - hash::BuildHasherDefault, - path::{Path, PathBuf}, - sync::Arc, -}; - -use indexmap::IndexMap; -use rustc_hash::FxHasher; -use serde::Deserialize; - -use crate::PathUtil; - -pub type CompilerOptionsPathsMap = IndexMap, BuildHasherDefault>; - -#[derive(Debug, Clone, Eq, PartialEq, Deserialize)] -#[serde(untagged)] -pub enum ExtendsField { - Single(String), - Multiple(Vec), -} - -#[derive(Debug, Deserialize)] -#[serde(rename_all = "camelCase")] -pub struct TsConfig { - /// Whether this is the caller tsconfig. - /// Used for final template variable substitution when all configs are extended and merged. - #[serde(skip)] - root: bool, - - /// Path to `tsconfig.json`. Contains the `tsconfig.json` filename. - #[serde(skip)] - pub(crate) path: PathBuf, - - #[serde(default)] - pub extends: Option, - - #[serde(default)] - pub compiler_options: CompilerOptions, - - /// Bubbled up project references with a reference to their tsconfig. - #[serde(default)] - pub references: Vec, -} - -/// Compiler Options -/// -/// -#[derive(Debug, Default, Deserialize)] -#[serde(rename_all = "camelCase")] -pub struct CompilerOptions { - base_url: Option, - - /// Path aliases - paths: Option, - - /// The actual base for where path aliases are resolved from. - #[serde(skip)] - paths_base: PathBuf, -} - -/// Project Reference -/// -/// -#[derive(Debug, Deserialize)] -pub struct ProjectReference { - /// The path property of each reference can point to a directory containing a tsconfig.json file, - /// or to the config file itself (which may have any name). - pub path: PathBuf, - - /// Reference to the resolved tsconfig - #[serde(skip)] - pub tsconfig: Option>, -} - -impl TsConfig { - pub fn parse(root: bool, path: &Path, json: &mut str) -> Result { - _ = json_strip_comments::strip(json); - let mut tsconfig: Self = serde_json::from_str(json)?; - tsconfig.root = root; - tsconfig.path = path.to_path_buf(); - let directory = tsconfig.directory().to_path_buf(); - if let Some(base_url) = tsconfig.compiler_options.base_url { - tsconfig.compiler_options.base_url = Some(directory.normalize_with(base_url)); - } - if tsconfig.compiler_options.paths.is_some() { - tsconfig.compiler_options.paths_base = - tsconfig.compiler_options.base_url.as_ref().map_or(directory, Clone::clone); - } - Ok(tsconfig) - } - - pub fn build(mut self) -> Self { - if self.root { - let dir = self.directory().to_path_buf(); - // Substitute template variable in `tsconfig.compilerOptions.paths` - if let Some(paths) = &mut self.compiler_options.paths { - for paths in paths.values_mut() { - for path in paths { - Self::substitute_template_variable(&dir, path); - } - } - } - } - self - } - - /// Directory to `tsconfig.json` - /// - /// # Panics - /// - /// * When the `tsconfig.json` path is misconfigured. - pub fn directory(&self) -> &Path { - debug_assert!(self.path.file_name().is_some()); - self.path.parent().unwrap() - } - - pub fn extend_tsconfig(&mut self, tsconfig: &Self) { - let compiler_options = &mut self.compiler_options; - if compiler_options.paths.is_none() { - compiler_options.paths_base = compiler_options - .base_url - .as_ref() - .map_or_else(|| tsconfig.compiler_options.paths_base.clone(), Clone::clone); - compiler_options.paths.clone_from(&tsconfig.compiler_options.paths); - } - if compiler_options.base_url.is_none() { - compiler_options.base_url.clone_from(&tsconfig.compiler_options.base_url); - } - } - - pub fn resolve(&self, path: &Path, specifier: &str) -> Vec { - if path.starts_with(self.base_path()) { - let paths = self.resolve_path_alias(specifier); - if !paths.is_empty() { - return paths; - } - } - for tsconfig in self.references.iter().filter_map(|reference| reference.tsconfig.as_ref()) { - if path.starts_with(tsconfig.base_path()) { - return tsconfig.resolve_path_alias(specifier); - } - } - vec![] - } - - // Copied from parcel - // - pub fn resolve_path_alias(&self, specifier: &str) -> Vec { - if specifier.starts_with(['/', '.']) { - return vec![]; - } - - let base_url_iter = self - .compiler_options - .base_url - .as_ref() - .map_or_else(Vec::new, |base_url| vec![base_url.normalize_with(specifier)]); - - let Some(paths_map) = &self.compiler_options.paths else { - return base_url_iter; - }; - - let paths = paths_map.get(specifier).map_or_else( - || { - let mut longest_prefix_length = 0; - let mut longest_suffix_length = 0; - let mut best_key: Option<&String> = None; - - for key in paths_map.keys() { - if let Some((prefix, suffix)) = key.split_once('*') { - if (best_key.is_none() || prefix.len() > longest_prefix_length) - && specifier.starts_with(prefix) - && specifier.ends_with(suffix) - { - longest_prefix_length = prefix.len(); - longest_suffix_length = suffix.len(); - best_key.replace(key); - } - } - } - - best_key.and_then(|key| paths_map.get(key)).map_or_else(Vec::new, |paths| { - paths - .iter() - .map(|path| { - path.replace( - '*', - &specifier[longest_prefix_length - ..specifier.len() - longest_suffix_length], - ) - }) - .collect::>() - }) - }, - Clone::clone, - ); - - paths - .into_iter() - .map(|p| self.compiler_options.paths_base.normalize_with(p)) - .chain(base_url_iter) - .collect() - } - - fn base_path(&self) -> &Path { - self.compiler_options - .base_url - .as_ref() - .map_or_else(|| self.directory(), |path| path.as_ref()) - } - - /// Template variable `${configDir}` for substitution of config files directory path - /// - /// NOTE: All tests cases are just a head replacement of `${configDir}`, so we are constrained as such. - /// - /// See - fn substitute_template_variable(directory: &Path, path: &mut String) { - const TEMPLATE_VARIABLE: &str = "${configDir}/"; - if let Some(stripped_path) = path.strip_prefix(TEMPLATE_VARIABLE) { - *path = directory.join(stripped_path).to_string_lossy().to_string(); - } - } -} diff --git a/tests/integration_test.rs b/tests/integration_test.rs deleted file mode 100644 index 0fc52887..00000000 --- a/tests/integration_test.rs +++ /dev/null @@ -1,103 +0,0 @@ -//! Test public APIs - -use std::{env, path::PathBuf}; - -use oxc_resolver::{EnforceExtension, Resolution, ResolveContext, ResolveOptions, Resolver}; - -fn dir() -> PathBuf { - env::current_dir().unwrap() -} - -fn resolve(specifier: &str) -> Resolution { - let path = dir(); - Resolver::new(ResolveOptions::default()).resolve(path, specifier).unwrap() -} - -#[test] -fn clone() { - let resolution = resolve("./tests/package.json"); - assert_eq!(resolution.clone(), resolution); -} - -#[test] -fn debug() { - let resolution = resolve("./tests/package.json"); - let s = format!("{resolution:?}"); - assert!(!s.is_empty()); -} - -#[test] -fn eq() { - let resolution = resolve("./tests/package.json"); - assert_eq!(resolution, resolution); -} - -#[test] -fn package_json() { - let resolution = resolve("./tests/package.json"); - let package_json = resolution.package_json().unwrap(); - assert_eq!(package_json.name.as_ref().unwrap(), "name"); - assert_eq!(package_json.r#type.as_ref().unwrap().as_str(), "module".into()); - assert!(package_json.side_effects.as_ref().unwrap().is_object()); -} - -#[cfg(feature = "package_json_raw_json_api")] -#[test] -fn package_json_raw_json_api() { - let resolution = resolve("./tests/package.json"); - assert!(resolution - .package_json() - .unwrap() - .raw_json() - .get("name") - .is_some_and(|name| name == "name")); -} - -#[test] -fn clear_cache() { - let resolver = Resolver::new(ResolveOptions::default()); - resolver.clear_cache(); // exists -} - -#[test] -fn options() { - let resolver = Resolver::new(ResolveOptions::default()); - let options = resolver.options(); - assert!(!format!("{options:?}").is_empty()); -} - -#[test] -fn debug_resolver() { - let resolver = Resolver::new(ResolveOptions::default()); - assert!(!format!("{resolver:?}").is_empty()); -} - -#[test] -fn dependencies() { - let path = dir(); - let mut ctx = ResolveContext::default(); - let _ = Resolver::new(ResolveOptions::default()).resolve_with_context( - path, - "./tests/package.json", - &mut ctx, - ); - assert!(!ctx.file_dependencies.is_empty()); - assert!(ctx.missing_dependencies.is_empty()); -} - -#[test] -fn options_api() { - _ = ResolveOptions::default() - .with_builtin_modules(true) - .with_condition_names(&[]) - .with_extension(".js") - .with_force_extension(EnforceExtension::Auto) - .with_fully_specified(true) - .with_main_field("asdf") - .with_main_file("main") - .with_module("module") - .with_prefer_absolute(true) - .with_prefer_relative(true) - .with_root(PathBuf::new()) - .with_symbolic_link(true); -} diff --git a/tests/package.json b/tests/package.json deleted file mode 100644 index 54f58b8c..00000000 --- a/tests/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "name", - "type": "module", - "sideEffects": {} -} diff --git a/tests/resolve_test.rs b/tests/resolve_test.rs deleted file mode 100644 index 45934cf8..00000000 --- a/tests/resolve_test.rs +++ /dev/null @@ -1,132 +0,0 @@ -use std::{env, path::PathBuf}; - -use oxc_resolver::{ResolveError, ResolveOptions, Resolver}; - -fn dir() -> PathBuf { - env::current_dir().unwrap() -} - -#[test] -fn chinese() { - let dir = dir(); - let specifier = "./fixtures/misc/中文/中文.js"; - let resolution = Resolver::new(ResolveOptions::default()).resolve(&dir, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(dir.join("fixtures/misc/中文/中文.js")) - ); -} - -#[test] -fn styled_components() { - let dir = dir(); - let path = dir.join("fixtures/pnpm"); - let module_path = dir.join("node_modules/.pnpm/styled-components@6.1.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/styled-components"); - let specifier = "styled-components"; - - // cjs - let options = - ResolveOptions { alias_fields: vec![vec!["browser".into()]], ..ResolveOptions::default() }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/styled-components.browser.cjs.js")) - ); - - // esm - let options = ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - main_fields: vec!["module".into()], - ..ResolveOptions::default() - }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/styled-components.browser.esm.js")) - ); -} - -#[test] -fn axios() { - let dir = dir(); - let path = dir.join("fixtures/pnpm"); - let module_path = dir.join("node_modules/.pnpm/axios@1.6.2/node_modules/axios"); - let specifier = "axios"; - - // default - let options = ResolveOptions::default(); - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("index.js")) - ); - - // browser - let options = ResolveOptions { - condition_names: vec!["browser".into(), "require".into()], - ..ResolveOptions::default() - }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/browser/axios.cjs")) - ); - - // cjs - let options = ResolveOptions { - condition_names: vec!["node".into(), "require".into()], - ..ResolveOptions::default() - }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/node/axios.cjs")) - ); -} - -#[test] -fn postcss() { - let dir = dir(); - let path = dir.join("fixtures/pnpm"); - let module_path = path.join("node_modules/postcss"); - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - // should ignore "path" - let resolution = resolver.resolve(&module_path, "path"); - assert_eq!(resolution, Err(ResolveError::Ignored(module_path.clone()))); - - // should ignore "./lib/terminal-highlight" - let resolution = resolver.resolve(&module_path, "./lib/terminal-highlight"); - assert_eq!(resolution, Err(ResolveError::Ignored(module_path.join("lib/terminal-highlight")))); -} - -#[test] -fn ipaddr_js() { - let dir = dir(); - let path = dir.join("fixtures/pnpm"); - let module_path = - dir.join("node_modules/.pnpm/ipaddr.js@2.2.0/node_modules/ipaddr.js/lib/ipaddr.js"); - - let resolvers = [ - // with `extension_alias` - Resolver::new(ResolveOptions { - extension_alias: vec![(".js".into(), vec![".js".into(), ".ts".into(), ".tsx".into()])], - ..ResolveOptions::default() - }), - // with `extensions` should still resolve to module main - Resolver::new(ResolveOptions { - extensions: vec![(".ts".into())], - ..ResolveOptions::default() - }), - // default - Resolver::default(), - ]; - - for resolver in resolvers { - let resolution = resolver.resolve(&path, "ipaddr.js").map(|r| r.full_path()); - assert_eq!(resolution, Ok(module_path.clone())); - } -} From 4552423d91861f664a4797d7f5f2f2a001ae88a3 Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Thu, 12 Sep 2024 13:39:21 +0300 Subject: [PATCH 78/82] --- .github/CODE_OF_CONDUCT.md | 127 - .github/SECURITY.md | 7 - .github/actions/pnpm/action.yml | 26 - .github/codecov.yml | 14 - .github/renovate.json | 5 - .github/workflows/benchmark.yml | 41 - .github/workflows/ci.yml | 196 - .github/workflows/codecov.yml | 69 - .github/workflows/release-napi.yml | 252 - .github/workflows/release-plz.yml | 55 - Cargo.lock | 1326 --- {src => Source}/builtins.rs | 0 {src => Source}/cache.rs | 0 {src => Source}/context.rs | 0 {src => Source}/error.rs | 0 {src => Source}/file_system.rs | 0 {src => Source}/lib.rs | 0 {src => Source}/options.rs | 0 {src => Source}/package_json.rs | 0 {src => Source}/path.rs | 0 {src => Source}/resolution.rs | 0 {src => Source}/specifier.rs | 0 {src => Source}/tsconfig.rs | 0 fixtures/enhanced_resolve/lib/index.js | 1 - fixtures/enhanced_resolve/package.json | 4 - fixtures/enhanced_resolve/test/.gitignore | 3 - .../enhanced_resolve/test/fixtures/#/a.js | 0 fixtures/enhanced_resolve/test/fixtures/a.js | 3 - .../enhanced_resolve/test/fixtures/abc.txt | 1 - .../test/fixtures/alias/files/a.js | 0 fixtures/enhanced_resolve/test/fixtures/b.js | 3 - .../browser-module/browser/module-a.js | 0 .../fixtures/browser-module/lib/browser.js | 0 .../fixtures/browser-module/lib/ignore.js | 0 .../test/fixtures/browser-module/lib/main.js | 0 .../fixtures/browser-module/lib/replaced.js | 0 .../test/fixtures/browser-module/lib/self.js | 0 .../fixtures/browser-module/lib/toString.js | 0 .../browser-module/node_modules/module-a.js | 0 .../browser-module/node_modules/module-b.js | 0 .../browser-module/node_modules/module-c.js | 0 .../node_modules/recursive-file/a.js | 0 .../node_modules/recursive-file/b.js | 0 .../node_modules/recursive-file/c.js | 0 .../node_modules/recursive-file/d.js | 0 .../node_modules/recursive-file/package.json | 8 - .../test/fixtures/browser-module/package.json | 33 - .../test/fixtures/builtins/package.json | 12 - fixtures/enhanced_resolve/test/fixtures/c.js | 4 - .../enhanced_resolve/test/fixtures/complex.js | 13 - .../test/fixtures/crypto-js/index.js | 0 .../test/fixtures/crypto-js/package.json | 7 - .../test/fixtures/decorated-fs/exists.js | 0 .../test/fixtures/dirOrFile.js | 1 - .../test/fixtures/dirOrFile/index.js | 1 - .../directory-default/directory-default.js | 0 .../node_modules/@org/pkg/dist/string.js | 1 - .../@org/pkg/dist/string.test.d.ts | 1 - .../node_modules/@org/pkg/package.json | 9 - .../node_modules/pkg/dist/string.js | 1 - .../node_modules/pkg/dist/string.test.d.ts | 1 - .../node_modules/pkg/package.json | 9 - .../node_modules/exports-field/package.json | 7 - .../node_modules/pack1/index.js | 0 .../test/fixtures/exports-field/a.js | 1 - .../node_modules/exports-field/lib/browser.js | 1 - .../node_modules/exports-field/lib/index.js | 0 .../exports-field/lib/lib2/main.js | 1 - .../node_modules/exports-field/lib/main.js | 1 - .../node_modules/exports-field/main.js | 1 - .../node_modules/exports-field/package.json | 18 - .../node_modules/exports-field/x.js | 1 - .../invalid-exports-field/index.js | 0 .../invalid-exports-field/package.json | 13 - .../node_modules/invalid-exports-field/umd.js | 0 .../test/fixtures/exports-field/package.json | 5 - .../node_modules/exports-field/index.js | 1 - .../node_modules/exports-field/lib/browser.js | 1 - .../exports-field/lib/lib2/main.js | 1 - .../node_modules/exports-field/lib/main.js | 1 - .../node_modules/exports-field/main.js | 1 - .../node_modules/exports-field/package.json | 17 - .../node_modules/exports-field/index | 0 .../node_modules/exports-field/main.js | 1 - .../node_modules/exports-field/package.json | 10 - .../node_modules/exports-field/src/index.js | 0 .../fixtures/extension-alias/dir/index.js | 0 .../fixtures/extension-alias/dir/index.ts | 0 .../fixtures/extension-alias/dir2/index.js | 0 .../fixtures/extension-alias/dir2/index.mts | 0 .../test/fixtures/extension-alias/index.js | 0 .../test/fixtures/extension-alias/index.mjs | 0 .../fixtures/extension-alias/index.mts.js | 0 .../test/fixtures/extension-alias/index.ts | 0 .../test/fixtures/extensions/app.module.js | 0 .../test/fixtures/extensions/dir/index.js | 0 .../test/fixtures/extensions/dir/index.ts | 0 .../test/fixtures/extensions/foo.js | 0 .../test/fixtures/extensions/foo.ts | 0 .../test/fixtures/extensions/index.js | 0 .../test/fixtures/extensions/index.ts | 0 .../extensions/node_modules/module.js | 0 .../extensions/node_modules/module/index.ts | 0 .../test/fixtures/extensions/package.json | 3 - .../enhanced_resolve/test/fixtures/file.load1 | 0 .../enhanced_resolve/test/fixtures/file.load2 | 0 .../test/fixtures/foo/index.js | 0 .../test/fixtures/foo/package.json | 4 - .../node_modules/m/package.json | 17 - .../node_modules/m/src/features/f.js | 0 .../m/src/features/internal/file.js | 0 .../node_modules/m/src/features/y/y.js | 0 .../node_modules/m/src/internal/i.js | 0 .../node_modules/m/src/middle-1/f.js | 0 .../node_modules/m/src/middle-1/nested/f.js | 0 .../node_modules/m/src/middle-2/nested/f.js | 1 - .../m/src/middle-3/nested/f/nested/f.js | 0 .../node_modules/m/src/middle-4/f/f.js | 0 .../node_modules/m/src/middle-5/f$/$.js | 0 .../node_modules/m/src/middle-5/f/$.js | 0 .../node_modules/m/src/middle/f.js | 0 .../node_modules/m/src/middle/nested/f.js | 0 .../test/fixtures/imports-field/a.js | 1 - .../test/fixtures/imports-field/b.js | 0 .../test/fixtures/imports-field/dir/b.js | 0 .../node_modules/a/lib/browser.js | 1 - .../imports-field/node_modules/a/lib/index.js | 0 .../node_modules/a/lib/lib2/main.js | 1 - .../imports-field/node_modules/a/lib/main.js | 1 - .../imports-field/node_modules/a/main.js | 1 - .../imports-field/node_modules/a/package.json | 18 - .../imports-field/node_modules/a/x.js | 1 - .../imports-field/node_modules/c/index.js | 0 .../test/fixtures/imports-field/package.json | 17 - .../fixtures/incorrect-package/pack1/a.js | 0 .../incorrect-package/pack1/package.json | 2 - .../fixtures/incorrect-package/pack2/a.js | 0 .../incorrect-package/pack2/package.json | 0 .../test/fixtures/issue-238/package.json | 3 - .../test/fixtures/issue-238/src/a/config.js | 0 .../src/common/config/myObjectFile.js | 0 .../enhanced_resolve/test/fixtures/lib.js | 0 .../test/fixtures/lib/complex1.js | 1 - .../test/fixtures/main-field-self/index.js | 0 .../fixtures/main-field-self/package.json | 3 - .../test/fixtures/main-field-self2/index.js | 0 .../fixtures/main-field-self2/package.json | 3 - .../enhanced_resolve/test/fixtures/main1.js | 9 - .../enhanced_resolve/test/fixtures/main2.js | 12 - .../enhanced_resolve/test/fixtures/main3.js | 4 - .../multiple_modules/node_modules/m1/a.js | 3 - .../test/fixtures/no#fragment/#/#.js | 0 fixtures/enhanced_resolve/test/fixtures/no.js | 0 .../browser-module-broken/browser.js | 0 .../browser-module-broken/main.js | 0 .../browser-module-broken/package.json | 4 - .../complexm/node_modules/m1/a.js | 1 - .../complexm/node_modules/m1/index.js | 1 - .../fixtures/node_modules/complexm/step1.js | 1 - .../fixtures/node_modules/complexm/step2.js | 1 - .../fixtures/node_modules/dash-name/index.js | 0 .../node_modules/dash-name/package.json | 4 - .../test/fixtures/node_modules/dash/index.js | 0 .../fixtures/node_modules/dash/package.json | 4 - .../invalidPackageJson/package.json | 0 .../test/fixtures/node_modules/m1/a.js | 3 - .../test/fixtures/node_modules/m1/b.js | 3 - .../test/fixtures/node_modules/m2/b.js | 1 - .../node_modules/recursive-module/file.js | 0 .../node_modules/recursive-module/index.js | 0 .../test/fixtures/pnp-a/m2/a.js | 3 - .../test/fixtures/pnp/pkg/dir/index.js | 0 .../test/fixtures/pnp/pkg/index.js | 0 .../test/fixtures/pnp/pkg/main.js | 0 .../fixtures/pnp/pkg/package-alias/browser.js | 0 .../fixtures/pnp/pkg/package-alias/index.js | 0 .../test/fixtures/pnp/pkg/package.json | 7 - .../test/fixtures/pnp/pkg/typescript/index.ts | 0 .../test/fixtures/pnp/pkg3/a.js | 1 - .../test/fixtures/pnp/pkg3/package.json | 8 - .../prefer-pnp/alternative-modules/m1/b.js | 0 .../restrictions/node_modules/pck1/index.css | 0 .../restrictions/node_modules/pck1/index.js | 0 .../node_modules/pck1/package.json | 3 - .../restrictions/node_modules/pck2/index.css | 0 .../restrictions/node_modules/pck2/module.js | 0 .../node_modules/pck2/package.json | 5 - .../test/fixtures/roots_fall_through/index.js | 0 .../scoped/node_modules/@scope/pack1/main.js | 0 .../node_modules/@scope/pack1/package.json | 5 - .../node_modules/@scope/pack2/lib/index.js | 0 .../scoped/node_modules/@scope/pack2/main.js | 0 .../node_modules/@scope/pack2/package.json | 3 - .../test/fixtures/shortcutdir.js/a.js | 0 .../test/fixtures/yield/a/foo-2/b | 0 .../test/fixtures/yield/a/foo-2/c | 0 .../test/fixtures/yield/a/foo/a | 0 .../test/fixtures/yield/a/foo/b | 0 .../test/fixtures/yield/b/foo/a | 0 .../test/fixtures/yield/c/foo/a | 0 .../test/fixtures/yield/c/foo/package.json | 7 - .../fixtures/\346\265\213\350\257\225.js" | 0 .../\344\270\255\346\226\207.js" | 0 fixtures/pnp/.gitignore | 1 - fixtures/pnp/.pnp.cjs | 7543 ----------------- fixtures/pnp/.yarnrc.yml | 1 - fixtures/pnp/package.json | 8 - fixtures/pnp/yarn.lock | 74 - fixtures/pnpm/.gitignore | 1 - fixtures/pnpm/package.json | 11 - fixtures/pnpm/pnpm-lock.yaml | 212 - fixtures/tsconfig/cases/builtins/thing.js | 0 .../tsconfig/cases/builtins/tsconfig.json | 5 - fixtures/tsconfig/cases/exports/index.js | 0 fixtures/tsconfig/cases/exports/tsconfig.json | 3 - .../extends-extension/base-tsconfig.json | 7 - .../tsconfig/cases/extends-extension/foo.js | 0 .../cases/extends-extension/tsconfig.json | 3 - .../cases/extends-extensionless/foo.js | 0 .../cases/extends-extensionless/tsconfig.json | 3 - .../tsconfig/cases/extends-multiple/foo.js | 0 .../cases/extends-multiple/tsconfig.json | 6 - .../tsconfig/cases/extends-not-found/index.js | 0 .../cases/extends-not-found/tsconfig.json | 3 - .../tsconfig/cases/extends-paths/src/index.js | 0 .../cases/extends-paths/tsconfig.base.json | 7 - .../cases/extends-paths/tsconfig.json | 6 - fixtures/tsconfig/cases/field/index.js | 0 fixtures/tsconfig/cases/field/tsconfig.json | 3 - fixtures/tsconfig/cases/index/index.js | 0 fixtures/tsconfig/cases/index/tsconfig.json | 3 - .../cases/paths_template_variable/foo.js | 0 .../paths_template_variable/tsconfig1.json | 3 - .../paths_template_variable/tsconfig2.json | 8 - .../project_references/app/aliased/index.ts | 0 .../cases/project_references/app/index.ts | 0 .../project_references/app/tsconfig.json | 23 - .../project_a/aliased/index.ts | 0 .../project_references/project_a/conf.json | 8 - .../project_references/project_a/index.ts | 0 .../project_b/src/aliased/index.ts | 0 .../project_b/tsconfig.json | 9 - .../project_references/project_c/index.ts | 0 .../project_c/tsconfig.json | 5 - .../project_references/tsconfig.base.json | 4 - fixtures/tsconfig/cases/suffixes/a.ios.ts | 0 fixtures/tsconfig/cases/suffixes/a.ts | 0 fixtures/tsconfig/cases/suffixes/b.ts | 0 fixtures/tsconfig/cases/suffixes/c-test.ts | 0 fixtures/tsconfig/cases/suffixes/index.ts | 1 - .../tsconfig/cases/suffixes/tsconfig.json | 5 - fixtures/tsconfig/cases/trailing-comma/bar.js | 0 .../tsconfig/cases/trailing-comma/index.js | 0 .../cases/trailing-comma/tsconfig.json | 9 - fixtures/tsconfig/foo.js | 0 fixtures/tsconfig/nested/index.js | 0 fixtures/tsconfig/nested/test.js | 0 fixtures/tsconfig/nested/tsconfig.json | 8 - .../node_modules/tsconfig-exports/conf.json | 7 - .../node_modules/tsconfig-exports/foo.js | 0 .../tsconfig-exports/package.json | 7 - .../node_modules/tsconfig-field/conf.json | 7 - .../node_modules/tsconfig-field/foo.js | 0 .../node_modules/tsconfig-field/package.json | 5 - .../node_modules/tsconfig-index/foo.js | 0 .../node_modules/tsconfig-index/package.json | 4 - .../node_modules/tsconfig-index/tsconfig.json | 7 - .../node_modules/tsconfig-not-used/foo.js | 0 .../tsconfig-not-used/tsconfig.json | 7 - fixtures/tsconfig/package.json | 24 - fixtures/tsconfig/tsconfig.json | 7 - fixtures/tsconfig/tsconfig_broken.json | 1 - .../tsconfig/tsconfig_template_variable.json | 7 - napi/{src => Source}/lib.rs | 0 napi/{src => Source}/options.rs | 0 napi/{src => Source}/tracing.rs | 0 napi/__test__/resolver.spec.mjs | 260 - napi/tests/options.test.mjs | 59 - npm/package.json | 79 +- package.json | 53 +- pnpm-lock.yaml | 2598 ------ src/tests/alias.rs | 283 - src/tests/browser_field.rs | 189 - src/tests/builtins.rs | 121 - src/tests/dependencies.rs | 110 - src/tests/exports_field.rs | 2546 ------ src/tests/extension_alias.rs | 70 - src/tests/extensions.rs | 125 - src/tests/fallback.rs | 100 - src/tests/full_specified.rs | 113 - src/tests/imports_field.rs | 1320 --- src/tests/incorrect_description_file.rs | 65 - src/tests/main_field.rs | 24 - src/tests/memory_fs.rs | 74 - src/tests/missing.rs | 106 - src/tests/mod.rs | 51 - src/tests/pnp.rs | 45 - src/tests/resolve.rs | 119 - src/tests/restrictions.rs | 25 - src/tests/roots.rs | 92 - src/tests/scoped_packages.rs | 25 - src/tests/simple.rs | 68 - src/tests/symlink.rs | 121 - src/tests/tsconfig_paths.rs | 530 -- src/tests/tsconfig_project_references.rs | 132 - tests/integration_test.rs | 103 - tests/package.json | 5 - tests/resolve_test.rs | 132 - 308 files changed, 56 insertions(+), 20240 deletions(-) delete mode 100644 .github/CODE_OF_CONDUCT.md delete mode 100644 .github/SECURITY.md delete mode 100644 .github/actions/pnpm/action.yml delete mode 100644 .github/codecov.yml delete mode 100644 .github/renovate.json delete mode 100644 .github/workflows/benchmark.yml delete mode 100644 .github/workflows/ci.yml delete mode 100644 .github/workflows/codecov.yml delete mode 100644 .github/workflows/release-napi.yml delete mode 100644 .github/workflows/release-plz.yml delete mode 100644 Cargo.lock rename {src => Source}/builtins.rs (100%) rename {src => Source}/cache.rs (100%) rename {src => Source}/context.rs (100%) rename {src => Source}/error.rs (100%) rename {src => Source}/file_system.rs (100%) rename {src => Source}/lib.rs (100%) rename {src => Source}/options.rs (100%) rename {src => Source}/package_json.rs (100%) rename {src => Source}/path.rs (100%) rename {src => Source}/resolution.rs (100%) rename {src => Source}/specifier.rs (100%) rename {src => Source}/tsconfig.rs (100%) delete mode 100644 fixtures/enhanced_resolve/lib/index.js delete mode 100644 fixtures/enhanced_resolve/package.json delete mode 100644 fixtures/enhanced_resolve/test/.gitignore delete mode 100644 fixtures/enhanced_resolve/test/fixtures/#/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/abc.txt delete mode 100644 fixtures/enhanced_resolve/test/fixtures/alias/files/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/browser/module-a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/ignore.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/replaced.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/self.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/toString.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-c.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/c.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/d.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/builtins/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/c.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/complex.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/crypto-js/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/decorated-fs/exists.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/dirOrFile.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/directory-default/directory-default.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/pack1/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/umd.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/index delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/src/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.mts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mjs delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mts.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/app.module.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/foo.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/foo.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/file.load1 delete mode 100644 fixtures/enhanced_resolve/test/fixtures/file.load2 delete mode 100644 fixtures/enhanced_resolve/test/fixtures/foo/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/foo/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/internal/file.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/y/y.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/internal/i.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-3/nested/f/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-4/f/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f$/$.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f/$.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/dir/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/c/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/issue-238/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/issue-238/src/a/config.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/issue-238/src/common/config/myObjectFile.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/lib.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/lib/complex1.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self2/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main1.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main2.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main3.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/no#fragment/#/#.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/no.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/invalidPackageJson/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/file.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/dir/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/typescript/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/prefer-pnp/alternative-modules/m1/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.css delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/index.css delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/module.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/roots_fall_through/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/lib/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/shortcutdir.js/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/b delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/c delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo/a delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo/b delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/b/foo/a delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/c/foo/a delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json delete mode 100644 "fixtures/enhanced_resolve/test/fixtures/\346\265\213\350\257\225.js" delete mode 100644 "fixtures/misc/\344\270\255\346\226\207/\344\270\255\346\226\207.js" delete mode 100644 fixtures/pnp/.gitignore delete mode 100755 fixtures/pnp/.pnp.cjs delete mode 100644 fixtures/pnp/.yarnrc.yml delete mode 100644 fixtures/pnp/package.json delete mode 100644 fixtures/pnp/yarn.lock delete mode 100644 fixtures/pnpm/.gitignore delete mode 100644 fixtures/pnpm/package.json delete mode 100644 fixtures/pnpm/pnpm-lock.yaml delete mode 100644 fixtures/tsconfig/cases/builtins/thing.js delete mode 100644 fixtures/tsconfig/cases/builtins/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/exports/index.js delete mode 100644 fixtures/tsconfig/cases/exports/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-extension/base-tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-extension/foo.js delete mode 100644 fixtures/tsconfig/cases/extends-extension/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-extensionless/foo.js delete mode 100644 fixtures/tsconfig/cases/extends-extensionless/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-multiple/foo.js delete mode 100644 fixtures/tsconfig/cases/extends-multiple/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-not-found/index.js delete mode 100644 fixtures/tsconfig/cases/extends-not-found/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-paths/src/index.js delete mode 100644 fixtures/tsconfig/cases/extends-paths/tsconfig.base.json delete mode 100644 fixtures/tsconfig/cases/extends-paths/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/field/index.js delete mode 100644 fixtures/tsconfig/cases/field/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/index/index.js delete mode 100644 fixtures/tsconfig/cases/index/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/paths_template_variable/foo.js delete mode 100644 fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json delete mode 100644 fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json delete mode 100644 fixtures/tsconfig/cases/project_references/app/aliased/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/app/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/app/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/project_references/project_a/aliased/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_a/conf.json delete mode 100644 fixtures/tsconfig/cases/project_references/project_a/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_b/src/aliased/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_b/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/project_references/project_c/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_c/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/project_references/tsconfig.base.json delete mode 100644 fixtures/tsconfig/cases/suffixes/a.ios.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/a.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/b.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/c-test.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/index.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/trailing-comma/bar.js delete mode 100644 fixtures/tsconfig/cases/trailing-comma/index.js delete mode 100644 fixtures/tsconfig/cases/trailing-comma/tsconfig.json delete mode 100644 fixtures/tsconfig/foo.js delete mode 100644 fixtures/tsconfig/nested/index.js delete mode 100644 fixtures/tsconfig/nested/test.js delete mode 100644 fixtures/tsconfig/nested/tsconfig.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-exports/conf.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-exports/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-exports/package.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-field/conf.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-field/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-field/package.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-index/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-index/package.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-not-used/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json delete mode 100755 fixtures/tsconfig/package.json delete mode 100644 fixtures/tsconfig/tsconfig.json delete mode 100644 fixtures/tsconfig/tsconfig_broken.json delete mode 100644 fixtures/tsconfig/tsconfig_template_variable.json rename napi/{src => Source}/lib.rs (100%) rename napi/{src => Source}/options.rs (100%) rename napi/{src => Source}/tracing.rs (100%) delete mode 100644 napi/__test__/resolver.spec.mjs delete mode 100644 napi/tests/options.test.mjs delete mode 100644 pnpm-lock.yaml delete mode 100644 src/tests/alias.rs delete mode 100644 src/tests/browser_field.rs delete mode 100644 src/tests/builtins.rs delete mode 100644 src/tests/dependencies.rs delete mode 100644 src/tests/exports_field.rs delete mode 100644 src/tests/extension_alias.rs delete mode 100644 src/tests/extensions.rs delete mode 100644 src/tests/fallback.rs delete mode 100644 src/tests/full_specified.rs delete mode 100644 src/tests/imports_field.rs delete mode 100644 src/tests/incorrect_description_file.rs delete mode 100644 src/tests/main_field.rs delete mode 100644 src/tests/memory_fs.rs delete mode 100644 src/tests/missing.rs delete mode 100644 src/tests/mod.rs delete mode 100644 src/tests/pnp.rs delete mode 100644 src/tests/resolve.rs delete mode 100644 src/tests/restrictions.rs delete mode 100644 src/tests/roots.rs delete mode 100644 src/tests/scoped_packages.rs delete mode 100644 src/tests/simple.rs delete mode 100644 src/tests/symlink.rs delete mode 100644 src/tests/tsconfig_paths.rs delete mode 100644 src/tests/tsconfig_project_references.rs delete mode 100644 tests/integration_test.rs delete mode 100644 tests/package.json delete mode 100644 tests/resolve_test.rs diff --git a/.github/CODE_OF_CONDUCT.md b/.github/CODE_OF_CONDUCT.md deleted file mode 100644 index 41dd9ebe..00000000 --- a/.github/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,127 +0,0 @@ -# Contributor Covenant Code of Conduct - -## Our Pledge - -We as members, contributors, and leaders pledge to make participation in our -community a harassment-free experience for everyone, regardless of age, body -size, visible or invisible disability, ethnicity, sex characteristics, gender -identity and expression, level of experience, education, socio-economic status, -nationality, personal appearance, race, religion, or sexual identity -and orientation. - -We pledge to act and interact in ways that contribute to an open, welcoming, -diverse, inclusive, and healthy community. - -## Our Standards - -Examples of behavior that contributes to a positive environment for our -community include: - -* Demonstrating empathy and kindness toward other people -* Being respectful of differing opinions, viewpoints, and experiences -* Giving and gracefully accepting constructive feedback -* Accepting responsibility and apologizing to those affected by our mistakes, - and learning from the experience -* Focusing on what is best not just for us as individuals, but for the - overall community - -Examples of unacceptable behavior include: - -* The use of sexualized language or imagery, and sexual attention or - advances of any kind -* Trolling, insulting or derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or email - address, without their explicit permission -* Other conduct which could reasonably be considered inappropriate in a - professional setting - -## Enforcement Responsibilities - -Community leaders are responsible for clarifying and enforcing our standards of -acceptable behavior and will take appropriate and fair corrective action in -response to any behavior that they deem inappropriate, threatening, offensive, -or harmful. - -Community leaders have the right and responsibility to remove, edit, or reject -comments, commits, code, wiki edits, issues, and other contributions that are -not aligned to this Code of Conduct, and will communicate reasons for moderation -decisions when appropriate. - -## Scope - -This Code of Conduct applies within all community spaces, and also applies when -an individual is officially representing the community in public spaces. -Examples of representing our community include using an official e-mail address, -posting via an official social media account, or acting as an appointed -representative at an online or offline event. - -## Enforcement - -Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported to the community leaders responsible for enforcement. -All complaints will be reviewed and investigated promptly and fairly. - -All community leaders are obligated to respect the privacy and security of the -reporter of any incident. - -## Enforcement Guidelines - -Community leaders will follow these Community Impact Guidelines in determining -the consequences for any action they deem in violation of this Code of Conduct: - -### 1. Correction - -**Community Impact**: Use of inappropriate language or other behavior deemed -unprofessional or unwelcome in the community. - -**Consequence**: A private, written warning from community leaders, providing -clarity around the nature of the violation and an explanation of why the -behavior was inappropriate. A public apology may be requested. - -### 2. Warning - -**Community Impact**: A violation through a single incident or series -of actions. - -**Consequence**: A warning with consequences for continued behavior. No -interaction with the people involved, including unsolicited interaction with -those enforcing the Code of Conduct, for a specified period of time. This -includes avoiding interactions in community spaces as well as external channels -like social media. Violating these terms may lead to a temporary or -permanent ban. - -### 3. Temporary Ban - -**Community Impact**: A serious violation of community standards, including -sustained inappropriate behavior. - -**Consequence**: A temporary ban from any sort of interaction or public -communication with the community for a specified period of time. No public or -private interaction with the people involved, including unsolicited interaction -with those enforcing the Code of Conduct, is allowed during this period. -Violating these terms may lead to a permanent ban. - -### 4. Permanent Ban - -**Community Impact**: Demonstrating a pattern of violation of community -standards, including sustained inappropriate behavior, harassment of an -individual, or aggression toward or disparagement of classes of individuals. - -**Consequence**: A permanent ban from any sort of public interaction within -the community. - -## Attribution - -This Code of Conduct is adapted from the [Contributor Covenant][homepage], -version 2.0, available at -https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. - -Community Impact Guidelines were inspired by [Mozilla's code of conduct -enforcement ladder](https://github.com/mozilla/diversity). - -[homepage]: https://www.contributor-covenant.org - -For answers to common questions about this code of conduct, see the FAQ at -https://www.contributor-covenant.org/faq. Translations are available at -https://www.contributor-covenant.org/translations. diff --git a/.github/SECURITY.md b/.github/SECURITY.md deleted file mode 100644 index 63f5b072..00000000 --- a/.github/SECURITY.md +++ /dev/null @@ -1,7 +0,0 @@ -# Security Policy - -## Supported Versions - -## Reporting a Vulnerability - -If you find any potential vulnerability, join our [discord channel](https://discord.gg/9uXCAwqQZW) and contact Boshen. diff --git a/.github/actions/pnpm/action.yml b/.github/actions/pnpm/action.yml deleted file mode 100644 index ab4291c0..00000000 --- a/.github/actions/pnpm/action.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: Pnpm - -description: Install pnpm - -runs: - using: composite - steps: - - uses: pnpm/action-setup@v4 - - - uses: actions/setup-node@v4 - with: - node-version-file: .node-version - cache: pnpm - - - name: yarn - shell: bash - run: | - cd fixtures/pnp - corepack enable - yarn install - - - name: pnpm - shell: bash - run: | - corepack enable - pnpm install diff --git a/.github/codecov.yml b/.github/codecov.yml deleted file mode 100644 index 0610268a..00000000 --- a/.github/codecov.yml +++ /dev/null @@ -1,14 +0,0 @@ -coverage: - status: - project: - default: - informational: true - patch: - default: - informational: true - changes: - default: - informational: true - -ignore: - - "examples" diff --git a/.github/renovate.json b/.github/renovate.json deleted file mode 100644 index 2339df09..00000000 --- a/.github/renovate.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "$schema": "https://docs.renovatebot.com/renovate-schema.json", - "extends": ["github>Boshen/renovate"], - "ignorePaths": ["**/node_modules/**", "**/fixtures/**"] -} diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml deleted file mode 100644 index 7c25853b..00000000 --- a/.github/workflows/benchmark.yml +++ /dev/null @@ -1,41 +0,0 @@ -name: Benchmark - -on: - workflow_dispatch: - pull_request: - types: [opened, synchronize] - paths-ignore: - - '**/*.md' - push: - branches: - - main - paths-ignore: - - '**/*.md' - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} - cancel-in-progress: true - -jobs: - benchmark: - name: Benchmark - runs-on: ubuntu-latest - steps: - - name: Checkout Branch - uses: taiki-e/checkout-action@v1 - - - uses: Boshen/setup-rust@main - with: - cache-key: benchmark - save-cache: ${{ github.ref_name == 'main' }} - tools: cargo-codspeed - - uses: ./.github/actions/pnpm - - name: Build Benchmark - run: cargo codspeed build --features codspeed - - - name: Run benchmark - uses: CodSpeedHQ/action@v3 - timeout-minutes: 30 - with: - run: cargo codspeed run - token: ${{ secrets.CODSPEED_TOKEN }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index 3f629ffb..00000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,196 +0,0 @@ -name: CI - -on: - workflow_dispatch: - pull_request: - types: [opened, synchronize] - paths-ignore: - - '**/*.md' - - '!.github/workflows/ci.yml' - push: - branches: - - main - - "renovate/**" - paths-ignore: - - '**/*.md' - - '!.github/workflows/ci.yml' - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} - cancel-in-progress: ${{ github.ref_name != 'main' }} - -defaults: - run: - shell: bash - -jobs: - cache: # Warm cache factory for all other CI jobs - name: Check and Build - strategy: - fail-fast: true - matrix: - include: - - os: windows-latest - - os: ubuntu-latest - - os: macos-14 - runs-on: ${{ matrix.os }} - steps: - - uses: taiki-e/checkout-action@v1 - - - uses: Boshen/setup-rust@main - with: - save-cache: ${{ github.ref_name == 'main' }} - cache-key: warm - - - run: cargo check --all-features --locked - - # Only need to build the test to create a warm cache on the main branch - - name: Build cache by Cargo Check and Cargo Test - if: ${{ github.ref_name == 'main' }} - run: cargo test --all-features --no-run - - wasm: - name: Check Wasm - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - - uses: Boshen/setup-rust@main - with: - cache-key: wasm - save-cache: ${{ github.ref_name == 'main' }} - - - name: Check - run: | - rustup target add wasm32-unknown-unknown - cargo check --all-features --target wasm32-unknown-unknown - - wasi: - name: Test wasi target - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - - uses: Boshen/setup-rust@main - with: - cache-key: wasi - save-cache: ${{ github.ref_name == 'main' }} - - - uses: ./.github/actions/pnpm - - - name: Build - run: | - rustup target add wasm32-wasip1-threads - pnpm build --target wasm32-wasip1-threads - - - name: Test - run: pnpm test - env: - WASI_TEST: 1 - - typos: - name: Spell Check - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - - uses: crate-ci/typos@v1.24.5 - with: - files: . - - deny: - name: Cargo Deny - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - - uses: dorny/paths-filter@v3 - id: filter - with: - filters: | - src: - - 'Cargo.lock' - - - uses: Boshen/setup-rust@main - with: - restore-cache: false - tools: cargo-deny - - - if: steps.filter.outputs.src == 'true' - run: cargo deny check - - unused-deps: - name: Check Unused Dependencies - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - uses: dorny/paths-filter@v3 - id: filter - with: - filters: | - src: - - '**/*.rs' - - '**/Cargo.toml' - - 'Cargo.lock' - - uses: Boshen/setup-rust@main - with: - restore-cache: false - if: steps.filter.outputs.src == 'true' - - uses: cargo-bins/cargo-binstall@main - if: steps.filter.outputs.src == 'true' - - run: cargo binstall --no-confirm cargo-shear@1 - if: steps.filter.outputs.src == 'true' - - run: cargo shear - if: steps.filter.outputs.src == 'true' - - format: - name: Format - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - uses: Boshen/setup-rust@main - with: - components: rustfmt - restore-cache: false - - run: cargo fmt --all -- --check - - lint: - name: Clippy - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - uses: Boshen/setup-rust@main - with: - components: clippy - - run: cargo clippy --all-features -- -D warnings - - doc: - name: Doc - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - uses: Boshen/setup-rust@main - with: - components: rust-docs - - run: RUSTDOCFLAGS='-D warnings' cargo doc --no-deps --all-features - - test: - name: Test - strategy: - fail-fast: true - matrix: - include: - - os: windows-latest - - os: ubuntu-latest - - os: macos-14 - runs-on: ${{ matrix.os }} - env: - RUST_BACKTRACE: 1 - steps: - - uses: taiki-e/checkout-action@v1 - - uses: ./.github/actions/pnpm - - uses: Boshen/setup-rust@main - with: - cache-key: warm - - run: cargo test --doc - - run: cargo test --all-features diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml deleted file mode 100644 index 97302b03..00000000 --- a/.github/workflows/codecov.yml +++ /dev/null @@ -1,69 +0,0 @@ -name: Code Coverage # Run cargo-llvm-cov and upload to codecov.io - -on: - workflow_dispatch: - pull_request: - types: [opened, synchronize] - paths-ignore: - - '**/*.md' - push: - branches: - - main - paths-ignore: - - '**/*.md' - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: ${{ github.ref_name != 'main' }} - -jobs: - coverage: - name: Code Coverage - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: taiki-e/checkout-action@v1 - - - uses: ./.github/actions/pnpm - - - uses: Boshen/setup-rust@main - with: - cache-key: codecov - save-cache: ${{ github.ref_name == 'main' }} - tools: cargo-llvm-cov - components: llvm-tools-preview - - - run: cargo llvm-cov --lcov --output-path lcov.info - - - name: Upload Artifact - uses: actions/upload-artifact@v4 - with: - name: codecov - path: lcov.info - - # codecov often fails, use another workflow for retry - upload-codecov: - name: Upload coverage file - runs-on: ubuntu-latest - needs: coverage - # Check if the event is not triggered by a fork by checking whether CODECOV_TOKEN is set - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - steps: - - name: Checkout - if: env.CODECOV_TOKEN - uses: taiki-e/checkout-action@v1 - - - name: Download coverage file - if: env.CODECOV_TOKEN - uses: actions/download-artifact@v4 - with: - name: codecov - - - name: Upload to codecov.io - if: env.CODECOV_TOKEN - uses: codecov/codecov-action@v4 - with: - token: ${{ secrets.CODECOV_TOKEN }} - fail_ci_if_error: true - files: lcov.info diff --git a/.github/workflows/release-napi.yml b/.github/workflows/release-napi.yml deleted file mode 100644 index 1ea68db8..00000000 --- a/.github/workflows/release-napi.yml +++ /dev/null @@ -1,252 +0,0 @@ -name: Release NAPI - -on: - workflow_dispatch: - push: - branches: - - main - paths: - - npm/package.json # Please only commit this file, so we don't need to wait for test CI to pass. - -env: - DEBUG: 'napi:*' - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - check: - name: Check version - runs-on: ubuntu-latest - outputs: - version: ${{ env.version }} - version_changed: ${{ steps.version.outputs.changed }} - steps: - - uses: taiki-e/checkout-action@v1 - - - name: Check version changes - uses: EndBug/version-check@v2 - id: version - with: - static-checking: localIsNew - file-url: https://unpkg.com/oxc-resolver@latest/package.json - file-name: npm/package.json - - - name: Set version name - if: steps.version.outputs.changed == 'true' - run: | - echo "Version change found! New version: ${{ steps.version.outputs.version }} (${{ steps.version.outputs.version_type }})" - echo "version=${{ steps.version.outputs.version }}" >> $GITHUB_ENV - - build: - needs: check - if: needs.check.outputs.version_changed == 'true' - env: - version: ${{ needs.check.outputs.version }} - outputs: - version: ${{ env.version }} - strategy: - fail-fast: false - matrix: - include: - - os: windows-latest - target: x86_64-pc-windows-msvc - - - os: windows-latest - target: aarch64-pc-windows-msvc - - - os: ubuntu-latest - target: x86_64-unknown-linux-gnu - - - os: ubuntu-latest - target: x86_64-unknown-linux-musl - - - os: ubuntu-latest - target: aarch64-unknown-linux-gnu - - - os: ubuntu-latest - target: aarch64-unknown-linux-musl - - - os: ubuntu-latest - target: armv7-unknown-linux-gnueabihf - - - os: macos-latest - target: x86_64-apple-darwin - - - os: macos-latest - target: aarch64-apple-darwin - - - os: ubuntu-latest - target: wasm32-wasip1-threads - - name: Package ${{ matrix.target }} - runs-on: ${{ matrix.os }} - steps: - - uses: taiki-e/checkout-action@v1 - - - uses: ./.github/actions/pnpm - - - name: Add Rust Target - run: rustup target add ${{ matrix.target }} - - - uses: goto-bus-stop/setup-zig@v2 - if: ${{ contains(matrix.target, 'musl') }} - with: - version: 0.13.0 - - - name: Build with zig cross - if: ${{ contains(matrix.target, 'musl') }} - run: pnpm build -x --target ${{ matrix.target }} - - - name: Build with napi cross - if: ${{ contains(matrix.target, 'gnu') }} - run: pnpm build --use-napi-cross --target ${{ matrix.target }} - - - name: Build - if: ${{ !contains(matrix.target, 'gnu') && !contains(matrix.target, 'musl') }} - run: pnpm build --target ${{ matrix.target }} - - - name: Test - if: matrix.target == 'x86_64-pc-windows-msvc' || matrix.target == 'aarch64-apple-darwin' || matrix.target == 'wasm32-wasip1-threads' - run: pnpm test - - - name: Output docker params - if: ${{ contains(matrix.target, 'linux') }} - id: docker - run: | - node -e " - if ('${{ matrix.target }}'.startsWith('aarch64')) { - console.log('PLATFORM=linux/arm64') - } else if ('${{ matrix.target }}'.startsWith('armv7')) { - console.log('PLATFORM=linux/arm/v7') - } else { - console.log('PLATFORM=linux/amd64') - } - " >> $GITHUB_OUTPUT - node -e " - if ('${{ matrix.target }}'.endsWith('-musl')) { - console.log('IMAGE=node:lts-alpine') - } else { - console.log('IMAGE=node:lts-slim') - } - " >> $GITHUB_OUTPUT - echo "PNPM_STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_OUTPUT - - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - if: ${{ contains(matrix.target, 'linux') }} - with: - platforms: all - - - run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes - if: ${{ contains(matrix.target, 'linux') }} - - - name: Run linux test - uses: addnab/docker-run-action@v3 - if: ${{ contains(matrix.target, 'linux') }} - with: - image: ${{ steps.docker.outputs.IMAGE }} - options: -v ${{ steps.docker.outputs.PNPM_STORE_PATH }}:${{ steps.docker.outputs.PNPM_STORE_PATH }} -v ${{ github.workspace }}:/oxc_resolver -w /oxc_resolver --platform ${{ steps.docker.outputs.PLATFORM }} - run: | - corepack enable - pnpm test - - - name: Upload artifacts - uses: actions/upload-artifact@v4 - with: - name: bindings-${{ matrix.target }} - path: | - napi/*.node - napi/*.wasm - - build-freebsd: - needs: check - if: needs.check.outputs.version_changed == 'true' - name: Build FreeBSD - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Build - id: build - uses: cross-platform-actions/action@v0.25.0 - env: - DEBUG: napi:* - RUSTUP_IO_THREADS: 1 - with: - operating_system: freebsd - version: '14.0' - memory: 8G - cpu_count: 3 - environment_variables: 'DEBUG RUSTUP_IO_THREADS' - shell: bash - run: | - sudo pkg install -y -f curl node libnghttp2 npm - curl https://sh.rustup.rs -sSf --output rustup.sh - sh rustup.sh -y --profile minimal --default-toolchain stable - source "$HOME/.cargo/env" - echo "~~~~ rustc --version ~~~~" - rustc --version - echo "~~~~ node -v ~~~~" - node -v - pwd - ls -lah - whoami - env - sudo corepack enable - pnpm install - pnpm build --target x86_64-unknown-freebsd - rm -rf node_modules - rm -rf target - - name: Upload artifact - uses: actions/upload-artifact@v4 - with: - name: bindings-freebsd - path: napi/*.node - if-no-files-found: error - - publish: - name: Publish NAPI - runs-on: ubuntu-latest - permissions: - id-token: write # for `npm publish --provenance` - needs: - - build - - build-freebsd - steps: - - uses: taiki-e/checkout-action@v1 - - - name: corepack - run: corepack enable - - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version-file: .node-version - cache: pnpm - - - name: Install dependencies - run: pnpm install --frozen-lockfile - - - name: Download Artifacts - uses: actions/download-artifact@v4 - with: - path: artifacts - - - name: Prepare dirs and artifacts - run: | - pnpm napi create-npm-dirs --package-json-path npm/package.json - pnpm napi artifacts --package-json-path npm/package.json --build-output-dir napi - - - name: Publish npm packages as latest - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - shell: bash - run: | - cp napi/index.js npm/index.js - cp napi/index.d.ts npm/index.d.ts - cp napi/browser.js npm/browser.js - echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc - pnpm napi pre-publish --no-gh-release -t npm --package-json-path npm/package.json - npm publish npm/ --tag latest --provenance --access public diff --git a/.github/workflows/release-plz.yml b/.github/workflows/release-plz.yml deleted file mode 100644 index 121758ad..00000000 --- a/.github/workflows/release-plz.yml +++ /dev/null @@ -1,55 +0,0 @@ -name: Release Plz - -on: - workflow_dispatch: - push: - branches: - - main - -permissions: - pull-requests: write - contents: write - -jobs: - release-plz: - name: Release-plz - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - uses: Boshen/setup-rust@main - with: - save-cache: ${{ github.ref_name == 'main' }} - cache-key: warm - - - name: Run release-plz - id: release-plz - uses: MarcoIeni/release-plz-action@v0.5 - env: - GITHUB_TOKEN: ${{ secrets.RELEASE_PLZ_TOKEN }} - CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} - - - name: Bump package.json - if: ${{ steps.release-plz.outputs.prs_created }} - env: - GH_TOKEN: ${{ github.token }} - RELEASES: ${{ steps.release-plz.outputs.releases }} - PR: ${{ steps.release-plz.outputs.pr }} - run: | - set -e - - pr_number=${{ fromJSON(steps.release-plz.outputs.pr).number }} - if [[ -n "$pr_number" ]]; then - version=$(echo "$RELEASES" | jq -r '.[0].version') - echo "version: $version" - - jq --arg version "${version}" '.version = ($version)' npm/package.json > tmp - mv tmp npm/package.json - - gh pr checkout $pr_number - git add . - git commit -m "Update package.json" - git push - fi diff --git a/Cargo.lock b/Cargo.lock deleted file mode 100644 index 58c1e7ad..00000000 --- a/Cargo.lock +++ /dev/null @@ -1,1326 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "adler" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" - -[[package]] -name = "aho-corasick" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" -dependencies = [ - "memchr", -] - -[[package]] -name = "android-tzdata" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" - -[[package]] -name = "android_system_properties" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" -dependencies = [ - "libc", -] - -[[package]] -name = "anes" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "735d4f398ca57cfa2880225c2bf81c3b9af3be5bb22e44ae70118dad38713e84" - -[[package]] -name = "arca" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f915ddd863ef73f11c10c75170e86db1d4f539689bc6bfb9ce25d6528d6fe83" -dependencies = [ - "clean-path", - "path-slash", - "radix_trie", -] - -[[package]] -name = "autocfg" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" - -[[package]] -name = "base64" -version = "0.22.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" - -[[package]] -name = "bit-set" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1" -dependencies = [ - "bit-vec", -] - -[[package]] -name = "bit-vec" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "bitflags" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" - -[[package]] -name = "bpaf" -version = "0.9.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3280efcf6d66bc77c2cf9b67dc8acee47a217d9be67dd590b3230dffe663724d" - -[[package]] -name = "bumpalo" -version = "3.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" - -[[package]] -name = "byteorder" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" - -[[package]] -name = "cast" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" - -[[package]] -name = "cc" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eaff6f8ce506b9773fa786672d63fc7a191ffea1be33f72bbd4aeacefca9ffc8" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "chrono" -version = "0.4.38" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" -dependencies = [ - "android-tzdata", - "iana-time-zone", - "num-traits", - "serde", - "windows-targets 0.52.6", -] - -[[package]] -name = "ciborium" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42e69ffd6f0917f5c029256a24d0161db17cea3997d185db0d35926308770f0e" -dependencies = [ - "ciborium-io", - "ciborium-ll", - "serde", -] - -[[package]] -name = "ciborium-io" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05afea1e0a06c9be33d539b876f1ce3692f4afea2cb41f740e7743225ed1c757" - -[[package]] -name = "ciborium-ll" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57663b653d948a338bfb3eeba9bb2fd5fcfaecb9e199e87e1eda4d9e8b240fd9" -dependencies = [ - "ciborium-io", - "half", -] - -[[package]] -name = "clean-path" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aaa6b4b263a5d737e9bf6b7c09b72c41a5480aec4d7219af827f6564e950b6a5" - -[[package]] -name = "codspeed" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a104ac948e0188b921eb3fcbdd55dcf62e542df4c7ab7e660623f6288302089" -dependencies = [ - "colored", - "libc", - "serde_json", -] - -[[package]] -name = "colored" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbf2150cce219b664a8a70df7a1f933836724b503f8a413af9365b4dcc4d90b8" -dependencies = [ - "lazy_static", - "windows-sys 0.48.0", -] - -[[package]] -name = "concurrent_lru" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7feb5cb312f774e8a24540e27206db4e890f7d488563671d24a16389cf4c2e4e" -dependencies = [ - "once_cell", -] - -[[package]] -name = "convert_case" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec182b0ca2f35d8fc196cf3404988fd8b8c739a4d270ff118a398feb0cbec1ca" -dependencies = [ - "unicode-segmentation", -] - -[[package]] -name = "core-foundation-sys" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" - -[[package]] -name = "criterion2" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8df39381f28ced0ceebfb5611528d99aef14f8d75b43e9d4ceb6aba66e7b04d" -dependencies = [ - "anes", - "bpaf", - "cast", - "ciborium", - "codspeed", - "colored", - "num-traits", - "oorandom", - "serde", - "serde_json", - "walkdir", -] - -[[package]] -name = "crossbeam-deque" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" -dependencies = [ - "crossbeam-epoch", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.9.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" -dependencies = [ - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" - -[[package]] -name = "crunchy" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" - -[[package]] -name = "ctor" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edb49164822f3ee45b17acd4a208cfc1251410cf0cad9a833234c9890774dd9f" -dependencies = [ - "quote", - "syn", -] - -[[package]] -name = "darling" -version = "0.20.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" -dependencies = [ - "darling_core", - "darling_macro", -] - -[[package]] -name = "darling_core" -version = "0.20.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95133861a8032aaea082871032f5815eb9e98cef03fa916ab4500513994df9e5" -dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "strsim", - "syn", -] - -[[package]] -name = "darling_macro" -version = "0.20.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" -dependencies = [ - "darling_core", - "quote", - "syn", -] - -[[package]] -name = "dashmap" -version = "6.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "804c8821570c3f8b70230c2ba75ffa5c0f9a4189b9a432b6656c536712acae28" -dependencies = [ - "cfg-if", - "crossbeam-utils", - "hashbrown 0.14.5", - "lock_api", - "once_cell", - "parking_lot_core", -] - -[[package]] -name = "deranged" -version = "0.3.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" -dependencies = [ - "powerfmt", - "serde", -] - -[[package]] -name = "document-features" -version = "0.2.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb6969eaabd2421f8a2775cfd2471a2b634372b4a25d41e3bd647b79912850a0" -dependencies = [ - "litrs", -] - -[[package]] -name = "dunce" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" - -[[package]] -name = "either" -version = "1.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" - -[[package]] -name = "endian-type" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" - -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "fancy-regex" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "531e46835a22af56d1e3b66f04844bed63158bc094a628bec1d321d9b4c44bf2" -dependencies = [ - "bit-set", - "regex-automata", - "regex-syntax", -] - -[[package]] -name = "filetime" -version = "0.2.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ee447700ac8aa0b2f2bd7bc4462ad686ba06baa6727ac149a2d6277f0d240fd" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall 0.4.1", - "windows-sys 0.52.0", -] - -[[package]] -name = "fnv" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" - -[[package]] -name = "half" -version = "2.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dd08c532ae367adf81c312a4580bc67f1d0fe8bc9c460520283f4c0ff277888" -dependencies = [ - "cfg-if", - "crunchy", -] - -[[package]] -name = "hashbrown" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" - -[[package]] -name = "hashbrown" -version = "0.14.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "iana-time-zone" -version = "0.1.60" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" -dependencies = [ - "android_system_properties", - "core-foundation-sys", - "iana-time-zone-haiku", - "js-sys", - "wasm-bindgen", - "windows-core", -] - -[[package]] -name = "iana-time-zone-haiku" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" -dependencies = [ - "cc", -] - -[[package]] -name = "ident_case" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" - -[[package]] -name = "indexmap" -version = "1.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" -dependencies = [ - "autocfg", - "hashbrown 0.12.3", - "serde", -] - -[[package]] -name = "indexmap" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93ead53efc7ea8ed3cfb0c79fc8023fbb782a5432b52830b6518941cebe6505c" -dependencies = [ - "equivalent", - "hashbrown 0.14.5", - "serde", -] - -[[package]] -name = "itoa" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" - -[[package]] -name = "js-sys" -version = "0.3.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" -dependencies = [ - "wasm-bindgen", -] - -[[package]] -name = "json-strip-comments" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b271732a960335e715b6b2ae66a086f115c74eb97360e996d2bd809bfc063bba" -dependencies = [ - "memchr", -] - -[[package]] -name = "lazy_static" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" - -[[package]] -name = "libc" -version = "0.2.155" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" - -[[package]] -name = "libloading" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e310b3a6b5907f99202fcdb4960ff45b93735d7c7d96b760fcff8db2dc0e103d" -dependencies = [ - "cfg-if", - "windows-targets 0.52.6", -] - -[[package]] -name = "litrs" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4ce301924b7887e9d637144fdade93f9dfff9b60981d4ac161db09720d39aa5" - -[[package]] -name = "lock_api" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" -dependencies = [ - "autocfg", - "scopeguard", -] - -[[package]] -name = "log" -version = "0.4.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" - -[[package]] -name = "memchr" -version = "2.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" - -[[package]] -name = "miniz_oxide" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" -dependencies = [ - "adler", -] - -[[package]] -name = "napi" -version = "3.0.0-alpha.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ec04344cc540f5897e97c9821ab99e7eb276b4dca6f3e6e441dfa72e5bcde70" -dependencies = [ - "bitflags 2.6.0", - "ctor", - "napi-build", - "napi-sys", - "once_cell", - "serde", - "serde_json", -] - -[[package]] -name = "napi-build" -version = "2.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1c0f5d67ee408a4685b61f5ab7e58605c8ae3f2b4189f0127d804ff13d5560a" - -[[package]] -name = "napi-derive" -version = "3.0.0-alpha.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c6240c4ddca592cde608bbfa26e2af397c3596e413a0c65c9bbcb65c2f1e485" -dependencies = [ - "cfg-if", - "convert_case", - "napi-derive-backend", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "napi-derive-backend" -version = "2.0.0-alpha.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b32dcc50065508fe2f387076c17adbdf10e038d1c080d48b10196813d94ac6a8" -dependencies = [ - "convert_case", - "once_cell", - "proc-macro2", - "quote", - "regex", - "semver", - "syn", -] - -[[package]] -name = "napi-sys" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "427802e8ec3a734331fec1035594a210ce1ff4dc5bc1950530920ab717964ea3" -dependencies = [ - "libloading", -] - -[[package]] -name = "nibble_vec" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" -dependencies = [ - "smallvec", -] - -[[package]] -name = "normalize-path" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5438dd2b2ff4c6df6e1ce22d825ed2fa93ee2922235cc45186991717f0a892d" - -[[package]] -name = "num-conv" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" - -[[package]] -name = "num-traits" -version = "0.2.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" -dependencies = [ - "autocfg", -] - -[[package]] -name = "once_cell" -version = "1.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" - -[[package]] -name = "oorandom" -version = "11.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b410bbe7e14ab526a0e86877eb47c6996a2bd7746f027ba551028c925390e4e9" - -[[package]] -name = "oxc_napi_resolver" -version = "0.0.0" -dependencies = [ - "napi", - "napi-build", - "napi-derive", - "oxc_resolver", - "tracing-subscriber", -] - -[[package]] -name = "oxc_resolver" -version = "1.11.0" -dependencies = [ - "cfg-if", - "criterion2", - "dashmap", - "document-features", - "dunce", - "indexmap 2.4.0", - "json-strip-comments", - "normalize-path", - "once_cell", - "pnp", - "rayon", - "rustc-hash", - "serde", - "serde_json", - "simdutf8", - "thiserror", - "tracing", - "vfs", -] - -[[package]] -name = "parking_lot_core" -version = "0.9.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall 0.5.2", - "smallvec", - "windows-targets 0.52.6", -] - -[[package]] -name = "path-slash" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e91099d4268b0e11973f036e885d652fb0b21fedcf69738c627f94db6a44f42" - -[[package]] -name = "pathdiff" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8835116a5c179084a830efb3adc117ab007512b535bc1a21c991d3b32a6b44dd" - -[[package]] -name = "pin-project-lite" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" - -[[package]] -name = "pnp" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46770cee76a618023fea15411d0449dd066dc232cc17e4562f154da215f27af7" -dependencies = [ - "arca", - "byteorder", - "concurrent_lru", - "fancy-regex", - "lazy_static", - "miniz_oxide", - "pathdiff", - "regex", - "serde", - "serde_json", - "serde_with", - "thiserror", -] - -[[package]] -name = "powerfmt" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" - -[[package]] -name = "proc-macro2" -version = "1.0.86" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.36" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "radix_trie" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" -dependencies = [ - "endian-type", - "nibble_vec", -] - -[[package]] -name = "rayon" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" -dependencies = [ - "either", - "rayon-core", -] - -[[package]] -name = "rayon-core" -version = "1.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" -dependencies = [ - "crossbeam-deque", - "crossbeam-utils", -] - -[[package]] -name = "redox_syscall" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" -dependencies = [ - "bitflags 1.3.2", -] - -[[package]] -name = "redox_syscall" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c82cf8cff14456045f55ec4241383baeff27af886adb72ffb2162f99911de0fd" -dependencies = [ - "bitflags 2.6.0", -] - -[[package]] -name = "regex" -version = "1.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b91213439dad192326a0d7c6ee3955910425f441d7038e0d6933b0aec5c4517f" -dependencies = [ - "aho-corasick", - "memchr", - "regex-automata", - "regex-syntax", -] - -[[package]] -name = "regex-automata" -version = "0.4.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", -] - -[[package]] -name = "regex-syntax" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" - -[[package]] -name = "rustc-hash" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" - -[[package]] -name = "ryu" -version = "1.0.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" - -[[package]] -name = "same-file" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "scopeguard" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" - -[[package]] -name = "semver" -version = "1.0.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" - -[[package]] -name = "serde" -version = "1.0.209" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99fce0ffe7310761ca6bf9faf5115afbc19688edd00171d81b1bb1b116c63e09" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.209" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5831b979fd7b5439637af1752d535ff49f4860c0f341d1baeb6faf0f4242170" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "serde_json" -version = "1.0.127" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8043c06d9f82bd7271361ed64f415fe5e12a77fdb52e573e7f06a516dea329ad" -dependencies = [ - "indexmap 2.4.0", - "itoa", - "memchr", - "ryu", - "serde", -] - -[[package]] -name = "serde_with" -version = "3.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e73139bc5ec2d45e6c5fd85be5a46949c1c39a4c18e56915f5eb4c12f975e377" -dependencies = [ - "base64", - "chrono", - "hex", - "indexmap 1.9.3", - "indexmap 2.4.0", - "serde", - "serde_derive", - "serde_json", - "serde_with_macros", - "time", -] - -[[package]] -name = "serde_with_macros" -version = "3.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b80d3d6b56b64335c0180e5ffde23b3c5e08c14c585b51a15bd0e95393f46703" -dependencies = [ - "darling", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "sharded-slab" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" -dependencies = [ - "lazy_static", -] - -[[package]] -name = "simdutf8" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f27f6278552951f1f2b8cf9da965d10969b2efdea95a6ec47987ab46edfe263a" - -[[package]] -name = "smallvec" -version = "1.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" - -[[package]] -name = "strsim" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" - -[[package]] -name = "syn" -version = "2.0.70" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f0209b68b3613b093e0ec905354eccaedcfe83b8cb37cbdeae64026c3064c16" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "thiserror" -version = "1.0.63" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.63" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "thread_local" -version = "1.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" -dependencies = [ - "cfg-if", - "once_cell", -] - -[[package]] -name = "time" -version = "0.3.36" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" -dependencies = [ - "deranged", - "itoa", - "num-conv", - "powerfmt", - "serde", - "time-core", - "time-macros", -] - -[[package]] -name = "time-core" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" - -[[package]] -name = "time-macros" -version = "0.2.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" -dependencies = [ - "num-conv", - "time-core", -] - -[[package]] -name = "tracing" -version = "0.1.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" -dependencies = [ - "pin-project-lite", - "tracing-attributes", - "tracing-core", -] - -[[package]] -name = "tracing-attributes" -version = "0.1.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "tracing-core" -version = "0.1.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" -dependencies = [ - "once_cell", -] - -[[package]] -name = "tracing-subscriber" -version = "0.3.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" -dependencies = [ - "sharded-slab", - "thread_local", - "tracing-core", -] - -[[package]] -name = "unicode-ident" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" - -[[package]] -name = "unicode-segmentation" -version = "1.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" - -[[package]] -name = "vfs" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "654cd097e182a71dbf899178e6b5662c2157dd0b8afd5975de18008f6fc173d1" -dependencies = [ - "filetime", -] - -[[package]] -name = "walkdir" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" -dependencies = [ - "same-file", - "winapi-util", -] - -[[package]] -name = "wasm-bindgen" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" -dependencies = [ - "cfg-if", - "wasm-bindgen-macro", -] - -[[package]] -name = "wasm-bindgen-backend" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" -dependencies = [ - "bumpalo", - "log", - "once_cell", - "proc-macro2", - "quote", - "syn", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-macro" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" -dependencies = [ - "quote", - "wasm-bindgen-macro-support", -] - -[[package]] -name = "wasm-bindgen-macro-support" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" -dependencies = [ - "proc-macro2", - "quote", - "syn", - "wasm-bindgen-backend", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-shared" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" - -[[package]] -name = "winapi-util" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b" -dependencies = [ - "windows-sys 0.52.0", -] - -[[package]] -name = "windows-core" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" -dependencies = [ - "windows-targets 0.52.6", -] - -[[package]] -name = "windows-sys" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" -dependencies = [ - "windows-targets 0.48.5", -] - -[[package]] -name = "windows-sys" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" -dependencies = [ - "windows-targets 0.52.6", -] - -[[package]] -name = "windows-targets" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" -dependencies = [ - "windows_aarch64_gnullvm 0.48.5", - "windows_aarch64_msvc 0.48.5", - "windows_i686_gnu 0.48.5", - "windows_i686_msvc 0.48.5", - "windows_x86_64_gnu 0.48.5", - "windows_x86_64_gnullvm 0.48.5", - "windows_x86_64_msvc 0.48.5", -] - -[[package]] -name = "windows-targets" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" -dependencies = [ - "windows_aarch64_gnullvm 0.52.6", - "windows_aarch64_msvc 0.52.6", - "windows_i686_gnu 0.52.6", - "windows_i686_gnullvm", - "windows_i686_msvc 0.52.6", - "windows_x86_64_gnu 0.52.6", - "windows_x86_64_gnullvm 0.52.6", - "windows_x86_64_msvc 0.52.6", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" - -[[package]] -name = "windows_i686_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" - -[[package]] -name = "windows_i686_gnu" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" - -[[package]] -name = "windows_i686_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" - -[[package]] -name = "windows_i686_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" - -[[package]] -name = "windows_i686_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" diff --git a/src/builtins.rs b/Source/builtins.rs similarity index 100% rename from src/builtins.rs rename to Source/builtins.rs diff --git a/src/cache.rs b/Source/cache.rs similarity index 100% rename from src/cache.rs rename to Source/cache.rs diff --git a/src/context.rs b/Source/context.rs similarity index 100% rename from src/context.rs rename to Source/context.rs diff --git a/src/error.rs b/Source/error.rs similarity index 100% rename from src/error.rs rename to Source/error.rs diff --git a/src/file_system.rs b/Source/file_system.rs similarity index 100% rename from src/file_system.rs rename to Source/file_system.rs diff --git a/src/lib.rs b/Source/lib.rs similarity index 100% rename from src/lib.rs rename to Source/lib.rs diff --git a/src/options.rs b/Source/options.rs similarity index 100% rename from src/options.rs rename to Source/options.rs diff --git a/src/package_json.rs b/Source/package_json.rs similarity index 100% rename from src/package_json.rs rename to Source/package_json.rs diff --git a/src/path.rs b/Source/path.rs similarity index 100% rename from src/path.rs rename to Source/path.rs diff --git a/src/resolution.rs b/Source/resolution.rs similarity index 100% rename from src/resolution.rs rename to Source/resolution.rs diff --git a/src/specifier.rs b/Source/specifier.rs similarity index 100% rename from src/specifier.rs rename to Source/specifier.rs diff --git a/src/tsconfig.rs b/Source/tsconfig.rs similarity index 100% rename from src/tsconfig.rs rename to Source/tsconfig.rs diff --git a/fixtures/enhanced_resolve/lib/index.js b/fixtures/enhanced_resolve/lib/index.js deleted file mode 100644 index 1e872e8f..00000000 --- a/fixtures/enhanced_resolve/lib/index.js +++ /dev/null @@ -1 +0,0 @@ -// mimic enhanced-resolved root directory structure diff --git a/fixtures/enhanced_resolve/package.json b/fixtures/enhanced_resolve/package.json deleted file mode 100644 index d1b845b5..00000000 --- a/fixtures/enhanced_resolve/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "enhanced-resolve", - "main": "lib/index.js" -} diff --git a/fixtures/enhanced_resolve/test/.gitignore b/fixtures/enhanced_resolve/test/.gitignore deleted file mode 100644 index b021b4e4..00000000 --- a/fixtures/enhanced_resolve/test/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -# created by symlink.rs -/temp -/temp_symlinks \ No newline at end of file diff --git a/fixtures/enhanced_resolve/test/fixtures/#/a.js b/fixtures/enhanced_resolve/test/fixtures/#/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/a.js b/fixtures/enhanced_resolve/test/fixtures/a.js deleted file mode 100644 index 896ffc6d..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/abc.txt b/fixtures/enhanced_resolve/test/fixtures/abc.txt deleted file mode 100644 index f2ba8f84..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/abc.txt +++ /dev/null @@ -1 +0,0 @@ -abc \ No newline at end of file diff --git a/fixtures/enhanced_resolve/test/fixtures/alias/files/a.js b/fixtures/enhanced_resolve/test/fixtures/alias/files/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/b.js b/fixtures/enhanced_resolve/test/fixtures/b.js deleted file mode 100644 index 11476340..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/b.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function b() { - return "This is b"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/browser/module-a.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/browser/module-a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/browser.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/ignore.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/ignore.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/replaced.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/replaced.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/self.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/self.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/toString.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/toString.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-a.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-b.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-c.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-c.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/a.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/b.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/c.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/c.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/d.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/d.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json deleted file mode 100644 index c13fe23b..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "browser": { - "a.js": "./a", - "./b.js": "./b", - "c.js": "./d.js", - "./d.js": "./c.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/package.json b/fixtures/enhanced_resolve/test/fixtures/browser-module/package.json deleted file mode 100644 index 19ff7739..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/browser-module/package.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "exports": { - "./lib/index.js": "./lib/index.js" - }, - "browser": { - "./lib/ignore.js": false, - "./lib/replaced.js": "./lib/browser", - "module-a": "./browser/module-a.js", - "module-b": "module-c", - "module-c": "module-c", - "./toString": "./lib/toString.js", - "./lib/main.js": "./lib/main.js", - "./main.js": "./lib/main.js", - "./lib/xyz.js": "./xyz.js", - "./xyz.js": "./lib/xyz.js", - "./lib/non-existent.js": "./lib/non-existent.js", - ".": false, - "./number": 1, - "./foo": "./lib/replaced.js?query" - }, - "innerBrowser1": { - "field": { - "browser": { - "./lib/main1.js": "./lib/main.js" - } - } - }, - "innerBrowser2": { - "browser": { - "./lib/main2.js": "./lib/replaced.js" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/builtins/package.json b/fixtures/enhanced_resolve/test/fixtures/builtins/package.json deleted file mode 100644 index 4a54ea96..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/builtins/package.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "name": "builtins", - "private": true, - "imports": { - "#fs": { - "default": "fs" - }, - "#http": { - "node": "node:http" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/c.js b/fixtures/enhanced_resolve/test/fixtures/c.js deleted file mode 100644 index e3aca8aa..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/c.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = function b() { - require("./a"); - return "This is c"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/complex.js b/fixtures/enhanced_resolve/test/fixtures/complex.js deleted file mode 100644 index 1f62db84..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/complex.js +++ /dev/null @@ -1,13 +0,0 @@ -var 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); diff --git a/fixtures/enhanced_resolve/test/fixtures/crypto-js/index.js b/fixtures/enhanced_resolve/test/fixtures/crypto-js/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json b/fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json deleted file mode 100644 index 1d31aa8b..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "crypto-js", - "main": "index.js", - "browser": { - "crypto": false - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/decorated-fs/exists.js b/fixtures/enhanced_resolve/test/fixtures/decorated-fs/exists.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/dirOrFile.js b/fixtures/enhanced_resolve/test/fixtures/dirOrFile.js deleted file mode 100644 index c3cb885f..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/dirOrFile.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "file"; diff --git a/fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js b/fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js deleted file mode 100644 index 85e01cd4..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "dir"; diff --git a/fixtures/enhanced_resolve/test/fixtures/directory-default/directory-default.js b/fixtures/enhanced_resolve/test/fixtures/directory-default/directory-default.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js deleted file mode 100644 index d1007aae..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js +++ /dev/null @@ -1 +0,0 @@ -export default "string"; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts deleted file mode 100644 index cb0ff5c3..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json deleted file mode 100644 index b523a1e9..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "@org/pkg", - "exports": { - "./*.js": { - "types": "./dist/*.d.ts", - "default": "./dist/*.js" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js deleted file mode 100644 index d1007aae..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js +++ /dev/null @@ -1 +0,0 @@ -export default "string"; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts deleted file mode 100644 index cb0ff5c3..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json deleted file mode 100644 index 8e55fb46..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "@raviqqe/hidash", - "exports": { - "./*.js": { - "types": "./dist/*.d.ts", - "default": "./dist/*.js" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json deleted file mode 100644 index f0edf449..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "exports-field", - "version": "1.0.0", - "exports": { - ".": "./a/../b/../../pack1/index.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/pack1/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/pack1/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/a.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/a.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json deleted file mode 100644 index 6b105c08..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "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/": { - "webpack": ["./lib/lib2/", "./lib/"], - "node": "./lib/", - "default": "./lib/" - }, - "./dist/a.js": "./../../a.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json deleted file mode 100644 index 0012a3de..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "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" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/umd.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/umd.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field/package.json deleted file mode 100644 index 5fa72bb5..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "@exports-field/core", - "version": "1.0.0", - "exports": "./a.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json deleted file mode 100644 index e6f12074..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "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/lib2/", "./lib/"], - "node": "./lib/", - "default": "./lib/" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/index b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/index deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json deleted file mode 100644 index 1a838f49..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "name": "exports-field", - "exportsField": { - "exports": "./main.js" - }, - "ex": "./index", - "broken": { - ".": "./src" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/src/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/src/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.ts b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.mts b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.mts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mjs b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mjs deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mts.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mts.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.ts b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/app.module.js b/fixtures/enhanced_resolve/test/fixtures/extensions/app.module.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.js b/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/foo.js b/fixtures/enhanced_resolve/test/fixtures/extensions/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/foo.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/foo.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/index.js b/fixtures/enhanced_resolve/test/fixtures/extensions/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/index.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module.js b/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module/index.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/package.json b/fixtures/enhanced_resolve/test/fixtures/extensions/package.json deleted file mode 100644 index 5e55a1e8..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/extensions/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "./index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/file.load1 b/fixtures/enhanced_resolve/test/fixtures/file.load1 deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/file.load2 b/fixtures/enhanced_resolve/test/fixtures/file.load2 deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/foo/index.js b/fixtures/enhanced_resolve/test/fixtures/foo/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/foo/package.json b/fixtures/enhanced_resolve/test/fixtures/foo/package.json deleted file mode 100644 index da86787a..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/foo/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "foo", - "version": "1.0.0" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json deleted file mode 100644 index aa2be496..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "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" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/internal/file.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/internal/file.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/y/y.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/y/y.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/internal/i.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/internal/i.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/nested/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js deleted file mode 100644 index e5b70a86..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = { nested: "nested" } diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-3/nested/f/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-3/nested/f/nested/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-4/f/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-4/f/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f$/$.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f$/$.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f/$.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f/$.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/nested/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/a.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/a.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/b.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/dir/b.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/dir/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/index.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json deleted file mode 100644 index 8d8d3a46..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "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/lib2/", "./lib/"], - "node": "./lib/", - "default": "./lib/" - }, - "./dist/a.js": "./../../a.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/c/index.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/c/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/imports-field/package.json deleted file mode 100644 index 248351a9..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "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" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/a.js b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json deleted file mode 100644 index ded7faa2..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json +++ /dev/null @@ -1,2 +0,0 @@ -{ - "main": "./a.js", diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/a.js b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/package.json b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/package.json deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/issue-238/package.json b/fixtures/enhanced_resolve/test/fixtures/issue-238/package.json deleted file mode 100644 index 352055cd..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/issue-238/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "private": true -} diff --git a/fixtures/enhanced_resolve/test/fixtures/issue-238/src/a/config.js b/fixtures/enhanced_resolve/test/fixtures/issue-238/src/a/config.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/issue-238/src/common/config/myObjectFile.js b/fixtures/enhanced_resolve/test/fixtures/issue-238/src/common/config/myObjectFile.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/lib.js b/fixtures/enhanced_resolve/test/fixtures/lib.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/lib/complex1.js b/fixtures/enhanced_resolve/test/fixtures/lib/complex1.js deleted file mode 100644 index b3de3d70..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/lib/complex1.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "lib complex1"; diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self/index.js b/fixtures/enhanced_resolve/test/fixtures/main-field-self/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json b/fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json deleted file mode 100644 index a2b6f341..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "./" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self2/index.js b/fixtures/enhanced_resolve/test/fixtures/main-field-self2/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json b/fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json deleted file mode 100644 index 4fa6f730..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "." -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main1.js b/fixtures/enhanced_resolve/test/fixtures/main1.js deleted file mode 100644 index 168f2a1e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main1.js +++ /dev/null @@ -1,9 +0,0 @@ -var a = require("./a"); -if (x) { - for (var i = 0; i < 100; i++) { - while (true) require("./b"); - do { - i++; - } while (require("m1/a")()); - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main2.js b/fixtures/enhanced_resolve/test/fixtures/main2.js deleted file mode 100644 index 39f062b1..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main2.js +++ /dev/null @@ -1,12 +0,0 @@ -var 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"); - }); - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main3.js b/fixtures/enhanced_resolve/test/fixtures/main3.js deleted file mode 100644 index 1c180166..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main3.js +++ /dev/null @@ -1,4 +0,0 @@ -var a = require("./a"); -require.ensure([], function(require) { - require("./c.js"); -}); diff --git a/fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js b/fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js deleted file mode 100644 index 997c1051..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is nested m1/a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/no#fragment/#/#.js b/fixtures/enhanced_resolve/test/fixtures/no#fragment/#/#.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/no.js b/fixtures/enhanced_resolve/test/fixtures/no.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/browser.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/browser.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/main.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json deleted file mode 100644 index c469e1fd..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "main": "./main.js", - "browser": "./browser.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js deleted file mode 100644 index 549620a5..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "the correct a.js"; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js deleted file mode 100644 index 5db6632e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = " :) " + require("m2/b.js"); diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js deleted file mode 100644 index d308569d..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require("m1/a") + require("m1"); diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js deleted file mode 100644 index cb8127e8..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "Step2"; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json deleted file mode 100644 index 8d6dfa56..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "dash-name", - "exports": "./index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json deleted file mode 100644 index 4fd8706e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "dash", - "exports": "./index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/invalidPackageJson/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/invalidPackageJson/package.json deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js deleted file mode 100644 index 46fc8e6c..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is m1/a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js deleted file mode 100644 index 8565c244..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is m1/b"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js deleted file mode 100644 index 34faaaf5..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "This is m2/b"; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/file.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/file.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js b/fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js deleted file mode 100644 index 997c1051..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is nested m1/a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/dir/index.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/dir/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/index.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/main.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/browser.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/browser.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/index.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json deleted file mode 100644 index e20ceaeb..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "main": "main.js", - "browser": { - "./package-alias/index.js": "./package-alias/browser.js", - "module": "pkg/dir/index" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/typescript/index.ts b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/typescript/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json deleted file mode 100644 index 4a1f838e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "@exports-field/core", - "version": "1.0.0", - "exports": { - ".": "./a.js", - "./x": "./a.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/prefer-pnp/alternative-modules/m1/b.js b/fixtures/enhanced_resolve/test/fixtures/prefer-pnp/alternative-modules/m1/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.css b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.css deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.js b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json deleted file mode 100644 index 14ab704d..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/index.css b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/index.css deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/module.js b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/module.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json deleted file mode 100644 index ee0eb71b..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "main": "../../../c.js", - "module": "module.js", - "style": "index.css" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/roots_fall_through/index.js b/fixtures/enhanced_resolve/test/fixtures/roots_fall_through/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/main.js b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json deleted file mode 100644 index 70a0f20f..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "browser": { - "./index.js": "./main.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/lib/index.js b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/lib/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/main.js b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json deleted file mode 100644 index 2af9e0d1..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "./main.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/shortcutdir.js/a.js b/fixtures/enhanced_resolve/test/fixtures/shortcutdir.js/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/b b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/b deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/c b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/c deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/a b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/a deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/b b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/b deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/b/foo/a b/fixtures/enhanced_resolve/test/fixtures/yield/b/foo/a deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/a b/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/a deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json b/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json deleted file mode 100644 index 0acc4b4c..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "foo", - "version": "1.0.0", - "browser": { - "./a": false - } -} diff --git "a/fixtures/enhanced_resolve/test/fixtures/\346\265\213\350\257\225.js" "b/fixtures/enhanced_resolve/test/fixtures/\346\265\213\350\257\225.js" deleted file mode 100644 index e69de29b..00000000 diff --git "a/fixtures/misc/\344\270\255\346\226\207/\344\270\255\346\226\207.js" "b/fixtures/misc/\344\270\255\346\226\207/\344\270\255\346\226\207.js" deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/pnp/.gitignore b/fixtures/pnp/.gitignore deleted file mode 100644 index 1783c71a..00000000 --- a/fixtures/pnp/.gitignore +++ /dev/null @@ -1 +0,0 @@ -install_state.gz \ No newline at end of file diff --git a/fixtures/pnp/.pnp.cjs b/fixtures/pnp/.pnp.cjs deleted file mode 100755 index 2a8d1771..00000000 --- a/fixtures/pnp/.pnp.cjs +++ /dev/null @@ -1,7543 +0,0 @@ -#!/usr/bin/env node -/* eslint-disable */ -// @ts-nocheck -"use strict"; - -const RAW_RUNTIME_STATE = -'{\ - "__info": [\ - "This file is automatically generated. Do not touch it, or risk",\ - "your modifications being lost."\ - ],\ - "dependencyTreeRoots": [\ - {\ - "name": "pnp",\ - "reference": "workspace:."\ - }\ - ],\ - "enableTopLevelFallback": true,\ - "ignorePatternData": "(^(?:\\\\.yarn\\\\/sdks(?:\\\\/(?!\\\\.{1,2}(?:\\\\/|$))(?:(?:(?!(?:^|\\\\/)\\\\.{1,2}(?:\\\\/|$)).)*?)|$))$)",\ - "fallbackExclusionList": [\ - ["pnp", ["workspace:."]]\ - ],\ - "fallbackPool": [\ - ],\ - "packageRegistryData": [\ - [null, [\ - [null, {\ - "packageLocation": "./",\ - "packageDependencies": [\ - ["is-even", "npm:1.0.0"],\ - ["is-odd", "npm:3.0.1"]\ - ],\ - "linkType": "SOFT"\ - }]\ - ]],\ - ["is-buffer", [\ - ["npm:1.1.6", {\ - "packageLocation": "./.yarn/cache/is-buffer-npm-1.1.6-08199d9ccc-ae18aa0b6e.zip/node_modules/is-buffer/",\ - "packageDependencies": [\ - ["is-buffer", "npm:1.1.6"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["is-even", [\ - ["npm:1.0.0", {\ - "packageLocation": "./.yarn/cache/is-even-npm-1.0.0-9f726520dc-2728cc2f39.zip/node_modules/is-even/",\ - "packageDependencies": [\ - ["is-even", "npm:1.0.0"],\ - ["is-odd", "npm:0.1.2"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["is-number", [\ - ["npm:3.0.0", {\ - "packageLocation": "./.yarn/cache/is-number-npm-3.0.0-9088035ade-e639c54640.zip/node_modules/is-number/",\ - "packageDependencies": [\ - ["is-number", "npm:3.0.0"],\ - ["kind-of", "npm:3.2.2"]\ - ],\ - "linkType": "HARD"\ - }],\ - ["npm:6.0.0", {\ - "packageLocation": "./.yarn/cache/is-number-npm-6.0.0-30881e83e6-5da4c68401.zip/node_modules/is-number/",\ - "packageDependencies": [\ - ["is-number", "npm:6.0.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["is-odd", [\ - ["npm:0.1.2", {\ - "packageLocation": "./.yarn/cache/is-odd-npm-0.1.2-9d980a9da8-7dc6c6fd00.zip/node_modules/is-odd/",\ - "packageDependencies": [\ - ["is-odd", "npm:0.1.2"],\ - ["is-number", "npm:3.0.0"]\ - ],\ - "linkType": "HARD"\ - }],\ - ["npm:3.0.1", {\ - "packageLocation": "./.yarn/cache/is-odd-npm-3.0.1-93c3c3f41b-89ee2e353c.zip/node_modules/is-odd/",\ - "packageDependencies": [\ - ["is-odd", "npm:3.0.1"],\ - ["is-number", "npm:6.0.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["kind-of", [\ - ["npm:3.2.2", {\ - "packageLocation": "./.yarn/cache/kind-of-npm-3.2.2-7deaffa5f9-7e34bc29d4.zip/node_modules/kind-of/",\ - "packageDependencies": [\ - ["kind-of", "npm:3.2.2"],\ - ["is-buffer", "npm:1.1.6"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["pnp", [\ - ["workspace:.", {\ - "packageLocation": "./",\ - "packageDependencies": [\ - ["pnp", "workspace:."],\ - ["is-even", "npm:1.0.0"],\ - ["is-odd", "npm:3.0.1"]\ - ],\ - "linkType": "SOFT"\ - }]\ - ]]\ - ]\ -}'; - -function $$SETUP_STATE(hydrateRuntimeState, basePath) { - return hydrateRuntimeState(JSON.parse(RAW_RUNTIME_STATE), {basePath: basePath || __dirname}); -} - -const fs = require('fs'); -const path = require('path'); -const crypto = require('crypto'); -const os = require('os'); -const events = require('events'); -const nodeUtils = require('util'); -const stream = require('stream'); -const zlib = require('zlib'); -const require$$0 = require('module'); -const StringDecoder = require('string_decoder'); -const url = require('url'); -const buffer = require('buffer'); -const readline = require('readline'); -const assert = require('assert'); - -const _interopDefaultLegacy = e => e && typeof e === 'object' && 'default' in e ? e : { default: e }; - -function _interopNamespace(e) { - if (e && e.__esModule) return e; - const n = Object.create(null); - if (e) { - for (const k in e) { - if (k !== 'default') { - const d = Object.getOwnPropertyDescriptor(e, k); - Object.defineProperty(n, k, d.get ? d : { - enumerable: true, - get: () => e[k] - }); - } - } - } - n.default = e; - return Object.freeze(n); -} - -const fs__default = /*#__PURE__*/_interopDefaultLegacy(fs); -const path__default = /*#__PURE__*/_interopDefaultLegacy(path); -const nodeUtils__namespace = /*#__PURE__*/_interopNamespace(nodeUtils); -const zlib__default = /*#__PURE__*/_interopDefaultLegacy(zlib); -const require$$0__default = /*#__PURE__*/_interopDefaultLegacy(require$$0); -const StringDecoder__default = /*#__PURE__*/_interopDefaultLegacy(StringDecoder); -const buffer__default = /*#__PURE__*/_interopDefaultLegacy(buffer); -const assert__default = /*#__PURE__*/_interopDefaultLegacy(assert); - -const S_IFMT = 61440; -const S_IFDIR = 16384; -const S_IFREG = 32768; -const S_IFLNK = 40960; -const SAFE_TIME = 456789e3; - -function makeError$1(code, message) { - return Object.assign(new Error(`${code}: ${message}`), { code }); -} -function EBUSY(message) { - return makeError$1(`EBUSY`, message); -} -function ENOSYS(message, reason) { - return makeError$1(`ENOSYS`, `${message}, ${reason}`); -} -function EINVAL(reason) { - return makeError$1(`EINVAL`, `invalid argument, ${reason}`); -} -function EBADF(reason) { - return makeError$1(`EBADF`, `bad file descriptor, ${reason}`); -} -function ENOENT(reason) { - return makeError$1(`ENOENT`, `no such file or directory, ${reason}`); -} -function ENOTDIR(reason) { - return makeError$1(`ENOTDIR`, `not a directory, ${reason}`); -} -function EISDIR(reason) { - return makeError$1(`EISDIR`, `illegal operation on a directory, ${reason}`); -} -function EEXIST(reason) { - return makeError$1(`EEXIST`, `file already exists, ${reason}`); -} -function EROFS(reason) { - return makeError$1(`EROFS`, `read-only filesystem, ${reason}`); -} -function ENOTEMPTY(reason) { - return makeError$1(`ENOTEMPTY`, `directory not empty, ${reason}`); -} -function EOPNOTSUPP(reason) { - return makeError$1(`EOPNOTSUPP`, `operation not supported, ${reason}`); -} -function ERR_DIR_CLOSED() { - return makeError$1(`ERR_DIR_CLOSED`, `Directory handle was closed`); -} - -const DEFAULT_MODE = S_IFREG | 420; -class StatEntry { - constructor() { - this.uid = 0; - this.gid = 0; - this.size = 0; - this.blksize = 0; - this.atimeMs = 0; - this.mtimeMs = 0; - this.ctimeMs = 0; - this.birthtimeMs = 0; - this.atime = new Date(0); - this.mtime = new Date(0); - this.ctime = new Date(0); - this.birthtime = new Date(0); - this.dev = 0; - this.ino = 0; - this.mode = DEFAULT_MODE; - this.nlink = 1; - this.rdev = 0; - this.blocks = 1; - } - isBlockDevice() { - return false; - } - isCharacterDevice() { - return false; - } - isDirectory() { - return (this.mode & S_IFMT) === S_IFDIR; - } - isFIFO() { - return false; - } - isFile() { - return (this.mode & S_IFMT) === S_IFREG; - } - isSocket() { - return false; - } - isSymbolicLink() { - return (this.mode & S_IFMT) === S_IFLNK; - } -} -class BigIntStatsEntry { - constructor() { - this.uid = BigInt(0); - this.gid = BigInt(0); - this.size = BigInt(0); - this.blksize = BigInt(0); - this.atimeMs = BigInt(0); - this.mtimeMs = BigInt(0); - this.ctimeMs = BigInt(0); - this.birthtimeMs = BigInt(0); - this.atimeNs = BigInt(0); - this.mtimeNs = BigInt(0); - this.ctimeNs = BigInt(0); - this.birthtimeNs = BigInt(0); - this.atime = new Date(0); - this.mtime = new Date(0); - this.ctime = new Date(0); - this.birthtime = new Date(0); - this.dev = BigInt(0); - this.ino = BigInt(0); - this.mode = BigInt(DEFAULT_MODE); - this.nlink = BigInt(1); - this.rdev = BigInt(0); - this.blocks = BigInt(1); - } - isBlockDevice() { - return false; - } - isCharacterDevice() { - return false; - } - isDirectory() { - return (this.mode & BigInt(S_IFMT)) === BigInt(S_IFDIR); - } - isFIFO() { - return false; - } - isFile() { - return (this.mode & BigInt(S_IFMT)) === BigInt(S_IFREG); - } - isSocket() { - return false; - } - isSymbolicLink() { - return (this.mode & BigInt(S_IFMT)) === BigInt(S_IFLNK); - } -} -function makeDefaultStats() { - return new StatEntry(); -} -function clearStats(stats) { - for (const key in stats) { - if (Object.hasOwn(stats, key)) { - const element = stats[key]; - if (typeof element === `number`) { - stats[key] = 0; - } else if (typeof element === `bigint`) { - stats[key] = BigInt(0); - } else if (nodeUtils__namespace.types.isDate(element)) { - stats[key] = new Date(0); - } - } - } - return stats; -} -function convertToBigIntStats(stats) { - const bigintStats = new BigIntStatsEntry(); - for (const key in stats) { - if (Object.hasOwn(stats, key)) { - const element = stats[key]; - if (typeof element === `number`) { - bigintStats[key] = BigInt(element); - } else if (nodeUtils__namespace.types.isDate(element)) { - bigintStats[key] = new Date(element); - } - } - } - bigintStats.atimeNs = bigintStats.atimeMs * BigInt(1e6); - bigintStats.mtimeNs = bigintStats.mtimeMs * BigInt(1e6); - bigintStats.ctimeNs = bigintStats.ctimeMs * BigInt(1e6); - bigintStats.birthtimeNs = bigintStats.birthtimeMs * BigInt(1e6); - return bigintStats; -} -function areStatsEqual(a, b) { - if (a.atimeMs !== b.atimeMs) - return false; - if (a.birthtimeMs !== b.birthtimeMs) - return false; - if (a.blksize !== b.blksize) - return false; - if (a.blocks !== b.blocks) - return false; - if (a.ctimeMs !== b.ctimeMs) - return false; - if (a.dev !== b.dev) - return false; - if (a.gid !== b.gid) - return false; - if (a.ino !== b.ino) - return false; - if (a.isBlockDevice() !== b.isBlockDevice()) - return false; - if (a.isCharacterDevice() !== b.isCharacterDevice()) - return false; - if (a.isDirectory() !== b.isDirectory()) - return false; - if (a.isFIFO() !== b.isFIFO()) - return false; - if (a.isFile() !== b.isFile()) - return false; - if (a.isSocket() !== b.isSocket()) - return false; - if (a.isSymbolicLink() !== b.isSymbolicLink()) - return false; - if (a.mode !== b.mode) - return false; - if (a.mtimeMs !== b.mtimeMs) - return false; - if (a.nlink !== b.nlink) - return false; - if (a.rdev !== b.rdev) - return false; - if (a.size !== b.size) - return false; - if (a.uid !== b.uid) - return false; - const aN = a; - const bN = b; - if (aN.atimeNs !== bN.atimeNs) - return false; - if (aN.mtimeNs !== bN.mtimeNs) - return false; - if (aN.ctimeNs !== bN.ctimeNs) - return false; - if (aN.birthtimeNs !== bN.birthtimeNs) - return false; - return true; -} - -const PortablePath = { - root: `/`, - dot: `.`, - parent: `..` -}; -const Filename = { - home: `~`, - nodeModules: `node_modules`, - manifest: `package.json`, - lockfile: `yarn.lock`, - virtual: `__virtual__`, - pnpJs: `.pnp.js`, - pnpCjs: `.pnp.cjs`, - pnpData: `.pnp.data.json`, - pnpEsmLoader: `.pnp.loader.mjs`, - rc: `.yarnrc.yml`, - env: `.env` -}; -const npath = Object.create(path__default.default); -const ppath = Object.create(path__default.default.posix); -npath.cwd = () => process.cwd(); -ppath.cwd = process.platform === `win32` ? () => toPortablePath(process.cwd()) : process.cwd; -if (process.platform === `win32`) { - ppath.resolve = (...segments) => { - if (segments.length > 0 && ppath.isAbsolute(segments[0])) { - return path__default.default.posix.resolve(...segments); - } else { - return path__default.default.posix.resolve(ppath.cwd(), ...segments); - } - }; -} -const contains = function(pathUtils, from, to) { - from = pathUtils.normalize(from); - to = pathUtils.normalize(to); - if (from === to) - return `.`; - if (!from.endsWith(pathUtils.sep)) - from = from + pathUtils.sep; - if (to.startsWith(from)) { - return to.slice(from.length); - } else { - return null; - } -}; -npath.contains = (from, to) => contains(npath, from, to); -ppath.contains = (from, to) => contains(ppath, from, to); -const WINDOWS_PATH_REGEXP = /^([a-zA-Z]:.*)$/; -const UNC_WINDOWS_PATH_REGEXP = /^\/\/(\.\/)?(.*)$/; -const PORTABLE_PATH_REGEXP = /^\/([a-zA-Z]:.*)$/; -const UNC_PORTABLE_PATH_REGEXP = /^\/unc\/(\.dot\/)?(.*)$/; -function fromPortablePathWin32(p) { - let portablePathMatch, uncPortablePathMatch; - if (portablePathMatch = p.match(PORTABLE_PATH_REGEXP)) - p = portablePathMatch[1]; - else if (uncPortablePathMatch = p.match(UNC_PORTABLE_PATH_REGEXP)) - p = `\\\\${uncPortablePathMatch[1] ? `.\\` : ``}${uncPortablePathMatch[2]}`; - else - return p; - return p.replace(/\//g, `\\`); -} -function toPortablePathWin32(p) { - p = p.replace(/\\/g, `/`); - let windowsPathMatch, uncWindowsPathMatch; - if (windowsPathMatch = p.match(WINDOWS_PATH_REGEXP)) - p = `/${windowsPathMatch[1]}`; - else if (uncWindowsPathMatch = p.match(UNC_WINDOWS_PATH_REGEXP)) - p = `/unc/${uncWindowsPathMatch[1] ? `.dot/` : ``}${uncWindowsPathMatch[2]}`; - return p; -} -const toPortablePath = process.platform === `win32` ? toPortablePathWin32 : (p) => p; -const fromPortablePath = process.platform === `win32` ? fromPortablePathWin32 : (p) => p; -npath.fromPortablePath = fromPortablePath; -npath.toPortablePath = toPortablePath; -function convertPath(targetPathUtils, sourcePath) { - return targetPathUtils === npath ? fromPortablePath(sourcePath) : toPortablePath(sourcePath); -} - -const defaultTime = new Date(SAFE_TIME * 1e3); -const defaultTimeMs = defaultTime.getTime(); -async function copyPromise(destinationFs, destination, sourceFs, source, opts) { - const normalizedDestination = destinationFs.pathUtils.normalize(destination); - const normalizedSource = sourceFs.pathUtils.normalize(source); - const prelayout = []; - const postlayout = []; - const { atime, mtime } = opts.stableTime ? { atime: defaultTime, mtime: defaultTime } : await sourceFs.lstatPromise(normalizedSource); - await destinationFs.mkdirpPromise(destinationFs.pathUtils.dirname(destination), { utimes: [atime, mtime] }); - await copyImpl(prelayout, postlayout, destinationFs, normalizedDestination, sourceFs, normalizedSource, { ...opts, didParentExist: true }); - for (const operation of prelayout) - await operation(); - await Promise.all(postlayout.map((operation) => { - return operation(); - })); -} -async function copyImpl(prelayout, postlayout, destinationFs, destination, sourceFs, source, opts) { - const destinationStat = opts.didParentExist ? await maybeLStat(destinationFs, destination) : null; - const sourceStat = await sourceFs.lstatPromise(source); - const { atime, mtime } = opts.stableTime ? { atime: defaultTime, mtime: defaultTime } : sourceStat; - let updated; - switch (true) { - case sourceStat.isDirectory(): - { - updated = await copyFolder(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts); - } - break; - case sourceStat.isFile(): - { - updated = await copyFile(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts); - } - break; - case sourceStat.isSymbolicLink(): - { - updated = await copySymlink(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts); - } - break; - default: { - throw new Error(`Unsupported file type (${sourceStat.mode})`); - } - } - if (opts.linkStrategy?.type !== `HardlinkFromIndex` || !sourceStat.isFile()) { - if (updated || destinationStat?.mtime?.getTime() !== mtime.getTime() || destinationStat?.atime?.getTime() !== atime.getTime()) { - postlayout.push(() => destinationFs.lutimesPromise(destination, atime, mtime)); - updated = true; - } - if (destinationStat === null || (destinationStat.mode & 511) !== (sourceStat.mode & 511)) { - postlayout.push(() => destinationFs.chmodPromise(destination, sourceStat.mode & 511)); - updated = true; - } - } - return updated; -} -async function maybeLStat(baseFs, p) { - try { - return await baseFs.lstatPromise(p); - } catch (e) { - return null; - } -} -async function copyFolder(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts) { - if (destinationStat !== null && !destinationStat.isDirectory()) { - if (opts.overwrite) { - prelayout.push(async () => destinationFs.removePromise(destination)); - destinationStat = null; - } else { - return false; - } - } - let updated = false; - if (destinationStat === null) { - prelayout.push(async () => { - try { - await destinationFs.mkdirPromise(destination, { mode: sourceStat.mode }); - } catch (err) { - if (err.code !== `EEXIST`) { - throw err; - } - } - }); - updated = true; - } - const entries = await sourceFs.readdirPromise(source); - const nextOpts = opts.didParentExist && !destinationStat ? { ...opts, didParentExist: false } : opts; - if (opts.stableSort) { - for (const entry of entries.sort()) { - if (await copyImpl(prelayout, postlayout, destinationFs, destinationFs.pathUtils.join(destination, entry), sourceFs, sourceFs.pathUtils.join(source, entry), nextOpts)) { - updated = true; - } - } - } else { - const entriesUpdateStatus = await Promise.all(entries.map(async (entry) => { - await copyImpl(prelayout, postlayout, destinationFs, destinationFs.pathUtils.join(destination, entry), sourceFs, sourceFs.pathUtils.join(source, entry), nextOpts); - })); - if (entriesUpdateStatus.some((status) => status)) { - updated = true; - } - } - return updated; -} -async function copyFileViaIndex(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts, linkStrategy) { - const sourceHash = await sourceFs.checksumFilePromise(source, { algorithm: `sha1` }); - const defaultMode = 420; - const sourceMode = sourceStat.mode & 511; - const indexFileName = `${sourceHash}${sourceMode !== defaultMode ? sourceMode.toString(8) : ``}`; - const indexPath = destinationFs.pathUtils.join(linkStrategy.indexPath, sourceHash.slice(0, 2), `${indexFileName}.dat`); - let AtomicBehavior; - ((AtomicBehavior2) => { - AtomicBehavior2[AtomicBehavior2["Lock"] = 0] = "Lock"; - AtomicBehavior2[AtomicBehavior2["Rename"] = 1] = "Rename"; - })(AtomicBehavior || (AtomicBehavior = {})); - let atomicBehavior = 1 /* Rename */; - let indexStat = await maybeLStat(destinationFs, indexPath); - if (destinationStat) { - const isDestinationHardlinkedFromIndex = indexStat && destinationStat.dev === indexStat.dev && destinationStat.ino === indexStat.ino; - const isIndexModified = indexStat?.mtimeMs !== defaultTimeMs; - if (isDestinationHardlinkedFromIndex) { - if (isIndexModified && linkStrategy.autoRepair) { - atomicBehavior = 0 /* Lock */; - indexStat = null; - } - } - if (!isDestinationHardlinkedFromIndex) { - if (opts.overwrite) { - prelayout.push(async () => destinationFs.removePromise(destination)); - destinationStat = null; - } else { - return false; - } - } - } - const tempPath = !indexStat && atomicBehavior === 1 /* Rename */ ? `${indexPath}.${Math.floor(Math.random() * 4294967296).toString(16).padStart(8, `0`)}` : null; - let tempPathCleaned = false; - prelayout.push(async () => { - if (!indexStat) { - if (atomicBehavior === 0 /* Lock */) { - await destinationFs.lockPromise(indexPath, async () => { - const content = await sourceFs.readFilePromise(source); - await destinationFs.writeFilePromise(indexPath, content); - }); - } - if (atomicBehavior === 1 /* Rename */ && tempPath) { - const content = await sourceFs.readFilePromise(source); - await destinationFs.writeFilePromise(tempPath, content); - try { - await destinationFs.linkPromise(tempPath, indexPath); - } catch (err) { - if (err.code === `EEXIST`) { - tempPathCleaned = true; - await destinationFs.unlinkPromise(tempPath); - } else { - throw err; - } - } - } - } - if (!destinationStat) { - await destinationFs.linkPromise(indexPath, destination); - } - }); - postlayout.push(async () => { - if (!indexStat) { - await destinationFs.lutimesPromise(indexPath, defaultTime, defaultTime); - if (sourceMode !== defaultMode) { - await destinationFs.chmodPromise(indexPath, sourceMode); - } - } - if (tempPath && !tempPathCleaned) { - await destinationFs.unlinkPromise(tempPath); - } - }); - return false; -} -async function copyFileDirect(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts) { - if (destinationStat !== null) { - if (opts.overwrite) { - prelayout.push(async () => destinationFs.removePromise(destination)); - destinationStat = null; - } else { - return false; - } - } - prelayout.push(async () => { - const content = await sourceFs.readFilePromise(source); - await destinationFs.writeFilePromise(destination, content); - }); - return true; -} -async function copyFile(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts) { - if (opts.linkStrategy?.type === `HardlinkFromIndex`) { - return copyFileViaIndex(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts, opts.linkStrategy); - } else { - return copyFileDirect(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts); - } -} -async function copySymlink(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts) { - if (destinationStat !== null) { - if (opts.overwrite) { - prelayout.push(async () => destinationFs.removePromise(destination)); - destinationStat = null; - } else { - return false; - } - } - prelayout.push(async () => { - await destinationFs.symlinkPromise(convertPath(destinationFs.pathUtils, await sourceFs.readlinkPromise(source)), destination); - }); - return true; -} - -class CustomDir { - constructor(path, nextDirent, opts = {}) { - this.path = path; - this.nextDirent = nextDirent; - this.opts = opts; - this.closed = false; - } - throwIfClosed() { - if (this.closed) { - throw ERR_DIR_CLOSED(); - } - } - async *[Symbol.asyncIterator]() { - try { - let dirent; - while ((dirent = await this.read()) !== null) { - yield dirent; - } - } finally { - await this.close(); - } - } - read(cb) { - const dirent = this.readSync(); - if (typeof cb !== `undefined`) - return cb(null, dirent); - return Promise.resolve(dirent); - } - readSync() { - this.throwIfClosed(); - return this.nextDirent(); - } - close(cb) { - this.closeSync(); - if (typeof cb !== `undefined`) - return cb(null); - return Promise.resolve(); - } - closeSync() { - this.throwIfClosed(); - this.opts.onClose?.(); - this.closed = true; - } -} -function opendir(fakeFs, path, entries, opts) { - const nextDirent = () => { - const filename = entries.shift(); - if (typeof filename === `undefined`) - return null; - const entryPath = fakeFs.pathUtils.join(path, filename); - return Object.assign(fakeFs.statSync(entryPath), { - name: filename, - path: void 0 - }); - }; - return new CustomDir(path, nextDirent, opts); -} - -function assertStatus(current, expected) { - if (current !== expected) { - throw new Error(`Invalid StatWatcher status: expected '${expected}', got '${current}'`); - } -} -class CustomStatWatcher extends events.EventEmitter { - constructor(fakeFs, path, { bigint = false } = {}) { - super(); - this.status = "ready" /* Ready */; - this.changeListeners = /* @__PURE__ */ new Map(); - this.startTimeout = null; - this.fakeFs = fakeFs; - this.path = path; - this.bigint = bigint; - this.lastStats = this.stat(); - } - static create(fakeFs, path, opts) { - const statWatcher = new CustomStatWatcher(fakeFs, path, opts); - statWatcher.start(); - return statWatcher; - } - start() { - assertStatus(this.status, "ready" /* Ready */); - this.status = "running" /* Running */; - this.startTimeout = setTimeout(() => { - this.startTimeout = null; - if (!this.fakeFs.existsSync(this.path)) { - this.emit("change" /* Change */, this.lastStats, this.lastStats); - } - }, 3); - } - stop() { - assertStatus(this.status, "running" /* Running */); - this.status = "stopped" /* Stopped */; - if (this.startTimeout !== null) { - clearTimeout(this.startTimeout); - this.startTimeout = null; - } - this.emit("stop" /* Stop */); - } - stat() { - try { - return this.fakeFs.statSync(this.path, { bigint: this.bigint }); - } catch (error) { - const statInstance = this.bigint ? new BigIntStatsEntry() : new StatEntry(); - return clearStats(statInstance); - } - } - makeInterval(opts) { - const interval = setInterval(() => { - const currentStats = this.stat(); - const previousStats = this.lastStats; - if (areStatsEqual(currentStats, previousStats)) - return; - this.lastStats = currentStats; - this.emit("change" /* Change */, currentStats, previousStats); - }, opts.interval); - return opts.persistent ? interval : interval.unref(); - } - registerChangeListener(listener, opts) { - this.addListener("change" /* Change */, listener); - this.changeListeners.set(listener, this.makeInterval(opts)); - } - unregisterChangeListener(listener) { - this.removeListener("change" /* Change */, listener); - const interval = this.changeListeners.get(listener); - if (typeof interval !== `undefined`) - clearInterval(interval); - this.changeListeners.delete(listener); - } - unregisterAllChangeListeners() { - for (const listener of this.changeListeners.keys()) { - this.unregisterChangeListener(listener); - } - } - hasChangeListeners() { - return this.changeListeners.size > 0; - } - ref() { - for (const interval of this.changeListeners.values()) - interval.ref(); - return this; - } - unref() { - for (const interval of this.changeListeners.values()) - interval.unref(); - return this; - } -} - -const statWatchersByFakeFS = /* @__PURE__ */ new WeakMap(); -function watchFile(fakeFs, path, a, b) { - let bigint; - let persistent; - let interval; - let listener; - switch (typeof a) { - case `function`: - { - bigint = false; - persistent = true; - interval = 5007; - listener = a; - } - break; - default: - { - ({ - bigint = false, - persistent = true, - interval = 5007 - } = a); - listener = b; - } - break; - } - let statWatchers = statWatchersByFakeFS.get(fakeFs); - if (typeof statWatchers === `undefined`) - statWatchersByFakeFS.set(fakeFs, statWatchers = /* @__PURE__ */ new Map()); - let statWatcher = statWatchers.get(path); - if (typeof statWatcher === `undefined`) { - statWatcher = CustomStatWatcher.create(fakeFs, path, { bigint }); - statWatchers.set(path, statWatcher); - } - statWatcher.registerChangeListener(listener, { persistent, interval }); - return statWatcher; -} -function unwatchFile(fakeFs, path, cb) { - const statWatchers = statWatchersByFakeFS.get(fakeFs); - if (typeof statWatchers === `undefined`) - return; - const statWatcher = statWatchers.get(path); - if (typeof statWatcher === `undefined`) - return; - if (typeof cb === `undefined`) - statWatcher.unregisterAllChangeListeners(); - else - statWatcher.unregisterChangeListener(cb); - if (!statWatcher.hasChangeListeners()) { - statWatcher.stop(); - statWatchers.delete(path); - } -} -function unwatchAllFiles(fakeFs) { - const statWatchers = statWatchersByFakeFS.get(fakeFs); - if (typeof statWatchers === `undefined`) - return; - for (const path of statWatchers.keys()) { - unwatchFile(fakeFs, path); - } -} - -class FakeFS { - constructor(pathUtils) { - this.pathUtils = pathUtils; - } - async *genTraversePromise(init, { stableSort = false } = {}) { - const stack = [init]; - while (stack.length > 0) { - const p = stack.shift(); - const entry = await this.lstatPromise(p); - if (entry.isDirectory()) { - const entries = await this.readdirPromise(p); - if (stableSort) { - for (const entry2 of entries.sort()) { - stack.push(this.pathUtils.join(p, entry2)); - } - } else { - throw new Error(`Not supported`); - } - } else { - yield p; - } - } - } - async checksumFilePromise(path, { algorithm = `sha512` } = {}) { - const fd = await this.openPromise(path, `r`); - try { - const CHUNK_SIZE = 65536; - const chunk = Buffer.allocUnsafeSlow(CHUNK_SIZE); - const hash = crypto.createHash(algorithm); - let bytesRead = 0; - while ((bytesRead = await this.readPromise(fd, chunk, 0, CHUNK_SIZE)) !== 0) - hash.update(bytesRead === CHUNK_SIZE ? chunk : chunk.slice(0, bytesRead)); - return hash.digest(`hex`); - } finally { - await this.closePromise(fd); - } - } - async removePromise(p, { recursive = true, maxRetries = 5 } = {}) { - let stat; - try { - stat = await this.lstatPromise(p); - } catch (error) { - if (error.code === `ENOENT`) { - return; - } else { - throw error; - } - } - if (stat.isDirectory()) { - if (recursive) { - const entries = await this.readdirPromise(p); - await Promise.all(entries.map((entry) => { - return this.removePromise(this.pathUtils.resolve(p, entry)); - })); - } - for (let t = 0; t <= maxRetries; t++) { - try { - await this.rmdirPromise(p); - break; - } catch (error) { - if (error.code !== `EBUSY` && error.code !== `ENOTEMPTY`) { - throw error; - } else if (t < maxRetries) { - await new Promise((resolve) => setTimeout(resolve, t * 100)); - } - } - } - } else { - await this.unlinkPromise(p); - } - } - removeSync(p, { recursive = true } = {}) { - let stat; - try { - stat = this.lstatSync(p); - } catch (error) { - if (error.code === `ENOENT`) { - return; - } else { - throw error; - } - } - if (stat.isDirectory()) { - if (recursive) - for (const entry of this.readdirSync(p)) - this.removeSync(this.pathUtils.resolve(p, entry)); - this.rmdirSync(p); - } else { - this.unlinkSync(p); - } - } - async mkdirpPromise(p, { chmod, utimes } = {}) { - p = this.resolve(p); - if (p === this.pathUtils.dirname(p)) - return void 0; - const parts = p.split(this.pathUtils.sep); - let createdDirectory; - for (let u = 2; u <= parts.length; ++u) { - const subPath = parts.slice(0, u).join(this.pathUtils.sep); - if (!this.existsSync(subPath)) { - try { - await this.mkdirPromise(subPath); - } catch (error) { - if (error.code === `EEXIST`) { - continue; - } else { - throw error; - } - } - createdDirectory ??= subPath; - if (chmod != null) - await this.chmodPromise(subPath, chmod); - if (utimes != null) { - await this.utimesPromise(subPath, utimes[0], utimes[1]); - } else { - const parentStat = await this.statPromise(this.pathUtils.dirname(subPath)); - await this.utimesPromise(subPath, parentStat.atime, parentStat.mtime); - } - } - } - return createdDirectory; - } - mkdirpSync(p, { chmod, utimes } = {}) { - p = this.resolve(p); - if (p === this.pathUtils.dirname(p)) - return void 0; - const parts = p.split(this.pathUtils.sep); - let createdDirectory; - for (let u = 2; u <= parts.length; ++u) { - const subPath = parts.slice(0, u).join(this.pathUtils.sep); - if (!this.existsSync(subPath)) { - try { - this.mkdirSync(subPath); - } catch (error) { - if (error.code === `EEXIST`) { - continue; - } else { - throw error; - } - } - createdDirectory ??= subPath; - if (chmod != null) - this.chmodSync(subPath, chmod); - if (utimes != null) { - this.utimesSync(subPath, utimes[0], utimes[1]); - } else { - const parentStat = this.statSync(this.pathUtils.dirname(subPath)); - this.utimesSync(subPath, parentStat.atime, parentStat.mtime); - } - } - } - return createdDirectory; - } - async copyPromise(destination, source, { baseFs = this, overwrite = true, stableSort = false, stableTime = false, linkStrategy = null } = {}) { - return await copyPromise(this, destination, baseFs, source, { overwrite, stableSort, stableTime, linkStrategy }); - } - copySync(destination, source, { baseFs = this, overwrite = true } = {}) { - const stat = baseFs.lstatSync(source); - const exists = this.existsSync(destination); - if (stat.isDirectory()) { - this.mkdirpSync(destination); - const directoryListing = baseFs.readdirSync(source); - for (const entry of directoryListing) { - this.copySync(this.pathUtils.join(destination, entry), baseFs.pathUtils.join(source, entry), { baseFs, overwrite }); - } - } else if (stat.isFile()) { - if (!exists || overwrite) { - if (exists) - this.removeSync(destination); - const content = baseFs.readFileSync(source); - this.writeFileSync(destination, content); - } - } else if (stat.isSymbolicLink()) { - if (!exists || overwrite) { - if (exists) - this.removeSync(destination); - const target = baseFs.readlinkSync(source); - this.symlinkSync(convertPath(this.pathUtils, target), destination); - } - } else { - throw new Error(`Unsupported file type (file: ${source}, mode: 0o${stat.mode.toString(8).padStart(6, `0`)})`); - } - const mode = stat.mode & 511; - this.chmodSync(destination, mode); - } - async changeFilePromise(p, content, opts = {}) { - if (Buffer.isBuffer(content)) { - return this.changeFileBufferPromise(p, content, opts); - } else { - return this.changeFileTextPromise(p, content, opts); - } - } - async changeFileBufferPromise(p, content, { mode } = {}) { - let current = Buffer.alloc(0); - try { - current = await this.readFilePromise(p); - } catch (error) { - } - if (Buffer.compare(current, content) === 0) - return; - await this.writeFilePromise(p, content, { mode }); - } - async changeFileTextPromise(p, content, { automaticNewlines, mode } = {}) { - let current = ``; - try { - current = await this.readFilePromise(p, `utf8`); - } catch (error) { - } - const normalizedContent = automaticNewlines ? normalizeLineEndings(current, content) : content; - if (current === normalizedContent) - return; - await this.writeFilePromise(p, normalizedContent, { mode }); - } - changeFileSync(p, content, opts = {}) { - if (Buffer.isBuffer(content)) { - return this.changeFileBufferSync(p, content, opts); - } else { - return this.changeFileTextSync(p, content, opts); - } - } - changeFileBufferSync(p, content, { mode } = {}) { - let current = Buffer.alloc(0); - try { - current = this.readFileSync(p); - } catch (error) { - } - if (Buffer.compare(current, content) === 0) - return; - this.writeFileSync(p, content, { mode }); - } - changeFileTextSync(p, content, { automaticNewlines = false, mode } = {}) { - let current = ``; - try { - current = this.readFileSync(p, `utf8`); - } catch (error) { - } - const normalizedContent = automaticNewlines ? normalizeLineEndings(current, content) : content; - if (current === normalizedContent) - return; - this.writeFileSync(p, normalizedContent, { mode }); - } - async movePromise(fromP, toP) { - try { - await this.renamePromise(fromP, toP); - } catch (error) { - if (error.code === `EXDEV`) { - await this.copyPromise(toP, fromP); - await this.removePromise(fromP); - } else { - throw error; - } - } - } - moveSync(fromP, toP) { - try { - this.renameSync(fromP, toP); - } catch (error) { - if (error.code === `EXDEV`) { - this.copySync(toP, fromP); - this.removeSync(fromP); - } else { - throw error; - } - } - } - async lockPromise(affectedPath, callback) { - const lockPath = `${affectedPath}.flock`; - const interval = 1e3 / 60; - const startTime = Date.now(); - let fd = null; - const isAlive = async () => { - let pid; - try { - [pid] = await this.readJsonPromise(lockPath); - } catch (error) { - return Date.now() - startTime < 500; - } - try { - process.kill(pid, 0); - return true; - } catch (error) { - return false; - } - }; - while (fd === null) { - try { - fd = await this.openPromise(lockPath, `wx`); - } catch (error) { - if (error.code === `EEXIST`) { - if (!await isAlive()) { - try { - await this.unlinkPromise(lockPath); - continue; - } catch (error2) { - } - } - if (Date.now() - startTime < 60 * 1e3) { - await new Promise((resolve) => setTimeout(resolve, interval)); - } else { - throw new Error(`Couldn't acquire a lock in a reasonable time (via ${lockPath})`); - } - } else { - throw error; - } - } - } - await this.writePromise(fd, JSON.stringify([process.pid])); - try { - return await callback(); - } finally { - try { - await this.closePromise(fd); - await this.unlinkPromise(lockPath); - } catch (error) { - } - } - } - async readJsonPromise(p) { - const content = await this.readFilePromise(p, `utf8`); - try { - return JSON.parse(content); - } catch (error) { - error.message += ` (in ${p})`; - throw error; - } - } - readJsonSync(p) { - const content = this.readFileSync(p, `utf8`); - try { - return JSON.parse(content); - } catch (error) { - error.message += ` (in ${p})`; - throw error; - } - } - async writeJsonPromise(p, data, { compact = false } = {}) { - const space = compact ? 0 : 2; - return await this.writeFilePromise(p, `${JSON.stringify(data, null, space)} -`); - } - writeJsonSync(p, data, { compact = false } = {}) { - const space = compact ? 0 : 2; - return this.writeFileSync(p, `${JSON.stringify(data, null, space)} -`); - } - async preserveTimePromise(p, cb) { - const stat = await this.lstatPromise(p); - const result = await cb(); - if (typeof result !== `undefined`) - p = result; - await this.lutimesPromise(p, stat.atime, stat.mtime); - } - async preserveTimeSync(p, cb) { - const stat = this.lstatSync(p); - const result = cb(); - if (typeof result !== `undefined`) - p = result; - this.lutimesSync(p, stat.atime, stat.mtime); - } -} -class BasePortableFakeFS extends FakeFS { - constructor() { - super(ppath); - } -} -function getEndOfLine(content) { - const matches = content.match(/\r?\n/g); - if (matches === null) - return os.EOL; - const crlf = matches.filter((nl) => nl === `\r -`).length; - const lf = matches.length - crlf; - return crlf > lf ? `\r -` : ` -`; -} -function normalizeLineEndings(originalContent, newContent) { - return newContent.replace(/\r?\n/g, getEndOfLine(originalContent)); -} - -class ProxiedFS extends FakeFS { - getExtractHint(hints) { - return this.baseFs.getExtractHint(hints); - } - resolve(path) { - return this.mapFromBase(this.baseFs.resolve(this.mapToBase(path))); - } - getRealPath() { - return this.mapFromBase(this.baseFs.getRealPath()); - } - async openPromise(p, flags, mode) { - return this.baseFs.openPromise(this.mapToBase(p), flags, mode); - } - openSync(p, flags, mode) { - return this.baseFs.openSync(this.mapToBase(p), flags, mode); - } - async opendirPromise(p, opts) { - return Object.assign(await this.baseFs.opendirPromise(this.mapToBase(p), opts), { path: p }); - } - opendirSync(p, opts) { - return Object.assign(this.baseFs.opendirSync(this.mapToBase(p), opts), { path: p }); - } - async readPromise(fd, buffer, offset, length, position) { - return await this.baseFs.readPromise(fd, buffer, offset, length, position); - } - readSync(fd, buffer, offset, length, position) { - return this.baseFs.readSync(fd, buffer, offset, length, position); - } - async writePromise(fd, buffer, offset, length, position) { - if (typeof buffer === `string`) { - return await this.baseFs.writePromise(fd, buffer, offset); - } else { - return await this.baseFs.writePromise(fd, buffer, offset, length, position); - } - } - writeSync(fd, buffer, offset, length, position) { - if (typeof buffer === `string`) { - return this.baseFs.writeSync(fd, buffer, offset); - } else { - return this.baseFs.writeSync(fd, buffer, offset, length, position); - } - } - async closePromise(fd) { - return this.baseFs.closePromise(fd); - } - closeSync(fd) { - this.baseFs.closeSync(fd); - } - createReadStream(p, opts) { - return this.baseFs.createReadStream(p !== null ? this.mapToBase(p) : p, opts); - } - createWriteStream(p, opts) { - return this.baseFs.createWriteStream(p !== null ? this.mapToBase(p) : p, opts); - } - async realpathPromise(p) { - return this.mapFromBase(await this.baseFs.realpathPromise(this.mapToBase(p))); - } - realpathSync(p) { - return this.mapFromBase(this.baseFs.realpathSync(this.mapToBase(p))); - } - async existsPromise(p) { - return this.baseFs.existsPromise(this.mapToBase(p)); - } - existsSync(p) { - return this.baseFs.existsSync(this.mapToBase(p)); - } - accessSync(p, mode) { - return this.baseFs.accessSync(this.mapToBase(p), mode); - } - async accessPromise(p, mode) { - return this.baseFs.accessPromise(this.mapToBase(p), mode); - } - async statPromise(p, opts) { - return this.baseFs.statPromise(this.mapToBase(p), opts); - } - statSync(p, opts) { - return this.baseFs.statSync(this.mapToBase(p), opts); - } - async fstatPromise(fd, opts) { - return this.baseFs.fstatPromise(fd, opts); - } - fstatSync(fd, opts) { - return this.baseFs.fstatSync(fd, opts); - } - lstatPromise(p, opts) { - return this.baseFs.lstatPromise(this.mapToBase(p), opts); - } - lstatSync(p, opts) { - return this.baseFs.lstatSync(this.mapToBase(p), opts); - } - async fchmodPromise(fd, mask) { - return this.baseFs.fchmodPromise(fd, mask); - } - fchmodSync(fd, mask) { - return this.baseFs.fchmodSync(fd, mask); - } - async chmodPromise(p, mask) { - return this.baseFs.chmodPromise(this.mapToBase(p), mask); - } - chmodSync(p, mask) { - return this.baseFs.chmodSync(this.mapToBase(p), mask); - } - async fchownPromise(fd, uid, gid) { - return this.baseFs.fchownPromise(fd, uid, gid); - } - fchownSync(fd, uid, gid) { - return this.baseFs.fchownSync(fd, uid, gid); - } - async chownPromise(p, uid, gid) { - return this.baseFs.chownPromise(this.mapToBase(p), uid, gid); - } - chownSync(p, uid, gid) { - return this.baseFs.chownSync(this.mapToBase(p), uid, gid); - } - async renamePromise(oldP, newP) { - return this.baseFs.renamePromise(this.mapToBase(oldP), this.mapToBase(newP)); - } - renameSync(oldP, newP) { - return this.baseFs.renameSync(this.mapToBase(oldP), this.mapToBase(newP)); - } - async copyFilePromise(sourceP, destP, flags = 0) { - return this.baseFs.copyFilePromise(this.mapToBase(sourceP), this.mapToBase(destP), flags); - } - copyFileSync(sourceP, destP, flags = 0) { - return this.baseFs.copyFileSync(this.mapToBase(sourceP), this.mapToBase(destP), flags); - } - async appendFilePromise(p, content, opts) { - return this.baseFs.appendFilePromise(this.fsMapToBase(p), content, opts); - } - appendFileSync(p, content, opts) { - return this.baseFs.appendFileSync(this.fsMapToBase(p), content, opts); - } - async writeFilePromise(p, content, opts) { - return this.baseFs.writeFilePromise(this.fsMapToBase(p), content, opts); - } - writeFileSync(p, content, opts) { - return this.baseFs.writeFileSync(this.fsMapToBase(p), content, opts); - } - async unlinkPromise(p) { - return this.baseFs.unlinkPromise(this.mapToBase(p)); - } - unlinkSync(p) { - return this.baseFs.unlinkSync(this.mapToBase(p)); - } - async utimesPromise(p, atime, mtime) { - return this.baseFs.utimesPromise(this.mapToBase(p), atime, mtime); - } - utimesSync(p, atime, mtime) { - return this.baseFs.utimesSync(this.mapToBase(p), atime, mtime); - } - async lutimesPromise(p, atime, mtime) { - return this.baseFs.lutimesPromise(this.mapToBase(p), atime, mtime); - } - lutimesSync(p, atime, mtime) { - return this.baseFs.lutimesSync(this.mapToBase(p), atime, mtime); - } - async mkdirPromise(p, opts) { - return this.baseFs.mkdirPromise(this.mapToBase(p), opts); - } - mkdirSync(p, opts) { - return this.baseFs.mkdirSync(this.mapToBase(p), opts); - } - async rmdirPromise(p, opts) { - return this.baseFs.rmdirPromise(this.mapToBase(p), opts); - } - rmdirSync(p, opts) { - return this.baseFs.rmdirSync(this.mapToBase(p), opts); - } - async rmPromise(p, opts) { - return this.baseFs.rmPromise(this.mapToBase(p), opts); - } - rmSync(p, opts) { - return this.baseFs.rmSync(this.mapToBase(p), opts); - } - async linkPromise(existingP, newP) { - return this.baseFs.linkPromise(this.mapToBase(existingP), this.mapToBase(newP)); - } - linkSync(existingP, newP) { - return this.baseFs.linkSync(this.mapToBase(existingP), this.mapToBase(newP)); - } - async symlinkPromise(target, p, type) { - const mappedP = this.mapToBase(p); - if (this.pathUtils.isAbsolute(target)) - return this.baseFs.symlinkPromise(this.mapToBase(target), mappedP, type); - const mappedAbsoluteTarget = this.mapToBase(this.pathUtils.join(this.pathUtils.dirname(p), target)); - const mappedTarget = this.baseFs.pathUtils.relative(this.baseFs.pathUtils.dirname(mappedP), mappedAbsoluteTarget); - return this.baseFs.symlinkPromise(mappedTarget, mappedP, type); - } - symlinkSync(target, p, type) { - const mappedP = this.mapToBase(p); - if (this.pathUtils.isAbsolute(target)) - return this.baseFs.symlinkSync(this.mapToBase(target), mappedP, type); - const mappedAbsoluteTarget = this.mapToBase(this.pathUtils.join(this.pathUtils.dirname(p), target)); - const mappedTarget = this.baseFs.pathUtils.relative(this.baseFs.pathUtils.dirname(mappedP), mappedAbsoluteTarget); - return this.baseFs.symlinkSync(mappedTarget, mappedP, type); - } - async readFilePromise(p, encoding) { - return this.baseFs.readFilePromise(this.fsMapToBase(p), encoding); - } - readFileSync(p, encoding) { - return this.baseFs.readFileSync(this.fsMapToBase(p), encoding); - } - readdirPromise(p, opts) { - return this.baseFs.readdirPromise(this.mapToBase(p), opts); - } - readdirSync(p, opts) { - return this.baseFs.readdirSync(this.mapToBase(p), opts); - } - async readlinkPromise(p) { - return this.mapFromBase(await this.baseFs.readlinkPromise(this.mapToBase(p))); - } - readlinkSync(p) { - return this.mapFromBase(this.baseFs.readlinkSync(this.mapToBase(p))); - } - async truncatePromise(p, len) { - return this.baseFs.truncatePromise(this.mapToBase(p), len); - } - truncateSync(p, len) { - return this.baseFs.truncateSync(this.mapToBase(p), len); - } - async ftruncatePromise(fd, len) { - return this.baseFs.ftruncatePromise(fd, len); - } - ftruncateSync(fd, len) { - return this.baseFs.ftruncateSync(fd, len); - } - watch(p, a, b) { - return this.baseFs.watch( - this.mapToBase(p), - a, - b - ); - } - watchFile(p, a, b) { - return this.baseFs.watchFile( - this.mapToBase(p), - a, - b - ); - } - unwatchFile(p, cb) { - return this.baseFs.unwatchFile(this.mapToBase(p), cb); - } - fsMapToBase(p) { - if (typeof p === `number`) { - return p; - } else { - return this.mapToBase(p); - } - } -} - -function direntToPortable(dirent) { - const portableDirent = dirent; - if (typeof dirent.path === `string`) - portableDirent.path = npath.toPortablePath(dirent.path); - return portableDirent; -} -class NodeFS extends BasePortableFakeFS { - constructor(realFs = fs__default.default) { - super(); - this.realFs = realFs; - } - getExtractHint() { - return false; - } - getRealPath() { - return PortablePath.root; - } - resolve(p) { - return ppath.resolve(p); - } - async openPromise(p, flags, mode) { - return await new Promise((resolve, reject) => { - this.realFs.open(npath.fromPortablePath(p), flags, mode, this.makeCallback(resolve, reject)); - }); - } - openSync(p, flags, mode) { - return this.realFs.openSync(npath.fromPortablePath(p), flags, mode); - } - async opendirPromise(p, opts) { - return await new Promise((resolve, reject) => { - if (typeof opts !== `undefined`) { - this.realFs.opendir(npath.fromPortablePath(p), opts, this.makeCallback(resolve, reject)); - } else { - this.realFs.opendir(npath.fromPortablePath(p), this.makeCallback(resolve, reject)); - } - }).then((dir) => { - const dirWithFixedPath = dir; - Object.defineProperty(dirWithFixedPath, `path`, { - value: p, - configurable: true, - writable: true - }); - return dirWithFixedPath; - }); - } - opendirSync(p, opts) { - const dir = typeof opts !== `undefined` ? this.realFs.opendirSync(npath.fromPortablePath(p), opts) : this.realFs.opendirSync(npath.fromPortablePath(p)); - const dirWithFixedPath = dir; - Object.defineProperty(dirWithFixedPath, `path`, { - value: p, - configurable: true, - writable: true - }); - return dirWithFixedPath; - } - async readPromise(fd, buffer, offset = 0, length = 0, position = -1) { - return await new Promise((resolve, reject) => { - this.realFs.read(fd, buffer, offset, length, position, (error, bytesRead) => { - if (error) { - reject(error); - } else { - resolve(bytesRead); - } - }); - }); - } - readSync(fd, buffer, offset, length, position) { - return this.realFs.readSync(fd, buffer, offset, length, position); - } - async writePromise(fd, buffer, offset, length, position) { - return await new Promise((resolve, reject) => { - if (typeof buffer === `string`) { - return this.realFs.write(fd, buffer, offset, this.makeCallback(resolve, reject)); - } else { - return this.realFs.write(fd, buffer, offset, length, position, this.makeCallback(resolve, reject)); - } - }); - } - writeSync(fd, buffer, offset, length, position) { - if (typeof buffer === `string`) { - return this.realFs.writeSync(fd, buffer, offset); - } else { - return this.realFs.writeSync(fd, buffer, offset, length, position); - } - } - async closePromise(fd) { - await new Promise((resolve, reject) => { - this.realFs.close(fd, this.makeCallback(resolve, reject)); - }); - } - closeSync(fd) { - this.realFs.closeSync(fd); - } - createReadStream(p, opts) { - const realPath = p !== null ? npath.fromPortablePath(p) : p; - return this.realFs.createReadStream(realPath, opts); - } - createWriteStream(p, opts) { - const realPath = p !== null ? npath.fromPortablePath(p) : p; - return this.realFs.createWriteStream(realPath, opts); - } - async realpathPromise(p) { - return await new Promise((resolve, reject) => { - this.realFs.realpath(npath.fromPortablePath(p), {}, this.makeCallback(resolve, reject)); - }).then((path) => { - return npath.toPortablePath(path); - }); - } - realpathSync(p) { - return npath.toPortablePath(this.realFs.realpathSync(npath.fromPortablePath(p), {})); - } - async existsPromise(p) { - return await new Promise((resolve) => { - this.realFs.exists(npath.fromPortablePath(p), resolve); - }); - } - accessSync(p, mode) { - return this.realFs.accessSync(npath.fromPortablePath(p), mode); - } - async accessPromise(p, mode) { - return await new Promise((resolve, reject) => { - this.realFs.access(npath.fromPortablePath(p), mode, this.makeCallback(resolve, reject)); - }); - } - existsSync(p) { - return this.realFs.existsSync(npath.fromPortablePath(p)); - } - async statPromise(p, opts) { - return await new Promise((resolve, reject) => { - if (opts) { - this.realFs.stat(npath.fromPortablePath(p), opts, this.makeCallback(resolve, reject)); - } else { - this.realFs.stat(npath.fromPortablePath(p), this.makeCallback(resolve, reject)); - } - }); - } - statSync(p, opts) { - if (opts) { - return this.realFs.statSync(npath.fromPortablePath(p), opts); - } else { - return this.realFs.statSync(npath.fromPortablePath(p)); - } - } - async fstatPromise(fd, opts) { - return await new Promise((resolve, reject) => { - if (opts) { - this.realFs.fstat(fd, opts, this.makeCallback(resolve, reject)); - } else { - this.realFs.fstat(fd, this.makeCallback(resolve, reject)); - } - }); - } - fstatSync(fd, opts) { - if (opts) { - return this.realFs.fstatSync(fd, opts); - } else { - return this.realFs.fstatSync(fd); - } - } - async lstatPromise(p, opts) { - return await new Promise((resolve, reject) => { - if (opts) { - this.realFs.lstat(npath.fromPortablePath(p), opts, this.makeCallback(resolve, reject)); - } else { - this.realFs.lstat(npath.fromPortablePath(p), this.makeCallback(resolve, reject)); - } - }); - } - lstatSync(p, opts) { - if (opts) { - return this.realFs.lstatSync(npath.fromPortablePath(p), opts); - } else { - return this.realFs.lstatSync(npath.fromPortablePath(p)); - } - } - async fchmodPromise(fd, mask) { - return await new Promise((resolve, reject) => { - this.realFs.fchmod(fd, mask, this.makeCallback(resolve, reject)); - }); - } - fchmodSync(fd, mask) { - return this.realFs.fchmodSync(fd, mask); - } - async chmodPromise(p, mask) { - return await new Promise((resolve, reject) => { - this.realFs.chmod(npath.fromPortablePath(p), mask, this.makeCallback(resolve, reject)); - }); - } - chmodSync(p, mask) { - return this.realFs.chmodSync(npath.fromPortablePath(p), mask); - } - async fchownPromise(fd, uid, gid) { - return await new Promise((resolve, reject) => { - this.realFs.fchown(fd, uid, gid, this.makeCallback(resolve, reject)); - }); - } - fchownSync(fd, uid, gid) { - return this.realFs.fchownSync(fd, uid, gid); - } - async chownPromise(p, uid, gid) { - return await new Promise((resolve, reject) => { - this.realFs.chown(npath.fromPortablePath(p), uid, gid, this.makeCallback(resolve, reject)); - }); - } - chownSync(p, uid, gid) { - return this.realFs.chownSync(npath.fromPortablePath(p), uid, gid); - } - async renamePromise(oldP, newP) { - return await new Promise((resolve, reject) => { - this.realFs.rename(npath.fromPortablePath(oldP), npath.fromPortablePath(newP), this.makeCallback(resolve, reject)); - }); - } - renameSync(oldP, newP) { - return this.realFs.renameSync(npath.fromPortablePath(oldP), npath.fromPortablePath(newP)); - } - async copyFilePromise(sourceP, destP, flags = 0) { - return await new Promise((resolve, reject) => { - this.realFs.copyFile(npath.fromPortablePath(sourceP), npath.fromPortablePath(destP), flags, this.makeCallback(resolve, reject)); - }); - } - copyFileSync(sourceP, destP, flags = 0) { - return this.realFs.copyFileSync(npath.fromPortablePath(sourceP), npath.fromPortablePath(destP), flags); - } - async appendFilePromise(p, content, opts) { - return await new Promise((resolve, reject) => { - const fsNativePath = typeof p === `string` ? npath.fromPortablePath(p) : p; - if (opts) { - this.realFs.appendFile(fsNativePath, content, opts, this.makeCallback(resolve, reject)); - } else { - this.realFs.appendFile(fsNativePath, content, this.makeCallback(resolve, reject)); - } - }); - } - appendFileSync(p, content, opts) { - const fsNativePath = typeof p === `string` ? npath.fromPortablePath(p) : p; - if (opts) { - this.realFs.appendFileSync(fsNativePath, content, opts); - } else { - this.realFs.appendFileSync(fsNativePath, content); - } - } - async writeFilePromise(p, content, opts) { - return await new Promise((resolve, reject) => { - const fsNativePath = typeof p === `string` ? npath.fromPortablePath(p) : p; - if (opts) { - this.realFs.writeFile(fsNativePath, content, opts, this.makeCallback(resolve, reject)); - } else { - this.realFs.writeFile(fsNativePath, content, this.makeCallback(resolve, reject)); - } - }); - } - writeFileSync(p, content, opts) { - const fsNativePath = typeof p === `string` ? npath.fromPortablePath(p) : p; - if (opts) { - this.realFs.writeFileSync(fsNativePath, content, opts); - } else { - this.realFs.writeFileSync(fsNativePath, content); - } - } - async unlinkPromise(p) { - return await new Promise((resolve, reject) => { - this.realFs.unlink(npath.fromPortablePath(p), this.makeCallback(resolve, reject)); - }); - } - unlinkSync(p) { - return this.realFs.unlinkSync(npath.fromPortablePath(p)); - } - async utimesPromise(p, atime, mtime) { - return await new Promise((resolve, reject) => { - this.realFs.utimes(npath.fromPortablePath(p), atime, mtime, this.makeCallback(resolve, reject)); - }); - } - utimesSync(p, atime, mtime) { - this.realFs.utimesSync(npath.fromPortablePath(p), atime, mtime); - } - async lutimesPromise(p, atime, mtime) { - return await new Promise((resolve, reject) => { - this.realFs.lutimes(npath.fromPortablePath(p), atime, mtime, this.makeCallback(resolve, reject)); - }); - } - lutimesSync(p, atime, mtime) { - this.realFs.lutimesSync(npath.fromPortablePath(p), atime, mtime); - } - async mkdirPromise(p, opts) { - return await new Promise((resolve, reject) => { - this.realFs.mkdir(npath.fromPortablePath(p), opts, this.makeCallback(resolve, reject)); - }); - } - mkdirSync(p, opts) { - return this.realFs.mkdirSync(npath.fromPortablePath(p), opts); - } - async rmdirPromise(p, opts) { - return await new Promise((resolve, reject) => { - if (opts) { - this.realFs.rmdir(npath.fromPortablePath(p), opts, this.makeCallback(resolve, reject)); - } else { - this.realFs.rmdir(npath.fromPortablePath(p), this.makeCallback(resolve, reject)); - } - }); - } - rmdirSync(p, opts) { - return this.realFs.rmdirSync(npath.fromPortablePath(p), opts); - } - async rmPromise(p, opts) { - return await new Promise((resolve, reject) => { - if (opts) { - this.realFs.rm(npath.fromPortablePath(p), opts, this.makeCallback(resolve, reject)); - } else { - this.realFs.rm(npath.fromPortablePath(p), this.makeCallback(resolve, reject)); - } - }); - } - rmSync(p, opts) { - return this.realFs.rmSync(npath.fromPortablePath(p), opts); - } - async linkPromise(existingP, newP) { - return await new Promise((resolve, reject) => { - this.realFs.link(npath.fromPortablePath(existingP), npath.fromPortablePath(newP), this.makeCallback(resolve, reject)); - }); - } - linkSync(existingP, newP) { - return this.realFs.linkSync(npath.fromPortablePath(existingP), npath.fromPortablePath(newP)); - } - async symlinkPromise(target, p, type) { - return await new Promise((resolve, reject) => { - this.realFs.symlink(npath.fromPortablePath(target.replace(/\/+$/, ``)), npath.fromPortablePath(p), type, this.makeCallback(resolve, reject)); - }); - } - symlinkSync(target, p, type) { - return this.realFs.symlinkSync(npath.fromPortablePath(target.replace(/\/+$/, ``)), npath.fromPortablePath(p), type); - } - async readFilePromise(p, encoding) { - return await new Promise((resolve, reject) => { - const fsNativePath = typeof p === `string` ? npath.fromPortablePath(p) : p; - this.realFs.readFile(fsNativePath, encoding, this.makeCallback(resolve, reject)); - }); - } - readFileSync(p, encoding) { - const fsNativePath = typeof p === `string` ? npath.fromPortablePath(p) : p; - return this.realFs.readFileSync(fsNativePath, encoding); - } - async readdirPromise(p, opts) { - return await new Promise((resolve, reject) => { - if (opts) { - if (opts.recursive && process.platform === `win32`) { - if (opts.withFileTypes) { - this.realFs.readdir(npath.fromPortablePath(p), opts, this.makeCallback((results) => resolve(results.map(direntToPortable)), reject)); - } else { - this.realFs.readdir(npath.fromPortablePath(p), opts, this.makeCallback((results) => resolve(results.map(npath.toPortablePath)), reject)); - } - } else { - this.realFs.readdir(npath.fromPortablePath(p), opts, this.makeCallback(resolve, reject)); - } - } else { - this.realFs.readdir(npath.fromPortablePath(p), this.makeCallback(resolve, reject)); - } - }); - } - readdirSync(p, opts) { - if (opts) { - if (opts.recursive && process.platform === `win32`) { - if (opts.withFileTypes) { - return this.realFs.readdirSync(npath.fromPortablePath(p), opts).map(direntToPortable); - } else { - return this.realFs.readdirSync(npath.fromPortablePath(p), opts).map(npath.toPortablePath); - } - } else { - return this.realFs.readdirSync(npath.fromPortablePath(p), opts); - } - } else { - return this.realFs.readdirSync(npath.fromPortablePath(p)); - } - } - async readlinkPromise(p) { - return await new Promise((resolve, reject) => { - this.realFs.readlink(npath.fromPortablePath(p), this.makeCallback(resolve, reject)); - }).then((path) => { - return npath.toPortablePath(path); - }); - } - readlinkSync(p) { - return npath.toPortablePath(this.realFs.readlinkSync(npath.fromPortablePath(p))); - } - async truncatePromise(p, len) { - return await new Promise((resolve, reject) => { - this.realFs.truncate(npath.fromPortablePath(p), len, this.makeCallback(resolve, reject)); - }); - } - truncateSync(p, len) { - return this.realFs.truncateSync(npath.fromPortablePath(p), len); - } - async ftruncatePromise(fd, len) { - return await new Promise((resolve, reject) => { - this.realFs.ftruncate(fd, len, this.makeCallback(resolve, reject)); - }); - } - ftruncateSync(fd, len) { - return this.realFs.ftruncateSync(fd, len); - } - watch(p, a, b) { - return this.realFs.watch( - npath.fromPortablePath(p), - a, - b - ); - } - watchFile(p, a, b) { - return this.realFs.watchFile( - npath.fromPortablePath(p), - a, - b - ); - } - unwatchFile(p, cb) { - return this.realFs.unwatchFile(npath.fromPortablePath(p), cb); - } - makeCallback(resolve, reject) { - return (err, result) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }; - } -} - -const MOUNT_MASK = 4278190080; -class MountFS extends BasePortableFakeFS { - constructor({ baseFs = new NodeFS(), filter = null, magicByte = 42, maxOpenFiles = Infinity, useCache = true, maxAge = 5e3, typeCheck = fs.constants.S_IFREG, getMountPoint, factoryPromise, factorySync }) { - if (Math.floor(magicByte) !== magicByte || !(magicByte > 1 && magicByte <= 127)) - throw new Error(`The magic byte must be set to a round value between 1 and 127 included`); - super(); - this.fdMap = /* @__PURE__ */ new Map(); - this.nextFd = 3; - this.isMount = /* @__PURE__ */ new Set(); - this.notMount = /* @__PURE__ */ new Set(); - this.realPaths = /* @__PURE__ */ new Map(); - this.limitOpenFilesTimeout = null; - this.baseFs = baseFs; - this.mountInstances = useCache ? /* @__PURE__ */ new Map() : null; - this.factoryPromise = factoryPromise; - this.factorySync = factorySync; - this.filter = filter; - this.getMountPoint = getMountPoint; - this.magic = magicByte << 24; - this.maxAge = maxAge; - this.maxOpenFiles = maxOpenFiles; - this.typeCheck = typeCheck; - } - getExtractHint(hints) { - return this.baseFs.getExtractHint(hints); - } - getRealPath() { - return this.baseFs.getRealPath(); - } - saveAndClose() { - unwatchAllFiles(this); - if (this.mountInstances) { - for (const [path, { childFs }] of this.mountInstances.entries()) { - childFs.saveAndClose?.(); - this.mountInstances.delete(path); - } - } - } - discardAndClose() { - unwatchAllFiles(this); - if (this.mountInstances) { - for (const [path, { childFs }] of this.mountInstances.entries()) { - childFs.discardAndClose?.(); - this.mountInstances.delete(path); - } - } - } - resolve(p) { - return this.baseFs.resolve(p); - } - remapFd(mountFs, fd) { - const remappedFd = this.nextFd++ | this.magic; - this.fdMap.set(remappedFd, [mountFs, fd]); - return remappedFd; - } - async openPromise(p, flags, mode) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.openPromise(p, flags, mode); - }, async (mountFs, { subPath }) => { - return this.remapFd(mountFs, await mountFs.openPromise(subPath, flags, mode)); - }); - } - openSync(p, flags, mode) { - return this.makeCallSync(p, () => { - return this.baseFs.openSync(p, flags, mode); - }, (mountFs, { subPath }) => { - return this.remapFd(mountFs, mountFs.openSync(subPath, flags, mode)); - }); - } - async opendirPromise(p, opts) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.opendirPromise(p, opts); - }, async (mountFs, { subPath }) => { - return await mountFs.opendirPromise(subPath, opts); - }, { - requireSubpath: false - }); - } - opendirSync(p, opts) { - return this.makeCallSync(p, () => { - return this.baseFs.opendirSync(p, opts); - }, (mountFs, { subPath }) => { - return mountFs.opendirSync(subPath, opts); - }, { - requireSubpath: false - }); - } - async readPromise(fd, buffer, offset, length, position) { - if ((fd & MOUNT_MASK) !== this.magic) - return await this.baseFs.readPromise(fd, buffer, offset, length, position); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`read`); - const [mountFs, realFd] = entry; - return await mountFs.readPromise(realFd, buffer, offset, length, position); - } - readSync(fd, buffer, offset, length, position) { - if ((fd & MOUNT_MASK) !== this.magic) - return this.baseFs.readSync(fd, buffer, offset, length, position); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`readSync`); - const [mountFs, realFd] = entry; - return mountFs.readSync(realFd, buffer, offset, length, position); - } - async writePromise(fd, buffer, offset, length, position) { - if ((fd & MOUNT_MASK) !== this.magic) { - if (typeof buffer === `string`) { - return await this.baseFs.writePromise(fd, buffer, offset); - } else { - return await this.baseFs.writePromise(fd, buffer, offset, length, position); - } - } - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`write`); - const [mountFs, realFd] = entry; - if (typeof buffer === `string`) { - return await mountFs.writePromise(realFd, buffer, offset); - } else { - return await mountFs.writePromise(realFd, buffer, offset, length, position); - } - } - writeSync(fd, buffer, offset, length, position) { - if ((fd & MOUNT_MASK) !== this.magic) { - if (typeof buffer === `string`) { - return this.baseFs.writeSync(fd, buffer, offset); - } else { - return this.baseFs.writeSync(fd, buffer, offset, length, position); - } - } - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`writeSync`); - const [mountFs, realFd] = entry; - if (typeof buffer === `string`) { - return mountFs.writeSync(realFd, buffer, offset); - } else { - return mountFs.writeSync(realFd, buffer, offset, length, position); - } - } - async closePromise(fd) { - if ((fd & MOUNT_MASK) !== this.magic) - return await this.baseFs.closePromise(fd); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`close`); - this.fdMap.delete(fd); - const [mountFs, realFd] = entry; - return await mountFs.closePromise(realFd); - } - closeSync(fd) { - if ((fd & MOUNT_MASK) !== this.magic) - return this.baseFs.closeSync(fd); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`closeSync`); - this.fdMap.delete(fd); - const [mountFs, realFd] = entry; - return mountFs.closeSync(realFd); - } - createReadStream(p, opts) { - if (p === null) - return this.baseFs.createReadStream(p, opts); - return this.makeCallSync(p, () => { - return this.baseFs.createReadStream(p, opts); - }, (mountFs, { archivePath, subPath }) => { - const stream = mountFs.createReadStream(subPath, opts); - stream.path = npath.fromPortablePath(this.pathUtils.join(archivePath, subPath)); - return stream; - }); - } - createWriteStream(p, opts) { - if (p === null) - return this.baseFs.createWriteStream(p, opts); - return this.makeCallSync(p, () => { - return this.baseFs.createWriteStream(p, opts); - }, (mountFs, { subPath }) => { - return mountFs.createWriteStream(subPath, opts); - }); - } - async realpathPromise(p) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.realpathPromise(p); - }, async (mountFs, { archivePath, subPath }) => { - let realArchivePath = this.realPaths.get(archivePath); - if (typeof realArchivePath === `undefined`) { - realArchivePath = await this.baseFs.realpathPromise(archivePath); - this.realPaths.set(archivePath, realArchivePath); - } - return this.pathUtils.join(realArchivePath, this.pathUtils.relative(PortablePath.root, await mountFs.realpathPromise(subPath))); - }); - } - realpathSync(p) { - return this.makeCallSync(p, () => { - return this.baseFs.realpathSync(p); - }, (mountFs, { archivePath, subPath }) => { - let realArchivePath = this.realPaths.get(archivePath); - if (typeof realArchivePath === `undefined`) { - realArchivePath = this.baseFs.realpathSync(archivePath); - this.realPaths.set(archivePath, realArchivePath); - } - return this.pathUtils.join(realArchivePath, this.pathUtils.relative(PortablePath.root, mountFs.realpathSync(subPath))); - }); - } - async existsPromise(p) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.existsPromise(p); - }, async (mountFs, { subPath }) => { - return await mountFs.existsPromise(subPath); - }); - } - existsSync(p) { - return this.makeCallSync(p, () => { - return this.baseFs.existsSync(p); - }, (mountFs, { subPath }) => { - return mountFs.existsSync(subPath); - }); - } - async accessPromise(p, mode) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.accessPromise(p, mode); - }, async (mountFs, { subPath }) => { - return await mountFs.accessPromise(subPath, mode); - }); - } - accessSync(p, mode) { - return this.makeCallSync(p, () => { - return this.baseFs.accessSync(p, mode); - }, (mountFs, { subPath }) => { - return mountFs.accessSync(subPath, mode); - }); - } - async statPromise(p, opts) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.statPromise(p, opts); - }, async (mountFs, { subPath }) => { - return await mountFs.statPromise(subPath, opts); - }); - } - statSync(p, opts) { - return this.makeCallSync(p, () => { - return this.baseFs.statSync(p, opts); - }, (mountFs, { subPath }) => { - return mountFs.statSync(subPath, opts); - }); - } - async fstatPromise(fd, opts) { - if ((fd & MOUNT_MASK) !== this.magic) - return this.baseFs.fstatPromise(fd, opts); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`fstat`); - const [mountFs, realFd] = entry; - return mountFs.fstatPromise(realFd, opts); - } - fstatSync(fd, opts) { - if ((fd & MOUNT_MASK) !== this.magic) - return this.baseFs.fstatSync(fd, opts); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`fstatSync`); - const [mountFs, realFd] = entry; - return mountFs.fstatSync(realFd, opts); - } - async lstatPromise(p, opts) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.lstatPromise(p, opts); - }, async (mountFs, { subPath }) => { - return await mountFs.lstatPromise(subPath, opts); - }); - } - lstatSync(p, opts) { - return this.makeCallSync(p, () => { - return this.baseFs.lstatSync(p, opts); - }, (mountFs, { subPath }) => { - return mountFs.lstatSync(subPath, opts); - }); - } - async fchmodPromise(fd, mask) { - if ((fd & MOUNT_MASK) !== this.magic) - return this.baseFs.fchmodPromise(fd, mask); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`fchmod`); - const [mountFs, realFd] = entry; - return mountFs.fchmodPromise(realFd, mask); - } - fchmodSync(fd, mask) { - if ((fd & MOUNT_MASK) !== this.magic) - return this.baseFs.fchmodSync(fd, mask); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`fchmodSync`); - const [mountFs, realFd] = entry; - return mountFs.fchmodSync(realFd, mask); - } - async chmodPromise(p, mask) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.chmodPromise(p, mask); - }, async (mountFs, { subPath }) => { - return await mountFs.chmodPromise(subPath, mask); - }); - } - chmodSync(p, mask) { - return this.makeCallSync(p, () => { - return this.baseFs.chmodSync(p, mask); - }, (mountFs, { subPath }) => { - return mountFs.chmodSync(subPath, mask); - }); - } - async fchownPromise(fd, uid, gid) { - if ((fd & MOUNT_MASK) !== this.magic) - return this.baseFs.fchownPromise(fd, uid, gid); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`fchown`); - const [zipFs, realFd] = entry; - return zipFs.fchownPromise(realFd, uid, gid); - } - fchownSync(fd, uid, gid) { - if ((fd & MOUNT_MASK) !== this.magic) - return this.baseFs.fchownSync(fd, uid, gid); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`fchownSync`); - const [zipFs, realFd] = entry; - return zipFs.fchownSync(realFd, uid, gid); - } - async chownPromise(p, uid, gid) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.chownPromise(p, uid, gid); - }, async (mountFs, { subPath }) => { - return await mountFs.chownPromise(subPath, uid, gid); - }); - } - chownSync(p, uid, gid) { - return this.makeCallSync(p, () => { - return this.baseFs.chownSync(p, uid, gid); - }, (mountFs, { subPath }) => { - return mountFs.chownSync(subPath, uid, gid); - }); - } - async renamePromise(oldP, newP) { - return await this.makeCallPromise(oldP, async () => { - return await this.makeCallPromise(newP, async () => { - return await this.baseFs.renamePromise(oldP, newP); - }, async () => { - throw Object.assign(new Error(`EEXDEV: cross-device link not permitted`), { code: `EEXDEV` }); - }); - }, async (mountFsO, { subPath: subPathO }) => { - return await this.makeCallPromise(newP, async () => { - throw Object.assign(new Error(`EEXDEV: cross-device link not permitted`), { code: `EEXDEV` }); - }, async (mountFsN, { subPath: subPathN }) => { - if (mountFsO !== mountFsN) { - throw Object.assign(new Error(`EEXDEV: cross-device link not permitted`), { code: `EEXDEV` }); - } else { - return await mountFsO.renamePromise(subPathO, subPathN); - } - }); - }); - } - renameSync(oldP, newP) { - return this.makeCallSync(oldP, () => { - return this.makeCallSync(newP, () => { - return this.baseFs.renameSync(oldP, newP); - }, () => { - throw Object.assign(new Error(`EEXDEV: cross-device link not permitted`), { code: `EEXDEV` }); - }); - }, (mountFsO, { subPath: subPathO }) => { - return this.makeCallSync(newP, () => { - throw Object.assign(new Error(`EEXDEV: cross-device link not permitted`), { code: `EEXDEV` }); - }, (mountFsN, { subPath: subPathN }) => { - if (mountFsO !== mountFsN) { - throw Object.assign(new Error(`EEXDEV: cross-device link not permitted`), { code: `EEXDEV` }); - } else { - return mountFsO.renameSync(subPathO, subPathN); - } - }); - }); - } - async copyFilePromise(sourceP, destP, flags = 0) { - const fallback = async (sourceFs, sourceP2, destFs, destP2) => { - if ((flags & fs.constants.COPYFILE_FICLONE_FORCE) !== 0) - throw Object.assign(new Error(`EXDEV: cross-device clone not permitted, copyfile '${sourceP2}' -> ${destP2}'`), { code: `EXDEV` }); - if (flags & fs.constants.COPYFILE_EXCL && await this.existsPromise(sourceP2)) - throw Object.assign(new Error(`EEXIST: file already exists, copyfile '${sourceP2}' -> '${destP2}'`), { code: `EEXIST` }); - let content; - try { - content = await sourceFs.readFilePromise(sourceP2); - } catch (error) { - throw Object.assign(new Error(`EINVAL: invalid argument, copyfile '${sourceP2}' -> '${destP2}'`), { code: `EINVAL` }); - } - await destFs.writeFilePromise(destP2, content); - }; - return await this.makeCallPromise(sourceP, async () => { - return await this.makeCallPromise(destP, async () => { - return await this.baseFs.copyFilePromise(sourceP, destP, flags); - }, async (mountFsD, { subPath: subPathD }) => { - return await fallback(this.baseFs, sourceP, mountFsD, subPathD); - }); - }, async (mountFsS, { subPath: subPathS }) => { - return await this.makeCallPromise(destP, async () => { - return await fallback(mountFsS, subPathS, this.baseFs, destP); - }, async (mountFsD, { subPath: subPathD }) => { - if (mountFsS !== mountFsD) { - return await fallback(mountFsS, subPathS, mountFsD, subPathD); - } else { - return await mountFsS.copyFilePromise(subPathS, subPathD, flags); - } - }); - }); - } - copyFileSync(sourceP, destP, flags = 0) { - const fallback = (sourceFs, sourceP2, destFs, destP2) => { - if ((flags & fs.constants.COPYFILE_FICLONE_FORCE) !== 0) - throw Object.assign(new Error(`EXDEV: cross-device clone not permitted, copyfile '${sourceP2}' -> ${destP2}'`), { code: `EXDEV` }); - if (flags & fs.constants.COPYFILE_EXCL && this.existsSync(sourceP2)) - throw Object.assign(new Error(`EEXIST: file already exists, copyfile '${sourceP2}' -> '${destP2}'`), { code: `EEXIST` }); - let content; - try { - content = sourceFs.readFileSync(sourceP2); - } catch (error) { - throw Object.assign(new Error(`EINVAL: invalid argument, copyfile '${sourceP2}' -> '${destP2}'`), { code: `EINVAL` }); - } - destFs.writeFileSync(destP2, content); - }; - return this.makeCallSync(sourceP, () => { - return this.makeCallSync(destP, () => { - return this.baseFs.copyFileSync(sourceP, destP, flags); - }, (mountFsD, { subPath: subPathD }) => { - return fallback(this.baseFs, sourceP, mountFsD, subPathD); - }); - }, (mountFsS, { subPath: subPathS }) => { - return this.makeCallSync(destP, () => { - return fallback(mountFsS, subPathS, this.baseFs, destP); - }, (mountFsD, { subPath: subPathD }) => { - if (mountFsS !== mountFsD) { - return fallback(mountFsS, subPathS, mountFsD, subPathD); - } else { - return mountFsS.copyFileSync(subPathS, subPathD, flags); - } - }); - }); - } - async appendFilePromise(p, content, opts) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.appendFilePromise(p, content, opts); - }, async (mountFs, { subPath }) => { - return await mountFs.appendFilePromise(subPath, content, opts); - }); - } - appendFileSync(p, content, opts) { - return this.makeCallSync(p, () => { - return this.baseFs.appendFileSync(p, content, opts); - }, (mountFs, { subPath }) => { - return mountFs.appendFileSync(subPath, content, opts); - }); - } - async writeFilePromise(p, content, opts) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.writeFilePromise(p, content, opts); - }, async (mountFs, { subPath }) => { - return await mountFs.writeFilePromise(subPath, content, opts); - }); - } - writeFileSync(p, content, opts) { - return this.makeCallSync(p, () => { - return this.baseFs.writeFileSync(p, content, opts); - }, (mountFs, { subPath }) => { - return mountFs.writeFileSync(subPath, content, opts); - }); - } - async unlinkPromise(p) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.unlinkPromise(p); - }, async (mountFs, { subPath }) => { - return await mountFs.unlinkPromise(subPath); - }); - } - unlinkSync(p) { - return this.makeCallSync(p, () => { - return this.baseFs.unlinkSync(p); - }, (mountFs, { subPath }) => { - return mountFs.unlinkSync(subPath); - }); - } - async utimesPromise(p, atime, mtime) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.utimesPromise(p, atime, mtime); - }, async (mountFs, { subPath }) => { - return await mountFs.utimesPromise(subPath, atime, mtime); - }); - } - utimesSync(p, atime, mtime) { - return this.makeCallSync(p, () => { - return this.baseFs.utimesSync(p, atime, mtime); - }, (mountFs, { subPath }) => { - return mountFs.utimesSync(subPath, atime, mtime); - }); - } - async lutimesPromise(p, atime, mtime) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.lutimesPromise(p, atime, mtime); - }, async (mountFs, { subPath }) => { - return await mountFs.lutimesPromise(subPath, atime, mtime); - }); - } - lutimesSync(p, atime, mtime) { - return this.makeCallSync(p, () => { - return this.baseFs.lutimesSync(p, atime, mtime); - }, (mountFs, { subPath }) => { - return mountFs.lutimesSync(subPath, atime, mtime); - }); - } - async mkdirPromise(p, opts) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.mkdirPromise(p, opts); - }, async (mountFs, { subPath }) => { - return await mountFs.mkdirPromise(subPath, opts); - }); - } - mkdirSync(p, opts) { - return this.makeCallSync(p, () => { - return this.baseFs.mkdirSync(p, opts); - }, (mountFs, { subPath }) => { - return mountFs.mkdirSync(subPath, opts); - }); - } - async rmdirPromise(p, opts) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.rmdirPromise(p, opts); - }, async (mountFs, { subPath }) => { - return await mountFs.rmdirPromise(subPath, opts); - }); - } - rmdirSync(p, opts) { - return this.makeCallSync(p, () => { - return this.baseFs.rmdirSync(p, opts); - }, (mountFs, { subPath }) => { - return mountFs.rmdirSync(subPath, opts); - }); - } - async rmPromise(p, opts) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.rmPromise(p, opts); - }, async (mountFs, { subPath }) => { - return await mountFs.rmPromise(subPath, opts); - }); - } - rmSync(p, opts) { - return this.makeCallSync(p, () => { - return this.baseFs.rmSync(p, opts); - }, (mountFs, { subPath }) => { - return mountFs.rmSync(subPath, opts); - }); - } - async linkPromise(existingP, newP) { - return await this.makeCallPromise(newP, async () => { - return await this.baseFs.linkPromise(existingP, newP); - }, async (mountFs, { subPath }) => { - return await mountFs.linkPromise(existingP, subPath); - }); - } - linkSync(existingP, newP) { - return this.makeCallSync(newP, () => { - return this.baseFs.linkSync(existingP, newP); - }, (mountFs, { subPath }) => { - return mountFs.linkSync(existingP, subPath); - }); - } - async symlinkPromise(target, p, type) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.symlinkPromise(target, p, type); - }, async (mountFs, { subPath }) => { - return await mountFs.symlinkPromise(target, subPath); - }); - } - symlinkSync(target, p, type) { - return this.makeCallSync(p, () => { - return this.baseFs.symlinkSync(target, p, type); - }, (mountFs, { subPath }) => { - return mountFs.symlinkSync(target, subPath); - }); - } - async readFilePromise(p, encoding) { - return this.makeCallPromise(p, async () => { - return await this.baseFs.readFilePromise(p, encoding); - }, async (mountFs, { subPath }) => { - return await mountFs.readFilePromise(subPath, encoding); - }); - } - readFileSync(p, encoding) { - return this.makeCallSync(p, () => { - return this.baseFs.readFileSync(p, encoding); - }, (mountFs, { subPath }) => { - return mountFs.readFileSync(subPath, encoding); - }); - } - async readdirPromise(p, opts) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.readdirPromise(p, opts); - }, async (mountFs, { subPath }) => { - return await mountFs.readdirPromise(subPath, opts); - }, { - requireSubpath: false - }); - } - readdirSync(p, opts) { - return this.makeCallSync(p, () => { - return this.baseFs.readdirSync(p, opts); - }, (mountFs, { subPath }) => { - return mountFs.readdirSync(subPath, opts); - }, { - requireSubpath: false - }); - } - async readlinkPromise(p) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.readlinkPromise(p); - }, async (mountFs, { subPath }) => { - return await mountFs.readlinkPromise(subPath); - }); - } - readlinkSync(p) { - return this.makeCallSync(p, () => { - return this.baseFs.readlinkSync(p); - }, (mountFs, { subPath }) => { - return mountFs.readlinkSync(subPath); - }); - } - async truncatePromise(p, len) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.truncatePromise(p, len); - }, async (mountFs, { subPath }) => { - return await mountFs.truncatePromise(subPath, len); - }); - } - truncateSync(p, len) { - return this.makeCallSync(p, () => { - return this.baseFs.truncateSync(p, len); - }, (mountFs, { subPath }) => { - return mountFs.truncateSync(subPath, len); - }); - } - async ftruncatePromise(fd, len) { - if ((fd & MOUNT_MASK) !== this.magic) - return this.baseFs.ftruncatePromise(fd, len); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`ftruncate`); - const [mountFs, realFd] = entry; - return mountFs.ftruncatePromise(realFd, len); - } - ftruncateSync(fd, len) { - if ((fd & MOUNT_MASK) !== this.magic) - return this.baseFs.ftruncateSync(fd, len); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`ftruncateSync`); - const [mountFs, realFd] = entry; - return mountFs.ftruncateSync(realFd, len); - } - watch(p, a, b) { - return this.makeCallSync(p, () => { - return this.baseFs.watch( - p, - a, - b - ); - }, (mountFs, { subPath }) => { - return mountFs.watch( - subPath, - a, - b - ); - }); - } - watchFile(p, a, b) { - return this.makeCallSync(p, () => { - return this.baseFs.watchFile( - p, - a, - b - ); - }, () => { - return watchFile(this, p, a, b); - }); - } - unwatchFile(p, cb) { - return this.makeCallSync(p, () => { - return this.baseFs.unwatchFile(p, cb); - }, () => { - return unwatchFile(this, p, cb); - }); - } - async makeCallPromise(p, discard, accept, { requireSubpath = true } = {}) { - if (typeof p !== `string`) - return await discard(); - const normalizedP = this.resolve(p); - const mountInfo = this.findMount(normalizedP); - if (!mountInfo) - return await discard(); - if (requireSubpath && mountInfo.subPath === `/`) - return await discard(); - return await this.getMountPromise(mountInfo.archivePath, async (mountFs) => await accept(mountFs, mountInfo)); - } - makeCallSync(p, discard, accept, { requireSubpath = true } = {}) { - if (typeof p !== `string`) - return discard(); - const normalizedP = this.resolve(p); - const mountInfo = this.findMount(normalizedP); - if (!mountInfo) - return discard(); - if (requireSubpath && mountInfo.subPath === `/`) - return discard(); - return this.getMountSync(mountInfo.archivePath, (mountFs) => accept(mountFs, mountInfo)); - } - findMount(p) { - if (this.filter && !this.filter.test(p)) - return null; - let filePath = ``; - while (true) { - const pathPartWithArchive = p.substring(filePath.length); - const mountPoint = this.getMountPoint(pathPartWithArchive, filePath); - if (!mountPoint) - return null; - filePath = this.pathUtils.join(filePath, mountPoint); - if (!this.isMount.has(filePath)) { - if (this.notMount.has(filePath)) - continue; - try { - if (this.typeCheck !== null && (this.baseFs.lstatSync(filePath).mode & fs.constants.S_IFMT) !== this.typeCheck) { - this.notMount.add(filePath); - continue; - } - } catch { - return null; - } - this.isMount.add(filePath); - } - return { - archivePath: filePath, - subPath: this.pathUtils.join(PortablePath.root, p.substring(filePath.length)) - }; - } - } - limitOpenFiles(max) { - if (this.mountInstances === null) - return; - const now = Date.now(); - let nextExpiresAt = now + this.maxAge; - let closeCount = max === null ? 0 : this.mountInstances.size - max; - for (const [path, { childFs, expiresAt, refCount }] of this.mountInstances.entries()) { - if (refCount !== 0 || childFs.hasOpenFileHandles?.()) { - continue; - } else if (now >= expiresAt) { - childFs.saveAndClose?.(); - this.mountInstances.delete(path); - closeCount -= 1; - continue; - } else if (max === null || closeCount <= 0) { - nextExpiresAt = expiresAt; - break; - } - childFs.saveAndClose?.(); - this.mountInstances.delete(path); - closeCount -= 1; - } - if (this.limitOpenFilesTimeout === null && (max === null && this.mountInstances.size > 0 || max !== null) && isFinite(nextExpiresAt)) { - this.limitOpenFilesTimeout = setTimeout(() => { - this.limitOpenFilesTimeout = null; - this.limitOpenFiles(null); - }, nextExpiresAt - now).unref(); - } - } - async getMountPromise(p, accept) { - if (this.mountInstances) { - let cachedMountFs = this.mountInstances.get(p); - if (!cachedMountFs) { - const createFsInstance = await this.factoryPromise(this.baseFs, p); - cachedMountFs = this.mountInstances.get(p); - if (!cachedMountFs) { - cachedMountFs = { - childFs: createFsInstance(), - expiresAt: 0, - refCount: 0 - }; - } - } - this.mountInstances.delete(p); - this.limitOpenFiles(this.maxOpenFiles - 1); - this.mountInstances.set(p, cachedMountFs); - cachedMountFs.expiresAt = Date.now() + this.maxAge; - cachedMountFs.refCount += 1; - try { - return await accept(cachedMountFs.childFs); - } finally { - cachedMountFs.refCount -= 1; - } - } else { - const mountFs = (await this.factoryPromise(this.baseFs, p))(); - try { - return await accept(mountFs); - } finally { - mountFs.saveAndClose?.(); - } - } - } - getMountSync(p, accept) { - if (this.mountInstances) { - let cachedMountFs = this.mountInstances.get(p); - if (!cachedMountFs) { - cachedMountFs = { - childFs: this.factorySync(this.baseFs, p), - expiresAt: 0, - refCount: 0 - }; - } - this.mountInstances.delete(p); - this.limitOpenFiles(this.maxOpenFiles - 1); - this.mountInstances.set(p, cachedMountFs); - cachedMountFs.expiresAt = Date.now() + this.maxAge; - return accept(cachedMountFs.childFs); - } else { - const childFs = this.factorySync(this.baseFs, p); - try { - return accept(childFs); - } finally { - childFs.saveAndClose?.(); - } - } - } -} - -class PosixFS extends ProxiedFS { - constructor(baseFs) { - super(npath); - this.baseFs = baseFs; - } - mapFromBase(path) { - return npath.fromPortablePath(path); - } - mapToBase(path) { - return npath.toPortablePath(path); - } -} - -const NUMBER_REGEXP = /^[0-9]+$/; -const VIRTUAL_REGEXP = /^(\/(?:[^/]+\/)*?(?:\$\$virtual|__virtual__))((?:\/((?:[^/]+-)?[a-f0-9]+)(?:\/([^/]+))?)?((?:\/.*)?))$/; -const VALID_COMPONENT = /^([^/]+-)?[a-f0-9]+$/; -class VirtualFS extends ProxiedFS { - constructor({ baseFs = new NodeFS() } = {}) { - super(ppath); - this.baseFs = baseFs; - } - static makeVirtualPath(base, component, to) { - if (ppath.basename(base) !== `__virtual__`) - throw new Error(`Assertion failed: Virtual folders must be named "__virtual__"`); - if (!ppath.basename(component).match(VALID_COMPONENT)) - throw new Error(`Assertion failed: Virtual components must be ended by an hexadecimal hash`); - const target = ppath.relative(ppath.dirname(base), to); - const segments = target.split(`/`); - let depth = 0; - while (depth < segments.length && segments[depth] === `..`) - depth += 1; - const finalSegments = segments.slice(depth); - const fullVirtualPath = ppath.join(base, component, String(depth), ...finalSegments); - return fullVirtualPath; - } - static resolveVirtual(p) { - const match = p.match(VIRTUAL_REGEXP); - if (!match || !match[3] && match[5]) - return p; - const target = ppath.dirname(match[1]); - if (!match[3] || !match[4]) - return target; - const isnum = NUMBER_REGEXP.test(match[4]); - if (!isnum) - return p; - const depth = Number(match[4]); - const backstep = `../`.repeat(depth); - const subpath = match[5] || `.`; - return VirtualFS.resolveVirtual(ppath.join(target, backstep, subpath)); - } - getExtractHint(hints) { - return this.baseFs.getExtractHint(hints); - } - getRealPath() { - return this.baseFs.getRealPath(); - } - realpathSync(p) { - const match = p.match(VIRTUAL_REGEXP); - if (!match) - return this.baseFs.realpathSync(p); - if (!match[5]) - return p; - const realpath = this.baseFs.realpathSync(this.mapToBase(p)); - return VirtualFS.makeVirtualPath(match[1], match[3], realpath); - } - async realpathPromise(p) { - const match = p.match(VIRTUAL_REGEXP); - if (!match) - return await this.baseFs.realpathPromise(p); - if (!match[5]) - return p; - const realpath = await this.baseFs.realpathPromise(this.mapToBase(p)); - return VirtualFS.makeVirtualPath(match[1], match[3], realpath); - } - mapToBase(p) { - if (p === ``) - return p; - if (this.pathUtils.isAbsolute(p)) - return VirtualFS.resolveVirtual(p); - const resolvedRoot = VirtualFS.resolveVirtual(this.baseFs.resolve(PortablePath.dot)); - const resolvedP = VirtualFS.resolveVirtual(this.baseFs.resolve(p)); - return ppath.relative(resolvedRoot, resolvedP) || PortablePath.dot; - } - mapFromBase(p) { - return p; - } -} - -const URL = Number(process.versions.node.split('.', 1)[0]) < 20 ? url.URL : globalThis.URL; - -class NodePathFS extends ProxiedFS { - constructor(baseFs) { - super(npath); - this.baseFs = baseFs; - } - mapFromBase(path) { - return path; - } - mapToBase(path) { - if (typeof path === `string`) - return path; - if (path instanceof URL) - return url.fileURLToPath(path); - if (Buffer.isBuffer(path)) { - const str = path.toString(); - if (!isUtf8(path, str)) - throw new Error(`Non-utf8 buffers are not supported at the moment. Please upvote the following issue if you encounter this error: https://github.com/yarnpkg/berry/issues/4942`); - return str; - } - throw new Error(`Unsupported path type: ${nodeUtils.inspect(path)}`); - } -} -function isUtf8(buf, str) { - if (typeof buffer__default.default.isUtf8 !== `undefined`) - return buffer__default.default.isUtf8(buf); - return Buffer.byteLength(str) === buf.byteLength; -} - -var _a, _b, _c, _d; -const kBaseFs = Symbol(`kBaseFs`); -const kFd = Symbol(`kFd`); -const kClosePromise = Symbol(`kClosePromise`); -const kCloseResolve = Symbol(`kCloseResolve`); -const kCloseReject = Symbol(`kCloseReject`); -const kRefs = Symbol(`kRefs`); -const kRef = Symbol(`kRef`); -const kUnref = Symbol(`kUnref`); -class FileHandle { - constructor(fd, baseFs) { - this[_a] = 1; - this[_b] = void 0; - this[_c] = void 0; - this[_d] = void 0; - this[kBaseFs] = baseFs; - this[kFd] = fd; - } - get fd() { - return this[kFd]; - } - async appendFile(data, options) { - try { - this[kRef](this.appendFile); - const encoding = (typeof options === `string` ? options : options?.encoding) ?? void 0; - return await this[kBaseFs].appendFilePromise(this.fd, data, encoding ? { encoding } : void 0); - } finally { - this[kUnref](); - } - } - async chown(uid, gid) { - try { - this[kRef](this.chown); - return await this[kBaseFs].fchownPromise(this.fd, uid, gid); - } finally { - this[kUnref](); - } - } - async chmod(mode) { - try { - this[kRef](this.chmod); - return await this[kBaseFs].fchmodPromise(this.fd, mode); - } finally { - this[kUnref](); - } - } - createReadStream(options) { - return this[kBaseFs].createReadStream(null, { ...options, fd: this.fd }); - } - createWriteStream(options) { - return this[kBaseFs].createWriteStream(null, { ...options, fd: this.fd }); - } - datasync() { - throw new Error(`Method not implemented.`); - } - sync() { - throw new Error(`Method not implemented.`); - } - async read(bufferOrOptions, offset, length, position) { - try { - this[kRef](this.read); - let buffer; - if (!Buffer.isBuffer(bufferOrOptions)) { - bufferOrOptions ??= {}; - buffer = bufferOrOptions.buffer ?? Buffer.alloc(16384); - offset = bufferOrOptions.offset || 0; - length = bufferOrOptions.length ?? buffer.byteLength; - position = bufferOrOptions.position ?? null; - } else { - buffer = bufferOrOptions; - } - offset ??= 0; - length ??= 0; - if (length === 0) { - return { - bytesRead: length, - buffer - }; - } - const bytesRead = await this[kBaseFs].readPromise(this.fd, buffer, offset, length, position); - return { - bytesRead, - buffer - }; - } finally { - this[kUnref](); - } - } - async readFile(options) { - try { - this[kRef](this.readFile); - const encoding = (typeof options === `string` ? options : options?.encoding) ?? void 0; - return await this[kBaseFs].readFilePromise(this.fd, encoding); - } finally { - this[kUnref](); - } - } - readLines(options) { - return readline.createInterface({ - input: this.createReadStream(options), - crlfDelay: Infinity - }); - } - async stat(opts) { - try { - this[kRef](this.stat); - return await this[kBaseFs].fstatPromise(this.fd, opts); - } finally { - this[kUnref](); - } - } - async truncate(len) { - try { - this[kRef](this.truncate); - return await this[kBaseFs].ftruncatePromise(this.fd, len); - } finally { - this[kUnref](); - } - } - utimes(atime, mtime) { - throw new Error(`Method not implemented.`); - } - async writeFile(data, options) { - try { - this[kRef](this.writeFile); - const encoding = (typeof options === `string` ? options : options?.encoding) ?? void 0; - await this[kBaseFs].writeFilePromise(this.fd, data, encoding); - } finally { - this[kUnref](); - } - } - async write(...args) { - try { - this[kRef](this.write); - if (ArrayBuffer.isView(args[0])) { - const [buffer, offset, length, position] = args; - const bytesWritten = await this[kBaseFs].writePromise(this.fd, buffer, offset ?? void 0, length ?? void 0, position ?? void 0); - return { bytesWritten, buffer }; - } else { - const [data, position, encoding] = args; - const bytesWritten = await this[kBaseFs].writePromise(this.fd, data, position, encoding); - return { bytesWritten, buffer: data }; - } - } finally { - this[kUnref](); - } - } - async writev(buffers, position) { - try { - this[kRef](this.writev); - let bytesWritten = 0; - if (typeof position !== `undefined`) { - for (const buffer of buffers) { - const writeResult = await this.write(buffer, void 0, void 0, position); - bytesWritten += writeResult.bytesWritten; - position += writeResult.bytesWritten; - } - } else { - for (const buffer of buffers) { - const writeResult = await this.write(buffer); - bytesWritten += writeResult.bytesWritten; - } - } - return { - buffers, - bytesWritten - }; - } finally { - this[kUnref](); - } - } - readv(buffers, position) { - throw new Error(`Method not implemented.`); - } - close() { - if (this[kFd] === -1) - return Promise.resolve(); - if (this[kClosePromise]) - return this[kClosePromise]; - this[kRefs]--; - if (this[kRefs] === 0) { - const fd = this[kFd]; - this[kFd] = -1; - this[kClosePromise] = this[kBaseFs].closePromise(fd).finally(() => { - this[kClosePromise] = void 0; - }); - } else { - this[kClosePromise] = new Promise((resolve, reject) => { - this[kCloseResolve] = resolve; - this[kCloseReject] = reject; - }).finally(() => { - this[kClosePromise] = void 0; - this[kCloseReject] = void 0; - this[kCloseResolve] = void 0; - }); - } - return this[kClosePromise]; - } - [(_a = kRefs, _b = kClosePromise, _c = kCloseResolve, _d = kCloseReject, kRef)](caller) { - if (this[kFd] === -1) { - const err = new Error(`file closed`); - err.code = `EBADF`; - err.syscall = caller.name; - throw err; - } - this[kRefs]++; - } - [kUnref]() { - this[kRefs]--; - if (this[kRefs] === 0) { - const fd = this[kFd]; - this[kFd] = -1; - this[kBaseFs].closePromise(fd).then(this[kCloseResolve], this[kCloseReject]); - } - } -} - -const SYNC_IMPLEMENTATIONS = /* @__PURE__ */ new Set([ - `accessSync`, - `appendFileSync`, - `createReadStream`, - `createWriteStream`, - `chmodSync`, - `fchmodSync`, - `chownSync`, - `fchownSync`, - `closeSync`, - `copyFileSync`, - `linkSync`, - `lstatSync`, - `fstatSync`, - `lutimesSync`, - `mkdirSync`, - `openSync`, - `opendirSync`, - `readlinkSync`, - `readFileSync`, - `readdirSync`, - `readlinkSync`, - `realpathSync`, - `renameSync`, - `rmdirSync`, - `rmSync`, - `statSync`, - `symlinkSync`, - `truncateSync`, - `ftruncateSync`, - `unlinkSync`, - `unwatchFile`, - `utimesSync`, - `watch`, - `watchFile`, - `writeFileSync`, - `writeSync` -]); -const ASYNC_IMPLEMENTATIONS = /* @__PURE__ */ new Set([ - `accessPromise`, - `appendFilePromise`, - `fchmodPromise`, - `chmodPromise`, - `fchownPromise`, - `chownPromise`, - `closePromise`, - `copyFilePromise`, - `linkPromise`, - `fstatPromise`, - `lstatPromise`, - `lutimesPromise`, - `mkdirPromise`, - `openPromise`, - `opendirPromise`, - `readdirPromise`, - `realpathPromise`, - `readFilePromise`, - `readdirPromise`, - `readlinkPromise`, - `renamePromise`, - `rmdirPromise`, - `rmPromise`, - `statPromise`, - `symlinkPromise`, - `truncatePromise`, - `ftruncatePromise`, - `unlinkPromise`, - `utimesPromise`, - `writeFilePromise`, - `writeSync` -]); -function patchFs(patchedFs, fakeFs) { - fakeFs = new NodePathFS(fakeFs); - const setupFn = (target, name, replacement) => { - const orig = target[name]; - target[name] = replacement; - if (typeof orig?.[nodeUtils.promisify.custom] !== `undefined`) { - replacement[nodeUtils.promisify.custom] = orig[nodeUtils.promisify.custom]; - } - }; - { - setupFn(patchedFs, `exists`, (p, ...args) => { - const hasCallback = typeof args[args.length - 1] === `function`; - const callback = hasCallback ? args.pop() : () => { - }; - process.nextTick(() => { - fakeFs.existsPromise(p).then((exists) => { - callback(exists); - }, () => { - callback(false); - }); - }); - }); - setupFn(patchedFs, `read`, (...args) => { - let [fd, buffer, offset, length, position, callback] = args; - if (args.length <= 3) { - let options = {}; - if (args.length < 3) { - callback = args[1]; - } else { - options = args[1]; - callback = args[2]; - } - ({ - buffer = Buffer.alloc(16384), - offset = 0, - length = buffer.byteLength, - position - } = options); - } - if (offset == null) - offset = 0; - length |= 0; - if (length === 0) { - process.nextTick(() => { - callback(null, 0, buffer); - }); - return; - } - if (position == null) - position = -1; - process.nextTick(() => { - fakeFs.readPromise(fd, buffer, offset, length, position).then((bytesRead) => { - callback(null, bytesRead, buffer); - }, (error) => { - callback(error, 0, buffer); - }); - }); - }); - for (const fnName of ASYNC_IMPLEMENTATIONS) { - const origName = fnName.replace(/Promise$/, ``); - if (typeof patchedFs[origName] === `undefined`) - continue; - const fakeImpl = fakeFs[fnName]; - if (typeof fakeImpl === `undefined`) - continue; - const wrapper = (...args) => { - const hasCallback = typeof args[args.length - 1] === `function`; - const callback = hasCallback ? args.pop() : () => { - }; - process.nextTick(() => { - fakeImpl.apply(fakeFs, args).then((result) => { - callback(null, result); - }, (error) => { - callback(error); - }); - }); - }; - setupFn(patchedFs, origName, wrapper); - } - patchedFs.realpath.native = patchedFs.realpath; - } - { - setupFn(patchedFs, `existsSync`, (p) => { - try { - return fakeFs.existsSync(p); - } catch (error) { - return false; - } - }); - setupFn(patchedFs, `readSync`, (...args) => { - let [fd, buffer, offset, length, position] = args; - if (args.length <= 3) { - const options = args[2] || {}; - ({ offset = 0, length = buffer.byteLength, position } = options); - } - if (offset == null) - offset = 0; - length |= 0; - if (length === 0) - return 0; - if (position == null) - position = -1; - return fakeFs.readSync(fd, buffer, offset, length, position); - }); - for (const fnName of SYNC_IMPLEMENTATIONS) { - const origName = fnName; - if (typeof patchedFs[origName] === `undefined`) - continue; - const fakeImpl = fakeFs[fnName]; - if (typeof fakeImpl === `undefined`) - continue; - setupFn(patchedFs, origName, fakeImpl.bind(fakeFs)); - } - patchedFs.realpathSync.native = patchedFs.realpathSync; - } - { - const patchedFsPromises = patchedFs.promises; - for (const fnName of ASYNC_IMPLEMENTATIONS) { - const origName = fnName.replace(/Promise$/, ``); - if (typeof patchedFsPromises[origName] === `undefined`) - continue; - const fakeImpl = fakeFs[fnName]; - if (typeof fakeImpl === `undefined`) - continue; - if (fnName === `open`) - continue; - setupFn(patchedFsPromises, origName, (pathLike, ...args) => { - if (pathLike instanceof FileHandle) { - return pathLike[origName].apply(pathLike, args); - } else { - return fakeImpl.call(fakeFs, pathLike, ...args); - } - }); - } - setupFn(patchedFsPromises, `open`, async (...args) => { - const fd = await fakeFs.openPromise(...args); - return new FileHandle(fd, fakeFs); - }); - } - { - patchedFs.read[nodeUtils.promisify.custom] = async (fd, buffer, ...args) => { - const res = fakeFs.readPromise(fd, buffer, ...args); - return { bytesRead: await res, buffer }; - }; - patchedFs.write[nodeUtils.promisify.custom] = async (fd, buffer, ...args) => { - const res = fakeFs.writePromise(fd, buffer, ...args); - return { bytesWritten: await res, buffer }; - }; - } -} - -let cachedInstance; -let registeredFactory = () => { - throw new Error(`Assertion failed: No libzip instance is available, and no factory was configured`); -}; -function setFactory(factory) { - registeredFactory = factory; -} -function getInstance() { - if (typeof cachedInstance === `undefined`) - cachedInstance = registeredFactory(); - return cachedInstance; -} - -var libzipSync = {exports: {}}; - -(function (module, exports) { -var frozenFs = Object.assign({}, fs__default.default); -var createModule = function() { - var _scriptDir = void 0; - if (typeof __filename !== "undefined") - _scriptDir = _scriptDir || __filename; - return function(createModule2) { - createModule2 = createModule2 || {}; - var Module = typeof createModule2 !== "undefined" ? createModule2 : {}; - var readyPromiseResolve, readyPromiseReject; - Module["ready"] = new Promise(function(resolve, reject) { - readyPromiseResolve = resolve; - readyPromiseReject = reject; - }); - var moduleOverrides = {}; - var key; - for (key in Module) { - if (Module.hasOwnProperty(key)) { - moduleOverrides[key] = Module[key]; - } - } - var scriptDirectory = ""; - function locateFile(path) { - if (Module["locateFile"]) { - return Module["locateFile"](path, scriptDirectory); - } - return scriptDirectory + path; - } - var read_, readBinary; - var nodeFS; - var nodePath; - { - { - scriptDirectory = __dirname + "/"; - } - read_ = function shell_read(filename, binary) { - var ret = tryParseAsDataURI(filename); - if (ret) { - return binary ? ret : ret.toString(); - } - if (!nodeFS) - nodeFS = frozenFs; - if (!nodePath) - nodePath = path__default.default; - filename = nodePath["normalize"](filename); - return nodeFS["readFileSync"](filename, binary ? null : "utf8"); - }; - readBinary = function readBinary2(filename) { - var ret = read_(filename, true); - if (!ret.buffer) { - ret = new Uint8Array(ret); - } - assert(ret.buffer); - return ret; - }; - if (process["argv"].length > 1) { - process["argv"][1].replace(/\\/g, "/"); - } - process["argv"].slice(2); - Module["inspect"] = function() { - return "[Emscripten Module object]"; - }; - } - Module["print"] || console.log.bind(console); - var err = Module["printErr"] || console.warn.bind(console); - for (key in moduleOverrides) { - if (moduleOverrides.hasOwnProperty(key)) { - Module[key] = moduleOverrides[key]; - } - } - moduleOverrides = null; - if (Module["arguments"]) - ; - if (Module["thisProgram"]) - ; - if (Module["quit"]) - ; - var wasmBinary; - if (Module["wasmBinary"]) - wasmBinary = Module["wasmBinary"]; - Module["noExitRuntime"] || true; - if (typeof WebAssembly !== "object") { - abort("no native wasm support detected"); - } - function getValue(ptr, type, noSafe) { - type = type || "i8"; - if (type.charAt(type.length - 1) === "*") - type = "i32"; - switch (type) { - case "i1": - return HEAP8[ptr >> 0]; - case "i8": - return HEAP8[ptr >> 0]; - case "i16": - return LE_HEAP_LOAD_I16((ptr >> 1) * 2); - case "i32": - return LE_HEAP_LOAD_I32((ptr >> 2) * 4); - case "i64": - return LE_HEAP_LOAD_I32((ptr >> 2) * 4); - case "float": - return LE_HEAP_LOAD_F32((ptr >> 2) * 4); - case "double": - return LE_HEAP_LOAD_F64((ptr >> 3) * 8); - default: - abort("invalid type for getValue: " + type); - } - return null; - } - var wasmMemory; - var ABORT = false; - function assert(condition, text) { - if (!condition) { - abort("Assertion failed: " + text); - } - } - function getCFunc(ident) { - var func = Module["_" + ident]; - assert( - func, - "Cannot call unknown function " + ident + ", make sure it is exported" - ); - return func; - } - function ccall(ident, returnType, argTypes, args, opts) { - var toC = { - string: function(str) { - var ret2 = 0; - if (str !== null && str !== void 0 && str !== 0) { - var len = (str.length << 2) + 1; - ret2 = stackAlloc(len); - stringToUTF8(str, ret2, len); - } - return ret2; - }, - array: function(arr) { - var ret2 = stackAlloc(arr.length); - writeArrayToMemory(arr, ret2); - return ret2; - } - }; - function convertReturnValue(ret2) { - if (returnType === "string") - return UTF8ToString(ret2); - if (returnType === "boolean") - return Boolean(ret2); - return ret2; - } - var func = getCFunc(ident); - var cArgs = []; - var stack = 0; - if (args) { - for (var i = 0; i < args.length; i++) { - var converter = toC[argTypes[i]]; - if (converter) { - if (stack === 0) - stack = stackSave(); - cArgs[i] = converter(args[i]); - } else { - cArgs[i] = args[i]; - } - } - } - var ret = func.apply(null, cArgs); - ret = convertReturnValue(ret); - if (stack !== 0) - stackRestore(stack); - return ret; - } - function cwrap(ident, returnType, argTypes, opts) { - argTypes = argTypes || []; - var numericArgs = argTypes.every(function(type) { - return type === "number"; - }); - var numericRet = returnType !== "string"; - if (numericRet && numericArgs && !opts) { - return getCFunc(ident); - } - return function() { - return ccall(ident, returnType, argTypes, arguments); - }; - } - var UTF8Decoder = new TextDecoder("utf8"); - function UTF8ToString(ptr, maxBytesToRead) { - if (!ptr) - return ""; - var maxPtr = ptr + maxBytesToRead; - for (var end = ptr; !(end >= maxPtr) && HEAPU8[end]; ) - ++end; - return UTF8Decoder.decode(HEAPU8.subarray(ptr, end)); - } - function stringToUTF8Array(str, heap, outIdx, maxBytesToWrite) { - if (!(maxBytesToWrite > 0)) - return 0; - var startIdx = outIdx; - var endIdx = outIdx + maxBytesToWrite - 1; - for (var i = 0; i < str.length; ++i) { - var u = str.charCodeAt(i); - if (u >= 55296 && u <= 57343) { - var u1 = str.charCodeAt(++i); - u = 65536 + ((u & 1023) << 10) | u1 & 1023; - } - if (u <= 127) { - if (outIdx >= endIdx) - break; - heap[outIdx++] = u; - } else if (u <= 2047) { - if (outIdx + 1 >= endIdx) - break; - heap[outIdx++] = 192 | u >> 6; - heap[outIdx++] = 128 | u & 63; - } else if (u <= 65535) { - if (outIdx + 2 >= endIdx) - break; - heap[outIdx++] = 224 | u >> 12; - heap[outIdx++] = 128 | u >> 6 & 63; - heap[outIdx++] = 128 | u & 63; - } else { - if (outIdx + 3 >= endIdx) - break; - heap[outIdx++] = 240 | u >> 18; - heap[outIdx++] = 128 | u >> 12 & 63; - heap[outIdx++] = 128 | u >> 6 & 63; - heap[outIdx++] = 128 | u & 63; - } - } - heap[outIdx] = 0; - return outIdx - startIdx; - } - function stringToUTF8(str, outPtr, maxBytesToWrite) { - return stringToUTF8Array(str, HEAPU8, outPtr, maxBytesToWrite); - } - function lengthBytesUTF8(str) { - var len = 0; - for (var i = 0; i < str.length; ++i) { - var u = str.charCodeAt(i); - if (u >= 55296 && u <= 57343) - u = 65536 + ((u & 1023) << 10) | str.charCodeAt(++i) & 1023; - if (u <= 127) - ++len; - else if (u <= 2047) - len += 2; - else if (u <= 65535) - len += 3; - else - len += 4; - } - return len; - } - function allocateUTF8(str) { - var size = lengthBytesUTF8(str) + 1; - var ret = _malloc(size); - if (ret) - stringToUTF8Array(str, HEAP8, ret, size); - return ret; - } - function writeArrayToMemory(array, buffer2) { - HEAP8.set(array, buffer2); - } - function alignUp(x, multiple) { - if (x % multiple > 0) { - x += multiple - x % multiple; - } - return x; - } - var buffer, HEAP8, HEAPU8; - var HEAP_DATA_VIEW; - function updateGlobalBufferAndViews(buf) { - buffer = buf; - Module["HEAP_DATA_VIEW"] = HEAP_DATA_VIEW = new DataView(buf); - Module["HEAP8"] = HEAP8 = new Int8Array(buf); - Module["HEAP16"] = new Int16Array(buf); - Module["HEAP32"] = new Int32Array(buf); - Module["HEAPU8"] = HEAPU8 = new Uint8Array(buf); - Module["HEAPU16"] = new Uint16Array(buf); - Module["HEAPU32"] = new Uint32Array(buf); - Module["HEAPF32"] = new Float32Array(buf); - Module["HEAPF64"] = new Float64Array(buf); - } - Module["INITIAL_MEMORY"] || 16777216; - var wasmTable; - var __ATPRERUN__ = []; - var __ATINIT__ = []; - var __ATPOSTRUN__ = []; - function preRun() { - if (Module["preRun"]) { - if (typeof Module["preRun"] == "function") - Module["preRun"] = [Module["preRun"]]; - while (Module["preRun"].length) { - addOnPreRun(Module["preRun"].shift()); - } - } - callRuntimeCallbacks(__ATPRERUN__); - } - function initRuntime() { - callRuntimeCallbacks(__ATINIT__); - } - function postRun() { - if (Module["postRun"]) { - if (typeof Module["postRun"] == "function") - Module["postRun"] = [Module["postRun"]]; - while (Module["postRun"].length) { - addOnPostRun(Module["postRun"].shift()); - } - } - callRuntimeCallbacks(__ATPOSTRUN__); - } - function addOnPreRun(cb) { - __ATPRERUN__.unshift(cb); - } - function addOnInit(cb) { - __ATINIT__.unshift(cb); - } - function addOnPostRun(cb) { - __ATPOSTRUN__.unshift(cb); - } - var runDependencies = 0; - var dependenciesFulfilled = null; - function addRunDependency(id) { - runDependencies++; - if (Module["monitorRunDependencies"]) { - Module["monitorRunDependencies"](runDependencies); - } - } - function removeRunDependency(id) { - runDependencies--; - if (Module["monitorRunDependencies"]) { - Module["monitorRunDependencies"](runDependencies); - } - if (runDependencies == 0) { - if (dependenciesFulfilled) { - var callback = dependenciesFulfilled; - dependenciesFulfilled = null; - callback(); - } - } - } - Module["preloadedImages"] = {}; - Module["preloadedAudios"] = {}; - function abort(what) { - if (Module["onAbort"]) { - Module["onAbort"](what); - } - what += ""; - err(what); - ABORT = true; - what = "abort(" + what + "). Build with -s ASSERTIONS=1 for more info."; - var e = new WebAssembly.RuntimeError(what); - readyPromiseReject(e); - throw e; - } - var dataURIPrefix = "data:application/octet-stream;base64,"; - function isDataURI(filename) { - return filename.startsWith(dataURIPrefix); - } - var wasmBinaryFile = "data:application/octet-stream;base64,AGFzbQEAAAAB/wEkYAN/f38Bf2ABfwF/YAJ/fwF/YAF/AGAEf39/fwF/YAN/f38AYAV/f39/fwF/YAJ/fwBgBH9/f38AYAABf2AFf39/fn8BfmAEf35/fwF/YAR/f35/AX5gAn9+AX9gA398fwBgA39/fgF/YAF/AX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EAgA0EANgIEIANBDjYCAAtBAA8LIARCADcDECAEIAE3AwggBCAFNgIEIARBAToAACAEIAJFOgABIAAgBSABIAMQZUEASAR/IAQtAAEEQCAEKAIEEAYLIAQQBkEABSAECwubAgEDfyAALQAAQSBxRQRAAkAgASEDAkAgAiAAIgEoAhAiAAR/IAAFAn8gASABLQBKIgBBAWsgAHI6AEogASgCACIAQQhxBEAgASAAQSByNgIAQX8MAQsgAUIANwIEIAEgASgCLCIANgIcIAEgADYCFCABIAAgASgCMGo2AhBBAAsNASABKAIQCyABKAIUIgVrSwRAIAEgAyACIAEoAiQRAAAaDAILAn8gASwAS0F/SgRAIAIhAANAIAIgACIERQ0CGiADIARBAWsiAGotAABBCkcNAAsgASADIAQgASgCJBEAACAESQ0CIAMgBGohAyABKAIUIQUgAiAEawwBCyACCyEAIAUgAyAAEAcaIAEgASgCFCAAajYCFAsLCwvNBQEGfyAAKAIwIgNBhgJrIQYgACgCPCECIAMhAQNAIAAoAkQgAiAAKAJoIgRqayECIAEgBmogBE0EQCAAKAJIIgEgASADaiADEAcaAkAgAyAAKAJsIgFNBEAgACABIANrNgJsDAELIABCADcCbAsgACAAKAJoIANrIgE2AmggACAAKAJYIANrNgJYIAEgACgChC5JBEAgACABNgKELgsgAEH8gAEoAgARAwAgAiADaiECCwJAIAAoAgAiASgCBCIERQ0AIAAoAjwhBSAAIAIgBCACIARJGyICBH8gACgCSCAAKAJoaiAFaiEFIAEgBCACazYCBAJAAkACQAJAIAEoAhwiBCgCFEEBaw4CAQACCyAEQaABaiAFIAEoAgAgAkHcgAEoAgARCAAMAgsgASABKAIwIAUgASgCACACQcSAASgCABEEADYCMAwBCyAFIAEoAgAgAhAHGgsgASABKAIAIAJqNgIAIAEgASgCCCACajYCCCAAKAI8BSAFCyACaiICNgI8AkAgACgChC4iASACakEDSQ0AIAAoAmggAWshAQJAIAAoAnRBgQhPBEAgACAAIAAoAkggAWoiAi0AACACLQABIAAoAnwRAAA2AlQMAQsgAUUNACAAIAFBAWsgACgChAERAgAaCyAAKAKELiAAKAI8IgJBAUZrIgRFDQAgACABIAQgACgCgAERBQAgACAAKAKELiAEazYChC4gACgCPCECCyACQYUCSw0AIAAoAgAoAgRFDQAgACgCMCEBDAELCwJAIAAoAkQiAiAAKAJAIgNNDQAgAAJ/IAAoAjwgACgCaGoiASADSwRAIAAoAkggAWpBACACIAFrIgNBggIgA0GCAkkbIgMQGSABIANqDAELIAFBggJqIgEgA00NASAAKAJIIANqQQAgAiADayICIAEgA2siAyACIANJGyIDEBkgACgCQCADags2AkALC50CAQF/AkAgAAJ/IAAoAqAuIgFBwABGBEAgACgCBCAAKAIQaiAAKQOYLjcAACAAQgA3A5guIAAgACgCEEEIajYCEEEADAELIAFBIE4EQCAAKAIEIAAoAhBqIAApA5guPgAAIAAgAEGcLmo1AgA3A5guIAAgACgCEEEEajYCECAAIAAoAqAuQSBrIgE2AqAuCyABQRBOBEAgACgCBCAAKAIQaiAAKQOYLj0AACAAIAAoAhBBAmo2AhAgACAAKQOYLkIQiDcDmC4gACAAKAKgLkEQayIBNgKgLgsgAUEISA0BIAAgACgCECIBQQFqNgIQIAEgACgCBGogACkDmC48AAAgACAAKQOYLkIIiDcDmC4gACgCoC5BCGsLNgKgLgsLEAAgACgCCBAGIABBADYCCAvwAQECf0F/IQECQCAALQAoDQAgACgCJEEDRgRAIABBDGoEQCAAQQA2AhAgAEEXNgIMC0F/DwsCQCAAKAIgBEAgACkDGELAAINCAFINASAAQQxqBEAgAEEANgIQIABBHTYCDAtBfw8LAkAgACgCACICRQ0AIAIQMkF/Sg0AIAAoAgAhASAAQQxqIgAEQCAAIAEoAgw2AgAgACABKAIQNgIEC0F/DwsgAEEAQgBBABAOQn9VDQAgACgCACIARQ0BIAAQGhpBfw8LQQAhASAAQQA7ATQgAEEMagRAIABCADcCDAsgACAAKAIgQQFqNgIgCyABCzsAIAAtACgEfkJ/BSAAKAIgRQRAIABBDGoiAARAIABBADYCBCAAQRI2AgALQn8PCyAAQQBCA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SEDDAELIARBAkcEQCAFIQMMAQtB9cYBIAEoAjggAEEIahBpIgNFBEAgBRAcDAILIAMgBTYCAAsgASABLwEMQf7/A3EgAS8BUiIFQQBHcjsBDAJAAkACQAJAAn8CQAJAIAEpAyhC/v///w9WDQAgASkDIEL+////D1YNACACQYAEcUUNASABKQNIQv////8PVA0BCyAFQYECa0H//wNxQQNJIQdBAQwBCyAFQYECa0H//wNxIQQgAkGACnFBgApHDQEgBEEDSSEHQQALIQkgBkIcEBciBEUEQCAAQQhqIgAEQCAAQQA2AgQgAEEONgIACyADEBwMBQsgAkGACHEhBQJAAkAgAkGAAnEEQAJAIAUNACABKQMgQv////8PVg0AIAEpAyhCgICAgBBUDQMLIAQgASkDKBAYIAEpAyAhDAwBCwJAAkACQCAFDQAgASkDIEL/////D1YNACABKQMoIgxC/////w9WDQEgASkDSEKAgICAEFQNBAsgASkDKCIMQv////8PVA0BCyAEIAwQGAsgASkDICIMQv////8PWgRAIAQgDBAYCyABKQNIIgxC/////w9UDQELIAQgDBAYCyAELQAARQRAIABBCGoiAARAIABBADYCBCAAQRQ2AgALIAQQCCADEBwMBQtBASEKQQEgBC0AAAR+IAQpAxAFQgALp0H//wNxIAYQRyEFIAQQCCAFIAM2AgAgBw0BDAILIAMhBSAEQQJLDQELIAZCBxAXIgRFBEAgAEEIaiIABEAgAEEANgIEIABBDjYCAAsgBRAcDAMLIARBAhANIARBhxJBAhAsIAQgAS0AUhBwIAQgAS8BEBANIAQtAABFBEAgAEEIaiIABEAgAEEANgIEIABBFDYCAAsgBBAIDAILQYGyAkEHIAYQRyEDIAQQCCADIAU2AgBBASELIAMhBQsgBkIuEBciA0UEQCAAQQhqIgAEQCAAQQA2AgQgAEEONgIACyAFEBwMAgsgA0GjEkGoEiACQYACcSIHG0EEECwgB0UEQCADIAkEf0EtBSABLwEIC0H//wNxEA0LIAMgCQR/QS0FIAEvAQoLQf//A3EQDSADIAEvAQwQDSADIAsEf0HjAAUgASgCEAtB//8DcRANIAYgAS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IgiKcbCyIBEAkiAEUNACAAQQRrLQAAQQNxRQ0AIABBACABEBkLIAALQwEDfwJAIAJFDQADQCAALQAAIgQgAS0AACIFRgRAIAFBAWohASAAQQFqIQAgAkEBayICDQEMAgsLIAQgBWshAwsgAwsUACAAEEAgACgCABAgIAAoAgQQIAutBAIBfgV/IwBBEGsiBCQAIAAgAWshBgJAAkAgAUEBRgRAIAAgBi0AACACEBkMAQsgAUEJTwRAIAAgBikAADcAACAAIAJBAWtBB3FBAWoiBWohACACIAVrIgFFDQIgBSAGaiECA0AgACACKQAANwAAIAJBCGohAiAAQQhqIQAgAUEIayIBDQALDAILAkACQAJAAkAgAUEEaw4FAAICAgECCyAEIAYoAAAiATYCBCAEIAE2AgAMAgsgBCAGKQAANwMADAELQQghByAEQQhqIQgDQCAIIAYgByABIAEgB0sbIgUQByAFaiEIIAcgBWsiBw0ACyAEIAQpAwg3AwALAkAgBQ0AIAJBEEkNACAEKQMAIQMgAkEQayIGQQR2QQFqQQdxIgEEQANAIAAgAzcACCAAIAM3AAAgAkEQayECIABBEGohACABQQFrIgENAAsLIAZB8ABJDQADQCAAIAM3AHggACADNwBwIAAgAzcAaCAAIAM3AGAgACADNwBYIAAgAzcAUCAAIAM3AEggACADNwBAIAAgAzcAOCAAIAM3ADAgACADNwAoIAAgAzcAICAAIAM3ABggACADNwAQIAAgAzcACCAAIAM3AAAgAEGAAWohACACQYABayICQQ9LDQALCyACQQhPBEBBCCAFayEBA0AgACAEKQMANwAAIAAgAWohACACIAFrIgJBB0sNAAsLIAJFDQEgACAEIAIQBxoLIAAgAmohAAsgBEEQaiQAIAALXwECfyAAKAIIIgEEQCABEAsgAEEANgIICwJAIAAoAgQiAUUNACABKAIAIgJBAXFFDQAgASgCEEF+Rw0AIAEgAkF+cSICNgIAIAINACABECAgAEEANgIECyAAQQA6AAwL1wICBH8BfgJAAkAgACgCQCABp0EEdGooAgAiA0UEQCACBEAgAkEANgIEIAJBFDYCAAsMAQsgACgCACADKQNIIgdB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RQRAA0AgASACKQAANwAAIAEgAikAGDcAGCABIAIpABA3ABAgASACKQAINwAIIBpCIH0hGiACQSBqIQIgAUEgaiEBIB9CAX0iH0IAUg0ACwsgIELgAFQNAANAIAEgAikAADcAACABIAIpABg3ABggASACKQAQNwAQIAEgAikACDcACCABIAIpADg3ADggASACKQAwNwAwIAEgAikAKDcAKCABIAIpACA3ACAgASACKQBYNwBYIAEgAikAUDcAUCABIAIpAEg3AEggASACKQBANwBAIAEgAikAYDcAYCABIAIpAGg3AGggASACKQBwNwBwIAEgAikAeDcAeCACQYABaiECIAFBgAFqIQEgGkKAAX0iGkIfVg0ACwsgGkIQWgRAIAEgAikAADcAACABIAIpAAg3AAggGkIQfSEaIAJBEGohAiABQRBqIQELIBpCCFoEQCABIAIpAAA3AAAgGkIIfSEaIAJBCGohAiABQQhqIQELIBpCBFoEQCABIAIoAAA2AAAgGkIEfSEaIAJBBGohAiABQQRqIQELIBpCAloEQCABIAIvAAA7AAAgGkICfSEaIAJBAmohAiABQQJqIQELIBwgG30hHCAaUEUEQCABIAItAAA6AAAgAkEBaiECIAFBAWohAQsgHEIAUg0ACwsgDiEGIAwhAwsgBSAGSwRAAkACQCABIANNIAEgDyABa6wiGiAGrSIbIBogG1QbIhqnIglqIgIgA0txDQAgAyAJaiABSyABIANPcQ0AIAEgAyAJEAcaDAELIAEgAyADIAFrIgEgAUEfdSIBaiABcyIBEAcgAWohAiAaIAGtIh59IhxQDQAgASADaiEBA0ACQCAcIB4gHCAeVBsiG0IgVARAIBshGgwBCyAbIhpCIH0iIEIFiEIBfEIDgyIfUEUEQANAIAIgASkAADcAACACIAEpABg3ABggAiABKQAQNwAQIAIgASkACDcACCAaQiB9IRogAUEgaiEBIAJBIGohAiAfQgF9Ih9CAFINAAsLICBC4ABUDQADQCACIAEpAAA3AAAgAiABKQAYNwAYIAIgASkAEDcAECACIAEpAAg3AAggAiABKQA4NwA4IAIgASkAMDcAMCACIAEpACg3ACggAiABKQAgNwAgIAIgASkAWDcAWCACIAEpAFA3AFAgAiABKQBINwBIIAIgASkAQDcAQCACIAEpAGA3AGAgAiABKQBoNwBoIAIgASkAcDcAcCACIAEpAHg3AHggAUGAAWohASACQYABaiECIBpCgAF9IhpCH1YNAAsLIBpCEFoEQCACIAEpAAA3AAAgAiABKQAINwAIIBpCEH0hGiACQRBqIQIgAUEQaiEBCyAaQghaBEAgAiABKQAANwAAIBpCCH0hGiACQQhqIQIgAUEIaiEBCyAaQgRaBEAgAiABKAAANgAAIBpCBH0hGiACQQRqIQIgAUEEaiEBCyAaQgJaBEAgAiABLwAAOwAAIBpCAn0hGiACQQJqIQIgAUECaiEBCyAcIBt9IRwgGlBFBEAgAiABLQAAOgAAIAJBAWohAiABQQFqIQELIBxCAFINAAsLIAUgBmshAUEAIARrIQUCQCAEQQdLBEAgBCEDDAELIAEgBE0EQCAEIQMMAQsgAiAEayEFA0ACQCACIAUpAAA3AAAgBEEBdCEDIAEgBGshASACIARqIQIgBEEDSw0AIAMhBCABIANLDQELC0EAIANrIQULIAIgBWohBAJAIAUgDyACa6wiGiABrSIbIBogG1QbIhqnIgFIIAVBf0pxDQAgBUEBSCABIARqIAJLcQ0AIAIgBCABEAcgAWohAgwDCyACIAQgAyADQR91IgFqIAFzIgEQByABaiECIBogAa0iHn0iHFANAiABIARqIQEDQAJAIBwgHiAcIB5UGyIbQiBUBEAgGyEaDAELIBsiGkIgfSIgQgWIQgF8QgODIh9QRQRAA0AgAiABKQAANwAAIAIgASkAGDcAGCACIAEpABA3ABAgAiABKQAINwAIIBpCIH0hGiABQSBqIQEgAkEgaiECIB9CAX0iH0IAUg0ACwsgIELgAFQNAANAIAIgASkAADcAACACIAEpABg3ABggAiABKQAQNwAQIAIgASkACDcACCACIAEpADg3ADggAiABKQAwNwAwIAIgASkAKDcAKCACIAEpACA3ACAgAiABKQBYNwBYIAIgASkAUDcAUCACIAEpAEg3AEggAiABKQBANwBAIAIgASkAYDcAYCACIAEpAGg3AGggAiABKQBwNwBwIAIgASkAeDcAeCABQYABaiEBIAJBgAFqIQIgGkKAAX0iGkIfVg0ACwsgGkIQWgRAIAIgASkAADcAACACIAEpAAg3AAggGkIQfSEaIAJBEGohAiABQRBqIQELIBpCCFoEQCACIAEpAAA3AAAgGkIIfSEaIAJBCGohAiABQQhqIQELIBpCBFoEQCACIAEoAAA2AAAgGkIEfSEaIAJBBGohAiABQQRqIQELIBpCAloEQCACIAEvAAA7AAAgGkICfSEaIAJBAmohAiABQQJqIQELIBwgG30hHCAaUEUEQCACIAEtAAA6AAAgAkEBaiECIAFBAWohAQsgHFBFDQALDAILAkAgASADTSABIA8gAWusIhogBa0iGyAaIBtUGyIapyIEaiICIANLcQ0AIAMgBGogAUsgASADT3ENACABIAMgBBAHGgwCCyABIAMgAyABayIBIAFBH3UiAWogAXMiARAHIAFqIQIgGiABrSIefSIcUA0BIAEgA2ohAQNAAkAgHCAeIBwgHlQbIhtCIFQEQCAbIRoMAQsgGyIaQiB9IiBCBYhCAXxCA4MiH1BFBEADQCACIAEpAAA3AAAgAiABKQAYNwAYIAIgASkAEDcAECACIAEpAAg3AAggGkIgfSEaIAFBIGohASACQSBqIQIgH0IBfSIfQgBSDQALCyAgQuAAVA0AA0AgAiABKQAANwAAIAIgASkAGDcAGCACIAEpABA3ABAgAiABKQAINwAIIAIgASkAODcAOCACIAEpADA3ADAgAiABKQAoNwAoIAIgASkAIDcAICACIAEpAFg3AFggAiABKQBQNwBQIAIgASkASDcASCACIAEpAEA3AEAgAiABKQBgNwBgIAIgASkAaDcAaCACIAEpAHA3AHAgAiABKQB4NwB4IAFBgAFqIQEgAkGAAWohAiAaQoABfSIaQh9WDQALCyAaQhBaBEAgAiABKQAANwAAIAIgASkACDcACCAaQhB9IRogAkEQaiECIAFBEGohAQsgGkIIWgRAIAIgASkAADcAACAaQgh9IRogAkEIaiECIAFBCGohAQsgGkIEWgRAIAIgASgAADYAACAaQgR9IRogAkEEaiECIAFBBGohAQsgGkICWgRAIAIgAS8AADsAACAaQgJ9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AuEIQsgBCAFQQRJBH8gBgUgByAIQYDSAGooAgBrrSAGrYYgC4QhCyAIQcDUAGooAgAgBmoLIgVqIgNBP00EQCALIASthiAMhCELDAELIARBwABGBEAgACgCBCAAKAIQaiAMNwAAIAAgACgCEEEIajYCECAFIQMMAQsgACgCBCAAKAIQaiALIASthiAMhDcAACAAIAAoAhBBCGo2AhAgA0FAaiEDIAtBwAAgBGutiCELCyAAIAs3A5guIAAgAzYCoC4gCSAAKALwLUkNAAsLIAFBgAhqMwEAIQwCQCADIAFBgghqLwEAIgJqIgFBP00EQCAMIAOthiALhCEMDAELIANBwABGBEAgACgCBCAAKAIQaiALNwAAIAAgACgCEEEIajYCECACIQEMAQsgACgCBCAAKAIQaiAMIAOthiALhDcAACAAIAAoAhBBCGo2AhAgAUFAaiEBIAxBwAAgA2utiCEMCyAAIAw3A5guIAAgATYCoC4L8AQBA38gAEHkAWohAgNAIAIgAUECdCIDakEAOwEAIAIgA0EEcmpBADsBACABQQJqIgFBngJHDQALIABBADsBzBUgAEEAOwHYEyAAQZQWakEAOwEAIABBkBZqQQA7AQAgAEGMFmpBADsBACAAQYgWakEAOwEAIABBhBZqQQA7AQAgAEGAFmpBADsBACAAQfwVakEAOwEAIABB+BVqQQA7AQAgAEH0FWpBADsBACAAQfAVakEAOwEAIABB7BVqQQA7AQAgAEHoFWpBADsBACAAQeQVakEAOwEAIABB4BVqQQA7AQAgAEHcFWpBADsBACAAQdgVakEAOwEAIABB1BVqQQA7AQAgAEHQFWpBADsBACAAQcwUakEAOwEAIABByBRqQQA7AQAgAEHEFGpBADsBACAAQcAUakEAOwEAIABBvBRqQQA7AQAgAEG4FGpBADsBACAAQbQUakEAOwEAIABBsBRqQQA7AQAgAEGsFGpBADsBACAAQagUakEAOwEAIABBpBRqQQA7AQAgAEGgFGpBADsBACAAQZwUakEAOwEAIABBmBRqQQA7AQAgAEGUFGpBADsBACAAQZAUakEAOwEAIABBjBRqQQA7AQAgAEGIFGpBADsBACAAQYQUakEA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KIAMoAhANAkEABSABCyADKAIEaiAFKAIwOwAAIAMgAygCEEECajYCECADQaABakHkgAEoAgARAQAaCyADQfEANgIgIAUQCiADKAIQRQ0BDAcLDAYLIAUoAgQNAQsgAygCPA0AIApFDQEgAygCIEGaBUYNAQsCfyADKAKIASIBRQRAIAMgChCFAQwBCwJAAkACQCADKAKMAUECaw4CAAECCwJ/AkADQAJAAkAgAygCPA0AIAMQLyADKAI8DQAgCg0BQQAMBAsgAygCSCADKAJoai0AACEEIAMgAygC8C0iAUEBajYC8C0gASADKALsLWpBADoAACADIAMoAvAtIgFBAWo2AvAtIAEgAygC7C1qQQA6AAAgAyADKALwLSIBQQFqNgLwLSABIAMoAuwtaiAEOgAAIAMgBEECdGoiASABLwHkAUEBajsB5AEgAyADKAI8QQFrNgI8IAMgAygCaEEBaiIBNgJoIAMoAvAtIAMoAvQtRw0BQQAhBCADIAMoAlgiBkEATgR/IAMoAkggBmoFQQALIAEgBmtBABAPIAMgAygCaDYCWCADKAIAEAogAygCACgCEA0BDAILCyADQQA2AoQuIApBBEYEQCADIAMoAlgiAUEATgR/IAMoAkggAWoFQQALIAMoAmggAWtBARAPIAMgAygCaDYCWCADKAIAEApBA0ECIAMoAgAoAhAbDAILIAMoAvAtBEBBACEEIAMgAygCWCIBQQBOBH8gAygCSCABagVBAAsgAygCaCABa0EAEA8gAyADKAJoNgJYIAMoAgAQCiADKAIAKAIQRQ0BC0EBIQQLIAQLDAILAn8CQANAAkACQAJAAkACQCADKAI8Ig1BggJLDQAgAxAvAkAgAygCPCINQYICSw0AIAoNAEEADAgLIA1FDQQgDUECSw0AIAMoAmghCAwBCyADKAJoIghFBEBBACEIDAELIAMoAkggCGoiAUEBayIELQAAIgYgAS0AAEcNACAGIAQtAAJHDQAgBEEDaiEEQQAhCQJAA0AgBiAELQAARw0BIAQtAAEgBkcEQCAJQQFyIQkMAgsgBC0AAiAGRwRAIAlBAnIhCQwCCyAELQADIAZHBEAgCUEDciEJDAILIAQtAAQgBkc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AgAEoAgARAAAiATYCHCAMIAE2AjALIAMoAiwiDUUNASAQIA1rIQUgAygCOCEBIAwoAhwiBigCFARAIAZBQGsgASAFIA1B3IABKAIAEQgADAILIAYgBigCHCABIAUgDUHEgAEoAgARBAAiATYCHCAMIAE2AjAMAQsgDSAQIAZrIAYQBxoLIANBADYCNCADIAMoAiw2AjBBAAwECyAKIAYgAygCNCIFayIBIAEgCksbIQsgECAKayEGIAUgDWohBQJAIAkEQAJAIAtFDQAgDCgCHCIBKAIUBEAgAUFAayAFIAYgC0HcgAEoAgARCAAMAQsgASABKAIcIAUgBiALQcSAASgCABEEACIBNgIcIAwgATYCMAsgCiALayIFRQ0BIBAgBWshBiADKAI4IQEgDCgCHCINKAIUBEAgDUFAayABIAYgBUHcgAEoAgARCAAMBQsgDSANKAIcIAEgBiAFQcSAASgCABEEACIBNgIcIAwgATYCMAwECyAFIAYgCxAHGiAKIAtrIgUNAgtBACEIIANBACADKAI0IAtqIgUgBSADKAIsIgFGGzYCNCABIAMoAjAiAU0NACADIAEgC2o2AjALIAgMAgsgAygCOCAQIAVrIAUQBxoLIAMgBTYCNCADIAMoAiw2AjBBAAtFBEAgDCgCECEPIAwoAgQhFyAHKAKIAQwDCyAHQdL+ADYCBAtBfCEXDAILIAYhFyAFCyEFIAwgICAXayIBIAwoAghqNgIIIAwgFiAPayIGIAwoAhRqNgIUIAcgBygCICAGajYCICAMIAcoAghBAEdBBnQgBWogBygCBCIFQb/+AEZBB3RqQYACIAVBwv4ARkEIdCAFQcf+AEYbajYCLCAEIARBeyAEGyABIAZyGyEXCyAUQRBqJAAgFwshASACIAIpAwAgADUCIH03AwACQAJAAkACQCABQQVqDgcBAgICAgMAAgtBAQ8LIAAoAhQNAEEDDwsgACgCACIABEAgACABNgIEIABBDTYCAAtBAiEBCyABCwkAIABBAToADAtEAAJAIAJC/////w9YBEAgACgCFEUNAQsgACgCACIABEAgAEEANgIEIABBEjYCAAtBAA8LIAAgATYCECAAIAI+AhRBAQu5AQE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jfLf0cVz0P9fbcGRNiDOv6w+bBTje2M6eWVyVBAofXqKNVCIwrRfpliqTsgx50Hmq/gVKKDhGgY6/wtoU7IERsmvKbSBLiaaGzA39HJ9ONroYFAQAAJ0HAAAsCQAAhgUAAEgFAACnBQAAAAQAADIFAAC8BQAALAkAQYDBAAv3CQwACACMAAgATAAIAMwACAAsAAgArAAIAGwACADsAAgAHAAIAJwACABcAAgA3AAIADwACAC8AAgAfAAIAPwACAACAAgAggAIAEIACADCAAgAIgAIAKIACABiAAgA4gAIABIACACSAAgAUgAIANIACAAyAAgAsgAIAHIACADyAAgACgAIAIoACABKAAgAygAIACoACACqAAgAagAIAOoACAAaAAgAmgAIAFoACADaAAgAOgAIALoACAB6AAgA+gAIAAYACACGAAgARgAIAMYACAAmAAgApgAIAGYACADmAAgAFgAIAJYACABWAAgA1gAIADYACAC2AAgAdgAIAPYACAAOAAgAjgAIAE4ACADOAAgALgAIAK4ACABuAAgA7gAIAB4ACACeAAgAXgAIAN4ACAA+AAgAvgAIAH4ACAD+AAgAAQAIAIEACABBAAgAwQAIACEACAChAAgAYQAIAOEACAARAAgAkQAIAFEACADRAAgAMQAIALEACABxAAgA8QAIAAkACACJAAgASQAIAMkACAApAAgAqQAIAGkACADpAAgAGQAIAJkACABZAAgA2QAIADkACAC5AAgAeQAIAPkACAAFAAgAhQAIAEUACADFAAgAJQAIAKUACABlAAgA5QAIABUACACVAAgAVQAIANUACAA1AAgAtQAIAHUACAD1AAgADQAIAI0ACABNAAgAzQAIAC0ACACtAAgAbQAIAO0ACAAdAAgAnQAIAF0ACADdAAgAPQAIAL0ACAB9AAgA/QAIABMACQATAQkAkwAJAJMBCQBTAAkAUwEJANMACQDTAQkAMwAJADMBCQCzAAkAswEJAHMACQBzAQkA8wAJAPMBCQALAAkACwEJAIsACQCLAQkASwAJAEsBCQDLAAkAywEJACsACQArAQkAqwAJAKsBCQBrAAkAawEJAOsACQDrAQkAGwAJABsBCQCbAAkAmwEJAFsACQBbAQkA2w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HAEHg0wALTQEAAAABAAAAAQAAAAEAAAACAAAAAgAAAAIAAAACAAAAAwAAAAMAAAADAAAAAwAAAAQAAAAEAAAABAAAAAQAAAAFAAAABQAAAAUAAAAFAEHQ1AALZQEAAAABAAAAAgAAAAIAAAADAAAAAwAAAAQAAAAEAAAABQAAAAUAAAAGAAAABgAAAAcAAAAHAAAACAAAAAgAAAAJAAAACQAAAAoAAAAKAAAACwAAAAsAAAAMAAAADAAAAA0AAAANAEGA1gALIwIAAAADAAAABwAAAAAAAAAQERIACAcJBgoFCwQMAw0CDgEPAEHQ1gALTQEAAAABAAAAAQAAAAEAAAACAAAAAgAAAAIAAAACAAAAAwAAAAMAAAADAAAAAwAAAAQAAAAEAAAABAAAAAQAAAAFAAAABQAAAAUAAAAFAEHA1wALZQEAAAABAAAAAgAAAAIAAAADAAAAAwAAAAQAAAAEAAAABQAAAAUAAAAGAAAABgAAAAcAAAAHAAAACAAAAAgAAAAJAAAACQAAAAoAAAAKAAAACwAAAAsAAAAMAAAADAAAAA0AAAANAEG42AALASwAQcTYAAthLQAAAAQABAAIAAQALgAAAAQABgAQAAYALwAAAAQADAAgABgALwAAAAgAEAAgACAALwAAAAgAEACAAIAALwAAAAgAIACAAAABMAAAACAAgAACAQAEMAAAACAAAgECAQAQMABBsNkAC6UTAwAEAAUABgAHAAgACQAKAAsADQAPABEAEwAXABsAHwAjACsAMwA7AEMAUwBjAHMAgwCjAMMA4wACAQAAAAAAABAAEAAQABAAEAAQABAAEAARABEAEQARABIAEgASABIAEwATABMAEwAUABQAFAAUABUAFQAVABUAEABNAMoAAAABAAIAAwAEAAUABwAJAA0AEQAZACEAMQBBAGEAgQDBAAEBgQEBAgEDAQQBBgEIAQwBEAEYASABMAFAAWAAAAAAEAAQABAAEAARABEAEgASABMAEwAUABQAFQAVABYAFgAXABcAGAAYABkAGQAaABoAGwAbABwAHAAdAB0AQABAAGAHAAAACFAAAAgQABQIcwASBx8AAAhwAAAIMAAACcAAEAcKAAAIYAAACC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HdvcmsgaXMgZG93bgBOZXR3b3JrIHVucmVhY2hhYmxlAENvbm5lY3Rpb24gcmVzZXQgYnkgbmV0d29yawBDb25uZWN0aW9uIGFib3J0ZWQATm8gYnVmZmVyIHNwYWNlIGF2YWlsYWJsZQBTb2NrZXQgaXMgY29ubmVjdGVkAFNvY2tldCBub3QgY29ubmVjdGVkAENhbm5vdCBzZW5kIGFmdGVyIHNvY2tldCBzaHV0ZG93bgBPcGVyYXRpb24gYWxyZWFkeSBpbiBwcm9ncmVzcwBPcGVyYXRpb24gaW4gcHJvZ3Jlc3MAU3RhbGUgZmlsZSBoYW5kbGUAUmVtb3RlIEkvTyBlcnJvcgBRdW90YSBleGNlZWRlZABObyBtZWRpdW0gZm91bmQAV3JvbmcgbWVkaXVtIHR5cGUATm8gZXJyb3IgaW5mb3JtYXRpb24AQcCAAQuFARMAAAAUAAAAFQAAABYAAAAXAAAAGAAAABkAAAAaAAAAGwAAABwAAAAdAAAAHgAAAB8AAAAgAAAAIQAAACIAAAAjAAAAgERQADEAAAAyAAAAMwAAADQAAAA1AAAANgAAADcAAAA4AAAAOQAAADIAAAAzAAAANAAAADUAAAA2AAAANwAAADgAQfSCAQsCXEQAQbCDAQsQ/////////////////////w=="; - if (!isDataURI(wasmBinaryFile)) { - wasmBinaryFile = locateFile(wasmBinaryFile); - } - function getBinary(file) { - try { - if (file == wasmBinaryFile && wasmBinary) { - return new Uint8Array(wasmBinary); - } - var binary = tryParseAsDataURI(file); - if (binary) { - return binary; - } - if (readBinary) { - return readBinary(file); - } else { - throw "sync fetching of the wasm failed: you can preload it to Module['wasmBinary'] manually, or emcc.py will do that for you when generating HTML (but not JS)"; - } - } catch (err2) { - abort(err2); - } - } - function instantiateSync(file, info) { - var instance; - var module2; - var binary; - try { - binary = getBinary(file); - module2 = new WebAssembly.Module(binary); - instance = new WebAssembly.Instance(module2, info); - } catch (e) { - var str = e.toString(); - err("failed to compile wasm module: " + str); - if (str.includes("imported Memory") || str.includes("memory import")) { - err( - "Memory size incompatibility issues may be due to changing INITIAL_MEMORY at runtime to something too large. Use ALLOW_MEMORY_GROWTH to allow any size memory (and also make sure not to set INITIAL_MEMORY at runtime to something smaller than it was at compile time)." - ); - } - throw e; - } - return [instance, module2]; - } - function createWasm() { - var info = { a: asmLibraryArg }; - function receiveInstance(instance, module2) { - var exports3 = instance.exports; - Module["asm"] = exports3; - wasmMemory = Module["asm"]["g"]; - updateGlobalBufferAndViews(wasmMemory.buffer); - wasmTable = Module["asm"]["W"]; - addOnInit(Module["asm"]["h"]); - removeRunDependency(); - } - addRunDependency(); - if (Module["instantiateWasm"]) { - try { - var exports2 = Module["instantiateWasm"](info, receiveInstance); - return exports2; - } catch (e) { - err("Module.instantiateWasm callback failed with error: " + e); - return false; - } - } - var result = instantiateSync(wasmBinaryFile, info); - receiveInstance(result[0]); - return Module["asm"]; - } - function LE_HEAP_LOAD_F32(byteOffset) { - return HEAP_DATA_VIEW.getFloat32(byteOffset, true); - } - function LE_HEAP_LOAD_F64(byteOffset) { - return HEAP_DATA_VIEW.getFloat64(byteOffset, true); - } - function LE_HEAP_LOAD_I16(byteOffset) { - return HEAP_DATA_VIEW.getInt16(byteOffset, true); - } - function LE_HEAP_LOAD_I32(byteOffset) { - return HEAP_DATA_VIEW.getInt32(byteOffset, true); - } - function LE_HEAP_STORE_I32(byteOffset, value) { - HEAP_DATA_VIEW.setInt32(byteOffset, value, true); - } - function callRuntimeCallbacks(callbacks) { - while (callbacks.length > 0) { - var callback = callbacks.shift(); - if (typeof callback == "function") { - callback(Module); - continue; - } - var func = callback.func; - if (typeof func === "number") { - if (callback.arg === void 0) { - wasmTable.get(func)(); - } else { - wasmTable.get(func)(callback.arg); - } - } else { - func(callback.arg === void 0 ? null : callback.arg); - } - } - } - function _gmtime_r(time, tmPtr) { - var date = new Date(LE_HEAP_LOAD_I32((time >> 2) * 4) * 1e3); - LE_HEAP_STORE_I32((tmPtr >> 2) * 4, date.getUTCSeconds()); - LE_HEAP_STORE_I32((tmPtr + 4 >> 2) * 4, date.getUTCMinutes()); - LE_HEAP_STORE_I32((tmPtr + 8 >> 2) * 4, date.getUTCHours()); - LE_HEAP_STORE_I32((tmPtr + 12 >> 2) * 4, date.getUTCDate()); - LE_HEAP_STORE_I32((tmPtr + 16 >> 2) * 4, date.getUTCMonth()); - LE_HEAP_STORE_I32((tmPtr + 20 >> 2) * 4, date.getUTCFullYear() - 1900); - LE_HEAP_STORE_I32((tmPtr + 24 >> 2) * 4, date.getUTCDay()); - LE_HEAP_STORE_I32((tmPtr + 36 >> 2) * 4, 0); - LE_HEAP_STORE_I32((tmPtr + 32 >> 2) * 4, 0); - var start = Date.UTC(date.getUTCFullYear(), 0, 1, 0, 0, 0, 0); - var yday = (date.getTime() - start) / (1e3 * 60 * 60 * 24) | 0; - LE_HEAP_STORE_I32((tmPtr + 28 >> 2) * 4, yday); - if (!_gmtime_r.GMTString) - _gmtime_r.GMTString = allocateUTF8("GMT"); - LE_HEAP_STORE_I32((tmPtr + 40 >> 2) * 4, _gmtime_r.GMTString); - return tmPtr; - } - function ___gmtime_r(a0, a1) { - return _gmtime_r(a0, a1); - } - function _emscripten_memcpy_big(dest, src, num) { - HEAPU8.copyWithin(dest, src, src + num); - } - function emscripten_realloc_buffer(size) { - try { - wasmMemory.grow(size - buffer.byteLength + 65535 >>> 16); - updateGlobalBufferAndViews(wasmMemory.buffer); - return 1; - } catch (e) { - } - } - function _emscripten_resize_heap(requestedSize) { - var oldSize = HEAPU8.length; - requestedSize = requestedSize >>> 0; - var maxHeapSize = 2147483648; - if (requestedSize > maxHeapSize) { - return false; - } - for (var cutDown = 1; cutDown <= 4; cutDown *= 2) { - var overGrownHeapSize = oldSize * (1 + 0.2 / cutDown); - overGrownHeapSize = Math.min( - overGrownHeapSize, - requestedSize + 100663296 - ); - var newSize = Math.min( - maxHeapSize, - alignUp(Math.max(requestedSize, overGrownHeapSize), 65536) - ); - var replacement = emscripten_realloc_buffer(newSize); - if (replacement) { - return true; - } - } - return false; - } - function _setTempRet0(val) { - } - function _time(ptr) { - var ret = Date.now() / 1e3 | 0; - if (ptr) { - LE_HEAP_STORE_I32((ptr >> 2) * 4, ret); - } - return ret; - } - function _tzset() { - if (_tzset.called) - return; - _tzset.called = true; - var currentYear = new Date().getFullYear(); - var winter = new Date(currentYear, 0, 1); - var summer = new Date(currentYear, 6, 1); - var winterOffset = winter.getTimezoneOffset(); - var summerOffset = summer.getTimezoneOffset(); - var stdTimezoneOffset = Math.max(winterOffset, summerOffset); - LE_HEAP_STORE_I32((__get_timezone() >> 2) * 4, stdTimezoneOffset * 60); - LE_HEAP_STORE_I32( - (__get_daylight() >> 2) * 4, - Number(winterOffset != summerOffset) - ); - function extractZone(date) { - var match = date.toTimeString().match(/\(([A-Za-z ]+)\)$/); - return match ? match[1] : "GMT"; - } - var winterName = extractZone(winter); - var summerName = extractZone(summer); - var winterNamePtr = allocateUTF8(winterName); - var summerNamePtr = allocateUTF8(summerName); - if (summerOffset < winterOffset) { - LE_HEAP_STORE_I32((__get_tzname() >> 2) * 4, winterNamePtr); - LE_HEAP_STORE_I32((__get_tzname() + 4 >> 2) * 4, summerNamePtr); - } else { - LE_HEAP_STORE_I32((__get_tzname() >> 2) * 4, summerNamePtr); - LE_HEAP_STORE_I32((__get_tzname() + 4 >> 2) * 4, winterNamePtr); - } - } - function _timegm(tmPtr) { - _tzset(); - var time = Date.UTC( - LE_HEAP_LOAD_I32((tmPtr + 20 >> 2) * 4) + 1900, - LE_HEAP_LOAD_I32((tmPtr + 16 >> 2) * 4), - LE_HEAP_LOAD_I32((tmPtr + 12 >> 2) * 4), - LE_HEAP_LOAD_I32((tmPtr + 8 >> 2) * 4), - LE_HEAP_LOAD_I32((tmPtr + 4 >> 2) * 4), - LE_HEAP_LOAD_I32((tmPtr >> 2) * 4), - 0 - ); - var date = new Date(time); - LE_HEAP_STORE_I32((tmPtr + 24 >> 2) * 4, date.getUTCDay()); - var start = Date.UTC(date.getUTCFullYear(), 0, 1, 0, 0, 0, 0); - var yday = (date.getTime() - start) / (1e3 * 60 * 60 * 24) | 0; - LE_HEAP_STORE_I32((tmPtr + 28 >> 2) * 4, yday); - return date.getTime() / 1e3 | 0; - } - function intArrayFromBase64(s) { - { - var buf; - try { - buf = Buffer.from(s, "base64"); - } catch (_) { - buf = new Buffer(s, "base64"); - } - return new Uint8Array( - buf["buffer"], - buf["byteOffset"], - buf["byteLength"] - ); - } - } - function tryParseAsDataURI(filename) { - if (!isDataURI(filename)) { - return; - } - return intArrayFromBase64(filename.slice(dataURIPrefix.length)); - } - var asmLibraryArg = { - e: ___gmtime_r, - c: _emscripten_memcpy_big, - d: _emscripten_resize_heap, - a: _setTempRet0, - b: _time, - f: _timegm - }; - var asm = createWasm(); - Module["___wasm_call_ctors"] = asm["h"]; - Module["_zip_ext_count_symlinks"] = asm["i"]; - Module["_zip_file_get_external_attributes"] = asm["j"]; - Module["_zipstruct_statS"] = asm["k"]; - Module["_zipstruct_stat_size"] = asm["l"]; - Module["_zipstruct_stat_mtime"] = asm["m"]; - Module["_zipstruct_stat_crc"] = asm["n"]; - Module["_zipstruct_errorS"] = asm["o"]; - Module["_zipstruct_error_code_zip"] = asm["p"]; - Module["_zipstruct_stat_comp_size"] = asm["q"]; - Module["_zipstruct_stat_comp_method"] = asm["r"]; - Module["_zip_close"] = asm["s"]; - Module["_zip_delete"] = asm["t"]; - Module["_zip_dir_add"] = asm["u"]; - Module["_zip_discard"] = asm["v"]; - Module["_zip_error_init_with_code"] = asm["w"]; - Module["_zip_get_error"] = asm["x"]; - Module["_zip_file_get_error"] = asm["y"]; - Module["_zip_error_strerror"] = asm["z"]; - Module["_zip_fclose"] = asm["A"]; - Module["_zip_file_add"] = asm["B"]; - Module["_free"] = asm["C"]; - var _malloc = Module["_malloc"] = asm["D"]; - Module["_zip_source_error"] = asm["E"]; - Module["_zip_source_seek"] = asm["F"]; - Module["_zip_file_set_external_attributes"] = asm["G"]; - Module["_zip_file_set_mtime"] = asm["H"]; - Module["_zip_fopen_index"] = asm["I"]; - Module["_zip_fread"] = asm["J"]; - Module["_zip_get_name"] = asm["K"]; - Module["_zip_get_num_entries"] = asm["L"]; - Module["_zip_source_read"] = asm["M"]; - Module["_zip_name_locate"] = asm["N"]; - Module["_zip_open_from_source"] = asm["O"]; - Module["_zip_set_file_compression"] = asm["P"]; - Module["_zip_source_buffer"] = asm["Q"]; - Module["_zip_source_buffer_create"] = asm["R"]; - Module["_zip_source_close"] = asm["S"]; - Module["_zip_source_free"] = asm["T"]; - Module["_zip_source_keep"] = asm["U"]; - Module["_zip_source_open"] = asm["V"]; - Module["_zip_source_tell"] = asm["X"]; - Module["_zip_stat_index"] = asm["Y"]; - var __get_tzname = Module["__get_tzname"] = asm["Z"]; - var __get_daylight = Module["__get_daylight"] = asm["_"]; - var __get_timezone = Module["__get_timezone"] = asm["$"]; - var stackSave = Module["stackSave"] = asm["aa"]; - var stackRestore = Module["stackRestore"] = asm["ba"]; - var stackAlloc = Module["stackAlloc"] = asm["ca"]; - Module["cwrap"] = cwrap; - Module["getValue"] = getValue; - var calledRun; - dependenciesFulfilled = function runCaller() { - if (!calledRun) - run(); - if (!calledRun) - dependenciesFulfilled = runCaller; - }; - function run(args) { - if (runDependencies > 0) { - return; - } - preRun(); - if (runDependencies > 0) { - return; - } - function doRun() { - if (calledRun) - return; - calledRun = true; - Module["calledRun"] = true; - if (ABORT) - return; - initRuntime(); - readyPromiseResolve(Module); - if (Module["onRuntimeInitialized"]) - Module["onRuntimeInitialized"](); - postRun(); - } - if (Module["setStatus"]) { - Module["setStatus"]("Running..."); - setTimeout(function() { - setTimeout(function() { - Module["setStatus"](""); - }, 1); - doRun(); - }, 1); - } else { - doRun(); - } - } - Module["run"] = run; - if (Module["preInit"]) { - if (typeof Module["preInit"] == "function") - Module["preInit"] = [Module["preInit"]]; - while (Module["preInit"].length > 0) { - Module["preInit"].pop()(); - } - } - run(); - return createModule2; - }; -}(); -module.exports = createModule; -}(libzipSync)); - -const createModule = libzipSync.exports; - -const number64 = [ - `number`, - `number` -]; -var Errors = /* @__PURE__ */ ((Errors2) => { - Errors2[Errors2["ZIP_ER_OK"] = 0] = "ZIP_ER_OK"; - Errors2[Errors2["ZIP_ER_MULTIDISK"] = 1] = "ZIP_ER_MULTIDISK"; - Errors2[Errors2["ZIP_ER_RENAME"] = 2] = "ZIP_ER_RENAME"; - Errors2[Errors2["ZIP_ER_CLOSE"] = 3] = "ZIP_ER_CLOSE"; - Errors2[Errors2["ZIP_ER_SEEK"] = 4] = "ZIP_ER_SEEK"; - Errors2[Errors2["ZIP_ER_READ"] = 5] = "ZIP_ER_READ"; - Errors2[Errors2["ZIP_ER_WRITE"] = 6] = "ZIP_ER_WRITE"; - Errors2[Errors2["ZIP_ER_CRC"] = 7] = "ZIP_ER_CRC"; - Errors2[Errors2["ZIP_ER_ZIPCLOSED"] = 8] = "ZIP_ER_ZIPCLOSED"; - Errors2[Errors2["ZIP_ER_NOENT"] = 9] = "ZIP_ER_NOENT"; - Errors2[Errors2["ZIP_ER_EXISTS"] = 10] = "ZIP_ER_EXISTS"; - Errors2[Errors2["ZIP_ER_OPEN"] = 11] = "ZIP_ER_OPEN"; - Errors2[Errors2["ZIP_ER_TMPOPEN"] = 12] = "ZIP_ER_TMPOPEN"; - Errors2[Errors2["ZIP_ER_ZLIB"] = 13] = "ZIP_ER_ZLIB"; - Errors2[Errors2["ZIP_ER_MEMORY"] = 14] = "ZIP_ER_MEMORY"; - Errors2[Errors2["ZIP_ER_CHANGED"] = 15] = "ZIP_ER_CHANGED"; - Errors2[Errors2["ZIP_ER_COMPNOTSUPP"] = 16] = "ZIP_ER_COMPNOTSUPP"; - Errors2[Errors2["ZIP_ER_EOF"] = 17] = "ZIP_ER_EOF"; - Errors2[Errors2["ZIP_ER_INVAL"] = 18] = "ZIP_ER_INVAL"; - Errors2[Errors2["ZIP_ER_NOZIP"] = 19] = "ZIP_ER_NOZIP"; - Errors2[Errors2["ZIP_ER_INTERNAL"] = 20] = "ZIP_ER_INTERNAL"; - Errors2[Errors2["ZIP_ER_INCONS"] = 21] = "ZIP_ER_INCONS"; - Errors2[Errors2["ZIP_ER_REMOVE"] = 22] = "ZIP_ER_REMOVE"; - Errors2[Errors2["ZIP_ER_DELETED"] = 23] = "ZIP_ER_DELETED"; - Errors2[Errors2["ZIP_ER_ENCRNOTSUPP"] = 24] = "ZIP_ER_ENCRNOTSUPP"; - Errors2[Errors2["ZIP_ER_RDONLY"] = 25] = "ZIP_ER_RDONLY"; - Errors2[Errors2["ZIP_ER_NOPASSWD"] = 26] = "ZIP_ER_NOPASSWD"; - Errors2[Errors2["ZIP_ER_WRONGPASSWD"] = 27] = "ZIP_ER_WRONGPASSWD"; - Errors2[Errors2["ZIP_ER_OPNOTSUPP"] = 28] = "ZIP_ER_OPNOTSUPP"; - Errors2[Errors2["ZIP_ER_INUSE"] = 29] = "ZIP_ER_INUSE"; - Errors2[Errors2["ZIP_ER_TELL"] = 30] = "ZIP_ER_TELL"; - Errors2[Errors2["ZIP_ER_COMPRESSED_DATA"] = 31] = "ZIP_ER_COMPRESSED_DATA"; - return Errors2; -})(Errors || {}); -const makeInterface = (emZip) => ({ - get HEAPU8() { - return emZip.HEAPU8; - }, - errors: Errors, - SEEK_SET: 0, - SEEK_CUR: 1, - SEEK_END: 2, - ZIP_CHECKCONS: 4, - ZIP_EXCL: 2, - ZIP_RDONLY: 16, - ZIP_FL_OVERWRITE: 8192, - ZIP_FL_COMPRESSED: 4, - ZIP_OPSYS_DOS: 0, - ZIP_OPSYS_AMIGA: 1, - ZIP_OPSYS_OPENVMS: 2, - ZIP_OPSYS_UNIX: 3, - ZIP_OPSYS_VM_CMS: 4, - ZIP_OPSYS_ATARI_ST: 5, - ZIP_OPSYS_OS_2: 6, - ZIP_OPSYS_MACINTOSH: 7, - ZIP_OPSYS_Z_SYSTEM: 8, - ZIP_OPSYS_CPM: 9, - ZIP_OPSYS_WINDOWS_NTFS: 10, - ZIP_OPSYS_MVS: 11, - ZIP_OPSYS_VSE: 12, - ZIP_OPSYS_ACORN_RISC: 13, - ZIP_OPSYS_VFAT: 14, - ZIP_OPSYS_ALTERNATE_MVS: 15, - ZIP_OPSYS_BEOS: 16, - ZIP_OPSYS_TANDEM: 17, - ZIP_OPSYS_OS_400: 18, - ZIP_OPSYS_OS_X: 19, - ZIP_CM_DEFAULT: -1, - ZIP_CM_STORE: 0, - ZIP_CM_DEFLATE: 8, - uint08S: emZip._malloc(1), - uint32S: emZip._malloc(4), - malloc: emZip._malloc, - free: emZip._free, - getValue: emZip.getValue, - openFromSource: emZip.cwrap(`zip_open_from_source`, `number`, [`number`, `number`, `number`]), - close: emZip.cwrap(`zip_close`, `number`, [`number`]), - discard: emZip.cwrap(`zip_discard`, null, [`number`]), - getError: emZip.cwrap(`zip_get_error`, `number`, [`number`]), - getName: emZip.cwrap(`zip_get_name`, `string`, [`number`, `number`, `number`]), - getNumEntries: emZip.cwrap(`zip_get_num_entries`, `number`, [`number`, `number`]), - delete: emZip.cwrap(`zip_delete`, `number`, [`number`, `number`]), - statIndex: emZip.cwrap(`zip_stat_index`, `number`, [`number`, ...number64, `number`, `number`]), - fopenIndex: emZip.cwrap(`zip_fopen_index`, `number`, [`number`, ...number64, `number`]), - fread: emZip.cwrap(`zip_fread`, `number`, [`number`, `number`, `number`, `number`]), - fclose: emZip.cwrap(`zip_fclose`, `number`, [`number`]), - dir: { - add: emZip.cwrap(`zip_dir_add`, `number`, [`number`, `string`]) - }, - file: { - add: emZip.cwrap(`zip_file_add`, `number`, [`number`, `string`, `number`, `number`]), - getError: emZip.cwrap(`zip_file_get_error`, `number`, [`number`]), - getExternalAttributes: emZip.cwrap(`zip_file_get_external_attributes`, `number`, [`number`, ...number64, `number`, `number`, `number`]), - setExternalAttributes: emZip.cwrap(`zip_file_set_external_attributes`, `number`, [`number`, ...number64, `number`, `number`, `number`]), - setMtime: emZip.cwrap(`zip_file_set_mtime`, `number`, [`number`, ...number64, `number`, `number`]), - setCompression: emZip.cwrap(`zip_set_file_compression`, `number`, [`number`, ...number64, `number`, `number`]) - }, - ext: { - countSymlinks: emZip.cwrap(`zip_ext_count_symlinks`, `number`, [`number`]) - }, - error: { - initWithCode: emZip.cwrap(`zip_error_init_with_code`, null, [`number`, `number`]), - strerror: emZip.cwrap(`zip_error_strerror`, `string`, [`number`]) - }, - name: { - locate: emZip.cwrap(`zip_name_locate`, `number`, [`number`, `string`, `number`]) - }, - source: { - fromUnattachedBuffer: emZip.cwrap(`zip_source_buffer_create`, `number`, [`number`, ...number64, `number`, `number`]), - fromBuffer: emZip.cwrap(`zip_source_buffer`, `number`, [`number`, `number`, ...number64, `number`]), - free: emZip.cwrap(`zip_source_free`, null, [`number`]), - keep: emZip.cwrap(`zip_source_keep`, null, [`number`]), - open: emZip.cwrap(`zip_source_open`, `number`, [`number`]), - close: emZip.cwrap(`zip_source_close`, `number`, [`number`]), - seek: emZip.cwrap(`zip_source_seek`, `number`, [`number`, ...number64, `number`]), - tell: emZip.cwrap(`zip_source_tell`, `number`, [`number`]), - read: emZip.cwrap(`zip_source_read`, `number`, [`number`, `number`, `number`]), - error: emZip.cwrap(`zip_source_error`, `number`, [`number`]) - }, - struct: { - statS: emZip.cwrap(`zipstruct_statS`, `number`, []), - statSize: emZip.cwrap(`zipstruct_stat_size`, `number`, [`number`]), - statCompSize: emZip.cwrap(`zipstruct_stat_comp_size`, `number`, [`number`]), - statCompMethod: emZip.cwrap(`zipstruct_stat_comp_method`, `number`, [`number`]), - statMtime: emZip.cwrap(`zipstruct_stat_mtime`, `number`, [`number`]), - statCrc: emZip.cwrap(`zipstruct_stat_crc`, `number`, [`number`]), - errorS: emZip.cwrap(`zipstruct_errorS`, `number`, []), - errorCodeZip: emZip.cwrap(`zipstruct_error_code_zip`, `number`, [`number`]) - } -}); - -function getArchivePart(path, extension) { - let idx = path.indexOf(extension); - if (idx <= 0) - return null; - let nextCharIdx = idx; - while (idx >= 0) { - nextCharIdx = idx + extension.length; - if (path[nextCharIdx] === ppath.sep) - break; - if (path[idx - 1] === ppath.sep) - return null; - idx = path.indexOf(extension, nextCharIdx); - } - if (path.length > nextCharIdx && path[nextCharIdx] !== ppath.sep) - return null; - return path.slice(0, nextCharIdx); -} -class ZipOpenFS extends MountFS { - static async openPromise(fn, opts) { - const zipOpenFs = new ZipOpenFS(opts); - try { - return await fn(zipOpenFs); - } finally { - zipOpenFs.saveAndClose(); - } - } - constructor(opts = {}) { - const fileExtensions = opts.fileExtensions; - const readOnlyArchives = opts.readOnlyArchives; - const getMountPoint = typeof fileExtensions === `undefined` ? (path) => getArchivePart(path, `.zip`) : (path) => { - for (const extension of fileExtensions) { - const result = getArchivePart(path, extension); - if (result) { - return result; - } - } - return null; - }; - const factorySync = (baseFs, p) => { - return new ZipFS(p, { - baseFs, - readOnly: readOnlyArchives, - stats: baseFs.statSync(p) - }); - }; - const factoryPromise = async (baseFs, p) => { - const zipOptions = { - baseFs, - readOnly: readOnlyArchives, - stats: await baseFs.statPromise(p) - }; - return () => { - return new ZipFS(p, zipOptions); - }; - }; - super({ - ...opts, - factorySync, - factoryPromise, - getMountPoint - }); - } -} - -const DEFAULT_COMPRESSION_LEVEL = `mixed`; -function toUnixTimestamp(time) { - if (typeof time === `string` && String(+time) === time) - return +time; - if (typeof time === `number` && Number.isFinite(time)) { - if (time < 0) { - return Date.now() / 1e3; - } else { - return time; - } - } - if (nodeUtils.types.isDate(time)) - return time.getTime() / 1e3; - throw new Error(`Invalid time`); -} -function makeEmptyArchive() { - return Buffer.from([ - 80, - 75, - 5, - 6, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0 - ]); -} -class LibzipError extends Error { - constructor(message, code) { - super(message); - this.name = `Libzip Error`; - this.code = code; - } -} -class ZipFS extends BasePortableFakeFS { - constructor(source, opts = {}) { - super(); - this.listings = /* @__PURE__ */ new Map(); - this.entries = /* @__PURE__ */ new Map(); - this.fileSources = /* @__PURE__ */ new Map(); - this.fds = /* @__PURE__ */ new Map(); - this.nextFd = 0; - this.ready = false; - this.readOnly = false; - const pathOptions = opts; - this.level = typeof pathOptions.level !== `undefined` ? pathOptions.level : DEFAULT_COMPRESSION_LEVEL; - source ??= makeEmptyArchive(); - if (typeof source === `string`) { - const { baseFs = new NodeFS() } = pathOptions; - this.baseFs = baseFs; - this.path = source; - } else { - this.path = null; - this.baseFs = null; - } - if (opts.stats) { - this.stats = opts.stats; - } else { - if (typeof source === `string`) { - try { - this.stats = this.baseFs.statSync(source); - } catch (error) { - if (error.code === `ENOENT` && pathOptions.create) { - this.stats = makeDefaultStats(); - } else { - throw error; - } - } - } else { - this.stats = makeDefaultStats(); - } - } - this.libzip = getInstance(); - const errPtr = this.libzip.malloc(4); - try { - let flags = 0; - if (opts.readOnly) { - flags |= this.libzip.ZIP_RDONLY; - this.readOnly = true; - } - if (typeof source === `string`) - source = pathOptions.create ? makeEmptyArchive() : this.baseFs.readFileSync(source); - const lzSource = this.allocateUnattachedSource(source); - try { - this.zip = this.libzip.openFromSource(lzSource, flags, errPtr); - this.lzSource = lzSource; - } catch (error) { - this.libzip.source.free(lzSource); - throw error; - } - if (this.zip === 0) { - const error = this.libzip.struct.errorS(); - this.libzip.error.initWithCode(error, this.libzip.getValue(errPtr, `i32`)); - throw this.makeLibzipError(error); - } - } finally { - this.libzip.free(errPtr); - } - this.listings.set(PortablePath.root, /* @__PURE__ */ new Set()); - const entryCount = this.libzip.getNumEntries(this.zip, 0); - for (let t = 0; t < entryCount; ++t) { - const raw = this.libzip.getName(this.zip, t, 0); - if (ppath.isAbsolute(raw)) - continue; - const p = ppath.resolve(PortablePath.root, raw); - this.registerEntry(p, t); - if (raw.endsWith(`/`)) { - this.registerListing(p); - } - } - this.symlinkCount = this.libzip.ext.countSymlinks(this.zip); - if (this.symlinkCount === -1) - throw this.makeLibzipError(this.libzip.getError(this.zip)); - this.ready = true; - } - makeLibzipError(error) { - const errorCode = this.libzip.struct.errorCodeZip(error); - const strerror = this.libzip.error.strerror(error); - const libzipError = new LibzipError(strerror, this.libzip.errors[errorCode]); - if (errorCode === this.libzip.errors.ZIP_ER_CHANGED) - throw new Error(`Assertion failed: Unexpected libzip error: ${libzipError.message}`); - return libzipError; - } - getExtractHint(hints) { - for (const fileName of this.entries.keys()) { - const ext = this.pathUtils.extname(fileName); - if (hints.relevantExtensions.has(ext)) { - return true; - } - } - return false; - } - getAllFiles() { - return Array.from(this.entries.keys()); - } - getRealPath() { - if (!this.path) - throw new Error(`ZipFS don't have real paths when loaded from a buffer`); - return this.path; - } - prepareClose() { - if (!this.ready) - throw EBUSY(`archive closed, close`); - unwatchAllFiles(this); - } - getBufferAndClose() { - this.prepareClose(); - if (this.entries.size === 0) { - this.discardAndClose(); - return makeEmptyArchive(); - } - try { - this.libzip.source.keep(this.lzSource); - if (this.libzip.close(this.zip) === -1) - throw this.makeLibzipError(this.libzip.getError(this.zip)); - if (this.libzip.source.open(this.lzSource) === -1) - throw this.makeLibzipError(this.libzip.source.error(this.lzSource)); - if (this.libzip.source.seek(this.lzSource, 0, 0, this.libzip.SEEK_END) === -1) - throw this.makeLibzipError(this.libzip.source.error(this.lzSource)); - const size = this.libzip.source.tell(this.lzSource); - if (size === -1) - throw this.makeLibzipError(this.libzip.source.error(this.lzSource)); - if (this.libzip.source.seek(this.lzSource, 0, 0, this.libzip.SEEK_SET) === -1) - throw this.makeLibzipError(this.libzip.source.error(this.lzSource)); - const buffer = this.libzip.malloc(size); - if (!buffer) - throw new Error(`Couldn't allocate enough memory`); - try { - const rc = this.libzip.source.read(this.lzSource, buffer, size); - if (rc === -1) - throw this.makeLibzipError(this.libzip.source.error(this.lzSource)); - else if (rc < size) - throw new Error(`Incomplete read`); - else if (rc > size) - throw new Error(`Overread`); - let result = Buffer.from(this.libzip.HEAPU8.subarray(buffer, buffer + size)); - if (process.env.YARN_IS_TEST_ENV && process.env.YARN_ZIP_DATA_EPILOGUE) - result = Buffer.concat([result, Buffer.from(process.env.YARN_ZIP_DATA_EPILOGUE)]); - return result; - } finally { - this.libzip.free(buffer); - } - } finally { - this.libzip.source.close(this.lzSource); - this.libzip.source.free(this.lzSource); - this.ready = false; - } - } - discardAndClose() { - this.prepareClose(); - this.libzip.discard(this.zip); - this.ready = false; - } - saveAndClose() { - if (!this.path || !this.baseFs) - throw new Error(`ZipFS cannot be saved and must be discarded when loaded from a buffer`); - if (this.readOnly) { - this.discardAndClose(); - return; - } - const newMode = this.baseFs.existsSync(this.path) || this.stats.mode === DEFAULT_MODE ? void 0 : this.stats.mode; - this.baseFs.writeFileSync(this.path, this.getBufferAndClose(), { mode: newMode }); - this.ready = false; - } - resolve(p) { - return ppath.resolve(PortablePath.root, p); - } - async openPromise(p, flags, mode) { - return this.openSync(p, flags, mode); - } - openSync(p, flags, mode) { - const fd = this.nextFd++; - this.fds.set(fd, { cursor: 0, p }); - return fd; - } - hasOpenFileHandles() { - return !!this.fds.size; - } - async opendirPromise(p, opts) { - return this.opendirSync(p, opts); - } - opendirSync(p, opts = {}) { - const resolvedP = this.resolveFilename(`opendir '${p}'`, p); - if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) - throw ENOENT(`opendir '${p}'`); - const directoryListing = this.listings.get(resolvedP); - if (!directoryListing) - throw ENOTDIR(`opendir '${p}'`); - const entries = [...directoryListing]; - const fd = this.openSync(resolvedP, `r`); - const onClose = () => { - this.closeSync(fd); - }; - return opendir(this, resolvedP, entries, { onClose }); - } - async readPromise(fd, buffer, offset, length, position) { - return this.readSync(fd, buffer, offset, length, position); - } - readSync(fd, buffer, offset = 0, length = buffer.byteLength, position = -1) { - const entry = this.fds.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`read`); - const realPosition = position === -1 || position === null ? entry.cursor : position; - const source = this.readFileSync(entry.p); - source.copy(buffer, offset, realPosition, realPosition + length); - const bytesRead = Math.max(0, Math.min(source.length - realPosition, length)); - if (position === -1 || position === null) - entry.cursor += bytesRead; - return bytesRead; - } - async writePromise(fd, buffer, offset, length, position) { - if (typeof buffer === `string`) { - return this.writeSync(fd, buffer, position); - } else { - return this.writeSync(fd, buffer, offset, length, position); - } - } - writeSync(fd, buffer, offset, length, position) { - const entry = this.fds.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`read`); - throw new Error(`Unimplemented`); - } - async closePromise(fd) { - return this.closeSync(fd); - } - closeSync(fd) { - const entry = this.fds.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`read`); - this.fds.delete(fd); - } - createReadStream(p, { encoding } = {}) { - if (p === null) - throw new Error(`Unimplemented`); - const fd = this.openSync(p, `r`); - const stream$1 = Object.assign( - new stream.PassThrough({ - emitClose: true, - autoDestroy: true, - destroy: (error, callback) => { - clearImmediate(immediate); - this.closeSync(fd); - callback(error); - } - }), - { - close() { - stream$1.destroy(); - }, - bytesRead: 0, - path: p, - pending: false - } - ); - const immediate = setImmediate(async () => { - try { - const data = await this.readFilePromise(p, encoding); - stream$1.bytesRead = data.length; - stream$1.end(data); - } catch (error) { - stream$1.destroy(error); - } - }); - return stream$1; - } - createWriteStream(p, { encoding } = {}) { - if (this.readOnly) - throw EROFS(`open '${p}'`); - if (p === null) - throw new Error(`Unimplemented`); - const chunks = []; - const fd = this.openSync(p, `w`); - const stream$1 = Object.assign( - new stream.PassThrough({ - autoDestroy: true, - emitClose: true, - destroy: (error, callback) => { - try { - if (error) { - callback(error); - } else { - this.writeFileSync(p, Buffer.concat(chunks), encoding); - callback(null); - } - } catch (err) { - callback(err); - } finally { - this.closeSync(fd); - } - } - }), - { - close() { - stream$1.destroy(); - }, - bytesWritten: 0, - path: p, - pending: false - } - ); - stream$1.on(`data`, (chunk) => { - const chunkBuffer = Buffer.from(chunk); - stream$1.bytesWritten += chunkBuffer.length; - chunks.push(chunkBuffer); - }); - return stream$1; - } - async realpathPromise(p) { - return this.realpathSync(p); - } - realpathSync(p) { - const resolvedP = this.resolveFilename(`lstat '${p}'`, p); - if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) - throw ENOENT(`lstat '${p}'`); - return resolvedP; - } - async existsPromise(p) { - return this.existsSync(p); - } - existsSync(p) { - if (!this.ready) - throw EBUSY(`archive closed, existsSync '${p}'`); - if (this.symlinkCount === 0) { - const resolvedP2 = ppath.resolve(PortablePath.root, p); - return this.entries.has(resolvedP2) || this.listings.has(resolvedP2); - } - let resolvedP; - try { - resolvedP = this.resolveFilename(`stat '${p}'`, p, void 0, false); - } catch (error) { - return false; - } - if (resolvedP === void 0) - return false; - return this.entries.has(resolvedP) || this.listings.has(resolvedP); - } - async accessPromise(p, mode) { - return this.accessSync(p, mode); - } - accessSync(p, mode = fs.constants.F_OK) { - const resolvedP = this.resolveFilename(`access '${p}'`, p); - if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) - throw ENOENT(`access '${p}'`); - if (this.readOnly && mode & fs.constants.W_OK) { - throw EROFS(`access '${p}'`); - } - } - async statPromise(p, opts = { bigint: false }) { - if (opts.bigint) - return this.statSync(p, { bigint: true }); - return this.statSync(p); - } - statSync(p, opts = { bigint: false, throwIfNoEntry: true }) { - const resolvedP = this.resolveFilename(`stat '${p}'`, p, void 0, opts.throwIfNoEntry); - if (resolvedP === void 0) - return void 0; - if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) { - if (opts.throwIfNoEntry === false) - return void 0; - throw ENOENT(`stat '${p}'`); - } - if (p[p.length - 1] === `/` && !this.listings.has(resolvedP)) - throw ENOTDIR(`stat '${p}'`); - return this.statImpl(`stat '${p}'`, resolvedP, opts); - } - async fstatPromise(fd, opts) { - return this.fstatSync(fd, opts); - } - fstatSync(fd, opts) { - const entry = this.fds.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`fstatSync`); - const { p } = entry; - const resolvedP = this.resolveFilename(`stat '${p}'`, p); - if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) - throw ENOENT(`stat '${p}'`); - if (p[p.length - 1] === `/` && !this.listings.has(resolvedP)) - throw ENOTDIR(`stat '${p}'`); - return this.statImpl(`fstat '${p}'`, resolvedP, opts); - } - async lstatPromise(p, opts = { bigint: false }) { - if (opts.bigint) - return this.lstatSync(p, { bigint: true }); - return this.lstatSync(p); - } - lstatSync(p, opts = { bigint: false, throwIfNoEntry: true }) { - const resolvedP = this.resolveFilename(`lstat '${p}'`, p, false, opts.throwIfNoEntry); - if (resolvedP === void 0) - return void 0; - if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) { - if (opts.throwIfNoEntry === false) - return void 0; - throw ENOENT(`lstat '${p}'`); - } - if (p[p.length - 1] === `/` && !this.listings.has(resolvedP)) - throw ENOTDIR(`lstat '${p}'`); - return this.statImpl(`lstat '${p}'`, resolvedP, opts); - } - statImpl(reason, p, opts = {}) { - const entry = this.entries.get(p); - if (typeof entry !== `undefined`) { - const stat = this.libzip.struct.statS(); - const rc = this.libzip.statIndex(this.zip, entry, 0, 0, stat); - if (rc === -1) - throw this.makeLibzipError(this.libzip.getError(this.zip)); - const uid = this.stats.uid; - const gid = this.stats.gid; - const size = this.libzip.struct.statSize(stat) >>> 0; - const blksize = 512; - const blocks = Math.ceil(size / blksize); - const mtimeMs = (this.libzip.struct.statMtime(stat) >>> 0) * 1e3; - const atimeMs = mtimeMs; - const birthtimeMs = mtimeMs; - const ctimeMs = mtimeMs; - const atime = new Date(atimeMs); - const birthtime = new Date(birthtimeMs); - const ctime = new Date(ctimeMs); - const mtime = new Date(mtimeMs); - const type = this.listings.has(p) ? fs.constants.S_IFDIR : this.isSymbolicLink(entry) ? fs.constants.S_IFLNK : fs.constants.S_IFREG; - const defaultMode = type === fs.constants.S_IFDIR ? 493 : 420; - const mode = type | this.getUnixMode(entry, defaultMode) & 511; - const crc = this.libzip.struct.statCrc(stat); - const statInstance = Object.assign(new StatEntry(), { uid, gid, size, blksize, blocks, atime, birthtime, ctime, mtime, atimeMs, birthtimeMs, ctimeMs, mtimeMs, mode, crc }); - return opts.bigint === true ? convertToBigIntStats(statInstance) : statInstance; - } - if (this.listings.has(p)) { - const uid = this.stats.uid; - const gid = this.stats.gid; - const size = 0; - const blksize = 512; - const blocks = 0; - const atimeMs = this.stats.mtimeMs; - const birthtimeMs = this.stats.mtimeMs; - const ctimeMs = this.stats.mtimeMs; - const mtimeMs = this.stats.mtimeMs; - const atime = new Date(atimeMs); - const birthtime = new Date(birthtimeMs); - const ctime = new Date(ctimeMs); - const mtime = new Date(mtimeMs); - const mode = fs.constants.S_IFDIR | 493; - const crc = 0; - const statInstance = Object.assign(new StatEntry(), { uid, gid, size, blksize, blocks, atime, birthtime, ctime, mtime, atimeMs, birthtimeMs, ctimeMs, mtimeMs, mode, crc }); - return opts.bigint === true ? convertToBigIntStats(statInstance) : statInstance; - } - throw new Error(`Unreachable`); - } - getUnixMode(index, defaultMode) { - const rc = this.libzip.file.getExternalAttributes(this.zip, index, 0, 0, this.libzip.uint08S, this.libzip.uint32S); - if (rc === -1) - throw this.makeLibzipError(this.libzip.getError(this.zip)); - const opsys = this.libzip.getValue(this.libzip.uint08S, `i8`) >>> 0; - if (opsys !== this.libzip.ZIP_OPSYS_UNIX) - return defaultMode; - return this.libzip.getValue(this.libzip.uint32S, `i32`) >>> 16; - } - registerListing(p) { - const existingListing = this.listings.get(p); - if (existingListing) - return existingListing; - const parentListing = this.registerListing(ppath.dirname(p)); - parentListing.add(ppath.basename(p)); - const newListing = /* @__PURE__ */ new Set(); - this.listings.set(p, newListing); - return newListing; - } - registerEntry(p, index) { - const parentListing = this.registerListing(ppath.dirname(p)); - parentListing.add(ppath.basename(p)); - this.entries.set(p, index); - } - unregisterListing(p) { - this.listings.delete(p); - const parentListing = this.listings.get(ppath.dirname(p)); - parentListing?.delete(ppath.basename(p)); - } - unregisterEntry(p) { - this.unregisterListing(p); - const entry = this.entries.get(p); - this.entries.delete(p); - if (typeof entry === `undefined`) - return; - this.fileSources.delete(entry); - if (this.isSymbolicLink(entry)) { - this.symlinkCount--; - } - } - deleteEntry(p, index) { - this.unregisterEntry(p); - const rc = this.libzip.delete(this.zip, index); - if (rc === -1) { - throw this.makeLibzipError(this.libzip.getError(this.zip)); - } - } - resolveFilename(reason, p, resolveLastComponent = true, throwIfNoEntry = true) { - if (!this.ready) - throw EBUSY(`archive closed, ${reason}`); - let resolvedP = ppath.resolve(PortablePath.root, p); - if (resolvedP === `/`) - return PortablePath.root; - const fileIndex = this.entries.get(resolvedP); - if (resolveLastComponent && fileIndex !== void 0) { - if (this.symlinkCount !== 0 && this.isSymbolicLink(fileIndex)) { - const target = this.getFileSource(fileIndex).toString(); - return this.resolveFilename(reason, ppath.resolve(ppath.dirname(resolvedP), target), true, throwIfNoEntry); - } else { - return resolvedP; - } - } - while (true) { - const parentP = this.resolveFilename(reason, ppath.dirname(resolvedP), true, throwIfNoEntry); - if (parentP === void 0) - return parentP; - const isDir = this.listings.has(parentP); - const doesExist = this.entries.has(parentP); - if (!isDir && !doesExist) { - if (throwIfNoEntry === false) - return void 0; - throw ENOENT(reason); - } - if (!isDir) - throw ENOTDIR(reason); - resolvedP = ppath.resolve(parentP, ppath.basename(resolvedP)); - if (!resolveLastComponent || this.symlinkCount === 0) - break; - const index = this.libzip.name.locate(this.zip, resolvedP.slice(1), 0); - if (index === -1) - break; - if (this.isSymbolicLink(index)) { - const target = this.getFileSource(index).toString(); - resolvedP = ppath.resolve(ppath.dirname(resolvedP), target); - } else { - break; - } - } - return resolvedP; - } - allocateBuffer(content) { - if (!Buffer.isBuffer(content)) - content = Buffer.from(content); - const buffer = this.libzip.malloc(content.byteLength); - if (!buffer) - throw new Error(`Couldn't allocate enough memory`); - const heap = new Uint8Array(this.libzip.HEAPU8.buffer, buffer, content.byteLength); - heap.set(content); - return { buffer, byteLength: content.byteLength }; - } - allocateUnattachedSource(content) { - const error = this.libzip.struct.errorS(); - const { buffer, byteLength } = this.allocateBuffer(content); - const source = this.libzip.source.fromUnattachedBuffer(buffer, byteLength, 0, 1, error); - if (source === 0) { - this.libzip.free(error); - throw this.makeLibzipError(error); - } - return source; - } - allocateSource(content) { - const { buffer, byteLength } = this.allocateBuffer(content); - const source = this.libzip.source.fromBuffer(this.zip, buffer, byteLength, 0, 1); - if (source === 0) { - this.libzip.free(buffer); - throw this.makeLibzipError(this.libzip.getError(this.zip)); - } - return source; - } - setFileSource(p, content) { - const buffer = Buffer.isBuffer(content) ? content : Buffer.from(content); - const target = ppath.relative(PortablePath.root, p); - const lzSource = this.allocateSource(content); - try { - const newIndex = this.libzip.file.add(this.zip, target, lzSource, this.libzip.ZIP_FL_OVERWRITE); - if (newIndex === -1) - throw this.makeLibzipError(this.libzip.getError(this.zip)); - if (this.level !== `mixed`) { - const method = this.level === 0 ? this.libzip.ZIP_CM_STORE : this.libzip.ZIP_CM_DEFLATE; - const rc = this.libzip.file.setCompression(this.zip, newIndex, 0, method, this.level); - if (rc === -1) { - throw this.makeLibzipError(this.libzip.getError(this.zip)); - } - } - this.fileSources.set(newIndex, buffer); - return newIndex; - } catch (error) { - this.libzip.source.free(lzSource); - throw error; - } - } - isSymbolicLink(index) { - if (this.symlinkCount === 0) - return false; - const attrs = this.libzip.file.getExternalAttributes(this.zip, index, 0, 0, this.libzip.uint08S, this.libzip.uint32S); - if (attrs === -1) - throw this.makeLibzipError(this.libzip.getError(this.zip)); - const opsys = this.libzip.getValue(this.libzip.uint08S, `i8`) >>> 0; - if (opsys !== this.libzip.ZIP_OPSYS_UNIX) - return false; - const attributes = this.libzip.getValue(this.libzip.uint32S, `i32`) >>> 16; - return (attributes & fs.constants.S_IFMT) === fs.constants.S_IFLNK; - } - getFileSource(index, opts = { asyncDecompress: false }) { - const cachedFileSource = this.fileSources.get(index); - if (typeof cachedFileSource !== `undefined`) - return cachedFileSource; - const stat = this.libzip.struct.statS(); - const rc = this.libzip.statIndex(this.zip, index, 0, 0, stat); - if (rc === -1) - throw this.makeLibzipError(this.libzip.getError(this.zip)); - const size = this.libzip.struct.statCompSize(stat); - const compressionMethod = this.libzip.struct.statCompMethod(stat); - const buffer = this.libzip.malloc(size); - try { - const file = this.libzip.fopenIndex(this.zip, index, 0, this.libzip.ZIP_FL_COMPRESSED); - if (file === 0) - throw this.makeLibzipError(this.libzip.getError(this.zip)); - try { - const rc2 = this.libzip.fread(file, buffer, size, 0); - if (rc2 === -1) - throw this.makeLibzipError(this.libzip.file.getError(file)); - else if (rc2 < size) - throw new Error(`Incomplete read`); - else if (rc2 > size) - throw new Error(`Overread`); - const memory = this.libzip.HEAPU8.subarray(buffer, buffer + size); - const data = Buffer.from(memory); - if (compressionMethod === 0) { - this.fileSources.set(index, data); - return data; - } else if (opts.asyncDecompress) { - return new Promise((resolve, reject) => { - zlib__default.default.inflateRaw(data, (error, result) => { - if (error) { - reject(error); - } else { - this.fileSources.set(index, result); - resolve(result); - } - }); - }); - } else { - const decompressedData = zlib__default.default.inflateRawSync(data); - this.fileSources.set(index, decompressedData); - return decompressedData; - } - } finally { - this.libzip.fclose(file); - } - } finally { - this.libzip.free(buffer); - } - } - async fchmodPromise(fd, mask) { - return this.chmodPromise(this.fdToPath(fd, `fchmod`), mask); - } - fchmodSync(fd, mask) { - return this.chmodSync(this.fdToPath(fd, `fchmodSync`), mask); - } - async chmodPromise(p, mask) { - return this.chmodSync(p, mask); - } - chmodSync(p, mask) { - if (this.readOnly) - throw EROFS(`chmod '${p}'`); - mask &= 493; - const resolvedP = this.resolveFilename(`chmod '${p}'`, p, false); - const entry = this.entries.get(resolvedP); - if (typeof entry === `undefined`) - throw new Error(`Assertion failed: The entry should have been registered (${resolvedP})`); - const oldMod = this.getUnixMode(entry, fs.constants.S_IFREG | 0); - const newMod = oldMod & ~511 | mask; - const rc = this.libzip.file.setExternalAttributes(this.zip, entry, 0, 0, this.libzip.ZIP_OPSYS_UNIX, newMod << 16); - if (rc === -1) { - throw this.makeLibzipError(this.libzip.getError(this.zip)); - } - } - async fchownPromise(fd, uid, gid) { - return this.chownPromise(this.fdToPath(fd, `fchown`), uid, gid); - } - fchownSync(fd, uid, gid) { - return this.chownSync(this.fdToPath(fd, `fchownSync`), uid, gid); - } - async chownPromise(p, uid, gid) { - return this.chownSync(p, uid, gid); - } - chownSync(p, uid, gid) { - throw new Error(`Unimplemented`); - } - async renamePromise(oldP, newP) { - return this.renameSync(oldP, newP); - } - renameSync(oldP, newP) { - throw new Error(`Unimplemented`); - } - async copyFilePromise(sourceP, destP, flags) { - const { indexSource, indexDest, resolvedDestP } = this.prepareCopyFile(sourceP, destP, flags); - const source = await this.getFileSource(indexSource, { asyncDecompress: true }); - const newIndex = this.setFileSource(resolvedDestP, source); - if (newIndex !== indexDest) { - this.registerEntry(resolvedDestP, newIndex); - } - } - copyFileSync(sourceP, destP, flags = 0) { - const { indexSource, indexDest, resolvedDestP } = this.prepareCopyFile(sourceP, destP, flags); - const source = this.getFileSource(indexSource); - const newIndex = this.setFileSource(resolvedDestP, source); - if (newIndex !== indexDest) { - this.registerEntry(resolvedDestP, newIndex); - } - } - prepareCopyFile(sourceP, destP, flags = 0) { - if (this.readOnly) - throw EROFS(`copyfile '${sourceP} -> '${destP}'`); - if ((flags & fs.constants.COPYFILE_FICLONE_FORCE) !== 0) - throw ENOSYS(`unsupported clone operation`, `copyfile '${sourceP}' -> ${destP}'`); - const resolvedSourceP = this.resolveFilename(`copyfile '${sourceP} -> ${destP}'`, sourceP); - const indexSource = this.entries.get(resolvedSourceP); - if (typeof indexSource === `undefined`) - throw EINVAL(`copyfile '${sourceP}' -> '${destP}'`); - const resolvedDestP = this.resolveFilename(`copyfile '${sourceP}' -> ${destP}'`, destP); - const indexDest = this.entries.get(resolvedDestP); - if ((flags & (fs.constants.COPYFILE_EXCL | fs.constants.COPYFILE_FICLONE_FORCE)) !== 0 && typeof indexDest !== `undefined`) - throw EEXIST(`copyfile '${sourceP}' -> '${destP}'`); - return { - indexSource, - resolvedDestP, - indexDest - }; - } - async appendFilePromise(p, content, opts) { - if (this.readOnly) - throw EROFS(`open '${p}'`); - if (typeof opts === `undefined`) - opts = { flag: `a` }; - else if (typeof opts === `string`) - opts = { flag: `a`, encoding: opts }; - else if (typeof opts.flag === `undefined`) - opts = { flag: `a`, ...opts }; - return this.writeFilePromise(p, content, opts); - } - appendFileSync(p, content, opts = {}) { - if (this.readOnly) - throw EROFS(`open '${p}'`); - if (typeof opts === `undefined`) - opts = { flag: `a` }; - else if (typeof opts === `string`) - opts = { flag: `a`, encoding: opts }; - else if (typeof opts.flag === `undefined`) - opts = { flag: `a`, ...opts }; - return this.writeFileSync(p, content, opts); - } - fdToPath(fd, reason) { - const path = this.fds.get(fd)?.p; - if (typeof path === `undefined`) - throw EBADF(reason); - return path; - } - async writeFilePromise(p, content, opts) { - const { encoding, mode, index, resolvedP } = this.prepareWriteFile(p, opts); - if (index !== void 0 && typeof opts === `object` && opts.flag && opts.flag.includes(`a`)) - content = Buffer.concat([await this.getFileSource(index, { asyncDecompress: true }), Buffer.from(content)]); - if (encoding !== null) - content = content.toString(encoding); - const newIndex = this.setFileSource(resolvedP, content); - if (newIndex !== index) - this.registerEntry(resolvedP, newIndex); - if (mode !== null) { - await this.chmodPromise(resolvedP, mode); - } - } - writeFileSync(p, content, opts) { - const { encoding, mode, index, resolvedP } = this.prepareWriteFile(p, opts); - if (index !== void 0 && typeof opts === `object` && opts.flag && opts.flag.includes(`a`)) - content = Buffer.concat([this.getFileSource(index), Buffer.from(content)]); - if (encoding !== null) - content = content.toString(encoding); - const newIndex = this.setFileSource(resolvedP, content); - if (newIndex !== index) - this.registerEntry(resolvedP, newIndex); - if (mode !== null) { - this.chmodSync(resolvedP, mode); - } - } - prepareWriteFile(p, opts) { - if (typeof p === `number`) - p = this.fdToPath(p, `read`); - if (this.readOnly) - throw EROFS(`open '${p}'`); - const resolvedP = this.resolveFilename(`open '${p}'`, p); - if (this.listings.has(resolvedP)) - throw EISDIR(`open '${p}'`); - let encoding = null, mode = null; - if (typeof opts === `string`) { - encoding = opts; - } else if (typeof opts === `object`) { - ({ - encoding = null, - mode = null - } = opts); - } - const index = this.entries.get(resolvedP); - return { - encoding, - mode, - resolvedP, - index - }; - } - async unlinkPromise(p) { - return this.unlinkSync(p); - } - unlinkSync(p) { - if (this.readOnly) - throw EROFS(`unlink '${p}'`); - const resolvedP = this.resolveFilename(`unlink '${p}'`, p); - if (this.listings.has(resolvedP)) - throw EISDIR(`unlink '${p}'`); - const index = this.entries.get(resolvedP); - if (typeof index === `undefined`) - throw EINVAL(`unlink '${p}'`); - this.deleteEntry(resolvedP, index); - } - async utimesPromise(p, atime, mtime) { - return this.utimesSync(p, atime, mtime); - } - utimesSync(p, atime, mtime) { - if (this.readOnly) - throw EROFS(`utimes '${p}'`); - const resolvedP = this.resolveFilename(`utimes '${p}'`, p); - this.utimesImpl(resolvedP, mtime); - } - async lutimesPromise(p, atime, mtime) { - return this.lutimesSync(p, atime, mtime); - } - lutimesSync(p, atime, mtime) { - if (this.readOnly) - throw EROFS(`lutimes '${p}'`); - const resolvedP = this.resolveFilename(`utimes '${p}'`, p, false); - this.utimesImpl(resolvedP, mtime); - } - utimesImpl(resolvedP, mtime) { - if (this.listings.has(resolvedP)) { - if (!this.entries.has(resolvedP)) - this.hydrateDirectory(resolvedP); - } - const entry = this.entries.get(resolvedP); - if (entry === void 0) - throw new Error(`Unreachable`); - const rc = this.libzip.file.setMtime(this.zip, entry, 0, toUnixTimestamp(mtime), 0); - if (rc === -1) { - throw this.makeLibzipError(this.libzip.getError(this.zip)); - } - } - async mkdirPromise(p, opts) { - return this.mkdirSync(p, opts); - } - mkdirSync(p, { mode = 493, recursive = false } = {}) { - if (recursive) - return this.mkdirpSync(p, { chmod: mode }); - if (this.readOnly) - throw EROFS(`mkdir '${p}'`); - const resolvedP = this.resolveFilename(`mkdir '${p}'`, p); - if (this.entries.has(resolvedP) || this.listings.has(resolvedP)) - throw EEXIST(`mkdir '${p}'`); - this.hydrateDirectory(resolvedP); - this.chmodSync(resolvedP, mode); - return void 0; - } - async rmdirPromise(p, opts) { - return this.rmdirSync(p, opts); - } - rmdirSync(p, { recursive = false } = {}) { - if (this.readOnly) - throw EROFS(`rmdir '${p}'`); - if (recursive) { - this.removeSync(p); - return; - } - const resolvedP = this.resolveFilename(`rmdir '${p}'`, p); - const directoryListing = this.listings.get(resolvedP); - if (!directoryListing) - throw ENOTDIR(`rmdir '${p}'`); - if (directoryListing.size > 0) - throw ENOTEMPTY(`rmdir '${p}'`); - const index = this.entries.get(resolvedP); - if (typeof index === `undefined`) - throw EINVAL(`rmdir '${p}'`); - this.deleteEntry(p, index); - } - async rmPromise(p, opts) { - return this.rmSync(p, opts); - } - rmSync(p, { recursive = false } = {}) { - if (this.readOnly) - throw EROFS(`rm '${p}'`); - if (recursive) { - this.removeSync(p); - return; - } - const resolvedP = this.resolveFilename(`rm '${p}'`, p); - const directoryListing = this.listings.get(resolvedP); - if (!directoryListing) - throw ENOTDIR(`rm '${p}'`); - if (directoryListing.size > 0) - throw ENOTEMPTY(`rm '${p}'`); - const index = this.entries.get(resolvedP); - if (typeof index === `undefined`) - throw EINVAL(`rm '${p}'`); - this.deleteEntry(p, index); - } - hydrateDirectory(resolvedP) { - const index = this.libzip.dir.add(this.zip, ppath.relative(PortablePath.root, resolvedP)); - if (index === -1) - throw this.makeLibzipError(this.libzip.getError(this.zip)); - this.registerListing(resolvedP); - this.registerEntry(resolvedP, index); - return index; - } - async linkPromise(existingP, newP) { - return this.linkSync(existingP, newP); - } - linkSync(existingP, newP) { - throw EOPNOTSUPP(`link '${existingP}' -> '${newP}'`); - } - async symlinkPromise(target, p) { - return this.symlinkSync(target, p); - } - symlinkSync(target, p) { - if (this.readOnly) - throw EROFS(`symlink '${target}' -> '${p}'`); - const resolvedP = this.resolveFilename(`symlink '${target}' -> '${p}'`, p); - if (this.listings.has(resolvedP)) - throw EISDIR(`symlink '${target}' -> '${p}'`); - if (this.entries.has(resolvedP)) - throw EEXIST(`symlink '${target}' -> '${p}'`); - const index = this.setFileSource(resolvedP, target); - this.registerEntry(resolvedP, index); - const rc = this.libzip.file.setExternalAttributes(this.zip, index, 0, 0, this.libzip.ZIP_OPSYS_UNIX, (fs.constants.S_IFLNK | 511) << 16); - if (rc === -1) - throw this.makeLibzipError(this.libzip.getError(this.zip)); - this.symlinkCount += 1; - } - async readFilePromise(p, encoding) { - if (typeof encoding === `object`) - encoding = encoding ? encoding.encoding : void 0; - const data = await this.readFileBuffer(p, { asyncDecompress: true }); - return encoding ? data.toString(encoding) : data; - } - readFileSync(p, encoding) { - if (typeof encoding === `object`) - encoding = encoding ? encoding.encoding : void 0; - const data = this.readFileBuffer(p); - return encoding ? data.toString(encoding) : data; - } - readFileBuffer(p, opts = { asyncDecompress: false }) { - if (typeof p === `number`) - p = this.fdToPath(p, `read`); - const resolvedP = this.resolveFilename(`open '${p}'`, p); - if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) - throw ENOENT(`open '${p}'`); - if (p[p.length - 1] === `/` && !this.listings.has(resolvedP)) - throw ENOTDIR(`open '${p}'`); - if (this.listings.has(resolvedP)) - throw EISDIR(`read`); - const entry = this.entries.get(resolvedP); - if (entry === void 0) - throw new Error(`Unreachable`); - return this.getFileSource(entry, opts); - } - async readdirPromise(p, opts) { - return this.readdirSync(p, opts); - } - readdirSync(p, opts) { - const resolvedP = this.resolveFilename(`scandir '${p}'`, p); - if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) - throw ENOENT(`scandir '${p}'`); - const directoryListing = this.listings.get(resolvedP); - if (!directoryListing) - throw ENOTDIR(`scandir '${p}'`); - if (opts?.recursive) { - if (opts?.withFileTypes) { - const entries = Array.from(directoryListing, (name) => { - return Object.assign(this.statImpl(`lstat`, ppath.join(p, name)), { - name, - path: PortablePath.dot - }); - }); - for (const entry of entries) { - if (!entry.isDirectory()) - continue; - const subPath = ppath.join(entry.path, entry.name); - const subListing = this.listings.get(ppath.join(resolvedP, subPath)); - for (const child of subListing) { - entries.push(Object.assign(this.statImpl(`lstat`, ppath.join(p, subPath, child)), { - name: child, - path: subPath - })); - } - } - return entries; - } else { - const entries = [...directoryListing]; - for (const subPath of entries) { - const subListing = this.listings.get(ppath.join(resolvedP, subPath)); - if (typeof subListing === `undefined`) - continue; - for (const child of subListing) { - entries.push(ppath.join(subPath, child)); - } - } - return entries; - } - } else if (opts?.withFileTypes) { - return Array.from(directoryListing, (name) => { - return Object.assign(this.statImpl(`lstat`, ppath.join(p, name)), { - name, - path: void 0 - }); - }); - } else { - return [...directoryListing]; - } - } - async readlinkPromise(p) { - const entry = this.prepareReadlink(p); - return (await this.getFileSource(entry, { asyncDecompress: true })).toString(); - } - readlinkSync(p) { - const entry = this.prepareReadlink(p); - return this.getFileSource(entry).toString(); - } - prepareReadlink(p) { - const resolvedP = this.resolveFilename(`readlink '${p}'`, p, false); - if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) - throw ENOENT(`readlink '${p}'`); - if (p[p.length - 1] === `/` && !this.listings.has(resolvedP)) - throw ENOTDIR(`open '${p}'`); - if (this.listings.has(resolvedP)) - throw EINVAL(`readlink '${p}'`); - const entry = this.entries.get(resolvedP); - if (entry === void 0) - throw new Error(`Unreachable`); - if (!this.isSymbolicLink(entry)) - throw EINVAL(`readlink '${p}'`); - return entry; - } - async truncatePromise(p, len = 0) { - const resolvedP = this.resolveFilename(`open '${p}'`, p); - const index = this.entries.get(resolvedP); - if (typeof index === `undefined`) - throw EINVAL(`open '${p}'`); - const source = await this.getFileSource(index, { asyncDecompress: true }); - const truncated = Buffer.alloc(len, 0); - source.copy(truncated); - return await this.writeFilePromise(p, truncated); - } - truncateSync(p, len = 0) { - const resolvedP = this.resolveFilename(`open '${p}'`, p); - const index = this.entries.get(resolvedP); - if (typeof index === `undefined`) - throw EINVAL(`open '${p}'`); - const source = this.getFileSource(index); - const truncated = Buffer.alloc(len, 0); - source.copy(truncated); - return this.writeFileSync(p, truncated); - } - async ftruncatePromise(fd, len) { - return this.truncatePromise(this.fdToPath(fd, `ftruncate`), len); - } - ftruncateSync(fd, len) { - return this.truncateSync(this.fdToPath(fd, `ftruncateSync`), len); - } - watch(p, a, b) { - let persistent; - switch (typeof a) { - case `function`: - case `string`: - case `undefined`: - { - persistent = true; - } - break; - default: - { - ({ persistent = true } = a); - } - break; - } - if (!persistent) - return { on: () => { - }, close: () => { - } }; - const interval = setInterval(() => { - }, 24 * 60 * 60 * 1e3); - return { on: () => { - }, close: () => { - clearInterval(interval); - } }; - } - watchFile(p, a, b) { - const resolvedP = ppath.resolve(PortablePath.root, p); - return watchFile(this, resolvedP, a, b); - } - unwatchFile(p, cb) { - const resolvedP = ppath.resolve(PortablePath.root, p); - return unwatchFile(this, resolvedP, cb); - } -} - -setFactory(() => { - const emZip = createModule(); - return makeInterface(emZip); -}); - -var ErrorCode = /* @__PURE__ */ ((ErrorCode2) => { - ErrorCode2["API_ERROR"] = `API_ERROR`; - ErrorCode2["BUILTIN_NODE_RESOLUTION_FAILED"] = `BUILTIN_NODE_RESOLUTION_FAILED`; - ErrorCode2["EXPORTS_RESOLUTION_FAILED"] = `EXPORTS_RESOLUTION_FAILED`; - ErrorCode2["MISSING_DEPENDENCY"] = `MISSING_DEPENDENCY`; - ErrorCode2["MISSING_PEER_DEPENDENCY"] = `MISSING_PEER_DEPENDENCY`; - ErrorCode2["QUALIFIED_PATH_RESOLUTION_FAILED"] = `QUALIFIED_PATH_RESOLUTION_FAILED`; - ErrorCode2["INTERNAL"] = `INTERNAL`; - ErrorCode2["UNDECLARED_DEPENDENCY"] = `UNDECLARED_DEPENDENCY`; - ErrorCode2["UNSUPPORTED"] = `UNSUPPORTED`; - return ErrorCode2; -})(ErrorCode || {}); -const MODULE_NOT_FOUND_ERRORS = /* @__PURE__ */ new Set([ - "BUILTIN_NODE_RESOLUTION_FAILED" /* BUILTIN_NODE_RESOLUTION_FAILED */, - "MISSING_DEPENDENCY" /* MISSING_DEPENDENCY */, - "MISSING_PEER_DEPENDENCY" /* MISSING_PEER_DEPENDENCY */, - "QUALIFIED_PATH_RESOLUTION_FAILED" /* QUALIFIED_PATH_RESOLUTION_FAILED */, - "UNDECLARED_DEPENDENCY" /* UNDECLARED_DEPENDENCY */ -]); -function makeError(pnpCode, message, data = {}, code) { - code ??= MODULE_NOT_FOUND_ERRORS.has(pnpCode) ? `MODULE_NOT_FOUND` : pnpCode; - const propertySpec = { - configurable: true, - writable: true, - enumerable: false - }; - return Object.defineProperties(new Error(message), { - code: { - ...propertySpec, - value: code - }, - pnpCode: { - ...propertySpec, - value: pnpCode - }, - data: { - ...propertySpec, - value: data - } - }); -} -function getIssuerModule(parent) { - let issuer = parent; - while (issuer && (issuer.id === `[eval]` || issuer.id === `` || !issuer.filename)) - issuer = issuer.parent; - return issuer || null; -} -function getPathForDisplay(p) { - return npath.normalize(npath.fromPortablePath(p)); -} - -const [major, minor] = process.versions.node.split(`.`).map((value) => parseInt(value, 10)); -const WATCH_MODE_MESSAGE_USES_ARRAYS = major > 19 || major === 19 && minor >= 2 || major === 18 && minor >= 13; - -function readPackageScope(checkPath) { - const rootSeparatorIndex = checkPath.indexOf(npath.sep); - let separatorIndex; - do { - separatorIndex = checkPath.lastIndexOf(npath.sep); - checkPath = checkPath.slice(0, separatorIndex); - if (checkPath.endsWith(`${npath.sep}node_modules`)) - return false; - const pjson = readPackage(checkPath + npath.sep); - if (pjson) { - return { - data: pjson, - path: checkPath - }; - } - } while (separatorIndex > rootSeparatorIndex); - return false; -} -function readPackage(requestPath) { - const jsonPath = npath.resolve(requestPath, `package.json`); - if (!fs__default.default.existsSync(jsonPath)) - return null; - return JSON.parse(fs__default.default.readFileSync(jsonPath, `utf8`)); -} -function ERR_REQUIRE_ESM(filename, parentPath = null) { - const basename = parentPath && path__default.default.basename(filename) === path__default.default.basename(parentPath) ? filename : path__default.default.basename(filename); - const msg = `require() of ES Module ${filename}${parentPath ? ` from ${parentPath}` : ``} not supported. -Instead change the require of ${basename} in ${parentPath} to a dynamic import() which is available in all CommonJS modules.`; - const err = new Error(msg); - err.code = `ERR_REQUIRE_ESM`; - return err; -} -function reportRequiredFilesToWatchMode(files) { - if (process.env.WATCH_REPORT_DEPENDENCIES && process.send) { - files = files.map((filename) => npath.fromPortablePath(VirtualFS.resolveVirtual(npath.toPortablePath(filename)))); - if (WATCH_MODE_MESSAGE_USES_ARRAYS) { - process.send({ "watch:require": files }); - } else { - for (const filename of files) { - process.send({ "watch:require": filename }); - } - } - } -} - -function applyPatch(pnpapi, opts) { - let enableNativeHooks = true; - process.versions.pnp = String(pnpapi.VERSIONS.std); - const moduleExports = require$$0__default.default; - moduleExports.findPnpApi = (lookupSource) => { - const lookupPath = lookupSource instanceof URL ? url.fileURLToPath(lookupSource) : lookupSource; - const apiPath = opts.manager.findApiPathFor(lookupPath); - if (apiPath === null) - return null; - const apiEntry = opts.manager.getApiEntry(apiPath, true); - return apiEntry.instance.findPackageLocator(lookupPath) ? apiEntry.instance : null; - }; - function getRequireStack(parent) { - const requireStack = []; - for (let cursor = parent; cursor; cursor = cursor.parent) - requireStack.push(cursor.filename || cursor.id); - return requireStack; - } - const originalModuleLoad = require$$0.Module._load; - require$$0.Module._load = function(request, parent, isMain) { - if (request === `pnpapi`) { - const parentApiPath = opts.manager.getApiPathFromParent(parent); - if (parentApiPath) { - return opts.manager.getApiEntry(parentApiPath, true).instance; - } - } - return originalModuleLoad.call(require$$0.Module, request, parent, isMain); - }; - function getIssuerSpecsFromPaths(paths) { - return paths.map((path) => ({ - apiPath: opts.manager.findApiPathFor(path), - path, - module: null - })); - } - function getIssuerSpecsFromModule(module) { - if (module && module.id !== `` && module.id !== `internal/preload` && !module.parent && !module.filename && module.paths.length > 0) { - return [{ - apiPath: opts.manager.findApiPathFor(module.paths[0]), - path: module.paths[0], - module - }]; - } - const issuer = getIssuerModule(module); - if (issuer !== null) { - const path = npath.dirname(issuer.filename); - const apiPath = opts.manager.getApiPathFromParent(issuer); - return [{ apiPath, path, module }]; - } else { - const path = process.cwd(); - const apiPath = opts.manager.findApiPathFor(npath.join(path, `[file]`)) ?? opts.manager.getApiPathFromParent(null); - return [{ apiPath, path, module }]; - } - } - function makeFakeParent(path) { - const fakeParent = new require$$0.Module(``); - const fakeFilePath = npath.join(path, `[file]`); - fakeParent.paths = require$$0.Module._nodeModulePaths(fakeFilePath); - return fakeParent; - } - const pathRegExp = /^(?![a-zA-Z]:[\\/]|\\\\|\.{0,2}(?:\/|$))((?:@[^/]+\/)?[^/]+)\/*(.*|)$/; - const originalModuleResolveFilename = require$$0.Module._resolveFilename; - require$$0.Module._resolveFilename = function(request, parent, isMain, options) { - if (require$$0.isBuiltin(request)) - return request; - if (!enableNativeHooks) - return originalModuleResolveFilename.call(require$$0.Module, request, parent, isMain, options); - if (options && options.plugnplay === false) { - const { plugnplay, ...forwardedOptions } = options; - try { - enableNativeHooks = false; - return originalModuleResolveFilename.call(require$$0.Module, request, parent, isMain, forwardedOptions); - } finally { - enableNativeHooks = true; - } - } - if (options) { - const optionNames = new Set(Object.keys(options)); - optionNames.delete(`paths`); - optionNames.delete(`plugnplay`); - if (optionNames.size > 0) { - throw makeError( - ErrorCode.UNSUPPORTED, - `Some options passed to require() aren't supported by PnP yet (${Array.from(optionNames).join(`, `)})` - ); - } - } - const issuerSpecs = options && options.paths ? getIssuerSpecsFromPaths(options.paths) : getIssuerSpecsFromModule(parent); - if (request.match(pathRegExp) === null) { - const parentDirectory = parent?.filename != null ? npath.dirname(parent.filename) : null; - const absoluteRequest = npath.isAbsolute(request) ? request : parentDirectory !== null ? npath.resolve(parentDirectory, request) : null; - if (absoluteRequest !== null) { - const apiPath = parent && parentDirectory === npath.dirname(absoluteRequest) ? opts.manager.getApiPathFromParent(parent) : opts.manager.findApiPathFor(absoluteRequest); - if (apiPath !== null) { - issuerSpecs.unshift({ - apiPath, - path: parentDirectory, - module: null - }); - } - } - } - let firstError; - for (const { apiPath, path, module } of issuerSpecs) { - let resolution; - const issuerApi = apiPath !== null ? opts.manager.getApiEntry(apiPath, true).instance : null; - try { - if (issuerApi !== null) { - resolution = issuerApi.resolveRequest(request, path !== null ? `${path}/` : null); - } else { - if (path === null) - throw new Error(`Assertion failed: Expected the path to be set`); - resolution = originalModuleResolveFilename.call(require$$0.Module, request, module || makeFakeParent(path), isMain); - } - } catch (error) { - firstError = firstError || error; - continue; - } - if (resolution !== null) { - return resolution; - } - } - const requireStack = getRequireStack(parent); - Object.defineProperty(firstError, `requireStack`, { - configurable: true, - writable: true, - enumerable: false, - value: requireStack - }); - if (requireStack.length > 0) - firstError.message += ` -Require stack: -- ${requireStack.join(` -- `)}`; - if (typeof firstError.pnpCode === `string`) - Error.captureStackTrace(firstError); - throw firstError; - }; - const originalFindPath = require$$0.Module._findPath; - require$$0.Module._findPath = function(request, paths, isMain) { - if (request === `pnpapi`) - return false; - if (!enableNativeHooks) - return originalFindPath.call(require$$0.Module, request, paths, isMain); - const isAbsolute = npath.isAbsolute(request); - if (isAbsolute) - paths = [``]; - else if (!paths || paths.length === 0) - return false; - for (const path of paths) { - let resolution; - try { - const pnpApiPath = opts.manager.findApiPathFor(isAbsolute ? request : path); - if (pnpApiPath !== null) { - const api = opts.manager.getApiEntry(pnpApiPath, true).instance; - resolution = api.resolveRequest(request, path) || false; - } else { - resolution = originalFindPath.call(require$$0.Module, request, [path], isMain); - } - } catch (error) { - continue; - } - if (resolution) { - return resolution; - } - } - return false; - }; - const originalExtensionJSFunction = require$$0.Module._extensions[`.js`]; - require$$0.Module._extensions[`.js`] = function(module, filename) { - if (filename.endsWith(`.js`)) { - const pkg = readPackageScope(filename); - if (pkg && pkg.data?.type === `module`) { - const err = ERR_REQUIRE_ESM(filename, module.parent?.filename); - Error.captureStackTrace(err); - throw err; - } - } - originalExtensionJSFunction.call(this, module, filename); - }; - const originalDlopen = process.dlopen; - process.dlopen = function(...args) { - const [module, filename, ...rest] = args; - return originalDlopen.call( - this, - module, - npath.fromPortablePath(VirtualFS.resolveVirtual(npath.toPortablePath(filename))), - ...rest - ); - }; - const originalEmit = process.emit; - process.emit = function(name, data, ...args) { - if (name === `warning` && typeof data === `object` && data.name === `ExperimentalWarning` && (data.message.includes(`--experimental-loader`) || data.message.includes(`Custom ESM Loaders is an experimental feature`))) - return false; - return originalEmit.apply(process, arguments); - }; - patchFs(fs__default.default, new PosixFS(opts.fakeFs)); -} - -function hydrateRuntimeState(data, { basePath }) { - const portablePath = npath.toPortablePath(basePath); - const absolutePortablePath = ppath.resolve(portablePath); - const ignorePattern = data.ignorePatternData !== null ? new RegExp(data.ignorePatternData) : null; - const packageLocatorsByLocations = /* @__PURE__ */ new Map(); - const packageRegistry = new Map(data.packageRegistryData.map(([packageName, packageStoreData]) => { - return [packageName, new Map(packageStoreData.map(([packageReference, packageInformationData]) => { - if (packageName === null !== (packageReference === null)) - throw new Error(`Assertion failed: The name and reference should be null, or neither should`); - const discardFromLookup = packageInformationData.discardFromLookup ?? false; - const packageLocator = { name: packageName, reference: packageReference }; - const entry = packageLocatorsByLocations.get(packageInformationData.packageLocation); - if (!entry) { - packageLocatorsByLocations.set(packageInformationData.packageLocation, { locator: packageLocator, discardFromLookup }); - } else { - entry.discardFromLookup = entry.discardFromLookup && discardFromLookup; - if (!discardFromLookup) { - entry.locator = packageLocator; - } - } - let resolvedPackageLocation = null; - return [packageReference, { - packageDependencies: new Map(packageInformationData.packageDependencies), - packagePeers: new Set(packageInformationData.packagePeers), - linkType: packageInformationData.linkType, - discardFromLookup, - get packageLocation() { - return resolvedPackageLocation || (resolvedPackageLocation = ppath.join(absolutePortablePath, packageInformationData.packageLocation)); - } - }]; - }))]; - })); - const fallbackExclusionList = new Map(data.fallbackExclusionList.map(([packageName, packageReferences]) => { - return [packageName, new Set(packageReferences)]; - })); - const fallbackPool = new Map(data.fallbackPool); - const dependencyTreeRoots = data.dependencyTreeRoots; - const enableTopLevelFallback = data.enableTopLevelFallback; - return { - basePath: portablePath, - dependencyTreeRoots, - enableTopLevelFallback, - fallbackExclusionList, - fallbackPool, - ignorePattern, - packageLocatorsByLocations, - packageRegistry - }; -} - -const ArrayIsArray = Array.isArray; -const JSONStringify = JSON.stringify; -const ObjectGetOwnPropertyNames = Object.getOwnPropertyNames; -const ObjectPrototypeHasOwnProperty = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop); -const RegExpPrototypeExec = (obj, string) => RegExp.prototype.exec.call(obj, string); -const RegExpPrototypeSymbolReplace = (obj, ...rest) => RegExp.prototype[Symbol.replace].apply(obj, rest); -const StringPrototypeEndsWith = (str, ...rest) => String.prototype.endsWith.apply(str, rest); -const StringPrototypeIncludes = (str, ...rest) => String.prototype.includes.apply(str, rest); -const StringPrototypeLastIndexOf = (str, ...rest) => String.prototype.lastIndexOf.apply(str, rest); -const StringPrototypeIndexOf = (str, ...rest) => String.prototype.indexOf.apply(str, rest); -const StringPrototypeReplace = (str, ...rest) => String.prototype.replace.apply(str, rest); -const StringPrototypeSlice = (str, ...rest) => String.prototype.slice.apply(str, rest); -const StringPrototypeStartsWith = (str, ...rest) => String.prototype.startsWith.apply(str, rest); -const SafeMap = Map; -const JSONParse = JSON.parse; - -function createErrorType(code, messageCreator, errorType) { - return class extends errorType { - constructor(...args) { - super(messageCreator(...args)); - this.code = code; - this.name = `${errorType.name} [${code}]`; - } - }; -} -const ERR_PACKAGE_IMPORT_NOT_DEFINED = createErrorType( - `ERR_PACKAGE_IMPORT_NOT_DEFINED`, - (specifier, packagePath, base) => { - return `Package import specifier "${specifier}" is not defined${packagePath ? ` in package ${packagePath}package.json` : ``} imported from ${base}`; - }, - TypeError -); -const ERR_INVALID_MODULE_SPECIFIER = createErrorType( - `ERR_INVALID_MODULE_SPECIFIER`, - (request, reason, base = void 0) => { - return `Invalid module "${request}" ${reason}${base ? ` imported from ${base}` : ``}`; - }, - TypeError -); -const ERR_INVALID_PACKAGE_TARGET = createErrorType( - `ERR_INVALID_PACKAGE_TARGET`, - (pkgPath, key, target, isImport = false, base = void 0) => { - const relError = typeof target === `string` && !isImport && target.length && !StringPrototypeStartsWith(target, `./`); - if (key === `.`) { - assert__default.default(isImport === false); - return `Invalid "exports" main target ${JSONStringify(target)} defined in the package config ${pkgPath}package.json${base ? ` imported from ${base}` : ``}${relError ? `; targets must start with "./"` : ``}`; - } - return `Invalid "${isImport ? `imports` : `exports`}" target ${JSONStringify( - target - )} defined for '${key}' in the package config ${pkgPath}package.json${base ? ` imported from ${base}` : ``}${relError ? `; targets must start with "./"` : ``}`; - }, - Error -); -const ERR_INVALID_PACKAGE_CONFIG = createErrorType( - `ERR_INVALID_PACKAGE_CONFIG`, - (path, base, message) => { - return `Invalid package config ${path}${base ? ` while importing ${base}` : ``}${message ? `. ${message}` : ``}`; - }, - Error -); -const ERR_PACKAGE_PATH_NOT_EXPORTED = createErrorType( - "ERR_PACKAGE_PATH_NOT_EXPORTED", - (pkgPath, subpath, base = void 0) => { - if (subpath === ".") - return `No "exports" main defined in ${pkgPath}package.json${base ? ` imported from ${base}` : ""}`; - return `Package subpath '${subpath}' is not defined by "exports" in ${pkgPath}package.json${base ? ` imported from ${base}` : ""}`; - }, - Error -); - -function filterOwnProperties(source, keys) { - const filtered = /* @__PURE__ */ Object.create(null); - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - if (ObjectPrototypeHasOwnProperty(source, key)) { - filtered[key] = source[key]; - } - } - return filtered; -} - -const packageJSONCache = new SafeMap(); -function getPackageConfig(path, specifier, base, readFileSyncFn) { - const existing = packageJSONCache.get(path); - if (existing !== void 0) { - return existing; - } - const source = readFileSyncFn(path); - if (source === void 0) { - const packageConfig2 = { - pjsonPath: path, - exists: false, - main: void 0, - name: void 0, - type: "none", - exports: void 0, - imports: void 0 - }; - packageJSONCache.set(path, packageConfig2); - return packageConfig2; - } - let packageJSON; - try { - packageJSON = JSONParse(source); - } catch (error) { - throw new ERR_INVALID_PACKAGE_CONFIG( - path, - (base ? `"${specifier}" from ` : "") + url.fileURLToPath(base || specifier), - error.message - ); - } - let { imports, main, name, type } = filterOwnProperties(packageJSON, [ - "imports", - "main", - "name", - "type" - ]); - const exports = ObjectPrototypeHasOwnProperty(packageJSON, "exports") ? packageJSON.exports : void 0; - if (typeof imports !== "object" || imports === null) { - imports = void 0; - } - if (typeof main !== "string") { - main = void 0; - } - if (typeof name !== "string") { - name = void 0; - } - if (type !== "module" && type !== "commonjs") { - type = "none"; - } - const packageConfig = { - pjsonPath: path, - exists: true, - main, - name, - type, - exports, - imports - }; - packageJSONCache.set(path, packageConfig); - return packageConfig; -} -function getPackageScopeConfig(resolved, readFileSyncFn) { - let packageJSONUrl = new URL("./package.json", resolved); - while (true) { - const packageJSONPath2 = packageJSONUrl.pathname; - if (StringPrototypeEndsWith(packageJSONPath2, "node_modules/package.json")) { - break; - } - const packageConfig2 = getPackageConfig( - url.fileURLToPath(packageJSONUrl), - resolved, - void 0, - readFileSyncFn - ); - if (packageConfig2.exists) { - return packageConfig2; - } - const lastPackageJSONUrl = packageJSONUrl; - packageJSONUrl = new URL("../package.json", packageJSONUrl); - if (packageJSONUrl.pathname === lastPackageJSONUrl.pathname) { - break; - } - } - const packageJSONPath = url.fileURLToPath(packageJSONUrl); - const packageConfig = { - pjsonPath: packageJSONPath, - exists: false, - main: void 0, - name: void 0, - type: "none", - exports: void 0, - imports: void 0 - }; - packageJSONCache.set(packageJSONPath, packageConfig); - return packageConfig; -} - -function throwImportNotDefined(specifier, packageJSONUrl, base) { - throw new ERR_PACKAGE_IMPORT_NOT_DEFINED( - specifier, - packageJSONUrl && url.fileURLToPath(new URL(".", packageJSONUrl)), - url.fileURLToPath(base) - ); -} -function throwInvalidSubpath(subpath, packageJSONUrl, internal, base) { - const reason = `request is not a valid subpath for the "${internal ? "imports" : "exports"}" resolution of ${url.fileURLToPath(packageJSONUrl)}`; - throw new ERR_INVALID_MODULE_SPECIFIER( - subpath, - reason, - base && url.fileURLToPath(base) - ); -} -function throwInvalidPackageTarget(subpath, target, packageJSONUrl, internal, base) { - if (typeof target === "object" && target !== null) { - target = JSONStringify(target, null, ""); - } else { - target = `${target}`; - } - throw new ERR_INVALID_PACKAGE_TARGET( - url.fileURLToPath(new URL(".", packageJSONUrl)), - subpath, - target, - internal, - base && url.fileURLToPath(base) - ); -} -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; -const patternRegEx = /\*/g; -function resolvePackageTargetString(target, subpath, match, packageJSONUrl, base, pattern, internal, conditions) { - if (subpath !== "" && !pattern && target[target.length - 1] !== "/") - throwInvalidPackageTarget(match, target, packageJSONUrl, internal, base); - if (!StringPrototypeStartsWith(target, "./")) { - if (internal && !StringPrototypeStartsWith(target, "../") && !StringPrototypeStartsWith(target, "/")) { - let isURL = false; - try { - new URL(target); - isURL = true; - } catch { - } - if (!isURL) { - const exportTarget = pattern ? RegExpPrototypeSymbolReplace(patternRegEx, target, () => subpath) : target + subpath; - return exportTarget; - } - } - throwInvalidPackageTarget(match, target, packageJSONUrl, internal, base); - } - if (RegExpPrototypeExec( - invalidSegmentRegEx, - StringPrototypeSlice(target, 2) - ) !== null) - throwInvalidPackageTarget(match, target, packageJSONUrl, internal, base); - const resolved = new URL(target, packageJSONUrl); - const resolvedPath = resolved.pathname; - const packagePath = new URL(".", packageJSONUrl).pathname; - if (!StringPrototypeStartsWith(resolvedPath, packagePath)) - throwInvalidPackageTarget(match, target, packageJSONUrl, internal, base); - if (subpath === "") - return resolved; - if (RegExpPrototypeExec(invalidSegmentRegEx, subpath) !== null) { - const request = pattern ? StringPrototypeReplace(match, "*", () => subpath) : match + subpath; - throwInvalidSubpath(request, packageJSONUrl, internal, base); - } - if (pattern) { - return new URL( - RegExpPrototypeSymbolReplace(patternRegEx, resolved.href, () => subpath) - ); - } - return new URL(subpath, resolved); -} -function isArrayIndex(key) { - const keyNum = +key; - if (`${keyNum}` !== key) - return false; - return keyNum >= 0 && keyNum < 4294967295; -} -function resolvePackageTarget(packageJSONUrl, target, subpath, packageSubpath, base, pattern, internal, conditions) { - if (typeof target === "string") { - return resolvePackageTargetString( - target, - subpath, - packageSubpath, - packageJSONUrl, - base, - pattern, - internal); - } else if (ArrayIsArray(target)) { - if (target.length === 0) { - return null; - } - let lastException; - for (let i = 0; i < target.length; i++) { - const targetItem = target[i]; - let resolveResult; - try { - resolveResult = resolvePackageTarget( - packageJSONUrl, - targetItem, - subpath, - packageSubpath, - base, - pattern, - internal, - conditions - ); - } catch (e) { - lastException = e; - if (e.code === "ERR_INVALID_PACKAGE_TARGET") { - continue; - } - throw e; - } - if (resolveResult === void 0) { - continue; - } - if (resolveResult === null) { - lastException = null; - continue; - } - return resolveResult; - } - if (lastException === void 0 || lastException === null) - return lastException; - throw lastException; - } else if (typeof target === "object" && target !== null) { - const keys = ObjectGetOwnPropertyNames(target); - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - if (isArrayIndex(key)) { - throw new ERR_INVALID_PACKAGE_CONFIG( - url.fileURLToPath(packageJSONUrl), - base, - '"exports" cannot contain numeric property keys.' - ); - } - } - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - if (key === "default" || conditions.has(key)) { - const conditionalTarget = target[key]; - const resolveResult = resolvePackageTarget( - packageJSONUrl, - conditionalTarget, - subpath, - packageSubpath, - base, - pattern, - internal, - conditions - ); - if (resolveResult === void 0) - continue; - return resolveResult; - } - } - return void 0; - } else if (target === null) { - return null; - } - throwInvalidPackageTarget( - packageSubpath, - target, - packageJSONUrl, - internal, - base - ); -} -function patternKeyCompare(a, b) { - const aPatternIndex = StringPrototypeIndexOf(a, "*"); - const bPatternIndex = StringPrototypeIndexOf(b, "*"); - 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; -} -function isConditionalExportsMainSugar(exports, packageJSONUrl, base) { - if (typeof exports === "string" || ArrayIsArray(exports)) - return true; - if (typeof exports !== "object" || exports === null) - return false; - const keys = ObjectGetOwnPropertyNames(exports); - let isConditionalSugar = false; - let i = 0; - for (let j = 0; j < keys.length; j++) { - const key = keys[j]; - const curIsConditionalSugar = key === "" || key[0] !== "."; - if (i++ === 0) { - isConditionalSugar = curIsConditionalSugar; - } else if (isConditionalSugar !== curIsConditionalSugar) { - throw new ERR_INVALID_PACKAGE_CONFIG( - url.fileURLToPath(packageJSONUrl), - base, - `"exports" cannot contain some keys starting with '.' and some not. The exports object must either be an object of package subpath keys or an object of main entry condition name keys only.` - ); - } - } - return isConditionalSugar; -} -function throwExportsNotFound(subpath, packageJSONUrl, base) { - throw new ERR_PACKAGE_PATH_NOT_EXPORTED( - url.fileURLToPath(new URL(".", packageJSONUrl)), - subpath, - base && url.fileURLToPath(base) - ); -} -const emittedPackageWarnings = /* @__PURE__ */ new Set(); -function emitTrailingSlashPatternDeprecation(match, pjsonUrl, base) { - const pjsonPath = url.fileURLToPath(pjsonUrl); - if (emittedPackageWarnings.has(pjsonPath + "|" + match)) - return; - emittedPackageWarnings.add(pjsonPath + "|" + match); - process.emitWarning( - `Use of deprecated trailing slash pattern mapping "${match}" in the "exports" field module resolution of the package at ${pjsonPath}${base ? ` imported from ${url.fileURLToPath(base)}` : ""}. Mapping specifiers ending in "/" is no longer supported.`, - "DeprecationWarning", - "DEP0155" - ); -} -function packageExportsResolve({ - packageJSONUrl, - packageSubpath, - exports, - base, - conditions -}) { - if (isConditionalExportsMainSugar(exports, packageJSONUrl, base)) - exports = { ".": exports }; - if (ObjectPrototypeHasOwnProperty(exports, packageSubpath) && !StringPrototypeIncludes(packageSubpath, "*") && !StringPrototypeEndsWith(packageSubpath, "/")) { - const target = exports[packageSubpath]; - const resolveResult = resolvePackageTarget( - packageJSONUrl, - target, - "", - packageSubpath, - base, - false, - false, - conditions - ); - if (resolveResult == null) { - throwExportsNotFound(packageSubpath, packageJSONUrl, base); - } - return resolveResult; - } - let bestMatch = ""; - let bestMatchSubpath; - const keys = ObjectGetOwnPropertyNames(exports); - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - const patternIndex = StringPrototypeIndexOf(key, "*"); - if (patternIndex !== -1 && StringPrototypeStartsWith( - packageSubpath, - StringPrototypeSlice(key, 0, patternIndex) - )) { - if (StringPrototypeEndsWith(packageSubpath, "/")) - emitTrailingSlashPatternDeprecation( - packageSubpath, - packageJSONUrl, - base - ); - const patternTrailer = StringPrototypeSlice(key, patternIndex + 1); - if (packageSubpath.length >= key.length && StringPrototypeEndsWith(packageSubpath, patternTrailer) && patternKeyCompare(bestMatch, key) === 1 && StringPrototypeLastIndexOf(key, "*") === patternIndex) { - bestMatch = key; - bestMatchSubpath = StringPrototypeSlice( - packageSubpath, - patternIndex, - packageSubpath.length - patternTrailer.length - ); - } - } - } - if (bestMatch) { - const target = exports[bestMatch]; - const resolveResult = resolvePackageTarget( - packageJSONUrl, - target, - bestMatchSubpath, - bestMatch, - base, - true, - false, - conditions - ); - if (resolveResult == null) { - throwExportsNotFound(packageSubpath, packageJSONUrl, base); - } - return resolveResult; - } - throwExportsNotFound(packageSubpath, packageJSONUrl, base); -} -function packageImportsResolve({ name, base, conditions, readFileSyncFn }) { - if (name === "#" || StringPrototypeStartsWith(name, "#/") || StringPrototypeEndsWith(name, "/")) { - const reason = "is not a valid internal imports specifier name"; - throw new ERR_INVALID_MODULE_SPECIFIER(name, reason, url.fileURLToPath(base)); - } - let packageJSONUrl; - const packageConfig = getPackageScopeConfig(base, readFileSyncFn); - if (packageConfig.exists) { - packageJSONUrl = url.pathToFileURL(packageConfig.pjsonPath); - const imports = packageConfig.imports; - if (imports) { - if (ObjectPrototypeHasOwnProperty(imports, name) && !StringPrototypeIncludes(name, "*")) { - const resolveResult = resolvePackageTarget( - packageJSONUrl, - imports[name], - "", - name, - base, - false, - true, - conditions - ); - if (resolveResult != null) { - return resolveResult; - } - } else { - let bestMatch = ""; - let bestMatchSubpath; - const keys = ObjectGetOwnPropertyNames(imports); - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - const patternIndex = StringPrototypeIndexOf(key, "*"); - if (patternIndex !== -1 && StringPrototypeStartsWith( - name, - StringPrototypeSlice(key, 0, patternIndex) - )) { - const patternTrailer = StringPrototypeSlice(key, patternIndex + 1); - if (name.length >= key.length && StringPrototypeEndsWith(name, patternTrailer) && patternKeyCompare(bestMatch, key) === 1 && StringPrototypeLastIndexOf(key, "*") === patternIndex) { - bestMatch = key; - bestMatchSubpath = StringPrototypeSlice( - name, - patternIndex, - name.length - patternTrailer.length - ); - } - } - } - if (bestMatch) { - const target = imports[bestMatch]; - const resolveResult = resolvePackageTarget( - packageJSONUrl, - target, - bestMatchSubpath, - bestMatch, - base, - true, - true, - conditions - ); - if (resolveResult != null) { - return resolveResult; - } - } - } - } - } - throwImportNotDefined(name, packageJSONUrl, base); -} - -const flagSymbol = Symbol('arg flag'); - -class ArgError extends Error { - constructor(msg, code) { - super(msg); - this.name = 'ArgError'; - this.code = code; - - Object.setPrototypeOf(this, ArgError.prototype); - } -} - -function arg( - opts, - { - argv = process.argv.slice(2), - permissive = false, - stopAtPositional = false - } = {} -) { - if (!opts) { - throw new ArgError( - 'argument specification object is required', - 'ARG_CONFIG_NO_SPEC' - ); - } - - const result = { _: [] }; - - const aliases = {}; - const handlers = {}; - - for (const key of Object.keys(opts)) { - if (!key) { - throw new ArgError( - 'argument key cannot be an empty string', - 'ARG_CONFIG_EMPTY_KEY' - ); - } - - if (key[0] !== '-') { - throw new ArgError( - `argument key must start with '-' but found: '${key}'`, - 'ARG_CONFIG_NONOPT_KEY' - ); - } - - if (key.length === 1) { - throw new ArgError( - `argument key must have a name; singular '-' keys are not allowed: ${key}`, - 'ARG_CONFIG_NONAME_KEY' - ); - } - - if (typeof opts[key] === 'string') { - aliases[key] = opts[key]; - continue; - } - - let type = opts[key]; - let isFlag = false; - - if ( - Array.isArray(type) && - type.length === 1 && - typeof type[0] === 'function' - ) { - const [fn] = type; - type = (value, name, prev = []) => { - prev.push(fn(value, name, prev[prev.length - 1])); - return prev; - }; - isFlag = fn === Boolean || fn[flagSymbol] === true; - } else if (typeof type === 'function') { - isFlag = type === Boolean || type[flagSymbol] === true; - } else { - throw new ArgError( - `type missing or not a function or valid array type: ${key}`, - 'ARG_CONFIG_VAD_TYPE' - ); - } - - if (key[1] !== '-' && key.length > 2) { - throw new ArgError( - `short argument keys (with a single hyphen) must have only one character: ${key}`, - 'ARG_CONFIG_SHORTOPT_TOOLONG' - ); - } - - handlers[key] = [type, isFlag]; - } - - for (let i = 0, len = argv.length; i < len; i++) { - const wholeArg = argv[i]; - - if (stopAtPositional && result._.length > 0) { - result._ = result._.concat(argv.slice(i)); - break; - } - - if (wholeArg === '--') { - result._ = result._.concat(argv.slice(i + 1)); - break; - } - - if (wholeArg.length > 1 && wholeArg[0] === '-') { - /* eslint-disable operator-linebreak */ - const separatedArguments = - wholeArg[1] === '-' || wholeArg.length === 2 - ? [wholeArg] - : wholeArg - .slice(1) - .split('') - .map((a) => `-${a}`); - /* eslint-enable operator-linebreak */ - - for (let j = 0; j < separatedArguments.length; j++) { - const arg = separatedArguments[j]; - const [originalArgName, argStr] = - arg[1] === '-' ? arg.split(/=(.*)/, 2) : [arg, undefined]; - - let argName = originalArgName; - while (argName in aliases) { - argName = aliases[argName]; - } - - if (!(argName in handlers)) { - if (permissive) { - result._.push(arg); - continue; - } else { - throw new ArgError( - `unknown or unexpected option: ${originalArgName}`, - 'ARG_UNKNOWN_OPTION' - ); - } - } - - const [type, isFlag] = handlers[argName]; - - if (!isFlag && j + 1 < separatedArguments.length) { - throw new ArgError( - `option requires argument (but was followed by another short argument): ${originalArgName}`, - 'ARG_MISSING_REQUIRED_SHORTARG' - ); - } - - if (isFlag) { - result[argName] = type(true, argName, result[argName]); - } else if (argStr === undefined) { - if ( - argv.length < i + 2 || - (argv[i + 1].length > 1 && - argv[i + 1][0] === '-' && - !( - argv[i + 1].match(/^-?\d*(\.(?=\d))?\d*$/) && - (type === Number || - // eslint-disable-next-line no-undef - (typeof BigInt !== 'undefined' && type === BigInt)) - )) - ) { - const extended = - originalArgName === argName ? '' : ` (alias for ${argName})`; - throw new ArgError( - `option requires argument: ${originalArgName}${extended}`, - 'ARG_MISSING_REQUIRED_LONGARG' - ); - } - - result[argName] = type(argv[i + 1], argName, result[argName]); - ++i; - } else { - result[argName] = type(argStr, argName, result[argName]); - } - } - } else { - result._.push(wholeArg); - } - } - - return result; -} - -arg.flag = (fn) => { - fn[flagSymbol] = true; - return fn; -}; - -// Utility types -arg.COUNT = arg.flag((v, name, existingCount) => (existingCount || 0) + 1); - -// Expose error class -arg.ArgError = ArgError; - -var arg_1 = arg; - -/** - @license - The MIT License (MIT) - - Copyright (c) 2014 Blake Embrey (hello@blakeembrey.com) - - 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. -*/ -function getOptionValue(opt) { - parseOptions(); - return options[opt]; -} -let options; -function parseOptions() { - if (!options) { - options = { - "--conditions": [], - ...parseArgv(getNodeOptionsEnvArgv()), - ...parseArgv(process.execArgv) - }; - } -} -function parseArgv(argv) { - return arg_1( - { - "--conditions": [String], - "-C": "--conditions" - }, - { - argv, - permissive: true - } - ); -} -function getNodeOptionsEnvArgv() { - const errors = []; - const envArgv = ParseNodeOptionsEnvVar(process.env.NODE_OPTIONS || "", errors); - if (errors.length !== 0) ; - return envArgv; -} -function ParseNodeOptionsEnvVar(node_options, errors) { - const env_argv = []; - let is_in_string = false; - let will_start_new_arg = true; - for (let index = 0; index < node_options.length; ++index) { - let c = node_options[index]; - if (c === "\\" && is_in_string) { - if (index + 1 === node_options.length) { - errors.push("invalid value for NODE_OPTIONS (invalid escape)\n"); - return env_argv; - } else { - c = node_options[++index]; - } - } else if (c === " " && !is_in_string) { - will_start_new_arg = true; - continue; - } else if (c === '"') { - is_in_string = !is_in_string; - continue; - } - if (will_start_new_arg) { - env_argv.push(c); - will_start_new_arg = false; - } else { - env_argv[env_argv.length - 1] += c; - } - } - if (is_in_string) { - errors.push("invalid value for NODE_OPTIONS (unterminated string)\n"); - } - return env_argv; -} - -function makeApi(runtimeState, opts) { - const alwaysWarnOnFallback = Number(process.env.PNP_ALWAYS_WARN_ON_FALLBACK) > 0; - const debugLevel = Number(process.env.PNP_DEBUG_LEVEL); - const pathRegExp = /^(?![a-zA-Z]:[\\/]|\\\\|\.{0,2}(?:\/|$))((?:node:)?(?:@[^/]+\/)?[^/]+)\/*(.*|)$/; - const isStrictRegExp = /^(\/|\.{1,2}(\/|$))/; - const isDirRegExp = /\/$/; - const isRelativeRegexp = /^\.{0,2}\//; - const topLevelLocator = { name: null, reference: null }; - const fallbackLocators = []; - const emittedWarnings = /* @__PURE__ */ new Set(); - if (runtimeState.enableTopLevelFallback === true) - fallbackLocators.push(topLevelLocator); - if (opts.compatibilityMode !== false) { - for (const name of [`react-scripts`, `gatsby`]) { - const packageStore = runtimeState.packageRegistry.get(name); - if (packageStore) { - for (const reference of packageStore.keys()) { - if (reference === null) { - throw new Error(`Assertion failed: This reference shouldn't be null`); - } else { - fallbackLocators.push({ name, reference }); - } - } - } - } - } - const { - ignorePattern, - packageRegistry, - packageLocatorsByLocations - } = runtimeState; - function makeLogEntry(name, args) { - return { - fn: name, - args, - error: null, - result: null - }; - } - function trace(entry) { - const colors = process.stderr?.hasColors?.() ?? process.stdout.isTTY; - const c = (n, str) => `\x1B[${n}m${str}\x1B[0m`; - const error = entry.error; - if (error) - console.error(c(`31;1`, `\u2716 ${entry.error?.message.replace(/\n.*/s, ``)}`)); - else - console.error(c(`33;1`, `\u203C Resolution`)); - if (entry.args.length > 0) - console.error(); - for (const arg of entry.args) - console.error(` ${c(`37;1`, `In \u2190`)} ${nodeUtils.inspect(arg, { colors, compact: true })}`); - if (entry.result) { - console.error(); - console.error(` ${c(`37;1`, `Out \u2192`)} ${nodeUtils.inspect(entry.result, { colors, compact: true })}`); - } - const stack = new Error().stack.match(/(?<=^ +)at.*/gm)?.slice(2) ?? []; - if (stack.length > 0) { - console.error(); - for (const line of stack) { - console.error(` ${c(`38;5;244`, line)}`); - } - } - console.error(); - } - function maybeLog(name, fn) { - if (opts.allowDebug === false) - return fn; - if (Number.isFinite(debugLevel)) { - if (debugLevel >= 2) { - return (...args) => { - const logEntry = makeLogEntry(name, args); - try { - return logEntry.result = fn(...args); - } catch (error) { - throw logEntry.error = error; - } finally { - trace(logEntry); - } - }; - } else if (debugLevel >= 1) { - return (...args) => { - try { - return fn(...args); - } catch (error) { - const logEntry = makeLogEntry(name, args); - logEntry.error = error; - trace(logEntry); - throw error; - } - }; - } - } - return fn; - } - function getPackageInformationSafe(packageLocator) { - const packageInformation = getPackageInformation(packageLocator); - if (!packageInformation) { - throw makeError( - ErrorCode.INTERNAL, - `Couldn't find a matching entry in the dependency tree for the specified parent (this is probably an internal error)` - ); - } - return packageInformation; - } - function isDependencyTreeRoot(packageLocator) { - if (packageLocator.name === null) - return true; - for (const dependencyTreeRoot of runtimeState.dependencyTreeRoots) - if (dependencyTreeRoot.name === packageLocator.name && dependencyTreeRoot.reference === packageLocator.reference) - return true; - return false; - } - const defaultExportsConditions = /* @__PURE__ */ new Set([ - `node`, - `require`, - ...getOptionValue(`--conditions`) - ]); - function applyNodeExportsResolution(unqualifiedPath, conditions = defaultExportsConditions, issuer) { - const locator = findPackageLocator(ppath.join(unqualifiedPath, `internal.js`), { - resolveIgnored: true, - includeDiscardFromLookup: true - }); - if (locator === null) { - throw makeError( - ErrorCode.INTERNAL, - `The locator that owns the "${unqualifiedPath}" path can't be found inside the dependency tree (this is probably an internal error)` - ); - } - const { packageLocation } = getPackageInformationSafe(locator); - const manifestPath = ppath.join(packageLocation, Filename.manifest); - if (!opts.fakeFs.existsSync(manifestPath)) - return null; - const pkgJson = JSON.parse(opts.fakeFs.readFileSync(manifestPath, `utf8`)); - if (pkgJson.exports == null) - return null; - let subpath = ppath.contains(packageLocation, unqualifiedPath); - if (subpath === null) { - throw makeError( - ErrorCode.INTERNAL, - `unqualifiedPath doesn't contain the packageLocation (this is probably an internal error)` - ); - } - if (subpath !== `.` && !isRelativeRegexp.test(subpath)) - subpath = `./${subpath}`; - try { - const resolvedExport = packageExportsResolve({ - packageJSONUrl: url.pathToFileURL(npath.fromPortablePath(manifestPath)), - packageSubpath: subpath, - exports: pkgJson.exports, - base: issuer ? url.pathToFileURL(npath.fromPortablePath(issuer)) : null, - conditions - }); - return npath.toPortablePath(url.fileURLToPath(resolvedExport)); - } catch (error) { - throw makeError( - ErrorCode.EXPORTS_RESOLUTION_FAILED, - error.message, - { unqualifiedPath: getPathForDisplay(unqualifiedPath), locator, pkgJson, subpath: getPathForDisplay(subpath), conditions }, - error.code - ); - } - } - function applyNodeExtensionResolution(unqualifiedPath, candidates, { extensions }) { - let stat; - try { - candidates.push(unqualifiedPath); - stat = opts.fakeFs.statSync(unqualifiedPath); - } catch (error) { - } - if (stat && !stat.isDirectory()) - return opts.fakeFs.realpathSync(unqualifiedPath); - if (stat && stat.isDirectory()) { - let pkgJson; - try { - pkgJson = JSON.parse(opts.fakeFs.readFileSync(ppath.join(unqualifiedPath, Filename.manifest), `utf8`)); - } catch (error) { - } - let nextUnqualifiedPath; - if (pkgJson && pkgJson.main) - nextUnqualifiedPath = ppath.resolve(unqualifiedPath, pkgJson.main); - if (nextUnqualifiedPath && nextUnqualifiedPath !== unqualifiedPath) { - const resolution = applyNodeExtensionResolution(nextUnqualifiedPath, candidates, { extensions }); - if (resolution !== null) { - return resolution; - } - } - } - for (let i = 0, length = extensions.length; i < length; i++) { - const candidateFile = `${unqualifiedPath}${extensions[i]}`; - candidates.push(candidateFile); - if (opts.fakeFs.existsSync(candidateFile)) { - return candidateFile; - } - } - if (stat && stat.isDirectory()) { - for (let i = 0, length = extensions.length; i < length; i++) { - const candidateFile = ppath.format({ dir: unqualifiedPath, name: `index`, ext: extensions[i] }); - candidates.push(candidateFile); - if (opts.fakeFs.existsSync(candidateFile)) { - return candidateFile; - } - } - } - return null; - } - function makeFakeModule(path) { - const fakeModule = new require$$0.Module(path, null); - fakeModule.filename = path; - fakeModule.paths = require$$0.Module._nodeModulePaths(path); - return fakeModule; - } - function callNativeResolution(request, issuer) { - if (issuer.endsWith(`/`)) - issuer = ppath.join(issuer, `internal.js`); - return require$$0.Module._resolveFilename(npath.fromPortablePath(request), makeFakeModule(npath.fromPortablePath(issuer)), false, { plugnplay: false }); - } - function isPathIgnored(path) { - if (ignorePattern === null) - return false; - const subPath = ppath.contains(runtimeState.basePath, path); - if (subPath === null) - return false; - if (ignorePattern.test(subPath.replace(/\/$/, ``))) { - return true; - } else { - return false; - } - } - const VERSIONS = { std: 3, resolveVirtual: 1, getAllLocators: 1 }; - const topLevel = topLevelLocator; - function getPackageInformation({ name, reference }) { - const packageInformationStore = packageRegistry.get(name); - if (!packageInformationStore) - return null; - const packageInformation = packageInformationStore.get(reference); - if (!packageInformation) - return null; - return packageInformation; - } - function findPackageDependents({ name, reference }) { - const dependents = []; - for (const [dependentName, packageInformationStore] of packageRegistry) { - if (dependentName === null) - continue; - for (const [dependentReference, packageInformation] of packageInformationStore) { - if (dependentReference === null) - continue; - const dependencyReference = packageInformation.packageDependencies.get(name); - if (dependencyReference !== reference) - continue; - if (dependentName === name && dependentReference === reference) - continue; - dependents.push({ - name: dependentName, - reference: dependentReference - }); - } - } - return dependents; - } - function findBrokenPeerDependencies(dependency, initialPackage) { - const brokenPackages = /* @__PURE__ */ new Map(); - const alreadyVisited = /* @__PURE__ */ new Set(); - const traversal = (currentPackage) => { - const identifier = JSON.stringify(currentPackage.name); - if (alreadyVisited.has(identifier)) - return; - alreadyVisited.add(identifier); - const dependents = findPackageDependents(currentPackage); - for (const dependent of dependents) { - const dependentInformation = getPackageInformationSafe(dependent); - if (dependentInformation.packagePeers.has(dependency)) { - traversal(dependent); - } else { - let brokenSet = brokenPackages.get(dependent.name); - if (typeof brokenSet === `undefined`) - brokenPackages.set(dependent.name, brokenSet = /* @__PURE__ */ new Set()); - brokenSet.add(dependent.reference); - } - } - }; - traversal(initialPackage); - const brokenList = []; - for (const name of [...brokenPackages.keys()].sort()) - for (const reference of [...brokenPackages.get(name)].sort()) - brokenList.push({ name, reference }); - return brokenList; - } - function findPackageLocator(location, { resolveIgnored = false, includeDiscardFromLookup = false } = {}) { - if (isPathIgnored(location) && !resolveIgnored) - return null; - let relativeLocation = ppath.relative(runtimeState.basePath, location); - if (!relativeLocation.match(isStrictRegExp)) - relativeLocation = `./${relativeLocation}`; - if (!relativeLocation.endsWith(`/`)) - relativeLocation = `${relativeLocation}/`; - do { - const entry = packageLocatorsByLocations.get(relativeLocation); - if (typeof entry === `undefined` || entry.discardFromLookup && !includeDiscardFromLookup) { - relativeLocation = relativeLocation.substring(0, relativeLocation.lastIndexOf(`/`, relativeLocation.length - 2) + 1); - continue; - } - return entry.locator; - } while (relativeLocation !== ``); - return null; - } - function tryReadFile(filePath) { - try { - return opts.fakeFs.readFileSync(npath.toPortablePath(filePath), `utf8`); - } catch (err) { - if (err.code === `ENOENT`) - return void 0; - throw err; - } - } - function resolveToUnqualified(request, issuer, { considerBuiltins = true } = {}) { - if (request.startsWith(`#`)) - throw new Error(`resolveToUnqualified can not handle private import mappings`); - if (request === `pnpapi`) - return npath.toPortablePath(opts.pnpapiResolution); - if (considerBuiltins && require$$0.isBuiltin(request)) - return null; - const requestForDisplay = getPathForDisplay(request); - const issuerForDisplay = issuer && getPathForDisplay(issuer); - if (issuer && isPathIgnored(issuer)) { - if (!ppath.isAbsolute(request) || findPackageLocator(request) === null) { - const result = callNativeResolution(request, issuer); - if (result === false) { - throw makeError( - ErrorCode.BUILTIN_NODE_RESOLUTION_FAILED, - `The builtin node resolution algorithm was unable to resolve the requested module (it didn't go through the pnp resolver because the issuer was explicitely ignored by the regexp) - -Require request: "${requestForDisplay}" -Required by: ${issuerForDisplay} -`, - { request: requestForDisplay, issuer: issuerForDisplay } - ); - } - return npath.toPortablePath(result); - } - } - let unqualifiedPath; - const dependencyNameMatch = request.match(pathRegExp); - if (!dependencyNameMatch) { - if (ppath.isAbsolute(request)) { - unqualifiedPath = ppath.normalize(request); - } else { - if (!issuer) { - throw makeError( - ErrorCode.API_ERROR, - `The resolveToUnqualified function must be called with a valid issuer when the path isn't a builtin nor absolute`, - { request: requestForDisplay, issuer: issuerForDisplay } - ); - } - const absoluteIssuer = ppath.resolve(issuer); - if (issuer.match(isDirRegExp)) { - unqualifiedPath = ppath.normalize(ppath.join(absoluteIssuer, request)); - } else { - unqualifiedPath = ppath.normalize(ppath.join(ppath.dirname(absoluteIssuer), request)); - } - } - } else { - if (!issuer) { - throw makeError( - ErrorCode.API_ERROR, - `The resolveToUnqualified function must be called with a valid issuer when the path isn't a builtin nor absolute`, - { request: requestForDisplay, issuer: issuerForDisplay } - ); - } - const [, dependencyName, subPath] = dependencyNameMatch; - const issuerLocator = findPackageLocator(issuer); - if (!issuerLocator) { - const result = callNativeResolution(request, issuer); - if (result === false) { - throw makeError( - ErrorCode.BUILTIN_NODE_RESOLUTION_FAILED, - `The builtin node resolution algorithm was unable to resolve the requested module (it didn't go through the pnp resolver because the issuer doesn't seem to be part of the Yarn-managed dependency tree). - -Require path: "${requestForDisplay}" -Required by: ${issuerForDisplay} -`, - { request: requestForDisplay, issuer: issuerForDisplay } - ); - } - return npath.toPortablePath(result); - } - const issuerInformation = getPackageInformationSafe(issuerLocator); - let dependencyReference = issuerInformation.packageDependencies.get(dependencyName); - let fallbackReference = null; - if (dependencyReference == null) { - if (issuerLocator.name !== null) { - const exclusionEntry = runtimeState.fallbackExclusionList.get(issuerLocator.name); - const canUseFallbacks = !exclusionEntry || !exclusionEntry.has(issuerLocator.reference); - if (canUseFallbacks) { - for (let t = 0, T = fallbackLocators.length; t < T; ++t) { - const fallbackInformation = getPackageInformationSafe(fallbackLocators[t]); - const reference = fallbackInformation.packageDependencies.get(dependencyName); - if (reference == null) - continue; - if (alwaysWarnOnFallback) - fallbackReference = reference; - else - dependencyReference = reference; - break; - } - if (runtimeState.enableTopLevelFallback) { - if (dependencyReference == null && fallbackReference === null) { - const reference = runtimeState.fallbackPool.get(dependencyName); - if (reference != null) { - fallbackReference = reference; - } - } - } - } - } - } - let error = null; - if (dependencyReference === null) { - if (isDependencyTreeRoot(issuerLocator)) { - error = makeError( - ErrorCode.MISSING_PEER_DEPENDENCY, - `Your application tried to access ${dependencyName} (a peer dependency); this isn't allowed as there is no ancestor to satisfy the requirement. Use a devDependency if needed. - -Required package: ${dependencyName}${dependencyName !== requestForDisplay ? ` (via "${requestForDisplay}")` : ``} -Required by: ${issuerForDisplay} -`, - { request: requestForDisplay, issuer: issuerForDisplay, dependencyName } - ); - } else { - const brokenAncestors = findBrokenPeerDependencies(dependencyName, issuerLocator); - if (brokenAncestors.every((ancestor) => isDependencyTreeRoot(ancestor))) { - error = makeError( - ErrorCode.MISSING_PEER_DEPENDENCY, - `${issuerLocator.name} tried to access ${dependencyName} (a peer dependency) but it isn't provided by your application; this makes the require call ambiguous and unsound. - -Required package: ${dependencyName}${dependencyName !== requestForDisplay ? ` (via "${requestForDisplay}")` : ``} -Required by: ${issuerLocator.name}@${issuerLocator.reference} (via ${issuerForDisplay}) -${brokenAncestors.map((ancestorLocator) => `Ancestor breaking the chain: ${ancestorLocator.name}@${ancestorLocator.reference} -`).join(``)} -`, - { request: requestForDisplay, issuer: issuerForDisplay, issuerLocator: Object.assign({}, issuerLocator), dependencyName, brokenAncestors } - ); - } else { - error = makeError( - ErrorCode.MISSING_PEER_DEPENDENCY, - `${issuerLocator.name} tried to access ${dependencyName} (a peer dependency) but it isn't provided by its ancestors; this makes the require call ambiguous and unsound. - -Required package: ${dependencyName}${dependencyName !== requestForDisplay ? ` (via "${requestForDisplay}")` : ``} -Required by: ${issuerLocator.name}@${issuerLocator.reference} (via ${issuerForDisplay}) - -${brokenAncestors.map((ancestorLocator) => `Ancestor breaking the chain: ${ancestorLocator.name}@${ancestorLocator.reference} -`).join(``)} -`, - { request: requestForDisplay, issuer: issuerForDisplay, issuerLocator: Object.assign({}, issuerLocator), dependencyName, brokenAncestors } - ); - } - } - } else if (dependencyReference === void 0) { - if (!considerBuiltins && require$$0.isBuiltin(request)) { - if (isDependencyTreeRoot(issuerLocator)) { - error = makeError( - ErrorCode.UNDECLARED_DEPENDENCY, - `Your application tried to access ${dependencyName}. While this module is usually interpreted as a Node builtin, your resolver is running inside a non-Node resolution context where such builtins are ignored. Since ${dependencyName} isn't otherwise declared in your dependencies, this makes the require call ambiguous and unsound. - -Required package: ${dependencyName}${dependencyName !== requestForDisplay ? ` (via "${requestForDisplay}")` : ``} -Required by: ${issuerForDisplay} -`, - { request: requestForDisplay, issuer: issuerForDisplay, dependencyName } - ); - } else { - error = makeError( - ErrorCode.UNDECLARED_DEPENDENCY, - `${issuerLocator.name} tried to access ${dependencyName}. While this module is usually interpreted as a Node builtin, your resolver is running inside a non-Node resolution context where such builtins are ignored. Since ${dependencyName} isn't otherwise declared in ${issuerLocator.name}'s dependencies, this makes the require call ambiguous and unsound. - -Required package: ${dependencyName}${dependencyName !== requestForDisplay ? ` (via "${requestForDisplay}")` : ``} -Required by: ${issuerForDisplay} -`, - { request: requestForDisplay, issuer: issuerForDisplay, issuerLocator: Object.assign({}, issuerLocator), dependencyName } - ); - } - } else { - if (isDependencyTreeRoot(issuerLocator)) { - error = makeError( - ErrorCode.UNDECLARED_DEPENDENCY, - `Your application tried to access ${dependencyName}, but it isn't declared in your dependencies; this makes the require call ambiguous and unsound. - -Required package: ${dependencyName}${dependencyName !== requestForDisplay ? ` (via "${requestForDisplay}")` : ``} -Required by: ${issuerForDisplay} -`, - { request: requestForDisplay, issuer: issuerForDisplay, dependencyName } - ); - } else { - error = makeError( - ErrorCode.UNDECLARED_DEPENDENCY, - `${issuerLocator.name} tried to access ${dependencyName}, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound. - -Required package: ${dependencyName}${dependencyName !== requestForDisplay ? ` (via "${requestForDisplay}")` : ``} -Required by: ${issuerLocator.name}@${issuerLocator.reference} (via ${issuerForDisplay}) -`, - { request: requestForDisplay, issuer: issuerForDisplay, issuerLocator: Object.assign({}, issuerLocator), dependencyName } - ); - } - } - } - if (dependencyReference == null) { - if (fallbackReference === null || error === null) - throw error || new Error(`Assertion failed: Expected an error to have been set`); - dependencyReference = fallbackReference; - const message = error.message.replace(/\n.*/g, ``); - error.message = message; - if (!emittedWarnings.has(message) && debugLevel !== 0) { - emittedWarnings.add(message); - process.emitWarning(error); - } - } - const dependencyLocator = Array.isArray(dependencyReference) ? { name: dependencyReference[0], reference: dependencyReference[1] } : { name: dependencyName, reference: dependencyReference }; - const dependencyInformation = getPackageInformationSafe(dependencyLocator); - if (!dependencyInformation.packageLocation) { - throw makeError( - ErrorCode.MISSING_DEPENDENCY, - `A dependency seems valid but didn't get installed for some reason. This might be caused by a partial install, such as dev vs prod. - -Required package: ${dependencyLocator.name}@${dependencyLocator.reference}${dependencyLocator.name !== requestForDisplay ? ` (via "${requestForDisplay}")` : ``} -Required by: ${issuerLocator.name}@${issuerLocator.reference} (via ${issuerForDisplay}) -`, - { request: requestForDisplay, issuer: issuerForDisplay, dependencyLocator: Object.assign({}, dependencyLocator) } - ); - } - const dependencyLocation = dependencyInformation.packageLocation; - if (subPath) { - unqualifiedPath = ppath.join(dependencyLocation, subPath); - } else { - unqualifiedPath = dependencyLocation; - } - } - return ppath.normalize(unqualifiedPath); - } - function resolveUnqualifiedExport(request, unqualifiedPath, conditions = defaultExportsConditions, issuer) { - if (isStrictRegExp.test(request)) - return unqualifiedPath; - const unqualifiedExportPath = applyNodeExportsResolution(unqualifiedPath, conditions, issuer); - if (unqualifiedExportPath) { - return ppath.normalize(unqualifiedExportPath); - } else { - return unqualifiedPath; - } - } - function resolveUnqualified(unqualifiedPath, { extensions = Object.keys(require$$0.Module._extensions) } = {}) { - const candidates = []; - const qualifiedPath = applyNodeExtensionResolution(unqualifiedPath, candidates, { extensions }); - if (qualifiedPath) { - return ppath.normalize(qualifiedPath); - } else { - reportRequiredFilesToWatchMode(candidates.map((candidate) => npath.fromPortablePath(candidate))); - const unqualifiedPathForDisplay = getPathForDisplay(unqualifiedPath); - const containingPackage = findPackageLocator(unqualifiedPath); - if (containingPackage) { - const { packageLocation } = getPackageInformationSafe(containingPackage); - let exists = true; - try { - opts.fakeFs.accessSync(packageLocation); - } catch (err) { - if (err?.code === `ENOENT`) { - exists = false; - } else { - const readableError = (err?.message ?? err ?? `empty exception thrown`).replace(/^[A-Z]/, ($0) => $0.toLowerCase()); - throw makeError(ErrorCode.QUALIFIED_PATH_RESOLUTION_FAILED, `Required package exists but could not be accessed (${readableError}). - -Missing package: ${containingPackage.name}@${containingPackage.reference} -Expected package location: ${getPathForDisplay(packageLocation)} -`, { unqualifiedPath: unqualifiedPathForDisplay, extensions }); - } - } - if (!exists) { - const errorMessage = packageLocation.includes(`/unplugged/`) ? `Required unplugged package missing from disk. This may happen when switching branches without running installs (unplugged packages must be fully materialized on disk to work).` : `Required package missing from disk. If you keep your packages inside your repository then restarting the Node process may be enough. Otherwise, try to run an install first.`; - throw makeError( - ErrorCode.QUALIFIED_PATH_RESOLUTION_FAILED, - `${errorMessage} - -Missing package: ${containingPackage.name}@${containingPackage.reference} -Expected package location: ${getPathForDisplay(packageLocation)} -`, - { unqualifiedPath: unqualifiedPathForDisplay, extensions } - ); - } - } - throw makeError( - ErrorCode.QUALIFIED_PATH_RESOLUTION_FAILED, - `Qualified path resolution failed: we looked for the following paths, but none could be accessed. - -Source path: ${unqualifiedPathForDisplay} -${candidates.map((candidate) => `Not found: ${getPathForDisplay(candidate)} -`).join(``)}`, - { unqualifiedPath: unqualifiedPathForDisplay, extensions } - ); - } - } - function resolvePrivateRequest(request, issuer, opts2) { - if (!issuer) - throw new Error(`Assertion failed: An issuer is required to resolve private import mappings`); - const resolved = packageImportsResolve({ - name: request, - base: url.pathToFileURL(npath.fromPortablePath(issuer)), - conditions: opts2.conditions ?? defaultExportsConditions, - readFileSyncFn: tryReadFile - }); - if (resolved instanceof URL) { - return resolveUnqualified(npath.toPortablePath(url.fileURLToPath(resolved)), { extensions: opts2.extensions }); - } else { - if (resolved.startsWith(`#`)) - throw new Error(`Mapping from one private import to another isn't allowed`); - return resolveRequest(resolved, issuer, opts2); - } - } - function resolveRequest(request, issuer, opts2 = {}) { - try { - if (request.startsWith(`#`)) - return resolvePrivateRequest(request, issuer, opts2); - const { considerBuiltins, extensions, conditions } = opts2; - const unqualifiedPath = resolveToUnqualified(request, issuer, { considerBuiltins }); - if (request === `pnpapi`) - return unqualifiedPath; - if (unqualifiedPath === null) - return null; - const isIssuerIgnored = () => issuer !== null ? isPathIgnored(issuer) : false; - const remappedPath = (!considerBuiltins || !require$$0.isBuiltin(request)) && !isIssuerIgnored() ? resolveUnqualifiedExport(request, unqualifiedPath, conditions, issuer) : unqualifiedPath; - return resolveUnqualified(remappedPath, { extensions }); - } catch (error) { - if (Object.hasOwn(error, `pnpCode`)) - Object.assign(error.data, { request: getPathForDisplay(request), issuer: issuer && getPathForDisplay(issuer) }); - throw error; - } - } - function resolveVirtual(request) { - const normalized = ppath.normalize(request); - const resolved = VirtualFS.resolveVirtual(normalized); - return resolved !== normalized ? resolved : null; - } - return { - VERSIONS, - topLevel, - getLocator: (name, referencish) => { - if (Array.isArray(referencish)) { - return { name: referencish[0], reference: referencish[1] }; - } else { - return { name, reference: referencish }; - } - }, - getDependencyTreeRoots: () => { - return [...runtimeState.dependencyTreeRoots]; - }, - getAllLocators() { - const locators = []; - for (const [name, entry] of packageRegistry) - for (const reference of entry.keys()) - if (name !== null && reference !== null) - locators.push({ name, reference }); - return locators; - }, - getPackageInformation: (locator) => { - const info = getPackageInformation(locator); - if (info === null) - return null; - const packageLocation = npath.fromPortablePath(info.packageLocation); - const nativeInfo = { ...info, packageLocation }; - return nativeInfo; - }, - findPackageLocator: (path) => { - return findPackageLocator(npath.toPortablePath(path)); - }, - resolveToUnqualified: maybeLog(`resolveToUnqualified`, (request, issuer, opts2) => { - const portableIssuer = issuer !== null ? npath.toPortablePath(issuer) : null; - const resolution = resolveToUnqualified(npath.toPortablePath(request), portableIssuer, opts2); - if (resolution === null) - return null; - return npath.fromPortablePath(resolution); - }), - resolveUnqualified: maybeLog(`resolveUnqualified`, (unqualifiedPath, opts2) => { - return npath.fromPortablePath(resolveUnqualified(npath.toPortablePath(unqualifiedPath), opts2)); - }), - resolveRequest: maybeLog(`resolveRequest`, (request, issuer, opts2) => { - const portableIssuer = issuer !== null ? npath.toPortablePath(issuer) : null; - const resolution = resolveRequest(npath.toPortablePath(request), portableIssuer, opts2); - if (resolution === null) - return null; - return npath.fromPortablePath(resolution); - }), - resolveVirtual: maybeLog(`resolveVirtual`, (path) => { - const result = resolveVirtual(npath.toPortablePath(path)); - if (result !== null) { - return npath.fromPortablePath(result); - } else { - return null; - } - }) - }; -} - -function makeManager(pnpapi, opts) { - const initialApiPath = npath.toPortablePath(pnpapi.resolveToUnqualified(`pnpapi`, null)); - const initialApiStats = opts.fakeFs.statSync(npath.toPortablePath(initialApiPath)); - const apiMetadata = /* @__PURE__ */ new Map([ - [initialApiPath, { - instance: pnpapi, - stats: initialApiStats, - lastRefreshCheck: Date.now() - }] - ]); - function loadApiInstance(pnpApiPath) { - const nativePath = npath.fromPortablePath(pnpApiPath); - const module = new require$$0.Module(nativePath, null); - module.load(nativePath); - return module.exports; - } - function refreshApiEntry(pnpApiPath, apiEntry) { - const timeNow = Date.now(); - if (timeNow - apiEntry.lastRefreshCheck < 500) - return; - apiEntry.lastRefreshCheck = timeNow; - const stats = opts.fakeFs.statSync(pnpApiPath); - if (stats.mtime > apiEntry.stats.mtime) { - process.emitWarning(`[Warning] The runtime detected new information in a PnP file; reloading the API instance (${npath.fromPortablePath(pnpApiPath)})`); - apiEntry.stats = stats; - apiEntry.instance = loadApiInstance(pnpApiPath); - } - } - function getApiEntry(pnpApiPath, refresh = false) { - let apiEntry = apiMetadata.get(pnpApiPath); - if (typeof apiEntry !== `undefined`) { - if (refresh) { - refreshApiEntry(pnpApiPath, apiEntry); - } - } else { - apiMetadata.set(pnpApiPath, apiEntry = { - instance: loadApiInstance(pnpApiPath), - stats: opts.fakeFs.statSync(pnpApiPath), - lastRefreshCheck: Date.now() - }); - } - return apiEntry; - } - const findApiPathCache = /* @__PURE__ */ new Map(); - function addToCacheAndReturn(start, end, target) { - if (target !== null) { - target = VirtualFS.resolveVirtual(target); - target = opts.fakeFs.realpathSync(target); - } - let curr; - let next = start; - do { - curr = next; - findApiPathCache.set(curr, target); - next = ppath.dirname(curr); - } while (curr !== end); - return target; - } - function findApiPathFor(modulePath) { - let bestCandidate = null; - for (const [apiPath, apiEntry] of apiMetadata) { - const locator = apiEntry.instance.findPackageLocator(modulePath); - if (!locator) - continue; - if (apiMetadata.size === 1) - return apiPath; - const packageInformation = apiEntry.instance.getPackageInformation(locator); - if (!packageInformation) - throw new Error(`Assertion failed: Couldn't get package information for '${modulePath}'`); - if (!bestCandidate) - bestCandidate = { packageLocation: packageInformation.packageLocation, apiPaths: [] }; - if (packageInformation.packageLocation === bestCandidate.packageLocation) { - bestCandidate.apiPaths.push(apiPath); - } else if (packageInformation.packageLocation.length > bestCandidate.packageLocation.length) { - bestCandidate = { packageLocation: packageInformation.packageLocation, apiPaths: [apiPath] }; - } - } - if (bestCandidate) { - if (bestCandidate.apiPaths.length === 1) - return bestCandidate.apiPaths[0]; - const controlSegment = bestCandidate.apiPaths.map((apiPath) => ` ${npath.fromPortablePath(apiPath)}`).join(` -`); - throw new Error(`Unable to locate pnpapi, the module '${modulePath}' is controlled by multiple pnpapi instances. -This is usually caused by using the global cache (enableGlobalCache: true) - -Controlled by: -${controlSegment} -`); - } - const start = ppath.resolve(npath.toPortablePath(modulePath)); - let curr; - let next = start; - do { - curr = next; - const cached = findApiPathCache.get(curr); - if (cached !== void 0) - return addToCacheAndReturn(start, curr, cached); - const cjsCandidate = ppath.join(curr, Filename.pnpCjs); - if (opts.fakeFs.existsSync(cjsCandidate) && opts.fakeFs.statSync(cjsCandidate).isFile()) - return addToCacheAndReturn(start, curr, cjsCandidate); - const legacyCjsCandidate = ppath.join(curr, Filename.pnpJs); - if (opts.fakeFs.existsSync(legacyCjsCandidate) && opts.fakeFs.statSync(legacyCjsCandidate).isFile()) - return addToCacheAndReturn(start, curr, legacyCjsCandidate); - next = ppath.dirname(curr); - } while (curr !== PortablePath.root); - return addToCacheAndReturn(start, curr, null); - } - const moduleToApiPathCache = /* @__PURE__ */ new WeakMap(); - function getApiPathFromParent(parent) { - if (parent == null) - return initialApiPath; - let apiPath = moduleToApiPathCache.get(parent); - if (typeof apiPath !== `undefined`) - return apiPath; - apiPath = parent.filename ? findApiPathFor(parent.filename) : null; - moduleToApiPathCache.set(parent, apiPath); - return apiPath; - } - return { - getApiPathFromParent, - findApiPathFor, - getApiEntry - }; -} - -const localFs = { ...fs__default.default }; -const nodeFs = new NodeFS(localFs); -const defaultRuntimeState = $$SETUP_STATE(hydrateRuntimeState); -const defaultPnpapiResolution = __filename; -const defaultFsLayer = new VirtualFS({ - baseFs: new ZipOpenFS({ - baseFs: nodeFs, - maxOpenFiles: 80, - readOnlyArchives: true - }) -}); -class DynamicFS extends ProxiedFS { - constructor() { - super(ppath); - this.baseFs = defaultFsLayer; - } - mapToBase(p) { - return p; - } - mapFromBase(p) { - return p; - } -} -const dynamicFsLayer = new DynamicFS(); -let manager; -const defaultApi = Object.assign(makeApi(defaultRuntimeState, { - fakeFs: dynamicFsLayer, - pnpapiResolution: defaultPnpapiResolution -}), { - makeApi: ({ - basePath = void 0, - fakeFs = dynamicFsLayer, - pnpapiResolution = defaultPnpapiResolution, - ...rest - }) => { - const apiRuntimeState = typeof basePath !== `undefined` ? $$SETUP_STATE(hydrateRuntimeState, basePath) : defaultRuntimeState; - return makeApi(apiRuntimeState, { - fakeFs, - pnpapiResolution, - ...rest - }); - }, - setup: (api) => { - applyPatch(api || defaultApi, { - fakeFs: defaultFsLayer, - manager - }); - dynamicFsLayer.baseFs = new NodeFS(fs__default.default); - } -}); -manager = makeManager(defaultApi, { - fakeFs: dynamicFsLayer -}); -if (module.parent && module.parent.id === `internal/preload`) { - defaultApi.setup(); - if (module.filename) { - delete require$$0__default.default._cache[module.filename]; - } -} -if (process.mainModule === module) { - const reportError = (code, message, data) => { - process.stdout.write(`${JSON.stringify([{ code, message, data }, null])} -`); - }; - const reportSuccess = (resolution) => { - process.stdout.write(`${JSON.stringify([null, resolution])} -`); - }; - const processResolution = (request, issuer) => { - try { - reportSuccess(defaultApi.resolveRequest(request, issuer)); - } catch (error) { - reportError(error.code, error.message, error.data); - } - }; - const processRequest = (data) => { - try { - const [request, issuer] = JSON.parse(data); - processResolution(request, issuer); - } catch (error) { - reportError(`INVALID_JSON`, error.message, error.data); - } - }; - if (process.argv.length > 2) { - if (process.argv.length !== 4) { - process.stderr.write(`Usage: ${process.argv[0]} ${process.argv[1]} -`); - process.exitCode = 64; - } else { - processResolution(process.argv[2], process.argv[3]); - } - } else { - let buffer = ``; - const decoder = new StringDecoder__default.default.StringDecoder(); - process.stdin.on(`data`, (chunk) => { - buffer += decoder.write(chunk); - do { - const index = buffer.indexOf(` -`); - if (index === -1) - break; - const line = buffer.slice(0, index); - buffer = buffer.slice(index + 1); - processRequest(line); - } while (true); - }); - } -} - -module.exports = defaultApi; diff --git a/fixtures/pnp/.yarnrc.yml b/fixtures/pnp/.yarnrc.yml deleted file mode 100644 index 6a6b24d8..00000000 --- a/fixtures/pnp/.yarnrc.yml +++ /dev/null @@ -1 +0,0 @@ -enableGlobalCache: 0 diff --git a/fixtures/pnp/package.json b/fixtures/pnp/package.json deleted file mode 100644 index 5d119379..00000000 --- a/fixtures/pnp/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "pnp", - "packageManager": "yarn@4.3.1", - "dependencies": { - "is-even": "^1.0.0", - "is-odd": "^3.0.1" - } -} diff --git a/fixtures/pnp/yarn.lock b/fixtures/pnp/yarn.lock deleted file mode 100644 index ba89514d..00000000 --- a/fixtures/pnp/yarn.lock +++ /dev/null @@ -1,74 +0,0 @@ -# This file is generated by running "yarn install" inside your project. -# Manual changes might be lost - proceed with caution! - -__metadata: - version: 8 - cacheKey: 10c0 - -"is-buffer@npm:^1.1.5": - version: 1.1.6 - resolution: "is-buffer@npm:1.1.6" - checksum: 10c0/ae18aa0b6e113d6c490ad1db5e8df9bdb57758382b313f5a22c9c61084875c6396d50bbf49315f5b1926d142d74dfb8d31b40d993a383e0a158b15fea7a82234 - languageName: node - linkType: hard - -"is-even@npm:^1.0.0": - version: 1.0.0 - resolution: "is-even@npm:1.0.0" - dependencies: - is-odd: "npm:^0.1.2" - checksum: 10c0/2728cc2f390d07c6a44a054aa53ae6ce57c3a4adfd76a92df528e992b4a978fdec4eaa948e0de6e6431ef3c8deebf1c964fd870d4983044ec9f0f4e630dfb3a5 - languageName: node - linkType: hard - -"is-number@npm:^3.0.0": - version: 3.0.0 - resolution: "is-number@npm:3.0.0" - dependencies: - kind-of: "npm:^3.0.2" - checksum: 10c0/e639c54640b7f029623df24d3d103901e322c0c25ea5bde97cd723c2d0d4c05857a8364ab5c58d963089dbed6bf1d0ffe975cb6aef917e2ad0ccbca653d31b4f - languageName: node - linkType: hard - -"is-number@npm:^6.0.0": - version: 6.0.0 - resolution: "is-number@npm:6.0.0" - checksum: 10c0/5da4c68401529675c575878d2760d66f18eaef4b014858577f6003daf66488d7fe4eae684b1e8574e3fa1bb447c6c6c56b8491d2b4b3239da2d32e5f6f218008 - languageName: node - linkType: hard - -"is-odd@npm:^0.1.2": - version: 0.1.2 - resolution: "is-odd@npm:0.1.2" - dependencies: - is-number: "npm:^3.0.0" - checksum: 10c0/7dc6c6fd004861208ef9f324021c66f19b3dad209c2da3ef3720d4d76e141974fadb52c47b439fc8c52af579468640b554115395b5673f4558ef09719260e898 - languageName: node - linkType: hard - -"is-odd@npm:^3.0.1": - version: 3.0.1 - resolution: "is-odd@npm:3.0.1" - dependencies: - is-number: "npm:^6.0.0" - checksum: 10c0/89ee2e353c5a3f3bd400c79db1c307a5b3506198ee8169d521e533a9b1d8a08fc95f21a919c084e98845b4286d7ffe309778da03744dfe66c3c1763ab1a030c6 - languageName: node - linkType: hard - -"kind-of@npm:^3.0.2": - version: 3.2.2 - resolution: "kind-of@npm:3.2.2" - dependencies: - is-buffer: "npm:^1.1.5" - checksum: 10c0/7e34bc29d4b02c997f92f080de34ebb92033a96736bbb0bb2410e033a7e5ae6571f1fa37b2d7710018f95361473b816c604234197f4f203f9cf149d8ef1574d9 - languageName: node - linkType: hard - -"pnp@workspace:.": - version: 0.0.0-use.local - resolution: "pnp@workspace:." - dependencies: - is-even: "npm:^1.0.0" - is-odd: "npm:^3.0.1" - languageName: unknown - linkType: soft diff --git a/fixtures/pnpm/.gitignore b/fixtures/pnpm/.gitignore deleted file mode 100644 index 3c3629e6..00000000 --- a/fixtures/pnpm/.gitignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/fixtures/pnpm/package.json b/fixtures/pnpm/package.json deleted file mode 100644 index b763d74d..00000000 --- a/fixtures/pnpm/package.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "name": "pnpm", - "version": "1.0.0", - "private": true, - "devDependencies": { - "axios": "1.6.2", - "ipaddr.js": "2.2.0", - "postcss": "8.4.33", - "styled-components": "6.1.1" - } -} diff --git a/fixtures/pnpm/pnpm-lock.yaml b/fixtures/pnpm/pnpm-lock.yaml deleted file mode 100644 index e51dfd6a..00000000 --- a/fixtures/pnpm/pnpm-lock.yaml +++ /dev/null @@ -1,212 +0,0 @@ -lockfileVersion: '6.0' - -settings: - autoInstallPeers: true - excludeLinksFromLockfile: false - -devDependencies: - axios: - specifier: 1.6.2 - version: 1.6.2 - postcss: - specifier: 8.4.33 - version: 8.4.33 - styled-components: - specifier: 6.1.1 - version: 6.1.1(react-dom@18.2.0)(react@18.2.0) - -packages: - - /@emotion/is-prop-valid@1.2.1: - resolution: {integrity: sha512-61Mf7Ufx4aDxx1xlDeOm8aFFigGHE4z+0sKCa+IHCeZKiyP9RLD0Mmx7m8b9/Cf37f7NAvQOOJAbQQGVr5uERw==} - dependencies: - '@emotion/memoize': 0.8.1 - dev: true - - /@emotion/memoize@0.8.1: - resolution: {integrity: sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA==} - dev: true - - /@emotion/unitless@0.8.1: - resolution: {integrity: sha512-KOEGMu6dmJZtpadb476IsZBclKvILjopjUii3V+7MnXIQCYh8W3NgNcgwo21n9LXZX6EDIKvqfjYxXebDwxKmQ==} - dev: true - - /@types/stylis@4.2.4: - resolution: {integrity: sha512-36ZrGJ8fgtBr6nwNnuJ9jXIj+bn/pF6UoqmrQT7+Y99+tFFeHHsoR54+194dHdyhPjgbeoNz3Qru0oRt0l6ASQ==} - dev: true - - /asynckit@0.4.0: - resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} - dev: true - - /axios@1.6.2: - resolution: {integrity: sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A==} - dependencies: - follow-redirects: 1.15.3 - form-data: 4.0.0 - proxy-from-env: 1.1.0 - transitivePeerDependencies: - - debug - dev: true - - /camelize@1.0.1: - resolution: {integrity: sha512-dU+Tx2fsypxTgtLoE36npi3UqcjSSMNYfkqgmoEhtZrraP5VWq0K7FkWVTYa8eMPtnU/G2txVsfdCJTn9uzpuQ==} - dev: true - - /combined-stream@1.0.8: - resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} - engines: {node: '>= 0.8'} - dependencies: - delayed-stream: 1.0.0 - dev: true - - /css-color-keywords@1.0.0: - resolution: {integrity: sha512-FyyrDHZKEjXDpNJYvVsV960FiqQyXc/LlYmsxl2BcdMb2WPx0OGRVgTg55rPSyLSNMqP52R9r8geSp7apN3Ofg==} - engines: {node: '>=4'} - dev: true - - /css-to-react-native@3.2.0: - resolution: {integrity: sha512-e8RKaLXMOFii+02mOlqwjbD00KSEKqblnpO9e++1aXS1fPQOpS1YoqdVHBqPjHNoxeF2mimzVqawm2KCbEdtHQ==} - dependencies: - camelize: 1.0.1 - css-color-keywords: 1.0.0 - postcss-value-parser: 4.2.0 - dev: true - - /csstype@3.1.2: - resolution: {integrity: sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==} - dev: true - - /delayed-stream@1.0.0: - resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} - engines: {node: '>=0.4.0'} - dev: true - - /follow-redirects@1.15.3: - resolution: {integrity: sha512-1VzOtuEM8pC9SFU1E+8KfTjZyMztRsgEfwQl44z8A25uy13jSzTj6dyK2Df52iV0vgHCfBwLhDWevLn95w5v6Q==} - engines: {node: '>=4.0'} - peerDependencies: - debug: '*' - peerDependenciesMeta: - debug: - optional: true - dev: true - - /form-data@4.0.0: - resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==} - engines: {node: '>= 6'} - dependencies: - asynckit: 0.4.0 - combined-stream: 1.0.8 - mime-types: 2.1.35 - dev: true - - /js-tokens@4.0.0: - resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} - dev: true - - /loose-envify@1.4.0: - resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==} - hasBin: true - dependencies: - js-tokens: 4.0.0 - dev: true - - /mime-db@1.52.0: - resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} - engines: {node: '>= 0.6'} - dev: true - - /mime-types@2.1.35: - resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} - engines: {node: '>= 0.6'} - dependencies: - mime-db: 1.52.0 - dev: true - - /nanoid@3.3.7: - resolution: {integrity: sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==} - engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} - hasBin: true - dev: true - - /picocolors@1.0.0: - resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==} - dev: true - - /postcss-value-parser@4.2.0: - resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==} - dev: true - - /postcss@8.4.33: - resolution: {integrity: sha512-Kkpbhhdjw2qQs2O2DGX+8m5OVqEcbB9HRBvuYM9pgrjEFUg30A9LmXNlTAUj4S9kgtGyrMbTzVjH7E+s5Re2yg==} - engines: {node: ^10 || ^12 || >=14} - dependencies: - nanoid: 3.3.7 - picocolors: 1.0.0 - source-map-js: 1.0.2 - dev: true - - /proxy-from-env@1.1.0: - resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==} - dev: true - - /react-dom@18.2.0(react@18.2.0): - resolution: {integrity: sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==} - peerDependencies: - react: ^18.2.0 - dependencies: - loose-envify: 1.4.0 - react: 18.2.0 - scheduler: 0.23.0 - dev: true - - /react@18.2.0: - resolution: {integrity: sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==} - engines: {node: '>=0.10.0'} - dependencies: - loose-envify: 1.4.0 - dev: true - - /scheduler@0.23.0: - resolution: {integrity: sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw==} - dependencies: - loose-envify: 1.4.0 - dev: true - - /shallowequal@1.1.0: - resolution: {integrity: sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ==} - dev: true - - /source-map-js@1.0.2: - resolution: {integrity: sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==} - engines: {node: '>=0.10.0'} - dev: true - - /styled-components@6.1.1(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-cpZZP5RrKRIClBW5Eby4JM1wElLVP4NQrJbJ0h10TidTyJf4SIIwa3zLXOoPb4gJi8MsJ8mjq5mu2IrEhZIAcQ==} - engines: {node: '>= 16'} - peerDependencies: - react: '>= 16.8.0' - react-dom: '>= 16.8.0' - dependencies: - '@emotion/is-prop-valid': 1.2.1 - '@emotion/unitless': 0.8.1 - '@types/stylis': 4.2.4 - css-to-react-native: 3.2.0 - csstype: 3.1.2 - postcss: 8.4.33 - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - shallowequal: 1.1.0 - stylis: 4.3.0 - tslib: 2.6.2 - dev: true - - /stylis@4.3.0: - resolution: {integrity: sha512-E87pIogpwUsUwXw7dNyU4QDjdgVMy52m+XEOPEKUn161cCzWjjhPSQhByfd1CcNvrOLnXQ6OnnZDwnJrz/Z4YQ==} - dev: true - - /tslib@2.6.2: - resolution: {integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==} - dev: true diff --git a/fixtures/tsconfig/cases/builtins/thing.js b/fixtures/tsconfig/cases/builtins/thing.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/builtins/tsconfig.json b/fixtures/tsconfig/cases/builtins/tsconfig.json deleted file mode 100644 index 36aa1a4d..00000000 --- a/fixtures/tsconfig/cases/builtins/tsconfig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compilerOptions": { - "baseUrl": "." - } -} diff --git a/fixtures/tsconfig/cases/exports/index.js b/fixtures/tsconfig/cases/exports/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/exports/tsconfig.json b/fixtures/tsconfig/cases/exports/tsconfig.json deleted file mode 100644 index f0e3159b..00000000 --- a/fixtures/tsconfig/cases/exports/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-exports" -} diff --git a/fixtures/tsconfig/cases/extends-extension/base-tsconfig.json b/fixtures/tsconfig/cases/extends-extension/base-tsconfig.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/cases/extends-extension/base-tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/cases/extends-extension/foo.js b/fixtures/tsconfig/cases/extends-extension/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-extension/tsconfig.json b/fixtures/tsconfig/cases/extends-extension/tsconfig.json deleted file mode 100644 index 0ae4c6a3..00000000 --- a/fixtures/tsconfig/cases/extends-extension/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./base-tsconfig" -} diff --git a/fixtures/tsconfig/cases/extends-extensionless/foo.js b/fixtures/tsconfig/cases/extends-extensionless/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-extensionless/tsconfig.json b/fixtures/tsconfig/cases/extends-extensionless/tsconfig.json deleted file mode 100644 index c36cb7d4..00000000 --- a/fixtures/tsconfig/cases/extends-extensionless/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-field/conf" -} diff --git a/fixtures/tsconfig/cases/extends-multiple/foo.js b/fixtures/tsconfig/cases/extends-multiple/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-multiple/tsconfig.json b/fixtures/tsconfig/cases/extends-multiple/tsconfig.json deleted file mode 100644 index aa2ae783..00000000 --- a/fixtures/tsconfig/cases/extends-multiple/tsconfig.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": ["../extends-extension", "../extends-paths"], - "compilerOptions": { - "baseUrl": ".", - }, -} diff --git a/fixtures/tsconfig/cases/extends-not-found/index.js b/fixtures/tsconfig/cases/extends-not-found/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-not-found/tsconfig.json b/fixtures/tsconfig/cases/extends-not-found/tsconfig.json deleted file mode 100644 index 99df91da..00000000 --- a/fixtures/tsconfig/cases/extends-not-found/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./not-found" -} diff --git a/fixtures/tsconfig/cases/extends-paths/src/index.js b/fixtures/tsconfig/cases/extends-paths/src/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-paths/tsconfig.base.json b/fixtures/tsconfig/cases/extends-paths/tsconfig.base.json deleted file mode 100644 index 5c64b067..00000000 --- a/fixtures/tsconfig/cases/extends-paths/tsconfig.base.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "@/*": ["./*"] - } - } -} diff --git a/fixtures/tsconfig/cases/extends-paths/tsconfig.json b/fixtures/tsconfig/cases/extends-paths/tsconfig.json deleted file mode 100644 index 51086018..00000000 --- a/fixtures/tsconfig/cases/extends-paths/tsconfig.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": "./tsconfig.base.json", - "compilerOptions": { - "baseUrl": "src", - }, -} diff --git a/fixtures/tsconfig/cases/field/index.js b/fixtures/tsconfig/cases/field/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/field/tsconfig.json b/fixtures/tsconfig/cases/field/tsconfig.json deleted file mode 100644 index 9f86c3f4..00000000 --- a/fixtures/tsconfig/cases/field/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-field" -} diff --git a/fixtures/tsconfig/cases/index/index.js b/fixtures/tsconfig/cases/index/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/index/tsconfig.json b/fixtures/tsconfig/cases/index/tsconfig.json deleted file mode 100644 index d20b1774..00000000 --- a/fixtures/tsconfig/cases/index/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-index" -} diff --git a/fixtures/tsconfig/cases/paths_template_variable/foo.js b/fixtures/tsconfig/cases/paths_template_variable/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json b/fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json deleted file mode 100644 index a1a37bb6..00000000 --- a/fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "../../tsconfig_template_variable.json" -} diff --git a/fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json b/fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json deleted file mode 100644 index e7d8e5e5..00000000 --- a/fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "compilerOptions": { - "composite": true, - "paths": { - "foo": ["${configDir}/foo.js"] - } - } -} diff --git a/fixtures/tsconfig/cases/project_references/app/aliased/index.ts b/fixtures/tsconfig/cases/project_references/app/aliased/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/app/index.ts b/fixtures/tsconfig/cases/project_references/app/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/app/tsconfig.json b/fixtures/tsconfig/cases/project_references/app/tsconfig.json deleted file mode 100644 index 7036d2bb..00000000 --- a/fixtures/tsconfig/cases/project_references/app/tsconfig.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "extends": "../tsconfig.base.json", - "compilerOptions": { - "baseUrl": "./", - "paths": { - "@/*": ["./aliased/*"] - } - }, - "references": [ - { - "path": "../project_a/conf.json" - }, - { - "path": "../project_b" - }, - { - "path": "../project_c/tsconfig.json" - }, - { - "path": "../../paths_template_variable/tsconfig2.json" - } - ] -} diff --git a/fixtures/tsconfig/cases/project_references/project_a/aliased/index.ts b/fixtures/tsconfig/cases/project_references/project_a/aliased/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_a/conf.json b/fixtures/tsconfig/cases/project_references/project_a/conf.json deleted file mode 100644 index 4d389d7a..00000000 --- a/fixtures/tsconfig/cases/project_references/project_a/conf.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "compilerOptions": { - "composite": true, - "paths": { - "@/*": ["./aliased/*"] - } - } -} diff --git a/fixtures/tsconfig/cases/project_references/project_a/index.ts b/fixtures/tsconfig/cases/project_references/project_a/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_b/src/aliased/index.ts b/fixtures/tsconfig/cases/project_references/project_b/src/aliased/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_b/tsconfig.json b/fixtures/tsconfig/cases/project_references/project_b/tsconfig.json deleted file mode 100644 index 4ab05cd8..00000000 --- a/fixtures/tsconfig/cases/project_references/project_b/tsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "compilerOptions": { - "composite": true, - "baseUrl": "./src", - "paths": { - "@/*": ["./aliased/*"] - } - } -} diff --git a/fixtures/tsconfig/cases/project_references/project_c/index.ts b/fixtures/tsconfig/cases/project_references/project_c/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_c/tsconfig.json b/fixtures/tsconfig/cases/project_references/project_c/tsconfig.json deleted file mode 100644 index fe520939..00000000 --- a/fixtures/tsconfig/cases/project_references/project_c/tsconfig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compilerOptions": { - "composite": true - } -} diff --git a/fixtures/tsconfig/cases/project_references/tsconfig.base.json b/fixtures/tsconfig/cases/project_references/tsconfig.base.json deleted file mode 100644 index 88ccffe7..00000000 --- a/fixtures/tsconfig/cases/project_references/tsconfig.base.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "compilerOptions": { - } -} diff --git a/fixtures/tsconfig/cases/suffixes/a.ios.ts b/fixtures/tsconfig/cases/suffixes/a.ios.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/a.ts b/fixtures/tsconfig/cases/suffixes/a.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/b.ts b/fixtures/tsconfig/cases/suffixes/b.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/c-test.ts b/fixtures/tsconfig/cases/suffixes/c-test.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/index.ts b/fixtures/tsconfig/cases/suffixes/index.ts deleted file mode 100644 index b09939b9..00000000 --- a/fixtures/tsconfig/cases/suffixes/index.ts +++ /dev/null @@ -1 +0,0 @@ -import './a'; diff --git a/fixtures/tsconfig/cases/suffixes/tsconfig.json b/fixtures/tsconfig/cases/suffixes/tsconfig.json deleted file mode 100644 index 4c2ccc8f..00000000 --- a/fixtures/tsconfig/cases/suffixes/tsconfig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compilerOptions": { - "moduleSuffixes": [".ios", "-test", ""] - } -} diff --git a/fixtures/tsconfig/cases/trailing-comma/bar.js b/fixtures/tsconfig/cases/trailing-comma/bar.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/trailing-comma/index.js b/fixtures/tsconfig/cases/trailing-comma/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/trailing-comma/tsconfig.json b/fixtures/tsconfig/cases/trailing-comma/tsconfig.json deleted file mode 100644 index 6dc20ca5..00000000 --- a/fixtures/tsconfig/cases/trailing-comma/tsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "compilerOptions": { - "paths": { - /* some comment */ - "foo": ["bar.js"], - }, - }, - // another comment -} diff --git a/fixtures/tsconfig/foo.js b/fixtures/tsconfig/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/nested/index.js b/fixtures/tsconfig/nested/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/nested/test.js b/fixtures/tsconfig/nested/test.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/nested/tsconfig.json b/fixtures/tsconfig/nested/tsconfig.json deleted file mode 100644 index 6deb3011..00000000 --- a/fixtures/tsconfig/nested/tsconfig.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "extends": "..", - "compilerOptions": { - "paths": { - "ts-path": ["test.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-exports/conf.json b/fixtures/tsconfig/node_modules/tsconfig-exports/conf.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-exports/conf.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-exports/foo.js b/fixtures/tsconfig/node_modules/tsconfig-exports/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-exports/package.json b/fixtures/tsconfig/node_modules/tsconfig-exports/package.json deleted file mode 100644 index be0ddee6..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-exports/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "tsconfig-exports", - "private": true, - "exports": { - ".": "./conf.json" - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-field/conf.json b/fixtures/tsconfig/node_modules/tsconfig-field/conf.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-field/conf.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-field/foo.js b/fixtures/tsconfig/node_modules/tsconfig-field/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-field/package.json b/fixtures/tsconfig/node_modules/tsconfig-field/package.json deleted file mode 100644 index 7138fdde..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-field/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "tsconfig-field", - "private": true, - "tsconfig": "conf.json" -} \ No newline at end of file diff --git a/fixtures/tsconfig/node_modules/tsconfig-index/foo.js b/fixtures/tsconfig/node_modules/tsconfig-index/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-index/package.json b/fixtures/tsconfig/node_modules/tsconfig-index/package.json deleted file mode 100644 index eb2431e7..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-index/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "tsconfig-index", - "private": true -} \ No newline at end of file diff --git a/fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json b/fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-not-used/foo.js b/fixtures/tsconfig/node_modules/tsconfig-not-used/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json b/fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json deleted file mode 100644 index eb16d127..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "ts-path": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/package.json b/fixtures/tsconfig/package.json deleted file mode 100755 index f48acd1c..00000000 --- a/fixtures/tsconfig/package.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "name": "resolver", - "private": true, - "alias": { - "aliased": "foo", - "aliased-file": "./bar.js", - "something": "./nested/test.js", - "aliasedfolder": "./nested", - "aliasedabsolute": "/nested", - "foo/bar": "./bar.js", - "glob/*/*": "./nested/$2", - "./baz": "./bar.js", - "url": false - }, - "imports": { - "#test": "./bar.js" - }, - "dependencies": { - "foo": "^0.3.4" - }, - "peerDependencies": { - "bar": "*" - } -} diff --git a/fixtures/tsconfig/tsconfig.json b/fixtures/tsconfig/tsconfig.json deleted file mode 100644 index eb16d127..00000000 --- a/fixtures/tsconfig/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "ts-path": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/tsconfig_broken.json b/fixtures/tsconfig/tsconfig_broken.json deleted file mode 100644 index 98232c64..00000000 --- a/fixtures/tsconfig/tsconfig_broken.json +++ /dev/null @@ -1 +0,0 @@ -{ diff --git a/fixtures/tsconfig/tsconfig_template_variable.json b/fixtures/tsconfig/tsconfig_template_variable.json deleted file mode 100644 index 6f272344..00000000 --- a/fixtures/tsconfig/tsconfig_template_variable.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["${configDir}/foo.js"] - } - } -} diff --git a/napi/src/lib.rs b/napi/Source/lib.rs similarity index 100% rename from napi/src/lib.rs rename to napi/Source/lib.rs diff --git a/napi/src/options.rs b/napi/Source/options.rs similarity index 100% rename from napi/src/options.rs rename to napi/Source/options.rs diff --git a/napi/src/tracing.rs b/napi/Source/tracing.rs similarity index 100% rename from napi/src/tracing.rs rename to napi/Source/tracing.rs diff --git a/napi/__test__/resolver.spec.mjs b/napi/__test__/resolver.spec.mjs deleted file mode 100644 index ac6ee0ef..00000000 --- a/napi/__test__/resolver.spec.mjs +++ /dev/null @@ -1,260 +0,0 @@ -import { join } from 'node:path' -import { fileURLToPath } from 'node:url' - -import test from 'ava' - -let ResolverFactory - -if (process.env.WASI_TEST) { - const wasi = await import('../resolver.wasi.cjs') - ResolverFactory = wasi.ResolverFactory -} else { - const napi = await import('../index.js') - ResolverFactory = napi.ResolverFactory -} - -const currentDir = join(fileURLToPath(import.meta.url), '..') - -const enhancedResolveRoot = join( - currentDir, - '..', - '..', - 'fixtures', - 'enhanced_resolve', - 'test', - 'fixtures' -) - -// https://github.com/webpack/enhanced-resolve/blob/main/test/resolve.test.js - -for (const [title, context, request, expected] of [ - [ - 'absolute path', - enhancedResolveRoot, - join(enhancedResolveRoot, 'main1.js'), - join(enhancedResolveRoot, 'main1.js'), - ], - [ - 'file with .js', - enhancedResolveRoot, - './main1.js', - join(enhancedResolveRoot, 'main1.js'), - ], - [ - 'file without extension', - enhancedResolveRoot, - './main1', - join(enhancedResolveRoot, 'main1.js'), - ], - [ - 'another file with .js', - enhancedResolveRoot, - './a.js', - join(enhancedResolveRoot, 'a.js'), - ], - [ - 'another file without extension', - enhancedResolveRoot, - './a', - join(enhancedResolveRoot, 'a.js'), - ], - [ - 'file in module with .js', - enhancedResolveRoot, - 'm1/a.js', - join(enhancedResolveRoot, 'node_modules/m1/a.js'), - ], - [ - 'file in module without extension', - enhancedResolveRoot, - 'm1/a', - join(enhancedResolveRoot, 'node_modules/m1/a.js'), - ], - [ - 'another file in module without extension', - enhancedResolveRoot, - 'complexm/step1', - join(enhancedResolveRoot, 'node_modules/complexm/step1.js'), - ], - [ - 'from submodule to file in sibling module', - join(enhancedResolveRoot, 'node_modules/complexm'), - 'm2/b.js', - join(enhancedResolveRoot, 'node_modules/m2/b.js'), - ], - [ - 'from nested directory to overwritten file in module', - join(enhancedResolveRoot, 'multiple_modules'), - 'm1/a.js', - join(enhancedResolveRoot, 'multiple_modules/node_modules/m1/a.js'), - ], - [ - 'from nested directory to not overwritten file in module', - join(enhancedResolveRoot, 'multiple_modules'), - 'm1/b.js', - join(enhancedResolveRoot, 'node_modules/m1/b.js'), - ], - [ - 'file with query', - enhancedResolveRoot, - './main1.js?query', - join(enhancedResolveRoot, 'main1.js?query'), - ], - [ - 'file with fragment', - enhancedResolveRoot, - './main1.js#fragment', - join(enhancedResolveRoot, 'main1.js#fragment'), - ], - [ - 'file with fragment and query', - enhancedResolveRoot, - './main1.js#fragment?query', - join(enhancedResolveRoot, 'main1.js#fragment?query'), - ], - [ - 'file with query and fragment', - enhancedResolveRoot, - './main1.js?#fragment', - join(enhancedResolveRoot, 'main1.js?#fragment'), - ], - - [ - 'file with query (unicode)', - enhancedResolveRoot, - './测试.js?query', - join(enhancedResolveRoot, '测试.js?query'), - ], - [ - 'file with fragment (unicode)', - enhancedResolveRoot, - './测试.js#fragment', - join(enhancedResolveRoot, '测试.js#fragment'), - ], - [ - 'file with fragment and query (unicode)', - enhancedResolveRoot, - './测试.js#fragment?query', - join(enhancedResolveRoot, '测试.js#fragment?query'), - ], - [ - 'file with query and fragment (unicode)', - enhancedResolveRoot, - './测试.js?#fragment', - join(enhancedResolveRoot, '测试.js?#fragment'), - ], - - [ - 'file in module with query', - enhancedResolveRoot, - 'm1/a?query', - join(enhancedResolveRoot, 'node_modules/m1/a.js?query'), - ], - [ - 'file in module with fragment', - enhancedResolveRoot, - 'm1/a#fragment', - join(enhancedResolveRoot, 'node_modules/m1/a.js#fragment'), - ], - [ - 'file in module with fragment and query', - enhancedResolveRoot, - 'm1/a#fragment?query', - join(enhancedResolveRoot, 'node_modules/m1/a.js#fragment?query'), - ], - [ - 'file in module with query and fragment', - enhancedResolveRoot, - 'm1/a?#fragment', - join(enhancedResolveRoot, 'node_modules/m1/a.js?#fragment'), - ], - [ - 'differ between directory and file, resolve file', - enhancedResolveRoot, - './dirOrFile', - join(enhancedResolveRoot, 'dirOrFile.js'), - ], - [ - 'differ between directory and file, resolve directory', - enhancedResolveRoot, - './dirOrFile/', - join(enhancedResolveRoot, 'dirOrFile/index.js'), - ], - [ - 'find node_modules outside of node_modules', - join(enhancedResolveRoot, 'browser-module/node_modules'), - 'm1/a', - join(enhancedResolveRoot, 'node_modules/m1/a.js'), - ], - [ - "don't crash on main field pointing to self", - enhancedResolveRoot, - './main-field-self', - join(enhancedResolveRoot, './main-field-self/index.js'), - ], - [ - "don't crash on main field pointing to self (2)", - enhancedResolveRoot, - './main-field-self2', - join(enhancedResolveRoot, './main-field-self2/index.js'), - ], - // enhanced-resolve has `#` prepended with a `\0`, they are removed from the - // following 3 expected test results. - // See https://github.com/webpack/enhanced-resolve#escaping - [ - 'handle fragment edge case (no fragment)', - enhancedResolveRoot, - './no#fragment/#/#', - join(enhancedResolveRoot, 'no#fragment', '#', '#.js'), - ], - [ - 'handle fragment edge case (fragment)', - enhancedResolveRoot, - './no#fragment/#/', - join(enhancedResolveRoot, 'no.js#fragment') + '/#/', - ], - [ - 'handle fragment escaping', - enhancedResolveRoot, - './no\0#fragment/\0#/\0##fragment', - join(enhancedResolveRoot, 'no#fragment', '#', '#.js#fragment'), - ], -]) { - test(title, (t) => { - const resolver = new ResolverFactory({ - modules: ['src/a', 'src/b', 'src/common', 'node_modules'], - extensions: ['.js', '.jsx', '.ts', '.tsx'], - }) - - t.is(resolver.sync(context, request).path, expected) - }) -} - -test('resolve pnpm package', (t) => { - const rootDir = join(currentDir, '..', '..'); - const pnpmProjectPath = join(rootDir, 'fixtures', 'pnpm') - const resolver = new ResolverFactory({ - aliasFields: ['browser'], - }) - t.deepEqual(resolver.sync(pnpmProjectPath, 'styled-components'), { - path: join( - rootDir, - 'node_modules/.pnpm/styled-components@6.1.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/styled-components/dist/styled-components.browser.cjs.js' - ), - }) - t.deepEqual( - resolver.sync( - join( - rootDir, - 'node_modules/.pnpm/styled-components@6.1.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/styled-components' - ), - 'react' - ), - { - path: join( - rootDir, - 'node_modules/.pnpm/react@18.3.1/node_modules/react/index.js' - ), - } - ) -}) diff --git a/napi/tests/options.test.mjs b/napi/tests/options.test.mjs deleted file mode 100644 index 4a93efff..00000000 --- a/napi/tests/options.test.mjs +++ /dev/null @@ -1,59 +0,0 @@ -import { describe, it } from "node:test"; -import { ResolverFactory } from "../index.js"; -import * as assert from "node:assert"; -import * as path from "node:path"; - -const fixtureDir = new URL( - "../../fixtures/enhanced_resolve/test/fixtures", - import.meta.url -).pathname; - -describe("option", () => { - describe("aliasFields", () => { - it("should allow field string ", () => { - const resolver = new ResolverFactory({ aliasFields: ["browser"] }); - assert.match( - resolver.sync(fixtureDir, "./browser-module/lib/replaced.js").path, - /browser-module\/lib\/browser\.js$/ - ); - }); - it("should allow json path array", () => { - const resolver = new ResolverFactory({ - aliasFields: [["innerBrowser1", "field", "browser"]], - }); - - assert.match( - resolver.sync(fixtureDir, "./browser-module/lib/main1.js").path, - /browser-module\/lib\/main\.js$/ - ); - }); - }); - - describe("exportsFields", () => { - const createTest = (exportsFields) => { - const resolver = new ResolverFactory({ exportsFields }); - assert.match( - resolver.sync( - path.resolve(fixtureDir, "./exports-field3"), - "exports-field" - ).path, - /\/exports-field\/src\/index\.js$/ - ); - }; - it("should allow string as field item", createTest(["broken"])); - it("should allow json path array as field item", createTest([["broken"]])); - }); - - describe("mainFields", () => { - const createTest = (mainFields) => { - const resolver = new ResolverFactory({ mainFields }); - assert.match( - resolver.sync(fixtureDir, "../..").path, - /\/lib\/index\.js$/ - ); - }; - it("should use `'main'` as default", createTest(undefined)); - it("should allow field string", createTest("main")); - it("should allow field array", createTest(["main"])); - }); -}); diff --git a/npm/package.json b/npm/package.json index 85422809..7136edb8 100644 --- a/npm/package.json +++ b/npm/package.json @@ -1,47 +1,36 @@ { - "name": "oxc-resolver", - "version": "1.11.0", - "description": "Oxc Resolver Node API", - "main": "index.js", - "browser": "browser.js", - "files": [ - "index.d.ts", - "index.js", - "browser.js" - ], - "license": "MIT", - "homepage": "https://oxc.rs", - "repository": { - "type": "git", - "url": "git+https://github.com/oxc-project/oxc-resolver.git" - }, - "publishConfig": { - "registry": "https://registry.npmjs.org/", - "access": "public" - }, - "napi": { - "binaryName": "resolver", - "packageName": "@oxc-resolver/binding", - "wasm": { - "browser": { - "fs": true - } - }, - "targets": [ - "x86_64-pc-windows-msvc", - "aarch64-pc-windows-msvc", - "x86_64-unknown-linux-gnu", - "x86_64-unknown-linux-musl", - "x86_64-unknown-freebsd", - "aarch64-unknown-linux-gnu", - "aarch64-unknown-linux-musl", - "armv7-unknown-linux-gnueabihf", - "x86_64-apple-darwin", - "aarch64-apple-darwin", - "wasm32-wasip1-threads" - ] - }, - "funding": { - "url": "https://github.com/sponsors/Boshen" - } + "browser": "browser.js", + "description": "Oxc Resolver Node API", + "files": [ + "index.d.ts", + "index.js", + "browser.js" + ], + "funding": { + "url": "https://github.com/sponsors/Boshen" + }, + "main": "index.js", + "name": "oxc-resolver", + "napi": { + "binaryName": "resolver", + "packageName": "@oxc-resolver/binding", + "targets": [ + "x86_64-pc-windows-msvc", + "aarch64-pc-windows-msvc", + "x86_64-unknown-linux-gnu", + "x86_64-unknown-linux-musl", + "x86_64-unknown-freebsd", + "aarch64-unknown-linux-gnu", + "aarch64-unknown-linux-musl", + "armv7-unknown-linux-gnueabihf", + "x86_64-apple-darwin", + "aarch64-apple-darwin", + "wasm32-wasip1-threads" + ], + "wasm": { + "browser": { + "fs": true + } + } + } } diff --git a/package.json b/package.json index 30892ca3..d0ee7633 100644 --- a/package.json +++ b/package.json @@ -1,33 +1,24 @@ { - "name": "@oxc-resolver/binding", - "private": true, - "version": "0.0.0", - "scripts": { - "build": "napi build --platform --release --package-json-path npm/package.json --manifest-path napi/Cargo.toml", - "build:debug": "napi build --platform --package-json-path npm/package.json --manifest-path napi/Cargo.toml", - "prepublishOnly": "napi pre-publish -t npm", - "test": "ava" - }, - "devDependencies": { - "@napi-rs/cli": "3.0.0-alpha.62", - "@napi-rs/wasm-runtime": "^0.2.4", - "@types/node": "^22.0.0", - "ava": "^6.1.3", - "emnapi": "^1.2.0", - "typescript": "^5.5.3" - }, - "ava": { - "files": [ - "napi/__test__/*.spec.mjs" - ], - "cache": false - }, - "packageManager": "pnpm@9.9.0", - "repository": { - "type": "git", - "url": "git+https://github.com/oxc-project/oxc-resolver.git" - }, - "funding": { - "url": "https://github.com/sponsors/Boshen" - } + "ava": { + "cache": false, + "files": [ + "napi/__test__/*.spec.mjs" + ] + }, + "devDependencies": { + "@napi-rs/cli": "3.0.0-alpha.62", + "@napi-rs/wasm-runtime": "^0.2.4", + "@types/node": "^22.0.0", + "ava": "^6.1.3", + "emnapi": "^1.2.0" + }, + "funding": { + "url": "https://github.com/sponsors/Boshen" + }, + "name": "@oxc-resolver/binding", + "scripts": { + "build": "napi build --platform --release --package-json-path npm/package.json --manifest-path napi/Cargo.toml", + "build:debug": "napi build --platform --package-json-path npm/package.json --manifest-path napi/Cargo.toml", + "prepublishOnly": "napi pre-publish -t npm" + } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml deleted file mode 100644 index db9e5b63..00000000 --- a/pnpm-lock.yaml +++ /dev/null @@ -1,2598 +0,0 @@ -lockfileVersion: '9.0' - -settings: - autoInstallPeers: true - excludeLinksFromLockfile: false - -importers: - - .: - devDependencies: - '@napi-rs/cli': - specifier: 3.0.0-alpha.62 - version: 3.0.0-alpha.62(@emnapi/runtime@1.2.0)(emnapi@1.2.0) - '@napi-rs/wasm-runtime': - specifier: ^0.2.4 - version: 0.2.4 - '@types/node': - specifier: ^22.0.0 - version: 22.5.4 - ava: - specifier: ^6.1.3 - version: 6.1.3 - emnapi: - specifier: ^1.2.0 - version: 1.2.0 - typescript: - specifier: ^5.5.3 - version: 5.5.4 - - fixtures/pnpm: - devDependencies: - axios: - specifier: 1.6.2 - version: 1.6.2 - ipaddr.js: - specifier: 2.2.0 - version: 2.2.0 - postcss: - specifier: 8.4.33 - version: 8.4.33 - styled-components: - specifier: 6.1.1 - version: 6.1.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - - npm: {} - -packages: - - '@emnapi/core@1.2.0': - resolution: {integrity: sha512-E7Vgw78I93we4ZWdYCb4DGAwRROGkMIXk7/y87UmANR+J6qsWusmC3gLt0H+O0KOt5e6O38U8oJamgbudrES/w==} - - '@emnapi/runtime@1.2.0': - resolution: {integrity: sha512-bV21/9LQmcQeCPEg3BDFtvwL6cwiTMksYNWQQ4KOxCZikEGalWtenoZ0wCiukJINlGCIi2KXx01g4FoH/LxpzQ==} - - '@emnapi/wasi-threads@1.0.1': - resolution: {integrity: sha512-iIBu7mwkq4UQGeMEM8bLwNK962nXdhodeScX4slfQnRhEMMzvYivHhutCIk8uojvmASXXPC2WNEjwxFWk72Oqw==} - - '@emotion/is-prop-valid@1.2.2': - resolution: {integrity: sha512-uNsoYd37AFmaCdXlg6EYD1KaPOaRWRByMCYzbKUX4+hhMfrxdVSelShywL4JVaAeM/eHUOSprYBQls+/neX3pw==} - - '@emotion/memoize@0.8.1': - resolution: {integrity: sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA==} - - '@emotion/unitless@0.8.1': - resolution: {integrity: sha512-KOEGMu6dmJZtpadb476IsZBclKvILjopjUii3V+7MnXIQCYh8W3NgNcgwo21n9LXZX6EDIKvqfjYxXebDwxKmQ==} - - '@inquirer/checkbox@2.3.10': - resolution: {integrity: sha512-CTc864M2/523rKc9AglIzAcUCuPXDZENgc5S2KZFVRbnMzpXcYTsUWmbqSeL0XLvtlvEtNevkkVbfVhJpruOyQ==} - engines: {node: '>=18'} - - '@inquirer/confirm@3.1.14': - resolution: {integrity: sha512-nbLSX37b2dGPtKWL3rPuR/5hOuD30S+pqJ/MuFiUEgN6GiMs8UMxiurKAMDzKt6C95ltjupa8zH6+3csXNHWpA==} - engines: {node: '>=18'} - - '@inquirer/core@9.0.2': - resolution: {integrity: sha512-nguvH3TZar3ACwbytZrraRTzGqyxJfYJwv+ZwqZNatAosdWQMP1GV8zvmkNlBe2JeZSaw0WYBHZk52pDpWC9qA==} - engines: {node: '>=18'} - - '@inquirer/editor@2.1.14': - resolution: {integrity: sha512-6nWpoJyVAKwAcv67bkbBmmi3f32xua79fP7TRmNUoR4K+B1GiOBsHO1YdvET/jvC+nTlBZL7puKAKyM7G+Lkzw==} - engines: {node: '>=18'} - - '@inquirer/expand@2.1.14': - resolution: {integrity: sha512-JcxsLajwPykF2kq6biIUdoOzTQ3LXqb8XMVrWkCprG/pFeU1SsxcSSFbF1T5jJGvvlTVcsE+JdGjbQ8ZRZ82RA==} - engines: {node: '>=18'} - - '@inquirer/figures@1.0.3': - resolution: {integrity: sha512-ErXXzENMH5pJt5/ssXV0DfWUZqly8nGzf0UcBV9xTnP+KyffE2mqyxIMBrZ8ijQck2nU0TQm40EQB53YreyWHw==} - engines: {node: '>=18'} - - '@inquirer/input@2.2.1': - resolution: {integrity: sha512-Yl1G6h7qWydzrJwqN777geeJVaAFL5Ly83aZlw4xHf8Z/BoTMfKRheyuMaQwOG7LQ4e5nQP7PxXdEg4SzQ+OKw==} - engines: {node: '>=18'} - - '@inquirer/number@1.0.2': - resolution: {integrity: sha512-GcoK+Phxcln0Qw9e73S5a8B2Ejg3HgSTvNfDegIcS5/BKwUm8t5rejja1l09WXjZM9vrVbRDf9RzWtSUiWVYRQ==} - engines: {node: '>=18'} - - '@inquirer/password@2.1.14': - resolution: {integrity: sha512-sPzOkXLhWJQ96K6nPZFnF8XB8tsDrcCRobd1d3EDz81F+4hp8BbdmsnsQcqZ7oYDIOVM/mWJyIUtJ35TrssJxQ==} - engines: {node: '>=18'} - - '@inquirer/prompts@5.1.2': - resolution: {integrity: sha512-E+ndnfwtVQtcmPt888Hc/HAxJUHSaA6OIvyvLAQ5BLQv+t20GbYdFSjXeLgb47OpMU+aRsKA/ys+Zoylw3kTVg==} - engines: {node: '>=18'} - - '@inquirer/rawlist@2.1.14': - resolution: {integrity: sha512-pLpEzhKNQ/ugFAFfgCNaXljB+dcCwmXwR1jOxAbVeFIdB3l02E5gjI+h1rb136tq0T8JO6P5KFR1oTeld/wdrA==} - engines: {node: '>=18'} - - '@inquirer/select@2.3.10': - resolution: {integrity: sha512-rr7iR0Zj1YFfgM8IUGimPD9Yukd+n/U63CnYT9kdum6DbRXtMxR45rrreP+EA9ixCnShr+W4xj7suRxC1+8t9g==} - engines: {node: '>=18'} - - '@inquirer/type@1.4.0': - resolution: {integrity: sha512-AjOqykVyjdJQvtfkNDGUyMYGF8xN50VUxftCQWsOyIo4DFRLr6VQhW0VItGI1JIyQGCGgIpKa7hMMwNhZb4OIw==} - engines: {node: '>=18'} - - '@mapbox/node-pre-gyp@1.0.11': - resolution: {integrity: sha512-Yhlar6v9WQgUp/He7BdgzOz8lqMQ8sU+jkCq7Wx8Myc5YFJLbEe7lgui/V7G1qB1DJykHSGwreceSaD60Y0PUQ==} - hasBin: true - - '@napi-rs/cli@3.0.0-alpha.62': - resolution: {integrity: sha512-IDUwHAEJZ9ad/s5oyhznrz5ZDcU+SJ6GdP5nb++Wx5MkS4FD9MeS3HfNZdsxkf10pOUPnmvCVFuG4xnLBQYmjw==} - engines: {node: '>= 16'} - hasBin: true - peerDependencies: - '@emnapi/runtime': ^1.1.0 - emnapi: ^1.1.0 - peerDependenciesMeta: - '@emnapi/runtime': - optional: true - emnapi: - optional: true - - '@napi-rs/cross-toolchain@0.0.16': - resolution: {integrity: sha512-jwdjHT5L0m9MH0CmzDwPp0ckn/UO7afHCsPeo7NugHUvYgvlgS7SWhdMVgIgJW2HHqhcW/2nhaLLGpAU1c7QRQ==} - peerDependencies: - '@napi-rs/cross-toolchain-arm64-target-aarch64': ^0.0.16 - '@napi-rs/cross-toolchain-arm64-target-armv7': ^0.0.16 - '@napi-rs/cross-toolchain-arm64-target-x86_64': ^0.0.16 - '@napi-rs/cross-toolchain-x64-target-aarch64': ^0.0.16 - '@napi-rs/cross-toolchain-x64-target-armv7': ^0.0.16 - '@napi-rs/cross-toolchain-x64-target-x86_64': ^0.0.16 - peerDependenciesMeta: - '@napi-rs/cross-toolchain-arm64-target-aarch64': - optional: true - '@napi-rs/cross-toolchain-arm64-target-armv7': - optional: true - '@napi-rs/cross-toolchain-arm64-target-x86_64': - optional: true - '@napi-rs/cross-toolchain-x64-target-aarch64': - optional: true - '@napi-rs/cross-toolchain-x64-target-armv7': - optional: true - '@napi-rs/cross-toolchain-x64-target-x86_64': - optional: true - - '@napi-rs/lzma-android-arm-eabi@1.3.1': - resolution: {integrity: sha512-mtGOg8jXlc+pTBI86cqohfndS9UmOAkk9d5CChKMb8btVks70yhUN1e7YYS3QFbmoxbPs2Ee+wmuH1Khdc7B2w==} - engines: {node: '>= 10'} - cpu: [arm] - os: [android] - - '@napi-rs/lzma-android-arm64@1.3.1': - resolution: {integrity: sha512-4uGkQgAv9Tnc/i0k2eIgbhZgyzs94+iECWxz4MFZNcZ1fNGvGbRL2j+SITE4OmwrUn3TuFK/uYWfgzooq8E1Qg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [android] - - '@napi-rs/lzma-darwin-arm64@1.3.1': - resolution: {integrity: sha512-MZBg4iwHTS8icjTiCMdzh8kYrMmKBCEglFPa+vjI91R2XDwuuwSzqmpATRpmMH8cWUUWtGPF4fnxKzjgkzhd4Q==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [darwin] - - '@napi-rs/lzma-darwin-x64@1.3.1': - resolution: {integrity: sha512-7vte+1lYV7xgZERKH/pjAeh4T16aQASKOzu4op70pK6VP/64Plr5rrvqxQqQmlAIe4pwyo/RkFl1n4LXDod3xg==} - engines: {node: '>= 10'} - cpu: [x64] - os: [darwin] - - '@napi-rs/lzma-freebsd-x64@1.3.1': - resolution: {integrity: sha512-uBS74fynTqLUC3catIxyezCafn8UDlr2yxVV47vz1T6Vop2PGDz/cMQdV6rnLSjPE08Rv66ihM36mgf/MmOkOg==} - engines: {node: '>= 10'} - cpu: [x64] - os: [freebsd] - - '@napi-rs/lzma-linux-arm-gnueabihf@1.3.1': - resolution: {integrity: sha512-rrVLyqBJeN29gPJCNkPbZ7dAzaseEcERKyhjwM+DfbFrDUvtkEcrYPvo+iwE/NmF+OkZQkzcanrVMGnq/mcJYQ==} - engines: {node: '>= 10'} - cpu: [arm] - os: [linux] - - '@napi-rs/lzma-linux-arm64-gnu@1.3.1': - resolution: {integrity: sha512-vDmVsthRbX2opkgRirJJGKQxUP/spvyVM2Y5CyCWZ7sadSID3hA97r38gf9ISn/sJ8/r93IPWLq+iycudNKi+Q==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/lzma-linux-arm64-musl@1.3.1': - resolution: {integrity: sha512-x4m/J3hRdFd3IoqKc+4aBcSUkcuDEP7hH6vdss8bKNLjPfXmnG/lcHJEQX3hNnNOULPP8xVRxgiY8jeL62cnsw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/lzma-linux-x64-gnu@1.3.1': - resolution: {integrity: sha512-riB+Xg72NfH8Kcpq07omshVu0QsLW0v2bhywBNYxvA+t2dGGWSIEN1U/zazUXys+IEA6pBQKqLVseurWE6Cl8g==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/lzma-linux-x64-musl@1.3.1': - resolution: {integrity: sha512-JXLgJFwoeysxdSg7rdVYP8wrliCQVJlU5JcLYjRVSCL4P0mQTjnYi7R7VdaOkDACw/Fvlji7oIJXt0KiaDTcOw==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/lzma-wasm32-wasi@1.3.1': - resolution: {integrity: sha512-XTA9XTUtj0KPKuzNS2oi3bWN6tJodk00wwMd/TiKoEqx9Fe/zu+OfDGuXAn+xs+P7S3YCDHqjYinuTQMZ0ucJw==} - engines: {node: '>=14.0.0'} - cpu: [wasm32] - - '@napi-rs/lzma-win32-arm64-msvc@1.3.1': - resolution: {integrity: sha512-qLDfs9UEtLPPTN/FdSz3gSdlx86VwFQBuLBrQtaiYQtUTKZCOYV1Z1fXqFt5Zqa1HKV2oyXnwGcTI7RpcyXxtg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [win32] - - '@napi-rs/lzma-win32-ia32-msvc@1.3.1': - resolution: {integrity: sha512-rWNlxLFMIfvxzfdQCfeQ3D/HEnQG3vfladFYrXUx6ePXO6r+BLCGn6/LWSSuKlw4vKkb1iHEWsAVaRLIcJEMIA==} - engines: {node: '>= 10'} - cpu: [ia32] - os: [win32] - - '@napi-rs/lzma-win32-x64-msvc@1.3.1': - resolution: {integrity: sha512-SNfHNqEjabXfTL1+KRi0qiAhwIlZHhQystvfSYX6p1g+2trSC/3WUpUQ4fbbR7KyE31g2AAnwjXivnlQ0af/pg==} - engines: {node: '>= 10'} - cpu: [x64] - os: [win32] - - '@napi-rs/lzma@1.3.1': - resolution: {integrity: sha512-XyZoBlYNMvCulK/RmVK/0nB3j7IdH7HpqcrMMg0U+HqQqKRLOQBwvnKNBocPC1bZQ7iZuKWYTLn1ayZwTyek8w==} - engines: {node: '>= 10'} - - '@napi-rs/tar-android-arm-eabi@0.1.1': - resolution: {integrity: sha512-Ufa0ahZvE5KGrC2WBux5svCe/jvC+e8IgtleiicwqnfgTfbDknYyq/QuqkP1AnMp/IvTmx2iutCZt6OFIG0zAg==} - engines: {node: '>= 10'} - cpu: [arm] - os: [android] - - '@napi-rs/tar-android-arm64@0.1.1': - resolution: {integrity: sha512-KUu5fHIiIObSuZ/crHxUrQ243+LiCRKPwdCVLHwjtftqFjzls+R2Mp6GrpM41XxexDMN00SUta3kazi93Xr19A==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [android] - - '@napi-rs/tar-darwin-arm64@0.1.1': - resolution: {integrity: sha512-jaqgdX20iIga+2gzotQ78eF00Cm8vECocUYeMY62WqyzJNv/jx1dlOfELWEccOjpmawFT9tjWebsS9F1QMvSUg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [darwin] - - '@napi-rs/tar-darwin-x64@0.1.1': - resolution: {integrity: sha512-80sa32IxfRso9x9sGTFpfLSx3BnruyJODpSkUzalOCz9i14n5gOKA8KR/JrnSWwDz0p5l5P9kfQD3pu8Voj7WA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [darwin] - - '@napi-rs/tar-freebsd-x64@0.1.1': - resolution: {integrity: sha512-P7V1zBjjC1dCrTwtUzuzYM4AeZduigeCtd8qQw2IUZowM5AsmhMd77oYuXjdU29cEpKUpyYjJRxjPCzFy+WbAQ==} - engines: {node: '>= 10'} - cpu: [x64] - os: [freebsd] - - '@napi-rs/tar-linux-arm-gnueabihf@0.1.1': - resolution: {integrity: sha512-qpC71ILPkWKt8k1iJCYt5gjwcOkd2VFSQIelTRr12t5CVNKV04rE/TMdwFoCP7kxbtb9Fl2cZzCRISw2BhMCmQ==} - engines: {node: '>= 10'} - cpu: [arm] - os: [linux] - - '@napi-rs/tar-linux-arm64-gnu@0.1.1': - resolution: {integrity: sha512-71QgxcFJCog6O4Tauoge8D0ILkDGJTRk3ru7zG8PUFG1QXJ1kkiRikdT77YmoVxtomc9FUOt+bdEdU5Yn+3QUQ==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/tar-linux-arm64-musl@0.1.1': - resolution: {integrity: sha512-R2e7YEILPKc447N1hUt1zQuyy0st83HX6nhmtFywS1aOj76/3hzxLVrebGiiS6kifyCrO82o66CNTYe7DixMZw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/tar-linux-x64-gnu@0.1.1': - resolution: {integrity: sha512-tmy9q2LXUB2GQ+IgUzJn3+us52leplMu96ORyFq1iHQEelGSqXt4xi5DzU07JhX3obJPqVqkybtcRS4enBfmBA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/tar-linux-x64-musl@0.1.1': - resolution: {integrity: sha512-j5ePbe6vihApl0cGPPDUVTWZbf2mF4NhxngAoG2jp7AeX3cWP2O4pjsvaOraW6QfvWEMFPeER7S0b6eBS7duvA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/tar-wasm32-wasi@0.1.1': - resolution: {integrity: sha512-se0+DlOiIRt7mcz7BeOJDoZtCrROpKLwiAOGmNgrjQ/SZS7TnOPuwm3wy9XN9WLoepttEjCEem6UP8yD5GJuQg==} - engines: {node: '>=14.0.0'} - cpu: [wasm32] - - '@napi-rs/tar-win32-arm64-msvc@0.1.1': - resolution: {integrity: sha512-FDZPi2wC7RwzvodogigLh/pJvhqCTVTUqOYuHlLkPSUbSAGiEkI55wk9RqH3y3EdJQaDuzyqC0QKz5ket2U+GA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [win32] - - '@napi-rs/tar-win32-ia32-msvc@0.1.1': - resolution: {integrity: sha512-OPR9Tou5z5M912G7Kc7gkf1ltinbOQx5dS/OeDIWHvPGOfdFDIxt0YVKhzSLRJi43+zIDp8/+cbeMD/cKXfX8w==} - engines: {node: '>= 10'} - cpu: [ia32] - os: [win32] - - '@napi-rs/tar-win32-x64-msvc@0.1.1': - resolution: {integrity: sha512-hiv5KfhrMSg8tTRC2oQXVckVg1h6ZVjwbd5aF9Esl0V3p2TaNFwwbqgnAN4Gm/PmSnHWNL/IRTHkk3cOzDWihQ==} - engines: {node: '>= 10'} - cpu: [x64] - os: [win32] - - '@napi-rs/tar@0.1.1': - resolution: {integrity: sha512-FOMhwwlvoYjHaDBxP26K3D92ltw1Y/CC4CIjgC6qXdzW4MYNwTlEyI58smCM3k+nCVJH3kpOYyH3sgbK4WZA4A==} - engines: {node: '>= 10'} - - '@napi-rs/wasm-runtime@0.2.4': - resolution: {integrity: sha512-9zESzOO5aDByvhIAsOy9TbpZ0Ur2AJbUI7UT73kcUTS2mxAMHOBaa1st/jAymNoCtvrit99kkzT1FZuXVcgfIQ==} - - '@napi-rs/wasm-tools-android-arm-eabi@0.0.2': - resolution: {integrity: sha512-/b+UU3suXjW4P0DzHRNdrnebQtFKcQf/YMeZJH+xUlKgvwli5kbmWjx8Wqqz0VETVkUTuPqJMBDIVLyc+14FGw==} - engines: {node: '>= 10'} - cpu: [arm] - os: [android] - - '@napi-rs/wasm-tools-android-arm64@0.0.2': - resolution: {integrity: sha512-j57GbDflwJdZtT8pZj5fOV4JAP+LdKN+wzsUYs+QRUoBqpWbbUANudolqfw63bkS9sD4z7fbCuz8iwtJqzxTVA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [android] - - '@napi-rs/wasm-tools-darwin-arm64@0.0.2': - resolution: {integrity: sha512-P2ChgWgVuv9GwmbxN89R84KzIImoTqXINteEixUvmkdnhyFiR+I8deNs89Yed+5w8QLC6MEfrtRqLP9YI+NoQA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [darwin] - - '@napi-rs/wasm-tools-darwin-x64@0.0.2': - resolution: {integrity: sha512-T/kQQ0gt8+wau1Z821PKVAD76QhmwVoLs2CT7Z9tTBs2pJvwSCP0C/kQiQAHcJIMi7A2E9Ab/Mez0BERy50EFA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [darwin] - - '@napi-rs/wasm-tools-freebsd-x64@0.0.2': - resolution: {integrity: sha512-GnnHu+r5sfzuxC/1J5UMF/h3BOZnHb3NQZ5hmbCfZYCKzpzRxrAJhzRunlbRN+v0x8M/49dztVTYR3s7K4ooAw==} - engines: {node: '>= 10'} - cpu: [x64] - os: [freebsd] - - '@napi-rs/wasm-tools-linux-arm64-gnu@0.0.2': - resolution: {integrity: sha512-KnZdLT0OnKb1CG2kdt3/WvM43vr9i+FEwXCvSOVC/6Tsifz7ynhMg7LAVESILd03HubzQJfg9nbRsk0bQ+IOwg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/wasm-tools-linux-arm64-musl@0.0.2': - resolution: {integrity: sha512-HkpZOID2U8P6pWqK3mqZ8bxU5xcuT3iA2fO+jrxn78h006iYgfNmdc5JaVhHnHazMmk32xKhSV4iV0VUh8UWDg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/wasm-tools-linux-x64-gnu@0.0.2': - resolution: {integrity: sha512-YksJWBCyOalB9ogtP9+/dZKP+vR6+h7BmzMXaXMT71WW/GvIsifMVgv+DY/FRSNJQupp5Y+ugjqVAOUOc/G65g==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/wasm-tools-linux-x64-musl@0.0.2': - resolution: {integrity: sha512-sPtRxPMdw05KdTcxgSPMmSXG2+PiK3vJ/l2+g9hvjnnKtvslJN2Hr7j8zgzuoKRAUFPaJVe6+D2xVh5cpdqhww==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/wasm-tools-wasm32-wasi@0.0.2': - resolution: {integrity: sha512-muRvZK7AIuo88G2AxYx3gA59rHMQgoN004saQkBvXnz3K/DVHKfTZ6TtUebss8zI3dURU6xExL8drxFWYxjEbQ==} - engines: {node: '>=14.0.0'} - cpu: [wasm32] - - '@napi-rs/wasm-tools-win32-arm64-msvc@0.0.2': - resolution: {integrity: sha512-Cn13WQ+tpFqdVwx0DIWKbsI9auFyzVZV4F5UNOUeDt6GgOL+NndgJul0Pc9bSU6fi03AylMPfF/nTCaDWO2Wgw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [win32] - - '@napi-rs/wasm-tools-win32-ia32-msvc@0.0.2': - resolution: {integrity: sha512-xsg5DkIQi82a8rcx6246Y3XC8TIqHamY+/C6sIlPLaZEuHctDkMECAw0AANwRf5vN//D2oo2oljOuoYtB1GOKw==} - engines: {node: '>= 10'} - cpu: [ia32] - os: [win32] - - '@napi-rs/wasm-tools-win32-x64-msvc@0.0.2': - resolution: {integrity: sha512-yHigltEt33eq8bappvKsIliz4MxfMPn1M+NWbIFRWN+IS1Z57mhmc1osuk+IRXrSlq0Tom0R6MYN1jpkZKz81Q==} - engines: {node: '>= 10'} - cpu: [x64] - os: [win32] - - '@napi-rs/wasm-tools@0.0.2': - resolution: {integrity: sha512-kBvDQCP5BLw2TxTENXLp3Of7vVEx0uyIye824JHE4dduzzOHVgSoOFVhVqAT3Fx/hLV445RVWfEqQbXMg4w/Mw==} - engines: {node: '>= 10'} - - '@nodelib/fs.scandir@2.1.5': - resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} - engines: {node: '>= 8'} - - '@nodelib/fs.stat@2.0.5': - resolution: {integrity: sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==} - engines: {node: '>= 8'} - - '@nodelib/fs.walk@1.2.8': - resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} - engines: {node: '>= 8'} - - '@octokit/auth-token@5.1.1': - resolution: {integrity: sha512-rh3G3wDO8J9wSjfI436JUKzHIxq8NaiL0tVeB2aXmG6p/9859aUOAjA9pmSPNGGZxfwmaJ9ozOJImuNVJdpvbA==} - engines: {node: '>= 18'} - - '@octokit/core@6.1.2': - resolution: {integrity: sha512-hEb7Ma4cGJGEUNOAVmyfdB/3WirWMg5hDuNFVejGEDFqupeOysLc2sG6HJxY2etBp5YQu5Wtxwi020jS9xlUwg==} - engines: {node: '>= 18'} - - '@octokit/endpoint@10.1.1': - resolution: {integrity: sha512-JYjh5rMOwXMJyUpj028cu0Gbp7qe/ihxfJMLc8VZBMMqSwLgOxDI1911gV4Enl1QSavAQNJcwmwBF9M0VvLh6Q==} - engines: {node: '>= 18'} - - '@octokit/graphql@8.1.1': - resolution: {integrity: sha512-ukiRmuHTi6ebQx/HFRCXKbDlOh/7xEV6QUXaE7MJEKGNAncGI/STSbOkl12qVXZrfZdpXctx5O9X1AIaebiDBg==} - engines: {node: '>= 18'} - - '@octokit/openapi-types@22.2.0': - resolution: {integrity: sha512-QBhVjcUa9W7Wwhm6DBFu6ZZ+1/t/oYxqc2tp81Pi41YNuJinbFRx8B133qVOrAaBbF7D/m0Et6f9/pZt9Rc+tg==} - - '@octokit/plugin-paginate-rest@11.3.3': - resolution: {integrity: sha512-o4WRoOJZlKqEEgj+i9CpcmnByvtzoUYC6I8PD2SA95M+BJ2x8h7oLcVOg9qcowWXBOdcTRsMZiwvM3EyLm9AfA==} - engines: {node: '>= 18'} - peerDependencies: - '@octokit/core': '>=6' - - '@octokit/plugin-request-log@5.3.0': - resolution: {integrity: sha512-FiGcyjdtYPlr03ExBk/0ysIlEFIFGJQAVoPPMxL19B24bVSEiZQnVGBunNtaAF1YnvE/EFoDpXmITtRnyCiypQ==} - engines: {node: '>= 18'} - peerDependencies: - '@octokit/core': '>=6' - - '@octokit/plugin-rest-endpoint-methods@13.2.4': - resolution: {integrity: sha512-gusyAVgTrPiuXOdfqOySMDztQHv6928PQ3E4dqVGEtOvRXAKRbJR4b1zQyniIT9waqaWk/UDaoJ2dyPr7Bk7Iw==} - engines: {node: '>= 18'} - peerDependencies: - '@octokit/core': '>=6' - - '@octokit/request-error@6.1.2': - resolution: {integrity: sha512-sA0oF7aL5wXbNfl+7zgLYJiFZctei9GaIMJlTraJrlQyFaoIYr4MCqPSakzxxGCfm8fET4vn0cQdRFmD7avlDg==} - engines: {node: '>= 18'} - - '@octokit/request@9.1.1': - resolution: {integrity: sha512-pyAguc0p+f+GbQho0uNetNQMmLG1e80WjkIaqqgUkihqUp0boRU6nKItXO4VWnr+nbZiLGEyy4TeKRwqaLvYgw==} - engines: {node: '>= 18'} - - '@octokit/rest@21.0.0': - resolution: {integrity: sha512-XudXXOmiIjivdjNZ+fN71NLrnDM00sxSZlhqmPR3v0dVoJwyP628tSlc12xqn8nX3N0965583RBw5GPo6r8u4Q==} - engines: {node: '>= 18'} - - '@octokit/types@13.5.0': - resolution: {integrity: sha512-HdqWTf5Z3qwDVlzCrP8UJquMwunpDiMPt5er+QjGzL4hqr/vBVY/MauQgS1xWxCDT1oMx1EULyqxncdCY/NVSQ==} - - '@rollup/pluginutils@4.2.1': - resolution: {integrity: sha512-iKnFXr7NkdZAIHiIWE+BX5ULi/ucVFYWD6TbAV+rZctiRTY2PL6tsIKhoIOaoskiWAkgu+VsbXgUVDNLHf+InQ==} - engines: {node: '>= 8.0.0'} - - '@sindresorhus/merge-streams@2.3.0': - resolution: {integrity: sha512-LtoMMhxAlorcGhmFYI+LhPgbPZCkgP6ra1YL604EeF6U98pLlQ3iWIGMdWSC+vWmPBWBNgmDBAhnAobLROJmwg==} - engines: {node: '>=18'} - - '@tybys/wasm-util@0.9.0': - resolution: {integrity: sha512-6+7nlbMVX/PVDCwaIQ8nTOPveOcFLSt8GcXdx8hD0bt39uWxYT88uXzqTd4fTvqta7oeUJqudepapKNt2DYJFw==} - - '@types/mute-stream@0.0.4': - resolution: {integrity: sha512-CPM9nzrCPPJHQNA9keH9CVkVI+WR5kMa+7XEs5jcGQ0VoAGnLv242w8lIVgwAEfmE4oufJRaTc9PNLQl0ioAow==} - - '@types/node@20.16.5': - resolution: {integrity: sha512-VwYCweNo3ERajwy0IUlqqcyZ8/A7Zwa9ZP3MnENWcB11AejO+tLy3pu850goUW2FC/IJMdZUfKpX/yxL1gymCA==} - - '@types/node@22.5.4': - resolution: {integrity: sha512-FDuKUJQm/ju9fT/SeX/6+gBzoPzlVCzfzmGkwKvRHQVxi4BntVbyIwf6a4Xn62mrvndLiml6z/UBXIdEVjQLXg==} - - '@types/stylis@4.2.6': - resolution: {integrity: sha512-4nebF2ZJGzQk0ka0O6+FZUWceyFv4vWq/0dXBMmrSeAwzOuOd/GxE5Pa64d/ndeNLG73dXoBsRzvtsVsYUv6Uw==} - - '@types/wrap-ansi@3.0.0': - resolution: {integrity: sha512-ltIpx+kM7g/MLRZfkbL7EsCEjfzCcScLpkg37eXEtx5kmrAKBkTJwd1GIAjDSL8wTpM6Hzn5YO4pSb91BEwu1g==} - - '@vercel/nft@0.26.5': - resolution: {integrity: sha512-NHxohEqad6Ra/r4lGknO52uc/GrWILXAMs1BB4401GTqww0fw1bAqzpG1XHuDO+dprg4GvsD9ZLLSsdo78p9hQ==} - engines: {node: '>=16'} - hasBin: true - - abbrev@1.1.1: - resolution: {integrity: sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==} - - acorn-import-attributes@1.9.5: - resolution: {integrity: sha512-n02Vykv5uA3eHGM/Z2dQrcD56kL8TyDb2p1+0P83PClMnC/nc+anbQRhIOWnSq4Ke/KvDPrY3C9hDtC/A3eHnQ==} - peerDependencies: - acorn: ^8 - - acorn-walk@8.3.3: - resolution: {integrity: sha512-MxXdReSRhGO7VlFe1bRG/oI7/mdLV9B9JJT0N8vZOhF7gFRR5l3M8W9G8JxmKV+JC5mGqJ0QvqfSOLsCPa4nUw==} - engines: {node: '>=0.4.0'} - - acorn@8.12.1: - resolution: {integrity: sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg==} - engines: {node: '>=0.4.0'} - hasBin: true - - agent-base@6.0.2: - resolution: {integrity: sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==} - engines: {node: '>= 6.0.0'} - - ansi-escapes@4.3.2: - resolution: {integrity: sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==} - engines: {node: '>=8'} - - ansi-regex@5.0.1: - resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} - engines: {node: '>=8'} - - ansi-regex@6.0.1: - resolution: {integrity: sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==} - engines: {node: '>=12'} - - ansi-styles@4.3.0: - resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} - engines: {node: '>=8'} - - ansi-styles@6.2.1: - resolution: {integrity: sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==} - engines: {node: '>=12'} - - aproba@2.0.0: - resolution: {integrity: sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==} - - are-we-there-yet@2.0.0: - resolution: {integrity: sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw==} - engines: {node: '>=10'} - deprecated: This package is no longer supported. - - argparse@1.0.10: - resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==} - - argparse@2.0.1: - resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} - - array-find-index@1.0.2: - resolution: {integrity: sha512-M1HQyIXcBGtVywBt8WVdim+lrNaK7VHp99Qt5pSNziXznKHViIBbXWtfRTpEFpF/c4FdfxNAsCCwPp5phBYJtw==} - engines: {node: '>=0.10.0'} - - arrgv@1.0.2: - resolution: {integrity: sha512-a4eg4yhp7mmruZDQFqVMlxNRFGi/i1r87pt8SDHy0/I8PqSXoUTlWZRdAZo0VXgvEARcujbtTk8kiZRi1uDGRw==} - engines: {node: '>=8.0.0'} - - arrify@3.0.0: - resolution: {integrity: sha512-tLkvA81vQG/XqE2mjDkGQHoOINtMHtysSnemrmoGe6PydDPMRbVugqyk4A6V/WDWEfm3l+0d8anA9r8cv/5Jaw==} - engines: {node: '>=12'} - - async-sema@3.1.1: - resolution: {integrity: sha512-tLRNUXati5MFePdAk8dw7Qt7DpxPB60ofAgn8WRhW6a2rcimZnYBP9oxHiv0OHy+Wz7kPMG+t4LGdt31+4EmGg==} - - asynckit@0.4.0: - resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} - - ava@6.1.3: - resolution: {integrity: sha512-tkKbpF1pIiC+q09wNU9OfyTDYZa8yuWvU2up3+lFJ3lr1RmnYh2GBpPwzYUEB0wvTPIUysGjcZLNZr7STDviRA==} - engines: {node: ^18.18 || ^20.8 || ^21 || ^22} - hasBin: true - peerDependencies: - '@ava/typescript': '*' - peerDependenciesMeta: - '@ava/typescript': - optional: true - - axios@1.6.2: - resolution: {integrity: sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A==} - - balanced-match@1.0.2: - resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} - - before-after-hook@3.0.2: - resolution: {integrity: sha512-Nik3Sc0ncrMK4UUdXQmAnRtzmNQTAAXmXIopizwZ1W1t8QmfJj+zL4OA2I7XPTPW5z5TDqv4hRo/JzouDJnX3A==} - - bindings@1.5.0: - resolution: {integrity: sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==} - - blueimp-md5@2.19.0: - resolution: {integrity: sha512-DRQrD6gJyy8FbiE4s+bDoXS9hiW3Vbx5uCdwvcCf3zLHL+Iv7LtGHLpr+GZV8rHG8tK766FGYBwRbu8pELTt+w==} - - brace-expansion@1.1.11: - resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} - - braces@3.0.3: - resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==} - engines: {node: '>=8'} - - callsites@4.2.0: - resolution: {integrity: sha512-kfzR4zzQtAE9PC7CzZsjl3aBNbXWuXiSeOCdLcPpBfGW8YuCqQHcRPFDbr/BPVmd3EEPVpuFzLyuT/cUhPr4OQ==} - engines: {node: '>=12.20'} - - camelize@1.0.1: - resolution: {integrity: sha512-dU+Tx2fsypxTgtLoE36npi3UqcjSSMNYfkqgmoEhtZrraP5VWq0K7FkWVTYa8eMPtnU/G2txVsfdCJTn9uzpuQ==} - - cbor@9.0.2: - resolution: {integrity: sha512-JPypkxsB10s9QOWwa6zwPzqE1Md3vqpPc+cai4sAecuCsRyAtAl/pMyhPlMbT/xtPnm2dznJZYRLui57qiRhaQ==} - engines: {node: '>=16'} - - chalk@5.3.0: - resolution: {integrity: sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==} - engines: {node: ^12.17.0 || ^14.13 || >=16.0.0} - - chardet@0.7.0: - resolution: {integrity: sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==} - - chownr@2.0.0: - resolution: {integrity: sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==} - engines: {node: '>=10'} - - chunkd@2.0.1: - resolution: {integrity: sha512-7d58XsFmOq0j6el67Ug9mHf9ELUXsQXYJBkyxhH/k+6Ke0qXRnv0kbemx+Twc6fRJ07C49lcbdgm9FL1Ei/6SQ==} - - ci-info@4.0.0: - resolution: {integrity: sha512-TdHqgGf9odd8SXNuxtUBVx8Nv+qZOejE6qyqiy5NtbYYQOeFa6zmHkxlPzmaLxWWHsU6nJmB7AETdVPi+2NBUg==} - engines: {node: '>=8'} - - ci-parallel-vars@1.0.1: - resolution: {integrity: sha512-uvzpYrpmidaoxvIQHM+rKSrigjOe9feHYbw4uOI2gdfe1C3xIlxO+kVXq83WQWNniTf8bAxVpy+cQeFQsMERKg==} - - cli-spinners@2.9.2: - resolution: {integrity: sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==} - engines: {node: '>=6'} - - cli-truncate@4.0.0: - resolution: {integrity: sha512-nPdaFdQ0h/GEigbPClz11D0v/ZJEwxmeVZGeMo3Z5StPtUTkA9o1lD6QwoirYiSDzbcwn2XcjwmCp68W1IS4TA==} - engines: {node: '>=18'} - - cli-width@4.1.0: - resolution: {integrity: sha512-ouuZd4/dm2Sw5Gmqy6bGyNNNe1qt9RpmxveLSO7KcgsTnU7RXfsw+/bukWGo1abgBiMAic068rclZsO4IWmmxQ==} - engines: {node: '>= 12'} - - clipanion@3.2.1: - resolution: {integrity: sha512-dYFdjLb7y1ajfxQopN05mylEpK9ZX0sO1/RfMXdfmwjlIsPkbh4p7A682x++zFPLDCo1x3p82dtljHf5cW2LKA==} - peerDependencies: - typanion: '*' - - cliui@8.0.1: - resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==} - engines: {node: '>=12'} - - code-excerpt@4.0.0: - resolution: {integrity: sha512-xxodCmBen3iy2i0WtAK8FlFNrRzjUqjRsMfho58xT/wvZU1YTM3fCnRjcy1gJPMepaRlgm/0e6w8SpWHpn3/cA==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - color-convert@2.0.1: - resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} - engines: {node: '>=7.0.0'} - - color-name@1.1.4: - resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} - - color-support@1.1.3: - resolution: {integrity: sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==} - hasBin: true - - colorette@2.0.20: - resolution: {integrity: sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==} - - combined-stream@1.0.8: - resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} - engines: {node: '>= 0.8'} - - common-path-prefix@3.0.0: - resolution: {integrity: sha512-QE33hToZseCH3jS0qN96O/bSh3kaw/h+Tq7ngyY9eWDUnTlTNUyqfqvCXioLe5Na5jFsL78ra/wuBU4iuEgd4w==} - - concat-map@0.0.1: - resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} - - concordance@5.0.4: - resolution: {integrity: sha512-OAcsnTEYu1ARJqWVGwf4zh4JDfHZEaSNlNccFmt8YjB2l/n19/PF2viLINHc57vO4FKIAFl2FWASIGZZWZ2Kxw==} - engines: {node: '>=10.18.0 <11 || >=12.14.0 <13 || >=14'} - - console-control-strings@1.1.0: - resolution: {integrity: sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==} - - convert-to-spaces@2.0.1: - resolution: {integrity: sha512-rcQ1bsQO9799wq24uE5AM2tAILy4gXGIK/njFWcVQkGNZ96edlpY+A7bjwvzjYvLDyzmG1MmMLZhpcsb+klNMQ==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - css-color-keywords@1.0.0: - resolution: {integrity: sha512-FyyrDHZKEjXDpNJYvVsV960FiqQyXc/LlYmsxl2BcdMb2WPx0OGRVgTg55rPSyLSNMqP52R9r8geSp7apN3Ofg==} - engines: {node: '>=4'} - - css-to-react-native@3.2.0: - resolution: {integrity: sha512-e8RKaLXMOFii+02mOlqwjbD00KSEKqblnpO9e++1aXS1fPQOpS1YoqdVHBqPjHNoxeF2mimzVqawm2KCbEdtHQ==} - - csstype@3.1.3: - resolution: {integrity: sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==} - - currently-unhandled@0.4.1: - resolution: {integrity: sha512-/fITjgjGU50vjQ4FH6eUoYu+iUoUKIXws2hL15JJpIR+BbTxaXQsMuuyjtNh2WqsSBS5nsaZHFsFecyw5CCAng==} - engines: {node: '>=0.10.0'} - - date-time@3.1.0: - resolution: {integrity: sha512-uqCUKXE5q1PNBXjPqvwhwJf9SwMoAHBgWJ6DcrnS5o+W2JOiIILl0JEdVD8SGujrNS02GGxgwAg2PN2zONgtjg==} - engines: {node: '>=6'} - - debug@4.3.5: - resolution: {integrity: sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg==} - engines: {node: '>=6.0'} - peerDependencies: - supports-color: '*' - peerDependenciesMeta: - supports-color: - optional: true - - delayed-stream@1.0.0: - resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} - engines: {node: '>=0.4.0'} - - delegates@1.0.0: - resolution: {integrity: sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==} - - detect-libc@2.0.3: - resolution: {integrity: sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw==} - engines: {node: '>=8'} - - emittery@1.0.3: - resolution: {integrity: sha512-tJdCJitoy2lrC2ldJcqN4vkqJ00lT+tOWNT1hBJjO/3FDMJa5TTIiYGCKGkn/WfCyOzUMObeohbVTj00fhiLiA==} - engines: {node: '>=14.16'} - - emnapi@1.2.0: - resolution: {integrity: sha512-rcq+dJCcfr08I0XM/57LPRqaUokGfni/+SvhO7NaJthTTjRdohhIy0FQwyC5rR1enAsjkldQg83th8J5hURv0Q==} - peerDependencies: - node-addon-api: '>= 6.1.0' - peerDependenciesMeta: - node-addon-api: - optional: true - - emoji-regex@10.3.0: - resolution: {integrity: sha512-QpLs9D9v9kArv4lfDEgg1X/gN5XLnf/A6l9cs8SPZLRZR3ZkY9+kwIQTxm+fsSej5UMYGE8fdoaZVIBlqG0XTw==} - - emoji-regex@8.0.0: - resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} - - escalade@3.1.2: - resolution: {integrity: sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==} - engines: {node: '>=6'} - - escape-string-regexp@2.0.0: - resolution: {integrity: sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==} - engines: {node: '>=8'} - - escape-string-regexp@5.0.0: - resolution: {integrity: sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==} - engines: {node: '>=12'} - - esprima@4.0.1: - resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==} - engines: {node: '>=4'} - hasBin: true - - estree-walker@2.0.2: - resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==} - - esutils@2.0.3: - resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} - engines: {node: '>=0.10.0'} - - external-editor@3.1.0: - resolution: {integrity: sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==} - engines: {node: '>=4'} - - fast-diff@1.3.0: - resolution: {integrity: sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==} - - fast-glob@3.3.2: - resolution: {integrity: sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==} - engines: {node: '>=8.6.0'} - - fastq@1.17.1: - resolution: {integrity: sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==} - - figures@6.1.0: - resolution: {integrity: sha512-d+l3qxjSesT4V7v2fh+QnmFnUWv9lSpjarhShNTgBOfA0ttejbQUAlHLitbjkoRiDulW0OPoQPYIGhIC8ohejg==} - engines: {node: '>=18'} - - file-uri-to-path@1.0.0: - resolution: {integrity: sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==} - - fill-range@7.1.1: - resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==} - engines: {node: '>=8'} - - find-up-simple@1.0.0: - resolution: {integrity: sha512-q7Us7kcjj2VMePAa02hDAF6d+MzsdsAWEwYyOpwUtlerRBkOEPBCRZrAV4XfcSN8fHAgaD0hP7miwoay6DCprw==} - engines: {node: '>=18'} - - follow-redirects@1.15.6: - resolution: {integrity: sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==} - engines: {node: '>=4.0'} - peerDependencies: - debug: '*' - peerDependenciesMeta: - debug: - optional: true - - form-data@4.0.0: - resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==} - engines: {node: '>= 6'} - - fs-minipass@2.1.0: - resolution: {integrity: sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==} - engines: {node: '>= 8'} - - fs.realpath@1.0.0: - resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} - - gauge@3.0.2: - resolution: {integrity: sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q==} - engines: {node: '>=10'} - deprecated: This package is no longer supported. - - get-caller-file@2.0.5: - resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} - engines: {node: 6.* || 8.* || >= 10.*} - - get-east-asian-width@1.2.0: - resolution: {integrity: sha512-2nk+7SIVb14QrgXFHcm84tD4bKQz0RxPuMT8Ag5KPOq7J5fEmAg0UbXdTOSHqNuHSU28k55qnceesxXRZGzKWA==} - engines: {node: '>=18'} - - glob-parent@5.1.2: - resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} - engines: {node: '>= 6'} - - glob@7.2.3: - resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} - deprecated: Glob versions prior to v9 are no longer supported - - globby@14.0.2: - resolution: {integrity: sha512-s3Fq41ZVh7vbbe2PN3nrW7yC7U7MFVc5c98/iTl9c2GawNMKx/J648KQRW6WKkuU8GIbbh2IXfIRQjOZnXcTnw==} - engines: {node: '>=18'} - - graceful-fs@4.2.11: - resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} - - has-unicode@2.0.1: - resolution: {integrity: sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==} - - https-proxy-agent@5.0.1: - resolution: {integrity: sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==} - engines: {node: '>= 6'} - - iconv-lite@0.4.24: - resolution: {integrity: sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==} - engines: {node: '>=0.10.0'} - - ignore-by-default@2.1.0: - resolution: {integrity: sha512-yiWd4GVmJp0Q6ghmM2B/V3oZGRmjrKLXvHR3TE1nfoXsmoggllfZUQe74EN0fJdPFZu2NIvNdrMMLm3OsV7Ohw==} - engines: {node: '>=10 <11 || >=12 <13 || >=14'} - - ignore@5.3.1: - resolution: {integrity: sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==} - engines: {node: '>= 4'} - - imurmurhash@0.1.4: - resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} - engines: {node: '>=0.8.19'} - - indent-string@5.0.0: - resolution: {integrity: sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==} - engines: {node: '>=12'} - - inflight@1.0.6: - resolution: {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. - - inherits@2.0.4: - resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} - - inquirer@10.0.1: - resolution: {integrity: sha512-XgthhRIn0Ci9JdGJpUo2EtpPfaczbooZbGTN+FTzSCyUb7YHJcPPnuSXfeG5903bJMy3OyEoVTQMnvO4Ly5tFg==} - engines: {node: '>=18'} - - ipaddr.js@2.2.0: - resolution: {integrity: sha512-Ag3wB2o37wslZS19hZqorUnrnzSkpOVy+IiiDEiTqNubEYpYuHWIf6K4psgN2ZWKExS4xhVCrRVfb/wfW8fWJA==} - engines: {node: '>= 10'} - - irregular-plurals@3.5.0: - resolution: {integrity: sha512-1ANGLZ+Nkv1ptFb2pa8oG8Lem4krflKuX/gINiHJHjJUKaJHk/SXk5x6K3J+39/p0h1RQ2saROclJJ+QLvETCQ==} - engines: {node: '>=8'} - - is-extglob@2.1.1: - resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} - engines: {node: '>=0.10.0'} - - is-fullwidth-code-point@3.0.0: - resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} - engines: {node: '>=8'} - - is-fullwidth-code-point@4.0.0: - resolution: {integrity: sha512-O4L094N2/dZ7xqVdrXhh9r1KODPJpFms8B5sGdJLPy664AgvXsreZUyCQQNItZRDlYug4xStLjNp/sz3HvBowQ==} - engines: {node: '>=12'} - - is-glob@4.0.3: - resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} - engines: {node: '>=0.10.0'} - - is-number@7.0.0: - resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} - engines: {node: '>=0.12.0'} - - is-plain-object@5.0.0: - resolution: {integrity: sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==} - engines: {node: '>=0.10.0'} - - is-promise@4.0.0: - resolution: {integrity: sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==} - - is-unicode-supported@2.0.0: - resolution: {integrity: sha512-FRdAyx5lusK1iHG0TWpVtk9+1i+GjrzRffhDg4ovQ7mcidMQ6mj+MhKPmvh7Xwyv5gIS06ns49CA7Sqg7lC22Q==} - engines: {node: '>=18'} - - js-string-escape@1.0.1: - resolution: {integrity: sha512-Smw4xcfIQ5LVjAOuJCvN/zIodzA/BBSsluuoSykP+lUvScIi4U6RJLfwHet5cxFnCswUjISV8oAXaqaJDY3chg==} - engines: {node: '>= 0.8'} - - js-tokens@4.0.0: - resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} - - js-yaml@3.14.1: - resolution: {integrity: sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==} - hasBin: true - - js-yaml@4.1.0: - resolution: {integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==} - hasBin: true - - load-json-file@7.0.1: - resolution: {integrity: sha512-Gnxj3ev3mB5TkVBGad0JM6dmLiQL+o0t23JPBZ9sd+yvSLk05mFoqKBw5N8gbbkU4TNXyqCgIrl/VM17OgUIgQ==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - lodash-es@4.17.21: - resolution: {integrity: sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==} - - lodash@4.17.21: - resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} - - loose-envify@1.4.0: - resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==} - hasBin: true - - make-dir@3.1.0: - resolution: {integrity: sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==} - engines: {node: '>=8'} - - matcher@5.0.0: - resolution: {integrity: sha512-s2EMBOWtXFc8dgqvoAzKJXxNHibcdJMV0gwqKUaw9E2JBJuGUK7DrNKrA6g/i+v72TT16+6sVm5mS3thaMLQUw==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - md5-hex@3.0.1: - resolution: {integrity: sha512-BUiRtTtV39LIJwinWBjqVsU9xhdnz7/i889V859IBFpuqGAj6LuOvHv5XLbgZ2R7ptJoJaEcxkv88/h25T7Ciw==} - engines: {node: '>=8'} - - memoize@10.0.0: - resolution: {integrity: sha512-H6cBLgsi6vMWOcCpvVCdFFnl3kerEXbrYh9q+lY6VXvQSmM6CkmV08VOwT+WE2tzIEqRPFfAq3fm4v/UIW6mSA==} - engines: {node: '>=18'} - - merge2@1.4.1: - resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} - engines: {node: '>= 8'} - - micromatch@4.0.7: - resolution: {integrity: sha512-LPP/3KorzCwBxfeUuZmaR6bG2kdeHSbe0P2tY3FLRU4vYrjYz5hI4QZwV0njUx3jeuKe67YukQ1LSPZBKDqO/Q==} - engines: {node: '>=8.6'} - - mime-db@1.52.0: - resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} - engines: {node: '>= 0.6'} - - mime-types@2.1.35: - resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} - engines: {node: '>= 0.6'} - - mimic-function@5.0.1: - resolution: {integrity: sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==} - engines: {node: '>=18'} - - minimatch@3.1.2: - resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} - - minipass@3.3.6: - resolution: {integrity: sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==} - engines: {node: '>=8'} - - minipass@5.0.0: - resolution: {integrity: sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==} - engines: {node: '>=8'} - - minizlib@2.1.2: - resolution: {integrity: sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==} - engines: {node: '>= 8'} - - mkdirp@1.0.4: - resolution: {integrity: sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==} - engines: {node: '>=10'} - hasBin: true - - ms@2.1.2: - resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} - - ms@2.1.3: - resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} - - mute-stream@1.0.0: - resolution: {integrity: sha512-avsJQhyd+680gKXyG/sQc0nXaC6rBkPOfyHYcFb9+hdkqQkR9bdnkJ0AMZhke0oesPqIO+mFFJ+IdBc7mst4IA==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - - nanoid@3.3.7: - resolution: {integrity: sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==} - engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} - hasBin: true - - node-fetch@2.7.0: - resolution: {integrity: sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==} - engines: {node: 4.x || >=6.0.0} - peerDependencies: - encoding: ^0.1.0 - peerDependenciesMeta: - encoding: - optional: true - - node-gyp-build@4.8.1: - resolution: {integrity: sha512-OSs33Z9yWr148JZcbZd5WiAXhh/n9z8TxQcdMhIOlpN9AhWpLfvVFO73+m77bBABQMaY9XSvIa+qk0jlI7Gcaw==} - hasBin: true - - nofilter@3.1.0: - resolution: {integrity: sha512-l2NNj07e9afPnhAhvgVrCD/oy2Ai1yfLpuo3EpiO1jFTsB4sFz6oIfAfSZyQzVpkZQ9xS8ZS5g1jCBgq4Hwo0g==} - engines: {node: '>=12.19'} - - nopt@5.0.0: - resolution: {integrity: sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==} - engines: {node: '>=6'} - hasBin: true - - npmlog@5.0.1: - resolution: {integrity: sha512-AqZtDUWOMKs1G/8lwylVjrdYgqA4d9nu8hc+0gzRxlDb1I10+FHBGMXs6aiQHFdCUUlqH99MUMuLfzWDNDtfxw==} - deprecated: This package is no longer supported. - - object-assign@4.1.1: - resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} - engines: {node: '>=0.10.0'} - - once@1.4.0: - resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} - - os-tmpdir@1.0.2: - resolution: {integrity: sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==} - engines: {node: '>=0.10.0'} - - p-map@7.0.2: - resolution: {integrity: sha512-z4cYYMMdKHzw4O5UkWJImbZynVIo0lSGTXc7bzB1e/rrDqkgGUNysK/o4bTr+0+xKvvLoTyGqYC4Fgljy9qe1Q==} - engines: {node: '>=18'} - - package-config@5.0.0: - resolution: {integrity: sha512-GYTTew2slBcYdvRHqjhwaaydVMvn/qrGC323+nKclYioNSLTDUM/lGgtGTgyHVtYcozb+XkE8CNhwcraOmZ9Mg==} - engines: {node: '>=18'} - - parse-ms@4.0.0: - resolution: {integrity: sha512-TXfryirbmq34y8QBwgqCVLi+8oA3oWx2eAnSn62ITyEhEYaWRlVZ2DvMM9eZbMs/RfxPu/PK/aBLyGj4IrqMHw==} - engines: {node: '>=18'} - - path-is-absolute@1.0.1: - resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==} - engines: {node: '>=0.10.0'} - - path-type@5.0.0: - resolution: {integrity: sha512-5HviZNaZcfqP95rwpv+1HDgUamezbqdSYTyzjTvwtJSnIH+3vnbmWsItli8OFEndS984VT55M3jduxZbX351gg==} - engines: {node: '>=12'} - - picocolors@1.0.1: - resolution: {integrity: sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==} - - picomatch@2.3.1: - resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} - engines: {node: '>=8.6'} - - picomatch@3.0.1: - resolution: {integrity: sha512-I3EurrIQMlRc9IaAZnqRR044Phh2DXY+55o7uJ0V+hYZAcQYSuFWsc9q5PvyDHUSCe1Qxn/iBz+78s86zWnGag==} - engines: {node: '>=10'} - - plur@5.1.0: - resolution: {integrity: sha512-VP/72JeXqak2KiOzjgKtQen5y3IZHn+9GOuLDafPv0eXa47xq0At93XahYBs26MsifCQ4enGKwbjBTKgb9QJXg==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - postcss-value-parser@4.2.0: - resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==} - - postcss@8.4.33: - resolution: {integrity: sha512-Kkpbhhdjw2qQs2O2DGX+8m5OVqEcbB9HRBvuYM9pgrjEFUg30A9LmXNlTAUj4S9kgtGyrMbTzVjH7E+s5Re2yg==} - engines: {node: ^10 || ^12 || >=14} - - pretty-ms@9.0.0: - resolution: {integrity: sha512-E9e9HJ9R9NasGOgPaPE8VMeiPKAyWR5jcFpNnwIejslIhWqdqOrb2wShBsncMPUb+BcCd2OPYfh7p2W6oemTng==} - engines: {node: '>=18'} - - proxy-from-env@1.1.0: - resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==} - - queue-microtask@1.2.3: - resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} - - react-dom@18.3.1: - resolution: {integrity: sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==} - peerDependencies: - react: ^18.3.1 - - react@18.3.1: - resolution: {integrity: sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==} - engines: {node: '>=0.10.0'} - - readable-stream@3.6.2: - resolution: {integrity: sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==} - engines: {node: '>= 6'} - - require-directory@2.1.1: - resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} - engines: {node: '>=0.10.0'} - - resolve-cwd@3.0.0: - resolution: {integrity: sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==} - engines: {node: '>=8'} - - resolve-from@5.0.0: - resolution: {integrity: sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==} - engines: {node: '>=8'} - - reusify@1.0.4: - resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==} - engines: {iojs: '>=1.0.0', node: '>=0.10.0'} - - rimraf@3.0.2: - resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==} - deprecated: Rimraf versions prior to v4 are no longer supported - hasBin: true - - run-async@3.0.0: - resolution: {integrity: sha512-540WwVDOMxA6dN6We19EcT9sc3hkXPw5mzRNGM3FkdN/vtE9NFvj5lFAPNwUDmJjXidm3v7TC1cTE7t17Ulm1Q==} - engines: {node: '>=0.12.0'} - - run-parallel@1.2.0: - resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} - - rxjs@7.8.1: - resolution: {integrity: sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==} - - safe-buffer@5.2.1: - resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} - - safer-buffer@2.1.2: - resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} - - scheduler@0.23.2: - resolution: {integrity: sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ==} - - semver@6.3.1: - resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} - hasBin: true - - semver@7.6.2: - resolution: {integrity: sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==} - engines: {node: '>=10'} - hasBin: true - - serialize-error@7.0.1: - resolution: {integrity: sha512-8I8TjW5KMOKsZQTvoxjuSIa7foAwPWGOts+6o7sgjz41/qMD9VQHEDxi6PBvK2l0MXUmqZyNpUK+T2tQaaElvw==} - engines: {node: '>=10'} - - set-blocking@2.0.0: - resolution: {integrity: sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==} - - shallowequal@1.1.0: - resolution: {integrity: sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ==} - - signal-exit@3.0.7: - resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} - - signal-exit@4.1.0: - resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} - engines: {node: '>=14'} - - slash@5.1.0: - resolution: {integrity: sha512-ZA6oR3T/pEyuqwMgAKT0/hAv8oAXckzbkmR0UkUosQ+Mc4RxGoJkRmwHgHufaenlyAgE1Mxgpdcrf75y6XcnDg==} - engines: {node: '>=14.16'} - - slice-ansi@5.0.0: - resolution: {integrity: sha512-FC+lgizVPfie0kkhqUScwRu1O/lF6NOgJmlCgK+/LYxDCTk8sGelYaHDhFcDN+Sn3Cv+3VSa4Byeo+IMCzpMgQ==} - engines: {node: '>=12'} - - source-map-js@1.2.0: - resolution: {integrity: sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==} - engines: {node: '>=0.10.0'} - - sprintf-js@1.0.3: - resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==} - - stack-utils@2.0.6: - resolution: {integrity: sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==} - engines: {node: '>=10'} - - string-width@4.2.3: - resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} - engines: {node: '>=8'} - - string-width@7.2.0: - resolution: {integrity: sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==} - engines: {node: '>=18'} - - string_decoder@1.3.0: - resolution: {integrity: sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==} - - strip-ansi@6.0.1: - resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} - engines: {node: '>=8'} - - strip-ansi@7.1.0: - resolution: {integrity: sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==} - engines: {node: '>=12'} - - styled-components@6.1.1: - resolution: {integrity: sha512-cpZZP5RrKRIClBW5Eby4JM1wElLVP4NQrJbJ0h10TidTyJf4SIIwa3zLXOoPb4gJi8MsJ8mjq5mu2IrEhZIAcQ==} - engines: {node: '>= 16'} - peerDependencies: - react: '>= 16.8.0' - react-dom: '>= 16.8.0' - - stylis@4.3.2: - resolution: {integrity: sha512-bhtUjWd/z6ltJiQwg0dUfxEJ+W+jdqQd8TbWLWyeIJHlnsqmGLRFFd8e5mA0AZi/zx90smXRlN66YMTcaSFifg==} - - supertap@3.0.1: - resolution: {integrity: sha512-u1ZpIBCawJnO+0QePsEiOknOfCRq0yERxiAchT0i4li0WHNUJbf0evXXSXOcCAR4M8iMDoajXYmstm/qO81Isw==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - tar@6.2.1: - resolution: {integrity: sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==} - engines: {node: '>=10'} - - temp-dir@3.0.0: - resolution: {integrity: sha512-nHc6S/bwIilKHNRgK/3jlhDoIHcp45YgyiwcAk46Tr0LfEqGBVpmiAyuiuxeVE44m3mXnEeVhaipLOEWmH+Njw==} - engines: {node: '>=14.16'} - - time-zone@1.0.0: - resolution: {integrity: sha512-TIsDdtKo6+XrPtiTm1ssmMngN1sAhyKnTO2kunQWqNPWIVvCm15Wmw4SWInwTVgJ5u/Tr04+8Ei9TNcw4x4ONA==} - engines: {node: '>=4'} - - tmp@0.0.33: - resolution: {integrity: sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==} - engines: {node: '>=0.6.0'} - - to-regex-range@5.0.1: - resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} - engines: {node: '>=8.0'} - - toml@3.0.0: - resolution: {integrity: sha512-y/mWCZinnvxjTKYhJ+pYxwD0mRLVvOtdS2Awbgxln6iEnt4rk0yBxeSBHkGJcPucRiG0e55mwWp+g/05rsrd6w==} - - tr46@0.0.3: - resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==} - - tslib@2.6.3: - resolution: {integrity: sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ==} - - typanion@3.14.0: - resolution: {integrity: sha512-ZW/lVMRabETuYCd9O9ZvMhAh8GslSqaUjxmK/JLPCh6l73CvLBiuXswj/+7LdnWOgYsQ130FqLzFz5aGT4I3Ug==} - - type-fest@0.13.1: - resolution: {integrity: sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==} - engines: {node: '>=10'} - - type-fest@0.21.3: - resolution: {integrity: sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==} - engines: {node: '>=10'} - - typescript@5.5.4: - resolution: {integrity: sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q==} - engines: {node: '>=14.17'} - hasBin: true - - undici-types@6.19.8: - resolution: {integrity: sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==} - - unicorn-magic@0.1.0: - resolution: {integrity: sha512-lRfVq8fE8gz6QMBuDM6a+LO3IAzTi05H6gCVaUpir2E1Rwpo4ZUog45KpNXKC/Mn3Yb9UDuHumeFTo9iV/D9FQ==} - engines: {node: '>=18'} - - universal-user-agent@7.0.2: - resolution: {integrity: sha512-0JCqzSKnStlRRQfCdowvqy3cy0Dvtlb8xecj/H8JFZuCze4rwjPZQOgvFvn0Ws/usCHQFGpyr+pB9adaGwXn4Q==} - - util-deprecate@1.0.2: - resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} - - wasm-sjlj@1.0.5: - resolution: {integrity: sha512-Z/MHJeOkAvJJVWnGX3/YZGYldGaawZbYHX4ldYG9kLhcdB8H31F5x66M7Zc4BP/7pg0aLsusQj1629m2B3Rilg==} - - webidl-conversions@3.0.1: - resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==} - - well-known-symbols@2.0.0: - resolution: {integrity: sha512-ZMjC3ho+KXo0BfJb7JgtQ5IBuvnShdlACNkKkdsqBmYw3bPAaJfPeYUo6tLUaT5tG/Gkh7xkpBhKRQ9e7pyg9Q==} - engines: {node: '>=6'} - - whatwg-url@5.0.0: - resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==} - - wide-align@1.1.5: - resolution: {integrity: sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==} - - wrap-ansi@6.2.0: - resolution: {integrity: sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==} - engines: {node: '>=8'} - - wrap-ansi@7.0.0: - resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==} - engines: {node: '>=10'} - - wrappy@1.0.2: - resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} - - write-file-atomic@5.0.1: - resolution: {integrity: sha512-+QU2zd6OTD8XWIJCbffaiQeH9U73qIqafo1x6V1snCWYGJf6cVE0cDR4D8xRzcEnfI21IFrUPzPGtcPf8AC+Rw==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - - y18n@5.0.8: - resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==} - engines: {node: '>=10'} - - yallist@4.0.0: - resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==} - - yargs-parser@21.1.1: - resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} - engines: {node: '>=12'} - - yargs@17.7.2: - resolution: {integrity: sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==} - engines: {node: '>=12'} - - yoctocolors-cjs@2.1.2: - resolution: {integrity: sha512-cYVsTjKl8b+FrnidjibDWskAv7UKOfcwaVZdp/it9n1s9fU3IkgDbhdIRKCW4JDsAlECJY0ytoVPT3sK6kideA==} - engines: {node: '>=18'} - -snapshots: - - '@emnapi/core@1.2.0': - dependencies: - '@emnapi/wasi-threads': 1.0.1 - tslib: 2.6.3 - - '@emnapi/runtime@1.2.0': - dependencies: - tslib: 2.6.3 - - '@emnapi/wasi-threads@1.0.1': - dependencies: - tslib: 2.6.3 - - '@emotion/is-prop-valid@1.2.2': - dependencies: - '@emotion/memoize': 0.8.1 - - '@emotion/memoize@0.8.1': {} - - '@emotion/unitless@0.8.1': {} - - '@inquirer/checkbox@2.3.10': - dependencies: - '@inquirer/core': 9.0.2 - '@inquirer/figures': 1.0.3 - '@inquirer/type': 1.4.0 - ansi-escapes: 4.3.2 - yoctocolors-cjs: 2.1.2 - - '@inquirer/confirm@3.1.14': - dependencies: - '@inquirer/core': 9.0.2 - '@inquirer/type': 1.4.0 - - '@inquirer/core@9.0.2': - dependencies: - '@inquirer/figures': 1.0.3 - '@inquirer/type': 1.4.0 - '@types/mute-stream': 0.0.4 - '@types/node': 20.16.5 - '@types/wrap-ansi': 3.0.0 - ansi-escapes: 4.3.2 - cli-spinners: 2.9.2 - cli-width: 4.1.0 - mute-stream: 1.0.0 - signal-exit: 4.1.0 - strip-ansi: 6.0.1 - wrap-ansi: 6.2.0 - yoctocolors-cjs: 2.1.2 - - '@inquirer/editor@2.1.14': - dependencies: - '@inquirer/core': 9.0.2 - '@inquirer/type': 1.4.0 - external-editor: 3.1.0 - - '@inquirer/expand@2.1.14': - dependencies: - '@inquirer/core': 9.0.2 - '@inquirer/type': 1.4.0 - yoctocolors-cjs: 2.1.2 - - '@inquirer/figures@1.0.3': {} - - '@inquirer/input@2.2.1': - dependencies: - '@inquirer/core': 9.0.2 - '@inquirer/type': 1.4.0 - - '@inquirer/number@1.0.2': - dependencies: - '@inquirer/core': 9.0.2 - '@inquirer/type': 1.4.0 - - '@inquirer/password@2.1.14': - dependencies: - '@inquirer/core': 9.0.2 - '@inquirer/type': 1.4.0 - ansi-escapes: 4.3.2 - - '@inquirer/prompts@5.1.2': - dependencies: - '@inquirer/checkbox': 2.3.10 - '@inquirer/confirm': 3.1.14 - '@inquirer/editor': 2.1.14 - '@inquirer/expand': 2.1.14 - '@inquirer/input': 2.2.1 - '@inquirer/number': 1.0.2 - '@inquirer/password': 2.1.14 - '@inquirer/rawlist': 2.1.14 - '@inquirer/select': 2.3.10 - - '@inquirer/rawlist@2.1.14': - dependencies: - '@inquirer/core': 9.0.2 - '@inquirer/type': 1.4.0 - yoctocolors-cjs: 2.1.2 - - '@inquirer/select@2.3.10': - dependencies: - '@inquirer/core': 9.0.2 - '@inquirer/figures': 1.0.3 - '@inquirer/type': 1.4.0 - ansi-escapes: 4.3.2 - yoctocolors-cjs: 2.1.2 - - '@inquirer/type@1.4.0': - dependencies: - mute-stream: 1.0.0 - - '@mapbox/node-pre-gyp@1.0.11': - dependencies: - detect-libc: 2.0.3 - https-proxy-agent: 5.0.1 - make-dir: 3.1.0 - node-fetch: 2.7.0 - nopt: 5.0.0 - npmlog: 5.0.1 - rimraf: 3.0.2 - semver: 7.6.2 - tar: 6.2.1 - transitivePeerDependencies: - - encoding - - supports-color - - '@napi-rs/cli@3.0.0-alpha.62(@emnapi/runtime@1.2.0)(emnapi@1.2.0)': - dependencies: - '@napi-rs/cross-toolchain': 0.0.16 - '@napi-rs/wasm-tools': 0.0.2 - '@octokit/rest': 21.0.0 - clipanion: 3.2.1(typanion@3.14.0) - colorette: 2.0.20 - debug: 4.3.5 - inquirer: 10.0.1 - js-yaml: 4.1.0 - lodash-es: 4.17.21 - semver: 7.6.2 - toml: 3.0.0 - typanion: 3.14.0 - wasm-sjlj: 1.0.5 - optionalDependencies: - '@emnapi/runtime': 1.2.0 - emnapi: 1.2.0 - transitivePeerDependencies: - - '@napi-rs/cross-toolchain-arm64-target-aarch64' - - '@napi-rs/cross-toolchain-arm64-target-armv7' - - '@napi-rs/cross-toolchain-arm64-target-x86_64' - - '@napi-rs/cross-toolchain-x64-target-aarch64' - - '@napi-rs/cross-toolchain-x64-target-armv7' - - '@napi-rs/cross-toolchain-x64-target-x86_64' - - supports-color - - '@napi-rs/cross-toolchain@0.0.16': - dependencies: - '@napi-rs/lzma': 1.3.1 - '@napi-rs/tar': 0.1.1 - debug: 4.3.5 - transitivePeerDependencies: - - supports-color - - '@napi-rs/lzma-android-arm-eabi@1.3.1': - optional: true - - '@napi-rs/lzma-android-arm64@1.3.1': - optional: true - - '@napi-rs/lzma-darwin-arm64@1.3.1': - optional: true - - '@napi-rs/lzma-darwin-x64@1.3.1': - optional: true - - '@napi-rs/lzma-freebsd-x64@1.3.1': - optional: true - - '@napi-rs/lzma-linux-arm-gnueabihf@1.3.1': - optional: true - - '@napi-rs/lzma-linux-arm64-gnu@1.3.1': - optional: true - - '@napi-rs/lzma-linux-arm64-musl@1.3.1': - optional: true - - '@napi-rs/lzma-linux-x64-gnu@1.3.1': - optional: true - - '@napi-rs/lzma-linux-x64-musl@1.3.1': - optional: true - - '@napi-rs/lzma-wasm32-wasi@1.3.1': - dependencies: - '@napi-rs/wasm-runtime': 0.2.4 - optional: true - - '@napi-rs/lzma-win32-arm64-msvc@1.3.1': - optional: true - - '@napi-rs/lzma-win32-ia32-msvc@1.3.1': - optional: true - - '@napi-rs/lzma-win32-x64-msvc@1.3.1': - optional: true - - '@napi-rs/lzma@1.3.1': - optionalDependencies: - '@napi-rs/lzma-android-arm-eabi': 1.3.1 - '@napi-rs/lzma-android-arm64': 1.3.1 - '@napi-rs/lzma-darwin-arm64': 1.3.1 - '@napi-rs/lzma-darwin-x64': 1.3.1 - '@napi-rs/lzma-freebsd-x64': 1.3.1 - '@napi-rs/lzma-linux-arm-gnueabihf': 1.3.1 - '@napi-rs/lzma-linux-arm64-gnu': 1.3.1 - '@napi-rs/lzma-linux-arm64-musl': 1.3.1 - '@napi-rs/lzma-linux-x64-gnu': 1.3.1 - '@napi-rs/lzma-linux-x64-musl': 1.3.1 - '@napi-rs/lzma-wasm32-wasi': 1.3.1 - '@napi-rs/lzma-win32-arm64-msvc': 1.3.1 - '@napi-rs/lzma-win32-ia32-msvc': 1.3.1 - '@napi-rs/lzma-win32-x64-msvc': 1.3.1 - - '@napi-rs/tar-android-arm-eabi@0.1.1': - optional: true - - '@napi-rs/tar-android-arm64@0.1.1': - optional: true - - '@napi-rs/tar-darwin-arm64@0.1.1': - optional: true - - '@napi-rs/tar-darwin-x64@0.1.1': - optional: true - - '@napi-rs/tar-freebsd-x64@0.1.1': - optional: true - - '@napi-rs/tar-linux-arm-gnueabihf@0.1.1': - optional: true - - '@napi-rs/tar-linux-arm64-gnu@0.1.1': - optional: true - - '@napi-rs/tar-linux-arm64-musl@0.1.1': - optional: true - - '@napi-rs/tar-linux-x64-gnu@0.1.1': - optional: true - - '@napi-rs/tar-linux-x64-musl@0.1.1': - optional: true - - '@napi-rs/tar-wasm32-wasi@0.1.1': - dependencies: - '@napi-rs/wasm-runtime': 0.2.4 - optional: true - - '@napi-rs/tar-win32-arm64-msvc@0.1.1': - optional: true - - '@napi-rs/tar-win32-ia32-msvc@0.1.1': - optional: true - - '@napi-rs/tar-win32-x64-msvc@0.1.1': - optional: true - - '@napi-rs/tar@0.1.1': - optionalDependencies: - '@napi-rs/tar-android-arm-eabi': 0.1.1 - '@napi-rs/tar-android-arm64': 0.1.1 - '@napi-rs/tar-darwin-arm64': 0.1.1 - '@napi-rs/tar-darwin-x64': 0.1.1 - '@napi-rs/tar-freebsd-x64': 0.1.1 - '@napi-rs/tar-linux-arm-gnueabihf': 0.1.1 - '@napi-rs/tar-linux-arm64-gnu': 0.1.1 - '@napi-rs/tar-linux-arm64-musl': 0.1.1 - '@napi-rs/tar-linux-x64-gnu': 0.1.1 - '@napi-rs/tar-linux-x64-musl': 0.1.1 - '@napi-rs/tar-wasm32-wasi': 0.1.1 - '@napi-rs/tar-win32-arm64-msvc': 0.1.1 - '@napi-rs/tar-win32-ia32-msvc': 0.1.1 - '@napi-rs/tar-win32-x64-msvc': 0.1.1 - - '@napi-rs/wasm-runtime@0.2.4': - dependencies: - '@emnapi/core': 1.2.0 - '@emnapi/runtime': 1.2.0 - '@tybys/wasm-util': 0.9.0 - - '@napi-rs/wasm-tools-android-arm-eabi@0.0.2': - optional: true - - '@napi-rs/wasm-tools-android-arm64@0.0.2': - optional: true - - '@napi-rs/wasm-tools-darwin-arm64@0.0.2': - optional: true - - '@napi-rs/wasm-tools-darwin-x64@0.0.2': - optional: true - - '@napi-rs/wasm-tools-freebsd-x64@0.0.2': - optional: true - - '@napi-rs/wasm-tools-linux-arm64-gnu@0.0.2': - optional: true - - '@napi-rs/wasm-tools-linux-arm64-musl@0.0.2': - optional: true - - '@napi-rs/wasm-tools-linux-x64-gnu@0.0.2': - optional: true - - '@napi-rs/wasm-tools-linux-x64-musl@0.0.2': - optional: true - - '@napi-rs/wasm-tools-wasm32-wasi@0.0.2': - dependencies: - '@napi-rs/wasm-runtime': 0.2.4 - optional: true - - '@napi-rs/wasm-tools-win32-arm64-msvc@0.0.2': - optional: true - - '@napi-rs/wasm-tools-win32-ia32-msvc@0.0.2': - optional: true - - '@napi-rs/wasm-tools-win32-x64-msvc@0.0.2': - optional: true - - '@napi-rs/wasm-tools@0.0.2': - optionalDependencies: - '@napi-rs/wasm-tools-android-arm-eabi': 0.0.2 - '@napi-rs/wasm-tools-android-arm64': 0.0.2 - '@napi-rs/wasm-tools-darwin-arm64': 0.0.2 - '@napi-rs/wasm-tools-darwin-x64': 0.0.2 - '@napi-rs/wasm-tools-freebsd-x64': 0.0.2 - '@napi-rs/wasm-tools-linux-arm64-gnu': 0.0.2 - '@napi-rs/wasm-tools-linux-arm64-musl': 0.0.2 - '@napi-rs/wasm-tools-linux-x64-gnu': 0.0.2 - '@napi-rs/wasm-tools-linux-x64-musl': 0.0.2 - '@napi-rs/wasm-tools-wasm32-wasi': 0.0.2 - '@napi-rs/wasm-tools-win32-arm64-msvc': 0.0.2 - '@napi-rs/wasm-tools-win32-ia32-msvc': 0.0.2 - '@napi-rs/wasm-tools-win32-x64-msvc': 0.0.2 - - '@nodelib/fs.scandir@2.1.5': - dependencies: - '@nodelib/fs.stat': 2.0.5 - run-parallel: 1.2.0 - - '@nodelib/fs.stat@2.0.5': {} - - '@nodelib/fs.walk@1.2.8': - dependencies: - '@nodelib/fs.scandir': 2.1.5 - fastq: 1.17.1 - - '@octokit/auth-token@5.1.1': {} - - '@octokit/core@6.1.2': - dependencies: - '@octokit/auth-token': 5.1.1 - '@octokit/graphql': 8.1.1 - '@octokit/request': 9.1.1 - '@octokit/request-error': 6.1.2 - '@octokit/types': 13.5.0 - before-after-hook: 3.0.2 - universal-user-agent: 7.0.2 - - '@octokit/endpoint@10.1.1': - dependencies: - '@octokit/types': 13.5.0 - universal-user-agent: 7.0.2 - - '@octokit/graphql@8.1.1': - dependencies: - '@octokit/request': 9.1.1 - '@octokit/types': 13.5.0 - universal-user-agent: 7.0.2 - - '@octokit/openapi-types@22.2.0': {} - - '@octokit/plugin-paginate-rest@11.3.3(@octokit/core@6.1.2)': - dependencies: - '@octokit/core': 6.1.2 - '@octokit/types': 13.5.0 - - '@octokit/plugin-request-log@5.3.0(@octokit/core@6.1.2)': - dependencies: - '@octokit/core': 6.1.2 - - '@octokit/plugin-rest-endpoint-methods@13.2.4(@octokit/core@6.1.2)': - dependencies: - '@octokit/core': 6.1.2 - '@octokit/types': 13.5.0 - - '@octokit/request-error@6.1.2': - dependencies: - '@octokit/types': 13.5.0 - - '@octokit/request@9.1.1': - dependencies: - '@octokit/endpoint': 10.1.1 - '@octokit/request-error': 6.1.2 - '@octokit/types': 13.5.0 - universal-user-agent: 7.0.2 - - '@octokit/rest@21.0.0': - dependencies: - '@octokit/core': 6.1.2 - '@octokit/plugin-paginate-rest': 11.3.3(@octokit/core@6.1.2) - '@octokit/plugin-request-log': 5.3.0(@octokit/core@6.1.2) - '@octokit/plugin-rest-endpoint-methods': 13.2.4(@octokit/core@6.1.2) - - '@octokit/types@13.5.0': - dependencies: - '@octokit/openapi-types': 22.2.0 - - '@rollup/pluginutils@4.2.1': - dependencies: - estree-walker: 2.0.2 - picomatch: 2.3.1 - - '@sindresorhus/merge-streams@2.3.0': {} - - '@tybys/wasm-util@0.9.0': - dependencies: - tslib: 2.6.3 - - '@types/mute-stream@0.0.4': - dependencies: - '@types/node': 22.5.4 - - '@types/node@20.16.5': - dependencies: - undici-types: 6.19.8 - - '@types/node@22.5.4': - dependencies: - undici-types: 6.19.8 - - '@types/stylis@4.2.6': {} - - '@types/wrap-ansi@3.0.0': {} - - '@vercel/nft@0.26.5': - dependencies: - '@mapbox/node-pre-gyp': 1.0.11 - '@rollup/pluginutils': 4.2.1 - acorn: 8.12.1 - acorn-import-attributes: 1.9.5(acorn@8.12.1) - async-sema: 3.1.1 - bindings: 1.5.0 - estree-walker: 2.0.2 - glob: 7.2.3 - graceful-fs: 4.2.11 - micromatch: 4.0.7 - node-gyp-build: 4.8.1 - resolve-from: 5.0.0 - transitivePeerDependencies: - - encoding - - supports-color - - abbrev@1.1.1: {} - - acorn-import-attributes@1.9.5(acorn@8.12.1): - dependencies: - acorn: 8.12.1 - - acorn-walk@8.3.3: - dependencies: - acorn: 8.12.1 - - acorn@8.12.1: {} - - agent-base@6.0.2: - dependencies: - debug: 4.3.5 - transitivePeerDependencies: - - supports-color - - ansi-escapes@4.3.2: - dependencies: - type-fest: 0.21.3 - - ansi-regex@5.0.1: {} - - ansi-regex@6.0.1: {} - - ansi-styles@4.3.0: - dependencies: - color-convert: 2.0.1 - - ansi-styles@6.2.1: {} - - aproba@2.0.0: {} - - are-we-there-yet@2.0.0: - dependencies: - delegates: 1.0.0 - readable-stream: 3.6.2 - - argparse@1.0.10: - dependencies: - sprintf-js: 1.0.3 - - argparse@2.0.1: {} - - array-find-index@1.0.2: {} - - arrgv@1.0.2: {} - - arrify@3.0.0: {} - - async-sema@3.1.1: {} - - asynckit@0.4.0: {} - - ava@6.1.3: - dependencies: - '@vercel/nft': 0.26.5 - acorn: 8.12.1 - acorn-walk: 8.3.3 - ansi-styles: 6.2.1 - arrgv: 1.0.2 - arrify: 3.0.0 - callsites: 4.2.0 - cbor: 9.0.2 - chalk: 5.3.0 - chunkd: 2.0.1 - ci-info: 4.0.0 - ci-parallel-vars: 1.0.1 - cli-truncate: 4.0.0 - code-excerpt: 4.0.0 - common-path-prefix: 3.0.0 - concordance: 5.0.4 - currently-unhandled: 0.4.1 - debug: 4.3.5 - emittery: 1.0.3 - figures: 6.1.0 - globby: 14.0.2 - ignore-by-default: 2.1.0 - indent-string: 5.0.0 - is-plain-object: 5.0.0 - is-promise: 4.0.0 - matcher: 5.0.0 - memoize: 10.0.0 - ms: 2.1.3 - p-map: 7.0.2 - package-config: 5.0.0 - picomatch: 3.0.1 - plur: 5.1.0 - pretty-ms: 9.0.0 - resolve-cwd: 3.0.0 - stack-utils: 2.0.6 - strip-ansi: 7.1.0 - supertap: 3.0.1 - temp-dir: 3.0.0 - write-file-atomic: 5.0.1 - yargs: 17.7.2 - transitivePeerDependencies: - - encoding - - supports-color - - axios@1.6.2: - dependencies: - follow-redirects: 1.15.6 - form-data: 4.0.0 - proxy-from-env: 1.1.0 - transitivePeerDependencies: - - debug - - balanced-match@1.0.2: {} - - before-after-hook@3.0.2: {} - - bindings@1.5.0: - dependencies: - file-uri-to-path: 1.0.0 - - blueimp-md5@2.19.0: {} - - brace-expansion@1.1.11: - dependencies: - balanced-match: 1.0.2 - concat-map: 0.0.1 - - braces@3.0.3: - dependencies: - fill-range: 7.1.1 - - callsites@4.2.0: {} - - camelize@1.0.1: {} - - cbor@9.0.2: - dependencies: - nofilter: 3.1.0 - - chalk@5.3.0: {} - - chardet@0.7.0: {} - - chownr@2.0.0: {} - - chunkd@2.0.1: {} - - ci-info@4.0.0: {} - - ci-parallel-vars@1.0.1: {} - - cli-spinners@2.9.2: {} - - cli-truncate@4.0.0: - dependencies: - slice-ansi: 5.0.0 - string-width: 7.2.0 - - cli-width@4.1.0: {} - - clipanion@3.2.1(typanion@3.14.0): - dependencies: - typanion: 3.14.0 - - cliui@8.0.1: - dependencies: - string-width: 4.2.3 - strip-ansi: 6.0.1 - wrap-ansi: 7.0.0 - - code-excerpt@4.0.0: - dependencies: - convert-to-spaces: 2.0.1 - - color-convert@2.0.1: - dependencies: - color-name: 1.1.4 - - color-name@1.1.4: {} - - color-support@1.1.3: {} - - colorette@2.0.20: {} - - combined-stream@1.0.8: - dependencies: - delayed-stream: 1.0.0 - - common-path-prefix@3.0.0: {} - - concat-map@0.0.1: {} - - concordance@5.0.4: - dependencies: - date-time: 3.1.0 - esutils: 2.0.3 - fast-diff: 1.3.0 - js-string-escape: 1.0.1 - lodash: 4.17.21 - md5-hex: 3.0.1 - semver: 7.6.2 - well-known-symbols: 2.0.0 - - console-control-strings@1.1.0: {} - - convert-to-spaces@2.0.1: {} - - css-color-keywords@1.0.0: {} - - css-to-react-native@3.2.0: - dependencies: - camelize: 1.0.1 - css-color-keywords: 1.0.0 - postcss-value-parser: 4.2.0 - - csstype@3.1.3: {} - - currently-unhandled@0.4.1: - dependencies: - array-find-index: 1.0.2 - - date-time@3.1.0: - dependencies: - time-zone: 1.0.0 - - debug@4.3.5: - dependencies: - ms: 2.1.2 - - delayed-stream@1.0.0: {} - - delegates@1.0.0: {} - - detect-libc@2.0.3: {} - - emittery@1.0.3: {} - - emnapi@1.2.0: {} - - emoji-regex@10.3.0: {} - - emoji-regex@8.0.0: {} - - escalade@3.1.2: {} - - escape-string-regexp@2.0.0: {} - - escape-string-regexp@5.0.0: {} - - esprima@4.0.1: {} - - estree-walker@2.0.2: {} - - esutils@2.0.3: {} - - external-editor@3.1.0: - dependencies: - chardet: 0.7.0 - iconv-lite: 0.4.24 - tmp: 0.0.33 - - fast-diff@1.3.0: {} - - fast-glob@3.3.2: - dependencies: - '@nodelib/fs.stat': 2.0.5 - '@nodelib/fs.walk': 1.2.8 - glob-parent: 5.1.2 - merge2: 1.4.1 - micromatch: 4.0.7 - - fastq@1.17.1: - dependencies: - reusify: 1.0.4 - - figures@6.1.0: - dependencies: - is-unicode-supported: 2.0.0 - - file-uri-to-path@1.0.0: {} - - fill-range@7.1.1: - dependencies: - to-regex-range: 5.0.1 - - find-up-simple@1.0.0: {} - - follow-redirects@1.15.6: {} - - form-data@4.0.0: - dependencies: - asynckit: 0.4.0 - combined-stream: 1.0.8 - mime-types: 2.1.35 - - fs-minipass@2.1.0: - dependencies: - minipass: 3.3.6 - - fs.realpath@1.0.0: {} - - gauge@3.0.2: - dependencies: - aproba: 2.0.0 - color-support: 1.1.3 - console-control-strings: 1.1.0 - has-unicode: 2.0.1 - object-assign: 4.1.1 - signal-exit: 3.0.7 - string-width: 4.2.3 - strip-ansi: 6.0.1 - wide-align: 1.1.5 - - get-caller-file@2.0.5: {} - - get-east-asian-width@1.2.0: {} - - glob-parent@5.1.2: - dependencies: - is-glob: 4.0.3 - - glob@7.2.3: - dependencies: - fs.realpath: 1.0.0 - inflight: 1.0.6 - inherits: 2.0.4 - minimatch: 3.1.2 - once: 1.4.0 - path-is-absolute: 1.0.1 - - globby@14.0.2: - dependencies: - '@sindresorhus/merge-streams': 2.3.0 - fast-glob: 3.3.2 - ignore: 5.3.1 - path-type: 5.0.0 - slash: 5.1.0 - unicorn-magic: 0.1.0 - - graceful-fs@4.2.11: {} - - has-unicode@2.0.1: {} - - https-proxy-agent@5.0.1: - dependencies: - agent-base: 6.0.2 - debug: 4.3.5 - transitivePeerDependencies: - - supports-color - - iconv-lite@0.4.24: - dependencies: - safer-buffer: 2.1.2 - - ignore-by-default@2.1.0: {} - - ignore@5.3.1: {} - - imurmurhash@0.1.4: {} - - indent-string@5.0.0: {} - - inflight@1.0.6: - dependencies: - once: 1.4.0 - wrappy: 1.0.2 - - inherits@2.0.4: {} - - inquirer@10.0.1: - dependencies: - '@inquirer/prompts': 5.1.2 - '@inquirer/type': 1.4.0 - '@types/mute-stream': 0.0.4 - ansi-escapes: 4.3.2 - mute-stream: 1.0.0 - run-async: 3.0.0 - rxjs: 7.8.1 - - ipaddr.js@2.2.0: {} - - irregular-plurals@3.5.0: {} - - is-extglob@2.1.1: {} - - is-fullwidth-code-point@3.0.0: {} - - is-fullwidth-code-point@4.0.0: {} - - is-glob@4.0.3: - dependencies: - is-extglob: 2.1.1 - - is-number@7.0.0: {} - - is-plain-object@5.0.0: {} - - is-promise@4.0.0: {} - - is-unicode-supported@2.0.0: {} - - js-string-escape@1.0.1: {} - - js-tokens@4.0.0: {} - - js-yaml@3.14.1: - dependencies: - argparse: 1.0.10 - esprima: 4.0.1 - - js-yaml@4.1.0: - dependencies: - argparse: 2.0.1 - - load-json-file@7.0.1: {} - - lodash-es@4.17.21: {} - - lodash@4.17.21: {} - - loose-envify@1.4.0: - dependencies: - js-tokens: 4.0.0 - - make-dir@3.1.0: - dependencies: - semver: 6.3.1 - - matcher@5.0.0: - dependencies: - escape-string-regexp: 5.0.0 - - md5-hex@3.0.1: - dependencies: - blueimp-md5: 2.19.0 - - memoize@10.0.0: - dependencies: - mimic-function: 5.0.1 - - merge2@1.4.1: {} - - micromatch@4.0.7: - dependencies: - braces: 3.0.3 - picomatch: 2.3.1 - - mime-db@1.52.0: {} - - mime-types@2.1.35: - dependencies: - mime-db: 1.52.0 - - mimic-function@5.0.1: {} - - minimatch@3.1.2: - dependencies: - brace-expansion: 1.1.11 - - minipass@3.3.6: - dependencies: - yallist: 4.0.0 - - minipass@5.0.0: {} - - minizlib@2.1.2: - dependencies: - minipass: 3.3.6 - yallist: 4.0.0 - - mkdirp@1.0.4: {} - - ms@2.1.2: {} - - ms@2.1.3: {} - - mute-stream@1.0.0: {} - - nanoid@3.3.7: {} - - node-fetch@2.7.0: - dependencies: - whatwg-url: 5.0.0 - - node-gyp-build@4.8.1: {} - - nofilter@3.1.0: {} - - nopt@5.0.0: - dependencies: - abbrev: 1.1.1 - - npmlog@5.0.1: - dependencies: - are-we-there-yet: 2.0.0 - console-control-strings: 1.1.0 - gauge: 3.0.2 - set-blocking: 2.0.0 - - object-assign@4.1.1: {} - - once@1.4.0: - dependencies: - wrappy: 1.0.2 - - os-tmpdir@1.0.2: {} - - p-map@7.0.2: {} - - package-config@5.0.0: - dependencies: - find-up-simple: 1.0.0 - load-json-file: 7.0.1 - - parse-ms@4.0.0: {} - - path-is-absolute@1.0.1: {} - - path-type@5.0.0: {} - - picocolors@1.0.1: {} - - picomatch@2.3.1: {} - - picomatch@3.0.1: {} - - plur@5.1.0: - dependencies: - irregular-plurals: 3.5.0 - - postcss-value-parser@4.2.0: {} - - postcss@8.4.33: - dependencies: - nanoid: 3.3.7 - picocolors: 1.0.1 - source-map-js: 1.2.0 - - pretty-ms@9.0.0: - dependencies: - parse-ms: 4.0.0 - - proxy-from-env@1.1.0: {} - - queue-microtask@1.2.3: {} - - react-dom@18.3.1(react@18.3.1): - dependencies: - loose-envify: 1.4.0 - react: 18.3.1 - scheduler: 0.23.2 - - react@18.3.1: - dependencies: - loose-envify: 1.4.0 - - readable-stream@3.6.2: - dependencies: - inherits: 2.0.4 - string_decoder: 1.3.0 - util-deprecate: 1.0.2 - - require-directory@2.1.1: {} - - resolve-cwd@3.0.0: - dependencies: - resolve-from: 5.0.0 - - resolve-from@5.0.0: {} - - reusify@1.0.4: {} - - rimraf@3.0.2: - dependencies: - glob: 7.2.3 - - run-async@3.0.0: {} - - run-parallel@1.2.0: - dependencies: - queue-microtask: 1.2.3 - - rxjs@7.8.1: - dependencies: - tslib: 2.6.3 - - safe-buffer@5.2.1: {} - - safer-buffer@2.1.2: {} - - scheduler@0.23.2: - dependencies: - loose-envify: 1.4.0 - - semver@6.3.1: {} - - semver@7.6.2: {} - - serialize-error@7.0.1: - dependencies: - type-fest: 0.13.1 - - set-blocking@2.0.0: {} - - shallowequal@1.1.0: {} - - signal-exit@3.0.7: {} - - signal-exit@4.1.0: {} - - slash@5.1.0: {} - - slice-ansi@5.0.0: - dependencies: - ansi-styles: 6.2.1 - is-fullwidth-code-point: 4.0.0 - - source-map-js@1.2.0: {} - - sprintf-js@1.0.3: {} - - stack-utils@2.0.6: - dependencies: - escape-string-regexp: 2.0.0 - - string-width@4.2.3: - dependencies: - emoji-regex: 8.0.0 - is-fullwidth-code-point: 3.0.0 - strip-ansi: 6.0.1 - - string-width@7.2.0: - dependencies: - emoji-regex: 10.3.0 - get-east-asian-width: 1.2.0 - strip-ansi: 7.1.0 - - string_decoder@1.3.0: - dependencies: - safe-buffer: 5.2.1 - - strip-ansi@6.0.1: - dependencies: - ansi-regex: 5.0.1 - - strip-ansi@7.1.0: - dependencies: - ansi-regex: 6.0.1 - - styled-components@6.1.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1): - dependencies: - '@emotion/is-prop-valid': 1.2.2 - '@emotion/unitless': 0.8.1 - '@types/stylis': 4.2.6 - css-to-react-native: 3.2.0 - csstype: 3.1.3 - postcss: 8.4.33 - react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) - shallowequal: 1.1.0 - stylis: 4.3.2 - tslib: 2.6.3 - - stylis@4.3.2: {} - - supertap@3.0.1: - dependencies: - indent-string: 5.0.0 - js-yaml: 3.14.1 - serialize-error: 7.0.1 - strip-ansi: 7.1.0 - - tar@6.2.1: - dependencies: - chownr: 2.0.0 - fs-minipass: 2.1.0 - minipass: 5.0.0 - minizlib: 2.1.2 - mkdirp: 1.0.4 - yallist: 4.0.0 - - temp-dir@3.0.0: {} - - time-zone@1.0.0: {} - - tmp@0.0.33: - dependencies: - os-tmpdir: 1.0.2 - - to-regex-range@5.0.1: - dependencies: - is-number: 7.0.0 - - toml@3.0.0: {} - - tr46@0.0.3: {} - - tslib@2.6.3: {} - - typanion@3.14.0: {} - - type-fest@0.13.1: {} - - type-fest@0.21.3: {} - - typescript@5.5.4: {} - - undici-types@6.19.8: {} - - unicorn-magic@0.1.0: {} - - universal-user-agent@7.0.2: {} - - util-deprecate@1.0.2: {} - - wasm-sjlj@1.0.5: {} - - webidl-conversions@3.0.1: {} - - well-known-symbols@2.0.0: {} - - whatwg-url@5.0.0: - dependencies: - tr46: 0.0.3 - webidl-conversions: 3.0.1 - - wide-align@1.1.5: - dependencies: - string-width: 4.2.3 - - wrap-ansi@6.2.0: - dependencies: - ansi-styles: 4.3.0 - string-width: 4.2.3 - strip-ansi: 6.0.1 - - wrap-ansi@7.0.0: - dependencies: - ansi-styles: 4.3.0 - string-width: 4.2.3 - strip-ansi: 6.0.1 - - wrappy@1.0.2: {} - - write-file-atomic@5.0.1: - dependencies: - imurmurhash: 0.1.4 - signal-exit: 4.1.0 - - y18n@5.0.8: {} - - yallist@4.0.0: {} - - yargs-parser@21.1.1: {} - - yargs@17.7.2: - dependencies: - cliui: 8.0.1 - escalade: 3.1.2 - get-caller-file: 2.0.5 - require-directory: 2.1.1 - string-width: 4.2.3 - y18n: 5.0.8 - yargs-parser: 21.1.1 - - yoctocolors-cjs@2.1.2: {} diff --git a/src/tests/alias.rs b/src/tests/alias.rs deleted file mode 100644 index e5892066..00000000 --- a/src/tests/alias.rs +++ /dev/null @@ -1,283 +0,0 @@ -//! - -use normalize_path::NormalizePath; -use std::path::Path; - -use crate::{AliasValue, Resolution, ResolveContext, ResolveError, ResolveOptions, Resolver}; - -#[test] -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -fn alias() { - use super::memory_fs::MemoryFS; - use crate::ResolverGeneric; - use std::path::{Path, PathBuf}; - - let f = Path::new("/"); - - let file_system = MemoryFS::new(&[ - ("/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", ""), - ("/dashed-name", ""), - ]); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - alias: vec![ - ("aliasA".into(), vec![AliasValue::from("a")]), - ("b$".into(), vec![AliasValue::from("a/index")]), - ("c$".into(), vec![AliasValue::from("/a/index")]), - ( - "multiAlias".into(), - vec![ - AliasValue::from("b"), - AliasValue::from("c"), - AliasValue::from("d"), - AliasValue::from("e"), - AliasValue::from("a"), - ], - ), - ("recursive".into(), vec![AliasValue::from("recursive/dir")]), - ("/d/dir".into(), vec![AliasValue::from("/c/dir")]), - ("/d/index.js".into(), vec![AliasValue::from("/c/index")]), - ("#".into(), vec![AliasValue::from("/c/dir")]), - ("@".into(), vec![AliasValue::from("/c/dir")]), - ("ignored".into(), vec![AliasValue::Ignore]), - // not part of enhanced-resolve, added to make sure query in alias value works - ("alias_query".into(), vec![AliasValue::from("a?query_after")]), - ("alias_fragment".into(), vec![AliasValue::from("a#fragment_after")]), - ("dash".into(), vec![AliasValue::Ignore]), - ("@scope/package-name/file$".into(), vec![AliasValue::from("/c/dir")]), - ], - modules: vec!["/".into()], - ..ResolveOptions::default() - }, - ); - - #[rustfmt::skip] - let pass = [ - ("should resolve a not aliased module 1", "a", "/a/index"), - ("should resolve a not aliased module 2", "a/index", "/a/index"), - ("should resolve a not aliased module 3", "a/dir", "/a/dir/index"), - ("should resolve a not aliased module 4", "a/dir/index", "/a/dir/index"), - ("should resolve an aliased module 1", "aliasA", "/a/index"), - ("should resolve an aliased module 2", "aliasA/index", "/a/index"), - ("should resolve an aliased module 3", "aliasA/dir", "/a/dir/index"), - ("should resolve an aliased module 4", "aliasA/dir/index", "/a/dir/index"), - ("should resolve '#' alias 1", "#", "/c/dir/index"), - ("should resolve '#' alias 2", "#/index", "/c/dir/index"), - ("should resolve '@' alias 1", "@", "/c/dir/index"), - ("should resolve '@' alias 2", "@/index", "/c/dir/index"), - ("should resolve a recursive aliased module 1", "recursive", "/recursive/dir/index"), - ("should resolve a recursive aliased module 2", "recursive/index", "/recursive/dir/index"), - ("should resolve a recursive aliased module 3", "recursive/dir", "/recursive/dir/index"), - ("should resolve a recursive aliased module 4", "recursive/dir/index", "/recursive/dir/index"), - ("should resolve a file aliased module 1", "b", "/a/index"), - ("should resolve a file aliased module 2", "c", "/a/index"), - ("should resolve a file aliased module with a query 1", "b?query", "/a/index?query"), - ("should resolve a file aliased module with a query 2", "c?query", "/a/index?query"), - ("should resolve a path in a file aliased module 1", "b/index", "/b/index"), - ("should resolve a path in a file aliased module 2", "b/dir", "/b/dir/index"), - ("should resolve a path in a file aliased module 3", "b/dir/index", "/b/dir/index"), - ("should resolve a path in a file aliased module 4", "c/index", "/c/index"), - ("should resolve a path in a file aliased module 5", "c/dir", "/c/dir/index"), - ("should resolve a path in a file aliased module 6", "c/dir/index", "/c/dir/index"), - ("should resolve a file aliased file 1", "d", "/c/index"), - ("should resolve a file aliased file 2", "d/dir/index", "/c/dir/index"), - ("should resolve a file in multiple aliased dirs 1", "multiAlias/dir/file", "/e/dir/file"), - ("should resolve a file in multiple aliased dirs 2", "multiAlias/anotherDir", "/e/anotherDir/index"), - // not part of enhanced-resolve, added to make sure query in alias value works - ("should resolve query in alias value", "alias_query?query_before", "/a/index?query_after"), - ("should resolve query in alias value", "alias_fragment#fragment_before", "/a/index#fragment_after"), - ("should resolve dashed name", "dashed-name", "/dashed-name"), - ("should resolve scoped package name with sub dir", "@scope/package-name/file", "/c/dir/index"), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - - #[rustfmt::skip] - let ignore = [ - ("should resolve an ignore module", "ignored", ResolveError::Ignored(f.join("ignored"))) - ]; - - for (comment, request, expected) in ignore { - let resolution = resolver.resolve(f, request); - assert_eq!(resolution, Err(expected), "{comment} {request}"); - } -} - -// Not part of enhanced-resolve -#[test] -fn infinite_recursion() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![ - ("./a".into(), vec![AliasValue::from("./b")]), - ("./b".into(), vec![AliasValue::from("./a")]), - ], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(f, "./a"); - assert_eq!(resolution, Err(ResolveError::Recursion)); -} - -fn check_slash(path: &Path) { - let s = path.to_string_lossy().to_string(); - #[cfg(target_os = "windows")] - { - assert!(!s.contains('/'), "{s}"); - assert!(s.contains('\\'), "{s}"); - } - #[cfg(not(target_os = "windows"))] - { - assert!(s.contains('/'), "{s}"); - assert!(!s.contains('\\'), "{s}"); - } -} - -#[test] -fn absolute_path() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![(f.join("foo").to_str().unwrap().to_string(), vec![AliasValue::Ignore])], - modules: vec![f.clone().to_str().unwrap().to_string()], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(&f, "foo/index"); - assert_eq!(resolution, Err(ResolveError::Ignored(f.join("foo")))); -} - -#[test] -fn system_path() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![("@app".into(), vec![AliasValue::from(f.join("alias").to_string_lossy())])], - ..ResolveOptions::default() - }); - - let specifiers = ["@app/files/a", "@app/files/a.js"]; - - for specifier in specifiers { - let path = resolver.resolve(&f, specifier).map(Resolution::into_path_buf).unwrap(); - assert_eq!(path, f.join("alias/files/a.js")); - check_slash(&path); - } -} - -#[test] -fn alias_is_full_path() { - let f = super::fixture(); - let dir = f.join("foo"); - let dir_str = dir.to_string_lossy().to_string(); - - let resolver = Resolver::new(ResolveOptions { - alias: vec![("@".into(), vec![AliasValue::Path(dir_str.clone())])], - ..ResolveOptions::default() - }); - - let mut ctx = ResolveContext::default(); - - let specifiers = [ - "@/index".to_string(), - "@/index.js".to_string(), - // specifier has multiple `/` for reasons we'll never know - "@////index".to_string(), - // specifier is a full path - dir_str, - ]; - - for specifier in specifiers { - let resolution = resolver.resolve_with_context(&f, &specifier, &mut ctx); - assert_eq!(resolution.map(|r| r.full_path()), Ok(dir.join("index.js"))); - } - - for path in ctx.file_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - check_slash(&path); - } - - for path in ctx.missing_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - check_slash(&path); - if let Some(path) = path.parent() { - assert!(!path.is_file(), "{path:?} must not be a file"); - } - } -} - -// For the `should_stop` variable in `load_alias` -#[test] -fn all_alias_values_are_not_found() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![( - "m1".to_string(), - vec![AliasValue::Path(f.join("node_modules").join("m2").to_string_lossy().to_string())], - )], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(&f, "m1/a.js"); - assert_eq!( - resolution, - Err(ResolveError::MatchedAliasNotFound("m1/a.js".to_string(), "m1".to_string(),)) - ); -} - -#[test] -fn alias_fragment() { - let f = super::fixture(); - - let data = [ - // enhanced-resolve has `#` prepended with a `\0`, they are removed from the - // following 3 expected test results. - // See https://github.com/webpack/enhanced-resolve#escaping - ( - "handle fragment edge case (no fragment)", - "./no#fragment/#/#", - f.join("no#fragment/#/#.js"), - ), - ("handle fragment edge case (fragment)", "./no#fragment/#/", f.join("no.js#fragment/#/")), - ( - "handle fragment escaping", - "./no\0#fragment/\0#/\0##fragment", - f.join("no#fragment/#/#.js#fragment"), - ), - ]; - - for (comment, request, expected) in data { - let resolver = Resolver::new(ResolveOptions { - alias: vec![("foo".to_string(), vec![AliasValue::Path(request.to_string())])], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f, "foo").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } -} - -#[test] -fn alias_try_fragment_as_path() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![( - "#".to_string(), - vec![AliasValue::Path(f.join("#").to_string_lossy().to_string())], - )], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(&f, "#/a").map(|r| r.full_path()); - assert_eq!(resolution, Ok(f.join("#").join("a.js"))); -} diff --git a/src/tests/browser_field.rs b/src/tests/browser_field.rs deleted file mode 100644 index 171ee099..00000000 --- a/src/tests/browser_field.rs +++ /dev/null @@ -1,189 +0,0 @@ -//! - -use crate::{AliasValue, ResolveError, ResolveOptions, Resolver}; - -#[test] -fn ignore() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![ - vec!["browser".into()], - vec!["innerBrowser1".into()], - vec!["innerBrowser2".into()], - vec![], - ], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - (f.clone(), "./lib/ignore", f.join("lib/ignore.js")), - (f.clone(), "./lib/ignore.js", f.join("lib/ignore.js")), - (f.join("lib"), "./ignore", f.join("lib/ignore.js")), - (f.join("lib"), "./ignore.js", f.join("lib/ignore.js")), - ]; - - for (path, request, expected) in data { - let resolution = resolver.resolve(&path, request); - let expected = ResolveError::Ignored(expected); - assert_eq!(resolution, Err(expected), "{path:?} {request}"); - } -} - -#[test] -fn shared_resolvers() { - let f = super::fixture().join("browser-module"); - - let resolver1 = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["innerBrowser1".into(), "field".into(), "browser".into()]], - ..ResolveOptions::default() - }); - let resolved_path = resolver1.resolve(&f, "./lib/main1.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("lib/main.js"))); - - let resolver2 = resolver1.clone_with_options(ResolveOptions { - alias_fields: vec![vec!["innerBrowser2".into(), "browser".into()]], - ..ResolveOptions::default() - }); - let resolved_path = resolver2.resolve(&f, "./lib/main2.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("./lib/replaced.js"))); -} - -#[test] -fn replace_file() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![ - vec!["browser".into()], - vec!["innerBrowser1".into(), "field2".into(), "browser".into()], // not presented - vec!["innerBrowser1".into(), "field".into(), "browser".into()], - vec!["innerBrowser2".into(), "browser".into()], - ], - // Not part of enhanced-resolve. Added to make sure no interaction between these two fields. - main_fields: vec!["browser".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - ("should replace a file 1", f.clone(), "./lib/replaced", f.join("lib/browser.js")), - ("should replace a file 2", f.clone(), "./lib/replaced.js", f.join("lib/browser.js")), - ("should replace a file 3", f.join("lib"), "./replaced", f.join("lib/browser.js")), - ("should replace a file 4", f.join("lib"), "./replaced.js", f.join("lib/browser.js")), - ("should replace a module with a file 1", f.clone(), "module-a", f.join("browser/module-a.js")), - ("should replace a module with a file 2", f.join("lib"), "module-a", f.join("browser/module-a.js")), - ("should replace a module with a module 1", f.clone(), "module-b", f.join("node_modules/module-c.js")), - ("should replace a module with a module 2", f.join("lib"), "module-b", f.join("node_modules/module-c.js")), - ("should resolve in nested property 1", f.clone(), "./lib/main1.js", f.join("lib/main.js")), - ("should resolve in nested property 2", f.clone(), "./lib/main2.js", f.join("lib/browser.js")), - ("should check only alias field properties", f.clone(), "./toString", f.join("lib/toString.js")), - // not part of enhanced-resolve - ("recursion", f.clone(), "module-c", f.join("node_modules/module-c.js")), - ("resolve self 1", f.clone(), "./lib/main.js", f.join("lib/main.js")), - ("resolve self 2", f.clone(), "./main.js", f.join("lib/main.js")), - ]; - - for (comment, path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn recurse_fail() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - ("recurse non existent", f.clone(), "./lib/non-existent.js", ResolveError::NotFound("./lib/non-existent.js".into())), - ("path partial match 1", f.clone(), "./xyz.js", ResolveError::NotFound("./xyz.js".into())), - ("path partial match 2", f, "./lib/xyz.js", ResolveError::NotFound("./lib/xyz.js".into())), - ]; - - for (comment, path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Err(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn broken() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - // The browser field string value should be ignored - (f.clone(), "browser-module-broken", Ok(f.join("node_modules/browser-module-broken/main.js"))), - (f.join("browser-module"), "./number", Err(ResolveError::NotFound("./number".into()))), - ]; - - for (path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, expected, "{path:?} {request}"); - } -} - -#[test] -fn crypto_js() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - fallback: vec![( - "crypto".into(), - vec![AliasValue::from(f.join("lib.js").to_string_lossy())], - )], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(f.join("crypto-js"), "crypto").map(|r| r.full_path()); - assert_eq!(resolved_path, Err(ResolveError::Ignored(f.join("crypto-js")))); -} - -// https://github.com/webpack/webpack/blob/87660921808566ef3b8796f8df61bd79fc026108/test/cases/resolving/browser-field/index.js#L40-L43 -#[test] -fn recursive() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - let data = [ - ("should handle recursive file 1", f.clone(), "recursive-file/a"), - ("should handle recursive file 2", f.clone(), "recursive-file/b"), - ("should handle recursive file 3", f.clone(), "recursive-file/c"), - ("should handle recursive file 4", f, "recursive-file/d"), - ]; - - for (comment, path, request) in data { - let resolved_path = resolver.resolve(&path, request); - assert_eq!(resolved_path, Err(ResolveError::Recursion), "{comment} {path:?} {request}"); - } -} - -#[test] -fn with_query() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "./foo").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("lib").join("browser.js?query"))); -} diff --git a/src/tests/builtins.rs b/src/tests/builtins.rs deleted file mode 100644 index 5d6d14d9..00000000 --- a/src/tests/builtins.rs +++ /dev/null @@ -1,121 +0,0 @@ -use std::path::Path; - -use crate::{ResolveError, ResolveOptions, Resolver}; - -#[test] -fn builtins_off() { - let f = Path::new("/"); - let resolver = Resolver::default(); - let resolved_path = resolver.resolve(f, "zlib").map(|r| r.full_path()); - assert_eq!(resolved_path, Err(ResolveError::NotFound("zlib".into()))); -} - -#[test] -fn builtins() { - let f = Path::new("/"); - - let resolver = Resolver::new(ResolveOptions::default().with_builtin_modules(true)); - - let pass = [ - "_http_agent", - "_http_client", - "_http_common", - "_http_incoming", - "_http_outgoing", - "_http_server", - "_stream_duplex", - "_stream_passthrough", - "_stream_readable", - "_stream_transform", - "_stream_wrap", - "_stream_writable", - "_tls_common", - "_tls_wrap", - "assert", - "assert/strict", - "async_hooks", - "buffer", - "child_process", - "cluster", - "console", - "constants", - "crypto", - "dgram", - "diagnostics_channel", - "dns", - "dns/promises", - "domain", - "events", - "fs", - "fs/promises", - "http", - "http2", - "https", - "inspector", - "module", - "net", - "os", - "path", - "path/posix", - "path/win32", - "perf_hooks", - "process", - "punycode", - "querystring", - "readline", - "repl", - "stream", - "stream/consumers", - "stream/promises", - "stream/web", - "string_decoder", - "sys", - "timers", - "timers/promises", - "tls", - "trace_events", - "tty", - "url", - "util", - "util/types", - "v8", - "vm", - "worker_threads", - "zlib", - ]; - - for request in pass { - let prefixed_request = format!("node:{request}"); - for request in [prefixed_request.clone(), request.to_string()] { - let resolved_path = resolver.resolve(f, &request).map(|r| r.full_path()); - let err = ResolveError::Builtin(prefixed_request.clone()); - assert_eq!(resolved_path, Err(err), "{request}"); - } - } -} - -#[test] -fn fail() { - let f = Path::new("/"); - let resolver = Resolver::new(ResolveOptions::default().with_builtin_modules(true)); - let request = "xxx"; - let resolved_path = resolver.resolve(f, request); - let err = ResolveError::NotFound(request.to_string()); - assert_eq!(resolved_path, Err(err), "{request}"); -} - -#[test] -fn imports() { - let f = super::fixture().join("builtins"); - let resolver = Resolver::new(ResolveOptions { - builtin_modules: true, - condition_names: vec!["node".into()], - ..ResolveOptions::default() - }); - - for request in ["#fs", "#http"] { - let resolved_path = resolver.resolve(f.clone(), request).map(|r| r.full_path()); - let err = ResolveError::Builtin(format!("node:{}", request.trim_start_matches('#'))); - assert_eq!(resolved_path, Err(err)); - } -} diff --git a/src/tests/dependencies.rs b/src/tests/dependencies.rs deleted file mode 100644 index bcc2355b..00000000 --- a/src/tests/dependencies.rs +++ /dev/null @@ -1,110 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/dependencies.test.js - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows { - use rustc_hash::FxHashSet; - use std::path::PathBuf; - - use crate::{ResolveContext, ResolveOptions, ResolverGeneric}; - - use super::super::memory_fs::MemoryFS; - - fn file_system() -> MemoryFS { - MemoryFS::new(&[ - ("/a/b/node_modules/some-module/index.js", ""), - ("/a/node_modules/module/package.json", r#"{"main":"entry.js"}"#), - ("/a/node_modules/module/file.js", r#"{"main":"entry.js"}"#), - ("/modules/other-module/file.js", ""), - ]) - } - - #[test] - fn test() { - let file_system = file_system(); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - extensions: vec![".json".into(), ".js".into()], - modules: vec!["/modules".into(), "node_modules".into()], - ..ResolveOptions::default() - }, - ); - - let data = [ - ( - "middle module request", - "/a/b/c", - "module/file", - "/a/node_modules/module/file.js", - // These dependencies are different from enhanced-resolve due to different code path to - // querying the file system - vec![ - // 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", - // "/", - ], - vec![ - // missing package.jsons - // "/a/b/c/package.json", - "/a/b/package.json", - "/a/package.json", - "/package.json", - // missing modules directories - "/a/b/c", - // "/a/b/c/node_modules", - // missing single file modules - "/modules/module", - "/a/b/node_modules/module", - // missing files with alternative extensions - "/a/node_modules/module/file", - "/a/node_modules/module/file.json", - ], - ), - ( - "fast found module", - "/a/b/c", - "other-module/file.js", - "/modules/other-module/file.js", - // These dependencies are different from enhanced-resolve due to different code path to - // querying the file system - vec![ - // symlink checks - "/modules/other-module/file.js", - // "/modules/other-module", - // "/modules", - // "/", - ], - vec![ - // missing package.jsons - // "/a/b/c/package.json", - "/a/b/c", - "/a/b/package.json", - "/a/package.json", - "/package.json", - "/modules/other-module/package.json", - "/modules/package.json", - ], - ), - ]; - - for (name, context, request, result, file_dependencies, missing_dependencies) in data { - let mut ctx = ResolveContext::default(); - let path = PathBuf::from(context); - let resolved = - resolver.resolve_with_context(path, request, &mut ctx).map(|r| r.full_path()); - assert_eq!(resolved, Ok(PathBuf::from(result))); - let file_dependencies = - FxHashSet::from_iter(file_dependencies.iter().map(PathBuf::from)); - let missing_dependencies = - FxHashSet::from_iter(missing_dependencies.iter().map(PathBuf::from)); - assert_eq!(ctx.file_dependencies, file_dependencies, "{name}"); - assert_eq!(ctx.missing_dependencies, missing_dependencies, "{name}"); - } - } -} diff --git a/src/tests/exports_field.rs b/src/tests/exports_field.rs deleted file mode 100644 index 7ca73fbd..00000000 --- a/src/tests/exports_field.rs +++ /dev/null @@ -1,2546 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/exportsField.test.js -//! -//! The huge exports field test cases are at the bottom of this file. - -use crate::{Ctx, PathUtil, ResolveError, ResolveOptions, Resolver}; -use serde_json::json; -use std::path::Path; - -#[test] -fn test_simple() { - let f = super::fixture().join("exports-field"); - let f2 = super::fixture().join("exports-field2"); - let f4 = super::fixture().join("exports-field-error"); - let f5 = super::fixture().join("imports-exports-wildcard"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - fully_specified: true, - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("resolve root using exports field, not a main field", f.clone(), "exports-field", f.join("node_modules/exports-field/x.js")), - ("resolver should respect condition names", f.clone(), "exports-field/dist/main.js", f.join("node_modules/exports-field/lib/lib2/main.js")), - // enhanced_resolve behaves differently to node.js. enhanced_resolve fallbacks when an - // array item is unresolved, where as node.js fallbacks when an array has an - // InvalidPackageTarget error. - // ("resolver should respect fallback", f2.clone(), "exports-field/dist/browser.js", f2.join("node_modules/exports-field/lib/browser.js")), - // The following two tests require fallback from array values, the path is changed here to - // only test query and fragment. - ("resolver should respect query parameters #1", f2.clone(), "exports-field/dist/main.js?foo", f2.join("node_modules/exports-field/lib/lib2/main.js?foo")), - ("resolver should respect fragment parameters #1", f2.clone(), "exports-field/dist/main.js#foo", f2.join("node_modules/exports-field/lib/lib2/main.js#foo")), - ("relative path should work, if relative path as request is used", f.clone(), "./node_modules/exports-field/lib/main.js", f.join("node_modules/exports-field/lib/main.js")), - ("self-resolving root", f.clone(), "@exports-field/core", f.join("a.js")), - ("should resolve with wildcard pattern #1", f5.clone(), "m/features/f.js", f5.join("node_modules/m/src/features/f.js")), - ("should resolve with wildcard pattern #2", f5.clone(), "m/features/y/y.js", f5.join("node_modules/m/src/features/y/y.js")), - ("should resolve with wildcard pattern #3", f5.clone(), "m/features-no-ext/y/y.js", f5.join("node_modules/m/src/features/y/y.js")), - ("should resolve with wildcard pattern #4", f5.clone(), "m/middle/nested/f.js", f5.join("node_modules/m/src/middle/nested/f.js")), - ("should resolve with wildcard pattern #5", f5.clone(), "m/middle-1/nested/f.js", f5.join("node_modules/m/src/middle-1/nested/f.js")), - ("should resolve with wildcard pattern #6", f5.clone(), "m/middle-2/nested/f.js", f5.join("node_modules/m/src/middle-2/nested/f.js")), - ("should resolve with wildcard pattern #7", f5.clone(), "m/middle-3/nested/f", f5.join("node_modules/m/src/middle-3/nested/f/nested/f.js")), - ("should resolve with wildcard pattern #8", f5.clone(), "m/middle-4/f/nested", f5.join("node_modules/m/src/middle-4/f/f.js")), - ("should resolve with wildcard pattern #9", f5.clone(), "m/middle-5/f$/$", f5.join("node_modules/m/src/middle-5/f$/$.js")), - ]; - - // Not needed or snapshot: - // * should log the correct info - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } - - let p = f.join("node_modules/exports-field/package.json"); - let p2 = f2.join("node_modules/exports-field/package.json"); - let p4 = f4.join("node_modules/exports-field/package.json"); - let p5 = f5.join("node_modules/m/package.json"); - - #[rustfmt::skip] - let fail = [ - // ("throw error if extension not provided", f2.clone(), "exports-field/dist/main", ResolveError::NotFound(f2.join("node_modules/exports-field/lib/lib2/main"))), - ("resolver should respect query parameters #2. Direct matching", f2.clone(), "exports-field?foo", ResolveError::PackagePathNotExported("./?foo".into(), p2.clone())), - ("resolver should respect fragment parameters #2. Direct matching", f2, "exports-field#foo", ResolveError::PackagePathNotExported("./#foo".into(), p2)), - ("relative path should not work with exports field", f.clone(), "./node_modules/exports-field/dist/main.js", ResolveError::NotFound("./node_modules/exports-field/dist/main.js".into())), - ("backtracking should not work for request", f.clone(), "exports-field/dist/../../../a.js", ResolveError::InvalidPackageTarget("./lib/../../../a.js".to_string(), "./dist/".to_string(), p.clone())), - ("backtracking should not work for exports field target", f.clone(), "exports-field/dist/a.js", ResolveError::InvalidPackageTarget("./../../a.js".to_string(), "./dist/a.js".to_string(), p.clone())), - ("not exported error", f.clone(), "exports-field/anything/else", ResolveError::PackagePathNotExported("./anything/else".to_string(), p.clone())), - ("request ending with slash #1", f.clone(), "exports-field/", ResolveError::PackagePathNotExported("./".to_string(), p.clone())), - ("request ending with slash #2", f.clone(), "exports-field/dist/", ResolveError::PackagePathNotExported("./dist/".to_string(), p.clone())), - ("request ending with slash #3", f.clone(), "exports-field/lib/", ResolveError::PackagePathNotExported("./lib/".to_string(), p)), - ("should throw error if target is invalid", f4, "exports-field", ResolveError::InvalidPackageTarget("./a/../b/../../pack1/index.js".to_string(), ".".to_string(), p4)), - ("throw error if exports field is invalid", f.clone(), "invalid-exports-field", ResolveError::InvalidPackageConfig(f.join("node_modules/invalid-exports-field/package.json"))), - ("should throw error if target is 'null'", f5, "m/features/internal/file.js", ResolveError::PackagePathNotExported("./features/internal/file.js".to_string(), p5)), - ]; - - for (comment, path, request, error) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!(resolution, Err(error), "{comment} {path:?} {request}"); - } -} - -// resolve using exports field, not a browser field #1 -#[test] -fn exports_not_browser_field1() { - let f = super::fixture().join("exports-field"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - condition_names: vec!["webpack".into()], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "exports-field/dist/main.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("node_modules/exports-field/lib/lib2/main.js"))); -} - -// resolve using exports field and a browser alias field #2 -#[test] -fn exports_not_browser_field2() { - let f2 = super::fixture().join("exports-field2"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - extensions: vec![".js".into()], - condition_names: vec!["node".into()], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f2, "exports-field/dist/main.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f2.join("node_modules/exports-field/lib/browser.js"))); -} - -// should resolve extension without fullySpecified -#[test] -fn extension_without_fully_specified() { - let f2 = super::fixture().join("exports-field2"); - - let commonjs_resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - let resolved_path = - commonjs_resolver.resolve(&f2, "exports-field/dist/main").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f2.join("node_modules/exports-field/lib/lib2/main.js"))); -} - -#[test] -fn field_name_path() { - let f2 = super::fixture().join("exports-field2"); - let f3 = super::fixture().join("exports-field3"); - - // field name path #1 #2 #3 - let exports_fields = [ - vec![vec!["exportsField".into(), "exports".into()]], - vec![vec!["exportsField".into(), "exports".into()], vec!["exports".into()]], - vec![vec!["exports".into()], vec!["exportsField".into(), "exports".into()]], - ]; - - for exports_fields in exports_fields { - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - exports_fields, - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/main.js"))); - } - - // field name path #4 - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - exports_fields: vec![vec!["exports".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f2, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f2.join("node_modules/exports-field/index.js"))); - - // field name path #5 - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - exports_fields: vec![vec!["ex".into()], vec!["exports_field".into(), "exports".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/index"))); - - // non-compliant export targeting a directory - let resolver = Resolver::new(ResolveOptions { - exports_fields: vec![vec!["broken".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/src/index.js"))); -} - -#[test] -fn shared_resolvers() { - let f3 = super::fixture().join("exports-field3"); - - let resolver1 = Resolver::new(ResolveOptions { - exports_fields: vec![vec!["exportsField".into(), "exports".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver1.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/main.js"))); - - let resolver2 = resolver1.clone_with_options(ResolveOptions { - exports_fields: vec![vec!["ex".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver2.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/index"))); -} - -#[test] -fn extension_alias_1_2() { - let f = super::fixture().join("exports-field-and-extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - extension_alias: vec![(".js".into(), vec![".ts".into(), ".js".into()])], - fully_specified: true, - condition_names: vec!["webpack".into(), "default".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve with the `extensionAlias` option", f.clone(), "@org/pkg/string.js", f.join("node_modules/@org/pkg/dist/string.js")), - ("should resolve with the `extensionAlias` option #2", f.clone(), "pkg/string.js", f.join("node_modules/pkg/dist/string.js")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn extension_alias_3() { - let f = super::fixture().join("exports-field-and-extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - extension_alias: vec![( - ".js".into(), - vec![".foo".into(), ".baz".into(), ".baz".into(), ".ts".into(), ".js".into()], - )], - fully_specified: true, - condition_names: vec!["webpack".into(), "default".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve with the `extensionAlias` option #3", f.clone(), "pkg/string.js", f.join("node_modules/pkg/dist/string.js")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn extension_alias_throw_error() { - let f = super::fixture().join("exports-field-and-extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - extension_alias: vec![(".js".into(), vec![".ts".into()])], - fully_specified: true, - condition_names: vec!["webpack".into(), "default".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let fail = [ - // enhanced-resolve has two test cases that are exactly the same here - // https://github.com/webpack/enhanced-resolve/blob/a998c7d218b7a9ec2461fc4fddd1ad5dd7687485/test/exportsField.test.js#L2976-L3024 - ("should throw error with the `extensionAlias` option", f.clone(), "pkg/string.js", ResolveError::ExtensionAlias(f.join("node_modules/pkg/dist/string.js"))), - // TODO: The error is PackagePathNotExported in enhanced-resolve - // ("should throw error with the `extensionAlias` option", f.clone(), "pkg/string.js", ResolveError::PackagePathNotExported("node_modules/pkg/dist/string.ts".to_string())), - ]; - - for (comment, path, request, error) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!(resolution, Err(error), "{comment} {path:?} {request}"); - } -} - -// Small script for generating the test cases from enhanced-resolve -// for (c of testCases) { -// console.log("TestCase {") -// console.log(`name: ${JSON.stringify(c.name)},`) -// if (c.expect instanceof Error) { -// console.log(`expect: None,`) -// } else { -// console.log(`expect: Some(vec!${JSON.stringify(c.expect)}),`) -// } -// console.log(`exports_field: exports_field(json!(${JSON.stringify(c.suite[0], null, 2)})),`) -// console.log(`request: "${c.suite[1]}",`) -// console.log(`condition_names: vec!${JSON.stringify(c.suite[2])},`) -// console.log("},") -//} -struct TestCase { - name: &'static str, - expect: Option>, - exports_field: serde_json::Value, - request: &'static str, - condition_names: Vec<&'static str>, -} - -#[allow(clippy::needless_pass_by_value)] -fn exports_field(value: serde_json::Value) -> serde_json::Value { - value -} - -#[test] -fn test_cases() { - let test_cases = [ - TestCase { - name: "sample #1", - expect: Some(vec!["./dist/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/": { - "import": [ - "./dist/", - "./src/" - ], - "webpack": "./wp/" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "sample #1", - expect: Some(vec!["./src/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/": { - "import": [ - "./src/" - ], - "webpack": "./wp/" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - TestCase { - name: "sample #1 (wildcard)", - expect: Some(vec!["./dist/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/*": { - "import": [ - "./dist/*", - "./src/*" - ], - "webpack": "./wp/*" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "sample #1 (wildcard)", - expect: Some(vec!["./src/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/*": { - "import": [ - "./src/*" - ], - "webpack": "./wp/*" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - TestCase { - name: "sample #2", - expect: Some(vec!["./data/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./timezones/": "./data/timezones/" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #2 (wildcard)", - expect: Some(vec!["./data/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./timezones/*": "./data/timezones/*" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #3", - expect: Some(vec!["./data/timezones/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./": "./data/timezones/" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #3 (wildcard)", - expect: Some(vec!["./data/timezones/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./*": "./data/timezones/*.mjs" - })), - request: "./timezones/pdt", - condition_names: vec![], - }, - TestCase { - name: "sample #4", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./lib/": { - "browser": [ - "./browser/" - ] - }, - "./dist/index.js": { - "node": "./index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #4 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "node": "./index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #5", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/": { - "browser": [ - "./browser/" - ] - }, - "./dist/index.js": { - "node": "./index.js", - "default": "./browser/index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #5 (wildcard)", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "node": "./index.js", - "default": "./browser/index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./dist/a": "./dist/index.js" - })), - request: "./dist/aaa", - condition_names: vec![], - }, - TestCase { - name: "sample #7", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./dist/a/a/": "./dist/index.js" - })), - request: "./dist/a/a", - condition_names: vec![], - }, - TestCase { - name: "sample #7 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./dist/a/a/*": "./dist/index.js" - })), - request: "./dist/a/a", - condition_names: vec![], - }, - TestCase { - name: "sample #8", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": "./index.js" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #9", - expect: Some(vec!["./main.js"]), - exports_field: exports_field(json!({ - "./index.js": "./main.js" - })), - request: "./index.js", - condition_names: vec![], - }, - TestCase { - name: "sample #10", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #11", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./bar#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #12", - expect: Some(vec!["./ok.js#abc"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/ok.js#abc", - condition_names: vec![], - }, - TestCase { - name: "sample #12", - expect: Some(vec!["./ok.js#abc"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/ok.js#abc", - condition_names: vec![], - }, - TestCase { - name: "sample #13", - expect: Some(vec!["./ok.js?abc"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/ok.js?abc", - condition_names: vec![], - }, - TestCase { - name: "sample #14", - expect: Some(vec!["./🎉.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/🎉.js", - condition_names: vec![], - }, - TestCase { - name: "sample #15", - expect: Some(vec!["./%F0%9F%8E%89.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/%F0%9F%8E%89.js", - condition_names: vec![], - }, - TestCase { - name: "sample #16", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./🎉", - condition_names: vec![], - }, - TestCase { - name: "sample #17", - expect: Some(vec!["./other.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./%F0%9F%8E%89", - condition_names: vec![], - }, - TestCase { - name: "sample #18", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./module", - condition_names: vec![], - }, - TestCase { - name: "sample #19", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./module#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #20", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./module?foo", - condition_names: vec![], - }, - TestCase { - name: "sample #21", - expect: Some(vec!["./zizizi"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./z*z*z*" - })), - request: "./#zippi", - condition_names: vec![], - }, - TestCase { - name: "sample #22", - expect: Some(vec!["./d?e?f"]), - exports_field: exports_field(json!({ - "./a?b?c/": "./" - })), - request: "./a?b?c/d?e?f", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #1", - expect: Some(vec!["./dist/index.js"]), - exports_field: exports_field(json!({ - ".": "./dist/index.js" - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #2", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./": "./", - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #3", - expect: Some(vec!["./dist/a.js"]), - exports_field: exports_field(json!({ - "./dist/": "./dist/", - "./dist/*": "./dist/*", - "./dist*": "./dist*", - "./dist/index.js": "./dist/a.js" - })), - request: "./dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #4", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./": { - "browser": [ - "./browser/" - ] - }, - "./*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "browser": "./index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #5", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./": { - "browser": [ - "./browser/" - ] - }, - "./*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "node": "./node.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #6", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - ".": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #7", - expect: Some(vec!["./src/index.js"]), // `enhanced_resolve` is `None` - exports_field: exports_field(json!({ - ".": { - "default": "./src/index.js", - "browser": "./index.js", - "node": "./src/node/index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #8", - expect: Some(vec!["./src/index.js"]), - exports_field: exports_field(json!({ - ".": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #9", - expect: Some(vec!["./index"]), - exports_field: exports_field(json!({ - ".": "./index" - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #10", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./index": "./index.js" - })), - request: "./index", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #11", - expect: Some(vec!["./foo.js"]), - exports_field: exports_field(json!({ - "./": "./", - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #12", - expect: Some(vec!["./foo/bar/baz.js"]), - exports_field: exports_field(json!({ - "./": "./", - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo/bar/baz.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #13", - expect: Some(vec!["./foo/bar/baz.js"]), - exports_field: exports_field(json!({ - "./": "./", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo/bar/baz.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #14", - expect: Some(vec!["./foo/bar/baz.js"]), - exports_field: exports_field(json!({ - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo/bar/baz.js", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #1", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "require": "./require.js" - }, { - "import": "./import.mjs" - }] - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #2", - expect: Some(vec!["./import.mjs"]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "require": "./require.js" - }, { - "import": "./import.mjs" - }] - })), - request: ".", - condition_names: vec!["import"], - }, - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./require.js"]), - exports_field: exports_field(json!({ - ".": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./import.mjs"]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "import": "./import.mjs" - }] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./require.js"]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "require": [ - "./require.js" - ] - }, { - "import": [ - "./import.mjs", - "./import.js" - ] - }] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./import.mjs"]), - exports_field: exports_field(json!({ - ".": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "./import.mjs", - "./import.js" - ] - } - ] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./import.js"]), - exports_field: exports_field(json!({ - ".": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "./import.js" - ] - } - ] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "mapping to a folder root #1", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./timezones": "./data/timezones/" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #2", - expect: None, - exports_field: exports_field(json!({ - "./timezones/": "./data/timezones" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #3", - expect: Some(vec!["./data/timezones/pdt/index.mjs"]), - exports_field: exports_field(json!({ - "./timezones/pdt/": "./data/timezones/pdt/" - })), - request: "./timezones/pdt/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #3 (wildcard)", - expect: Some(vec!["./data/timezones/pdt/index.mjs"]), - exports_field: exports_field(json!({ - "./timezones/pdt/*": "./data/timezones/pdt/*" - })), - request: "./timezones/pdt/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #4", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./": "./timezones/" - })), - request: "./pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #4 (wildcard)", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./*": "./timezones/*" - })), - request: "./pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #5", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./": "./" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #5 (wildcard)", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./*": "./*" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #6", - expect: None, - exports_field: exports_field(json!({ - "./": "." - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #6 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "./*": "." - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #7", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": "./" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #7 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": "./*" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #1", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./": "./", - "./dist/": "./lib/" - })), - request: "./dist/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #1 (wildcard)", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./*": "./*", - "./dist/*": "./lib/*" - })), - request: "./dist/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #2", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/": "./dist/utils/", - "./dist/": "./lib/" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #2 (wildcard)", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/*": "./dist/utils/*", - "./dist/*": "./lib/*" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #3", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/index.js": "./dist/utils/index.js", - "./dist/utils/": "./dist/utils/index.mjs", - "./dist/": "./lib/" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #3 (wildcard)", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/index.js": "./dist/utils/index.js", - "./dist/utils/*": "./dist/utils/index.mjs", - "./dist/*": "./lib/*" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #4", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./": { - "browser": "./browser/" - }, - "./dist/": "./lib/" - })), - request: "./dist/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "the longest matching path prefix is prioritized #4 (wildcard)", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./*": { - "browser": "./browser/*" - }, - "./dist/*": "./lib/*" - })), - request: "./dist/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #1", - // `lodash/` does not start with './' so fallbacks to util - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "conditional mapping folder #1", - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": [ - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #1 (wildcard)", - // `lodash/` does not start with './' so fallbacks to util - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": [ - "lodash/*", - "./utils/*" - ], - "node": [ - "./utils-node/*" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "conditional mapping folder #1 (wildcard)", - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": [ - "./utils/*" - ], - "node": [ - "./utils-node/*" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #2", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./node/" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "conditional mapping folder #2 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "webpack": "./wpk/*", - "browser": [ - "lodash/*", - "./utils/*" - ], - "node": [ - "./node/*" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "conditional mapping folder #3", - expect: Some(vec!["./wpk/index.mjs"]), - exports_field: exports_field(json!({ - "./utils/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils/" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "conditional mapping folder #3 (wildcard)", - expect: Some(vec!["./wpk/index.mjs"]), - exports_field: exports_field(json!({ - "./utils/*": { - "webpack": "./wpk/*", - "browser": [ - "lodash/*", - "./utils/*" - ], - "node": [ - "./utils/*" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "incorrect exports field #1", - expect: None, - exports_field: exports_field(json!({ - "/utils/": "./a/" - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #2", - expect: None, - exports_field: exports_field(json!({ - "./utils/": "/a/" - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #3", - expect: None, - exports_field: exports_field(json!({ - "/utils/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #4", - expect: None, - exports_field: exports_field(json!({ - "./utils/": { - "browser": "/a/", - "default": "/b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #4 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "/a/", - "default": "/b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #5", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index": "./a/index.js" - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index.mjs": "./a/index.js" - })), - request: "./utils/index", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #7", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #8", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index.mjs": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - // Requests that are not `./` does not apply to `package_exports_resolve` - // TestCase { - // name: "incorrect request #1", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": "./a/" - // })), - // request: "/utils/index.mjs", - // condition_names: vec![], - // }, - // TestCase { - // name: "incorrect request #2", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": { - // "browser": "./a/", - // "default": "./b/" - // } - // })), - // request: "/utils/index.mjs", - // condition_names: vec!["browser"], - // }, - // TestCase { - // name: "incorrect request #3", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": { - // "browser": "./a/", - // "default": "./b/" - // } - // })), - // request: "../utils/index.mjs", - // condition_names: vec!["browser"], - // }, - // TestCase { - // name: "incorrect request #4", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": { - // "browser": "./a/", - // "default": "./b/" - // } - // })), - // request: "/utils/index.mjs/", - // condition_names: vec!["browser"], - // }, - TestCase { - name: "backtracking package base #1", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./../../utils/": "./dist/" - })), - request: "./../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #1 (wildcard)", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./../../utils/*": "./dist/*" - })), - request: "./../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #2", - expect: None, - exports_field: exports_field(json!({ - "../../utils/": "./dist/" - })), - request: "../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #2 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "../../utils/*": "./dist/*" - })), - request: "../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #3", - expect: None, - exports_field: exports_field(json!({ - "./utils/": "../src/" - })), - request: "./utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #3 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "./utils/*": "../src/*" - })), - request: "./utils/index", - condition_names: vec![], - }, - // enhanced-resolve does not handle backtracking here - // TestCase { - // name: "backtracking package base #4", - // expect: Some(vec!["./../src/index"]), - // exports_field: exports_field(json!({ - // "./utils/": "./../src/" - // })), - // request: "./utils/index", - // condition_names: vec![], - // }, - // TestCase { - // name: "backtracking package base #4 (wildcard)", - // expect: Some(vec!["./../src/index"]), - // exports_field: exports_field(json!({ - // "./utils/*": "./../src/*" - // })), - // request: "./utils/index", - // condition_names: vec![], - // }, - // TestCase { - // name: "backtracking package base #5", - // expect: Some(vec!["./src/../index.js"]), - // exports_field: exports_field(json!({ - // "./utils/index": "./src/../index.js" - // })), - // request: "./utils/index", - // condition_names: vec![], - // }, - TestCase { - name: "backtracking package base #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/../utils/index": "./src/../index.js" - })), - request: "./utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #7", - expect: None, - exports_field: exports_field(json!({ - "./utils/": { - "browser": "../this/" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #7", - expect: None, - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "../this/*" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #8", - // We throw "InvalidPackageTarget" - // expect: Some(vec!["./utils/../index"]), - expect: None, - exports_field: exports_field(json!({ - "./utils/": { - "browser": "./utils/../" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #8 (wildcard)", - // We throw "InvalidPackageTarget" - // expect: Some(vec!["./utils/../index"]), - expect: None, - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "./utils/../*" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #9", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./": "./src/../../", - "./dist/": "./dist/" - })), - request: "./dist/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #9 (wildcard)", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./*": "./src/../../*", - "./dist/*": "./dist/*" - })), - request: "./dist/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking target folder #1", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../../index"]), - exports_field: exports_field(json!({ - "./utils/": "./dist/" - })), - request: "./utils/timezone/../../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #1 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../../index"]), - exports_field: exports_field(json!({ - "./utils/*": "./dist/*" - })), - request: "./utils/timezone/../../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #2", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../index"]), - exports_field: exports_field(json!({ - "./utils/": "./dist/" - })), - request: "./utils/timezone/../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #2 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../index"]), - exports_field: exports_field(json!({ - "./utils/*": "./dist/*" - })), - request: "./utils/timezone/../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #3", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/target/../../index"]), - exports_field: exports_field(json!({ - "./utils/": "./dist/target/" - })), - request: "./utils/../../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #3 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/target/../../index"]), - exports_field: exports_field(json!({ - "./utils/*": "./dist/target/*" - })), - request: "./utils/../../index", - condition_names: vec![], - }, - // enhanced-resolve does not handle `node_modules` in target - TestCase { - name: "nested node_modules path #1", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": "./node_modules/" - } - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #1 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "./node_modules/*" - } - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #2", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./utils/../node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/": "./utils/../node_modules/" - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "nested node_modules path #2 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./utils/../node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": "./utils/../node_modules/*" - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "nested mapping #1", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": "./", - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested mapping #1 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": "./*", - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "nested mapping #2 (wildcard)", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #2 (wildcard)", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "nested mapping #3", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["webpack"], - }, - TestCase { - name: "nested mapping #3 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["webpack"], - }, - TestCase { - name: "nested mapping #4", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["node", "browser"], - }, - TestCase { - name: "nested mapping #4 (wildcard)", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["node", "browser"], - }, - TestCase { - name: "nested mapping #5", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node"], - }, - TestCase { - name: "nested mapping #5 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": { - "webpack": [ - "./wpck/*" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node"], - }, - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - TestCase { - name: "nested mapping #6 (wildcard)", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": { - "webpack": [ - "./wpck/*" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #6 (wildcard)", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./node/*" - ], - "default": { - "node": { - "webpack": [ - "./wpck/*" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - TestCase { - name: "nested mapping #7", - expect: Some(vec!["./y.js"]), - exports_field: exports_field(json!({ - "./a.js": { - "abc": { - "def": "./x.js" - }, - "ghi": "./y.js" - } - })), - request: "./a.js", - condition_names: vec!["abc", "ghi"], - }, - TestCase { - name: "nested mapping #8", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./a.js": { - "abc": { - "def": "./x.js", - "default": [] - }, - "ghi": "./y.js" - } - })), - request: "./a.js", - condition_names: vec!["abc", "ghi"], - }, - TestCase { - name: "syntax sugar #1", - expect: Some(vec!["./main.js"]), - exports_field: exports_field(json!("./main.js")), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #2", - expect: Some(vec![]), - exports_field: exports_field(json!("./main.js")), - request: "./lib.js", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #3", - expect: Some(vec!["./a.js"]), - exports_field: exports_field(json!(["./a.js", "./b.js"])), - request: ".", - condition_names: vec![], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "syntax sugar #3", - expect: Some(vec!["./b.js"]), - exports_field: exports_field(json!(["./b.js"])), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #4", - expect: Some(vec![]), - exports_field: exports_field(json!(["./a.js", "./b.js"])), - request: "./lib.js", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #5", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "browser": { - "default": "./index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "syntax sugar #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "browser": { - "default": "./index.js" - } - })), - request: "./lib.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "syntax sugar #7", - expect: None, - exports_field: exports_field(json!({ - "./node": "./node.js", - "browser": { - "default": "./index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "syntax sugar #8", - expect: None, - exports_field: exports_field(json!({ - "browser": { - "default": "./index.js" - }, - "./node": "./node.js" - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #1", - expect: Some(vec!["./abc/d"]), - exports_field: exports_field(json!({ - "./ab*": "./ab/*", - "./abc*": "./abc/*", - "./a*": "./a/*" - })), - request: "./abcd", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #2", - expect: Some(vec!["./abc/d/e"]), - exports_field: exports_field(json!({ - "./ab*": "./ab/*", - "./abc*": "./abc/*", - "./a*": "./a/*" - })), - request: "./abcd/e", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #3", - expect: Some(vec!["./abc/d"]), - exports_field: exports_field(json!({ - "./x/ab*": "./ab/*", - "./x/abc*": "./abc/*", - "./x/a*": "./a/*" - })), - request: "./x/abcd", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #4", - expect: Some(vec!["./abc/d/e"]), - exports_field: exports_field(json!({ - "./x/ab*": "./ab/*", - "./x/abc*": "./abc/*", - "./x/a*": "./a/*" - })), - request: "./x/abcd/e", - condition_names: vec!["browser"], - }, - TestCase { - name: "path tree edge case #1", - expect: Some(vec!["./A/b/d.js"]), - exports_field: exports_field(json!({ - "./a/": "./A/", - "./a/b/c": "./c.js" - })), - request: "./a/b/d.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #1 (wildcard)", - expect: Some(vec!["./A/b/d.js"]), - exports_field: exports_field(json!({ - "./a/*": "./A/*", - "./a/b/c": "./c.js" - })), - request: "./a/b/d.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #2", - expect: Some(vec!["./A/c.js"]), - exports_field: exports_field(json!({ - "./a/": "./A/", - "./a/b": "./b.js" - })), - request: "./a/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #2 (wildcard)", - expect: Some(vec!["./A/c.js"]), - exports_field: exports_field(json!({ - "./a/*": "./A/*", - "./a/b": "./b.js" - })), - request: "./a/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #3", - expect: Some(vec!["./A/b/d/c.js"]), - exports_field: exports_field(json!({ - "./a/": "./A/", - "./a/b/c/d": "./c.js" - })), - request: "./a/b/d/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #3 (wildcard)", - expect: Some(vec!["./A/b/d/c.js"]), - exports_field: exports_field(json!({ - "./a/*": "./A/*", - "./a/b/c/d": "./c.js" - })), - request: "./a/b/d/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #1", - expect: Some(vec!["./A/b.js"]), - exports_field: exports_field(json!({ - "./a/*.js": "./A/*.js" - })), - request: "./a/b.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #2", - expect: Some(vec!["./A/b/c.js"]), - exports_field: exports_field(json!({ - "./a/*.js": "./A/*.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #3", - expect: Some(vec!["./A/b/c.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": "./A/*/c.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #4", - expect: Some(vec!["./A/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": "./A/*/*.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #5", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/*.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #5", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/*.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./lib/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #6", - expect: Some(vec!["./browser/foo/bar.js"]), - exports_field: exports_field(json!({ - "./lib/*/bar.js": { - "browser": [ - "./browser/*/bar.js" - ] - }, - "./dist/*/bar.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./lib/foo/bar.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #6", - expect: Some(vec!["./browser/foo.js"]), - exports_field: exports_field(json!({ - "./lib/*/bar.js": { - "browser": [ - "./browser/*/bar.js" - ] - }, - "./dist/*/bar.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./dist/foo/bar.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #7", - expect: Some(vec!["./browser/foo/default.js"]), - exports_field: exports_field(json!({ - "./lib/*/bar.js": { - "browser": [ - "./browser/*/bar.js" - ] - }, - "./dist/*/bar.js": { - "node": "./*.js", - "default": "./browser/*/default.js" - } - })), - request: "./dist/foo/bar.js", - condition_names: vec!["default"], - }, - TestCase { - name: "wildcard pattern #8", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": "./A/*/*/*.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #9", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": [ - "./A/*/*/*.js", - "./B/*/*/*.js" - ] - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "wildcard pattern #9", - expect: Some(vec!["./B/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": [ - "./B/*/*/*.js" - ] - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #10", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/foo-*/c.js": "./A/*/*/*.js" - })), - request: "./a/foo-b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #11", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*-foo/c.js": "./A/*/*/*.js" - })), - request: "./a/b-foo/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #12", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/foo-*-foo/c.js": "./A/*/*/*.js" - })), - request: "./a/foo-b-foo/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #13", - expect: Some(vec!["./A/b/c/d.js"]), - exports_field: exports_field(json!({ - "./a/foo-*-foo/c.js": "./A/b/c/d.js" - })), - request: "./a/foo-b-foo/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #14", - expect: Some(vec!["./A/b/c/*.js"]), - exports_field: exports_field(json!({ - "./a/foo-foo/c.js": "./A/b/c/*.js" - })), - request: "./a/foo-foo/c.js", - condition_names: vec![], - }, - ]; - - for case in test_cases { - let resolved = Resolver::new(ResolveOptions { - condition_names: case - .condition_names - .iter() - .map(ToString::to_string) - .collect::>(), - ..ResolveOptions::default() - }) - .package_exports_resolve( - Path::new(""), - case.request, - &case.exports_field, - &mut Ctx::default(), - ) - .map(|p| p.map(|p| p.to_path_buf())); - if let Some(expect) = case.expect { - if expect.is_empty() { - assert!( - matches!(resolved, Err(ResolveError::PackagePathNotExported(_, _))), - "{} {:?}", - &case.name, - &resolved - ); - } else { - for expect in expect { - assert_eq!(resolved, Ok(Some(Path::new(expect).normalize())), "{}", &case.name); - } - } - } else { - assert!(resolved.is_err(), "{} {resolved:?}", &case.name); - } - } -} diff --git a/src/tests/extension_alias.rs b/src/tests/extension_alias.rs deleted file mode 100644 index cc6a906b..00000000 --- a/src/tests/extension_alias.rs +++ /dev/null @@ -1,70 +0,0 @@ -//! - -use crate::{ResolveError, ResolveOptions, Resolver}; - -#[test] -fn extension_alias() { - let f = super::fixture().join("extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - extension_alias: vec![ - (".js".into(), vec![".ts".into(), ".js".into()]), - (".mjs".into(), vec![".mts".into()]), - ], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should alias fully specified file", f.clone(), "./index.js", f.join("index.ts")), - ("should alias fully specified file when there are two alternatives", f.clone(), "./dir/index.js", f.join("dir/index.ts")), - ("should also allow the second alternative", f.clone(), "./dir2/index.js", f.join("dir2/index.js")), - ("should support alias option without an array", f.clone(), "./dir2/index.mjs", f.join("dir2/index.mts")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } - - #[rustfmt::skip] - let fail = [ - ("should not allow to fallback to the original extension or add extensions", f.clone(), "./index.mjs"), - ]; - - for (comment, path, request) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!( - resolution, - Err(ResolveError::ExtensionAlias(f.join(request))), - "{comment} {path:?} {request}" - ); - } -} - -// should not apply extension alias to extensions or mainFiles field -#[test] -fn not_apply_to_extension_nor_main_files() { - let f = super::fixture().join("extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - extension_alias: vec![(".js".into(), vec![])], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("directory", f.clone(), "./dir2", "dir2/index.js"), - ("file", f.clone(), "./dir2/index", "dir2/index.js"), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - let expected = f.join(expected); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} diff --git a/src/tests/extensions.rs b/src/tests/extensions.rs deleted file mode 100644 index 1ebd86f4..00000000 --- a/src/tests/extensions.rs +++ /dev/null @@ -1,125 +0,0 @@ -//! - -use crate::{EnforceExtension, Resolution, ResolveContext, ResolveError, ResolveOptions, Resolver}; -use rustc_hash::FxHashSet; - -#[test] -fn extensions() { - let f = super::fixture().join("extensions"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".ts".into(), ".js".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve according to order of provided extensions", "./foo", "foo.ts"), - ("should resolve according to order of provided extensions (dir index)", "./dir", "dir/index.ts"), - ("should resolve according to main field in module root", ".", "index.js"), - // This is a core module - // ("should resolve single file module before directory", "module", "node_modules/module.js"), - ("should resolve trailing slash directory before single file", "module/", "node_modules/module/index.ts"), - ]; - - for (comment, request, expected_path) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - let expected = f.join(expected_path); - assert_eq!(resolved_path, Ok(expected), "{comment} {request} {expected_path}"); - } - - #[rustfmt::skip] - let fail = [ - ("not resolve to file when request has a trailing slash (relative)", "./foo.js/", "./foo.js/".into()) - ]; - - for (comment, request, expected_error) in fail { - let resolution = resolver.resolve(&f, request); - let error = ResolveError::NotFound(expected_error); - assert_eq!(resolution, Err(error), "{comment} {request} {resolution:?}"); - } -} - -// should default enforceExtension to true when extensions includes an empty string -#[test] -fn default_enforce_extension() { - let f = super::fixture().join("extensions"); - - let mut ctx = ResolveContext::default(); - let resolved = Resolver::new(ResolveOptions { - extensions: vec![".ts".into(), String::new(), ".js".into()], - ..ResolveOptions::default() - }) - .resolve_with_context(&f, "./foo", &mut ctx); - - assert_eq!(resolved.map(Resolution::into_path_buf), Ok(f.join("foo.ts"))); - assert_eq!( - ctx.file_dependencies, - FxHashSet::from_iter([f.join("foo.ts"), f.join("package.json")]) - ); - assert!(ctx.missing_dependencies.is_empty()); -} - -// should respect enforceExtension when extensions includes an empty string -#[test] -fn respect_enforce_extension() { - let f = super::fixture().join("extensions"); - - let mut ctx = ResolveContext::default(); - let resolved = Resolver::new(ResolveOptions { - enforce_extension: EnforceExtension::Disabled, - extensions: vec![".ts".into(), String::new(), ".js".into()], - ..ResolveOptions::default() - }) - .resolve_with_context(&f, "./foo", &mut ctx); - - assert_eq!(resolved.map(Resolution::into_path_buf), Ok(f.join("foo.ts"))); - assert_eq!( - ctx.file_dependencies, - FxHashSet::from_iter([f.join("foo.ts"), f.join("package.json")]) - ); - assert_eq!(ctx.missing_dependencies, FxHashSet::from_iter([f.join("foo")])); -} - -#[test] -fn multi_dot_extension() { - let f = super::fixture().join("extensions"); - - let resolver = Resolver::new(ResolveOptions { - // Test for `.d.ts`, not part of enhanced-resolve. - extensions: vec![".a.b.c".into(), ".d.ts".into(), ".ts".into(), ".js".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve according to order of provided extensions", "./foo", "foo.ts"), - ("should resolve file with extension", "./app.module", "app.module.js") - ]; - - for (comment, request, expected_path) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - let expected = f.join(expected_path); - assert_eq!(resolved_path, Ok(expected), "{comment} {request} {expected_path}"); - } - - #[rustfmt::skip] - let fail = [ - ("not resolve to file", "./index.", "./index.".into()) - ]; - - for (comment, request, expected_error) in fail { - let resolution = resolver.resolve(&f, request); - let error = ResolveError::NotFound(expected_error); - assert_eq!(resolution, Err(error), "{comment} {request} {resolution:?}"); - } -} - -#[test] -#[should_panic = "All extensions must start with a leading dot"] -fn without_leading_dot() { - Resolver::new(ResolveOptions { - extensions: vec!["ts".into(), "js".into()], - ..ResolveOptions::default() - }); -} diff --git a/src/tests/fallback.rs b/src/tests/fallback.rs deleted file mode 100644 index 3da2d767..00000000 --- a/src/tests/fallback.rs +++ /dev/null @@ -1,100 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/fallback.test.js - -#[test] -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -fn fallback() { - use super::memory_fs::MemoryFS; - use crate::{AliasValue, ResolveError, ResolveOptions, ResolverGeneric}; - use std::path::{Path, PathBuf}; - - let f = Path::new("/"); - - let file_system = MemoryFS::new(&[ - ("/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", ""), - ]); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - fallback: vec![ - ("aliasA".into(), vec![AliasValue::Path("a".into())]), - ("b$".into(), vec![AliasValue::Path("a/index".into())]), - ("c$".into(), vec![AliasValue::Path("/a/index".into())]), - ( - "multiAlias".into(), - vec![ - AliasValue::Path("b".into()), - AliasValue::Path("c".into()), - AliasValue::Path("d".into()), - AliasValue::Path("e".into()), - AliasValue::Path("a".into()), - ], - ), - ("recursive".into(), vec![AliasValue::Path("recursive/dir".into())]), - ("/d/dir".into(), vec![AliasValue::Path("/c/dir".into())]), - ("/d/index.js".into(), vec![AliasValue::Path("/c/index".into())]), - ("ignored".into(), vec![AliasValue::Ignore]), - ("node:path".into(), vec![AliasValue::Ignore]), - ], - modules: vec!["/".into()], - ..ResolveOptions::default() - }, - ); - - #[rustfmt::skip] - let pass = [ - ("should resolve a not aliased module 1", "a", "/a/index"), - ("should resolve a not aliased module 2", "a/index", "/a/index"), - ("should resolve a not aliased module 3", "a/dir", "/a/dir/index"), - ("should resolve a not aliased module 4", "a/dir/index", "/a/dir/index"), - ("should resolve an fallback module 1", "aliasA", "/a/index"), - ("should resolve an fallback module 2", "aliasA/index", "/a/index"), - ("should resolve an fallback module 3", "aliasA/dir", "/a/dir/index"), - ("should resolve an fallback module 4", "aliasA/dir/index", "/a/dir/index"), - ("should resolve a recursive aliased module 1", "recursive", "/recursive/index"), - ("should resolve a recursive aliased module 2", "recursive/index", "/recursive/index"), - ("should resolve a recursive aliased module 3", "recursive/dir", "/recursive/dir/index"), - ("should resolve a recursive aliased module 4", "recursive/dir/index", "/recursive/dir/index"), - ("should resolve a recursive aliased module 5", "recursive/file", "/recursive/dir/file"), - ("should resolve a file aliased module with a query 1", "b?query", "/b/index?query"), - ("should resolve a file aliased module with a query 2", "c?query", "/c/index?query"), - ("should resolve a path in a file aliased module 1", "b/index", "/b/index"), - ("should resolve a path in a file aliased module 2", "b/dir", "/b/dir/index"), - ("should resolve a path in a file aliased module 3", "b/dir/index", "/b/dir/index"), - ("should resolve a path in a file aliased module 4", "c/index", "/c/index"), - ("should resolve a path in a file aliased module 5", "c/dir", "/c/dir/index"), - ("should resolve a path in a file aliased module 6", "c/dir/index", "/c/dir/index"), - ("should resolve a file in multiple aliased dirs 1", "multiAlias/dir/file", "/e/dir/file"), - ("should resolve a file in multiple aliased dirs 2", "multiAlias/anotherDir", "/e/anotherDir/index"), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - - #[rustfmt::skip] - let ignore = [ - ("should resolve an ignore module", "ignored", ResolveError::Ignored(f.join("ignored"))), - ("should resolve node: builtin module", "node:path", ResolveError::Ignored(PathBuf::from("/node:path"))), - ]; - - for (comment, request, expected) in ignore { - let resolution = resolver.resolve(f, request); - assert_eq!(resolution, Err(expected), "{comment} {request}"); - } -} diff --git a/src/tests/full_specified.rs b/src/tests/full_specified.rs deleted file mode 100644 index a70c0191..00000000 --- a/src/tests/full_specified.rs +++ /dev/null @@ -1,113 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/fullSpecified.test.js - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows { - use std::path::PathBuf; - - use crate::{AliasValue, ResolveOptions, ResolverGeneric}; - - use super::super::memory_fs::MemoryFS; - - fn file_system() -> MemoryFS { - MemoryFS::new(&[ - ("/a/node_modules/package1/index.js", ""), - ("/a/node_modules/package1/file.js", ""), - ("/a/node_modules/package2/package.json", r#"{"main":"a"}"#), - ("/a/node_modules/package2/a.js", ""), - ("/a/node_modules/package3/package.json", r#"{"main":"dir"}"#), - ("/a/node_modules/package3/dir/index.js", ""), - ("/a/node_modules/package4/package.json", r#"{"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", ""), - ]) - } - - #[test] - fn test() { - let file_system = file_system(); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - alias: vec![ - ("alias1".into(), vec![AliasValue::from("/a/abc")]), - ("alias2".into(), vec![AliasValue::from("/a")]), - ], - alias_fields: vec![vec!["browser".into()]], - fully_specified: true, - ..ResolveOptions::default() - }, - ); - - let failing_resolves = [ - ("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"), - ]; - - for (comment, request) in failing_resolves { - let resolution = resolver.resolve("/a", request); - assert!(resolution.is_err(), "{comment} {request}"); - } - - let successful_resolves = [ - ("fully relative", "./abc.js", "/a/abc.js"), - ("fully absolute", "/a/abc.js", "/a/abc.js"), - ("fully relative in package", "package1/file.js", "/a/node_modules/package1/file.js"), - ("extensions in mainFiles", "package1", "/a/node_modules/package1/index.js"), - ("extensions in mainFields", "package2", "/a/node_modules/package2/a.js"), - ("extensions in alias", "alias1", "/a/abc.js"), - ("directories in alias", "alias2", "/a/index.js"), - ("directories in packages", "package3", "/a/node_modules/package3/dir/index.js"), - ("extensions in aliasFields", "package4/a.js", "/a/node_modules/package4/b.js"), - ]; - - for (comment, request, expected) in successful_resolves { - let resolution = resolver.resolve("/a", request).map(|r| r.full_path()); - assert_eq!(resolution, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - } - - #[test] - #[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. - fn resolve_to_context() { - let file_system = file_system(); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - alias: vec![ - ("alias1".into(), vec![AliasValue::from("/a/abc")]), - ("alias2".into(), vec![AliasValue::from("/a")]), - ], - alias_fields: vec![vec!["browser".into()]], - fully_specified: true, - resolve_to_context: true, - ..ResolveOptions::default() - }, - ); - - let successful_resolves = [ - ("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", "/a/node_modules/package3/dir"), - ]; - - for (comment, request, expected) in successful_resolves { - let resolution = resolver.resolve("/a", request).map(|r| r.full_path()); - assert_eq!(resolution, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - } -} diff --git a/src/tests/imports_field.rs b/src/tests/imports_field.rs deleted file mode 100644 index c928627a..00000000 --- a/src/tests/imports_field.rs +++ /dev/null @@ -1,1320 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/importsField.test.js -//! -//! The huge imports field test cases are at the bottom of this file. - -use serde_json::json; - -use crate::{Ctx, JSONMap, PathUtil, ResolveError, ResolveOptions, Resolver}; -use std::path::Path; - -#[test] -fn test_simple() { - let f = super::fixture().join("imports-field"); - let f2 = super::fixture().join("imports-exports-wildcard/node_modules/m/"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve using imports field instead of self-referencing", f.clone(), "#imports-field", f.join("b.js")), - ("should resolve using imports field instead of self-referencing for a subpath", f.join("dir"), "#imports-field", f.join("b.js")), - ("should resolve package #1", f.clone(), "#a/dist/main.js", f.join("node_modules/a/lib/lib2/main.js")), - ("should resolve package #3", f.clone(), "#ccc/index.js", f.join("node_modules/c/index.js")), - ("should resolve package #4", f.clone(), "#c", f.join("node_modules/c/index.js")), - ("should resolve with wildcard pattern", f2.clone(), "#internal/i.js", f2.join("src/internal/i.js")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } - - // Note added: - // * should resolve absolute path as an imports field target - // * should log the correct info - - #[rustfmt::skip] - let fail = [ - ("should disallow resolve out of package scope", f.clone(), "#b", ResolveError::InvalidPackageTarget("../b.js".to_string(), "#b".to_string(), f.join("package.json"))), - ("should resolve package #2", f.clone(), "#a", ResolveError::PackageImportNotDefined("#a".to_string(), f.join("package.json"))), - ]; - - for (comment, path, request, error) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!(resolution, Err(error), "{comment} {path:?} {request}"); - } -} - -#[test] -fn shared_resolvers() { - let f = super::fixture().join("imports-field"); - - // field name #1 - let resolver1 = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - imports_fields: vec![vec!["imports".into()]], - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - let resolved_path = resolver1.resolve(&f, "#imports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("b.js"))); - - // field name #2 - let resolver2 = resolver1.clone_with_options(ResolveOptions { - imports_fields: vec![vec!["other".into(), "imports".into()]], - ..ResolveOptions::default() - }); - - let resolved_path = resolver2.resolve(&f, "#b").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("a.js"))); -} - -// Small script for generating the test cases from enhanced_resolve -// for (c of testCases) { -// console.log("TestCase {") -// console.log(`name: ${JSON.stringify(c.name)},`) -// if (c.expect instanceof Error) { -// console.log(`expect: None,`) -// } else { -// console.log(`expect: Some(vec!${JSON.stringify(c.expect)}),`) -// } -// console.log(`imports_field: imports_field(json!(${JSON.stringify(c.suite[0], null, 2)})),`) -// console.log(`request: "${c.suite[1]}",`) -// console.log(`condition_names: vec!${JSON.stringify(c.suite[2])},`) -// console.log("},") -// } - -struct TestCase { - name: &'static str, - expect: Option>, - imports_field: JSONMap, - request: &'static str, - condition_names: Vec<&'static str>, -} - -#[allow(clippy::needless_pass_by_value)] -fn imports_field(value: serde_json::Value) -> JSONMap { - let s = serde_json::to_string(&value).unwrap(); - serde_json::from_str(&s).unwrap() -} - -#[test] -fn test_cases() { - let test_cases = [ - TestCase { - name: "sample #1", - expect: Some(vec!["./dist/test/file.js"]), - imports_field: imports_field(json!({ - "#abc/": { - "import": [ - "./dist/", - "./src/" - ], - "webpack": "./wp/" - }, - "#abc": "./main.js" - })), - request: "#abc/test/file.js", - condition_names: vec!["import", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "sample #1", - expect: Some(vec!["./src/test/file.js"]), - imports_field: imports_field(json!({ - "#abc/": { - "import": [ - "./src/" - ], - "webpack": "./wp/" - }, - "#abc": "./main.js" - })), - request: "#abc/test/file.js", - condition_names: vec!["import", "webpack"], - }, - TestCase { - name: "sample #2", - expect: Some(vec!["./data/timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#1/timezones/": "./data/timezones/" - })), - request: "#1/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #3", - expect: Some(vec!["./data/timezones/timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#aaa/": "./data/timezones/", - "#a/": "./data/timezones/" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #4", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/lib/": { - "browser": [ - "./browser/" - ] - }, - "#a/dist/index.js": { - "node": "./index.js" - } - })), - request: "#a/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #5", - expect: Some(vec!["./browser/index.js"]), - imports_field: imports_field(json!({ - "#a/lib/": { - "browser": [ - "./browser/" - ] - }, - "#a/dist/index.js": { - "node": "./index.js", - "default": "./browser/index.js" - } - })), - request: "#a/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #6", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/dist/a": "./dist/index.js" - })), - request: "#a/dist/aaa", - condition_names: vec![], - }, - TestCase { - name: "sample #7", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/a/a/": "./dist/index.js" - })), - request: "#a/a/a", - condition_names: vec![], - }, - TestCase { - name: "sample #8", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": "./index.js" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #9", - expect: Some(vec!["./main.js"]), - imports_field: imports_field(json!({ - "#a/index.js": "./main.js" - })), - request: "#a/index.js", - condition_names: vec![], - }, - TestCase { - name: "sample #10", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #11", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/bar#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #12", - expect: Some(vec!["./ok.js#abc"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/ok.js#abc", - condition_names: vec![], - }, - TestCase { - name: "sample #13", - expect: Some(vec!["./ok.js?abc"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/ok.js?abc", - condition_names: vec![], - }, - TestCase { - name: "sample #14", - expect: Some(vec!["./🎉.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/🎉.js", - condition_names: vec![], - }, - TestCase { - name: "sample #15", - expect: Some(vec!["./%F0%9F%8E%89.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/%F0%9F%8E%89.js", - condition_names: vec![], - }, - TestCase { - name: "sample #16", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/🎉", - condition_names: vec![], - }, - TestCase { - name: "sample #17", - expect: Some(vec!["./other.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/%F0%9F%8E%89", - condition_names: vec![], - }, - TestCase { - name: "sample #18", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/module", - condition_names: vec![], - }, - TestCase { - name: "sample #19", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/module#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #20", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/module?foo", - condition_names: vec![], - }, - TestCase { - name: "sample #21", - expect: Some(vec!["./d?e?f"]), - imports_field: imports_field(json!({ - "#a/a?b?c/": "./" - })), - request: "#a/a?b?c/d?e?f", - condition_names: vec![], - }, - TestCase { - name: "sample #22", - // We throw InvalidPackageTarget - expect: None, - // expect: Some(vec!["/user/a/index"]), - imports_field: imports_field(json!({ - "#a/": "/user/a/" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #1", - expect: Some(vec!["./A/b/d.js"]), - imports_field: imports_field(json!({ - "#a/": "./A/", - "#a/b/c": "./c.js" - })), - request: "#a/b/d.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #2", - expect: Some(vec!["./A/c.js"]), - imports_field: imports_field(json!({ - "#a/": "./A/", - "#a/b": "./b.js" - })), - request: "#a/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #3", - expect: Some(vec!["./A/b/c/d.js"]), - imports_field: imports_field(json!({ - "#a/": "./A/", - "#a/b/c/d": "./c.js" - })), - request: "#a/b/c/d.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #1", - expect: Some(vec!["./dist/index.js"]), - imports_field: imports_field(json!({ - "#a": "./dist/index.js" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #2", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": "./" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #3", - expect: Some(vec!["./dist/a.js"]), - imports_field: imports_field(json!({ - "#a/": "./dist/", - "#a/index.js": "./dist/a.js" - })), - request: "#a/index.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #4", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "./browser/" - ] - }, - "#a/index.js": { - "browser": "./index.js" - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #5", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "./browser/" - ] - }, - "#a/index.js": { - "node": "./node.js" - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #6", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: "#a", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #7", - expect: Some(vec!["./src/index.js"]), // `enhanced_resolve` is `None` - imports_field: imports_field(json!({ - "#a": { - "default": "./src/index.js", - "browser": "./index.js", - "node": "./src/node/index.js" - } - })), - request: "#a", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #8", - expect: Some(vec!["./src/index.js"]), - imports_field: imports_field(json!({ - "#a": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #9", - expect: Some(vec!["./index"]), - imports_field: imports_field(json!({ - "#a": "./index" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #10", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/index": "./index.js" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #11", - // We throw InvalidPackageTarget - // expect: Some(vec!["b"]), - expect: None, - imports_field: imports_field(json!({ - "#a": "b" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #12", - // We throw InvalidPackageTarget - // expect: Some(vec!["b/index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "b/" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #13", - // We throw InvalidPackageTarget - // expect: Some(vec!["b#anotherhashishere"]), - expect: None, - imports_field: imports_field(json!({ - "#a?q=a#hashishere": "b#anotherhashishere" - })), - request: "#a?q=a#hashishere", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #1", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #2", - expect: Some(vec!["./import.mjs"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec!["import"], - }, - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./require.js"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./import.mjs"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./require.js"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": [ - "./require.js" - ] - }, - { - "import": [ - "./import.mjs", - "#b/import.js" - ] - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./import.mjs"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "./import.mjs", - "#b/import.js" - ] - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "#b/import.js" - ] - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "mapping to a folder root #1", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#timezones": "./data/timezones/" - })), - request: "#timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #2", - expect: None, - imports_field: imports_field(json!({ - "#timezones/": "./data/timezones" - })), - request: "#timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #3", - expect: Some(vec!["./data/timezones/pdt/index.mjs"]), - imports_field: imports_field(json!({ - "#timezones/pdt/": "./data/timezones/pdt/" - })), - request: "#timezones/pdt/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #4", - expect: Some(vec!["./timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#a/": "./timezones/" - })), - request: "#a/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #5", - expect: Some(vec!["./timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#a/": "./" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #6", - expect: None, - imports_field: imports_field(json!({ - "#a/": "." - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #7", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": "./" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #1", - expect: Some(vec!["./lib/index.mjs"]), - imports_field: imports_field(json!({ - "#a/": "./", - "#a/dist/": "./lib/" - })), - request: "#a/dist/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #2", - expect: Some(vec!["./dist/utils/index.js"]), - imports_field: imports_field(json!({ - "#a/dist/utils/": "./dist/utils/", - "#a/dist/": "./lib/" - })), - request: "#a/dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #3", - expect: Some(vec!["./dist/utils/index.js"]), - imports_field: imports_field(json!({ - "#a/dist/utils/index.js": "./dist/utils/index.js", - "#a/dist/utils/": "./dist/utils/index.mjs", - "#a/dist/": "./lib/" - })), - request: "#a/dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #4", - expect: Some(vec!["./lib/index.mjs"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./browser/" - }, - "#a/dist/": "./lib/" - })), - request: "#a/dist/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #1", - // This behaves differently from enhanced_resolve, because `lodash/` is an an InvalidPackageConfig - // expect: Some(vec!["lodash/index.js"]), - expect: Some(vec!["./utils/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "conditional mapping folder #1", - expect: Some(vec!["./utils/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #2", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./node/" - ] - } - })), - request: "#a/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "conditional mapping folder #3", - expect: Some(vec!["./wpk/index.mjs"]), - imports_field: imports_field(json!({ - "#a/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils/" - ] - } - })), - request: "#a/index.mjs", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "incorrect exports field #1", - // We throw `PackageImportNotDefined` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "/utils/": "./a/" - })), - request: "#a/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #2", - // We throw `PackageImportNotDefined` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "/utils/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#a/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #3", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index": "./a/index.js" - })), - request: "#a/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #4", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index.mjs": "./a/index.js" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #5", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "#a/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #6", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index.mjs": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "#a/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #1", - // We don't throw in `package_imports_exports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": "./a/" - })), - request: "/utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect request #2", - // We don't throw in `package_imports_exports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #3", - // We don't throw in `package_imports_exports_resolve`, it's thrown in `package_imports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #4", - // We don't throw in `package_imports_exports_resolve`, it's thrown in `package_imports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#/", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #5", - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#a/", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #1", - // expect: Some(vec!["./dist/index"]), - expect: Some(vec!["dist/index"]), - imports_field: imports_field(json!({ - "#a/../../utils/": "./dist/" - })), - request: "#a/../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #2", - // We throw InvalidPackageTarget - // expect: Some(vec!["./dist/../../utils/index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "./dist/" - })), - request: "#a/../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #3", - // We throw InvalidPackageTarget - // expect: Some(vec!["../src/index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "../src/" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #4", - // We throw InvalidPackageTarget - // expect: Some(vec!["./utils/../../../index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": { - "browser": "./utils/../../../" - } - })), - request: "#a/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #1", - // expect: Some(vec!["moment/node_modules/lodash/dist/index.js"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": { - "browser": "moment/node_modules/" - } - })), - request: "#a/lodash/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #2", - // We throw InvalidPackageTarget - // expect: Some(vec!["../node_modules/lodash/dist/index.js"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "../node_modules/" - })), - request: "#a/lodash/dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "nested mapping #1", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": "./", - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./node/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "nested mapping #3", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["webpack"], - }, - TestCase { - name: "nested mapping #4", - // We throw NotFound - // expect: Some(vec!["moment/node/index.js"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "moment/node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["node", "browser"], - }, - TestCase { - name: "nested mapping #5", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "node"], - }, - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./node/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - TestCase { - name: "nested mapping #7", - expect: Some(vec!["./y.js"]), - imports_field: imports_field(json!({ - "#a": { - "abc": { - "def": "./x.js" - }, - "ghi": "./y.js" - } - })), - request: "#a", - condition_names: vec!["abc", "ghi"], - }, - TestCase { - name: "nested mapping #8", - // We throw PackageImportNotDefined - // expect: Some(vec![]), - expect: None, - imports_field: imports_field(json!({ - "#a": { - "abc": { - "def": "./x.js", - "default": [] - }, - "ghi": "./y.js" - } - })), - request: "#a", - condition_names: vec!["abc", "ghi"], - }, - ]; - - for case in test_cases { - let resolved = Resolver::default() - .package_imports_exports_resolve( - case.request, - &case.imports_field, - Path::new(""), - true, - &case.condition_names.iter().map(ToString::to_string).collect::>(), - &mut Ctx::default(), - ) - .map(|p| p.map(|p| p.to_path_buf())); - if let Some(expect) = case.expect { - if expect.is_empty() { - assert!(matches!(resolved, Ok(None)), "{} {:?}", &case.name, &resolved); - } else { - for expect in expect { - assert_eq!(resolved, Ok(Some(Path::new(expect).normalize())), "{}", &case.name); - } - } - } else { - assert!(resolved.is_err(), "{} {resolved:?}", &case.name); - } - } -} diff --git a/src/tests/incorrect_description_file.rs b/src/tests/incorrect_description_file.rs deleted file mode 100644 index e2caecbb..00000000 --- a/src/tests/incorrect_description_file.rs +++ /dev/null @@ -1,65 +0,0 @@ -//! - -use rustc_hash::FxHashSet; - -use crate::{JSONError, Resolution, ResolveContext, ResolveError, ResolveOptions, Resolver}; - -// should not resolve main in incorrect description file #1 -#[test] -fn incorrect_description_file_1() { - let f = super::fixture().join("incorrect-package"); - let mut ctx = ResolveContext::default(); - let resolution = Resolver::default().resolve_with_context(f.join("pack1"), ".", &mut ctx); - let error = ResolveError::JSON(JSONError { - path: f.join("pack1/package.json"), - message: String::from("EOF while parsing a value at line 3 column 0"), - line: 3, - column: 0, - }); - assert_eq!(resolution, Err(error)); - assert_eq!( - ctx.file_dependencies, - FxHashSet::from_iter([f.join("pack1"), f.join("pack1/package.json")]) - ); - assert!(!ctx.missing_dependencies.is_empty()); -} - -// should not resolve main in incorrect description file #2 -#[test] -fn incorrect_description_file_2() { - let f = super::fixture().join("incorrect-package"); - let resolution = Resolver::default().resolve(f.join("pack2"), "."); - let error = ResolveError::JSON(JSONError { - path: f.join("pack2/package.json"), - message: String::from("EOF while parsing a value at line 1 column 0"), - line: 1, - column: 0, - }); - assert_eq!(resolution, Err(error)); -} - -// should not resolve main in incorrect description file #3 -#[test] -fn incorrect_description_file_3() { - let f = super::fixture().join("incorrect-package"); - let resolution = Resolver::default().resolve(f.join("pack2"), "."); - assert!(resolution.is_err()); -} - -// `enhanced_resolve` does not have this test case -#[test] -fn no_description_file() { - let f = super::fixture_root().join("enhanced_resolve"); - - // has description file - let resolver = Resolver::default(); - assert_eq!( - resolver.resolve(&f, ".").map(Resolution::into_path_buf), - Ok(f.join("lib/index.js")) - ); - - // without description file - let resolver = - Resolver::new(ResolveOptions { description_files: vec![], ..ResolveOptions::default() }); - assert_eq!(resolver.resolve(&f, "."), Err(ResolveError::NotFound(".".into()))); -} diff --git a/src/tests/main_field.rs b/src/tests/main_field.rs deleted file mode 100644 index 3cadc8ce..00000000 --- a/src/tests/main_field.rs +++ /dev/null @@ -1,24 +0,0 @@ -//! Not part of enhanced_resolve's test suite - -use crate::{ResolveOptions, Resolver}; - -#[test] -fn test() { - let f = super::fixture().join("restrictions"); - - let resolver1 = Resolver::new(ResolveOptions { - main_fields: vec!["style".into()], - ..ResolveOptions::default() - }); - - let resolution = resolver1.resolve(&f, "pck2").map(|r| r.full_path()); - assert_eq!(resolution, Ok(f.join("node_modules/pck2/index.css"))); - - let resolver2 = resolver1.clone_with_options(ResolveOptions { - main_fields: vec!["module".into(), "main".into()], - ..ResolveOptions::default() - }); - - let resolution = resolver2.resolve(&f, "pck2").map(|r| r.full_path()); - assert_eq!(resolution, Ok(f.join("node_modules/pck2/module.js"))); -} diff --git a/src/tests/memory_fs.rs b/src/tests/memory_fs.rs deleted file mode 100644 index e4116609..00000000 --- a/src/tests/memory_fs.rs +++ /dev/null @@ -1,74 +0,0 @@ -use std::{ - io, - path::{Path, PathBuf}, -}; - -use crate::{FileMetadata, FileSystem}; - -#[derive(Default)] -pub struct MemoryFS { - fs: vfs::MemoryFS, -} - -impl MemoryFS { - /// # Panics - /// - /// * Fails to create directory - /// * Fails to write file - #[allow(dead_code)] - pub fn new(data: &[(&'static str, &'static str)]) -> Self { - let mut fs = Self { fs: vfs::MemoryFS::default() }; - for (path, content) in data { - fs.add_file(Path::new(path), content); - } - fs - } - - #[allow(dead_code)] - pub fn add_file(&mut self, path: &Path, content: &str) { - use vfs::FileSystem; - let fs = &mut self.fs; - // Create all parent directories - for path in path.ancestors().collect::>().iter().rev() { - let path = path.to_string_lossy(); - if !fs.exists(path.as_ref()).unwrap() { - fs.create_dir(path.as_ref()).unwrap(); - } - } - // Create file - let mut file = fs.create_file(path.to_string_lossy().as_ref()).unwrap(); - file.write_all(content.as_bytes()).unwrap(); - } -} - -impl FileSystem for MemoryFS { - fn read_to_string(&self, path: &Path) -> io::Result { - use vfs::FileSystem; - let mut file = self - .fs - .open_file(path.to_string_lossy().as_ref()) - .map_err(|err| io::Error::new(io::ErrorKind::NotFound, err))?; - let mut buffer = String::new(); - file.read_to_string(&mut buffer).unwrap(); - Ok(buffer) - } - - fn metadata(&self, path: &Path) -> io::Result { - use vfs::FileSystem; - let metadata = self - .fs - .metadata(path.to_string_lossy().as_ref()) - .map_err(|err| io::Error::new(io::ErrorKind::NotFound, err))?; - let is_file = metadata.file_type == vfs::VfsFileType::File; - let is_dir = metadata.file_type == vfs::VfsFileType::Directory; - Ok(FileMetadata::new(is_file, is_dir, false)) - } - - fn symlink_metadata(&self, path: &Path) -> io::Result { - self.metadata(path) - } - - fn canonicalize(&self, _path: &Path) -> io::Result { - Err(io::Error::new(io::ErrorKind::NotFound, "not a symlink")) - } -} diff --git a/src/tests/missing.rs b/src/tests/missing.rs deleted file mode 100644 index 4bf611ef..00000000 --- a/src/tests/missing.rs +++ /dev/null @@ -1,106 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/missing.test.js - -use normalize_path::NormalizePath; - -use crate::{AliasValue, ResolveContext, ResolveOptions, Resolver}; - -#[test] -fn test() { - let f = super::fixture(); - - let data = [ - ( - "./missing-file", - vec![f.join("missing-file"), f.join("missing-file.js"), f.join("missing-file.node")], - ), - ( - "missing-module", - vec![ - f.join("node_modules/missing-module"), - f.parent().unwrap().join("node_modules"), // enhanced-resolve is "node_modules/missing-module" - ], - ), - ( - "missing-module/missing-file", - vec![ - f.join("node_modules/missing-module"), - // f.parent().unwrap().join("node_modules/missing-module"), // we don't report this - ], - ), - ( - "m1/missing-file", - vec![ - f.join("node_modules/m1/missing-file"), - f.join("node_modules/m1/missing-file.js"), - f.join("node_modules/m1/missing-file.node"), - // f.parent().unwrap().join("node_modules/m1"), // we don't report this - ], - ), - ( - "m1/", - vec![ - f.join("node_modules/m1/index"), - f.join("node_modules/m1/index.js"), - f.join("node_modules/m1/index.json"), - f.join("node_modules/m1/index.node"), - ], - ), - ("m1/a", vec![f.join("node_modules/m1/a")]), - ]; - - let resolver = Resolver::default(); - - for (specifier, missing_dependencies) in data { - let mut ctx = ResolveContext::default(); - let _ = resolver.resolve_with_context(&f, specifier, &mut ctx); - - for path in ctx.file_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - } - - for path in missing_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - assert!( - ctx.missing_dependencies.contains(&path), - "{specifier}: {path:?} not in {:?}", - &ctx.missing_dependencies - ); - } - } -} - -#[test] -fn alias_and_extensions() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias: vec![ - ( - "@scope-js/package-name/dir$".into(), - vec![AliasValue::Path(f.join("foo/index.js").to_string_lossy().to_string())], - ), - ( - "react-dom".into(), - vec![AliasValue::Path(f.join("foo/index.js").to_string_lossy().to_string())], - ), - ], - extensions: vec![".server.ts".into()], - - ..ResolveOptions::default() - }); - - let mut ctx = ResolveContext::default(); - let _ = resolver.resolve_with_context(&f, "@scope-js/package-name/dir/router", &mut ctx); - let _ = resolver.resolve_with_context(&f, "react-dom/client", &mut ctx); - - for path in ctx.file_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - } - - for path in ctx.missing_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - if let Some(path) = path.parent() { - assert!(!path.is_file(), "{path:?} must not be a file"); - } - } -} diff --git a/src/tests/mod.rs b/src/tests/mod.rs deleted file mode 100644 index e347dd1f..00000000 --- a/src/tests/mod.rs +++ /dev/null @@ -1,51 +0,0 @@ -mod alias; -mod browser_field; -mod builtins; -mod dependencies; -mod exports_field; -mod extension_alias; -mod extensions; -mod fallback; -mod full_specified; -mod imports_field; -mod incorrect_description_file; -mod main_field; -mod memory_fs; -mod missing; -#[cfg(feature = "yarn_pnp")] -mod pnp; -mod resolve; -mod restrictions; -mod roots; -mod scoped_packages; -mod simple; -mod symlink; -mod tsconfig_paths; -mod tsconfig_project_references; - -use crate::Resolver; -use std::{env, path::PathBuf, sync::Arc, thread}; - -pub fn fixture_root() -> PathBuf { - env::current_dir().unwrap().join("fixtures") -} - -pub fn fixture() -> PathBuf { - fixture_root().join("enhanced_resolve").join("test").join("fixtures") -} - -#[test] -fn threaded_environment() { - let cwd = env::current_dir().unwrap(); - let resolver = Arc::new(Resolver::default()); - for _ in 0..2 { - _ = thread::spawn({ - let cwd = cwd.clone(); - let resolver = Arc::clone(&resolver); - move || { - _ = resolver.resolve(cwd, "."); - } - }) - .join(); - } -} diff --git a/src/tests/pnp.rs b/src/tests/pnp.rs deleted file mode 100644 index 1562a009..00000000 --- a/src/tests/pnp.rs +++ /dev/null @@ -1,45 +0,0 @@ -//! Not part of enhanced_resolve's test suite -//! -//! enhanced_resolve's test -//! cannot be ported over because it uses mocks on `pnpApi` provided by the runtime. - -use crate::{ResolveOptions, Resolver}; - -#[test] -fn pnp1() { - let fixture = super::fixture_root().join("pnp"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - pnp_manifest: Some(pnp::load_pnp_manifest(fixture.join(".pnp.cjs")).unwrap()), - ..ResolveOptions::default() - }); - - assert_eq!( - resolver.resolve(&fixture, "is-even").map(|r| r.full_path()), - Ok(fixture.join( - ".yarn/cache/is-even-npm-1.0.0-9f726520dc-2728cc2f39.zip/node_modules/is-even/index.js" - )) - ); - - assert_eq!( - resolver - .resolve( - &fixture.join( - ".yarn/cache/is-even-npm-1.0.0-9f726520dc-2728cc2f39.zip/node_modules/is-even" - ), - "is-odd" - ) - .map(|r| r.full_path()), - Ok(fixture.join( - ".yarn/cache/is-odd-npm-0.1.2-9d980a9da8-7dc6c6fd00.zip/node_modules/is-odd/index.js" - )), - ); - - assert_eq!( - resolver.resolve(&fixture, "is-odd").map(|r| r.full_path()), - Ok(fixture.join( - ".yarn/cache/is-odd-npm-3.0.1-93c3c3f41b-89ee2e353c.zip/node_modules/is-odd/index.js" - )), - ); -} diff --git a/src/tests/resolve.rs b/src/tests/resolve.rs deleted file mode 100644 index f2dbb88e..00000000 --- a/src/tests/resolve.rs +++ /dev/null @@ -1,119 +0,0 @@ -//! - -use crate::{ResolveError, ResolveOptions, Resolver}; - -#[test] -fn resolve() { - let f = super::fixture(); - - let resolver = Resolver::default(); - - let main1_js_path = f.join("main1.js").to_string_lossy().to_string(); - - #[rustfmt::skip] - let pass = [ - ("absolute path", f.clone(), main1_js_path.as_str(), f.join("main1.js")), - ("file with .js", f.clone(), "./main1.js", f.join("main1.js")), - ("file without extension", f.clone(), "./main1", f.join("main1.js")), - ("another file with .js", f.clone(), "./a.js", f.join("a.js")), - ("another file without extension", f.clone(), "./a", f.join("a.js")), - ("file in module with .js", f.clone(), "m1/a.js", f.join("node_modules/m1/a.js")), - ("file in module without extension", f.clone(), "m1/a", f.join("node_modules/m1/a.js")), - ("another file in module without extension", f.clone(), "complexm/step1", f.join("node_modules/complexm/step1.js")), - ("from submodule to file in sibling module", f.join("node_modules/complexm"), "m2/b.js", f.join("node_modules/m2/b.js")), - ("from nested directory to overwritten file in module", f.join("multiple_modules"), "m1/a.js", f.join("multiple_modules/node_modules/m1/a.js")), - ("from nested directory to not overwritten file in module", f.join("multiple_modules"), "m1/b.js", f.join("node_modules/m1/b.js")), - ("file with query", f.clone(), "./main1.js?query", f.join("main1.js?query")), - ("file with fragment", f.clone(), "./main1.js#fragment", f.join("main1.js#fragment")), - ("file with fragment and query", f.clone(), "./main1.js#fragment?query", f.join("main1.js#fragment?query")), - ("file with query and fragment", f.clone(), "./main1.js?#fragment", f.join("main1.js?#fragment")), - - ("file with query (unicode)", f.clone(), "./测试.js?query", f.join("测试.js?query")), - ("file with fragment (unicode)", f.clone(), "./测试.js#fragment", f.join("测试.js#fragment")), - ("file with fragment and query (unicode)", f.clone(), "./测试.js#fragment?query", f.join("测试.js#fragment?query")), - ("file with query and fragment (unicode)", f.clone(), "./测试.js?#fragment", f.join("测试.js?#fragment")), - - ("file in module with query", f.clone(), "m1/a?query", f.join("node_modules/m1/a.js?query")), - ("file in module with fragment", f.clone(), "m1/a#fragment", f.join("node_modules/m1/a.js#fragment")), - ("file in module with fragment and query", f.clone(), "m1/a#fragment?query", f.join("node_modules/m1/a.js#fragment?query")), - ("file in module with query and fragment", f.clone(), "m1/a?#fragment", f.join("node_modules/m1/a.js?#fragment")), - ("file in module with query and fragment", f.clone(), "m1/a?#fragment", f.join("node_modules/m1/a.js?#fragment")), - ("differ between directory and file, resolve file", f.clone(), "./dirOrFile", f.join("dirOrFile.js")), - ("differ between directory and file, resolve directory", f.clone(), "./dirOrFile/", f.join("dirOrFile/index.js")), - ("find node_modules outside of node_modules", f.join("browser-module/node_modules"), "m1/a", f.join("node_modules/m1/a.js")), - ("don't crash on main field pointing to self", f.clone(), "./main-field-self", f.join("./main-field-self/index.js")), - ("don't crash on main field pointing to self (2)", f.clone(), "./main-field-self2", f.join("./main-field-self2/index.js")), - // enhanced-resolve has `#` prepended with a `\0`, they are removed from the - // following 3 expected test results. - // See https://github.com/webpack/enhanced-resolve#escaping - ("handle fragment edge case (no fragment)", f.clone(), "./no#fragment/#/#", f.join("no#fragment/#/#.js")), - ("handle fragment edge case (fragment)", f.clone(), "./no#fragment/#/", f.join("no.js#fragment/#/")), - ("handle fragment escaping", f.clone(), "./no\0#fragment/\0#/\0##fragment", f.join("no#fragment/#/#.js#fragment")), - - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn issue238_resolve() { - let f = super::fixture().join("issue-238"); - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into(), ".jsx".into(), ".ts".into(), ".tsx".into()], - modules: vec!["src/a".into(), "src/b".into(), "src/common".into(), "node_modules".into()], - ..ResolveOptions::default() - }); - let resolved_path = - resolver.resolve(f.join("src/common"), "config/myObjectFile").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("src/common/config/myObjectFile.js")),); -} - -#[test] -fn prefer_relative() { - let f = super::fixture(); - - let resolver = - Resolver::new(ResolveOptions { prefer_relative: true, ..ResolveOptions::default() }); - - #[rustfmt::skip] - let pass = [ - ("should correctly resolve with preferRelative 1", "main1.js", f.join("main1.js")), - ("should correctly resolve with preferRelative 2", "m1/a.js", f.join("node_modules/m1/a.js")), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } -} - -#[test] -fn resolve_to_context() { - let f = super::fixture(); - let resolver = - Resolver::new(ResolveOptions { resolve_to_context: true, ..ResolveOptions::default() }); - - #[rustfmt::skip] - let data = [ - ("context for fixtures", f.clone(), "./", f.clone()), - ("context for fixtures/lib", f.clone(), "./lib", f.join("lib")), - ("context for fixtures with ..", f.clone(), "./lib/../../fixtures/./lib/..", f.clone()), - ("context for fixtures with query", f.clone(), "./?query", f.clone().with_file_name("fixtures?query")), - ]; - - for (comment, path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn resolve_hash_as_module() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions::default()); - let resolution = resolver.resolve(f, "#a"); - assert_eq!(resolution, Err(ResolveError::NotFound("#a".into()))); -} diff --git a/src/tests/restrictions.rs b/src/tests/restrictions.rs deleted file mode 100644 index 5ba56596..00000000 --- a/src/tests/restrictions.rs +++ /dev/null @@ -1,25 +0,0 @@ -//! - -use crate::{ResolveError, ResolveOptions, Resolver, Restriction}; - -// TODO: regex -// * should respect RegExp restriction -// * should try to find alternative #1 -// * should try to find alternative #2 -// * should try to find alternative #3 - -// should respect string restriction -#[test] -fn restriction1() { - let fixture = super::fixture(); - let f = fixture.join("restrictions"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - restrictions: vec![Restriction::Path(f.clone())], - ..ResolveOptions::default() - }); - - let resolution = resolver.resolve(&f, "pck2"); - assert_eq!(resolution, Err(ResolveError::Restriction(fixture.join("c.js"), f))); -} diff --git a/src/tests/roots.rs b/src/tests/roots.rs deleted file mode 100644 index b50e2a07..00000000 --- a/src/tests/roots.rs +++ /dev/null @@ -1,92 +0,0 @@ -//! - -use std::path::PathBuf; - -use crate::{AliasValue, ResolveError, ResolveOptions, Resolver}; - -fn dirname() -> PathBuf { - super::fixture_root().join("enhanced_resolve").join("test") -} - -#[test] -fn roots() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - alias: vec![("foo".into(), vec![AliasValue::from("/fixtures")])], - roots: vec![dirname(), f.clone()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should respect roots option", "/fixtures/b.js", f.join("b.js")), - ("should try another root option, if it exists", "/b.js", f.join("b.js")), - ("should respect extension", "/fixtures/b", f.join("b.js")), - ("should resolve in directory", "/fixtures/extensions/dir", f.join("extensions/dir/index.js")), - ("should respect aliases", "foo/b", f.join("b.js")), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } - - #[rustfmt::skip] - let fail = [ - ("should not work with relative path", "fixtures/b.js", ResolveError::NotFound("fixtures/b.js".into())) - ]; - - for (comment, request, expected) in fail { - let resolution = resolver.resolve(&f, request); - assert_eq!(resolution, Err(expected), "{comment} {request}"); - } -} - -#[test] -fn resolve_to_context() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - roots: vec![dirname(), f.clone()], - resolve_to_context: true, - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f, "/fixtures/lib").map(|r| r.full_path()); - let expected = f.join("lib"); - assert_eq!(resolved_path, Ok(expected)); -} - -#[test] -fn prefer_absolute() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - alias: vec![("foo".into(), vec![AliasValue::from("/fixtures")])], - roots: vec![dirname(), f.clone()], - prefer_absolute: true, - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve an absolute path (prefer absolute)", f.join("b.js").to_string_lossy().to_string(), f.join("b.js")), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(&f, &request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } -} - -#[test] -fn roots_fall_through() { - let f = super::fixture(); - let absolute_path = f.join("roots_fall_through/index.js"); - let specifier = absolute_path.to_string_lossy(); - let resolution = Resolver::new(ResolveOptions::default().with_root(&f)).resolve(&f, &specifier); - assert_eq!( - resolution.map(super::super::resolution::Resolution::into_path_buf), - Ok(absolute_path) - ); -} diff --git a/src/tests/scoped_packages.rs b/src/tests/scoped_packages.rs deleted file mode 100644 index 8258f00f..00000000 --- a/src/tests/scoped_packages.rs +++ /dev/null @@ -1,25 +0,0 @@ -//! - -use crate::{ResolveOptions, Resolver}; - -#[test] -fn scoped_packages() { - let f = super::fixture().join("scoped"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("main field should work", f.clone(), "@scope/pack1", f.join("./node_modules/@scope/pack1/main.js")), - ("browser field should work", f.clone(), "@scope/pack2", f.join("./node_modules/@scope/pack2/main.js")), - ("folder request should work", f.clone(), "@scope/pack2/lib", f.join("./node_modules/@scope/pack2/lib/index.js")) - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} diff --git a/src/tests/simple.rs b/src/tests/simple.rs deleted file mode 100644 index 08e1238a..00000000 --- a/src/tests/simple.rs +++ /dev/null @@ -1,68 +0,0 @@ -//! - -use std::env; - -use crate::Resolver; - -#[test] -fn simple() { - // mimic `enhanced-resolve/test/simple.test.js` - let dirname = env::current_dir().unwrap().join("fixtures"); - let f = dirname.join("enhanced_resolve/test"); - - let resolver = Resolver::default(); - - let data = [ - ("direct", f.clone(), "../lib/index"), - ("as directory", f, ".."), - ("as module", dirname.clone(), "./enhanced_resolve"), - ]; - - for (comment, path, request) in data { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - let expected = dirname.join("enhanced_resolve/lib/index.js"); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn dashed_name() { - let f = super::fixture(); - - let resolver = Resolver::default(); - - let data = [ - (f.clone(), "dash", f.join("node_modules/dash/index.js")), - (f.clone(), "dash-name", f.join("node_modules/dash-name/index.js")), - (f.join("node_modules/dash"), "dash", f.join("node_modules/dash/index.js")), - (f.join("node_modules/dash"), "dash-name", f.join("node_modules/dash-name/index.js")), - (f.join("node_modules/dash-name"), "dash", f.join("node_modules/dash/index.js")), - (f.join("node_modules/dash-name"), "dash-name", f.join("node_modules/dash-name/index.js")), - ]; - - for (path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{path:?} {request}"); - } -} - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows { - use super::super::memory_fs::MemoryFS; - - use crate::ResolveOptions; - - #[test] - fn no_package() { - use crate::ResolverGeneric; - use std::path::Path; - let f = Path::new("/"); - let file_system = MemoryFS::new(&[]); - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions::default(), - ); - let resolved_path = resolver.resolve(f, "package"); - assert!(resolved_path.is_err()); - } -} diff --git a/src/tests/symlink.rs b/src/tests/symlink.rs deleted file mode 100644 index 7589b560..00000000 --- a/src/tests/symlink.rs +++ /dev/null @@ -1,121 +0,0 @@ -use std::{fs, io, path::Path}; - -use crate::{ResolveOptions, Resolver}; - -#[derive(Debug, Clone, Copy)] -enum FileType { - File, - Dir, -} - -#[allow(unused_variables)] -fn symlink, Q: AsRef>( - original: P, - link: Q, - file_type: FileType, -) -> io::Result<()> { - #[cfg(target_family = "unix")] - { - std::os::unix::fs::symlink(original, link) - } - - #[cfg(target_family = "windows")] - match file_type { - FileType::File => std::os::windows::fs::symlink_file(original, link), - FileType::Dir => std::os::windows::fs::symlink_dir(original, link), - } -} - -fn init(dirname: &Path, temp_path: &Path) -> io::Result<()> { - if temp_path.exists() { - _ = fs::remove_dir_all(temp_path); - } - fs::create_dir(temp_path)?; - symlink(dirname.join("../lib/index.js"), temp_path.join("test"), FileType::File)?; - symlink(dirname.join("../lib"), temp_path.join("test2"), FileType::Dir)?; - fs::remove_file(temp_path.join("test"))?; - fs::remove_file(temp_path.join("test2"))?; - fs::remove_dir(temp_path) -} - -fn create_symlinks(dirname: &Path, temp_path: &Path) -> io::Result<()> { - fs::create_dir(temp_path).unwrap(); - symlink( - dirname.join("../lib/index.js").canonicalize().unwrap(), - temp_path.join("index.js"), - FileType::File, - )?; - symlink(dirname.join("../lib").canonicalize().unwrap(), temp_path.join("lib"), FileType::Dir)?; - symlink(dirname.join("..").canonicalize().unwrap(), temp_path.join("this"), FileType::Dir)?; - symlink(temp_path.join("this"), temp_path.join("that"), FileType::Dir)?; - symlink(Path::new("../../lib/index.js"), temp_path.join("node.relative.js"), FileType::File)?; - symlink( - Path::new("./node.relative.js"), - temp_path.join("node.relative.sym.js"), - FileType::File, - )?; - Ok(()) -} - -fn cleanup_symlinks(temp_path: &Path) { - _ = fs::remove_dir_all(temp_path); -} - -#[test] -fn test() -> io::Result<()> { - let root = super::fixture_root().join("enhanced_resolve"); - let dirname = root.join("test"); - let temp_path = dirname.join("temp"); - if !temp_path.exists() { - let is_admin = init(&dirname, &temp_path).is_ok(); - if !is_admin { - return Ok(()); - } - if let Err(err) = create_symlinks(&dirname, &temp_path) { - cleanup_symlinks(&temp_path); - return Err(err); - } - } - - let resolver_without_symlinks = - Resolver::new(ResolveOptions { symlinks: false, ..ResolveOptions::default() }); - let resolver_with_symlinks = Resolver::default(); - - #[rustfmt::skip] - let pass = [ - ("with a symlink to a file", temp_path.clone(), "./index.js"), - ("with a relative symlink to a file", temp_path.clone(), "./node.relative.js"), - ("with a relative symlink to a symlink to a file", temp_path.clone(), "./node.relative.sym.js"), - ("with a symlink to a directory 1", temp_path.clone(), "./lib/index.js"), - ("with a symlink to a directory 2", temp_path.clone(), "./this/lib/index.js"), - ("with multiple symlinks in the path 1", temp_path.clone(), "./this/test/temp/index.js"), - ("with multiple symlinks in the path 2", temp_path.clone(), "./this/test/temp/lib/index.js"), - ("with multiple symlinks in the path 3", temp_path.clone(), "./this/test/temp/this/lib/index.js"), - ("with a symlink to a directory 2 (chained)", temp_path.clone(), "./that/lib/index.js"), - ("with multiple symlinks in the path 1 (chained)", temp_path.clone(), "./that/test/temp/index.js"), - ("with multiple symlinks in the path 2 (chained)", temp_path.clone(), "./that/test/temp/lib/index.js"), - ("with multiple symlinks in the path 3 (chained)", temp_path.clone(), "./that/test/temp/that/lib/index.js"), - ("with symlinked directory as context 1", temp_path.join( "lib"), "./index.js"), - ("with symlinked directory as context 2", temp_path.join( "this"), "./lib/index.js"), - ("with symlinked directory as context and in path", temp_path.join( "this"), "./test/temp/lib/index.js"), - ("with symlinked directory in context path", temp_path.join( "this/lib"), "./index.js"), - ("with symlinked directory in context path and symlinked file", temp_path.join( "this/test"), "./temp/index.js"), - ("with symlinked directory in context path and symlinked directory", temp_path.join( "this/test"), "./temp/lib/index.js"), - ("with symlinked directory as context 2 (chained)", temp_path.join( "that"), "./lib/index.js"), - ("with symlinked directory as context and in path (chained)", temp_path.join( "that"), "./test/temp/lib/index.js"), - ("with symlinked directory in context path (chained)", temp_path.join( "that/lib"), "./index.js"), - ("with symlinked directory in context path and symlinked file (chained)", temp_path.join( "that/test"), "./temp/index.js"), - ("with symlinked directory in context path and symlinked directory (chained)", temp_path.join( "that/test"), "./temp/lib/index.js") - ]; - - for (comment, path, request) in pass { - let filename = resolver_with_symlinks.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(filename, Ok(root.join("lib/index.js")), "{comment:?}"); - - let resolved_path = - resolver_without_symlinks.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(path.join(request))); - } - - Ok(()) -} diff --git a/src/tests/tsconfig_paths.rs b/src/tests/tsconfig_paths.rs deleted file mode 100644 index b85bf6be..00000000 --- a/src/tests/tsconfig_paths.rs +++ /dev/null @@ -1,530 +0,0 @@ -//! tests for tsconfig-paths -//! -//! Fixtures copied from . - -use std::path::{Path, PathBuf}; - -use crate::{ - JSONError, ResolveError, ResolveOptions, Resolver, TsConfig, TsconfigOptions, - TsconfigReferences, -}; - -// -#[test] -fn tsconfig() { - let f = super::fixture_root().join("tsconfig"); - - #[rustfmt::skip] - let pass = [ - (f.clone(), None, "ts-path", f.join("foo.js")), - (f.join("nested"), None, "ts-path", f.join("nested/test.js")), - (f.join("cases/index"), None, "foo", f.join("node_modules/tsconfig-index/foo.js")), - // This requires reading package.json.tsconfig field - // (f.join("cases/field"), "foo", f.join("node_modules/tsconfig-field/foo.js")) - (f.join("cases/exports"), None, "foo", f.join("node_modules/tsconfig-exports/foo.js")), - (f.join("cases/extends-extension"), None, "foo", f.join("cases/extends-extension/foo.js")), - (f.join("cases/extends-extensionless"), None, "foo", f.join("node_modules/tsconfig-field/foo.js")), - (f.join("cases/extends-paths"), Some("src"), "@/index", f.join("cases/extends-paths/src/index.js")), - (f.join("cases/extends-multiple"), None, "foo", f.join("cases/extends-multiple/foo.js")), - ]; - - for (dir, subdir, request, expected) in pass { - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: dir.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - let path = subdir.map_or(dir.clone(), |subdir| dir.join(subdir)); - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{request} {path:?}"); - } - - #[rustfmt::skip] - let data = [ - (f.join("node_modules/tsconfig-not-used"), "ts-path", Ok(f.join("foo.js"))), - ]; - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - for (path, request, expected) in data { - let resolution = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolution, expected, "{path:?} {request}"); - } -} - -#[test] -fn tsconfig_fallthrough() { - let f = super::fixture_root().join("tsconfig"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "/"); - assert_eq!(resolved_path, Err(ResolveError::NotFound("/".into()))); -} - -#[test] -fn json_with_comments() { - let f = super::fixture_root().join("tsconfig/cases/trailing-comma"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "foo").map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(f.join("bar.js"))); -} - -#[test] -fn broken() { - let f = super::fixture_root().join("tsconfig"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("tsconfig_broken.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "/"); - let error = ResolveError::JSON(JSONError { - path: f.join("tsconfig_broken.json"), - message: String::from("EOF while parsing an object at line 2 column 0"), - line: 2, - column: 0, - }); - assert_eq!(resolved_path, Err(error)); -} - -// -#[test] -fn test_paths() { - let path = Path::new("/foo/tsconfig.json"); - let mut tsconfig_json = serde_json::json!({ - "compilerOptions": { - "paths": { - "jquery": ["node_modules/jquery/dist/jquery"], - "*": ["generated/*"], - "bar/*": ["test/*"], - "bar/baz/*": ["baz/*", "yo/*"], - "@/components/*": ["components/*"], - "url": ["node_modules/my-url"], - } - } - }) - .to_string(); - let tsconfig = TsConfig::parse(true, path, &mut tsconfig_json).unwrap(); - - let data = [ - ("jquery", vec!["/foo/node_modules/jquery/dist/jquery"]), - ("test", vec!["/foo/generated/test"]), - ("test/hello", vec!["/foo/generated/test/hello"]), - ("bar/hi", vec!["/foo/test/hi"]), - ("bar/baz/hi", vec!["/foo/baz/hi", "/foo/yo/hi"]), - ("@/components/button", vec!["/foo/components/button"]), - ("./jquery", vec![]), - ("url", vec!["/foo/node_modules/my-url"]), - ]; - - for (specifier, expected) in data { - let paths = tsconfig.resolve_path_alias(specifier); - let expected = expected.into_iter().map(PathBuf::from).collect::>(); - assert_eq!(paths, expected, "{specifier}"); - } -} - -// -#[test] -fn test_base_url() { - let path = Path::new("/foo/tsconfig.json"); - let mut tsconfig_json = serde_json::json!({ - "compilerOptions": { - "baseUrl": "./src" - } - }) - .to_string(); - let tsconfig = TsConfig::parse(true, path, &mut tsconfig_json).unwrap(); - - let data = [ - ("foo", vec!["/foo/src/foo"]), - ("components/button", vec!["/foo/src/components/button"]), - ("./jquery", vec![]), - ]; - - for (specifier, expected) in data { - let paths = tsconfig.resolve_path_alias(specifier); - let expected = expected.into_iter().map(PathBuf::from).collect::>(); - assert_eq!(paths, expected, "{specifier}"); - } -} - -// -#[test] -fn test_paths_and_base_url() { - let path = Path::new("/foo/tsconfig.json"); - let mut tsconfig_json = serde_json::json!({ - "compilerOptions": { - "baseUrl": "./src", - "paths": { - "*": ["generated/*"], - "bar/*": ["test/*"], - "bar/baz/*": ["baz/*", "yo/*"], - "@/components/*": ["components/*"] - } - } - }) - .to_string(); - let tsconfig = TsConfig::parse(true, path, &mut tsconfig_json).unwrap(); - - let data = [ - ("test", vec!["/foo/src/generated/test", "/foo/src/test"]), - ("test/hello", vec!["/foo/src/generated/test/hello", "/foo/src/test/hello"]), - ("bar/hi", vec!["/foo/src/test/hi", "/foo/src/bar/hi"]), - ("bar/baz/hi", vec!["/foo/src/baz/hi", "/foo/src/yo/hi", "/foo/src/bar/baz/hi"]), - ("@/components/button", vec!["/foo/src/components/button", "/foo/src/@/components/button"]), - ("./jquery", vec![]), - ]; - - for (specifier, expected) in data { - let paths = tsconfig.resolve_path_alias(specifier); - let expected = expected.into_iter().map(PathBuf::from).collect::>(); - assert_eq!(paths, expected, "{specifier}"); - } -} - -// Template variable ${configDir} for substitution of config files directory path -// https://github.com/microsoft/TypeScript/pull/58042 -#[test] -fn test_template_variable() { - let f = super::fixture_root().join("tsconfig"); - let f2 = f.join("cases").join("paths_template_variable"); - - #[rustfmt::skip] - let pass = [ - (f2.clone(), "tsconfig1.json", "foo", f2.join("foo.js")), - (f2.clone(), "tsconfig2.json", "foo", f2.join("foo.js")), - (f.clone(), "tsconfig_template_variable.json", "foo", f.join("foo.js")), - ]; - - for (dir, tsconfig, request, expected) in pass { - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: dir.join(tsconfig), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&dir, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{request} {tsconfig} {dir:?}"); - } -} - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows_test { - use std::path::{Path, PathBuf}; - - use crate::{ - ResolveError, ResolveOptions, ResolverGeneric, TsconfigOptions, TsconfigReferences, - }; - - use super::super::memory_fs::MemoryFS; - - struct OneTest { - name: &'static str, - tsconfig: String, - package_json: Option<(PathBuf, String)>, - main_fields: Option>, - existing_files: Vec<&'static str>, - requested_module: &'static str, - expected_path: &'static str, - extensions: Vec, - } - - impl Default for OneTest { - fn default() -> Self { - Self { - name: "", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/*": ["location/*"] - } - } - }) - .to_string(), - package_json: None, - main_fields: None, - existing_files: vec![], - requested_module: "", - expected_path: "", - extensions: vec![ - ".js".into(), - ".json".into(), - ".node".into(), - ".ts".into(), - ".tsx".into(), - ], - } - } - } - - impl OneTest { - fn resolver(&self, root: &Path) -> ResolverGeneric { - let mut file_system = MemoryFS::default(); - - file_system.add_file(&root.join("tsconfig.json"), &self.tsconfig); - if let Some((path, package_json)) = &self.package_json { - file_system.add_file(&root.join(path).join("package.json"), package_json); - } - for path in &self.existing_files { - file_system.add_file(Path::new(path), ""); - } - - let mut options = ResolveOptions { - extensions: self.extensions.clone(), - tsconfig: Some(TsconfigOptions { - config_file: root.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }; - if let Some(main_fields) = &self.main_fields { - options.main_fields.clone_from(main_fields); - } - - ResolverGeneric::::new_with_file_system(file_system, options) - } - } - - // Path matching tests from tsconfig-paths - // * - // * - #[test] - fn match_path() { - let pass = [ - OneTest { - name: "should locate path that matches with star and exists", - existing_files: vec!["/root/location/mylib/index.ts"], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve to correct path when many are specified", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/*": ["foo1/*", "foo2/*", "location/*", "foo3/*"], - } - } - }) - .to_string(), - existing_files: vec!["/root/location/mylib/index.ts"], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should locate path that matches with star and prioritize pattern with longest prefix", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "*": ["location/*"], - "lib/*": ["location/*"], - } - } - }) - .to_string(), - existing_files: vec![ - "/root/location/lib/mylib/index.ts", - "/root/location/mylib/index.ts", - ], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should locate path that matches with star and exists with extension", - existing_files: vec![ - "/root/location/mylib.myext", - ], - requested_module: "lib/mylib", - extensions: vec![".js".into(), ".myext".into()], - expected_path: "/root/location/mylib.myext", - ..OneTest::default() - }, - OneTest { - name: "should resolve request with extension specified", - existing_files: vec![ - "/root/location/test.jpg", - ], - requested_module: "lib/test.jpg", - expected_path: "/root/location/test.jpg", - ..OneTest::default() - }, - OneTest { - name: "should locate path that matches without star and exists", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/foo": ["location/foo"] - } - } - }) - .to_string(), - existing_files: vec![ - "/root/location/foo.ts", - ], - requested_module: "lib/foo", - expected_path: "/root/location/foo.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve to parent folder when filename is in subfolder", - existing_files: vec![ - "/root/location/mylib/index.ts", - ], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve from main field in package.json", - package_json: Some((PathBuf::from("/root/location/mylib"), serde_json::json!({ - "main": "./kalle.ts" - }).to_string())), - existing_files: vec![ - "/root/location/mylib/kalle.ts", - ], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/kalle.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve from main field in package.json (js)", - package_json: Some((PathBuf::from("/root/location/mylib.js"), serde_json::json!({ - "main": "./kalle.js" - }).to_string())), - existing_files: vec![ - "/root/location/mylib.js/kalle.js", - ], - extensions: vec![".ts".into(), ".js".into()], - requested_module: "lib/mylib.js", - expected_path: "/root/location/mylib.js/kalle.js", - ..OneTest::default() - }, - OneTest { - name: "should resolve from list of fields by priority in package.json", - main_fields: Some(vec!["missing".into(), "browser".into(), "main".into()]), - package_json: Some((PathBuf::from("/root/location/mylibjs"), serde_json::json!({ - "main": "./main.js", - "browser": "./browser.js" - }).to_string())), - existing_files: vec![ - "/root/location/mylibjs/main.js", - "/root/location/mylibjs/browser.js", - ], - extensions: vec![".ts".into(), ".js".into()], - requested_module: "lib/mylibjs", - expected_path: "/root/location/mylibjs/browser.js", - ..OneTest::default() - }, -OneTest { - name: "should ignore field mappings to missing files in package.json", - main_fields: Some(vec!["browser".into(), "main".into()]), - package_json: Some((PathBuf::from("/root/location/mylibjs"), serde_json::json!({ - "main": "./kalle.js", - "browser": "./nope.js" - }).to_string())), - existing_files: vec![ - "/root/location/mylibjs/kalle.js", - ], - extensions: vec![".ts".into(), ".js".into()], - requested_module: "lib/mylibjs", - expected_path: "/root/location/mylibjs/kalle.js", - ..OneTest::default() - }, - // Tests that are not applicable: - // name: "should resolve nested main fields" - // name: "should ignore advanced field mappings in package.json" - // name: "should resolve to with the help of baseUrl when not explicitly set" - // name: "should not resolve with the help of baseUrl when asked not to" - // name: "should resolve main file with cjs file extension" - OneTest { - name: "should resolve .ts from .js alias", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "@/*": ["src/*"] - } - } - }).to_string(), - existing_files: vec![ - "/root/src/foo.ts", - ], - requested_module: "@/foo", // original data was "@/foo.ts" but I don't get why it is the case? - expected_path: "/root/src/foo.ts", // original data was "/root/src/foo" - ..OneTest::default() - }, - ]; - - let root = PathBuf::from("/root"); - - for test in pass { - let resolved_path = - test.resolver(&root).resolve(&root, test.requested_module).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(PathBuf::from(test.expected_path)), "{}", test.name); - } - - let fail = [ - OneTest { - name: "should not locate path that does not match", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/*": ["location/*"] - } - } - }) - .to_string(), - existing_files: vec!["/root/location/mylib"], - requested_module: "lib/mylibjs", - ..OneTest::default() - }, - OneTest { - name: "should not resolve typings file (index.d.ts)", - existing_files: vec!["/root/location/mylib/index.d.ts"], - requested_module: "lib/mylib", - ..OneTest::default() - }, - ]; - - for test in fail { - let resolved_path = - test.resolver(&root).resolve(&root, test.requested_module).map(|f| f.full_path()); - assert_eq!( - resolved_path, - Err(ResolveError::NotFound(test.requested_module.into())), - "{}", - test.name - ); - } - } -} diff --git a/src/tests/tsconfig_project_references.rs b/src/tests/tsconfig_project_references.rs deleted file mode 100644 index 0d019d27..00000000 --- a/src/tests/tsconfig_project_references.rs +++ /dev/null @@ -1,132 +0,0 @@ -//! Tests for tsconfig project references - -use crate::{ResolveError, ResolveOptions, Resolver, TsconfigOptions, TsconfigReferences}; - -#[test] -fn auto() { - let f = super::fixture_root().join("tsconfig/cases/project_references"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("app"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - // Test normal paths alias - (f.join("app"), "@/index.ts", f.join("app/aliased/index.ts")), - (f.join("app"), "@/../index.ts", f.join("app/index.ts")), - // Test project reference - (f.join("project_a"), "@/index.ts", f.join("project_a/aliased/index.ts")), - (f.join("project_b/src"), "@/index.ts", f.join("project_b/src/aliased/index.ts")), - // Does not have paths alias - (f.join("project_a"), "./index.ts", f.join("project_a/index.ts")), - (f.join("project_c"), "./index.ts", f.join("project_c/index.ts")), - // Template variable - { - let dir = f.parent().unwrap().join("paths_template_variable"); - (dir.clone(), "foo", dir.join("foo.js")) - } - ]; - - for (path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{request} {path:?}"); - } -} - -#[test] -fn disabled() { - let f = super::fixture_root().join("tsconfig/cases/project_references"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("app"), - references: TsconfigReferences::Disabled, - }), - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - // Test normal paths alias - (f.join("app"), "@/index.ts", Ok(f.join("app/aliased/index.ts"))), - (f.join("app"), "@/../index.ts", Ok(f.join("app/index.ts"))), - // Test project reference - (f.join("project_a"), "@/index.ts", Err(ResolveError::NotFound("@/index.ts".into()))), - (f.join("project_b/src"), "@/index.ts", Err(ResolveError::NotFound("@/index.ts".into()))), - // Does not have paths alias - (f.join("project_a"), "./index.ts", Ok(f.join("project_a/index.ts"))), - (f.join("project_c"), "./index.ts", Ok(f.join("project_c/index.ts"))), - ]; - - for (path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, expected, "{request} {path:?}"); - } -} - -#[test] -fn manual() { - let f = super::fixture_root().join("tsconfig/cases/project_references"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("app"), - references: TsconfigReferences::Paths(vec!["../project_a/conf.json".into()]), - }), - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - // Test normal paths alias - (f.join("app"), "@/index.ts", Ok(f.join("app/aliased/index.ts"))), - (f.join("app"), "@/../index.ts", Ok(f.join("app/index.ts"))), - // Test project reference - (f.join("project_a"), "@/index.ts", Ok(f.join("project_a/aliased/index.ts"))), - (f.join("project_b/src"), "@/index.ts", Err(ResolveError::NotFound("@/index.ts".into()))), - // Does not have paths alias - (f.join("project_a"), "./index.ts", Ok(f.join("project_a/index.ts"))), - (f.join("project_c"), "./index.ts", Ok(f.join("project_c/index.ts"))), - ]; - - for (path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, expected, "{request} {path:?}"); - } -} - -#[test] -fn self_reference() { - let f = super::fixture_root().join("tsconfig/cases/project_references"); - - #[rustfmt::skip] - let pass = [ - (f.join("app"), vec!["./tsconfig.json".into()]), - (f.join("app/tsconfig.json"), vec!["./tsconfig.json".into()]), - (f.join("app"), vec![f.join("app")]), - (f.join("app/tsconfig.json"), vec![f.join("app")]), - (f.join("app/tsconfig.json"), vec![f.join("project_b"), f.join("app")]), - ]; - - for (config_file, reference_paths) in pass { - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: config_file.clone(), - references: TsconfigReferences::Paths(reference_paths.clone()), - }), - ..ResolveOptions::default() - }); - let path = f.join("app"); - let resolved_path = resolver.resolve(&path, "@/index.ts").map(|f| f.full_path()); - assert_eq!( - resolved_path, - Err(ResolveError::TsconfigSelfReference(f.join("app/tsconfig.json"))), - "{config_file:?} {reference_paths:?}" - ); - } -} diff --git a/tests/integration_test.rs b/tests/integration_test.rs deleted file mode 100644 index 0fc52887..00000000 --- a/tests/integration_test.rs +++ /dev/null @@ -1,103 +0,0 @@ -//! Test public APIs - -use std::{env, path::PathBuf}; - -use oxc_resolver::{EnforceExtension, Resolution, ResolveContext, ResolveOptions, Resolver}; - -fn dir() -> PathBuf { - env::current_dir().unwrap() -} - -fn resolve(specifier: &str) -> Resolution { - let path = dir(); - Resolver::new(ResolveOptions::default()).resolve(path, specifier).unwrap() -} - -#[test] -fn clone() { - let resolution = resolve("./tests/package.json"); - assert_eq!(resolution.clone(), resolution); -} - -#[test] -fn debug() { - let resolution = resolve("./tests/package.json"); - let s = format!("{resolution:?}"); - assert!(!s.is_empty()); -} - -#[test] -fn eq() { - let resolution = resolve("./tests/package.json"); - assert_eq!(resolution, resolution); -} - -#[test] -fn package_json() { - let resolution = resolve("./tests/package.json"); - let package_json = resolution.package_json().unwrap(); - assert_eq!(package_json.name.as_ref().unwrap(), "name"); - assert_eq!(package_json.r#type.as_ref().unwrap().as_str(), "module".into()); - assert!(package_json.side_effects.as_ref().unwrap().is_object()); -} - -#[cfg(feature = "package_json_raw_json_api")] -#[test] -fn package_json_raw_json_api() { - let resolution = resolve("./tests/package.json"); - assert!(resolution - .package_json() - .unwrap() - .raw_json() - .get("name") - .is_some_and(|name| name == "name")); -} - -#[test] -fn clear_cache() { - let resolver = Resolver::new(ResolveOptions::default()); - resolver.clear_cache(); // exists -} - -#[test] -fn options() { - let resolver = Resolver::new(ResolveOptions::default()); - let options = resolver.options(); - assert!(!format!("{options:?}").is_empty()); -} - -#[test] -fn debug_resolver() { - let resolver = Resolver::new(ResolveOptions::default()); - assert!(!format!("{resolver:?}").is_empty()); -} - -#[test] -fn dependencies() { - let path = dir(); - let mut ctx = ResolveContext::default(); - let _ = Resolver::new(ResolveOptions::default()).resolve_with_context( - path, - "./tests/package.json", - &mut ctx, - ); - assert!(!ctx.file_dependencies.is_empty()); - assert!(ctx.missing_dependencies.is_empty()); -} - -#[test] -fn options_api() { - _ = ResolveOptions::default() - .with_builtin_modules(true) - .with_condition_names(&[]) - .with_extension(".js") - .with_force_extension(EnforceExtension::Auto) - .with_fully_specified(true) - .with_main_field("asdf") - .with_main_file("main") - .with_module("module") - .with_prefer_absolute(true) - .with_prefer_relative(true) - .with_root(PathBuf::new()) - .with_symbolic_link(true); -} diff --git a/tests/package.json b/tests/package.json deleted file mode 100644 index 54f58b8c..00000000 --- a/tests/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "name", - "type": "module", - "sideEffects": {} -} diff --git a/tests/resolve_test.rs b/tests/resolve_test.rs deleted file mode 100644 index 45934cf8..00000000 --- a/tests/resolve_test.rs +++ /dev/null @@ -1,132 +0,0 @@ -use std::{env, path::PathBuf}; - -use oxc_resolver::{ResolveError, ResolveOptions, Resolver}; - -fn dir() -> PathBuf { - env::current_dir().unwrap() -} - -#[test] -fn chinese() { - let dir = dir(); - let specifier = "./fixtures/misc/中文/中文.js"; - let resolution = Resolver::new(ResolveOptions::default()).resolve(&dir, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(dir.join("fixtures/misc/中文/中文.js")) - ); -} - -#[test] -fn styled_components() { - let dir = dir(); - let path = dir.join("fixtures/pnpm"); - let module_path = dir.join("node_modules/.pnpm/styled-components@6.1.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/styled-components"); - let specifier = "styled-components"; - - // cjs - let options = - ResolveOptions { alias_fields: vec![vec!["browser".into()]], ..ResolveOptions::default() }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/styled-components.browser.cjs.js")) - ); - - // esm - let options = ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - main_fields: vec!["module".into()], - ..ResolveOptions::default() - }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/styled-components.browser.esm.js")) - ); -} - -#[test] -fn axios() { - let dir = dir(); - let path = dir.join("fixtures/pnpm"); - let module_path = dir.join("node_modules/.pnpm/axios@1.6.2/node_modules/axios"); - let specifier = "axios"; - - // default - let options = ResolveOptions::default(); - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("index.js")) - ); - - // browser - let options = ResolveOptions { - condition_names: vec!["browser".into(), "require".into()], - ..ResolveOptions::default() - }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/browser/axios.cjs")) - ); - - // cjs - let options = ResolveOptions { - condition_names: vec!["node".into(), "require".into()], - ..ResolveOptions::default() - }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/node/axios.cjs")) - ); -} - -#[test] -fn postcss() { - let dir = dir(); - let path = dir.join("fixtures/pnpm"); - let module_path = path.join("node_modules/postcss"); - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - // should ignore "path" - let resolution = resolver.resolve(&module_path, "path"); - assert_eq!(resolution, Err(ResolveError::Ignored(module_path.clone()))); - - // should ignore "./lib/terminal-highlight" - let resolution = resolver.resolve(&module_path, "./lib/terminal-highlight"); - assert_eq!(resolution, Err(ResolveError::Ignored(module_path.join("lib/terminal-highlight")))); -} - -#[test] -fn ipaddr_js() { - let dir = dir(); - let path = dir.join("fixtures/pnpm"); - let module_path = - dir.join("node_modules/.pnpm/ipaddr.js@2.2.0/node_modules/ipaddr.js/lib/ipaddr.js"); - - let resolvers = [ - // with `extension_alias` - Resolver::new(ResolveOptions { - extension_alias: vec![(".js".into(), vec![".js".into(), ".ts".into(), ".tsx".into()])], - ..ResolveOptions::default() - }), - // with `extensions` should still resolve to module main - Resolver::new(ResolveOptions { - extensions: vec![(".ts".into())], - ..ResolveOptions::default() - }), - // default - Resolver::default(), - ]; - - for resolver in resolvers { - let resolution = resolver.resolve(&path, "ipaddr.js").map(|r| r.full_path()); - assert_eq!(resolution, Ok(module_path.clone())); - } -} From 40d3bb1d1cd9d9b32e5b92da9fc5b5294c77d530 Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Thu, 12 Sep 2024 14:18:39 +0300 Subject: [PATCH 79/82] --- .github/CODE_OF_CONDUCT.md | 127 - .github/SECURITY.md | 7 - .github/actions/pnpm/action.yml | 26 - .github/codecov.yml | 14 - .github/renovate.json | 5 - .github/workflows/benchmark.yml | 41 - .github/workflows/ci.yml | 196 - .github/workflows/codecov.yml | 69 - .github/workflows/release-napi.yml | 252 - .github/workflows/release-plz.yml | 55 - Cargo.lock | 1326 --- fixtures/enhanced_resolve/lib/index.js | 1 - fixtures/enhanced_resolve/package.json | 4 - fixtures/enhanced_resolve/test/.gitignore | 3 - .../enhanced_resolve/test/fixtures/#/a.js | 0 fixtures/enhanced_resolve/test/fixtures/a.js | 3 - .../enhanced_resolve/test/fixtures/abc.txt | 1 - .../test/fixtures/alias/files/a.js | 0 fixtures/enhanced_resolve/test/fixtures/b.js | 3 - .../browser-module/browser/module-a.js | 0 .../fixtures/browser-module/lib/browser.js | 0 .../fixtures/browser-module/lib/ignore.js | 0 .../test/fixtures/browser-module/lib/main.js | 0 .../fixtures/browser-module/lib/replaced.js | 0 .../test/fixtures/browser-module/lib/self.js | 0 .../fixtures/browser-module/lib/toString.js | 0 .../browser-module/node_modules/module-a.js | 0 .../browser-module/node_modules/module-b.js | 0 .../browser-module/node_modules/module-c.js | 0 .../node_modules/recursive-file/a.js | 0 .../node_modules/recursive-file/b.js | 0 .../node_modules/recursive-file/c.js | 0 .../node_modules/recursive-file/d.js | 0 .../node_modules/recursive-file/package.json | 8 - .../test/fixtures/browser-module/package.json | 33 - .../test/fixtures/builtins/package.json | 12 - fixtures/enhanced_resolve/test/fixtures/c.js | 4 - .../enhanced_resolve/test/fixtures/complex.js | 13 - .../test/fixtures/crypto-js/index.js | 0 .../test/fixtures/crypto-js/package.json | 7 - .../test/fixtures/decorated-fs/exists.js | 0 .../test/fixtures/dirOrFile.js | 1 - .../test/fixtures/dirOrFile/index.js | 1 - .../directory-default/directory-default.js | 0 .../node_modules/@org/pkg/dist/string.js | 1 - .../@org/pkg/dist/string.test.d.ts | 1 - .../node_modules/@org/pkg/package.json | 9 - .../node_modules/pkg/dist/string.js | 1 - .../node_modules/pkg/dist/string.test.d.ts | 1 - .../node_modules/pkg/package.json | 9 - .../node_modules/exports-field/package.json | 7 - .../node_modules/pack1/index.js | 0 .../test/fixtures/exports-field/a.js | 1 - .../node_modules/exports-field/lib/browser.js | 1 - .../node_modules/exports-field/lib/index.js | 0 .../exports-field/lib/lib2/main.js | 1 - .../node_modules/exports-field/lib/main.js | 1 - .../node_modules/exports-field/main.js | 1 - .../node_modules/exports-field/package.json | 18 - .../node_modules/exports-field/x.js | 1 - .../invalid-exports-field/index.js | 0 .../invalid-exports-field/package.json | 13 - .../node_modules/invalid-exports-field/umd.js | 0 .../test/fixtures/exports-field/package.json | 5 - .../node_modules/exports-field/index.js | 1 - .../node_modules/exports-field/lib/browser.js | 1 - .../exports-field/lib/lib2/main.js | 1 - .../node_modules/exports-field/lib/main.js | 1 - .../node_modules/exports-field/main.js | 1 - .../node_modules/exports-field/package.json | 17 - .../node_modules/exports-field/index | 0 .../node_modules/exports-field/main.js | 1 - .../node_modules/exports-field/package.json | 10 - .../node_modules/exports-field/src/index.js | 0 .../fixtures/extension-alias/dir/index.js | 0 .../fixtures/extension-alias/dir/index.ts | 0 .../fixtures/extension-alias/dir2/index.js | 0 .../fixtures/extension-alias/dir2/index.mts | 0 .../test/fixtures/extension-alias/index.js | 0 .../test/fixtures/extension-alias/index.mjs | 0 .../fixtures/extension-alias/index.mts.js | 0 .../test/fixtures/extension-alias/index.ts | 0 .../test/fixtures/extensions/app.module.js | 0 .../test/fixtures/extensions/dir/index.js | 0 .../test/fixtures/extensions/dir/index.ts | 0 .../test/fixtures/extensions/foo.js | 0 .../test/fixtures/extensions/foo.ts | 0 .../test/fixtures/extensions/index.js | 0 .../test/fixtures/extensions/index.ts | 0 .../extensions/node_modules/module.js | 0 .../extensions/node_modules/module/index.ts | 0 .../test/fixtures/extensions/package.json | 3 - .../enhanced_resolve/test/fixtures/file.load1 | 0 .../enhanced_resolve/test/fixtures/file.load2 | 0 .../test/fixtures/foo/index.js | 0 .../test/fixtures/foo/package.json | 4 - .../node_modules/m/package.json | 17 - .../node_modules/m/src/features/f.js | 0 .../m/src/features/internal/file.js | 0 .../node_modules/m/src/features/y/y.js | 0 .../node_modules/m/src/internal/i.js | 0 .../node_modules/m/src/middle-1/f.js | 0 .../node_modules/m/src/middle-1/nested/f.js | 0 .../node_modules/m/src/middle-2/nested/f.js | 1 - .../m/src/middle-3/nested/f/nested/f.js | 0 .../node_modules/m/src/middle-4/f/f.js | 0 .../node_modules/m/src/middle-5/f$/$.js | 0 .../node_modules/m/src/middle-5/f/$.js | 0 .../node_modules/m/src/middle/f.js | 0 .../node_modules/m/src/middle/nested/f.js | 0 .../test/fixtures/imports-field/a.js | 1 - .../test/fixtures/imports-field/b.js | 0 .../test/fixtures/imports-field/dir/b.js | 0 .../node_modules/a/lib/browser.js | 1 - .../imports-field/node_modules/a/lib/index.js | 0 .../node_modules/a/lib/lib2/main.js | 1 - .../imports-field/node_modules/a/lib/main.js | 1 - .../imports-field/node_modules/a/main.js | 1 - .../imports-field/node_modules/a/package.json | 18 - .../imports-field/node_modules/a/x.js | 1 - .../imports-field/node_modules/c/index.js | 0 .../test/fixtures/imports-field/package.json | 17 - .../fixtures/incorrect-package/pack1/a.js | 0 .../incorrect-package/pack1/package.json | 2 - .../fixtures/incorrect-package/pack2/a.js | 0 .../incorrect-package/pack2/package.json | 0 .../test/fixtures/issue-238/package.json | 3 - .../test/fixtures/issue-238/src/a/config.js | 0 .../src/common/config/myObjectFile.js | 0 .../enhanced_resolve/test/fixtures/lib.js | 0 .../test/fixtures/lib/complex1.js | 1 - .../test/fixtures/main-field-self/index.js | 0 .../fixtures/main-field-self/package.json | 3 - .../test/fixtures/main-field-self2/index.js | 0 .../fixtures/main-field-self2/package.json | 3 - .../enhanced_resolve/test/fixtures/main1.js | 9 - .../enhanced_resolve/test/fixtures/main2.js | 12 - .../enhanced_resolve/test/fixtures/main3.js | 4 - .../multiple_modules/node_modules/m1/a.js | 3 - .../test/fixtures/no#fragment/#/#.js | 0 fixtures/enhanced_resolve/test/fixtures/no.js | 0 .../browser-module-broken/browser.js | 0 .../browser-module-broken/main.js | 0 .../browser-module-broken/package.json | 4 - .../complexm/node_modules/m1/a.js | 1 - .../complexm/node_modules/m1/index.js | 1 - .../fixtures/node_modules/complexm/step1.js | 1 - .../fixtures/node_modules/complexm/step2.js | 1 - .../fixtures/node_modules/dash-name/index.js | 0 .../node_modules/dash-name/package.json | 4 - .../test/fixtures/node_modules/dash/index.js | 0 .../fixtures/node_modules/dash/package.json | 4 - .../invalidPackageJson/package.json | 0 .../test/fixtures/node_modules/m1/a.js | 3 - .../test/fixtures/node_modules/m1/b.js | 3 - .../test/fixtures/node_modules/m2/b.js | 1 - .../node_modules/recursive-module/file.js | 0 .../node_modules/recursive-module/index.js | 0 .../test/fixtures/pnp-a/m2/a.js | 3 - .../test/fixtures/pnp/pkg/dir/index.js | 0 .../test/fixtures/pnp/pkg/index.js | 0 .../test/fixtures/pnp/pkg/main.js | 0 .../fixtures/pnp/pkg/package-alias/browser.js | 0 .../fixtures/pnp/pkg/package-alias/index.js | 0 .../test/fixtures/pnp/pkg/package.json | 7 - .../test/fixtures/pnp/pkg/typescript/index.ts | 0 .../test/fixtures/pnp/pkg3/a.js | 1 - .../test/fixtures/pnp/pkg3/package.json | 8 - .../prefer-pnp/alternative-modules/m1/b.js | 0 .../restrictions/node_modules/pck1/index.css | 0 .../restrictions/node_modules/pck1/index.js | 0 .../node_modules/pck1/package.json | 3 - .../restrictions/node_modules/pck2/index.css | 0 .../restrictions/node_modules/pck2/module.js | 0 .../node_modules/pck2/package.json | 5 - .../test/fixtures/roots_fall_through/index.js | 0 .../scoped/node_modules/@scope/pack1/main.js | 0 .../node_modules/@scope/pack1/package.json | 5 - .../node_modules/@scope/pack2/lib/index.js | 0 .../scoped/node_modules/@scope/pack2/main.js | 0 .../node_modules/@scope/pack2/package.json | 3 - .../test/fixtures/shortcutdir.js/a.js | 0 .../test/fixtures/yield/a/foo-2/b | 0 .../test/fixtures/yield/a/foo-2/c | 0 .../test/fixtures/yield/a/foo/a | 0 .../test/fixtures/yield/a/foo/b | 0 .../test/fixtures/yield/b/foo/a | 0 .../test/fixtures/yield/c/foo/a | 0 .../test/fixtures/yield/c/foo/package.json | 7 - .../fixtures/\346\265\213\350\257\225.js" | 0 .../\344\270\255\346\226\207.js" | 0 fixtures/pnp/.gitignore | 1 - fixtures/pnp/.pnp.cjs | 7543 ----------------- fixtures/pnp/.yarnrc.yml | 1 - fixtures/pnp/package.json | 8 - fixtures/pnp/yarn.lock | 74 - fixtures/pnpm/.gitignore | 1 - fixtures/pnpm/package.json | 11 - fixtures/pnpm/pnpm-lock.yaml | 212 - fixtures/tsconfig/cases/builtins/thing.js | 0 .../tsconfig/cases/builtins/tsconfig.json | 5 - fixtures/tsconfig/cases/exports/index.js | 0 fixtures/tsconfig/cases/exports/tsconfig.json | 3 - .../extends-extension/base-tsconfig.json | 7 - .../tsconfig/cases/extends-extension/foo.js | 0 .../cases/extends-extension/tsconfig.json | 3 - .../cases/extends-extensionless/foo.js | 0 .../cases/extends-extensionless/tsconfig.json | 3 - .../tsconfig/cases/extends-multiple/foo.js | 0 .../cases/extends-multiple/tsconfig.json | 6 - .../tsconfig/cases/extends-not-found/index.js | 0 .../cases/extends-not-found/tsconfig.json | 3 - .../tsconfig/cases/extends-paths/src/index.js | 0 .../cases/extends-paths/tsconfig.base.json | 7 - .../cases/extends-paths/tsconfig.json | 6 - fixtures/tsconfig/cases/field/index.js | 0 fixtures/tsconfig/cases/field/tsconfig.json | 3 - fixtures/tsconfig/cases/index/index.js | 0 fixtures/tsconfig/cases/index/tsconfig.json | 3 - .../cases/paths_template_variable/foo.js | 0 .../paths_template_variable/tsconfig1.json | 3 - .../paths_template_variable/tsconfig2.json | 8 - .../project_references/app/aliased/index.ts | 0 .../cases/project_references/app/index.ts | 0 .../project_references/app/tsconfig.json | 23 - .../project_a/aliased/index.ts | 0 .../project_references/project_a/conf.json | 8 - .../project_references/project_a/index.ts | 0 .../project_b/src/aliased/index.ts | 0 .../project_b/tsconfig.json | 9 - .../project_references/project_c/index.ts | 0 .../project_c/tsconfig.json | 5 - .../project_references/tsconfig.base.json | 4 - fixtures/tsconfig/cases/suffixes/a.ios.ts | 0 fixtures/tsconfig/cases/suffixes/a.ts | 0 fixtures/tsconfig/cases/suffixes/b.ts | 0 fixtures/tsconfig/cases/suffixes/c-test.ts | 0 fixtures/tsconfig/cases/suffixes/index.ts | 1 - .../tsconfig/cases/suffixes/tsconfig.json | 5 - fixtures/tsconfig/cases/trailing-comma/bar.js | 0 .../tsconfig/cases/trailing-comma/index.js | 0 .../cases/trailing-comma/tsconfig.json | 9 - fixtures/tsconfig/foo.js | 0 fixtures/tsconfig/nested/index.js | 0 fixtures/tsconfig/nested/test.js | 0 fixtures/tsconfig/nested/tsconfig.json | 8 - .../node_modules/tsconfig-exports/conf.json | 7 - .../node_modules/tsconfig-exports/foo.js | 0 .../tsconfig-exports/package.json | 7 - .../node_modules/tsconfig-field/conf.json | 7 - .../node_modules/tsconfig-field/foo.js | 0 .../node_modules/tsconfig-field/package.json | 5 - .../node_modules/tsconfig-index/foo.js | 0 .../node_modules/tsconfig-index/package.json | 4 - .../node_modules/tsconfig-index/tsconfig.json | 7 - .../node_modules/tsconfig-not-used/foo.js | 0 .../tsconfig-not-used/tsconfig.json | 7 - fixtures/tsconfig/package.json | 24 - fixtures/tsconfig/tsconfig.json | 7 - fixtures/tsconfig/tsconfig_broken.json | 1 - .../tsconfig/tsconfig_template_variable.json | 7 - napi/__test__/resolver.spec.mjs | 260 - napi/src/lib.rs | 214 - napi/src/options.rs | 261 - napi/src/tracing.rs | 25 - napi/tests/options.test.mjs | 59 - npm/package.json | 79 +- package.json | 53 +- pnpm-lock.yaml | 2598 ------ src/builtins.rs | 71 - src/cache.rs | 354 - src/context.rs | 89 - src/error.rs | 182 - src/file_system.rs | 220 - src/lib.rs | 1755 ---- src/options.rs | 633 -- src/package_json.rs | 219 - src/path.rs | 132 - src/resolution.rs | 92 - src/specifier.rs | 230 - src/tests/alias.rs | 283 - src/tests/browser_field.rs | 189 - src/tests/builtins.rs | 121 - src/tests/dependencies.rs | 110 - src/tests/exports_field.rs | 2546 ------ src/tests/extension_alias.rs | 70 - src/tests/extensions.rs | 125 - src/tests/fallback.rs | 100 - src/tests/full_specified.rs | 113 - src/tests/imports_field.rs | 1320 --- src/tests/incorrect_description_file.rs | 65 - src/tests/main_field.rs | 24 - src/tests/memory_fs.rs | 74 - src/tests/missing.rs | 106 - src/tests/mod.rs | 51 - src/tests/pnp.rs | 45 - src/tests/resolve.rs | 119 - src/tests/restrictions.rs | 25 - src/tests/roots.rs | 92 - src/tests/scoped_packages.rs | 25 - src/tests/simple.rs | 68 - src/tests/symlink.rs | 121 - src/tests/tsconfig_paths.rs | 530 -- src/tests/tsconfig_project_references.rs | 132 - src/tsconfig.rs | 223 - tests/integration_test.rs | 103 - tests/package.json | 5 - tests/resolve_test.rs | 132 - 308 files changed, 56 insertions(+), 24940 deletions(-) delete mode 100644 .github/CODE_OF_CONDUCT.md delete mode 100644 .github/SECURITY.md delete mode 100644 .github/actions/pnpm/action.yml delete mode 100644 .github/codecov.yml delete mode 100644 .github/renovate.json delete mode 100644 .github/workflows/benchmark.yml delete mode 100644 .github/workflows/ci.yml delete mode 100644 .github/workflows/codecov.yml delete mode 100644 .github/workflows/release-napi.yml delete mode 100644 .github/workflows/release-plz.yml delete mode 100644 Cargo.lock delete mode 100644 fixtures/enhanced_resolve/lib/index.js delete mode 100644 fixtures/enhanced_resolve/package.json delete mode 100644 fixtures/enhanced_resolve/test/.gitignore delete mode 100644 fixtures/enhanced_resolve/test/fixtures/#/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/abc.txt delete mode 100644 fixtures/enhanced_resolve/test/fixtures/alias/files/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/browser/module-a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/ignore.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/replaced.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/self.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/toString.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-c.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/c.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/d.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/builtins/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/c.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/complex.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/crypto-js/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/decorated-fs/exists.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/dirOrFile.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/directory-default/directory-default.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/pack1/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/umd.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/index delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/src/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.mts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mjs delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mts.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/app.module.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/foo.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/foo.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/file.load1 delete mode 100644 fixtures/enhanced_resolve/test/fixtures/file.load2 delete mode 100644 fixtures/enhanced_resolve/test/fixtures/foo/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/foo/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/internal/file.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/y/y.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/internal/i.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-3/nested/f/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-4/f/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f$/$.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f/$.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/dir/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/c/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/issue-238/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/issue-238/src/a/config.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/issue-238/src/common/config/myObjectFile.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/lib.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/lib/complex1.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self2/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main1.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main2.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main3.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/no#fragment/#/#.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/no.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/invalidPackageJson/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/file.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/dir/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/typescript/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/prefer-pnp/alternative-modules/m1/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.css delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/index.css delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/module.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/roots_fall_through/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/lib/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/shortcutdir.js/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/b delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/c delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo/a delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo/b delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/b/foo/a delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/c/foo/a delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json delete mode 100644 "fixtures/enhanced_resolve/test/fixtures/\346\265\213\350\257\225.js" delete mode 100644 "fixtures/misc/\344\270\255\346\226\207/\344\270\255\346\226\207.js" delete mode 100644 fixtures/pnp/.gitignore delete mode 100755 fixtures/pnp/.pnp.cjs delete mode 100644 fixtures/pnp/.yarnrc.yml delete mode 100644 fixtures/pnp/package.json delete mode 100644 fixtures/pnp/yarn.lock delete mode 100644 fixtures/pnpm/.gitignore delete mode 100644 fixtures/pnpm/package.json delete mode 100644 fixtures/pnpm/pnpm-lock.yaml delete mode 100644 fixtures/tsconfig/cases/builtins/thing.js delete mode 100644 fixtures/tsconfig/cases/builtins/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/exports/index.js delete mode 100644 fixtures/tsconfig/cases/exports/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-extension/base-tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-extension/foo.js delete mode 100644 fixtures/tsconfig/cases/extends-extension/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-extensionless/foo.js delete mode 100644 fixtures/tsconfig/cases/extends-extensionless/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-multiple/foo.js delete mode 100644 fixtures/tsconfig/cases/extends-multiple/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-not-found/index.js delete mode 100644 fixtures/tsconfig/cases/extends-not-found/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-paths/src/index.js delete mode 100644 fixtures/tsconfig/cases/extends-paths/tsconfig.base.json delete mode 100644 fixtures/tsconfig/cases/extends-paths/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/field/index.js delete mode 100644 fixtures/tsconfig/cases/field/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/index/index.js delete mode 100644 fixtures/tsconfig/cases/index/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/paths_template_variable/foo.js delete mode 100644 fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json delete mode 100644 fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json delete mode 100644 fixtures/tsconfig/cases/project_references/app/aliased/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/app/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/app/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/project_references/project_a/aliased/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_a/conf.json delete mode 100644 fixtures/tsconfig/cases/project_references/project_a/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_b/src/aliased/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_b/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/project_references/project_c/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_c/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/project_references/tsconfig.base.json delete mode 100644 fixtures/tsconfig/cases/suffixes/a.ios.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/a.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/b.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/c-test.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/index.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/trailing-comma/bar.js delete mode 100644 fixtures/tsconfig/cases/trailing-comma/index.js delete mode 100644 fixtures/tsconfig/cases/trailing-comma/tsconfig.json delete mode 100644 fixtures/tsconfig/foo.js delete mode 100644 fixtures/tsconfig/nested/index.js delete mode 100644 fixtures/tsconfig/nested/test.js delete mode 100644 fixtures/tsconfig/nested/tsconfig.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-exports/conf.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-exports/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-exports/package.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-field/conf.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-field/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-field/package.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-index/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-index/package.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-not-used/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json delete mode 100755 fixtures/tsconfig/package.json delete mode 100644 fixtures/tsconfig/tsconfig.json delete mode 100644 fixtures/tsconfig/tsconfig_broken.json delete mode 100644 fixtures/tsconfig/tsconfig_template_variable.json delete mode 100644 napi/__test__/resolver.spec.mjs delete mode 100644 napi/src/lib.rs delete mode 100644 napi/src/options.rs delete mode 100644 napi/src/tracing.rs delete mode 100644 napi/tests/options.test.mjs delete mode 100644 pnpm-lock.yaml delete mode 100644 src/builtins.rs delete mode 100644 src/cache.rs delete mode 100644 src/context.rs delete mode 100644 src/error.rs delete mode 100644 src/file_system.rs delete mode 100644 src/lib.rs delete mode 100644 src/options.rs delete mode 100644 src/package_json.rs delete mode 100644 src/path.rs delete mode 100644 src/resolution.rs delete mode 100644 src/specifier.rs delete mode 100644 src/tests/alias.rs delete mode 100644 src/tests/browser_field.rs delete mode 100644 src/tests/builtins.rs delete mode 100644 src/tests/dependencies.rs delete mode 100644 src/tests/exports_field.rs delete mode 100644 src/tests/extension_alias.rs delete mode 100644 src/tests/extensions.rs delete mode 100644 src/tests/fallback.rs delete mode 100644 src/tests/full_specified.rs delete mode 100644 src/tests/imports_field.rs delete mode 100644 src/tests/incorrect_description_file.rs delete mode 100644 src/tests/main_field.rs delete mode 100644 src/tests/memory_fs.rs delete mode 100644 src/tests/missing.rs delete mode 100644 src/tests/mod.rs delete mode 100644 src/tests/pnp.rs delete mode 100644 src/tests/resolve.rs delete mode 100644 src/tests/restrictions.rs delete mode 100644 src/tests/roots.rs delete mode 100644 src/tests/scoped_packages.rs delete mode 100644 src/tests/simple.rs delete mode 100644 src/tests/symlink.rs delete mode 100644 src/tests/tsconfig_paths.rs delete mode 100644 src/tests/tsconfig_project_references.rs delete mode 100644 src/tsconfig.rs delete mode 100644 tests/integration_test.rs delete mode 100644 tests/package.json delete mode 100644 tests/resolve_test.rs diff --git a/.github/CODE_OF_CONDUCT.md b/.github/CODE_OF_CONDUCT.md deleted file mode 100644 index 41dd9ebe..00000000 --- a/.github/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,127 +0,0 @@ -# Contributor Covenant Code of Conduct - -## Our Pledge - -We as members, contributors, and leaders pledge to make participation in our -community a harassment-free experience for everyone, regardless of age, body -size, visible or invisible disability, ethnicity, sex characteristics, gender -identity and expression, level of experience, education, socio-economic status, -nationality, personal appearance, race, religion, or sexual identity -and orientation. - -We pledge to act and interact in ways that contribute to an open, welcoming, -diverse, inclusive, and healthy community. - -## Our Standards - -Examples of behavior that contributes to a positive environment for our -community include: - -* Demonstrating empathy and kindness toward other people -* Being respectful of differing opinions, viewpoints, and experiences -* Giving and gracefully accepting constructive feedback -* Accepting responsibility and apologizing to those affected by our mistakes, - and learning from the experience -* Focusing on what is best not just for us as individuals, but for the - overall community - -Examples of unacceptable behavior include: - -* The use of sexualized language or imagery, and sexual attention or - advances of any kind -* Trolling, insulting or derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or email - address, without their explicit permission -* Other conduct which could reasonably be considered inappropriate in a - professional setting - -## Enforcement Responsibilities - -Community leaders are responsible for clarifying and enforcing our standards of -acceptable behavior and will take appropriate and fair corrective action in -response to any behavior that they deem inappropriate, threatening, offensive, -or harmful. - -Community leaders have the right and responsibility to remove, edit, or reject -comments, commits, code, wiki edits, issues, and other contributions that are -not aligned to this Code of Conduct, and will communicate reasons for moderation -decisions when appropriate. - -## Scope - -This Code of Conduct applies within all community spaces, and also applies when -an individual is officially representing the community in public spaces. -Examples of representing our community include using an official e-mail address, -posting via an official social media account, or acting as an appointed -representative at an online or offline event. - -## Enforcement - -Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported to the community leaders responsible for enforcement. -All complaints will be reviewed and investigated promptly and fairly. - -All community leaders are obligated to respect the privacy and security of the -reporter of any incident. - -## Enforcement Guidelines - -Community leaders will follow these Community Impact Guidelines in determining -the consequences for any action they deem in violation of this Code of Conduct: - -### 1. Correction - -**Community Impact**: Use of inappropriate language or other behavior deemed -unprofessional or unwelcome in the community. - -**Consequence**: A private, written warning from community leaders, providing -clarity around the nature of the violation and an explanation of why the -behavior was inappropriate. A public apology may be requested. - -### 2. Warning - -**Community Impact**: A violation through a single incident or series -of actions. - -**Consequence**: A warning with consequences for continued behavior. No -interaction with the people involved, including unsolicited interaction with -those enforcing the Code of Conduct, for a specified period of time. This -includes avoiding interactions in community spaces as well as external channels -like social media. Violating these terms may lead to a temporary or -permanent ban. - -### 3. Temporary Ban - -**Community Impact**: A serious violation of community standards, including -sustained inappropriate behavior. - -**Consequence**: A temporary ban from any sort of interaction or public -communication with the community for a specified period of time. No public or -private interaction with the people involved, including unsolicited interaction -with those enforcing the Code of Conduct, is allowed during this period. -Violating these terms may lead to a permanent ban. - -### 4. Permanent Ban - -**Community Impact**: Demonstrating a pattern of violation of community -standards, including sustained inappropriate behavior, harassment of an -individual, or aggression toward or disparagement of classes of individuals. - -**Consequence**: A permanent ban from any sort of public interaction within -the community. - -## Attribution - -This Code of Conduct is adapted from the [Contributor Covenant][homepage], -version 2.0, available at -https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. - -Community Impact Guidelines were inspired by [Mozilla's code of conduct -enforcement ladder](https://github.com/mozilla/diversity). - -[homepage]: https://www.contributor-covenant.org - -For answers to common questions about this code of conduct, see the FAQ at -https://www.contributor-covenant.org/faq. Translations are available at -https://www.contributor-covenant.org/translations. diff --git a/.github/SECURITY.md b/.github/SECURITY.md deleted file mode 100644 index 63f5b072..00000000 --- a/.github/SECURITY.md +++ /dev/null @@ -1,7 +0,0 @@ -# Security Policy - -## Supported Versions - -## Reporting a Vulnerability - -If you find any potential vulnerability, join our [discord channel](https://discord.gg/9uXCAwqQZW) and contact Boshen. diff --git a/.github/actions/pnpm/action.yml b/.github/actions/pnpm/action.yml deleted file mode 100644 index ab4291c0..00000000 --- a/.github/actions/pnpm/action.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: Pnpm - -description: Install pnpm - -runs: - using: composite - steps: - - uses: pnpm/action-setup@v4 - - - uses: actions/setup-node@v4 - with: - node-version-file: .node-version - cache: pnpm - - - name: yarn - shell: bash - run: | - cd fixtures/pnp - corepack enable - yarn install - - - name: pnpm - shell: bash - run: | - corepack enable - pnpm install diff --git a/.github/codecov.yml b/.github/codecov.yml deleted file mode 100644 index 0610268a..00000000 --- a/.github/codecov.yml +++ /dev/null @@ -1,14 +0,0 @@ -coverage: - status: - project: - default: - informational: true - patch: - default: - informational: true - changes: - default: - informational: true - -ignore: - - "examples" diff --git a/.github/renovate.json b/.github/renovate.json deleted file mode 100644 index 2339df09..00000000 --- a/.github/renovate.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "$schema": "https://docs.renovatebot.com/renovate-schema.json", - "extends": ["github>Boshen/renovate"], - "ignorePaths": ["**/node_modules/**", "**/fixtures/**"] -} diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml deleted file mode 100644 index 7c25853b..00000000 --- a/.github/workflows/benchmark.yml +++ /dev/null @@ -1,41 +0,0 @@ -name: Benchmark - -on: - workflow_dispatch: - pull_request: - types: [opened, synchronize] - paths-ignore: - - '**/*.md' - push: - branches: - - main - paths-ignore: - - '**/*.md' - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} - cancel-in-progress: true - -jobs: - benchmark: - name: Benchmark - runs-on: ubuntu-latest - steps: - - name: Checkout Branch - uses: taiki-e/checkout-action@v1 - - - uses: Boshen/setup-rust@main - with: - cache-key: benchmark - save-cache: ${{ github.ref_name == 'main' }} - tools: cargo-codspeed - - uses: ./.github/actions/pnpm - - name: Build Benchmark - run: cargo codspeed build --features codspeed - - - name: Run benchmark - uses: CodSpeedHQ/action@v3 - timeout-minutes: 30 - with: - run: cargo codspeed run - token: ${{ secrets.CODSPEED_TOKEN }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index 3f629ffb..00000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,196 +0,0 @@ -name: CI - -on: - workflow_dispatch: - pull_request: - types: [opened, synchronize] - paths-ignore: - - '**/*.md' - - '!.github/workflows/ci.yml' - push: - branches: - - main - - "renovate/**" - paths-ignore: - - '**/*.md' - - '!.github/workflows/ci.yml' - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} - cancel-in-progress: ${{ github.ref_name != 'main' }} - -defaults: - run: - shell: bash - -jobs: - cache: # Warm cache factory for all other CI jobs - name: Check and Build - strategy: - fail-fast: true - matrix: - include: - - os: windows-latest - - os: ubuntu-latest - - os: macos-14 - runs-on: ${{ matrix.os }} - steps: - - uses: taiki-e/checkout-action@v1 - - - uses: Boshen/setup-rust@main - with: - save-cache: ${{ github.ref_name == 'main' }} - cache-key: warm - - - run: cargo check --all-features --locked - - # Only need to build the test to create a warm cache on the main branch - - name: Build cache by Cargo Check and Cargo Test - if: ${{ github.ref_name == 'main' }} - run: cargo test --all-features --no-run - - wasm: - name: Check Wasm - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - - uses: Boshen/setup-rust@main - with: - cache-key: wasm - save-cache: ${{ github.ref_name == 'main' }} - - - name: Check - run: | - rustup target add wasm32-unknown-unknown - cargo check --all-features --target wasm32-unknown-unknown - - wasi: - name: Test wasi target - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - - uses: Boshen/setup-rust@main - with: - cache-key: wasi - save-cache: ${{ github.ref_name == 'main' }} - - - uses: ./.github/actions/pnpm - - - name: Build - run: | - rustup target add wasm32-wasip1-threads - pnpm build --target wasm32-wasip1-threads - - - name: Test - run: pnpm test - env: - WASI_TEST: 1 - - typos: - name: Spell Check - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - - uses: crate-ci/typos@v1.24.5 - with: - files: . - - deny: - name: Cargo Deny - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - - uses: dorny/paths-filter@v3 - id: filter - with: - filters: | - src: - - 'Cargo.lock' - - - uses: Boshen/setup-rust@main - with: - restore-cache: false - tools: cargo-deny - - - if: steps.filter.outputs.src == 'true' - run: cargo deny check - - unused-deps: - name: Check Unused Dependencies - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - uses: dorny/paths-filter@v3 - id: filter - with: - filters: | - src: - - '**/*.rs' - - '**/Cargo.toml' - - 'Cargo.lock' - - uses: Boshen/setup-rust@main - with: - restore-cache: false - if: steps.filter.outputs.src == 'true' - - uses: cargo-bins/cargo-binstall@main - if: steps.filter.outputs.src == 'true' - - run: cargo binstall --no-confirm cargo-shear@1 - if: steps.filter.outputs.src == 'true' - - run: cargo shear - if: steps.filter.outputs.src == 'true' - - format: - name: Format - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - uses: Boshen/setup-rust@main - with: - components: rustfmt - restore-cache: false - - run: cargo fmt --all -- --check - - lint: - name: Clippy - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - uses: Boshen/setup-rust@main - with: - components: clippy - - run: cargo clippy --all-features -- -D warnings - - doc: - name: Doc - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - uses: Boshen/setup-rust@main - with: - components: rust-docs - - run: RUSTDOCFLAGS='-D warnings' cargo doc --no-deps --all-features - - test: - name: Test - strategy: - fail-fast: true - matrix: - include: - - os: windows-latest - - os: ubuntu-latest - - os: macos-14 - runs-on: ${{ matrix.os }} - env: - RUST_BACKTRACE: 1 - steps: - - uses: taiki-e/checkout-action@v1 - - uses: ./.github/actions/pnpm - - uses: Boshen/setup-rust@main - with: - cache-key: warm - - run: cargo test --doc - - run: cargo test --all-features diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml deleted file mode 100644 index 97302b03..00000000 --- a/.github/workflows/codecov.yml +++ /dev/null @@ -1,69 +0,0 @@ -name: Code Coverage # Run cargo-llvm-cov and upload to codecov.io - -on: - workflow_dispatch: - pull_request: - types: [opened, synchronize] - paths-ignore: - - '**/*.md' - push: - branches: - - main - paths-ignore: - - '**/*.md' - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: ${{ github.ref_name != 'main' }} - -jobs: - coverage: - name: Code Coverage - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: taiki-e/checkout-action@v1 - - - uses: ./.github/actions/pnpm - - - uses: Boshen/setup-rust@main - with: - cache-key: codecov - save-cache: ${{ github.ref_name == 'main' }} - tools: cargo-llvm-cov - components: llvm-tools-preview - - - run: cargo llvm-cov --lcov --output-path lcov.info - - - name: Upload Artifact - uses: actions/upload-artifact@v4 - with: - name: codecov - path: lcov.info - - # codecov often fails, use another workflow for retry - upload-codecov: - name: Upload coverage file - runs-on: ubuntu-latest - needs: coverage - # Check if the event is not triggered by a fork by checking whether CODECOV_TOKEN is set - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - steps: - - name: Checkout - if: env.CODECOV_TOKEN - uses: taiki-e/checkout-action@v1 - - - name: Download coverage file - if: env.CODECOV_TOKEN - uses: actions/download-artifact@v4 - with: - name: codecov - - - name: Upload to codecov.io - if: env.CODECOV_TOKEN - uses: codecov/codecov-action@v4 - with: - token: ${{ secrets.CODECOV_TOKEN }} - fail_ci_if_error: true - files: lcov.info diff --git a/.github/workflows/release-napi.yml b/.github/workflows/release-napi.yml deleted file mode 100644 index 1ea68db8..00000000 --- a/.github/workflows/release-napi.yml +++ /dev/null @@ -1,252 +0,0 @@ -name: Release NAPI - -on: - workflow_dispatch: - push: - branches: - - main - paths: - - npm/package.json # Please only commit this file, so we don't need to wait for test CI to pass. - -env: - DEBUG: 'napi:*' - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - check: - name: Check version - runs-on: ubuntu-latest - outputs: - version: ${{ env.version }} - version_changed: ${{ steps.version.outputs.changed }} - steps: - - uses: taiki-e/checkout-action@v1 - - - name: Check version changes - uses: EndBug/version-check@v2 - id: version - with: - static-checking: localIsNew - file-url: https://unpkg.com/oxc-resolver@latest/package.json - file-name: npm/package.json - - - name: Set version name - if: steps.version.outputs.changed == 'true' - run: | - echo "Version change found! New version: ${{ steps.version.outputs.version }} (${{ steps.version.outputs.version_type }})" - echo "version=${{ steps.version.outputs.version }}" >> $GITHUB_ENV - - build: - needs: check - if: needs.check.outputs.version_changed == 'true' - env: - version: ${{ needs.check.outputs.version }} - outputs: - version: ${{ env.version }} - strategy: - fail-fast: false - matrix: - include: - - os: windows-latest - target: x86_64-pc-windows-msvc - - - os: windows-latest - target: aarch64-pc-windows-msvc - - - os: ubuntu-latest - target: x86_64-unknown-linux-gnu - - - os: ubuntu-latest - target: x86_64-unknown-linux-musl - - - os: ubuntu-latest - target: aarch64-unknown-linux-gnu - - - os: ubuntu-latest - target: aarch64-unknown-linux-musl - - - os: ubuntu-latest - target: armv7-unknown-linux-gnueabihf - - - os: macos-latest - target: x86_64-apple-darwin - - - os: macos-latest - target: aarch64-apple-darwin - - - os: ubuntu-latest - target: wasm32-wasip1-threads - - name: Package ${{ matrix.target }} - runs-on: ${{ matrix.os }} - steps: - - uses: taiki-e/checkout-action@v1 - - - uses: ./.github/actions/pnpm - - - name: Add Rust Target - run: rustup target add ${{ matrix.target }} - - - uses: goto-bus-stop/setup-zig@v2 - if: ${{ contains(matrix.target, 'musl') }} - with: - version: 0.13.0 - - - name: Build with zig cross - if: ${{ contains(matrix.target, 'musl') }} - run: pnpm build -x --target ${{ matrix.target }} - - - name: Build with napi cross - if: ${{ contains(matrix.target, 'gnu') }} - run: pnpm build --use-napi-cross --target ${{ matrix.target }} - - - name: Build - if: ${{ !contains(matrix.target, 'gnu') && !contains(matrix.target, 'musl') }} - run: pnpm build --target ${{ matrix.target }} - - - name: Test - if: matrix.target == 'x86_64-pc-windows-msvc' || matrix.target == 'aarch64-apple-darwin' || matrix.target == 'wasm32-wasip1-threads' - run: pnpm test - - - name: Output docker params - if: ${{ contains(matrix.target, 'linux') }} - id: docker - run: | - node -e " - if ('${{ matrix.target }}'.startsWith('aarch64')) { - console.log('PLATFORM=linux/arm64') - } else if ('${{ matrix.target }}'.startsWith('armv7')) { - console.log('PLATFORM=linux/arm/v7') - } else { - console.log('PLATFORM=linux/amd64') - } - " >> $GITHUB_OUTPUT - node -e " - if ('${{ matrix.target }}'.endsWith('-musl')) { - console.log('IMAGE=node:lts-alpine') - } else { - console.log('IMAGE=node:lts-slim') - } - " >> $GITHUB_OUTPUT - echo "PNPM_STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_OUTPUT - - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - if: ${{ contains(matrix.target, 'linux') }} - with: - platforms: all - - - run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes - if: ${{ contains(matrix.target, 'linux') }} - - - name: Run linux test - uses: addnab/docker-run-action@v3 - if: ${{ contains(matrix.target, 'linux') }} - with: - image: ${{ steps.docker.outputs.IMAGE }} - options: -v ${{ steps.docker.outputs.PNPM_STORE_PATH }}:${{ steps.docker.outputs.PNPM_STORE_PATH }} -v ${{ github.workspace }}:/oxc_resolver -w /oxc_resolver --platform ${{ steps.docker.outputs.PLATFORM }} - run: | - corepack enable - pnpm test - - - name: Upload artifacts - uses: actions/upload-artifact@v4 - with: - name: bindings-${{ matrix.target }} - path: | - napi/*.node - napi/*.wasm - - build-freebsd: - needs: check - if: needs.check.outputs.version_changed == 'true' - name: Build FreeBSD - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Build - id: build - uses: cross-platform-actions/action@v0.25.0 - env: - DEBUG: napi:* - RUSTUP_IO_THREADS: 1 - with: - operating_system: freebsd - version: '14.0' - memory: 8G - cpu_count: 3 - environment_variables: 'DEBUG RUSTUP_IO_THREADS' - shell: bash - run: | - sudo pkg install -y -f curl node libnghttp2 npm - curl https://sh.rustup.rs -sSf --output rustup.sh - sh rustup.sh -y --profile minimal --default-toolchain stable - source "$HOME/.cargo/env" - echo "~~~~ rustc --version ~~~~" - rustc --version - echo "~~~~ node -v ~~~~" - node -v - pwd - ls -lah - whoami - env - sudo corepack enable - pnpm install - pnpm build --target x86_64-unknown-freebsd - rm -rf node_modules - rm -rf target - - name: Upload artifact - uses: actions/upload-artifact@v4 - with: - name: bindings-freebsd - path: napi/*.node - if-no-files-found: error - - publish: - name: Publish NAPI - runs-on: ubuntu-latest - permissions: - id-token: write # for `npm publish --provenance` - needs: - - build - - build-freebsd - steps: - - uses: taiki-e/checkout-action@v1 - - - name: corepack - run: corepack enable - - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version-file: .node-version - cache: pnpm - - - name: Install dependencies - run: pnpm install --frozen-lockfile - - - name: Download Artifacts - uses: actions/download-artifact@v4 - with: - path: artifacts - - - name: Prepare dirs and artifacts - run: | - pnpm napi create-npm-dirs --package-json-path npm/package.json - pnpm napi artifacts --package-json-path npm/package.json --build-output-dir napi - - - name: Publish npm packages as latest - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - shell: bash - run: | - cp napi/index.js npm/index.js - cp napi/index.d.ts npm/index.d.ts - cp napi/browser.js npm/browser.js - echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc - pnpm napi pre-publish --no-gh-release -t npm --package-json-path npm/package.json - npm publish npm/ --tag latest --provenance --access public diff --git a/.github/workflows/release-plz.yml b/.github/workflows/release-plz.yml deleted file mode 100644 index 121758ad..00000000 --- a/.github/workflows/release-plz.yml +++ /dev/null @@ -1,55 +0,0 @@ -name: Release Plz - -on: - workflow_dispatch: - push: - branches: - - main - -permissions: - pull-requests: write - contents: write - -jobs: - release-plz: - name: Release-plz - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - uses: Boshen/setup-rust@main - with: - save-cache: ${{ github.ref_name == 'main' }} - cache-key: warm - - - name: Run release-plz - id: release-plz - uses: MarcoIeni/release-plz-action@v0.5 - env: - GITHUB_TOKEN: ${{ secrets.RELEASE_PLZ_TOKEN }} - CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} - - - name: Bump package.json - if: ${{ steps.release-plz.outputs.prs_created }} - env: - GH_TOKEN: ${{ github.token }} - RELEASES: ${{ steps.release-plz.outputs.releases }} - PR: ${{ steps.release-plz.outputs.pr }} - run: | - set -e - - pr_number=${{ fromJSON(steps.release-plz.outputs.pr).number }} - if [[ -n "$pr_number" ]]; then - version=$(echo "$RELEASES" | jq -r '.[0].version') - echo "version: $version" - - jq --arg version "${version}" '.version = ($version)' npm/package.json > tmp - mv tmp npm/package.json - - gh pr checkout $pr_number - git add . - git commit -m "Update package.json" - git push - fi diff --git a/Cargo.lock b/Cargo.lock deleted file mode 100644 index 58c1e7ad..00000000 --- a/Cargo.lock +++ /dev/null @@ -1,1326 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "adler" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" - -[[package]] -name = "aho-corasick" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" -dependencies = [ - "memchr", -] - -[[package]] -name = "android-tzdata" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" - -[[package]] -name = "android_system_properties" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" -dependencies = [ - "libc", -] - -[[package]] -name = "anes" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "735d4f398ca57cfa2880225c2bf81c3b9af3be5bb22e44ae70118dad38713e84" - -[[package]] -name = "arca" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f915ddd863ef73f11c10c75170e86db1d4f539689bc6bfb9ce25d6528d6fe83" -dependencies = [ - "clean-path", - "path-slash", - "radix_trie", -] - -[[package]] -name = "autocfg" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" - -[[package]] -name = "base64" -version = "0.22.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" - -[[package]] -name = "bit-set" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1" -dependencies = [ - "bit-vec", -] - -[[package]] -name = "bit-vec" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "bitflags" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" - -[[package]] -name = "bpaf" -version = "0.9.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3280efcf6d66bc77c2cf9b67dc8acee47a217d9be67dd590b3230dffe663724d" - -[[package]] -name = "bumpalo" -version = "3.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" - -[[package]] -name = "byteorder" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" - -[[package]] -name = "cast" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" - -[[package]] -name = "cc" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eaff6f8ce506b9773fa786672d63fc7a191ffea1be33f72bbd4aeacefca9ffc8" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "chrono" -version = "0.4.38" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" -dependencies = [ - "android-tzdata", - "iana-time-zone", - "num-traits", - "serde", - "windows-targets 0.52.6", -] - -[[package]] -name = "ciborium" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42e69ffd6f0917f5c029256a24d0161db17cea3997d185db0d35926308770f0e" -dependencies = [ - "ciborium-io", - "ciborium-ll", - "serde", -] - -[[package]] -name = "ciborium-io" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05afea1e0a06c9be33d539b876f1ce3692f4afea2cb41f740e7743225ed1c757" - -[[package]] -name = "ciborium-ll" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57663b653d948a338bfb3eeba9bb2fd5fcfaecb9e199e87e1eda4d9e8b240fd9" -dependencies = [ - "ciborium-io", - "half", -] - -[[package]] -name = "clean-path" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aaa6b4b263a5d737e9bf6b7c09b72c41a5480aec4d7219af827f6564e950b6a5" - -[[package]] -name = "codspeed" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a104ac948e0188b921eb3fcbdd55dcf62e542df4c7ab7e660623f6288302089" -dependencies = [ - "colored", - "libc", - "serde_json", -] - -[[package]] -name = "colored" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbf2150cce219b664a8a70df7a1f933836724b503f8a413af9365b4dcc4d90b8" -dependencies = [ - "lazy_static", - "windows-sys 0.48.0", -] - -[[package]] -name = "concurrent_lru" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7feb5cb312f774e8a24540e27206db4e890f7d488563671d24a16389cf4c2e4e" -dependencies = [ - "once_cell", -] - -[[package]] -name = "convert_case" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec182b0ca2f35d8fc196cf3404988fd8b8c739a4d270ff118a398feb0cbec1ca" -dependencies = [ - "unicode-segmentation", -] - -[[package]] -name = "core-foundation-sys" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" - -[[package]] -name = "criterion2" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8df39381f28ced0ceebfb5611528d99aef14f8d75b43e9d4ceb6aba66e7b04d" -dependencies = [ - "anes", - "bpaf", - "cast", - "ciborium", - "codspeed", - "colored", - "num-traits", - "oorandom", - "serde", - "serde_json", - "walkdir", -] - -[[package]] -name = "crossbeam-deque" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" -dependencies = [ - "crossbeam-epoch", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.9.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" -dependencies = [ - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" - -[[package]] -name = "crunchy" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" - -[[package]] -name = "ctor" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edb49164822f3ee45b17acd4a208cfc1251410cf0cad9a833234c9890774dd9f" -dependencies = [ - "quote", - "syn", -] - -[[package]] -name = "darling" -version = "0.20.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" -dependencies = [ - "darling_core", - "darling_macro", -] - -[[package]] -name = "darling_core" -version = "0.20.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95133861a8032aaea082871032f5815eb9e98cef03fa916ab4500513994df9e5" -dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "strsim", - "syn", -] - -[[package]] -name = "darling_macro" -version = "0.20.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" -dependencies = [ - "darling_core", - "quote", - "syn", -] - -[[package]] -name = "dashmap" -version = "6.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "804c8821570c3f8b70230c2ba75ffa5c0f9a4189b9a432b6656c536712acae28" -dependencies = [ - "cfg-if", - "crossbeam-utils", - "hashbrown 0.14.5", - "lock_api", - "once_cell", - "parking_lot_core", -] - -[[package]] -name = "deranged" -version = "0.3.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" -dependencies = [ - "powerfmt", - "serde", -] - -[[package]] -name = "document-features" -version = "0.2.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb6969eaabd2421f8a2775cfd2471a2b634372b4a25d41e3bd647b79912850a0" -dependencies = [ - "litrs", -] - -[[package]] -name = "dunce" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" - -[[package]] -name = "either" -version = "1.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" - -[[package]] -name = "endian-type" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" - -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "fancy-regex" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "531e46835a22af56d1e3b66f04844bed63158bc094a628bec1d321d9b4c44bf2" -dependencies = [ - "bit-set", - "regex-automata", - "regex-syntax", -] - -[[package]] -name = "filetime" -version = "0.2.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ee447700ac8aa0b2f2bd7bc4462ad686ba06baa6727ac149a2d6277f0d240fd" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall 0.4.1", - "windows-sys 0.52.0", -] - -[[package]] -name = "fnv" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" - -[[package]] -name = "half" -version = "2.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dd08c532ae367adf81c312a4580bc67f1d0fe8bc9c460520283f4c0ff277888" -dependencies = [ - "cfg-if", - "crunchy", -] - -[[package]] -name = "hashbrown" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" - -[[package]] -name = "hashbrown" -version = "0.14.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "iana-time-zone" -version = "0.1.60" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" -dependencies = [ - "android_system_properties", - "core-foundation-sys", - "iana-time-zone-haiku", - "js-sys", - "wasm-bindgen", - "windows-core", -] - -[[package]] -name = "iana-time-zone-haiku" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" -dependencies = [ - "cc", -] - -[[package]] -name = "ident_case" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" - -[[package]] -name = "indexmap" -version = "1.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" -dependencies = [ - "autocfg", - "hashbrown 0.12.3", - "serde", -] - -[[package]] -name = "indexmap" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93ead53efc7ea8ed3cfb0c79fc8023fbb782a5432b52830b6518941cebe6505c" -dependencies = [ - "equivalent", - "hashbrown 0.14.5", - "serde", -] - -[[package]] -name = "itoa" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" - -[[package]] -name = "js-sys" -version = "0.3.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" -dependencies = [ - "wasm-bindgen", -] - -[[package]] -name = "json-strip-comments" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b271732a960335e715b6b2ae66a086f115c74eb97360e996d2bd809bfc063bba" -dependencies = [ - "memchr", -] - -[[package]] -name = "lazy_static" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" - -[[package]] -name = "libc" -version = "0.2.155" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" - -[[package]] -name = "libloading" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e310b3a6b5907f99202fcdb4960ff45b93735d7c7d96b760fcff8db2dc0e103d" -dependencies = [ - "cfg-if", - "windows-targets 0.52.6", -] - -[[package]] -name = "litrs" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4ce301924b7887e9d637144fdade93f9dfff9b60981d4ac161db09720d39aa5" - -[[package]] -name = "lock_api" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" -dependencies = [ - "autocfg", - "scopeguard", -] - -[[package]] -name = "log" -version = "0.4.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" - -[[package]] -name = "memchr" -version = "2.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" - -[[package]] -name = "miniz_oxide" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" -dependencies = [ - "adler", -] - -[[package]] -name = "napi" -version = "3.0.0-alpha.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ec04344cc540f5897e97c9821ab99e7eb276b4dca6f3e6e441dfa72e5bcde70" -dependencies = [ - "bitflags 2.6.0", - "ctor", - "napi-build", - "napi-sys", - "once_cell", - "serde", - "serde_json", -] - -[[package]] -name = "napi-build" -version = "2.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1c0f5d67ee408a4685b61f5ab7e58605c8ae3f2b4189f0127d804ff13d5560a" - -[[package]] -name = "napi-derive" -version = "3.0.0-alpha.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c6240c4ddca592cde608bbfa26e2af397c3596e413a0c65c9bbcb65c2f1e485" -dependencies = [ - "cfg-if", - "convert_case", - "napi-derive-backend", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "napi-derive-backend" -version = "2.0.0-alpha.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b32dcc50065508fe2f387076c17adbdf10e038d1c080d48b10196813d94ac6a8" -dependencies = [ - "convert_case", - "once_cell", - "proc-macro2", - "quote", - "regex", - "semver", - "syn", -] - -[[package]] -name = "napi-sys" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "427802e8ec3a734331fec1035594a210ce1ff4dc5bc1950530920ab717964ea3" -dependencies = [ - "libloading", -] - -[[package]] -name = "nibble_vec" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" -dependencies = [ - "smallvec", -] - -[[package]] -name = "normalize-path" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5438dd2b2ff4c6df6e1ce22d825ed2fa93ee2922235cc45186991717f0a892d" - -[[package]] -name = "num-conv" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" - -[[package]] -name = "num-traits" -version = "0.2.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" -dependencies = [ - "autocfg", -] - -[[package]] -name = "once_cell" -version = "1.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" - -[[package]] -name = "oorandom" -version = "11.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b410bbe7e14ab526a0e86877eb47c6996a2bd7746f027ba551028c925390e4e9" - -[[package]] -name = "oxc_napi_resolver" -version = "0.0.0" -dependencies = [ - "napi", - "napi-build", - "napi-derive", - "oxc_resolver", - "tracing-subscriber", -] - -[[package]] -name = "oxc_resolver" -version = "1.11.0" -dependencies = [ - "cfg-if", - "criterion2", - "dashmap", - "document-features", - "dunce", - "indexmap 2.4.0", - "json-strip-comments", - "normalize-path", - "once_cell", - "pnp", - "rayon", - "rustc-hash", - "serde", - "serde_json", - "simdutf8", - "thiserror", - "tracing", - "vfs", -] - -[[package]] -name = "parking_lot_core" -version = "0.9.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall 0.5.2", - "smallvec", - "windows-targets 0.52.6", -] - -[[package]] -name = "path-slash" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e91099d4268b0e11973f036e885d652fb0b21fedcf69738c627f94db6a44f42" - -[[package]] -name = "pathdiff" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8835116a5c179084a830efb3adc117ab007512b535bc1a21c991d3b32a6b44dd" - -[[package]] -name = "pin-project-lite" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" - -[[package]] -name = "pnp" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46770cee76a618023fea15411d0449dd066dc232cc17e4562f154da215f27af7" -dependencies = [ - "arca", - "byteorder", - "concurrent_lru", - "fancy-regex", - "lazy_static", - "miniz_oxide", - "pathdiff", - "regex", - "serde", - "serde_json", - "serde_with", - "thiserror", -] - -[[package]] -name = "powerfmt" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" - -[[package]] -name = "proc-macro2" -version = "1.0.86" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.36" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "radix_trie" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" -dependencies = [ - "endian-type", - "nibble_vec", -] - -[[package]] -name = "rayon" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" -dependencies = [ - "either", - "rayon-core", -] - -[[package]] -name = "rayon-core" -version = "1.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" -dependencies = [ - "crossbeam-deque", - "crossbeam-utils", -] - -[[package]] -name = "redox_syscall" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" -dependencies = [ - "bitflags 1.3.2", -] - -[[package]] -name = "redox_syscall" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c82cf8cff14456045f55ec4241383baeff27af886adb72ffb2162f99911de0fd" -dependencies = [ - "bitflags 2.6.0", -] - -[[package]] -name = "regex" -version = "1.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b91213439dad192326a0d7c6ee3955910425f441d7038e0d6933b0aec5c4517f" -dependencies = [ - "aho-corasick", - "memchr", - "regex-automata", - "regex-syntax", -] - -[[package]] -name = "regex-automata" -version = "0.4.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", -] - -[[package]] -name = "regex-syntax" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" - -[[package]] -name = "rustc-hash" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" - -[[package]] -name = "ryu" -version = "1.0.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" - -[[package]] -name = "same-file" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "scopeguard" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" - -[[package]] -name = "semver" -version = "1.0.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" - -[[package]] -name = "serde" -version = "1.0.209" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99fce0ffe7310761ca6bf9faf5115afbc19688edd00171d81b1bb1b116c63e09" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.209" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5831b979fd7b5439637af1752d535ff49f4860c0f341d1baeb6faf0f4242170" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "serde_json" -version = "1.0.127" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8043c06d9f82bd7271361ed64f415fe5e12a77fdb52e573e7f06a516dea329ad" -dependencies = [ - "indexmap 2.4.0", - "itoa", - "memchr", - "ryu", - "serde", -] - -[[package]] -name = "serde_with" -version = "3.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e73139bc5ec2d45e6c5fd85be5a46949c1c39a4c18e56915f5eb4c12f975e377" -dependencies = [ - "base64", - "chrono", - "hex", - "indexmap 1.9.3", - "indexmap 2.4.0", - "serde", - "serde_derive", - "serde_json", - "serde_with_macros", - "time", -] - -[[package]] -name = "serde_with_macros" -version = "3.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b80d3d6b56b64335c0180e5ffde23b3c5e08c14c585b51a15bd0e95393f46703" -dependencies = [ - "darling", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "sharded-slab" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" -dependencies = [ - "lazy_static", -] - -[[package]] -name = "simdutf8" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f27f6278552951f1f2b8cf9da965d10969b2efdea95a6ec47987ab46edfe263a" - -[[package]] -name = "smallvec" -version = "1.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" - -[[package]] -name = "strsim" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" - -[[package]] -name = "syn" -version = "2.0.70" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f0209b68b3613b093e0ec905354eccaedcfe83b8cb37cbdeae64026c3064c16" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "thiserror" -version = "1.0.63" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.63" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "thread_local" -version = "1.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" -dependencies = [ - "cfg-if", - "once_cell", -] - -[[package]] -name = "time" -version = "0.3.36" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" -dependencies = [ - "deranged", - "itoa", - "num-conv", - "powerfmt", - "serde", - "time-core", - "time-macros", -] - -[[package]] -name = "time-core" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" - -[[package]] -name = "time-macros" -version = "0.2.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" -dependencies = [ - "num-conv", - "time-core", -] - -[[package]] -name = "tracing" -version = "0.1.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" -dependencies = [ - "pin-project-lite", - "tracing-attributes", - "tracing-core", -] - -[[package]] -name = "tracing-attributes" -version = "0.1.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "tracing-core" -version = "0.1.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" -dependencies = [ - "once_cell", -] - -[[package]] -name = "tracing-subscriber" -version = "0.3.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" -dependencies = [ - "sharded-slab", - "thread_local", - "tracing-core", -] - -[[package]] -name = "unicode-ident" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" - -[[package]] -name = "unicode-segmentation" -version = "1.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" - -[[package]] -name = "vfs" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "654cd097e182a71dbf899178e6b5662c2157dd0b8afd5975de18008f6fc173d1" -dependencies = [ - "filetime", -] - -[[package]] -name = "walkdir" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" -dependencies = [ - "same-file", - "winapi-util", -] - -[[package]] -name = "wasm-bindgen" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" -dependencies = [ - "cfg-if", - "wasm-bindgen-macro", -] - -[[package]] -name = "wasm-bindgen-backend" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" -dependencies = [ - "bumpalo", - "log", - "once_cell", - "proc-macro2", - "quote", - "syn", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-macro" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" -dependencies = [ - "quote", - "wasm-bindgen-macro-support", -] - -[[package]] -name = "wasm-bindgen-macro-support" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" -dependencies = [ - "proc-macro2", - "quote", - "syn", - "wasm-bindgen-backend", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-shared" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" - -[[package]] -name = "winapi-util" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b" -dependencies = [ - "windows-sys 0.52.0", -] - -[[package]] -name = "windows-core" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" -dependencies = [ - "windows-targets 0.52.6", -] - -[[package]] -name = "windows-sys" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" -dependencies = [ - "windows-targets 0.48.5", -] - -[[package]] -name = "windows-sys" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" -dependencies = [ - "windows-targets 0.52.6", -] - -[[package]] -name = "windows-targets" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" -dependencies = [ - "windows_aarch64_gnullvm 0.48.5", - "windows_aarch64_msvc 0.48.5", - "windows_i686_gnu 0.48.5", - "windows_i686_msvc 0.48.5", - "windows_x86_64_gnu 0.48.5", - "windows_x86_64_gnullvm 0.48.5", - "windows_x86_64_msvc 0.48.5", -] - -[[package]] -name = "windows-targets" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" -dependencies = [ - "windows_aarch64_gnullvm 0.52.6", - "windows_aarch64_msvc 0.52.6", - "windows_i686_gnu 0.52.6", - "windows_i686_gnullvm", - "windows_i686_msvc 0.52.6", - "windows_x86_64_gnu 0.52.6", - "windows_x86_64_gnullvm 0.52.6", - "windows_x86_64_msvc 0.52.6", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" - -[[package]] -name = "windows_i686_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" - -[[package]] -name = "windows_i686_gnu" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" - -[[package]] -name = "windows_i686_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" - -[[package]] -name = "windows_i686_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" - -[[package]] -name = "windows_i686_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" diff --git a/fixtures/enhanced_resolve/lib/index.js b/fixtures/enhanced_resolve/lib/index.js deleted file mode 100644 index 1e872e8f..00000000 --- a/fixtures/enhanced_resolve/lib/index.js +++ /dev/null @@ -1 +0,0 @@ -// mimic enhanced-resolved root directory structure diff --git a/fixtures/enhanced_resolve/package.json b/fixtures/enhanced_resolve/package.json deleted file mode 100644 index d1b845b5..00000000 --- a/fixtures/enhanced_resolve/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "enhanced-resolve", - "main": "lib/index.js" -} diff --git a/fixtures/enhanced_resolve/test/.gitignore b/fixtures/enhanced_resolve/test/.gitignore deleted file mode 100644 index b021b4e4..00000000 --- a/fixtures/enhanced_resolve/test/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -# created by symlink.rs -/temp -/temp_symlinks \ No newline at end of file diff --git a/fixtures/enhanced_resolve/test/fixtures/#/a.js b/fixtures/enhanced_resolve/test/fixtures/#/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/a.js b/fixtures/enhanced_resolve/test/fixtures/a.js deleted file mode 100644 index 896ffc6d..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/abc.txt b/fixtures/enhanced_resolve/test/fixtures/abc.txt deleted file mode 100644 index f2ba8f84..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/abc.txt +++ /dev/null @@ -1 +0,0 @@ -abc \ No newline at end of file diff --git a/fixtures/enhanced_resolve/test/fixtures/alias/files/a.js b/fixtures/enhanced_resolve/test/fixtures/alias/files/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/b.js b/fixtures/enhanced_resolve/test/fixtures/b.js deleted file mode 100644 index 11476340..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/b.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function b() { - return "This is b"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/browser/module-a.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/browser/module-a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/browser.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/ignore.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/ignore.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/replaced.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/replaced.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/self.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/self.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/toString.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/toString.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-a.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-b.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-c.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-c.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/a.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/b.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/c.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/c.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/d.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/d.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json deleted file mode 100644 index c13fe23b..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "browser": { - "a.js": "./a", - "./b.js": "./b", - "c.js": "./d.js", - "./d.js": "./c.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/package.json b/fixtures/enhanced_resolve/test/fixtures/browser-module/package.json deleted file mode 100644 index 19ff7739..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/browser-module/package.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "exports": { - "./lib/index.js": "./lib/index.js" - }, - "browser": { - "./lib/ignore.js": false, - "./lib/replaced.js": "./lib/browser", - "module-a": "./browser/module-a.js", - "module-b": "module-c", - "module-c": "module-c", - "./toString": "./lib/toString.js", - "./lib/main.js": "./lib/main.js", - "./main.js": "./lib/main.js", - "./lib/xyz.js": "./xyz.js", - "./xyz.js": "./lib/xyz.js", - "./lib/non-existent.js": "./lib/non-existent.js", - ".": false, - "./number": 1, - "./foo": "./lib/replaced.js?query" - }, - "innerBrowser1": { - "field": { - "browser": { - "./lib/main1.js": "./lib/main.js" - } - } - }, - "innerBrowser2": { - "browser": { - "./lib/main2.js": "./lib/replaced.js" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/builtins/package.json b/fixtures/enhanced_resolve/test/fixtures/builtins/package.json deleted file mode 100644 index 4a54ea96..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/builtins/package.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "name": "builtins", - "private": true, - "imports": { - "#fs": { - "default": "fs" - }, - "#http": { - "node": "node:http" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/c.js b/fixtures/enhanced_resolve/test/fixtures/c.js deleted file mode 100644 index e3aca8aa..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/c.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = function b() { - require("./a"); - return "This is c"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/complex.js b/fixtures/enhanced_resolve/test/fixtures/complex.js deleted file mode 100644 index 1f62db84..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/complex.js +++ /dev/null @@ -1,13 +0,0 @@ -var 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); diff --git a/fixtures/enhanced_resolve/test/fixtures/crypto-js/index.js b/fixtures/enhanced_resolve/test/fixtures/crypto-js/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json b/fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json deleted file mode 100644 index 1d31aa8b..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "crypto-js", - "main": "index.js", - "browser": { - "crypto": false - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/decorated-fs/exists.js b/fixtures/enhanced_resolve/test/fixtures/decorated-fs/exists.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/dirOrFile.js b/fixtures/enhanced_resolve/test/fixtures/dirOrFile.js deleted file mode 100644 index c3cb885f..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/dirOrFile.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "file"; diff --git a/fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js b/fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js deleted file mode 100644 index 85e01cd4..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "dir"; diff --git a/fixtures/enhanced_resolve/test/fixtures/directory-default/directory-default.js b/fixtures/enhanced_resolve/test/fixtures/directory-default/directory-default.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js deleted file mode 100644 index d1007aae..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js +++ /dev/null @@ -1 +0,0 @@ -export default "string"; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts deleted file mode 100644 index cb0ff5c3..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json deleted file mode 100644 index b523a1e9..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "@org/pkg", - "exports": { - "./*.js": { - "types": "./dist/*.d.ts", - "default": "./dist/*.js" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js deleted file mode 100644 index d1007aae..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js +++ /dev/null @@ -1 +0,0 @@ -export default "string"; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts deleted file mode 100644 index cb0ff5c3..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json deleted file mode 100644 index 8e55fb46..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "@raviqqe/hidash", - "exports": { - "./*.js": { - "types": "./dist/*.d.ts", - "default": "./dist/*.js" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json deleted file mode 100644 index f0edf449..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "exports-field", - "version": "1.0.0", - "exports": { - ".": "./a/../b/../../pack1/index.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/pack1/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/pack1/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/a.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/a.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json deleted file mode 100644 index 6b105c08..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "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/": { - "webpack": ["./lib/lib2/", "./lib/"], - "node": "./lib/", - "default": "./lib/" - }, - "./dist/a.js": "./../../a.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json deleted file mode 100644 index 0012a3de..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "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" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/umd.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/umd.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field/package.json deleted file mode 100644 index 5fa72bb5..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "@exports-field/core", - "version": "1.0.0", - "exports": "./a.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json deleted file mode 100644 index e6f12074..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "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/lib2/", "./lib/"], - "node": "./lib/", - "default": "./lib/" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/index b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/index deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json deleted file mode 100644 index 1a838f49..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "name": "exports-field", - "exportsField": { - "exports": "./main.js" - }, - "ex": "./index", - "broken": { - ".": "./src" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/src/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/src/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.ts b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.mts b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.mts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mjs b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mjs deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mts.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mts.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.ts b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/app.module.js b/fixtures/enhanced_resolve/test/fixtures/extensions/app.module.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.js b/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/foo.js b/fixtures/enhanced_resolve/test/fixtures/extensions/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/foo.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/foo.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/index.js b/fixtures/enhanced_resolve/test/fixtures/extensions/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/index.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module.js b/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module/index.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/package.json b/fixtures/enhanced_resolve/test/fixtures/extensions/package.json deleted file mode 100644 index 5e55a1e8..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/extensions/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "./index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/file.load1 b/fixtures/enhanced_resolve/test/fixtures/file.load1 deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/file.load2 b/fixtures/enhanced_resolve/test/fixtures/file.load2 deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/foo/index.js b/fixtures/enhanced_resolve/test/fixtures/foo/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/foo/package.json b/fixtures/enhanced_resolve/test/fixtures/foo/package.json deleted file mode 100644 index da86787a..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/foo/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "foo", - "version": "1.0.0" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json deleted file mode 100644 index aa2be496..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "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" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/internal/file.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/internal/file.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/y/y.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/y/y.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/internal/i.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/internal/i.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/nested/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js deleted file mode 100644 index e5b70a86..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = { nested: "nested" } diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-3/nested/f/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-3/nested/f/nested/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-4/f/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-4/f/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f$/$.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f$/$.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f/$.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f/$.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/nested/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/a.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/a.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/b.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/dir/b.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/dir/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/index.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json deleted file mode 100644 index 8d8d3a46..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "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/lib2/", "./lib/"], - "node": "./lib/", - "default": "./lib/" - }, - "./dist/a.js": "./../../a.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/c/index.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/c/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/imports-field/package.json deleted file mode 100644 index 248351a9..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "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" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/a.js b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json deleted file mode 100644 index ded7faa2..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json +++ /dev/null @@ -1,2 +0,0 @@ -{ - "main": "./a.js", diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/a.js b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/package.json b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/package.json deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/issue-238/package.json b/fixtures/enhanced_resolve/test/fixtures/issue-238/package.json deleted file mode 100644 index 352055cd..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/issue-238/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "private": true -} diff --git a/fixtures/enhanced_resolve/test/fixtures/issue-238/src/a/config.js b/fixtures/enhanced_resolve/test/fixtures/issue-238/src/a/config.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/issue-238/src/common/config/myObjectFile.js b/fixtures/enhanced_resolve/test/fixtures/issue-238/src/common/config/myObjectFile.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/lib.js b/fixtures/enhanced_resolve/test/fixtures/lib.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/lib/complex1.js b/fixtures/enhanced_resolve/test/fixtures/lib/complex1.js deleted file mode 100644 index b3de3d70..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/lib/complex1.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "lib complex1"; diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self/index.js b/fixtures/enhanced_resolve/test/fixtures/main-field-self/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json b/fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json deleted file mode 100644 index a2b6f341..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "./" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self2/index.js b/fixtures/enhanced_resolve/test/fixtures/main-field-self2/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json b/fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json deleted file mode 100644 index 4fa6f730..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "." -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main1.js b/fixtures/enhanced_resolve/test/fixtures/main1.js deleted file mode 100644 index 168f2a1e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main1.js +++ /dev/null @@ -1,9 +0,0 @@ -var a = require("./a"); -if (x) { - for (var i = 0; i < 100; i++) { - while (true) require("./b"); - do { - i++; - } while (require("m1/a")()); - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main2.js b/fixtures/enhanced_resolve/test/fixtures/main2.js deleted file mode 100644 index 39f062b1..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main2.js +++ /dev/null @@ -1,12 +0,0 @@ -var 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"); - }); - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main3.js b/fixtures/enhanced_resolve/test/fixtures/main3.js deleted file mode 100644 index 1c180166..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main3.js +++ /dev/null @@ -1,4 +0,0 @@ -var a = require("./a"); -require.ensure([], function(require) { - require("./c.js"); -}); diff --git a/fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js b/fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js deleted file mode 100644 index 997c1051..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is nested m1/a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/no#fragment/#/#.js b/fixtures/enhanced_resolve/test/fixtures/no#fragment/#/#.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/no.js b/fixtures/enhanced_resolve/test/fixtures/no.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/browser.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/browser.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/main.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json deleted file mode 100644 index c469e1fd..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "main": "./main.js", - "browser": "./browser.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js deleted file mode 100644 index 549620a5..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "the correct a.js"; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js deleted file mode 100644 index 5db6632e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = " :) " + require("m2/b.js"); diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js deleted file mode 100644 index d308569d..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require("m1/a") + require("m1"); diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js deleted file mode 100644 index cb8127e8..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "Step2"; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json deleted file mode 100644 index 8d6dfa56..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "dash-name", - "exports": "./index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json deleted file mode 100644 index 4fd8706e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "dash", - "exports": "./index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/invalidPackageJson/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/invalidPackageJson/package.json deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js deleted file mode 100644 index 46fc8e6c..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is m1/a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js deleted file mode 100644 index 8565c244..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is m1/b"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js deleted file mode 100644 index 34faaaf5..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "This is m2/b"; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/file.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/file.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js b/fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js deleted file mode 100644 index 997c1051..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is nested m1/a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/dir/index.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/dir/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/index.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/main.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/browser.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/browser.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/index.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json deleted file mode 100644 index e20ceaeb..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "main": "main.js", - "browser": { - "./package-alias/index.js": "./package-alias/browser.js", - "module": "pkg/dir/index" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/typescript/index.ts b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/typescript/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json deleted file mode 100644 index 4a1f838e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "@exports-field/core", - "version": "1.0.0", - "exports": { - ".": "./a.js", - "./x": "./a.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/prefer-pnp/alternative-modules/m1/b.js b/fixtures/enhanced_resolve/test/fixtures/prefer-pnp/alternative-modules/m1/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.css b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.css deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.js b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json deleted file mode 100644 index 14ab704d..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/index.css b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/index.css deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/module.js b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/module.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json deleted file mode 100644 index ee0eb71b..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "main": "../../../c.js", - "module": "module.js", - "style": "index.css" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/roots_fall_through/index.js b/fixtures/enhanced_resolve/test/fixtures/roots_fall_through/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/main.js b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json deleted file mode 100644 index 70a0f20f..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "browser": { - "./index.js": "./main.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/lib/index.js b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/lib/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/main.js b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json deleted file mode 100644 index 2af9e0d1..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "./main.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/shortcutdir.js/a.js b/fixtures/enhanced_resolve/test/fixtures/shortcutdir.js/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/b b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/b deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/c b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/c deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/a b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/a deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/b b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/b deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/b/foo/a b/fixtures/enhanced_resolve/test/fixtures/yield/b/foo/a deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/a b/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/a deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json b/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json deleted file mode 100644 index 0acc4b4c..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "foo", - "version": "1.0.0", - "browser": { - "./a": false - } -} diff --git "a/fixtures/enhanced_resolve/test/fixtures/\346\265\213\350\257\225.js" "b/fixtures/enhanced_resolve/test/fixtures/\346\265\213\350\257\225.js" deleted file mode 100644 index e69de29b..00000000 diff --git "a/fixtures/misc/\344\270\255\346\226\207/\344\270\255\346\226\207.js" "b/fixtures/misc/\344\270\255\346\226\207/\344\270\255\346\226\207.js" deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/pnp/.gitignore b/fixtures/pnp/.gitignore deleted file mode 100644 index 1783c71a..00000000 --- a/fixtures/pnp/.gitignore +++ /dev/null @@ -1 +0,0 @@ -install_state.gz \ No newline at end of file diff --git a/fixtures/pnp/.pnp.cjs b/fixtures/pnp/.pnp.cjs deleted file mode 100755 index 2a8d1771..00000000 --- a/fixtures/pnp/.pnp.cjs +++ /dev/null @@ -1,7543 +0,0 @@ -#!/usr/bin/env node -/* eslint-disable */ -// @ts-nocheck -"use strict"; - -const RAW_RUNTIME_STATE = -'{\ - "__info": [\ - "This file is automatically generated. Do not touch it, or risk",\ - "your modifications being lost."\ - ],\ - "dependencyTreeRoots": [\ - {\ - "name": "pnp",\ - "reference": "workspace:."\ - }\ - ],\ - "enableTopLevelFallback": true,\ - "ignorePatternData": "(^(?:\\\\.yarn\\\\/sdks(?:\\\\/(?!\\\\.{1,2}(?:\\\\/|$))(?:(?:(?!(?:^|\\\\/)\\\\.{1,2}(?:\\\\/|$)).)*?)|$))$)",\ - "fallbackExclusionList": [\ - ["pnp", ["workspace:."]]\ - ],\ - "fallbackPool": [\ - ],\ - "packageRegistryData": [\ - [null, [\ - [null, {\ - "packageLocation": "./",\ - "packageDependencies": [\ - ["is-even", "npm:1.0.0"],\ - ["is-odd", "npm:3.0.1"]\ - ],\ - "linkType": "SOFT"\ - }]\ - ]],\ - ["is-buffer", [\ - ["npm:1.1.6", {\ - "packageLocation": "./.yarn/cache/is-buffer-npm-1.1.6-08199d9ccc-ae18aa0b6e.zip/node_modules/is-buffer/",\ - "packageDependencies": [\ - ["is-buffer", "npm:1.1.6"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["is-even", [\ - ["npm:1.0.0", {\ - "packageLocation": "./.yarn/cache/is-even-npm-1.0.0-9f726520dc-2728cc2f39.zip/node_modules/is-even/",\ - "packageDependencies": [\ - ["is-even", "npm:1.0.0"],\ - ["is-odd", "npm:0.1.2"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["is-number", [\ - ["npm:3.0.0", {\ - "packageLocation": "./.yarn/cache/is-number-npm-3.0.0-9088035ade-e639c54640.zip/node_modules/is-number/",\ - "packageDependencies": [\ - ["is-number", "npm:3.0.0"],\ - ["kind-of", "npm:3.2.2"]\ - ],\ - "linkType": "HARD"\ - }],\ - ["npm:6.0.0", {\ - "packageLocation": "./.yarn/cache/is-number-npm-6.0.0-30881e83e6-5da4c68401.zip/node_modules/is-number/",\ - "packageDependencies": [\ - ["is-number", "npm:6.0.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["is-odd", [\ - ["npm:0.1.2", {\ - "packageLocation": "./.yarn/cache/is-odd-npm-0.1.2-9d980a9da8-7dc6c6fd00.zip/node_modules/is-odd/",\ - "packageDependencies": [\ - ["is-odd", "npm:0.1.2"],\ - ["is-number", "npm:3.0.0"]\ - ],\ - "linkType": "HARD"\ - }],\ - ["npm:3.0.1", {\ - "packageLocation": "./.yarn/cache/is-odd-npm-3.0.1-93c3c3f41b-89ee2e353c.zip/node_modules/is-odd/",\ - "packageDependencies": [\ - ["is-odd", "npm:3.0.1"],\ - ["is-number", "npm:6.0.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["kind-of", [\ - ["npm:3.2.2", {\ - "packageLocation": "./.yarn/cache/kind-of-npm-3.2.2-7deaffa5f9-7e34bc29d4.zip/node_modules/kind-of/",\ - "packageDependencies": [\ - ["kind-of", "npm:3.2.2"],\ - ["is-buffer", "npm:1.1.6"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["pnp", [\ - ["workspace:.", {\ - "packageLocation": "./",\ - "packageDependencies": [\ - ["pnp", "workspace:."],\ - ["is-even", "npm:1.0.0"],\ - ["is-odd", "npm:3.0.1"]\ - ],\ - "linkType": "SOFT"\ - }]\ - ]]\ - ]\ -}'; - -function $$SETUP_STATE(hydrateRuntimeState, basePath) { - return hydrateRuntimeState(JSON.parse(RAW_RUNTIME_STATE), {basePath: basePath || __dirname}); -} - -const fs = require('fs'); -const path = require('path'); -const crypto = require('crypto'); -const os = require('os'); -const events = require('events'); -const nodeUtils = require('util'); -const stream = require('stream'); -const zlib = require('zlib'); -const require$$0 = require('module'); -const StringDecoder = require('string_decoder'); -const url = require('url'); -const buffer = require('buffer'); -const readline = require('readline'); -const assert = require('assert'); - -const _interopDefaultLegacy = e => e && typeof e === 'object' && 'default' in e ? e : { default: e }; - -function _interopNamespace(e) { - if (e && e.__esModule) return e; - const n = Object.create(null); - if (e) { - for (const k in e) { - if (k !== 'default') { - const d = Object.getOwnPropertyDescriptor(e, k); - Object.defineProperty(n, k, d.get ? d : { - enumerable: true, - get: () => e[k] - }); - } - } - } - n.default = e; - return Object.freeze(n); -} - -const fs__default = /*#__PURE__*/_interopDefaultLegacy(fs); -const path__default = /*#__PURE__*/_interopDefaultLegacy(path); -const nodeUtils__namespace = /*#__PURE__*/_interopNamespace(nodeUtils); -const zlib__default = /*#__PURE__*/_interopDefaultLegacy(zlib); -const require$$0__default = /*#__PURE__*/_interopDefaultLegacy(require$$0); -const StringDecoder__default = /*#__PURE__*/_interopDefaultLegacy(StringDecoder); -const buffer__default = /*#__PURE__*/_interopDefaultLegacy(buffer); -const assert__default = /*#__PURE__*/_interopDefaultLegacy(assert); - -const S_IFMT = 61440; -const S_IFDIR = 16384; -const S_IFREG = 32768; -const S_IFLNK = 40960; -const SAFE_TIME = 456789e3; - -function makeError$1(code, message) { - return Object.assign(new Error(`${code}: ${message}`), { code }); -} -function EBUSY(message) { - return makeError$1(`EBUSY`, message); -} -function ENOSYS(message, reason) { - return makeError$1(`ENOSYS`, `${message}, ${reason}`); -} -function EINVAL(reason) { - return makeError$1(`EINVAL`, `invalid argument, ${reason}`); -} -function EBADF(reason) { - return makeError$1(`EBADF`, `bad file descriptor, ${reason}`); -} -function ENOENT(reason) { - return makeError$1(`ENOENT`, `no such file or directory, ${reason}`); -} -function ENOTDIR(reason) { - return makeError$1(`ENOTDIR`, `not a directory, ${reason}`); -} -function EISDIR(reason) { - return makeError$1(`EISDIR`, `illegal operation on a directory, ${reason}`); -} -function EEXIST(reason) { - return makeError$1(`EEXIST`, `file already exists, ${reason}`); -} -function EROFS(reason) { - return makeError$1(`EROFS`, `read-only filesystem, ${reason}`); -} -function ENOTEMPTY(reason) { - return makeError$1(`ENOTEMPTY`, `directory not empty, ${reason}`); -} -function EOPNOTSUPP(reason) { - return makeError$1(`EOPNOTSUPP`, `operation not supported, ${reason}`); -} -function ERR_DIR_CLOSED() { - return makeError$1(`ERR_DIR_CLOSED`, `Directory handle was closed`); -} - -const DEFAULT_MODE = S_IFREG | 420; -class StatEntry { - constructor() { - this.uid = 0; - this.gid = 0; - this.size = 0; - this.blksize = 0; - this.atimeMs = 0; - this.mtimeMs = 0; - this.ctimeMs = 0; - this.birthtimeMs = 0; - this.atime = new Date(0); - this.mtime = new Date(0); - this.ctime = new Date(0); - this.birthtime = new Date(0); - this.dev = 0; - this.ino = 0; - this.mode = DEFAULT_MODE; - this.nlink = 1; - this.rdev = 0; - this.blocks = 1; - } - isBlockDevice() { - return false; - } - isCharacterDevice() { - return false; - } - isDirectory() { - return (this.mode & S_IFMT) === S_IFDIR; - } - isFIFO() { - return false; - } - isFile() { - return (this.mode & S_IFMT) === S_IFREG; - } - isSocket() { - return false; - } - isSymbolicLink() { - return (this.mode & S_IFMT) === S_IFLNK; - } -} -class BigIntStatsEntry { - constructor() { - this.uid = BigInt(0); - this.gid = BigInt(0); - this.size = BigInt(0); - this.blksize = BigInt(0); - this.atimeMs = BigInt(0); - this.mtimeMs = BigInt(0); - this.ctimeMs = BigInt(0); - this.birthtimeMs = BigInt(0); - this.atimeNs = BigInt(0); - this.mtimeNs = BigInt(0); - this.ctimeNs = BigInt(0); - this.birthtimeNs = BigInt(0); - this.atime = new Date(0); - this.mtime = new Date(0); - this.ctime = new Date(0); - this.birthtime = new Date(0); - this.dev = BigInt(0); - this.ino = BigInt(0); - this.mode = BigInt(DEFAULT_MODE); - this.nlink = BigInt(1); - this.rdev = BigInt(0); - this.blocks = BigInt(1); - } - isBlockDevice() { - return false; - } - isCharacterDevice() { - return false; - } - isDirectory() { - return (this.mode & BigInt(S_IFMT)) === BigInt(S_IFDIR); - } - isFIFO() { - return false; - } - isFile() { - return (this.mode & BigInt(S_IFMT)) === BigInt(S_IFREG); - } - isSocket() { - return false; - } - isSymbolicLink() { - return (this.mode & BigInt(S_IFMT)) === BigInt(S_IFLNK); - } -} -function makeDefaultStats() { - return new StatEntry(); -} -function clearStats(stats) { - for (const key in stats) { - if (Object.hasOwn(stats, key)) { - const element = stats[key]; - if (typeof element === `number`) { - stats[key] = 0; - } else if (typeof element === `bigint`) { - stats[key] = BigInt(0); - } else if (nodeUtils__namespace.types.isDate(element)) { - stats[key] = new Date(0); - } - } - } - return stats; -} -function convertToBigIntStats(stats) { - const bigintStats = new BigIntStatsEntry(); - for (const key in stats) { - if (Object.hasOwn(stats, key)) { - const element = stats[key]; - if (typeof element === `number`) { - bigintStats[key] = BigInt(element); - } else if (nodeUtils__namespace.types.isDate(element)) { - bigintStats[key] = new Date(element); - } - } - } - bigintStats.atimeNs = bigintStats.atimeMs * BigInt(1e6); - bigintStats.mtimeNs = bigintStats.mtimeMs * BigInt(1e6); - bigintStats.ctimeNs = bigintStats.ctimeMs * BigInt(1e6); - bigintStats.birthtimeNs = bigintStats.birthtimeMs * BigInt(1e6); - return bigintStats; -} -function areStatsEqual(a, b) { - if (a.atimeMs !== b.atimeMs) - return false; - if (a.birthtimeMs !== b.birthtimeMs) - return false; - if (a.blksize !== b.blksize) - return false; - if (a.blocks !== b.blocks) - return false; - if (a.ctimeMs !== b.ctimeMs) - return false; - if (a.dev !== b.dev) - return false; - if (a.gid !== b.gid) - return false; - if (a.ino !== b.ino) - return false; - if (a.isBlockDevice() !== b.isBlockDevice()) - return false; - if (a.isCharacterDevice() !== b.isCharacterDevice()) - return false; - if (a.isDirectory() !== b.isDirectory()) - return false; - if (a.isFIFO() !== b.isFIFO()) - return false; - if (a.isFile() !== b.isFile()) - return false; - if (a.isSocket() !== b.isSocket()) - return false; - if (a.isSymbolicLink() !== b.isSymbolicLink()) - return false; - if (a.mode !== b.mode) - return false; - if (a.mtimeMs !== b.mtimeMs) - return false; - if (a.nlink !== b.nlink) - return false; - if (a.rdev !== b.rdev) - return false; - if (a.size !== b.size) - return false; - if (a.uid !== b.uid) - return false; - const aN = a; - const bN = b; - if (aN.atimeNs !== bN.atimeNs) - return false; - if (aN.mtimeNs !== bN.mtimeNs) - return false; - if (aN.ctimeNs !== bN.ctimeNs) - return false; - if (aN.birthtimeNs !== bN.birthtimeNs) - return false; - return true; -} - -const PortablePath = { - root: `/`, - dot: `.`, - parent: `..` -}; -const Filename = { - home: `~`, - nodeModules: `node_modules`, - manifest: `package.json`, - lockfile: `yarn.lock`, - virtual: `__virtual__`, - pnpJs: `.pnp.js`, - pnpCjs: `.pnp.cjs`, - pnpData: `.pnp.data.json`, - pnpEsmLoader: `.pnp.loader.mjs`, - rc: `.yarnrc.yml`, - env: `.env` -}; -const npath = Object.create(path__default.default); -const ppath = Object.create(path__default.default.posix); -npath.cwd = () => process.cwd(); -ppath.cwd = process.platform === `win32` ? () => toPortablePath(process.cwd()) : process.cwd; -if (process.platform === `win32`) { - ppath.resolve = (...segments) => { - if (segments.length > 0 && ppath.isAbsolute(segments[0])) { - return path__default.default.posix.resolve(...segments); - } else { - return path__default.default.posix.resolve(ppath.cwd(), ...segments); - } - }; -} -const contains = function(pathUtils, from, to) { - from = pathUtils.normalize(from); - to = pathUtils.normalize(to); - if (from === to) - return `.`; - if (!from.endsWith(pathUtils.sep)) - from = from + pathUtils.sep; - if (to.startsWith(from)) { - return to.slice(from.length); - } else { - return null; - } -}; -npath.contains = (from, to) => contains(npath, from, to); -ppath.contains = (from, to) => contains(ppath, from, to); -const WINDOWS_PATH_REGEXP = /^([a-zA-Z]:.*)$/; -const UNC_WINDOWS_PATH_REGEXP = /^\/\/(\.\/)?(.*)$/; -const PORTABLE_PATH_REGEXP = /^\/([a-zA-Z]:.*)$/; -const UNC_PORTABLE_PATH_REGEXP = /^\/unc\/(\.dot\/)?(.*)$/; -function fromPortablePathWin32(p) { - let portablePathMatch, uncPortablePathMatch; - if (portablePathMatch = p.match(PORTABLE_PATH_REGEXP)) - p = portablePathMatch[1]; - else if (uncPortablePathMatch = p.match(UNC_PORTABLE_PATH_REGEXP)) - p = `\\\\${uncPortablePathMatch[1] ? `.\\` : ``}${uncPortablePathMatch[2]}`; - else - return p; - return p.replace(/\//g, `\\`); -} -function toPortablePathWin32(p) { - p = p.replace(/\\/g, `/`); - let windowsPathMatch, uncWindowsPathMatch; - if (windowsPathMatch = p.match(WINDOWS_PATH_REGEXP)) - p = `/${windowsPathMatch[1]}`; - else if (uncWindowsPathMatch = p.match(UNC_WINDOWS_PATH_REGEXP)) - p = `/unc/${uncWindowsPathMatch[1] ? `.dot/` : ``}${uncWindowsPathMatch[2]}`; - return p; -} -const toPortablePath = process.platform === `win32` ? toPortablePathWin32 : (p) => p; -const fromPortablePath = process.platform === `win32` ? fromPortablePathWin32 : (p) => p; -npath.fromPortablePath = fromPortablePath; -npath.toPortablePath = toPortablePath; -function convertPath(targetPathUtils, sourcePath) { - return targetPathUtils === npath ? fromPortablePath(sourcePath) : toPortablePath(sourcePath); -} - -const defaultTime = new Date(SAFE_TIME * 1e3); -const defaultTimeMs = defaultTime.getTime(); -async function copyPromise(destinationFs, destination, sourceFs, source, opts) { - const normalizedDestination = destinationFs.pathUtils.normalize(destination); - const normalizedSource = sourceFs.pathUtils.normalize(source); - const prelayout = []; - const postlayout = []; - const { atime, mtime } = opts.stableTime ? { atime: defaultTime, mtime: defaultTime } : await sourceFs.lstatPromise(normalizedSource); - await destinationFs.mkdirpPromise(destinationFs.pathUtils.dirname(destination), { utimes: [atime, mtime] }); - await copyImpl(prelayout, postlayout, destinationFs, normalizedDestination, sourceFs, normalizedSource, { ...opts, didParentExist: true }); - for (const operation of prelayout) - await operation(); - await Promise.all(postlayout.map((operation) => { - return operation(); - })); -} -async function copyImpl(prelayout, postlayout, destinationFs, destination, sourceFs, source, opts) { - const destinationStat = opts.didParentExist ? await maybeLStat(destinationFs, destination) : null; - const sourceStat = await sourceFs.lstatPromise(source); - const { atime, mtime } = opts.stableTime ? { atime: defaultTime, mtime: defaultTime } : sourceStat; - let updated; - switch (true) { - case sourceStat.isDirectory(): - { - updated = await copyFolder(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts); - } - break; - case sourceStat.isFile(): - { - updated = await copyFile(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts); - } - break; - case sourceStat.isSymbolicLink(): - { - updated = await copySymlink(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts); - } - break; - default: { - throw new Error(`Unsupported file type (${sourceStat.mode})`); - } - } - if (opts.linkStrategy?.type !== `HardlinkFromIndex` || !sourceStat.isFile()) { - if (updated || destinationStat?.mtime?.getTime() !== mtime.getTime() || destinationStat?.atime?.getTime() !== atime.getTime()) { - postlayout.push(() => destinationFs.lutimesPromise(destination, atime, mtime)); - updated = true; - } - if (destinationStat === null || (destinationStat.mode & 511) !== (sourceStat.mode & 511)) { - postlayout.push(() => destinationFs.chmodPromise(destination, sourceStat.mode & 511)); - updated = true; - } - } - return updated; -} -async function maybeLStat(baseFs, p) { - try { - return await baseFs.lstatPromise(p); - } catch (e) { - return null; - } -} -async function copyFolder(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts) { - if (destinationStat !== null && !destinationStat.isDirectory()) { - if (opts.overwrite) { - prelayout.push(async () => destinationFs.removePromise(destination)); - destinationStat = null; - } else { - return false; - } - } - let updated = false; - if (destinationStat === null) { - prelayout.push(async () => { - try { - await destinationFs.mkdirPromise(destination, { mode: sourceStat.mode }); - } catch (err) { - if (err.code !== `EEXIST`) { - throw err; - } - } - }); - updated = true; - } - const entries = await sourceFs.readdirPromise(source); - const nextOpts = opts.didParentExist && !destinationStat ? { ...opts, didParentExist: false } : opts; - if (opts.stableSort) { - for (const entry of entries.sort()) { - if (await copyImpl(prelayout, postlayout, destinationFs, destinationFs.pathUtils.join(destination, entry), sourceFs, sourceFs.pathUtils.join(source, entry), nextOpts)) { - updated = true; - } - } - } else { - const entriesUpdateStatus = await Promise.all(entries.map(async (entry) => { - await copyImpl(prelayout, postlayout, destinationFs, destinationFs.pathUtils.join(destination, entry), sourceFs, sourceFs.pathUtils.join(source, entry), nextOpts); - })); - if (entriesUpdateStatus.some((status) => status)) { - updated = true; - } - } - return updated; -} -async function copyFileViaIndex(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts, linkStrategy) { - const sourceHash = await sourceFs.checksumFilePromise(source, { algorithm: `sha1` }); - const defaultMode = 420; - const sourceMode = sourceStat.mode & 511; - const indexFileName = `${sourceHash}${sourceMode !== defaultMode ? sourceMode.toString(8) : ``}`; - const indexPath = destinationFs.pathUtils.join(linkStrategy.indexPath, sourceHash.slice(0, 2), `${indexFileName}.dat`); - let AtomicBehavior; - ((AtomicBehavior2) => { - AtomicBehavior2[AtomicBehavior2["Lock"] = 0] = "Lock"; - AtomicBehavior2[AtomicBehavior2["Rename"] = 1] = "Rename"; - })(AtomicBehavior || (AtomicBehavior = {})); - let atomicBehavior = 1 /* Rename */; - let indexStat = await maybeLStat(destinationFs, indexPath); - if (destinationStat) { - const isDestinationHardlinkedFromIndex = indexStat && destinationStat.dev === indexStat.dev && destinationStat.ino === indexStat.ino; - const isIndexModified = indexStat?.mtimeMs !== defaultTimeMs; - if (isDestinationHardlinkedFromIndex) { - if (isIndexModified && linkStrategy.autoRepair) { - atomicBehavior = 0 /* Lock */; - indexStat = null; - } - } - if (!isDestinationHardlinkedFromIndex) { - if (opts.overwrite) { - prelayout.push(async () => destinationFs.removePromise(destination)); - destinationStat = null; - } else { - return false; - } - } - } - const tempPath = !indexStat && atomicBehavior === 1 /* Rename */ ? `${indexPath}.${Math.floor(Math.random() * 4294967296).toString(16).padStart(8, `0`)}` : null; - let tempPathCleaned = false; - prelayout.push(async () => { - if (!indexStat) { - if (atomicBehavior === 0 /* Lock */) { - await destinationFs.lockPromise(indexPath, async () => { - const content = await sourceFs.readFilePromise(source); - await destinationFs.writeFilePromise(indexPath, content); - }); - } - if (atomicBehavior === 1 /* Rename */ && tempPath) { - const content = await sourceFs.readFilePromise(source); - await destinationFs.writeFilePromise(tempPath, content); - try { - await destinationFs.linkPromise(tempPath, indexPath); - } catch (err) { - if (err.code === `EEXIST`) { - tempPathCleaned = true; - await destinationFs.unlinkPromise(tempPath); - } else { - throw err; - } - } - } - } - if (!destinationStat) { - await destinationFs.linkPromise(indexPath, destination); - } - }); - postlayout.push(async () => { - if (!indexStat) { - await destinationFs.lutimesPromise(indexPath, defaultTime, defaultTime); - if (sourceMode !== defaultMode) { - await destinationFs.chmodPromise(indexPath, sourceMode); - } - } - if (tempPath && !tempPathCleaned) { - await destinationFs.unlinkPromise(tempPath); - } - }); - return false; -} -async function copyFileDirect(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts) { - if (destinationStat !== null) { - if (opts.overwrite) { - prelayout.push(async () => destinationFs.removePromise(destination)); - destinationStat = null; - } else { - return false; - } - } - prelayout.push(async () => { - const content = await sourceFs.readFilePromise(source); - await destinationFs.writeFilePromise(destination, content); - }); - return true; -} -async function copyFile(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts) { - if (opts.linkStrategy?.type === `HardlinkFromIndex`) { - return copyFileViaIndex(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts, opts.linkStrategy); - } else { - return copyFileDirect(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts); - } -} -async function copySymlink(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts) { - if (destinationStat !== null) { - if (opts.overwrite) { - prelayout.push(async () => destinationFs.removePromise(destination)); - destinationStat = null; - } else { - return false; - } - } - prelayout.push(async () => { - await destinationFs.symlinkPromise(convertPath(destinationFs.pathUtils, await sourceFs.readlinkPromise(source)), destination); - }); - return true; -} - -class CustomDir { - constructor(path, nextDirent, opts = {}) { - this.path = path; - this.nextDirent = nextDirent; - this.opts = opts; - this.closed = false; - } - throwIfClosed() { - if (this.closed) { - throw ERR_DIR_CLOSED(); - } - } - async *[Symbol.asyncIterator]() { - try { - let dirent; - while ((dirent = await this.read()) !== null) { - yield dirent; - } - } finally { - await this.close(); - } - } - read(cb) { - const dirent = this.readSync(); - if (typeof cb !== `undefined`) - return cb(null, dirent); - return Promise.resolve(dirent); - } - readSync() { - this.throwIfClosed(); - return this.nextDirent(); - } - close(cb) { - this.closeSync(); - if (typeof cb !== `undefined`) - return cb(null); - return Promise.resolve(); - } - closeSync() { - this.throwIfClosed(); - this.opts.onClose?.(); - this.closed = true; - } -} -function opendir(fakeFs, path, entries, opts) { - const nextDirent = () => { - const filename = entries.shift(); - if (typeof filename === `undefined`) - return null; - const entryPath = fakeFs.pathUtils.join(path, filename); - return Object.assign(fakeFs.statSync(entryPath), { - name: filename, - path: void 0 - }); - }; - return new CustomDir(path, nextDirent, opts); -} - -function assertStatus(current, expected) { - if (current !== expected) { - throw new Error(`Invalid StatWatcher status: expected '${expected}', got '${current}'`); - } -} -class CustomStatWatcher extends events.EventEmitter { - constructor(fakeFs, path, { bigint = false } = {}) { - super(); - this.status = "ready" /* Ready */; - this.changeListeners = /* @__PURE__ */ new Map(); - this.startTimeout = null; - this.fakeFs = fakeFs; - this.path = path; - this.bigint = bigint; - this.lastStats = this.stat(); - } - static create(fakeFs, path, opts) { - const statWatcher = new CustomStatWatcher(fakeFs, path, opts); - statWatcher.start(); - return statWatcher; - } - start() { - assertStatus(this.status, "ready" /* Ready */); - this.status = "running" /* Running */; - this.startTimeout = setTimeout(() => { - this.startTimeout = null; - if (!this.fakeFs.existsSync(this.path)) { - this.emit("change" /* Change */, this.lastStats, this.lastStats); - } - }, 3); - } - stop() { - assertStatus(this.status, "running" /* Running */); - this.status = "stopped" /* Stopped */; - if (this.startTimeout !== null) { - clearTimeout(this.startTimeout); - this.startTimeout = null; - } - this.emit("stop" /* Stop */); - } - stat() { - try { - return this.fakeFs.statSync(this.path, { bigint: this.bigint }); - } catch (error) { - const statInstance = this.bigint ? new BigIntStatsEntry() : new StatEntry(); - return clearStats(statInstance); - } - } - makeInterval(opts) { - const interval = setInterval(() => { - const currentStats = this.stat(); - const previousStats = this.lastStats; - if (areStatsEqual(currentStats, previousStats)) - return; - this.lastStats = currentStats; - this.emit("change" /* Change */, currentStats, previousStats); - }, opts.interval); - return opts.persistent ? interval : interval.unref(); - } - registerChangeListener(listener, opts) { - this.addListener("change" /* Change */, listener); - this.changeListeners.set(listener, this.makeInterval(opts)); - } - unregisterChangeListener(listener) { - this.removeListener("change" /* Change */, listener); - const interval = this.changeListeners.get(listener); - if (typeof interval !== `undefined`) - clearInterval(interval); - this.changeListeners.delete(listener); - } - unregisterAllChangeListeners() { - for (const listener of this.changeListeners.keys()) { - this.unregisterChangeListener(listener); - } - } - hasChangeListeners() { - return this.changeListeners.size > 0; - } - ref() { - for (const interval of this.changeListeners.values()) - interval.ref(); - return this; - } - unref() { - for (const interval of this.changeListeners.values()) - interval.unref(); - return this; - } -} - -const statWatchersByFakeFS = /* @__PURE__ */ new WeakMap(); -function watchFile(fakeFs, path, a, b) { - let bigint; - let persistent; - let interval; - let listener; - switch (typeof a) { - case `function`: - { - bigint = false; - persistent = true; - interval = 5007; - listener = a; - } - break; - default: - { - ({ - bigint = false, - persistent = true, - interval = 5007 - } = a); - listener = b; - } - break; - } - let statWatchers = statWatchersByFakeFS.get(fakeFs); - if (typeof statWatchers === `undefined`) - statWatchersByFakeFS.set(fakeFs, statWatchers = /* @__PURE__ */ new Map()); - let statWatcher = statWatchers.get(path); - if (typeof statWatcher === `undefined`) { - statWatcher = CustomStatWatcher.create(fakeFs, path, { bigint }); - statWatchers.set(path, statWatcher); - } - statWatcher.registerChangeListener(listener, { persistent, interval }); - return statWatcher; -} -function unwatchFile(fakeFs, path, cb) { - const statWatchers = statWatchersByFakeFS.get(fakeFs); - if (typeof statWatchers === `undefined`) - return; - const statWatcher = statWatchers.get(path); - if (typeof statWatcher === `undefined`) - return; - if (typeof cb === `undefined`) - statWatcher.unregisterAllChangeListeners(); - else - statWatcher.unregisterChangeListener(cb); - if (!statWatcher.hasChangeListeners()) { - statWatcher.stop(); - statWatchers.delete(path); - } -} -function unwatchAllFiles(fakeFs) { - const statWatchers = statWatchersByFakeFS.get(fakeFs); - if (typeof statWatchers === `undefined`) - return; - for (const path of statWatchers.keys()) { - unwatchFile(fakeFs, path); - } -} - -class FakeFS { - constructor(pathUtils) { - this.pathUtils = pathUtils; - } - async *genTraversePromise(init, { stableSort = false } = {}) { - const stack = [init]; - while (stack.length > 0) { - const p = stack.shift(); - const entry = await this.lstatPromise(p); - if (entry.isDirectory()) { - const entries = await this.readdirPromise(p); - if (stableSort) { - for (const entry2 of entries.sort()) { - stack.push(this.pathUtils.join(p, entry2)); - } - } else { - throw new Error(`Not supported`); - } - } else { - yield p; - } - } - } - async checksumFilePromise(path, { algorithm = `sha512` } = {}) { - const fd = await this.openPromise(path, `r`); - try { - const CHUNK_SIZE = 65536; - const chunk = Buffer.allocUnsafeSlow(CHUNK_SIZE); - const hash = crypto.createHash(algorithm); - let bytesRead = 0; - while ((bytesRead = await this.readPromise(fd, chunk, 0, CHUNK_SIZE)) !== 0) - hash.update(bytesRead === CHUNK_SIZE ? chunk : chunk.slice(0, bytesRead)); - return hash.digest(`hex`); - } finally { - await this.closePromise(fd); - } - } - async removePromise(p, { recursive = true, maxRetries = 5 } = {}) { - let stat; - try { - stat = await this.lstatPromise(p); - } catch (error) { - if (error.code === `ENOENT`) { - return; - } else { - throw error; - } - } - if (stat.isDirectory()) { - if (recursive) { - const entries = await this.readdirPromise(p); - await Promise.all(entries.map((entry) => { - return this.removePromise(this.pathUtils.resolve(p, entry)); - })); - } - for (let t = 0; t <= maxRetries; t++) { - try { - await this.rmdirPromise(p); - break; - } catch (error) { - if (error.code !== `EBUSY` && error.code !== `ENOTEMPTY`) { - throw error; - } else if (t < maxRetries) { - await new Promise((resolve) => setTimeout(resolve, t * 100)); - } - } - } - } else { - await this.unlinkPromise(p); - } - } - removeSync(p, { recursive = true } = {}) { - let stat; - try { - stat = this.lstatSync(p); - } catch (error) { - if (error.code === `ENOENT`) { - return; - } else { - throw error; - } - } - if (stat.isDirectory()) { - if (recursive) - for (const entry of this.readdirSync(p)) - this.removeSync(this.pathUtils.resolve(p, entry)); - this.rmdirSync(p); - } else { - this.unlinkSync(p); - } - } - async mkdirpPromise(p, { chmod, utimes } = {}) { - p = this.resolve(p); - if (p === this.pathUtils.dirname(p)) - return void 0; - const parts = p.split(this.pathUtils.sep); - let createdDirectory; - for (let u = 2; u <= parts.length; ++u) { - const subPath = parts.slice(0, u).join(this.pathUtils.sep); - if (!this.existsSync(subPath)) { - try { - await this.mkdirPromise(subPath); - } catch (error) { - if (error.code === `EEXIST`) { - continue; - } else { - throw error; - } - } - createdDirectory ??= subPath; - if (chmod != null) - await this.chmodPromise(subPath, chmod); - if (utimes != null) { - await this.utimesPromise(subPath, utimes[0], utimes[1]); - } else { - const parentStat = await this.statPromise(this.pathUtils.dirname(subPath)); - await this.utimesPromise(subPath, parentStat.atime, parentStat.mtime); - } - } - } - return createdDirectory; - } - mkdirpSync(p, { chmod, utimes } = {}) { - p = this.resolve(p); - if (p === this.pathUtils.dirname(p)) - return void 0; - const parts = p.split(this.pathUtils.sep); - let createdDirectory; - for (let u = 2; u <= parts.length; ++u) { - const subPath = parts.slice(0, u).join(this.pathUtils.sep); - if (!this.existsSync(subPath)) { - try { - this.mkdirSync(subPath); - } catch (error) { - if (error.code === `EEXIST`) { - continue; - } else { - throw error; - } - } - createdDirectory ??= subPath; - if (chmod != null) - this.chmodSync(subPath, chmod); - if (utimes != null) { - this.utimesSync(subPath, utimes[0], utimes[1]); - } else { - const parentStat = this.statSync(this.pathUtils.dirname(subPath)); - this.utimesSync(subPath, parentStat.atime, parentStat.mtime); - } - } - } - return createdDirectory; - } - async copyPromise(destination, source, { baseFs = this, overwrite = true, stableSort = false, stableTime = false, linkStrategy = null } = {}) { - return await copyPromise(this, destination, baseFs, source, { overwrite, stableSort, stableTime, linkStrategy }); - } - copySync(destination, source, { baseFs = this, overwrite = true } = {}) { - const stat = baseFs.lstatSync(source); - const exists = this.existsSync(destination); - if (stat.isDirectory()) { - this.mkdirpSync(destination); - const directoryListing = baseFs.readdirSync(source); - for (const entry of directoryListing) { - this.copySync(this.pathUtils.join(destination, entry), baseFs.pathUtils.join(source, entry), { baseFs, overwrite }); - } - } else if (stat.isFile()) { - if (!exists || overwrite) { - if (exists) - this.removeSync(destination); - const content = baseFs.readFileSync(source); - this.writeFileSync(destination, content); - } - } else if (stat.isSymbolicLink()) { - if (!exists || overwrite) { - if (exists) - this.removeSync(destination); - const target = baseFs.readlinkSync(source); - this.symlinkSync(convertPath(this.pathUtils, target), destination); - } - } else { - throw new Error(`Unsupported file type (file: ${source}, mode: 0o${stat.mode.toString(8).padStart(6, `0`)})`); - } - const mode = stat.mode & 511; - this.chmodSync(destination, mode); - } - async changeFilePromise(p, content, opts = {}) { - if (Buffer.isBuffer(content)) { - return this.changeFileBufferPromise(p, content, opts); - } else { - return this.changeFileTextPromise(p, content, opts); - } - } - async changeFileBufferPromise(p, content, { mode } = {}) { - let current = Buffer.alloc(0); - try { - current = await this.readFilePromise(p); - } catch (error) { - } - if (Buffer.compare(current, content) === 0) - return; - await this.writeFilePromise(p, content, { mode }); - } - async changeFileTextPromise(p, content, { automaticNewlines, mode } = {}) { - let current = ``; - try { - current = await this.readFilePromise(p, `utf8`); - } catch (error) { - } - const normalizedContent = automaticNewlines ? normalizeLineEndings(current, content) : content; - if (current === normalizedContent) - return; - await this.writeFilePromise(p, normalizedContent, { mode }); - } - changeFileSync(p, content, opts = {}) { - if (Buffer.isBuffer(content)) { - return this.changeFileBufferSync(p, content, opts); - } else { - return this.changeFileTextSync(p, content, opts); - } - } - changeFileBufferSync(p, content, { mode } = {}) { - let current = Buffer.alloc(0); - try { - current = this.readFileSync(p); - } catch (error) { - } - if (Buffer.compare(current, content) === 0) - return; - this.writeFileSync(p, content, { mode }); - } - changeFileTextSync(p, content, { automaticNewlines = false, mode } = {}) { - let current = ``; - try { - current = this.readFileSync(p, `utf8`); - } catch (error) { - } - const normalizedContent = automaticNewlines ? normalizeLineEndings(current, content) : content; - if (current === normalizedContent) - return; - this.writeFileSync(p, normalizedContent, { mode }); - } - async movePromise(fromP, toP) { - try { - await this.renamePromise(fromP, toP); - } catch (error) { - if (error.code === `EXDEV`) { - await this.copyPromise(toP, fromP); - await this.removePromise(fromP); - } else { - throw error; - } - } - } - moveSync(fromP, toP) { - try { - this.renameSync(fromP, toP); - } catch (error) { - if (error.code === `EXDEV`) { - this.copySync(toP, fromP); - this.removeSync(fromP); - } else { - throw error; - } - } - } - async lockPromise(affectedPath, callback) { - const lockPath = `${affectedPath}.flock`; - const interval = 1e3 / 60; - const startTime = Date.now(); - let fd = null; - const isAlive = async () => { - let pid; - try { - [pid] = await this.readJsonPromise(lockPath); - } catch (error) { - return Date.now() - startTime < 500; - } - try { - process.kill(pid, 0); - return true; - } catch (error) { - return false; - } - }; - while (fd === null) { - try { - fd = await this.openPromise(lockPath, `wx`); - } catch (error) { - if (error.code === `EEXIST`) { - if (!await isAlive()) { - try { - await this.unlinkPromise(lockPath); - continue; - } catch (error2) { - } - } - if (Date.now() - startTime < 60 * 1e3) { - await new Promise((resolve) => setTimeout(resolve, interval)); - } else { - throw new Error(`Couldn't acquire a lock in a reasonable time (via ${lockPath})`); - } - } else { - throw error; - } - } - } - await this.writePromise(fd, JSON.stringify([process.pid])); - try { - return await callback(); - } finally { - try { - await this.closePromise(fd); - await this.unlinkPromise(lockPath); - } catch (error) { - } - } - } - async readJsonPromise(p) { - const content = await this.readFilePromise(p, `utf8`); - try { - return JSON.parse(content); - } catch (error) { - error.message += ` (in ${p})`; - throw error; - } - } - readJsonSync(p) { - const content = this.readFileSync(p, `utf8`); - try { - return JSON.parse(content); - } catch (error) { - error.message += ` (in ${p})`; - throw error; - } - } - async writeJsonPromise(p, data, { compact = false } = {}) { - const space = compact ? 0 : 2; - return await this.writeFilePromise(p, `${JSON.stringify(data, null, space)} -`); - } - writeJsonSync(p, data, { compact = false } = {}) { - const space = compact ? 0 : 2; - return this.writeFileSync(p, `${JSON.stringify(data, null, space)} -`); - } - async preserveTimePromise(p, cb) { - const stat = await this.lstatPromise(p); - const result = await cb(); - if (typeof result !== `undefined`) - p = result; - await this.lutimesPromise(p, stat.atime, stat.mtime); - } - async preserveTimeSync(p, cb) { - const stat = this.lstatSync(p); - const result = cb(); - if (typeof result !== `undefined`) - p = result; - this.lutimesSync(p, stat.atime, stat.mtime); - } -} -class BasePortableFakeFS extends FakeFS { - constructor() { - super(ppath); - } -} -function getEndOfLine(content) { - const matches = content.match(/\r?\n/g); - if (matches === null) - return os.EOL; - const crlf = matches.filter((nl) => nl === `\r -`).length; - const lf = matches.length - crlf; - return crlf > lf ? `\r -` : ` -`; -} -function normalizeLineEndings(originalContent, newContent) { - return newContent.replace(/\r?\n/g, getEndOfLine(originalContent)); -} - -class ProxiedFS extends FakeFS { - getExtractHint(hints) { - return this.baseFs.getExtractHint(hints); - } - resolve(path) { - return this.mapFromBase(this.baseFs.resolve(this.mapToBase(path))); - } - getRealPath() { - return this.mapFromBase(this.baseFs.getRealPath()); - } - async openPromise(p, flags, mode) { - return this.baseFs.openPromise(this.mapToBase(p), flags, mode); - } - openSync(p, flags, mode) { - return this.baseFs.openSync(this.mapToBase(p), flags, mode); - } - async opendirPromise(p, opts) { - return Object.assign(await this.baseFs.opendirPromise(this.mapToBase(p), opts), { path: p }); - } - opendirSync(p, opts) { - return Object.assign(this.baseFs.opendirSync(this.mapToBase(p), opts), { path: p }); - } - async readPromise(fd, buffer, offset, length, position) { - return await this.baseFs.readPromise(fd, buffer, offset, length, position); - } - readSync(fd, buffer, offset, length, position) { - return this.baseFs.readSync(fd, buffer, offset, length, position); - } - async writePromise(fd, buffer, offset, length, position) { - if (typeof buffer === `string`) { - return await this.baseFs.writePromise(fd, buffer, offset); - } else { - return await this.baseFs.writePromise(fd, buffer, offset, length, position); - } - } - writeSync(fd, buffer, offset, length, position) { - if (typeof buffer === `string`) { - return this.baseFs.writeSync(fd, buffer, offset); - } else { - return this.baseFs.writeSync(fd, buffer, offset, length, position); - } - } - async closePromise(fd) { - return this.baseFs.closePromise(fd); - } - closeSync(fd) { - this.baseFs.closeSync(fd); - } - createReadStream(p, opts) { - return this.baseFs.createReadStream(p !== null ? this.mapToBase(p) : p, opts); - } - createWriteStream(p, opts) { - return this.baseFs.createWriteStream(p !== null ? this.mapToBase(p) : p, opts); - } - async realpathPromise(p) { - return this.mapFromBase(await this.baseFs.realpathPromise(this.mapToBase(p))); - } - realpathSync(p) { - return this.mapFromBase(this.baseFs.realpathSync(this.mapToBase(p))); - } - async existsPromise(p) { - return this.baseFs.existsPromise(this.mapToBase(p)); - } - existsSync(p) { - return this.baseFs.existsSync(this.mapToBase(p)); - } - accessSync(p, mode) { - return this.baseFs.accessSync(this.mapToBase(p), mode); - } - async accessPromise(p, mode) { - return this.baseFs.accessPromise(this.mapToBase(p), mode); - } - async statPromise(p, opts) { - return this.baseFs.statPromise(this.mapToBase(p), opts); - } - statSync(p, opts) { - return this.baseFs.statSync(this.mapToBase(p), opts); - } - async fstatPromise(fd, opts) { - return this.baseFs.fstatPromise(fd, opts); - } - fstatSync(fd, opts) { - return this.baseFs.fstatSync(fd, opts); - } - lstatPromise(p, opts) { - return this.baseFs.lstatPromise(this.mapToBase(p), opts); - } - lstatSync(p, opts) { - return this.baseFs.lstatSync(this.mapToBase(p), opts); - } - async fchmodPromise(fd, mask) { - return this.baseFs.fchmodPromise(fd, mask); - } - fchmodSync(fd, mask) { - return this.baseFs.fchmodSync(fd, mask); - } - async chmodPromise(p, mask) { - return this.baseFs.chmodPromise(this.mapToBase(p), mask); - } - chmodSync(p, mask) { - return this.baseFs.chmodSync(this.mapToBase(p), mask); - } - async fchownPromise(fd, uid, gid) { - return this.baseFs.fchownPromise(fd, uid, gid); - } - fchownSync(fd, uid, gid) { - return this.baseFs.fchownSync(fd, uid, gid); - } - async chownPromise(p, uid, gid) { - return this.baseFs.chownPromise(this.mapToBase(p), uid, gid); - } - chownSync(p, uid, gid) { - return this.baseFs.chownSync(this.mapToBase(p), uid, gid); - } - async renamePromise(oldP, newP) { - return this.baseFs.renamePromise(this.mapToBase(oldP), this.mapToBase(newP)); - } - renameSync(oldP, newP) { - return this.baseFs.renameSync(this.mapToBase(oldP), this.mapToBase(newP)); - } - async copyFilePromise(sourceP, destP, flags = 0) { - return this.baseFs.copyFilePromise(this.mapToBase(sourceP), this.mapToBase(destP), flags); - } - copyFileSync(sourceP, destP, flags = 0) { - return this.baseFs.copyFileSync(this.mapToBase(sourceP), this.mapToBase(destP), flags); - } - async appendFilePromise(p, content, opts) { - return this.baseFs.appendFilePromise(this.fsMapToBase(p), content, opts); - } - appendFileSync(p, content, opts) { - return this.baseFs.appendFileSync(this.fsMapToBase(p), content, opts); - } - async writeFilePromise(p, content, opts) { - return this.baseFs.writeFilePromise(this.fsMapToBase(p), content, opts); - } - writeFileSync(p, content, opts) { - return this.baseFs.writeFileSync(this.fsMapToBase(p), content, opts); - } - async unlinkPromise(p) { - return this.baseFs.unlinkPromise(this.mapToBase(p)); - } - unlinkSync(p) { - return this.baseFs.unlinkSync(this.mapToBase(p)); - } - async utimesPromise(p, atime, mtime) { - return this.baseFs.utimesPromise(this.mapToBase(p), atime, mtime); - } - utimesSync(p, atime, mtime) { - return this.baseFs.utimesSync(this.mapToBase(p), atime, mtime); - } - async lutimesPromise(p, atime, mtime) { - return this.baseFs.lutimesPromise(this.mapToBase(p), atime, mtime); - } - lutimesSync(p, atime, mtime) { - return this.baseFs.lutimesSync(this.mapToBase(p), atime, mtime); - } - async mkdirPromise(p, opts) { - return this.baseFs.mkdirPromise(this.mapToBase(p), opts); - } - mkdirSync(p, opts) { - return this.baseFs.mkdirSync(this.mapToBase(p), opts); - } - async rmdirPromise(p, opts) { - return this.baseFs.rmdirPromise(this.mapToBase(p), opts); - } - rmdirSync(p, opts) { - return this.baseFs.rmdirSync(this.mapToBase(p), opts); - } - async rmPromise(p, opts) { - return this.baseFs.rmPromise(this.mapToBase(p), opts); - } - rmSync(p, opts) { - return this.baseFs.rmSync(this.mapToBase(p), opts); - } - async linkPromise(existingP, newP) { - return this.baseFs.linkPromise(this.mapToBase(existingP), this.mapToBase(newP)); - } - linkSync(existingP, newP) { - return this.baseFs.linkSync(this.mapToBase(existingP), this.mapToBase(newP)); - } - async symlinkPromise(target, p, type) { - const mappedP = this.mapToBase(p); - if (this.pathUtils.isAbsolute(target)) - return this.baseFs.symlinkPromise(this.mapToBase(target), mappedP, type); - const mappedAbsoluteTarget = this.mapToBase(this.pathUtils.join(this.pathUtils.dirname(p), target)); - const mappedTarget = this.baseFs.pathUtils.relative(this.baseFs.pathUtils.dirname(mappedP), mappedAbsoluteTarget); - return this.baseFs.symlinkPromise(mappedTarget, mappedP, type); - } - symlinkSync(target, p, type) { - const mappedP = this.mapToBase(p); - if (this.pathUtils.isAbsolute(target)) - return this.baseFs.symlinkSync(this.mapToBase(target), mappedP, type); - const mappedAbsoluteTarget = this.mapToBase(this.pathUtils.join(this.pathUtils.dirname(p), target)); - const mappedTarget = this.baseFs.pathUtils.relative(this.baseFs.pathUtils.dirname(mappedP), mappedAbsoluteTarget); - return this.baseFs.symlinkSync(mappedTarget, mappedP, type); - } - async readFilePromise(p, encoding) { - return this.baseFs.readFilePromise(this.fsMapToBase(p), encoding); - } - readFileSync(p, encoding) { - return this.baseFs.readFileSync(this.fsMapToBase(p), encoding); - } - readdirPromise(p, opts) { - return this.baseFs.readdirPromise(this.mapToBase(p), opts); - } - readdirSync(p, opts) { - return this.baseFs.readdirSync(this.mapToBase(p), opts); - } - async readlinkPromise(p) { - return this.mapFromBase(await this.baseFs.readlinkPromise(this.mapToBase(p))); - } - readlinkSync(p) { - return this.mapFromBase(this.baseFs.readlinkSync(this.mapToBase(p))); - } - async truncatePromise(p, len) { - return this.baseFs.truncatePromise(this.mapToBase(p), len); - } - truncateSync(p, len) { - return this.baseFs.truncateSync(this.mapToBase(p), len); - } - async ftruncatePromise(fd, len) { - return this.baseFs.ftruncatePromise(fd, len); - } - ftruncateSync(fd, len) { - return this.baseFs.ftruncateSync(fd, len); - } - watch(p, a, b) { - return this.baseFs.watch( - this.mapToBase(p), - a, - b - ); - } - watchFile(p, a, b) { - return this.baseFs.watchFile( - this.mapToBase(p), - a, - b - ); - } - unwatchFile(p, cb) { - return this.baseFs.unwatchFile(this.mapToBase(p), cb); - } - fsMapToBase(p) { - if (typeof p === `number`) { - return p; - } else { - return this.mapToBase(p); - } - } -} - -function direntToPortable(dirent) { - const portableDirent = dirent; - if (typeof dirent.path === `string`) - portableDirent.path = npath.toPortablePath(dirent.path); - return portableDirent; -} -class NodeFS extends BasePortableFakeFS { - constructor(realFs = fs__default.default) { - super(); - this.realFs = realFs; - } - getExtractHint() { - return false; - } - getRealPath() { - return PortablePath.root; - } - resolve(p) { - return ppath.resolve(p); - } - async openPromise(p, flags, mode) { - return await new Promise((resolve, reject) => { - this.realFs.open(npath.fromPortablePath(p), flags, mode, this.makeCallback(resolve, reject)); - }); - } - openSync(p, flags, mode) { - return this.realFs.openSync(npath.fromPortablePath(p), flags, mode); - } - async opendirPromise(p, opts) { - return await new Promise((resolve, reject) => { - if (typeof opts !== `undefined`) { - this.realFs.opendir(npath.fromPortablePath(p), opts, this.makeCallback(resolve, reject)); - } else { - this.realFs.opendir(npath.fromPortablePath(p), this.makeCallback(resolve, reject)); - } - }).then((dir) => { - const dirWithFixedPath = dir; - Object.defineProperty(dirWithFixedPath, `path`, { - value: p, - configurable: true, - writable: true - }); - return dirWithFixedPath; - }); - } - opendirSync(p, opts) { - const dir = typeof opts !== `undefined` ? this.realFs.opendirSync(npath.fromPortablePath(p), opts) : this.realFs.opendirSync(npath.fromPortablePath(p)); - const dirWithFixedPath = dir; - Object.defineProperty(dirWithFixedPath, `path`, { - value: p, - configurable: true, - writable: true - }); - return dirWithFixedPath; - } - async readPromise(fd, buffer, offset = 0, length = 0, position = -1) { - return await new Promise((resolve, reject) => { - this.realFs.read(fd, buffer, offset, length, position, (error, bytesRead) => { - if (error) { - reject(error); - } else { - resolve(bytesRead); - } - }); - }); - } - readSync(fd, buffer, offset, length, position) { - return this.realFs.readSync(fd, buffer, offset, length, position); - } - async writePromise(fd, buffer, offset, length, position) { - return await new Promise((resolve, reject) => { - if (typeof buffer === `string`) { - return this.realFs.write(fd, buffer, offset, this.makeCallback(resolve, reject)); - } else { - return this.realFs.write(fd, buffer, offset, length, position, this.makeCallback(resolve, reject)); - } - }); - } - writeSync(fd, buffer, offset, length, position) { - if (typeof buffer === `string`) { - return this.realFs.writeSync(fd, buffer, offset); - } else { - return this.realFs.writeSync(fd, buffer, offset, length, position); - } - } - async closePromise(fd) { - await new Promise((resolve, reject) => { - this.realFs.close(fd, this.makeCallback(resolve, reject)); - }); - } - closeSync(fd) { - this.realFs.closeSync(fd); - } - createReadStream(p, opts) { - const realPath = p !== null ? npath.fromPortablePath(p) : p; - return this.realFs.createReadStream(realPath, opts); - } - createWriteStream(p, opts) { - const realPath = p !== null ? npath.fromPortablePath(p) : p; - return this.realFs.createWriteStream(realPath, opts); - } - async realpathPromise(p) { - return await new Promise((resolve, reject) => { - this.realFs.realpath(npath.fromPortablePath(p), {}, this.makeCallback(resolve, reject)); - }).then((path) => { - return npath.toPortablePath(path); - }); - } - realpathSync(p) { - return npath.toPortablePath(this.realFs.realpathSync(npath.fromPortablePath(p), {})); - } - async existsPromise(p) { - return await new Promise((resolve) => { - this.realFs.exists(npath.fromPortablePath(p), resolve); - }); - } - accessSync(p, mode) { - return this.realFs.accessSync(npath.fromPortablePath(p), mode); - } - async accessPromise(p, mode) { - return await new Promise((resolve, reject) => { - this.realFs.access(npath.fromPortablePath(p), mode, this.makeCallback(resolve, reject)); - }); - } - existsSync(p) { - return this.realFs.existsSync(npath.fromPortablePath(p)); - } - async statPromise(p, opts) { - return await new Promise((resolve, reject) => { - if (opts) { - this.realFs.stat(npath.fromPortablePath(p), opts, this.makeCallback(resolve, reject)); - } else { - this.realFs.stat(npath.fromPortablePath(p), this.makeCallback(resolve, reject)); - } - }); - } - statSync(p, opts) { - if (opts) { - return this.realFs.statSync(npath.fromPortablePath(p), opts); - } else { - return this.realFs.statSync(npath.fromPortablePath(p)); - } - } - async fstatPromise(fd, opts) { - return await new Promise((resolve, reject) => { - if (opts) { - this.realFs.fstat(fd, opts, this.makeCallback(resolve, reject)); - } else { - this.realFs.fstat(fd, this.makeCallback(resolve, reject)); - } - }); - } - fstatSync(fd, opts) { - if (opts) { - return this.realFs.fstatSync(fd, opts); - } else { - return this.realFs.fstatSync(fd); - } - } - async lstatPromise(p, opts) { - return await new Promise((resolve, reject) => { - if (opts) { - this.realFs.lstat(npath.fromPortablePath(p), opts, this.makeCallback(resolve, reject)); - } else { - this.realFs.lstat(npath.fromPortablePath(p), this.makeCallback(resolve, reject)); - } - }); - } - lstatSync(p, opts) { - if (opts) { - return this.realFs.lstatSync(npath.fromPortablePath(p), opts); - } else { - return this.realFs.lstatSync(npath.fromPortablePath(p)); - } - } - async fchmodPromise(fd, mask) { - return await new Promise((resolve, reject) => { - this.realFs.fchmod(fd, mask, this.makeCallback(resolve, reject)); - }); - } - fchmodSync(fd, mask) { - return this.realFs.fchmodSync(fd, mask); - } - async chmodPromise(p, mask) { - return await new Promise((resolve, reject) => { - this.realFs.chmod(npath.fromPortablePath(p), mask, this.makeCallback(resolve, reject)); - }); - } - chmodSync(p, mask) { - return this.realFs.chmodSync(npath.fromPortablePath(p), mask); - } - async fchownPromise(fd, uid, gid) { - return await new Promise((resolve, reject) => { - this.realFs.fchown(fd, uid, gid, this.makeCallback(resolve, reject)); - }); - } - fchownSync(fd, uid, gid) { - return this.realFs.fchownSync(fd, uid, gid); - } - async chownPromise(p, uid, gid) { - return await new Promise((resolve, reject) => { - this.realFs.chown(npath.fromPortablePath(p), uid, gid, this.makeCallback(resolve, reject)); - }); - } - chownSync(p, uid, gid) { - return this.realFs.chownSync(npath.fromPortablePath(p), uid, gid); - } - async renamePromise(oldP, newP) { - return await new Promise((resolve, reject) => { - this.realFs.rename(npath.fromPortablePath(oldP), npath.fromPortablePath(newP), this.makeCallback(resolve, reject)); - }); - } - renameSync(oldP, newP) { - return this.realFs.renameSync(npath.fromPortablePath(oldP), npath.fromPortablePath(newP)); - } - async copyFilePromise(sourceP, destP, flags = 0) { - return await new Promise((resolve, reject) => { - this.realFs.copyFile(npath.fromPortablePath(sourceP), npath.fromPortablePath(destP), flags, this.makeCallback(resolve, reject)); - }); - } - copyFileSync(sourceP, destP, flags = 0) { - return this.realFs.copyFileSync(npath.fromPortablePath(sourceP), npath.fromPortablePath(destP), flags); - } - async appendFilePromise(p, content, opts) { - return await new Promise((resolve, reject) => { - const fsNativePath = typeof p === `string` ? npath.fromPortablePath(p) : p; - if (opts) { - this.realFs.appendFile(fsNativePath, content, opts, this.makeCallback(resolve, reject)); - } else { - this.realFs.appendFile(fsNativePath, content, this.makeCallback(resolve, reject)); - } - }); - } - appendFileSync(p, content, opts) { - const fsNativePath = typeof p === `string` ? npath.fromPortablePath(p) : p; - if (opts) { - this.realFs.appendFileSync(fsNativePath, content, opts); - } else { - this.realFs.appendFileSync(fsNativePath, content); - } - } - async writeFilePromise(p, content, opts) { - return await new Promise((resolve, reject) => { - const fsNativePath = typeof p === `string` ? npath.fromPortablePath(p) : p; - if (opts) { - this.realFs.writeFile(fsNativePath, content, opts, this.makeCallback(resolve, reject)); - } else { - this.realFs.writeFile(fsNativePath, content, this.makeCallback(resolve, reject)); - } - }); - } - writeFileSync(p, content, opts) { - const fsNativePath = typeof p === `string` ? npath.fromPortablePath(p) : p; - if (opts) { - this.realFs.writeFileSync(fsNativePath, content, opts); - } else { - this.realFs.writeFileSync(fsNativePath, content); - } - } - async unlinkPromise(p) { - return await new Promise((resolve, reject) => { - this.realFs.unlink(npath.fromPortablePath(p), this.makeCallback(resolve, reject)); - }); - } - unlinkSync(p) { - return this.realFs.unlinkSync(npath.fromPortablePath(p)); - } - async utimesPromise(p, atime, mtime) { - return await new Promise((resolve, reject) => { - this.realFs.utimes(npath.fromPortablePath(p), atime, mtime, this.makeCallback(resolve, reject)); - }); - } - utimesSync(p, atime, mtime) { - this.realFs.utimesSync(npath.fromPortablePath(p), atime, mtime); - } - async lutimesPromise(p, atime, mtime) { - return await new Promise((resolve, reject) => { - this.realFs.lutimes(npath.fromPortablePath(p), atime, mtime, this.makeCallback(resolve, reject)); - }); - } - lutimesSync(p, atime, mtime) { - this.realFs.lutimesSync(npath.fromPortablePath(p), atime, mtime); - } - async mkdirPromise(p, opts) { - return await new Promise((resolve, reject) => { - this.realFs.mkdir(npath.fromPortablePath(p), opts, this.makeCallback(resolve, reject)); - }); - } - mkdirSync(p, opts) { - return this.realFs.mkdirSync(npath.fromPortablePath(p), opts); - } - async rmdirPromise(p, opts) { - return await new Promise((resolve, reject) => { - if (opts) { - this.realFs.rmdir(npath.fromPortablePath(p), opts, this.makeCallback(resolve, reject)); - } else { - this.realFs.rmdir(npath.fromPortablePath(p), this.makeCallback(resolve, reject)); - } - }); - } - rmdirSync(p, opts) { - return this.realFs.rmdirSync(npath.fromPortablePath(p), opts); - } - async rmPromise(p, opts) { - return await new Promise((resolve, reject) => { - if (opts) { - this.realFs.rm(npath.fromPortablePath(p), opts, this.makeCallback(resolve, reject)); - } else { - this.realFs.rm(npath.fromPortablePath(p), this.makeCallback(resolve, reject)); - } - }); - } - rmSync(p, opts) { - return this.realFs.rmSync(npath.fromPortablePath(p), opts); - } - async linkPromise(existingP, newP) { - return await new Promise((resolve, reject) => { - this.realFs.link(npath.fromPortablePath(existingP), npath.fromPortablePath(newP), this.makeCallback(resolve, reject)); - }); - } - linkSync(existingP, newP) { - return this.realFs.linkSync(npath.fromPortablePath(existingP), npath.fromPortablePath(newP)); - } - async symlinkPromise(target, p, type) { - return await new Promise((resolve, reject) => { - this.realFs.symlink(npath.fromPortablePath(target.replace(/\/+$/, ``)), npath.fromPortablePath(p), type, this.makeCallback(resolve, reject)); - }); - } - symlinkSync(target, p, type) { - return this.realFs.symlinkSync(npath.fromPortablePath(target.replace(/\/+$/, ``)), npath.fromPortablePath(p), type); - } - async readFilePromise(p, encoding) { - return await new Promise((resolve, reject) => { - const fsNativePath = typeof p === `string` ? npath.fromPortablePath(p) : p; - this.realFs.readFile(fsNativePath, encoding, this.makeCallback(resolve, reject)); - }); - } - readFileSync(p, encoding) { - const fsNativePath = typeof p === `string` ? npath.fromPortablePath(p) : p; - return this.realFs.readFileSync(fsNativePath, encoding); - } - async readdirPromise(p, opts) { - return await new Promise((resolve, reject) => { - if (opts) { - if (opts.recursive && process.platform === `win32`) { - if (opts.withFileTypes) { - this.realFs.readdir(npath.fromPortablePath(p), opts, this.makeCallback((results) => resolve(results.map(direntToPortable)), reject)); - } else { - this.realFs.readdir(npath.fromPortablePath(p), opts, this.makeCallback((results) => resolve(results.map(npath.toPortablePath)), reject)); - } - } else { - this.realFs.readdir(npath.fromPortablePath(p), opts, this.makeCallback(resolve, reject)); - } - } else { - this.realFs.readdir(npath.fromPortablePath(p), this.makeCallback(resolve, reject)); - } - }); - } - readdirSync(p, opts) { - if (opts) { - if (opts.recursive && process.platform === `win32`) { - if (opts.withFileTypes) { - return this.realFs.readdirSync(npath.fromPortablePath(p), opts).map(direntToPortable); - } else { - return this.realFs.readdirSync(npath.fromPortablePath(p), opts).map(npath.toPortablePath); - } - } else { - return this.realFs.readdirSync(npath.fromPortablePath(p), opts); - } - } else { - return this.realFs.readdirSync(npath.fromPortablePath(p)); - } - } - async readlinkPromise(p) { - return await new Promise((resolve, reject) => { - this.realFs.readlink(npath.fromPortablePath(p), this.makeCallback(resolve, reject)); - }).then((path) => { - return npath.toPortablePath(path); - }); - } - readlinkSync(p) { - return npath.toPortablePath(this.realFs.readlinkSync(npath.fromPortablePath(p))); - } - async truncatePromise(p, len) { - return await new Promise((resolve, reject) => { - this.realFs.truncate(npath.fromPortablePath(p), len, this.makeCallback(resolve, reject)); - }); - } - truncateSync(p, len) { - return this.realFs.truncateSync(npath.fromPortablePath(p), len); - } - async ftruncatePromise(fd, len) { - return await new Promise((resolve, reject) => { - this.realFs.ftruncate(fd, len, this.makeCallback(resolve, reject)); - }); - } - ftruncateSync(fd, len) { - return this.realFs.ftruncateSync(fd, len); - } - watch(p, a, b) { - return this.realFs.watch( - npath.fromPortablePath(p), - a, - b - ); - } - watchFile(p, a, b) { - return this.realFs.watchFile( - npath.fromPortablePath(p), - a, - b - ); - } - unwatchFile(p, cb) { - return this.realFs.unwatchFile(npath.fromPortablePath(p), cb); - } - makeCallback(resolve, reject) { - return (err, result) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }; - } -} - -const MOUNT_MASK = 4278190080; -class MountFS extends BasePortableFakeFS { - constructor({ baseFs = new NodeFS(), filter = null, magicByte = 42, maxOpenFiles = Infinity, useCache = true, maxAge = 5e3, typeCheck = fs.constants.S_IFREG, getMountPoint, factoryPromise, factorySync }) { - if (Math.floor(magicByte) !== magicByte || !(magicByte > 1 && magicByte <= 127)) - throw new Error(`The magic byte must be set to a round value between 1 and 127 included`); - super(); - this.fdMap = /* @__PURE__ */ new Map(); - this.nextFd = 3; - this.isMount = /* @__PURE__ */ new Set(); - this.notMount = /* @__PURE__ */ new Set(); - this.realPaths = /* @__PURE__ */ new Map(); - this.limitOpenFilesTimeout = null; - this.baseFs = baseFs; - this.mountInstances = useCache ? /* @__PURE__ */ new Map() : null; - this.factoryPromise = factoryPromise; - this.factorySync = factorySync; - this.filter = filter; - this.getMountPoint = getMountPoint; - this.magic = magicByte << 24; - this.maxAge = maxAge; - this.maxOpenFiles = maxOpenFiles; - this.typeCheck = typeCheck; - } - getExtractHint(hints) { - return this.baseFs.getExtractHint(hints); - } - getRealPath() { - return this.baseFs.getRealPath(); - } - saveAndClose() { - unwatchAllFiles(this); - if (this.mountInstances) { - for (const [path, { childFs }] of this.mountInstances.entries()) { - childFs.saveAndClose?.(); - this.mountInstances.delete(path); - } - } - } - discardAndClose() { - unwatchAllFiles(this); - if (this.mountInstances) { - for (const [path, { childFs }] of this.mountInstances.entries()) { - childFs.discardAndClose?.(); - this.mountInstances.delete(path); - } - } - } - resolve(p) { - return this.baseFs.resolve(p); - } - remapFd(mountFs, fd) { - const remappedFd = this.nextFd++ | this.magic; - this.fdMap.set(remappedFd, [mountFs, fd]); - return remappedFd; - } - async openPromise(p, flags, mode) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.openPromise(p, flags, mode); - }, async (mountFs, { subPath }) => { - return this.remapFd(mountFs, await mountFs.openPromise(subPath, flags, mode)); - }); - } - openSync(p, flags, mode) { - return this.makeCallSync(p, () => { - return this.baseFs.openSync(p, flags, mode); - }, (mountFs, { subPath }) => { - return this.remapFd(mountFs, mountFs.openSync(subPath, flags, mode)); - }); - } - async opendirPromise(p, opts) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.opendirPromise(p, opts); - }, async (mountFs, { subPath }) => { - return await mountFs.opendirPromise(subPath, opts); - }, { - requireSubpath: false - }); - } - opendirSync(p, opts) { - return this.makeCallSync(p, () => { - return this.baseFs.opendirSync(p, opts); - }, (mountFs, { subPath }) => { - return mountFs.opendirSync(subPath, opts); - }, { - requireSubpath: false - }); - } - async readPromise(fd, buffer, offset, length, position) { - if ((fd & MOUNT_MASK) !== this.magic) - return await this.baseFs.readPromise(fd, buffer, offset, length, position); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`read`); - const [mountFs, realFd] = entry; - return await mountFs.readPromise(realFd, buffer, offset, length, position); - } - readSync(fd, buffer, offset, length, position) { - if ((fd & MOUNT_MASK) !== this.magic) - return this.baseFs.readSync(fd, buffer, offset, length, position); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`readSync`); - const [mountFs, realFd] = entry; - return mountFs.readSync(realFd, buffer, offset, length, position); - } - async writePromise(fd, buffer, offset, length, position) { - if ((fd & MOUNT_MASK) !== this.magic) { - if (typeof buffer === `string`) { - return await this.baseFs.writePromise(fd, buffer, offset); - } else { - return await this.baseFs.writePromise(fd, buffer, offset, length, position); - } - } - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`write`); - const [mountFs, realFd] = entry; - if (typeof buffer === `string`) { - return await mountFs.writePromise(realFd, buffer, offset); - } else { - return await mountFs.writePromise(realFd, buffer, offset, length, position); - } - } - writeSync(fd, buffer, offset, length, position) { - if ((fd & MOUNT_MASK) !== this.magic) { - if (typeof buffer === `string`) { - return this.baseFs.writeSync(fd, buffer, offset); - } else { - return this.baseFs.writeSync(fd, buffer, offset, length, position); - } - } - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`writeSync`); - const [mountFs, realFd] = entry; - if (typeof buffer === `string`) { - return mountFs.writeSync(realFd, buffer, offset); - } else { - return mountFs.writeSync(realFd, buffer, offset, length, position); - } - } - async closePromise(fd) { - if ((fd & MOUNT_MASK) !== this.magic) - return await this.baseFs.closePromise(fd); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`close`); - this.fdMap.delete(fd); - const [mountFs, realFd] = entry; - return await mountFs.closePromise(realFd); - } - closeSync(fd) { - if ((fd & MOUNT_MASK) !== this.magic) - return this.baseFs.closeSync(fd); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`closeSync`); - this.fdMap.delete(fd); - const [mountFs, realFd] = entry; - return mountFs.closeSync(realFd); - } - createReadStream(p, opts) { - if (p === null) - return this.baseFs.createReadStream(p, opts); - return this.makeCallSync(p, () => { - return this.baseFs.createReadStream(p, opts); - }, (mountFs, { archivePath, subPath }) => { - const stream = mountFs.createReadStream(subPath, opts); - stream.path = npath.fromPortablePath(this.pathUtils.join(archivePath, subPath)); - return stream; - }); - } - createWriteStream(p, opts) { - if (p === null) - return this.baseFs.createWriteStream(p, opts); - return this.makeCallSync(p, () => { - return this.baseFs.createWriteStream(p, opts); - }, (mountFs, { subPath }) => { - return mountFs.createWriteStream(subPath, opts); - }); - } - async realpathPromise(p) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.realpathPromise(p); - }, async (mountFs, { archivePath, subPath }) => { - let realArchivePath = this.realPaths.get(archivePath); - if (typeof realArchivePath === `undefined`) { - realArchivePath = await this.baseFs.realpathPromise(archivePath); - this.realPaths.set(archivePath, realArchivePath); - } - return this.pathUtils.join(realArchivePath, this.pathUtils.relative(PortablePath.root, await mountFs.realpathPromise(subPath))); - }); - } - realpathSync(p) { - return this.makeCallSync(p, () => { - return this.baseFs.realpathSync(p); - }, (mountFs, { archivePath, subPath }) => { - let realArchivePath = this.realPaths.get(archivePath); - if (typeof realArchivePath === `undefined`) { - realArchivePath = this.baseFs.realpathSync(archivePath); - this.realPaths.set(archivePath, realArchivePath); - } - return this.pathUtils.join(realArchivePath, this.pathUtils.relative(PortablePath.root, mountFs.realpathSync(subPath))); - }); - } - async existsPromise(p) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.existsPromise(p); - }, async (mountFs, { subPath }) => { - return await mountFs.existsPromise(subPath); - }); - } - existsSync(p) { - return this.makeCallSync(p, () => { - return this.baseFs.existsSync(p); - }, (mountFs, { subPath }) => { - return mountFs.existsSync(subPath); - }); - } - async accessPromise(p, mode) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.accessPromise(p, mode); - }, async (mountFs, { subPath }) => { - return await mountFs.accessPromise(subPath, mode); - }); - } - accessSync(p, mode) { - return this.makeCallSync(p, () => { - return this.baseFs.accessSync(p, mode); - }, (mountFs, { subPath }) => { - return mountFs.accessSync(subPath, mode); - }); - } - async statPromise(p, opts) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.statPromise(p, opts); - }, async (mountFs, { subPath }) => { - return await mountFs.statPromise(subPath, opts); - }); - } - statSync(p, opts) { - return this.makeCallSync(p, () => { - return this.baseFs.statSync(p, opts); - }, (mountFs, { subPath }) => { - return mountFs.statSync(subPath, opts); - }); - } - async fstatPromise(fd, opts) { - if ((fd & MOUNT_MASK) !== this.magic) - return this.baseFs.fstatPromise(fd, opts); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`fstat`); - const [mountFs, realFd] = entry; - return mountFs.fstatPromise(realFd, opts); - } - fstatSync(fd, opts) { - if ((fd & MOUNT_MASK) !== this.magic) - return this.baseFs.fstatSync(fd, opts); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`fstatSync`); - const [mountFs, realFd] = entry; - return mountFs.fstatSync(realFd, opts); - } - async lstatPromise(p, opts) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.lstatPromise(p, opts); - }, async (mountFs, { subPath }) => { - return await mountFs.lstatPromise(subPath, opts); - }); - } - lstatSync(p, opts) { - return this.makeCallSync(p, () => { - return this.baseFs.lstatSync(p, opts); - }, (mountFs, { subPath }) => { - return mountFs.lstatSync(subPath, opts); - }); - } - async fchmodPromise(fd, mask) { - if ((fd & MOUNT_MASK) !== this.magic) - return this.baseFs.fchmodPromise(fd, mask); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`fchmod`); - const [mountFs, realFd] = entry; - return mountFs.fchmodPromise(realFd, mask); - } - fchmodSync(fd, mask) { - if ((fd & MOUNT_MASK) !== this.magic) - return this.baseFs.fchmodSync(fd, mask); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`fchmodSync`); - const [mountFs, realFd] = entry; - return mountFs.fchmodSync(realFd, mask); - } - async chmodPromise(p, mask) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.chmodPromise(p, mask); - }, async (mountFs, { subPath }) => { - return await mountFs.chmodPromise(subPath, mask); - }); - } - chmodSync(p, mask) { - return this.makeCallSync(p, () => { - return this.baseFs.chmodSync(p, mask); - }, (mountFs, { subPath }) => { - return mountFs.chmodSync(subPath, mask); - }); - } - async fchownPromise(fd, uid, gid) { - if ((fd & MOUNT_MASK) !== this.magic) - return this.baseFs.fchownPromise(fd, uid, gid); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`fchown`); - const [zipFs, realFd] = entry; - return zipFs.fchownPromise(realFd, uid, gid); - } - fchownSync(fd, uid, gid) { - if ((fd & MOUNT_MASK) !== this.magic) - return this.baseFs.fchownSync(fd, uid, gid); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`fchownSync`); - const [zipFs, realFd] = entry; - return zipFs.fchownSync(realFd, uid, gid); - } - async chownPromise(p, uid, gid) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.chownPromise(p, uid, gid); - }, async (mountFs, { subPath }) => { - return await mountFs.chownPromise(subPath, uid, gid); - }); - } - chownSync(p, uid, gid) { - return this.makeCallSync(p, () => { - return this.baseFs.chownSync(p, uid, gid); - }, (mountFs, { subPath }) => { - return mountFs.chownSync(subPath, uid, gid); - }); - } - async renamePromise(oldP, newP) { - return await this.makeCallPromise(oldP, async () => { - return await this.makeCallPromise(newP, async () => { - return await this.baseFs.renamePromise(oldP, newP); - }, async () => { - throw Object.assign(new Error(`EEXDEV: cross-device link not permitted`), { code: `EEXDEV` }); - }); - }, async (mountFsO, { subPath: subPathO }) => { - return await this.makeCallPromise(newP, async () => { - throw Object.assign(new Error(`EEXDEV: cross-device link not permitted`), { code: `EEXDEV` }); - }, async (mountFsN, { subPath: subPathN }) => { - if (mountFsO !== mountFsN) { - throw Object.assign(new Error(`EEXDEV: cross-device link not permitted`), { code: `EEXDEV` }); - } else { - return await mountFsO.renamePromise(subPathO, subPathN); - } - }); - }); - } - renameSync(oldP, newP) { - return this.makeCallSync(oldP, () => { - return this.makeCallSync(newP, () => { - return this.baseFs.renameSync(oldP, newP); - }, () => { - throw Object.assign(new Error(`EEXDEV: cross-device link not permitted`), { code: `EEXDEV` }); - }); - }, (mountFsO, { subPath: subPathO }) => { - return this.makeCallSync(newP, () => { - throw Object.assign(new Error(`EEXDEV: cross-device link not permitted`), { code: `EEXDEV` }); - }, (mountFsN, { subPath: subPathN }) => { - if (mountFsO !== mountFsN) { - throw Object.assign(new Error(`EEXDEV: cross-device link not permitted`), { code: `EEXDEV` }); - } else { - return mountFsO.renameSync(subPathO, subPathN); - } - }); - }); - } - async copyFilePromise(sourceP, destP, flags = 0) { - const fallback = async (sourceFs, sourceP2, destFs, destP2) => { - if ((flags & fs.constants.COPYFILE_FICLONE_FORCE) !== 0) - throw Object.assign(new Error(`EXDEV: cross-device clone not permitted, copyfile '${sourceP2}' -> ${destP2}'`), { code: `EXDEV` }); - if (flags & fs.constants.COPYFILE_EXCL && await this.existsPromise(sourceP2)) - throw Object.assign(new Error(`EEXIST: file already exists, copyfile '${sourceP2}' -> '${destP2}'`), { code: `EEXIST` }); - let content; - try { - content = await sourceFs.readFilePromise(sourceP2); - } catch (error) { - throw Object.assign(new Error(`EINVAL: invalid argument, copyfile '${sourceP2}' -> '${destP2}'`), { code: `EINVAL` }); - } - await destFs.writeFilePromise(destP2, content); - }; - return await this.makeCallPromise(sourceP, async () => { - return await this.makeCallPromise(destP, async () => { - return await this.baseFs.copyFilePromise(sourceP, destP, flags); - }, async (mountFsD, { subPath: subPathD }) => { - return await fallback(this.baseFs, sourceP, mountFsD, subPathD); - }); - }, async (mountFsS, { subPath: subPathS }) => { - return await this.makeCallPromise(destP, async () => { - return await fallback(mountFsS, subPathS, this.baseFs, destP); - }, async (mountFsD, { subPath: subPathD }) => { - if (mountFsS !== mountFsD) { - return await fallback(mountFsS, subPathS, mountFsD, subPathD); - } else { - return await mountFsS.copyFilePromise(subPathS, subPathD, flags); - } - }); - }); - } - copyFileSync(sourceP, destP, flags = 0) { - const fallback = (sourceFs, sourceP2, destFs, destP2) => { - if ((flags & fs.constants.COPYFILE_FICLONE_FORCE) !== 0) - throw Object.assign(new Error(`EXDEV: cross-device clone not permitted, copyfile '${sourceP2}' -> ${destP2}'`), { code: `EXDEV` }); - if (flags & fs.constants.COPYFILE_EXCL && this.existsSync(sourceP2)) - throw Object.assign(new Error(`EEXIST: file already exists, copyfile '${sourceP2}' -> '${destP2}'`), { code: `EEXIST` }); - let content; - try { - content = sourceFs.readFileSync(sourceP2); - } catch (error) { - throw Object.assign(new Error(`EINVAL: invalid argument, copyfile '${sourceP2}' -> '${destP2}'`), { code: `EINVAL` }); - } - destFs.writeFileSync(destP2, content); - }; - return this.makeCallSync(sourceP, () => { - return this.makeCallSync(destP, () => { - return this.baseFs.copyFileSync(sourceP, destP, flags); - }, (mountFsD, { subPath: subPathD }) => { - return fallback(this.baseFs, sourceP, mountFsD, subPathD); - }); - }, (mountFsS, { subPath: subPathS }) => { - return this.makeCallSync(destP, () => { - return fallback(mountFsS, subPathS, this.baseFs, destP); - }, (mountFsD, { subPath: subPathD }) => { - if (mountFsS !== mountFsD) { - return fallback(mountFsS, subPathS, mountFsD, subPathD); - } else { - return mountFsS.copyFileSync(subPathS, subPathD, flags); - } - }); - }); - } - async appendFilePromise(p, content, opts) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.appendFilePromise(p, content, opts); - }, async (mountFs, { subPath }) => { - return await mountFs.appendFilePromise(subPath, content, opts); - }); - } - appendFileSync(p, content, opts) { - return this.makeCallSync(p, () => { - return this.baseFs.appendFileSync(p, content, opts); - }, (mountFs, { subPath }) => { - return mountFs.appendFileSync(subPath, content, opts); - }); - } - async writeFilePromise(p, content, opts) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.writeFilePromise(p, content, opts); - }, async (mountFs, { subPath }) => { - return await mountFs.writeFilePromise(subPath, content, opts); - }); - } - writeFileSync(p, content, opts) { - return this.makeCallSync(p, () => { - return this.baseFs.writeFileSync(p, content, opts); - }, (mountFs, { subPath }) => { - return mountFs.writeFileSync(subPath, content, opts); - }); - } - async unlinkPromise(p) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.unlinkPromise(p); - }, async (mountFs, { subPath }) => { - return await mountFs.unlinkPromise(subPath); - }); - } - unlinkSync(p) { - return this.makeCallSync(p, () => { - return this.baseFs.unlinkSync(p); - }, (mountFs, { subPath }) => { - return mountFs.unlinkSync(subPath); - }); - } - async utimesPromise(p, atime, mtime) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.utimesPromise(p, atime, mtime); - }, async (mountFs, { subPath }) => { - return await mountFs.utimesPromise(subPath, atime, mtime); - }); - } - utimesSync(p, atime, mtime) { - return this.makeCallSync(p, () => { - return this.baseFs.utimesSync(p, atime, mtime); - }, (mountFs, { subPath }) => { - return mountFs.utimesSync(subPath, atime, mtime); - }); - } - async lutimesPromise(p, atime, mtime) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.lutimesPromise(p, atime, mtime); - }, async (mountFs, { subPath }) => { - return await mountFs.lutimesPromise(subPath, atime, mtime); - }); - } - lutimesSync(p, atime, mtime) { - return this.makeCallSync(p, () => { - return this.baseFs.lutimesSync(p, atime, mtime); - }, (mountFs, { subPath }) => { - return mountFs.lutimesSync(subPath, atime, mtime); - }); - } - async mkdirPromise(p, opts) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.mkdirPromise(p, opts); - }, async (mountFs, { subPath }) => { - return await mountFs.mkdirPromise(subPath, opts); - }); - } - mkdirSync(p, opts) { - return this.makeCallSync(p, () => { - return this.baseFs.mkdirSync(p, opts); - }, (mountFs, { subPath }) => { - return mountFs.mkdirSync(subPath, opts); - }); - } - async rmdirPromise(p, opts) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.rmdirPromise(p, opts); - }, async (mountFs, { subPath }) => { - return await mountFs.rmdirPromise(subPath, opts); - }); - } - rmdirSync(p, opts) { - return this.makeCallSync(p, () => { - return this.baseFs.rmdirSync(p, opts); - }, (mountFs, { subPath }) => { - return mountFs.rmdirSync(subPath, opts); - }); - } - async rmPromise(p, opts) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.rmPromise(p, opts); - }, async (mountFs, { subPath }) => { - return await mountFs.rmPromise(subPath, opts); - }); - } - rmSync(p, opts) { - return this.makeCallSync(p, () => { - return this.baseFs.rmSync(p, opts); - }, (mountFs, { subPath }) => { - return mountFs.rmSync(subPath, opts); - }); - } - async linkPromise(existingP, newP) { - return await this.makeCallPromise(newP, async () => { - return await this.baseFs.linkPromise(existingP, newP); - }, async (mountFs, { subPath }) => { - return await mountFs.linkPromise(existingP, subPath); - }); - } - linkSync(existingP, newP) { - return this.makeCallSync(newP, () => { - return this.baseFs.linkSync(existingP, newP); - }, (mountFs, { subPath }) => { - return mountFs.linkSync(existingP, subPath); - }); - } - async symlinkPromise(target, p, type) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.symlinkPromise(target, p, type); - }, async (mountFs, { subPath }) => { - return await mountFs.symlinkPromise(target, subPath); - }); - } - symlinkSync(target, p, type) { - return this.makeCallSync(p, () => { - return this.baseFs.symlinkSync(target, p, type); - }, (mountFs, { subPath }) => { - return mountFs.symlinkSync(target, subPath); - }); - } - async readFilePromise(p, encoding) { - return this.makeCallPromise(p, async () => { - return await this.baseFs.readFilePromise(p, encoding); - }, async (mountFs, { subPath }) => { - return await mountFs.readFilePromise(subPath, encoding); - }); - } - readFileSync(p, encoding) { - return this.makeCallSync(p, () => { - return this.baseFs.readFileSync(p, encoding); - }, (mountFs, { subPath }) => { - return mountFs.readFileSync(subPath, encoding); - }); - } - async readdirPromise(p, opts) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.readdirPromise(p, opts); - }, async (mountFs, { subPath }) => { - return await mountFs.readdirPromise(subPath, opts); - }, { - requireSubpath: false - }); - } - readdirSync(p, opts) { - return this.makeCallSync(p, () => { - return this.baseFs.readdirSync(p, opts); - }, (mountFs, { subPath }) => { - return mountFs.readdirSync(subPath, opts); - }, { - requireSubpath: false - }); - } - async readlinkPromise(p) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.readlinkPromise(p); - }, async (mountFs, { subPath }) => { - return await mountFs.readlinkPromise(subPath); - }); - } - readlinkSync(p) { - return this.makeCallSync(p, () => { - return this.baseFs.readlinkSync(p); - }, (mountFs, { subPath }) => { - return mountFs.readlinkSync(subPath); - }); - } - async truncatePromise(p, len) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.truncatePromise(p, len); - }, async (mountFs, { subPath }) => { - return await mountFs.truncatePromise(subPath, len); - }); - } - truncateSync(p, len) { - return this.makeCallSync(p, () => { - return this.baseFs.truncateSync(p, len); - }, (mountFs, { subPath }) => { - return mountFs.truncateSync(subPath, len); - }); - } - async ftruncatePromise(fd, len) { - if ((fd & MOUNT_MASK) !== this.magic) - return this.baseFs.ftruncatePromise(fd, len); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`ftruncate`); - const [mountFs, realFd] = entry; - return mountFs.ftruncatePromise(realFd, len); - } - ftruncateSync(fd, len) { - if ((fd & MOUNT_MASK) !== this.magic) - return this.baseFs.ftruncateSync(fd, len); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`ftruncateSync`); - const [mountFs, realFd] = entry; - return mountFs.ftruncateSync(realFd, len); - } - watch(p, a, b) { - return this.makeCallSync(p, () => { - return this.baseFs.watch( - p, - a, - b - ); - }, (mountFs, { subPath }) => { - return mountFs.watch( - subPath, - a, - b - ); - }); - } - watchFile(p, a, b) { - return this.makeCallSync(p, () => { - return this.baseFs.watchFile( - p, - a, - b - ); - }, () => { - return watchFile(this, p, a, b); - }); - } - unwatchFile(p, cb) { - return this.makeCallSync(p, () => { - return this.baseFs.unwatchFile(p, cb); - }, () => { - return unwatchFile(this, p, cb); - }); - } - async makeCallPromise(p, discard, accept, { requireSubpath = true } = {}) { - if (typeof p !== `string`) - return await discard(); - const normalizedP = this.resolve(p); - const mountInfo = this.findMount(normalizedP); - if (!mountInfo) - return await discard(); - if (requireSubpath && mountInfo.subPath === `/`) - return await discard(); - return await this.getMountPromise(mountInfo.archivePath, async (mountFs) => await accept(mountFs, mountInfo)); - } - makeCallSync(p, discard, accept, { requireSubpath = true } = {}) { - if (typeof p !== `string`) - return discard(); - const normalizedP = this.resolve(p); - const mountInfo = this.findMount(normalizedP); - if (!mountInfo) - return discard(); - if (requireSubpath && mountInfo.subPath === `/`) - return discard(); - return this.getMountSync(mountInfo.archivePath, (mountFs) => accept(mountFs, mountInfo)); - } - findMount(p) { - if (this.filter && !this.filter.test(p)) - return null; - let filePath = ``; - while (true) { - const pathPartWithArchive = p.substring(filePath.length); - const mountPoint = this.getMountPoint(pathPartWithArchive, filePath); - if (!mountPoint) - return null; - filePath = this.pathUtils.join(filePath, mountPoint); - if (!this.isMount.has(filePath)) { - if (this.notMount.has(filePath)) - continue; - try { - if (this.typeCheck !== null && (this.baseFs.lstatSync(filePath).mode & fs.constants.S_IFMT) !== this.typeCheck) { - this.notMount.add(filePath); - continue; - } - } catch { - return null; - } - this.isMount.add(filePath); - } - return { - archivePath: filePath, - subPath: this.pathUtils.join(PortablePath.root, p.substring(filePath.length)) - }; - } - } - limitOpenFiles(max) { - if (this.mountInstances === null) - return; - const now = Date.now(); - let nextExpiresAt = now + this.maxAge; - let closeCount = max === null ? 0 : this.mountInstances.size - max; - for (const [path, { childFs, expiresAt, refCount }] of this.mountInstances.entries()) { - if (refCount !== 0 || childFs.hasOpenFileHandles?.()) { - continue; - } else if (now >= expiresAt) { - childFs.saveAndClose?.(); - this.mountInstances.delete(path); - closeCount -= 1; - continue; - } else if (max === null || closeCount <= 0) { - nextExpiresAt = expiresAt; - break; - } - childFs.saveAndClose?.(); - this.mountInstances.delete(path); - closeCount -= 1; - } - if (this.limitOpenFilesTimeout === null && (max === null && this.mountInstances.size > 0 || max !== null) && isFinite(nextExpiresAt)) { - this.limitOpenFilesTimeout = setTimeout(() => { - this.limitOpenFilesTimeout = null; - this.limitOpenFiles(null); - }, nextExpiresAt - now).unref(); - } - } - async getMountPromise(p, accept) { - if (this.mountInstances) { - let cachedMountFs = this.mountInstances.get(p); - if (!cachedMountFs) { - const createFsInstance = await this.factoryPromise(this.baseFs, p); - cachedMountFs = this.mountInstances.get(p); - if (!cachedMountFs) { - cachedMountFs = { - childFs: createFsInstance(), - expiresAt: 0, - refCount: 0 - }; - } - } - this.mountInstances.delete(p); - this.limitOpenFiles(this.maxOpenFiles - 1); - this.mountInstances.set(p, cachedMountFs); - cachedMountFs.expiresAt = Date.now() + this.maxAge; - cachedMountFs.refCount += 1; - try { - return await accept(cachedMountFs.childFs); - } finally { - cachedMountFs.refCount -= 1; - } - } else { - const mountFs = (await this.factoryPromise(this.baseFs, p))(); - try { - return await accept(mountFs); - } finally { - mountFs.saveAndClose?.(); - } - } - } - getMountSync(p, accept) { - if (this.mountInstances) { - let cachedMountFs = this.mountInstances.get(p); - if (!cachedMountFs) { - cachedMountFs = { - childFs: this.factorySync(this.baseFs, p), - expiresAt: 0, - refCount: 0 - }; - } - this.mountInstances.delete(p); - this.limitOpenFiles(this.maxOpenFiles - 1); - this.mountInstances.set(p, cachedMountFs); - cachedMountFs.expiresAt = Date.now() + this.maxAge; - return accept(cachedMountFs.childFs); - } else { - const childFs = this.factorySync(this.baseFs, p); - try { - return accept(childFs); - } finally { - childFs.saveAndClose?.(); - } - } - } -} - -class PosixFS extends ProxiedFS { - constructor(baseFs) { - super(npath); - this.baseFs = baseFs; - } - mapFromBase(path) { - return npath.fromPortablePath(path); - } - mapToBase(path) { - return npath.toPortablePath(path); - } -} - -const NUMBER_REGEXP = /^[0-9]+$/; -const VIRTUAL_REGEXP = /^(\/(?:[^/]+\/)*?(?:\$\$virtual|__virtual__))((?:\/((?:[^/]+-)?[a-f0-9]+)(?:\/([^/]+))?)?((?:\/.*)?))$/; -const VALID_COMPONENT = /^([^/]+-)?[a-f0-9]+$/; -class VirtualFS extends ProxiedFS { - constructor({ baseFs = new NodeFS() } = {}) { - super(ppath); - this.baseFs = baseFs; - } - static makeVirtualPath(base, component, to) { - if (ppath.basename(base) !== `__virtual__`) - throw new Error(`Assertion failed: Virtual folders must be named "__virtual__"`); - if (!ppath.basename(component).match(VALID_COMPONENT)) - throw new Error(`Assertion failed: Virtual components must be ended by an hexadecimal hash`); - const target = ppath.relative(ppath.dirname(base), to); - const segments = target.split(`/`); - let depth = 0; - while (depth < segments.length && segments[depth] === `..`) - depth += 1; - const finalSegments = segments.slice(depth); - const fullVirtualPath = ppath.join(base, component, String(depth), ...finalSegments); - return fullVirtualPath; - } - static resolveVirtual(p) { - const match = p.match(VIRTUAL_REGEXP); - if (!match || !match[3] && match[5]) - return p; - const target = ppath.dirname(match[1]); - if (!match[3] || !match[4]) - return target; - const isnum = NUMBER_REGEXP.test(match[4]); - if (!isnum) - return p; - const depth = Number(match[4]); - const backstep = `../`.repeat(depth); - const subpath = match[5] || `.`; - return VirtualFS.resolveVirtual(ppath.join(target, backstep, subpath)); - } - getExtractHint(hints) { - return this.baseFs.getExtractHint(hints); - } - getRealPath() { - return this.baseFs.getRealPath(); - } - realpathSync(p) { - const match = p.match(VIRTUAL_REGEXP); - if (!match) - return this.baseFs.realpathSync(p); - if (!match[5]) - return p; - const realpath = this.baseFs.realpathSync(this.mapToBase(p)); - return VirtualFS.makeVirtualPath(match[1], match[3], realpath); - } - async realpathPromise(p) { - const match = p.match(VIRTUAL_REGEXP); - if (!match) - return await this.baseFs.realpathPromise(p); - if (!match[5]) - return p; - const realpath = await this.baseFs.realpathPromise(this.mapToBase(p)); - return VirtualFS.makeVirtualPath(match[1], match[3], realpath); - } - mapToBase(p) { - if (p === ``) - return p; - if (this.pathUtils.isAbsolute(p)) - return VirtualFS.resolveVirtual(p); - const resolvedRoot = VirtualFS.resolveVirtual(this.baseFs.resolve(PortablePath.dot)); - const resolvedP = VirtualFS.resolveVirtual(this.baseFs.resolve(p)); - return ppath.relative(resolvedRoot, resolvedP) || PortablePath.dot; - } - mapFromBase(p) { - return p; - } -} - -const URL = Number(process.versions.node.split('.', 1)[0]) < 20 ? url.URL : globalThis.URL; - -class NodePathFS extends ProxiedFS { - constructor(baseFs) { - super(npath); - this.baseFs = baseFs; - } - mapFromBase(path) { - return path; - } - mapToBase(path) { - if (typeof path === `string`) - return path; - if (path instanceof URL) - return url.fileURLToPath(path); - if (Buffer.isBuffer(path)) { - const str = path.toString(); - if (!isUtf8(path, str)) - throw new Error(`Non-utf8 buffers are not supported at the moment. Please upvote the following issue if you encounter this error: https://github.com/yarnpkg/berry/issues/4942`); - return str; - } - throw new Error(`Unsupported path type: ${nodeUtils.inspect(path)}`); - } -} -function isUtf8(buf, str) { - if (typeof buffer__default.default.isUtf8 !== `undefined`) - return buffer__default.default.isUtf8(buf); - return Buffer.byteLength(str) === buf.byteLength; -} - -var _a, _b, _c, _d; -const kBaseFs = Symbol(`kBaseFs`); -const kFd = Symbol(`kFd`); -const kClosePromise = Symbol(`kClosePromise`); -const kCloseResolve = Symbol(`kCloseResolve`); -const kCloseReject = Symbol(`kCloseReject`); -const kRefs = Symbol(`kRefs`); -const kRef = Symbol(`kRef`); -const kUnref = Symbol(`kUnref`); -class FileHandle { - constructor(fd, baseFs) { - this[_a] = 1; - this[_b] = void 0; - this[_c] = void 0; - this[_d] = void 0; - this[kBaseFs] = baseFs; - this[kFd] = fd; - } - get fd() { - return this[kFd]; - } - async appendFile(data, options) { - try { - this[kRef](this.appendFile); - const encoding = (typeof options === `string` ? options : options?.encoding) ?? void 0; - return await this[kBaseFs].appendFilePromise(this.fd, data, encoding ? { encoding } : void 0); - } finally { - this[kUnref](); - } - } - async chown(uid, gid) { - try { - this[kRef](this.chown); - return await this[kBaseFs].fchownPromise(this.fd, uid, gid); - } finally { - this[kUnref](); - } - } - async chmod(mode) { - try { - this[kRef](this.chmod); - return await this[kBaseFs].fchmodPromise(this.fd, mode); - } finally { - this[kUnref](); - } - } - createReadStream(options) { - return this[kBaseFs].createReadStream(null, { ...options, fd: this.fd }); - } - createWriteStream(options) { - return this[kBaseFs].createWriteStream(null, { ...options, fd: this.fd }); - } - datasync() { - throw new Error(`Method not implemented.`); - } - sync() { - throw new Error(`Method not implemented.`); - } - async read(bufferOrOptions, offset, length, position) { - try { - this[kRef](this.read); - let buffer; - if (!Buffer.isBuffer(bufferOrOptions)) { - bufferOrOptions ??= {}; - buffer = bufferOrOptions.buffer ?? Buffer.alloc(16384); - offset = bufferOrOptions.offset || 0; - length = bufferOrOptions.length ?? buffer.byteLength; - position = bufferOrOptions.position ?? null; - } else { - buffer = bufferOrOptions; - } - offset ??= 0; - length ??= 0; - if (length === 0) { - return { - bytesRead: length, - buffer - }; - } - const bytesRead = await this[kBaseFs].readPromise(this.fd, buffer, offset, length, position); - return { - bytesRead, - buffer - }; - } finally { - this[kUnref](); - } - } - async readFile(options) { - try { - this[kRef](this.readFile); - const encoding = (typeof options === `string` ? options : options?.encoding) ?? void 0; - return await this[kBaseFs].readFilePromise(this.fd, encoding); - } finally { - this[kUnref](); - } - } - readLines(options) { - return readline.createInterface({ - input: this.createReadStream(options), - crlfDelay: Infinity - }); - } - async stat(opts) { - try { - this[kRef](this.stat); - return await this[kBaseFs].fstatPromise(this.fd, opts); - } finally { - this[kUnref](); - } - } - async truncate(len) { - try { - this[kRef](this.truncate); - return await this[kBaseFs].ftruncatePromise(this.fd, len); - } finally { - this[kUnref](); - } - } - utimes(atime, mtime) { - throw new Error(`Method not implemented.`); - } - async writeFile(data, options) { - try { - this[kRef](this.writeFile); - const encoding = (typeof options === `string` ? options : options?.encoding) ?? void 0; - await this[kBaseFs].writeFilePromise(this.fd, data, encoding); - } finally { - this[kUnref](); - } - } - async write(...args) { - try { - this[kRef](this.write); - if (ArrayBuffer.isView(args[0])) { - const [buffer, offset, length, position] = args; - const bytesWritten = await this[kBaseFs].writePromise(this.fd, buffer, offset ?? void 0, length ?? void 0, position ?? void 0); - return { bytesWritten, buffer }; - } else { - const [data, position, encoding] = args; - const bytesWritten = await this[kBaseFs].writePromise(this.fd, data, position, encoding); - return { bytesWritten, buffer: data }; - } - } finally { - this[kUnref](); - } - } - async writev(buffers, position) { - try { - this[kRef](this.writev); - let bytesWritten = 0; - if (typeof position !== `undefined`) { - for (const buffer of buffers) { - const writeResult = await this.write(buffer, void 0, void 0, position); - bytesWritten += writeResult.bytesWritten; - position += writeResult.bytesWritten; - } - } else { - for (const buffer of buffers) { - const writeResult = await this.write(buffer); - bytesWritten += writeResult.bytesWritten; - } - } - return { - buffers, - bytesWritten - }; - } finally { - this[kUnref](); - } - } - readv(buffers, position) { - throw new Error(`Method not implemented.`); - } - close() { - if (this[kFd] === -1) - return Promise.resolve(); - if (this[kClosePromise]) - return this[kClosePromise]; - this[kRefs]--; - if (this[kRefs] === 0) { - const fd = this[kFd]; - this[kFd] = -1; - this[kClosePromise] = this[kBaseFs].closePromise(fd).finally(() => { - this[kClosePromise] = void 0; - }); - } else { - this[kClosePromise] = new Promise((resolve, reject) => { - this[kCloseResolve] = resolve; - this[kCloseReject] = reject; - }).finally(() => { - this[kClosePromise] = void 0; - this[kCloseReject] = void 0; - this[kCloseResolve] = void 0; - }); - } - return this[kClosePromise]; - } - [(_a = kRefs, _b = kClosePromise, _c = kCloseResolve, _d = kCloseReject, kRef)](caller) { - if (this[kFd] === -1) { - const err = new Error(`file closed`); - err.code = `EBADF`; - err.syscall = caller.name; - throw err; - } - this[kRefs]++; - } - [kUnref]() { - this[kRefs]--; - if (this[kRefs] === 0) { - const fd = this[kFd]; - this[kFd] = -1; - this[kBaseFs].closePromise(fd).then(this[kCloseResolve], this[kCloseReject]); - } - } -} - -const SYNC_IMPLEMENTATIONS = /* @__PURE__ */ new Set([ - `accessSync`, - `appendFileSync`, - `createReadStream`, - `createWriteStream`, - `chmodSync`, - `fchmodSync`, - `chownSync`, - `fchownSync`, - `closeSync`, - `copyFileSync`, - `linkSync`, - `lstatSync`, - `fstatSync`, - `lutimesSync`, - `mkdirSync`, - `openSync`, - `opendirSync`, - `readlinkSync`, - `readFileSync`, - `readdirSync`, - `readlinkSync`, - `realpathSync`, - `renameSync`, - `rmdirSync`, - `rmSync`, - `statSync`, - `symlinkSync`, - `truncateSync`, - `ftruncateSync`, - `unlinkSync`, - `unwatchFile`, - `utimesSync`, - `watch`, - `watchFile`, - `writeFileSync`, - `writeSync` -]); -const ASYNC_IMPLEMENTATIONS = /* @__PURE__ */ new Set([ - `accessPromise`, - `appendFilePromise`, - `fchmodPromise`, - `chmodPromise`, - `fchownPromise`, - `chownPromise`, - `closePromise`, - `copyFilePromise`, - `linkPromise`, - `fstatPromise`, - `lstatPromise`, - `lutimesPromise`, - `mkdirPromise`, - `openPromise`, - `opendirPromise`, - `readdirPromise`, - `realpathPromise`, - `readFilePromise`, - `readdirPromise`, - `readlinkPromise`, - `renamePromise`, - `rmdirPromise`, - `rmPromise`, - `statPromise`, - `symlinkPromise`, - `truncatePromise`, - `ftruncatePromise`, - `unlinkPromise`, - `utimesPromise`, - `writeFilePromise`, - `writeSync` -]); -function patchFs(patchedFs, fakeFs) { - fakeFs = new NodePathFS(fakeFs); - const setupFn = (target, name, replacement) => { - const orig = target[name]; - target[name] = replacement; - if (typeof orig?.[nodeUtils.promisify.custom] !== `undefined`) { - replacement[nodeUtils.promisify.custom] = orig[nodeUtils.promisify.custom]; - } - }; - { - setupFn(patchedFs, `exists`, (p, ...args) => { - const hasCallback = typeof args[args.length - 1] === `function`; - const callback = hasCallback ? args.pop() : () => { - }; - process.nextTick(() => { - fakeFs.existsPromise(p).then((exists) => { - callback(exists); - }, () => { - callback(false); - }); - }); - }); - setupFn(patchedFs, `read`, (...args) => { - let [fd, buffer, offset, length, position, callback] = args; - if (args.length <= 3) { - let options = {}; - if (args.length < 3) { - callback = args[1]; - } else { - options = args[1]; - callback = args[2]; - } - ({ - buffer = Buffer.alloc(16384), - offset = 0, - length = buffer.byteLength, - position - } = options); - } - if (offset == null) - offset = 0; - length |= 0; - if (length === 0) { - process.nextTick(() => { - callback(null, 0, buffer); - }); - return; - } - if (position == null) - position = -1; - process.nextTick(() => { - fakeFs.readPromise(fd, buffer, offset, length, position).then((bytesRead) => { - callback(null, bytesRead, buffer); - }, (error) => { - callback(error, 0, buffer); - }); - }); - }); - for (const fnName of ASYNC_IMPLEMENTATIONS) { - const origName = fnName.replace(/Promise$/, ``); - if (typeof patchedFs[origName] === `undefined`) - continue; - const fakeImpl = fakeFs[fnName]; - if (typeof fakeImpl === `undefined`) - continue; - const wrapper = (...args) => { - const hasCallback = typeof args[args.length - 1] === `function`; - const callback = hasCallback ? args.pop() : () => { - }; - process.nextTick(() => { - fakeImpl.apply(fakeFs, args).then((result) => { - callback(null, result); - }, (error) => { - callback(error); - }); - }); - }; - setupFn(patchedFs, origName, wrapper); - } - patchedFs.realpath.native = patchedFs.realpath; - } - { - setupFn(patchedFs, `existsSync`, (p) => { - try { - return fakeFs.existsSync(p); - } catch (error) { - return false; - } - }); - setupFn(patchedFs, `readSync`, (...args) => { - let [fd, buffer, offset, length, position] = args; - if (args.length <= 3) { - const options = args[2] || {}; - ({ offset = 0, length = buffer.byteLength, position } = options); - } - if (offset == null) - offset = 0; - length |= 0; - if (length === 0) - return 0; - if (position == null) - position = -1; - return fakeFs.readSync(fd, buffer, offset, length, position); - }); - for (const fnName of SYNC_IMPLEMENTATIONS) { - const origName = fnName; - if (typeof patchedFs[origName] === `undefined`) - continue; - const fakeImpl = fakeFs[fnName]; - if (typeof fakeImpl === `undefined`) - continue; - setupFn(patchedFs, origName, fakeImpl.bind(fakeFs)); - } - patchedFs.realpathSync.native = patchedFs.realpathSync; - } - { - const patchedFsPromises = patchedFs.promises; - for (const fnName of ASYNC_IMPLEMENTATIONS) { - const origName = fnName.replace(/Promise$/, ``); - if (typeof patchedFsPromises[origName] === `undefined`) - continue; - const fakeImpl = fakeFs[fnName]; - if (typeof fakeImpl === `undefined`) - continue; - if (fnName === `open`) - continue; - setupFn(patchedFsPromises, origName, (pathLike, ...args) => { - if (pathLike instanceof FileHandle) { - return pathLike[origName].apply(pathLike, args); - } else { - return fakeImpl.call(fakeFs, pathLike, ...args); - } - }); - } - setupFn(patchedFsPromises, `open`, async (...args) => { - const fd = await fakeFs.openPromise(...args); - return new FileHandle(fd, fakeFs); - }); - } - { - patchedFs.read[nodeUtils.promisify.custom] = async (fd, buffer, ...args) => { - const res = fakeFs.readPromise(fd, buffer, ...args); - return { bytesRead: await res, buffer }; - }; - patchedFs.write[nodeUtils.promisify.custom] = async (fd, buffer, ...args) => { - const res = fakeFs.writePromise(fd, buffer, ...args); - return { bytesWritten: await res, buffer }; - }; - } -} - -let cachedInstance; -let registeredFactory = () => { - throw new Error(`Assertion failed: No libzip instance is available, and no factory was configured`); -}; -function setFactory(factory) { - registeredFactory = factory; -} -function getInstance() { - if (typeof cachedInstance === `undefined`) - cachedInstance = registeredFactory(); - return cachedInstance; -} - -var libzipSync = {exports: {}}; - -(function (module, exports) { -var frozenFs = Object.assign({}, fs__default.default); -var createModule = function() { - var _scriptDir = void 0; - if (typeof __filename !== "undefined") - _scriptDir = _scriptDir || __filename; - return function(createModule2) { - createModule2 = createModule2 || {}; - var Module = typeof createModule2 !== "undefined" ? createModule2 : {}; - var readyPromiseResolve, readyPromiseReject; - Module["ready"] = new Promise(function(resolve, reject) { - readyPromiseResolve = resolve; - readyPromiseReject = reject; - }); - var moduleOverrides = {}; - var key; - for (key in Module) { - if (Module.hasOwnProperty(key)) { - moduleOverrides[key] = Module[key]; - } - } - var scriptDirectory = ""; - function locateFile(path) { - if (Module["locateFile"]) { - return Module["locateFile"](path, scriptDirectory); - } - return scriptDirectory + path; - } - var read_, readBinary; - var nodeFS; - var nodePath; - { - { - scriptDirectory = __dirname + "/"; - } - read_ = function shell_read(filename, binary) { - var ret = tryParseAsDataURI(filename); - if (ret) { - return binary ? ret : ret.toString(); - } - if (!nodeFS) - nodeFS = frozenFs; - if (!nodePath) - nodePath = path__default.default; - filename = nodePath["normalize"](filename); - return nodeFS["readFileSync"](filename, binary ? null : "utf8"); - }; - readBinary = function readBinary2(filename) { - var ret = read_(filename, true); - if (!ret.buffer) { - ret = new Uint8Array(ret); - } - assert(ret.buffer); - return ret; - }; - if (process["argv"].length > 1) { - process["argv"][1].replace(/\\/g, "/"); - } - process["argv"].slice(2); - Module["inspect"] = function() { - return "[Emscripten Module object]"; - }; - } - Module["print"] || console.log.bind(console); - var err = Module["printErr"] || console.warn.bind(console); - for (key in moduleOverrides) { - if (moduleOverrides.hasOwnProperty(key)) { - Module[key] = moduleOverrides[key]; - } - } - moduleOverrides = null; - if (Module["arguments"]) - ; - if (Module["thisProgram"]) - ; - if (Module["quit"]) - ; - var wasmBinary; - if (Module["wasmBinary"]) - wasmBinary = Module["wasmBinary"]; - Module["noExitRuntime"] || true; - if (typeof WebAssembly !== "object") { - abort("no native wasm support detected"); - } - function getValue(ptr, type, noSafe) { - type = type || "i8"; - if (type.charAt(type.length - 1) === "*") - type = "i32"; - switch (type) { - case "i1": - return HEAP8[ptr >> 0]; - case "i8": - return HEAP8[ptr >> 0]; - case "i16": - return LE_HEAP_LOAD_I16((ptr >> 1) * 2); - case "i32": - return LE_HEAP_LOAD_I32((ptr >> 2) * 4); - case "i64": - return LE_HEAP_LOAD_I32((ptr >> 2) * 4); - case "float": - return LE_HEAP_LOAD_F32((ptr >> 2) * 4); - case "double": - return LE_HEAP_LOAD_F64((ptr >> 3) * 8); - default: - abort("invalid type for getValue: " + type); - } - return null; - } - var wasmMemory; - var ABORT = false; - function assert(condition, text) { - if (!condition) { - abort("Assertion failed: " + text); - } - } - function getCFunc(ident) { - var func = Module["_" + ident]; - assert( - func, - "Cannot call unknown function " + ident + ", make sure it is exported" - ); - return func; - } - function ccall(ident, returnType, argTypes, args, opts) { - var toC = { - string: function(str) { - var ret2 = 0; - if (str !== null && str !== void 0 && str !== 0) { - var len = (str.length << 2) + 1; - ret2 = stackAlloc(len); - stringToUTF8(str, ret2, len); - } - return ret2; - }, - array: function(arr) { - var ret2 = stackAlloc(arr.length); - writeArrayToMemory(arr, ret2); - return ret2; - } - }; - function convertReturnValue(ret2) { - if (returnType === "string") - return UTF8ToString(ret2); - if (returnType === "boolean") - return Boolean(ret2); - return ret2; - } - var func = getCFunc(ident); - var cArgs = []; - var stack = 0; - if (args) { - for (var i = 0; i < args.length; i++) { - var converter = toC[argTypes[i]]; - if (converter) { - if (stack === 0) - stack = stackSave(); - cArgs[i] = converter(args[i]); - } else { - cArgs[i] = args[i]; - } - } - } - var ret = func.apply(null, cArgs); - ret = convertReturnValue(ret); - if (stack !== 0) - stackRestore(stack); - return ret; - } - function cwrap(ident, returnType, argTypes, opts) { - argTypes = argTypes || []; - var numericArgs = argTypes.every(function(type) { - return type === "number"; - }); - var numericRet = returnType !== "string"; - if (numericRet && numericArgs && !opts) { - return getCFunc(ident); - } - return function() { - return ccall(ident, returnType, argTypes, arguments); - }; - } - var UTF8Decoder = new TextDecoder("utf8"); - function UTF8ToString(ptr, maxBytesToRead) { - if (!ptr) - return ""; - var maxPtr = ptr + maxBytesToRead; - for (var end = ptr; !(end >= maxPtr) && HEAPU8[end]; ) - ++end; - return UTF8Decoder.decode(HEAPU8.subarray(ptr, end)); - } - function stringToUTF8Array(str, heap, outIdx, maxBytesToWrite) { - if (!(maxBytesToWrite > 0)) - return 0; - var startIdx = outIdx; - var endIdx = outIdx + maxBytesToWrite - 1; - for (var i = 0; i < str.length; ++i) { - var u = str.charCodeAt(i); - if (u >= 55296 && u <= 57343) { - var u1 = str.charCodeAt(++i); - u = 65536 + ((u & 1023) << 10) | u1 & 1023; - } - if (u <= 127) { - if (outIdx >= endIdx) - break; - heap[outIdx++] = u; - } else if (u <= 2047) { - if (outIdx + 1 >= endIdx) - break; - heap[outIdx++] = 192 | u >> 6; - heap[outIdx++] = 128 | u & 63; - } else if (u <= 65535) { - if (outIdx + 2 >= endIdx) - break; - heap[outIdx++] = 224 | u >> 12; - heap[outIdx++] = 128 | u >> 6 & 63; - heap[outIdx++] = 128 | u & 63; - } else { - if (outIdx + 3 >= endIdx) - break; - heap[outIdx++] = 240 | u >> 18; - heap[outIdx++] = 128 | u >> 12 & 63; - heap[outIdx++] = 128 | u >> 6 & 63; - heap[outIdx++] = 128 | u & 63; - } - } - heap[outIdx] = 0; - return outIdx - startIdx; - } - function stringToUTF8(str, outPtr, maxBytesToWrite) { - return stringToUTF8Array(str, HEAPU8, outPtr, maxBytesToWrite); - } - function lengthBytesUTF8(str) { - var len = 0; - for (var i = 0; i < str.length; ++i) { - var u = str.charCodeAt(i); - if (u >= 55296 && u <= 57343) - u = 65536 + ((u & 1023) << 10) | str.charCodeAt(++i) & 1023; - if (u <= 127) - ++len; - else if (u <= 2047) - len += 2; - else if (u <= 65535) - len += 3; - else - len += 4; - } - return len; - } - function allocateUTF8(str) { - var size = lengthBytesUTF8(str) + 1; - var ret = _malloc(size); - if (ret) - stringToUTF8Array(str, HEAP8, ret, size); - return ret; - } - function writeArrayToMemory(array, buffer2) { - HEAP8.set(array, buffer2); - } - function alignUp(x, multiple) { - if (x % multiple > 0) { - x += multiple - x % multiple; - } - return x; - } - var buffer, HEAP8, HEAPU8; - var HEAP_DATA_VIEW; - function updateGlobalBufferAndViews(buf) { - buffer = buf; - Module["HEAP_DATA_VIEW"] = HEAP_DATA_VIEW = new DataView(buf); - Module["HEAP8"] = HEAP8 = new Int8Array(buf); - Module["HEAP16"] = new Int16Array(buf); - Module["HEAP32"] = new Int32Array(buf); - Module["HEAPU8"] = HEAPU8 = new Uint8Array(buf); - Module["HEAPU16"] = new Uint16Array(buf); - Module["HEAPU32"] = new Uint32Array(buf); - Module["HEAPF32"] = new Float32Array(buf); - Module["HEAPF64"] = new Float64Array(buf); - } - Module["INITIAL_MEMORY"] || 16777216; - var wasmTable; - var __ATPRERUN__ = []; - var __ATINIT__ = []; - var __ATPOSTRUN__ = []; - function preRun() { - if (Module["preRun"]) { - if (typeof Module["preRun"] == "function") - Module["preRun"] = [Module["preRun"]]; - while (Module["preRun"].length) { - addOnPreRun(Module["preRun"].shift()); - } - } - callRuntimeCallbacks(__ATPRERUN__); - } - function initRuntime() { - callRuntimeCallbacks(__ATINIT__); - } - function postRun() { - if (Module["postRun"]) { - if (typeof Module["postRun"] == "function") - Module["postRun"] = [Module["postRun"]]; - while (Module["postRun"].length) { - addOnPostRun(Module["postRun"].shift()); - } - } - callRuntimeCallbacks(__ATPOSTRUN__); - } - function addOnPreRun(cb) { - __ATPRERUN__.unshift(cb); - } - function addOnInit(cb) { - __ATINIT__.unshift(cb); - } - function addOnPostRun(cb) { - __ATPOSTRUN__.unshift(cb); - } - var runDependencies = 0; - var dependenciesFulfilled = null; - function addRunDependency(id) { - runDependencies++; - if (Module["monitorRunDependencies"]) { - Module["monitorRunDependencies"](runDependencies); - } - } - function removeRunDependency(id) { - runDependencies--; - if (Module["monitorRunDependencies"]) { - Module["monitorRunDependencies"](runDependencies); - } - if (runDependencies == 0) { - if (dependenciesFulfilled) { - var callback = dependenciesFulfilled; - dependenciesFulfilled = null; - callback(); - } - } - } - Module["preloadedImages"] = {}; - Module["preloadedAudios"] = {}; - function abort(what) { - if (Module["onAbort"]) { - Module["onAbort"](what); - } - what += ""; - err(what); - ABORT = true; - what = "abort(" + what + "). Build with -s ASSERTIONS=1 for more info."; - var e = new WebAssembly.RuntimeError(what); - readyPromiseReject(e); - throw e; - } - var dataURIPrefix = "data:application/octet-stream;base64,"; - function isDataURI(filename) { - return filename.startsWith(dataURIPrefix); - } - var wasmBinaryFile = "data:application/octet-stream;base64,AGFzbQEAAAAB/wEkYAN/f38Bf2ABfwF/YAJ/fwF/YAF/AGAEf39/fwF/YAN/f38AYAV/f39/fwF/YAJ/fwBgBH9/f38AYAABf2AFf39/fn8BfmAEf35/fwF/YAR/f35/AX5gAn9+AX9gA398fwBgA39/fgF/YAF/AX5gBn9/f39/fwF/YAN/fn8Bf2AEf39/fwF+YAV/f35/fwF/YAR/f35/A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AToAACAEIAJFOgABIAAgBSABIAMQZUEASAR/IAQtAAEEQCAEKAIEEAYLIAQQBkEABSAECwubAgEDfyAALQAAQSBxRQRAAkAgASEDAkAgAiAAIgEoAhAiAAR/IAAFAn8gASABLQBKIgBBAWsgAHI6AEogASgCACIAQQhxBEAgASAAQSByNgIAQX8MAQsgAUIANwIEIAEgASgCLCIANgIcIAEgADYCFCABIAAgASgCMGo2AhBBAAsNASABKAIQCyABKAIUIgVrSwRAIAEgAyACIAEoAiQRAAAaDAILAn8gASwAS0F/SgRAIAIhAANAIAIgACIERQ0CGiADIARBAWsiAGotAABBCkcNAAsgASADIAQgASgCJBEAACAESQ0CIAMgBGohAyABKAIUIQUgAiAEawwBCyACCyEAIAUgAyAAEAcaIAEgASgCFCAAajYCFAsLCwvNBQEGfyAAKAIwIgNBhgJrIQYgACgCPCECIAMhAQNAIAAoAkQgAiAAKAJoIgRqayECIAEgBmogBE0EQCAAKAJIIgEgASADaiADEAcaAkAgAyAAKAJsIgFNBEAgACABIANrNgJsDAELIABCADcCbAsgACAAKAJoIANrIgE2AmggACAAKAJYIANrNgJYIAEgACgChC5JBEAgACABNgKELgsgAEH8gAEoAgARAwAgAiADaiECCwJAIAAoAgAiASgCBCIERQ0AIAAoAjwhBSAAIAIgBCACIARJGyICBH8gACgCSCAAKAJoaiAFaiEFIAEgBCACazYCBAJAAkACQAJAIAEoAhwiBCgCFEEBaw4CAQACCyAEQaABaiAFIAEoAgAgAkHcgAEoAgARCAAMAgsgASABKAIwIAUgASgCACACQcSAASgCABEEADYCMAwBCyAFIAEoAgAgAhAHGgsgASABKAIAIAJqNgIAIAEgASgCCCACajYCCCAAKAI8BSAFCyACaiICNgI8AkAgACgChC4iASACakEDSQ0AIAAoAmggAWshAQJAIAAoAnRBgQhPBEAgACAAIAAoAkggAWoiAi0AACACLQABIAAoAnwRAAA2AlQMAQsgAUUNACAAIAFBAWsgACgChAERAgAaCyAAKAKELiAAKAI8IgJBAUZrIgRFDQAgACABIAQg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RAcDAILIAMgBTYCAAsgASABLwEMQf7/A3EgAS8BUiIFQQBHcjsBDAJAAkACQAJAAn8CQAJAIAEpAyhC/v///w9WDQAgASkDIEL+////D1YNACACQYAEcUUNASABKQNIQv////8PVA0BCyAFQYECa0H//wNxQQNJIQdBAQwBCyAFQYECa0H//wNxIQQgAkGACnFBgApHDQEgBEEDSSEHQQALIQkgBkIcEBciBEUEQCAAQQhqIgAEQCAAQQA2AgQgAEEONgIACyADEBwMBQsgAkGACHEhBQJAAkAgAkGAAnEEQAJAIAUNACABKQMgQv////8PVg0AIAEpAyhCgICAgBBUDQMLIAQgASkDKBAYIAEpAyAhDAwBCwJAAkACQCAFDQAgASkDIEL/////D1YNACABKQMoIgxC/////w9WDQEgASkDSEKAgICAEFQNBAsgASkDKCIMQv////8PVA0BCyAEIAwQGAsgASkDICIMQv////8PWgRAIAQgDBAYCyABKQNIIgxC/////w9UDQELIAQgDBAYCyAELQAARQRAIABBCGoiAARAIABBADYCBCAAQRQ2AgALIAQQCCADEBwMBQtBASEKQQEgBC0AAAR+IAQpAxAFQgALp0H//wNxIAYQRyEFIAQQCCAFIAM2AgAgBw0BDAILIAMhBSAEQQJLDQELIAZCBxAXIgRFBEAgAEEIaiIABEAgAEEANgIEIABBDjYCAAsgBRAcDAMLIARBAhANIARBhxJBAhAsIAQgAS0AUhBwIAQgAS8BEBANIAQtAABFBEAgAEEIaiIABEAgAEEANgIEIABBFDYCAAsgBBAIDAILQYGyAkEHIAYQRyEDIAQQCCADIAU2AgBBASELIAMhBQsgBkIuEBciA0UEQCAAQQhqIgAEQCAAQQA2AgQgAEEONgIACyAFEBwMAgsgA0GjEkGoEiACQYACcSIHG0EEECwgB0UEQCADIAkEf0EtBSABLwEIC0H//wNxEA0LIAMgCQR/QS0FIAEvAQoLQf//A3EQDSADIAEvAQwQDSADIAsEf0HjAAUgASgCEAtB//8DcRANIAYgASgCFDYCPAJ/IAZBPGoQjQEiCEUEQEEAIQlBIQwBCwJ/IAgoAhQi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EDfwJAIAJFDQADQCAALQAAIgQgAS0AACIFRgRAIAFBAWohASAAQQFqIQAgAkEBayICDQEMAgsLIAQgBWshAwsgAwsUACAAEEAgACgCABAgIAAoAgQQIAutBAIBfgV/IwBBEGsiBCQAIAAgAWshBgJAAkAgAUEBRgRAIAAgBi0AACACEBkMAQsgAUEJTwRAIAAgBikAADcAACAAIAJBAWtBB3FBAWoiBWohACACIAVrIgFFDQIgBSAGaiECA0AgACACKQAANwAAIAJBCGohAiAAQQhqIQAgAUEIayIBDQALDAILAkACQAJAAkAgAUEEaw4FAAICAgECCyAEIAYoAAAiATYCBCAEIAE2AgAMAgsgBCAGKQAANwMADAELQQghByAEQQhqIQgDQCAIIAYgByABIAEgB0sbIgUQByAFaiEIIAcgBWsiBw0ACyAEIAQpAwg3AwALAkAgBQ0AIAJBEEkNACAEKQMAIQMgAkEQayIGQQR2QQFqQQdxIgEEQANAIAAgAzcACCAAIAM3AAAgAkEQayECIABBEGohACABQQFrIgENAAsLIAZB8ABJDQADQCAAIAM3AHggACADNwBwIAAgAzcAaCAAIAM3AGAgACADNwBYIAAgAzcAUCAAIAM3AEggACADNwBAIAAgAzcAOCAAIAM3ADAgACADNwAoIAAgAzcAICAAIAM3ABggACADNwAQIAAgAzcACCAAIAM3AAAgAEGAAWohACACQYABayICQQ9LDQALCyACQQhPBEBBCCAFayEBA0AgACAEKQMANwAAIAAgAWohACACIAFrIgJBB0sNAAsLIAJFDQEgACAEIAIQBxoLIAAgAmohAAsgBEEQaiQAIAALXwECfyAAKAIIIgEEQCABEAsgAEEANgIICwJAIAAoAgQiAUUNACABKAIAIgJBAXFFDQAgASgCEEF+Rw0AIAEgAkF+cSICNgIAIAINACABECAgAEEANgIECyAAQQA6AAwL1wICBH8BfgJAAkAgACgCQCABp0EEdGooAgAiA0UEQCACBEAgAkEANgIEIAJBFDYCAAsMAQsgACgCACADKQNIIgdBABAUIQMgACgCACEAIANBf0wEQCACBEAgAiAAKAIMNgIAIAIgACgCEDYCBA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BpCIH0hGiACQSBqIQIgAUEgaiEBIB9CAX0iH0IAUg0ACwsgIELgAFQNAANAIAEgAikAADcAACABIAIpABg3ABggASACKQAQNwAQIAEgAikACDcACCABIAIpADg3ADggASACKQAwNwAwIAEgAikAKDcAKCABIAIpACA3ACAgASACKQBYNwBYIAEgAikAUDcAUCABIAIpAEg3AEggASACKQBANwBAIAEgAikAYDcAYCABIAIpAGg3AGggASACKQBwNwBwIAEgAikAeDcAeCACQYABaiECIAFBgAFqIQEgGkKAAX0iGkIfVg0ACwsgGkIQWgRAIAEgAikAADcAACABIAIpAAg3AAggGkIQfSEaIAJBEGohAiABQRBqIQELIBpCCFoEQCABIAIpAAA3AAAgGkIIfSEaIAJBCGohAiABQQhqIQELIBpCBFoEQCABIAIoAAA2AAAgGkIEfSEaIAJBBGohAiABQQRqIQELIBpCAloEQCABIAIvAAA7AAAgGkICfSEaIAJBAmohAiABQQJqIQELIBwgG30hHCAaUEUEQCABIAItAAA6AAAgAkEBaiECIAFBAWohAQsgHEIAUg0ACwsgDiEGIAwhAwsgBSAGSwRAAkACQCABIANNIAEgDyABa6wiGiAGrSIbIBogG1QbIhqnIglqIgIgA0txDQAgAyAJaiABSyABIANPcQ0AIAEgAyAJEAcaDAELIAEgAyADIAFrIgEgAUEfdSIBaiABcyIBEAcgAWohAiAaIAGtIh59IhxQDQAgASADaiEBA0ACQCAcIB4gHCAeVBsiG0IgVARAIBshGgwBCyAbIhpCIH0iIEIFiEIBfEIDgyIfUEUEQANAIAIgASkAADcAACACIAEpABg3ABggAiABKQAQNwAQIAIgASkACDcACCAaQiB9IRogAUEgaiEBIAJBIGohAiAfQgF9Ih9CAFINAAsLICBC4ABUDQADQCACIAEpAAA3AAAgAiABKQAYNwAYIAIgASkAEDcAECACIAEpAAg3AAggAiABKQA4NwA4IAIgASkAMDcAMCACIAEpACg3ACggAiABKQAgNwAgIAIgASkAWDcAWCACIAEpAFA3AFAgAiABKQBINwBIIAIgASkAQDcAQCACIAEpAGA3AG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WgRAIAIgASkAADcAACACIAEpAAg3AAggGkIQfSEaIAJBEGohAiABQRBqIQELIBpCCFoEQCACIAEpAAA3AAAgGkIIfSEaIAJBCGohAiABQQhqIQELIBpCBFoEQCACIAEoAAA2AAAgGkIEfSEaIAJBBGohAiABQQRqIQELIBpCAloEQCACIAEvAAA7AAAgGkICfSEaIAJBAmohAiABQQJqIQELIBwgG30hHCAaUEUEQCACIAEtAAA6AAAgAkEBaiECIAFBAWohAQsgHFBFDQALDAILAkAgASADTSABIA8gAWusIhogBa0iGyAaIBtUGyIapyIEaiICIANLcQ0AIAMgBGogAUsgASADT3ENACABIAMgBBAHGgwCCyABIAMgAyABayIBIAFBH3UiAWogAXMiARAHIAFqIQIgGiABrSIefSIcUA0BIAEgA2ohAQNAAkAgHCAeIBwgHlQbIhtCIFQEQCAbIRoMAQsgGyIaQiB9IiBCBYhCAXxCA4MiH1BFBEADQCACIAEpAAA3AAAgAiABKQAYNwAYIAIgASkAEDcAECACIAEpAAg3AAggGkIgfSEaIAFBIGohASACQSBqIQIgH0IBfSIfQgBSDQALCyAgQuAAVA0AA0AgAiABKQAANwAAIAIgASkAGDcAGCACIAEpABA3ABAgAiABKQAINwAIIAIgASkAODcAOCACIAEpADA3ADAgAiABKQAoNwAoIAIgASkAIDcAICACIAEpAFg3AFggAiABKQBQNwBQIAIgASkASDcASCACIAEpAEA3AEAgAiABKQBgNwBgIAIgASkAaDcAaCACIAEpAHA3AHAgAiABKQB4NwB4IAFBgAFqIQEgAkGAAWohAiAaQoABfSIaQh9WDQALCyAaQhBaBEAgAiABKQAANwAAIAIgASkACDcACCAaQhB9IRogAkEQaiECIAFBEGohAQsgGkIIWgRAIAIgASkAADcAACAaQgh9IRogAkEIaiECIAFBCGohAQsgGkIEWgRAIAIgASgAADYAACAaQgR9IRogAkEEaiECIAFBBGohAQsgGkICWgRAIAIgAS8AADsAACAaQgJ9IRogAkECaiECIAFBAmohAQsgHCAbfSEcIBpQRQRAIAIgAS0AADoAACACQQF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2AggLDAMLIAAgBiAFLwFqQQAgBCABEQYAIQEgBhALIAFFDQILAkAgDUUEQCABIQMMAQsgACABIAUvAWgQgQEhAyABEAsgA0UNAQsCQCAJRSAMckUEQCADIQEMAQsgACADQQEQgAEhASADEAsgAUUNAQsgASEDDAELQQAhAwsgBUHwAGokACADC4UBAQF/IAFFBEAgAEEIaiIABEAgAEEANgIEIABBEjYCAAtBAA8LQTgQCSIDRQRAIABBCGoiAARAIABBADYCBCAAQQ42AgALQQAPCyADQQA2AhAgA0IANwIIIANCADcDKCADQQA2AgQgAyACNgIAIANCADcDGCADQQA2AjAgACABQTsgAxBCCw8AIAAgASACQQBBABCCAQusAgECfyABRQRAIABBCGoiAARAIABBADYCBCAAQRI2AgALQQAPCwJAIAJBfUsNACACQf//A3FBCEYNACAAQQhqIgAEQCAAQQA2AgQgAEEQNgIAC0EADwsCQEGwwAAQCSIFBEAgBUEANgIIIAVCADcCACAFQYiBAUGogQEgAxs2AqhAIAUgAjYCFCAFIAM6ABAgBUEAOgAPIAVBADsBDCAFIAMgAkF9SyIGcToADiAFQQggAiAGG0H//wNxIAQgBUGIgQFBqIEBIAMbKAIAEQAAIgI2AqxAIAINASAFEDEgBRAGCyAAQQhqIgAEQCAAQQA2AgQgAEEONgIAC0EADwsgACABQTogBRBCIgAEfyAABSAFKAKsQCAFKAKoQCgCBBEDACAFEDEgBRAGQQALC6ABAQF/IAIgACgCBCIDIAIgA0kbIgIEQCAAIAMgAms2AgQCQAJAAkACQCAAKAIcIgMoAhRBAWsOAgEAAgsgA0GgAWogASAAKAIAIAJB3IABKAIAEQgADAILIAAgACgCMCABIAAoAgAgAkHEgAEoAgARBAA2AjAMAQsgASAAKAIAIAIQBxoLIAAgACgCACACajYCACAAIAAoAgggAmo2AggLC7cCAQR/QX4hAgJAIABFDQAgACgCIEUNACAAKAIkIgRFDQAgACgCHCIBRQ0AIAEoAgAgAEcNAAJAAkAgASgCICIDQTlrDjkBAgICAgICAgICAgIBAgICAQICAgICAg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IQcDUAGooAgAgBmoLIgVqIgNBP00EQCALIASthiAMhCELDAELIARBwABGBEAgACgCBCAAKAIQaiAMNwAAIAAgACgCEEEIajYCECAFIQMMAQsgACgCBCAAKAIQaiALIASthiAMhDcAACAAIAAoAhBBCGo2AhAgA0FAaiEDIAtBwAAgBGutiCELCyAAIAs3A5guIAAgAzYCoC4gCSAAKALwLUkNAAsLIAFBgAhqMwEAIQwCQCADIAFBgghqLwEAIgJqIgFBP00EQCAMIAOthiALhCEMDAELIANBwABGBEAgACgCBCAAKAIQaiALNwAAIAAgACgCEEEIajYCECACIQEMAQsgACgCBCAAKAIQaiAMIAOthiALhDcAACAAIAAoAhBBCGo2AhAgAUFAaiEBIAxBwAAgA2utiCEMCyAAIAw3A5guIAAgATYCoC4L8AQBA38gAEHkAWohAgNAIAIgAUECdCIDakEAOwEAIAIgA0EEcmpBADsBACABQQJqIgFBngJHDQALIABBADsBzBUgAEEAOwHYEyAAQZQWakEAOwEAIABBkBZqQQA7AQAgAEGMFmpBADsBACAAQYgWakEAOwEAIABBhBZqQQA7AQAgAEGAFmpBADsBACAAQfwVakEAOwEAIABB+BVqQQA7AQAgAEH0FWpBADsBACAAQfAVakEAOwEAIABB7BVqQQA7AQAgAEHoFWpBADsBACAAQeQVakEAOwEAIABB4BVqQQA7AQAgAEHcFWpBADsBACAAQdgVakEAOwEAIABB1BVqQQA7AQAgAEHQFWpBADsBACAAQcwUakEAOwEAIABByBRqQQA7AQAgAEHEFGpBADsBACAAQcAUakEAOwEAIABBvBRqQQA7AQAgAEG4FGpBADsBACAAQbQUakEAOwEAIABBsBRqQQA7AQAgAEGsFGpBADsBACAAQagUakEAOwEAIABBpBRqQQA7AQAgAEGgFGpBADsBACAAQZwUakEAOwEAIABBmBRqQQA7AQAgAEGUFGpBADsBACAAQZAUakEAOwEAIABBjBRqQQA7AQAgAEGIFGpBADsBACAAQYQUakEAOwEAIABBgBRqQQA7AQAgAEH8E2pBADsBACAAQfgTakEAOwEAIABB9BNqQ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qTsgx50Hmq/gVKKDhGgY6/wtoU7IERsmvKbSBLiaaGzA39HJ9ONroYFAQAAJ0HAAAsCQAAhgUAAEgFAACnBQAAAAQAADIFAAC8BQAALAkAQYDBAAv3CQwACACMAAgATAAIAMwACAAsAAgArAAIAGwACADsAAgAHAAIAJwACABcAAgA3AAIADwACAC8AAgAfAAIAPwACAACAAgAggAIAEIACADCAAgAIgAIAKIACABiAAgA4gAIABIACACSAAgAUgAIANIACAAyAAgAsgAIAHIACADyAAgACgAIAIoACABKAAgAygAIACoACACqAAgAagAIAOoACAAaAAgAmgAIAFoACADaAAgAOgAIALoACAB6AAgA+gAIAAYACACGAAgARgAIAMYACAAmAAgApgAIAGYACADmAAgAFgAIAJYACABWAAgA1gAIADYACAC2AAgAdgAIAPYACAAOAAgAjgAIAE4ACADOAAgALgAIAK4ACABuAAgA7gAIAB4ACACeAAgAXgAIAN4ACAA+AAgAvgAIAH4ACAD+AAgAAQAIAIEACABBAAgAwQAIACEACAChAAgAYQAIAOEACAARAAgAkQAIAFEACADRAAgAMQAIALEACABxAAgA8QAIAAkACACJAAgASQAIAMkACAApAAgAqQAIAGkACADpAAgAGQAIAJkACABZAAgA2QAIADkACAC5AAgAeQAIAPkACAAFAAgAhQAIAEUACADFAAgAJQAIAKUACABlAAgA5QAIABUACACVAAgAVQAIANUACAA1AAgAtQAIAHUACAD1AAgADQAIAI0ACABNAAgAzQAIAC0ACACtAAgAbQAIAO0ACAAdAAgAnQAIAF0ACADdAAgAPQAIAL0ACAB9AAgA/QAIABMACQATAQkAkwAJAJMBCQBTAAkAUwEJANMACQDTAQkAMwAJADMBCQCzAAkAswEJAHMACQBzAQkA8wAJAPMBCQALAAkACwEJAIsACQCLAQkASwAJAEsBCQDLAAkAywEJACsACQArAQkAqwAJAKsBCQBrAAkAawEJAOsACQDrAQkAGwAJABsBCQCbAAkAmwEJAFsACQBbAQkA2wAJANsBCQA7AAkAOwEJALsACQC7AQkAewAJAHsBCQD7AAkA+wEJAAcACQA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pb24gcmVzZXQgYnkgbmV0d29yawBDb25uZWN0aW9uIGFib3J0ZWQATm8gYnVmZmVyIHNwYWNlIGF2YWlsYWJsZQBTb2NrZXQgaXMgY29ubmVjdGVkAFNvY2tldCBub3QgY29ubmVjdGVkAENhbm5vdCBzZW5kIGFmdGVyIHNvY2tldCBzaHV0ZG93bgBPcGVyYXRpb24gYWxyZWFkeSBpbiBwcm9ncmVzcwBPcGVyYXRpb24gaW4gcHJvZ3Jlc3MAU3RhbGUgZmlsZSBoYW5kbGUAUmVtb3RlIEkvTyBlcnJvcgBRdW90YSBleGNlZWRlZABObyBtZWRpdW0gZm91bmQAV3JvbmcgbWVkaXVtIHR5cGUATm8gZXJyb3IgaW5mb3JtYXRpb24AQcCAAQuFARMAAAAUAAAAFQAAABYAAAAXAAAAGAAAABkAAAAaAAAAGwAAABwAAAAdAAAAHgAAAB8AAAAgAAAAIQAAACIAAAAjAAAAgERQADEAAAAyAAAAMwAAADQAAAA1AAAANgAAADcAAAA4AAAAOQAAADIAAAAzAAAANAAAADUAAAA2AAAANwAAADgAQfSCAQsCXEQAQbCDAQsQ/////////////////////w=="; - if (!isDataURI(wasmBinaryFile)) { - wasmBinaryFile = locateFile(wasmBinaryFile); - } - function getBinary(file) { - try { - if (file == wasmBinaryFile && wasmBinary) { - return new Uint8Array(wasmBinary); - } - var binary = tryParseAsDataURI(file); - if (binary) { - return binary; - } - if (readBinary) { - return readBinary(file); - } else { - throw "sync fetching of the wasm failed: you can preload it to Module['wasmBinary'] manually, or emcc.py will do that for you when generating HTML (but not JS)"; - } - } catch (err2) { - abort(err2); - } - } - function instantiateSync(file, info) { - var instance; - var module2; - var binary; - try { - binary = getBinary(file); - module2 = new WebAssembly.Module(binary); - instance = new WebAssembly.Instance(module2, info); - } catch (e) { - var str = e.toString(); - err("failed to compile wasm module: " + str); - if (str.includes("imported Memory") || str.includes("memory import")) { - err( - "Memory size incompatibility issues may be due to changing INITIAL_MEMORY at runtime to something too large. Use ALLOW_MEMORY_GROWTH to allow any size memory (and also make sure not to set INITIAL_MEMORY at runtime to something smaller than it was at compile time)." - ); - } - throw e; - } - return [instance, module2]; - } - function createWasm() { - var info = { a: asmLibraryArg }; - function receiveInstance(instance, module2) { - var exports3 = instance.exports; - Module["asm"] = exports3; - wasmMemory = Module["asm"]["g"]; - updateGlobalBufferAndViews(wasmMemory.buffer); - wasmTable = Module["asm"]["W"]; - addOnInit(Module["asm"]["h"]); - removeRunDependency(); - } - addRunDependency(); - if (Module["instantiateWasm"]) { - try { - var exports2 = Module["instantiateWasm"](info, receiveInstance); - return exports2; - } catch (e) { - err("Module.instantiateWasm callback failed with error: " + e); - return false; - } - } - var result = instantiateSync(wasmBinaryFile, info); - receiveInstance(result[0]); - return Module["asm"]; - } - function LE_HEAP_LOAD_F32(byteOffset) { - return HEAP_DATA_VIEW.getFloat32(byteOffset, true); - } - function LE_HEAP_LOAD_F64(byteOffset) { - return HEAP_DATA_VIEW.getFloat64(byteOffset, true); - } - function LE_HEAP_LOAD_I16(byteOffset) { - return HEAP_DATA_VIEW.getInt16(byteOffset, true); - } - function LE_HEAP_LOAD_I32(byteOffset) { - return HEAP_DATA_VIEW.getInt32(byteOffset, true); - } - function LE_HEAP_STORE_I32(byteOffset, value) { - HEAP_DATA_VIEW.setInt32(byteOffset, value, true); - } - function callRuntimeCallbacks(callbacks) { - while (callbacks.length > 0) { - var callback = callbacks.shift(); - if (typeof callback == "function") { - callback(Module); - continue; - } - var func = callback.func; - if (typeof func === "number") { - if (callback.arg === void 0) { - wasmTable.get(func)(); - } else { - wasmTable.get(func)(callback.arg); - } - } else { - func(callback.arg === void 0 ? null : callback.arg); - } - } - } - function _gmtime_r(time, tmPtr) { - var date = new Date(LE_HEAP_LOAD_I32((time >> 2) * 4) * 1e3); - LE_HEAP_STORE_I32((tmPtr >> 2) * 4, date.getUTCSeconds()); - LE_HEAP_STORE_I32((tmPtr + 4 >> 2) * 4, date.getUTCMinutes()); - LE_HEAP_STORE_I32((tmPtr + 8 >> 2) * 4, date.getUTCHours()); - LE_HEAP_STORE_I32((tmPtr + 12 >> 2) * 4, date.getUTCDate()); - LE_HEAP_STORE_I32((tmPtr + 16 >> 2) * 4, date.getUTCMonth()); - LE_HEAP_STORE_I32((tmPtr + 20 >> 2) * 4, date.getUTCFullYear() - 1900); - LE_HEAP_STORE_I32((tmPtr + 24 >> 2) * 4, date.getUTCDay()); - LE_HEAP_STORE_I32((tmPtr + 36 >> 2) * 4, 0); - LE_HEAP_STORE_I32((tmPtr + 32 >> 2) * 4, 0); - var start = Date.UTC(date.getUTCFullYear(), 0, 1, 0, 0, 0, 0); - var yday = (date.getTime() - start) / (1e3 * 60 * 60 * 24) | 0; - LE_HEAP_STORE_I32((tmPtr + 28 >> 2) * 4, yday); - if (!_gmtime_r.GMTString) - _gmtime_r.GMTString = allocateUTF8("GMT"); - LE_HEAP_STORE_I32((tmPtr + 40 >> 2) * 4, _gmtime_r.GMTString); - return tmPtr; - } - function ___gmtime_r(a0, a1) { - return _gmtime_r(a0, a1); - } - function _emscripten_memcpy_big(dest, src, num) { - HEAPU8.copyWithin(dest, src, src + num); - } - function emscripten_realloc_buffer(size) { - try { - wasmMemory.grow(size - buffer.byteLength + 65535 >>> 16); - updateGlobalBufferAndViews(wasmMemory.buffer); - return 1; - } catch (e) { - } - } - function _emscripten_resize_heap(requestedSize) { - var oldSize = HEAPU8.length; - requestedSize = requestedSize >>> 0; - var maxHeapSize = 2147483648; - if (requestedSize > maxHeapSize) { - return false; - } - for (var cutDown = 1; cutDown <= 4; cutDown *= 2) { - var overGrownHeapSize = oldSize * (1 + 0.2 / cutDown); - overGrownHeapSize = Math.min( - overGrownHeapSize, - requestedSize + 100663296 - ); - var newSize = Math.min( - maxHeapSize, - alignUp(Math.max(requestedSize, overGrownHeapSize), 65536) - ); - var replacement = emscripten_realloc_buffer(newSize); - if (replacement) { - return true; - } - } - return false; - } - function _setTempRet0(val) { - } - function _time(ptr) { - var ret = Date.now() / 1e3 | 0; - if (ptr) { - LE_HEAP_STORE_I32((ptr >> 2) * 4, ret); - } - return ret; - } - function _tzset() { - if (_tzset.called) - return; - _tzset.called = true; - var currentYear = new Date().getFullYear(); - var winter = new Date(currentYear, 0, 1); - var summer = new Date(currentYear, 6, 1); - var winterOffset = winter.getTimezoneOffset(); - var summerOffset = summer.getTimezoneOffset(); - var stdTimezoneOffset = Math.max(winterOffset, summerOffset); - LE_HEAP_STORE_I32((__get_timezone() >> 2) * 4, stdTimezoneOffset * 60); - LE_HEAP_STORE_I32( - (__get_daylight() >> 2) * 4, - Number(winterOffset != summerOffset) - ); - function extractZone(date) { - var match = date.toTimeString().match(/\(([A-Za-z ]+)\)$/); - return match ? match[1] : "GMT"; - } - var winterName = extractZone(winter); - var summerName = extractZone(summer); - var winterNamePtr = allocateUTF8(winterName); - var summerNamePtr = allocateUTF8(summerName); - if (summerOffset < winterOffset) { - LE_HEAP_STORE_I32((__get_tzname() >> 2) * 4, winterNamePtr); - LE_HEAP_STORE_I32((__get_tzname() + 4 >> 2) * 4, summerNamePtr); - } else { - LE_HEAP_STORE_I32((__get_tzname() >> 2) * 4, summerNamePtr); - LE_HEAP_STORE_I32((__get_tzname() + 4 >> 2) * 4, winterNamePtr); - } - } - function _timegm(tmPtr) { - _tzset(); - var time = Date.UTC( - LE_HEAP_LOAD_I32((tmPtr + 20 >> 2) * 4) + 1900, - LE_HEAP_LOAD_I32((tmPtr + 16 >> 2) * 4), - LE_HEAP_LOAD_I32((tmPtr + 12 >> 2) * 4), - LE_HEAP_LOAD_I32((tmPtr + 8 >> 2) * 4), - LE_HEAP_LOAD_I32((tmPtr + 4 >> 2) * 4), - LE_HEAP_LOAD_I32((tmPtr >> 2) * 4), - 0 - ); - var date = new Date(time); - LE_HEAP_STORE_I32((tmPtr + 24 >> 2) * 4, date.getUTCDay()); - var start = Date.UTC(date.getUTCFullYear(), 0, 1, 0, 0, 0, 0); - var yday = (date.getTime() - start) / (1e3 * 60 * 60 * 24) | 0; - LE_HEAP_STORE_I32((tmPtr + 28 >> 2) * 4, yday); - return date.getTime() / 1e3 | 0; - } - function intArrayFromBase64(s) { - { - var buf; - try { - buf = Buffer.from(s, "base64"); - } catch (_) { - buf = new Buffer(s, "base64"); - } - return new Uint8Array( - buf["buffer"], - buf["byteOffset"], - buf["byteLength"] - ); - } - } - function tryParseAsDataURI(filename) { - if (!isDataURI(filename)) { - return; - } - return intArrayFromBase64(filename.slice(dataURIPrefix.length)); - } - var asmLibraryArg = { - e: ___gmtime_r, - c: _emscripten_memcpy_big, - d: _emscripten_resize_heap, - a: _setTempRet0, - b: _time, - f: _timegm - }; - var asm = createWasm(); - Module["___wasm_call_ctors"] = asm["h"]; - Module["_zip_ext_count_symlinks"] = asm["i"]; - Module["_zip_file_get_external_attributes"] = asm["j"]; - Module["_zipstruct_statS"] = asm["k"]; - Module["_zipstruct_stat_size"] = asm["l"]; - Module["_zipstruct_stat_mtime"] = asm["m"]; - Module["_zipstruct_stat_crc"] = asm["n"]; - Module["_zipstruct_errorS"] = asm["o"]; - Module["_zipstruct_error_code_zip"] = asm["p"]; - Module["_zipstruct_stat_comp_size"] = asm["q"]; - Module["_zipstruct_stat_comp_method"] = asm["r"]; - Module["_zip_close"] = asm["s"]; - Module["_zip_delete"] = asm["t"]; - Module["_zip_dir_add"] = asm["u"]; - Module["_zip_discard"] = asm["v"]; - Module["_zip_error_init_with_code"] = asm["w"]; - Module["_zip_get_error"] = asm["x"]; - Module["_zip_file_get_error"] = asm["y"]; - Module["_zip_error_strerror"] = asm["z"]; - Module["_zip_fclose"] = asm["A"]; - Module["_zip_file_add"] = asm["B"]; - Module["_free"] = asm["C"]; - var _malloc = Module["_malloc"] = asm["D"]; - Module["_zip_source_error"] = asm["E"]; - Module["_zip_source_seek"] = asm["F"]; - Module["_zip_file_set_external_attributes"] = asm["G"]; - Module["_zip_file_set_mtime"] = asm["H"]; - Module["_zip_fopen_index"] = asm["I"]; - Module["_zip_fread"] = asm["J"]; - Module["_zip_get_name"] = asm["K"]; - Module["_zip_get_num_entries"] = asm["L"]; - Module["_zip_source_read"] = asm["M"]; - Module["_zip_name_locate"] = asm["N"]; - Module["_zip_open_from_source"] = asm["O"]; - Module["_zip_set_file_compression"] = asm["P"]; - Module["_zip_source_buffer"] = asm["Q"]; - Module["_zip_source_buffer_create"] = asm["R"]; - Module["_zip_source_close"] = asm["S"]; - Module["_zip_source_free"] = asm["T"]; - Module["_zip_source_keep"] = asm["U"]; - Module["_zip_source_open"] = asm["V"]; - Module["_zip_source_tell"] = asm["X"]; - Module["_zip_stat_index"] = asm["Y"]; - var __get_tzname = Module["__get_tzname"] = asm["Z"]; - var __get_daylight = Module["__get_daylight"] = asm["_"]; - var __get_timezone = Module["__get_timezone"] = asm["$"]; - var stackSave = Module["stackSave"] = asm["aa"]; - var stackRestore = Module["stackRestore"] = asm["ba"]; - var stackAlloc = Module["stackAlloc"] = asm["ca"]; - Module["cwrap"] = cwrap; - Module["getValue"] = getValue; - var calledRun; - dependenciesFulfilled = function runCaller() { - if (!calledRun) - run(); - if (!calledRun) - dependenciesFulfilled = runCaller; - }; - function run(args) { - if (runDependencies > 0) { - return; - } - preRun(); - if (runDependencies > 0) { - return; - } - function doRun() { - if (calledRun) - return; - calledRun = true; - Module["calledRun"] = true; - if (ABORT) - return; - initRuntime(); - readyPromiseResolve(Module); - if (Module["onRuntimeInitialized"]) - Module["onRuntimeInitialized"](); - postRun(); - } - if (Module["setStatus"]) { - Module["setStatus"]("Running..."); - setTimeout(function() { - setTimeout(function() { - Module["setStatus"](""); - }, 1); - doRun(); - }, 1); - } else { - doRun(); - } - } - Module["run"] = run; - if (Module["preInit"]) { - if (typeof Module["preInit"] == "function") - Module["preInit"] = [Module["preInit"]]; - while (Module["preInit"].length > 0) { - Module["preInit"].pop()(); - } - } - run(); - return createModule2; - }; -}(); -module.exports = createModule; -}(libzipSync)); - -const createModule = libzipSync.exports; - -const number64 = [ - `number`, - `number` -]; -var Errors = /* @__PURE__ */ ((Errors2) => { - Errors2[Errors2["ZIP_ER_OK"] = 0] = "ZIP_ER_OK"; - Errors2[Errors2["ZIP_ER_MULTIDISK"] = 1] = "ZIP_ER_MULTIDISK"; - Errors2[Errors2["ZIP_ER_RENAME"] = 2] = "ZIP_ER_RENAME"; - Errors2[Errors2["ZIP_ER_CLOSE"] = 3] = "ZIP_ER_CLOSE"; - Errors2[Errors2["ZIP_ER_SEEK"] = 4] = "ZIP_ER_SEEK"; - Errors2[Errors2["ZIP_ER_READ"] = 5] = "ZIP_ER_READ"; - Errors2[Errors2["ZIP_ER_WRITE"] = 6] = "ZIP_ER_WRITE"; - Errors2[Errors2["ZIP_ER_CRC"] = 7] = "ZIP_ER_CRC"; - Errors2[Errors2["ZIP_ER_ZIPCLOSED"] = 8] = "ZIP_ER_ZIPCLOSED"; - Errors2[Errors2["ZIP_ER_NOENT"] = 9] = "ZIP_ER_NOENT"; - Errors2[Errors2["ZIP_ER_EXISTS"] = 10] = "ZIP_ER_EXISTS"; - Errors2[Errors2["ZIP_ER_OPEN"] = 11] = "ZIP_ER_OPEN"; - Errors2[Errors2["ZIP_ER_TMPOPEN"] = 12] = "ZIP_ER_TMPOPEN"; - Errors2[Errors2["ZIP_ER_ZLIB"] = 13] = "ZIP_ER_ZLIB"; - Errors2[Errors2["ZIP_ER_MEMORY"] = 14] = "ZIP_ER_MEMORY"; - Errors2[Errors2["ZIP_ER_CHANGED"] = 15] = "ZIP_ER_CHANGED"; - Errors2[Errors2["ZIP_ER_COMPNOTSUPP"] = 16] = "ZIP_ER_COMPNOTSUPP"; - Errors2[Errors2["ZIP_ER_EOF"] = 17] = "ZIP_ER_EOF"; - Errors2[Errors2["ZIP_ER_INVAL"] = 18] = "ZIP_ER_INVAL"; - Errors2[Errors2["ZIP_ER_NOZIP"] = 19] = "ZIP_ER_NOZIP"; - Errors2[Errors2["ZIP_ER_INTERNAL"] = 20] = "ZIP_ER_INTERNAL"; - Errors2[Errors2["ZIP_ER_INCONS"] = 21] = "ZIP_ER_INCONS"; - Errors2[Errors2["ZIP_ER_REMOVE"] = 22] = "ZIP_ER_REMOVE"; - Errors2[Errors2["ZIP_ER_DELETED"] = 23] = "ZIP_ER_DELETED"; - Errors2[Errors2["ZIP_ER_ENCRNOTSUPP"] = 24] = "ZIP_ER_ENCRNOTSUPP"; - Errors2[Errors2["ZIP_ER_RDONLY"] = 25] = "ZIP_ER_RDONLY"; - Errors2[Errors2["ZIP_ER_NOPASSWD"] = 26] = "ZIP_ER_NOPASSWD"; - Errors2[Errors2["ZIP_ER_WRONGPASSWD"] = 27] = "ZIP_ER_WRONGPASSWD"; - Errors2[Errors2["ZIP_ER_OPNOTSUPP"] = 28] = "ZIP_ER_OPNOTSUPP"; - Errors2[Errors2["ZIP_ER_INUSE"] = 29] = "ZIP_ER_INUSE"; - Errors2[Errors2["ZIP_ER_TELL"] = 30] = "ZIP_ER_TELL"; - Errors2[Errors2["ZIP_ER_COMPRESSED_DATA"] = 31] = "ZIP_ER_COMPRESSED_DATA"; - return Errors2; -})(Errors || {}); -const makeInterface = (emZip) => ({ - get HEAPU8() { - return emZip.HEAPU8; - }, - errors: Errors, - SEEK_SET: 0, - SEEK_CUR: 1, - SEEK_END: 2, - ZIP_CHECKCONS: 4, - ZIP_EXCL: 2, - ZIP_RDONLY: 16, - ZIP_FL_OVERWRITE: 8192, - ZIP_FL_COMPRESSED: 4, - ZIP_OPSYS_DOS: 0, - ZIP_OPSYS_AMIGA: 1, - ZIP_OPSYS_OPENVMS: 2, - ZIP_OPSYS_UNIX: 3, - ZIP_OPSYS_VM_CMS: 4, - ZIP_OPSYS_ATARI_ST: 5, - ZIP_OPSYS_OS_2: 6, - ZIP_OPSYS_MACINTOSH: 7, - ZIP_OPSYS_Z_SYSTEM: 8, - ZIP_OPSYS_CPM: 9, - ZIP_OPSYS_WINDOWS_NTFS: 10, - ZIP_OPSYS_MVS: 11, - ZIP_OPSYS_VSE: 12, - ZIP_OPSYS_ACORN_RISC: 13, - ZIP_OPSYS_VFAT: 14, - ZIP_OPSYS_ALTERNATE_MVS: 15, - ZIP_OPSYS_BEOS: 16, - ZIP_OPSYS_TANDEM: 17, - ZIP_OPSYS_OS_400: 18, - ZIP_OPSYS_OS_X: 19, - ZIP_CM_DEFAULT: -1, - ZIP_CM_STORE: 0, - ZIP_CM_DEFLATE: 8, - uint08S: emZip._malloc(1), - uint32S: emZip._malloc(4), - malloc: emZip._malloc, - free: emZip._free, - getValue: emZip.getValue, - openFromSource: emZip.cwrap(`zip_open_from_source`, `number`, [`number`, `number`, `number`]), - close: emZip.cwrap(`zip_close`, `number`, [`number`]), - discard: emZip.cwrap(`zip_discard`, null, [`number`]), - getError: emZip.cwrap(`zip_get_error`, `number`, [`number`]), - getName: emZip.cwrap(`zip_get_name`, `string`, [`number`, `number`, `number`]), - getNumEntries: emZip.cwrap(`zip_get_num_entries`, `number`, [`number`, `number`]), - delete: emZip.cwrap(`zip_delete`, `number`, [`number`, `number`]), - statIndex: emZip.cwrap(`zip_stat_index`, `number`, [`number`, ...number64, `number`, `number`]), - fopenIndex: emZip.cwrap(`zip_fopen_index`, `number`, [`number`, ...number64, `number`]), - fread: emZip.cwrap(`zip_fread`, `number`, [`number`, `number`, `number`, `number`]), - fclose: emZip.cwrap(`zip_fclose`, `number`, [`number`]), - dir: { - add: emZip.cwrap(`zip_dir_add`, `number`, [`number`, `string`]) - }, - file: { - add: emZip.cwrap(`zip_file_add`, `number`, [`number`, `string`, `number`, `number`]), - getError: emZip.cwrap(`zip_file_get_error`, `number`, [`number`]), - getExternalAttributes: emZip.cwrap(`zip_file_get_external_attributes`, `number`, [`number`, ...number64, `number`, `number`, `number`]), - setExternalAttributes: emZip.cwrap(`zip_file_set_external_attributes`, `number`, [`number`, ...number64, `number`, `number`, `number`]), - setMtime: emZip.cwrap(`zip_file_set_mtime`, `number`, [`number`, ...number64, `number`, `number`]), - setCompression: emZip.cwrap(`zip_set_file_compression`, `number`, [`number`, ...number64, `number`, `number`]) - }, - ext: { - countSymlinks: emZip.cwrap(`zip_ext_count_symlinks`, `number`, [`number`]) - }, - error: { - initWithCode: emZip.cwrap(`zip_error_init_with_code`, null, [`number`, `number`]), - strerror: emZip.cwrap(`zip_error_strerror`, `string`, [`number`]) - }, - name: { - locate: emZip.cwrap(`zip_name_locate`, `number`, [`number`, `string`, `number`]) - }, - source: { - fromUnattachedBuffer: emZip.cwrap(`zip_source_buffer_create`, `number`, [`number`, ...number64, `number`, `number`]), - fromBuffer: emZip.cwrap(`zip_source_buffer`, `number`, [`number`, `number`, ...number64, `number`]), - free: emZip.cwrap(`zip_source_free`, null, [`number`]), - keep: emZip.cwrap(`zip_source_keep`, null, [`number`]), - open: emZip.cwrap(`zip_source_open`, `number`, [`number`]), - close: emZip.cwrap(`zip_source_close`, `number`, [`number`]), - seek: emZip.cwrap(`zip_source_seek`, `number`, [`number`, ...number64, `number`]), - tell: emZip.cwrap(`zip_source_tell`, `number`, [`number`]), - read: emZip.cwrap(`zip_source_read`, `number`, [`number`, `number`, `number`]), - error: emZip.cwrap(`zip_source_error`, `number`, [`number`]) - }, - struct: { - statS: emZip.cwrap(`zipstruct_statS`, `number`, []), - statSize: emZip.cwrap(`zipstruct_stat_size`, `number`, [`number`]), - statCompSize: emZip.cwrap(`zipstruct_stat_comp_size`, `number`, [`number`]), - statCompMethod: emZip.cwrap(`zipstruct_stat_comp_method`, `number`, [`number`]), - statMtime: emZip.cwrap(`zipstruct_stat_mtime`, `number`, [`number`]), - statCrc: emZip.cwrap(`zipstruct_stat_crc`, `number`, [`number`]), - errorS: emZip.cwrap(`zipstruct_errorS`, `number`, []), - errorCodeZip: emZip.cwrap(`zipstruct_error_code_zip`, `number`, [`number`]) - } -}); - -function getArchivePart(path, extension) { - let idx = path.indexOf(extension); - if (idx <= 0) - return null; - let nextCharIdx = idx; - while (idx >= 0) { - nextCharIdx = idx + extension.length; - if (path[nextCharIdx] === ppath.sep) - break; - if (path[idx - 1] === ppath.sep) - return null; - idx = path.indexOf(extension, nextCharIdx); - } - if (path.length > nextCharIdx && path[nextCharIdx] !== ppath.sep) - return null; - return path.slice(0, nextCharIdx); -} -class ZipOpenFS extends MountFS { - static async openPromise(fn, opts) { - const zipOpenFs = new ZipOpenFS(opts); - try { - return await fn(zipOpenFs); - } finally { - zipOpenFs.saveAndClose(); - } - } - constructor(opts = {}) { - const fileExtensions = opts.fileExtensions; - const readOnlyArchives = opts.readOnlyArchives; - const getMountPoint = typeof fileExtensions === `undefined` ? (path) => getArchivePart(path, `.zip`) : (path) => { - for (const extension of fileExtensions) { - const result = getArchivePart(path, extension); - if (result) { - return result; - } - } - return null; - }; - const factorySync = (baseFs, p) => { - return new ZipFS(p, { - baseFs, - readOnly: readOnlyArchives, - stats: baseFs.statSync(p) - }); - }; - const factoryPromise = async (baseFs, p) => { - const zipOptions = { - baseFs, - readOnly: readOnlyArchives, - stats: await baseFs.statPromise(p) - }; - return () => { - return new ZipFS(p, zipOptions); - }; - }; - super({ - ...opts, - factorySync, - factoryPromise, - getMountPoint - }); - } -} - -const DEFAULT_COMPRESSION_LEVEL = `mixed`; -function toUnixTimestamp(time) { - if (typeof time === `string` && String(+time) === time) - return +time; - if (typeof time === `number` && Number.isFinite(time)) { - if (time < 0) { - return Date.now() / 1e3; - } else { - return time; - } - } - if (nodeUtils.types.isDate(time)) - return time.getTime() / 1e3; - throw new Error(`Invalid time`); -} -function makeEmptyArchive() { - return Buffer.from([ - 80, - 75, - 5, - 6, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0 - ]); -} -class LibzipError extends Error { - constructor(message, code) { - super(message); - this.name = `Libzip Error`; - this.code = code; - } -} -class ZipFS extends BasePortableFakeFS { - constructor(source, opts = {}) { - super(); - this.listings = /* @__PURE__ */ new Map(); - this.entries = /* @__PURE__ */ new Map(); - this.fileSources = /* @__PURE__ */ new Map(); - this.fds = /* @__PURE__ */ new Map(); - this.nextFd = 0; - this.ready = false; - this.readOnly = false; - const pathOptions = opts; - this.level = typeof pathOptions.level !== `undefined` ? pathOptions.level : DEFAULT_COMPRESSION_LEVEL; - source ??= makeEmptyArchive(); - if (typeof source === `string`) { - const { baseFs = new NodeFS() } = pathOptions; - this.baseFs = baseFs; - this.path = source; - } else { - this.path = null; - this.baseFs = null; - } - if (opts.stats) { - this.stats = opts.stats; - } else { - if (typeof source === `string`) { - try { - this.stats = this.baseFs.statSync(source); - } catch (error) { - if (error.code === `ENOENT` && pathOptions.create) { - this.stats = makeDefaultStats(); - } else { - throw error; - } - } - } else { - this.stats = makeDefaultStats(); - } - } - this.libzip = getInstance(); - const errPtr = this.libzip.malloc(4); - try { - let flags = 0; - if (opts.readOnly) { - flags |= this.libzip.ZIP_RDONLY; - this.readOnly = true; - } - if (typeof source === `string`) - source = pathOptions.create ? makeEmptyArchive() : this.baseFs.readFileSync(source); - const lzSource = this.allocateUnattachedSource(source); - try { - this.zip = this.libzip.openFromSource(lzSource, flags, errPtr); - this.lzSource = lzSource; - } catch (error) { - this.libzip.source.free(lzSource); - throw error; - } - if (this.zip === 0) { - const error = this.libzip.struct.errorS(); - this.libzip.error.initWithCode(error, this.libzip.getValue(errPtr, `i32`)); - throw this.makeLibzipError(error); - } - } finally { - this.libzip.free(errPtr); - } - this.listings.set(PortablePath.root, /* @__PURE__ */ new Set()); - const entryCount = this.libzip.getNumEntries(this.zip, 0); - for (let t = 0; t < entryCount; ++t) { - const raw = this.libzip.getName(this.zip, t, 0); - if (ppath.isAbsolute(raw)) - continue; - const p = ppath.resolve(PortablePath.root, raw); - this.registerEntry(p, t); - if (raw.endsWith(`/`)) { - this.registerListing(p); - } - } - this.symlinkCount = this.libzip.ext.countSymlinks(this.zip); - if (this.symlinkCount === -1) - throw this.makeLibzipError(this.libzip.getError(this.zip)); - this.ready = true; - } - makeLibzipError(error) { - const errorCode = this.libzip.struct.errorCodeZip(error); - const strerror = this.libzip.error.strerror(error); - const libzipError = new LibzipError(strerror, this.libzip.errors[errorCode]); - if (errorCode === this.libzip.errors.ZIP_ER_CHANGED) - throw new Error(`Assertion failed: Unexpected libzip error: ${libzipError.message}`); - return libzipError; - } - getExtractHint(hints) { - for (const fileName of this.entries.keys()) { - const ext = this.pathUtils.extname(fileName); - if (hints.relevantExtensions.has(ext)) { - return true; - } - } - return false; - } - getAllFiles() { - return Array.from(this.entries.keys()); - } - getRealPath() { - if (!this.path) - throw new Error(`ZipFS don't have real paths when loaded from a buffer`); - return this.path; - } - prepareClose() { - if (!this.ready) - throw EBUSY(`archive closed, close`); - unwatchAllFiles(this); - } - getBufferAndClose() { - this.prepareClose(); - if (this.entries.size === 0) { - this.discardAndClose(); - return makeEmptyArchive(); - } - try { - this.libzip.source.keep(this.lzSource); - if (this.libzip.close(this.zip) === -1) - throw this.makeLibzipError(this.libzip.getError(this.zip)); - if (this.libzip.source.open(this.lzSource) === -1) - throw this.makeLibzipError(this.libzip.source.error(this.lzSource)); - if (this.libzip.source.seek(this.lzSource, 0, 0, this.libzip.SEEK_END) === -1) - throw this.makeLibzipError(this.libzip.source.error(this.lzSource)); - const size = this.libzip.source.tell(this.lzSource); - if (size === -1) - throw this.makeLibzipError(this.libzip.source.error(this.lzSource)); - if (this.libzip.source.seek(this.lzSource, 0, 0, this.libzip.SEEK_SET) === -1) - throw this.makeLibzipError(this.libzip.source.error(this.lzSource)); - const buffer = this.libzip.malloc(size); - if (!buffer) - throw new Error(`Couldn't allocate enough memory`); - try { - const rc = this.libzip.source.read(this.lzSource, buffer, size); - if (rc === -1) - throw this.makeLibzipError(this.libzip.source.error(this.lzSource)); - else if (rc < size) - throw new Error(`Incomplete read`); - else if (rc > size) - throw new Error(`Overread`); - let result = Buffer.from(this.libzip.HEAPU8.subarray(buffer, buffer + size)); - if (process.env.YARN_IS_TEST_ENV && process.env.YARN_ZIP_DATA_EPILOGUE) - result = Buffer.concat([result, Buffer.from(process.env.YARN_ZIP_DATA_EPILOGUE)]); - return result; - } finally { - this.libzip.free(buffer); - } - } finally { - this.libzip.source.close(this.lzSource); - this.libzip.source.free(this.lzSource); - this.ready = false; - } - } - discardAndClose() { - this.prepareClose(); - this.libzip.discard(this.zip); - this.ready = false; - } - saveAndClose() { - if (!this.path || !this.baseFs) - throw new Error(`ZipFS cannot be saved and must be discarded when loaded from a buffer`); - if (this.readOnly) { - this.discardAndClose(); - return; - } - const newMode = this.baseFs.existsSync(this.path) || this.stats.mode === DEFAULT_MODE ? void 0 : this.stats.mode; - this.baseFs.writeFileSync(this.path, this.getBufferAndClose(), { mode: newMode }); - this.ready = false; - } - resolve(p) { - return ppath.resolve(PortablePath.root, p); - } - async openPromise(p, flags, mode) { - return this.openSync(p, flags, mode); - } - openSync(p, flags, mode) { - const fd = this.nextFd++; - this.fds.set(fd, { cursor: 0, p }); - return fd; - } - hasOpenFileHandles() { - return !!this.fds.size; - } - async opendirPromise(p, opts) { - return this.opendirSync(p, opts); - } - opendirSync(p, opts = {}) { - const resolvedP = this.resolveFilename(`opendir '${p}'`, p); - if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) - throw ENOENT(`opendir '${p}'`); - const directoryListing = this.listings.get(resolvedP); - if (!directoryListing) - throw ENOTDIR(`opendir '${p}'`); - const entries = [...directoryListing]; - const fd = this.openSync(resolvedP, `r`); - const onClose = () => { - this.closeSync(fd); - }; - return opendir(this, resolvedP, entries, { onClose }); - } - async readPromise(fd, buffer, offset, length, position) { - return this.readSync(fd, buffer, offset, length, position); - } - readSync(fd, buffer, offset = 0, length = buffer.byteLength, position = -1) { - const entry = this.fds.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`read`); - const realPosition = position === -1 || position === null ? entry.cursor : position; - const source = this.readFileSync(entry.p); - source.copy(buffer, offset, realPosition, realPosition + length); - const bytesRead = Math.max(0, Math.min(source.length - realPosition, length)); - if (position === -1 || position === null) - entry.cursor += bytesRead; - return bytesRead; - } - async writePromise(fd, buffer, offset, length, position) { - if (typeof buffer === `string`) { - return this.writeSync(fd, buffer, position); - } else { - return this.writeSync(fd, buffer, offset, length, position); - } - } - writeSync(fd, buffer, offset, length, position) { - const entry = this.fds.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`read`); - throw new Error(`Unimplemented`); - } - async closePromise(fd) { - return this.closeSync(fd); - } - closeSync(fd) { - const entry = this.fds.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`read`); - this.fds.delete(fd); - } - createReadStream(p, { encoding } = {}) { - if (p === null) - throw new Error(`Unimplemented`); - const fd = this.openSync(p, `r`); - const stream$1 = Object.assign( - new stream.PassThrough({ - emitClose: true, - autoDestroy: true, - destroy: (error, callback) => { - clearImmediate(immediate); - this.closeSync(fd); - callback(error); - } - }), - { - close() { - stream$1.destroy(); - }, - bytesRead: 0, - path: p, - pending: false - } - ); - const immediate = setImmediate(async () => { - try { - const data = await this.readFilePromise(p, encoding); - stream$1.bytesRead = data.length; - stream$1.end(data); - } catch (error) { - stream$1.destroy(error); - } - }); - return stream$1; - } - createWriteStream(p, { encoding } = {}) { - if (this.readOnly) - throw EROFS(`open '${p}'`); - if (p === null) - throw new Error(`Unimplemented`); - const chunks = []; - const fd = this.openSync(p, `w`); - const stream$1 = Object.assign( - new stream.PassThrough({ - autoDestroy: true, - emitClose: true, - destroy: (error, callback) => { - try { - if (error) { - callback(error); - } else { - this.writeFileSync(p, Buffer.concat(chunks), encoding); - callback(null); - } - } catch (err) { - callback(err); - } finally { - this.closeSync(fd); - } - } - }), - { - close() { - stream$1.destroy(); - }, - bytesWritten: 0, - path: p, - pending: false - } - ); - stream$1.on(`data`, (chunk) => { - const chunkBuffer = Buffer.from(chunk); - stream$1.bytesWritten += chunkBuffer.length; - chunks.push(chunkBuffer); - }); - return stream$1; - } - async realpathPromise(p) { - return this.realpathSync(p); - } - realpathSync(p) { - const resolvedP = this.resolveFilename(`lstat '${p}'`, p); - if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) - throw ENOENT(`lstat '${p}'`); - return resolvedP; - } - async existsPromise(p) { - return this.existsSync(p); - } - existsSync(p) { - if (!this.ready) - throw EBUSY(`archive closed, existsSync '${p}'`); - if (this.symlinkCount === 0) { - const resolvedP2 = ppath.resolve(PortablePath.root, p); - return this.entries.has(resolvedP2) || this.listings.has(resolvedP2); - } - let resolvedP; - try { - resolvedP = this.resolveFilename(`stat '${p}'`, p, void 0, false); - } catch (error) { - return false; - } - if (resolvedP === void 0) - return false; - return this.entries.has(resolvedP) || this.listings.has(resolvedP); - } - async accessPromise(p, mode) { - return this.accessSync(p, mode); - } - accessSync(p, mode = fs.constants.F_OK) { - const resolvedP = this.resolveFilename(`access '${p}'`, p); - if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) - throw ENOENT(`access '${p}'`); - if (this.readOnly && mode & fs.constants.W_OK) { - throw EROFS(`access '${p}'`); - } - } - async statPromise(p, opts = { bigint: false }) { - if (opts.bigint) - return this.statSync(p, { bigint: true }); - return this.statSync(p); - } - statSync(p, opts = { bigint: false, throwIfNoEntry: true }) { - const resolvedP = this.resolveFilename(`stat '${p}'`, p, void 0, opts.throwIfNoEntry); - if (resolvedP === void 0) - return void 0; - if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) { - if (opts.throwIfNoEntry === false) - return void 0; - throw ENOENT(`stat '${p}'`); - } - if (p[p.length - 1] === `/` && !this.listings.has(resolvedP)) - throw ENOTDIR(`stat '${p}'`); - return this.statImpl(`stat '${p}'`, resolvedP, opts); - } - async fstatPromise(fd, opts) { - return this.fstatSync(fd, opts); - } - fstatSync(fd, opts) { - const entry = this.fds.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`fstatSync`); - const { p } = entry; - const resolvedP = this.resolveFilename(`stat '${p}'`, p); - if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) - throw ENOENT(`stat '${p}'`); - if (p[p.length - 1] === `/` && !this.listings.has(resolvedP)) - throw ENOTDIR(`stat '${p}'`); - return this.statImpl(`fstat '${p}'`, resolvedP, opts); - } - async lstatPromise(p, opts = { bigint: false }) { - if (opts.bigint) - return this.lstatSync(p, { bigint: true }); - return this.lstatSync(p); - } - lstatSync(p, opts = { bigint: false, throwIfNoEntry: true }) { - const resolvedP = this.resolveFilename(`lstat '${p}'`, p, false, opts.throwIfNoEntry); - if (resolvedP === void 0) - return void 0; - if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) { - if (opts.throwIfNoEntry === false) - return void 0; - throw ENOENT(`lstat '${p}'`); - } - if (p[p.length - 1] === `/` && !this.listings.has(resolvedP)) - throw ENOTDIR(`lstat '${p}'`); - return this.statImpl(`lstat '${p}'`, resolvedP, opts); - } - statImpl(reason, p, opts = {}) { - const entry = this.entries.get(p); - if (typeof entry !== `undefined`) { - const stat = this.libzip.struct.statS(); - const rc = this.libzip.statIndex(this.zip, entry, 0, 0, stat); - if (rc === -1) - throw this.makeLibzipError(this.libzip.getError(this.zip)); - const uid = this.stats.uid; - const gid = this.stats.gid; - const size = this.libzip.struct.statSize(stat) >>> 0; - const blksize = 512; - const blocks = Math.ceil(size / blksize); - const mtimeMs = (this.libzip.struct.statMtime(stat) >>> 0) * 1e3; - const atimeMs = mtimeMs; - const birthtimeMs = mtimeMs; - const ctimeMs = mtimeMs; - const atime = new Date(atimeMs); - const birthtime = new Date(birthtimeMs); - const ctime = new Date(ctimeMs); - const mtime = new Date(mtimeMs); - const type = this.listings.has(p) ? fs.constants.S_IFDIR : this.isSymbolicLink(entry) ? fs.constants.S_IFLNK : fs.constants.S_IFREG; - const defaultMode = type === fs.constants.S_IFDIR ? 493 : 420; - const mode = type | this.getUnixMode(entry, defaultMode) & 511; - const crc = this.libzip.struct.statCrc(stat); - const statInstance = Object.assign(new StatEntry(), { uid, gid, size, blksize, blocks, atime, birthtime, ctime, mtime, atimeMs, birthtimeMs, ctimeMs, mtimeMs, mode, crc }); - return opts.bigint === true ? convertToBigIntStats(statInstance) : statInstance; - } - if (this.listings.has(p)) { - const uid = this.stats.uid; - const gid = this.stats.gid; - const size = 0; - const blksize = 512; - const blocks = 0; - const atimeMs = this.stats.mtimeMs; - const birthtimeMs = this.stats.mtimeMs; - const ctimeMs = this.stats.mtimeMs; - const mtimeMs = this.stats.mtimeMs; - const atime = new Date(atimeMs); - const birthtime = new Date(birthtimeMs); - const ctime = new Date(ctimeMs); - const mtime = new Date(mtimeMs); - const mode = fs.constants.S_IFDIR | 493; - const crc = 0; - const statInstance = Object.assign(new StatEntry(), { uid, gid, size, blksize, blocks, atime, birthtime, ctime, mtime, atimeMs, birthtimeMs, ctimeMs, mtimeMs, mode, crc }); - return opts.bigint === true ? convertToBigIntStats(statInstance) : statInstance; - } - throw new Error(`Unreachable`); - } - getUnixMode(index, defaultMode) { - const rc = this.libzip.file.getExternalAttributes(this.zip, index, 0, 0, this.libzip.uint08S, this.libzip.uint32S); - if (rc === -1) - throw this.makeLibzipError(this.libzip.getError(this.zip)); - const opsys = this.libzip.getValue(this.libzip.uint08S, `i8`) >>> 0; - if (opsys !== this.libzip.ZIP_OPSYS_UNIX) - return defaultMode; - return this.libzip.getValue(this.libzip.uint32S, `i32`) >>> 16; - } - registerListing(p) { - const existingListing = this.listings.get(p); - if (existingListing) - return existingListing; - const parentListing = this.registerListing(ppath.dirname(p)); - parentListing.add(ppath.basename(p)); - const newListing = /* @__PURE__ */ new Set(); - this.listings.set(p, newListing); - return newListing; - } - registerEntry(p, index) { - const parentListing = this.registerListing(ppath.dirname(p)); - parentListing.add(ppath.basename(p)); - this.entries.set(p, index); - } - unregisterListing(p) { - this.listings.delete(p); - const parentListing = this.listings.get(ppath.dirname(p)); - parentListing?.delete(ppath.basename(p)); - } - unregisterEntry(p) { - this.unregisterListing(p); - const entry = this.entries.get(p); - this.entries.delete(p); - if (typeof entry === `undefined`) - return; - this.fileSources.delete(entry); - if (this.isSymbolicLink(entry)) { - this.symlinkCount--; - } - } - deleteEntry(p, index) { - this.unregisterEntry(p); - const rc = this.libzip.delete(this.zip, index); - if (rc === -1) { - throw this.makeLibzipError(this.libzip.getError(this.zip)); - } - } - resolveFilename(reason, p, resolveLastComponent = true, throwIfNoEntry = true) { - if (!this.ready) - throw EBUSY(`archive closed, ${reason}`); - let resolvedP = ppath.resolve(PortablePath.root, p); - if (resolvedP === `/`) - return PortablePath.root; - const fileIndex = this.entries.get(resolvedP); - if (resolveLastComponent && fileIndex !== void 0) { - if (this.symlinkCount !== 0 && this.isSymbolicLink(fileIndex)) { - const target = this.getFileSource(fileIndex).toString(); - return this.resolveFilename(reason, ppath.resolve(ppath.dirname(resolvedP), target), true, throwIfNoEntry); - } else { - return resolvedP; - } - } - while (true) { - const parentP = this.resolveFilename(reason, ppath.dirname(resolvedP), true, throwIfNoEntry); - if (parentP === void 0) - return parentP; - const isDir = this.listings.has(parentP); - const doesExist = this.entries.has(parentP); - if (!isDir && !doesExist) { - if (throwIfNoEntry === false) - return void 0; - throw ENOENT(reason); - } - if (!isDir) - throw ENOTDIR(reason); - resolvedP = ppath.resolve(parentP, ppath.basename(resolvedP)); - if (!resolveLastComponent || this.symlinkCount === 0) - break; - const index = this.libzip.name.locate(this.zip, resolvedP.slice(1), 0); - if (index === -1) - break; - if (this.isSymbolicLink(index)) { - const target = this.getFileSource(index).toString(); - resolvedP = ppath.resolve(ppath.dirname(resolvedP), target); - } else { - break; - } - } - return resolvedP; - } - allocateBuffer(content) { - if (!Buffer.isBuffer(content)) - content = Buffer.from(content); - const buffer = this.libzip.malloc(content.byteLength); - if (!buffer) - throw new Error(`Couldn't allocate enough memory`); - const heap = new Uint8Array(this.libzip.HEAPU8.buffer, buffer, content.byteLength); - heap.set(content); - return { buffer, byteLength: content.byteLength }; - } - allocateUnattachedSource(content) { - const error = this.libzip.struct.errorS(); - const { buffer, byteLength } = this.allocateBuffer(content); - const source = this.libzip.source.fromUnattachedBuffer(buffer, byteLength, 0, 1, error); - if (source === 0) { - this.libzip.free(error); - throw this.makeLibzipError(error); - } - return source; - } - allocateSource(content) { - const { buffer, byteLength } = this.allocateBuffer(content); - const source = this.libzip.source.fromBuffer(this.zip, buffer, byteLength, 0, 1); - if (source === 0) { - this.libzip.free(buffer); - throw this.makeLibzipError(this.libzip.getError(this.zip)); - } - return source; - } - setFileSource(p, content) { - const buffer = Buffer.isBuffer(content) ? content : Buffer.from(content); - const target = ppath.relative(PortablePath.root, p); - const lzSource = this.allocateSource(content); - try { - const newIndex = this.libzip.file.add(this.zip, target, lzSource, this.libzip.ZIP_FL_OVERWRITE); - if (newIndex === -1) - throw this.makeLibzipError(this.libzip.getError(this.zip)); - if (this.level !== `mixed`) { - const method = this.level === 0 ? this.libzip.ZIP_CM_STORE : this.libzip.ZIP_CM_DEFLATE; - const rc = this.libzip.file.setCompression(this.zip, newIndex, 0, method, this.level); - if (rc === -1) { - throw this.makeLibzipError(this.libzip.getError(this.zip)); - } - } - this.fileSources.set(newIndex, buffer); - return newIndex; - } catch (error) { - this.libzip.source.free(lzSource); - throw error; - } - } - isSymbolicLink(index) { - if (this.symlinkCount === 0) - return false; - const attrs = this.libzip.file.getExternalAttributes(this.zip, index, 0, 0, this.libzip.uint08S, this.libzip.uint32S); - if (attrs === -1) - throw this.makeLibzipError(this.libzip.getError(this.zip)); - const opsys = this.libzip.getValue(this.libzip.uint08S, `i8`) >>> 0; - if (opsys !== this.libzip.ZIP_OPSYS_UNIX) - return false; - const attributes = this.libzip.getValue(this.libzip.uint32S, `i32`) >>> 16; - return (attributes & fs.constants.S_IFMT) === fs.constants.S_IFLNK; - } - getFileSource(index, opts = { asyncDecompress: false }) { - const cachedFileSource = this.fileSources.get(index); - if (typeof cachedFileSource !== `undefined`) - return cachedFileSource; - const stat = this.libzip.struct.statS(); - const rc = this.libzip.statIndex(this.zip, index, 0, 0, stat); - if (rc === -1) - throw this.makeLibzipError(this.libzip.getError(this.zip)); - const size = this.libzip.struct.statCompSize(stat); - const compressionMethod = this.libzip.struct.statCompMethod(stat); - const buffer = this.libzip.malloc(size); - try { - const file = this.libzip.fopenIndex(this.zip, index, 0, this.libzip.ZIP_FL_COMPRESSED); - if (file === 0) - throw this.makeLibzipError(this.libzip.getError(this.zip)); - try { - const rc2 = this.libzip.fread(file, buffer, size, 0); - if (rc2 === -1) - throw this.makeLibzipError(this.libzip.file.getError(file)); - else if (rc2 < size) - throw new Error(`Incomplete read`); - else if (rc2 > size) - throw new Error(`Overread`); - const memory = this.libzip.HEAPU8.subarray(buffer, buffer + size); - const data = Buffer.from(memory); - if (compressionMethod === 0) { - this.fileSources.set(index, data); - return data; - } else if (opts.asyncDecompress) { - return new Promise((resolve, reject) => { - zlib__default.default.inflateRaw(data, (error, result) => { - if (error) { - reject(error); - } else { - this.fileSources.set(index, result); - resolve(result); - } - }); - }); - } else { - const decompressedData = zlib__default.default.inflateRawSync(data); - this.fileSources.set(index, decompressedData); - return decompressedData; - } - } finally { - this.libzip.fclose(file); - } - } finally { - this.libzip.free(buffer); - } - } - async fchmodPromise(fd, mask) { - return this.chmodPromise(this.fdToPath(fd, `fchmod`), mask); - } - fchmodSync(fd, mask) { - return this.chmodSync(this.fdToPath(fd, `fchmodSync`), mask); - } - async chmodPromise(p, mask) { - return this.chmodSync(p, mask); - } - chmodSync(p, mask) { - if (this.readOnly) - throw EROFS(`chmod '${p}'`); - mask &= 493; - const resolvedP = this.resolveFilename(`chmod '${p}'`, p, false); - const entry = this.entries.get(resolvedP); - if (typeof entry === `undefined`) - throw new Error(`Assertion failed: The entry should have been registered (${resolvedP})`); - const oldMod = this.getUnixMode(entry, fs.constants.S_IFREG | 0); - const newMod = oldMod & ~511 | mask; - const rc = this.libzip.file.setExternalAttributes(this.zip, entry, 0, 0, this.libzip.ZIP_OPSYS_UNIX, newMod << 16); - if (rc === -1) { - throw this.makeLibzipError(this.libzip.getError(this.zip)); - } - } - async fchownPromise(fd, uid, gid) { - return this.chownPromise(this.fdToPath(fd, `fchown`), uid, gid); - } - fchownSync(fd, uid, gid) { - return this.chownSync(this.fdToPath(fd, `fchownSync`), uid, gid); - } - async chownPromise(p, uid, gid) { - return this.chownSync(p, uid, gid); - } - chownSync(p, uid, gid) { - throw new Error(`Unimplemented`); - } - async renamePromise(oldP, newP) { - return this.renameSync(oldP, newP); - } - renameSync(oldP, newP) { - throw new Error(`Unimplemented`); - } - async copyFilePromise(sourceP, destP, flags) { - const { indexSource, indexDest, resolvedDestP } = this.prepareCopyFile(sourceP, destP, flags); - const source = await this.getFileSource(indexSource, { asyncDecompress: true }); - const newIndex = this.setFileSource(resolvedDestP, source); - if (newIndex !== indexDest) { - this.registerEntry(resolvedDestP, newIndex); - } - } - copyFileSync(sourceP, destP, flags = 0) { - const { indexSource, indexDest, resolvedDestP } = this.prepareCopyFile(sourceP, destP, flags); - const source = this.getFileSource(indexSource); - const newIndex = this.setFileSource(resolvedDestP, source); - if (newIndex !== indexDest) { - this.registerEntry(resolvedDestP, newIndex); - } - } - prepareCopyFile(sourceP, destP, flags = 0) { - if (this.readOnly) - throw EROFS(`copyfile '${sourceP} -> '${destP}'`); - if ((flags & fs.constants.COPYFILE_FICLONE_FORCE) !== 0) - throw ENOSYS(`unsupported clone operation`, `copyfile '${sourceP}' -> ${destP}'`); - const resolvedSourceP = this.resolveFilename(`copyfile '${sourceP} -> ${destP}'`, sourceP); - const indexSource = this.entries.get(resolvedSourceP); - if (typeof indexSource === `undefined`) - throw EINVAL(`copyfile '${sourceP}' -> '${destP}'`); - const resolvedDestP = this.resolveFilename(`copyfile '${sourceP}' -> ${destP}'`, destP); - const indexDest = this.entries.get(resolvedDestP); - if ((flags & (fs.constants.COPYFILE_EXCL | fs.constants.COPYFILE_FICLONE_FORCE)) !== 0 && typeof indexDest !== `undefined`) - throw EEXIST(`copyfile '${sourceP}' -> '${destP}'`); - return { - indexSource, - resolvedDestP, - indexDest - }; - } - async appendFilePromise(p, content, opts) { - if (this.readOnly) - throw EROFS(`open '${p}'`); - if (typeof opts === `undefined`) - opts = { flag: `a` }; - else if (typeof opts === `string`) - opts = { flag: `a`, encoding: opts }; - else if (typeof opts.flag === `undefined`) - opts = { flag: `a`, ...opts }; - return this.writeFilePromise(p, content, opts); - } - appendFileSync(p, content, opts = {}) { - if (this.readOnly) - throw EROFS(`open '${p}'`); - if (typeof opts === `undefined`) - opts = { flag: `a` }; - else if (typeof opts === `string`) - opts = { flag: `a`, encoding: opts }; - else if (typeof opts.flag === `undefined`) - opts = { flag: `a`, ...opts }; - return this.writeFileSync(p, content, opts); - } - fdToPath(fd, reason) { - const path = this.fds.get(fd)?.p; - if (typeof path === `undefined`) - throw EBADF(reason); - return path; - } - async writeFilePromise(p, content, opts) { - const { encoding, mode, index, resolvedP } = this.prepareWriteFile(p, opts); - if (index !== void 0 && typeof opts === `object` && opts.flag && opts.flag.includes(`a`)) - content = Buffer.concat([await this.getFileSource(index, { asyncDecompress: true }), Buffer.from(content)]); - if (encoding !== null) - content = content.toString(encoding); - const newIndex = this.setFileSource(resolvedP, content); - if (newIndex !== index) - this.registerEntry(resolvedP, newIndex); - if (mode !== null) { - await this.chmodPromise(resolvedP, mode); - } - } - writeFileSync(p, content, opts) { - const { encoding, mode, index, resolvedP } = this.prepareWriteFile(p, opts); - if (index !== void 0 && typeof opts === `object` && opts.flag && opts.flag.includes(`a`)) - content = Buffer.concat([this.getFileSource(index), Buffer.from(content)]); - if (encoding !== null) - content = content.toString(encoding); - const newIndex = this.setFileSource(resolvedP, content); - if (newIndex !== index) - this.registerEntry(resolvedP, newIndex); - if (mode !== null) { - this.chmodSync(resolvedP, mode); - } - } - prepareWriteFile(p, opts) { - if (typeof p === `number`) - p = this.fdToPath(p, `read`); - if (this.readOnly) - throw EROFS(`open '${p}'`); - const resolvedP = this.resolveFilename(`open '${p}'`, p); - if (this.listings.has(resolvedP)) - throw EISDIR(`open '${p}'`); - let encoding = null, mode = null; - if (typeof opts === `string`) { - encoding = opts; - } else if (typeof opts === `object`) { - ({ - encoding = null, - mode = null - } = opts); - } - const index = this.entries.get(resolvedP); - return { - encoding, - mode, - resolvedP, - index - }; - } - async unlinkPromise(p) { - return this.unlinkSync(p); - } - unlinkSync(p) { - if (this.readOnly) - throw EROFS(`unlink '${p}'`); - const resolvedP = this.resolveFilename(`unlink '${p}'`, p); - if (this.listings.has(resolvedP)) - throw EISDIR(`unlink '${p}'`); - const index = this.entries.get(resolvedP); - if (typeof index === `undefined`) - throw EINVAL(`unlink '${p}'`); - this.deleteEntry(resolvedP, index); - } - async utimesPromise(p, atime, mtime) { - return this.utimesSync(p, atime, mtime); - } - utimesSync(p, atime, mtime) { - if (this.readOnly) - throw EROFS(`utimes '${p}'`); - const resolvedP = this.resolveFilename(`utimes '${p}'`, p); - this.utimesImpl(resolvedP, mtime); - } - async lutimesPromise(p, atime, mtime) { - return this.lutimesSync(p, atime, mtime); - } - lutimesSync(p, atime, mtime) { - if (this.readOnly) - throw EROFS(`lutimes '${p}'`); - const resolvedP = this.resolveFilename(`utimes '${p}'`, p, false); - this.utimesImpl(resolvedP, mtime); - } - utimesImpl(resolvedP, mtime) { - if (this.listings.has(resolvedP)) { - if (!this.entries.has(resolvedP)) - this.hydrateDirectory(resolvedP); - } - const entry = this.entries.get(resolvedP); - if (entry === void 0) - throw new Error(`Unreachable`); - const rc = this.libzip.file.setMtime(this.zip, entry, 0, toUnixTimestamp(mtime), 0); - if (rc === -1) { - throw this.makeLibzipError(this.libzip.getError(this.zip)); - } - } - async mkdirPromise(p, opts) { - return this.mkdirSync(p, opts); - } - mkdirSync(p, { mode = 493, recursive = false } = {}) { - if (recursive) - return this.mkdirpSync(p, { chmod: mode }); - if (this.readOnly) - throw EROFS(`mkdir '${p}'`); - const resolvedP = this.resolveFilename(`mkdir '${p}'`, p); - if (this.entries.has(resolvedP) || this.listings.has(resolvedP)) - throw EEXIST(`mkdir '${p}'`); - this.hydrateDirectory(resolvedP); - this.chmodSync(resolvedP, mode); - return void 0; - } - async rmdirPromise(p, opts) { - return this.rmdirSync(p, opts); - } - rmdirSync(p, { recursive = false } = {}) { - if (this.readOnly) - throw EROFS(`rmdir '${p}'`); - if (recursive) { - this.removeSync(p); - return; - } - const resolvedP = this.resolveFilename(`rmdir '${p}'`, p); - const directoryListing = this.listings.get(resolvedP); - if (!directoryListing) - throw ENOTDIR(`rmdir '${p}'`); - if (directoryListing.size > 0) - throw ENOTEMPTY(`rmdir '${p}'`); - const index = this.entries.get(resolvedP); - if (typeof index === `undefined`) - throw EINVAL(`rmdir '${p}'`); - this.deleteEntry(p, index); - } - async rmPromise(p, opts) { - return this.rmSync(p, opts); - } - rmSync(p, { recursive = false } = {}) { - if (this.readOnly) - throw EROFS(`rm '${p}'`); - if (recursive) { - this.removeSync(p); - return; - } - const resolvedP = this.resolveFilename(`rm '${p}'`, p); - const directoryListing = this.listings.get(resolvedP); - if (!directoryListing) - throw ENOTDIR(`rm '${p}'`); - if (directoryListing.size > 0) - throw ENOTEMPTY(`rm '${p}'`); - const index = this.entries.get(resolvedP); - if (typeof index === `undefined`) - throw EINVAL(`rm '${p}'`); - this.deleteEntry(p, index); - } - hydrateDirectory(resolvedP) { - const index = this.libzip.dir.add(this.zip, ppath.relative(PortablePath.root, resolvedP)); - if (index === -1) - throw this.makeLibzipError(this.libzip.getError(this.zip)); - this.registerListing(resolvedP); - this.registerEntry(resolvedP, index); - return index; - } - async linkPromise(existingP, newP) { - return this.linkSync(existingP, newP); - } - linkSync(existingP, newP) { - throw EOPNOTSUPP(`link '${existingP}' -> '${newP}'`); - } - async symlinkPromise(target, p) { - return this.symlinkSync(target, p); - } - symlinkSync(target, p) { - if (this.readOnly) - throw EROFS(`symlink '${target}' -> '${p}'`); - const resolvedP = this.resolveFilename(`symlink '${target}' -> '${p}'`, p); - if (this.listings.has(resolvedP)) - throw EISDIR(`symlink '${target}' -> '${p}'`); - if (this.entries.has(resolvedP)) - throw EEXIST(`symlink '${target}' -> '${p}'`); - const index = this.setFileSource(resolvedP, target); - this.registerEntry(resolvedP, index); - const rc = this.libzip.file.setExternalAttributes(this.zip, index, 0, 0, this.libzip.ZIP_OPSYS_UNIX, (fs.constants.S_IFLNK | 511) << 16); - if (rc === -1) - throw this.makeLibzipError(this.libzip.getError(this.zip)); - this.symlinkCount += 1; - } - async readFilePromise(p, encoding) { - if (typeof encoding === `object`) - encoding = encoding ? encoding.encoding : void 0; - const data = await this.readFileBuffer(p, { asyncDecompress: true }); - return encoding ? data.toString(encoding) : data; - } - readFileSync(p, encoding) { - if (typeof encoding === `object`) - encoding = encoding ? encoding.encoding : void 0; - const data = this.readFileBuffer(p); - return encoding ? data.toString(encoding) : data; - } - readFileBuffer(p, opts = { asyncDecompress: false }) { - if (typeof p === `number`) - p = this.fdToPath(p, `read`); - const resolvedP = this.resolveFilename(`open '${p}'`, p); - if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) - throw ENOENT(`open '${p}'`); - if (p[p.length - 1] === `/` && !this.listings.has(resolvedP)) - throw ENOTDIR(`open '${p}'`); - if (this.listings.has(resolvedP)) - throw EISDIR(`read`); - const entry = this.entries.get(resolvedP); - if (entry === void 0) - throw new Error(`Unreachable`); - return this.getFileSource(entry, opts); - } - async readdirPromise(p, opts) { - return this.readdirSync(p, opts); - } - readdirSync(p, opts) { - const resolvedP = this.resolveFilename(`scandir '${p}'`, p); - if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) - throw ENOENT(`scandir '${p}'`); - const directoryListing = this.listings.get(resolvedP); - if (!directoryListing) - throw ENOTDIR(`scandir '${p}'`); - if (opts?.recursive) { - if (opts?.withFileTypes) { - const entries = Array.from(directoryListing, (name) => { - return Object.assign(this.statImpl(`lstat`, ppath.join(p, name)), { - name, - path: PortablePath.dot - }); - }); - for (const entry of entries) { - if (!entry.isDirectory()) - continue; - const subPath = ppath.join(entry.path, entry.name); - const subListing = this.listings.get(ppath.join(resolvedP, subPath)); - for (const child of subListing) { - entries.push(Object.assign(this.statImpl(`lstat`, ppath.join(p, subPath, child)), { - name: child, - path: subPath - })); - } - } - return entries; - } else { - const entries = [...directoryListing]; - for (const subPath of entries) { - const subListing = this.listings.get(ppath.join(resolvedP, subPath)); - if (typeof subListing === `undefined`) - continue; - for (const child of subListing) { - entries.push(ppath.join(subPath, child)); - } - } - return entries; - } - } else if (opts?.withFileTypes) { - return Array.from(directoryListing, (name) => { - return Object.assign(this.statImpl(`lstat`, ppath.join(p, name)), { - name, - path: void 0 - }); - }); - } else { - return [...directoryListing]; - } - } - async readlinkPromise(p) { - const entry = this.prepareReadlink(p); - return (await this.getFileSource(entry, { asyncDecompress: true })).toString(); - } - readlinkSync(p) { - const entry = this.prepareReadlink(p); - return this.getFileSource(entry).toString(); - } - prepareReadlink(p) { - const resolvedP = this.resolveFilename(`readlink '${p}'`, p, false); - if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) - throw ENOENT(`readlink '${p}'`); - if (p[p.length - 1] === `/` && !this.listings.has(resolvedP)) - throw ENOTDIR(`open '${p}'`); - if (this.listings.has(resolvedP)) - throw EINVAL(`readlink '${p}'`); - const entry = this.entries.get(resolvedP); - if (entry === void 0) - throw new Error(`Unreachable`); - if (!this.isSymbolicLink(entry)) - throw EINVAL(`readlink '${p}'`); - return entry; - } - async truncatePromise(p, len = 0) { - const resolvedP = this.resolveFilename(`open '${p}'`, p); - const index = this.entries.get(resolvedP); - if (typeof index === `undefined`) - throw EINVAL(`open '${p}'`); - const source = await this.getFileSource(index, { asyncDecompress: true }); - const truncated = Buffer.alloc(len, 0); - source.copy(truncated); - return await this.writeFilePromise(p, truncated); - } - truncateSync(p, len = 0) { - const resolvedP = this.resolveFilename(`open '${p}'`, p); - const index = this.entries.get(resolvedP); - if (typeof index === `undefined`) - throw EINVAL(`open '${p}'`); - const source = this.getFileSource(index); - const truncated = Buffer.alloc(len, 0); - source.copy(truncated); - return this.writeFileSync(p, truncated); - } - async ftruncatePromise(fd, len) { - return this.truncatePromise(this.fdToPath(fd, `ftruncate`), len); - } - ftruncateSync(fd, len) { - return this.truncateSync(this.fdToPath(fd, `ftruncateSync`), len); - } - watch(p, a, b) { - let persistent; - switch (typeof a) { - case `function`: - case `string`: - case `undefined`: - { - persistent = true; - } - break; - default: - { - ({ persistent = true } = a); - } - break; - } - if (!persistent) - return { on: () => { - }, close: () => { - } }; - const interval = setInterval(() => { - }, 24 * 60 * 60 * 1e3); - return { on: () => { - }, close: () => { - clearInterval(interval); - } }; - } - watchFile(p, a, b) { - const resolvedP = ppath.resolve(PortablePath.root, p); - return watchFile(this, resolvedP, a, b); - } - unwatchFile(p, cb) { - const resolvedP = ppath.resolve(PortablePath.root, p); - return unwatchFile(this, resolvedP, cb); - } -} - -setFactory(() => { - const emZip = createModule(); - return makeInterface(emZip); -}); - -var ErrorCode = /* @__PURE__ */ ((ErrorCode2) => { - ErrorCode2["API_ERROR"] = `API_ERROR`; - ErrorCode2["BUILTIN_NODE_RESOLUTION_FAILED"] = `BUILTIN_NODE_RESOLUTION_FAILED`; - ErrorCode2["EXPORTS_RESOLUTION_FAILED"] = `EXPORTS_RESOLUTION_FAILED`; - ErrorCode2["MISSING_DEPENDENCY"] = `MISSING_DEPENDENCY`; - ErrorCode2["MISSING_PEER_DEPENDENCY"] = `MISSING_PEER_DEPENDENCY`; - ErrorCode2["QUALIFIED_PATH_RESOLUTION_FAILED"] = `QUALIFIED_PATH_RESOLUTION_FAILED`; - ErrorCode2["INTERNAL"] = `INTERNAL`; - ErrorCode2["UNDECLARED_DEPENDENCY"] = `UNDECLARED_DEPENDENCY`; - ErrorCode2["UNSUPPORTED"] = `UNSUPPORTED`; - return ErrorCode2; -})(ErrorCode || {}); -const MODULE_NOT_FOUND_ERRORS = /* @__PURE__ */ new Set([ - "BUILTIN_NODE_RESOLUTION_FAILED" /* BUILTIN_NODE_RESOLUTION_FAILED */, - "MISSING_DEPENDENCY" /* MISSING_DEPENDENCY */, - "MISSING_PEER_DEPENDENCY" /* MISSING_PEER_DEPENDENCY */, - "QUALIFIED_PATH_RESOLUTION_FAILED" /* QUALIFIED_PATH_RESOLUTION_FAILED */, - "UNDECLARED_DEPENDENCY" /* UNDECLARED_DEPENDENCY */ -]); -function makeError(pnpCode, message, data = {}, code) { - code ??= MODULE_NOT_FOUND_ERRORS.has(pnpCode) ? `MODULE_NOT_FOUND` : pnpCode; - const propertySpec = { - configurable: true, - writable: true, - enumerable: false - }; - return Object.defineProperties(new Error(message), { - code: { - ...propertySpec, - value: code - }, - pnpCode: { - ...propertySpec, - value: pnpCode - }, - data: { - ...propertySpec, - value: data - } - }); -} -function getIssuerModule(parent) { - let issuer = parent; - while (issuer && (issuer.id === `[eval]` || issuer.id === `` || !issuer.filename)) - issuer = issuer.parent; - return issuer || null; -} -function getPathForDisplay(p) { - return npath.normalize(npath.fromPortablePath(p)); -} - -const [major, minor] = process.versions.node.split(`.`).map((value) => parseInt(value, 10)); -const WATCH_MODE_MESSAGE_USES_ARRAYS = major > 19 || major === 19 && minor >= 2 || major === 18 && minor >= 13; - -function readPackageScope(checkPath) { - const rootSeparatorIndex = checkPath.indexOf(npath.sep); - let separatorIndex; - do { - separatorIndex = checkPath.lastIndexOf(npath.sep); - checkPath = checkPath.slice(0, separatorIndex); - if (checkPath.endsWith(`${npath.sep}node_modules`)) - return false; - const pjson = readPackage(checkPath + npath.sep); - if (pjson) { - return { - data: pjson, - path: checkPath - }; - } - } while (separatorIndex > rootSeparatorIndex); - return false; -} -function readPackage(requestPath) { - const jsonPath = npath.resolve(requestPath, `package.json`); - if (!fs__default.default.existsSync(jsonPath)) - return null; - return JSON.parse(fs__default.default.readFileSync(jsonPath, `utf8`)); -} -function ERR_REQUIRE_ESM(filename, parentPath = null) { - const basename = parentPath && path__default.default.basename(filename) === path__default.default.basename(parentPath) ? filename : path__default.default.basename(filename); - const msg = `require() of ES Module ${filename}${parentPath ? ` from ${parentPath}` : ``} not supported. -Instead change the require of ${basename} in ${parentPath} to a dynamic import() which is available in all CommonJS modules.`; - const err = new Error(msg); - err.code = `ERR_REQUIRE_ESM`; - return err; -} -function reportRequiredFilesToWatchMode(files) { - if (process.env.WATCH_REPORT_DEPENDENCIES && process.send) { - files = files.map((filename) => npath.fromPortablePath(VirtualFS.resolveVirtual(npath.toPortablePath(filename)))); - if (WATCH_MODE_MESSAGE_USES_ARRAYS) { - process.send({ "watch:require": files }); - } else { - for (const filename of files) { - process.send({ "watch:require": filename }); - } - } - } -} - -function applyPatch(pnpapi, opts) { - let enableNativeHooks = true; - process.versions.pnp = String(pnpapi.VERSIONS.std); - const moduleExports = require$$0__default.default; - moduleExports.findPnpApi = (lookupSource) => { - const lookupPath = lookupSource instanceof URL ? url.fileURLToPath(lookupSource) : lookupSource; - const apiPath = opts.manager.findApiPathFor(lookupPath); - if (apiPath === null) - return null; - const apiEntry = opts.manager.getApiEntry(apiPath, true); - return apiEntry.instance.findPackageLocator(lookupPath) ? apiEntry.instance : null; - }; - function getRequireStack(parent) { - const requireStack = []; - for (let cursor = parent; cursor; cursor = cursor.parent) - requireStack.push(cursor.filename || cursor.id); - return requireStack; - } - const originalModuleLoad = require$$0.Module._load; - require$$0.Module._load = function(request, parent, isMain) { - if (request === `pnpapi`) { - const parentApiPath = opts.manager.getApiPathFromParent(parent); - if (parentApiPath) { - return opts.manager.getApiEntry(parentApiPath, true).instance; - } - } - return originalModuleLoad.call(require$$0.Module, request, parent, isMain); - }; - function getIssuerSpecsFromPaths(paths) { - return paths.map((path) => ({ - apiPath: opts.manager.findApiPathFor(path), - path, - module: null - })); - } - function getIssuerSpecsFromModule(module) { - if (module && module.id !== `` && module.id !== `internal/preload` && !module.parent && !module.filename && module.paths.length > 0) { - return [{ - apiPath: opts.manager.findApiPathFor(module.paths[0]), - path: module.paths[0], - module - }]; - } - const issuer = getIssuerModule(module); - if (issuer !== null) { - const path = npath.dirname(issuer.filename); - const apiPath = opts.manager.getApiPathFromParent(issuer); - return [{ apiPath, path, module }]; - } else { - const path = process.cwd(); - const apiPath = opts.manager.findApiPathFor(npath.join(path, `[file]`)) ?? opts.manager.getApiPathFromParent(null); - return [{ apiPath, path, module }]; - } - } - function makeFakeParent(path) { - const fakeParent = new require$$0.Module(``); - const fakeFilePath = npath.join(path, `[file]`); - fakeParent.paths = require$$0.Module._nodeModulePaths(fakeFilePath); - return fakeParent; - } - const pathRegExp = /^(?![a-zA-Z]:[\\/]|\\\\|\.{0,2}(?:\/|$))((?:@[^/]+\/)?[^/]+)\/*(.*|)$/; - const originalModuleResolveFilename = require$$0.Module._resolveFilename; - require$$0.Module._resolveFilename = function(request, parent, isMain, options) { - if (require$$0.isBuiltin(request)) - return request; - if (!enableNativeHooks) - return originalModuleResolveFilename.call(require$$0.Module, request, parent, isMain, options); - if (options && options.plugnplay === false) { - const { plugnplay, ...forwardedOptions } = options; - try { - enableNativeHooks = false; - return originalModuleResolveFilename.call(require$$0.Module, request, parent, isMain, forwardedOptions); - } finally { - enableNativeHooks = true; - } - } - if (options) { - const optionNames = new Set(Object.keys(options)); - optionNames.delete(`paths`); - optionNames.delete(`plugnplay`); - if (optionNames.size > 0) { - throw makeError( - ErrorCode.UNSUPPORTED, - `Some options passed to require() aren't supported by PnP yet (${Array.from(optionNames).join(`, `)})` - ); - } - } - const issuerSpecs = options && options.paths ? getIssuerSpecsFromPaths(options.paths) : getIssuerSpecsFromModule(parent); - if (request.match(pathRegExp) === null) { - const parentDirectory = parent?.filename != null ? npath.dirname(parent.filename) : null; - const absoluteRequest = npath.isAbsolute(request) ? request : parentDirectory !== null ? npath.resolve(parentDirectory, request) : null; - if (absoluteRequest !== null) { - const apiPath = parent && parentDirectory === npath.dirname(absoluteRequest) ? opts.manager.getApiPathFromParent(parent) : opts.manager.findApiPathFor(absoluteRequest); - if (apiPath !== null) { - issuerSpecs.unshift({ - apiPath, - path: parentDirectory, - module: null - }); - } - } - } - let firstError; - for (const { apiPath, path, module } of issuerSpecs) { - let resolution; - const issuerApi = apiPath !== null ? opts.manager.getApiEntry(apiPath, true).instance : null; - try { - if (issuerApi !== null) { - resolution = issuerApi.resolveRequest(request, path !== null ? `${path}/` : null); - } else { - if (path === null) - throw new Error(`Assertion failed: Expected the path to be set`); - resolution = originalModuleResolveFilename.call(require$$0.Module, request, module || makeFakeParent(path), isMain); - } - } catch (error) { - firstError = firstError || error; - continue; - } - if (resolution !== null) { - return resolution; - } - } - const requireStack = getRequireStack(parent); - Object.defineProperty(firstError, `requireStack`, { - configurable: true, - writable: true, - enumerable: false, - value: requireStack - }); - if (requireStack.length > 0) - firstError.message += ` -Require stack: -- ${requireStack.join(` -- `)}`; - if (typeof firstError.pnpCode === `string`) - Error.captureStackTrace(firstError); - throw firstError; - }; - const originalFindPath = require$$0.Module._findPath; - require$$0.Module._findPath = function(request, paths, isMain) { - if (request === `pnpapi`) - return false; - if (!enableNativeHooks) - return originalFindPath.call(require$$0.Module, request, paths, isMain); - const isAbsolute = npath.isAbsolute(request); - if (isAbsolute) - paths = [``]; - else if (!paths || paths.length === 0) - return false; - for (const path of paths) { - let resolution; - try { - const pnpApiPath = opts.manager.findApiPathFor(isAbsolute ? request : path); - if (pnpApiPath !== null) { - const api = opts.manager.getApiEntry(pnpApiPath, true).instance; - resolution = api.resolveRequest(request, path) || false; - } else { - resolution = originalFindPath.call(require$$0.Module, request, [path], isMain); - } - } catch (error) { - continue; - } - if (resolution) { - return resolution; - } - } - return false; - }; - const originalExtensionJSFunction = require$$0.Module._extensions[`.js`]; - require$$0.Module._extensions[`.js`] = function(module, filename) { - if (filename.endsWith(`.js`)) { - const pkg = readPackageScope(filename); - if (pkg && pkg.data?.type === `module`) { - const err = ERR_REQUIRE_ESM(filename, module.parent?.filename); - Error.captureStackTrace(err); - throw err; - } - } - originalExtensionJSFunction.call(this, module, filename); - }; - const originalDlopen = process.dlopen; - process.dlopen = function(...args) { - const [module, filename, ...rest] = args; - return originalDlopen.call( - this, - module, - npath.fromPortablePath(VirtualFS.resolveVirtual(npath.toPortablePath(filename))), - ...rest - ); - }; - const originalEmit = process.emit; - process.emit = function(name, data, ...args) { - if (name === `warning` && typeof data === `object` && data.name === `ExperimentalWarning` && (data.message.includes(`--experimental-loader`) || data.message.includes(`Custom ESM Loaders is an experimental feature`))) - return false; - return originalEmit.apply(process, arguments); - }; - patchFs(fs__default.default, new PosixFS(opts.fakeFs)); -} - -function hydrateRuntimeState(data, { basePath }) { - const portablePath = npath.toPortablePath(basePath); - const absolutePortablePath = ppath.resolve(portablePath); - const ignorePattern = data.ignorePatternData !== null ? new RegExp(data.ignorePatternData) : null; - const packageLocatorsByLocations = /* @__PURE__ */ new Map(); - const packageRegistry = new Map(data.packageRegistryData.map(([packageName, packageStoreData]) => { - return [packageName, new Map(packageStoreData.map(([packageReference, packageInformationData]) => { - if (packageName === null !== (packageReference === null)) - throw new Error(`Assertion failed: The name and reference should be null, or neither should`); - const discardFromLookup = packageInformationData.discardFromLookup ?? false; - const packageLocator = { name: packageName, reference: packageReference }; - const entry = packageLocatorsByLocations.get(packageInformationData.packageLocation); - if (!entry) { - packageLocatorsByLocations.set(packageInformationData.packageLocation, { locator: packageLocator, discardFromLookup }); - } else { - entry.discardFromLookup = entry.discardFromLookup && discardFromLookup; - if (!discardFromLookup) { - entry.locator = packageLocator; - } - } - let resolvedPackageLocation = null; - return [packageReference, { - packageDependencies: new Map(packageInformationData.packageDependencies), - packagePeers: new Set(packageInformationData.packagePeers), - linkType: packageInformationData.linkType, - discardFromLookup, - get packageLocation() { - return resolvedPackageLocation || (resolvedPackageLocation = ppath.join(absolutePortablePath, packageInformationData.packageLocation)); - } - }]; - }))]; - })); - const fallbackExclusionList = new Map(data.fallbackExclusionList.map(([packageName, packageReferences]) => { - return [packageName, new Set(packageReferences)]; - })); - const fallbackPool = new Map(data.fallbackPool); - const dependencyTreeRoots = data.dependencyTreeRoots; - const enableTopLevelFallback = data.enableTopLevelFallback; - return { - basePath: portablePath, - dependencyTreeRoots, - enableTopLevelFallback, - fallbackExclusionList, - fallbackPool, - ignorePattern, - packageLocatorsByLocations, - packageRegistry - }; -} - -const ArrayIsArray = Array.isArray; -const JSONStringify = JSON.stringify; -const ObjectGetOwnPropertyNames = Object.getOwnPropertyNames; -const ObjectPrototypeHasOwnProperty = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop); -const RegExpPrototypeExec = (obj, string) => RegExp.prototype.exec.call(obj, string); -const RegExpPrototypeSymbolReplace = (obj, ...rest) => RegExp.prototype[Symbol.replace].apply(obj, rest); -const StringPrototypeEndsWith = (str, ...rest) => String.prototype.endsWith.apply(str, rest); -const StringPrototypeIncludes = (str, ...rest) => String.prototype.includes.apply(str, rest); -const StringPrototypeLastIndexOf = (str, ...rest) => String.prototype.lastIndexOf.apply(str, rest); -const StringPrototypeIndexOf = (str, ...rest) => String.prototype.indexOf.apply(str, rest); -const StringPrototypeReplace = (str, ...rest) => String.prototype.replace.apply(str, rest); -const StringPrototypeSlice = (str, ...rest) => String.prototype.slice.apply(str, rest); -const StringPrototypeStartsWith = (str, ...rest) => String.prototype.startsWith.apply(str, rest); -const SafeMap = Map; -const JSONParse = JSON.parse; - -function createErrorType(code, messageCreator, errorType) { - return class extends errorType { - constructor(...args) { - super(messageCreator(...args)); - this.code = code; - this.name = `${errorType.name} [${code}]`; - } - }; -} -const ERR_PACKAGE_IMPORT_NOT_DEFINED = createErrorType( - `ERR_PACKAGE_IMPORT_NOT_DEFINED`, - (specifier, packagePath, base) => { - return `Package import specifier "${specifier}" is not defined${packagePath ? ` in package ${packagePath}package.json` : ``} imported from ${base}`; - }, - TypeError -); -const ERR_INVALID_MODULE_SPECIFIER = createErrorType( - `ERR_INVALID_MODULE_SPECIFIER`, - (request, reason, base = void 0) => { - return `Invalid module "${request}" ${reason}${base ? ` imported from ${base}` : ``}`; - }, - TypeError -); -const ERR_INVALID_PACKAGE_TARGET = createErrorType( - `ERR_INVALID_PACKAGE_TARGET`, - (pkgPath, key, target, isImport = false, base = void 0) => { - const relError = typeof target === `string` && !isImport && target.length && !StringPrototypeStartsWith(target, `./`); - if (key === `.`) { - assert__default.default(isImport === false); - return `Invalid "exports" main target ${JSONStringify(target)} defined in the package config ${pkgPath}package.json${base ? ` imported from ${base}` : ``}${relError ? `; targets must start with "./"` : ``}`; - } - return `Invalid "${isImport ? `imports` : `exports`}" target ${JSONStringify( - target - )} defined for '${key}' in the package config ${pkgPath}package.json${base ? ` imported from ${base}` : ``}${relError ? `; targets must start with "./"` : ``}`; - }, - Error -); -const ERR_INVALID_PACKAGE_CONFIG = createErrorType( - `ERR_INVALID_PACKAGE_CONFIG`, - (path, base, message) => { - return `Invalid package config ${path}${base ? ` while importing ${base}` : ``}${message ? `. ${message}` : ``}`; - }, - Error -); -const ERR_PACKAGE_PATH_NOT_EXPORTED = createErrorType( - "ERR_PACKAGE_PATH_NOT_EXPORTED", - (pkgPath, subpath, base = void 0) => { - if (subpath === ".") - return `No "exports" main defined in ${pkgPath}package.json${base ? ` imported from ${base}` : ""}`; - return `Package subpath '${subpath}' is not defined by "exports" in ${pkgPath}package.json${base ? ` imported from ${base}` : ""}`; - }, - Error -); - -function filterOwnProperties(source, keys) { - const filtered = /* @__PURE__ */ Object.create(null); - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - if (ObjectPrototypeHasOwnProperty(source, key)) { - filtered[key] = source[key]; - } - } - return filtered; -} - -const packageJSONCache = new SafeMap(); -function getPackageConfig(path, specifier, base, readFileSyncFn) { - const existing = packageJSONCache.get(path); - if (existing !== void 0) { - return existing; - } - const source = readFileSyncFn(path); - if (source === void 0) { - const packageConfig2 = { - pjsonPath: path, - exists: false, - main: void 0, - name: void 0, - type: "none", - exports: void 0, - imports: void 0 - }; - packageJSONCache.set(path, packageConfig2); - return packageConfig2; - } - let packageJSON; - try { - packageJSON = JSONParse(source); - } catch (error) { - throw new ERR_INVALID_PACKAGE_CONFIG( - path, - (base ? `"${specifier}" from ` : "") + url.fileURLToPath(base || specifier), - error.message - ); - } - let { imports, main, name, type } = filterOwnProperties(packageJSON, [ - "imports", - "main", - "name", - "type" - ]); - const exports = ObjectPrototypeHasOwnProperty(packageJSON, "exports") ? packageJSON.exports : void 0; - if (typeof imports !== "object" || imports === null) { - imports = void 0; - } - if (typeof main !== "string") { - main = void 0; - } - if (typeof name !== "string") { - name = void 0; - } - if (type !== "module" && type !== "commonjs") { - type = "none"; - } - const packageConfig = { - pjsonPath: path, - exists: true, - main, - name, - type, - exports, - imports - }; - packageJSONCache.set(path, packageConfig); - return packageConfig; -} -function getPackageScopeConfig(resolved, readFileSyncFn) { - let packageJSONUrl = new URL("./package.json", resolved); - while (true) { - const packageJSONPath2 = packageJSONUrl.pathname; - if (StringPrototypeEndsWith(packageJSONPath2, "node_modules/package.json")) { - break; - } - const packageConfig2 = getPackageConfig( - url.fileURLToPath(packageJSONUrl), - resolved, - void 0, - readFileSyncFn - ); - if (packageConfig2.exists) { - return packageConfig2; - } - const lastPackageJSONUrl = packageJSONUrl; - packageJSONUrl = new URL("../package.json", packageJSONUrl); - if (packageJSONUrl.pathname === lastPackageJSONUrl.pathname) { - break; - } - } - const packageJSONPath = url.fileURLToPath(packageJSONUrl); - const packageConfig = { - pjsonPath: packageJSONPath, - exists: false, - main: void 0, - name: void 0, - type: "none", - exports: void 0, - imports: void 0 - }; - packageJSONCache.set(packageJSONPath, packageConfig); - return packageConfig; -} - -function throwImportNotDefined(specifier, packageJSONUrl, base) { - throw new ERR_PACKAGE_IMPORT_NOT_DEFINED( - specifier, - packageJSONUrl && url.fileURLToPath(new URL(".", packageJSONUrl)), - url.fileURLToPath(base) - ); -} -function throwInvalidSubpath(subpath, packageJSONUrl, internal, base) { - const reason = `request is not a valid subpath for the "${internal ? "imports" : "exports"}" resolution of ${url.fileURLToPath(packageJSONUrl)}`; - throw new ERR_INVALID_MODULE_SPECIFIER( - subpath, - reason, - base && url.fileURLToPath(base) - ); -} -function throwInvalidPackageTarget(subpath, target, packageJSONUrl, internal, base) { - if (typeof target === "object" && target !== null) { - target = JSONStringify(target, null, ""); - } else { - target = `${target}`; - } - throw new ERR_INVALID_PACKAGE_TARGET( - url.fileURLToPath(new URL(".", packageJSONUrl)), - subpath, - target, - internal, - base && url.fileURLToPath(base) - ); -} -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; -const patternRegEx = /\*/g; -function resolvePackageTargetString(target, subpath, match, packageJSONUrl, base, pattern, internal, conditions) { - if (subpath !== "" && !pattern && target[target.length - 1] !== "/") - throwInvalidPackageTarget(match, target, packageJSONUrl, internal, base); - if (!StringPrototypeStartsWith(target, "./")) { - if (internal && !StringPrototypeStartsWith(target, "../") && !StringPrototypeStartsWith(target, "/")) { - let isURL = false; - try { - new URL(target); - isURL = true; - } catch { - } - if (!isURL) { - const exportTarget = pattern ? RegExpPrototypeSymbolReplace(patternRegEx, target, () => subpath) : target + subpath; - return exportTarget; - } - } - throwInvalidPackageTarget(match, target, packageJSONUrl, internal, base); - } - if (RegExpPrototypeExec( - invalidSegmentRegEx, - StringPrototypeSlice(target, 2) - ) !== null) - throwInvalidPackageTarget(match, target, packageJSONUrl, internal, base); - const resolved = new URL(target, packageJSONUrl); - const resolvedPath = resolved.pathname; - const packagePath = new URL(".", packageJSONUrl).pathname; - if (!StringPrototypeStartsWith(resolvedPath, packagePath)) - throwInvalidPackageTarget(match, target, packageJSONUrl, internal, base); - if (subpath === "") - return resolved; - if (RegExpPrototypeExec(invalidSegmentRegEx, subpath) !== null) { - const request = pattern ? StringPrototypeReplace(match, "*", () => subpath) : match + subpath; - throwInvalidSubpath(request, packageJSONUrl, internal, base); - } - if (pattern) { - return new URL( - RegExpPrototypeSymbolReplace(patternRegEx, resolved.href, () => subpath) - ); - } - return new URL(subpath, resolved); -} -function isArrayIndex(key) { - const keyNum = +key; - if (`${keyNum}` !== key) - return false; - return keyNum >= 0 && keyNum < 4294967295; -} -function resolvePackageTarget(packageJSONUrl, target, subpath, packageSubpath, base, pattern, internal, conditions) { - if (typeof target === "string") { - return resolvePackageTargetString( - target, - subpath, - packageSubpath, - packageJSONUrl, - base, - pattern, - internal); - } else if (ArrayIsArray(target)) { - if (target.length === 0) { - return null; - } - let lastException; - for (let i = 0; i < target.length; i++) { - const targetItem = target[i]; - let resolveResult; - try { - resolveResult = resolvePackageTarget( - packageJSONUrl, - targetItem, - subpath, - packageSubpath, - base, - pattern, - internal, - conditions - ); - } catch (e) { - lastException = e; - if (e.code === "ERR_INVALID_PACKAGE_TARGET") { - continue; - } - throw e; - } - if (resolveResult === void 0) { - continue; - } - if (resolveResult === null) { - lastException = null; - continue; - } - return resolveResult; - } - if (lastException === void 0 || lastException === null) - return lastException; - throw lastException; - } else if (typeof target === "object" && target !== null) { - const keys = ObjectGetOwnPropertyNames(target); - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - if (isArrayIndex(key)) { - throw new ERR_INVALID_PACKAGE_CONFIG( - url.fileURLToPath(packageJSONUrl), - base, - '"exports" cannot contain numeric property keys.' - ); - } - } - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - if (key === "default" || conditions.has(key)) { - const conditionalTarget = target[key]; - const resolveResult = resolvePackageTarget( - packageJSONUrl, - conditionalTarget, - subpath, - packageSubpath, - base, - pattern, - internal, - conditions - ); - if (resolveResult === void 0) - continue; - return resolveResult; - } - } - return void 0; - } else if (target === null) { - return null; - } - throwInvalidPackageTarget( - packageSubpath, - target, - packageJSONUrl, - internal, - base - ); -} -function patternKeyCompare(a, b) { - const aPatternIndex = StringPrototypeIndexOf(a, "*"); - const bPatternIndex = StringPrototypeIndexOf(b, "*"); - 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; -} -function isConditionalExportsMainSugar(exports, packageJSONUrl, base) { - if (typeof exports === "string" || ArrayIsArray(exports)) - return true; - if (typeof exports !== "object" || exports === null) - return false; - const keys = ObjectGetOwnPropertyNames(exports); - let isConditionalSugar = false; - let i = 0; - for (let j = 0; j < keys.length; j++) { - const key = keys[j]; - const curIsConditionalSugar = key === "" || key[0] !== "."; - if (i++ === 0) { - isConditionalSugar = curIsConditionalSugar; - } else if (isConditionalSugar !== curIsConditionalSugar) { - throw new ERR_INVALID_PACKAGE_CONFIG( - url.fileURLToPath(packageJSONUrl), - base, - `"exports" cannot contain some keys starting with '.' and some not. The exports object must either be an object of package subpath keys or an object of main entry condition name keys only.` - ); - } - } - return isConditionalSugar; -} -function throwExportsNotFound(subpath, packageJSONUrl, base) { - throw new ERR_PACKAGE_PATH_NOT_EXPORTED( - url.fileURLToPath(new URL(".", packageJSONUrl)), - subpath, - base && url.fileURLToPath(base) - ); -} -const emittedPackageWarnings = /* @__PURE__ */ new Set(); -function emitTrailingSlashPatternDeprecation(match, pjsonUrl, base) { - const pjsonPath = url.fileURLToPath(pjsonUrl); - if (emittedPackageWarnings.has(pjsonPath + "|" + match)) - return; - emittedPackageWarnings.add(pjsonPath + "|" + match); - process.emitWarning( - `Use of deprecated trailing slash pattern mapping "${match}" in the "exports" field module resolution of the package at ${pjsonPath}${base ? ` imported from ${url.fileURLToPath(base)}` : ""}. Mapping specifiers ending in "/" is no longer supported.`, - "DeprecationWarning", - "DEP0155" - ); -} -function packageExportsResolve({ - packageJSONUrl, - packageSubpath, - exports, - base, - conditions -}) { - if (isConditionalExportsMainSugar(exports, packageJSONUrl, base)) - exports = { ".": exports }; - if (ObjectPrototypeHasOwnProperty(exports, packageSubpath) && !StringPrototypeIncludes(packageSubpath, "*") && !StringPrototypeEndsWith(packageSubpath, "/")) { - const target = exports[packageSubpath]; - const resolveResult = resolvePackageTarget( - packageJSONUrl, - target, - "", - packageSubpath, - base, - false, - false, - conditions - ); - if (resolveResult == null) { - throwExportsNotFound(packageSubpath, packageJSONUrl, base); - } - return resolveResult; - } - let bestMatch = ""; - let bestMatchSubpath; - const keys = ObjectGetOwnPropertyNames(exports); - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - const patternIndex = StringPrototypeIndexOf(key, "*"); - if (patternIndex !== -1 && StringPrototypeStartsWith( - packageSubpath, - StringPrototypeSlice(key, 0, patternIndex) - )) { - if (StringPrototypeEndsWith(packageSubpath, "/")) - emitTrailingSlashPatternDeprecation( - packageSubpath, - packageJSONUrl, - base - ); - const patternTrailer = StringPrototypeSlice(key, patternIndex + 1); - if (packageSubpath.length >= key.length && StringPrototypeEndsWith(packageSubpath, patternTrailer) && patternKeyCompare(bestMatch, key) === 1 && StringPrototypeLastIndexOf(key, "*") === patternIndex) { - bestMatch = key; - bestMatchSubpath = StringPrototypeSlice( - packageSubpath, - patternIndex, - packageSubpath.length - patternTrailer.length - ); - } - } - } - if (bestMatch) { - const target = exports[bestMatch]; - const resolveResult = resolvePackageTarget( - packageJSONUrl, - target, - bestMatchSubpath, - bestMatch, - base, - true, - false, - conditions - ); - if (resolveResult == null) { - throwExportsNotFound(packageSubpath, packageJSONUrl, base); - } - return resolveResult; - } - throwExportsNotFound(packageSubpath, packageJSONUrl, base); -} -function packageImportsResolve({ name, base, conditions, readFileSyncFn }) { - if (name === "#" || StringPrototypeStartsWith(name, "#/") || StringPrototypeEndsWith(name, "/")) { - const reason = "is not a valid internal imports specifier name"; - throw new ERR_INVALID_MODULE_SPECIFIER(name, reason, url.fileURLToPath(base)); - } - let packageJSONUrl; - const packageConfig = getPackageScopeConfig(base, readFileSyncFn); - if (packageConfig.exists) { - packageJSONUrl = url.pathToFileURL(packageConfig.pjsonPath); - const imports = packageConfig.imports; - if (imports) { - if (ObjectPrototypeHasOwnProperty(imports, name) && !StringPrototypeIncludes(name, "*")) { - const resolveResult = resolvePackageTarget( - packageJSONUrl, - imports[name], - "", - name, - base, - false, - true, - conditions - ); - if (resolveResult != null) { - return resolveResult; - } - } else { - let bestMatch = ""; - let bestMatchSubpath; - const keys = ObjectGetOwnPropertyNames(imports); - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - const patternIndex = StringPrototypeIndexOf(key, "*"); - if (patternIndex !== -1 && StringPrototypeStartsWith( - name, - StringPrototypeSlice(key, 0, patternIndex) - )) { - const patternTrailer = StringPrototypeSlice(key, patternIndex + 1); - if (name.length >= key.length && StringPrototypeEndsWith(name, patternTrailer) && patternKeyCompare(bestMatch, key) === 1 && StringPrototypeLastIndexOf(key, "*") === patternIndex) { - bestMatch = key; - bestMatchSubpath = StringPrototypeSlice( - name, - patternIndex, - name.length - patternTrailer.length - ); - } - } - } - if (bestMatch) { - const target = imports[bestMatch]; - const resolveResult = resolvePackageTarget( - packageJSONUrl, - target, - bestMatchSubpath, - bestMatch, - base, - true, - true, - conditions - ); - if (resolveResult != null) { - return resolveResult; - } - } - } - } - } - throwImportNotDefined(name, packageJSONUrl, base); -} - -const flagSymbol = Symbol('arg flag'); - -class ArgError extends Error { - constructor(msg, code) { - super(msg); - this.name = 'ArgError'; - this.code = code; - - Object.setPrototypeOf(this, ArgError.prototype); - } -} - -function arg( - opts, - { - argv = process.argv.slice(2), - permissive = false, - stopAtPositional = false - } = {} -) { - if (!opts) { - throw new ArgError( - 'argument specification object is required', - 'ARG_CONFIG_NO_SPEC' - ); - } - - const result = { _: [] }; - - const aliases = {}; - const handlers = {}; - - for (const key of Object.keys(opts)) { - if (!key) { - throw new ArgError( - 'argument key cannot be an empty string', - 'ARG_CONFIG_EMPTY_KEY' - ); - } - - if (key[0] !== '-') { - throw new ArgError( - `argument key must start with '-' but found: '${key}'`, - 'ARG_CONFIG_NONOPT_KEY' - ); - } - - if (key.length === 1) { - throw new ArgError( - `argument key must have a name; singular '-' keys are not allowed: ${key}`, - 'ARG_CONFIG_NONAME_KEY' - ); - } - - if (typeof opts[key] === 'string') { - aliases[key] = opts[key]; - continue; - } - - let type = opts[key]; - let isFlag = false; - - if ( - Array.isArray(type) && - type.length === 1 && - typeof type[0] === 'function' - ) { - const [fn] = type; - type = (value, name, prev = []) => { - prev.push(fn(value, name, prev[prev.length - 1])); - return prev; - }; - isFlag = fn === Boolean || fn[flagSymbol] === true; - } else if (typeof type === 'function') { - isFlag = type === Boolean || type[flagSymbol] === true; - } else { - throw new ArgError( - `type missing or not a function or valid array type: ${key}`, - 'ARG_CONFIG_VAD_TYPE' - ); - } - - if (key[1] !== '-' && key.length > 2) { - throw new ArgError( - `short argument keys (with a single hyphen) must have only one character: ${key}`, - 'ARG_CONFIG_SHORTOPT_TOOLONG' - ); - } - - handlers[key] = [type, isFlag]; - } - - for (let i = 0, len = argv.length; i < len; i++) { - const wholeArg = argv[i]; - - if (stopAtPositional && result._.length > 0) { - result._ = result._.concat(argv.slice(i)); - break; - } - - if (wholeArg === '--') { - result._ = result._.concat(argv.slice(i + 1)); - break; - } - - if (wholeArg.length > 1 && wholeArg[0] === '-') { - /* eslint-disable operator-linebreak */ - const separatedArguments = - wholeArg[1] === '-' || wholeArg.length === 2 - ? [wholeArg] - : wholeArg - .slice(1) - .split('') - .map((a) => `-${a}`); - /* eslint-enable operator-linebreak */ - - for (let j = 0; j < separatedArguments.length; j++) { - const arg = separatedArguments[j]; - const [originalArgName, argStr] = - arg[1] === '-' ? arg.split(/=(.*)/, 2) : [arg, undefined]; - - let argName = originalArgName; - while (argName in aliases) { - argName = aliases[argName]; - } - - if (!(argName in handlers)) { - if (permissive) { - result._.push(arg); - continue; - } else { - throw new ArgError( - `unknown or unexpected option: ${originalArgName}`, - 'ARG_UNKNOWN_OPTION' - ); - } - } - - const [type, isFlag] = handlers[argName]; - - if (!isFlag && j + 1 < separatedArguments.length) { - throw new ArgError( - `option requires argument (but was followed by another short argument): ${originalArgName}`, - 'ARG_MISSING_REQUIRED_SHORTARG' - ); - } - - if (isFlag) { - result[argName] = type(true, argName, result[argName]); - } else if (argStr === undefined) { - if ( - argv.length < i + 2 || - (argv[i + 1].length > 1 && - argv[i + 1][0] === '-' && - !( - argv[i + 1].match(/^-?\d*(\.(?=\d))?\d*$/) && - (type === Number || - // eslint-disable-next-line no-undef - (typeof BigInt !== 'undefined' && type === BigInt)) - )) - ) { - const extended = - originalArgName === argName ? '' : ` (alias for ${argName})`; - throw new ArgError( - `option requires argument: ${originalArgName}${extended}`, - 'ARG_MISSING_REQUIRED_LONGARG' - ); - } - - result[argName] = type(argv[i + 1], argName, result[argName]); - ++i; - } else { - result[argName] = type(argStr, argName, result[argName]); - } - } - } else { - result._.push(wholeArg); - } - } - - return result; -} - -arg.flag = (fn) => { - fn[flagSymbol] = true; - return fn; -}; - -// Utility types -arg.COUNT = arg.flag((v, name, existingCount) => (existingCount || 0) + 1); - -// Expose error class -arg.ArgError = ArgError; - -var arg_1 = arg; - -/** - @license - The MIT License (MIT) - - Copyright (c) 2014 Blake Embrey (hello@blakeembrey.com) - - 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. -*/ -function getOptionValue(opt) { - parseOptions(); - return options[opt]; -} -let options; -function parseOptions() { - if (!options) { - options = { - "--conditions": [], - ...parseArgv(getNodeOptionsEnvArgv()), - ...parseArgv(process.execArgv) - }; - } -} -function parseArgv(argv) { - return arg_1( - { - "--conditions": [String], - "-C": "--conditions" - }, - { - argv, - permissive: true - } - ); -} -function getNodeOptionsEnvArgv() { - const errors = []; - const envArgv = ParseNodeOptionsEnvVar(process.env.NODE_OPTIONS || "", errors); - if (errors.length !== 0) ; - return envArgv; -} -function ParseNodeOptionsEnvVar(node_options, errors) { - const env_argv = []; - let is_in_string = false; - let will_start_new_arg = true; - for (let index = 0; index < node_options.length; ++index) { - let c = node_options[index]; - if (c === "\\" && is_in_string) { - if (index + 1 === node_options.length) { - errors.push("invalid value for NODE_OPTIONS (invalid escape)\n"); - return env_argv; - } else { - c = node_options[++index]; - } - } else if (c === " " && !is_in_string) { - will_start_new_arg = true; - continue; - } else if (c === '"') { - is_in_string = !is_in_string; - continue; - } - if (will_start_new_arg) { - env_argv.push(c); - will_start_new_arg = false; - } else { - env_argv[env_argv.length - 1] += c; - } - } - if (is_in_string) { - errors.push("invalid value for NODE_OPTIONS (unterminated string)\n"); - } - return env_argv; -} - -function makeApi(runtimeState, opts) { - const alwaysWarnOnFallback = Number(process.env.PNP_ALWAYS_WARN_ON_FALLBACK) > 0; - const debugLevel = Number(process.env.PNP_DEBUG_LEVEL); - const pathRegExp = /^(?![a-zA-Z]:[\\/]|\\\\|\.{0,2}(?:\/|$))((?:node:)?(?:@[^/]+\/)?[^/]+)\/*(.*|)$/; - const isStrictRegExp = /^(\/|\.{1,2}(\/|$))/; - const isDirRegExp = /\/$/; - const isRelativeRegexp = /^\.{0,2}\//; - const topLevelLocator = { name: null, reference: null }; - const fallbackLocators = []; - const emittedWarnings = /* @__PURE__ */ new Set(); - if (runtimeState.enableTopLevelFallback === true) - fallbackLocators.push(topLevelLocator); - if (opts.compatibilityMode !== false) { - for (const name of [`react-scripts`, `gatsby`]) { - const packageStore = runtimeState.packageRegistry.get(name); - if (packageStore) { - for (const reference of packageStore.keys()) { - if (reference === null) { - throw new Error(`Assertion failed: This reference shouldn't be null`); - } else { - fallbackLocators.push({ name, reference }); - } - } - } - } - } - const { - ignorePattern, - packageRegistry, - packageLocatorsByLocations - } = runtimeState; - function makeLogEntry(name, args) { - return { - fn: name, - args, - error: null, - result: null - }; - } - function trace(entry) { - const colors = process.stderr?.hasColors?.() ?? process.stdout.isTTY; - const c = (n, str) => `\x1B[${n}m${str}\x1B[0m`; - const error = entry.error; - if (error) - console.error(c(`31;1`, `\u2716 ${entry.error?.message.replace(/\n.*/s, ``)}`)); - else - console.error(c(`33;1`, `\u203C Resolution`)); - if (entry.args.length > 0) - console.error(); - for (const arg of entry.args) - console.error(` ${c(`37;1`, `In \u2190`)} ${nodeUtils.inspect(arg, { colors, compact: true })}`); - if (entry.result) { - console.error(); - console.error(` ${c(`37;1`, `Out \u2192`)} ${nodeUtils.inspect(entry.result, { colors, compact: true })}`); - } - const stack = new Error().stack.match(/(?<=^ +)at.*/gm)?.slice(2) ?? []; - if (stack.length > 0) { - console.error(); - for (const line of stack) { - console.error(` ${c(`38;5;244`, line)}`); - } - } - console.error(); - } - function maybeLog(name, fn) { - if (opts.allowDebug === false) - return fn; - if (Number.isFinite(debugLevel)) { - if (debugLevel >= 2) { - return (...args) => { - const logEntry = makeLogEntry(name, args); - try { - return logEntry.result = fn(...args); - } catch (error) { - throw logEntry.error = error; - } finally { - trace(logEntry); - } - }; - } else if (debugLevel >= 1) { - return (...args) => { - try { - return fn(...args); - } catch (error) { - const logEntry = makeLogEntry(name, args); - logEntry.error = error; - trace(logEntry); - throw error; - } - }; - } - } - return fn; - } - function getPackageInformationSafe(packageLocator) { - const packageInformation = getPackageInformation(packageLocator); - if (!packageInformation) { - throw makeError( - ErrorCode.INTERNAL, - `Couldn't find a matching entry in the dependency tree for the specified parent (this is probably an internal error)` - ); - } - return packageInformation; - } - function isDependencyTreeRoot(packageLocator) { - if (packageLocator.name === null) - return true; - for (const dependencyTreeRoot of runtimeState.dependencyTreeRoots) - if (dependencyTreeRoot.name === packageLocator.name && dependencyTreeRoot.reference === packageLocator.reference) - return true; - return false; - } - const defaultExportsConditions = /* @__PURE__ */ new Set([ - `node`, - `require`, - ...getOptionValue(`--conditions`) - ]); - function applyNodeExportsResolution(unqualifiedPath, conditions = defaultExportsConditions, issuer) { - const locator = findPackageLocator(ppath.join(unqualifiedPath, `internal.js`), { - resolveIgnored: true, - includeDiscardFromLookup: true - }); - if (locator === null) { - throw makeError( - ErrorCode.INTERNAL, - `The locator that owns the "${unqualifiedPath}" path can't be found inside the dependency tree (this is probably an internal error)` - ); - } - const { packageLocation } = getPackageInformationSafe(locator); - const manifestPath = ppath.join(packageLocation, Filename.manifest); - if (!opts.fakeFs.existsSync(manifestPath)) - return null; - const pkgJson = JSON.parse(opts.fakeFs.readFileSync(manifestPath, `utf8`)); - if (pkgJson.exports == null) - return null; - let subpath = ppath.contains(packageLocation, unqualifiedPath); - if (subpath === null) { - throw makeError( - ErrorCode.INTERNAL, - `unqualifiedPath doesn't contain the packageLocation (this is probably an internal error)` - ); - } - if (subpath !== `.` && !isRelativeRegexp.test(subpath)) - subpath = `./${subpath}`; - try { - const resolvedExport = packageExportsResolve({ - packageJSONUrl: url.pathToFileURL(npath.fromPortablePath(manifestPath)), - packageSubpath: subpath, - exports: pkgJson.exports, - base: issuer ? url.pathToFileURL(npath.fromPortablePath(issuer)) : null, - conditions - }); - return npath.toPortablePath(url.fileURLToPath(resolvedExport)); - } catch (error) { - throw makeError( - ErrorCode.EXPORTS_RESOLUTION_FAILED, - error.message, - { unqualifiedPath: getPathForDisplay(unqualifiedPath), locator, pkgJson, subpath: getPathForDisplay(subpath), conditions }, - error.code - ); - } - } - function applyNodeExtensionResolution(unqualifiedPath, candidates, { extensions }) { - let stat; - try { - candidates.push(unqualifiedPath); - stat = opts.fakeFs.statSync(unqualifiedPath); - } catch (error) { - } - if (stat && !stat.isDirectory()) - return opts.fakeFs.realpathSync(unqualifiedPath); - if (stat && stat.isDirectory()) { - let pkgJson; - try { - pkgJson = JSON.parse(opts.fakeFs.readFileSync(ppath.join(unqualifiedPath, Filename.manifest), `utf8`)); - } catch (error) { - } - let nextUnqualifiedPath; - if (pkgJson && pkgJson.main) - nextUnqualifiedPath = ppath.resolve(unqualifiedPath, pkgJson.main); - if (nextUnqualifiedPath && nextUnqualifiedPath !== unqualifiedPath) { - const resolution = applyNodeExtensionResolution(nextUnqualifiedPath, candidates, { extensions }); - if (resolution !== null) { - return resolution; - } - } - } - for (let i = 0, length = extensions.length; i < length; i++) { - const candidateFile = `${unqualifiedPath}${extensions[i]}`; - candidates.push(candidateFile); - if (opts.fakeFs.existsSync(candidateFile)) { - return candidateFile; - } - } - if (stat && stat.isDirectory()) { - for (let i = 0, length = extensions.length; i < length; i++) { - const candidateFile = ppath.format({ dir: unqualifiedPath, name: `index`, ext: extensions[i] }); - candidates.push(candidateFile); - if (opts.fakeFs.existsSync(candidateFile)) { - return candidateFile; - } - } - } - return null; - } - function makeFakeModule(path) { - const fakeModule = new require$$0.Module(path, null); - fakeModule.filename = path; - fakeModule.paths = require$$0.Module._nodeModulePaths(path); - return fakeModule; - } - function callNativeResolution(request, issuer) { - if (issuer.endsWith(`/`)) - issuer = ppath.join(issuer, `internal.js`); - return require$$0.Module._resolveFilename(npath.fromPortablePath(request), makeFakeModule(npath.fromPortablePath(issuer)), false, { plugnplay: false }); - } - function isPathIgnored(path) { - if (ignorePattern === null) - return false; - const subPath = ppath.contains(runtimeState.basePath, path); - if (subPath === null) - return false; - if (ignorePattern.test(subPath.replace(/\/$/, ``))) { - return true; - } else { - return false; - } - } - const VERSIONS = { std: 3, resolveVirtual: 1, getAllLocators: 1 }; - const topLevel = topLevelLocator; - function getPackageInformation({ name, reference }) { - const packageInformationStore = packageRegistry.get(name); - if (!packageInformationStore) - return null; - const packageInformation = packageInformationStore.get(reference); - if (!packageInformation) - return null; - return packageInformation; - } - function findPackageDependents({ name, reference }) { - const dependents = []; - for (const [dependentName, packageInformationStore] of packageRegistry) { - if (dependentName === null) - continue; - for (const [dependentReference, packageInformation] of packageInformationStore) { - if (dependentReference === null) - continue; - const dependencyReference = packageInformation.packageDependencies.get(name); - if (dependencyReference !== reference) - continue; - if (dependentName === name && dependentReference === reference) - continue; - dependents.push({ - name: dependentName, - reference: dependentReference - }); - } - } - return dependents; - } - function findBrokenPeerDependencies(dependency, initialPackage) { - const brokenPackages = /* @__PURE__ */ new Map(); - const alreadyVisited = /* @__PURE__ */ new Set(); - const traversal = (currentPackage) => { - const identifier = JSON.stringify(currentPackage.name); - if (alreadyVisited.has(identifier)) - return; - alreadyVisited.add(identifier); - const dependents = findPackageDependents(currentPackage); - for (const dependent of dependents) { - const dependentInformation = getPackageInformationSafe(dependent); - if (dependentInformation.packagePeers.has(dependency)) { - traversal(dependent); - } else { - let brokenSet = brokenPackages.get(dependent.name); - if (typeof brokenSet === `undefined`) - brokenPackages.set(dependent.name, brokenSet = /* @__PURE__ */ new Set()); - brokenSet.add(dependent.reference); - } - } - }; - traversal(initialPackage); - const brokenList = []; - for (const name of [...brokenPackages.keys()].sort()) - for (const reference of [...brokenPackages.get(name)].sort()) - brokenList.push({ name, reference }); - return brokenList; - } - function findPackageLocator(location, { resolveIgnored = false, includeDiscardFromLookup = false } = {}) { - if (isPathIgnored(location) && !resolveIgnored) - return null; - let relativeLocation = ppath.relative(runtimeState.basePath, location); - if (!relativeLocation.match(isStrictRegExp)) - relativeLocation = `./${relativeLocation}`; - if (!relativeLocation.endsWith(`/`)) - relativeLocation = `${relativeLocation}/`; - do { - const entry = packageLocatorsByLocations.get(relativeLocation); - if (typeof entry === `undefined` || entry.discardFromLookup && !includeDiscardFromLookup) { - relativeLocation = relativeLocation.substring(0, relativeLocation.lastIndexOf(`/`, relativeLocation.length - 2) + 1); - continue; - } - return entry.locator; - } while (relativeLocation !== ``); - return null; - } - function tryReadFile(filePath) { - try { - return opts.fakeFs.readFileSync(npath.toPortablePath(filePath), `utf8`); - } catch (err) { - if (err.code === `ENOENT`) - return void 0; - throw err; - } - } - function resolveToUnqualified(request, issuer, { considerBuiltins = true } = {}) { - if (request.startsWith(`#`)) - throw new Error(`resolveToUnqualified can not handle private import mappings`); - if (request === `pnpapi`) - return npath.toPortablePath(opts.pnpapiResolution); - if (considerBuiltins && require$$0.isBuiltin(request)) - return null; - const requestForDisplay = getPathForDisplay(request); - const issuerForDisplay = issuer && getPathForDisplay(issuer); - if (issuer && isPathIgnored(issuer)) { - if (!ppath.isAbsolute(request) || findPackageLocator(request) === null) { - const result = callNativeResolution(request, issuer); - if (result === false) { - throw makeError( - ErrorCode.BUILTIN_NODE_RESOLUTION_FAILED, - `The builtin node resolution algorithm was unable to resolve the requested module (it didn't go through the pnp resolver because the issuer was explicitely ignored by the regexp) - -Require request: "${requestForDisplay}" -Required by: ${issuerForDisplay} -`, - { request: requestForDisplay, issuer: issuerForDisplay } - ); - } - return npath.toPortablePath(result); - } - } - let unqualifiedPath; - const dependencyNameMatch = request.match(pathRegExp); - if (!dependencyNameMatch) { - if (ppath.isAbsolute(request)) { - unqualifiedPath = ppath.normalize(request); - } else { - if (!issuer) { - throw makeError( - ErrorCode.API_ERROR, - `The resolveToUnqualified function must be called with a valid issuer when the path isn't a builtin nor absolute`, - { request: requestForDisplay, issuer: issuerForDisplay } - ); - } - const absoluteIssuer = ppath.resolve(issuer); - if (issuer.match(isDirRegExp)) { - unqualifiedPath = ppath.normalize(ppath.join(absoluteIssuer, request)); - } else { - unqualifiedPath = ppath.normalize(ppath.join(ppath.dirname(absoluteIssuer), request)); - } - } - } else { - if (!issuer) { - throw makeError( - ErrorCode.API_ERROR, - `The resolveToUnqualified function must be called with a valid issuer when the path isn't a builtin nor absolute`, - { request: requestForDisplay, issuer: issuerForDisplay } - ); - } - const [, dependencyName, subPath] = dependencyNameMatch; - const issuerLocator = findPackageLocator(issuer); - if (!issuerLocator) { - const result = callNativeResolution(request, issuer); - if (result === false) { - throw makeError( - ErrorCode.BUILTIN_NODE_RESOLUTION_FAILED, - `The builtin node resolution algorithm was unable to resolve the requested module (it didn't go through the pnp resolver because the issuer doesn't seem to be part of the Yarn-managed dependency tree). - -Require path: "${requestForDisplay}" -Required by: ${issuerForDisplay} -`, - { request: requestForDisplay, issuer: issuerForDisplay } - ); - } - return npath.toPortablePath(result); - } - const issuerInformation = getPackageInformationSafe(issuerLocator); - let dependencyReference = issuerInformation.packageDependencies.get(dependencyName); - let fallbackReference = null; - if (dependencyReference == null) { - if (issuerLocator.name !== null) { - const exclusionEntry = runtimeState.fallbackExclusionList.get(issuerLocator.name); - const canUseFallbacks = !exclusionEntry || !exclusionEntry.has(issuerLocator.reference); - if (canUseFallbacks) { - for (let t = 0, T = fallbackLocators.length; t < T; ++t) { - const fallbackInformation = getPackageInformationSafe(fallbackLocators[t]); - const reference = fallbackInformation.packageDependencies.get(dependencyName); - if (reference == null) - continue; - if (alwaysWarnOnFallback) - fallbackReference = reference; - else - dependencyReference = reference; - break; - } - if (runtimeState.enableTopLevelFallback) { - if (dependencyReference == null && fallbackReference === null) { - const reference = runtimeState.fallbackPool.get(dependencyName); - if (reference != null) { - fallbackReference = reference; - } - } - } - } - } - } - let error = null; - if (dependencyReference === null) { - if (isDependencyTreeRoot(issuerLocator)) { - error = makeError( - ErrorCode.MISSING_PEER_DEPENDENCY, - `Your application tried to access ${dependencyName} (a peer dependency); this isn't allowed as there is no ancestor to satisfy the requirement. Use a devDependency if needed. - -Required package: ${dependencyName}${dependencyName !== requestForDisplay ? ` (via "${requestForDisplay}")` : ``} -Required by: ${issuerForDisplay} -`, - { request: requestForDisplay, issuer: issuerForDisplay, dependencyName } - ); - } else { - const brokenAncestors = findBrokenPeerDependencies(dependencyName, issuerLocator); - if (brokenAncestors.every((ancestor) => isDependencyTreeRoot(ancestor))) { - error = makeError( - ErrorCode.MISSING_PEER_DEPENDENCY, - `${issuerLocator.name} tried to access ${dependencyName} (a peer dependency) but it isn't provided by your application; this makes the require call ambiguous and unsound. - -Required package: ${dependencyName}${dependencyName !== requestForDisplay ? ` (via "${requestForDisplay}")` : ``} -Required by: ${issuerLocator.name}@${issuerLocator.reference} (via ${issuerForDisplay}) -${brokenAncestors.map((ancestorLocator) => `Ancestor breaking the chain: ${ancestorLocator.name}@${ancestorLocator.reference} -`).join(``)} -`, - { request: requestForDisplay, issuer: issuerForDisplay, issuerLocator: Object.assign({}, issuerLocator), dependencyName, brokenAncestors } - ); - } else { - error = makeError( - ErrorCode.MISSING_PEER_DEPENDENCY, - `${issuerLocator.name} tried to access ${dependencyName} (a peer dependency) but it isn't provided by its ancestors; this makes the require call ambiguous and unsound. - -Required package: ${dependencyName}${dependencyName !== requestForDisplay ? ` (via "${requestForDisplay}")` : ``} -Required by: ${issuerLocator.name}@${issuerLocator.reference} (via ${issuerForDisplay}) - -${brokenAncestors.map((ancestorLocator) => `Ancestor breaking the chain: ${ancestorLocator.name}@${ancestorLocator.reference} -`).join(``)} -`, - { request: requestForDisplay, issuer: issuerForDisplay, issuerLocator: Object.assign({}, issuerLocator), dependencyName, brokenAncestors } - ); - } - } - } else if (dependencyReference === void 0) { - if (!considerBuiltins && require$$0.isBuiltin(request)) { - if (isDependencyTreeRoot(issuerLocator)) { - error = makeError( - ErrorCode.UNDECLARED_DEPENDENCY, - `Your application tried to access ${dependencyName}. While this module is usually interpreted as a Node builtin, your resolver is running inside a non-Node resolution context where such builtins are ignored. Since ${dependencyName} isn't otherwise declared in your dependencies, this makes the require call ambiguous and unsound. - -Required package: ${dependencyName}${dependencyName !== requestForDisplay ? ` (via "${requestForDisplay}")` : ``} -Required by: ${issuerForDisplay} -`, - { request: requestForDisplay, issuer: issuerForDisplay, dependencyName } - ); - } else { - error = makeError( - ErrorCode.UNDECLARED_DEPENDENCY, - `${issuerLocator.name} tried to access ${dependencyName}. While this module is usually interpreted as a Node builtin, your resolver is running inside a non-Node resolution context where such builtins are ignored. Since ${dependencyName} isn't otherwise declared in ${issuerLocator.name}'s dependencies, this makes the require call ambiguous and unsound. - -Required package: ${dependencyName}${dependencyName !== requestForDisplay ? ` (via "${requestForDisplay}")` : ``} -Required by: ${issuerForDisplay} -`, - { request: requestForDisplay, issuer: issuerForDisplay, issuerLocator: Object.assign({}, issuerLocator), dependencyName } - ); - } - } else { - if (isDependencyTreeRoot(issuerLocator)) { - error = makeError( - ErrorCode.UNDECLARED_DEPENDENCY, - `Your application tried to access ${dependencyName}, but it isn't declared in your dependencies; this makes the require call ambiguous and unsound. - -Required package: ${dependencyName}${dependencyName !== requestForDisplay ? ` (via "${requestForDisplay}")` : ``} -Required by: ${issuerForDisplay} -`, - { request: requestForDisplay, issuer: issuerForDisplay, dependencyName } - ); - } else { - error = makeError( - ErrorCode.UNDECLARED_DEPENDENCY, - `${issuerLocator.name} tried to access ${dependencyName}, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound. - -Required package: ${dependencyName}${dependencyName !== requestForDisplay ? ` (via "${requestForDisplay}")` : ``} -Required by: ${issuerLocator.name}@${issuerLocator.reference} (via ${issuerForDisplay}) -`, - { request: requestForDisplay, issuer: issuerForDisplay, issuerLocator: Object.assign({}, issuerLocator), dependencyName } - ); - } - } - } - if (dependencyReference == null) { - if (fallbackReference === null || error === null) - throw error || new Error(`Assertion failed: Expected an error to have been set`); - dependencyReference = fallbackReference; - const message = error.message.replace(/\n.*/g, ``); - error.message = message; - if (!emittedWarnings.has(message) && debugLevel !== 0) { - emittedWarnings.add(message); - process.emitWarning(error); - } - } - const dependencyLocator = Array.isArray(dependencyReference) ? { name: dependencyReference[0], reference: dependencyReference[1] } : { name: dependencyName, reference: dependencyReference }; - const dependencyInformation = getPackageInformationSafe(dependencyLocator); - if (!dependencyInformation.packageLocation) { - throw makeError( - ErrorCode.MISSING_DEPENDENCY, - `A dependency seems valid but didn't get installed for some reason. This might be caused by a partial install, such as dev vs prod. - -Required package: ${dependencyLocator.name}@${dependencyLocator.reference}${dependencyLocator.name !== requestForDisplay ? ` (via "${requestForDisplay}")` : ``} -Required by: ${issuerLocator.name}@${issuerLocator.reference} (via ${issuerForDisplay}) -`, - { request: requestForDisplay, issuer: issuerForDisplay, dependencyLocator: Object.assign({}, dependencyLocator) } - ); - } - const dependencyLocation = dependencyInformation.packageLocation; - if (subPath) { - unqualifiedPath = ppath.join(dependencyLocation, subPath); - } else { - unqualifiedPath = dependencyLocation; - } - } - return ppath.normalize(unqualifiedPath); - } - function resolveUnqualifiedExport(request, unqualifiedPath, conditions = defaultExportsConditions, issuer) { - if (isStrictRegExp.test(request)) - return unqualifiedPath; - const unqualifiedExportPath = applyNodeExportsResolution(unqualifiedPath, conditions, issuer); - if (unqualifiedExportPath) { - return ppath.normalize(unqualifiedExportPath); - } else { - return unqualifiedPath; - } - } - function resolveUnqualified(unqualifiedPath, { extensions = Object.keys(require$$0.Module._extensions) } = {}) { - const candidates = []; - const qualifiedPath = applyNodeExtensionResolution(unqualifiedPath, candidates, { extensions }); - if (qualifiedPath) { - return ppath.normalize(qualifiedPath); - } else { - reportRequiredFilesToWatchMode(candidates.map((candidate) => npath.fromPortablePath(candidate))); - const unqualifiedPathForDisplay = getPathForDisplay(unqualifiedPath); - const containingPackage = findPackageLocator(unqualifiedPath); - if (containingPackage) { - const { packageLocation } = getPackageInformationSafe(containingPackage); - let exists = true; - try { - opts.fakeFs.accessSync(packageLocation); - } catch (err) { - if (err?.code === `ENOENT`) { - exists = false; - } else { - const readableError = (err?.message ?? err ?? `empty exception thrown`).replace(/^[A-Z]/, ($0) => $0.toLowerCase()); - throw makeError(ErrorCode.QUALIFIED_PATH_RESOLUTION_FAILED, `Required package exists but could not be accessed (${readableError}). - -Missing package: ${containingPackage.name}@${containingPackage.reference} -Expected package location: ${getPathForDisplay(packageLocation)} -`, { unqualifiedPath: unqualifiedPathForDisplay, extensions }); - } - } - if (!exists) { - const errorMessage = packageLocation.includes(`/unplugged/`) ? `Required unplugged package missing from disk. This may happen when switching branches without running installs (unplugged packages must be fully materialized on disk to work).` : `Required package missing from disk. If you keep your packages inside your repository then restarting the Node process may be enough. Otherwise, try to run an install first.`; - throw makeError( - ErrorCode.QUALIFIED_PATH_RESOLUTION_FAILED, - `${errorMessage} - -Missing package: ${containingPackage.name}@${containingPackage.reference} -Expected package location: ${getPathForDisplay(packageLocation)} -`, - { unqualifiedPath: unqualifiedPathForDisplay, extensions } - ); - } - } - throw makeError( - ErrorCode.QUALIFIED_PATH_RESOLUTION_FAILED, - `Qualified path resolution failed: we looked for the following paths, but none could be accessed. - -Source path: ${unqualifiedPathForDisplay} -${candidates.map((candidate) => `Not found: ${getPathForDisplay(candidate)} -`).join(``)}`, - { unqualifiedPath: unqualifiedPathForDisplay, extensions } - ); - } - } - function resolvePrivateRequest(request, issuer, opts2) { - if (!issuer) - throw new Error(`Assertion failed: An issuer is required to resolve private import mappings`); - const resolved = packageImportsResolve({ - name: request, - base: url.pathToFileURL(npath.fromPortablePath(issuer)), - conditions: opts2.conditions ?? defaultExportsConditions, - readFileSyncFn: tryReadFile - }); - if (resolved instanceof URL) { - return resolveUnqualified(npath.toPortablePath(url.fileURLToPath(resolved)), { extensions: opts2.extensions }); - } else { - if (resolved.startsWith(`#`)) - throw new Error(`Mapping from one private import to another isn't allowed`); - return resolveRequest(resolved, issuer, opts2); - } - } - function resolveRequest(request, issuer, opts2 = {}) { - try { - if (request.startsWith(`#`)) - return resolvePrivateRequest(request, issuer, opts2); - const { considerBuiltins, extensions, conditions } = opts2; - const unqualifiedPath = resolveToUnqualified(request, issuer, { considerBuiltins }); - if (request === `pnpapi`) - return unqualifiedPath; - if (unqualifiedPath === null) - return null; - const isIssuerIgnored = () => issuer !== null ? isPathIgnored(issuer) : false; - const remappedPath = (!considerBuiltins || !require$$0.isBuiltin(request)) && !isIssuerIgnored() ? resolveUnqualifiedExport(request, unqualifiedPath, conditions, issuer) : unqualifiedPath; - return resolveUnqualified(remappedPath, { extensions }); - } catch (error) { - if (Object.hasOwn(error, `pnpCode`)) - Object.assign(error.data, { request: getPathForDisplay(request), issuer: issuer && getPathForDisplay(issuer) }); - throw error; - } - } - function resolveVirtual(request) { - const normalized = ppath.normalize(request); - const resolved = VirtualFS.resolveVirtual(normalized); - return resolved !== normalized ? resolved : null; - } - return { - VERSIONS, - topLevel, - getLocator: (name, referencish) => { - if (Array.isArray(referencish)) { - return { name: referencish[0], reference: referencish[1] }; - } else { - return { name, reference: referencish }; - } - }, - getDependencyTreeRoots: () => { - return [...runtimeState.dependencyTreeRoots]; - }, - getAllLocators() { - const locators = []; - for (const [name, entry] of packageRegistry) - for (const reference of entry.keys()) - if (name !== null && reference !== null) - locators.push({ name, reference }); - return locators; - }, - getPackageInformation: (locator) => { - const info = getPackageInformation(locator); - if (info === null) - return null; - const packageLocation = npath.fromPortablePath(info.packageLocation); - const nativeInfo = { ...info, packageLocation }; - return nativeInfo; - }, - findPackageLocator: (path) => { - return findPackageLocator(npath.toPortablePath(path)); - }, - resolveToUnqualified: maybeLog(`resolveToUnqualified`, (request, issuer, opts2) => { - const portableIssuer = issuer !== null ? npath.toPortablePath(issuer) : null; - const resolution = resolveToUnqualified(npath.toPortablePath(request), portableIssuer, opts2); - if (resolution === null) - return null; - return npath.fromPortablePath(resolution); - }), - resolveUnqualified: maybeLog(`resolveUnqualified`, (unqualifiedPath, opts2) => { - return npath.fromPortablePath(resolveUnqualified(npath.toPortablePath(unqualifiedPath), opts2)); - }), - resolveRequest: maybeLog(`resolveRequest`, (request, issuer, opts2) => { - const portableIssuer = issuer !== null ? npath.toPortablePath(issuer) : null; - const resolution = resolveRequest(npath.toPortablePath(request), portableIssuer, opts2); - if (resolution === null) - return null; - return npath.fromPortablePath(resolution); - }), - resolveVirtual: maybeLog(`resolveVirtual`, (path) => { - const result = resolveVirtual(npath.toPortablePath(path)); - if (result !== null) { - return npath.fromPortablePath(result); - } else { - return null; - } - }) - }; -} - -function makeManager(pnpapi, opts) { - const initialApiPath = npath.toPortablePath(pnpapi.resolveToUnqualified(`pnpapi`, null)); - const initialApiStats = opts.fakeFs.statSync(npath.toPortablePath(initialApiPath)); - const apiMetadata = /* @__PURE__ */ new Map([ - [initialApiPath, { - instance: pnpapi, - stats: initialApiStats, - lastRefreshCheck: Date.now() - }] - ]); - function loadApiInstance(pnpApiPath) { - const nativePath = npath.fromPortablePath(pnpApiPath); - const module = new require$$0.Module(nativePath, null); - module.load(nativePath); - return module.exports; - } - function refreshApiEntry(pnpApiPath, apiEntry) { - const timeNow = Date.now(); - if (timeNow - apiEntry.lastRefreshCheck < 500) - return; - apiEntry.lastRefreshCheck = timeNow; - const stats = opts.fakeFs.statSync(pnpApiPath); - if (stats.mtime > apiEntry.stats.mtime) { - process.emitWarning(`[Warning] The runtime detected new information in a PnP file; reloading the API instance (${npath.fromPortablePath(pnpApiPath)})`); - apiEntry.stats = stats; - apiEntry.instance = loadApiInstance(pnpApiPath); - } - } - function getApiEntry(pnpApiPath, refresh = false) { - let apiEntry = apiMetadata.get(pnpApiPath); - if (typeof apiEntry !== `undefined`) { - if (refresh) { - refreshApiEntry(pnpApiPath, apiEntry); - } - } else { - apiMetadata.set(pnpApiPath, apiEntry = { - instance: loadApiInstance(pnpApiPath), - stats: opts.fakeFs.statSync(pnpApiPath), - lastRefreshCheck: Date.now() - }); - } - return apiEntry; - } - const findApiPathCache = /* @__PURE__ */ new Map(); - function addToCacheAndReturn(start, end, target) { - if (target !== null) { - target = VirtualFS.resolveVirtual(target); - target = opts.fakeFs.realpathSync(target); - } - let curr; - let next = start; - do { - curr = next; - findApiPathCache.set(curr, target); - next = ppath.dirname(curr); - } while (curr !== end); - return target; - } - function findApiPathFor(modulePath) { - let bestCandidate = null; - for (const [apiPath, apiEntry] of apiMetadata) { - const locator = apiEntry.instance.findPackageLocator(modulePath); - if (!locator) - continue; - if (apiMetadata.size === 1) - return apiPath; - const packageInformation = apiEntry.instance.getPackageInformation(locator); - if (!packageInformation) - throw new Error(`Assertion failed: Couldn't get package information for '${modulePath}'`); - if (!bestCandidate) - bestCandidate = { packageLocation: packageInformation.packageLocation, apiPaths: [] }; - if (packageInformation.packageLocation === bestCandidate.packageLocation) { - bestCandidate.apiPaths.push(apiPath); - } else if (packageInformation.packageLocation.length > bestCandidate.packageLocation.length) { - bestCandidate = { packageLocation: packageInformation.packageLocation, apiPaths: [apiPath] }; - } - } - if (bestCandidate) { - if (bestCandidate.apiPaths.length === 1) - return bestCandidate.apiPaths[0]; - const controlSegment = bestCandidate.apiPaths.map((apiPath) => ` ${npath.fromPortablePath(apiPath)}`).join(` -`); - throw new Error(`Unable to locate pnpapi, the module '${modulePath}' is controlled by multiple pnpapi instances. -This is usually caused by using the global cache (enableGlobalCache: true) - -Controlled by: -${controlSegment} -`); - } - const start = ppath.resolve(npath.toPortablePath(modulePath)); - let curr; - let next = start; - do { - curr = next; - const cached = findApiPathCache.get(curr); - if (cached !== void 0) - return addToCacheAndReturn(start, curr, cached); - const cjsCandidate = ppath.join(curr, Filename.pnpCjs); - if (opts.fakeFs.existsSync(cjsCandidate) && opts.fakeFs.statSync(cjsCandidate).isFile()) - return addToCacheAndReturn(start, curr, cjsCandidate); - const legacyCjsCandidate = ppath.join(curr, Filename.pnpJs); - if (opts.fakeFs.existsSync(legacyCjsCandidate) && opts.fakeFs.statSync(legacyCjsCandidate).isFile()) - return addToCacheAndReturn(start, curr, legacyCjsCandidate); - next = ppath.dirname(curr); - } while (curr !== PortablePath.root); - return addToCacheAndReturn(start, curr, null); - } - const moduleToApiPathCache = /* @__PURE__ */ new WeakMap(); - function getApiPathFromParent(parent) { - if (parent == null) - return initialApiPath; - let apiPath = moduleToApiPathCache.get(parent); - if (typeof apiPath !== `undefined`) - return apiPath; - apiPath = parent.filename ? findApiPathFor(parent.filename) : null; - moduleToApiPathCache.set(parent, apiPath); - return apiPath; - } - return { - getApiPathFromParent, - findApiPathFor, - getApiEntry - }; -} - -const localFs = { ...fs__default.default }; -const nodeFs = new NodeFS(localFs); -const defaultRuntimeState = $$SETUP_STATE(hydrateRuntimeState); -const defaultPnpapiResolution = __filename; -const defaultFsLayer = new VirtualFS({ - baseFs: new ZipOpenFS({ - baseFs: nodeFs, - maxOpenFiles: 80, - readOnlyArchives: true - }) -}); -class DynamicFS extends ProxiedFS { - constructor() { - super(ppath); - this.baseFs = defaultFsLayer; - } - mapToBase(p) { - return p; - } - mapFromBase(p) { - return p; - } -} -const dynamicFsLayer = new DynamicFS(); -let manager; -const defaultApi = Object.assign(makeApi(defaultRuntimeState, { - fakeFs: dynamicFsLayer, - pnpapiResolution: defaultPnpapiResolution -}), { - makeApi: ({ - basePath = void 0, - fakeFs = dynamicFsLayer, - pnpapiResolution = defaultPnpapiResolution, - ...rest - }) => { - const apiRuntimeState = typeof basePath !== `undefined` ? $$SETUP_STATE(hydrateRuntimeState, basePath) : defaultRuntimeState; - return makeApi(apiRuntimeState, { - fakeFs, - pnpapiResolution, - ...rest - }); - }, - setup: (api) => { - applyPatch(api || defaultApi, { - fakeFs: defaultFsLayer, - manager - }); - dynamicFsLayer.baseFs = new NodeFS(fs__default.default); - } -}); -manager = makeManager(defaultApi, { - fakeFs: dynamicFsLayer -}); -if (module.parent && module.parent.id === `internal/preload`) { - defaultApi.setup(); - if (module.filename) { - delete require$$0__default.default._cache[module.filename]; - } -} -if (process.mainModule === module) { - const reportError = (code, message, data) => { - process.stdout.write(`${JSON.stringify([{ code, message, data }, null])} -`); - }; - const reportSuccess = (resolution) => { - process.stdout.write(`${JSON.stringify([null, resolution])} -`); - }; - const processResolution = (request, issuer) => { - try { - reportSuccess(defaultApi.resolveRequest(request, issuer)); - } catch (error) { - reportError(error.code, error.message, error.data); - } - }; - const processRequest = (data) => { - try { - const [request, issuer] = JSON.parse(data); - processResolution(request, issuer); - } catch (error) { - reportError(`INVALID_JSON`, error.message, error.data); - } - }; - if (process.argv.length > 2) { - if (process.argv.length !== 4) { - process.stderr.write(`Usage: ${process.argv[0]} ${process.argv[1]} -`); - process.exitCode = 64; - } else { - processResolution(process.argv[2], process.argv[3]); - } - } else { - let buffer = ``; - const decoder = new StringDecoder__default.default.StringDecoder(); - process.stdin.on(`data`, (chunk) => { - buffer += decoder.write(chunk); - do { - const index = buffer.indexOf(` -`); - if (index === -1) - break; - const line = buffer.slice(0, index); - buffer = buffer.slice(index + 1); - processRequest(line); - } while (true); - }); - } -} - -module.exports = defaultApi; diff --git a/fixtures/pnp/.yarnrc.yml b/fixtures/pnp/.yarnrc.yml deleted file mode 100644 index 6a6b24d8..00000000 --- a/fixtures/pnp/.yarnrc.yml +++ /dev/null @@ -1 +0,0 @@ -enableGlobalCache: 0 diff --git a/fixtures/pnp/package.json b/fixtures/pnp/package.json deleted file mode 100644 index 5d119379..00000000 --- a/fixtures/pnp/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "pnp", - "packageManager": "yarn@4.3.1", - "dependencies": { - "is-even": "^1.0.0", - "is-odd": "^3.0.1" - } -} diff --git a/fixtures/pnp/yarn.lock b/fixtures/pnp/yarn.lock deleted file mode 100644 index ba89514d..00000000 --- a/fixtures/pnp/yarn.lock +++ /dev/null @@ -1,74 +0,0 @@ -# This file is generated by running "yarn install" inside your project. -# Manual changes might be lost - proceed with caution! - -__metadata: - version: 8 - cacheKey: 10c0 - -"is-buffer@npm:^1.1.5": - version: 1.1.6 - resolution: "is-buffer@npm:1.1.6" - checksum: 10c0/ae18aa0b6e113d6c490ad1db5e8df9bdb57758382b313f5a22c9c61084875c6396d50bbf49315f5b1926d142d74dfb8d31b40d993a383e0a158b15fea7a82234 - languageName: node - linkType: hard - -"is-even@npm:^1.0.0": - version: 1.0.0 - resolution: "is-even@npm:1.0.0" - dependencies: - is-odd: "npm:^0.1.2" - checksum: 10c0/2728cc2f390d07c6a44a054aa53ae6ce57c3a4adfd76a92df528e992b4a978fdec4eaa948e0de6e6431ef3c8deebf1c964fd870d4983044ec9f0f4e630dfb3a5 - languageName: node - linkType: hard - -"is-number@npm:^3.0.0": - version: 3.0.0 - resolution: "is-number@npm:3.0.0" - dependencies: - kind-of: "npm:^3.0.2" - checksum: 10c0/e639c54640b7f029623df24d3d103901e322c0c25ea5bde97cd723c2d0d4c05857a8364ab5c58d963089dbed6bf1d0ffe975cb6aef917e2ad0ccbca653d31b4f - languageName: node - linkType: hard - -"is-number@npm:^6.0.0": - version: 6.0.0 - resolution: "is-number@npm:6.0.0" - checksum: 10c0/5da4c68401529675c575878d2760d66f18eaef4b014858577f6003daf66488d7fe4eae684b1e8574e3fa1bb447c6c6c56b8491d2b4b3239da2d32e5f6f218008 - languageName: node - linkType: hard - -"is-odd@npm:^0.1.2": - version: 0.1.2 - resolution: "is-odd@npm:0.1.2" - dependencies: - is-number: "npm:^3.0.0" - checksum: 10c0/7dc6c6fd004861208ef9f324021c66f19b3dad209c2da3ef3720d4d76e141974fadb52c47b439fc8c52af579468640b554115395b5673f4558ef09719260e898 - languageName: node - linkType: hard - -"is-odd@npm:^3.0.1": - version: 3.0.1 - resolution: "is-odd@npm:3.0.1" - dependencies: - is-number: "npm:^6.0.0" - checksum: 10c0/89ee2e353c5a3f3bd400c79db1c307a5b3506198ee8169d521e533a9b1d8a08fc95f21a919c084e98845b4286d7ffe309778da03744dfe66c3c1763ab1a030c6 - languageName: node - linkType: hard - -"kind-of@npm:^3.0.2": - version: 3.2.2 - resolution: "kind-of@npm:3.2.2" - dependencies: - is-buffer: "npm:^1.1.5" - checksum: 10c0/7e34bc29d4b02c997f92f080de34ebb92033a96736bbb0bb2410e033a7e5ae6571f1fa37b2d7710018f95361473b816c604234197f4f203f9cf149d8ef1574d9 - languageName: node - linkType: hard - -"pnp@workspace:.": - version: 0.0.0-use.local - resolution: "pnp@workspace:." - dependencies: - is-even: "npm:^1.0.0" - is-odd: "npm:^3.0.1" - languageName: unknown - linkType: soft diff --git a/fixtures/pnpm/.gitignore b/fixtures/pnpm/.gitignore deleted file mode 100644 index 3c3629e6..00000000 --- a/fixtures/pnpm/.gitignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/fixtures/pnpm/package.json b/fixtures/pnpm/package.json deleted file mode 100644 index b763d74d..00000000 --- a/fixtures/pnpm/package.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "name": "pnpm", - "version": "1.0.0", - "private": true, - "devDependencies": { - "axios": "1.6.2", - "ipaddr.js": "2.2.0", - "postcss": "8.4.33", - "styled-components": "6.1.1" - } -} diff --git a/fixtures/pnpm/pnpm-lock.yaml b/fixtures/pnpm/pnpm-lock.yaml deleted file mode 100644 index e51dfd6a..00000000 --- a/fixtures/pnpm/pnpm-lock.yaml +++ /dev/null @@ -1,212 +0,0 @@ -lockfileVersion: '6.0' - -settings: - autoInstallPeers: true - excludeLinksFromLockfile: false - -devDependencies: - axios: - specifier: 1.6.2 - version: 1.6.2 - postcss: - specifier: 8.4.33 - version: 8.4.33 - styled-components: - specifier: 6.1.1 - version: 6.1.1(react-dom@18.2.0)(react@18.2.0) - -packages: - - /@emotion/is-prop-valid@1.2.1: - resolution: {integrity: sha512-61Mf7Ufx4aDxx1xlDeOm8aFFigGHE4z+0sKCa+IHCeZKiyP9RLD0Mmx7m8b9/Cf37f7NAvQOOJAbQQGVr5uERw==} - dependencies: - '@emotion/memoize': 0.8.1 - dev: true - - /@emotion/memoize@0.8.1: - resolution: {integrity: sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA==} - dev: true - - /@emotion/unitless@0.8.1: - resolution: {integrity: sha512-KOEGMu6dmJZtpadb476IsZBclKvILjopjUii3V+7MnXIQCYh8W3NgNcgwo21n9LXZX6EDIKvqfjYxXebDwxKmQ==} - dev: true - - /@types/stylis@4.2.4: - resolution: {integrity: sha512-36ZrGJ8fgtBr6nwNnuJ9jXIj+bn/pF6UoqmrQT7+Y99+tFFeHHsoR54+194dHdyhPjgbeoNz3Qru0oRt0l6ASQ==} - dev: true - - /asynckit@0.4.0: - resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} - dev: true - - /axios@1.6.2: - resolution: {integrity: sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A==} - dependencies: - follow-redirects: 1.15.3 - form-data: 4.0.0 - proxy-from-env: 1.1.0 - transitivePeerDependencies: - - debug - dev: true - - /camelize@1.0.1: - resolution: {integrity: sha512-dU+Tx2fsypxTgtLoE36npi3UqcjSSMNYfkqgmoEhtZrraP5VWq0K7FkWVTYa8eMPtnU/G2txVsfdCJTn9uzpuQ==} - dev: true - - /combined-stream@1.0.8: - resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} - engines: {node: '>= 0.8'} - dependencies: - delayed-stream: 1.0.0 - dev: true - - /css-color-keywords@1.0.0: - resolution: {integrity: sha512-FyyrDHZKEjXDpNJYvVsV960FiqQyXc/LlYmsxl2BcdMb2WPx0OGRVgTg55rPSyLSNMqP52R9r8geSp7apN3Ofg==} - engines: {node: '>=4'} - dev: true - - /css-to-react-native@3.2.0: - resolution: {integrity: sha512-e8RKaLXMOFii+02mOlqwjbD00KSEKqblnpO9e++1aXS1fPQOpS1YoqdVHBqPjHNoxeF2mimzVqawm2KCbEdtHQ==} - dependencies: - camelize: 1.0.1 - css-color-keywords: 1.0.0 - postcss-value-parser: 4.2.0 - dev: true - - /csstype@3.1.2: - resolution: {integrity: sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==} - dev: true - - /delayed-stream@1.0.0: - resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} - engines: {node: '>=0.4.0'} - dev: true - - /follow-redirects@1.15.3: - resolution: {integrity: sha512-1VzOtuEM8pC9SFU1E+8KfTjZyMztRsgEfwQl44z8A25uy13jSzTj6dyK2Df52iV0vgHCfBwLhDWevLn95w5v6Q==} - engines: {node: '>=4.0'} - peerDependencies: - debug: '*' - peerDependenciesMeta: - debug: - optional: true - dev: true - - /form-data@4.0.0: - resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==} - engines: {node: '>= 6'} - dependencies: - asynckit: 0.4.0 - combined-stream: 1.0.8 - mime-types: 2.1.35 - dev: true - - /js-tokens@4.0.0: - resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} - dev: true - - /loose-envify@1.4.0: - resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==} - hasBin: true - dependencies: - js-tokens: 4.0.0 - dev: true - - /mime-db@1.52.0: - resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} - engines: {node: '>= 0.6'} - dev: true - - /mime-types@2.1.35: - resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} - engines: {node: '>= 0.6'} - dependencies: - mime-db: 1.52.0 - dev: true - - /nanoid@3.3.7: - resolution: {integrity: sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==} - engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} - hasBin: true - dev: true - - /picocolors@1.0.0: - resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==} - dev: true - - /postcss-value-parser@4.2.0: - resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==} - dev: true - - /postcss@8.4.33: - resolution: {integrity: sha512-Kkpbhhdjw2qQs2O2DGX+8m5OVqEcbB9HRBvuYM9pgrjEFUg30A9LmXNlTAUj4S9kgtGyrMbTzVjH7E+s5Re2yg==} - engines: {node: ^10 || ^12 || >=14} - dependencies: - nanoid: 3.3.7 - picocolors: 1.0.0 - source-map-js: 1.0.2 - dev: true - - /proxy-from-env@1.1.0: - resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==} - dev: true - - /react-dom@18.2.0(react@18.2.0): - resolution: {integrity: sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==} - peerDependencies: - react: ^18.2.0 - dependencies: - loose-envify: 1.4.0 - react: 18.2.0 - scheduler: 0.23.0 - dev: true - - /react@18.2.0: - resolution: {integrity: sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==} - engines: {node: '>=0.10.0'} - dependencies: - loose-envify: 1.4.0 - dev: true - - /scheduler@0.23.0: - resolution: {integrity: sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw==} - dependencies: - loose-envify: 1.4.0 - dev: true - - /shallowequal@1.1.0: - resolution: {integrity: sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ==} - dev: true - - /source-map-js@1.0.2: - resolution: {integrity: sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==} - engines: {node: '>=0.10.0'} - dev: true - - /styled-components@6.1.1(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-cpZZP5RrKRIClBW5Eby4JM1wElLVP4NQrJbJ0h10TidTyJf4SIIwa3zLXOoPb4gJi8MsJ8mjq5mu2IrEhZIAcQ==} - engines: {node: '>= 16'} - peerDependencies: - react: '>= 16.8.0' - react-dom: '>= 16.8.0' - dependencies: - '@emotion/is-prop-valid': 1.2.1 - '@emotion/unitless': 0.8.1 - '@types/stylis': 4.2.4 - css-to-react-native: 3.2.0 - csstype: 3.1.2 - postcss: 8.4.33 - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - shallowequal: 1.1.0 - stylis: 4.3.0 - tslib: 2.6.2 - dev: true - - /stylis@4.3.0: - resolution: {integrity: sha512-E87pIogpwUsUwXw7dNyU4QDjdgVMy52m+XEOPEKUn161cCzWjjhPSQhByfd1CcNvrOLnXQ6OnnZDwnJrz/Z4YQ==} - dev: true - - /tslib@2.6.2: - resolution: {integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==} - dev: true diff --git a/fixtures/tsconfig/cases/builtins/thing.js b/fixtures/tsconfig/cases/builtins/thing.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/builtins/tsconfig.json b/fixtures/tsconfig/cases/builtins/tsconfig.json deleted file mode 100644 index 36aa1a4d..00000000 --- a/fixtures/tsconfig/cases/builtins/tsconfig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compilerOptions": { - "baseUrl": "." - } -} diff --git a/fixtures/tsconfig/cases/exports/index.js b/fixtures/tsconfig/cases/exports/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/exports/tsconfig.json b/fixtures/tsconfig/cases/exports/tsconfig.json deleted file mode 100644 index f0e3159b..00000000 --- a/fixtures/tsconfig/cases/exports/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-exports" -} diff --git a/fixtures/tsconfig/cases/extends-extension/base-tsconfig.json b/fixtures/tsconfig/cases/extends-extension/base-tsconfig.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/cases/extends-extension/base-tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/cases/extends-extension/foo.js b/fixtures/tsconfig/cases/extends-extension/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-extension/tsconfig.json b/fixtures/tsconfig/cases/extends-extension/tsconfig.json deleted file mode 100644 index 0ae4c6a3..00000000 --- a/fixtures/tsconfig/cases/extends-extension/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./base-tsconfig" -} diff --git a/fixtures/tsconfig/cases/extends-extensionless/foo.js b/fixtures/tsconfig/cases/extends-extensionless/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-extensionless/tsconfig.json b/fixtures/tsconfig/cases/extends-extensionless/tsconfig.json deleted file mode 100644 index c36cb7d4..00000000 --- a/fixtures/tsconfig/cases/extends-extensionless/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-field/conf" -} diff --git a/fixtures/tsconfig/cases/extends-multiple/foo.js b/fixtures/tsconfig/cases/extends-multiple/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-multiple/tsconfig.json b/fixtures/tsconfig/cases/extends-multiple/tsconfig.json deleted file mode 100644 index aa2ae783..00000000 --- a/fixtures/tsconfig/cases/extends-multiple/tsconfig.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": ["../extends-extension", "../extends-paths"], - "compilerOptions": { - "baseUrl": ".", - }, -} diff --git a/fixtures/tsconfig/cases/extends-not-found/index.js b/fixtures/tsconfig/cases/extends-not-found/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-not-found/tsconfig.json b/fixtures/tsconfig/cases/extends-not-found/tsconfig.json deleted file mode 100644 index 99df91da..00000000 --- a/fixtures/tsconfig/cases/extends-not-found/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./not-found" -} diff --git a/fixtures/tsconfig/cases/extends-paths/src/index.js b/fixtures/tsconfig/cases/extends-paths/src/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-paths/tsconfig.base.json b/fixtures/tsconfig/cases/extends-paths/tsconfig.base.json deleted file mode 100644 index 5c64b067..00000000 --- a/fixtures/tsconfig/cases/extends-paths/tsconfig.base.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "@/*": ["./*"] - } - } -} diff --git a/fixtures/tsconfig/cases/extends-paths/tsconfig.json b/fixtures/tsconfig/cases/extends-paths/tsconfig.json deleted file mode 100644 index 51086018..00000000 --- a/fixtures/tsconfig/cases/extends-paths/tsconfig.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": "./tsconfig.base.json", - "compilerOptions": { - "baseUrl": "src", - }, -} diff --git a/fixtures/tsconfig/cases/field/index.js b/fixtures/tsconfig/cases/field/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/field/tsconfig.json b/fixtures/tsconfig/cases/field/tsconfig.json deleted file mode 100644 index 9f86c3f4..00000000 --- a/fixtures/tsconfig/cases/field/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-field" -} diff --git a/fixtures/tsconfig/cases/index/index.js b/fixtures/tsconfig/cases/index/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/index/tsconfig.json b/fixtures/tsconfig/cases/index/tsconfig.json deleted file mode 100644 index d20b1774..00000000 --- a/fixtures/tsconfig/cases/index/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-index" -} diff --git a/fixtures/tsconfig/cases/paths_template_variable/foo.js b/fixtures/tsconfig/cases/paths_template_variable/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json b/fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json deleted file mode 100644 index a1a37bb6..00000000 --- a/fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "../../tsconfig_template_variable.json" -} diff --git a/fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json b/fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json deleted file mode 100644 index e7d8e5e5..00000000 --- a/fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "compilerOptions": { - "composite": true, - "paths": { - "foo": ["${configDir}/foo.js"] - } - } -} diff --git a/fixtures/tsconfig/cases/project_references/app/aliased/index.ts b/fixtures/tsconfig/cases/project_references/app/aliased/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/app/index.ts b/fixtures/tsconfig/cases/project_references/app/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/app/tsconfig.json b/fixtures/tsconfig/cases/project_references/app/tsconfig.json deleted file mode 100644 index 7036d2bb..00000000 --- a/fixtures/tsconfig/cases/project_references/app/tsconfig.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "extends": "../tsconfig.base.json", - "compilerOptions": { - "baseUrl": "./", - "paths": { - "@/*": ["./aliased/*"] - } - }, - "references": [ - { - "path": "../project_a/conf.json" - }, - { - "path": "../project_b" - }, - { - "path": "../project_c/tsconfig.json" - }, - { - "path": "../../paths_template_variable/tsconfig2.json" - } - ] -} diff --git a/fixtures/tsconfig/cases/project_references/project_a/aliased/index.ts b/fixtures/tsconfig/cases/project_references/project_a/aliased/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_a/conf.json b/fixtures/tsconfig/cases/project_references/project_a/conf.json deleted file mode 100644 index 4d389d7a..00000000 --- a/fixtures/tsconfig/cases/project_references/project_a/conf.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "compilerOptions": { - "composite": true, - "paths": { - "@/*": ["./aliased/*"] - } - } -} diff --git a/fixtures/tsconfig/cases/project_references/project_a/index.ts b/fixtures/tsconfig/cases/project_references/project_a/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_b/src/aliased/index.ts b/fixtures/tsconfig/cases/project_references/project_b/src/aliased/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_b/tsconfig.json b/fixtures/tsconfig/cases/project_references/project_b/tsconfig.json deleted file mode 100644 index 4ab05cd8..00000000 --- a/fixtures/tsconfig/cases/project_references/project_b/tsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "compilerOptions": { - "composite": true, - "baseUrl": "./src", - "paths": { - "@/*": ["./aliased/*"] - } - } -} diff --git a/fixtures/tsconfig/cases/project_references/project_c/index.ts b/fixtures/tsconfig/cases/project_references/project_c/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_c/tsconfig.json b/fixtures/tsconfig/cases/project_references/project_c/tsconfig.json deleted file mode 100644 index fe520939..00000000 --- a/fixtures/tsconfig/cases/project_references/project_c/tsconfig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compilerOptions": { - "composite": true - } -} diff --git a/fixtures/tsconfig/cases/project_references/tsconfig.base.json b/fixtures/tsconfig/cases/project_references/tsconfig.base.json deleted file mode 100644 index 88ccffe7..00000000 --- a/fixtures/tsconfig/cases/project_references/tsconfig.base.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "compilerOptions": { - } -} diff --git a/fixtures/tsconfig/cases/suffixes/a.ios.ts b/fixtures/tsconfig/cases/suffixes/a.ios.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/a.ts b/fixtures/tsconfig/cases/suffixes/a.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/b.ts b/fixtures/tsconfig/cases/suffixes/b.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/c-test.ts b/fixtures/tsconfig/cases/suffixes/c-test.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/index.ts b/fixtures/tsconfig/cases/suffixes/index.ts deleted file mode 100644 index b09939b9..00000000 --- a/fixtures/tsconfig/cases/suffixes/index.ts +++ /dev/null @@ -1 +0,0 @@ -import './a'; diff --git a/fixtures/tsconfig/cases/suffixes/tsconfig.json b/fixtures/tsconfig/cases/suffixes/tsconfig.json deleted file mode 100644 index 4c2ccc8f..00000000 --- a/fixtures/tsconfig/cases/suffixes/tsconfig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compilerOptions": { - "moduleSuffixes": [".ios", "-test", ""] - } -} diff --git a/fixtures/tsconfig/cases/trailing-comma/bar.js b/fixtures/tsconfig/cases/trailing-comma/bar.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/trailing-comma/index.js b/fixtures/tsconfig/cases/trailing-comma/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/trailing-comma/tsconfig.json b/fixtures/tsconfig/cases/trailing-comma/tsconfig.json deleted file mode 100644 index 6dc20ca5..00000000 --- a/fixtures/tsconfig/cases/trailing-comma/tsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "compilerOptions": { - "paths": { - /* some comment */ - "foo": ["bar.js"], - }, - }, - // another comment -} diff --git a/fixtures/tsconfig/foo.js b/fixtures/tsconfig/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/nested/index.js b/fixtures/tsconfig/nested/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/nested/test.js b/fixtures/tsconfig/nested/test.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/nested/tsconfig.json b/fixtures/tsconfig/nested/tsconfig.json deleted file mode 100644 index 6deb3011..00000000 --- a/fixtures/tsconfig/nested/tsconfig.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "extends": "..", - "compilerOptions": { - "paths": { - "ts-path": ["test.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-exports/conf.json b/fixtures/tsconfig/node_modules/tsconfig-exports/conf.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-exports/conf.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-exports/foo.js b/fixtures/tsconfig/node_modules/tsconfig-exports/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-exports/package.json b/fixtures/tsconfig/node_modules/tsconfig-exports/package.json deleted file mode 100644 index be0ddee6..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-exports/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "tsconfig-exports", - "private": true, - "exports": { - ".": "./conf.json" - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-field/conf.json b/fixtures/tsconfig/node_modules/tsconfig-field/conf.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-field/conf.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-field/foo.js b/fixtures/tsconfig/node_modules/tsconfig-field/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-field/package.json b/fixtures/tsconfig/node_modules/tsconfig-field/package.json deleted file mode 100644 index 7138fdde..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-field/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "tsconfig-field", - "private": true, - "tsconfig": "conf.json" -} \ No newline at end of file diff --git a/fixtures/tsconfig/node_modules/tsconfig-index/foo.js b/fixtures/tsconfig/node_modules/tsconfig-index/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-index/package.json b/fixtures/tsconfig/node_modules/tsconfig-index/package.json deleted file mode 100644 index eb2431e7..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-index/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "tsconfig-index", - "private": true -} \ No newline at end of file diff --git a/fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json b/fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-not-used/foo.js b/fixtures/tsconfig/node_modules/tsconfig-not-used/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json b/fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json deleted file mode 100644 index eb16d127..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "ts-path": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/package.json b/fixtures/tsconfig/package.json deleted file mode 100755 index f48acd1c..00000000 --- a/fixtures/tsconfig/package.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "name": "resolver", - "private": true, - "alias": { - "aliased": "foo", - "aliased-file": "./bar.js", - "something": "./nested/test.js", - "aliasedfolder": "./nested", - "aliasedabsolute": "/nested", - "foo/bar": "./bar.js", - "glob/*/*": "./nested/$2", - "./baz": "./bar.js", - "url": false - }, - "imports": { - "#test": "./bar.js" - }, - "dependencies": { - "foo": "^0.3.4" - }, - "peerDependencies": { - "bar": "*" - } -} diff --git a/fixtures/tsconfig/tsconfig.json b/fixtures/tsconfig/tsconfig.json deleted file mode 100644 index eb16d127..00000000 --- a/fixtures/tsconfig/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "ts-path": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/tsconfig_broken.json b/fixtures/tsconfig/tsconfig_broken.json deleted file mode 100644 index 98232c64..00000000 --- a/fixtures/tsconfig/tsconfig_broken.json +++ /dev/null @@ -1 +0,0 @@ -{ diff --git a/fixtures/tsconfig/tsconfig_template_variable.json b/fixtures/tsconfig/tsconfig_template_variable.json deleted file mode 100644 index 6f272344..00000000 --- a/fixtures/tsconfig/tsconfig_template_variable.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["${configDir}/foo.js"] - } - } -} diff --git a/napi/__test__/resolver.spec.mjs b/napi/__test__/resolver.spec.mjs deleted file mode 100644 index ac6ee0ef..00000000 --- a/napi/__test__/resolver.spec.mjs +++ /dev/null @@ -1,260 +0,0 @@ -import { join } from 'node:path' -import { fileURLToPath } from 'node:url' - -import test from 'ava' - -let ResolverFactory - -if (process.env.WASI_TEST) { - const wasi = await import('../resolver.wasi.cjs') - ResolverFactory = wasi.ResolverFactory -} else { - const napi = await import('../index.js') - ResolverFactory = napi.ResolverFactory -} - -const currentDir = join(fileURLToPath(import.meta.url), '..') - -const enhancedResolveRoot = join( - currentDir, - '..', - '..', - 'fixtures', - 'enhanced_resolve', - 'test', - 'fixtures' -) - -// https://github.com/webpack/enhanced-resolve/blob/main/test/resolve.test.js - -for (const [title, context, request, expected] of [ - [ - 'absolute path', - enhancedResolveRoot, - join(enhancedResolveRoot, 'main1.js'), - join(enhancedResolveRoot, 'main1.js'), - ], - [ - 'file with .js', - enhancedResolveRoot, - './main1.js', - join(enhancedResolveRoot, 'main1.js'), - ], - [ - 'file without extension', - enhancedResolveRoot, - './main1', - join(enhancedResolveRoot, 'main1.js'), - ], - [ - 'another file with .js', - enhancedResolveRoot, - './a.js', - join(enhancedResolveRoot, 'a.js'), - ], - [ - 'another file without extension', - enhancedResolveRoot, - './a', - join(enhancedResolveRoot, 'a.js'), - ], - [ - 'file in module with .js', - enhancedResolveRoot, - 'm1/a.js', - join(enhancedResolveRoot, 'node_modules/m1/a.js'), - ], - [ - 'file in module without extension', - enhancedResolveRoot, - 'm1/a', - join(enhancedResolveRoot, 'node_modules/m1/a.js'), - ], - [ - 'another file in module without extension', - enhancedResolveRoot, - 'complexm/step1', - join(enhancedResolveRoot, 'node_modules/complexm/step1.js'), - ], - [ - 'from submodule to file in sibling module', - join(enhancedResolveRoot, 'node_modules/complexm'), - 'm2/b.js', - join(enhancedResolveRoot, 'node_modules/m2/b.js'), - ], - [ - 'from nested directory to overwritten file in module', - join(enhancedResolveRoot, 'multiple_modules'), - 'm1/a.js', - join(enhancedResolveRoot, 'multiple_modules/node_modules/m1/a.js'), - ], - [ - 'from nested directory to not overwritten file in module', - join(enhancedResolveRoot, 'multiple_modules'), - 'm1/b.js', - join(enhancedResolveRoot, 'node_modules/m1/b.js'), - ], - [ - 'file with query', - enhancedResolveRoot, - './main1.js?query', - join(enhancedResolveRoot, 'main1.js?query'), - ], - [ - 'file with fragment', - enhancedResolveRoot, - './main1.js#fragment', - join(enhancedResolveRoot, 'main1.js#fragment'), - ], - [ - 'file with fragment and query', - enhancedResolveRoot, - './main1.js#fragment?query', - join(enhancedResolveRoot, 'main1.js#fragment?query'), - ], - [ - 'file with query and fragment', - enhancedResolveRoot, - './main1.js?#fragment', - join(enhancedResolveRoot, 'main1.js?#fragment'), - ], - - [ - 'file with query (unicode)', - enhancedResolveRoot, - './测试.js?query', - join(enhancedResolveRoot, '测试.js?query'), - ], - [ - 'file with fragment (unicode)', - enhancedResolveRoot, - './测试.js#fragment', - join(enhancedResolveRoot, '测试.js#fragment'), - ], - [ - 'file with fragment and query (unicode)', - enhancedResolveRoot, - './测试.js#fragment?query', - join(enhancedResolveRoot, '测试.js#fragment?query'), - ], - [ - 'file with query and fragment (unicode)', - enhancedResolveRoot, - './测试.js?#fragment', - join(enhancedResolveRoot, '测试.js?#fragment'), - ], - - [ - 'file in module with query', - enhancedResolveRoot, - 'm1/a?query', - join(enhancedResolveRoot, 'node_modules/m1/a.js?query'), - ], - [ - 'file in module with fragment', - enhancedResolveRoot, - 'm1/a#fragment', - join(enhancedResolveRoot, 'node_modules/m1/a.js#fragment'), - ], - [ - 'file in module with fragment and query', - enhancedResolveRoot, - 'm1/a#fragment?query', - join(enhancedResolveRoot, 'node_modules/m1/a.js#fragment?query'), - ], - [ - 'file in module with query and fragment', - enhancedResolveRoot, - 'm1/a?#fragment', - join(enhancedResolveRoot, 'node_modules/m1/a.js?#fragment'), - ], - [ - 'differ between directory and file, resolve file', - enhancedResolveRoot, - './dirOrFile', - join(enhancedResolveRoot, 'dirOrFile.js'), - ], - [ - 'differ between directory and file, resolve directory', - enhancedResolveRoot, - './dirOrFile/', - join(enhancedResolveRoot, 'dirOrFile/index.js'), - ], - [ - 'find node_modules outside of node_modules', - join(enhancedResolveRoot, 'browser-module/node_modules'), - 'm1/a', - join(enhancedResolveRoot, 'node_modules/m1/a.js'), - ], - [ - "don't crash on main field pointing to self", - enhancedResolveRoot, - './main-field-self', - join(enhancedResolveRoot, './main-field-self/index.js'), - ], - [ - "don't crash on main field pointing to self (2)", - enhancedResolveRoot, - './main-field-self2', - join(enhancedResolveRoot, './main-field-self2/index.js'), - ], - // enhanced-resolve has `#` prepended with a `\0`, they are removed from the - // following 3 expected test results. - // See https://github.com/webpack/enhanced-resolve#escaping - [ - 'handle fragment edge case (no fragment)', - enhancedResolveRoot, - './no#fragment/#/#', - join(enhancedResolveRoot, 'no#fragment', '#', '#.js'), - ], - [ - 'handle fragment edge case (fragment)', - enhancedResolveRoot, - './no#fragment/#/', - join(enhancedResolveRoot, 'no.js#fragment') + '/#/', - ], - [ - 'handle fragment escaping', - enhancedResolveRoot, - './no\0#fragment/\0#/\0##fragment', - join(enhancedResolveRoot, 'no#fragment', '#', '#.js#fragment'), - ], -]) { - test(title, (t) => { - const resolver = new ResolverFactory({ - modules: ['src/a', 'src/b', 'src/common', 'node_modules'], - extensions: ['.js', '.jsx', '.ts', '.tsx'], - }) - - t.is(resolver.sync(context, request).path, expected) - }) -} - -test('resolve pnpm package', (t) => { - const rootDir = join(currentDir, '..', '..'); - const pnpmProjectPath = join(rootDir, 'fixtures', 'pnpm') - const resolver = new ResolverFactory({ - aliasFields: ['browser'], - }) - t.deepEqual(resolver.sync(pnpmProjectPath, 'styled-components'), { - path: join( - rootDir, - 'node_modules/.pnpm/styled-components@6.1.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/styled-components/dist/styled-components.browser.cjs.js' - ), - }) - t.deepEqual( - resolver.sync( - join( - rootDir, - 'node_modules/.pnpm/styled-components@6.1.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/styled-components' - ), - 'react' - ), - { - path: join( - rootDir, - 'node_modules/.pnpm/react@18.3.1/node_modules/react/index.js' - ), - } - ) -}) diff --git a/napi/src/lib.rs b/napi/src/lib.rs deleted file mode 100644 index 7cd839c5..00000000 --- a/napi/src/lib.rs +++ /dev/null @@ -1,214 +0,0 @@ -extern crate napi; -extern crate napi_derive; -extern crate oxc_resolver; - -use std::{ - path::{Path, PathBuf}, - sync::Arc, -}; - -use napi::{bindgen_prelude::AsyncTask, Task}; -use napi_derive::napi; -use oxc_resolver::{ResolveOptions, Resolver}; - -use self::{ - options::{NapiResolveOptions, StrOrStrList}, - tracing::init_tracing, -}; - -mod options; -mod tracing; - -#[napi(object)] -pub struct ResolveResult { - pub path: Option, - pub error: Option, - /// "type" field in the package.json file - pub module_type: Option, -} - -fn resolve(resolver: &Resolver, path: &Path, request: &str) -> ResolveResult { - match resolver.resolve(path, request) { - Ok(resolution) => ResolveResult { - path: Some(resolution.full_path().to_string_lossy().to_string()), - error: None, - module_type: resolution - .package_json() - .and_then(|p| p.r#type.as_ref()) - .and_then(|t| t.as_str()) - .map(|t| t.to_string()), - }, - Err(err) => ResolveResult { path: None, module_type: None, error: Some(err.to_string()) }, - } -} - -#[allow(clippy::needless_pass_by_value)] -#[napi] -pub fn sync(path: String, request: String) -> ResolveResult { - let path = PathBuf::from(path); - let resolver = Resolver::new(ResolveOptions::default()); - resolve(&resolver, &path, &request) -} - -pub struct ResolveTask { - resolver: Arc, - directory: PathBuf, - request: String, -} - -#[napi] -impl Task for ResolveTask { - type Output = ResolveResult; - type JsValue = ResolveResult; - - fn compute(&mut self) -> napi::Result { - Ok(resolve(&self.resolver, &self.directory, &self.request)) - } - - fn resolve(&mut self, _: napi::Env, result: Self::Output) -> napi::Result { - Ok(result) - } -} - -#[napi] -pub struct ResolverFactory { - resolver: Arc, -} - -#[napi] -impl ResolverFactory { - #[napi(constructor)] - pub fn new(options: NapiResolveOptions) -> Self { - init_tracing(); - Self { resolver: Arc::new(Resolver::new(Self::normalize_options(options))) } - } - - #[napi] - pub fn default() -> Self { - let default_options = ResolveOptions::default(); - Self { resolver: Arc::new(Resolver::new(default_options)) } - } - - /// Clone the resolver using the same underlying cache. - #[napi] - pub fn clone_with_options(&self, options: NapiResolveOptions) -> Self { - Self { - resolver: Arc::new(self.resolver.clone_with_options(Self::normalize_options(options))), - } - } - - /// Clear the underlying cache. - #[napi] - pub fn clear_cache(&self) { - self.resolver.clear_cache(); - } - - /// Synchronously resolve `specifier` at an absolute path to a `directory`. - #[allow(clippy::needless_pass_by_value)] - #[napi] - pub fn sync(&self, directory: String, request: String) -> ResolveResult { - let path = PathBuf::from(directory); - resolve(&self.resolver, &path, &request) - } - - /// Asynchronously resolve `specifier` at an absolute path to a `directory`. - #[allow(clippy::needless_pass_by_value)] - #[napi(js_name = "async")] - pub fn resolve_async(&self, directory: String, request: String) -> AsyncTask { - let path = PathBuf::from(directory); - let resolver = self.resolver.clone(); - AsyncTask::new(ResolveTask { resolver, directory: path, request }) - } - - fn normalize_options(op: NapiResolveOptions) -> ResolveOptions { - let default = ResolveOptions::default(); - // merging options - ResolveOptions { - tsconfig: op.tsconfig.map(|tsconfig| tsconfig.into()), - alias: op - .alias - .map(|alias| { - alias - .into_iter() - .map(|(k, v)| { - let v = v - .into_iter() - .map(|item| match item { - Some(path) => oxc_resolver::AliasValue::from(path), - None => oxc_resolver::AliasValue::Ignore, - }) - .collect(); - (k, v) - }) - .collect::>() - }) - .unwrap_or(default.alias), - alias_fields: op - .alias_fields - .map(|o| o.into_iter().map(|x| StrOrStrList(x).into()).collect::>()) - .unwrap_or(default.alias_fields), - condition_names: op.condition_names.unwrap_or(default.condition_names), - description_files: op.description_files.unwrap_or(default.description_files), - enforce_extension: op - .enforce_extension - .map(|enforce_extension| enforce_extension.into()) - .unwrap_or(default.enforce_extension), - exports_fields: op - .exports_fields - .map(|o| o.into_iter().map(|x| StrOrStrList(x).into()).collect::>()) - .unwrap_or(default.exports_fields), - imports_fields: op - .imports_fields - .map(|o| o.into_iter().map(|x| StrOrStrList(x).into()).collect::>()) - .unwrap_or(default.imports_fields), - extension_alias: op - .extension_alias - .map(|extension_alias| extension_alias.into_iter().collect::>()) - .unwrap_or(default.extension_alias), - extensions: op.extensions.unwrap_or(default.extensions), - fallback: op - .fallback - .map(|fallback| { - fallback - .into_iter() - .map(|(k, v)| { - let v = v - .into_iter() - .map(|item| match item { - Some(path) => oxc_resolver::AliasValue::from(path), - None => oxc_resolver::AliasValue::Ignore, - }) - .collect(); - (k, v) - }) - .collect::>() - }) - .unwrap_or(default.fallback), - fully_specified: op.fully_specified.unwrap_or(default.fully_specified), - main_fields: op - .main_fields - .map(|o| StrOrStrList(o).into()) - .unwrap_or(default.main_fields), - main_files: op.main_files.unwrap_or(default.main_files), - modules: op.modules.map(|o| StrOrStrList(o).into()).unwrap_or(default.modules), - resolve_to_context: op.resolve_to_context.unwrap_or(default.resolve_to_context), - prefer_relative: op.prefer_relative.unwrap_or(default.prefer_relative), - prefer_absolute: op.prefer_absolute.unwrap_or(default.prefer_absolute), - restrictions: op - .restrictions - .map(|restrictions| { - restrictions - .into_iter() - .map(|restriction| restriction.into()) - .collect::>() - }) - .unwrap_or(default.restrictions), - roots: op - .roots - .map(|roots| roots.into_iter().map(PathBuf::from).collect::>()) - .unwrap_or(default.roots), - symlinks: op.symlinks.unwrap_or(default.symlinks), - builtin_modules: op.builtin_modules.unwrap_or(default.builtin_modules), - } - } -} diff --git a/napi/src/options.rs b/napi/src/options.rs deleted file mode 100644 index ea35672f..00000000 --- a/napi/src/options.rs +++ /dev/null @@ -1,261 +0,0 @@ -use std::path::PathBuf; - -use napi::Either; -use napi_derive::napi; -use std::collections::HashMap; - -/// Module Resolution Options -/// -/// Options are directly ported from [enhanced-resolve](https://github.com/webpack/enhanced-resolve#resolver-options). -/// -/// See [webpack resolve](https://webpack.js.org/configuration/resolve/) for information and examples -#[derive(Debug, Clone)] -#[napi(object)] -pub struct NapiResolveOptions { - /// Path to TypeScript configuration file. - /// - /// Default `None` - pub tsconfig: Option, - - /// Alias for [ResolveOptions::alias] and [ResolveOptions::fallback]. - /// - /// For the second value of the tuple, `None -> AliasValue::Ignore`, Some(String) -> - /// AliasValue::Path(String)` - /// Create aliases to import or require certain modules more easily. - /// A trailing $ can also be added to the given object's keys to signify an exact match. - pub alias: Option>>>, - - /// A list of alias fields in description files. - /// Specify a field, such as `browser`, to be parsed according to [this specification](https://github.com/defunctzombie/package-browser-field-spec). - /// Can be a path to json object such as `["path", "to", "exports"]`. - /// - /// Default `[]` - #[napi(ts_type = "(string | string[])[]")] - pub alias_fields: Option>, - - /// Condition names for exports field which defines entry points of a package. - /// The key order in the exports field is significant. During condition matching, earlier entries have higher priority and take precedence over later entries. - /// - /// Default `[]` - pub condition_names: Option>, - - /// The JSON files to use for descriptions. (There was once a `bower.json`.) - /// - /// Default `["package.json"]` - pub description_files: Option>, - - /// If true, it will not allow extension-less files. - /// So by default `require('./foo')` works if `./foo` has a `.js` extension, - /// but with this enabled only `require('./foo.js')` will work. - /// - /// Default to `true` when [ResolveOptions::extensions] contains an empty string. - /// Use `Some(false)` to disable the behavior. - /// See - /// - /// Default None, which is the same as `Some(false)` when the above empty rule is not applied. - pub enforce_extension: Option, - - /// A list of exports fields in description files. - /// Can be a path to json object such as `["path", "to", "exports"]`. - /// - /// Default `[["exports"]]`. - #[napi(ts_type = "(string | string[])[]")] - pub exports_fields: Option>, - - /// Fields from `package.json` which are used to provide the internal requests of a package - /// (requests starting with # are considered internal). - /// - /// Can be a path to a JSON object such as `["path", "to", "imports"]`. - /// - /// Default `[["imports"]]`. - #[napi(ts_type = "(string | string[])[]")] - pub imports_fields: Option>, - - /// An object which maps extension to extension aliases. - /// - /// Default `{}` - pub extension_alias: Option>>, - - /// Attempt to resolve these extensions in order. - /// If multiple files share the same name but have different extensions, - /// will resolve the one with the extension listed first in the array and skip the rest. - /// - /// Default `[".js", ".json", ".node"]` - pub extensions: Option>, - - /// Redirect module requests when normal resolving fails. - /// - /// Default `[]` - pub fallback: Option>>>, - - /// 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). - /// - /// See also webpack configuration [resolve.fullySpecified](https://webpack.js.org/configuration/module/#resolvefullyspecified) - /// - /// Default `false` - pub fully_specified: Option, - - /// A list of main fields in description files - /// - /// Default `["main"]`. - #[napi(ts_type = "string | string[]")] - pub main_fields: Option, - - /// The filename to be used while resolving directories. - /// - /// Default `["index"]` - pub main_files: Option>, - - /// A list of directories to resolve modules from, can be absolute path or folder name. - /// - /// Default `["node_modules"]` - #[napi(ts_type = "string | string[]")] - pub modules: Option, - - /// Resolve to a context instead of a file. - /// - /// Default `false` - pub resolve_to_context: Option, - - /// Prefer to resolve module requests as relative requests instead of using modules from node_modules directories. - /// - /// Default `false` - pub prefer_relative: Option, - - /// Prefer to resolve server-relative urls as absolute paths before falling back to resolve in ResolveOptions::roots. - /// - /// Default `false` - pub prefer_absolute: Option, - - /// A list of resolve restrictions to restrict the paths that a request can be resolved on. - /// - /// Default `[]` - pub restrictions: Option>, - - /// A list of directories where requests of server-relative URLs (starting with '/') are resolved. - /// On non-Windows systems these requests are resolved as an absolute path first. - /// - /// Default `[]` - pub roots: Option>, - - /// Whether to resolve symlinks to their symlinked location. - /// When enabled, symlinked resources are resolved to their real path, not their symlinked location. - /// Note that this may cause module resolution to fail when using tools that symlink packages (like npm link). - /// - /// Default `true` - pub symlinks: Option, - - /// Whether to parse [module.builtinModules](https://nodejs.org/api/module.html#modulebuiltinmodules) or not. - /// For example, "zlib" will throw [crate::ResolveError::Builtin] when set to true. - /// - /// Default `false` - pub builtin_modules: Option, -} - -#[napi] -#[derive(Debug, PartialEq, Eq)] -pub enum EnforceExtension { - Auto, - Enabled, - Disabled, -} - -impl EnforceExtension { - pub fn is_auto(&self) -> bool { - *self == Self::Auto - } - - pub fn is_enabled(&self) -> bool { - *self == Self::Enabled - } - - pub fn is_disabled(&self) -> bool { - *self == Self::Disabled - } -} - -/// Alias Value for [ResolveOptions::alias] and [ResolveOptions::fallback]. -/// Use struct because napi don't support structured union now -#[napi(object)] -#[derive(Debug, Clone)] -pub struct Restriction { - pub path: Option, - pub regex: Option, -} - -/// Tsconfig Options -/// -/// Derived from [tsconfig-paths-webpack-plugin](https://github.com/dividab/tsconfig-paths-webpack-plugin#options) -#[napi(object)] -#[derive(Debug, Clone)] -pub struct TsconfigOptions { - /// Allows you to specify where to find the TypeScript configuration file. - /// You may provide - /// * a relative path to the configuration file. It will be resolved relative to cwd. - /// * an absolute path to the configuration file. - pub config_file: String, - - /// Support for Typescript Project References. - /// - /// * `'auto'`: use the `references` field from tsconfig of `config_file`. - /// * `string[]`: manually provided relative or absolute path. - #[napi(ts_type = "'auto' | string[]")] - pub references: Option>>, -} - -impl Into for Restriction { - fn into(self) -> oxc_resolver::Restriction { - match (self.path, self.regex) { - (None, None) => { - panic!("Should specify path or regex") - } - (None, Some(regex)) => oxc_resolver::Restriction::RegExp(regex), - (Some(path), None) => oxc_resolver::Restriction::Path(PathBuf::from(path)), - (Some(_), Some(_)) => { - panic!("Restriction can't be path and regex at the same time") - } - } - } -} - -impl Into for EnforceExtension { - fn into(self) -> oxc_resolver::EnforceExtension { - match self { - EnforceExtension::Auto => oxc_resolver::EnforceExtension::Auto, - EnforceExtension::Enabled => oxc_resolver::EnforceExtension::Enabled, - EnforceExtension::Disabled => oxc_resolver::EnforceExtension::Disabled, - } - } -} - -impl Into for TsconfigOptions { - fn into(self) -> oxc_resolver::TsconfigOptions { - oxc_resolver::TsconfigOptions { - config_file: PathBuf::from(self.config_file), - references: match self.references { - Some(Either::A(string)) if string.as_str() == "auto" => { - oxc_resolver::TsconfigReferences::Auto - } - Some(Either::A(opt)) => { - panic!("`{}` is not a valid option for tsconfig references", opt) - } - Some(Either::B(paths)) => oxc_resolver::TsconfigReferences::Paths( - paths.into_iter().map(PathBuf::from).collect::>(), - ), - None => oxc_resolver::TsconfigReferences::Disabled, - }, - } - } -} - -type StrOrStrListType = Either>; -pub struct StrOrStrList(pub StrOrStrListType); - -impl Into> for StrOrStrList { - fn into(self) -> Vec { - match self { - StrOrStrList(Either::A(s)) => Vec::from([s]), - StrOrStrList(Either::B(a)) => a, - } - } -} diff --git a/napi/src/tracing.rs b/napi/src/tracing.rs deleted file mode 100644 index 88e4cd7e..00000000 --- a/napi/src/tracing.rs +++ /dev/null @@ -1,25 +0,0 @@ -use std::sync::OnceLock; - -use tracing_subscriber::filter::Targets; -use tracing_subscriber::prelude::__tracing_subscriber_SubscriberExt; -use tracing_subscriber::util::SubscriberInitExt; - -/// To debug `oxc_resolver`: -/// `OXC_LOG=DEBUG your program` -pub fn init_tracing() { - static TRACING: OnceLock<()> = OnceLock::new(); - TRACING.get_or_init(|| { - // Usage without the `regex` feature. - // - tracing_subscriber::registry() - .with(std::env::var("OXC_LOG").map_or_else( - |_| Targets::new(), - |env_var| { - use std::str::FromStr; - Targets::from_str(&env_var).unwrap() - }, - )) - .with(tracing_subscriber::fmt::layer()) - .init(); - }); -} diff --git a/napi/tests/options.test.mjs b/napi/tests/options.test.mjs deleted file mode 100644 index 4a93efff..00000000 --- a/napi/tests/options.test.mjs +++ /dev/null @@ -1,59 +0,0 @@ -import { describe, it } from "node:test"; -import { ResolverFactory } from "../index.js"; -import * as assert from "node:assert"; -import * as path from "node:path"; - -const fixtureDir = new URL( - "../../fixtures/enhanced_resolve/test/fixtures", - import.meta.url -).pathname; - -describe("option", () => { - describe("aliasFields", () => { - it("should allow field string ", () => { - const resolver = new ResolverFactory({ aliasFields: ["browser"] }); - assert.match( - resolver.sync(fixtureDir, "./browser-module/lib/replaced.js").path, - /browser-module\/lib\/browser\.js$/ - ); - }); - it("should allow json path array", () => { - const resolver = new ResolverFactory({ - aliasFields: [["innerBrowser1", "field", "browser"]], - }); - - assert.match( - resolver.sync(fixtureDir, "./browser-module/lib/main1.js").path, - /browser-module\/lib\/main\.js$/ - ); - }); - }); - - describe("exportsFields", () => { - const createTest = (exportsFields) => { - const resolver = new ResolverFactory({ exportsFields }); - assert.match( - resolver.sync( - path.resolve(fixtureDir, "./exports-field3"), - "exports-field" - ).path, - /\/exports-field\/src\/index\.js$/ - ); - }; - it("should allow string as field item", createTest(["broken"])); - it("should allow json path array as field item", createTest([["broken"]])); - }); - - describe("mainFields", () => { - const createTest = (mainFields) => { - const resolver = new ResolverFactory({ mainFields }); - assert.match( - resolver.sync(fixtureDir, "../..").path, - /\/lib\/index\.js$/ - ); - }; - it("should use `'main'` as default", createTest(undefined)); - it("should allow field string", createTest("main")); - it("should allow field array", createTest(["main"])); - }); -}); diff --git a/npm/package.json b/npm/package.json index 85422809..7136edb8 100644 --- a/npm/package.json +++ b/npm/package.json @@ -1,47 +1,36 @@ { - "name": "oxc-resolver", - "version": "1.11.0", - "description": "Oxc Resolver Node API", - "main": "index.js", - "browser": "browser.js", - "files": [ - "index.d.ts", - "index.js", - "browser.js" - ], - "license": "MIT", - "homepage": "https://oxc.rs", - "repository": { - "type": "git", - "url": "git+https://github.com/oxc-project/oxc-resolver.git" - }, - "publishConfig": { - "registry": "https://registry.npmjs.org/", - "access": "public" - }, - "napi": { - "binaryName": "resolver", - "packageName": "@oxc-resolver/binding", - "wasm": { - "browser": { - "fs": true - } - }, - "targets": [ - "x86_64-pc-windows-msvc", - "aarch64-pc-windows-msvc", - "x86_64-unknown-linux-gnu", - "x86_64-unknown-linux-musl", - "x86_64-unknown-freebsd", - "aarch64-unknown-linux-gnu", - "aarch64-unknown-linux-musl", - "armv7-unknown-linux-gnueabihf", - "x86_64-apple-darwin", - "aarch64-apple-darwin", - "wasm32-wasip1-threads" - ] - }, - "funding": { - "url": "https://github.com/sponsors/Boshen" - } + "browser": "browser.js", + "description": "Oxc Resolver Node API", + "files": [ + "index.d.ts", + "index.js", + "browser.js" + ], + "funding": { + "url": "https://github.com/sponsors/Boshen" + }, + "main": "index.js", + "name": "oxc-resolver", + "napi": { + "binaryName": "resolver", + "packageName": "@oxc-resolver/binding", + "targets": [ + "x86_64-pc-windows-msvc", + "aarch64-pc-windows-msvc", + "x86_64-unknown-linux-gnu", + "x86_64-unknown-linux-musl", + "x86_64-unknown-freebsd", + "aarch64-unknown-linux-gnu", + "aarch64-unknown-linux-musl", + "armv7-unknown-linux-gnueabihf", + "x86_64-apple-darwin", + "aarch64-apple-darwin", + "wasm32-wasip1-threads" + ], + "wasm": { + "browser": { + "fs": true + } + } + } } diff --git a/package.json b/package.json index 30892ca3..d0ee7633 100644 --- a/package.json +++ b/package.json @@ -1,33 +1,24 @@ { - "name": "@oxc-resolver/binding", - "private": true, - "version": "0.0.0", - "scripts": { - "build": "napi build --platform --release --package-json-path npm/package.json --manifest-path napi/Cargo.toml", - "build:debug": "napi build --platform --package-json-path npm/package.json --manifest-path napi/Cargo.toml", - "prepublishOnly": "napi pre-publish -t npm", - "test": "ava" - }, - "devDependencies": { - "@napi-rs/cli": "3.0.0-alpha.62", - "@napi-rs/wasm-runtime": "^0.2.4", - "@types/node": "^22.0.0", - "ava": "^6.1.3", - "emnapi": "^1.2.0", - "typescript": "^5.5.3" - }, - "ava": { - "files": [ - "napi/__test__/*.spec.mjs" - ], - "cache": false - }, - "packageManager": "pnpm@9.9.0", - "repository": { - "type": "git", - "url": "git+https://github.com/oxc-project/oxc-resolver.git" - }, - "funding": { - "url": "https://github.com/sponsors/Boshen" - } + "ava": { + "cache": false, + "files": [ + "napi/__test__/*.spec.mjs" + ] + }, + "devDependencies": { + "@napi-rs/cli": "3.0.0-alpha.62", + "@napi-rs/wasm-runtime": "^0.2.4", + "@types/node": "^22.0.0", + "ava": "^6.1.3", + "emnapi": "^1.2.0" + }, + "funding": { + "url": "https://github.com/sponsors/Boshen" + }, + "name": "@oxc-resolver/binding", + "scripts": { + "build": "napi build --platform --release --package-json-path npm/package.json --manifest-path napi/Cargo.toml", + "build:debug": "napi build --platform --package-json-path npm/package.json --manifest-path napi/Cargo.toml", + "prepublishOnly": "napi pre-publish -t npm" + } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml deleted file mode 100644 index db9e5b63..00000000 --- a/pnpm-lock.yaml +++ /dev/null @@ -1,2598 +0,0 @@ -lockfileVersion: '9.0' - -settings: - autoInstallPeers: true - excludeLinksFromLockfile: false - -importers: - - .: - devDependencies: - '@napi-rs/cli': - specifier: 3.0.0-alpha.62 - version: 3.0.0-alpha.62(@emnapi/runtime@1.2.0)(emnapi@1.2.0) - '@napi-rs/wasm-runtime': - specifier: ^0.2.4 - version: 0.2.4 - '@types/node': - specifier: ^22.0.0 - version: 22.5.4 - ava: - specifier: ^6.1.3 - version: 6.1.3 - emnapi: - specifier: ^1.2.0 - version: 1.2.0 - typescript: - specifier: ^5.5.3 - version: 5.5.4 - - fixtures/pnpm: - devDependencies: - axios: - specifier: 1.6.2 - version: 1.6.2 - ipaddr.js: - specifier: 2.2.0 - version: 2.2.0 - postcss: - specifier: 8.4.33 - version: 8.4.33 - styled-components: - specifier: 6.1.1 - version: 6.1.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - - npm: {} - -packages: - - '@emnapi/core@1.2.0': - resolution: {integrity: sha512-E7Vgw78I93we4ZWdYCb4DGAwRROGkMIXk7/y87UmANR+J6qsWusmC3gLt0H+O0KOt5e6O38U8oJamgbudrES/w==} - - '@emnapi/runtime@1.2.0': - resolution: {integrity: sha512-bV21/9LQmcQeCPEg3BDFtvwL6cwiTMksYNWQQ4KOxCZikEGalWtenoZ0wCiukJINlGCIi2KXx01g4FoH/LxpzQ==} - - '@emnapi/wasi-threads@1.0.1': - resolution: {integrity: sha512-iIBu7mwkq4UQGeMEM8bLwNK962nXdhodeScX4slfQnRhEMMzvYivHhutCIk8uojvmASXXPC2WNEjwxFWk72Oqw==} - - '@emotion/is-prop-valid@1.2.2': - resolution: {integrity: sha512-uNsoYd37AFmaCdXlg6EYD1KaPOaRWRByMCYzbKUX4+hhMfrxdVSelShywL4JVaAeM/eHUOSprYBQls+/neX3pw==} - - '@emotion/memoize@0.8.1': - resolution: {integrity: sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA==} - - '@emotion/unitless@0.8.1': - resolution: {integrity: sha512-KOEGMu6dmJZtpadb476IsZBclKvILjopjUii3V+7MnXIQCYh8W3NgNcgwo21n9LXZX6EDIKvqfjYxXebDwxKmQ==} - - '@inquirer/checkbox@2.3.10': - resolution: {integrity: sha512-CTc864M2/523rKc9AglIzAcUCuPXDZENgc5S2KZFVRbnMzpXcYTsUWmbqSeL0XLvtlvEtNevkkVbfVhJpruOyQ==} - engines: {node: '>=18'} - - '@inquirer/confirm@3.1.14': - resolution: {integrity: sha512-nbLSX37b2dGPtKWL3rPuR/5hOuD30S+pqJ/MuFiUEgN6GiMs8UMxiurKAMDzKt6C95ltjupa8zH6+3csXNHWpA==} - engines: {node: '>=18'} - - '@inquirer/core@9.0.2': - resolution: {integrity: sha512-nguvH3TZar3ACwbytZrraRTzGqyxJfYJwv+ZwqZNatAosdWQMP1GV8zvmkNlBe2JeZSaw0WYBHZk52pDpWC9qA==} - engines: {node: '>=18'} - - '@inquirer/editor@2.1.14': - resolution: {integrity: sha512-6nWpoJyVAKwAcv67bkbBmmi3f32xua79fP7TRmNUoR4K+B1GiOBsHO1YdvET/jvC+nTlBZL7puKAKyM7G+Lkzw==} - engines: {node: '>=18'} - - '@inquirer/expand@2.1.14': - resolution: {integrity: sha512-JcxsLajwPykF2kq6biIUdoOzTQ3LXqb8XMVrWkCprG/pFeU1SsxcSSFbF1T5jJGvvlTVcsE+JdGjbQ8ZRZ82RA==} - engines: {node: '>=18'} - - '@inquirer/figures@1.0.3': - resolution: {integrity: sha512-ErXXzENMH5pJt5/ssXV0DfWUZqly8nGzf0UcBV9xTnP+KyffE2mqyxIMBrZ8ijQck2nU0TQm40EQB53YreyWHw==} - engines: {node: '>=18'} - - '@inquirer/input@2.2.1': - resolution: {integrity: sha512-Yl1G6h7qWydzrJwqN777geeJVaAFL5Ly83aZlw4xHf8Z/BoTMfKRheyuMaQwOG7LQ4e5nQP7PxXdEg4SzQ+OKw==} - engines: {node: '>=18'} - - '@inquirer/number@1.0.2': - resolution: {integrity: sha512-GcoK+Phxcln0Qw9e73S5a8B2Ejg3HgSTvNfDegIcS5/BKwUm8t5rejja1l09WXjZM9vrVbRDf9RzWtSUiWVYRQ==} - engines: {node: '>=18'} - - '@inquirer/password@2.1.14': - resolution: {integrity: sha512-sPzOkXLhWJQ96K6nPZFnF8XB8tsDrcCRobd1d3EDz81F+4hp8BbdmsnsQcqZ7oYDIOVM/mWJyIUtJ35TrssJxQ==} - engines: {node: '>=18'} - - '@inquirer/prompts@5.1.2': - resolution: {integrity: sha512-E+ndnfwtVQtcmPt888Hc/HAxJUHSaA6OIvyvLAQ5BLQv+t20GbYdFSjXeLgb47OpMU+aRsKA/ys+Zoylw3kTVg==} - engines: {node: '>=18'} - - '@inquirer/rawlist@2.1.14': - resolution: {integrity: sha512-pLpEzhKNQ/ugFAFfgCNaXljB+dcCwmXwR1jOxAbVeFIdB3l02E5gjI+h1rb136tq0T8JO6P5KFR1oTeld/wdrA==} - engines: {node: '>=18'} - - '@inquirer/select@2.3.10': - resolution: {integrity: sha512-rr7iR0Zj1YFfgM8IUGimPD9Yukd+n/U63CnYT9kdum6DbRXtMxR45rrreP+EA9ixCnShr+W4xj7suRxC1+8t9g==} - engines: {node: '>=18'} - - '@inquirer/type@1.4.0': - resolution: {integrity: sha512-AjOqykVyjdJQvtfkNDGUyMYGF8xN50VUxftCQWsOyIo4DFRLr6VQhW0VItGI1JIyQGCGgIpKa7hMMwNhZb4OIw==} - engines: {node: '>=18'} - - '@mapbox/node-pre-gyp@1.0.11': - resolution: {integrity: sha512-Yhlar6v9WQgUp/He7BdgzOz8lqMQ8sU+jkCq7Wx8Myc5YFJLbEe7lgui/V7G1qB1DJykHSGwreceSaD60Y0PUQ==} - hasBin: true - - '@napi-rs/cli@3.0.0-alpha.62': - resolution: {integrity: sha512-IDUwHAEJZ9ad/s5oyhznrz5ZDcU+SJ6GdP5nb++Wx5MkS4FD9MeS3HfNZdsxkf10pOUPnmvCVFuG4xnLBQYmjw==} - engines: {node: '>= 16'} - hasBin: true - peerDependencies: - '@emnapi/runtime': ^1.1.0 - emnapi: ^1.1.0 - peerDependenciesMeta: - '@emnapi/runtime': - optional: true - emnapi: - optional: true - - '@napi-rs/cross-toolchain@0.0.16': - resolution: {integrity: sha512-jwdjHT5L0m9MH0CmzDwPp0ckn/UO7afHCsPeo7NugHUvYgvlgS7SWhdMVgIgJW2HHqhcW/2nhaLLGpAU1c7QRQ==} - peerDependencies: - '@napi-rs/cross-toolchain-arm64-target-aarch64': ^0.0.16 - '@napi-rs/cross-toolchain-arm64-target-armv7': ^0.0.16 - '@napi-rs/cross-toolchain-arm64-target-x86_64': ^0.0.16 - '@napi-rs/cross-toolchain-x64-target-aarch64': ^0.0.16 - '@napi-rs/cross-toolchain-x64-target-armv7': ^0.0.16 - '@napi-rs/cross-toolchain-x64-target-x86_64': ^0.0.16 - peerDependenciesMeta: - '@napi-rs/cross-toolchain-arm64-target-aarch64': - optional: true - '@napi-rs/cross-toolchain-arm64-target-armv7': - optional: true - '@napi-rs/cross-toolchain-arm64-target-x86_64': - optional: true - '@napi-rs/cross-toolchain-x64-target-aarch64': - optional: true - '@napi-rs/cross-toolchain-x64-target-armv7': - optional: true - '@napi-rs/cross-toolchain-x64-target-x86_64': - optional: true - - '@napi-rs/lzma-android-arm-eabi@1.3.1': - resolution: {integrity: sha512-mtGOg8jXlc+pTBI86cqohfndS9UmOAkk9d5CChKMb8btVks70yhUN1e7YYS3QFbmoxbPs2Ee+wmuH1Khdc7B2w==} - engines: {node: '>= 10'} - cpu: [arm] - os: [android] - - '@napi-rs/lzma-android-arm64@1.3.1': - resolution: {integrity: sha512-4uGkQgAv9Tnc/i0k2eIgbhZgyzs94+iECWxz4MFZNcZ1fNGvGbRL2j+SITE4OmwrUn3TuFK/uYWfgzooq8E1Qg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [android] - - '@napi-rs/lzma-darwin-arm64@1.3.1': - resolution: {integrity: sha512-MZBg4iwHTS8icjTiCMdzh8kYrMmKBCEglFPa+vjI91R2XDwuuwSzqmpATRpmMH8cWUUWtGPF4fnxKzjgkzhd4Q==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [darwin] - - '@napi-rs/lzma-darwin-x64@1.3.1': - resolution: {integrity: sha512-7vte+1lYV7xgZERKH/pjAeh4T16aQASKOzu4op70pK6VP/64Plr5rrvqxQqQmlAIe4pwyo/RkFl1n4LXDod3xg==} - engines: {node: '>= 10'} - cpu: [x64] - os: [darwin] - - '@napi-rs/lzma-freebsd-x64@1.3.1': - resolution: {integrity: sha512-uBS74fynTqLUC3catIxyezCafn8UDlr2yxVV47vz1T6Vop2PGDz/cMQdV6rnLSjPE08Rv66ihM36mgf/MmOkOg==} - engines: {node: '>= 10'} - cpu: [x64] - os: [freebsd] - - '@napi-rs/lzma-linux-arm-gnueabihf@1.3.1': - resolution: {integrity: sha512-rrVLyqBJeN29gPJCNkPbZ7dAzaseEcERKyhjwM+DfbFrDUvtkEcrYPvo+iwE/NmF+OkZQkzcanrVMGnq/mcJYQ==} - engines: {node: '>= 10'} - cpu: [arm] - os: [linux] - - '@napi-rs/lzma-linux-arm64-gnu@1.3.1': - resolution: {integrity: sha512-vDmVsthRbX2opkgRirJJGKQxUP/spvyVM2Y5CyCWZ7sadSID3hA97r38gf9ISn/sJ8/r93IPWLq+iycudNKi+Q==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/lzma-linux-arm64-musl@1.3.1': - resolution: {integrity: sha512-x4m/J3hRdFd3IoqKc+4aBcSUkcuDEP7hH6vdss8bKNLjPfXmnG/lcHJEQX3hNnNOULPP8xVRxgiY8jeL62cnsw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/lzma-linux-x64-gnu@1.3.1': - resolution: {integrity: sha512-riB+Xg72NfH8Kcpq07omshVu0QsLW0v2bhywBNYxvA+t2dGGWSIEN1U/zazUXys+IEA6pBQKqLVseurWE6Cl8g==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/lzma-linux-x64-musl@1.3.1': - resolution: {integrity: sha512-JXLgJFwoeysxdSg7rdVYP8wrliCQVJlU5JcLYjRVSCL4P0mQTjnYi7R7VdaOkDACw/Fvlji7oIJXt0KiaDTcOw==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/lzma-wasm32-wasi@1.3.1': - resolution: {integrity: sha512-XTA9XTUtj0KPKuzNS2oi3bWN6tJodk00wwMd/TiKoEqx9Fe/zu+OfDGuXAn+xs+P7S3YCDHqjYinuTQMZ0ucJw==} - engines: {node: '>=14.0.0'} - cpu: [wasm32] - - '@napi-rs/lzma-win32-arm64-msvc@1.3.1': - resolution: {integrity: sha512-qLDfs9UEtLPPTN/FdSz3gSdlx86VwFQBuLBrQtaiYQtUTKZCOYV1Z1fXqFt5Zqa1HKV2oyXnwGcTI7RpcyXxtg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [win32] - - '@napi-rs/lzma-win32-ia32-msvc@1.3.1': - resolution: {integrity: sha512-rWNlxLFMIfvxzfdQCfeQ3D/HEnQG3vfladFYrXUx6ePXO6r+BLCGn6/LWSSuKlw4vKkb1iHEWsAVaRLIcJEMIA==} - engines: {node: '>= 10'} - cpu: [ia32] - os: [win32] - - '@napi-rs/lzma-win32-x64-msvc@1.3.1': - resolution: {integrity: sha512-SNfHNqEjabXfTL1+KRi0qiAhwIlZHhQystvfSYX6p1g+2trSC/3WUpUQ4fbbR7KyE31g2AAnwjXivnlQ0af/pg==} - engines: {node: '>= 10'} - cpu: [x64] - os: [win32] - - '@napi-rs/lzma@1.3.1': - resolution: {integrity: sha512-XyZoBlYNMvCulK/RmVK/0nB3j7IdH7HpqcrMMg0U+HqQqKRLOQBwvnKNBocPC1bZQ7iZuKWYTLn1ayZwTyek8w==} - engines: {node: '>= 10'} - - '@napi-rs/tar-android-arm-eabi@0.1.1': - resolution: {integrity: sha512-Ufa0ahZvE5KGrC2WBux5svCe/jvC+e8IgtleiicwqnfgTfbDknYyq/QuqkP1AnMp/IvTmx2iutCZt6OFIG0zAg==} - engines: {node: '>= 10'} - cpu: [arm] - os: [android] - - '@napi-rs/tar-android-arm64@0.1.1': - resolution: {integrity: sha512-KUu5fHIiIObSuZ/crHxUrQ243+LiCRKPwdCVLHwjtftqFjzls+R2Mp6GrpM41XxexDMN00SUta3kazi93Xr19A==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [android] - - '@napi-rs/tar-darwin-arm64@0.1.1': - resolution: {integrity: sha512-jaqgdX20iIga+2gzotQ78eF00Cm8vECocUYeMY62WqyzJNv/jx1dlOfELWEccOjpmawFT9tjWebsS9F1QMvSUg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [darwin] - - '@napi-rs/tar-darwin-x64@0.1.1': - resolution: {integrity: sha512-80sa32IxfRso9x9sGTFpfLSx3BnruyJODpSkUzalOCz9i14n5gOKA8KR/JrnSWwDz0p5l5P9kfQD3pu8Voj7WA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [darwin] - - '@napi-rs/tar-freebsd-x64@0.1.1': - resolution: {integrity: sha512-P7V1zBjjC1dCrTwtUzuzYM4AeZduigeCtd8qQw2IUZowM5AsmhMd77oYuXjdU29cEpKUpyYjJRxjPCzFy+WbAQ==} - engines: {node: '>= 10'} - cpu: [x64] - os: [freebsd] - - '@napi-rs/tar-linux-arm-gnueabihf@0.1.1': - resolution: {integrity: sha512-qpC71ILPkWKt8k1iJCYt5gjwcOkd2VFSQIelTRr12t5CVNKV04rE/TMdwFoCP7kxbtb9Fl2cZzCRISw2BhMCmQ==} - engines: {node: '>= 10'} - cpu: [arm] - os: [linux] - - '@napi-rs/tar-linux-arm64-gnu@0.1.1': - resolution: {integrity: sha512-71QgxcFJCog6O4Tauoge8D0ILkDGJTRk3ru7zG8PUFG1QXJ1kkiRikdT77YmoVxtomc9FUOt+bdEdU5Yn+3QUQ==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/tar-linux-arm64-musl@0.1.1': - resolution: {integrity: sha512-R2e7YEILPKc447N1hUt1zQuyy0st83HX6nhmtFywS1aOj76/3hzxLVrebGiiS6kifyCrO82o66CNTYe7DixMZw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/tar-linux-x64-gnu@0.1.1': - resolution: {integrity: sha512-tmy9q2LXUB2GQ+IgUzJn3+us52leplMu96ORyFq1iHQEelGSqXt4xi5DzU07JhX3obJPqVqkybtcRS4enBfmBA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/tar-linux-x64-musl@0.1.1': - resolution: {integrity: sha512-j5ePbe6vihApl0cGPPDUVTWZbf2mF4NhxngAoG2jp7AeX3cWP2O4pjsvaOraW6QfvWEMFPeER7S0b6eBS7duvA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/tar-wasm32-wasi@0.1.1': - resolution: {integrity: sha512-se0+DlOiIRt7mcz7BeOJDoZtCrROpKLwiAOGmNgrjQ/SZS7TnOPuwm3wy9XN9WLoepttEjCEem6UP8yD5GJuQg==} - engines: {node: '>=14.0.0'} - cpu: [wasm32] - - '@napi-rs/tar-win32-arm64-msvc@0.1.1': - resolution: {integrity: sha512-FDZPi2wC7RwzvodogigLh/pJvhqCTVTUqOYuHlLkPSUbSAGiEkI55wk9RqH3y3EdJQaDuzyqC0QKz5ket2U+GA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [win32] - - '@napi-rs/tar-win32-ia32-msvc@0.1.1': - resolution: {integrity: sha512-OPR9Tou5z5M912G7Kc7gkf1ltinbOQx5dS/OeDIWHvPGOfdFDIxt0YVKhzSLRJi43+zIDp8/+cbeMD/cKXfX8w==} - engines: {node: '>= 10'} - cpu: [ia32] - os: [win32] - - '@napi-rs/tar-win32-x64-msvc@0.1.1': - resolution: {integrity: sha512-hiv5KfhrMSg8tTRC2oQXVckVg1h6ZVjwbd5aF9Esl0V3p2TaNFwwbqgnAN4Gm/PmSnHWNL/IRTHkk3cOzDWihQ==} - engines: {node: '>= 10'} - cpu: [x64] - os: [win32] - - '@napi-rs/tar@0.1.1': - resolution: {integrity: sha512-FOMhwwlvoYjHaDBxP26K3D92ltw1Y/CC4CIjgC6qXdzW4MYNwTlEyI58smCM3k+nCVJH3kpOYyH3sgbK4WZA4A==} - engines: {node: '>= 10'} - - '@napi-rs/wasm-runtime@0.2.4': - resolution: {integrity: sha512-9zESzOO5aDByvhIAsOy9TbpZ0Ur2AJbUI7UT73kcUTS2mxAMHOBaa1st/jAymNoCtvrit99kkzT1FZuXVcgfIQ==} - - '@napi-rs/wasm-tools-android-arm-eabi@0.0.2': - resolution: {integrity: sha512-/b+UU3suXjW4P0DzHRNdrnebQtFKcQf/YMeZJH+xUlKgvwli5kbmWjx8Wqqz0VETVkUTuPqJMBDIVLyc+14FGw==} - engines: {node: '>= 10'} - cpu: [arm] - os: [android] - - '@napi-rs/wasm-tools-android-arm64@0.0.2': - resolution: {integrity: sha512-j57GbDflwJdZtT8pZj5fOV4JAP+LdKN+wzsUYs+QRUoBqpWbbUANudolqfw63bkS9sD4z7fbCuz8iwtJqzxTVA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [android] - - '@napi-rs/wasm-tools-darwin-arm64@0.0.2': - resolution: {integrity: sha512-P2ChgWgVuv9GwmbxN89R84KzIImoTqXINteEixUvmkdnhyFiR+I8deNs89Yed+5w8QLC6MEfrtRqLP9YI+NoQA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [darwin] - - '@napi-rs/wasm-tools-darwin-x64@0.0.2': - resolution: {integrity: sha512-T/kQQ0gt8+wau1Z821PKVAD76QhmwVoLs2CT7Z9tTBs2pJvwSCP0C/kQiQAHcJIMi7A2E9Ab/Mez0BERy50EFA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [darwin] - - '@napi-rs/wasm-tools-freebsd-x64@0.0.2': - resolution: {integrity: sha512-GnnHu+r5sfzuxC/1J5UMF/h3BOZnHb3NQZ5hmbCfZYCKzpzRxrAJhzRunlbRN+v0x8M/49dztVTYR3s7K4ooAw==} - engines: {node: '>= 10'} - cpu: [x64] - os: [freebsd] - - '@napi-rs/wasm-tools-linux-arm64-gnu@0.0.2': - resolution: {integrity: sha512-KnZdLT0OnKb1CG2kdt3/WvM43vr9i+FEwXCvSOVC/6Tsifz7ynhMg7LAVESILd03HubzQJfg9nbRsk0bQ+IOwg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/wasm-tools-linux-arm64-musl@0.0.2': - resolution: {integrity: sha512-HkpZOID2U8P6pWqK3mqZ8bxU5xcuT3iA2fO+jrxn78h006iYgfNmdc5JaVhHnHazMmk32xKhSV4iV0VUh8UWDg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/wasm-tools-linux-x64-gnu@0.0.2': - resolution: {integrity: sha512-YksJWBCyOalB9ogtP9+/dZKP+vR6+h7BmzMXaXMT71WW/GvIsifMVgv+DY/FRSNJQupp5Y+ugjqVAOUOc/G65g==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/wasm-tools-linux-x64-musl@0.0.2': - resolution: {integrity: sha512-sPtRxPMdw05KdTcxgSPMmSXG2+PiK3vJ/l2+g9hvjnnKtvslJN2Hr7j8zgzuoKRAUFPaJVe6+D2xVh5cpdqhww==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/wasm-tools-wasm32-wasi@0.0.2': - resolution: {integrity: sha512-muRvZK7AIuo88G2AxYx3gA59rHMQgoN004saQkBvXnz3K/DVHKfTZ6TtUebss8zI3dURU6xExL8drxFWYxjEbQ==} - engines: {node: '>=14.0.0'} - cpu: [wasm32] - - '@napi-rs/wasm-tools-win32-arm64-msvc@0.0.2': - resolution: {integrity: sha512-Cn13WQ+tpFqdVwx0DIWKbsI9auFyzVZV4F5UNOUeDt6GgOL+NndgJul0Pc9bSU6fi03AylMPfF/nTCaDWO2Wgw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [win32] - - '@napi-rs/wasm-tools-win32-ia32-msvc@0.0.2': - resolution: {integrity: sha512-xsg5DkIQi82a8rcx6246Y3XC8TIqHamY+/C6sIlPLaZEuHctDkMECAw0AANwRf5vN//D2oo2oljOuoYtB1GOKw==} - engines: {node: '>= 10'} - cpu: [ia32] - os: [win32] - - '@napi-rs/wasm-tools-win32-x64-msvc@0.0.2': - resolution: {integrity: sha512-yHigltEt33eq8bappvKsIliz4MxfMPn1M+NWbIFRWN+IS1Z57mhmc1osuk+IRXrSlq0Tom0R6MYN1jpkZKz81Q==} - engines: {node: '>= 10'} - cpu: [x64] - os: [win32] - - '@napi-rs/wasm-tools@0.0.2': - resolution: {integrity: sha512-kBvDQCP5BLw2TxTENXLp3Of7vVEx0uyIye824JHE4dduzzOHVgSoOFVhVqAT3Fx/hLV445RVWfEqQbXMg4w/Mw==} - engines: {node: '>= 10'} - - '@nodelib/fs.scandir@2.1.5': - resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} - engines: {node: '>= 8'} - - '@nodelib/fs.stat@2.0.5': - resolution: {integrity: sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==} - engines: {node: '>= 8'} - - '@nodelib/fs.walk@1.2.8': - resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} - engines: {node: '>= 8'} - - '@octokit/auth-token@5.1.1': - resolution: {integrity: sha512-rh3G3wDO8J9wSjfI436JUKzHIxq8NaiL0tVeB2aXmG6p/9859aUOAjA9pmSPNGGZxfwmaJ9ozOJImuNVJdpvbA==} - engines: {node: '>= 18'} - - '@octokit/core@6.1.2': - resolution: {integrity: sha512-hEb7Ma4cGJGEUNOAVmyfdB/3WirWMg5hDuNFVejGEDFqupeOysLc2sG6HJxY2etBp5YQu5Wtxwi020jS9xlUwg==} - engines: {node: '>= 18'} - - '@octokit/endpoint@10.1.1': - resolution: {integrity: sha512-JYjh5rMOwXMJyUpj028cu0Gbp7qe/ihxfJMLc8VZBMMqSwLgOxDI1911gV4Enl1QSavAQNJcwmwBF9M0VvLh6Q==} - engines: {node: '>= 18'} - - '@octokit/graphql@8.1.1': - resolution: {integrity: sha512-ukiRmuHTi6ebQx/HFRCXKbDlOh/7xEV6QUXaE7MJEKGNAncGI/STSbOkl12qVXZrfZdpXctx5O9X1AIaebiDBg==} - engines: {node: '>= 18'} - - '@octokit/openapi-types@22.2.0': - resolution: {integrity: sha512-QBhVjcUa9W7Wwhm6DBFu6ZZ+1/t/oYxqc2tp81Pi41YNuJinbFRx8B133qVOrAaBbF7D/m0Et6f9/pZt9Rc+tg==} - - '@octokit/plugin-paginate-rest@11.3.3': - resolution: {integrity: sha512-o4WRoOJZlKqEEgj+i9CpcmnByvtzoUYC6I8PD2SA95M+BJ2x8h7oLcVOg9qcowWXBOdcTRsMZiwvM3EyLm9AfA==} - engines: {node: '>= 18'} - peerDependencies: - '@octokit/core': '>=6' - - '@octokit/plugin-request-log@5.3.0': - resolution: {integrity: sha512-FiGcyjdtYPlr03ExBk/0ysIlEFIFGJQAVoPPMxL19B24bVSEiZQnVGBunNtaAF1YnvE/EFoDpXmITtRnyCiypQ==} - engines: {node: '>= 18'} - peerDependencies: - '@octokit/core': '>=6' - - '@octokit/plugin-rest-endpoint-methods@13.2.4': - resolution: {integrity: sha512-gusyAVgTrPiuXOdfqOySMDztQHv6928PQ3E4dqVGEtOvRXAKRbJR4b1zQyniIT9waqaWk/UDaoJ2dyPr7Bk7Iw==} - engines: {node: '>= 18'} - peerDependencies: - '@octokit/core': '>=6' - - '@octokit/request-error@6.1.2': - resolution: {integrity: sha512-sA0oF7aL5wXbNfl+7zgLYJiFZctei9GaIMJlTraJrlQyFaoIYr4MCqPSakzxxGCfm8fET4vn0cQdRFmD7avlDg==} - engines: {node: '>= 18'} - - '@octokit/request@9.1.1': - resolution: {integrity: sha512-pyAguc0p+f+GbQho0uNetNQMmLG1e80WjkIaqqgUkihqUp0boRU6nKItXO4VWnr+nbZiLGEyy4TeKRwqaLvYgw==} - engines: {node: '>= 18'} - - '@octokit/rest@21.0.0': - resolution: {integrity: sha512-XudXXOmiIjivdjNZ+fN71NLrnDM00sxSZlhqmPR3v0dVoJwyP628tSlc12xqn8nX3N0965583RBw5GPo6r8u4Q==} - engines: {node: '>= 18'} - - '@octokit/types@13.5.0': - resolution: {integrity: sha512-HdqWTf5Z3qwDVlzCrP8UJquMwunpDiMPt5er+QjGzL4hqr/vBVY/MauQgS1xWxCDT1oMx1EULyqxncdCY/NVSQ==} - - '@rollup/pluginutils@4.2.1': - resolution: {integrity: sha512-iKnFXr7NkdZAIHiIWE+BX5ULi/ucVFYWD6TbAV+rZctiRTY2PL6tsIKhoIOaoskiWAkgu+VsbXgUVDNLHf+InQ==} - engines: {node: '>= 8.0.0'} - - '@sindresorhus/merge-streams@2.3.0': - resolution: {integrity: sha512-LtoMMhxAlorcGhmFYI+LhPgbPZCkgP6ra1YL604EeF6U98pLlQ3iWIGMdWSC+vWmPBWBNgmDBAhnAobLROJmwg==} - engines: {node: '>=18'} - - '@tybys/wasm-util@0.9.0': - resolution: {integrity: sha512-6+7nlbMVX/PVDCwaIQ8nTOPveOcFLSt8GcXdx8hD0bt39uWxYT88uXzqTd4fTvqta7oeUJqudepapKNt2DYJFw==} - - '@types/mute-stream@0.0.4': - resolution: {integrity: sha512-CPM9nzrCPPJHQNA9keH9CVkVI+WR5kMa+7XEs5jcGQ0VoAGnLv242w8lIVgwAEfmE4oufJRaTc9PNLQl0ioAow==} - - '@types/node@20.16.5': - resolution: {integrity: sha512-VwYCweNo3ERajwy0IUlqqcyZ8/A7Zwa9ZP3MnENWcB11AejO+tLy3pu850goUW2FC/IJMdZUfKpX/yxL1gymCA==} - - '@types/node@22.5.4': - resolution: {integrity: sha512-FDuKUJQm/ju9fT/SeX/6+gBzoPzlVCzfzmGkwKvRHQVxi4BntVbyIwf6a4Xn62mrvndLiml6z/UBXIdEVjQLXg==} - - '@types/stylis@4.2.6': - resolution: {integrity: sha512-4nebF2ZJGzQk0ka0O6+FZUWceyFv4vWq/0dXBMmrSeAwzOuOd/GxE5Pa64d/ndeNLG73dXoBsRzvtsVsYUv6Uw==} - - '@types/wrap-ansi@3.0.0': - resolution: {integrity: sha512-ltIpx+kM7g/MLRZfkbL7EsCEjfzCcScLpkg37eXEtx5kmrAKBkTJwd1GIAjDSL8wTpM6Hzn5YO4pSb91BEwu1g==} - - '@vercel/nft@0.26.5': - resolution: {integrity: sha512-NHxohEqad6Ra/r4lGknO52uc/GrWILXAMs1BB4401GTqww0fw1bAqzpG1XHuDO+dprg4GvsD9ZLLSsdo78p9hQ==} - engines: {node: '>=16'} - hasBin: true - - abbrev@1.1.1: - resolution: {integrity: sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==} - - acorn-import-attributes@1.9.5: - resolution: {integrity: sha512-n02Vykv5uA3eHGM/Z2dQrcD56kL8TyDb2p1+0P83PClMnC/nc+anbQRhIOWnSq4Ke/KvDPrY3C9hDtC/A3eHnQ==} - peerDependencies: - acorn: ^8 - - acorn-walk@8.3.3: - resolution: {integrity: sha512-MxXdReSRhGO7VlFe1bRG/oI7/mdLV9B9JJT0N8vZOhF7gFRR5l3M8W9G8JxmKV+JC5mGqJ0QvqfSOLsCPa4nUw==} - engines: {node: '>=0.4.0'} - - acorn@8.12.1: - resolution: {integrity: sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg==} - engines: {node: '>=0.4.0'} - hasBin: true - - agent-base@6.0.2: - resolution: {integrity: sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==} - engines: {node: '>= 6.0.0'} - - ansi-escapes@4.3.2: - resolution: {integrity: sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==} - engines: {node: '>=8'} - - ansi-regex@5.0.1: - resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} - engines: {node: '>=8'} - - ansi-regex@6.0.1: - resolution: {integrity: sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==} - engines: {node: '>=12'} - - ansi-styles@4.3.0: - resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} - engines: {node: '>=8'} - - ansi-styles@6.2.1: - resolution: {integrity: sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==} - engines: {node: '>=12'} - - aproba@2.0.0: - resolution: {integrity: sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==} - - are-we-there-yet@2.0.0: - resolution: {integrity: sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw==} - engines: {node: '>=10'} - deprecated: This package is no longer supported. - - argparse@1.0.10: - resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==} - - argparse@2.0.1: - resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} - - array-find-index@1.0.2: - resolution: {integrity: sha512-M1HQyIXcBGtVywBt8WVdim+lrNaK7VHp99Qt5pSNziXznKHViIBbXWtfRTpEFpF/c4FdfxNAsCCwPp5phBYJtw==} - engines: {node: '>=0.10.0'} - - arrgv@1.0.2: - resolution: {integrity: sha512-a4eg4yhp7mmruZDQFqVMlxNRFGi/i1r87pt8SDHy0/I8PqSXoUTlWZRdAZo0VXgvEARcujbtTk8kiZRi1uDGRw==} - engines: {node: '>=8.0.0'} - - arrify@3.0.0: - resolution: {integrity: sha512-tLkvA81vQG/XqE2mjDkGQHoOINtMHtysSnemrmoGe6PydDPMRbVugqyk4A6V/WDWEfm3l+0d8anA9r8cv/5Jaw==} - engines: {node: '>=12'} - - async-sema@3.1.1: - resolution: {integrity: sha512-tLRNUXati5MFePdAk8dw7Qt7DpxPB60ofAgn8WRhW6a2rcimZnYBP9oxHiv0OHy+Wz7kPMG+t4LGdt31+4EmGg==} - - asynckit@0.4.0: - resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} - - ava@6.1.3: - resolution: {integrity: sha512-tkKbpF1pIiC+q09wNU9OfyTDYZa8yuWvU2up3+lFJ3lr1RmnYh2GBpPwzYUEB0wvTPIUysGjcZLNZr7STDviRA==} - engines: {node: ^18.18 || ^20.8 || ^21 || ^22} - hasBin: true - peerDependencies: - '@ava/typescript': '*' - peerDependenciesMeta: - '@ava/typescript': - optional: true - - axios@1.6.2: - resolution: {integrity: sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A==} - - balanced-match@1.0.2: - resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} - - before-after-hook@3.0.2: - resolution: {integrity: sha512-Nik3Sc0ncrMK4UUdXQmAnRtzmNQTAAXmXIopizwZ1W1t8QmfJj+zL4OA2I7XPTPW5z5TDqv4hRo/JzouDJnX3A==} - - bindings@1.5.0: - resolution: {integrity: sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==} - - blueimp-md5@2.19.0: - resolution: {integrity: sha512-DRQrD6gJyy8FbiE4s+bDoXS9hiW3Vbx5uCdwvcCf3zLHL+Iv7LtGHLpr+GZV8rHG8tK766FGYBwRbu8pELTt+w==} - - brace-expansion@1.1.11: - resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} - - braces@3.0.3: - resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==} - engines: {node: '>=8'} - - callsites@4.2.0: - resolution: {integrity: sha512-kfzR4zzQtAE9PC7CzZsjl3aBNbXWuXiSeOCdLcPpBfGW8YuCqQHcRPFDbr/BPVmd3EEPVpuFzLyuT/cUhPr4OQ==} - engines: {node: '>=12.20'} - - camelize@1.0.1: - resolution: {integrity: sha512-dU+Tx2fsypxTgtLoE36npi3UqcjSSMNYfkqgmoEhtZrraP5VWq0K7FkWVTYa8eMPtnU/G2txVsfdCJTn9uzpuQ==} - - cbor@9.0.2: - resolution: {integrity: sha512-JPypkxsB10s9QOWwa6zwPzqE1Md3vqpPc+cai4sAecuCsRyAtAl/pMyhPlMbT/xtPnm2dznJZYRLui57qiRhaQ==} - engines: {node: '>=16'} - - chalk@5.3.0: - resolution: {integrity: sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==} - engines: {node: ^12.17.0 || ^14.13 || >=16.0.0} - - chardet@0.7.0: - resolution: {integrity: sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==} - - chownr@2.0.0: - resolution: {integrity: sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==} - engines: {node: '>=10'} - - chunkd@2.0.1: - resolution: {integrity: sha512-7d58XsFmOq0j6el67Ug9mHf9ELUXsQXYJBkyxhH/k+6Ke0qXRnv0kbemx+Twc6fRJ07C49lcbdgm9FL1Ei/6SQ==} - - ci-info@4.0.0: - resolution: {integrity: sha512-TdHqgGf9odd8SXNuxtUBVx8Nv+qZOejE6qyqiy5NtbYYQOeFa6zmHkxlPzmaLxWWHsU6nJmB7AETdVPi+2NBUg==} - engines: {node: '>=8'} - - ci-parallel-vars@1.0.1: - resolution: {integrity: sha512-uvzpYrpmidaoxvIQHM+rKSrigjOe9feHYbw4uOI2gdfe1C3xIlxO+kVXq83WQWNniTf8bAxVpy+cQeFQsMERKg==} - - cli-spinners@2.9.2: - resolution: {integrity: sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==} - engines: {node: '>=6'} - - cli-truncate@4.0.0: - resolution: {integrity: sha512-nPdaFdQ0h/GEigbPClz11D0v/ZJEwxmeVZGeMo3Z5StPtUTkA9o1lD6QwoirYiSDzbcwn2XcjwmCp68W1IS4TA==} - engines: {node: '>=18'} - - cli-width@4.1.0: - resolution: {integrity: sha512-ouuZd4/dm2Sw5Gmqy6bGyNNNe1qt9RpmxveLSO7KcgsTnU7RXfsw+/bukWGo1abgBiMAic068rclZsO4IWmmxQ==} - engines: {node: '>= 12'} - - clipanion@3.2.1: - resolution: {integrity: sha512-dYFdjLb7y1ajfxQopN05mylEpK9ZX0sO1/RfMXdfmwjlIsPkbh4p7A682x++zFPLDCo1x3p82dtljHf5cW2LKA==} - peerDependencies: - typanion: '*' - - cliui@8.0.1: - resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==} - engines: {node: '>=12'} - - code-excerpt@4.0.0: - resolution: {integrity: sha512-xxodCmBen3iy2i0WtAK8FlFNrRzjUqjRsMfho58xT/wvZU1YTM3fCnRjcy1gJPMepaRlgm/0e6w8SpWHpn3/cA==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - color-convert@2.0.1: - resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} - engines: {node: '>=7.0.0'} - - color-name@1.1.4: - resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} - - color-support@1.1.3: - resolution: {integrity: sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==} - hasBin: true - - colorette@2.0.20: - resolution: {integrity: sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==} - - combined-stream@1.0.8: - resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} - engines: {node: '>= 0.8'} - - common-path-prefix@3.0.0: - resolution: {integrity: sha512-QE33hToZseCH3jS0qN96O/bSh3kaw/h+Tq7ngyY9eWDUnTlTNUyqfqvCXioLe5Na5jFsL78ra/wuBU4iuEgd4w==} - - concat-map@0.0.1: - resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} - - concordance@5.0.4: - resolution: {integrity: sha512-OAcsnTEYu1ARJqWVGwf4zh4JDfHZEaSNlNccFmt8YjB2l/n19/PF2viLINHc57vO4FKIAFl2FWASIGZZWZ2Kxw==} - engines: {node: '>=10.18.0 <11 || >=12.14.0 <13 || >=14'} - - console-control-strings@1.1.0: - resolution: {integrity: sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==} - - convert-to-spaces@2.0.1: - resolution: {integrity: sha512-rcQ1bsQO9799wq24uE5AM2tAILy4gXGIK/njFWcVQkGNZ96edlpY+A7bjwvzjYvLDyzmG1MmMLZhpcsb+klNMQ==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - css-color-keywords@1.0.0: - resolution: {integrity: sha512-FyyrDHZKEjXDpNJYvVsV960FiqQyXc/LlYmsxl2BcdMb2WPx0OGRVgTg55rPSyLSNMqP52R9r8geSp7apN3Ofg==} - engines: {node: '>=4'} - - css-to-react-native@3.2.0: - resolution: {integrity: sha512-e8RKaLXMOFii+02mOlqwjbD00KSEKqblnpO9e++1aXS1fPQOpS1YoqdVHBqPjHNoxeF2mimzVqawm2KCbEdtHQ==} - - csstype@3.1.3: - resolution: {integrity: sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==} - - currently-unhandled@0.4.1: - resolution: {integrity: sha512-/fITjgjGU50vjQ4FH6eUoYu+iUoUKIXws2hL15JJpIR+BbTxaXQsMuuyjtNh2WqsSBS5nsaZHFsFecyw5CCAng==} - engines: {node: '>=0.10.0'} - - date-time@3.1.0: - resolution: {integrity: sha512-uqCUKXE5q1PNBXjPqvwhwJf9SwMoAHBgWJ6DcrnS5o+W2JOiIILl0JEdVD8SGujrNS02GGxgwAg2PN2zONgtjg==} - engines: {node: '>=6'} - - debug@4.3.5: - resolution: {integrity: sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg==} - engines: {node: '>=6.0'} - peerDependencies: - supports-color: '*' - peerDependenciesMeta: - supports-color: - optional: true - - delayed-stream@1.0.0: - resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} - engines: {node: '>=0.4.0'} - - delegates@1.0.0: - resolution: {integrity: sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==} - - detect-libc@2.0.3: - resolution: {integrity: sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw==} - engines: {node: '>=8'} - - emittery@1.0.3: - resolution: {integrity: sha512-tJdCJitoy2lrC2ldJcqN4vkqJ00lT+tOWNT1hBJjO/3FDMJa5TTIiYGCKGkn/WfCyOzUMObeohbVTj00fhiLiA==} - engines: {node: '>=14.16'} - - emnapi@1.2.0: - resolution: {integrity: sha512-rcq+dJCcfr08I0XM/57LPRqaUokGfni/+SvhO7NaJthTTjRdohhIy0FQwyC5rR1enAsjkldQg83th8J5hURv0Q==} - peerDependencies: - node-addon-api: '>= 6.1.0' - peerDependenciesMeta: - node-addon-api: - optional: true - - emoji-regex@10.3.0: - resolution: {integrity: sha512-QpLs9D9v9kArv4lfDEgg1X/gN5XLnf/A6l9cs8SPZLRZR3ZkY9+kwIQTxm+fsSej5UMYGE8fdoaZVIBlqG0XTw==} - - emoji-regex@8.0.0: - resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} - - escalade@3.1.2: - resolution: {integrity: sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==} - engines: {node: '>=6'} - - escape-string-regexp@2.0.0: - resolution: {integrity: sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==} - engines: {node: '>=8'} - - escape-string-regexp@5.0.0: - resolution: {integrity: sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==} - engines: {node: '>=12'} - - esprima@4.0.1: - resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==} - engines: {node: '>=4'} - hasBin: true - - estree-walker@2.0.2: - resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==} - - esutils@2.0.3: - resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} - engines: {node: '>=0.10.0'} - - external-editor@3.1.0: - resolution: {integrity: sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==} - engines: {node: '>=4'} - - fast-diff@1.3.0: - resolution: {integrity: sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==} - - fast-glob@3.3.2: - resolution: {integrity: sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==} - engines: {node: '>=8.6.0'} - - fastq@1.17.1: - resolution: {integrity: sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==} - - figures@6.1.0: - resolution: {integrity: sha512-d+l3qxjSesT4V7v2fh+QnmFnUWv9lSpjarhShNTgBOfA0ttejbQUAlHLitbjkoRiDulW0OPoQPYIGhIC8ohejg==} - engines: {node: '>=18'} - - file-uri-to-path@1.0.0: - resolution: {integrity: sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==} - - fill-range@7.1.1: - resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==} - engines: {node: '>=8'} - - find-up-simple@1.0.0: - resolution: {integrity: sha512-q7Us7kcjj2VMePAa02hDAF6d+MzsdsAWEwYyOpwUtlerRBkOEPBCRZrAV4XfcSN8fHAgaD0hP7miwoay6DCprw==} - engines: {node: '>=18'} - - follow-redirects@1.15.6: - resolution: {integrity: sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==} - engines: {node: '>=4.0'} - peerDependencies: - debug: '*' - peerDependenciesMeta: - debug: - optional: true - - form-data@4.0.0: - resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==} - engines: {node: '>= 6'} - - fs-minipass@2.1.0: - resolution: {integrity: sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==} - engines: {node: '>= 8'} - - fs.realpath@1.0.0: - resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} - - gauge@3.0.2: - resolution: {integrity: sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q==} - engines: {node: '>=10'} - deprecated: This package is no longer supported. - - get-caller-file@2.0.5: - resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} - engines: {node: 6.* || 8.* || >= 10.*} - - get-east-asian-width@1.2.0: - resolution: {integrity: sha512-2nk+7SIVb14QrgXFHcm84tD4bKQz0RxPuMT8Ag5KPOq7J5fEmAg0UbXdTOSHqNuHSU28k55qnceesxXRZGzKWA==} - engines: {node: '>=18'} - - glob-parent@5.1.2: - resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} - engines: {node: '>= 6'} - - glob@7.2.3: - resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} - deprecated: Glob versions prior to v9 are no longer supported - - globby@14.0.2: - resolution: {integrity: sha512-s3Fq41ZVh7vbbe2PN3nrW7yC7U7MFVc5c98/iTl9c2GawNMKx/J648KQRW6WKkuU8GIbbh2IXfIRQjOZnXcTnw==} - engines: {node: '>=18'} - - graceful-fs@4.2.11: - resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} - - has-unicode@2.0.1: - resolution: {integrity: sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==} - - https-proxy-agent@5.0.1: - resolution: {integrity: sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==} - engines: {node: '>= 6'} - - iconv-lite@0.4.24: - resolution: {integrity: sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==} - engines: {node: '>=0.10.0'} - - ignore-by-default@2.1.0: - resolution: {integrity: sha512-yiWd4GVmJp0Q6ghmM2B/V3oZGRmjrKLXvHR3TE1nfoXsmoggllfZUQe74EN0fJdPFZu2NIvNdrMMLm3OsV7Ohw==} - engines: {node: '>=10 <11 || >=12 <13 || >=14'} - - ignore@5.3.1: - resolution: {integrity: sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==} - engines: {node: '>= 4'} - - imurmurhash@0.1.4: - resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} - engines: {node: '>=0.8.19'} - - indent-string@5.0.0: - resolution: {integrity: sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==} - engines: {node: '>=12'} - - inflight@1.0.6: - resolution: {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. - - inherits@2.0.4: - resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} - - inquirer@10.0.1: - resolution: {integrity: sha512-XgthhRIn0Ci9JdGJpUo2EtpPfaczbooZbGTN+FTzSCyUb7YHJcPPnuSXfeG5903bJMy3OyEoVTQMnvO4Ly5tFg==} - engines: {node: '>=18'} - - ipaddr.js@2.2.0: - resolution: {integrity: sha512-Ag3wB2o37wslZS19hZqorUnrnzSkpOVy+IiiDEiTqNubEYpYuHWIf6K4psgN2ZWKExS4xhVCrRVfb/wfW8fWJA==} - engines: {node: '>= 10'} - - irregular-plurals@3.5.0: - resolution: {integrity: sha512-1ANGLZ+Nkv1ptFb2pa8oG8Lem4krflKuX/gINiHJHjJUKaJHk/SXk5x6K3J+39/p0h1RQ2saROclJJ+QLvETCQ==} - engines: {node: '>=8'} - - is-extglob@2.1.1: - resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} - engines: {node: '>=0.10.0'} - - is-fullwidth-code-point@3.0.0: - resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} - engines: {node: '>=8'} - - is-fullwidth-code-point@4.0.0: - resolution: {integrity: sha512-O4L094N2/dZ7xqVdrXhh9r1KODPJpFms8B5sGdJLPy664AgvXsreZUyCQQNItZRDlYug4xStLjNp/sz3HvBowQ==} - engines: {node: '>=12'} - - is-glob@4.0.3: - resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} - engines: {node: '>=0.10.0'} - - is-number@7.0.0: - resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} - engines: {node: '>=0.12.0'} - - is-plain-object@5.0.0: - resolution: {integrity: sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==} - engines: {node: '>=0.10.0'} - - is-promise@4.0.0: - resolution: {integrity: sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==} - - is-unicode-supported@2.0.0: - resolution: {integrity: sha512-FRdAyx5lusK1iHG0TWpVtk9+1i+GjrzRffhDg4ovQ7mcidMQ6mj+MhKPmvh7Xwyv5gIS06ns49CA7Sqg7lC22Q==} - engines: {node: '>=18'} - - js-string-escape@1.0.1: - resolution: {integrity: sha512-Smw4xcfIQ5LVjAOuJCvN/zIodzA/BBSsluuoSykP+lUvScIi4U6RJLfwHet5cxFnCswUjISV8oAXaqaJDY3chg==} - engines: {node: '>= 0.8'} - - js-tokens@4.0.0: - resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} - - js-yaml@3.14.1: - resolution: {integrity: sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==} - hasBin: true - - js-yaml@4.1.0: - resolution: {integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==} - hasBin: true - - load-json-file@7.0.1: - resolution: {integrity: sha512-Gnxj3ev3mB5TkVBGad0JM6dmLiQL+o0t23JPBZ9sd+yvSLk05mFoqKBw5N8gbbkU4TNXyqCgIrl/VM17OgUIgQ==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - lodash-es@4.17.21: - resolution: {integrity: sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==} - - lodash@4.17.21: - resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} - - loose-envify@1.4.0: - resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==} - hasBin: true - - make-dir@3.1.0: - resolution: {integrity: sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==} - engines: {node: '>=8'} - - matcher@5.0.0: - resolution: {integrity: sha512-s2EMBOWtXFc8dgqvoAzKJXxNHibcdJMV0gwqKUaw9E2JBJuGUK7DrNKrA6g/i+v72TT16+6sVm5mS3thaMLQUw==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - md5-hex@3.0.1: - resolution: {integrity: sha512-BUiRtTtV39LIJwinWBjqVsU9xhdnz7/i889V859IBFpuqGAj6LuOvHv5XLbgZ2R7ptJoJaEcxkv88/h25T7Ciw==} - engines: {node: '>=8'} - - memoize@10.0.0: - resolution: {integrity: sha512-H6cBLgsi6vMWOcCpvVCdFFnl3kerEXbrYh9q+lY6VXvQSmM6CkmV08VOwT+WE2tzIEqRPFfAq3fm4v/UIW6mSA==} - engines: {node: '>=18'} - - merge2@1.4.1: - resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} - engines: {node: '>= 8'} - - micromatch@4.0.7: - resolution: {integrity: sha512-LPP/3KorzCwBxfeUuZmaR6bG2kdeHSbe0P2tY3FLRU4vYrjYz5hI4QZwV0njUx3jeuKe67YukQ1LSPZBKDqO/Q==} - engines: {node: '>=8.6'} - - mime-db@1.52.0: - resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} - engines: {node: '>= 0.6'} - - mime-types@2.1.35: - resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} - engines: {node: '>= 0.6'} - - mimic-function@5.0.1: - resolution: {integrity: sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==} - engines: {node: '>=18'} - - minimatch@3.1.2: - resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} - - minipass@3.3.6: - resolution: {integrity: sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==} - engines: {node: '>=8'} - - minipass@5.0.0: - resolution: {integrity: sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==} - engines: {node: '>=8'} - - minizlib@2.1.2: - resolution: {integrity: sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==} - engines: {node: '>= 8'} - - mkdirp@1.0.4: - resolution: {integrity: sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==} - engines: {node: '>=10'} - hasBin: true - - ms@2.1.2: - resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} - - ms@2.1.3: - resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} - - mute-stream@1.0.0: - resolution: {integrity: sha512-avsJQhyd+680gKXyG/sQc0nXaC6rBkPOfyHYcFb9+hdkqQkR9bdnkJ0AMZhke0oesPqIO+mFFJ+IdBc7mst4IA==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - - nanoid@3.3.7: - resolution: {integrity: sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==} - engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} - hasBin: true - - node-fetch@2.7.0: - resolution: {integrity: sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==} - engines: {node: 4.x || >=6.0.0} - peerDependencies: - encoding: ^0.1.0 - peerDependenciesMeta: - encoding: - optional: true - - node-gyp-build@4.8.1: - resolution: {integrity: sha512-OSs33Z9yWr148JZcbZd5WiAXhh/n9z8TxQcdMhIOlpN9AhWpLfvVFO73+m77bBABQMaY9XSvIa+qk0jlI7Gcaw==} - hasBin: true - - nofilter@3.1.0: - resolution: {integrity: sha512-l2NNj07e9afPnhAhvgVrCD/oy2Ai1yfLpuo3EpiO1jFTsB4sFz6oIfAfSZyQzVpkZQ9xS8ZS5g1jCBgq4Hwo0g==} - engines: {node: '>=12.19'} - - nopt@5.0.0: - resolution: {integrity: sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==} - engines: {node: '>=6'} - hasBin: true - - npmlog@5.0.1: - resolution: {integrity: sha512-AqZtDUWOMKs1G/8lwylVjrdYgqA4d9nu8hc+0gzRxlDb1I10+FHBGMXs6aiQHFdCUUlqH99MUMuLfzWDNDtfxw==} - deprecated: This package is no longer supported. - - object-assign@4.1.1: - resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} - engines: {node: '>=0.10.0'} - - once@1.4.0: - resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} - - os-tmpdir@1.0.2: - resolution: {integrity: sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==} - engines: {node: '>=0.10.0'} - - p-map@7.0.2: - resolution: {integrity: sha512-z4cYYMMdKHzw4O5UkWJImbZynVIo0lSGTXc7bzB1e/rrDqkgGUNysK/o4bTr+0+xKvvLoTyGqYC4Fgljy9qe1Q==} - engines: {node: '>=18'} - - package-config@5.0.0: - resolution: {integrity: sha512-GYTTew2slBcYdvRHqjhwaaydVMvn/qrGC323+nKclYioNSLTDUM/lGgtGTgyHVtYcozb+XkE8CNhwcraOmZ9Mg==} - engines: {node: '>=18'} - - parse-ms@4.0.0: - resolution: {integrity: sha512-TXfryirbmq34y8QBwgqCVLi+8oA3oWx2eAnSn62ITyEhEYaWRlVZ2DvMM9eZbMs/RfxPu/PK/aBLyGj4IrqMHw==} - engines: {node: '>=18'} - - path-is-absolute@1.0.1: - resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==} - engines: {node: '>=0.10.0'} - - path-type@5.0.0: - resolution: {integrity: sha512-5HviZNaZcfqP95rwpv+1HDgUamezbqdSYTyzjTvwtJSnIH+3vnbmWsItli8OFEndS984VT55M3jduxZbX351gg==} - engines: {node: '>=12'} - - picocolors@1.0.1: - resolution: {integrity: sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==} - - picomatch@2.3.1: - resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} - engines: {node: '>=8.6'} - - picomatch@3.0.1: - resolution: {integrity: sha512-I3EurrIQMlRc9IaAZnqRR044Phh2DXY+55o7uJ0V+hYZAcQYSuFWsc9q5PvyDHUSCe1Qxn/iBz+78s86zWnGag==} - engines: {node: '>=10'} - - plur@5.1.0: - resolution: {integrity: sha512-VP/72JeXqak2KiOzjgKtQen5y3IZHn+9GOuLDafPv0eXa47xq0At93XahYBs26MsifCQ4enGKwbjBTKgb9QJXg==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - postcss-value-parser@4.2.0: - resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==} - - postcss@8.4.33: - resolution: {integrity: sha512-Kkpbhhdjw2qQs2O2DGX+8m5OVqEcbB9HRBvuYM9pgrjEFUg30A9LmXNlTAUj4S9kgtGyrMbTzVjH7E+s5Re2yg==} - engines: {node: ^10 || ^12 || >=14} - - pretty-ms@9.0.0: - resolution: {integrity: sha512-E9e9HJ9R9NasGOgPaPE8VMeiPKAyWR5jcFpNnwIejslIhWqdqOrb2wShBsncMPUb+BcCd2OPYfh7p2W6oemTng==} - engines: {node: '>=18'} - - proxy-from-env@1.1.0: - resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==} - - queue-microtask@1.2.3: - resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} - - react-dom@18.3.1: - resolution: {integrity: sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==} - peerDependencies: - react: ^18.3.1 - - react@18.3.1: - resolution: {integrity: sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==} - engines: {node: '>=0.10.0'} - - readable-stream@3.6.2: - resolution: {integrity: sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==} - engines: {node: '>= 6'} - - require-directory@2.1.1: - resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} - engines: {node: '>=0.10.0'} - - resolve-cwd@3.0.0: - resolution: {integrity: sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==} - engines: {node: '>=8'} - - resolve-from@5.0.0: - resolution: {integrity: sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==} - engines: {node: '>=8'} - - reusify@1.0.4: - resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==} - engines: {iojs: '>=1.0.0', node: '>=0.10.0'} - - rimraf@3.0.2: - resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==} - deprecated: Rimraf versions prior to v4 are no longer supported - hasBin: true - - run-async@3.0.0: - resolution: {integrity: sha512-540WwVDOMxA6dN6We19EcT9sc3hkXPw5mzRNGM3FkdN/vtE9NFvj5lFAPNwUDmJjXidm3v7TC1cTE7t17Ulm1Q==} - engines: {node: '>=0.12.0'} - - run-parallel@1.2.0: - resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} - - rxjs@7.8.1: - resolution: {integrity: sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==} - - safe-buffer@5.2.1: - resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} - - safer-buffer@2.1.2: - resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} - - scheduler@0.23.2: - resolution: {integrity: sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ==} - - semver@6.3.1: - resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} - hasBin: true - - semver@7.6.2: - resolution: {integrity: sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==} - engines: {node: '>=10'} - hasBin: true - - serialize-error@7.0.1: - resolution: {integrity: sha512-8I8TjW5KMOKsZQTvoxjuSIa7foAwPWGOts+6o7sgjz41/qMD9VQHEDxi6PBvK2l0MXUmqZyNpUK+T2tQaaElvw==} - engines: {node: '>=10'} - - set-blocking@2.0.0: - resolution: {integrity: sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==} - - shallowequal@1.1.0: - resolution: {integrity: sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ==} - - signal-exit@3.0.7: - resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} - - signal-exit@4.1.0: - resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} - engines: {node: '>=14'} - - slash@5.1.0: - resolution: {integrity: sha512-ZA6oR3T/pEyuqwMgAKT0/hAv8oAXckzbkmR0UkUosQ+Mc4RxGoJkRmwHgHufaenlyAgE1Mxgpdcrf75y6XcnDg==} - engines: {node: '>=14.16'} - - slice-ansi@5.0.0: - resolution: {integrity: sha512-FC+lgizVPfie0kkhqUScwRu1O/lF6NOgJmlCgK+/LYxDCTk8sGelYaHDhFcDN+Sn3Cv+3VSa4Byeo+IMCzpMgQ==} - engines: {node: '>=12'} - - source-map-js@1.2.0: - resolution: {integrity: sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==} - engines: {node: '>=0.10.0'} - - sprintf-js@1.0.3: - resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==} - - stack-utils@2.0.6: - resolution: {integrity: sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==} - engines: {node: '>=10'} - - string-width@4.2.3: - resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} - engines: {node: '>=8'} - - string-width@7.2.0: - resolution: {integrity: sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==} - engines: {node: '>=18'} - - string_decoder@1.3.0: - resolution: {integrity: sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==} - - strip-ansi@6.0.1: - resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} - engines: {node: '>=8'} - - strip-ansi@7.1.0: - resolution: {integrity: sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==} - engines: {node: '>=12'} - - styled-components@6.1.1: - resolution: {integrity: sha512-cpZZP5RrKRIClBW5Eby4JM1wElLVP4NQrJbJ0h10TidTyJf4SIIwa3zLXOoPb4gJi8MsJ8mjq5mu2IrEhZIAcQ==} - engines: {node: '>= 16'} - peerDependencies: - react: '>= 16.8.0' - react-dom: '>= 16.8.0' - - stylis@4.3.2: - resolution: {integrity: sha512-bhtUjWd/z6ltJiQwg0dUfxEJ+W+jdqQd8TbWLWyeIJHlnsqmGLRFFd8e5mA0AZi/zx90smXRlN66YMTcaSFifg==} - - supertap@3.0.1: - resolution: {integrity: sha512-u1ZpIBCawJnO+0QePsEiOknOfCRq0yERxiAchT0i4li0WHNUJbf0evXXSXOcCAR4M8iMDoajXYmstm/qO81Isw==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - tar@6.2.1: - resolution: {integrity: sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==} - engines: {node: '>=10'} - - temp-dir@3.0.0: - resolution: {integrity: sha512-nHc6S/bwIilKHNRgK/3jlhDoIHcp45YgyiwcAk46Tr0LfEqGBVpmiAyuiuxeVE44m3mXnEeVhaipLOEWmH+Njw==} - engines: {node: '>=14.16'} - - time-zone@1.0.0: - resolution: {integrity: sha512-TIsDdtKo6+XrPtiTm1ssmMngN1sAhyKnTO2kunQWqNPWIVvCm15Wmw4SWInwTVgJ5u/Tr04+8Ei9TNcw4x4ONA==} - engines: {node: '>=4'} - - tmp@0.0.33: - resolution: {integrity: sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==} - engines: {node: '>=0.6.0'} - - to-regex-range@5.0.1: - resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} - engines: {node: '>=8.0'} - - toml@3.0.0: - resolution: {integrity: sha512-y/mWCZinnvxjTKYhJ+pYxwD0mRLVvOtdS2Awbgxln6iEnt4rk0yBxeSBHkGJcPucRiG0e55mwWp+g/05rsrd6w==} - - tr46@0.0.3: - resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==} - - tslib@2.6.3: - resolution: {integrity: sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ==} - - typanion@3.14.0: - resolution: {integrity: sha512-ZW/lVMRabETuYCd9O9ZvMhAh8GslSqaUjxmK/JLPCh6l73CvLBiuXswj/+7LdnWOgYsQ130FqLzFz5aGT4I3Ug==} - - type-fest@0.13.1: - resolution: {integrity: sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==} - engines: {node: '>=10'} - - type-fest@0.21.3: - resolution: {integrity: sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==} - engines: {node: '>=10'} - - typescript@5.5.4: - resolution: {integrity: sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q==} - engines: {node: '>=14.17'} - hasBin: true - - undici-types@6.19.8: - resolution: {integrity: sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==} - - unicorn-magic@0.1.0: - resolution: {integrity: sha512-lRfVq8fE8gz6QMBuDM6a+LO3IAzTi05H6gCVaUpir2E1Rwpo4ZUog45KpNXKC/Mn3Yb9UDuHumeFTo9iV/D9FQ==} - engines: {node: '>=18'} - - universal-user-agent@7.0.2: - resolution: {integrity: sha512-0JCqzSKnStlRRQfCdowvqy3cy0Dvtlb8xecj/H8JFZuCze4rwjPZQOgvFvn0Ws/usCHQFGpyr+pB9adaGwXn4Q==} - - util-deprecate@1.0.2: - resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} - - wasm-sjlj@1.0.5: - resolution: {integrity: sha512-Z/MHJeOkAvJJVWnGX3/YZGYldGaawZbYHX4ldYG9kLhcdB8H31F5x66M7Zc4BP/7pg0aLsusQj1629m2B3Rilg==} - - webidl-conversions@3.0.1: - resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==} - - well-known-symbols@2.0.0: - resolution: {integrity: sha512-ZMjC3ho+KXo0BfJb7JgtQ5IBuvnShdlACNkKkdsqBmYw3bPAaJfPeYUo6tLUaT5tG/Gkh7xkpBhKRQ9e7pyg9Q==} - engines: {node: '>=6'} - - whatwg-url@5.0.0: - resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==} - - wide-align@1.1.5: - resolution: {integrity: sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==} - - wrap-ansi@6.2.0: - resolution: {integrity: sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==} - engines: {node: '>=8'} - - wrap-ansi@7.0.0: - resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==} - engines: {node: '>=10'} - - wrappy@1.0.2: - resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} - - write-file-atomic@5.0.1: - resolution: {integrity: sha512-+QU2zd6OTD8XWIJCbffaiQeH9U73qIqafo1x6V1snCWYGJf6cVE0cDR4D8xRzcEnfI21IFrUPzPGtcPf8AC+Rw==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - - y18n@5.0.8: - resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==} - engines: {node: '>=10'} - - yallist@4.0.0: - resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==} - - yargs-parser@21.1.1: - resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} - engines: {node: '>=12'} - - yargs@17.7.2: - resolution: {integrity: sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==} - engines: {node: '>=12'} - - yoctocolors-cjs@2.1.2: - resolution: {integrity: sha512-cYVsTjKl8b+FrnidjibDWskAv7UKOfcwaVZdp/it9n1s9fU3IkgDbhdIRKCW4JDsAlECJY0ytoVPT3sK6kideA==} - engines: {node: '>=18'} - -snapshots: - - '@emnapi/core@1.2.0': - dependencies: - '@emnapi/wasi-threads': 1.0.1 - tslib: 2.6.3 - - '@emnapi/runtime@1.2.0': - dependencies: - tslib: 2.6.3 - - '@emnapi/wasi-threads@1.0.1': - dependencies: - tslib: 2.6.3 - - '@emotion/is-prop-valid@1.2.2': - dependencies: - '@emotion/memoize': 0.8.1 - - '@emotion/memoize@0.8.1': {} - - '@emotion/unitless@0.8.1': {} - - '@inquirer/checkbox@2.3.10': - dependencies: - '@inquirer/core': 9.0.2 - '@inquirer/figures': 1.0.3 - '@inquirer/type': 1.4.0 - ansi-escapes: 4.3.2 - yoctocolors-cjs: 2.1.2 - - '@inquirer/confirm@3.1.14': - dependencies: - '@inquirer/core': 9.0.2 - '@inquirer/type': 1.4.0 - - '@inquirer/core@9.0.2': - dependencies: - '@inquirer/figures': 1.0.3 - '@inquirer/type': 1.4.0 - '@types/mute-stream': 0.0.4 - '@types/node': 20.16.5 - '@types/wrap-ansi': 3.0.0 - ansi-escapes: 4.3.2 - cli-spinners: 2.9.2 - cli-width: 4.1.0 - mute-stream: 1.0.0 - signal-exit: 4.1.0 - strip-ansi: 6.0.1 - wrap-ansi: 6.2.0 - yoctocolors-cjs: 2.1.2 - - '@inquirer/editor@2.1.14': - dependencies: - '@inquirer/core': 9.0.2 - '@inquirer/type': 1.4.0 - external-editor: 3.1.0 - - '@inquirer/expand@2.1.14': - dependencies: - '@inquirer/core': 9.0.2 - '@inquirer/type': 1.4.0 - yoctocolors-cjs: 2.1.2 - - '@inquirer/figures@1.0.3': {} - - '@inquirer/input@2.2.1': - dependencies: - '@inquirer/core': 9.0.2 - '@inquirer/type': 1.4.0 - - '@inquirer/number@1.0.2': - dependencies: - '@inquirer/core': 9.0.2 - '@inquirer/type': 1.4.0 - - '@inquirer/password@2.1.14': - dependencies: - '@inquirer/core': 9.0.2 - '@inquirer/type': 1.4.0 - ansi-escapes: 4.3.2 - - '@inquirer/prompts@5.1.2': - dependencies: - '@inquirer/checkbox': 2.3.10 - '@inquirer/confirm': 3.1.14 - '@inquirer/editor': 2.1.14 - '@inquirer/expand': 2.1.14 - '@inquirer/input': 2.2.1 - '@inquirer/number': 1.0.2 - '@inquirer/password': 2.1.14 - '@inquirer/rawlist': 2.1.14 - '@inquirer/select': 2.3.10 - - '@inquirer/rawlist@2.1.14': - dependencies: - '@inquirer/core': 9.0.2 - '@inquirer/type': 1.4.0 - yoctocolors-cjs: 2.1.2 - - '@inquirer/select@2.3.10': - dependencies: - '@inquirer/core': 9.0.2 - '@inquirer/figures': 1.0.3 - '@inquirer/type': 1.4.0 - ansi-escapes: 4.3.2 - yoctocolors-cjs: 2.1.2 - - '@inquirer/type@1.4.0': - dependencies: - mute-stream: 1.0.0 - - '@mapbox/node-pre-gyp@1.0.11': - dependencies: - detect-libc: 2.0.3 - https-proxy-agent: 5.0.1 - make-dir: 3.1.0 - node-fetch: 2.7.0 - nopt: 5.0.0 - npmlog: 5.0.1 - rimraf: 3.0.2 - semver: 7.6.2 - tar: 6.2.1 - transitivePeerDependencies: - - encoding - - supports-color - - '@napi-rs/cli@3.0.0-alpha.62(@emnapi/runtime@1.2.0)(emnapi@1.2.0)': - dependencies: - '@napi-rs/cross-toolchain': 0.0.16 - '@napi-rs/wasm-tools': 0.0.2 - '@octokit/rest': 21.0.0 - clipanion: 3.2.1(typanion@3.14.0) - colorette: 2.0.20 - debug: 4.3.5 - inquirer: 10.0.1 - js-yaml: 4.1.0 - lodash-es: 4.17.21 - semver: 7.6.2 - toml: 3.0.0 - typanion: 3.14.0 - wasm-sjlj: 1.0.5 - optionalDependencies: - '@emnapi/runtime': 1.2.0 - emnapi: 1.2.0 - transitivePeerDependencies: - - '@napi-rs/cross-toolchain-arm64-target-aarch64' - - '@napi-rs/cross-toolchain-arm64-target-armv7' - - '@napi-rs/cross-toolchain-arm64-target-x86_64' - - '@napi-rs/cross-toolchain-x64-target-aarch64' - - '@napi-rs/cross-toolchain-x64-target-armv7' - - '@napi-rs/cross-toolchain-x64-target-x86_64' - - supports-color - - '@napi-rs/cross-toolchain@0.0.16': - dependencies: - '@napi-rs/lzma': 1.3.1 - '@napi-rs/tar': 0.1.1 - debug: 4.3.5 - transitivePeerDependencies: - - supports-color - - '@napi-rs/lzma-android-arm-eabi@1.3.1': - optional: true - - '@napi-rs/lzma-android-arm64@1.3.1': - optional: true - - '@napi-rs/lzma-darwin-arm64@1.3.1': - optional: true - - '@napi-rs/lzma-darwin-x64@1.3.1': - optional: true - - '@napi-rs/lzma-freebsd-x64@1.3.1': - optional: true - - '@napi-rs/lzma-linux-arm-gnueabihf@1.3.1': - optional: true - - '@napi-rs/lzma-linux-arm64-gnu@1.3.1': - optional: true - - '@napi-rs/lzma-linux-arm64-musl@1.3.1': - optional: true - - '@napi-rs/lzma-linux-x64-gnu@1.3.1': - optional: true - - '@napi-rs/lzma-linux-x64-musl@1.3.1': - optional: true - - '@napi-rs/lzma-wasm32-wasi@1.3.1': - dependencies: - '@napi-rs/wasm-runtime': 0.2.4 - optional: true - - '@napi-rs/lzma-win32-arm64-msvc@1.3.1': - optional: true - - '@napi-rs/lzma-win32-ia32-msvc@1.3.1': - optional: true - - '@napi-rs/lzma-win32-x64-msvc@1.3.1': - optional: true - - '@napi-rs/lzma@1.3.1': - optionalDependencies: - '@napi-rs/lzma-android-arm-eabi': 1.3.1 - '@napi-rs/lzma-android-arm64': 1.3.1 - '@napi-rs/lzma-darwin-arm64': 1.3.1 - '@napi-rs/lzma-darwin-x64': 1.3.1 - '@napi-rs/lzma-freebsd-x64': 1.3.1 - '@napi-rs/lzma-linux-arm-gnueabihf': 1.3.1 - '@napi-rs/lzma-linux-arm64-gnu': 1.3.1 - '@napi-rs/lzma-linux-arm64-musl': 1.3.1 - '@napi-rs/lzma-linux-x64-gnu': 1.3.1 - '@napi-rs/lzma-linux-x64-musl': 1.3.1 - '@napi-rs/lzma-wasm32-wasi': 1.3.1 - '@napi-rs/lzma-win32-arm64-msvc': 1.3.1 - '@napi-rs/lzma-win32-ia32-msvc': 1.3.1 - '@napi-rs/lzma-win32-x64-msvc': 1.3.1 - - '@napi-rs/tar-android-arm-eabi@0.1.1': - optional: true - - '@napi-rs/tar-android-arm64@0.1.1': - optional: true - - '@napi-rs/tar-darwin-arm64@0.1.1': - optional: true - - '@napi-rs/tar-darwin-x64@0.1.1': - optional: true - - '@napi-rs/tar-freebsd-x64@0.1.1': - optional: true - - '@napi-rs/tar-linux-arm-gnueabihf@0.1.1': - optional: true - - '@napi-rs/tar-linux-arm64-gnu@0.1.1': - optional: true - - '@napi-rs/tar-linux-arm64-musl@0.1.1': - optional: true - - '@napi-rs/tar-linux-x64-gnu@0.1.1': - optional: true - - '@napi-rs/tar-linux-x64-musl@0.1.1': - optional: true - - '@napi-rs/tar-wasm32-wasi@0.1.1': - dependencies: - '@napi-rs/wasm-runtime': 0.2.4 - optional: true - - '@napi-rs/tar-win32-arm64-msvc@0.1.1': - optional: true - - '@napi-rs/tar-win32-ia32-msvc@0.1.1': - optional: true - - '@napi-rs/tar-win32-x64-msvc@0.1.1': - optional: true - - '@napi-rs/tar@0.1.1': - optionalDependencies: - '@napi-rs/tar-android-arm-eabi': 0.1.1 - '@napi-rs/tar-android-arm64': 0.1.1 - '@napi-rs/tar-darwin-arm64': 0.1.1 - '@napi-rs/tar-darwin-x64': 0.1.1 - '@napi-rs/tar-freebsd-x64': 0.1.1 - '@napi-rs/tar-linux-arm-gnueabihf': 0.1.1 - '@napi-rs/tar-linux-arm64-gnu': 0.1.1 - '@napi-rs/tar-linux-arm64-musl': 0.1.1 - '@napi-rs/tar-linux-x64-gnu': 0.1.1 - '@napi-rs/tar-linux-x64-musl': 0.1.1 - '@napi-rs/tar-wasm32-wasi': 0.1.1 - '@napi-rs/tar-win32-arm64-msvc': 0.1.1 - '@napi-rs/tar-win32-ia32-msvc': 0.1.1 - '@napi-rs/tar-win32-x64-msvc': 0.1.1 - - '@napi-rs/wasm-runtime@0.2.4': - dependencies: - '@emnapi/core': 1.2.0 - '@emnapi/runtime': 1.2.0 - '@tybys/wasm-util': 0.9.0 - - '@napi-rs/wasm-tools-android-arm-eabi@0.0.2': - optional: true - - '@napi-rs/wasm-tools-android-arm64@0.0.2': - optional: true - - '@napi-rs/wasm-tools-darwin-arm64@0.0.2': - optional: true - - '@napi-rs/wasm-tools-darwin-x64@0.0.2': - optional: true - - '@napi-rs/wasm-tools-freebsd-x64@0.0.2': - optional: true - - '@napi-rs/wasm-tools-linux-arm64-gnu@0.0.2': - optional: true - - '@napi-rs/wasm-tools-linux-arm64-musl@0.0.2': - optional: true - - '@napi-rs/wasm-tools-linux-x64-gnu@0.0.2': - optional: true - - '@napi-rs/wasm-tools-linux-x64-musl@0.0.2': - optional: true - - '@napi-rs/wasm-tools-wasm32-wasi@0.0.2': - dependencies: - '@napi-rs/wasm-runtime': 0.2.4 - optional: true - - '@napi-rs/wasm-tools-win32-arm64-msvc@0.0.2': - optional: true - - '@napi-rs/wasm-tools-win32-ia32-msvc@0.0.2': - optional: true - - '@napi-rs/wasm-tools-win32-x64-msvc@0.0.2': - optional: true - - '@napi-rs/wasm-tools@0.0.2': - optionalDependencies: - '@napi-rs/wasm-tools-android-arm-eabi': 0.0.2 - '@napi-rs/wasm-tools-android-arm64': 0.0.2 - '@napi-rs/wasm-tools-darwin-arm64': 0.0.2 - '@napi-rs/wasm-tools-darwin-x64': 0.0.2 - '@napi-rs/wasm-tools-freebsd-x64': 0.0.2 - '@napi-rs/wasm-tools-linux-arm64-gnu': 0.0.2 - '@napi-rs/wasm-tools-linux-arm64-musl': 0.0.2 - '@napi-rs/wasm-tools-linux-x64-gnu': 0.0.2 - '@napi-rs/wasm-tools-linux-x64-musl': 0.0.2 - '@napi-rs/wasm-tools-wasm32-wasi': 0.0.2 - '@napi-rs/wasm-tools-win32-arm64-msvc': 0.0.2 - '@napi-rs/wasm-tools-win32-ia32-msvc': 0.0.2 - '@napi-rs/wasm-tools-win32-x64-msvc': 0.0.2 - - '@nodelib/fs.scandir@2.1.5': - dependencies: - '@nodelib/fs.stat': 2.0.5 - run-parallel: 1.2.0 - - '@nodelib/fs.stat@2.0.5': {} - - '@nodelib/fs.walk@1.2.8': - dependencies: - '@nodelib/fs.scandir': 2.1.5 - fastq: 1.17.1 - - '@octokit/auth-token@5.1.1': {} - - '@octokit/core@6.1.2': - dependencies: - '@octokit/auth-token': 5.1.1 - '@octokit/graphql': 8.1.1 - '@octokit/request': 9.1.1 - '@octokit/request-error': 6.1.2 - '@octokit/types': 13.5.0 - before-after-hook: 3.0.2 - universal-user-agent: 7.0.2 - - '@octokit/endpoint@10.1.1': - dependencies: - '@octokit/types': 13.5.0 - universal-user-agent: 7.0.2 - - '@octokit/graphql@8.1.1': - dependencies: - '@octokit/request': 9.1.1 - '@octokit/types': 13.5.0 - universal-user-agent: 7.0.2 - - '@octokit/openapi-types@22.2.0': {} - - '@octokit/plugin-paginate-rest@11.3.3(@octokit/core@6.1.2)': - dependencies: - '@octokit/core': 6.1.2 - '@octokit/types': 13.5.0 - - '@octokit/plugin-request-log@5.3.0(@octokit/core@6.1.2)': - dependencies: - '@octokit/core': 6.1.2 - - '@octokit/plugin-rest-endpoint-methods@13.2.4(@octokit/core@6.1.2)': - dependencies: - '@octokit/core': 6.1.2 - '@octokit/types': 13.5.0 - - '@octokit/request-error@6.1.2': - dependencies: - '@octokit/types': 13.5.0 - - '@octokit/request@9.1.1': - dependencies: - '@octokit/endpoint': 10.1.1 - '@octokit/request-error': 6.1.2 - '@octokit/types': 13.5.0 - universal-user-agent: 7.0.2 - - '@octokit/rest@21.0.0': - dependencies: - '@octokit/core': 6.1.2 - '@octokit/plugin-paginate-rest': 11.3.3(@octokit/core@6.1.2) - '@octokit/plugin-request-log': 5.3.0(@octokit/core@6.1.2) - '@octokit/plugin-rest-endpoint-methods': 13.2.4(@octokit/core@6.1.2) - - '@octokit/types@13.5.0': - dependencies: - '@octokit/openapi-types': 22.2.0 - - '@rollup/pluginutils@4.2.1': - dependencies: - estree-walker: 2.0.2 - picomatch: 2.3.1 - - '@sindresorhus/merge-streams@2.3.0': {} - - '@tybys/wasm-util@0.9.0': - dependencies: - tslib: 2.6.3 - - '@types/mute-stream@0.0.4': - dependencies: - '@types/node': 22.5.4 - - '@types/node@20.16.5': - dependencies: - undici-types: 6.19.8 - - '@types/node@22.5.4': - dependencies: - undici-types: 6.19.8 - - '@types/stylis@4.2.6': {} - - '@types/wrap-ansi@3.0.0': {} - - '@vercel/nft@0.26.5': - dependencies: - '@mapbox/node-pre-gyp': 1.0.11 - '@rollup/pluginutils': 4.2.1 - acorn: 8.12.1 - acorn-import-attributes: 1.9.5(acorn@8.12.1) - async-sema: 3.1.1 - bindings: 1.5.0 - estree-walker: 2.0.2 - glob: 7.2.3 - graceful-fs: 4.2.11 - micromatch: 4.0.7 - node-gyp-build: 4.8.1 - resolve-from: 5.0.0 - transitivePeerDependencies: - - encoding - - supports-color - - abbrev@1.1.1: {} - - acorn-import-attributes@1.9.5(acorn@8.12.1): - dependencies: - acorn: 8.12.1 - - acorn-walk@8.3.3: - dependencies: - acorn: 8.12.1 - - acorn@8.12.1: {} - - agent-base@6.0.2: - dependencies: - debug: 4.3.5 - transitivePeerDependencies: - - supports-color - - ansi-escapes@4.3.2: - dependencies: - type-fest: 0.21.3 - - ansi-regex@5.0.1: {} - - ansi-regex@6.0.1: {} - - ansi-styles@4.3.0: - dependencies: - color-convert: 2.0.1 - - ansi-styles@6.2.1: {} - - aproba@2.0.0: {} - - are-we-there-yet@2.0.0: - dependencies: - delegates: 1.0.0 - readable-stream: 3.6.2 - - argparse@1.0.10: - dependencies: - sprintf-js: 1.0.3 - - argparse@2.0.1: {} - - array-find-index@1.0.2: {} - - arrgv@1.0.2: {} - - arrify@3.0.0: {} - - async-sema@3.1.1: {} - - asynckit@0.4.0: {} - - ava@6.1.3: - dependencies: - '@vercel/nft': 0.26.5 - acorn: 8.12.1 - acorn-walk: 8.3.3 - ansi-styles: 6.2.1 - arrgv: 1.0.2 - arrify: 3.0.0 - callsites: 4.2.0 - cbor: 9.0.2 - chalk: 5.3.0 - chunkd: 2.0.1 - ci-info: 4.0.0 - ci-parallel-vars: 1.0.1 - cli-truncate: 4.0.0 - code-excerpt: 4.0.0 - common-path-prefix: 3.0.0 - concordance: 5.0.4 - currently-unhandled: 0.4.1 - debug: 4.3.5 - emittery: 1.0.3 - figures: 6.1.0 - globby: 14.0.2 - ignore-by-default: 2.1.0 - indent-string: 5.0.0 - is-plain-object: 5.0.0 - is-promise: 4.0.0 - matcher: 5.0.0 - memoize: 10.0.0 - ms: 2.1.3 - p-map: 7.0.2 - package-config: 5.0.0 - picomatch: 3.0.1 - plur: 5.1.0 - pretty-ms: 9.0.0 - resolve-cwd: 3.0.0 - stack-utils: 2.0.6 - strip-ansi: 7.1.0 - supertap: 3.0.1 - temp-dir: 3.0.0 - write-file-atomic: 5.0.1 - yargs: 17.7.2 - transitivePeerDependencies: - - encoding - - supports-color - - axios@1.6.2: - dependencies: - follow-redirects: 1.15.6 - form-data: 4.0.0 - proxy-from-env: 1.1.0 - transitivePeerDependencies: - - debug - - balanced-match@1.0.2: {} - - before-after-hook@3.0.2: {} - - bindings@1.5.0: - dependencies: - file-uri-to-path: 1.0.0 - - blueimp-md5@2.19.0: {} - - brace-expansion@1.1.11: - dependencies: - balanced-match: 1.0.2 - concat-map: 0.0.1 - - braces@3.0.3: - dependencies: - fill-range: 7.1.1 - - callsites@4.2.0: {} - - camelize@1.0.1: {} - - cbor@9.0.2: - dependencies: - nofilter: 3.1.0 - - chalk@5.3.0: {} - - chardet@0.7.0: {} - - chownr@2.0.0: {} - - chunkd@2.0.1: {} - - ci-info@4.0.0: {} - - ci-parallel-vars@1.0.1: {} - - cli-spinners@2.9.2: {} - - cli-truncate@4.0.0: - dependencies: - slice-ansi: 5.0.0 - string-width: 7.2.0 - - cli-width@4.1.0: {} - - clipanion@3.2.1(typanion@3.14.0): - dependencies: - typanion: 3.14.0 - - cliui@8.0.1: - dependencies: - string-width: 4.2.3 - strip-ansi: 6.0.1 - wrap-ansi: 7.0.0 - - code-excerpt@4.0.0: - dependencies: - convert-to-spaces: 2.0.1 - - color-convert@2.0.1: - dependencies: - color-name: 1.1.4 - - color-name@1.1.4: {} - - color-support@1.1.3: {} - - colorette@2.0.20: {} - - combined-stream@1.0.8: - dependencies: - delayed-stream: 1.0.0 - - common-path-prefix@3.0.0: {} - - concat-map@0.0.1: {} - - concordance@5.0.4: - dependencies: - date-time: 3.1.0 - esutils: 2.0.3 - fast-diff: 1.3.0 - js-string-escape: 1.0.1 - lodash: 4.17.21 - md5-hex: 3.0.1 - semver: 7.6.2 - well-known-symbols: 2.0.0 - - console-control-strings@1.1.0: {} - - convert-to-spaces@2.0.1: {} - - css-color-keywords@1.0.0: {} - - css-to-react-native@3.2.0: - dependencies: - camelize: 1.0.1 - css-color-keywords: 1.0.0 - postcss-value-parser: 4.2.0 - - csstype@3.1.3: {} - - currently-unhandled@0.4.1: - dependencies: - array-find-index: 1.0.2 - - date-time@3.1.0: - dependencies: - time-zone: 1.0.0 - - debug@4.3.5: - dependencies: - ms: 2.1.2 - - delayed-stream@1.0.0: {} - - delegates@1.0.0: {} - - detect-libc@2.0.3: {} - - emittery@1.0.3: {} - - emnapi@1.2.0: {} - - emoji-regex@10.3.0: {} - - emoji-regex@8.0.0: {} - - escalade@3.1.2: {} - - escape-string-regexp@2.0.0: {} - - escape-string-regexp@5.0.0: {} - - esprima@4.0.1: {} - - estree-walker@2.0.2: {} - - esutils@2.0.3: {} - - external-editor@3.1.0: - dependencies: - chardet: 0.7.0 - iconv-lite: 0.4.24 - tmp: 0.0.33 - - fast-diff@1.3.0: {} - - fast-glob@3.3.2: - dependencies: - '@nodelib/fs.stat': 2.0.5 - '@nodelib/fs.walk': 1.2.8 - glob-parent: 5.1.2 - merge2: 1.4.1 - micromatch: 4.0.7 - - fastq@1.17.1: - dependencies: - reusify: 1.0.4 - - figures@6.1.0: - dependencies: - is-unicode-supported: 2.0.0 - - file-uri-to-path@1.0.0: {} - - fill-range@7.1.1: - dependencies: - to-regex-range: 5.0.1 - - find-up-simple@1.0.0: {} - - follow-redirects@1.15.6: {} - - form-data@4.0.0: - dependencies: - asynckit: 0.4.0 - combined-stream: 1.0.8 - mime-types: 2.1.35 - - fs-minipass@2.1.0: - dependencies: - minipass: 3.3.6 - - fs.realpath@1.0.0: {} - - gauge@3.0.2: - dependencies: - aproba: 2.0.0 - color-support: 1.1.3 - console-control-strings: 1.1.0 - has-unicode: 2.0.1 - object-assign: 4.1.1 - signal-exit: 3.0.7 - string-width: 4.2.3 - strip-ansi: 6.0.1 - wide-align: 1.1.5 - - get-caller-file@2.0.5: {} - - get-east-asian-width@1.2.0: {} - - glob-parent@5.1.2: - dependencies: - is-glob: 4.0.3 - - glob@7.2.3: - dependencies: - fs.realpath: 1.0.0 - inflight: 1.0.6 - inherits: 2.0.4 - minimatch: 3.1.2 - once: 1.4.0 - path-is-absolute: 1.0.1 - - globby@14.0.2: - dependencies: - '@sindresorhus/merge-streams': 2.3.0 - fast-glob: 3.3.2 - ignore: 5.3.1 - path-type: 5.0.0 - slash: 5.1.0 - unicorn-magic: 0.1.0 - - graceful-fs@4.2.11: {} - - has-unicode@2.0.1: {} - - https-proxy-agent@5.0.1: - dependencies: - agent-base: 6.0.2 - debug: 4.3.5 - transitivePeerDependencies: - - supports-color - - iconv-lite@0.4.24: - dependencies: - safer-buffer: 2.1.2 - - ignore-by-default@2.1.0: {} - - ignore@5.3.1: {} - - imurmurhash@0.1.4: {} - - indent-string@5.0.0: {} - - inflight@1.0.6: - dependencies: - once: 1.4.0 - wrappy: 1.0.2 - - inherits@2.0.4: {} - - inquirer@10.0.1: - dependencies: - '@inquirer/prompts': 5.1.2 - '@inquirer/type': 1.4.0 - '@types/mute-stream': 0.0.4 - ansi-escapes: 4.3.2 - mute-stream: 1.0.0 - run-async: 3.0.0 - rxjs: 7.8.1 - - ipaddr.js@2.2.0: {} - - irregular-plurals@3.5.0: {} - - is-extglob@2.1.1: {} - - is-fullwidth-code-point@3.0.0: {} - - is-fullwidth-code-point@4.0.0: {} - - is-glob@4.0.3: - dependencies: - is-extglob: 2.1.1 - - is-number@7.0.0: {} - - is-plain-object@5.0.0: {} - - is-promise@4.0.0: {} - - is-unicode-supported@2.0.0: {} - - js-string-escape@1.0.1: {} - - js-tokens@4.0.0: {} - - js-yaml@3.14.1: - dependencies: - argparse: 1.0.10 - esprima: 4.0.1 - - js-yaml@4.1.0: - dependencies: - argparse: 2.0.1 - - load-json-file@7.0.1: {} - - lodash-es@4.17.21: {} - - lodash@4.17.21: {} - - loose-envify@1.4.0: - dependencies: - js-tokens: 4.0.0 - - make-dir@3.1.0: - dependencies: - semver: 6.3.1 - - matcher@5.0.0: - dependencies: - escape-string-regexp: 5.0.0 - - md5-hex@3.0.1: - dependencies: - blueimp-md5: 2.19.0 - - memoize@10.0.0: - dependencies: - mimic-function: 5.0.1 - - merge2@1.4.1: {} - - micromatch@4.0.7: - dependencies: - braces: 3.0.3 - picomatch: 2.3.1 - - mime-db@1.52.0: {} - - mime-types@2.1.35: - dependencies: - mime-db: 1.52.0 - - mimic-function@5.0.1: {} - - minimatch@3.1.2: - dependencies: - brace-expansion: 1.1.11 - - minipass@3.3.6: - dependencies: - yallist: 4.0.0 - - minipass@5.0.0: {} - - minizlib@2.1.2: - dependencies: - minipass: 3.3.6 - yallist: 4.0.0 - - mkdirp@1.0.4: {} - - ms@2.1.2: {} - - ms@2.1.3: {} - - mute-stream@1.0.0: {} - - nanoid@3.3.7: {} - - node-fetch@2.7.0: - dependencies: - whatwg-url: 5.0.0 - - node-gyp-build@4.8.1: {} - - nofilter@3.1.0: {} - - nopt@5.0.0: - dependencies: - abbrev: 1.1.1 - - npmlog@5.0.1: - dependencies: - are-we-there-yet: 2.0.0 - console-control-strings: 1.1.0 - gauge: 3.0.2 - set-blocking: 2.0.0 - - object-assign@4.1.1: {} - - once@1.4.0: - dependencies: - wrappy: 1.0.2 - - os-tmpdir@1.0.2: {} - - p-map@7.0.2: {} - - package-config@5.0.0: - dependencies: - find-up-simple: 1.0.0 - load-json-file: 7.0.1 - - parse-ms@4.0.0: {} - - path-is-absolute@1.0.1: {} - - path-type@5.0.0: {} - - picocolors@1.0.1: {} - - picomatch@2.3.1: {} - - picomatch@3.0.1: {} - - plur@5.1.0: - dependencies: - irregular-plurals: 3.5.0 - - postcss-value-parser@4.2.0: {} - - postcss@8.4.33: - dependencies: - nanoid: 3.3.7 - picocolors: 1.0.1 - source-map-js: 1.2.0 - - pretty-ms@9.0.0: - dependencies: - parse-ms: 4.0.0 - - proxy-from-env@1.1.0: {} - - queue-microtask@1.2.3: {} - - react-dom@18.3.1(react@18.3.1): - dependencies: - loose-envify: 1.4.0 - react: 18.3.1 - scheduler: 0.23.2 - - react@18.3.1: - dependencies: - loose-envify: 1.4.0 - - readable-stream@3.6.2: - dependencies: - inherits: 2.0.4 - string_decoder: 1.3.0 - util-deprecate: 1.0.2 - - require-directory@2.1.1: {} - - resolve-cwd@3.0.0: - dependencies: - resolve-from: 5.0.0 - - resolve-from@5.0.0: {} - - reusify@1.0.4: {} - - rimraf@3.0.2: - dependencies: - glob: 7.2.3 - - run-async@3.0.0: {} - - run-parallel@1.2.0: - dependencies: - queue-microtask: 1.2.3 - - rxjs@7.8.1: - dependencies: - tslib: 2.6.3 - - safe-buffer@5.2.1: {} - - safer-buffer@2.1.2: {} - - scheduler@0.23.2: - dependencies: - loose-envify: 1.4.0 - - semver@6.3.1: {} - - semver@7.6.2: {} - - serialize-error@7.0.1: - dependencies: - type-fest: 0.13.1 - - set-blocking@2.0.0: {} - - shallowequal@1.1.0: {} - - signal-exit@3.0.7: {} - - signal-exit@4.1.0: {} - - slash@5.1.0: {} - - slice-ansi@5.0.0: - dependencies: - ansi-styles: 6.2.1 - is-fullwidth-code-point: 4.0.0 - - source-map-js@1.2.0: {} - - sprintf-js@1.0.3: {} - - stack-utils@2.0.6: - dependencies: - escape-string-regexp: 2.0.0 - - string-width@4.2.3: - dependencies: - emoji-regex: 8.0.0 - is-fullwidth-code-point: 3.0.0 - strip-ansi: 6.0.1 - - string-width@7.2.0: - dependencies: - emoji-regex: 10.3.0 - get-east-asian-width: 1.2.0 - strip-ansi: 7.1.0 - - string_decoder@1.3.0: - dependencies: - safe-buffer: 5.2.1 - - strip-ansi@6.0.1: - dependencies: - ansi-regex: 5.0.1 - - strip-ansi@7.1.0: - dependencies: - ansi-regex: 6.0.1 - - styled-components@6.1.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1): - dependencies: - '@emotion/is-prop-valid': 1.2.2 - '@emotion/unitless': 0.8.1 - '@types/stylis': 4.2.6 - css-to-react-native: 3.2.0 - csstype: 3.1.3 - postcss: 8.4.33 - react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) - shallowequal: 1.1.0 - stylis: 4.3.2 - tslib: 2.6.3 - - stylis@4.3.2: {} - - supertap@3.0.1: - dependencies: - indent-string: 5.0.0 - js-yaml: 3.14.1 - serialize-error: 7.0.1 - strip-ansi: 7.1.0 - - tar@6.2.1: - dependencies: - chownr: 2.0.0 - fs-minipass: 2.1.0 - minipass: 5.0.0 - minizlib: 2.1.2 - mkdirp: 1.0.4 - yallist: 4.0.0 - - temp-dir@3.0.0: {} - - time-zone@1.0.0: {} - - tmp@0.0.33: - dependencies: - os-tmpdir: 1.0.2 - - to-regex-range@5.0.1: - dependencies: - is-number: 7.0.0 - - toml@3.0.0: {} - - tr46@0.0.3: {} - - tslib@2.6.3: {} - - typanion@3.14.0: {} - - type-fest@0.13.1: {} - - type-fest@0.21.3: {} - - typescript@5.5.4: {} - - undici-types@6.19.8: {} - - unicorn-magic@0.1.0: {} - - universal-user-agent@7.0.2: {} - - util-deprecate@1.0.2: {} - - wasm-sjlj@1.0.5: {} - - webidl-conversions@3.0.1: {} - - well-known-symbols@2.0.0: {} - - whatwg-url@5.0.0: - dependencies: - tr46: 0.0.3 - webidl-conversions: 3.0.1 - - wide-align@1.1.5: - dependencies: - string-width: 4.2.3 - - wrap-ansi@6.2.0: - dependencies: - ansi-styles: 4.3.0 - string-width: 4.2.3 - strip-ansi: 6.0.1 - - wrap-ansi@7.0.0: - dependencies: - ansi-styles: 4.3.0 - string-width: 4.2.3 - strip-ansi: 6.0.1 - - wrappy@1.0.2: {} - - write-file-atomic@5.0.1: - dependencies: - imurmurhash: 0.1.4 - signal-exit: 4.1.0 - - y18n@5.0.8: {} - - yallist@4.0.0: {} - - yargs-parser@21.1.1: {} - - yargs@17.7.2: - dependencies: - cliui: 8.0.1 - escalade: 3.1.2 - get-caller-file: 2.0.5 - require-directory: 2.1.1 - string-width: 4.2.3 - y18n: 5.0.8 - yargs-parser: 21.1.1 - - yoctocolors-cjs@2.1.2: {} diff --git a/src/builtins.rs b/src/builtins.rs deleted file mode 100644 index 45a25117..00000000 --- a/src/builtins.rs +++ /dev/null @@ -1,71 +0,0 @@ -/// Node.js built-in modules -/// -/// `node -p "[...require('module').builtinModules].map(b => JSON.stringify(b)).join(',\n')"` -/// -pub const NODEJS_BUILTINS: &[&str] = &[ - "_http_agent", - "_http_client", - "_http_common", - "_http_incoming", - "_http_outgoing", - "_http_server", - "_stream_duplex", - "_stream_passthrough", - "_stream_readable", - "_stream_transform", - "_stream_wrap", - "_stream_writable", - "_tls_common", - "_tls_wrap", - "assert", - "assert/strict", - "async_hooks", - "buffer", - "child_process", - "cluster", - "console", - "constants", - "crypto", - "dgram", - "diagnostics_channel", - "dns", - "dns/promises", - "domain", - "events", - "fs", - "fs/promises", - "http", - "http2", - "https", - "inspector", - "module", - "net", - "os", - "path", - "path/posix", - "path/win32", - "perf_hooks", - "process", - "punycode", - "querystring", - "readline", - "repl", - "stream", - "stream/consumers", - "stream/promises", - "stream/web", - "string_decoder", - "sys", - "timers", - "timers/promises", - "tls", - "trace_events", - "tty", - "url", - "util", - "util/types", - "v8", - "vm", - "worker_threads", - "zlib", -]; diff --git a/src/cache.rs b/src/cache.rs deleted file mode 100644 index 6e600664..00000000 --- a/src/cache.rs +++ /dev/null @@ -1,354 +0,0 @@ -use once_cell::sync::OnceCell as OnceLock; -use std::{ - borrow::{Borrow, Cow}, - convert::AsRef, - hash::{BuildHasherDefault, Hash, Hasher}, - io, - ops::Deref, - path::{Path, PathBuf}, - sync::Arc, -}; - -use dashmap::{DashMap, DashSet}; -use rustc_hash::FxHasher; - -use crate::{ - context::ResolveContext as Ctx, package_json::PackageJson, path::PathUtil, FileMetadata, - FileSystem, ResolveError, ResolveOptions, TsConfig, -}; - -#[derive(Default)] -pub struct Cache { - pub(crate) fs: Fs, - paths: DashSet>, - tsconfigs: DashMap, BuildHasherDefault>, -} - -impl Cache { - pub fn new(fs: Fs) -> Self { - Self { fs, paths: DashSet::default(), tsconfigs: DashMap::default() } - } - - pub fn clear(&self) { - self.paths.clear(); - self.tsconfigs.clear(); - } - - pub fn value(&self, path: &Path) -> CachedPath { - let hash = { - let mut hasher = FxHasher::default(); - path.hash(&mut hasher); - hasher.finish() - }; - if let Some(cache_entry) = self.paths.get((hash, path).borrow() as &dyn CacheKey) { - return cache_entry.clone(); - } - let parent = path.parent().map(|p| self.value(p)); - let data = CachedPath(Arc::new(CachedPathImpl::new( - hash, - path.to_path_buf().into_boxed_path(), - parent, - ))); - self.paths.insert(data.clone()); - data - } - - pub fn tsconfig Result<(), ResolveError>>( - &self, - root: bool, - path: &Path, - callback: F, // callback for modifying tsconfig with `extends` - ) -> Result, ResolveError> { - if let Some(tsconfig_ref) = self.tsconfigs.get(path) { - return Ok(Arc::clone(tsconfig_ref.value())); - } - let meta = self.fs.metadata(path).ok(); - let tsconfig_path = if meta.is_some_and(|m| m.is_file) { - Cow::Borrowed(path) - } else if meta.is_some_and(|m| m.is_dir) { - Cow::Owned(path.join("tsconfig.json")) - } else { - let mut os_string = path.to_path_buf().into_os_string(); - os_string.push(".json"); - Cow::Owned(PathBuf::from(os_string)) - }; - let mut tsconfig_string = self - .fs - .read_to_string(&tsconfig_path) - .map_err(|_| ResolveError::TsconfigNotFound(path.to_path_buf()))?; - let mut tsconfig = - TsConfig::parse(root, &tsconfig_path, &mut tsconfig_string).map_err(|error| { - ResolveError::from_serde_json_error(tsconfig_path.to_path_buf(), &error) - })?; - callback(&mut tsconfig)?; - let tsconfig = Arc::new(tsconfig.build()); - self.tsconfigs.insert(path.to_path_buf(), Arc::clone(&tsconfig)); - Ok(tsconfig) - } -} - -#[derive(Clone)] -pub struct CachedPath(Arc); - -impl Hash for CachedPath { - fn hash(&self, state: &mut H) { - self.0.hash.hash(state); - } -} - -impl PartialEq for CachedPath { - fn eq(&self, other: &Self) -> bool { - self.0.path == other.0.path - } -} -impl Eq for CachedPath {} - -impl Deref for CachedPath { - type Target = CachedPathImpl; - - fn deref(&self) -> &Self::Target { - self.0.as_ref() - } -} - -impl<'a> Borrow for CachedPath { - fn borrow(&self) -> &(dyn CacheKey + 'a) { - self - } -} - -impl AsRef for CachedPath { - fn as_ref(&self) -> &CachedPathImpl { - self.0.as_ref() - } -} - -impl CacheKey for CachedPath { - fn tuple(&self) -> (u64, &Path) { - (self.hash, &self.path) - } -} - -pub struct CachedPathImpl { - hash: u64, - path: Box, - parent: Option, - meta: OnceLock>, - canonicalized: OnceLock>, - node_modules: OnceLock>, - package_json: OnceLock>>, -} - -impl CachedPathImpl { - fn new(hash: u64, path: Box, parent: Option) -> Self { - Self { - hash, - path, - parent, - meta: OnceLock::new(), - canonicalized: OnceLock::new(), - node_modules: OnceLock::new(), - package_json: OnceLock::new(), - } - } - - pub fn path(&self) -> &Path { - &self.path - } - - pub fn to_path_buf(&self) -> PathBuf { - self.path.to_path_buf() - } - - pub fn parent(&self) -> Option<&CachedPath> { - self.parent.as_ref() - } - - fn meta(&self, fs: &Fs) -> Option { - *self.meta.get_or_init(|| fs.metadata(&self.path).ok()) - } - - pub fn is_file(&self, fs: &Fs, ctx: &mut Ctx) -> bool { - if let Some(meta) = self.meta(fs) { - ctx.add_file_dependency(self.path()); - meta.is_file - } else { - ctx.add_missing_dependency(self.path()); - false - } - } - - pub fn is_dir(&self, fs: &Fs, ctx: &mut Ctx) -> bool { - self.meta(fs).map_or_else( - || { - ctx.add_missing_dependency(self.path()); - false - }, - |meta| meta.is_dir, - ) - } - - pub fn realpath(&self, fs: &Fs) -> io::Result { - self.canonicalized - .get_or_try_init(|| { - if fs.symlink_metadata(&self.path).is_ok_and(|m| m.is_symlink) { - return fs.canonicalize(&self.path).map(Some); - } - if let Some(parent) = self.parent() { - let parent_path = parent.realpath(fs)?; - return Ok(Some( - parent_path.normalize_with(self.path.strip_prefix(&parent.path).unwrap()), - )); - }; - Ok(None) - }) - .cloned() - .map(|r| r.unwrap_or_else(|| self.path.clone().to_path_buf())) - } - - pub fn module_directory( - &self, - module_name: &str, - cache: &Cache, - ctx: &mut Ctx, - ) -> Option { - let cached_path = cache.value(&self.path.join(module_name)); - cached_path.is_dir(&cache.fs, ctx).then_some(cached_path) - } - - pub fn cached_node_modules( - &self, - cache: &Cache, - ctx: &mut Ctx, - ) -> Option { - self.node_modules.get_or_init(|| self.module_directory("node_modules", cache, ctx)).clone() - } - - /// Find package.json of a path by traversing parent directories. - /// - /// # Errors - /// - /// * [ResolveError::JSON] - pub fn find_package_json( - &self, - fs: &Fs, - options: &ResolveOptions, - ctx: &mut Ctx, - ) -> Result>, ResolveError> { - let mut cache_value = self; - // Go up directories when the querying path is not a directory - while !cache_value.is_dir(fs, ctx) { - if let Some(cv) = &cache_value.parent { - cache_value = cv.as_ref(); - } else { - break; - } - } - let mut cache_value = Some(cache_value); - while let Some(cv) = cache_value { - if let Some(package_json) = cv.package_json(fs, options, ctx)? { - return Ok(Some(Arc::clone(&package_json))); - } - cache_value = cv.parent.as_deref(); - } - Ok(None) - } - - /// Get package.json of the given path. - /// - /// # Errors - /// - /// * [ResolveError::JSON] - pub fn package_json( - &self, - fs: &Fs, - options: &ResolveOptions, - ctx: &mut Ctx, - ) -> Result>, ResolveError> { - // Change to `std::sync::OnceLock::get_or_try_init` when it is stable. - let result = self - .package_json - .get_or_try_init(|| { - let package_json_path = self.path.join("package.json"); - let Ok(package_json_string) = fs.read_to_string(&package_json_path) else { - return Ok(None); - }; - let real_path = if options.symlinks { - self.realpath(fs)?.join("package.json") - } else { - package_json_path.clone() - }; - PackageJson::parse(package_json_path.clone(), real_path, &package_json_string) - .map(Arc::new) - .map(Some) - .map_err(|error| ResolveError::from_serde_json_error(package_json_path, &error)) - }) - .cloned(); - // https://github.com/webpack/enhanced-resolve/blob/58464fc7cb56673c9aa849e68e6300239601e615/lib/DescriptionFileUtils.js#L68-L82 - match &result { - Ok(Some(package_json)) => { - ctx.add_file_dependency(&package_json.path); - } - Ok(None) => { - // Avoid an allocation by making this lazy - if let Some(deps) = &mut ctx.missing_dependencies { - deps.push(self.path.join("package.json")); - } - } - Err(_) => { - if let Some(deps) = &mut ctx.file_dependencies { - deps.push(self.path.join("package.json")); - } - } - } - result - } -} - -/// Memoized cache key, code adapted from . -trait CacheKey { - fn tuple(&self) -> (u64, &Path); -} - -impl Hash for dyn CacheKey + '_ { - fn hash(&self, state: &mut H) { - self.tuple().0.hash(state); - } -} - -impl PartialEq for dyn CacheKey + '_ { - fn eq(&self, other: &Self) -> bool { - self.tuple().1 == other.tuple().1 - } -} - -impl Eq for dyn CacheKey + '_ {} - -impl<'a> CacheKey for (u64, &'a Path) { - fn tuple(&self) -> (u64, &Path) { - (self.0, self.1) - } -} - -impl<'a> Borrow for (u64, &'a Path) { - fn borrow(&self) -> &(dyn CacheKey + 'a) { - self - } -} - -/// Since the cache key is memoized, use an identity hasher -/// to avoid double cache. -#[derive(Default)] -struct IdentityHasher(u64); - -impl Hasher for IdentityHasher { - fn write(&mut self, _: &[u8]) { - unreachable!("Invalid use of IdentityHasher") - } - fn write_u64(&mut self, n: u64) { - self.0 = n; - } - fn finish(&self) -> u64 { - self.0 - } -} diff --git a/src/context.rs b/src/context.rs deleted file mode 100644 index 9349de30..00000000 --- a/src/context.rs +++ /dev/null @@ -1,89 +0,0 @@ -use std::{ - ops::{Deref, DerefMut}, - path::{Path, PathBuf}, -}; - -use crate::error::ResolveError; - -#[derive(Debug, Default, Clone)] -pub struct ResolveContext(ResolveContextImpl); - -#[derive(Debug, Default, Clone)] -pub struct ResolveContextImpl { - pub fully_specified: bool, - - pub query: Option, - - pub fragment: Option, - - /// Files that was found on file system - pub file_dependencies: Option>, - - /// Files that was found on file system - pub missing_dependencies: Option>, - - /// The current resolving alias for bailing recursion alias. - pub resolving_alias: Option, - - /// For avoiding infinite recursion, which will cause stack overflow. - depth: u8, -} - -impl Deref for ResolveContext { - type Target = ResolveContextImpl; - - fn deref(&self) -> &Self::Target { - &self.0 - } -} - -impl DerefMut for ResolveContext { - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} - -impl ResolveContext { - pub fn with_fully_specified(&mut self, yes: bool) { - self.fully_specified = yes; - } - - pub fn with_query_fragment(&mut self, query: Option<&str>, fragment: Option<&str>) { - if let Some(query) = query { - self.query.replace(query.to_string()); - } - if let Some(fragment) = fragment { - self.fragment.replace(fragment.to_string()); - } - } - - pub fn init_file_dependencies(&mut self) { - self.file_dependencies.replace(vec![]); - self.missing_dependencies.replace(vec![]); - } - - pub fn add_file_dependency(&mut self, dep: &Path) { - if let Some(deps) = &mut self.file_dependencies { - deps.push(dep.to_path_buf()); - } - } - - pub fn add_missing_dependency(&mut self, dep: &Path) { - if let Some(deps) = &mut self.missing_dependencies { - deps.push(dep.to_path_buf()); - } - } - - pub fn with_resolving_alias(&mut self, alias: String) { - self.resolving_alias = Some(alias); - } - - pub fn test_for_infinite_recursion(&mut self) -> Result<(), ResolveError> { - self.depth += 1; - // 64 should be more than enough for detecting infinite recursion. - if self.depth > 64 { - return Err(ResolveError::Recursion); - } - Ok(()) - } -} diff --git a/src/error.rs b/src/error.rs deleted file mode 100644 index b00a0ba8..00000000 --- a/src/error.rs +++ /dev/null @@ -1,182 +0,0 @@ -use std::{io, path::PathBuf, sync::Arc}; -use thiserror::Error; - -/// All resolution errors -/// -/// `thiserror` is used to display meaningful error messages. -#[derive(Debug, Clone, PartialEq, Error)] -pub enum ResolveError { - /// Ignored path - /// - /// Derived from ignored path (false value) from browser field in package.json - /// ```json - /// { - /// "browser": { - /// "./module": false - /// } - /// } - /// ``` - /// See - #[error("Path is ignored {0}")] - Ignored(PathBuf), - - /// Module not found - #[error("Cannot find module '{0}'")] - NotFound(/* specifier */ String), - - /// Matched alias value not found - #[error("Cannot find module '{0}' for matched aliased key '{1}'")] - MatchedAliasNotFound(/* specifier */ String, /* alias key */ String), - - /// Tsconfig not found - #[error("Tsconfig not found {0}")] - TsconfigNotFound(PathBuf), - - /// Tsconfig's project reference path points to it self - #[error("Tsconfig's project reference path points to this tsconfig {0}")] - TsconfigSelfReference(PathBuf), - - #[error("{0}")] - IOError(IOError), - - /// Node.js builtin modules - /// - /// This is an error due to not being a Node.js runtime. - /// The `alias` option can be used to resolve a builtin module to a polyfill. - #[error("Builtin module {0}")] - Builtin(String), - - /// All of the aliased extension are not found - #[error("All of the aliased extensions are not found for {0}")] - ExtensionAlias(PathBuf), - - /// The provided path specifier cannot be parsed - #[error("{0}")] - Specifier(SpecifierError), - - /// JSON parse error - #[error("{0:?}")] - JSON(JSONError), - - /// Restricted by `ResolveOptions::restrictions` - #[error(r#"Path "{0}" restricted by {0}"#)] - Restriction(PathBuf, PathBuf), - - #[error(r#"Invalid module "{0}" specifier is not a valid subpath for the "exports" resolution of {1}"#)] - InvalidModuleSpecifier(String, PathBuf), - - #[error(r#"Invalid "exports" target "{0}" defined for '{1}' in the package config {2}"#)] - InvalidPackageTarget(String, String, PathBuf), - - #[error(r#"Package subpath '{0}' is not defined by "exports" in {1}"#)] - PackagePathNotExported(String, PathBuf), - - #[error(r#"Invalid package config "{0}", "exports" cannot contain some keys starting with '.' and some not. The exports object must either be an object of package subpath keys or an object of main entry condition name keys only."#)] - InvalidPackageConfig(PathBuf), - - #[error(r#"Default condition should be last one in "{0}""#)] - InvalidPackageConfigDefault(PathBuf), - - #[error(r#"Expecting folder to folder mapping. "{0}" should end with "/"#)] - InvalidPackageConfigDirectory(PathBuf), - - #[error(r#"Package import specifier "{0}" is not defined in package {1}"#)] - PackageImportNotDefined(String, PathBuf), - - #[error("{0} is unimplemented")] - Unimplemented(&'static str), - - /// Occurs when alias paths reference each other. - #[error("Recursion in resolving")] - Recursion, -} - -impl ResolveError { - pub fn is_ignore(&self) -> bool { - matches!(self, Self::Ignored(_)) - } - - pub(crate) fn from_serde_json_error(path: PathBuf, error: &serde_json::Error) -> Self { - Self::JSON(JSONError { - path, - message: error.to_string(), - line: error.line(), - column: error.column(), - }) - } -} - -/// Error for [ResolveError::Specifier] -#[derive(Debug, Clone, Eq, PartialEq, Error)] -pub enum SpecifierError { - #[error("The specifiers must be a non-empty string. Received \"{0}\"")] - Empty(String), -} - -/// JSON error from [serde_json::Error] -#[derive(Debug, Clone, Eq, PartialEq)] -pub struct JSONError { - pub path: PathBuf, - pub message: String, - pub line: usize, - pub column: usize, -} - -#[derive(Debug, Clone, Error)] -#[error("{0}")] -pub struct IOError(Arc); - -impl PartialEq for IOError { - fn eq(&self, other: &Self) -> bool { - self.0.kind() == other.0.kind() - } -} - -impl From for io::Error { - fn from(error: IOError) -> Self { - let io_error = error.0.as_ref(); - Self::new(io_error.kind(), io_error.to_string()) - } -} - -impl From for ResolveError { - fn from(err: io::Error) -> Self { - Self::IOError(IOError(Arc::new(err))) - } -} - -#[test] -fn test_into_io_error() { - use std::io::{self, ErrorKind}; - let error_string = "IOError occurred"; - let string_error = io::Error::new(ErrorKind::Interrupted, error_string.to_string()); - let string_error2 = io::Error::new(ErrorKind::Interrupted, error_string.to_string()); - let resolve_io_error: ResolveError = ResolveError::from(string_error2); - - assert_eq!(resolve_io_error, ResolveError::from(string_error)); - assert_eq!(resolve_io_error.clone(), resolve_io_error); - let ResolveError::IOError(io_error) = resolve_io_error else { unreachable!() }; - assert_eq!( - format!("{io_error:?}"), - r#"IOError(Custom { kind: Interrupted, error: "IOError occurred" })"# - ); - // fix for https://github.com/web-infra-dev/rspack/issues/4564 - let std_io_error: io::Error = io_error.into(); - assert_eq!(std_io_error.kind(), ErrorKind::Interrupted); - assert_eq!(std_io_error.to_string(), error_string); - assert_eq!( - format!("{std_io_error:?}"), - r#"Custom { kind: Interrupted, error: "IOError occurred" }"# - ); -} - -#[test] -fn test_coverage() { - let error = ResolveError::NotFound("x".into()); - assert_eq!(format!("{error:?}"), r#"NotFound("x")"#); - assert_eq!(error.clone(), error); - - let error = ResolveError::Specifier(SpecifierError::Empty("x".into())); - assert_eq!(format!("{error:?}"), r#"Specifier(Empty("x"))"#); - assert_eq!(error.clone(), error); -} diff --git a/src/file_system.rs b/src/file_system.rs deleted file mode 100644 index d5f0ff8a..00000000 --- a/src/file_system.rs +++ /dev/null @@ -1,220 +0,0 @@ -use cfg_if::cfg_if; -use std::{ - fs, io, - path::{Path, PathBuf}, -}; - -#[cfg(feature = "yarn_pnp")] -use pnp::fs::{LruZipCache, VPath, VPathInfo, ZipCache}; - -/// File System abstraction used for `ResolverGeneric` -pub trait FileSystem: Send + Sync { - /// See [std::fs::read_to_string] - /// - /// # Errors - /// - /// * See [std::fs::read_to_string] - /// ## Warning - /// Use `&Path` instead of a generic `P: AsRef` here, - /// because object safety requirements, it is especially useful, when - /// you want to store multiple `dyn FileSystem` in a `Vec` or use a `ResolverGeneric` in - /// napi env. - fn read_to_string(&self, path: &Path) -> io::Result; - - /// See [std::fs::metadata] - /// - /// # Errors - /// See [std::fs::metadata] - /// ## Warning - /// Use `&Path` instead of a generic `P: AsRef` here, - /// because object safety requirements, it is especially useful, when - /// you want to store multiple `dyn FileSystem` in a `Vec` or use a `ResolverGeneric` in - /// napi env. - fn metadata(&self, path: &Path) -> io::Result; - - /// See [std::fs::symlink_metadata] - /// - /// # Errors - /// - /// See [std::fs::symlink_metadata] - /// ## Warning - /// Use `&Path` instead of a generic `P: AsRef` here, - /// because object safety requirements, it is especially useful, when - /// you want to store multiple `dyn FileSystem` in a `Vec` or use a `ResolverGeneric` in - /// napi env. - fn symlink_metadata(&self, path: &Path) -> io::Result; - - /// See [std::fs::canonicalize] - /// - /// # Errors - /// - /// See [std::fs::read_link] - /// ## Warning - /// Use `&Path` instead of a generic `P: AsRef` here, - /// because object safety requirements, it is especially useful, when - /// you want to store multiple `dyn FileSystem` in a `Vec` or use a `ResolverGeneric` in - /// napi env. - fn canonicalize(&self, path: &Path) -> io::Result; -} - -/// Metadata information about a file -#[derive(Debug, Clone, Copy)] -pub struct FileMetadata { - pub(crate) is_file: bool, - pub(crate) is_dir: bool, - pub(crate) is_symlink: bool, -} - -impl FileMetadata { - pub fn new(is_file: bool, is_dir: bool, is_symlink: bool) -> Self { - Self { is_file, is_dir, is_symlink } - } -} - -#[cfg(feature = "yarn_pnp")] -impl From for FileMetadata { - fn from(value: pnp::fs::FileType) -> Self { - Self::new(value == pnp::fs::FileType::File, value == pnp::fs::FileType::Directory, false) - } -} - -impl From for FileMetadata { - fn from(metadata: fs::Metadata) -> Self { - Self::new(metadata.is_file(), metadata.is_dir(), metadata.is_symlink()) - } -} - -/// Operating System -#[cfg(feature = "yarn_pnp")] -pub struct FileSystemOs { - pnp_lru: LruZipCache>, -} - -#[cfg(not(feature = "yarn_pnp"))] -pub struct FileSystemOs; - -impl Default for FileSystemOs { - fn default() -> Self { - cfg_if! { - if #[cfg(feature = "yarn_pnp")] { - Self { pnp_lru: LruZipCache::new(50, pnp::fs::open_zip_via_read_p) } - } else { - Self - } - } - } -} - -fn read_to_string(path: &Path) -> io::Result { - // `simdutf8` is faster than `std::str::from_utf8` which `fs::read_to_string` uses internally - let bytes = std::fs::read(path)?; - if simdutf8::basic::from_utf8(&bytes).is_err() { - // Same error as `fs::read_to_string` produces (`io::Error::INVALID_UTF8`) - return Err(io::Error::new( - io::ErrorKind::InvalidData, - "stream did not contain valid UTF-8", - )); - } - // SAFETY: `simdutf8` has ensured it's a valid UTF-8 string - Ok(unsafe { String::from_utf8_unchecked(bytes) }) -} - -impl FileSystem for FileSystemOs { - fn read_to_string(&self, path: &Path) -> io::Result { - cfg_if! { - if #[cfg(feature = "yarn_pnp")] { - match VPath::from(path)? { - VPath::Zip(info) => { - self.pnp_lru.read_to_string(info.physical_base_path(), info.zip_path) - } - VPath::Virtual(info) => read_to_string(&info.physical_base_path()), - VPath::Native(path) => read_to_string(&path), - } - } else { - read_to_string(path) - } - } - } - - fn metadata(&self, path: &Path) -> io::Result { - cfg_if! { - if #[cfg(feature = "yarn_pnp")] { - match VPath::from(path)? { - VPath::Zip(info) => self - .pnp_lru - .file_type(info.physical_base_path(), info.zip_path) - .map(FileMetadata::from), - VPath::Virtual(info) => { - fs::metadata(info.physical_base_path()).map(FileMetadata::from) - } - VPath::Native(path) => fs::metadata(path).map(FileMetadata::from), - } - } else { - fs::metadata(path).map(FileMetadata::from) - } - } - } - - fn symlink_metadata(&self, path: &Path) -> io::Result { - fs::symlink_metadata(path).map(FileMetadata::from) - } - - fn canonicalize(&self, path: &Path) -> io::Result { - cfg_if! { - if #[cfg(feature = "yarn_pnp")] { - match VPath::from(path)? { - VPath::Zip(info) => { - dunce::canonicalize(info.physical_base_path().join(info.zip_path)) - } - VPath::Virtual(info) => dunce::canonicalize(info.physical_base_path()), - VPath::Native(path) => dunce::canonicalize(path), - } - } else if #[cfg(windows)] { - dunce::canonicalize(path) - } else { - use std::path::Component; - let mut path_buf = path.to_path_buf(); - loop { - let link = fs::read_link(&path_buf)?; - path_buf.pop(); - for component in link.components() { - match component { - Component::ParentDir => { - path_buf.pop(); - } - Component::Normal(seg) => { - #[cfg(target_family = "wasm")] - // Need to trim the extra \0 introduces by https://github.com/nodejs/uvwasi/issues/262 - { - path_buf.push(seg.to_string_lossy().trim_end_matches('\0')); - } - #[cfg(not(target_family = "wasm"))] - { - path_buf.push(seg); - } - } - Component::RootDir => { - path_buf = PathBuf::from("/"); - } - Component::CurDir | Component::Prefix(_) => {} - } - } - if !fs::symlink_metadata(&path_buf)?.is_symlink() { - break; - } - } - Ok(path_buf) - } - } - } -} - -#[test] -fn metadata() { - let meta = FileMetadata { is_file: true, is_dir: true, is_symlink: true }; - assert_eq!( - format!("{meta:?}"), - "FileMetadata { is_file: true, is_dir: true, is_symlink: true }" - ); - let _ = meta; -} diff --git a/src/lib.rs b/src/lib.rs deleted file mode 100644 index e6cb2246..00000000 --- a/src/lib.rs +++ /dev/null @@ -1,1755 +0,0 @@ -//! # Oxc Resolver -//! -//! Node.js [CommonJS][cjs] and [ECMAScript][esm] Module Resolution. -//! -//! Released on [crates.io](https://crates.io/crates/oxc_resolver) and [npm](https://www.npmjs.com/package/oxc-resolver). -//! -//! A module resolution is the process of finding the file referenced by a module specifier in -//! `import "specifier"` or `require("specifier")`. -//! -//! All [configuration options](ResolveOptions) are aligned with webpack's [enhanced-resolve]. -//! -//! ## Terminology -//! -//! ### Specifier -//! -//! For [CommonJS modules][cjs], -//! the specifier is the string passed to the `require` function. e.g. `"id"` in `require("id")`. -//! -//! For [ECMAScript modules][esm], -//! the specifier of an `import` statement is the string after the `from` keyword, -//! e.g. `'specifier'` in `import 'specifier'` or `import { sep } from 'specifier'`. -//! Specifiers are also used in export from statements, and as the argument to an `import()` expression. -//! -//! This is also named "request" in some places. -//! -//! ## References: -//! -//! * Algorithm adapted from Node.js [CommonJS Module Resolution Algorithm] and [ECMAScript Module Resolution Algorithm]. -//! * Tests are ported from [enhanced-resolve]. -//! * Some code is adapted from [parcel-resolver]. -//! * The documentation is copied from [webpack's resolve configuration](https://webpack.js.org/configuration/resolve). -//! -//! [enhanced-resolve]: https://github.com/webpack/enhanced-resolve -//! [CommonJS Module Resolution Algorithm]: https://nodejs.org/api/modules.html#all-together -//! [ECMAScript Module Resolution Algorithm]: https://nodejs.org/api/esm.html#resolution-algorithm-specification -//! [parcel-resolver]: https://github.com/parcel-bundler/parcel/blob/v2/packages/utils/node-resolver-rs -//! [cjs]: https://nodejs.org/api/modules.html -//! [esm]: https://nodejs.org/api/esm.html -//! -//! ## Feature flags -#![cfg_attr(feature = "document-features", doc = document_features::document_features!())] -#![cfg_attr(docsrs, feature(doc_auto_cfg))] -//! -//! ## Example -//! -//! ```rust,ignore -#![doc = include_str!("../examples/resolver.rs")] -//! ``` - -mod builtins; -mod cache; -mod context; -mod error; -mod file_system; -mod options; -mod package_json; -mod path; -mod resolution; -mod specifier; -mod tsconfig; - -#[cfg(test)] -mod tests; - -use std::{ - borrow::Cow, - cmp::Ordering, - ffi::OsStr, - fmt, - path::{Component, Path, PathBuf}, - sync::Arc, -}; - -use rustc_hash::FxHashSet; -use serde_json::Value as JSONValue; - -pub use crate::{ - builtins::NODEJS_BUILTINS, - error::{JSONError, ResolveError, SpecifierError}, - file_system::{FileMetadata, FileSystem}, - options::{ - Alias, AliasValue, EnforceExtension, ResolveOptions, Restriction, TsconfigOptions, - TsconfigReferences, - }, - package_json::PackageJson, - resolution::Resolution, -}; -use crate::{ - cache::{Cache, CachedPath}, - context::ResolveContext as Ctx, - file_system::FileSystemOs, - package_json::JSONMap, - path::{PathUtil, SLASH_START}, - specifier::Specifier, - tsconfig::ExtendsField, - tsconfig::{ProjectReference, TsConfig}, -}; - -type ResolveResult = Result, ResolveError>; - -/// Context returned from the [Resolver::resolve_with_context] API -#[derive(Debug, Default, Clone)] -pub struct ResolveContext { - /// Files that was found on file system - pub file_dependencies: FxHashSet, - - /// Dependencies that was not found on file system - pub missing_dependencies: FxHashSet, -} - -/// Resolver with the current operating system as the file system -pub type Resolver = ResolverGeneric; - -/// Generic implementation of the resolver, can be configured by the [FileSystem] trait -pub struct ResolverGeneric { - options: ResolveOptions, - cache: Arc>, -} - -impl fmt::Debug for ResolverGeneric { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - self.options.fmt(f) - } -} - -impl Default for ResolverGeneric { - fn default() -> Self { - Self::new(ResolveOptions::default()) - } -} - -impl ResolverGeneric { - pub fn new(options: ResolveOptions) -> Self { - Self { options: options.sanitize(), cache: Arc::new(Cache::new(Fs::default())) } - } -} - -impl ResolverGeneric { - pub fn new_with_file_system(file_system: Fs, options: ResolveOptions) -> Self { - Self { cache: Arc::new(Cache::new(file_system)), options: options.sanitize() } - } - - /// Clone the resolver using the same underlying cache. - #[must_use] - pub fn clone_with_options(&self, options: ResolveOptions) -> Self { - Self { options: options.sanitize(), cache: Arc::clone(&self.cache) } - } - - /// Returns the options. - pub fn options(&self) -> &ResolveOptions { - &self.options - } - - /// Clear the underlying cache. - pub fn clear_cache(&self) { - self.cache.clear(); - } - - /// Resolve `specifier` at an absolute path to a `directory`. - /// - /// A specifier is the string passed to require or import, i.e. `require("specifier")` or `import "specifier"`. - /// - /// `directory` must be an **absolute** path to a directory where the specifier is resolved against. - /// For CommonJS modules, it is the `__dirname` variable that contains the absolute path to the folder containing current module. - /// For ECMAScript modules, it is the value of `import.meta.url`. - /// - /// # Errors - /// - /// * See [ResolveError] - pub fn resolve>( - &self, - directory: P, - specifier: &str, - ) -> Result { - let mut ctx = Ctx::default(); - self.resolve_tracing(directory.as_ref(), specifier, &mut ctx) - } - - /// Resolve `specifier` at absolute `path` with [ResolveContext] - /// - /// # Errors - /// - /// * See [ResolveError] - pub fn resolve_with_context>( - &self, - directory: P, - specifier: &str, - resolve_context: &mut ResolveContext, - ) -> Result { - let mut ctx = Ctx::default(); - ctx.init_file_dependencies(); - let result = self.resolve_tracing(directory.as_ref(), specifier, &mut ctx); - if let Some(deps) = &mut ctx.file_dependencies { - resolve_context.file_dependencies.extend(deps.drain(..)); - } - if let Some(deps) = &mut ctx.missing_dependencies { - resolve_context.missing_dependencies.extend(deps.drain(..)); - } - result - } - - /// Wrap `resolve_impl` with `tracing` information - fn resolve_tracing( - &self, - directory: &Path, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - let span = tracing::debug_span!("resolve", path = ?directory, specifier = specifier); - let _enter = span.enter(); - let r = self.resolve_impl(directory, specifier, ctx); - match &r { - Ok(r) => { - tracing::debug!(options = ?self.options, path = ?directory, specifier = specifier, ret = ?r.path); - } - Err(err) => { - tracing::debug!(options = ?self.options, path = ?directory, specifier = specifier, err = ?err); - } - }; - r - } - - fn resolve_impl( - &self, - path: &Path, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - ctx.with_fully_specified(self.options.fully_specified); - let cached_path = self.cache.value(path); - let cached_path = self.require(&cached_path, specifier, ctx)?; - let path = self.load_realpath(&cached_path)?; - // enhanced-resolve: restrictions - self.check_restrictions(&path)?; - let package_json = cached_path.find_package_json(&self.cache.fs, &self.options, ctx)?; - if let Some(package_json) = &package_json { - // path must be inside the package. - debug_assert!(path.starts_with(package_json.directory())); - } - Ok(Resolution { - path, - query: ctx.query.take(), - fragment: ctx.fragment.take(), - package_json, - }) - } - - /// require(X) from module at path Y - /// - /// X: specifier - /// Y: path - /// - /// - fn require( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - ctx.test_for_infinite_recursion()?; - - // enhanced-resolve: parse - let (parsed, try_fragment_as_path) = self.load_parse(cached_path, specifier, ctx)?; - if let Some(path) = try_fragment_as_path { - return Ok(path); - } - - self.require_without_parse(cached_path, parsed.path(), ctx) - } - - fn require_without_parse( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - // tsconfig-paths - if let Some(path) = self.load_tsconfig_paths(cached_path, specifier, &mut Ctx::default())? { - return Ok(path); - } - - // enhanced-resolve: try alias - if let Some(path) = self.load_alias(cached_path, specifier, &self.options.alias, ctx)? { - return Ok(path); - } - - let result = match Path::new(specifier).components().next() { - // 2. If X begins with '/' - Some(Component::RootDir | Component::Prefix(_)) => { - self.require_absolute(cached_path, specifier, ctx) - } - // 3. If X begins with './' or '/' or '../' - Some(Component::CurDir | Component::ParentDir) => { - self.require_relative(cached_path, specifier, ctx) - } - // 4. If X begins with '#' - Some(Component::Normal(_)) if specifier.as_bytes()[0] == b'#' => { - self.require_hash(cached_path, specifier, ctx) - } - _ => { - // 1. If X is a core module, - // a. return the core module - // b. STOP - self.require_core(specifier)?; - - // (ESM) 5. Otherwise, - // Note: specifier is now a bare specifier. - // Set resolved the result of PACKAGE_RESOLVE(specifier, parentURL). - self.require_bare(cached_path, specifier, ctx) - } - }; - - result.or_else(|err| { - if err.is_ignore() { - return Err(err); - } - // enhanced-resolve: try fallback - self.load_alias(cached_path, specifier, &self.options.fallback, ctx) - .and_then(|value| value.ok_or(err)) - }) - } - - // PACKAGE_RESOLVE(packageSpecifier, parentURL) - // 3. If packageSpecifier is a Node.js builtin module name, then - // 1. Return the string "node:" concatenated with packageSpecifier. - fn require_core(&self, specifier: &str) -> Result<(), ResolveError> { - if self.options.builtin_modules { - let starts_with_node = specifier.starts_with("node:"); - if starts_with_node || NODEJS_BUILTINS.binary_search(&specifier).is_ok() { - let mut specifier = specifier.to_string(); - if !starts_with_node { - specifier = format!("node:{specifier}"); - } - return Err(ResolveError::Builtin(specifier)); - } - } - Ok(()) - } - - fn require_absolute( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - // Make sure only path prefixes gets called - debug_assert!(Path::new(specifier) - .components() - .next() - .is_some_and(|c| matches!(c, Component::RootDir | Component::Prefix(_)))); - if !self.options.prefer_relative && self.options.prefer_absolute { - if let Ok(path) = self.load_package_self_or_node_modules(cached_path, specifier, ctx) { - return Ok(path); - } - } - if let Some(path) = self.load_roots(specifier, ctx) { - return Ok(path); - } - // 2. If X begins with '/' - // a. set Y to be the file system root - let path = self.cache.value(Path::new(specifier)); - if let Some(path) = self.load_as_file_or_directory(&path, specifier, ctx)? { - return Ok(path); - } - Err(ResolveError::NotFound(specifier.to_string())) - } - - // 3. If X begins with './' or '/' or '../' - fn require_relative( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - // Make sure only relative or normal paths gets called - debug_assert!(Path::new(specifier).components().next().is_some_and(|c| matches!( - c, - Component::CurDir | Component::ParentDir | Component::Normal(_) - ))); - let path = cached_path.path().normalize_with(specifier); - let cached_path = self.cache.value(&path); - // a. LOAD_AS_FILE(Y + X) - // b. LOAD_AS_DIRECTORY(Y + X) - if let Some(path) = self.load_as_file_or_directory(&cached_path, specifier, ctx)? { - return Ok(path); - } - // c. THROW "not found" - Err(ResolveError::NotFound(specifier.to_string())) - } - - fn require_hash( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - debug_assert_eq!(specifier.chars().next(), Some('#')); - // a. LOAD_PACKAGE_IMPORTS(X, dirname(Y)) - if let Some(path) = self.load_package_imports(cached_path, specifier, ctx)? { - return Ok(path); - } - self.load_package_self_or_node_modules(cached_path, specifier, ctx) - } - - fn require_bare( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - // Make sure no other path prefixes gets called - debug_assert!(Path::new(specifier) - .components() - .next() - .is_some_and(|c| matches!(c, Component::Normal(_)))); - if self.options.prefer_relative { - if let Ok(path) = self.require_relative(cached_path, specifier, ctx) { - return Ok(path); - } - } - self.load_package_self_or_node_modules(cached_path, specifier, ctx) - } - - /// enhanced-resolve: ParsePlugin. - /// - /// 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`. - /// - /// - fn load_parse<'s>( - &self, - cached_path: &CachedPath, - specifier: &'s str, - ctx: &mut Ctx, - ) -> Result<(Specifier<'s>, Option), ResolveError> { - let parsed = Specifier::parse(specifier).map_err(ResolveError::Specifier)?; - ctx.with_query_fragment(parsed.query, parsed.fragment); - - // There is an edge-case where a request with # can be a path or a fragment -> try both - if ctx.fragment.is_some() && ctx.query.is_none() { - let specifier = parsed.path(); - let fragment = ctx.fragment.take().unwrap(); - let path = format!("{specifier}{fragment}"); - if let Ok(path) = self.require_without_parse(cached_path, &path, ctx) { - return Ok((parsed, Some(path))); - } - ctx.fragment.replace(fragment); - } - Ok((parsed, None)) - } - - fn load_package_self_or_node_modules( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - let (_, subpath) = Self::parse_package_specifier(specifier); - if subpath.is_empty() { - ctx.with_fully_specified(false); - } - // 5. LOAD_PACKAGE_SELF(X, dirname(Y)) - if let Some(path) = self.load_package_self(cached_path, specifier, ctx)? { - return Ok(path); - } - // 6. LOAD_NODE_MODULES(X, dirname(Y)) - if let Some(path) = self.load_node_modules(cached_path, specifier, ctx)? { - return Ok(path); - } - // 7. THROW "not found" - Err(ResolveError::NotFound(specifier.to_string())) - } - - /// LOAD_PACKAGE_IMPORTS(X, DIR) - fn load_package_imports( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - // 1. Find the closest package scope SCOPE to DIR. - // 2. If no scope was found, return. - let Some(package_json) = - cached_path.find_package_json(&self.cache.fs, &self.options, ctx)? - else { - return Ok(None); - }; - // 3. If the SCOPE/package.json "imports" is null or undefined, return. - // 4. let MATCH = PACKAGE_IMPORTS_RESOLVE(X, pathToFileURL(SCOPE), ["node", "require"]) defined in the ESM resolver. - if let Some(path) = self.package_imports_resolve(specifier, &package_json, ctx)? { - // 5. RESOLVE_ESM_MATCH(MATCH). - return self.resolve_esm_match(specifier, &path, ctx); - } - Ok(None) - } - - fn load_as_file(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - // enhanced-resolve feature: extension_alias - if let Some(path) = self.load_extension_alias(cached_path, ctx)? { - return Ok(Some(path)); - } - if self.options.enforce_extension.is_disabled() { - // 1. If X is a file, load X as its file extension format. STOP - if let Some(path) = self.load_alias_or_file(cached_path, ctx)? { - return Ok(Some(path)); - } - } - // 2. If X.js is a file, load X.js as JavaScript text. STOP - // 3. If X.json is a file, parse X.json to a JavaScript Object. STOP - // 4. If X.node is a file, load X.node as binary addon. STOP - if let Some(path) = self.load_extensions(cached_path, &self.options.extensions, ctx)? { - return Ok(Some(path)); - } - Ok(None) - } - - fn load_as_directory(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - // TODO: Only package.json is supported, so warn about having other values - // Checking for empty files is needed for omitting checks on package.json - // 1. If X/package.json is a file, - if !self.options.description_files.is_empty() { - // a. Parse X/package.json, and look for "main" field. - if let Some(package_json) = - cached_path.package_json(&self.cache.fs, &self.options, ctx)? - { - // b. If "main" is a falsy value, GOTO 2. - for main_field in package_json.main_fields(&self.options.main_fields) { - // c. let M = X + (json main field) - let main_field_path = cached_path.path().normalize_with(main_field); - // d. LOAD_AS_FILE(M) - let cached_path = self.cache.value(&main_field_path); - if let Some(path) = self.load_as_file(&cached_path, ctx)? { - return Ok(Some(path)); - } - // e. LOAD_INDEX(M) - if let Some(path) = self.load_index(&cached_path, ctx)? { - return Ok(Some(path)); - } - } - // f. LOAD_INDEX(X) DEPRECATED - // g. THROW "not found" - } - } - // 2. LOAD_INDEX(X) - self.load_index(cached_path, ctx) - } - - fn load_as_file_or_directory( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - if self.options.resolve_to_context { - return Ok(cached_path.is_dir(&self.cache.fs, ctx).then(|| cached_path.clone())); - } - if !specifier.ends_with('/') { - if let Some(path) = self.load_as_file(cached_path, ctx)? { - return Ok(Some(path)); - } - } - if cached_path.is_dir(&self.cache.fs, ctx) { - if let Some(path) = self.load_as_directory(cached_path, ctx)? { - return Ok(Some(path)); - } - } - Ok(None) - } - - fn load_extensions( - &self, - path: &CachedPath, - extensions: &[String], - ctx: &mut Ctx, - ) -> ResolveResult { - if ctx.fully_specified { - return Ok(None); - } - let path = path.path().as_os_str(); - for extension in extensions { - let mut path_with_extension = path.to_os_string(); - path_with_extension.reserve_exact(extension.len()); - path_with_extension.push(extension); - let cached_path = self.cache.value(Path::new(&path_with_extension)); - if let Some(path) = self.load_alias_or_file(&cached_path, ctx)? { - return Ok(Some(path)); - } - } - Ok(None) - } - - fn load_realpath(&self, cached_path: &CachedPath) -> Result { - if self.options.symlinks { - cached_path.realpath(&self.cache.fs).map_err(ResolveError::from) - } else { - Ok(cached_path.to_path_buf()) - } - } - - fn check_restrictions(&self, path: &Path) -> Result<(), ResolveError> { - // https://github.com/webpack/enhanced-resolve/blob/a998c7d218b7a9ec2461fc4fddd1ad5dd7687485/lib/RestrictionsPlugin.js#L19-L24 - fn is_inside(path: &Path, parent: &Path) -> bool { - if !path.starts_with(parent) { - return false; - } - if path.as_os_str().len() == parent.as_os_str().len() { - return true; - } - path.strip_prefix(parent).is_ok_and(|p| p == Path::new("./")) - } - for restriction in &self.options.restrictions { - match restriction { - Restriction::Path(restricted_path) => { - if !is_inside(path, restricted_path) { - return Err(ResolveError::Restriction( - path.to_path_buf(), - restricted_path.clone(), - )); - } - } - Restriction::RegExp(_) => { - return Err(ResolveError::Unimplemented("Restriction with regex")) - } - } - } - Ok(()) - } - - fn load_index(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - for main_file in &self.options.main_files { - let main_path = cached_path.path().normalize_with(main_file); - let cached_path = self.cache.value(&main_path); - if self.options.enforce_extension.is_disabled() { - if let Some(path) = self.load_alias_or_file(&cached_path, ctx)? { - return Ok(Some(path)); - } - } - // 1. If X/index.js is a file, load X/index.js as JavaScript text. STOP - // 2. If X/index.json is a file, parse X/index.json to a JavaScript object. STOP - // 3. If X/index.node is a file, load X/index.node as binary addon. STOP - if let Some(path) = self.load_extensions(&cached_path, &self.options.extensions, ctx)? { - return Ok(Some(path)); - } - } - Ok(None) - } - - fn load_alias_or_file(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - if !self.options.alias_fields.is_empty() { - if let Some(package_json) = - cached_path.find_package_json(&self.cache.fs, &self.options, ctx)? - { - if let Some(path) = - self.load_browser_field(cached_path, None, &package_json, ctx)? - { - return Ok(Some(path)); - } - } - } - // enhanced-resolve: try file as alias - let alias_specifier = cached_path.path().to_string_lossy(); - if let Some(path) = - self.load_alias(cached_path, &alias_specifier, &self.options.alias, ctx)? - { - return Ok(Some(path)); - } - if cached_path.is_file(&self.cache.fs, ctx) { - return Ok(Some(cached_path.clone())); - } - Ok(None) - } - - fn load_node_modules( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - #[cfg(feature = "yarn_pnp")] - { - if let Some(resolved_path) = self.load_pnp(cached_path, specifier, ctx)? { - return Ok(Some(resolved_path)); - } - } - - let (package_name, subpath) = Self::parse_package_specifier(specifier); - // 1. let DIRS = NODE_MODULES_PATHS(START) - // 2. for each DIR in DIRS: - for module_name in &self.options.modules { - for cached_path in std::iter::successors(Some(cached_path), |p| p.parent()) { - // Skip if /path/to/node_modules does not exist - if !cached_path.is_dir(&self.cache.fs, ctx) { - continue; - } - - let Some(cached_path) = self.get_module_directory(cached_path, module_name, ctx) - else { - continue; - }; - // Optimize node_modules lookup by inspecting whether the package exists - // From LOAD_PACKAGE_EXPORTS(X, DIR) - // 1. Try to interpret X as a combination of NAME and SUBPATH where the name - // may have a @scope/ prefix and the subpath begins with a slash (`/`). - if !package_name.is_empty() { - let package_path = cached_path.path().normalize_with(package_name); - let cached_path = self.cache.value(&package_path); - // Try foo/node_modules/package_name - if cached_path.is_dir(&self.cache.fs, ctx) { - // a. LOAD_PACKAGE_EXPORTS(X, DIR) - if let Some(path) = - self.load_package_exports(specifier, subpath, &cached_path, ctx)? - { - return Ok(Some(path)); - } - } else { - // foo/node_modules/package_name is not a directory, so useless to check inside it - if !subpath.is_empty() { - continue; - } - // Skip if the directory lead to the scope package does not exist - // i.e. `foo/node_modules/@scope` is not a directory for `foo/node_modules/@scope/package` - if package_name.starts_with('@') { - if let Some(path) = cached_path.parent() { - if !path.is_dir(&self.cache.fs, ctx) { - continue; - } - } - } - } - } - - // Try as file or directory for all other cases - // b. LOAD_AS_FILE(DIR/X) - // c. LOAD_AS_DIRECTORY(DIR/X) - let node_module_file = cached_path.path().normalize_with(specifier); - let cached_path = self.cache.value(&node_module_file); - if let Some(path) = self.load_as_file_or_directory(&cached_path, specifier, ctx)? { - return Ok(Some(path)); - } - } - } - Ok(None) - } - - #[cfg(feature = "yarn_pnp")] - fn load_pnp( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result, ResolveError> { - let Some(pnp_manifest) = &self.options.pnp_manifest else { return Ok(None) }; - let resolution = - pnp::resolve_to_unqualified_via_manifest(pnp_manifest, specifier, cached_path.path()); - match resolution { - Ok(pnp::Resolution::Resolved(path, subpath)) => { - let cached_path = self.cache.value(&path); - let export_resolution = self.load_package_exports( - specifier, - &subpath.unwrap_or_default(), - &cached_path, - ctx, - )?; - if export_resolution.is_some() { - return Ok(export_resolution); - } - let file_or_directory_resolution = - self.load_as_file_or_directory(&cached_path, specifier, ctx)?; - if file_or_directory_resolution.is_some() { - return Ok(file_or_directory_resolution); - } - Err(ResolveError::NotFound(specifier.to_string())) - } - - Ok(pnp::Resolution::Skipped) => Ok(None), - - Err(_) => { - // Todo: Add a ResolveError::Pnp variant? - Err(ResolveError::NotFound(specifier.to_string())) - } - } - } - - fn get_module_directory( - &self, - cached_path: &CachedPath, - module_name: &str, - ctx: &mut Ctx, - ) -> Option { - if module_name == "node_modules" { - cached_path.cached_node_modules(&self.cache, ctx) - } else if cached_path.path().components().next_back() - == Some(Component::Normal(OsStr::new(module_name))) - { - Some(cached_path.clone()) - } else { - cached_path.module_directory(module_name, &self.cache, ctx) - } - } - - fn load_package_exports( - &self, - specifier: &str, - subpath: &str, - cached_path: &CachedPath, - ctx: &mut Ctx, - ) -> ResolveResult { - // 2. If X does not match this pattern or DIR/NAME/package.json is not a file, - // return. - let Some(package_json) = cached_path.package_json(&self.cache.fs, &self.options, ctx)? - else { - return Ok(None); - }; - // 3. Parse DIR/NAME/package.json, and look for "exports" field. - // 4. If "exports" is null or undefined, return. - // 5. let MATCH = PACKAGE_EXPORTS_RESOLVE(pathToFileURL(DIR/NAME), "." + SUBPATH, - // `package.json` "exports", ["node", "require"]) defined in the ESM resolver. - // Note: The subpath is not prepended with a dot on purpose - for exports in package_json.exports_fields(&self.options.exports_fields) { - if let Some(path) = self.package_exports_resolve( - cached_path.path(), - &format!(".{subpath}"), - exports, - ctx, - )? { - // 6. RESOLVE_ESM_MATCH(MATCH) - return self.resolve_esm_match(specifier, &path, ctx); - }; - } - Ok(None) - } - - fn load_package_self( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - // 1. Find the closest package scope SCOPE to DIR. - // 2. If no scope was found, return. - let Some(package_json) = - cached_path.find_package_json(&self.cache.fs, &self.options, ctx)? - else { - return Ok(None); - }; - // 3. If the SCOPE/package.json "exports" is null or undefined, return. - // 4. If the SCOPE/package.json "name" is not the first segment of X, return. - if let Some(subpath) = package_json - .name - .as_ref() - .and_then(|package_name| Self::strip_package_name(specifier, package_name)) - { - // 5. let MATCH = PACKAGE_EXPORTS_RESOLVE(pathToFileURL(SCOPE), - // "." + X.slice("name".length), `package.json` "exports", ["node", "require"]) - // defined in the ESM resolver. - let package_url = package_json.directory(); - // Note: The subpath is not prepended with a dot on purpose - // because `package_exports_resolve` matches subpath without the leading dot. - for exports in package_json.exports_fields(&self.options.exports_fields) { - if let Some(cached_path) = - self.package_exports_resolve(package_url, &format!(".{subpath}"), exports, ctx)? - { - // 6. RESOLVE_ESM_MATCH(MATCH) - return self.resolve_esm_match(specifier, &cached_path, ctx); - } - } - } - self.load_browser_field(cached_path, Some(specifier), &package_json, ctx) - } - - /// RESOLVE_ESM_MATCH(MATCH) - fn resolve_esm_match( - &self, - specifier: &str, - cached_path: &CachedPath, - ctx: &mut Ctx, - ) -> ResolveResult { - // 1. let RESOLVED_PATH = fileURLToPath(MATCH) - // 2. If the file at RESOLVED_PATH exists, load RESOLVED_PATH as its extension format. STOP - // - // Non-compliant ESM can result in a directory, so directory is tried as well. - if let Some(path) = self.load_as_file_or_directory(cached_path, "", ctx)? { - return Ok(Some(path)); - } - // 3. THROW "not found" - Err(ResolveError::NotFound(specifier.to_string())) - } - - /// enhanced-resolve: AliasFieldPlugin for [ResolveOptions::alias_fields] - fn load_browser_field( - &self, - cached_path: &CachedPath, - module_specifier: Option<&str>, - package_json: &PackageJson, - ctx: &mut Ctx, - ) -> ResolveResult { - let path = cached_path.path(); - let Some(new_specifier) = package_json.resolve_browser_field( - path, - module_specifier, - &self.options.alias_fields, - )? - else { - return Ok(None); - }; - // Abort when resolving recursive module - if module_specifier.is_some_and(|s| s == new_specifier) { - return Ok(None); - } - if ctx.resolving_alias.as_ref().is_some_and(|s| s == new_specifier) { - // Complete when resolving to self `{"./a.js": "./a.js"}` - if new_specifier.strip_prefix("./").filter(|s| path.ends_with(Path::new(s))).is_some() { - return if cached_path.is_file(&self.cache.fs, ctx) { - Ok(Some(cached_path.clone())) - } else { - Err(ResolveError::NotFound(new_specifier.to_string())) - }; - } - return Err(ResolveError::Recursion); - } - ctx.with_resolving_alias(new_specifier.to_string()); - ctx.with_fully_specified(false); - let cached_path = self.cache.value(package_json.directory()); - self.require(&cached_path, new_specifier, ctx).map(Some) - } - - /// enhanced-resolve: AliasPlugin for [ResolveOptions::alias] and [ResolveOptions::fallback]. - fn load_alias( - &self, - cached_path: &CachedPath, - specifier: &str, - aliases: &Alias, - ctx: &mut Ctx, - ) -> ResolveResult { - for (alias_key_raw, specifiers) in aliases { - let alias_key = if let Some(alias_key) = alias_key_raw.strip_suffix('$') { - if alias_key != specifier { - continue; - } - alias_key - } else { - let strip_package_name = Self::strip_package_name(specifier, alias_key_raw); - if strip_package_name.is_none() { - continue; - } - alias_key_raw - }; - // It should stop resolving when all of the tried alias values - // failed to resolve. - // - let mut should_stop = false; - for r in specifiers { - match r { - AliasValue::Path(alias_value) => { - if let Some(path) = self.load_alias_value( - cached_path, - alias_key, - alias_value, - specifier, - ctx, - &mut should_stop, - )? { - return Ok(Some(path)); - } - } - AliasValue::Ignore => { - let path = cached_path.path().normalize_with(alias_key); - return Err(ResolveError::Ignored(path)); - } - } - } - if should_stop { - return Err(ResolveError::MatchedAliasNotFound( - specifier.to_string(), - alias_key.to_string(), - )); - } - } - Ok(None) - } - - fn load_alias_value( - &self, - cached_path: &CachedPath, - alias_key: &str, - alias_value: &str, - request: &str, - ctx: &mut Ctx, - should_stop: &mut bool, - ) -> ResolveResult { - if request != alias_value - && !request.strip_prefix(alias_value).is_some_and(|prefix| prefix.starts_with('/')) - { - let tail = &request[alias_key.len()..]; - - let new_specifier = if tail.is_empty() { - Cow::Borrowed(alias_value) - } else { - let alias_value = Path::new(alias_value).normalize(); - // Must not append anything to alias_value if it is a file. - let alias_value_cached_path = self.cache.value(&alias_value); - if alias_value_cached_path.is_file(&self.cache.fs, ctx) { - return Ok(None); - } - - // Remove the leading slash so the final path is concatenated. - let tail = tail.trim_start_matches(SLASH_START); - let normalized = alias_value.normalize_with(tail); - Cow::Owned(normalized.to_string_lossy().to_string()) - }; - - *should_stop = true; - ctx.with_fully_specified(false); - return match self.require(cached_path, new_specifier.as_ref(), ctx) { - Err(ResolveError::NotFound(_) | ResolveError::MatchedAliasNotFound(_, _)) => { - Ok(None) - } - Ok(path) => return Ok(Some(path)), - Err(err) => return Err(err), - }; - } - Ok(None) - } - - /// Given an extension alias map `{".js": [".ts", ".js"]}`, - /// load the mapping instead of the provided extension - /// - /// This is an enhanced-resolve feature - /// - /// # Errors - /// - /// * [ResolveError::ExtensionAlias]: When all of the aliased extensions are not found - fn load_extension_alias(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - if self.options.extension_alias.is_empty() { - return Ok(None); - } - let Some(path_extension) = cached_path.path().extension() else { - return Ok(None); - }; - let Some((_, extensions)) = self - .options - .extension_alias - .iter() - .find(|(ext, _)| OsStr::new(ext.trim_start_matches('.')) == path_extension) - else { - return Ok(None); - }; - let path = cached_path.path().with_extension(""); - let path = path.as_os_str(); - ctx.with_fully_specified(true); - for extension in extensions { - let mut path_with_extension = path.to_os_string(); - path_with_extension.reserve_exact(extension.len()); - path_with_extension.push(extension); - let cached_path = self.cache.value(Path::new(&path_with_extension)); - // Bail if path is module directory such as `ipaddr.js` - if cached_path.is_dir(&self.cache.fs, ctx) { - ctx.with_fully_specified(false); - return Ok(None); - } - if let Some(path) = self.load_alias_or_file(&cached_path, ctx)? { - ctx.with_fully_specified(false); - return Ok(Some(path)); - } - } - Err(ResolveError::ExtensionAlias(cached_path.to_path_buf())) - } - - /// enhanced-resolve: RootsPlugin - /// - /// A list of directories where requests of server-relative URLs (starting with '/') are resolved, - /// defaults to context configuration option. - /// - /// On non-Windows systems these requests are resolved as an absolute path first. - fn load_roots(&self, specifier: &str, ctx: &mut Ctx) -> Option { - if self.options.roots.is_empty() { - return None; - } - if let Some(specifier) = specifier.strip_prefix(SLASH_START) { - for root in &self.options.roots { - let cached_path = self.cache.value(root); - if let Ok(path) = self.require_relative(&cached_path, specifier, ctx) { - return Some(path); - } - } - } - None - } - - fn load_tsconfig_paths( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - let Some(tsconfig_options) = &self.options.tsconfig else { - return Ok(None); - }; - let tsconfig = self.load_tsconfig( - /* root */ true, - &tsconfig_options.config_file, - &tsconfig_options.references, - )?; - let paths = tsconfig.resolve(cached_path.path(), specifier); - for path in paths { - let cached_path = self.cache.value(&path); - if let Ok(path) = self.require_relative(&cached_path, ".", ctx) { - return Ok(Some(path)); - } - } - Ok(None) - } - - fn load_tsconfig( - &self, - root: bool, - path: &Path, - references: &TsconfigReferences, - ) -> Result, ResolveError> { - self.cache.tsconfig(root, path, |tsconfig| { - let directory = self.cache.value(tsconfig.directory()); - tracing::trace!(tsconfig = ?tsconfig, "load_tsconfig"); - - // Extend tsconfig - if let Some(extends) = &tsconfig.extends { - let extended_tsconfig_paths = match extends { - ExtendsField::Single(s) => { - vec![self.get_extended_tsconfig_path(&directory, tsconfig, s)?] - } - ExtendsField::Multiple(specifiers) => specifiers - .iter() - .map(|s| self.get_extended_tsconfig_path(&directory, tsconfig, s)) - .collect::, ResolveError>>()?, - }; - for extended_tsconfig_path in extended_tsconfig_paths { - let extended_tsconfig = self.load_tsconfig( - /* root */ false, - &extended_tsconfig_path, - &TsconfigReferences::Disabled, - )?; - tsconfig.extend_tsconfig(&extended_tsconfig); - } - } - - // Load project references - match references { - TsconfigReferences::Disabled => { - tsconfig.references.drain(..); - } - TsconfigReferences::Auto => {} - TsconfigReferences::Paths(paths) => { - tsconfig.references = paths - .iter() - .map(|path| ProjectReference { path: path.clone(), tsconfig: None }) - .collect(); - } - } - if !tsconfig.references.is_empty() { - let directory = tsconfig.directory().to_path_buf(); - for reference in &mut tsconfig.references { - let reference_tsconfig_path = directory.normalize_with(&reference.path); - let tsconfig = self.cache.tsconfig( - /* root */ true, - &reference_tsconfig_path, - |reference_tsconfig| { - if reference_tsconfig.path == tsconfig.path { - return Err(ResolveError::TsconfigSelfReference( - reference_tsconfig.path.clone(), - )); - } - Ok(()) - }, - )?; - reference.tsconfig.replace(tsconfig); - } - } - Ok(()) - }) - } - - fn get_extended_tsconfig_path( - &self, - directory: &CachedPath, - tsconfig: &TsConfig, - specifier: &str, - ) -> Result { - match specifier.as_bytes().first() { - None => Err(ResolveError::Specifier(SpecifierError::Empty(specifier.to_string()))), - Some(b'/') => Ok(PathBuf::from(specifier)), - Some(b'.') => Ok(tsconfig.directory().normalize_with(specifier)), - _ => self - .clone_with_options(ResolveOptions { - description_files: vec![], - extensions: vec![".json".into()], - main_files: vec!["tsconfig.json".into()], - ..ResolveOptions::default() - }) - .load_package_self_or_node_modules(directory, specifier, &mut Ctx::default()) - .map(|p| p.to_path_buf()) - .map_err(|err| match err { - ResolveError::NotFound(_) => { - ResolveError::TsconfigNotFound(PathBuf::from(specifier)) - } - _ => err, - }), - } - } - - /// PACKAGE_RESOLVE(packageSpecifier, parentURL) - fn package_resolve( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - let (package_name, subpath) = Self::parse_package_specifier(specifier); - - // 3. If packageSpecifier is a Node.js builtin module name, then - // 1. Return the string "node:" concatenated with packageSpecifier. - self.require_core(package_name)?; - - // 11. While parentURL is not the file system root, - for module_name in &self.options.modules { - for cached_path in std::iter::successors(Some(cached_path), |p| p.parent()) { - // 1. Let packageURL be the URL resolution of "node_modules/" concatenated with packageSpecifier, relative to parentURL. - let Some(cached_path) = self.get_module_directory(cached_path, module_name, ctx) - else { - continue; - }; - // 2. Set parentURL to the parent folder URL of parentURL. - let package_path = cached_path.path().normalize_with(package_name); - let cached_path = self.cache.value(&package_path); - // 3. If the folder at packageURL does not exist, then - // 1. Continue the next loop iteration. - if cached_path.is_dir(&self.cache.fs, ctx) { - // 4. Let pjson be the result of READ_PACKAGE_JSON(packageURL). - if let Some(package_json) = - cached_path.package_json(&self.cache.fs, &self.options, ctx)? - { - // 5. If pjson is not null and pjson.exports is not null or undefined, then - // 1. Return the result of PACKAGE_EXPORTS_RESOLVE(packageURL, packageSubpath, pjson.exports, defaultConditions). - for exports in package_json.exports_fields(&self.options.exports_fields) { - if let Some(path) = self.package_exports_resolve( - cached_path.path(), - &format!(".{subpath}"), - exports, - ctx, - )? { - return Ok(Some(path)); - } - } - // 6. Otherwise, if packageSubpath is equal to ".", then - if subpath == "." { - // 1. If pjson.main is a string, then - for main_field in package_json.main_fields(&self.options.main_fields) { - // 1. Return the URL resolution of main in packageURL. - let path = cached_path.path().normalize_with(main_field); - let cached_path = self.cache.value(&path); - if cached_path.is_file(&self.cache.fs, ctx) { - return Ok(Some(cached_path)); - } - } - } - } - let subpath = format!(".{subpath}"); - ctx.with_fully_specified(false); - return self.require(&cached_path, &subpath, ctx).map(Some); - } - } - } - - Err(ResolveError::NotFound(specifier.to_string())) - } - - /// PACKAGE_EXPORTS_RESOLVE(packageURL, subpath, exports, conditions) - fn package_exports_resolve( - &self, - package_url: &Path, - subpath: &str, - exports: &JSONValue, - ctx: &mut Ctx, - ) -> ResolveResult { - let conditions = &self.options.condition_names; - // 1. If exports is an Object with both a key starting with "." and a key not starting with ".", throw an Invalid Package Configuration error. - if let JSONValue::Object(map) = exports { - let mut has_dot = false; - let mut without_dot = false; - for key in map.keys() { - let starts_with_dot_or_hash = key.starts_with(['.', '#']); - has_dot = has_dot || starts_with_dot_or_hash; - without_dot = without_dot || !starts_with_dot_or_hash; - if has_dot && without_dot { - return Err(ResolveError::InvalidPackageConfig( - package_url.join("package.json"), - )); - } - } - } - // 2. If subpath is equal to ".", then - // Note: subpath is not prepended with a dot when passed in. - if subpath == "." { - // enhanced-resolve appends query and fragment when resolving exports field - // https://github.com/webpack/enhanced-resolve/blob/a998c7d218b7a9ec2461fc4fddd1ad5dd7687485/lib/ExportsFieldPlugin.js#L57-L62 - // This is only need when querying the main export, otherwise ctx is passed through. - if ctx.query.is_some() || ctx.fragment.is_some() { - let query = ctx.query.clone().unwrap_or_default(); - let fragment = ctx.fragment.clone().unwrap_or_default(); - return Err(ResolveError::PackagePathNotExported( - format!("./{}{query}{fragment}", subpath.trim_start_matches('.')), - package_url.join("package.json"), - )); - } - // 1. Let mainExport be undefined. - let main_export = match exports { - // 2. If exports is a String or Array, or an Object containing no keys starting with ".", then - JSONValue::String(_) | JSONValue::Array(_) => { - // 1. Set mainExport to exports. - Some(exports) - } - // 3. Otherwise if exports is an Object containing a "." property, then - JSONValue::Object(map) => { - // 1. Set mainExport to exports["."]. - map.get(".").map_or_else( - || { - if map.keys().any(|key| key.starts_with("./") || key.starts_with('#')) { - None - } else { - Some(exports) - } - }, - Some, - ) - } - _ => None, - }; - // 4. If mainExport is not undefined, then - if let Some(main_export) = main_export { - // 1. Let resolved be the result of PACKAGE_TARGET_RESOLVE( packageURL, mainExport, null, false, conditions). - let resolved = self.package_target_resolve( - package_url, - ".", - main_export, - None, - /* is_imports */ false, - conditions, - ctx, - )?; - // 2. If resolved is not null or undefined, return resolved. - if let Some(path) = resolved { - return Ok(Some(path)); - } - } - } - // 3. Otherwise, if exports is an Object and all keys of exports start with ".", then - if let JSONValue::Object(exports) = exports { - // 1. Let matchKey be the string "./" concatenated with subpath. - // Note: `package_imports_exports_resolve` does not require the leading dot. - let match_key = &subpath; - // 2. Let resolved be the result of PACKAGE_IMPORTS_EXPORTS_RESOLVE( matchKey, exports, packageURL, false, conditions). - if let Some(path) = self.package_imports_exports_resolve( - match_key, - exports, - package_url, - /* is_imports */ false, - conditions, - ctx, - )? { - // 3. If resolved is not null or undefined, return resolved. - return Ok(Some(path)); - } - } - // 4. Throw a Package Path Not Exported error. - Err(ResolveError::PackagePathNotExported( - subpath.to_string(), - package_url.join("package.json"), - )) - } - - /// PACKAGE_IMPORTS_RESOLVE(specifier, parentURL, conditions) - fn package_imports_resolve( - &self, - specifier: &str, - package_json: &PackageJson, - ctx: &mut Ctx, - ) -> Result, ResolveError> { - // 1. Assert: specifier begins with "#". - debug_assert!(specifier.starts_with('#'), "{specifier}"); - // 2. If specifier is exactly equal to "#" or starts with "#/", then - // 1. Throw an Invalid Module Specifier error. - // 3. Let packageURL be the result of LOOKUP_PACKAGE_SCOPE(parentURL). - // 4. If packageURL is not null, then - - // 1. Let pjson be the result of READ_PACKAGE_JSON(packageURL). - // 2. If pjson.imports is a non-null Object, then - - // 1. Let resolved be the result of PACKAGE_IMPORTS_EXPORTS_RESOLVE( specifier, pjson.imports, packageURL, true, conditions). - let mut has_imports = false; - for imports in package_json.imports_fields(&self.options.imports_fields) { - if !has_imports { - has_imports = true; - // TODO: fill in test case for this case - if specifier == "#" || specifier.starts_with("#/") { - return Err(ResolveError::InvalidModuleSpecifier( - specifier.to_string(), - package_json.path.clone(), - )); - } - } - if let Some(path) = self.package_imports_exports_resolve( - specifier, - imports, - package_json.directory(), - /* is_imports */ true, - &self.options.condition_names, - ctx, - )? { - // 2. If resolved is not null or undefined, return resolved. - return Ok(Some(path)); - } - } - - // 5. Throw a Package Import Not Defined error. - if has_imports { - Err(ResolveError::PackageImportNotDefined( - specifier.to_string(), - package_json.path.clone(), - )) - } else { - Ok(None) - } - } - - /// PACKAGE_IMPORTS_EXPORTS_RESOLVE(matchKey, matchObj, packageURL, isImports, conditions) - fn package_imports_exports_resolve( - &self, - match_key: &str, - match_obj: &JSONMap, - package_url: &Path, - is_imports: bool, - conditions: &[String], - ctx: &mut Ctx, - ) -> ResolveResult { - // enhanced-resolve behaves differently, it throws - // Error: CachedPath to directories is not possible with the exports field (specifier was ./dist/) - if match_key.ends_with('/') { - return Ok(None); - } - // 1. If matchKey is a key of matchObj and does not contain "*", then - if !match_key.contains('*') { - // 1. Let target be the value of matchObj[matchKey]. - if let Some(target) = match_obj.get(match_key) { - // 2. Return the result of PACKAGE_TARGET_RESOLVE(packageURL, target, null, isImports, conditions). - return self.package_target_resolve( - package_url, - match_key, - target, - None, - is_imports, - conditions, - ctx, - ); - } - } - - let mut best_target = None; - let mut best_match = ""; - let mut best_key = ""; - // 2. Let expansionKeys be the list of keys of matchObj containing only a single "*", sorted by the sorting function PATTERN_KEY_COMPARE which orders in descending order of specificity. - // 3. For each key expansionKey in expansionKeys, do - for (expansion_key, target) in match_obj { - if expansion_key.starts_with("./") || expansion_key.starts_with('#') { - // 1. Let patternBase be the substring of expansionKey up to but excluding the first "*" character. - if let Some((pattern_base, pattern_trailer)) = expansion_key.split_once('*') { - // 2. If matchKey starts with but is not equal to patternBase, then - if match_key.starts_with(pattern_base) - // 1. Let patternTrailer be the substring of expansionKey from the index after the first "*" character. - && !pattern_trailer.contains('*') - // 2. If patternTrailer has zero length, or if matchKey ends with patternTrailer and the length of matchKey is greater than or equal to the length of expansionKey, then - && (pattern_trailer.is_empty() - || (match_key.len() >= expansion_key.len() - && match_key.ends_with(pattern_trailer))) - && Self::pattern_key_compare(best_key, expansion_key).is_gt() - { - // 1. Let target be the value of matchObj[expansionKey]. - best_target = Some(target); - // 2. Let patternMatch be the substring of matchKey starting at the index of the length of patternBase up to the length of matchKey minus the length of patternTrailer. - best_match = - &match_key[pattern_base.len()..match_key.len() - pattern_trailer.len()]; - best_key = expansion_key; - } - } else if expansion_key.ends_with('/') - && match_key.starts_with(expansion_key) - && Self::pattern_key_compare(best_key, expansion_key).is_gt() - { - // TODO: [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./dist/" in the "exports" field module resolution of the package at xxx/package.json. - best_target = Some(target); - best_match = &match_key[expansion_key.len()..]; - best_key = expansion_key; - } - } - } - if let Some(best_target) = best_target { - // 3. Return the result of PACKAGE_TARGET_RESOLVE(packageURL, target, patternMatch, isImports, conditions). - return self.package_target_resolve( - package_url, - best_key, - best_target, - Some(best_match), - is_imports, - conditions, - ctx, - ); - } - // 4. Return null. - Ok(None) - } - - /// PACKAGE_TARGET_RESOLVE(packageURL, target, patternMatch, isImports, conditions) - #[allow(clippy::too_many_arguments)] - fn package_target_resolve( - &self, - package_url: &Path, - target_key: &str, - target: &JSONValue, - pattern_match: Option<&str>, - is_imports: bool, - conditions: &[String], - ctx: &mut Ctx, - ) -> ResolveResult { - fn normalize_string_target<'a>( - target_key: &'a str, - target: &'a str, - pattern_match: Option<&'a str>, - package_url: &Path, - ) -> Result, ResolveError> { - let target = if let Some(pattern_match) = pattern_match { - if !target_key.contains('*') && !target.contains('*') { - // enhanced-resolve behaviour - // TODO: [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./dist/" in the "exports" field module resolution of the package at xxx/package.json. - if target_key.ends_with('/') && target.ends_with('/') { - Cow::Owned(format!("{target}{pattern_match}")) - } else { - return Err(ResolveError::InvalidPackageConfigDirectory( - package_url.join("package.json"), - )); - } - } else { - Cow::Owned(target.replace('*', pattern_match)) - } - } else { - Cow::Borrowed(target) - }; - Ok(target) - } - - match target { - // 1. If target is a String, then - JSONValue::String(target) => { - // 1. If target does not start with "./", then - if !target.starts_with("./") { - // 1. If isImports is false, or if target starts with "../" or "/", or if target is a valid URL, then - if !is_imports || target.starts_with("../") || target.starts_with('/') { - // 1. Throw an Invalid Package Target error. - return Err(ResolveError::InvalidPackageTarget( - target.to_string(), - target_key.to_string(), - package_url.join("package.json"), - )); - } - // 2. If patternMatch is a String, then - // 1. Return PACKAGE_RESOLVE(target with every instance of "*" replaced by patternMatch, packageURL + "/"). - let target = - normalize_string_target(target_key, target, pattern_match, package_url)?; - let package_url = self.cache.value(package_url); - // // 3. Return PACKAGE_RESOLVE(target, packageURL + "/"). - return self.package_resolve(&package_url, &target, ctx); - } - - // 2. If target split on "/" or "\" contains any "", ".", "..", or "node_modules" segments after the first "." segment, case insensitive and including percent encoded variants, throw an Invalid Package Target error. - // 3. Let resolvedTarget be the URL resolution of the concatenation of packageURL and target. - // 4. Assert: resolvedTarget is contained in packageURL. - // 5. If patternMatch is null, then - let target = - normalize_string_target(target_key, target, pattern_match, package_url)?; - if Path::new(target.as_ref()).is_invalid_exports_target() { - return Err(ResolveError::InvalidPackageTarget( - target.to_string(), - target_key.to_string(), - package_url.join("package.json"), - )); - } - let resolved_target = package_url.normalize_with(target.as_ref()); - // 6. If patternMatch split on "/" or "\" contains any "", ".", "..", or "node_modules" segments, case insensitive and including percent encoded variants, throw an Invalid Module Specifier error. - // 7. Return the URL resolution of resolvedTarget with every instance of "*" replaced with patternMatch. - let value = self.cache.value(&resolved_target); - return Ok(Some(value)); - } - // 2. Otherwise, if target is a non-null Object, then - JSONValue::Object(target) => { - // 1. If exports contains any index property keys, as defined in ECMA-262 6.1.7 Array Index, throw an Invalid Package Configuration error. - // 2. For each property p of target, in object insertion order as, - for (key, target_value) in target { - // 1. If p equals "default" or conditions contains an entry for p, then - if key == "default" || conditions.contains(key) { - // 1. Let targetValue be the value of the p property in target. - // 2. Let resolved be the result of PACKAGE_TARGET_RESOLVE( packageURL, targetValue, patternMatch, isImports, conditions). - let resolved = self.package_target_resolve( - package_url, - target_key, - target_value, - pattern_match, - is_imports, - conditions, - ctx, - ); - // 3. If resolved is equal to undefined, continue the loop. - if let Some(path) = resolved? { - // 4. Return resolved. - return Ok(Some(path)); - } - } - } - // 3. Return undefined. - return Ok(None); - } - // 3. Otherwise, if target is an Array, then - JSONValue::Array(targets) => { - // 1. If _target.length is zero, return null. - if targets.is_empty() { - // Note: return PackagePathNotExported has the same effect as return because there are no matches. - return Err(ResolveError::PackagePathNotExported( - pattern_match.unwrap_or(".").to_string(), - package_url.join("package.json"), - )); - } - // 2. For each item targetValue in target, do - for (i, target_value) in targets.iter().enumerate() { - // 1. Let resolved be the result of PACKAGE_TARGET_RESOLVE( packageURL, targetValue, patternMatch, isImports, conditions), continuing the loop on any Invalid Package Target error. - let resolved = self.package_target_resolve( - package_url, - target_key, - target_value, - pattern_match, - is_imports, - conditions, - ctx, - ); - - if resolved.is_err() && i == targets.len() { - return resolved; - } - - // 2. If resolved is undefined, continue the loop. - if let Ok(Some(path)) = resolved { - // 3. Return resolved. - return Ok(Some(path)); - } - } - // 3. Return or throw the last fallback resolution null return or error. - // Note: see `resolved.is_err() && i == targets.len()` - } - _ => {} - } - // 4. Otherwise, if target is null, return null. - Ok(None) - // 5. Otherwise throw an Invalid Package Target error. - } - - // Returns (module, subpath) - // https://github.com/nodejs/node/blob/8f0f17e1e3b6c4e58ce748e06343c5304062c491/lib/internal/modules/esm/resolve.js#L688 - fn parse_package_specifier(specifier: &str) -> (&str, &str) { - let mut separator_index = specifier.as_bytes().iter().position(|b| *b == b'/'); - // let mut valid_package_name = true; - // let mut is_scoped = false; - if specifier.starts_with('@') { - // is_scoped = true; - if separator_index.is_none() || specifier.is_empty() { - // valid_package_name = false; - } else if let Some(index) = &separator_index { - separator_index = specifier[*index + 1..] - .as_bytes() - .iter() - .position(|b| *b == b'/') - .map(|i| i + *index + 1); - } - } - let package_name = - separator_index.map_or(specifier, |separator_index| &specifier[..separator_index]); - - // TODO: https://github.com/nodejs/node/blob/8f0f17e1e3b6c4e58ce748e06343c5304062c491/lib/internal/modules/esm/resolve.js#L705C1-L714C1 - // Package name cannot have leading . and cannot have percent-encoding or - // \\ separators. - // if (RegExpPrototypeExec(invalidPackageNameRegEx, packageName) !== null) - // validPackageName = false; - - // if (!validPackageName) { - // throw new ERR_INVALID_MODULE_SPECIFIER( - // specifier, 'is not a valid package name', fileURLToPath(base)); - // } - let package_subpath = - separator_index.map_or("", |separator_index| &specifier[separator_index..]); - (package_name, package_subpath) - } - - /// PATTERN_KEY_COMPARE(keyA, keyB) - fn pattern_key_compare(key_a: &str, key_b: &str) -> Ordering { - if key_a.is_empty() { - return Ordering::Greater; - } - // 1. Assert: keyA ends with "/" or contains only a single "*". - debug_assert!(key_a.ends_with('/') || key_a.match_indices('*').count() == 1, "{key_a}"); - // 2. Assert: keyB ends with "/" or contains only a single "*". - debug_assert!(key_b.ends_with('/') || key_b.match_indices('*').count() == 1, "{key_b}"); - // 3. Let baseLengthA be the index of "*" in keyA plus one, if keyA contains "*", or the length of keyA otherwise. - let a_pos = key_a.chars().position(|c| c == '*'); - let base_length_a = a_pos.map_or(key_a.len(), |p| p + 1); - // 4. Let baseLengthB be the index of "*" in keyB plus one, if keyB contains "*", or the length of keyB otherwise. - let b_pos = key_b.chars().position(|c| c == '*'); - let base_length_b = b_pos.map_or(key_b.len(), |p| p + 1); - // 5. If baseLengthA is greater than baseLengthB, return -1. - if base_length_a > base_length_b { - return Ordering::Less; - } - // 6. If baseLengthB is greater than baseLengthA, return 1. - if base_length_b > base_length_a { - return Ordering::Greater; - } - // 7. If keyA does not contain "*", return 1. - if !key_a.contains('*') { - return Ordering::Greater; - } - // 8. If keyB does not contain "*", return -1. - if !key_b.contains('*') { - return Ordering::Less; - } - // 9. If the length of keyA is greater than the length of keyB, return -1. - if key_a.len() > key_b.len() { - return Ordering::Less; - } - // 10. If the length of keyB is greater than the length of keyA, return 1. - if key_b.len() > key_a.len() { - return Ordering::Greater; - } - // 11. Return 0. - Ordering::Equal - } - - fn strip_package_name<'a>(specifier: &'a str, package_name: &'a str) -> Option<&'a str> { - specifier - .strip_prefix(package_name) - .filter(|tail| tail.is_empty() || tail.starts_with(SLASH_START)) - } -} diff --git a/src/options.rs b/src/options.rs deleted file mode 100644 index 7893890e..00000000 --- a/src/options.rs +++ /dev/null @@ -1,633 +0,0 @@ -use std::path::Path; -use std::{fmt, path::PathBuf}; - -/// Module Resolution Options -/// -/// Options are directly ported from [enhanced-resolve](https://github.com/webpack/enhanced-resolve#resolver-options). -/// -/// See [webpack resolve](https://webpack.js.org/configuration/resolve/) for information and examples -#[derive(Debug, Clone)] -pub struct ResolveOptions { - /// Path to TypeScript configuration file. - /// - /// Default `None` - pub tsconfig: Option, - - /// Create aliases to import or require certain modules more easily. - /// - /// An alias is used to replace a whole path or part of a path. - /// For example, to alias a commonly used `src/` folders: `vec![("@/src"), vec![AliasValue::Path("/path/to/src")]]` - /// - /// A trailing $ can also be added to the given object's keys to signify an exact match. - /// - /// See [webpack's `resolve.alias` documentation](https://webpack.js.org/configuration/resolve/#resolvealias) for a list of use cases. - pub alias: Alias, - - /// A list of alias fields in description files. - /// - /// Specify a field, such as `browser`, to be parsed according to [this specification](https://github.com/defunctzombie/package-browser-field-spec). - /// Can be a path to json object such as `["path", "to", "exports"]`. - /// - /// Default `[]` - pub alias_fields: Vec>, - - /// Condition names for exports field which defines entry points of a package. - /// - /// The key order in the exports field is significant. During condition matching, earlier entries have higher priority and take precedence over later entries. - /// - /// Default `[]` - pub condition_names: Vec, - - /// The JSON files to use for descriptions. (There was once a `bower.json`.) - /// - /// Default `["package.json"]` - pub description_files: Vec, - - /// Set to [EnforceExtension::Enabled] for [ESM Mandatory file extensions](https://nodejs.org/api/esm.html#mandatory-file-extensions). - /// - /// If `enforce_extension` is set to [EnforceExtension::Enabled], resolution will not allow extension-less files. - /// This means `require('./foo.js')` will resolve, while `require('./foo')` will not. - /// - /// The default value for `enforce_extension` is [EnforceExtension::Auto], which is changed upon initialization. - /// - /// It changes to [EnforceExtension::Enabled] if [ResolveOptions::extensions] contains an empty string; - /// otherwise, this value changes to [EnforceExtension::Disabled]. - /// - /// Explicitly set the value to [EnforceExtension::Disabled] to disable this automatic behavior. - /// - /// For reference, this behavior is aligned with `enhanced-resolve`. See . - pub enforce_extension: EnforceExtension, - - /// A list of exports fields in description files. - /// - /// Can be a path to a JSON object such as `["path", "to", "exports"]`. - /// - /// Default `[["exports"]]`. - pub exports_fields: Vec>, - - /// Fields from `package.json` which are used to provide the internal requests of a package - /// (requests starting with # are considered internal). - /// - /// Can be a path to a JSON object such as `["path", "to", "imports"]`. - /// - /// Default `[["imports"]]`. - pub imports_fields: Vec>, - - /// An object which maps extension to extension aliases. - /// - /// Default `{}` - pub extension_alias: Vec<(String, Vec)>, - - /// Attempt to resolve these extensions in order. - /// - /// If multiple files share the same name but have different extensions, - /// will resolve the one with the extension listed first in the array and skip the rest. - /// - /// All extensions must have a leading dot. - /// - /// Default `[".js", ".json", ".node"]` - pub extensions: Vec, - - /// Redirect module requests when normal resolving fails. - /// - /// Default `[]` - pub fallback: Alias, - - /// 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). - /// - /// See also webpack configuration [resolve.fullySpecified](https://webpack.js.org/configuration/module/#resolvefullyspecified) - /// - /// Default `false` - pub fully_specified: bool, - - /// A list of main fields in description files - /// - /// Default `["main"]`. - pub main_fields: Vec, - - /// The filename to be used while resolving directories. - /// - /// Default `["index"]` - pub main_files: Vec, - - /// A list of directories to resolve modules from, can be absolute path or folder name. - /// - /// Default `["node_modules"]` - pub modules: Vec, - - /// A manifest loaded from pnp::load_pnp_manifest. - /// - /// Default `None` - #[cfg(feature = "yarn_pnp")] - pub pnp_manifest: Option, - - /// Resolve to a context instead of a file. - /// - /// Default `false` - pub resolve_to_context: bool, - - /// Prefer to resolve module requests as relative requests instead of using modules from node_modules directories. - /// - /// Default `false` - pub prefer_relative: bool, - - /// Prefer to resolve server-relative urls as absolute paths before falling back to resolve in ResolveOptions::roots. - /// - /// Default `false` - pub prefer_absolute: bool, - - /// A list of resolve restrictions to restrict the paths that a request can be resolved on. - /// - /// Default `[]` - pub restrictions: Vec, - - /// A list of directories where requests of server-relative URLs (starting with '/') are resolved. - /// On non-Windows systems these requests are resolved as an absolute path first. - /// - /// Default `[]` - pub roots: Vec, - - /// Whether to resolve symlinks to their symlinked location. - /// When enabled, symlinked resources are resolved to their real path, not their symlinked location. - /// Note that this may cause module resolution to fail when using tools that symlink packages (like npm link). - /// - /// Default `true` - pub symlinks: bool, - - /// Whether to parse [module.builtinModules](https://nodejs.org/api/module.html#modulebuiltinmodules) or not. - /// For example, "zlib" will throw [crate::ResolveError::Builtin] when set to true. - /// - /// Default `false` - pub builtin_modules: bool, -} - -impl ResolveOptions { - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// - /// let options = ResolveOptions::default().with_condition_names(&["bar"]); - /// assert_eq!(options.condition_names, vec!["bar".to_string()]) - /// ``` - #[must_use] - pub fn with_condition_names(mut self, names: &[&str]) -> Self { - self.condition_names = names.iter().map(ToString::to_string).collect::>(); - self - } - - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// - /// let options = ResolveOptions::default().with_builtin_modules(false); - /// assert_eq!(options.builtin_modules, false) - /// ``` - #[must_use] - pub fn with_builtin_modules(mut self, flag: bool) -> Self { - self.builtin_modules = flag; - self - } - - /// Adds a single root to the options - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_root("foo"); - /// assert_eq!(options.roots, vec![PathBuf::from("foo")]) - /// ``` - #[must_use] - pub fn with_root>(mut self, root: P) -> Self { - self.roots.push(root.as_ref().to_path_buf()); - self - } - - /// Adds a single extension to the list of extensions - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_extension("jsonc"); - /// assert!(options.extensions.contains(&"jsonc".to_string())); - /// ``` - #[must_use] - pub fn with_extension>(mut self, extension: S) -> Self { - self.extensions.push(extension.into()); - self - } - - /// Adds a single main field to the list of fields - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_main_field("something"); - /// assert!(options.main_fields.contains(&"something".to_string())); - /// ``` - #[must_use] - pub fn with_main_field>(mut self, field: S) -> Self { - self.main_fields.push(field.into()); - self - } - - /// Changes how the extension should be treated - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions, EnforceExtension}; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_force_extension(EnforceExtension::Enabled); - /// assert_eq!(options.enforce_extension, EnforceExtension::Enabled); - /// ``` - #[must_use] - pub fn with_force_extension(mut self, enforce_extension: EnforceExtension) -> Self { - self.enforce_extension = enforce_extension; - self - } - - /// Sets the value for [ResolveOptions::fully_specified] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_fully_specified(true); - /// assert_eq!(options.fully_specified, true); - /// ``` - #[must_use] - pub fn with_fully_specified(mut self, fully_specified: bool) -> Self { - self.fully_specified = fully_specified; - self - } - /// Sets the value for [ResolveOptions::prefer_relative] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_prefer_relative(true); - /// assert_eq!(options.prefer_relative, true); - /// ``` - #[must_use] - pub fn with_prefer_relative(mut self, flag: bool) -> Self { - self.prefer_relative = flag; - self - } - /// Sets the value for [ResolveOptions::prefer_absolute] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_prefer_absolute(true); - /// assert_eq!(options.prefer_absolute, true); - /// ``` - #[must_use] - pub fn with_prefer_absolute(mut self, flag: bool) -> Self { - self.prefer_absolute = flag; - self - } - - /// Changes the value of [ResolveOptions::symlinks] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// - /// let options = ResolveOptions::default().with_symbolic_link(false); - /// assert_eq!(options.symlinks, false); - /// ``` - #[must_use] - pub fn with_symbolic_link(mut self, flag: bool) -> Self { - self.symlinks = flag; - self - } - - /// Adds a module to [ResolveOptions::modules] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// - /// let options = ResolveOptions::default().with_module("module"); - /// assert!(options.modules.contains(&"module".to_string())); - /// ``` - #[must_use] - pub fn with_module>(mut self, module: M) -> Self { - self.modules.push(module.into()); - self - } - - /// Adds a main file to [ResolveOptions::main_files] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// - /// let options = ResolveOptions::default().with_main_file("foo"); - /// assert!(options.main_files.contains(&"foo".to_string())); - /// ``` - #[must_use] - pub fn with_main_file>(mut self, module: M) -> Self { - self.main_files.push(module.into()); - self - } - - pub(crate) fn sanitize(mut self) -> Self { - debug_assert!( - self.extensions.iter().filter(|e| !e.is_empty()).all(|e| e.starts_with('.')), - "All extensions must start with a leading dot" - ); - // Set `enforceExtension` to `true` when [ResolveOptions::extensions] contains an empty string. - // See - if self.enforce_extension == EnforceExtension::Auto { - if !self.extensions.is_empty() && self.extensions.iter().any(String::is_empty) { - self.enforce_extension = EnforceExtension::Enabled; - } else { - self.enforce_extension = EnforceExtension::Disabled; - } - } - self - } -} - -/// Value for [ResolveOptions::enforce_extension] -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -pub enum EnforceExtension { - Auto, - Enabled, - Disabled, -} - -impl EnforceExtension { - pub const fn is_auto(&self) -> bool { - matches!(self, Self::Auto) - } - - pub const fn is_enabled(&self) -> bool { - matches!(self, Self::Enabled) - } - - pub const fn is_disabled(&self) -> bool { - matches!(self, Self::Disabled) - } -} - -/// Alias for [ResolveOptions::alias] and [ResolveOptions::fallback] -pub type Alias = Vec<(String, Vec)>; - -/// Alias Value for [ResolveOptions::alias] and [ResolveOptions::fallback] -#[derive(Debug, Clone, Hash, PartialEq, Eq)] -pub enum AliasValue { - /// The path value - Path(String), - - /// The `false` value - Ignore, -} - -impl From for AliasValue -where - S: Into, -{ - fn from(value: S) -> Self { - Self::Path(value.into()) - } -} - -/// Value for [ResolveOptions::restrictions] -#[derive(Debug, Clone)] -pub enum Restriction { - Path(PathBuf), - RegExp(String), -} - -/// Tsconfig Options for [ResolveOptions::tsconfig] -/// -/// Derived from [tsconfig-paths-webpack-plugin](https://github.com/dividab/tsconfig-paths-webpack-plugin#options) -#[derive(Debug, Clone)] -pub struct TsconfigOptions { - /// Allows you to specify where to find the TypeScript configuration file. - /// You may provide - /// * a relative path to the configuration file. It will be resolved relative to cwd. - /// * an absolute path to the configuration file. - pub config_file: PathBuf, - - /// Support for Typescript Project References. - pub references: TsconfigReferences, -} - -/// Configuration for [TsconfigOptions::references] -#[derive(Debug, Clone)] -pub enum TsconfigReferences { - Disabled, - /// Use the `references` field from tsconfig of `config_file`. - Auto, - /// Manually provided relative or absolute path. - Paths(Vec), -} - -impl Default for ResolveOptions { - fn default() -> Self { - Self { - tsconfig: None, - alias: vec![], - alias_fields: vec![], - condition_names: vec![], - description_files: vec!["package.json".into()], - enforce_extension: EnforceExtension::Auto, - extension_alias: vec![], - exports_fields: vec![vec!["exports".into()]], - imports_fields: vec![vec!["imports".into()]], - extensions: vec![".js".into(), ".json".into(), ".node".into()], - fallback: vec![], - fully_specified: false, - main_fields: vec!["main".into()], - main_files: vec!["index".into()], - modules: vec!["node_modules".into()], - #[cfg(feature = "yarn_pnp")] - pnp_manifest: None, - resolve_to_context: false, - prefer_relative: false, - prefer_absolute: false, - restrictions: vec![], - roots: vec![], - symlinks: true, - builtin_modules: false, - } - } -} - -// For tracing -impl fmt::Display for ResolveOptions { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - if let Some(tsconfig) = &self.tsconfig { - write!(f, "tsconfig:{tsconfig:?},")?; - } - if !self.alias.is_empty() { - write!(f, "alias:{:?},", self.alias)?; - } - if !self.alias_fields.is_empty() { - write!(f, "alias_fields:{:?},", self.alias_fields)?; - } - if !self.condition_names.is_empty() { - write!(f, "condition_names:{:?},", self.condition_names)?; - } - if self.enforce_extension.is_enabled() { - write!(f, "enforce_extension:{:?},", self.enforce_extension)?; - } - if !self.exports_fields.is_empty() { - write!(f, "exports_fields:{:?},", self.exports_fields)?; - } - if !self.imports_fields.is_empty() { - write!(f, "imports_fields:{:?},", self.imports_fields)?; - } - if !self.extension_alias.is_empty() { - write!(f, "extension_alias:{:?},", self.extension_alias)?; - } - if !self.extensions.is_empty() { - write!(f, "extensions:{:?},", self.extensions)?; - } - if !self.fallback.is_empty() { - write!(f, "fallback:{:?},", self.fallback)?; - } - if self.fully_specified { - write!(f, "fully_specified:{:?},", self.fully_specified)?; - } - if !self.main_fields.is_empty() { - write!(f, "main_fields:{:?},", self.main_fields)?; - } - if !self.main_files.is_empty() { - write!(f, "main_files:{:?},", self.main_files)?; - } - if !self.modules.is_empty() { - write!(f, "modules:{:?},", self.modules)?; - } - if self.resolve_to_context { - write!(f, "resolve_to_context:{:?},", self.resolve_to_context)?; - } - if self.prefer_relative { - write!(f, "prefer_relative:{:?},", self.prefer_relative)?; - } - if self.prefer_absolute { - write!(f, "prefer_absolute:{:?},", self.prefer_absolute)?; - } - if !self.restrictions.is_empty() { - write!(f, "restrictions:{:?},", self.restrictions)?; - } - if !self.roots.is_empty() { - write!(f, "roots:{:?},", self.roots)?; - } - if self.symlinks { - write!(f, "symlinks:{:?},", self.symlinks)?; - } - if self.builtin_modules { - write!(f, "builtin_modules:{:?},", self.builtin_modules)?; - } - Ok(()) - } -} - -#[cfg(test)] -mod test { - use super::{ - AliasValue, EnforceExtension, ResolveOptions, Restriction, TsconfigOptions, - TsconfigReferences, - }; - use std::path::PathBuf; - - #[test] - fn enforce_extension() { - assert!(EnforceExtension::Auto.is_auto()); - assert!(!EnforceExtension::Enabled.is_auto()); - assert!(!EnforceExtension::Disabled.is_auto()); - - assert!(!EnforceExtension::Auto.is_enabled()); - assert!(EnforceExtension::Enabled.is_enabled()); - assert!(!EnforceExtension::Disabled.is_enabled()); - - assert!(!EnforceExtension::Auto.is_disabled()); - assert!(!EnforceExtension::Enabled.is_disabled()); - assert!(EnforceExtension::Disabled.is_disabled()); - } - - #[test] - fn display() { - let options = ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: PathBuf::from("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - alias: vec![("a".into(), vec![AliasValue::Ignore])], - alias_fields: vec![vec!["browser".into()]], - condition_names: vec!["require".into()], - enforce_extension: EnforceExtension::Enabled, - extension_alias: vec![(".js".into(), vec![".ts".into()])], - exports_fields: vec![vec!["exports".into()]], - imports_fields: vec![vec!["imports".into()]], - fallback: vec![("fallback".into(), vec![AliasValue::Ignore])], - fully_specified: true, - resolve_to_context: true, - prefer_relative: true, - prefer_absolute: true, - restrictions: vec![Restriction::Path(PathBuf::from("restrictions"))], - roots: vec![PathBuf::from("roots")], - builtin_modules: true, - ..ResolveOptions::default() - }; - - let expected = r#"tsconfig:TsconfigOptions { config_file: "tsconfig.json", references: Auto },alias:[("a", [Ignore])],alias_fields:[["browser"]],condition_names:["require"],enforce_extension:Enabled,exports_fields:[["exports"]],imports_fields:[["imports"]],extension_alias:[(".js", [".ts"])],extensions:[".js", ".json", ".node"],fallback:[("fallback", [Ignore])],fully_specified:true,main_fields:["main"],main_files:["index"],modules:["node_modules"],resolve_to_context:true,prefer_relative:true,prefer_absolute:true,restrictions:[Path("restrictions")],roots:["roots"],symlinks:true,builtin_modules:true,"#; - assert_eq!(format!("{options}"), expected); - - let options = ResolveOptions { - alias: vec![], - alias_fields: vec![], - builtin_modules: false, - condition_names: vec![], - description_files: vec![], - enforce_extension: EnforceExtension::Disabled, - exports_fields: vec![], - extension_alias: vec![], - extensions: vec![], - fallback: vec![], - fully_specified: false, - imports_fields: vec![], - main_fields: vec![], - main_files: vec![], - modules: vec![], - #[cfg(feature = "yarn_pnp")] - pnp_manifest: None, - prefer_absolute: false, - prefer_relative: false, - resolve_to_context: false, - restrictions: vec![], - roots: vec![], - symlinks: false, - tsconfig: None, - }; - - assert_eq!(format!("{options}"), ""); - } -} diff --git a/src/package_json.rs b/src/package_json.rs deleted file mode 100644 index 7e05d202..00000000 --- a/src/package_json.rs +++ /dev/null @@ -1,219 +0,0 @@ -//! package.json definitions -//! -//! Code related to export field are copied from [Parcel's resolver](https://github.com/parcel-bundler/parcel/blob/v2/packages/utils/node-resolver-rs/src/package_json.rs) -use std::path::{Path, PathBuf}; - -use serde_json::Value as JSONValue; - -use crate::{path::PathUtil, ResolveError}; - -pub type JSONMap = serde_json::Map; - -/// Deserialized package.json -#[derive(Debug, Default)] -pub struct PackageJson { - /// Path to `package.json`. Contains the `package.json` filename. - pub path: PathBuf, - - /// Realpath to `package.json`. Contains the `package.json` filename. - pub realpath: PathBuf, - - /// The "name" field defines your package's name. - /// The "name" field can be used in addition to the "exports" field to self-reference a package using its name. - /// - /// - pub name: Option, - - /// The "type" field. - /// - /// - pub r#type: Option, - - /// The "sideEffects" field. - /// - /// - pub side_effects: Option, - - raw_json: std::sync::Arc, -} - -impl PackageJson { - /// # Panics - /// # Errors - pub(crate) fn parse( - path: PathBuf, - realpath: PathBuf, - json: &str, - ) -> Result { - let mut raw_json: JSONValue = serde_json::from_str(json)?; - let mut package_json = Self::default(); - - if let Some(json_object) = raw_json.as_object_mut() { - // Remove large fields that are useless for pragmatic use. - #[cfg(feature = "package_json_raw_json_api")] - { - json_object.remove("description"); - json_object.remove("keywords"); - json_object.remove("scripts"); - json_object.remove("dependencies"); - json_object.remove("devDependencies"); - json_object.remove("peerDependencies"); - json_object.remove("optionalDependencies"); - } - - // Add name, type and sideEffects. - package_json.name = - json_object.get("name").and_then(|field| field.as_str()).map(ToString::to_string); - package_json.r#type = json_object.get("type").cloned(); - package_json.side_effects = json_object.get("sideEffects").cloned(); - } - - package_json.path = path; - package_json.realpath = realpath; - package_json.raw_json = std::sync::Arc::new(raw_json); - Ok(package_json) - } - - fn get_value_by_path<'a>( - fields: &'a serde_json::Map, - path: &[String], - ) -> Option<&'a JSONValue> { - if path.is_empty() { - return None; - } - let mut value = fields.get(&path[0])?; - for key in path.iter().skip(1) { - if let Some(inner_value) = value.as_object().and_then(|o| o.get(key)) { - value = inner_value; - } else { - return None; - } - } - Some(value) - } - - /// Raw serde json value of `package.json`. - /// - /// This is currently used in Rspack for: - /// * getting the `sideEffects` field - /// * query in - search on GitHub indicates query on the `type` field. - /// - /// To reduce overall memory consumption, large fields that useless for pragmatic use are removed. - /// They are: `description`, `keywords`, `scripts`, - /// `dependencies` and `devDependencies`, `peerDependencies`, `optionalDependencies`. - #[cfg(feature = "package_json_raw_json_api")] - pub fn raw_json(&self) -> &std::sync::Arc { - &self.raw_json - } - - /// Directory to `package.json` - /// - /// # Panics - /// - /// * When the package.json path is misconfigured. - pub fn directory(&self) -> &Path { - debug_assert!(self.realpath.file_name().is_some_and(|x| x == "package.json")); - self.realpath.parent().unwrap() - } - - /// The "main" field defines the entry point of a package when imported by name via a node_modules lookup. Its value is a path. - /// - /// When a package has an "exports" field, this will take precedence over the "main" field when importing the package by name. - /// - /// Values are dynamically retrieved from [ResolveOptions::main_fields]. - /// - /// - pub(crate) fn main_fields<'a>( - &'a self, - main_fields: &'a [String], - ) -> impl Iterator + '_ { - main_fields - .iter() - .filter_map(|main_field| self.raw_json.get(main_field)) - .filter_map(|value| value.as_str()) - } - - /// The "exports" field allows defining the entry points of a package when imported by name loaded either via a node_modules lookup or a self-reference to its own name. - /// - /// - pub(crate) fn exports_fields<'a>( - &'a self, - exports_fields: &'a [Vec], - ) -> impl Iterator + '_ { - exports_fields.iter().filter_map(|object_path| { - self.raw_json - .as_object() - .and_then(|json_object| Self::get_value_by_path(json_object, object_path)) - }) - } - - /// In addition to the "exports" field, there is a package "imports" field to create private mappings that only apply to import specifiers from within the package itself. - /// - /// - pub(crate) fn imports_fields<'a>( - &'a self, - imports_fields: &'a [Vec], - ) -> impl Iterator + '_ { - imports_fields.iter().filter_map(|object_path| { - self.raw_json - .as_object() - .and_then(|json_object| Self::get_value_by_path(json_object, object_path)) - .and_then(|value| value.as_object()) - }) - } - - /// The "browser" field is provided by a module author as a hint to javascript bundlers or component tools when packaging modules for client side use. - /// Multiple values are configured by [ResolveOptions::alias_fields]. - /// - /// - fn browser_fields<'a>( - &'a self, - alias_fields: &'a [Vec], - ) -> impl Iterator + '_ { - alias_fields.iter().filter_map(|object_path| { - self.raw_json - .as_object() - .and_then(|json_object| Self::get_value_by_path(json_object, object_path)) - // Only object is valid, all other types are invalid - // https://github.com/webpack/enhanced-resolve/blob/3a28f47788de794d9da4d1702a3a583d8422cd48/lib/AliasFieldPlugin.js#L44-L52 - .and_then(|value| value.as_object()) - }) - } - - /// Resolve the request string for this package.json by looking at the `browser` field. - /// - /// # Errors - /// - /// * Returns [ResolveError::Ignored] for `"path": false` in `browser` field. - pub(crate) fn resolve_browser_field<'a>( - &'a self, - path: &Path, - request: Option<&str>, - alias_fields: &'a [Vec], - ) -> Result, ResolveError> { - for object in self.browser_fields(alias_fields) { - if let Some(request) = request { - if let Some(value) = object.get(request) { - return Self::alias_value(path, value); - } - } else { - let dir = self.path.parent().unwrap(); - for (key, value) in object { - let joined = dir.normalize_with(key); - if joined == path { - return Self::alias_value(path, value); - } - } - } - } - Ok(None) - } - - fn alias_value<'a>(key: &Path, value: &'a JSONValue) -> Result, ResolveError> { - match value { - JSONValue::String(value) => Ok(Some(value.as_str())), - JSONValue::Bool(b) if !b => Err(ResolveError::Ignored(key.to_path_buf())), - _ => Ok(None), - } - } -} diff --git a/src/path.rs b/src/path.rs deleted file mode 100644 index f66fdd76..00000000 --- a/src/path.rs +++ /dev/null @@ -1,132 +0,0 @@ -//! Path Utilities -//! -//! Code adapted from the following libraries -//! * [path-absolutize](https://docs.rs/path-absolutize) -//! * [normalize_path](https://docs.rs/normalize-path) -use std::path::{Component, Path, PathBuf}; - -pub const SLASH_START: &[char; 2] = &['/', '\\']; - -/// Extension trait to add path normalization to std's [`Path`]. -pub trait PathUtil { - /// Normalize this path without performing I/O. - /// - /// All redundant separator and up-level references are collapsed. - /// - /// However, this does not resolve links. - fn normalize(&self) -> PathBuf; - - /// Normalize with subpath assuming this path is normalized without performing I/O. - /// - /// All redundant separator and up-level references are collapsed. - /// - /// However, this does not resolve links. - fn normalize_with>(&self, subpath: P) -> PathBuf; - - /// Defined in ESM PACKAGE_TARGET_RESOLVE - /// If target split on "/" or "\" contains any "", ".", "..", or "node_modules" segments after the first "." segment, case insensitive and including percent encoded variants - fn is_invalid_exports_target(&self) -> bool; -} - -impl PathUtil for Path { - // https://github.com/parcel-bundler/parcel/blob/e0b99c2a42e9109a9ecbd6f537844a1b33e7faf5/packages/utils/node-resolver-rs/src/path.rs#L7 - fn normalize(&self) -> PathBuf { - let mut components = self.components().peekable(); - let mut ret = if let Some(c @ Component::Prefix(..)) = components.peek() { - let buf = PathBuf::from(c.as_os_str()); - components.next(); - buf - } else { - PathBuf::new() - }; - - for component in components { - match component { - Component::Prefix(..) => unreachable!("Path {:?}", self), - Component::RootDir => { - ret.push(component.as_os_str()); - } - Component::CurDir => {} - Component::ParentDir => { - ret.pop(); - } - Component::Normal(c) => { - ret.push(c); - } - } - } - - ret - } - - // https://github.com/parcel-bundler/parcel/blob/e0b99c2a42e9109a9ecbd6f537844a1b33e7faf5/packages/utils/node-resolver-rs/src/path.rs#L37 - fn normalize_with>(&self, subpath: B) -> PathBuf { - let subpath = subpath.as_ref(); - - let mut components = subpath.components(); - - let Some(head) = components.next() else { return subpath.to_path_buf() }; - - if matches!(head, Component::Prefix(..) | Component::RootDir) { - return subpath.to_path_buf(); - } - - let mut ret = self.to_path_buf(); - for component in std::iter::once(head).chain(components) { - match component { - Component::CurDir => {} - Component::ParentDir => { - ret.pop(); - } - Component::Normal(c) => { - ret.push(c); - } - Component::Prefix(..) | Component::RootDir => { - unreachable!("Path {:?} Subpath {:?}", self, subpath) - } - } - } - - ret - } - - fn is_invalid_exports_target(&self) -> bool { - self.components().enumerate().any(|(index, c)| match c { - Component::ParentDir => true, - Component::CurDir => index > 0, - Component::Normal(c) => c.eq_ignore_ascii_case("node_modules"), - _ => false, - }) - } -} - -// https://github.com/webpack/enhanced-resolve/blob/main/test/path.test.js -#[test] -fn is_invalid_exports_target() { - let test_cases = [ - "../a.js", - "../", - "./a/b/../../../c.js", - "./a/b/../../../", - "./../../c.js", - "./../../", - "./a/../b/../../c.js", - "./a/../b/../../", - "./././../", - ]; - - for case in test_cases { - assert!(Path::new(case).is_invalid_exports_target(), "{case}"); - } - - assert!(!Path::new("C:").is_invalid_exports_target()); - assert!(!Path::new("/").is_invalid_exports_target()); -} - -#[test] -fn normalize() { - assert_eq!(Path::new("/foo/.././foo/").normalize(), Path::new("/foo")); - assert_eq!(Path::new("C://").normalize(), Path::new("C://")); - assert_eq!(Path::new("C:").normalize(), Path::new("C:")); - assert_eq!(Path::new(r"\\server\share").normalize(), Path::new(r"\\server\share")); -} diff --git a/src/resolution.rs b/src/resolution.rs deleted file mode 100644 index a3aaa2e7..00000000 --- a/src/resolution.rs +++ /dev/null @@ -1,92 +0,0 @@ -use crate::package_json::PackageJson; -use std::{ - fmt, - path::{Path, PathBuf}, - sync::Arc, -}; - -/// The final path resolution with optional `?query` and `#fragment` -#[derive(Clone)] -pub struct Resolution { - pub(crate) path: PathBuf, - - /// path query `?query`, contains `?`. - pub(crate) query: Option, - - /// path fragment `#query`, contains `#`. - pub(crate) fragment: Option, - - pub(crate) package_json: Option>, -} - -impl fmt::Debug for Resolution { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - f.debug_struct("Resolution") - .field("path", &self.path) - .field("query", &self.query) - .field("fragment", &self.fragment) - .field("package_json", &self.package_json.as_ref().map(|p| &p.path)) - .finish() - } -} - -impl PartialEq for Resolution { - fn eq(&self, other: &Self) -> bool { - self.path == other.path && self.query == other.query && self.fragment == other.fragment - } -} -impl Eq for Resolution {} - -impl Resolution { - /// Returns the path without query and fragment - pub fn path(&self) -> &Path { - &self.path - } - - /// Returns the path without query and fragment - pub fn into_path_buf(self) -> PathBuf { - self.path - } - - /// Returns the path query `?query`, contains the leading `?` - pub fn query(&self) -> Option<&str> { - self.query.as_deref() - } - - /// Returns the path fragment `#fragment`, contains the leading `#` - pub fn fragment(&self) -> Option<&str> { - self.fragment.as_deref() - } - - /// Returns serialized package_json - pub fn package_json(&self) -> Option<&Arc> { - self.package_json.as_ref() - } - - /// Returns the full path with query and fragment - pub fn full_path(&self) -> PathBuf { - let mut path = self.path.clone().into_os_string(); - if let Some(query) = &self.query { - path.push(query); - } - if let Some(fragment) = &self.fragment { - path.push(fragment); - } - PathBuf::from(path) - } -} - -#[test] -fn test() { - let resolution = Resolution { - path: PathBuf::from("foo"), - query: Some("?query".to_string()), - fragment: Some("#fragment".to_string()), - package_json: None, - }; - assert_eq!(resolution.path(), Path::new("foo")); - assert_eq!(resolution.query(), Some("?query")); - assert_eq!(resolution.fragment(), Some("#fragment")); - assert_eq!(resolution.full_path(), PathBuf::from("foo?query#fragment")); - assert_eq!(resolution.into_path_buf(), PathBuf::from("foo")); -} diff --git a/src/specifier.rs b/src/specifier.rs deleted file mode 100644 index 73ed038c..00000000 --- a/src/specifier.rs +++ /dev/null @@ -1,230 +0,0 @@ -use crate::error::SpecifierError; -use std::borrow::Cow; - -#[derive(Debug)] -pub struct Specifier<'a> { - path: Cow<'a, str>, - pub query: Option<&'a str>, - pub fragment: Option<&'a str>, -} - -impl<'a> Specifier<'a> { - pub fn path(&'a self) -> &'a str { - self.path.as_ref() - } - - pub fn parse(specifier: &'a str) -> Result { - if specifier.is_empty() { - return Err(SpecifierError::Empty(specifier.to_string())); - } - let offset = match specifier.as_bytes()[0] { - b'/' | b'.' | b'#' => 1, - _ => 0, - }; - let (path, query, fragment) = Self::parse_query_framgment(specifier, offset); - if path.is_empty() { - return Err(SpecifierError::Empty(specifier.to_string())); - } - Ok(Self { path, query, fragment }) - } - - fn parse_query_framgment( - specifier: &'a str, - skip: usize, - ) -> (Cow<'a, str>, Option<&str>, Option<&str>) { - let mut query_start: Option = None; - let mut fragment_start: Option = None; - - let mut prev = specifier.chars().next().unwrap(); - let mut escaped_indexes = vec![]; - for (i, c) in specifier.char_indices().skip(skip) { - if c == '?' && query_start.is_none() { - query_start = Some(i); - } - if c == '#' { - if prev == '\0' { - escaped_indexes.push(i - 1); - } else { - fragment_start = Some(i); - break; - } - } - prev = c; - } - - let (path, query, fragment) = match (query_start, fragment_start) { - (Some(i), Some(j)) => { - debug_assert!(i < j); - (&specifier[..i], Some(&specifier[i..j]), Some(&specifier[j..])) - } - (Some(i), None) => (&specifier[..i], Some(&specifier[i..]), None), - (None, Some(j)) => (&specifier[..j], None, Some(&specifier[j..])), - _ => (specifier, None, None), - }; - - let path = if escaped_indexes.is_empty() { - Cow::Borrowed(path) - } else { - // Remove the `\0` characters for a legal path. - Cow::Owned( - path.chars() - .enumerate() - .filter_map(|(i, c)| (!escaped_indexes.contains(&i)).then_some(c)) - .collect::(), - ) - }; - - (path, query, fragment) - } -} - -#[cfg(test)] -mod tests { - use super::{Specifier, SpecifierError}; - - #[test] - fn debug() { - let specifier = Specifier::parse("/").unwrap(); - assert_eq!( - format!("{specifier:?}"), - r#"Specifier { path: "/", query: None, fragment: None }"# - ); - } - - #[test] - fn empty() { - let specifiers = ["", "?"]; - for specifier in specifiers { - let error = Specifier::parse(specifier).unwrap_err(); - assert_eq!(error, SpecifierError::Empty(specifier.to_string())); - } - } - - #[test] - fn absolute() -> Result<(), SpecifierError> { - let specifier = "/test?#"; - let parsed = Specifier::parse(specifier)?; - assert_eq!(parsed.path, "/test"); - assert_eq!(parsed.query, Some("?")); - assert_eq!(parsed.fragment, Some("#")); - Ok(()) - } - - #[test] - fn relative() -> Result<(), SpecifierError> { - let specifiers = ["./test", "../test", "../../test"]; - for specifier in specifiers { - let mut r = specifier.to_string(); - r.push_str("?#"); - let parsed = Specifier::parse(&r)?; - assert_eq!(parsed.path, specifier); - assert_eq!(parsed.query, Some("?")); - assert_eq!(parsed.fragment, Some("#")); - } - Ok(()) - } - - #[test] - fn hash() -> Result<(), SpecifierError> { - let specifiers = ["#", "#path"]; - for specifier in specifiers { - let mut r = specifier.to_string(); - r.push_str("?#"); - let parsed = Specifier::parse(&r)?; - assert_eq!(parsed.path, specifier); - assert_eq!(parsed.query, Some("?")); - assert_eq!(parsed.fragment, Some("#")); - } - Ok(()) - } - - #[test] - fn module() -> Result<(), SpecifierError> { - let specifiers = ["module"]; - for specifier in specifiers { - let mut r = specifier.to_string(); - r.push_str("?#"); - let parsed = Specifier::parse(&r)?; - assert_eq!(parsed.path, specifier); - assert_eq!(parsed.query, Some("?")); - assert_eq!(parsed.fragment, Some("#")); - } - Ok(()) - } - - #[test] - fn query_fragment() -> Result<(), SpecifierError> { - let data = [ - ("a?", Some("?"), None), - ("a?query", Some("?query"), None), - ("a?query1?query2", Some("?query1?query2"), None), - ("a?query1?query2?query3", Some("?query1?query2?query3"), None), - ("a#", None, Some("#")), - ("a#b#c", None, Some("#b#c")), - ("a#fragment", None, Some("#fragment")), - ("a?#", Some("?"), Some("#")), - ("a?#fragment", Some("?"), Some("#fragment")), - ("a?query#", Some("?query"), Some("#")), - ("a?query#fragment", Some("?query"), Some("#fragment")), - ("a#fragment?", None, Some("#fragment?")), - ("a#fragment?query", None, Some("#fragment?query")), - ]; - - for (specifier_str, query, fragment) in data { - let specifier = Specifier::parse(specifier_str)?; - assert_eq!(specifier.path, "a", "{specifier_str}"); - assert_eq!(specifier.query, query, "{specifier_str}"); - assert_eq!(specifier.fragment, fragment, "{specifier_str}"); - } - - Ok(()) - } - - #[test] - // https://github.com/webpack/enhanced-resolve/blob/main/test/identifier.test.js - fn enhanced_resolve_edge_cases() -> Result<(), SpecifierError> { - let data = [ - ("path/#", "path/", "", "#"), - ("path/as/?", "path/as/", "?", ""), - ("path/#/?", "path/", "", "#/?"), - ("path/#repo#hash", "path/", "", "#repo#hash"), - ("path/#r#hash", "path/", "", "#r#hash"), - ("path/#repo/#repo2#hash", "path/", "", "#repo/#repo2#hash"), - ("path/#r/#r#hash", "path/", "", "#r/#r#hash"), - ("path/#/not/a/hash?not-a-query", "path/", "", "#/not/a/hash?not-a-query"), - ]; - - for (specifier_str, path, query, fragment) in data { - let specifier = Specifier::parse(specifier_str)?; - assert_eq!(specifier.path, path, "{specifier_str}"); - assert_eq!(specifier.query.unwrap_or(""), query, "{specifier_str}"); - assert_eq!(specifier.fragment.unwrap_or(""), fragment, "{specifier_str}"); - } - - Ok(()) - } - - // https://github.com/webpack/enhanced-resolve/blob/main/test/identifier.test.js - #[test] - fn enhanced_resolve_windows_like() -> Result<(), SpecifierError> { - let data = [ - ("path\\#", "path\\", "", "#"), - ("path\\as\\?", "path\\as\\", "?", ""), - ("path\\#\\?", "path\\", "", "#\\?"), - ("path\\#repo#hash", "path\\", "", "#repo#hash"), - ("path\\#r#hash", "path\\", "", "#r#hash"), - ("path\\#repo\\#repo2#hash", "path\\", "", "#repo\\#repo2#hash"), - ("path\\#r\\#r#hash", "path\\", "", "#r\\#r#hash"), - ("path\\#/not/a/hash?not-a-query", "path\\", "", "#/not/a/hash?not-a-query"), - ]; - - for (specifier_str, path, query, fragment) in data { - let specifier = Specifier::parse(specifier_str)?; - assert_eq!(specifier.path, path, "{specifier_str}"); - assert_eq!(specifier.query.unwrap_or(""), query, "{specifier_str}"); - assert_eq!(specifier.fragment.unwrap_or(""), fragment, "{specifier_str}"); - } - - Ok(()) - } -} diff --git a/src/tests/alias.rs b/src/tests/alias.rs deleted file mode 100644 index e5892066..00000000 --- a/src/tests/alias.rs +++ /dev/null @@ -1,283 +0,0 @@ -//! - -use normalize_path::NormalizePath; -use std::path::Path; - -use crate::{AliasValue, Resolution, ResolveContext, ResolveError, ResolveOptions, Resolver}; - -#[test] -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -fn alias() { - use super::memory_fs::MemoryFS; - use crate::ResolverGeneric; - use std::path::{Path, PathBuf}; - - let f = Path::new("/"); - - let file_system = MemoryFS::new(&[ - ("/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", ""), - ("/dashed-name", ""), - ]); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - alias: vec![ - ("aliasA".into(), vec![AliasValue::from("a")]), - ("b$".into(), vec![AliasValue::from("a/index")]), - ("c$".into(), vec![AliasValue::from("/a/index")]), - ( - "multiAlias".into(), - vec![ - AliasValue::from("b"), - AliasValue::from("c"), - AliasValue::from("d"), - AliasValue::from("e"), - AliasValue::from("a"), - ], - ), - ("recursive".into(), vec![AliasValue::from("recursive/dir")]), - ("/d/dir".into(), vec![AliasValue::from("/c/dir")]), - ("/d/index.js".into(), vec![AliasValue::from("/c/index")]), - ("#".into(), vec![AliasValue::from("/c/dir")]), - ("@".into(), vec![AliasValue::from("/c/dir")]), - ("ignored".into(), vec![AliasValue::Ignore]), - // not part of enhanced-resolve, added to make sure query in alias value works - ("alias_query".into(), vec![AliasValue::from("a?query_after")]), - ("alias_fragment".into(), vec![AliasValue::from("a#fragment_after")]), - ("dash".into(), vec![AliasValue::Ignore]), - ("@scope/package-name/file$".into(), vec![AliasValue::from("/c/dir")]), - ], - modules: vec!["/".into()], - ..ResolveOptions::default() - }, - ); - - #[rustfmt::skip] - let pass = [ - ("should resolve a not aliased module 1", "a", "/a/index"), - ("should resolve a not aliased module 2", "a/index", "/a/index"), - ("should resolve a not aliased module 3", "a/dir", "/a/dir/index"), - ("should resolve a not aliased module 4", "a/dir/index", "/a/dir/index"), - ("should resolve an aliased module 1", "aliasA", "/a/index"), - ("should resolve an aliased module 2", "aliasA/index", "/a/index"), - ("should resolve an aliased module 3", "aliasA/dir", "/a/dir/index"), - ("should resolve an aliased module 4", "aliasA/dir/index", "/a/dir/index"), - ("should resolve '#' alias 1", "#", "/c/dir/index"), - ("should resolve '#' alias 2", "#/index", "/c/dir/index"), - ("should resolve '@' alias 1", "@", "/c/dir/index"), - ("should resolve '@' alias 2", "@/index", "/c/dir/index"), - ("should resolve a recursive aliased module 1", "recursive", "/recursive/dir/index"), - ("should resolve a recursive aliased module 2", "recursive/index", "/recursive/dir/index"), - ("should resolve a recursive aliased module 3", "recursive/dir", "/recursive/dir/index"), - ("should resolve a recursive aliased module 4", "recursive/dir/index", "/recursive/dir/index"), - ("should resolve a file aliased module 1", "b", "/a/index"), - ("should resolve a file aliased module 2", "c", "/a/index"), - ("should resolve a file aliased module with a query 1", "b?query", "/a/index?query"), - ("should resolve a file aliased module with a query 2", "c?query", "/a/index?query"), - ("should resolve a path in a file aliased module 1", "b/index", "/b/index"), - ("should resolve a path in a file aliased module 2", "b/dir", "/b/dir/index"), - ("should resolve a path in a file aliased module 3", "b/dir/index", "/b/dir/index"), - ("should resolve a path in a file aliased module 4", "c/index", "/c/index"), - ("should resolve a path in a file aliased module 5", "c/dir", "/c/dir/index"), - ("should resolve a path in a file aliased module 6", "c/dir/index", "/c/dir/index"), - ("should resolve a file aliased file 1", "d", "/c/index"), - ("should resolve a file aliased file 2", "d/dir/index", "/c/dir/index"), - ("should resolve a file in multiple aliased dirs 1", "multiAlias/dir/file", "/e/dir/file"), - ("should resolve a file in multiple aliased dirs 2", "multiAlias/anotherDir", "/e/anotherDir/index"), - // not part of enhanced-resolve, added to make sure query in alias value works - ("should resolve query in alias value", "alias_query?query_before", "/a/index?query_after"), - ("should resolve query in alias value", "alias_fragment#fragment_before", "/a/index#fragment_after"), - ("should resolve dashed name", "dashed-name", "/dashed-name"), - ("should resolve scoped package name with sub dir", "@scope/package-name/file", "/c/dir/index"), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - - #[rustfmt::skip] - let ignore = [ - ("should resolve an ignore module", "ignored", ResolveError::Ignored(f.join("ignored"))) - ]; - - for (comment, request, expected) in ignore { - let resolution = resolver.resolve(f, request); - assert_eq!(resolution, Err(expected), "{comment} {request}"); - } -} - -// Not part of enhanced-resolve -#[test] -fn infinite_recursion() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![ - ("./a".into(), vec![AliasValue::from("./b")]), - ("./b".into(), vec![AliasValue::from("./a")]), - ], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(f, "./a"); - assert_eq!(resolution, Err(ResolveError::Recursion)); -} - -fn check_slash(path: &Path) { - let s = path.to_string_lossy().to_string(); - #[cfg(target_os = "windows")] - { - assert!(!s.contains('/'), "{s}"); - assert!(s.contains('\\'), "{s}"); - } - #[cfg(not(target_os = "windows"))] - { - assert!(s.contains('/'), "{s}"); - assert!(!s.contains('\\'), "{s}"); - } -} - -#[test] -fn absolute_path() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![(f.join("foo").to_str().unwrap().to_string(), vec![AliasValue::Ignore])], - modules: vec![f.clone().to_str().unwrap().to_string()], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(&f, "foo/index"); - assert_eq!(resolution, Err(ResolveError::Ignored(f.join("foo")))); -} - -#[test] -fn system_path() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![("@app".into(), vec![AliasValue::from(f.join("alias").to_string_lossy())])], - ..ResolveOptions::default() - }); - - let specifiers = ["@app/files/a", "@app/files/a.js"]; - - for specifier in specifiers { - let path = resolver.resolve(&f, specifier).map(Resolution::into_path_buf).unwrap(); - assert_eq!(path, f.join("alias/files/a.js")); - check_slash(&path); - } -} - -#[test] -fn alias_is_full_path() { - let f = super::fixture(); - let dir = f.join("foo"); - let dir_str = dir.to_string_lossy().to_string(); - - let resolver = Resolver::new(ResolveOptions { - alias: vec![("@".into(), vec![AliasValue::Path(dir_str.clone())])], - ..ResolveOptions::default() - }); - - let mut ctx = ResolveContext::default(); - - let specifiers = [ - "@/index".to_string(), - "@/index.js".to_string(), - // specifier has multiple `/` for reasons we'll never know - "@////index".to_string(), - // specifier is a full path - dir_str, - ]; - - for specifier in specifiers { - let resolution = resolver.resolve_with_context(&f, &specifier, &mut ctx); - assert_eq!(resolution.map(|r| r.full_path()), Ok(dir.join("index.js"))); - } - - for path in ctx.file_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - check_slash(&path); - } - - for path in ctx.missing_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - check_slash(&path); - if let Some(path) = path.parent() { - assert!(!path.is_file(), "{path:?} must not be a file"); - } - } -} - -// For the `should_stop` variable in `load_alias` -#[test] -fn all_alias_values_are_not_found() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![( - "m1".to_string(), - vec![AliasValue::Path(f.join("node_modules").join("m2").to_string_lossy().to_string())], - )], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(&f, "m1/a.js"); - assert_eq!( - resolution, - Err(ResolveError::MatchedAliasNotFound("m1/a.js".to_string(), "m1".to_string(),)) - ); -} - -#[test] -fn alias_fragment() { - let f = super::fixture(); - - let data = [ - // enhanced-resolve has `#` prepended with a `\0`, they are removed from the - // following 3 expected test results. - // See https://github.com/webpack/enhanced-resolve#escaping - ( - "handle fragment edge case (no fragment)", - "./no#fragment/#/#", - f.join("no#fragment/#/#.js"), - ), - ("handle fragment edge case (fragment)", "./no#fragment/#/", f.join("no.js#fragment/#/")), - ( - "handle fragment escaping", - "./no\0#fragment/\0#/\0##fragment", - f.join("no#fragment/#/#.js#fragment"), - ), - ]; - - for (comment, request, expected) in data { - let resolver = Resolver::new(ResolveOptions { - alias: vec![("foo".to_string(), vec![AliasValue::Path(request.to_string())])], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f, "foo").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } -} - -#[test] -fn alias_try_fragment_as_path() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![( - "#".to_string(), - vec![AliasValue::Path(f.join("#").to_string_lossy().to_string())], - )], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(&f, "#/a").map(|r| r.full_path()); - assert_eq!(resolution, Ok(f.join("#").join("a.js"))); -} diff --git a/src/tests/browser_field.rs b/src/tests/browser_field.rs deleted file mode 100644 index 171ee099..00000000 --- a/src/tests/browser_field.rs +++ /dev/null @@ -1,189 +0,0 @@ -//! - -use crate::{AliasValue, ResolveError, ResolveOptions, Resolver}; - -#[test] -fn ignore() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![ - vec!["browser".into()], - vec!["innerBrowser1".into()], - vec!["innerBrowser2".into()], - vec![], - ], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - (f.clone(), "./lib/ignore", f.join("lib/ignore.js")), - (f.clone(), "./lib/ignore.js", f.join("lib/ignore.js")), - (f.join("lib"), "./ignore", f.join("lib/ignore.js")), - (f.join("lib"), "./ignore.js", f.join("lib/ignore.js")), - ]; - - for (path, request, expected) in data { - let resolution = resolver.resolve(&path, request); - let expected = ResolveError::Ignored(expected); - assert_eq!(resolution, Err(expected), "{path:?} {request}"); - } -} - -#[test] -fn shared_resolvers() { - let f = super::fixture().join("browser-module"); - - let resolver1 = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["innerBrowser1".into(), "field".into(), "browser".into()]], - ..ResolveOptions::default() - }); - let resolved_path = resolver1.resolve(&f, "./lib/main1.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("lib/main.js"))); - - let resolver2 = resolver1.clone_with_options(ResolveOptions { - alias_fields: vec![vec!["innerBrowser2".into(), "browser".into()]], - ..ResolveOptions::default() - }); - let resolved_path = resolver2.resolve(&f, "./lib/main2.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("./lib/replaced.js"))); -} - -#[test] -fn replace_file() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![ - vec!["browser".into()], - vec!["innerBrowser1".into(), "field2".into(), "browser".into()], // not presented - vec!["innerBrowser1".into(), "field".into(), "browser".into()], - vec!["innerBrowser2".into(), "browser".into()], - ], - // Not part of enhanced-resolve. Added to make sure no interaction between these two fields. - main_fields: vec!["browser".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - ("should replace a file 1", f.clone(), "./lib/replaced", f.join("lib/browser.js")), - ("should replace a file 2", f.clone(), "./lib/replaced.js", f.join("lib/browser.js")), - ("should replace a file 3", f.join("lib"), "./replaced", f.join("lib/browser.js")), - ("should replace a file 4", f.join("lib"), "./replaced.js", f.join("lib/browser.js")), - ("should replace a module with a file 1", f.clone(), "module-a", f.join("browser/module-a.js")), - ("should replace a module with a file 2", f.join("lib"), "module-a", f.join("browser/module-a.js")), - ("should replace a module with a module 1", f.clone(), "module-b", f.join("node_modules/module-c.js")), - ("should replace a module with a module 2", f.join("lib"), "module-b", f.join("node_modules/module-c.js")), - ("should resolve in nested property 1", f.clone(), "./lib/main1.js", f.join("lib/main.js")), - ("should resolve in nested property 2", f.clone(), "./lib/main2.js", f.join("lib/browser.js")), - ("should check only alias field properties", f.clone(), "./toString", f.join("lib/toString.js")), - // not part of enhanced-resolve - ("recursion", f.clone(), "module-c", f.join("node_modules/module-c.js")), - ("resolve self 1", f.clone(), "./lib/main.js", f.join("lib/main.js")), - ("resolve self 2", f.clone(), "./main.js", f.join("lib/main.js")), - ]; - - for (comment, path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn recurse_fail() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - ("recurse non existent", f.clone(), "./lib/non-existent.js", ResolveError::NotFound("./lib/non-existent.js".into())), - ("path partial match 1", f.clone(), "./xyz.js", ResolveError::NotFound("./xyz.js".into())), - ("path partial match 2", f, "./lib/xyz.js", ResolveError::NotFound("./lib/xyz.js".into())), - ]; - - for (comment, path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Err(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn broken() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - // The browser field string value should be ignored - (f.clone(), "browser-module-broken", Ok(f.join("node_modules/browser-module-broken/main.js"))), - (f.join("browser-module"), "./number", Err(ResolveError::NotFound("./number".into()))), - ]; - - for (path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, expected, "{path:?} {request}"); - } -} - -#[test] -fn crypto_js() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - fallback: vec![( - "crypto".into(), - vec![AliasValue::from(f.join("lib.js").to_string_lossy())], - )], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(f.join("crypto-js"), "crypto").map(|r| r.full_path()); - assert_eq!(resolved_path, Err(ResolveError::Ignored(f.join("crypto-js")))); -} - -// https://github.com/webpack/webpack/blob/87660921808566ef3b8796f8df61bd79fc026108/test/cases/resolving/browser-field/index.js#L40-L43 -#[test] -fn recursive() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - let data = [ - ("should handle recursive file 1", f.clone(), "recursive-file/a"), - ("should handle recursive file 2", f.clone(), "recursive-file/b"), - ("should handle recursive file 3", f.clone(), "recursive-file/c"), - ("should handle recursive file 4", f, "recursive-file/d"), - ]; - - for (comment, path, request) in data { - let resolved_path = resolver.resolve(&path, request); - assert_eq!(resolved_path, Err(ResolveError::Recursion), "{comment} {path:?} {request}"); - } -} - -#[test] -fn with_query() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "./foo").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("lib").join("browser.js?query"))); -} diff --git a/src/tests/builtins.rs b/src/tests/builtins.rs deleted file mode 100644 index 5d6d14d9..00000000 --- a/src/tests/builtins.rs +++ /dev/null @@ -1,121 +0,0 @@ -use std::path::Path; - -use crate::{ResolveError, ResolveOptions, Resolver}; - -#[test] -fn builtins_off() { - let f = Path::new("/"); - let resolver = Resolver::default(); - let resolved_path = resolver.resolve(f, "zlib").map(|r| r.full_path()); - assert_eq!(resolved_path, Err(ResolveError::NotFound("zlib".into()))); -} - -#[test] -fn builtins() { - let f = Path::new("/"); - - let resolver = Resolver::new(ResolveOptions::default().with_builtin_modules(true)); - - let pass = [ - "_http_agent", - "_http_client", - "_http_common", - "_http_incoming", - "_http_outgoing", - "_http_server", - "_stream_duplex", - "_stream_passthrough", - "_stream_readable", - "_stream_transform", - "_stream_wrap", - "_stream_writable", - "_tls_common", - "_tls_wrap", - "assert", - "assert/strict", - "async_hooks", - "buffer", - "child_process", - "cluster", - "console", - "constants", - "crypto", - "dgram", - "diagnostics_channel", - "dns", - "dns/promises", - "domain", - "events", - "fs", - "fs/promises", - "http", - "http2", - "https", - "inspector", - "module", - "net", - "os", - "path", - "path/posix", - "path/win32", - "perf_hooks", - "process", - "punycode", - "querystring", - "readline", - "repl", - "stream", - "stream/consumers", - "stream/promises", - "stream/web", - "string_decoder", - "sys", - "timers", - "timers/promises", - "tls", - "trace_events", - "tty", - "url", - "util", - "util/types", - "v8", - "vm", - "worker_threads", - "zlib", - ]; - - for request in pass { - let prefixed_request = format!("node:{request}"); - for request in [prefixed_request.clone(), request.to_string()] { - let resolved_path = resolver.resolve(f, &request).map(|r| r.full_path()); - let err = ResolveError::Builtin(prefixed_request.clone()); - assert_eq!(resolved_path, Err(err), "{request}"); - } - } -} - -#[test] -fn fail() { - let f = Path::new("/"); - let resolver = Resolver::new(ResolveOptions::default().with_builtin_modules(true)); - let request = "xxx"; - let resolved_path = resolver.resolve(f, request); - let err = ResolveError::NotFound(request.to_string()); - assert_eq!(resolved_path, Err(err), "{request}"); -} - -#[test] -fn imports() { - let f = super::fixture().join("builtins"); - let resolver = Resolver::new(ResolveOptions { - builtin_modules: true, - condition_names: vec!["node".into()], - ..ResolveOptions::default() - }); - - for request in ["#fs", "#http"] { - let resolved_path = resolver.resolve(f.clone(), request).map(|r| r.full_path()); - let err = ResolveError::Builtin(format!("node:{}", request.trim_start_matches('#'))); - assert_eq!(resolved_path, Err(err)); - } -} diff --git a/src/tests/dependencies.rs b/src/tests/dependencies.rs deleted file mode 100644 index bcc2355b..00000000 --- a/src/tests/dependencies.rs +++ /dev/null @@ -1,110 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/dependencies.test.js - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows { - use rustc_hash::FxHashSet; - use std::path::PathBuf; - - use crate::{ResolveContext, ResolveOptions, ResolverGeneric}; - - use super::super::memory_fs::MemoryFS; - - fn file_system() -> MemoryFS { - MemoryFS::new(&[ - ("/a/b/node_modules/some-module/index.js", ""), - ("/a/node_modules/module/package.json", r#"{"main":"entry.js"}"#), - ("/a/node_modules/module/file.js", r#"{"main":"entry.js"}"#), - ("/modules/other-module/file.js", ""), - ]) - } - - #[test] - fn test() { - let file_system = file_system(); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - extensions: vec![".json".into(), ".js".into()], - modules: vec!["/modules".into(), "node_modules".into()], - ..ResolveOptions::default() - }, - ); - - let data = [ - ( - "middle module request", - "/a/b/c", - "module/file", - "/a/node_modules/module/file.js", - // These dependencies are different from enhanced-resolve due to different code path to - // querying the file system - vec![ - // 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", - // "/", - ], - vec![ - // missing package.jsons - // "/a/b/c/package.json", - "/a/b/package.json", - "/a/package.json", - "/package.json", - // missing modules directories - "/a/b/c", - // "/a/b/c/node_modules", - // missing single file modules - "/modules/module", - "/a/b/node_modules/module", - // missing files with alternative extensions - "/a/node_modules/module/file", - "/a/node_modules/module/file.json", - ], - ), - ( - "fast found module", - "/a/b/c", - "other-module/file.js", - "/modules/other-module/file.js", - // These dependencies are different from enhanced-resolve due to different code path to - // querying the file system - vec![ - // symlink checks - "/modules/other-module/file.js", - // "/modules/other-module", - // "/modules", - // "/", - ], - vec![ - // missing package.jsons - // "/a/b/c/package.json", - "/a/b/c", - "/a/b/package.json", - "/a/package.json", - "/package.json", - "/modules/other-module/package.json", - "/modules/package.json", - ], - ), - ]; - - for (name, context, request, result, file_dependencies, missing_dependencies) in data { - let mut ctx = ResolveContext::default(); - let path = PathBuf::from(context); - let resolved = - resolver.resolve_with_context(path, request, &mut ctx).map(|r| r.full_path()); - assert_eq!(resolved, Ok(PathBuf::from(result))); - let file_dependencies = - FxHashSet::from_iter(file_dependencies.iter().map(PathBuf::from)); - let missing_dependencies = - FxHashSet::from_iter(missing_dependencies.iter().map(PathBuf::from)); - assert_eq!(ctx.file_dependencies, file_dependencies, "{name}"); - assert_eq!(ctx.missing_dependencies, missing_dependencies, "{name}"); - } - } -} diff --git a/src/tests/exports_field.rs b/src/tests/exports_field.rs deleted file mode 100644 index 7ca73fbd..00000000 --- a/src/tests/exports_field.rs +++ /dev/null @@ -1,2546 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/exportsField.test.js -//! -//! The huge exports field test cases are at the bottom of this file. - -use crate::{Ctx, PathUtil, ResolveError, ResolveOptions, Resolver}; -use serde_json::json; -use std::path::Path; - -#[test] -fn test_simple() { - let f = super::fixture().join("exports-field"); - let f2 = super::fixture().join("exports-field2"); - let f4 = super::fixture().join("exports-field-error"); - let f5 = super::fixture().join("imports-exports-wildcard"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - fully_specified: true, - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("resolve root using exports field, not a main field", f.clone(), "exports-field", f.join("node_modules/exports-field/x.js")), - ("resolver should respect condition names", f.clone(), "exports-field/dist/main.js", f.join("node_modules/exports-field/lib/lib2/main.js")), - // enhanced_resolve behaves differently to node.js. enhanced_resolve fallbacks when an - // array item is unresolved, where as node.js fallbacks when an array has an - // InvalidPackageTarget error. - // ("resolver should respect fallback", f2.clone(), "exports-field/dist/browser.js", f2.join("node_modules/exports-field/lib/browser.js")), - // The following two tests require fallback from array values, the path is changed here to - // only test query and fragment. - ("resolver should respect query parameters #1", f2.clone(), "exports-field/dist/main.js?foo", f2.join("node_modules/exports-field/lib/lib2/main.js?foo")), - ("resolver should respect fragment parameters #1", f2.clone(), "exports-field/dist/main.js#foo", f2.join("node_modules/exports-field/lib/lib2/main.js#foo")), - ("relative path should work, if relative path as request is used", f.clone(), "./node_modules/exports-field/lib/main.js", f.join("node_modules/exports-field/lib/main.js")), - ("self-resolving root", f.clone(), "@exports-field/core", f.join("a.js")), - ("should resolve with wildcard pattern #1", f5.clone(), "m/features/f.js", f5.join("node_modules/m/src/features/f.js")), - ("should resolve with wildcard pattern #2", f5.clone(), "m/features/y/y.js", f5.join("node_modules/m/src/features/y/y.js")), - ("should resolve with wildcard pattern #3", f5.clone(), "m/features-no-ext/y/y.js", f5.join("node_modules/m/src/features/y/y.js")), - ("should resolve with wildcard pattern #4", f5.clone(), "m/middle/nested/f.js", f5.join("node_modules/m/src/middle/nested/f.js")), - ("should resolve with wildcard pattern #5", f5.clone(), "m/middle-1/nested/f.js", f5.join("node_modules/m/src/middle-1/nested/f.js")), - ("should resolve with wildcard pattern #6", f5.clone(), "m/middle-2/nested/f.js", f5.join("node_modules/m/src/middle-2/nested/f.js")), - ("should resolve with wildcard pattern #7", f5.clone(), "m/middle-3/nested/f", f5.join("node_modules/m/src/middle-3/nested/f/nested/f.js")), - ("should resolve with wildcard pattern #8", f5.clone(), "m/middle-4/f/nested", f5.join("node_modules/m/src/middle-4/f/f.js")), - ("should resolve with wildcard pattern #9", f5.clone(), "m/middle-5/f$/$", f5.join("node_modules/m/src/middle-5/f$/$.js")), - ]; - - // Not needed or snapshot: - // * should log the correct info - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } - - let p = f.join("node_modules/exports-field/package.json"); - let p2 = f2.join("node_modules/exports-field/package.json"); - let p4 = f4.join("node_modules/exports-field/package.json"); - let p5 = f5.join("node_modules/m/package.json"); - - #[rustfmt::skip] - let fail = [ - // ("throw error if extension not provided", f2.clone(), "exports-field/dist/main", ResolveError::NotFound(f2.join("node_modules/exports-field/lib/lib2/main"))), - ("resolver should respect query parameters #2. Direct matching", f2.clone(), "exports-field?foo", ResolveError::PackagePathNotExported("./?foo".into(), p2.clone())), - ("resolver should respect fragment parameters #2. Direct matching", f2, "exports-field#foo", ResolveError::PackagePathNotExported("./#foo".into(), p2)), - ("relative path should not work with exports field", f.clone(), "./node_modules/exports-field/dist/main.js", ResolveError::NotFound("./node_modules/exports-field/dist/main.js".into())), - ("backtracking should not work for request", f.clone(), "exports-field/dist/../../../a.js", ResolveError::InvalidPackageTarget("./lib/../../../a.js".to_string(), "./dist/".to_string(), p.clone())), - ("backtracking should not work for exports field target", f.clone(), "exports-field/dist/a.js", ResolveError::InvalidPackageTarget("./../../a.js".to_string(), "./dist/a.js".to_string(), p.clone())), - ("not exported error", f.clone(), "exports-field/anything/else", ResolveError::PackagePathNotExported("./anything/else".to_string(), p.clone())), - ("request ending with slash #1", f.clone(), "exports-field/", ResolveError::PackagePathNotExported("./".to_string(), p.clone())), - ("request ending with slash #2", f.clone(), "exports-field/dist/", ResolveError::PackagePathNotExported("./dist/".to_string(), p.clone())), - ("request ending with slash #3", f.clone(), "exports-field/lib/", ResolveError::PackagePathNotExported("./lib/".to_string(), p)), - ("should throw error if target is invalid", f4, "exports-field", ResolveError::InvalidPackageTarget("./a/../b/../../pack1/index.js".to_string(), ".".to_string(), p4)), - ("throw error if exports field is invalid", f.clone(), "invalid-exports-field", ResolveError::InvalidPackageConfig(f.join("node_modules/invalid-exports-field/package.json"))), - ("should throw error if target is 'null'", f5, "m/features/internal/file.js", ResolveError::PackagePathNotExported("./features/internal/file.js".to_string(), p5)), - ]; - - for (comment, path, request, error) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!(resolution, Err(error), "{comment} {path:?} {request}"); - } -} - -// resolve using exports field, not a browser field #1 -#[test] -fn exports_not_browser_field1() { - let f = super::fixture().join("exports-field"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - condition_names: vec!["webpack".into()], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "exports-field/dist/main.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("node_modules/exports-field/lib/lib2/main.js"))); -} - -// resolve using exports field and a browser alias field #2 -#[test] -fn exports_not_browser_field2() { - let f2 = super::fixture().join("exports-field2"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - extensions: vec![".js".into()], - condition_names: vec!["node".into()], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f2, "exports-field/dist/main.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f2.join("node_modules/exports-field/lib/browser.js"))); -} - -// should resolve extension without fullySpecified -#[test] -fn extension_without_fully_specified() { - let f2 = super::fixture().join("exports-field2"); - - let commonjs_resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - let resolved_path = - commonjs_resolver.resolve(&f2, "exports-field/dist/main").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f2.join("node_modules/exports-field/lib/lib2/main.js"))); -} - -#[test] -fn field_name_path() { - let f2 = super::fixture().join("exports-field2"); - let f3 = super::fixture().join("exports-field3"); - - // field name path #1 #2 #3 - let exports_fields = [ - vec![vec!["exportsField".into(), "exports".into()]], - vec![vec!["exportsField".into(), "exports".into()], vec!["exports".into()]], - vec![vec!["exports".into()], vec!["exportsField".into(), "exports".into()]], - ]; - - for exports_fields in exports_fields { - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - exports_fields, - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/main.js"))); - } - - // field name path #4 - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - exports_fields: vec![vec!["exports".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f2, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f2.join("node_modules/exports-field/index.js"))); - - // field name path #5 - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - exports_fields: vec![vec!["ex".into()], vec!["exports_field".into(), "exports".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/index"))); - - // non-compliant export targeting a directory - let resolver = Resolver::new(ResolveOptions { - exports_fields: vec![vec!["broken".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/src/index.js"))); -} - -#[test] -fn shared_resolvers() { - let f3 = super::fixture().join("exports-field3"); - - let resolver1 = Resolver::new(ResolveOptions { - exports_fields: vec![vec!["exportsField".into(), "exports".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver1.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/main.js"))); - - let resolver2 = resolver1.clone_with_options(ResolveOptions { - exports_fields: vec![vec!["ex".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver2.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/index"))); -} - -#[test] -fn extension_alias_1_2() { - let f = super::fixture().join("exports-field-and-extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - extension_alias: vec![(".js".into(), vec![".ts".into(), ".js".into()])], - fully_specified: true, - condition_names: vec!["webpack".into(), "default".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve with the `extensionAlias` option", f.clone(), "@org/pkg/string.js", f.join("node_modules/@org/pkg/dist/string.js")), - ("should resolve with the `extensionAlias` option #2", f.clone(), "pkg/string.js", f.join("node_modules/pkg/dist/string.js")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn extension_alias_3() { - let f = super::fixture().join("exports-field-and-extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - extension_alias: vec![( - ".js".into(), - vec![".foo".into(), ".baz".into(), ".baz".into(), ".ts".into(), ".js".into()], - )], - fully_specified: true, - condition_names: vec!["webpack".into(), "default".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve with the `extensionAlias` option #3", f.clone(), "pkg/string.js", f.join("node_modules/pkg/dist/string.js")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn extension_alias_throw_error() { - let f = super::fixture().join("exports-field-and-extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - extension_alias: vec![(".js".into(), vec![".ts".into()])], - fully_specified: true, - condition_names: vec!["webpack".into(), "default".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let fail = [ - // enhanced-resolve has two test cases that are exactly the same here - // https://github.com/webpack/enhanced-resolve/blob/a998c7d218b7a9ec2461fc4fddd1ad5dd7687485/test/exportsField.test.js#L2976-L3024 - ("should throw error with the `extensionAlias` option", f.clone(), "pkg/string.js", ResolveError::ExtensionAlias(f.join("node_modules/pkg/dist/string.js"))), - // TODO: The error is PackagePathNotExported in enhanced-resolve - // ("should throw error with the `extensionAlias` option", f.clone(), "pkg/string.js", ResolveError::PackagePathNotExported("node_modules/pkg/dist/string.ts".to_string())), - ]; - - for (comment, path, request, error) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!(resolution, Err(error), "{comment} {path:?} {request}"); - } -} - -// Small script for generating the test cases from enhanced-resolve -// for (c of testCases) { -// console.log("TestCase {") -// console.log(`name: ${JSON.stringify(c.name)},`) -// if (c.expect instanceof Error) { -// console.log(`expect: None,`) -// } else { -// console.log(`expect: Some(vec!${JSON.stringify(c.expect)}),`) -// } -// console.log(`exports_field: exports_field(json!(${JSON.stringify(c.suite[0], null, 2)})),`) -// console.log(`request: "${c.suite[1]}",`) -// console.log(`condition_names: vec!${JSON.stringify(c.suite[2])},`) -// console.log("},") -//} -struct TestCase { - name: &'static str, - expect: Option>, - exports_field: serde_json::Value, - request: &'static str, - condition_names: Vec<&'static str>, -} - -#[allow(clippy::needless_pass_by_value)] -fn exports_field(value: serde_json::Value) -> serde_json::Value { - value -} - -#[test] -fn test_cases() { - let test_cases = [ - TestCase { - name: "sample #1", - expect: Some(vec!["./dist/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/": { - "import": [ - "./dist/", - "./src/" - ], - "webpack": "./wp/" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "sample #1", - expect: Some(vec!["./src/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/": { - "import": [ - "./src/" - ], - "webpack": "./wp/" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - TestCase { - name: "sample #1 (wildcard)", - expect: Some(vec!["./dist/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/*": { - "import": [ - "./dist/*", - "./src/*" - ], - "webpack": "./wp/*" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "sample #1 (wildcard)", - expect: Some(vec!["./src/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/*": { - "import": [ - "./src/*" - ], - "webpack": "./wp/*" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - TestCase { - name: "sample #2", - expect: Some(vec!["./data/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./timezones/": "./data/timezones/" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #2 (wildcard)", - expect: Some(vec!["./data/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./timezones/*": "./data/timezones/*" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #3", - expect: Some(vec!["./data/timezones/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./": "./data/timezones/" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #3 (wildcard)", - expect: Some(vec!["./data/timezones/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./*": "./data/timezones/*.mjs" - })), - request: "./timezones/pdt", - condition_names: vec![], - }, - TestCase { - name: "sample #4", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./lib/": { - "browser": [ - "./browser/" - ] - }, - "./dist/index.js": { - "node": "./index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #4 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "node": "./index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #5", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/": { - "browser": [ - "./browser/" - ] - }, - "./dist/index.js": { - "node": "./index.js", - "default": "./browser/index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #5 (wildcard)", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "node": "./index.js", - "default": "./browser/index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./dist/a": "./dist/index.js" - })), - request: "./dist/aaa", - condition_names: vec![], - }, - TestCase { - name: "sample #7", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./dist/a/a/": "./dist/index.js" - })), - request: "./dist/a/a", - condition_names: vec![], - }, - TestCase { - name: "sample #7 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./dist/a/a/*": "./dist/index.js" - })), - request: "./dist/a/a", - condition_names: vec![], - }, - TestCase { - name: "sample #8", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": "./index.js" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #9", - expect: Some(vec!["./main.js"]), - exports_field: exports_field(json!({ - "./index.js": "./main.js" - })), - request: "./index.js", - condition_names: vec![], - }, - TestCase { - name: "sample #10", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #11", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./bar#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #12", - expect: Some(vec!["./ok.js#abc"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/ok.js#abc", - condition_names: vec![], - }, - TestCase { - name: "sample #12", - expect: Some(vec!["./ok.js#abc"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/ok.js#abc", - condition_names: vec![], - }, - TestCase { - name: "sample #13", - expect: Some(vec!["./ok.js?abc"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/ok.js?abc", - condition_names: vec![], - }, - TestCase { - name: "sample #14", - expect: Some(vec!["./🎉.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/🎉.js", - condition_names: vec![], - }, - TestCase { - name: "sample #15", - expect: Some(vec!["./%F0%9F%8E%89.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/%F0%9F%8E%89.js", - condition_names: vec![], - }, - TestCase { - name: "sample #16", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./🎉", - condition_names: vec![], - }, - TestCase { - name: "sample #17", - expect: Some(vec!["./other.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./%F0%9F%8E%89", - condition_names: vec![], - }, - TestCase { - name: "sample #18", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./module", - condition_names: vec![], - }, - TestCase { - name: "sample #19", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./module#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #20", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./module?foo", - condition_names: vec![], - }, - TestCase { - name: "sample #21", - expect: Some(vec!["./zizizi"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./z*z*z*" - })), - request: "./#zippi", - condition_names: vec![], - }, - TestCase { - name: "sample #22", - expect: Some(vec!["./d?e?f"]), - exports_field: exports_field(json!({ - "./a?b?c/": "./" - })), - request: "./a?b?c/d?e?f", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #1", - expect: Some(vec!["./dist/index.js"]), - exports_field: exports_field(json!({ - ".": "./dist/index.js" - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #2", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./": "./", - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #3", - expect: Some(vec!["./dist/a.js"]), - exports_field: exports_field(json!({ - "./dist/": "./dist/", - "./dist/*": "./dist/*", - "./dist*": "./dist*", - "./dist/index.js": "./dist/a.js" - })), - request: "./dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #4", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./": { - "browser": [ - "./browser/" - ] - }, - "./*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "browser": "./index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #5", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./": { - "browser": [ - "./browser/" - ] - }, - "./*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "node": "./node.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #6", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - ".": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #7", - expect: Some(vec!["./src/index.js"]), // `enhanced_resolve` is `None` - exports_field: exports_field(json!({ - ".": { - "default": "./src/index.js", - "browser": "./index.js", - "node": "./src/node/index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #8", - expect: Some(vec!["./src/index.js"]), - exports_field: exports_field(json!({ - ".": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #9", - expect: Some(vec!["./index"]), - exports_field: exports_field(json!({ - ".": "./index" - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #10", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./index": "./index.js" - })), - request: "./index", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #11", - expect: Some(vec!["./foo.js"]), - exports_field: exports_field(json!({ - "./": "./", - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #12", - expect: Some(vec!["./foo/bar/baz.js"]), - exports_field: exports_field(json!({ - "./": "./", - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo/bar/baz.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #13", - expect: Some(vec!["./foo/bar/baz.js"]), - exports_field: exports_field(json!({ - "./": "./", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo/bar/baz.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #14", - expect: Some(vec!["./foo/bar/baz.js"]), - exports_field: exports_field(json!({ - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo/bar/baz.js", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #1", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "require": "./require.js" - }, { - "import": "./import.mjs" - }] - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #2", - expect: Some(vec!["./import.mjs"]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "require": "./require.js" - }, { - "import": "./import.mjs" - }] - })), - request: ".", - condition_names: vec!["import"], - }, - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./require.js"]), - exports_field: exports_field(json!({ - ".": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./import.mjs"]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "import": "./import.mjs" - }] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./require.js"]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "require": [ - "./require.js" - ] - }, { - "import": [ - "./import.mjs", - "./import.js" - ] - }] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./import.mjs"]), - exports_field: exports_field(json!({ - ".": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "./import.mjs", - "./import.js" - ] - } - ] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./import.js"]), - exports_field: exports_field(json!({ - ".": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "./import.js" - ] - } - ] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "mapping to a folder root #1", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./timezones": "./data/timezones/" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #2", - expect: None, - exports_field: exports_field(json!({ - "./timezones/": "./data/timezones" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #3", - expect: Some(vec!["./data/timezones/pdt/index.mjs"]), - exports_field: exports_field(json!({ - "./timezones/pdt/": "./data/timezones/pdt/" - })), - request: "./timezones/pdt/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #3 (wildcard)", - expect: Some(vec!["./data/timezones/pdt/index.mjs"]), - exports_field: exports_field(json!({ - "./timezones/pdt/*": "./data/timezones/pdt/*" - })), - request: "./timezones/pdt/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #4", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./": "./timezones/" - })), - request: "./pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #4 (wildcard)", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./*": "./timezones/*" - })), - request: "./pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #5", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./": "./" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #5 (wildcard)", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./*": "./*" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #6", - expect: None, - exports_field: exports_field(json!({ - "./": "." - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #6 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "./*": "." - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #7", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": "./" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #7 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": "./*" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #1", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./": "./", - "./dist/": "./lib/" - })), - request: "./dist/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #1 (wildcard)", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./*": "./*", - "./dist/*": "./lib/*" - })), - request: "./dist/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #2", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/": "./dist/utils/", - "./dist/": "./lib/" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #2 (wildcard)", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/*": "./dist/utils/*", - "./dist/*": "./lib/*" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #3", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/index.js": "./dist/utils/index.js", - "./dist/utils/": "./dist/utils/index.mjs", - "./dist/": "./lib/" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #3 (wildcard)", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/index.js": "./dist/utils/index.js", - "./dist/utils/*": "./dist/utils/index.mjs", - "./dist/*": "./lib/*" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #4", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./": { - "browser": "./browser/" - }, - "./dist/": "./lib/" - })), - request: "./dist/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "the longest matching path prefix is prioritized #4 (wildcard)", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./*": { - "browser": "./browser/*" - }, - "./dist/*": "./lib/*" - })), - request: "./dist/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #1", - // `lodash/` does not start with './' so fallbacks to util - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "conditional mapping folder #1", - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": [ - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #1 (wildcard)", - // `lodash/` does not start with './' so fallbacks to util - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": [ - "lodash/*", - "./utils/*" - ], - "node": [ - "./utils-node/*" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "conditional mapping folder #1 (wildcard)", - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": [ - "./utils/*" - ], - "node": [ - "./utils-node/*" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #2", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./node/" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "conditional mapping folder #2 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "webpack": "./wpk/*", - "browser": [ - "lodash/*", - "./utils/*" - ], - "node": [ - "./node/*" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "conditional mapping folder #3", - expect: Some(vec!["./wpk/index.mjs"]), - exports_field: exports_field(json!({ - "./utils/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils/" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "conditional mapping folder #3 (wildcard)", - expect: Some(vec!["./wpk/index.mjs"]), - exports_field: exports_field(json!({ - "./utils/*": { - "webpack": "./wpk/*", - "browser": [ - "lodash/*", - "./utils/*" - ], - "node": [ - "./utils/*" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "incorrect exports field #1", - expect: None, - exports_field: exports_field(json!({ - "/utils/": "./a/" - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #2", - expect: None, - exports_field: exports_field(json!({ - "./utils/": "/a/" - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #3", - expect: None, - exports_field: exports_field(json!({ - "/utils/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #4", - expect: None, - exports_field: exports_field(json!({ - "./utils/": { - "browser": "/a/", - "default": "/b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #4 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "/a/", - "default": "/b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #5", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index": "./a/index.js" - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index.mjs": "./a/index.js" - })), - request: "./utils/index", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #7", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #8", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index.mjs": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - // Requests that are not `./` does not apply to `package_exports_resolve` - // TestCase { - // name: "incorrect request #1", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": "./a/" - // })), - // request: "/utils/index.mjs", - // condition_names: vec![], - // }, - // TestCase { - // name: "incorrect request #2", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": { - // "browser": "./a/", - // "default": "./b/" - // } - // })), - // request: "/utils/index.mjs", - // condition_names: vec!["browser"], - // }, - // TestCase { - // name: "incorrect request #3", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": { - // "browser": "./a/", - // "default": "./b/" - // } - // })), - // request: "../utils/index.mjs", - // condition_names: vec!["browser"], - // }, - // TestCase { - // name: "incorrect request #4", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": { - // "browser": "./a/", - // "default": "./b/" - // } - // })), - // request: "/utils/index.mjs/", - // condition_names: vec!["browser"], - // }, - TestCase { - name: "backtracking package base #1", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./../../utils/": "./dist/" - })), - request: "./../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #1 (wildcard)", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./../../utils/*": "./dist/*" - })), - request: "./../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #2", - expect: None, - exports_field: exports_field(json!({ - "../../utils/": "./dist/" - })), - request: "../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #2 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "../../utils/*": "./dist/*" - })), - request: "../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #3", - expect: None, - exports_field: exports_field(json!({ - "./utils/": "../src/" - })), - request: "./utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #3 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "./utils/*": "../src/*" - })), - request: "./utils/index", - condition_names: vec![], - }, - // enhanced-resolve does not handle backtracking here - // TestCase { - // name: "backtracking package base #4", - // expect: Some(vec!["./../src/index"]), - // exports_field: exports_field(json!({ - // "./utils/": "./../src/" - // })), - // request: "./utils/index", - // condition_names: vec![], - // }, - // TestCase { - // name: "backtracking package base #4 (wildcard)", - // expect: Some(vec!["./../src/index"]), - // exports_field: exports_field(json!({ - // "./utils/*": "./../src/*" - // })), - // request: "./utils/index", - // condition_names: vec![], - // }, - // TestCase { - // name: "backtracking package base #5", - // expect: Some(vec!["./src/../index.js"]), - // exports_field: exports_field(json!({ - // "./utils/index": "./src/../index.js" - // })), - // request: "./utils/index", - // condition_names: vec![], - // }, - TestCase { - name: "backtracking package base #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/../utils/index": "./src/../index.js" - })), - request: "./utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #7", - expect: None, - exports_field: exports_field(json!({ - "./utils/": { - "browser": "../this/" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #7", - expect: None, - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "../this/*" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #8", - // We throw "InvalidPackageTarget" - // expect: Some(vec!["./utils/../index"]), - expect: None, - exports_field: exports_field(json!({ - "./utils/": { - "browser": "./utils/../" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #8 (wildcard)", - // We throw "InvalidPackageTarget" - // expect: Some(vec!["./utils/../index"]), - expect: None, - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "./utils/../*" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #9", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./": "./src/../../", - "./dist/": "./dist/" - })), - request: "./dist/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #9 (wildcard)", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./*": "./src/../../*", - "./dist/*": "./dist/*" - })), - request: "./dist/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking target folder #1", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../../index"]), - exports_field: exports_field(json!({ - "./utils/": "./dist/" - })), - request: "./utils/timezone/../../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #1 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../../index"]), - exports_field: exports_field(json!({ - "./utils/*": "./dist/*" - })), - request: "./utils/timezone/../../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #2", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../index"]), - exports_field: exports_field(json!({ - "./utils/": "./dist/" - })), - request: "./utils/timezone/../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #2 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../index"]), - exports_field: exports_field(json!({ - "./utils/*": "./dist/*" - })), - request: "./utils/timezone/../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #3", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/target/../../index"]), - exports_field: exports_field(json!({ - "./utils/": "./dist/target/" - })), - request: "./utils/../../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #3 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/target/../../index"]), - exports_field: exports_field(json!({ - "./utils/*": "./dist/target/*" - })), - request: "./utils/../../index", - condition_names: vec![], - }, - // enhanced-resolve does not handle `node_modules` in target - TestCase { - name: "nested node_modules path #1", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": "./node_modules/" - } - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #1 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "./node_modules/*" - } - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #2", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./utils/../node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/": "./utils/../node_modules/" - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "nested node_modules path #2 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./utils/../node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": "./utils/../node_modules/*" - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "nested mapping #1", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": "./", - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested mapping #1 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": "./*", - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "nested mapping #2 (wildcard)", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #2 (wildcard)", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "nested mapping #3", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["webpack"], - }, - TestCase { - name: "nested mapping #3 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["webpack"], - }, - TestCase { - name: "nested mapping #4", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["node", "browser"], - }, - TestCase { - name: "nested mapping #4 (wildcard)", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["node", "browser"], - }, - TestCase { - name: "nested mapping #5", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node"], - }, - TestCase { - name: "nested mapping #5 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": { - "webpack": [ - "./wpck/*" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node"], - }, - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - TestCase { - name: "nested mapping #6 (wildcard)", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": { - "webpack": [ - "./wpck/*" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #6 (wildcard)", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./node/*" - ], - "default": { - "node": { - "webpack": [ - "./wpck/*" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - TestCase { - name: "nested mapping #7", - expect: Some(vec!["./y.js"]), - exports_field: exports_field(json!({ - "./a.js": { - "abc": { - "def": "./x.js" - }, - "ghi": "./y.js" - } - })), - request: "./a.js", - condition_names: vec!["abc", "ghi"], - }, - TestCase { - name: "nested mapping #8", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./a.js": { - "abc": { - "def": "./x.js", - "default": [] - }, - "ghi": "./y.js" - } - })), - request: "./a.js", - condition_names: vec!["abc", "ghi"], - }, - TestCase { - name: "syntax sugar #1", - expect: Some(vec!["./main.js"]), - exports_field: exports_field(json!("./main.js")), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #2", - expect: Some(vec![]), - exports_field: exports_field(json!("./main.js")), - request: "./lib.js", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #3", - expect: Some(vec!["./a.js"]), - exports_field: exports_field(json!(["./a.js", "./b.js"])), - request: ".", - condition_names: vec![], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "syntax sugar #3", - expect: Some(vec!["./b.js"]), - exports_field: exports_field(json!(["./b.js"])), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #4", - expect: Some(vec![]), - exports_field: exports_field(json!(["./a.js", "./b.js"])), - request: "./lib.js", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #5", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "browser": { - "default": "./index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "syntax sugar #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "browser": { - "default": "./index.js" - } - })), - request: "./lib.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "syntax sugar #7", - expect: None, - exports_field: exports_field(json!({ - "./node": "./node.js", - "browser": { - "default": "./index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "syntax sugar #8", - expect: None, - exports_field: exports_field(json!({ - "browser": { - "default": "./index.js" - }, - "./node": "./node.js" - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #1", - expect: Some(vec!["./abc/d"]), - exports_field: exports_field(json!({ - "./ab*": "./ab/*", - "./abc*": "./abc/*", - "./a*": "./a/*" - })), - request: "./abcd", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #2", - expect: Some(vec!["./abc/d/e"]), - exports_field: exports_field(json!({ - "./ab*": "./ab/*", - "./abc*": "./abc/*", - "./a*": "./a/*" - })), - request: "./abcd/e", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #3", - expect: Some(vec!["./abc/d"]), - exports_field: exports_field(json!({ - "./x/ab*": "./ab/*", - "./x/abc*": "./abc/*", - "./x/a*": "./a/*" - })), - request: "./x/abcd", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #4", - expect: Some(vec!["./abc/d/e"]), - exports_field: exports_field(json!({ - "./x/ab*": "./ab/*", - "./x/abc*": "./abc/*", - "./x/a*": "./a/*" - })), - request: "./x/abcd/e", - condition_names: vec!["browser"], - }, - TestCase { - name: "path tree edge case #1", - expect: Some(vec!["./A/b/d.js"]), - exports_field: exports_field(json!({ - "./a/": "./A/", - "./a/b/c": "./c.js" - })), - request: "./a/b/d.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #1 (wildcard)", - expect: Some(vec!["./A/b/d.js"]), - exports_field: exports_field(json!({ - "./a/*": "./A/*", - "./a/b/c": "./c.js" - })), - request: "./a/b/d.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #2", - expect: Some(vec!["./A/c.js"]), - exports_field: exports_field(json!({ - "./a/": "./A/", - "./a/b": "./b.js" - })), - request: "./a/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #2 (wildcard)", - expect: Some(vec!["./A/c.js"]), - exports_field: exports_field(json!({ - "./a/*": "./A/*", - "./a/b": "./b.js" - })), - request: "./a/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #3", - expect: Some(vec!["./A/b/d/c.js"]), - exports_field: exports_field(json!({ - "./a/": "./A/", - "./a/b/c/d": "./c.js" - })), - request: "./a/b/d/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #3 (wildcard)", - expect: Some(vec!["./A/b/d/c.js"]), - exports_field: exports_field(json!({ - "./a/*": "./A/*", - "./a/b/c/d": "./c.js" - })), - request: "./a/b/d/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #1", - expect: Some(vec!["./A/b.js"]), - exports_field: exports_field(json!({ - "./a/*.js": "./A/*.js" - })), - request: "./a/b.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #2", - expect: Some(vec!["./A/b/c.js"]), - exports_field: exports_field(json!({ - "./a/*.js": "./A/*.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #3", - expect: Some(vec!["./A/b/c.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": "./A/*/c.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #4", - expect: Some(vec!["./A/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": "./A/*/*.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #5", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/*.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #5", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/*.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./lib/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #6", - expect: Some(vec!["./browser/foo/bar.js"]), - exports_field: exports_field(json!({ - "./lib/*/bar.js": { - "browser": [ - "./browser/*/bar.js" - ] - }, - "./dist/*/bar.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./lib/foo/bar.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #6", - expect: Some(vec!["./browser/foo.js"]), - exports_field: exports_field(json!({ - "./lib/*/bar.js": { - "browser": [ - "./browser/*/bar.js" - ] - }, - "./dist/*/bar.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./dist/foo/bar.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #7", - expect: Some(vec!["./browser/foo/default.js"]), - exports_field: exports_field(json!({ - "./lib/*/bar.js": { - "browser": [ - "./browser/*/bar.js" - ] - }, - "./dist/*/bar.js": { - "node": "./*.js", - "default": "./browser/*/default.js" - } - })), - request: "./dist/foo/bar.js", - condition_names: vec!["default"], - }, - TestCase { - name: "wildcard pattern #8", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": "./A/*/*/*.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #9", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": [ - "./A/*/*/*.js", - "./B/*/*/*.js" - ] - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "wildcard pattern #9", - expect: Some(vec!["./B/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": [ - "./B/*/*/*.js" - ] - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #10", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/foo-*/c.js": "./A/*/*/*.js" - })), - request: "./a/foo-b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #11", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*-foo/c.js": "./A/*/*/*.js" - })), - request: "./a/b-foo/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #12", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/foo-*-foo/c.js": "./A/*/*/*.js" - })), - request: "./a/foo-b-foo/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #13", - expect: Some(vec!["./A/b/c/d.js"]), - exports_field: exports_field(json!({ - "./a/foo-*-foo/c.js": "./A/b/c/d.js" - })), - request: "./a/foo-b-foo/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #14", - expect: Some(vec!["./A/b/c/*.js"]), - exports_field: exports_field(json!({ - "./a/foo-foo/c.js": "./A/b/c/*.js" - })), - request: "./a/foo-foo/c.js", - condition_names: vec![], - }, - ]; - - for case in test_cases { - let resolved = Resolver::new(ResolveOptions { - condition_names: case - .condition_names - .iter() - .map(ToString::to_string) - .collect::>(), - ..ResolveOptions::default() - }) - .package_exports_resolve( - Path::new(""), - case.request, - &case.exports_field, - &mut Ctx::default(), - ) - .map(|p| p.map(|p| p.to_path_buf())); - if let Some(expect) = case.expect { - if expect.is_empty() { - assert!( - matches!(resolved, Err(ResolveError::PackagePathNotExported(_, _))), - "{} {:?}", - &case.name, - &resolved - ); - } else { - for expect in expect { - assert_eq!(resolved, Ok(Some(Path::new(expect).normalize())), "{}", &case.name); - } - } - } else { - assert!(resolved.is_err(), "{} {resolved:?}", &case.name); - } - } -} diff --git a/src/tests/extension_alias.rs b/src/tests/extension_alias.rs deleted file mode 100644 index cc6a906b..00000000 --- a/src/tests/extension_alias.rs +++ /dev/null @@ -1,70 +0,0 @@ -//! - -use crate::{ResolveError, ResolveOptions, Resolver}; - -#[test] -fn extension_alias() { - let f = super::fixture().join("extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - extension_alias: vec![ - (".js".into(), vec![".ts".into(), ".js".into()]), - (".mjs".into(), vec![".mts".into()]), - ], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should alias fully specified file", f.clone(), "./index.js", f.join("index.ts")), - ("should alias fully specified file when there are two alternatives", f.clone(), "./dir/index.js", f.join("dir/index.ts")), - ("should also allow the second alternative", f.clone(), "./dir2/index.js", f.join("dir2/index.js")), - ("should support alias option without an array", f.clone(), "./dir2/index.mjs", f.join("dir2/index.mts")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } - - #[rustfmt::skip] - let fail = [ - ("should not allow to fallback to the original extension or add extensions", f.clone(), "./index.mjs"), - ]; - - for (comment, path, request) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!( - resolution, - Err(ResolveError::ExtensionAlias(f.join(request))), - "{comment} {path:?} {request}" - ); - } -} - -// should not apply extension alias to extensions or mainFiles field -#[test] -fn not_apply_to_extension_nor_main_files() { - let f = super::fixture().join("extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - extension_alias: vec![(".js".into(), vec![])], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("directory", f.clone(), "./dir2", "dir2/index.js"), - ("file", f.clone(), "./dir2/index", "dir2/index.js"), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - let expected = f.join(expected); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} diff --git a/src/tests/extensions.rs b/src/tests/extensions.rs deleted file mode 100644 index 1ebd86f4..00000000 --- a/src/tests/extensions.rs +++ /dev/null @@ -1,125 +0,0 @@ -//! - -use crate::{EnforceExtension, Resolution, ResolveContext, ResolveError, ResolveOptions, Resolver}; -use rustc_hash::FxHashSet; - -#[test] -fn extensions() { - let f = super::fixture().join("extensions"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".ts".into(), ".js".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve according to order of provided extensions", "./foo", "foo.ts"), - ("should resolve according to order of provided extensions (dir index)", "./dir", "dir/index.ts"), - ("should resolve according to main field in module root", ".", "index.js"), - // This is a core module - // ("should resolve single file module before directory", "module", "node_modules/module.js"), - ("should resolve trailing slash directory before single file", "module/", "node_modules/module/index.ts"), - ]; - - for (comment, request, expected_path) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - let expected = f.join(expected_path); - assert_eq!(resolved_path, Ok(expected), "{comment} {request} {expected_path}"); - } - - #[rustfmt::skip] - let fail = [ - ("not resolve to file when request has a trailing slash (relative)", "./foo.js/", "./foo.js/".into()) - ]; - - for (comment, request, expected_error) in fail { - let resolution = resolver.resolve(&f, request); - let error = ResolveError::NotFound(expected_error); - assert_eq!(resolution, Err(error), "{comment} {request} {resolution:?}"); - } -} - -// should default enforceExtension to true when extensions includes an empty string -#[test] -fn default_enforce_extension() { - let f = super::fixture().join("extensions"); - - let mut ctx = ResolveContext::default(); - let resolved = Resolver::new(ResolveOptions { - extensions: vec![".ts".into(), String::new(), ".js".into()], - ..ResolveOptions::default() - }) - .resolve_with_context(&f, "./foo", &mut ctx); - - assert_eq!(resolved.map(Resolution::into_path_buf), Ok(f.join("foo.ts"))); - assert_eq!( - ctx.file_dependencies, - FxHashSet::from_iter([f.join("foo.ts"), f.join("package.json")]) - ); - assert!(ctx.missing_dependencies.is_empty()); -} - -// should respect enforceExtension when extensions includes an empty string -#[test] -fn respect_enforce_extension() { - let f = super::fixture().join("extensions"); - - let mut ctx = ResolveContext::default(); - let resolved = Resolver::new(ResolveOptions { - enforce_extension: EnforceExtension::Disabled, - extensions: vec![".ts".into(), String::new(), ".js".into()], - ..ResolveOptions::default() - }) - .resolve_with_context(&f, "./foo", &mut ctx); - - assert_eq!(resolved.map(Resolution::into_path_buf), Ok(f.join("foo.ts"))); - assert_eq!( - ctx.file_dependencies, - FxHashSet::from_iter([f.join("foo.ts"), f.join("package.json")]) - ); - assert_eq!(ctx.missing_dependencies, FxHashSet::from_iter([f.join("foo")])); -} - -#[test] -fn multi_dot_extension() { - let f = super::fixture().join("extensions"); - - let resolver = Resolver::new(ResolveOptions { - // Test for `.d.ts`, not part of enhanced-resolve. - extensions: vec![".a.b.c".into(), ".d.ts".into(), ".ts".into(), ".js".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve according to order of provided extensions", "./foo", "foo.ts"), - ("should resolve file with extension", "./app.module", "app.module.js") - ]; - - for (comment, request, expected_path) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - let expected = f.join(expected_path); - assert_eq!(resolved_path, Ok(expected), "{comment} {request} {expected_path}"); - } - - #[rustfmt::skip] - let fail = [ - ("not resolve to file", "./index.", "./index.".into()) - ]; - - for (comment, request, expected_error) in fail { - let resolution = resolver.resolve(&f, request); - let error = ResolveError::NotFound(expected_error); - assert_eq!(resolution, Err(error), "{comment} {request} {resolution:?}"); - } -} - -#[test] -#[should_panic = "All extensions must start with a leading dot"] -fn without_leading_dot() { - Resolver::new(ResolveOptions { - extensions: vec!["ts".into(), "js".into()], - ..ResolveOptions::default() - }); -} diff --git a/src/tests/fallback.rs b/src/tests/fallback.rs deleted file mode 100644 index 3da2d767..00000000 --- a/src/tests/fallback.rs +++ /dev/null @@ -1,100 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/fallback.test.js - -#[test] -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -fn fallback() { - use super::memory_fs::MemoryFS; - use crate::{AliasValue, ResolveError, ResolveOptions, ResolverGeneric}; - use std::path::{Path, PathBuf}; - - let f = Path::new("/"); - - let file_system = MemoryFS::new(&[ - ("/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", ""), - ]); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - fallback: vec![ - ("aliasA".into(), vec![AliasValue::Path("a".into())]), - ("b$".into(), vec![AliasValue::Path("a/index".into())]), - ("c$".into(), vec![AliasValue::Path("/a/index".into())]), - ( - "multiAlias".into(), - vec![ - AliasValue::Path("b".into()), - AliasValue::Path("c".into()), - AliasValue::Path("d".into()), - AliasValue::Path("e".into()), - AliasValue::Path("a".into()), - ], - ), - ("recursive".into(), vec![AliasValue::Path("recursive/dir".into())]), - ("/d/dir".into(), vec![AliasValue::Path("/c/dir".into())]), - ("/d/index.js".into(), vec![AliasValue::Path("/c/index".into())]), - ("ignored".into(), vec![AliasValue::Ignore]), - ("node:path".into(), vec![AliasValue::Ignore]), - ], - modules: vec!["/".into()], - ..ResolveOptions::default() - }, - ); - - #[rustfmt::skip] - let pass = [ - ("should resolve a not aliased module 1", "a", "/a/index"), - ("should resolve a not aliased module 2", "a/index", "/a/index"), - ("should resolve a not aliased module 3", "a/dir", "/a/dir/index"), - ("should resolve a not aliased module 4", "a/dir/index", "/a/dir/index"), - ("should resolve an fallback module 1", "aliasA", "/a/index"), - ("should resolve an fallback module 2", "aliasA/index", "/a/index"), - ("should resolve an fallback module 3", "aliasA/dir", "/a/dir/index"), - ("should resolve an fallback module 4", "aliasA/dir/index", "/a/dir/index"), - ("should resolve a recursive aliased module 1", "recursive", "/recursive/index"), - ("should resolve a recursive aliased module 2", "recursive/index", "/recursive/index"), - ("should resolve a recursive aliased module 3", "recursive/dir", "/recursive/dir/index"), - ("should resolve a recursive aliased module 4", "recursive/dir/index", "/recursive/dir/index"), - ("should resolve a recursive aliased module 5", "recursive/file", "/recursive/dir/file"), - ("should resolve a file aliased module with a query 1", "b?query", "/b/index?query"), - ("should resolve a file aliased module with a query 2", "c?query", "/c/index?query"), - ("should resolve a path in a file aliased module 1", "b/index", "/b/index"), - ("should resolve a path in a file aliased module 2", "b/dir", "/b/dir/index"), - ("should resolve a path in a file aliased module 3", "b/dir/index", "/b/dir/index"), - ("should resolve a path in a file aliased module 4", "c/index", "/c/index"), - ("should resolve a path in a file aliased module 5", "c/dir", "/c/dir/index"), - ("should resolve a path in a file aliased module 6", "c/dir/index", "/c/dir/index"), - ("should resolve a file in multiple aliased dirs 1", "multiAlias/dir/file", "/e/dir/file"), - ("should resolve a file in multiple aliased dirs 2", "multiAlias/anotherDir", "/e/anotherDir/index"), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - - #[rustfmt::skip] - let ignore = [ - ("should resolve an ignore module", "ignored", ResolveError::Ignored(f.join("ignored"))), - ("should resolve node: builtin module", "node:path", ResolveError::Ignored(PathBuf::from("/node:path"))), - ]; - - for (comment, request, expected) in ignore { - let resolution = resolver.resolve(f, request); - assert_eq!(resolution, Err(expected), "{comment} {request}"); - } -} diff --git a/src/tests/full_specified.rs b/src/tests/full_specified.rs deleted file mode 100644 index a70c0191..00000000 --- a/src/tests/full_specified.rs +++ /dev/null @@ -1,113 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/fullSpecified.test.js - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows { - use std::path::PathBuf; - - use crate::{AliasValue, ResolveOptions, ResolverGeneric}; - - use super::super::memory_fs::MemoryFS; - - fn file_system() -> MemoryFS { - MemoryFS::new(&[ - ("/a/node_modules/package1/index.js", ""), - ("/a/node_modules/package1/file.js", ""), - ("/a/node_modules/package2/package.json", r#"{"main":"a"}"#), - ("/a/node_modules/package2/a.js", ""), - ("/a/node_modules/package3/package.json", r#"{"main":"dir"}"#), - ("/a/node_modules/package3/dir/index.js", ""), - ("/a/node_modules/package4/package.json", r#"{"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", ""), - ]) - } - - #[test] - fn test() { - let file_system = file_system(); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - alias: vec![ - ("alias1".into(), vec![AliasValue::from("/a/abc")]), - ("alias2".into(), vec![AliasValue::from("/a")]), - ], - alias_fields: vec![vec!["browser".into()]], - fully_specified: true, - ..ResolveOptions::default() - }, - ); - - let failing_resolves = [ - ("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"), - ]; - - for (comment, request) in failing_resolves { - let resolution = resolver.resolve("/a", request); - assert!(resolution.is_err(), "{comment} {request}"); - } - - let successful_resolves = [ - ("fully relative", "./abc.js", "/a/abc.js"), - ("fully absolute", "/a/abc.js", "/a/abc.js"), - ("fully relative in package", "package1/file.js", "/a/node_modules/package1/file.js"), - ("extensions in mainFiles", "package1", "/a/node_modules/package1/index.js"), - ("extensions in mainFields", "package2", "/a/node_modules/package2/a.js"), - ("extensions in alias", "alias1", "/a/abc.js"), - ("directories in alias", "alias2", "/a/index.js"), - ("directories in packages", "package3", "/a/node_modules/package3/dir/index.js"), - ("extensions in aliasFields", "package4/a.js", "/a/node_modules/package4/b.js"), - ]; - - for (comment, request, expected) in successful_resolves { - let resolution = resolver.resolve("/a", request).map(|r| r.full_path()); - assert_eq!(resolution, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - } - - #[test] - #[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. - fn resolve_to_context() { - let file_system = file_system(); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - alias: vec![ - ("alias1".into(), vec![AliasValue::from("/a/abc")]), - ("alias2".into(), vec![AliasValue::from("/a")]), - ], - alias_fields: vec![vec!["browser".into()]], - fully_specified: true, - resolve_to_context: true, - ..ResolveOptions::default() - }, - ); - - let successful_resolves = [ - ("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", "/a/node_modules/package3/dir"), - ]; - - for (comment, request, expected) in successful_resolves { - let resolution = resolver.resolve("/a", request).map(|r| r.full_path()); - assert_eq!(resolution, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - } -} diff --git a/src/tests/imports_field.rs b/src/tests/imports_field.rs deleted file mode 100644 index c928627a..00000000 --- a/src/tests/imports_field.rs +++ /dev/null @@ -1,1320 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/importsField.test.js -//! -//! The huge imports field test cases are at the bottom of this file. - -use serde_json::json; - -use crate::{Ctx, JSONMap, PathUtil, ResolveError, ResolveOptions, Resolver}; -use std::path::Path; - -#[test] -fn test_simple() { - let f = super::fixture().join("imports-field"); - let f2 = super::fixture().join("imports-exports-wildcard/node_modules/m/"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve using imports field instead of self-referencing", f.clone(), "#imports-field", f.join("b.js")), - ("should resolve using imports field instead of self-referencing for a subpath", f.join("dir"), "#imports-field", f.join("b.js")), - ("should resolve package #1", f.clone(), "#a/dist/main.js", f.join("node_modules/a/lib/lib2/main.js")), - ("should resolve package #3", f.clone(), "#ccc/index.js", f.join("node_modules/c/index.js")), - ("should resolve package #4", f.clone(), "#c", f.join("node_modules/c/index.js")), - ("should resolve with wildcard pattern", f2.clone(), "#internal/i.js", f2.join("src/internal/i.js")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } - - // Note added: - // * should resolve absolute path as an imports field target - // * should log the correct info - - #[rustfmt::skip] - let fail = [ - ("should disallow resolve out of package scope", f.clone(), "#b", ResolveError::InvalidPackageTarget("../b.js".to_string(), "#b".to_string(), f.join("package.json"))), - ("should resolve package #2", f.clone(), "#a", ResolveError::PackageImportNotDefined("#a".to_string(), f.join("package.json"))), - ]; - - for (comment, path, request, error) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!(resolution, Err(error), "{comment} {path:?} {request}"); - } -} - -#[test] -fn shared_resolvers() { - let f = super::fixture().join("imports-field"); - - // field name #1 - let resolver1 = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - imports_fields: vec![vec!["imports".into()]], - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - let resolved_path = resolver1.resolve(&f, "#imports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("b.js"))); - - // field name #2 - let resolver2 = resolver1.clone_with_options(ResolveOptions { - imports_fields: vec![vec!["other".into(), "imports".into()]], - ..ResolveOptions::default() - }); - - let resolved_path = resolver2.resolve(&f, "#b").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("a.js"))); -} - -// Small script for generating the test cases from enhanced_resolve -// for (c of testCases) { -// console.log("TestCase {") -// console.log(`name: ${JSON.stringify(c.name)},`) -// if (c.expect instanceof Error) { -// console.log(`expect: None,`) -// } else { -// console.log(`expect: Some(vec!${JSON.stringify(c.expect)}),`) -// } -// console.log(`imports_field: imports_field(json!(${JSON.stringify(c.suite[0], null, 2)})),`) -// console.log(`request: "${c.suite[1]}",`) -// console.log(`condition_names: vec!${JSON.stringify(c.suite[2])},`) -// console.log("},") -// } - -struct TestCase { - name: &'static str, - expect: Option>, - imports_field: JSONMap, - request: &'static str, - condition_names: Vec<&'static str>, -} - -#[allow(clippy::needless_pass_by_value)] -fn imports_field(value: serde_json::Value) -> JSONMap { - let s = serde_json::to_string(&value).unwrap(); - serde_json::from_str(&s).unwrap() -} - -#[test] -fn test_cases() { - let test_cases = [ - TestCase { - name: "sample #1", - expect: Some(vec!["./dist/test/file.js"]), - imports_field: imports_field(json!({ - "#abc/": { - "import": [ - "./dist/", - "./src/" - ], - "webpack": "./wp/" - }, - "#abc": "./main.js" - })), - request: "#abc/test/file.js", - condition_names: vec!["import", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "sample #1", - expect: Some(vec!["./src/test/file.js"]), - imports_field: imports_field(json!({ - "#abc/": { - "import": [ - "./src/" - ], - "webpack": "./wp/" - }, - "#abc": "./main.js" - })), - request: "#abc/test/file.js", - condition_names: vec!["import", "webpack"], - }, - TestCase { - name: "sample #2", - expect: Some(vec!["./data/timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#1/timezones/": "./data/timezones/" - })), - request: "#1/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #3", - expect: Some(vec!["./data/timezones/timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#aaa/": "./data/timezones/", - "#a/": "./data/timezones/" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #4", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/lib/": { - "browser": [ - "./browser/" - ] - }, - "#a/dist/index.js": { - "node": "./index.js" - } - })), - request: "#a/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #5", - expect: Some(vec!["./browser/index.js"]), - imports_field: imports_field(json!({ - "#a/lib/": { - "browser": [ - "./browser/" - ] - }, - "#a/dist/index.js": { - "node": "./index.js", - "default": "./browser/index.js" - } - })), - request: "#a/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #6", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/dist/a": "./dist/index.js" - })), - request: "#a/dist/aaa", - condition_names: vec![], - }, - TestCase { - name: "sample #7", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/a/a/": "./dist/index.js" - })), - request: "#a/a/a", - condition_names: vec![], - }, - TestCase { - name: "sample #8", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": "./index.js" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #9", - expect: Some(vec!["./main.js"]), - imports_field: imports_field(json!({ - "#a/index.js": "./main.js" - })), - request: "#a/index.js", - condition_names: vec![], - }, - TestCase { - name: "sample #10", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #11", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/bar#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #12", - expect: Some(vec!["./ok.js#abc"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/ok.js#abc", - condition_names: vec![], - }, - TestCase { - name: "sample #13", - expect: Some(vec!["./ok.js?abc"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/ok.js?abc", - condition_names: vec![], - }, - TestCase { - name: "sample #14", - expect: Some(vec!["./🎉.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/🎉.js", - condition_names: vec![], - }, - TestCase { - name: "sample #15", - expect: Some(vec!["./%F0%9F%8E%89.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/%F0%9F%8E%89.js", - condition_names: vec![], - }, - TestCase { - name: "sample #16", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/🎉", - condition_names: vec![], - }, - TestCase { - name: "sample #17", - expect: Some(vec!["./other.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/%F0%9F%8E%89", - condition_names: vec![], - }, - TestCase { - name: "sample #18", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/module", - condition_names: vec![], - }, - TestCase { - name: "sample #19", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/module#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #20", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/module?foo", - condition_names: vec![], - }, - TestCase { - name: "sample #21", - expect: Some(vec!["./d?e?f"]), - imports_field: imports_field(json!({ - "#a/a?b?c/": "./" - })), - request: "#a/a?b?c/d?e?f", - condition_names: vec![], - }, - TestCase { - name: "sample #22", - // We throw InvalidPackageTarget - expect: None, - // expect: Some(vec!["/user/a/index"]), - imports_field: imports_field(json!({ - "#a/": "/user/a/" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #1", - expect: Some(vec!["./A/b/d.js"]), - imports_field: imports_field(json!({ - "#a/": "./A/", - "#a/b/c": "./c.js" - })), - request: "#a/b/d.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #2", - expect: Some(vec!["./A/c.js"]), - imports_field: imports_field(json!({ - "#a/": "./A/", - "#a/b": "./b.js" - })), - request: "#a/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #3", - expect: Some(vec!["./A/b/c/d.js"]), - imports_field: imports_field(json!({ - "#a/": "./A/", - "#a/b/c/d": "./c.js" - })), - request: "#a/b/c/d.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #1", - expect: Some(vec!["./dist/index.js"]), - imports_field: imports_field(json!({ - "#a": "./dist/index.js" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #2", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": "./" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #3", - expect: Some(vec!["./dist/a.js"]), - imports_field: imports_field(json!({ - "#a/": "./dist/", - "#a/index.js": "./dist/a.js" - })), - request: "#a/index.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #4", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "./browser/" - ] - }, - "#a/index.js": { - "browser": "./index.js" - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #5", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "./browser/" - ] - }, - "#a/index.js": { - "node": "./node.js" - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #6", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: "#a", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #7", - expect: Some(vec!["./src/index.js"]), // `enhanced_resolve` is `None` - imports_field: imports_field(json!({ - "#a": { - "default": "./src/index.js", - "browser": "./index.js", - "node": "./src/node/index.js" - } - })), - request: "#a", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #8", - expect: Some(vec!["./src/index.js"]), - imports_field: imports_field(json!({ - "#a": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #9", - expect: Some(vec!["./index"]), - imports_field: imports_field(json!({ - "#a": "./index" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #10", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/index": "./index.js" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #11", - // We throw InvalidPackageTarget - // expect: Some(vec!["b"]), - expect: None, - imports_field: imports_field(json!({ - "#a": "b" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #12", - // We throw InvalidPackageTarget - // expect: Some(vec!["b/index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "b/" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #13", - // We throw InvalidPackageTarget - // expect: Some(vec!["b#anotherhashishere"]), - expect: None, - imports_field: imports_field(json!({ - "#a?q=a#hashishere": "b#anotherhashishere" - })), - request: "#a?q=a#hashishere", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #1", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #2", - expect: Some(vec!["./import.mjs"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec!["import"], - }, - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./require.js"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./import.mjs"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./require.js"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": [ - "./require.js" - ] - }, - { - "import": [ - "./import.mjs", - "#b/import.js" - ] - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./import.mjs"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "./import.mjs", - "#b/import.js" - ] - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "#b/import.js" - ] - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "mapping to a folder root #1", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#timezones": "./data/timezones/" - })), - request: "#timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #2", - expect: None, - imports_field: imports_field(json!({ - "#timezones/": "./data/timezones" - })), - request: "#timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #3", - expect: Some(vec!["./data/timezones/pdt/index.mjs"]), - imports_field: imports_field(json!({ - "#timezones/pdt/": "./data/timezones/pdt/" - })), - request: "#timezones/pdt/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #4", - expect: Some(vec!["./timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#a/": "./timezones/" - })), - request: "#a/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #5", - expect: Some(vec!["./timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#a/": "./" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #6", - expect: None, - imports_field: imports_field(json!({ - "#a/": "." - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #7", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": "./" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #1", - expect: Some(vec!["./lib/index.mjs"]), - imports_field: imports_field(json!({ - "#a/": "./", - "#a/dist/": "./lib/" - })), - request: "#a/dist/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #2", - expect: Some(vec!["./dist/utils/index.js"]), - imports_field: imports_field(json!({ - "#a/dist/utils/": "./dist/utils/", - "#a/dist/": "./lib/" - })), - request: "#a/dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #3", - expect: Some(vec!["./dist/utils/index.js"]), - imports_field: imports_field(json!({ - "#a/dist/utils/index.js": "./dist/utils/index.js", - "#a/dist/utils/": "./dist/utils/index.mjs", - "#a/dist/": "./lib/" - })), - request: "#a/dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #4", - expect: Some(vec!["./lib/index.mjs"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./browser/" - }, - "#a/dist/": "./lib/" - })), - request: "#a/dist/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #1", - // This behaves differently from enhanced_resolve, because `lodash/` is an an InvalidPackageConfig - // expect: Some(vec!["lodash/index.js"]), - expect: Some(vec!["./utils/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "conditional mapping folder #1", - expect: Some(vec!["./utils/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #2", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./node/" - ] - } - })), - request: "#a/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "conditional mapping folder #3", - expect: Some(vec!["./wpk/index.mjs"]), - imports_field: imports_field(json!({ - "#a/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils/" - ] - } - })), - request: "#a/index.mjs", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "incorrect exports field #1", - // We throw `PackageImportNotDefined` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "/utils/": "./a/" - })), - request: "#a/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #2", - // We throw `PackageImportNotDefined` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "/utils/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#a/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #3", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index": "./a/index.js" - })), - request: "#a/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #4", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index.mjs": "./a/index.js" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #5", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "#a/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #6", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index.mjs": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "#a/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #1", - // We don't throw in `package_imports_exports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": "./a/" - })), - request: "/utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect request #2", - // We don't throw in `package_imports_exports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #3", - // We don't throw in `package_imports_exports_resolve`, it's thrown in `package_imports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #4", - // We don't throw in `package_imports_exports_resolve`, it's thrown in `package_imports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#/", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #5", - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#a/", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #1", - // expect: Some(vec!["./dist/index"]), - expect: Some(vec!["dist/index"]), - imports_field: imports_field(json!({ - "#a/../../utils/": "./dist/" - })), - request: "#a/../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #2", - // We throw InvalidPackageTarget - // expect: Some(vec!["./dist/../../utils/index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "./dist/" - })), - request: "#a/../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #3", - // We throw InvalidPackageTarget - // expect: Some(vec!["../src/index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "../src/" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #4", - // We throw InvalidPackageTarget - // expect: Some(vec!["./utils/../../../index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": { - "browser": "./utils/../../../" - } - })), - request: "#a/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #1", - // expect: Some(vec!["moment/node_modules/lodash/dist/index.js"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": { - "browser": "moment/node_modules/" - } - })), - request: "#a/lodash/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #2", - // We throw InvalidPackageTarget - // expect: Some(vec!["../node_modules/lodash/dist/index.js"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "../node_modules/" - })), - request: "#a/lodash/dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "nested mapping #1", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": "./", - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./node/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "nested mapping #3", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["webpack"], - }, - TestCase { - name: "nested mapping #4", - // We throw NotFound - // expect: Some(vec!["moment/node/index.js"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "moment/node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["node", "browser"], - }, - TestCase { - name: "nested mapping #5", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "node"], - }, - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./node/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - TestCase { - name: "nested mapping #7", - expect: Some(vec!["./y.js"]), - imports_field: imports_field(json!({ - "#a": { - "abc": { - "def": "./x.js" - }, - "ghi": "./y.js" - } - })), - request: "#a", - condition_names: vec!["abc", "ghi"], - }, - TestCase { - name: "nested mapping #8", - // We throw PackageImportNotDefined - // expect: Some(vec![]), - expect: None, - imports_field: imports_field(json!({ - "#a": { - "abc": { - "def": "./x.js", - "default": [] - }, - "ghi": "./y.js" - } - })), - request: "#a", - condition_names: vec!["abc", "ghi"], - }, - ]; - - for case in test_cases { - let resolved = Resolver::default() - .package_imports_exports_resolve( - case.request, - &case.imports_field, - Path::new(""), - true, - &case.condition_names.iter().map(ToString::to_string).collect::>(), - &mut Ctx::default(), - ) - .map(|p| p.map(|p| p.to_path_buf())); - if let Some(expect) = case.expect { - if expect.is_empty() { - assert!(matches!(resolved, Ok(None)), "{} {:?}", &case.name, &resolved); - } else { - for expect in expect { - assert_eq!(resolved, Ok(Some(Path::new(expect).normalize())), "{}", &case.name); - } - } - } else { - assert!(resolved.is_err(), "{} {resolved:?}", &case.name); - } - } -} diff --git a/src/tests/incorrect_description_file.rs b/src/tests/incorrect_description_file.rs deleted file mode 100644 index e2caecbb..00000000 --- a/src/tests/incorrect_description_file.rs +++ /dev/null @@ -1,65 +0,0 @@ -//! - -use rustc_hash::FxHashSet; - -use crate::{JSONError, Resolution, ResolveContext, ResolveError, ResolveOptions, Resolver}; - -// should not resolve main in incorrect description file #1 -#[test] -fn incorrect_description_file_1() { - let f = super::fixture().join("incorrect-package"); - let mut ctx = ResolveContext::default(); - let resolution = Resolver::default().resolve_with_context(f.join("pack1"), ".", &mut ctx); - let error = ResolveError::JSON(JSONError { - path: f.join("pack1/package.json"), - message: String::from("EOF while parsing a value at line 3 column 0"), - line: 3, - column: 0, - }); - assert_eq!(resolution, Err(error)); - assert_eq!( - ctx.file_dependencies, - FxHashSet::from_iter([f.join("pack1"), f.join("pack1/package.json")]) - ); - assert!(!ctx.missing_dependencies.is_empty()); -} - -// should not resolve main in incorrect description file #2 -#[test] -fn incorrect_description_file_2() { - let f = super::fixture().join("incorrect-package"); - let resolution = Resolver::default().resolve(f.join("pack2"), "."); - let error = ResolveError::JSON(JSONError { - path: f.join("pack2/package.json"), - message: String::from("EOF while parsing a value at line 1 column 0"), - line: 1, - column: 0, - }); - assert_eq!(resolution, Err(error)); -} - -// should not resolve main in incorrect description file #3 -#[test] -fn incorrect_description_file_3() { - let f = super::fixture().join("incorrect-package"); - let resolution = Resolver::default().resolve(f.join("pack2"), "."); - assert!(resolution.is_err()); -} - -// `enhanced_resolve` does not have this test case -#[test] -fn no_description_file() { - let f = super::fixture_root().join("enhanced_resolve"); - - // has description file - let resolver = Resolver::default(); - assert_eq!( - resolver.resolve(&f, ".").map(Resolution::into_path_buf), - Ok(f.join("lib/index.js")) - ); - - // without description file - let resolver = - Resolver::new(ResolveOptions { description_files: vec![], ..ResolveOptions::default() }); - assert_eq!(resolver.resolve(&f, "."), Err(ResolveError::NotFound(".".into()))); -} diff --git a/src/tests/main_field.rs b/src/tests/main_field.rs deleted file mode 100644 index 3cadc8ce..00000000 --- a/src/tests/main_field.rs +++ /dev/null @@ -1,24 +0,0 @@ -//! Not part of enhanced_resolve's test suite - -use crate::{ResolveOptions, Resolver}; - -#[test] -fn test() { - let f = super::fixture().join("restrictions"); - - let resolver1 = Resolver::new(ResolveOptions { - main_fields: vec!["style".into()], - ..ResolveOptions::default() - }); - - let resolution = resolver1.resolve(&f, "pck2").map(|r| r.full_path()); - assert_eq!(resolution, Ok(f.join("node_modules/pck2/index.css"))); - - let resolver2 = resolver1.clone_with_options(ResolveOptions { - main_fields: vec!["module".into(), "main".into()], - ..ResolveOptions::default() - }); - - let resolution = resolver2.resolve(&f, "pck2").map(|r| r.full_path()); - assert_eq!(resolution, Ok(f.join("node_modules/pck2/module.js"))); -} diff --git a/src/tests/memory_fs.rs b/src/tests/memory_fs.rs deleted file mode 100644 index e4116609..00000000 --- a/src/tests/memory_fs.rs +++ /dev/null @@ -1,74 +0,0 @@ -use std::{ - io, - path::{Path, PathBuf}, -}; - -use crate::{FileMetadata, FileSystem}; - -#[derive(Default)] -pub struct MemoryFS { - fs: vfs::MemoryFS, -} - -impl MemoryFS { - /// # Panics - /// - /// * Fails to create directory - /// * Fails to write file - #[allow(dead_code)] - pub fn new(data: &[(&'static str, &'static str)]) -> Self { - let mut fs = Self { fs: vfs::MemoryFS::default() }; - for (path, content) in data { - fs.add_file(Path::new(path), content); - } - fs - } - - #[allow(dead_code)] - pub fn add_file(&mut self, path: &Path, content: &str) { - use vfs::FileSystem; - let fs = &mut self.fs; - // Create all parent directories - for path in path.ancestors().collect::>().iter().rev() { - let path = path.to_string_lossy(); - if !fs.exists(path.as_ref()).unwrap() { - fs.create_dir(path.as_ref()).unwrap(); - } - } - // Create file - let mut file = fs.create_file(path.to_string_lossy().as_ref()).unwrap(); - file.write_all(content.as_bytes()).unwrap(); - } -} - -impl FileSystem for MemoryFS { - fn read_to_string(&self, path: &Path) -> io::Result { - use vfs::FileSystem; - let mut file = self - .fs - .open_file(path.to_string_lossy().as_ref()) - .map_err(|err| io::Error::new(io::ErrorKind::NotFound, err))?; - let mut buffer = String::new(); - file.read_to_string(&mut buffer).unwrap(); - Ok(buffer) - } - - fn metadata(&self, path: &Path) -> io::Result { - use vfs::FileSystem; - let metadata = self - .fs - .metadata(path.to_string_lossy().as_ref()) - .map_err(|err| io::Error::new(io::ErrorKind::NotFound, err))?; - let is_file = metadata.file_type == vfs::VfsFileType::File; - let is_dir = metadata.file_type == vfs::VfsFileType::Directory; - Ok(FileMetadata::new(is_file, is_dir, false)) - } - - fn symlink_metadata(&self, path: &Path) -> io::Result { - self.metadata(path) - } - - fn canonicalize(&self, _path: &Path) -> io::Result { - Err(io::Error::new(io::ErrorKind::NotFound, "not a symlink")) - } -} diff --git a/src/tests/missing.rs b/src/tests/missing.rs deleted file mode 100644 index 4bf611ef..00000000 --- a/src/tests/missing.rs +++ /dev/null @@ -1,106 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/missing.test.js - -use normalize_path::NormalizePath; - -use crate::{AliasValue, ResolveContext, ResolveOptions, Resolver}; - -#[test] -fn test() { - let f = super::fixture(); - - let data = [ - ( - "./missing-file", - vec![f.join("missing-file"), f.join("missing-file.js"), f.join("missing-file.node")], - ), - ( - "missing-module", - vec![ - f.join("node_modules/missing-module"), - f.parent().unwrap().join("node_modules"), // enhanced-resolve is "node_modules/missing-module" - ], - ), - ( - "missing-module/missing-file", - vec![ - f.join("node_modules/missing-module"), - // f.parent().unwrap().join("node_modules/missing-module"), // we don't report this - ], - ), - ( - "m1/missing-file", - vec![ - f.join("node_modules/m1/missing-file"), - f.join("node_modules/m1/missing-file.js"), - f.join("node_modules/m1/missing-file.node"), - // f.parent().unwrap().join("node_modules/m1"), // we don't report this - ], - ), - ( - "m1/", - vec![ - f.join("node_modules/m1/index"), - f.join("node_modules/m1/index.js"), - f.join("node_modules/m1/index.json"), - f.join("node_modules/m1/index.node"), - ], - ), - ("m1/a", vec![f.join("node_modules/m1/a")]), - ]; - - let resolver = Resolver::default(); - - for (specifier, missing_dependencies) in data { - let mut ctx = ResolveContext::default(); - let _ = resolver.resolve_with_context(&f, specifier, &mut ctx); - - for path in ctx.file_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - } - - for path in missing_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - assert!( - ctx.missing_dependencies.contains(&path), - "{specifier}: {path:?} not in {:?}", - &ctx.missing_dependencies - ); - } - } -} - -#[test] -fn alias_and_extensions() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias: vec![ - ( - "@scope-js/package-name/dir$".into(), - vec![AliasValue::Path(f.join("foo/index.js").to_string_lossy().to_string())], - ), - ( - "react-dom".into(), - vec![AliasValue::Path(f.join("foo/index.js").to_string_lossy().to_string())], - ), - ], - extensions: vec![".server.ts".into()], - - ..ResolveOptions::default() - }); - - let mut ctx = ResolveContext::default(); - let _ = resolver.resolve_with_context(&f, "@scope-js/package-name/dir/router", &mut ctx); - let _ = resolver.resolve_with_context(&f, "react-dom/client", &mut ctx); - - for path in ctx.file_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - } - - for path in ctx.missing_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - if let Some(path) = path.parent() { - assert!(!path.is_file(), "{path:?} must not be a file"); - } - } -} diff --git a/src/tests/mod.rs b/src/tests/mod.rs deleted file mode 100644 index e347dd1f..00000000 --- a/src/tests/mod.rs +++ /dev/null @@ -1,51 +0,0 @@ -mod alias; -mod browser_field; -mod builtins; -mod dependencies; -mod exports_field; -mod extension_alias; -mod extensions; -mod fallback; -mod full_specified; -mod imports_field; -mod incorrect_description_file; -mod main_field; -mod memory_fs; -mod missing; -#[cfg(feature = "yarn_pnp")] -mod pnp; -mod resolve; -mod restrictions; -mod roots; -mod scoped_packages; -mod simple; -mod symlink; -mod tsconfig_paths; -mod tsconfig_project_references; - -use crate::Resolver; -use std::{env, path::PathBuf, sync::Arc, thread}; - -pub fn fixture_root() -> PathBuf { - env::current_dir().unwrap().join("fixtures") -} - -pub fn fixture() -> PathBuf { - fixture_root().join("enhanced_resolve").join("test").join("fixtures") -} - -#[test] -fn threaded_environment() { - let cwd = env::current_dir().unwrap(); - let resolver = Arc::new(Resolver::default()); - for _ in 0..2 { - _ = thread::spawn({ - let cwd = cwd.clone(); - let resolver = Arc::clone(&resolver); - move || { - _ = resolver.resolve(cwd, "."); - } - }) - .join(); - } -} diff --git a/src/tests/pnp.rs b/src/tests/pnp.rs deleted file mode 100644 index 1562a009..00000000 --- a/src/tests/pnp.rs +++ /dev/null @@ -1,45 +0,0 @@ -//! Not part of enhanced_resolve's test suite -//! -//! enhanced_resolve's test -//! cannot be ported over because it uses mocks on `pnpApi` provided by the runtime. - -use crate::{ResolveOptions, Resolver}; - -#[test] -fn pnp1() { - let fixture = super::fixture_root().join("pnp"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - pnp_manifest: Some(pnp::load_pnp_manifest(fixture.join(".pnp.cjs")).unwrap()), - ..ResolveOptions::default() - }); - - assert_eq!( - resolver.resolve(&fixture, "is-even").map(|r| r.full_path()), - Ok(fixture.join( - ".yarn/cache/is-even-npm-1.0.0-9f726520dc-2728cc2f39.zip/node_modules/is-even/index.js" - )) - ); - - assert_eq!( - resolver - .resolve( - &fixture.join( - ".yarn/cache/is-even-npm-1.0.0-9f726520dc-2728cc2f39.zip/node_modules/is-even" - ), - "is-odd" - ) - .map(|r| r.full_path()), - Ok(fixture.join( - ".yarn/cache/is-odd-npm-0.1.2-9d980a9da8-7dc6c6fd00.zip/node_modules/is-odd/index.js" - )), - ); - - assert_eq!( - resolver.resolve(&fixture, "is-odd").map(|r| r.full_path()), - Ok(fixture.join( - ".yarn/cache/is-odd-npm-3.0.1-93c3c3f41b-89ee2e353c.zip/node_modules/is-odd/index.js" - )), - ); -} diff --git a/src/tests/resolve.rs b/src/tests/resolve.rs deleted file mode 100644 index f2dbb88e..00000000 --- a/src/tests/resolve.rs +++ /dev/null @@ -1,119 +0,0 @@ -//! - -use crate::{ResolveError, ResolveOptions, Resolver}; - -#[test] -fn resolve() { - let f = super::fixture(); - - let resolver = Resolver::default(); - - let main1_js_path = f.join("main1.js").to_string_lossy().to_string(); - - #[rustfmt::skip] - let pass = [ - ("absolute path", f.clone(), main1_js_path.as_str(), f.join("main1.js")), - ("file with .js", f.clone(), "./main1.js", f.join("main1.js")), - ("file without extension", f.clone(), "./main1", f.join("main1.js")), - ("another file with .js", f.clone(), "./a.js", f.join("a.js")), - ("another file without extension", f.clone(), "./a", f.join("a.js")), - ("file in module with .js", f.clone(), "m1/a.js", f.join("node_modules/m1/a.js")), - ("file in module without extension", f.clone(), "m1/a", f.join("node_modules/m1/a.js")), - ("another file in module without extension", f.clone(), "complexm/step1", f.join("node_modules/complexm/step1.js")), - ("from submodule to file in sibling module", f.join("node_modules/complexm"), "m2/b.js", f.join("node_modules/m2/b.js")), - ("from nested directory to overwritten file in module", f.join("multiple_modules"), "m1/a.js", f.join("multiple_modules/node_modules/m1/a.js")), - ("from nested directory to not overwritten file in module", f.join("multiple_modules"), "m1/b.js", f.join("node_modules/m1/b.js")), - ("file with query", f.clone(), "./main1.js?query", f.join("main1.js?query")), - ("file with fragment", f.clone(), "./main1.js#fragment", f.join("main1.js#fragment")), - ("file with fragment and query", f.clone(), "./main1.js#fragment?query", f.join("main1.js#fragment?query")), - ("file with query and fragment", f.clone(), "./main1.js?#fragment", f.join("main1.js?#fragment")), - - ("file with query (unicode)", f.clone(), "./测试.js?query", f.join("测试.js?query")), - ("file with fragment (unicode)", f.clone(), "./测试.js#fragment", f.join("测试.js#fragment")), - ("file with fragment and query (unicode)", f.clone(), "./测试.js#fragment?query", f.join("测试.js#fragment?query")), - ("file with query and fragment (unicode)", f.clone(), "./测试.js?#fragment", f.join("测试.js?#fragment")), - - ("file in module with query", f.clone(), "m1/a?query", f.join("node_modules/m1/a.js?query")), - ("file in module with fragment", f.clone(), "m1/a#fragment", f.join("node_modules/m1/a.js#fragment")), - ("file in module with fragment and query", f.clone(), "m1/a#fragment?query", f.join("node_modules/m1/a.js#fragment?query")), - ("file in module with query and fragment", f.clone(), "m1/a?#fragment", f.join("node_modules/m1/a.js?#fragment")), - ("file in module with query and fragment", f.clone(), "m1/a?#fragment", f.join("node_modules/m1/a.js?#fragment")), - ("differ between directory and file, resolve file", f.clone(), "./dirOrFile", f.join("dirOrFile.js")), - ("differ between directory and file, resolve directory", f.clone(), "./dirOrFile/", f.join("dirOrFile/index.js")), - ("find node_modules outside of node_modules", f.join("browser-module/node_modules"), "m1/a", f.join("node_modules/m1/a.js")), - ("don't crash on main field pointing to self", f.clone(), "./main-field-self", f.join("./main-field-self/index.js")), - ("don't crash on main field pointing to self (2)", f.clone(), "./main-field-self2", f.join("./main-field-self2/index.js")), - // enhanced-resolve has `#` prepended with a `\0`, they are removed from the - // following 3 expected test results. - // See https://github.com/webpack/enhanced-resolve#escaping - ("handle fragment edge case (no fragment)", f.clone(), "./no#fragment/#/#", f.join("no#fragment/#/#.js")), - ("handle fragment edge case (fragment)", f.clone(), "./no#fragment/#/", f.join("no.js#fragment/#/")), - ("handle fragment escaping", f.clone(), "./no\0#fragment/\0#/\0##fragment", f.join("no#fragment/#/#.js#fragment")), - - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn issue238_resolve() { - let f = super::fixture().join("issue-238"); - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into(), ".jsx".into(), ".ts".into(), ".tsx".into()], - modules: vec!["src/a".into(), "src/b".into(), "src/common".into(), "node_modules".into()], - ..ResolveOptions::default() - }); - let resolved_path = - resolver.resolve(f.join("src/common"), "config/myObjectFile").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("src/common/config/myObjectFile.js")),); -} - -#[test] -fn prefer_relative() { - let f = super::fixture(); - - let resolver = - Resolver::new(ResolveOptions { prefer_relative: true, ..ResolveOptions::default() }); - - #[rustfmt::skip] - let pass = [ - ("should correctly resolve with preferRelative 1", "main1.js", f.join("main1.js")), - ("should correctly resolve with preferRelative 2", "m1/a.js", f.join("node_modules/m1/a.js")), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } -} - -#[test] -fn resolve_to_context() { - let f = super::fixture(); - let resolver = - Resolver::new(ResolveOptions { resolve_to_context: true, ..ResolveOptions::default() }); - - #[rustfmt::skip] - let data = [ - ("context for fixtures", f.clone(), "./", f.clone()), - ("context for fixtures/lib", f.clone(), "./lib", f.join("lib")), - ("context for fixtures with ..", f.clone(), "./lib/../../fixtures/./lib/..", f.clone()), - ("context for fixtures with query", f.clone(), "./?query", f.clone().with_file_name("fixtures?query")), - ]; - - for (comment, path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn resolve_hash_as_module() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions::default()); - let resolution = resolver.resolve(f, "#a"); - assert_eq!(resolution, Err(ResolveError::NotFound("#a".into()))); -} diff --git a/src/tests/restrictions.rs b/src/tests/restrictions.rs deleted file mode 100644 index 5ba56596..00000000 --- a/src/tests/restrictions.rs +++ /dev/null @@ -1,25 +0,0 @@ -//! - -use crate::{ResolveError, ResolveOptions, Resolver, Restriction}; - -// TODO: regex -// * should respect RegExp restriction -// * should try to find alternative #1 -// * should try to find alternative #2 -// * should try to find alternative #3 - -// should respect string restriction -#[test] -fn restriction1() { - let fixture = super::fixture(); - let f = fixture.join("restrictions"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - restrictions: vec![Restriction::Path(f.clone())], - ..ResolveOptions::default() - }); - - let resolution = resolver.resolve(&f, "pck2"); - assert_eq!(resolution, Err(ResolveError::Restriction(fixture.join("c.js"), f))); -} diff --git a/src/tests/roots.rs b/src/tests/roots.rs deleted file mode 100644 index b50e2a07..00000000 --- a/src/tests/roots.rs +++ /dev/null @@ -1,92 +0,0 @@ -//! - -use std::path::PathBuf; - -use crate::{AliasValue, ResolveError, ResolveOptions, Resolver}; - -fn dirname() -> PathBuf { - super::fixture_root().join("enhanced_resolve").join("test") -} - -#[test] -fn roots() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - alias: vec![("foo".into(), vec![AliasValue::from("/fixtures")])], - roots: vec![dirname(), f.clone()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should respect roots option", "/fixtures/b.js", f.join("b.js")), - ("should try another root option, if it exists", "/b.js", f.join("b.js")), - ("should respect extension", "/fixtures/b", f.join("b.js")), - ("should resolve in directory", "/fixtures/extensions/dir", f.join("extensions/dir/index.js")), - ("should respect aliases", "foo/b", f.join("b.js")), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } - - #[rustfmt::skip] - let fail = [ - ("should not work with relative path", "fixtures/b.js", ResolveError::NotFound("fixtures/b.js".into())) - ]; - - for (comment, request, expected) in fail { - let resolution = resolver.resolve(&f, request); - assert_eq!(resolution, Err(expected), "{comment} {request}"); - } -} - -#[test] -fn resolve_to_context() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - roots: vec![dirname(), f.clone()], - resolve_to_context: true, - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f, "/fixtures/lib").map(|r| r.full_path()); - let expected = f.join("lib"); - assert_eq!(resolved_path, Ok(expected)); -} - -#[test] -fn prefer_absolute() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - alias: vec![("foo".into(), vec![AliasValue::from("/fixtures")])], - roots: vec![dirname(), f.clone()], - prefer_absolute: true, - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve an absolute path (prefer absolute)", f.join("b.js").to_string_lossy().to_string(), f.join("b.js")), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(&f, &request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } -} - -#[test] -fn roots_fall_through() { - let f = super::fixture(); - let absolute_path = f.join("roots_fall_through/index.js"); - let specifier = absolute_path.to_string_lossy(); - let resolution = Resolver::new(ResolveOptions::default().with_root(&f)).resolve(&f, &specifier); - assert_eq!( - resolution.map(super::super::resolution::Resolution::into_path_buf), - Ok(absolute_path) - ); -} diff --git a/src/tests/scoped_packages.rs b/src/tests/scoped_packages.rs deleted file mode 100644 index 8258f00f..00000000 --- a/src/tests/scoped_packages.rs +++ /dev/null @@ -1,25 +0,0 @@ -//! - -use crate::{ResolveOptions, Resolver}; - -#[test] -fn scoped_packages() { - let f = super::fixture().join("scoped"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("main field should work", f.clone(), "@scope/pack1", f.join("./node_modules/@scope/pack1/main.js")), - ("browser field should work", f.clone(), "@scope/pack2", f.join("./node_modules/@scope/pack2/main.js")), - ("folder request should work", f.clone(), "@scope/pack2/lib", f.join("./node_modules/@scope/pack2/lib/index.js")) - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} diff --git a/src/tests/simple.rs b/src/tests/simple.rs deleted file mode 100644 index 08e1238a..00000000 --- a/src/tests/simple.rs +++ /dev/null @@ -1,68 +0,0 @@ -//! - -use std::env; - -use crate::Resolver; - -#[test] -fn simple() { - // mimic `enhanced-resolve/test/simple.test.js` - let dirname = env::current_dir().unwrap().join("fixtures"); - let f = dirname.join("enhanced_resolve/test"); - - let resolver = Resolver::default(); - - let data = [ - ("direct", f.clone(), "../lib/index"), - ("as directory", f, ".."), - ("as module", dirname.clone(), "./enhanced_resolve"), - ]; - - for (comment, path, request) in data { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - let expected = dirname.join("enhanced_resolve/lib/index.js"); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn dashed_name() { - let f = super::fixture(); - - let resolver = Resolver::default(); - - let data = [ - (f.clone(), "dash", f.join("node_modules/dash/index.js")), - (f.clone(), "dash-name", f.join("node_modules/dash-name/index.js")), - (f.join("node_modules/dash"), "dash", f.join("node_modules/dash/index.js")), - (f.join("node_modules/dash"), "dash-name", f.join("node_modules/dash-name/index.js")), - (f.join("node_modules/dash-name"), "dash", f.join("node_modules/dash/index.js")), - (f.join("node_modules/dash-name"), "dash-name", f.join("node_modules/dash-name/index.js")), - ]; - - for (path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{path:?} {request}"); - } -} - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows { - use super::super::memory_fs::MemoryFS; - - use crate::ResolveOptions; - - #[test] - fn no_package() { - use crate::ResolverGeneric; - use std::path::Path; - let f = Path::new("/"); - let file_system = MemoryFS::new(&[]); - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions::default(), - ); - let resolved_path = resolver.resolve(f, "package"); - assert!(resolved_path.is_err()); - } -} diff --git a/src/tests/symlink.rs b/src/tests/symlink.rs deleted file mode 100644 index 7589b560..00000000 --- a/src/tests/symlink.rs +++ /dev/null @@ -1,121 +0,0 @@ -use std::{fs, io, path::Path}; - -use crate::{ResolveOptions, Resolver}; - -#[derive(Debug, Clone, Copy)] -enum FileType { - File, - Dir, -} - -#[allow(unused_variables)] -fn symlink, Q: AsRef>( - original: P, - link: Q, - file_type: FileType, -) -> io::Result<()> { - #[cfg(target_family = "unix")] - { - std::os::unix::fs::symlink(original, link) - } - - #[cfg(target_family = "windows")] - match file_type { - FileType::File => std::os::windows::fs::symlink_file(original, link), - FileType::Dir => std::os::windows::fs::symlink_dir(original, link), - } -} - -fn init(dirname: &Path, temp_path: &Path) -> io::Result<()> { - if temp_path.exists() { - _ = fs::remove_dir_all(temp_path); - } - fs::create_dir(temp_path)?; - symlink(dirname.join("../lib/index.js"), temp_path.join("test"), FileType::File)?; - symlink(dirname.join("../lib"), temp_path.join("test2"), FileType::Dir)?; - fs::remove_file(temp_path.join("test"))?; - fs::remove_file(temp_path.join("test2"))?; - fs::remove_dir(temp_path) -} - -fn create_symlinks(dirname: &Path, temp_path: &Path) -> io::Result<()> { - fs::create_dir(temp_path).unwrap(); - symlink( - dirname.join("../lib/index.js").canonicalize().unwrap(), - temp_path.join("index.js"), - FileType::File, - )?; - symlink(dirname.join("../lib").canonicalize().unwrap(), temp_path.join("lib"), FileType::Dir)?; - symlink(dirname.join("..").canonicalize().unwrap(), temp_path.join("this"), FileType::Dir)?; - symlink(temp_path.join("this"), temp_path.join("that"), FileType::Dir)?; - symlink(Path::new("../../lib/index.js"), temp_path.join("node.relative.js"), FileType::File)?; - symlink( - Path::new("./node.relative.js"), - temp_path.join("node.relative.sym.js"), - FileType::File, - )?; - Ok(()) -} - -fn cleanup_symlinks(temp_path: &Path) { - _ = fs::remove_dir_all(temp_path); -} - -#[test] -fn test() -> io::Result<()> { - let root = super::fixture_root().join("enhanced_resolve"); - let dirname = root.join("test"); - let temp_path = dirname.join("temp"); - if !temp_path.exists() { - let is_admin = init(&dirname, &temp_path).is_ok(); - if !is_admin { - return Ok(()); - } - if let Err(err) = create_symlinks(&dirname, &temp_path) { - cleanup_symlinks(&temp_path); - return Err(err); - } - } - - let resolver_without_symlinks = - Resolver::new(ResolveOptions { symlinks: false, ..ResolveOptions::default() }); - let resolver_with_symlinks = Resolver::default(); - - #[rustfmt::skip] - let pass = [ - ("with a symlink to a file", temp_path.clone(), "./index.js"), - ("with a relative symlink to a file", temp_path.clone(), "./node.relative.js"), - ("with a relative symlink to a symlink to a file", temp_path.clone(), "./node.relative.sym.js"), - ("with a symlink to a directory 1", temp_path.clone(), "./lib/index.js"), - ("with a symlink to a directory 2", temp_path.clone(), "./this/lib/index.js"), - ("with multiple symlinks in the path 1", temp_path.clone(), "./this/test/temp/index.js"), - ("with multiple symlinks in the path 2", temp_path.clone(), "./this/test/temp/lib/index.js"), - ("with multiple symlinks in the path 3", temp_path.clone(), "./this/test/temp/this/lib/index.js"), - ("with a symlink to a directory 2 (chained)", temp_path.clone(), "./that/lib/index.js"), - ("with multiple symlinks in the path 1 (chained)", temp_path.clone(), "./that/test/temp/index.js"), - ("with multiple symlinks in the path 2 (chained)", temp_path.clone(), "./that/test/temp/lib/index.js"), - ("with multiple symlinks in the path 3 (chained)", temp_path.clone(), "./that/test/temp/that/lib/index.js"), - ("with symlinked directory as context 1", temp_path.join( "lib"), "./index.js"), - ("with symlinked directory as context 2", temp_path.join( "this"), "./lib/index.js"), - ("with symlinked directory as context and in path", temp_path.join( "this"), "./test/temp/lib/index.js"), - ("with symlinked directory in context path", temp_path.join( "this/lib"), "./index.js"), - ("with symlinked directory in context path and symlinked file", temp_path.join( "this/test"), "./temp/index.js"), - ("with symlinked directory in context path and symlinked directory", temp_path.join( "this/test"), "./temp/lib/index.js"), - ("with symlinked directory as context 2 (chained)", temp_path.join( "that"), "./lib/index.js"), - ("with symlinked directory as context and in path (chained)", temp_path.join( "that"), "./test/temp/lib/index.js"), - ("with symlinked directory in context path (chained)", temp_path.join( "that/lib"), "./index.js"), - ("with symlinked directory in context path and symlinked file (chained)", temp_path.join( "that/test"), "./temp/index.js"), - ("with symlinked directory in context path and symlinked directory (chained)", temp_path.join( "that/test"), "./temp/lib/index.js") - ]; - - for (comment, path, request) in pass { - let filename = resolver_with_symlinks.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(filename, Ok(root.join("lib/index.js")), "{comment:?}"); - - let resolved_path = - resolver_without_symlinks.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(path.join(request))); - } - - Ok(()) -} diff --git a/src/tests/tsconfig_paths.rs b/src/tests/tsconfig_paths.rs deleted file mode 100644 index b85bf6be..00000000 --- a/src/tests/tsconfig_paths.rs +++ /dev/null @@ -1,530 +0,0 @@ -//! tests for tsconfig-paths -//! -//! Fixtures copied from . - -use std::path::{Path, PathBuf}; - -use crate::{ - JSONError, ResolveError, ResolveOptions, Resolver, TsConfig, TsconfigOptions, - TsconfigReferences, -}; - -// -#[test] -fn tsconfig() { - let f = super::fixture_root().join("tsconfig"); - - #[rustfmt::skip] - let pass = [ - (f.clone(), None, "ts-path", f.join("foo.js")), - (f.join("nested"), None, "ts-path", f.join("nested/test.js")), - (f.join("cases/index"), None, "foo", f.join("node_modules/tsconfig-index/foo.js")), - // This requires reading package.json.tsconfig field - // (f.join("cases/field"), "foo", f.join("node_modules/tsconfig-field/foo.js")) - (f.join("cases/exports"), None, "foo", f.join("node_modules/tsconfig-exports/foo.js")), - (f.join("cases/extends-extension"), None, "foo", f.join("cases/extends-extension/foo.js")), - (f.join("cases/extends-extensionless"), None, "foo", f.join("node_modules/tsconfig-field/foo.js")), - (f.join("cases/extends-paths"), Some("src"), "@/index", f.join("cases/extends-paths/src/index.js")), - (f.join("cases/extends-multiple"), None, "foo", f.join("cases/extends-multiple/foo.js")), - ]; - - for (dir, subdir, request, expected) in pass { - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: dir.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - let path = subdir.map_or(dir.clone(), |subdir| dir.join(subdir)); - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{request} {path:?}"); - } - - #[rustfmt::skip] - let data = [ - (f.join("node_modules/tsconfig-not-used"), "ts-path", Ok(f.join("foo.js"))), - ]; - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - for (path, request, expected) in data { - let resolution = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolution, expected, "{path:?} {request}"); - } -} - -#[test] -fn tsconfig_fallthrough() { - let f = super::fixture_root().join("tsconfig"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "/"); - assert_eq!(resolved_path, Err(ResolveError::NotFound("/".into()))); -} - -#[test] -fn json_with_comments() { - let f = super::fixture_root().join("tsconfig/cases/trailing-comma"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "foo").map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(f.join("bar.js"))); -} - -#[test] -fn broken() { - let f = super::fixture_root().join("tsconfig"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("tsconfig_broken.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "/"); - let error = ResolveError::JSON(JSONError { - path: f.join("tsconfig_broken.json"), - message: String::from("EOF while parsing an object at line 2 column 0"), - line: 2, - column: 0, - }); - assert_eq!(resolved_path, Err(error)); -} - -// -#[test] -fn test_paths() { - let path = Path::new("/foo/tsconfig.json"); - let mut tsconfig_json = serde_json::json!({ - "compilerOptions": { - "paths": { - "jquery": ["node_modules/jquery/dist/jquery"], - "*": ["generated/*"], - "bar/*": ["test/*"], - "bar/baz/*": ["baz/*", "yo/*"], - "@/components/*": ["components/*"], - "url": ["node_modules/my-url"], - } - } - }) - .to_string(); - let tsconfig = TsConfig::parse(true, path, &mut tsconfig_json).unwrap(); - - let data = [ - ("jquery", vec!["/foo/node_modules/jquery/dist/jquery"]), - ("test", vec!["/foo/generated/test"]), - ("test/hello", vec!["/foo/generated/test/hello"]), - ("bar/hi", vec!["/foo/test/hi"]), - ("bar/baz/hi", vec!["/foo/baz/hi", "/foo/yo/hi"]), - ("@/components/button", vec!["/foo/components/button"]), - ("./jquery", vec![]), - ("url", vec!["/foo/node_modules/my-url"]), - ]; - - for (specifier, expected) in data { - let paths = tsconfig.resolve_path_alias(specifier); - let expected = expected.into_iter().map(PathBuf::from).collect::>(); - assert_eq!(paths, expected, "{specifier}"); - } -} - -// -#[test] -fn test_base_url() { - let path = Path::new("/foo/tsconfig.json"); - let mut tsconfig_json = serde_json::json!({ - "compilerOptions": { - "baseUrl": "./src" - } - }) - .to_string(); - let tsconfig = TsConfig::parse(true, path, &mut tsconfig_json).unwrap(); - - let data = [ - ("foo", vec!["/foo/src/foo"]), - ("components/button", vec!["/foo/src/components/button"]), - ("./jquery", vec![]), - ]; - - for (specifier, expected) in data { - let paths = tsconfig.resolve_path_alias(specifier); - let expected = expected.into_iter().map(PathBuf::from).collect::>(); - assert_eq!(paths, expected, "{specifier}"); - } -} - -// -#[test] -fn test_paths_and_base_url() { - let path = Path::new("/foo/tsconfig.json"); - let mut tsconfig_json = serde_json::json!({ - "compilerOptions": { - "baseUrl": "./src", - "paths": { - "*": ["generated/*"], - "bar/*": ["test/*"], - "bar/baz/*": ["baz/*", "yo/*"], - "@/components/*": ["components/*"] - } - } - }) - .to_string(); - let tsconfig = TsConfig::parse(true, path, &mut tsconfig_json).unwrap(); - - let data = [ - ("test", vec!["/foo/src/generated/test", "/foo/src/test"]), - ("test/hello", vec!["/foo/src/generated/test/hello", "/foo/src/test/hello"]), - ("bar/hi", vec!["/foo/src/test/hi", "/foo/src/bar/hi"]), - ("bar/baz/hi", vec!["/foo/src/baz/hi", "/foo/src/yo/hi", "/foo/src/bar/baz/hi"]), - ("@/components/button", vec!["/foo/src/components/button", "/foo/src/@/components/button"]), - ("./jquery", vec![]), - ]; - - for (specifier, expected) in data { - let paths = tsconfig.resolve_path_alias(specifier); - let expected = expected.into_iter().map(PathBuf::from).collect::>(); - assert_eq!(paths, expected, "{specifier}"); - } -} - -// Template variable ${configDir} for substitution of config files directory path -// https://github.com/microsoft/TypeScript/pull/58042 -#[test] -fn test_template_variable() { - let f = super::fixture_root().join("tsconfig"); - let f2 = f.join("cases").join("paths_template_variable"); - - #[rustfmt::skip] - let pass = [ - (f2.clone(), "tsconfig1.json", "foo", f2.join("foo.js")), - (f2.clone(), "tsconfig2.json", "foo", f2.join("foo.js")), - (f.clone(), "tsconfig_template_variable.json", "foo", f.join("foo.js")), - ]; - - for (dir, tsconfig, request, expected) in pass { - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: dir.join(tsconfig), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&dir, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{request} {tsconfig} {dir:?}"); - } -} - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows_test { - use std::path::{Path, PathBuf}; - - use crate::{ - ResolveError, ResolveOptions, ResolverGeneric, TsconfigOptions, TsconfigReferences, - }; - - use super::super::memory_fs::MemoryFS; - - struct OneTest { - name: &'static str, - tsconfig: String, - package_json: Option<(PathBuf, String)>, - main_fields: Option>, - existing_files: Vec<&'static str>, - requested_module: &'static str, - expected_path: &'static str, - extensions: Vec, - } - - impl Default for OneTest { - fn default() -> Self { - Self { - name: "", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/*": ["location/*"] - } - } - }) - .to_string(), - package_json: None, - main_fields: None, - existing_files: vec![], - requested_module: "", - expected_path: "", - extensions: vec![ - ".js".into(), - ".json".into(), - ".node".into(), - ".ts".into(), - ".tsx".into(), - ], - } - } - } - - impl OneTest { - fn resolver(&self, root: &Path) -> ResolverGeneric { - let mut file_system = MemoryFS::default(); - - file_system.add_file(&root.join("tsconfig.json"), &self.tsconfig); - if let Some((path, package_json)) = &self.package_json { - file_system.add_file(&root.join(path).join("package.json"), package_json); - } - for path in &self.existing_files { - file_system.add_file(Path::new(path), ""); - } - - let mut options = ResolveOptions { - extensions: self.extensions.clone(), - tsconfig: Some(TsconfigOptions { - config_file: root.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }; - if let Some(main_fields) = &self.main_fields { - options.main_fields.clone_from(main_fields); - } - - ResolverGeneric::::new_with_file_system(file_system, options) - } - } - - // Path matching tests from tsconfig-paths - // * - // * - #[test] - fn match_path() { - let pass = [ - OneTest { - name: "should locate path that matches with star and exists", - existing_files: vec!["/root/location/mylib/index.ts"], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve to correct path when many are specified", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/*": ["foo1/*", "foo2/*", "location/*", "foo3/*"], - } - } - }) - .to_string(), - existing_files: vec!["/root/location/mylib/index.ts"], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should locate path that matches with star and prioritize pattern with longest prefix", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "*": ["location/*"], - "lib/*": ["location/*"], - } - } - }) - .to_string(), - existing_files: vec![ - "/root/location/lib/mylib/index.ts", - "/root/location/mylib/index.ts", - ], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should locate path that matches with star and exists with extension", - existing_files: vec![ - "/root/location/mylib.myext", - ], - requested_module: "lib/mylib", - extensions: vec![".js".into(), ".myext".into()], - expected_path: "/root/location/mylib.myext", - ..OneTest::default() - }, - OneTest { - name: "should resolve request with extension specified", - existing_files: vec![ - "/root/location/test.jpg", - ], - requested_module: "lib/test.jpg", - expected_path: "/root/location/test.jpg", - ..OneTest::default() - }, - OneTest { - name: "should locate path that matches without star and exists", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/foo": ["location/foo"] - } - } - }) - .to_string(), - existing_files: vec![ - "/root/location/foo.ts", - ], - requested_module: "lib/foo", - expected_path: "/root/location/foo.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve to parent folder when filename is in subfolder", - existing_files: vec![ - "/root/location/mylib/index.ts", - ], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve from main field in package.json", - package_json: Some((PathBuf::from("/root/location/mylib"), serde_json::json!({ - "main": "./kalle.ts" - }).to_string())), - existing_files: vec![ - "/root/location/mylib/kalle.ts", - ], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/kalle.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve from main field in package.json (js)", - package_json: Some((PathBuf::from("/root/location/mylib.js"), serde_json::json!({ - "main": "./kalle.js" - }).to_string())), - existing_files: vec![ - "/root/location/mylib.js/kalle.js", - ], - extensions: vec![".ts".into(), ".js".into()], - requested_module: "lib/mylib.js", - expected_path: "/root/location/mylib.js/kalle.js", - ..OneTest::default() - }, - OneTest { - name: "should resolve from list of fields by priority in package.json", - main_fields: Some(vec!["missing".into(), "browser".into(), "main".into()]), - package_json: Some((PathBuf::from("/root/location/mylibjs"), serde_json::json!({ - "main": "./main.js", - "browser": "./browser.js" - }).to_string())), - existing_files: vec![ - "/root/location/mylibjs/main.js", - "/root/location/mylibjs/browser.js", - ], - extensions: vec![".ts".into(), ".js".into()], - requested_module: "lib/mylibjs", - expected_path: "/root/location/mylibjs/browser.js", - ..OneTest::default() - }, -OneTest { - name: "should ignore field mappings to missing files in package.json", - main_fields: Some(vec!["browser".into(), "main".into()]), - package_json: Some((PathBuf::from("/root/location/mylibjs"), serde_json::json!({ - "main": "./kalle.js", - "browser": "./nope.js" - }).to_string())), - existing_files: vec![ - "/root/location/mylibjs/kalle.js", - ], - extensions: vec![".ts".into(), ".js".into()], - requested_module: "lib/mylibjs", - expected_path: "/root/location/mylibjs/kalle.js", - ..OneTest::default() - }, - // Tests that are not applicable: - // name: "should resolve nested main fields" - // name: "should ignore advanced field mappings in package.json" - // name: "should resolve to with the help of baseUrl when not explicitly set" - // name: "should not resolve with the help of baseUrl when asked not to" - // name: "should resolve main file with cjs file extension" - OneTest { - name: "should resolve .ts from .js alias", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "@/*": ["src/*"] - } - } - }).to_string(), - existing_files: vec![ - "/root/src/foo.ts", - ], - requested_module: "@/foo", // original data was "@/foo.ts" but I don't get why it is the case? - expected_path: "/root/src/foo.ts", // original data was "/root/src/foo" - ..OneTest::default() - }, - ]; - - let root = PathBuf::from("/root"); - - for test in pass { - let resolved_path = - test.resolver(&root).resolve(&root, test.requested_module).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(PathBuf::from(test.expected_path)), "{}", test.name); - } - - let fail = [ - OneTest { - name: "should not locate path that does not match", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/*": ["location/*"] - } - } - }) - .to_string(), - existing_files: vec!["/root/location/mylib"], - requested_module: "lib/mylibjs", - ..OneTest::default() - }, - OneTest { - name: "should not resolve typings file (index.d.ts)", - existing_files: vec!["/root/location/mylib/index.d.ts"], - requested_module: "lib/mylib", - ..OneTest::default() - }, - ]; - - for test in fail { - let resolved_path = - test.resolver(&root).resolve(&root, test.requested_module).map(|f| f.full_path()); - assert_eq!( - resolved_path, - Err(ResolveError::NotFound(test.requested_module.into())), - "{}", - test.name - ); - } - } -} diff --git a/src/tests/tsconfig_project_references.rs b/src/tests/tsconfig_project_references.rs deleted file mode 100644 index 0d019d27..00000000 --- a/src/tests/tsconfig_project_references.rs +++ /dev/null @@ -1,132 +0,0 @@ -//! Tests for tsconfig project references - -use crate::{ResolveError, ResolveOptions, Resolver, TsconfigOptions, TsconfigReferences}; - -#[test] -fn auto() { - let f = super::fixture_root().join("tsconfig/cases/project_references"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("app"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - // Test normal paths alias - (f.join("app"), "@/index.ts", f.join("app/aliased/index.ts")), - (f.join("app"), "@/../index.ts", f.join("app/index.ts")), - // Test project reference - (f.join("project_a"), "@/index.ts", f.join("project_a/aliased/index.ts")), - (f.join("project_b/src"), "@/index.ts", f.join("project_b/src/aliased/index.ts")), - // Does not have paths alias - (f.join("project_a"), "./index.ts", f.join("project_a/index.ts")), - (f.join("project_c"), "./index.ts", f.join("project_c/index.ts")), - // Template variable - { - let dir = f.parent().unwrap().join("paths_template_variable"); - (dir.clone(), "foo", dir.join("foo.js")) - } - ]; - - for (path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{request} {path:?}"); - } -} - -#[test] -fn disabled() { - let f = super::fixture_root().join("tsconfig/cases/project_references"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("app"), - references: TsconfigReferences::Disabled, - }), - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - // Test normal paths alias - (f.join("app"), "@/index.ts", Ok(f.join("app/aliased/index.ts"))), - (f.join("app"), "@/../index.ts", Ok(f.join("app/index.ts"))), - // Test project reference - (f.join("project_a"), "@/index.ts", Err(ResolveError::NotFound("@/index.ts".into()))), - (f.join("project_b/src"), "@/index.ts", Err(ResolveError::NotFound("@/index.ts".into()))), - // Does not have paths alias - (f.join("project_a"), "./index.ts", Ok(f.join("project_a/index.ts"))), - (f.join("project_c"), "./index.ts", Ok(f.join("project_c/index.ts"))), - ]; - - for (path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, expected, "{request} {path:?}"); - } -} - -#[test] -fn manual() { - let f = super::fixture_root().join("tsconfig/cases/project_references"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("app"), - references: TsconfigReferences::Paths(vec!["../project_a/conf.json".into()]), - }), - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - // Test normal paths alias - (f.join("app"), "@/index.ts", Ok(f.join("app/aliased/index.ts"))), - (f.join("app"), "@/../index.ts", Ok(f.join("app/index.ts"))), - // Test project reference - (f.join("project_a"), "@/index.ts", Ok(f.join("project_a/aliased/index.ts"))), - (f.join("project_b/src"), "@/index.ts", Err(ResolveError::NotFound("@/index.ts".into()))), - // Does not have paths alias - (f.join("project_a"), "./index.ts", Ok(f.join("project_a/index.ts"))), - (f.join("project_c"), "./index.ts", Ok(f.join("project_c/index.ts"))), - ]; - - for (path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, expected, "{request} {path:?}"); - } -} - -#[test] -fn self_reference() { - let f = super::fixture_root().join("tsconfig/cases/project_references"); - - #[rustfmt::skip] - let pass = [ - (f.join("app"), vec!["./tsconfig.json".into()]), - (f.join("app/tsconfig.json"), vec!["./tsconfig.json".into()]), - (f.join("app"), vec![f.join("app")]), - (f.join("app/tsconfig.json"), vec![f.join("app")]), - (f.join("app/tsconfig.json"), vec![f.join("project_b"), f.join("app")]), - ]; - - for (config_file, reference_paths) in pass { - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: config_file.clone(), - references: TsconfigReferences::Paths(reference_paths.clone()), - }), - ..ResolveOptions::default() - }); - let path = f.join("app"); - let resolved_path = resolver.resolve(&path, "@/index.ts").map(|f| f.full_path()); - assert_eq!( - resolved_path, - Err(ResolveError::TsconfigSelfReference(f.join("app/tsconfig.json"))), - "{config_file:?} {reference_paths:?}" - ); - } -} diff --git a/src/tsconfig.rs b/src/tsconfig.rs deleted file mode 100644 index 6a675442..00000000 --- a/src/tsconfig.rs +++ /dev/null @@ -1,223 +0,0 @@ -use std::{ - hash::BuildHasherDefault, - path::{Path, PathBuf}, - sync::Arc, -}; - -use indexmap::IndexMap; -use rustc_hash::FxHasher; -use serde::Deserialize; - -use crate::PathUtil; - -pub type CompilerOptionsPathsMap = IndexMap, BuildHasherDefault>; - -#[derive(Debug, Clone, Eq, PartialEq, Deserialize)] -#[serde(untagged)] -pub enum ExtendsField { - Single(String), - Multiple(Vec), -} - -#[derive(Debug, Deserialize)] -#[serde(rename_all = "camelCase")] -pub struct TsConfig { - /// Whether this is the caller tsconfig. - /// Used for final template variable substitution when all configs are extended and merged. - #[serde(skip)] - root: bool, - - /// Path to `tsconfig.json`. Contains the `tsconfig.json` filename. - #[serde(skip)] - pub(crate) path: PathBuf, - - #[serde(default)] - pub extends: Option, - - #[serde(default)] - pub compiler_options: CompilerOptions, - - /// Bubbled up project references with a reference to their tsconfig. - #[serde(default)] - pub references: Vec, -} - -/// Compiler Options -/// -/// -#[derive(Debug, Default, Deserialize)] -#[serde(rename_all = "camelCase")] -pub struct CompilerOptions { - base_url: Option, - - /// Path aliases - paths: Option, - - /// The actual base for where path aliases are resolved from. - #[serde(skip)] - paths_base: PathBuf, -} - -/// Project Reference -/// -/// -#[derive(Debug, Deserialize)] -pub struct ProjectReference { - /// The path property of each reference can point to a directory containing a tsconfig.json file, - /// or to the config file itself (which may have any name). - pub path: PathBuf, - - /// Reference to the resolved tsconfig - #[serde(skip)] - pub tsconfig: Option>, -} - -impl TsConfig { - pub fn parse(root: bool, path: &Path, json: &mut str) -> Result { - _ = json_strip_comments::strip(json); - let mut tsconfig: Self = serde_json::from_str(json)?; - tsconfig.root = root; - tsconfig.path = path.to_path_buf(); - let directory = tsconfig.directory().to_path_buf(); - if let Some(base_url) = tsconfig.compiler_options.base_url { - tsconfig.compiler_options.base_url = Some(directory.normalize_with(base_url)); - } - if tsconfig.compiler_options.paths.is_some() { - tsconfig.compiler_options.paths_base = - tsconfig.compiler_options.base_url.as_ref().map_or(directory, Clone::clone); - } - Ok(tsconfig) - } - - pub fn build(mut self) -> Self { - if self.root { - let dir = self.directory().to_path_buf(); - // Substitute template variable in `tsconfig.compilerOptions.paths` - if let Some(paths) = &mut self.compiler_options.paths { - for paths in paths.values_mut() { - for path in paths { - Self::substitute_template_variable(&dir, path); - } - } - } - } - self - } - - /// Directory to `tsconfig.json` - /// - /// # Panics - /// - /// * When the `tsconfig.json` path is misconfigured. - pub fn directory(&self) -> &Path { - debug_assert!(self.path.file_name().is_some()); - self.path.parent().unwrap() - } - - pub fn extend_tsconfig(&mut self, tsconfig: &Self) { - let compiler_options = &mut self.compiler_options; - if compiler_options.paths.is_none() { - compiler_options.paths_base = compiler_options - .base_url - .as_ref() - .map_or_else(|| tsconfig.compiler_options.paths_base.clone(), Clone::clone); - compiler_options.paths.clone_from(&tsconfig.compiler_options.paths); - } - if compiler_options.base_url.is_none() { - compiler_options.base_url.clone_from(&tsconfig.compiler_options.base_url); - } - } - - pub fn resolve(&self, path: &Path, specifier: &str) -> Vec { - if path.starts_with(self.base_path()) { - let paths = self.resolve_path_alias(specifier); - if !paths.is_empty() { - return paths; - } - } - for tsconfig in self.references.iter().filter_map(|reference| reference.tsconfig.as_ref()) { - if path.starts_with(tsconfig.base_path()) { - return tsconfig.resolve_path_alias(specifier); - } - } - vec![] - } - - // Copied from parcel - // - pub fn resolve_path_alias(&self, specifier: &str) -> Vec { - if specifier.starts_with(['/', '.']) { - return vec![]; - } - - let base_url_iter = self - .compiler_options - .base_url - .as_ref() - .map_or_else(Vec::new, |base_url| vec![base_url.normalize_with(specifier)]); - - let Some(paths_map) = &self.compiler_options.paths else { - return base_url_iter; - }; - - let paths = paths_map.get(specifier).map_or_else( - || { - let mut longest_prefix_length = 0; - let mut longest_suffix_length = 0; - let mut best_key: Option<&String> = None; - - for key in paths_map.keys() { - if let Some((prefix, suffix)) = key.split_once('*') { - if (best_key.is_none() || prefix.len() > longest_prefix_length) - && specifier.starts_with(prefix) - && specifier.ends_with(suffix) - { - longest_prefix_length = prefix.len(); - longest_suffix_length = suffix.len(); - best_key.replace(key); - } - } - } - - best_key.and_then(|key| paths_map.get(key)).map_or_else(Vec::new, |paths| { - paths - .iter() - .map(|path| { - path.replace( - '*', - &specifier[longest_prefix_length - ..specifier.len() - longest_suffix_length], - ) - }) - .collect::>() - }) - }, - Clone::clone, - ); - - paths - .into_iter() - .map(|p| self.compiler_options.paths_base.normalize_with(p)) - .chain(base_url_iter) - .collect() - } - - fn base_path(&self) -> &Path { - self.compiler_options - .base_url - .as_ref() - .map_or_else(|| self.directory(), |path| path.as_ref()) - } - - /// Template variable `${configDir}` for substitution of config files directory path - /// - /// NOTE: All tests cases are just a head replacement of `${configDir}`, so we are constrained as such. - /// - /// See - fn substitute_template_variable(directory: &Path, path: &mut String) { - const TEMPLATE_VARIABLE: &str = "${configDir}/"; - if let Some(stripped_path) = path.strip_prefix(TEMPLATE_VARIABLE) { - *path = directory.join(stripped_path).to_string_lossy().to_string(); - } - } -} diff --git a/tests/integration_test.rs b/tests/integration_test.rs deleted file mode 100644 index 0fc52887..00000000 --- a/tests/integration_test.rs +++ /dev/null @@ -1,103 +0,0 @@ -//! Test public APIs - -use std::{env, path::PathBuf}; - -use oxc_resolver::{EnforceExtension, Resolution, ResolveContext, ResolveOptions, Resolver}; - -fn dir() -> PathBuf { - env::current_dir().unwrap() -} - -fn resolve(specifier: &str) -> Resolution { - let path = dir(); - Resolver::new(ResolveOptions::default()).resolve(path, specifier).unwrap() -} - -#[test] -fn clone() { - let resolution = resolve("./tests/package.json"); - assert_eq!(resolution.clone(), resolution); -} - -#[test] -fn debug() { - let resolution = resolve("./tests/package.json"); - let s = format!("{resolution:?}"); - assert!(!s.is_empty()); -} - -#[test] -fn eq() { - let resolution = resolve("./tests/package.json"); - assert_eq!(resolution, resolution); -} - -#[test] -fn package_json() { - let resolution = resolve("./tests/package.json"); - let package_json = resolution.package_json().unwrap(); - assert_eq!(package_json.name.as_ref().unwrap(), "name"); - assert_eq!(package_json.r#type.as_ref().unwrap().as_str(), "module".into()); - assert!(package_json.side_effects.as_ref().unwrap().is_object()); -} - -#[cfg(feature = "package_json_raw_json_api")] -#[test] -fn package_json_raw_json_api() { - let resolution = resolve("./tests/package.json"); - assert!(resolution - .package_json() - .unwrap() - .raw_json() - .get("name") - .is_some_and(|name| name == "name")); -} - -#[test] -fn clear_cache() { - let resolver = Resolver::new(ResolveOptions::default()); - resolver.clear_cache(); // exists -} - -#[test] -fn options() { - let resolver = Resolver::new(ResolveOptions::default()); - let options = resolver.options(); - assert!(!format!("{options:?}").is_empty()); -} - -#[test] -fn debug_resolver() { - let resolver = Resolver::new(ResolveOptions::default()); - assert!(!format!("{resolver:?}").is_empty()); -} - -#[test] -fn dependencies() { - let path = dir(); - let mut ctx = ResolveContext::default(); - let _ = Resolver::new(ResolveOptions::default()).resolve_with_context( - path, - "./tests/package.json", - &mut ctx, - ); - assert!(!ctx.file_dependencies.is_empty()); - assert!(ctx.missing_dependencies.is_empty()); -} - -#[test] -fn options_api() { - _ = ResolveOptions::default() - .with_builtin_modules(true) - .with_condition_names(&[]) - .with_extension(".js") - .with_force_extension(EnforceExtension::Auto) - .with_fully_specified(true) - .with_main_field("asdf") - .with_main_file("main") - .with_module("module") - .with_prefer_absolute(true) - .with_prefer_relative(true) - .with_root(PathBuf::new()) - .with_symbolic_link(true); -} diff --git a/tests/package.json b/tests/package.json deleted file mode 100644 index 54f58b8c..00000000 --- a/tests/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "name", - "type": "module", - "sideEffects": {} -} diff --git a/tests/resolve_test.rs b/tests/resolve_test.rs deleted file mode 100644 index 45934cf8..00000000 --- a/tests/resolve_test.rs +++ /dev/null @@ -1,132 +0,0 @@ -use std::{env, path::PathBuf}; - -use oxc_resolver::{ResolveError, ResolveOptions, Resolver}; - -fn dir() -> PathBuf { - env::current_dir().unwrap() -} - -#[test] -fn chinese() { - let dir = dir(); - let specifier = "./fixtures/misc/中文/中文.js"; - let resolution = Resolver::new(ResolveOptions::default()).resolve(&dir, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(dir.join("fixtures/misc/中文/中文.js")) - ); -} - -#[test] -fn styled_components() { - let dir = dir(); - let path = dir.join("fixtures/pnpm"); - let module_path = dir.join("node_modules/.pnpm/styled-components@6.1.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/styled-components"); - let specifier = "styled-components"; - - // cjs - let options = - ResolveOptions { alias_fields: vec![vec!["browser".into()]], ..ResolveOptions::default() }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/styled-components.browser.cjs.js")) - ); - - // esm - let options = ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - main_fields: vec!["module".into()], - ..ResolveOptions::default() - }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/styled-components.browser.esm.js")) - ); -} - -#[test] -fn axios() { - let dir = dir(); - let path = dir.join("fixtures/pnpm"); - let module_path = dir.join("node_modules/.pnpm/axios@1.6.2/node_modules/axios"); - let specifier = "axios"; - - // default - let options = ResolveOptions::default(); - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("index.js")) - ); - - // browser - let options = ResolveOptions { - condition_names: vec!["browser".into(), "require".into()], - ..ResolveOptions::default() - }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/browser/axios.cjs")) - ); - - // cjs - let options = ResolveOptions { - condition_names: vec!["node".into(), "require".into()], - ..ResolveOptions::default() - }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/node/axios.cjs")) - ); -} - -#[test] -fn postcss() { - let dir = dir(); - let path = dir.join("fixtures/pnpm"); - let module_path = path.join("node_modules/postcss"); - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - // should ignore "path" - let resolution = resolver.resolve(&module_path, "path"); - assert_eq!(resolution, Err(ResolveError::Ignored(module_path.clone()))); - - // should ignore "./lib/terminal-highlight" - let resolution = resolver.resolve(&module_path, "./lib/terminal-highlight"); - assert_eq!(resolution, Err(ResolveError::Ignored(module_path.join("lib/terminal-highlight")))); -} - -#[test] -fn ipaddr_js() { - let dir = dir(); - let path = dir.join("fixtures/pnpm"); - let module_path = - dir.join("node_modules/.pnpm/ipaddr.js@2.2.0/node_modules/ipaddr.js/lib/ipaddr.js"); - - let resolvers = [ - // with `extension_alias` - Resolver::new(ResolveOptions { - extension_alias: vec![(".js".into(), vec![".js".into(), ".ts".into(), ".tsx".into()])], - ..ResolveOptions::default() - }), - // with `extensions` should still resolve to module main - Resolver::new(ResolveOptions { - extensions: vec![(".ts".into())], - ..ResolveOptions::default() - }), - // default - Resolver::default(), - ]; - - for resolver in resolvers { - let resolution = resolver.resolve(&path, "ipaddr.js").map(|r| r.full_path()); - assert_eq!(resolution, Ok(module_path.clone())); - } -} From 92552329087e6f44037a1713b87c2b35d9f7836f Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Sat, 14 Sep 2024 09:01:36 +0300 Subject: [PATCH 80/82] --- .github/CODE_OF_CONDUCT.md | 127 - .github/SECURITY.md | 7 - .github/actions/pnpm/action.yml | 26 - .github/codecov.yml | 14 - .github/renovate.json | 5 - .github/workflows/benchmark.yml | 41 - .github/workflows/ci.yml | 196 - .github/workflows/codecov.yml | 69 - .github/workflows/release-napi.yml | 252 - .github/workflows/release-plz.yml | 55 - Cargo.lock | 1326 --- fixtures/enhanced_resolve/lib/index.js | 1 - fixtures/enhanced_resolve/package.json | 4 - fixtures/enhanced_resolve/test/.gitignore | 3 - .../enhanced_resolve/test/fixtures/#/a.js | 0 fixtures/enhanced_resolve/test/fixtures/a.js | 3 - .../enhanced_resolve/test/fixtures/abc.txt | 1 - .../test/fixtures/alias/files/a.js | 0 fixtures/enhanced_resolve/test/fixtures/b.js | 3 - .../browser-module/browser/module-a.js | 0 .../fixtures/browser-module/lib/browser.js | 0 .../fixtures/browser-module/lib/ignore.js | 0 .../test/fixtures/browser-module/lib/main.js | 0 .../fixtures/browser-module/lib/replaced.js | 0 .../test/fixtures/browser-module/lib/self.js | 0 .../fixtures/browser-module/lib/toString.js | 0 .../browser-module/node_modules/module-a.js | 0 .../browser-module/node_modules/module-b.js | 0 .../browser-module/node_modules/module-c.js | 0 .../node_modules/recursive-file/a.js | 0 .../node_modules/recursive-file/b.js | 0 .../node_modules/recursive-file/c.js | 0 .../node_modules/recursive-file/d.js | 0 .../node_modules/recursive-file/package.json | 8 - .../test/fixtures/browser-module/package.json | 33 - .../test/fixtures/builtins/package.json | 12 - fixtures/enhanced_resolve/test/fixtures/c.js | 4 - .../enhanced_resolve/test/fixtures/complex.js | 13 - .../test/fixtures/crypto-js/index.js | 0 .../test/fixtures/crypto-js/package.json | 7 - .../test/fixtures/decorated-fs/exists.js | 0 .../test/fixtures/dirOrFile.js | 1 - .../test/fixtures/dirOrFile/index.js | 1 - .../directory-default/directory-default.js | 0 .../node_modules/@org/pkg/dist/string.js | 1 - .../@org/pkg/dist/string.test.d.ts | 1 - .../node_modules/@org/pkg/package.json | 9 - .../node_modules/pkg/dist/string.js | 1 - .../node_modules/pkg/dist/string.test.d.ts | 1 - .../node_modules/pkg/package.json | 9 - .../node_modules/exports-field/package.json | 7 - .../node_modules/pack1/index.js | 0 .../test/fixtures/exports-field/a.js | 1 - .../node_modules/exports-field/lib/browser.js | 1 - .../node_modules/exports-field/lib/index.js | 0 .../exports-field/lib/lib2/main.js | 1 - .../node_modules/exports-field/lib/main.js | 1 - .../node_modules/exports-field/main.js | 1 - .../node_modules/exports-field/package.json | 18 - .../node_modules/exports-field/x.js | 1 - .../invalid-exports-field/index.js | 0 .../invalid-exports-field/package.json | 13 - .../node_modules/invalid-exports-field/umd.js | 0 .../test/fixtures/exports-field/package.json | 5 - .../node_modules/exports-field/index.js | 1 - .../node_modules/exports-field/lib/browser.js | 1 - .../exports-field/lib/lib2/main.js | 1 - .../node_modules/exports-field/lib/main.js | 1 - .../node_modules/exports-field/main.js | 1 - .../node_modules/exports-field/package.json | 17 - .../node_modules/exports-field/index | 0 .../node_modules/exports-field/main.js | 1 - .../node_modules/exports-field/package.json | 10 - .../node_modules/exports-field/src/index.js | 0 .../fixtures/extension-alias/dir/index.js | 0 .../fixtures/extension-alias/dir/index.ts | 0 .../fixtures/extension-alias/dir2/index.js | 0 .../fixtures/extension-alias/dir2/index.mts | 0 .../test/fixtures/extension-alias/index.js | 0 .../test/fixtures/extension-alias/index.mjs | 0 .../fixtures/extension-alias/index.mts.js | 0 .../test/fixtures/extension-alias/index.ts | 0 .../test/fixtures/extensions/app.module.js | 0 .../test/fixtures/extensions/dir/index.js | 0 .../test/fixtures/extensions/dir/index.ts | 0 .../test/fixtures/extensions/foo.js | 0 .../test/fixtures/extensions/foo.ts | 0 .../test/fixtures/extensions/index.js | 0 .../test/fixtures/extensions/index.ts | 0 .../extensions/node_modules/module.js | 0 .../extensions/node_modules/module/index.ts | 0 .../test/fixtures/extensions/package.json | 3 - .../enhanced_resolve/test/fixtures/file.load1 | 0 .../enhanced_resolve/test/fixtures/file.load2 | 0 .../test/fixtures/foo/index.js | 0 .../test/fixtures/foo/package.json | 4 - .../node_modules/m/package.json | 17 - .../node_modules/m/src/features/f.js | 0 .../m/src/features/internal/file.js | 0 .../node_modules/m/src/features/y/y.js | 0 .../node_modules/m/src/internal/i.js | 0 .../node_modules/m/src/middle-1/f.js | 0 .../node_modules/m/src/middle-1/nested/f.js | 0 .../node_modules/m/src/middle-2/nested/f.js | 1 - .../m/src/middle-3/nested/f/nested/f.js | 0 .../node_modules/m/src/middle-4/f/f.js | 0 .../node_modules/m/src/middle-5/f$/$.js | 0 .../node_modules/m/src/middle-5/f/$.js | 0 .../node_modules/m/src/middle/f.js | 0 .../node_modules/m/src/middle/nested/f.js | 0 .../test/fixtures/imports-field/a.js | 1 - .../test/fixtures/imports-field/b.js | 0 .../test/fixtures/imports-field/dir/b.js | 0 .../node_modules/a/lib/browser.js | 1 - .../imports-field/node_modules/a/lib/index.js | 0 .../node_modules/a/lib/lib2/main.js | 1 - .../imports-field/node_modules/a/lib/main.js | 1 - .../imports-field/node_modules/a/main.js | 1 - .../imports-field/node_modules/a/package.json | 18 - .../imports-field/node_modules/a/x.js | 1 - .../imports-field/node_modules/c/index.js | 0 .../test/fixtures/imports-field/package.json | 17 - .../fixtures/incorrect-package/pack1/a.js | 0 .../incorrect-package/pack1/package.json | 2 - .../fixtures/incorrect-package/pack2/a.js | 0 .../incorrect-package/pack2/package.json | 0 .../test/fixtures/issue-238/package.json | 3 - .../test/fixtures/issue-238/src/a/config.js | 0 .../src/common/config/myObjectFile.js | 0 .../enhanced_resolve/test/fixtures/lib.js | 0 .../test/fixtures/lib/complex1.js | 1 - .../test/fixtures/main-field-self/index.js | 0 .../fixtures/main-field-self/package.json | 3 - .../test/fixtures/main-field-self2/index.js | 0 .../fixtures/main-field-self2/package.json | 3 - .../enhanced_resolve/test/fixtures/main1.js | 9 - .../enhanced_resolve/test/fixtures/main2.js | 12 - .../enhanced_resolve/test/fixtures/main3.js | 4 - .../multiple_modules/node_modules/m1/a.js | 3 - .../test/fixtures/no#fragment/#/#.js | 0 fixtures/enhanced_resolve/test/fixtures/no.js | 0 .../browser-module-broken/browser.js | 0 .../browser-module-broken/main.js | 0 .../browser-module-broken/package.json | 4 - .../complexm/node_modules/m1/a.js | 1 - .../complexm/node_modules/m1/index.js | 1 - .../fixtures/node_modules/complexm/step1.js | 1 - .../fixtures/node_modules/complexm/step2.js | 1 - .../fixtures/node_modules/dash-name/index.js | 0 .../node_modules/dash-name/package.json | 4 - .../test/fixtures/node_modules/dash/index.js | 0 .../fixtures/node_modules/dash/package.json | 4 - .../invalidPackageJson/package.json | 0 .../test/fixtures/node_modules/m1/a.js | 3 - .../test/fixtures/node_modules/m1/b.js | 3 - .../test/fixtures/node_modules/m2/b.js | 1 - .../node_modules/recursive-module/file.js | 0 .../node_modules/recursive-module/index.js | 0 .../test/fixtures/pnp-a/m2/a.js | 3 - .../test/fixtures/pnp/pkg/dir/index.js | 0 .../test/fixtures/pnp/pkg/index.js | 0 .../test/fixtures/pnp/pkg/main.js | 0 .../fixtures/pnp/pkg/package-alias/browser.js | 0 .../fixtures/pnp/pkg/package-alias/index.js | 0 .../test/fixtures/pnp/pkg/package.json | 7 - .../test/fixtures/pnp/pkg/typescript/index.ts | 0 .../test/fixtures/pnp/pkg3/a.js | 1 - .../test/fixtures/pnp/pkg3/package.json | 8 - .../prefer-pnp/alternative-modules/m1/b.js | 0 .../restrictions/node_modules/pck1/index.css | 0 .../restrictions/node_modules/pck1/index.js | 0 .../node_modules/pck1/package.json | 3 - .../restrictions/node_modules/pck2/index.css | 0 .../restrictions/node_modules/pck2/module.js | 0 .../node_modules/pck2/package.json | 5 - .../test/fixtures/roots_fall_through/index.js | 0 .../scoped/node_modules/@scope/pack1/main.js | 0 .../node_modules/@scope/pack1/package.json | 5 - .../node_modules/@scope/pack2/lib/index.js | 0 .../scoped/node_modules/@scope/pack2/main.js | 0 .../node_modules/@scope/pack2/package.json | 3 - .../test/fixtures/shortcutdir.js/a.js | 0 .../test/fixtures/yield/a/foo-2/b | 0 .../test/fixtures/yield/a/foo-2/c | 0 .../test/fixtures/yield/a/foo/a | 0 .../test/fixtures/yield/a/foo/b | 0 .../test/fixtures/yield/b/foo/a | 0 .../test/fixtures/yield/c/foo/a | 0 .../test/fixtures/yield/c/foo/package.json | 7 - .../fixtures/\346\265\213\350\257\225.js" | 0 .../\344\270\255\346\226\207.js" | 0 fixtures/pnp/.gitignore | 1 - fixtures/pnp/.pnp.cjs | 7543 ----------------- fixtures/pnp/.yarnrc.yml | 1 - fixtures/pnp/package.json | 8 - fixtures/pnp/yarn.lock | 74 - fixtures/pnpm/.gitignore | 1 - fixtures/pnpm/package.json | 11 - fixtures/pnpm/pnpm-lock.yaml | 212 - fixtures/tsconfig/cases/builtins/thing.js | 0 .../tsconfig/cases/builtins/tsconfig.json | 5 - fixtures/tsconfig/cases/exports/index.js | 0 fixtures/tsconfig/cases/exports/tsconfig.json | 3 - .../extends-extension/base-tsconfig.json | 7 - .../tsconfig/cases/extends-extension/foo.js | 0 .../cases/extends-extension/tsconfig.json | 3 - .../cases/extends-extensionless/foo.js | 0 .../cases/extends-extensionless/tsconfig.json | 3 - .../tsconfig/cases/extends-multiple/foo.js | 0 .../cases/extends-multiple/tsconfig.json | 6 - .../tsconfig/cases/extends-not-found/index.js | 0 .../cases/extends-not-found/tsconfig.json | 3 - .../tsconfig/cases/extends-paths/src/index.js | 0 .../cases/extends-paths/tsconfig.base.json | 7 - .../cases/extends-paths/tsconfig.json | 6 - fixtures/tsconfig/cases/field/index.js | 0 fixtures/tsconfig/cases/field/tsconfig.json | 3 - fixtures/tsconfig/cases/index/index.js | 0 fixtures/tsconfig/cases/index/tsconfig.json | 3 - .../cases/paths_template_variable/foo.js | 0 .../paths_template_variable/tsconfig1.json | 3 - .../paths_template_variable/tsconfig2.json | 8 - .../project_references/app/aliased/index.ts | 0 .../cases/project_references/app/index.ts | 0 .../project_references/app/tsconfig.json | 23 - .../project_a/aliased/index.ts | 0 .../project_references/project_a/conf.json | 8 - .../project_references/project_a/index.ts | 0 .../project_b/src/aliased/index.ts | 0 .../project_b/tsconfig.json | 9 - .../project_references/project_c/index.ts | 0 .../project_c/tsconfig.json | 5 - .../project_references/tsconfig.base.json | 4 - fixtures/tsconfig/cases/suffixes/a.ios.ts | 0 fixtures/tsconfig/cases/suffixes/a.ts | 0 fixtures/tsconfig/cases/suffixes/b.ts | 0 fixtures/tsconfig/cases/suffixes/c-test.ts | 0 fixtures/tsconfig/cases/suffixes/index.ts | 1 - .../tsconfig/cases/suffixes/tsconfig.json | 5 - fixtures/tsconfig/cases/trailing-comma/bar.js | 0 .../tsconfig/cases/trailing-comma/index.js | 0 .../cases/trailing-comma/tsconfig.json | 9 - fixtures/tsconfig/foo.js | 0 fixtures/tsconfig/nested/index.js | 0 fixtures/tsconfig/nested/test.js | 0 fixtures/tsconfig/nested/tsconfig.json | 8 - .../node_modules/tsconfig-exports/conf.json | 7 - .../node_modules/tsconfig-exports/foo.js | 0 .../tsconfig-exports/package.json | 7 - .../node_modules/tsconfig-field/conf.json | 7 - .../node_modules/tsconfig-field/foo.js | 0 .../node_modules/tsconfig-field/package.json | 5 - .../node_modules/tsconfig-index/foo.js | 0 .../node_modules/tsconfig-index/package.json | 4 - .../node_modules/tsconfig-index/tsconfig.json | 7 - .../node_modules/tsconfig-not-used/foo.js | 0 .../tsconfig-not-used/tsconfig.json | 7 - fixtures/tsconfig/package.json | 24 - fixtures/tsconfig/tsconfig.json | 7 - fixtures/tsconfig/tsconfig_broken.json | 1 - .../tsconfig/tsconfig_template_variable.json | 7 - napi/__test__/resolver.spec.mjs | 260 - napi/src/lib.rs | 214 - napi/src/options.rs | 261 - napi/src/tracing.rs | 25 - napi/tests/options.test.mjs | 59 - npm/package.json | 79 +- package.json | 53 +- pnpm-lock.yaml | 2598 ------ src/builtins.rs | 71 - src/cache.rs | 354 - src/context.rs | 89 - src/error.rs | 182 - src/file_system.rs | 220 - src/lib.rs | 1755 ---- src/options.rs | 633 -- src/package_json.rs | 219 - src/path.rs | 132 - src/resolution.rs | 92 - src/specifier.rs | 230 - src/tests/alias.rs | 283 - src/tests/browser_field.rs | 189 - src/tests/builtins.rs | 121 - src/tests/dependencies.rs | 110 - src/tests/exports_field.rs | 2546 ------ src/tests/extension_alias.rs | 70 - src/tests/extensions.rs | 125 - src/tests/fallback.rs | 100 - src/tests/full_specified.rs | 113 - src/tests/imports_field.rs | 1320 --- src/tests/incorrect_description_file.rs | 65 - src/tests/main_field.rs | 24 - src/tests/memory_fs.rs | 74 - src/tests/missing.rs | 106 - src/tests/mod.rs | 51 - src/tests/pnp.rs | 45 - src/tests/resolve.rs | 119 - src/tests/restrictions.rs | 25 - src/tests/roots.rs | 92 - src/tests/scoped_packages.rs | 25 - src/tests/simple.rs | 68 - src/tests/symlink.rs | 121 - src/tests/tsconfig_paths.rs | 530 -- src/tests/tsconfig_project_references.rs | 132 - src/tsconfig.rs | 223 - tests/integration_test.rs | 103 - tests/package.json | 5 - tests/resolve_test.rs | 132 - 308 files changed, 56 insertions(+), 24940 deletions(-) delete mode 100644 .github/CODE_OF_CONDUCT.md delete mode 100644 .github/SECURITY.md delete mode 100644 .github/actions/pnpm/action.yml delete mode 100644 .github/codecov.yml delete mode 100644 .github/renovate.json delete mode 100644 .github/workflows/benchmark.yml delete mode 100644 .github/workflows/ci.yml delete mode 100644 .github/workflows/codecov.yml delete mode 100644 .github/workflows/release-napi.yml delete mode 100644 .github/workflows/release-plz.yml delete mode 100644 Cargo.lock delete mode 100644 fixtures/enhanced_resolve/lib/index.js delete mode 100644 fixtures/enhanced_resolve/package.json delete mode 100644 fixtures/enhanced_resolve/test/.gitignore delete mode 100644 fixtures/enhanced_resolve/test/fixtures/#/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/abc.txt delete mode 100644 fixtures/enhanced_resolve/test/fixtures/alias/files/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/browser/module-a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/ignore.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/replaced.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/self.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/toString.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-c.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/c.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/d.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/builtins/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/c.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/complex.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/crypto-js/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/decorated-fs/exists.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/dirOrFile.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/directory-default/directory-default.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/pack1/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/umd.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/index delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/src/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.mts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mjs delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mts.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/app.module.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/foo.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/foo.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/file.load1 delete mode 100644 fixtures/enhanced_resolve/test/fixtures/file.load2 delete mode 100644 fixtures/enhanced_resolve/test/fixtures/foo/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/foo/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/internal/file.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/y/y.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/internal/i.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-3/nested/f/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-4/f/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f$/$.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f/$.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/dir/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/c/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/issue-238/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/issue-238/src/a/config.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/issue-238/src/common/config/myObjectFile.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/lib.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/lib/complex1.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self2/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main1.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main2.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main3.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/no#fragment/#/#.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/no.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/invalidPackageJson/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/file.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/dir/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/typescript/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/prefer-pnp/alternative-modules/m1/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.css delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/index.css delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/module.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/roots_fall_through/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/lib/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/shortcutdir.js/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/b delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/c delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo/a delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo/b delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/b/foo/a delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/c/foo/a delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json delete mode 100644 "fixtures/enhanced_resolve/test/fixtures/\346\265\213\350\257\225.js" delete mode 100644 "fixtures/misc/\344\270\255\346\226\207/\344\270\255\346\226\207.js" delete mode 100644 fixtures/pnp/.gitignore delete mode 100755 fixtures/pnp/.pnp.cjs delete mode 100644 fixtures/pnp/.yarnrc.yml delete mode 100644 fixtures/pnp/package.json delete mode 100644 fixtures/pnp/yarn.lock delete mode 100644 fixtures/pnpm/.gitignore delete mode 100644 fixtures/pnpm/package.json delete mode 100644 fixtures/pnpm/pnpm-lock.yaml delete mode 100644 fixtures/tsconfig/cases/builtins/thing.js delete mode 100644 fixtures/tsconfig/cases/builtins/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/exports/index.js delete mode 100644 fixtures/tsconfig/cases/exports/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-extension/base-tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-extension/foo.js delete mode 100644 fixtures/tsconfig/cases/extends-extension/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-extensionless/foo.js delete mode 100644 fixtures/tsconfig/cases/extends-extensionless/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-multiple/foo.js delete mode 100644 fixtures/tsconfig/cases/extends-multiple/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-not-found/index.js delete mode 100644 fixtures/tsconfig/cases/extends-not-found/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-paths/src/index.js delete mode 100644 fixtures/tsconfig/cases/extends-paths/tsconfig.base.json delete mode 100644 fixtures/tsconfig/cases/extends-paths/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/field/index.js delete mode 100644 fixtures/tsconfig/cases/field/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/index/index.js delete mode 100644 fixtures/tsconfig/cases/index/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/paths_template_variable/foo.js delete mode 100644 fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json delete mode 100644 fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json delete mode 100644 fixtures/tsconfig/cases/project_references/app/aliased/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/app/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/app/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/project_references/project_a/aliased/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_a/conf.json delete mode 100644 fixtures/tsconfig/cases/project_references/project_a/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_b/src/aliased/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_b/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/project_references/project_c/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_c/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/project_references/tsconfig.base.json delete mode 100644 fixtures/tsconfig/cases/suffixes/a.ios.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/a.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/b.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/c-test.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/index.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/trailing-comma/bar.js delete mode 100644 fixtures/tsconfig/cases/trailing-comma/index.js delete mode 100644 fixtures/tsconfig/cases/trailing-comma/tsconfig.json delete mode 100644 fixtures/tsconfig/foo.js delete mode 100644 fixtures/tsconfig/nested/index.js delete mode 100644 fixtures/tsconfig/nested/test.js delete mode 100644 fixtures/tsconfig/nested/tsconfig.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-exports/conf.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-exports/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-exports/package.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-field/conf.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-field/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-field/package.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-index/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-index/package.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-not-used/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json delete mode 100755 fixtures/tsconfig/package.json delete mode 100644 fixtures/tsconfig/tsconfig.json delete mode 100644 fixtures/tsconfig/tsconfig_broken.json delete mode 100644 fixtures/tsconfig/tsconfig_template_variable.json delete mode 100644 napi/__test__/resolver.spec.mjs delete mode 100644 napi/src/lib.rs delete mode 100644 napi/src/options.rs delete mode 100644 napi/src/tracing.rs delete mode 100644 napi/tests/options.test.mjs delete mode 100644 pnpm-lock.yaml delete mode 100644 src/builtins.rs delete mode 100644 src/cache.rs delete mode 100644 src/context.rs delete mode 100644 src/error.rs delete mode 100644 src/file_system.rs delete mode 100644 src/lib.rs delete mode 100644 src/options.rs delete mode 100644 src/package_json.rs delete mode 100644 src/path.rs delete mode 100644 src/resolution.rs delete mode 100644 src/specifier.rs delete mode 100644 src/tests/alias.rs delete mode 100644 src/tests/browser_field.rs delete mode 100644 src/tests/builtins.rs delete mode 100644 src/tests/dependencies.rs delete mode 100644 src/tests/exports_field.rs delete mode 100644 src/tests/extension_alias.rs delete mode 100644 src/tests/extensions.rs delete mode 100644 src/tests/fallback.rs delete mode 100644 src/tests/full_specified.rs delete mode 100644 src/tests/imports_field.rs delete mode 100644 src/tests/incorrect_description_file.rs delete mode 100644 src/tests/main_field.rs delete mode 100644 src/tests/memory_fs.rs delete mode 100644 src/tests/missing.rs delete mode 100644 src/tests/mod.rs delete mode 100644 src/tests/pnp.rs delete mode 100644 src/tests/resolve.rs delete mode 100644 src/tests/restrictions.rs delete mode 100644 src/tests/roots.rs delete mode 100644 src/tests/scoped_packages.rs delete mode 100644 src/tests/simple.rs delete mode 100644 src/tests/symlink.rs delete mode 100644 src/tests/tsconfig_paths.rs delete mode 100644 src/tests/tsconfig_project_references.rs delete mode 100644 src/tsconfig.rs delete mode 100644 tests/integration_test.rs delete mode 100644 tests/package.json delete mode 100644 tests/resolve_test.rs diff --git a/.github/CODE_OF_CONDUCT.md b/.github/CODE_OF_CONDUCT.md deleted file mode 100644 index 41dd9ebe..00000000 --- a/.github/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,127 +0,0 @@ -# Contributor Covenant Code of Conduct - -## Our Pledge - -We as members, contributors, and leaders pledge to make participation in our -community a harassment-free experience for everyone, regardless of age, body -size, visible or invisible disability, ethnicity, sex characteristics, gender -identity and expression, level of experience, education, socio-economic status, -nationality, personal appearance, race, religion, or sexual identity -and orientation. - -We pledge to act and interact in ways that contribute to an open, welcoming, -diverse, inclusive, and healthy community. - -## Our Standards - -Examples of behavior that contributes to a positive environment for our -community include: - -* Demonstrating empathy and kindness toward other people -* Being respectful of differing opinions, viewpoints, and experiences -* Giving and gracefully accepting constructive feedback -* Accepting responsibility and apologizing to those affected by our mistakes, - and learning from the experience -* Focusing on what is best not just for us as individuals, but for the - overall community - -Examples of unacceptable behavior include: - -* The use of sexualized language or imagery, and sexual attention or - advances of any kind -* Trolling, insulting or derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or email - address, without their explicit permission -* Other conduct which could reasonably be considered inappropriate in a - professional setting - -## Enforcement Responsibilities - -Community leaders are responsible for clarifying and enforcing our standards of -acceptable behavior and will take appropriate and fair corrective action in -response to any behavior that they deem inappropriate, threatening, offensive, -or harmful. - -Community leaders have the right and responsibility to remove, edit, or reject -comments, commits, code, wiki edits, issues, and other contributions that are -not aligned to this Code of Conduct, and will communicate reasons for moderation -decisions when appropriate. - -## Scope - -This Code of Conduct applies within all community spaces, and also applies when -an individual is officially representing the community in public spaces. -Examples of representing our community include using an official e-mail address, -posting via an official social media account, or acting as an appointed -representative at an online or offline event. - -## Enforcement - -Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported to the community leaders responsible for enforcement. -All complaints will be reviewed and investigated promptly and fairly. - -All community leaders are obligated to respect the privacy and security of the -reporter of any incident. - -## Enforcement Guidelines - -Community leaders will follow these Community Impact Guidelines in determining -the consequences for any action they deem in violation of this Code of Conduct: - -### 1. Correction - -**Community Impact**: Use of inappropriate language or other behavior deemed -unprofessional or unwelcome in the community. - -**Consequence**: A private, written warning from community leaders, providing -clarity around the nature of the violation and an explanation of why the -behavior was inappropriate. A public apology may be requested. - -### 2. Warning - -**Community Impact**: A violation through a single incident or series -of actions. - -**Consequence**: A warning with consequences for continued behavior. No -interaction with the people involved, including unsolicited interaction with -those enforcing the Code of Conduct, for a specified period of time. This -includes avoiding interactions in community spaces as well as external channels -like social media. Violating these terms may lead to a temporary or -permanent ban. - -### 3. Temporary Ban - -**Community Impact**: A serious violation of community standards, including -sustained inappropriate behavior. - -**Consequence**: A temporary ban from any sort of interaction or public -communication with the community for a specified period of time. No public or -private interaction with the people involved, including unsolicited interaction -with those enforcing the Code of Conduct, is allowed during this period. -Violating these terms may lead to a permanent ban. - -### 4. Permanent Ban - -**Community Impact**: Demonstrating a pattern of violation of community -standards, including sustained inappropriate behavior, harassment of an -individual, or aggression toward or disparagement of classes of individuals. - -**Consequence**: A permanent ban from any sort of public interaction within -the community. - -## Attribution - -This Code of Conduct is adapted from the [Contributor Covenant][homepage], -version 2.0, available at -https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. - -Community Impact Guidelines were inspired by [Mozilla's code of conduct -enforcement ladder](https://github.com/mozilla/diversity). - -[homepage]: https://www.contributor-covenant.org - -For answers to common questions about this code of conduct, see the FAQ at -https://www.contributor-covenant.org/faq. Translations are available at -https://www.contributor-covenant.org/translations. diff --git a/.github/SECURITY.md b/.github/SECURITY.md deleted file mode 100644 index 63f5b072..00000000 --- a/.github/SECURITY.md +++ /dev/null @@ -1,7 +0,0 @@ -# Security Policy - -## Supported Versions - -## Reporting a Vulnerability - -If you find any potential vulnerability, join our [discord channel](https://discord.gg/9uXCAwqQZW) and contact Boshen. diff --git a/.github/actions/pnpm/action.yml b/.github/actions/pnpm/action.yml deleted file mode 100644 index ab4291c0..00000000 --- a/.github/actions/pnpm/action.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: Pnpm - -description: Install pnpm - -runs: - using: composite - steps: - - uses: pnpm/action-setup@v4 - - - uses: actions/setup-node@v4 - with: - node-version-file: .node-version - cache: pnpm - - - name: yarn - shell: bash - run: | - cd fixtures/pnp - corepack enable - yarn install - - - name: pnpm - shell: bash - run: | - corepack enable - pnpm install diff --git a/.github/codecov.yml b/.github/codecov.yml deleted file mode 100644 index 0610268a..00000000 --- a/.github/codecov.yml +++ /dev/null @@ -1,14 +0,0 @@ -coverage: - status: - project: - default: - informational: true - patch: - default: - informational: true - changes: - default: - informational: true - -ignore: - - "examples" diff --git a/.github/renovate.json b/.github/renovate.json deleted file mode 100644 index 2339df09..00000000 --- a/.github/renovate.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "$schema": "https://docs.renovatebot.com/renovate-schema.json", - "extends": ["github>Boshen/renovate"], - "ignorePaths": ["**/node_modules/**", "**/fixtures/**"] -} diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml deleted file mode 100644 index 7c25853b..00000000 --- a/.github/workflows/benchmark.yml +++ /dev/null @@ -1,41 +0,0 @@ -name: Benchmark - -on: - workflow_dispatch: - pull_request: - types: [opened, synchronize] - paths-ignore: - - '**/*.md' - push: - branches: - - main - paths-ignore: - - '**/*.md' - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} - cancel-in-progress: true - -jobs: - benchmark: - name: Benchmark - runs-on: ubuntu-latest - steps: - - name: Checkout Branch - uses: taiki-e/checkout-action@v1 - - - uses: Boshen/setup-rust@main - with: - cache-key: benchmark - save-cache: ${{ github.ref_name == 'main' }} - tools: cargo-codspeed - - uses: ./.github/actions/pnpm - - name: Build Benchmark - run: cargo codspeed build --features codspeed - - - name: Run benchmark - uses: CodSpeedHQ/action@v3 - timeout-minutes: 30 - with: - run: cargo codspeed run - token: ${{ secrets.CODSPEED_TOKEN }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index 3f629ffb..00000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,196 +0,0 @@ -name: CI - -on: - workflow_dispatch: - pull_request: - types: [opened, synchronize] - paths-ignore: - - '**/*.md' - - '!.github/workflows/ci.yml' - push: - branches: - - main - - "renovate/**" - paths-ignore: - - '**/*.md' - - '!.github/workflows/ci.yml' - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} - cancel-in-progress: ${{ github.ref_name != 'main' }} - -defaults: - run: - shell: bash - -jobs: - cache: # Warm cache factory for all other CI jobs - name: Check and Build - strategy: - fail-fast: true - matrix: - include: - - os: windows-latest - - os: ubuntu-latest - - os: macos-14 - runs-on: ${{ matrix.os }} - steps: - - uses: taiki-e/checkout-action@v1 - - - uses: Boshen/setup-rust@main - with: - save-cache: ${{ github.ref_name == 'main' }} - cache-key: warm - - - run: cargo check --all-features --locked - - # Only need to build the test to create a warm cache on the main branch - - name: Build cache by Cargo Check and Cargo Test - if: ${{ github.ref_name == 'main' }} - run: cargo test --all-features --no-run - - wasm: - name: Check Wasm - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - - uses: Boshen/setup-rust@main - with: - cache-key: wasm - save-cache: ${{ github.ref_name == 'main' }} - - - name: Check - run: | - rustup target add wasm32-unknown-unknown - cargo check --all-features --target wasm32-unknown-unknown - - wasi: - name: Test wasi target - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - - uses: Boshen/setup-rust@main - with: - cache-key: wasi - save-cache: ${{ github.ref_name == 'main' }} - - - uses: ./.github/actions/pnpm - - - name: Build - run: | - rustup target add wasm32-wasip1-threads - pnpm build --target wasm32-wasip1-threads - - - name: Test - run: pnpm test - env: - WASI_TEST: 1 - - typos: - name: Spell Check - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - - uses: crate-ci/typos@v1.24.5 - with: - files: . - - deny: - name: Cargo Deny - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - - uses: dorny/paths-filter@v3 - id: filter - with: - filters: | - src: - - 'Cargo.lock' - - - uses: Boshen/setup-rust@main - with: - restore-cache: false - tools: cargo-deny - - - if: steps.filter.outputs.src == 'true' - run: cargo deny check - - unused-deps: - name: Check Unused Dependencies - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - uses: dorny/paths-filter@v3 - id: filter - with: - filters: | - src: - - '**/*.rs' - - '**/Cargo.toml' - - 'Cargo.lock' - - uses: Boshen/setup-rust@main - with: - restore-cache: false - if: steps.filter.outputs.src == 'true' - - uses: cargo-bins/cargo-binstall@main - if: steps.filter.outputs.src == 'true' - - run: cargo binstall --no-confirm cargo-shear@1 - if: steps.filter.outputs.src == 'true' - - run: cargo shear - if: steps.filter.outputs.src == 'true' - - format: - name: Format - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - uses: Boshen/setup-rust@main - with: - components: rustfmt - restore-cache: false - - run: cargo fmt --all -- --check - - lint: - name: Clippy - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - uses: Boshen/setup-rust@main - with: - components: clippy - - run: cargo clippy --all-features -- -D warnings - - doc: - name: Doc - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - uses: Boshen/setup-rust@main - with: - components: rust-docs - - run: RUSTDOCFLAGS='-D warnings' cargo doc --no-deps --all-features - - test: - name: Test - strategy: - fail-fast: true - matrix: - include: - - os: windows-latest - - os: ubuntu-latest - - os: macos-14 - runs-on: ${{ matrix.os }} - env: - RUST_BACKTRACE: 1 - steps: - - uses: taiki-e/checkout-action@v1 - - uses: ./.github/actions/pnpm - - uses: Boshen/setup-rust@main - with: - cache-key: warm - - run: cargo test --doc - - run: cargo test --all-features diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml deleted file mode 100644 index 97302b03..00000000 --- a/.github/workflows/codecov.yml +++ /dev/null @@ -1,69 +0,0 @@ -name: Code Coverage # Run cargo-llvm-cov and upload to codecov.io - -on: - workflow_dispatch: - pull_request: - types: [opened, synchronize] - paths-ignore: - - '**/*.md' - push: - branches: - - main - paths-ignore: - - '**/*.md' - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: ${{ github.ref_name != 'main' }} - -jobs: - coverage: - name: Code Coverage - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: taiki-e/checkout-action@v1 - - - uses: ./.github/actions/pnpm - - - uses: Boshen/setup-rust@main - with: - cache-key: codecov - save-cache: ${{ github.ref_name == 'main' }} - tools: cargo-llvm-cov - components: llvm-tools-preview - - - run: cargo llvm-cov --lcov --output-path lcov.info - - - name: Upload Artifact - uses: actions/upload-artifact@v4 - with: - name: codecov - path: lcov.info - - # codecov often fails, use another workflow for retry - upload-codecov: - name: Upload coverage file - runs-on: ubuntu-latest - needs: coverage - # Check if the event is not triggered by a fork by checking whether CODECOV_TOKEN is set - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - steps: - - name: Checkout - if: env.CODECOV_TOKEN - uses: taiki-e/checkout-action@v1 - - - name: Download coverage file - if: env.CODECOV_TOKEN - uses: actions/download-artifact@v4 - with: - name: codecov - - - name: Upload to codecov.io - if: env.CODECOV_TOKEN - uses: codecov/codecov-action@v4 - with: - token: ${{ secrets.CODECOV_TOKEN }} - fail_ci_if_error: true - files: lcov.info diff --git a/.github/workflows/release-napi.yml b/.github/workflows/release-napi.yml deleted file mode 100644 index 1ea68db8..00000000 --- a/.github/workflows/release-napi.yml +++ /dev/null @@ -1,252 +0,0 @@ -name: Release NAPI - -on: - workflow_dispatch: - push: - branches: - - main - paths: - - npm/package.json # Please only commit this file, so we don't need to wait for test CI to pass. - -env: - DEBUG: 'napi:*' - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - check: - name: Check version - runs-on: ubuntu-latest - outputs: - version: ${{ env.version }} - version_changed: ${{ steps.version.outputs.changed }} - steps: - - uses: taiki-e/checkout-action@v1 - - - name: Check version changes - uses: EndBug/version-check@v2 - id: version - with: - static-checking: localIsNew - file-url: https://unpkg.com/oxc-resolver@latest/package.json - file-name: npm/package.json - - - name: Set version name - if: steps.version.outputs.changed == 'true' - run: | - echo "Version change found! New version: ${{ steps.version.outputs.version }} (${{ steps.version.outputs.version_type }})" - echo "version=${{ steps.version.outputs.version }}" >> $GITHUB_ENV - - build: - needs: check - if: needs.check.outputs.version_changed == 'true' - env: - version: ${{ needs.check.outputs.version }} - outputs: - version: ${{ env.version }} - strategy: - fail-fast: false - matrix: - include: - - os: windows-latest - target: x86_64-pc-windows-msvc - - - os: windows-latest - target: aarch64-pc-windows-msvc - - - os: ubuntu-latest - target: x86_64-unknown-linux-gnu - - - os: ubuntu-latest - target: x86_64-unknown-linux-musl - - - os: ubuntu-latest - target: aarch64-unknown-linux-gnu - - - os: ubuntu-latest - target: aarch64-unknown-linux-musl - - - os: ubuntu-latest - target: armv7-unknown-linux-gnueabihf - - - os: macos-latest - target: x86_64-apple-darwin - - - os: macos-latest - target: aarch64-apple-darwin - - - os: ubuntu-latest - target: wasm32-wasip1-threads - - name: Package ${{ matrix.target }} - runs-on: ${{ matrix.os }} - steps: - - uses: taiki-e/checkout-action@v1 - - - uses: ./.github/actions/pnpm - - - name: Add Rust Target - run: rustup target add ${{ matrix.target }} - - - uses: goto-bus-stop/setup-zig@v2 - if: ${{ contains(matrix.target, 'musl') }} - with: - version: 0.13.0 - - - name: Build with zig cross - if: ${{ contains(matrix.target, 'musl') }} - run: pnpm build -x --target ${{ matrix.target }} - - - name: Build with napi cross - if: ${{ contains(matrix.target, 'gnu') }} - run: pnpm build --use-napi-cross --target ${{ matrix.target }} - - - name: Build - if: ${{ !contains(matrix.target, 'gnu') && !contains(matrix.target, 'musl') }} - run: pnpm build --target ${{ matrix.target }} - - - name: Test - if: matrix.target == 'x86_64-pc-windows-msvc' || matrix.target == 'aarch64-apple-darwin' || matrix.target == 'wasm32-wasip1-threads' - run: pnpm test - - - name: Output docker params - if: ${{ contains(matrix.target, 'linux') }} - id: docker - run: | - node -e " - if ('${{ matrix.target }}'.startsWith('aarch64')) { - console.log('PLATFORM=linux/arm64') - } else if ('${{ matrix.target }}'.startsWith('armv7')) { - console.log('PLATFORM=linux/arm/v7') - } else { - console.log('PLATFORM=linux/amd64') - } - " >> $GITHUB_OUTPUT - node -e " - if ('${{ matrix.target }}'.endsWith('-musl')) { - console.log('IMAGE=node:lts-alpine') - } else { - console.log('IMAGE=node:lts-slim') - } - " >> $GITHUB_OUTPUT - echo "PNPM_STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_OUTPUT - - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - if: ${{ contains(matrix.target, 'linux') }} - with: - platforms: all - - - run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes - if: ${{ contains(matrix.target, 'linux') }} - - - name: Run linux test - uses: addnab/docker-run-action@v3 - if: ${{ contains(matrix.target, 'linux') }} - with: - image: ${{ steps.docker.outputs.IMAGE }} - options: -v ${{ steps.docker.outputs.PNPM_STORE_PATH }}:${{ steps.docker.outputs.PNPM_STORE_PATH }} -v ${{ github.workspace }}:/oxc_resolver -w /oxc_resolver --platform ${{ steps.docker.outputs.PLATFORM }} - run: | - corepack enable - pnpm test - - - name: Upload artifacts - uses: actions/upload-artifact@v4 - with: - name: bindings-${{ matrix.target }} - path: | - napi/*.node - napi/*.wasm - - build-freebsd: - needs: check - if: needs.check.outputs.version_changed == 'true' - name: Build FreeBSD - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Build - id: build - uses: cross-platform-actions/action@v0.25.0 - env: - DEBUG: napi:* - RUSTUP_IO_THREADS: 1 - with: - operating_system: freebsd - version: '14.0' - memory: 8G - cpu_count: 3 - environment_variables: 'DEBUG RUSTUP_IO_THREADS' - shell: bash - run: | - sudo pkg install -y -f curl node libnghttp2 npm - curl https://sh.rustup.rs -sSf --output rustup.sh - sh rustup.sh -y --profile minimal --default-toolchain stable - source "$HOME/.cargo/env" - echo "~~~~ rustc --version ~~~~" - rustc --version - echo "~~~~ node -v ~~~~" - node -v - pwd - ls -lah - whoami - env - sudo corepack enable - pnpm install - pnpm build --target x86_64-unknown-freebsd - rm -rf node_modules - rm -rf target - - name: Upload artifact - uses: actions/upload-artifact@v4 - with: - name: bindings-freebsd - path: napi/*.node - if-no-files-found: error - - publish: - name: Publish NAPI - runs-on: ubuntu-latest - permissions: - id-token: write # for `npm publish --provenance` - needs: - - build - - build-freebsd - steps: - - uses: taiki-e/checkout-action@v1 - - - name: corepack - run: corepack enable - - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version-file: .node-version - cache: pnpm - - - name: Install dependencies - run: pnpm install --frozen-lockfile - - - name: Download Artifacts - uses: actions/download-artifact@v4 - with: - path: artifacts - - - name: Prepare dirs and artifacts - run: | - pnpm napi create-npm-dirs --package-json-path npm/package.json - pnpm napi artifacts --package-json-path npm/package.json --build-output-dir napi - - - name: Publish npm packages as latest - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - shell: bash - run: | - cp napi/index.js npm/index.js - cp napi/index.d.ts npm/index.d.ts - cp napi/browser.js npm/browser.js - echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc - pnpm napi pre-publish --no-gh-release -t npm --package-json-path npm/package.json - npm publish npm/ --tag latest --provenance --access public diff --git a/.github/workflows/release-plz.yml b/.github/workflows/release-plz.yml deleted file mode 100644 index 121758ad..00000000 --- a/.github/workflows/release-plz.yml +++ /dev/null @@ -1,55 +0,0 @@ -name: Release Plz - -on: - workflow_dispatch: - push: - branches: - - main - -permissions: - pull-requests: write - contents: write - -jobs: - release-plz: - name: Release-plz - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - uses: Boshen/setup-rust@main - with: - save-cache: ${{ github.ref_name == 'main' }} - cache-key: warm - - - name: Run release-plz - id: release-plz - uses: MarcoIeni/release-plz-action@v0.5 - env: - GITHUB_TOKEN: ${{ secrets.RELEASE_PLZ_TOKEN }} - CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} - - - name: Bump package.json - if: ${{ steps.release-plz.outputs.prs_created }} - env: - GH_TOKEN: ${{ github.token }} - RELEASES: ${{ steps.release-plz.outputs.releases }} - PR: ${{ steps.release-plz.outputs.pr }} - run: | - set -e - - pr_number=${{ fromJSON(steps.release-plz.outputs.pr).number }} - if [[ -n "$pr_number" ]]; then - version=$(echo "$RELEASES" | jq -r '.[0].version') - echo "version: $version" - - jq --arg version "${version}" '.version = ($version)' npm/package.json > tmp - mv tmp npm/package.json - - gh pr checkout $pr_number - git add . - git commit -m "Update package.json" - git push - fi diff --git a/Cargo.lock b/Cargo.lock deleted file mode 100644 index 58c1e7ad..00000000 --- a/Cargo.lock +++ /dev/null @@ -1,1326 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "adler" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" - -[[package]] -name = "aho-corasick" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" -dependencies = [ - "memchr", -] - -[[package]] -name = "android-tzdata" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" - -[[package]] -name = "android_system_properties" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" -dependencies = [ - "libc", -] - -[[package]] -name = "anes" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "735d4f398ca57cfa2880225c2bf81c3b9af3be5bb22e44ae70118dad38713e84" - -[[package]] -name = "arca" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f915ddd863ef73f11c10c75170e86db1d4f539689bc6bfb9ce25d6528d6fe83" -dependencies = [ - "clean-path", - "path-slash", - "radix_trie", -] - -[[package]] -name = "autocfg" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" - -[[package]] -name = "base64" -version = "0.22.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" - -[[package]] -name = "bit-set" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1" -dependencies = [ - "bit-vec", -] - -[[package]] -name = "bit-vec" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "bitflags" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" - -[[package]] -name = "bpaf" -version = "0.9.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3280efcf6d66bc77c2cf9b67dc8acee47a217d9be67dd590b3230dffe663724d" - -[[package]] -name = "bumpalo" -version = "3.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" - -[[package]] -name = "byteorder" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" - -[[package]] -name = "cast" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" - -[[package]] -name = "cc" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eaff6f8ce506b9773fa786672d63fc7a191ffea1be33f72bbd4aeacefca9ffc8" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "chrono" -version = "0.4.38" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" -dependencies = [ - "android-tzdata", - "iana-time-zone", - "num-traits", - "serde", - "windows-targets 0.52.6", -] - -[[package]] -name = "ciborium" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42e69ffd6f0917f5c029256a24d0161db17cea3997d185db0d35926308770f0e" -dependencies = [ - "ciborium-io", - "ciborium-ll", - "serde", -] - -[[package]] -name = "ciborium-io" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05afea1e0a06c9be33d539b876f1ce3692f4afea2cb41f740e7743225ed1c757" - -[[package]] -name = "ciborium-ll" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57663b653d948a338bfb3eeba9bb2fd5fcfaecb9e199e87e1eda4d9e8b240fd9" -dependencies = [ - "ciborium-io", - "half", -] - -[[package]] -name = "clean-path" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aaa6b4b263a5d737e9bf6b7c09b72c41a5480aec4d7219af827f6564e950b6a5" - -[[package]] -name = "codspeed" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a104ac948e0188b921eb3fcbdd55dcf62e542df4c7ab7e660623f6288302089" -dependencies = [ - "colored", - "libc", - "serde_json", -] - -[[package]] -name = "colored" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbf2150cce219b664a8a70df7a1f933836724b503f8a413af9365b4dcc4d90b8" -dependencies = [ - "lazy_static", - "windows-sys 0.48.0", -] - -[[package]] -name = "concurrent_lru" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7feb5cb312f774e8a24540e27206db4e890f7d488563671d24a16389cf4c2e4e" -dependencies = [ - "once_cell", -] - -[[package]] -name = "convert_case" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec182b0ca2f35d8fc196cf3404988fd8b8c739a4d270ff118a398feb0cbec1ca" -dependencies = [ - "unicode-segmentation", -] - -[[package]] -name = "core-foundation-sys" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" - -[[package]] -name = "criterion2" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8df39381f28ced0ceebfb5611528d99aef14f8d75b43e9d4ceb6aba66e7b04d" -dependencies = [ - "anes", - "bpaf", - "cast", - "ciborium", - "codspeed", - "colored", - "num-traits", - "oorandom", - "serde", - "serde_json", - "walkdir", -] - -[[package]] -name = "crossbeam-deque" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" -dependencies = [ - "crossbeam-epoch", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.9.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" -dependencies = [ - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" - -[[package]] -name = "crunchy" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" - -[[package]] -name = "ctor" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edb49164822f3ee45b17acd4a208cfc1251410cf0cad9a833234c9890774dd9f" -dependencies = [ - "quote", - "syn", -] - -[[package]] -name = "darling" -version = "0.20.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" -dependencies = [ - "darling_core", - "darling_macro", -] - -[[package]] -name = "darling_core" -version = "0.20.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95133861a8032aaea082871032f5815eb9e98cef03fa916ab4500513994df9e5" -dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "strsim", - "syn", -] - -[[package]] -name = "darling_macro" -version = "0.20.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" -dependencies = [ - "darling_core", - "quote", - "syn", -] - -[[package]] -name = "dashmap" -version = "6.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "804c8821570c3f8b70230c2ba75ffa5c0f9a4189b9a432b6656c536712acae28" -dependencies = [ - "cfg-if", - "crossbeam-utils", - "hashbrown 0.14.5", - "lock_api", - "once_cell", - "parking_lot_core", -] - -[[package]] -name = "deranged" -version = "0.3.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" -dependencies = [ - "powerfmt", - "serde", -] - -[[package]] -name = "document-features" -version = "0.2.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb6969eaabd2421f8a2775cfd2471a2b634372b4a25d41e3bd647b79912850a0" -dependencies = [ - "litrs", -] - -[[package]] -name = "dunce" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" - -[[package]] -name = "either" -version = "1.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" - -[[package]] -name = "endian-type" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" - -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "fancy-regex" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "531e46835a22af56d1e3b66f04844bed63158bc094a628bec1d321d9b4c44bf2" -dependencies = [ - "bit-set", - "regex-automata", - "regex-syntax", -] - -[[package]] -name = "filetime" -version = "0.2.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ee447700ac8aa0b2f2bd7bc4462ad686ba06baa6727ac149a2d6277f0d240fd" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall 0.4.1", - "windows-sys 0.52.0", -] - -[[package]] -name = "fnv" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" - -[[package]] -name = "half" -version = "2.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dd08c532ae367adf81c312a4580bc67f1d0fe8bc9c460520283f4c0ff277888" -dependencies = [ - "cfg-if", - "crunchy", -] - -[[package]] -name = "hashbrown" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" - -[[package]] -name = "hashbrown" -version = "0.14.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "iana-time-zone" -version = "0.1.60" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" -dependencies = [ - "android_system_properties", - "core-foundation-sys", - "iana-time-zone-haiku", - "js-sys", - "wasm-bindgen", - "windows-core", -] - -[[package]] -name = "iana-time-zone-haiku" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" -dependencies = [ - "cc", -] - -[[package]] -name = "ident_case" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" - -[[package]] -name = "indexmap" -version = "1.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" -dependencies = [ - "autocfg", - "hashbrown 0.12.3", - "serde", -] - -[[package]] -name = "indexmap" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93ead53efc7ea8ed3cfb0c79fc8023fbb782a5432b52830b6518941cebe6505c" -dependencies = [ - "equivalent", - "hashbrown 0.14.5", - "serde", -] - -[[package]] -name = "itoa" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" - -[[package]] -name = "js-sys" -version = "0.3.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" -dependencies = [ - "wasm-bindgen", -] - -[[package]] -name = "json-strip-comments" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b271732a960335e715b6b2ae66a086f115c74eb97360e996d2bd809bfc063bba" -dependencies = [ - "memchr", -] - -[[package]] -name = "lazy_static" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" - -[[package]] -name = "libc" -version = "0.2.155" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" - -[[package]] -name = "libloading" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e310b3a6b5907f99202fcdb4960ff45b93735d7c7d96b760fcff8db2dc0e103d" -dependencies = [ - "cfg-if", - "windows-targets 0.52.6", -] - -[[package]] -name = "litrs" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4ce301924b7887e9d637144fdade93f9dfff9b60981d4ac161db09720d39aa5" - -[[package]] -name = "lock_api" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" -dependencies = [ - "autocfg", - "scopeguard", -] - -[[package]] -name = "log" -version = "0.4.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" - -[[package]] -name = "memchr" -version = "2.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" - -[[package]] -name = "miniz_oxide" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" -dependencies = [ - "adler", -] - -[[package]] -name = "napi" -version = "3.0.0-alpha.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ec04344cc540f5897e97c9821ab99e7eb276b4dca6f3e6e441dfa72e5bcde70" -dependencies = [ - "bitflags 2.6.0", - "ctor", - "napi-build", - "napi-sys", - "once_cell", - "serde", - "serde_json", -] - -[[package]] -name = "napi-build" -version = "2.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1c0f5d67ee408a4685b61f5ab7e58605c8ae3f2b4189f0127d804ff13d5560a" - -[[package]] -name = "napi-derive" -version = "3.0.0-alpha.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c6240c4ddca592cde608bbfa26e2af397c3596e413a0c65c9bbcb65c2f1e485" -dependencies = [ - "cfg-if", - "convert_case", - "napi-derive-backend", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "napi-derive-backend" -version = "2.0.0-alpha.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b32dcc50065508fe2f387076c17adbdf10e038d1c080d48b10196813d94ac6a8" -dependencies = [ - "convert_case", - "once_cell", - "proc-macro2", - "quote", - "regex", - "semver", - "syn", -] - -[[package]] -name = "napi-sys" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "427802e8ec3a734331fec1035594a210ce1ff4dc5bc1950530920ab717964ea3" -dependencies = [ - "libloading", -] - -[[package]] -name = "nibble_vec" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" -dependencies = [ - "smallvec", -] - -[[package]] -name = "normalize-path" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5438dd2b2ff4c6df6e1ce22d825ed2fa93ee2922235cc45186991717f0a892d" - -[[package]] -name = "num-conv" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" - -[[package]] -name = "num-traits" -version = "0.2.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" -dependencies = [ - "autocfg", -] - -[[package]] -name = "once_cell" -version = "1.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" - -[[package]] -name = "oorandom" -version = "11.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b410bbe7e14ab526a0e86877eb47c6996a2bd7746f027ba551028c925390e4e9" - -[[package]] -name = "oxc_napi_resolver" -version = "0.0.0" -dependencies = [ - "napi", - "napi-build", - "napi-derive", - "oxc_resolver", - "tracing-subscriber", -] - -[[package]] -name = "oxc_resolver" -version = "1.11.0" -dependencies = [ - "cfg-if", - "criterion2", - "dashmap", - "document-features", - "dunce", - "indexmap 2.4.0", - "json-strip-comments", - "normalize-path", - "once_cell", - "pnp", - "rayon", - "rustc-hash", - "serde", - "serde_json", - "simdutf8", - "thiserror", - "tracing", - "vfs", -] - -[[package]] -name = "parking_lot_core" -version = "0.9.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall 0.5.2", - "smallvec", - "windows-targets 0.52.6", -] - -[[package]] -name = "path-slash" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e91099d4268b0e11973f036e885d652fb0b21fedcf69738c627f94db6a44f42" - -[[package]] -name = "pathdiff" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8835116a5c179084a830efb3adc117ab007512b535bc1a21c991d3b32a6b44dd" - -[[package]] -name = "pin-project-lite" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" - -[[package]] -name = "pnp" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46770cee76a618023fea15411d0449dd066dc232cc17e4562f154da215f27af7" -dependencies = [ - "arca", - "byteorder", - "concurrent_lru", - "fancy-regex", - "lazy_static", - "miniz_oxide", - "pathdiff", - "regex", - "serde", - "serde_json", - "serde_with", - "thiserror", -] - -[[package]] -name = "powerfmt" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" - -[[package]] -name = "proc-macro2" -version = "1.0.86" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.36" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "radix_trie" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" -dependencies = [ - "endian-type", - "nibble_vec", -] - -[[package]] -name = "rayon" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" -dependencies = [ - "either", - "rayon-core", -] - -[[package]] -name = "rayon-core" -version = "1.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" -dependencies = [ - "crossbeam-deque", - "crossbeam-utils", -] - -[[package]] -name = "redox_syscall" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" -dependencies = [ - "bitflags 1.3.2", -] - -[[package]] -name = "redox_syscall" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c82cf8cff14456045f55ec4241383baeff27af886adb72ffb2162f99911de0fd" -dependencies = [ - "bitflags 2.6.0", -] - -[[package]] -name = "regex" -version = "1.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b91213439dad192326a0d7c6ee3955910425f441d7038e0d6933b0aec5c4517f" -dependencies = [ - "aho-corasick", - "memchr", - "regex-automata", - "regex-syntax", -] - -[[package]] -name = "regex-automata" -version = "0.4.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", -] - -[[package]] -name = "regex-syntax" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" - -[[package]] -name = "rustc-hash" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" - -[[package]] -name = "ryu" -version = "1.0.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" - -[[package]] -name = "same-file" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "scopeguard" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" - -[[package]] -name = "semver" -version = "1.0.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" - -[[package]] -name = "serde" -version = "1.0.209" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99fce0ffe7310761ca6bf9faf5115afbc19688edd00171d81b1bb1b116c63e09" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.209" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5831b979fd7b5439637af1752d535ff49f4860c0f341d1baeb6faf0f4242170" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "serde_json" -version = "1.0.127" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8043c06d9f82bd7271361ed64f415fe5e12a77fdb52e573e7f06a516dea329ad" -dependencies = [ - "indexmap 2.4.0", - "itoa", - "memchr", - "ryu", - "serde", -] - -[[package]] -name = "serde_with" -version = "3.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e73139bc5ec2d45e6c5fd85be5a46949c1c39a4c18e56915f5eb4c12f975e377" -dependencies = [ - "base64", - "chrono", - "hex", - "indexmap 1.9.3", - "indexmap 2.4.0", - "serde", - "serde_derive", - "serde_json", - "serde_with_macros", - "time", -] - -[[package]] -name = "serde_with_macros" -version = "3.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b80d3d6b56b64335c0180e5ffde23b3c5e08c14c585b51a15bd0e95393f46703" -dependencies = [ - "darling", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "sharded-slab" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" -dependencies = [ - "lazy_static", -] - -[[package]] -name = "simdutf8" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f27f6278552951f1f2b8cf9da965d10969b2efdea95a6ec47987ab46edfe263a" - -[[package]] -name = "smallvec" -version = "1.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" - -[[package]] -name = "strsim" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" - -[[package]] -name = "syn" -version = "2.0.70" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f0209b68b3613b093e0ec905354eccaedcfe83b8cb37cbdeae64026c3064c16" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "thiserror" -version = "1.0.63" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.63" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "thread_local" -version = "1.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" -dependencies = [ - "cfg-if", - "once_cell", -] - -[[package]] -name = "time" -version = "0.3.36" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" -dependencies = [ - "deranged", - "itoa", - "num-conv", - "powerfmt", - "serde", - "time-core", - "time-macros", -] - -[[package]] -name = "time-core" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" - -[[package]] -name = "time-macros" -version = "0.2.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" -dependencies = [ - "num-conv", - "time-core", -] - -[[package]] -name = "tracing" -version = "0.1.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" -dependencies = [ - "pin-project-lite", - "tracing-attributes", - "tracing-core", -] - -[[package]] -name = "tracing-attributes" -version = "0.1.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "tracing-core" -version = "0.1.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" -dependencies = [ - "once_cell", -] - -[[package]] -name = "tracing-subscriber" -version = "0.3.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" -dependencies = [ - "sharded-slab", - "thread_local", - "tracing-core", -] - -[[package]] -name = "unicode-ident" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" - -[[package]] -name = "unicode-segmentation" -version = "1.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" - -[[package]] -name = "vfs" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "654cd097e182a71dbf899178e6b5662c2157dd0b8afd5975de18008f6fc173d1" -dependencies = [ - "filetime", -] - -[[package]] -name = "walkdir" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" -dependencies = [ - "same-file", - "winapi-util", -] - -[[package]] -name = "wasm-bindgen" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" -dependencies = [ - "cfg-if", - "wasm-bindgen-macro", -] - -[[package]] -name = "wasm-bindgen-backend" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" -dependencies = [ - "bumpalo", - "log", - "once_cell", - "proc-macro2", - "quote", - "syn", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-macro" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" -dependencies = [ - "quote", - "wasm-bindgen-macro-support", -] - -[[package]] -name = "wasm-bindgen-macro-support" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" -dependencies = [ - "proc-macro2", - "quote", - "syn", - "wasm-bindgen-backend", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-shared" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" - -[[package]] -name = "winapi-util" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b" -dependencies = [ - "windows-sys 0.52.0", -] - -[[package]] -name = "windows-core" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" -dependencies = [ - "windows-targets 0.52.6", -] - -[[package]] -name = "windows-sys" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" -dependencies = [ - "windows-targets 0.48.5", -] - -[[package]] -name = "windows-sys" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" -dependencies = [ - "windows-targets 0.52.6", -] - -[[package]] -name = "windows-targets" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" -dependencies = [ - "windows_aarch64_gnullvm 0.48.5", - "windows_aarch64_msvc 0.48.5", - "windows_i686_gnu 0.48.5", - "windows_i686_msvc 0.48.5", - "windows_x86_64_gnu 0.48.5", - "windows_x86_64_gnullvm 0.48.5", - "windows_x86_64_msvc 0.48.5", -] - -[[package]] -name = "windows-targets" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" -dependencies = [ - "windows_aarch64_gnullvm 0.52.6", - "windows_aarch64_msvc 0.52.6", - "windows_i686_gnu 0.52.6", - "windows_i686_gnullvm", - "windows_i686_msvc 0.52.6", - "windows_x86_64_gnu 0.52.6", - "windows_x86_64_gnullvm 0.52.6", - "windows_x86_64_msvc 0.52.6", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" - -[[package]] -name = "windows_i686_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" - -[[package]] -name = "windows_i686_gnu" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" - -[[package]] -name = "windows_i686_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" - -[[package]] -name = "windows_i686_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" - -[[package]] -name = "windows_i686_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" diff --git a/fixtures/enhanced_resolve/lib/index.js b/fixtures/enhanced_resolve/lib/index.js deleted file mode 100644 index 1e872e8f..00000000 --- a/fixtures/enhanced_resolve/lib/index.js +++ /dev/null @@ -1 +0,0 @@ -// mimic enhanced-resolved root directory structure diff --git a/fixtures/enhanced_resolve/package.json b/fixtures/enhanced_resolve/package.json deleted file mode 100644 index d1b845b5..00000000 --- a/fixtures/enhanced_resolve/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "enhanced-resolve", - "main": "lib/index.js" -} diff --git a/fixtures/enhanced_resolve/test/.gitignore b/fixtures/enhanced_resolve/test/.gitignore deleted file mode 100644 index b021b4e4..00000000 --- a/fixtures/enhanced_resolve/test/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -# created by symlink.rs -/temp -/temp_symlinks \ No newline at end of file diff --git a/fixtures/enhanced_resolve/test/fixtures/#/a.js b/fixtures/enhanced_resolve/test/fixtures/#/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/a.js b/fixtures/enhanced_resolve/test/fixtures/a.js deleted file mode 100644 index 896ffc6d..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/abc.txt b/fixtures/enhanced_resolve/test/fixtures/abc.txt deleted file mode 100644 index f2ba8f84..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/abc.txt +++ /dev/null @@ -1 +0,0 @@ -abc \ No newline at end of file diff --git a/fixtures/enhanced_resolve/test/fixtures/alias/files/a.js b/fixtures/enhanced_resolve/test/fixtures/alias/files/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/b.js b/fixtures/enhanced_resolve/test/fixtures/b.js deleted file mode 100644 index 11476340..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/b.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function b() { - return "This is b"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/browser/module-a.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/browser/module-a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/browser.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/ignore.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/ignore.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/replaced.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/replaced.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/self.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/self.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/toString.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/toString.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-a.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-b.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-c.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-c.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/a.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/b.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/c.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/c.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/d.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/d.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json deleted file mode 100644 index c13fe23b..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "browser": { - "a.js": "./a", - "./b.js": "./b", - "c.js": "./d.js", - "./d.js": "./c.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/package.json b/fixtures/enhanced_resolve/test/fixtures/browser-module/package.json deleted file mode 100644 index 19ff7739..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/browser-module/package.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "exports": { - "./lib/index.js": "./lib/index.js" - }, - "browser": { - "./lib/ignore.js": false, - "./lib/replaced.js": "./lib/browser", - "module-a": "./browser/module-a.js", - "module-b": "module-c", - "module-c": "module-c", - "./toString": "./lib/toString.js", - "./lib/main.js": "./lib/main.js", - "./main.js": "./lib/main.js", - "./lib/xyz.js": "./xyz.js", - "./xyz.js": "./lib/xyz.js", - "./lib/non-existent.js": "./lib/non-existent.js", - ".": false, - "./number": 1, - "./foo": "./lib/replaced.js?query" - }, - "innerBrowser1": { - "field": { - "browser": { - "./lib/main1.js": "./lib/main.js" - } - } - }, - "innerBrowser2": { - "browser": { - "./lib/main2.js": "./lib/replaced.js" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/builtins/package.json b/fixtures/enhanced_resolve/test/fixtures/builtins/package.json deleted file mode 100644 index 4a54ea96..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/builtins/package.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "name": "builtins", - "private": true, - "imports": { - "#fs": { - "default": "fs" - }, - "#http": { - "node": "node:http" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/c.js b/fixtures/enhanced_resolve/test/fixtures/c.js deleted file mode 100644 index e3aca8aa..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/c.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = function b() { - require("./a"); - return "This is c"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/complex.js b/fixtures/enhanced_resolve/test/fixtures/complex.js deleted file mode 100644 index 1f62db84..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/complex.js +++ /dev/null @@ -1,13 +0,0 @@ -var 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); diff --git a/fixtures/enhanced_resolve/test/fixtures/crypto-js/index.js b/fixtures/enhanced_resolve/test/fixtures/crypto-js/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json b/fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json deleted file mode 100644 index 1d31aa8b..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "crypto-js", - "main": "index.js", - "browser": { - "crypto": false - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/decorated-fs/exists.js b/fixtures/enhanced_resolve/test/fixtures/decorated-fs/exists.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/dirOrFile.js b/fixtures/enhanced_resolve/test/fixtures/dirOrFile.js deleted file mode 100644 index c3cb885f..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/dirOrFile.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "file"; diff --git a/fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js b/fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js deleted file mode 100644 index 85e01cd4..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "dir"; diff --git a/fixtures/enhanced_resolve/test/fixtures/directory-default/directory-default.js b/fixtures/enhanced_resolve/test/fixtures/directory-default/directory-default.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js deleted file mode 100644 index d1007aae..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js +++ /dev/null @@ -1 +0,0 @@ -export default "string"; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts deleted file mode 100644 index cb0ff5c3..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json deleted file mode 100644 index b523a1e9..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "@org/pkg", - "exports": { - "./*.js": { - "types": "./dist/*.d.ts", - "default": "./dist/*.js" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js deleted file mode 100644 index d1007aae..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js +++ /dev/null @@ -1 +0,0 @@ -export default "string"; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts deleted file mode 100644 index cb0ff5c3..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json deleted file mode 100644 index 8e55fb46..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "@raviqqe/hidash", - "exports": { - "./*.js": { - "types": "./dist/*.d.ts", - "default": "./dist/*.js" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json deleted file mode 100644 index f0edf449..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "exports-field", - "version": "1.0.0", - "exports": { - ".": "./a/../b/../../pack1/index.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/pack1/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/pack1/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/a.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/a.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json deleted file mode 100644 index 6b105c08..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "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/": { - "webpack": ["./lib/lib2/", "./lib/"], - "node": "./lib/", - "default": "./lib/" - }, - "./dist/a.js": "./../../a.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json deleted file mode 100644 index 0012a3de..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "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" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/umd.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/umd.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field/package.json deleted file mode 100644 index 5fa72bb5..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "@exports-field/core", - "version": "1.0.0", - "exports": "./a.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json deleted file mode 100644 index e6f12074..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "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/lib2/", "./lib/"], - "node": "./lib/", - "default": "./lib/" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/index b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/index deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json deleted file mode 100644 index 1a838f49..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "name": "exports-field", - "exportsField": { - "exports": "./main.js" - }, - "ex": "./index", - "broken": { - ".": "./src" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/src/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/src/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.ts b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.mts b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.mts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mjs b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mjs deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mts.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mts.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.ts b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/app.module.js b/fixtures/enhanced_resolve/test/fixtures/extensions/app.module.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.js b/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/foo.js b/fixtures/enhanced_resolve/test/fixtures/extensions/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/foo.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/foo.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/index.js b/fixtures/enhanced_resolve/test/fixtures/extensions/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/index.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module.js b/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module/index.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/package.json b/fixtures/enhanced_resolve/test/fixtures/extensions/package.json deleted file mode 100644 index 5e55a1e8..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/extensions/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "./index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/file.load1 b/fixtures/enhanced_resolve/test/fixtures/file.load1 deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/file.load2 b/fixtures/enhanced_resolve/test/fixtures/file.load2 deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/foo/index.js b/fixtures/enhanced_resolve/test/fixtures/foo/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/foo/package.json b/fixtures/enhanced_resolve/test/fixtures/foo/package.json deleted file mode 100644 index da86787a..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/foo/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "foo", - "version": "1.0.0" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json deleted file mode 100644 index aa2be496..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "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" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/internal/file.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/internal/file.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/y/y.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/y/y.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/internal/i.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/internal/i.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/nested/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js deleted file mode 100644 index e5b70a86..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = { nested: "nested" } diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-3/nested/f/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-3/nested/f/nested/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-4/f/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-4/f/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f$/$.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f$/$.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f/$.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f/$.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/nested/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/a.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/a.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/b.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/dir/b.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/dir/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/index.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json deleted file mode 100644 index 8d8d3a46..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "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/lib2/", "./lib/"], - "node": "./lib/", - "default": "./lib/" - }, - "./dist/a.js": "./../../a.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/c/index.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/c/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/imports-field/package.json deleted file mode 100644 index 248351a9..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "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" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/a.js b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json deleted file mode 100644 index ded7faa2..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json +++ /dev/null @@ -1,2 +0,0 @@ -{ - "main": "./a.js", diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/a.js b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/package.json b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/package.json deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/issue-238/package.json b/fixtures/enhanced_resolve/test/fixtures/issue-238/package.json deleted file mode 100644 index 352055cd..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/issue-238/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "private": true -} diff --git a/fixtures/enhanced_resolve/test/fixtures/issue-238/src/a/config.js b/fixtures/enhanced_resolve/test/fixtures/issue-238/src/a/config.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/issue-238/src/common/config/myObjectFile.js b/fixtures/enhanced_resolve/test/fixtures/issue-238/src/common/config/myObjectFile.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/lib.js b/fixtures/enhanced_resolve/test/fixtures/lib.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/lib/complex1.js b/fixtures/enhanced_resolve/test/fixtures/lib/complex1.js deleted file mode 100644 index b3de3d70..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/lib/complex1.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "lib complex1"; diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self/index.js b/fixtures/enhanced_resolve/test/fixtures/main-field-self/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json b/fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json deleted file mode 100644 index a2b6f341..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "./" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self2/index.js b/fixtures/enhanced_resolve/test/fixtures/main-field-self2/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json b/fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json deleted file mode 100644 index 4fa6f730..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "." -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main1.js b/fixtures/enhanced_resolve/test/fixtures/main1.js deleted file mode 100644 index 168f2a1e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main1.js +++ /dev/null @@ -1,9 +0,0 @@ -var a = require("./a"); -if (x) { - for (var i = 0; i < 100; i++) { - while (true) require("./b"); - do { - i++; - } while (require("m1/a")()); - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main2.js b/fixtures/enhanced_resolve/test/fixtures/main2.js deleted file mode 100644 index 39f062b1..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main2.js +++ /dev/null @@ -1,12 +0,0 @@ -var 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"); - }); - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main3.js b/fixtures/enhanced_resolve/test/fixtures/main3.js deleted file mode 100644 index 1c180166..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main3.js +++ /dev/null @@ -1,4 +0,0 @@ -var a = require("./a"); -require.ensure([], function(require) { - require("./c.js"); -}); diff --git a/fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js b/fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js deleted file mode 100644 index 997c1051..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is nested m1/a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/no#fragment/#/#.js b/fixtures/enhanced_resolve/test/fixtures/no#fragment/#/#.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/no.js b/fixtures/enhanced_resolve/test/fixtures/no.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/browser.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/browser.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/main.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json deleted file mode 100644 index c469e1fd..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "main": "./main.js", - "browser": "./browser.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js deleted file mode 100644 index 549620a5..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "the correct a.js"; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js deleted file mode 100644 index 5db6632e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = " :) " + require("m2/b.js"); diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js deleted file mode 100644 index d308569d..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require("m1/a") + require("m1"); diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js deleted file mode 100644 index cb8127e8..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "Step2"; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json deleted file mode 100644 index 8d6dfa56..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "dash-name", - "exports": "./index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json deleted file mode 100644 index 4fd8706e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "dash", - "exports": "./index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/invalidPackageJson/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/invalidPackageJson/package.json deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js deleted file mode 100644 index 46fc8e6c..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is m1/a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js deleted file mode 100644 index 8565c244..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is m1/b"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js deleted file mode 100644 index 34faaaf5..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "This is m2/b"; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/file.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/file.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js b/fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js deleted file mode 100644 index 997c1051..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is nested m1/a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/dir/index.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/dir/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/index.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/main.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/browser.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/browser.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/index.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json deleted file mode 100644 index e20ceaeb..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "main": "main.js", - "browser": { - "./package-alias/index.js": "./package-alias/browser.js", - "module": "pkg/dir/index" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/typescript/index.ts b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/typescript/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json deleted file mode 100644 index 4a1f838e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "@exports-field/core", - "version": "1.0.0", - "exports": { - ".": "./a.js", - "./x": "./a.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/prefer-pnp/alternative-modules/m1/b.js b/fixtures/enhanced_resolve/test/fixtures/prefer-pnp/alternative-modules/m1/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.css b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.css deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.js b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json deleted file mode 100644 index 14ab704d..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/index.css b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/index.css deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/module.js b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/module.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json deleted file mode 100644 index ee0eb71b..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "main": "../../../c.js", - "module": "module.js", - "style": "index.css" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/roots_fall_through/index.js b/fixtures/enhanced_resolve/test/fixtures/roots_fall_through/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/main.js b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json deleted file mode 100644 index 70a0f20f..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "browser": { - "./index.js": "./main.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/lib/index.js b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/lib/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/main.js b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json deleted file mode 100644 index 2af9e0d1..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "./main.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/shortcutdir.js/a.js b/fixtures/enhanced_resolve/test/fixtures/shortcutdir.js/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/b b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/b deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/c b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/c deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/a b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/a deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/b b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/b deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/b/foo/a b/fixtures/enhanced_resolve/test/fixtures/yield/b/foo/a deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/a b/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/a deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json b/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json deleted file mode 100644 index 0acc4b4c..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "foo", - "version": "1.0.0", - "browser": { - "./a": false - } -} diff --git "a/fixtures/enhanced_resolve/test/fixtures/\346\265\213\350\257\225.js" "b/fixtures/enhanced_resolve/test/fixtures/\346\265\213\350\257\225.js" deleted file mode 100644 index e69de29b..00000000 diff --git "a/fixtures/misc/\344\270\255\346\226\207/\344\270\255\346\226\207.js" "b/fixtures/misc/\344\270\255\346\226\207/\344\270\255\346\226\207.js" deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/pnp/.gitignore b/fixtures/pnp/.gitignore deleted file mode 100644 index 1783c71a..00000000 --- a/fixtures/pnp/.gitignore +++ /dev/null @@ -1 +0,0 @@ -install_state.gz \ No newline at end of file diff --git a/fixtures/pnp/.pnp.cjs b/fixtures/pnp/.pnp.cjs deleted file mode 100755 index 2a8d1771..00000000 --- a/fixtures/pnp/.pnp.cjs +++ /dev/null @@ -1,7543 +0,0 @@ -#!/usr/bin/env node -/* eslint-disable */ -// @ts-nocheck -"use strict"; - -const RAW_RUNTIME_STATE = -'{\ - "__info": [\ - "This file is automatically generated. Do not touch it, or risk",\ - "your modifications being lost."\ - ],\ - "dependencyTreeRoots": [\ - {\ - "name": "pnp",\ - "reference": "workspace:."\ - }\ - ],\ - "enableTopLevelFallback": true,\ - "ignorePatternData": "(^(?:\\\\.yarn\\\\/sdks(?:\\\\/(?!\\\\.{1,2}(?:\\\\/|$))(?:(?:(?!(?:^|\\\\/)\\\\.{1,2}(?:\\\\/|$)).)*?)|$))$)",\ - "fallbackExclusionList": [\ - ["pnp", ["workspace:."]]\ - ],\ - "fallbackPool": [\ - ],\ - "packageRegistryData": [\ - [null, [\ - [null, {\ - "packageLocation": "./",\ - "packageDependencies": [\ - ["is-even", "npm:1.0.0"],\ - ["is-odd", "npm:3.0.1"]\ - ],\ - "linkType": "SOFT"\ - }]\ - ]],\ - ["is-buffer", [\ - ["npm:1.1.6", {\ - "packageLocation": "./.yarn/cache/is-buffer-npm-1.1.6-08199d9ccc-ae18aa0b6e.zip/node_modules/is-buffer/",\ - "packageDependencies": [\ - ["is-buffer", "npm:1.1.6"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["is-even", [\ - ["npm:1.0.0", {\ - "packageLocation": "./.yarn/cache/is-even-npm-1.0.0-9f726520dc-2728cc2f39.zip/node_modules/is-even/",\ - "packageDependencies": [\ - ["is-even", "npm:1.0.0"],\ - ["is-odd", "npm:0.1.2"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["is-number", [\ - ["npm:3.0.0", {\ - "packageLocation": "./.yarn/cache/is-number-npm-3.0.0-9088035ade-e639c54640.zip/node_modules/is-number/",\ - "packageDependencies": [\ - ["is-number", "npm:3.0.0"],\ - ["kind-of", "npm:3.2.2"]\ - ],\ - "linkType": "HARD"\ - }],\ - ["npm:6.0.0", {\ - "packageLocation": "./.yarn/cache/is-number-npm-6.0.0-30881e83e6-5da4c68401.zip/node_modules/is-number/",\ - "packageDependencies": [\ - ["is-number", "npm:6.0.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["is-odd", [\ - ["npm:0.1.2", {\ - "packageLocation": "./.yarn/cache/is-odd-npm-0.1.2-9d980a9da8-7dc6c6fd00.zip/node_modules/is-odd/",\ - "packageDependencies": [\ - ["is-odd", "npm:0.1.2"],\ - ["is-number", "npm:3.0.0"]\ - ],\ - "linkType": "HARD"\ - }],\ - ["npm:3.0.1", {\ - "packageLocation": "./.yarn/cache/is-odd-npm-3.0.1-93c3c3f41b-89ee2e353c.zip/node_modules/is-odd/",\ - "packageDependencies": [\ - ["is-odd", "npm:3.0.1"],\ - ["is-number", "npm:6.0.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["kind-of", [\ - ["npm:3.2.2", {\ - "packageLocation": "./.yarn/cache/kind-of-npm-3.2.2-7deaffa5f9-7e34bc29d4.zip/node_modules/kind-of/",\ - "packageDependencies": [\ - ["kind-of", "npm:3.2.2"],\ - ["is-buffer", "npm:1.1.6"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["pnp", [\ - ["workspace:.", {\ - "packageLocation": "./",\ - "packageDependencies": [\ - ["pnp", "workspace:."],\ - ["is-even", "npm:1.0.0"],\ - ["is-odd", "npm:3.0.1"]\ - ],\ - "linkType": "SOFT"\ - }]\ - ]]\ - ]\ -}'; - -function $$SETUP_STATE(hydrateRuntimeState, basePath) { - return hydrateRuntimeState(JSON.parse(RAW_RUNTIME_STATE), {basePath: basePath || __dirname}); -} - -const fs = require('fs'); -const path = require('path'); -const crypto = require('crypto'); -const os = require('os'); -const events = require('events'); -const nodeUtils = require('util'); -const stream = require('stream'); -const zlib = require('zlib'); -const require$$0 = require('module'); -const StringDecoder = require('string_decoder'); -const url = require('url'); -const buffer = require('buffer'); -const readline = require('readline'); -const assert = require('assert'); - -const _interopDefaultLegacy = e => e && typeof e === 'object' && 'default' in e ? e : { default: e }; - -function _interopNamespace(e) { - if (e && e.__esModule) return e; - const n = Object.create(null); - if (e) { - for (const k in e) { - if (k !== 'default') { - const d = Object.getOwnPropertyDescriptor(e, k); - Object.defineProperty(n, k, d.get ? d : { - enumerable: true, - get: () => e[k] - }); - } - } - } - n.default = e; - return Object.freeze(n); -} - -const fs__default = /*#__PURE__*/_interopDefaultLegacy(fs); -const path__default = /*#__PURE__*/_interopDefaultLegacy(path); -const nodeUtils__namespace = /*#__PURE__*/_interopNamespace(nodeUtils); -const zlib__default = /*#__PURE__*/_interopDefaultLegacy(zlib); -const require$$0__default = /*#__PURE__*/_interopDefaultLegacy(require$$0); -const StringDecoder__default = /*#__PURE__*/_interopDefaultLegacy(StringDecoder); -const buffer__default = /*#__PURE__*/_interopDefaultLegacy(buffer); -const assert__default = /*#__PURE__*/_interopDefaultLegacy(assert); - -const S_IFMT = 61440; -const S_IFDIR = 16384; -const S_IFREG = 32768; -const S_IFLNK = 40960; -const SAFE_TIME = 456789e3; - -function makeError$1(code, message) { - return Object.assign(new Error(`${code}: ${message}`), { code }); -} -function EBUSY(message) { - return makeError$1(`EBUSY`, message); -} -function ENOSYS(message, reason) { - return makeError$1(`ENOSYS`, `${message}, ${reason}`); -} -function EINVAL(reason) { - return makeError$1(`EINVAL`, `invalid argument, ${reason}`); -} -function EBADF(reason) { - return makeError$1(`EBADF`, `bad file descriptor, ${reason}`); -} -function ENOENT(reason) { - return makeError$1(`ENOENT`, `no such file or directory, ${reason}`); -} -function ENOTDIR(reason) { - return makeError$1(`ENOTDIR`, `not a directory, ${reason}`); -} -function EISDIR(reason) { - return makeError$1(`EISDIR`, `illegal operation on a directory, ${reason}`); -} -function EEXIST(reason) { - return makeError$1(`EEXIST`, `file already exists, ${reason}`); -} -function EROFS(reason) { - return makeError$1(`EROFS`, `read-only filesystem, ${reason}`); -} -function ENOTEMPTY(reason) { - return makeError$1(`ENOTEMPTY`, `directory not empty, ${reason}`); -} -function EOPNOTSUPP(reason) { - return makeError$1(`EOPNOTSUPP`, `operation not supported, ${reason}`); -} -function ERR_DIR_CLOSED() { - return makeError$1(`ERR_DIR_CLOSED`, `Directory handle was closed`); -} - -const DEFAULT_MODE = S_IFREG | 420; -class StatEntry { - constructor() { - this.uid = 0; - this.gid = 0; - this.size = 0; - this.blksize = 0; - this.atimeMs = 0; - this.mtimeMs = 0; - this.ctimeMs = 0; - this.birthtimeMs = 0; - this.atime = new Date(0); - this.mtime = new Date(0); - this.ctime = new Date(0); - this.birthtime = new Date(0); - this.dev = 0; - this.ino = 0; - this.mode = DEFAULT_MODE; - this.nlink = 1; - this.rdev = 0; - this.blocks = 1; - } - isBlockDevice() { - return false; - } - isCharacterDevice() { - return false; - } - isDirectory() { - return (this.mode & S_IFMT) === S_IFDIR; - } - isFIFO() { - return false; - } - isFile() { - return (this.mode & S_IFMT) === S_IFREG; - } - isSocket() { - return false; - } - isSymbolicLink() { - return (this.mode & S_IFMT) === S_IFLNK; - } -} -class BigIntStatsEntry { - constructor() { - this.uid = BigInt(0); - this.gid = BigInt(0); - this.size = BigInt(0); - this.blksize = BigInt(0); - this.atimeMs = BigInt(0); - this.mtimeMs = BigInt(0); - this.ctimeMs = BigInt(0); - this.birthtimeMs = BigInt(0); - this.atimeNs = BigInt(0); - this.mtimeNs = BigInt(0); - this.ctimeNs = BigInt(0); - this.birthtimeNs = BigInt(0); - this.atime = new Date(0); - this.mtime = new Date(0); - this.ctime = new Date(0); - this.birthtime = new Date(0); - this.dev = BigInt(0); - this.ino = BigInt(0); - this.mode = BigInt(DEFAULT_MODE); - this.nlink = BigInt(1); - this.rdev = BigInt(0); - this.blocks = BigInt(1); - } - isBlockDevice() { - return false; - } - isCharacterDevice() { - return false; - } - isDirectory() { - return (this.mode & BigInt(S_IFMT)) === BigInt(S_IFDIR); - } - isFIFO() { - return false; - } - isFile() { - return (this.mode & BigInt(S_IFMT)) === BigInt(S_IFREG); - } - isSocket() { - return false; - } - isSymbolicLink() { - return (this.mode & BigInt(S_IFMT)) === BigInt(S_IFLNK); - } -} -function makeDefaultStats() { - return new StatEntry(); -} -function clearStats(stats) { - for (const key in stats) { - if (Object.hasOwn(stats, key)) { - const element = stats[key]; - if (typeof element === `number`) { - stats[key] = 0; - } else if (typeof element === `bigint`) { - stats[key] = BigInt(0); - } else if (nodeUtils__namespace.types.isDate(element)) { - stats[key] = new Date(0); - } - } - } - return stats; -} -function convertToBigIntStats(stats) { - const bigintStats = new BigIntStatsEntry(); - for (const key in stats) { - if (Object.hasOwn(stats, key)) { - const element = stats[key]; - if (typeof element === `number`) { - bigintStats[key] = BigInt(element); - } else if (nodeUtils__namespace.types.isDate(element)) { - bigintStats[key] = new Date(element); - } - } - } - bigintStats.atimeNs = bigintStats.atimeMs * BigInt(1e6); - bigintStats.mtimeNs = bigintStats.mtimeMs * BigInt(1e6); - bigintStats.ctimeNs = bigintStats.ctimeMs * BigInt(1e6); - bigintStats.birthtimeNs = bigintStats.birthtimeMs * BigInt(1e6); - return bigintStats; -} -function areStatsEqual(a, b) { - if (a.atimeMs !== b.atimeMs) - return false; - if (a.birthtimeMs !== b.birthtimeMs) - return false; - if (a.blksize !== b.blksize) - return false; - if (a.blocks !== b.blocks) - return false; - if (a.ctimeMs !== b.ctimeMs) - return false; - if (a.dev !== b.dev) - return false; - if (a.gid !== b.gid) - return false; - if (a.ino !== b.ino) - return false; - if (a.isBlockDevice() !== b.isBlockDevice()) - return false; - if (a.isCharacterDevice() !== b.isCharacterDevice()) - return false; - if (a.isDirectory() !== b.isDirectory()) - return false; - if (a.isFIFO() !== b.isFIFO()) - return false; - if (a.isFile() !== b.isFile()) - return false; - if (a.isSocket() !== b.isSocket()) - return false; - if (a.isSymbolicLink() !== b.isSymbolicLink()) - return false; - if (a.mode !== b.mode) - return false; - if (a.mtimeMs !== b.mtimeMs) - return false; - if (a.nlink !== b.nlink) - return false; - if (a.rdev !== b.rdev) - return false; - if (a.size !== b.size) - return false; - if (a.uid !== b.uid) - return false; - const aN = a; - const bN = b; - if (aN.atimeNs !== bN.atimeNs) - return false; - if (aN.mtimeNs !== bN.mtimeNs) - return false; - if (aN.ctimeNs !== bN.ctimeNs) - return false; - if (aN.birthtimeNs !== bN.birthtimeNs) - return false; - return true; -} - -const PortablePath = { - root: `/`, - dot: `.`, - parent: `..` -}; -const Filename = { - home: `~`, - nodeModules: `node_modules`, - manifest: `package.json`, - lockfile: `yarn.lock`, - virtual: `__virtual__`, - pnpJs: `.pnp.js`, - pnpCjs: `.pnp.cjs`, - pnpData: `.pnp.data.json`, - pnpEsmLoader: `.pnp.loader.mjs`, - rc: `.yarnrc.yml`, - env: `.env` -}; -const npath = Object.create(path__default.default); -const ppath = Object.create(path__default.default.posix); -npath.cwd = () => process.cwd(); -ppath.cwd = process.platform === `win32` ? () => toPortablePath(process.cwd()) : process.cwd; -if (process.platform === `win32`) { - ppath.resolve = (...segments) => { - if (segments.length > 0 && ppath.isAbsolute(segments[0])) { - return path__default.default.posix.resolve(...segments); - } else { - return path__default.default.posix.resolve(ppath.cwd(), ...segments); - } - }; -} -const contains = function(pathUtils, from, to) { - from = pathUtils.normalize(from); - to = pathUtils.normalize(to); - if (from === to) - return `.`; - if (!from.endsWith(pathUtils.sep)) - from = from + pathUtils.sep; - if (to.startsWith(from)) { - return to.slice(from.length); - } else { - return null; - } -}; -npath.contains = (from, to) => contains(npath, from, to); -ppath.contains = (from, to) => contains(ppath, from, to); -const WINDOWS_PATH_REGEXP = /^([a-zA-Z]:.*)$/; -const UNC_WINDOWS_PATH_REGEXP = /^\/\/(\.\/)?(.*)$/; -const PORTABLE_PATH_REGEXP = /^\/([a-zA-Z]:.*)$/; -const UNC_PORTABLE_PATH_REGEXP = /^\/unc\/(\.dot\/)?(.*)$/; -function fromPortablePathWin32(p) { - let portablePathMatch, uncPortablePathMatch; - if (portablePathMatch = p.match(PORTABLE_PATH_REGEXP)) - p = portablePathMatch[1]; - else if (uncPortablePathMatch = p.match(UNC_PORTABLE_PATH_REGEXP)) - p = `\\\\${uncPortablePathMatch[1] ? `.\\` : ``}${uncPortablePathMatch[2]}`; - else - return p; - return p.replace(/\//g, `\\`); -} -function toPortablePathWin32(p) { - p = p.replace(/\\/g, `/`); - let windowsPathMatch, uncWindowsPathMatch; - if (windowsPathMatch = p.match(WINDOWS_PATH_REGEXP)) - p = `/${windowsPathMatch[1]}`; - else if (uncWindowsPathMatch = p.match(UNC_WINDOWS_PATH_REGEXP)) - p = `/unc/${uncWindowsPathMatch[1] ? `.dot/` : ``}${uncWindowsPathMatch[2]}`; - return p; -} -const toPortablePath = process.platform === `win32` ? toPortablePathWin32 : (p) => p; -const fromPortablePath = process.platform === `win32` ? fromPortablePathWin32 : (p) => p; -npath.fromPortablePath = fromPortablePath; -npath.toPortablePath = toPortablePath; -function convertPath(targetPathUtils, sourcePath) { - return targetPathUtils === npath ? fromPortablePath(sourcePath) : toPortablePath(sourcePath); -} - -const defaultTime = new Date(SAFE_TIME * 1e3); -const defaultTimeMs = defaultTime.getTime(); -async function copyPromise(destinationFs, destination, sourceFs, source, opts) { - const normalizedDestination = destinationFs.pathUtils.normalize(destination); - const normalizedSource = sourceFs.pathUtils.normalize(source); - const prelayout = []; - const postlayout = []; - const { atime, mtime } = opts.stableTime ? { atime: defaultTime, mtime: defaultTime } : await sourceFs.lstatPromise(normalizedSource); - await destinationFs.mkdirpPromise(destinationFs.pathUtils.dirname(destination), { utimes: [atime, mtime] }); - await copyImpl(prelayout, postlayout, destinationFs, normalizedDestination, sourceFs, normalizedSource, { ...opts, didParentExist: true }); - for (const operation of prelayout) - await operation(); - await Promise.all(postlayout.map((operation) => { - return operation(); - })); -} -async function copyImpl(prelayout, postlayout, destinationFs, destination, sourceFs, source, opts) { - const destinationStat = opts.didParentExist ? await maybeLStat(destinationFs, destination) : null; - const sourceStat = await sourceFs.lstatPromise(source); - const { atime, mtime } = opts.stableTime ? { atime: defaultTime, mtime: defaultTime } : sourceStat; - let updated; - switch (true) { - case sourceStat.isDirectory(): - { - updated = await copyFolder(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts); - } - break; - case sourceStat.isFile(): - { - updated = await copyFile(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts); - } - break; - case sourceStat.isSymbolicLink(): - { - updated = await copySymlink(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts); - } - break; - default: { - throw new Error(`Unsupported file type (${sourceStat.mode})`); - } - } - if (opts.linkStrategy?.type !== `HardlinkFromIndex` || !sourceStat.isFile()) { - if (updated || destinationStat?.mtime?.getTime() !== mtime.getTime() || destinationStat?.atime?.getTime() !== atime.getTime()) { - postlayout.push(() => destinationFs.lutimesPromise(destination, atime, mtime)); - updated = true; - } - if (destinationStat === null || (destinationStat.mode & 511) !== (sourceStat.mode & 511)) { - postlayout.push(() => destinationFs.chmodPromise(destination, sourceStat.mode & 511)); - updated = true; - } - } - return updated; -} -async function maybeLStat(baseFs, p) { - try { - return await baseFs.lstatPromise(p); - } catch (e) { - return null; - } -} -async function copyFolder(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts) { - if (destinationStat !== null && !destinationStat.isDirectory()) { - if (opts.overwrite) { - prelayout.push(async () => destinationFs.removePromise(destination)); - destinationStat = null; - } else { - return false; - } - } - let updated = false; - if (destinationStat === null) { - prelayout.push(async () => { - try { - await destinationFs.mkdirPromise(destination, { mode: sourceStat.mode }); - } catch (err) { - if (err.code !== `EEXIST`) { - throw err; - } - } - }); - updated = true; - } - const entries = await sourceFs.readdirPromise(source); - const nextOpts = opts.didParentExist && !destinationStat ? { ...opts, didParentExist: false } : opts; - if (opts.stableSort) { - for (const entry of entries.sort()) { - if (await copyImpl(prelayout, postlayout, destinationFs, destinationFs.pathUtils.join(destination, entry), sourceFs, sourceFs.pathUtils.join(source, entry), nextOpts)) { - updated = true; - } - } - } else { - const entriesUpdateStatus = await Promise.all(entries.map(async (entry) => { - await copyImpl(prelayout, postlayout, destinationFs, destinationFs.pathUtils.join(destination, entry), sourceFs, sourceFs.pathUtils.join(source, entry), nextOpts); - })); - if (entriesUpdateStatus.some((status) => status)) { - updated = true; - } - } - return updated; -} -async function copyFileViaIndex(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts, linkStrategy) { - const sourceHash = await sourceFs.checksumFilePromise(source, { algorithm: `sha1` }); - const defaultMode = 420; - const sourceMode = sourceStat.mode & 511; - const indexFileName = `${sourceHash}${sourceMode !== defaultMode ? sourceMode.toString(8) : ``}`; - const indexPath = destinationFs.pathUtils.join(linkStrategy.indexPath, sourceHash.slice(0, 2), `${indexFileName}.dat`); - let AtomicBehavior; - ((AtomicBehavior2) => { - AtomicBehavior2[AtomicBehavior2["Lock"] = 0] = "Lock"; - AtomicBehavior2[AtomicBehavior2["Rename"] = 1] = "Rename"; - })(AtomicBehavior || (AtomicBehavior = {})); - let atomicBehavior = 1 /* Rename */; - let indexStat = await maybeLStat(destinationFs, indexPath); - if (destinationStat) { - const isDestinationHardlinkedFromIndex = indexStat && destinationStat.dev === indexStat.dev && destinationStat.ino === indexStat.ino; - const isIndexModified = indexStat?.mtimeMs !== defaultTimeMs; - if (isDestinationHardlinkedFromIndex) { - if (isIndexModified && linkStrategy.autoRepair) { - atomicBehavior = 0 /* Lock */; - indexStat = null; - } - } - if (!isDestinationHardlinkedFromIndex) { - if (opts.overwrite) { - prelayout.push(async () => destinationFs.removePromise(destination)); - destinationStat = null; - } else { - return false; - } - } - } - const tempPath = !indexStat && atomicBehavior === 1 /* Rename */ ? `${indexPath}.${Math.floor(Math.random() * 4294967296).toString(16).padStart(8, `0`)}` : null; - let tempPathCleaned = false; - prelayout.push(async () => { - if (!indexStat) { - if (atomicBehavior === 0 /* Lock */) { - await destinationFs.lockPromise(indexPath, async () => { - const content = await sourceFs.readFilePromise(source); - await destinationFs.writeFilePromise(indexPath, content); - }); - } - if (atomicBehavior === 1 /* Rename */ && tempPath) { - const content = await sourceFs.readFilePromise(source); - await destinationFs.writeFilePromise(tempPath, content); - try { - await destinationFs.linkPromise(tempPath, indexPath); - } catch (err) { - if (err.code === `EEXIST`) { - tempPathCleaned = true; - await destinationFs.unlinkPromise(tempPath); - } else { - throw err; - } - } - } - } - if (!destinationStat) { - await destinationFs.linkPromise(indexPath, destination); - } - }); - postlayout.push(async () => { - if (!indexStat) { - await destinationFs.lutimesPromise(indexPath, defaultTime, defaultTime); - if (sourceMode !== defaultMode) { - await destinationFs.chmodPromise(indexPath, sourceMode); - } - } - if (tempPath && !tempPathCleaned) { - await destinationFs.unlinkPromise(tempPath); - } - }); - return false; -} -async function copyFileDirect(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts) { - if (destinationStat !== null) { - if (opts.overwrite) { - prelayout.push(async () => destinationFs.removePromise(destination)); - destinationStat = null; - } else { - return false; - } - } - prelayout.push(async () => { - const content = await sourceFs.readFilePromise(source); - await destinationFs.writeFilePromise(destination, content); - }); - return true; -} -async function copyFile(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts) { - if (opts.linkStrategy?.type === `HardlinkFromIndex`) { - return copyFileViaIndex(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts, opts.linkStrategy); - } else { - return copyFileDirect(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts); - } -} -async function copySymlink(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts) { - if (destinationStat !== null) { - if (opts.overwrite) { - prelayout.push(async () => destinationFs.removePromise(destination)); - destinationStat = null; - } else { - return false; - } - } - prelayout.push(async () => { - await destinationFs.symlinkPromise(convertPath(destinationFs.pathUtils, await sourceFs.readlinkPromise(source)), destination); - }); - return true; -} - -class CustomDir { - constructor(path, nextDirent, opts = {}) { - this.path = path; - this.nextDirent = nextDirent; - this.opts = opts; - this.closed = false; - } - throwIfClosed() { - if (this.closed) { - throw ERR_DIR_CLOSED(); - } - } - async *[Symbol.asyncIterator]() { - try { - let dirent; - while ((dirent = await this.read()) !== null) { - yield dirent; - } - } finally { - await this.close(); - } - } - read(cb) { - const dirent = this.readSync(); - if (typeof cb !== `undefined`) - return cb(null, dirent); - return Promise.resolve(dirent); - } - readSync() { - this.throwIfClosed(); - return this.nextDirent(); - } - close(cb) { - this.closeSync(); - if (typeof cb !== `undefined`) - return cb(null); - return Promise.resolve(); - } - closeSync() { - this.throwIfClosed(); - this.opts.onClose?.(); - this.closed = true; - } -} -function opendir(fakeFs, path, entries, opts) { - const nextDirent = () => { - const filename = entries.shift(); - if (typeof filename === `undefined`) - return null; - const entryPath = fakeFs.pathUtils.join(path, filename); - return Object.assign(fakeFs.statSync(entryPath), { - name: filename, - path: void 0 - }); - }; - return new CustomDir(path, nextDirent, opts); -} - -function assertStatus(current, expected) { - if (current !== expected) { - throw new Error(`Invalid StatWatcher status: expected '${expected}', got '${current}'`); - } -} -class CustomStatWatcher extends events.EventEmitter { - constructor(fakeFs, path, { bigint = false } = {}) { - super(); - this.status = "ready" /* Ready */; - this.changeListeners = /* @__PURE__ */ new Map(); - this.startTimeout = null; - this.fakeFs = fakeFs; - this.path = path; - this.bigint = bigint; - this.lastStats = this.stat(); - } - static create(fakeFs, path, opts) { - const statWatcher = new CustomStatWatcher(fakeFs, path, opts); - statWatcher.start(); - return statWatcher; - } - start() { - assertStatus(this.status, "ready" /* Ready */); - this.status = "running" /* Running */; - this.startTimeout = setTimeout(() => { - this.startTimeout = null; - if (!this.fakeFs.existsSync(this.path)) { - this.emit("change" /* Change */, this.lastStats, this.lastStats); - } - }, 3); - } - stop() { - assertStatus(this.status, "running" /* Running */); - this.status = "stopped" /* Stopped */; - if (this.startTimeout !== null) { - clearTimeout(this.startTimeout); - this.startTimeout = null; - } - this.emit("stop" /* Stop */); - } - stat() { - try { - return this.fakeFs.statSync(this.path, { bigint: this.bigint }); - } catch (error) { - const statInstance = this.bigint ? new BigIntStatsEntry() : new StatEntry(); - return clearStats(statInstance); - } - } - makeInterval(opts) { - const interval = setInterval(() => { - const currentStats = this.stat(); - const previousStats = this.lastStats; - if (areStatsEqual(currentStats, previousStats)) - return; - this.lastStats = currentStats; - this.emit("change" /* Change */, currentStats, previousStats); - }, opts.interval); - return opts.persistent ? interval : interval.unref(); - } - registerChangeListener(listener, opts) { - this.addListener("change" /* Change */, listener); - this.changeListeners.set(listener, this.makeInterval(opts)); - } - unregisterChangeListener(listener) { - this.removeListener("change" /* Change */, listener); - const interval = this.changeListeners.get(listener); - if (typeof interval !== `undefined`) - clearInterval(interval); - this.changeListeners.delete(listener); - } - unregisterAllChangeListeners() { - for (const listener of this.changeListeners.keys()) { - this.unregisterChangeListener(listener); - } - } - hasChangeListeners() { - return this.changeListeners.size > 0; - } - ref() { - for (const interval of this.changeListeners.values()) - interval.ref(); - return this; - } - unref() { - for (const interval of this.changeListeners.values()) - interval.unref(); - return this; - } -} - -const statWatchersByFakeFS = /* @__PURE__ */ new WeakMap(); -function watchFile(fakeFs, path, a, b) { - let bigint; - let persistent; - let interval; - let listener; - switch (typeof a) { - case `function`: - { - bigint = false; - persistent = true; - interval = 5007; - listener = a; - } - break; - default: - { - ({ - bigint = false, - persistent = true, - interval = 5007 - } = a); - listener = b; - } - break; - } - let statWatchers = statWatchersByFakeFS.get(fakeFs); - if (typeof statWatchers === `undefined`) - statWatchersByFakeFS.set(fakeFs, statWatchers = /* @__PURE__ */ new Map()); - let statWatcher = statWatchers.get(path); - if (typeof statWatcher === `undefined`) { - statWatcher = CustomStatWatcher.create(fakeFs, path, { bigint }); - statWatchers.set(path, statWatcher); - } - statWatcher.registerChangeListener(listener, { persistent, interval }); - return statWatcher; -} -function unwatchFile(fakeFs, path, cb) { - const statWatchers = statWatchersByFakeFS.get(fakeFs); - if (typeof statWatchers === `undefined`) - return; - const statWatcher = statWatchers.get(path); - if (typeof statWatcher === `undefined`) - return; - if (typeof cb === `undefined`) - statWatcher.unregisterAllChangeListeners(); - else - statWatcher.unregisterChangeListener(cb); - if (!statWatcher.hasChangeListeners()) { - statWatcher.stop(); - statWatchers.delete(path); - } -} -function unwatchAllFiles(fakeFs) { - const statWatchers = statWatchersByFakeFS.get(fakeFs); - if (typeof statWatchers === `undefined`) - return; - for (const path of statWatchers.keys()) { - unwatchFile(fakeFs, path); - } -} - -class FakeFS { - constructor(pathUtils) { - this.pathUtils = pathUtils; - } - async *genTraversePromise(init, { stableSort = false } = {}) { - const stack = [init]; - while (stack.length > 0) { - const p = stack.shift(); - const entry = await this.lstatPromise(p); - if (entry.isDirectory()) { - const entries = await this.readdirPromise(p); - if (stableSort) { - for (const entry2 of entries.sort()) { - stack.push(this.pathUtils.join(p, entry2)); - } - } else { - throw new Error(`Not supported`); - } - } else { - yield p; - } - } - } - async checksumFilePromise(path, { algorithm = `sha512` } = {}) { - const fd = await this.openPromise(path, `r`); - try { - const CHUNK_SIZE = 65536; - const chunk = Buffer.allocUnsafeSlow(CHUNK_SIZE); - const hash = crypto.createHash(algorithm); - let bytesRead = 0; - while ((bytesRead = await this.readPromise(fd, chunk, 0, CHUNK_SIZE)) !== 0) - hash.update(bytesRead === CHUNK_SIZE ? chunk : chunk.slice(0, bytesRead)); - return hash.digest(`hex`); - } finally { - await this.closePromise(fd); - } - } - async removePromise(p, { recursive = true, maxRetries = 5 } = {}) { - let stat; - try { - stat = await this.lstatPromise(p); - } catch (error) { - if (error.code === `ENOENT`) { - return; - } else { - throw error; - } - } - if (stat.isDirectory()) { - if (recursive) { - const entries = await this.readdirPromise(p); - await Promise.all(entries.map((entry) => { - return this.removePromise(this.pathUtils.resolve(p, entry)); - })); - } - for (let t = 0; t <= maxRetries; t++) { - try { - await this.rmdirPromise(p); - break; - } catch (error) { - if (error.code !== `EBUSY` && error.code !== `ENOTEMPTY`) { - throw error; - } else if (t < maxRetries) { - await new Promise((resolve) => setTimeout(resolve, t * 100)); - } - } - } - } else { - await this.unlinkPromise(p); - } - } - removeSync(p, { recursive = true } = {}) { - let stat; - try { - stat = this.lstatSync(p); - } catch (error) { - if (error.code === `ENOENT`) { - return; - } else { - throw error; - } - } - if (stat.isDirectory()) { - if (recursive) - for (const entry of this.readdirSync(p)) - this.removeSync(this.pathUtils.resolve(p, entry)); - this.rmdirSync(p); - } else { - this.unlinkSync(p); - } - } - async mkdirpPromise(p, { chmod, utimes } = {}) { - p = this.resolve(p); - if (p === this.pathUtils.dirname(p)) - return void 0; - const parts = p.split(this.pathUtils.sep); - let createdDirectory; - for (let u = 2; u <= parts.length; ++u) { - const subPath = parts.slice(0, u).join(this.pathUtils.sep); - if (!this.existsSync(subPath)) { - try { - await this.mkdirPromise(subPath); - } catch (error) { - if (error.code === `EEXIST`) { - continue; - } else { - throw error; - } - } - createdDirectory ??= subPath; - if (chmod != null) - await this.chmodPromise(subPath, chmod); - if (utimes != null) { - await this.utimesPromise(subPath, utimes[0], utimes[1]); - } else { - const parentStat = await this.statPromise(this.pathUtils.dirname(subPath)); - await this.utimesPromise(subPath, parentStat.atime, parentStat.mtime); - } - } - } - return createdDirectory; - } - mkdirpSync(p, { chmod, utimes } = {}) { - p = this.resolve(p); - if (p === this.pathUtils.dirname(p)) - return void 0; - const parts = p.split(this.pathUtils.sep); - let createdDirectory; - for (let u = 2; u <= parts.length; ++u) { - const subPath = parts.slice(0, u).join(this.pathUtils.sep); - if (!this.existsSync(subPath)) { - try { - this.mkdirSync(subPath); - } catch (error) { - if (error.code === `EEXIST`) { - continue; - } else { - throw error; - } - } - createdDirectory ??= subPath; - if (chmod != null) - this.chmodSync(subPath, chmod); - if (utimes != null) { - this.utimesSync(subPath, utimes[0], utimes[1]); - } else { - const parentStat = this.statSync(this.pathUtils.dirname(subPath)); - this.utimesSync(subPath, parentStat.atime, parentStat.mtime); - } - } - } - return createdDirectory; - } - async copyPromise(destination, source, { baseFs = this, overwrite = true, stableSort = false, stableTime = false, linkStrategy = null } = {}) { - return await copyPromise(this, destination, baseFs, source, { overwrite, stableSort, stableTime, linkStrategy }); - } - copySync(destination, source, { baseFs = this, overwrite = true } = {}) { - const stat = baseFs.lstatSync(source); - const exists = this.existsSync(destination); - if (stat.isDirectory()) { - this.mkdirpSync(destination); - const directoryListing = baseFs.readdirSync(source); - for (const entry of directoryListing) { - this.copySync(this.pathUtils.join(destination, entry), baseFs.pathUtils.join(source, entry), { baseFs, overwrite }); - } - } else if (stat.isFile()) { - if (!exists || overwrite) { - if (exists) - this.removeSync(destination); - const content = baseFs.readFileSync(source); - this.writeFileSync(destination, content); - } - } else if (stat.isSymbolicLink()) { - if (!exists || overwrite) { - if (exists) - this.removeSync(destination); - const target = baseFs.readlinkSync(source); - this.symlinkSync(convertPath(this.pathUtils, target), destination); - } - } else { - throw new Error(`Unsupported file type (file: ${source}, mode: 0o${stat.mode.toString(8).padStart(6, `0`)})`); - } - const mode = stat.mode & 511; - this.chmodSync(destination, mode); - } - async changeFilePromise(p, content, opts = {}) { - if (Buffer.isBuffer(content)) { - return this.changeFileBufferPromise(p, content, opts); - } else { - return this.changeFileTextPromise(p, content, opts); - } - } - async changeFileBufferPromise(p, content, { mode } = {}) { - let current = Buffer.alloc(0); - try { - current = await this.readFilePromise(p); - } catch (error) { - } - if (Buffer.compare(current, content) === 0) - return; - await this.writeFilePromise(p, content, { mode }); - } - async changeFileTextPromise(p, content, { automaticNewlines, mode } = {}) { - let current = ``; - try { - current = await this.readFilePromise(p, `utf8`); - } catch (error) { - } - const normalizedContent = automaticNewlines ? normalizeLineEndings(current, content) : content; - if (current === normalizedContent) - return; - await this.writeFilePromise(p, normalizedContent, { mode }); - } - changeFileSync(p, content, opts = {}) { - if (Buffer.isBuffer(content)) { - return this.changeFileBufferSync(p, content, opts); - } else { - return this.changeFileTextSync(p, content, opts); - } - } - changeFileBufferSync(p, content, { mode } = {}) { - let current = Buffer.alloc(0); - try { - current = this.readFileSync(p); - } catch (error) { - } - if (Buffer.compare(current, content) === 0) - return; - this.writeFileSync(p, content, { mode }); - } - changeFileTextSync(p, content, { automaticNewlines = false, mode } = {}) { - let current = ``; - try { - current = this.readFileSync(p, `utf8`); - } catch (error) { - } - const normalizedContent = automaticNewlines ? normalizeLineEndings(current, content) : content; - if (current === normalizedContent) - return; - this.writeFileSync(p, normalizedContent, { mode }); - } - async movePromise(fromP, toP) { - try { - await this.renamePromise(fromP, toP); - } catch (error) { - if (error.code === `EXDEV`) { - await this.copyPromise(toP, fromP); - await this.removePromise(fromP); - } else { - throw error; - } - } - } - moveSync(fromP, toP) { - try { - this.renameSync(fromP, toP); - } catch (error) { - if (error.code === `EXDEV`) { - this.copySync(toP, fromP); - this.removeSync(fromP); - } else { - throw error; - } - } - } - async lockPromise(affectedPath, callback) { - const lockPath = `${affectedPath}.flock`; - const interval = 1e3 / 60; - const startTime = Date.now(); - let fd = null; - const isAlive = async () => { - let pid; - try { - [pid] = await this.readJsonPromise(lockPath); - } catch (error) { - return Date.now() - startTime < 500; - } - try { - process.kill(pid, 0); - return true; - } catch (error) { - return false; - } - }; - while (fd === null) { - try { - fd = await this.openPromise(lockPath, `wx`); - } catch (error) { - if (error.code === `EEXIST`) { - if (!await isAlive()) { - try { - await this.unlinkPromise(lockPath); - continue; - } catch (error2) { - } - } - if (Date.now() - startTime < 60 * 1e3) { - await new Promise((resolve) => setTimeout(resolve, interval)); - } else { - throw new Error(`Couldn't acquire a lock in a reasonable time (via ${lockPath})`); - } - } else { - throw error; - } - } - } - await this.writePromise(fd, JSON.stringify([process.pid])); - try { - return await callback(); - } finally { - try { - await this.closePromise(fd); - await this.unlinkPromise(lockPath); - } catch (error) { - } - } - } - async readJsonPromise(p) { - const content = await this.readFilePromise(p, `utf8`); - try { - return JSON.parse(content); - } catch (error) { - error.message += ` (in ${p})`; - throw error; - } - } - readJsonSync(p) { - const content = this.readFileSync(p, `utf8`); - try { - return JSON.parse(content); - } catch (error) { - error.message += ` (in ${p})`; - throw error; - } - } - async writeJsonPromise(p, data, { compact = false } = {}) { - const space = compact ? 0 : 2; - return await this.writeFilePromise(p, `${JSON.stringify(data, null, space)} -`); - } - writeJsonSync(p, data, { compact = false } = {}) { - const space = compact ? 0 : 2; - return this.writeFileSync(p, `${JSON.stringify(data, null, space)} -`); - } - async preserveTimePromise(p, cb) { - const stat = await this.lstatPromise(p); - const result = await cb(); - if (typeof result !== `undefined`) - p = result; - await this.lutimesPromise(p, stat.atime, stat.mtime); - } - async preserveTimeSync(p, cb) { - const stat = this.lstatSync(p); - const result = cb(); - if (typeof result !== `undefined`) - p = result; - this.lutimesSync(p, stat.atime, stat.mtime); - } -} -class BasePortableFakeFS extends FakeFS { - constructor() { - super(ppath); - } -} -function getEndOfLine(content) { - const matches = content.match(/\r?\n/g); - if (matches === null) - return os.EOL; - const crlf = matches.filter((nl) => nl === `\r -`).length; - const lf = matches.length - crlf; - return crlf > lf ? `\r -` : ` -`; -} -function normalizeLineEndings(originalContent, newContent) { - return newContent.replace(/\r?\n/g, getEndOfLine(originalContent)); -} - -class ProxiedFS extends FakeFS { - getExtractHint(hints) { - return this.baseFs.getExtractHint(hints); - } - resolve(path) { - return this.mapFromBase(this.baseFs.resolve(this.mapToBase(path))); - } - getRealPath() { - return this.mapFromBase(this.baseFs.getRealPath()); - } - async openPromise(p, flags, mode) { - return this.baseFs.openPromise(this.mapToBase(p), flags, mode); - } - openSync(p, flags, mode) { - return this.baseFs.openSync(this.mapToBase(p), flags, mode); - } - async opendirPromise(p, opts) { - return Object.assign(await this.baseFs.opendirPromise(this.mapToBase(p), opts), { path: p }); - } - opendirSync(p, opts) { - return Object.assign(this.baseFs.opendirSync(this.mapToBase(p), opts), { path: p }); - } - async readPromise(fd, buffer, offset, length, position) { - return await this.baseFs.readPromise(fd, buffer, offset, length, position); - } - readSync(fd, buffer, offset, length, position) { - return this.baseFs.readSync(fd, buffer, offset, length, position); - } - async writePromise(fd, buffer, offset, length, position) { - if (typeof buffer === `string`) { - return await this.baseFs.writePromise(fd, buffer, offset); - } else { - return await this.baseFs.writePromise(fd, buffer, offset, length, position); - } - } - writeSync(fd, buffer, offset, length, position) { - if (typeof buffer === `string`) { - return this.baseFs.writeSync(fd, buffer, offset); - } else { - return this.baseFs.writeSync(fd, buffer, offset, length, position); - } - } - async closePromise(fd) { - return this.baseFs.closePromise(fd); - } - closeSync(fd) { - this.baseFs.closeSync(fd); - } - createReadStream(p, opts) { - return this.baseFs.createReadStream(p !== null ? this.mapToBase(p) : p, opts); - } - createWriteStream(p, opts) { - return this.baseFs.createWriteStream(p !== null ? this.mapToBase(p) : p, opts); - } - async realpathPromise(p) { - return this.mapFromBase(await this.baseFs.realpathPromise(this.mapToBase(p))); - } - realpathSync(p) { - return this.mapFromBase(this.baseFs.realpathSync(this.mapToBase(p))); - } - async existsPromise(p) { - return this.baseFs.existsPromise(this.mapToBase(p)); - } - existsSync(p) { - return this.baseFs.existsSync(this.mapToBase(p)); - } - accessSync(p, mode) { - return this.baseFs.accessSync(this.mapToBase(p), mode); - } - async accessPromise(p, mode) { - return this.baseFs.accessPromise(this.mapToBase(p), mode); - } - async statPromise(p, opts) { - return this.baseFs.statPromise(this.mapToBase(p), opts); - } - statSync(p, opts) { - return this.baseFs.statSync(this.mapToBase(p), opts); - } - async fstatPromise(fd, opts) { - return this.baseFs.fstatPromise(fd, opts); - } - fstatSync(fd, opts) { - return this.baseFs.fstatSync(fd, opts); - } - lstatPromise(p, opts) { - return this.baseFs.lstatPromise(this.mapToBase(p), opts); - } - lstatSync(p, opts) { - return this.baseFs.lstatSync(this.mapToBase(p), opts); - } - async fchmodPromise(fd, mask) { - return this.baseFs.fchmodPromise(fd, mask); - } - fchmodSync(fd, mask) { - return this.baseFs.fchmodSync(fd, mask); - } - async chmodPromise(p, mask) { - return this.baseFs.chmodPromise(this.mapToBase(p), mask); - } - chmodSync(p, mask) { - return this.baseFs.chmodSync(this.mapToBase(p), mask); - } - async fchownPromise(fd, uid, gid) { - return this.baseFs.fchownPromise(fd, uid, gid); - } - fchownSync(fd, uid, gid) { - return this.baseFs.fchownSync(fd, uid, gid); - } - async chownPromise(p, uid, gid) { - return this.baseFs.chownPromise(this.mapToBase(p), uid, gid); - } - chownSync(p, uid, gid) { - return this.baseFs.chownSync(this.mapToBase(p), uid, gid); - } - async renamePromise(oldP, newP) { - return this.baseFs.renamePromise(this.mapToBase(oldP), this.mapToBase(newP)); - } - renameSync(oldP, newP) { - return this.baseFs.renameSync(this.mapToBase(oldP), this.mapToBase(newP)); - } - async copyFilePromise(sourceP, destP, flags = 0) { - return this.baseFs.copyFilePromise(this.mapToBase(sourceP), this.mapToBase(destP), flags); - } - copyFileSync(sourceP, destP, flags = 0) { - return this.baseFs.copyFileSync(this.mapToBase(sourceP), this.mapToBase(destP), flags); - } - async appendFilePromise(p, content, opts) { - return this.baseFs.appendFilePromise(this.fsMapToBase(p), content, opts); - } - appendFileSync(p, content, opts) { - return this.baseFs.appendFileSync(this.fsMapToBase(p), content, opts); - } - async writeFilePromise(p, content, opts) { - return this.baseFs.writeFilePromise(this.fsMapToBase(p), content, opts); - } - writeFileSync(p, content, opts) { - return this.baseFs.writeFileSync(this.fsMapToBase(p), content, opts); - } - async unlinkPromise(p) { - return this.baseFs.unlinkPromise(this.mapToBase(p)); - } - unlinkSync(p) { - return this.baseFs.unlinkSync(this.mapToBase(p)); - } - async utimesPromise(p, atime, mtime) { - return this.baseFs.utimesPromise(this.mapToBase(p), atime, mtime); - } - utimesSync(p, atime, mtime) { - return this.baseFs.utimesSync(this.mapToBase(p), atime, mtime); - } - async lutimesPromise(p, atime, mtime) { - return this.baseFs.lutimesPromise(this.mapToBase(p), atime, mtime); - } - lutimesSync(p, atime, mtime) { - return this.baseFs.lutimesSync(this.mapToBase(p), atime, mtime); - } - async mkdirPromise(p, opts) { - return this.baseFs.mkdirPromise(this.mapToBase(p), opts); - } - mkdirSync(p, opts) { - return this.baseFs.mkdirSync(this.mapToBase(p), opts); - } - async rmdirPromise(p, opts) { - return this.baseFs.rmdirPromise(this.mapToBase(p), opts); - } - rmdirSync(p, opts) { - return this.baseFs.rmdirSync(this.mapToBase(p), opts); - } - async rmPromise(p, opts) { - return this.baseFs.rmPromise(this.mapToBase(p), opts); - } - rmSync(p, opts) { - return this.baseFs.rmSync(this.mapToBase(p), opts); - } - async linkPromise(existingP, newP) { - return this.baseFs.linkPromise(this.mapToBase(existingP), this.mapToBase(newP)); - } - linkSync(existingP, newP) { - return this.baseFs.linkSync(this.mapToBase(existingP), this.mapToBase(newP)); - } - async symlinkPromise(target, p, type) { - const mappedP = this.mapToBase(p); - if (this.pathUtils.isAbsolute(target)) - return this.baseFs.symlinkPromise(this.mapToBase(target), mappedP, type); - const mappedAbsoluteTarget = this.mapToBase(this.pathUtils.join(this.pathUtils.dirname(p), target)); - const mappedTarget = this.baseFs.pathUtils.relative(this.baseFs.pathUtils.dirname(mappedP), mappedAbsoluteTarget); - return this.baseFs.symlinkPromise(mappedTarget, mappedP, type); - } - symlinkSync(target, p, type) { - const mappedP = this.mapToBase(p); - if (this.pathUtils.isAbsolute(target)) - return this.baseFs.symlinkSync(this.mapToBase(target), mappedP, type); - const mappedAbsoluteTarget = this.mapToBase(this.pathUtils.join(this.pathUtils.dirname(p), target)); - const mappedTarget = this.baseFs.pathUtils.relative(this.baseFs.pathUtils.dirname(mappedP), mappedAbsoluteTarget); - return this.baseFs.symlinkSync(mappedTarget, mappedP, type); - } - async readFilePromise(p, encoding) { - return this.baseFs.readFilePromise(this.fsMapToBase(p), encoding); - } - readFileSync(p, encoding) { - return this.baseFs.readFileSync(this.fsMapToBase(p), encoding); - } - readdirPromise(p, opts) { - return this.baseFs.readdirPromise(this.mapToBase(p), opts); - } - readdirSync(p, opts) { - return this.baseFs.readdirSync(this.mapToBase(p), opts); - } - async readlinkPromise(p) { - return this.mapFromBase(await this.baseFs.readlinkPromise(this.mapToBase(p))); - } - readlinkSync(p) { - return this.mapFromBase(this.baseFs.readlinkSync(this.mapToBase(p))); - } - async truncatePromise(p, len) { - return this.baseFs.truncatePromise(this.mapToBase(p), len); - } - truncateSync(p, len) { - return this.baseFs.truncateSync(this.mapToBase(p), len); - } - async ftruncatePromise(fd, len) { - return this.baseFs.ftruncatePromise(fd, len); - } - ftruncateSync(fd, len) { - return this.baseFs.ftruncateSync(fd, len); - } - watch(p, a, b) { - return this.baseFs.watch( - this.mapToBase(p), - a, - b - ); - } - watchFile(p, a, b) { - return this.baseFs.watchFile( - this.mapToBase(p), - a, - b - ); - } - unwatchFile(p, cb) { - return this.baseFs.unwatchFile(this.mapToBase(p), cb); - } - fsMapToBase(p) { - if (typeof p === `number`) { - return p; - } else { - return this.mapToBase(p); - } - } -} - -function direntToPortable(dirent) { - const portableDirent = dirent; - if (typeof dirent.path === `string`) - portableDirent.path = npath.toPortablePath(dirent.path); - return portableDirent; -} -class NodeFS extends BasePortableFakeFS { - constructor(realFs = fs__default.default) { - super(); - this.realFs = realFs; - } - getExtractHint() { - return false; - } - getRealPath() { - return PortablePath.root; - } - resolve(p) { - return ppath.resolve(p); - } - async openPromise(p, flags, mode) { - return await new Promise((resolve, reject) => { - this.realFs.open(npath.fromPortablePath(p), flags, mode, this.makeCallback(resolve, reject)); - }); - } - openSync(p, flags, mode) { - return this.realFs.openSync(npath.fromPortablePath(p), flags, mode); - } - async opendirPromise(p, opts) { - return await new Promise((resolve, reject) => { - if (typeof opts !== `undefined`) { - this.realFs.opendir(npath.fromPortablePath(p), opts, this.makeCallback(resolve, reject)); - } else { - this.realFs.opendir(npath.fromPortablePath(p), this.makeCallback(resolve, reject)); - } - }).then((dir) => { - const dirWithFixedPath = dir; - Object.defineProperty(dirWithFixedPath, `path`, { - value: p, - configurable: true, - writable: true - }); - return dirWithFixedPath; - }); - } - opendirSync(p, opts) { - const dir = typeof opts !== `undefined` ? this.realFs.opendirSync(npath.fromPortablePath(p), opts) : this.realFs.opendirSync(npath.fromPortablePath(p)); - const dirWithFixedPath = dir; - Object.defineProperty(dirWithFixedPath, `path`, { - value: p, - configurable: true, - writable: true - }); - return dirWithFixedPath; - } - async readPromise(fd, buffer, offset = 0, length = 0, position = -1) { - return await new Promise((resolve, reject) => { - this.realFs.read(fd, buffer, offset, length, position, (error, bytesRead) => { - if (error) { - reject(error); - } else { - resolve(bytesRead); - } - }); - }); - } - readSync(fd, buffer, offset, length, position) { - return this.realFs.readSync(fd, buffer, offset, length, position); - } - async writePromise(fd, buffer, offset, length, position) { - return await new Promise((resolve, reject) => { - if (typeof buffer === `string`) { - return this.realFs.write(fd, buffer, offset, this.makeCallback(resolve, reject)); - } else { - return this.realFs.write(fd, buffer, offset, length, position, this.makeCallback(resolve, reject)); - } - }); - } - writeSync(fd, buffer, offset, length, position) { - if (typeof buffer === `string`) { - return this.realFs.writeSync(fd, buffer, offset); - } else { - return this.realFs.writeSync(fd, buffer, offset, length, position); - } - } - async closePromise(fd) { - await new Promise((resolve, reject) => { - this.realFs.close(fd, this.makeCallback(resolve, reject)); - }); - } - closeSync(fd) { - this.realFs.closeSync(fd); - } - createReadStream(p, opts) { - const realPath = p !== null ? npath.fromPortablePath(p) : p; - return this.realFs.createReadStream(realPath, opts); - } - createWriteStream(p, opts) { - const realPath = p !== null ? npath.fromPortablePath(p) : p; - return this.realFs.createWriteStream(realPath, opts); - } - async realpathPromise(p) { - return await new Promise((resolve, reject) => { - this.realFs.realpath(npath.fromPortablePath(p), {}, this.makeCallback(resolve, reject)); - }).then((path) => { - return npath.toPortablePath(path); - }); - } - realpathSync(p) { - return npath.toPortablePath(this.realFs.realpathSync(npath.fromPortablePath(p), {})); - } - async existsPromise(p) { - return await new Promise((resolve) => { - this.realFs.exists(npath.fromPortablePath(p), resolve); - }); - } - accessSync(p, mode) { - return this.realFs.accessSync(npath.fromPortablePath(p), mode); - } - async accessPromise(p, mode) { - return await new Promise((resolve, reject) => { - this.realFs.access(npath.fromPortablePath(p), mode, this.makeCallback(resolve, reject)); - }); - } - existsSync(p) { - return this.realFs.existsSync(npath.fromPortablePath(p)); - } - async statPromise(p, opts) { - return await new Promise((resolve, reject) => { - if (opts) { - this.realFs.stat(npath.fromPortablePath(p), opts, this.makeCallback(resolve, reject)); - } else { - this.realFs.stat(npath.fromPortablePath(p), this.makeCallback(resolve, reject)); - } - }); - } - statSync(p, opts) { - if (opts) { - return this.realFs.statSync(npath.fromPortablePath(p), opts); - } else { - return this.realFs.statSync(npath.fromPortablePath(p)); - } - } - async fstatPromise(fd, opts) { - return await new Promise((resolve, reject) => { - if (opts) { - this.realFs.fstat(fd, opts, this.makeCallback(resolve, reject)); - } else { - this.realFs.fstat(fd, this.makeCallback(resolve, reject)); - } - }); - } - fstatSync(fd, opts) { - if (opts) { - return this.realFs.fstatSync(fd, opts); - } else { - return this.realFs.fstatSync(fd); - } - } - async lstatPromise(p, opts) { - return await new Promise((resolve, reject) => { - if (opts) { - this.realFs.lstat(npath.fromPortablePath(p), opts, this.makeCallback(resolve, reject)); - } else { - this.realFs.lstat(npath.fromPortablePath(p), this.makeCallback(resolve, reject)); - } - }); - } - lstatSync(p, opts) { - if (opts) { - return this.realFs.lstatSync(npath.fromPortablePath(p), opts); - } else { - return this.realFs.lstatSync(npath.fromPortablePath(p)); - } - } - async fchmodPromise(fd, mask) { - return await new Promise((resolve, reject) => { - this.realFs.fchmod(fd, mask, this.makeCallback(resolve, reject)); - }); - } - fchmodSync(fd, mask) { - return this.realFs.fchmodSync(fd, mask); - } - async chmodPromise(p, mask) { - return await new Promise((resolve, reject) => { - this.realFs.chmod(npath.fromPortablePath(p), mask, this.makeCallback(resolve, reject)); - }); - } - chmodSync(p, mask) { - return this.realFs.chmodSync(npath.fromPortablePath(p), mask); - } - async fchownPromise(fd, uid, gid) { - return await new Promise((resolve, reject) => { - this.realFs.fchown(fd, uid, gid, this.makeCallback(resolve, reject)); - }); - } - fchownSync(fd, uid, gid) { - return this.realFs.fchownSync(fd, uid, gid); - } - async chownPromise(p, uid, gid) { - return await new Promise((resolve, reject) => { - this.realFs.chown(npath.fromPortablePath(p), uid, gid, this.makeCallback(resolve, reject)); - }); - } - chownSync(p, uid, gid) { - return this.realFs.chownSync(npath.fromPortablePath(p), uid, gid); - } - async renamePromise(oldP, newP) { - return await new Promise((resolve, reject) => { - this.realFs.rename(npath.fromPortablePath(oldP), npath.fromPortablePath(newP), this.makeCallback(resolve, reject)); - }); - } - renameSync(oldP, newP) { - return this.realFs.renameSync(npath.fromPortablePath(oldP), npath.fromPortablePath(newP)); - } - async copyFilePromise(sourceP, destP, flags = 0) { - return await new Promise((resolve, reject) => { - this.realFs.copyFile(npath.fromPortablePath(sourceP), npath.fromPortablePath(destP), flags, this.makeCallback(resolve, reject)); - }); - } - copyFileSync(sourceP, destP, flags = 0) { - return this.realFs.copyFileSync(npath.fromPortablePath(sourceP), npath.fromPortablePath(destP), flags); - } - async appendFilePromise(p, content, opts) { - return await new Promise((resolve, reject) => { - const fsNativePath = typeof p === `string` ? npath.fromPortablePath(p) : p; - if (opts) { - this.realFs.appendFile(fsNativePath, content, opts, this.makeCallback(resolve, reject)); - } else { - this.realFs.appendFile(fsNativePath, content, this.makeCallback(resolve, reject)); - } - }); - } - appendFileSync(p, content, opts) { - const fsNativePath = typeof p === `string` ? npath.fromPortablePath(p) : p; - if (opts) { - this.realFs.appendFileSync(fsNativePath, content, opts); - } else { - this.realFs.appendFileSync(fsNativePath, content); - } - } - async writeFilePromise(p, content, opts) { - return await new Promise((resolve, reject) => { - const fsNativePath = typeof p === `string` ? npath.fromPortablePath(p) : p; - if (opts) { - this.realFs.writeFile(fsNativePath, content, opts, this.makeCallback(resolve, reject)); - } else { - this.realFs.writeFile(fsNativePath, content, this.makeCallback(resolve, reject)); - } - }); - } - writeFileSync(p, content, opts) { - const fsNativePath = typeof p === `string` ? npath.fromPortablePath(p) : p; - if (opts) { - this.realFs.writeFileSync(fsNativePath, content, opts); - } else { - this.realFs.writeFileSync(fsNativePath, content); - } - } - async unlinkPromise(p) { - return await new Promise((resolve, reject) => { - this.realFs.unlink(npath.fromPortablePath(p), this.makeCallback(resolve, reject)); - }); - } - unlinkSync(p) { - return this.realFs.unlinkSync(npath.fromPortablePath(p)); - } - async utimesPromise(p, atime, mtime) { - return await new Promise((resolve, reject) => { - this.realFs.utimes(npath.fromPortablePath(p), atime, mtime, this.makeCallback(resolve, reject)); - }); - } - utimesSync(p, atime, mtime) { - this.realFs.utimesSync(npath.fromPortablePath(p), atime, mtime); - } - async lutimesPromise(p, atime, mtime) { - return await new Promise((resolve, reject) => { - this.realFs.lutimes(npath.fromPortablePath(p), atime, mtime, this.makeCallback(resolve, reject)); - }); - } - lutimesSync(p, atime, mtime) { - this.realFs.lutimesSync(npath.fromPortablePath(p), atime, mtime); - } - async mkdirPromise(p, opts) { - return await new Promise((resolve, reject) => { - this.realFs.mkdir(npath.fromPortablePath(p), opts, this.makeCallback(resolve, reject)); - }); - } - mkdirSync(p, opts) { - return this.realFs.mkdirSync(npath.fromPortablePath(p), opts); - } - async rmdirPromise(p, opts) { - return await new Promise((resolve, reject) => { - if (opts) { - this.realFs.rmdir(npath.fromPortablePath(p), opts, this.makeCallback(resolve, reject)); - } else { - this.realFs.rmdir(npath.fromPortablePath(p), this.makeCallback(resolve, reject)); - } - }); - } - rmdirSync(p, opts) { - return this.realFs.rmdirSync(npath.fromPortablePath(p), opts); - } - async rmPromise(p, opts) { - return await new Promise((resolve, reject) => { - if (opts) { - this.realFs.rm(npath.fromPortablePath(p), opts, this.makeCallback(resolve, reject)); - } else { - this.realFs.rm(npath.fromPortablePath(p), this.makeCallback(resolve, reject)); - } - }); - } - rmSync(p, opts) { - return this.realFs.rmSync(npath.fromPortablePath(p), opts); - } - async linkPromise(existingP, newP) { - return await new Promise((resolve, reject) => { - this.realFs.link(npath.fromPortablePath(existingP), npath.fromPortablePath(newP), this.makeCallback(resolve, reject)); - }); - } - linkSync(existingP, newP) { - return this.realFs.linkSync(npath.fromPortablePath(existingP), npath.fromPortablePath(newP)); - } - async symlinkPromise(target, p, type) { - return await new Promise((resolve, reject) => { - this.realFs.symlink(npath.fromPortablePath(target.replace(/\/+$/, ``)), npath.fromPortablePath(p), type, this.makeCallback(resolve, reject)); - }); - } - symlinkSync(target, p, type) { - return this.realFs.symlinkSync(npath.fromPortablePath(target.replace(/\/+$/, ``)), npath.fromPortablePath(p), type); - } - async readFilePromise(p, encoding) { - return await new Promise((resolve, reject) => { - const fsNativePath = typeof p === `string` ? npath.fromPortablePath(p) : p; - this.realFs.readFile(fsNativePath, encoding, this.makeCallback(resolve, reject)); - }); - } - readFileSync(p, encoding) { - const fsNativePath = typeof p === `string` ? npath.fromPortablePath(p) : p; - return this.realFs.readFileSync(fsNativePath, encoding); - } - async readdirPromise(p, opts) { - return await new Promise((resolve, reject) => { - if (opts) { - if (opts.recursive && process.platform === `win32`) { - if (opts.withFileTypes) { - this.realFs.readdir(npath.fromPortablePath(p), opts, this.makeCallback((results) => resolve(results.map(direntToPortable)), reject)); - } else { - this.realFs.readdir(npath.fromPortablePath(p), opts, this.makeCallback((results) => resolve(results.map(npath.toPortablePath)), reject)); - } - } else { - this.realFs.readdir(npath.fromPortablePath(p), opts, this.makeCallback(resolve, reject)); - } - } else { - this.realFs.readdir(npath.fromPortablePath(p), this.makeCallback(resolve, reject)); - } - }); - } - readdirSync(p, opts) { - if (opts) { - if (opts.recursive && process.platform === `win32`) { - if (opts.withFileTypes) { - return this.realFs.readdirSync(npath.fromPortablePath(p), opts).map(direntToPortable); - } else { - return this.realFs.readdirSync(npath.fromPortablePath(p), opts).map(npath.toPortablePath); - } - } else { - return this.realFs.readdirSync(npath.fromPortablePath(p), opts); - } - } else { - return this.realFs.readdirSync(npath.fromPortablePath(p)); - } - } - async readlinkPromise(p) { - return await new Promise((resolve, reject) => { - this.realFs.readlink(npath.fromPortablePath(p), this.makeCallback(resolve, reject)); - }).then((path) => { - return npath.toPortablePath(path); - }); - } - readlinkSync(p) { - return npath.toPortablePath(this.realFs.readlinkSync(npath.fromPortablePath(p))); - } - async truncatePromise(p, len) { - return await new Promise((resolve, reject) => { - this.realFs.truncate(npath.fromPortablePath(p), len, this.makeCallback(resolve, reject)); - }); - } - truncateSync(p, len) { - return this.realFs.truncateSync(npath.fromPortablePath(p), len); - } - async ftruncatePromise(fd, len) { - return await new Promise((resolve, reject) => { - this.realFs.ftruncate(fd, len, this.makeCallback(resolve, reject)); - }); - } - ftruncateSync(fd, len) { - return this.realFs.ftruncateSync(fd, len); - } - watch(p, a, b) { - return this.realFs.watch( - npath.fromPortablePath(p), - a, - b - ); - } - watchFile(p, a, b) { - return this.realFs.watchFile( - npath.fromPortablePath(p), - a, - b - ); - } - unwatchFile(p, cb) { - return this.realFs.unwatchFile(npath.fromPortablePath(p), cb); - } - makeCallback(resolve, reject) { - return (err, result) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }; - } -} - -const MOUNT_MASK = 4278190080; -class MountFS extends BasePortableFakeFS { - constructor({ baseFs = new NodeFS(), filter = null, magicByte = 42, maxOpenFiles = Infinity, useCache = true, maxAge = 5e3, typeCheck = fs.constants.S_IFREG, getMountPoint, factoryPromise, factorySync }) { - if (Math.floor(magicByte) !== magicByte || !(magicByte > 1 && magicByte <= 127)) - throw new Error(`The magic byte must be set to a round value between 1 and 127 included`); - super(); - this.fdMap = /* @__PURE__ */ new Map(); - this.nextFd = 3; - this.isMount = /* @__PURE__ */ new Set(); - this.notMount = /* @__PURE__ */ new Set(); - this.realPaths = /* @__PURE__ */ new Map(); - this.limitOpenFilesTimeout = null; - this.baseFs = baseFs; - this.mountInstances = useCache ? /* @__PURE__ */ new Map() : null; - this.factoryPromise = factoryPromise; - this.factorySync = factorySync; - this.filter = filter; - this.getMountPoint = getMountPoint; - this.magic = magicByte << 24; - this.maxAge = maxAge; - this.maxOpenFiles = maxOpenFiles; - this.typeCheck = typeCheck; - } - getExtractHint(hints) { - return this.baseFs.getExtractHint(hints); - } - getRealPath() { - return this.baseFs.getRealPath(); - } - saveAndClose() { - unwatchAllFiles(this); - if (this.mountInstances) { - for (const [path, { childFs }] of this.mountInstances.entries()) { - childFs.saveAndClose?.(); - this.mountInstances.delete(path); - } - } - } - discardAndClose() { - unwatchAllFiles(this); - if (this.mountInstances) { - for (const [path, { childFs }] of this.mountInstances.entries()) { - childFs.discardAndClose?.(); - this.mountInstances.delete(path); - } - } - } - resolve(p) { - return this.baseFs.resolve(p); - } - remapFd(mountFs, fd) { - const remappedFd = this.nextFd++ | this.magic; - this.fdMap.set(remappedFd, [mountFs, fd]); - return remappedFd; - } - async openPromise(p, flags, mode) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.openPromise(p, flags, mode); - }, async (mountFs, { subPath }) => { - return this.remapFd(mountFs, await mountFs.openPromise(subPath, flags, mode)); - }); - } - openSync(p, flags, mode) { - return this.makeCallSync(p, () => { - return this.baseFs.openSync(p, flags, mode); - }, (mountFs, { subPath }) => { - return this.remapFd(mountFs, mountFs.openSync(subPath, flags, mode)); - }); - } - async opendirPromise(p, opts) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.opendirPromise(p, opts); - }, async (mountFs, { subPath }) => { - return await mountFs.opendirPromise(subPath, opts); - }, { - requireSubpath: false - }); - } - opendirSync(p, opts) { - return this.makeCallSync(p, () => { - return this.baseFs.opendirSync(p, opts); - }, (mountFs, { subPath }) => { - return mountFs.opendirSync(subPath, opts); - }, { - requireSubpath: false - }); - } - async readPromise(fd, buffer, offset, length, position) { - if ((fd & MOUNT_MASK) !== this.magic) - return await this.baseFs.readPromise(fd, buffer, offset, length, position); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`read`); - const [mountFs, realFd] = entry; - return await mountFs.readPromise(realFd, buffer, offset, length, position); - } - readSync(fd, buffer, offset, length, position) { - if ((fd & MOUNT_MASK) !== this.magic) - return this.baseFs.readSync(fd, buffer, offset, length, position); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`readSync`); - const [mountFs, realFd] = entry; - return mountFs.readSync(realFd, buffer, offset, length, position); - } - async writePromise(fd, buffer, offset, length, position) { - if ((fd & MOUNT_MASK) !== this.magic) { - if (typeof buffer === `string`) { - return await this.baseFs.writePromise(fd, buffer, offset); - } else { - return await this.baseFs.writePromise(fd, buffer, offset, length, position); - } - } - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`write`); - const [mountFs, realFd] = entry; - if (typeof buffer === `string`) { - return await mountFs.writePromise(realFd, buffer, offset); - } else { - return await mountFs.writePromise(realFd, buffer, offset, length, position); - } - } - writeSync(fd, buffer, offset, length, position) { - if ((fd & MOUNT_MASK) !== this.magic) { - if (typeof buffer === `string`) { - return this.baseFs.writeSync(fd, buffer, offset); - } else { - return this.baseFs.writeSync(fd, buffer, offset, length, position); - } - } - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`writeSync`); - const [mountFs, realFd] = entry; - if (typeof buffer === `string`) { - return mountFs.writeSync(realFd, buffer, offset); - } else { - return mountFs.writeSync(realFd, buffer, offset, length, position); - } - } - async closePromise(fd) { - if ((fd & MOUNT_MASK) !== this.magic) - return await this.baseFs.closePromise(fd); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`close`); - this.fdMap.delete(fd); - const [mountFs, realFd] = entry; - return await mountFs.closePromise(realFd); - } - closeSync(fd) { - if ((fd & MOUNT_MASK) !== this.magic) - return this.baseFs.closeSync(fd); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`closeSync`); - this.fdMap.delete(fd); - const [mountFs, realFd] = entry; - return mountFs.closeSync(realFd); - } - createReadStream(p, opts) { - if (p === null) - return this.baseFs.createReadStream(p, opts); - return this.makeCallSync(p, () => { - return this.baseFs.createReadStream(p, opts); - }, (mountFs, { archivePath, subPath }) => { - const stream = mountFs.createReadStream(subPath, opts); - stream.path = npath.fromPortablePath(this.pathUtils.join(archivePath, subPath)); - return stream; - }); - } - createWriteStream(p, opts) { - if (p === null) - return this.baseFs.createWriteStream(p, opts); - return this.makeCallSync(p, () => { - return this.baseFs.createWriteStream(p, opts); - }, (mountFs, { subPath }) => { - return mountFs.createWriteStream(subPath, opts); - }); - } - async realpathPromise(p) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.realpathPromise(p); - }, async (mountFs, { archivePath, subPath }) => { - let realArchivePath = this.realPaths.get(archivePath); - if (typeof realArchivePath === `undefined`) { - realArchivePath = await this.baseFs.realpathPromise(archivePath); - this.realPaths.set(archivePath, realArchivePath); - } - return this.pathUtils.join(realArchivePath, this.pathUtils.relative(PortablePath.root, await mountFs.realpathPromise(subPath))); - }); - } - realpathSync(p) { - return this.makeCallSync(p, () => { - return this.baseFs.realpathSync(p); - }, (mountFs, { archivePath, subPath }) => { - let realArchivePath = this.realPaths.get(archivePath); - if (typeof realArchivePath === `undefined`) { - realArchivePath = this.baseFs.realpathSync(archivePath); - this.realPaths.set(archivePath, realArchivePath); - } - return this.pathUtils.join(realArchivePath, this.pathUtils.relative(PortablePath.root, mountFs.realpathSync(subPath))); - }); - } - async existsPromise(p) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.existsPromise(p); - }, async (mountFs, { subPath }) => { - return await mountFs.existsPromise(subPath); - }); - } - existsSync(p) { - return this.makeCallSync(p, () => { - return this.baseFs.existsSync(p); - }, (mountFs, { subPath }) => { - return mountFs.existsSync(subPath); - }); - } - async accessPromise(p, mode) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.accessPromise(p, mode); - }, async (mountFs, { subPath }) => { - return await mountFs.accessPromise(subPath, mode); - }); - } - accessSync(p, mode) { - return this.makeCallSync(p, () => { - return this.baseFs.accessSync(p, mode); - }, (mountFs, { subPath }) => { - return mountFs.accessSync(subPath, mode); - }); - } - async statPromise(p, opts) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.statPromise(p, opts); - }, async (mountFs, { subPath }) => { - return await mountFs.statPromise(subPath, opts); - }); - } - statSync(p, opts) { - return this.makeCallSync(p, () => { - return this.baseFs.statSync(p, opts); - }, (mountFs, { subPath }) => { - return mountFs.statSync(subPath, opts); - }); - } - async fstatPromise(fd, opts) { - if ((fd & MOUNT_MASK) !== this.magic) - return this.baseFs.fstatPromise(fd, opts); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`fstat`); - const [mountFs, realFd] = entry; - return mountFs.fstatPromise(realFd, opts); - } - fstatSync(fd, opts) { - if ((fd & MOUNT_MASK) !== this.magic) - return this.baseFs.fstatSync(fd, opts); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`fstatSync`); - const [mountFs, realFd] = entry; - return mountFs.fstatSync(realFd, opts); - } - async lstatPromise(p, opts) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.lstatPromise(p, opts); - }, async (mountFs, { subPath }) => { - return await mountFs.lstatPromise(subPath, opts); - }); - } - lstatSync(p, opts) { - return this.makeCallSync(p, () => { - return this.baseFs.lstatSync(p, opts); - }, (mountFs, { subPath }) => { - return mountFs.lstatSync(subPath, opts); - }); - } - async fchmodPromise(fd, mask) { - if ((fd & MOUNT_MASK) !== this.magic) - return this.baseFs.fchmodPromise(fd, mask); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`fchmod`); - const [mountFs, realFd] = entry; - return mountFs.fchmodPromise(realFd, mask); - } - fchmodSync(fd, mask) { - if ((fd & MOUNT_MASK) !== this.magic) - return this.baseFs.fchmodSync(fd, mask); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`fchmodSync`); - const [mountFs, realFd] = entry; - return mountFs.fchmodSync(realFd, mask); - } - async chmodPromise(p, mask) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.chmodPromise(p, mask); - }, async (mountFs, { subPath }) => { - return await mountFs.chmodPromise(subPath, mask); - }); - } - chmodSync(p, mask) { - return this.makeCallSync(p, () => { - return this.baseFs.chmodSync(p, mask); - }, (mountFs, { subPath }) => { - return mountFs.chmodSync(subPath, mask); - }); - } - async fchownPromise(fd, uid, gid) { - if ((fd & MOUNT_MASK) !== this.magic) - return this.baseFs.fchownPromise(fd, uid, gid); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`fchown`); - const [zipFs, realFd] = entry; - return zipFs.fchownPromise(realFd, uid, gid); - } - fchownSync(fd, uid, gid) { - if ((fd & MOUNT_MASK) !== this.magic) - return this.baseFs.fchownSync(fd, uid, gid); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`fchownSync`); - const [zipFs, realFd] = entry; - return zipFs.fchownSync(realFd, uid, gid); - } - async chownPromise(p, uid, gid) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.chownPromise(p, uid, gid); - }, async (mountFs, { subPath }) => { - return await mountFs.chownPromise(subPath, uid, gid); - }); - } - chownSync(p, uid, gid) { - return this.makeCallSync(p, () => { - return this.baseFs.chownSync(p, uid, gid); - }, (mountFs, { subPath }) => { - return mountFs.chownSync(subPath, uid, gid); - }); - } - async renamePromise(oldP, newP) { - return await this.makeCallPromise(oldP, async () => { - return await this.makeCallPromise(newP, async () => { - return await this.baseFs.renamePromise(oldP, newP); - }, async () => { - throw Object.assign(new Error(`EEXDEV: cross-device link not permitted`), { code: `EEXDEV` }); - }); - }, async (mountFsO, { subPath: subPathO }) => { - return await this.makeCallPromise(newP, async () => { - throw Object.assign(new Error(`EEXDEV: cross-device link not permitted`), { code: `EEXDEV` }); - }, async (mountFsN, { subPath: subPathN }) => { - if (mountFsO !== mountFsN) { - throw Object.assign(new Error(`EEXDEV: cross-device link not permitted`), { code: `EEXDEV` }); - } else { - return await mountFsO.renamePromise(subPathO, subPathN); - } - }); - }); - } - renameSync(oldP, newP) { - return this.makeCallSync(oldP, () => { - return this.makeCallSync(newP, () => { - return this.baseFs.renameSync(oldP, newP); - }, () => { - throw Object.assign(new Error(`EEXDEV: cross-device link not permitted`), { code: `EEXDEV` }); - }); - }, (mountFsO, { subPath: subPathO }) => { - return this.makeCallSync(newP, () => { - throw Object.assign(new Error(`EEXDEV: cross-device link not permitted`), { code: `EEXDEV` }); - }, (mountFsN, { subPath: subPathN }) => { - if (mountFsO !== mountFsN) { - throw Object.assign(new Error(`EEXDEV: cross-device link not permitted`), { code: `EEXDEV` }); - } else { - return mountFsO.renameSync(subPathO, subPathN); - } - }); - }); - } - async copyFilePromise(sourceP, destP, flags = 0) { - const fallback = async (sourceFs, sourceP2, destFs, destP2) => { - if ((flags & fs.constants.COPYFILE_FICLONE_FORCE) !== 0) - throw Object.assign(new Error(`EXDEV: cross-device clone not permitted, copyfile '${sourceP2}' -> ${destP2}'`), { code: `EXDEV` }); - if (flags & fs.constants.COPYFILE_EXCL && await this.existsPromise(sourceP2)) - throw Object.assign(new Error(`EEXIST: file already exists, copyfile '${sourceP2}' -> '${destP2}'`), { code: `EEXIST` }); - let content; - try { - content = await sourceFs.readFilePromise(sourceP2); - } catch (error) { - throw Object.assign(new Error(`EINVAL: invalid argument, copyfile '${sourceP2}' -> '${destP2}'`), { code: `EINVAL` }); - } - await destFs.writeFilePromise(destP2, content); - }; - return await this.makeCallPromise(sourceP, async () => { - return await this.makeCallPromise(destP, async () => { - return await this.baseFs.copyFilePromise(sourceP, destP, flags); - }, async (mountFsD, { subPath: subPathD }) => { - return await fallback(this.baseFs, sourceP, mountFsD, subPathD); - }); - }, async (mountFsS, { subPath: subPathS }) => { - return await this.makeCallPromise(destP, async () => { - return await fallback(mountFsS, subPathS, this.baseFs, destP); - }, async (mountFsD, { subPath: subPathD }) => { - if (mountFsS !== mountFsD) { - return await fallback(mountFsS, subPathS, mountFsD, subPathD); - } else { - return await mountFsS.copyFilePromise(subPathS, subPathD, flags); - } - }); - }); - } - copyFileSync(sourceP, destP, flags = 0) { - const fallback = (sourceFs, sourceP2, destFs, destP2) => { - if ((flags & fs.constants.COPYFILE_FICLONE_FORCE) !== 0) - throw Object.assign(new Error(`EXDEV: cross-device clone not permitted, copyfile '${sourceP2}' -> ${destP2}'`), { code: `EXDEV` }); - if (flags & fs.constants.COPYFILE_EXCL && this.existsSync(sourceP2)) - throw Object.assign(new Error(`EEXIST: file already exists, copyfile '${sourceP2}' -> '${destP2}'`), { code: `EEXIST` }); - let content; - try { - content = sourceFs.readFileSync(sourceP2); - } catch (error) { - throw Object.assign(new Error(`EINVAL: invalid argument, copyfile '${sourceP2}' -> '${destP2}'`), { code: `EINVAL` }); - } - destFs.writeFileSync(destP2, content); - }; - return this.makeCallSync(sourceP, () => { - return this.makeCallSync(destP, () => { - return this.baseFs.copyFileSync(sourceP, destP, flags); - }, (mountFsD, { subPath: subPathD }) => { - return fallback(this.baseFs, sourceP, mountFsD, subPathD); - }); - }, (mountFsS, { subPath: subPathS }) => { - return this.makeCallSync(destP, () => { - return fallback(mountFsS, subPathS, this.baseFs, destP); - }, (mountFsD, { subPath: subPathD }) => { - if (mountFsS !== mountFsD) { - return fallback(mountFsS, subPathS, mountFsD, subPathD); - } else { - return mountFsS.copyFileSync(subPathS, subPathD, flags); - } - }); - }); - } - async appendFilePromise(p, content, opts) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.appendFilePromise(p, content, opts); - }, async (mountFs, { subPath }) => { - return await mountFs.appendFilePromise(subPath, content, opts); - }); - } - appendFileSync(p, content, opts) { - return this.makeCallSync(p, () => { - return this.baseFs.appendFileSync(p, content, opts); - }, (mountFs, { subPath }) => { - return mountFs.appendFileSync(subPath, content, opts); - }); - } - async writeFilePromise(p, content, opts) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.writeFilePromise(p, content, opts); - }, async (mountFs, { subPath }) => { - return await mountFs.writeFilePromise(subPath, content, opts); - }); - } - writeFileSync(p, content, opts) { - return this.makeCallSync(p, () => { - return this.baseFs.writeFileSync(p, content, opts); - }, (mountFs, { subPath }) => { - return mountFs.writeFileSync(subPath, content, opts); - }); - } - async unlinkPromise(p) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.unlinkPromise(p); - }, async (mountFs, { subPath }) => { - return await mountFs.unlinkPromise(subPath); - }); - } - unlinkSync(p) { - return this.makeCallSync(p, () => { - return this.baseFs.unlinkSync(p); - }, (mountFs, { subPath }) => { - return mountFs.unlinkSync(subPath); - }); - } - async utimesPromise(p, atime, mtime) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.utimesPromise(p, atime, mtime); - }, async (mountFs, { subPath }) => { - return await mountFs.utimesPromise(subPath, atime, mtime); - }); - } - utimesSync(p, atime, mtime) { - return this.makeCallSync(p, () => { - return this.baseFs.utimesSync(p, atime, mtime); - }, (mountFs, { subPath }) => { - return mountFs.utimesSync(subPath, atime, mtime); - }); - } - async lutimesPromise(p, atime, mtime) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.lutimesPromise(p, atime, mtime); - }, async (mountFs, { subPath }) => { - return await mountFs.lutimesPromise(subPath, atime, mtime); - }); - } - lutimesSync(p, atime, mtime) { - return this.makeCallSync(p, () => { - return this.baseFs.lutimesSync(p, atime, mtime); - }, (mountFs, { subPath }) => { - return mountFs.lutimesSync(subPath, atime, mtime); - }); - } - async mkdirPromise(p, opts) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.mkdirPromise(p, opts); - }, async (mountFs, { subPath }) => { - return await mountFs.mkdirPromise(subPath, opts); - }); - } - mkdirSync(p, opts) { - return this.makeCallSync(p, () => { - return this.baseFs.mkdirSync(p, opts); - }, (mountFs, { subPath }) => { - return mountFs.mkdirSync(subPath, opts); - }); - } - async rmdirPromise(p, opts) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.rmdirPromise(p, opts); - }, async (mountFs, { subPath }) => { - return await mountFs.rmdirPromise(subPath, opts); - }); - } - rmdirSync(p, opts) { - return this.makeCallSync(p, () => { - return this.baseFs.rmdirSync(p, opts); - }, (mountFs, { subPath }) => { - return mountFs.rmdirSync(subPath, opts); - }); - } - async rmPromise(p, opts) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.rmPromise(p, opts); - }, async (mountFs, { subPath }) => { - return await mountFs.rmPromise(subPath, opts); - }); - } - rmSync(p, opts) { - return this.makeCallSync(p, () => { - return this.baseFs.rmSync(p, opts); - }, (mountFs, { subPath }) => { - return mountFs.rmSync(subPath, opts); - }); - } - async linkPromise(existingP, newP) { - return await this.makeCallPromise(newP, async () => { - return await this.baseFs.linkPromise(existingP, newP); - }, async (mountFs, { subPath }) => { - return await mountFs.linkPromise(existingP, subPath); - }); - } - linkSync(existingP, newP) { - return this.makeCallSync(newP, () => { - return this.baseFs.linkSync(existingP, newP); - }, (mountFs, { subPath }) => { - return mountFs.linkSync(existingP, subPath); - }); - } - async symlinkPromise(target, p, type) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.symlinkPromise(target, p, type); - }, async (mountFs, { subPath }) => { - return await mountFs.symlinkPromise(target, subPath); - }); - } - symlinkSync(target, p, type) { - return this.makeCallSync(p, () => { - return this.baseFs.symlinkSync(target, p, type); - }, (mountFs, { subPath }) => { - return mountFs.symlinkSync(target, subPath); - }); - } - async readFilePromise(p, encoding) { - return this.makeCallPromise(p, async () => { - return await this.baseFs.readFilePromise(p, encoding); - }, async (mountFs, { subPath }) => { - return await mountFs.readFilePromise(subPath, encoding); - }); - } - readFileSync(p, encoding) { - return this.makeCallSync(p, () => { - return this.baseFs.readFileSync(p, encoding); - }, (mountFs, { subPath }) => { - return mountFs.readFileSync(subPath, encoding); - }); - } - async readdirPromise(p, opts) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.readdirPromise(p, opts); - }, async (mountFs, { subPath }) => { - return await mountFs.readdirPromise(subPath, opts); - }, { - requireSubpath: false - }); - } - readdirSync(p, opts) { - return this.makeCallSync(p, () => { - return this.baseFs.readdirSync(p, opts); - }, (mountFs, { subPath }) => { - return mountFs.readdirSync(subPath, opts); - }, { - requireSubpath: false - }); - } - async readlinkPromise(p) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.readlinkPromise(p); - }, async (mountFs, { subPath }) => { - return await mountFs.readlinkPromise(subPath); - }); - } - readlinkSync(p) { - return this.makeCallSync(p, () => { - return this.baseFs.readlinkSync(p); - }, (mountFs, { subPath }) => { - return mountFs.readlinkSync(subPath); - }); - } - async truncatePromise(p, len) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.truncatePromise(p, len); - }, async (mountFs, { subPath }) => { - return await mountFs.truncatePromise(subPath, len); - }); - } - truncateSync(p, len) { - return this.makeCallSync(p, () => { - return this.baseFs.truncateSync(p, len); - }, (mountFs, { subPath }) => { - return mountFs.truncateSync(subPath, len); - }); - } - async ftruncatePromise(fd, len) { - if ((fd & MOUNT_MASK) !== this.magic) - return this.baseFs.ftruncatePromise(fd, len); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`ftruncate`); - const [mountFs, realFd] = entry; - return mountFs.ftruncatePromise(realFd, len); - } - ftruncateSync(fd, len) { - if ((fd & MOUNT_MASK) !== this.magic) - return this.baseFs.ftruncateSync(fd, len); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`ftruncateSync`); - const [mountFs, realFd] = entry; - return mountFs.ftruncateSync(realFd, len); - } - watch(p, a, b) { - return this.makeCallSync(p, () => { - return this.baseFs.watch( - p, - a, - b - ); - }, (mountFs, { subPath }) => { - return mountFs.watch( - subPath, - a, - b - ); - }); - } - watchFile(p, a, b) { - return this.makeCallSync(p, () => { - return this.baseFs.watchFile( - p, - a, - b - ); - }, () => { - return watchFile(this, p, a, b); - }); - } - unwatchFile(p, cb) { - return this.makeCallSync(p, () => { - return this.baseFs.unwatchFile(p, cb); - }, () => { - return unwatchFile(this, p, cb); - }); - } - async makeCallPromise(p, discard, accept, { requireSubpath = true } = {}) { - if (typeof p !== `string`) - return await discard(); - const normalizedP = this.resolve(p); - const mountInfo = this.findMount(normalizedP); - if (!mountInfo) - return await discard(); - if (requireSubpath && mountInfo.subPath === `/`) - return await discard(); - return await this.getMountPromise(mountInfo.archivePath, async (mountFs) => await accept(mountFs, mountInfo)); - } - makeCallSync(p, discard, accept, { requireSubpath = true } = {}) { - if (typeof p !== `string`) - return discard(); - const normalizedP = this.resolve(p); - const mountInfo = this.findMount(normalizedP); - if (!mountInfo) - return discard(); - if (requireSubpath && mountInfo.subPath === `/`) - return discard(); - return this.getMountSync(mountInfo.archivePath, (mountFs) => accept(mountFs, mountInfo)); - } - findMount(p) { - if (this.filter && !this.filter.test(p)) - return null; - let filePath = ``; - while (true) { - const pathPartWithArchive = p.substring(filePath.length); - const mountPoint = this.getMountPoint(pathPartWithArchive, filePath); - if (!mountPoint) - return null; - filePath = this.pathUtils.join(filePath, mountPoint); - if (!this.isMount.has(filePath)) { - if (this.notMount.has(filePath)) - continue; - try { - if (this.typeCheck !== null && (this.baseFs.lstatSync(filePath).mode & fs.constants.S_IFMT) !== this.typeCheck) { - this.notMount.add(filePath); - continue; - } - } catch { - return null; - } - this.isMount.add(filePath); - } - return { - archivePath: filePath, - subPath: this.pathUtils.join(PortablePath.root, p.substring(filePath.length)) - }; - } - } - limitOpenFiles(max) { - if (this.mountInstances === null) - return; - const now = Date.now(); - let nextExpiresAt = now + this.maxAge; - let closeCount = max === null ? 0 : this.mountInstances.size - max; - for (const [path, { childFs, expiresAt, refCount }] of this.mountInstances.entries()) { - if (refCount !== 0 || childFs.hasOpenFileHandles?.()) { - continue; - } else if (now >= expiresAt) { - childFs.saveAndClose?.(); - this.mountInstances.delete(path); - closeCount -= 1; - continue; - } else if (max === null || closeCount <= 0) { - nextExpiresAt = expiresAt; - break; - } - childFs.saveAndClose?.(); - this.mountInstances.delete(path); - closeCount -= 1; - } - if (this.limitOpenFilesTimeout === null && (max === null && this.mountInstances.size > 0 || max !== null) && isFinite(nextExpiresAt)) { - this.limitOpenFilesTimeout = setTimeout(() => { - this.limitOpenFilesTimeout = null; - this.limitOpenFiles(null); - }, nextExpiresAt - now).unref(); - } - } - async getMountPromise(p, accept) { - if (this.mountInstances) { - let cachedMountFs = this.mountInstances.get(p); - if (!cachedMountFs) { - const createFsInstance = await this.factoryPromise(this.baseFs, p); - cachedMountFs = this.mountInstances.get(p); - if (!cachedMountFs) { - cachedMountFs = { - childFs: createFsInstance(), - expiresAt: 0, - refCount: 0 - }; - } - } - this.mountInstances.delete(p); - this.limitOpenFiles(this.maxOpenFiles - 1); - this.mountInstances.set(p, cachedMountFs); - cachedMountFs.expiresAt = Date.now() + this.maxAge; - cachedMountFs.refCount += 1; - try { - return await accept(cachedMountFs.childFs); - } finally { - cachedMountFs.refCount -= 1; - } - } else { - const mountFs = (await this.factoryPromise(this.baseFs, p))(); - try { - return await accept(mountFs); - } finally { - mountFs.saveAndClose?.(); - } - } - } - getMountSync(p, accept) { - if (this.mountInstances) { - let cachedMountFs = this.mountInstances.get(p); - if (!cachedMountFs) { - cachedMountFs = { - childFs: this.factorySync(this.baseFs, p), - expiresAt: 0, - refCount: 0 - }; - } - this.mountInstances.delete(p); - this.limitOpenFiles(this.maxOpenFiles - 1); - this.mountInstances.set(p, cachedMountFs); - cachedMountFs.expiresAt = Date.now() + this.maxAge; - return accept(cachedMountFs.childFs); - } else { - const childFs = this.factorySync(this.baseFs, p); - try { - return accept(childFs); - } finally { - childFs.saveAndClose?.(); - } - } - } -} - -class PosixFS extends ProxiedFS { - constructor(baseFs) { - super(npath); - this.baseFs = baseFs; - } - mapFromBase(path) { - return npath.fromPortablePath(path); - } - mapToBase(path) { - return npath.toPortablePath(path); - } -} - -const NUMBER_REGEXP = /^[0-9]+$/; -const VIRTUAL_REGEXP = /^(\/(?:[^/]+\/)*?(?:\$\$virtual|__virtual__))((?:\/((?:[^/]+-)?[a-f0-9]+)(?:\/([^/]+))?)?((?:\/.*)?))$/; -const VALID_COMPONENT = /^([^/]+-)?[a-f0-9]+$/; -class VirtualFS extends ProxiedFS { - constructor({ baseFs = new NodeFS() } = {}) { - super(ppath); - this.baseFs = baseFs; - } - static makeVirtualPath(base, component, to) { - if (ppath.basename(base) !== `__virtual__`) - throw new Error(`Assertion failed: Virtual folders must be named "__virtual__"`); - if (!ppath.basename(component).match(VALID_COMPONENT)) - throw new Error(`Assertion failed: Virtual components must be ended by an hexadecimal hash`); - const target = ppath.relative(ppath.dirname(base), to); - const segments = target.split(`/`); - let depth = 0; - while (depth < segments.length && segments[depth] === `..`) - depth += 1; - const finalSegments = segments.slice(depth); - const fullVirtualPath = ppath.join(base, component, String(depth), ...finalSegments); - return fullVirtualPath; - } - static resolveVirtual(p) { - const match = p.match(VIRTUAL_REGEXP); - if (!match || !match[3] && match[5]) - return p; - const target = ppath.dirname(match[1]); - if (!match[3] || !match[4]) - return target; - const isnum = NUMBER_REGEXP.test(match[4]); - if (!isnum) - return p; - const depth = Number(match[4]); - const backstep = `../`.repeat(depth); - const subpath = match[5] || `.`; - return VirtualFS.resolveVirtual(ppath.join(target, backstep, subpath)); - } - getExtractHint(hints) { - return this.baseFs.getExtractHint(hints); - } - getRealPath() { - return this.baseFs.getRealPath(); - } - realpathSync(p) { - const match = p.match(VIRTUAL_REGEXP); - if (!match) - return this.baseFs.realpathSync(p); - if (!match[5]) - return p; - const realpath = this.baseFs.realpathSync(this.mapToBase(p)); - return VirtualFS.makeVirtualPath(match[1], match[3], realpath); - } - async realpathPromise(p) { - const match = p.match(VIRTUAL_REGEXP); - if (!match) - return await this.baseFs.realpathPromise(p); - if (!match[5]) - return p; - const realpath = await this.baseFs.realpathPromise(this.mapToBase(p)); - return VirtualFS.makeVirtualPath(match[1], match[3], realpath); - } - mapToBase(p) { - if (p === ``) - return p; - if (this.pathUtils.isAbsolute(p)) - return VirtualFS.resolveVirtual(p); - const resolvedRoot = VirtualFS.resolveVirtual(this.baseFs.resolve(PortablePath.dot)); - const resolvedP = VirtualFS.resolveVirtual(this.baseFs.resolve(p)); - return ppath.relative(resolvedRoot, resolvedP) || PortablePath.dot; - } - mapFromBase(p) { - return p; - } -} - -const URL = Number(process.versions.node.split('.', 1)[0]) < 20 ? url.URL : globalThis.URL; - -class NodePathFS extends ProxiedFS { - constructor(baseFs) { - super(npath); - this.baseFs = baseFs; - } - mapFromBase(path) { - return path; - } - mapToBase(path) { - if (typeof path === `string`) - return path; - if (path instanceof URL) - return url.fileURLToPath(path); - if (Buffer.isBuffer(path)) { - const str = path.toString(); - if (!isUtf8(path, str)) - throw new Error(`Non-utf8 buffers are not supported at the moment. Please upvote the following issue if you encounter this error: https://github.com/yarnpkg/berry/issues/4942`); - return str; - } - throw new Error(`Unsupported path type: ${nodeUtils.inspect(path)}`); - } -} -function isUtf8(buf, str) { - if (typeof buffer__default.default.isUtf8 !== `undefined`) - return buffer__default.default.isUtf8(buf); - return Buffer.byteLength(str) === buf.byteLength; -} - -var _a, _b, _c, _d; -const kBaseFs = Symbol(`kBaseFs`); -const kFd = Symbol(`kFd`); -const kClosePromise = Symbol(`kClosePromise`); -const kCloseResolve = Symbol(`kCloseResolve`); -const kCloseReject = Symbol(`kCloseReject`); -const kRefs = Symbol(`kRefs`); -const kRef = Symbol(`kRef`); -const kUnref = Symbol(`kUnref`); -class FileHandle { - constructor(fd, baseFs) { - this[_a] = 1; - this[_b] = void 0; - this[_c] = void 0; - this[_d] = void 0; - this[kBaseFs] = baseFs; - this[kFd] = fd; - } - get fd() { - return this[kFd]; - } - async appendFile(data, options) { - try { - this[kRef](this.appendFile); - const encoding = (typeof options === `string` ? options : options?.encoding) ?? void 0; - return await this[kBaseFs].appendFilePromise(this.fd, data, encoding ? { encoding } : void 0); - } finally { - this[kUnref](); - } - } - async chown(uid, gid) { - try { - this[kRef](this.chown); - return await this[kBaseFs].fchownPromise(this.fd, uid, gid); - } finally { - this[kUnref](); - } - } - async chmod(mode) { - try { - this[kRef](this.chmod); - return await this[kBaseFs].fchmodPromise(this.fd, mode); - } finally { - this[kUnref](); - } - } - createReadStream(options) { - return this[kBaseFs].createReadStream(null, { ...options, fd: this.fd }); - } - createWriteStream(options) { - return this[kBaseFs].createWriteStream(null, { ...options, fd: this.fd }); - } - datasync() { - throw new Error(`Method not implemented.`); - } - sync() { - throw new Error(`Method not implemented.`); - } - async read(bufferOrOptions, offset, length, position) { - try { - this[kRef](this.read); - let buffer; - if (!Buffer.isBuffer(bufferOrOptions)) { - bufferOrOptions ??= {}; - buffer = bufferOrOptions.buffer ?? Buffer.alloc(16384); - offset = bufferOrOptions.offset || 0; - length = bufferOrOptions.length ?? buffer.byteLength; - position = bufferOrOptions.position ?? null; - } else { - buffer = bufferOrOptions; - } - offset ??= 0; - length ??= 0; - if (length === 0) { - return { - bytesRead: length, - buffer - }; - } - const bytesRead = await this[kBaseFs].readPromise(this.fd, buffer, offset, length, position); - return { - bytesRead, - buffer - }; - } finally { - this[kUnref](); - } - } - async readFile(options) { - try { - this[kRef](this.readFile); - const encoding = (typeof options === `string` ? options : options?.encoding) ?? void 0; - return await this[kBaseFs].readFilePromise(this.fd, encoding); - } finally { - this[kUnref](); - } - } - readLines(options) { - return readline.createInterface({ - input: this.createReadStream(options), - crlfDelay: Infinity - }); - } - async stat(opts) { - try { - this[kRef](this.stat); - return await this[kBaseFs].fstatPromise(this.fd, opts); - } finally { - this[kUnref](); - } - } - async truncate(len) { - try { - this[kRef](this.truncate); - return await this[kBaseFs].ftruncatePromise(this.fd, len); - } finally { - this[kUnref](); - } - } - utimes(atime, mtime) { - throw new Error(`Method not implemented.`); - } - async writeFile(data, options) { - try { - this[kRef](this.writeFile); - const encoding = (typeof options === `string` ? options : options?.encoding) ?? void 0; - await this[kBaseFs].writeFilePromise(this.fd, data, encoding); - } finally { - this[kUnref](); - } - } - async write(...args) { - try { - this[kRef](this.write); - if (ArrayBuffer.isView(args[0])) { - const [buffer, offset, length, position] = args; - const bytesWritten = await this[kBaseFs].writePromise(this.fd, buffer, offset ?? void 0, length ?? void 0, position ?? void 0); - return { bytesWritten, buffer }; - } else { - const [data, position, encoding] = args; - const bytesWritten = await this[kBaseFs].writePromise(this.fd, data, position, encoding); - return { bytesWritten, buffer: data }; - } - } finally { - this[kUnref](); - } - } - async writev(buffers, position) { - try { - this[kRef](this.writev); - let bytesWritten = 0; - if (typeof position !== `undefined`) { - for (const buffer of buffers) { - const writeResult = await this.write(buffer, void 0, void 0, position); - bytesWritten += writeResult.bytesWritten; - position += writeResult.bytesWritten; - } - } else { - for (const buffer of buffers) { - const writeResult = await this.write(buffer); - bytesWritten += writeResult.bytesWritten; - } - } - return { - buffers, - bytesWritten - }; - } finally { - this[kUnref](); - } - } - readv(buffers, position) { - throw new Error(`Method not implemented.`); - } - close() { - if (this[kFd] === -1) - return Promise.resolve(); - if (this[kClosePromise]) - return this[kClosePromise]; - this[kRefs]--; - if (this[kRefs] === 0) { - const fd = this[kFd]; - this[kFd] = -1; - this[kClosePromise] = this[kBaseFs].closePromise(fd).finally(() => { - this[kClosePromise] = void 0; - }); - } else { - this[kClosePromise] = new Promise((resolve, reject) => { - this[kCloseResolve] = resolve; - this[kCloseReject] = reject; - }).finally(() => { - this[kClosePromise] = void 0; - this[kCloseReject] = void 0; - this[kCloseResolve] = void 0; - }); - } - return this[kClosePromise]; - } - [(_a = kRefs, _b = kClosePromise, _c = kCloseResolve, _d = kCloseReject, kRef)](caller) { - if (this[kFd] === -1) { - const err = new Error(`file closed`); - err.code = `EBADF`; - err.syscall = caller.name; - throw err; - } - this[kRefs]++; - } - [kUnref]() { - this[kRefs]--; - if (this[kRefs] === 0) { - const fd = this[kFd]; - this[kFd] = -1; - this[kBaseFs].closePromise(fd).then(this[kCloseResolve], this[kCloseReject]); - } - } -} - -const SYNC_IMPLEMENTATIONS = /* @__PURE__ */ new Set([ - `accessSync`, - `appendFileSync`, - `createReadStream`, - `createWriteStream`, - `chmodSync`, - `fchmodSync`, - `chownSync`, - `fchownSync`, - `closeSync`, - `copyFileSync`, - `linkSync`, - `lstatSync`, - `fstatSync`, - `lutimesSync`, - `mkdirSync`, - `openSync`, - `opendirSync`, - `readlinkSync`, - `readFileSync`, - `readdirSync`, - `readlinkSync`, - `realpathSync`, - `renameSync`, - `rmdirSync`, - `rmSync`, - `statSync`, - `symlinkSync`, - `truncateSync`, - `ftruncateSync`, - `unlinkSync`, - `unwatchFile`, - `utimesSync`, - `watch`, - `watchFile`, - `writeFileSync`, - `writeSync` -]); -const ASYNC_IMPLEMENTATIONS = /* @__PURE__ */ new Set([ - `accessPromise`, - `appendFilePromise`, - `fchmodPromise`, - `chmodPromise`, - `fchownPromise`, - `chownPromise`, - `closePromise`, - `copyFilePromise`, - `linkPromise`, - `fstatPromise`, - `lstatPromise`, - `lutimesPromise`, - `mkdirPromise`, - `openPromise`, - `opendirPromise`, - `readdirPromise`, - `realpathPromise`, - `readFilePromise`, - `readdirPromise`, - `readlinkPromise`, - `renamePromise`, - `rmdirPromise`, - `rmPromise`, - `statPromise`, - `symlinkPromise`, - `truncatePromise`, - `ftruncatePromise`, - `unlinkPromise`, - `utimesPromise`, - `writeFilePromise`, - `writeSync` -]); -function patchFs(patchedFs, fakeFs) { - fakeFs = new NodePathFS(fakeFs); - const setupFn = (target, name, replacement) => { - const orig = target[name]; - target[name] = replacement; - if (typeof orig?.[nodeUtils.promisify.custom] !== `undefined`) { - replacement[nodeUtils.promisify.custom] = orig[nodeUtils.promisify.custom]; - } - }; - { - setupFn(patchedFs, `exists`, (p, ...args) => { - const hasCallback = typeof args[args.length - 1] === `function`; - const callback = hasCallback ? args.pop() : () => { - }; - process.nextTick(() => { - fakeFs.existsPromise(p).then((exists) => { - callback(exists); - }, () => { - callback(false); - }); - }); - }); - setupFn(patchedFs, `read`, (...args) => { - let [fd, buffer, offset, length, position, callback] = args; - if (args.length <= 3) { - let options = {}; - if (args.length < 3) { - callback = args[1]; - } else { - options = args[1]; - callback = args[2]; - } - ({ - buffer = Buffer.alloc(16384), - offset = 0, - length = buffer.byteLength, - position - } = options); - } - if (offset == null) - offset = 0; - length |= 0; - if (length === 0) { - process.nextTick(() => { - callback(null, 0, buffer); - }); - return; - } - if (position == null) - position = -1; - process.nextTick(() => { - fakeFs.readPromise(fd, buffer, offset, length, position).then((bytesRead) => { - callback(null, bytesRead, buffer); - }, (error) => { - callback(error, 0, buffer); - }); - }); - }); - for (const fnName of ASYNC_IMPLEMENTATIONS) { - const origName = fnName.replace(/Promise$/, ``); - if (typeof patchedFs[origName] === `undefined`) - continue; - const fakeImpl = fakeFs[fnName]; - if (typeof fakeImpl === `undefined`) - continue; - const wrapper = (...args) => { - const hasCallback = typeof args[args.length - 1] === `function`; - const callback = hasCallback ? args.pop() : () => { - }; - process.nextTick(() => { - fakeImpl.apply(fakeFs, args).then((result) => { - callback(null, result); - }, (error) => { - callback(error); - }); - }); - }; - setupFn(patchedFs, origName, wrapper); - } - patchedFs.realpath.native = patchedFs.realpath; - } - { - setupFn(patchedFs, `existsSync`, (p) => { - try { - return fakeFs.existsSync(p); - } catch (error) { - return false; - } - }); - setupFn(patchedFs, `readSync`, (...args) => { - let [fd, buffer, offset, length, position] = args; - if (args.length <= 3) { - const options = args[2] || {}; - ({ offset = 0, length = buffer.byteLength, position } = options); - } - if (offset == null) - offset = 0; - length |= 0; - if (length === 0) - return 0; - if (position == null) - position = -1; - return fakeFs.readSync(fd, buffer, offset, length, position); - }); - for (const fnName of SYNC_IMPLEMENTATIONS) { - const origName = fnName; - if (typeof patchedFs[origName] === `undefined`) - continue; - const fakeImpl = fakeFs[fnName]; - if (typeof fakeImpl === `undefined`) - continue; - setupFn(patchedFs, origName, fakeImpl.bind(fakeFs)); - } - patchedFs.realpathSync.native = patchedFs.realpathSync; - } - { - const patchedFsPromises = patchedFs.promises; - for (const fnName of ASYNC_IMPLEMENTATIONS) { - const origName = fnName.replace(/Promise$/, ``); - if (typeof patchedFsPromises[origName] === `undefined`) - continue; - const fakeImpl = fakeFs[fnName]; - if (typeof fakeImpl === `undefined`) - continue; - if (fnName === `open`) - continue; - setupFn(patchedFsPromises, origName, (pathLike, ...args) => { - if (pathLike instanceof FileHandle) { - return pathLike[origName].apply(pathLike, args); - } else { - return fakeImpl.call(fakeFs, pathLike, ...args); - } - }); - } - setupFn(patchedFsPromises, `open`, async (...args) => { - const fd = await fakeFs.openPromise(...args); - return new FileHandle(fd, fakeFs); - }); - } - { - patchedFs.read[nodeUtils.promisify.custom] = async (fd, buffer, ...args) => { - const res = fakeFs.readPromise(fd, buffer, ...args); - return { bytesRead: await res, buffer }; - }; - patchedFs.write[nodeUtils.promisify.custom] = async (fd, buffer, ...args) => { - const res = fakeFs.writePromise(fd, buffer, ...args); - return { bytesWritten: await res, buffer }; - }; - } -} - -let cachedInstance; -let registeredFactory = () => { - throw new Error(`Assertion failed: No libzip instance is available, and no factory was configured`); -}; -function setFactory(factory) { - registeredFactory = factory; -} -function getInstance() { - if (typeof cachedInstance === `undefined`) - cachedInstance = registeredFactory(); - return cachedInstance; -} - -var libzipSync = {exports: {}}; - -(function (module, exports) { -var frozenFs = Object.assign({}, fs__default.default); -var createModule = function() { - var _scriptDir = void 0; - if (typeof __filename !== "undefined") - _scriptDir = _scriptDir || __filename; - return function(createModule2) { - createModule2 = createModule2 || {}; - var Module = typeof createModule2 !== "undefined" ? createModule2 : {}; - var readyPromiseResolve, readyPromiseReject; - Module["ready"] = new Promise(function(resolve, reject) { - readyPromiseResolve = resolve; - readyPromiseReject = reject; - }); - var moduleOverrides = {}; - var key; - for (key in Module) { - if (Module.hasOwnProperty(key)) { - moduleOverrides[key] = Module[key]; - } - } - var scriptDirectory = ""; - function locateFile(path) { - if (Module["locateFile"]) { - return Module["locateFile"](path, scriptDirectory); - } - return scriptDirectory + path; - } - var read_, readBinary; - var nodeFS; - var nodePath; - { - { - scriptDirectory = __dirname + "/"; - } - read_ = function shell_read(filename, binary) { - var ret = tryParseAsDataURI(filename); - if (ret) { - return binary ? ret : ret.toString(); - } - if (!nodeFS) - nodeFS = frozenFs; - if (!nodePath) - nodePath = path__default.default; - filename = nodePath["normalize"](filename); - return nodeFS["readFileSync"](filename, binary ? null : "utf8"); - }; - readBinary = function readBinary2(filename) { - var ret = read_(filename, true); - if (!ret.buffer) { - ret = new Uint8Array(ret); - } - assert(ret.buffer); - return ret; - }; - if (process["argv"].length > 1) { - process["argv"][1].replace(/\\/g, "/"); - } - process["argv"].slice(2); - Module["inspect"] = function() { - return "[Emscripten Module object]"; - }; - } - Module["print"] || console.log.bind(console); - var err = Module["printErr"] || console.warn.bind(console); - for (key in moduleOverrides) { - if (moduleOverrides.hasOwnProperty(key)) { - Module[key] = moduleOverrides[key]; - } - } - moduleOverrides = null; - if (Module["arguments"]) - ; - if (Module["thisProgram"]) - ; - if (Module["quit"]) - ; - var wasmBinary; - if (Module["wasmBinary"]) - wasmBinary = Module["wasmBinary"]; - Module["noExitRuntime"] || true; - if (typeof WebAssembly !== "object") { - abort("no native wasm support detected"); - } - function getValue(ptr, type, noSafe) { - type = type || "i8"; - if (type.charAt(type.length - 1) === "*") - type = "i32"; - switch (type) { - case "i1": - return HEAP8[ptr >> 0]; - case "i8": - return HEAP8[ptr >> 0]; - case "i16": - return LE_HEAP_LOAD_I16((ptr >> 1) * 2); - case "i32": - return LE_HEAP_LOAD_I32((ptr >> 2) * 4); - case "i64": - return LE_HEAP_LOAD_I32((ptr >> 2) * 4); - case "float": - return LE_HEAP_LOAD_F32((ptr >> 2) * 4); - case "double": - return LE_HEAP_LOAD_F64((ptr >> 3) * 8); - default: - abort("invalid type for getValue: " + type); - } - return null; - } - var wasmMemory; - var ABORT = false; - function assert(condition, text) { - if (!condition) { - abort("Assertion failed: " + text); - } - } - function getCFunc(ident) { - var func = Module["_" + ident]; - assert( - func, - "Cannot call unknown function " + ident + ", make sure it is exported" - ); - return func; - } - function ccall(ident, returnType, argTypes, args, opts) { - var toC = { - string: function(str) { - var ret2 = 0; - if (str !== null && str !== void 0 && str !== 0) { - var len = (str.length << 2) + 1; - ret2 = stackAlloc(len); - stringToUTF8(str, ret2, len); - } - return ret2; - }, - array: function(arr) { - var ret2 = stackAlloc(arr.length); - writeArrayToMemory(arr, ret2); - return ret2; - } - }; - function convertReturnValue(ret2) { - if (returnType === "string") - return UTF8ToString(ret2); - if (returnType === "boolean") - return Boolean(ret2); - return ret2; - } - var func = getCFunc(ident); - var cArgs = []; - var stack = 0; - if (args) { - for (var i = 0; i < args.length; i++) { - var converter = toC[argTypes[i]]; - if (converter) { - if (stack === 0) - stack = stackSave(); - cArgs[i] = converter(args[i]); - } else { - cArgs[i] = args[i]; - } - } - } - var ret = func.apply(null, cArgs); - ret = convertReturnValue(ret); - if (stack !== 0) - stackRestore(stack); - return ret; - } - function cwrap(ident, returnType, argTypes, opts) { - argTypes = argTypes || []; - var numericArgs = argTypes.every(function(type) { - return type === "number"; - }); - var numericRet = returnType !== "string"; - if (numericRet && numericArgs && !opts) { - return getCFunc(ident); - } - return function() { - return ccall(ident, returnType, argTypes, arguments); - }; - } - var UTF8Decoder = new TextDecoder("utf8"); - function UTF8ToString(ptr, maxBytesToRead) { - if (!ptr) - return ""; - var maxPtr = ptr + maxBytesToRead; - for (var end = ptr; !(end >= maxPtr) && HEAPU8[end]; ) - ++end; - return UTF8Decoder.decode(HEAPU8.subarray(ptr, end)); - } - function stringToUTF8Array(str, heap, outIdx, maxBytesToWrite) { - if (!(maxBytesToWrite > 0)) - return 0; - var startIdx = outIdx; - var endIdx = outIdx + maxBytesToWrite - 1; - for (var i = 0; i < str.length; ++i) { - var u = str.charCodeAt(i); - if (u >= 55296 && u <= 57343) { - var u1 = str.charCodeAt(++i); - u = 65536 + ((u & 1023) << 10) | u1 & 1023; - } - if (u <= 127) { - if (outIdx >= endIdx) - break; - heap[outIdx++] = u; - } else if (u <= 2047) { - if (outIdx + 1 >= endIdx) - break; - heap[outIdx++] = 192 | u >> 6; - heap[outIdx++] = 128 | u & 63; - } else if (u <= 65535) { - if (outIdx + 2 >= endIdx) - break; - heap[outIdx++] = 224 | u >> 12; - heap[outIdx++] = 128 | u >> 6 & 63; - heap[outIdx++] = 128 | u & 63; - } else { - if (outIdx + 3 >= endIdx) - break; - heap[outIdx++] = 240 | u >> 18; - heap[outIdx++] = 128 | u >> 12 & 63; - heap[outIdx++] = 128 | u >> 6 & 63; - heap[outIdx++] = 128 | u & 63; - } - } - heap[outIdx] = 0; - return outIdx - startIdx; - } - function stringToUTF8(str, outPtr, maxBytesToWrite) { - return stringToUTF8Array(str, HEAPU8, outPtr, maxBytesToWrite); - } - function lengthBytesUTF8(str) { - var len = 0; - for (var i = 0; i < str.length; ++i) { - var u = str.charCodeAt(i); - if (u >= 55296 && u <= 57343) - u = 65536 + ((u & 1023) << 10) | str.charCodeAt(++i) & 1023; - if (u <= 127) - ++len; - else if (u <= 2047) - len += 2; - else if (u <= 65535) - len += 3; - else - len += 4; - } - return len; - } - function allocateUTF8(str) { - var size = lengthBytesUTF8(str) + 1; - var ret = _malloc(size); - if (ret) - stringToUTF8Array(str, HEAP8, ret, size); - return ret; - } - function writeArrayToMemory(array, buffer2) { - HEAP8.set(array, buffer2); - } - function alignUp(x, multiple) { - if (x % multiple > 0) { - x += multiple - x % multiple; - } - return x; - } - var buffer, HEAP8, HEAPU8; - var HEAP_DATA_VIEW; - function updateGlobalBufferAndViews(buf) { - buffer = buf; - Module["HEAP_DATA_VIEW"] = HEAP_DATA_VIEW = new DataView(buf); - Module["HEAP8"] = HEAP8 = new Int8Array(buf); - Module["HEAP16"] = new Int16Array(buf); - Module["HEAP32"] = new Int32Array(buf); - Module["HEAPU8"] = HEAPU8 = new Uint8Array(buf); - Module["HEAPU16"] = new Uint16Array(buf); - Module["HEAPU32"] = new Uint32Array(buf); - Module["HEAPF32"] = new Float32Array(buf); - Module["HEAPF64"] = new Float64Array(buf); - } - Module["INITIAL_MEMORY"] || 16777216; - var wasmTable; - var __ATPRERUN__ = []; - var __ATINIT__ = []; - var __ATPOSTRUN__ = []; - function preRun() { - if (Module["preRun"]) { - if (typeof Module["preRun"] == "function") - Module["preRun"] = [Module["preRun"]]; - while (Module["preRun"].length) { - addOnPreRun(Module["preRun"].shift()); - } - } - callRuntimeCallbacks(__ATPRERUN__); - } - function initRuntime() { - callRuntimeCallbacks(__ATINIT__); - } - function postRun() { - if (Module["postRun"]) { - if (typeof Module["postRun"] == "function") - Module["postRun"] = [Module["postRun"]]; - while (Module["postRun"].length) { - addOnPostRun(Module["postRun"].shift()); - } - } - callRuntimeCallbacks(__ATPOSTRUN__); - } - function addOnPreRun(cb) { - __ATPRERUN__.unshift(cb); - } - function addOnInit(cb) { - __ATINIT__.unshift(cb); - } - function addOnPostRun(cb) { - __ATPOSTRUN__.unshift(cb); - } - var runDependencies = 0; - var dependenciesFulfilled = null; - function addRunDependency(id) { - runDependencies++; - if (Module["monitorRunDependencies"]) { - Module["monitorRunDependencies"](runDependencies); - } - } - function removeRunDependency(id) { - runDependencies--; - if (Module["monitorRunDependencies"]) { - Module["monitorRunDependencies"](runDependencies); - } - if (runDependencies == 0) { - if (dependenciesFulfilled) { - var callback = dependenciesFulfilled; - dependenciesFulfilled = null; - callback(); - } - } - } - Module["preloadedImages"] = {}; - Module["preloadedAudios"] = {}; - function abort(what) { - if (Module["onAbort"]) { - Module["onAbort"](what); - } - what += ""; - err(what); - ABORT = true; - what = "abort(" + what + "). Build with -s ASSERTIONS=1 for more info."; - var e = new WebAssembly.RuntimeError(what); - readyPromiseReject(e); - throw e; - } - var dataURIPrefix = "data:application/octet-stream;base64,"; - function isDataURI(filename) { - return filename.startsWith(dataURIPrefix); - } - var wasmBinaryFile = "data:application/octet-stream;base64,AGFzbQEAAAAB/wE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QNACAEIAApAwhYDQELIABBADoAAA8LIAAoAgQiBUUEQA8LIAAgBDcDECAFIAOnaiABIAIQBxoLlgEBAn8CQAJAIAJFBEAgAacQCSIFRQ0BQRgQCSIEDQIgBRAGDAELIAIhBUEYEAkiBA0BCyADBEAgA0EANgIEIANBDjYCAAtBAA8LIARCADcDECAEIAE3AwggBCAFNgIEIARBAToAACAEIAJFOgABIAAgBSABIAMQZUEASAR/IAQtAAEEQCAEKAIEEAYLIAQQBkEABSAECwubAgEDfyAALQAAQSBxRQRAAkAgASEDAkAgAiAAIgEoAhAiAAR/IAAFAn8gASABLQBKIgBBAWsgAHI6AEogASgCACIAQQhxBEAgASAAQSByNgIAQX8MAQsgAUIANwIEIAEgASgCLCIANgIcIAEgADYCFCABIAAgASgCMGo2AhBBAAsNASABKAIQCyABKAIUIgVrSwRAIAEgAyACIAEoAiQRAAAaDAILAn8gASwAS0F/SgRAIAIhAANAIAIgACIERQ0CGiADIARBAWsiAGotAABBCkcNAAsgASADIAQgASgCJBEAACAESQ0CIAMgBGohAyABKAIUIQUgAiAEawwBCyACCyEAIAUgAyAAEAcaIAEgASgCFCAAajYCFAsLCwvNBQEGfyAAKAIwIgNBhgJrIQYgACgCPCECIAMhAQNAIAAoAkQgAiAAKAJoIgRqayECIAEgBmogBE0EQCAAKAJIIgEgASADaiADEAcaAkAgAyAAKAJsIgFNBEAgACABIANrNgJsDAELIABCADcCbAsgACAAKAJoIANrIgE2AmggACAAKAJYIANrNgJYIAEgACgChC5JBEAgACABNgKELgsgAEH8gAEoAgARAwAgAiADaiECCwJAIAAoAgAiASgCBCIERQ0AIAAoAjwhBSAAIAIgBCACIARJGyICBH8gACgCSCAAKAJoaiAFaiEFIAEgBCACazYCBAJAAkACQAJAIAEoAhwiBCgCFEEBaw4CAQACCyAEQaABaiAFIAEoAgAgAkHcgAEoAgARCAAMAgsgASABKAIwIAUgASgCACACQcSAASgCABEEADYCMAwBCyAFIAEoAgAgAhAHGgsgASABKAIAIAJqNgIAIAEgASgCCCACajYCCCAAKAI8BSAFCyACaiICNgI8AkAgACgChC4iASACakEDSQ0AIAAoAmggAWshAQJAIAAoAnRBgQhPBEAgACAAIAAoAkggAWoiAi0AACACLQABIAAoAnwRAAA2AlQMAQsgAUUNACAAIAFBAWsgACgChAERAgAaCyAAKAKELiAAKAI8IgJBAUZrIgRFDQAgACABIAQgACgCgAERBQAgACAAKAKELiAEazYChC4gACgCPCECCyACQYUCSw0AIAAoAgAoAgRFDQAgACgCMCEBDAELCwJAIAAoAkQiAiAAKAJAIgNNDQAgAAJ/IAAoAjwgACgCaGoiASADSwRAIAAoAkggAWpBACACIAFrIgNBggIgA0GCAkkbIgMQGSABIANqDAELIAFBggJqIgEgA00NASAAKAJIIANqQQAgAiADayICIAEgA2siAyACIANJGyIDEBkgACgCQCADags2AkALC50CAQF/AkAgAAJ/IAAoAqAuIgFBwABGBEAgACgCBCAAKAIQaiAAKQOYLjcAACAAQgA3A5guIAAgACgCEEEIajYCEEEADAELIAFBIE4EQCAAKAIEIAAoAhBqIAApA5guPgAAIAAgAEGcLmo1AgA3A5guIAAgACgCEEEEajYCECAAIAAoAqAuQSBrIgE2AqAuCyABQRBOBEAgACgCBCAAKAIQaiAAKQOYLj0AACAAIAAoAhBBAmo2AhAgACAAKQOYLkIQiDcDmC4gACAAKAKgLkEQayIBNgKgLgsgAUEISA0BIAAgACgCECIBQQFqNgIQIAEgACgCBGogACkDmC48AAAgACAAKQOYLkIIiDcDmC4gACgCoC5BCGsLNgKgLgsLEAAgACgCCBAGIABBADYCCAvwAQECf0F/IQECQCAALQAoDQAgACgCJEEDRgRAIABBDGoEQCAAQQA2AhAgAEEXNgIMC0F/DwsCQCAAKAIgBEAgACkDGELAAINCAFINASAAQQxqBEAgAEEANgIQIABBHTYCDAtBfw8LAkAgACgCACICRQ0AIAIQMkF/Sg0AIAAoAgAhASAAQQxqIgAEQCAAIAEoAgw2AgAgACABKAIQNgIEC0F/DwsgAEEAQgBBABAOQn9VDQAgACg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GGw0AIAVBAUZBACAEQQJGGw0AIAVBAkciAw0BIARBAkcNAQsgASABLwEMQYAQcjsBDEEAIQMMAQsgASABLwEMQf/vA3E7AQxBACEFIANFBEBB9eABIAEoAjAgAEEIahBpIgVFDQILIAJBgAJxBEAgBSEDDAELIARBAkcEQCAFIQMMAQtB9cYBIAEoAjggAEEIahBpIgNFBEAgBRAcDAILIAMgBTYCAAsgASABLwEMQf7/A3EgAS8BUiIFQQBHcjsBDAJAAkACQAJAAn8CQAJAIAEpAyhC/v///w9WDQAgASkDIEL+////D1YNACACQYAEcUUNASABKQNIQv////8PVA0BCyAFQYECa0H//wNxQQNJIQdBAQwBCyAFQYECa0H//wNxIQQgAkGACnFBgApHDQEgBEEDSSEHQQALIQkgBkIcEBciBEUEQCAAQQhqIgAEQCAAQQA2AgQgAEEONgIACyADEBwMBQsgAkGACHEhBQJAAkAgAkGAAnEEQAJAIAUNACABKQMgQv////8PVg0AIAEpAyhCgICAgBBUDQMLIAQgASkDKBAYIAEpAyAhDAwBCwJAAkACQCAFDQAgASkDIEL/////D1YNACABKQMoIgxC/////w9WDQEgASkDSEKAgICAEFQNBAsgASkDKCIMQv////8PVA0BCyAEIAwQGAsgASkDICIMQv////8PWgRAIAQgDBAYCyABKQNIIgxC/////w9UDQELIAQgDBAYCyAELQAARQRAIABBCGoiAARAIABBADYCBCAAQRQ2AgALIAQQCCADEBwMBQtBASEKQQEgBC0AAAR+IAQpAxAFQgALp0H//wNxIAYQRyEFIAQQCCAFIAM2AgAgBw0BDAILIAMhBSAEQQJLDQELIAZCBxAXIgRFBEAgAEEIaiIABEAgAEEANgIEIABBDjYCAAsgBRAcDAMLIARBAhANIARBhxJBAhAsIAQgAS0AUhBwIAQgAS8BEBANIAQtAABFBEAgAEEIaiIABEAgAEEANgIEIABBFDYCAAsgBBAIDAILQYGyAkEHIAYQRyEDIAQQCCADIAU2AgBBASELIAMhBQsgBkIuEBciA0UEQCAAQQhqIgAEQCAAQQA2AgQgAEEONgIACyA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Q2AhgLIAAgADYCDCAAIAA2AggPCyAEKAIIIgEgADYCDCAEIAA2AgggAEEANgIYIAAgBDYCDCAAIAE2AggLC1gCAX8BfgJAAn9BACAARQ0AGiAArUIChiICpyIBIABBBHJBgIAESQ0AGkF/IAEgAkIgiKcbCyIBEAkiAEUNACAAQQRrLQAAQQNxRQ0AIABBACABEBkLIAALQwEDfwJAIAJFDQADQCAALQAAIgQgAS0AACIFRgRAIAFBAWohASAAQQFqIQAgAkEBayICDQEMAgsLIAQgBWshAwsgAwsUACAAEEAgACgCABAgIAAoAgQQIAutBAIBfgV/IwBBEGsiBCQAIAAgAWshBgJAAkAgAUEBRgRAIAAgBi0AACACEBkMAQsgAUEJTwRAIAAgBikAADcAACAAIAJBAWtBB3FBAWoiBWohACACIAVrIgFFDQIgBSAGaiECA0AgACACKQAANwAAIAJBCGohAiAAQQhqIQAgAUEIayIBDQALDAILAkACQAJAAkAgAUEEaw4FAAICAgECCyAEIAYoAAAiATYCBCAEIAE2AgAMAgsgBCAGKQAANwMADAELQQghByAEQQhqIQgDQCAIIAYgByABIAEgB0sbIgUQByAFaiEIIAcgBWsiBw0ACyAEIAQpAwg3AwALAkAgBQ0AIAJBEEkNACAEKQMAIQMgAkEQayIGQQR2QQFqQQdxIgEEQANAIAAgAzcACCAAIAM3AAAgAkEQayECIABBEGohACABQQFrIgENAAsLIAZB8ABJDQADQCAAIAM3AHggACADNwBwIAAgAzcAaCAAIAM3AGAgACADNwBYIAAgAzcAUCAAIAM3AEggACADNwBAIAAgAzcAOCAAIAM3ADAgACADNwAoIAAgAzcAICAAIAM3ABggACADNwAQIAAgAzcACCAAIAM3AAAgAEGAAWohACACQYABayICQQ9LDQALCyACQQhPBEBBCCAFayEBA0AgACAEKQMANwAAIAAgAWohACACIAFrIgJBB0sNAAsLIAJFDQEgACAEIAIQBxoLIAAgAmohAAsgBEEQaiQAIAALXwECfyAAKAIIIgEEQCABEAsgAEEANgIICwJAIAAoAgQiAUUNACABKAIAIgJBAX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ABIAMgBhAHGiACIQEMAQsgASADIAMgAWsiASABQR91IgFqIAFzIgIQByACaiEBIBogAq0iHn0iHFANACACIANqIQIDQAJAIBwgHiAcIB5UGyIbQiBUBEAgGyEaDAELIBsiGkIgfSIgQgWIQgF8QgODIh9QRQRAA0AgASACKQAANwAAIAEgAikAGDcAGCABIAIpABA3ABAgASACKQAINwAIIBpCIH0hGiACQSBqIQIgAUEgaiEBIB9CAX0iH0IAUg0ACwsgIELgAFQNAANAIAEgAikAADcAACABIAIpABg3ABggASACKQAQNwAQIAEgAikACDcACCABIAIpADg3ADggASACKQAwNwAwIAEgAikAKDcAKCABIAIpACA3ACAgASACKQBYNwBYIAEgAikAUDcAUCABIAIpAEg3AEggASACKQBANwBAIAEgAikAYDcAYCABIAIpAGg3AGggASACKQBwNwBwIAEgAikAeDcAeCACQYABaiECIAFBgAFqIQEgGkKAAX0iGkIfVg0ACwsgGkIQWgRAIAEgAikAADcAACABIAIpAAg3AAggGkIQfSEaIAJBEGohAiABQRBqIQELIBpCCFoEQCABIAIpAAA3AAAgGkIIfSEaIAJBCGohAiABQQhqIQELIBpCBFoEQCABIAIoAAA2AAAgGkIEfSEaIAJBBGohAiABQQRqIQELIBpCAloEQCABIAIvAAA7AAAgGkICfSEaIAJBAmohAiABQQJqIQELIBwgG30hHCAaUEUEQCABIAItAAA6AAAgAkEBaiECIAFBAWohAQsgHEIAUg0ACwsgDiEGIAwhAwsgBSAGSwRAAkACQCABIANNIAEgDyABa6wiGiAGrSIbIBogG1QbIhqnIglqIgIgA0txDQAgAyAJaiABSyABIANPcQ0AIAEgAyAJEAcaDAELIAEgAyADIAFrIgEgAUEfdSIBaiABcyIBEAcgAWohAiAaIAGtIh59IhxQDQAgASADaiEBA0ACQCAcIB4gHCAeVBsiG0IgVARAIBshGgwBCyAbIhpCIH0iIEIFiEIBfEIDgyIfUEUEQANAIAIgASkAADcAACACIAEpABg3ABggAiABKQAQNwAQIAIgASkACDcACCAaQiB9IRogAUEgaiEBIAJ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DcACCACIAEpADg3ADggAiABKQAwNwAwIAIgASkAKDcAKCACIAEpACA3ACAgAiABKQBYNwBYIAIgASkAUDcAUCACIAEpAEg3AEggAiABKQBANwBAIAIgASkAYDcAYCACIAEpAGg3AGggAiABKQBwNwBwIAIgASkAeDcAeCABQYABaiEBIAJBgAFqIQIgGkKAAX0iGkIfVg0ACwsgGkIQWgRAIAIgASkAADcAACACIAEpAAg3AAggGkIQfSEaIAJBEGohAiABQRBqIQELIBpCCFoEQCACIAEpAAA3AAAgGkIIfSEaIAJBCGohAiABQQhqIQELIBpCBFoEQCACIAEoAAA2AAAgGkIEfSEaIAJBBGohAiABQQRqIQELIBpCAloEQCACIAEvAAA7AAAgGkICfSEaIAJBAmohAiABQQJqIQELIBwgG30hHCAaUEUEQCACIAEtAAA6AAAgAkEBaiECIAFBAWohAQsgHFBFDQALDAILAkAgASADTSABIA8gAWusIhogBa0iGyAaIBtUGyIapyIEaiICIANLcQ0AIAMgBGogAUsgASADT3ENACABIAMgBBAHGgwCCyABIAMgAyABayIBIAFBH3UiAWogAXMiARAHIAFqIQIgGiABrSIefSIcUA0BIAEgA2ohAQNAAkAgHCAeIBwgHlQbIhtCIFQEQCAbIRoMAQsgGyIaQiB9IiBCBYhCAXxCA4MiH1BFBEADQCACIAEpAAA3AAAgAiABKQAYNwAYIAIgASkAEDcAECACIAEpAAg3AAggGkIgfSEaIAFBIGohASACQSBqIQIgH0IBfSIfQgBSDQALCyAgQuAAVA0AA0AgAiABKQAANwAAIAIgASkAGDcAGCACIAEpABA3ABAgAiABKQAINwAIIAIgASkAODcAOCACIAEpADA3ADAgAiABKQAoNwAoIAIgASkAIDcAICACIAEpAFg3AFggAiABKQBQNwBQIAIgASkASDcASCACIAEpAEA3AEAgAiABKQBgNwBgIAIgASkAaDcAaCACIAEpAHA3AHAgAiABKQB4NwB4IAFBgAFqIQEgAkGAAWohAiAaQoABfSIaQh9WDQALCyAaQhBaBEAgAiABKQAANwAAIAIgASkACDcACCAaQhB9IRogAkEQaiECIAFBEGohAQsgGkIIWgRAIAIgASkAADcAACAaQgh9IRogAkEIaiECIAFBCGohAQsgGkIEWgRAIAIgASgAADYAACAaQgR9IRogAkEEaiECIAFBBGohAQsgGkICWgRAIAIgAS8AADsAACAaQgJ9IRogAkECaiECIAFBAmohAQsgHCAbfSEcIBpQRQRAIAIgAS0AADoAACACQQFqIQIgAUEBaiEBCyAcUEUNAAsMAQsCQAJAIBYEQAJAIAQgBUkEQCAHKAKYRyAESw0BCyABIARrIQMCQEEAIARrIgVBf0ogDyABa6wiGiAbIBogG1QbIhqnIgIgBUpxDQAgBUEBSCACIANqIAFLcQ0AIAEgAyACEAcgAmohAgwFCyABIAMgBCAEQR91IgFqIAFzIgEQByABaiECIBogAa0iHn0iHFANBCABIANqIQEDQAJAIBwgHiAcIB5UGyIbQiBUBEAgGyEaDAELIBsiGkIgfSIgQgWIQgF8QgODIh9QRQRAA0AgAiABKQAANwAAIAIgASkAGDcAGCACIAEpABA3ABAgAiABKQAINwAIIBpCIH0hGiABQSBqIQEgAkEgaiECIB9CAX0iH0IAUg0ACwsgIELgAFQNAANAIAIgASkAADcAACACIAEpABg3ABggAiABKQAQNwAQIAIgASkACDcACCACIAEpADg3ADggAiABKQAwNwAwIAIgASkAKDcAKCACIAEpACA3ACAgAiABKQBYNwBYIAIgASkAUDcAUCACIAEpAEg3AEggAiABKQBANwBAIAIgASkAYDcAYCACIAEpAGg3AGggAiABKQBwNwBwIAIgASkAeDcAeCABQYABaiEBIAJBgAFqIQIgGkKAAX0iGkIfVg0ACwsgGkIQWgRAIAIgASkAADcAACACIAEpAAg3AAggGkIQfSEaIAJBEGohAiABQRBqIQELIBpCCFoEQCACIAEpAAA3AAAgGkIIfSEaIAJBCGohAiABQQhqIQELIBpCBFoEQCACIAEoAAA2AAAgGkIEfSEaIAJBBGohAiABQQRqIQELIBpCAloEQCACIAEvAAA7AAAgGkICfSEaIAJBAmohAiABQQJqIQELIBwgG30hHCAaUEUEQCACIAEtAA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IQIgA0EIayIDDQALDAELIAMNAQsgASECDAELIAEgBCADED8hAgsgCyEFDAELIAEgAy0AAjoAACABQQFqIQILIAUgFE8NACACIBNJDQELCyAAIAI2AgwgACAFIAhBA3ZrIgE2AgAgACATIAJrQYMCajYCECAAIBQgAWtBDmo2AgQgByAIQQdxIgA2AogBIAcgHUJ/IACthkJ/hYM+AoQBC+cFAQR/IAMgAiACIANLGyEEIAAgAWshAgJAIABBB3FFDQAgBEUNACAAIAItAAA6AAAgA0EBayEGIAJBAWohAiAAQQFqIgdBB3FBACAEQQFrIgUbRQRAIAchACAFIQQgBiEDDAELIAAgAi0AADoAASADQQJrIQYgBEECayEFIAJBAWohAgJAIABBAmoiB0EHcUUNACAFRQ0AIAAgAi0AADoAAiADQQNrIQYgBEEDayEFIAJBAWohAgJAIABBA2oiB0EHcUUNACAFRQ0AIAAgAi0AADoAAyADQQRrIQYgBEEEayEFIAJBAWohAgJAIABBBGoiB0EHcUUNACAFRQ0AIAAgAi0AADoABCADQQVrIQYgBEEFayEFIAJBAWohAgJAIABBBWoiB0EHcUUNACAFRQ0AIAAgAi0AADoABSADQQZrIQYgBEEGayEFIAJBAWohAgJAIABBBmoiB0EHcUUNACAFRQ0AIAAgAi0AADoABiADQQdrIQYgBEEHayEFIAJBAWohAgJAIABBB2oiB0EHcUUNACAFRQ0AIAAgAi0AADoAByADQQhrIQMgBEEIayEEIABBCGohACACQQFqIQIMBgsgByEAIAUhBCAGIQMMBQsgByEAIAUhBCAGIQMMBAsgByEAIAUhBCAGIQMMAwsgByEAIAUhBCAGIQMMAgsgByEAIAUhBCAGIQMMAQsgByEAIAUhBCAGIQMLAkAgA0EXTQRAIARFDQEgBEEBayEBIARBB3EiAwRAA0AgACACLQAAOgAAIARBAWshBCAAQQFqIQAgAkEBaiECIANBAWsiAw0ACwsgAUEHSQ0BA0AgACACLQAAOgAAIAAgAi0AAToAASAAIAItAAI6AAIgACACLQADOgADIAAgAi0ABDoABCAAIAItAAU6AAUgACACLQA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woAixFDQAgAygCECIGIAlNDQAgBQJ/IAUoAjAhBEEAIAMoAgQgCWoiAUUNABogBCABIAYgCWtB1IABKAIAEQAACzYCMAsgA0HnADYCIAsCQCADKAIcKAIsBEAgAygCDCADKAIQIgFBAmpJBH8gBRAKIAMoAhANAkEABSABCyADKAIEaiAFKAIwOwAAIAMgAygCEEECajYCECADQaABakHkgAEoAgARAQAaCyADQfEANgIgIAUQCiADKAIQRQ0BDAcLDAYLIAUoAgQNAQsgAygCPA0AIApFDQEgAygCIEGaBUYNAQsCfyADKAKIASIBRQRAIAMgChCFAQwBCwJAAkACQCADKAKMAUECaw4CAAECCwJ/AkADQAJAAkAgAygCPA0AIAMQLyADKAI8DQAgCg0BQQAMBAsgAygCSCADKAJoai0AACEEIAMgAygC8C0iAUEBajYC8C0gASADKALsLWpBADoAACADIAMoAvAtIgFBAWo2AvAtIAEgAygC7C1qQQA6AAAgAyADKALwLSIBQQFqNgLwLSABIAMoAuwtaiAEOgAAIAMgBEECdGoiASABLwHkAUEBajsB5AEgAyADKAI8QQFrNgI8IAMgAygCaEEBaiIBNgJoIAMoAvAtIAMoAvQtRw0BQQAhBCADIAMoAlgiBkEATgR/IAMoAkggBmoFQQALIAEgBmtBABAPIAMgAygCaDYCWCADKAIAEAogAygCACgCEA0BDAILCyADQQA2AoQuIApBBEYEQCADIAMoAlgiAUEATgR/IAMoAkggAWoFQQALIAMoAmggAWtBARAPIAMgAygCaDYCWCADKAIAEApBA0ECIAMoAgAoAhAbDAILIAMoAvAtBEBBACEEIAMgAygCWCIBQQBOBH8gAygCSCABagVBAAsgAygCaCABa0EAEA8gAyADKAJoNgJYIAMoAgAQCiADKAIAKAIQRQ0BC0EBIQQLIAQLDAILAn8CQANAAkACQAJAAkACQCADKAI8Ig1BggJLDQAgAxAvAkAgAygCPCINQYICSw0AIAoNAEEADAgLIA1FDQQgDUECSw0AIAMoAmghCAwBCyADKAJoIghFBEBBACEIDAELIAMoAkggCGoiAUEBayIELQAAIgYgAS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Teb8CL8PXemp6ck5WwBo64Qk4Pt2zUEaYCvVypLCdD/eIsWvLMtkTjot8J7IxFFMF+DZXOUJeL3z7+xtAQZNuacacmlV89OIQxVHWLH85opu2G6anDHPe4rXW6t4PvpeNN5LzsY36i/Q0X7/IjjfLf0cVz0P9fbcGRNiDOv6w+bBTje2M6eWVyVBAofXqKNVCIwrRfpliqTsgx50Hmq/gVKKDhGgY6/wtoU7IERsmvKbSBLiaaGzA39HJ9ONroYFAQAAJ0HAAAsCQAAhgUAAEgFAACnBQAAAAQAADIFAAC8BQAALAkAQYDBAAv3CQwACACMAAgATAAIAMwACAAsAAgArAAIAGwACADsAAgAHAAIAJwACABcAAgA3AAIADwACAC8AAgAfAAIAPwACAACAAgAggAIAEIACADCAAgAIgAIAKIACABiAAgA4gAIABIACACSAAgAUgAIANIACAAyAAgAsgAIAHIACADyAAgACgAIAIoACABKAAgAygAIACoACACqAAgAagAIAOoACAAaAAgAmgAIAFoACADaAAgAOgAIALoACAB6AAgA+gAIAAYACACGAAgARgAIAMYACAAmAAgApgAIAGYACADmAAgAFgAIAJYACABWAAgA1gAIADYACAC2AAgAdgAIAPYACAAOAAgAjgAIAE4ACADOAAgALgAIAK4ACABuAAgA7gAIAB4ACACeAAgAXgAIAN4ACAA+AAgAvgAIAH4ACAD+AAgAAQAIAIEACABBAAgAwQAIACEACAChAAgAYQAIAOEACAARAAgAkQAIAFEACADRAAgAMQAIALEACABxAAgA8QAIAAkACACJAAgASQAIAMkACAApAAgAqQAIAGkACADpAAgAGQAIAJkACABZAAgA2QAIADkACAC5AAgAeQAIAPkACAAFAAgAhQAIAEUACADFAAgAJQAIAKUACABlAAgA5QAIABUACACVAAgAVQAIANUACAA1AAgAtQAIAHUACAD1AAgADQAIAI0ACABNAAgAzQAIAC0ACACtAAgAbQAIAO0ACAAdAAgAnQAIAF0ACADdAAgAPQAIAL0ACAB9AAgA/QAIABMACQATAQkAkwAJAJMBCQBTAAkAUwEJANMACQDTAQkAMwAJADMBCQ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c3VwcG9ydGVkAFByb3RvY29sIGZhbWlseSBub3Qgc3VwcG9ydGVkAEFkZHJlc3MgZmFtaWx5IG5vdCBzdXBwb3J0ZWQgYnkgcHJvdG9jb2wAQWRkcmVzcyBub3QgYXZhaWxhYmxlAE5ldHdvcmsgaXMgZG93bgBOZXR3b3JrIHVucmVhY2hhYmxlAENvbm5lY3Rpb24gcmVzZXQgYnkgbmV0d29yawBDb25uZWN0aW9uIGFib3J0ZWQATm8gYnVmZmVyIHNwYWNlIGF2YWlsYWJsZQBTb2NrZXQgaXMgY29ubmVjdGVkAFNvY2tldCBub3QgY29ubmVjdGVkAENhbm5vdCBzZW5kIGFmdGVyIHNvY2tldCBzaHV0ZG93bgBPcGVyYXRpb24gYWxyZWFkeSBpbiBwcm9ncmVzcwBPcGVyYXRpb24gaW4gcHJvZ3Jlc3MAU3RhbGUgZmlsZSBoYW5kbGUAUmVtb3RlIEkvTyBlcnJvcgBRdW90YSBleGNlZWRlZABObyBtZWRpdW0gZm91bmQAV3JvbmcgbWVkaXVtIHR5cGUATm8gZXJyb3IgaW5mb3JtYXRpb24AQcCAAQuFARMAAAAUAAAAFQAAABYAAAAXAAAAGAAAABkAAAAaAAAAGwAAABwAAAAdAAAAHgAAAB8AAAAgAAAAIQAAACIAAAAjAAAAgERQADEAAAAyAAAAMwAAADQAAAA1AAAANgAAADcAAAA4AAAAOQAAADIAAAAzAAAANAAAADUAAAA2AAAANwAAADgAQfSCAQsCXEQAQbCDAQsQ/////////////////////w=="; - if (!isDataURI(wasmBinaryFile)) { - wasmBinaryFile = locateFile(wasmBinaryFile); - } - function getBinary(file) { - try { - if (file == wasmBinaryFile && wasmBinary) { - return new Uint8Array(wasmBinary); - } - var binary = tryParseAsDataURI(file); - if (binary) { - return binary; - } - if (readBinary) { - return readBinary(file); - } else { - throw "sync fetching of the wasm failed: you can preload it to Module['wasmBinary'] manually, or emcc.py will do that for you when generating HTML (but not JS)"; - } - } catch (err2) { - abort(err2); - } - } - function instantiateSync(file, info) { - var instance; - var module2; - var binary; - try { - binary = getBinary(file); - module2 = new WebAssembly.Module(binary); - instance = new WebAssembly.Instance(module2, info); - } catch (e) { - var str = e.toString(); - err("failed to compile wasm module: " + str); - if (str.includes("imported Memory") || str.includes("memory import")) { - err( - "Memory size incompatibility issues may be due to changing INITIAL_MEMORY at runtime to something too large. Use ALLOW_MEMORY_GROWTH to allow any size memory (and also make sure not to set INITIAL_MEMORY at runtime to something smaller than it was at compile time)." - ); - } - throw e; - } - return [instance, module2]; - } - function createWasm() { - var info = { a: asmLibraryArg }; - function receiveInstance(instance, module2) { - var exports3 = instance.exports; - Module["asm"] = exports3; - wasmMemory = Module["asm"]["g"]; - updateGlobalBufferAndViews(wasmMemory.buffer); - wasmTable = Module["asm"]["W"]; - addOnInit(Module["asm"]["h"]); - removeRunDependency(); - } - addRunDependency(); - if (Module["instantiateWasm"]) { - try { - var exports2 = Module["instantiateWasm"](info, receiveInstance); - return exports2; - } catch (e) { - err("Module.instantiateWasm callback failed with error: " + e); - return false; - } - } - var result = instantiateSync(wasmBinaryFile, info); - receiveInstance(result[0]); - return Module["asm"]; - } - function LE_HEAP_LOAD_F32(byteOffset) { - return HEAP_DATA_VIEW.getFloat32(byteOffset, true); - } - function LE_HEAP_LOAD_F64(byteOffset) { - return HEAP_DATA_VIEW.getFloat64(byteOffset, true); - } - function LE_HEAP_LOAD_I16(byteOffset) { - return HEAP_DATA_VIEW.getInt16(byteOffset, true); - } - function LE_HEAP_LOAD_I32(byteOffset) { - return HEAP_DATA_VIEW.getInt32(byteOffset, true); - } - function LE_HEAP_STORE_I32(byteOffset, value) { - HEAP_DATA_VIEW.setInt32(byteOffset, value, true); - } - function callRuntimeCallbacks(callbacks) { - while (callbacks.length > 0) { - var callback = callbacks.shift(); - if (typeof callback == "function") { - callback(Module); - continue; - } - var func = callback.func; - if (typeof func === "number") { - if (callback.arg === void 0) { - wasmTable.get(func)(); - } else { - wasmTable.get(func)(callback.arg); - } - } else { - func(callback.arg === void 0 ? null : callback.arg); - } - } - } - function _gmtime_r(time, tmPtr) { - var date = new Date(LE_HEAP_LOAD_I32((time >> 2) * 4) * 1e3); - LE_HEAP_STORE_I32((tmPtr >> 2) * 4, date.getUTCSeconds()); - LE_HEAP_STORE_I32((tmPtr + 4 >> 2) * 4, date.getUTCMinutes()); - LE_HEAP_STORE_I32((tmPtr + 8 >> 2) * 4, date.getUTCHours()); - LE_HEAP_STORE_I32((tmPtr + 12 >> 2) * 4, date.getUTCDate()); - LE_HEAP_STORE_I32((tmPtr + 16 >> 2) * 4, date.getUTCMonth()); - LE_HEAP_STORE_I32((tmPtr + 20 >> 2) * 4, date.getUTCFullYear() - 1900); - LE_HEAP_STORE_I32((tmPtr + 24 >> 2) * 4, date.getUTCDay()); - LE_HEAP_STORE_I32((tmPtr + 36 >> 2) * 4, 0); - LE_HEAP_STORE_I32((tmPtr + 32 >> 2) * 4, 0); - var start = Date.UTC(date.getUTCFullYear(), 0, 1, 0, 0, 0, 0); - var yday = (date.getTime() - start) / (1e3 * 60 * 60 * 24) | 0; - LE_HEAP_STORE_I32((tmPtr + 28 >> 2) * 4, yday); - if (!_gmtime_r.GMTString) - _gmtime_r.GMTString = allocateUTF8("GMT"); - LE_HEAP_STORE_I32((tmPtr + 40 >> 2) * 4, _gmtime_r.GMTString); - return tmPtr; - } - function ___gmtime_r(a0, a1) { - return _gmtime_r(a0, a1); - } - function _emscripten_memcpy_big(dest, src, num) { - HEAPU8.copyWithin(dest, src, src + num); - } - function emscripten_realloc_buffer(size) { - try { - wasmMemory.grow(size - buffer.byteLength + 65535 >>> 16); - updateGlobalBufferAndViews(wasmMemory.buffer); - return 1; - } catch (e) { - } - } - function _emscripten_resize_heap(requestedSize) { - var oldSize = HEAPU8.length; - requestedSize = requestedSize >>> 0; - var maxHeapSize = 2147483648; - if (requestedSize > maxHeapSize) { - return false; - } - for (var cutDown = 1; cutDown <= 4; cutDown *= 2) { - var overGrownHeapSize = oldSize * (1 + 0.2 / cutDown); - overGrownHeapSize = Math.min( - overGrownHeapSize, - requestedSize + 100663296 - ); - var newSize = Math.min( - maxHeapSize, - alignUp(Math.max(requestedSize, overGrownHeapSize), 65536) - ); - var replacement = emscripten_realloc_buffer(newSize); - if (replacement) { - return true; - } - } - return false; - } - function _setTempRet0(val) { - } - function _time(ptr) { - var ret = Date.now() / 1e3 | 0; - if (ptr) { - LE_HEAP_STORE_I32((ptr >> 2) * 4, ret); - } - return ret; - } - function _tzset() { - if (_tzset.called) - return; - _tzset.called = true; - var currentYear = new Date().getFullYear(); - var winter = new Date(currentYear, 0, 1); - var summer = new Date(currentYear, 6, 1); - var winterOffset = winter.getTimezoneOffset(); - var summerOffset = summer.getTimezoneOffset(); - var stdTimezoneOffset = Math.max(winterOffset, summerOffset); - LE_HEAP_STORE_I32((__get_timezone() >> 2) * 4, stdTimezoneOffset * 60); - LE_HEAP_STORE_I32( - (__get_daylight() >> 2) * 4, - Number(winterOffset != summerOffset) - ); - function extractZone(date) { - var match = date.toTimeString().match(/\(([A-Za-z ]+)\)$/); - return match ? match[1] : "GMT"; - } - var winterName = extractZone(winter); - var summerName = extractZone(summer); - var winterNamePtr = allocateUTF8(winterName); - var summerNamePtr = allocateUTF8(summerName); - if (summerOffset < winterOffset) { - LE_HEAP_STORE_I32((__get_tzname() >> 2) * 4, winterNamePtr); - LE_HEAP_STORE_I32((__get_tzname() + 4 >> 2) * 4, summerNamePtr); - } else { - LE_HEAP_STORE_I32((__get_tzname() >> 2) * 4, summerNamePtr); - LE_HEAP_STORE_I32((__get_tzname() + 4 >> 2) * 4, winterNamePtr); - } - } - function _timegm(tmPtr) { - _tzset(); - var time = Date.UTC( - LE_HEAP_LOAD_I32((tmPtr + 20 >> 2) * 4) + 1900, - LE_HEAP_LOAD_I32((tmPtr + 16 >> 2) * 4), - LE_HEAP_LOAD_I32((tmPtr + 12 >> 2) * 4), - LE_HEAP_LOAD_I32((tmPtr + 8 >> 2) * 4), - LE_HEAP_LOAD_I32((tmPtr + 4 >> 2) * 4), - LE_HEAP_LOAD_I32((tmPtr >> 2) * 4), - 0 - ); - var date = new Date(time); - LE_HEAP_STORE_I32((tmPtr + 24 >> 2) * 4, date.getUTCDay()); - var start = Date.UTC(date.getUTCFullYear(), 0, 1, 0, 0, 0, 0); - var yday = (date.getTime() - start) / (1e3 * 60 * 60 * 24) | 0; - LE_HEAP_STORE_I32((tmPtr + 28 >> 2) * 4, yday); - return date.getTime() / 1e3 | 0; - } - function intArrayFromBase64(s) { - { - var buf; - try { - buf = Buffer.from(s, "base64"); - } catch (_) { - buf = new Buffer(s, "base64"); - } - return new Uint8Array( - buf["buffer"], - buf["byteOffset"], - buf["byteLength"] - ); - } - } - function tryParseAsDataURI(filename) { - if (!isDataURI(filename)) { - return; - } - return intArrayFromBase64(filename.slice(dataURIPrefix.length)); - } - var asmLibraryArg = { - e: ___gmtime_r, - c: _emscripten_memcpy_big, - d: _emscripten_resize_heap, - a: _setTempRet0, - b: _time, - f: _timegm - }; - var asm = createWasm(); - Module["___wasm_call_ctors"] = asm["h"]; - Module["_zip_ext_count_symlinks"] = asm["i"]; - Module["_zip_file_get_external_attributes"] = asm["j"]; - Module["_zipstruct_statS"] = asm["k"]; - Module["_zipstruct_stat_size"] = asm["l"]; - Module["_zipstruct_stat_mtime"] = asm["m"]; - Module["_zipstruct_stat_crc"] = asm["n"]; - Module["_zipstruct_errorS"] = asm["o"]; - Module["_zipstruct_error_code_zip"] = asm["p"]; - Module["_zipstruct_stat_comp_size"] = asm["q"]; - Module["_zipstruct_stat_comp_method"] = asm["r"]; - Module["_zip_close"] = asm["s"]; - Module["_zip_delete"] = asm["t"]; - Module["_zip_dir_add"] = asm["u"]; - Module["_zip_discard"] = asm["v"]; - Module["_zip_error_init_with_code"] = asm["w"]; - Module["_zip_get_error"] = asm["x"]; - Module["_zip_file_get_error"] = asm["y"]; - Module["_zip_error_strerror"] = asm["z"]; - Module["_zip_fclose"] = asm["A"]; - Module["_zip_file_add"] = asm["B"]; - Module["_free"] = asm["C"]; - var _malloc = Module["_malloc"] = asm["D"]; - Module["_zip_source_error"] = asm["E"]; - Module["_zip_source_seek"] = asm["F"]; - Module["_zip_file_set_external_attributes"] = asm["G"]; - Module["_zip_file_set_mtime"] = asm["H"]; - Module["_zip_fopen_index"] = asm["I"]; - Module["_zip_fread"] = asm["J"]; - Module["_zip_get_name"] = asm["K"]; - Module["_zip_get_num_entries"] = asm["L"]; - Module["_zip_source_read"] = asm["M"]; - Module["_zip_name_locate"] = asm["N"]; - Module["_zip_open_from_source"] = asm["O"]; - Module["_zip_set_file_compression"] = asm["P"]; - Module["_zip_source_buffer"] = asm["Q"]; - Module["_zip_source_buffer_create"] = asm["R"]; - Module["_zip_source_close"] = asm["S"]; - Module["_zip_source_free"] = asm["T"]; - Module["_zip_source_keep"] = asm["U"]; - Module["_zip_source_open"] = asm["V"]; - Module["_zip_source_tell"] = asm["X"]; - Module["_zip_stat_index"] = asm["Y"]; - var __get_tzname = Module["__get_tzname"] = asm["Z"]; - var __get_daylight = Module["__get_daylight"] = asm["_"]; - var __get_timezone = Module["__get_timezone"] = asm["$"]; - var stackSave = Module["stackSave"] = asm["aa"]; - var stackRestore = Module["stackRestore"] = asm["ba"]; - var stackAlloc = Module["stackAlloc"] = asm["ca"]; - Module["cwrap"] = cwrap; - Module["getValue"] = getValue; - var calledRun; - dependenciesFulfilled = function runCaller() { - if (!calledRun) - run(); - if (!calledRun) - dependenciesFulfilled = runCaller; - }; - function run(args) { - if (runDependencies > 0) { - return; - } - preRun(); - if (runDependencies > 0) { - return; - } - function doRun() { - if (calledRun) - return; - calledRun = true; - Module["calledRun"] = true; - if (ABORT) - return; - initRuntime(); - readyPromiseResolve(Module); - if (Module["onRuntimeInitialized"]) - Module["onRuntimeInitialized"](); - postRun(); - } - if (Module["setStatus"]) { - Module["setStatus"]("Running..."); - setTimeout(function() { - setTimeout(function() { - Module["setStatus"](""); - }, 1); - doRun(); - }, 1); - } else { - doRun(); - } - } - Module["run"] = run; - if (Module["preInit"]) { - if (typeof Module["preInit"] == "function") - Module["preInit"] = [Module["preInit"]]; - while (Module["preInit"].length > 0) { - Module["preInit"].pop()(); - } - } - run(); - return createModule2; - }; -}(); -module.exports = createModule; -}(libzipSync)); - -const createModule = libzipSync.exports; - -const number64 = [ - `number`, - `number` -]; -var Errors = /* @__PURE__ */ ((Errors2) => { - Errors2[Errors2["ZIP_ER_OK"] = 0] = "ZIP_ER_OK"; - Errors2[Errors2["ZIP_ER_MULTIDISK"] = 1] = "ZIP_ER_MULTIDISK"; - Errors2[Errors2["ZIP_ER_RENAME"] = 2] = "ZIP_ER_RENAME"; - Errors2[Errors2["ZIP_ER_CLOSE"] = 3] = "ZIP_ER_CLOSE"; - Errors2[Errors2["ZIP_ER_SEEK"] = 4] = "ZIP_ER_SEEK"; - Errors2[Errors2["ZIP_ER_READ"] = 5] = "ZIP_ER_READ"; - Errors2[Errors2["ZIP_ER_WRITE"] = 6] = "ZIP_ER_WRITE"; - Errors2[Errors2["ZIP_ER_CRC"] = 7] = "ZIP_ER_CRC"; - Errors2[Errors2["ZIP_ER_ZIPCLOSED"] = 8] = "ZIP_ER_ZIPCLOSED"; - Errors2[Errors2["ZIP_ER_NOENT"] = 9] = "ZIP_ER_NOENT"; - Errors2[Errors2["ZIP_ER_EXISTS"] = 10] = "ZIP_ER_EXISTS"; - Errors2[Errors2["ZIP_ER_OPEN"] = 11] = "ZIP_ER_OPEN"; - Errors2[Errors2["ZIP_ER_TMPOPEN"] = 12] = "ZIP_ER_TMPOPEN"; - Errors2[Errors2["ZIP_ER_ZLIB"] = 13] = "ZIP_ER_ZLIB"; - Errors2[Errors2["ZIP_ER_MEMORY"] = 14] = "ZIP_ER_MEMORY"; - Errors2[Errors2["ZIP_ER_CHANGED"] = 15] = "ZIP_ER_CHANGED"; - Errors2[Errors2["ZIP_ER_COMPNOTSUPP"] = 16] = "ZIP_ER_COMPNOTSUPP"; - Errors2[Errors2["ZIP_ER_EOF"] = 17] = "ZIP_ER_EOF"; - Errors2[Errors2["ZIP_ER_INVAL"] = 18] = "ZIP_ER_INVAL"; - Errors2[Errors2["ZIP_ER_NOZIP"] = 19] = "ZIP_ER_NOZIP"; - Errors2[Errors2["ZIP_ER_INTERNAL"] = 20] = "ZIP_ER_INTERNAL"; - Errors2[Errors2["ZIP_ER_INCONS"] = 21] = "ZIP_ER_INCONS"; - Errors2[Errors2["ZIP_ER_REMOVE"] = 22] = "ZIP_ER_REMOVE"; - Errors2[Errors2["ZIP_ER_DELETED"] = 23] = "ZIP_ER_DELETED"; - Errors2[Errors2["ZIP_ER_ENCRNOTSUPP"] = 24] = "ZIP_ER_ENCRNOTSUPP"; - Errors2[Errors2["ZIP_ER_RDONLY"] = 25] = "ZIP_ER_RDONLY"; - Errors2[Errors2["ZIP_ER_NOPASSWD"] = 26] = "ZIP_ER_NOPASSWD"; - Errors2[Errors2["ZIP_ER_WRONGPASSWD"] = 27] = "ZIP_ER_WRONGPASSWD"; - Errors2[Errors2["ZIP_ER_OPNOTSUPP"] = 28] = "ZIP_ER_OPNOTSUPP"; - Errors2[Errors2["ZIP_ER_INUSE"] = 29] = "ZIP_ER_INUSE"; - Errors2[Errors2["ZIP_ER_TELL"] = 30] = "ZIP_ER_TELL"; - Errors2[Errors2["ZIP_ER_COMPRESSED_DATA"] = 31] = "ZIP_ER_COMPRESSED_DATA"; - return Errors2; -})(Errors || {}); -const makeInterface = (emZip) => ({ - get HEAPU8() { - return emZip.HEAPU8; - }, - errors: Errors, - SEEK_SET: 0, - SEEK_CUR: 1, - SEEK_END: 2, - ZIP_CHECKCONS: 4, - ZIP_EXCL: 2, - ZIP_RDONLY: 16, - ZIP_FL_OVERWRITE: 8192, - ZIP_FL_COMPRESSED: 4, - ZIP_OPSYS_DOS: 0, - ZIP_OPSYS_AMIGA: 1, - ZIP_OPSYS_OPENVMS: 2, - ZIP_OPSYS_UNIX: 3, - ZIP_OPSYS_VM_CMS: 4, - ZIP_OPSYS_ATARI_ST: 5, - ZIP_OPSYS_OS_2: 6, - ZIP_OPSYS_MACINTOSH: 7, - ZIP_OPSYS_Z_SYSTEM: 8, - ZIP_OPSYS_CPM: 9, - ZIP_OPSYS_WINDOWS_NTFS: 10, - ZIP_OPSYS_MVS: 11, - ZIP_OPSYS_VSE: 12, - ZIP_OPSYS_ACORN_RISC: 13, - ZIP_OPSYS_VFAT: 14, - ZIP_OPSYS_ALTERNATE_MVS: 15, - ZIP_OPSYS_BEOS: 16, - ZIP_OPSYS_TANDEM: 17, - ZIP_OPSYS_OS_400: 18, - ZIP_OPSYS_OS_X: 19, - ZIP_CM_DEFAULT: -1, - ZIP_CM_STORE: 0, - ZIP_CM_DEFLATE: 8, - uint08S: emZip._malloc(1), - uint32S: emZip._malloc(4), - malloc: emZip._malloc, - free: emZip._free, - getValue: emZip.getValue, - openFromSource: emZip.cwrap(`zip_open_from_source`, `number`, [`number`, `number`, `number`]), - close: emZip.cwrap(`zip_close`, `number`, [`number`]), - discard: emZip.cwrap(`zip_discard`, null, [`number`]), - getError: emZip.cwrap(`zip_get_error`, `number`, [`number`]), - getName: emZip.cwrap(`zip_get_name`, `string`, [`number`, `number`, `number`]), - getNumEntries: emZip.cwrap(`zip_get_num_entries`, `number`, [`number`, `number`]), - delete: emZip.cwrap(`zip_delete`, `number`, [`number`, `number`]), - statIndex: emZip.cwrap(`zip_stat_index`, `number`, [`number`, ...number64, `number`, `number`]), - fopenIndex: emZip.cwrap(`zip_fopen_index`, `number`, [`number`, ...number64, `number`]), - fread: emZip.cwrap(`zip_fread`, `number`, [`number`, `number`, `number`, `number`]), - fclose: emZip.cwrap(`zip_fclose`, `number`, [`number`]), - dir: { - add: emZip.cwrap(`zip_dir_add`, `number`, [`number`, `string`]) - }, - file: { - add: emZip.cwrap(`zip_file_add`, `number`, [`number`, `string`, `number`, `number`]), - getError: emZip.cwrap(`zip_file_get_error`, `number`, [`number`]), - getExternalAttributes: emZip.cwrap(`zip_file_get_external_attributes`, `number`, [`number`, ...number64, `number`, `number`, `number`]), - setExternalAttributes: emZip.cwrap(`zip_file_set_external_attributes`, `number`, [`number`, ...number64, `number`, `number`, `number`]), - setMtime: emZip.cwrap(`zip_file_set_mtime`, `number`, [`number`, ...number64, `number`, `number`]), - setCompression: emZip.cwrap(`zip_set_file_compression`, `number`, [`number`, ...number64, `number`, `number`]) - }, - ext: { - countSymlinks: emZip.cwrap(`zip_ext_count_symlinks`, `number`, [`number`]) - }, - error: { - initWithCode: emZip.cwrap(`zip_error_init_with_code`, null, [`number`, `number`]), - strerror: emZip.cwrap(`zip_error_strerror`, `string`, [`number`]) - }, - name: { - locate: emZip.cwrap(`zip_name_locate`, `number`, [`number`, `string`, `number`]) - }, - source: { - fromUnattachedBuffer: emZip.cwrap(`zip_source_buffer_create`, `number`, [`number`, ...number64, `number`, `number`]), - fromBuffer: emZip.cwrap(`zip_source_buffer`, `number`, [`number`, `number`, ...number64, `number`]), - free: emZip.cwrap(`zip_source_free`, null, [`number`]), - keep: emZip.cwrap(`zip_source_keep`, null, [`number`]), - open: emZip.cwrap(`zip_source_open`, `number`, [`number`]), - close: emZip.cwrap(`zip_source_close`, `number`, [`number`]), - seek: emZip.cwrap(`zip_source_seek`, `number`, [`number`, ...number64, `number`]), - tell: emZip.cwrap(`zip_source_tell`, `number`, [`number`]), - read: emZip.cwrap(`zip_source_read`, `number`, [`number`, `number`, `number`]), - error: emZip.cwrap(`zip_source_error`, `number`, [`number`]) - }, - struct: { - statS: emZip.cwrap(`zipstruct_statS`, `number`, []), - statSize: emZip.cwrap(`zipstruct_stat_size`, `number`, [`number`]), - statCompSize: emZip.cwrap(`zipstruct_stat_comp_size`, `number`, [`number`]), - statCompMethod: emZip.cwrap(`zipstruct_stat_comp_method`, `number`, [`number`]), - statMtime: emZip.cwrap(`zipstruct_stat_mtime`, `number`, [`number`]), - statCrc: emZip.cwrap(`zipstruct_stat_crc`, `number`, [`number`]), - errorS: emZip.cwrap(`zipstruct_errorS`, `number`, []), - errorCodeZip: emZip.cwrap(`zipstruct_error_code_zip`, `number`, [`number`]) - } -}); - -function getArchivePart(path, extension) { - let idx = path.indexOf(extension); - if (idx <= 0) - return null; - let nextCharIdx = idx; - while (idx >= 0) { - nextCharIdx = idx + extension.length; - if (path[nextCharIdx] === ppath.sep) - break; - if (path[idx - 1] === ppath.sep) - return null; - idx = path.indexOf(extension, nextCharIdx); - } - if (path.length > nextCharIdx && path[nextCharIdx] !== ppath.sep) - return null; - return path.slice(0, nextCharIdx); -} -class ZipOpenFS extends MountFS { - static async openPromise(fn, opts) { - const zipOpenFs = new ZipOpenFS(opts); - try { - return await fn(zipOpenFs); - } finally { - zipOpenFs.saveAndClose(); - } - } - constructor(opts = {}) { - const fileExtensions = opts.fileExtensions; - const readOnlyArchives = opts.readOnlyArchives; - const getMountPoint = typeof fileExtensions === `undefined` ? (path) => getArchivePart(path, `.zip`) : (path) => { - for (const extension of fileExtensions) { - const result = getArchivePart(path, extension); - if (result) { - return result; - } - } - return null; - }; - const factorySync = (baseFs, p) => { - return new ZipFS(p, { - baseFs, - readOnly: readOnlyArchives, - stats: baseFs.statSync(p) - }); - }; - const factoryPromise = async (baseFs, p) => { - const zipOptions = { - baseFs, - readOnly: readOnlyArchives, - stats: await baseFs.statPromise(p) - }; - return () => { - return new ZipFS(p, zipOptions); - }; - }; - super({ - ...opts, - factorySync, - factoryPromise, - getMountPoint - }); - } -} - -const DEFAULT_COMPRESSION_LEVEL = `mixed`; -function toUnixTimestamp(time) { - if (typeof time === `string` && String(+time) === time) - return +time; - if (typeof time === `number` && Number.isFinite(time)) { - if (time < 0) { - return Date.now() / 1e3; - } else { - return time; - } - } - if (nodeUtils.types.isDate(time)) - return time.getTime() / 1e3; - throw new Error(`Invalid time`); -} -function makeEmptyArchive() { - return Buffer.from([ - 80, - 75, - 5, - 6, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0 - ]); -} -class LibzipError extends Error { - constructor(message, code) { - super(message); - this.name = `Libzip Error`; - this.code = code; - } -} -class ZipFS extends BasePortableFakeFS { - constructor(source, opts = {}) { - super(); - this.listings = /* @__PURE__ */ new Map(); - this.entries = /* @__PURE__ */ new Map(); - this.fileSources = /* @__PURE__ */ new Map(); - this.fds = /* @__PURE__ */ new Map(); - this.nextFd = 0; - this.ready = false; - this.readOnly = false; - const pathOptions = opts; - this.level = typeof pathOptions.level !== `undefined` ? pathOptions.level : DEFAULT_COMPRESSION_LEVEL; - source ??= makeEmptyArchive(); - if (typeof source === `string`) { - const { baseFs = new NodeFS() } = pathOptions; - this.baseFs = baseFs; - this.path = source; - } else { - this.path = null; - this.baseFs = null; - } - if (opts.stats) { - this.stats = opts.stats; - } else { - if (typeof source === `string`) { - try { - this.stats = this.baseFs.statSync(source); - } catch (error) { - if (error.code === `ENOENT` && pathOptions.create) { - this.stats = makeDefaultStats(); - } else { - throw error; - } - } - } else { - this.stats = makeDefaultStats(); - } - } - this.libzip = getInstance(); - const errPtr = this.libzip.malloc(4); - try { - let flags = 0; - if (opts.readOnly) { - flags |= this.libzip.ZIP_RDONLY; - this.readOnly = true; - } - if (typeof source === `string`) - source = pathOptions.create ? makeEmptyArchive() : this.baseFs.readFileSync(source); - const lzSource = this.allocateUnattachedSource(source); - try { - this.zip = this.libzip.openFromSource(lzSource, flags, errPtr); - this.lzSource = lzSource; - } catch (error) { - this.libzip.source.free(lzSource); - throw error; - } - if (this.zip === 0) { - const error = this.libzip.struct.errorS(); - this.libzip.error.initWithCode(error, this.libzip.getValue(errPtr, `i32`)); - throw this.makeLibzipError(error); - } - } finally { - this.libzip.free(errPtr); - } - this.listings.set(PortablePath.root, /* @__PURE__ */ new Set()); - const entryCount = this.libzip.getNumEntries(this.zip, 0); - for (let t = 0; t < entryCount; ++t) { - const raw = this.libzip.getName(this.zip, t, 0); - if (ppath.isAbsolute(raw)) - continue; - const p = ppath.resolve(PortablePath.root, raw); - this.registerEntry(p, t); - if (raw.endsWith(`/`)) { - this.registerListing(p); - } - } - this.symlinkCount = this.libzip.ext.countSymlinks(this.zip); - if (this.symlinkCount === -1) - throw this.makeLibzipError(this.libzip.getError(this.zip)); - this.ready = true; - } - makeLibzipError(error) { - const errorCode = this.libzip.struct.errorCodeZip(error); - const strerror = this.libzip.error.strerror(error); - const libzipError = new LibzipError(strerror, this.libzip.errors[errorCode]); - if (errorCode === this.libzip.errors.ZIP_ER_CHANGED) - throw new Error(`Assertion failed: Unexpected libzip error: ${libzipError.message}`); - return libzipError; - } - getExtractHint(hints) { - for (const fileName of this.entries.keys()) { - const ext = this.pathUtils.extname(fileName); - if (hints.relevantExtensions.has(ext)) { - return true; - } - } - return false; - } - getAllFiles() { - return Array.from(this.entries.keys()); - } - getRealPath() { - if (!this.path) - throw new Error(`ZipFS don't have real paths when loaded from a buffer`); - return this.path; - } - prepareClose() { - if (!this.ready) - throw EBUSY(`archive closed, close`); - unwatchAllFiles(this); - } - getBufferAndClose() { - this.prepareClose(); - if (this.entries.size === 0) { - this.discardAndClose(); - return makeEmptyArchive(); - } - try { - this.libzip.source.keep(this.lzSource); - if (this.libzip.close(this.zip) === -1) - throw this.makeLibzipError(this.libzip.getError(this.zip)); - if (this.libzip.source.open(this.lzSource) === -1) - throw this.makeLibzipError(this.libzip.source.error(this.lzSource)); - if (this.libzip.source.seek(this.lzSource, 0, 0, this.libzip.SEEK_END) === -1) - throw this.makeLibzipError(this.libzip.source.error(this.lzSource)); - const size = this.libzip.source.tell(this.lzSource); - if (size === -1) - throw this.makeLibzipError(this.libzip.source.error(this.lzSource)); - if (this.libzip.source.seek(this.lzSource, 0, 0, this.libzip.SEEK_SET) === -1) - throw this.makeLibzipError(this.libzip.source.error(this.lzSource)); - const buffer = this.libzip.malloc(size); - if (!buffer) - throw new Error(`Couldn't allocate enough memory`); - try { - const rc = this.libzip.source.read(this.lzSource, buffer, size); - if (rc === -1) - throw this.makeLibzipError(this.libzip.source.error(this.lzSource)); - else if (rc < size) - throw new Error(`Incomplete read`); - else if (rc > size) - throw new Error(`Overread`); - let result = Buffer.from(this.libzip.HEAPU8.subarray(buffer, buffer + size)); - if (process.env.YARN_IS_TEST_ENV && process.env.YARN_ZIP_DATA_EPILOGUE) - result = Buffer.concat([result, Buffer.from(process.env.YARN_ZIP_DATA_EPILOGUE)]); - return result; - } finally { - this.libzip.free(buffer); - } - } finally { - this.libzip.source.close(this.lzSource); - this.libzip.source.free(this.lzSource); - this.ready = false; - } - } - discardAndClose() { - this.prepareClose(); - this.libzip.discard(this.zip); - this.ready = false; - } - saveAndClose() { - if (!this.path || !this.baseFs) - throw new Error(`ZipFS cannot be saved and must be discarded when loaded from a buffer`); - if (this.readOnly) { - this.discardAndClose(); - return; - } - const newMode = this.baseFs.existsSync(this.path) || this.stats.mode === DEFAULT_MODE ? void 0 : this.stats.mode; - this.baseFs.writeFileSync(this.path, this.getBufferAndClose(), { mode: newMode }); - this.ready = false; - } - resolve(p) { - return ppath.resolve(PortablePath.root, p); - } - async openPromise(p, flags, mode) { - return this.openSync(p, flags, mode); - } - openSync(p, flags, mode) { - const fd = this.nextFd++; - this.fds.set(fd, { cursor: 0, p }); - return fd; - } - hasOpenFileHandles() { - return !!this.fds.size; - } - async opendirPromise(p, opts) { - return this.opendirSync(p, opts); - } - opendirSync(p, opts = {}) { - const resolvedP = this.resolveFilename(`opendir '${p}'`, p); - if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) - throw ENOENT(`opendir '${p}'`); - const directoryListing = this.listings.get(resolvedP); - if (!directoryListing) - throw ENOTDIR(`opendir '${p}'`); - const entries = [...directoryListing]; - const fd = this.openSync(resolvedP, `r`); - const onClose = () => { - this.closeSync(fd); - }; - return opendir(this, resolvedP, entries, { onClose }); - } - async readPromise(fd, buffer, offset, length, position) { - return this.readSync(fd, buffer, offset, length, position); - } - readSync(fd, buffer, offset = 0, length = buffer.byteLength, position = -1) { - const entry = this.fds.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`read`); - const realPosition = position === -1 || position === null ? entry.cursor : position; - const source = this.readFileSync(entry.p); - source.copy(buffer, offset, realPosition, realPosition + length); - const bytesRead = Math.max(0, Math.min(source.length - realPosition, length)); - if (position === -1 || position === null) - entry.cursor += bytesRead; - return bytesRead; - } - async writePromise(fd, buffer, offset, length, position) { - if (typeof buffer === `string`) { - return this.writeSync(fd, buffer, position); - } else { - return this.writeSync(fd, buffer, offset, length, position); - } - } - writeSync(fd, buffer, offset, length, position) { - const entry = this.fds.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`read`); - throw new Error(`Unimplemented`); - } - async closePromise(fd) { - return this.closeSync(fd); - } - closeSync(fd) { - const entry = this.fds.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`read`); - this.fds.delete(fd); - } - createReadStream(p, { encoding } = {}) { - if (p === null) - throw new Error(`Unimplemented`); - const fd = this.openSync(p, `r`); - const stream$1 = Object.assign( - new stream.PassThrough({ - emitClose: true, - autoDestroy: true, - destroy: (error, callback) => { - clearImmediate(immediate); - this.closeSync(fd); - callback(error); - } - }), - { - close() { - stream$1.destroy(); - }, - bytesRead: 0, - path: p, - pending: false - } - ); - const immediate = setImmediate(async () => { - try { - const data = await this.readFilePromise(p, encoding); - stream$1.bytesRead = data.length; - stream$1.end(data); - } catch (error) { - stream$1.destroy(error); - } - }); - return stream$1; - } - createWriteStream(p, { encoding } = {}) { - if (this.readOnly) - throw EROFS(`open '${p}'`); - if (p === null) - throw new Error(`Unimplemented`); - const chunks = []; - const fd = this.openSync(p, `w`); - const stream$1 = Object.assign( - new stream.PassThrough({ - autoDestroy: true, - emitClose: true, - destroy: (error, callback) => { - try { - if (error) { - callback(error); - } else { - this.writeFileSync(p, Buffer.concat(chunks), encoding); - callback(null); - } - } catch (err) { - callback(err); - } finally { - this.closeSync(fd); - } - } - }), - { - close() { - stream$1.destroy(); - }, - bytesWritten: 0, - path: p, - pending: false - } - ); - stream$1.on(`data`, (chunk) => { - const chunkBuffer = Buffer.from(chunk); - stream$1.bytesWritten += chunkBuffer.length; - chunks.push(chunkBuffer); - }); - return stream$1; - } - async realpathPromise(p) { - return this.realpathSync(p); - } - realpathSync(p) { - const resolvedP = this.resolveFilename(`lstat '${p}'`, p); - if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) - throw ENOENT(`lstat '${p}'`); - return resolvedP; - } - async existsPromise(p) { - return this.existsSync(p); - } - existsSync(p) { - if (!this.ready) - throw EBUSY(`archive closed, existsSync '${p}'`); - if (this.symlinkCount === 0) { - const resolvedP2 = ppath.resolve(PortablePath.root, p); - return this.entries.has(resolvedP2) || this.listings.has(resolvedP2); - } - let resolvedP; - try { - resolvedP = this.resolveFilename(`stat '${p}'`, p, void 0, false); - } catch (error) { - return false; - } - if (resolvedP === void 0) - return false; - return this.entries.has(resolvedP) || this.listings.has(resolvedP); - } - async accessPromise(p, mode) { - return this.accessSync(p, mode); - } - accessSync(p, mode = fs.constants.F_OK) { - const resolvedP = this.resolveFilename(`access '${p}'`, p); - if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) - throw ENOENT(`access '${p}'`); - if (this.readOnly && mode & fs.constants.W_OK) { - throw EROFS(`access '${p}'`); - } - } - async statPromise(p, opts = { bigint: false }) { - if (opts.bigint) - return this.statSync(p, { bigint: true }); - return this.statSync(p); - } - statSync(p, opts = { bigint: false, throwIfNoEntry: true }) { - const resolvedP = this.resolveFilename(`stat '${p}'`, p, void 0, opts.throwIfNoEntry); - if (resolvedP === void 0) - return void 0; - if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) { - if (opts.throwIfNoEntry === false) - return void 0; - throw ENOENT(`stat '${p}'`); - } - if (p[p.length - 1] === `/` && !this.listings.has(resolvedP)) - throw ENOTDIR(`stat '${p}'`); - return this.statImpl(`stat '${p}'`, resolvedP, opts); - } - async fstatPromise(fd, opts) { - return this.fstatSync(fd, opts); - } - fstatSync(fd, opts) { - const entry = this.fds.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`fstatSync`); - const { p } = entry; - const resolvedP = this.resolveFilename(`stat '${p}'`, p); - if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) - throw ENOENT(`stat '${p}'`); - if (p[p.length - 1] === `/` && !this.listings.has(resolvedP)) - throw ENOTDIR(`stat '${p}'`); - return this.statImpl(`fstat '${p}'`, resolvedP, opts); - } - async lstatPromise(p, opts = { bigint: false }) { - if (opts.bigint) - return this.lstatSync(p, { bigint: true }); - return this.lstatSync(p); - } - lstatSync(p, opts = { bigint: false, throwIfNoEntry: true }) { - const resolvedP = this.resolveFilename(`lstat '${p}'`, p, false, opts.throwIfNoEntry); - if (resolvedP === void 0) - return void 0; - if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) { - if (opts.throwIfNoEntry === false) - return void 0; - throw ENOENT(`lstat '${p}'`); - } - if (p[p.length - 1] === `/` && !this.listings.has(resolvedP)) - throw ENOTDIR(`lstat '${p}'`); - return this.statImpl(`lstat '${p}'`, resolvedP, opts); - } - statImpl(reason, p, opts = {}) { - const entry = this.entries.get(p); - if (typeof entry !== `undefined`) { - const stat = this.libzip.struct.statS(); - const rc = this.libzip.statIndex(this.zip, entry, 0, 0, stat); - if (rc === -1) - throw this.makeLibzipError(this.libzip.getError(this.zip)); - const uid = this.stats.uid; - const gid = this.stats.gid; - const size = this.libzip.struct.statSize(stat) >>> 0; - const blksize = 512; - const blocks = Math.ceil(size / blksize); - const mtimeMs = (this.libzip.struct.statMtime(stat) >>> 0) * 1e3; - const atimeMs = mtimeMs; - const birthtimeMs = mtimeMs; - const ctimeMs = mtimeMs; - const atime = new Date(atimeMs); - const birthtime = new Date(birthtimeMs); - const ctime = new Date(ctimeMs); - const mtime = new Date(mtimeMs); - const type = this.listings.has(p) ? fs.constants.S_IFDIR : this.isSymbolicLink(entry) ? fs.constants.S_IFLNK : fs.constants.S_IFREG; - const defaultMode = type === fs.constants.S_IFDIR ? 493 : 420; - const mode = type | this.getUnixMode(entry, defaultMode) & 511; - const crc = this.libzip.struct.statCrc(stat); - const statInstance = Object.assign(new StatEntry(), { uid, gid, size, blksize, blocks, atime, birthtime, ctime, mtime, atimeMs, birthtimeMs, ctimeMs, mtimeMs, mode, crc }); - return opts.bigint === true ? convertToBigIntStats(statInstance) : statInstance; - } - if (this.listings.has(p)) { - const uid = this.stats.uid; - const gid = this.stats.gid; - const size = 0; - const blksize = 512; - const blocks = 0; - const atimeMs = this.stats.mtimeMs; - const birthtimeMs = this.stats.mtimeMs; - const ctimeMs = this.stats.mtimeMs; - const mtimeMs = this.stats.mtimeMs; - const atime = new Date(atimeMs); - const birthtime = new Date(birthtimeMs); - const ctime = new Date(ctimeMs); - const mtime = new Date(mtimeMs); - const mode = fs.constants.S_IFDIR | 493; - const crc = 0; - const statInstance = Object.assign(new StatEntry(), { uid, gid, size, blksize, blocks, atime, birthtime, ctime, mtime, atimeMs, birthtimeMs, ctimeMs, mtimeMs, mode, crc }); - return opts.bigint === true ? convertToBigIntStats(statInstance) : statInstance; - } - throw new Error(`Unreachable`); - } - getUnixMode(index, defaultMode) { - const rc = this.libzip.file.getExternalAttributes(this.zip, index, 0, 0, this.libzip.uint08S, this.libzip.uint32S); - if (rc === -1) - throw this.makeLibzipError(this.libzip.getError(this.zip)); - const opsys = this.libzip.getValue(this.libzip.uint08S, `i8`) >>> 0; - if (opsys !== this.libzip.ZIP_OPSYS_UNIX) - return defaultMode; - return this.libzip.getValue(this.libzip.uint32S, `i32`) >>> 16; - } - registerListing(p) { - const existingListing = this.listings.get(p); - if (existingListing) - return existingListing; - const parentListing = this.registerListing(ppath.dirname(p)); - parentListing.add(ppath.basename(p)); - const newListing = /* @__PURE__ */ new Set(); - this.listings.set(p, newListing); - return newListing; - } - registerEntry(p, index) { - const parentListing = this.registerListing(ppath.dirname(p)); - parentListing.add(ppath.basename(p)); - this.entries.set(p, index); - } - unregisterListing(p) { - this.listings.delete(p); - const parentListing = this.listings.get(ppath.dirname(p)); - parentListing?.delete(ppath.basename(p)); - } - unregisterEntry(p) { - this.unregisterListing(p); - const entry = this.entries.get(p); - this.entries.delete(p); - if (typeof entry === `undefined`) - return; - this.fileSources.delete(entry); - if (this.isSymbolicLink(entry)) { - this.symlinkCount--; - } - } - deleteEntry(p, index) { - this.unregisterEntry(p); - const rc = this.libzip.delete(this.zip, index); - if (rc === -1) { - throw this.makeLibzipError(this.libzip.getError(this.zip)); - } - } - resolveFilename(reason, p, resolveLastComponent = true, throwIfNoEntry = true) { - if (!this.ready) - throw EBUSY(`archive closed, ${reason}`); - let resolvedP = ppath.resolve(PortablePath.root, p); - if (resolvedP === `/`) - return PortablePath.root; - const fileIndex = this.entries.get(resolvedP); - if (resolveLastComponent && fileIndex !== void 0) { - if (this.symlinkCount !== 0 && this.isSymbolicLink(fileIndex)) { - const target = this.getFileSource(fileIndex).toString(); - return this.resolveFilename(reason, ppath.resolve(ppath.dirname(resolvedP), target), true, throwIfNoEntry); - } else { - return resolvedP; - } - } - while (true) { - const parentP = this.resolveFilename(reason, ppath.dirname(resolvedP), true, throwIfNoEntry); - if (parentP === void 0) - return parentP; - const isDir = this.listings.has(parentP); - const doesExist = this.entries.has(parentP); - if (!isDir && !doesExist) { - if (throwIfNoEntry === false) - return void 0; - throw ENOENT(reason); - } - if (!isDir) - throw ENOTDIR(reason); - resolvedP = ppath.resolve(parentP, ppath.basename(resolvedP)); - if (!resolveLastComponent || this.symlinkCount === 0) - break; - const index = this.libzip.name.locate(this.zip, resolvedP.slice(1), 0); - if (index === -1) - break; - if (this.isSymbolicLink(index)) { - const target = this.getFileSource(index).toString(); - resolvedP = ppath.resolve(ppath.dirname(resolvedP), target); - } else { - break; - } - } - return resolvedP; - } - allocateBuffer(content) { - if (!Buffer.isBuffer(content)) - content = Buffer.from(content); - const buffer = this.libzip.malloc(content.byteLength); - if (!buffer) - throw new Error(`Couldn't allocate enough memory`); - const heap = new Uint8Array(this.libzip.HEAPU8.buffer, buffer, content.byteLength); - heap.set(content); - return { buffer, byteLength: content.byteLength }; - } - allocateUnattachedSource(content) { - const error = this.libzip.struct.errorS(); - const { buffer, byteLength } = this.allocateBuffer(content); - const source = this.libzip.source.fromUnattachedBuffer(buffer, byteLength, 0, 1, error); - if (source === 0) { - this.libzip.free(error); - throw this.makeLibzipError(error); - } - return source; - } - allocateSource(content) { - const { buffer, byteLength } = this.allocateBuffer(content); - const source = this.libzip.source.fromBuffer(this.zip, buffer, byteLength, 0, 1); - if (source === 0) { - this.libzip.free(buffer); - throw this.makeLibzipError(this.libzip.getError(this.zip)); - } - return source; - } - setFileSource(p, content) { - const buffer = Buffer.isBuffer(content) ? content : Buffer.from(content); - const target = ppath.relative(PortablePath.root, p); - const lzSource = this.allocateSource(content); - try { - const newIndex = this.libzip.file.add(this.zip, target, lzSource, this.libzip.ZIP_FL_OVERWRITE); - if (newIndex === -1) - throw this.makeLibzipError(this.libzip.getError(this.zip)); - if (this.level !== `mixed`) { - const method = this.level === 0 ? this.libzip.ZIP_CM_STORE : this.libzip.ZIP_CM_DEFLATE; - const rc = this.libzip.file.setCompression(this.zip, newIndex, 0, method, this.level); - if (rc === -1) { - throw this.makeLibzipError(this.libzip.getError(this.zip)); - } - } - this.fileSources.set(newIndex, buffer); - return newIndex; - } catch (error) { - this.libzip.source.free(lzSource); - throw error; - } - } - isSymbolicLink(index) { - if (this.symlinkCount === 0) - return false; - const attrs = this.libzip.file.getExternalAttributes(this.zip, index, 0, 0, this.libzip.uint08S, this.libzip.uint32S); - if (attrs === -1) - throw this.makeLibzipError(this.libzip.getError(this.zip)); - const opsys = this.libzip.getValue(this.libzip.uint08S, `i8`) >>> 0; - if (opsys !== this.libzip.ZIP_OPSYS_UNIX) - return false; - const attributes = this.libzip.getValue(this.libzip.uint32S, `i32`) >>> 16; - return (attributes & fs.constants.S_IFMT) === fs.constants.S_IFLNK; - } - getFileSource(index, opts = { asyncDecompress: false }) { - const cachedFileSource = this.fileSources.get(index); - if (typeof cachedFileSource !== `undefined`) - return cachedFileSource; - const stat = this.libzip.struct.statS(); - const rc = this.libzip.statIndex(this.zip, index, 0, 0, stat); - if (rc === -1) - throw this.makeLibzipError(this.libzip.getError(this.zip)); - const size = this.libzip.struct.statCompSize(stat); - const compressionMethod = this.libzip.struct.statCompMethod(stat); - const buffer = this.libzip.malloc(size); - try { - const file = this.libzip.fopenIndex(this.zip, index, 0, this.libzip.ZIP_FL_COMPRESSED); - if (file === 0) - throw this.makeLibzipError(this.libzip.getError(this.zip)); - try { - const rc2 = this.libzip.fread(file, buffer, size, 0); - if (rc2 === -1) - throw this.makeLibzipError(this.libzip.file.getError(file)); - else if (rc2 < size) - throw new Error(`Incomplete read`); - else if (rc2 > size) - throw new Error(`Overread`); - const memory = this.libzip.HEAPU8.subarray(buffer, buffer + size); - const data = Buffer.from(memory); - if (compressionMethod === 0) { - this.fileSources.set(index, data); - return data; - } else if (opts.asyncDecompress) { - return new Promise((resolve, reject) => { - zlib__default.default.inflateRaw(data, (error, result) => { - if (error) { - reject(error); - } else { - this.fileSources.set(index, result); - resolve(result); - } - }); - }); - } else { - const decompressedData = zlib__default.default.inflateRawSync(data); - this.fileSources.set(index, decompressedData); - return decompressedData; - } - } finally { - this.libzip.fclose(file); - } - } finally { - this.libzip.free(buffer); - } - } - async fchmodPromise(fd, mask) { - return this.chmodPromise(this.fdToPath(fd, `fchmod`), mask); - } - fchmodSync(fd, mask) { - return this.chmodSync(this.fdToPath(fd, `fchmodSync`), mask); - } - async chmodPromise(p, mask) { - return this.chmodSync(p, mask); - } - chmodSync(p, mask) { - if (this.readOnly) - throw EROFS(`chmod '${p}'`); - mask &= 493; - const resolvedP = this.resolveFilename(`chmod '${p}'`, p, false); - const entry = this.entries.get(resolvedP); - if (typeof entry === `undefined`) - throw new Error(`Assertion failed: The entry should have been registered (${resolvedP})`); - const oldMod = this.getUnixMode(entry, fs.constants.S_IFREG | 0); - const newMod = oldMod & ~511 | mask; - const rc = this.libzip.file.setExternalAttributes(this.zip, entry, 0, 0, this.libzip.ZIP_OPSYS_UNIX, newMod << 16); - if (rc === -1) { - throw this.makeLibzipError(this.libzip.getError(this.zip)); - } - } - async fchownPromise(fd, uid, gid) { - return this.chownPromise(this.fdToPath(fd, `fchown`), uid, gid); - } - fchownSync(fd, uid, gid) { - return this.chownSync(this.fdToPath(fd, `fchownSync`), uid, gid); - } - async chownPromise(p, uid, gid) { - return this.chownSync(p, uid, gid); - } - chownSync(p, uid, gid) { - throw new Error(`Unimplemented`); - } - async renamePromise(oldP, newP) { - return this.renameSync(oldP, newP); - } - renameSync(oldP, newP) { - throw new Error(`Unimplemented`); - } - async copyFilePromise(sourceP, destP, flags) { - const { indexSource, indexDest, resolvedDestP } = this.prepareCopyFile(sourceP, destP, flags); - const source = await this.getFileSource(indexSource, { asyncDecompress: true }); - const newIndex = this.setFileSource(resolvedDestP, source); - if (newIndex !== indexDest) { - this.registerEntry(resolvedDestP, newIndex); - } - } - copyFileSync(sourceP, destP, flags = 0) { - const { indexSource, indexDest, resolvedDestP } = this.prepareCopyFile(sourceP, destP, flags); - const source = this.getFileSource(indexSource); - const newIndex = this.setFileSource(resolvedDestP, source); - if (newIndex !== indexDest) { - this.registerEntry(resolvedDestP, newIndex); - } - } - prepareCopyFile(sourceP, destP, flags = 0) { - if (this.readOnly) - throw EROFS(`copyfile '${sourceP} -> '${destP}'`); - if ((flags & fs.constants.COPYFILE_FICLONE_FORCE) !== 0) - throw ENOSYS(`unsupported clone operation`, `copyfile '${sourceP}' -> ${destP}'`); - const resolvedSourceP = this.resolveFilename(`copyfile '${sourceP} -> ${destP}'`, sourceP); - const indexSource = this.entries.get(resolvedSourceP); - if (typeof indexSource === `undefined`) - throw EINVAL(`copyfile '${sourceP}' -> '${destP}'`); - const resolvedDestP = this.resolveFilename(`copyfile '${sourceP}' -> ${destP}'`, destP); - const indexDest = this.entries.get(resolvedDestP); - if ((flags & (fs.constants.COPYFILE_EXCL | fs.constants.COPYFILE_FICLONE_FORCE)) !== 0 && typeof indexDest !== `undefined`) - throw EEXIST(`copyfile '${sourceP}' -> '${destP}'`); - return { - indexSource, - resolvedDestP, - indexDest - }; - } - async appendFilePromise(p, content, opts) { - if (this.readOnly) - throw EROFS(`open '${p}'`); - if (typeof opts === `undefined`) - opts = { flag: `a` }; - else if (typeof opts === `string`) - opts = { flag: `a`, encoding: opts }; - else if (typeof opts.flag === `undefined`) - opts = { flag: `a`, ...opts }; - return this.writeFilePromise(p, content, opts); - } - appendFileSync(p, content, opts = {}) { - if (this.readOnly) - throw EROFS(`open '${p}'`); - if (typeof opts === `undefined`) - opts = { flag: `a` }; - else if (typeof opts === `string`) - opts = { flag: `a`, encoding: opts }; - else if (typeof opts.flag === `undefined`) - opts = { flag: `a`, ...opts }; - return this.writeFileSync(p, content, opts); - } - fdToPath(fd, reason) { - const path = this.fds.get(fd)?.p; - if (typeof path === `undefined`) - throw EBADF(reason); - return path; - } - async writeFilePromise(p, content, opts) { - const { encoding, mode, index, resolvedP } = this.prepareWriteFile(p, opts); - if (index !== void 0 && typeof opts === `object` && opts.flag && opts.flag.includes(`a`)) - content = Buffer.concat([await this.getFileSource(index, { asyncDecompress: true }), Buffer.from(content)]); - if (encoding !== null) - content = content.toString(encoding); - const newIndex = this.setFileSource(resolvedP, content); - if (newIndex !== index) - this.registerEntry(resolvedP, newIndex); - if (mode !== null) { - await this.chmodPromise(resolvedP, mode); - } - } - writeFileSync(p, content, opts) { - const { encoding, mode, index, resolvedP } = this.prepareWriteFile(p, opts); - if (index !== void 0 && typeof opts === `object` && opts.flag && opts.flag.includes(`a`)) - content = Buffer.concat([this.getFileSource(index), Buffer.from(content)]); - if (encoding !== null) - content = content.toString(encoding); - const newIndex = this.setFileSource(resolvedP, content); - if (newIndex !== index) - this.registerEntry(resolvedP, newIndex); - if (mode !== null) { - this.chmodSync(resolvedP, mode); - } - } - prepareWriteFile(p, opts) { - if (typeof p === `number`) - p = this.fdToPath(p, `read`); - if (this.readOnly) - throw EROFS(`open '${p}'`); - const resolvedP = this.resolveFilename(`open '${p}'`, p); - if (this.listings.has(resolvedP)) - throw EISDIR(`open '${p}'`); - let encoding = null, mode = null; - if (typeof opts === `string`) { - encoding = opts; - } else if (typeof opts === `object`) { - ({ - encoding = null, - mode = null - } = opts); - } - const index = this.entries.get(resolvedP); - return { - encoding, - mode, - resolvedP, - index - }; - } - async unlinkPromise(p) { - return this.unlinkSync(p); - } - unlinkSync(p) { - if (this.readOnly) - throw EROFS(`unlink '${p}'`); - const resolvedP = this.resolveFilename(`unlink '${p}'`, p); - if (this.listings.has(resolvedP)) - throw EISDIR(`unlink '${p}'`); - const index = this.entries.get(resolvedP); - if (typeof index === `undefined`) - throw EINVAL(`unlink '${p}'`); - this.deleteEntry(resolvedP, index); - } - async utimesPromise(p, atime, mtime) { - return this.utimesSync(p, atime, mtime); - } - utimesSync(p, atime, mtime) { - if (this.readOnly) - throw EROFS(`utimes '${p}'`); - const resolvedP = this.resolveFilename(`utimes '${p}'`, p); - this.utimesImpl(resolvedP, mtime); - } - async lutimesPromise(p, atime, mtime) { - return this.lutimesSync(p, atime, mtime); - } - lutimesSync(p, atime, mtime) { - if (this.readOnly) - throw EROFS(`lutimes '${p}'`); - const resolvedP = this.resolveFilename(`utimes '${p}'`, p, false); - this.utimesImpl(resolvedP, mtime); - } - utimesImpl(resolvedP, mtime) { - if (this.listings.has(resolvedP)) { - if (!this.entries.has(resolvedP)) - this.hydrateDirectory(resolvedP); - } - const entry = this.entries.get(resolvedP); - if (entry === void 0) - throw new Error(`Unreachable`); - const rc = this.libzip.file.setMtime(this.zip, entry, 0, toUnixTimestamp(mtime), 0); - if (rc === -1) { - throw this.makeLibzipError(this.libzip.getError(this.zip)); - } - } - async mkdirPromise(p, opts) { - return this.mkdirSync(p, opts); - } - mkdirSync(p, { mode = 493, recursive = false } = {}) { - if (recursive) - return this.mkdirpSync(p, { chmod: mode }); - if (this.readOnly) - throw EROFS(`mkdir '${p}'`); - const resolvedP = this.resolveFilename(`mkdir '${p}'`, p); - if (this.entries.has(resolvedP) || this.listings.has(resolvedP)) - throw EEXIST(`mkdir '${p}'`); - this.hydrateDirectory(resolvedP); - this.chmodSync(resolvedP, mode); - return void 0; - } - async rmdirPromise(p, opts) { - return this.rmdirSync(p, opts); - } - rmdirSync(p, { recursive = false } = {}) { - if (this.readOnly) - throw EROFS(`rmdir '${p}'`); - if (recursive) { - this.removeSync(p); - return; - } - const resolvedP = this.resolveFilename(`rmdir '${p}'`, p); - const directoryListing = this.listings.get(resolvedP); - if (!directoryListing) - throw ENOTDIR(`rmdir '${p}'`); - if (directoryListing.size > 0) - throw ENOTEMPTY(`rmdir '${p}'`); - const index = this.entries.get(resolvedP); - if (typeof index === `undefined`) - throw EINVAL(`rmdir '${p}'`); - this.deleteEntry(p, index); - } - async rmPromise(p, opts) { - return this.rmSync(p, opts); - } - rmSync(p, { recursive = false } = {}) { - if (this.readOnly) - throw EROFS(`rm '${p}'`); - if (recursive) { - this.removeSync(p); - return; - } - const resolvedP = this.resolveFilename(`rm '${p}'`, p); - const directoryListing = this.listings.get(resolvedP); - if (!directoryListing) - throw ENOTDIR(`rm '${p}'`); - if (directoryListing.size > 0) - throw ENOTEMPTY(`rm '${p}'`); - const index = this.entries.get(resolvedP); - if (typeof index === `undefined`) - throw EINVAL(`rm '${p}'`); - this.deleteEntry(p, index); - } - hydrateDirectory(resolvedP) { - const index = this.libzip.dir.add(this.zip, ppath.relative(PortablePath.root, resolvedP)); - if (index === -1) - throw this.makeLibzipError(this.libzip.getError(this.zip)); - this.registerListing(resolvedP); - this.registerEntry(resolvedP, index); - return index; - } - async linkPromise(existingP, newP) { - return this.linkSync(existingP, newP); - } - linkSync(existingP, newP) { - throw EOPNOTSUPP(`link '${existingP}' -> '${newP}'`); - } - async symlinkPromise(target, p) { - return this.symlinkSync(target, p); - } - symlinkSync(target, p) { - if (this.readOnly) - throw EROFS(`symlink '${target}' -> '${p}'`); - const resolvedP = this.resolveFilename(`symlink '${target}' -> '${p}'`, p); - if (this.listings.has(resolvedP)) - throw EISDIR(`symlink '${target}' -> '${p}'`); - if (this.entries.has(resolvedP)) - throw EEXIST(`symlink '${target}' -> '${p}'`); - const index = this.setFileSource(resolvedP, target); - this.registerEntry(resolvedP, index); - const rc = this.libzip.file.setExternalAttributes(this.zip, index, 0, 0, this.libzip.ZIP_OPSYS_UNIX, (fs.constants.S_IFLNK | 511) << 16); - if (rc === -1) - throw this.makeLibzipError(this.libzip.getError(this.zip)); - this.symlinkCount += 1; - } - async readFilePromise(p, encoding) { - if (typeof encoding === `object`) - encoding = encoding ? encoding.encoding : void 0; - const data = await this.readFileBuffer(p, { asyncDecompress: true }); - return encoding ? data.toString(encoding) : data; - } - readFileSync(p, encoding) { - if (typeof encoding === `object`) - encoding = encoding ? encoding.encoding : void 0; - const data = this.readFileBuffer(p); - return encoding ? data.toString(encoding) : data; - } - readFileBuffer(p, opts = { asyncDecompress: false }) { - if (typeof p === `number`) - p = this.fdToPath(p, `read`); - const resolvedP = this.resolveFilename(`open '${p}'`, p); - if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) - throw ENOENT(`open '${p}'`); - if (p[p.length - 1] === `/` && !this.listings.has(resolvedP)) - throw ENOTDIR(`open '${p}'`); - if (this.listings.has(resolvedP)) - throw EISDIR(`read`); - const entry = this.entries.get(resolvedP); - if (entry === void 0) - throw new Error(`Unreachable`); - return this.getFileSource(entry, opts); - } - async readdirPromise(p, opts) { - return this.readdirSync(p, opts); - } - readdirSync(p, opts) { - const resolvedP = this.resolveFilename(`scandir '${p}'`, p); - if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) - throw ENOENT(`scandir '${p}'`); - const directoryListing = this.listings.get(resolvedP); - if (!directoryListing) - throw ENOTDIR(`scandir '${p}'`); - if (opts?.recursive) { - if (opts?.withFileTypes) { - const entries = Array.from(directoryListing, (name) => { - return Object.assign(this.statImpl(`lstat`, ppath.join(p, name)), { - name, - path: PortablePath.dot - }); - }); - for (const entry of entries) { - if (!entry.isDirectory()) - continue; - const subPath = ppath.join(entry.path, entry.name); - const subListing = this.listings.get(ppath.join(resolvedP, subPath)); - for (const child of subListing) { - entries.push(Object.assign(this.statImpl(`lstat`, ppath.join(p, subPath, child)), { - name: child, - path: subPath - })); - } - } - return entries; - } else { - const entries = [...directoryListing]; - for (const subPath of entries) { - const subListing = this.listings.get(ppath.join(resolvedP, subPath)); - if (typeof subListing === `undefined`) - continue; - for (const child of subListing) { - entries.push(ppath.join(subPath, child)); - } - } - return entries; - } - } else if (opts?.withFileTypes) { - return Array.from(directoryListing, (name) => { - return Object.assign(this.statImpl(`lstat`, ppath.join(p, name)), { - name, - path: void 0 - }); - }); - } else { - return [...directoryListing]; - } - } - async readlinkPromise(p) { - const entry = this.prepareReadlink(p); - return (await this.getFileSource(entry, { asyncDecompress: true })).toString(); - } - readlinkSync(p) { - const entry = this.prepareReadlink(p); - return this.getFileSource(entry).toString(); - } - prepareReadlink(p) { - const resolvedP = this.resolveFilename(`readlink '${p}'`, p, false); - if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) - throw ENOENT(`readlink '${p}'`); - if (p[p.length - 1] === `/` && !this.listings.has(resolvedP)) - throw ENOTDIR(`open '${p}'`); - if (this.listings.has(resolvedP)) - throw EINVAL(`readlink '${p}'`); - const entry = this.entries.get(resolvedP); - if (entry === void 0) - throw new Error(`Unreachable`); - if (!this.isSymbolicLink(entry)) - throw EINVAL(`readlink '${p}'`); - return entry; - } - async truncatePromise(p, len = 0) { - const resolvedP = this.resolveFilename(`open '${p}'`, p); - const index = this.entries.get(resolvedP); - if (typeof index === `undefined`) - throw EINVAL(`open '${p}'`); - const source = await this.getFileSource(index, { asyncDecompress: true }); - const truncated = Buffer.alloc(len, 0); - source.copy(truncated); - return await this.writeFilePromise(p, truncated); - } - truncateSync(p, len = 0) { - const resolvedP = this.resolveFilename(`open '${p}'`, p); - const index = this.entries.get(resolvedP); - if (typeof index === `undefined`) - throw EINVAL(`open '${p}'`); - const source = this.getFileSource(index); - const truncated = Buffer.alloc(len, 0); - source.copy(truncated); - return this.writeFileSync(p, truncated); - } - async ftruncatePromise(fd, len) { - return this.truncatePromise(this.fdToPath(fd, `ftruncate`), len); - } - ftruncateSync(fd, len) { - return this.truncateSync(this.fdToPath(fd, `ftruncateSync`), len); - } - watch(p, a, b) { - let persistent; - switch (typeof a) { - case `function`: - case `string`: - case `undefined`: - { - persistent = true; - } - break; - default: - { - ({ persistent = true } = a); - } - break; - } - if (!persistent) - return { on: () => { - }, close: () => { - } }; - const interval = setInterval(() => { - }, 24 * 60 * 60 * 1e3); - return { on: () => { - }, close: () => { - clearInterval(interval); - } }; - } - watchFile(p, a, b) { - const resolvedP = ppath.resolve(PortablePath.root, p); - return watchFile(this, resolvedP, a, b); - } - unwatchFile(p, cb) { - const resolvedP = ppath.resolve(PortablePath.root, p); - return unwatchFile(this, resolvedP, cb); - } -} - -setFactory(() => { - const emZip = createModule(); - return makeInterface(emZip); -}); - -var ErrorCode = /* @__PURE__ */ ((ErrorCode2) => { - ErrorCode2["API_ERROR"] = `API_ERROR`; - ErrorCode2["BUILTIN_NODE_RESOLUTION_FAILED"] = `BUILTIN_NODE_RESOLUTION_FAILED`; - ErrorCode2["EXPORTS_RESOLUTION_FAILED"] = `EXPORTS_RESOLUTION_FAILED`; - ErrorCode2["MISSING_DEPENDENCY"] = `MISSING_DEPENDENCY`; - ErrorCode2["MISSING_PEER_DEPENDENCY"] = `MISSING_PEER_DEPENDENCY`; - ErrorCode2["QUALIFIED_PATH_RESOLUTION_FAILED"] = `QUALIFIED_PATH_RESOLUTION_FAILED`; - ErrorCode2["INTERNAL"] = `INTERNAL`; - ErrorCode2["UNDECLARED_DEPENDENCY"] = `UNDECLARED_DEPENDENCY`; - ErrorCode2["UNSUPPORTED"] = `UNSUPPORTED`; - return ErrorCode2; -})(ErrorCode || {}); -const MODULE_NOT_FOUND_ERRORS = /* @__PURE__ */ new Set([ - "BUILTIN_NODE_RESOLUTION_FAILED" /* BUILTIN_NODE_RESOLUTION_FAILED */, - "MISSING_DEPENDENCY" /* MISSING_DEPENDENCY */, - "MISSING_PEER_DEPENDENCY" /* MISSING_PEER_DEPENDENCY */, - "QUALIFIED_PATH_RESOLUTION_FAILED" /* QUALIFIED_PATH_RESOLUTION_FAILED */, - "UNDECLARED_DEPENDENCY" /* UNDECLARED_DEPENDENCY */ -]); -function makeError(pnpCode, message, data = {}, code) { - code ??= MODULE_NOT_FOUND_ERRORS.has(pnpCode) ? `MODULE_NOT_FOUND` : pnpCode; - const propertySpec = { - configurable: true, - writable: true, - enumerable: false - }; - return Object.defineProperties(new Error(message), { - code: { - ...propertySpec, - value: code - }, - pnpCode: { - ...propertySpec, - value: pnpCode - }, - data: { - ...propertySpec, - value: data - } - }); -} -function getIssuerModule(parent) { - let issuer = parent; - while (issuer && (issuer.id === `[eval]` || issuer.id === `` || !issuer.filename)) - issuer = issuer.parent; - return issuer || null; -} -function getPathForDisplay(p) { - return npath.normalize(npath.fromPortablePath(p)); -} - -const [major, minor] = process.versions.node.split(`.`).map((value) => parseInt(value, 10)); -const WATCH_MODE_MESSAGE_USES_ARRAYS = major > 19 || major === 19 && minor >= 2 || major === 18 && minor >= 13; - -function readPackageScope(checkPath) { - const rootSeparatorIndex = checkPath.indexOf(npath.sep); - let separatorIndex; - do { - separatorIndex = checkPath.lastIndexOf(npath.sep); - checkPath = checkPath.slice(0, separatorIndex); - if (checkPath.endsWith(`${npath.sep}node_modules`)) - return false; - const pjson = readPackage(checkPath + npath.sep); - if (pjson) { - return { - data: pjson, - path: checkPath - }; - } - } while (separatorIndex > rootSeparatorIndex); - return false; -} -function readPackage(requestPath) { - const jsonPath = npath.resolve(requestPath, `package.json`); - if (!fs__default.default.existsSync(jsonPath)) - return null; - return JSON.parse(fs__default.default.readFileSync(jsonPath, `utf8`)); -} -function ERR_REQUIRE_ESM(filename, parentPath = null) { - const basename = parentPath && path__default.default.basename(filename) === path__default.default.basename(parentPath) ? filename : path__default.default.basename(filename); - const msg = `require() of ES Module ${filename}${parentPath ? ` from ${parentPath}` : ``} not supported. -Instead change the require of ${basename} in ${parentPath} to a dynamic import() which is available in all CommonJS modules.`; - const err = new Error(msg); - err.code = `ERR_REQUIRE_ESM`; - return err; -} -function reportRequiredFilesToWatchMode(files) { - if (process.env.WATCH_REPORT_DEPENDENCIES && process.send) { - files = files.map((filename) => npath.fromPortablePath(VirtualFS.resolveVirtual(npath.toPortablePath(filename)))); - if (WATCH_MODE_MESSAGE_USES_ARRAYS) { - process.send({ "watch:require": files }); - } else { - for (const filename of files) { - process.send({ "watch:require": filename }); - } - } - } -} - -function applyPatch(pnpapi, opts) { - let enableNativeHooks = true; - process.versions.pnp = String(pnpapi.VERSIONS.std); - const moduleExports = require$$0__default.default; - moduleExports.findPnpApi = (lookupSource) => { - const lookupPath = lookupSource instanceof URL ? url.fileURLToPath(lookupSource) : lookupSource; - const apiPath = opts.manager.findApiPathFor(lookupPath); - if (apiPath === null) - return null; - const apiEntry = opts.manager.getApiEntry(apiPath, true); - return apiEntry.instance.findPackageLocator(lookupPath) ? apiEntry.instance : null; - }; - function getRequireStack(parent) { - const requireStack = []; - for (let cursor = parent; cursor; cursor = cursor.parent) - requireStack.push(cursor.filename || cursor.id); - return requireStack; - } - const originalModuleLoad = require$$0.Module._load; - require$$0.Module._load = function(request, parent, isMain) { - if (request === `pnpapi`) { - const parentApiPath = opts.manager.getApiPathFromParent(parent); - if (parentApiPath) { - return opts.manager.getApiEntry(parentApiPath, true).instance; - } - } - return originalModuleLoad.call(require$$0.Module, request, parent, isMain); - }; - function getIssuerSpecsFromPaths(paths) { - return paths.map((path) => ({ - apiPath: opts.manager.findApiPathFor(path), - path, - module: null - })); - } - function getIssuerSpecsFromModule(module) { - if (module && module.id !== `` && module.id !== `internal/preload` && !module.parent && !module.filename && module.paths.length > 0) { - return [{ - apiPath: opts.manager.findApiPathFor(module.paths[0]), - path: module.paths[0], - module - }]; - } - const issuer = getIssuerModule(module); - if (issuer !== null) { - const path = npath.dirname(issuer.filename); - const apiPath = opts.manager.getApiPathFromParent(issuer); - return [{ apiPath, path, module }]; - } else { - const path = process.cwd(); - const apiPath = opts.manager.findApiPathFor(npath.join(path, `[file]`)) ?? opts.manager.getApiPathFromParent(null); - return [{ apiPath, path, module }]; - } - } - function makeFakeParent(path) { - const fakeParent = new require$$0.Module(``); - const fakeFilePath = npath.join(path, `[file]`); - fakeParent.paths = require$$0.Module._nodeModulePaths(fakeFilePath); - return fakeParent; - } - const pathRegExp = /^(?![a-zA-Z]:[\\/]|\\\\|\.{0,2}(?:\/|$))((?:@[^/]+\/)?[^/]+)\/*(.*|)$/; - const originalModuleResolveFilename = require$$0.Module._resolveFilename; - require$$0.Module._resolveFilename = function(request, parent, isMain, options) { - if (require$$0.isBuiltin(request)) - return request; - if (!enableNativeHooks) - return originalModuleResolveFilename.call(require$$0.Module, request, parent, isMain, options); - if (options && options.plugnplay === false) { - const { plugnplay, ...forwardedOptions } = options; - try { - enableNativeHooks = false; - return originalModuleResolveFilename.call(require$$0.Module, request, parent, isMain, forwardedOptions); - } finally { - enableNativeHooks = true; - } - } - if (options) { - const optionNames = new Set(Object.keys(options)); - optionNames.delete(`paths`); - optionNames.delete(`plugnplay`); - if (optionNames.size > 0) { - throw makeError( - ErrorCode.UNSUPPORTED, - `Some options passed to require() aren't supported by PnP yet (${Array.from(optionNames).join(`, `)})` - ); - } - } - const issuerSpecs = options && options.paths ? getIssuerSpecsFromPaths(options.paths) : getIssuerSpecsFromModule(parent); - if (request.match(pathRegExp) === null) { - const parentDirectory = parent?.filename != null ? npath.dirname(parent.filename) : null; - const absoluteRequest = npath.isAbsolute(request) ? request : parentDirectory !== null ? npath.resolve(parentDirectory, request) : null; - if (absoluteRequest !== null) { - const apiPath = parent && parentDirectory === npath.dirname(absoluteRequest) ? opts.manager.getApiPathFromParent(parent) : opts.manager.findApiPathFor(absoluteRequest); - if (apiPath !== null) { - issuerSpecs.unshift({ - apiPath, - path: parentDirectory, - module: null - }); - } - } - } - let firstError; - for (const { apiPath, path, module } of issuerSpecs) { - let resolution; - const issuerApi = apiPath !== null ? opts.manager.getApiEntry(apiPath, true).instance : null; - try { - if (issuerApi !== null) { - resolution = issuerApi.resolveRequest(request, path !== null ? `${path}/` : null); - } else { - if (path === null) - throw new Error(`Assertion failed: Expected the path to be set`); - resolution = originalModuleResolveFilename.call(require$$0.Module, request, module || makeFakeParent(path), isMain); - } - } catch (error) { - firstError = firstError || error; - continue; - } - if (resolution !== null) { - return resolution; - } - } - const requireStack = getRequireStack(parent); - Object.defineProperty(firstError, `requireStack`, { - configurable: true, - writable: true, - enumerable: false, - value: requireStack - }); - if (requireStack.length > 0) - firstError.message += ` -Require stack: -- ${requireStack.join(` -- `)}`; - if (typeof firstError.pnpCode === `string`) - Error.captureStackTrace(firstError); - throw firstError; - }; - const originalFindPath = require$$0.Module._findPath; - require$$0.Module._findPath = function(request, paths, isMain) { - if (request === `pnpapi`) - return false; - if (!enableNativeHooks) - return originalFindPath.call(require$$0.Module, request, paths, isMain); - const isAbsolute = npath.isAbsolute(request); - if (isAbsolute) - paths = [``]; - else if (!paths || paths.length === 0) - return false; - for (const path of paths) { - let resolution; - try { - const pnpApiPath = opts.manager.findApiPathFor(isAbsolute ? request : path); - if (pnpApiPath !== null) { - const api = opts.manager.getApiEntry(pnpApiPath, true).instance; - resolution = api.resolveRequest(request, path) || false; - } else { - resolution = originalFindPath.call(require$$0.Module, request, [path], isMain); - } - } catch (error) { - continue; - } - if (resolution) { - return resolution; - } - } - return false; - }; - const originalExtensionJSFunction = require$$0.Module._extensions[`.js`]; - require$$0.Module._extensions[`.js`] = function(module, filename) { - if (filename.endsWith(`.js`)) { - const pkg = readPackageScope(filename); - if (pkg && pkg.data?.type === `module`) { - const err = ERR_REQUIRE_ESM(filename, module.parent?.filename); - Error.captureStackTrace(err); - throw err; - } - } - originalExtensionJSFunction.call(this, module, filename); - }; - const originalDlopen = process.dlopen; - process.dlopen = function(...args) { - const [module, filename, ...rest] = args; - return originalDlopen.call( - this, - module, - npath.fromPortablePath(VirtualFS.resolveVirtual(npath.toPortablePath(filename))), - ...rest - ); - }; - const originalEmit = process.emit; - process.emit = function(name, data, ...args) { - if (name === `warning` && typeof data === `object` && data.name === `ExperimentalWarning` && (data.message.includes(`--experimental-loader`) || data.message.includes(`Custom ESM Loaders is an experimental feature`))) - return false; - return originalEmit.apply(process, arguments); - }; - patchFs(fs__default.default, new PosixFS(opts.fakeFs)); -} - -function hydrateRuntimeState(data, { basePath }) { - const portablePath = npath.toPortablePath(basePath); - const absolutePortablePath = ppath.resolve(portablePath); - const ignorePattern = data.ignorePatternData !== null ? new RegExp(data.ignorePatternData) : null; - const packageLocatorsByLocations = /* @__PURE__ */ new Map(); - const packageRegistry = new Map(data.packageRegistryData.map(([packageName, packageStoreData]) => { - return [packageName, new Map(packageStoreData.map(([packageReference, packageInformationData]) => { - if (packageName === null !== (packageReference === null)) - throw new Error(`Assertion failed: The name and reference should be null, or neither should`); - const discardFromLookup = packageInformationData.discardFromLookup ?? false; - const packageLocator = { name: packageName, reference: packageReference }; - const entry = packageLocatorsByLocations.get(packageInformationData.packageLocation); - if (!entry) { - packageLocatorsByLocations.set(packageInformationData.packageLocation, { locator: packageLocator, discardFromLookup }); - } else { - entry.discardFromLookup = entry.discardFromLookup && discardFromLookup; - if (!discardFromLookup) { - entry.locator = packageLocator; - } - } - let resolvedPackageLocation = null; - return [packageReference, { - packageDependencies: new Map(packageInformationData.packageDependencies), - packagePeers: new Set(packageInformationData.packagePeers), - linkType: packageInformationData.linkType, - discardFromLookup, - get packageLocation() { - return resolvedPackageLocation || (resolvedPackageLocation = ppath.join(absolutePortablePath, packageInformationData.packageLocation)); - } - }]; - }))]; - })); - const fallbackExclusionList = new Map(data.fallbackExclusionList.map(([packageName, packageReferences]) => { - return [packageName, new Set(packageReferences)]; - })); - const fallbackPool = new Map(data.fallbackPool); - const dependencyTreeRoots = data.dependencyTreeRoots; - const enableTopLevelFallback = data.enableTopLevelFallback; - return { - basePath: portablePath, - dependencyTreeRoots, - enableTopLevelFallback, - fallbackExclusionList, - fallbackPool, - ignorePattern, - packageLocatorsByLocations, - packageRegistry - }; -} - -const ArrayIsArray = Array.isArray; -const JSONStringify = JSON.stringify; -const ObjectGetOwnPropertyNames = Object.getOwnPropertyNames; -const ObjectPrototypeHasOwnProperty = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop); -const RegExpPrototypeExec = (obj, string) => RegExp.prototype.exec.call(obj, string); -const RegExpPrototypeSymbolReplace = (obj, ...rest) => RegExp.prototype[Symbol.replace].apply(obj, rest); -const StringPrototypeEndsWith = (str, ...rest) => String.prototype.endsWith.apply(str, rest); -const StringPrototypeIncludes = (str, ...rest) => String.prototype.includes.apply(str, rest); -const StringPrototypeLastIndexOf = (str, ...rest) => String.prototype.lastIndexOf.apply(str, rest); -const StringPrototypeIndexOf = (str, ...rest) => String.prototype.indexOf.apply(str, rest); -const StringPrototypeReplace = (str, ...rest) => String.prototype.replace.apply(str, rest); -const StringPrototypeSlice = (str, ...rest) => String.prototype.slice.apply(str, rest); -const StringPrototypeStartsWith = (str, ...rest) => String.prototype.startsWith.apply(str, rest); -const SafeMap = Map; -const JSONParse = JSON.parse; - -function createErrorType(code, messageCreator, errorType) { - return class extends errorType { - constructor(...args) { - super(messageCreator(...args)); - this.code = code; - this.name = `${errorType.name} [${code}]`; - } - }; -} -const ERR_PACKAGE_IMPORT_NOT_DEFINED = createErrorType( - `ERR_PACKAGE_IMPORT_NOT_DEFINED`, - (specifier, packagePath, base) => { - return `Package import specifier "${specifier}" is not defined${packagePath ? ` in package ${packagePath}package.json` : ``} imported from ${base}`; - }, - TypeError -); -const ERR_INVALID_MODULE_SPECIFIER = createErrorType( - `ERR_INVALID_MODULE_SPECIFIER`, - (request, reason, base = void 0) => { - return `Invalid module "${request}" ${reason}${base ? ` imported from ${base}` : ``}`; - }, - TypeError -); -const ERR_INVALID_PACKAGE_TARGET = createErrorType( - `ERR_INVALID_PACKAGE_TARGET`, - (pkgPath, key, target, isImport = false, base = void 0) => { - const relError = typeof target === `string` && !isImport && target.length && !StringPrototypeStartsWith(target, `./`); - if (key === `.`) { - assert__default.default(isImport === false); - return `Invalid "exports" main target ${JSONStringify(target)} defined in the package config ${pkgPath}package.json${base ? ` imported from ${base}` : ``}${relError ? `; targets must start with "./"` : ``}`; - } - return `Invalid "${isImport ? `imports` : `exports`}" target ${JSONStringify( - target - )} defined for '${key}' in the package config ${pkgPath}package.json${base ? ` imported from ${base}` : ``}${relError ? `; targets must start with "./"` : ``}`; - }, - Error -); -const ERR_INVALID_PACKAGE_CONFIG = createErrorType( - `ERR_INVALID_PACKAGE_CONFIG`, - (path, base, message) => { - return `Invalid package config ${path}${base ? ` while importing ${base}` : ``}${message ? `. ${message}` : ``}`; - }, - Error -); -const ERR_PACKAGE_PATH_NOT_EXPORTED = createErrorType( - "ERR_PACKAGE_PATH_NOT_EXPORTED", - (pkgPath, subpath, base = void 0) => { - if (subpath === ".") - return `No "exports" main defined in ${pkgPath}package.json${base ? ` imported from ${base}` : ""}`; - return `Package subpath '${subpath}' is not defined by "exports" in ${pkgPath}package.json${base ? ` imported from ${base}` : ""}`; - }, - Error -); - -function filterOwnProperties(source, keys) { - const filtered = /* @__PURE__ */ Object.create(null); - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - if (ObjectPrototypeHasOwnProperty(source, key)) { - filtered[key] = source[key]; - } - } - return filtered; -} - -const packageJSONCache = new SafeMap(); -function getPackageConfig(path, specifier, base, readFileSyncFn) { - const existing = packageJSONCache.get(path); - if (existing !== void 0) { - return existing; - } - const source = readFileSyncFn(path); - if (source === void 0) { - const packageConfig2 = { - pjsonPath: path, - exists: false, - main: void 0, - name: void 0, - type: "none", - exports: void 0, - imports: void 0 - }; - packageJSONCache.set(path, packageConfig2); - return packageConfig2; - } - let packageJSON; - try { - packageJSON = JSONParse(source); - } catch (error) { - throw new ERR_INVALID_PACKAGE_CONFIG( - path, - (base ? `"${specifier}" from ` : "") + url.fileURLToPath(base || specifier), - error.message - ); - } - let { imports, main, name, type } = filterOwnProperties(packageJSON, [ - "imports", - "main", - "name", - "type" - ]); - const exports = ObjectPrototypeHasOwnProperty(packageJSON, "exports") ? packageJSON.exports : void 0; - if (typeof imports !== "object" || imports === null) { - imports = void 0; - } - if (typeof main !== "string") { - main = void 0; - } - if (typeof name !== "string") { - name = void 0; - } - if (type !== "module" && type !== "commonjs") { - type = "none"; - } - const packageConfig = { - pjsonPath: path, - exists: true, - main, - name, - type, - exports, - imports - }; - packageJSONCache.set(path, packageConfig); - return packageConfig; -} -function getPackageScopeConfig(resolved, readFileSyncFn) { - let packageJSONUrl = new URL("./package.json", resolved); - while (true) { - const packageJSONPath2 = packageJSONUrl.pathname; - if (StringPrototypeEndsWith(packageJSONPath2, "node_modules/package.json")) { - break; - } - const packageConfig2 = getPackageConfig( - url.fileURLToPath(packageJSONUrl), - resolved, - void 0, - readFileSyncFn - ); - if (packageConfig2.exists) { - return packageConfig2; - } - const lastPackageJSONUrl = packageJSONUrl; - packageJSONUrl = new URL("../package.json", packageJSONUrl); - if (packageJSONUrl.pathname === lastPackageJSONUrl.pathname) { - break; - } - } - const packageJSONPath = url.fileURLToPath(packageJSONUrl); - const packageConfig = { - pjsonPath: packageJSONPath, - exists: false, - main: void 0, - name: void 0, - type: "none", - exports: void 0, - imports: void 0 - }; - packageJSONCache.set(packageJSONPath, packageConfig); - return packageConfig; -} - -function throwImportNotDefined(specifier, packageJSONUrl, base) { - throw new ERR_PACKAGE_IMPORT_NOT_DEFINED( - specifier, - packageJSONUrl && url.fileURLToPath(new URL(".", packageJSONUrl)), - url.fileURLToPath(base) - ); -} -function throwInvalidSubpath(subpath, packageJSONUrl, internal, base) { - const reason = `request is not a valid subpath for the "${internal ? "imports" : "exports"}" resolution of ${url.fileURLToPath(packageJSONUrl)}`; - throw new ERR_INVALID_MODULE_SPECIFIER( - subpath, - reason, - base && url.fileURLToPath(base) - ); -} -function throwInvalidPackageTarget(subpath, target, packageJSONUrl, internal, base) { - if (typeof target === "object" && target !== null) { - target = JSONStringify(target, null, ""); - } else { - target = `${target}`; - } - throw new ERR_INVALID_PACKAGE_TARGET( - url.fileURLToPath(new URL(".", packageJSONUrl)), - subpath, - target, - internal, - base && url.fileURLToPath(base) - ); -} -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; -const patternRegEx = /\*/g; -function resolvePackageTargetString(target, subpath, match, packageJSONUrl, base, pattern, internal, conditions) { - if (subpath !== "" && !pattern && target[target.length - 1] !== "/") - throwInvalidPackageTarget(match, target, packageJSONUrl, internal, base); - if (!StringPrototypeStartsWith(target, "./")) { - if (internal && !StringPrototypeStartsWith(target, "../") && !StringPrototypeStartsWith(target, "/")) { - let isURL = false; - try { - new URL(target); - isURL = true; - } catch { - } - if (!isURL) { - const exportTarget = pattern ? RegExpPrototypeSymbolReplace(patternRegEx, target, () => subpath) : target + subpath; - return exportTarget; - } - } - throwInvalidPackageTarget(match, target, packageJSONUrl, internal, base); - } - if (RegExpPrototypeExec( - invalidSegmentRegEx, - StringPrototypeSlice(target, 2) - ) !== null) - throwInvalidPackageTarget(match, target, packageJSONUrl, internal, base); - const resolved = new URL(target, packageJSONUrl); - const resolvedPath = resolved.pathname; - const packagePath = new URL(".", packageJSONUrl).pathname; - if (!StringPrototypeStartsWith(resolvedPath, packagePath)) - throwInvalidPackageTarget(match, target, packageJSONUrl, internal, base); - if (subpath === "") - return resolved; - if (RegExpPrototypeExec(invalidSegmentRegEx, subpath) !== null) { - const request = pattern ? StringPrototypeReplace(match, "*", () => subpath) : match + subpath; - throwInvalidSubpath(request, packageJSONUrl, internal, base); - } - if (pattern) { - return new URL( - RegExpPrototypeSymbolReplace(patternRegEx, resolved.href, () => subpath) - ); - } - return new URL(subpath, resolved); -} -function isArrayIndex(key) { - const keyNum = +key; - if (`${keyNum}` !== key) - return false; - return keyNum >= 0 && keyNum < 4294967295; -} -function resolvePackageTarget(packageJSONUrl, target, subpath, packageSubpath, base, pattern, internal, conditions) { - if (typeof target === "string") { - return resolvePackageTargetString( - target, - subpath, - packageSubpath, - packageJSONUrl, - base, - pattern, - internal); - } else if (ArrayIsArray(target)) { - if (target.length === 0) { - return null; - } - let lastException; - for (let i = 0; i < target.length; i++) { - const targetItem = target[i]; - let resolveResult; - try { - resolveResult = resolvePackageTarget( - packageJSONUrl, - targetItem, - subpath, - packageSubpath, - base, - pattern, - internal, - conditions - ); - } catch (e) { - lastException = e; - if (e.code === "ERR_INVALID_PACKAGE_TARGET") { - continue; - } - throw e; - } - if (resolveResult === void 0) { - continue; - } - if (resolveResult === null) { - lastException = null; - continue; - } - return resolveResult; - } - if (lastException === void 0 || lastException === null) - return lastException; - throw lastException; - } else if (typeof target === "object" && target !== null) { - const keys = ObjectGetOwnPropertyNames(target); - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - if (isArrayIndex(key)) { - throw new ERR_INVALID_PACKAGE_CONFIG( - url.fileURLToPath(packageJSONUrl), - base, - '"exports" cannot contain numeric property keys.' - ); - } - } - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - if (key === "default" || conditions.has(key)) { - const conditionalTarget = target[key]; - const resolveResult = resolvePackageTarget( - packageJSONUrl, - conditionalTarget, - subpath, - packageSubpath, - base, - pattern, - internal, - conditions - ); - if (resolveResult === void 0) - continue; - return resolveResult; - } - } - return void 0; - } else if (target === null) { - return null; - } - throwInvalidPackageTarget( - packageSubpath, - target, - packageJSONUrl, - internal, - base - ); -} -function patternKeyCompare(a, b) { - const aPatternIndex = StringPrototypeIndexOf(a, "*"); - const bPatternIndex = StringPrototypeIndexOf(b, "*"); - 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; -} -function isConditionalExportsMainSugar(exports, packageJSONUrl, base) { - if (typeof exports === "string" || ArrayIsArray(exports)) - return true; - if (typeof exports !== "object" || exports === null) - return false; - const keys = ObjectGetOwnPropertyNames(exports); - let isConditionalSugar = false; - let i = 0; - for (let j = 0; j < keys.length; j++) { - const key = keys[j]; - const curIsConditionalSugar = key === "" || key[0] !== "."; - if (i++ === 0) { - isConditionalSugar = curIsConditionalSugar; - } else if (isConditionalSugar !== curIsConditionalSugar) { - throw new ERR_INVALID_PACKAGE_CONFIG( - url.fileURLToPath(packageJSONUrl), - base, - `"exports" cannot contain some keys starting with '.' and some not. The exports object must either be an object of package subpath keys or an object of main entry condition name keys only.` - ); - } - } - return isConditionalSugar; -} -function throwExportsNotFound(subpath, packageJSONUrl, base) { - throw new ERR_PACKAGE_PATH_NOT_EXPORTED( - url.fileURLToPath(new URL(".", packageJSONUrl)), - subpath, - base && url.fileURLToPath(base) - ); -} -const emittedPackageWarnings = /* @__PURE__ */ new Set(); -function emitTrailingSlashPatternDeprecation(match, pjsonUrl, base) { - const pjsonPath = url.fileURLToPath(pjsonUrl); - if (emittedPackageWarnings.has(pjsonPath + "|" + match)) - return; - emittedPackageWarnings.add(pjsonPath + "|" + match); - process.emitWarning( - `Use of deprecated trailing slash pattern mapping "${match}" in the "exports" field module resolution of the package at ${pjsonPath}${base ? ` imported from ${url.fileURLToPath(base)}` : ""}. Mapping specifiers ending in "/" is no longer supported.`, - "DeprecationWarning", - "DEP0155" - ); -} -function packageExportsResolve({ - packageJSONUrl, - packageSubpath, - exports, - base, - conditions -}) { - if (isConditionalExportsMainSugar(exports, packageJSONUrl, base)) - exports = { ".": exports }; - if (ObjectPrototypeHasOwnProperty(exports, packageSubpath) && !StringPrototypeIncludes(packageSubpath, "*") && !StringPrototypeEndsWith(packageSubpath, "/")) { - const target = exports[packageSubpath]; - const resolveResult = resolvePackageTarget( - packageJSONUrl, - target, - "", - packageSubpath, - base, - false, - false, - conditions - ); - if (resolveResult == null) { - throwExportsNotFound(packageSubpath, packageJSONUrl, base); - } - return resolveResult; - } - let bestMatch = ""; - let bestMatchSubpath; - const keys = ObjectGetOwnPropertyNames(exports); - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - const patternIndex = StringPrototypeIndexOf(key, "*"); - if (patternIndex !== -1 && StringPrototypeStartsWith( - packageSubpath, - StringPrototypeSlice(key, 0, patternIndex) - )) { - if (StringPrototypeEndsWith(packageSubpath, "/")) - emitTrailingSlashPatternDeprecation( - packageSubpath, - packageJSONUrl, - base - ); - const patternTrailer = StringPrototypeSlice(key, patternIndex + 1); - if (packageSubpath.length >= key.length && StringPrototypeEndsWith(packageSubpath, patternTrailer) && patternKeyCompare(bestMatch, key) === 1 && StringPrototypeLastIndexOf(key, "*") === patternIndex) { - bestMatch = key; - bestMatchSubpath = StringPrototypeSlice( - packageSubpath, - patternIndex, - packageSubpath.length - patternTrailer.length - ); - } - } - } - if (bestMatch) { - const target = exports[bestMatch]; - const resolveResult = resolvePackageTarget( - packageJSONUrl, - target, - bestMatchSubpath, - bestMatch, - base, - true, - false, - conditions - ); - if (resolveResult == null) { - throwExportsNotFound(packageSubpath, packageJSONUrl, base); - } - return resolveResult; - } - throwExportsNotFound(packageSubpath, packageJSONUrl, base); -} -function packageImportsResolve({ name, base, conditions, readFileSyncFn }) { - if (name === "#" || StringPrototypeStartsWith(name, "#/") || StringPrototypeEndsWith(name, "/")) { - const reason = "is not a valid internal imports specifier name"; - throw new ERR_INVALID_MODULE_SPECIFIER(name, reason, url.fileURLToPath(base)); - } - let packageJSONUrl; - const packageConfig = getPackageScopeConfig(base, readFileSyncFn); - if (packageConfig.exists) { - packageJSONUrl = url.pathToFileURL(packageConfig.pjsonPath); - const imports = packageConfig.imports; - if (imports) { - if (ObjectPrototypeHasOwnProperty(imports, name) && !StringPrototypeIncludes(name, "*")) { - const resolveResult = resolvePackageTarget( - packageJSONUrl, - imports[name], - "", - name, - base, - false, - true, - conditions - ); - if (resolveResult != null) { - return resolveResult; - } - } else { - let bestMatch = ""; - let bestMatchSubpath; - const keys = ObjectGetOwnPropertyNames(imports); - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - const patternIndex = StringPrototypeIndexOf(key, "*"); - if (patternIndex !== -1 && StringPrototypeStartsWith( - name, - StringPrototypeSlice(key, 0, patternIndex) - )) { - const patternTrailer = StringPrototypeSlice(key, patternIndex + 1); - if (name.length >= key.length && StringPrototypeEndsWith(name, patternTrailer) && patternKeyCompare(bestMatch, key) === 1 && StringPrototypeLastIndexOf(key, "*") === patternIndex) { - bestMatch = key; - bestMatchSubpath = StringPrototypeSlice( - name, - patternIndex, - name.length - patternTrailer.length - ); - } - } - } - if (bestMatch) { - const target = imports[bestMatch]; - const resolveResult = resolvePackageTarget( - packageJSONUrl, - target, - bestMatchSubpath, - bestMatch, - base, - true, - true, - conditions - ); - if (resolveResult != null) { - return resolveResult; - } - } - } - } - } - throwImportNotDefined(name, packageJSONUrl, base); -} - -const flagSymbol = Symbol('arg flag'); - -class ArgError extends Error { - constructor(msg, code) { - super(msg); - this.name = 'ArgError'; - this.code = code; - - Object.setPrototypeOf(this, ArgError.prototype); - } -} - -function arg( - opts, - { - argv = process.argv.slice(2), - permissive = false, - stopAtPositional = false - } = {} -) { - if (!opts) { - throw new ArgError( - 'argument specification object is required', - 'ARG_CONFIG_NO_SPEC' - ); - } - - const result = { _: [] }; - - const aliases = {}; - const handlers = {}; - - for (const key of Object.keys(opts)) { - if (!key) { - throw new ArgError( - 'argument key cannot be an empty string', - 'ARG_CONFIG_EMPTY_KEY' - ); - } - - if (key[0] !== '-') { - throw new ArgError( - `argument key must start with '-' but found: '${key}'`, - 'ARG_CONFIG_NONOPT_KEY' - ); - } - - if (key.length === 1) { - throw new ArgError( - `argument key must have a name; singular '-' keys are not allowed: ${key}`, - 'ARG_CONFIG_NONAME_KEY' - ); - } - - if (typeof opts[key] === 'string') { - aliases[key] = opts[key]; - continue; - } - - let type = opts[key]; - let isFlag = false; - - if ( - Array.isArray(type) && - type.length === 1 && - typeof type[0] === 'function' - ) { - const [fn] = type; - type = (value, name, prev = []) => { - prev.push(fn(value, name, prev[prev.length - 1])); - return prev; - }; - isFlag = fn === Boolean || fn[flagSymbol] === true; - } else if (typeof type === 'function') { - isFlag = type === Boolean || type[flagSymbol] === true; - } else { - throw new ArgError( - `type missing or not a function or valid array type: ${key}`, - 'ARG_CONFIG_VAD_TYPE' - ); - } - - if (key[1] !== '-' && key.length > 2) { - throw new ArgError( - `short argument keys (with a single hyphen) must have only one character: ${key}`, - 'ARG_CONFIG_SHORTOPT_TOOLONG' - ); - } - - handlers[key] = [type, isFlag]; - } - - for (let i = 0, len = argv.length; i < len; i++) { - const wholeArg = argv[i]; - - if (stopAtPositional && result._.length > 0) { - result._ = result._.concat(argv.slice(i)); - break; - } - - if (wholeArg === '--') { - result._ = result._.concat(argv.slice(i + 1)); - break; - } - - if (wholeArg.length > 1 && wholeArg[0] === '-') { - /* eslint-disable operator-linebreak */ - const separatedArguments = - wholeArg[1] === '-' || wholeArg.length === 2 - ? [wholeArg] - : wholeArg - .slice(1) - .split('') - .map((a) => `-${a}`); - /* eslint-enable operator-linebreak */ - - for (let j = 0; j < separatedArguments.length; j++) { - const arg = separatedArguments[j]; - const [originalArgName, argStr] = - arg[1] === '-' ? arg.split(/=(.*)/, 2) : [arg, undefined]; - - let argName = originalArgName; - while (argName in aliases) { - argName = aliases[argName]; - } - - if (!(argName in handlers)) { - if (permissive) { - result._.push(arg); - continue; - } else { - throw new ArgError( - `unknown or unexpected option: ${originalArgName}`, - 'ARG_UNKNOWN_OPTION' - ); - } - } - - const [type, isFlag] = handlers[argName]; - - if (!isFlag && j + 1 < separatedArguments.length) { - throw new ArgError( - `option requires argument (but was followed by another short argument): ${originalArgName}`, - 'ARG_MISSING_REQUIRED_SHORTARG' - ); - } - - if (isFlag) { - result[argName] = type(true, argName, result[argName]); - } else if (argStr === undefined) { - if ( - argv.length < i + 2 || - (argv[i + 1].length > 1 && - argv[i + 1][0] === '-' && - !( - argv[i + 1].match(/^-?\d*(\.(?=\d))?\d*$/) && - (type === Number || - // eslint-disable-next-line no-undef - (typeof BigInt !== 'undefined' && type === BigInt)) - )) - ) { - const extended = - originalArgName === argName ? '' : ` (alias for ${argName})`; - throw new ArgError( - `option requires argument: ${originalArgName}${extended}`, - 'ARG_MISSING_REQUIRED_LONGARG' - ); - } - - result[argName] = type(argv[i + 1], argName, result[argName]); - ++i; - } else { - result[argName] = type(argStr, argName, result[argName]); - } - } - } else { - result._.push(wholeArg); - } - } - - return result; -} - -arg.flag = (fn) => { - fn[flagSymbol] = true; - return fn; -}; - -// Utility types -arg.COUNT = arg.flag((v, name, existingCount) => (existingCount || 0) + 1); - -// Expose error class -arg.ArgError = ArgError; - -var arg_1 = arg; - -/** - @license - The MIT License (MIT) - - Copyright (c) 2014 Blake Embrey (hello@blakeembrey.com) - - 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. -*/ -function getOptionValue(opt) { - parseOptions(); - return options[opt]; -} -let options; -function parseOptions() { - if (!options) { - options = { - "--conditions": [], - ...parseArgv(getNodeOptionsEnvArgv()), - ...parseArgv(process.execArgv) - }; - } -} -function parseArgv(argv) { - return arg_1( - { - "--conditions": [String], - "-C": "--conditions" - }, - { - argv, - permissive: true - } - ); -} -function getNodeOptionsEnvArgv() { - const errors = []; - const envArgv = ParseNodeOptionsEnvVar(process.env.NODE_OPTIONS || "", errors); - if (errors.length !== 0) ; - return envArgv; -} -function ParseNodeOptionsEnvVar(node_options, errors) { - const env_argv = []; - let is_in_string = false; - let will_start_new_arg = true; - for (let index = 0; index < node_options.length; ++index) { - let c = node_options[index]; - if (c === "\\" && is_in_string) { - if (index + 1 === node_options.length) { - errors.push("invalid value for NODE_OPTIONS (invalid escape)\n"); - return env_argv; - } else { - c = node_options[++index]; - } - } else if (c === " " && !is_in_string) { - will_start_new_arg = true; - continue; - } else if (c === '"') { - is_in_string = !is_in_string; - continue; - } - if (will_start_new_arg) { - env_argv.push(c); - will_start_new_arg = false; - } else { - env_argv[env_argv.length - 1] += c; - } - } - if (is_in_string) { - errors.push("invalid value for NODE_OPTIONS (unterminated string)\n"); - } - return env_argv; -} - -function makeApi(runtimeState, opts) { - const alwaysWarnOnFallback = Number(process.env.PNP_ALWAYS_WARN_ON_FALLBACK) > 0; - const debugLevel = Number(process.env.PNP_DEBUG_LEVEL); - const pathRegExp = /^(?![a-zA-Z]:[\\/]|\\\\|\.{0,2}(?:\/|$))((?:node:)?(?:@[^/]+\/)?[^/]+)\/*(.*|)$/; - const isStrictRegExp = /^(\/|\.{1,2}(\/|$))/; - const isDirRegExp = /\/$/; - const isRelativeRegexp = /^\.{0,2}\//; - const topLevelLocator = { name: null, reference: null }; - const fallbackLocators = []; - const emittedWarnings = /* @__PURE__ */ new Set(); - if (runtimeState.enableTopLevelFallback === true) - fallbackLocators.push(topLevelLocator); - if (opts.compatibilityMode !== false) { - for (const name of [`react-scripts`, `gatsby`]) { - const packageStore = runtimeState.packageRegistry.get(name); - if (packageStore) { - for (const reference of packageStore.keys()) { - if (reference === null) { - throw new Error(`Assertion failed: This reference shouldn't be null`); - } else { - fallbackLocators.push({ name, reference }); - } - } - } - } - } - const { - ignorePattern, - packageRegistry, - packageLocatorsByLocations - } = runtimeState; - function makeLogEntry(name, args) { - return { - fn: name, - args, - error: null, - result: null - }; - } - function trace(entry) { - const colors = process.stderr?.hasColors?.() ?? process.stdout.isTTY; - const c = (n, str) => `\x1B[${n}m${str}\x1B[0m`; - const error = entry.error; - if (error) - console.error(c(`31;1`, `\u2716 ${entry.error?.message.replace(/\n.*/s, ``)}`)); - else - console.error(c(`33;1`, `\u203C Resolution`)); - if (entry.args.length > 0) - console.error(); - for (const arg of entry.args) - console.error(` ${c(`37;1`, `In \u2190`)} ${nodeUtils.inspect(arg, { colors, compact: true })}`); - if (entry.result) { - console.error(); - console.error(` ${c(`37;1`, `Out \u2192`)} ${nodeUtils.inspect(entry.result, { colors, compact: true })}`); - } - const stack = new Error().stack.match(/(?<=^ +)at.*/gm)?.slice(2) ?? []; - if (stack.length > 0) { - console.error(); - for (const line of stack) { - console.error(` ${c(`38;5;244`, line)}`); - } - } - console.error(); - } - function maybeLog(name, fn) { - if (opts.allowDebug === false) - return fn; - if (Number.isFinite(debugLevel)) { - if (debugLevel >= 2) { - return (...args) => { - const logEntry = makeLogEntry(name, args); - try { - return logEntry.result = fn(...args); - } catch (error) { - throw logEntry.error = error; - } finally { - trace(logEntry); - } - }; - } else if (debugLevel >= 1) { - return (...args) => { - try { - return fn(...args); - } catch (error) { - const logEntry = makeLogEntry(name, args); - logEntry.error = error; - trace(logEntry); - throw error; - } - }; - } - } - return fn; - } - function getPackageInformationSafe(packageLocator) { - const packageInformation = getPackageInformation(packageLocator); - if (!packageInformation) { - throw makeError( - ErrorCode.INTERNAL, - `Couldn't find a matching entry in the dependency tree for the specified parent (this is probably an internal error)` - ); - } - return packageInformation; - } - function isDependencyTreeRoot(packageLocator) { - if (packageLocator.name === null) - return true; - for (const dependencyTreeRoot of runtimeState.dependencyTreeRoots) - if (dependencyTreeRoot.name === packageLocator.name && dependencyTreeRoot.reference === packageLocator.reference) - return true; - return false; - } - const defaultExportsConditions = /* @__PURE__ */ new Set([ - `node`, - `require`, - ...getOptionValue(`--conditions`) - ]); - function applyNodeExportsResolution(unqualifiedPath, conditions = defaultExportsConditions, issuer) { - const locator = findPackageLocator(ppath.join(unqualifiedPath, `internal.js`), { - resolveIgnored: true, - includeDiscardFromLookup: true - }); - if (locator === null) { - throw makeError( - ErrorCode.INTERNAL, - `The locator that owns the "${unqualifiedPath}" path can't be found inside the dependency tree (this is probably an internal error)` - ); - } - const { packageLocation } = getPackageInformationSafe(locator); - const manifestPath = ppath.join(packageLocation, Filename.manifest); - if (!opts.fakeFs.existsSync(manifestPath)) - return null; - const pkgJson = JSON.parse(opts.fakeFs.readFileSync(manifestPath, `utf8`)); - if (pkgJson.exports == null) - return null; - let subpath = ppath.contains(packageLocation, unqualifiedPath); - if (subpath === null) { - throw makeError( - ErrorCode.INTERNAL, - `unqualifiedPath doesn't contain the packageLocation (this is probably an internal error)` - ); - } - if (subpath !== `.` && !isRelativeRegexp.test(subpath)) - subpath = `./${subpath}`; - try { - const resolvedExport = packageExportsResolve({ - packageJSONUrl: url.pathToFileURL(npath.fromPortablePath(manifestPath)), - packageSubpath: subpath, - exports: pkgJson.exports, - base: issuer ? url.pathToFileURL(npath.fromPortablePath(issuer)) : null, - conditions - }); - return npath.toPortablePath(url.fileURLToPath(resolvedExport)); - } catch (error) { - throw makeError( - ErrorCode.EXPORTS_RESOLUTION_FAILED, - error.message, - { unqualifiedPath: getPathForDisplay(unqualifiedPath), locator, pkgJson, subpath: getPathForDisplay(subpath), conditions }, - error.code - ); - } - } - function applyNodeExtensionResolution(unqualifiedPath, candidates, { extensions }) { - let stat; - try { - candidates.push(unqualifiedPath); - stat = opts.fakeFs.statSync(unqualifiedPath); - } catch (error) { - } - if (stat && !stat.isDirectory()) - return opts.fakeFs.realpathSync(unqualifiedPath); - if (stat && stat.isDirectory()) { - let pkgJson; - try { - pkgJson = JSON.parse(opts.fakeFs.readFileSync(ppath.join(unqualifiedPath, Filename.manifest), `utf8`)); - } catch (error) { - } - let nextUnqualifiedPath; - if (pkgJson && pkgJson.main) - nextUnqualifiedPath = ppath.resolve(unqualifiedPath, pkgJson.main); - if (nextUnqualifiedPath && nextUnqualifiedPath !== unqualifiedPath) { - const resolution = applyNodeExtensionResolution(nextUnqualifiedPath, candidates, { extensions }); - if (resolution !== null) { - return resolution; - } - } - } - for (let i = 0, length = extensions.length; i < length; i++) { - const candidateFile = `${unqualifiedPath}${extensions[i]}`; - candidates.push(candidateFile); - if (opts.fakeFs.existsSync(candidateFile)) { - return candidateFile; - } - } - if (stat && stat.isDirectory()) { - for (let i = 0, length = extensions.length; i < length; i++) { - const candidateFile = ppath.format({ dir: unqualifiedPath, name: `index`, ext: extensions[i] }); - candidates.push(candidateFile); - if (opts.fakeFs.existsSync(candidateFile)) { - return candidateFile; - } - } - } - return null; - } - function makeFakeModule(path) { - const fakeModule = new require$$0.Module(path, null); - fakeModule.filename = path; - fakeModule.paths = require$$0.Module._nodeModulePaths(path); - return fakeModule; - } - function callNativeResolution(request, issuer) { - if (issuer.endsWith(`/`)) - issuer = ppath.join(issuer, `internal.js`); - return require$$0.Module._resolveFilename(npath.fromPortablePath(request), makeFakeModule(npath.fromPortablePath(issuer)), false, { plugnplay: false }); - } - function isPathIgnored(path) { - if (ignorePattern === null) - return false; - const subPath = ppath.contains(runtimeState.basePath, path); - if (subPath === null) - return false; - if (ignorePattern.test(subPath.replace(/\/$/, ``))) { - return true; - } else { - return false; - } - } - const VERSIONS = { std: 3, resolveVirtual: 1, getAllLocators: 1 }; - const topLevel = topLevelLocator; - function getPackageInformation({ name, reference }) { - const packageInformationStore = packageRegistry.get(name); - if (!packageInformationStore) - return null; - const packageInformation = packageInformationStore.get(reference); - if (!packageInformation) - return null; - return packageInformation; - } - function findPackageDependents({ name, reference }) { - const dependents = []; - for (const [dependentName, packageInformationStore] of packageRegistry) { - if (dependentName === null) - continue; - for (const [dependentReference, packageInformation] of packageInformationStore) { - if (dependentReference === null) - continue; - const dependencyReference = packageInformation.packageDependencies.get(name); - if (dependencyReference !== reference) - continue; - if (dependentName === name && dependentReference === reference) - continue; - dependents.push({ - name: dependentName, - reference: dependentReference - }); - } - } - return dependents; - } - function findBrokenPeerDependencies(dependency, initialPackage) { - const brokenPackages = /* @__PURE__ */ new Map(); - const alreadyVisited = /* @__PURE__ */ new Set(); - const traversal = (currentPackage) => { - const identifier = JSON.stringify(currentPackage.name); - if (alreadyVisited.has(identifier)) - return; - alreadyVisited.add(identifier); - const dependents = findPackageDependents(currentPackage); - for (const dependent of dependents) { - const dependentInformation = getPackageInformationSafe(dependent); - if (dependentInformation.packagePeers.has(dependency)) { - traversal(dependent); - } else { - let brokenSet = brokenPackages.get(dependent.name); - if (typeof brokenSet === `undefined`) - brokenPackages.set(dependent.name, brokenSet = /* @__PURE__ */ new Set()); - brokenSet.add(dependent.reference); - } - } - }; - traversal(initialPackage); - const brokenList = []; - for (const name of [...brokenPackages.keys()].sort()) - for (const reference of [...brokenPackages.get(name)].sort()) - brokenList.push({ name, reference }); - return brokenList; - } - function findPackageLocator(location, { resolveIgnored = false, includeDiscardFromLookup = false } = {}) { - if (isPathIgnored(location) && !resolveIgnored) - return null; - let relativeLocation = ppath.relative(runtimeState.basePath, location); - if (!relativeLocation.match(isStrictRegExp)) - relativeLocation = `./${relativeLocation}`; - if (!relativeLocation.endsWith(`/`)) - relativeLocation = `${relativeLocation}/`; - do { - const entry = packageLocatorsByLocations.get(relativeLocation); - if (typeof entry === `undefined` || entry.discardFromLookup && !includeDiscardFromLookup) { - relativeLocation = relativeLocation.substring(0, relativeLocation.lastIndexOf(`/`, relativeLocation.length - 2) + 1); - continue; - } - return entry.locator; - } while (relativeLocation !== ``); - return null; - } - function tryReadFile(filePath) { - try { - return opts.fakeFs.readFileSync(npath.toPortablePath(filePath), `utf8`); - } catch (err) { - if (err.code === `ENOENT`) - return void 0; - throw err; - } - } - function resolveToUnqualified(request, issuer, { considerBuiltins = true } = {}) { - if (request.startsWith(`#`)) - throw new Error(`resolveToUnqualified can not handle private import mappings`); - if (request === `pnpapi`) - return npath.toPortablePath(opts.pnpapiResolution); - if (considerBuiltins && require$$0.isBuiltin(request)) - return null; - const requestForDisplay = getPathForDisplay(request); - const issuerForDisplay = issuer && getPathForDisplay(issuer); - if (issuer && isPathIgnored(issuer)) { - if (!ppath.isAbsolute(request) || findPackageLocator(request) === null) { - const result = callNativeResolution(request, issuer); - if (result === false) { - throw makeError( - ErrorCode.BUILTIN_NODE_RESOLUTION_FAILED, - `The builtin node resolution algorithm was unable to resolve the requested module (it didn't go through the pnp resolver because the issuer was explicitely ignored by the regexp) - -Require request: "${requestForDisplay}" -Required by: ${issuerForDisplay} -`, - { request: requestForDisplay, issuer: issuerForDisplay } - ); - } - return npath.toPortablePath(result); - } - } - let unqualifiedPath; - const dependencyNameMatch = request.match(pathRegExp); - if (!dependencyNameMatch) { - if (ppath.isAbsolute(request)) { - unqualifiedPath = ppath.normalize(request); - } else { - if (!issuer) { - throw makeError( - ErrorCode.API_ERROR, - `The resolveToUnqualified function must be called with a valid issuer when the path isn't a builtin nor absolute`, - { request: requestForDisplay, issuer: issuerForDisplay } - ); - } - const absoluteIssuer = ppath.resolve(issuer); - if (issuer.match(isDirRegExp)) { - unqualifiedPath = ppath.normalize(ppath.join(absoluteIssuer, request)); - } else { - unqualifiedPath = ppath.normalize(ppath.join(ppath.dirname(absoluteIssuer), request)); - } - } - } else { - if (!issuer) { - throw makeError( - ErrorCode.API_ERROR, - `The resolveToUnqualified function must be called with a valid issuer when the path isn't a builtin nor absolute`, - { request: requestForDisplay, issuer: issuerForDisplay } - ); - } - const [, dependencyName, subPath] = dependencyNameMatch; - const issuerLocator = findPackageLocator(issuer); - if (!issuerLocator) { - const result = callNativeResolution(request, issuer); - if (result === false) { - throw makeError( - ErrorCode.BUILTIN_NODE_RESOLUTION_FAILED, - `The builtin node resolution algorithm was unable to resolve the requested module (it didn't go through the pnp resolver because the issuer doesn't seem to be part of the Yarn-managed dependency tree). - -Require path: "${requestForDisplay}" -Required by: ${issuerForDisplay} -`, - { request: requestForDisplay, issuer: issuerForDisplay } - ); - } - return npath.toPortablePath(result); - } - const issuerInformation = getPackageInformationSafe(issuerLocator); - let dependencyReference = issuerInformation.packageDependencies.get(dependencyName); - let fallbackReference = null; - if (dependencyReference == null) { - if (issuerLocator.name !== null) { - const exclusionEntry = runtimeState.fallbackExclusionList.get(issuerLocator.name); - const canUseFallbacks = !exclusionEntry || !exclusionEntry.has(issuerLocator.reference); - if (canUseFallbacks) { - for (let t = 0, T = fallbackLocators.length; t < T; ++t) { - const fallbackInformation = getPackageInformationSafe(fallbackLocators[t]); - const reference = fallbackInformation.packageDependencies.get(dependencyName); - if (reference == null) - continue; - if (alwaysWarnOnFallback) - fallbackReference = reference; - else - dependencyReference = reference; - break; - } - if (runtimeState.enableTopLevelFallback) { - if (dependencyReference == null && fallbackReference === null) { - const reference = runtimeState.fallbackPool.get(dependencyName); - if (reference != null) { - fallbackReference = reference; - } - } - } - } - } - } - let error = null; - if (dependencyReference === null) { - if (isDependencyTreeRoot(issuerLocator)) { - error = makeError( - ErrorCode.MISSING_PEER_DEPENDENCY, - `Your application tried to access ${dependencyName} (a peer dependency); this isn't allowed as there is no ancestor to satisfy the requirement. Use a devDependency if needed. - -Required package: ${dependencyName}${dependencyName !== requestForDisplay ? ` (via "${requestForDisplay}")` : ``} -Required by: ${issuerForDisplay} -`, - { request: requestForDisplay, issuer: issuerForDisplay, dependencyName } - ); - } else { - const brokenAncestors = findBrokenPeerDependencies(dependencyName, issuerLocator); - if (brokenAncestors.every((ancestor) => isDependencyTreeRoot(ancestor))) { - error = makeError( - ErrorCode.MISSING_PEER_DEPENDENCY, - `${issuerLocator.name} tried to access ${dependencyName} (a peer dependency) but it isn't provided by your application; this makes the require call ambiguous and unsound. - -Required package: ${dependencyName}${dependencyName !== requestForDisplay ? ` (via "${requestForDisplay}")` : ``} -Required by: ${issuerLocator.name}@${issuerLocator.reference} (via ${issuerForDisplay}) -${brokenAncestors.map((ancestorLocator) => `Ancestor breaking the chain: ${ancestorLocator.name}@${ancestorLocator.reference} -`).join(``)} -`, - { request: requestForDisplay, issuer: issuerForDisplay, issuerLocator: Object.assign({}, issuerLocator), dependencyName, brokenAncestors } - ); - } else { - error = makeError( - ErrorCode.MISSING_PEER_DEPENDENCY, - `${issuerLocator.name} tried to access ${dependencyName} (a peer dependency) but it isn't provided by its ancestors; this makes the require call ambiguous and unsound. - -Required package: ${dependencyName}${dependencyName !== requestForDisplay ? ` (via "${requestForDisplay}")` : ``} -Required by: ${issuerLocator.name}@${issuerLocator.reference} (via ${issuerForDisplay}) - -${brokenAncestors.map((ancestorLocator) => `Ancestor breaking the chain: ${ancestorLocator.name}@${ancestorLocator.reference} -`).join(``)} -`, - { request: requestForDisplay, issuer: issuerForDisplay, issuerLocator: Object.assign({}, issuerLocator), dependencyName, brokenAncestors } - ); - } - } - } else if (dependencyReference === void 0) { - if (!considerBuiltins && require$$0.isBuiltin(request)) { - if (isDependencyTreeRoot(issuerLocator)) { - error = makeError( - ErrorCode.UNDECLARED_DEPENDENCY, - `Your application tried to access ${dependencyName}. While this module is usually interpreted as a Node builtin, your resolver is running inside a non-Node resolution context where such builtins are ignored. Since ${dependencyName} isn't otherwise declared in your dependencies, this makes the require call ambiguous and unsound. - -Required package: ${dependencyName}${dependencyName !== requestForDisplay ? ` (via "${requestForDisplay}")` : ``} -Required by: ${issuerForDisplay} -`, - { request: requestForDisplay, issuer: issuerForDisplay, dependencyName } - ); - } else { - error = makeError( - ErrorCode.UNDECLARED_DEPENDENCY, - `${issuerLocator.name} tried to access ${dependencyName}. While this module is usually interpreted as a Node builtin, your resolver is running inside a non-Node resolution context where such builtins are ignored. Since ${dependencyName} isn't otherwise declared in ${issuerLocator.name}'s dependencies, this makes the require call ambiguous and unsound. - -Required package: ${dependencyName}${dependencyName !== requestForDisplay ? ` (via "${requestForDisplay}")` : ``} -Required by: ${issuerForDisplay} -`, - { request: requestForDisplay, issuer: issuerForDisplay, issuerLocator: Object.assign({}, issuerLocator), dependencyName } - ); - } - } else { - if (isDependencyTreeRoot(issuerLocator)) { - error = makeError( - ErrorCode.UNDECLARED_DEPENDENCY, - `Your application tried to access ${dependencyName}, but it isn't declared in your dependencies; this makes the require call ambiguous and unsound. - -Required package: ${dependencyName}${dependencyName !== requestForDisplay ? ` (via "${requestForDisplay}")` : ``} -Required by: ${issuerForDisplay} -`, - { request: requestForDisplay, issuer: issuerForDisplay, dependencyName } - ); - } else { - error = makeError( - ErrorCode.UNDECLARED_DEPENDENCY, - `${issuerLocator.name} tried to access ${dependencyName}, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound. - -Required package: ${dependencyName}${dependencyName !== requestForDisplay ? ` (via "${requestForDisplay}")` : ``} -Required by: ${issuerLocator.name}@${issuerLocator.reference} (via ${issuerForDisplay}) -`, - { request: requestForDisplay, issuer: issuerForDisplay, issuerLocator: Object.assign({}, issuerLocator), dependencyName } - ); - } - } - } - if (dependencyReference == null) { - if (fallbackReference === null || error === null) - throw error || new Error(`Assertion failed: Expected an error to have been set`); - dependencyReference = fallbackReference; - const message = error.message.replace(/\n.*/g, ``); - error.message = message; - if (!emittedWarnings.has(message) && debugLevel !== 0) { - emittedWarnings.add(message); - process.emitWarning(error); - } - } - const dependencyLocator = Array.isArray(dependencyReference) ? { name: dependencyReference[0], reference: dependencyReference[1] } : { name: dependencyName, reference: dependencyReference }; - const dependencyInformation = getPackageInformationSafe(dependencyLocator); - if (!dependencyInformation.packageLocation) { - throw makeError( - ErrorCode.MISSING_DEPENDENCY, - `A dependency seems valid but didn't get installed for some reason. This might be caused by a partial install, such as dev vs prod. - -Required package: ${dependencyLocator.name}@${dependencyLocator.reference}${dependencyLocator.name !== requestForDisplay ? ` (via "${requestForDisplay}")` : ``} -Required by: ${issuerLocator.name}@${issuerLocator.reference} (via ${issuerForDisplay}) -`, - { request: requestForDisplay, issuer: issuerForDisplay, dependencyLocator: Object.assign({}, dependencyLocator) } - ); - } - const dependencyLocation = dependencyInformation.packageLocation; - if (subPath) { - unqualifiedPath = ppath.join(dependencyLocation, subPath); - } else { - unqualifiedPath = dependencyLocation; - } - } - return ppath.normalize(unqualifiedPath); - } - function resolveUnqualifiedExport(request, unqualifiedPath, conditions = defaultExportsConditions, issuer) { - if (isStrictRegExp.test(request)) - return unqualifiedPath; - const unqualifiedExportPath = applyNodeExportsResolution(unqualifiedPath, conditions, issuer); - if (unqualifiedExportPath) { - return ppath.normalize(unqualifiedExportPath); - } else { - return unqualifiedPath; - } - } - function resolveUnqualified(unqualifiedPath, { extensions = Object.keys(require$$0.Module._extensions) } = {}) { - const candidates = []; - const qualifiedPath = applyNodeExtensionResolution(unqualifiedPath, candidates, { extensions }); - if (qualifiedPath) { - return ppath.normalize(qualifiedPath); - } else { - reportRequiredFilesToWatchMode(candidates.map((candidate) => npath.fromPortablePath(candidate))); - const unqualifiedPathForDisplay = getPathForDisplay(unqualifiedPath); - const containingPackage = findPackageLocator(unqualifiedPath); - if (containingPackage) { - const { packageLocation } = getPackageInformationSafe(containingPackage); - let exists = true; - try { - opts.fakeFs.accessSync(packageLocation); - } catch (err) { - if (err?.code === `ENOENT`) { - exists = false; - } else { - const readableError = (err?.message ?? err ?? `empty exception thrown`).replace(/^[A-Z]/, ($0) => $0.toLowerCase()); - throw makeError(ErrorCode.QUALIFIED_PATH_RESOLUTION_FAILED, `Required package exists but could not be accessed (${readableError}). - -Missing package: ${containingPackage.name}@${containingPackage.reference} -Expected package location: ${getPathForDisplay(packageLocation)} -`, { unqualifiedPath: unqualifiedPathForDisplay, extensions }); - } - } - if (!exists) { - const errorMessage = packageLocation.includes(`/unplugged/`) ? `Required unplugged package missing from disk. This may happen when switching branches without running installs (unplugged packages must be fully materialized on disk to work).` : `Required package missing from disk. If you keep your packages inside your repository then restarting the Node process may be enough. Otherwise, try to run an install first.`; - throw makeError( - ErrorCode.QUALIFIED_PATH_RESOLUTION_FAILED, - `${errorMessage} - -Missing package: ${containingPackage.name}@${containingPackage.reference} -Expected package location: ${getPathForDisplay(packageLocation)} -`, - { unqualifiedPath: unqualifiedPathForDisplay, extensions } - ); - } - } - throw makeError( - ErrorCode.QUALIFIED_PATH_RESOLUTION_FAILED, - `Qualified path resolution failed: we looked for the following paths, but none could be accessed. - -Source path: ${unqualifiedPathForDisplay} -${candidates.map((candidate) => `Not found: ${getPathForDisplay(candidate)} -`).join(``)}`, - { unqualifiedPath: unqualifiedPathForDisplay, extensions } - ); - } - } - function resolvePrivateRequest(request, issuer, opts2) { - if (!issuer) - throw new Error(`Assertion failed: An issuer is required to resolve private import mappings`); - const resolved = packageImportsResolve({ - name: request, - base: url.pathToFileURL(npath.fromPortablePath(issuer)), - conditions: opts2.conditions ?? defaultExportsConditions, - readFileSyncFn: tryReadFile - }); - if (resolved instanceof URL) { - return resolveUnqualified(npath.toPortablePath(url.fileURLToPath(resolved)), { extensions: opts2.extensions }); - } else { - if (resolved.startsWith(`#`)) - throw new Error(`Mapping from one private import to another isn't allowed`); - return resolveRequest(resolved, issuer, opts2); - } - } - function resolveRequest(request, issuer, opts2 = {}) { - try { - if (request.startsWith(`#`)) - return resolvePrivateRequest(request, issuer, opts2); - const { considerBuiltins, extensions, conditions } = opts2; - const unqualifiedPath = resolveToUnqualified(request, issuer, { considerBuiltins }); - if (request === `pnpapi`) - return unqualifiedPath; - if (unqualifiedPath === null) - return null; - const isIssuerIgnored = () => issuer !== null ? isPathIgnored(issuer) : false; - const remappedPath = (!considerBuiltins || !require$$0.isBuiltin(request)) && !isIssuerIgnored() ? resolveUnqualifiedExport(request, unqualifiedPath, conditions, issuer) : unqualifiedPath; - return resolveUnqualified(remappedPath, { extensions }); - } catch (error) { - if (Object.hasOwn(error, `pnpCode`)) - Object.assign(error.data, { request: getPathForDisplay(request), issuer: issuer && getPathForDisplay(issuer) }); - throw error; - } - } - function resolveVirtual(request) { - const normalized = ppath.normalize(request); - const resolved = VirtualFS.resolveVirtual(normalized); - return resolved !== normalized ? resolved : null; - } - return { - VERSIONS, - topLevel, - getLocator: (name, referencish) => { - if (Array.isArray(referencish)) { - return { name: referencish[0], reference: referencish[1] }; - } else { - return { name, reference: referencish }; - } - }, - getDependencyTreeRoots: () => { - return [...runtimeState.dependencyTreeRoots]; - }, - getAllLocators() { - const locators = []; - for (const [name, entry] of packageRegistry) - for (const reference of entry.keys()) - if (name !== null && reference !== null) - locators.push({ name, reference }); - return locators; - }, - getPackageInformation: (locator) => { - const info = getPackageInformation(locator); - if (info === null) - return null; - const packageLocation = npath.fromPortablePath(info.packageLocation); - const nativeInfo = { ...info, packageLocation }; - return nativeInfo; - }, - findPackageLocator: (path) => { - return findPackageLocator(npath.toPortablePath(path)); - }, - resolveToUnqualified: maybeLog(`resolveToUnqualified`, (request, issuer, opts2) => { - const portableIssuer = issuer !== null ? npath.toPortablePath(issuer) : null; - const resolution = resolveToUnqualified(npath.toPortablePath(request), portableIssuer, opts2); - if (resolution === null) - return null; - return npath.fromPortablePath(resolution); - }), - resolveUnqualified: maybeLog(`resolveUnqualified`, (unqualifiedPath, opts2) => { - return npath.fromPortablePath(resolveUnqualified(npath.toPortablePath(unqualifiedPath), opts2)); - }), - resolveRequest: maybeLog(`resolveRequest`, (request, issuer, opts2) => { - const portableIssuer = issuer !== null ? npath.toPortablePath(issuer) : null; - const resolution = resolveRequest(npath.toPortablePath(request), portableIssuer, opts2); - if (resolution === null) - return null; - return npath.fromPortablePath(resolution); - }), - resolveVirtual: maybeLog(`resolveVirtual`, (path) => { - const result = resolveVirtual(npath.toPortablePath(path)); - if (result !== null) { - return npath.fromPortablePath(result); - } else { - return null; - } - }) - }; -} - -function makeManager(pnpapi, opts) { - const initialApiPath = npath.toPortablePath(pnpapi.resolveToUnqualified(`pnpapi`, null)); - const initialApiStats = opts.fakeFs.statSync(npath.toPortablePath(initialApiPath)); - const apiMetadata = /* @__PURE__ */ new Map([ - [initialApiPath, { - instance: pnpapi, - stats: initialApiStats, - lastRefreshCheck: Date.now() - }] - ]); - function loadApiInstance(pnpApiPath) { - const nativePath = npath.fromPortablePath(pnpApiPath); - const module = new require$$0.Module(nativePath, null); - module.load(nativePath); - return module.exports; - } - function refreshApiEntry(pnpApiPath, apiEntry) { - const timeNow = Date.now(); - if (timeNow - apiEntry.lastRefreshCheck < 500) - return; - apiEntry.lastRefreshCheck = timeNow; - const stats = opts.fakeFs.statSync(pnpApiPath); - if (stats.mtime > apiEntry.stats.mtime) { - process.emitWarning(`[Warning] The runtime detected new information in a PnP file; reloading the API instance (${npath.fromPortablePath(pnpApiPath)})`); - apiEntry.stats = stats; - apiEntry.instance = loadApiInstance(pnpApiPath); - } - } - function getApiEntry(pnpApiPath, refresh = false) { - let apiEntry = apiMetadata.get(pnpApiPath); - if (typeof apiEntry !== `undefined`) { - if (refresh) { - refreshApiEntry(pnpApiPath, apiEntry); - } - } else { - apiMetadata.set(pnpApiPath, apiEntry = { - instance: loadApiInstance(pnpApiPath), - stats: opts.fakeFs.statSync(pnpApiPath), - lastRefreshCheck: Date.now() - }); - } - return apiEntry; - } - const findApiPathCache = /* @__PURE__ */ new Map(); - function addToCacheAndReturn(start, end, target) { - if (target !== null) { - target = VirtualFS.resolveVirtual(target); - target = opts.fakeFs.realpathSync(target); - } - let curr; - let next = start; - do { - curr = next; - findApiPathCache.set(curr, target); - next = ppath.dirname(curr); - } while (curr !== end); - return target; - } - function findApiPathFor(modulePath) { - let bestCandidate = null; - for (const [apiPath, apiEntry] of apiMetadata) { - const locator = apiEntry.instance.findPackageLocator(modulePath); - if (!locator) - continue; - if (apiMetadata.size === 1) - return apiPath; - const packageInformation = apiEntry.instance.getPackageInformation(locator); - if (!packageInformation) - throw new Error(`Assertion failed: Couldn't get package information for '${modulePath}'`); - if (!bestCandidate) - bestCandidate = { packageLocation: packageInformation.packageLocation, apiPaths: [] }; - if (packageInformation.packageLocation === bestCandidate.packageLocation) { - bestCandidate.apiPaths.push(apiPath); - } else if (packageInformation.packageLocation.length > bestCandidate.packageLocation.length) { - bestCandidate = { packageLocation: packageInformation.packageLocation, apiPaths: [apiPath] }; - } - } - if (bestCandidate) { - if (bestCandidate.apiPaths.length === 1) - return bestCandidate.apiPaths[0]; - const controlSegment = bestCandidate.apiPaths.map((apiPath) => ` ${npath.fromPortablePath(apiPath)}`).join(` -`); - throw new Error(`Unable to locate pnpapi, the module '${modulePath}' is controlled by multiple pnpapi instances. -This is usually caused by using the global cache (enableGlobalCache: true) - -Controlled by: -${controlSegment} -`); - } - const start = ppath.resolve(npath.toPortablePath(modulePath)); - let curr; - let next = start; - do { - curr = next; - const cached = findApiPathCache.get(curr); - if (cached !== void 0) - return addToCacheAndReturn(start, curr, cached); - const cjsCandidate = ppath.join(curr, Filename.pnpCjs); - if (opts.fakeFs.existsSync(cjsCandidate) && opts.fakeFs.statSync(cjsCandidate).isFile()) - return addToCacheAndReturn(start, curr, cjsCandidate); - const legacyCjsCandidate = ppath.join(curr, Filename.pnpJs); - if (opts.fakeFs.existsSync(legacyCjsCandidate) && opts.fakeFs.statSync(legacyCjsCandidate).isFile()) - return addToCacheAndReturn(start, curr, legacyCjsCandidate); - next = ppath.dirname(curr); - } while (curr !== PortablePath.root); - return addToCacheAndReturn(start, curr, null); - } - const moduleToApiPathCache = /* @__PURE__ */ new WeakMap(); - function getApiPathFromParent(parent) { - if (parent == null) - return initialApiPath; - let apiPath = moduleToApiPathCache.get(parent); - if (typeof apiPath !== `undefined`) - return apiPath; - apiPath = parent.filename ? findApiPathFor(parent.filename) : null; - moduleToApiPathCache.set(parent, apiPath); - return apiPath; - } - return { - getApiPathFromParent, - findApiPathFor, - getApiEntry - }; -} - -const localFs = { ...fs__default.default }; -const nodeFs = new NodeFS(localFs); -const defaultRuntimeState = $$SETUP_STATE(hydrateRuntimeState); -const defaultPnpapiResolution = __filename; -const defaultFsLayer = new VirtualFS({ - baseFs: new ZipOpenFS({ - baseFs: nodeFs, - maxOpenFiles: 80, - readOnlyArchives: true - }) -}); -class DynamicFS extends ProxiedFS { - constructor() { - super(ppath); - this.baseFs = defaultFsLayer; - } - mapToBase(p) { - return p; - } - mapFromBase(p) { - return p; - } -} -const dynamicFsLayer = new DynamicFS(); -let manager; -const defaultApi = Object.assign(makeApi(defaultRuntimeState, { - fakeFs: dynamicFsLayer, - pnpapiResolution: defaultPnpapiResolution -}), { - makeApi: ({ - basePath = void 0, - fakeFs = dynamicFsLayer, - pnpapiResolution = defaultPnpapiResolution, - ...rest - }) => { - const apiRuntimeState = typeof basePath !== `undefined` ? $$SETUP_STATE(hydrateRuntimeState, basePath) : defaultRuntimeState; - return makeApi(apiRuntimeState, { - fakeFs, - pnpapiResolution, - ...rest - }); - }, - setup: (api) => { - applyPatch(api || defaultApi, { - fakeFs: defaultFsLayer, - manager - }); - dynamicFsLayer.baseFs = new NodeFS(fs__default.default); - } -}); -manager = makeManager(defaultApi, { - fakeFs: dynamicFsLayer -}); -if (module.parent && module.parent.id === `internal/preload`) { - defaultApi.setup(); - if (module.filename) { - delete require$$0__default.default._cache[module.filename]; - } -} -if (process.mainModule === module) { - const reportError = (code, message, data) => { - process.stdout.write(`${JSON.stringify([{ code, message, data }, null])} -`); - }; - const reportSuccess = (resolution) => { - process.stdout.write(`${JSON.stringify([null, resolution])} -`); - }; - const processResolution = (request, issuer) => { - try { - reportSuccess(defaultApi.resolveRequest(request, issuer)); - } catch (error) { - reportError(error.code, error.message, error.data); - } - }; - const processRequest = (data) => { - try { - const [request, issuer] = JSON.parse(data); - processResolution(request, issuer); - } catch (error) { - reportError(`INVALID_JSON`, error.message, error.data); - } - }; - if (process.argv.length > 2) { - if (process.argv.length !== 4) { - process.stderr.write(`Usage: ${process.argv[0]} ${process.argv[1]} -`); - process.exitCode = 64; - } else { - processResolution(process.argv[2], process.argv[3]); - } - } else { - let buffer = ``; - const decoder = new StringDecoder__default.default.StringDecoder(); - process.stdin.on(`data`, (chunk) => { - buffer += decoder.write(chunk); - do { - const index = buffer.indexOf(` -`); - if (index === -1) - break; - const line = buffer.slice(0, index); - buffer = buffer.slice(index + 1); - processRequest(line); - } while (true); - }); - } -} - -module.exports = defaultApi; diff --git a/fixtures/pnp/.yarnrc.yml b/fixtures/pnp/.yarnrc.yml deleted file mode 100644 index 6a6b24d8..00000000 --- a/fixtures/pnp/.yarnrc.yml +++ /dev/null @@ -1 +0,0 @@ -enableGlobalCache: 0 diff --git a/fixtures/pnp/package.json b/fixtures/pnp/package.json deleted file mode 100644 index 5d119379..00000000 --- a/fixtures/pnp/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "pnp", - "packageManager": "yarn@4.3.1", - "dependencies": { - "is-even": "^1.0.0", - "is-odd": "^3.0.1" - } -} diff --git a/fixtures/pnp/yarn.lock b/fixtures/pnp/yarn.lock deleted file mode 100644 index ba89514d..00000000 --- a/fixtures/pnp/yarn.lock +++ /dev/null @@ -1,74 +0,0 @@ -# This file is generated by running "yarn install" inside your project. -# Manual changes might be lost - proceed with caution! - -__metadata: - version: 8 - cacheKey: 10c0 - -"is-buffer@npm:^1.1.5": - version: 1.1.6 - resolution: "is-buffer@npm:1.1.6" - checksum: 10c0/ae18aa0b6e113d6c490ad1db5e8df9bdb57758382b313f5a22c9c61084875c6396d50bbf49315f5b1926d142d74dfb8d31b40d993a383e0a158b15fea7a82234 - languageName: node - linkType: hard - -"is-even@npm:^1.0.0": - version: 1.0.0 - resolution: "is-even@npm:1.0.0" - dependencies: - is-odd: "npm:^0.1.2" - checksum: 10c0/2728cc2f390d07c6a44a054aa53ae6ce57c3a4adfd76a92df528e992b4a978fdec4eaa948e0de6e6431ef3c8deebf1c964fd870d4983044ec9f0f4e630dfb3a5 - languageName: node - linkType: hard - -"is-number@npm:^3.0.0": - version: 3.0.0 - resolution: "is-number@npm:3.0.0" - dependencies: - kind-of: "npm:^3.0.2" - checksum: 10c0/e639c54640b7f029623df24d3d103901e322c0c25ea5bde97cd723c2d0d4c05857a8364ab5c58d963089dbed6bf1d0ffe975cb6aef917e2ad0ccbca653d31b4f - languageName: node - linkType: hard - -"is-number@npm:^6.0.0": - version: 6.0.0 - resolution: "is-number@npm:6.0.0" - checksum: 10c0/5da4c68401529675c575878d2760d66f18eaef4b014858577f6003daf66488d7fe4eae684b1e8574e3fa1bb447c6c6c56b8491d2b4b3239da2d32e5f6f218008 - languageName: node - linkType: hard - -"is-odd@npm:^0.1.2": - version: 0.1.2 - resolution: "is-odd@npm:0.1.2" - dependencies: - is-number: "npm:^3.0.0" - checksum: 10c0/7dc6c6fd004861208ef9f324021c66f19b3dad209c2da3ef3720d4d76e141974fadb52c47b439fc8c52af579468640b554115395b5673f4558ef09719260e898 - languageName: node - linkType: hard - -"is-odd@npm:^3.0.1": - version: 3.0.1 - resolution: "is-odd@npm:3.0.1" - dependencies: - is-number: "npm:^6.0.0" - checksum: 10c0/89ee2e353c5a3f3bd400c79db1c307a5b3506198ee8169d521e533a9b1d8a08fc95f21a919c084e98845b4286d7ffe309778da03744dfe66c3c1763ab1a030c6 - languageName: node - linkType: hard - -"kind-of@npm:^3.0.2": - version: 3.2.2 - resolution: "kind-of@npm:3.2.2" - dependencies: - is-buffer: "npm:^1.1.5" - checksum: 10c0/7e34bc29d4b02c997f92f080de34ebb92033a96736bbb0bb2410e033a7e5ae6571f1fa37b2d7710018f95361473b816c604234197f4f203f9cf149d8ef1574d9 - languageName: node - linkType: hard - -"pnp@workspace:.": - version: 0.0.0-use.local - resolution: "pnp@workspace:." - dependencies: - is-even: "npm:^1.0.0" - is-odd: "npm:^3.0.1" - languageName: unknown - linkType: soft diff --git a/fixtures/pnpm/.gitignore b/fixtures/pnpm/.gitignore deleted file mode 100644 index 3c3629e6..00000000 --- a/fixtures/pnpm/.gitignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/fixtures/pnpm/package.json b/fixtures/pnpm/package.json deleted file mode 100644 index b763d74d..00000000 --- a/fixtures/pnpm/package.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "name": "pnpm", - "version": "1.0.0", - "private": true, - "devDependencies": { - "axios": "1.6.2", - "ipaddr.js": "2.2.0", - "postcss": "8.4.33", - "styled-components": "6.1.1" - } -} diff --git a/fixtures/pnpm/pnpm-lock.yaml b/fixtures/pnpm/pnpm-lock.yaml deleted file mode 100644 index e51dfd6a..00000000 --- a/fixtures/pnpm/pnpm-lock.yaml +++ /dev/null @@ -1,212 +0,0 @@ -lockfileVersion: '6.0' - -settings: - autoInstallPeers: true - excludeLinksFromLockfile: false - -devDependencies: - axios: - specifier: 1.6.2 - version: 1.6.2 - postcss: - specifier: 8.4.33 - version: 8.4.33 - styled-components: - specifier: 6.1.1 - version: 6.1.1(react-dom@18.2.0)(react@18.2.0) - -packages: - - /@emotion/is-prop-valid@1.2.1: - resolution: {integrity: sha512-61Mf7Ufx4aDxx1xlDeOm8aFFigGHE4z+0sKCa+IHCeZKiyP9RLD0Mmx7m8b9/Cf37f7NAvQOOJAbQQGVr5uERw==} - dependencies: - '@emotion/memoize': 0.8.1 - dev: true - - /@emotion/memoize@0.8.1: - resolution: {integrity: sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA==} - dev: true - - /@emotion/unitless@0.8.1: - resolution: {integrity: sha512-KOEGMu6dmJZtpadb476IsZBclKvILjopjUii3V+7MnXIQCYh8W3NgNcgwo21n9LXZX6EDIKvqfjYxXebDwxKmQ==} - dev: true - - /@types/stylis@4.2.4: - resolution: {integrity: sha512-36ZrGJ8fgtBr6nwNnuJ9jXIj+bn/pF6UoqmrQT7+Y99+tFFeHHsoR54+194dHdyhPjgbeoNz3Qru0oRt0l6ASQ==} - dev: true - - /asynckit@0.4.0: - resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} - dev: true - - /axios@1.6.2: - resolution: {integrity: sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A==} - dependencies: - follow-redirects: 1.15.3 - form-data: 4.0.0 - proxy-from-env: 1.1.0 - transitivePeerDependencies: - - debug - dev: true - - /camelize@1.0.1: - resolution: {integrity: sha512-dU+Tx2fsypxTgtLoE36npi3UqcjSSMNYfkqgmoEhtZrraP5VWq0K7FkWVTYa8eMPtnU/G2txVsfdCJTn9uzpuQ==} - dev: true - - /combined-stream@1.0.8: - resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} - engines: {node: '>= 0.8'} - dependencies: - delayed-stream: 1.0.0 - dev: true - - /css-color-keywords@1.0.0: - resolution: {integrity: sha512-FyyrDHZKEjXDpNJYvVsV960FiqQyXc/LlYmsxl2BcdMb2WPx0OGRVgTg55rPSyLSNMqP52R9r8geSp7apN3Ofg==} - engines: {node: '>=4'} - dev: true - - /css-to-react-native@3.2.0: - resolution: {integrity: sha512-e8RKaLXMOFii+02mOlqwjbD00KSEKqblnpO9e++1aXS1fPQOpS1YoqdVHBqPjHNoxeF2mimzVqawm2KCbEdtHQ==} - dependencies: - camelize: 1.0.1 - css-color-keywords: 1.0.0 - postcss-value-parser: 4.2.0 - dev: true - - /csstype@3.1.2: - resolution: {integrity: sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==} - dev: true - - /delayed-stream@1.0.0: - resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} - engines: {node: '>=0.4.0'} - dev: true - - /follow-redirects@1.15.3: - resolution: {integrity: sha512-1VzOtuEM8pC9SFU1E+8KfTjZyMztRsgEfwQl44z8A25uy13jSzTj6dyK2Df52iV0vgHCfBwLhDWevLn95w5v6Q==} - engines: {node: '>=4.0'} - peerDependencies: - debug: '*' - peerDependenciesMeta: - debug: - optional: true - dev: true - - /form-data@4.0.0: - resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==} - engines: {node: '>= 6'} - dependencies: - asynckit: 0.4.0 - combined-stream: 1.0.8 - mime-types: 2.1.35 - dev: true - - /js-tokens@4.0.0: - resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} - dev: true - - /loose-envify@1.4.0: - resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==} - hasBin: true - dependencies: - js-tokens: 4.0.0 - dev: true - - /mime-db@1.52.0: - resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} - engines: {node: '>= 0.6'} - dev: true - - /mime-types@2.1.35: - resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} - engines: {node: '>= 0.6'} - dependencies: - mime-db: 1.52.0 - dev: true - - /nanoid@3.3.7: - resolution: {integrity: sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==} - engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} - hasBin: true - dev: true - - /picocolors@1.0.0: - resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==} - dev: true - - /postcss-value-parser@4.2.0: - resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==} - dev: true - - /postcss@8.4.33: - resolution: {integrity: sha512-Kkpbhhdjw2qQs2O2DGX+8m5OVqEcbB9HRBvuYM9pgrjEFUg30A9LmXNlTAUj4S9kgtGyrMbTzVjH7E+s5Re2yg==} - engines: {node: ^10 || ^12 || >=14} - dependencies: - nanoid: 3.3.7 - picocolors: 1.0.0 - source-map-js: 1.0.2 - dev: true - - /proxy-from-env@1.1.0: - resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==} - dev: true - - /react-dom@18.2.0(react@18.2.0): - resolution: {integrity: sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==} - peerDependencies: - react: ^18.2.0 - dependencies: - loose-envify: 1.4.0 - react: 18.2.0 - scheduler: 0.23.0 - dev: true - - /react@18.2.0: - resolution: {integrity: sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==} - engines: {node: '>=0.10.0'} - dependencies: - loose-envify: 1.4.0 - dev: true - - /scheduler@0.23.0: - resolution: {integrity: sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw==} - dependencies: - loose-envify: 1.4.0 - dev: true - - /shallowequal@1.1.0: - resolution: {integrity: sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ==} - dev: true - - /source-map-js@1.0.2: - resolution: {integrity: sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==} - engines: {node: '>=0.10.0'} - dev: true - - /styled-components@6.1.1(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-cpZZP5RrKRIClBW5Eby4JM1wElLVP4NQrJbJ0h10TidTyJf4SIIwa3zLXOoPb4gJi8MsJ8mjq5mu2IrEhZIAcQ==} - engines: {node: '>= 16'} - peerDependencies: - react: '>= 16.8.0' - react-dom: '>= 16.8.0' - dependencies: - '@emotion/is-prop-valid': 1.2.1 - '@emotion/unitless': 0.8.1 - '@types/stylis': 4.2.4 - css-to-react-native: 3.2.0 - csstype: 3.1.2 - postcss: 8.4.33 - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - shallowequal: 1.1.0 - stylis: 4.3.0 - tslib: 2.6.2 - dev: true - - /stylis@4.3.0: - resolution: {integrity: sha512-E87pIogpwUsUwXw7dNyU4QDjdgVMy52m+XEOPEKUn161cCzWjjhPSQhByfd1CcNvrOLnXQ6OnnZDwnJrz/Z4YQ==} - dev: true - - /tslib@2.6.2: - resolution: {integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==} - dev: true diff --git a/fixtures/tsconfig/cases/builtins/thing.js b/fixtures/tsconfig/cases/builtins/thing.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/builtins/tsconfig.json b/fixtures/tsconfig/cases/builtins/tsconfig.json deleted file mode 100644 index 36aa1a4d..00000000 --- a/fixtures/tsconfig/cases/builtins/tsconfig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compilerOptions": { - "baseUrl": "." - } -} diff --git a/fixtures/tsconfig/cases/exports/index.js b/fixtures/tsconfig/cases/exports/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/exports/tsconfig.json b/fixtures/tsconfig/cases/exports/tsconfig.json deleted file mode 100644 index f0e3159b..00000000 --- a/fixtures/tsconfig/cases/exports/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-exports" -} diff --git a/fixtures/tsconfig/cases/extends-extension/base-tsconfig.json b/fixtures/tsconfig/cases/extends-extension/base-tsconfig.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/cases/extends-extension/base-tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/cases/extends-extension/foo.js b/fixtures/tsconfig/cases/extends-extension/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-extension/tsconfig.json b/fixtures/tsconfig/cases/extends-extension/tsconfig.json deleted file mode 100644 index 0ae4c6a3..00000000 --- a/fixtures/tsconfig/cases/extends-extension/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./base-tsconfig" -} diff --git a/fixtures/tsconfig/cases/extends-extensionless/foo.js b/fixtures/tsconfig/cases/extends-extensionless/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-extensionless/tsconfig.json b/fixtures/tsconfig/cases/extends-extensionless/tsconfig.json deleted file mode 100644 index c36cb7d4..00000000 --- a/fixtures/tsconfig/cases/extends-extensionless/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-field/conf" -} diff --git a/fixtures/tsconfig/cases/extends-multiple/foo.js b/fixtures/tsconfig/cases/extends-multiple/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-multiple/tsconfig.json b/fixtures/tsconfig/cases/extends-multiple/tsconfig.json deleted file mode 100644 index aa2ae783..00000000 --- a/fixtures/tsconfig/cases/extends-multiple/tsconfig.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": ["../extends-extension", "../extends-paths"], - "compilerOptions": { - "baseUrl": ".", - }, -} diff --git a/fixtures/tsconfig/cases/extends-not-found/index.js b/fixtures/tsconfig/cases/extends-not-found/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-not-found/tsconfig.json b/fixtures/tsconfig/cases/extends-not-found/tsconfig.json deleted file mode 100644 index 99df91da..00000000 --- a/fixtures/tsconfig/cases/extends-not-found/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./not-found" -} diff --git a/fixtures/tsconfig/cases/extends-paths/src/index.js b/fixtures/tsconfig/cases/extends-paths/src/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-paths/tsconfig.base.json b/fixtures/tsconfig/cases/extends-paths/tsconfig.base.json deleted file mode 100644 index 5c64b067..00000000 --- a/fixtures/tsconfig/cases/extends-paths/tsconfig.base.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "@/*": ["./*"] - } - } -} diff --git a/fixtures/tsconfig/cases/extends-paths/tsconfig.json b/fixtures/tsconfig/cases/extends-paths/tsconfig.json deleted file mode 100644 index 51086018..00000000 --- a/fixtures/tsconfig/cases/extends-paths/tsconfig.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": "./tsconfig.base.json", - "compilerOptions": { - "baseUrl": "src", - }, -} diff --git a/fixtures/tsconfig/cases/field/index.js b/fixtures/tsconfig/cases/field/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/field/tsconfig.json b/fixtures/tsconfig/cases/field/tsconfig.json deleted file mode 100644 index 9f86c3f4..00000000 --- a/fixtures/tsconfig/cases/field/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-field" -} diff --git a/fixtures/tsconfig/cases/index/index.js b/fixtures/tsconfig/cases/index/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/index/tsconfig.json b/fixtures/tsconfig/cases/index/tsconfig.json deleted file mode 100644 index d20b1774..00000000 --- a/fixtures/tsconfig/cases/index/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-index" -} diff --git a/fixtures/tsconfig/cases/paths_template_variable/foo.js b/fixtures/tsconfig/cases/paths_template_variable/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json b/fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json deleted file mode 100644 index a1a37bb6..00000000 --- a/fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "../../tsconfig_template_variable.json" -} diff --git a/fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json b/fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json deleted file mode 100644 index e7d8e5e5..00000000 --- a/fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "compilerOptions": { - "composite": true, - "paths": { - "foo": ["${configDir}/foo.js"] - } - } -} diff --git a/fixtures/tsconfig/cases/project_references/app/aliased/index.ts b/fixtures/tsconfig/cases/project_references/app/aliased/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/app/index.ts b/fixtures/tsconfig/cases/project_references/app/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/app/tsconfig.json b/fixtures/tsconfig/cases/project_references/app/tsconfig.json deleted file mode 100644 index 7036d2bb..00000000 --- a/fixtures/tsconfig/cases/project_references/app/tsconfig.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "extends": "../tsconfig.base.json", - "compilerOptions": { - "baseUrl": "./", - "paths": { - "@/*": ["./aliased/*"] - } - }, - "references": [ - { - "path": "../project_a/conf.json" - }, - { - "path": "../project_b" - }, - { - "path": "../project_c/tsconfig.json" - }, - { - "path": "../../paths_template_variable/tsconfig2.json" - } - ] -} diff --git a/fixtures/tsconfig/cases/project_references/project_a/aliased/index.ts b/fixtures/tsconfig/cases/project_references/project_a/aliased/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_a/conf.json b/fixtures/tsconfig/cases/project_references/project_a/conf.json deleted file mode 100644 index 4d389d7a..00000000 --- a/fixtures/tsconfig/cases/project_references/project_a/conf.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "compilerOptions": { - "composite": true, - "paths": { - "@/*": ["./aliased/*"] - } - } -} diff --git a/fixtures/tsconfig/cases/project_references/project_a/index.ts b/fixtures/tsconfig/cases/project_references/project_a/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_b/src/aliased/index.ts b/fixtures/tsconfig/cases/project_references/project_b/src/aliased/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_b/tsconfig.json b/fixtures/tsconfig/cases/project_references/project_b/tsconfig.json deleted file mode 100644 index 4ab05cd8..00000000 --- a/fixtures/tsconfig/cases/project_references/project_b/tsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "compilerOptions": { - "composite": true, - "baseUrl": "./src", - "paths": { - "@/*": ["./aliased/*"] - } - } -} diff --git a/fixtures/tsconfig/cases/project_references/project_c/index.ts b/fixtures/tsconfig/cases/project_references/project_c/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_c/tsconfig.json b/fixtures/tsconfig/cases/project_references/project_c/tsconfig.json deleted file mode 100644 index fe520939..00000000 --- a/fixtures/tsconfig/cases/project_references/project_c/tsconfig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compilerOptions": { - "composite": true - } -} diff --git a/fixtures/tsconfig/cases/project_references/tsconfig.base.json b/fixtures/tsconfig/cases/project_references/tsconfig.base.json deleted file mode 100644 index 88ccffe7..00000000 --- a/fixtures/tsconfig/cases/project_references/tsconfig.base.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "compilerOptions": { - } -} diff --git a/fixtures/tsconfig/cases/suffixes/a.ios.ts b/fixtures/tsconfig/cases/suffixes/a.ios.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/a.ts b/fixtures/tsconfig/cases/suffixes/a.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/b.ts b/fixtures/tsconfig/cases/suffixes/b.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/c-test.ts b/fixtures/tsconfig/cases/suffixes/c-test.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/index.ts b/fixtures/tsconfig/cases/suffixes/index.ts deleted file mode 100644 index b09939b9..00000000 --- a/fixtures/tsconfig/cases/suffixes/index.ts +++ /dev/null @@ -1 +0,0 @@ -import './a'; diff --git a/fixtures/tsconfig/cases/suffixes/tsconfig.json b/fixtures/tsconfig/cases/suffixes/tsconfig.json deleted file mode 100644 index 4c2ccc8f..00000000 --- a/fixtures/tsconfig/cases/suffixes/tsconfig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compilerOptions": { - "moduleSuffixes": [".ios", "-test", ""] - } -} diff --git a/fixtures/tsconfig/cases/trailing-comma/bar.js b/fixtures/tsconfig/cases/trailing-comma/bar.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/trailing-comma/index.js b/fixtures/tsconfig/cases/trailing-comma/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/trailing-comma/tsconfig.json b/fixtures/tsconfig/cases/trailing-comma/tsconfig.json deleted file mode 100644 index 6dc20ca5..00000000 --- a/fixtures/tsconfig/cases/trailing-comma/tsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "compilerOptions": { - "paths": { - /* some comment */ - "foo": ["bar.js"], - }, - }, - // another comment -} diff --git a/fixtures/tsconfig/foo.js b/fixtures/tsconfig/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/nested/index.js b/fixtures/tsconfig/nested/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/nested/test.js b/fixtures/tsconfig/nested/test.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/nested/tsconfig.json b/fixtures/tsconfig/nested/tsconfig.json deleted file mode 100644 index 6deb3011..00000000 --- a/fixtures/tsconfig/nested/tsconfig.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "extends": "..", - "compilerOptions": { - "paths": { - "ts-path": ["test.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-exports/conf.json b/fixtures/tsconfig/node_modules/tsconfig-exports/conf.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-exports/conf.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-exports/foo.js b/fixtures/tsconfig/node_modules/tsconfig-exports/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-exports/package.json b/fixtures/tsconfig/node_modules/tsconfig-exports/package.json deleted file mode 100644 index be0ddee6..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-exports/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "tsconfig-exports", - "private": true, - "exports": { - ".": "./conf.json" - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-field/conf.json b/fixtures/tsconfig/node_modules/tsconfig-field/conf.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-field/conf.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-field/foo.js b/fixtures/tsconfig/node_modules/tsconfig-field/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-field/package.json b/fixtures/tsconfig/node_modules/tsconfig-field/package.json deleted file mode 100644 index 7138fdde..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-field/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "tsconfig-field", - "private": true, - "tsconfig": "conf.json" -} \ No newline at end of file diff --git a/fixtures/tsconfig/node_modules/tsconfig-index/foo.js b/fixtures/tsconfig/node_modules/tsconfig-index/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-index/package.json b/fixtures/tsconfig/node_modules/tsconfig-index/package.json deleted file mode 100644 index eb2431e7..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-index/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "tsconfig-index", - "private": true -} \ No newline at end of file diff --git a/fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json b/fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-not-used/foo.js b/fixtures/tsconfig/node_modules/tsconfig-not-used/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json b/fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json deleted file mode 100644 index eb16d127..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "ts-path": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/package.json b/fixtures/tsconfig/package.json deleted file mode 100755 index f48acd1c..00000000 --- a/fixtures/tsconfig/package.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "name": "resolver", - "private": true, - "alias": { - "aliased": "foo", - "aliased-file": "./bar.js", - "something": "./nested/test.js", - "aliasedfolder": "./nested", - "aliasedabsolute": "/nested", - "foo/bar": "./bar.js", - "glob/*/*": "./nested/$2", - "./baz": "./bar.js", - "url": false - }, - "imports": { - "#test": "./bar.js" - }, - "dependencies": { - "foo": "^0.3.4" - }, - "peerDependencies": { - "bar": "*" - } -} diff --git a/fixtures/tsconfig/tsconfig.json b/fixtures/tsconfig/tsconfig.json deleted file mode 100644 index eb16d127..00000000 --- a/fixtures/tsconfig/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "ts-path": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/tsconfig_broken.json b/fixtures/tsconfig/tsconfig_broken.json deleted file mode 100644 index 98232c64..00000000 --- a/fixtures/tsconfig/tsconfig_broken.json +++ /dev/null @@ -1 +0,0 @@ -{ diff --git a/fixtures/tsconfig/tsconfig_template_variable.json b/fixtures/tsconfig/tsconfig_template_variable.json deleted file mode 100644 index 6f272344..00000000 --- a/fixtures/tsconfig/tsconfig_template_variable.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["${configDir}/foo.js"] - } - } -} diff --git a/napi/__test__/resolver.spec.mjs b/napi/__test__/resolver.spec.mjs deleted file mode 100644 index ac6ee0ef..00000000 --- a/napi/__test__/resolver.spec.mjs +++ /dev/null @@ -1,260 +0,0 @@ -import { join } from 'node:path' -import { fileURLToPath } from 'node:url' - -import test from 'ava' - -let ResolverFactory - -if (process.env.WASI_TEST) { - const wasi = await import('../resolver.wasi.cjs') - ResolverFactory = wasi.ResolverFactory -} else { - const napi = await import('../index.js') - ResolverFactory = napi.ResolverFactory -} - -const currentDir = join(fileURLToPath(import.meta.url), '..') - -const enhancedResolveRoot = join( - currentDir, - '..', - '..', - 'fixtures', - 'enhanced_resolve', - 'test', - 'fixtures' -) - -// https://github.com/webpack/enhanced-resolve/blob/main/test/resolve.test.js - -for (const [title, context, request, expected] of [ - [ - 'absolute path', - enhancedResolveRoot, - join(enhancedResolveRoot, 'main1.js'), - join(enhancedResolveRoot, 'main1.js'), - ], - [ - 'file with .js', - enhancedResolveRoot, - './main1.js', - join(enhancedResolveRoot, 'main1.js'), - ], - [ - 'file without extension', - enhancedResolveRoot, - './main1', - join(enhancedResolveRoot, 'main1.js'), - ], - [ - 'another file with .js', - enhancedResolveRoot, - './a.js', - join(enhancedResolveRoot, 'a.js'), - ], - [ - 'another file without extension', - enhancedResolveRoot, - './a', - join(enhancedResolveRoot, 'a.js'), - ], - [ - 'file in module with .js', - enhancedResolveRoot, - 'm1/a.js', - join(enhancedResolveRoot, 'node_modules/m1/a.js'), - ], - [ - 'file in module without extension', - enhancedResolveRoot, - 'm1/a', - join(enhancedResolveRoot, 'node_modules/m1/a.js'), - ], - [ - 'another file in module without extension', - enhancedResolveRoot, - 'complexm/step1', - join(enhancedResolveRoot, 'node_modules/complexm/step1.js'), - ], - [ - 'from submodule to file in sibling module', - join(enhancedResolveRoot, 'node_modules/complexm'), - 'm2/b.js', - join(enhancedResolveRoot, 'node_modules/m2/b.js'), - ], - [ - 'from nested directory to overwritten file in module', - join(enhancedResolveRoot, 'multiple_modules'), - 'm1/a.js', - join(enhancedResolveRoot, 'multiple_modules/node_modules/m1/a.js'), - ], - [ - 'from nested directory to not overwritten file in module', - join(enhancedResolveRoot, 'multiple_modules'), - 'm1/b.js', - join(enhancedResolveRoot, 'node_modules/m1/b.js'), - ], - [ - 'file with query', - enhancedResolveRoot, - './main1.js?query', - join(enhancedResolveRoot, 'main1.js?query'), - ], - [ - 'file with fragment', - enhancedResolveRoot, - './main1.js#fragment', - join(enhancedResolveRoot, 'main1.js#fragment'), - ], - [ - 'file with fragment and query', - enhancedResolveRoot, - './main1.js#fragment?query', - join(enhancedResolveRoot, 'main1.js#fragment?query'), - ], - [ - 'file with query and fragment', - enhancedResolveRoot, - './main1.js?#fragment', - join(enhancedResolveRoot, 'main1.js?#fragment'), - ], - - [ - 'file with query (unicode)', - enhancedResolveRoot, - './测试.js?query', - join(enhancedResolveRoot, '测试.js?query'), - ], - [ - 'file with fragment (unicode)', - enhancedResolveRoot, - './测试.js#fragment', - join(enhancedResolveRoot, '测试.js#fragment'), - ], - [ - 'file with fragment and query (unicode)', - enhancedResolveRoot, - './测试.js#fragment?query', - join(enhancedResolveRoot, '测试.js#fragment?query'), - ], - [ - 'file with query and fragment (unicode)', - enhancedResolveRoot, - './测试.js?#fragment', - join(enhancedResolveRoot, '测试.js?#fragment'), - ], - - [ - 'file in module with query', - enhancedResolveRoot, - 'm1/a?query', - join(enhancedResolveRoot, 'node_modules/m1/a.js?query'), - ], - [ - 'file in module with fragment', - enhancedResolveRoot, - 'm1/a#fragment', - join(enhancedResolveRoot, 'node_modules/m1/a.js#fragment'), - ], - [ - 'file in module with fragment and query', - enhancedResolveRoot, - 'm1/a#fragment?query', - join(enhancedResolveRoot, 'node_modules/m1/a.js#fragment?query'), - ], - [ - 'file in module with query and fragment', - enhancedResolveRoot, - 'm1/a?#fragment', - join(enhancedResolveRoot, 'node_modules/m1/a.js?#fragment'), - ], - [ - 'differ between directory and file, resolve file', - enhancedResolveRoot, - './dirOrFile', - join(enhancedResolveRoot, 'dirOrFile.js'), - ], - [ - 'differ between directory and file, resolve directory', - enhancedResolveRoot, - './dirOrFile/', - join(enhancedResolveRoot, 'dirOrFile/index.js'), - ], - [ - 'find node_modules outside of node_modules', - join(enhancedResolveRoot, 'browser-module/node_modules'), - 'm1/a', - join(enhancedResolveRoot, 'node_modules/m1/a.js'), - ], - [ - "don't crash on main field pointing to self", - enhancedResolveRoot, - './main-field-self', - join(enhancedResolveRoot, './main-field-self/index.js'), - ], - [ - "don't crash on main field pointing to self (2)", - enhancedResolveRoot, - './main-field-self2', - join(enhancedResolveRoot, './main-field-self2/index.js'), - ], - // enhanced-resolve has `#` prepended with a `\0`, they are removed from the - // following 3 expected test results. - // See https://github.com/webpack/enhanced-resolve#escaping - [ - 'handle fragment edge case (no fragment)', - enhancedResolveRoot, - './no#fragment/#/#', - join(enhancedResolveRoot, 'no#fragment', '#', '#.js'), - ], - [ - 'handle fragment edge case (fragment)', - enhancedResolveRoot, - './no#fragment/#/', - join(enhancedResolveRoot, 'no.js#fragment') + '/#/', - ], - [ - 'handle fragment escaping', - enhancedResolveRoot, - './no\0#fragment/\0#/\0##fragment', - join(enhancedResolveRoot, 'no#fragment', '#', '#.js#fragment'), - ], -]) { - test(title, (t) => { - const resolver = new ResolverFactory({ - modules: ['src/a', 'src/b', 'src/common', 'node_modules'], - extensions: ['.js', '.jsx', '.ts', '.tsx'], - }) - - t.is(resolver.sync(context, request).path, expected) - }) -} - -test('resolve pnpm package', (t) => { - const rootDir = join(currentDir, '..', '..'); - const pnpmProjectPath = join(rootDir, 'fixtures', 'pnpm') - const resolver = new ResolverFactory({ - aliasFields: ['browser'], - }) - t.deepEqual(resolver.sync(pnpmProjectPath, 'styled-components'), { - path: join( - rootDir, - 'node_modules/.pnpm/styled-components@6.1.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/styled-components/dist/styled-components.browser.cjs.js' - ), - }) - t.deepEqual( - resolver.sync( - join( - rootDir, - 'node_modules/.pnpm/styled-components@6.1.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/styled-components' - ), - 'react' - ), - { - path: join( - rootDir, - 'node_modules/.pnpm/react@18.3.1/node_modules/react/index.js' - ), - } - ) -}) diff --git a/napi/src/lib.rs b/napi/src/lib.rs deleted file mode 100644 index 7cd839c5..00000000 --- a/napi/src/lib.rs +++ /dev/null @@ -1,214 +0,0 @@ -extern crate napi; -extern crate napi_derive; -extern crate oxc_resolver; - -use std::{ - path::{Path, PathBuf}, - sync::Arc, -}; - -use napi::{bindgen_prelude::AsyncTask, Task}; -use napi_derive::napi; -use oxc_resolver::{ResolveOptions, Resolver}; - -use self::{ - options::{NapiResolveOptions, StrOrStrList}, - tracing::init_tracing, -}; - -mod options; -mod tracing; - -#[napi(object)] -pub struct ResolveResult { - pub path: Option, - pub error: Option, - /// "type" field in the package.json file - pub module_type: Option, -} - -fn resolve(resolver: &Resolver, path: &Path, request: &str) -> ResolveResult { - match resolver.resolve(path, request) { - Ok(resolution) => ResolveResult { - path: Some(resolution.full_path().to_string_lossy().to_string()), - error: None, - module_type: resolution - .package_json() - .and_then(|p| p.r#type.as_ref()) - .and_then(|t| t.as_str()) - .map(|t| t.to_string()), - }, - Err(err) => ResolveResult { path: None, module_type: None, error: Some(err.to_string()) }, - } -} - -#[allow(clippy::needless_pass_by_value)] -#[napi] -pub fn sync(path: String, request: String) -> ResolveResult { - let path = PathBuf::from(path); - let resolver = Resolver::new(ResolveOptions::default()); - resolve(&resolver, &path, &request) -} - -pub struct ResolveTask { - resolver: Arc, - directory: PathBuf, - request: String, -} - -#[napi] -impl Task for ResolveTask { - type Output = ResolveResult; - type JsValue = ResolveResult; - - fn compute(&mut self) -> napi::Result { - Ok(resolve(&self.resolver, &self.directory, &self.request)) - } - - fn resolve(&mut self, _: napi::Env, result: Self::Output) -> napi::Result { - Ok(result) - } -} - -#[napi] -pub struct ResolverFactory { - resolver: Arc, -} - -#[napi] -impl ResolverFactory { - #[napi(constructor)] - pub fn new(options: NapiResolveOptions) -> Self { - init_tracing(); - Self { resolver: Arc::new(Resolver::new(Self::normalize_options(options))) } - } - - #[napi] - pub fn default() -> Self { - let default_options = ResolveOptions::default(); - Self { resolver: Arc::new(Resolver::new(default_options)) } - } - - /// Clone the resolver using the same underlying cache. - #[napi] - pub fn clone_with_options(&self, options: NapiResolveOptions) -> Self { - Self { - resolver: Arc::new(self.resolver.clone_with_options(Self::normalize_options(options))), - } - } - - /// Clear the underlying cache. - #[napi] - pub fn clear_cache(&self) { - self.resolver.clear_cache(); - } - - /// Synchronously resolve `specifier` at an absolute path to a `directory`. - #[allow(clippy::needless_pass_by_value)] - #[napi] - pub fn sync(&self, directory: String, request: String) -> ResolveResult { - let path = PathBuf::from(directory); - resolve(&self.resolver, &path, &request) - } - - /// Asynchronously resolve `specifier` at an absolute path to a `directory`. - #[allow(clippy::needless_pass_by_value)] - #[napi(js_name = "async")] - pub fn resolve_async(&self, directory: String, request: String) -> AsyncTask { - let path = PathBuf::from(directory); - let resolver = self.resolver.clone(); - AsyncTask::new(ResolveTask { resolver, directory: path, request }) - } - - fn normalize_options(op: NapiResolveOptions) -> ResolveOptions { - let default = ResolveOptions::default(); - // merging options - ResolveOptions { - tsconfig: op.tsconfig.map(|tsconfig| tsconfig.into()), - alias: op - .alias - .map(|alias| { - alias - .into_iter() - .map(|(k, v)| { - let v = v - .into_iter() - .map(|item| match item { - Some(path) => oxc_resolver::AliasValue::from(path), - None => oxc_resolver::AliasValue::Ignore, - }) - .collect(); - (k, v) - }) - .collect::>() - }) - .unwrap_or(default.alias), - alias_fields: op - .alias_fields - .map(|o| o.into_iter().map(|x| StrOrStrList(x).into()).collect::>()) - .unwrap_or(default.alias_fields), - condition_names: op.condition_names.unwrap_or(default.condition_names), - description_files: op.description_files.unwrap_or(default.description_files), - enforce_extension: op - .enforce_extension - .map(|enforce_extension| enforce_extension.into()) - .unwrap_or(default.enforce_extension), - exports_fields: op - .exports_fields - .map(|o| o.into_iter().map(|x| StrOrStrList(x).into()).collect::>()) - .unwrap_or(default.exports_fields), - imports_fields: op - .imports_fields - .map(|o| o.into_iter().map(|x| StrOrStrList(x).into()).collect::>()) - .unwrap_or(default.imports_fields), - extension_alias: op - .extension_alias - .map(|extension_alias| extension_alias.into_iter().collect::>()) - .unwrap_or(default.extension_alias), - extensions: op.extensions.unwrap_or(default.extensions), - fallback: op - .fallback - .map(|fallback| { - fallback - .into_iter() - .map(|(k, v)| { - let v = v - .into_iter() - .map(|item| match item { - Some(path) => oxc_resolver::AliasValue::from(path), - None => oxc_resolver::AliasValue::Ignore, - }) - .collect(); - (k, v) - }) - .collect::>() - }) - .unwrap_or(default.fallback), - fully_specified: op.fully_specified.unwrap_or(default.fully_specified), - main_fields: op - .main_fields - .map(|o| StrOrStrList(o).into()) - .unwrap_or(default.main_fields), - main_files: op.main_files.unwrap_or(default.main_files), - modules: op.modules.map(|o| StrOrStrList(o).into()).unwrap_or(default.modules), - resolve_to_context: op.resolve_to_context.unwrap_or(default.resolve_to_context), - prefer_relative: op.prefer_relative.unwrap_or(default.prefer_relative), - prefer_absolute: op.prefer_absolute.unwrap_or(default.prefer_absolute), - restrictions: op - .restrictions - .map(|restrictions| { - restrictions - .into_iter() - .map(|restriction| restriction.into()) - .collect::>() - }) - .unwrap_or(default.restrictions), - roots: op - .roots - .map(|roots| roots.into_iter().map(PathBuf::from).collect::>()) - .unwrap_or(default.roots), - symlinks: op.symlinks.unwrap_or(default.symlinks), - builtin_modules: op.builtin_modules.unwrap_or(default.builtin_modules), - } - } -} diff --git a/napi/src/options.rs b/napi/src/options.rs deleted file mode 100644 index ea35672f..00000000 --- a/napi/src/options.rs +++ /dev/null @@ -1,261 +0,0 @@ -use std::path::PathBuf; - -use napi::Either; -use napi_derive::napi; -use std::collections::HashMap; - -/// Module Resolution Options -/// -/// Options are directly ported from [enhanced-resolve](https://github.com/webpack/enhanced-resolve#resolver-options). -/// -/// See [webpack resolve](https://webpack.js.org/configuration/resolve/) for information and examples -#[derive(Debug, Clone)] -#[napi(object)] -pub struct NapiResolveOptions { - /// Path to TypeScript configuration file. - /// - /// Default `None` - pub tsconfig: Option, - - /// Alias for [ResolveOptions::alias] and [ResolveOptions::fallback]. - /// - /// For the second value of the tuple, `None -> AliasValue::Ignore`, Some(String) -> - /// AliasValue::Path(String)` - /// Create aliases to import or require certain modules more easily. - /// A trailing $ can also be added to the given object's keys to signify an exact match. - pub alias: Option>>>, - - /// A list of alias fields in description files. - /// Specify a field, such as `browser`, to be parsed according to [this specification](https://github.com/defunctzombie/package-browser-field-spec). - /// Can be a path to json object such as `["path", "to", "exports"]`. - /// - /// Default `[]` - #[napi(ts_type = "(string | string[])[]")] - pub alias_fields: Option>, - - /// Condition names for exports field which defines entry points of a package. - /// The key order in the exports field is significant. During condition matching, earlier entries have higher priority and take precedence over later entries. - /// - /// Default `[]` - pub condition_names: Option>, - - /// The JSON files to use for descriptions. (There was once a `bower.json`.) - /// - /// Default `["package.json"]` - pub description_files: Option>, - - /// If true, it will not allow extension-less files. - /// So by default `require('./foo')` works if `./foo` has a `.js` extension, - /// but with this enabled only `require('./foo.js')` will work. - /// - /// Default to `true` when [ResolveOptions::extensions] contains an empty string. - /// Use `Some(false)` to disable the behavior. - /// See - /// - /// Default None, which is the same as `Some(false)` when the above empty rule is not applied. - pub enforce_extension: Option, - - /// A list of exports fields in description files. - /// Can be a path to json object such as `["path", "to", "exports"]`. - /// - /// Default `[["exports"]]`. - #[napi(ts_type = "(string | string[])[]")] - pub exports_fields: Option>, - - /// Fields from `package.json` which are used to provide the internal requests of a package - /// (requests starting with # are considered internal). - /// - /// Can be a path to a JSON object such as `["path", "to", "imports"]`. - /// - /// Default `[["imports"]]`. - #[napi(ts_type = "(string | string[])[]")] - pub imports_fields: Option>, - - /// An object which maps extension to extension aliases. - /// - /// Default `{}` - pub extension_alias: Option>>, - - /// Attempt to resolve these extensions in order. - /// If multiple files share the same name but have different extensions, - /// will resolve the one with the extension listed first in the array and skip the rest. - /// - /// Default `[".js", ".json", ".node"]` - pub extensions: Option>, - - /// Redirect module requests when normal resolving fails. - /// - /// Default `[]` - pub fallback: Option>>>, - - /// 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). - /// - /// See also webpack configuration [resolve.fullySpecified](https://webpack.js.org/configuration/module/#resolvefullyspecified) - /// - /// Default `false` - pub fully_specified: Option, - - /// A list of main fields in description files - /// - /// Default `["main"]`. - #[napi(ts_type = "string | string[]")] - pub main_fields: Option, - - /// The filename to be used while resolving directories. - /// - /// Default `["index"]` - pub main_files: Option>, - - /// A list of directories to resolve modules from, can be absolute path or folder name. - /// - /// Default `["node_modules"]` - #[napi(ts_type = "string | string[]")] - pub modules: Option, - - /// Resolve to a context instead of a file. - /// - /// Default `false` - pub resolve_to_context: Option, - - /// Prefer to resolve module requests as relative requests instead of using modules from node_modules directories. - /// - /// Default `false` - pub prefer_relative: Option, - - /// Prefer to resolve server-relative urls as absolute paths before falling back to resolve in ResolveOptions::roots. - /// - /// Default `false` - pub prefer_absolute: Option, - - /// A list of resolve restrictions to restrict the paths that a request can be resolved on. - /// - /// Default `[]` - pub restrictions: Option>, - - /// A list of directories where requests of server-relative URLs (starting with '/') are resolved. - /// On non-Windows systems these requests are resolved as an absolute path first. - /// - /// Default `[]` - pub roots: Option>, - - /// Whether to resolve symlinks to their symlinked location. - /// When enabled, symlinked resources are resolved to their real path, not their symlinked location. - /// Note that this may cause module resolution to fail when using tools that symlink packages (like npm link). - /// - /// Default `true` - pub symlinks: Option, - - /// Whether to parse [module.builtinModules](https://nodejs.org/api/module.html#modulebuiltinmodules) or not. - /// For example, "zlib" will throw [crate::ResolveError::Builtin] when set to true. - /// - /// Default `false` - pub builtin_modules: Option, -} - -#[napi] -#[derive(Debug, PartialEq, Eq)] -pub enum EnforceExtension { - Auto, - Enabled, - Disabled, -} - -impl EnforceExtension { - pub fn is_auto(&self) -> bool { - *self == Self::Auto - } - - pub fn is_enabled(&self) -> bool { - *self == Self::Enabled - } - - pub fn is_disabled(&self) -> bool { - *self == Self::Disabled - } -} - -/// Alias Value for [ResolveOptions::alias] and [ResolveOptions::fallback]. -/// Use struct because napi don't support structured union now -#[napi(object)] -#[derive(Debug, Clone)] -pub struct Restriction { - pub path: Option, - pub regex: Option, -} - -/// Tsconfig Options -/// -/// Derived from [tsconfig-paths-webpack-plugin](https://github.com/dividab/tsconfig-paths-webpack-plugin#options) -#[napi(object)] -#[derive(Debug, Clone)] -pub struct TsconfigOptions { - /// Allows you to specify where to find the TypeScript configuration file. - /// You may provide - /// * a relative path to the configuration file. It will be resolved relative to cwd. - /// * an absolute path to the configuration file. - pub config_file: String, - - /// Support for Typescript Project References. - /// - /// * `'auto'`: use the `references` field from tsconfig of `config_file`. - /// * `string[]`: manually provided relative or absolute path. - #[napi(ts_type = "'auto' | string[]")] - pub references: Option>>, -} - -impl Into for Restriction { - fn into(self) -> oxc_resolver::Restriction { - match (self.path, self.regex) { - (None, None) => { - panic!("Should specify path or regex") - } - (None, Some(regex)) => oxc_resolver::Restriction::RegExp(regex), - (Some(path), None) => oxc_resolver::Restriction::Path(PathBuf::from(path)), - (Some(_), Some(_)) => { - panic!("Restriction can't be path and regex at the same time") - } - } - } -} - -impl Into for EnforceExtension { - fn into(self) -> oxc_resolver::EnforceExtension { - match self { - EnforceExtension::Auto => oxc_resolver::EnforceExtension::Auto, - EnforceExtension::Enabled => oxc_resolver::EnforceExtension::Enabled, - EnforceExtension::Disabled => oxc_resolver::EnforceExtension::Disabled, - } - } -} - -impl Into for TsconfigOptions { - fn into(self) -> oxc_resolver::TsconfigOptions { - oxc_resolver::TsconfigOptions { - config_file: PathBuf::from(self.config_file), - references: match self.references { - Some(Either::A(string)) if string.as_str() == "auto" => { - oxc_resolver::TsconfigReferences::Auto - } - Some(Either::A(opt)) => { - panic!("`{}` is not a valid option for tsconfig references", opt) - } - Some(Either::B(paths)) => oxc_resolver::TsconfigReferences::Paths( - paths.into_iter().map(PathBuf::from).collect::>(), - ), - None => oxc_resolver::TsconfigReferences::Disabled, - }, - } - } -} - -type StrOrStrListType = Either>; -pub struct StrOrStrList(pub StrOrStrListType); - -impl Into> for StrOrStrList { - fn into(self) -> Vec { - match self { - StrOrStrList(Either::A(s)) => Vec::from([s]), - StrOrStrList(Either::B(a)) => a, - } - } -} diff --git a/napi/src/tracing.rs b/napi/src/tracing.rs deleted file mode 100644 index 88e4cd7e..00000000 --- a/napi/src/tracing.rs +++ /dev/null @@ -1,25 +0,0 @@ -use std::sync::OnceLock; - -use tracing_subscriber::filter::Targets; -use tracing_subscriber::prelude::__tracing_subscriber_SubscriberExt; -use tracing_subscriber::util::SubscriberInitExt; - -/// To debug `oxc_resolver`: -/// `OXC_LOG=DEBUG your program` -pub fn init_tracing() { - static TRACING: OnceLock<()> = OnceLock::new(); - TRACING.get_or_init(|| { - // Usage without the `regex` feature. - // - tracing_subscriber::registry() - .with(std::env::var("OXC_LOG").map_or_else( - |_| Targets::new(), - |env_var| { - use std::str::FromStr; - Targets::from_str(&env_var).unwrap() - }, - )) - .with(tracing_subscriber::fmt::layer()) - .init(); - }); -} diff --git a/napi/tests/options.test.mjs b/napi/tests/options.test.mjs deleted file mode 100644 index 4a93efff..00000000 --- a/napi/tests/options.test.mjs +++ /dev/null @@ -1,59 +0,0 @@ -import { describe, it } from "node:test"; -import { ResolverFactory } from "../index.js"; -import * as assert from "node:assert"; -import * as path from "node:path"; - -const fixtureDir = new URL( - "../../fixtures/enhanced_resolve/test/fixtures", - import.meta.url -).pathname; - -describe("option", () => { - describe("aliasFields", () => { - it("should allow field string ", () => { - const resolver = new ResolverFactory({ aliasFields: ["browser"] }); - assert.match( - resolver.sync(fixtureDir, "./browser-module/lib/replaced.js").path, - /browser-module\/lib\/browser\.js$/ - ); - }); - it("should allow json path array", () => { - const resolver = new ResolverFactory({ - aliasFields: [["innerBrowser1", "field", "browser"]], - }); - - assert.match( - resolver.sync(fixtureDir, "./browser-module/lib/main1.js").path, - /browser-module\/lib\/main\.js$/ - ); - }); - }); - - describe("exportsFields", () => { - const createTest = (exportsFields) => { - const resolver = new ResolverFactory({ exportsFields }); - assert.match( - resolver.sync( - path.resolve(fixtureDir, "./exports-field3"), - "exports-field" - ).path, - /\/exports-field\/src\/index\.js$/ - ); - }; - it("should allow string as field item", createTest(["broken"])); - it("should allow json path array as field item", createTest([["broken"]])); - }); - - describe("mainFields", () => { - const createTest = (mainFields) => { - const resolver = new ResolverFactory({ mainFields }); - assert.match( - resolver.sync(fixtureDir, "../..").path, - /\/lib\/index\.js$/ - ); - }; - it("should use `'main'` as default", createTest(undefined)); - it("should allow field string", createTest("main")); - it("should allow field array", createTest(["main"])); - }); -}); diff --git a/npm/package.json b/npm/package.json index 85422809..7136edb8 100644 --- a/npm/package.json +++ b/npm/package.json @@ -1,47 +1,36 @@ { - "name": "oxc-resolver", - "version": "1.11.0", - "description": "Oxc Resolver Node API", - "main": "index.js", - "browser": "browser.js", - "files": [ - "index.d.ts", - "index.js", - "browser.js" - ], - "license": "MIT", - "homepage": "https://oxc.rs", - "repository": { - "type": "git", - "url": "git+https://github.com/oxc-project/oxc-resolver.git" - }, - "publishConfig": { - "registry": "https://registry.npmjs.org/", - "access": "public" - }, - "napi": { - "binaryName": "resolver", - "packageName": "@oxc-resolver/binding", - "wasm": { - "browser": { - "fs": true - } - }, - "targets": [ - "x86_64-pc-windows-msvc", - "aarch64-pc-windows-msvc", - "x86_64-unknown-linux-gnu", - "x86_64-unknown-linux-musl", - "x86_64-unknown-freebsd", - "aarch64-unknown-linux-gnu", - "aarch64-unknown-linux-musl", - "armv7-unknown-linux-gnueabihf", - "x86_64-apple-darwin", - "aarch64-apple-darwin", - "wasm32-wasip1-threads" - ] - }, - "funding": { - "url": "https://github.com/sponsors/Boshen" - } + "browser": "browser.js", + "description": "Oxc Resolver Node API", + "files": [ + "index.d.ts", + "index.js", + "browser.js" + ], + "funding": { + "url": "https://github.com/sponsors/Boshen" + }, + "main": "index.js", + "name": "oxc-resolver", + "napi": { + "binaryName": "resolver", + "packageName": "@oxc-resolver/binding", + "targets": [ + "x86_64-pc-windows-msvc", + "aarch64-pc-windows-msvc", + "x86_64-unknown-linux-gnu", + "x86_64-unknown-linux-musl", + "x86_64-unknown-freebsd", + "aarch64-unknown-linux-gnu", + "aarch64-unknown-linux-musl", + "armv7-unknown-linux-gnueabihf", + "x86_64-apple-darwin", + "aarch64-apple-darwin", + "wasm32-wasip1-threads" + ], + "wasm": { + "browser": { + "fs": true + } + } + } } diff --git a/package.json b/package.json index 30892ca3..d0ee7633 100644 --- a/package.json +++ b/package.json @@ -1,33 +1,24 @@ { - "name": "@oxc-resolver/binding", - "private": true, - "version": "0.0.0", - "scripts": { - "build": "napi build --platform --release --package-json-path npm/package.json --manifest-path napi/Cargo.toml", - "build:debug": "napi build --platform --package-json-path npm/package.json --manifest-path napi/Cargo.toml", - "prepublishOnly": "napi pre-publish -t npm", - "test": "ava" - }, - "devDependencies": { - "@napi-rs/cli": "3.0.0-alpha.62", - "@napi-rs/wasm-runtime": "^0.2.4", - "@types/node": "^22.0.0", - "ava": "^6.1.3", - "emnapi": "^1.2.0", - "typescript": "^5.5.3" - }, - "ava": { - "files": [ - "napi/__test__/*.spec.mjs" - ], - "cache": false - }, - "packageManager": "pnpm@9.9.0", - "repository": { - "type": "git", - "url": "git+https://github.com/oxc-project/oxc-resolver.git" - }, - "funding": { - "url": "https://github.com/sponsors/Boshen" - } + "ava": { + "cache": false, + "files": [ + "napi/__test__/*.spec.mjs" + ] + }, + "devDependencies": { + "@napi-rs/cli": "3.0.0-alpha.62", + "@napi-rs/wasm-runtime": "^0.2.4", + "@types/node": "^22.0.0", + "ava": "^6.1.3", + "emnapi": "^1.2.0" + }, + "funding": { + "url": "https://github.com/sponsors/Boshen" + }, + "name": "@oxc-resolver/binding", + "scripts": { + "build": "napi build --platform --release --package-json-path npm/package.json --manifest-path napi/Cargo.toml", + "build:debug": "napi build --platform --package-json-path npm/package.json --manifest-path napi/Cargo.toml", + "prepublishOnly": "napi pre-publish -t npm" + } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml deleted file mode 100644 index db9e5b63..00000000 --- a/pnpm-lock.yaml +++ /dev/null @@ -1,2598 +0,0 @@ -lockfileVersion: '9.0' - -settings: - autoInstallPeers: true - excludeLinksFromLockfile: false - -importers: - - .: - devDependencies: - '@napi-rs/cli': - specifier: 3.0.0-alpha.62 - version: 3.0.0-alpha.62(@emnapi/runtime@1.2.0)(emnapi@1.2.0) - '@napi-rs/wasm-runtime': - specifier: ^0.2.4 - version: 0.2.4 - '@types/node': - specifier: ^22.0.0 - version: 22.5.4 - ava: - specifier: ^6.1.3 - version: 6.1.3 - emnapi: - specifier: ^1.2.0 - version: 1.2.0 - typescript: - specifier: ^5.5.3 - version: 5.5.4 - - fixtures/pnpm: - devDependencies: - axios: - specifier: 1.6.2 - version: 1.6.2 - ipaddr.js: - specifier: 2.2.0 - version: 2.2.0 - postcss: - specifier: 8.4.33 - version: 8.4.33 - styled-components: - specifier: 6.1.1 - version: 6.1.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - - npm: {} - -packages: - - '@emnapi/core@1.2.0': - resolution: {integrity: sha512-E7Vgw78I93we4ZWdYCb4DGAwRROGkMIXk7/y87UmANR+J6qsWusmC3gLt0H+O0KOt5e6O38U8oJamgbudrES/w==} - - '@emnapi/runtime@1.2.0': - resolution: {integrity: sha512-bV21/9LQmcQeCPEg3BDFtvwL6cwiTMksYNWQQ4KOxCZikEGalWtenoZ0wCiukJINlGCIi2KXx01g4FoH/LxpzQ==} - - '@emnapi/wasi-threads@1.0.1': - resolution: {integrity: sha512-iIBu7mwkq4UQGeMEM8bLwNK962nXdhodeScX4slfQnRhEMMzvYivHhutCIk8uojvmASXXPC2WNEjwxFWk72Oqw==} - - '@emotion/is-prop-valid@1.2.2': - resolution: {integrity: sha512-uNsoYd37AFmaCdXlg6EYD1KaPOaRWRByMCYzbKUX4+hhMfrxdVSelShywL4JVaAeM/eHUOSprYBQls+/neX3pw==} - - '@emotion/memoize@0.8.1': - resolution: {integrity: sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA==} - - '@emotion/unitless@0.8.1': - resolution: {integrity: sha512-KOEGMu6dmJZtpadb476IsZBclKvILjopjUii3V+7MnXIQCYh8W3NgNcgwo21n9LXZX6EDIKvqfjYxXebDwxKmQ==} - - '@inquirer/checkbox@2.3.10': - resolution: {integrity: sha512-CTc864M2/523rKc9AglIzAcUCuPXDZENgc5S2KZFVRbnMzpXcYTsUWmbqSeL0XLvtlvEtNevkkVbfVhJpruOyQ==} - engines: {node: '>=18'} - - '@inquirer/confirm@3.1.14': - resolution: {integrity: sha512-nbLSX37b2dGPtKWL3rPuR/5hOuD30S+pqJ/MuFiUEgN6GiMs8UMxiurKAMDzKt6C95ltjupa8zH6+3csXNHWpA==} - engines: {node: '>=18'} - - '@inquirer/core@9.0.2': - resolution: {integrity: sha512-nguvH3TZar3ACwbytZrraRTzGqyxJfYJwv+ZwqZNatAosdWQMP1GV8zvmkNlBe2JeZSaw0WYBHZk52pDpWC9qA==} - engines: {node: '>=18'} - - '@inquirer/editor@2.1.14': - resolution: {integrity: sha512-6nWpoJyVAKwAcv67bkbBmmi3f32xua79fP7TRmNUoR4K+B1GiOBsHO1YdvET/jvC+nTlBZL7puKAKyM7G+Lkzw==} - engines: {node: '>=18'} - - '@inquirer/expand@2.1.14': - resolution: {integrity: sha512-JcxsLajwPykF2kq6biIUdoOzTQ3LXqb8XMVrWkCprG/pFeU1SsxcSSFbF1T5jJGvvlTVcsE+JdGjbQ8ZRZ82RA==} - engines: {node: '>=18'} - - '@inquirer/figures@1.0.3': - resolution: {integrity: sha512-ErXXzENMH5pJt5/ssXV0DfWUZqly8nGzf0UcBV9xTnP+KyffE2mqyxIMBrZ8ijQck2nU0TQm40EQB53YreyWHw==} - engines: {node: '>=18'} - - '@inquirer/input@2.2.1': - resolution: {integrity: sha512-Yl1G6h7qWydzrJwqN777geeJVaAFL5Ly83aZlw4xHf8Z/BoTMfKRheyuMaQwOG7LQ4e5nQP7PxXdEg4SzQ+OKw==} - engines: {node: '>=18'} - - '@inquirer/number@1.0.2': - resolution: {integrity: sha512-GcoK+Phxcln0Qw9e73S5a8B2Ejg3HgSTvNfDegIcS5/BKwUm8t5rejja1l09WXjZM9vrVbRDf9RzWtSUiWVYRQ==} - engines: {node: '>=18'} - - '@inquirer/password@2.1.14': - resolution: {integrity: sha512-sPzOkXLhWJQ96K6nPZFnF8XB8tsDrcCRobd1d3EDz81F+4hp8BbdmsnsQcqZ7oYDIOVM/mWJyIUtJ35TrssJxQ==} - engines: {node: '>=18'} - - '@inquirer/prompts@5.1.2': - resolution: {integrity: sha512-E+ndnfwtVQtcmPt888Hc/HAxJUHSaA6OIvyvLAQ5BLQv+t20GbYdFSjXeLgb47OpMU+aRsKA/ys+Zoylw3kTVg==} - engines: {node: '>=18'} - - '@inquirer/rawlist@2.1.14': - resolution: {integrity: sha512-pLpEzhKNQ/ugFAFfgCNaXljB+dcCwmXwR1jOxAbVeFIdB3l02E5gjI+h1rb136tq0T8JO6P5KFR1oTeld/wdrA==} - engines: {node: '>=18'} - - '@inquirer/select@2.3.10': - resolution: {integrity: sha512-rr7iR0Zj1YFfgM8IUGimPD9Yukd+n/U63CnYT9kdum6DbRXtMxR45rrreP+EA9ixCnShr+W4xj7suRxC1+8t9g==} - engines: {node: '>=18'} - - '@inquirer/type@1.4.0': - resolution: {integrity: sha512-AjOqykVyjdJQvtfkNDGUyMYGF8xN50VUxftCQWsOyIo4DFRLr6VQhW0VItGI1JIyQGCGgIpKa7hMMwNhZb4OIw==} - engines: {node: '>=18'} - - '@mapbox/node-pre-gyp@1.0.11': - resolution: {integrity: sha512-Yhlar6v9WQgUp/He7BdgzOz8lqMQ8sU+jkCq7Wx8Myc5YFJLbEe7lgui/V7G1qB1DJykHSGwreceSaD60Y0PUQ==} - hasBin: true - - '@napi-rs/cli@3.0.0-alpha.62': - resolution: {integrity: sha512-IDUwHAEJZ9ad/s5oyhznrz5ZDcU+SJ6GdP5nb++Wx5MkS4FD9MeS3HfNZdsxkf10pOUPnmvCVFuG4xnLBQYmjw==} - engines: {node: '>= 16'} - hasBin: true - peerDependencies: - '@emnapi/runtime': ^1.1.0 - emnapi: ^1.1.0 - peerDependenciesMeta: - '@emnapi/runtime': - optional: true - emnapi: - optional: true - - '@napi-rs/cross-toolchain@0.0.16': - resolution: {integrity: sha512-jwdjHT5L0m9MH0CmzDwPp0ckn/UO7afHCsPeo7NugHUvYgvlgS7SWhdMVgIgJW2HHqhcW/2nhaLLGpAU1c7QRQ==} - peerDependencies: - '@napi-rs/cross-toolchain-arm64-target-aarch64': ^0.0.16 - '@napi-rs/cross-toolchain-arm64-target-armv7': ^0.0.16 - '@napi-rs/cross-toolchain-arm64-target-x86_64': ^0.0.16 - '@napi-rs/cross-toolchain-x64-target-aarch64': ^0.0.16 - '@napi-rs/cross-toolchain-x64-target-armv7': ^0.0.16 - '@napi-rs/cross-toolchain-x64-target-x86_64': ^0.0.16 - peerDependenciesMeta: - '@napi-rs/cross-toolchain-arm64-target-aarch64': - optional: true - '@napi-rs/cross-toolchain-arm64-target-armv7': - optional: true - '@napi-rs/cross-toolchain-arm64-target-x86_64': - optional: true - '@napi-rs/cross-toolchain-x64-target-aarch64': - optional: true - '@napi-rs/cross-toolchain-x64-target-armv7': - optional: true - '@napi-rs/cross-toolchain-x64-target-x86_64': - optional: true - - '@napi-rs/lzma-android-arm-eabi@1.3.1': - resolution: {integrity: sha512-mtGOg8jXlc+pTBI86cqohfndS9UmOAkk9d5CChKMb8btVks70yhUN1e7YYS3QFbmoxbPs2Ee+wmuH1Khdc7B2w==} - engines: {node: '>= 10'} - cpu: [arm] - os: [android] - - '@napi-rs/lzma-android-arm64@1.3.1': - resolution: {integrity: sha512-4uGkQgAv9Tnc/i0k2eIgbhZgyzs94+iECWxz4MFZNcZ1fNGvGbRL2j+SITE4OmwrUn3TuFK/uYWfgzooq8E1Qg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [android] - - '@napi-rs/lzma-darwin-arm64@1.3.1': - resolution: {integrity: sha512-MZBg4iwHTS8icjTiCMdzh8kYrMmKBCEglFPa+vjI91R2XDwuuwSzqmpATRpmMH8cWUUWtGPF4fnxKzjgkzhd4Q==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [darwin] - - '@napi-rs/lzma-darwin-x64@1.3.1': - resolution: {integrity: sha512-7vte+1lYV7xgZERKH/pjAeh4T16aQASKOzu4op70pK6VP/64Plr5rrvqxQqQmlAIe4pwyo/RkFl1n4LXDod3xg==} - engines: {node: '>= 10'} - cpu: [x64] - os: [darwin] - - '@napi-rs/lzma-freebsd-x64@1.3.1': - resolution: {integrity: sha512-uBS74fynTqLUC3catIxyezCafn8UDlr2yxVV47vz1T6Vop2PGDz/cMQdV6rnLSjPE08Rv66ihM36mgf/MmOkOg==} - engines: {node: '>= 10'} - cpu: [x64] - os: [freebsd] - - '@napi-rs/lzma-linux-arm-gnueabihf@1.3.1': - resolution: {integrity: sha512-rrVLyqBJeN29gPJCNkPbZ7dAzaseEcERKyhjwM+DfbFrDUvtkEcrYPvo+iwE/NmF+OkZQkzcanrVMGnq/mcJYQ==} - engines: {node: '>= 10'} - cpu: [arm] - os: [linux] - - '@napi-rs/lzma-linux-arm64-gnu@1.3.1': - resolution: {integrity: sha512-vDmVsthRbX2opkgRirJJGKQxUP/spvyVM2Y5CyCWZ7sadSID3hA97r38gf9ISn/sJ8/r93IPWLq+iycudNKi+Q==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/lzma-linux-arm64-musl@1.3.1': - resolution: {integrity: sha512-x4m/J3hRdFd3IoqKc+4aBcSUkcuDEP7hH6vdss8bKNLjPfXmnG/lcHJEQX3hNnNOULPP8xVRxgiY8jeL62cnsw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/lzma-linux-x64-gnu@1.3.1': - resolution: {integrity: sha512-riB+Xg72NfH8Kcpq07omshVu0QsLW0v2bhywBNYxvA+t2dGGWSIEN1U/zazUXys+IEA6pBQKqLVseurWE6Cl8g==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/lzma-linux-x64-musl@1.3.1': - resolution: {integrity: sha512-JXLgJFwoeysxdSg7rdVYP8wrliCQVJlU5JcLYjRVSCL4P0mQTjnYi7R7VdaOkDACw/Fvlji7oIJXt0KiaDTcOw==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/lzma-wasm32-wasi@1.3.1': - resolution: {integrity: sha512-XTA9XTUtj0KPKuzNS2oi3bWN6tJodk00wwMd/TiKoEqx9Fe/zu+OfDGuXAn+xs+P7S3YCDHqjYinuTQMZ0ucJw==} - engines: {node: '>=14.0.0'} - cpu: [wasm32] - - '@napi-rs/lzma-win32-arm64-msvc@1.3.1': - resolution: {integrity: sha512-qLDfs9UEtLPPTN/FdSz3gSdlx86VwFQBuLBrQtaiYQtUTKZCOYV1Z1fXqFt5Zqa1HKV2oyXnwGcTI7RpcyXxtg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [win32] - - '@napi-rs/lzma-win32-ia32-msvc@1.3.1': - resolution: {integrity: sha512-rWNlxLFMIfvxzfdQCfeQ3D/HEnQG3vfladFYrXUx6ePXO6r+BLCGn6/LWSSuKlw4vKkb1iHEWsAVaRLIcJEMIA==} - engines: {node: '>= 10'} - cpu: [ia32] - os: [win32] - - '@napi-rs/lzma-win32-x64-msvc@1.3.1': - resolution: {integrity: sha512-SNfHNqEjabXfTL1+KRi0qiAhwIlZHhQystvfSYX6p1g+2trSC/3WUpUQ4fbbR7KyE31g2AAnwjXivnlQ0af/pg==} - engines: {node: '>= 10'} - cpu: [x64] - os: [win32] - - '@napi-rs/lzma@1.3.1': - resolution: {integrity: sha512-XyZoBlYNMvCulK/RmVK/0nB3j7IdH7HpqcrMMg0U+HqQqKRLOQBwvnKNBocPC1bZQ7iZuKWYTLn1ayZwTyek8w==} - engines: {node: '>= 10'} - - '@napi-rs/tar-android-arm-eabi@0.1.1': - resolution: {integrity: sha512-Ufa0ahZvE5KGrC2WBux5svCe/jvC+e8IgtleiicwqnfgTfbDknYyq/QuqkP1AnMp/IvTmx2iutCZt6OFIG0zAg==} - engines: {node: '>= 10'} - cpu: [arm] - os: [android] - - '@napi-rs/tar-android-arm64@0.1.1': - resolution: {integrity: sha512-KUu5fHIiIObSuZ/crHxUrQ243+LiCRKPwdCVLHwjtftqFjzls+R2Mp6GrpM41XxexDMN00SUta3kazi93Xr19A==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [android] - - '@napi-rs/tar-darwin-arm64@0.1.1': - resolution: {integrity: sha512-jaqgdX20iIga+2gzotQ78eF00Cm8vECocUYeMY62WqyzJNv/jx1dlOfELWEccOjpmawFT9tjWebsS9F1QMvSUg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [darwin] - - '@napi-rs/tar-darwin-x64@0.1.1': - resolution: {integrity: sha512-80sa32IxfRso9x9sGTFpfLSx3BnruyJODpSkUzalOCz9i14n5gOKA8KR/JrnSWwDz0p5l5P9kfQD3pu8Voj7WA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [darwin] - - '@napi-rs/tar-freebsd-x64@0.1.1': - resolution: {integrity: sha512-P7V1zBjjC1dCrTwtUzuzYM4AeZduigeCtd8qQw2IUZowM5AsmhMd77oYuXjdU29cEpKUpyYjJRxjPCzFy+WbAQ==} - engines: {node: '>= 10'} - cpu: [x64] - os: [freebsd] - - '@napi-rs/tar-linux-arm-gnueabihf@0.1.1': - resolution: {integrity: sha512-qpC71ILPkWKt8k1iJCYt5gjwcOkd2VFSQIelTRr12t5CVNKV04rE/TMdwFoCP7kxbtb9Fl2cZzCRISw2BhMCmQ==} - engines: {node: '>= 10'} - cpu: [arm] - os: [linux] - - '@napi-rs/tar-linux-arm64-gnu@0.1.1': - resolution: {integrity: sha512-71QgxcFJCog6O4Tauoge8D0ILkDGJTRk3ru7zG8PUFG1QXJ1kkiRikdT77YmoVxtomc9FUOt+bdEdU5Yn+3QUQ==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/tar-linux-arm64-musl@0.1.1': - resolution: {integrity: sha512-R2e7YEILPKc447N1hUt1zQuyy0st83HX6nhmtFywS1aOj76/3hzxLVrebGiiS6kifyCrO82o66CNTYe7DixMZw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/tar-linux-x64-gnu@0.1.1': - resolution: {integrity: sha512-tmy9q2LXUB2GQ+IgUzJn3+us52leplMu96ORyFq1iHQEelGSqXt4xi5DzU07JhX3obJPqVqkybtcRS4enBfmBA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/tar-linux-x64-musl@0.1.1': - resolution: {integrity: sha512-j5ePbe6vihApl0cGPPDUVTWZbf2mF4NhxngAoG2jp7AeX3cWP2O4pjsvaOraW6QfvWEMFPeER7S0b6eBS7duvA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/tar-wasm32-wasi@0.1.1': - resolution: {integrity: sha512-se0+DlOiIRt7mcz7BeOJDoZtCrROpKLwiAOGmNgrjQ/SZS7TnOPuwm3wy9XN9WLoepttEjCEem6UP8yD5GJuQg==} - engines: {node: '>=14.0.0'} - cpu: [wasm32] - - '@napi-rs/tar-win32-arm64-msvc@0.1.1': - resolution: {integrity: sha512-FDZPi2wC7RwzvodogigLh/pJvhqCTVTUqOYuHlLkPSUbSAGiEkI55wk9RqH3y3EdJQaDuzyqC0QKz5ket2U+GA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [win32] - - '@napi-rs/tar-win32-ia32-msvc@0.1.1': - resolution: {integrity: sha512-OPR9Tou5z5M912G7Kc7gkf1ltinbOQx5dS/OeDIWHvPGOfdFDIxt0YVKhzSLRJi43+zIDp8/+cbeMD/cKXfX8w==} - engines: {node: '>= 10'} - cpu: [ia32] - os: [win32] - - '@napi-rs/tar-win32-x64-msvc@0.1.1': - resolution: {integrity: sha512-hiv5KfhrMSg8tTRC2oQXVckVg1h6ZVjwbd5aF9Esl0V3p2TaNFwwbqgnAN4Gm/PmSnHWNL/IRTHkk3cOzDWihQ==} - engines: {node: '>= 10'} - cpu: [x64] - os: [win32] - - '@napi-rs/tar@0.1.1': - resolution: {integrity: sha512-FOMhwwlvoYjHaDBxP26K3D92ltw1Y/CC4CIjgC6qXdzW4MYNwTlEyI58smCM3k+nCVJH3kpOYyH3sgbK4WZA4A==} - engines: {node: '>= 10'} - - '@napi-rs/wasm-runtime@0.2.4': - resolution: {integrity: sha512-9zESzOO5aDByvhIAsOy9TbpZ0Ur2AJbUI7UT73kcUTS2mxAMHOBaa1st/jAymNoCtvrit99kkzT1FZuXVcgfIQ==} - - '@napi-rs/wasm-tools-android-arm-eabi@0.0.2': - resolution: {integrity: sha512-/b+UU3suXjW4P0DzHRNdrnebQtFKcQf/YMeZJH+xUlKgvwli5kbmWjx8Wqqz0VETVkUTuPqJMBDIVLyc+14FGw==} - engines: {node: '>= 10'} - cpu: [arm] - os: [android] - - '@napi-rs/wasm-tools-android-arm64@0.0.2': - resolution: {integrity: sha512-j57GbDflwJdZtT8pZj5fOV4JAP+LdKN+wzsUYs+QRUoBqpWbbUANudolqfw63bkS9sD4z7fbCuz8iwtJqzxTVA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [android] - - '@napi-rs/wasm-tools-darwin-arm64@0.0.2': - resolution: {integrity: sha512-P2ChgWgVuv9GwmbxN89R84KzIImoTqXINteEixUvmkdnhyFiR+I8deNs89Yed+5w8QLC6MEfrtRqLP9YI+NoQA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [darwin] - - '@napi-rs/wasm-tools-darwin-x64@0.0.2': - resolution: {integrity: sha512-T/kQQ0gt8+wau1Z821PKVAD76QhmwVoLs2CT7Z9tTBs2pJvwSCP0C/kQiQAHcJIMi7A2E9Ab/Mez0BERy50EFA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [darwin] - - '@napi-rs/wasm-tools-freebsd-x64@0.0.2': - resolution: {integrity: sha512-GnnHu+r5sfzuxC/1J5UMF/h3BOZnHb3NQZ5hmbCfZYCKzpzRxrAJhzRunlbRN+v0x8M/49dztVTYR3s7K4ooAw==} - engines: {node: '>= 10'} - cpu: [x64] - os: [freebsd] - - '@napi-rs/wasm-tools-linux-arm64-gnu@0.0.2': - resolution: {integrity: sha512-KnZdLT0OnKb1CG2kdt3/WvM43vr9i+FEwXCvSOVC/6Tsifz7ynhMg7LAVESILd03HubzQJfg9nbRsk0bQ+IOwg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/wasm-tools-linux-arm64-musl@0.0.2': - resolution: {integrity: sha512-HkpZOID2U8P6pWqK3mqZ8bxU5xcuT3iA2fO+jrxn78h006iYgfNmdc5JaVhHnHazMmk32xKhSV4iV0VUh8UWDg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/wasm-tools-linux-x64-gnu@0.0.2': - resolution: {integrity: sha512-YksJWBCyOalB9ogtP9+/dZKP+vR6+h7BmzMXaXMT71WW/GvIsifMVgv+DY/FRSNJQupp5Y+ugjqVAOUOc/G65g==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/wasm-tools-linux-x64-musl@0.0.2': - resolution: {integrity: sha512-sPtRxPMdw05KdTcxgSPMmSXG2+PiK3vJ/l2+g9hvjnnKtvslJN2Hr7j8zgzuoKRAUFPaJVe6+D2xVh5cpdqhww==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/wasm-tools-wasm32-wasi@0.0.2': - resolution: {integrity: sha512-muRvZK7AIuo88G2AxYx3gA59rHMQgoN004saQkBvXnz3K/DVHKfTZ6TtUebss8zI3dURU6xExL8drxFWYxjEbQ==} - engines: {node: '>=14.0.0'} - cpu: [wasm32] - - '@napi-rs/wasm-tools-win32-arm64-msvc@0.0.2': - resolution: {integrity: sha512-Cn13WQ+tpFqdVwx0DIWKbsI9auFyzVZV4F5UNOUeDt6GgOL+NndgJul0Pc9bSU6fi03AylMPfF/nTCaDWO2Wgw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [win32] - - '@napi-rs/wasm-tools-win32-ia32-msvc@0.0.2': - resolution: {integrity: sha512-xsg5DkIQi82a8rcx6246Y3XC8TIqHamY+/C6sIlPLaZEuHctDkMECAw0AANwRf5vN//D2oo2oljOuoYtB1GOKw==} - engines: {node: '>= 10'} - cpu: [ia32] - os: [win32] - - '@napi-rs/wasm-tools-win32-x64-msvc@0.0.2': - resolution: {integrity: sha512-yHigltEt33eq8bappvKsIliz4MxfMPn1M+NWbIFRWN+IS1Z57mhmc1osuk+IRXrSlq0Tom0R6MYN1jpkZKz81Q==} - engines: {node: '>= 10'} - cpu: [x64] - os: [win32] - - '@napi-rs/wasm-tools@0.0.2': - resolution: {integrity: sha512-kBvDQCP5BLw2TxTENXLp3Of7vVEx0uyIye824JHE4dduzzOHVgSoOFVhVqAT3Fx/hLV445RVWfEqQbXMg4w/Mw==} - engines: {node: '>= 10'} - - '@nodelib/fs.scandir@2.1.5': - resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} - engines: {node: '>= 8'} - - '@nodelib/fs.stat@2.0.5': - resolution: {integrity: sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==} - engines: {node: '>= 8'} - - '@nodelib/fs.walk@1.2.8': - resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} - engines: {node: '>= 8'} - - '@octokit/auth-token@5.1.1': - resolution: {integrity: sha512-rh3G3wDO8J9wSjfI436JUKzHIxq8NaiL0tVeB2aXmG6p/9859aUOAjA9pmSPNGGZxfwmaJ9ozOJImuNVJdpvbA==} - engines: {node: '>= 18'} - - '@octokit/core@6.1.2': - resolution: {integrity: sha512-hEb7Ma4cGJGEUNOAVmyfdB/3WirWMg5hDuNFVejGEDFqupeOysLc2sG6HJxY2etBp5YQu5Wtxwi020jS9xlUwg==} - engines: {node: '>= 18'} - - '@octokit/endpoint@10.1.1': - resolution: {integrity: sha512-JYjh5rMOwXMJyUpj028cu0Gbp7qe/ihxfJMLc8VZBMMqSwLgOxDI1911gV4Enl1QSavAQNJcwmwBF9M0VvLh6Q==} - engines: {node: '>= 18'} - - '@octokit/graphql@8.1.1': - resolution: {integrity: sha512-ukiRmuHTi6ebQx/HFRCXKbDlOh/7xEV6QUXaE7MJEKGNAncGI/STSbOkl12qVXZrfZdpXctx5O9X1AIaebiDBg==} - engines: {node: '>= 18'} - - '@octokit/openapi-types@22.2.0': - resolution: {integrity: sha512-QBhVjcUa9W7Wwhm6DBFu6ZZ+1/t/oYxqc2tp81Pi41YNuJinbFRx8B133qVOrAaBbF7D/m0Et6f9/pZt9Rc+tg==} - - '@octokit/plugin-paginate-rest@11.3.3': - resolution: {integrity: sha512-o4WRoOJZlKqEEgj+i9CpcmnByvtzoUYC6I8PD2SA95M+BJ2x8h7oLcVOg9qcowWXBOdcTRsMZiwvM3EyLm9AfA==} - engines: {node: '>= 18'} - peerDependencies: - '@octokit/core': '>=6' - - '@octokit/plugin-request-log@5.3.0': - resolution: {integrity: sha512-FiGcyjdtYPlr03ExBk/0ysIlEFIFGJQAVoPPMxL19B24bVSEiZQnVGBunNtaAF1YnvE/EFoDpXmITtRnyCiypQ==} - engines: {node: '>= 18'} - peerDependencies: - '@octokit/core': '>=6' - - '@octokit/plugin-rest-endpoint-methods@13.2.4': - resolution: {integrity: sha512-gusyAVgTrPiuXOdfqOySMDztQHv6928PQ3E4dqVGEtOvRXAKRbJR4b1zQyniIT9waqaWk/UDaoJ2dyPr7Bk7Iw==} - engines: {node: '>= 18'} - peerDependencies: - '@octokit/core': '>=6' - - '@octokit/request-error@6.1.2': - resolution: {integrity: sha512-sA0oF7aL5wXbNfl+7zgLYJiFZctei9GaIMJlTraJrlQyFaoIYr4MCqPSakzxxGCfm8fET4vn0cQdRFmD7avlDg==} - engines: {node: '>= 18'} - - '@octokit/request@9.1.1': - resolution: {integrity: sha512-pyAguc0p+f+GbQho0uNetNQMmLG1e80WjkIaqqgUkihqUp0boRU6nKItXO4VWnr+nbZiLGEyy4TeKRwqaLvYgw==} - engines: {node: '>= 18'} - - '@octokit/rest@21.0.0': - resolution: {integrity: sha512-XudXXOmiIjivdjNZ+fN71NLrnDM00sxSZlhqmPR3v0dVoJwyP628tSlc12xqn8nX3N0965583RBw5GPo6r8u4Q==} - engines: {node: '>= 18'} - - '@octokit/types@13.5.0': - resolution: {integrity: sha512-HdqWTf5Z3qwDVlzCrP8UJquMwunpDiMPt5er+QjGzL4hqr/vBVY/MauQgS1xWxCDT1oMx1EULyqxncdCY/NVSQ==} - - '@rollup/pluginutils@4.2.1': - resolution: {integrity: sha512-iKnFXr7NkdZAIHiIWE+BX5ULi/ucVFYWD6TbAV+rZctiRTY2PL6tsIKhoIOaoskiWAkgu+VsbXgUVDNLHf+InQ==} - engines: {node: '>= 8.0.0'} - - '@sindresorhus/merge-streams@2.3.0': - resolution: {integrity: sha512-LtoMMhxAlorcGhmFYI+LhPgbPZCkgP6ra1YL604EeF6U98pLlQ3iWIGMdWSC+vWmPBWBNgmDBAhnAobLROJmwg==} - engines: {node: '>=18'} - - '@tybys/wasm-util@0.9.0': - resolution: {integrity: sha512-6+7nlbMVX/PVDCwaIQ8nTOPveOcFLSt8GcXdx8hD0bt39uWxYT88uXzqTd4fTvqta7oeUJqudepapKNt2DYJFw==} - - '@types/mute-stream@0.0.4': - resolution: {integrity: sha512-CPM9nzrCPPJHQNA9keH9CVkVI+WR5kMa+7XEs5jcGQ0VoAGnLv242w8lIVgwAEfmE4oufJRaTc9PNLQl0ioAow==} - - '@types/node@20.16.5': - resolution: {integrity: sha512-VwYCweNo3ERajwy0IUlqqcyZ8/A7Zwa9ZP3MnENWcB11AejO+tLy3pu850goUW2FC/IJMdZUfKpX/yxL1gymCA==} - - '@types/node@22.5.4': - resolution: {integrity: sha512-FDuKUJQm/ju9fT/SeX/6+gBzoPzlVCzfzmGkwKvRHQVxi4BntVbyIwf6a4Xn62mrvndLiml6z/UBXIdEVjQLXg==} - - '@types/stylis@4.2.6': - resolution: {integrity: sha512-4nebF2ZJGzQk0ka0O6+FZUWceyFv4vWq/0dXBMmrSeAwzOuOd/GxE5Pa64d/ndeNLG73dXoBsRzvtsVsYUv6Uw==} - - '@types/wrap-ansi@3.0.0': - resolution: {integrity: sha512-ltIpx+kM7g/MLRZfkbL7EsCEjfzCcScLpkg37eXEtx5kmrAKBkTJwd1GIAjDSL8wTpM6Hzn5YO4pSb91BEwu1g==} - - '@vercel/nft@0.26.5': - resolution: {integrity: sha512-NHxohEqad6Ra/r4lGknO52uc/GrWILXAMs1BB4401GTqww0fw1bAqzpG1XHuDO+dprg4GvsD9ZLLSsdo78p9hQ==} - engines: {node: '>=16'} - hasBin: true - - abbrev@1.1.1: - resolution: {integrity: sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==} - - acorn-import-attributes@1.9.5: - resolution: {integrity: sha512-n02Vykv5uA3eHGM/Z2dQrcD56kL8TyDb2p1+0P83PClMnC/nc+anbQRhIOWnSq4Ke/KvDPrY3C9hDtC/A3eHnQ==} - peerDependencies: - acorn: ^8 - - acorn-walk@8.3.3: - resolution: {integrity: sha512-MxXdReSRhGO7VlFe1bRG/oI7/mdLV9B9JJT0N8vZOhF7gFRR5l3M8W9G8JxmKV+JC5mGqJ0QvqfSOLsCPa4nUw==} - engines: {node: '>=0.4.0'} - - acorn@8.12.1: - resolution: {integrity: sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg==} - engines: {node: '>=0.4.0'} - hasBin: true - - agent-base@6.0.2: - resolution: {integrity: sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==} - engines: {node: '>= 6.0.0'} - - ansi-escapes@4.3.2: - resolution: {integrity: sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==} - engines: {node: '>=8'} - - ansi-regex@5.0.1: - resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} - engines: {node: '>=8'} - - ansi-regex@6.0.1: - resolution: {integrity: sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==} - engines: {node: '>=12'} - - ansi-styles@4.3.0: - resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} - engines: {node: '>=8'} - - ansi-styles@6.2.1: - resolution: {integrity: sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==} - engines: {node: '>=12'} - - aproba@2.0.0: - resolution: {integrity: sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==} - - are-we-there-yet@2.0.0: - resolution: {integrity: sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw==} - engines: {node: '>=10'} - deprecated: This package is no longer supported. - - argparse@1.0.10: - resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==} - - argparse@2.0.1: - resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} - - array-find-index@1.0.2: - resolution: {integrity: sha512-M1HQyIXcBGtVywBt8WVdim+lrNaK7VHp99Qt5pSNziXznKHViIBbXWtfRTpEFpF/c4FdfxNAsCCwPp5phBYJtw==} - engines: {node: '>=0.10.0'} - - arrgv@1.0.2: - resolution: {integrity: sha512-a4eg4yhp7mmruZDQFqVMlxNRFGi/i1r87pt8SDHy0/I8PqSXoUTlWZRdAZo0VXgvEARcujbtTk8kiZRi1uDGRw==} - engines: {node: '>=8.0.0'} - - arrify@3.0.0: - resolution: {integrity: sha512-tLkvA81vQG/XqE2mjDkGQHoOINtMHtysSnemrmoGe6PydDPMRbVugqyk4A6V/WDWEfm3l+0d8anA9r8cv/5Jaw==} - engines: {node: '>=12'} - - async-sema@3.1.1: - resolution: {integrity: sha512-tLRNUXati5MFePdAk8dw7Qt7DpxPB60ofAgn8WRhW6a2rcimZnYBP9oxHiv0OHy+Wz7kPMG+t4LGdt31+4EmGg==} - - asynckit@0.4.0: - resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} - - ava@6.1.3: - resolution: {integrity: sha512-tkKbpF1pIiC+q09wNU9OfyTDYZa8yuWvU2up3+lFJ3lr1RmnYh2GBpPwzYUEB0wvTPIUysGjcZLNZr7STDviRA==} - engines: {node: ^18.18 || ^20.8 || ^21 || ^22} - hasBin: true - peerDependencies: - '@ava/typescript': '*' - peerDependenciesMeta: - '@ava/typescript': - optional: true - - axios@1.6.2: - resolution: {integrity: sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A==} - - balanced-match@1.0.2: - resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} - - before-after-hook@3.0.2: - resolution: {integrity: sha512-Nik3Sc0ncrMK4UUdXQmAnRtzmNQTAAXmXIopizwZ1W1t8QmfJj+zL4OA2I7XPTPW5z5TDqv4hRo/JzouDJnX3A==} - - bindings@1.5.0: - resolution: {integrity: sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==} - - blueimp-md5@2.19.0: - resolution: {integrity: sha512-DRQrD6gJyy8FbiE4s+bDoXS9hiW3Vbx5uCdwvcCf3zLHL+Iv7LtGHLpr+GZV8rHG8tK766FGYBwRbu8pELTt+w==} - - brace-expansion@1.1.11: - resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} - - braces@3.0.3: - resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==} - engines: {node: '>=8'} - - callsites@4.2.0: - resolution: {integrity: sha512-kfzR4zzQtAE9PC7CzZsjl3aBNbXWuXiSeOCdLcPpBfGW8YuCqQHcRPFDbr/BPVmd3EEPVpuFzLyuT/cUhPr4OQ==} - engines: {node: '>=12.20'} - - camelize@1.0.1: - resolution: {integrity: sha512-dU+Tx2fsypxTgtLoE36npi3UqcjSSMNYfkqgmoEhtZrraP5VWq0K7FkWVTYa8eMPtnU/G2txVsfdCJTn9uzpuQ==} - - cbor@9.0.2: - resolution: {integrity: sha512-JPypkxsB10s9QOWwa6zwPzqE1Md3vqpPc+cai4sAecuCsRyAtAl/pMyhPlMbT/xtPnm2dznJZYRLui57qiRhaQ==} - engines: {node: '>=16'} - - chalk@5.3.0: - resolution: {integrity: sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==} - engines: {node: ^12.17.0 || ^14.13 || >=16.0.0} - - chardet@0.7.0: - resolution: {integrity: sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==} - - chownr@2.0.0: - resolution: {integrity: sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==} - engines: {node: '>=10'} - - chunkd@2.0.1: - resolution: {integrity: sha512-7d58XsFmOq0j6el67Ug9mHf9ELUXsQXYJBkyxhH/k+6Ke0qXRnv0kbemx+Twc6fRJ07C49lcbdgm9FL1Ei/6SQ==} - - ci-info@4.0.0: - resolution: {integrity: sha512-TdHqgGf9odd8SXNuxtUBVx8Nv+qZOejE6qyqiy5NtbYYQOeFa6zmHkxlPzmaLxWWHsU6nJmB7AETdVPi+2NBUg==} - engines: {node: '>=8'} - - ci-parallel-vars@1.0.1: - resolution: {integrity: sha512-uvzpYrpmidaoxvIQHM+rKSrigjOe9feHYbw4uOI2gdfe1C3xIlxO+kVXq83WQWNniTf8bAxVpy+cQeFQsMERKg==} - - cli-spinners@2.9.2: - resolution: {integrity: sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==} - engines: {node: '>=6'} - - cli-truncate@4.0.0: - resolution: {integrity: sha512-nPdaFdQ0h/GEigbPClz11D0v/ZJEwxmeVZGeMo3Z5StPtUTkA9o1lD6QwoirYiSDzbcwn2XcjwmCp68W1IS4TA==} - engines: {node: '>=18'} - - cli-width@4.1.0: - resolution: {integrity: sha512-ouuZd4/dm2Sw5Gmqy6bGyNNNe1qt9RpmxveLSO7KcgsTnU7RXfsw+/bukWGo1abgBiMAic068rclZsO4IWmmxQ==} - engines: {node: '>= 12'} - - clipanion@3.2.1: - resolution: {integrity: sha512-dYFdjLb7y1ajfxQopN05mylEpK9ZX0sO1/RfMXdfmwjlIsPkbh4p7A682x++zFPLDCo1x3p82dtljHf5cW2LKA==} - peerDependencies: - typanion: '*' - - cliui@8.0.1: - resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==} - engines: {node: '>=12'} - - code-excerpt@4.0.0: - resolution: {integrity: sha512-xxodCmBen3iy2i0WtAK8FlFNrRzjUqjRsMfho58xT/wvZU1YTM3fCnRjcy1gJPMepaRlgm/0e6w8SpWHpn3/cA==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - color-convert@2.0.1: - resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} - engines: {node: '>=7.0.0'} - - color-name@1.1.4: - resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} - - color-support@1.1.3: - resolution: {integrity: sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==} - hasBin: true - - colorette@2.0.20: - resolution: {integrity: sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==} - - combined-stream@1.0.8: - resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} - engines: {node: '>= 0.8'} - - common-path-prefix@3.0.0: - resolution: {integrity: sha512-QE33hToZseCH3jS0qN96O/bSh3kaw/h+Tq7ngyY9eWDUnTlTNUyqfqvCXioLe5Na5jFsL78ra/wuBU4iuEgd4w==} - - concat-map@0.0.1: - resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} - - concordance@5.0.4: - resolution: {integrity: sha512-OAcsnTEYu1ARJqWVGwf4zh4JDfHZEaSNlNccFmt8YjB2l/n19/PF2viLINHc57vO4FKIAFl2FWASIGZZWZ2Kxw==} - engines: {node: '>=10.18.0 <11 || >=12.14.0 <13 || >=14'} - - console-control-strings@1.1.0: - resolution: {integrity: sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==} - - convert-to-spaces@2.0.1: - resolution: {integrity: sha512-rcQ1bsQO9799wq24uE5AM2tAILy4gXGIK/njFWcVQkGNZ96edlpY+A7bjwvzjYvLDyzmG1MmMLZhpcsb+klNMQ==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - css-color-keywords@1.0.0: - resolution: {integrity: sha512-FyyrDHZKEjXDpNJYvVsV960FiqQyXc/LlYmsxl2BcdMb2WPx0OGRVgTg55rPSyLSNMqP52R9r8geSp7apN3Ofg==} - engines: {node: '>=4'} - - css-to-react-native@3.2.0: - resolution: {integrity: sha512-e8RKaLXMOFii+02mOlqwjbD00KSEKqblnpO9e++1aXS1fPQOpS1YoqdVHBqPjHNoxeF2mimzVqawm2KCbEdtHQ==} - - csstype@3.1.3: - resolution: {integrity: sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==} - - currently-unhandled@0.4.1: - resolution: {integrity: sha512-/fITjgjGU50vjQ4FH6eUoYu+iUoUKIXws2hL15JJpIR+BbTxaXQsMuuyjtNh2WqsSBS5nsaZHFsFecyw5CCAng==} - engines: {node: '>=0.10.0'} - - date-time@3.1.0: - resolution: {integrity: sha512-uqCUKXE5q1PNBXjPqvwhwJf9SwMoAHBgWJ6DcrnS5o+W2JOiIILl0JEdVD8SGujrNS02GGxgwAg2PN2zONgtjg==} - engines: {node: '>=6'} - - debug@4.3.5: - resolution: {integrity: sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg==} - engines: {node: '>=6.0'} - peerDependencies: - supports-color: '*' - peerDependenciesMeta: - supports-color: - optional: true - - delayed-stream@1.0.0: - resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} - engines: {node: '>=0.4.0'} - - delegates@1.0.0: - resolution: {integrity: sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==} - - detect-libc@2.0.3: - resolution: {integrity: sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw==} - engines: {node: '>=8'} - - emittery@1.0.3: - resolution: {integrity: sha512-tJdCJitoy2lrC2ldJcqN4vkqJ00lT+tOWNT1hBJjO/3FDMJa5TTIiYGCKGkn/WfCyOzUMObeohbVTj00fhiLiA==} - engines: {node: '>=14.16'} - - emnapi@1.2.0: - resolution: {integrity: sha512-rcq+dJCcfr08I0XM/57LPRqaUokGfni/+SvhO7NaJthTTjRdohhIy0FQwyC5rR1enAsjkldQg83th8J5hURv0Q==} - peerDependencies: - node-addon-api: '>= 6.1.0' - peerDependenciesMeta: - node-addon-api: - optional: true - - emoji-regex@10.3.0: - resolution: {integrity: sha512-QpLs9D9v9kArv4lfDEgg1X/gN5XLnf/A6l9cs8SPZLRZR3ZkY9+kwIQTxm+fsSej5UMYGE8fdoaZVIBlqG0XTw==} - - emoji-regex@8.0.0: - resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} - - escalade@3.1.2: - resolution: {integrity: sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==} - engines: {node: '>=6'} - - escape-string-regexp@2.0.0: - resolution: {integrity: sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==} - engines: {node: '>=8'} - - escape-string-regexp@5.0.0: - resolution: {integrity: sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==} - engines: {node: '>=12'} - - esprima@4.0.1: - resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==} - engines: {node: '>=4'} - hasBin: true - - estree-walker@2.0.2: - resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==} - - esutils@2.0.3: - resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} - engines: {node: '>=0.10.0'} - - external-editor@3.1.0: - resolution: {integrity: sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==} - engines: {node: '>=4'} - - fast-diff@1.3.0: - resolution: {integrity: sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==} - - fast-glob@3.3.2: - resolution: {integrity: sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==} - engines: {node: '>=8.6.0'} - - fastq@1.17.1: - resolution: {integrity: sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==} - - figures@6.1.0: - resolution: {integrity: sha512-d+l3qxjSesT4V7v2fh+QnmFnUWv9lSpjarhShNTgBOfA0ttejbQUAlHLitbjkoRiDulW0OPoQPYIGhIC8ohejg==} - engines: {node: '>=18'} - - file-uri-to-path@1.0.0: - resolution: {integrity: sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==} - - fill-range@7.1.1: - resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==} - engines: {node: '>=8'} - - find-up-simple@1.0.0: - resolution: {integrity: sha512-q7Us7kcjj2VMePAa02hDAF6d+MzsdsAWEwYyOpwUtlerRBkOEPBCRZrAV4XfcSN8fHAgaD0hP7miwoay6DCprw==} - engines: {node: '>=18'} - - follow-redirects@1.15.6: - resolution: {integrity: sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==} - engines: {node: '>=4.0'} - peerDependencies: - debug: '*' - peerDependenciesMeta: - debug: - optional: true - - form-data@4.0.0: - resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==} - engines: {node: '>= 6'} - - fs-minipass@2.1.0: - resolution: {integrity: sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==} - engines: {node: '>= 8'} - - fs.realpath@1.0.0: - resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} - - gauge@3.0.2: - resolution: {integrity: sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q==} - engines: {node: '>=10'} - deprecated: This package is no longer supported. - - get-caller-file@2.0.5: - resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} - engines: {node: 6.* || 8.* || >= 10.*} - - get-east-asian-width@1.2.0: - resolution: {integrity: sha512-2nk+7SIVb14QrgXFHcm84tD4bKQz0RxPuMT8Ag5KPOq7J5fEmAg0UbXdTOSHqNuHSU28k55qnceesxXRZGzKWA==} - engines: {node: '>=18'} - - glob-parent@5.1.2: - resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} - engines: {node: '>= 6'} - - glob@7.2.3: - resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} - deprecated: Glob versions prior to v9 are no longer supported - - globby@14.0.2: - resolution: {integrity: sha512-s3Fq41ZVh7vbbe2PN3nrW7yC7U7MFVc5c98/iTl9c2GawNMKx/J648KQRW6WKkuU8GIbbh2IXfIRQjOZnXcTnw==} - engines: {node: '>=18'} - - graceful-fs@4.2.11: - resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} - - has-unicode@2.0.1: - resolution: {integrity: sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==} - - https-proxy-agent@5.0.1: - resolution: {integrity: sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==} - engines: {node: '>= 6'} - - iconv-lite@0.4.24: - resolution: {integrity: sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==} - engines: {node: '>=0.10.0'} - - ignore-by-default@2.1.0: - resolution: {integrity: sha512-yiWd4GVmJp0Q6ghmM2B/V3oZGRmjrKLXvHR3TE1nfoXsmoggllfZUQe74EN0fJdPFZu2NIvNdrMMLm3OsV7Ohw==} - engines: {node: '>=10 <11 || >=12 <13 || >=14'} - - ignore@5.3.1: - resolution: {integrity: sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==} - engines: {node: '>= 4'} - - imurmurhash@0.1.4: - resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} - engines: {node: '>=0.8.19'} - - indent-string@5.0.0: - resolution: {integrity: sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==} - engines: {node: '>=12'} - - inflight@1.0.6: - resolution: {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. - - inherits@2.0.4: - resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} - - inquirer@10.0.1: - resolution: {integrity: sha512-XgthhRIn0Ci9JdGJpUo2EtpPfaczbooZbGTN+FTzSCyUb7YHJcPPnuSXfeG5903bJMy3OyEoVTQMnvO4Ly5tFg==} - engines: {node: '>=18'} - - ipaddr.js@2.2.0: - resolution: {integrity: sha512-Ag3wB2o37wslZS19hZqorUnrnzSkpOVy+IiiDEiTqNubEYpYuHWIf6K4psgN2ZWKExS4xhVCrRVfb/wfW8fWJA==} - engines: {node: '>= 10'} - - irregular-plurals@3.5.0: - resolution: {integrity: sha512-1ANGLZ+Nkv1ptFb2pa8oG8Lem4krflKuX/gINiHJHjJUKaJHk/SXk5x6K3J+39/p0h1RQ2saROclJJ+QLvETCQ==} - engines: {node: '>=8'} - - is-extglob@2.1.1: - resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} - engines: {node: '>=0.10.0'} - - is-fullwidth-code-point@3.0.0: - resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} - engines: {node: '>=8'} - - is-fullwidth-code-point@4.0.0: - resolution: {integrity: sha512-O4L094N2/dZ7xqVdrXhh9r1KODPJpFms8B5sGdJLPy664AgvXsreZUyCQQNItZRDlYug4xStLjNp/sz3HvBowQ==} - engines: {node: '>=12'} - - is-glob@4.0.3: - resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} - engines: {node: '>=0.10.0'} - - is-number@7.0.0: - resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} - engines: {node: '>=0.12.0'} - - is-plain-object@5.0.0: - resolution: {integrity: sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==} - engines: {node: '>=0.10.0'} - - is-promise@4.0.0: - resolution: {integrity: sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==} - - is-unicode-supported@2.0.0: - resolution: {integrity: sha512-FRdAyx5lusK1iHG0TWpVtk9+1i+GjrzRffhDg4ovQ7mcidMQ6mj+MhKPmvh7Xwyv5gIS06ns49CA7Sqg7lC22Q==} - engines: {node: '>=18'} - - js-string-escape@1.0.1: - resolution: {integrity: sha512-Smw4xcfIQ5LVjAOuJCvN/zIodzA/BBSsluuoSykP+lUvScIi4U6RJLfwHet5cxFnCswUjISV8oAXaqaJDY3chg==} - engines: {node: '>= 0.8'} - - js-tokens@4.0.0: - resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} - - js-yaml@3.14.1: - resolution: {integrity: sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==} - hasBin: true - - js-yaml@4.1.0: - resolution: {integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==} - hasBin: true - - load-json-file@7.0.1: - resolution: {integrity: sha512-Gnxj3ev3mB5TkVBGad0JM6dmLiQL+o0t23JPBZ9sd+yvSLk05mFoqKBw5N8gbbkU4TNXyqCgIrl/VM17OgUIgQ==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - lodash-es@4.17.21: - resolution: {integrity: sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==} - - lodash@4.17.21: - resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} - - loose-envify@1.4.0: - resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==} - hasBin: true - - make-dir@3.1.0: - resolution: {integrity: sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==} - engines: {node: '>=8'} - - matcher@5.0.0: - resolution: {integrity: sha512-s2EMBOWtXFc8dgqvoAzKJXxNHibcdJMV0gwqKUaw9E2JBJuGUK7DrNKrA6g/i+v72TT16+6sVm5mS3thaMLQUw==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - md5-hex@3.0.1: - resolution: {integrity: sha512-BUiRtTtV39LIJwinWBjqVsU9xhdnz7/i889V859IBFpuqGAj6LuOvHv5XLbgZ2R7ptJoJaEcxkv88/h25T7Ciw==} - engines: {node: '>=8'} - - memoize@10.0.0: - resolution: {integrity: sha512-H6cBLgsi6vMWOcCpvVCdFFnl3kerEXbrYh9q+lY6VXvQSmM6CkmV08VOwT+WE2tzIEqRPFfAq3fm4v/UIW6mSA==} - engines: {node: '>=18'} - - merge2@1.4.1: - resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} - engines: {node: '>= 8'} - - micromatch@4.0.7: - resolution: {integrity: sha512-LPP/3KorzCwBxfeUuZmaR6bG2kdeHSbe0P2tY3FLRU4vYrjYz5hI4QZwV0njUx3jeuKe67YukQ1LSPZBKDqO/Q==} - engines: {node: '>=8.6'} - - mime-db@1.52.0: - resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} - engines: {node: '>= 0.6'} - - mime-types@2.1.35: - resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} - engines: {node: '>= 0.6'} - - mimic-function@5.0.1: - resolution: {integrity: sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==} - engines: {node: '>=18'} - - minimatch@3.1.2: - resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} - - minipass@3.3.6: - resolution: {integrity: sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==} - engines: {node: '>=8'} - - minipass@5.0.0: - resolution: {integrity: sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==} - engines: {node: '>=8'} - - minizlib@2.1.2: - resolution: {integrity: sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==} - engines: {node: '>= 8'} - - mkdirp@1.0.4: - resolution: {integrity: sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==} - engines: {node: '>=10'} - hasBin: true - - ms@2.1.2: - resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} - - ms@2.1.3: - resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} - - mute-stream@1.0.0: - resolution: {integrity: sha512-avsJQhyd+680gKXyG/sQc0nXaC6rBkPOfyHYcFb9+hdkqQkR9bdnkJ0AMZhke0oesPqIO+mFFJ+IdBc7mst4IA==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - - nanoid@3.3.7: - resolution: {integrity: sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==} - engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} - hasBin: true - - node-fetch@2.7.0: - resolution: {integrity: sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==} - engines: {node: 4.x || >=6.0.0} - peerDependencies: - encoding: ^0.1.0 - peerDependenciesMeta: - encoding: - optional: true - - node-gyp-build@4.8.1: - resolution: {integrity: sha512-OSs33Z9yWr148JZcbZd5WiAXhh/n9z8TxQcdMhIOlpN9AhWpLfvVFO73+m77bBABQMaY9XSvIa+qk0jlI7Gcaw==} - hasBin: true - - nofilter@3.1.0: - resolution: {integrity: sha512-l2NNj07e9afPnhAhvgVrCD/oy2Ai1yfLpuo3EpiO1jFTsB4sFz6oIfAfSZyQzVpkZQ9xS8ZS5g1jCBgq4Hwo0g==} - engines: {node: '>=12.19'} - - nopt@5.0.0: - resolution: {integrity: sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==} - engines: {node: '>=6'} - hasBin: true - - npmlog@5.0.1: - resolution: {integrity: sha512-AqZtDUWOMKs1G/8lwylVjrdYgqA4d9nu8hc+0gzRxlDb1I10+FHBGMXs6aiQHFdCUUlqH99MUMuLfzWDNDtfxw==} - deprecated: This package is no longer supported. - - object-assign@4.1.1: - resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} - engines: {node: '>=0.10.0'} - - once@1.4.0: - resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} - - os-tmpdir@1.0.2: - resolution: {integrity: sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==} - engines: {node: '>=0.10.0'} - - p-map@7.0.2: - resolution: {integrity: sha512-z4cYYMMdKHzw4O5UkWJImbZynVIo0lSGTXc7bzB1e/rrDqkgGUNysK/o4bTr+0+xKvvLoTyGqYC4Fgljy9qe1Q==} - engines: {node: '>=18'} - - package-config@5.0.0: - resolution: {integrity: sha512-GYTTew2slBcYdvRHqjhwaaydVMvn/qrGC323+nKclYioNSLTDUM/lGgtGTgyHVtYcozb+XkE8CNhwcraOmZ9Mg==} - engines: {node: '>=18'} - - parse-ms@4.0.0: - resolution: {integrity: sha512-TXfryirbmq34y8QBwgqCVLi+8oA3oWx2eAnSn62ITyEhEYaWRlVZ2DvMM9eZbMs/RfxPu/PK/aBLyGj4IrqMHw==} - engines: {node: '>=18'} - - path-is-absolute@1.0.1: - resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==} - engines: {node: '>=0.10.0'} - - path-type@5.0.0: - resolution: {integrity: sha512-5HviZNaZcfqP95rwpv+1HDgUamezbqdSYTyzjTvwtJSnIH+3vnbmWsItli8OFEndS984VT55M3jduxZbX351gg==} - engines: {node: '>=12'} - - picocolors@1.0.1: - resolution: {integrity: sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==} - - picomatch@2.3.1: - resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} - engines: {node: '>=8.6'} - - picomatch@3.0.1: - resolution: {integrity: sha512-I3EurrIQMlRc9IaAZnqRR044Phh2DXY+55o7uJ0V+hYZAcQYSuFWsc9q5PvyDHUSCe1Qxn/iBz+78s86zWnGag==} - engines: {node: '>=10'} - - plur@5.1.0: - resolution: {integrity: sha512-VP/72JeXqak2KiOzjgKtQen5y3IZHn+9GOuLDafPv0eXa47xq0At93XahYBs26MsifCQ4enGKwbjBTKgb9QJXg==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - postcss-value-parser@4.2.0: - resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==} - - postcss@8.4.33: - resolution: {integrity: sha512-Kkpbhhdjw2qQs2O2DGX+8m5OVqEcbB9HRBvuYM9pgrjEFUg30A9LmXNlTAUj4S9kgtGyrMbTzVjH7E+s5Re2yg==} - engines: {node: ^10 || ^12 || >=14} - - pretty-ms@9.0.0: - resolution: {integrity: sha512-E9e9HJ9R9NasGOgPaPE8VMeiPKAyWR5jcFpNnwIejslIhWqdqOrb2wShBsncMPUb+BcCd2OPYfh7p2W6oemTng==} - engines: {node: '>=18'} - - proxy-from-env@1.1.0: - resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==} - - queue-microtask@1.2.3: - resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} - - react-dom@18.3.1: - resolution: {integrity: sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==} - peerDependencies: - react: ^18.3.1 - - react@18.3.1: - resolution: {integrity: sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==} - engines: {node: '>=0.10.0'} - - readable-stream@3.6.2: - resolution: {integrity: sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==} - engines: {node: '>= 6'} - - require-directory@2.1.1: - resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} - engines: {node: '>=0.10.0'} - - resolve-cwd@3.0.0: - resolution: {integrity: sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==} - engines: {node: '>=8'} - - resolve-from@5.0.0: - resolution: {integrity: sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==} - engines: {node: '>=8'} - - reusify@1.0.4: - resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==} - engines: {iojs: '>=1.0.0', node: '>=0.10.0'} - - rimraf@3.0.2: - resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==} - deprecated: Rimraf versions prior to v4 are no longer supported - hasBin: true - - run-async@3.0.0: - resolution: {integrity: sha512-540WwVDOMxA6dN6We19EcT9sc3hkXPw5mzRNGM3FkdN/vtE9NFvj5lFAPNwUDmJjXidm3v7TC1cTE7t17Ulm1Q==} - engines: {node: '>=0.12.0'} - - run-parallel@1.2.0: - resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} - - rxjs@7.8.1: - resolution: {integrity: sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==} - - safe-buffer@5.2.1: - resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} - - safer-buffer@2.1.2: - resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} - - scheduler@0.23.2: - resolution: {integrity: sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ==} - - semver@6.3.1: - resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} - hasBin: true - - semver@7.6.2: - resolution: {integrity: sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==} - engines: {node: '>=10'} - hasBin: true - - serialize-error@7.0.1: - resolution: {integrity: sha512-8I8TjW5KMOKsZQTvoxjuSIa7foAwPWGOts+6o7sgjz41/qMD9VQHEDxi6PBvK2l0MXUmqZyNpUK+T2tQaaElvw==} - engines: {node: '>=10'} - - set-blocking@2.0.0: - resolution: {integrity: sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==} - - shallowequal@1.1.0: - resolution: {integrity: sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ==} - - signal-exit@3.0.7: - resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} - - signal-exit@4.1.0: - resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} - engines: {node: '>=14'} - - slash@5.1.0: - resolution: {integrity: sha512-ZA6oR3T/pEyuqwMgAKT0/hAv8oAXckzbkmR0UkUosQ+Mc4RxGoJkRmwHgHufaenlyAgE1Mxgpdcrf75y6XcnDg==} - engines: {node: '>=14.16'} - - slice-ansi@5.0.0: - resolution: {integrity: sha512-FC+lgizVPfie0kkhqUScwRu1O/lF6NOgJmlCgK+/LYxDCTk8sGelYaHDhFcDN+Sn3Cv+3VSa4Byeo+IMCzpMgQ==} - engines: {node: '>=12'} - - source-map-js@1.2.0: - resolution: {integrity: sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==} - engines: {node: '>=0.10.0'} - - sprintf-js@1.0.3: - resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==} - - stack-utils@2.0.6: - resolution: {integrity: sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==} - engines: {node: '>=10'} - - string-width@4.2.3: - resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} - engines: {node: '>=8'} - - string-width@7.2.0: - resolution: {integrity: sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==} - engines: {node: '>=18'} - - string_decoder@1.3.0: - resolution: {integrity: sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==} - - strip-ansi@6.0.1: - resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} - engines: {node: '>=8'} - - strip-ansi@7.1.0: - resolution: {integrity: sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==} - engines: {node: '>=12'} - - styled-components@6.1.1: - resolution: {integrity: sha512-cpZZP5RrKRIClBW5Eby4JM1wElLVP4NQrJbJ0h10TidTyJf4SIIwa3zLXOoPb4gJi8MsJ8mjq5mu2IrEhZIAcQ==} - engines: {node: '>= 16'} - peerDependencies: - react: '>= 16.8.0' - react-dom: '>= 16.8.0' - - stylis@4.3.2: - resolution: {integrity: sha512-bhtUjWd/z6ltJiQwg0dUfxEJ+W+jdqQd8TbWLWyeIJHlnsqmGLRFFd8e5mA0AZi/zx90smXRlN66YMTcaSFifg==} - - supertap@3.0.1: - resolution: {integrity: sha512-u1ZpIBCawJnO+0QePsEiOknOfCRq0yERxiAchT0i4li0WHNUJbf0evXXSXOcCAR4M8iMDoajXYmstm/qO81Isw==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - tar@6.2.1: - resolution: {integrity: sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==} - engines: {node: '>=10'} - - temp-dir@3.0.0: - resolution: {integrity: sha512-nHc6S/bwIilKHNRgK/3jlhDoIHcp45YgyiwcAk46Tr0LfEqGBVpmiAyuiuxeVE44m3mXnEeVhaipLOEWmH+Njw==} - engines: {node: '>=14.16'} - - time-zone@1.0.0: - resolution: {integrity: sha512-TIsDdtKo6+XrPtiTm1ssmMngN1sAhyKnTO2kunQWqNPWIVvCm15Wmw4SWInwTVgJ5u/Tr04+8Ei9TNcw4x4ONA==} - engines: {node: '>=4'} - - tmp@0.0.33: - resolution: {integrity: sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==} - engines: {node: '>=0.6.0'} - - to-regex-range@5.0.1: - resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} - engines: {node: '>=8.0'} - - toml@3.0.0: - resolution: {integrity: sha512-y/mWCZinnvxjTKYhJ+pYxwD0mRLVvOtdS2Awbgxln6iEnt4rk0yBxeSBHkGJcPucRiG0e55mwWp+g/05rsrd6w==} - - tr46@0.0.3: - resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==} - - tslib@2.6.3: - resolution: {integrity: sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ==} - - typanion@3.14.0: - resolution: {integrity: sha512-ZW/lVMRabETuYCd9O9ZvMhAh8GslSqaUjxmK/JLPCh6l73CvLBiuXswj/+7LdnWOgYsQ130FqLzFz5aGT4I3Ug==} - - type-fest@0.13.1: - resolution: {integrity: sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==} - engines: {node: '>=10'} - - type-fest@0.21.3: - resolution: {integrity: sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==} - engines: {node: '>=10'} - - typescript@5.5.4: - resolution: {integrity: sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q==} - engines: {node: '>=14.17'} - hasBin: true - - undici-types@6.19.8: - resolution: {integrity: sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==} - - unicorn-magic@0.1.0: - resolution: {integrity: sha512-lRfVq8fE8gz6QMBuDM6a+LO3IAzTi05H6gCVaUpir2E1Rwpo4ZUog45KpNXKC/Mn3Yb9UDuHumeFTo9iV/D9FQ==} - engines: {node: '>=18'} - - universal-user-agent@7.0.2: - resolution: {integrity: sha512-0JCqzSKnStlRRQfCdowvqy3cy0Dvtlb8xecj/H8JFZuCze4rwjPZQOgvFvn0Ws/usCHQFGpyr+pB9adaGwXn4Q==} - - util-deprecate@1.0.2: - resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} - - wasm-sjlj@1.0.5: - resolution: {integrity: sha512-Z/MHJeOkAvJJVWnGX3/YZGYldGaawZbYHX4ldYG9kLhcdB8H31F5x66M7Zc4BP/7pg0aLsusQj1629m2B3Rilg==} - - webidl-conversions@3.0.1: - resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==} - - well-known-symbols@2.0.0: - resolution: {integrity: sha512-ZMjC3ho+KXo0BfJb7JgtQ5IBuvnShdlACNkKkdsqBmYw3bPAaJfPeYUo6tLUaT5tG/Gkh7xkpBhKRQ9e7pyg9Q==} - engines: {node: '>=6'} - - whatwg-url@5.0.0: - resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==} - - wide-align@1.1.5: - resolution: {integrity: sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==} - - wrap-ansi@6.2.0: - resolution: {integrity: sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==} - engines: {node: '>=8'} - - wrap-ansi@7.0.0: - resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==} - engines: {node: '>=10'} - - wrappy@1.0.2: - resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} - - write-file-atomic@5.0.1: - resolution: {integrity: sha512-+QU2zd6OTD8XWIJCbffaiQeH9U73qIqafo1x6V1snCWYGJf6cVE0cDR4D8xRzcEnfI21IFrUPzPGtcPf8AC+Rw==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - - y18n@5.0.8: - resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==} - engines: {node: '>=10'} - - yallist@4.0.0: - resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==} - - yargs-parser@21.1.1: - resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} - engines: {node: '>=12'} - - yargs@17.7.2: - resolution: {integrity: sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==} - engines: {node: '>=12'} - - yoctocolors-cjs@2.1.2: - resolution: {integrity: sha512-cYVsTjKl8b+FrnidjibDWskAv7UKOfcwaVZdp/it9n1s9fU3IkgDbhdIRKCW4JDsAlECJY0ytoVPT3sK6kideA==} - engines: {node: '>=18'} - -snapshots: - - '@emnapi/core@1.2.0': - dependencies: - '@emnapi/wasi-threads': 1.0.1 - tslib: 2.6.3 - - '@emnapi/runtime@1.2.0': - dependencies: - tslib: 2.6.3 - - '@emnapi/wasi-threads@1.0.1': - dependencies: - tslib: 2.6.3 - - '@emotion/is-prop-valid@1.2.2': - dependencies: - '@emotion/memoize': 0.8.1 - - '@emotion/memoize@0.8.1': {} - - '@emotion/unitless@0.8.1': {} - - '@inquirer/checkbox@2.3.10': - dependencies: - '@inquirer/core': 9.0.2 - '@inquirer/figures': 1.0.3 - '@inquirer/type': 1.4.0 - ansi-escapes: 4.3.2 - yoctocolors-cjs: 2.1.2 - - '@inquirer/confirm@3.1.14': - dependencies: - '@inquirer/core': 9.0.2 - '@inquirer/type': 1.4.0 - - '@inquirer/core@9.0.2': - dependencies: - '@inquirer/figures': 1.0.3 - '@inquirer/type': 1.4.0 - '@types/mute-stream': 0.0.4 - '@types/node': 20.16.5 - '@types/wrap-ansi': 3.0.0 - ansi-escapes: 4.3.2 - cli-spinners: 2.9.2 - cli-width: 4.1.0 - mute-stream: 1.0.0 - signal-exit: 4.1.0 - strip-ansi: 6.0.1 - wrap-ansi: 6.2.0 - yoctocolors-cjs: 2.1.2 - - '@inquirer/editor@2.1.14': - dependencies: - '@inquirer/core': 9.0.2 - '@inquirer/type': 1.4.0 - external-editor: 3.1.0 - - '@inquirer/expand@2.1.14': - dependencies: - '@inquirer/core': 9.0.2 - '@inquirer/type': 1.4.0 - yoctocolors-cjs: 2.1.2 - - '@inquirer/figures@1.0.3': {} - - '@inquirer/input@2.2.1': - dependencies: - '@inquirer/core': 9.0.2 - '@inquirer/type': 1.4.0 - - '@inquirer/number@1.0.2': - dependencies: - '@inquirer/core': 9.0.2 - '@inquirer/type': 1.4.0 - - '@inquirer/password@2.1.14': - dependencies: - '@inquirer/core': 9.0.2 - '@inquirer/type': 1.4.0 - ansi-escapes: 4.3.2 - - '@inquirer/prompts@5.1.2': - dependencies: - '@inquirer/checkbox': 2.3.10 - '@inquirer/confirm': 3.1.14 - '@inquirer/editor': 2.1.14 - '@inquirer/expand': 2.1.14 - '@inquirer/input': 2.2.1 - '@inquirer/number': 1.0.2 - '@inquirer/password': 2.1.14 - '@inquirer/rawlist': 2.1.14 - '@inquirer/select': 2.3.10 - - '@inquirer/rawlist@2.1.14': - dependencies: - '@inquirer/core': 9.0.2 - '@inquirer/type': 1.4.0 - yoctocolors-cjs: 2.1.2 - - '@inquirer/select@2.3.10': - dependencies: - '@inquirer/core': 9.0.2 - '@inquirer/figures': 1.0.3 - '@inquirer/type': 1.4.0 - ansi-escapes: 4.3.2 - yoctocolors-cjs: 2.1.2 - - '@inquirer/type@1.4.0': - dependencies: - mute-stream: 1.0.0 - - '@mapbox/node-pre-gyp@1.0.11': - dependencies: - detect-libc: 2.0.3 - https-proxy-agent: 5.0.1 - make-dir: 3.1.0 - node-fetch: 2.7.0 - nopt: 5.0.0 - npmlog: 5.0.1 - rimraf: 3.0.2 - semver: 7.6.2 - tar: 6.2.1 - transitivePeerDependencies: - - encoding - - supports-color - - '@napi-rs/cli@3.0.0-alpha.62(@emnapi/runtime@1.2.0)(emnapi@1.2.0)': - dependencies: - '@napi-rs/cross-toolchain': 0.0.16 - '@napi-rs/wasm-tools': 0.0.2 - '@octokit/rest': 21.0.0 - clipanion: 3.2.1(typanion@3.14.0) - colorette: 2.0.20 - debug: 4.3.5 - inquirer: 10.0.1 - js-yaml: 4.1.0 - lodash-es: 4.17.21 - semver: 7.6.2 - toml: 3.0.0 - typanion: 3.14.0 - wasm-sjlj: 1.0.5 - optionalDependencies: - '@emnapi/runtime': 1.2.0 - emnapi: 1.2.0 - transitivePeerDependencies: - - '@napi-rs/cross-toolchain-arm64-target-aarch64' - - '@napi-rs/cross-toolchain-arm64-target-armv7' - - '@napi-rs/cross-toolchain-arm64-target-x86_64' - - '@napi-rs/cross-toolchain-x64-target-aarch64' - - '@napi-rs/cross-toolchain-x64-target-armv7' - - '@napi-rs/cross-toolchain-x64-target-x86_64' - - supports-color - - '@napi-rs/cross-toolchain@0.0.16': - dependencies: - '@napi-rs/lzma': 1.3.1 - '@napi-rs/tar': 0.1.1 - debug: 4.3.5 - transitivePeerDependencies: - - supports-color - - '@napi-rs/lzma-android-arm-eabi@1.3.1': - optional: true - - '@napi-rs/lzma-android-arm64@1.3.1': - optional: true - - '@napi-rs/lzma-darwin-arm64@1.3.1': - optional: true - - '@napi-rs/lzma-darwin-x64@1.3.1': - optional: true - - '@napi-rs/lzma-freebsd-x64@1.3.1': - optional: true - - '@napi-rs/lzma-linux-arm-gnueabihf@1.3.1': - optional: true - - '@napi-rs/lzma-linux-arm64-gnu@1.3.1': - optional: true - - '@napi-rs/lzma-linux-arm64-musl@1.3.1': - optional: true - - '@napi-rs/lzma-linux-x64-gnu@1.3.1': - optional: true - - '@napi-rs/lzma-linux-x64-musl@1.3.1': - optional: true - - '@napi-rs/lzma-wasm32-wasi@1.3.1': - dependencies: - '@napi-rs/wasm-runtime': 0.2.4 - optional: true - - '@napi-rs/lzma-win32-arm64-msvc@1.3.1': - optional: true - - '@napi-rs/lzma-win32-ia32-msvc@1.3.1': - optional: true - - '@napi-rs/lzma-win32-x64-msvc@1.3.1': - optional: true - - '@napi-rs/lzma@1.3.1': - optionalDependencies: - '@napi-rs/lzma-android-arm-eabi': 1.3.1 - '@napi-rs/lzma-android-arm64': 1.3.1 - '@napi-rs/lzma-darwin-arm64': 1.3.1 - '@napi-rs/lzma-darwin-x64': 1.3.1 - '@napi-rs/lzma-freebsd-x64': 1.3.1 - '@napi-rs/lzma-linux-arm-gnueabihf': 1.3.1 - '@napi-rs/lzma-linux-arm64-gnu': 1.3.1 - '@napi-rs/lzma-linux-arm64-musl': 1.3.1 - '@napi-rs/lzma-linux-x64-gnu': 1.3.1 - '@napi-rs/lzma-linux-x64-musl': 1.3.1 - '@napi-rs/lzma-wasm32-wasi': 1.3.1 - '@napi-rs/lzma-win32-arm64-msvc': 1.3.1 - '@napi-rs/lzma-win32-ia32-msvc': 1.3.1 - '@napi-rs/lzma-win32-x64-msvc': 1.3.1 - - '@napi-rs/tar-android-arm-eabi@0.1.1': - optional: true - - '@napi-rs/tar-android-arm64@0.1.1': - optional: true - - '@napi-rs/tar-darwin-arm64@0.1.1': - optional: true - - '@napi-rs/tar-darwin-x64@0.1.1': - optional: true - - '@napi-rs/tar-freebsd-x64@0.1.1': - optional: true - - '@napi-rs/tar-linux-arm-gnueabihf@0.1.1': - optional: true - - '@napi-rs/tar-linux-arm64-gnu@0.1.1': - optional: true - - '@napi-rs/tar-linux-arm64-musl@0.1.1': - optional: true - - '@napi-rs/tar-linux-x64-gnu@0.1.1': - optional: true - - '@napi-rs/tar-linux-x64-musl@0.1.1': - optional: true - - '@napi-rs/tar-wasm32-wasi@0.1.1': - dependencies: - '@napi-rs/wasm-runtime': 0.2.4 - optional: true - - '@napi-rs/tar-win32-arm64-msvc@0.1.1': - optional: true - - '@napi-rs/tar-win32-ia32-msvc@0.1.1': - optional: true - - '@napi-rs/tar-win32-x64-msvc@0.1.1': - optional: true - - '@napi-rs/tar@0.1.1': - optionalDependencies: - '@napi-rs/tar-android-arm-eabi': 0.1.1 - '@napi-rs/tar-android-arm64': 0.1.1 - '@napi-rs/tar-darwin-arm64': 0.1.1 - '@napi-rs/tar-darwin-x64': 0.1.1 - '@napi-rs/tar-freebsd-x64': 0.1.1 - '@napi-rs/tar-linux-arm-gnueabihf': 0.1.1 - '@napi-rs/tar-linux-arm64-gnu': 0.1.1 - '@napi-rs/tar-linux-arm64-musl': 0.1.1 - '@napi-rs/tar-linux-x64-gnu': 0.1.1 - '@napi-rs/tar-linux-x64-musl': 0.1.1 - '@napi-rs/tar-wasm32-wasi': 0.1.1 - '@napi-rs/tar-win32-arm64-msvc': 0.1.1 - '@napi-rs/tar-win32-ia32-msvc': 0.1.1 - '@napi-rs/tar-win32-x64-msvc': 0.1.1 - - '@napi-rs/wasm-runtime@0.2.4': - dependencies: - '@emnapi/core': 1.2.0 - '@emnapi/runtime': 1.2.0 - '@tybys/wasm-util': 0.9.0 - - '@napi-rs/wasm-tools-android-arm-eabi@0.0.2': - optional: true - - '@napi-rs/wasm-tools-android-arm64@0.0.2': - optional: true - - '@napi-rs/wasm-tools-darwin-arm64@0.0.2': - optional: true - - '@napi-rs/wasm-tools-darwin-x64@0.0.2': - optional: true - - '@napi-rs/wasm-tools-freebsd-x64@0.0.2': - optional: true - - '@napi-rs/wasm-tools-linux-arm64-gnu@0.0.2': - optional: true - - '@napi-rs/wasm-tools-linux-arm64-musl@0.0.2': - optional: true - - '@napi-rs/wasm-tools-linux-x64-gnu@0.0.2': - optional: true - - '@napi-rs/wasm-tools-linux-x64-musl@0.0.2': - optional: true - - '@napi-rs/wasm-tools-wasm32-wasi@0.0.2': - dependencies: - '@napi-rs/wasm-runtime': 0.2.4 - optional: true - - '@napi-rs/wasm-tools-win32-arm64-msvc@0.0.2': - optional: true - - '@napi-rs/wasm-tools-win32-ia32-msvc@0.0.2': - optional: true - - '@napi-rs/wasm-tools-win32-x64-msvc@0.0.2': - optional: true - - '@napi-rs/wasm-tools@0.0.2': - optionalDependencies: - '@napi-rs/wasm-tools-android-arm-eabi': 0.0.2 - '@napi-rs/wasm-tools-android-arm64': 0.0.2 - '@napi-rs/wasm-tools-darwin-arm64': 0.0.2 - '@napi-rs/wasm-tools-darwin-x64': 0.0.2 - '@napi-rs/wasm-tools-freebsd-x64': 0.0.2 - '@napi-rs/wasm-tools-linux-arm64-gnu': 0.0.2 - '@napi-rs/wasm-tools-linux-arm64-musl': 0.0.2 - '@napi-rs/wasm-tools-linux-x64-gnu': 0.0.2 - '@napi-rs/wasm-tools-linux-x64-musl': 0.0.2 - '@napi-rs/wasm-tools-wasm32-wasi': 0.0.2 - '@napi-rs/wasm-tools-win32-arm64-msvc': 0.0.2 - '@napi-rs/wasm-tools-win32-ia32-msvc': 0.0.2 - '@napi-rs/wasm-tools-win32-x64-msvc': 0.0.2 - - '@nodelib/fs.scandir@2.1.5': - dependencies: - '@nodelib/fs.stat': 2.0.5 - run-parallel: 1.2.0 - - '@nodelib/fs.stat@2.0.5': {} - - '@nodelib/fs.walk@1.2.8': - dependencies: - '@nodelib/fs.scandir': 2.1.5 - fastq: 1.17.1 - - '@octokit/auth-token@5.1.1': {} - - '@octokit/core@6.1.2': - dependencies: - '@octokit/auth-token': 5.1.1 - '@octokit/graphql': 8.1.1 - '@octokit/request': 9.1.1 - '@octokit/request-error': 6.1.2 - '@octokit/types': 13.5.0 - before-after-hook: 3.0.2 - universal-user-agent: 7.0.2 - - '@octokit/endpoint@10.1.1': - dependencies: - '@octokit/types': 13.5.0 - universal-user-agent: 7.0.2 - - '@octokit/graphql@8.1.1': - dependencies: - '@octokit/request': 9.1.1 - '@octokit/types': 13.5.0 - universal-user-agent: 7.0.2 - - '@octokit/openapi-types@22.2.0': {} - - '@octokit/plugin-paginate-rest@11.3.3(@octokit/core@6.1.2)': - dependencies: - '@octokit/core': 6.1.2 - '@octokit/types': 13.5.0 - - '@octokit/plugin-request-log@5.3.0(@octokit/core@6.1.2)': - dependencies: - '@octokit/core': 6.1.2 - - '@octokit/plugin-rest-endpoint-methods@13.2.4(@octokit/core@6.1.2)': - dependencies: - '@octokit/core': 6.1.2 - '@octokit/types': 13.5.0 - - '@octokit/request-error@6.1.2': - dependencies: - '@octokit/types': 13.5.0 - - '@octokit/request@9.1.1': - dependencies: - '@octokit/endpoint': 10.1.1 - '@octokit/request-error': 6.1.2 - '@octokit/types': 13.5.0 - universal-user-agent: 7.0.2 - - '@octokit/rest@21.0.0': - dependencies: - '@octokit/core': 6.1.2 - '@octokit/plugin-paginate-rest': 11.3.3(@octokit/core@6.1.2) - '@octokit/plugin-request-log': 5.3.0(@octokit/core@6.1.2) - '@octokit/plugin-rest-endpoint-methods': 13.2.4(@octokit/core@6.1.2) - - '@octokit/types@13.5.0': - dependencies: - '@octokit/openapi-types': 22.2.0 - - '@rollup/pluginutils@4.2.1': - dependencies: - estree-walker: 2.0.2 - picomatch: 2.3.1 - - '@sindresorhus/merge-streams@2.3.0': {} - - '@tybys/wasm-util@0.9.0': - dependencies: - tslib: 2.6.3 - - '@types/mute-stream@0.0.4': - dependencies: - '@types/node': 22.5.4 - - '@types/node@20.16.5': - dependencies: - undici-types: 6.19.8 - - '@types/node@22.5.4': - dependencies: - undici-types: 6.19.8 - - '@types/stylis@4.2.6': {} - - '@types/wrap-ansi@3.0.0': {} - - '@vercel/nft@0.26.5': - dependencies: - '@mapbox/node-pre-gyp': 1.0.11 - '@rollup/pluginutils': 4.2.1 - acorn: 8.12.1 - acorn-import-attributes: 1.9.5(acorn@8.12.1) - async-sema: 3.1.1 - bindings: 1.5.0 - estree-walker: 2.0.2 - glob: 7.2.3 - graceful-fs: 4.2.11 - micromatch: 4.0.7 - node-gyp-build: 4.8.1 - resolve-from: 5.0.0 - transitivePeerDependencies: - - encoding - - supports-color - - abbrev@1.1.1: {} - - acorn-import-attributes@1.9.5(acorn@8.12.1): - dependencies: - acorn: 8.12.1 - - acorn-walk@8.3.3: - dependencies: - acorn: 8.12.1 - - acorn@8.12.1: {} - - agent-base@6.0.2: - dependencies: - debug: 4.3.5 - transitivePeerDependencies: - - supports-color - - ansi-escapes@4.3.2: - dependencies: - type-fest: 0.21.3 - - ansi-regex@5.0.1: {} - - ansi-regex@6.0.1: {} - - ansi-styles@4.3.0: - dependencies: - color-convert: 2.0.1 - - ansi-styles@6.2.1: {} - - aproba@2.0.0: {} - - are-we-there-yet@2.0.0: - dependencies: - delegates: 1.0.0 - readable-stream: 3.6.2 - - argparse@1.0.10: - dependencies: - sprintf-js: 1.0.3 - - argparse@2.0.1: {} - - array-find-index@1.0.2: {} - - arrgv@1.0.2: {} - - arrify@3.0.0: {} - - async-sema@3.1.1: {} - - asynckit@0.4.0: {} - - ava@6.1.3: - dependencies: - '@vercel/nft': 0.26.5 - acorn: 8.12.1 - acorn-walk: 8.3.3 - ansi-styles: 6.2.1 - arrgv: 1.0.2 - arrify: 3.0.0 - callsites: 4.2.0 - cbor: 9.0.2 - chalk: 5.3.0 - chunkd: 2.0.1 - ci-info: 4.0.0 - ci-parallel-vars: 1.0.1 - cli-truncate: 4.0.0 - code-excerpt: 4.0.0 - common-path-prefix: 3.0.0 - concordance: 5.0.4 - currently-unhandled: 0.4.1 - debug: 4.3.5 - emittery: 1.0.3 - figures: 6.1.0 - globby: 14.0.2 - ignore-by-default: 2.1.0 - indent-string: 5.0.0 - is-plain-object: 5.0.0 - is-promise: 4.0.0 - matcher: 5.0.0 - memoize: 10.0.0 - ms: 2.1.3 - p-map: 7.0.2 - package-config: 5.0.0 - picomatch: 3.0.1 - plur: 5.1.0 - pretty-ms: 9.0.0 - resolve-cwd: 3.0.0 - stack-utils: 2.0.6 - strip-ansi: 7.1.0 - supertap: 3.0.1 - temp-dir: 3.0.0 - write-file-atomic: 5.0.1 - yargs: 17.7.2 - transitivePeerDependencies: - - encoding - - supports-color - - axios@1.6.2: - dependencies: - follow-redirects: 1.15.6 - form-data: 4.0.0 - proxy-from-env: 1.1.0 - transitivePeerDependencies: - - debug - - balanced-match@1.0.2: {} - - before-after-hook@3.0.2: {} - - bindings@1.5.0: - dependencies: - file-uri-to-path: 1.0.0 - - blueimp-md5@2.19.0: {} - - brace-expansion@1.1.11: - dependencies: - balanced-match: 1.0.2 - concat-map: 0.0.1 - - braces@3.0.3: - dependencies: - fill-range: 7.1.1 - - callsites@4.2.0: {} - - camelize@1.0.1: {} - - cbor@9.0.2: - dependencies: - nofilter: 3.1.0 - - chalk@5.3.0: {} - - chardet@0.7.0: {} - - chownr@2.0.0: {} - - chunkd@2.0.1: {} - - ci-info@4.0.0: {} - - ci-parallel-vars@1.0.1: {} - - cli-spinners@2.9.2: {} - - cli-truncate@4.0.0: - dependencies: - slice-ansi: 5.0.0 - string-width: 7.2.0 - - cli-width@4.1.0: {} - - clipanion@3.2.1(typanion@3.14.0): - dependencies: - typanion: 3.14.0 - - cliui@8.0.1: - dependencies: - string-width: 4.2.3 - strip-ansi: 6.0.1 - wrap-ansi: 7.0.0 - - code-excerpt@4.0.0: - dependencies: - convert-to-spaces: 2.0.1 - - color-convert@2.0.1: - dependencies: - color-name: 1.1.4 - - color-name@1.1.4: {} - - color-support@1.1.3: {} - - colorette@2.0.20: {} - - combined-stream@1.0.8: - dependencies: - delayed-stream: 1.0.0 - - common-path-prefix@3.0.0: {} - - concat-map@0.0.1: {} - - concordance@5.0.4: - dependencies: - date-time: 3.1.0 - esutils: 2.0.3 - fast-diff: 1.3.0 - js-string-escape: 1.0.1 - lodash: 4.17.21 - md5-hex: 3.0.1 - semver: 7.6.2 - well-known-symbols: 2.0.0 - - console-control-strings@1.1.0: {} - - convert-to-spaces@2.0.1: {} - - css-color-keywords@1.0.0: {} - - css-to-react-native@3.2.0: - dependencies: - camelize: 1.0.1 - css-color-keywords: 1.0.0 - postcss-value-parser: 4.2.0 - - csstype@3.1.3: {} - - currently-unhandled@0.4.1: - dependencies: - array-find-index: 1.0.2 - - date-time@3.1.0: - dependencies: - time-zone: 1.0.0 - - debug@4.3.5: - dependencies: - ms: 2.1.2 - - delayed-stream@1.0.0: {} - - delegates@1.0.0: {} - - detect-libc@2.0.3: {} - - emittery@1.0.3: {} - - emnapi@1.2.0: {} - - emoji-regex@10.3.0: {} - - emoji-regex@8.0.0: {} - - escalade@3.1.2: {} - - escape-string-regexp@2.0.0: {} - - escape-string-regexp@5.0.0: {} - - esprima@4.0.1: {} - - estree-walker@2.0.2: {} - - esutils@2.0.3: {} - - external-editor@3.1.0: - dependencies: - chardet: 0.7.0 - iconv-lite: 0.4.24 - tmp: 0.0.33 - - fast-diff@1.3.0: {} - - fast-glob@3.3.2: - dependencies: - '@nodelib/fs.stat': 2.0.5 - '@nodelib/fs.walk': 1.2.8 - glob-parent: 5.1.2 - merge2: 1.4.1 - micromatch: 4.0.7 - - fastq@1.17.1: - dependencies: - reusify: 1.0.4 - - figures@6.1.0: - dependencies: - is-unicode-supported: 2.0.0 - - file-uri-to-path@1.0.0: {} - - fill-range@7.1.1: - dependencies: - to-regex-range: 5.0.1 - - find-up-simple@1.0.0: {} - - follow-redirects@1.15.6: {} - - form-data@4.0.0: - dependencies: - asynckit: 0.4.0 - combined-stream: 1.0.8 - mime-types: 2.1.35 - - fs-minipass@2.1.0: - dependencies: - minipass: 3.3.6 - - fs.realpath@1.0.0: {} - - gauge@3.0.2: - dependencies: - aproba: 2.0.0 - color-support: 1.1.3 - console-control-strings: 1.1.0 - has-unicode: 2.0.1 - object-assign: 4.1.1 - signal-exit: 3.0.7 - string-width: 4.2.3 - strip-ansi: 6.0.1 - wide-align: 1.1.5 - - get-caller-file@2.0.5: {} - - get-east-asian-width@1.2.0: {} - - glob-parent@5.1.2: - dependencies: - is-glob: 4.0.3 - - glob@7.2.3: - dependencies: - fs.realpath: 1.0.0 - inflight: 1.0.6 - inherits: 2.0.4 - minimatch: 3.1.2 - once: 1.4.0 - path-is-absolute: 1.0.1 - - globby@14.0.2: - dependencies: - '@sindresorhus/merge-streams': 2.3.0 - fast-glob: 3.3.2 - ignore: 5.3.1 - path-type: 5.0.0 - slash: 5.1.0 - unicorn-magic: 0.1.0 - - graceful-fs@4.2.11: {} - - has-unicode@2.0.1: {} - - https-proxy-agent@5.0.1: - dependencies: - agent-base: 6.0.2 - debug: 4.3.5 - transitivePeerDependencies: - - supports-color - - iconv-lite@0.4.24: - dependencies: - safer-buffer: 2.1.2 - - ignore-by-default@2.1.0: {} - - ignore@5.3.1: {} - - imurmurhash@0.1.4: {} - - indent-string@5.0.0: {} - - inflight@1.0.6: - dependencies: - once: 1.4.0 - wrappy: 1.0.2 - - inherits@2.0.4: {} - - inquirer@10.0.1: - dependencies: - '@inquirer/prompts': 5.1.2 - '@inquirer/type': 1.4.0 - '@types/mute-stream': 0.0.4 - ansi-escapes: 4.3.2 - mute-stream: 1.0.0 - run-async: 3.0.0 - rxjs: 7.8.1 - - ipaddr.js@2.2.0: {} - - irregular-plurals@3.5.0: {} - - is-extglob@2.1.1: {} - - is-fullwidth-code-point@3.0.0: {} - - is-fullwidth-code-point@4.0.0: {} - - is-glob@4.0.3: - dependencies: - is-extglob: 2.1.1 - - is-number@7.0.0: {} - - is-plain-object@5.0.0: {} - - is-promise@4.0.0: {} - - is-unicode-supported@2.0.0: {} - - js-string-escape@1.0.1: {} - - js-tokens@4.0.0: {} - - js-yaml@3.14.1: - dependencies: - argparse: 1.0.10 - esprima: 4.0.1 - - js-yaml@4.1.0: - dependencies: - argparse: 2.0.1 - - load-json-file@7.0.1: {} - - lodash-es@4.17.21: {} - - lodash@4.17.21: {} - - loose-envify@1.4.0: - dependencies: - js-tokens: 4.0.0 - - make-dir@3.1.0: - dependencies: - semver: 6.3.1 - - matcher@5.0.0: - dependencies: - escape-string-regexp: 5.0.0 - - md5-hex@3.0.1: - dependencies: - blueimp-md5: 2.19.0 - - memoize@10.0.0: - dependencies: - mimic-function: 5.0.1 - - merge2@1.4.1: {} - - micromatch@4.0.7: - dependencies: - braces: 3.0.3 - picomatch: 2.3.1 - - mime-db@1.52.0: {} - - mime-types@2.1.35: - dependencies: - mime-db: 1.52.0 - - mimic-function@5.0.1: {} - - minimatch@3.1.2: - dependencies: - brace-expansion: 1.1.11 - - minipass@3.3.6: - dependencies: - yallist: 4.0.0 - - minipass@5.0.0: {} - - minizlib@2.1.2: - dependencies: - minipass: 3.3.6 - yallist: 4.0.0 - - mkdirp@1.0.4: {} - - ms@2.1.2: {} - - ms@2.1.3: {} - - mute-stream@1.0.0: {} - - nanoid@3.3.7: {} - - node-fetch@2.7.0: - dependencies: - whatwg-url: 5.0.0 - - node-gyp-build@4.8.1: {} - - nofilter@3.1.0: {} - - nopt@5.0.0: - dependencies: - abbrev: 1.1.1 - - npmlog@5.0.1: - dependencies: - are-we-there-yet: 2.0.0 - console-control-strings: 1.1.0 - gauge: 3.0.2 - set-blocking: 2.0.0 - - object-assign@4.1.1: {} - - once@1.4.0: - dependencies: - wrappy: 1.0.2 - - os-tmpdir@1.0.2: {} - - p-map@7.0.2: {} - - package-config@5.0.0: - dependencies: - find-up-simple: 1.0.0 - load-json-file: 7.0.1 - - parse-ms@4.0.0: {} - - path-is-absolute@1.0.1: {} - - path-type@5.0.0: {} - - picocolors@1.0.1: {} - - picomatch@2.3.1: {} - - picomatch@3.0.1: {} - - plur@5.1.0: - dependencies: - irregular-plurals: 3.5.0 - - postcss-value-parser@4.2.0: {} - - postcss@8.4.33: - dependencies: - nanoid: 3.3.7 - picocolors: 1.0.1 - source-map-js: 1.2.0 - - pretty-ms@9.0.0: - dependencies: - parse-ms: 4.0.0 - - proxy-from-env@1.1.0: {} - - queue-microtask@1.2.3: {} - - react-dom@18.3.1(react@18.3.1): - dependencies: - loose-envify: 1.4.0 - react: 18.3.1 - scheduler: 0.23.2 - - react@18.3.1: - dependencies: - loose-envify: 1.4.0 - - readable-stream@3.6.2: - dependencies: - inherits: 2.0.4 - string_decoder: 1.3.0 - util-deprecate: 1.0.2 - - require-directory@2.1.1: {} - - resolve-cwd@3.0.0: - dependencies: - resolve-from: 5.0.0 - - resolve-from@5.0.0: {} - - reusify@1.0.4: {} - - rimraf@3.0.2: - dependencies: - glob: 7.2.3 - - run-async@3.0.0: {} - - run-parallel@1.2.0: - dependencies: - queue-microtask: 1.2.3 - - rxjs@7.8.1: - dependencies: - tslib: 2.6.3 - - safe-buffer@5.2.1: {} - - safer-buffer@2.1.2: {} - - scheduler@0.23.2: - dependencies: - loose-envify: 1.4.0 - - semver@6.3.1: {} - - semver@7.6.2: {} - - serialize-error@7.0.1: - dependencies: - type-fest: 0.13.1 - - set-blocking@2.0.0: {} - - shallowequal@1.1.0: {} - - signal-exit@3.0.7: {} - - signal-exit@4.1.0: {} - - slash@5.1.0: {} - - slice-ansi@5.0.0: - dependencies: - ansi-styles: 6.2.1 - is-fullwidth-code-point: 4.0.0 - - source-map-js@1.2.0: {} - - sprintf-js@1.0.3: {} - - stack-utils@2.0.6: - dependencies: - escape-string-regexp: 2.0.0 - - string-width@4.2.3: - dependencies: - emoji-regex: 8.0.0 - is-fullwidth-code-point: 3.0.0 - strip-ansi: 6.0.1 - - string-width@7.2.0: - dependencies: - emoji-regex: 10.3.0 - get-east-asian-width: 1.2.0 - strip-ansi: 7.1.0 - - string_decoder@1.3.0: - dependencies: - safe-buffer: 5.2.1 - - strip-ansi@6.0.1: - dependencies: - ansi-regex: 5.0.1 - - strip-ansi@7.1.0: - dependencies: - ansi-regex: 6.0.1 - - styled-components@6.1.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1): - dependencies: - '@emotion/is-prop-valid': 1.2.2 - '@emotion/unitless': 0.8.1 - '@types/stylis': 4.2.6 - css-to-react-native: 3.2.0 - csstype: 3.1.3 - postcss: 8.4.33 - react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) - shallowequal: 1.1.0 - stylis: 4.3.2 - tslib: 2.6.3 - - stylis@4.3.2: {} - - supertap@3.0.1: - dependencies: - indent-string: 5.0.0 - js-yaml: 3.14.1 - serialize-error: 7.0.1 - strip-ansi: 7.1.0 - - tar@6.2.1: - dependencies: - chownr: 2.0.0 - fs-minipass: 2.1.0 - minipass: 5.0.0 - minizlib: 2.1.2 - mkdirp: 1.0.4 - yallist: 4.0.0 - - temp-dir@3.0.0: {} - - time-zone@1.0.0: {} - - tmp@0.0.33: - dependencies: - os-tmpdir: 1.0.2 - - to-regex-range@5.0.1: - dependencies: - is-number: 7.0.0 - - toml@3.0.0: {} - - tr46@0.0.3: {} - - tslib@2.6.3: {} - - typanion@3.14.0: {} - - type-fest@0.13.1: {} - - type-fest@0.21.3: {} - - typescript@5.5.4: {} - - undici-types@6.19.8: {} - - unicorn-magic@0.1.0: {} - - universal-user-agent@7.0.2: {} - - util-deprecate@1.0.2: {} - - wasm-sjlj@1.0.5: {} - - webidl-conversions@3.0.1: {} - - well-known-symbols@2.0.0: {} - - whatwg-url@5.0.0: - dependencies: - tr46: 0.0.3 - webidl-conversions: 3.0.1 - - wide-align@1.1.5: - dependencies: - string-width: 4.2.3 - - wrap-ansi@6.2.0: - dependencies: - ansi-styles: 4.3.0 - string-width: 4.2.3 - strip-ansi: 6.0.1 - - wrap-ansi@7.0.0: - dependencies: - ansi-styles: 4.3.0 - string-width: 4.2.3 - strip-ansi: 6.0.1 - - wrappy@1.0.2: {} - - write-file-atomic@5.0.1: - dependencies: - imurmurhash: 0.1.4 - signal-exit: 4.1.0 - - y18n@5.0.8: {} - - yallist@4.0.0: {} - - yargs-parser@21.1.1: {} - - yargs@17.7.2: - dependencies: - cliui: 8.0.1 - escalade: 3.1.2 - get-caller-file: 2.0.5 - require-directory: 2.1.1 - string-width: 4.2.3 - y18n: 5.0.8 - yargs-parser: 21.1.1 - - yoctocolors-cjs@2.1.2: {} diff --git a/src/builtins.rs b/src/builtins.rs deleted file mode 100644 index 45a25117..00000000 --- a/src/builtins.rs +++ /dev/null @@ -1,71 +0,0 @@ -/// Node.js built-in modules -/// -/// `node -p "[...require('module').builtinModules].map(b => JSON.stringify(b)).join(',\n')"` -/// -pub const NODEJS_BUILTINS: &[&str] = &[ - "_http_agent", - "_http_client", - "_http_common", - "_http_incoming", - "_http_outgoing", - "_http_server", - "_stream_duplex", - "_stream_passthrough", - "_stream_readable", - "_stream_transform", - "_stream_wrap", - "_stream_writable", - "_tls_common", - "_tls_wrap", - "assert", - "assert/strict", - "async_hooks", - "buffer", - "child_process", - "cluster", - "console", - "constants", - "crypto", - "dgram", - "diagnostics_channel", - "dns", - "dns/promises", - "domain", - "events", - "fs", - "fs/promises", - "http", - "http2", - "https", - "inspector", - "module", - "net", - "os", - "path", - "path/posix", - "path/win32", - "perf_hooks", - "process", - "punycode", - "querystring", - "readline", - "repl", - "stream", - "stream/consumers", - "stream/promises", - "stream/web", - "string_decoder", - "sys", - "timers", - "timers/promises", - "tls", - "trace_events", - "tty", - "url", - "util", - "util/types", - "v8", - "vm", - "worker_threads", - "zlib", -]; diff --git a/src/cache.rs b/src/cache.rs deleted file mode 100644 index 6e600664..00000000 --- a/src/cache.rs +++ /dev/null @@ -1,354 +0,0 @@ -use once_cell::sync::OnceCell as OnceLock; -use std::{ - borrow::{Borrow, Cow}, - convert::AsRef, - hash::{BuildHasherDefault, Hash, Hasher}, - io, - ops::Deref, - path::{Path, PathBuf}, - sync::Arc, -}; - -use dashmap::{DashMap, DashSet}; -use rustc_hash::FxHasher; - -use crate::{ - context::ResolveContext as Ctx, package_json::PackageJson, path::PathUtil, FileMetadata, - FileSystem, ResolveError, ResolveOptions, TsConfig, -}; - -#[derive(Default)] -pub struct Cache { - pub(crate) fs: Fs, - paths: DashSet>, - tsconfigs: DashMap, BuildHasherDefault>, -} - -impl Cache { - pub fn new(fs: Fs) -> Self { - Self { fs, paths: DashSet::default(), tsconfigs: DashMap::default() } - } - - pub fn clear(&self) { - self.paths.clear(); - self.tsconfigs.clear(); - } - - pub fn value(&self, path: &Path) -> CachedPath { - let hash = { - let mut hasher = FxHasher::default(); - path.hash(&mut hasher); - hasher.finish() - }; - if let Some(cache_entry) = self.paths.get((hash, path).borrow() as &dyn CacheKey) { - return cache_entry.clone(); - } - let parent = path.parent().map(|p| self.value(p)); - let data = CachedPath(Arc::new(CachedPathImpl::new( - hash, - path.to_path_buf().into_boxed_path(), - parent, - ))); - self.paths.insert(data.clone()); - data - } - - pub fn tsconfig Result<(), ResolveError>>( - &self, - root: bool, - path: &Path, - callback: F, // callback for modifying tsconfig with `extends` - ) -> Result, ResolveError> { - if let Some(tsconfig_ref) = self.tsconfigs.get(path) { - return Ok(Arc::clone(tsconfig_ref.value())); - } - let meta = self.fs.metadata(path).ok(); - let tsconfig_path = if meta.is_some_and(|m| m.is_file) { - Cow::Borrowed(path) - } else if meta.is_some_and(|m| m.is_dir) { - Cow::Owned(path.join("tsconfig.json")) - } else { - let mut os_string = path.to_path_buf().into_os_string(); - os_string.push(".json"); - Cow::Owned(PathBuf::from(os_string)) - }; - let mut tsconfig_string = self - .fs - .read_to_string(&tsconfig_path) - .map_err(|_| ResolveError::TsconfigNotFound(path.to_path_buf()))?; - let mut tsconfig = - TsConfig::parse(root, &tsconfig_path, &mut tsconfig_string).map_err(|error| { - ResolveError::from_serde_json_error(tsconfig_path.to_path_buf(), &error) - })?; - callback(&mut tsconfig)?; - let tsconfig = Arc::new(tsconfig.build()); - self.tsconfigs.insert(path.to_path_buf(), Arc::clone(&tsconfig)); - Ok(tsconfig) - } -} - -#[derive(Clone)] -pub struct CachedPath(Arc); - -impl Hash for CachedPath { - fn hash(&self, state: &mut H) { - self.0.hash.hash(state); - } -} - -impl PartialEq for CachedPath { - fn eq(&self, other: &Self) -> bool { - self.0.path == other.0.path - } -} -impl Eq for CachedPath {} - -impl Deref for CachedPath { - type Target = CachedPathImpl; - - fn deref(&self) -> &Self::Target { - self.0.as_ref() - } -} - -impl<'a> Borrow for CachedPath { - fn borrow(&self) -> &(dyn CacheKey + 'a) { - self - } -} - -impl AsRef for CachedPath { - fn as_ref(&self) -> &CachedPathImpl { - self.0.as_ref() - } -} - -impl CacheKey for CachedPath { - fn tuple(&self) -> (u64, &Path) { - (self.hash, &self.path) - } -} - -pub struct CachedPathImpl { - hash: u64, - path: Box, - parent: Option, - meta: OnceLock>, - canonicalized: OnceLock>, - node_modules: OnceLock>, - package_json: OnceLock>>, -} - -impl CachedPathImpl { - fn new(hash: u64, path: Box, parent: Option) -> Self { - Self { - hash, - path, - parent, - meta: OnceLock::new(), - canonicalized: OnceLock::new(), - node_modules: OnceLock::new(), - package_json: OnceLock::new(), - } - } - - pub fn path(&self) -> &Path { - &self.path - } - - pub fn to_path_buf(&self) -> PathBuf { - self.path.to_path_buf() - } - - pub fn parent(&self) -> Option<&CachedPath> { - self.parent.as_ref() - } - - fn meta(&self, fs: &Fs) -> Option { - *self.meta.get_or_init(|| fs.metadata(&self.path).ok()) - } - - pub fn is_file(&self, fs: &Fs, ctx: &mut Ctx) -> bool { - if let Some(meta) = self.meta(fs) { - ctx.add_file_dependency(self.path()); - meta.is_file - } else { - ctx.add_missing_dependency(self.path()); - false - } - } - - pub fn is_dir(&self, fs: &Fs, ctx: &mut Ctx) -> bool { - self.meta(fs).map_or_else( - || { - ctx.add_missing_dependency(self.path()); - false - }, - |meta| meta.is_dir, - ) - } - - pub fn realpath(&self, fs: &Fs) -> io::Result { - self.canonicalized - .get_or_try_init(|| { - if fs.symlink_metadata(&self.path).is_ok_and(|m| m.is_symlink) { - return fs.canonicalize(&self.path).map(Some); - } - if let Some(parent) = self.parent() { - let parent_path = parent.realpath(fs)?; - return Ok(Some( - parent_path.normalize_with(self.path.strip_prefix(&parent.path).unwrap()), - )); - }; - Ok(None) - }) - .cloned() - .map(|r| r.unwrap_or_else(|| self.path.clone().to_path_buf())) - } - - pub fn module_directory( - &self, - module_name: &str, - cache: &Cache, - ctx: &mut Ctx, - ) -> Option { - let cached_path = cache.value(&self.path.join(module_name)); - cached_path.is_dir(&cache.fs, ctx).then_some(cached_path) - } - - pub fn cached_node_modules( - &self, - cache: &Cache, - ctx: &mut Ctx, - ) -> Option { - self.node_modules.get_or_init(|| self.module_directory("node_modules", cache, ctx)).clone() - } - - /// Find package.json of a path by traversing parent directories. - /// - /// # Errors - /// - /// * [ResolveError::JSON] - pub fn find_package_json( - &self, - fs: &Fs, - options: &ResolveOptions, - ctx: &mut Ctx, - ) -> Result>, ResolveError> { - let mut cache_value = self; - // Go up directories when the querying path is not a directory - while !cache_value.is_dir(fs, ctx) { - if let Some(cv) = &cache_value.parent { - cache_value = cv.as_ref(); - } else { - break; - } - } - let mut cache_value = Some(cache_value); - while let Some(cv) = cache_value { - if let Some(package_json) = cv.package_json(fs, options, ctx)? { - return Ok(Some(Arc::clone(&package_json))); - } - cache_value = cv.parent.as_deref(); - } - Ok(None) - } - - /// Get package.json of the given path. - /// - /// # Errors - /// - /// * [ResolveError::JSON] - pub fn package_json( - &self, - fs: &Fs, - options: &ResolveOptions, - ctx: &mut Ctx, - ) -> Result>, ResolveError> { - // Change to `std::sync::OnceLock::get_or_try_init` when it is stable. - let result = self - .package_json - .get_or_try_init(|| { - let package_json_path = self.path.join("package.json"); - let Ok(package_json_string) = fs.read_to_string(&package_json_path) else { - return Ok(None); - }; - let real_path = if options.symlinks { - self.realpath(fs)?.join("package.json") - } else { - package_json_path.clone() - }; - PackageJson::parse(package_json_path.clone(), real_path, &package_json_string) - .map(Arc::new) - .map(Some) - .map_err(|error| ResolveError::from_serde_json_error(package_json_path, &error)) - }) - .cloned(); - // https://github.com/webpack/enhanced-resolve/blob/58464fc7cb56673c9aa849e68e6300239601e615/lib/DescriptionFileUtils.js#L68-L82 - match &result { - Ok(Some(package_json)) => { - ctx.add_file_dependency(&package_json.path); - } - Ok(None) => { - // Avoid an allocation by making this lazy - if let Some(deps) = &mut ctx.missing_dependencies { - deps.push(self.path.join("package.json")); - } - } - Err(_) => { - if let Some(deps) = &mut ctx.file_dependencies { - deps.push(self.path.join("package.json")); - } - } - } - result - } -} - -/// Memoized cache key, code adapted from . -trait CacheKey { - fn tuple(&self) -> (u64, &Path); -} - -impl Hash for dyn CacheKey + '_ { - fn hash(&self, state: &mut H) { - self.tuple().0.hash(state); - } -} - -impl PartialEq for dyn CacheKey + '_ { - fn eq(&self, other: &Self) -> bool { - self.tuple().1 == other.tuple().1 - } -} - -impl Eq for dyn CacheKey + '_ {} - -impl<'a> CacheKey for (u64, &'a Path) { - fn tuple(&self) -> (u64, &Path) { - (self.0, self.1) - } -} - -impl<'a> Borrow for (u64, &'a Path) { - fn borrow(&self) -> &(dyn CacheKey + 'a) { - self - } -} - -/// Since the cache key is memoized, use an identity hasher -/// to avoid double cache. -#[derive(Default)] -struct IdentityHasher(u64); - -impl Hasher for IdentityHasher { - fn write(&mut self, _: &[u8]) { - unreachable!("Invalid use of IdentityHasher") - } - fn write_u64(&mut self, n: u64) { - self.0 = n; - } - fn finish(&self) -> u64 { - self.0 - } -} diff --git a/src/context.rs b/src/context.rs deleted file mode 100644 index 9349de30..00000000 --- a/src/context.rs +++ /dev/null @@ -1,89 +0,0 @@ -use std::{ - ops::{Deref, DerefMut}, - path::{Path, PathBuf}, -}; - -use crate::error::ResolveError; - -#[derive(Debug, Default, Clone)] -pub struct ResolveContext(ResolveContextImpl); - -#[derive(Debug, Default, Clone)] -pub struct ResolveContextImpl { - pub fully_specified: bool, - - pub query: Option, - - pub fragment: Option, - - /// Files that was found on file system - pub file_dependencies: Option>, - - /// Files that was found on file system - pub missing_dependencies: Option>, - - /// The current resolving alias for bailing recursion alias. - pub resolving_alias: Option, - - /// For avoiding infinite recursion, which will cause stack overflow. - depth: u8, -} - -impl Deref for ResolveContext { - type Target = ResolveContextImpl; - - fn deref(&self) -> &Self::Target { - &self.0 - } -} - -impl DerefMut for ResolveContext { - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} - -impl ResolveContext { - pub fn with_fully_specified(&mut self, yes: bool) { - self.fully_specified = yes; - } - - pub fn with_query_fragment(&mut self, query: Option<&str>, fragment: Option<&str>) { - if let Some(query) = query { - self.query.replace(query.to_string()); - } - if let Some(fragment) = fragment { - self.fragment.replace(fragment.to_string()); - } - } - - pub fn init_file_dependencies(&mut self) { - self.file_dependencies.replace(vec![]); - self.missing_dependencies.replace(vec![]); - } - - pub fn add_file_dependency(&mut self, dep: &Path) { - if let Some(deps) = &mut self.file_dependencies { - deps.push(dep.to_path_buf()); - } - } - - pub fn add_missing_dependency(&mut self, dep: &Path) { - if let Some(deps) = &mut self.missing_dependencies { - deps.push(dep.to_path_buf()); - } - } - - pub fn with_resolving_alias(&mut self, alias: String) { - self.resolving_alias = Some(alias); - } - - pub fn test_for_infinite_recursion(&mut self) -> Result<(), ResolveError> { - self.depth += 1; - // 64 should be more than enough for detecting infinite recursion. - if self.depth > 64 { - return Err(ResolveError::Recursion); - } - Ok(()) - } -} diff --git a/src/error.rs b/src/error.rs deleted file mode 100644 index b00a0ba8..00000000 --- a/src/error.rs +++ /dev/null @@ -1,182 +0,0 @@ -use std::{io, path::PathBuf, sync::Arc}; -use thiserror::Error; - -/// All resolution errors -/// -/// `thiserror` is used to display meaningful error messages. -#[derive(Debug, Clone, PartialEq, Error)] -pub enum ResolveError { - /// Ignored path - /// - /// Derived from ignored path (false value) from browser field in package.json - /// ```json - /// { - /// "browser": { - /// "./module": false - /// } - /// } - /// ``` - /// See - #[error("Path is ignored {0}")] - Ignored(PathBuf), - - /// Module not found - #[error("Cannot find module '{0}'")] - NotFound(/* specifier */ String), - - /// Matched alias value not found - #[error("Cannot find module '{0}' for matched aliased key '{1}'")] - MatchedAliasNotFound(/* specifier */ String, /* alias key */ String), - - /// Tsconfig not found - #[error("Tsconfig not found {0}")] - TsconfigNotFound(PathBuf), - - /// Tsconfig's project reference path points to it self - #[error("Tsconfig's project reference path points to this tsconfig {0}")] - TsconfigSelfReference(PathBuf), - - #[error("{0}")] - IOError(IOError), - - /// Node.js builtin modules - /// - /// This is an error due to not being a Node.js runtime. - /// The `alias` option can be used to resolve a builtin module to a polyfill. - #[error("Builtin module {0}")] - Builtin(String), - - /// All of the aliased extension are not found - #[error("All of the aliased extensions are not found for {0}")] - ExtensionAlias(PathBuf), - - /// The provided path specifier cannot be parsed - #[error("{0}")] - Specifier(SpecifierError), - - /// JSON parse error - #[error("{0:?}")] - JSON(JSONError), - - /// Restricted by `ResolveOptions::restrictions` - #[error(r#"Path "{0}" restricted by {0}"#)] - Restriction(PathBuf, PathBuf), - - #[error(r#"Invalid module "{0}" specifier is not a valid subpath for the "exports" resolution of {1}"#)] - InvalidModuleSpecifier(String, PathBuf), - - #[error(r#"Invalid "exports" target "{0}" defined for '{1}' in the package config {2}"#)] - InvalidPackageTarget(String, String, PathBuf), - - #[error(r#"Package subpath '{0}' is not defined by "exports" in {1}"#)] - PackagePathNotExported(String, PathBuf), - - #[error(r#"Invalid package config "{0}", "exports" cannot contain some keys starting with '.' and some not. The exports object must either be an object of package subpath keys or an object of main entry condition name keys only."#)] - InvalidPackageConfig(PathBuf), - - #[error(r#"Default condition should be last one in "{0}""#)] - InvalidPackageConfigDefault(PathBuf), - - #[error(r#"Expecting folder to folder mapping. "{0}" should end with "/"#)] - InvalidPackageConfigDirectory(PathBuf), - - #[error(r#"Package import specifier "{0}" is not defined in package {1}"#)] - PackageImportNotDefined(String, PathBuf), - - #[error("{0} is unimplemented")] - Unimplemented(&'static str), - - /// Occurs when alias paths reference each other. - #[error("Recursion in resolving")] - Recursion, -} - -impl ResolveError { - pub fn is_ignore(&self) -> bool { - matches!(self, Self::Ignored(_)) - } - - pub(crate) fn from_serde_json_error(path: PathBuf, error: &serde_json::Error) -> Self { - Self::JSON(JSONError { - path, - message: error.to_string(), - line: error.line(), - column: error.column(), - }) - } -} - -/// Error for [ResolveError::Specifier] -#[derive(Debug, Clone, Eq, PartialEq, Error)] -pub enum SpecifierError { - #[error("The specifiers must be a non-empty string. Received \"{0}\"")] - Empty(String), -} - -/// JSON error from [serde_json::Error] -#[derive(Debug, Clone, Eq, PartialEq)] -pub struct JSONError { - pub path: PathBuf, - pub message: String, - pub line: usize, - pub column: usize, -} - -#[derive(Debug, Clone, Error)] -#[error("{0}")] -pub struct IOError(Arc); - -impl PartialEq for IOError { - fn eq(&self, other: &Self) -> bool { - self.0.kind() == other.0.kind() - } -} - -impl From for io::Error { - fn from(error: IOError) -> Self { - let io_error = error.0.as_ref(); - Self::new(io_error.kind(), io_error.to_string()) - } -} - -impl From for ResolveError { - fn from(err: io::Error) -> Self { - Self::IOError(IOError(Arc::new(err))) - } -} - -#[test] -fn test_into_io_error() { - use std::io::{self, ErrorKind}; - let error_string = "IOError occurred"; - let string_error = io::Error::new(ErrorKind::Interrupted, error_string.to_string()); - let string_error2 = io::Error::new(ErrorKind::Interrupted, error_string.to_string()); - let resolve_io_error: ResolveError = ResolveError::from(string_error2); - - assert_eq!(resolve_io_error, ResolveError::from(string_error)); - assert_eq!(resolve_io_error.clone(), resolve_io_error); - let ResolveError::IOError(io_error) = resolve_io_error else { unreachable!() }; - assert_eq!( - format!("{io_error:?}"), - r#"IOError(Custom { kind: Interrupted, error: "IOError occurred" })"# - ); - // fix for https://github.com/web-infra-dev/rspack/issues/4564 - let std_io_error: io::Error = io_error.into(); - assert_eq!(std_io_error.kind(), ErrorKind::Interrupted); - assert_eq!(std_io_error.to_string(), error_string); - assert_eq!( - format!("{std_io_error:?}"), - r#"Custom { kind: Interrupted, error: "IOError occurred" }"# - ); -} - -#[test] -fn test_coverage() { - let error = ResolveError::NotFound("x".into()); - assert_eq!(format!("{error:?}"), r#"NotFound("x")"#); - assert_eq!(error.clone(), error); - - let error = ResolveError::Specifier(SpecifierError::Empty("x".into())); - assert_eq!(format!("{error:?}"), r#"Specifier(Empty("x"))"#); - assert_eq!(error.clone(), error); -} diff --git a/src/file_system.rs b/src/file_system.rs deleted file mode 100644 index d5f0ff8a..00000000 --- a/src/file_system.rs +++ /dev/null @@ -1,220 +0,0 @@ -use cfg_if::cfg_if; -use std::{ - fs, io, - path::{Path, PathBuf}, -}; - -#[cfg(feature = "yarn_pnp")] -use pnp::fs::{LruZipCache, VPath, VPathInfo, ZipCache}; - -/// File System abstraction used for `ResolverGeneric` -pub trait FileSystem: Send + Sync { - /// See [std::fs::read_to_string] - /// - /// # Errors - /// - /// * See [std::fs::read_to_string] - /// ## Warning - /// Use `&Path` instead of a generic `P: AsRef` here, - /// because object safety requirements, it is especially useful, when - /// you want to store multiple `dyn FileSystem` in a `Vec` or use a `ResolverGeneric` in - /// napi env. - fn read_to_string(&self, path: &Path) -> io::Result; - - /// See [std::fs::metadata] - /// - /// # Errors - /// See [std::fs::metadata] - /// ## Warning - /// Use `&Path` instead of a generic `P: AsRef` here, - /// because object safety requirements, it is especially useful, when - /// you want to store multiple `dyn FileSystem` in a `Vec` or use a `ResolverGeneric` in - /// napi env. - fn metadata(&self, path: &Path) -> io::Result; - - /// See [std::fs::symlink_metadata] - /// - /// # Errors - /// - /// See [std::fs::symlink_metadata] - /// ## Warning - /// Use `&Path` instead of a generic `P: AsRef` here, - /// because object safety requirements, it is especially useful, when - /// you want to store multiple `dyn FileSystem` in a `Vec` or use a `ResolverGeneric` in - /// napi env. - fn symlink_metadata(&self, path: &Path) -> io::Result; - - /// See [std::fs::canonicalize] - /// - /// # Errors - /// - /// See [std::fs::read_link] - /// ## Warning - /// Use `&Path` instead of a generic `P: AsRef` here, - /// because object safety requirements, it is especially useful, when - /// you want to store multiple `dyn FileSystem` in a `Vec` or use a `ResolverGeneric` in - /// napi env. - fn canonicalize(&self, path: &Path) -> io::Result; -} - -/// Metadata information about a file -#[derive(Debug, Clone, Copy)] -pub struct FileMetadata { - pub(crate) is_file: bool, - pub(crate) is_dir: bool, - pub(crate) is_symlink: bool, -} - -impl FileMetadata { - pub fn new(is_file: bool, is_dir: bool, is_symlink: bool) -> Self { - Self { is_file, is_dir, is_symlink } - } -} - -#[cfg(feature = "yarn_pnp")] -impl From for FileMetadata { - fn from(value: pnp::fs::FileType) -> Self { - Self::new(value == pnp::fs::FileType::File, value == pnp::fs::FileType::Directory, false) - } -} - -impl From for FileMetadata { - fn from(metadata: fs::Metadata) -> Self { - Self::new(metadata.is_file(), metadata.is_dir(), metadata.is_symlink()) - } -} - -/// Operating System -#[cfg(feature = "yarn_pnp")] -pub struct FileSystemOs { - pnp_lru: LruZipCache>, -} - -#[cfg(not(feature = "yarn_pnp"))] -pub struct FileSystemOs; - -impl Default for FileSystemOs { - fn default() -> Self { - cfg_if! { - if #[cfg(feature = "yarn_pnp")] { - Self { pnp_lru: LruZipCache::new(50, pnp::fs::open_zip_via_read_p) } - } else { - Self - } - } - } -} - -fn read_to_string(path: &Path) -> io::Result { - // `simdutf8` is faster than `std::str::from_utf8` which `fs::read_to_string` uses internally - let bytes = std::fs::read(path)?; - if simdutf8::basic::from_utf8(&bytes).is_err() { - // Same error as `fs::read_to_string` produces (`io::Error::INVALID_UTF8`) - return Err(io::Error::new( - io::ErrorKind::InvalidData, - "stream did not contain valid UTF-8", - )); - } - // SAFETY: `simdutf8` has ensured it's a valid UTF-8 string - Ok(unsafe { String::from_utf8_unchecked(bytes) }) -} - -impl FileSystem for FileSystemOs { - fn read_to_string(&self, path: &Path) -> io::Result { - cfg_if! { - if #[cfg(feature = "yarn_pnp")] { - match VPath::from(path)? { - VPath::Zip(info) => { - self.pnp_lru.read_to_string(info.physical_base_path(), info.zip_path) - } - VPath::Virtual(info) => read_to_string(&info.physical_base_path()), - VPath::Native(path) => read_to_string(&path), - } - } else { - read_to_string(path) - } - } - } - - fn metadata(&self, path: &Path) -> io::Result { - cfg_if! { - if #[cfg(feature = "yarn_pnp")] { - match VPath::from(path)? { - VPath::Zip(info) => self - .pnp_lru - .file_type(info.physical_base_path(), info.zip_path) - .map(FileMetadata::from), - VPath::Virtual(info) => { - fs::metadata(info.physical_base_path()).map(FileMetadata::from) - } - VPath::Native(path) => fs::metadata(path).map(FileMetadata::from), - } - } else { - fs::metadata(path).map(FileMetadata::from) - } - } - } - - fn symlink_metadata(&self, path: &Path) -> io::Result { - fs::symlink_metadata(path).map(FileMetadata::from) - } - - fn canonicalize(&self, path: &Path) -> io::Result { - cfg_if! { - if #[cfg(feature = "yarn_pnp")] { - match VPath::from(path)? { - VPath::Zip(info) => { - dunce::canonicalize(info.physical_base_path().join(info.zip_path)) - } - VPath::Virtual(info) => dunce::canonicalize(info.physical_base_path()), - VPath::Native(path) => dunce::canonicalize(path), - } - } else if #[cfg(windows)] { - dunce::canonicalize(path) - } else { - use std::path::Component; - let mut path_buf = path.to_path_buf(); - loop { - let link = fs::read_link(&path_buf)?; - path_buf.pop(); - for component in link.components() { - match component { - Component::ParentDir => { - path_buf.pop(); - } - Component::Normal(seg) => { - #[cfg(target_family = "wasm")] - // Need to trim the extra \0 introduces by https://github.com/nodejs/uvwasi/issues/262 - { - path_buf.push(seg.to_string_lossy().trim_end_matches('\0')); - } - #[cfg(not(target_family = "wasm"))] - { - path_buf.push(seg); - } - } - Component::RootDir => { - path_buf = PathBuf::from("/"); - } - Component::CurDir | Component::Prefix(_) => {} - } - } - if !fs::symlink_metadata(&path_buf)?.is_symlink() { - break; - } - } - Ok(path_buf) - } - } - } -} - -#[test] -fn metadata() { - let meta = FileMetadata { is_file: true, is_dir: true, is_symlink: true }; - assert_eq!( - format!("{meta:?}"), - "FileMetadata { is_file: true, is_dir: true, is_symlink: true }" - ); - let _ = meta; -} diff --git a/src/lib.rs b/src/lib.rs deleted file mode 100644 index e6cb2246..00000000 --- a/src/lib.rs +++ /dev/null @@ -1,1755 +0,0 @@ -//! # Oxc Resolver -//! -//! Node.js [CommonJS][cjs] and [ECMAScript][esm] Module Resolution. -//! -//! Released on [crates.io](https://crates.io/crates/oxc_resolver) and [npm](https://www.npmjs.com/package/oxc-resolver). -//! -//! A module resolution is the process of finding the file referenced by a module specifier in -//! `import "specifier"` or `require("specifier")`. -//! -//! All [configuration options](ResolveOptions) are aligned with webpack's [enhanced-resolve]. -//! -//! ## Terminology -//! -//! ### Specifier -//! -//! For [CommonJS modules][cjs], -//! the specifier is the string passed to the `require` function. e.g. `"id"` in `require("id")`. -//! -//! For [ECMAScript modules][esm], -//! the specifier of an `import` statement is the string after the `from` keyword, -//! e.g. `'specifier'` in `import 'specifier'` or `import { sep } from 'specifier'`. -//! Specifiers are also used in export from statements, and as the argument to an `import()` expression. -//! -//! This is also named "request" in some places. -//! -//! ## References: -//! -//! * Algorithm adapted from Node.js [CommonJS Module Resolution Algorithm] and [ECMAScript Module Resolution Algorithm]. -//! * Tests are ported from [enhanced-resolve]. -//! * Some code is adapted from [parcel-resolver]. -//! * The documentation is copied from [webpack's resolve configuration](https://webpack.js.org/configuration/resolve). -//! -//! [enhanced-resolve]: https://github.com/webpack/enhanced-resolve -//! [CommonJS Module Resolution Algorithm]: https://nodejs.org/api/modules.html#all-together -//! [ECMAScript Module Resolution Algorithm]: https://nodejs.org/api/esm.html#resolution-algorithm-specification -//! [parcel-resolver]: https://github.com/parcel-bundler/parcel/blob/v2/packages/utils/node-resolver-rs -//! [cjs]: https://nodejs.org/api/modules.html -//! [esm]: https://nodejs.org/api/esm.html -//! -//! ## Feature flags -#![cfg_attr(feature = "document-features", doc = document_features::document_features!())] -#![cfg_attr(docsrs, feature(doc_auto_cfg))] -//! -//! ## Example -//! -//! ```rust,ignore -#![doc = include_str!("../examples/resolver.rs")] -//! ``` - -mod builtins; -mod cache; -mod context; -mod error; -mod file_system; -mod options; -mod package_json; -mod path; -mod resolution; -mod specifier; -mod tsconfig; - -#[cfg(test)] -mod tests; - -use std::{ - borrow::Cow, - cmp::Ordering, - ffi::OsStr, - fmt, - path::{Component, Path, PathBuf}, - sync::Arc, -}; - -use rustc_hash::FxHashSet; -use serde_json::Value as JSONValue; - -pub use crate::{ - builtins::NODEJS_BUILTINS, - error::{JSONError, ResolveError, SpecifierError}, - file_system::{FileMetadata, FileSystem}, - options::{ - Alias, AliasValue, EnforceExtension, ResolveOptions, Restriction, TsconfigOptions, - TsconfigReferences, - }, - package_json::PackageJson, - resolution::Resolution, -}; -use crate::{ - cache::{Cache, CachedPath}, - context::ResolveContext as Ctx, - file_system::FileSystemOs, - package_json::JSONMap, - path::{PathUtil, SLASH_START}, - specifier::Specifier, - tsconfig::ExtendsField, - tsconfig::{ProjectReference, TsConfig}, -}; - -type ResolveResult = Result, ResolveError>; - -/// Context returned from the [Resolver::resolve_with_context] API -#[derive(Debug, Default, Clone)] -pub struct ResolveContext { - /// Files that was found on file system - pub file_dependencies: FxHashSet, - - /// Dependencies that was not found on file system - pub missing_dependencies: FxHashSet, -} - -/// Resolver with the current operating system as the file system -pub type Resolver = ResolverGeneric; - -/// Generic implementation of the resolver, can be configured by the [FileSystem] trait -pub struct ResolverGeneric { - options: ResolveOptions, - cache: Arc>, -} - -impl fmt::Debug for ResolverGeneric { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - self.options.fmt(f) - } -} - -impl Default for ResolverGeneric { - fn default() -> Self { - Self::new(ResolveOptions::default()) - } -} - -impl ResolverGeneric { - pub fn new(options: ResolveOptions) -> Self { - Self { options: options.sanitize(), cache: Arc::new(Cache::new(Fs::default())) } - } -} - -impl ResolverGeneric { - pub fn new_with_file_system(file_system: Fs, options: ResolveOptions) -> Self { - Self { cache: Arc::new(Cache::new(file_system)), options: options.sanitize() } - } - - /// Clone the resolver using the same underlying cache. - #[must_use] - pub fn clone_with_options(&self, options: ResolveOptions) -> Self { - Self { options: options.sanitize(), cache: Arc::clone(&self.cache) } - } - - /// Returns the options. - pub fn options(&self) -> &ResolveOptions { - &self.options - } - - /// Clear the underlying cache. - pub fn clear_cache(&self) { - self.cache.clear(); - } - - /// Resolve `specifier` at an absolute path to a `directory`. - /// - /// A specifier is the string passed to require or import, i.e. `require("specifier")` or `import "specifier"`. - /// - /// `directory` must be an **absolute** path to a directory where the specifier is resolved against. - /// For CommonJS modules, it is the `__dirname` variable that contains the absolute path to the folder containing current module. - /// For ECMAScript modules, it is the value of `import.meta.url`. - /// - /// # Errors - /// - /// * See [ResolveError] - pub fn resolve>( - &self, - directory: P, - specifier: &str, - ) -> Result { - let mut ctx = Ctx::default(); - self.resolve_tracing(directory.as_ref(), specifier, &mut ctx) - } - - /// Resolve `specifier` at absolute `path` with [ResolveContext] - /// - /// # Errors - /// - /// * See [ResolveError] - pub fn resolve_with_context>( - &self, - directory: P, - specifier: &str, - resolve_context: &mut ResolveContext, - ) -> Result { - let mut ctx = Ctx::default(); - ctx.init_file_dependencies(); - let result = self.resolve_tracing(directory.as_ref(), specifier, &mut ctx); - if let Some(deps) = &mut ctx.file_dependencies { - resolve_context.file_dependencies.extend(deps.drain(..)); - } - if let Some(deps) = &mut ctx.missing_dependencies { - resolve_context.missing_dependencies.extend(deps.drain(..)); - } - result - } - - /// Wrap `resolve_impl` with `tracing` information - fn resolve_tracing( - &self, - directory: &Path, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - let span = tracing::debug_span!("resolve", path = ?directory, specifier = specifier); - let _enter = span.enter(); - let r = self.resolve_impl(directory, specifier, ctx); - match &r { - Ok(r) => { - tracing::debug!(options = ?self.options, path = ?directory, specifier = specifier, ret = ?r.path); - } - Err(err) => { - tracing::debug!(options = ?self.options, path = ?directory, specifier = specifier, err = ?err); - } - }; - r - } - - fn resolve_impl( - &self, - path: &Path, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - ctx.with_fully_specified(self.options.fully_specified); - let cached_path = self.cache.value(path); - let cached_path = self.require(&cached_path, specifier, ctx)?; - let path = self.load_realpath(&cached_path)?; - // enhanced-resolve: restrictions - self.check_restrictions(&path)?; - let package_json = cached_path.find_package_json(&self.cache.fs, &self.options, ctx)?; - if let Some(package_json) = &package_json { - // path must be inside the package. - debug_assert!(path.starts_with(package_json.directory())); - } - Ok(Resolution { - path, - query: ctx.query.take(), - fragment: ctx.fragment.take(), - package_json, - }) - } - - /// require(X) from module at path Y - /// - /// X: specifier - /// Y: path - /// - /// - fn require( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - ctx.test_for_infinite_recursion()?; - - // enhanced-resolve: parse - let (parsed, try_fragment_as_path) = self.load_parse(cached_path, specifier, ctx)?; - if let Some(path) = try_fragment_as_path { - return Ok(path); - } - - self.require_without_parse(cached_path, parsed.path(), ctx) - } - - fn require_without_parse( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - // tsconfig-paths - if let Some(path) = self.load_tsconfig_paths(cached_path, specifier, &mut Ctx::default())? { - return Ok(path); - } - - // enhanced-resolve: try alias - if let Some(path) = self.load_alias(cached_path, specifier, &self.options.alias, ctx)? { - return Ok(path); - } - - let result = match Path::new(specifier).components().next() { - // 2. If X begins with '/' - Some(Component::RootDir | Component::Prefix(_)) => { - self.require_absolute(cached_path, specifier, ctx) - } - // 3. If X begins with './' or '/' or '../' - Some(Component::CurDir | Component::ParentDir) => { - self.require_relative(cached_path, specifier, ctx) - } - // 4. If X begins with '#' - Some(Component::Normal(_)) if specifier.as_bytes()[0] == b'#' => { - self.require_hash(cached_path, specifier, ctx) - } - _ => { - // 1. If X is a core module, - // a. return the core module - // b. STOP - self.require_core(specifier)?; - - // (ESM) 5. Otherwise, - // Note: specifier is now a bare specifier. - // Set resolved the result of PACKAGE_RESOLVE(specifier, parentURL). - self.require_bare(cached_path, specifier, ctx) - } - }; - - result.or_else(|err| { - if err.is_ignore() { - return Err(err); - } - // enhanced-resolve: try fallback - self.load_alias(cached_path, specifier, &self.options.fallback, ctx) - .and_then(|value| value.ok_or(err)) - }) - } - - // PACKAGE_RESOLVE(packageSpecifier, parentURL) - // 3. If packageSpecifier is a Node.js builtin module name, then - // 1. Return the string "node:" concatenated with packageSpecifier. - fn require_core(&self, specifier: &str) -> Result<(), ResolveError> { - if self.options.builtin_modules { - let starts_with_node = specifier.starts_with("node:"); - if starts_with_node || NODEJS_BUILTINS.binary_search(&specifier).is_ok() { - let mut specifier = specifier.to_string(); - if !starts_with_node { - specifier = format!("node:{specifier}"); - } - return Err(ResolveError::Builtin(specifier)); - } - } - Ok(()) - } - - fn require_absolute( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - // Make sure only path prefixes gets called - debug_assert!(Path::new(specifier) - .components() - .next() - .is_some_and(|c| matches!(c, Component::RootDir | Component::Prefix(_)))); - if !self.options.prefer_relative && self.options.prefer_absolute { - if let Ok(path) = self.load_package_self_or_node_modules(cached_path, specifier, ctx) { - return Ok(path); - } - } - if let Some(path) = self.load_roots(specifier, ctx) { - return Ok(path); - } - // 2. If X begins with '/' - // a. set Y to be the file system root - let path = self.cache.value(Path::new(specifier)); - if let Some(path) = self.load_as_file_or_directory(&path, specifier, ctx)? { - return Ok(path); - } - Err(ResolveError::NotFound(specifier.to_string())) - } - - // 3. If X begins with './' or '/' or '../' - fn require_relative( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - // Make sure only relative or normal paths gets called - debug_assert!(Path::new(specifier).components().next().is_some_and(|c| matches!( - c, - Component::CurDir | Component::ParentDir | Component::Normal(_) - ))); - let path = cached_path.path().normalize_with(specifier); - let cached_path = self.cache.value(&path); - // a. LOAD_AS_FILE(Y + X) - // b. LOAD_AS_DIRECTORY(Y + X) - if let Some(path) = self.load_as_file_or_directory(&cached_path, specifier, ctx)? { - return Ok(path); - } - // c. THROW "not found" - Err(ResolveError::NotFound(specifier.to_string())) - } - - fn require_hash( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - debug_assert_eq!(specifier.chars().next(), Some('#')); - // a. LOAD_PACKAGE_IMPORTS(X, dirname(Y)) - if let Some(path) = self.load_package_imports(cached_path, specifier, ctx)? { - return Ok(path); - } - self.load_package_self_or_node_modules(cached_path, specifier, ctx) - } - - fn require_bare( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - // Make sure no other path prefixes gets called - debug_assert!(Path::new(specifier) - .components() - .next() - .is_some_and(|c| matches!(c, Component::Normal(_)))); - if self.options.prefer_relative { - if let Ok(path) = self.require_relative(cached_path, specifier, ctx) { - return Ok(path); - } - } - self.load_package_self_or_node_modules(cached_path, specifier, ctx) - } - - /// enhanced-resolve: ParsePlugin. - /// - /// 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`. - /// - /// - fn load_parse<'s>( - &self, - cached_path: &CachedPath, - specifier: &'s str, - ctx: &mut Ctx, - ) -> Result<(Specifier<'s>, Option), ResolveError> { - let parsed = Specifier::parse(specifier).map_err(ResolveError::Specifier)?; - ctx.with_query_fragment(parsed.query, parsed.fragment); - - // There is an edge-case where a request with # can be a path or a fragment -> try both - if ctx.fragment.is_some() && ctx.query.is_none() { - let specifier = parsed.path(); - let fragment = ctx.fragment.take().unwrap(); - let path = format!("{specifier}{fragment}"); - if let Ok(path) = self.require_without_parse(cached_path, &path, ctx) { - return Ok((parsed, Some(path))); - } - ctx.fragment.replace(fragment); - } - Ok((parsed, None)) - } - - fn load_package_self_or_node_modules( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - let (_, subpath) = Self::parse_package_specifier(specifier); - if subpath.is_empty() { - ctx.with_fully_specified(false); - } - // 5. LOAD_PACKAGE_SELF(X, dirname(Y)) - if let Some(path) = self.load_package_self(cached_path, specifier, ctx)? { - return Ok(path); - } - // 6. LOAD_NODE_MODULES(X, dirname(Y)) - if let Some(path) = self.load_node_modules(cached_path, specifier, ctx)? { - return Ok(path); - } - // 7. THROW "not found" - Err(ResolveError::NotFound(specifier.to_string())) - } - - /// LOAD_PACKAGE_IMPORTS(X, DIR) - fn load_package_imports( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - // 1. Find the closest package scope SCOPE to DIR. - // 2. If no scope was found, return. - let Some(package_json) = - cached_path.find_package_json(&self.cache.fs, &self.options, ctx)? - else { - return Ok(None); - }; - // 3. If the SCOPE/package.json "imports" is null or undefined, return. - // 4. let MATCH = PACKAGE_IMPORTS_RESOLVE(X, pathToFileURL(SCOPE), ["node", "require"]) defined in the ESM resolver. - if let Some(path) = self.package_imports_resolve(specifier, &package_json, ctx)? { - // 5. RESOLVE_ESM_MATCH(MATCH). - return self.resolve_esm_match(specifier, &path, ctx); - } - Ok(None) - } - - fn load_as_file(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - // enhanced-resolve feature: extension_alias - if let Some(path) = self.load_extension_alias(cached_path, ctx)? { - return Ok(Some(path)); - } - if self.options.enforce_extension.is_disabled() { - // 1. If X is a file, load X as its file extension format. STOP - if let Some(path) = self.load_alias_or_file(cached_path, ctx)? { - return Ok(Some(path)); - } - } - // 2. If X.js is a file, load X.js as JavaScript text. STOP - // 3. If X.json is a file, parse X.json to a JavaScript Object. STOP - // 4. If X.node is a file, load X.node as binary addon. STOP - if let Some(path) = self.load_extensions(cached_path, &self.options.extensions, ctx)? { - return Ok(Some(path)); - } - Ok(None) - } - - fn load_as_directory(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - // TODO: Only package.json is supported, so warn about having other values - // Checking for empty files is needed for omitting checks on package.json - // 1. If X/package.json is a file, - if !self.options.description_files.is_empty() { - // a. Parse X/package.json, and look for "main" field. - if let Some(package_json) = - cached_path.package_json(&self.cache.fs, &self.options, ctx)? - { - // b. If "main" is a falsy value, GOTO 2. - for main_field in package_json.main_fields(&self.options.main_fields) { - // c. let M = X + (json main field) - let main_field_path = cached_path.path().normalize_with(main_field); - // d. LOAD_AS_FILE(M) - let cached_path = self.cache.value(&main_field_path); - if let Some(path) = self.load_as_file(&cached_path, ctx)? { - return Ok(Some(path)); - } - // e. LOAD_INDEX(M) - if let Some(path) = self.load_index(&cached_path, ctx)? { - return Ok(Some(path)); - } - } - // f. LOAD_INDEX(X) DEPRECATED - // g. THROW "not found" - } - } - // 2. LOAD_INDEX(X) - self.load_index(cached_path, ctx) - } - - fn load_as_file_or_directory( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - if self.options.resolve_to_context { - return Ok(cached_path.is_dir(&self.cache.fs, ctx).then(|| cached_path.clone())); - } - if !specifier.ends_with('/') { - if let Some(path) = self.load_as_file(cached_path, ctx)? { - return Ok(Some(path)); - } - } - if cached_path.is_dir(&self.cache.fs, ctx) { - if let Some(path) = self.load_as_directory(cached_path, ctx)? { - return Ok(Some(path)); - } - } - Ok(None) - } - - fn load_extensions( - &self, - path: &CachedPath, - extensions: &[String], - ctx: &mut Ctx, - ) -> ResolveResult { - if ctx.fully_specified { - return Ok(None); - } - let path = path.path().as_os_str(); - for extension in extensions { - let mut path_with_extension = path.to_os_string(); - path_with_extension.reserve_exact(extension.len()); - path_with_extension.push(extension); - let cached_path = self.cache.value(Path::new(&path_with_extension)); - if let Some(path) = self.load_alias_or_file(&cached_path, ctx)? { - return Ok(Some(path)); - } - } - Ok(None) - } - - fn load_realpath(&self, cached_path: &CachedPath) -> Result { - if self.options.symlinks { - cached_path.realpath(&self.cache.fs).map_err(ResolveError::from) - } else { - Ok(cached_path.to_path_buf()) - } - } - - fn check_restrictions(&self, path: &Path) -> Result<(), ResolveError> { - // https://github.com/webpack/enhanced-resolve/blob/a998c7d218b7a9ec2461fc4fddd1ad5dd7687485/lib/RestrictionsPlugin.js#L19-L24 - fn is_inside(path: &Path, parent: &Path) -> bool { - if !path.starts_with(parent) { - return false; - } - if path.as_os_str().len() == parent.as_os_str().len() { - return true; - } - path.strip_prefix(parent).is_ok_and(|p| p == Path::new("./")) - } - for restriction in &self.options.restrictions { - match restriction { - Restriction::Path(restricted_path) => { - if !is_inside(path, restricted_path) { - return Err(ResolveError::Restriction( - path.to_path_buf(), - restricted_path.clone(), - )); - } - } - Restriction::RegExp(_) => { - return Err(ResolveError::Unimplemented("Restriction with regex")) - } - } - } - Ok(()) - } - - fn load_index(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - for main_file in &self.options.main_files { - let main_path = cached_path.path().normalize_with(main_file); - let cached_path = self.cache.value(&main_path); - if self.options.enforce_extension.is_disabled() { - if let Some(path) = self.load_alias_or_file(&cached_path, ctx)? { - return Ok(Some(path)); - } - } - // 1. If X/index.js is a file, load X/index.js as JavaScript text. STOP - // 2. If X/index.json is a file, parse X/index.json to a JavaScript object. STOP - // 3. If X/index.node is a file, load X/index.node as binary addon. STOP - if let Some(path) = self.load_extensions(&cached_path, &self.options.extensions, ctx)? { - return Ok(Some(path)); - } - } - Ok(None) - } - - fn load_alias_or_file(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - if !self.options.alias_fields.is_empty() { - if let Some(package_json) = - cached_path.find_package_json(&self.cache.fs, &self.options, ctx)? - { - if let Some(path) = - self.load_browser_field(cached_path, None, &package_json, ctx)? - { - return Ok(Some(path)); - } - } - } - // enhanced-resolve: try file as alias - let alias_specifier = cached_path.path().to_string_lossy(); - if let Some(path) = - self.load_alias(cached_path, &alias_specifier, &self.options.alias, ctx)? - { - return Ok(Some(path)); - } - if cached_path.is_file(&self.cache.fs, ctx) { - return Ok(Some(cached_path.clone())); - } - Ok(None) - } - - fn load_node_modules( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - #[cfg(feature = "yarn_pnp")] - { - if let Some(resolved_path) = self.load_pnp(cached_path, specifier, ctx)? { - return Ok(Some(resolved_path)); - } - } - - let (package_name, subpath) = Self::parse_package_specifier(specifier); - // 1. let DIRS = NODE_MODULES_PATHS(START) - // 2. for each DIR in DIRS: - for module_name in &self.options.modules { - for cached_path in std::iter::successors(Some(cached_path), |p| p.parent()) { - // Skip if /path/to/node_modules does not exist - if !cached_path.is_dir(&self.cache.fs, ctx) { - continue; - } - - let Some(cached_path) = self.get_module_directory(cached_path, module_name, ctx) - else { - continue; - }; - // Optimize node_modules lookup by inspecting whether the package exists - // From LOAD_PACKAGE_EXPORTS(X, DIR) - // 1. Try to interpret X as a combination of NAME and SUBPATH where the name - // may have a @scope/ prefix and the subpath begins with a slash (`/`). - if !package_name.is_empty() { - let package_path = cached_path.path().normalize_with(package_name); - let cached_path = self.cache.value(&package_path); - // Try foo/node_modules/package_name - if cached_path.is_dir(&self.cache.fs, ctx) { - // a. LOAD_PACKAGE_EXPORTS(X, DIR) - if let Some(path) = - self.load_package_exports(specifier, subpath, &cached_path, ctx)? - { - return Ok(Some(path)); - } - } else { - // foo/node_modules/package_name is not a directory, so useless to check inside it - if !subpath.is_empty() { - continue; - } - // Skip if the directory lead to the scope package does not exist - // i.e. `foo/node_modules/@scope` is not a directory for `foo/node_modules/@scope/package` - if package_name.starts_with('@') { - if let Some(path) = cached_path.parent() { - if !path.is_dir(&self.cache.fs, ctx) { - continue; - } - } - } - } - } - - // Try as file or directory for all other cases - // b. LOAD_AS_FILE(DIR/X) - // c. LOAD_AS_DIRECTORY(DIR/X) - let node_module_file = cached_path.path().normalize_with(specifier); - let cached_path = self.cache.value(&node_module_file); - if let Some(path) = self.load_as_file_or_directory(&cached_path, specifier, ctx)? { - return Ok(Some(path)); - } - } - } - Ok(None) - } - - #[cfg(feature = "yarn_pnp")] - fn load_pnp( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result, ResolveError> { - let Some(pnp_manifest) = &self.options.pnp_manifest else { return Ok(None) }; - let resolution = - pnp::resolve_to_unqualified_via_manifest(pnp_manifest, specifier, cached_path.path()); - match resolution { - Ok(pnp::Resolution::Resolved(path, subpath)) => { - let cached_path = self.cache.value(&path); - let export_resolution = self.load_package_exports( - specifier, - &subpath.unwrap_or_default(), - &cached_path, - ctx, - )?; - if export_resolution.is_some() { - return Ok(export_resolution); - } - let file_or_directory_resolution = - self.load_as_file_or_directory(&cached_path, specifier, ctx)?; - if file_or_directory_resolution.is_some() { - return Ok(file_or_directory_resolution); - } - Err(ResolveError::NotFound(specifier.to_string())) - } - - Ok(pnp::Resolution::Skipped) => Ok(None), - - Err(_) => { - // Todo: Add a ResolveError::Pnp variant? - Err(ResolveError::NotFound(specifier.to_string())) - } - } - } - - fn get_module_directory( - &self, - cached_path: &CachedPath, - module_name: &str, - ctx: &mut Ctx, - ) -> Option { - if module_name == "node_modules" { - cached_path.cached_node_modules(&self.cache, ctx) - } else if cached_path.path().components().next_back() - == Some(Component::Normal(OsStr::new(module_name))) - { - Some(cached_path.clone()) - } else { - cached_path.module_directory(module_name, &self.cache, ctx) - } - } - - fn load_package_exports( - &self, - specifier: &str, - subpath: &str, - cached_path: &CachedPath, - ctx: &mut Ctx, - ) -> ResolveResult { - // 2. If X does not match this pattern or DIR/NAME/package.json is not a file, - // return. - let Some(package_json) = cached_path.package_json(&self.cache.fs, &self.options, ctx)? - else { - return Ok(None); - }; - // 3. Parse DIR/NAME/package.json, and look for "exports" field. - // 4. If "exports" is null or undefined, return. - // 5. let MATCH = PACKAGE_EXPORTS_RESOLVE(pathToFileURL(DIR/NAME), "." + SUBPATH, - // `package.json` "exports", ["node", "require"]) defined in the ESM resolver. - // Note: The subpath is not prepended with a dot on purpose - for exports in package_json.exports_fields(&self.options.exports_fields) { - if let Some(path) = self.package_exports_resolve( - cached_path.path(), - &format!(".{subpath}"), - exports, - ctx, - )? { - // 6. RESOLVE_ESM_MATCH(MATCH) - return self.resolve_esm_match(specifier, &path, ctx); - }; - } - Ok(None) - } - - fn load_package_self( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - // 1. Find the closest package scope SCOPE to DIR. - // 2. If no scope was found, return. - let Some(package_json) = - cached_path.find_package_json(&self.cache.fs, &self.options, ctx)? - else { - return Ok(None); - }; - // 3. If the SCOPE/package.json "exports" is null or undefined, return. - // 4. If the SCOPE/package.json "name" is not the first segment of X, return. - if let Some(subpath) = package_json - .name - .as_ref() - .and_then(|package_name| Self::strip_package_name(specifier, package_name)) - { - // 5. let MATCH = PACKAGE_EXPORTS_RESOLVE(pathToFileURL(SCOPE), - // "." + X.slice("name".length), `package.json` "exports", ["node", "require"]) - // defined in the ESM resolver. - let package_url = package_json.directory(); - // Note: The subpath is not prepended with a dot on purpose - // because `package_exports_resolve` matches subpath without the leading dot. - for exports in package_json.exports_fields(&self.options.exports_fields) { - if let Some(cached_path) = - self.package_exports_resolve(package_url, &format!(".{subpath}"), exports, ctx)? - { - // 6. RESOLVE_ESM_MATCH(MATCH) - return self.resolve_esm_match(specifier, &cached_path, ctx); - } - } - } - self.load_browser_field(cached_path, Some(specifier), &package_json, ctx) - } - - /// RESOLVE_ESM_MATCH(MATCH) - fn resolve_esm_match( - &self, - specifier: &str, - cached_path: &CachedPath, - ctx: &mut Ctx, - ) -> ResolveResult { - // 1. let RESOLVED_PATH = fileURLToPath(MATCH) - // 2. If the file at RESOLVED_PATH exists, load RESOLVED_PATH as its extension format. STOP - // - // Non-compliant ESM can result in a directory, so directory is tried as well. - if let Some(path) = self.load_as_file_or_directory(cached_path, "", ctx)? { - return Ok(Some(path)); - } - // 3. THROW "not found" - Err(ResolveError::NotFound(specifier.to_string())) - } - - /// enhanced-resolve: AliasFieldPlugin for [ResolveOptions::alias_fields] - fn load_browser_field( - &self, - cached_path: &CachedPath, - module_specifier: Option<&str>, - package_json: &PackageJson, - ctx: &mut Ctx, - ) -> ResolveResult { - let path = cached_path.path(); - let Some(new_specifier) = package_json.resolve_browser_field( - path, - module_specifier, - &self.options.alias_fields, - )? - else { - return Ok(None); - }; - // Abort when resolving recursive module - if module_specifier.is_some_and(|s| s == new_specifier) { - return Ok(None); - } - if ctx.resolving_alias.as_ref().is_some_and(|s| s == new_specifier) { - // Complete when resolving to self `{"./a.js": "./a.js"}` - if new_specifier.strip_prefix("./").filter(|s| path.ends_with(Path::new(s))).is_some() { - return if cached_path.is_file(&self.cache.fs, ctx) { - Ok(Some(cached_path.clone())) - } else { - Err(ResolveError::NotFound(new_specifier.to_string())) - }; - } - return Err(ResolveError::Recursion); - } - ctx.with_resolving_alias(new_specifier.to_string()); - ctx.with_fully_specified(false); - let cached_path = self.cache.value(package_json.directory()); - self.require(&cached_path, new_specifier, ctx).map(Some) - } - - /// enhanced-resolve: AliasPlugin for [ResolveOptions::alias] and [ResolveOptions::fallback]. - fn load_alias( - &self, - cached_path: &CachedPath, - specifier: &str, - aliases: &Alias, - ctx: &mut Ctx, - ) -> ResolveResult { - for (alias_key_raw, specifiers) in aliases { - let alias_key = if let Some(alias_key) = alias_key_raw.strip_suffix('$') { - if alias_key != specifier { - continue; - } - alias_key - } else { - let strip_package_name = Self::strip_package_name(specifier, alias_key_raw); - if strip_package_name.is_none() { - continue; - } - alias_key_raw - }; - // It should stop resolving when all of the tried alias values - // failed to resolve. - // - let mut should_stop = false; - for r in specifiers { - match r { - AliasValue::Path(alias_value) => { - if let Some(path) = self.load_alias_value( - cached_path, - alias_key, - alias_value, - specifier, - ctx, - &mut should_stop, - )? { - return Ok(Some(path)); - } - } - AliasValue::Ignore => { - let path = cached_path.path().normalize_with(alias_key); - return Err(ResolveError::Ignored(path)); - } - } - } - if should_stop { - return Err(ResolveError::MatchedAliasNotFound( - specifier.to_string(), - alias_key.to_string(), - )); - } - } - Ok(None) - } - - fn load_alias_value( - &self, - cached_path: &CachedPath, - alias_key: &str, - alias_value: &str, - request: &str, - ctx: &mut Ctx, - should_stop: &mut bool, - ) -> ResolveResult { - if request != alias_value - && !request.strip_prefix(alias_value).is_some_and(|prefix| prefix.starts_with('/')) - { - let tail = &request[alias_key.len()..]; - - let new_specifier = if tail.is_empty() { - Cow::Borrowed(alias_value) - } else { - let alias_value = Path::new(alias_value).normalize(); - // Must not append anything to alias_value if it is a file. - let alias_value_cached_path = self.cache.value(&alias_value); - if alias_value_cached_path.is_file(&self.cache.fs, ctx) { - return Ok(None); - } - - // Remove the leading slash so the final path is concatenated. - let tail = tail.trim_start_matches(SLASH_START); - let normalized = alias_value.normalize_with(tail); - Cow::Owned(normalized.to_string_lossy().to_string()) - }; - - *should_stop = true; - ctx.with_fully_specified(false); - return match self.require(cached_path, new_specifier.as_ref(), ctx) { - Err(ResolveError::NotFound(_) | ResolveError::MatchedAliasNotFound(_, _)) => { - Ok(None) - } - Ok(path) => return Ok(Some(path)), - Err(err) => return Err(err), - }; - } - Ok(None) - } - - /// Given an extension alias map `{".js": [".ts", ".js"]}`, - /// load the mapping instead of the provided extension - /// - /// This is an enhanced-resolve feature - /// - /// # Errors - /// - /// * [ResolveError::ExtensionAlias]: When all of the aliased extensions are not found - fn load_extension_alias(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - if self.options.extension_alias.is_empty() { - return Ok(None); - } - let Some(path_extension) = cached_path.path().extension() else { - return Ok(None); - }; - let Some((_, extensions)) = self - .options - .extension_alias - .iter() - .find(|(ext, _)| OsStr::new(ext.trim_start_matches('.')) == path_extension) - else { - return Ok(None); - }; - let path = cached_path.path().with_extension(""); - let path = path.as_os_str(); - ctx.with_fully_specified(true); - for extension in extensions { - let mut path_with_extension = path.to_os_string(); - path_with_extension.reserve_exact(extension.len()); - path_with_extension.push(extension); - let cached_path = self.cache.value(Path::new(&path_with_extension)); - // Bail if path is module directory such as `ipaddr.js` - if cached_path.is_dir(&self.cache.fs, ctx) { - ctx.with_fully_specified(false); - return Ok(None); - } - if let Some(path) = self.load_alias_or_file(&cached_path, ctx)? { - ctx.with_fully_specified(false); - return Ok(Some(path)); - } - } - Err(ResolveError::ExtensionAlias(cached_path.to_path_buf())) - } - - /// enhanced-resolve: RootsPlugin - /// - /// A list of directories where requests of server-relative URLs (starting with '/') are resolved, - /// defaults to context configuration option. - /// - /// On non-Windows systems these requests are resolved as an absolute path first. - fn load_roots(&self, specifier: &str, ctx: &mut Ctx) -> Option { - if self.options.roots.is_empty() { - return None; - } - if let Some(specifier) = specifier.strip_prefix(SLASH_START) { - for root in &self.options.roots { - let cached_path = self.cache.value(root); - if let Ok(path) = self.require_relative(&cached_path, specifier, ctx) { - return Some(path); - } - } - } - None - } - - fn load_tsconfig_paths( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - let Some(tsconfig_options) = &self.options.tsconfig else { - return Ok(None); - }; - let tsconfig = self.load_tsconfig( - /* root */ true, - &tsconfig_options.config_file, - &tsconfig_options.references, - )?; - let paths = tsconfig.resolve(cached_path.path(), specifier); - for path in paths { - let cached_path = self.cache.value(&path); - if let Ok(path) = self.require_relative(&cached_path, ".", ctx) { - return Ok(Some(path)); - } - } - Ok(None) - } - - fn load_tsconfig( - &self, - root: bool, - path: &Path, - references: &TsconfigReferences, - ) -> Result, ResolveError> { - self.cache.tsconfig(root, path, |tsconfig| { - let directory = self.cache.value(tsconfig.directory()); - tracing::trace!(tsconfig = ?tsconfig, "load_tsconfig"); - - // Extend tsconfig - if let Some(extends) = &tsconfig.extends { - let extended_tsconfig_paths = match extends { - ExtendsField::Single(s) => { - vec![self.get_extended_tsconfig_path(&directory, tsconfig, s)?] - } - ExtendsField::Multiple(specifiers) => specifiers - .iter() - .map(|s| self.get_extended_tsconfig_path(&directory, tsconfig, s)) - .collect::, ResolveError>>()?, - }; - for extended_tsconfig_path in extended_tsconfig_paths { - let extended_tsconfig = self.load_tsconfig( - /* root */ false, - &extended_tsconfig_path, - &TsconfigReferences::Disabled, - )?; - tsconfig.extend_tsconfig(&extended_tsconfig); - } - } - - // Load project references - match references { - TsconfigReferences::Disabled => { - tsconfig.references.drain(..); - } - TsconfigReferences::Auto => {} - TsconfigReferences::Paths(paths) => { - tsconfig.references = paths - .iter() - .map(|path| ProjectReference { path: path.clone(), tsconfig: None }) - .collect(); - } - } - if !tsconfig.references.is_empty() { - let directory = tsconfig.directory().to_path_buf(); - for reference in &mut tsconfig.references { - let reference_tsconfig_path = directory.normalize_with(&reference.path); - let tsconfig = self.cache.tsconfig( - /* root */ true, - &reference_tsconfig_path, - |reference_tsconfig| { - if reference_tsconfig.path == tsconfig.path { - return Err(ResolveError::TsconfigSelfReference( - reference_tsconfig.path.clone(), - )); - } - Ok(()) - }, - )?; - reference.tsconfig.replace(tsconfig); - } - } - Ok(()) - }) - } - - fn get_extended_tsconfig_path( - &self, - directory: &CachedPath, - tsconfig: &TsConfig, - specifier: &str, - ) -> Result { - match specifier.as_bytes().first() { - None => Err(ResolveError::Specifier(SpecifierError::Empty(specifier.to_string()))), - Some(b'/') => Ok(PathBuf::from(specifier)), - Some(b'.') => Ok(tsconfig.directory().normalize_with(specifier)), - _ => self - .clone_with_options(ResolveOptions { - description_files: vec![], - extensions: vec![".json".into()], - main_files: vec!["tsconfig.json".into()], - ..ResolveOptions::default() - }) - .load_package_self_or_node_modules(directory, specifier, &mut Ctx::default()) - .map(|p| p.to_path_buf()) - .map_err(|err| match err { - ResolveError::NotFound(_) => { - ResolveError::TsconfigNotFound(PathBuf::from(specifier)) - } - _ => err, - }), - } - } - - /// PACKAGE_RESOLVE(packageSpecifier, parentURL) - fn package_resolve( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - let (package_name, subpath) = Self::parse_package_specifier(specifier); - - // 3. If packageSpecifier is a Node.js builtin module name, then - // 1. Return the string "node:" concatenated with packageSpecifier. - self.require_core(package_name)?; - - // 11. While parentURL is not the file system root, - for module_name in &self.options.modules { - for cached_path in std::iter::successors(Some(cached_path), |p| p.parent()) { - // 1. Let packageURL be the URL resolution of "node_modules/" concatenated with packageSpecifier, relative to parentURL. - let Some(cached_path) = self.get_module_directory(cached_path, module_name, ctx) - else { - continue; - }; - // 2. Set parentURL to the parent folder URL of parentURL. - let package_path = cached_path.path().normalize_with(package_name); - let cached_path = self.cache.value(&package_path); - // 3. If the folder at packageURL does not exist, then - // 1. Continue the next loop iteration. - if cached_path.is_dir(&self.cache.fs, ctx) { - // 4. Let pjson be the result of READ_PACKAGE_JSON(packageURL). - if let Some(package_json) = - cached_path.package_json(&self.cache.fs, &self.options, ctx)? - { - // 5. If pjson is not null and pjson.exports is not null or undefined, then - // 1. Return the result of PACKAGE_EXPORTS_RESOLVE(packageURL, packageSubpath, pjson.exports, defaultConditions). - for exports in package_json.exports_fields(&self.options.exports_fields) { - if let Some(path) = self.package_exports_resolve( - cached_path.path(), - &format!(".{subpath}"), - exports, - ctx, - )? { - return Ok(Some(path)); - } - } - // 6. Otherwise, if packageSubpath is equal to ".", then - if subpath == "." { - // 1. If pjson.main is a string, then - for main_field in package_json.main_fields(&self.options.main_fields) { - // 1. Return the URL resolution of main in packageURL. - let path = cached_path.path().normalize_with(main_field); - let cached_path = self.cache.value(&path); - if cached_path.is_file(&self.cache.fs, ctx) { - return Ok(Some(cached_path)); - } - } - } - } - let subpath = format!(".{subpath}"); - ctx.with_fully_specified(false); - return self.require(&cached_path, &subpath, ctx).map(Some); - } - } - } - - Err(ResolveError::NotFound(specifier.to_string())) - } - - /// PACKAGE_EXPORTS_RESOLVE(packageURL, subpath, exports, conditions) - fn package_exports_resolve( - &self, - package_url: &Path, - subpath: &str, - exports: &JSONValue, - ctx: &mut Ctx, - ) -> ResolveResult { - let conditions = &self.options.condition_names; - // 1. If exports is an Object with both a key starting with "." and a key not starting with ".", throw an Invalid Package Configuration error. - if let JSONValue::Object(map) = exports { - let mut has_dot = false; - let mut without_dot = false; - for key in map.keys() { - let starts_with_dot_or_hash = key.starts_with(['.', '#']); - has_dot = has_dot || starts_with_dot_or_hash; - without_dot = without_dot || !starts_with_dot_or_hash; - if has_dot && without_dot { - return Err(ResolveError::InvalidPackageConfig( - package_url.join("package.json"), - )); - } - } - } - // 2. If subpath is equal to ".", then - // Note: subpath is not prepended with a dot when passed in. - if subpath == "." { - // enhanced-resolve appends query and fragment when resolving exports field - // https://github.com/webpack/enhanced-resolve/blob/a998c7d218b7a9ec2461fc4fddd1ad5dd7687485/lib/ExportsFieldPlugin.js#L57-L62 - // This is only need when querying the main export, otherwise ctx is passed through. - if ctx.query.is_some() || ctx.fragment.is_some() { - let query = ctx.query.clone().unwrap_or_default(); - let fragment = ctx.fragment.clone().unwrap_or_default(); - return Err(ResolveError::PackagePathNotExported( - format!("./{}{query}{fragment}", subpath.trim_start_matches('.')), - package_url.join("package.json"), - )); - } - // 1. Let mainExport be undefined. - let main_export = match exports { - // 2. If exports is a String or Array, or an Object containing no keys starting with ".", then - JSONValue::String(_) | JSONValue::Array(_) => { - // 1. Set mainExport to exports. - Some(exports) - } - // 3. Otherwise if exports is an Object containing a "." property, then - JSONValue::Object(map) => { - // 1. Set mainExport to exports["."]. - map.get(".").map_or_else( - || { - if map.keys().any(|key| key.starts_with("./") || key.starts_with('#')) { - None - } else { - Some(exports) - } - }, - Some, - ) - } - _ => None, - }; - // 4. If mainExport is not undefined, then - if let Some(main_export) = main_export { - // 1. Let resolved be the result of PACKAGE_TARGET_RESOLVE( packageURL, mainExport, null, false, conditions). - let resolved = self.package_target_resolve( - package_url, - ".", - main_export, - None, - /* is_imports */ false, - conditions, - ctx, - )?; - // 2. If resolved is not null or undefined, return resolved. - if let Some(path) = resolved { - return Ok(Some(path)); - } - } - } - // 3. Otherwise, if exports is an Object and all keys of exports start with ".", then - if let JSONValue::Object(exports) = exports { - // 1. Let matchKey be the string "./" concatenated with subpath. - // Note: `package_imports_exports_resolve` does not require the leading dot. - let match_key = &subpath; - // 2. Let resolved be the result of PACKAGE_IMPORTS_EXPORTS_RESOLVE( matchKey, exports, packageURL, false, conditions). - if let Some(path) = self.package_imports_exports_resolve( - match_key, - exports, - package_url, - /* is_imports */ false, - conditions, - ctx, - )? { - // 3. If resolved is not null or undefined, return resolved. - return Ok(Some(path)); - } - } - // 4. Throw a Package Path Not Exported error. - Err(ResolveError::PackagePathNotExported( - subpath.to_string(), - package_url.join("package.json"), - )) - } - - /// PACKAGE_IMPORTS_RESOLVE(specifier, parentURL, conditions) - fn package_imports_resolve( - &self, - specifier: &str, - package_json: &PackageJson, - ctx: &mut Ctx, - ) -> Result, ResolveError> { - // 1. Assert: specifier begins with "#". - debug_assert!(specifier.starts_with('#'), "{specifier}"); - // 2. If specifier is exactly equal to "#" or starts with "#/", then - // 1. Throw an Invalid Module Specifier error. - // 3. Let packageURL be the result of LOOKUP_PACKAGE_SCOPE(parentURL). - // 4. If packageURL is not null, then - - // 1. Let pjson be the result of READ_PACKAGE_JSON(packageURL). - // 2. If pjson.imports is a non-null Object, then - - // 1. Let resolved be the result of PACKAGE_IMPORTS_EXPORTS_RESOLVE( specifier, pjson.imports, packageURL, true, conditions). - let mut has_imports = false; - for imports in package_json.imports_fields(&self.options.imports_fields) { - if !has_imports { - has_imports = true; - // TODO: fill in test case for this case - if specifier == "#" || specifier.starts_with("#/") { - return Err(ResolveError::InvalidModuleSpecifier( - specifier.to_string(), - package_json.path.clone(), - )); - } - } - if let Some(path) = self.package_imports_exports_resolve( - specifier, - imports, - package_json.directory(), - /* is_imports */ true, - &self.options.condition_names, - ctx, - )? { - // 2. If resolved is not null or undefined, return resolved. - return Ok(Some(path)); - } - } - - // 5. Throw a Package Import Not Defined error. - if has_imports { - Err(ResolveError::PackageImportNotDefined( - specifier.to_string(), - package_json.path.clone(), - )) - } else { - Ok(None) - } - } - - /// PACKAGE_IMPORTS_EXPORTS_RESOLVE(matchKey, matchObj, packageURL, isImports, conditions) - fn package_imports_exports_resolve( - &self, - match_key: &str, - match_obj: &JSONMap, - package_url: &Path, - is_imports: bool, - conditions: &[String], - ctx: &mut Ctx, - ) -> ResolveResult { - // enhanced-resolve behaves differently, it throws - // Error: CachedPath to directories is not possible with the exports field (specifier was ./dist/) - if match_key.ends_with('/') { - return Ok(None); - } - // 1. If matchKey is a key of matchObj and does not contain "*", then - if !match_key.contains('*') { - // 1. Let target be the value of matchObj[matchKey]. - if let Some(target) = match_obj.get(match_key) { - // 2. Return the result of PACKAGE_TARGET_RESOLVE(packageURL, target, null, isImports, conditions). - return self.package_target_resolve( - package_url, - match_key, - target, - None, - is_imports, - conditions, - ctx, - ); - } - } - - let mut best_target = None; - let mut best_match = ""; - let mut best_key = ""; - // 2. Let expansionKeys be the list of keys of matchObj containing only a single "*", sorted by the sorting function PATTERN_KEY_COMPARE which orders in descending order of specificity. - // 3. For each key expansionKey in expansionKeys, do - for (expansion_key, target) in match_obj { - if expansion_key.starts_with("./") || expansion_key.starts_with('#') { - // 1. Let patternBase be the substring of expansionKey up to but excluding the first "*" character. - if let Some((pattern_base, pattern_trailer)) = expansion_key.split_once('*') { - // 2. If matchKey starts with but is not equal to patternBase, then - if match_key.starts_with(pattern_base) - // 1. Let patternTrailer be the substring of expansionKey from the index after the first "*" character. - && !pattern_trailer.contains('*') - // 2. If patternTrailer has zero length, or if matchKey ends with patternTrailer and the length of matchKey is greater than or equal to the length of expansionKey, then - && (pattern_trailer.is_empty() - || (match_key.len() >= expansion_key.len() - && match_key.ends_with(pattern_trailer))) - && Self::pattern_key_compare(best_key, expansion_key).is_gt() - { - // 1. Let target be the value of matchObj[expansionKey]. - best_target = Some(target); - // 2. Let patternMatch be the substring of matchKey starting at the index of the length of patternBase up to the length of matchKey minus the length of patternTrailer. - best_match = - &match_key[pattern_base.len()..match_key.len() - pattern_trailer.len()]; - best_key = expansion_key; - } - } else if expansion_key.ends_with('/') - && match_key.starts_with(expansion_key) - && Self::pattern_key_compare(best_key, expansion_key).is_gt() - { - // TODO: [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./dist/" in the "exports" field module resolution of the package at xxx/package.json. - best_target = Some(target); - best_match = &match_key[expansion_key.len()..]; - best_key = expansion_key; - } - } - } - if let Some(best_target) = best_target { - // 3. Return the result of PACKAGE_TARGET_RESOLVE(packageURL, target, patternMatch, isImports, conditions). - return self.package_target_resolve( - package_url, - best_key, - best_target, - Some(best_match), - is_imports, - conditions, - ctx, - ); - } - // 4. Return null. - Ok(None) - } - - /// PACKAGE_TARGET_RESOLVE(packageURL, target, patternMatch, isImports, conditions) - #[allow(clippy::too_many_arguments)] - fn package_target_resolve( - &self, - package_url: &Path, - target_key: &str, - target: &JSONValue, - pattern_match: Option<&str>, - is_imports: bool, - conditions: &[String], - ctx: &mut Ctx, - ) -> ResolveResult { - fn normalize_string_target<'a>( - target_key: &'a str, - target: &'a str, - pattern_match: Option<&'a str>, - package_url: &Path, - ) -> Result, ResolveError> { - let target = if let Some(pattern_match) = pattern_match { - if !target_key.contains('*') && !target.contains('*') { - // enhanced-resolve behaviour - // TODO: [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./dist/" in the "exports" field module resolution of the package at xxx/package.json. - if target_key.ends_with('/') && target.ends_with('/') { - Cow::Owned(format!("{target}{pattern_match}")) - } else { - return Err(ResolveError::InvalidPackageConfigDirectory( - package_url.join("package.json"), - )); - } - } else { - Cow::Owned(target.replace('*', pattern_match)) - } - } else { - Cow::Borrowed(target) - }; - Ok(target) - } - - match target { - // 1. If target is a String, then - JSONValue::String(target) => { - // 1. If target does not start with "./", then - if !target.starts_with("./") { - // 1. If isImports is false, or if target starts with "../" or "/", or if target is a valid URL, then - if !is_imports || target.starts_with("../") || target.starts_with('/') { - // 1. Throw an Invalid Package Target error. - return Err(ResolveError::InvalidPackageTarget( - target.to_string(), - target_key.to_string(), - package_url.join("package.json"), - )); - } - // 2. If patternMatch is a String, then - // 1. Return PACKAGE_RESOLVE(target with every instance of "*" replaced by patternMatch, packageURL + "/"). - let target = - normalize_string_target(target_key, target, pattern_match, package_url)?; - let package_url = self.cache.value(package_url); - // // 3. Return PACKAGE_RESOLVE(target, packageURL + "/"). - return self.package_resolve(&package_url, &target, ctx); - } - - // 2. If target split on "/" or "\" contains any "", ".", "..", or "node_modules" segments after the first "." segment, case insensitive and including percent encoded variants, throw an Invalid Package Target error. - // 3. Let resolvedTarget be the URL resolution of the concatenation of packageURL and target. - // 4. Assert: resolvedTarget is contained in packageURL. - // 5. If patternMatch is null, then - let target = - normalize_string_target(target_key, target, pattern_match, package_url)?; - if Path::new(target.as_ref()).is_invalid_exports_target() { - return Err(ResolveError::InvalidPackageTarget( - target.to_string(), - target_key.to_string(), - package_url.join("package.json"), - )); - } - let resolved_target = package_url.normalize_with(target.as_ref()); - // 6. If patternMatch split on "/" or "\" contains any "", ".", "..", or "node_modules" segments, case insensitive and including percent encoded variants, throw an Invalid Module Specifier error. - // 7. Return the URL resolution of resolvedTarget with every instance of "*" replaced with patternMatch. - let value = self.cache.value(&resolved_target); - return Ok(Some(value)); - } - // 2. Otherwise, if target is a non-null Object, then - JSONValue::Object(target) => { - // 1. If exports contains any index property keys, as defined in ECMA-262 6.1.7 Array Index, throw an Invalid Package Configuration error. - // 2. For each property p of target, in object insertion order as, - for (key, target_value) in target { - // 1. If p equals "default" or conditions contains an entry for p, then - if key == "default" || conditions.contains(key) { - // 1. Let targetValue be the value of the p property in target. - // 2. Let resolved be the result of PACKAGE_TARGET_RESOLVE( packageURL, targetValue, patternMatch, isImports, conditions). - let resolved = self.package_target_resolve( - package_url, - target_key, - target_value, - pattern_match, - is_imports, - conditions, - ctx, - ); - // 3. If resolved is equal to undefined, continue the loop. - if let Some(path) = resolved? { - // 4. Return resolved. - return Ok(Some(path)); - } - } - } - // 3. Return undefined. - return Ok(None); - } - // 3. Otherwise, if target is an Array, then - JSONValue::Array(targets) => { - // 1. If _target.length is zero, return null. - if targets.is_empty() { - // Note: return PackagePathNotExported has the same effect as return because there are no matches. - return Err(ResolveError::PackagePathNotExported( - pattern_match.unwrap_or(".").to_string(), - package_url.join("package.json"), - )); - } - // 2. For each item targetValue in target, do - for (i, target_value) in targets.iter().enumerate() { - // 1. Let resolved be the result of PACKAGE_TARGET_RESOLVE( packageURL, targetValue, patternMatch, isImports, conditions), continuing the loop on any Invalid Package Target error. - let resolved = self.package_target_resolve( - package_url, - target_key, - target_value, - pattern_match, - is_imports, - conditions, - ctx, - ); - - if resolved.is_err() && i == targets.len() { - return resolved; - } - - // 2. If resolved is undefined, continue the loop. - if let Ok(Some(path)) = resolved { - // 3. Return resolved. - return Ok(Some(path)); - } - } - // 3. Return or throw the last fallback resolution null return or error. - // Note: see `resolved.is_err() && i == targets.len()` - } - _ => {} - } - // 4. Otherwise, if target is null, return null. - Ok(None) - // 5. Otherwise throw an Invalid Package Target error. - } - - // Returns (module, subpath) - // https://github.com/nodejs/node/blob/8f0f17e1e3b6c4e58ce748e06343c5304062c491/lib/internal/modules/esm/resolve.js#L688 - fn parse_package_specifier(specifier: &str) -> (&str, &str) { - let mut separator_index = specifier.as_bytes().iter().position(|b| *b == b'/'); - // let mut valid_package_name = true; - // let mut is_scoped = false; - if specifier.starts_with('@') { - // is_scoped = true; - if separator_index.is_none() || specifier.is_empty() { - // valid_package_name = false; - } else if let Some(index) = &separator_index { - separator_index = specifier[*index + 1..] - .as_bytes() - .iter() - .position(|b| *b == b'/') - .map(|i| i + *index + 1); - } - } - let package_name = - separator_index.map_or(specifier, |separator_index| &specifier[..separator_index]); - - // TODO: https://github.com/nodejs/node/blob/8f0f17e1e3b6c4e58ce748e06343c5304062c491/lib/internal/modules/esm/resolve.js#L705C1-L714C1 - // Package name cannot have leading . and cannot have percent-encoding or - // \\ separators. - // if (RegExpPrototypeExec(invalidPackageNameRegEx, packageName) !== null) - // validPackageName = false; - - // if (!validPackageName) { - // throw new ERR_INVALID_MODULE_SPECIFIER( - // specifier, 'is not a valid package name', fileURLToPath(base)); - // } - let package_subpath = - separator_index.map_or("", |separator_index| &specifier[separator_index..]); - (package_name, package_subpath) - } - - /// PATTERN_KEY_COMPARE(keyA, keyB) - fn pattern_key_compare(key_a: &str, key_b: &str) -> Ordering { - if key_a.is_empty() { - return Ordering::Greater; - } - // 1. Assert: keyA ends with "/" or contains only a single "*". - debug_assert!(key_a.ends_with('/') || key_a.match_indices('*').count() == 1, "{key_a}"); - // 2. Assert: keyB ends with "/" or contains only a single "*". - debug_assert!(key_b.ends_with('/') || key_b.match_indices('*').count() == 1, "{key_b}"); - // 3. Let baseLengthA be the index of "*" in keyA plus one, if keyA contains "*", or the length of keyA otherwise. - let a_pos = key_a.chars().position(|c| c == '*'); - let base_length_a = a_pos.map_or(key_a.len(), |p| p + 1); - // 4. Let baseLengthB be the index of "*" in keyB plus one, if keyB contains "*", or the length of keyB otherwise. - let b_pos = key_b.chars().position(|c| c == '*'); - let base_length_b = b_pos.map_or(key_b.len(), |p| p + 1); - // 5. If baseLengthA is greater than baseLengthB, return -1. - if base_length_a > base_length_b { - return Ordering::Less; - } - // 6. If baseLengthB is greater than baseLengthA, return 1. - if base_length_b > base_length_a { - return Ordering::Greater; - } - // 7. If keyA does not contain "*", return 1. - if !key_a.contains('*') { - return Ordering::Greater; - } - // 8. If keyB does not contain "*", return -1. - if !key_b.contains('*') { - return Ordering::Less; - } - // 9. If the length of keyA is greater than the length of keyB, return -1. - if key_a.len() > key_b.len() { - return Ordering::Less; - } - // 10. If the length of keyB is greater than the length of keyA, return 1. - if key_b.len() > key_a.len() { - return Ordering::Greater; - } - // 11. Return 0. - Ordering::Equal - } - - fn strip_package_name<'a>(specifier: &'a str, package_name: &'a str) -> Option<&'a str> { - specifier - .strip_prefix(package_name) - .filter(|tail| tail.is_empty() || tail.starts_with(SLASH_START)) - } -} diff --git a/src/options.rs b/src/options.rs deleted file mode 100644 index 7893890e..00000000 --- a/src/options.rs +++ /dev/null @@ -1,633 +0,0 @@ -use std::path::Path; -use std::{fmt, path::PathBuf}; - -/// Module Resolution Options -/// -/// Options are directly ported from [enhanced-resolve](https://github.com/webpack/enhanced-resolve#resolver-options). -/// -/// See [webpack resolve](https://webpack.js.org/configuration/resolve/) for information and examples -#[derive(Debug, Clone)] -pub struct ResolveOptions { - /// Path to TypeScript configuration file. - /// - /// Default `None` - pub tsconfig: Option, - - /// Create aliases to import or require certain modules more easily. - /// - /// An alias is used to replace a whole path or part of a path. - /// For example, to alias a commonly used `src/` folders: `vec![("@/src"), vec![AliasValue::Path("/path/to/src")]]` - /// - /// A trailing $ can also be added to the given object's keys to signify an exact match. - /// - /// See [webpack's `resolve.alias` documentation](https://webpack.js.org/configuration/resolve/#resolvealias) for a list of use cases. - pub alias: Alias, - - /// A list of alias fields in description files. - /// - /// Specify a field, such as `browser`, to be parsed according to [this specification](https://github.com/defunctzombie/package-browser-field-spec). - /// Can be a path to json object such as `["path", "to", "exports"]`. - /// - /// Default `[]` - pub alias_fields: Vec>, - - /// Condition names for exports field which defines entry points of a package. - /// - /// The key order in the exports field is significant. During condition matching, earlier entries have higher priority and take precedence over later entries. - /// - /// Default `[]` - pub condition_names: Vec, - - /// The JSON files to use for descriptions. (There was once a `bower.json`.) - /// - /// Default `["package.json"]` - pub description_files: Vec, - - /// Set to [EnforceExtension::Enabled] for [ESM Mandatory file extensions](https://nodejs.org/api/esm.html#mandatory-file-extensions). - /// - /// If `enforce_extension` is set to [EnforceExtension::Enabled], resolution will not allow extension-less files. - /// This means `require('./foo.js')` will resolve, while `require('./foo')` will not. - /// - /// The default value for `enforce_extension` is [EnforceExtension::Auto], which is changed upon initialization. - /// - /// It changes to [EnforceExtension::Enabled] if [ResolveOptions::extensions] contains an empty string; - /// otherwise, this value changes to [EnforceExtension::Disabled]. - /// - /// Explicitly set the value to [EnforceExtension::Disabled] to disable this automatic behavior. - /// - /// For reference, this behavior is aligned with `enhanced-resolve`. See . - pub enforce_extension: EnforceExtension, - - /// A list of exports fields in description files. - /// - /// Can be a path to a JSON object such as `["path", "to", "exports"]`. - /// - /// Default `[["exports"]]`. - pub exports_fields: Vec>, - - /// Fields from `package.json` which are used to provide the internal requests of a package - /// (requests starting with # are considered internal). - /// - /// Can be a path to a JSON object such as `["path", "to", "imports"]`. - /// - /// Default `[["imports"]]`. - pub imports_fields: Vec>, - - /// An object which maps extension to extension aliases. - /// - /// Default `{}` - pub extension_alias: Vec<(String, Vec)>, - - /// Attempt to resolve these extensions in order. - /// - /// If multiple files share the same name but have different extensions, - /// will resolve the one with the extension listed first in the array and skip the rest. - /// - /// All extensions must have a leading dot. - /// - /// Default `[".js", ".json", ".node"]` - pub extensions: Vec, - - /// Redirect module requests when normal resolving fails. - /// - /// Default `[]` - pub fallback: Alias, - - /// 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). - /// - /// See also webpack configuration [resolve.fullySpecified](https://webpack.js.org/configuration/module/#resolvefullyspecified) - /// - /// Default `false` - pub fully_specified: bool, - - /// A list of main fields in description files - /// - /// Default `["main"]`. - pub main_fields: Vec, - - /// The filename to be used while resolving directories. - /// - /// Default `["index"]` - pub main_files: Vec, - - /// A list of directories to resolve modules from, can be absolute path or folder name. - /// - /// Default `["node_modules"]` - pub modules: Vec, - - /// A manifest loaded from pnp::load_pnp_manifest. - /// - /// Default `None` - #[cfg(feature = "yarn_pnp")] - pub pnp_manifest: Option, - - /// Resolve to a context instead of a file. - /// - /// Default `false` - pub resolve_to_context: bool, - - /// Prefer to resolve module requests as relative requests instead of using modules from node_modules directories. - /// - /// Default `false` - pub prefer_relative: bool, - - /// Prefer to resolve server-relative urls as absolute paths before falling back to resolve in ResolveOptions::roots. - /// - /// Default `false` - pub prefer_absolute: bool, - - /// A list of resolve restrictions to restrict the paths that a request can be resolved on. - /// - /// Default `[]` - pub restrictions: Vec, - - /// A list of directories where requests of server-relative URLs (starting with '/') are resolved. - /// On non-Windows systems these requests are resolved as an absolute path first. - /// - /// Default `[]` - pub roots: Vec, - - /// Whether to resolve symlinks to their symlinked location. - /// When enabled, symlinked resources are resolved to their real path, not their symlinked location. - /// Note that this may cause module resolution to fail when using tools that symlink packages (like npm link). - /// - /// Default `true` - pub symlinks: bool, - - /// Whether to parse [module.builtinModules](https://nodejs.org/api/module.html#modulebuiltinmodules) or not. - /// For example, "zlib" will throw [crate::ResolveError::Builtin] when set to true. - /// - /// Default `false` - pub builtin_modules: bool, -} - -impl ResolveOptions { - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// - /// let options = ResolveOptions::default().with_condition_names(&["bar"]); - /// assert_eq!(options.condition_names, vec!["bar".to_string()]) - /// ``` - #[must_use] - pub fn with_condition_names(mut self, names: &[&str]) -> Self { - self.condition_names = names.iter().map(ToString::to_string).collect::>(); - self - } - - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// - /// let options = ResolveOptions::default().with_builtin_modules(false); - /// assert_eq!(options.builtin_modules, false) - /// ``` - #[must_use] - pub fn with_builtin_modules(mut self, flag: bool) -> Self { - self.builtin_modules = flag; - self - } - - /// Adds a single root to the options - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_root("foo"); - /// assert_eq!(options.roots, vec![PathBuf::from("foo")]) - /// ``` - #[must_use] - pub fn with_root>(mut self, root: P) -> Self { - self.roots.push(root.as_ref().to_path_buf()); - self - } - - /// Adds a single extension to the list of extensions - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_extension("jsonc"); - /// assert!(options.extensions.contains(&"jsonc".to_string())); - /// ``` - #[must_use] - pub fn with_extension>(mut self, extension: S) -> Self { - self.extensions.push(extension.into()); - self - } - - /// Adds a single main field to the list of fields - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_main_field("something"); - /// assert!(options.main_fields.contains(&"something".to_string())); - /// ``` - #[must_use] - pub fn with_main_field>(mut self, field: S) -> Self { - self.main_fields.push(field.into()); - self - } - - /// Changes how the extension should be treated - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions, EnforceExtension}; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_force_extension(EnforceExtension::Enabled); - /// assert_eq!(options.enforce_extension, EnforceExtension::Enabled); - /// ``` - #[must_use] - pub fn with_force_extension(mut self, enforce_extension: EnforceExtension) -> Self { - self.enforce_extension = enforce_extension; - self - } - - /// Sets the value for [ResolveOptions::fully_specified] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_fully_specified(true); - /// assert_eq!(options.fully_specified, true); - /// ``` - #[must_use] - pub fn with_fully_specified(mut self, fully_specified: bool) -> Self { - self.fully_specified = fully_specified; - self - } - /// Sets the value for [ResolveOptions::prefer_relative] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_prefer_relative(true); - /// assert_eq!(options.prefer_relative, true); - /// ``` - #[must_use] - pub fn with_prefer_relative(mut self, flag: bool) -> Self { - self.prefer_relative = flag; - self - } - /// Sets the value for [ResolveOptions::prefer_absolute] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_prefer_absolute(true); - /// assert_eq!(options.prefer_absolute, true); - /// ``` - #[must_use] - pub fn with_prefer_absolute(mut self, flag: bool) -> Self { - self.prefer_absolute = flag; - self - } - - /// Changes the value of [ResolveOptions::symlinks] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// - /// let options = ResolveOptions::default().with_symbolic_link(false); - /// assert_eq!(options.symlinks, false); - /// ``` - #[must_use] - pub fn with_symbolic_link(mut self, flag: bool) -> Self { - self.symlinks = flag; - self - } - - /// Adds a module to [ResolveOptions::modules] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// - /// let options = ResolveOptions::default().with_module("module"); - /// assert!(options.modules.contains(&"module".to_string())); - /// ``` - #[must_use] - pub fn with_module>(mut self, module: M) -> Self { - self.modules.push(module.into()); - self - } - - /// Adds a main file to [ResolveOptions::main_files] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// - /// let options = ResolveOptions::default().with_main_file("foo"); - /// assert!(options.main_files.contains(&"foo".to_string())); - /// ``` - #[must_use] - pub fn with_main_file>(mut self, module: M) -> Self { - self.main_files.push(module.into()); - self - } - - pub(crate) fn sanitize(mut self) -> Self { - debug_assert!( - self.extensions.iter().filter(|e| !e.is_empty()).all(|e| e.starts_with('.')), - "All extensions must start with a leading dot" - ); - // Set `enforceExtension` to `true` when [ResolveOptions::extensions] contains an empty string. - // See - if self.enforce_extension == EnforceExtension::Auto { - if !self.extensions.is_empty() && self.extensions.iter().any(String::is_empty) { - self.enforce_extension = EnforceExtension::Enabled; - } else { - self.enforce_extension = EnforceExtension::Disabled; - } - } - self - } -} - -/// Value for [ResolveOptions::enforce_extension] -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -pub enum EnforceExtension { - Auto, - Enabled, - Disabled, -} - -impl EnforceExtension { - pub const fn is_auto(&self) -> bool { - matches!(self, Self::Auto) - } - - pub const fn is_enabled(&self) -> bool { - matches!(self, Self::Enabled) - } - - pub const fn is_disabled(&self) -> bool { - matches!(self, Self::Disabled) - } -} - -/// Alias for [ResolveOptions::alias] and [ResolveOptions::fallback] -pub type Alias = Vec<(String, Vec)>; - -/// Alias Value for [ResolveOptions::alias] and [ResolveOptions::fallback] -#[derive(Debug, Clone, Hash, PartialEq, Eq)] -pub enum AliasValue { - /// The path value - Path(String), - - /// The `false` value - Ignore, -} - -impl From for AliasValue -where - S: Into, -{ - fn from(value: S) -> Self { - Self::Path(value.into()) - } -} - -/// Value for [ResolveOptions::restrictions] -#[derive(Debug, Clone)] -pub enum Restriction { - Path(PathBuf), - RegExp(String), -} - -/// Tsconfig Options for [ResolveOptions::tsconfig] -/// -/// Derived from [tsconfig-paths-webpack-plugin](https://github.com/dividab/tsconfig-paths-webpack-plugin#options) -#[derive(Debug, Clone)] -pub struct TsconfigOptions { - /// Allows you to specify where to find the TypeScript configuration file. - /// You may provide - /// * a relative path to the configuration file. It will be resolved relative to cwd. - /// * an absolute path to the configuration file. - pub config_file: PathBuf, - - /// Support for Typescript Project References. - pub references: TsconfigReferences, -} - -/// Configuration for [TsconfigOptions::references] -#[derive(Debug, Clone)] -pub enum TsconfigReferences { - Disabled, - /// Use the `references` field from tsconfig of `config_file`. - Auto, - /// Manually provided relative or absolute path. - Paths(Vec), -} - -impl Default for ResolveOptions { - fn default() -> Self { - Self { - tsconfig: None, - alias: vec![], - alias_fields: vec![], - condition_names: vec![], - description_files: vec!["package.json".into()], - enforce_extension: EnforceExtension::Auto, - extension_alias: vec![], - exports_fields: vec![vec!["exports".into()]], - imports_fields: vec![vec!["imports".into()]], - extensions: vec![".js".into(), ".json".into(), ".node".into()], - fallback: vec![], - fully_specified: false, - main_fields: vec!["main".into()], - main_files: vec!["index".into()], - modules: vec!["node_modules".into()], - #[cfg(feature = "yarn_pnp")] - pnp_manifest: None, - resolve_to_context: false, - prefer_relative: false, - prefer_absolute: false, - restrictions: vec![], - roots: vec![], - symlinks: true, - builtin_modules: false, - } - } -} - -// For tracing -impl fmt::Display for ResolveOptions { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - if let Some(tsconfig) = &self.tsconfig { - write!(f, "tsconfig:{tsconfig:?},")?; - } - if !self.alias.is_empty() { - write!(f, "alias:{:?},", self.alias)?; - } - if !self.alias_fields.is_empty() { - write!(f, "alias_fields:{:?},", self.alias_fields)?; - } - if !self.condition_names.is_empty() { - write!(f, "condition_names:{:?},", self.condition_names)?; - } - if self.enforce_extension.is_enabled() { - write!(f, "enforce_extension:{:?},", self.enforce_extension)?; - } - if !self.exports_fields.is_empty() { - write!(f, "exports_fields:{:?},", self.exports_fields)?; - } - if !self.imports_fields.is_empty() { - write!(f, "imports_fields:{:?},", self.imports_fields)?; - } - if !self.extension_alias.is_empty() { - write!(f, "extension_alias:{:?},", self.extension_alias)?; - } - if !self.extensions.is_empty() { - write!(f, "extensions:{:?},", self.extensions)?; - } - if !self.fallback.is_empty() { - write!(f, "fallback:{:?},", self.fallback)?; - } - if self.fully_specified { - write!(f, "fully_specified:{:?},", self.fully_specified)?; - } - if !self.main_fields.is_empty() { - write!(f, "main_fields:{:?},", self.main_fields)?; - } - if !self.main_files.is_empty() { - write!(f, "main_files:{:?},", self.main_files)?; - } - if !self.modules.is_empty() { - write!(f, "modules:{:?},", self.modules)?; - } - if self.resolve_to_context { - write!(f, "resolve_to_context:{:?},", self.resolve_to_context)?; - } - if self.prefer_relative { - write!(f, "prefer_relative:{:?},", self.prefer_relative)?; - } - if self.prefer_absolute { - write!(f, "prefer_absolute:{:?},", self.prefer_absolute)?; - } - if !self.restrictions.is_empty() { - write!(f, "restrictions:{:?},", self.restrictions)?; - } - if !self.roots.is_empty() { - write!(f, "roots:{:?},", self.roots)?; - } - if self.symlinks { - write!(f, "symlinks:{:?},", self.symlinks)?; - } - if self.builtin_modules { - write!(f, "builtin_modules:{:?},", self.builtin_modules)?; - } - Ok(()) - } -} - -#[cfg(test)] -mod test { - use super::{ - AliasValue, EnforceExtension, ResolveOptions, Restriction, TsconfigOptions, - TsconfigReferences, - }; - use std::path::PathBuf; - - #[test] - fn enforce_extension() { - assert!(EnforceExtension::Auto.is_auto()); - assert!(!EnforceExtension::Enabled.is_auto()); - assert!(!EnforceExtension::Disabled.is_auto()); - - assert!(!EnforceExtension::Auto.is_enabled()); - assert!(EnforceExtension::Enabled.is_enabled()); - assert!(!EnforceExtension::Disabled.is_enabled()); - - assert!(!EnforceExtension::Auto.is_disabled()); - assert!(!EnforceExtension::Enabled.is_disabled()); - assert!(EnforceExtension::Disabled.is_disabled()); - } - - #[test] - fn display() { - let options = ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: PathBuf::from("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - alias: vec![("a".into(), vec![AliasValue::Ignore])], - alias_fields: vec![vec!["browser".into()]], - condition_names: vec!["require".into()], - enforce_extension: EnforceExtension::Enabled, - extension_alias: vec![(".js".into(), vec![".ts".into()])], - exports_fields: vec![vec!["exports".into()]], - imports_fields: vec![vec!["imports".into()]], - fallback: vec![("fallback".into(), vec![AliasValue::Ignore])], - fully_specified: true, - resolve_to_context: true, - prefer_relative: true, - prefer_absolute: true, - restrictions: vec![Restriction::Path(PathBuf::from("restrictions"))], - roots: vec![PathBuf::from("roots")], - builtin_modules: true, - ..ResolveOptions::default() - }; - - let expected = r#"tsconfig:TsconfigOptions { config_file: "tsconfig.json", references: Auto },alias:[("a", [Ignore])],alias_fields:[["browser"]],condition_names:["require"],enforce_extension:Enabled,exports_fields:[["exports"]],imports_fields:[["imports"]],extension_alias:[(".js", [".ts"])],extensions:[".js", ".json", ".node"],fallback:[("fallback", [Ignore])],fully_specified:true,main_fields:["main"],main_files:["index"],modules:["node_modules"],resolve_to_context:true,prefer_relative:true,prefer_absolute:true,restrictions:[Path("restrictions")],roots:["roots"],symlinks:true,builtin_modules:true,"#; - assert_eq!(format!("{options}"), expected); - - let options = ResolveOptions { - alias: vec![], - alias_fields: vec![], - builtin_modules: false, - condition_names: vec![], - description_files: vec![], - enforce_extension: EnforceExtension::Disabled, - exports_fields: vec![], - extension_alias: vec![], - extensions: vec![], - fallback: vec![], - fully_specified: false, - imports_fields: vec![], - main_fields: vec![], - main_files: vec![], - modules: vec![], - #[cfg(feature = "yarn_pnp")] - pnp_manifest: None, - prefer_absolute: false, - prefer_relative: false, - resolve_to_context: false, - restrictions: vec![], - roots: vec![], - symlinks: false, - tsconfig: None, - }; - - assert_eq!(format!("{options}"), ""); - } -} diff --git a/src/package_json.rs b/src/package_json.rs deleted file mode 100644 index 7e05d202..00000000 --- a/src/package_json.rs +++ /dev/null @@ -1,219 +0,0 @@ -//! package.json definitions -//! -//! Code related to export field are copied from [Parcel's resolver](https://github.com/parcel-bundler/parcel/blob/v2/packages/utils/node-resolver-rs/src/package_json.rs) -use std::path::{Path, PathBuf}; - -use serde_json::Value as JSONValue; - -use crate::{path::PathUtil, ResolveError}; - -pub type JSONMap = serde_json::Map; - -/// Deserialized package.json -#[derive(Debug, Default)] -pub struct PackageJson { - /// Path to `package.json`. Contains the `package.json` filename. - pub path: PathBuf, - - /// Realpath to `package.json`. Contains the `package.json` filename. - pub realpath: PathBuf, - - /// The "name" field defines your package's name. - /// The "name" field can be used in addition to the "exports" field to self-reference a package using its name. - /// - /// - pub name: Option, - - /// The "type" field. - /// - /// - pub r#type: Option, - - /// The "sideEffects" field. - /// - /// - pub side_effects: Option, - - raw_json: std::sync::Arc, -} - -impl PackageJson { - /// # Panics - /// # Errors - pub(crate) fn parse( - path: PathBuf, - realpath: PathBuf, - json: &str, - ) -> Result { - let mut raw_json: JSONValue = serde_json::from_str(json)?; - let mut package_json = Self::default(); - - if let Some(json_object) = raw_json.as_object_mut() { - // Remove large fields that are useless for pragmatic use. - #[cfg(feature = "package_json_raw_json_api")] - { - json_object.remove("description"); - json_object.remove("keywords"); - json_object.remove("scripts"); - json_object.remove("dependencies"); - json_object.remove("devDependencies"); - json_object.remove("peerDependencies"); - json_object.remove("optionalDependencies"); - } - - // Add name, type and sideEffects. - package_json.name = - json_object.get("name").and_then(|field| field.as_str()).map(ToString::to_string); - package_json.r#type = json_object.get("type").cloned(); - package_json.side_effects = json_object.get("sideEffects").cloned(); - } - - package_json.path = path; - package_json.realpath = realpath; - package_json.raw_json = std::sync::Arc::new(raw_json); - Ok(package_json) - } - - fn get_value_by_path<'a>( - fields: &'a serde_json::Map, - path: &[String], - ) -> Option<&'a JSONValue> { - if path.is_empty() { - return None; - } - let mut value = fields.get(&path[0])?; - for key in path.iter().skip(1) { - if let Some(inner_value) = value.as_object().and_then(|o| o.get(key)) { - value = inner_value; - } else { - return None; - } - } - Some(value) - } - - /// Raw serde json value of `package.json`. - /// - /// This is currently used in Rspack for: - /// * getting the `sideEffects` field - /// * query in - search on GitHub indicates query on the `type` field. - /// - /// To reduce overall memory consumption, large fields that useless for pragmatic use are removed. - /// They are: `description`, `keywords`, `scripts`, - /// `dependencies` and `devDependencies`, `peerDependencies`, `optionalDependencies`. - #[cfg(feature = "package_json_raw_json_api")] - pub fn raw_json(&self) -> &std::sync::Arc { - &self.raw_json - } - - /// Directory to `package.json` - /// - /// # Panics - /// - /// * When the package.json path is misconfigured. - pub fn directory(&self) -> &Path { - debug_assert!(self.realpath.file_name().is_some_and(|x| x == "package.json")); - self.realpath.parent().unwrap() - } - - /// The "main" field defines the entry point of a package when imported by name via a node_modules lookup. Its value is a path. - /// - /// When a package has an "exports" field, this will take precedence over the "main" field when importing the package by name. - /// - /// Values are dynamically retrieved from [ResolveOptions::main_fields]. - /// - /// - pub(crate) fn main_fields<'a>( - &'a self, - main_fields: &'a [String], - ) -> impl Iterator + '_ { - main_fields - .iter() - .filter_map(|main_field| self.raw_json.get(main_field)) - .filter_map(|value| value.as_str()) - } - - /// The "exports" field allows defining the entry points of a package when imported by name loaded either via a node_modules lookup or a self-reference to its own name. - /// - /// - pub(crate) fn exports_fields<'a>( - &'a self, - exports_fields: &'a [Vec], - ) -> impl Iterator + '_ { - exports_fields.iter().filter_map(|object_path| { - self.raw_json - .as_object() - .and_then(|json_object| Self::get_value_by_path(json_object, object_path)) - }) - } - - /// In addition to the "exports" field, there is a package "imports" field to create private mappings that only apply to import specifiers from within the package itself. - /// - /// - pub(crate) fn imports_fields<'a>( - &'a self, - imports_fields: &'a [Vec], - ) -> impl Iterator + '_ { - imports_fields.iter().filter_map(|object_path| { - self.raw_json - .as_object() - .and_then(|json_object| Self::get_value_by_path(json_object, object_path)) - .and_then(|value| value.as_object()) - }) - } - - /// The "browser" field is provided by a module author as a hint to javascript bundlers or component tools when packaging modules for client side use. - /// Multiple values are configured by [ResolveOptions::alias_fields]. - /// - /// - fn browser_fields<'a>( - &'a self, - alias_fields: &'a [Vec], - ) -> impl Iterator + '_ { - alias_fields.iter().filter_map(|object_path| { - self.raw_json - .as_object() - .and_then(|json_object| Self::get_value_by_path(json_object, object_path)) - // Only object is valid, all other types are invalid - // https://github.com/webpack/enhanced-resolve/blob/3a28f47788de794d9da4d1702a3a583d8422cd48/lib/AliasFieldPlugin.js#L44-L52 - .and_then(|value| value.as_object()) - }) - } - - /// Resolve the request string for this package.json by looking at the `browser` field. - /// - /// # Errors - /// - /// * Returns [ResolveError::Ignored] for `"path": false` in `browser` field. - pub(crate) fn resolve_browser_field<'a>( - &'a self, - path: &Path, - request: Option<&str>, - alias_fields: &'a [Vec], - ) -> Result, ResolveError> { - for object in self.browser_fields(alias_fields) { - if let Some(request) = request { - if let Some(value) = object.get(request) { - return Self::alias_value(path, value); - } - } else { - let dir = self.path.parent().unwrap(); - for (key, value) in object { - let joined = dir.normalize_with(key); - if joined == path { - return Self::alias_value(path, value); - } - } - } - } - Ok(None) - } - - fn alias_value<'a>(key: &Path, value: &'a JSONValue) -> Result, ResolveError> { - match value { - JSONValue::String(value) => Ok(Some(value.as_str())), - JSONValue::Bool(b) if !b => Err(ResolveError::Ignored(key.to_path_buf())), - _ => Ok(None), - } - } -} diff --git a/src/path.rs b/src/path.rs deleted file mode 100644 index f66fdd76..00000000 --- a/src/path.rs +++ /dev/null @@ -1,132 +0,0 @@ -//! Path Utilities -//! -//! Code adapted from the following libraries -//! * [path-absolutize](https://docs.rs/path-absolutize) -//! * [normalize_path](https://docs.rs/normalize-path) -use std::path::{Component, Path, PathBuf}; - -pub const SLASH_START: &[char; 2] = &['/', '\\']; - -/// Extension trait to add path normalization to std's [`Path`]. -pub trait PathUtil { - /// Normalize this path without performing I/O. - /// - /// All redundant separator and up-level references are collapsed. - /// - /// However, this does not resolve links. - fn normalize(&self) -> PathBuf; - - /// Normalize with subpath assuming this path is normalized without performing I/O. - /// - /// All redundant separator and up-level references are collapsed. - /// - /// However, this does not resolve links. - fn normalize_with>(&self, subpath: P) -> PathBuf; - - /// Defined in ESM PACKAGE_TARGET_RESOLVE - /// If target split on "/" or "\" contains any "", ".", "..", or "node_modules" segments after the first "." segment, case insensitive and including percent encoded variants - fn is_invalid_exports_target(&self) -> bool; -} - -impl PathUtil for Path { - // https://github.com/parcel-bundler/parcel/blob/e0b99c2a42e9109a9ecbd6f537844a1b33e7faf5/packages/utils/node-resolver-rs/src/path.rs#L7 - fn normalize(&self) -> PathBuf { - let mut components = self.components().peekable(); - let mut ret = if let Some(c @ Component::Prefix(..)) = components.peek() { - let buf = PathBuf::from(c.as_os_str()); - components.next(); - buf - } else { - PathBuf::new() - }; - - for component in components { - match component { - Component::Prefix(..) => unreachable!("Path {:?}", self), - Component::RootDir => { - ret.push(component.as_os_str()); - } - Component::CurDir => {} - Component::ParentDir => { - ret.pop(); - } - Component::Normal(c) => { - ret.push(c); - } - } - } - - ret - } - - // https://github.com/parcel-bundler/parcel/blob/e0b99c2a42e9109a9ecbd6f537844a1b33e7faf5/packages/utils/node-resolver-rs/src/path.rs#L37 - fn normalize_with>(&self, subpath: B) -> PathBuf { - let subpath = subpath.as_ref(); - - let mut components = subpath.components(); - - let Some(head) = components.next() else { return subpath.to_path_buf() }; - - if matches!(head, Component::Prefix(..) | Component::RootDir) { - return subpath.to_path_buf(); - } - - let mut ret = self.to_path_buf(); - for component in std::iter::once(head).chain(components) { - match component { - Component::CurDir => {} - Component::ParentDir => { - ret.pop(); - } - Component::Normal(c) => { - ret.push(c); - } - Component::Prefix(..) | Component::RootDir => { - unreachable!("Path {:?} Subpath {:?}", self, subpath) - } - } - } - - ret - } - - fn is_invalid_exports_target(&self) -> bool { - self.components().enumerate().any(|(index, c)| match c { - Component::ParentDir => true, - Component::CurDir => index > 0, - Component::Normal(c) => c.eq_ignore_ascii_case("node_modules"), - _ => false, - }) - } -} - -// https://github.com/webpack/enhanced-resolve/blob/main/test/path.test.js -#[test] -fn is_invalid_exports_target() { - let test_cases = [ - "../a.js", - "../", - "./a/b/../../../c.js", - "./a/b/../../../", - "./../../c.js", - "./../../", - "./a/../b/../../c.js", - "./a/../b/../../", - "./././../", - ]; - - for case in test_cases { - assert!(Path::new(case).is_invalid_exports_target(), "{case}"); - } - - assert!(!Path::new("C:").is_invalid_exports_target()); - assert!(!Path::new("/").is_invalid_exports_target()); -} - -#[test] -fn normalize() { - assert_eq!(Path::new("/foo/.././foo/").normalize(), Path::new("/foo")); - assert_eq!(Path::new("C://").normalize(), Path::new("C://")); - assert_eq!(Path::new("C:").normalize(), Path::new("C:")); - assert_eq!(Path::new(r"\\server\share").normalize(), Path::new(r"\\server\share")); -} diff --git a/src/resolution.rs b/src/resolution.rs deleted file mode 100644 index a3aaa2e7..00000000 --- a/src/resolution.rs +++ /dev/null @@ -1,92 +0,0 @@ -use crate::package_json::PackageJson; -use std::{ - fmt, - path::{Path, PathBuf}, - sync::Arc, -}; - -/// The final path resolution with optional `?query` and `#fragment` -#[derive(Clone)] -pub struct Resolution { - pub(crate) path: PathBuf, - - /// path query `?query`, contains `?`. - pub(crate) query: Option, - - /// path fragment `#query`, contains `#`. - pub(crate) fragment: Option, - - pub(crate) package_json: Option>, -} - -impl fmt::Debug for Resolution { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - f.debug_struct("Resolution") - .field("path", &self.path) - .field("query", &self.query) - .field("fragment", &self.fragment) - .field("package_json", &self.package_json.as_ref().map(|p| &p.path)) - .finish() - } -} - -impl PartialEq for Resolution { - fn eq(&self, other: &Self) -> bool { - self.path == other.path && self.query == other.query && self.fragment == other.fragment - } -} -impl Eq for Resolution {} - -impl Resolution { - /// Returns the path without query and fragment - pub fn path(&self) -> &Path { - &self.path - } - - /// Returns the path without query and fragment - pub fn into_path_buf(self) -> PathBuf { - self.path - } - - /// Returns the path query `?query`, contains the leading `?` - pub fn query(&self) -> Option<&str> { - self.query.as_deref() - } - - /// Returns the path fragment `#fragment`, contains the leading `#` - pub fn fragment(&self) -> Option<&str> { - self.fragment.as_deref() - } - - /// Returns serialized package_json - pub fn package_json(&self) -> Option<&Arc> { - self.package_json.as_ref() - } - - /// Returns the full path with query and fragment - pub fn full_path(&self) -> PathBuf { - let mut path = self.path.clone().into_os_string(); - if let Some(query) = &self.query { - path.push(query); - } - if let Some(fragment) = &self.fragment { - path.push(fragment); - } - PathBuf::from(path) - } -} - -#[test] -fn test() { - let resolution = Resolution { - path: PathBuf::from("foo"), - query: Some("?query".to_string()), - fragment: Some("#fragment".to_string()), - package_json: None, - }; - assert_eq!(resolution.path(), Path::new("foo")); - assert_eq!(resolution.query(), Some("?query")); - assert_eq!(resolution.fragment(), Some("#fragment")); - assert_eq!(resolution.full_path(), PathBuf::from("foo?query#fragment")); - assert_eq!(resolution.into_path_buf(), PathBuf::from("foo")); -} diff --git a/src/specifier.rs b/src/specifier.rs deleted file mode 100644 index 73ed038c..00000000 --- a/src/specifier.rs +++ /dev/null @@ -1,230 +0,0 @@ -use crate::error::SpecifierError; -use std::borrow::Cow; - -#[derive(Debug)] -pub struct Specifier<'a> { - path: Cow<'a, str>, - pub query: Option<&'a str>, - pub fragment: Option<&'a str>, -} - -impl<'a> Specifier<'a> { - pub fn path(&'a self) -> &'a str { - self.path.as_ref() - } - - pub fn parse(specifier: &'a str) -> Result { - if specifier.is_empty() { - return Err(SpecifierError::Empty(specifier.to_string())); - } - let offset = match specifier.as_bytes()[0] { - b'/' | b'.' | b'#' => 1, - _ => 0, - }; - let (path, query, fragment) = Self::parse_query_framgment(specifier, offset); - if path.is_empty() { - return Err(SpecifierError::Empty(specifier.to_string())); - } - Ok(Self { path, query, fragment }) - } - - fn parse_query_framgment( - specifier: &'a str, - skip: usize, - ) -> (Cow<'a, str>, Option<&str>, Option<&str>) { - let mut query_start: Option = None; - let mut fragment_start: Option = None; - - let mut prev = specifier.chars().next().unwrap(); - let mut escaped_indexes = vec![]; - for (i, c) in specifier.char_indices().skip(skip) { - if c == '?' && query_start.is_none() { - query_start = Some(i); - } - if c == '#' { - if prev == '\0' { - escaped_indexes.push(i - 1); - } else { - fragment_start = Some(i); - break; - } - } - prev = c; - } - - let (path, query, fragment) = match (query_start, fragment_start) { - (Some(i), Some(j)) => { - debug_assert!(i < j); - (&specifier[..i], Some(&specifier[i..j]), Some(&specifier[j..])) - } - (Some(i), None) => (&specifier[..i], Some(&specifier[i..]), None), - (None, Some(j)) => (&specifier[..j], None, Some(&specifier[j..])), - _ => (specifier, None, None), - }; - - let path = if escaped_indexes.is_empty() { - Cow::Borrowed(path) - } else { - // Remove the `\0` characters for a legal path. - Cow::Owned( - path.chars() - .enumerate() - .filter_map(|(i, c)| (!escaped_indexes.contains(&i)).then_some(c)) - .collect::(), - ) - }; - - (path, query, fragment) - } -} - -#[cfg(test)] -mod tests { - use super::{Specifier, SpecifierError}; - - #[test] - fn debug() { - let specifier = Specifier::parse("/").unwrap(); - assert_eq!( - format!("{specifier:?}"), - r#"Specifier { path: "/", query: None, fragment: None }"# - ); - } - - #[test] - fn empty() { - let specifiers = ["", "?"]; - for specifier in specifiers { - let error = Specifier::parse(specifier).unwrap_err(); - assert_eq!(error, SpecifierError::Empty(specifier.to_string())); - } - } - - #[test] - fn absolute() -> Result<(), SpecifierError> { - let specifier = "/test?#"; - let parsed = Specifier::parse(specifier)?; - assert_eq!(parsed.path, "/test"); - assert_eq!(parsed.query, Some("?")); - assert_eq!(parsed.fragment, Some("#")); - Ok(()) - } - - #[test] - fn relative() -> Result<(), SpecifierError> { - let specifiers = ["./test", "../test", "../../test"]; - for specifier in specifiers { - let mut r = specifier.to_string(); - r.push_str("?#"); - let parsed = Specifier::parse(&r)?; - assert_eq!(parsed.path, specifier); - assert_eq!(parsed.query, Some("?")); - assert_eq!(parsed.fragment, Some("#")); - } - Ok(()) - } - - #[test] - fn hash() -> Result<(), SpecifierError> { - let specifiers = ["#", "#path"]; - for specifier in specifiers { - let mut r = specifier.to_string(); - r.push_str("?#"); - let parsed = Specifier::parse(&r)?; - assert_eq!(parsed.path, specifier); - assert_eq!(parsed.query, Some("?")); - assert_eq!(parsed.fragment, Some("#")); - } - Ok(()) - } - - #[test] - fn module() -> Result<(), SpecifierError> { - let specifiers = ["module"]; - for specifier in specifiers { - let mut r = specifier.to_string(); - r.push_str("?#"); - let parsed = Specifier::parse(&r)?; - assert_eq!(parsed.path, specifier); - assert_eq!(parsed.query, Some("?")); - assert_eq!(parsed.fragment, Some("#")); - } - Ok(()) - } - - #[test] - fn query_fragment() -> Result<(), SpecifierError> { - let data = [ - ("a?", Some("?"), None), - ("a?query", Some("?query"), None), - ("a?query1?query2", Some("?query1?query2"), None), - ("a?query1?query2?query3", Some("?query1?query2?query3"), None), - ("a#", None, Some("#")), - ("a#b#c", None, Some("#b#c")), - ("a#fragment", None, Some("#fragment")), - ("a?#", Some("?"), Some("#")), - ("a?#fragment", Some("?"), Some("#fragment")), - ("a?query#", Some("?query"), Some("#")), - ("a?query#fragment", Some("?query"), Some("#fragment")), - ("a#fragment?", None, Some("#fragment?")), - ("a#fragment?query", None, Some("#fragment?query")), - ]; - - for (specifier_str, query, fragment) in data { - let specifier = Specifier::parse(specifier_str)?; - assert_eq!(specifier.path, "a", "{specifier_str}"); - assert_eq!(specifier.query, query, "{specifier_str}"); - assert_eq!(specifier.fragment, fragment, "{specifier_str}"); - } - - Ok(()) - } - - #[test] - // https://github.com/webpack/enhanced-resolve/blob/main/test/identifier.test.js - fn enhanced_resolve_edge_cases() -> Result<(), SpecifierError> { - let data = [ - ("path/#", "path/", "", "#"), - ("path/as/?", "path/as/", "?", ""), - ("path/#/?", "path/", "", "#/?"), - ("path/#repo#hash", "path/", "", "#repo#hash"), - ("path/#r#hash", "path/", "", "#r#hash"), - ("path/#repo/#repo2#hash", "path/", "", "#repo/#repo2#hash"), - ("path/#r/#r#hash", "path/", "", "#r/#r#hash"), - ("path/#/not/a/hash?not-a-query", "path/", "", "#/not/a/hash?not-a-query"), - ]; - - for (specifier_str, path, query, fragment) in data { - let specifier = Specifier::parse(specifier_str)?; - assert_eq!(specifier.path, path, "{specifier_str}"); - assert_eq!(specifier.query.unwrap_or(""), query, "{specifier_str}"); - assert_eq!(specifier.fragment.unwrap_or(""), fragment, "{specifier_str}"); - } - - Ok(()) - } - - // https://github.com/webpack/enhanced-resolve/blob/main/test/identifier.test.js - #[test] - fn enhanced_resolve_windows_like() -> Result<(), SpecifierError> { - let data = [ - ("path\\#", "path\\", "", "#"), - ("path\\as\\?", "path\\as\\", "?", ""), - ("path\\#\\?", "path\\", "", "#\\?"), - ("path\\#repo#hash", "path\\", "", "#repo#hash"), - ("path\\#r#hash", "path\\", "", "#r#hash"), - ("path\\#repo\\#repo2#hash", "path\\", "", "#repo\\#repo2#hash"), - ("path\\#r\\#r#hash", "path\\", "", "#r\\#r#hash"), - ("path\\#/not/a/hash?not-a-query", "path\\", "", "#/not/a/hash?not-a-query"), - ]; - - for (specifier_str, path, query, fragment) in data { - let specifier = Specifier::parse(specifier_str)?; - assert_eq!(specifier.path, path, "{specifier_str}"); - assert_eq!(specifier.query.unwrap_or(""), query, "{specifier_str}"); - assert_eq!(specifier.fragment.unwrap_or(""), fragment, "{specifier_str}"); - } - - Ok(()) - } -} diff --git a/src/tests/alias.rs b/src/tests/alias.rs deleted file mode 100644 index e5892066..00000000 --- a/src/tests/alias.rs +++ /dev/null @@ -1,283 +0,0 @@ -//! - -use normalize_path::NormalizePath; -use std::path::Path; - -use crate::{AliasValue, Resolution, ResolveContext, ResolveError, ResolveOptions, Resolver}; - -#[test] -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -fn alias() { - use super::memory_fs::MemoryFS; - use crate::ResolverGeneric; - use std::path::{Path, PathBuf}; - - let f = Path::new("/"); - - let file_system = MemoryFS::new(&[ - ("/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", ""), - ("/dashed-name", ""), - ]); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - alias: vec![ - ("aliasA".into(), vec![AliasValue::from("a")]), - ("b$".into(), vec![AliasValue::from("a/index")]), - ("c$".into(), vec![AliasValue::from("/a/index")]), - ( - "multiAlias".into(), - vec![ - AliasValue::from("b"), - AliasValue::from("c"), - AliasValue::from("d"), - AliasValue::from("e"), - AliasValue::from("a"), - ], - ), - ("recursive".into(), vec![AliasValue::from("recursive/dir")]), - ("/d/dir".into(), vec![AliasValue::from("/c/dir")]), - ("/d/index.js".into(), vec![AliasValue::from("/c/index")]), - ("#".into(), vec![AliasValue::from("/c/dir")]), - ("@".into(), vec![AliasValue::from("/c/dir")]), - ("ignored".into(), vec![AliasValue::Ignore]), - // not part of enhanced-resolve, added to make sure query in alias value works - ("alias_query".into(), vec![AliasValue::from("a?query_after")]), - ("alias_fragment".into(), vec![AliasValue::from("a#fragment_after")]), - ("dash".into(), vec![AliasValue::Ignore]), - ("@scope/package-name/file$".into(), vec![AliasValue::from("/c/dir")]), - ], - modules: vec!["/".into()], - ..ResolveOptions::default() - }, - ); - - #[rustfmt::skip] - let pass = [ - ("should resolve a not aliased module 1", "a", "/a/index"), - ("should resolve a not aliased module 2", "a/index", "/a/index"), - ("should resolve a not aliased module 3", "a/dir", "/a/dir/index"), - ("should resolve a not aliased module 4", "a/dir/index", "/a/dir/index"), - ("should resolve an aliased module 1", "aliasA", "/a/index"), - ("should resolve an aliased module 2", "aliasA/index", "/a/index"), - ("should resolve an aliased module 3", "aliasA/dir", "/a/dir/index"), - ("should resolve an aliased module 4", "aliasA/dir/index", "/a/dir/index"), - ("should resolve '#' alias 1", "#", "/c/dir/index"), - ("should resolve '#' alias 2", "#/index", "/c/dir/index"), - ("should resolve '@' alias 1", "@", "/c/dir/index"), - ("should resolve '@' alias 2", "@/index", "/c/dir/index"), - ("should resolve a recursive aliased module 1", "recursive", "/recursive/dir/index"), - ("should resolve a recursive aliased module 2", "recursive/index", "/recursive/dir/index"), - ("should resolve a recursive aliased module 3", "recursive/dir", "/recursive/dir/index"), - ("should resolve a recursive aliased module 4", "recursive/dir/index", "/recursive/dir/index"), - ("should resolve a file aliased module 1", "b", "/a/index"), - ("should resolve a file aliased module 2", "c", "/a/index"), - ("should resolve a file aliased module with a query 1", "b?query", "/a/index?query"), - ("should resolve a file aliased module with a query 2", "c?query", "/a/index?query"), - ("should resolve a path in a file aliased module 1", "b/index", "/b/index"), - ("should resolve a path in a file aliased module 2", "b/dir", "/b/dir/index"), - ("should resolve a path in a file aliased module 3", "b/dir/index", "/b/dir/index"), - ("should resolve a path in a file aliased module 4", "c/index", "/c/index"), - ("should resolve a path in a file aliased module 5", "c/dir", "/c/dir/index"), - ("should resolve a path in a file aliased module 6", "c/dir/index", "/c/dir/index"), - ("should resolve a file aliased file 1", "d", "/c/index"), - ("should resolve a file aliased file 2", "d/dir/index", "/c/dir/index"), - ("should resolve a file in multiple aliased dirs 1", "multiAlias/dir/file", "/e/dir/file"), - ("should resolve a file in multiple aliased dirs 2", "multiAlias/anotherDir", "/e/anotherDir/index"), - // not part of enhanced-resolve, added to make sure query in alias value works - ("should resolve query in alias value", "alias_query?query_before", "/a/index?query_after"), - ("should resolve query in alias value", "alias_fragment#fragment_before", "/a/index#fragment_after"), - ("should resolve dashed name", "dashed-name", "/dashed-name"), - ("should resolve scoped package name with sub dir", "@scope/package-name/file", "/c/dir/index"), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - - #[rustfmt::skip] - let ignore = [ - ("should resolve an ignore module", "ignored", ResolveError::Ignored(f.join("ignored"))) - ]; - - for (comment, request, expected) in ignore { - let resolution = resolver.resolve(f, request); - assert_eq!(resolution, Err(expected), "{comment} {request}"); - } -} - -// Not part of enhanced-resolve -#[test] -fn infinite_recursion() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![ - ("./a".into(), vec![AliasValue::from("./b")]), - ("./b".into(), vec![AliasValue::from("./a")]), - ], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(f, "./a"); - assert_eq!(resolution, Err(ResolveError::Recursion)); -} - -fn check_slash(path: &Path) { - let s = path.to_string_lossy().to_string(); - #[cfg(target_os = "windows")] - { - assert!(!s.contains('/'), "{s}"); - assert!(s.contains('\\'), "{s}"); - } - #[cfg(not(target_os = "windows"))] - { - assert!(s.contains('/'), "{s}"); - assert!(!s.contains('\\'), "{s}"); - } -} - -#[test] -fn absolute_path() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![(f.join("foo").to_str().unwrap().to_string(), vec![AliasValue::Ignore])], - modules: vec![f.clone().to_str().unwrap().to_string()], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(&f, "foo/index"); - assert_eq!(resolution, Err(ResolveError::Ignored(f.join("foo")))); -} - -#[test] -fn system_path() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![("@app".into(), vec![AliasValue::from(f.join("alias").to_string_lossy())])], - ..ResolveOptions::default() - }); - - let specifiers = ["@app/files/a", "@app/files/a.js"]; - - for specifier in specifiers { - let path = resolver.resolve(&f, specifier).map(Resolution::into_path_buf).unwrap(); - assert_eq!(path, f.join("alias/files/a.js")); - check_slash(&path); - } -} - -#[test] -fn alias_is_full_path() { - let f = super::fixture(); - let dir = f.join("foo"); - let dir_str = dir.to_string_lossy().to_string(); - - let resolver = Resolver::new(ResolveOptions { - alias: vec![("@".into(), vec![AliasValue::Path(dir_str.clone())])], - ..ResolveOptions::default() - }); - - let mut ctx = ResolveContext::default(); - - let specifiers = [ - "@/index".to_string(), - "@/index.js".to_string(), - // specifier has multiple `/` for reasons we'll never know - "@////index".to_string(), - // specifier is a full path - dir_str, - ]; - - for specifier in specifiers { - let resolution = resolver.resolve_with_context(&f, &specifier, &mut ctx); - assert_eq!(resolution.map(|r| r.full_path()), Ok(dir.join("index.js"))); - } - - for path in ctx.file_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - check_slash(&path); - } - - for path in ctx.missing_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - check_slash(&path); - if let Some(path) = path.parent() { - assert!(!path.is_file(), "{path:?} must not be a file"); - } - } -} - -// For the `should_stop` variable in `load_alias` -#[test] -fn all_alias_values_are_not_found() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![( - "m1".to_string(), - vec![AliasValue::Path(f.join("node_modules").join("m2").to_string_lossy().to_string())], - )], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(&f, "m1/a.js"); - assert_eq!( - resolution, - Err(ResolveError::MatchedAliasNotFound("m1/a.js".to_string(), "m1".to_string(),)) - ); -} - -#[test] -fn alias_fragment() { - let f = super::fixture(); - - let data = [ - // enhanced-resolve has `#` prepended with a `\0`, they are removed from the - // following 3 expected test results. - // See https://github.com/webpack/enhanced-resolve#escaping - ( - "handle fragment edge case (no fragment)", - "./no#fragment/#/#", - f.join("no#fragment/#/#.js"), - ), - ("handle fragment edge case (fragment)", "./no#fragment/#/", f.join("no.js#fragment/#/")), - ( - "handle fragment escaping", - "./no\0#fragment/\0#/\0##fragment", - f.join("no#fragment/#/#.js#fragment"), - ), - ]; - - for (comment, request, expected) in data { - let resolver = Resolver::new(ResolveOptions { - alias: vec![("foo".to_string(), vec![AliasValue::Path(request.to_string())])], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f, "foo").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } -} - -#[test] -fn alias_try_fragment_as_path() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![( - "#".to_string(), - vec![AliasValue::Path(f.join("#").to_string_lossy().to_string())], - )], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(&f, "#/a").map(|r| r.full_path()); - assert_eq!(resolution, Ok(f.join("#").join("a.js"))); -} diff --git a/src/tests/browser_field.rs b/src/tests/browser_field.rs deleted file mode 100644 index 171ee099..00000000 --- a/src/tests/browser_field.rs +++ /dev/null @@ -1,189 +0,0 @@ -//! - -use crate::{AliasValue, ResolveError, ResolveOptions, Resolver}; - -#[test] -fn ignore() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![ - vec!["browser".into()], - vec!["innerBrowser1".into()], - vec!["innerBrowser2".into()], - vec![], - ], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - (f.clone(), "./lib/ignore", f.join("lib/ignore.js")), - (f.clone(), "./lib/ignore.js", f.join("lib/ignore.js")), - (f.join("lib"), "./ignore", f.join("lib/ignore.js")), - (f.join("lib"), "./ignore.js", f.join("lib/ignore.js")), - ]; - - for (path, request, expected) in data { - let resolution = resolver.resolve(&path, request); - let expected = ResolveError::Ignored(expected); - assert_eq!(resolution, Err(expected), "{path:?} {request}"); - } -} - -#[test] -fn shared_resolvers() { - let f = super::fixture().join("browser-module"); - - let resolver1 = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["innerBrowser1".into(), "field".into(), "browser".into()]], - ..ResolveOptions::default() - }); - let resolved_path = resolver1.resolve(&f, "./lib/main1.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("lib/main.js"))); - - let resolver2 = resolver1.clone_with_options(ResolveOptions { - alias_fields: vec![vec!["innerBrowser2".into(), "browser".into()]], - ..ResolveOptions::default() - }); - let resolved_path = resolver2.resolve(&f, "./lib/main2.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("./lib/replaced.js"))); -} - -#[test] -fn replace_file() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![ - vec!["browser".into()], - vec!["innerBrowser1".into(), "field2".into(), "browser".into()], // not presented - vec!["innerBrowser1".into(), "field".into(), "browser".into()], - vec!["innerBrowser2".into(), "browser".into()], - ], - // Not part of enhanced-resolve. Added to make sure no interaction between these two fields. - main_fields: vec!["browser".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - ("should replace a file 1", f.clone(), "./lib/replaced", f.join("lib/browser.js")), - ("should replace a file 2", f.clone(), "./lib/replaced.js", f.join("lib/browser.js")), - ("should replace a file 3", f.join("lib"), "./replaced", f.join("lib/browser.js")), - ("should replace a file 4", f.join("lib"), "./replaced.js", f.join("lib/browser.js")), - ("should replace a module with a file 1", f.clone(), "module-a", f.join("browser/module-a.js")), - ("should replace a module with a file 2", f.join("lib"), "module-a", f.join("browser/module-a.js")), - ("should replace a module with a module 1", f.clone(), "module-b", f.join("node_modules/module-c.js")), - ("should replace a module with a module 2", f.join("lib"), "module-b", f.join("node_modules/module-c.js")), - ("should resolve in nested property 1", f.clone(), "./lib/main1.js", f.join("lib/main.js")), - ("should resolve in nested property 2", f.clone(), "./lib/main2.js", f.join("lib/browser.js")), - ("should check only alias field properties", f.clone(), "./toString", f.join("lib/toString.js")), - // not part of enhanced-resolve - ("recursion", f.clone(), "module-c", f.join("node_modules/module-c.js")), - ("resolve self 1", f.clone(), "./lib/main.js", f.join("lib/main.js")), - ("resolve self 2", f.clone(), "./main.js", f.join("lib/main.js")), - ]; - - for (comment, path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn recurse_fail() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - ("recurse non existent", f.clone(), "./lib/non-existent.js", ResolveError::NotFound("./lib/non-existent.js".into())), - ("path partial match 1", f.clone(), "./xyz.js", ResolveError::NotFound("./xyz.js".into())), - ("path partial match 2", f, "./lib/xyz.js", ResolveError::NotFound("./lib/xyz.js".into())), - ]; - - for (comment, path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Err(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn broken() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - // The browser field string value should be ignored - (f.clone(), "browser-module-broken", Ok(f.join("node_modules/browser-module-broken/main.js"))), - (f.join("browser-module"), "./number", Err(ResolveError::NotFound("./number".into()))), - ]; - - for (path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, expected, "{path:?} {request}"); - } -} - -#[test] -fn crypto_js() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - fallback: vec![( - "crypto".into(), - vec![AliasValue::from(f.join("lib.js").to_string_lossy())], - )], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(f.join("crypto-js"), "crypto").map(|r| r.full_path()); - assert_eq!(resolved_path, Err(ResolveError::Ignored(f.join("crypto-js")))); -} - -// https://github.com/webpack/webpack/blob/87660921808566ef3b8796f8df61bd79fc026108/test/cases/resolving/browser-field/index.js#L40-L43 -#[test] -fn recursive() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - let data = [ - ("should handle recursive file 1", f.clone(), "recursive-file/a"), - ("should handle recursive file 2", f.clone(), "recursive-file/b"), - ("should handle recursive file 3", f.clone(), "recursive-file/c"), - ("should handle recursive file 4", f, "recursive-file/d"), - ]; - - for (comment, path, request) in data { - let resolved_path = resolver.resolve(&path, request); - assert_eq!(resolved_path, Err(ResolveError::Recursion), "{comment} {path:?} {request}"); - } -} - -#[test] -fn with_query() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "./foo").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("lib").join("browser.js?query"))); -} diff --git a/src/tests/builtins.rs b/src/tests/builtins.rs deleted file mode 100644 index 5d6d14d9..00000000 --- a/src/tests/builtins.rs +++ /dev/null @@ -1,121 +0,0 @@ -use std::path::Path; - -use crate::{ResolveError, ResolveOptions, Resolver}; - -#[test] -fn builtins_off() { - let f = Path::new("/"); - let resolver = Resolver::default(); - let resolved_path = resolver.resolve(f, "zlib").map(|r| r.full_path()); - assert_eq!(resolved_path, Err(ResolveError::NotFound("zlib".into()))); -} - -#[test] -fn builtins() { - let f = Path::new("/"); - - let resolver = Resolver::new(ResolveOptions::default().with_builtin_modules(true)); - - let pass = [ - "_http_agent", - "_http_client", - "_http_common", - "_http_incoming", - "_http_outgoing", - "_http_server", - "_stream_duplex", - "_stream_passthrough", - "_stream_readable", - "_stream_transform", - "_stream_wrap", - "_stream_writable", - "_tls_common", - "_tls_wrap", - "assert", - "assert/strict", - "async_hooks", - "buffer", - "child_process", - "cluster", - "console", - "constants", - "crypto", - "dgram", - "diagnostics_channel", - "dns", - "dns/promises", - "domain", - "events", - "fs", - "fs/promises", - "http", - "http2", - "https", - "inspector", - "module", - "net", - "os", - "path", - "path/posix", - "path/win32", - "perf_hooks", - "process", - "punycode", - "querystring", - "readline", - "repl", - "stream", - "stream/consumers", - "stream/promises", - "stream/web", - "string_decoder", - "sys", - "timers", - "timers/promises", - "tls", - "trace_events", - "tty", - "url", - "util", - "util/types", - "v8", - "vm", - "worker_threads", - "zlib", - ]; - - for request in pass { - let prefixed_request = format!("node:{request}"); - for request in [prefixed_request.clone(), request.to_string()] { - let resolved_path = resolver.resolve(f, &request).map(|r| r.full_path()); - let err = ResolveError::Builtin(prefixed_request.clone()); - assert_eq!(resolved_path, Err(err), "{request}"); - } - } -} - -#[test] -fn fail() { - let f = Path::new("/"); - let resolver = Resolver::new(ResolveOptions::default().with_builtin_modules(true)); - let request = "xxx"; - let resolved_path = resolver.resolve(f, request); - let err = ResolveError::NotFound(request.to_string()); - assert_eq!(resolved_path, Err(err), "{request}"); -} - -#[test] -fn imports() { - let f = super::fixture().join("builtins"); - let resolver = Resolver::new(ResolveOptions { - builtin_modules: true, - condition_names: vec!["node".into()], - ..ResolveOptions::default() - }); - - for request in ["#fs", "#http"] { - let resolved_path = resolver.resolve(f.clone(), request).map(|r| r.full_path()); - let err = ResolveError::Builtin(format!("node:{}", request.trim_start_matches('#'))); - assert_eq!(resolved_path, Err(err)); - } -} diff --git a/src/tests/dependencies.rs b/src/tests/dependencies.rs deleted file mode 100644 index bcc2355b..00000000 --- a/src/tests/dependencies.rs +++ /dev/null @@ -1,110 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/dependencies.test.js - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows { - use rustc_hash::FxHashSet; - use std::path::PathBuf; - - use crate::{ResolveContext, ResolveOptions, ResolverGeneric}; - - use super::super::memory_fs::MemoryFS; - - fn file_system() -> MemoryFS { - MemoryFS::new(&[ - ("/a/b/node_modules/some-module/index.js", ""), - ("/a/node_modules/module/package.json", r#"{"main":"entry.js"}"#), - ("/a/node_modules/module/file.js", r#"{"main":"entry.js"}"#), - ("/modules/other-module/file.js", ""), - ]) - } - - #[test] - fn test() { - let file_system = file_system(); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - extensions: vec![".json".into(), ".js".into()], - modules: vec!["/modules".into(), "node_modules".into()], - ..ResolveOptions::default() - }, - ); - - let data = [ - ( - "middle module request", - "/a/b/c", - "module/file", - "/a/node_modules/module/file.js", - // These dependencies are different from enhanced-resolve due to different code path to - // querying the file system - vec![ - // 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", - // "/", - ], - vec![ - // missing package.jsons - // "/a/b/c/package.json", - "/a/b/package.json", - "/a/package.json", - "/package.json", - // missing modules directories - "/a/b/c", - // "/a/b/c/node_modules", - // missing single file modules - "/modules/module", - "/a/b/node_modules/module", - // missing files with alternative extensions - "/a/node_modules/module/file", - "/a/node_modules/module/file.json", - ], - ), - ( - "fast found module", - "/a/b/c", - "other-module/file.js", - "/modules/other-module/file.js", - // These dependencies are different from enhanced-resolve due to different code path to - // querying the file system - vec![ - // symlink checks - "/modules/other-module/file.js", - // "/modules/other-module", - // "/modules", - // "/", - ], - vec![ - // missing package.jsons - // "/a/b/c/package.json", - "/a/b/c", - "/a/b/package.json", - "/a/package.json", - "/package.json", - "/modules/other-module/package.json", - "/modules/package.json", - ], - ), - ]; - - for (name, context, request, result, file_dependencies, missing_dependencies) in data { - let mut ctx = ResolveContext::default(); - let path = PathBuf::from(context); - let resolved = - resolver.resolve_with_context(path, request, &mut ctx).map(|r| r.full_path()); - assert_eq!(resolved, Ok(PathBuf::from(result))); - let file_dependencies = - FxHashSet::from_iter(file_dependencies.iter().map(PathBuf::from)); - let missing_dependencies = - FxHashSet::from_iter(missing_dependencies.iter().map(PathBuf::from)); - assert_eq!(ctx.file_dependencies, file_dependencies, "{name}"); - assert_eq!(ctx.missing_dependencies, missing_dependencies, "{name}"); - } - } -} diff --git a/src/tests/exports_field.rs b/src/tests/exports_field.rs deleted file mode 100644 index 7ca73fbd..00000000 --- a/src/tests/exports_field.rs +++ /dev/null @@ -1,2546 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/exportsField.test.js -//! -//! The huge exports field test cases are at the bottom of this file. - -use crate::{Ctx, PathUtil, ResolveError, ResolveOptions, Resolver}; -use serde_json::json; -use std::path::Path; - -#[test] -fn test_simple() { - let f = super::fixture().join("exports-field"); - let f2 = super::fixture().join("exports-field2"); - let f4 = super::fixture().join("exports-field-error"); - let f5 = super::fixture().join("imports-exports-wildcard"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - fully_specified: true, - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("resolve root using exports field, not a main field", f.clone(), "exports-field", f.join("node_modules/exports-field/x.js")), - ("resolver should respect condition names", f.clone(), "exports-field/dist/main.js", f.join("node_modules/exports-field/lib/lib2/main.js")), - // enhanced_resolve behaves differently to node.js. enhanced_resolve fallbacks when an - // array item is unresolved, where as node.js fallbacks when an array has an - // InvalidPackageTarget error. - // ("resolver should respect fallback", f2.clone(), "exports-field/dist/browser.js", f2.join("node_modules/exports-field/lib/browser.js")), - // The following two tests require fallback from array values, the path is changed here to - // only test query and fragment. - ("resolver should respect query parameters #1", f2.clone(), "exports-field/dist/main.js?foo", f2.join("node_modules/exports-field/lib/lib2/main.js?foo")), - ("resolver should respect fragment parameters #1", f2.clone(), "exports-field/dist/main.js#foo", f2.join("node_modules/exports-field/lib/lib2/main.js#foo")), - ("relative path should work, if relative path as request is used", f.clone(), "./node_modules/exports-field/lib/main.js", f.join("node_modules/exports-field/lib/main.js")), - ("self-resolving root", f.clone(), "@exports-field/core", f.join("a.js")), - ("should resolve with wildcard pattern #1", f5.clone(), "m/features/f.js", f5.join("node_modules/m/src/features/f.js")), - ("should resolve with wildcard pattern #2", f5.clone(), "m/features/y/y.js", f5.join("node_modules/m/src/features/y/y.js")), - ("should resolve with wildcard pattern #3", f5.clone(), "m/features-no-ext/y/y.js", f5.join("node_modules/m/src/features/y/y.js")), - ("should resolve with wildcard pattern #4", f5.clone(), "m/middle/nested/f.js", f5.join("node_modules/m/src/middle/nested/f.js")), - ("should resolve with wildcard pattern #5", f5.clone(), "m/middle-1/nested/f.js", f5.join("node_modules/m/src/middle-1/nested/f.js")), - ("should resolve with wildcard pattern #6", f5.clone(), "m/middle-2/nested/f.js", f5.join("node_modules/m/src/middle-2/nested/f.js")), - ("should resolve with wildcard pattern #7", f5.clone(), "m/middle-3/nested/f", f5.join("node_modules/m/src/middle-3/nested/f/nested/f.js")), - ("should resolve with wildcard pattern #8", f5.clone(), "m/middle-4/f/nested", f5.join("node_modules/m/src/middle-4/f/f.js")), - ("should resolve with wildcard pattern #9", f5.clone(), "m/middle-5/f$/$", f5.join("node_modules/m/src/middle-5/f$/$.js")), - ]; - - // Not needed or snapshot: - // * should log the correct info - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } - - let p = f.join("node_modules/exports-field/package.json"); - let p2 = f2.join("node_modules/exports-field/package.json"); - let p4 = f4.join("node_modules/exports-field/package.json"); - let p5 = f5.join("node_modules/m/package.json"); - - #[rustfmt::skip] - let fail = [ - // ("throw error if extension not provided", f2.clone(), "exports-field/dist/main", ResolveError::NotFound(f2.join("node_modules/exports-field/lib/lib2/main"))), - ("resolver should respect query parameters #2. Direct matching", f2.clone(), "exports-field?foo", ResolveError::PackagePathNotExported("./?foo".into(), p2.clone())), - ("resolver should respect fragment parameters #2. Direct matching", f2, "exports-field#foo", ResolveError::PackagePathNotExported("./#foo".into(), p2)), - ("relative path should not work with exports field", f.clone(), "./node_modules/exports-field/dist/main.js", ResolveError::NotFound("./node_modules/exports-field/dist/main.js".into())), - ("backtracking should not work for request", f.clone(), "exports-field/dist/../../../a.js", ResolveError::InvalidPackageTarget("./lib/../../../a.js".to_string(), "./dist/".to_string(), p.clone())), - ("backtracking should not work for exports field target", f.clone(), "exports-field/dist/a.js", ResolveError::InvalidPackageTarget("./../../a.js".to_string(), "./dist/a.js".to_string(), p.clone())), - ("not exported error", f.clone(), "exports-field/anything/else", ResolveError::PackagePathNotExported("./anything/else".to_string(), p.clone())), - ("request ending with slash #1", f.clone(), "exports-field/", ResolveError::PackagePathNotExported("./".to_string(), p.clone())), - ("request ending with slash #2", f.clone(), "exports-field/dist/", ResolveError::PackagePathNotExported("./dist/".to_string(), p.clone())), - ("request ending with slash #3", f.clone(), "exports-field/lib/", ResolveError::PackagePathNotExported("./lib/".to_string(), p)), - ("should throw error if target is invalid", f4, "exports-field", ResolveError::InvalidPackageTarget("./a/../b/../../pack1/index.js".to_string(), ".".to_string(), p4)), - ("throw error if exports field is invalid", f.clone(), "invalid-exports-field", ResolveError::InvalidPackageConfig(f.join("node_modules/invalid-exports-field/package.json"))), - ("should throw error if target is 'null'", f5, "m/features/internal/file.js", ResolveError::PackagePathNotExported("./features/internal/file.js".to_string(), p5)), - ]; - - for (comment, path, request, error) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!(resolution, Err(error), "{comment} {path:?} {request}"); - } -} - -// resolve using exports field, not a browser field #1 -#[test] -fn exports_not_browser_field1() { - let f = super::fixture().join("exports-field"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - condition_names: vec!["webpack".into()], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "exports-field/dist/main.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("node_modules/exports-field/lib/lib2/main.js"))); -} - -// resolve using exports field and a browser alias field #2 -#[test] -fn exports_not_browser_field2() { - let f2 = super::fixture().join("exports-field2"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - extensions: vec![".js".into()], - condition_names: vec!["node".into()], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f2, "exports-field/dist/main.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f2.join("node_modules/exports-field/lib/browser.js"))); -} - -// should resolve extension without fullySpecified -#[test] -fn extension_without_fully_specified() { - let f2 = super::fixture().join("exports-field2"); - - let commonjs_resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - let resolved_path = - commonjs_resolver.resolve(&f2, "exports-field/dist/main").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f2.join("node_modules/exports-field/lib/lib2/main.js"))); -} - -#[test] -fn field_name_path() { - let f2 = super::fixture().join("exports-field2"); - let f3 = super::fixture().join("exports-field3"); - - // field name path #1 #2 #3 - let exports_fields = [ - vec![vec!["exportsField".into(), "exports".into()]], - vec![vec!["exportsField".into(), "exports".into()], vec!["exports".into()]], - vec![vec!["exports".into()], vec!["exportsField".into(), "exports".into()]], - ]; - - for exports_fields in exports_fields { - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - exports_fields, - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/main.js"))); - } - - // field name path #4 - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - exports_fields: vec![vec!["exports".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f2, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f2.join("node_modules/exports-field/index.js"))); - - // field name path #5 - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - exports_fields: vec![vec!["ex".into()], vec!["exports_field".into(), "exports".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/index"))); - - // non-compliant export targeting a directory - let resolver = Resolver::new(ResolveOptions { - exports_fields: vec![vec!["broken".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/src/index.js"))); -} - -#[test] -fn shared_resolvers() { - let f3 = super::fixture().join("exports-field3"); - - let resolver1 = Resolver::new(ResolveOptions { - exports_fields: vec![vec!["exportsField".into(), "exports".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver1.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/main.js"))); - - let resolver2 = resolver1.clone_with_options(ResolveOptions { - exports_fields: vec![vec!["ex".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver2.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/index"))); -} - -#[test] -fn extension_alias_1_2() { - let f = super::fixture().join("exports-field-and-extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - extension_alias: vec![(".js".into(), vec![".ts".into(), ".js".into()])], - fully_specified: true, - condition_names: vec!["webpack".into(), "default".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve with the `extensionAlias` option", f.clone(), "@org/pkg/string.js", f.join("node_modules/@org/pkg/dist/string.js")), - ("should resolve with the `extensionAlias` option #2", f.clone(), "pkg/string.js", f.join("node_modules/pkg/dist/string.js")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn extension_alias_3() { - let f = super::fixture().join("exports-field-and-extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - extension_alias: vec![( - ".js".into(), - vec![".foo".into(), ".baz".into(), ".baz".into(), ".ts".into(), ".js".into()], - )], - fully_specified: true, - condition_names: vec!["webpack".into(), "default".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve with the `extensionAlias` option #3", f.clone(), "pkg/string.js", f.join("node_modules/pkg/dist/string.js")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn extension_alias_throw_error() { - let f = super::fixture().join("exports-field-and-extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - extension_alias: vec![(".js".into(), vec![".ts".into()])], - fully_specified: true, - condition_names: vec!["webpack".into(), "default".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let fail = [ - // enhanced-resolve has two test cases that are exactly the same here - // https://github.com/webpack/enhanced-resolve/blob/a998c7d218b7a9ec2461fc4fddd1ad5dd7687485/test/exportsField.test.js#L2976-L3024 - ("should throw error with the `extensionAlias` option", f.clone(), "pkg/string.js", ResolveError::ExtensionAlias(f.join("node_modules/pkg/dist/string.js"))), - // TODO: The error is PackagePathNotExported in enhanced-resolve - // ("should throw error with the `extensionAlias` option", f.clone(), "pkg/string.js", ResolveError::PackagePathNotExported("node_modules/pkg/dist/string.ts".to_string())), - ]; - - for (comment, path, request, error) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!(resolution, Err(error), "{comment} {path:?} {request}"); - } -} - -// Small script for generating the test cases from enhanced-resolve -// for (c of testCases) { -// console.log("TestCase {") -// console.log(`name: ${JSON.stringify(c.name)},`) -// if (c.expect instanceof Error) { -// console.log(`expect: None,`) -// } else { -// console.log(`expect: Some(vec!${JSON.stringify(c.expect)}),`) -// } -// console.log(`exports_field: exports_field(json!(${JSON.stringify(c.suite[0], null, 2)})),`) -// console.log(`request: "${c.suite[1]}",`) -// console.log(`condition_names: vec!${JSON.stringify(c.suite[2])},`) -// console.log("},") -//} -struct TestCase { - name: &'static str, - expect: Option>, - exports_field: serde_json::Value, - request: &'static str, - condition_names: Vec<&'static str>, -} - -#[allow(clippy::needless_pass_by_value)] -fn exports_field(value: serde_json::Value) -> serde_json::Value { - value -} - -#[test] -fn test_cases() { - let test_cases = [ - TestCase { - name: "sample #1", - expect: Some(vec!["./dist/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/": { - "import": [ - "./dist/", - "./src/" - ], - "webpack": "./wp/" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "sample #1", - expect: Some(vec!["./src/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/": { - "import": [ - "./src/" - ], - "webpack": "./wp/" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - TestCase { - name: "sample #1 (wildcard)", - expect: Some(vec!["./dist/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/*": { - "import": [ - "./dist/*", - "./src/*" - ], - "webpack": "./wp/*" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "sample #1 (wildcard)", - expect: Some(vec!["./src/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/*": { - "import": [ - "./src/*" - ], - "webpack": "./wp/*" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - TestCase { - name: "sample #2", - expect: Some(vec!["./data/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./timezones/": "./data/timezones/" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #2 (wildcard)", - expect: Some(vec!["./data/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./timezones/*": "./data/timezones/*" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #3", - expect: Some(vec!["./data/timezones/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./": "./data/timezones/" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #3 (wildcard)", - expect: Some(vec!["./data/timezones/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./*": "./data/timezones/*.mjs" - })), - request: "./timezones/pdt", - condition_names: vec![], - }, - TestCase { - name: "sample #4", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./lib/": { - "browser": [ - "./browser/" - ] - }, - "./dist/index.js": { - "node": "./index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #4 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "node": "./index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #5", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/": { - "browser": [ - "./browser/" - ] - }, - "./dist/index.js": { - "node": "./index.js", - "default": "./browser/index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #5 (wildcard)", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "node": "./index.js", - "default": "./browser/index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./dist/a": "./dist/index.js" - })), - request: "./dist/aaa", - condition_names: vec![], - }, - TestCase { - name: "sample #7", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./dist/a/a/": "./dist/index.js" - })), - request: "./dist/a/a", - condition_names: vec![], - }, - TestCase { - name: "sample #7 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./dist/a/a/*": "./dist/index.js" - })), - request: "./dist/a/a", - condition_names: vec![], - }, - TestCase { - name: "sample #8", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": "./index.js" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #9", - expect: Some(vec!["./main.js"]), - exports_field: exports_field(json!({ - "./index.js": "./main.js" - })), - request: "./index.js", - condition_names: vec![], - }, - TestCase { - name: "sample #10", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #11", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./bar#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #12", - expect: Some(vec!["./ok.js#abc"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/ok.js#abc", - condition_names: vec![], - }, - TestCase { - name: "sample #12", - expect: Some(vec!["./ok.js#abc"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/ok.js#abc", - condition_names: vec![], - }, - TestCase { - name: "sample #13", - expect: Some(vec!["./ok.js?abc"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/ok.js?abc", - condition_names: vec![], - }, - TestCase { - name: "sample #14", - expect: Some(vec!["./🎉.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/🎉.js", - condition_names: vec![], - }, - TestCase { - name: "sample #15", - expect: Some(vec!["./%F0%9F%8E%89.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/%F0%9F%8E%89.js", - condition_names: vec![], - }, - TestCase { - name: "sample #16", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./🎉", - condition_names: vec![], - }, - TestCase { - name: "sample #17", - expect: Some(vec!["./other.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./%F0%9F%8E%89", - condition_names: vec![], - }, - TestCase { - name: "sample #18", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./module", - condition_names: vec![], - }, - TestCase { - name: "sample #19", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./module#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #20", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./module?foo", - condition_names: vec![], - }, - TestCase { - name: "sample #21", - expect: Some(vec!["./zizizi"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./z*z*z*" - })), - request: "./#zippi", - condition_names: vec![], - }, - TestCase { - name: "sample #22", - expect: Some(vec!["./d?e?f"]), - exports_field: exports_field(json!({ - "./a?b?c/": "./" - })), - request: "./a?b?c/d?e?f", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #1", - expect: Some(vec!["./dist/index.js"]), - exports_field: exports_field(json!({ - ".": "./dist/index.js" - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #2", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./": "./", - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #3", - expect: Some(vec!["./dist/a.js"]), - exports_field: exports_field(json!({ - "./dist/": "./dist/", - "./dist/*": "./dist/*", - "./dist*": "./dist*", - "./dist/index.js": "./dist/a.js" - })), - request: "./dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #4", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./": { - "browser": [ - "./browser/" - ] - }, - "./*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "browser": "./index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #5", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./": { - "browser": [ - "./browser/" - ] - }, - "./*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "node": "./node.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #6", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - ".": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #7", - expect: Some(vec!["./src/index.js"]), // `enhanced_resolve` is `None` - exports_field: exports_field(json!({ - ".": { - "default": "./src/index.js", - "browser": "./index.js", - "node": "./src/node/index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #8", - expect: Some(vec!["./src/index.js"]), - exports_field: exports_field(json!({ - ".": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #9", - expect: Some(vec!["./index"]), - exports_field: exports_field(json!({ - ".": "./index" - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #10", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./index": "./index.js" - })), - request: "./index", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #11", - expect: Some(vec!["./foo.js"]), - exports_field: exports_field(json!({ - "./": "./", - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #12", - expect: Some(vec!["./foo/bar/baz.js"]), - exports_field: exports_field(json!({ - "./": "./", - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo/bar/baz.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #13", - expect: Some(vec!["./foo/bar/baz.js"]), - exports_field: exports_field(json!({ - "./": "./", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo/bar/baz.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #14", - expect: Some(vec!["./foo/bar/baz.js"]), - exports_field: exports_field(json!({ - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo/bar/baz.js", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #1", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "require": "./require.js" - }, { - "import": "./import.mjs" - }] - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #2", - expect: Some(vec!["./import.mjs"]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "require": "./require.js" - }, { - "import": "./import.mjs" - }] - })), - request: ".", - condition_names: vec!["import"], - }, - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./require.js"]), - exports_field: exports_field(json!({ - ".": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./import.mjs"]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "import": "./import.mjs" - }] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./require.js"]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "require": [ - "./require.js" - ] - }, { - "import": [ - "./import.mjs", - "./import.js" - ] - }] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./import.mjs"]), - exports_field: exports_field(json!({ - ".": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "./import.mjs", - "./import.js" - ] - } - ] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./import.js"]), - exports_field: exports_field(json!({ - ".": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "./import.js" - ] - } - ] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "mapping to a folder root #1", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./timezones": "./data/timezones/" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #2", - expect: None, - exports_field: exports_field(json!({ - "./timezones/": "./data/timezones" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #3", - expect: Some(vec!["./data/timezones/pdt/index.mjs"]), - exports_field: exports_field(json!({ - "./timezones/pdt/": "./data/timezones/pdt/" - })), - request: "./timezones/pdt/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #3 (wildcard)", - expect: Some(vec!["./data/timezones/pdt/index.mjs"]), - exports_field: exports_field(json!({ - "./timezones/pdt/*": "./data/timezones/pdt/*" - })), - request: "./timezones/pdt/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #4", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./": "./timezones/" - })), - request: "./pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #4 (wildcard)", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./*": "./timezones/*" - })), - request: "./pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #5", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./": "./" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #5 (wildcard)", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./*": "./*" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #6", - expect: None, - exports_field: exports_field(json!({ - "./": "." - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #6 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "./*": "." - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #7", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": "./" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #7 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": "./*" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #1", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./": "./", - "./dist/": "./lib/" - })), - request: "./dist/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #1 (wildcard)", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./*": "./*", - "./dist/*": "./lib/*" - })), - request: "./dist/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #2", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/": "./dist/utils/", - "./dist/": "./lib/" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #2 (wildcard)", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/*": "./dist/utils/*", - "./dist/*": "./lib/*" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #3", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/index.js": "./dist/utils/index.js", - "./dist/utils/": "./dist/utils/index.mjs", - "./dist/": "./lib/" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #3 (wildcard)", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/index.js": "./dist/utils/index.js", - "./dist/utils/*": "./dist/utils/index.mjs", - "./dist/*": "./lib/*" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #4", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./": { - "browser": "./browser/" - }, - "./dist/": "./lib/" - })), - request: "./dist/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "the longest matching path prefix is prioritized #4 (wildcard)", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./*": { - "browser": "./browser/*" - }, - "./dist/*": "./lib/*" - })), - request: "./dist/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #1", - // `lodash/` does not start with './' so fallbacks to util - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "conditional mapping folder #1", - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": [ - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #1 (wildcard)", - // `lodash/` does not start with './' so fallbacks to util - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": [ - "lodash/*", - "./utils/*" - ], - "node": [ - "./utils-node/*" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "conditional mapping folder #1 (wildcard)", - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": [ - "./utils/*" - ], - "node": [ - "./utils-node/*" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #2", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./node/" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "conditional mapping folder #2 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "webpack": "./wpk/*", - "browser": [ - "lodash/*", - "./utils/*" - ], - "node": [ - "./node/*" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "conditional mapping folder #3", - expect: Some(vec!["./wpk/index.mjs"]), - exports_field: exports_field(json!({ - "./utils/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils/" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "conditional mapping folder #3 (wildcard)", - expect: Some(vec!["./wpk/index.mjs"]), - exports_field: exports_field(json!({ - "./utils/*": { - "webpack": "./wpk/*", - "browser": [ - "lodash/*", - "./utils/*" - ], - "node": [ - "./utils/*" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "incorrect exports field #1", - expect: None, - exports_field: exports_field(json!({ - "/utils/": "./a/" - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #2", - expect: None, - exports_field: exports_field(json!({ - "./utils/": "/a/" - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #3", - expect: None, - exports_field: exports_field(json!({ - "/utils/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #4", - expect: None, - exports_field: exports_field(json!({ - "./utils/": { - "browser": "/a/", - "default": "/b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #4 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "/a/", - "default": "/b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #5", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index": "./a/index.js" - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index.mjs": "./a/index.js" - })), - request: "./utils/index", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #7", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #8", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index.mjs": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - // Requests that are not `./` does not apply to `package_exports_resolve` - // TestCase { - // name: "incorrect request #1", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": "./a/" - // })), - // request: "/utils/index.mjs", - // condition_names: vec![], - // }, - // TestCase { - // name: "incorrect request #2", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": { - // "browser": "./a/", - // "default": "./b/" - // } - // })), - // request: "/utils/index.mjs", - // condition_names: vec!["browser"], - // }, - // TestCase { - // name: "incorrect request #3", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": { - // "browser": "./a/", - // "default": "./b/" - // } - // })), - // request: "../utils/index.mjs", - // condition_names: vec!["browser"], - // }, - // TestCase { - // name: "incorrect request #4", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": { - // "browser": "./a/", - // "default": "./b/" - // } - // })), - // request: "/utils/index.mjs/", - // condition_names: vec!["browser"], - // }, - TestCase { - name: "backtracking package base #1", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./../../utils/": "./dist/" - })), - request: "./../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #1 (wildcard)", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./../../utils/*": "./dist/*" - })), - request: "./../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #2", - expect: None, - exports_field: exports_field(json!({ - "../../utils/": "./dist/" - })), - request: "../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #2 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "../../utils/*": "./dist/*" - })), - request: "../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #3", - expect: None, - exports_field: exports_field(json!({ - "./utils/": "../src/" - })), - request: "./utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #3 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "./utils/*": "../src/*" - })), - request: "./utils/index", - condition_names: vec![], - }, - // enhanced-resolve does not handle backtracking here - // TestCase { - // name: "backtracking package base #4", - // expect: Some(vec!["./../src/index"]), - // exports_field: exports_field(json!({ - // "./utils/": "./../src/" - // })), - // request: "./utils/index", - // condition_names: vec![], - // }, - // TestCase { - // name: "backtracking package base #4 (wildcard)", - // expect: Some(vec!["./../src/index"]), - // exports_field: exports_field(json!({ - // "./utils/*": "./../src/*" - // })), - // request: "./utils/index", - // condition_names: vec![], - // }, - // TestCase { - // name: "backtracking package base #5", - // expect: Some(vec!["./src/../index.js"]), - // exports_field: exports_field(json!({ - // "./utils/index": "./src/../index.js" - // })), - // request: "./utils/index", - // condition_names: vec![], - // }, - TestCase { - name: "backtracking package base #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/../utils/index": "./src/../index.js" - })), - request: "./utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #7", - expect: None, - exports_field: exports_field(json!({ - "./utils/": { - "browser": "../this/" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #7", - expect: None, - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "../this/*" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #8", - // We throw "InvalidPackageTarget" - // expect: Some(vec!["./utils/../index"]), - expect: None, - exports_field: exports_field(json!({ - "./utils/": { - "browser": "./utils/../" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #8 (wildcard)", - // We throw "InvalidPackageTarget" - // expect: Some(vec!["./utils/../index"]), - expect: None, - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "./utils/../*" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #9", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./": "./src/../../", - "./dist/": "./dist/" - })), - request: "./dist/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #9 (wildcard)", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./*": "./src/../../*", - "./dist/*": "./dist/*" - })), - request: "./dist/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking target folder #1", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../../index"]), - exports_field: exports_field(json!({ - "./utils/": "./dist/" - })), - request: "./utils/timezone/../../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #1 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../../index"]), - exports_field: exports_field(json!({ - "./utils/*": "./dist/*" - })), - request: "./utils/timezone/../../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #2", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../index"]), - exports_field: exports_field(json!({ - "./utils/": "./dist/" - })), - request: "./utils/timezone/../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #2 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../index"]), - exports_field: exports_field(json!({ - "./utils/*": "./dist/*" - })), - request: "./utils/timezone/../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #3", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/target/../../index"]), - exports_field: exports_field(json!({ - "./utils/": "./dist/target/" - })), - request: "./utils/../../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #3 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/target/../../index"]), - exports_field: exports_field(json!({ - "./utils/*": "./dist/target/*" - })), - request: "./utils/../../index", - condition_names: vec![], - }, - // enhanced-resolve does not handle `node_modules` in target - TestCase { - name: "nested node_modules path #1", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": "./node_modules/" - } - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #1 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "./node_modules/*" - } - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #2", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./utils/../node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/": "./utils/../node_modules/" - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "nested node_modules path #2 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./utils/../node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": "./utils/../node_modules/*" - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "nested mapping #1", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": "./", - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested mapping #1 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": "./*", - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "nested mapping #2 (wildcard)", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #2 (wildcard)", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "nested mapping #3", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["webpack"], - }, - TestCase { - name: "nested mapping #3 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["webpack"], - }, - TestCase { - name: "nested mapping #4", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["node", "browser"], - }, - TestCase { - name: "nested mapping #4 (wildcard)", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["node", "browser"], - }, - TestCase { - name: "nested mapping #5", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node"], - }, - TestCase { - name: "nested mapping #5 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": { - "webpack": [ - "./wpck/*" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node"], - }, - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - TestCase { - name: "nested mapping #6 (wildcard)", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": { - "webpack": [ - "./wpck/*" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #6 (wildcard)", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./node/*" - ], - "default": { - "node": { - "webpack": [ - "./wpck/*" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - TestCase { - name: "nested mapping #7", - expect: Some(vec!["./y.js"]), - exports_field: exports_field(json!({ - "./a.js": { - "abc": { - "def": "./x.js" - }, - "ghi": "./y.js" - } - })), - request: "./a.js", - condition_names: vec!["abc", "ghi"], - }, - TestCase { - name: "nested mapping #8", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./a.js": { - "abc": { - "def": "./x.js", - "default": [] - }, - "ghi": "./y.js" - } - })), - request: "./a.js", - condition_names: vec!["abc", "ghi"], - }, - TestCase { - name: "syntax sugar #1", - expect: Some(vec!["./main.js"]), - exports_field: exports_field(json!("./main.js")), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #2", - expect: Some(vec![]), - exports_field: exports_field(json!("./main.js")), - request: "./lib.js", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #3", - expect: Some(vec!["./a.js"]), - exports_field: exports_field(json!(["./a.js", "./b.js"])), - request: ".", - condition_names: vec![], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "syntax sugar #3", - expect: Some(vec!["./b.js"]), - exports_field: exports_field(json!(["./b.js"])), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #4", - expect: Some(vec![]), - exports_field: exports_field(json!(["./a.js", "./b.js"])), - request: "./lib.js", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #5", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "browser": { - "default": "./index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "syntax sugar #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "browser": { - "default": "./index.js" - } - })), - request: "./lib.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "syntax sugar #7", - expect: None, - exports_field: exports_field(json!({ - "./node": "./node.js", - "browser": { - "default": "./index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "syntax sugar #8", - expect: None, - exports_field: exports_field(json!({ - "browser": { - "default": "./index.js" - }, - "./node": "./node.js" - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #1", - expect: Some(vec!["./abc/d"]), - exports_field: exports_field(json!({ - "./ab*": "./ab/*", - "./abc*": "./abc/*", - "./a*": "./a/*" - })), - request: "./abcd", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #2", - expect: Some(vec!["./abc/d/e"]), - exports_field: exports_field(json!({ - "./ab*": "./ab/*", - "./abc*": "./abc/*", - "./a*": "./a/*" - })), - request: "./abcd/e", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #3", - expect: Some(vec!["./abc/d"]), - exports_field: exports_field(json!({ - "./x/ab*": "./ab/*", - "./x/abc*": "./abc/*", - "./x/a*": "./a/*" - })), - request: "./x/abcd", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #4", - expect: Some(vec!["./abc/d/e"]), - exports_field: exports_field(json!({ - "./x/ab*": "./ab/*", - "./x/abc*": "./abc/*", - "./x/a*": "./a/*" - })), - request: "./x/abcd/e", - condition_names: vec!["browser"], - }, - TestCase { - name: "path tree edge case #1", - expect: Some(vec!["./A/b/d.js"]), - exports_field: exports_field(json!({ - "./a/": "./A/", - "./a/b/c": "./c.js" - })), - request: "./a/b/d.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #1 (wildcard)", - expect: Some(vec!["./A/b/d.js"]), - exports_field: exports_field(json!({ - "./a/*": "./A/*", - "./a/b/c": "./c.js" - })), - request: "./a/b/d.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #2", - expect: Some(vec!["./A/c.js"]), - exports_field: exports_field(json!({ - "./a/": "./A/", - "./a/b": "./b.js" - })), - request: "./a/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #2 (wildcard)", - expect: Some(vec!["./A/c.js"]), - exports_field: exports_field(json!({ - "./a/*": "./A/*", - "./a/b": "./b.js" - })), - request: "./a/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #3", - expect: Some(vec!["./A/b/d/c.js"]), - exports_field: exports_field(json!({ - "./a/": "./A/", - "./a/b/c/d": "./c.js" - })), - request: "./a/b/d/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #3 (wildcard)", - expect: Some(vec!["./A/b/d/c.js"]), - exports_field: exports_field(json!({ - "./a/*": "./A/*", - "./a/b/c/d": "./c.js" - })), - request: "./a/b/d/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #1", - expect: Some(vec!["./A/b.js"]), - exports_field: exports_field(json!({ - "./a/*.js": "./A/*.js" - })), - request: "./a/b.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #2", - expect: Some(vec!["./A/b/c.js"]), - exports_field: exports_field(json!({ - "./a/*.js": "./A/*.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #3", - expect: Some(vec!["./A/b/c.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": "./A/*/c.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #4", - expect: Some(vec!["./A/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": "./A/*/*.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #5", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/*.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #5", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/*.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./lib/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #6", - expect: Some(vec!["./browser/foo/bar.js"]), - exports_field: exports_field(json!({ - "./lib/*/bar.js": { - "browser": [ - "./browser/*/bar.js" - ] - }, - "./dist/*/bar.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./lib/foo/bar.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #6", - expect: Some(vec!["./browser/foo.js"]), - exports_field: exports_field(json!({ - "./lib/*/bar.js": { - "browser": [ - "./browser/*/bar.js" - ] - }, - "./dist/*/bar.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./dist/foo/bar.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #7", - expect: Some(vec!["./browser/foo/default.js"]), - exports_field: exports_field(json!({ - "./lib/*/bar.js": { - "browser": [ - "./browser/*/bar.js" - ] - }, - "./dist/*/bar.js": { - "node": "./*.js", - "default": "./browser/*/default.js" - } - })), - request: "./dist/foo/bar.js", - condition_names: vec!["default"], - }, - TestCase { - name: "wildcard pattern #8", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": "./A/*/*/*.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #9", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": [ - "./A/*/*/*.js", - "./B/*/*/*.js" - ] - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "wildcard pattern #9", - expect: Some(vec!["./B/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": [ - "./B/*/*/*.js" - ] - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #10", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/foo-*/c.js": "./A/*/*/*.js" - })), - request: "./a/foo-b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #11", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*-foo/c.js": "./A/*/*/*.js" - })), - request: "./a/b-foo/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #12", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/foo-*-foo/c.js": "./A/*/*/*.js" - })), - request: "./a/foo-b-foo/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #13", - expect: Some(vec!["./A/b/c/d.js"]), - exports_field: exports_field(json!({ - "./a/foo-*-foo/c.js": "./A/b/c/d.js" - })), - request: "./a/foo-b-foo/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #14", - expect: Some(vec!["./A/b/c/*.js"]), - exports_field: exports_field(json!({ - "./a/foo-foo/c.js": "./A/b/c/*.js" - })), - request: "./a/foo-foo/c.js", - condition_names: vec![], - }, - ]; - - for case in test_cases { - let resolved = Resolver::new(ResolveOptions { - condition_names: case - .condition_names - .iter() - .map(ToString::to_string) - .collect::>(), - ..ResolveOptions::default() - }) - .package_exports_resolve( - Path::new(""), - case.request, - &case.exports_field, - &mut Ctx::default(), - ) - .map(|p| p.map(|p| p.to_path_buf())); - if let Some(expect) = case.expect { - if expect.is_empty() { - assert!( - matches!(resolved, Err(ResolveError::PackagePathNotExported(_, _))), - "{} {:?}", - &case.name, - &resolved - ); - } else { - for expect in expect { - assert_eq!(resolved, Ok(Some(Path::new(expect).normalize())), "{}", &case.name); - } - } - } else { - assert!(resolved.is_err(), "{} {resolved:?}", &case.name); - } - } -} diff --git a/src/tests/extension_alias.rs b/src/tests/extension_alias.rs deleted file mode 100644 index cc6a906b..00000000 --- a/src/tests/extension_alias.rs +++ /dev/null @@ -1,70 +0,0 @@ -//! - -use crate::{ResolveError, ResolveOptions, Resolver}; - -#[test] -fn extension_alias() { - let f = super::fixture().join("extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - extension_alias: vec![ - (".js".into(), vec![".ts".into(), ".js".into()]), - (".mjs".into(), vec![".mts".into()]), - ], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should alias fully specified file", f.clone(), "./index.js", f.join("index.ts")), - ("should alias fully specified file when there are two alternatives", f.clone(), "./dir/index.js", f.join("dir/index.ts")), - ("should also allow the second alternative", f.clone(), "./dir2/index.js", f.join("dir2/index.js")), - ("should support alias option without an array", f.clone(), "./dir2/index.mjs", f.join("dir2/index.mts")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } - - #[rustfmt::skip] - let fail = [ - ("should not allow to fallback to the original extension or add extensions", f.clone(), "./index.mjs"), - ]; - - for (comment, path, request) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!( - resolution, - Err(ResolveError::ExtensionAlias(f.join(request))), - "{comment} {path:?} {request}" - ); - } -} - -// should not apply extension alias to extensions or mainFiles field -#[test] -fn not_apply_to_extension_nor_main_files() { - let f = super::fixture().join("extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - extension_alias: vec![(".js".into(), vec![])], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("directory", f.clone(), "./dir2", "dir2/index.js"), - ("file", f.clone(), "./dir2/index", "dir2/index.js"), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - let expected = f.join(expected); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} diff --git a/src/tests/extensions.rs b/src/tests/extensions.rs deleted file mode 100644 index 1ebd86f4..00000000 --- a/src/tests/extensions.rs +++ /dev/null @@ -1,125 +0,0 @@ -//! - -use crate::{EnforceExtension, Resolution, ResolveContext, ResolveError, ResolveOptions, Resolver}; -use rustc_hash::FxHashSet; - -#[test] -fn extensions() { - let f = super::fixture().join("extensions"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".ts".into(), ".js".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve according to order of provided extensions", "./foo", "foo.ts"), - ("should resolve according to order of provided extensions (dir index)", "./dir", "dir/index.ts"), - ("should resolve according to main field in module root", ".", "index.js"), - // This is a core module - // ("should resolve single file module before directory", "module", "node_modules/module.js"), - ("should resolve trailing slash directory before single file", "module/", "node_modules/module/index.ts"), - ]; - - for (comment, request, expected_path) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - let expected = f.join(expected_path); - assert_eq!(resolved_path, Ok(expected), "{comment} {request} {expected_path}"); - } - - #[rustfmt::skip] - let fail = [ - ("not resolve to file when request has a trailing slash (relative)", "./foo.js/", "./foo.js/".into()) - ]; - - for (comment, request, expected_error) in fail { - let resolution = resolver.resolve(&f, request); - let error = ResolveError::NotFound(expected_error); - assert_eq!(resolution, Err(error), "{comment} {request} {resolution:?}"); - } -} - -// should default enforceExtension to true when extensions includes an empty string -#[test] -fn default_enforce_extension() { - let f = super::fixture().join("extensions"); - - let mut ctx = ResolveContext::default(); - let resolved = Resolver::new(ResolveOptions { - extensions: vec![".ts".into(), String::new(), ".js".into()], - ..ResolveOptions::default() - }) - .resolve_with_context(&f, "./foo", &mut ctx); - - assert_eq!(resolved.map(Resolution::into_path_buf), Ok(f.join("foo.ts"))); - assert_eq!( - ctx.file_dependencies, - FxHashSet::from_iter([f.join("foo.ts"), f.join("package.json")]) - ); - assert!(ctx.missing_dependencies.is_empty()); -} - -// should respect enforceExtension when extensions includes an empty string -#[test] -fn respect_enforce_extension() { - let f = super::fixture().join("extensions"); - - let mut ctx = ResolveContext::default(); - let resolved = Resolver::new(ResolveOptions { - enforce_extension: EnforceExtension::Disabled, - extensions: vec![".ts".into(), String::new(), ".js".into()], - ..ResolveOptions::default() - }) - .resolve_with_context(&f, "./foo", &mut ctx); - - assert_eq!(resolved.map(Resolution::into_path_buf), Ok(f.join("foo.ts"))); - assert_eq!( - ctx.file_dependencies, - FxHashSet::from_iter([f.join("foo.ts"), f.join("package.json")]) - ); - assert_eq!(ctx.missing_dependencies, FxHashSet::from_iter([f.join("foo")])); -} - -#[test] -fn multi_dot_extension() { - let f = super::fixture().join("extensions"); - - let resolver = Resolver::new(ResolveOptions { - // Test for `.d.ts`, not part of enhanced-resolve. - extensions: vec![".a.b.c".into(), ".d.ts".into(), ".ts".into(), ".js".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve according to order of provided extensions", "./foo", "foo.ts"), - ("should resolve file with extension", "./app.module", "app.module.js") - ]; - - for (comment, request, expected_path) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - let expected = f.join(expected_path); - assert_eq!(resolved_path, Ok(expected), "{comment} {request} {expected_path}"); - } - - #[rustfmt::skip] - let fail = [ - ("not resolve to file", "./index.", "./index.".into()) - ]; - - for (comment, request, expected_error) in fail { - let resolution = resolver.resolve(&f, request); - let error = ResolveError::NotFound(expected_error); - assert_eq!(resolution, Err(error), "{comment} {request} {resolution:?}"); - } -} - -#[test] -#[should_panic = "All extensions must start with a leading dot"] -fn without_leading_dot() { - Resolver::new(ResolveOptions { - extensions: vec!["ts".into(), "js".into()], - ..ResolveOptions::default() - }); -} diff --git a/src/tests/fallback.rs b/src/tests/fallback.rs deleted file mode 100644 index 3da2d767..00000000 --- a/src/tests/fallback.rs +++ /dev/null @@ -1,100 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/fallback.test.js - -#[test] -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -fn fallback() { - use super::memory_fs::MemoryFS; - use crate::{AliasValue, ResolveError, ResolveOptions, ResolverGeneric}; - use std::path::{Path, PathBuf}; - - let f = Path::new("/"); - - let file_system = MemoryFS::new(&[ - ("/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", ""), - ]); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - fallback: vec![ - ("aliasA".into(), vec![AliasValue::Path("a".into())]), - ("b$".into(), vec![AliasValue::Path("a/index".into())]), - ("c$".into(), vec![AliasValue::Path("/a/index".into())]), - ( - "multiAlias".into(), - vec![ - AliasValue::Path("b".into()), - AliasValue::Path("c".into()), - AliasValue::Path("d".into()), - AliasValue::Path("e".into()), - AliasValue::Path("a".into()), - ], - ), - ("recursive".into(), vec![AliasValue::Path("recursive/dir".into())]), - ("/d/dir".into(), vec![AliasValue::Path("/c/dir".into())]), - ("/d/index.js".into(), vec![AliasValue::Path("/c/index".into())]), - ("ignored".into(), vec![AliasValue::Ignore]), - ("node:path".into(), vec![AliasValue::Ignore]), - ], - modules: vec!["/".into()], - ..ResolveOptions::default() - }, - ); - - #[rustfmt::skip] - let pass = [ - ("should resolve a not aliased module 1", "a", "/a/index"), - ("should resolve a not aliased module 2", "a/index", "/a/index"), - ("should resolve a not aliased module 3", "a/dir", "/a/dir/index"), - ("should resolve a not aliased module 4", "a/dir/index", "/a/dir/index"), - ("should resolve an fallback module 1", "aliasA", "/a/index"), - ("should resolve an fallback module 2", "aliasA/index", "/a/index"), - ("should resolve an fallback module 3", "aliasA/dir", "/a/dir/index"), - ("should resolve an fallback module 4", "aliasA/dir/index", "/a/dir/index"), - ("should resolve a recursive aliased module 1", "recursive", "/recursive/index"), - ("should resolve a recursive aliased module 2", "recursive/index", "/recursive/index"), - ("should resolve a recursive aliased module 3", "recursive/dir", "/recursive/dir/index"), - ("should resolve a recursive aliased module 4", "recursive/dir/index", "/recursive/dir/index"), - ("should resolve a recursive aliased module 5", "recursive/file", "/recursive/dir/file"), - ("should resolve a file aliased module with a query 1", "b?query", "/b/index?query"), - ("should resolve a file aliased module with a query 2", "c?query", "/c/index?query"), - ("should resolve a path in a file aliased module 1", "b/index", "/b/index"), - ("should resolve a path in a file aliased module 2", "b/dir", "/b/dir/index"), - ("should resolve a path in a file aliased module 3", "b/dir/index", "/b/dir/index"), - ("should resolve a path in a file aliased module 4", "c/index", "/c/index"), - ("should resolve a path in a file aliased module 5", "c/dir", "/c/dir/index"), - ("should resolve a path in a file aliased module 6", "c/dir/index", "/c/dir/index"), - ("should resolve a file in multiple aliased dirs 1", "multiAlias/dir/file", "/e/dir/file"), - ("should resolve a file in multiple aliased dirs 2", "multiAlias/anotherDir", "/e/anotherDir/index"), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - - #[rustfmt::skip] - let ignore = [ - ("should resolve an ignore module", "ignored", ResolveError::Ignored(f.join("ignored"))), - ("should resolve node: builtin module", "node:path", ResolveError::Ignored(PathBuf::from("/node:path"))), - ]; - - for (comment, request, expected) in ignore { - let resolution = resolver.resolve(f, request); - assert_eq!(resolution, Err(expected), "{comment} {request}"); - } -} diff --git a/src/tests/full_specified.rs b/src/tests/full_specified.rs deleted file mode 100644 index a70c0191..00000000 --- a/src/tests/full_specified.rs +++ /dev/null @@ -1,113 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/fullSpecified.test.js - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows { - use std::path::PathBuf; - - use crate::{AliasValue, ResolveOptions, ResolverGeneric}; - - use super::super::memory_fs::MemoryFS; - - fn file_system() -> MemoryFS { - MemoryFS::new(&[ - ("/a/node_modules/package1/index.js", ""), - ("/a/node_modules/package1/file.js", ""), - ("/a/node_modules/package2/package.json", r#"{"main":"a"}"#), - ("/a/node_modules/package2/a.js", ""), - ("/a/node_modules/package3/package.json", r#"{"main":"dir"}"#), - ("/a/node_modules/package3/dir/index.js", ""), - ("/a/node_modules/package4/package.json", r#"{"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", ""), - ]) - } - - #[test] - fn test() { - let file_system = file_system(); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - alias: vec![ - ("alias1".into(), vec![AliasValue::from("/a/abc")]), - ("alias2".into(), vec![AliasValue::from("/a")]), - ], - alias_fields: vec![vec!["browser".into()]], - fully_specified: true, - ..ResolveOptions::default() - }, - ); - - let failing_resolves = [ - ("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"), - ]; - - for (comment, request) in failing_resolves { - let resolution = resolver.resolve("/a", request); - assert!(resolution.is_err(), "{comment} {request}"); - } - - let successful_resolves = [ - ("fully relative", "./abc.js", "/a/abc.js"), - ("fully absolute", "/a/abc.js", "/a/abc.js"), - ("fully relative in package", "package1/file.js", "/a/node_modules/package1/file.js"), - ("extensions in mainFiles", "package1", "/a/node_modules/package1/index.js"), - ("extensions in mainFields", "package2", "/a/node_modules/package2/a.js"), - ("extensions in alias", "alias1", "/a/abc.js"), - ("directories in alias", "alias2", "/a/index.js"), - ("directories in packages", "package3", "/a/node_modules/package3/dir/index.js"), - ("extensions in aliasFields", "package4/a.js", "/a/node_modules/package4/b.js"), - ]; - - for (comment, request, expected) in successful_resolves { - let resolution = resolver.resolve("/a", request).map(|r| r.full_path()); - assert_eq!(resolution, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - } - - #[test] - #[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. - fn resolve_to_context() { - let file_system = file_system(); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - alias: vec![ - ("alias1".into(), vec![AliasValue::from("/a/abc")]), - ("alias2".into(), vec![AliasValue::from("/a")]), - ], - alias_fields: vec![vec!["browser".into()]], - fully_specified: true, - resolve_to_context: true, - ..ResolveOptions::default() - }, - ); - - let successful_resolves = [ - ("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", "/a/node_modules/package3/dir"), - ]; - - for (comment, request, expected) in successful_resolves { - let resolution = resolver.resolve("/a", request).map(|r| r.full_path()); - assert_eq!(resolution, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - } -} diff --git a/src/tests/imports_field.rs b/src/tests/imports_field.rs deleted file mode 100644 index c928627a..00000000 --- a/src/tests/imports_field.rs +++ /dev/null @@ -1,1320 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/importsField.test.js -//! -//! The huge imports field test cases are at the bottom of this file. - -use serde_json::json; - -use crate::{Ctx, JSONMap, PathUtil, ResolveError, ResolveOptions, Resolver}; -use std::path::Path; - -#[test] -fn test_simple() { - let f = super::fixture().join("imports-field"); - let f2 = super::fixture().join("imports-exports-wildcard/node_modules/m/"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve using imports field instead of self-referencing", f.clone(), "#imports-field", f.join("b.js")), - ("should resolve using imports field instead of self-referencing for a subpath", f.join("dir"), "#imports-field", f.join("b.js")), - ("should resolve package #1", f.clone(), "#a/dist/main.js", f.join("node_modules/a/lib/lib2/main.js")), - ("should resolve package #3", f.clone(), "#ccc/index.js", f.join("node_modules/c/index.js")), - ("should resolve package #4", f.clone(), "#c", f.join("node_modules/c/index.js")), - ("should resolve with wildcard pattern", f2.clone(), "#internal/i.js", f2.join("src/internal/i.js")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } - - // Note added: - // * should resolve absolute path as an imports field target - // * should log the correct info - - #[rustfmt::skip] - let fail = [ - ("should disallow resolve out of package scope", f.clone(), "#b", ResolveError::InvalidPackageTarget("../b.js".to_string(), "#b".to_string(), f.join("package.json"))), - ("should resolve package #2", f.clone(), "#a", ResolveError::PackageImportNotDefined("#a".to_string(), f.join("package.json"))), - ]; - - for (comment, path, request, error) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!(resolution, Err(error), "{comment} {path:?} {request}"); - } -} - -#[test] -fn shared_resolvers() { - let f = super::fixture().join("imports-field"); - - // field name #1 - let resolver1 = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - imports_fields: vec![vec!["imports".into()]], - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - let resolved_path = resolver1.resolve(&f, "#imports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("b.js"))); - - // field name #2 - let resolver2 = resolver1.clone_with_options(ResolveOptions { - imports_fields: vec![vec!["other".into(), "imports".into()]], - ..ResolveOptions::default() - }); - - let resolved_path = resolver2.resolve(&f, "#b").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("a.js"))); -} - -// Small script for generating the test cases from enhanced_resolve -// for (c of testCases) { -// console.log("TestCase {") -// console.log(`name: ${JSON.stringify(c.name)},`) -// if (c.expect instanceof Error) { -// console.log(`expect: None,`) -// } else { -// console.log(`expect: Some(vec!${JSON.stringify(c.expect)}),`) -// } -// console.log(`imports_field: imports_field(json!(${JSON.stringify(c.suite[0], null, 2)})),`) -// console.log(`request: "${c.suite[1]}",`) -// console.log(`condition_names: vec!${JSON.stringify(c.suite[2])},`) -// console.log("},") -// } - -struct TestCase { - name: &'static str, - expect: Option>, - imports_field: JSONMap, - request: &'static str, - condition_names: Vec<&'static str>, -} - -#[allow(clippy::needless_pass_by_value)] -fn imports_field(value: serde_json::Value) -> JSONMap { - let s = serde_json::to_string(&value).unwrap(); - serde_json::from_str(&s).unwrap() -} - -#[test] -fn test_cases() { - let test_cases = [ - TestCase { - name: "sample #1", - expect: Some(vec!["./dist/test/file.js"]), - imports_field: imports_field(json!({ - "#abc/": { - "import": [ - "./dist/", - "./src/" - ], - "webpack": "./wp/" - }, - "#abc": "./main.js" - })), - request: "#abc/test/file.js", - condition_names: vec!["import", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "sample #1", - expect: Some(vec!["./src/test/file.js"]), - imports_field: imports_field(json!({ - "#abc/": { - "import": [ - "./src/" - ], - "webpack": "./wp/" - }, - "#abc": "./main.js" - })), - request: "#abc/test/file.js", - condition_names: vec!["import", "webpack"], - }, - TestCase { - name: "sample #2", - expect: Some(vec!["./data/timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#1/timezones/": "./data/timezones/" - })), - request: "#1/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #3", - expect: Some(vec!["./data/timezones/timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#aaa/": "./data/timezones/", - "#a/": "./data/timezones/" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #4", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/lib/": { - "browser": [ - "./browser/" - ] - }, - "#a/dist/index.js": { - "node": "./index.js" - } - })), - request: "#a/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #5", - expect: Some(vec!["./browser/index.js"]), - imports_field: imports_field(json!({ - "#a/lib/": { - "browser": [ - "./browser/" - ] - }, - "#a/dist/index.js": { - "node": "./index.js", - "default": "./browser/index.js" - } - })), - request: "#a/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #6", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/dist/a": "./dist/index.js" - })), - request: "#a/dist/aaa", - condition_names: vec![], - }, - TestCase { - name: "sample #7", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/a/a/": "./dist/index.js" - })), - request: "#a/a/a", - condition_names: vec![], - }, - TestCase { - name: "sample #8", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": "./index.js" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #9", - expect: Some(vec!["./main.js"]), - imports_field: imports_field(json!({ - "#a/index.js": "./main.js" - })), - request: "#a/index.js", - condition_names: vec![], - }, - TestCase { - name: "sample #10", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #11", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/bar#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #12", - expect: Some(vec!["./ok.js#abc"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/ok.js#abc", - condition_names: vec![], - }, - TestCase { - name: "sample #13", - expect: Some(vec!["./ok.js?abc"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/ok.js?abc", - condition_names: vec![], - }, - TestCase { - name: "sample #14", - expect: Some(vec!["./🎉.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/🎉.js", - condition_names: vec![], - }, - TestCase { - name: "sample #15", - expect: Some(vec!["./%F0%9F%8E%89.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/%F0%9F%8E%89.js", - condition_names: vec![], - }, - TestCase { - name: "sample #16", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/🎉", - condition_names: vec![], - }, - TestCase { - name: "sample #17", - expect: Some(vec!["./other.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/%F0%9F%8E%89", - condition_names: vec![], - }, - TestCase { - name: "sample #18", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/module", - condition_names: vec![], - }, - TestCase { - name: "sample #19", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/module#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #20", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/module?foo", - condition_names: vec![], - }, - TestCase { - name: "sample #21", - expect: Some(vec!["./d?e?f"]), - imports_field: imports_field(json!({ - "#a/a?b?c/": "./" - })), - request: "#a/a?b?c/d?e?f", - condition_names: vec![], - }, - TestCase { - name: "sample #22", - // We throw InvalidPackageTarget - expect: None, - // expect: Some(vec!["/user/a/index"]), - imports_field: imports_field(json!({ - "#a/": "/user/a/" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #1", - expect: Some(vec!["./A/b/d.js"]), - imports_field: imports_field(json!({ - "#a/": "./A/", - "#a/b/c": "./c.js" - })), - request: "#a/b/d.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #2", - expect: Some(vec!["./A/c.js"]), - imports_field: imports_field(json!({ - "#a/": "./A/", - "#a/b": "./b.js" - })), - request: "#a/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #3", - expect: Some(vec!["./A/b/c/d.js"]), - imports_field: imports_field(json!({ - "#a/": "./A/", - "#a/b/c/d": "./c.js" - })), - request: "#a/b/c/d.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #1", - expect: Some(vec!["./dist/index.js"]), - imports_field: imports_field(json!({ - "#a": "./dist/index.js" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #2", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": "./" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #3", - expect: Some(vec!["./dist/a.js"]), - imports_field: imports_field(json!({ - "#a/": "./dist/", - "#a/index.js": "./dist/a.js" - })), - request: "#a/index.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #4", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "./browser/" - ] - }, - "#a/index.js": { - "browser": "./index.js" - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #5", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "./browser/" - ] - }, - "#a/index.js": { - "node": "./node.js" - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #6", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: "#a", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #7", - expect: Some(vec!["./src/index.js"]), // `enhanced_resolve` is `None` - imports_field: imports_field(json!({ - "#a": { - "default": "./src/index.js", - "browser": "./index.js", - "node": "./src/node/index.js" - } - })), - request: "#a", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #8", - expect: Some(vec!["./src/index.js"]), - imports_field: imports_field(json!({ - "#a": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #9", - expect: Some(vec!["./index"]), - imports_field: imports_field(json!({ - "#a": "./index" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #10", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/index": "./index.js" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #11", - // We throw InvalidPackageTarget - // expect: Some(vec!["b"]), - expect: None, - imports_field: imports_field(json!({ - "#a": "b" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #12", - // We throw InvalidPackageTarget - // expect: Some(vec!["b/index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "b/" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #13", - // We throw InvalidPackageTarget - // expect: Some(vec!["b#anotherhashishere"]), - expect: None, - imports_field: imports_field(json!({ - "#a?q=a#hashishere": "b#anotherhashishere" - })), - request: "#a?q=a#hashishere", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #1", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #2", - expect: Some(vec!["./import.mjs"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec!["import"], - }, - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./require.js"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./import.mjs"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./require.js"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": [ - "./require.js" - ] - }, - { - "import": [ - "./import.mjs", - "#b/import.js" - ] - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./import.mjs"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "./import.mjs", - "#b/import.js" - ] - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "#b/import.js" - ] - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "mapping to a folder root #1", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#timezones": "./data/timezones/" - })), - request: "#timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #2", - expect: None, - imports_field: imports_field(json!({ - "#timezones/": "./data/timezones" - })), - request: "#timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #3", - expect: Some(vec!["./data/timezones/pdt/index.mjs"]), - imports_field: imports_field(json!({ - "#timezones/pdt/": "./data/timezones/pdt/" - })), - request: "#timezones/pdt/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #4", - expect: Some(vec!["./timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#a/": "./timezones/" - })), - request: "#a/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #5", - expect: Some(vec!["./timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#a/": "./" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #6", - expect: None, - imports_field: imports_field(json!({ - "#a/": "." - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #7", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": "./" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #1", - expect: Some(vec!["./lib/index.mjs"]), - imports_field: imports_field(json!({ - "#a/": "./", - "#a/dist/": "./lib/" - })), - request: "#a/dist/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #2", - expect: Some(vec!["./dist/utils/index.js"]), - imports_field: imports_field(json!({ - "#a/dist/utils/": "./dist/utils/", - "#a/dist/": "./lib/" - })), - request: "#a/dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #3", - expect: Some(vec!["./dist/utils/index.js"]), - imports_field: imports_field(json!({ - "#a/dist/utils/index.js": "./dist/utils/index.js", - "#a/dist/utils/": "./dist/utils/index.mjs", - "#a/dist/": "./lib/" - })), - request: "#a/dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #4", - expect: Some(vec!["./lib/index.mjs"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./browser/" - }, - "#a/dist/": "./lib/" - })), - request: "#a/dist/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #1", - // This behaves differently from enhanced_resolve, because `lodash/` is an an InvalidPackageConfig - // expect: Some(vec!["lodash/index.js"]), - expect: Some(vec!["./utils/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "conditional mapping folder #1", - expect: Some(vec!["./utils/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #2", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./node/" - ] - } - })), - request: "#a/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "conditional mapping folder #3", - expect: Some(vec!["./wpk/index.mjs"]), - imports_field: imports_field(json!({ - "#a/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils/" - ] - } - })), - request: "#a/index.mjs", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "incorrect exports field #1", - // We throw `PackageImportNotDefined` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "/utils/": "./a/" - })), - request: "#a/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #2", - // We throw `PackageImportNotDefined` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "/utils/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#a/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #3", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index": "./a/index.js" - })), - request: "#a/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #4", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index.mjs": "./a/index.js" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #5", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "#a/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #6", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index.mjs": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "#a/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #1", - // We don't throw in `package_imports_exports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": "./a/" - })), - request: "/utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect request #2", - // We don't throw in `package_imports_exports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #3", - // We don't throw in `package_imports_exports_resolve`, it's thrown in `package_imports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #4", - // We don't throw in `package_imports_exports_resolve`, it's thrown in `package_imports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#/", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #5", - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#a/", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #1", - // expect: Some(vec!["./dist/index"]), - expect: Some(vec!["dist/index"]), - imports_field: imports_field(json!({ - "#a/../../utils/": "./dist/" - })), - request: "#a/../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #2", - // We throw InvalidPackageTarget - // expect: Some(vec!["./dist/../../utils/index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "./dist/" - })), - request: "#a/../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #3", - // We throw InvalidPackageTarget - // expect: Some(vec!["../src/index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "../src/" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #4", - // We throw InvalidPackageTarget - // expect: Some(vec!["./utils/../../../index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": { - "browser": "./utils/../../../" - } - })), - request: "#a/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #1", - // expect: Some(vec!["moment/node_modules/lodash/dist/index.js"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": { - "browser": "moment/node_modules/" - } - })), - request: "#a/lodash/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #2", - // We throw InvalidPackageTarget - // expect: Some(vec!["../node_modules/lodash/dist/index.js"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "../node_modules/" - })), - request: "#a/lodash/dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "nested mapping #1", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": "./", - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./node/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "nested mapping #3", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["webpack"], - }, - TestCase { - name: "nested mapping #4", - // We throw NotFound - // expect: Some(vec!["moment/node/index.js"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "moment/node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["node", "browser"], - }, - TestCase { - name: "nested mapping #5", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "node"], - }, - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./node/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - TestCase { - name: "nested mapping #7", - expect: Some(vec!["./y.js"]), - imports_field: imports_field(json!({ - "#a": { - "abc": { - "def": "./x.js" - }, - "ghi": "./y.js" - } - })), - request: "#a", - condition_names: vec!["abc", "ghi"], - }, - TestCase { - name: "nested mapping #8", - // We throw PackageImportNotDefined - // expect: Some(vec![]), - expect: None, - imports_field: imports_field(json!({ - "#a": { - "abc": { - "def": "./x.js", - "default": [] - }, - "ghi": "./y.js" - } - })), - request: "#a", - condition_names: vec!["abc", "ghi"], - }, - ]; - - for case in test_cases { - let resolved = Resolver::default() - .package_imports_exports_resolve( - case.request, - &case.imports_field, - Path::new(""), - true, - &case.condition_names.iter().map(ToString::to_string).collect::>(), - &mut Ctx::default(), - ) - .map(|p| p.map(|p| p.to_path_buf())); - if let Some(expect) = case.expect { - if expect.is_empty() { - assert!(matches!(resolved, Ok(None)), "{} {:?}", &case.name, &resolved); - } else { - for expect in expect { - assert_eq!(resolved, Ok(Some(Path::new(expect).normalize())), "{}", &case.name); - } - } - } else { - assert!(resolved.is_err(), "{} {resolved:?}", &case.name); - } - } -} diff --git a/src/tests/incorrect_description_file.rs b/src/tests/incorrect_description_file.rs deleted file mode 100644 index e2caecbb..00000000 --- a/src/tests/incorrect_description_file.rs +++ /dev/null @@ -1,65 +0,0 @@ -//! - -use rustc_hash::FxHashSet; - -use crate::{JSONError, Resolution, ResolveContext, ResolveError, ResolveOptions, Resolver}; - -// should not resolve main in incorrect description file #1 -#[test] -fn incorrect_description_file_1() { - let f = super::fixture().join("incorrect-package"); - let mut ctx = ResolveContext::default(); - let resolution = Resolver::default().resolve_with_context(f.join("pack1"), ".", &mut ctx); - let error = ResolveError::JSON(JSONError { - path: f.join("pack1/package.json"), - message: String::from("EOF while parsing a value at line 3 column 0"), - line: 3, - column: 0, - }); - assert_eq!(resolution, Err(error)); - assert_eq!( - ctx.file_dependencies, - FxHashSet::from_iter([f.join("pack1"), f.join("pack1/package.json")]) - ); - assert!(!ctx.missing_dependencies.is_empty()); -} - -// should not resolve main in incorrect description file #2 -#[test] -fn incorrect_description_file_2() { - let f = super::fixture().join("incorrect-package"); - let resolution = Resolver::default().resolve(f.join("pack2"), "."); - let error = ResolveError::JSON(JSONError { - path: f.join("pack2/package.json"), - message: String::from("EOF while parsing a value at line 1 column 0"), - line: 1, - column: 0, - }); - assert_eq!(resolution, Err(error)); -} - -// should not resolve main in incorrect description file #3 -#[test] -fn incorrect_description_file_3() { - let f = super::fixture().join("incorrect-package"); - let resolution = Resolver::default().resolve(f.join("pack2"), "."); - assert!(resolution.is_err()); -} - -// `enhanced_resolve` does not have this test case -#[test] -fn no_description_file() { - let f = super::fixture_root().join("enhanced_resolve"); - - // has description file - let resolver = Resolver::default(); - assert_eq!( - resolver.resolve(&f, ".").map(Resolution::into_path_buf), - Ok(f.join("lib/index.js")) - ); - - // without description file - let resolver = - Resolver::new(ResolveOptions { description_files: vec![], ..ResolveOptions::default() }); - assert_eq!(resolver.resolve(&f, "."), Err(ResolveError::NotFound(".".into()))); -} diff --git a/src/tests/main_field.rs b/src/tests/main_field.rs deleted file mode 100644 index 3cadc8ce..00000000 --- a/src/tests/main_field.rs +++ /dev/null @@ -1,24 +0,0 @@ -//! Not part of enhanced_resolve's test suite - -use crate::{ResolveOptions, Resolver}; - -#[test] -fn test() { - let f = super::fixture().join("restrictions"); - - let resolver1 = Resolver::new(ResolveOptions { - main_fields: vec!["style".into()], - ..ResolveOptions::default() - }); - - let resolution = resolver1.resolve(&f, "pck2").map(|r| r.full_path()); - assert_eq!(resolution, Ok(f.join("node_modules/pck2/index.css"))); - - let resolver2 = resolver1.clone_with_options(ResolveOptions { - main_fields: vec!["module".into(), "main".into()], - ..ResolveOptions::default() - }); - - let resolution = resolver2.resolve(&f, "pck2").map(|r| r.full_path()); - assert_eq!(resolution, Ok(f.join("node_modules/pck2/module.js"))); -} diff --git a/src/tests/memory_fs.rs b/src/tests/memory_fs.rs deleted file mode 100644 index e4116609..00000000 --- a/src/tests/memory_fs.rs +++ /dev/null @@ -1,74 +0,0 @@ -use std::{ - io, - path::{Path, PathBuf}, -}; - -use crate::{FileMetadata, FileSystem}; - -#[derive(Default)] -pub struct MemoryFS { - fs: vfs::MemoryFS, -} - -impl MemoryFS { - /// # Panics - /// - /// * Fails to create directory - /// * Fails to write file - #[allow(dead_code)] - pub fn new(data: &[(&'static str, &'static str)]) -> Self { - let mut fs = Self { fs: vfs::MemoryFS::default() }; - for (path, content) in data { - fs.add_file(Path::new(path), content); - } - fs - } - - #[allow(dead_code)] - pub fn add_file(&mut self, path: &Path, content: &str) { - use vfs::FileSystem; - let fs = &mut self.fs; - // Create all parent directories - for path in path.ancestors().collect::>().iter().rev() { - let path = path.to_string_lossy(); - if !fs.exists(path.as_ref()).unwrap() { - fs.create_dir(path.as_ref()).unwrap(); - } - } - // Create file - let mut file = fs.create_file(path.to_string_lossy().as_ref()).unwrap(); - file.write_all(content.as_bytes()).unwrap(); - } -} - -impl FileSystem for MemoryFS { - fn read_to_string(&self, path: &Path) -> io::Result { - use vfs::FileSystem; - let mut file = self - .fs - .open_file(path.to_string_lossy().as_ref()) - .map_err(|err| io::Error::new(io::ErrorKind::NotFound, err))?; - let mut buffer = String::new(); - file.read_to_string(&mut buffer).unwrap(); - Ok(buffer) - } - - fn metadata(&self, path: &Path) -> io::Result { - use vfs::FileSystem; - let metadata = self - .fs - .metadata(path.to_string_lossy().as_ref()) - .map_err(|err| io::Error::new(io::ErrorKind::NotFound, err))?; - let is_file = metadata.file_type == vfs::VfsFileType::File; - let is_dir = metadata.file_type == vfs::VfsFileType::Directory; - Ok(FileMetadata::new(is_file, is_dir, false)) - } - - fn symlink_metadata(&self, path: &Path) -> io::Result { - self.metadata(path) - } - - fn canonicalize(&self, _path: &Path) -> io::Result { - Err(io::Error::new(io::ErrorKind::NotFound, "not a symlink")) - } -} diff --git a/src/tests/missing.rs b/src/tests/missing.rs deleted file mode 100644 index 4bf611ef..00000000 --- a/src/tests/missing.rs +++ /dev/null @@ -1,106 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/missing.test.js - -use normalize_path::NormalizePath; - -use crate::{AliasValue, ResolveContext, ResolveOptions, Resolver}; - -#[test] -fn test() { - let f = super::fixture(); - - let data = [ - ( - "./missing-file", - vec![f.join("missing-file"), f.join("missing-file.js"), f.join("missing-file.node")], - ), - ( - "missing-module", - vec![ - f.join("node_modules/missing-module"), - f.parent().unwrap().join("node_modules"), // enhanced-resolve is "node_modules/missing-module" - ], - ), - ( - "missing-module/missing-file", - vec![ - f.join("node_modules/missing-module"), - // f.parent().unwrap().join("node_modules/missing-module"), // we don't report this - ], - ), - ( - "m1/missing-file", - vec![ - f.join("node_modules/m1/missing-file"), - f.join("node_modules/m1/missing-file.js"), - f.join("node_modules/m1/missing-file.node"), - // f.parent().unwrap().join("node_modules/m1"), // we don't report this - ], - ), - ( - "m1/", - vec![ - f.join("node_modules/m1/index"), - f.join("node_modules/m1/index.js"), - f.join("node_modules/m1/index.json"), - f.join("node_modules/m1/index.node"), - ], - ), - ("m1/a", vec![f.join("node_modules/m1/a")]), - ]; - - let resolver = Resolver::default(); - - for (specifier, missing_dependencies) in data { - let mut ctx = ResolveContext::default(); - let _ = resolver.resolve_with_context(&f, specifier, &mut ctx); - - for path in ctx.file_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - } - - for path in missing_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - assert!( - ctx.missing_dependencies.contains(&path), - "{specifier}: {path:?} not in {:?}", - &ctx.missing_dependencies - ); - } - } -} - -#[test] -fn alias_and_extensions() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias: vec![ - ( - "@scope-js/package-name/dir$".into(), - vec![AliasValue::Path(f.join("foo/index.js").to_string_lossy().to_string())], - ), - ( - "react-dom".into(), - vec![AliasValue::Path(f.join("foo/index.js").to_string_lossy().to_string())], - ), - ], - extensions: vec![".server.ts".into()], - - ..ResolveOptions::default() - }); - - let mut ctx = ResolveContext::default(); - let _ = resolver.resolve_with_context(&f, "@scope-js/package-name/dir/router", &mut ctx); - let _ = resolver.resolve_with_context(&f, "react-dom/client", &mut ctx); - - for path in ctx.file_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - } - - for path in ctx.missing_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - if let Some(path) = path.parent() { - assert!(!path.is_file(), "{path:?} must not be a file"); - } - } -} diff --git a/src/tests/mod.rs b/src/tests/mod.rs deleted file mode 100644 index e347dd1f..00000000 --- a/src/tests/mod.rs +++ /dev/null @@ -1,51 +0,0 @@ -mod alias; -mod browser_field; -mod builtins; -mod dependencies; -mod exports_field; -mod extension_alias; -mod extensions; -mod fallback; -mod full_specified; -mod imports_field; -mod incorrect_description_file; -mod main_field; -mod memory_fs; -mod missing; -#[cfg(feature = "yarn_pnp")] -mod pnp; -mod resolve; -mod restrictions; -mod roots; -mod scoped_packages; -mod simple; -mod symlink; -mod tsconfig_paths; -mod tsconfig_project_references; - -use crate::Resolver; -use std::{env, path::PathBuf, sync::Arc, thread}; - -pub fn fixture_root() -> PathBuf { - env::current_dir().unwrap().join("fixtures") -} - -pub fn fixture() -> PathBuf { - fixture_root().join("enhanced_resolve").join("test").join("fixtures") -} - -#[test] -fn threaded_environment() { - let cwd = env::current_dir().unwrap(); - let resolver = Arc::new(Resolver::default()); - for _ in 0..2 { - _ = thread::spawn({ - let cwd = cwd.clone(); - let resolver = Arc::clone(&resolver); - move || { - _ = resolver.resolve(cwd, "."); - } - }) - .join(); - } -} diff --git a/src/tests/pnp.rs b/src/tests/pnp.rs deleted file mode 100644 index 1562a009..00000000 --- a/src/tests/pnp.rs +++ /dev/null @@ -1,45 +0,0 @@ -//! Not part of enhanced_resolve's test suite -//! -//! enhanced_resolve's test -//! cannot be ported over because it uses mocks on `pnpApi` provided by the runtime. - -use crate::{ResolveOptions, Resolver}; - -#[test] -fn pnp1() { - let fixture = super::fixture_root().join("pnp"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - pnp_manifest: Some(pnp::load_pnp_manifest(fixture.join(".pnp.cjs")).unwrap()), - ..ResolveOptions::default() - }); - - assert_eq!( - resolver.resolve(&fixture, "is-even").map(|r| r.full_path()), - Ok(fixture.join( - ".yarn/cache/is-even-npm-1.0.0-9f726520dc-2728cc2f39.zip/node_modules/is-even/index.js" - )) - ); - - assert_eq!( - resolver - .resolve( - &fixture.join( - ".yarn/cache/is-even-npm-1.0.0-9f726520dc-2728cc2f39.zip/node_modules/is-even" - ), - "is-odd" - ) - .map(|r| r.full_path()), - Ok(fixture.join( - ".yarn/cache/is-odd-npm-0.1.2-9d980a9da8-7dc6c6fd00.zip/node_modules/is-odd/index.js" - )), - ); - - assert_eq!( - resolver.resolve(&fixture, "is-odd").map(|r| r.full_path()), - Ok(fixture.join( - ".yarn/cache/is-odd-npm-3.0.1-93c3c3f41b-89ee2e353c.zip/node_modules/is-odd/index.js" - )), - ); -} diff --git a/src/tests/resolve.rs b/src/tests/resolve.rs deleted file mode 100644 index f2dbb88e..00000000 --- a/src/tests/resolve.rs +++ /dev/null @@ -1,119 +0,0 @@ -//! - -use crate::{ResolveError, ResolveOptions, Resolver}; - -#[test] -fn resolve() { - let f = super::fixture(); - - let resolver = Resolver::default(); - - let main1_js_path = f.join("main1.js").to_string_lossy().to_string(); - - #[rustfmt::skip] - let pass = [ - ("absolute path", f.clone(), main1_js_path.as_str(), f.join("main1.js")), - ("file with .js", f.clone(), "./main1.js", f.join("main1.js")), - ("file without extension", f.clone(), "./main1", f.join("main1.js")), - ("another file with .js", f.clone(), "./a.js", f.join("a.js")), - ("another file without extension", f.clone(), "./a", f.join("a.js")), - ("file in module with .js", f.clone(), "m1/a.js", f.join("node_modules/m1/a.js")), - ("file in module without extension", f.clone(), "m1/a", f.join("node_modules/m1/a.js")), - ("another file in module without extension", f.clone(), "complexm/step1", f.join("node_modules/complexm/step1.js")), - ("from submodule to file in sibling module", f.join("node_modules/complexm"), "m2/b.js", f.join("node_modules/m2/b.js")), - ("from nested directory to overwritten file in module", f.join("multiple_modules"), "m1/a.js", f.join("multiple_modules/node_modules/m1/a.js")), - ("from nested directory to not overwritten file in module", f.join("multiple_modules"), "m1/b.js", f.join("node_modules/m1/b.js")), - ("file with query", f.clone(), "./main1.js?query", f.join("main1.js?query")), - ("file with fragment", f.clone(), "./main1.js#fragment", f.join("main1.js#fragment")), - ("file with fragment and query", f.clone(), "./main1.js#fragment?query", f.join("main1.js#fragment?query")), - ("file with query and fragment", f.clone(), "./main1.js?#fragment", f.join("main1.js?#fragment")), - - ("file with query (unicode)", f.clone(), "./测试.js?query", f.join("测试.js?query")), - ("file with fragment (unicode)", f.clone(), "./测试.js#fragment", f.join("测试.js#fragment")), - ("file with fragment and query (unicode)", f.clone(), "./测试.js#fragment?query", f.join("测试.js#fragment?query")), - ("file with query and fragment (unicode)", f.clone(), "./测试.js?#fragment", f.join("测试.js?#fragment")), - - ("file in module with query", f.clone(), "m1/a?query", f.join("node_modules/m1/a.js?query")), - ("file in module with fragment", f.clone(), "m1/a#fragment", f.join("node_modules/m1/a.js#fragment")), - ("file in module with fragment and query", f.clone(), "m1/a#fragment?query", f.join("node_modules/m1/a.js#fragment?query")), - ("file in module with query and fragment", f.clone(), "m1/a?#fragment", f.join("node_modules/m1/a.js?#fragment")), - ("file in module with query and fragment", f.clone(), "m1/a?#fragment", f.join("node_modules/m1/a.js?#fragment")), - ("differ between directory and file, resolve file", f.clone(), "./dirOrFile", f.join("dirOrFile.js")), - ("differ between directory and file, resolve directory", f.clone(), "./dirOrFile/", f.join("dirOrFile/index.js")), - ("find node_modules outside of node_modules", f.join("browser-module/node_modules"), "m1/a", f.join("node_modules/m1/a.js")), - ("don't crash on main field pointing to self", f.clone(), "./main-field-self", f.join("./main-field-self/index.js")), - ("don't crash on main field pointing to self (2)", f.clone(), "./main-field-self2", f.join("./main-field-self2/index.js")), - // enhanced-resolve has `#` prepended with a `\0`, they are removed from the - // following 3 expected test results. - // See https://github.com/webpack/enhanced-resolve#escaping - ("handle fragment edge case (no fragment)", f.clone(), "./no#fragment/#/#", f.join("no#fragment/#/#.js")), - ("handle fragment edge case (fragment)", f.clone(), "./no#fragment/#/", f.join("no.js#fragment/#/")), - ("handle fragment escaping", f.clone(), "./no\0#fragment/\0#/\0##fragment", f.join("no#fragment/#/#.js#fragment")), - - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn issue238_resolve() { - let f = super::fixture().join("issue-238"); - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into(), ".jsx".into(), ".ts".into(), ".tsx".into()], - modules: vec!["src/a".into(), "src/b".into(), "src/common".into(), "node_modules".into()], - ..ResolveOptions::default() - }); - let resolved_path = - resolver.resolve(f.join("src/common"), "config/myObjectFile").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("src/common/config/myObjectFile.js")),); -} - -#[test] -fn prefer_relative() { - let f = super::fixture(); - - let resolver = - Resolver::new(ResolveOptions { prefer_relative: true, ..ResolveOptions::default() }); - - #[rustfmt::skip] - let pass = [ - ("should correctly resolve with preferRelative 1", "main1.js", f.join("main1.js")), - ("should correctly resolve with preferRelative 2", "m1/a.js", f.join("node_modules/m1/a.js")), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } -} - -#[test] -fn resolve_to_context() { - let f = super::fixture(); - let resolver = - Resolver::new(ResolveOptions { resolve_to_context: true, ..ResolveOptions::default() }); - - #[rustfmt::skip] - let data = [ - ("context for fixtures", f.clone(), "./", f.clone()), - ("context for fixtures/lib", f.clone(), "./lib", f.join("lib")), - ("context for fixtures with ..", f.clone(), "./lib/../../fixtures/./lib/..", f.clone()), - ("context for fixtures with query", f.clone(), "./?query", f.clone().with_file_name("fixtures?query")), - ]; - - for (comment, path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn resolve_hash_as_module() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions::default()); - let resolution = resolver.resolve(f, "#a"); - assert_eq!(resolution, Err(ResolveError::NotFound("#a".into()))); -} diff --git a/src/tests/restrictions.rs b/src/tests/restrictions.rs deleted file mode 100644 index 5ba56596..00000000 --- a/src/tests/restrictions.rs +++ /dev/null @@ -1,25 +0,0 @@ -//! - -use crate::{ResolveError, ResolveOptions, Resolver, Restriction}; - -// TODO: regex -// * should respect RegExp restriction -// * should try to find alternative #1 -// * should try to find alternative #2 -// * should try to find alternative #3 - -// should respect string restriction -#[test] -fn restriction1() { - let fixture = super::fixture(); - let f = fixture.join("restrictions"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - restrictions: vec![Restriction::Path(f.clone())], - ..ResolveOptions::default() - }); - - let resolution = resolver.resolve(&f, "pck2"); - assert_eq!(resolution, Err(ResolveError::Restriction(fixture.join("c.js"), f))); -} diff --git a/src/tests/roots.rs b/src/tests/roots.rs deleted file mode 100644 index b50e2a07..00000000 --- a/src/tests/roots.rs +++ /dev/null @@ -1,92 +0,0 @@ -//! - -use std::path::PathBuf; - -use crate::{AliasValue, ResolveError, ResolveOptions, Resolver}; - -fn dirname() -> PathBuf { - super::fixture_root().join("enhanced_resolve").join("test") -} - -#[test] -fn roots() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - alias: vec![("foo".into(), vec![AliasValue::from("/fixtures")])], - roots: vec![dirname(), f.clone()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should respect roots option", "/fixtures/b.js", f.join("b.js")), - ("should try another root option, if it exists", "/b.js", f.join("b.js")), - ("should respect extension", "/fixtures/b", f.join("b.js")), - ("should resolve in directory", "/fixtures/extensions/dir", f.join("extensions/dir/index.js")), - ("should respect aliases", "foo/b", f.join("b.js")), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } - - #[rustfmt::skip] - let fail = [ - ("should not work with relative path", "fixtures/b.js", ResolveError::NotFound("fixtures/b.js".into())) - ]; - - for (comment, request, expected) in fail { - let resolution = resolver.resolve(&f, request); - assert_eq!(resolution, Err(expected), "{comment} {request}"); - } -} - -#[test] -fn resolve_to_context() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - roots: vec![dirname(), f.clone()], - resolve_to_context: true, - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f, "/fixtures/lib").map(|r| r.full_path()); - let expected = f.join("lib"); - assert_eq!(resolved_path, Ok(expected)); -} - -#[test] -fn prefer_absolute() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - alias: vec![("foo".into(), vec![AliasValue::from("/fixtures")])], - roots: vec![dirname(), f.clone()], - prefer_absolute: true, - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve an absolute path (prefer absolute)", f.join("b.js").to_string_lossy().to_string(), f.join("b.js")), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(&f, &request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } -} - -#[test] -fn roots_fall_through() { - let f = super::fixture(); - let absolute_path = f.join("roots_fall_through/index.js"); - let specifier = absolute_path.to_string_lossy(); - let resolution = Resolver::new(ResolveOptions::default().with_root(&f)).resolve(&f, &specifier); - assert_eq!( - resolution.map(super::super::resolution::Resolution::into_path_buf), - Ok(absolute_path) - ); -} diff --git a/src/tests/scoped_packages.rs b/src/tests/scoped_packages.rs deleted file mode 100644 index 8258f00f..00000000 --- a/src/tests/scoped_packages.rs +++ /dev/null @@ -1,25 +0,0 @@ -//! - -use crate::{ResolveOptions, Resolver}; - -#[test] -fn scoped_packages() { - let f = super::fixture().join("scoped"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("main field should work", f.clone(), "@scope/pack1", f.join("./node_modules/@scope/pack1/main.js")), - ("browser field should work", f.clone(), "@scope/pack2", f.join("./node_modules/@scope/pack2/main.js")), - ("folder request should work", f.clone(), "@scope/pack2/lib", f.join("./node_modules/@scope/pack2/lib/index.js")) - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} diff --git a/src/tests/simple.rs b/src/tests/simple.rs deleted file mode 100644 index 08e1238a..00000000 --- a/src/tests/simple.rs +++ /dev/null @@ -1,68 +0,0 @@ -//! - -use std::env; - -use crate::Resolver; - -#[test] -fn simple() { - // mimic `enhanced-resolve/test/simple.test.js` - let dirname = env::current_dir().unwrap().join("fixtures"); - let f = dirname.join("enhanced_resolve/test"); - - let resolver = Resolver::default(); - - let data = [ - ("direct", f.clone(), "../lib/index"), - ("as directory", f, ".."), - ("as module", dirname.clone(), "./enhanced_resolve"), - ]; - - for (comment, path, request) in data { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - let expected = dirname.join("enhanced_resolve/lib/index.js"); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn dashed_name() { - let f = super::fixture(); - - let resolver = Resolver::default(); - - let data = [ - (f.clone(), "dash", f.join("node_modules/dash/index.js")), - (f.clone(), "dash-name", f.join("node_modules/dash-name/index.js")), - (f.join("node_modules/dash"), "dash", f.join("node_modules/dash/index.js")), - (f.join("node_modules/dash"), "dash-name", f.join("node_modules/dash-name/index.js")), - (f.join("node_modules/dash-name"), "dash", f.join("node_modules/dash/index.js")), - (f.join("node_modules/dash-name"), "dash-name", f.join("node_modules/dash-name/index.js")), - ]; - - for (path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{path:?} {request}"); - } -} - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows { - use super::super::memory_fs::MemoryFS; - - use crate::ResolveOptions; - - #[test] - fn no_package() { - use crate::ResolverGeneric; - use std::path::Path; - let f = Path::new("/"); - let file_system = MemoryFS::new(&[]); - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions::default(), - ); - let resolved_path = resolver.resolve(f, "package"); - assert!(resolved_path.is_err()); - } -} diff --git a/src/tests/symlink.rs b/src/tests/symlink.rs deleted file mode 100644 index 7589b560..00000000 --- a/src/tests/symlink.rs +++ /dev/null @@ -1,121 +0,0 @@ -use std::{fs, io, path::Path}; - -use crate::{ResolveOptions, Resolver}; - -#[derive(Debug, Clone, Copy)] -enum FileType { - File, - Dir, -} - -#[allow(unused_variables)] -fn symlink, Q: AsRef>( - original: P, - link: Q, - file_type: FileType, -) -> io::Result<()> { - #[cfg(target_family = "unix")] - { - std::os::unix::fs::symlink(original, link) - } - - #[cfg(target_family = "windows")] - match file_type { - FileType::File => std::os::windows::fs::symlink_file(original, link), - FileType::Dir => std::os::windows::fs::symlink_dir(original, link), - } -} - -fn init(dirname: &Path, temp_path: &Path) -> io::Result<()> { - if temp_path.exists() { - _ = fs::remove_dir_all(temp_path); - } - fs::create_dir(temp_path)?; - symlink(dirname.join("../lib/index.js"), temp_path.join("test"), FileType::File)?; - symlink(dirname.join("../lib"), temp_path.join("test2"), FileType::Dir)?; - fs::remove_file(temp_path.join("test"))?; - fs::remove_file(temp_path.join("test2"))?; - fs::remove_dir(temp_path) -} - -fn create_symlinks(dirname: &Path, temp_path: &Path) -> io::Result<()> { - fs::create_dir(temp_path).unwrap(); - symlink( - dirname.join("../lib/index.js").canonicalize().unwrap(), - temp_path.join("index.js"), - FileType::File, - )?; - symlink(dirname.join("../lib").canonicalize().unwrap(), temp_path.join("lib"), FileType::Dir)?; - symlink(dirname.join("..").canonicalize().unwrap(), temp_path.join("this"), FileType::Dir)?; - symlink(temp_path.join("this"), temp_path.join("that"), FileType::Dir)?; - symlink(Path::new("../../lib/index.js"), temp_path.join("node.relative.js"), FileType::File)?; - symlink( - Path::new("./node.relative.js"), - temp_path.join("node.relative.sym.js"), - FileType::File, - )?; - Ok(()) -} - -fn cleanup_symlinks(temp_path: &Path) { - _ = fs::remove_dir_all(temp_path); -} - -#[test] -fn test() -> io::Result<()> { - let root = super::fixture_root().join("enhanced_resolve"); - let dirname = root.join("test"); - let temp_path = dirname.join("temp"); - if !temp_path.exists() { - let is_admin = init(&dirname, &temp_path).is_ok(); - if !is_admin { - return Ok(()); - } - if let Err(err) = create_symlinks(&dirname, &temp_path) { - cleanup_symlinks(&temp_path); - return Err(err); - } - } - - let resolver_without_symlinks = - Resolver::new(ResolveOptions { symlinks: false, ..ResolveOptions::default() }); - let resolver_with_symlinks = Resolver::default(); - - #[rustfmt::skip] - let pass = [ - ("with a symlink to a file", temp_path.clone(), "./index.js"), - ("with a relative symlink to a file", temp_path.clone(), "./node.relative.js"), - ("with a relative symlink to a symlink to a file", temp_path.clone(), "./node.relative.sym.js"), - ("with a symlink to a directory 1", temp_path.clone(), "./lib/index.js"), - ("with a symlink to a directory 2", temp_path.clone(), "./this/lib/index.js"), - ("with multiple symlinks in the path 1", temp_path.clone(), "./this/test/temp/index.js"), - ("with multiple symlinks in the path 2", temp_path.clone(), "./this/test/temp/lib/index.js"), - ("with multiple symlinks in the path 3", temp_path.clone(), "./this/test/temp/this/lib/index.js"), - ("with a symlink to a directory 2 (chained)", temp_path.clone(), "./that/lib/index.js"), - ("with multiple symlinks in the path 1 (chained)", temp_path.clone(), "./that/test/temp/index.js"), - ("with multiple symlinks in the path 2 (chained)", temp_path.clone(), "./that/test/temp/lib/index.js"), - ("with multiple symlinks in the path 3 (chained)", temp_path.clone(), "./that/test/temp/that/lib/index.js"), - ("with symlinked directory as context 1", temp_path.join( "lib"), "./index.js"), - ("with symlinked directory as context 2", temp_path.join( "this"), "./lib/index.js"), - ("with symlinked directory as context and in path", temp_path.join( "this"), "./test/temp/lib/index.js"), - ("with symlinked directory in context path", temp_path.join( "this/lib"), "./index.js"), - ("with symlinked directory in context path and symlinked file", temp_path.join( "this/test"), "./temp/index.js"), - ("with symlinked directory in context path and symlinked directory", temp_path.join( "this/test"), "./temp/lib/index.js"), - ("with symlinked directory as context 2 (chained)", temp_path.join( "that"), "./lib/index.js"), - ("with symlinked directory as context and in path (chained)", temp_path.join( "that"), "./test/temp/lib/index.js"), - ("with symlinked directory in context path (chained)", temp_path.join( "that/lib"), "./index.js"), - ("with symlinked directory in context path and symlinked file (chained)", temp_path.join( "that/test"), "./temp/index.js"), - ("with symlinked directory in context path and symlinked directory (chained)", temp_path.join( "that/test"), "./temp/lib/index.js") - ]; - - for (comment, path, request) in pass { - let filename = resolver_with_symlinks.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(filename, Ok(root.join("lib/index.js")), "{comment:?}"); - - let resolved_path = - resolver_without_symlinks.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(path.join(request))); - } - - Ok(()) -} diff --git a/src/tests/tsconfig_paths.rs b/src/tests/tsconfig_paths.rs deleted file mode 100644 index b85bf6be..00000000 --- a/src/tests/tsconfig_paths.rs +++ /dev/null @@ -1,530 +0,0 @@ -//! tests for tsconfig-paths -//! -//! Fixtures copied from . - -use std::path::{Path, PathBuf}; - -use crate::{ - JSONError, ResolveError, ResolveOptions, Resolver, TsConfig, TsconfigOptions, - TsconfigReferences, -}; - -// -#[test] -fn tsconfig() { - let f = super::fixture_root().join("tsconfig"); - - #[rustfmt::skip] - let pass = [ - (f.clone(), None, "ts-path", f.join("foo.js")), - (f.join("nested"), None, "ts-path", f.join("nested/test.js")), - (f.join("cases/index"), None, "foo", f.join("node_modules/tsconfig-index/foo.js")), - // This requires reading package.json.tsconfig field - // (f.join("cases/field"), "foo", f.join("node_modules/tsconfig-field/foo.js")) - (f.join("cases/exports"), None, "foo", f.join("node_modules/tsconfig-exports/foo.js")), - (f.join("cases/extends-extension"), None, "foo", f.join("cases/extends-extension/foo.js")), - (f.join("cases/extends-extensionless"), None, "foo", f.join("node_modules/tsconfig-field/foo.js")), - (f.join("cases/extends-paths"), Some("src"), "@/index", f.join("cases/extends-paths/src/index.js")), - (f.join("cases/extends-multiple"), None, "foo", f.join("cases/extends-multiple/foo.js")), - ]; - - for (dir, subdir, request, expected) in pass { - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: dir.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - let path = subdir.map_or(dir.clone(), |subdir| dir.join(subdir)); - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{request} {path:?}"); - } - - #[rustfmt::skip] - let data = [ - (f.join("node_modules/tsconfig-not-used"), "ts-path", Ok(f.join("foo.js"))), - ]; - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - for (path, request, expected) in data { - let resolution = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolution, expected, "{path:?} {request}"); - } -} - -#[test] -fn tsconfig_fallthrough() { - let f = super::fixture_root().join("tsconfig"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "/"); - assert_eq!(resolved_path, Err(ResolveError::NotFound("/".into()))); -} - -#[test] -fn json_with_comments() { - let f = super::fixture_root().join("tsconfig/cases/trailing-comma"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "foo").map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(f.join("bar.js"))); -} - -#[test] -fn broken() { - let f = super::fixture_root().join("tsconfig"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("tsconfig_broken.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "/"); - let error = ResolveError::JSON(JSONError { - path: f.join("tsconfig_broken.json"), - message: String::from("EOF while parsing an object at line 2 column 0"), - line: 2, - column: 0, - }); - assert_eq!(resolved_path, Err(error)); -} - -// -#[test] -fn test_paths() { - let path = Path::new("/foo/tsconfig.json"); - let mut tsconfig_json = serde_json::json!({ - "compilerOptions": { - "paths": { - "jquery": ["node_modules/jquery/dist/jquery"], - "*": ["generated/*"], - "bar/*": ["test/*"], - "bar/baz/*": ["baz/*", "yo/*"], - "@/components/*": ["components/*"], - "url": ["node_modules/my-url"], - } - } - }) - .to_string(); - let tsconfig = TsConfig::parse(true, path, &mut tsconfig_json).unwrap(); - - let data = [ - ("jquery", vec!["/foo/node_modules/jquery/dist/jquery"]), - ("test", vec!["/foo/generated/test"]), - ("test/hello", vec!["/foo/generated/test/hello"]), - ("bar/hi", vec!["/foo/test/hi"]), - ("bar/baz/hi", vec!["/foo/baz/hi", "/foo/yo/hi"]), - ("@/components/button", vec!["/foo/components/button"]), - ("./jquery", vec![]), - ("url", vec!["/foo/node_modules/my-url"]), - ]; - - for (specifier, expected) in data { - let paths = tsconfig.resolve_path_alias(specifier); - let expected = expected.into_iter().map(PathBuf::from).collect::>(); - assert_eq!(paths, expected, "{specifier}"); - } -} - -// -#[test] -fn test_base_url() { - let path = Path::new("/foo/tsconfig.json"); - let mut tsconfig_json = serde_json::json!({ - "compilerOptions": { - "baseUrl": "./src" - } - }) - .to_string(); - let tsconfig = TsConfig::parse(true, path, &mut tsconfig_json).unwrap(); - - let data = [ - ("foo", vec!["/foo/src/foo"]), - ("components/button", vec!["/foo/src/components/button"]), - ("./jquery", vec![]), - ]; - - for (specifier, expected) in data { - let paths = tsconfig.resolve_path_alias(specifier); - let expected = expected.into_iter().map(PathBuf::from).collect::>(); - assert_eq!(paths, expected, "{specifier}"); - } -} - -// -#[test] -fn test_paths_and_base_url() { - let path = Path::new("/foo/tsconfig.json"); - let mut tsconfig_json = serde_json::json!({ - "compilerOptions": { - "baseUrl": "./src", - "paths": { - "*": ["generated/*"], - "bar/*": ["test/*"], - "bar/baz/*": ["baz/*", "yo/*"], - "@/components/*": ["components/*"] - } - } - }) - .to_string(); - let tsconfig = TsConfig::parse(true, path, &mut tsconfig_json).unwrap(); - - let data = [ - ("test", vec!["/foo/src/generated/test", "/foo/src/test"]), - ("test/hello", vec!["/foo/src/generated/test/hello", "/foo/src/test/hello"]), - ("bar/hi", vec!["/foo/src/test/hi", "/foo/src/bar/hi"]), - ("bar/baz/hi", vec!["/foo/src/baz/hi", "/foo/src/yo/hi", "/foo/src/bar/baz/hi"]), - ("@/components/button", vec!["/foo/src/components/button", "/foo/src/@/components/button"]), - ("./jquery", vec![]), - ]; - - for (specifier, expected) in data { - let paths = tsconfig.resolve_path_alias(specifier); - let expected = expected.into_iter().map(PathBuf::from).collect::>(); - assert_eq!(paths, expected, "{specifier}"); - } -} - -// Template variable ${configDir} for substitution of config files directory path -// https://github.com/microsoft/TypeScript/pull/58042 -#[test] -fn test_template_variable() { - let f = super::fixture_root().join("tsconfig"); - let f2 = f.join("cases").join("paths_template_variable"); - - #[rustfmt::skip] - let pass = [ - (f2.clone(), "tsconfig1.json", "foo", f2.join("foo.js")), - (f2.clone(), "tsconfig2.json", "foo", f2.join("foo.js")), - (f.clone(), "tsconfig_template_variable.json", "foo", f.join("foo.js")), - ]; - - for (dir, tsconfig, request, expected) in pass { - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: dir.join(tsconfig), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&dir, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{request} {tsconfig} {dir:?}"); - } -} - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows_test { - use std::path::{Path, PathBuf}; - - use crate::{ - ResolveError, ResolveOptions, ResolverGeneric, TsconfigOptions, TsconfigReferences, - }; - - use super::super::memory_fs::MemoryFS; - - struct OneTest { - name: &'static str, - tsconfig: String, - package_json: Option<(PathBuf, String)>, - main_fields: Option>, - existing_files: Vec<&'static str>, - requested_module: &'static str, - expected_path: &'static str, - extensions: Vec, - } - - impl Default for OneTest { - fn default() -> Self { - Self { - name: "", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/*": ["location/*"] - } - } - }) - .to_string(), - package_json: None, - main_fields: None, - existing_files: vec![], - requested_module: "", - expected_path: "", - extensions: vec![ - ".js".into(), - ".json".into(), - ".node".into(), - ".ts".into(), - ".tsx".into(), - ], - } - } - } - - impl OneTest { - fn resolver(&self, root: &Path) -> ResolverGeneric { - let mut file_system = MemoryFS::default(); - - file_system.add_file(&root.join("tsconfig.json"), &self.tsconfig); - if let Some((path, package_json)) = &self.package_json { - file_system.add_file(&root.join(path).join("package.json"), package_json); - } - for path in &self.existing_files { - file_system.add_file(Path::new(path), ""); - } - - let mut options = ResolveOptions { - extensions: self.extensions.clone(), - tsconfig: Some(TsconfigOptions { - config_file: root.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }; - if let Some(main_fields) = &self.main_fields { - options.main_fields.clone_from(main_fields); - } - - ResolverGeneric::::new_with_file_system(file_system, options) - } - } - - // Path matching tests from tsconfig-paths - // * - // * - #[test] - fn match_path() { - let pass = [ - OneTest { - name: "should locate path that matches with star and exists", - existing_files: vec!["/root/location/mylib/index.ts"], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve to correct path when many are specified", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/*": ["foo1/*", "foo2/*", "location/*", "foo3/*"], - } - } - }) - .to_string(), - existing_files: vec!["/root/location/mylib/index.ts"], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should locate path that matches with star and prioritize pattern with longest prefix", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "*": ["location/*"], - "lib/*": ["location/*"], - } - } - }) - .to_string(), - existing_files: vec![ - "/root/location/lib/mylib/index.ts", - "/root/location/mylib/index.ts", - ], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should locate path that matches with star and exists with extension", - existing_files: vec![ - "/root/location/mylib.myext", - ], - requested_module: "lib/mylib", - extensions: vec![".js".into(), ".myext".into()], - expected_path: "/root/location/mylib.myext", - ..OneTest::default() - }, - OneTest { - name: "should resolve request with extension specified", - existing_files: vec![ - "/root/location/test.jpg", - ], - requested_module: "lib/test.jpg", - expected_path: "/root/location/test.jpg", - ..OneTest::default() - }, - OneTest { - name: "should locate path that matches without star and exists", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/foo": ["location/foo"] - } - } - }) - .to_string(), - existing_files: vec![ - "/root/location/foo.ts", - ], - requested_module: "lib/foo", - expected_path: "/root/location/foo.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve to parent folder when filename is in subfolder", - existing_files: vec![ - "/root/location/mylib/index.ts", - ], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve from main field in package.json", - package_json: Some((PathBuf::from("/root/location/mylib"), serde_json::json!({ - "main": "./kalle.ts" - }).to_string())), - existing_files: vec![ - "/root/location/mylib/kalle.ts", - ], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/kalle.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve from main field in package.json (js)", - package_json: Some((PathBuf::from("/root/location/mylib.js"), serde_json::json!({ - "main": "./kalle.js" - }).to_string())), - existing_files: vec![ - "/root/location/mylib.js/kalle.js", - ], - extensions: vec![".ts".into(), ".js".into()], - requested_module: "lib/mylib.js", - expected_path: "/root/location/mylib.js/kalle.js", - ..OneTest::default() - }, - OneTest { - name: "should resolve from list of fields by priority in package.json", - main_fields: Some(vec!["missing".into(), "browser".into(), "main".into()]), - package_json: Some((PathBuf::from("/root/location/mylibjs"), serde_json::json!({ - "main": "./main.js", - "browser": "./browser.js" - }).to_string())), - existing_files: vec![ - "/root/location/mylibjs/main.js", - "/root/location/mylibjs/browser.js", - ], - extensions: vec![".ts".into(), ".js".into()], - requested_module: "lib/mylibjs", - expected_path: "/root/location/mylibjs/browser.js", - ..OneTest::default() - }, -OneTest { - name: "should ignore field mappings to missing files in package.json", - main_fields: Some(vec!["browser".into(), "main".into()]), - package_json: Some((PathBuf::from("/root/location/mylibjs"), serde_json::json!({ - "main": "./kalle.js", - "browser": "./nope.js" - }).to_string())), - existing_files: vec![ - "/root/location/mylibjs/kalle.js", - ], - extensions: vec![".ts".into(), ".js".into()], - requested_module: "lib/mylibjs", - expected_path: "/root/location/mylibjs/kalle.js", - ..OneTest::default() - }, - // Tests that are not applicable: - // name: "should resolve nested main fields" - // name: "should ignore advanced field mappings in package.json" - // name: "should resolve to with the help of baseUrl when not explicitly set" - // name: "should not resolve with the help of baseUrl when asked not to" - // name: "should resolve main file with cjs file extension" - OneTest { - name: "should resolve .ts from .js alias", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "@/*": ["src/*"] - } - } - }).to_string(), - existing_files: vec![ - "/root/src/foo.ts", - ], - requested_module: "@/foo", // original data was "@/foo.ts" but I don't get why it is the case? - expected_path: "/root/src/foo.ts", // original data was "/root/src/foo" - ..OneTest::default() - }, - ]; - - let root = PathBuf::from("/root"); - - for test in pass { - let resolved_path = - test.resolver(&root).resolve(&root, test.requested_module).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(PathBuf::from(test.expected_path)), "{}", test.name); - } - - let fail = [ - OneTest { - name: "should not locate path that does not match", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/*": ["location/*"] - } - } - }) - .to_string(), - existing_files: vec!["/root/location/mylib"], - requested_module: "lib/mylibjs", - ..OneTest::default() - }, - OneTest { - name: "should not resolve typings file (index.d.ts)", - existing_files: vec!["/root/location/mylib/index.d.ts"], - requested_module: "lib/mylib", - ..OneTest::default() - }, - ]; - - for test in fail { - let resolved_path = - test.resolver(&root).resolve(&root, test.requested_module).map(|f| f.full_path()); - assert_eq!( - resolved_path, - Err(ResolveError::NotFound(test.requested_module.into())), - "{}", - test.name - ); - } - } -} diff --git a/src/tests/tsconfig_project_references.rs b/src/tests/tsconfig_project_references.rs deleted file mode 100644 index 0d019d27..00000000 --- a/src/tests/tsconfig_project_references.rs +++ /dev/null @@ -1,132 +0,0 @@ -//! Tests for tsconfig project references - -use crate::{ResolveError, ResolveOptions, Resolver, TsconfigOptions, TsconfigReferences}; - -#[test] -fn auto() { - let f = super::fixture_root().join("tsconfig/cases/project_references"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("app"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - // Test normal paths alias - (f.join("app"), "@/index.ts", f.join("app/aliased/index.ts")), - (f.join("app"), "@/../index.ts", f.join("app/index.ts")), - // Test project reference - (f.join("project_a"), "@/index.ts", f.join("project_a/aliased/index.ts")), - (f.join("project_b/src"), "@/index.ts", f.join("project_b/src/aliased/index.ts")), - // Does not have paths alias - (f.join("project_a"), "./index.ts", f.join("project_a/index.ts")), - (f.join("project_c"), "./index.ts", f.join("project_c/index.ts")), - // Template variable - { - let dir = f.parent().unwrap().join("paths_template_variable"); - (dir.clone(), "foo", dir.join("foo.js")) - } - ]; - - for (path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{request} {path:?}"); - } -} - -#[test] -fn disabled() { - let f = super::fixture_root().join("tsconfig/cases/project_references"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("app"), - references: TsconfigReferences::Disabled, - }), - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - // Test normal paths alias - (f.join("app"), "@/index.ts", Ok(f.join("app/aliased/index.ts"))), - (f.join("app"), "@/../index.ts", Ok(f.join("app/index.ts"))), - // Test project reference - (f.join("project_a"), "@/index.ts", Err(ResolveError::NotFound("@/index.ts".into()))), - (f.join("project_b/src"), "@/index.ts", Err(ResolveError::NotFound("@/index.ts".into()))), - // Does not have paths alias - (f.join("project_a"), "./index.ts", Ok(f.join("project_a/index.ts"))), - (f.join("project_c"), "./index.ts", Ok(f.join("project_c/index.ts"))), - ]; - - for (path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, expected, "{request} {path:?}"); - } -} - -#[test] -fn manual() { - let f = super::fixture_root().join("tsconfig/cases/project_references"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("app"), - references: TsconfigReferences::Paths(vec!["../project_a/conf.json".into()]), - }), - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - // Test normal paths alias - (f.join("app"), "@/index.ts", Ok(f.join("app/aliased/index.ts"))), - (f.join("app"), "@/../index.ts", Ok(f.join("app/index.ts"))), - // Test project reference - (f.join("project_a"), "@/index.ts", Ok(f.join("project_a/aliased/index.ts"))), - (f.join("project_b/src"), "@/index.ts", Err(ResolveError::NotFound("@/index.ts".into()))), - // Does not have paths alias - (f.join("project_a"), "./index.ts", Ok(f.join("project_a/index.ts"))), - (f.join("project_c"), "./index.ts", Ok(f.join("project_c/index.ts"))), - ]; - - for (path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, expected, "{request} {path:?}"); - } -} - -#[test] -fn self_reference() { - let f = super::fixture_root().join("tsconfig/cases/project_references"); - - #[rustfmt::skip] - let pass = [ - (f.join("app"), vec!["./tsconfig.json".into()]), - (f.join("app/tsconfig.json"), vec!["./tsconfig.json".into()]), - (f.join("app"), vec![f.join("app")]), - (f.join("app/tsconfig.json"), vec![f.join("app")]), - (f.join("app/tsconfig.json"), vec![f.join("project_b"), f.join("app")]), - ]; - - for (config_file, reference_paths) in pass { - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: config_file.clone(), - references: TsconfigReferences::Paths(reference_paths.clone()), - }), - ..ResolveOptions::default() - }); - let path = f.join("app"); - let resolved_path = resolver.resolve(&path, "@/index.ts").map(|f| f.full_path()); - assert_eq!( - resolved_path, - Err(ResolveError::TsconfigSelfReference(f.join("app/tsconfig.json"))), - "{config_file:?} {reference_paths:?}" - ); - } -} diff --git a/src/tsconfig.rs b/src/tsconfig.rs deleted file mode 100644 index 6a675442..00000000 --- a/src/tsconfig.rs +++ /dev/null @@ -1,223 +0,0 @@ -use std::{ - hash::BuildHasherDefault, - path::{Path, PathBuf}, - sync::Arc, -}; - -use indexmap::IndexMap; -use rustc_hash::FxHasher; -use serde::Deserialize; - -use crate::PathUtil; - -pub type CompilerOptionsPathsMap = IndexMap, BuildHasherDefault>; - -#[derive(Debug, Clone, Eq, PartialEq, Deserialize)] -#[serde(untagged)] -pub enum ExtendsField { - Single(String), - Multiple(Vec), -} - -#[derive(Debug, Deserialize)] -#[serde(rename_all = "camelCase")] -pub struct TsConfig { - /// Whether this is the caller tsconfig. - /// Used for final template variable substitution when all configs are extended and merged. - #[serde(skip)] - root: bool, - - /// Path to `tsconfig.json`. Contains the `tsconfig.json` filename. - #[serde(skip)] - pub(crate) path: PathBuf, - - #[serde(default)] - pub extends: Option, - - #[serde(default)] - pub compiler_options: CompilerOptions, - - /// Bubbled up project references with a reference to their tsconfig. - #[serde(default)] - pub references: Vec, -} - -/// Compiler Options -/// -/// -#[derive(Debug, Default, Deserialize)] -#[serde(rename_all = "camelCase")] -pub struct CompilerOptions { - base_url: Option, - - /// Path aliases - paths: Option, - - /// The actual base for where path aliases are resolved from. - #[serde(skip)] - paths_base: PathBuf, -} - -/// Project Reference -/// -/// -#[derive(Debug, Deserialize)] -pub struct ProjectReference { - /// The path property of each reference can point to a directory containing a tsconfig.json file, - /// or to the config file itself (which may have any name). - pub path: PathBuf, - - /// Reference to the resolved tsconfig - #[serde(skip)] - pub tsconfig: Option>, -} - -impl TsConfig { - pub fn parse(root: bool, path: &Path, json: &mut str) -> Result { - _ = json_strip_comments::strip(json); - let mut tsconfig: Self = serde_json::from_str(json)?; - tsconfig.root = root; - tsconfig.path = path.to_path_buf(); - let directory = tsconfig.directory().to_path_buf(); - if let Some(base_url) = tsconfig.compiler_options.base_url { - tsconfig.compiler_options.base_url = Some(directory.normalize_with(base_url)); - } - if tsconfig.compiler_options.paths.is_some() { - tsconfig.compiler_options.paths_base = - tsconfig.compiler_options.base_url.as_ref().map_or(directory, Clone::clone); - } - Ok(tsconfig) - } - - pub fn build(mut self) -> Self { - if self.root { - let dir = self.directory().to_path_buf(); - // Substitute template variable in `tsconfig.compilerOptions.paths` - if let Some(paths) = &mut self.compiler_options.paths { - for paths in paths.values_mut() { - for path in paths { - Self::substitute_template_variable(&dir, path); - } - } - } - } - self - } - - /// Directory to `tsconfig.json` - /// - /// # Panics - /// - /// * When the `tsconfig.json` path is misconfigured. - pub fn directory(&self) -> &Path { - debug_assert!(self.path.file_name().is_some()); - self.path.parent().unwrap() - } - - pub fn extend_tsconfig(&mut self, tsconfig: &Self) { - let compiler_options = &mut self.compiler_options; - if compiler_options.paths.is_none() { - compiler_options.paths_base = compiler_options - .base_url - .as_ref() - .map_or_else(|| tsconfig.compiler_options.paths_base.clone(), Clone::clone); - compiler_options.paths.clone_from(&tsconfig.compiler_options.paths); - } - if compiler_options.base_url.is_none() { - compiler_options.base_url.clone_from(&tsconfig.compiler_options.base_url); - } - } - - pub fn resolve(&self, path: &Path, specifier: &str) -> Vec { - if path.starts_with(self.base_path()) { - let paths = self.resolve_path_alias(specifier); - if !paths.is_empty() { - return paths; - } - } - for tsconfig in self.references.iter().filter_map(|reference| reference.tsconfig.as_ref()) { - if path.starts_with(tsconfig.base_path()) { - return tsconfig.resolve_path_alias(specifier); - } - } - vec![] - } - - // Copied from parcel - // - pub fn resolve_path_alias(&self, specifier: &str) -> Vec { - if specifier.starts_with(['/', '.']) { - return vec![]; - } - - let base_url_iter = self - .compiler_options - .base_url - .as_ref() - .map_or_else(Vec::new, |base_url| vec![base_url.normalize_with(specifier)]); - - let Some(paths_map) = &self.compiler_options.paths else { - return base_url_iter; - }; - - let paths = paths_map.get(specifier).map_or_else( - || { - let mut longest_prefix_length = 0; - let mut longest_suffix_length = 0; - let mut best_key: Option<&String> = None; - - for key in paths_map.keys() { - if let Some((prefix, suffix)) = key.split_once('*') { - if (best_key.is_none() || prefix.len() > longest_prefix_length) - && specifier.starts_with(prefix) - && specifier.ends_with(suffix) - { - longest_prefix_length = prefix.len(); - longest_suffix_length = suffix.len(); - best_key.replace(key); - } - } - } - - best_key.and_then(|key| paths_map.get(key)).map_or_else(Vec::new, |paths| { - paths - .iter() - .map(|path| { - path.replace( - '*', - &specifier[longest_prefix_length - ..specifier.len() - longest_suffix_length], - ) - }) - .collect::>() - }) - }, - Clone::clone, - ); - - paths - .into_iter() - .map(|p| self.compiler_options.paths_base.normalize_with(p)) - .chain(base_url_iter) - .collect() - } - - fn base_path(&self) -> &Path { - self.compiler_options - .base_url - .as_ref() - .map_or_else(|| self.directory(), |path| path.as_ref()) - } - - /// Template variable `${configDir}` for substitution of config files directory path - /// - /// NOTE: All tests cases are just a head replacement of `${configDir}`, so we are constrained as such. - /// - /// See - fn substitute_template_variable(directory: &Path, path: &mut String) { - const TEMPLATE_VARIABLE: &str = "${configDir}/"; - if let Some(stripped_path) = path.strip_prefix(TEMPLATE_VARIABLE) { - *path = directory.join(stripped_path).to_string_lossy().to_string(); - } - } -} diff --git a/tests/integration_test.rs b/tests/integration_test.rs deleted file mode 100644 index 0fc52887..00000000 --- a/tests/integration_test.rs +++ /dev/null @@ -1,103 +0,0 @@ -//! Test public APIs - -use std::{env, path::PathBuf}; - -use oxc_resolver::{EnforceExtension, Resolution, ResolveContext, ResolveOptions, Resolver}; - -fn dir() -> PathBuf { - env::current_dir().unwrap() -} - -fn resolve(specifier: &str) -> Resolution { - let path = dir(); - Resolver::new(ResolveOptions::default()).resolve(path, specifier).unwrap() -} - -#[test] -fn clone() { - let resolution = resolve("./tests/package.json"); - assert_eq!(resolution.clone(), resolution); -} - -#[test] -fn debug() { - let resolution = resolve("./tests/package.json"); - let s = format!("{resolution:?}"); - assert!(!s.is_empty()); -} - -#[test] -fn eq() { - let resolution = resolve("./tests/package.json"); - assert_eq!(resolution, resolution); -} - -#[test] -fn package_json() { - let resolution = resolve("./tests/package.json"); - let package_json = resolution.package_json().unwrap(); - assert_eq!(package_json.name.as_ref().unwrap(), "name"); - assert_eq!(package_json.r#type.as_ref().unwrap().as_str(), "module".into()); - assert!(package_json.side_effects.as_ref().unwrap().is_object()); -} - -#[cfg(feature = "package_json_raw_json_api")] -#[test] -fn package_json_raw_json_api() { - let resolution = resolve("./tests/package.json"); - assert!(resolution - .package_json() - .unwrap() - .raw_json() - .get("name") - .is_some_and(|name| name == "name")); -} - -#[test] -fn clear_cache() { - let resolver = Resolver::new(ResolveOptions::default()); - resolver.clear_cache(); // exists -} - -#[test] -fn options() { - let resolver = Resolver::new(ResolveOptions::default()); - let options = resolver.options(); - assert!(!format!("{options:?}").is_empty()); -} - -#[test] -fn debug_resolver() { - let resolver = Resolver::new(ResolveOptions::default()); - assert!(!format!("{resolver:?}").is_empty()); -} - -#[test] -fn dependencies() { - let path = dir(); - let mut ctx = ResolveContext::default(); - let _ = Resolver::new(ResolveOptions::default()).resolve_with_context( - path, - "./tests/package.json", - &mut ctx, - ); - assert!(!ctx.file_dependencies.is_empty()); - assert!(ctx.missing_dependencies.is_empty()); -} - -#[test] -fn options_api() { - _ = ResolveOptions::default() - .with_builtin_modules(true) - .with_condition_names(&[]) - .with_extension(".js") - .with_force_extension(EnforceExtension::Auto) - .with_fully_specified(true) - .with_main_field("asdf") - .with_main_file("main") - .with_module("module") - .with_prefer_absolute(true) - .with_prefer_relative(true) - .with_root(PathBuf::new()) - .with_symbolic_link(true); -} diff --git a/tests/package.json b/tests/package.json deleted file mode 100644 index 54f58b8c..00000000 --- a/tests/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "name", - "type": "module", - "sideEffects": {} -} diff --git a/tests/resolve_test.rs b/tests/resolve_test.rs deleted file mode 100644 index 45934cf8..00000000 --- a/tests/resolve_test.rs +++ /dev/null @@ -1,132 +0,0 @@ -use std::{env, path::PathBuf}; - -use oxc_resolver::{ResolveError, ResolveOptions, Resolver}; - -fn dir() -> PathBuf { - env::current_dir().unwrap() -} - -#[test] -fn chinese() { - let dir = dir(); - let specifier = "./fixtures/misc/中文/中文.js"; - let resolution = Resolver::new(ResolveOptions::default()).resolve(&dir, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(dir.join("fixtures/misc/中文/中文.js")) - ); -} - -#[test] -fn styled_components() { - let dir = dir(); - let path = dir.join("fixtures/pnpm"); - let module_path = dir.join("node_modules/.pnpm/styled-components@6.1.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/styled-components"); - let specifier = "styled-components"; - - // cjs - let options = - ResolveOptions { alias_fields: vec![vec!["browser".into()]], ..ResolveOptions::default() }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/styled-components.browser.cjs.js")) - ); - - // esm - let options = ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - main_fields: vec!["module".into()], - ..ResolveOptions::default() - }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/styled-components.browser.esm.js")) - ); -} - -#[test] -fn axios() { - let dir = dir(); - let path = dir.join("fixtures/pnpm"); - let module_path = dir.join("node_modules/.pnpm/axios@1.6.2/node_modules/axios"); - let specifier = "axios"; - - // default - let options = ResolveOptions::default(); - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("index.js")) - ); - - // browser - let options = ResolveOptions { - condition_names: vec!["browser".into(), "require".into()], - ..ResolveOptions::default() - }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/browser/axios.cjs")) - ); - - // cjs - let options = ResolveOptions { - condition_names: vec!["node".into(), "require".into()], - ..ResolveOptions::default() - }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/node/axios.cjs")) - ); -} - -#[test] -fn postcss() { - let dir = dir(); - let path = dir.join("fixtures/pnpm"); - let module_path = path.join("node_modules/postcss"); - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - // should ignore "path" - let resolution = resolver.resolve(&module_path, "path"); - assert_eq!(resolution, Err(ResolveError::Ignored(module_path.clone()))); - - // should ignore "./lib/terminal-highlight" - let resolution = resolver.resolve(&module_path, "./lib/terminal-highlight"); - assert_eq!(resolution, Err(ResolveError::Ignored(module_path.join("lib/terminal-highlight")))); -} - -#[test] -fn ipaddr_js() { - let dir = dir(); - let path = dir.join("fixtures/pnpm"); - let module_path = - dir.join("node_modules/.pnpm/ipaddr.js@2.2.0/node_modules/ipaddr.js/lib/ipaddr.js"); - - let resolvers = [ - // with `extension_alias` - Resolver::new(ResolveOptions { - extension_alias: vec![(".js".into(), vec![".js".into(), ".ts".into(), ".tsx".into()])], - ..ResolveOptions::default() - }), - // with `extensions` should still resolve to module main - Resolver::new(ResolveOptions { - extensions: vec![(".ts".into())], - ..ResolveOptions::default() - }), - // default - Resolver::default(), - ]; - - for resolver in resolvers { - let resolution = resolver.resolve(&path, "ipaddr.js").map(|r| r.full_path()); - assert_eq!(resolution, Ok(module_path.clone())); - } -} From 5687abd1a940bc404bc5edf44565d13e6d0e19c2 Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Mon, 16 Sep 2024 11:02:57 +0300 Subject: [PATCH 81/82] --- .github/CODE_OF_CONDUCT.md | 127 - .github/SECURITY.md | 7 - .github/actions/pnpm/action.yml | 26 - .github/codecov.yml | 14 - .github/renovate.json | 5 - .github/workflows/benchmark.yml | 41 - .github/workflows/ci.yml | 196 - .github/workflows/codecov.yml | 69 - .github/workflows/release-napi.yml | 252 - .github/workflows/release-plz.yml | 55 - Cargo.lock | 1326 --- fixtures/enhanced_resolve/lib/index.js | 1 - fixtures/enhanced_resolve/package.json | 4 - fixtures/enhanced_resolve/test/.gitignore | 3 - .../enhanced_resolve/test/fixtures/#/a.js | 0 fixtures/enhanced_resolve/test/fixtures/a.js | 3 - .../enhanced_resolve/test/fixtures/abc.txt | 1 - .../test/fixtures/alias/files/a.js | 0 fixtures/enhanced_resolve/test/fixtures/b.js | 3 - .../browser-module/browser/module-a.js | 0 .../fixtures/browser-module/lib/browser.js | 0 .../fixtures/browser-module/lib/ignore.js | 0 .../test/fixtures/browser-module/lib/main.js | 0 .../fixtures/browser-module/lib/replaced.js | 0 .../test/fixtures/browser-module/lib/self.js | 0 .../fixtures/browser-module/lib/toString.js | 0 .../browser-module/node_modules/module-a.js | 0 .../browser-module/node_modules/module-b.js | 0 .../browser-module/node_modules/module-c.js | 0 .../node_modules/recursive-file/a.js | 0 .../node_modules/recursive-file/b.js | 0 .../node_modules/recursive-file/c.js | 0 .../node_modules/recursive-file/d.js | 0 .../node_modules/recursive-file/package.json | 8 - .../test/fixtures/browser-module/package.json | 33 - .../test/fixtures/builtins/package.json | 12 - fixtures/enhanced_resolve/test/fixtures/c.js | 4 - .../enhanced_resolve/test/fixtures/complex.js | 13 - .../test/fixtures/crypto-js/index.js | 0 .../test/fixtures/crypto-js/package.json | 7 - .../test/fixtures/decorated-fs/exists.js | 0 .../test/fixtures/dirOrFile.js | 1 - .../test/fixtures/dirOrFile/index.js | 1 - .../directory-default/directory-default.js | 0 .../node_modules/@org/pkg/dist/string.js | 1 - .../@org/pkg/dist/string.test.d.ts | 1 - .../node_modules/@org/pkg/package.json | 9 - .../node_modules/pkg/dist/string.js | 1 - .../node_modules/pkg/dist/string.test.d.ts | 1 - .../node_modules/pkg/package.json | 9 - .../node_modules/exports-field/package.json | 7 - .../node_modules/pack1/index.js | 0 .../test/fixtures/exports-field/a.js | 1 - .../node_modules/exports-field/lib/browser.js | 1 - .../node_modules/exports-field/lib/index.js | 0 .../exports-field/lib/lib2/main.js | 1 - .../node_modules/exports-field/lib/main.js | 1 - .../node_modules/exports-field/main.js | 1 - .../node_modules/exports-field/package.json | 18 - .../node_modules/exports-field/x.js | 1 - .../invalid-exports-field/index.js | 0 .../invalid-exports-field/package.json | 13 - .../node_modules/invalid-exports-field/umd.js | 0 .../test/fixtures/exports-field/package.json | 5 - .../node_modules/exports-field/index.js | 1 - .../node_modules/exports-field/lib/browser.js | 1 - .../exports-field/lib/lib2/main.js | 1 - .../node_modules/exports-field/lib/main.js | 1 - .../node_modules/exports-field/main.js | 1 - .../node_modules/exports-field/package.json | 17 - .../node_modules/exports-field/index | 0 .../node_modules/exports-field/main.js | 1 - .../node_modules/exports-field/package.json | 10 - .../node_modules/exports-field/src/index.js | 0 .../fixtures/extension-alias/dir/index.js | 0 .../fixtures/extension-alias/dir/index.ts | 0 .../fixtures/extension-alias/dir2/index.js | 0 .../fixtures/extension-alias/dir2/index.mts | 0 .../test/fixtures/extension-alias/index.js | 0 .../test/fixtures/extension-alias/index.mjs | 0 .../fixtures/extension-alias/index.mts.js | 0 .../test/fixtures/extension-alias/index.ts | 0 .../test/fixtures/extensions/app.module.js | 0 .../test/fixtures/extensions/dir/index.js | 0 .../test/fixtures/extensions/dir/index.ts | 0 .../test/fixtures/extensions/foo.js | 0 .../test/fixtures/extensions/foo.ts | 0 .../test/fixtures/extensions/index.js | 0 .../test/fixtures/extensions/index.ts | 0 .../extensions/node_modules/module.js | 0 .../extensions/node_modules/module/index.ts | 0 .../test/fixtures/extensions/package.json | 3 - .../enhanced_resolve/test/fixtures/file.load1 | 0 .../enhanced_resolve/test/fixtures/file.load2 | 0 .../test/fixtures/foo/index.js | 0 .../test/fixtures/foo/package.json | 4 - .../node_modules/m/package.json | 17 - .../node_modules/m/src/features/f.js | 0 .../m/src/features/internal/file.js | 0 .../node_modules/m/src/features/y/y.js | 0 .../node_modules/m/src/internal/i.js | 0 .../node_modules/m/src/middle-1/f.js | 0 .../node_modules/m/src/middle-1/nested/f.js | 0 .../node_modules/m/src/middle-2/nested/f.js | 1 - .../m/src/middle-3/nested/f/nested/f.js | 0 .../node_modules/m/src/middle-4/f/f.js | 0 .../node_modules/m/src/middle-5/f$/$.js | 0 .../node_modules/m/src/middle-5/f/$.js | 0 .../node_modules/m/src/middle/f.js | 0 .../node_modules/m/src/middle/nested/f.js | 0 .../test/fixtures/imports-field/a.js | 1 - .../test/fixtures/imports-field/b.js | 0 .../test/fixtures/imports-field/dir/b.js | 0 .../node_modules/a/lib/browser.js | 1 - .../imports-field/node_modules/a/lib/index.js | 0 .../node_modules/a/lib/lib2/main.js | 1 - .../imports-field/node_modules/a/lib/main.js | 1 - .../imports-field/node_modules/a/main.js | 1 - .../imports-field/node_modules/a/package.json | 18 - .../imports-field/node_modules/a/x.js | 1 - .../imports-field/node_modules/c/index.js | 0 .../test/fixtures/imports-field/package.json | 17 - .../fixtures/incorrect-package/pack1/a.js | 0 .../incorrect-package/pack1/package.json | 2 - .../fixtures/incorrect-package/pack2/a.js | 0 .../incorrect-package/pack2/package.json | 0 .../test/fixtures/issue-238/package.json | 3 - .../test/fixtures/issue-238/src/a/config.js | 0 .../src/common/config/myObjectFile.js | 0 .../enhanced_resolve/test/fixtures/lib.js | 0 .../test/fixtures/lib/complex1.js | 1 - .../test/fixtures/main-field-self/index.js | 0 .../fixtures/main-field-self/package.json | 3 - .../test/fixtures/main-field-self2/index.js | 0 .../fixtures/main-field-self2/package.json | 3 - .../enhanced_resolve/test/fixtures/main1.js | 9 - .../enhanced_resolve/test/fixtures/main2.js | 12 - .../enhanced_resolve/test/fixtures/main3.js | 4 - .../multiple_modules/node_modules/m1/a.js | 3 - .../test/fixtures/no#fragment/#/#.js | 0 fixtures/enhanced_resolve/test/fixtures/no.js | 0 .../browser-module-broken/browser.js | 0 .../browser-module-broken/main.js | 0 .../browser-module-broken/package.json | 4 - .../complexm/node_modules/m1/a.js | 1 - .../complexm/node_modules/m1/index.js | 1 - .../fixtures/node_modules/complexm/step1.js | 1 - .../fixtures/node_modules/complexm/step2.js | 1 - .../fixtures/node_modules/dash-name/index.js | 0 .../node_modules/dash-name/package.json | 4 - .../test/fixtures/node_modules/dash/index.js | 0 .../fixtures/node_modules/dash/package.json | 4 - .../invalidPackageJson/package.json | 0 .../test/fixtures/node_modules/m1/a.js | 3 - .../test/fixtures/node_modules/m1/b.js | 3 - .../test/fixtures/node_modules/m2/b.js | 1 - .../node_modules/recursive-module/file.js | 0 .../node_modules/recursive-module/index.js | 0 .../test/fixtures/pnp-a/m2/a.js | 3 - .../test/fixtures/pnp/pkg/dir/index.js | 0 .../test/fixtures/pnp/pkg/index.js | 0 .../test/fixtures/pnp/pkg/main.js | 0 .../fixtures/pnp/pkg/package-alias/browser.js | 0 .../fixtures/pnp/pkg/package-alias/index.js | 0 .../test/fixtures/pnp/pkg/package.json | 7 - .../test/fixtures/pnp/pkg/typescript/index.ts | 0 .../test/fixtures/pnp/pkg3/a.js | 1 - .../test/fixtures/pnp/pkg3/package.json | 8 - .../prefer-pnp/alternative-modules/m1/b.js | 0 .../restrictions/node_modules/pck1/index.css | 0 .../restrictions/node_modules/pck1/index.js | 0 .../node_modules/pck1/package.json | 3 - .../restrictions/node_modules/pck2/index.css | 0 .../restrictions/node_modules/pck2/module.js | 0 .../node_modules/pck2/package.json | 5 - .../test/fixtures/roots_fall_through/index.js | 0 .../scoped/node_modules/@scope/pack1/main.js | 0 .../node_modules/@scope/pack1/package.json | 5 - .../node_modules/@scope/pack2/lib/index.js | 0 .../scoped/node_modules/@scope/pack2/main.js | 0 .../node_modules/@scope/pack2/package.json | 3 - .../test/fixtures/shortcutdir.js/a.js | 0 .../test/fixtures/yield/a/foo-2/b | 0 .../test/fixtures/yield/a/foo-2/c | 0 .../test/fixtures/yield/a/foo/a | 0 .../test/fixtures/yield/a/foo/b | 0 .../test/fixtures/yield/b/foo/a | 0 .../test/fixtures/yield/c/foo/a | 0 .../test/fixtures/yield/c/foo/package.json | 7 - .../fixtures/\346\265\213\350\257\225.js" | 0 .../\344\270\255\346\226\207.js" | 0 fixtures/pnp/.gitignore | 1 - fixtures/pnp/.pnp.cjs | 7543 ----------------- fixtures/pnp/.yarnrc.yml | 1 - fixtures/pnp/package.json | 8 - fixtures/pnp/yarn.lock | 74 - fixtures/pnpm/.gitignore | 1 - fixtures/pnpm/package.json | 11 - fixtures/pnpm/pnpm-lock.yaml | 212 - fixtures/tsconfig/cases/builtins/thing.js | 0 .../tsconfig/cases/builtins/tsconfig.json | 5 - fixtures/tsconfig/cases/exports/index.js | 0 fixtures/tsconfig/cases/exports/tsconfig.json | 3 - .../extends-extension/base-tsconfig.json | 7 - .../tsconfig/cases/extends-extension/foo.js | 0 .../cases/extends-extension/tsconfig.json | 3 - .../cases/extends-extensionless/foo.js | 0 .../cases/extends-extensionless/tsconfig.json | 3 - .../tsconfig/cases/extends-multiple/foo.js | 0 .../cases/extends-multiple/tsconfig.json | 6 - .../tsconfig/cases/extends-not-found/index.js | 0 .../cases/extends-not-found/tsconfig.json | 3 - .../tsconfig/cases/extends-paths/src/index.js | 0 .../cases/extends-paths/tsconfig.base.json | 7 - .../cases/extends-paths/tsconfig.json | 6 - fixtures/tsconfig/cases/field/index.js | 0 fixtures/tsconfig/cases/field/tsconfig.json | 3 - fixtures/tsconfig/cases/index/index.js | 0 fixtures/tsconfig/cases/index/tsconfig.json | 3 - .../cases/paths_template_variable/foo.js | 0 .../paths_template_variable/tsconfig1.json | 3 - .../paths_template_variable/tsconfig2.json | 8 - .../project_references/app/aliased/index.ts | 0 .../cases/project_references/app/index.ts | 0 .../project_references/app/tsconfig.json | 23 - .../project_a/aliased/index.ts | 0 .../project_references/project_a/conf.json | 8 - .../project_references/project_a/index.ts | 0 .../project_b/src/aliased/index.ts | 0 .../project_b/tsconfig.json | 9 - .../project_references/project_c/index.ts | 0 .../project_c/tsconfig.json | 5 - .../project_references/tsconfig.base.json | 4 - fixtures/tsconfig/cases/suffixes/a.ios.ts | 0 fixtures/tsconfig/cases/suffixes/a.ts | 0 fixtures/tsconfig/cases/suffixes/b.ts | 0 fixtures/tsconfig/cases/suffixes/c-test.ts | 0 fixtures/tsconfig/cases/suffixes/index.ts | 1 - .../tsconfig/cases/suffixes/tsconfig.json | 5 - fixtures/tsconfig/cases/trailing-comma/bar.js | 0 .../tsconfig/cases/trailing-comma/index.js | 0 .../cases/trailing-comma/tsconfig.json | 9 - fixtures/tsconfig/foo.js | 0 fixtures/tsconfig/nested/index.js | 0 fixtures/tsconfig/nested/test.js | 0 fixtures/tsconfig/nested/tsconfig.json | 8 - .../node_modules/tsconfig-exports/conf.json | 7 - .../node_modules/tsconfig-exports/foo.js | 0 .../tsconfig-exports/package.json | 7 - .../node_modules/tsconfig-field/conf.json | 7 - .../node_modules/tsconfig-field/foo.js | 0 .../node_modules/tsconfig-field/package.json | 5 - .../node_modules/tsconfig-index/foo.js | 0 .../node_modules/tsconfig-index/package.json | 4 - .../node_modules/tsconfig-index/tsconfig.json | 7 - .../node_modules/tsconfig-not-used/foo.js | 0 .../tsconfig-not-used/tsconfig.json | 7 - fixtures/tsconfig/package.json | 24 - fixtures/tsconfig/tsconfig.json | 7 - fixtures/tsconfig/tsconfig_broken.json | 1 - .../tsconfig/tsconfig_template_variable.json | 7 - napi/__test__/resolver.spec.mjs | 260 - napi/src/lib.rs | 214 - napi/src/options.rs | 261 - napi/src/tracing.rs | 25 - napi/tests/options.test.mjs | 59 - npm/package.json | 79 +- package.json | 53 +- pnpm-lock.yaml | 2598 ------ src/builtins.rs | 71 - src/cache.rs | 354 - src/context.rs | 89 - src/error.rs | 182 - src/file_system.rs | 220 - src/lib.rs | 1755 ---- src/options.rs | 633 -- src/package_json.rs | 219 - src/path.rs | 132 - src/resolution.rs | 92 - src/specifier.rs | 230 - src/tests/alias.rs | 283 - src/tests/browser_field.rs | 189 - src/tests/builtins.rs | 121 - src/tests/dependencies.rs | 110 - src/tests/exports_field.rs | 2546 ------ src/tests/extension_alias.rs | 70 - src/tests/extensions.rs | 125 - src/tests/fallback.rs | 100 - src/tests/full_specified.rs | 113 - src/tests/imports_field.rs | 1320 --- src/tests/incorrect_description_file.rs | 65 - src/tests/main_field.rs | 24 - src/tests/memory_fs.rs | 74 - src/tests/missing.rs | 106 - src/tests/mod.rs | 51 - src/tests/pnp.rs | 45 - src/tests/resolve.rs | 119 - src/tests/restrictions.rs | 25 - src/tests/roots.rs | 92 - src/tests/scoped_packages.rs | 25 - src/tests/simple.rs | 68 - src/tests/symlink.rs | 121 - src/tests/tsconfig_paths.rs | 530 -- src/tests/tsconfig_project_references.rs | 132 - src/tsconfig.rs | 223 - tests/integration_test.rs | 103 - tests/package.json | 5 - tests/resolve_test.rs | 132 - 308 files changed, 56 insertions(+), 24940 deletions(-) delete mode 100644 .github/CODE_OF_CONDUCT.md delete mode 100644 .github/SECURITY.md delete mode 100644 .github/actions/pnpm/action.yml delete mode 100644 .github/codecov.yml delete mode 100644 .github/renovate.json delete mode 100644 .github/workflows/benchmark.yml delete mode 100644 .github/workflows/ci.yml delete mode 100644 .github/workflows/codecov.yml delete mode 100644 .github/workflows/release-napi.yml delete mode 100644 .github/workflows/release-plz.yml delete mode 100644 Cargo.lock delete mode 100644 fixtures/enhanced_resolve/lib/index.js delete mode 100644 fixtures/enhanced_resolve/package.json delete mode 100644 fixtures/enhanced_resolve/test/.gitignore delete mode 100644 fixtures/enhanced_resolve/test/fixtures/#/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/abc.txt delete mode 100644 fixtures/enhanced_resolve/test/fixtures/alias/files/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/browser/module-a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/ignore.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/replaced.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/self.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/lib/toString.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-c.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/c.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/d.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/browser-module/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/builtins/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/c.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/complex.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/crypto-js/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/decorated-fs/exists.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/dirOrFile.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/directory-default/directory-default.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/pack1/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/umd.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/index delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/src/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.mts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mjs delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mts.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extension-alias/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/app.module.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/foo.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/foo.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/extensions/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/file.load1 delete mode 100644 fixtures/enhanced_resolve/test/fixtures/file.load2 delete mode 100644 fixtures/enhanced_resolve/test/fixtures/foo/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/foo/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/internal/file.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/y/y.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/internal/i.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-3/nested/f/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-4/f/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f$/$.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f/$.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/nested/f.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/dir/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/c/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/imports-field/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/issue-238/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/issue-238/src/a/config.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/issue-238/src/common/config/myObjectFile.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/lib.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/lib/complex1.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self2/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main1.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main2.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/main3.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/no#fragment/#/#.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/no.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/invalidPackageJson/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/file.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/dir/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/browser.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg/typescript/index.ts delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/prefer-pnp/alternative-modules/m1/b.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.css delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/index.css delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/module.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/roots_fall_through/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/lib/index.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/main.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json delete mode 100644 fixtures/enhanced_resolve/test/fixtures/shortcutdir.js/a.js delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/b delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/c delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo/a delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/a/foo/b delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/b/foo/a delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/c/foo/a delete mode 100644 fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json delete mode 100644 "fixtures/enhanced_resolve/test/fixtures/\346\265\213\350\257\225.js" delete mode 100644 "fixtures/misc/\344\270\255\346\226\207/\344\270\255\346\226\207.js" delete mode 100644 fixtures/pnp/.gitignore delete mode 100755 fixtures/pnp/.pnp.cjs delete mode 100644 fixtures/pnp/.yarnrc.yml delete mode 100644 fixtures/pnp/package.json delete mode 100644 fixtures/pnp/yarn.lock delete mode 100644 fixtures/pnpm/.gitignore delete mode 100644 fixtures/pnpm/package.json delete mode 100644 fixtures/pnpm/pnpm-lock.yaml delete mode 100644 fixtures/tsconfig/cases/builtins/thing.js delete mode 100644 fixtures/tsconfig/cases/builtins/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/exports/index.js delete mode 100644 fixtures/tsconfig/cases/exports/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-extension/base-tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-extension/foo.js delete mode 100644 fixtures/tsconfig/cases/extends-extension/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-extensionless/foo.js delete mode 100644 fixtures/tsconfig/cases/extends-extensionless/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-multiple/foo.js delete mode 100644 fixtures/tsconfig/cases/extends-multiple/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-not-found/index.js delete mode 100644 fixtures/tsconfig/cases/extends-not-found/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/extends-paths/src/index.js delete mode 100644 fixtures/tsconfig/cases/extends-paths/tsconfig.base.json delete mode 100644 fixtures/tsconfig/cases/extends-paths/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/field/index.js delete mode 100644 fixtures/tsconfig/cases/field/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/index/index.js delete mode 100644 fixtures/tsconfig/cases/index/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/paths_template_variable/foo.js delete mode 100644 fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json delete mode 100644 fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json delete mode 100644 fixtures/tsconfig/cases/project_references/app/aliased/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/app/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/app/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/project_references/project_a/aliased/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_a/conf.json delete mode 100644 fixtures/tsconfig/cases/project_references/project_a/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_b/src/aliased/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_b/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/project_references/project_c/index.ts delete mode 100644 fixtures/tsconfig/cases/project_references/project_c/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/project_references/tsconfig.base.json delete mode 100644 fixtures/tsconfig/cases/suffixes/a.ios.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/a.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/b.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/c-test.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/index.ts delete mode 100644 fixtures/tsconfig/cases/suffixes/tsconfig.json delete mode 100644 fixtures/tsconfig/cases/trailing-comma/bar.js delete mode 100644 fixtures/tsconfig/cases/trailing-comma/index.js delete mode 100644 fixtures/tsconfig/cases/trailing-comma/tsconfig.json delete mode 100644 fixtures/tsconfig/foo.js delete mode 100644 fixtures/tsconfig/nested/index.js delete mode 100644 fixtures/tsconfig/nested/test.js delete mode 100644 fixtures/tsconfig/nested/tsconfig.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-exports/conf.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-exports/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-exports/package.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-field/conf.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-field/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-field/package.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-index/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-index/package.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-not-used/foo.js delete mode 100644 fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json delete mode 100755 fixtures/tsconfig/package.json delete mode 100644 fixtures/tsconfig/tsconfig.json delete mode 100644 fixtures/tsconfig/tsconfig_broken.json delete mode 100644 fixtures/tsconfig/tsconfig_template_variable.json delete mode 100644 napi/__test__/resolver.spec.mjs delete mode 100644 napi/src/lib.rs delete mode 100644 napi/src/options.rs delete mode 100644 napi/src/tracing.rs delete mode 100644 napi/tests/options.test.mjs delete mode 100644 pnpm-lock.yaml delete mode 100644 src/builtins.rs delete mode 100644 src/cache.rs delete mode 100644 src/context.rs delete mode 100644 src/error.rs delete mode 100644 src/file_system.rs delete mode 100644 src/lib.rs delete mode 100644 src/options.rs delete mode 100644 src/package_json.rs delete mode 100644 src/path.rs delete mode 100644 src/resolution.rs delete mode 100644 src/specifier.rs delete mode 100644 src/tests/alias.rs delete mode 100644 src/tests/browser_field.rs delete mode 100644 src/tests/builtins.rs delete mode 100644 src/tests/dependencies.rs delete mode 100644 src/tests/exports_field.rs delete mode 100644 src/tests/extension_alias.rs delete mode 100644 src/tests/extensions.rs delete mode 100644 src/tests/fallback.rs delete mode 100644 src/tests/full_specified.rs delete mode 100644 src/tests/imports_field.rs delete mode 100644 src/tests/incorrect_description_file.rs delete mode 100644 src/tests/main_field.rs delete mode 100644 src/tests/memory_fs.rs delete mode 100644 src/tests/missing.rs delete mode 100644 src/tests/mod.rs delete mode 100644 src/tests/pnp.rs delete mode 100644 src/tests/resolve.rs delete mode 100644 src/tests/restrictions.rs delete mode 100644 src/tests/roots.rs delete mode 100644 src/tests/scoped_packages.rs delete mode 100644 src/tests/simple.rs delete mode 100644 src/tests/symlink.rs delete mode 100644 src/tests/tsconfig_paths.rs delete mode 100644 src/tests/tsconfig_project_references.rs delete mode 100644 src/tsconfig.rs delete mode 100644 tests/integration_test.rs delete mode 100644 tests/package.json delete mode 100644 tests/resolve_test.rs diff --git a/.github/CODE_OF_CONDUCT.md b/.github/CODE_OF_CONDUCT.md deleted file mode 100644 index 41dd9ebe..00000000 --- a/.github/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,127 +0,0 @@ -# Contributor Covenant Code of Conduct - -## Our Pledge - -We as members, contributors, and leaders pledge to make participation in our -community a harassment-free experience for everyone, regardless of age, body -size, visible or invisible disability, ethnicity, sex characteristics, gender -identity and expression, level of experience, education, socio-economic status, -nationality, personal appearance, race, religion, or sexual identity -and orientation. - -We pledge to act and interact in ways that contribute to an open, welcoming, -diverse, inclusive, and healthy community. - -## Our Standards - -Examples of behavior that contributes to a positive environment for our -community include: - -* Demonstrating empathy and kindness toward other people -* Being respectful of differing opinions, viewpoints, and experiences -* Giving and gracefully accepting constructive feedback -* Accepting responsibility and apologizing to those affected by our mistakes, - and learning from the experience -* Focusing on what is best not just for us as individuals, but for the - overall community - -Examples of unacceptable behavior include: - -* The use of sexualized language or imagery, and sexual attention or - advances of any kind -* Trolling, insulting or derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or email - address, without their explicit permission -* Other conduct which could reasonably be considered inappropriate in a - professional setting - -## Enforcement Responsibilities - -Community leaders are responsible for clarifying and enforcing our standards of -acceptable behavior and will take appropriate and fair corrective action in -response to any behavior that they deem inappropriate, threatening, offensive, -or harmful. - -Community leaders have the right and responsibility to remove, edit, or reject -comments, commits, code, wiki edits, issues, and other contributions that are -not aligned to this Code of Conduct, and will communicate reasons for moderation -decisions when appropriate. - -## Scope - -This Code of Conduct applies within all community spaces, and also applies when -an individual is officially representing the community in public spaces. -Examples of representing our community include using an official e-mail address, -posting via an official social media account, or acting as an appointed -representative at an online or offline event. - -## Enforcement - -Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported to the community leaders responsible for enforcement. -All complaints will be reviewed and investigated promptly and fairly. - -All community leaders are obligated to respect the privacy and security of the -reporter of any incident. - -## Enforcement Guidelines - -Community leaders will follow these Community Impact Guidelines in determining -the consequences for any action they deem in violation of this Code of Conduct: - -### 1. Correction - -**Community Impact**: Use of inappropriate language or other behavior deemed -unprofessional or unwelcome in the community. - -**Consequence**: A private, written warning from community leaders, providing -clarity around the nature of the violation and an explanation of why the -behavior was inappropriate. A public apology may be requested. - -### 2. Warning - -**Community Impact**: A violation through a single incident or series -of actions. - -**Consequence**: A warning with consequences for continued behavior. No -interaction with the people involved, including unsolicited interaction with -those enforcing the Code of Conduct, for a specified period of time. This -includes avoiding interactions in community spaces as well as external channels -like social media. Violating these terms may lead to a temporary or -permanent ban. - -### 3. Temporary Ban - -**Community Impact**: A serious violation of community standards, including -sustained inappropriate behavior. - -**Consequence**: A temporary ban from any sort of interaction or public -communication with the community for a specified period of time. No public or -private interaction with the people involved, including unsolicited interaction -with those enforcing the Code of Conduct, is allowed during this period. -Violating these terms may lead to a permanent ban. - -### 4. Permanent Ban - -**Community Impact**: Demonstrating a pattern of violation of community -standards, including sustained inappropriate behavior, harassment of an -individual, or aggression toward or disparagement of classes of individuals. - -**Consequence**: A permanent ban from any sort of public interaction within -the community. - -## Attribution - -This Code of Conduct is adapted from the [Contributor Covenant][homepage], -version 2.0, available at -https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. - -Community Impact Guidelines were inspired by [Mozilla's code of conduct -enforcement ladder](https://github.com/mozilla/diversity). - -[homepage]: https://www.contributor-covenant.org - -For answers to common questions about this code of conduct, see the FAQ at -https://www.contributor-covenant.org/faq. Translations are available at -https://www.contributor-covenant.org/translations. diff --git a/.github/SECURITY.md b/.github/SECURITY.md deleted file mode 100644 index 63f5b072..00000000 --- a/.github/SECURITY.md +++ /dev/null @@ -1,7 +0,0 @@ -# Security Policy - -## Supported Versions - -## Reporting a Vulnerability - -If you find any potential vulnerability, join our [discord channel](https://discord.gg/9uXCAwqQZW) and contact Boshen. diff --git a/.github/actions/pnpm/action.yml b/.github/actions/pnpm/action.yml deleted file mode 100644 index ab4291c0..00000000 --- a/.github/actions/pnpm/action.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: Pnpm - -description: Install pnpm - -runs: - using: composite - steps: - - uses: pnpm/action-setup@v4 - - - uses: actions/setup-node@v4 - with: - node-version-file: .node-version - cache: pnpm - - - name: yarn - shell: bash - run: | - cd fixtures/pnp - corepack enable - yarn install - - - name: pnpm - shell: bash - run: | - corepack enable - pnpm install diff --git a/.github/codecov.yml b/.github/codecov.yml deleted file mode 100644 index 0610268a..00000000 --- a/.github/codecov.yml +++ /dev/null @@ -1,14 +0,0 @@ -coverage: - status: - project: - default: - informational: true - patch: - default: - informational: true - changes: - default: - informational: true - -ignore: - - "examples" diff --git a/.github/renovate.json b/.github/renovate.json deleted file mode 100644 index 2339df09..00000000 --- a/.github/renovate.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "$schema": "https://docs.renovatebot.com/renovate-schema.json", - "extends": ["github>Boshen/renovate"], - "ignorePaths": ["**/node_modules/**", "**/fixtures/**"] -} diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml deleted file mode 100644 index 7c25853b..00000000 --- a/.github/workflows/benchmark.yml +++ /dev/null @@ -1,41 +0,0 @@ -name: Benchmark - -on: - workflow_dispatch: - pull_request: - types: [opened, synchronize] - paths-ignore: - - '**/*.md' - push: - branches: - - main - paths-ignore: - - '**/*.md' - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} - cancel-in-progress: true - -jobs: - benchmark: - name: Benchmark - runs-on: ubuntu-latest - steps: - - name: Checkout Branch - uses: taiki-e/checkout-action@v1 - - - uses: Boshen/setup-rust@main - with: - cache-key: benchmark - save-cache: ${{ github.ref_name == 'main' }} - tools: cargo-codspeed - - uses: ./.github/actions/pnpm - - name: Build Benchmark - run: cargo codspeed build --features codspeed - - - name: Run benchmark - uses: CodSpeedHQ/action@v3 - timeout-minutes: 30 - with: - run: cargo codspeed run - token: ${{ secrets.CODSPEED_TOKEN }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index 3f629ffb..00000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,196 +0,0 @@ -name: CI - -on: - workflow_dispatch: - pull_request: - types: [opened, synchronize] - paths-ignore: - - '**/*.md' - - '!.github/workflows/ci.yml' - push: - branches: - - main - - "renovate/**" - paths-ignore: - - '**/*.md' - - '!.github/workflows/ci.yml' - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} - cancel-in-progress: ${{ github.ref_name != 'main' }} - -defaults: - run: - shell: bash - -jobs: - cache: # Warm cache factory for all other CI jobs - name: Check and Build - strategy: - fail-fast: true - matrix: - include: - - os: windows-latest - - os: ubuntu-latest - - os: macos-14 - runs-on: ${{ matrix.os }} - steps: - - uses: taiki-e/checkout-action@v1 - - - uses: Boshen/setup-rust@main - with: - save-cache: ${{ github.ref_name == 'main' }} - cache-key: warm - - - run: cargo check --all-features --locked - - # Only need to build the test to create a warm cache on the main branch - - name: Build cache by Cargo Check and Cargo Test - if: ${{ github.ref_name == 'main' }} - run: cargo test --all-features --no-run - - wasm: - name: Check Wasm - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - - uses: Boshen/setup-rust@main - with: - cache-key: wasm - save-cache: ${{ github.ref_name == 'main' }} - - - name: Check - run: | - rustup target add wasm32-unknown-unknown - cargo check --all-features --target wasm32-unknown-unknown - - wasi: - name: Test wasi target - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - - uses: Boshen/setup-rust@main - with: - cache-key: wasi - save-cache: ${{ github.ref_name == 'main' }} - - - uses: ./.github/actions/pnpm - - - name: Build - run: | - rustup target add wasm32-wasip1-threads - pnpm build --target wasm32-wasip1-threads - - - name: Test - run: pnpm test - env: - WASI_TEST: 1 - - typos: - name: Spell Check - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - - uses: crate-ci/typos@v1.24.5 - with: - files: . - - deny: - name: Cargo Deny - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - - uses: dorny/paths-filter@v3 - id: filter - with: - filters: | - src: - - 'Cargo.lock' - - - uses: Boshen/setup-rust@main - with: - restore-cache: false - tools: cargo-deny - - - if: steps.filter.outputs.src == 'true' - run: cargo deny check - - unused-deps: - name: Check Unused Dependencies - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - uses: dorny/paths-filter@v3 - id: filter - with: - filters: | - src: - - '**/*.rs' - - '**/Cargo.toml' - - 'Cargo.lock' - - uses: Boshen/setup-rust@main - with: - restore-cache: false - if: steps.filter.outputs.src == 'true' - - uses: cargo-bins/cargo-binstall@main - if: steps.filter.outputs.src == 'true' - - run: cargo binstall --no-confirm cargo-shear@1 - if: steps.filter.outputs.src == 'true' - - run: cargo shear - if: steps.filter.outputs.src == 'true' - - format: - name: Format - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - uses: Boshen/setup-rust@main - with: - components: rustfmt - restore-cache: false - - run: cargo fmt --all -- --check - - lint: - name: Clippy - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - uses: Boshen/setup-rust@main - with: - components: clippy - - run: cargo clippy --all-features -- -D warnings - - doc: - name: Doc - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@v1 - - uses: Boshen/setup-rust@main - with: - components: rust-docs - - run: RUSTDOCFLAGS='-D warnings' cargo doc --no-deps --all-features - - test: - name: Test - strategy: - fail-fast: true - matrix: - include: - - os: windows-latest - - os: ubuntu-latest - - os: macos-14 - runs-on: ${{ matrix.os }} - env: - RUST_BACKTRACE: 1 - steps: - - uses: taiki-e/checkout-action@v1 - - uses: ./.github/actions/pnpm - - uses: Boshen/setup-rust@main - with: - cache-key: warm - - run: cargo test --doc - - run: cargo test --all-features diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml deleted file mode 100644 index 97302b03..00000000 --- a/.github/workflows/codecov.yml +++ /dev/null @@ -1,69 +0,0 @@ -name: Code Coverage # Run cargo-llvm-cov and upload to codecov.io - -on: - workflow_dispatch: - pull_request: - types: [opened, synchronize] - paths-ignore: - - '**/*.md' - push: - branches: - - main - paths-ignore: - - '**/*.md' - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: ${{ github.ref_name != 'main' }} - -jobs: - coverage: - name: Code Coverage - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: taiki-e/checkout-action@v1 - - - uses: ./.github/actions/pnpm - - - uses: Boshen/setup-rust@main - with: - cache-key: codecov - save-cache: ${{ github.ref_name == 'main' }} - tools: cargo-llvm-cov - components: llvm-tools-preview - - - run: cargo llvm-cov --lcov --output-path lcov.info - - - name: Upload Artifact - uses: actions/upload-artifact@v4 - with: - name: codecov - path: lcov.info - - # codecov often fails, use another workflow for retry - upload-codecov: - name: Upload coverage file - runs-on: ubuntu-latest - needs: coverage - # Check if the event is not triggered by a fork by checking whether CODECOV_TOKEN is set - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - steps: - - name: Checkout - if: env.CODECOV_TOKEN - uses: taiki-e/checkout-action@v1 - - - name: Download coverage file - if: env.CODECOV_TOKEN - uses: actions/download-artifact@v4 - with: - name: codecov - - - name: Upload to codecov.io - if: env.CODECOV_TOKEN - uses: codecov/codecov-action@v4 - with: - token: ${{ secrets.CODECOV_TOKEN }} - fail_ci_if_error: true - files: lcov.info diff --git a/.github/workflows/release-napi.yml b/.github/workflows/release-napi.yml deleted file mode 100644 index 1ea68db8..00000000 --- a/.github/workflows/release-napi.yml +++ /dev/null @@ -1,252 +0,0 @@ -name: Release NAPI - -on: - workflow_dispatch: - push: - branches: - - main - paths: - - npm/package.json # Please only commit this file, so we don't need to wait for test CI to pass. - -env: - DEBUG: 'napi:*' - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - check: - name: Check version - runs-on: ubuntu-latest - outputs: - version: ${{ env.version }} - version_changed: ${{ steps.version.outputs.changed }} - steps: - - uses: taiki-e/checkout-action@v1 - - - name: Check version changes - uses: EndBug/version-check@v2 - id: version - with: - static-checking: localIsNew - file-url: https://unpkg.com/oxc-resolver@latest/package.json - file-name: npm/package.json - - - name: Set version name - if: steps.version.outputs.changed == 'true' - run: | - echo "Version change found! New version: ${{ steps.version.outputs.version }} (${{ steps.version.outputs.version_type }})" - echo "version=${{ steps.version.outputs.version }}" >> $GITHUB_ENV - - build: - needs: check - if: needs.check.outputs.version_changed == 'true' - env: - version: ${{ needs.check.outputs.version }} - outputs: - version: ${{ env.version }} - strategy: - fail-fast: false - matrix: - include: - - os: windows-latest - target: x86_64-pc-windows-msvc - - - os: windows-latest - target: aarch64-pc-windows-msvc - - - os: ubuntu-latest - target: x86_64-unknown-linux-gnu - - - os: ubuntu-latest - target: x86_64-unknown-linux-musl - - - os: ubuntu-latest - target: aarch64-unknown-linux-gnu - - - os: ubuntu-latest - target: aarch64-unknown-linux-musl - - - os: ubuntu-latest - target: armv7-unknown-linux-gnueabihf - - - os: macos-latest - target: x86_64-apple-darwin - - - os: macos-latest - target: aarch64-apple-darwin - - - os: ubuntu-latest - target: wasm32-wasip1-threads - - name: Package ${{ matrix.target }} - runs-on: ${{ matrix.os }} - steps: - - uses: taiki-e/checkout-action@v1 - - - uses: ./.github/actions/pnpm - - - name: Add Rust Target - run: rustup target add ${{ matrix.target }} - - - uses: goto-bus-stop/setup-zig@v2 - if: ${{ contains(matrix.target, 'musl') }} - with: - version: 0.13.0 - - - name: Build with zig cross - if: ${{ contains(matrix.target, 'musl') }} - run: pnpm build -x --target ${{ matrix.target }} - - - name: Build with napi cross - if: ${{ contains(matrix.target, 'gnu') }} - run: pnpm build --use-napi-cross --target ${{ matrix.target }} - - - name: Build - if: ${{ !contains(matrix.target, 'gnu') && !contains(matrix.target, 'musl') }} - run: pnpm build --target ${{ matrix.target }} - - - name: Test - if: matrix.target == 'x86_64-pc-windows-msvc' || matrix.target == 'aarch64-apple-darwin' || matrix.target == 'wasm32-wasip1-threads' - run: pnpm test - - - name: Output docker params - if: ${{ contains(matrix.target, 'linux') }} - id: docker - run: | - node -e " - if ('${{ matrix.target }}'.startsWith('aarch64')) { - console.log('PLATFORM=linux/arm64') - } else if ('${{ matrix.target }}'.startsWith('armv7')) { - console.log('PLATFORM=linux/arm/v7') - } else { - console.log('PLATFORM=linux/amd64') - } - " >> $GITHUB_OUTPUT - node -e " - if ('${{ matrix.target }}'.endsWith('-musl')) { - console.log('IMAGE=node:lts-alpine') - } else { - console.log('IMAGE=node:lts-slim') - } - " >> $GITHUB_OUTPUT - echo "PNPM_STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_OUTPUT - - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - if: ${{ contains(matrix.target, 'linux') }} - with: - platforms: all - - - run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes - if: ${{ contains(matrix.target, 'linux') }} - - - name: Run linux test - uses: addnab/docker-run-action@v3 - if: ${{ contains(matrix.target, 'linux') }} - with: - image: ${{ steps.docker.outputs.IMAGE }} - options: -v ${{ steps.docker.outputs.PNPM_STORE_PATH }}:${{ steps.docker.outputs.PNPM_STORE_PATH }} -v ${{ github.workspace }}:/oxc_resolver -w /oxc_resolver --platform ${{ steps.docker.outputs.PLATFORM }} - run: | - corepack enable - pnpm test - - - name: Upload artifacts - uses: actions/upload-artifact@v4 - with: - name: bindings-${{ matrix.target }} - path: | - napi/*.node - napi/*.wasm - - build-freebsd: - needs: check - if: needs.check.outputs.version_changed == 'true' - name: Build FreeBSD - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Build - id: build - uses: cross-platform-actions/action@v0.25.0 - env: - DEBUG: napi:* - RUSTUP_IO_THREADS: 1 - with: - operating_system: freebsd - version: '14.0' - memory: 8G - cpu_count: 3 - environment_variables: 'DEBUG RUSTUP_IO_THREADS' - shell: bash - run: | - sudo pkg install -y -f curl node libnghttp2 npm - curl https://sh.rustup.rs -sSf --output rustup.sh - sh rustup.sh -y --profile minimal --default-toolchain stable - source "$HOME/.cargo/env" - echo "~~~~ rustc --version ~~~~" - rustc --version - echo "~~~~ node -v ~~~~" - node -v - pwd - ls -lah - whoami - env - sudo corepack enable - pnpm install - pnpm build --target x86_64-unknown-freebsd - rm -rf node_modules - rm -rf target - - name: Upload artifact - uses: actions/upload-artifact@v4 - with: - name: bindings-freebsd - path: napi/*.node - if-no-files-found: error - - publish: - name: Publish NAPI - runs-on: ubuntu-latest - permissions: - id-token: write # for `npm publish --provenance` - needs: - - build - - build-freebsd - steps: - - uses: taiki-e/checkout-action@v1 - - - name: corepack - run: corepack enable - - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version-file: .node-version - cache: pnpm - - - name: Install dependencies - run: pnpm install --frozen-lockfile - - - name: Download Artifacts - uses: actions/download-artifact@v4 - with: - path: artifacts - - - name: Prepare dirs and artifacts - run: | - pnpm napi create-npm-dirs --package-json-path npm/package.json - pnpm napi artifacts --package-json-path npm/package.json --build-output-dir napi - - - name: Publish npm packages as latest - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - shell: bash - run: | - cp napi/index.js npm/index.js - cp napi/index.d.ts npm/index.d.ts - cp napi/browser.js npm/browser.js - echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc - pnpm napi pre-publish --no-gh-release -t npm --package-json-path npm/package.json - npm publish npm/ --tag latest --provenance --access public diff --git a/.github/workflows/release-plz.yml b/.github/workflows/release-plz.yml deleted file mode 100644 index 121758ad..00000000 --- a/.github/workflows/release-plz.yml +++ /dev/null @@ -1,55 +0,0 @@ -name: Release Plz - -on: - workflow_dispatch: - push: - branches: - - main - -permissions: - pull-requests: write - contents: write - -jobs: - release-plz: - name: Release-plz - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - uses: Boshen/setup-rust@main - with: - save-cache: ${{ github.ref_name == 'main' }} - cache-key: warm - - - name: Run release-plz - id: release-plz - uses: MarcoIeni/release-plz-action@v0.5 - env: - GITHUB_TOKEN: ${{ secrets.RELEASE_PLZ_TOKEN }} - CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} - - - name: Bump package.json - if: ${{ steps.release-plz.outputs.prs_created }} - env: - GH_TOKEN: ${{ github.token }} - RELEASES: ${{ steps.release-plz.outputs.releases }} - PR: ${{ steps.release-plz.outputs.pr }} - run: | - set -e - - pr_number=${{ fromJSON(steps.release-plz.outputs.pr).number }} - if [[ -n "$pr_number" ]]; then - version=$(echo "$RELEASES" | jq -r '.[0].version') - echo "version: $version" - - jq --arg version "${version}" '.version = ($version)' npm/package.json > tmp - mv tmp npm/package.json - - gh pr checkout $pr_number - git add . - git commit -m "Update package.json" - git push - fi diff --git a/Cargo.lock b/Cargo.lock deleted file mode 100644 index 58c1e7ad..00000000 --- a/Cargo.lock +++ /dev/null @@ -1,1326 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "adler" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" - -[[package]] -name = "aho-corasick" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" -dependencies = [ - "memchr", -] - -[[package]] -name = "android-tzdata" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" - -[[package]] -name = "android_system_properties" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" -dependencies = [ - "libc", -] - -[[package]] -name = "anes" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "735d4f398ca57cfa2880225c2bf81c3b9af3be5bb22e44ae70118dad38713e84" - -[[package]] -name = "arca" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f915ddd863ef73f11c10c75170e86db1d4f539689bc6bfb9ce25d6528d6fe83" -dependencies = [ - "clean-path", - "path-slash", - "radix_trie", -] - -[[package]] -name = "autocfg" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" - -[[package]] -name = "base64" -version = "0.22.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" - -[[package]] -name = "bit-set" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1" -dependencies = [ - "bit-vec", -] - -[[package]] -name = "bit-vec" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "bitflags" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" - -[[package]] -name = "bpaf" -version = "0.9.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3280efcf6d66bc77c2cf9b67dc8acee47a217d9be67dd590b3230dffe663724d" - -[[package]] -name = "bumpalo" -version = "3.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" - -[[package]] -name = "byteorder" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" - -[[package]] -name = "cast" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" - -[[package]] -name = "cc" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eaff6f8ce506b9773fa786672d63fc7a191ffea1be33f72bbd4aeacefca9ffc8" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "chrono" -version = "0.4.38" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" -dependencies = [ - "android-tzdata", - "iana-time-zone", - "num-traits", - "serde", - "windows-targets 0.52.6", -] - -[[package]] -name = "ciborium" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42e69ffd6f0917f5c029256a24d0161db17cea3997d185db0d35926308770f0e" -dependencies = [ - "ciborium-io", - "ciborium-ll", - "serde", -] - -[[package]] -name = "ciborium-io" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05afea1e0a06c9be33d539b876f1ce3692f4afea2cb41f740e7743225ed1c757" - -[[package]] -name = "ciborium-ll" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57663b653d948a338bfb3eeba9bb2fd5fcfaecb9e199e87e1eda4d9e8b240fd9" -dependencies = [ - "ciborium-io", - "half", -] - -[[package]] -name = "clean-path" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aaa6b4b263a5d737e9bf6b7c09b72c41a5480aec4d7219af827f6564e950b6a5" - -[[package]] -name = "codspeed" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a104ac948e0188b921eb3fcbdd55dcf62e542df4c7ab7e660623f6288302089" -dependencies = [ - "colored", - "libc", - "serde_json", -] - -[[package]] -name = "colored" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbf2150cce219b664a8a70df7a1f933836724b503f8a413af9365b4dcc4d90b8" -dependencies = [ - "lazy_static", - "windows-sys 0.48.0", -] - -[[package]] -name = "concurrent_lru" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7feb5cb312f774e8a24540e27206db4e890f7d488563671d24a16389cf4c2e4e" -dependencies = [ - "once_cell", -] - -[[package]] -name = "convert_case" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec182b0ca2f35d8fc196cf3404988fd8b8c739a4d270ff118a398feb0cbec1ca" -dependencies = [ - "unicode-segmentation", -] - -[[package]] -name = "core-foundation-sys" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" - -[[package]] -name = "criterion2" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8df39381f28ced0ceebfb5611528d99aef14f8d75b43e9d4ceb6aba66e7b04d" -dependencies = [ - "anes", - "bpaf", - "cast", - "ciborium", - "codspeed", - "colored", - "num-traits", - "oorandom", - "serde", - "serde_json", - "walkdir", -] - -[[package]] -name = "crossbeam-deque" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" -dependencies = [ - "crossbeam-epoch", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.9.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" -dependencies = [ - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" - -[[package]] -name = "crunchy" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" - -[[package]] -name = "ctor" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edb49164822f3ee45b17acd4a208cfc1251410cf0cad9a833234c9890774dd9f" -dependencies = [ - "quote", - "syn", -] - -[[package]] -name = "darling" -version = "0.20.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" -dependencies = [ - "darling_core", - "darling_macro", -] - -[[package]] -name = "darling_core" -version = "0.20.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95133861a8032aaea082871032f5815eb9e98cef03fa916ab4500513994df9e5" -dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "strsim", - "syn", -] - -[[package]] -name = "darling_macro" -version = "0.20.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" -dependencies = [ - "darling_core", - "quote", - "syn", -] - -[[package]] -name = "dashmap" -version = "6.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "804c8821570c3f8b70230c2ba75ffa5c0f9a4189b9a432b6656c536712acae28" -dependencies = [ - "cfg-if", - "crossbeam-utils", - "hashbrown 0.14.5", - "lock_api", - "once_cell", - "parking_lot_core", -] - -[[package]] -name = "deranged" -version = "0.3.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" -dependencies = [ - "powerfmt", - "serde", -] - -[[package]] -name = "document-features" -version = "0.2.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb6969eaabd2421f8a2775cfd2471a2b634372b4a25d41e3bd647b79912850a0" -dependencies = [ - "litrs", -] - -[[package]] -name = "dunce" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" - -[[package]] -name = "either" -version = "1.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" - -[[package]] -name = "endian-type" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" - -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "fancy-regex" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "531e46835a22af56d1e3b66f04844bed63158bc094a628bec1d321d9b4c44bf2" -dependencies = [ - "bit-set", - "regex-automata", - "regex-syntax", -] - -[[package]] -name = "filetime" -version = "0.2.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ee447700ac8aa0b2f2bd7bc4462ad686ba06baa6727ac149a2d6277f0d240fd" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall 0.4.1", - "windows-sys 0.52.0", -] - -[[package]] -name = "fnv" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" - -[[package]] -name = "half" -version = "2.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dd08c532ae367adf81c312a4580bc67f1d0fe8bc9c460520283f4c0ff277888" -dependencies = [ - "cfg-if", - "crunchy", -] - -[[package]] -name = "hashbrown" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" - -[[package]] -name = "hashbrown" -version = "0.14.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "iana-time-zone" -version = "0.1.60" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" -dependencies = [ - "android_system_properties", - "core-foundation-sys", - "iana-time-zone-haiku", - "js-sys", - "wasm-bindgen", - "windows-core", -] - -[[package]] -name = "iana-time-zone-haiku" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" -dependencies = [ - "cc", -] - -[[package]] -name = "ident_case" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" - -[[package]] -name = "indexmap" -version = "1.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" -dependencies = [ - "autocfg", - "hashbrown 0.12.3", - "serde", -] - -[[package]] -name = "indexmap" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93ead53efc7ea8ed3cfb0c79fc8023fbb782a5432b52830b6518941cebe6505c" -dependencies = [ - "equivalent", - "hashbrown 0.14.5", - "serde", -] - -[[package]] -name = "itoa" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" - -[[package]] -name = "js-sys" -version = "0.3.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" -dependencies = [ - "wasm-bindgen", -] - -[[package]] -name = "json-strip-comments" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b271732a960335e715b6b2ae66a086f115c74eb97360e996d2bd809bfc063bba" -dependencies = [ - "memchr", -] - -[[package]] -name = "lazy_static" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" - -[[package]] -name = "libc" -version = "0.2.155" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" - -[[package]] -name = "libloading" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e310b3a6b5907f99202fcdb4960ff45b93735d7c7d96b760fcff8db2dc0e103d" -dependencies = [ - "cfg-if", - "windows-targets 0.52.6", -] - -[[package]] -name = "litrs" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4ce301924b7887e9d637144fdade93f9dfff9b60981d4ac161db09720d39aa5" - -[[package]] -name = "lock_api" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" -dependencies = [ - "autocfg", - "scopeguard", -] - -[[package]] -name = "log" -version = "0.4.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" - -[[package]] -name = "memchr" -version = "2.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" - -[[package]] -name = "miniz_oxide" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" -dependencies = [ - "adler", -] - -[[package]] -name = "napi" -version = "3.0.0-alpha.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ec04344cc540f5897e97c9821ab99e7eb276b4dca6f3e6e441dfa72e5bcde70" -dependencies = [ - "bitflags 2.6.0", - "ctor", - "napi-build", - "napi-sys", - "once_cell", - "serde", - "serde_json", -] - -[[package]] -name = "napi-build" -version = "2.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1c0f5d67ee408a4685b61f5ab7e58605c8ae3f2b4189f0127d804ff13d5560a" - -[[package]] -name = "napi-derive" -version = "3.0.0-alpha.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c6240c4ddca592cde608bbfa26e2af397c3596e413a0c65c9bbcb65c2f1e485" -dependencies = [ - "cfg-if", - "convert_case", - "napi-derive-backend", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "napi-derive-backend" -version = "2.0.0-alpha.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b32dcc50065508fe2f387076c17adbdf10e038d1c080d48b10196813d94ac6a8" -dependencies = [ - "convert_case", - "once_cell", - "proc-macro2", - "quote", - "regex", - "semver", - "syn", -] - -[[package]] -name = "napi-sys" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "427802e8ec3a734331fec1035594a210ce1ff4dc5bc1950530920ab717964ea3" -dependencies = [ - "libloading", -] - -[[package]] -name = "nibble_vec" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" -dependencies = [ - "smallvec", -] - -[[package]] -name = "normalize-path" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5438dd2b2ff4c6df6e1ce22d825ed2fa93ee2922235cc45186991717f0a892d" - -[[package]] -name = "num-conv" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" - -[[package]] -name = "num-traits" -version = "0.2.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" -dependencies = [ - "autocfg", -] - -[[package]] -name = "once_cell" -version = "1.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" - -[[package]] -name = "oorandom" -version = "11.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b410bbe7e14ab526a0e86877eb47c6996a2bd7746f027ba551028c925390e4e9" - -[[package]] -name = "oxc_napi_resolver" -version = "0.0.0" -dependencies = [ - "napi", - "napi-build", - "napi-derive", - "oxc_resolver", - "tracing-subscriber", -] - -[[package]] -name = "oxc_resolver" -version = "1.11.0" -dependencies = [ - "cfg-if", - "criterion2", - "dashmap", - "document-features", - "dunce", - "indexmap 2.4.0", - "json-strip-comments", - "normalize-path", - "once_cell", - "pnp", - "rayon", - "rustc-hash", - "serde", - "serde_json", - "simdutf8", - "thiserror", - "tracing", - "vfs", -] - -[[package]] -name = "parking_lot_core" -version = "0.9.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall 0.5.2", - "smallvec", - "windows-targets 0.52.6", -] - -[[package]] -name = "path-slash" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e91099d4268b0e11973f036e885d652fb0b21fedcf69738c627f94db6a44f42" - -[[package]] -name = "pathdiff" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8835116a5c179084a830efb3adc117ab007512b535bc1a21c991d3b32a6b44dd" - -[[package]] -name = "pin-project-lite" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" - -[[package]] -name = "pnp" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46770cee76a618023fea15411d0449dd066dc232cc17e4562f154da215f27af7" -dependencies = [ - "arca", - "byteorder", - "concurrent_lru", - "fancy-regex", - "lazy_static", - "miniz_oxide", - "pathdiff", - "regex", - "serde", - "serde_json", - "serde_with", - "thiserror", -] - -[[package]] -name = "powerfmt" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" - -[[package]] -name = "proc-macro2" -version = "1.0.86" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.36" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "radix_trie" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" -dependencies = [ - "endian-type", - "nibble_vec", -] - -[[package]] -name = "rayon" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" -dependencies = [ - "either", - "rayon-core", -] - -[[package]] -name = "rayon-core" -version = "1.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" -dependencies = [ - "crossbeam-deque", - "crossbeam-utils", -] - -[[package]] -name = "redox_syscall" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" -dependencies = [ - "bitflags 1.3.2", -] - -[[package]] -name = "redox_syscall" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c82cf8cff14456045f55ec4241383baeff27af886adb72ffb2162f99911de0fd" -dependencies = [ - "bitflags 2.6.0", -] - -[[package]] -name = "regex" -version = "1.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b91213439dad192326a0d7c6ee3955910425f441d7038e0d6933b0aec5c4517f" -dependencies = [ - "aho-corasick", - "memchr", - "regex-automata", - "regex-syntax", -] - -[[package]] -name = "regex-automata" -version = "0.4.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", -] - -[[package]] -name = "regex-syntax" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" - -[[package]] -name = "rustc-hash" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" - -[[package]] -name = "ryu" -version = "1.0.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" - -[[package]] -name = "same-file" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "scopeguard" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" - -[[package]] -name = "semver" -version = "1.0.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" - -[[package]] -name = "serde" -version = "1.0.209" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99fce0ffe7310761ca6bf9faf5115afbc19688edd00171d81b1bb1b116c63e09" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.209" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5831b979fd7b5439637af1752d535ff49f4860c0f341d1baeb6faf0f4242170" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "serde_json" -version = "1.0.127" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8043c06d9f82bd7271361ed64f415fe5e12a77fdb52e573e7f06a516dea329ad" -dependencies = [ - "indexmap 2.4.0", - "itoa", - "memchr", - "ryu", - "serde", -] - -[[package]] -name = "serde_with" -version = "3.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e73139bc5ec2d45e6c5fd85be5a46949c1c39a4c18e56915f5eb4c12f975e377" -dependencies = [ - "base64", - "chrono", - "hex", - "indexmap 1.9.3", - "indexmap 2.4.0", - "serde", - "serde_derive", - "serde_json", - "serde_with_macros", - "time", -] - -[[package]] -name = "serde_with_macros" -version = "3.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b80d3d6b56b64335c0180e5ffde23b3c5e08c14c585b51a15bd0e95393f46703" -dependencies = [ - "darling", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "sharded-slab" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" -dependencies = [ - "lazy_static", -] - -[[package]] -name = "simdutf8" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f27f6278552951f1f2b8cf9da965d10969b2efdea95a6ec47987ab46edfe263a" - -[[package]] -name = "smallvec" -version = "1.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" - -[[package]] -name = "strsim" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" - -[[package]] -name = "syn" -version = "2.0.70" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f0209b68b3613b093e0ec905354eccaedcfe83b8cb37cbdeae64026c3064c16" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "thiserror" -version = "1.0.63" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.63" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "thread_local" -version = "1.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" -dependencies = [ - "cfg-if", - "once_cell", -] - -[[package]] -name = "time" -version = "0.3.36" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" -dependencies = [ - "deranged", - "itoa", - "num-conv", - "powerfmt", - "serde", - "time-core", - "time-macros", -] - -[[package]] -name = "time-core" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" - -[[package]] -name = "time-macros" -version = "0.2.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" -dependencies = [ - "num-conv", - "time-core", -] - -[[package]] -name = "tracing" -version = "0.1.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" -dependencies = [ - "pin-project-lite", - "tracing-attributes", - "tracing-core", -] - -[[package]] -name = "tracing-attributes" -version = "0.1.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "tracing-core" -version = "0.1.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" -dependencies = [ - "once_cell", -] - -[[package]] -name = "tracing-subscriber" -version = "0.3.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" -dependencies = [ - "sharded-slab", - "thread_local", - "tracing-core", -] - -[[package]] -name = "unicode-ident" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" - -[[package]] -name = "unicode-segmentation" -version = "1.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" - -[[package]] -name = "vfs" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "654cd097e182a71dbf899178e6b5662c2157dd0b8afd5975de18008f6fc173d1" -dependencies = [ - "filetime", -] - -[[package]] -name = "walkdir" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" -dependencies = [ - "same-file", - "winapi-util", -] - -[[package]] -name = "wasm-bindgen" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" -dependencies = [ - "cfg-if", - "wasm-bindgen-macro", -] - -[[package]] -name = "wasm-bindgen-backend" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" -dependencies = [ - "bumpalo", - "log", - "once_cell", - "proc-macro2", - "quote", - "syn", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-macro" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" -dependencies = [ - "quote", - "wasm-bindgen-macro-support", -] - -[[package]] -name = "wasm-bindgen-macro-support" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" -dependencies = [ - "proc-macro2", - "quote", - "syn", - "wasm-bindgen-backend", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-shared" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" - -[[package]] -name = "winapi-util" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b" -dependencies = [ - "windows-sys 0.52.0", -] - -[[package]] -name = "windows-core" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" -dependencies = [ - "windows-targets 0.52.6", -] - -[[package]] -name = "windows-sys" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" -dependencies = [ - "windows-targets 0.48.5", -] - -[[package]] -name = "windows-sys" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" -dependencies = [ - "windows-targets 0.52.6", -] - -[[package]] -name = "windows-targets" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" -dependencies = [ - "windows_aarch64_gnullvm 0.48.5", - "windows_aarch64_msvc 0.48.5", - "windows_i686_gnu 0.48.5", - "windows_i686_msvc 0.48.5", - "windows_x86_64_gnu 0.48.5", - "windows_x86_64_gnullvm 0.48.5", - "windows_x86_64_msvc 0.48.5", -] - -[[package]] -name = "windows-targets" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" -dependencies = [ - "windows_aarch64_gnullvm 0.52.6", - "windows_aarch64_msvc 0.52.6", - "windows_i686_gnu 0.52.6", - "windows_i686_gnullvm", - "windows_i686_msvc 0.52.6", - "windows_x86_64_gnu 0.52.6", - "windows_x86_64_gnullvm 0.52.6", - "windows_x86_64_msvc 0.52.6", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" - -[[package]] -name = "windows_i686_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" - -[[package]] -name = "windows_i686_gnu" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" - -[[package]] -name = "windows_i686_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" - -[[package]] -name = "windows_i686_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" - -[[package]] -name = "windows_i686_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" diff --git a/fixtures/enhanced_resolve/lib/index.js b/fixtures/enhanced_resolve/lib/index.js deleted file mode 100644 index 1e872e8f..00000000 --- a/fixtures/enhanced_resolve/lib/index.js +++ /dev/null @@ -1 +0,0 @@ -// mimic enhanced-resolved root directory structure diff --git a/fixtures/enhanced_resolve/package.json b/fixtures/enhanced_resolve/package.json deleted file mode 100644 index d1b845b5..00000000 --- a/fixtures/enhanced_resolve/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "enhanced-resolve", - "main": "lib/index.js" -} diff --git a/fixtures/enhanced_resolve/test/.gitignore b/fixtures/enhanced_resolve/test/.gitignore deleted file mode 100644 index b021b4e4..00000000 --- a/fixtures/enhanced_resolve/test/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -# created by symlink.rs -/temp -/temp_symlinks \ No newline at end of file diff --git a/fixtures/enhanced_resolve/test/fixtures/#/a.js b/fixtures/enhanced_resolve/test/fixtures/#/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/a.js b/fixtures/enhanced_resolve/test/fixtures/a.js deleted file mode 100644 index 896ffc6d..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/abc.txt b/fixtures/enhanced_resolve/test/fixtures/abc.txt deleted file mode 100644 index f2ba8f84..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/abc.txt +++ /dev/null @@ -1 +0,0 @@ -abc \ No newline at end of file diff --git a/fixtures/enhanced_resolve/test/fixtures/alias/files/a.js b/fixtures/enhanced_resolve/test/fixtures/alias/files/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/b.js b/fixtures/enhanced_resolve/test/fixtures/b.js deleted file mode 100644 index 11476340..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/b.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function b() { - return "This is b"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/browser/module-a.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/browser/module-a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/browser.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/ignore.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/ignore.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/replaced.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/replaced.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/self.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/self.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/toString.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/lib/toString.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-a.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-b.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-c.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/module-c.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/a.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/b.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/c.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/c.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/d.js b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/d.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json b/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json deleted file mode 100644 index c13fe23b..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/browser-module/node_modules/recursive-file/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "browser": { - "a.js": "./a", - "./b.js": "./b", - "c.js": "./d.js", - "./d.js": "./c.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/browser-module/package.json b/fixtures/enhanced_resolve/test/fixtures/browser-module/package.json deleted file mode 100644 index 19ff7739..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/browser-module/package.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "exports": { - "./lib/index.js": "./lib/index.js" - }, - "browser": { - "./lib/ignore.js": false, - "./lib/replaced.js": "./lib/browser", - "module-a": "./browser/module-a.js", - "module-b": "module-c", - "module-c": "module-c", - "./toString": "./lib/toString.js", - "./lib/main.js": "./lib/main.js", - "./main.js": "./lib/main.js", - "./lib/xyz.js": "./xyz.js", - "./xyz.js": "./lib/xyz.js", - "./lib/non-existent.js": "./lib/non-existent.js", - ".": false, - "./number": 1, - "./foo": "./lib/replaced.js?query" - }, - "innerBrowser1": { - "field": { - "browser": { - "./lib/main1.js": "./lib/main.js" - } - } - }, - "innerBrowser2": { - "browser": { - "./lib/main2.js": "./lib/replaced.js" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/builtins/package.json b/fixtures/enhanced_resolve/test/fixtures/builtins/package.json deleted file mode 100644 index 4a54ea96..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/builtins/package.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "name": "builtins", - "private": true, - "imports": { - "#fs": { - "default": "fs" - }, - "#http": { - "node": "node:http" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/c.js b/fixtures/enhanced_resolve/test/fixtures/c.js deleted file mode 100644 index e3aca8aa..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/c.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = function b() { - require("./a"); - return "This is c"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/complex.js b/fixtures/enhanced_resolve/test/fixtures/complex.js deleted file mode 100644 index 1f62db84..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/complex.js +++ /dev/null @@ -1,13 +0,0 @@ -var 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); diff --git a/fixtures/enhanced_resolve/test/fixtures/crypto-js/index.js b/fixtures/enhanced_resolve/test/fixtures/crypto-js/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json b/fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json deleted file mode 100644 index 1d31aa8b..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/crypto-js/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "crypto-js", - "main": "index.js", - "browser": { - "crypto": false - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/decorated-fs/exists.js b/fixtures/enhanced_resolve/test/fixtures/decorated-fs/exists.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/dirOrFile.js b/fixtures/enhanced_resolve/test/fixtures/dirOrFile.js deleted file mode 100644 index c3cb885f..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/dirOrFile.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "file"; diff --git a/fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js b/fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js deleted file mode 100644 index 85e01cd4..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/dirOrFile/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "dir"; diff --git a/fixtures/enhanced_resolve/test/fixtures/directory-default/directory-default.js b/fixtures/enhanced_resolve/test/fixtures/directory-default/directory-default.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js deleted file mode 100644 index d1007aae..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.js +++ /dev/null @@ -1 +0,0 @@ -export default "string"; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts deleted file mode 100644 index cb0ff5c3..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/dist/string.test.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json deleted file mode 100644 index b523a1e9..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/package.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "@org/pkg", - "exports": { - "./*.js": { - "types": "./dist/*.d.ts", - "default": "./dist/*.js" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js deleted file mode 100644 index d1007aae..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.js +++ /dev/null @@ -1 +0,0 @@ -export default "string"; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts deleted file mode 100644 index cb0ff5c3..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/dist/string.test.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json deleted file mode 100644 index 8e55fb46..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/package.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "@raviqqe/hidash", - "exports": { - "./*.js": { - "types": "./dist/*.d.ts", - "default": "./dist/*.js" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json deleted file mode 100644 index f0edf449..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/exports-field/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "exports-field", - "version": "1.0.0", - "exports": { - ".": "./a/../b/../../pack1/index.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/pack1/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field-error/node_modules/pack1/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/a.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/a.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/lib/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json deleted file mode 100644 index 6b105c08..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/package.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "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/": { - "webpack": ["./lib/lib2/", "./lib/"], - "node": "./lib/", - "default": "./lib/" - }, - "./dist/a.js": "./../../a.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/exports-field/x.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json deleted file mode 100644 index 0012a3de..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/package.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "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" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/umd.js b/fixtures/enhanced_resolve/test/fixtures/exports-field/node_modules/invalid-exports-field/umd.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field/package.json deleted file mode 100644 index 5fa72bb5..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "@exports-field/core", - "version": "1.0.0", - "exports": "./a.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json deleted file mode 100644 index e6f12074..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field2/node_modules/exports-field/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "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/lib2/", "./lib/"], - "node": "./lib/", - "default": "./lib/" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/index b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/index deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json deleted file mode 100644 index 1a838f49..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/package.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "name": "exports-field", - "exportsField": { - "exports": "./main.js" - }, - "ex": "./index", - "broken": { - ".": "./src" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/src/index.js b/fixtures/enhanced_resolve/test/fixtures/exports-field3/node_modules/exports-field/src/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.ts b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.mts b/fixtures/enhanced_resolve/test/fixtures/extension-alias/dir2/index.mts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mjs b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mjs deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mts.js b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.mts.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.ts b/fixtures/enhanced_resolve/test/fixtures/extension-alias/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/app.module.js b/fixtures/enhanced_resolve/test/fixtures/extensions/app.module.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.js b/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/dir/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/foo.js b/fixtures/enhanced_resolve/test/fixtures/extensions/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/foo.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/foo.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/index.js b/fixtures/enhanced_resolve/test/fixtures/extensions/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/index.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module.js b/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module/index.ts b/fixtures/enhanced_resolve/test/fixtures/extensions/node_modules/module/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/extensions/package.json b/fixtures/enhanced_resolve/test/fixtures/extensions/package.json deleted file mode 100644 index 5e55a1e8..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/extensions/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "./index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/file.load1 b/fixtures/enhanced_resolve/test/fixtures/file.load1 deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/file.load2 b/fixtures/enhanced_resolve/test/fixtures/file.load2 deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/foo/index.js b/fixtures/enhanced_resolve/test/fixtures/foo/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/foo/package.json b/fixtures/enhanced_resolve/test/fixtures/foo/package.json deleted file mode 100644 index da86787a..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/foo/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "foo", - "version": "1.0.0" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json deleted file mode 100644 index aa2be496..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "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" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/internal/file.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/internal/file.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/y/y.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/y/y.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/internal/i.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/internal/i.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/nested/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js deleted file mode 100644 index e5b70a86..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nested/f.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = { nested: "nested" } diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-3/nested/f/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-3/nested/f/nested/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-4/f/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-4/f/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f$/$.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f$/$.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f/$.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f/$.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/nested/f.js b/fixtures/enhanced_resolve/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/nested/f.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/a.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/a.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/b.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/dir/b.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/dir/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/index.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/lib/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json deleted file mode 100644 index 8d8d3a46..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/package.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "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/lib2/", "./lib/"], - "node": "./lib/", - "default": "./lib/" - }, - "./dist/a.js": "./../../a.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/a/x.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/c/index.js b/fixtures/enhanced_resolve/test/fixtures/imports-field/node_modules/c/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/imports-field/package.json b/fixtures/enhanced_resolve/test/fixtures/imports-field/package.json deleted file mode 100644 index 248351a9..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/imports-field/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "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" - } - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/a.js b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json deleted file mode 100644 index ded7faa2..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json +++ /dev/null @@ -1,2 +0,0 @@ -{ - "main": "./a.js", diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/a.js b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/package.json b/fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack2/package.json deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/issue-238/package.json b/fixtures/enhanced_resolve/test/fixtures/issue-238/package.json deleted file mode 100644 index 352055cd..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/issue-238/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "private": true -} diff --git a/fixtures/enhanced_resolve/test/fixtures/issue-238/src/a/config.js b/fixtures/enhanced_resolve/test/fixtures/issue-238/src/a/config.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/issue-238/src/common/config/myObjectFile.js b/fixtures/enhanced_resolve/test/fixtures/issue-238/src/common/config/myObjectFile.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/lib.js b/fixtures/enhanced_resolve/test/fixtures/lib.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/lib/complex1.js b/fixtures/enhanced_resolve/test/fixtures/lib/complex1.js deleted file mode 100644 index b3de3d70..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/lib/complex1.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "lib complex1"; diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self/index.js b/fixtures/enhanced_resolve/test/fixtures/main-field-self/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json b/fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json deleted file mode 100644 index a2b6f341..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main-field-self/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "./" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self2/index.js b/fixtures/enhanced_resolve/test/fixtures/main-field-self2/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json b/fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json deleted file mode 100644 index 4fa6f730..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main-field-self2/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "." -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main1.js b/fixtures/enhanced_resolve/test/fixtures/main1.js deleted file mode 100644 index 168f2a1e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main1.js +++ /dev/null @@ -1,9 +0,0 @@ -var a = require("./a"); -if (x) { - for (var i = 0; i < 100; i++) { - while (true) require("./b"); - do { - i++; - } while (require("m1/a")()); - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main2.js b/fixtures/enhanced_resolve/test/fixtures/main2.js deleted file mode 100644 index 39f062b1..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main2.js +++ /dev/null @@ -1,12 +0,0 @@ -var 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"); - }); - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/main3.js b/fixtures/enhanced_resolve/test/fixtures/main3.js deleted file mode 100644 index 1c180166..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/main3.js +++ /dev/null @@ -1,4 +0,0 @@ -var a = require("./a"); -require.ensure([], function(require) { - require("./c.js"); -}); diff --git a/fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js b/fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js deleted file mode 100644 index 997c1051..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/multiple_modules/node_modules/m1/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is nested m1/a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/no#fragment/#/#.js b/fixtures/enhanced_resolve/test/fixtures/no#fragment/#/#.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/no.js b/fixtures/enhanced_resolve/test/fixtures/no.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/browser.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/browser.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/main.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json deleted file mode 100644 index c469e1fd..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/browser-module-broken/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "main": "./main.js", - "browser": "./browser.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js deleted file mode 100644 index 549620a5..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "the correct a.js"; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js deleted file mode 100644 index 5db6632e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/node_modules/m1/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = " :) " + require("m2/b.js"); diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js deleted file mode 100644 index d308569d..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step1.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require("m1/a") + require("m1"); diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js deleted file mode 100644 index cb8127e8..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/complexm/step2.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "Step2"; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json deleted file mode 100644 index 8d6dfa56..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash-name/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "dash-name", - "exports": "./index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json deleted file mode 100644 index 4fd8706e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/dash/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "dash", - "exports": "./index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/invalidPackageJson/package.json b/fixtures/enhanced_resolve/test/fixtures/node_modules/invalidPackageJson/package.json deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js deleted file mode 100644 index 46fc8e6c..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is m1/a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js deleted file mode 100644 index 8565c244..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/m1/b.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is m1/b"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js deleted file mode 100644 index 34faaaf5..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/node_modules/m2/b.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "This is m2/b"; diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/file.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/file.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/index.js b/fixtures/enhanced_resolve/test/fixtures/node_modules/recursive-module/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js b/fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js deleted file mode 100644 index 997c1051..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp-a/m2/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function a() { - return "This is nested m1/a"; -}; diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/dir/index.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/dir/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/index.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/main.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/browser.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/browser.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/index.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package-alias/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json deleted file mode 100644 index e20ceaeb..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "main": "main.js", - "browser": { - "./package-alias/index.js": "./package-alias/browser.js", - "module": "pkg/dir/index" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/typescript/index.ts b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg/typescript/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js deleted file mode 100644 index bd816eab..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json b/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json deleted file mode 100644 index 4a1f838e..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/pnp/pkg3/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "@exports-field/core", - "version": "1.0.0", - "exports": { - ".": "./a.js", - "./x": "./a.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/prefer-pnp/alternative-modules/m1/b.js b/fixtures/enhanced_resolve/test/fixtures/prefer-pnp/alternative-modules/m1/b.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.css b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.css deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.js b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json deleted file mode 100644 index 14ab704d..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck1/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "index.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/index.css b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/index.css deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/module.js b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/module.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json b/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json deleted file mode 100644 index ee0eb71b..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/restrictions/node_modules/pck2/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "main": "../../../c.js", - "module": "module.js", - "style": "index.css" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/roots_fall_through/index.js b/fixtures/enhanced_resolve/test/fixtures/roots_fall_through/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/main.js b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json deleted file mode 100644 index 70a0f20f..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack1/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "browser": { - "./index.js": "./main.js" - } -} diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/lib/index.js b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/lib/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/main.js b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/main.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json b/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json deleted file mode 100644 index 2af9e0d1..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/scoped/node_modules/@scope/pack2/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "./main.js" -} diff --git a/fixtures/enhanced_resolve/test/fixtures/shortcutdir.js/a.js b/fixtures/enhanced_resolve/test/fixtures/shortcutdir.js/a.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/b b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/b deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/c b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo-2/c deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/a b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/a deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/b b/fixtures/enhanced_resolve/test/fixtures/yield/a/foo/b deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/b/foo/a b/fixtures/enhanced_resolve/test/fixtures/yield/b/foo/a deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/a b/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/a deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json b/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json deleted file mode 100644 index 0acc4b4c..00000000 --- a/fixtures/enhanced_resolve/test/fixtures/yield/c/foo/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "foo", - "version": "1.0.0", - "browser": { - "./a": false - } -} diff --git "a/fixtures/enhanced_resolve/test/fixtures/\346\265\213\350\257\225.js" "b/fixtures/enhanced_resolve/test/fixtures/\346\265\213\350\257\225.js" deleted file mode 100644 index e69de29b..00000000 diff --git "a/fixtures/misc/\344\270\255\346\226\207/\344\270\255\346\226\207.js" "b/fixtures/misc/\344\270\255\346\226\207/\344\270\255\346\226\207.js" deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/pnp/.gitignore b/fixtures/pnp/.gitignore deleted file mode 100644 index 1783c71a..00000000 --- a/fixtures/pnp/.gitignore +++ /dev/null @@ -1 +0,0 @@ -install_state.gz \ No newline at end of file diff --git a/fixtures/pnp/.pnp.cjs b/fixtures/pnp/.pnp.cjs deleted file mode 100755 index 2a8d1771..00000000 --- a/fixtures/pnp/.pnp.cjs +++ /dev/null @@ -1,7543 +0,0 @@ -#!/usr/bin/env node -/* eslint-disable */ -// @ts-nocheck -"use strict"; - -const RAW_RUNTIME_STATE = -'{\ - "__info": [\ - "This file is automatically generated. Do not touch it, or risk",\ - "your modifications being lost."\ - ],\ - "dependencyTreeRoots": [\ - {\ - "name": "pnp",\ - "reference": "workspace:."\ - }\ - ],\ - "enableTopLevelFallback": true,\ - "ignorePatternData": "(^(?:\\\\.yarn\\\\/sdks(?:\\\\/(?!\\\\.{1,2}(?:\\\\/|$))(?:(?:(?!(?:^|\\\\/)\\\\.{1,2}(?:\\\\/|$)).)*?)|$))$)",\ - "fallbackExclusionList": [\ - ["pnp", ["workspace:."]]\ - ],\ - "fallbackPool": [\ - ],\ - "packageRegistryData": [\ - [null, [\ - [null, {\ - "packageLocation": "./",\ - "packageDependencies": [\ - ["is-even", "npm:1.0.0"],\ - ["is-odd", "npm:3.0.1"]\ - ],\ - "linkType": "SOFT"\ - }]\ - ]],\ - ["is-buffer", [\ - ["npm:1.1.6", {\ - "packageLocation": "./.yarn/cache/is-buffer-npm-1.1.6-08199d9ccc-ae18aa0b6e.zip/node_modules/is-buffer/",\ - "packageDependencies": [\ - ["is-buffer", "npm:1.1.6"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["is-even", [\ - ["npm:1.0.0", {\ - "packageLocation": "./.yarn/cache/is-even-npm-1.0.0-9f726520dc-2728cc2f39.zip/node_modules/is-even/",\ - "packageDependencies": [\ - ["is-even", "npm:1.0.0"],\ - ["is-odd", "npm:0.1.2"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["is-number", [\ - ["npm:3.0.0", {\ - "packageLocation": "./.yarn/cache/is-number-npm-3.0.0-9088035ade-e639c54640.zip/node_modules/is-number/",\ - "packageDependencies": [\ - ["is-number", "npm:3.0.0"],\ - ["kind-of", "npm:3.2.2"]\ - ],\ - "linkType": "HARD"\ - }],\ - ["npm:6.0.0", {\ - "packageLocation": "./.yarn/cache/is-number-npm-6.0.0-30881e83e6-5da4c68401.zip/node_modules/is-number/",\ - "packageDependencies": [\ - ["is-number", "npm:6.0.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["is-odd", [\ - ["npm:0.1.2", {\ - "packageLocation": "./.yarn/cache/is-odd-npm-0.1.2-9d980a9da8-7dc6c6fd00.zip/node_modules/is-odd/",\ - "packageDependencies": [\ - ["is-odd", "npm:0.1.2"],\ - ["is-number", "npm:3.0.0"]\ - ],\ - "linkType": "HARD"\ - }],\ - ["npm:3.0.1", {\ - "packageLocation": "./.yarn/cache/is-odd-npm-3.0.1-93c3c3f41b-89ee2e353c.zip/node_modules/is-odd/",\ - "packageDependencies": [\ - ["is-odd", "npm:3.0.1"],\ - ["is-number", "npm:6.0.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["kind-of", [\ - ["npm:3.2.2", {\ - "packageLocation": "./.yarn/cache/kind-of-npm-3.2.2-7deaffa5f9-7e34bc29d4.zip/node_modules/kind-of/",\ - "packageDependencies": [\ - ["kind-of", "npm:3.2.2"],\ - ["is-buffer", "npm:1.1.6"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ - ["pnp", [\ - ["workspace:.", {\ - "packageLocation": "./",\ - "packageDependencies": [\ - ["pnp", "workspace:."],\ - ["is-even", "npm:1.0.0"],\ - ["is-odd", "npm:3.0.1"]\ - ],\ - "linkType": "SOFT"\ - }]\ - ]]\ - ]\ -}'; - -function $$SETUP_STATE(hydrateRuntimeState, basePath) { - return hydrateRuntimeState(JSON.parse(RAW_RUNTIME_STATE), {basePath: basePath || __dirname}); -} - -const fs = require('fs'); -const path = require('path'); -const crypto = require('crypto'); -const os = require('os'); -const events = require('events'); -const nodeUtils = require('util'); -const stream = require('stream'); -const zlib = require('zlib'); -const require$$0 = require('module'); -const StringDecoder = require('string_decoder'); -const url = require('url'); -const buffer = require('buffer'); -const readline = require('readline'); -const assert = require('assert'); - -const _interopDefaultLegacy = e => e && typeof e === 'object' && 'default' in e ? e : { default: e }; - -function _interopNamespace(e) { - if (e && e.__esModule) return e; - const n = Object.create(null); - if (e) { - for (const k in e) { - if (k !== 'default') { - const d = Object.getOwnPropertyDescriptor(e, k); - Object.defineProperty(n, k, d.get ? d : { - enumerable: true, - get: () => e[k] - }); - } - } - } - n.default = e; - return Object.freeze(n); -} - -const fs__default = /*#__PURE__*/_interopDefaultLegacy(fs); -const path__default = /*#__PURE__*/_interopDefaultLegacy(path); -const nodeUtils__namespace = /*#__PURE__*/_interopNamespace(nodeUtils); -const zlib__default = /*#__PURE__*/_interopDefaultLegacy(zlib); -const require$$0__default = /*#__PURE__*/_interopDefaultLegacy(require$$0); -const StringDecoder__default = /*#__PURE__*/_interopDefaultLegacy(StringDecoder); -const buffer__default = /*#__PURE__*/_interopDefaultLegacy(buffer); -const assert__default = /*#__PURE__*/_interopDefaultLegacy(assert); - -const S_IFMT = 61440; -const S_IFDIR = 16384; -const S_IFREG = 32768; -const S_IFLNK = 40960; -const SAFE_TIME = 456789e3; - -function makeError$1(code, message) { - return Object.assign(new Error(`${code}: ${message}`), { code }); -} -function EBUSY(message) { - return makeError$1(`EBUSY`, message); -} -function ENOSYS(message, reason) { - return makeError$1(`ENOSYS`, `${message}, ${reason}`); -} -function EINVAL(reason) { - return makeError$1(`EINVAL`, `invalid argument, ${reason}`); -} -function EBADF(reason) { - return makeError$1(`EBADF`, `bad file descriptor, ${reason}`); -} -function ENOENT(reason) { - return makeError$1(`ENOENT`, `no such file or directory, ${reason}`); -} -function ENOTDIR(reason) { - return makeError$1(`ENOTDIR`, `not a directory, ${reason}`); -} -function EISDIR(reason) { - return makeError$1(`EISDIR`, `illegal operation on a directory, ${reason}`); -} -function EEXIST(reason) { - return makeError$1(`EEXIST`, `file already exists, ${reason}`); -} -function EROFS(reason) { - return makeError$1(`EROFS`, `read-only filesystem, ${reason}`); -} -function ENOTEMPTY(reason) { - return makeError$1(`ENOTEMPTY`, `directory not empty, ${reason}`); -} -function EOPNOTSUPP(reason) { - return makeError$1(`EOPNOTSUPP`, `operation not supported, ${reason}`); -} -function ERR_DIR_CLOSED() { - return makeError$1(`ERR_DIR_CLOSED`, `Directory handle was closed`); -} - -const DEFAULT_MODE = S_IFREG | 420; -class StatEntry { - constructor() { - this.uid = 0; - this.gid = 0; - this.size = 0; - this.blksize = 0; - this.atimeMs = 0; - this.mtimeMs = 0; - this.ctimeMs = 0; - this.birthtimeMs = 0; - this.atime = new Date(0); - this.mtime = new Date(0); - this.ctime = new Date(0); - this.birthtime = new Date(0); - this.dev = 0; - this.ino = 0; - this.mode = DEFAULT_MODE; - this.nlink = 1; - this.rdev = 0; - this.blocks = 1; - } - isBlockDevice() { - return false; - } - isCharacterDevice() { - return false; - } - isDirectory() { - return (this.mode & S_IFMT) === S_IFDIR; - } - isFIFO() { - return false; - } - isFile() { - return (this.mode & S_IFMT) === S_IFREG; - } - isSocket() { - return false; - } - isSymbolicLink() { - return (this.mode & S_IFMT) === S_IFLNK; - } -} -class BigIntStatsEntry { - constructor() { - this.uid = BigInt(0); - this.gid = BigInt(0); - this.size = BigInt(0); - this.blksize = BigInt(0); - this.atimeMs = BigInt(0); - this.mtimeMs = BigInt(0); - this.ctimeMs = BigInt(0); - this.birthtimeMs = BigInt(0); - this.atimeNs = BigInt(0); - this.mtimeNs = BigInt(0); - this.ctimeNs = BigInt(0); - this.birthtimeNs = BigInt(0); - this.atime = new Date(0); - this.mtime = new Date(0); - this.ctime = new Date(0); - this.birthtime = new Date(0); - this.dev = BigInt(0); - this.ino = BigInt(0); - this.mode = BigInt(DEFAULT_MODE); - this.nlink = BigInt(1); - this.rdev = BigInt(0); - this.blocks = BigInt(1); - } - isBlockDevice() { - return false; - } - isCharacterDevice() { - return false; - } - isDirectory() { - return (this.mode & BigInt(S_IFMT)) === BigInt(S_IFDIR); - } - isFIFO() { - return false; - } - isFile() { - return (this.mode & BigInt(S_IFMT)) === BigInt(S_IFREG); - } - isSocket() { - return false; - } - isSymbolicLink() { - return (this.mode & BigInt(S_IFMT)) === BigInt(S_IFLNK); - } -} -function makeDefaultStats() { - return new StatEntry(); -} -function clearStats(stats) { - for (const key in stats) { - if (Object.hasOwn(stats, key)) { - const element = stats[key]; - if (typeof element === `number`) { - stats[key] = 0; - } else if (typeof element === `bigint`) { - stats[key] = BigInt(0); - } else if (nodeUtils__namespace.types.isDate(element)) { - stats[key] = new Date(0); - } - } - } - return stats; -} -function convertToBigIntStats(stats) { - const bigintStats = new BigIntStatsEntry(); - for (const key in stats) { - if (Object.hasOwn(stats, key)) { - const element = stats[key]; - if (typeof element === `number`) { - bigintStats[key] = BigInt(element); - } else if (nodeUtils__namespace.types.isDate(element)) { - bigintStats[key] = new Date(element); - } - } - } - bigintStats.atimeNs = bigintStats.atimeMs * BigInt(1e6); - bigintStats.mtimeNs = bigintStats.mtimeMs * BigInt(1e6); - bigintStats.ctimeNs = bigintStats.ctimeMs * BigInt(1e6); - bigintStats.birthtimeNs = bigintStats.birthtimeMs * BigInt(1e6); - return bigintStats; -} -function areStatsEqual(a, b) { - if (a.atimeMs !== b.atimeMs) - return false; - if (a.birthtimeMs !== b.birthtimeMs) - return false; - if (a.blksize !== b.blksize) - return false; - if (a.blocks !== b.blocks) - return false; - if (a.ctimeMs !== b.ctimeMs) - return false; - if (a.dev !== b.dev) - return false; - if (a.gid !== b.gid) - return false; - if (a.ino !== b.ino) - return false; - if (a.isBlockDevice() !== b.isBlockDevice()) - return false; - if (a.isCharacterDevice() !== b.isCharacterDevice()) - return false; - if (a.isDirectory() !== b.isDirectory()) - return false; - if (a.isFIFO() !== b.isFIFO()) - return false; - if (a.isFile() !== b.isFile()) - return false; - if (a.isSocket() !== b.isSocket()) - return false; - if (a.isSymbolicLink() !== b.isSymbolicLink()) - return false; - if (a.mode !== b.mode) - return false; - if (a.mtimeMs !== b.mtimeMs) - return false; - if (a.nlink !== b.nlink) - return false; - if (a.rdev !== b.rdev) - return false; - if (a.size !== b.size) - return false; - if (a.uid !== b.uid) - return false; - const aN = a; - const bN = b; - if (aN.atimeNs !== bN.atimeNs) - return false; - if (aN.mtimeNs !== bN.mtimeNs) - return false; - if (aN.ctimeNs !== bN.ctimeNs) - return false; - if (aN.birthtimeNs !== bN.birthtimeNs) - return false; - return true; -} - -const PortablePath = { - root: `/`, - dot: `.`, - parent: `..` -}; -const Filename = { - home: `~`, - nodeModules: `node_modules`, - manifest: `package.json`, - lockfile: `yarn.lock`, - virtual: `__virtual__`, - pnpJs: `.pnp.js`, - pnpCjs: `.pnp.cjs`, - pnpData: `.pnp.data.json`, - pnpEsmLoader: `.pnp.loader.mjs`, - rc: `.yarnrc.yml`, - env: `.env` -}; -const npath = Object.create(path__default.default); -const ppath = Object.create(path__default.default.posix); -npath.cwd = () => process.cwd(); -ppath.cwd = process.platform === `win32` ? () => toPortablePath(process.cwd()) : process.cwd; -if (process.platform === `win32`) { - ppath.resolve = (...segments) => { - if (segments.length > 0 && ppath.isAbsolute(segments[0])) { - return path__default.default.posix.resolve(...segments); - } else { - return path__default.default.posix.resolve(ppath.cwd(), ...segments); - } - }; -} -const contains = function(pathUtils, from, to) { - from = pathUtils.normalize(from); - to = pathUtils.normalize(to); - if (from === to) - return `.`; - if (!from.endsWith(pathUtils.sep)) - from = from + pathUtils.sep; - if (to.startsWith(from)) { - return to.slice(from.length); - } else { - return null; - } -}; -npath.contains = (from, to) => contains(npath, from, to); -ppath.contains = (from, to) => contains(ppath, from, to); -const WINDOWS_PATH_REGEXP = /^([a-zA-Z]:.*)$/; -const UNC_WINDOWS_PATH_REGEXP = /^\/\/(\.\/)?(.*)$/; -const PORTABLE_PATH_REGEXP = /^\/([a-zA-Z]:.*)$/; -const UNC_PORTABLE_PATH_REGEXP = /^\/unc\/(\.dot\/)?(.*)$/; -function fromPortablePathWin32(p) { - let portablePathMatch, uncPortablePathMatch; - if (portablePathMatch = p.match(PORTABLE_PATH_REGEXP)) - p = portablePathMatch[1]; - else if (uncPortablePathMatch = p.match(UNC_PORTABLE_PATH_REGEXP)) - p = `\\\\${uncPortablePathMatch[1] ? `.\\` : ``}${uncPortablePathMatch[2]}`; - else - return p; - return p.replace(/\//g, `\\`); -} -function toPortablePathWin32(p) { - p = p.replace(/\\/g, `/`); - let windowsPathMatch, uncWindowsPathMatch; - if (windowsPathMatch = p.match(WINDOWS_PATH_REGEXP)) - p = `/${windowsPathMatch[1]}`; - else if (uncWindowsPathMatch = p.match(UNC_WINDOWS_PATH_REGEXP)) - p = `/unc/${uncWindowsPathMatch[1] ? `.dot/` : ``}${uncWindowsPathMatch[2]}`; - return p; -} -const toPortablePath = process.platform === `win32` ? toPortablePathWin32 : (p) => p; -const fromPortablePath = process.platform === `win32` ? fromPortablePathWin32 : (p) => p; -npath.fromPortablePath = fromPortablePath; -npath.toPortablePath = toPortablePath; -function convertPath(targetPathUtils, sourcePath) { - return targetPathUtils === npath ? fromPortablePath(sourcePath) : toPortablePath(sourcePath); -} - -const defaultTime = new Date(SAFE_TIME * 1e3); -const defaultTimeMs = defaultTime.getTime(); -async function copyPromise(destinationFs, destination, sourceFs, source, opts) { - const normalizedDestination = destinationFs.pathUtils.normalize(destination); - const normalizedSource = sourceFs.pathUtils.normalize(source); - const prelayout = []; - const postlayout = []; - const { atime, mtime } = opts.stableTime ? { atime: defaultTime, mtime: defaultTime } : await sourceFs.lstatPromise(normalizedSource); - await destinationFs.mkdirpPromise(destinationFs.pathUtils.dirname(destination), { utimes: [atime, mtime] }); - await copyImpl(prelayout, postlayout, destinationFs, normalizedDestination, sourceFs, normalizedSource, { ...opts, didParentExist: true }); - for (const operation of prelayout) - await operation(); - await Promise.all(postlayout.map((operation) => { - return operation(); - })); -} -async function copyImpl(prelayout, postlayout, destinationFs, destination, sourceFs, source, opts) { - const destinationStat = opts.didParentExist ? await maybeLStat(destinationFs, destination) : null; - const sourceStat = await sourceFs.lstatPromise(source); - const { atime, mtime } = opts.stableTime ? { atime: defaultTime, mtime: defaultTime } : sourceStat; - let updated; - switch (true) { - case sourceStat.isDirectory(): - { - updated = await copyFolder(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts); - } - break; - case sourceStat.isFile(): - { - updated = await copyFile(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts); - } - break; - case sourceStat.isSymbolicLink(): - { - updated = await copySymlink(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts); - } - break; - default: { - throw new Error(`Unsupported file type (${sourceStat.mode})`); - } - } - if (opts.linkStrategy?.type !== `HardlinkFromIndex` || !sourceStat.isFile()) { - if (updated || destinationStat?.mtime?.getTime() !== mtime.getTime() || destinationStat?.atime?.getTime() !== atime.getTime()) { - postlayout.push(() => destinationFs.lutimesPromise(destination, atime, mtime)); - updated = true; - } - if (destinationStat === null || (destinationStat.mode & 511) !== (sourceStat.mode & 511)) { - postlayout.push(() => destinationFs.chmodPromise(destination, sourceStat.mode & 511)); - updated = true; - } - } - return updated; -} -async function maybeLStat(baseFs, p) { - try { - return await baseFs.lstatPromise(p); - } catch (e) { - return null; - } -} -async function copyFolder(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts) { - if (destinationStat !== null && !destinationStat.isDirectory()) { - if (opts.overwrite) { - prelayout.push(async () => destinationFs.removePromise(destination)); - destinationStat = null; - } else { - return false; - } - } - let updated = false; - if (destinationStat === null) { - prelayout.push(async () => { - try { - await destinationFs.mkdirPromise(destination, { mode: sourceStat.mode }); - } catch (err) { - if (err.code !== `EEXIST`) { - throw err; - } - } - }); - updated = true; - } - const entries = await sourceFs.readdirPromise(source); - const nextOpts = opts.didParentExist && !destinationStat ? { ...opts, didParentExist: false } : opts; - if (opts.stableSort) { - for (const entry of entries.sort()) { - if (await copyImpl(prelayout, postlayout, destinationFs, destinationFs.pathUtils.join(destination, entry), sourceFs, sourceFs.pathUtils.join(source, entry), nextOpts)) { - updated = true; - } - } - } else { - const entriesUpdateStatus = await Promise.all(entries.map(async (entry) => { - await copyImpl(prelayout, postlayout, destinationFs, destinationFs.pathUtils.join(destination, entry), sourceFs, sourceFs.pathUtils.join(source, entry), nextOpts); - })); - if (entriesUpdateStatus.some((status) => status)) { - updated = true; - } - } - return updated; -} -async function copyFileViaIndex(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts, linkStrategy) { - const sourceHash = await sourceFs.checksumFilePromise(source, { algorithm: `sha1` }); - const defaultMode = 420; - const sourceMode = sourceStat.mode & 511; - const indexFileName = `${sourceHash}${sourceMode !== defaultMode ? sourceMode.toString(8) : ``}`; - const indexPath = destinationFs.pathUtils.join(linkStrategy.indexPath, sourceHash.slice(0, 2), `${indexFileName}.dat`); - let AtomicBehavior; - ((AtomicBehavior2) => { - AtomicBehavior2[AtomicBehavior2["Lock"] = 0] = "Lock"; - AtomicBehavior2[AtomicBehavior2["Rename"] = 1] = "Rename"; - })(AtomicBehavior || (AtomicBehavior = {})); - let atomicBehavior = 1 /* Rename */; - let indexStat = await maybeLStat(destinationFs, indexPath); - if (destinationStat) { - const isDestinationHardlinkedFromIndex = indexStat && destinationStat.dev === indexStat.dev && destinationStat.ino === indexStat.ino; - const isIndexModified = indexStat?.mtimeMs !== defaultTimeMs; - if (isDestinationHardlinkedFromIndex) { - if (isIndexModified && linkStrategy.autoRepair) { - atomicBehavior = 0 /* Lock */; - indexStat = null; - } - } - if (!isDestinationHardlinkedFromIndex) { - if (opts.overwrite) { - prelayout.push(async () => destinationFs.removePromise(destination)); - destinationStat = null; - } else { - return false; - } - } - } - const tempPath = !indexStat && atomicBehavior === 1 /* Rename */ ? `${indexPath}.${Math.floor(Math.random() * 4294967296).toString(16).padStart(8, `0`)}` : null; - let tempPathCleaned = false; - prelayout.push(async () => { - if (!indexStat) { - if (atomicBehavior === 0 /* Lock */) { - await destinationFs.lockPromise(indexPath, async () => { - const content = await sourceFs.readFilePromise(source); - await destinationFs.writeFilePromise(indexPath, content); - }); - } - if (atomicBehavior === 1 /* Rename */ && tempPath) { - const content = await sourceFs.readFilePromise(source); - await destinationFs.writeFilePromise(tempPath, content); - try { - await destinationFs.linkPromise(tempPath, indexPath); - } catch (err) { - if (err.code === `EEXIST`) { - tempPathCleaned = true; - await destinationFs.unlinkPromise(tempPath); - } else { - throw err; - } - } - } - } - if (!destinationStat) { - await destinationFs.linkPromise(indexPath, destination); - } - }); - postlayout.push(async () => { - if (!indexStat) { - await destinationFs.lutimesPromise(indexPath, defaultTime, defaultTime); - if (sourceMode !== defaultMode) { - await destinationFs.chmodPromise(indexPath, sourceMode); - } - } - if (tempPath && !tempPathCleaned) { - await destinationFs.unlinkPromise(tempPath); - } - }); - return false; -} -async function copyFileDirect(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts) { - if (destinationStat !== null) { - if (opts.overwrite) { - prelayout.push(async () => destinationFs.removePromise(destination)); - destinationStat = null; - } else { - return false; - } - } - prelayout.push(async () => { - const content = await sourceFs.readFilePromise(source); - await destinationFs.writeFilePromise(destination, content); - }); - return true; -} -async function copyFile(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts) { - if (opts.linkStrategy?.type === `HardlinkFromIndex`) { - return copyFileViaIndex(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts, opts.linkStrategy); - } else { - return copyFileDirect(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts); - } -} -async function copySymlink(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts) { - if (destinationStat !== null) { - if (opts.overwrite) { - prelayout.push(async () => destinationFs.removePromise(destination)); - destinationStat = null; - } else { - return false; - } - } - prelayout.push(async () => { - await destinationFs.symlinkPromise(convertPath(destinationFs.pathUtils, await sourceFs.readlinkPromise(source)), destination); - }); - return true; -} - -class CustomDir { - constructor(path, nextDirent, opts = {}) { - this.path = path; - this.nextDirent = nextDirent; - this.opts = opts; - this.closed = false; - } - throwIfClosed() { - if (this.closed) { - throw ERR_DIR_CLOSED(); - } - } - async *[Symbol.asyncIterator]() { - try { - let dirent; - while ((dirent = await this.read()) !== null) { - yield dirent; - } - } finally { - await this.close(); - } - } - read(cb) { - const dirent = this.readSync(); - if (typeof cb !== `undefined`) - return cb(null, dirent); - return Promise.resolve(dirent); - } - readSync() { - this.throwIfClosed(); - return this.nextDirent(); - } - close(cb) { - this.closeSync(); - if (typeof cb !== `undefined`) - return cb(null); - return Promise.resolve(); - } - closeSync() { - this.throwIfClosed(); - this.opts.onClose?.(); - this.closed = true; - } -} -function opendir(fakeFs, path, entries, opts) { - const nextDirent = () => { - const filename = entries.shift(); - if (typeof filename === `undefined`) - return null; - const entryPath = fakeFs.pathUtils.join(path, filename); - return Object.assign(fakeFs.statSync(entryPath), { - name: filename, - path: void 0 - }); - }; - return new CustomDir(path, nextDirent, opts); -} - -function assertStatus(current, expected) { - if (current !== expected) { - throw new Error(`Invalid StatWatcher status: expected '${expected}', got '${current}'`); - } -} -class CustomStatWatcher extends events.EventEmitter { - constructor(fakeFs, path, { bigint = false } = {}) { - super(); - this.status = "ready" /* Ready */; - this.changeListeners = /* @__PURE__ */ new Map(); - this.startTimeout = null; - this.fakeFs = fakeFs; - this.path = path; - this.bigint = bigint; - this.lastStats = this.stat(); - } - static create(fakeFs, path, opts) { - const statWatcher = new CustomStatWatcher(fakeFs, path, opts); - statWatcher.start(); - return statWatcher; - } - start() { - assertStatus(this.status, "ready" /* Ready */); - this.status = "running" /* Running */; - this.startTimeout = setTimeout(() => { - this.startTimeout = null; - if (!this.fakeFs.existsSync(this.path)) { - this.emit("change" /* Change */, this.lastStats, this.lastStats); - } - }, 3); - } - stop() { - assertStatus(this.status, "running" /* Running */); - this.status = "stopped" /* Stopped */; - if (this.startTimeout !== null) { - clearTimeout(this.startTimeout); - this.startTimeout = null; - } - this.emit("stop" /* Stop */); - } - stat() { - try { - return this.fakeFs.statSync(this.path, { bigint: this.bigint }); - } catch (error) { - const statInstance = this.bigint ? new BigIntStatsEntry() : new StatEntry(); - return clearStats(statInstance); - } - } - makeInterval(opts) { - const interval = setInterval(() => { - const currentStats = this.stat(); - const previousStats = this.lastStats; - if (areStatsEqual(currentStats, previousStats)) - return; - this.lastStats = currentStats; - this.emit("change" /* Change */, currentStats, previousStats); - }, opts.interval); - return opts.persistent ? interval : interval.unref(); - } - registerChangeListener(listener, opts) { - this.addListener("change" /* Change */, listener); - this.changeListeners.set(listener, this.makeInterval(opts)); - } - unregisterChangeListener(listener) { - this.removeListener("change" /* Change */, listener); - const interval = this.changeListeners.get(listener); - if (typeof interval !== `undefined`) - clearInterval(interval); - this.changeListeners.delete(listener); - } - unregisterAllChangeListeners() { - for (const listener of this.changeListeners.keys()) { - this.unregisterChangeListener(listener); - } - } - hasChangeListeners() { - return this.changeListeners.size > 0; - } - ref() { - for (const interval of this.changeListeners.values()) - interval.ref(); - return this; - } - unref() { - for (const interval of this.changeListeners.values()) - interval.unref(); - return this; - } -} - -const statWatchersByFakeFS = /* @__PURE__ */ new WeakMap(); -function watchFile(fakeFs, path, a, b) { - let bigint; - let persistent; - let interval; - let listener; - switch (typeof a) { - case `function`: - { - bigint = false; - persistent = true; - interval = 5007; - listener = a; - } - break; - default: - { - ({ - bigint = false, - persistent = true, - interval = 5007 - } = a); - listener = b; - } - break; - } - let statWatchers = statWatchersByFakeFS.get(fakeFs); - if (typeof statWatchers === `undefined`) - statWatchersByFakeFS.set(fakeFs, statWatchers = /* @__PURE__ */ new Map()); - let statWatcher = statWatchers.get(path); - if (typeof statWatcher === `undefined`) { - statWatcher = CustomStatWatcher.create(fakeFs, path, { bigint }); - statWatchers.set(path, statWatcher); - } - statWatcher.registerChangeListener(listener, { persistent, interval }); - return statWatcher; -} -function unwatchFile(fakeFs, path, cb) { - const statWatchers = statWatchersByFakeFS.get(fakeFs); - if (typeof statWatchers === `undefined`) - return; - const statWatcher = statWatchers.get(path); - if (typeof statWatcher === `undefined`) - return; - if (typeof cb === `undefined`) - statWatcher.unregisterAllChangeListeners(); - else - statWatcher.unregisterChangeListener(cb); - if (!statWatcher.hasChangeListeners()) { - statWatcher.stop(); - statWatchers.delete(path); - } -} -function unwatchAllFiles(fakeFs) { - const statWatchers = statWatchersByFakeFS.get(fakeFs); - if (typeof statWatchers === `undefined`) - return; - for (const path of statWatchers.keys()) { - unwatchFile(fakeFs, path); - } -} - -class FakeFS { - constructor(pathUtils) { - this.pathUtils = pathUtils; - } - async *genTraversePromise(init, { stableSort = false } = {}) { - const stack = [init]; - while (stack.length > 0) { - const p = stack.shift(); - const entry = await this.lstatPromise(p); - if (entry.isDirectory()) { - const entries = await this.readdirPromise(p); - if (stableSort) { - for (const entry2 of entries.sort()) { - stack.push(this.pathUtils.join(p, entry2)); - } - } else { - throw new Error(`Not supported`); - } - } else { - yield p; - } - } - } - async checksumFilePromise(path, { algorithm = `sha512` } = {}) { - const fd = await this.openPromise(path, `r`); - try { - const CHUNK_SIZE = 65536; - const chunk = Buffer.allocUnsafeSlow(CHUNK_SIZE); - const hash = crypto.createHash(algorithm); - let bytesRead = 0; - while ((bytesRead = await this.readPromise(fd, chunk, 0, CHUNK_SIZE)) !== 0) - hash.update(bytesRead === CHUNK_SIZE ? chunk : chunk.slice(0, bytesRead)); - return hash.digest(`hex`); - } finally { - await this.closePromise(fd); - } - } - async removePromise(p, { recursive = true, maxRetries = 5 } = {}) { - let stat; - try { - stat = await this.lstatPromise(p); - } catch (error) { - if (error.code === `ENOENT`) { - return; - } else { - throw error; - } - } - if (stat.isDirectory()) { - if (recursive) { - const entries = await this.readdirPromise(p); - await Promise.all(entries.map((entry) => { - return this.removePromise(this.pathUtils.resolve(p, entry)); - })); - } - for (let t = 0; t <= maxRetries; t++) { - try { - await this.rmdirPromise(p); - break; - } catch (error) { - if (error.code !== `EBUSY` && error.code !== `ENOTEMPTY`) { - throw error; - } else if (t < maxRetries) { - await new Promise((resolve) => setTimeout(resolve, t * 100)); - } - } - } - } else { - await this.unlinkPromise(p); - } - } - removeSync(p, { recursive = true } = {}) { - let stat; - try { - stat = this.lstatSync(p); - } catch (error) { - if (error.code === `ENOENT`) { - return; - } else { - throw error; - } - } - if (stat.isDirectory()) { - if (recursive) - for (const entry of this.readdirSync(p)) - this.removeSync(this.pathUtils.resolve(p, entry)); - this.rmdirSync(p); - } else { - this.unlinkSync(p); - } - } - async mkdirpPromise(p, { chmod, utimes } = {}) { - p = this.resolve(p); - if (p === this.pathUtils.dirname(p)) - return void 0; - const parts = p.split(this.pathUtils.sep); - let createdDirectory; - for (let u = 2; u <= parts.length; ++u) { - const subPath = parts.slice(0, u).join(this.pathUtils.sep); - if (!this.existsSync(subPath)) { - try { - await this.mkdirPromise(subPath); - } catch (error) { - if (error.code === `EEXIST`) { - continue; - } else { - throw error; - } - } - createdDirectory ??= subPath; - if (chmod != null) - await this.chmodPromise(subPath, chmod); - if (utimes != null) { - await this.utimesPromise(subPath, utimes[0], utimes[1]); - } else { - const parentStat = await this.statPromise(this.pathUtils.dirname(subPath)); - await this.utimesPromise(subPath, parentStat.atime, parentStat.mtime); - } - } - } - return createdDirectory; - } - mkdirpSync(p, { chmod, utimes } = {}) { - p = this.resolve(p); - if (p === this.pathUtils.dirname(p)) - return void 0; - const parts = p.split(this.pathUtils.sep); - let createdDirectory; - for (let u = 2; u <= parts.length; ++u) { - const subPath = parts.slice(0, u).join(this.pathUtils.sep); - if (!this.existsSync(subPath)) { - try { - this.mkdirSync(subPath); - } catch (error) { - if (error.code === `EEXIST`) { - continue; - } else { - throw error; - } - } - createdDirectory ??= subPath; - if (chmod != null) - this.chmodSync(subPath, chmod); - if (utimes != null) { - this.utimesSync(subPath, utimes[0], utimes[1]); - } else { - const parentStat = this.statSync(this.pathUtils.dirname(subPath)); - this.utimesSync(subPath, parentStat.atime, parentStat.mtime); - } - } - } - return createdDirectory; - } - async copyPromise(destination, source, { baseFs = this, overwrite = true, stableSort = false, stableTime = false, linkStrategy = null } = {}) { - return await copyPromise(this, destination, baseFs, source, { overwrite, stableSort, stableTime, linkStrategy }); - } - copySync(destination, source, { baseFs = this, overwrite = true } = {}) { - const stat = baseFs.lstatSync(source); - const exists = this.existsSync(destination); - if (stat.isDirectory()) { - this.mkdirpSync(destination); - const directoryListing = baseFs.readdirSync(source); - for (const entry of directoryListing) { - this.copySync(this.pathUtils.join(destination, entry), baseFs.pathUtils.join(source, entry), { baseFs, overwrite }); - } - } else if (stat.isFile()) { - if (!exists || overwrite) { - if (exists) - this.removeSync(destination); - const content = baseFs.readFileSync(source); - this.writeFileSync(destination, content); - } - } else if (stat.isSymbolicLink()) { - if (!exists || overwrite) { - if (exists) - this.removeSync(destination); - const target = baseFs.readlinkSync(source); - this.symlinkSync(convertPath(this.pathUtils, target), destination); - } - } else { - throw new Error(`Unsupported file type (file: ${source}, mode: 0o${stat.mode.toString(8).padStart(6, `0`)})`); - } - const mode = stat.mode & 511; - this.chmodSync(destination, mode); - } - async changeFilePromise(p, content, opts = {}) { - if (Buffer.isBuffer(content)) { - return this.changeFileBufferPromise(p, content, opts); - } else { - return this.changeFileTextPromise(p, content, opts); - } - } - async changeFileBufferPromise(p, content, { mode } = {}) { - let current = Buffer.alloc(0); - try { - current = await this.readFilePromise(p); - } catch (error) { - } - if (Buffer.compare(current, content) === 0) - return; - await this.writeFilePromise(p, content, { mode }); - } - async changeFileTextPromise(p, content, { automaticNewlines, mode } = {}) { - let current = ``; - try { - current = await this.readFilePromise(p, `utf8`); - } catch (error) { - } - const normalizedContent = automaticNewlines ? normalizeLineEndings(current, content) : content; - if (current === normalizedContent) - return; - await this.writeFilePromise(p, normalizedContent, { mode }); - } - changeFileSync(p, content, opts = {}) { - if (Buffer.isBuffer(content)) { - return this.changeFileBufferSync(p, content, opts); - } else { - return this.changeFileTextSync(p, content, opts); - } - } - changeFileBufferSync(p, content, { mode } = {}) { - let current = Buffer.alloc(0); - try { - current = this.readFileSync(p); - } catch (error) { - } - if (Buffer.compare(current, content) === 0) - return; - this.writeFileSync(p, content, { mode }); - } - changeFileTextSync(p, content, { automaticNewlines = false, mode } = {}) { - let current = ``; - try { - current = this.readFileSync(p, `utf8`); - } catch (error) { - } - const normalizedContent = automaticNewlines ? normalizeLineEndings(current, content) : content; - if (current === normalizedContent) - return; - this.writeFileSync(p, normalizedContent, { mode }); - } - async movePromise(fromP, toP) { - try { - await this.renamePromise(fromP, toP); - } catch (error) { - if (error.code === `EXDEV`) { - await this.copyPromise(toP, fromP); - await this.removePromise(fromP); - } else { - throw error; - } - } - } - moveSync(fromP, toP) { - try { - this.renameSync(fromP, toP); - } catch (error) { - if (error.code === `EXDEV`) { - this.copySync(toP, fromP); - this.removeSync(fromP); - } else { - throw error; - } - } - } - async lockPromise(affectedPath, callback) { - const lockPath = `${affectedPath}.flock`; - const interval = 1e3 / 60; - const startTime = Date.now(); - let fd = null; - const isAlive = async () => { - let pid; - try { - [pid] = await this.readJsonPromise(lockPath); - } catch (error) { - return Date.now() - startTime < 500; - } - try { - process.kill(pid, 0); - return true; - } catch (error) { - return false; - } - }; - while (fd === null) { - try { - fd = await this.openPromise(lockPath, `wx`); - } catch (error) { - if (error.code === `EEXIST`) { - if (!await isAlive()) { - try { - await this.unlinkPromise(lockPath); - continue; - } catch (error2) { - } - } - if (Date.now() - startTime < 60 * 1e3) { - await new Promise((resolve) => setTimeout(resolve, interval)); - } else { - throw new Error(`Couldn't acquire a lock in a reasonable time (via ${lockPath})`); - } - } else { - throw error; - } - } - } - await this.writePromise(fd, JSON.stringify([process.pid])); - try { - return await callback(); - } finally { - try { - await this.closePromise(fd); - await this.unlinkPromise(lockPath); - } catch (error) { - } - } - } - async readJsonPromise(p) { - const content = await this.readFilePromise(p, `utf8`); - try { - return JSON.parse(content); - } catch (error) { - error.message += ` (in ${p})`; - throw error; - } - } - readJsonSync(p) { - const content = this.readFileSync(p, `utf8`); - try { - return JSON.parse(content); - } catch (error) { - error.message += ` (in ${p})`; - throw error; - } - } - async writeJsonPromise(p, data, { compact = false } = {}) { - const space = compact ? 0 : 2; - return await this.writeFilePromise(p, `${JSON.stringify(data, null, space)} -`); - } - writeJsonSync(p, data, { compact = false } = {}) { - const space = compact ? 0 : 2; - return this.writeFileSync(p, `${JSON.stringify(data, null, space)} -`); - } - async preserveTimePromise(p, cb) { - const stat = await this.lstatPromise(p); - const result = await cb(); - if (typeof result !== `undefined`) - p = result; - await this.lutimesPromise(p, stat.atime, stat.mtime); - } - async preserveTimeSync(p, cb) { - const stat = this.lstatSync(p); - const result = cb(); - if (typeof result !== `undefined`) - p = result; - this.lutimesSync(p, stat.atime, stat.mtime); - } -} -class BasePortableFakeFS extends FakeFS { - constructor() { - super(ppath); - } -} -function getEndOfLine(content) { - const matches = content.match(/\r?\n/g); - if (matches === null) - return os.EOL; - const crlf = matches.filter((nl) => nl === `\r -`).length; - const lf = matches.length - crlf; - return crlf > lf ? `\r -` : ` -`; -} -function normalizeLineEndings(originalContent, newContent) { - return newContent.replace(/\r?\n/g, getEndOfLine(originalContent)); -} - -class ProxiedFS extends FakeFS { - getExtractHint(hints) { - return this.baseFs.getExtractHint(hints); - } - resolve(path) { - return this.mapFromBase(this.baseFs.resolve(this.mapToBase(path))); - } - getRealPath() { - return this.mapFromBase(this.baseFs.getRealPath()); - } - async openPromise(p, flags, mode) { - return this.baseFs.openPromise(this.mapToBase(p), flags, mode); - } - openSync(p, flags, mode) { - return this.baseFs.openSync(this.mapToBase(p), flags, mode); - } - async opendirPromise(p, opts) { - return Object.assign(await this.baseFs.opendirPromise(this.mapToBase(p), opts), { path: p }); - } - opendirSync(p, opts) { - return Object.assign(this.baseFs.opendirSync(this.mapToBase(p), opts), { path: p }); - } - async readPromise(fd, buffer, offset, length, position) { - return await this.baseFs.readPromise(fd, buffer, offset, length, position); - } - readSync(fd, buffer, offset, length, position) { - return this.baseFs.readSync(fd, buffer, offset, length, position); - } - async writePromise(fd, buffer, offset, length, position) { - if (typeof buffer === `string`) { - return await this.baseFs.writePromise(fd, buffer, offset); - } else { - return await this.baseFs.writePromise(fd, buffer, offset, length, position); - } - } - writeSync(fd, buffer, offset, length, position) { - if (typeof buffer === `string`) { - return this.baseFs.writeSync(fd, buffer, offset); - } else { - return this.baseFs.writeSync(fd, buffer, offset, length, position); - } - } - async closePromise(fd) { - return this.baseFs.closePromise(fd); - } - closeSync(fd) { - this.baseFs.closeSync(fd); - } - createReadStream(p, opts) { - return this.baseFs.createReadStream(p !== null ? this.mapToBase(p) : p, opts); - } - createWriteStream(p, opts) { - return this.baseFs.createWriteStream(p !== null ? this.mapToBase(p) : p, opts); - } - async realpathPromise(p) { - return this.mapFromBase(await this.baseFs.realpathPromise(this.mapToBase(p))); - } - realpathSync(p) { - return this.mapFromBase(this.baseFs.realpathSync(this.mapToBase(p))); - } - async existsPromise(p) { - return this.baseFs.existsPromise(this.mapToBase(p)); - } - existsSync(p) { - return this.baseFs.existsSync(this.mapToBase(p)); - } - accessSync(p, mode) { - return this.baseFs.accessSync(this.mapToBase(p), mode); - } - async accessPromise(p, mode) { - return this.baseFs.accessPromise(this.mapToBase(p), mode); - } - async statPromise(p, opts) { - return this.baseFs.statPromise(this.mapToBase(p), opts); - } - statSync(p, opts) { - return this.baseFs.statSync(this.mapToBase(p), opts); - } - async fstatPromise(fd, opts) { - return this.baseFs.fstatPromise(fd, opts); - } - fstatSync(fd, opts) { - return this.baseFs.fstatSync(fd, opts); - } - lstatPromise(p, opts) { - return this.baseFs.lstatPromise(this.mapToBase(p), opts); - } - lstatSync(p, opts) { - return this.baseFs.lstatSync(this.mapToBase(p), opts); - } - async fchmodPromise(fd, mask) { - return this.baseFs.fchmodPromise(fd, mask); - } - fchmodSync(fd, mask) { - return this.baseFs.fchmodSync(fd, mask); - } - async chmodPromise(p, mask) { - return this.baseFs.chmodPromise(this.mapToBase(p), mask); - } - chmodSync(p, mask) { - return this.baseFs.chmodSync(this.mapToBase(p), mask); - } - async fchownPromise(fd, uid, gid) { - return this.baseFs.fchownPromise(fd, uid, gid); - } - fchownSync(fd, uid, gid) { - return this.baseFs.fchownSync(fd, uid, gid); - } - async chownPromise(p, uid, gid) { - return this.baseFs.chownPromise(this.mapToBase(p), uid, gid); - } - chownSync(p, uid, gid) { - return this.baseFs.chownSync(this.mapToBase(p), uid, gid); - } - async renamePromise(oldP, newP) { - return this.baseFs.renamePromise(this.mapToBase(oldP), this.mapToBase(newP)); - } - renameSync(oldP, newP) { - return this.baseFs.renameSync(this.mapToBase(oldP), this.mapToBase(newP)); - } - async copyFilePromise(sourceP, destP, flags = 0) { - return this.baseFs.copyFilePromise(this.mapToBase(sourceP), this.mapToBase(destP), flags); - } - copyFileSync(sourceP, destP, flags = 0) { - return this.baseFs.copyFileSync(this.mapToBase(sourceP), this.mapToBase(destP), flags); - } - async appendFilePromise(p, content, opts) { - return this.baseFs.appendFilePromise(this.fsMapToBase(p), content, opts); - } - appendFileSync(p, content, opts) { - return this.baseFs.appendFileSync(this.fsMapToBase(p), content, opts); - } - async writeFilePromise(p, content, opts) { - return this.baseFs.writeFilePromise(this.fsMapToBase(p), content, opts); - } - writeFileSync(p, content, opts) { - return this.baseFs.writeFileSync(this.fsMapToBase(p), content, opts); - } - async unlinkPromise(p) { - return this.baseFs.unlinkPromise(this.mapToBase(p)); - } - unlinkSync(p) { - return this.baseFs.unlinkSync(this.mapToBase(p)); - } - async utimesPromise(p, atime, mtime) { - return this.baseFs.utimesPromise(this.mapToBase(p), atime, mtime); - } - utimesSync(p, atime, mtime) { - return this.baseFs.utimesSync(this.mapToBase(p), atime, mtime); - } - async lutimesPromise(p, atime, mtime) { - return this.baseFs.lutimesPromise(this.mapToBase(p), atime, mtime); - } - lutimesSync(p, atime, mtime) { - return this.baseFs.lutimesSync(this.mapToBase(p), atime, mtime); - } - async mkdirPromise(p, opts) { - return this.baseFs.mkdirPromise(this.mapToBase(p), opts); - } - mkdirSync(p, opts) { - return this.baseFs.mkdirSync(this.mapToBase(p), opts); - } - async rmdirPromise(p, opts) { - return this.baseFs.rmdirPromise(this.mapToBase(p), opts); - } - rmdirSync(p, opts) { - return this.baseFs.rmdirSync(this.mapToBase(p), opts); - } - async rmPromise(p, opts) { - return this.baseFs.rmPromise(this.mapToBase(p), opts); - } - rmSync(p, opts) { - return this.baseFs.rmSync(this.mapToBase(p), opts); - } - async linkPromise(existingP, newP) { - return this.baseFs.linkPromise(this.mapToBase(existingP), this.mapToBase(newP)); - } - linkSync(existingP, newP) { - return this.baseFs.linkSync(this.mapToBase(existingP), this.mapToBase(newP)); - } - async symlinkPromise(target, p, type) { - const mappedP = this.mapToBase(p); - if (this.pathUtils.isAbsolute(target)) - return this.baseFs.symlinkPromise(this.mapToBase(target), mappedP, type); - const mappedAbsoluteTarget = this.mapToBase(this.pathUtils.join(this.pathUtils.dirname(p), target)); - const mappedTarget = this.baseFs.pathUtils.relative(this.baseFs.pathUtils.dirname(mappedP), mappedAbsoluteTarget); - return this.baseFs.symlinkPromise(mappedTarget, mappedP, type); - } - symlinkSync(target, p, type) { - const mappedP = this.mapToBase(p); - if (this.pathUtils.isAbsolute(target)) - return this.baseFs.symlinkSync(this.mapToBase(target), mappedP, type); - const mappedAbsoluteTarget = this.mapToBase(this.pathUtils.join(this.pathUtils.dirname(p), target)); - const mappedTarget = this.baseFs.pathUtils.relative(this.baseFs.pathUtils.dirname(mappedP), mappedAbsoluteTarget); - return this.baseFs.symlinkSync(mappedTarget, mappedP, type); - } - async readFilePromise(p, encoding) { - return this.baseFs.readFilePromise(this.fsMapToBase(p), encoding); - } - readFileSync(p, encoding) { - return this.baseFs.readFileSync(this.fsMapToBase(p), encoding); - } - readdirPromise(p, opts) { - return this.baseFs.readdirPromise(this.mapToBase(p), opts); - } - readdirSync(p, opts) { - return this.baseFs.readdirSync(this.mapToBase(p), opts); - } - async readlinkPromise(p) { - return this.mapFromBase(await this.baseFs.readlinkPromise(this.mapToBase(p))); - } - readlinkSync(p) { - return this.mapFromBase(this.baseFs.readlinkSync(this.mapToBase(p))); - } - async truncatePromise(p, len) { - return this.baseFs.truncatePromise(this.mapToBase(p), len); - } - truncateSync(p, len) { - return this.baseFs.truncateSync(this.mapToBase(p), len); - } - async ftruncatePromise(fd, len) { - return this.baseFs.ftruncatePromise(fd, len); - } - ftruncateSync(fd, len) { - return this.baseFs.ftruncateSync(fd, len); - } - watch(p, a, b) { - return this.baseFs.watch( - this.mapToBase(p), - a, - b - ); - } - watchFile(p, a, b) { - return this.baseFs.watchFile( - this.mapToBase(p), - a, - b - ); - } - unwatchFile(p, cb) { - return this.baseFs.unwatchFile(this.mapToBase(p), cb); - } - fsMapToBase(p) { - if (typeof p === `number`) { - return p; - } else { - return this.mapToBase(p); - } - } -} - -function direntToPortable(dirent) { - const portableDirent = dirent; - if (typeof dirent.path === `string`) - portableDirent.path = npath.toPortablePath(dirent.path); - return portableDirent; -} -class NodeFS extends BasePortableFakeFS { - constructor(realFs = fs__default.default) { - super(); - this.realFs = realFs; - } - getExtractHint() { - return false; - } - getRealPath() { - return PortablePath.root; - } - resolve(p) { - return ppath.resolve(p); - } - async openPromise(p, flags, mode) { - return await new Promise((resolve, reject) => { - this.realFs.open(npath.fromPortablePath(p), flags, mode, this.makeCallback(resolve, reject)); - }); - } - openSync(p, flags, mode) { - return this.realFs.openSync(npath.fromPortablePath(p), flags, mode); - } - async opendirPromise(p, opts) { - return await new Promise((resolve, reject) => { - if (typeof opts !== `undefined`) { - this.realFs.opendir(npath.fromPortablePath(p), opts, this.makeCallback(resolve, reject)); - } else { - this.realFs.opendir(npath.fromPortablePath(p), this.makeCallback(resolve, reject)); - } - }).then((dir) => { - const dirWithFixedPath = dir; - Object.defineProperty(dirWithFixedPath, `path`, { - value: p, - configurable: true, - writable: true - }); - return dirWithFixedPath; - }); - } - opendirSync(p, opts) { - const dir = typeof opts !== `undefined` ? this.realFs.opendirSync(npath.fromPortablePath(p), opts) : this.realFs.opendirSync(npath.fromPortablePath(p)); - const dirWithFixedPath = dir; - Object.defineProperty(dirWithFixedPath, `path`, { - value: p, - configurable: true, - writable: true - }); - return dirWithFixedPath; - } - async readPromise(fd, buffer, offset = 0, length = 0, position = -1) { - return await new Promise((resolve, reject) => { - this.realFs.read(fd, buffer, offset, length, position, (error, bytesRead) => { - if (error) { - reject(error); - } else { - resolve(bytesRead); - } - }); - }); - } - readSync(fd, buffer, offset, length, position) { - return this.realFs.readSync(fd, buffer, offset, length, position); - } - async writePromise(fd, buffer, offset, length, position) { - return await new Promise((resolve, reject) => { - if (typeof buffer === `string`) { - return this.realFs.write(fd, buffer, offset, this.makeCallback(resolve, reject)); - } else { - return this.realFs.write(fd, buffer, offset, length, position, this.makeCallback(resolve, reject)); - } - }); - } - writeSync(fd, buffer, offset, length, position) { - if (typeof buffer === `string`) { - return this.realFs.writeSync(fd, buffer, offset); - } else { - return this.realFs.writeSync(fd, buffer, offset, length, position); - } - } - async closePromise(fd) { - await new Promise((resolve, reject) => { - this.realFs.close(fd, this.makeCallback(resolve, reject)); - }); - } - closeSync(fd) { - this.realFs.closeSync(fd); - } - createReadStream(p, opts) { - const realPath = p !== null ? npath.fromPortablePath(p) : p; - return this.realFs.createReadStream(realPath, opts); - } - createWriteStream(p, opts) { - const realPath = p !== null ? npath.fromPortablePath(p) : p; - return this.realFs.createWriteStream(realPath, opts); - } - async realpathPromise(p) { - return await new Promise((resolve, reject) => { - this.realFs.realpath(npath.fromPortablePath(p), {}, this.makeCallback(resolve, reject)); - }).then((path) => { - return npath.toPortablePath(path); - }); - } - realpathSync(p) { - return npath.toPortablePath(this.realFs.realpathSync(npath.fromPortablePath(p), {})); - } - async existsPromise(p) { - return await new Promise((resolve) => { - this.realFs.exists(npath.fromPortablePath(p), resolve); - }); - } - accessSync(p, mode) { - return this.realFs.accessSync(npath.fromPortablePath(p), mode); - } - async accessPromise(p, mode) { - return await new Promise((resolve, reject) => { - this.realFs.access(npath.fromPortablePath(p), mode, this.makeCallback(resolve, reject)); - }); - } - existsSync(p) { - return this.realFs.existsSync(npath.fromPortablePath(p)); - } - async statPromise(p, opts) { - return await new Promise((resolve, reject) => { - if (opts) { - this.realFs.stat(npath.fromPortablePath(p), opts, this.makeCallback(resolve, reject)); - } else { - this.realFs.stat(npath.fromPortablePath(p), this.makeCallback(resolve, reject)); - } - }); - } - statSync(p, opts) { - if (opts) { - return this.realFs.statSync(npath.fromPortablePath(p), opts); - } else { - return this.realFs.statSync(npath.fromPortablePath(p)); - } - } - async fstatPromise(fd, opts) { - return await new Promise((resolve, reject) => { - if (opts) { - this.realFs.fstat(fd, opts, this.makeCallback(resolve, reject)); - } else { - this.realFs.fstat(fd, this.makeCallback(resolve, reject)); - } - }); - } - fstatSync(fd, opts) { - if (opts) { - return this.realFs.fstatSync(fd, opts); - } else { - return this.realFs.fstatSync(fd); - } - } - async lstatPromise(p, opts) { - return await new Promise((resolve, reject) => { - if (opts) { - this.realFs.lstat(npath.fromPortablePath(p), opts, this.makeCallback(resolve, reject)); - } else { - this.realFs.lstat(npath.fromPortablePath(p), this.makeCallback(resolve, reject)); - } - }); - } - lstatSync(p, opts) { - if (opts) { - return this.realFs.lstatSync(npath.fromPortablePath(p), opts); - } else { - return this.realFs.lstatSync(npath.fromPortablePath(p)); - } - } - async fchmodPromise(fd, mask) { - return await new Promise((resolve, reject) => { - this.realFs.fchmod(fd, mask, this.makeCallback(resolve, reject)); - }); - } - fchmodSync(fd, mask) { - return this.realFs.fchmodSync(fd, mask); - } - async chmodPromise(p, mask) { - return await new Promise((resolve, reject) => { - this.realFs.chmod(npath.fromPortablePath(p), mask, this.makeCallback(resolve, reject)); - }); - } - chmodSync(p, mask) { - return this.realFs.chmodSync(npath.fromPortablePath(p), mask); - } - async fchownPromise(fd, uid, gid) { - return await new Promise((resolve, reject) => { - this.realFs.fchown(fd, uid, gid, this.makeCallback(resolve, reject)); - }); - } - fchownSync(fd, uid, gid) { - return this.realFs.fchownSync(fd, uid, gid); - } - async chownPromise(p, uid, gid) { - return await new Promise((resolve, reject) => { - this.realFs.chown(npath.fromPortablePath(p), uid, gid, this.makeCallback(resolve, reject)); - }); - } - chownSync(p, uid, gid) { - return this.realFs.chownSync(npath.fromPortablePath(p), uid, gid); - } - async renamePromise(oldP, newP) { - return await new Promise((resolve, reject) => { - this.realFs.rename(npath.fromPortablePath(oldP), npath.fromPortablePath(newP), this.makeCallback(resolve, reject)); - }); - } - renameSync(oldP, newP) { - return this.realFs.renameSync(npath.fromPortablePath(oldP), npath.fromPortablePath(newP)); - } - async copyFilePromise(sourceP, destP, flags = 0) { - return await new Promise((resolve, reject) => { - this.realFs.copyFile(npath.fromPortablePath(sourceP), npath.fromPortablePath(destP), flags, this.makeCallback(resolve, reject)); - }); - } - copyFileSync(sourceP, destP, flags = 0) { - return this.realFs.copyFileSync(npath.fromPortablePath(sourceP), npath.fromPortablePath(destP), flags); - } - async appendFilePromise(p, content, opts) { - return await new Promise((resolve, reject) => { - const fsNativePath = typeof p === `string` ? npath.fromPortablePath(p) : p; - if (opts) { - this.realFs.appendFile(fsNativePath, content, opts, this.makeCallback(resolve, reject)); - } else { - this.realFs.appendFile(fsNativePath, content, this.makeCallback(resolve, reject)); - } - }); - } - appendFileSync(p, content, opts) { - const fsNativePath = typeof p === `string` ? npath.fromPortablePath(p) : p; - if (opts) { - this.realFs.appendFileSync(fsNativePath, content, opts); - } else { - this.realFs.appendFileSync(fsNativePath, content); - } - } - async writeFilePromise(p, content, opts) { - return await new Promise((resolve, reject) => { - const fsNativePath = typeof p === `string` ? npath.fromPortablePath(p) : p; - if (opts) { - this.realFs.writeFile(fsNativePath, content, opts, this.makeCallback(resolve, reject)); - } else { - this.realFs.writeFile(fsNativePath, content, this.makeCallback(resolve, reject)); - } - }); - } - writeFileSync(p, content, opts) { - const fsNativePath = typeof p === `string` ? npath.fromPortablePath(p) : p; - if (opts) { - this.realFs.writeFileSync(fsNativePath, content, opts); - } else { - this.realFs.writeFileSync(fsNativePath, content); - } - } - async unlinkPromise(p) { - return await new Promise((resolve, reject) => { - this.realFs.unlink(npath.fromPortablePath(p), this.makeCallback(resolve, reject)); - }); - } - unlinkSync(p) { - return this.realFs.unlinkSync(npath.fromPortablePath(p)); - } - async utimesPromise(p, atime, mtime) { - return await new Promise((resolve, reject) => { - this.realFs.utimes(npath.fromPortablePath(p), atime, mtime, this.makeCallback(resolve, reject)); - }); - } - utimesSync(p, atime, mtime) { - this.realFs.utimesSync(npath.fromPortablePath(p), atime, mtime); - } - async lutimesPromise(p, atime, mtime) { - return await new Promise((resolve, reject) => { - this.realFs.lutimes(npath.fromPortablePath(p), atime, mtime, this.makeCallback(resolve, reject)); - }); - } - lutimesSync(p, atime, mtime) { - this.realFs.lutimesSync(npath.fromPortablePath(p), atime, mtime); - } - async mkdirPromise(p, opts) { - return await new Promise((resolve, reject) => { - this.realFs.mkdir(npath.fromPortablePath(p), opts, this.makeCallback(resolve, reject)); - }); - } - mkdirSync(p, opts) { - return this.realFs.mkdirSync(npath.fromPortablePath(p), opts); - } - async rmdirPromise(p, opts) { - return await new Promise((resolve, reject) => { - if (opts) { - this.realFs.rmdir(npath.fromPortablePath(p), opts, this.makeCallback(resolve, reject)); - } else { - this.realFs.rmdir(npath.fromPortablePath(p), this.makeCallback(resolve, reject)); - } - }); - } - rmdirSync(p, opts) { - return this.realFs.rmdirSync(npath.fromPortablePath(p), opts); - } - async rmPromise(p, opts) { - return await new Promise((resolve, reject) => { - if (opts) { - this.realFs.rm(npath.fromPortablePath(p), opts, this.makeCallback(resolve, reject)); - } else { - this.realFs.rm(npath.fromPortablePath(p), this.makeCallback(resolve, reject)); - } - }); - } - rmSync(p, opts) { - return this.realFs.rmSync(npath.fromPortablePath(p), opts); - } - async linkPromise(existingP, newP) { - return await new Promise((resolve, reject) => { - this.realFs.link(npath.fromPortablePath(existingP), npath.fromPortablePath(newP), this.makeCallback(resolve, reject)); - }); - } - linkSync(existingP, newP) { - return this.realFs.linkSync(npath.fromPortablePath(existingP), npath.fromPortablePath(newP)); - } - async symlinkPromise(target, p, type) { - return await new Promise((resolve, reject) => { - this.realFs.symlink(npath.fromPortablePath(target.replace(/\/+$/, ``)), npath.fromPortablePath(p), type, this.makeCallback(resolve, reject)); - }); - } - symlinkSync(target, p, type) { - return this.realFs.symlinkSync(npath.fromPortablePath(target.replace(/\/+$/, ``)), npath.fromPortablePath(p), type); - } - async readFilePromise(p, encoding) { - return await new Promise((resolve, reject) => { - const fsNativePath = typeof p === `string` ? npath.fromPortablePath(p) : p; - this.realFs.readFile(fsNativePath, encoding, this.makeCallback(resolve, reject)); - }); - } - readFileSync(p, encoding) { - const fsNativePath = typeof p === `string` ? npath.fromPortablePath(p) : p; - return this.realFs.readFileSync(fsNativePath, encoding); - } - async readdirPromise(p, opts) { - return await new Promise((resolve, reject) => { - if (opts) { - if (opts.recursive && process.platform === `win32`) { - if (opts.withFileTypes) { - this.realFs.readdir(npath.fromPortablePath(p), opts, this.makeCallback((results) => resolve(results.map(direntToPortable)), reject)); - } else { - this.realFs.readdir(npath.fromPortablePath(p), opts, this.makeCallback((results) => resolve(results.map(npath.toPortablePath)), reject)); - } - } else { - this.realFs.readdir(npath.fromPortablePath(p), opts, this.makeCallback(resolve, reject)); - } - } else { - this.realFs.readdir(npath.fromPortablePath(p), this.makeCallback(resolve, reject)); - } - }); - } - readdirSync(p, opts) { - if (opts) { - if (opts.recursive && process.platform === `win32`) { - if (opts.withFileTypes) { - return this.realFs.readdirSync(npath.fromPortablePath(p), opts).map(direntToPortable); - } else { - return this.realFs.readdirSync(npath.fromPortablePath(p), opts).map(npath.toPortablePath); - } - } else { - return this.realFs.readdirSync(npath.fromPortablePath(p), opts); - } - } else { - return this.realFs.readdirSync(npath.fromPortablePath(p)); - } - } - async readlinkPromise(p) { - return await new Promise((resolve, reject) => { - this.realFs.readlink(npath.fromPortablePath(p), this.makeCallback(resolve, reject)); - }).then((path) => { - return npath.toPortablePath(path); - }); - } - readlinkSync(p) { - return npath.toPortablePath(this.realFs.readlinkSync(npath.fromPortablePath(p))); - } - async truncatePromise(p, len) { - return await new Promise((resolve, reject) => { - this.realFs.truncate(npath.fromPortablePath(p), len, this.makeCallback(resolve, reject)); - }); - } - truncateSync(p, len) { - return this.realFs.truncateSync(npath.fromPortablePath(p), len); - } - async ftruncatePromise(fd, len) { - return await new Promise((resolve, reject) => { - this.realFs.ftruncate(fd, len, this.makeCallback(resolve, reject)); - }); - } - ftruncateSync(fd, len) { - return this.realFs.ftruncateSync(fd, len); - } - watch(p, a, b) { - return this.realFs.watch( - npath.fromPortablePath(p), - a, - b - ); - } - watchFile(p, a, b) { - return this.realFs.watchFile( - npath.fromPortablePath(p), - a, - b - ); - } - unwatchFile(p, cb) { - return this.realFs.unwatchFile(npath.fromPortablePath(p), cb); - } - makeCallback(resolve, reject) { - return (err, result) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }; - } -} - -const MOUNT_MASK = 4278190080; -class MountFS extends BasePortableFakeFS { - constructor({ baseFs = new NodeFS(), filter = null, magicByte = 42, maxOpenFiles = Infinity, useCache = true, maxAge = 5e3, typeCheck = fs.constants.S_IFREG, getMountPoint, factoryPromise, factorySync }) { - if (Math.floor(magicByte) !== magicByte || !(magicByte > 1 && magicByte <= 127)) - throw new Error(`The magic byte must be set to a round value between 1 and 127 included`); - super(); - this.fdMap = /* @__PURE__ */ new Map(); - this.nextFd = 3; - this.isMount = /* @__PURE__ */ new Set(); - this.notMount = /* @__PURE__ */ new Set(); - this.realPaths = /* @__PURE__ */ new Map(); - this.limitOpenFilesTimeout = null; - this.baseFs = baseFs; - this.mountInstances = useCache ? /* @__PURE__ */ new Map() : null; - this.factoryPromise = factoryPromise; - this.factorySync = factorySync; - this.filter = filter; - this.getMountPoint = getMountPoint; - this.magic = magicByte << 24; - this.maxAge = maxAge; - this.maxOpenFiles = maxOpenFiles; - this.typeCheck = typeCheck; - } - getExtractHint(hints) { - return this.baseFs.getExtractHint(hints); - } - getRealPath() { - return this.baseFs.getRealPath(); - } - saveAndClose() { - unwatchAllFiles(this); - if (this.mountInstances) { - for (const [path, { childFs }] of this.mountInstances.entries()) { - childFs.saveAndClose?.(); - this.mountInstances.delete(path); - } - } - } - discardAndClose() { - unwatchAllFiles(this); - if (this.mountInstances) { - for (const [path, { childFs }] of this.mountInstances.entries()) { - childFs.discardAndClose?.(); - this.mountInstances.delete(path); - } - } - } - resolve(p) { - return this.baseFs.resolve(p); - } - remapFd(mountFs, fd) { - const remappedFd = this.nextFd++ | this.magic; - this.fdMap.set(remappedFd, [mountFs, fd]); - return remappedFd; - } - async openPromise(p, flags, mode) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.openPromise(p, flags, mode); - }, async (mountFs, { subPath }) => { - return this.remapFd(mountFs, await mountFs.openPromise(subPath, flags, mode)); - }); - } - openSync(p, flags, mode) { - return this.makeCallSync(p, () => { - return this.baseFs.openSync(p, flags, mode); - }, (mountFs, { subPath }) => { - return this.remapFd(mountFs, mountFs.openSync(subPath, flags, mode)); - }); - } - async opendirPromise(p, opts) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.opendirPromise(p, opts); - }, async (mountFs, { subPath }) => { - return await mountFs.opendirPromise(subPath, opts); - }, { - requireSubpath: false - }); - } - opendirSync(p, opts) { - return this.makeCallSync(p, () => { - return this.baseFs.opendirSync(p, opts); - }, (mountFs, { subPath }) => { - return mountFs.opendirSync(subPath, opts); - }, { - requireSubpath: false - }); - } - async readPromise(fd, buffer, offset, length, position) { - if ((fd & MOUNT_MASK) !== this.magic) - return await this.baseFs.readPromise(fd, buffer, offset, length, position); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`read`); - const [mountFs, realFd] = entry; - return await mountFs.readPromise(realFd, buffer, offset, length, position); - } - readSync(fd, buffer, offset, length, position) { - if ((fd & MOUNT_MASK) !== this.magic) - return this.baseFs.readSync(fd, buffer, offset, length, position); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`readSync`); - const [mountFs, realFd] = entry; - return mountFs.readSync(realFd, buffer, offset, length, position); - } - async writePromise(fd, buffer, offset, length, position) { - if ((fd & MOUNT_MASK) !== this.magic) { - if (typeof buffer === `string`) { - return await this.baseFs.writePromise(fd, buffer, offset); - } else { - return await this.baseFs.writePromise(fd, buffer, offset, length, position); - } - } - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`write`); - const [mountFs, realFd] = entry; - if (typeof buffer === `string`) { - return await mountFs.writePromise(realFd, buffer, offset); - } else { - return await mountFs.writePromise(realFd, buffer, offset, length, position); - } - } - writeSync(fd, buffer, offset, length, position) { - if ((fd & MOUNT_MASK) !== this.magic) { - if (typeof buffer === `string`) { - return this.baseFs.writeSync(fd, buffer, offset); - } else { - return this.baseFs.writeSync(fd, buffer, offset, length, position); - } - } - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`writeSync`); - const [mountFs, realFd] = entry; - if (typeof buffer === `string`) { - return mountFs.writeSync(realFd, buffer, offset); - } else { - return mountFs.writeSync(realFd, buffer, offset, length, position); - } - } - async closePromise(fd) { - if ((fd & MOUNT_MASK) !== this.magic) - return await this.baseFs.closePromise(fd); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`close`); - this.fdMap.delete(fd); - const [mountFs, realFd] = entry; - return await mountFs.closePromise(realFd); - } - closeSync(fd) { - if ((fd & MOUNT_MASK) !== this.magic) - return this.baseFs.closeSync(fd); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`closeSync`); - this.fdMap.delete(fd); - const [mountFs, realFd] = entry; - return mountFs.closeSync(realFd); - } - createReadStream(p, opts) { - if (p === null) - return this.baseFs.createReadStream(p, opts); - return this.makeCallSync(p, () => { - return this.baseFs.createReadStream(p, opts); - }, (mountFs, { archivePath, subPath }) => { - const stream = mountFs.createReadStream(subPath, opts); - stream.path = npath.fromPortablePath(this.pathUtils.join(archivePath, subPath)); - return stream; - }); - } - createWriteStream(p, opts) { - if (p === null) - return this.baseFs.createWriteStream(p, opts); - return this.makeCallSync(p, () => { - return this.baseFs.createWriteStream(p, opts); - }, (mountFs, { subPath }) => { - return mountFs.createWriteStream(subPath, opts); - }); - } - async realpathPromise(p) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.realpathPromise(p); - }, async (mountFs, { archivePath, subPath }) => { - let realArchivePath = this.realPaths.get(archivePath); - if (typeof realArchivePath === `undefined`) { - realArchivePath = await this.baseFs.realpathPromise(archivePath); - this.realPaths.set(archivePath, realArchivePath); - } - return this.pathUtils.join(realArchivePath, this.pathUtils.relative(PortablePath.root, await mountFs.realpathPromise(subPath))); - }); - } - realpathSync(p) { - return this.makeCallSync(p, () => { - return this.baseFs.realpathSync(p); - }, (mountFs, { archivePath, subPath }) => { - let realArchivePath = this.realPaths.get(archivePath); - if (typeof realArchivePath === `undefined`) { - realArchivePath = this.baseFs.realpathSync(archivePath); - this.realPaths.set(archivePath, realArchivePath); - } - return this.pathUtils.join(realArchivePath, this.pathUtils.relative(PortablePath.root, mountFs.realpathSync(subPath))); - }); - } - async existsPromise(p) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.existsPromise(p); - }, async (mountFs, { subPath }) => { - return await mountFs.existsPromise(subPath); - }); - } - existsSync(p) { - return this.makeCallSync(p, () => { - return this.baseFs.existsSync(p); - }, (mountFs, { subPath }) => { - return mountFs.existsSync(subPath); - }); - } - async accessPromise(p, mode) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.accessPromise(p, mode); - }, async (mountFs, { subPath }) => { - return await mountFs.accessPromise(subPath, mode); - }); - } - accessSync(p, mode) { - return this.makeCallSync(p, () => { - return this.baseFs.accessSync(p, mode); - }, (mountFs, { subPath }) => { - return mountFs.accessSync(subPath, mode); - }); - } - async statPromise(p, opts) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.statPromise(p, opts); - }, async (mountFs, { subPath }) => { - return await mountFs.statPromise(subPath, opts); - }); - } - statSync(p, opts) { - return this.makeCallSync(p, () => { - return this.baseFs.statSync(p, opts); - }, (mountFs, { subPath }) => { - return mountFs.statSync(subPath, opts); - }); - } - async fstatPromise(fd, opts) { - if ((fd & MOUNT_MASK) !== this.magic) - return this.baseFs.fstatPromise(fd, opts); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`fstat`); - const [mountFs, realFd] = entry; - return mountFs.fstatPromise(realFd, opts); - } - fstatSync(fd, opts) { - if ((fd & MOUNT_MASK) !== this.magic) - return this.baseFs.fstatSync(fd, opts); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`fstatSync`); - const [mountFs, realFd] = entry; - return mountFs.fstatSync(realFd, opts); - } - async lstatPromise(p, opts) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.lstatPromise(p, opts); - }, async (mountFs, { subPath }) => { - return await mountFs.lstatPromise(subPath, opts); - }); - } - lstatSync(p, opts) { - return this.makeCallSync(p, () => { - return this.baseFs.lstatSync(p, opts); - }, (mountFs, { subPath }) => { - return mountFs.lstatSync(subPath, opts); - }); - } - async fchmodPromise(fd, mask) { - if ((fd & MOUNT_MASK) !== this.magic) - return this.baseFs.fchmodPromise(fd, mask); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`fchmod`); - const [mountFs, realFd] = entry; - return mountFs.fchmodPromise(realFd, mask); - } - fchmodSync(fd, mask) { - if ((fd & MOUNT_MASK) !== this.magic) - return this.baseFs.fchmodSync(fd, mask); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`fchmodSync`); - const [mountFs, realFd] = entry; - return mountFs.fchmodSync(realFd, mask); - } - async chmodPromise(p, mask) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.chmodPromise(p, mask); - }, async (mountFs, { subPath }) => { - return await mountFs.chmodPromise(subPath, mask); - }); - } - chmodSync(p, mask) { - return this.makeCallSync(p, () => { - return this.baseFs.chmodSync(p, mask); - }, (mountFs, { subPath }) => { - return mountFs.chmodSync(subPath, mask); - }); - } - async fchownPromise(fd, uid, gid) { - if ((fd & MOUNT_MASK) !== this.magic) - return this.baseFs.fchownPromise(fd, uid, gid); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`fchown`); - const [zipFs, realFd] = entry; - return zipFs.fchownPromise(realFd, uid, gid); - } - fchownSync(fd, uid, gid) { - if ((fd & MOUNT_MASK) !== this.magic) - return this.baseFs.fchownSync(fd, uid, gid); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`fchownSync`); - const [zipFs, realFd] = entry; - return zipFs.fchownSync(realFd, uid, gid); - } - async chownPromise(p, uid, gid) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.chownPromise(p, uid, gid); - }, async (mountFs, { subPath }) => { - return await mountFs.chownPromise(subPath, uid, gid); - }); - } - chownSync(p, uid, gid) { - return this.makeCallSync(p, () => { - return this.baseFs.chownSync(p, uid, gid); - }, (mountFs, { subPath }) => { - return mountFs.chownSync(subPath, uid, gid); - }); - } - async renamePromise(oldP, newP) { - return await this.makeCallPromise(oldP, async () => { - return await this.makeCallPromise(newP, async () => { - return await this.baseFs.renamePromise(oldP, newP); - }, async () => { - throw Object.assign(new Error(`EEXDEV: cross-device link not permitted`), { code: `EEXDEV` }); - }); - }, async (mountFsO, { subPath: subPathO }) => { - return await this.makeCallPromise(newP, async () => { - throw Object.assign(new Error(`EEXDEV: cross-device link not permitted`), { code: `EEXDEV` }); - }, async (mountFsN, { subPath: subPathN }) => { - if (mountFsO !== mountFsN) { - throw Object.assign(new Error(`EEXDEV: cross-device link not permitted`), { code: `EEXDEV` }); - } else { - return await mountFsO.renamePromise(subPathO, subPathN); - } - }); - }); - } - renameSync(oldP, newP) { - return this.makeCallSync(oldP, () => { - return this.makeCallSync(newP, () => { - return this.baseFs.renameSync(oldP, newP); - }, () => { - throw Object.assign(new Error(`EEXDEV: cross-device link not permitted`), { code: `EEXDEV` }); - }); - }, (mountFsO, { subPath: subPathO }) => { - return this.makeCallSync(newP, () => { - throw Object.assign(new Error(`EEXDEV: cross-device link not permitted`), { code: `EEXDEV` }); - }, (mountFsN, { subPath: subPathN }) => { - if (mountFsO !== mountFsN) { - throw Object.assign(new Error(`EEXDEV: cross-device link not permitted`), { code: `EEXDEV` }); - } else { - return mountFsO.renameSync(subPathO, subPathN); - } - }); - }); - } - async copyFilePromise(sourceP, destP, flags = 0) { - const fallback = async (sourceFs, sourceP2, destFs, destP2) => { - if ((flags & fs.constants.COPYFILE_FICLONE_FORCE) !== 0) - throw Object.assign(new Error(`EXDEV: cross-device clone not permitted, copyfile '${sourceP2}' -> ${destP2}'`), { code: `EXDEV` }); - if (flags & fs.constants.COPYFILE_EXCL && await this.existsPromise(sourceP2)) - throw Object.assign(new Error(`EEXIST: file already exists, copyfile '${sourceP2}' -> '${destP2}'`), { code: `EEXIST` }); - let content; - try { - content = await sourceFs.readFilePromise(sourceP2); - } catch (error) { - throw Object.assign(new Error(`EINVAL: invalid argument, copyfile '${sourceP2}' -> '${destP2}'`), { code: `EINVAL` }); - } - await destFs.writeFilePromise(destP2, content); - }; - return await this.makeCallPromise(sourceP, async () => { - return await this.makeCallPromise(destP, async () => { - return await this.baseFs.copyFilePromise(sourceP, destP, flags); - }, async (mountFsD, { subPath: subPathD }) => { - return await fallback(this.baseFs, sourceP, mountFsD, subPathD); - }); - }, async (mountFsS, { subPath: subPathS }) => { - return await this.makeCallPromise(destP, async () => { - return await fallback(mountFsS, subPathS, this.baseFs, destP); - }, async (mountFsD, { subPath: subPathD }) => { - if (mountFsS !== mountFsD) { - return await fallback(mountFsS, subPathS, mountFsD, subPathD); - } else { - return await mountFsS.copyFilePromise(subPathS, subPathD, flags); - } - }); - }); - } - copyFileSync(sourceP, destP, flags = 0) { - const fallback = (sourceFs, sourceP2, destFs, destP2) => { - if ((flags & fs.constants.COPYFILE_FICLONE_FORCE) !== 0) - throw Object.assign(new Error(`EXDEV: cross-device clone not permitted, copyfile '${sourceP2}' -> ${destP2}'`), { code: `EXDEV` }); - if (flags & fs.constants.COPYFILE_EXCL && this.existsSync(sourceP2)) - throw Object.assign(new Error(`EEXIST: file already exists, copyfile '${sourceP2}' -> '${destP2}'`), { code: `EEXIST` }); - let content; - try { - content = sourceFs.readFileSync(sourceP2); - } catch (error) { - throw Object.assign(new Error(`EINVAL: invalid argument, copyfile '${sourceP2}' -> '${destP2}'`), { code: `EINVAL` }); - } - destFs.writeFileSync(destP2, content); - }; - return this.makeCallSync(sourceP, () => { - return this.makeCallSync(destP, () => { - return this.baseFs.copyFileSync(sourceP, destP, flags); - }, (mountFsD, { subPath: subPathD }) => { - return fallback(this.baseFs, sourceP, mountFsD, subPathD); - }); - }, (mountFsS, { subPath: subPathS }) => { - return this.makeCallSync(destP, () => { - return fallback(mountFsS, subPathS, this.baseFs, destP); - }, (mountFsD, { subPath: subPathD }) => { - if (mountFsS !== mountFsD) { - return fallback(mountFsS, subPathS, mountFsD, subPathD); - } else { - return mountFsS.copyFileSync(subPathS, subPathD, flags); - } - }); - }); - } - async appendFilePromise(p, content, opts) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.appendFilePromise(p, content, opts); - }, async (mountFs, { subPath }) => { - return await mountFs.appendFilePromise(subPath, content, opts); - }); - } - appendFileSync(p, content, opts) { - return this.makeCallSync(p, () => { - return this.baseFs.appendFileSync(p, content, opts); - }, (mountFs, { subPath }) => { - return mountFs.appendFileSync(subPath, content, opts); - }); - } - async writeFilePromise(p, content, opts) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.writeFilePromise(p, content, opts); - }, async (mountFs, { subPath }) => { - return await mountFs.writeFilePromise(subPath, content, opts); - }); - } - writeFileSync(p, content, opts) { - return this.makeCallSync(p, () => { - return this.baseFs.writeFileSync(p, content, opts); - }, (mountFs, { subPath }) => { - return mountFs.writeFileSync(subPath, content, opts); - }); - } - async unlinkPromise(p) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.unlinkPromise(p); - }, async (mountFs, { subPath }) => { - return await mountFs.unlinkPromise(subPath); - }); - } - unlinkSync(p) { - return this.makeCallSync(p, () => { - return this.baseFs.unlinkSync(p); - }, (mountFs, { subPath }) => { - return mountFs.unlinkSync(subPath); - }); - } - async utimesPromise(p, atime, mtime) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.utimesPromise(p, atime, mtime); - }, async (mountFs, { subPath }) => { - return await mountFs.utimesPromise(subPath, atime, mtime); - }); - } - utimesSync(p, atime, mtime) { - return this.makeCallSync(p, () => { - return this.baseFs.utimesSync(p, atime, mtime); - }, (mountFs, { subPath }) => { - return mountFs.utimesSync(subPath, atime, mtime); - }); - } - async lutimesPromise(p, atime, mtime) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.lutimesPromise(p, atime, mtime); - }, async (mountFs, { subPath }) => { - return await mountFs.lutimesPromise(subPath, atime, mtime); - }); - } - lutimesSync(p, atime, mtime) { - return this.makeCallSync(p, () => { - return this.baseFs.lutimesSync(p, atime, mtime); - }, (mountFs, { subPath }) => { - return mountFs.lutimesSync(subPath, atime, mtime); - }); - } - async mkdirPromise(p, opts) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.mkdirPromise(p, opts); - }, async (mountFs, { subPath }) => { - return await mountFs.mkdirPromise(subPath, opts); - }); - } - mkdirSync(p, opts) { - return this.makeCallSync(p, () => { - return this.baseFs.mkdirSync(p, opts); - }, (mountFs, { subPath }) => { - return mountFs.mkdirSync(subPath, opts); - }); - } - async rmdirPromise(p, opts) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.rmdirPromise(p, opts); - }, async (mountFs, { subPath }) => { - return await mountFs.rmdirPromise(subPath, opts); - }); - } - rmdirSync(p, opts) { - return this.makeCallSync(p, () => { - return this.baseFs.rmdirSync(p, opts); - }, (mountFs, { subPath }) => { - return mountFs.rmdirSync(subPath, opts); - }); - } - async rmPromise(p, opts) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.rmPromise(p, opts); - }, async (mountFs, { subPath }) => { - return await mountFs.rmPromise(subPath, opts); - }); - } - rmSync(p, opts) { - return this.makeCallSync(p, () => { - return this.baseFs.rmSync(p, opts); - }, (mountFs, { subPath }) => { - return mountFs.rmSync(subPath, opts); - }); - } - async linkPromise(existingP, newP) { - return await this.makeCallPromise(newP, async () => { - return await this.baseFs.linkPromise(existingP, newP); - }, async (mountFs, { subPath }) => { - return await mountFs.linkPromise(existingP, subPath); - }); - } - linkSync(existingP, newP) { - return this.makeCallSync(newP, () => { - return this.baseFs.linkSync(existingP, newP); - }, (mountFs, { subPath }) => { - return mountFs.linkSync(existingP, subPath); - }); - } - async symlinkPromise(target, p, type) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.symlinkPromise(target, p, type); - }, async (mountFs, { subPath }) => { - return await mountFs.symlinkPromise(target, subPath); - }); - } - symlinkSync(target, p, type) { - return this.makeCallSync(p, () => { - return this.baseFs.symlinkSync(target, p, type); - }, (mountFs, { subPath }) => { - return mountFs.symlinkSync(target, subPath); - }); - } - async readFilePromise(p, encoding) { - return this.makeCallPromise(p, async () => { - return await this.baseFs.readFilePromise(p, encoding); - }, async (mountFs, { subPath }) => { - return await mountFs.readFilePromise(subPath, encoding); - }); - } - readFileSync(p, encoding) { - return this.makeCallSync(p, () => { - return this.baseFs.readFileSync(p, encoding); - }, (mountFs, { subPath }) => { - return mountFs.readFileSync(subPath, encoding); - }); - } - async readdirPromise(p, opts) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.readdirPromise(p, opts); - }, async (mountFs, { subPath }) => { - return await mountFs.readdirPromise(subPath, opts); - }, { - requireSubpath: false - }); - } - readdirSync(p, opts) { - return this.makeCallSync(p, () => { - return this.baseFs.readdirSync(p, opts); - }, (mountFs, { subPath }) => { - return mountFs.readdirSync(subPath, opts); - }, { - requireSubpath: false - }); - } - async readlinkPromise(p) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.readlinkPromise(p); - }, async (mountFs, { subPath }) => { - return await mountFs.readlinkPromise(subPath); - }); - } - readlinkSync(p) { - return this.makeCallSync(p, () => { - return this.baseFs.readlinkSync(p); - }, (mountFs, { subPath }) => { - return mountFs.readlinkSync(subPath); - }); - } - async truncatePromise(p, len) { - return await this.makeCallPromise(p, async () => { - return await this.baseFs.truncatePromise(p, len); - }, async (mountFs, { subPath }) => { - return await mountFs.truncatePromise(subPath, len); - }); - } - truncateSync(p, len) { - return this.makeCallSync(p, () => { - return this.baseFs.truncateSync(p, len); - }, (mountFs, { subPath }) => { - return mountFs.truncateSync(subPath, len); - }); - } - async ftruncatePromise(fd, len) { - if ((fd & MOUNT_MASK) !== this.magic) - return this.baseFs.ftruncatePromise(fd, len); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`ftruncate`); - const [mountFs, realFd] = entry; - return mountFs.ftruncatePromise(realFd, len); - } - ftruncateSync(fd, len) { - if ((fd & MOUNT_MASK) !== this.magic) - return this.baseFs.ftruncateSync(fd, len); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`ftruncateSync`); - const [mountFs, realFd] = entry; - return mountFs.ftruncateSync(realFd, len); - } - watch(p, a, b) { - return this.makeCallSync(p, () => { - return this.baseFs.watch( - p, - a, - b - ); - }, (mountFs, { subPath }) => { - return mountFs.watch( - subPath, - a, - b - ); - }); - } - watchFile(p, a, b) { - return this.makeCallSync(p, () => { - return this.baseFs.watchFile( - p, - a, - b - ); - }, () => { - return watchFile(this, p, a, b); - }); - } - unwatchFile(p, cb) { - return this.makeCallSync(p, () => { - return this.baseFs.unwatchFile(p, cb); - }, () => { - return unwatchFile(this, p, cb); - }); - } - async makeCallPromise(p, discard, accept, { requireSubpath = true } = {}) { - if (typeof p !== `string`) - return await discard(); - const normalizedP = this.resolve(p); - const mountInfo = this.findMount(normalizedP); - if (!mountInfo) - return await discard(); - if (requireSubpath && mountInfo.subPath === `/`) - return await discard(); - return await this.getMountPromise(mountInfo.archivePath, async (mountFs) => await accept(mountFs, mountInfo)); - } - makeCallSync(p, discard, accept, { requireSubpath = true } = {}) { - if (typeof p !== `string`) - return discard(); - const normalizedP = this.resolve(p); - const mountInfo = this.findMount(normalizedP); - if (!mountInfo) - return discard(); - if (requireSubpath && mountInfo.subPath === `/`) - return discard(); - return this.getMountSync(mountInfo.archivePath, (mountFs) => accept(mountFs, mountInfo)); - } - findMount(p) { - if (this.filter && !this.filter.test(p)) - return null; - let filePath = ``; - while (true) { - const pathPartWithArchive = p.substring(filePath.length); - const mountPoint = this.getMountPoint(pathPartWithArchive, filePath); - if (!mountPoint) - return null; - filePath = this.pathUtils.join(filePath, mountPoint); - if (!this.isMount.has(filePath)) { - if (this.notMount.has(filePath)) - continue; - try { - if (this.typeCheck !== null && (this.baseFs.lstatSync(filePath).mode & fs.constants.S_IFMT) !== this.typeCheck) { - this.notMount.add(filePath); - continue; - } - } catch { - return null; - } - this.isMount.add(filePath); - } - return { - archivePath: filePath, - subPath: this.pathUtils.join(PortablePath.root, p.substring(filePath.length)) - }; - } - } - limitOpenFiles(max) { - if (this.mountInstances === null) - return; - const now = Date.now(); - let nextExpiresAt = now + this.maxAge; - let closeCount = max === null ? 0 : this.mountInstances.size - max; - for (const [path, { childFs, expiresAt, refCount }] of this.mountInstances.entries()) { - if (refCount !== 0 || childFs.hasOpenFileHandles?.()) { - continue; - } else if (now >= expiresAt) { - childFs.saveAndClose?.(); - this.mountInstances.delete(path); - closeCount -= 1; - continue; - } else if (max === null || closeCount <= 0) { - nextExpiresAt = expiresAt; - break; - } - childFs.saveAndClose?.(); - this.mountInstances.delete(path); - closeCount -= 1; - } - if (this.limitOpenFilesTimeout === null && (max === null && this.mountInstances.size > 0 || max !== null) && isFinite(nextExpiresAt)) { - this.limitOpenFilesTimeout = setTimeout(() => { - this.limitOpenFilesTimeout = null; - this.limitOpenFiles(null); - }, nextExpiresAt - now).unref(); - } - } - async getMountPromise(p, accept) { - if (this.mountInstances) { - let cachedMountFs = this.mountInstances.get(p); - if (!cachedMountFs) { - const createFsInstance = await this.factoryPromise(this.baseFs, p); - cachedMountFs = this.mountInstances.get(p); - if (!cachedMountFs) { - cachedMountFs = { - childFs: createFsInstance(), - expiresAt: 0, - refCount: 0 - }; - } - } - this.mountInstances.delete(p); - this.limitOpenFiles(this.maxOpenFiles - 1); - this.mountInstances.set(p, cachedMountFs); - cachedMountFs.expiresAt = Date.now() + this.maxAge; - cachedMountFs.refCount += 1; - try { - return await accept(cachedMountFs.childFs); - } finally { - cachedMountFs.refCount -= 1; - } - } else { - const mountFs = (await this.factoryPromise(this.baseFs, p))(); - try { - return await accept(mountFs); - } finally { - mountFs.saveAndClose?.(); - } - } - } - getMountSync(p, accept) { - if (this.mountInstances) { - let cachedMountFs = this.mountInstances.get(p); - if (!cachedMountFs) { - cachedMountFs = { - childFs: this.factorySync(this.baseFs, p), - expiresAt: 0, - refCount: 0 - }; - } - this.mountInstances.delete(p); - this.limitOpenFiles(this.maxOpenFiles - 1); - this.mountInstances.set(p, cachedMountFs); - cachedMountFs.expiresAt = Date.now() + this.maxAge; - return accept(cachedMountFs.childFs); - } else { - const childFs = this.factorySync(this.baseFs, p); - try { - return accept(childFs); - } finally { - childFs.saveAndClose?.(); - } - } - } -} - -class PosixFS extends ProxiedFS { - constructor(baseFs) { - super(npath); - this.baseFs = baseFs; - } - mapFromBase(path) { - return npath.fromPortablePath(path); - } - mapToBase(path) { - return npath.toPortablePath(path); - } -} - -const NUMBER_REGEXP = /^[0-9]+$/; -const VIRTUAL_REGEXP = /^(\/(?:[^/]+\/)*?(?:\$\$virtual|__virtual__))((?:\/((?:[^/]+-)?[a-f0-9]+)(?:\/([^/]+))?)?((?:\/.*)?))$/; -const VALID_COMPONENT = /^([^/]+-)?[a-f0-9]+$/; -class VirtualFS extends ProxiedFS { - constructor({ baseFs = new NodeFS() } = {}) { - super(ppath); - this.baseFs = baseFs; - } - static makeVirtualPath(base, component, to) { - if (ppath.basename(base) !== `__virtual__`) - throw new Error(`Assertion failed: Virtual folders must be named "__virtual__"`); - if (!ppath.basename(component).match(VALID_COMPONENT)) - throw new Error(`Assertion failed: Virtual components must be ended by an hexadecimal hash`); - const target = ppath.relative(ppath.dirname(base), to); - const segments = target.split(`/`); - let depth = 0; - while (depth < segments.length && segments[depth] === `..`) - depth += 1; - const finalSegments = segments.slice(depth); - const fullVirtualPath = ppath.join(base, component, String(depth), ...finalSegments); - return fullVirtualPath; - } - static resolveVirtual(p) { - const match = p.match(VIRTUAL_REGEXP); - if (!match || !match[3] && match[5]) - return p; - const target = ppath.dirname(match[1]); - if (!match[3] || !match[4]) - return target; - const isnum = NUMBER_REGEXP.test(match[4]); - if (!isnum) - return p; - const depth = Number(match[4]); - const backstep = `../`.repeat(depth); - const subpath = match[5] || `.`; - return VirtualFS.resolveVirtual(ppath.join(target, backstep, subpath)); - } - getExtractHint(hints) { - return this.baseFs.getExtractHint(hints); - } - getRealPath() { - return this.baseFs.getRealPath(); - } - realpathSync(p) { - const match = p.match(VIRTUAL_REGEXP); - if (!match) - return this.baseFs.realpathSync(p); - if (!match[5]) - return p; - const realpath = this.baseFs.realpathSync(this.mapToBase(p)); - return VirtualFS.makeVirtualPath(match[1], match[3], realpath); - } - async realpathPromise(p) { - const match = p.match(VIRTUAL_REGEXP); - if (!match) - return await this.baseFs.realpathPromise(p); - if (!match[5]) - return p; - const realpath = await this.baseFs.realpathPromise(this.mapToBase(p)); - return VirtualFS.makeVirtualPath(match[1], match[3], realpath); - } - mapToBase(p) { - if (p === ``) - return p; - if (this.pathUtils.isAbsolute(p)) - return VirtualFS.resolveVirtual(p); - const resolvedRoot = VirtualFS.resolveVirtual(this.baseFs.resolve(PortablePath.dot)); - const resolvedP = VirtualFS.resolveVirtual(this.baseFs.resolve(p)); - return ppath.relative(resolvedRoot, resolvedP) || PortablePath.dot; - } - mapFromBase(p) { - return p; - } -} - -const URL = Number(process.versions.node.split('.', 1)[0]) < 20 ? url.URL : globalThis.URL; - -class NodePathFS extends ProxiedFS { - constructor(baseFs) { - super(npath); - this.baseFs = baseFs; - } - mapFromBase(path) { - return path; - } - mapToBase(path) { - if (typeof path === `string`) - return path; - if (path instanceof URL) - return url.fileURLToPath(path); - if (Buffer.isBuffer(path)) { - const str = path.toString(); - if (!isUtf8(path, str)) - throw new Error(`Non-utf8 buffers are not supported at the moment. Please upvote the following issue if you encounter this error: https://github.com/yarnpkg/berry/issues/4942`); - return str; - } - throw new Error(`Unsupported path type: ${nodeUtils.inspect(path)}`); - } -} -function isUtf8(buf, str) { - if (typeof buffer__default.default.isUtf8 !== `undefined`) - return buffer__default.default.isUtf8(buf); - return Buffer.byteLength(str) === buf.byteLength; -} - -var _a, _b, _c, _d; -const kBaseFs = Symbol(`kBaseFs`); -const kFd = Symbol(`kFd`); -const kClosePromise = Symbol(`kClosePromise`); -const kCloseResolve = Symbol(`kCloseResolve`); -const kCloseReject = Symbol(`kCloseReject`); -const kRefs = Symbol(`kRefs`); -const kRef = Symbol(`kRef`); -const kUnref = Symbol(`kUnref`); -class FileHandle { - constructor(fd, baseFs) { - this[_a] = 1; - this[_b] = void 0; - this[_c] = void 0; - this[_d] = void 0; - this[kBaseFs] = baseFs; - this[kFd] = fd; - } - get fd() { - return this[kFd]; - } - async appendFile(data, options) { - try { - this[kRef](this.appendFile); - const encoding = (typeof options === `string` ? options : options?.encoding) ?? void 0; - return await this[kBaseFs].appendFilePromise(this.fd, data, encoding ? { encoding } : void 0); - } finally { - this[kUnref](); - } - } - async chown(uid, gid) { - try { - this[kRef](this.chown); - return await this[kBaseFs].fchownPromise(this.fd, uid, gid); - } finally { - this[kUnref](); - } - } - async chmod(mode) { - try { - this[kRef](this.chmod); - return await this[kBaseFs].fchmodPromise(this.fd, mode); - } finally { - this[kUnref](); - } - } - createReadStream(options) { - return this[kBaseFs].createReadStream(null, { ...options, fd: this.fd }); - } - createWriteStream(options) { - return this[kBaseFs].createWriteStream(null, { ...options, fd: this.fd }); - } - datasync() { - throw new Error(`Method not implemented.`); - } - sync() { - throw new Error(`Method not implemented.`); - } - async read(bufferOrOptions, offset, length, position) { - try { - this[kRef](this.read); - let buffer; - if (!Buffer.isBuffer(bufferOrOptions)) { - bufferOrOptions ??= {}; - buffer = bufferOrOptions.buffer ?? Buffer.alloc(16384); - offset = bufferOrOptions.offset || 0; - length = bufferOrOptions.length ?? buffer.byteLength; - position = bufferOrOptions.position ?? null; - } else { - buffer = bufferOrOptions; - } - offset ??= 0; - length ??= 0; - if (length === 0) { - return { - bytesRead: length, - buffer - }; - } - const bytesRead = await this[kBaseFs].readPromise(this.fd, buffer, offset, length, position); - return { - bytesRead, - buffer - }; - } finally { - this[kUnref](); - } - } - async readFile(options) { - try { - this[kRef](this.readFile); - const encoding = (typeof options === `string` ? options : options?.encoding) ?? void 0; - return await this[kBaseFs].readFilePromise(this.fd, encoding); - } finally { - this[kUnref](); - } - } - readLines(options) { - return readline.createInterface({ - input: this.createReadStream(options), - crlfDelay: Infinity - }); - } - async stat(opts) { - try { - this[kRef](this.stat); - return await this[kBaseFs].fstatPromise(this.fd, opts); - } finally { - this[kUnref](); - } - } - async truncate(len) { - try { - this[kRef](this.truncate); - return await this[kBaseFs].ftruncatePromise(this.fd, len); - } finally { - this[kUnref](); - } - } - utimes(atime, mtime) { - throw new Error(`Method not implemented.`); - } - async writeFile(data, options) { - try { - this[kRef](this.writeFile); - const encoding = (typeof options === `string` ? options : options?.encoding) ?? void 0; - await this[kBaseFs].writeFilePromise(this.fd, data, encoding); - } finally { - this[kUnref](); - } - } - async write(...args) { - try { - this[kRef](this.write); - if (ArrayBuffer.isView(args[0])) { - const [buffer, offset, length, position] = args; - const bytesWritten = await this[kBaseFs].writePromise(this.fd, buffer, offset ?? void 0, length ?? void 0, position ?? void 0); - return { bytesWritten, buffer }; - } else { - const [data, position, encoding] = args; - const bytesWritten = await this[kBaseFs].writePromise(this.fd, data, position, encoding); - return { bytesWritten, buffer: data }; - } - } finally { - this[kUnref](); - } - } - async writev(buffers, position) { - try { - this[kRef](this.writev); - let bytesWritten = 0; - if (typeof position !== `undefined`) { - for (const buffer of buffers) { - const writeResult = await this.write(buffer, void 0, void 0, position); - bytesWritten += writeResult.bytesWritten; - position += writeResult.bytesWritten; - } - } else { - for (const buffer of buffers) { - const writeResult = await this.write(buffer); - bytesWritten += writeResult.bytesWritten; - } - } - return { - buffers, - bytesWritten - }; - } finally { - this[kUnref](); - } - } - readv(buffers, position) { - throw new Error(`Method not implemented.`); - } - close() { - if (this[kFd] === -1) - return Promise.resolve(); - if (this[kClosePromise]) - return this[kClosePromise]; - this[kRefs]--; - if (this[kRefs] === 0) { - const fd = this[kFd]; - this[kFd] = -1; - this[kClosePromise] = this[kBaseFs].closePromise(fd).finally(() => { - this[kClosePromise] = void 0; - }); - } else { - this[kClosePromise] = new Promise((resolve, reject) => { - this[kCloseResolve] = resolve; - this[kCloseReject] = reject; - }).finally(() => { - this[kClosePromise] = void 0; - this[kCloseReject] = void 0; - this[kCloseResolve] = void 0; - }); - } - return this[kClosePromise]; - } - [(_a = kRefs, _b = kClosePromise, _c = kCloseResolve, _d = kCloseReject, kRef)](caller) { - if (this[kFd] === -1) { - const err = new Error(`file closed`); - err.code = `EBADF`; - err.syscall = caller.name; - throw err; - } - this[kRefs]++; - } - [kUnref]() { - this[kRefs]--; - if (this[kRefs] === 0) { - const fd = this[kFd]; - this[kFd] = -1; - this[kBaseFs].closePromise(fd).then(this[kCloseResolve], this[kCloseReject]); - } - } -} - -const SYNC_IMPLEMENTATIONS = /* @__PURE__ */ new Set([ - `accessSync`, - `appendFileSync`, - `createReadStream`, - `createWriteStream`, - `chmodSync`, - `fchmodSync`, - `chownSync`, - `fchownSync`, - `closeSync`, - `copyFileSync`, - `linkSync`, - `lstatSync`, - `fstatSync`, - `lutimesSync`, - `mkdirSync`, - `openSync`, - `opendirSync`, - `readlinkSync`, - `readFileSync`, - `readdirSync`, - `readlinkSync`, - `realpathSync`, - `renameSync`, - `rmdirSync`, - `rmSync`, - `statSync`, - `symlinkSync`, - `truncateSync`, - `ftruncateSync`, - `unlinkSync`, - `unwatchFile`, - `utimesSync`, - `watch`, - `watchFile`, - `writeFileSync`, - `writeSync` -]); -const ASYNC_IMPLEMENTATIONS = /* @__PURE__ */ new Set([ - `accessPromise`, - `appendFilePromise`, - `fchmodPromise`, - `chmodPromise`, - `fchownPromise`, - `chownPromise`, - `closePromise`, - `copyFilePromise`, - `linkPromise`, - `fstatPromise`, - `lstatPromise`, - `lutimesPromise`, - `mkdirPromise`, - `openPromise`, - `opendirPromise`, - `readdirPromise`, - `realpathPromise`, - `readFilePromise`, - `readdirPromise`, - `readlinkPromise`, - `renamePromise`, - `rmdirPromise`, - `rmPromise`, - `statPromise`, - `symlinkPromise`, - `truncatePromise`, - `ftruncatePromise`, - `unlinkPromise`, - `utimesPromise`, - `writeFilePromise`, - `writeSync` -]); -function patchFs(patchedFs, fakeFs) { - fakeFs = new NodePathFS(fakeFs); - const setupFn = (target, name, replacement) => { - const orig = target[name]; - target[name] = replacement; - if (typeof orig?.[nodeUtils.promisify.custom] !== `undefined`) { - replacement[nodeUtils.promisify.custom] = orig[nodeUtils.promisify.custom]; - } - }; - { - setupFn(patchedFs, `exists`, (p, ...args) => { - const hasCallback = typeof args[args.length - 1] === `function`; - const callback = hasCallback ? args.pop() : () => { - }; - process.nextTick(() => { - fakeFs.existsPromise(p).then((exists) => { - callback(exists); - }, () => { - callback(false); - }); - }); - }); - setupFn(patchedFs, `read`, (...args) => { - let [fd, buffer, offset, length, position, callback] = args; - if (args.length <= 3) { - let options = {}; - if (args.length < 3) { - callback = args[1]; - } else { - options = args[1]; - callback = args[2]; - } - ({ - buffer = Buffer.alloc(16384), - offset = 0, - length = buffer.byteLength, - position - } = options); - } - if (offset == null) - offset = 0; - length |= 0; - if (length === 0) { - process.nextTick(() => { - callback(null, 0, buffer); - }); - return; - } - if (position == null) - position = -1; - process.nextTick(() => { - fakeFs.readPromise(fd, buffer, offset, length, position).then((bytesRead) => { - callback(null, bytesRead, buffer); - }, (error) => { - callback(error, 0, buffer); - }); - }); - }); - for (const fnName of ASYNC_IMPLEMENTATIONS) { - const origName = fnName.replace(/Promise$/, ``); - if (typeof patchedFs[origName] === `undefined`) - continue; - const fakeImpl = fakeFs[fnName]; - if (typeof fakeImpl === `undefined`) - continue; - const wrapper = (...args) => { - const hasCallback = typeof args[args.length - 1] === `function`; - const callback = hasCallback ? args.pop() : () => { - }; - process.nextTick(() => { - fakeImpl.apply(fakeFs, args).then((result) => { - callback(null, result); - }, (error) => { - callback(error); - }); - }); - }; - setupFn(patchedFs, origName, wrapper); - } - patchedFs.realpath.native = patchedFs.realpath; - } - { - setupFn(patchedFs, `existsSync`, (p) => { - try { - return fakeFs.existsSync(p); - } catch (error) { - return false; - } - }); - setupFn(patchedFs, `readSync`, (...args) => { - let [fd, buffer, offset, length, position] = args; - if (args.length <= 3) { - const options = args[2] || {}; - ({ offset = 0, length = buffer.byteLength, position } = options); - } - if (offset == null) - offset = 0; - length |= 0; - if (length === 0) - return 0; - if (position == null) - position = -1; - return fakeFs.readSync(fd, buffer, offset, length, position); - }); - for (const fnName of SYNC_IMPLEMENTATIONS) { - const origName = fnName; - if (typeof patchedFs[origName] === `undefined`) - continue; - const fakeImpl = fakeFs[fnName]; - if (typeof fakeImpl === `undefined`) - continue; - setupFn(patchedFs, origName, fakeImpl.bind(fakeFs)); - } - patchedFs.realpathSync.native = patchedFs.realpathSync; - } - { - const patchedFsPromises = patchedFs.promises; - for (const fnName of ASYNC_IMPLEMENTATIONS) { - const origName = fnName.replace(/Promise$/, ``); - if (typeof patchedFsPromises[origName] === `undefined`) - continue; - const fakeImpl = fakeFs[fnName]; - if (typeof fakeImpl === `undefined`) - continue; - if (fnName === `open`) - continue; - setupFn(patchedFsPromises, origName, (pathLike, ...args) => { - if (pathLike instanceof FileHandle) { - return pathLike[origName].apply(pathLike, args); - } else { - return fakeImpl.call(fakeFs, pathLike, ...args); - } - }); - } - setupFn(patchedFsPromises, `open`, async (...args) => { - const fd = await fakeFs.openPromise(...args); - return new FileHandle(fd, fakeFs); - }); - } - { - patchedFs.read[nodeUtils.promisify.custom] = async (fd, buffer, ...args) => { - const res = fakeFs.readPromise(fd, buffer, ...args); - return { bytesRead: await res, buffer }; - }; - patchedFs.write[nodeUtils.promisify.custom] = async (fd, buffer, ...args) => { - const res = fakeFs.writePromise(fd, buffer, ...args); - return { bytesWritten: await res, buffer }; - }; - } -} - -let cachedInstance; -let registeredFactory = () => { - throw new Error(`Assertion failed: No libzip instance is available, and no factory was configured`); -}; -function setFactory(factory) { - registeredFactory = factory; -} -function getInstance() { - if (typeof cachedInstance === `undefined`) - cachedInstance = registeredFactory(); - return cachedInstance; -} - -var libzipSync = {exports: {}}; - -(function (module, exports) { -var frozenFs = Object.assign({}, fs__default.default); -var createModule = function() { - var _scriptDir = void 0; - if (typeof __filename !== "undefined") - _scriptDir = _scriptDir || __filename; - return function(createModule2) { - createModule2 = createModule2 || {}; - var Module = typeof createModule2 !== "undefined" ? createModule2 : {}; - var readyPromiseResolve, readyPromiseReject; - Module["ready"] = new Promise(function(resolve, reject) { - readyPromiseResolve = resolve; - readyPromiseReject = reject; - }); - var moduleOverrides = {}; - var key; - for (key in Module) { - if (Module.hasOwnProperty(key)) { - moduleOverrides[key] = Module[key]; - } - } - var scriptDirectory = ""; - function locateFile(path) { - if (Module["locateFile"]) { - return Module["locateFile"](path, scriptDirectory); - } - return scriptDirectory + path; - } - var read_, readBinary; - var nodeFS; - var nodePath; - { - { - scriptDirectory = __dirname + "/"; - } - read_ = function shell_read(filename, binary) { - var ret = tryParseAsDataURI(filename); - if (ret) { - return binary ? ret : ret.toString(); - } - if (!nodeFS) - nodeFS = frozenFs; - if (!nodePath) - nodePath = path__default.default; - filename = nodePath["normalize"](filename); - return nodeFS["readFileSync"](filename, binary ? null : "utf8"); - }; - readBinary = function readBinary2(filename) { - var ret = read_(filename, true); - if (!ret.buffer) { - ret = new Uint8Array(ret); - } - assert(ret.buffer); - return ret; - }; - if (process["argv"].length > 1) { - process["argv"][1].replace(/\\/g, "/"); - } - process["argv"].slice(2); - Module["inspect"] = function() { - return "[Emscripten Module object]"; - }; - } - Module["print"] || console.log.bind(console); - var err = Module["printErr"] || console.warn.bind(console); - for (key in moduleOverrides) { - if (moduleOverrides.hasOwnProperty(key)) { - Module[key] = moduleOverrides[key]; - } - } - moduleOverrides = null; - if (Module["arguments"]) - ; - if (Module["thisProgram"]) - ; - if (Module["quit"]) - ; - var wasmBinary; - if (Module["wasmBinary"]) - wasmBinary = Module["wasmBinary"]; - Module["noExitRuntime"] || true; - if (typeof WebAssembly !== "object") { - abort("no native wasm support detected"); - } - function getValue(ptr, type, noSafe) { - type = type || "i8"; - if (type.charAt(type.length - 1) === "*") - type = "i32"; - switch (type) { - case "i1": - return HEAP8[ptr >> 0]; - case "i8": - return HEAP8[ptr >> 0]; - case "i16": - return LE_HEAP_LOAD_I16((ptr >> 1) * 2); - case "i32": - return LE_HEAP_LOAD_I32((ptr >> 2) * 4); - case "i64": - return LE_HEAP_LOAD_I32((ptr >> 2) * 4); - case "float": - return LE_HEAP_LOAD_F32((ptr >> 2) * 4); - case "double": - return LE_HEAP_LOAD_F64((ptr >> 3) * 8); - default: - abort("invalid type for getValue: " + type); - } - return null; - } - var wasmMemory; - var ABORT = false; - function assert(condition, text) { - if (!condition) { - abort("Assertion failed: " + text); - } - } - function getCFunc(ident) { - var func = Module["_" + ident]; - assert( - func, - "Cannot call unknown function " + ident + ", make sure it is exported" - ); - return func; - } - function ccall(ident, returnType, argTypes, args, opts) { - var toC = { - string: function(str) { - var ret2 = 0; - if (str !== null && str !== void 0 && str !== 0) { - var len = (str.length << 2) + 1; - ret2 = stackAlloc(len); - stringToUTF8(str, ret2, len); - } - return ret2; - }, - array: function(arr) { - var ret2 = stackAlloc(arr.length); - writeArrayToMemory(arr, ret2); - return ret2; - } - }; - function convertReturnValue(ret2) { - if (returnType === "string") - return UTF8ToString(ret2); - if (returnType === "boolean") - return Boolean(ret2); - return ret2; - } - var func = getCFunc(ident); - var cArgs = []; - var stack = 0; - if (args) { - for (var i = 0; i < args.length; i++) { - var converter = toC[argTypes[i]]; - if (converter) { - if (stack === 0) - stack = stackSave(); - cArgs[i] = converter(args[i]); - } else { - cArgs[i] = args[i]; - } - } - } - var ret = func.apply(null, cArgs); - ret = convertReturnValue(ret); - if (stack !== 0) - stackRestore(stack); - return ret; - } - function cwrap(ident, returnType, argTypes, opts) { - argTypes = argTypes || []; - var numericArgs = argTypes.every(function(type) { - return type === "number"; - }); - var numericRet = returnType !== "string"; - if (numericRet && numericArgs && !opts) { - return getCFunc(ident); - } - return function() { - return ccall(ident, returnType, argTypes, arguments); - }; - } - var UTF8Decoder = new TextDecoder("utf8"); - function UTF8ToString(ptr, maxBytesToRead) { - if (!ptr) - return ""; - var maxPtr = ptr + maxBytesToRead; - for (var end = ptr; !(end >= maxPtr) && HEAPU8[end]; ) - ++end; - return UTF8Decoder.decode(HEAPU8.subarray(ptr, end)); - } - function stringToUTF8Array(str, heap, outIdx, maxBytesToWrite) { - if (!(maxBytesToWrite > 0)) - return 0; - var startIdx = outIdx; - var endIdx = outIdx + maxBytesToWrite - 1; - for (var i = 0; i < str.length; ++i) { - var u = str.charCodeAt(i); - if (u >= 55296 && u <= 57343) { - var u1 = str.charCodeAt(++i); - u = 65536 + ((u & 1023) << 10) | u1 & 1023; - } - if (u <= 127) { - if (outIdx >= endIdx) - break; - heap[outIdx++] = u; - } else if (u <= 2047) { - if (outIdx + 1 >= endIdx) - break; - heap[outIdx++] = 192 | u >> 6; - heap[outIdx++] = 128 | u & 63; - } else if (u <= 65535) { - if (outIdx + 2 >= endIdx) - break; - heap[outIdx++] = 224 | u >> 12; - heap[outIdx++] = 128 | u >> 6 & 63; - heap[outIdx++] = 128 | u & 63; - } else { - if (outIdx + 3 >= endIdx) - break; - heap[outIdx++] = 240 | u >> 18; - heap[outIdx++] = 128 | u >> 12 & 63; - heap[outIdx++] = 128 | u >> 6 & 63; - heap[outIdx++] = 128 | u & 63; - } - } - heap[outIdx] = 0; - return outIdx - startIdx; - } - function stringToUTF8(str, outPtr, maxBytesToWrite) { - return stringToUTF8Array(str, HEAPU8, outPtr, maxBytesToWrite); - } - function lengthBytesUTF8(str) { - var len = 0; - for (var i = 0; i < str.length; ++i) { - var u = str.charCodeAt(i); - if (u >= 55296 && u <= 57343) - u = 65536 + ((u & 1023) << 10) | str.charCodeAt(++i) & 1023; - if (u <= 127) - ++len; - else if (u <= 2047) - len += 2; - else if (u <= 65535) - len += 3; - else - len += 4; - } - return len; - } - function allocateUTF8(str) { - var size = lengthBytesUTF8(str) + 1; - var ret = _malloc(size); - if (ret) - stringToUTF8Array(str, HEAP8, ret, size); - return ret; - } - function writeArrayToMemory(array, buffer2) { - HEAP8.set(array, buffer2); - } - function alignUp(x, multiple) { - if (x % multiple > 0) { - x += multiple - x % multiple; - } - return x; - } - var buffer, HEAP8, HEAPU8; - var HEAP_DATA_VIEW; - function updateGlobalBufferAndViews(buf) { - buffer = buf; - Module["HEAP_DATA_VIEW"] = HEAP_DATA_VIEW = new DataView(buf); - Module["HEAP8"] = HEAP8 = new Int8Array(buf); - Module["HEAP16"] = new Int16Array(buf); - Module["HEAP32"] = new Int32Array(buf); - Module["HEAPU8"] = HEAPU8 = new Uint8Array(buf); - Module["HEAPU16"] = new Uint16Array(buf); - Module["HEAPU32"] = new Uint32Array(buf); - Module["HEAPF32"] = new Float32Array(buf); - Module["HEAPF64"] = new Float64Array(buf); - } - Module["INITIAL_MEMORY"] || 16777216; - var wasmTable; - var __ATPRERUN__ = []; - var __ATINIT__ = []; - var __ATPOSTRUN__ = []; - function preRun() { - if (Module["preRun"]) { - if (typeof Module["preRun"] == "function") - Module["preRun"] = [Module["preRun"]]; - while (Module["preRun"].length) { - addOnPreRun(Module["preRun"].shift()); - } - } - callRuntimeCallbacks(__ATPRERUN__); - } - function initRuntime() { - callRuntimeCallbacks(__ATINIT__); - } - function postRun() { - if (Module["postRun"]) { - if (typeof Module["postRun"] == "function") - Module["postRun"] = [Module["postRun"]]; - while (Module["postRun"].length) { - addOnPostRun(Module["postRun"].shift()); - } - } - callRuntimeCallbacks(__ATPOSTRUN__); - } - function addOnPreRun(cb) { - __ATPRERUN__.unshift(cb); - } - function addOnInit(cb) { - __ATINIT__.unshift(cb); - } - function addOnPostRun(cb) { - __ATPOSTRUN__.unshift(cb); - } - var runDependencies = 0; - var dependenciesFulfilled = null; - function addRunDependency(id) { - runDependencies++; - if (Module["monitorRunDependencies"]) { - Module["monitorRunDependencies"](runDependencies); - } - } - function removeRunDependency(id) { - runDependencies--; - if (Module["monitorRunDependencies"]) { - Module["monitorRunDependencies"](runDependencies); - } - if (runDependencies == 0) { - if (dependenciesFulfilled) { - var callback = dependenciesFulfilled; - dependenciesFulfilled = null; - callback(); - } - } - } - Module["preloadedImages"] = {}; - Module["preloadedAudios"] = {}; - function abort(what) { - if (Module["onAbort"]) { - Module["onAbort"](what); - } - what += ""; - err(what); - ABORT = true; - what = "abort(" + what + "). Build with -s ASSERTIONS=1 for more info."; - var e = new WebAssembly.RuntimeError(what); - readyPromiseReject(e); - throw e; - } - var dataURIPrefix = "data:application/octet-stream;base64,"; - function isDataURI(filename) { - return filename.startsWith(dataURIPrefix); - } - var wasmBinaryFile = "data:application/octet-stream;base64,AGFzbQEAAAAB/wEkYAN/f38Bf2ABfwF/YAJ/fwF/YAF/AGAEf39/fwF/YAN/f38AYAV/f39/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naiABIAIQBxoLlgEBAn8CQAJAIAJFBEAgAacQCSIFRQ0BQRgQCSIEDQIgBRAGDAELIAIhBUEYEAkiBA0BCyADBEAgA0EANgIEIANBDjYCAAtBAA8LIARCADcDECAEIAE3AwggBCAFNgIEIARBAToAACAEIAJFOgABIAAgBSABIAMQZUEASAR/IAQtAAEEQCAEKAIEEAYLIAQQBkEABSAECwubAgEDfyAALQAAQSBxRQRAAkAgASEDAkAgAiAAIgEoAhAiAAR/IAAFAn8gASABLQBKIgBBAWsgAHI6AEogASgCACIAQQhxBEAgASAAQSByNgIAQX8MAQsgAUIANwIEIAEgASgCLCIANgIcIAEgADYCFCABIAAgASgCMGo2AhBBAAsNASABKAIQCyABKAIUIgVrSwRAIAEgAyACIAEoAiQRAAAaDAILAn8gASwAS0F/SgRAIAIhAANAIAIgACIERQ0CGiADIARBAWsiAGotAABBCkcNAAsgASADIAQgASgCJBEAACAESQ0CIAMgBGohAyABKAIUIQUgAiAEawwBCyACCyEAIAUgAyAAEAcaIAEgASgCFCAAajYCFAsLCwvNBQEGfyAAKAIwIgNBhgJrIQYgACgCPCECIAMhAQNAIAAoAkQgAiAAKAJoIgRqayECIAEgBmogBE0EQCAAKAJIIgEgASADaiADEAcaAkAgAyAAKAJsIgFNBEAgACABIANrNgJsDAELIABCADcCbAsgACAAKAJoIANrIgE2AmggACAAKAJYIANrNgJYIAEgACgChC5JBEAgACABNgKELgsgAEH8gAEoAgARAwAgAiADaiECCwJAIAAoAgAiASgCBCIERQ0AIAAoAjwhBSAAIAIgBCACIARJGyICBH8gACgCSCAAKAJoaiAFaiEFIAEgBCACazYCBAJAAkACQAJAIAEoAhwiBCgCFEEBaw4CAQACCyAEQaABaiAFIAEoAgAgAkHcgAEoAgARCAAMAgsgASABKAIwIAUgASgCACACQcSAASgCABEEADYCMAwBCyAFIAEoAgAgAhAHGgsgASABKAIAIAJqNgIAIAEgASgCCCACajYCCCAAKAI8BSAFCyACaiICNgI8AkAgACgChC4iASACakEDSQ0AIAAoAmggAWshAQJAIAAoAnRBgQhPBEAgACAAIAAoAkggAWoiAi0AACACLQABIAAoAnwRAAA2AlQMAQsgAUUNACAAIAFBAWsgACgChAERAgAaCyAAKAKELiAAKAI8IgJBAUZrIgRFDQAgACABIAQgACgCgAERBQAgACAAKAKELiAEazYChC4gACgCPCECCyACQYUCSw0AIAAoAgAoAgRFDQAgACgCMCEBDAELCwJAIAAoAkQiAiAAKAJAIgNNDQAgAAJ/IAAoAjwgACgCaGoiASADSwRAIAAoAkggAWpBACACIAFrIgNBggIgA0GCAkkbIgMQGSABIANqDAELIAFBggJqIgEgA00NASAAKAJIIANqQQAgAiADayICIAEgA2siAyACIANJGyIDEBkgACgCQCADags2AkALC50CAQF/AkAgAAJ/IAAoAqAuIgFBwABGBEAgACgCBCAAKAIQaiAAKQOYLjcAACAAQgA3A5guIAAgACgCEEEIajYCEEEADAELIAFBIE4EQCAAKAIEIAAoAhBqIAApA5guPgAAIAAgAEGcLmo1AgA3A5guIAAgACgCEEEEajYCECAAIAAoAqAuQSBrIgE2AqAuCyABQRBOBEAgACgCBCAAKAIQaiAAKQOYLj0AACAAIAAoAhBBAmo2AhAgACAAKQOYLkIQiDcDmC4gACAAKAKgLkEQayIBNgKgLgsgAUEISA0BIAAgACgCECIBQQFqNgIQIAEgACgCBGogACkDmC48AAAgACAAKQOYLkIIiDcDmC4gACgCoC5BCGsLNgKgLgsLEAAgACgCCBAGIABBADYCCAvwAQECf0F/IQECQCAALQAoDQAgACgCJEEDRgRAIABBDGoEQCAAQQA2AhAgAEEXNgIMC0F/DwsCQCAAKAIgBEAgACkDGELAAINCAFINASAAQQxqBEAgAEEANgIQIABBHTYCDAtBfw8LAkAgACgCACICRQ0AIAIQMkF/Sg0AIAAoAgAhASAAQQxqIgAEQCAAIAEoAgw2AgAgACABKAIQNgIEC0F/DwsgAEEAQgBBABAOQn9VDQAgACgCACIARQ0BIAAQGhpBfw8LQQAhASAAQQA7ATQgAEEMagRAIABCADcCDAsgACAA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QcjsBDEEAIQMMAQsgASABLwEMQf/vA3E7AQxBACEFIANFBEBB9eABIAEoAjAgAEEIahBpIgVFDQILIAJBgAJxBEAgBSEDDAELIARBAkcEQCAFIQMMAQtB9cYBIAEoAjggAEEIahBpIgNFBEAgBRAcDAILIAMgBTYCAAsgASABLwEMQf7/A3EgAS8BUiIFQQBHcjsBDAJAAkACQAJAAn8CQAJAIAEpAyhC/v///w9WDQAgASkDIEL+////D1YNACACQYAEcUUNASABKQNIQv////8PVA0BCyAFQYECa0H//wNxQQNJIQdBAQwBCyAFQYECa0H//wNxIQQgAkGACnFBgApHDQEgBEEDSSEHQQALIQkgBkIcEBciBEUEQCAAQQhqIgAEQCAAQQA2AgQgAEEONgIACyADEBwMBQsgAkGACHEhBQJAAkAgAkGAAnEEQAJAIAUNACABKQMgQv////8PVg0AIAEpAyhCgICAgBBUDQMLIAQgASkDKBAYIAEpAyAhDAwBCwJAAkACQCAFDQAgASkDIEL/////D1YNACABKQMoIgxC/////w9WDQEgASkDSEKAgICAEFQNBAsgASkDKCIMQv////8PVA0BCyAEIAwQGAsgASkDICIMQv////8PWgRAIAQgDBAYCyABKQNIIgxC/////w9UDQELIAQgDBAYCyAELQAARQRAIABBCGoiAARAIABBADYCBCAAQRQ2AgALIAQQCCADEBwMBQtBASEKQQEgBC0AAAR+IAQpAxAFQgALp0H//wNxIAYQRyEFIAQQCCAFIAM2AgAgBw0BDAILIAMhBSAEQQJLDQELIAZCBxAXIgRFBEAgAEEIaiIABEAgAEEANgIEIABBDjYCAAsgBRAcDAMLIARBAhANIARBhxJBAhAsIAQgAS0AUhBwIAQgAS8BEBANIAQtAABFBEAgAEEIaiIABEAgAEEANgIEIABBFDYCAAsgBBAIDAILQYGyAkEHIAYQRyEDIAQQCCADIAU2AgBBASELIAMhBQsgBkIuEBciA0UEQCAAQQhqIgAEQCAAQQA2AgQgAEEONgIACyAFEBwMAgsgA0GjEkGoEiACQYACcSIHG0EEECwgB0UEQCADIAkEf0EtBSABLwE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gIYIAAgBDYCDCAAIAE2AggLC1gCAX8BfgJAAn9BACAARQ0AGiAArUIChiICpyIBIABBBHJBgIAESQ0AGkF/IAEgAkIgiKcbCyIBEAkiAEUNACAAQQRrLQAAQQNxRQ0AIABBACABEBkLIAALQwEDfwJAIAJFDQADQCAALQAAIgQgAS0AACIFRgRAIAFBAWohASAAQQFqIQAgAkEBayICDQEMAgsLIAQgBWshAwsgAwsUACAAEEAgACgCABAgIAAoAgQQIAutBAIBfgV/IwBBEGsiBCQAIAAgAWshBgJAAkAgAUEBRgRAIAAgBi0AACACEBkMAQsgAUEJTwRAIAAgBikAADcAACAAIAJBAWtBB3FBAWoiBWohACACIAVrIgFFDQIgBSAGaiECA0AgACACKQAANwAAIAJBCGohAiAAQQhqIQAgAUEIayIBDQALDAILAkACQAJAAkAgAUEEaw4FAAICAgECCyAEIAYoAAAiATYCBCAEIAE2AgAMAgsgBCAGKQAANwMADAELQQghByAEQQhqIQgDQCAIIAYgByABIAEgB0sbIgUQByAFaiEIIAcgBWsiBw0ACyAEIAQpAwg3AwALAkAgBQ0AIAJBEEkNACAEKQMAIQMgAkEQayIGQQR2QQFqQQdxIgEEQANAIAAgAzcACCAAIAM3AAAgAkEQayECIABBEGohACABQQFrIgENAAsLIAZB8ABJDQADQCAAIAM3AHggACADNwBwIAAgAzcAaCAAIAM3AGAgACADNwBYIAAgAzcAUCAAIAM3AEggACADNwBAIAAgAzcAOCAAIAM3ADAgACADNwAoIAAgAzcAICAAIAM3ABggACADNwAQIAAgAzcACCAAIAM3AAAgAEGAAWohACACQYABayICQQ9LDQALCyACQQhPBEBBCCAFayEBA0AgACAEKQMANwAAIAAgAWohACACIAFrIgJBB0sNAAsLIAJFDQEgACAEIAIQBxoLIAAgAmohAAsgBEEQaiQAIAALXwECfyAAKAIIIgEEQCABEAsgAEEANgIICwJAIAAoAgQiAUUNACABKAIAIgJBAXFFDQAgASgCEEF+Rw0AIAEgAkF+cSICNgIAIAINACABECAgAEEANgIECyAAQQA6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ogAq0iHn0iHFANACACIANqIQIDQAJAIBwgHiAcIB5UGyIbQiBUBEAgGyEaDAELIBsiGkIgfSIgQgWIQgF8QgODIh9QRQRAA0AgASACKQAANwAAIAEgAikAGDcAGCABIAIpABA3ABAgASACKQAINwAIIBpCIH0hGiACQSBqIQIgAUEgaiEBIB9CAX0iH0IAUg0ACwsgIELgAFQNAANAIAEgAikAADcAACABIAIpABg3ABggASACKQAQNwAQIAEgAikACDcACCABIAIpADg3ADggASACKQAwNwAwIAEgAikAKDcAKCABIAIpACA3ACAgASACKQBYNwBYIAEgAikAUDcAUCABIAIpAEg3AEggASACKQBANwBAIAEgAikAYDcAYCABIAIpAGg3AGggASACKQBwNwBwIAEgAikAeDcAeCACQYABaiECIAFBgAFqIQEgGkKAAX0iGkIfVg0ACwsgGkIQWgRAIAEgAikAADcAACABIAIpAAg3AAggGkIQfSEaIAJBEGohAiABQRBqIQELIBpCCFoEQCABIAIpAAA3AAAgGkIIfSEaIAJBCGohAiABQQhqIQELIBpCBFoEQCABIAIoAAA2AAAgGkIEfSEaIAJBBGohAiABQQRqIQELIBpCAloEQCABIAIvAAA7AAAgGkICfSEaIAJBAmohAiABQQJqIQELIBwgG30hHCAaUEUEQCABIAItAAA6AAAgAkEBaiECIAFBAWohAQsgHEIAUg0ACwsgDiEGIAwhAwsgBSAGSwRAAkACQCABIANNIAEgDyABa6wiGiAGrSIbIBogG1QbIhqnIglqIgIgA0txDQAgAyAJaiABSyABIANPcQ0AIAEgAyAJEAcaDAELIAEgAyADIAFrIgEgAUEfdSIBaiABcyIBEAcgAWohAiAaIAGtIh59IhxQDQAgASADaiEBA0ACQCAcIB4gHCAeVBsiG0IgVARAIBshGgwBCyAbIhpCIH0iIEIFiEIBfEIDgyIfUEUEQANAIAIgASkAADcAACACIAEpABg3ABggAiABKQAQNwAQIAIgASkACDcACCAaQiB9IRogAUEgaiEBIAJBIGohAiAfQgF9Ih9CAFINAAsLICBC4ABUDQADQCACIAEpAAA3AAAgAiABKQAYNwAYIAIgASkAEDcAECACIAEpAAg3AAggAiABKQA4NwA4IAIgASkAMDcAMCACIAEpACg3ACggAiABKQAgNwAgIAIgASkAWDcAWCACIAEpAFA3AFAgAiABKQBINwBIIAIgASkAQDcAQCACIAEpAGA3AGAgAiABKQBoNwBoIAIgASkAcDcAcCACIAEpAHg3AHggAUGAAWohASACQYABaiECIBpCgAF9IhpCH1YNAAsLIBpCEFoEQCACIAEpAAA3AAAgAiABKQAINwAIIBpCEH0hGiACQRBqIQIgAUEQaiEBCyAaQghaBEAgAiABKQAANwAAIBpCCH0hGiACQQhqIQIgAUEIaiEBCyAaQgRaBEAgAiABKAAANgAAIBpCBH0hGiACQQRqIQIgAUEEaiEBCyAaQgJaBEAgAiABLwAAOwAAIBpCAn0hGiACQQJqIQIgAUECaiEBCyAcIBt9IRwgGlBFBEAgAiABLQAAOgAAIAJBAWohAiABQQFqIQELIBxCAFINAAsLIAUgBmshAUEAIARrIQUCQCAEQQdLBEAgBCEDDAELIAEgBE0EQCAEIQMMAQsgAiAEayEFA0ACQCACIAUpAAA3AAAgBEEBdCEDIAEgBGshASACIARqIQIgBEEDSw0AIAMhBCABIANLDQELC0EAIANrIQULIAIgBWohBAJAIAUgDyACa6wiGiABrSIbIBogG1QbIhqnIgFIIAVBf0pxDQAgBUEBSCABIARqIAJLcQ0AIAIgBCABEAcgAWohAgwDCyACIAQgAyADQR91IgFqIAFzIgEQByABaiECIBogAa0iHn0iHFANAiABIARqIQEDQAJAIBwgHiAcIB5UGyIbQiBUBEAgGyEaDAELIBsiGkIgfSIgQgWIQgF8QgODIh9QRQRAA0AgAiABKQAANwAAIAIgASkAGDcAGCACIAEpABA3ABAgAiABKQAINwAIIBpCIH0hGiABQSBqIQEgAkEgaiECIB9CAX0iH0IAUg0ACwsgIELgAFQNAANAIAIgASkAADcAACACIAEpABg3ABggAiABKQAQNwAQIAIgASkACDcACCACIAEpADg3ADggAiABKQAwNwAwIAIgASkAKDcAKCACIAEpACA3ACAgAiABKQBYNwBYIAIgASkAUDcAUCACIAEpAEg3AEggAiABKQBANwBAIAIgASkAYDcAYCACIAEpAGg3AGggAiABKQBwNwBwIAIgASkAeDcAeCABQYABaiEBIAJBgAFqIQIgGkKAAX0iGkIfVg0ACwsgGkIQWgRAIAIgASkAADcAACACIAEpAAg3AAggGkIQfSEaIAJBEGohAiABQRBqIQELIBpCCFoEQCACIAEpAAA3AAAgGkIIfSEaIAJBCGohAiABQQhqIQELIBpCBFoEQCACIAEoAAA2AAAgGkIEfSEaIAJBBGohAiABQQRqIQELIBpCAloEQCACIAEvAAA7AAAgGkICfSEaIAJBAmohAiABQQJqIQELIBwgG30hHCAaUEUEQCACIAEtAAA6AAAgAkEBaiECIAFBAWohAQsgHFBFDQALDAILAkAgASADTSABIA8gAWusIhogBa0iGyAaIBtUGyIapyIEaiICIANLcQ0AIAMgBGogAUsgASADT3ENACABIAMgBBAHGgwCCyABIAMgAyABayIBIAFBH3UiAWogAXMiARAHIAFqIQIgGiABrSIefSIcUA0BIAEgA2ohAQNAAkAgHCAeIBwgHlQbIhtCIFQEQCAbIRoMAQsgGyIaQiB9IiBCBYhCAXxCA4MiH1BFBEADQCACIAEpAAA3AAAgAiABKQAYNwAYIAIgASkAEDcAECACIAEpAAg3AAggGkIgfSEaIAFBIGohASACQSBqIQIgH0IBfSIfQgBSDQALCyAgQuAAVA0AA0AgAiABKQAANwAAIAIgASkAGDcAGCACIAEpABA3ABAgAiABKQAINwAIIAIgASkAODcAOCACIAEpADA3ADAgAiABKQAoNwAoIAIgASkAIDcAICACIAEpAFg3AFggAiABKQBQNwBQIAIgASkASDcASCACIAEpAEA3AEAgAiABKQBgNwBgIAIgASkAaDcAaCACIAEpAHA3AHAgAiABKQB4NwB4IAFBgAFqIQEgAkGAAWohAiAaQoABfSIaQh9WDQALCyAaQhBaBEAgAiABKQAANwAAIAIgASkACDcACCAaQhB9IRogAkEQaiECIAFBEGohAQsgGkIIWgRAIAIgASkAADcAACAaQgh9IRogAkEIaiECIAFBCGohAQsgGkIEWgRAIAIgASgAADYAACAaQgR9IRogAkEEaiECIAFBBGohAQsgGkICWgRAIAIgAS8AADsAACAaQgJ9IRogAkECaiECIAFBAmohAQsgHCAbfSEcIBpQRQRAIAIgAS0AADoAACACQQFqIQIgAUEBaiEBCyAcUEUNAAsMAQsCQAJAIBYEQAJAIAQgBUkEQCAHKAKYRyAESw0BCyABIARrIQMCQEEAIARrIgVBf0ogDyABa6wiGiAbIBogG1QbIhqnIgIgBUpxDQAgBUEBSCACIANqIAFLcQ0AIAEgAyACEAcgAmohAgwFCyABIAMgBCAEQR91IgFqIAFzIgEQByABaiECIBogAa0iHn0iHFANBCABIANqIQEDQAJAIBwgHiAcIB5UGyIbQiBUBEAgGyEaDAELIBsiGkIgfSIgQgWIQgF8QgODIh9QRQRAA0AgAiABKQAANwAAIAIgASkAGDcAGCACIAEpABA3ABAgAiABKQAINwAIIBpCIH0hGiABQSBqIQEgAkEgaiECIB9CAX0iH0IAUg0ACwsgIELgAFQNAANAIAIgASkAADcAACACIAEpABg3ABggAiABKQAQNwAQIAIgASkACDcACCACIAEpADg3ADggAiABKQAwNwAwIAIgASkAKDcAKCACIAEpACA3ACAgAiABKQBYNwBYIAIgASkAUDcAUCACIAEpAEg3AEggAiABKQBANwBAIAIgASkAYDcAYCACIAEpAGg3AGggAiABKQBwNwBwIAIgASkAeDcAeCABQYABaiEBIAJBgAFqIQIgGkKAAX0iGkIfVg0ACwsgGkIQWgRAIAIgASkAADcAACACIAEpAAg3AAggGkIQfSEaIAJBEGohAiABQRBqIQELIBpCCFoEQCACIAEpAAA3AAAgGkIIfSEaIAJBCGohAiABQQhqIQELIBpCBFoEQCACIAEoAAA2AAAgGkIEfSEaIAJBBGohAiABQQRqIQELIBpCAloEQCACIAEvAAA7AAAgGkICfSEaIAJBAmohAiABQQJqIQELIBwgG30hHCAaUEUEQCACIAEtAAA6AAAgAkEBaiECIAFBAWohAQsgHFBFDQALDAQLIBAgAWsiCUEBaiIGIAUg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AELIANCADcDECADQQE6AAALIAMgAS8BCBANIAMgAS8BChANIAMtAABFBEAgAEEIaiIABEAgAEEANgIEIABBFDYCAAtBfyECDAQLQX8hAiAAIARBDGpCBBAbQQBIDQMgATMBCiIGUA0AIAAgASgCDCAGEBtBAEgNAwsgASgCACIBDQALC0EAIQILIAMQCAsgBEEQaiQAIAILPAEBfyAABEAgAUGABnEhAQNAIAEgACgCBHEEQCACIAAvAQpqQQRqIQILIAAoAgAiAA0ACwsgAkH//wNxC5wBAQN/IABFBEBBAA8LIAAhAwNAAn8CQAJAIAAvAQgiAUH04AFNBEAgAUEBRg0BIAFB9cYBRg0BDAILIAFBgbICRg0AIAFB9eABRw0BCyAAKAIAIQEgAEEANgIAIAAoAgwQBiAAEAYgASADIAAgA0YbIQMCQCACRQRAQQAhAgwBCyACIAE2AgALIAEMAQsgACICKAIACyIADQALIAMLsgQCBX8BfgJAAkACQCAAIAGtEBciAQRAIAEtAAANAUEAIQAMAgsgBARAIARBADYCBCAEQQ42AgALQQAPC0EAIQADQCABLQAABH4gASkDCCABKQMQfQVCAAtCBFQNASABEAwhByABIAEQDCIGrRATIghFBEBBACECIAQEQCAEQQA2AgQgBEEVNgIACyABEAggAEUNAwNAIAAoAgAhASAAKAIMEAYgABAGIAEiAA0ACwwDCwJAAkBBEBAJIgUEQCAFIAY7AQogBSAHOwEIIAUgAjYCBCAFQQA2AgAgBkUNASAFIAggBhBjIgY2AgwgBg0CIAUQBgtBACECIAQEQCAEQQA2AgQgBEEONgIACyABEAggAEUNBANAIAAoAgAhASAAKAIMEAYgABAGIAEiAA0ACwwECyAFQQA2AgwLAkAgAEUEQCAFIQAMAQsgCSAFNgIACyAFIQkgAS0AAA0ACwsCQCABLQAABH8gASkDECABKQMIUQVBAAsNACABIAEtAAAEfiABKQMIIAEpAxB9BUIACyIKQv////8PgxATIQICQCAKpyIFQQNLDQAgAkUNACACQcEUIAUQPUUNAQtBACECIAQEQCAEQQA2AgQgBEEVNgIACyABEAggAEUNA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AIANqIQMLIAMgAiAHQQFrIgcgB0EHdkGAAmogB0GAAkkbQYDLAGotAAAiBUECdCIIaiIKLwECaiEGIAozAQAgA62GIAuEIQsgBCAFQQRJBH8gBgUgByAIQYDSAGooAgBrrSAGrYYgC4QhCyAIQcDUAGooAgAgBmoLIgVqIgNBP00EQCALIASthiAMhCELDAELIARBwABGBEAgACgCBCAAKAIQaiAMNwAAIAAgACgCEEEIajYCECAFIQMMAQsgACgCBCAAKAIQaiALIASthiAMhDcAACAAIAAoAhBBCGo2AhAgA0FAaiEDIAtBwAAgBGutiCELCyAAIAs3A5guIAAgAzYCoC4gCSAAKALwLUkNAAsLIAFBgAhqMwEAIQwCQCADIAFBgghqLwEAIgJqIgFBP00EQCAMIAOthiALhCEMDAELIANBwABGBEAgACgCBCAAKAIQaiALNwAAIAAgACgCEEEIajYCECACIQEMAQsgACgCBCAAKAIQaiAMIAOthiALhDcAACAAIAAoAhBBCGo2AhAgAUFAaiEBIAxBwAAgA2utiCEMCyAAIAw3A5guIAAgATYCoC4L8AQBA38gAEHkAWohAgNAIAIgAUECdCIDakEAOwEAIAIgA0EEcmpBADsBACABQQJqIgFBngJHDQALIABBADsBzBUgAEEAOwHYEyAAQZQWakEAOwEAIABBkBZqQQA7AQAgAEGMFmpBADsBACAAQYgWakEAOwEAIABBhBZqQQA7AQAgAEGAFmpBADsBACAAQfwVakEAOwEAIABB+BVqQQA7AQAgAEH0FWpBADsBACAAQfAVakEAOwEAIABB7BVqQQA7AQAgAEHoFWpBADsBACAAQeQVakEAOwEAIABB4BVqQQA7AQAgAEHcFWpBADsBACAAQdgVakEAOwEAIABB1BVqQQA7AQAgAEHQFWpBADsBACAAQcwUakEAOwEAIABByBRqQQA7AQAgAEHEFGpBADsBACAAQcAUakEAOwEAIABBvBRqQQA7AQAgAEG4FGpBADsBACAAQbQUakEAOwEAIABBsBRqQQA7AQAgAEGsFGpBADsBACAAQagUakEAOwEAIABBpBRqQQA7AQAgAEGgFGpBADsBACAAQZwU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NABogBCABIAYgCWtB1IABKAIAEQAACzYCMAsgA0HnADYCIAsCQCADKAIcKAIsBEAgAygCDCADKAIQIgFBAmpJBH8gBRAKIAMoAhANAkEABSABCyADKAIEaiAFKAIwOwAAIAMgAygCEEECajYCECADQaABakHkgAEoAgARAQAaCyADQfEANgIgIAUQCiADKAIQRQ0BDAcLDAYLIAUoAgQNAQsgAygCPA0AIApFDQEgAygCIEGaBUYNAQsCfyADKAKIASIBRQRAIAMgChCFAQwBCwJAAkACQCADKAKMAUECaw4CAAECCwJ/AkADQAJAAkAgAygCPA0AIAMQLyADKAI8DQAgCg0BQQAMBAsgAygCSCADKAJoai0AACEEIAMgAygC8C0iAUEBajYC8C0gASADKALsLWpBADoAACADIAMoAvAtIgFBAWo2AvAtIAEgAygC7C1qQQA6AAAgAyADKALwLSIBQQFqNgLwLSABIAMoAuwtaiAEOgAAIAMgBEECdGoiASABLwHkAUEBajsB5AEgAyADKAI8QQFrNgI8IAMgAygCaEEBaiIBNgJoIAMoAvAtIAMoAvQtRw0BQQAhBCADIAMoAlgiBkEATgR/IAMoAkggBmoFQQALIAEgBmtBABAPIAMgAygCaDYCWCADKAIAEAogAygCACgCEA0BDAILCyADQQA2AoQuIApBBEYEQCADIAMoAlgiAUEATgR/IAMoAkggAWoFQQALIAMoAmggAWtBARAPIAMgAygCaDYCWCADKAIAEApBA0ECIAMoAgAoAhAbDAILIAMoAvAtBEBBACEEIAMgAygCWCIBQQBOBH8gAygCSCABagVBAAsgAygCaCABa0EAEA8gAyADKAJoNgJYIAMoAgAQCiADKAIAKAIQRQ0BC0EBIQQLIAQLDAILAn8CQANAAkACQAJAAkACQCADKAI8Ig1BggJLDQAgAxAvAkAgAygCPCINQYICSw0AIAoNAEEADAgLIA1FDQQgDUECSw0AIAMoAmghCAwBCyADKAJoIghFBEBBACEIDAELIAMoAkggCGoiAUEBayIELQAAIgYgAS0AAEcNACAGIAQtAAJHDQAgBEEDaiEEQQAhCQJAA0AgBiAELQAARw0BIAQt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J7IxFFMF+DZXOUJeL3z7+xtAQZNuacacmlV89OIQxVHWLH85opu2G6anDHPe4rXW6t4PvpeNN5LzsY36i/Q0X7/IjjfLf0cVz0P9fbcGRNiDOv6w+bBTje2M6eWVyVBAofXqKNVCIwrRfpliqTsgx50Hmq/gVKKDhGgY6/wtoU7IERsmvKbSBLiaaGzA39HJ9ONroYFAQAAJ0HAAAsCQAAhgUAAEgFAACnBQAAAAQAADIFAAC8BQAALAkAQYDBAAv3CQwACACMAAgATAAIAMwACAAsAAgArAAIAGwACADsAAgAHAAIAJwACABcAAgA3AAIADwACAC8AAgAfAAIAPwACAACAAgAggAIAEIACADCAAgAIgAIAKIACABiAAgA4gAIABIACACSAAgAUgAIANIACAAyAAgAsgAIAHIACADyAAgACgAIAIoACABKAAgAygAIACoACACqAAgAagAIAOoACAAaAAgAmgAIAFoACADaAAgAOgAIALoACAB6AAgA+gAIAAYACACGAAgARgAIAMYACAAmAAgApgAIAGYACADmAAgAFgAIAJYACABWAAgA1gAIADYACAC2AAgAdgAIAPYACAAOAAgAjgAIAE4ACADOAAgALgAIAK4ACABuAAgA7gAIAB4ACACeAAgAXgAIAN4ACAA+AAgAvgAIAH4ACAD+AAgAAQAIAIEACABBAAgAwQAIACEACAChAAgAYQAIAOEACAARAAgAkQAIAFEACADRAAgAMQAIALEACABxAAgA8QAIAAkACACJAAgASQAIAMkACAApAAgAqQAIAGkACADpAAgAGQAIAJkACABZAAgA2QAIADkACAC5AAgAeQAIAPkACAAFAAgAhQAIAEUACADFAAgAJQAIAKUACABlAAgA5QAIABUACACVAAgAVQAIANUACAA1AAgAtQAIAHUACAD1AAgADQAIAI0ACABNAAgAzQAIAC0ACACtAAgAbQAIAO0ACAAdAAgAnQAIAF0ACADdAAgAPQAIAL0ACAB9AAgA/QAIABMACQATAQkAkwAJAJMBCQBTAAkAUwEJANMACQDTAQkAMwAJADMBCQCzAAkAswEJAHMACQBzAQkA8wAJAPMBCQALAAkACwEJAIsACQCLAQkASwAJAEs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Jlc3MgZmFtaWx5IG5vdCBzdXBwb3J0ZWQgYnkgcHJvdG9jb2wAQWRkcmVzcyBub3QgYXZhaWxhYmxlAE5ldHdvcmsgaXMgZG93bgBOZXR3b3JrIHVucmVhY2hhYmxlAENvbm5lY3Rpb24gcmVzZXQgYnkgbmV0d29yawBDb25uZWN0aW9uIGFib3J0ZWQATm8gYnVmZmVyIHNwYWNlIGF2YWlsYWJsZQBTb2NrZXQgaXMgY29ubmVjdGVkAFNvY2tldCBub3QgY29ubmVjdGVkAENhbm5vdCBzZW5kIGFmdGVyIHNvY2tldCBzaHV0ZG93bgBPcGVyYXRpb24gYWxyZWFkeSBpbiBwcm9ncmVzcwBPcGVyYXRpb24gaW4gcHJvZ3Jlc3MAU3RhbGUgZmlsZSBoYW5kbGUAUmVtb3RlIEkvTyBlcnJvcgBRdW90YSBleGNlZWRlZABObyBtZWRpdW0gZm91bmQAV3JvbmcgbWVkaXVtIHR5cGUATm8gZXJyb3IgaW5mb3JtYXRpb24AQcCAAQuFARMAAAAUAAAAFQAAABYAAAAXAAAAGAAAABkAAAAaAAAAGwAAABwAAAAdAAAAHgAAAB8AAAAgAAAAIQAAACIAAAAjAAAAgERQADEAAAAyAAAAMwAAADQAAAA1AAAANgAAADcAAAA4AAAAOQAAADIAAAAzAAAANAAAADUAAAA2AAAANwAAADgAQfSCAQsCXEQAQbCDAQsQ/////////////////////w=="; - if (!isDataURI(wasmBinaryFile)) { - wasmBinaryFile = locateFile(wasmBinaryFile); - } - function getBinary(file) { - try { - if (file == wasmBinaryFile && wasmBinary) { - return new Uint8Array(wasmBinary); - } - var binary = tryParseAsDataURI(file); - if (binary) { - return binary; - } - if (readBinary) { - return readBinary(file); - } else { - throw "sync fetching of the wasm failed: you can preload it to Module['wasmBinary'] manually, or emcc.py will do that for you when generating HTML (but not JS)"; - } - } catch (err2) { - abort(err2); - } - } - function instantiateSync(file, info) { - var instance; - var module2; - var binary; - try { - binary = getBinary(file); - module2 = new WebAssembly.Module(binary); - instance = new WebAssembly.Instance(module2, info); - } catch (e) { - var str = e.toString(); - err("failed to compile wasm module: " + str); - if (str.includes("imported Memory") || str.includes("memory import")) { - err( - "Memory size incompatibility issues may be due to changing INITIAL_MEMORY at runtime to something too large. Use ALLOW_MEMORY_GROWTH to allow any size memory (and also make sure not to set INITIAL_MEMORY at runtime to something smaller than it was at compile time)." - ); - } - throw e; - } - return [instance, module2]; - } - function createWasm() { - var info = { a: asmLibraryArg }; - function receiveInstance(instance, module2) { - var exports3 = instance.exports; - Module["asm"] = exports3; - wasmMemory = Module["asm"]["g"]; - updateGlobalBufferAndViews(wasmMemory.buffer); - wasmTable = Module["asm"]["W"]; - addOnInit(Module["asm"]["h"]); - removeRunDependency(); - } - addRunDependency(); - if (Module["instantiateWasm"]) { - try { - var exports2 = Module["instantiateWasm"](info, receiveInstance); - return exports2; - } catch (e) { - err("Module.instantiateWasm callback failed with error: " + e); - return false; - } - } - var result = instantiateSync(wasmBinaryFile, info); - receiveInstance(result[0]); - return Module["asm"]; - } - function LE_HEAP_LOAD_F32(byteOffset) { - return HEAP_DATA_VIEW.getFloat32(byteOffset, true); - } - function LE_HEAP_LOAD_F64(byteOffset) { - return HEAP_DATA_VIEW.getFloat64(byteOffset, true); - } - function LE_HEAP_LOAD_I16(byteOffset) { - return HEAP_DATA_VIEW.getInt16(byteOffset, true); - } - function LE_HEAP_LOAD_I32(byteOffset) { - return HEAP_DATA_VIEW.getInt32(byteOffset, true); - } - function LE_HEAP_STORE_I32(byteOffset, value) { - HEAP_DATA_VIEW.setInt32(byteOffset, value, true); - } - function callRuntimeCallbacks(callbacks) { - while (callbacks.length > 0) { - var callback = callbacks.shift(); - if (typeof callback == "function") { - callback(Module); - continue; - } - var func = callback.func; - if (typeof func === "number") { - if (callback.arg === void 0) { - wasmTable.get(func)(); - } else { - wasmTable.get(func)(callback.arg); - } - } else { - func(callback.arg === void 0 ? null : callback.arg); - } - } - } - function _gmtime_r(time, tmPtr) { - var date = new Date(LE_HEAP_LOAD_I32((time >> 2) * 4) * 1e3); - LE_HEAP_STORE_I32((tmPtr >> 2) * 4, date.getUTCSeconds()); - LE_HEAP_STORE_I32((tmPtr + 4 >> 2) * 4, date.getUTCMinutes()); - LE_HEAP_STORE_I32((tmPtr + 8 >> 2) * 4, date.getUTCHours()); - LE_HEAP_STORE_I32((tmPtr + 12 >> 2) * 4, date.getUTCDate()); - LE_HEAP_STORE_I32((tmPtr + 16 >> 2) * 4, date.getUTCMonth()); - LE_HEAP_STORE_I32((tmPtr + 20 >> 2) * 4, date.getUTCFullYear() - 1900); - LE_HEAP_STORE_I32((tmPtr + 24 >> 2) * 4, date.getUTCDay()); - LE_HEAP_STORE_I32((tmPtr + 36 >> 2) * 4, 0); - LE_HEAP_STORE_I32((tmPtr + 32 >> 2) * 4, 0); - var start = Date.UTC(date.getUTCFullYear(), 0, 1, 0, 0, 0, 0); - var yday = (date.getTime() - start) / (1e3 * 60 * 60 * 24) | 0; - LE_HEAP_STORE_I32((tmPtr + 28 >> 2) * 4, yday); - if (!_gmtime_r.GMTString) - _gmtime_r.GMTString = allocateUTF8("GMT"); - LE_HEAP_STORE_I32((tmPtr + 40 >> 2) * 4, _gmtime_r.GMTString); - return tmPtr; - } - function ___gmtime_r(a0, a1) { - return _gmtime_r(a0, a1); - } - function _emscripten_memcpy_big(dest, src, num) { - HEAPU8.copyWithin(dest, src, src + num); - } - function emscripten_realloc_buffer(size) { - try { - wasmMemory.grow(size - buffer.byteLength + 65535 >>> 16); - updateGlobalBufferAndViews(wasmMemory.buffer); - return 1; - } catch (e) { - } - } - function _emscripten_resize_heap(requestedSize) { - var oldSize = HEAPU8.length; - requestedSize = requestedSize >>> 0; - var maxHeapSize = 2147483648; - if (requestedSize > maxHeapSize) { - return false; - } - for (var cutDown = 1; cutDown <= 4; cutDown *= 2) { - var overGrownHeapSize = oldSize * (1 + 0.2 / cutDown); - overGrownHeapSize = Math.min( - overGrownHeapSize, - requestedSize + 100663296 - ); - var newSize = Math.min( - maxHeapSize, - alignUp(Math.max(requestedSize, overGrownHeapSize), 65536) - ); - var replacement = emscripten_realloc_buffer(newSize); - if (replacement) { - return true; - } - } - return false; - } - function _setTempRet0(val) { - } - function _time(ptr) { - var ret = Date.now() / 1e3 | 0; - if (ptr) { - LE_HEAP_STORE_I32((ptr >> 2) * 4, ret); - } - return ret; - } - function _tzset() { - if (_tzset.called) - return; - _tzset.called = true; - var currentYear = new Date().getFullYear(); - var winter = new Date(currentYear, 0, 1); - var summer = new Date(currentYear, 6, 1); - var winterOffset = winter.getTimezoneOffset(); - var summerOffset = summer.getTimezoneOffset(); - var stdTimezoneOffset = Math.max(winterOffset, summerOffset); - LE_HEAP_STORE_I32((__get_timezone() >> 2) * 4, stdTimezoneOffset * 60); - LE_HEAP_STORE_I32( - (__get_daylight() >> 2) * 4, - Number(winterOffset != summerOffset) - ); - function extractZone(date) { - var match = date.toTimeString().match(/\(([A-Za-z ]+)\)$/); - return match ? match[1] : "GMT"; - } - var winterName = extractZone(winter); - var summerName = extractZone(summer); - var winterNamePtr = allocateUTF8(winterName); - var summerNamePtr = allocateUTF8(summerName); - if (summerOffset < winterOffset) { - LE_HEAP_STORE_I32((__get_tzname() >> 2) * 4, winterNamePtr); - LE_HEAP_STORE_I32((__get_tzname() + 4 >> 2) * 4, summerNamePtr); - } else { - LE_HEAP_STORE_I32((__get_tzname() >> 2) * 4, summerNamePtr); - LE_HEAP_STORE_I32((__get_tzname() + 4 >> 2) * 4, winterNamePtr); - } - } - function _timegm(tmPtr) { - _tzset(); - var time = Date.UTC( - LE_HEAP_LOAD_I32((tmPtr + 20 >> 2) * 4) + 1900, - LE_HEAP_LOAD_I32((tmPtr + 16 >> 2) * 4), - LE_HEAP_LOAD_I32((tmPtr + 12 >> 2) * 4), - LE_HEAP_LOAD_I32((tmPtr + 8 >> 2) * 4), - LE_HEAP_LOAD_I32((tmPtr + 4 >> 2) * 4), - LE_HEAP_LOAD_I32((tmPtr >> 2) * 4), - 0 - ); - var date = new Date(time); - LE_HEAP_STORE_I32((tmPtr + 24 >> 2) * 4, date.getUTCDay()); - var start = Date.UTC(date.getUTCFullYear(), 0, 1, 0, 0, 0, 0); - var yday = (date.getTime() - start) / (1e3 * 60 * 60 * 24) | 0; - LE_HEAP_STORE_I32((tmPtr + 28 >> 2) * 4, yday); - return date.getTime() / 1e3 | 0; - } - function intArrayFromBase64(s) { - { - var buf; - try { - buf = Buffer.from(s, "base64"); - } catch (_) { - buf = new Buffer(s, "base64"); - } - return new Uint8Array( - buf["buffer"], - buf["byteOffset"], - buf["byteLength"] - ); - } - } - function tryParseAsDataURI(filename) { - if (!isDataURI(filename)) { - return; - } - return intArrayFromBase64(filename.slice(dataURIPrefix.length)); - } - var asmLibraryArg = { - e: ___gmtime_r, - c: _emscripten_memcpy_big, - d: _emscripten_resize_heap, - a: _setTempRet0, - b: _time, - f: _timegm - }; - var asm = createWasm(); - Module["___wasm_call_ctors"] = asm["h"]; - Module["_zip_ext_count_symlinks"] = asm["i"]; - Module["_zip_file_get_external_attributes"] = asm["j"]; - Module["_zipstruct_statS"] = asm["k"]; - Module["_zipstruct_stat_size"] = asm["l"]; - Module["_zipstruct_stat_mtime"] = asm["m"]; - Module["_zipstruct_stat_crc"] = asm["n"]; - Module["_zipstruct_errorS"] = asm["o"]; - Module["_zipstruct_error_code_zip"] = asm["p"]; - Module["_zipstruct_stat_comp_size"] = asm["q"]; - Module["_zipstruct_stat_comp_method"] = asm["r"]; - Module["_zip_close"] = asm["s"]; - Module["_zip_delete"] = asm["t"]; - Module["_zip_dir_add"] = asm["u"]; - Module["_zip_discard"] = asm["v"]; - Module["_zip_error_init_with_code"] = asm["w"]; - Module["_zip_get_error"] = asm["x"]; - Module["_zip_file_get_error"] = asm["y"]; - Module["_zip_error_strerror"] = asm["z"]; - Module["_zip_fclose"] = asm["A"]; - Module["_zip_file_add"] = asm["B"]; - Module["_free"] = asm["C"]; - var _malloc = Module["_malloc"] = asm["D"]; - Module["_zip_source_error"] = asm["E"]; - Module["_zip_source_seek"] = asm["F"]; - Module["_zip_file_set_external_attributes"] = asm["G"]; - Module["_zip_file_set_mtime"] = asm["H"]; - Module["_zip_fopen_index"] = asm["I"]; - Module["_zip_fread"] = asm["J"]; - Module["_zip_get_name"] = asm["K"]; - Module["_zip_get_num_entries"] = asm["L"]; - Module["_zip_source_read"] = asm["M"]; - Module["_zip_name_locate"] = asm["N"]; - Module["_zip_open_from_source"] = asm["O"]; - Module["_zip_set_file_compression"] = asm["P"]; - Module["_zip_source_buffer"] = asm["Q"]; - Module["_zip_source_buffer_create"] = asm["R"]; - Module["_zip_source_close"] = asm["S"]; - Module["_zip_source_free"] = asm["T"]; - Module["_zip_source_keep"] = asm["U"]; - Module["_zip_source_open"] = asm["V"]; - Module["_zip_source_tell"] = asm["X"]; - Module["_zip_stat_index"] = asm["Y"]; - var __get_tzname = Module["__get_tzname"] = asm["Z"]; - var __get_daylight = Module["__get_daylight"] = asm["_"]; - var __get_timezone = Module["__get_timezone"] = asm["$"]; - var stackSave = Module["stackSave"] = asm["aa"]; - var stackRestore = Module["stackRestore"] = asm["ba"]; - var stackAlloc = Module["stackAlloc"] = asm["ca"]; - Module["cwrap"] = cwrap; - Module["getValue"] = getValue; - var calledRun; - dependenciesFulfilled = function runCaller() { - if (!calledRun) - run(); - if (!calledRun) - dependenciesFulfilled = runCaller; - }; - function run(args) { - if (runDependencies > 0) { - return; - } - preRun(); - if (runDependencies > 0) { - return; - } - function doRun() { - if (calledRun) - return; - calledRun = true; - Module["calledRun"] = true; - if (ABORT) - return; - initRuntime(); - readyPromiseResolve(Module); - if (Module["onRuntimeInitialized"]) - Module["onRuntimeInitialized"](); - postRun(); - } - if (Module["setStatus"]) { - Module["setStatus"]("Running..."); - setTimeout(function() { - setTimeout(function() { - Module["setStatus"](""); - }, 1); - doRun(); - }, 1); - } else { - doRun(); - } - } - Module["run"] = run; - if (Module["preInit"]) { - if (typeof Module["preInit"] == "function") - Module["preInit"] = [Module["preInit"]]; - while (Module["preInit"].length > 0) { - Module["preInit"].pop()(); - } - } - run(); - return createModule2; - }; -}(); -module.exports = createModule; -}(libzipSync)); - -const createModule = libzipSync.exports; - -const number64 = [ - `number`, - `number` -]; -var Errors = /* @__PURE__ */ ((Errors2) => { - Errors2[Errors2["ZIP_ER_OK"] = 0] = "ZIP_ER_OK"; - Errors2[Errors2["ZIP_ER_MULTIDISK"] = 1] = "ZIP_ER_MULTIDISK"; - Errors2[Errors2["ZIP_ER_RENAME"] = 2] = "ZIP_ER_RENAME"; - Errors2[Errors2["ZIP_ER_CLOSE"] = 3] = "ZIP_ER_CLOSE"; - Errors2[Errors2["ZIP_ER_SEEK"] = 4] = "ZIP_ER_SEEK"; - Errors2[Errors2["ZIP_ER_READ"] = 5] = "ZIP_ER_READ"; - Errors2[Errors2["ZIP_ER_WRITE"] = 6] = "ZIP_ER_WRITE"; - Errors2[Errors2["ZIP_ER_CRC"] = 7] = "ZIP_ER_CRC"; - Errors2[Errors2["ZIP_ER_ZIPCLOSED"] = 8] = "ZIP_ER_ZIPCLOSED"; - Errors2[Errors2["ZIP_ER_NOENT"] = 9] = "ZIP_ER_NOENT"; - Errors2[Errors2["ZIP_ER_EXISTS"] = 10] = "ZIP_ER_EXISTS"; - Errors2[Errors2["ZIP_ER_OPEN"] = 11] = "ZIP_ER_OPEN"; - Errors2[Errors2["ZIP_ER_TMPOPEN"] = 12] = "ZIP_ER_TMPOPEN"; - Errors2[Errors2["ZIP_ER_ZLIB"] = 13] = "ZIP_ER_ZLIB"; - Errors2[Errors2["ZIP_ER_MEMORY"] = 14] = "ZIP_ER_MEMORY"; - Errors2[Errors2["ZIP_ER_CHANGED"] = 15] = "ZIP_ER_CHANGED"; - Errors2[Errors2["ZIP_ER_COMPNOTSUPP"] = 16] = "ZIP_ER_COMPNOTSUPP"; - Errors2[Errors2["ZIP_ER_EOF"] = 17] = "ZIP_ER_EOF"; - Errors2[Errors2["ZIP_ER_INVAL"] = 18] = "ZIP_ER_INVAL"; - Errors2[Errors2["ZIP_ER_NOZIP"] = 19] = "ZIP_ER_NOZIP"; - Errors2[Errors2["ZIP_ER_INTERNAL"] = 20] = "ZIP_ER_INTERNAL"; - Errors2[Errors2["ZIP_ER_INCONS"] = 21] = "ZIP_ER_INCONS"; - Errors2[Errors2["ZIP_ER_REMOVE"] = 22] = "ZIP_ER_REMOVE"; - Errors2[Errors2["ZIP_ER_DELETED"] = 23] = "ZIP_ER_DELETED"; - Errors2[Errors2["ZIP_ER_ENCRNOTSUPP"] = 24] = "ZIP_ER_ENCRNOTSUPP"; - Errors2[Errors2["ZIP_ER_RDONLY"] = 25] = "ZIP_ER_RDONLY"; - Errors2[Errors2["ZIP_ER_NOPASSWD"] = 26] = "ZIP_ER_NOPASSWD"; - Errors2[Errors2["ZIP_ER_WRONGPASSWD"] = 27] = "ZIP_ER_WRONGPASSWD"; - Errors2[Errors2["ZIP_ER_OPNOTSUPP"] = 28] = "ZIP_ER_OPNOTSUPP"; - Errors2[Errors2["ZIP_ER_INUSE"] = 29] = "ZIP_ER_INUSE"; - Errors2[Errors2["ZIP_ER_TELL"] = 30] = "ZIP_ER_TELL"; - Errors2[Errors2["ZIP_ER_COMPRESSED_DATA"] = 31] = "ZIP_ER_COMPRESSED_DATA"; - return Errors2; -})(Errors || {}); -const makeInterface = (emZip) => ({ - get HEAPU8() { - return emZip.HEAPU8; - }, - errors: Errors, - SEEK_SET: 0, - SEEK_CUR: 1, - SEEK_END: 2, - ZIP_CHECKCONS: 4, - ZIP_EXCL: 2, - ZIP_RDONLY: 16, - ZIP_FL_OVERWRITE: 8192, - ZIP_FL_COMPRESSED: 4, - ZIP_OPSYS_DOS: 0, - ZIP_OPSYS_AMIGA: 1, - ZIP_OPSYS_OPENVMS: 2, - ZIP_OPSYS_UNIX: 3, - ZIP_OPSYS_VM_CMS: 4, - ZIP_OPSYS_ATARI_ST: 5, - ZIP_OPSYS_OS_2: 6, - ZIP_OPSYS_MACINTOSH: 7, - ZIP_OPSYS_Z_SYSTEM: 8, - ZIP_OPSYS_CPM: 9, - ZIP_OPSYS_WINDOWS_NTFS: 10, - ZIP_OPSYS_MVS: 11, - ZIP_OPSYS_VSE: 12, - ZIP_OPSYS_ACORN_RISC: 13, - ZIP_OPSYS_VFAT: 14, - ZIP_OPSYS_ALTERNATE_MVS: 15, - ZIP_OPSYS_BEOS: 16, - ZIP_OPSYS_TANDEM: 17, - ZIP_OPSYS_OS_400: 18, - ZIP_OPSYS_OS_X: 19, - ZIP_CM_DEFAULT: -1, - ZIP_CM_STORE: 0, - ZIP_CM_DEFLATE: 8, - uint08S: emZip._malloc(1), - uint32S: emZip._malloc(4), - malloc: emZip._malloc, - free: emZip._free, - getValue: emZip.getValue, - openFromSource: emZip.cwrap(`zip_open_from_source`, `number`, [`number`, `number`, `number`]), - close: emZip.cwrap(`zip_close`, `number`, [`number`]), - discard: emZip.cwrap(`zip_discard`, null, [`number`]), - getError: emZip.cwrap(`zip_get_error`, `number`, [`number`]), - getName: emZip.cwrap(`zip_get_name`, `string`, [`number`, `number`, `number`]), - getNumEntries: emZip.cwrap(`zip_get_num_entries`, `number`, [`number`, `number`]), - delete: emZip.cwrap(`zip_delete`, `number`, [`number`, `number`]), - statIndex: emZip.cwrap(`zip_stat_index`, `number`, [`number`, ...number64, `number`, `number`]), - fopenIndex: emZip.cwrap(`zip_fopen_index`, `number`, [`number`, ...number64, `number`]), - fread: emZip.cwrap(`zip_fread`, `number`, [`number`, `number`, `number`, `number`]), - fclose: emZip.cwrap(`zip_fclose`, `number`, [`number`]), - dir: { - add: emZip.cwrap(`zip_dir_add`, `number`, [`number`, `string`]) - }, - file: { - add: emZip.cwrap(`zip_file_add`, `number`, [`number`, `string`, `number`, `number`]), - getError: emZip.cwrap(`zip_file_get_error`, `number`, [`number`]), - getExternalAttributes: emZip.cwrap(`zip_file_get_external_attributes`, `number`, [`number`, ...number64, `number`, `number`, `number`]), - setExternalAttributes: emZip.cwrap(`zip_file_set_external_attributes`, `number`, [`number`, ...number64, `number`, `number`, `number`]), - setMtime: emZip.cwrap(`zip_file_set_mtime`, `number`, [`number`, ...number64, `number`, `number`]), - setCompression: emZip.cwrap(`zip_set_file_compression`, `number`, [`number`, ...number64, `number`, `number`]) - }, - ext: { - countSymlinks: emZip.cwrap(`zip_ext_count_symlinks`, `number`, [`number`]) - }, - error: { - initWithCode: emZip.cwrap(`zip_error_init_with_code`, null, [`number`, `number`]), - strerror: emZip.cwrap(`zip_error_strerror`, `string`, [`number`]) - }, - name: { - locate: emZip.cwrap(`zip_name_locate`, `number`, [`number`, `string`, `number`]) - }, - source: { - fromUnattachedBuffer: emZip.cwrap(`zip_source_buffer_create`, `number`, [`number`, ...number64, `number`, `number`]), - fromBuffer: emZip.cwrap(`zip_source_buffer`, `number`, [`number`, `number`, ...number64, `number`]), - free: emZip.cwrap(`zip_source_free`, null, [`number`]), - keep: emZip.cwrap(`zip_source_keep`, null, [`number`]), - open: emZip.cwrap(`zip_source_open`, `number`, [`number`]), - close: emZip.cwrap(`zip_source_close`, `number`, [`number`]), - seek: emZip.cwrap(`zip_source_seek`, `number`, [`number`, ...number64, `number`]), - tell: emZip.cwrap(`zip_source_tell`, `number`, [`number`]), - read: emZip.cwrap(`zip_source_read`, `number`, [`number`, `number`, `number`]), - error: emZip.cwrap(`zip_source_error`, `number`, [`number`]) - }, - struct: { - statS: emZip.cwrap(`zipstruct_statS`, `number`, []), - statSize: emZip.cwrap(`zipstruct_stat_size`, `number`, [`number`]), - statCompSize: emZip.cwrap(`zipstruct_stat_comp_size`, `number`, [`number`]), - statCompMethod: emZip.cwrap(`zipstruct_stat_comp_method`, `number`, [`number`]), - statMtime: emZip.cwrap(`zipstruct_stat_mtime`, `number`, [`number`]), - statCrc: emZip.cwrap(`zipstruct_stat_crc`, `number`, [`number`]), - errorS: emZip.cwrap(`zipstruct_errorS`, `number`, []), - errorCodeZip: emZip.cwrap(`zipstruct_error_code_zip`, `number`, [`number`]) - } -}); - -function getArchivePart(path, extension) { - let idx = path.indexOf(extension); - if (idx <= 0) - return null; - let nextCharIdx = idx; - while (idx >= 0) { - nextCharIdx = idx + extension.length; - if (path[nextCharIdx] === ppath.sep) - break; - if (path[idx - 1] === ppath.sep) - return null; - idx = path.indexOf(extension, nextCharIdx); - } - if (path.length > nextCharIdx && path[nextCharIdx] !== ppath.sep) - return null; - return path.slice(0, nextCharIdx); -} -class ZipOpenFS extends MountFS { - static async openPromise(fn, opts) { - const zipOpenFs = new ZipOpenFS(opts); - try { - return await fn(zipOpenFs); - } finally { - zipOpenFs.saveAndClose(); - } - } - constructor(opts = {}) { - const fileExtensions = opts.fileExtensions; - const readOnlyArchives = opts.readOnlyArchives; - const getMountPoint = typeof fileExtensions === `undefined` ? (path) => getArchivePart(path, `.zip`) : (path) => { - for (const extension of fileExtensions) { - const result = getArchivePart(path, extension); - if (result) { - return result; - } - } - return null; - }; - const factorySync = (baseFs, p) => { - return new ZipFS(p, { - baseFs, - readOnly: readOnlyArchives, - stats: baseFs.statSync(p) - }); - }; - const factoryPromise = async (baseFs, p) => { - const zipOptions = { - baseFs, - readOnly: readOnlyArchives, - stats: await baseFs.statPromise(p) - }; - return () => { - return new ZipFS(p, zipOptions); - }; - }; - super({ - ...opts, - factorySync, - factoryPromise, - getMountPoint - }); - } -} - -const DEFAULT_COMPRESSION_LEVEL = `mixed`; -function toUnixTimestamp(time) { - if (typeof time === `string` && String(+time) === time) - return +time; - if (typeof time === `number` && Number.isFinite(time)) { - if (time < 0) { - return Date.now() / 1e3; - } else { - return time; - } - } - if (nodeUtils.types.isDate(time)) - return time.getTime() / 1e3; - throw new Error(`Invalid time`); -} -function makeEmptyArchive() { - return Buffer.from([ - 80, - 75, - 5, - 6, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0 - ]); -} -class LibzipError extends Error { - constructor(message, code) { - super(message); - this.name = `Libzip Error`; - this.code = code; - } -} -class ZipFS extends BasePortableFakeFS { - constructor(source, opts = {}) { - super(); - this.listings = /* @__PURE__ */ new Map(); - this.entries = /* @__PURE__ */ new Map(); - this.fileSources = /* @__PURE__ */ new Map(); - this.fds = /* @__PURE__ */ new Map(); - this.nextFd = 0; - this.ready = false; - this.readOnly = false; - const pathOptions = opts; - this.level = typeof pathOptions.level !== `undefined` ? pathOptions.level : DEFAULT_COMPRESSION_LEVEL; - source ??= makeEmptyArchive(); - if (typeof source === `string`) { - const { baseFs = new NodeFS() } = pathOptions; - this.baseFs = baseFs; - this.path = source; - } else { - this.path = null; - this.baseFs = null; - } - if (opts.stats) { - this.stats = opts.stats; - } else { - if (typeof source === `string`) { - try { - this.stats = this.baseFs.statSync(source); - } catch (error) { - if (error.code === `ENOENT` && pathOptions.create) { - this.stats = makeDefaultStats(); - } else { - throw error; - } - } - } else { - this.stats = makeDefaultStats(); - } - } - this.libzip = getInstance(); - const errPtr = this.libzip.malloc(4); - try { - let flags = 0; - if (opts.readOnly) { - flags |= this.libzip.ZIP_RDONLY; - this.readOnly = true; - } - if (typeof source === `string`) - source = pathOptions.create ? makeEmptyArchive() : this.baseFs.readFileSync(source); - const lzSource = this.allocateUnattachedSource(source); - try { - this.zip = this.libzip.openFromSource(lzSource, flags, errPtr); - this.lzSource = lzSource; - } catch (error) { - this.libzip.source.free(lzSource); - throw error; - } - if (this.zip === 0) { - const error = this.libzip.struct.errorS(); - this.libzip.error.initWithCode(error, this.libzip.getValue(errPtr, `i32`)); - throw this.makeLibzipError(error); - } - } finally { - this.libzip.free(errPtr); - } - this.listings.set(PortablePath.root, /* @__PURE__ */ new Set()); - const entryCount = this.libzip.getNumEntries(this.zip, 0); - for (let t = 0; t < entryCount; ++t) { - const raw = this.libzip.getName(this.zip, t, 0); - if (ppath.isAbsolute(raw)) - continue; - const p = ppath.resolve(PortablePath.root, raw); - this.registerEntry(p, t); - if (raw.endsWith(`/`)) { - this.registerListing(p); - } - } - this.symlinkCount = this.libzip.ext.countSymlinks(this.zip); - if (this.symlinkCount === -1) - throw this.makeLibzipError(this.libzip.getError(this.zip)); - this.ready = true; - } - makeLibzipError(error) { - const errorCode = this.libzip.struct.errorCodeZip(error); - const strerror = this.libzip.error.strerror(error); - const libzipError = new LibzipError(strerror, this.libzip.errors[errorCode]); - if (errorCode === this.libzip.errors.ZIP_ER_CHANGED) - throw new Error(`Assertion failed: Unexpected libzip error: ${libzipError.message}`); - return libzipError; - } - getExtractHint(hints) { - for (const fileName of this.entries.keys()) { - const ext = this.pathUtils.extname(fileName); - if (hints.relevantExtensions.has(ext)) { - return true; - } - } - return false; - } - getAllFiles() { - return Array.from(this.entries.keys()); - } - getRealPath() { - if (!this.path) - throw new Error(`ZipFS don't have real paths when loaded from a buffer`); - return this.path; - } - prepareClose() { - if (!this.ready) - throw EBUSY(`archive closed, close`); - unwatchAllFiles(this); - } - getBufferAndClose() { - this.prepareClose(); - if (this.entries.size === 0) { - this.discardAndClose(); - return makeEmptyArchive(); - } - try { - this.libzip.source.keep(this.lzSource); - if (this.libzip.close(this.zip) === -1) - throw this.makeLibzipError(this.libzip.getError(this.zip)); - if (this.libzip.source.open(this.lzSource) === -1) - throw this.makeLibzipError(this.libzip.source.error(this.lzSource)); - if (this.libzip.source.seek(this.lzSource, 0, 0, this.libzip.SEEK_END) === -1) - throw this.makeLibzipError(this.libzip.source.error(this.lzSource)); - const size = this.libzip.source.tell(this.lzSource); - if (size === -1) - throw this.makeLibzipError(this.libzip.source.error(this.lzSource)); - if (this.libzip.source.seek(this.lzSource, 0, 0, this.libzip.SEEK_SET) === -1) - throw this.makeLibzipError(this.libzip.source.error(this.lzSource)); - const buffer = this.libzip.malloc(size); - if (!buffer) - throw new Error(`Couldn't allocate enough memory`); - try { - const rc = this.libzip.source.read(this.lzSource, buffer, size); - if (rc === -1) - throw this.makeLibzipError(this.libzip.source.error(this.lzSource)); - else if (rc < size) - throw new Error(`Incomplete read`); - else if (rc > size) - throw new Error(`Overread`); - let result = Buffer.from(this.libzip.HEAPU8.subarray(buffer, buffer + size)); - if (process.env.YARN_IS_TEST_ENV && process.env.YARN_ZIP_DATA_EPILOGUE) - result = Buffer.concat([result, Buffer.from(process.env.YARN_ZIP_DATA_EPILOGUE)]); - return result; - } finally { - this.libzip.free(buffer); - } - } finally { - this.libzip.source.close(this.lzSource); - this.libzip.source.free(this.lzSource); - this.ready = false; - } - } - discardAndClose() { - this.prepareClose(); - this.libzip.discard(this.zip); - this.ready = false; - } - saveAndClose() { - if (!this.path || !this.baseFs) - throw new Error(`ZipFS cannot be saved and must be discarded when loaded from a buffer`); - if (this.readOnly) { - this.discardAndClose(); - return; - } - const newMode = this.baseFs.existsSync(this.path) || this.stats.mode === DEFAULT_MODE ? void 0 : this.stats.mode; - this.baseFs.writeFileSync(this.path, this.getBufferAndClose(), { mode: newMode }); - this.ready = false; - } - resolve(p) { - return ppath.resolve(PortablePath.root, p); - } - async openPromise(p, flags, mode) { - return this.openSync(p, flags, mode); - } - openSync(p, flags, mode) { - const fd = this.nextFd++; - this.fds.set(fd, { cursor: 0, p }); - return fd; - } - hasOpenFileHandles() { - return !!this.fds.size; - } - async opendirPromise(p, opts) { - return this.opendirSync(p, opts); - } - opendirSync(p, opts = {}) { - const resolvedP = this.resolveFilename(`opendir '${p}'`, p); - if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) - throw ENOENT(`opendir '${p}'`); - const directoryListing = this.listings.get(resolvedP); - if (!directoryListing) - throw ENOTDIR(`opendir '${p}'`); - const entries = [...directoryListing]; - const fd = this.openSync(resolvedP, `r`); - const onClose = () => { - this.closeSync(fd); - }; - return opendir(this, resolvedP, entries, { onClose }); - } - async readPromise(fd, buffer, offset, length, position) { - return this.readSync(fd, buffer, offset, length, position); - } - readSync(fd, buffer, offset = 0, length = buffer.byteLength, position = -1) { - const entry = this.fds.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`read`); - const realPosition = position === -1 || position === null ? entry.cursor : position; - const source = this.readFileSync(entry.p); - source.copy(buffer, offset, realPosition, realPosition + length); - const bytesRead = Math.max(0, Math.min(source.length - realPosition, length)); - if (position === -1 || position === null) - entry.cursor += bytesRead; - return bytesRead; - } - async writePromise(fd, buffer, offset, length, position) { - if (typeof buffer === `string`) { - return this.writeSync(fd, buffer, position); - } else { - return this.writeSync(fd, buffer, offset, length, position); - } - } - writeSync(fd, buffer, offset, length, position) { - const entry = this.fds.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`read`); - throw new Error(`Unimplemented`); - } - async closePromise(fd) { - return this.closeSync(fd); - } - closeSync(fd) { - const entry = this.fds.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`read`); - this.fds.delete(fd); - } - createReadStream(p, { encoding } = {}) { - if (p === null) - throw new Error(`Unimplemented`); - const fd = this.openSync(p, `r`); - const stream$1 = Object.assign( - new stream.PassThrough({ - emitClose: true, - autoDestroy: true, - destroy: (error, callback) => { - clearImmediate(immediate); - this.closeSync(fd); - callback(error); - } - }), - { - close() { - stream$1.destroy(); - }, - bytesRead: 0, - path: p, - pending: false - } - ); - const immediate = setImmediate(async () => { - try { - const data = await this.readFilePromise(p, encoding); - stream$1.bytesRead = data.length; - stream$1.end(data); - } catch (error) { - stream$1.destroy(error); - } - }); - return stream$1; - } - createWriteStream(p, { encoding } = {}) { - if (this.readOnly) - throw EROFS(`open '${p}'`); - if (p === null) - throw new Error(`Unimplemented`); - const chunks = []; - const fd = this.openSync(p, `w`); - const stream$1 = Object.assign( - new stream.PassThrough({ - autoDestroy: true, - emitClose: true, - destroy: (error, callback) => { - try { - if (error) { - callback(error); - } else { - this.writeFileSync(p, Buffer.concat(chunks), encoding); - callback(null); - } - } catch (err) { - callback(err); - } finally { - this.closeSync(fd); - } - } - }), - { - close() { - stream$1.destroy(); - }, - bytesWritten: 0, - path: p, - pending: false - } - ); - stream$1.on(`data`, (chunk) => { - const chunkBuffer = Buffer.from(chunk); - stream$1.bytesWritten += chunkBuffer.length; - chunks.push(chunkBuffer); - }); - return stream$1; - } - async realpathPromise(p) { - return this.realpathSync(p); - } - realpathSync(p) { - const resolvedP = this.resolveFilename(`lstat '${p}'`, p); - if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) - throw ENOENT(`lstat '${p}'`); - return resolvedP; - } - async existsPromise(p) { - return this.existsSync(p); - } - existsSync(p) { - if (!this.ready) - throw EBUSY(`archive closed, existsSync '${p}'`); - if (this.symlinkCount === 0) { - const resolvedP2 = ppath.resolve(PortablePath.root, p); - return this.entries.has(resolvedP2) || this.listings.has(resolvedP2); - } - let resolvedP; - try { - resolvedP = this.resolveFilename(`stat '${p}'`, p, void 0, false); - } catch (error) { - return false; - } - if (resolvedP === void 0) - return false; - return this.entries.has(resolvedP) || this.listings.has(resolvedP); - } - async accessPromise(p, mode) { - return this.accessSync(p, mode); - } - accessSync(p, mode = fs.constants.F_OK) { - const resolvedP = this.resolveFilename(`access '${p}'`, p); - if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) - throw ENOENT(`access '${p}'`); - if (this.readOnly && mode & fs.constants.W_OK) { - throw EROFS(`access '${p}'`); - } - } - async statPromise(p, opts = { bigint: false }) { - if (opts.bigint) - return this.statSync(p, { bigint: true }); - return this.statSync(p); - } - statSync(p, opts = { bigint: false, throwIfNoEntry: true }) { - const resolvedP = this.resolveFilename(`stat '${p}'`, p, void 0, opts.throwIfNoEntry); - if (resolvedP === void 0) - return void 0; - if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) { - if (opts.throwIfNoEntry === false) - return void 0; - throw ENOENT(`stat '${p}'`); - } - if (p[p.length - 1] === `/` && !this.listings.has(resolvedP)) - throw ENOTDIR(`stat '${p}'`); - return this.statImpl(`stat '${p}'`, resolvedP, opts); - } - async fstatPromise(fd, opts) { - return this.fstatSync(fd, opts); - } - fstatSync(fd, opts) { - const entry = this.fds.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`fstatSync`); - const { p } = entry; - const resolvedP = this.resolveFilename(`stat '${p}'`, p); - if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) - throw ENOENT(`stat '${p}'`); - if (p[p.length - 1] === `/` && !this.listings.has(resolvedP)) - throw ENOTDIR(`stat '${p}'`); - return this.statImpl(`fstat '${p}'`, resolvedP, opts); - } - async lstatPromise(p, opts = { bigint: false }) { - if (opts.bigint) - return this.lstatSync(p, { bigint: true }); - return this.lstatSync(p); - } - lstatSync(p, opts = { bigint: false, throwIfNoEntry: true }) { - const resolvedP = this.resolveFilename(`lstat '${p}'`, p, false, opts.throwIfNoEntry); - if (resolvedP === void 0) - return void 0; - if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) { - if (opts.throwIfNoEntry === false) - return void 0; - throw ENOENT(`lstat '${p}'`); - } - if (p[p.length - 1] === `/` && !this.listings.has(resolvedP)) - throw ENOTDIR(`lstat '${p}'`); - return this.statImpl(`lstat '${p}'`, resolvedP, opts); - } - statImpl(reason, p, opts = {}) { - const entry = this.entries.get(p); - if (typeof entry !== `undefined`) { - const stat = this.libzip.struct.statS(); - const rc = this.libzip.statIndex(this.zip, entry, 0, 0, stat); - if (rc === -1) - throw this.makeLibzipError(this.libzip.getError(this.zip)); - const uid = this.stats.uid; - const gid = this.stats.gid; - const size = this.libzip.struct.statSize(stat) >>> 0; - const blksize = 512; - const blocks = Math.ceil(size / blksize); - const mtimeMs = (this.libzip.struct.statMtime(stat) >>> 0) * 1e3; - const atimeMs = mtimeMs; - const birthtimeMs = mtimeMs; - const ctimeMs = mtimeMs; - const atime = new Date(atimeMs); - const birthtime = new Date(birthtimeMs); - const ctime = new Date(ctimeMs); - const mtime = new Date(mtimeMs); - const type = this.listings.has(p) ? fs.constants.S_IFDIR : this.isSymbolicLink(entry) ? fs.constants.S_IFLNK : fs.constants.S_IFREG; - const defaultMode = type === fs.constants.S_IFDIR ? 493 : 420; - const mode = type | this.getUnixMode(entry, defaultMode) & 511; - const crc = this.libzip.struct.statCrc(stat); - const statInstance = Object.assign(new StatEntry(), { uid, gid, size, blksize, blocks, atime, birthtime, ctime, mtime, atimeMs, birthtimeMs, ctimeMs, mtimeMs, mode, crc }); - return opts.bigint === true ? convertToBigIntStats(statInstance) : statInstance; - } - if (this.listings.has(p)) { - const uid = this.stats.uid; - const gid = this.stats.gid; - const size = 0; - const blksize = 512; - const blocks = 0; - const atimeMs = this.stats.mtimeMs; - const birthtimeMs = this.stats.mtimeMs; - const ctimeMs = this.stats.mtimeMs; - const mtimeMs = this.stats.mtimeMs; - const atime = new Date(atimeMs); - const birthtime = new Date(birthtimeMs); - const ctime = new Date(ctimeMs); - const mtime = new Date(mtimeMs); - const mode = fs.constants.S_IFDIR | 493; - const crc = 0; - const statInstance = Object.assign(new StatEntry(), { uid, gid, size, blksize, blocks, atime, birthtime, ctime, mtime, atimeMs, birthtimeMs, ctimeMs, mtimeMs, mode, crc }); - return opts.bigint === true ? convertToBigIntStats(statInstance) : statInstance; - } - throw new Error(`Unreachable`); - } - getUnixMode(index, defaultMode) { - const rc = this.libzip.file.getExternalAttributes(this.zip, index, 0, 0, this.libzip.uint08S, this.libzip.uint32S); - if (rc === -1) - throw this.makeLibzipError(this.libzip.getError(this.zip)); - const opsys = this.libzip.getValue(this.libzip.uint08S, `i8`) >>> 0; - if (opsys !== this.libzip.ZIP_OPSYS_UNIX) - return defaultMode; - return this.libzip.getValue(this.libzip.uint32S, `i32`) >>> 16; - } - registerListing(p) { - const existingListing = this.listings.get(p); - if (existingListing) - return existingListing; - const parentListing = this.registerListing(ppath.dirname(p)); - parentListing.add(ppath.basename(p)); - const newListing = /* @__PURE__ */ new Set(); - this.listings.set(p, newListing); - return newListing; - } - registerEntry(p, index) { - const parentListing = this.registerListing(ppath.dirname(p)); - parentListing.add(ppath.basename(p)); - this.entries.set(p, index); - } - unregisterListing(p) { - this.listings.delete(p); - const parentListing = this.listings.get(ppath.dirname(p)); - parentListing?.delete(ppath.basename(p)); - } - unregisterEntry(p) { - this.unregisterListing(p); - const entry = this.entries.get(p); - this.entries.delete(p); - if (typeof entry === `undefined`) - return; - this.fileSources.delete(entry); - if (this.isSymbolicLink(entry)) { - this.symlinkCount--; - } - } - deleteEntry(p, index) { - this.unregisterEntry(p); - const rc = this.libzip.delete(this.zip, index); - if (rc === -1) { - throw this.makeLibzipError(this.libzip.getError(this.zip)); - } - } - resolveFilename(reason, p, resolveLastComponent = true, throwIfNoEntry = true) { - if (!this.ready) - throw EBUSY(`archive closed, ${reason}`); - let resolvedP = ppath.resolve(PortablePath.root, p); - if (resolvedP === `/`) - return PortablePath.root; - const fileIndex = this.entries.get(resolvedP); - if (resolveLastComponent && fileIndex !== void 0) { - if (this.symlinkCount !== 0 && this.isSymbolicLink(fileIndex)) { - const target = this.getFileSource(fileIndex).toString(); - return this.resolveFilename(reason, ppath.resolve(ppath.dirname(resolvedP), target), true, throwIfNoEntry); - } else { - return resolvedP; - } - } - while (true) { - const parentP = this.resolveFilename(reason, ppath.dirname(resolvedP), true, throwIfNoEntry); - if (parentP === void 0) - return parentP; - const isDir = this.listings.has(parentP); - const doesExist = this.entries.has(parentP); - if (!isDir && !doesExist) { - if (throwIfNoEntry === false) - return void 0; - throw ENOENT(reason); - } - if (!isDir) - throw ENOTDIR(reason); - resolvedP = ppath.resolve(parentP, ppath.basename(resolvedP)); - if (!resolveLastComponent || this.symlinkCount === 0) - break; - const index = this.libzip.name.locate(this.zip, resolvedP.slice(1), 0); - if (index === -1) - break; - if (this.isSymbolicLink(index)) { - const target = this.getFileSource(index).toString(); - resolvedP = ppath.resolve(ppath.dirname(resolvedP), target); - } else { - break; - } - } - return resolvedP; - } - allocateBuffer(content) { - if (!Buffer.isBuffer(content)) - content = Buffer.from(content); - const buffer = this.libzip.malloc(content.byteLength); - if (!buffer) - throw new Error(`Couldn't allocate enough memory`); - const heap = new Uint8Array(this.libzip.HEAPU8.buffer, buffer, content.byteLength); - heap.set(content); - return { buffer, byteLength: content.byteLength }; - } - allocateUnattachedSource(content) { - const error = this.libzip.struct.errorS(); - const { buffer, byteLength } = this.allocateBuffer(content); - const source = this.libzip.source.fromUnattachedBuffer(buffer, byteLength, 0, 1, error); - if (source === 0) { - this.libzip.free(error); - throw this.makeLibzipError(error); - } - return source; - } - allocateSource(content) { - const { buffer, byteLength } = this.allocateBuffer(content); - const source = this.libzip.source.fromBuffer(this.zip, buffer, byteLength, 0, 1); - if (source === 0) { - this.libzip.free(buffer); - throw this.makeLibzipError(this.libzip.getError(this.zip)); - } - return source; - } - setFileSource(p, content) { - const buffer = Buffer.isBuffer(content) ? content : Buffer.from(content); - const target = ppath.relative(PortablePath.root, p); - const lzSource = this.allocateSource(content); - try { - const newIndex = this.libzip.file.add(this.zip, target, lzSource, this.libzip.ZIP_FL_OVERWRITE); - if (newIndex === -1) - throw this.makeLibzipError(this.libzip.getError(this.zip)); - if (this.level !== `mixed`) { - const method = this.level === 0 ? this.libzip.ZIP_CM_STORE : this.libzip.ZIP_CM_DEFLATE; - const rc = this.libzip.file.setCompression(this.zip, newIndex, 0, method, this.level); - if (rc === -1) { - throw this.makeLibzipError(this.libzip.getError(this.zip)); - } - } - this.fileSources.set(newIndex, buffer); - return newIndex; - } catch (error) { - this.libzip.source.free(lzSource); - throw error; - } - } - isSymbolicLink(index) { - if (this.symlinkCount === 0) - return false; - const attrs = this.libzip.file.getExternalAttributes(this.zip, index, 0, 0, this.libzip.uint08S, this.libzip.uint32S); - if (attrs === -1) - throw this.makeLibzipError(this.libzip.getError(this.zip)); - const opsys = this.libzip.getValue(this.libzip.uint08S, `i8`) >>> 0; - if (opsys !== this.libzip.ZIP_OPSYS_UNIX) - return false; - const attributes = this.libzip.getValue(this.libzip.uint32S, `i32`) >>> 16; - return (attributes & fs.constants.S_IFMT) === fs.constants.S_IFLNK; - } - getFileSource(index, opts = { asyncDecompress: false }) { - const cachedFileSource = this.fileSources.get(index); - if (typeof cachedFileSource !== `undefined`) - return cachedFileSource; - const stat = this.libzip.struct.statS(); - const rc = this.libzip.statIndex(this.zip, index, 0, 0, stat); - if (rc === -1) - throw this.makeLibzipError(this.libzip.getError(this.zip)); - const size = this.libzip.struct.statCompSize(stat); - const compressionMethod = this.libzip.struct.statCompMethod(stat); - const buffer = this.libzip.malloc(size); - try { - const file = this.libzip.fopenIndex(this.zip, index, 0, this.libzip.ZIP_FL_COMPRESSED); - if (file === 0) - throw this.makeLibzipError(this.libzip.getError(this.zip)); - try { - const rc2 = this.libzip.fread(file, buffer, size, 0); - if (rc2 === -1) - throw this.makeLibzipError(this.libzip.file.getError(file)); - else if (rc2 < size) - throw new Error(`Incomplete read`); - else if (rc2 > size) - throw new Error(`Overread`); - const memory = this.libzip.HEAPU8.subarray(buffer, buffer + size); - const data = Buffer.from(memory); - if (compressionMethod === 0) { - this.fileSources.set(index, data); - return data; - } else if (opts.asyncDecompress) { - return new Promise((resolve, reject) => { - zlib__default.default.inflateRaw(data, (error, result) => { - if (error) { - reject(error); - } else { - this.fileSources.set(index, result); - resolve(result); - } - }); - }); - } else { - const decompressedData = zlib__default.default.inflateRawSync(data); - this.fileSources.set(index, decompressedData); - return decompressedData; - } - } finally { - this.libzip.fclose(file); - } - } finally { - this.libzip.free(buffer); - } - } - async fchmodPromise(fd, mask) { - return this.chmodPromise(this.fdToPath(fd, `fchmod`), mask); - } - fchmodSync(fd, mask) { - return this.chmodSync(this.fdToPath(fd, `fchmodSync`), mask); - } - async chmodPromise(p, mask) { - return this.chmodSync(p, mask); - } - chmodSync(p, mask) { - if (this.readOnly) - throw EROFS(`chmod '${p}'`); - mask &= 493; - const resolvedP = this.resolveFilename(`chmod '${p}'`, p, false); - const entry = this.entries.get(resolvedP); - if (typeof entry === `undefined`) - throw new Error(`Assertion failed: The entry should have been registered (${resolvedP})`); - const oldMod = this.getUnixMode(entry, fs.constants.S_IFREG | 0); - const newMod = oldMod & ~511 | mask; - const rc = this.libzip.file.setExternalAttributes(this.zip, entry, 0, 0, this.libzip.ZIP_OPSYS_UNIX, newMod << 16); - if (rc === -1) { - throw this.makeLibzipError(this.libzip.getError(this.zip)); - } - } - async fchownPromise(fd, uid, gid) { - return this.chownPromise(this.fdToPath(fd, `fchown`), uid, gid); - } - fchownSync(fd, uid, gid) { - return this.chownSync(this.fdToPath(fd, `fchownSync`), uid, gid); - } - async chownPromise(p, uid, gid) { - return this.chownSync(p, uid, gid); - } - chownSync(p, uid, gid) { - throw new Error(`Unimplemented`); - } - async renamePromise(oldP, newP) { - return this.renameSync(oldP, newP); - } - renameSync(oldP, newP) { - throw new Error(`Unimplemented`); - } - async copyFilePromise(sourceP, destP, flags) { - const { indexSource, indexDest, resolvedDestP } = this.prepareCopyFile(sourceP, destP, flags); - const source = await this.getFileSource(indexSource, { asyncDecompress: true }); - const newIndex = this.setFileSource(resolvedDestP, source); - if (newIndex !== indexDest) { - this.registerEntry(resolvedDestP, newIndex); - } - } - copyFileSync(sourceP, destP, flags = 0) { - const { indexSource, indexDest, resolvedDestP } = this.prepareCopyFile(sourceP, destP, flags); - const source = this.getFileSource(indexSource); - const newIndex = this.setFileSource(resolvedDestP, source); - if (newIndex !== indexDest) { - this.registerEntry(resolvedDestP, newIndex); - } - } - prepareCopyFile(sourceP, destP, flags = 0) { - if (this.readOnly) - throw EROFS(`copyfile '${sourceP} -> '${destP}'`); - if ((flags & fs.constants.COPYFILE_FICLONE_FORCE) !== 0) - throw ENOSYS(`unsupported clone operation`, `copyfile '${sourceP}' -> ${destP}'`); - const resolvedSourceP = this.resolveFilename(`copyfile '${sourceP} -> ${destP}'`, sourceP); - const indexSource = this.entries.get(resolvedSourceP); - if (typeof indexSource === `undefined`) - throw EINVAL(`copyfile '${sourceP}' -> '${destP}'`); - const resolvedDestP = this.resolveFilename(`copyfile '${sourceP}' -> ${destP}'`, destP); - const indexDest = this.entries.get(resolvedDestP); - if ((flags & (fs.constants.COPYFILE_EXCL | fs.constants.COPYFILE_FICLONE_FORCE)) !== 0 && typeof indexDest !== `undefined`) - throw EEXIST(`copyfile '${sourceP}' -> '${destP}'`); - return { - indexSource, - resolvedDestP, - indexDest - }; - } - async appendFilePromise(p, content, opts) { - if (this.readOnly) - throw EROFS(`open '${p}'`); - if (typeof opts === `undefined`) - opts = { flag: `a` }; - else if (typeof opts === `string`) - opts = { flag: `a`, encoding: opts }; - else if (typeof opts.flag === `undefined`) - opts = { flag: `a`, ...opts }; - return this.writeFilePromise(p, content, opts); - } - appendFileSync(p, content, opts = {}) { - if (this.readOnly) - throw EROFS(`open '${p}'`); - if (typeof opts === `undefined`) - opts = { flag: `a` }; - else if (typeof opts === `string`) - opts = { flag: `a`, encoding: opts }; - else if (typeof opts.flag === `undefined`) - opts = { flag: `a`, ...opts }; - return this.writeFileSync(p, content, opts); - } - fdToPath(fd, reason) { - const path = this.fds.get(fd)?.p; - if (typeof path === `undefined`) - throw EBADF(reason); - return path; - } - async writeFilePromise(p, content, opts) { - const { encoding, mode, index, resolvedP } = this.prepareWriteFile(p, opts); - if (index !== void 0 && typeof opts === `object` && opts.flag && opts.flag.includes(`a`)) - content = Buffer.concat([await this.getFileSource(index, { asyncDecompress: true }), Buffer.from(content)]); - if (encoding !== null) - content = content.toString(encoding); - const newIndex = this.setFileSource(resolvedP, content); - if (newIndex !== index) - this.registerEntry(resolvedP, newIndex); - if (mode !== null) { - await this.chmodPromise(resolvedP, mode); - } - } - writeFileSync(p, content, opts) { - const { encoding, mode, index, resolvedP } = this.prepareWriteFile(p, opts); - if (index !== void 0 && typeof opts === `object` && opts.flag && opts.flag.includes(`a`)) - content = Buffer.concat([this.getFileSource(index), Buffer.from(content)]); - if (encoding !== null) - content = content.toString(encoding); - const newIndex = this.setFileSource(resolvedP, content); - if (newIndex !== index) - this.registerEntry(resolvedP, newIndex); - if (mode !== null) { - this.chmodSync(resolvedP, mode); - } - } - prepareWriteFile(p, opts) { - if (typeof p === `number`) - p = this.fdToPath(p, `read`); - if (this.readOnly) - throw EROFS(`open '${p}'`); - const resolvedP = this.resolveFilename(`open '${p}'`, p); - if (this.listings.has(resolvedP)) - throw EISDIR(`open '${p}'`); - let encoding = null, mode = null; - if (typeof opts === `string`) { - encoding = opts; - } else if (typeof opts === `object`) { - ({ - encoding = null, - mode = null - } = opts); - } - const index = this.entries.get(resolvedP); - return { - encoding, - mode, - resolvedP, - index - }; - } - async unlinkPromise(p) { - return this.unlinkSync(p); - } - unlinkSync(p) { - if (this.readOnly) - throw EROFS(`unlink '${p}'`); - const resolvedP = this.resolveFilename(`unlink '${p}'`, p); - if (this.listings.has(resolvedP)) - throw EISDIR(`unlink '${p}'`); - const index = this.entries.get(resolvedP); - if (typeof index === `undefined`) - throw EINVAL(`unlink '${p}'`); - this.deleteEntry(resolvedP, index); - } - async utimesPromise(p, atime, mtime) { - return this.utimesSync(p, atime, mtime); - } - utimesSync(p, atime, mtime) { - if (this.readOnly) - throw EROFS(`utimes '${p}'`); - const resolvedP = this.resolveFilename(`utimes '${p}'`, p); - this.utimesImpl(resolvedP, mtime); - } - async lutimesPromise(p, atime, mtime) { - return this.lutimesSync(p, atime, mtime); - } - lutimesSync(p, atime, mtime) { - if (this.readOnly) - throw EROFS(`lutimes '${p}'`); - const resolvedP = this.resolveFilename(`utimes '${p}'`, p, false); - this.utimesImpl(resolvedP, mtime); - } - utimesImpl(resolvedP, mtime) { - if (this.listings.has(resolvedP)) { - if (!this.entries.has(resolvedP)) - this.hydrateDirectory(resolvedP); - } - const entry = this.entries.get(resolvedP); - if (entry === void 0) - throw new Error(`Unreachable`); - const rc = this.libzip.file.setMtime(this.zip, entry, 0, toUnixTimestamp(mtime), 0); - if (rc === -1) { - throw this.makeLibzipError(this.libzip.getError(this.zip)); - } - } - async mkdirPromise(p, opts) { - return this.mkdirSync(p, opts); - } - mkdirSync(p, { mode = 493, recursive = false } = {}) { - if (recursive) - return this.mkdirpSync(p, { chmod: mode }); - if (this.readOnly) - throw EROFS(`mkdir '${p}'`); - const resolvedP = this.resolveFilename(`mkdir '${p}'`, p); - if (this.entries.has(resolvedP) || this.listings.has(resolvedP)) - throw EEXIST(`mkdir '${p}'`); - this.hydrateDirectory(resolvedP); - this.chmodSync(resolvedP, mode); - return void 0; - } - async rmdirPromise(p, opts) { - return this.rmdirSync(p, opts); - } - rmdirSync(p, { recursive = false } = {}) { - if (this.readOnly) - throw EROFS(`rmdir '${p}'`); - if (recursive) { - this.removeSync(p); - return; - } - const resolvedP = this.resolveFilename(`rmdir '${p}'`, p); - const directoryListing = this.listings.get(resolvedP); - if (!directoryListing) - throw ENOTDIR(`rmdir '${p}'`); - if (directoryListing.size > 0) - throw ENOTEMPTY(`rmdir '${p}'`); - const index = this.entries.get(resolvedP); - if (typeof index === `undefined`) - throw EINVAL(`rmdir '${p}'`); - this.deleteEntry(p, index); - } - async rmPromise(p, opts) { - return this.rmSync(p, opts); - } - rmSync(p, { recursive = false } = {}) { - if (this.readOnly) - throw EROFS(`rm '${p}'`); - if (recursive) { - this.removeSync(p); - return; - } - const resolvedP = this.resolveFilename(`rm '${p}'`, p); - const directoryListing = this.listings.get(resolvedP); - if (!directoryListing) - throw ENOTDIR(`rm '${p}'`); - if (directoryListing.size > 0) - throw ENOTEMPTY(`rm '${p}'`); - const index = this.entries.get(resolvedP); - if (typeof index === `undefined`) - throw EINVAL(`rm '${p}'`); - this.deleteEntry(p, index); - } - hydrateDirectory(resolvedP) { - const index = this.libzip.dir.add(this.zip, ppath.relative(PortablePath.root, resolvedP)); - if (index === -1) - throw this.makeLibzipError(this.libzip.getError(this.zip)); - this.registerListing(resolvedP); - this.registerEntry(resolvedP, index); - return index; - } - async linkPromise(existingP, newP) { - return this.linkSync(existingP, newP); - } - linkSync(existingP, newP) { - throw EOPNOTSUPP(`link '${existingP}' -> '${newP}'`); - } - async symlinkPromise(target, p) { - return this.symlinkSync(target, p); - } - symlinkSync(target, p) { - if (this.readOnly) - throw EROFS(`symlink '${target}' -> '${p}'`); - const resolvedP = this.resolveFilename(`symlink '${target}' -> '${p}'`, p); - if (this.listings.has(resolvedP)) - throw EISDIR(`symlink '${target}' -> '${p}'`); - if (this.entries.has(resolvedP)) - throw EEXIST(`symlink '${target}' -> '${p}'`); - const index = this.setFileSource(resolvedP, target); - this.registerEntry(resolvedP, index); - const rc = this.libzip.file.setExternalAttributes(this.zip, index, 0, 0, this.libzip.ZIP_OPSYS_UNIX, (fs.constants.S_IFLNK | 511) << 16); - if (rc === -1) - throw this.makeLibzipError(this.libzip.getError(this.zip)); - this.symlinkCount += 1; - } - async readFilePromise(p, encoding) { - if (typeof encoding === `object`) - encoding = encoding ? encoding.encoding : void 0; - const data = await this.readFileBuffer(p, { asyncDecompress: true }); - return encoding ? data.toString(encoding) : data; - } - readFileSync(p, encoding) { - if (typeof encoding === `object`) - encoding = encoding ? encoding.encoding : void 0; - const data = this.readFileBuffer(p); - return encoding ? data.toString(encoding) : data; - } - readFileBuffer(p, opts = { asyncDecompress: false }) { - if (typeof p === `number`) - p = this.fdToPath(p, `read`); - const resolvedP = this.resolveFilename(`open '${p}'`, p); - if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) - throw ENOENT(`open '${p}'`); - if (p[p.length - 1] === `/` && !this.listings.has(resolvedP)) - throw ENOTDIR(`open '${p}'`); - if (this.listings.has(resolvedP)) - throw EISDIR(`read`); - const entry = this.entries.get(resolvedP); - if (entry === void 0) - throw new Error(`Unreachable`); - return this.getFileSource(entry, opts); - } - async readdirPromise(p, opts) { - return this.readdirSync(p, opts); - } - readdirSync(p, opts) { - const resolvedP = this.resolveFilename(`scandir '${p}'`, p); - if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) - throw ENOENT(`scandir '${p}'`); - const directoryListing = this.listings.get(resolvedP); - if (!directoryListing) - throw ENOTDIR(`scandir '${p}'`); - if (opts?.recursive) { - if (opts?.withFileTypes) { - const entries = Array.from(directoryListing, (name) => { - return Object.assign(this.statImpl(`lstat`, ppath.join(p, name)), { - name, - path: PortablePath.dot - }); - }); - for (const entry of entries) { - if (!entry.isDirectory()) - continue; - const subPath = ppath.join(entry.path, entry.name); - const subListing = this.listings.get(ppath.join(resolvedP, subPath)); - for (const child of subListing) { - entries.push(Object.assign(this.statImpl(`lstat`, ppath.join(p, subPath, child)), { - name: child, - path: subPath - })); - } - } - return entries; - } else { - const entries = [...directoryListing]; - for (const subPath of entries) { - const subListing = this.listings.get(ppath.join(resolvedP, subPath)); - if (typeof subListing === `undefined`) - continue; - for (const child of subListing) { - entries.push(ppath.join(subPath, child)); - } - } - return entries; - } - } else if (opts?.withFileTypes) { - return Array.from(directoryListing, (name) => { - return Object.assign(this.statImpl(`lstat`, ppath.join(p, name)), { - name, - path: void 0 - }); - }); - } else { - return [...directoryListing]; - } - } - async readlinkPromise(p) { - const entry = this.prepareReadlink(p); - return (await this.getFileSource(entry, { asyncDecompress: true })).toString(); - } - readlinkSync(p) { - const entry = this.prepareReadlink(p); - return this.getFileSource(entry).toString(); - } - prepareReadlink(p) { - const resolvedP = this.resolveFilename(`readlink '${p}'`, p, false); - if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) - throw ENOENT(`readlink '${p}'`); - if (p[p.length - 1] === `/` && !this.listings.has(resolvedP)) - throw ENOTDIR(`open '${p}'`); - if (this.listings.has(resolvedP)) - throw EINVAL(`readlink '${p}'`); - const entry = this.entries.get(resolvedP); - if (entry === void 0) - throw new Error(`Unreachable`); - if (!this.isSymbolicLink(entry)) - throw EINVAL(`readlink '${p}'`); - return entry; - } - async truncatePromise(p, len = 0) { - const resolvedP = this.resolveFilename(`open '${p}'`, p); - const index = this.entries.get(resolvedP); - if (typeof index === `undefined`) - throw EINVAL(`open '${p}'`); - const source = await this.getFileSource(index, { asyncDecompress: true }); - const truncated = Buffer.alloc(len, 0); - source.copy(truncated); - return await this.writeFilePromise(p, truncated); - } - truncateSync(p, len = 0) { - const resolvedP = this.resolveFilename(`open '${p}'`, p); - const index = this.entries.get(resolvedP); - if (typeof index === `undefined`) - throw EINVAL(`open '${p}'`); - const source = this.getFileSource(index); - const truncated = Buffer.alloc(len, 0); - source.copy(truncated); - return this.writeFileSync(p, truncated); - } - async ftruncatePromise(fd, len) { - return this.truncatePromise(this.fdToPath(fd, `ftruncate`), len); - } - ftruncateSync(fd, len) { - return this.truncateSync(this.fdToPath(fd, `ftruncateSync`), len); - } - watch(p, a, b) { - let persistent; - switch (typeof a) { - case `function`: - case `string`: - case `undefined`: - { - persistent = true; - } - break; - default: - { - ({ persistent = true } = a); - } - break; - } - if (!persistent) - return { on: () => { - }, close: () => { - } }; - const interval = setInterval(() => { - }, 24 * 60 * 60 * 1e3); - return { on: () => { - }, close: () => { - clearInterval(interval); - } }; - } - watchFile(p, a, b) { - const resolvedP = ppath.resolve(PortablePath.root, p); - return watchFile(this, resolvedP, a, b); - } - unwatchFile(p, cb) { - const resolvedP = ppath.resolve(PortablePath.root, p); - return unwatchFile(this, resolvedP, cb); - } -} - -setFactory(() => { - const emZip = createModule(); - return makeInterface(emZip); -}); - -var ErrorCode = /* @__PURE__ */ ((ErrorCode2) => { - ErrorCode2["API_ERROR"] = `API_ERROR`; - ErrorCode2["BUILTIN_NODE_RESOLUTION_FAILED"] = `BUILTIN_NODE_RESOLUTION_FAILED`; - ErrorCode2["EXPORTS_RESOLUTION_FAILED"] = `EXPORTS_RESOLUTION_FAILED`; - ErrorCode2["MISSING_DEPENDENCY"] = `MISSING_DEPENDENCY`; - ErrorCode2["MISSING_PEER_DEPENDENCY"] = `MISSING_PEER_DEPENDENCY`; - ErrorCode2["QUALIFIED_PATH_RESOLUTION_FAILED"] = `QUALIFIED_PATH_RESOLUTION_FAILED`; - ErrorCode2["INTERNAL"] = `INTERNAL`; - ErrorCode2["UNDECLARED_DEPENDENCY"] = `UNDECLARED_DEPENDENCY`; - ErrorCode2["UNSUPPORTED"] = `UNSUPPORTED`; - return ErrorCode2; -})(ErrorCode || {}); -const MODULE_NOT_FOUND_ERRORS = /* @__PURE__ */ new Set([ - "BUILTIN_NODE_RESOLUTION_FAILED" /* BUILTIN_NODE_RESOLUTION_FAILED */, - "MISSING_DEPENDENCY" /* MISSING_DEPENDENCY */, - "MISSING_PEER_DEPENDENCY" /* MISSING_PEER_DEPENDENCY */, - "QUALIFIED_PATH_RESOLUTION_FAILED" /* QUALIFIED_PATH_RESOLUTION_FAILED */, - "UNDECLARED_DEPENDENCY" /* UNDECLARED_DEPENDENCY */ -]); -function makeError(pnpCode, message, data = {}, code) { - code ??= MODULE_NOT_FOUND_ERRORS.has(pnpCode) ? `MODULE_NOT_FOUND` : pnpCode; - const propertySpec = { - configurable: true, - writable: true, - enumerable: false - }; - return Object.defineProperties(new Error(message), { - code: { - ...propertySpec, - value: code - }, - pnpCode: { - ...propertySpec, - value: pnpCode - }, - data: { - ...propertySpec, - value: data - } - }); -} -function getIssuerModule(parent) { - let issuer = parent; - while (issuer && (issuer.id === `[eval]` || issuer.id === `` || !issuer.filename)) - issuer = issuer.parent; - return issuer || null; -} -function getPathForDisplay(p) { - return npath.normalize(npath.fromPortablePath(p)); -} - -const [major, minor] = process.versions.node.split(`.`).map((value) => parseInt(value, 10)); -const WATCH_MODE_MESSAGE_USES_ARRAYS = major > 19 || major === 19 && minor >= 2 || major === 18 && minor >= 13; - -function readPackageScope(checkPath) { - const rootSeparatorIndex = checkPath.indexOf(npath.sep); - let separatorIndex; - do { - separatorIndex = checkPath.lastIndexOf(npath.sep); - checkPath = checkPath.slice(0, separatorIndex); - if (checkPath.endsWith(`${npath.sep}node_modules`)) - return false; - const pjson = readPackage(checkPath + npath.sep); - if (pjson) { - return { - data: pjson, - path: checkPath - }; - } - } while (separatorIndex > rootSeparatorIndex); - return false; -} -function readPackage(requestPath) { - const jsonPath = npath.resolve(requestPath, `package.json`); - if (!fs__default.default.existsSync(jsonPath)) - return null; - return JSON.parse(fs__default.default.readFileSync(jsonPath, `utf8`)); -} -function ERR_REQUIRE_ESM(filename, parentPath = null) { - const basename = parentPath && path__default.default.basename(filename) === path__default.default.basename(parentPath) ? filename : path__default.default.basename(filename); - const msg = `require() of ES Module ${filename}${parentPath ? ` from ${parentPath}` : ``} not supported. -Instead change the require of ${basename} in ${parentPath} to a dynamic import() which is available in all CommonJS modules.`; - const err = new Error(msg); - err.code = `ERR_REQUIRE_ESM`; - return err; -} -function reportRequiredFilesToWatchMode(files) { - if (process.env.WATCH_REPORT_DEPENDENCIES && process.send) { - files = files.map((filename) => npath.fromPortablePath(VirtualFS.resolveVirtual(npath.toPortablePath(filename)))); - if (WATCH_MODE_MESSAGE_USES_ARRAYS) { - process.send({ "watch:require": files }); - } else { - for (const filename of files) { - process.send({ "watch:require": filename }); - } - } - } -} - -function applyPatch(pnpapi, opts) { - let enableNativeHooks = true; - process.versions.pnp = String(pnpapi.VERSIONS.std); - const moduleExports = require$$0__default.default; - moduleExports.findPnpApi = (lookupSource) => { - const lookupPath = lookupSource instanceof URL ? url.fileURLToPath(lookupSource) : lookupSource; - const apiPath = opts.manager.findApiPathFor(lookupPath); - if (apiPath === null) - return null; - const apiEntry = opts.manager.getApiEntry(apiPath, true); - return apiEntry.instance.findPackageLocator(lookupPath) ? apiEntry.instance : null; - }; - function getRequireStack(parent) { - const requireStack = []; - for (let cursor = parent; cursor; cursor = cursor.parent) - requireStack.push(cursor.filename || cursor.id); - return requireStack; - } - const originalModuleLoad = require$$0.Module._load; - require$$0.Module._load = function(request, parent, isMain) { - if (request === `pnpapi`) { - const parentApiPath = opts.manager.getApiPathFromParent(parent); - if (parentApiPath) { - return opts.manager.getApiEntry(parentApiPath, true).instance; - } - } - return originalModuleLoad.call(require$$0.Module, request, parent, isMain); - }; - function getIssuerSpecsFromPaths(paths) { - return paths.map((path) => ({ - apiPath: opts.manager.findApiPathFor(path), - path, - module: null - })); - } - function getIssuerSpecsFromModule(module) { - if (module && module.id !== `` && module.id !== `internal/preload` && !module.parent && !module.filename && module.paths.length > 0) { - return [{ - apiPath: opts.manager.findApiPathFor(module.paths[0]), - path: module.paths[0], - module - }]; - } - const issuer = getIssuerModule(module); - if (issuer !== null) { - const path = npath.dirname(issuer.filename); - const apiPath = opts.manager.getApiPathFromParent(issuer); - return [{ apiPath, path, module }]; - } else { - const path = process.cwd(); - const apiPath = opts.manager.findApiPathFor(npath.join(path, `[file]`)) ?? opts.manager.getApiPathFromParent(null); - return [{ apiPath, path, module }]; - } - } - function makeFakeParent(path) { - const fakeParent = new require$$0.Module(``); - const fakeFilePath = npath.join(path, `[file]`); - fakeParent.paths = require$$0.Module._nodeModulePaths(fakeFilePath); - return fakeParent; - } - const pathRegExp = /^(?![a-zA-Z]:[\\/]|\\\\|\.{0,2}(?:\/|$))((?:@[^/]+\/)?[^/]+)\/*(.*|)$/; - const originalModuleResolveFilename = require$$0.Module._resolveFilename; - require$$0.Module._resolveFilename = function(request, parent, isMain, options) { - if (require$$0.isBuiltin(request)) - return request; - if (!enableNativeHooks) - return originalModuleResolveFilename.call(require$$0.Module, request, parent, isMain, options); - if (options && options.plugnplay === false) { - const { plugnplay, ...forwardedOptions } = options; - try { - enableNativeHooks = false; - return originalModuleResolveFilename.call(require$$0.Module, request, parent, isMain, forwardedOptions); - } finally { - enableNativeHooks = true; - } - } - if (options) { - const optionNames = new Set(Object.keys(options)); - optionNames.delete(`paths`); - optionNames.delete(`plugnplay`); - if (optionNames.size > 0) { - throw makeError( - ErrorCode.UNSUPPORTED, - `Some options passed to require() aren't supported by PnP yet (${Array.from(optionNames).join(`, `)})` - ); - } - } - const issuerSpecs = options && options.paths ? getIssuerSpecsFromPaths(options.paths) : getIssuerSpecsFromModule(parent); - if (request.match(pathRegExp) === null) { - const parentDirectory = parent?.filename != null ? npath.dirname(parent.filename) : null; - const absoluteRequest = npath.isAbsolute(request) ? request : parentDirectory !== null ? npath.resolve(parentDirectory, request) : null; - if (absoluteRequest !== null) { - const apiPath = parent && parentDirectory === npath.dirname(absoluteRequest) ? opts.manager.getApiPathFromParent(parent) : opts.manager.findApiPathFor(absoluteRequest); - if (apiPath !== null) { - issuerSpecs.unshift({ - apiPath, - path: parentDirectory, - module: null - }); - } - } - } - let firstError; - for (const { apiPath, path, module } of issuerSpecs) { - let resolution; - const issuerApi = apiPath !== null ? opts.manager.getApiEntry(apiPath, true).instance : null; - try { - if (issuerApi !== null) { - resolution = issuerApi.resolveRequest(request, path !== null ? `${path}/` : null); - } else { - if (path === null) - throw new Error(`Assertion failed: Expected the path to be set`); - resolution = originalModuleResolveFilename.call(require$$0.Module, request, module || makeFakeParent(path), isMain); - } - } catch (error) { - firstError = firstError || error; - continue; - } - if (resolution !== null) { - return resolution; - } - } - const requireStack = getRequireStack(parent); - Object.defineProperty(firstError, `requireStack`, { - configurable: true, - writable: true, - enumerable: false, - value: requireStack - }); - if (requireStack.length > 0) - firstError.message += ` -Require stack: -- ${requireStack.join(` -- `)}`; - if (typeof firstError.pnpCode === `string`) - Error.captureStackTrace(firstError); - throw firstError; - }; - const originalFindPath = require$$0.Module._findPath; - require$$0.Module._findPath = function(request, paths, isMain) { - if (request === `pnpapi`) - return false; - if (!enableNativeHooks) - return originalFindPath.call(require$$0.Module, request, paths, isMain); - const isAbsolute = npath.isAbsolute(request); - if (isAbsolute) - paths = [``]; - else if (!paths || paths.length === 0) - return false; - for (const path of paths) { - let resolution; - try { - const pnpApiPath = opts.manager.findApiPathFor(isAbsolute ? request : path); - if (pnpApiPath !== null) { - const api = opts.manager.getApiEntry(pnpApiPath, true).instance; - resolution = api.resolveRequest(request, path) || false; - } else { - resolution = originalFindPath.call(require$$0.Module, request, [path], isMain); - } - } catch (error) { - continue; - } - if (resolution) { - return resolution; - } - } - return false; - }; - const originalExtensionJSFunction = require$$0.Module._extensions[`.js`]; - require$$0.Module._extensions[`.js`] = function(module, filename) { - if (filename.endsWith(`.js`)) { - const pkg = readPackageScope(filename); - if (pkg && pkg.data?.type === `module`) { - const err = ERR_REQUIRE_ESM(filename, module.parent?.filename); - Error.captureStackTrace(err); - throw err; - } - } - originalExtensionJSFunction.call(this, module, filename); - }; - const originalDlopen = process.dlopen; - process.dlopen = function(...args) { - const [module, filename, ...rest] = args; - return originalDlopen.call( - this, - module, - npath.fromPortablePath(VirtualFS.resolveVirtual(npath.toPortablePath(filename))), - ...rest - ); - }; - const originalEmit = process.emit; - process.emit = function(name, data, ...args) { - if (name === `warning` && typeof data === `object` && data.name === `ExperimentalWarning` && (data.message.includes(`--experimental-loader`) || data.message.includes(`Custom ESM Loaders is an experimental feature`))) - return false; - return originalEmit.apply(process, arguments); - }; - patchFs(fs__default.default, new PosixFS(opts.fakeFs)); -} - -function hydrateRuntimeState(data, { basePath }) { - const portablePath = npath.toPortablePath(basePath); - const absolutePortablePath = ppath.resolve(portablePath); - const ignorePattern = data.ignorePatternData !== null ? new RegExp(data.ignorePatternData) : null; - const packageLocatorsByLocations = /* @__PURE__ */ new Map(); - const packageRegistry = new Map(data.packageRegistryData.map(([packageName, packageStoreData]) => { - return [packageName, new Map(packageStoreData.map(([packageReference, packageInformationData]) => { - if (packageName === null !== (packageReference === null)) - throw new Error(`Assertion failed: The name and reference should be null, or neither should`); - const discardFromLookup = packageInformationData.discardFromLookup ?? false; - const packageLocator = { name: packageName, reference: packageReference }; - const entry = packageLocatorsByLocations.get(packageInformationData.packageLocation); - if (!entry) { - packageLocatorsByLocations.set(packageInformationData.packageLocation, { locator: packageLocator, discardFromLookup }); - } else { - entry.discardFromLookup = entry.discardFromLookup && discardFromLookup; - if (!discardFromLookup) { - entry.locator = packageLocator; - } - } - let resolvedPackageLocation = null; - return [packageReference, { - packageDependencies: new Map(packageInformationData.packageDependencies), - packagePeers: new Set(packageInformationData.packagePeers), - linkType: packageInformationData.linkType, - discardFromLookup, - get packageLocation() { - return resolvedPackageLocation || (resolvedPackageLocation = ppath.join(absolutePortablePath, packageInformationData.packageLocation)); - } - }]; - }))]; - })); - const fallbackExclusionList = new Map(data.fallbackExclusionList.map(([packageName, packageReferences]) => { - return [packageName, new Set(packageReferences)]; - })); - const fallbackPool = new Map(data.fallbackPool); - const dependencyTreeRoots = data.dependencyTreeRoots; - const enableTopLevelFallback = data.enableTopLevelFallback; - return { - basePath: portablePath, - dependencyTreeRoots, - enableTopLevelFallback, - fallbackExclusionList, - fallbackPool, - ignorePattern, - packageLocatorsByLocations, - packageRegistry - }; -} - -const ArrayIsArray = Array.isArray; -const JSONStringify = JSON.stringify; -const ObjectGetOwnPropertyNames = Object.getOwnPropertyNames; -const ObjectPrototypeHasOwnProperty = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop); -const RegExpPrototypeExec = (obj, string) => RegExp.prototype.exec.call(obj, string); -const RegExpPrototypeSymbolReplace = (obj, ...rest) => RegExp.prototype[Symbol.replace].apply(obj, rest); -const StringPrototypeEndsWith = (str, ...rest) => String.prototype.endsWith.apply(str, rest); -const StringPrototypeIncludes = (str, ...rest) => String.prototype.includes.apply(str, rest); -const StringPrototypeLastIndexOf = (str, ...rest) => String.prototype.lastIndexOf.apply(str, rest); -const StringPrototypeIndexOf = (str, ...rest) => String.prototype.indexOf.apply(str, rest); -const StringPrototypeReplace = (str, ...rest) => String.prototype.replace.apply(str, rest); -const StringPrototypeSlice = (str, ...rest) => String.prototype.slice.apply(str, rest); -const StringPrototypeStartsWith = (str, ...rest) => String.prototype.startsWith.apply(str, rest); -const SafeMap = Map; -const JSONParse = JSON.parse; - -function createErrorType(code, messageCreator, errorType) { - return class extends errorType { - constructor(...args) { - super(messageCreator(...args)); - this.code = code; - this.name = `${errorType.name} [${code}]`; - } - }; -} -const ERR_PACKAGE_IMPORT_NOT_DEFINED = createErrorType( - `ERR_PACKAGE_IMPORT_NOT_DEFINED`, - (specifier, packagePath, base) => { - return `Package import specifier "${specifier}" is not defined${packagePath ? ` in package ${packagePath}package.json` : ``} imported from ${base}`; - }, - TypeError -); -const ERR_INVALID_MODULE_SPECIFIER = createErrorType( - `ERR_INVALID_MODULE_SPECIFIER`, - (request, reason, base = void 0) => { - return `Invalid module "${request}" ${reason}${base ? ` imported from ${base}` : ``}`; - }, - TypeError -); -const ERR_INVALID_PACKAGE_TARGET = createErrorType( - `ERR_INVALID_PACKAGE_TARGET`, - (pkgPath, key, target, isImport = false, base = void 0) => { - const relError = typeof target === `string` && !isImport && target.length && !StringPrototypeStartsWith(target, `./`); - if (key === `.`) { - assert__default.default(isImport === false); - return `Invalid "exports" main target ${JSONStringify(target)} defined in the package config ${pkgPath}package.json${base ? ` imported from ${base}` : ``}${relError ? `; targets must start with "./"` : ``}`; - } - return `Invalid "${isImport ? `imports` : `exports`}" target ${JSONStringify( - target - )} defined for '${key}' in the package config ${pkgPath}package.json${base ? ` imported from ${base}` : ``}${relError ? `; targets must start with "./"` : ``}`; - }, - Error -); -const ERR_INVALID_PACKAGE_CONFIG = createErrorType( - `ERR_INVALID_PACKAGE_CONFIG`, - (path, base, message) => { - return `Invalid package config ${path}${base ? ` while importing ${base}` : ``}${message ? `. ${message}` : ``}`; - }, - Error -); -const ERR_PACKAGE_PATH_NOT_EXPORTED = createErrorType( - "ERR_PACKAGE_PATH_NOT_EXPORTED", - (pkgPath, subpath, base = void 0) => { - if (subpath === ".") - return `No "exports" main defined in ${pkgPath}package.json${base ? ` imported from ${base}` : ""}`; - return `Package subpath '${subpath}' is not defined by "exports" in ${pkgPath}package.json${base ? ` imported from ${base}` : ""}`; - }, - Error -); - -function filterOwnProperties(source, keys) { - const filtered = /* @__PURE__ */ Object.create(null); - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - if (ObjectPrototypeHasOwnProperty(source, key)) { - filtered[key] = source[key]; - } - } - return filtered; -} - -const packageJSONCache = new SafeMap(); -function getPackageConfig(path, specifier, base, readFileSyncFn) { - const existing = packageJSONCache.get(path); - if (existing !== void 0) { - return existing; - } - const source = readFileSyncFn(path); - if (source === void 0) { - const packageConfig2 = { - pjsonPath: path, - exists: false, - main: void 0, - name: void 0, - type: "none", - exports: void 0, - imports: void 0 - }; - packageJSONCache.set(path, packageConfig2); - return packageConfig2; - } - let packageJSON; - try { - packageJSON = JSONParse(source); - } catch (error) { - throw new ERR_INVALID_PACKAGE_CONFIG( - path, - (base ? `"${specifier}" from ` : "") + url.fileURLToPath(base || specifier), - error.message - ); - } - let { imports, main, name, type } = filterOwnProperties(packageJSON, [ - "imports", - "main", - "name", - "type" - ]); - const exports = ObjectPrototypeHasOwnProperty(packageJSON, "exports") ? packageJSON.exports : void 0; - if (typeof imports !== "object" || imports === null) { - imports = void 0; - } - if (typeof main !== "string") { - main = void 0; - } - if (typeof name !== "string") { - name = void 0; - } - if (type !== "module" && type !== "commonjs") { - type = "none"; - } - const packageConfig = { - pjsonPath: path, - exists: true, - main, - name, - type, - exports, - imports - }; - packageJSONCache.set(path, packageConfig); - return packageConfig; -} -function getPackageScopeConfig(resolved, readFileSyncFn) { - let packageJSONUrl = new URL("./package.json", resolved); - while (true) { - const packageJSONPath2 = packageJSONUrl.pathname; - if (StringPrototypeEndsWith(packageJSONPath2, "node_modules/package.json")) { - break; - } - const packageConfig2 = getPackageConfig( - url.fileURLToPath(packageJSONUrl), - resolved, - void 0, - readFileSyncFn - ); - if (packageConfig2.exists) { - return packageConfig2; - } - const lastPackageJSONUrl = packageJSONUrl; - packageJSONUrl = new URL("../package.json", packageJSONUrl); - if (packageJSONUrl.pathname === lastPackageJSONUrl.pathname) { - break; - } - } - const packageJSONPath = url.fileURLToPath(packageJSONUrl); - const packageConfig = { - pjsonPath: packageJSONPath, - exists: false, - main: void 0, - name: void 0, - type: "none", - exports: void 0, - imports: void 0 - }; - packageJSONCache.set(packageJSONPath, packageConfig); - return packageConfig; -} - -function throwImportNotDefined(specifier, packageJSONUrl, base) { - throw new ERR_PACKAGE_IMPORT_NOT_DEFINED( - specifier, - packageJSONUrl && url.fileURLToPath(new URL(".", packageJSONUrl)), - url.fileURLToPath(base) - ); -} -function throwInvalidSubpath(subpath, packageJSONUrl, internal, base) { - const reason = `request is not a valid subpath for the "${internal ? "imports" : "exports"}" resolution of ${url.fileURLToPath(packageJSONUrl)}`; - throw new ERR_INVALID_MODULE_SPECIFIER( - subpath, - reason, - base && url.fileURLToPath(base) - ); -} -function throwInvalidPackageTarget(subpath, target, packageJSONUrl, internal, base) { - if (typeof target === "object" && target !== null) { - target = JSONStringify(target, null, ""); - } else { - target = `${target}`; - } - throw new ERR_INVALID_PACKAGE_TARGET( - url.fileURLToPath(new URL(".", packageJSONUrl)), - subpath, - target, - internal, - base && url.fileURLToPath(base) - ); -} -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; -const patternRegEx = /\*/g; -function resolvePackageTargetString(target, subpath, match, packageJSONUrl, base, pattern, internal, conditions) { - if (subpath !== "" && !pattern && target[target.length - 1] !== "/") - throwInvalidPackageTarget(match, target, packageJSONUrl, internal, base); - if (!StringPrototypeStartsWith(target, "./")) { - if (internal && !StringPrototypeStartsWith(target, "../") && !StringPrototypeStartsWith(target, "/")) { - let isURL = false; - try { - new URL(target); - isURL = true; - } catch { - } - if (!isURL) { - const exportTarget = pattern ? RegExpPrototypeSymbolReplace(patternRegEx, target, () => subpath) : target + subpath; - return exportTarget; - } - } - throwInvalidPackageTarget(match, target, packageJSONUrl, internal, base); - } - if (RegExpPrototypeExec( - invalidSegmentRegEx, - StringPrototypeSlice(target, 2) - ) !== null) - throwInvalidPackageTarget(match, target, packageJSONUrl, internal, base); - const resolved = new URL(target, packageJSONUrl); - const resolvedPath = resolved.pathname; - const packagePath = new URL(".", packageJSONUrl).pathname; - if (!StringPrototypeStartsWith(resolvedPath, packagePath)) - throwInvalidPackageTarget(match, target, packageJSONUrl, internal, base); - if (subpath === "") - return resolved; - if (RegExpPrototypeExec(invalidSegmentRegEx, subpath) !== null) { - const request = pattern ? StringPrototypeReplace(match, "*", () => subpath) : match + subpath; - throwInvalidSubpath(request, packageJSONUrl, internal, base); - } - if (pattern) { - return new URL( - RegExpPrototypeSymbolReplace(patternRegEx, resolved.href, () => subpath) - ); - } - return new URL(subpath, resolved); -} -function isArrayIndex(key) { - const keyNum = +key; - if (`${keyNum}` !== key) - return false; - return keyNum >= 0 && keyNum < 4294967295; -} -function resolvePackageTarget(packageJSONUrl, target, subpath, packageSubpath, base, pattern, internal, conditions) { - if (typeof target === "string") { - return resolvePackageTargetString( - target, - subpath, - packageSubpath, - packageJSONUrl, - base, - pattern, - internal); - } else if (ArrayIsArray(target)) { - if (target.length === 0) { - return null; - } - let lastException; - for (let i = 0; i < target.length; i++) { - const targetItem = target[i]; - let resolveResult; - try { - resolveResult = resolvePackageTarget( - packageJSONUrl, - targetItem, - subpath, - packageSubpath, - base, - pattern, - internal, - conditions - ); - } catch (e) { - lastException = e; - if (e.code === "ERR_INVALID_PACKAGE_TARGET") { - continue; - } - throw e; - } - if (resolveResult === void 0) { - continue; - } - if (resolveResult === null) { - lastException = null; - continue; - } - return resolveResult; - } - if (lastException === void 0 || lastException === null) - return lastException; - throw lastException; - } else if (typeof target === "object" && target !== null) { - const keys = ObjectGetOwnPropertyNames(target); - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - if (isArrayIndex(key)) { - throw new ERR_INVALID_PACKAGE_CONFIG( - url.fileURLToPath(packageJSONUrl), - base, - '"exports" cannot contain numeric property keys.' - ); - } - } - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - if (key === "default" || conditions.has(key)) { - const conditionalTarget = target[key]; - const resolveResult = resolvePackageTarget( - packageJSONUrl, - conditionalTarget, - subpath, - packageSubpath, - base, - pattern, - internal, - conditions - ); - if (resolveResult === void 0) - continue; - return resolveResult; - } - } - return void 0; - } else if (target === null) { - return null; - } - throwInvalidPackageTarget( - packageSubpath, - target, - packageJSONUrl, - internal, - base - ); -} -function patternKeyCompare(a, b) { - const aPatternIndex = StringPrototypeIndexOf(a, "*"); - const bPatternIndex = StringPrototypeIndexOf(b, "*"); - 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; -} -function isConditionalExportsMainSugar(exports, packageJSONUrl, base) { - if (typeof exports === "string" || ArrayIsArray(exports)) - return true; - if (typeof exports !== "object" || exports === null) - return false; - const keys = ObjectGetOwnPropertyNames(exports); - let isConditionalSugar = false; - let i = 0; - for (let j = 0; j < keys.length; j++) { - const key = keys[j]; - const curIsConditionalSugar = key === "" || key[0] !== "."; - if (i++ === 0) { - isConditionalSugar = curIsConditionalSugar; - } else if (isConditionalSugar !== curIsConditionalSugar) { - throw new ERR_INVALID_PACKAGE_CONFIG( - url.fileURLToPath(packageJSONUrl), - base, - `"exports" cannot contain some keys starting with '.' and some not. The exports object must either be an object of package subpath keys or an object of main entry condition name keys only.` - ); - } - } - return isConditionalSugar; -} -function throwExportsNotFound(subpath, packageJSONUrl, base) { - throw new ERR_PACKAGE_PATH_NOT_EXPORTED( - url.fileURLToPath(new URL(".", packageJSONUrl)), - subpath, - base && url.fileURLToPath(base) - ); -} -const emittedPackageWarnings = /* @__PURE__ */ new Set(); -function emitTrailingSlashPatternDeprecation(match, pjsonUrl, base) { - const pjsonPath = url.fileURLToPath(pjsonUrl); - if (emittedPackageWarnings.has(pjsonPath + "|" + match)) - return; - emittedPackageWarnings.add(pjsonPath + "|" + match); - process.emitWarning( - `Use of deprecated trailing slash pattern mapping "${match}" in the "exports" field module resolution of the package at ${pjsonPath}${base ? ` imported from ${url.fileURLToPath(base)}` : ""}. Mapping specifiers ending in "/" is no longer supported.`, - "DeprecationWarning", - "DEP0155" - ); -} -function packageExportsResolve({ - packageJSONUrl, - packageSubpath, - exports, - base, - conditions -}) { - if (isConditionalExportsMainSugar(exports, packageJSONUrl, base)) - exports = { ".": exports }; - if (ObjectPrototypeHasOwnProperty(exports, packageSubpath) && !StringPrototypeIncludes(packageSubpath, "*") && !StringPrototypeEndsWith(packageSubpath, "/")) { - const target = exports[packageSubpath]; - const resolveResult = resolvePackageTarget( - packageJSONUrl, - target, - "", - packageSubpath, - base, - false, - false, - conditions - ); - if (resolveResult == null) { - throwExportsNotFound(packageSubpath, packageJSONUrl, base); - } - return resolveResult; - } - let bestMatch = ""; - let bestMatchSubpath; - const keys = ObjectGetOwnPropertyNames(exports); - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - const patternIndex = StringPrototypeIndexOf(key, "*"); - if (patternIndex !== -1 && StringPrototypeStartsWith( - packageSubpath, - StringPrototypeSlice(key, 0, patternIndex) - )) { - if (StringPrototypeEndsWith(packageSubpath, "/")) - emitTrailingSlashPatternDeprecation( - packageSubpath, - packageJSONUrl, - base - ); - const patternTrailer = StringPrototypeSlice(key, patternIndex + 1); - if (packageSubpath.length >= key.length && StringPrototypeEndsWith(packageSubpath, patternTrailer) && patternKeyCompare(bestMatch, key) === 1 && StringPrototypeLastIndexOf(key, "*") === patternIndex) { - bestMatch = key; - bestMatchSubpath = StringPrototypeSlice( - packageSubpath, - patternIndex, - packageSubpath.length - patternTrailer.length - ); - } - } - } - if (bestMatch) { - const target = exports[bestMatch]; - const resolveResult = resolvePackageTarget( - packageJSONUrl, - target, - bestMatchSubpath, - bestMatch, - base, - true, - false, - conditions - ); - if (resolveResult == null) { - throwExportsNotFound(packageSubpath, packageJSONUrl, base); - } - return resolveResult; - } - throwExportsNotFound(packageSubpath, packageJSONUrl, base); -} -function packageImportsResolve({ name, base, conditions, readFileSyncFn }) { - if (name === "#" || StringPrototypeStartsWith(name, "#/") || StringPrototypeEndsWith(name, "/")) { - const reason = "is not a valid internal imports specifier name"; - throw new ERR_INVALID_MODULE_SPECIFIER(name, reason, url.fileURLToPath(base)); - } - let packageJSONUrl; - const packageConfig = getPackageScopeConfig(base, readFileSyncFn); - if (packageConfig.exists) { - packageJSONUrl = url.pathToFileURL(packageConfig.pjsonPath); - const imports = packageConfig.imports; - if (imports) { - if (ObjectPrototypeHasOwnProperty(imports, name) && !StringPrototypeIncludes(name, "*")) { - const resolveResult = resolvePackageTarget( - packageJSONUrl, - imports[name], - "", - name, - base, - false, - true, - conditions - ); - if (resolveResult != null) { - return resolveResult; - } - } else { - let bestMatch = ""; - let bestMatchSubpath; - const keys = ObjectGetOwnPropertyNames(imports); - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - const patternIndex = StringPrototypeIndexOf(key, "*"); - if (patternIndex !== -1 && StringPrototypeStartsWith( - name, - StringPrototypeSlice(key, 0, patternIndex) - )) { - const patternTrailer = StringPrototypeSlice(key, patternIndex + 1); - if (name.length >= key.length && StringPrototypeEndsWith(name, patternTrailer) && patternKeyCompare(bestMatch, key) === 1 && StringPrototypeLastIndexOf(key, "*") === patternIndex) { - bestMatch = key; - bestMatchSubpath = StringPrototypeSlice( - name, - patternIndex, - name.length - patternTrailer.length - ); - } - } - } - if (bestMatch) { - const target = imports[bestMatch]; - const resolveResult = resolvePackageTarget( - packageJSONUrl, - target, - bestMatchSubpath, - bestMatch, - base, - true, - true, - conditions - ); - if (resolveResult != null) { - return resolveResult; - } - } - } - } - } - throwImportNotDefined(name, packageJSONUrl, base); -} - -const flagSymbol = Symbol('arg flag'); - -class ArgError extends Error { - constructor(msg, code) { - super(msg); - this.name = 'ArgError'; - this.code = code; - - Object.setPrototypeOf(this, ArgError.prototype); - } -} - -function arg( - opts, - { - argv = process.argv.slice(2), - permissive = false, - stopAtPositional = false - } = {} -) { - if (!opts) { - throw new ArgError( - 'argument specification object is required', - 'ARG_CONFIG_NO_SPEC' - ); - } - - const result = { _: [] }; - - const aliases = {}; - const handlers = {}; - - for (const key of Object.keys(opts)) { - if (!key) { - throw new ArgError( - 'argument key cannot be an empty string', - 'ARG_CONFIG_EMPTY_KEY' - ); - } - - if (key[0] !== '-') { - throw new ArgError( - `argument key must start with '-' but found: '${key}'`, - 'ARG_CONFIG_NONOPT_KEY' - ); - } - - if (key.length === 1) { - throw new ArgError( - `argument key must have a name; singular '-' keys are not allowed: ${key}`, - 'ARG_CONFIG_NONAME_KEY' - ); - } - - if (typeof opts[key] === 'string') { - aliases[key] = opts[key]; - continue; - } - - let type = opts[key]; - let isFlag = false; - - if ( - Array.isArray(type) && - type.length === 1 && - typeof type[0] === 'function' - ) { - const [fn] = type; - type = (value, name, prev = []) => { - prev.push(fn(value, name, prev[prev.length - 1])); - return prev; - }; - isFlag = fn === Boolean || fn[flagSymbol] === true; - } else if (typeof type === 'function') { - isFlag = type === Boolean || type[flagSymbol] === true; - } else { - throw new ArgError( - `type missing or not a function or valid array type: ${key}`, - 'ARG_CONFIG_VAD_TYPE' - ); - } - - if (key[1] !== '-' && key.length > 2) { - throw new ArgError( - `short argument keys (with a single hyphen) must have only one character: ${key}`, - 'ARG_CONFIG_SHORTOPT_TOOLONG' - ); - } - - handlers[key] = [type, isFlag]; - } - - for (let i = 0, len = argv.length; i < len; i++) { - const wholeArg = argv[i]; - - if (stopAtPositional && result._.length > 0) { - result._ = result._.concat(argv.slice(i)); - break; - } - - if (wholeArg === '--') { - result._ = result._.concat(argv.slice(i + 1)); - break; - } - - if (wholeArg.length > 1 && wholeArg[0] === '-') { - /* eslint-disable operator-linebreak */ - const separatedArguments = - wholeArg[1] === '-' || wholeArg.length === 2 - ? [wholeArg] - : wholeArg - .slice(1) - .split('') - .map((a) => `-${a}`); - /* eslint-enable operator-linebreak */ - - for (let j = 0; j < separatedArguments.length; j++) { - const arg = separatedArguments[j]; - const [originalArgName, argStr] = - arg[1] === '-' ? arg.split(/=(.*)/, 2) : [arg, undefined]; - - let argName = originalArgName; - while (argName in aliases) { - argName = aliases[argName]; - } - - if (!(argName in handlers)) { - if (permissive) { - result._.push(arg); - continue; - } else { - throw new ArgError( - `unknown or unexpected option: ${originalArgName}`, - 'ARG_UNKNOWN_OPTION' - ); - } - } - - const [type, isFlag] = handlers[argName]; - - if (!isFlag && j + 1 < separatedArguments.length) { - throw new ArgError( - `option requires argument (but was followed by another short argument): ${originalArgName}`, - 'ARG_MISSING_REQUIRED_SHORTARG' - ); - } - - if (isFlag) { - result[argName] = type(true, argName, result[argName]); - } else if (argStr === undefined) { - if ( - argv.length < i + 2 || - (argv[i + 1].length > 1 && - argv[i + 1][0] === '-' && - !( - argv[i + 1].match(/^-?\d*(\.(?=\d))?\d*$/) && - (type === Number || - // eslint-disable-next-line no-undef - (typeof BigInt !== 'undefined' && type === BigInt)) - )) - ) { - const extended = - originalArgName === argName ? '' : ` (alias for ${argName})`; - throw new ArgError( - `option requires argument: ${originalArgName}${extended}`, - 'ARG_MISSING_REQUIRED_LONGARG' - ); - } - - result[argName] = type(argv[i + 1], argName, result[argName]); - ++i; - } else { - result[argName] = type(argStr, argName, result[argName]); - } - } - } else { - result._.push(wholeArg); - } - } - - return result; -} - -arg.flag = (fn) => { - fn[flagSymbol] = true; - return fn; -}; - -// Utility types -arg.COUNT = arg.flag((v, name, existingCount) => (existingCount || 0) + 1); - -// Expose error class -arg.ArgError = ArgError; - -var arg_1 = arg; - -/** - @license - The MIT License (MIT) - - Copyright (c) 2014 Blake Embrey (hello@blakeembrey.com) - - 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. -*/ -function getOptionValue(opt) { - parseOptions(); - return options[opt]; -} -let options; -function parseOptions() { - if (!options) { - options = { - "--conditions": [], - ...parseArgv(getNodeOptionsEnvArgv()), - ...parseArgv(process.execArgv) - }; - } -} -function parseArgv(argv) { - return arg_1( - { - "--conditions": [String], - "-C": "--conditions" - }, - { - argv, - permissive: true - } - ); -} -function getNodeOptionsEnvArgv() { - const errors = []; - const envArgv = ParseNodeOptionsEnvVar(process.env.NODE_OPTIONS || "", errors); - if (errors.length !== 0) ; - return envArgv; -} -function ParseNodeOptionsEnvVar(node_options, errors) { - const env_argv = []; - let is_in_string = false; - let will_start_new_arg = true; - for (let index = 0; index < node_options.length; ++index) { - let c = node_options[index]; - if (c === "\\" && is_in_string) { - if (index + 1 === node_options.length) { - errors.push("invalid value for NODE_OPTIONS (invalid escape)\n"); - return env_argv; - } else { - c = node_options[++index]; - } - } else if (c === " " && !is_in_string) { - will_start_new_arg = true; - continue; - } else if (c === '"') { - is_in_string = !is_in_string; - continue; - } - if (will_start_new_arg) { - env_argv.push(c); - will_start_new_arg = false; - } else { - env_argv[env_argv.length - 1] += c; - } - } - if (is_in_string) { - errors.push("invalid value for NODE_OPTIONS (unterminated string)\n"); - } - return env_argv; -} - -function makeApi(runtimeState, opts) { - const alwaysWarnOnFallback = Number(process.env.PNP_ALWAYS_WARN_ON_FALLBACK) > 0; - const debugLevel = Number(process.env.PNP_DEBUG_LEVEL); - const pathRegExp = /^(?![a-zA-Z]:[\\/]|\\\\|\.{0,2}(?:\/|$))((?:node:)?(?:@[^/]+\/)?[^/]+)\/*(.*|)$/; - const isStrictRegExp = /^(\/|\.{1,2}(\/|$))/; - const isDirRegExp = /\/$/; - const isRelativeRegexp = /^\.{0,2}\//; - const topLevelLocator = { name: null, reference: null }; - const fallbackLocators = []; - const emittedWarnings = /* @__PURE__ */ new Set(); - if (runtimeState.enableTopLevelFallback === true) - fallbackLocators.push(topLevelLocator); - if (opts.compatibilityMode !== false) { - for (const name of [`react-scripts`, `gatsby`]) { - const packageStore = runtimeState.packageRegistry.get(name); - if (packageStore) { - for (const reference of packageStore.keys()) { - if (reference === null) { - throw new Error(`Assertion failed: This reference shouldn't be null`); - } else { - fallbackLocators.push({ name, reference }); - } - } - } - } - } - const { - ignorePattern, - packageRegistry, - packageLocatorsByLocations - } = runtimeState; - function makeLogEntry(name, args) { - return { - fn: name, - args, - error: null, - result: null - }; - } - function trace(entry) { - const colors = process.stderr?.hasColors?.() ?? process.stdout.isTTY; - const c = (n, str) => `\x1B[${n}m${str}\x1B[0m`; - const error = entry.error; - if (error) - console.error(c(`31;1`, `\u2716 ${entry.error?.message.replace(/\n.*/s, ``)}`)); - else - console.error(c(`33;1`, `\u203C Resolution`)); - if (entry.args.length > 0) - console.error(); - for (const arg of entry.args) - console.error(` ${c(`37;1`, `In \u2190`)} ${nodeUtils.inspect(arg, { colors, compact: true })}`); - if (entry.result) { - console.error(); - console.error(` ${c(`37;1`, `Out \u2192`)} ${nodeUtils.inspect(entry.result, { colors, compact: true })}`); - } - const stack = new Error().stack.match(/(?<=^ +)at.*/gm)?.slice(2) ?? []; - if (stack.length > 0) { - console.error(); - for (const line of stack) { - console.error(` ${c(`38;5;244`, line)}`); - } - } - console.error(); - } - function maybeLog(name, fn) { - if (opts.allowDebug === false) - return fn; - if (Number.isFinite(debugLevel)) { - if (debugLevel >= 2) { - return (...args) => { - const logEntry = makeLogEntry(name, args); - try { - return logEntry.result = fn(...args); - } catch (error) { - throw logEntry.error = error; - } finally { - trace(logEntry); - } - }; - } else if (debugLevel >= 1) { - return (...args) => { - try { - return fn(...args); - } catch (error) { - const logEntry = makeLogEntry(name, args); - logEntry.error = error; - trace(logEntry); - throw error; - } - }; - } - } - return fn; - } - function getPackageInformationSafe(packageLocator) { - const packageInformation = getPackageInformation(packageLocator); - if (!packageInformation) { - throw makeError( - ErrorCode.INTERNAL, - `Couldn't find a matching entry in the dependency tree for the specified parent (this is probably an internal error)` - ); - } - return packageInformation; - } - function isDependencyTreeRoot(packageLocator) { - if (packageLocator.name === null) - return true; - for (const dependencyTreeRoot of runtimeState.dependencyTreeRoots) - if (dependencyTreeRoot.name === packageLocator.name && dependencyTreeRoot.reference === packageLocator.reference) - return true; - return false; - } - const defaultExportsConditions = /* @__PURE__ */ new Set([ - `node`, - `require`, - ...getOptionValue(`--conditions`) - ]); - function applyNodeExportsResolution(unqualifiedPath, conditions = defaultExportsConditions, issuer) { - const locator = findPackageLocator(ppath.join(unqualifiedPath, `internal.js`), { - resolveIgnored: true, - includeDiscardFromLookup: true - }); - if (locator === null) { - throw makeError( - ErrorCode.INTERNAL, - `The locator that owns the "${unqualifiedPath}" path can't be found inside the dependency tree (this is probably an internal error)` - ); - } - const { packageLocation } = getPackageInformationSafe(locator); - const manifestPath = ppath.join(packageLocation, Filename.manifest); - if (!opts.fakeFs.existsSync(manifestPath)) - return null; - const pkgJson = JSON.parse(opts.fakeFs.readFileSync(manifestPath, `utf8`)); - if (pkgJson.exports == null) - return null; - let subpath = ppath.contains(packageLocation, unqualifiedPath); - if (subpath === null) { - throw makeError( - ErrorCode.INTERNAL, - `unqualifiedPath doesn't contain the packageLocation (this is probably an internal error)` - ); - } - if (subpath !== `.` && !isRelativeRegexp.test(subpath)) - subpath = `./${subpath}`; - try { - const resolvedExport = packageExportsResolve({ - packageJSONUrl: url.pathToFileURL(npath.fromPortablePath(manifestPath)), - packageSubpath: subpath, - exports: pkgJson.exports, - base: issuer ? url.pathToFileURL(npath.fromPortablePath(issuer)) : null, - conditions - }); - return npath.toPortablePath(url.fileURLToPath(resolvedExport)); - } catch (error) { - throw makeError( - ErrorCode.EXPORTS_RESOLUTION_FAILED, - error.message, - { unqualifiedPath: getPathForDisplay(unqualifiedPath), locator, pkgJson, subpath: getPathForDisplay(subpath), conditions }, - error.code - ); - } - } - function applyNodeExtensionResolution(unqualifiedPath, candidates, { extensions }) { - let stat; - try { - candidates.push(unqualifiedPath); - stat = opts.fakeFs.statSync(unqualifiedPath); - } catch (error) { - } - if (stat && !stat.isDirectory()) - return opts.fakeFs.realpathSync(unqualifiedPath); - if (stat && stat.isDirectory()) { - let pkgJson; - try { - pkgJson = JSON.parse(opts.fakeFs.readFileSync(ppath.join(unqualifiedPath, Filename.manifest), `utf8`)); - } catch (error) { - } - let nextUnqualifiedPath; - if (pkgJson && pkgJson.main) - nextUnqualifiedPath = ppath.resolve(unqualifiedPath, pkgJson.main); - if (nextUnqualifiedPath && nextUnqualifiedPath !== unqualifiedPath) { - const resolution = applyNodeExtensionResolution(nextUnqualifiedPath, candidates, { extensions }); - if (resolution !== null) { - return resolution; - } - } - } - for (let i = 0, length = extensions.length; i < length; i++) { - const candidateFile = `${unqualifiedPath}${extensions[i]}`; - candidates.push(candidateFile); - if (opts.fakeFs.existsSync(candidateFile)) { - return candidateFile; - } - } - if (stat && stat.isDirectory()) { - for (let i = 0, length = extensions.length; i < length; i++) { - const candidateFile = ppath.format({ dir: unqualifiedPath, name: `index`, ext: extensions[i] }); - candidates.push(candidateFile); - if (opts.fakeFs.existsSync(candidateFile)) { - return candidateFile; - } - } - } - return null; - } - function makeFakeModule(path) { - const fakeModule = new require$$0.Module(path, null); - fakeModule.filename = path; - fakeModule.paths = require$$0.Module._nodeModulePaths(path); - return fakeModule; - } - function callNativeResolution(request, issuer) { - if (issuer.endsWith(`/`)) - issuer = ppath.join(issuer, `internal.js`); - return require$$0.Module._resolveFilename(npath.fromPortablePath(request), makeFakeModule(npath.fromPortablePath(issuer)), false, { plugnplay: false }); - } - function isPathIgnored(path) { - if (ignorePattern === null) - return false; - const subPath = ppath.contains(runtimeState.basePath, path); - if (subPath === null) - return false; - if (ignorePattern.test(subPath.replace(/\/$/, ``))) { - return true; - } else { - return false; - } - } - const VERSIONS = { std: 3, resolveVirtual: 1, getAllLocators: 1 }; - const topLevel = topLevelLocator; - function getPackageInformation({ name, reference }) { - const packageInformationStore = packageRegistry.get(name); - if (!packageInformationStore) - return null; - const packageInformation = packageInformationStore.get(reference); - if (!packageInformation) - return null; - return packageInformation; - } - function findPackageDependents({ name, reference }) { - const dependents = []; - for (const [dependentName, packageInformationStore] of packageRegistry) { - if (dependentName === null) - continue; - for (const [dependentReference, packageInformation] of packageInformationStore) { - if (dependentReference === null) - continue; - const dependencyReference = packageInformation.packageDependencies.get(name); - if (dependencyReference !== reference) - continue; - if (dependentName === name && dependentReference === reference) - continue; - dependents.push({ - name: dependentName, - reference: dependentReference - }); - } - } - return dependents; - } - function findBrokenPeerDependencies(dependency, initialPackage) { - const brokenPackages = /* @__PURE__ */ new Map(); - const alreadyVisited = /* @__PURE__ */ new Set(); - const traversal = (currentPackage) => { - const identifier = JSON.stringify(currentPackage.name); - if (alreadyVisited.has(identifier)) - return; - alreadyVisited.add(identifier); - const dependents = findPackageDependents(currentPackage); - for (const dependent of dependents) { - const dependentInformation = getPackageInformationSafe(dependent); - if (dependentInformation.packagePeers.has(dependency)) { - traversal(dependent); - } else { - let brokenSet = brokenPackages.get(dependent.name); - if (typeof brokenSet === `undefined`) - brokenPackages.set(dependent.name, brokenSet = /* @__PURE__ */ new Set()); - brokenSet.add(dependent.reference); - } - } - }; - traversal(initialPackage); - const brokenList = []; - for (const name of [...brokenPackages.keys()].sort()) - for (const reference of [...brokenPackages.get(name)].sort()) - brokenList.push({ name, reference }); - return brokenList; - } - function findPackageLocator(location, { resolveIgnored = false, includeDiscardFromLookup = false } = {}) { - if (isPathIgnored(location) && !resolveIgnored) - return null; - let relativeLocation = ppath.relative(runtimeState.basePath, location); - if (!relativeLocation.match(isStrictRegExp)) - relativeLocation = `./${relativeLocation}`; - if (!relativeLocation.endsWith(`/`)) - relativeLocation = `${relativeLocation}/`; - do { - const entry = packageLocatorsByLocations.get(relativeLocation); - if (typeof entry === `undefined` || entry.discardFromLookup && !includeDiscardFromLookup) { - relativeLocation = relativeLocation.substring(0, relativeLocation.lastIndexOf(`/`, relativeLocation.length - 2) + 1); - continue; - } - return entry.locator; - } while (relativeLocation !== ``); - return null; - } - function tryReadFile(filePath) { - try { - return opts.fakeFs.readFileSync(npath.toPortablePath(filePath), `utf8`); - } catch (err) { - if (err.code === `ENOENT`) - return void 0; - throw err; - } - } - function resolveToUnqualified(request, issuer, { considerBuiltins = true } = {}) { - if (request.startsWith(`#`)) - throw new Error(`resolveToUnqualified can not handle private import mappings`); - if (request === `pnpapi`) - return npath.toPortablePath(opts.pnpapiResolution); - if (considerBuiltins && require$$0.isBuiltin(request)) - return null; - const requestForDisplay = getPathForDisplay(request); - const issuerForDisplay = issuer && getPathForDisplay(issuer); - if (issuer && isPathIgnored(issuer)) { - if (!ppath.isAbsolute(request) || findPackageLocator(request) === null) { - const result = callNativeResolution(request, issuer); - if (result === false) { - throw makeError( - ErrorCode.BUILTIN_NODE_RESOLUTION_FAILED, - `The builtin node resolution algorithm was unable to resolve the requested module (it didn't go through the pnp resolver because the issuer was explicitely ignored by the regexp) - -Require request: "${requestForDisplay}" -Required by: ${issuerForDisplay} -`, - { request: requestForDisplay, issuer: issuerForDisplay } - ); - } - return npath.toPortablePath(result); - } - } - let unqualifiedPath; - const dependencyNameMatch = request.match(pathRegExp); - if (!dependencyNameMatch) { - if (ppath.isAbsolute(request)) { - unqualifiedPath = ppath.normalize(request); - } else { - if (!issuer) { - throw makeError( - ErrorCode.API_ERROR, - `The resolveToUnqualified function must be called with a valid issuer when the path isn't a builtin nor absolute`, - { request: requestForDisplay, issuer: issuerForDisplay } - ); - } - const absoluteIssuer = ppath.resolve(issuer); - if (issuer.match(isDirRegExp)) { - unqualifiedPath = ppath.normalize(ppath.join(absoluteIssuer, request)); - } else { - unqualifiedPath = ppath.normalize(ppath.join(ppath.dirname(absoluteIssuer), request)); - } - } - } else { - if (!issuer) { - throw makeError( - ErrorCode.API_ERROR, - `The resolveToUnqualified function must be called with a valid issuer when the path isn't a builtin nor absolute`, - { request: requestForDisplay, issuer: issuerForDisplay } - ); - } - const [, dependencyName, subPath] = dependencyNameMatch; - const issuerLocator = findPackageLocator(issuer); - if (!issuerLocator) { - const result = callNativeResolution(request, issuer); - if (result === false) { - throw makeError( - ErrorCode.BUILTIN_NODE_RESOLUTION_FAILED, - `The builtin node resolution algorithm was unable to resolve the requested module (it didn't go through the pnp resolver because the issuer doesn't seem to be part of the Yarn-managed dependency tree). - -Require path: "${requestForDisplay}" -Required by: ${issuerForDisplay} -`, - { request: requestForDisplay, issuer: issuerForDisplay } - ); - } - return npath.toPortablePath(result); - } - const issuerInformation = getPackageInformationSafe(issuerLocator); - let dependencyReference = issuerInformation.packageDependencies.get(dependencyName); - let fallbackReference = null; - if (dependencyReference == null) { - if (issuerLocator.name !== null) { - const exclusionEntry = runtimeState.fallbackExclusionList.get(issuerLocator.name); - const canUseFallbacks = !exclusionEntry || !exclusionEntry.has(issuerLocator.reference); - if (canUseFallbacks) { - for (let t = 0, T = fallbackLocators.length; t < T; ++t) { - const fallbackInformation = getPackageInformationSafe(fallbackLocators[t]); - const reference = fallbackInformation.packageDependencies.get(dependencyName); - if (reference == null) - continue; - if (alwaysWarnOnFallback) - fallbackReference = reference; - else - dependencyReference = reference; - break; - } - if (runtimeState.enableTopLevelFallback) { - if (dependencyReference == null && fallbackReference === null) { - const reference = runtimeState.fallbackPool.get(dependencyName); - if (reference != null) { - fallbackReference = reference; - } - } - } - } - } - } - let error = null; - if (dependencyReference === null) { - if (isDependencyTreeRoot(issuerLocator)) { - error = makeError( - ErrorCode.MISSING_PEER_DEPENDENCY, - `Your application tried to access ${dependencyName} (a peer dependency); this isn't allowed as there is no ancestor to satisfy the requirement. Use a devDependency if needed. - -Required package: ${dependencyName}${dependencyName !== requestForDisplay ? ` (via "${requestForDisplay}")` : ``} -Required by: ${issuerForDisplay} -`, - { request: requestForDisplay, issuer: issuerForDisplay, dependencyName } - ); - } else { - const brokenAncestors = findBrokenPeerDependencies(dependencyName, issuerLocator); - if (brokenAncestors.every((ancestor) => isDependencyTreeRoot(ancestor))) { - error = makeError( - ErrorCode.MISSING_PEER_DEPENDENCY, - `${issuerLocator.name} tried to access ${dependencyName} (a peer dependency) but it isn't provided by your application; this makes the require call ambiguous and unsound. - -Required package: ${dependencyName}${dependencyName !== requestForDisplay ? ` (via "${requestForDisplay}")` : ``} -Required by: ${issuerLocator.name}@${issuerLocator.reference} (via ${issuerForDisplay}) -${brokenAncestors.map((ancestorLocator) => `Ancestor breaking the chain: ${ancestorLocator.name}@${ancestorLocator.reference} -`).join(``)} -`, - { request: requestForDisplay, issuer: issuerForDisplay, issuerLocator: Object.assign({}, issuerLocator), dependencyName, brokenAncestors } - ); - } else { - error = makeError( - ErrorCode.MISSING_PEER_DEPENDENCY, - `${issuerLocator.name} tried to access ${dependencyName} (a peer dependency) but it isn't provided by its ancestors; this makes the require call ambiguous and unsound. - -Required package: ${dependencyName}${dependencyName !== requestForDisplay ? ` (via "${requestForDisplay}")` : ``} -Required by: ${issuerLocator.name}@${issuerLocator.reference} (via ${issuerForDisplay}) - -${brokenAncestors.map((ancestorLocator) => `Ancestor breaking the chain: ${ancestorLocator.name}@${ancestorLocator.reference} -`).join(``)} -`, - { request: requestForDisplay, issuer: issuerForDisplay, issuerLocator: Object.assign({}, issuerLocator), dependencyName, brokenAncestors } - ); - } - } - } else if (dependencyReference === void 0) { - if (!considerBuiltins && require$$0.isBuiltin(request)) { - if (isDependencyTreeRoot(issuerLocator)) { - error = makeError( - ErrorCode.UNDECLARED_DEPENDENCY, - `Your application tried to access ${dependencyName}. While this module is usually interpreted as a Node builtin, your resolver is running inside a non-Node resolution context where such builtins are ignored. Since ${dependencyName} isn't otherwise declared in your dependencies, this makes the require call ambiguous and unsound. - -Required package: ${dependencyName}${dependencyName !== requestForDisplay ? ` (via "${requestForDisplay}")` : ``} -Required by: ${issuerForDisplay} -`, - { request: requestForDisplay, issuer: issuerForDisplay, dependencyName } - ); - } else { - error = makeError( - ErrorCode.UNDECLARED_DEPENDENCY, - `${issuerLocator.name} tried to access ${dependencyName}. While this module is usually interpreted as a Node builtin, your resolver is running inside a non-Node resolution context where such builtins are ignored. Since ${dependencyName} isn't otherwise declared in ${issuerLocator.name}'s dependencies, this makes the require call ambiguous and unsound. - -Required package: ${dependencyName}${dependencyName !== requestForDisplay ? ` (via "${requestForDisplay}")` : ``} -Required by: ${issuerForDisplay} -`, - { request: requestForDisplay, issuer: issuerForDisplay, issuerLocator: Object.assign({}, issuerLocator), dependencyName } - ); - } - } else { - if (isDependencyTreeRoot(issuerLocator)) { - error = makeError( - ErrorCode.UNDECLARED_DEPENDENCY, - `Your application tried to access ${dependencyName}, but it isn't declared in your dependencies; this makes the require call ambiguous and unsound. - -Required package: ${dependencyName}${dependencyName !== requestForDisplay ? ` (via "${requestForDisplay}")` : ``} -Required by: ${issuerForDisplay} -`, - { request: requestForDisplay, issuer: issuerForDisplay, dependencyName } - ); - } else { - error = makeError( - ErrorCode.UNDECLARED_DEPENDENCY, - `${issuerLocator.name} tried to access ${dependencyName}, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound. - -Required package: ${dependencyName}${dependencyName !== requestForDisplay ? ` (via "${requestForDisplay}")` : ``} -Required by: ${issuerLocator.name}@${issuerLocator.reference} (via ${issuerForDisplay}) -`, - { request: requestForDisplay, issuer: issuerForDisplay, issuerLocator: Object.assign({}, issuerLocator), dependencyName } - ); - } - } - } - if (dependencyReference == null) { - if (fallbackReference === null || error === null) - throw error || new Error(`Assertion failed: Expected an error to have been set`); - dependencyReference = fallbackReference; - const message = error.message.replace(/\n.*/g, ``); - error.message = message; - if (!emittedWarnings.has(message) && debugLevel !== 0) { - emittedWarnings.add(message); - process.emitWarning(error); - } - } - const dependencyLocator = Array.isArray(dependencyReference) ? { name: dependencyReference[0], reference: dependencyReference[1] } : { name: dependencyName, reference: dependencyReference }; - const dependencyInformation = getPackageInformationSafe(dependencyLocator); - if (!dependencyInformation.packageLocation) { - throw makeError( - ErrorCode.MISSING_DEPENDENCY, - `A dependency seems valid but didn't get installed for some reason. This might be caused by a partial install, such as dev vs prod. - -Required package: ${dependencyLocator.name}@${dependencyLocator.reference}${dependencyLocator.name !== requestForDisplay ? ` (via "${requestForDisplay}")` : ``} -Required by: ${issuerLocator.name}@${issuerLocator.reference} (via ${issuerForDisplay}) -`, - { request: requestForDisplay, issuer: issuerForDisplay, dependencyLocator: Object.assign({}, dependencyLocator) } - ); - } - const dependencyLocation = dependencyInformation.packageLocation; - if (subPath) { - unqualifiedPath = ppath.join(dependencyLocation, subPath); - } else { - unqualifiedPath = dependencyLocation; - } - } - return ppath.normalize(unqualifiedPath); - } - function resolveUnqualifiedExport(request, unqualifiedPath, conditions = defaultExportsConditions, issuer) { - if (isStrictRegExp.test(request)) - return unqualifiedPath; - const unqualifiedExportPath = applyNodeExportsResolution(unqualifiedPath, conditions, issuer); - if (unqualifiedExportPath) { - return ppath.normalize(unqualifiedExportPath); - } else { - return unqualifiedPath; - } - } - function resolveUnqualified(unqualifiedPath, { extensions = Object.keys(require$$0.Module._extensions) } = {}) { - const candidates = []; - const qualifiedPath = applyNodeExtensionResolution(unqualifiedPath, candidates, { extensions }); - if (qualifiedPath) { - return ppath.normalize(qualifiedPath); - } else { - reportRequiredFilesToWatchMode(candidates.map((candidate) => npath.fromPortablePath(candidate))); - const unqualifiedPathForDisplay = getPathForDisplay(unqualifiedPath); - const containingPackage = findPackageLocator(unqualifiedPath); - if (containingPackage) { - const { packageLocation } = getPackageInformationSafe(containingPackage); - let exists = true; - try { - opts.fakeFs.accessSync(packageLocation); - } catch (err) { - if (err?.code === `ENOENT`) { - exists = false; - } else { - const readableError = (err?.message ?? err ?? `empty exception thrown`).replace(/^[A-Z]/, ($0) => $0.toLowerCase()); - throw makeError(ErrorCode.QUALIFIED_PATH_RESOLUTION_FAILED, `Required package exists but could not be accessed (${readableError}). - -Missing package: ${containingPackage.name}@${containingPackage.reference} -Expected package location: ${getPathForDisplay(packageLocation)} -`, { unqualifiedPath: unqualifiedPathForDisplay, extensions }); - } - } - if (!exists) { - const errorMessage = packageLocation.includes(`/unplugged/`) ? `Required unplugged package missing from disk. This may happen when switching branches without running installs (unplugged packages must be fully materialized on disk to work).` : `Required package missing from disk. If you keep your packages inside your repository then restarting the Node process may be enough. Otherwise, try to run an install first.`; - throw makeError( - ErrorCode.QUALIFIED_PATH_RESOLUTION_FAILED, - `${errorMessage} - -Missing package: ${containingPackage.name}@${containingPackage.reference} -Expected package location: ${getPathForDisplay(packageLocation)} -`, - { unqualifiedPath: unqualifiedPathForDisplay, extensions } - ); - } - } - throw makeError( - ErrorCode.QUALIFIED_PATH_RESOLUTION_FAILED, - `Qualified path resolution failed: we looked for the following paths, but none could be accessed. - -Source path: ${unqualifiedPathForDisplay} -${candidates.map((candidate) => `Not found: ${getPathForDisplay(candidate)} -`).join(``)}`, - { unqualifiedPath: unqualifiedPathForDisplay, extensions } - ); - } - } - function resolvePrivateRequest(request, issuer, opts2) { - if (!issuer) - throw new Error(`Assertion failed: An issuer is required to resolve private import mappings`); - const resolved = packageImportsResolve({ - name: request, - base: url.pathToFileURL(npath.fromPortablePath(issuer)), - conditions: opts2.conditions ?? defaultExportsConditions, - readFileSyncFn: tryReadFile - }); - if (resolved instanceof URL) { - return resolveUnqualified(npath.toPortablePath(url.fileURLToPath(resolved)), { extensions: opts2.extensions }); - } else { - if (resolved.startsWith(`#`)) - throw new Error(`Mapping from one private import to another isn't allowed`); - return resolveRequest(resolved, issuer, opts2); - } - } - function resolveRequest(request, issuer, opts2 = {}) { - try { - if (request.startsWith(`#`)) - return resolvePrivateRequest(request, issuer, opts2); - const { considerBuiltins, extensions, conditions } = opts2; - const unqualifiedPath = resolveToUnqualified(request, issuer, { considerBuiltins }); - if (request === `pnpapi`) - return unqualifiedPath; - if (unqualifiedPath === null) - return null; - const isIssuerIgnored = () => issuer !== null ? isPathIgnored(issuer) : false; - const remappedPath = (!considerBuiltins || !require$$0.isBuiltin(request)) && !isIssuerIgnored() ? resolveUnqualifiedExport(request, unqualifiedPath, conditions, issuer) : unqualifiedPath; - return resolveUnqualified(remappedPath, { extensions }); - } catch (error) { - if (Object.hasOwn(error, `pnpCode`)) - Object.assign(error.data, { request: getPathForDisplay(request), issuer: issuer && getPathForDisplay(issuer) }); - throw error; - } - } - function resolveVirtual(request) { - const normalized = ppath.normalize(request); - const resolved = VirtualFS.resolveVirtual(normalized); - return resolved !== normalized ? resolved : null; - } - return { - VERSIONS, - topLevel, - getLocator: (name, referencish) => { - if (Array.isArray(referencish)) { - return { name: referencish[0], reference: referencish[1] }; - } else { - return { name, reference: referencish }; - } - }, - getDependencyTreeRoots: () => { - return [...runtimeState.dependencyTreeRoots]; - }, - getAllLocators() { - const locators = []; - for (const [name, entry] of packageRegistry) - for (const reference of entry.keys()) - if (name !== null && reference !== null) - locators.push({ name, reference }); - return locators; - }, - getPackageInformation: (locator) => { - const info = getPackageInformation(locator); - if (info === null) - return null; - const packageLocation = npath.fromPortablePath(info.packageLocation); - const nativeInfo = { ...info, packageLocation }; - return nativeInfo; - }, - findPackageLocator: (path) => { - return findPackageLocator(npath.toPortablePath(path)); - }, - resolveToUnqualified: maybeLog(`resolveToUnqualified`, (request, issuer, opts2) => { - const portableIssuer = issuer !== null ? npath.toPortablePath(issuer) : null; - const resolution = resolveToUnqualified(npath.toPortablePath(request), portableIssuer, opts2); - if (resolution === null) - return null; - return npath.fromPortablePath(resolution); - }), - resolveUnqualified: maybeLog(`resolveUnqualified`, (unqualifiedPath, opts2) => { - return npath.fromPortablePath(resolveUnqualified(npath.toPortablePath(unqualifiedPath), opts2)); - }), - resolveRequest: maybeLog(`resolveRequest`, (request, issuer, opts2) => { - const portableIssuer = issuer !== null ? npath.toPortablePath(issuer) : null; - const resolution = resolveRequest(npath.toPortablePath(request), portableIssuer, opts2); - if (resolution === null) - return null; - return npath.fromPortablePath(resolution); - }), - resolveVirtual: maybeLog(`resolveVirtual`, (path) => { - const result = resolveVirtual(npath.toPortablePath(path)); - if (result !== null) { - return npath.fromPortablePath(result); - } else { - return null; - } - }) - }; -} - -function makeManager(pnpapi, opts) { - const initialApiPath = npath.toPortablePath(pnpapi.resolveToUnqualified(`pnpapi`, null)); - const initialApiStats = opts.fakeFs.statSync(npath.toPortablePath(initialApiPath)); - const apiMetadata = /* @__PURE__ */ new Map([ - [initialApiPath, { - instance: pnpapi, - stats: initialApiStats, - lastRefreshCheck: Date.now() - }] - ]); - function loadApiInstance(pnpApiPath) { - const nativePath = npath.fromPortablePath(pnpApiPath); - const module = new require$$0.Module(nativePath, null); - module.load(nativePath); - return module.exports; - } - function refreshApiEntry(pnpApiPath, apiEntry) { - const timeNow = Date.now(); - if (timeNow - apiEntry.lastRefreshCheck < 500) - return; - apiEntry.lastRefreshCheck = timeNow; - const stats = opts.fakeFs.statSync(pnpApiPath); - if (stats.mtime > apiEntry.stats.mtime) { - process.emitWarning(`[Warning] The runtime detected new information in a PnP file; reloading the API instance (${npath.fromPortablePath(pnpApiPath)})`); - apiEntry.stats = stats; - apiEntry.instance = loadApiInstance(pnpApiPath); - } - } - function getApiEntry(pnpApiPath, refresh = false) { - let apiEntry = apiMetadata.get(pnpApiPath); - if (typeof apiEntry !== `undefined`) { - if (refresh) { - refreshApiEntry(pnpApiPath, apiEntry); - } - } else { - apiMetadata.set(pnpApiPath, apiEntry = { - instance: loadApiInstance(pnpApiPath), - stats: opts.fakeFs.statSync(pnpApiPath), - lastRefreshCheck: Date.now() - }); - } - return apiEntry; - } - const findApiPathCache = /* @__PURE__ */ new Map(); - function addToCacheAndReturn(start, end, target) { - if (target !== null) { - target = VirtualFS.resolveVirtual(target); - target = opts.fakeFs.realpathSync(target); - } - let curr; - let next = start; - do { - curr = next; - findApiPathCache.set(curr, target); - next = ppath.dirname(curr); - } while (curr !== end); - return target; - } - function findApiPathFor(modulePath) { - let bestCandidate = null; - for (const [apiPath, apiEntry] of apiMetadata) { - const locator = apiEntry.instance.findPackageLocator(modulePath); - if (!locator) - continue; - if (apiMetadata.size === 1) - return apiPath; - const packageInformation = apiEntry.instance.getPackageInformation(locator); - if (!packageInformation) - throw new Error(`Assertion failed: Couldn't get package information for '${modulePath}'`); - if (!bestCandidate) - bestCandidate = { packageLocation: packageInformation.packageLocation, apiPaths: [] }; - if (packageInformation.packageLocation === bestCandidate.packageLocation) { - bestCandidate.apiPaths.push(apiPath); - } else if (packageInformation.packageLocation.length > bestCandidate.packageLocation.length) { - bestCandidate = { packageLocation: packageInformation.packageLocation, apiPaths: [apiPath] }; - } - } - if (bestCandidate) { - if (bestCandidate.apiPaths.length === 1) - return bestCandidate.apiPaths[0]; - const controlSegment = bestCandidate.apiPaths.map((apiPath) => ` ${npath.fromPortablePath(apiPath)}`).join(` -`); - throw new Error(`Unable to locate pnpapi, the module '${modulePath}' is controlled by multiple pnpapi instances. -This is usually caused by using the global cache (enableGlobalCache: true) - -Controlled by: -${controlSegment} -`); - } - const start = ppath.resolve(npath.toPortablePath(modulePath)); - let curr; - let next = start; - do { - curr = next; - const cached = findApiPathCache.get(curr); - if (cached !== void 0) - return addToCacheAndReturn(start, curr, cached); - const cjsCandidate = ppath.join(curr, Filename.pnpCjs); - if (opts.fakeFs.existsSync(cjsCandidate) && opts.fakeFs.statSync(cjsCandidate).isFile()) - return addToCacheAndReturn(start, curr, cjsCandidate); - const legacyCjsCandidate = ppath.join(curr, Filename.pnpJs); - if (opts.fakeFs.existsSync(legacyCjsCandidate) && opts.fakeFs.statSync(legacyCjsCandidate).isFile()) - return addToCacheAndReturn(start, curr, legacyCjsCandidate); - next = ppath.dirname(curr); - } while (curr !== PortablePath.root); - return addToCacheAndReturn(start, curr, null); - } - const moduleToApiPathCache = /* @__PURE__ */ new WeakMap(); - function getApiPathFromParent(parent) { - if (parent == null) - return initialApiPath; - let apiPath = moduleToApiPathCache.get(parent); - if (typeof apiPath !== `undefined`) - return apiPath; - apiPath = parent.filename ? findApiPathFor(parent.filename) : null; - moduleToApiPathCache.set(parent, apiPath); - return apiPath; - } - return { - getApiPathFromParent, - findApiPathFor, - getApiEntry - }; -} - -const localFs = { ...fs__default.default }; -const nodeFs = new NodeFS(localFs); -const defaultRuntimeState = $$SETUP_STATE(hydrateRuntimeState); -const defaultPnpapiResolution = __filename; -const defaultFsLayer = new VirtualFS({ - baseFs: new ZipOpenFS({ - baseFs: nodeFs, - maxOpenFiles: 80, - readOnlyArchives: true - }) -}); -class DynamicFS extends ProxiedFS { - constructor() { - super(ppath); - this.baseFs = defaultFsLayer; - } - mapToBase(p) { - return p; - } - mapFromBase(p) { - return p; - } -} -const dynamicFsLayer = new DynamicFS(); -let manager; -const defaultApi = Object.assign(makeApi(defaultRuntimeState, { - fakeFs: dynamicFsLayer, - pnpapiResolution: defaultPnpapiResolution -}), { - makeApi: ({ - basePath = void 0, - fakeFs = dynamicFsLayer, - pnpapiResolution = defaultPnpapiResolution, - ...rest - }) => { - const apiRuntimeState = typeof basePath !== `undefined` ? $$SETUP_STATE(hydrateRuntimeState, basePath) : defaultRuntimeState; - return makeApi(apiRuntimeState, { - fakeFs, - pnpapiResolution, - ...rest - }); - }, - setup: (api) => { - applyPatch(api || defaultApi, { - fakeFs: defaultFsLayer, - manager - }); - dynamicFsLayer.baseFs = new NodeFS(fs__default.default); - } -}); -manager = makeManager(defaultApi, { - fakeFs: dynamicFsLayer -}); -if (module.parent && module.parent.id === `internal/preload`) { - defaultApi.setup(); - if (module.filename) { - delete require$$0__default.default._cache[module.filename]; - } -} -if (process.mainModule === module) { - const reportError = (code, message, data) => { - process.stdout.write(`${JSON.stringify([{ code, message, data }, null])} -`); - }; - const reportSuccess = (resolution) => { - process.stdout.write(`${JSON.stringify([null, resolution])} -`); - }; - const processResolution = (request, issuer) => { - try { - reportSuccess(defaultApi.resolveRequest(request, issuer)); - } catch (error) { - reportError(error.code, error.message, error.data); - } - }; - const processRequest = (data) => { - try { - const [request, issuer] = JSON.parse(data); - processResolution(request, issuer); - } catch (error) { - reportError(`INVALID_JSON`, error.message, error.data); - } - }; - if (process.argv.length > 2) { - if (process.argv.length !== 4) { - process.stderr.write(`Usage: ${process.argv[0]} ${process.argv[1]} -`); - process.exitCode = 64; - } else { - processResolution(process.argv[2], process.argv[3]); - } - } else { - let buffer = ``; - const decoder = new StringDecoder__default.default.StringDecoder(); - process.stdin.on(`data`, (chunk) => { - buffer += decoder.write(chunk); - do { - const index = buffer.indexOf(` -`); - if (index === -1) - break; - const line = buffer.slice(0, index); - buffer = buffer.slice(index + 1); - processRequest(line); - } while (true); - }); - } -} - -module.exports = defaultApi; diff --git a/fixtures/pnp/.yarnrc.yml b/fixtures/pnp/.yarnrc.yml deleted file mode 100644 index 6a6b24d8..00000000 --- a/fixtures/pnp/.yarnrc.yml +++ /dev/null @@ -1 +0,0 @@ -enableGlobalCache: 0 diff --git a/fixtures/pnp/package.json b/fixtures/pnp/package.json deleted file mode 100644 index 5d119379..00000000 --- a/fixtures/pnp/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "pnp", - "packageManager": "yarn@4.3.1", - "dependencies": { - "is-even": "^1.0.0", - "is-odd": "^3.0.1" - } -} diff --git a/fixtures/pnp/yarn.lock b/fixtures/pnp/yarn.lock deleted file mode 100644 index ba89514d..00000000 --- a/fixtures/pnp/yarn.lock +++ /dev/null @@ -1,74 +0,0 @@ -# This file is generated by running "yarn install" inside your project. -# Manual changes might be lost - proceed with caution! - -__metadata: - version: 8 - cacheKey: 10c0 - -"is-buffer@npm:^1.1.5": - version: 1.1.6 - resolution: "is-buffer@npm:1.1.6" - checksum: 10c0/ae18aa0b6e113d6c490ad1db5e8df9bdb57758382b313f5a22c9c61084875c6396d50bbf49315f5b1926d142d74dfb8d31b40d993a383e0a158b15fea7a82234 - languageName: node - linkType: hard - -"is-even@npm:^1.0.0": - version: 1.0.0 - resolution: "is-even@npm:1.0.0" - dependencies: - is-odd: "npm:^0.1.2" - checksum: 10c0/2728cc2f390d07c6a44a054aa53ae6ce57c3a4adfd76a92df528e992b4a978fdec4eaa948e0de6e6431ef3c8deebf1c964fd870d4983044ec9f0f4e630dfb3a5 - languageName: node - linkType: hard - -"is-number@npm:^3.0.0": - version: 3.0.0 - resolution: "is-number@npm:3.0.0" - dependencies: - kind-of: "npm:^3.0.2" - checksum: 10c0/e639c54640b7f029623df24d3d103901e322c0c25ea5bde97cd723c2d0d4c05857a8364ab5c58d963089dbed6bf1d0ffe975cb6aef917e2ad0ccbca653d31b4f - languageName: node - linkType: hard - -"is-number@npm:^6.0.0": - version: 6.0.0 - resolution: "is-number@npm:6.0.0" - checksum: 10c0/5da4c68401529675c575878d2760d66f18eaef4b014858577f6003daf66488d7fe4eae684b1e8574e3fa1bb447c6c6c56b8491d2b4b3239da2d32e5f6f218008 - languageName: node - linkType: hard - -"is-odd@npm:^0.1.2": - version: 0.1.2 - resolution: "is-odd@npm:0.1.2" - dependencies: - is-number: "npm:^3.0.0" - checksum: 10c0/7dc6c6fd004861208ef9f324021c66f19b3dad209c2da3ef3720d4d76e141974fadb52c47b439fc8c52af579468640b554115395b5673f4558ef09719260e898 - languageName: node - linkType: hard - -"is-odd@npm:^3.0.1": - version: 3.0.1 - resolution: "is-odd@npm:3.0.1" - dependencies: - is-number: "npm:^6.0.0" - checksum: 10c0/89ee2e353c5a3f3bd400c79db1c307a5b3506198ee8169d521e533a9b1d8a08fc95f21a919c084e98845b4286d7ffe309778da03744dfe66c3c1763ab1a030c6 - languageName: node - linkType: hard - -"kind-of@npm:^3.0.2": - version: 3.2.2 - resolution: "kind-of@npm:3.2.2" - dependencies: - is-buffer: "npm:^1.1.5" - checksum: 10c0/7e34bc29d4b02c997f92f080de34ebb92033a96736bbb0bb2410e033a7e5ae6571f1fa37b2d7710018f95361473b816c604234197f4f203f9cf149d8ef1574d9 - languageName: node - linkType: hard - -"pnp@workspace:.": - version: 0.0.0-use.local - resolution: "pnp@workspace:." - dependencies: - is-even: "npm:^1.0.0" - is-odd: "npm:^3.0.1" - languageName: unknown - linkType: soft diff --git a/fixtures/pnpm/.gitignore b/fixtures/pnpm/.gitignore deleted file mode 100644 index 3c3629e6..00000000 --- a/fixtures/pnpm/.gitignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/fixtures/pnpm/package.json b/fixtures/pnpm/package.json deleted file mode 100644 index b763d74d..00000000 --- a/fixtures/pnpm/package.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "name": "pnpm", - "version": "1.0.0", - "private": true, - "devDependencies": { - "axios": "1.6.2", - "ipaddr.js": "2.2.0", - "postcss": "8.4.33", - "styled-components": "6.1.1" - } -} diff --git a/fixtures/pnpm/pnpm-lock.yaml b/fixtures/pnpm/pnpm-lock.yaml deleted file mode 100644 index e51dfd6a..00000000 --- a/fixtures/pnpm/pnpm-lock.yaml +++ /dev/null @@ -1,212 +0,0 @@ -lockfileVersion: '6.0' - -settings: - autoInstallPeers: true - excludeLinksFromLockfile: false - -devDependencies: - axios: - specifier: 1.6.2 - version: 1.6.2 - postcss: - specifier: 8.4.33 - version: 8.4.33 - styled-components: - specifier: 6.1.1 - version: 6.1.1(react-dom@18.2.0)(react@18.2.0) - -packages: - - /@emotion/is-prop-valid@1.2.1: - resolution: {integrity: sha512-61Mf7Ufx4aDxx1xlDeOm8aFFigGHE4z+0sKCa+IHCeZKiyP9RLD0Mmx7m8b9/Cf37f7NAvQOOJAbQQGVr5uERw==} - dependencies: - '@emotion/memoize': 0.8.1 - dev: true - - /@emotion/memoize@0.8.1: - resolution: {integrity: sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA==} - dev: true - - /@emotion/unitless@0.8.1: - resolution: {integrity: sha512-KOEGMu6dmJZtpadb476IsZBclKvILjopjUii3V+7MnXIQCYh8W3NgNcgwo21n9LXZX6EDIKvqfjYxXebDwxKmQ==} - dev: true - - /@types/stylis@4.2.4: - resolution: {integrity: sha512-36ZrGJ8fgtBr6nwNnuJ9jXIj+bn/pF6UoqmrQT7+Y99+tFFeHHsoR54+194dHdyhPjgbeoNz3Qru0oRt0l6ASQ==} - dev: true - - /asynckit@0.4.0: - resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} - dev: true - - /axios@1.6.2: - resolution: {integrity: sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A==} - dependencies: - follow-redirects: 1.15.3 - form-data: 4.0.0 - proxy-from-env: 1.1.0 - transitivePeerDependencies: - - debug - dev: true - - /camelize@1.0.1: - resolution: {integrity: sha512-dU+Tx2fsypxTgtLoE36npi3UqcjSSMNYfkqgmoEhtZrraP5VWq0K7FkWVTYa8eMPtnU/G2txVsfdCJTn9uzpuQ==} - dev: true - - /combined-stream@1.0.8: - resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} - engines: {node: '>= 0.8'} - dependencies: - delayed-stream: 1.0.0 - dev: true - - /css-color-keywords@1.0.0: - resolution: {integrity: sha512-FyyrDHZKEjXDpNJYvVsV960FiqQyXc/LlYmsxl2BcdMb2WPx0OGRVgTg55rPSyLSNMqP52R9r8geSp7apN3Ofg==} - engines: {node: '>=4'} - dev: true - - /css-to-react-native@3.2.0: - resolution: {integrity: sha512-e8RKaLXMOFii+02mOlqwjbD00KSEKqblnpO9e++1aXS1fPQOpS1YoqdVHBqPjHNoxeF2mimzVqawm2KCbEdtHQ==} - dependencies: - camelize: 1.0.1 - css-color-keywords: 1.0.0 - postcss-value-parser: 4.2.0 - dev: true - - /csstype@3.1.2: - resolution: {integrity: sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==} - dev: true - - /delayed-stream@1.0.0: - resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} - engines: {node: '>=0.4.0'} - dev: true - - /follow-redirects@1.15.3: - resolution: {integrity: sha512-1VzOtuEM8pC9SFU1E+8KfTjZyMztRsgEfwQl44z8A25uy13jSzTj6dyK2Df52iV0vgHCfBwLhDWevLn95w5v6Q==} - engines: {node: '>=4.0'} - peerDependencies: - debug: '*' - peerDependenciesMeta: - debug: - optional: true - dev: true - - /form-data@4.0.0: - resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==} - engines: {node: '>= 6'} - dependencies: - asynckit: 0.4.0 - combined-stream: 1.0.8 - mime-types: 2.1.35 - dev: true - - /js-tokens@4.0.0: - resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} - dev: true - - /loose-envify@1.4.0: - resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==} - hasBin: true - dependencies: - js-tokens: 4.0.0 - dev: true - - /mime-db@1.52.0: - resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} - engines: {node: '>= 0.6'} - dev: true - - /mime-types@2.1.35: - resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} - engines: {node: '>= 0.6'} - dependencies: - mime-db: 1.52.0 - dev: true - - /nanoid@3.3.7: - resolution: {integrity: sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==} - engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} - hasBin: true - dev: true - - /picocolors@1.0.0: - resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==} - dev: true - - /postcss-value-parser@4.2.0: - resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==} - dev: true - - /postcss@8.4.33: - resolution: {integrity: sha512-Kkpbhhdjw2qQs2O2DGX+8m5OVqEcbB9HRBvuYM9pgrjEFUg30A9LmXNlTAUj4S9kgtGyrMbTzVjH7E+s5Re2yg==} - engines: {node: ^10 || ^12 || >=14} - dependencies: - nanoid: 3.3.7 - picocolors: 1.0.0 - source-map-js: 1.0.2 - dev: true - - /proxy-from-env@1.1.0: - resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==} - dev: true - - /react-dom@18.2.0(react@18.2.0): - resolution: {integrity: sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==} - peerDependencies: - react: ^18.2.0 - dependencies: - loose-envify: 1.4.0 - react: 18.2.0 - scheduler: 0.23.0 - dev: true - - /react@18.2.0: - resolution: {integrity: sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==} - engines: {node: '>=0.10.0'} - dependencies: - loose-envify: 1.4.0 - dev: true - - /scheduler@0.23.0: - resolution: {integrity: sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw==} - dependencies: - loose-envify: 1.4.0 - dev: true - - /shallowequal@1.1.0: - resolution: {integrity: sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ==} - dev: true - - /source-map-js@1.0.2: - resolution: {integrity: sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==} - engines: {node: '>=0.10.0'} - dev: true - - /styled-components@6.1.1(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-cpZZP5RrKRIClBW5Eby4JM1wElLVP4NQrJbJ0h10TidTyJf4SIIwa3zLXOoPb4gJi8MsJ8mjq5mu2IrEhZIAcQ==} - engines: {node: '>= 16'} - peerDependencies: - react: '>= 16.8.0' - react-dom: '>= 16.8.0' - dependencies: - '@emotion/is-prop-valid': 1.2.1 - '@emotion/unitless': 0.8.1 - '@types/stylis': 4.2.4 - css-to-react-native: 3.2.0 - csstype: 3.1.2 - postcss: 8.4.33 - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - shallowequal: 1.1.0 - stylis: 4.3.0 - tslib: 2.6.2 - dev: true - - /stylis@4.3.0: - resolution: {integrity: sha512-E87pIogpwUsUwXw7dNyU4QDjdgVMy52m+XEOPEKUn161cCzWjjhPSQhByfd1CcNvrOLnXQ6OnnZDwnJrz/Z4YQ==} - dev: true - - /tslib@2.6.2: - resolution: {integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==} - dev: true diff --git a/fixtures/tsconfig/cases/builtins/thing.js b/fixtures/tsconfig/cases/builtins/thing.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/builtins/tsconfig.json b/fixtures/tsconfig/cases/builtins/tsconfig.json deleted file mode 100644 index 36aa1a4d..00000000 --- a/fixtures/tsconfig/cases/builtins/tsconfig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compilerOptions": { - "baseUrl": "." - } -} diff --git a/fixtures/tsconfig/cases/exports/index.js b/fixtures/tsconfig/cases/exports/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/exports/tsconfig.json b/fixtures/tsconfig/cases/exports/tsconfig.json deleted file mode 100644 index f0e3159b..00000000 --- a/fixtures/tsconfig/cases/exports/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-exports" -} diff --git a/fixtures/tsconfig/cases/extends-extension/base-tsconfig.json b/fixtures/tsconfig/cases/extends-extension/base-tsconfig.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/cases/extends-extension/base-tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/cases/extends-extension/foo.js b/fixtures/tsconfig/cases/extends-extension/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-extension/tsconfig.json b/fixtures/tsconfig/cases/extends-extension/tsconfig.json deleted file mode 100644 index 0ae4c6a3..00000000 --- a/fixtures/tsconfig/cases/extends-extension/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./base-tsconfig" -} diff --git a/fixtures/tsconfig/cases/extends-extensionless/foo.js b/fixtures/tsconfig/cases/extends-extensionless/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-extensionless/tsconfig.json b/fixtures/tsconfig/cases/extends-extensionless/tsconfig.json deleted file mode 100644 index c36cb7d4..00000000 --- a/fixtures/tsconfig/cases/extends-extensionless/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-field/conf" -} diff --git a/fixtures/tsconfig/cases/extends-multiple/foo.js b/fixtures/tsconfig/cases/extends-multiple/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-multiple/tsconfig.json b/fixtures/tsconfig/cases/extends-multiple/tsconfig.json deleted file mode 100644 index aa2ae783..00000000 --- a/fixtures/tsconfig/cases/extends-multiple/tsconfig.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": ["../extends-extension", "../extends-paths"], - "compilerOptions": { - "baseUrl": ".", - }, -} diff --git a/fixtures/tsconfig/cases/extends-not-found/index.js b/fixtures/tsconfig/cases/extends-not-found/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-not-found/tsconfig.json b/fixtures/tsconfig/cases/extends-not-found/tsconfig.json deleted file mode 100644 index 99df91da..00000000 --- a/fixtures/tsconfig/cases/extends-not-found/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./not-found" -} diff --git a/fixtures/tsconfig/cases/extends-paths/src/index.js b/fixtures/tsconfig/cases/extends-paths/src/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/extends-paths/tsconfig.base.json b/fixtures/tsconfig/cases/extends-paths/tsconfig.base.json deleted file mode 100644 index 5c64b067..00000000 --- a/fixtures/tsconfig/cases/extends-paths/tsconfig.base.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "@/*": ["./*"] - } - } -} diff --git a/fixtures/tsconfig/cases/extends-paths/tsconfig.json b/fixtures/tsconfig/cases/extends-paths/tsconfig.json deleted file mode 100644 index 51086018..00000000 --- a/fixtures/tsconfig/cases/extends-paths/tsconfig.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": "./tsconfig.base.json", - "compilerOptions": { - "baseUrl": "src", - }, -} diff --git a/fixtures/tsconfig/cases/field/index.js b/fixtures/tsconfig/cases/field/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/field/tsconfig.json b/fixtures/tsconfig/cases/field/tsconfig.json deleted file mode 100644 index 9f86c3f4..00000000 --- a/fixtures/tsconfig/cases/field/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-field" -} diff --git a/fixtures/tsconfig/cases/index/index.js b/fixtures/tsconfig/cases/index/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/index/tsconfig.json b/fixtures/tsconfig/cases/index/tsconfig.json deleted file mode 100644 index d20b1774..00000000 --- a/fixtures/tsconfig/cases/index/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig-index" -} diff --git a/fixtures/tsconfig/cases/paths_template_variable/foo.js b/fixtures/tsconfig/cases/paths_template_variable/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json b/fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json deleted file mode 100644 index a1a37bb6..00000000 --- a/fixtures/tsconfig/cases/paths_template_variable/tsconfig1.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "../../tsconfig_template_variable.json" -} diff --git a/fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json b/fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json deleted file mode 100644 index e7d8e5e5..00000000 --- a/fixtures/tsconfig/cases/paths_template_variable/tsconfig2.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "compilerOptions": { - "composite": true, - "paths": { - "foo": ["${configDir}/foo.js"] - } - } -} diff --git a/fixtures/tsconfig/cases/project_references/app/aliased/index.ts b/fixtures/tsconfig/cases/project_references/app/aliased/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/app/index.ts b/fixtures/tsconfig/cases/project_references/app/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/app/tsconfig.json b/fixtures/tsconfig/cases/project_references/app/tsconfig.json deleted file mode 100644 index 7036d2bb..00000000 --- a/fixtures/tsconfig/cases/project_references/app/tsconfig.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "extends": "../tsconfig.base.json", - "compilerOptions": { - "baseUrl": "./", - "paths": { - "@/*": ["./aliased/*"] - } - }, - "references": [ - { - "path": "../project_a/conf.json" - }, - { - "path": "../project_b" - }, - { - "path": "../project_c/tsconfig.json" - }, - { - "path": "../../paths_template_variable/tsconfig2.json" - } - ] -} diff --git a/fixtures/tsconfig/cases/project_references/project_a/aliased/index.ts b/fixtures/tsconfig/cases/project_references/project_a/aliased/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_a/conf.json b/fixtures/tsconfig/cases/project_references/project_a/conf.json deleted file mode 100644 index 4d389d7a..00000000 --- a/fixtures/tsconfig/cases/project_references/project_a/conf.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "compilerOptions": { - "composite": true, - "paths": { - "@/*": ["./aliased/*"] - } - } -} diff --git a/fixtures/tsconfig/cases/project_references/project_a/index.ts b/fixtures/tsconfig/cases/project_references/project_a/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_b/src/aliased/index.ts b/fixtures/tsconfig/cases/project_references/project_b/src/aliased/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_b/tsconfig.json b/fixtures/tsconfig/cases/project_references/project_b/tsconfig.json deleted file mode 100644 index 4ab05cd8..00000000 --- a/fixtures/tsconfig/cases/project_references/project_b/tsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "compilerOptions": { - "composite": true, - "baseUrl": "./src", - "paths": { - "@/*": ["./aliased/*"] - } - } -} diff --git a/fixtures/tsconfig/cases/project_references/project_c/index.ts b/fixtures/tsconfig/cases/project_references/project_c/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/project_references/project_c/tsconfig.json b/fixtures/tsconfig/cases/project_references/project_c/tsconfig.json deleted file mode 100644 index fe520939..00000000 --- a/fixtures/tsconfig/cases/project_references/project_c/tsconfig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compilerOptions": { - "composite": true - } -} diff --git a/fixtures/tsconfig/cases/project_references/tsconfig.base.json b/fixtures/tsconfig/cases/project_references/tsconfig.base.json deleted file mode 100644 index 88ccffe7..00000000 --- a/fixtures/tsconfig/cases/project_references/tsconfig.base.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "compilerOptions": { - } -} diff --git a/fixtures/tsconfig/cases/suffixes/a.ios.ts b/fixtures/tsconfig/cases/suffixes/a.ios.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/a.ts b/fixtures/tsconfig/cases/suffixes/a.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/b.ts b/fixtures/tsconfig/cases/suffixes/b.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/c-test.ts b/fixtures/tsconfig/cases/suffixes/c-test.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/suffixes/index.ts b/fixtures/tsconfig/cases/suffixes/index.ts deleted file mode 100644 index b09939b9..00000000 --- a/fixtures/tsconfig/cases/suffixes/index.ts +++ /dev/null @@ -1 +0,0 @@ -import './a'; diff --git a/fixtures/tsconfig/cases/suffixes/tsconfig.json b/fixtures/tsconfig/cases/suffixes/tsconfig.json deleted file mode 100644 index 4c2ccc8f..00000000 --- a/fixtures/tsconfig/cases/suffixes/tsconfig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compilerOptions": { - "moduleSuffixes": [".ios", "-test", ""] - } -} diff --git a/fixtures/tsconfig/cases/trailing-comma/bar.js b/fixtures/tsconfig/cases/trailing-comma/bar.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/trailing-comma/index.js b/fixtures/tsconfig/cases/trailing-comma/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/cases/trailing-comma/tsconfig.json b/fixtures/tsconfig/cases/trailing-comma/tsconfig.json deleted file mode 100644 index 6dc20ca5..00000000 --- a/fixtures/tsconfig/cases/trailing-comma/tsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "compilerOptions": { - "paths": { - /* some comment */ - "foo": ["bar.js"], - }, - }, - // another comment -} diff --git a/fixtures/tsconfig/foo.js b/fixtures/tsconfig/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/nested/index.js b/fixtures/tsconfig/nested/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/nested/test.js b/fixtures/tsconfig/nested/test.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/nested/tsconfig.json b/fixtures/tsconfig/nested/tsconfig.json deleted file mode 100644 index 6deb3011..00000000 --- a/fixtures/tsconfig/nested/tsconfig.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "extends": "..", - "compilerOptions": { - "paths": { - "ts-path": ["test.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-exports/conf.json b/fixtures/tsconfig/node_modules/tsconfig-exports/conf.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-exports/conf.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-exports/foo.js b/fixtures/tsconfig/node_modules/tsconfig-exports/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-exports/package.json b/fixtures/tsconfig/node_modules/tsconfig-exports/package.json deleted file mode 100644 index be0ddee6..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-exports/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "tsconfig-exports", - "private": true, - "exports": { - ".": "./conf.json" - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-field/conf.json b/fixtures/tsconfig/node_modules/tsconfig-field/conf.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-field/conf.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-field/foo.js b/fixtures/tsconfig/node_modules/tsconfig-field/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-field/package.json b/fixtures/tsconfig/node_modules/tsconfig-field/package.json deleted file mode 100644 index 7138fdde..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-field/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "tsconfig-field", - "private": true, - "tsconfig": "conf.json" -} \ No newline at end of file diff --git a/fixtures/tsconfig/node_modules/tsconfig-index/foo.js b/fixtures/tsconfig/node_modules/tsconfig-index/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-index/package.json b/fixtures/tsconfig/node_modules/tsconfig-index/package.json deleted file mode 100644 index eb2431e7..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-index/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "tsconfig-index", - "private": true -} \ No newline at end of file diff --git a/fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json b/fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json deleted file mode 100644 index 2923ba1d..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-index/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/node_modules/tsconfig-not-used/foo.js b/fixtures/tsconfig/node_modules/tsconfig-not-used/foo.js deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json b/fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json deleted file mode 100644 index eb16d127..00000000 --- a/fixtures/tsconfig/node_modules/tsconfig-not-used/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "ts-path": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/package.json b/fixtures/tsconfig/package.json deleted file mode 100755 index f48acd1c..00000000 --- a/fixtures/tsconfig/package.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "name": "resolver", - "private": true, - "alias": { - "aliased": "foo", - "aliased-file": "./bar.js", - "something": "./nested/test.js", - "aliasedfolder": "./nested", - "aliasedabsolute": "/nested", - "foo/bar": "./bar.js", - "glob/*/*": "./nested/$2", - "./baz": "./bar.js", - "url": false - }, - "imports": { - "#test": "./bar.js" - }, - "dependencies": { - "foo": "^0.3.4" - }, - "peerDependencies": { - "bar": "*" - } -} diff --git a/fixtures/tsconfig/tsconfig.json b/fixtures/tsconfig/tsconfig.json deleted file mode 100644 index eb16d127..00000000 --- a/fixtures/tsconfig/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "ts-path": ["foo.js"] - } - } -} diff --git a/fixtures/tsconfig/tsconfig_broken.json b/fixtures/tsconfig/tsconfig_broken.json deleted file mode 100644 index 98232c64..00000000 --- a/fixtures/tsconfig/tsconfig_broken.json +++ /dev/null @@ -1 +0,0 @@ -{ diff --git a/fixtures/tsconfig/tsconfig_template_variable.json b/fixtures/tsconfig/tsconfig_template_variable.json deleted file mode 100644 index 6f272344..00000000 --- a/fixtures/tsconfig/tsconfig_template_variable.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "paths": { - "foo": ["${configDir}/foo.js"] - } - } -} diff --git a/napi/__test__/resolver.spec.mjs b/napi/__test__/resolver.spec.mjs deleted file mode 100644 index ac6ee0ef..00000000 --- a/napi/__test__/resolver.spec.mjs +++ /dev/null @@ -1,260 +0,0 @@ -import { join } from 'node:path' -import { fileURLToPath } from 'node:url' - -import test from 'ava' - -let ResolverFactory - -if (process.env.WASI_TEST) { - const wasi = await import('../resolver.wasi.cjs') - ResolverFactory = wasi.ResolverFactory -} else { - const napi = await import('../index.js') - ResolverFactory = napi.ResolverFactory -} - -const currentDir = join(fileURLToPath(import.meta.url), '..') - -const enhancedResolveRoot = join( - currentDir, - '..', - '..', - 'fixtures', - 'enhanced_resolve', - 'test', - 'fixtures' -) - -// https://github.com/webpack/enhanced-resolve/blob/main/test/resolve.test.js - -for (const [title, context, request, expected] of [ - [ - 'absolute path', - enhancedResolveRoot, - join(enhancedResolveRoot, 'main1.js'), - join(enhancedResolveRoot, 'main1.js'), - ], - [ - 'file with .js', - enhancedResolveRoot, - './main1.js', - join(enhancedResolveRoot, 'main1.js'), - ], - [ - 'file without extension', - enhancedResolveRoot, - './main1', - join(enhancedResolveRoot, 'main1.js'), - ], - [ - 'another file with .js', - enhancedResolveRoot, - './a.js', - join(enhancedResolveRoot, 'a.js'), - ], - [ - 'another file without extension', - enhancedResolveRoot, - './a', - join(enhancedResolveRoot, 'a.js'), - ], - [ - 'file in module with .js', - enhancedResolveRoot, - 'm1/a.js', - join(enhancedResolveRoot, 'node_modules/m1/a.js'), - ], - [ - 'file in module without extension', - enhancedResolveRoot, - 'm1/a', - join(enhancedResolveRoot, 'node_modules/m1/a.js'), - ], - [ - 'another file in module without extension', - enhancedResolveRoot, - 'complexm/step1', - join(enhancedResolveRoot, 'node_modules/complexm/step1.js'), - ], - [ - 'from submodule to file in sibling module', - join(enhancedResolveRoot, 'node_modules/complexm'), - 'm2/b.js', - join(enhancedResolveRoot, 'node_modules/m2/b.js'), - ], - [ - 'from nested directory to overwritten file in module', - join(enhancedResolveRoot, 'multiple_modules'), - 'm1/a.js', - join(enhancedResolveRoot, 'multiple_modules/node_modules/m1/a.js'), - ], - [ - 'from nested directory to not overwritten file in module', - join(enhancedResolveRoot, 'multiple_modules'), - 'm1/b.js', - join(enhancedResolveRoot, 'node_modules/m1/b.js'), - ], - [ - 'file with query', - enhancedResolveRoot, - './main1.js?query', - join(enhancedResolveRoot, 'main1.js?query'), - ], - [ - 'file with fragment', - enhancedResolveRoot, - './main1.js#fragment', - join(enhancedResolveRoot, 'main1.js#fragment'), - ], - [ - 'file with fragment and query', - enhancedResolveRoot, - './main1.js#fragment?query', - join(enhancedResolveRoot, 'main1.js#fragment?query'), - ], - [ - 'file with query and fragment', - enhancedResolveRoot, - './main1.js?#fragment', - join(enhancedResolveRoot, 'main1.js?#fragment'), - ], - - [ - 'file with query (unicode)', - enhancedResolveRoot, - './测试.js?query', - join(enhancedResolveRoot, '测试.js?query'), - ], - [ - 'file with fragment (unicode)', - enhancedResolveRoot, - './测试.js#fragment', - join(enhancedResolveRoot, '测试.js#fragment'), - ], - [ - 'file with fragment and query (unicode)', - enhancedResolveRoot, - './测试.js#fragment?query', - join(enhancedResolveRoot, '测试.js#fragment?query'), - ], - [ - 'file with query and fragment (unicode)', - enhancedResolveRoot, - './测试.js?#fragment', - join(enhancedResolveRoot, '测试.js?#fragment'), - ], - - [ - 'file in module with query', - enhancedResolveRoot, - 'm1/a?query', - join(enhancedResolveRoot, 'node_modules/m1/a.js?query'), - ], - [ - 'file in module with fragment', - enhancedResolveRoot, - 'm1/a#fragment', - join(enhancedResolveRoot, 'node_modules/m1/a.js#fragment'), - ], - [ - 'file in module with fragment and query', - enhancedResolveRoot, - 'm1/a#fragment?query', - join(enhancedResolveRoot, 'node_modules/m1/a.js#fragment?query'), - ], - [ - 'file in module with query and fragment', - enhancedResolveRoot, - 'm1/a?#fragment', - join(enhancedResolveRoot, 'node_modules/m1/a.js?#fragment'), - ], - [ - 'differ between directory and file, resolve file', - enhancedResolveRoot, - './dirOrFile', - join(enhancedResolveRoot, 'dirOrFile.js'), - ], - [ - 'differ between directory and file, resolve directory', - enhancedResolveRoot, - './dirOrFile/', - join(enhancedResolveRoot, 'dirOrFile/index.js'), - ], - [ - 'find node_modules outside of node_modules', - join(enhancedResolveRoot, 'browser-module/node_modules'), - 'm1/a', - join(enhancedResolveRoot, 'node_modules/m1/a.js'), - ], - [ - "don't crash on main field pointing to self", - enhancedResolveRoot, - './main-field-self', - join(enhancedResolveRoot, './main-field-self/index.js'), - ], - [ - "don't crash on main field pointing to self (2)", - enhancedResolveRoot, - './main-field-self2', - join(enhancedResolveRoot, './main-field-self2/index.js'), - ], - // enhanced-resolve has `#` prepended with a `\0`, they are removed from the - // following 3 expected test results. - // See https://github.com/webpack/enhanced-resolve#escaping - [ - 'handle fragment edge case (no fragment)', - enhancedResolveRoot, - './no#fragment/#/#', - join(enhancedResolveRoot, 'no#fragment', '#', '#.js'), - ], - [ - 'handle fragment edge case (fragment)', - enhancedResolveRoot, - './no#fragment/#/', - join(enhancedResolveRoot, 'no.js#fragment') + '/#/', - ], - [ - 'handle fragment escaping', - enhancedResolveRoot, - './no\0#fragment/\0#/\0##fragment', - join(enhancedResolveRoot, 'no#fragment', '#', '#.js#fragment'), - ], -]) { - test(title, (t) => { - const resolver = new ResolverFactory({ - modules: ['src/a', 'src/b', 'src/common', 'node_modules'], - extensions: ['.js', '.jsx', '.ts', '.tsx'], - }) - - t.is(resolver.sync(context, request).path, expected) - }) -} - -test('resolve pnpm package', (t) => { - const rootDir = join(currentDir, '..', '..'); - const pnpmProjectPath = join(rootDir, 'fixtures', 'pnpm') - const resolver = new ResolverFactory({ - aliasFields: ['browser'], - }) - t.deepEqual(resolver.sync(pnpmProjectPath, 'styled-components'), { - path: join( - rootDir, - 'node_modules/.pnpm/styled-components@6.1.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/styled-components/dist/styled-components.browser.cjs.js' - ), - }) - t.deepEqual( - resolver.sync( - join( - rootDir, - 'node_modules/.pnpm/styled-components@6.1.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/styled-components' - ), - 'react' - ), - { - path: join( - rootDir, - 'node_modules/.pnpm/react@18.3.1/node_modules/react/index.js' - ), - } - ) -}) diff --git a/napi/src/lib.rs b/napi/src/lib.rs deleted file mode 100644 index 7cd839c5..00000000 --- a/napi/src/lib.rs +++ /dev/null @@ -1,214 +0,0 @@ -extern crate napi; -extern crate napi_derive; -extern crate oxc_resolver; - -use std::{ - path::{Path, PathBuf}, - sync::Arc, -}; - -use napi::{bindgen_prelude::AsyncTask, Task}; -use napi_derive::napi; -use oxc_resolver::{ResolveOptions, Resolver}; - -use self::{ - options::{NapiResolveOptions, StrOrStrList}, - tracing::init_tracing, -}; - -mod options; -mod tracing; - -#[napi(object)] -pub struct ResolveResult { - pub path: Option, - pub error: Option, - /// "type" field in the package.json file - pub module_type: Option, -} - -fn resolve(resolver: &Resolver, path: &Path, request: &str) -> ResolveResult { - match resolver.resolve(path, request) { - Ok(resolution) => ResolveResult { - path: Some(resolution.full_path().to_string_lossy().to_string()), - error: None, - module_type: resolution - .package_json() - .and_then(|p| p.r#type.as_ref()) - .and_then(|t| t.as_str()) - .map(|t| t.to_string()), - }, - Err(err) => ResolveResult { path: None, module_type: None, error: Some(err.to_string()) }, - } -} - -#[allow(clippy::needless_pass_by_value)] -#[napi] -pub fn sync(path: String, request: String) -> ResolveResult { - let path = PathBuf::from(path); - let resolver = Resolver::new(ResolveOptions::default()); - resolve(&resolver, &path, &request) -} - -pub struct ResolveTask { - resolver: Arc, - directory: PathBuf, - request: String, -} - -#[napi] -impl Task for ResolveTask { - type Output = ResolveResult; - type JsValue = ResolveResult; - - fn compute(&mut self) -> napi::Result { - Ok(resolve(&self.resolver, &self.directory, &self.request)) - } - - fn resolve(&mut self, _: napi::Env, result: Self::Output) -> napi::Result { - Ok(result) - } -} - -#[napi] -pub struct ResolverFactory { - resolver: Arc, -} - -#[napi] -impl ResolverFactory { - #[napi(constructor)] - pub fn new(options: NapiResolveOptions) -> Self { - init_tracing(); - Self { resolver: Arc::new(Resolver::new(Self::normalize_options(options))) } - } - - #[napi] - pub fn default() -> Self { - let default_options = ResolveOptions::default(); - Self { resolver: Arc::new(Resolver::new(default_options)) } - } - - /// Clone the resolver using the same underlying cache. - #[napi] - pub fn clone_with_options(&self, options: NapiResolveOptions) -> Self { - Self { - resolver: Arc::new(self.resolver.clone_with_options(Self::normalize_options(options))), - } - } - - /// Clear the underlying cache. - #[napi] - pub fn clear_cache(&self) { - self.resolver.clear_cache(); - } - - /// Synchronously resolve `specifier` at an absolute path to a `directory`. - #[allow(clippy::needless_pass_by_value)] - #[napi] - pub fn sync(&self, directory: String, request: String) -> ResolveResult { - let path = PathBuf::from(directory); - resolve(&self.resolver, &path, &request) - } - - /// Asynchronously resolve `specifier` at an absolute path to a `directory`. - #[allow(clippy::needless_pass_by_value)] - #[napi(js_name = "async")] - pub fn resolve_async(&self, directory: String, request: String) -> AsyncTask { - let path = PathBuf::from(directory); - let resolver = self.resolver.clone(); - AsyncTask::new(ResolveTask { resolver, directory: path, request }) - } - - fn normalize_options(op: NapiResolveOptions) -> ResolveOptions { - let default = ResolveOptions::default(); - // merging options - ResolveOptions { - tsconfig: op.tsconfig.map(|tsconfig| tsconfig.into()), - alias: op - .alias - .map(|alias| { - alias - .into_iter() - .map(|(k, v)| { - let v = v - .into_iter() - .map(|item| match item { - Some(path) => oxc_resolver::AliasValue::from(path), - None => oxc_resolver::AliasValue::Ignore, - }) - .collect(); - (k, v) - }) - .collect::>() - }) - .unwrap_or(default.alias), - alias_fields: op - .alias_fields - .map(|o| o.into_iter().map(|x| StrOrStrList(x).into()).collect::>()) - .unwrap_or(default.alias_fields), - condition_names: op.condition_names.unwrap_or(default.condition_names), - description_files: op.description_files.unwrap_or(default.description_files), - enforce_extension: op - .enforce_extension - .map(|enforce_extension| enforce_extension.into()) - .unwrap_or(default.enforce_extension), - exports_fields: op - .exports_fields - .map(|o| o.into_iter().map(|x| StrOrStrList(x).into()).collect::>()) - .unwrap_or(default.exports_fields), - imports_fields: op - .imports_fields - .map(|o| o.into_iter().map(|x| StrOrStrList(x).into()).collect::>()) - .unwrap_or(default.imports_fields), - extension_alias: op - .extension_alias - .map(|extension_alias| extension_alias.into_iter().collect::>()) - .unwrap_or(default.extension_alias), - extensions: op.extensions.unwrap_or(default.extensions), - fallback: op - .fallback - .map(|fallback| { - fallback - .into_iter() - .map(|(k, v)| { - let v = v - .into_iter() - .map(|item| match item { - Some(path) => oxc_resolver::AliasValue::from(path), - None => oxc_resolver::AliasValue::Ignore, - }) - .collect(); - (k, v) - }) - .collect::>() - }) - .unwrap_or(default.fallback), - fully_specified: op.fully_specified.unwrap_or(default.fully_specified), - main_fields: op - .main_fields - .map(|o| StrOrStrList(o).into()) - .unwrap_or(default.main_fields), - main_files: op.main_files.unwrap_or(default.main_files), - modules: op.modules.map(|o| StrOrStrList(o).into()).unwrap_or(default.modules), - resolve_to_context: op.resolve_to_context.unwrap_or(default.resolve_to_context), - prefer_relative: op.prefer_relative.unwrap_or(default.prefer_relative), - prefer_absolute: op.prefer_absolute.unwrap_or(default.prefer_absolute), - restrictions: op - .restrictions - .map(|restrictions| { - restrictions - .into_iter() - .map(|restriction| restriction.into()) - .collect::>() - }) - .unwrap_or(default.restrictions), - roots: op - .roots - .map(|roots| roots.into_iter().map(PathBuf::from).collect::>()) - .unwrap_or(default.roots), - symlinks: op.symlinks.unwrap_or(default.symlinks), - builtin_modules: op.builtin_modules.unwrap_or(default.builtin_modules), - } - } -} diff --git a/napi/src/options.rs b/napi/src/options.rs deleted file mode 100644 index ea35672f..00000000 --- a/napi/src/options.rs +++ /dev/null @@ -1,261 +0,0 @@ -use std::path::PathBuf; - -use napi::Either; -use napi_derive::napi; -use std::collections::HashMap; - -/// Module Resolution Options -/// -/// Options are directly ported from [enhanced-resolve](https://github.com/webpack/enhanced-resolve#resolver-options). -/// -/// See [webpack resolve](https://webpack.js.org/configuration/resolve/) for information and examples -#[derive(Debug, Clone)] -#[napi(object)] -pub struct NapiResolveOptions { - /// Path to TypeScript configuration file. - /// - /// Default `None` - pub tsconfig: Option, - - /// Alias for [ResolveOptions::alias] and [ResolveOptions::fallback]. - /// - /// For the second value of the tuple, `None -> AliasValue::Ignore`, Some(String) -> - /// AliasValue::Path(String)` - /// Create aliases to import or require certain modules more easily. - /// A trailing $ can also be added to the given object's keys to signify an exact match. - pub alias: Option>>>, - - /// A list of alias fields in description files. - /// Specify a field, such as `browser`, to be parsed according to [this specification](https://github.com/defunctzombie/package-browser-field-spec). - /// Can be a path to json object such as `["path", "to", "exports"]`. - /// - /// Default `[]` - #[napi(ts_type = "(string | string[])[]")] - pub alias_fields: Option>, - - /// Condition names for exports field which defines entry points of a package. - /// The key order in the exports field is significant. During condition matching, earlier entries have higher priority and take precedence over later entries. - /// - /// Default `[]` - pub condition_names: Option>, - - /// The JSON files to use for descriptions. (There was once a `bower.json`.) - /// - /// Default `["package.json"]` - pub description_files: Option>, - - /// If true, it will not allow extension-less files. - /// So by default `require('./foo')` works if `./foo` has a `.js` extension, - /// but with this enabled only `require('./foo.js')` will work. - /// - /// Default to `true` when [ResolveOptions::extensions] contains an empty string. - /// Use `Some(false)` to disable the behavior. - /// See - /// - /// Default None, which is the same as `Some(false)` when the above empty rule is not applied. - pub enforce_extension: Option, - - /// A list of exports fields in description files. - /// Can be a path to json object such as `["path", "to", "exports"]`. - /// - /// Default `[["exports"]]`. - #[napi(ts_type = "(string | string[])[]")] - pub exports_fields: Option>, - - /// Fields from `package.json` which are used to provide the internal requests of a package - /// (requests starting with # are considered internal). - /// - /// Can be a path to a JSON object such as `["path", "to", "imports"]`. - /// - /// Default `[["imports"]]`. - #[napi(ts_type = "(string | string[])[]")] - pub imports_fields: Option>, - - /// An object which maps extension to extension aliases. - /// - /// Default `{}` - pub extension_alias: Option>>, - - /// Attempt to resolve these extensions in order. - /// If multiple files share the same name but have different extensions, - /// will resolve the one with the extension listed first in the array and skip the rest. - /// - /// Default `[".js", ".json", ".node"]` - pub extensions: Option>, - - /// Redirect module requests when normal resolving fails. - /// - /// Default `[]` - pub fallback: Option>>>, - - /// 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). - /// - /// See also webpack configuration [resolve.fullySpecified](https://webpack.js.org/configuration/module/#resolvefullyspecified) - /// - /// Default `false` - pub fully_specified: Option, - - /// A list of main fields in description files - /// - /// Default `["main"]`. - #[napi(ts_type = "string | string[]")] - pub main_fields: Option, - - /// The filename to be used while resolving directories. - /// - /// Default `["index"]` - pub main_files: Option>, - - /// A list of directories to resolve modules from, can be absolute path or folder name. - /// - /// Default `["node_modules"]` - #[napi(ts_type = "string | string[]")] - pub modules: Option, - - /// Resolve to a context instead of a file. - /// - /// Default `false` - pub resolve_to_context: Option, - - /// Prefer to resolve module requests as relative requests instead of using modules from node_modules directories. - /// - /// Default `false` - pub prefer_relative: Option, - - /// Prefer to resolve server-relative urls as absolute paths before falling back to resolve in ResolveOptions::roots. - /// - /// Default `false` - pub prefer_absolute: Option, - - /// A list of resolve restrictions to restrict the paths that a request can be resolved on. - /// - /// Default `[]` - pub restrictions: Option>, - - /// A list of directories where requests of server-relative URLs (starting with '/') are resolved. - /// On non-Windows systems these requests are resolved as an absolute path first. - /// - /// Default `[]` - pub roots: Option>, - - /// Whether to resolve symlinks to their symlinked location. - /// When enabled, symlinked resources are resolved to their real path, not their symlinked location. - /// Note that this may cause module resolution to fail when using tools that symlink packages (like npm link). - /// - /// Default `true` - pub symlinks: Option, - - /// Whether to parse [module.builtinModules](https://nodejs.org/api/module.html#modulebuiltinmodules) or not. - /// For example, "zlib" will throw [crate::ResolveError::Builtin] when set to true. - /// - /// Default `false` - pub builtin_modules: Option, -} - -#[napi] -#[derive(Debug, PartialEq, Eq)] -pub enum EnforceExtension { - Auto, - Enabled, - Disabled, -} - -impl EnforceExtension { - pub fn is_auto(&self) -> bool { - *self == Self::Auto - } - - pub fn is_enabled(&self) -> bool { - *self == Self::Enabled - } - - pub fn is_disabled(&self) -> bool { - *self == Self::Disabled - } -} - -/// Alias Value for [ResolveOptions::alias] and [ResolveOptions::fallback]. -/// Use struct because napi don't support structured union now -#[napi(object)] -#[derive(Debug, Clone)] -pub struct Restriction { - pub path: Option, - pub regex: Option, -} - -/// Tsconfig Options -/// -/// Derived from [tsconfig-paths-webpack-plugin](https://github.com/dividab/tsconfig-paths-webpack-plugin#options) -#[napi(object)] -#[derive(Debug, Clone)] -pub struct TsconfigOptions { - /// Allows you to specify where to find the TypeScript configuration file. - /// You may provide - /// * a relative path to the configuration file. It will be resolved relative to cwd. - /// * an absolute path to the configuration file. - pub config_file: String, - - /// Support for Typescript Project References. - /// - /// * `'auto'`: use the `references` field from tsconfig of `config_file`. - /// * `string[]`: manually provided relative or absolute path. - #[napi(ts_type = "'auto' | string[]")] - pub references: Option>>, -} - -impl Into for Restriction { - fn into(self) -> oxc_resolver::Restriction { - match (self.path, self.regex) { - (None, None) => { - panic!("Should specify path or regex") - } - (None, Some(regex)) => oxc_resolver::Restriction::RegExp(regex), - (Some(path), None) => oxc_resolver::Restriction::Path(PathBuf::from(path)), - (Some(_), Some(_)) => { - panic!("Restriction can't be path and regex at the same time") - } - } - } -} - -impl Into for EnforceExtension { - fn into(self) -> oxc_resolver::EnforceExtension { - match self { - EnforceExtension::Auto => oxc_resolver::EnforceExtension::Auto, - EnforceExtension::Enabled => oxc_resolver::EnforceExtension::Enabled, - EnforceExtension::Disabled => oxc_resolver::EnforceExtension::Disabled, - } - } -} - -impl Into for TsconfigOptions { - fn into(self) -> oxc_resolver::TsconfigOptions { - oxc_resolver::TsconfigOptions { - config_file: PathBuf::from(self.config_file), - references: match self.references { - Some(Either::A(string)) if string.as_str() == "auto" => { - oxc_resolver::TsconfigReferences::Auto - } - Some(Either::A(opt)) => { - panic!("`{}` is not a valid option for tsconfig references", opt) - } - Some(Either::B(paths)) => oxc_resolver::TsconfigReferences::Paths( - paths.into_iter().map(PathBuf::from).collect::>(), - ), - None => oxc_resolver::TsconfigReferences::Disabled, - }, - } - } -} - -type StrOrStrListType = Either>; -pub struct StrOrStrList(pub StrOrStrListType); - -impl Into> for StrOrStrList { - fn into(self) -> Vec { - match self { - StrOrStrList(Either::A(s)) => Vec::from([s]), - StrOrStrList(Either::B(a)) => a, - } - } -} diff --git a/napi/src/tracing.rs b/napi/src/tracing.rs deleted file mode 100644 index 88e4cd7e..00000000 --- a/napi/src/tracing.rs +++ /dev/null @@ -1,25 +0,0 @@ -use std::sync::OnceLock; - -use tracing_subscriber::filter::Targets; -use tracing_subscriber::prelude::__tracing_subscriber_SubscriberExt; -use tracing_subscriber::util::SubscriberInitExt; - -/// To debug `oxc_resolver`: -/// `OXC_LOG=DEBUG your program` -pub fn init_tracing() { - static TRACING: OnceLock<()> = OnceLock::new(); - TRACING.get_or_init(|| { - // Usage without the `regex` feature. - // - tracing_subscriber::registry() - .with(std::env::var("OXC_LOG").map_or_else( - |_| Targets::new(), - |env_var| { - use std::str::FromStr; - Targets::from_str(&env_var).unwrap() - }, - )) - .with(tracing_subscriber::fmt::layer()) - .init(); - }); -} diff --git a/napi/tests/options.test.mjs b/napi/tests/options.test.mjs deleted file mode 100644 index 4a93efff..00000000 --- a/napi/tests/options.test.mjs +++ /dev/null @@ -1,59 +0,0 @@ -import { describe, it } from "node:test"; -import { ResolverFactory } from "../index.js"; -import * as assert from "node:assert"; -import * as path from "node:path"; - -const fixtureDir = new URL( - "../../fixtures/enhanced_resolve/test/fixtures", - import.meta.url -).pathname; - -describe("option", () => { - describe("aliasFields", () => { - it("should allow field string ", () => { - const resolver = new ResolverFactory({ aliasFields: ["browser"] }); - assert.match( - resolver.sync(fixtureDir, "./browser-module/lib/replaced.js").path, - /browser-module\/lib\/browser\.js$/ - ); - }); - it("should allow json path array", () => { - const resolver = new ResolverFactory({ - aliasFields: [["innerBrowser1", "field", "browser"]], - }); - - assert.match( - resolver.sync(fixtureDir, "./browser-module/lib/main1.js").path, - /browser-module\/lib\/main\.js$/ - ); - }); - }); - - describe("exportsFields", () => { - const createTest = (exportsFields) => { - const resolver = new ResolverFactory({ exportsFields }); - assert.match( - resolver.sync( - path.resolve(fixtureDir, "./exports-field3"), - "exports-field" - ).path, - /\/exports-field\/src\/index\.js$/ - ); - }; - it("should allow string as field item", createTest(["broken"])); - it("should allow json path array as field item", createTest([["broken"]])); - }); - - describe("mainFields", () => { - const createTest = (mainFields) => { - const resolver = new ResolverFactory({ mainFields }); - assert.match( - resolver.sync(fixtureDir, "../..").path, - /\/lib\/index\.js$/ - ); - }; - it("should use `'main'` as default", createTest(undefined)); - it("should allow field string", createTest("main")); - it("should allow field array", createTest(["main"])); - }); -}); diff --git a/npm/package.json b/npm/package.json index 85422809..7136edb8 100644 --- a/npm/package.json +++ b/npm/package.json @@ -1,47 +1,36 @@ { - "name": "oxc-resolver", - "version": "1.11.0", - "description": "Oxc Resolver Node API", - "main": "index.js", - "browser": "browser.js", - "files": [ - "index.d.ts", - "index.js", - "browser.js" - ], - "license": "MIT", - "homepage": "https://oxc.rs", - "repository": { - "type": "git", - "url": "git+https://github.com/oxc-project/oxc-resolver.git" - }, - "publishConfig": { - "registry": "https://registry.npmjs.org/", - "access": "public" - }, - "napi": { - "binaryName": "resolver", - "packageName": "@oxc-resolver/binding", - "wasm": { - "browser": { - "fs": true - } - }, - "targets": [ - "x86_64-pc-windows-msvc", - "aarch64-pc-windows-msvc", - "x86_64-unknown-linux-gnu", - "x86_64-unknown-linux-musl", - "x86_64-unknown-freebsd", - "aarch64-unknown-linux-gnu", - "aarch64-unknown-linux-musl", - "armv7-unknown-linux-gnueabihf", - "x86_64-apple-darwin", - "aarch64-apple-darwin", - "wasm32-wasip1-threads" - ] - }, - "funding": { - "url": "https://github.com/sponsors/Boshen" - } + "browser": "browser.js", + "description": "Oxc Resolver Node API", + "files": [ + "index.d.ts", + "index.js", + "browser.js" + ], + "funding": { + "url": "https://github.com/sponsors/Boshen" + }, + "main": "index.js", + "name": "oxc-resolver", + "napi": { + "binaryName": "resolver", + "packageName": "@oxc-resolver/binding", + "targets": [ + "x86_64-pc-windows-msvc", + "aarch64-pc-windows-msvc", + "x86_64-unknown-linux-gnu", + "x86_64-unknown-linux-musl", + "x86_64-unknown-freebsd", + "aarch64-unknown-linux-gnu", + "aarch64-unknown-linux-musl", + "armv7-unknown-linux-gnueabihf", + "x86_64-apple-darwin", + "aarch64-apple-darwin", + "wasm32-wasip1-threads" + ], + "wasm": { + "browser": { + "fs": true + } + } + } } diff --git a/package.json b/package.json index 909b5b56..d0ee7633 100644 --- a/package.json +++ b/package.json @@ -1,33 +1,24 @@ { - "name": "@oxc-resolver/binding", - "private": true, - "version": "0.0.0", - "scripts": { - "build": "napi build --platform --release --package-json-path npm/package.json --manifest-path napi/Cargo.toml", - "build:debug": "napi build --platform --package-json-path npm/package.json --manifest-path napi/Cargo.toml", - "prepublishOnly": "napi pre-publish -t npm", - "test": "ava" - }, - "devDependencies": { - "@napi-rs/cli": "3.0.0-alpha.62", - "@napi-rs/wasm-runtime": "^0.2.4", - "@types/node": "^22.0.0", - "ava": "^6.1.3", - "emnapi": "^1.2.0", - "typescript": "^5.5.3" - }, - "ava": { - "files": [ - "napi/__test__/*.spec.mjs" - ], - "cache": false - }, - "packageManager": "pnpm@9.10.0", - "repository": { - "type": "git", - "url": "git+https://github.com/oxc-project/oxc-resolver.git" - }, - "funding": { - "url": "https://github.com/sponsors/Boshen" - } + "ava": { + "cache": false, + "files": [ + "napi/__test__/*.spec.mjs" + ] + }, + "devDependencies": { + "@napi-rs/cli": "3.0.0-alpha.62", + "@napi-rs/wasm-runtime": "^0.2.4", + "@types/node": "^22.0.0", + "ava": "^6.1.3", + "emnapi": "^1.2.0" + }, + "funding": { + "url": "https://github.com/sponsors/Boshen" + }, + "name": "@oxc-resolver/binding", + "scripts": { + "build": "napi build --platform --release --package-json-path npm/package.json --manifest-path napi/Cargo.toml", + "build:debug": "napi build --platform --package-json-path npm/package.json --manifest-path napi/Cargo.toml", + "prepublishOnly": "napi pre-publish -t npm" + } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml deleted file mode 100644 index 009f7a91..00000000 --- a/pnpm-lock.yaml +++ /dev/null @@ -1,2598 +0,0 @@ -lockfileVersion: '9.0' - -settings: - autoInstallPeers: true - excludeLinksFromLockfile: false - -importers: - - .: - devDependencies: - '@napi-rs/cli': - specifier: 3.0.0-alpha.62 - version: 3.0.0-alpha.62(@emnapi/runtime@1.2.0)(emnapi@1.2.0) - '@napi-rs/wasm-runtime': - specifier: ^0.2.4 - version: 0.2.4 - '@types/node': - specifier: ^22.0.0 - version: 22.5.5 - ava: - specifier: ^6.1.3 - version: 6.1.3 - emnapi: - specifier: ^1.2.0 - version: 1.2.0 - typescript: - specifier: ^5.5.3 - version: 5.6.2 - - fixtures/pnpm: - devDependencies: - axios: - specifier: 1.6.2 - version: 1.6.2 - ipaddr.js: - specifier: 2.2.0 - version: 2.2.0 - postcss: - specifier: 8.4.33 - version: 8.4.33 - styled-components: - specifier: 6.1.1 - version: 6.1.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - - npm: {} - -packages: - - '@emnapi/core@1.2.0': - resolution: {integrity: sha512-E7Vgw78I93we4ZWdYCb4DGAwRROGkMIXk7/y87UmANR+J6qsWusmC3gLt0H+O0KOt5e6O38U8oJamgbudrES/w==} - - '@emnapi/runtime@1.2.0': - resolution: {integrity: sha512-bV21/9LQmcQeCPEg3BDFtvwL6cwiTMksYNWQQ4KOxCZikEGalWtenoZ0wCiukJINlGCIi2KXx01g4FoH/LxpzQ==} - - '@emnapi/wasi-threads@1.0.1': - resolution: {integrity: sha512-iIBu7mwkq4UQGeMEM8bLwNK962nXdhodeScX4slfQnRhEMMzvYivHhutCIk8uojvmASXXPC2WNEjwxFWk72Oqw==} - - '@emotion/is-prop-valid@1.2.2': - resolution: {integrity: sha512-uNsoYd37AFmaCdXlg6EYD1KaPOaRWRByMCYzbKUX4+hhMfrxdVSelShywL4JVaAeM/eHUOSprYBQls+/neX3pw==} - - '@emotion/memoize@0.8.1': - resolution: {integrity: sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA==} - - '@emotion/unitless@0.8.1': - resolution: {integrity: sha512-KOEGMu6dmJZtpadb476IsZBclKvILjopjUii3V+7MnXIQCYh8W3NgNcgwo21n9LXZX6EDIKvqfjYxXebDwxKmQ==} - - '@inquirer/checkbox@2.3.10': - resolution: {integrity: sha512-CTc864M2/523rKc9AglIzAcUCuPXDZENgc5S2KZFVRbnMzpXcYTsUWmbqSeL0XLvtlvEtNevkkVbfVhJpruOyQ==} - engines: {node: '>=18'} - - '@inquirer/confirm@3.1.14': - resolution: {integrity: sha512-nbLSX37b2dGPtKWL3rPuR/5hOuD30S+pqJ/MuFiUEgN6GiMs8UMxiurKAMDzKt6C95ltjupa8zH6+3csXNHWpA==} - engines: {node: '>=18'} - - '@inquirer/core@9.0.2': - resolution: {integrity: sha512-nguvH3TZar3ACwbytZrraRTzGqyxJfYJwv+ZwqZNatAosdWQMP1GV8zvmkNlBe2JeZSaw0WYBHZk52pDpWC9qA==} - engines: {node: '>=18'} - - '@inquirer/editor@2.1.14': - resolution: {integrity: sha512-6nWpoJyVAKwAcv67bkbBmmi3f32xua79fP7TRmNUoR4K+B1GiOBsHO1YdvET/jvC+nTlBZL7puKAKyM7G+Lkzw==} - engines: {node: '>=18'} - - '@inquirer/expand@2.1.14': - resolution: {integrity: sha512-JcxsLajwPykF2kq6biIUdoOzTQ3LXqb8XMVrWkCprG/pFeU1SsxcSSFbF1T5jJGvvlTVcsE+JdGjbQ8ZRZ82RA==} - engines: {node: '>=18'} - - '@inquirer/figures@1.0.3': - resolution: {integrity: sha512-ErXXzENMH5pJt5/ssXV0DfWUZqly8nGzf0UcBV9xTnP+KyffE2mqyxIMBrZ8ijQck2nU0TQm40EQB53YreyWHw==} - engines: {node: '>=18'} - - '@inquirer/input@2.2.1': - resolution: {integrity: sha512-Yl1G6h7qWydzrJwqN777geeJVaAFL5Ly83aZlw4xHf8Z/BoTMfKRheyuMaQwOG7LQ4e5nQP7PxXdEg4SzQ+OKw==} - engines: {node: '>=18'} - - '@inquirer/number@1.0.2': - resolution: {integrity: sha512-GcoK+Phxcln0Qw9e73S5a8B2Ejg3HgSTvNfDegIcS5/BKwUm8t5rejja1l09WXjZM9vrVbRDf9RzWtSUiWVYRQ==} - engines: {node: '>=18'} - - '@inquirer/password@2.1.14': - resolution: {integrity: sha512-sPzOkXLhWJQ96K6nPZFnF8XB8tsDrcCRobd1d3EDz81F+4hp8BbdmsnsQcqZ7oYDIOVM/mWJyIUtJ35TrssJxQ==} - engines: {node: '>=18'} - - '@inquirer/prompts@5.1.2': - resolution: {integrity: sha512-E+ndnfwtVQtcmPt888Hc/HAxJUHSaA6OIvyvLAQ5BLQv+t20GbYdFSjXeLgb47OpMU+aRsKA/ys+Zoylw3kTVg==} - engines: {node: '>=18'} - - '@inquirer/rawlist@2.1.14': - resolution: {integrity: sha512-pLpEzhKNQ/ugFAFfgCNaXljB+dcCwmXwR1jOxAbVeFIdB3l02E5gjI+h1rb136tq0T8JO6P5KFR1oTeld/wdrA==} - engines: {node: '>=18'} - - '@inquirer/select@2.3.10': - resolution: {integrity: sha512-rr7iR0Zj1YFfgM8IUGimPD9Yukd+n/U63CnYT9kdum6DbRXtMxR45rrreP+EA9ixCnShr+W4xj7suRxC1+8t9g==} - engines: {node: '>=18'} - - '@inquirer/type@1.4.0': - resolution: {integrity: sha512-AjOqykVyjdJQvtfkNDGUyMYGF8xN50VUxftCQWsOyIo4DFRLr6VQhW0VItGI1JIyQGCGgIpKa7hMMwNhZb4OIw==} - engines: {node: '>=18'} - - '@mapbox/node-pre-gyp@1.0.11': - resolution: {integrity: sha512-Yhlar6v9WQgUp/He7BdgzOz8lqMQ8sU+jkCq7Wx8Myc5YFJLbEe7lgui/V7G1qB1DJykHSGwreceSaD60Y0PUQ==} - hasBin: true - - '@napi-rs/cli@3.0.0-alpha.62': - resolution: {integrity: sha512-IDUwHAEJZ9ad/s5oyhznrz5ZDcU+SJ6GdP5nb++Wx5MkS4FD9MeS3HfNZdsxkf10pOUPnmvCVFuG4xnLBQYmjw==} - engines: {node: '>= 16'} - hasBin: true - peerDependencies: - '@emnapi/runtime': ^1.1.0 - emnapi: ^1.1.0 - peerDependenciesMeta: - '@emnapi/runtime': - optional: true - emnapi: - optional: true - - '@napi-rs/cross-toolchain@0.0.16': - resolution: {integrity: sha512-jwdjHT5L0m9MH0CmzDwPp0ckn/UO7afHCsPeo7NugHUvYgvlgS7SWhdMVgIgJW2HHqhcW/2nhaLLGpAU1c7QRQ==} - peerDependencies: - '@napi-rs/cross-toolchain-arm64-target-aarch64': ^0.0.16 - '@napi-rs/cross-toolchain-arm64-target-armv7': ^0.0.16 - '@napi-rs/cross-toolchain-arm64-target-x86_64': ^0.0.16 - '@napi-rs/cross-toolchain-x64-target-aarch64': ^0.0.16 - '@napi-rs/cross-toolchain-x64-target-armv7': ^0.0.16 - '@napi-rs/cross-toolchain-x64-target-x86_64': ^0.0.16 - peerDependenciesMeta: - '@napi-rs/cross-toolchain-arm64-target-aarch64': - optional: true - '@napi-rs/cross-toolchain-arm64-target-armv7': - optional: true - '@napi-rs/cross-toolchain-arm64-target-x86_64': - optional: true - '@napi-rs/cross-toolchain-x64-target-aarch64': - optional: true - '@napi-rs/cross-toolchain-x64-target-armv7': - optional: true - '@napi-rs/cross-toolchain-x64-target-x86_64': - optional: true - - '@napi-rs/lzma-android-arm-eabi@1.3.1': - resolution: {integrity: sha512-mtGOg8jXlc+pTBI86cqohfndS9UmOAkk9d5CChKMb8btVks70yhUN1e7YYS3QFbmoxbPs2Ee+wmuH1Khdc7B2w==} - engines: {node: '>= 10'} - cpu: [arm] - os: [android] - - '@napi-rs/lzma-android-arm64@1.3.1': - resolution: {integrity: sha512-4uGkQgAv9Tnc/i0k2eIgbhZgyzs94+iECWxz4MFZNcZ1fNGvGbRL2j+SITE4OmwrUn3TuFK/uYWfgzooq8E1Qg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [android] - - '@napi-rs/lzma-darwin-arm64@1.3.1': - resolution: {integrity: sha512-MZBg4iwHTS8icjTiCMdzh8kYrMmKBCEglFPa+vjI91R2XDwuuwSzqmpATRpmMH8cWUUWtGPF4fnxKzjgkzhd4Q==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [darwin] - - '@napi-rs/lzma-darwin-x64@1.3.1': - resolution: {integrity: sha512-7vte+1lYV7xgZERKH/pjAeh4T16aQASKOzu4op70pK6VP/64Plr5rrvqxQqQmlAIe4pwyo/RkFl1n4LXDod3xg==} - engines: {node: '>= 10'} - cpu: [x64] - os: [darwin] - - '@napi-rs/lzma-freebsd-x64@1.3.1': - resolution: {integrity: sha512-uBS74fynTqLUC3catIxyezCafn8UDlr2yxVV47vz1T6Vop2PGDz/cMQdV6rnLSjPE08Rv66ihM36mgf/MmOkOg==} - engines: {node: '>= 10'} - cpu: [x64] - os: [freebsd] - - '@napi-rs/lzma-linux-arm-gnueabihf@1.3.1': - resolution: {integrity: sha512-rrVLyqBJeN29gPJCNkPbZ7dAzaseEcERKyhjwM+DfbFrDUvtkEcrYPvo+iwE/NmF+OkZQkzcanrVMGnq/mcJYQ==} - engines: {node: '>= 10'} - cpu: [arm] - os: [linux] - - '@napi-rs/lzma-linux-arm64-gnu@1.3.1': - resolution: {integrity: sha512-vDmVsthRbX2opkgRirJJGKQxUP/spvyVM2Y5CyCWZ7sadSID3hA97r38gf9ISn/sJ8/r93IPWLq+iycudNKi+Q==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/lzma-linux-arm64-musl@1.3.1': - resolution: {integrity: sha512-x4m/J3hRdFd3IoqKc+4aBcSUkcuDEP7hH6vdss8bKNLjPfXmnG/lcHJEQX3hNnNOULPP8xVRxgiY8jeL62cnsw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/lzma-linux-x64-gnu@1.3.1': - resolution: {integrity: sha512-riB+Xg72NfH8Kcpq07omshVu0QsLW0v2bhywBNYxvA+t2dGGWSIEN1U/zazUXys+IEA6pBQKqLVseurWE6Cl8g==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/lzma-linux-x64-musl@1.3.1': - resolution: {integrity: sha512-JXLgJFwoeysxdSg7rdVYP8wrliCQVJlU5JcLYjRVSCL4P0mQTjnYi7R7VdaOkDACw/Fvlji7oIJXt0KiaDTcOw==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/lzma-wasm32-wasi@1.3.1': - resolution: {integrity: sha512-XTA9XTUtj0KPKuzNS2oi3bWN6tJodk00wwMd/TiKoEqx9Fe/zu+OfDGuXAn+xs+P7S3YCDHqjYinuTQMZ0ucJw==} - engines: {node: '>=14.0.0'} - cpu: [wasm32] - - '@napi-rs/lzma-win32-arm64-msvc@1.3.1': - resolution: {integrity: sha512-qLDfs9UEtLPPTN/FdSz3gSdlx86VwFQBuLBrQtaiYQtUTKZCOYV1Z1fXqFt5Zqa1HKV2oyXnwGcTI7RpcyXxtg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [win32] - - '@napi-rs/lzma-win32-ia32-msvc@1.3.1': - resolution: {integrity: sha512-rWNlxLFMIfvxzfdQCfeQ3D/HEnQG3vfladFYrXUx6ePXO6r+BLCGn6/LWSSuKlw4vKkb1iHEWsAVaRLIcJEMIA==} - engines: {node: '>= 10'} - cpu: [ia32] - os: [win32] - - '@napi-rs/lzma-win32-x64-msvc@1.3.1': - resolution: {integrity: sha512-SNfHNqEjabXfTL1+KRi0qiAhwIlZHhQystvfSYX6p1g+2trSC/3WUpUQ4fbbR7KyE31g2AAnwjXivnlQ0af/pg==} - engines: {node: '>= 10'} - cpu: [x64] - os: [win32] - - '@napi-rs/lzma@1.3.1': - resolution: {integrity: sha512-XyZoBlYNMvCulK/RmVK/0nB3j7IdH7HpqcrMMg0U+HqQqKRLOQBwvnKNBocPC1bZQ7iZuKWYTLn1ayZwTyek8w==} - engines: {node: '>= 10'} - - '@napi-rs/tar-android-arm-eabi@0.1.1': - resolution: {integrity: sha512-Ufa0ahZvE5KGrC2WBux5svCe/jvC+e8IgtleiicwqnfgTfbDknYyq/QuqkP1AnMp/IvTmx2iutCZt6OFIG0zAg==} - engines: {node: '>= 10'} - cpu: [arm] - os: [android] - - '@napi-rs/tar-android-arm64@0.1.1': - resolution: {integrity: sha512-KUu5fHIiIObSuZ/crHxUrQ243+LiCRKPwdCVLHwjtftqFjzls+R2Mp6GrpM41XxexDMN00SUta3kazi93Xr19A==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [android] - - '@napi-rs/tar-darwin-arm64@0.1.1': - resolution: {integrity: sha512-jaqgdX20iIga+2gzotQ78eF00Cm8vECocUYeMY62WqyzJNv/jx1dlOfELWEccOjpmawFT9tjWebsS9F1QMvSUg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [darwin] - - '@napi-rs/tar-darwin-x64@0.1.1': - resolution: {integrity: sha512-80sa32IxfRso9x9sGTFpfLSx3BnruyJODpSkUzalOCz9i14n5gOKA8KR/JrnSWwDz0p5l5P9kfQD3pu8Voj7WA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [darwin] - - '@napi-rs/tar-freebsd-x64@0.1.1': - resolution: {integrity: sha512-P7V1zBjjC1dCrTwtUzuzYM4AeZduigeCtd8qQw2IUZowM5AsmhMd77oYuXjdU29cEpKUpyYjJRxjPCzFy+WbAQ==} - engines: {node: '>= 10'} - cpu: [x64] - os: [freebsd] - - '@napi-rs/tar-linux-arm-gnueabihf@0.1.1': - resolution: {integrity: sha512-qpC71ILPkWKt8k1iJCYt5gjwcOkd2VFSQIelTRr12t5CVNKV04rE/TMdwFoCP7kxbtb9Fl2cZzCRISw2BhMCmQ==} - engines: {node: '>= 10'} - cpu: [arm] - os: [linux] - - '@napi-rs/tar-linux-arm64-gnu@0.1.1': - resolution: {integrity: sha512-71QgxcFJCog6O4Tauoge8D0ILkDGJTRk3ru7zG8PUFG1QXJ1kkiRikdT77YmoVxtomc9FUOt+bdEdU5Yn+3QUQ==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/tar-linux-arm64-musl@0.1.1': - resolution: {integrity: sha512-R2e7YEILPKc447N1hUt1zQuyy0st83HX6nhmtFywS1aOj76/3hzxLVrebGiiS6kifyCrO82o66CNTYe7DixMZw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/tar-linux-x64-gnu@0.1.1': - resolution: {integrity: sha512-tmy9q2LXUB2GQ+IgUzJn3+us52leplMu96ORyFq1iHQEelGSqXt4xi5DzU07JhX3obJPqVqkybtcRS4enBfmBA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/tar-linux-x64-musl@0.1.1': - resolution: {integrity: sha512-j5ePbe6vihApl0cGPPDUVTWZbf2mF4NhxngAoG2jp7AeX3cWP2O4pjsvaOraW6QfvWEMFPeER7S0b6eBS7duvA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/tar-wasm32-wasi@0.1.1': - resolution: {integrity: sha512-se0+DlOiIRt7mcz7BeOJDoZtCrROpKLwiAOGmNgrjQ/SZS7TnOPuwm3wy9XN9WLoepttEjCEem6UP8yD5GJuQg==} - engines: {node: '>=14.0.0'} - cpu: [wasm32] - - '@napi-rs/tar-win32-arm64-msvc@0.1.1': - resolution: {integrity: sha512-FDZPi2wC7RwzvodogigLh/pJvhqCTVTUqOYuHlLkPSUbSAGiEkI55wk9RqH3y3EdJQaDuzyqC0QKz5ket2U+GA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [win32] - - '@napi-rs/tar-win32-ia32-msvc@0.1.1': - resolution: {integrity: sha512-OPR9Tou5z5M912G7Kc7gkf1ltinbOQx5dS/OeDIWHvPGOfdFDIxt0YVKhzSLRJi43+zIDp8/+cbeMD/cKXfX8w==} - engines: {node: '>= 10'} - cpu: [ia32] - os: [win32] - - '@napi-rs/tar-win32-x64-msvc@0.1.1': - resolution: {integrity: sha512-hiv5KfhrMSg8tTRC2oQXVckVg1h6ZVjwbd5aF9Esl0V3p2TaNFwwbqgnAN4Gm/PmSnHWNL/IRTHkk3cOzDWihQ==} - engines: {node: '>= 10'} - cpu: [x64] - os: [win32] - - '@napi-rs/tar@0.1.1': - resolution: {integrity: sha512-FOMhwwlvoYjHaDBxP26K3D92ltw1Y/CC4CIjgC6qXdzW4MYNwTlEyI58smCM3k+nCVJH3kpOYyH3sgbK4WZA4A==} - engines: {node: '>= 10'} - - '@napi-rs/wasm-runtime@0.2.4': - resolution: {integrity: sha512-9zESzOO5aDByvhIAsOy9TbpZ0Ur2AJbUI7UT73kcUTS2mxAMHOBaa1st/jAymNoCtvrit99kkzT1FZuXVcgfIQ==} - - '@napi-rs/wasm-tools-android-arm-eabi@0.0.2': - resolution: {integrity: sha512-/b+UU3suXjW4P0DzHRNdrnebQtFKcQf/YMeZJH+xUlKgvwli5kbmWjx8Wqqz0VETVkUTuPqJMBDIVLyc+14FGw==} - engines: {node: '>= 10'} - cpu: [arm] - os: [android] - - '@napi-rs/wasm-tools-android-arm64@0.0.2': - resolution: {integrity: sha512-j57GbDflwJdZtT8pZj5fOV4JAP+LdKN+wzsUYs+QRUoBqpWbbUANudolqfw63bkS9sD4z7fbCuz8iwtJqzxTVA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [android] - - '@napi-rs/wasm-tools-darwin-arm64@0.0.2': - resolution: {integrity: sha512-P2ChgWgVuv9GwmbxN89R84KzIImoTqXINteEixUvmkdnhyFiR+I8deNs89Yed+5w8QLC6MEfrtRqLP9YI+NoQA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [darwin] - - '@napi-rs/wasm-tools-darwin-x64@0.0.2': - resolution: {integrity: sha512-T/kQQ0gt8+wau1Z821PKVAD76QhmwVoLs2CT7Z9tTBs2pJvwSCP0C/kQiQAHcJIMi7A2E9Ab/Mez0BERy50EFA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [darwin] - - '@napi-rs/wasm-tools-freebsd-x64@0.0.2': - resolution: {integrity: sha512-GnnHu+r5sfzuxC/1J5UMF/h3BOZnHb3NQZ5hmbCfZYCKzpzRxrAJhzRunlbRN+v0x8M/49dztVTYR3s7K4ooAw==} - engines: {node: '>= 10'} - cpu: [x64] - os: [freebsd] - - '@napi-rs/wasm-tools-linux-arm64-gnu@0.0.2': - resolution: {integrity: sha512-KnZdLT0OnKb1CG2kdt3/WvM43vr9i+FEwXCvSOVC/6Tsifz7ynhMg7LAVESILd03HubzQJfg9nbRsk0bQ+IOwg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/wasm-tools-linux-arm64-musl@0.0.2': - resolution: {integrity: sha512-HkpZOID2U8P6pWqK3mqZ8bxU5xcuT3iA2fO+jrxn78h006iYgfNmdc5JaVhHnHazMmk32xKhSV4iV0VUh8UWDg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - '@napi-rs/wasm-tools-linux-x64-gnu@0.0.2': - resolution: {integrity: sha512-YksJWBCyOalB9ogtP9+/dZKP+vR6+h7BmzMXaXMT71WW/GvIsifMVgv+DY/FRSNJQupp5Y+ugjqVAOUOc/G65g==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/wasm-tools-linux-x64-musl@0.0.2': - resolution: {integrity: sha512-sPtRxPMdw05KdTcxgSPMmSXG2+PiK3vJ/l2+g9hvjnnKtvslJN2Hr7j8zgzuoKRAUFPaJVe6+D2xVh5cpdqhww==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - '@napi-rs/wasm-tools-wasm32-wasi@0.0.2': - resolution: {integrity: sha512-muRvZK7AIuo88G2AxYx3gA59rHMQgoN004saQkBvXnz3K/DVHKfTZ6TtUebss8zI3dURU6xExL8drxFWYxjEbQ==} - engines: {node: '>=14.0.0'} - cpu: [wasm32] - - '@napi-rs/wasm-tools-win32-arm64-msvc@0.0.2': - resolution: {integrity: sha512-Cn13WQ+tpFqdVwx0DIWKbsI9auFyzVZV4F5UNOUeDt6GgOL+NndgJul0Pc9bSU6fi03AylMPfF/nTCaDWO2Wgw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [win32] - - '@napi-rs/wasm-tools-win32-ia32-msvc@0.0.2': - resolution: {integrity: sha512-xsg5DkIQi82a8rcx6246Y3XC8TIqHamY+/C6sIlPLaZEuHctDkMECAw0AANwRf5vN//D2oo2oljOuoYtB1GOKw==} - engines: {node: '>= 10'} - cpu: [ia32] - os: [win32] - - '@napi-rs/wasm-tools-win32-x64-msvc@0.0.2': - resolution: {integrity: sha512-yHigltEt33eq8bappvKsIliz4MxfMPn1M+NWbIFRWN+IS1Z57mhmc1osuk+IRXrSlq0Tom0R6MYN1jpkZKz81Q==} - engines: {node: '>= 10'} - cpu: [x64] - os: [win32] - - '@napi-rs/wasm-tools@0.0.2': - resolution: {integrity: sha512-kBvDQCP5BLw2TxTENXLp3Of7vVEx0uyIye824JHE4dduzzOHVgSoOFVhVqAT3Fx/hLV445RVWfEqQbXMg4w/Mw==} - engines: {node: '>= 10'} - - '@nodelib/fs.scandir@2.1.5': - resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} - engines: {node: '>= 8'} - - '@nodelib/fs.stat@2.0.5': - resolution: {integrity: sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==} - engines: {node: '>= 8'} - - '@nodelib/fs.walk@1.2.8': - resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} - engines: {node: '>= 8'} - - '@octokit/auth-token@5.1.1': - resolution: {integrity: sha512-rh3G3wDO8J9wSjfI436JUKzHIxq8NaiL0tVeB2aXmG6p/9859aUOAjA9pmSPNGGZxfwmaJ9ozOJImuNVJdpvbA==} - engines: {node: '>= 18'} - - '@octokit/core@6.1.2': - resolution: {integrity: sha512-hEb7Ma4cGJGEUNOAVmyfdB/3WirWMg5hDuNFVejGEDFqupeOysLc2sG6HJxY2etBp5YQu5Wtxwi020jS9xlUwg==} - engines: {node: '>= 18'} - - '@octokit/endpoint@10.1.1': - resolution: {integrity: sha512-JYjh5rMOwXMJyUpj028cu0Gbp7qe/ihxfJMLc8VZBMMqSwLgOxDI1911gV4Enl1QSavAQNJcwmwBF9M0VvLh6Q==} - engines: {node: '>= 18'} - - '@octokit/graphql@8.1.1': - resolution: {integrity: sha512-ukiRmuHTi6ebQx/HFRCXKbDlOh/7xEV6QUXaE7MJEKGNAncGI/STSbOkl12qVXZrfZdpXctx5O9X1AIaebiDBg==} - engines: {node: '>= 18'} - - '@octokit/openapi-types@22.2.0': - resolution: {integrity: sha512-QBhVjcUa9W7Wwhm6DBFu6ZZ+1/t/oYxqc2tp81Pi41YNuJinbFRx8B133qVOrAaBbF7D/m0Et6f9/pZt9Rc+tg==} - - '@octokit/plugin-paginate-rest@11.3.3': - resolution: {integrity: sha512-o4WRoOJZlKqEEgj+i9CpcmnByvtzoUYC6I8PD2SA95M+BJ2x8h7oLcVOg9qcowWXBOdcTRsMZiwvM3EyLm9AfA==} - engines: {node: '>= 18'} - peerDependencies: - '@octokit/core': '>=6' - - '@octokit/plugin-request-log@5.3.0': - resolution: {integrity: sha512-FiGcyjdtYPlr03ExBk/0ysIlEFIFGJQAVoPPMxL19B24bVSEiZQnVGBunNtaAF1YnvE/EFoDpXmITtRnyCiypQ==} - engines: {node: '>= 18'} - peerDependencies: - '@octokit/core': '>=6' - - '@octokit/plugin-rest-endpoint-methods@13.2.4': - resolution: {integrity: sha512-gusyAVgTrPiuXOdfqOySMDztQHv6928PQ3E4dqVGEtOvRXAKRbJR4b1zQyniIT9waqaWk/UDaoJ2dyPr7Bk7Iw==} - engines: {node: '>= 18'} - peerDependencies: - '@octokit/core': '>=6' - - '@octokit/request-error@6.1.2': - resolution: {integrity: sha512-sA0oF7aL5wXbNfl+7zgLYJiFZctei9GaIMJlTraJrlQyFaoIYr4MCqPSakzxxGCfm8fET4vn0cQdRFmD7avlDg==} - engines: {node: '>= 18'} - - '@octokit/request@9.1.1': - resolution: {integrity: sha512-pyAguc0p+f+GbQho0uNetNQMmLG1e80WjkIaqqgUkihqUp0boRU6nKItXO4VWnr+nbZiLGEyy4TeKRwqaLvYgw==} - engines: {node: '>= 18'} - - '@octokit/rest@21.0.0': - resolution: {integrity: sha512-XudXXOmiIjivdjNZ+fN71NLrnDM00sxSZlhqmPR3v0dVoJwyP628tSlc12xqn8nX3N0965583RBw5GPo6r8u4Q==} - engines: {node: '>= 18'} - - '@octokit/types@13.5.0': - resolution: {integrity: sha512-HdqWTf5Z3qwDVlzCrP8UJquMwunpDiMPt5er+QjGzL4hqr/vBVY/MauQgS1xWxCDT1oMx1EULyqxncdCY/NVSQ==} - - '@rollup/pluginutils@4.2.1': - resolution: {integrity: sha512-iKnFXr7NkdZAIHiIWE+BX5ULi/ucVFYWD6TbAV+rZctiRTY2PL6tsIKhoIOaoskiWAkgu+VsbXgUVDNLHf+InQ==} - engines: {node: '>= 8.0.0'} - - '@sindresorhus/merge-streams@2.3.0': - resolution: {integrity: sha512-LtoMMhxAlorcGhmFYI+LhPgbPZCkgP6ra1YL604EeF6U98pLlQ3iWIGMdWSC+vWmPBWBNgmDBAhnAobLROJmwg==} - engines: {node: '>=18'} - - '@tybys/wasm-util@0.9.0': - resolution: {integrity: sha512-6+7nlbMVX/PVDCwaIQ8nTOPveOcFLSt8GcXdx8hD0bt39uWxYT88uXzqTd4fTvqta7oeUJqudepapKNt2DYJFw==} - - '@types/mute-stream@0.0.4': - resolution: {integrity: sha512-CPM9nzrCPPJHQNA9keH9CVkVI+WR5kMa+7XEs5jcGQ0VoAGnLv242w8lIVgwAEfmE4oufJRaTc9PNLQl0ioAow==} - - '@types/node@20.16.5': - resolution: {integrity: sha512-VwYCweNo3ERajwy0IUlqqcyZ8/A7Zwa9ZP3MnENWcB11AejO+tLy3pu850goUW2FC/IJMdZUfKpX/yxL1gymCA==} - - '@types/node@22.5.5': - resolution: {integrity: sha512-Xjs4y5UPO/CLdzpgR6GirZJx36yScjh73+2NlLlkFRSoQN8B0DpfXPdZGnvVmLRLOsqDpOfTNv7D9trgGhmOIA==} - - '@types/stylis@4.2.6': - resolution: {integrity: sha512-4nebF2ZJGzQk0ka0O6+FZUWceyFv4vWq/0dXBMmrSeAwzOuOd/GxE5Pa64d/ndeNLG73dXoBsRzvtsVsYUv6Uw==} - - '@types/wrap-ansi@3.0.0': - resolution: {integrity: sha512-ltIpx+kM7g/MLRZfkbL7EsCEjfzCcScLpkg37eXEtx5kmrAKBkTJwd1GIAjDSL8wTpM6Hzn5YO4pSb91BEwu1g==} - - '@vercel/nft@0.26.5': - resolution: {integrity: sha512-NHxohEqad6Ra/r4lGknO52uc/GrWILXAMs1BB4401GTqww0fw1bAqzpG1XHuDO+dprg4GvsD9ZLLSsdo78p9hQ==} - engines: {node: '>=16'} - hasBin: true - - abbrev@1.1.1: - resolution: {integrity: sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==} - - acorn-import-attributes@1.9.5: - resolution: {integrity: sha512-n02Vykv5uA3eHGM/Z2dQrcD56kL8TyDb2p1+0P83PClMnC/nc+anbQRhIOWnSq4Ke/KvDPrY3C9hDtC/A3eHnQ==} - peerDependencies: - acorn: ^8 - - acorn-walk@8.3.3: - resolution: {integrity: sha512-MxXdReSRhGO7VlFe1bRG/oI7/mdLV9B9JJT0N8vZOhF7gFRR5l3M8W9G8JxmKV+JC5mGqJ0QvqfSOLsCPa4nUw==} - engines: {node: '>=0.4.0'} - - acorn@8.12.1: - resolution: {integrity: sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg==} - engines: {node: '>=0.4.0'} - hasBin: true - - agent-base@6.0.2: - resolution: {integrity: sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==} - engines: {node: '>= 6.0.0'} - - ansi-escapes@4.3.2: - resolution: {integrity: sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==} - engines: {node: '>=8'} - - ansi-regex@5.0.1: - resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} - engines: {node: '>=8'} - - ansi-regex@6.0.1: - resolution: {integrity: sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==} - engines: {node: '>=12'} - - ansi-styles@4.3.0: - resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} - engines: {node: '>=8'} - - ansi-styles@6.2.1: - resolution: {integrity: sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==} - engines: {node: '>=12'} - - aproba@2.0.0: - resolution: {integrity: sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==} - - are-we-there-yet@2.0.0: - resolution: {integrity: sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw==} - engines: {node: '>=10'} - deprecated: This package is no longer supported. - - argparse@1.0.10: - resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==} - - argparse@2.0.1: - resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} - - array-find-index@1.0.2: - resolution: {integrity: sha512-M1HQyIXcBGtVywBt8WVdim+lrNaK7VHp99Qt5pSNziXznKHViIBbXWtfRTpEFpF/c4FdfxNAsCCwPp5phBYJtw==} - engines: {node: '>=0.10.0'} - - arrgv@1.0.2: - resolution: {integrity: sha512-a4eg4yhp7mmruZDQFqVMlxNRFGi/i1r87pt8SDHy0/I8PqSXoUTlWZRdAZo0VXgvEARcujbtTk8kiZRi1uDGRw==} - engines: {node: '>=8.0.0'} - - arrify@3.0.0: - resolution: {integrity: sha512-tLkvA81vQG/XqE2mjDkGQHoOINtMHtysSnemrmoGe6PydDPMRbVugqyk4A6V/WDWEfm3l+0d8anA9r8cv/5Jaw==} - engines: {node: '>=12'} - - async-sema@3.1.1: - resolution: {integrity: sha512-tLRNUXati5MFePdAk8dw7Qt7DpxPB60ofAgn8WRhW6a2rcimZnYBP9oxHiv0OHy+Wz7kPMG+t4LGdt31+4EmGg==} - - asynckit@0.4.0: - resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} - - ava@6.1.3: - resolution: {integrity: sha512-tkKbpF1pIiC+q09wNU9OfyTDYZa8yuWvU2up3+lFJ3lr1RmnYh2GBpPwzYUEB0wvTPIUysGjcZLNZr7STDviRA==} - engines: {node: ^18.18 || ^20.8 || ^21 || ^22} - hasBin: true - peerDependencies: - '@ava/typescript': '*' - peerDependenciesMeta: - '@ava/typescript': - optional: true - - axios@1.6.2: - resolution: {integrity: sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A==} - - balanced-match@1.0.2: - resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} - - before-after-hook@3.0.2: - resolution: {integrity: sha512-Nik3Sc0ncrMK4UUdXQmAnRtzmNQTAAXmXIopizwZ1W1t8QmfJj+zL4OA2I7XPTPW5z5TDqv4hRo/JzouDJnX3A==} - - bindings@1.5.0: - resolution: {integrity: sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==} - - blueimp-md5@2.19.0: - resolution: {integrity: sha512-DRQrD6gJyy8FbiE4s+bDoXS9hiW3Vbx5uCdwvcCf3zLHL+Iv7LtGHLpr+GZV8rHG8tK766FGYBwRbu8pELTt+w==} - - brace-expansion@1.1.11: - resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} - - braces@3.0.3: - resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==} - engines: {node: '>=8'} - - callsites@4.2.0: - resolution: {integrity: sha512-kfzR4zzQtAE9PC7CzZsjl3aBNbXWuXiSeOCdLcPpBfGW8YuCqQHcRPFDbr/BPVmd3EEPVpuFzLyuT/cUhPr4OQ==} - engines: {node: '>=12.20'} - - camelize@1.0.1: - resolution: {integrity: sha512-dU+Tx2fsypxTgtLoE36npi3UqcjSSMNYfkqgmoEhtZrraP5VWq0K7FkWVTYa8eMPtnU/G2txVsfdCJTn9uzpuQ==} - - cbor@9.0.2: - resolution: {integrity: sha512-JPypkxsB10s9QOWwa6zwPzqE1Md3vqpPc+cai4sAecuCsRyAtAl/pMyhPlMbT/xtPnm2dznJZYRLui57qiRhaQ==} - engines: {node: '>=16'} - - chalk@5.3.0: - resolution: {integrity: sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==} - engines: {node: ^12.17.0 || ^14.13 || >=16.0.0} - - chardet@0.7.0: - resolution: {integrity: sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==} - - chownr@2.0.0: - resolution: {integrity: sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==} - engines: {node: '>=10'} - - chunkd@2.0.1: - resolution: {integrity: sha512-7d58XsFmOq0j6el67Ug9mHf9ELUXsQXYJBkyxhH/k+6Ke0qXRnv0kbemx+Twc6fRJ07C49lcbdgm9FL1Ei/6SQ==} - - ci-info@4.0.0: - resolution: {integrity: sha512-TdHqgGf9odd8SXNuxtUBVx8Nv+qZOejE6qyqiy5NtbYYQOeFa6zmHkxlPzmaLxWWHsU6nJmB7AETdVPi+2NBUg==} - engines: {node: '>=8'} - - ci-parallel-vars@1.0.1: - resolution: {integrity: sha512-uvzpYrpmidaoxvIQHM+rKSrigjOe9feHYbw4uOI2gdfe1C3xIlxO+kVXq83WQWNniTf8bAxVpy+cQeFQsMERKg==} - - cli-spinners@2.9.2: - resolution: {integrity: sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==} - engines: {node: '>=6'} - - cli-truncate@4.0.0: - resolution: {integrity: sha512-nPdaFdQ0h/GEigbPClz11D0v/ZJEwxmeVZGeMo3Z5StPtUTkA9o1lD6QwoirYiSDzbcwn2XcjwmCp68W1IS4TA==} - engines: {node: '>=18'} - - cli-width@4.1.0: - resolution: {integrity: sha512-ouuZd4/dm2Sw5Gmqy6bGyNNNe1qt9RpmxveLSO7KcgsTnU7RXfsw+/bukWGo1abgBiMAic068rclZsO4IWmmxQ==} - engines: {node: '>= 12'} - - clipanion@3.2.1: - resolution: {integrity: sha512-dYFdjLb7y1ajfxQopN05mylEpK9ZX0sO1/RfMXdfmwjlIsPkbh4p7A682x++zFPLDCo1x3p82dtljHf5cW2LKA==} - peerDependencies: - typanion: '*' - - cliui@8.0.1: - resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==} - engines: {node: '>=12'} - - code-excerpt@4.0.0: - resolution: {integrity: sha512-xxodCmBen3iy2i0WtAK8FlFNrRzjUqjRsMfho58xT/wvZU1YTM3fCnRjcy1gJPMepaRlgm/0e6w8SpWHpn3/cA==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - color-convert@2.0.1: - resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} - engines: {node: '>=7.0.0'} - - color-name@1.1.4: - resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} - - color-support@1.1.3: - resolution: {integrity: sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==} - hasBin: true - - colorette@2.0.20: - resolution: {integrity: sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==} - - combined-stream@1.0.8: - resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} - engines: {node: '>= 0.8'} - - common-path-prefix@3.0.0: - resolution: {integrity: sha512-QE33hToZseCH3jS0qN96O/bSh3kaw/h+Tq7ngyY9eWDUnTlTNUyqfqvCXioLe5Na5jFsL78ra/wuBU4iuEgd4w==} - - concat-map@0.0.1: - resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} - - concordance@5.0.4: - resolution: {integrity: sha512-OAcsnTEYu1ARJqWVGwf4zh4JDfHZEaSNlNccFmt8YjB2l/n19/PF2viLINHc57vO4FKIAFl2FWASIGZZWZ2Kxw==} - engines: {node: '>=10.18.0 <11 || >=12.14.0 <13 || >=14'} - - console-control-strings@1.1.0: - resolution: {integrity: sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==} - - convert-to-spaces@2.0.1: - resolution: {integrity: sha512-rcQ1bsQO9799wq24uE5AM2tAILy4gXGIK/njFWcVQkGNZ96edlpY+A7bjwvzjYvLDyzmG1MmMLZhpcsb+klNMQ==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - css-color-keywords@1.0.0: - resolution: {integrity: sha512-FyyrDHZKEjXDpNJYvVsV960FiqQyXc/LlYmsxl2BcdMb2WPx0OGRVgTg55rPSyLSNMqP52R9r8geSp7apN3Ofg==} - engines: {node: '>=4'} - - css-to-react-native@3.2.0: - resolution: {integrity: sha512-e8RKaLXMOFii+02mOlqwjbD00KSEKqblnpO9e++1aXS1fPQOpS1YoqdVHBqPjHNoxeF2mimzVqawm2KCbEdtHQ==} - - csstype@3.1.3: - resolution: {integrity: sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==} - - currently-unhandled@0.4.1: - resolution: {integrity: sha512-/fITjgjGU50vjQ4FH6eUoYu+iUoUKIXws2hL15JJpIR+BbTxaXQsMuuyjtNh2WqsSBS5nsaZHFsFecyw5CCAng==} - engines: {node: '>=0.10.0'} - - date-time@3.1.0: - resolution: {integrity: sha512-uqCUKXE5q1PNBXjPqvwhwJf9SwMoAHBgWJ6DcrnS5o+W2JOiIILl0JEdVD8SGujrNS02GGxgwAg2PN2zONgtjg==} - engines: {node: '>=6'} - - debug@4.3.5: - resolution: {integrity: sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg==} - engines: {node: '>=6.0'} - peerDependencies: - supports-color: '*' - peerDependenciesMeta: - supports-color: - optional: true - - delayed-stream@1.0.0: - resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} - engines: {node: '>=0.4.0'} - - delegates@1.0.0: - resolution: {integrity: sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==} - - detect-libc@2.0.3: - resolution: {integrity: sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw==} - engines: {node: '>=8'} - - emittery@1.0.3: - resolution: {integrity: sha512-tJdCJitoy2lrC2ldJcqN4vkqJ00lT+tOWNT1hBJjO/3FDMJa5TTIiYGCKGkn/WfCyOzUMObeohbVTj00fhiLiA==} - engines: {node: '>=14.16'} - - emnapi@1.2.0: - resolution: {integrity: sha512-rcq+dJCcfr08I0XM/57LPRqaUokGfni/+SvhO7NaJthTTjRdohhIy0FQwyC5rR1enAsjkldQg83th8J5hURv0Q==} - peerDependencies: - node-addon-api: '>= 6.1.0' - peerDependenciesMeta: - node-addon-api: - optional: true - - emoji-regex@10.3.0: - resolution: {integrity: sha512-QpLs9D9v9kArv4lfDEgg1X/gN5XLnf/A6l9cs8SPZLRZR3ZkY9+kwIQTxm+fsSej5UMYGE8fdoaZVIBlqG0XTw==} - - emoji-regex@8.0.0: - resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} - - escalade@3.1.2: - resolution: {integrity: sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==} - engines: {node: '>=6'} - - escape-string-regexp@2.0.0: - resolution: {integrity: sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==} - engines: {node: '>=8'} - - escape-string-regexp@5.0.0: - resolution: {integrity: sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==} - engines: {node: '>=12'} - - esprima@4.0.1: - resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==} - engines: {node: '>=4'} - hasBin: true - - estree-walker@2.0.2: - resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==} - - esutils@2.0.3: - resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} - engines: {node: '>=0.10.0'} - - external-editor@3.1.0: - resolution: {integrity: sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==} - engines: {node: '>=4'} - - fast-diff@1.3.0: - resolution: {integrity: sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==} - - fast-glob@3.3.2: - resolution: {integrity: sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==} - engines: {node: '>=8.6.0'} - - fastq@1.17.1: - resolution: {integrity: sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==} - - figures@6.1.0: - resolution: {integrity: sha512-d+l3qxjSesT4V7v2fh+QnmFnUWv9lSpjarhShNTgBOfA0ttejbQUAlHLitbjkoRiDulW0OPoQPYIGhIC8ohejg==} - engines: {node: '>=18'} - - file-uri-to-path@1.0.0: - resolution: {integrity: sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==} - - fill-range@7.1.1: - resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==} - engines: {node: '>=8'} - - find-up-simple@1.0.0: - resolution: {integrity: sha512-q7Us7kcjj2VMePAa02hDAF6d+MzsdsAWEwYyOpwUtlerRBkOEPBCRZrAV4XfcSN8fHAgaD0hP7miwoay6DCprw==} - engines: {node: '>=18'} - - follow-redirects@1.15.6: - resolution: {integrity: sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==} - engines: {node: '>=4.0'} - peerDependencies: - debug: '*' - peerDependenciesMeta: - debug: - optional: true - - form-data@4.0.0: - resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==} - engines: {node: '>= 6'} - - fs-minipass@2.1.0: - resolution: {integrity: sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==} - engines: {node: '>= 8'} - - fs.realpath@1.0.0: - resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} - - gauge@3.0.2: - resolution: {integrity: sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q==} - engines: {node: '>=10'} - deprecated: This package is no longer supported. - - get-caller-file@2.0.5: - resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} - engines: {node: 6.* || 8.* || >= 10.*} - - get-east-asian-width@1.2.0: - resolution: {integrity: sha512-2nk+7SIVb14QrgXFHcm84tD4bKQz0RxPuMT8Ag5KPOq7J5fEmAg0UbXdTOSHqNuHSU28k55qnceesxXRZGzKWA==} - engines: {node: '>=18'} - - glob-parent@5.1.2: - resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} - engines: {node: '>= 6'} - - glob@7.2.3: - resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} - deprecated: Glob versions prior to v9 are no longer supported - - globby@14.0.2: - resolution: {integrity: sha512-s3Fq41ZVh7vbbe2PN3nrW7yC7U7MFVc5c98/iTl9c2GawNMKx/J648KQRW6WKkuU8GIbbh2IXfIRQjOZnXcTnw==} - engines: {node: '>=18'} - - graceful-fs@4.2.11: - resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} - - has-unicode@2.0.1: - resolution: {integrity: sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==} - - https-proxy-agent@5.0.1: - resolution: {integrity: sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==} - engines: {node: '>= 6'} - - iconv-lite@0.4.24: - resolution: {integrity: sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==} - engines: {node: '>=0.10.0'} - - ignore-by-default@2.1.0: - resolution: {integrity: sha512-yiWd4GVmJp0Q6ghmM2B/V3oZGRmjrKLXvHR3TE1nfoXsmoggllfZUQe74EN0fJdPFZu2NIvNdrMMLm3OsV7Ohw==} - engines: {node: '>=10 <11 || >=12 <13 || >=14'} - - ignore@5.3.1: - resolution: {integrity: sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==} - engines: {node: '>= 4'} - - imurmurhash@0.1.4: - resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} - engines: {node: '>=0.8.19'} - - indent-string@5.0.0: - resolution: {integrity: sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==} - engines: {node: '>=12'} - - inflight@1.0.6: - resolution: {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. - - inherits@2.0.4: - resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} - - inquirer@10.0.1: - resolution: {integrity: sha512-XgthhRIn0Ci9JdGJpUo2EtpPfaczbooZbGTN+FTzSCyUb7YHJcPPnuSXfeG5903bJMy3OyEoVTQMnvO4Ly5tFg==} - engines: {node: '>=18'} - - ipaddr.js@2.2.0: - resolution: {integrity: sha512-Ag3wB2o37wslZS19hZqorUnrnzSkpOVy+IiiDEiTqNubEYpYuHWIf6K4psgN2ZWKExS4xhVCrRVfb/wfW8fWJA==} - engines: {node: '>= 10'} - - irregular-plurals@3.5.0: - resolution: {integrity: sha512-1ANGLZ+Nkv1ptFb2pa8oG8Lem4krflKuX/gINiHJHjJUKaJHk/SXk5x6K3J+39/p0h1RQ2saROclJJ+QLvETCQ==} - engines: {node: '>=8'} - - is-extglob@2.1.1: - resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} - engines: {node: '>=0.10.0'} - - is-fullwidth-code-point@3.0.0: - resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} - engines: {node: '>=8'} - - is-fullwidth-code-point@4.0.0: - resolution: {integrity: sha512-O4L094N2/dZ7xqVdrXhh9r1KODPJpFms8B5sGdJLPy664AgvXsreZUyCQQNItZRDlYug4xStLjNp/sz3HvBowQ==} - engines: {node: '>=12'} - - is-glob@4.0.3: - resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} - engines: {node: '>=0.10.0'} - - is-number@7.0.0: - resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} - engines: {node: '>=0.12.0'} - - is-plain-object@5.0.0: - resolution: {integrity: sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==} - engines: {node: '>=0.10.0'} - - is-promise@4.0.0: - resolution: {integrity: sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==} - - is-unicode-supported@2.0.0: - resolution: {integrity: sha512-FRdAyx5lusK1iHG0TWpVtk9+1i+GjrzRffhDg4ovQ7mcidMQ6mj+MhKPmvh7Xwyv5gIS06ns49CA7Sqg7lC22Q==} - engines: {node: '>=18'} - - js-string-escape@1.0.1: - resolution: {integrity: sha512-Smw4xcfIQ5LVjAOuJCvN/zIodzA/BBSsluuoSykP+lUvScIi4U6RJLfwHet5cxFnCswUjISV8oAXaqaJDY3chg==} - engines: {node: '>= 0.8'} - - js-tokens@4.0.0: - resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} - - js-yaml@3.14.1: - resolution: {integrity: sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==} - hasBin: true - - js-yaml@4.1.0: - resolution: {integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==} - hasBin: true - - load-json-file@7.0.1: - resolution: {integrity: sha512-Gnxj3ev3mB5TkVBGad0JM6dmLiQL+o0t23JPBZ9sd+yvSLk05mFoqKBw5N8gbbkU4TNXyqCgIrl/VM17OgUIgQ==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - lodash-es@4.17.21: - resolution: {integrity: sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==} - - lodash@4.17.21: - resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} - - loose-envify@1.4.0: - resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==} - hasBin: true - - make-dir@3.1.0: - resolution: {integrity: sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==} - engines: {node: '>=8'} - - matcher@5.0.0: - resolution: {integrity: sha512-s2EMBOWtXFc8dgqvoAzKJXxNHibcdJMV0gwqKUaw9E2JBJuGUK7DrNKrA6g/i+v72TT16+6sVm5mS3thaMLQUw==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - md5-hex@3.0.1: - resolution: {integrity: sha512-BUiRtTtV39LIJwinWBjqVsU9xhdnz7/i889V859IBFpuqGAj6LuOvHv5XLbgZ2R7ptJoJaEcxkv88/h25T7Ciw==} - engines: {node: '>=8'} - - memoize@10.0.0: - resolution: {integrity: sha512-H6cBLgsi6vMWOcCpvVCdFFnl3kerEXbrYh9q+lY6VXvQSmM6CkmV08VOwT+WE2tzIEqRPFfAq3fm4v/UIW6mSA==} - engines: {node: '>=18'} - - merge2@1.4.1: - resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} - engines: {node: '>= 8'} - - micromatch@4.0.7: - resolution: {integrity: sha512-LPP/3KorzCwBxfeUuZmaR6bG2kdeHSbe0P2tY3FLRU4vYrjYz5hI4QZwV0njUx3jeuKe67YukQ1LSPZBKDqO/Q==} - engines: {node: '>=8.6'} - - mime-db@1.52.0: - resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} - engines: {node: '>= 0.6'} - - mime-types@2.1.35: - resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} - engines: {node: '>= 0.6'} - - mimic-function@5.0.1: - resolution: {integrity: sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==} - engines: {node: '>=18'} - - minimatch@3.1.2: - resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} - - minipass@3.3.6: - resolution: {integrity: sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==} - engines: {node: '>=8'} - - minipass@5.0.0: - resolution: {integrity: sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==} - engines: {node: '>=8'} - - minizlib@2.1.2: - resolution: {integrity: sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==} - engines: {node: '>= 8'} - - mkdirp@1.0.4: - resolution: {integrity: sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==} - engines: {node: '>=10'} - hasBin: true - - ms@2.1.2: - resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} - - ms@2.1.3: - resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} - - mute-stream@1.0.0: - resolution: {integrity: sha512-avsJQhyd+680gKXyG/sQc0nXaC6rBkPOfyHYcFb9+hdkqQkR9bdnkJ0AMZhke0oesPqIO+mFFJ+IdBc7mst4IA==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - - nanoid@3.3.7: - resolution: {integrity: sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==} - engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} - hasBin: true - - node-fetch@2.7.0: - resolution: {integrity: sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==} - engines: {node: 4.x || >=6.0.0} - peerDependencies: - encoding: ^0.1.0 - peerDependenciesMeta: - encoding: - optional: true - - node-gyp-build@4.8.1: - resolution: {integrity: sha512-OSs33Z9yWr148JZcbZd5WiAXhh/n9z8TxQcdMhIOlpN9AhWpLfvVFO73+m77bBABQMaY9XSvIa+qk0jlI7Gcaw==} - hasBin: true - - nofilter@3.1.0: - resolution: {integrity: sha512-l2NNj07e9afPnhAhvgVrCD/oy2Ai1yfLpuo3EpiO1jFTsB4sFz6oIfAfSZyQzVpkZQ9xS8ZS5g1jCBgq4Hwo0g==} - engines: {node: '>=12.19'} - - nopt@5.0.0: - resolution: {integrity: sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==} - engines: {node: '>=6'} - hasBin: true - - npmlog@5.0.1: - resolution: {integrity: sha512-AqZtDUWOMKs1G/8lwylVjrdYgqA4d9nu8hc+0gzRxlDb1I10+FHBGMXs6aiQHFdCUUlqH99MUMuLfzWDNDtfxw==} - deprecated: This package is no longer supported. - - object-assign@4.1.1: - resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} - engines: {node: '>=0.10.0'} - - once@1.4.0: - resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} - - os-tmpdir@1.0.2: - resolution: {integrity: sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==} - engines: {node: '>=0.10.0'} - - p-map@7.0.2: - resolution: {integrity: sha512-z4cYYMMdKHzw4O5UkWJImbZynVIo0lSGTXc7bzB1e/rrDqkgGUNysK/o4bTr+0+xKvvLoTyGqYC4Fgljy9qe1Q==} - engines: {node: '>=18'} - - package-config@5.0.0: - resolution: {integrity: sha512-GYTTew2slBcYdvRHqjhwaaydVMvn/qrGC323+nKclYioNSLTDUM/lGgtGTgyHVtYcozb+XkE8CNhwcraOmZ9Mg==} - engines: {node: '>=18'} - - parse-ms@4.0.0: - resolution: {integrity: sha512-TXfryirbmq34y8QBwgqCVLi+8oA3oWx2eAnSn62ITyEhEYaWRlVZ2DvMM9eZbMs/RfxPu/PK/aBLyGj4IrqMHw==} - engines: {node: '>=18'} - - path-is-absolute@1.0.1: - resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==} - engines: {node: '>=0.10.0'} - - path-type@5.0.0: - resolution: {integrity: sha512-5HviZNaZcfqP95rwpv+1HDgUamezbqdSYTyzjTvwtJSnIH+3vnbmWsItli8OFEndS984VT55M3jduxZbX351gg==} - engines: {node: '>=12'} - - picocolors@1.0.1: - resolution: {integrity: sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==} - - picomatch@2.3.1: - resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} - engines: {node: '>=8.6'} - - picomatch@3.0.1: - resolution: {integrity: sha512-I3EurrIQMlRc9IaAZnqRR044Phh2DXY+55o7uJ0V+hYZAcQYSuFWsc9q5PvyDHUSCe1Qxn/iBz+78s86zWnGag==} - engines: {node: '>=10'} - - plur@5.1.0: - resolution: {integrity: sha512-VP/72JeXqak2KiOzjgKtQen5y3IZHn+9GOuLDafPv0eXa47xq0At93XahYBs26MsifCQ4enGKwbjBTKgb9QJXg==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - postcss-value-parser@4.2.0: - resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==} - - postcss@8.4.33: - resolution: {integrity: sha512-Kkpbhhdjw2qQs2O2DGX+8m5OVqEcbB9HRBvuYM9pgrjEFUg30A9LmXNlTAUj4S9kgtGyrMbTzVjH7E+s5Re2yg==} - engines: {node: ^10 || ^12 || >=14} - - pretty-ms@9.0.0: - resolution: {integrity: sha512-E9e9HJ9R9NasGOgPaPE8VMeiPKAyWR5jcFpNnwIejslIhWqdqOrb2wShBsncMPUb+BcCd2OPYfh7p2W6oemTng==} - engines: {node: '>=18'} - - proxy-from-env@1.1.0: - resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==} - - queue-microtask@1.2.3: - resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} - - react-dom@18.3.1: - resolution: {integrity: sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==} - peerDependencies: - react: ^18.3.1 - - react@18.3.1: - resolution: {integrity: sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==} - engines: {node: '>=0.10.0'} - - readable-stream@3.6.2: - resolution: {integrity: sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==} - engines: {node: '>= 6'} - - require-directory@2.1.1: - resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} - engines: {node: '>=0.10.0'} - - resolve-cwd@3.0.0: - resolution: {integrity: sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==} - engines: {node: '>=8'} - - resolve-from@5.0.0: - resolution: {integrity: sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==} - engines: {node: '>=8'} - - reusify@1.0.4: - resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==} - engines: {iojs: '>=1.0.0', node: '>=0.10.0'} - - rimraf@3.0.2: - resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==} - deprecated: Rimraf versions prior to v4 are no longer supported - hasBin: true - - run-async@3.0.0: - resolution: {integrity: sha512-540WwVDOMxA6dN6We19EcT9sc3hkXPw5mzRNGM3FkdN/vtE9NFvj5lFAPNwUDmJjXidm3v7TC1cTE7t17Ulm1Q==} - engines: {node: '>=0.12.0'} - - run-parallel@1.2.0: - resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} - - rxjs@7.8.1: - resolution: {integrity: sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==} - - safe-buffer@5.2.1: - resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} - - safer-buffer@2.1.2: - resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} - - scheduler@0.23.2: - resolution: {integrity: sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ==} - - semver@6.3.1: - resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} - hasBin: true - - semver@7.6.2: - resolution: {integrity: sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==} - engines: {node: '>=10'} - hasBin: true - - serialize-error@7.0.1: - resolution: {integrity: sha512-8I8TjW5KMOKsZQTvoxjuSIa7foAwPWGOts+6o7sgjz41/qMD9VQHEDxi6PBvK2l0MXUmqZyNpUK+T2tQaaElvw==} - engines: {node: '>=10'} - - set-blocking@2.0.0: - resolution: {integrity: sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==} - - shallowequal@1.1.0: - resolution: {integrity: sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ==} - - signal-exit@3.0.7: - resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} - - signal-exit@4.1.0: - resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} - engines: {node: '>=14'} - - slash@5.1.0: - resolution: {integrity: sha512-ZA6oR3T/pEyuqwMgAKT0/hAv8oAXckzbkmR0UkUosQ+Mc4RxGoJkRmwHgHufaenlyAgE1Mxgpdcrf75y6XcnDg==} - engines: {node: '>=14.16'} - - slice-ansi@5.0.0: - resolution: {integrity: sha512-FC+lgizVPfie0kkhqUScwRu1O/lF6NOgJmlCgK+/LYxDCTk8sGelYaHDhFcDN+Sn3Cv+3VSa4Byeo+IMCzpMgQ==} - engines: {node: '>=12'} - - source-map-js@1.2.0: - resolution: {integrity: sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==} - engines: {node: '>=0.10.0'} - - sprintf-js@1.0.3: - resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==} - - stack-utils@2.0.6: - resolution: {integrity: sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==} - engines: {node: '>=10'} - - string-width@4.2.3: - resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} - engines: {node: '>=8'} - - string-width@7.2.0: - resolution: {integrity: sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==} - engines: {node: '>=18'} - - string_decoder@1.3.0: - resolution: {integrity: sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==} - - strip-ansi@6.0.1: - resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} - engines: {node: '>=8'} - - strip-ansi@7.1.0: - resolution: {integrity: sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==} - engines: {node: '>=12'} - - styled-components@6.1.1: - resolution: {integrity: sha512-cpZZP5RrKRIClBW5Eby4JM1wElLVP4NQrJbJ0h10TidTyJf4SIIwa3zLXOoPb4gJi8MsJ8mjq5mu2IrEhZIAcQ==} - engines: {node: '>= 16'} - peerDependencies: - react: '>= 16.8.0' - react-dom: '>= 16.8.0' - - stylis@4.3.2: - resolution: {integrity: sha512-bhtUjWd/z6ltJiQwg0dUfxEJ+W+jdqQd8TbWLWyeIJHlnsqmGLRFFd8e5mA0AZi/zx90smXRlN66YMTcaSFifg==} - - supertap@3.0.1: - resolution: {integrity: sha512-u1ZpIBCawJnO+0QePsEiOknOfCRq0yERxiAchT0i4li0WHNUJbf0evXXSXOcCAR4M8iMDoajXYmstm/qO81Isw==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - tar@6.2.1: - resolution: {integrity: sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==} - engines: {node: '>=10'} - - temp-dir@3.0.0: - resolution: {integrity: sha512-nHc6S/bwIilKHNRgK/3jlhDoIHcp45YgyiwcAk46Tr0LfEqGBVpmiAyuiuxeVE44m3mXnEeVhaipLOEWmH+Njw==} - engines: {node: '>=14.16'} - - time-zone@1.0.0: - resolution: {integrity: sha512-TIsDdtKo6+XrPtiTm1ssmMngN1sAhyKnTO2kunQWqNPWIVvCm15Wmw4SWInwTVgJ5u/Tr04+8Ei9TNcw4x4ONA==} - engines: {node: '>=4'} - - tmp@0.0.33: - resolution: {integrity: sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==} - engines: {node: '>=0.6.0'} - - to-regex-range@5.0.1: - resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} - engines: {node: '>=8.0'} - - toml@3.0.0: - resolution: {integrity: sha512-y/mWCZinnvxjTKYhJ+pYxwD0mRLVvOtdS2Awbgxln6iEnt4rk0yBxeSBHkGJcPucRiG0e55mwWp+g/05rsrd6w==} - - tr46@0.0.3: - resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==} - - tslib@2.6.3: - resolution: {integrity: sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ==} - - typanion@3.14.0: - resolution: {integrity: sha512-ZW/lVMRabETuYCd9O9ZvMhAh8GslSqaUjxmK/JLPCh6l73CvLBiuXswj/+7LdnWOgYsQ130FqLzFz5aGT4I3Ug==} - - type-fest@0.13.1: - resolution: {integrity: sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==} - engines: {node: '>=10'} - - type-fest@0.21.3: - resolution: {integrity: sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==} - engines: {node: '>=10'} - - typescript@5.6.2: - resolution: {integrity: sha512-NW8ByodCSNCwZeghjN3o+JX5OFH0Ojg6sadjEKY4huZ52TqbJTJnDo5+Tw98lSy63NZvi4n+ez5m2u5d4PkZyw==} - engines: {node: '>=14.17'} - hasBin: true - - undici-types@6.19.8: - resolution: {integrity: sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==} - - unicorn-magic@0.1.0: - resolution: {integrity: sha512-lRfVq8fE8gz6QMBuDM6a+LO3IAzTi05H6gCVaUpir2E1Rwpo4ZUog45KpNXKC/Mn3Yb9UDuHumeFTo9iV/D9FQ==} - engines: {node: '>=18'} - - universal-user-agent@7.0.2: - resolution: {integrity: sha512-0JCqzSKnStlRRQfCdowvqy3cy0Dvtlb8xecj/H8JFZuCze4rwjPZQOgvFvn0Ws/usCHQFGpyr+pB9adaGwXn4Q==} - - util-deprecate@1.0.2: - resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} - - wasm-sjlj@1.0.5: - resolution: {integrity: sha512-Z/MHJeOkAvJJVWnGX3/YZGYldGaawZbYHX4ldYG9kLhcdB8H31F5x66M7Zc4BP/7pg0aLsusQj1629m2B3Rilg==} - - webidl-conversions@3.0.1: - resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==} - - well-known-symbols@2.0.0: - resolution: {integrity: sha512-ZMjC3ho+KXo0BfJb7JgtQ5IBuvnShdlACNkKkdsqBmYw3bPAaJfPeYUo6tLUaT5tG/Gkh7xkpBhKRQ9e7pyg9Q==} - engines: {node: '>=6'} - - whatwg-url@5.0.0: - resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==} - - wide-align@1.1.5: - resolution: {integrity: sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==} - - wrap-ansi@6.2.0: - resolution: {integrity: sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==} - engines: {node: '>=8'} - - wrap-ansi@7.0.0: - resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==} - engines: {node: '>=10'} - - wrappy@1.0.2: - resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} - - write-file-atomic@5.0.1: - resolution: {integrity: sha512-+QU2zd6OTD8XWIJCbffaiQeH9U73qIqafo1x6V1snCWYGJf6cVE0cDR4D8xRzcEnfI21IFrUPzPGtcPf8AC+Rw==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - - y18n@5.0.8: - resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==} - engines: {node: '>=10'} - - yallist@4.0.0: - resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==} - - yargs-parser@21.1.1: - resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} - engines: {node: '>=12'} - - yargs@17.7.2: - resolution: {integrity: sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==} - engines: {node: '>=12'} - - yoctocolors-cjs@2.1.2: - resolution: {integrity: sha512-cYVsTjKl8b+FrnidjibDWskAv7UKOfcwaVZdp/it9n1s9fU3IkgDbhdIRKCW4JDsAlECJY0ytoVPT3sK6kideA==} - engines: {node: '>=18'} - -snapshots: - - '@emnapi/core@1.2.0': - dependencies: - '@emnapi/wasi-threads': 1.0.1 - tslib: 2.6.3 - - '@emnapi/runtime@1.2.0': - dependencies: - tslib: 2.6.3 - - '@emnapi/wasi-threads@1.0.1': - dependencies: - tslib: 2.6.3 - - '@emotion/is-prop-valid@1.2.2': - dependencies: - '@emotion/memoize': 0.8.1 - - '@emotion/memoize@0.8.1': {} - - '@emotion/unitless@0.8.1': {} - - '@inquirer/checkbox@2.3.10': - dependencies: - '@inquirer/core': 9.0.2 - '@inquirer/figures': 1.0.3 - '@inquirer/type': 1.4.0 - ansi-escapes: 4.3.2 - yoctocolors-cjs: 2.1.2 - - '@inquirer/confirm@3.1.14': - dependencies: - '@inquirer/core': 9.0.2 - '@inquirer/type': 1.4.0 - - '@inquirer/core@9.0.2': - dependencies: - '@inquirer/figures': 1.0.3 - '@inquirer/type': 1.4.0 - '@types/mute-stream': 0.0.4 - '@types/node': 20.16.5 - '@types/wrap-ansi': 3.0.0 - ansi-escapes: 4.3.2 - cli-spinners: 2.9.2 - cli-width: 4.1.0 - mute-stream: 1.0.0 - signal-exit: 4.1.0 - strip-ansi: 6.0.1 - wrap-ansi: 6.2.0 - yoctocolors-cjs: 2.1.2 - - '@inquirer/editor@2.1.14': - dependencies: - '@inquirer/core': 9.0.2 - '@inquirer/type': 1.4.0 - external-editor: 3.1.0 - - '@inquirer/expand@2.1.14': - dependencies: - '@inquirer/core': 9.0.2 - '@inquirer/type': 1.4.0 - yoctocolors-cjs: 2.1.2 - - '@inquirer/figures@1.0.3': {} - - '@inquirer/input@2.2.1': - dependencies: - '@inquirer/core': 9.0.2 - '@inquirer/type': 1.4.0 - - '@inquirer/number@1.0.2': - dependencies: - '@inquirer/core': 9.0.2 - '@inquirer/type': 1.4.0 - - '@inquirer/password@2.1.14': - dependencies: - '@inquirer/core': 9.0.2 - '@inquirer/type': 1.4.0 - ansi-escapes: 4.3.2 - - '@inquirer/prompts@5.1.2': - dependencies: - '@inquirer/checkbox': 2.3.10 - '@inquirer/confirm': 3.1.14 - '@inquirer/editor': 2.1.14 - '@inquirer/expand': 2.1.14 - '@inquirer/input': 2.2.1 - '@inquirer/number': 1.0.2 - '@inquirer/password': 2.1.14 - '@inquirer/rawlist': 2.1.14 - '@inquirer/select': 2.3.10 - - '@inquirer/rawlist@2.1.14': - dependencies: - '@inquirer/core': 9.0.2 - '@inquirer/type': 1.4.0 - yoctocolors-cjs: 2.1.2 - - '@inquirer/select@2.3.10': - dependencies: - '@inquirer/core': 9.0.2 - '@inquirer/figures': 1.0.3 - '@inquirer/type': 1.4.0 - ansi-escapes: 4.3.2 - yoctocolors-cjs: 2.1.2 - - '@inquirer/type@1.4.0': - dependencies: - mute-stream: 1.0.0 - - '@mapbox/node-pre-gyp@1.0.11': - dependencies: - detect-libc: 2.0.3 - https-proxy-agent: 5.0.1 - make-dir: 3.1.0 - node-fetch: 2.7.0 - nopt: 5.0.0 - npmlog: 5.0.1 - rimraf: 3.0.2 - semver: 7.6.2 - tar: 6.2.1 - transitivePeerDependencies: - - encoding - - supports-color - - '@napi-rs/cli@3.0.0-alpha.62(@emnapi/runtime@1.2.0)(emnapi@1.2.0)': - dependencies: - '@napi-rs/cross-toolchain': 0.0.16 - '@napi-rs/wasm-tools': 0.0.2 - '@octokit/rest': 21.0.0 - clipanion: 3.2.1(typanion@3.14.0) - colorette: 2.0.20 - debug: 4.3.5 - inquirer: 10.0.1 - js-yaml: 4.1.0 - lodash-es: 4.17.21 - semver: 7.6.2 - toml: 3.0.0 - typanion: 3.14.0 - wasm-sjlj: 1.0.5 - optionalDependencies: - '@emnapi/runtime': 1.2.0 - emnapi: 1.2.0 - transitivePeerDependencies: - - '@napi-rs/cross-toolchain-arm64-target-aarch64' - - '@napi-rs/cross-toolchain-arm64-target-armv7' - - '@napi-rs/cross-toolchain-arm64-target-x86_64' - - '@napi-rs/cross-toolchain-x64-target-aarch64' - - '@napi-rs/cross-toolchain-x64-target-armv7' - - '@napi-rs/cross-toolchain-x64-target-x86_64' - - supports-color - - '@napi-rs/cross-toolchain@0.0.16': - dependencies: - '@napi-rs/lzma': 1.3.1 - '@napi-rs/tar': 0.1.1 - debug: 4.3.5 - transitivePeerDependencies: - - supports-color - - '@napi-rs/lzma-android-arm-eabi@1.3.1': - optional: true - - '@napi-rs/lzma-android-arm64@1.3.1': - optional: true - - '@napi-rs/lzma-darwin-arm64@1.3.1': - optional: true - - '@napi-rs/lzma-darwin-x64@1.3.1': - optional: true - - '@napi-rs/lzma-freebsd-x64@1.3.1': - optional: true - - '@napi-rs/lzma-linux-arm-gnueabihf@1.3.1': - optional: true - - '@napi-rs/lzma-linux-arm64-gnu@1.3.1': - optional: true - - '@napi-rs/lzma-linux-arm64-musl@1.3.1': - optional: true - - '@napi-rs/lzma-linux-x64-gnu@1.3.1': - optional: true - - '@napi-rs/lzma-linux-x64-musl@1.3.1': - optional: true - - '@napi-rs/lzma-wasm32-wasi@1.3.1': - dependencies: - '@napi-rs/wasm-runtime': 0.2.4 - optional: true - - '@napi-rs/lzma-win32-arm64-msvc@1.3.1': - optional: true - - '@napi-rs/lzma-win32-ia32-msvc@1.3.1': - optional: true - - '@napi-rs/lzma-win32-x64-msvc@1.3.1': - optional: true - - '@napi-rs/lzma@1.3.1': - optionalDependencies: - '@napi-rs/lzma-android-arm-eabi': 1.3.1 - '@napi-rs/lzma-android-arm64': 1.3.1 - '@napi-rs/lzma-darwin-arm64': 1.3.1 - '@napi-rs/lzma-darwin-x64': 1.3.1 - '@napi-rs/lzma-freebsd-x64': 1.3.1 - '@napi-rs/lzma-linux-arm-gnueabihf': 1.3.1 - '@napi-rs/lzma-linux-arm64-gnu': 1.3.1 - '@napi-rs/lzma-linux-arm64-musl': 1.3.1 - '@napi-rs/lzma-linux-x64-gnu': 1.3.1 - '@napi-rs/lzma-linux-x64-musl': 1.3.1 - '@napi-rs/lzma-wasm32-wasi': 1.3.1 - '@napi-rs/lzma-win32-arm64-msvc': 1.3.1 - '@napi-rs/lzma-win32-ia32-msvc': 1.3.1 - '@napi-rs/lzma-win32-x64-msvc': 1.3.1 - - '@napi-rs/tar-android-arm-eabi@0.1.1': - optional: true - - '@napi-rs/tar-android-arm64@0.1.1': - optional: true - - '@napi-rs/tar-darwin-arm64@0.1.1': - optional: true - - '@napi-rs/tar-darwin-x64@0.1.1': - optional: true - - '@napi-rs/tar-freebsd-x64@0.1.1': - optional: true - - '@napi-rs/tar-linux-arm-gnueabihf@0.1.1': - optional: true - - '@napi-rs/tar-linux-arm64-gnu@0.1.1': - optional: true - - '@napi-rs/tar-linux-arm64-musl@0.1.1': - optional: true - - '@napi-rs/tar-linux-x64-gnu@0.1.1': - optional: true - - '@napi-rs/tar-linux-x64-musl@0.1.1': - optional: true - - '@napi-rs/tar-wasm32-wasi@0.1.1': - dependencies: - '@napi-rs/wasm-runtime': 0.2.4 - optional: true - - '@napi-rs/tar-win32-arm64-msvc@0.1.1': - optional: true - - '@napi-rs/tar-win32-ia32-msvc@0.1.1': - optional: true - - '@napi-rs/tar-win32-x64-msvc@0.1.1': - optional: true - - '@napi-rs/tar@0.1.1': - optionalDependencies: - '@napi-rs/tar-android-arm-eabi': 0.1.1 - '@napi-rs/tar-android-arm64': 0.1.1 - '@napi-rs/tar-darwin-arm64': 0.1.1 - '@napi-rs/tar-darwin-x64': 0.1.1 - '@napi-rs/tar-freebsd-x64': 0.1.1 - '@napi-rs/tar-linux-arm-gnueabihf': 0.1.1 - '@napi-rs/tar-linux-arm64-gnu': 0.1.1 - '@napi-rs/tar-linux-arm64-musl': 0.1.1 - '@napi-rs/tar-linux-x64-gnu': 0.1.1 - '@napi-rs/tar-linux-x64-musl': 0.1.1 - '@napi-rs/tar-wasm32-wasi': 0.1.1 - '@napi-rs/tar-win32-arm64-msvc': 0.1.1 - '@napi-rs/tar-win32-ia32-msvc': 0.1.1 - '@napi-rs/tar-win32-x64-msvc': 0.1.1 - - '@napi-rs/wasm-runtime@0.2.4': - dependencies: - '@emnapi/core': 1.2.0 - '@emnapi/runtime': 1.2.0 - '@tybys/wasm-util': 0.9.0 - - '@napi-rs/wasm-tools-android-arm-eabi@0.0.2': - optional: true - - '@napi-rs/wasm-tools-android-arm64@0.0.2': - optional: true - - '@napi-rs/wasm-tools-darwin-arm64@0.0.2': - optional: true - - '@napi-rs/wasm-tools-darwin-x64@0.0.2': - optional: true - - '@napi-rs/wasm-tools-freebsd-x64@0.0.2': - optional: true - - '@napi-rs/wasm-tools-linux-arm64-gnu@0.0.2': - optional: true - - '@napi-rs/wasm-tools-linux-arm64-musl@0.0.2': - optional: true - - '@napi-rs/wasm-tools-linux-x64-gnu@0.0.2': - optional: true - - '@napi-rs/wasm-tools-linux-x64-musl@0.0.2': - optional: true - - '@napi-rs/wasm-tools-wasm32-wasi@0.0.2': - dependencies: - '@napi-rs/wasm-runtime': 0.2.4 - optional: true - - '@napi-rs/wasm-tools-win32-arm64-msvc@0.0.2': - optional: true - - '@napi-rs/wasm-tools-win32-ia32-msvc@0.0.2': - optional: true - - '@napi-rs/wasm-tools-win32-x64-msvc@0.0.2': - optional: true - - '@napi-rs/wasm-tools@0.0.2': - optionalDependencies: - '@napi-rs/wasm-tools-android-arm-eabi': 0.0.2 - '@napi-rs/wasm-tools-android-arm64': 0.0.2 - '@napi-rs/wasm-tools-darwin-arm64': 0.0.2 - '@napi-rs/wasm-tools-darwin-x64': 0.0.2 - '@napi-rs/wasm-tools-freebsd-x64': 0.0.2 - '@napi-rs/wasm-tools-linux-arm64-gnu': 0.0.2 - '@napi-rs/wasm-tools-linux-arm64-musl': 0.0.2 - '@napi-rs/wasm-tools-linux-x64-gnu': 0.0.2 - '@napi-rs/wasm-tools-linux-x64-musl': 0.0.2 - '@napi-rs/wasm-tools-wasm32-wasi': 0.0.2 - '@napi-rs/wasm-tools-win32-arm64-msvc': 0.0.2 - '@napi-rs/wasm-tools-win32-ia32-msvc': 0.0.2 - '@napi-rs/wasm-tools-win32-x64-msvc': 0.0.2 - - '@nodelib/fs.scandir@2.1.5': - dependencies: - '@nodelib/fs.stat': 2.0.5 - run-parallel: 1.2.0 - - '@nodelib/fs.stat@2.0.5': {} - - '@nodelib/fs.walk@1.2.8': - dependencies: - '@nodelib/fs.scandir': 2.1.5 - fastq: 1.17.1 - - '@octokit/auth-token@5.1.1': {} - - '@octokit/core@6.1.2': - dependencies: - '@octokit/auth-token': 5.1.1 - '@octokit/graphql': 8.1.1 - '@octokit/request': 9.1.1 - '@octokit/request-error': 6.1.2 - '@octokit/types': 13.5.0 - before-after-hook: 3.0.2 - universal-user-agent: 7.0.2 - - '@octokit/endpoint@10.1.1': - dependencies: - '@octokit/types': 13.5.0 - universal-user-agent: 7.0.2 - - '@octokit/graphql@8.1.1': - dependencies: - '@octokit/request': 9.1.1 - '@octokit/types': 13.5.0 - universal-user-agent: 7.0.2 - - '@octokit/openapi-types@22.2.0': {} - - '@octokit/plugin-paginate-rest@11.3.3(@octokit/core@6.1.2)': - dependencies: - '@octokit/core': 6.1.2 - '@octokit/types': 13.5.0 - - '@octokit/plugin-request-log@5.3.0(@octokit/core@6.1.2)': - dependencies: - '@octokit/core': 6.1.2 - - '@octokit/plugin-rest-endpoint-methods@13.2.4(@octokit/core@6.1.2)': - dependencies: - '@octokit/core': 6.1.2 - '@octokit/types': 13.5.0 - - '@octokit/request-error@6.1.2': - dependencies: - '@octokit/types': 13.5.0 - - '@octokit/request@9.1.1': - dependencies: - '@octokit/endpoint': 10.1.1 - '@octokit/request-error': 6.1.2 - '@octokit/types': 13.5.0 - universal-user-agent: 7.0.2 - - '@octokit/rest@21.0.0': - dependencies: - '@octokit/core': 6.1.2 - '@octokit/plugin-paginate-rest': 11.3.3(@octokit/core@6.1.2) - '@octokit/plugin-request-log': 5.3.0(@octokit/core@6.1.2) - '@octokit/plugin-rest-endpoint-methods': 13.2.4(@octokit/core@6.1.2) - - '@octokit/types@13.5.0': - dependencies: - '@octokit/openapi-types': 22.2.0 - - '@rollup/pluginutils@4.2.1': - dependencies: - estree-walker: 2.0.2 - picomatch: 2.3.1 - - '@sindresorhus/merge-streams@2.3.0': {} - - '@tybys/wasm-util@0.9.0': - dependencies: - tslib: 2.6.3 - - '@types/mute-stream@0.0.4': - dependencies: - '@types/node': 22.5.5 - - '@types/node@20.16.5': - dependencies: - undici-types: 6.19.8 - - '@types/node@22.5.5': - dependencies: - undici-types: 6.19.8 - - '@types/stylis@4.2.6': {} - - '@types/wrap-ansi@3.0.0': {} - - '@vercel/nft@0.26.5': - dependencies: - '@mapbox/node-pre-gyp': 1.0.11 - '@rollup/pluginutils': 4.2.1 - acorn: 8.12.1 - acorn-import-attributes: 1.9.5(acorn@8.12.1) - async-sema: 3.1.1 - bindings: 1.5.0 - estree-walker: 2.0.2 - glob: 7.2.3 - graceful-fs: 4.2.11 - micromatch: 4.0.7 - node-gyp-build: 4.8.1 - resolve-from: 5.0.0 - transitivePeerDependencies: - - encoding - - supports-color - - abbrev@1.1.1: {} - - acorn-import-attributes@1.9.5(acorn@8.12.1): - dependencies: - acorn: 8.12.1 - - acorn-walk@8.3.3: - dependencies: - acorn: 8.12.1 - - acorn@8.12.1: {} - - agent-base@6.0.2: - dependencies: - debug: 4.3.5 - transitivePeerDependencies: - - supports-color - - ansi-escapes@4.3.2: - dependencies: - type-fest: 0.21.3 - - ansi-regex@5.0.1: {} - - ansi-regex@6.0.1: {} - - ansi-styles@4.3.0: - dependencies: - color-convert: 2.0.1 - - ansi-styles@6.2.1: {} - - aproba@2.0.0: {} - - are-we-there-yet@2.0.0: - dependencies: - delegates: 1.0.0 - readable-stream: 3.6.2 - - argparse@1.0.10: - dependencies: - sprintf-js: 1.0.3 - - argparse@2.0.1: {} - - array-find-index@1.0.2: {} - - arrgv@1.0.2: {} - - arrify@3.0.0: {} - - async-sema@3.1.1: {} - - asynckit@0.4.0: {} - - ava@6.1.3: - dependencies: - '@vercel/nft': 0.26.5 - acorn: 8.12.1 - acorn-walk: 8.3.3 - ansi-styles: 6.2.1 - arrgv: 1.0.2 - arrify: 3.0.0 - callsites: 4.2.0 - cbor: 9.0.2 - chalk: 5.3.0 - chunkd: 2.0.1 - ci-info: 4.0.0 - ci-parallel-vars: 1.0.1 - cli-truncate: 4.0.0 - code-excerpt: 4.0.0 - common-path-prefix: 3.0.0 - concordance: 5.0.4 - currently-unhandled: 0.4.1 - debug: 4.3.5 - emittery: 1.0.3 - figures: 6.1.0 - globby: 14.0.2 - ignore-by-default: 2.1.0 - indent-string: 5.0.0 - is-plain-object: 5.0.0 - is-promise: 4.0.0 - matcher: 5.0.0 - memoize: 10.0.0 - ms: 2.1.3 - p-map: 7.0.2 - package-config: 5.0.0 - picomatch: 3.0.1 - plur: 5.1.0 - pretty-ms: 9.0.0 - resolve-cwd: 3.0.0 - stack-utils: 2.0.6 - strip-ansi: 7.1.0 - supertap: 3.0.1 - temp-dir: 3.0.0 - write-file-atomic: 5.0.1 - yargs: 17.7.2 - transitivePeerDependencies: - - encoding - - supports-color - - axios@1.6.2: - dependencies: - follow-redirects: 1.15.6 - form-data: 4.0.0 - proxy-from-env: 1.1.0 - transitivePeerDependencies: - - debug - - balanced-match@1.0.2: {} - - before-after-hook@3.0.2: {} - - bindings@1.5.0: - dependencies: - file-uri-to-path: 1.0.0 - - blueimp-md5@2.19.0: {} - - brace-expansion@1.1.11: - dependencies: - balanced-match: 1.0.2 - concat-map: 0.0.1 - - braces@3.0.3: - dependencies: - fill-range: 7.1.1 - - callsites@4.2.0: {} - - camelize@1.0.1: {} - - cbor@9.0.2: - dependencies: - nofilter: 3.1.0 - - chalk@5.3.0: {} - - chardet@0.7.0: {} - - chownr@2.0.0: {} - - chunkd@2.0.1: {} - - ci-info@4.0.0: {} - - ci-parallel-vars@1.0.1: {} - - cli-spinners@2.9.2: {} - - cli-truncate@4.0.0: - dependencies: - slice-ansi: 5.0.0 - string-width: 7.2.0 - - cli-width@4.1.0: {} - - clipanion@3.2.1(typanion@3.14.0): - dependencies: - typanion: 3.14.0 - - cliui@8.0.1: - dependencies: - string-width: 4.2.3 - strip-ansi: 6.0.1 - wrap-ansi: 7.0.0 - - code-excerpt@4.0.0: - dependencies: - convert-to-spaces: 2.0.1 - - color-convert@2.0.1: - dependencies: - color-name: 1.1.4 - - color-name@1.1.4: {} - - color-support@1.1.3: {} - - colorette@2.0.20: {} - - combined-stream@1.0.8: - dependencies: - delayed-stream: 1.0.0 - - common-path-prefix@3.0.0: {} - - concat-map@0.0.1: {} - - concordance@5.0.4: - dependencies: - date-time: 3.1.0 - esutils: 2.0.3 - fast-diff: 1.3.0 - js-string-escape: 1.0.1 - lodash: 4.17.21 - md5-hex: 3.0.1 - semver: 7.6.2 - well-known-symbols: 2.0.0 - - console-control-strings@1.1.0: {} - - convert-to-spaces@2.0.1: {} - - css-color-keywords@1.0.0: {} - - css-to-react-native@3.2.0: - dependencies: - camelize: 1.0.1 - css-color-keywords: 1.0.0 - postcss-value-parser: 4.2.0 - - csstype@3.1.3: {} - - currently-unhandled@0.4.1: - dependencies: - array-find-index: 1.0.2 - - date-time@3.1.0: - dependencies: - time-zone: 1.0.0 - - debug@4.3.5: - dependencies: - ms: 2.1.2 - - delayed-stream@1.0.0: {} - - delegates@1.0.0: {} - - detect-libc@2.0.3: {} - - emittery@1.0.3: {} - - emnapi@1.2.0: {} - - emoji-regex@10.3.0: {} - - emoji-regex@8.0.0: {} - - escalade@3.1.2: {} - - escape-string-regexp@2.0.0: {} - - escape-string-regexp@5.0.0: {} - - esprima@4.0.1: {} - - estree-walker@2.0.2: {} - - esutils@2.0.3: {} - - external-editor@3.1.0: - dependencies: - chardet: 0.7.0 - iconv-lite: 0.4.24 - tmp: 0.0.33 - - fast-diff@1.3.0: {} - - fast-glob@3.3.2: - dependencies: - '@nodelib/fs.stat': 2.0.5 - '@nodelib/fs.walk': 1.2.8 - glob-parent: 5.1.2 - merge2: 1.4.1 - micromatch: 4.0.7 - - fastq@1.17.1: - dependencies: - reusify: 1.0.4 - - figures@6.1.0: - dependencies: - is-unicode-supported: 2.0.0 - - file-uri-to-path@1.0.0: {} - - fill-range@7.1.1: - dependencies: - to-regex-range: 5.0.1 - - find-up-simple@1.0.0: {} - - follow-redirects@1.15.6: {} - - form-data@4.0.0: - dependencies: - asynckit: 0.4.0 - combined-stream: 1.0.8 - mime-types: 2.1.35 - - fs-minipass@2.1.0: - dependencies: - minipass: 3.3.6 - - fs.realpath@1.0.0: {} - - gauge@3.0.2: - dependencies: - aproba: 2.0.0 - color-support: 1.1.3 - console-control-strings: 1.1.0 - has-unicode: 2.0.1 - object-assign: 4.1.1 - signal-exit: 3.0.7 - string-width: 4.2.3 - strip-ansi: 6.0.1 - wide-align: 1.1.5 - - get-caller-file@2.0.5: {} - - get-east-asian-width@1.2.0: {} - - glob-parent@5.1.2: - dependencies: - is-glob: 4.0.3 - - glob@7.2.3: - dependencies: - fs.realpath: 1.0.0 - inflight: 1.0.6 - inherits: 2.0.4 - minimatch: 3.1.2 - once: 1.4.0 - path-is-absolute: 1.0.1 - - globby@14.0.2: - dependencies: - '@sindresorhus/merge-streams': 2.3.0 - fast-glob: 3.3.2 - ignore: 5.3.1 - path-type: 5.0.0 - slash: 5.1.0 - unicorn-magic: 0.1.0 - - graceful-fs@4.2.11: {} - - has-unicode@2.0.1: {} - - https-proxy-agent@5.0.1: - dependencies: - agent-base: 6.0.2 - debug: 4.3.5 - transitivePeerDependencies: - - supports-color - - iconv-lite@0.4.24: - dependencies: - safer-buffer: 2.1.2 - - ignore-by-default@2.1.0: {} - - ignore@5.3.1: {} - - imurmurhash@0.1.4: {} - - indent-string@5.0.0: {} - - inflight@1.0.6: - dependencies: - once: 1.4.0 - wrappy: 1.0.2 - - inherits@2.0.4: {} - - inquirer@10.0.1: - dependencies: - '@inquirer/prompts': 5.1.2 - '@inquirer/type': 1.4.0 - '@types/mute-stream': 0.0.4 - ansi-escapes: 4.3.2 - mute-stream: 1.0.0 - run-async: 3.0.0 - rxjs: 7.8.1 - - ipaddr.js@2.2.0: {} - - irregular-plurals@3.5.0: {} - - is-extglob@2.1.1: {} - - is-fullwidth-code-point@3.0.0: {} - - is-fullwidth-code-point@4.0.0: {} - - is-glob@4.0.3: - dependencies: - is-extglob: 2.1.1 - - is-number@7.0.0: {} - - is-plain-object@5.0.0: {} - - is-promise@4.0.0: {} - - is-unicode-supported@2.0.0: {} - - js-string-escape@1.0.1: {} - - js-tokens@4.0.0: {} - - js-yaml@3.14.1: - dependencies: - argparse: 1.0.10 - esprima: 4.0.1 - - js-yaml@4.1.0: - dependencies: - argparse: 2.0.1 - - load-json-file@7.0.1: {} - - lodash-es@4.17.21: {} - - lodash@4.17.21: {} - - loose-envify@1.4.0: - dependencies: - js-tokens: 4.0.0 - - make-dir@3.1.0: - dependencies: - semver: 6.3.1 - - matcher@5.0.0: - dependencies: - escape-string-regexp: 5.0.0 - - md5-hex@3.0.1: - dependencies: - blueimp-md5: 2.19.0 - - memoize@10.0.0: - dependencies: - mimic-function: 5.0.1 - - merge2@1.4.1: {} - - micromatch@4.0.7: - dependencies: - braces: 3.0.3 - picomatch: 2.3.1 - - mime-db@1.52.0: {} - - mime-types@2.1.35: - dependencies: - mime-db: 1.52.0 - - mimic-function@5.0.1: {} - - minimatch@3.1.2: - dependencies: - brace-expansion: 1.1.11 - - minipass@3.3.6: - dependencies: - yallist: 4.0.0 - - minipass@5.0.0: {} - - minizlib@2.1.2: - dependencies: - minipass: 3.3.6 - yallist: 4.0.0 - - mkdirp@1.0.4: {} - - ms@2.1.2: {} - - ms@2.1.3: {} - - mute-stream@1.0.0: {} - - nanoid@3.3.7: {} - - node-fetch@2.7.0: - dependencies: - whatwg-url: 5.0.0 - - node-gyp-build@4.8.1: {} - - nofilter@3.1.0: {} - - nopt@5.0.0: - dependencies: - abbrev: 1.1.1 - - npmlog@5.0.1: - dependencies: - are-we-there-yet: 2.0.0 - console-control-strings: 1.1.0 - gauge: 3.0.2 - set-blocking: 2.0.0 - - object-assign@4.1.1: {} - - once@1.4.0: - dependencies: - wrappy: 1.0.2 - - os-tmpdir@1.0.2: {} - - p-map@7.0.2: {} - - package-config@5.0.0: - dependencies: - find-up-simple: 1.0.0 - load-json-file: 7.0.1 - - parse-ms@4.0.0: {} - - path-is-absolute@1.0.1: {} - - path-type@5.0.0: {} - - picocolors@1.0.1: {} - - picomatch@2.3.1: {} - - picomatch@3.0.1: {} - - plur@5.1.0: - dependencies: - irregular-plurals: 3.5.0 - - postcss-value-parser@4.2.0: {} - - postcss@8.4.33: - dependencies: - nanoid: 3.3.7 - picocolors: 1.0.1 - source-map-js: 1.2.0 - - pretty-ms@9.0.0: - dependencies: - parse-ms: 4.0.0 - - proxy-from-env@1.1.0: {} - - queue-microtask@1.2.3: {} - - react-dom@18.3.1(react@18.3.1): - dependencies: - loose-envify: 1.4.0 - react: 18.3.1 - scheduler: 0.23.2 - - react@18.3.1: - dependencies: - loose-envify: 1.4.0 - - readable-stream@3.6.2: - dependencies: - inherits: 2.0.4 - string_decoder: 1.3.0 - util-deprecate: 1.0.2 - - require-directory@2.1.1: {} - - resolve-cwd@3.0.0: - dependencies: - resolve-from: 5.0.0 - - resolve-from@5.0.0: {} - - reusify@1.0.4: {} - - rimraf@3.0.2: - dependencies: - glob: 7.2.3 - - run-async@3.0.0: {} - - run-parallel@1.2.0: - dependencies: - queue-microtask: 1.2.3 - - rxjs@7.8.1: - dependencies: - tslib: 2.6.3 - - safe-buffer@5.2.1: {} - - safer-buffer@2.1.2: {} - - scheduler@0.23.2: - dependencies: - loose-envify: 1.4.0 - - semver@6.3.1: {} - - semver@7.6.2: {} - - serialize-error@7.0.1: - dependencies: - type-fest: 0.13.1 - - set-blocking@2.0.0: {} - - shallowequal@1.1.0: {} - - signal-exit@3.0.7: {} - - signal-exit@4.1.0: {} - - slash@5.1.0: {} - - slice-ansi@5.0.0: - dependencies: - ansi-styles: 6.2.1 - is-fullwidth-code-point: 4.0.0 - - source-map-js@1.2.0: {} - - sprintf-js@1.0.3: {} - - stack-utils@2.0.6: - dependencies: - escape-string-regexp: 2.0.0 - - string-width@4.2.3: - dependencies: - emoji-regex: 8.0.0 - is-fullwidth-code-point: 3.0.0 - strip-ansi: 6.0.1 - - string-width@7.2.0: - dependencies: - emoji-regex: 10.3.0 - get-east-asian-width: 1.2.0 - strip-ansi: 7.1.0 - - string_decoder@1.3.0: - dependencies: - safe-buffer: 5.2.1 - - strip-ansi@6.0.1: - dependencies: - ansi-regex: 5.0.1 - - strip-ansi@7.1.0: - dependencies: - ansi-regex: 6.0.1 - - styled-components@6.1.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1): - dependencies: - '@emotion/is-prop-valid': 1.2.2 - '@emotion/unitless': 0.8.1 - '@types/stylis': 4.2.6 - css-to-react-native: 3.2.0 - csstype: 3.1.3 - postcss: 8.4.33 - react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) - shallowequal: 1.1.0 - stylis: 4.3.2 - tslib: 2.6.3 - - stylis@4.3.2: {} - - supertap@3.0.1: - dependencies: - indent-string: 5.0.0 - js-yaml: 3.14.1 - serialize-error: 7.0.1 - strip-ansi: 7.1.0 - - tar@6.2.1: - dependencies: - chownr: 2.0.0 - fs-minipass: 2.1.0 - minipass: 5.0.0 - minizlib: 2.1.2 - mkdirp: 1.0.4 - yallist: 4.0.0 - - temp-dir@3.0.0: {} - - time-zone@1.0.0: {} - - tmp@0.0.33: - dependencies: - os-tmpdir: 1.0.2 - - to-regex-range@5.0.1: - dependencies: - is-number: 7.0.0 - - toml@3.0.0: {} - - tr46@0.0.3: {} - - tslib@2.6.3: {} - - typanion@3.14.0: {} - - type-fest@0.13.1: {} - - type-fest@0.21.3: {} - - typescript@5.6.2: {} - - undici-types@6.19.8: {} - - unicorn-magic@0.1.0: {} - - universal-user-agent@7.0.2: {} - - util-deprecate@1.0.2: {} - - wasm-sjlj@1.0.5: {} - - webidl-conversions@3.0.1: {} - - well-known-symbols@2.0.0: {} - - whatwg-url@5.0.0: - dependencies: - tr46: 0.0.3 - webidl-conversions: 3.0.1 - - wide-align@1.1.5: - dependencies: - string-width: 4.2.3 - - wrap-ansi@6.2.0: - dependencies: - ansi-styles: 4.3.0 - string-width: 4.2.3 - strip-ansi: 6.0.1 - - wrap-ansi@7.0.0: - dependencies: - ansi-styles: 4.3.0 - string-width: 4.2.3 - strip-ansi: 6.0.1 - - wrappy@1.0.2: {} - - write-file-atomic@5.0.1: - dependencies: - imurmurhash: 0.1.4 - signal-exit: 4.1.0 - - y18n@5.0.8: {} - - yallist@4.0.0: {} - - yargs-parser@21.1.1: {} - - yargs@17.7.2: - dependencies: - cliui: 8.0.1 - escalade: 3.1.2 - get-caller-file: 2.0.5 - require-directory: 2.1.1 - string-width: 4.2.3 - y18n: 5.0.8 - yargs-parser: 21.1.1 - - yoctocolors-cjs@2.1.2: {} diff --git a/src/builtins.rs b/src/builtins.rs deleted file mode 100644 index 45a25117..00000000 --- a/src/builtins.rs +++ /dev/null @@ -1,71 +0,0 @@ -/// Node.js built-in modules -/// -/// `node -p "[...require('module').builtinModules].map(b => JSON.stringify(b)).join(',\n')"` -/// -pub const NODEJS_BUILTINS: &[&str] = &[ - "_http_agent", - "_http_client", - "_http_common", - "_http_incoming", - "_http_outgoing", - "_http_server", - "_stream_duplex", - "_stream_passthrough", - "_stream_readable", - "_stream_transform", - "_stream_wrap", - "_stream_writable", - "_tls_common", - "_tls_wrap", - "assert", - "assert/strict", - "async_hooks", - "buffer", - "child_process", - "cluster", - "console", - "constants", - "crypto", - "dgram", - "diagnostics_channel", - "dns", - "dns/promises", - "domain", - "events", - "fs", - "fs/promises", - "http", - "http2", - "https", - "inspector", - "module", - "net", - "os", - "path", - "path/posix", - "path/win32", - "perf_hooks", - "process", - "punycode", - "querystring", - "readline", - "repl", - "stream", - "stream/consumers", - "stream/promises", - "stream/web", - "string_decoder", - "sys", - "timers", - "timers/promises", - "tls", - "trace_events", - "tty", - "url", - "util", - "util/types", - "v8", - "vm", - "worker_threads", - "zlib", -]; diff --git a/src/cache.rs b/src/cache.rs deleted file mode 100644 index 6e600664..00000000 --- a/src/cache.rs +++ /dev/null @@ -1,354 +0,0 @@ -use once_cell::sync::OnceCell as OnceLock; -use std::{ - borrow::{Borrow, Cow}, - convert::AsRef, - hash::{BuildHasherDefault, Hash, Hasher}, - io, - ops::Deref, - path::{Path, PathBuf}, - sync::Arc, -}; - -use dashmap::{DashMap, DashSet}; -use rustc_hash::FxHasher; - -use crate::{ - context::ResolveContext as Ctx, package_json::PackageJson, path::PathUtil, FileMetadata, - FileSystem, ResolveError, ResolveOptions, TsConfig, -}; - -#[derive(Default)] -pub struct Cache { - pub(crate) fs: Fs, - paths: DashSet>, - tsconfigs: DashMap, BuildHasherDefault>, -} - -impl Cache { - pub fn new(fs: Fs) -> Self { - Self { fs, paths: DashSet::default(), tsconfigs: DashMap::default() } - } - - pub fn clear(&self) { - self.paths.clear(); - self.tsconfigs.clear(); - } - - pub fn value(&self, path: &Path) -> CachedPath { - let hash = { - let mut hasher = FxHasher::default(); - path.hash(&mut hasher); - hasher.finish() - }; - if let Some(cache_entry) = self.paths.get((hash, path).borrow() as &dyn CacheKey) { - return cache_entry.clone(); - } - let parent = path.parent().map(|p| self.value(p)); - let data = CachedPath(Arc::new(CachedPathImpl::new( - hash, - path.to_path_buf().into_boxed_path(), - parent, - ))); - self.paths.insert(data.clone()); - data - } - - pub fn tsconfig Result<(), ResolveError>>( - &self, - root: bool, - path: &Path, - callback: F, // callback for modifying tsconfig with `extends` - ) -> Result, ResolveError> { - if let Some(tsconfig_ref) = self.tsconfigs.get(path) { - return Ok(Arc::clone(tsconfig_ref.value())); - } - let meta = self.fs.metadata(path).ok(); - let tsconfig_path = if meta.is_some_and(|m| m.is_file) { - Cow::Borrowed(path) - } else if meta.is_some_and(|m| m.is_dir) { - Cow::Owned(path.join("tsconfig.json")) - } else { - let mut os_string = path.to_path_buf().into_os_string(); - os_string.push(".json"); - Cow::Owned(PathBuf::from(os_string)) - }; - let mut tsconfig_string = self - .fs - .read_to_string(&tsconfig_path) - .map_err(|_| ResolveError::TsconfigNotFound(path.to_path_buf()))?; - let mut tsconfig = - TsConfig::parse(root, &tsconfig_path, &mut tsconfig_string).map_err(|error| { - ResolveError::from_serde_json_error(tsconfig_path.to_path_buf(), &error) - })?; - callback(&mut tsconfig)?; - let tsconfig = Arc::new(tsconfig.build()); - self.tsconfigs.insert(path.to_path_buf(), Arc::clone(&tsconfig)); - Ok(tsconfig) - } -} - -#[derive(Clone)] -pub struct CachedPath(Arc); - -impl Hash for CachedPath { - fn hash(&self, state: &mut H) { - self.0.hash.hash(state); - } -} - -impl PartialEq for CachedPath { - fn eq(&self, other: &Self) -> bool { - self.0.path == other.0.path - } -} -impl Eq for CachedPath {} - -impl Deref for CachedPath { - type Target = CachedPathImpl; - - fn deref(&self) -> &Self::Target { - self.0.as_ref() - } -} - -impl<'a> Borrow for CachedPath { - fn borrow(&self) -> &(dyn CacheKey + 'a) { - self - } -} - -impl AsRef for CachedPath { - fn as_ref(&self) -> &CachedPathImpl { - self.0.as_ref() - } -} - -impl CacheKey for CachedPath { - fn tuple(&self) -> (u64, &Path) { - (self.hash, &self.path) - } -} - -pub struct CachedPathImpl { - hash: u64, - path: Box, - parent: Option, - meta: OnceLock>, - canonicalized: OnceLock>, - node_modules: OnceLock>, - package_json: OnceLock>>, -} - -impl CachedPathImpl { - fn new(hash: u64, path: Box, parent: Option) -> Self { - Self { - hash, - path, - parent, - meta: OnceLock::new(), - canonicalized: OnceLock::new(), - node_modules: OnceLock::new(), - package_json: OnceLock::new(), - } - } - - pub fn path(&self) -> &Path { - &self.path - } - - pub fn to_path_buf(&self) -> PathBuf { - self.path.to_path_buf() - } - - pub fn parent(&self) -> Option<&CachedPath> { - self.parent.as_ref() - } - - fn meta(&self, fs: &Fs) -> Option { - *self.meta.get_or_init(|| fs.metadata(&self.path).ok()) - } - - pub fn is_file(&self, fs: &Fs, ctx: &mut Ctx) -> bool { - if let Some(meta) = self.meta(fs) { - ctx.add_file_dependency(self.path()); - meta.is_file - } else { - ctx.add_missing_dependency(self.path()); - false - } - } - - pub fn is_dir(&self, fs: &Fs, ctx: &mut Ctx) -> bool { - self.meta(fs).map_or_else( - || { - ctx.add_missing_dependency(self.path()); - false - }, - |meta| meta.is_dir, - ) - } - - pub fn realpath(&self, fs: &Fs) -> io::Result { - self.canonicalized - .get_or_try_init(|| { - if fs.symlink_metadata(&self.path).is_ok_and(|m| m.is_symlink) { - return fs.canonicalize(&self.path).map(Some); - } - if let Some(parent) = self.parent() { - let parent_path = parent.realpath(fs)?; - return Ok(Some( - parent_path.normalize_with(self.path.strip_prefix(&parent.path).unwrap()), - )); - }; - Ok(None) - }) - .cloned() - .map(|r| r.unwrap_or_else(|| self.path.clone().to_path_buf())) - } - - pub fn module_directory( - &self, - module_name: &str, - cache: &Cache, - ctx: &mut Ctx, - ) -> Option { - let cached_path = cache.value(&self.path.join(module_name)); - cached_path.is_dir(&cache.fs, ctx).then_some(cached_path) - } - - pub fn cached_node_modules( - &self, - cache: &Cache, - ctx: &mut Ctx, - ) -> Option { - self.node_modules.get_or_init(|| self.module_directory("node_modules", cache, ctx)).clone() - } - - /// Find package.json of a path by traversing parent directories. - /// - /// # Errors - /// - /// * [ResolveError::JSON] - pub fn find_package_json( - &self, - fs: &Fs, - options: &ResolveOptions, - ctx: &mut Ctx, - ) -> Result>, ResolveError> { - let mut cache_value = self; - // Go up directories when the querying path is not a directory - while !cache_value.is_dir(fs, ctx) { - if let Some(cv) = &cache_value.parent { - cache_value = cv.as_ref(); - } else { - break; - } - } - let mut cache_value = Some(cache_value); - while let Some(cv) = cache_value { - if let Some(package_json) = cv.package_json(fs, options, ctx)? { - return Ok(Some(Arc::clone(&package_json))); - } - cache_value = cv.parent.as_deref(); - } - Ok(None) - } - - /// Get package.json of the given path. - /// - /// # Errors - /// - /// * [ResolveError::JSON] - pub fn package_json( - &self, - fs: &Fs, - options: &ResolveOptions, - ctx: &mut Ctx, - ) -> Result>, ResolveError> { - // Change to `std::sync::OnceLock::get_or_try_init` when it is stable. - let result = self - .package_json - .get_or_try_init(|| { - let package_json_path = self.path.join("package.json"); - let Ok(package_json_string) = fs.read_to_string(&package_json_path) else { - return Ok(None); - }; - let real_path = if options.symlinks { - self.realpath(fs)?.join("package.json") - } else { - package_json_path.clone() - }; - PackageJson::parse(package_json_path.clone(), real_path, &package_json_string) - .map(Arc::new) - .map(Some) - .map_err(|error| ResolveError::from_serde_json_error(package_json_path, &error)) - }) - .cloned(); - // https://github.com/webpack/enhanced-resolve/blob/58464fc7cb56673c9aa849e68e6300239601e615/lib/DescriptionFileUtils.js#L68-L82 - match &result { - Ok(Some(package_json)) => { - ctx.add_file_dependency(&package_json.path); - } - Ok(None) => { - // Avoid an allocation by making this lazy - if let Some(deps) = &mut ctx.missing_dependencies { - deps.push(self.path.join("package.json")); - } - } - Err(_) => { - if let Some(deps) = &mut ctx.file_dependencies { - deps.push(self.path.join("package.json")); - } - } - } - result - } -} - -/// Memoized cache key, code adapted from . -trait CacheKey { - fn tuple(&self) -> (u64, &Path); -} - -impl Hash for dyn CacheKey + '_ { - fn hash(&self, state: &mut H) { - self.tuple().0.hash(state); - } -} - -impl PartialEq for dyn CacheKey + '_ { - fn eq(&self, other: &Self) -> bool { - self.tuple().1 == other.tuple().1 - } -} - -impl Eq for dyn CacheKey + '_ {} - -impl<'a> CacheKey for (u64, &'a Path) { - fn tuple(&self) -> (u64, &Path) { - (self.0, self.1) - } -} - -impl<'a> Borrow for (u64, &'a Path) { - fn borrow(&self) -> &(dyn CacheKey + 'a) { - self - } -} - -/// Since the cache key is memoized, use an identity hasher -/// to avoid double cache. -#[derive(Default)] -struct IdentityHasher(u64); - -impl Hasher for IdentityHasher { - fn write(&mut self, _: &[u8]) { - unreachable!("Invalid use of IdentityHasher") - } - fn write_u64(&mut self, n: u64) { - self.0 = n; - } - fn finish(&self) -> u64 { - self.0 - } -} diff --git a/src/context.rs b/src/context.rs deleted file mode 100644 index 9349de30..00000000 --- a/src/context.rs +++ /dev/null @@ -1,89 +0,0 @@ -use std::{ - ops::{Deref, DerefMut}, - path::{Path, PathBuf}, -}; - -use crate::error::ResolveError; - -#[derive(Debug, Default, Clone)] -pub struct ResolveContext(ResolveContextImpl); - -#[derive(Debug, Default, Clone)] -pub struct ResolveContextImpl { - pub fully_specified: bool, - - pub query: Option, - - pub fragment: Option, - - /// Files that was found on file system - pub file_dependencies: Option>, - - /// Files that was found on file system - pub missing_dependencies: Option>, - - /// The current resolving alias for bailing recursion alias. - pub resolving_alias: Option, - - /// For avoiding infinite recursion, which will cause stack overflow. - depth: u8, -} - -impl Deref for ResolveContext { - type Target = ResolveContextImpl; - - fn deref(&self) -> &Self::Target { - &self.0 - } -} - -impl DerefMut for ResolveContext { - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} - -impl ResolveContext { - pub fn with_fully_specified(&mut self, yes: bool) { - self.fully_specified = yes; - } - - pub fn with_query_fragment(&mut self, query: Option<&str>, fragment: Option<&str>) { - if let Some(query) = query { - self.query.replace(query.to_string()); - } - if let Some(fragment) = fragment { - self.fragment.replace(fragment.to_string()); - } - } - - pub fn init_file_dependencies(&mut self) { - self.file_dependencies.replace(vec![]); - self.missing_dependencies.replace(vec![]); - } - - pub fn add_file_dependency(&mut self, dep: &Path) { - if let Some(deps) = &mut self.file_dependencies { - deps.push(dep.to_path_buf()); - } - } - - pub fn add_missing_dependency(&mut self, dep: &Path) { - if let Some(deps) = &mut self.missing_dependencies { - deps.push(dep.to_path_buf()); - } - } - - pub fn with_resolving_alias(&mut self, alias: String) { - self.resolving_alias = Some(alias); - } - - pub fn test_for_infinite_recursion(&mut self) -> Result<(), ResolveError> { - self.depth += 1; - // 64 should be more than enough for detecting infinite recursion. - if self.depth > 64 { - return Err(ResolveError::Recursion); - } - Ok(()) - } -} diff --git a/src/error.rs b/src/error.rs deleted file mode 100644 index b00a0ba8..00000000 --- a/src/error.rs +++ /dev/null @@ -1,182 +0,0 @@ -use std::{io, path::PathBuf, sync::Arc}; -use thiserror::Error; - -/// All resolution errors -/// -/// `thiserror` is used to display meaningful error messages. -#[derive(Debug, Clone, PartialEq, Error)] -pub enum ResolveError { - /// Ignored path - /// - /// Derived from ignored path (false value) from browser field in package.json - /// ```json - /// { - /// "browser": { - /// "./module": false - /// } - /// } - /// ``` - /// See - #[error("Path is ignored {0}")] - Ignored(PathBuf), - - /// Module not found - #[error("Cannot find module '{0}'")] - NotFound(/* specifier */ String), - - /// Matched alias value not found - #[error("Cannot find module '{0}' for matched aliased key '{1}'")] - MatchedAliasNotFound(/* specifier */ String, /* alias key */ String), - - /// Tsconfig not found - #[error("Tsconfig not found {0}")] - TsconfigNotFound(PathBuf), - - /// Tsconfig's project reference path points to it self - #[error("Tsconfig's project reference path points to this tsconfig {0}")] - TsconfigSelfReference(PathBuf), - - #[error("{0}")] - IOError(IOError), - - /// Node.js builtin modules - /// - /// This is an error due to not being a Node.js runtime. - /// The `alias` option can be used to resolve a builtin module to a polyfill. - #[error("Builtin module {0}")] - Builtin(String), - - /// All of the aliased extension are not found - #[error("All of the aliased extensions are not found for {0}")] - ExtensionAlias(PathBuf), - - /// The provided path specifier cannot be parsed - #[error("{0}")] - Specifier(SpecifierError), - - /// JSON parse error - #[error("{0:?}")] - JSON(JSONError), - - /// Restricted by `ResolveOptions::restrictions` - #[error(r#"Path "{0}" restricted by {0}"#)] - Restriction(PathBuf, PathBuf), - - #[error(r#"Invalid module "{0}" specifier is not a valid subpath for the "exports" resolution of {1}"#)] - InvalidModuleSpecifier(String, PathBuf), - - #[error(r#"Invalid "exports" target "{0}" defined for '{1}' in the package config {2}"#)] - InvalidPackageTarget(String, String, PathBuf), - - #[error(r#"Package subpath '{0}' is not defined by "exports" in {1}"#)] - PackagePathNotExported(String, PathBuf), - - #[error(r#"Invalid package config "{0}", "exports" cannot contain some keys starting with '.' and some not. The exports object must either be an object of package subpath keys or an object of main entry condition name keys only."#)] - InvalidPackageConfig(PathBuf), - - #[error(r#"Default condition should be last one in "{0}""#)] - InvalidPackageConfigDefault(PathBuf), - - #[error(r#"Expecting folder to folder mapping. "{0}" should end with "/"#)] - InvalidPackageConfigDirectory(PathBuf), - - #[error(r#"Package import specifier "{0}" is not defined in package {1}"#)] - PackageImportNotDefined(String, PathBuf), - - #[error("{0} is unimplemented")] - Unimplemented(&'static str), - - /// Occurs when alias paths reference each other. - #[error("Recursion in resolving")] - Recursion, -} - -impl ResolveError { - pub fn is_ignore(&self) -> bool { - matches!(self, Self::Ignored(_)) - } - - pub(crate) fn from_serde_json_error(path: PathBuf, error: &serde_json::Error) -> Self { - Self::JSON(JSONError { - path, - message: error.to_string(), - line: error.line(), - column: error.column(), - }) - } -} - -/// Error for [ResolveError::Specifier] -#[derive(Debug, Clone, Eq, PartialEq, Error)] -pub enum SpecifierError { - #[error("The specifiers must be a non-empty string. Received \"{0}\"")] - Empty(String), -} - -/// JSON error from [serde_json::Error] -#[derive(Debug, Clone, Eq, PartialEq)] -pub struct JSONError { - pub path: PathBuf, - pub message: String, - pub line: usize, - pub column: usize, -} - -#[derive(Debug, Clone, Error)] -#[error("{0}")] -pub struct IOError(Arc); - -impl PartialEq for IOError { - fn eq(&self, other: &Self) -> bool { - self.0.kind() == other.0.kind() - } -} - -impl From for io::Error { - fn from(error: IOError) -> Self { - let io_error = error.0.as_ref(); - Self::new(io_error.kind(), io_error.to_string()) - } -} - -impl From for ResolveError { - fn from(err: io::Error) -> Self { - Self::IOError(IOError(Arc::new(err))) - } -} - -#[test] -fn test_into_io_error() { - use std::io::{self, ErrorKind}; - let error_string = "IOError occurred"; - let string_error = io::Error::new(ErrorKind::Interrupted, error_string.to_string()); - let string_error2 = io::Error::new(ErrorKind::Interrupted, error_string.to_string()); - let resolve_io_error: ResolveError = ResolveError::from(string_error2); - - assert_eq!(resolve_io_error, ResolveError::from(string_error)); - assert_eq!(resolve_io_error.clone(), resolve_io_error); - let ResolveError::IOError(io_error) = resolve_io_error else { unreachable!() }; - assert_eq!( - format!("{io_error:?}"), - r#"IOError(Custom { kind: Interrupted, error: "IOError occurred" })"# - ); - // fix for https://github.com/web-infra-dev/rspack/issues/4564 - let std_io_error: io::Error = io_error.into(); - assert_eq!(std_io_error.kind(), ErrorKind::Interrupted); - assert_eq!(std_io_error.to_string(), error_string); - assert_eq!( - format!("{std_io_error:?}"), - r#"Custom { kind: Interrupted, error: "IOError occurred" }"# - ); -} - -#[test] -fn test_coverage() { - let error = ResolveError::NotFound("x".into()); - assert_eq!(format!("{error:?}"), r#"NotFound("x")"#); - assert_eq!(error.clone(), error); - - let error = ResolveError::Specifier(SpecifierError::Empty("x".into())); - assert_eq!(format!("{error:?}"), r#"Specifier(Empty("x"))"#); - assert_eq!(error.clone(), error); -} diff --git a/src/file_system.rs b/src/file_system.rs deleted file mode 100644 index d5f0ff8a..00000000 --- a/src/file_system.rs +++ /dev/null @@ -1,220 +0,0 @@ -use cfg_if::cfg_if; -use std::{ - fs, io, - path::{Path, PathBuf}, -}; - -#[cfg(feature = "yarn_pnp")] -use pnp::fs::{LruZipCache, VPath, VPathInfo, ZipCache}; - -/// File System abstraction used for `ResolverGeneric` -pub trait FileSystem: Send + Sync { - /// See [std::fs::read_to_string] - /// - /// # Errors - /// - /// * See [std::fs::read_to_string] - /// ## Warning - /// Use `&Path` instead of a generic `P: AsRef` here, - /// because object safety requirements, it is especially useful, when - /// you want to store multiple `dyn FileSystem` in a `Vec` or use a `ResolverGeneric` in - /// napi env. - fn read_to_string(&self, path: &Path) -> io::Result; - - /// See [std::fs::metadata] - /// - /// # Errors - /// See [std::fs::metadata] - /// ## Warning - /// Use `&Path` instead of a generic `P: AsRef` here, - /// because object safety requirements, it is especially useful, when - /// you want to store multiple `dyn FileSystem` in a `Vec` or use a `ResolverGeneric` in - /// napi env. - fn metadata(&self, path: &Path) -> io::Result; - - /// See [std::fs::symlink_metadata] - /// - /// # Errors - /// - /// See [std::fs::symlink_metadata] - /// ## Warning - /// Use `&Path` instead of a generic `P: AsRef` here, - /// because object safety requirements, it is especially useful, when - /// you want to store multiple `dyn FileSystem` in a `Vec` or use a `ResolverGeneric` in - /// napi env. - fn symlink_metadata(&self, path: &Path) -> io::Result; - - /// See [std::fs::canonicalize] - /// - /// # Errors - /// - /// See [std::fs::read_link] - /// ## Warning - /// Use `&Path` instead of a generic `P: AsRef` here, - /// because object safety requirements, it is especially useful, when - /// you want to store multiple `dyn FileSystem` in a `Vec` or use a `ResolverGeneric` in - /// napi env. - fn canonicalize(&self, path: &Path) -> io::Result; -} - -/// Metadata information about a file -#[derive(Debug, Clone, Copy)] -pub struct FileMetadata { - pub(crate) is_file: bool, - pub(crate) is_dir: bool, - pub(crate) is_symlink: bool, -} - -impl FileMetadata { - pub fn new(is_file: bool, is_dir: bool, is_symlink: bool) -> Self { - Self { is_file, is_dir, is_symlink } - } -} - -#[cfg(feature = "yarn_pnp")] -impl From for FileMetadata { - fn from(value: pnp::fs::FileType) -> Self { - Self::new(value == pnp::fs::FileType::File, value == pnp::fs::FileType::Directory, false) - } -} - -impl From for FileMetadata { - fn from(metadata: fs::Metadata) -> Self { - Self::new(metadata.is_file(), metadata.is_dir(), metadata.is_symlink()) - } -} - -/// Operating System -#[cfg(feature = "yarn_pnp")] -pub struct FileSystemOs { - pnp_lru: LruZipCache>, -} - -#[cfg(not(feature = "yarn_pnp"))] -pub struct FileSystemOs; - -impl Default for FileSystemOs { - fn default() -> Self { - cfg_if! { - if #[cfg(feature = "yarn_pnp")] { - Self { pnp_lru: LruZipCache::new(50, pnp::fs::open_zip_via_read_p) } - } else { - Self - } - } - } -} - -fn read_to_string(path: &Path) -> io::Result { - // `simdutf8` is faster than `std::str::from_utf8` which `fs::read_to_string` uses internally - let bytes = std::fs::read(path)?; - if simdutf8::basic::from_utf8(&bytes).is_err() { - // Same error as `fs::read_to_string` produces (`io::Error::INVALID_UTF8`) - return Err(io::Error::new( - io::ErrorKind::InvalidData, - "stream did not contain valid UTF-8", - )); - } - // SAFETY: `simdutf8` has ensured it's a valid UTF-8 string - Ok(unsafe { String::from_utf8_unchecked(bytes) }) -} - -impl FileSystem for FileSystemOs { - fn read_to_string(&self, path: &Path) -> io::Result { - cfg_if! { - if #[cfg(feature = "yarn_pnp")] { - match VPath::from(path)? { - VPath::Zip(info) => { - self.pnp_lru.read_to_string(info.physical_base_path(), info.zip_path) - } - VPath::Virtual(info) => read_to_string(&info.physical_base_path()), - VPath::Native(path) => read_to_string(&path), - } - } else { - read_to_string(path) - } - } - } - - fn metadata(&self, path: &Path) -> io::Result { - cfg_if! { - if #[cfg(feature = "yarn_pnp")] { - match VPath::from(path)? { - VPath::Zip(info) => self - .pnp_lru - .file_type(info.physical_base_path(), info.zip_path) - .map(FileMetadata::from), - VPath::Virtual(info) => { - fs::metadata(info.physical_base_path()).map(FileMetadata::from) - } - VPath::Native(path) => fs::metadata(path).map(FileMetadata::from), - } - } else { - fs::metadata(path).map(FileMetadata::from) - } - } - } - - fn symlink_metadata(&self, path: &Path) -> io::Result { - fs::symlink_metadata(path).map(FileMetadata::from) - } - - fn canonicalize(&self, path: &Path) -> io::Result { - cfg_if! { - if #[cfg(feature = "yarn_pnp")] { - match VPath::from(path)? { - VPath::Zip(info) => { - dunce::canonicalize(info.physical_base_path().join(info.zip_path)) - } - VPath::Virtual(info) => dunce::canonicalize(info.physical_base_path()), - VPath::Native(path) => dunce::canonicalize(path), - } - } else if #[cfg(windows)] { - dunce::canonicalize(path) - } else { - use std::path::Component; - let mut path_buf = path.to_path_buf(); - loop { - let link = fs::read_link(&path_buf)?; - path_buf.pop(); - for component in link.components() { - match component { - Component::ParentDir => { - path_buf.pop(); - } - Component::Normal(seg) => { - #[cfg(target_family = "wasm")] - // Need to trim the extra \0 introduces by https://github.com/nodejs/uvwasi/issues/262 - { - path_buf.push(seg.to_string_lossy().trim_end_matches('\0')); - } - #[cfg(not(target_family = "wasm"))] - { - path_buf.push(seg); - } - } - Component::RootDir => { - path_buf = PathBuf::from("/"); - } - Component::CurDir | Component::Prefix(_) => {} - } - } - if !fs::symlink_metadata(&path_buf)?.is_symlink() { - break; - } - } - Ok(path_buf) - } - } - } -} - -#[test] -fn metadata() { - let meta = FileMetadata { is_file: true, is_dir: true, is_symlink: true }; - assert_eq!( - format!("{meta:?}"), - "FileMetadata { is_file: true, is_dir: true, is_symlink: true }" - ); - let _ = meta; -} diff --git a/src/lib.rs b/src/lib.rs deleted file mode 100644 index e6cb2246..00000000 --- a/src/lib.rs +++ /dev/null @@ -1,1755 +0,0 @@ -//! # Oxc Resolver -//! -//! Node.js [CommonJS][cjs] and [ECMAScript][esm] Module Resolution. -//! -//! Released on [crates.io](https://crates.io/crates/oxc_resolver) and [npm](https://www.npmjs.com/package/oxc-resolver). -//! -//! A module resolution is the process of finding the file referenced by a module specifier in -//! `import "specifier"` or `require("specifier")`. -//! -//! All [configuration options](ResolveOptions) are aligned with webpack's [enhanced-resolve]. -//! -//! ## Terminology -//! -//! ### Specifier -//! -//! For [CommonJS modules][cjs], -//! the specifier is the string passed to the `require` function. e.g. `"id"` in `require("id")`. -//! -//! For [ECMAScript modules][esm], -//! the specifier of an `import` statement is the string after the `from` keyword, -//! e.g. `'specifier'` in `import 'specifier'` or `import { sep } from 'specifier'`. -//! Specifiers are also used in export from statements, and as the argument to an `import()` expression. -//! -//! This is also named "request" in some places. -//! -//! ## References: -//! -//! * Algorithm adapted from Node.js [CommonJS Module Resolution Algorithm] and [ECMAScript Module Resolution Algorithm]. -//! * Tests are ported from [enhanced-resolve]. -//! * Some code is adapted from [parcel-resolver]. -//! * The documentation is copied from [webpack's resolve configuration](https://webpack.js.org/configuration/resolve). -//! -//! [enhanced-resolve]: https://github.com/webpack/enhanced-resolve -//! [CommonJS Module Resolution Algorithm]: https://nodejs.org/api/modules.html#all-together -//! [ECMAScript Module Resolution Algorithm]: https://nodejs.org/api/esm.html#resolution-algorithm-specification -//! [parcel-resolver]: https://github.com/parcel-bundler/parcel/blob/v2/packages/utils/node-resolver-rs -//! [cjs]: https://nodejs.org/api/modules.html -//! [esm]: https://nodejs.org/api/esm.html -//! -//! ## Feature flags -#![cfg_attr(feature = "document-features", doc = document_features::document_features!())] -#![cfg_attr(docsrs, feature(doc_auto_cfg))] -//! -//! ## Example -//! -//! ```rust,ignore -#![doc = include_str!("../examples/resolver.rs")] -//! ``` - -mod builtins; -mod cache; -mod context; -mod error; -mod file_system; -mod options; -mod package_json; -mod path; -mod resolution; -mod specifier; -mod tsconfig; - -#[cfg(test)] -mod tests; - -use std::{ - borrow::Cow, - cmp::Ordering, - ffi::OsStr, - fmt, - path::{Component, Path, PathBuf}, - sync::Arc, -}; - -use rustc_hash::FxHashSet; -use serde_json::Value as JSONValue; - -pub use crate::{ - builtins::NODEJS_BUILTINS, - error::{JSONError, ResolveError, SpecifierError}, - file_system::{FileMetadata, FileSystem}, - options::{ - Alias, AliasValue, EnforceExtension, ResolveOptions, Restriction, TsconfigOptions, - TsconfigReferences, - }, - package_json::PackageJson, - resolution::Resolution, -}; -use crate::{ - cache::{Cache, CachedPath}, - context::ResolveContext as Ctx, - file_system::FileSystemOs, - package_json::JSONMap, - path::{PathUtil, SLASH_START}, - specifier::Specifier, - tsconfig::ExtendsField, - tsconfig::{ProjectReference, TsConfig}, -}; - -type ResolveResult = Result, ResolveError>; - -/// Context returned from the [Resolver::resolve_with_context] API -#[derive(Debug, Default, Clone)] -pub struct ResolveContext { - /// Files that was found on file system - pub file_dependencies: FxHashSet, - - /// Dependencies that was not found on file system - pub missing_dependencies: FxHashSet, -} - -/// Resolver with the current operating system as the file system -pub type Resolver = ResolverGeneric; - -/// Generic implementation of the resolver, can be configured by the [FileSystem] trait -pub struct ResolverGeneric { - options: ResolveOptions, - cache: Arc>, -} - -impl fmt::Debug for ResolverGeneric { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - self.options.fmt(f) - } -} - -impl Default for ResolverGeneric { - fn default() -> Self { - Self::new(ResolveOptions::default()) - } -} - -impl ResolverGeneric { - pub fn new(options: ResolveOptions) -> Self { - Self { options: options.sanitize(), cache: Arc::new(Cache::new(Fs::default())) } - } -} - -impl ResolverGeneric { - pub fn new_with_file_system(file_system: Fs, options: ResolveOptions) -> Self { - Self { cache: Arc::new(Cache::new(file_system)), options: options.sanitize() } - } - - /// Clone the resolver using the same underlying cache. - #[must_use] - pub fn clone_with_options(&self, options: ResolveOptions) -> Self { - Self { options: options.sanitize(), cache: Arc::clone(&self.cache) } - } - - /// Returns the options. - pub fn options(&self) -> &ResolveOptions { - &self.options - } - - /// Clear the underlying cache. - pub fn clear_cache(&self) { - self.cache.clear(); - } - - /// Resolve `specifier` at an absolute path to a `directory`. - /// - /// A specifier is the string passed to require or import, i.e. `require("specifier")` or `import "specifier"`. - /// - /// `directory` must be an **absolute** path to a directory where the specifier is resolved against. - /// For CommonJS modules, it is the `__dirname` variable that contains the absolute path to the folder containing current module. - /// For ECMAScript modules, it is the value of `import.meta.url`. - /// - /// # Errors - /// - /// * See [ResolveError] - pub fn resolve>( - &self, - directory: P, - specifier: &str, - ) -> Result { - let mut ctx = Ctx::default(); - self.resolve_tracing(directory.as_ref(), specifier, &mut ctx) - } - - /// Resolve `specifier` at absolute `path` with [ResolveContext] - /// - /// # Errors - /// - /// * See [ResolveError] - pub fn resolve_with_context>( - &self, - directory: P, - specifier: &str, - resolve_context: &mut ResolveContext, - ) -> Result { - let mut ctx = Ctx::default(); - ctx.init_file_dependencies(); - let result = self.resolve_tracing(directory.as_ref(), specifier, &mut ctx); - if let Some(deps) = &mut ctx.file_dependencies { - resolve_context.file_dependencies.extend(deps.drain(..)); - } - if let Some(deps) = &mut ctx.missing_dependencies { - resolve_context.missing_dependencies.extend(deps.drain(..)); - } - result - } - - /// Wrap `resolve_impl` with `tracing` information - fn resolve_tracing( - &self, - directory: &Path, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - let span = tracing::debug_span!("resolve", path = ?directory, specifier = specifier); - let _enter = span.enter(); - let r = self.resolve_impl(directory, specifier, ctx); - match &r { - Ok(r) => { - tracing::debug!(options = ?self.options, path = ?directory, specifier = specifier, ret = ?r.path); - } - Err(err) => { - tracing::debug!(options = ?self.options, path = ?directory, specifier = specifier, err = ?err); - } - }; - r - } - - fn resolve_impl( - &self, - path: &Path, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - ctx.with_fully_specified(self.options.fully_specified); - let cached_path = self.cache.value(path); - let cached_path = self.require(&cached_path, specifier, ctx)?; - let path = self.load_realpath(&cached_path)?; - // enhanced-resolve: restrictions - self.check_restrictions(&path)?; - let package_json = cached_path.find_package_json(&self.cache.fs, &self.options, ctx)?; - if let Some(package_json) = &package_json { - // path must be inside the package. - debug_assert!(path.starts_with(package_json.directory())); - } - Ok(Resolution { - path, - query: ctx.query.take(), - fragment: ctx.fragment.take(), - package_json, - }) - } - - /// require(X) from module at path Y - /// - /// X: specifier - /// Y: path - /// - /// - fn require( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - ctx.test_for_infinite_recursion()?; - - // enhanced-resolve: parse - let (parsed, try_fragment_as_path) = self.load_parse(cached_path, specifier, ctx)?; - if let Some(path) = try_fragment_as_path { - return Ok(path); - } - - self.require_without_parse(cached_path, parsed.path(), ctx) - } - - fn require_without_parse( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - // tsconfig-paths - if let Some(path) = self.load_tsconfig_paths(cached_path, specifier, &mut Ctx::default())? { - return Ok(path); - } - - // enhanced-resolve: try alias - if let Some(path) = self.load_alias(cached_path, specifier, &self.options.alias, ctx)? { - return Ok(path); - } - - let result = match Path::new(specifier).components().next() { - // 2. If X begins with '/' - Some(Component::RootDir | Component::Prefix(_)) => { - self.require_absolute(cached_path, specifier, ctx) - } - // 3. If X begins with './' or '/' or '../' - Some(Component::CurDir | Component::ParentDir) => { - self.require_relative(cached_path, specifier, ctx) - } - // 4. If X begins with '#' - Some(Component::Normal(_)) if specifier.as_bytes()[0] == b'#' => { - self.require_hash(cached_path, specifier, ctx) - } - _ => { - // 1. If X is a core module, - // a. return the core module - // b. STOP - self.require_core(specifier)?; - - // (ESM) 5. Otherwise, - // Note: specifier is now a bare specifier. - // Set resolved the result of PACKAGE_RESOLVE(specifier, parentURL). - self.require_bare(cached_path, specifier, ctx) - } - }; - - result.or_else(|err| { - if err.is_ignore() { - return Err(err); - } - // enhanced-resolve: try fallback - self.load_alias(cached_path, specifier, &self.options.fallback, ctx) - .and_then(|value| value.ok_or(err)) - }) - } - - // PACKAGE_RESOLVE(packageSpecifier, parentURL) - // 3. If packageSpecifier is a Node.js builtin module name, then - // 1. Return the string "node:" concatenated with packageSpecifier. - fn require_core(&self, specifier: &str) -> Result<(), ResolveError> { - if self.options.builtin_modules { - let starts_with_node = specifier.starts_with("node:"); - if starts_with_node || NODEJS_BUILTINS.binary_search(&specifier).is_ok() { - let mut specifier = specifier.to_string(); - if !starts_with_node { - specifier = format!("node:{specifier}"); - } - return Err(ResolveError::Builtin(specifier)); - } - } - Ok(()) - } - - fn require_absolute( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - // Make sure only path prefixes gets called - debug_assert!(Path::new(specifier) - .components() - .next() - .is_some_and(|c| matches!(c, Component::RootDir | Component::Prefix(_)))); - if !self.options.prefer_relative && self.options.prefer_absolute { - if let Ok(path) = self.load_package_self_or_node_modules(cached_path, specifier, ctx) { - return Ok(path); - } - } - if let Some(path) = self.load_roots(specifier, ctx) { - return Ok(path); - } - // 2. If X begins with '/' - // a. set Y to be the file system root - let path = self.cache.value(Path::new(specifier)); - if let Some(path) = self.load_as_file_or_directory(&path, specifier, ctx)? { - return Ok(path); - } - Err(ResolveError::NotFound(specifier.to_string())) - } - - // 3. If X begins with './' or '/' or '../' - fn require_relative( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - // Make sure only relative or normal paths gets called - debug_assert!(Path::new(specifier).components().next().is_some_and(|c| matches!( - c, - Component::CurDir | Component::ParentDir | Component::Normal(_) - ))); - let path = cached_path.path().normalize_with(specifier); - let cached_path = self.cache.value(&path); - // a. LOAD_AS_FILE(Y + X) - // b. LOAD_AS_DIRECTORY(Y + X) - if let Some(path) = self.load_as_file_or_directory(&cached_path, specifier, ctx)? { - return Ok(path); - } - // c. THROW "not found" - Err(ResolveError::NotFound(specifier.to_string())) - } - - fn require_hash( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - debug_assert_eq!(specifier.chars().next(), Some('#')); - // a. LOAD_PACKAGE_IMPORTS(X, dirname(Y)) - if let Some(path) = self.load_package_imports(cached_path, specifier, ctx)? { - return Ok(path); - } - self.load_package_self_or_node_modules(cached_path, specifier, ctx) - } - - fn require_bare( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - // Make sure no other path prefixes gets called - debug_assert!(Path::new(specifier) - .components() - .next() - .is_some_and(|c| matches!(c, Component::Normal(_)))); - if self.options.prefer_relative { - if let Ok(path) = self.require_relative(cached_path, specifier, ctx) { - return Ok(path); - } - } - self.load_package_self_or_node_modules(cached_path, specifier, ctx) - } - - /// enhanced-resolve: ParsePlugin. - /// - /// 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`. - /// - /// - fn load_parse<'s>( - &self, - cached_path: &CachedPath, - specifier: &'s str, - ctx: &mut Ctx, - ) -> Result<(Specifier<'s>, Option), ResolveError> { - let parsed = Specifier::parse(specifier).map_err(ResolveError::Specifier)?; - ctx.with_query_fragment(parsed.query, parsed.fragment); - - // There is an edge-case where a request with # can be a path or a fragment -> try both - if ctx.fragment.is_some() && ctx.query.is_none() { - let specifier = parsed.path(); - let fragment = ctx.fragment.take().unwrap(); - let path = format!("{specifier}{fragment}"); - if let Ok(path) = self.require_without_parse(cached_path, &path, ctx) { - return Ok((parsed, Some(path))); - } - ctx.fragment.replace(fragment); - } - Ok((parsed, None)) - } - - fn load_package_self_or_node_modules( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result { - let (_, subpath) = Self::parse_package_specifier(specifier); - if subpath.is_empty() { - ctx.with_fully_specified(false); - } - // 5. LOAD_PACKAGE_SELF(X, dirname(Y)) - if let Some(path) = self.load_package_self(cached_path, specifier, ctx)? { - return Ok(path); - } - // 6. LOAD_NODE_MODULES(X, dirname(Y)) - if let Some(path) = self.load_node_modules(cached_path, specifier, ctx)? { - return Ok(path); - } - // 7. THROW "not found" - Err(ResolveError::NotFound(specifier.to_string())) - } - - /// LOAD_PACKAGE_IMPORTS(X, DIR) - fn load_package_imports( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - // 1. Find the closest package scope SCOPE to DIR. - // 2. If no scope was found, return. - let Some(package_json) = - cached_path.find_package_json(&self.cache.fs, &self.options, ctx)? - else { - return Ok(None); - }; - // 3. If the SCOPE/package.json "imports" is null or undefined, return. - // 4. let MATCH = PACKAGE_IMPORTS_RESOLVE(X, pathToFileURL(SCOPE), ["node", "require"]) defined in the ESM resolver. - if let Some(path) = self.package_imports_resolve(specifier, &package_json, ctx)? { - // 5. RESOLVE_ESM_MATCH(MATCH). - return self.resolve_esm_match(specifier, &path, ctx); - } - Ok(None) - } - - fn load_as_file(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - // enhanced-resolve feature: extension_alias - if let Some(path) = self.load_extension_alias(cached_path, ctx)? { - return Ok(Some(path)); - } - if self.options.enforce_extension.is_disabled() { - // 1. If X is a file, load X as its file extension format. STOP - if let Some(path) = self.load_alias_or_file(cached_path, ctx)? { - return Ok(Some(path)); - } - } - // 2. If X.js is a file, load X.js as JavaScript text. STOP - // 3. If X.json is a file, parse X.json to a JavaScript Object. STOP - // 4. If X.node is a file, load X.node as binary addon. STOP - if let Some(path) = self.load_extensions(cached_path, &self.options.extensions, ctx)? { - return Ok(Some(path)); - } - Ok(None) - } - - fn load_as_directory(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - // TODO: Only package.json is supported, so warn about having other values - // Checking for empty files is needed for omitting checks on package.json - // 1. If X/package.json is a file, - if !self.options.description_files.is_empty() { - // a. Parse X/package.json, and look for "main" field. - if let Some(package_json) = - cached_path.package_json(&self.cache.fs, &self.options, ctx)? - { - // b. If "main" is a falsy value, GOTO 2. - for main_field in package_json.main_fields(&self.options.main_fields) { - // c. let M = X + (json main field) - let main_field_path = cached_path.path().normalize_with(main_field); - // d. LOAD_AS_FILE(M) - let cached_path = self.cache.value(&main_field_path); - if let Some(path) = self.load_as_file(&cached_path, ctx)? { - return Ok(Some(path)); - } - // e. LOAD_INDEX(M) - if let Some(path) = self.load_index(&cached_path, ctx)? { - return Ok(Some(path)); - } - } - // f. LOAD_INDEX(X) DEPRECATED - // g. THROW "not found" - } - } - // 2. LOAD_INDEX(X) - self.load_index(cached_path, ctx) - } - - fn load_as_file_or_directory( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - if self.options.resolve_to_context { - return Ok(cached_path.is_dir(&self.cache.fs, ctx).then(|| cached_path.clone())); - } - if !specifier.ends_with('/') { - if let Some(path) = self.load_as_file(cached_path, ctx)? { - return Ok(Some(path)); - } - } - if cached_path.is_dir(&self.cache.fs, ctx) { - if let Some(path) = self.load_as_directory(cached_path, ctx)? { - return Ok(Some(path)); - } - } - Ok(None) - } - - fn load_extensions( - &self, - path: &CachedPath, - extensions: &[String], - ctx: &mut Ctx, - ) -> ResolveResult { - if ctx.fully_specified { - return Ok(None); - } - let path = path.path().as_os_str(); - for extension in extensions { - let mut path_with_extension = path.to_os_string(); - path_with_extension.reserve_exact(extension.len()); - path_with_extension.push(extension); - let cached_path = self.cache.value(Path::new(&path_with_extension)); - if let Some(path) = self.load_alias_or_file(&cached_path, ctx)? { - return Ok(Some(path)); - } - } - Ok(None) - } - - fn load_realpath(&self, cached_path: &CachedPath) -> Result { - if self.options.symlinks { - cached_path.realpath(&self.cache.fs).map_err(ResolveError::from) - } else { - Ok(cached_path.to_path_buf()) - } - } - - fn check_restrictions(&self, path: &Path) -> Result<(), ResolveError> { - // https://github.com/webpack/enhanced-resolve/blob/a998c7d218b7a9ec2461fc4fddd1ad5dd7687485/lib/RestrictionsPlugin.js#L19-L24 - fn is_inside(path: &Path, parent: &Path) -> bool { - if !path.starts_with(parent) { - return false; - } - if path.as_os_str().len() == parent.as_os_str().len() { - return true; - } - path.strip_prefix(parent).is_ok_and(|p| p == Path::new("./")) - } - for restriction in &self.options.restrictions { - match restriction { - Restriction::Path(restricted_path) => { - if !is_inside(path, restricted_path) { - return Err(ResolveError::Restriction( - path.to_path_buf(), - restricted_path.clone(), - )); - } - } - Restriction::RegExp(_) => { - return Err(ResolveError::Unimplemented("Restriction with regex")) - } - } - } - Ok(()) - } - - fn load_index(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - for main_file in &self.options.main_files { - let main_path = cached_path.path().normalize_with(main_file); - let cached_path = self.cache.value(&main_path); - if self.options.enforce_extension.is_disabled() { - if let Some(path) = self.load_alias_or_file(&cached_path, ctx)? { - return Ok(Some(path)); - } - } - // 1. If X/index.js is a file, load X/index.js as JavaScript text. STOP - // 2. If X/index.json is a file, parse X/index.json to a JavaScript object. STOP - // 3. If X/index.node is a file, load X/index.node as binary addon. STOP - if let Some(path) = self.load_extensions(&cached_path, &self.options.extensions, ctx)? { - return Ok(Some(path)); - } - } - Ok(None) - } - - fn load_alias_or_file(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - if !self.options.alias_fields.is_empty() { - if let Some(package_json) = - cached_path.find_package_json(&self.cache.fs, &self.options, ctx)? - { - if let Some(path) = - self.load_browser_field(cached_path, None, &package_json, ctx)? - { - return Ok(Some(path)); - } - } - } - // enhanced-resolve: try file as alias - let alias_specifier = cached_path.path().to_string_lossy(); - if let Some(path) = - self.load_alias(cached_path, &alias_specifier, &self.options.alias, ctx)? - { - return Ok(Some(path)); - } - if cached_path.is_file(&self.cache.fs, ctx) { - return Ok(Some(cached_path.clone())); - } - Ok(None) - } - - fn load_node_modules( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - #[cfg(feature = "yarn_pnp")] - { - if let Some(resolved_path) = self.load_pnp(cached_path, specifier, ctx)? { - return Ok(Some(resolved_path)); - } - } - - let (package_name, subpath) = Self::parse_package_specifier(specifier); - // 1. let DIRS = NODE_MODULES_PATHS(START) - // 2. for each DIR in DIRS: - for module_name in &self.options.modules { - for cached_path in std::iter::successors(Some(cached_path), |p| p.parent()) { - // Skip if /path/to/node_modules does not exist - if !cached_path.is_dir(&self.cache.fs, ctx) { - continue; - } - - let Some(cached_path) = self.get_module_directory(cached_path, module_name, ctx) - else { - continue; - }; - // Optimize node_modules lookup by inspecting whether the package exists - // From LOAD_PACKAGE_EXPORTS(X, DIR) - // 1. Try to interpret X as a combination of NAME and SUBPATH where the name - // may have a @scope/ prefix and the subpath begins with a slash (`/`). - if !package_name.is_empty() { - let package_path = cached_path.path().normalize_with(package_name); - let cached_path = self.cache.value(&package_path); - // Try foo/node_modules/package_name - if cached_path.is_dir(&self.cache.fs, ctx) { - // a. LOAD_PACKAGE_EXPORTS(X, DIR) - if let Some(path) = - self.load_package_exports(specifier, subpath, &cached_path, ctx)? - { - return Ok(Some(path)); - } - } else { - // foo/node_modules/package_name is not a directory, so useless to check inside it - if !subpath.is_empty() { - continue; - } - // Skip if the directory lead to the scope package does not exist - // i.e. `foo/node_modules/@scope` is not a directory for `foo/node_modules/@scope/package` - if package_name.starts_with('@') { - if let Some(path) = cached_path.parent() { - if !path.is_dir(&self.cache.fs, ctx) { - continue; - } - } - } - } - } - - // Try as file or directory for all other cases - // b. LOAD_AS_FILE(DIR/X) - // c. LOAD_AS_DIRECTORY(DIR/X) - let node_module_file = cached_path.path().normalize_with(specifier); - let cached_path = self.cache.value(&node_module_file); - if let Some(path) = self.load_as_file_or_directory(&cached_path, specifier, ctx)? { - return Ok(Some(path)); - } - } - } - Ok(None) - } - - #[cfg(feature = "yarn_pnp")] - fn load_pnp( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> Result, ResolveError> { - let Some(pnp_manifest) = &self.options.pnp_manifest else { return Ok(None) }; - let resolution = - pnp::resolve_to_unqualified_via_manifest(pnp_manifest, specifier, cached_path.path()); - match resolution { - Ok(pnp::Resolution::Resolved(path, subpath)) => { - let cached_path = self.cache.value(&path); - let export_resolution = self.load_package_exports( - specifier, - &subpath.unwrap_or_default(), - &cached_path, - ctx, - )?; - if export_resolution.is_some() { - return Ok(export_resolution); - } - let file_or_directory_resolution = - self.load_as_file_or_directory(&cached_path, specifier, ctx)?; - if file_or_directory_resolution.is_some() { - return Ok(file_or_directory_resolution); - } - Err(ResolveError::NotFound(specifier.to_string())) - } - - Ok(pnp::Resolution::Skipped) => Ok(None), - - Err(_) => { - // Todo: Add a ResolveError::Pnp variant? - Err(ResolveError::NotFound(specifier.to_string())) - } - } - } - - fn get_module_directory( - &self, - cached_path: &CachedPath, - module_name: &str, - ctx: &mut Ctx, - ) -> Option { - if module_name == "node_modules" { - cached_path.cached_node_modules(&self.cache, ctx) - } else if cached_path.path().components().next_back() - == Some(Component::Normal(OsStr::new(module_name))) - { - Some(cached_path.clone()) - } else { - cached_path.module_directory(module_name, &self.cache, ctx) - } - } - - fn load_package_exports( - &self, - specifier: &str, - subpath: &str, - cached_path: &CachedPath, - ctx: &mut Ctx, - ) -> ResolveResult { - // 2. If X does not match this pattern or DIR/NAME/package.json is not a file, - // return. - let Some(package_json) = cached_path.package_json(&self.cache.fs, &self.options, ctx)? - else { - return Ok(None); - }; - // 3. Parse DIR/NAME/package.json, and look for "exports" field. - // 4. If "exports" is null or undefined, return. - // 5. let MATCH = PACKAGE_EXPORTS_RESOLVE(pathToFileURL(DIR/NAME), "." + SUBPATH, - // `package.json` "exports", ["node", "require"]) defined in the ESM resolver. - // Note: The subpath is not prepended with a dot on purpose - for exports in package_json.exports_fields(&self.options.exports_fields) { - if let Some(path) = self.package_exports_resolve( - cached_path.path(), - &format!(".{subpath}"), - exports, - ctx, - )? { - // 6. RESOLVE_ESM_MATCH(MATCH) - return self.resolve_esm_match(specifier, &path, ctx); - }; - } - Ok(None) - } - - fn load_package_self( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - // 1. Find the closest package scope SCOPE to DIR. - // 2. If no scope was found, return. - let Some(package_json) = - cached_path.find_package_json(&self.cache.fs, &self.options, ctx)? - else { - return Ok(None); - }; - // 3. If the SCOPE/package.json "exports" is null or undefined, return. - // 4. If the SCOPE/package.json "name" is not the first segment of X, return. - if let Some(subpath) = package_json - .name - .as_ref() - .and_then(|package_name| Self::strip_package_name(specifier, package_name)) - { - // 5. let MATCH = PACKAGE_EXPORTS_RESOLVE(pathToFileURL(SCOPE), - // "." + X.slice("name".length), `package.json` "exports", ["node", "require"]) - // defined in the ESM resolver. - let package_url = package_json.directory(); - // Note: The subpath is not prepended with a dot on purpose - // because `package_exports_resolve` matches subpath without the leading dot. - for exports in package_json.exports_fields(&self.options.exports_fields) { - if let Some(cached_path) = - self.package_exports_resolve(package_url, &format!(".{subpath}"), exports, ctx)? - { - // 6. RESOLVE_ESM_MATCH(MATCH) - return self.resolve_esm_match(specifier, &cached_path, ctx); - } - } - } - self.load_browser_field(cached_path, Some(specifier), &package_json, ctx) - } - - /// RESOLVE_ESM_MATCH(MATCH) - fn resolve_esm_match( - &self, - specifier: &str, - cached_path: &CachedPath, - ctx: &mut Ctx, - ) -> ResolveResult { - // 1. let RESOLVED_PATH = fileURLToPath(MATCH) - // 2. If the file at RESOLVED_PATH exists, load RESOLVED_PATH as its extension format. STOP - // - // Non-compliant ESM can result in a directory, so directory is tried as well. - if let Some(path) = self.load_as_file_or_directory(cached_path, "", ctx)? { - return Ok(Some(path)); - } - // 3. THROW "not found" - Err(ResolveError::NotFound(specifier.to_string())) - } - - /// enhanced-resolve: AliasFieldPlugin for [ResolveOptions::alias_fields] - fn load_browser_field( - &self, - cached_path: &CachedPath, - module_specifier: Option<&str>, - package_json: &PackageJson, - ctx: &mut Ctx, - ) -> ResolveResult { - let path = cached_path.path(); - let Some(new_specifier) = package_json.resolve_browser_field( - path, - module_specifier, - &self.options.alias_fields, - )? - else { - return Ok(None); - }; - // Abort when resolving recursive module - if module_specifier.is_some_and(|s| s == new_specifier) { - return Ok(None); - } - if ctx.resolving_alias.as_ref().is_some_and(|s| s == new_specifier) { - // Complete when resolving to self `{"./a.js": "./a.js"}` - if new_specifier.strip_prefix("./").filter(|s| path.ends_with(Path::new(s))).is_some() { - return if cached_path.is_file(&self.cache.fs, ctx) { - Ok(Some(cached_path.clone())) - } else { - Err(ResolveError::NotFound(new_specifier.to_string())) - }; - } - return Err(ResolveError::Recursion); - } - ctx.with_resolving_alias(new_specifier.to_string()); - ctx.with_fully_specified(false); - let cached_path = self.cache.value(package_json.directory()); - self.require(&cached_path, new_specifier, ctx).map(Some) - } - - /// enhanced-resolve: AliasPlugin for [ResolveOptions::alias] and [ResolveOptions::fallback]. - fn load_alias( - &self, - cached_path: &CachedPath, - specifier: &str, - aliases: &Alias, - ctx: &mut Ctx, - ) -> ResolveResult { - for (alias_key_raw, specifiers) in aliases { - let alias_key = if let Some(alias_key) = alias_key_raw.strip_suffix('$') { - if alias_key != specifier { - continue; - } - alias_key - } else { - let strip_package_name = Self::strip_package_name(specifier, alias_key_raw); - if strip_package_name.is_none() { - continue; - } - alias_key_raw - }; - // It should stop resolving when all of the tried alias values - // failed to resolve. - // - let mut should_stop = false; - for r in specifiers { - match r { - AliasValue::Path(alias_value) => { - if let Some(path) = self.load_alias_value( - cached_path, - alias_key, - alias_value, - specifier, - ctx, - &mut should_stop, - )? { - return Ok(Some(path)); - } - } - AliasValue::Ignore => { - let path = cached_path.path().normalize_with(alias_key); - return Err(ResolveError::Ignored(path)); - } - } - } - if should_stop { - return Err(ResolveError::MatchedAliasNotFound( - specifier.to_string(), - alias_key.to_string(), - )); - } - } - Ok(None) - } - - fn load_alias_value( - &self, - cached_path: &CachedPath, - alias_key: &str, - alias_value: &str, - request: &str, - ctx: &mut Ctx, - should_stop: &mut bool, - ) -> ResolveResult { - if request != alias_value - && !request.strip_prefix(alias_value).is_some_and(|prefix| prefix.starts_with('/')) - { - let tail = &request[alias_key.len()..]; - - let new_specifier = if tail.is_empty() { - Cow::Borrowed(alias_value) - } else { - let alias_value = Path::new(alias_value).normalize(); - // Must not append anything to alias_value if it is a file. - let alias_value_cached_path = self.cache.value(&alias_value); - if alias_value_cached_path.is_file(&self.cache.fs, ctx) { - return Ok(None); - } - - // Remove the leading slash so the final path is concatenated. - let tail = tail.trim_start_matches(SLASH_START); - let normalized = alias_value.normalize_with(tail); - Cow::Owned(normalized.to_string_lossy().to_string()) - }; - - *should_stop = true; - ctx.with_fully_specified(false); - return match self.require(cached_path, new_specifier.as_ref(), ctx) { - Err(ResolveError::NotFound(_) | ResolveError::MatchedAliasNotFound(_, _)) => { - Ok(None) - } - Ok(path) => return Ok(Some(path)), - Err(err) => return Err(err), - }; - } - Ok(None) - } - - /// Given an extension alias map `{".js": [".ts", ".js"]}`, - /// load the mapping instead of the provided extension - /// - /// This is an enhanced-resolve feature - /// - /// # Errors - /// - /// * [ResolveError::ExtensionAlias]: When all of the aliased extensions are not found - fn load_extension_alias(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult { - if self.options.extension_alias.is_empty() { - return Ok(None); - } - let Some(path_extension) = cached_path.path().extension() else { - return Ok(None); - }; - let Some((_, extensions)) = self - .options - .extension_alias - .iter() - .find(|(ext, _)| OsStr::new(ext.trim_start_matches('.')) == path_extension) - else { - return Ok(None); - }; - let path = cached_path.path().with_extension(""); - let path = path.as_os_str(); - ctx.with_fully_specified(true); - for extension in extensions { - let mut path_with_extension = path.to_os_string(); - path_with_extension.reserve_exact(extension.len()); - path_with_extension.push(extension); - let cached_path = self.cache.value(Path::new(&path_with_extension)); - // Bail if path is module directory such as `ipaddr.js` - if cached_path.is_dir(&self.cache.fs, ctx) { - ctx.with_fully_specified(false); - return Ok(None); - } - if let Some(path) = self.load_alias_or_file(&cached_path, ctx)? { - ctx.with_fully_specified(false); - return Ok(Some(path)); - } - } - Err(ResolveError::ExtensionAlias(cached_path.to_path_buf())) - } - - /// enhanced-resolve: RootsPlugin - /// - /// A list of directories where requests of server-relative URLs (starting with '/') are resolved, - /// defaults to context configuration option. - /// - /// On non-Windows systems these requests are resolved as an absolute path first. - fn load_roots(&self, specifier: &str, ctx: &mut Ctx) -> Option { - if self.options.roots.is_empty() { - return None; - } - if let Some(specifier) = specifier.strip_prefix(SLASH_START) { - for root in &self.options.roots { - let cached_path = self.cache.value(root); - if let Ok(path) = self.require_relative(&cached_path, specifier, ctx) { - return Some(path); - } - } - } - None - } - - fn load_tsconfig_paths( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - let Some(tsconfig_options) = &self.options.tsconfig else { - return Ok(None); - }; - let tsconfig = self.load_tsconfig( - /* root */ true, - &tsconfig_options.config_file, - &tsconfig_options.references, - )?; - let paths = tsconfig.resolve(cached_path.path(), specifier); - for path in paths { - let cached_path = self.cache.value(&path); - if let Ok(path) = self.require_relative(&cached_path, ".", ctx) { - return Ok(Some(path)); - } - } - Ok(None) - } - - fn load_tsconfig( - &self, - root: bool, - path: &Path, - references: &TsconfigReferences, - ) -> Result, ResolveError> { - self.cache.tsconfig(root, path, |tsconfig| { - let directory = self.cache.value(tsconfig.directory()); - tracing::trace!(tsconfig = ?tsconfig, "load_tsconfig"); - - // Extend tsconfig - if let Some(extends) = &tsconfig.extends { - let extended_tsconfig_paths = match extends { - ExtendsField::Single(s) => { - vec![self.get_extended_tsconfig_path(&directory, tsconfig, s)?] - } - ExtendsField::Multiple(specifiers) => specifiers - .iter() - .map(|s| self.get_extended_tsconfig_path(&directory, tsconfig, s)) - .collect::, ResolveError>>()?, - }; - for extended_tsconfig_path in extended_tsconfig_paths { - let extended_tsconfig = self.load_tsconfig( - /* root */ false, - &extended_tsconfig_path, - &TsconfigReferences::Disabled, - )?; - tsconfig.extend_tsconfig(&extended_tsconfig); - } - } - - // Load project references - match references { - TsconfigReferences::Disabled => { - tsconfig.references.drain(..); - } - TsconfigReferences::Auto => {} - TsconfigReferences::Paths(paths) => { - tsconfig.references = paths - .iter() - .map(|path| ProjectReference { path: path.clone(), tsconfig: None }) - .collect(); - } - } - if !tsconfig.references.is_empty() { - let directory = tsconfig.directory().to_path_buf(); - for reference in &mut tsconfig.references { - let reference_tsconfig_path = directory.normalize_with(&reference.path); - let tsconfig = self.cache.tsconfig( - /* root */ true, - &reference_tsconfig_path, - |reference_tsconfig| { - if reference_tsconfig.path == tsconfig.path { - return Err(ResolveError::TsconfigSelfReference( - reference_tsconfig.path.clone(), - )); - } - Ok(()) - }, - )?; - reference.tsconfig.replace(tsconfig); - } - } - Ok(()) - }) - } - - fn get_extended_tsconfig_path( - &self, - directory: &CachedPath, - tsconfig: &TsConfig, - specifier: &str, - ) -> Result { - match specifier.as_bytes().first() { - None => Err(ResolveError::Specifier(SpecifierError::Empty(specifier.to_string()))), - Some(b'/') => Ok(PathBuf::from(specifier)), - Some(b'.') => Ok(tsconfig.directory().normalize_with(specifier)), - _ => self - .clone_with_options(ResolveOptions { - description_files: vec![], - extensions: vec![".json".into()], - main_files: vec!["tsconfig.json".into()], - ..ResolveOptions::default() - }) - .load_package_self_or_node_modules(directory, specifier, &mut Ctx::default()) - .map(|p| p.to_path_buf()) - .map_err(|err| match err { - ResolveError::NotFound(_) => { - ResolveError::TsconfigNotFound(PathBuf::from(specifier)) - } - _ => err, - }), - } - } - - /// PACKAGE_RESOLVE(packageSpecifier, parentURL) - fn package_resolve( - &self, - cached_path: &CachedPath, - specifier: &str, - ctx: &mut Ctx, - ) -> ResolveResult { - let (package_name, subpath) = Self::parse_package_specifier(specifier); - - // 3. If packageSpecifier is a Node.js builtin module name, then - // 1. Return the string "node:" concatenated with packageSpecifier. - self.require_core(package_name)?; - - // 11. While parentURL is not the file system root, - for module_name in &self.options.modules { - for cached_path in std::iter::successors(Some(cached_path), |p| p.parent()) { - // 1. Let packageURL be the URL resolution of "node_modules/" concatenated with packageSpecifier, relative to parentURL. - let Some(cached_path) = self.get_module_directory(cached_path, module_name, ctx) - else { - continue; - }; - // 2. Set parentURL to the parent folder URL of parentURL. - let package_path = cached_path.path().normalize_with(package_name); - let cached_path = self.cache.value(&package_path); - // 3. If the folder at packageURL does not exist, then - // 1. Continue the next loop iteration. - if cached_path.is_dir(&self.cache.fs, ctx) { - // 4. Let pjson be the result of READ_PACKAGE_JSON(packageURL). - if let Some(package_json) = - cached_path.package_json(&self.cache.fs, &self.options, ctx)? - { - // 5. If pjson is not null and pjson.exports is not null or undefined, then - // 1. Return the result of PACKAGE_EXPORTS_RESOLVE(packageURL, packageSubpath, pjson.exports, defaultConditions). - for exports in package_json.exports_fields(&self.options.exports_fields) { - if let Some(path) = self.package_exports_resolve( - cached_path.path(), - &format!(".{subpath}"), - exports, - ctx, - )? { - return Ok(Some(path)); - } - } - // 6. Otherwise, if packageSubpath is equal to ".", then - if subpath == "." { - // 1. If pjson.main is a string, then - for main_field in package_json.main_fields(&self.options.main_fields) { - // 1. Return the URL resolution of main in packageURL. - let path = cached_path.path().normalize_with(main_field); - let cached_path = self.cache.value(&path); - if cached_path.is_file(&self.cache.fs, ctx) { - return Ok(Some(cached_path)); - } - } - } - } - let subpath = format!(".{subpath}"); - ctx.with_fully_specified(false); - return self.require(&cached_path, &subpath, ctx).map(Some); - } - } - } - - Err(ResolveError::NotFound(specifier.to_string())) - } - - /// PACKAGE_EXPORTS_RESOLVE(packageURL, subpath, exports, conditions) - fn package_exports_resolve( - &self, - package_url: &Path, - subpath: &str, - exports: &JSONValue, - ctx: &mut Ctx, - ) -> ResolveResult { - let conditions = &self.options.condition_names; - // 1. If exports is an Object with both a key starting with "." and a key not starting with ".", throw an Invalid Package Configuration error. - if let JSONValue::Object(map) = exports { - let mut has_dot = false; - let mut without_dot = false; - for key in map.keys() { - let starts_with_dot_or_hash = key.starts_with(['.', '#']); - has_dot = has_dot || starts_with_dot_or_hash; - without_dot = without_dot || !starts_with_dot_or_hash; - if has_dot && without_dot { - return Err(ResolveError::InvalidPackageConfig( - package_url.join("package.json"), - )); - } - } - } - // 2. If subpath is equal to ".", then - // Note: subpath is not prepended with a dot when passed in. - if subpath == "." { - // enhanced-resolve appends query and fragment when resolving exports field - // https://github.com/webpack/enhanced-resolve/blob/a998c7d218b7a9ec2461fc4fddd1ad5dd7687485/lib/ExportsFieldPlugin.js#L57-L62 - // This is only need when querying the main export, otherwise ctx is passed through. - if ctx.query.is_some() || ctx.fragment.is_some() { - let query = ctx.query.clone().unwrap_or_default(); - let fragment = ctx.fragment.clone().unwrap_or_default(); - return Err(ResolveError::PackagePathNotExported( - format!("./{}{query}{fragment}", subpath.trim_start_matches('.')), - package_url.join("package.json"), - )); - } - // 1. Let mainExport be undefined. - let main_export = match exports { - // 2. If exports is a String or Array, or an Object containing no keys starting with ".", then - JSONValue::String(_) | JSONValue::Array(_) => { - // 1. Set mainExport to exports. - Some(exports) - } - // 3. Otherwise if exports is an Object containing a "." property, then - JSONValue::Object(map) => { - // 1. Set mainExport to exports["."]. - map.get(".").map_or_else( - || { - if map.keys().any(|key| key.starts_with("./") || key.starts_with('#')) { - None - } else { - Some(exports) - } - }, - Some, - ) - } - _ => None, - }; - // 4. If mainExport is not undefined, then - if let Some(main_export) = main_export { - // 1. Let resolved be the result of PACKAGE_TARGET_RESOLVE( packageURL, mainExport, null, false, conditions). - let resolved = self.package_target_resolve( - package_url, - ".", - main_export, - None, - /* is_imports */ false, - conditions, - ctx, - )?; - // 2. If resolved is not null or undefined, return resolved. - if let Some(path) = resolved { - return Ok(Some(path)); - } - } - } - // 3. Otherwise, if exports is an Object and all keys of exports start with ".", then - if let JSONValue::Object(exports) = exports { - // 1. Let matchKey be the string "./" concatenated with subpath. - // Note: `package_imports_exports_resolve` does not require the leading dot. - let match_key = &subpath; - // 2. Let resolved be the result of PACKAGE_IMPORTS_EXPORTS_RESOLVE( matchKey, exports, packageURL, false, conditions). - if let Some(path) = self.package_imports_exports_resolve( - match_key, - exports, - package_url, - /* is_imports */ false, - conditions, - ctx, - )? { - // 3. If resolved is not null or undefined, return resolved. - return Ok(Some(path)); - } - } - // 4. Throw a Package Path Not Exported error. - Err(ResolveError::PackagePathNotExported( - subpath.to_string(), - package_url.join("package.json"), - )) - } - - /// PACKAGE_IMPORTS_RESOLVE(specifier, parentURL, conditions) - fn package_imports_resolve( - &self, - specifier: &str, - package_json: &PackageJson, - ctx: &mut Ctx, - ) -> Result, ResolveError> { - // 1. Assert: specifier begins with "#". - debug_assert!(specifier.starts_with('#'), "{specifier}"); - // 2. If specifier is exactly equal to "#" or starts with "#/", then - // 1. Throw an Invalid Module Specifier error. - // 3. Let packageURL be the result of LOOKUP_PACKAGE_SCOPE(parentURL). - // 4. If packageURL is not null, then - - // 1. Let pjson be the result of READ_PACKAGE_JSON(packageURL). - // 2. If pjson.imports is a non-null Object, then - - // 1. Let resolved be the result of PACKAGE_IMPORTS_EXPORTS_RESOLVE( specifier, pjson.imports, packageURL, true, conditions). - let mut has_imports = false; - for imports in package_json.imports_fields(&self.options.imports_fields) { - if !has_imports { - has_imports = true; - // TODO: fill in test case for this case - if specifier == "#" || specifier.starts_with("#/") { - return Err(ResolveError::InvalidModuleSpecifier( - specifier.to_string(), - package_json.path.clone(), - )); - } - } - if let Some(path) = self.package_imports_exports_resolve( - specifier, - imports, - package_json.directory(), - /* is_imports */ true, - &self.options.condition_names, - ctx, - )? { - // 2. If resolved is not null or undefined, return resolved. - return Ok(Some(path)); - } - } - - // 5. Throw a Package Import Not Defined error. - if has_imports { - Err(ResolveError::PackageImportNotDefined( - specifier.to_string(), - package_json.path.clone(), - )) - } else { - Ok(None) - } - } - - /// PACKAGE_IMPORTS_EXPORTS_RESOLVE(matchKey, matchObj, packageURL, isImports, conditions) - fn package_imports_exports_resolve( - &self, - match_key: &str, - match_obj: &JSONMap, - package_url: &Path, - is_imports: bool, - conditions: &[String], - ctx: &mut Ctx, - ) -> ResolveResult { - // enhanced-resolve behaves differently, it throws - // Error: CachedPath to directories is not possible with the exports field (specifier was ./dist/) - if match_key.ends_with('/') { - return Ok(None); - } - // 1. If matchKey is a key of matchObj and does not contain "*", then - if !match_key.contains('*') { - // 1. Let target be the value of matchObj[matchKey]. - if let Some(target) = match_obj.get(match_key) { - // 2. Return the result of PACKAGE_TARGET_RESOLVE(packageURL, target, null, isImports, conditions). - return self.package_target_resolve( - package_url, - match_key, - target, - None, - is_imports, - conditions, - ctx, - ); - } - } - - let mut best_target = None; - let mut best_match = ""; - let mut best_key = ""; - // 2. Let expansionKeys be the list of keys of matchObj containing only a single "*", sorted by the sorting function PATTERN_KEY_COMPARE which orders in descending order of specificity. - // 3. For each key expansionKey in expansionKeys, do - for (expansion_key, target) in match_obj { - if expansion_key.starts_with("./") || expansion_key.starts_with('#') { - // 1. Let patternBase be the substring of expansionKey up to but excluding the first "*" character. - if let Some((pattern_base, pattern_trailer)) = expansion_key.split_once('*') { - // 2. If matchKey starts with but is not equal to patternBase, then - if match_key.starts_with(pattern_base) - // 1. Let patternTrailer be the substring of expansionKey from the index after the first "*" character. - && !pattern_trailer.contains('*') - // 2. If patternTrailer has zero length, or if matchKey ends with patternTrailer and the length of matchKey is greater than or equal to the length of expansionKey, then - && (pattern_trailer.is_empty() - || (match_key.len() >= expansion_key.len() - && match_key.ends_with(pattern_trailer))) - && Self::pattern_key_compare(best_key, expansion_key).is_gt() - { - // 1. Let target be the value of matchObj[expansionKey]. - best_target = Some(target); - // 2. Let patternMatch be the substring of matchKey starting at the index of the length of patternBase up to the length of matchKey minus the length of patternTrailer. - best_match = - &match_key[pattern_base.len()..match_key.len() - pattern_trailer.len()]; - best_key = expansion_key; - } - } else if expansion_key.ends_with('/') - && match_key.starts_with(expansion_key) - && Self::pattern_key_compare(best_key, expansion_key).is_gt() - { - // TODO: [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./dist/" in the "exports" field module resolution of the package at xxx/package.json. - best_target = Some(target); - best_match = &match_key[expansion_key.len()..]; - best_key = expansion_key; - } - } - } - if let Some(best_target) = best_target { - // 3. Return the result of PACKAGE_TARGET_RESOLVE(packageURL, target, patternMatch, isImports, conditions). - return self.package_target_resolve( - package_url, - best_key, - best_target, - Some(best_match), - is_imports, - conditions, - ctx, - ); - } - // 4. Return null. - Ok(None) - } - - /// PACKAGE_TARGET_RESOLVE(packageURL, target, patternMatch, isImports, conditions) - #[allow(clippy::too_many_arguments)] - fn package_target_resolve( - &self, - package_url: &Path, - target_key: &str, - target: &JSONValue, - pattern_match: Option<&str>, - is_imports: bool, - conditions: &[String], - ctx: &mut Ctx, - ) -> ResolveResult { - fn normalize_string_target<'a>( - target_key: &'a str, - target: &'a str, - pattern_match: Option<&'a str>, - package_url: &Path, - ) -> Result, ResolveError> { - let target = if let Some(pattern_match) = pattern_match { - if !target_key.contains('*') && !target.contains('*') { - // enhanced-resolve behaviour - // TODO: [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./dist/" in the "exports" field module resolution of the package at xxx/package.json. - if target_key.ends_with('/') && target.ends_with('/') { - Cow::Owned(format!("{target}{pattern_match}")) - } else { - return Err(ResolveError::InvalidPackageConfigDirectory( - package_url.join("package.json"), - )); - } - } else { - Cow::Owned(target.replace('*', pattern_match)) - } - } else { - Cow::Borrowed(target) - }; - Ok(target) - } - - match target { - // 1. If target is a String, then - JSONValue::String(target) => { - // 1. If target does not start with "./", then - if !target.starts_with("./") { - // 1. If isImports is false, or if target starts with "../" or "/", or if target is a valid URL, then - if !is_imports || target.starts_with("../") || target.starts_with('/') { - // 1. Throw an Invalid Package Target error. - return Err(ResolveError::InvalidPackageTarget( - target.to_string(), - target_key.to_string(), - package_url.join("package.json"), - )); - } - // 2. If patternMatch is a String, then - // 1. Return PACKAGE_RESOLVE(target with every instance of "*" replaced by patternMatch, packageURL + "/"). - let target = - normalize_string_target(target_key, target, pattern_match, package_url)?; - let package_url = self.cache.value(package_url); - // // 3. Return PACKAGE_RESOLVE(target, packageURL + "/"). - return self.package_resolve(&package_url, &target, ctx); - } - - // 2. If target split on "/" or "\" contains any "", ".", "..", or "node_modules" segments after the first "." segment, case insensitive and including percent encoded variants, throw an Invalid Package Target error. - // 3. Let resolvedTarget be the URL resolution of the concatenation of packageURL and target. - // 4. Assert: resolvedTarget is contained in packageURL. - // 5. If patternMatch is null, then - let target = - normalize_string_target(target_key, target, pattern_match, package_url)?; - if Path::new(target.as_ref()).is_invalid_exports_target() { - return Err(ResolveError::InvalidPackageTarget( - target.to_string(), - target_key.to_string(), - package_url.join("package.json"), - )); - } - let resolved_target = package_url.normalize_with(target.as_ref()); - // 6. If patternMatch split on "/" or "\" contains any "", ".", "..", or "node_modules" segments, case insensitive and including percent encoded variants, throw an Invalid Module Specifier error. - // 7. Return the URL resolution of resolvedTarget with every instance of "*" replaced with patternMatch. - let value = self.cache.value(&resolved_target); - return Ok(Some(value)); - } - // 2. Otherwise, if target is a non-null Object, then - JSONValue::Object(target) => { - // 1. If exports contains any index property keys, as defined in ECMA-262 6.1.7 Array Index, throw an Invalid Package Configuration error. - // 2. For each property p of target, in object insertion order as, - for (key, target_value) in target { - // 1. If p equals "default" or conditions contains an entry for p, then - if key == "default" || conditions.contains(key) { - // 1. Let targetValue be the value of the p property in target. - // 2. Let resolved be the result of PACKAGE_TARGET_RESOLVE( packageURL, targetValue, patternMatch, isImports, conditions). - let resolved = self.package_target_resolve( - package_url, - target_key, - target_value, - pattern_match, - is_imports, - conditions, - ctx, - ); - // 3. If resolved is equal to undefined, continue the loop. - if let Some(path) = resolved? { - // 4. Return resolved. - return Ok(Some(path)); - } - } - } - // 3. Return undefined. - return Ok(None); - } - // 3. Otherwise, if target is an Array, then - JSONValue::Array(targets) => { - // 1. If _target.length is zero, return null. - if targets.is_empty() { - // Note: return PackagePathNotExported has the same effect as return because there are no matches. - return Err(ResolveError::PackagePathNotExported( - pattern_match.unwrap_or(".").to_string(), - package_url.join("package.json"), - )); - } - // 2. For each item targetValue in target, do - for (i, target_value) in targets.iter().enumerate() { - // 1. Let resolved be the result of PACKAGE_TARGET_RESOLVE( packageURL, targetValue, patternMatch, isImports, conditions), continuing the loop on any Invalid Package Target error. - let resolved = self.package_target_resolve( - package_url, - target_key, - target_value, - pattern_match, - is_imports, - conditions, - ctx, - ); - - if resolved.is_err() && i == targets.len() { - return resolved; - } - - // 2. If resolved is undefined, continue the loop. - if let Ok(Some(path)) = resolved { - // 3. Return resolved. - return Ok(Some(path)); - } - } - // 3. Return or throw the last fallback resolution null return or error. - // Note: see `resolved.is_err() && i == targets.len()` - } - _ => {} - } - // 4. Otherwise, if target is null, return null. - Ok(None) - // 5. Otherwise throw an Invalid Package Target error. - } - - // Returns (module, subpath) - // https://github.com/nodejs/node/blob/8f0f17e1e3b6c4e58ce748e06343c5304062c491/lib/internal/modules/esm/resolve.js#L688 - fn parse_package_specifier(specifier: &str) -> (&str, &str) { - let mut separator_index = specifier.as_bytes().iter().position(|b| *b == b'/'); - // let mut valid_package_name = true; - // let mut is_scoped = false; - if specifier.starts_with('@') { - // is_scoped = true; - if separator_index.is_none() || specifier.is_empty() { - // valid_package_name = false; - } else if let Some(index) = &separator_index { - separator_index = specifier[*index + 1..] - .as_bytes() - .iter() - .position(|b| *b == b'/') - .map(|i| i + *index + 1); - } - } - let package_name = - separator_index.map_or(specifier, |separator_index| &specifier[..separator_index]); - - // TODO: https://github.com/nodejs/node/blob/8f0f17e1e3b6c4e58ce748e06343c5304062c491/lib/internal/modules/esm/resolve.js#L705C1-L714C1 - // Package name cannot have leading . and cannot have percent-encoding or - // \\ separators. - // if (RegExpPrototypeExec(invalidPackageNameRegEx, packageName) !== null) - // validPackageName = false; - - // if (!validPackageName) { - // throw new ERR_INVALID_MODULE_SPECIFIER( - // specifier, 'is not a valid package name', fileURLToPath(base)); - // } - let package_subpath = - separator_index.map_or("", |separator_index| &specifier[separator_index..]); - (package_name, package_subpath) - } - - /// PATTERN_KEY_COMPARE(keyA, keyB) - fn pattern_key_compare(key_a: &str, key_b: &str) -> Ordering { - if key_a.is_empty() { - return Ordering::Greater; - } - // 1. Assert: keyA ends with "/" or contains only a single "*". - debug_assert!(key_a.ends_with('/') || key_a.match_indices('*').count() == 1, "{key_a}"); - // 2. Assert: keyB ends with "/" or contains only a single "*". - debug_assert!(key_b.ends_with('/') || key_b.match_indices('*').count() == 1, "{key_b}"); - // 3. Let baseLengthA be the index of "*" in keyA plus one, if keyA contains "*", or the length of keyA otherwise. - let a_pos = key_a.chars().position(|c| c == '*'); - let base_length_a = a_pos.map_or(key_a.len(), |p| p + 1); - // 4. Let baseLengthB be the index of "*" in keyB plus one, if keyB contains "*", or the length of keyB otherwise. - let b_pos = key_b.chars().position(|c| c == '*'); - let base_length_b = b_pos.map_or(key_b.len(), |p| p + 1); - // 5. If baseLengthA is greater than baseLengthB, return -1. - if base_length_a > base_length_b { - return Ordering::Less; - } - // 6. If baseLengthB is greater than baseLengthA, return 1. - if base_length_b > base_length_a { - return Ordering::Greater; - } - // 7. If keyA does not contain "*", return 1. - if !key_a.contains('*') { - return Ordering::Greater; - } - // 8. If keyB does not contain "*", return -1. - if !key_b.contains('*') { - return Ordering::Less; - } - // 9. If the length of keyA is greater than the length of keyB, return -1. - if key_a.len() > key_b.len() { - return Ordering::Less; - } - // 10. If the length of keyB is greater than the length of keyA, return 1. - if key_b.len() > key_a.len() { - return Ordering::Greater; - } - // 11. Return 0. - Ordering::Equal - } - - fn strip_package_name<'a>(specifier: &'a str, package_name: &'a str) -> Option<&'a str> { - specifier - .strip_prefix(package_name) - .filter(|tail| tail.is_empty() || tail.starts_with(SLASH_START)) - } -} diff --git a/src/options.rs b/src/options.rs deleted file mode 100644 index 7893890e..00000000 --- a/src/options.rs +++ /dev/null @@ -1,633 +0,0 @@ -use std::path::Path; -use std::{fmt, path::PathBuf}; - -/// Module Resolution Options -/// -/// Options are directly ported from [enhanced-resolve](https://github.com/webpack/enhanced-resolve#resolver-options). -/// -/// See [webpack resolve](https://webpack.js.org/configuration/resolve/) for information and examples -#[derive(Debug, Clone)] -pub struct ResolveOptions { - /// Path to TypeScript configuration file. - /// - /// Default `None` - pub tsconfig: Option, - - /// Create aliases to import or require certain modules more easily. - /// - /// An alias is used to replace a whole path or part of a path. - /// For example, to alias a commonly used `src/` folders: `vec![("@/src"), vec![AliasValue::Path("/path/to/src")]]` - /// - /// A trailing $ can also be added to the given object's keys to signify an exact match. - /// - /// See [webpack's `resolve.alias` documentation](https://webpack.js.org/configuration/resolve/#resolvealias) for a list of use cases. - pub alias: Alias, - - /// A list of alias fields in description files. - /// - /// Specify a field, such as `browser`, to be parsed according to [this specification](https://github.com/defunctzombie/package-browser-field-spec). - /// Can be a path to json object such as `["path", "to", "exports"]`. - /// - /// Default `[]` - pub alias_fields: Vec>, - - /// Condition names for exports field which defines entry points of a package. - /// - /// The key order in the exports field is significant. During condition matching, earlier entries have higher priority and take precedence over later entries. - /// - /// Default `[]` - pub condition_names: Vec, - - /// The JSON files to use for descriptions. (There was once a `bower.json`.) - /// - /// Default `["package.json"]` - pub description_files: Vec, - - /// Set to [EnforceExtension::Enabled] for [ESM Mandatory file extensions](https://nodejs.org/api/esm.html#mandatory-file-extensions). - /// - /// If `enforce_extension` is set to [EnforceExtension::Enabled], resolution will not allow extension-less files. - /// This means `require('./foo.js')` will resolve, while `require('./foo')` will not. - /// - /// The default value for `enforce_extension` is [EnforceExtension::Auto], which is changed upon initialization. - /// - /// It changes to [EnforceExtension::Enabled] if [ResolveOptions::extensions] contains an empty string; - /// otherwise, this value changes to [EnforceExtension::Disabled]. - /// - /// Explicitly set the value to [EnforceExtension::Disabled] to disable this automatic behavior. - /// - /// For reference, this behavior is aligned with `enhanced-resolve`. See . - pub enforce_extension: EnforceExtension, - - /// A list of exports fields in description files. - /// - /// Can be a path to a JSON object such as `["path", "to", "exports"]`. - /// - /// Default `[["exports"]]`. - pub exports_fields: Vec>, - - /// Fields from `package.json` which are used to provide the internal requests of a package - /// (requests starting with # are considered internal). - /// - /// Can be a path to a JSON object such as `["path", "to", "imports"]`. - /// - /// Default `[["imports"]]`. - pub imports_fields: Vec>, - - /// An object which maps extension to extension aliases. - /// - /// Default `{}` - pub extension_alias: Vec<(String, Vec)>, - - /// Attempt to resolve these extensions in order. - /// - /// If multiple files share the same name but have different extensions, - /// will resolve the one with the extension listed first in the array and skip the rest. - /// - /// All extensions must have a leading dot. - /// - /// Default `[".js", ".json", ".node"]` - pub extensions: Vec, - - /// Redirect module requests when normal resolving fails. - /// - /// Default `[]` - pub fallback: Alias, - - /// 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). - /// - /// See also webpack configuration [resolve.fullySpecified](https://webpack.js.org/configuration/module/#resolvefullyspecified) - /// - /// Default `false` - pub fully_specified: bool, - - /// A list of main fields in description files - /// - /// Default `["main"]`. - pub main_fields: Vec, - - /// The filename to be used while resolving directories. - /// - /// Default `["index"]` - pub main_files: Vec, - - /// A list of directories to resolve modules from, can be absolute path or folder name. - /// - /// Default `["node_modules"]` - pub modules: Vec, - - /// A manifest loaded from pnp::load_pnp_manifest. - /// - /// Default `None` - #[cfg(feature = "yarn_pnp")] - pub pnp_manifest: Option, - - /// Resolve to a context instead of a file. - /// - /// Default `false` - pub resolve_to_context: bool, - - /// Prefer to resolve module requests as relative requests instead of using modules from node_modules directories. - /// - /// Default `false` - pub prefer_relative: bool, - - /// Prefer to resolve server-relative urls as absolute paths before falling back to resolve in ResolveOptions::roots. - /// - /// Default `false` - pub prefer_absolute: bool, - - /// A list of resolve restrictions to restrict the paths that a request can be resolved on. - /// - /// Default `[]` - pub restrictions: Vec, - - /// A list of directories where requests of server-relative URLs (starting with '/') are resolved. - /// On non-Windows systems these requests are resolved as an absolute path first. - /// - /// Default `[]` - pub roots: Vec, - - /// Whether to resolve symlinks to their symlinked location. - /// When enabled, symlinked resources are resolved to their real path, not their symlinked location. - /// Note that this may cause module resolution to fail when using tools that symlink packages (like npm link). - /// - /// Default `true` - pub symlinks: bool, - - /// Whether to parse [module.builtinModules](https://nodejs.org/api/module.html#modulebuiltinmodules) or not. - /// For example, "zlib" will throw [crate::ResolveError::Builtin] when set to true. - /// - /// Default `false` - pub builtin_modules: bool, -} - -impl ResolveOptions { - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// - /// let options = ResolveOptions::default().with_condition_names(&["bar"]); - /// assert_eq!(options.condition_names, vec!["bar".to_string()]) - /// ``` - #[must_use] - pub fn with_condition_names(mut self, names: &[&str]) -> Self { - self.condition_names = names.iter().map(ToString::to_string).collect::>(); - self - } - - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// - /// let options = ResolveOptions::default().with_builtin_modules(false); - /// assert_eq!(options.builtin_modules, false) - /// ``` - #[must_use] - pub fn with_builtin_modules(mut self, flag: bool) -> Self { - self.builtin_modules = flag; - self - } - - /// Adds a single root to the options - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_root("foo"); - /// assert_eq!(options.roots, vec![PathBuf::from("foo")]) - /// ``` - #[must_use] - pub fn with_root>(mut self, root: P) -> Self { - self.roots.push(root.as_ref().to_path_buf()); - self - } - - /// Adds a single extension to the list of extensions - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_extension("jsonc"); - /// assert!(options.extensions.contains(&"jsonc".to_string())); - /// ``` - #[must_use] - pub fn with_extension>(mut self, extension: S) -> Self { - self.extensions.push(extension.into()); - self - } - - /// Adds a single main field to the list of fields - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::ResolveOptions; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_main_field("something"); - /// assert!(options.main_fields.contains(&"something".to_string())); - /// ``` - #[must_use] - pub fn with_main_field>(mut self, field: S) -> Self { - self.main_fields.push(field.into()); - self - } - - /// Changes how the extension should be treated - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions, EnforceExtension}; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_force_extension(EnforceExtension::Enabled); - /// assert_eq!(options.enforce_extension, EnforceExtension::Enabled); - /// ``` - #[must_use] - pub fn with_force_extension(mut self, enforce_extension: EnforceExtension) -> Self { - self.enforce_extension = enforce_extension; - self - } - - /// Sets the value for [ResolveOptions::fully_specified] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_fully_specified(true); - /// assert_eq!(options.fully_specified, true); - /// ``` - #[must_use] - pub fn with_fully_specified(mut self, fully_specified: bool) -> Self { - self.fully_specified = fully_specified; - self - } - /// Sets the value for [ResolveOptions::prefer_relative] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_prefer_relative(true); - /// assert_eq!(options.prefer_relative, true); - /// ``` - #[must_use] - pub fn with_prefer_relative(mut self, flag: bool) -> Self { - self.prefer_relative = flag; - self - } - /// Sets the value for [ResolveOptions::prefer_absolute] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// use std::path::{Path, PathBuf}; - /// - /// let options = ResolveOptions::default().with_prefer_absolute(true); - /// assert_eq!(options.prefer_absolute, true); - /// ``` - #[must_use] - pub fn with_prefer_absolute(mut self, flag: bool) -> Self { - self.prefer_absolute = flag; - self - } - - /// Changes the value of [ResolveOptions::symlinks] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// - /// let options = ResolveOptions::default().with_symbolic_link(false); - /// assert_eq!(options.symlinks, false); - /// ``` - #[must_use] - pub fn with_symbolic_link(mut self, flag: bool) -> Self { - self.symlinks = flag; - self - } - - /// Adds a module to [ResolveOptions::modules] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// - /// let options = ResolveOptions::default().with_module("module"); - /// assert!(options.modules.contains(&"module".to_string())); - /// ``` - #[must_use] - pub fn with_module>(mut self, module: M) -> Self { - self.modules.push(module.into()); - self - } - - /// Adds a main file to [ResolveOptions::main_files] - /// - /// ## Examples - /// - /// ``` - /// use oxc_resolver::{ResolveOptions}; - /// - /// let options = ResolveOptions::default().with_main_file("foo"); - /// assert!(options.main_files.contains(&"foo".to_string())); - /// ``` - #[must_use] - pub fn with_main_file>(mut self, module: M) -> Self { - self.main_files.push(module.into()); - self - } - - pub(crate) fn sanitize(mut self) -> Self { - debug_assert!( - self.extensions.iter().filter(|e| !e.is_empty()).all(|e| e.starts_with('.')), - "All extensions must start with a leading dot" - ); - // Set `enforceExtension` to `true` when [ResolveOptions::extensions] contains an empty string. - // See - if self.enforce_extension == EnforceExtension::Auto { - if !self.extensions.is_empty() && self.extensions.iter().any(String::is_empty) { - self.enforce_extension = EnforceExtension::Enabled; - } else { - self.enforce_extension = EnforceExtension::Disabled; - } - } - self - } -} - -/// Value for [ResolveOptions::enforce_extension] -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -pub enum EnforceExtension { - Auto, - Enabled, - Disabled, -} - -impl EnforceExtension { - pub const fn is_auto(&self) -> bool { - matches!(self, Self::Auto) - } - - pub const fn is_enabled(&self) -> bool { - matches!(self, Self::Enabled) - } - - pub const fn is_disabled(&self) -> bool { - matches!(self, Self::Disabled) - } -} - -/// Alias for [ResolveOptions::alias] and [ResolveOptions::fallback] -pub type Alias = Vec<(String, Vec)>; - -/// Alias Value for [ResolveOptions::alias] and [ResolveOptions::fallback] -#[derive(Debug, Clone, Hash, PartialEq, Eq)] -pub enum AliasValue { - /// The path value - Path(String), - - /// The `false` value - Ignore, -} - -impl From for AliasValue -where - S: Into, -{ - fn from(value: S) -> Self { - Self::Path(value.into()) - } -} - -/// Value for [ResolveOptions::restrictions] -#[derive(Debug, Clone)] -pub enum Restriction { - Path(PathBuf), - RegExp(String), -} - -/// Tsconfig Options for [ResolveOptions::tsconfig] -/// -/// Derived from [tsconfig-paths-webpack-plugin](https://github.com/dividab/tsconfig-paths-webpack-plugin#options) -#[derive(Debug, Clone)] -pub struct TsconfigOptions { - /// Allows you to specify where to find the TypeScript configuration file. - /// You may provide - /// * a relative path to the configuration file. It will be resolved relative to cwd. - /// * an absolute path to the configuration file. - pub config_file: PathBuf, - - /// Support for Typescript Project References. - pub references: TsconfigReferences, -} - -/// Configuration for [TsconfigOptions::references] -#[derive(Debug, Clone)] -pub enum TsconfigReferences { - Disabled, - /// Use the `references` field from tsconfig of `config_file`. - Auto, - /// Manually provided relative or absolute path. - Paths(Vec), -} - -impl Default for ResolveOptions { - fn default() -> Self { - Self { - tsconfig: None, - alias: vec![], - alias_fields: vec![], - condition_names: vec![], - description_files: vec!["package.json".into()], - enforce_extension: EnforceExtension::Auto, - extension_alias: vec![], - exports_fields: vec![vec!["exports".into()]], - imports_fields: vec![vec!["imports".into()]], - extensions: vec![".js".into(), ".json".into(), ".node".into()], - fallback: vec![], - fully_specified: false, - main_fields: vec!["main".into()], - main_files: vec!["index".into()], - modules: vec!["node_modules".into()], - #[cfg(feature = "yarn_pnp")] - pnp_manifest: None, - resolve_to_context: false, - prefer_relative: false, - prefer_absolute: false, - restrictions: vec![], - roots: vec![], - symlinks: true, - builtin_modules: false, - } - } -} - -// For tracing -impl fmt::Display for ResolveOptions { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - if let Some(tsconfig) = &self.tsconfig { - write!(f, "tsconfig:{tsconfig:?},")?; - } - if !self.alias.is_empty() { - write!(f, "alias:{:?},", self.alias)?; - } - if !self.alias_fields.is_empty() { - write!(f, "alias_fields:{:?},", self.alias_fields)?; - } - if !self.condition_names.is_empty() { - write!(f, "condition_names:{:?},", self.condition_names)?; - } - if self.enforce_extension.is_enabled() { - write!(f, "enforce_extension:{:?},", self.enforce_extension)?; - } - if !self.exports_fields.is_empty() { - write!(f, "exports_fields:{:?},", self.exports_fields)?; - } - if !self.imports_fields.is_empty() { - write!(f, "imports_fields:{:?},", self.imports_fields)?; - } - if !self.extension_alias.is_empty() { - write!(f, "extension_alias:{:?},", self.extension_alias)?; - } - if !self.extensions.is_empty() { - write!(f, "extensions:{:?},", self.extensions)?; - } - if !self.fallback.is_empty() { - write!(f, "fallback:{:?},", self.fallback)?; - } - if self.fully_specified { - write!(f, "fully_specified:{:?},", self.fully_specified)?; - } - if !self.main_fields.is_empty() { - write!(f, "main_fields:{:?},", self.main_fields)?; - } - if !self.main_files.is_empty() { - write!(f, "main_files:{:?},", self.main_files)?; - } - if !self.modules.is_empty() { - write!(f, "modules:{:?},", self.modules)?; - } - if self.resolve_to_context { - write!(f, "resolve_to_context:{:?},", self.resolve_to_context)?; - } - if self.prefer_relative { - write!(f, "prefer_relative:{:?},", self.prefer_relative)?; - } - if self.prefer_absolute { - write!(f, "prefer_absolute:{:?},", self.prefer_absolute)?; - } - if !self.restrictions.is_empty() { - write!(f, "restrictions:{:?},", self.restrictions)?; - } - if !self.roots.is_empty() { - write!(f, "roots:{:?},", self.roots)?; - } - if self.symlinks { - write!(f, "symlinks:{:?},", self.symlinks)?; - } - if self.builtin_modules { - write!(f, "builtin_modules:{:?},", self.builtin_modules)?; - } - Ok(()) - } -} - -#[cfg(test)] -mod test { - use super::{ - AliasValue, EnforceExtension, ResolveOptions, Restriction, TsconfigOptions, - TsconfigReferences, - }; - use std::path::PathBuf; - - #[test] - fn enforce_extension() { - assert!(EnforceExtension::Auto.is_auto()); - assert!(!EnforceExtension::Enabled.is_auto()); - assert!(!EnforceExtension::Disabled.is_auto()); - - assert!(!EnforceExtension::Auto.is_enabled()); - assert!(EnforceExtension::Enabled.is_enabled()); - assert!(!EnforceExtension::Disabled.is_enabled()); - - assert!(!EnforceExtension::Auto.is_disabled()); - assert!(!EnforceExtension::Enabled.is_disabled()); - assert!(EnforceExtension::Disabled.is_disabled()); - } - - #[test] - fn display() { - let options = ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: PathBuf::from("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - alias: vec![("a".into(), vec![AliasValue::Ignore])], - alias_fields: vec![vec!["browser".into()]], - condition_names: vec!["require".into()], - enforce_extension: EnforceExtension::Enabled, - extension_alias: vec![(".js".into(), vec![".ts".into()])], - exports_fields: vec![vec!["exports".into()]], - imports_fields: vec![vec!["imports".into()]], - fallback: vec![("fallback".into(), vec![AliasValue::Ignore])], - fully_specified: true, - resolve_to_context: true, - prefer_relative: true, - prefer_absolute: true, - restrictions: vec![Restriction::Path(PathBuf::from("restrictions"))], - roots: vec![PathBuf::from("roots")], - builtin_modules: true, - ..ResolveOptions::default() - }; - - let expected = r#"tsconfig:TsconfigOptions { config_file: "tsconfig.json", references: Auto },alias:[("a", [Ignore])],alias_fields:[["browser"]],condition_names:["require"],enforce_extension:Enabled,exports_fields:[["exports"]],imports_fields:[["imports"]],extension_alias:[(".js", [".ts"])],extensions:[".js", ".json", ".node"],fallback:[("fallback", [Ignore])],fully_specified:true,main_fields:["main"],main_files:["index"],modules:["node_modules"],resolve_to_context:true,prefer_relative:true,prefer_absolute:true,restrictions:[Path("restrictions")],roots:["roots"],symlinks:true,builtin_modules:true,"#; - assert_eq!(format!("{options}"), expected); - - let options = ResolveOptions { - alias: vec![], - alias_fields: vec![], - builtin_modules: false, - condition_names: vec![], - description_files: vec![], - enforce_extension: EnforceExtension::Disabled, - exports_fields: vec![], - extension_alias: vec![], - extensions: vec![], - fallback: vec![], - fully_specified: false, - imports_fields: vec![], - main_fields: vec![], - main_files: vec![], - modules: vec![], - #[cfg(feature = "yarn_pnp")] - pnp_manifest: None, - prefer_absolute: false, - prefer_relative: false, - resolve_to_context: false, - restrictions: vec![], - roots: vec![], - symlinks: false, - tsconfig: None, - }; - - assert_eq!(format!("{options}"), ""); - } -} diff --git a/src/package_json.rs b/src/package_json.rs deleted file mode 100644 index 7e05d202..00000000 --- a/src/package_json.rs +++ /dev/null @@ -1,219 +0,0 @@ -//! package.json definitions -//! -//! Code related to export field are copied from [Parcel's resolver](https://github.com/parcel-bundler/parcel/blob/v2/packages/utils/node-resolver-rs/src/package_json.rs) -use std::path::{Path, PathBuf}; - -use serde_json::Value as JSONValue; - -use crate::{path::PathUtil, ResolveError}; - -pub type JSONMap = serde_json::Map; - -/// Deserialized package.json -#[derive(Debug, Default)] -pub struct PackageJson { - /// Path to `package.json`. Contains the `package.json` filename. - pub path: PathBuf, - - /// Realpath to `package.json`. Contains the `package.json` filename. - pub realpath: PathBuf, - - /// The "name" field defines your package's name. - /// The "name" field can be used in addition to the "exports" field to self-reference a package using its name. - /// - /// - pub name: Option, - - /// The "type" field. - /// - /// - pub r#type: Option, - - /// The "sideEffects" field. - /// - /// - pub side_effects: Option, - - raw_json: std::sync::Arc, -} - -impl PackageJson { - /// # Panics - /// # Errors - pub(crate) fn parse( - path: PathBuf, - realpath: PathBuf, - json: &str, - ) -> Result { - let mut raw_json: JSONValue = serde_json::from_str(json)?; - let mut package_json = Self::default(); - - if let Some(json_object) = raw_json.as_object_mut() { - // Remove large fields that are useless for pragmatic use. - #[cfg(feature = "package_json_raw_json_api")] - { - json_object.remove("description"); - json_object.remove("keywords"); - json_object.remove("scripts"); - json_object.remove("dependencies"); - json_object.remove("devDependencies"); - json_object.remove("peerDependencies"); - json_object.remove("optionalDependencies"); - } - - // Add name, type and sideEffects. - package_json.name = - json_object.get("name").and_then(|field| field.as_str()).map(ToString::to_string); - package_json.r#type = json_object.get("type").cloned(); - package_json.side_effects = json_object.get("sideEffects").cloned(); - } - - package_json.path = path; - package_json.realpath = realpath; - package_json.raw_json = std::sync::Arc::new(raw_json); - Ok(package_json) - } - - fn get_value_by_path<'a>( - fields: &'a serde_json::Map, - path: &[String], - ) -> Option<&'a JSONValue> { - if path.is_empty() { - return None; - } - let mut value = fields.get(&path[0])?; - for key in path.iter().skip(1) { - if let Some(inner_value) = value.as_object().and_then(|o| o.get(key)) { - value = inner_value; - } else { - return None; - } - } - Some(value) - } - - /// Raw serde json value of `package.json`. - /// - /// This is currently used in Rspack for: - /// * getting the `sideEffects` field - /// * query in - search on GitHub indicates query on the `type` field. - /// - /// To reduce overall memory consumption, large fields that useless for pragmatic use are removed. - /// They are: `description`, `keywords`, `scripts`, - /// `dependencies` and `devDependencies`, `peerDependencies`, `optionalDependencies`. - #[cfg(feature = "package_json_raw_json_api")] - pub fn raw_json(&self) -> &std::sync::Arc { - &self.raw_json - } - - /// Directory to `package.json` - /// - /// # Panics - /// - /// * When the package.json path is misconfigured. - pub fn directory(&self) -> &Path { - debug_assert!(self.realpath.file_name().is_some_and(|x| x == "package.json")); - self.realpath.parent().unwrap() - } - - /// The "main" field defines the entry point of a package when imported by name via a node_modules lookup. Its value is a path. - /// - /// When a package has an "exports" field, this will take precedence over the "main" field when importing the package by name. - /// - /// Values are dynamically retrieved from [ResolveOptions::main_fields]. - /// - /// - pub(crate) fn main_fields<'a>( - &'a self, - main_fields: &'a [String], - ) -> impl Iterator + '_ { - main_fields - .iter() - .filter_map(|main_field| self.raw_json.get(main_field)) - .filter_map(|value| value.as_str()) - } - - /// The "exports" field allows defining the entry points of a package when imported by name loaded either via a node_modules lookup or a self-reference to its own name. - /// - /// - pub(crate) fn exports_fields<'a>( - &'a self, - exports_fields: &'a [Vec], - ) -> impl Iterator + '_ { - exports_fields.iter().filter_map(|object_path| { - self.raw_json - .as_object() - .and_then(|json_object| Self::get_value_by_path(json_object, object_path)) - }) - } - - /// In addition to the "exports" field, there is a package "imports" field to create private mappings that only apply to import specifiers from within the package itself. - /// - /// - pub(crate) fn imports_fields<'a>( - &'a self, - imports_fields: &'a [Vec], - ) -> impl Iterator + '_ { - imports_fields.iter().filter_map(|object_path| { - self.raw_json - .as_object() - .and_then(|json_object| Self::get_value_by_path(json_object, object_path)) - .and_then(|value| value.as_object()) - }) - } - - /// The "browser" field is provided by a module author as a hint to javascript bundlers or component tools when packaging modules for client side use. - /// Multiple values are configured by [ResolveOptions::alias_fields]. - /// - /// - fn browser_fields<'a>( - &'a self, - alias_fields: &'a [Vec], - ) -> impl Iterator + '_ { - alias_fields.iter().filter_map(|object_path| { - self.raw_json - .as_object() - .and_then(|json_object| Self::get_value_by_path(json_object, object_path)) - // Only object is valid, all other types are invalid - // https://github.com/webpack/enhanced-resolve/blob/3a28f47788de794d9da4d1702a3a583d8422cd48/lib/AliasFieldPlugin.js#L44-L52 - .and_then(|value| value.as_object()) - }) - } - - /// Resolve the request string for this package.json by looking at the `browser` field. - /// - /// # Errors - /// - /// * Returns [ResolveError::Ignored] for `"path": false` in `browser` field. - pub(crate) fn resolve_browser_field<'a>( - &'a self, - path: &Path, - request: Option<&str>, - alias_fields: &'a [Vec], - ) -> Result, ResolveError> { - for object in self.browser_fields(alias_fields) { - if let Some(request) = request { - if let Some(value) = object.get(request) { - return Self::alias_value(path, value); - } - } else { - let dir = self.path.parent().unwrap(); - for (key, value) in object { - let joined = dir.normalize_with(key); - if joined == path { - return Self::alias_value(path, value); - } - } - } - } - Ok(None) - } - - fn alias_value<'a>(key: &Path, value: &'a JSONValue) -> Result, ResolveError> { - match value { - JSONValue::String(value) => Ok(Some(value.as_str())), - JSONValue::Bool(b) if !b => Err(ResolveError::Ignored(key.to_path_buf())), - _ => Ok(None), - } - } -} diff --git a/src/path.rs b/src/path.rs deleted file mode 100644 index f66fdd76..00000000 --- a/src/path.rs +++ /dev/null @@ -1,132 +0,0 @@ -//! Path Utilities -//! -//! Code adapted from the following libraries -//! * [path-absolutize](https://docs.rs/path-absolutize) -//! * [normalize_path](https://docs.rs/normalize-path) -use std::path::{Component, Path, PathBuf}; - -pub const SLASH_START: &[char; 2] = &['/', '\\']; - -/// Extension trait to add path normalization to std's [`Path`]. -pub trait PathUtil { - /// Normalize this path without performing I/O. - /// - /// All redundant separator and up-level references are collapsed. - /// - /// However, this does not resolve links. - fn normalize(&self) -> PathBuf; - - /// Normalize with subpath assuming this path is normalized without performing I/O. - /// - /// All redundant separator and up-level references are collapsed. - /// - /// However, this does not resolve links. - fn normalize_with>(&self, subpath: P) -> PathBuf; - - /// Defined in ESM PACKAGE_TARGET_RESOLVE - /// If target split on "/" or "\" contains any "", ".", "..", or "node_modules" segments after the first "." segment, case insensitive and including percent encoded variants - fn is_invalid_exports_target(&self) -> bool; -} - -impl PathUtil for Path { - // https://github.com/parcel-bundler/parcel/blob/e0b99c2a42e9109a9ecbd6f537844a1b33e7faf5/packages/utils/node-resolver-rs/src/path.rs#L7 - fn normalize(&self) -> PathBuf { - let mut components = self.components().peekable(); - let mut ret = if let Some(c @ Component::Prefix(..)) = components.peek() { - let buf = PathBuf::from(c.as_os_str()); - components.next(); - buf - } else { - PathBuf::new() - }; - - for component in components { - match component { - Component::Prefix(..) => unreachable!("Path {:?}", self), - Component::RootDir => { - ret.push(component.as_os_str()); - } - Component::CurDir => {} - Component::ParentDir => { - ret.pop(); - } - Component::Normal(c) => { - ret.push(c); - } - } - } - - ret - } - - // https://github.com/parcel-bundler/parcel/blob/e0b99c2a42e9109a9ecbd6f537844a1b33e7faf5/packages/utils/node-resolver-rs/src/path.rs#L37 - fn normalize_with>(&self, subpath: B) -> PathBuf { - let subpath = subpath.as_ref(); - - let mut components = subpath.components(); - - let Some(head) = components.next() else { return subpath.to_path_buf() }; - - if matches!(head, Component::Prefix(..) | Component::RootDir) { - return subpath.to_path_buf(); - } - - let mut ret = self.to_path_buf(); - for component in std::iter::once(head).chain(components) { - match component { - Component::CurDir => {} - Component::ParentDir => { - ret.pop(); - } - Component::Normal(c) => { - ret.push(c); - } - Component::Prefix(..) | Component::RootDir => { - unreachable!("Path {:?} Subpath {:?}", self, subpath) - } - } - } - - ret - } - - fn is_invalid_exports_target(&self) -> bool { - self.components().enumerate().any(|(index, c)| match c { - Component::ParentDir => true, - Component::CurDir => index > 0, - Component::Normal(c) => c.eq_ignore_ascii_case("node_modules"), - _ => false, - }) - } -} - -// https://github.com/webpack/enhanced-resolve/blob/main/test/path.test.js -#[test] -fn is_invalid_exports_target() { - let test_cases = [ - "../a.js", - "../", - "./a/b/../../../c.js", - "./a/b/../../../", - "./../../c.js", - "./../../", - "./a/../b/../../c.js", - "./a/../b/../../", - "./././../", - ]; - - for case in test_cases { - assert!(Path::new(case).is_invalid_exports_target(), "{case}"); - } - - assert!(!Path::new("C:").is_invalid_exports_target()); - assert!(!Path::new("/").is_invalid_exports_target()); -} - -#[test] -fn normalize() { - assert_eq!(Path::new("/foo/.././foo/").normalize(), Path::new("/foo")); - assert_eq!(Path::new("C://").normalize(), Path::new("C://")); - assert_eq!(Path::new("C:").normalize(), Path::new("C:")); - assert_eq!(Path::new(r"\\server\share").normalize(), Path::new(r"\\server\share")); -} diff --git a/src/resolution.rs b/src/resolution.rs deleted file mode 100644 index a3aaa2e7..00000000 --- a/src/resolution.rs +++ /dev/null @@ -1,92 +0,0 @@ -use crate::package_json::PackageJson; -use std::{ - fmt, - path::{Path, PathBuf}, - sync::Arc, -}; - -/// The final path resolution with optional `?query` and `#fragment` -#[derive(Clone)] -pub struct Resolution { - pub(crate) path: PathBuf, - - /// path query `?query`, contains `?`. - pub(crate) query: Option, - - /// path fragment `#query`, contains `#`. - pub(crate) fragment: Option, - - pub(crate) package_json: Option>, -} - -impl fmt::Debug for Resolution { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - f.debug_struct("Resolution") - .field("path", &self.path) - .field("query", &self.query) - .field("fragment", &self.fragment) - .field("package_json", &self.package_json.as_ref().map(|p| &p.path)) - .finish() - } -} - -impl PartialEq for Resolution { - fn eq(&self, other: &Self) -> bool { - self.path == other.path && self.query == other.query && self.fragment == other.fragment - } -} -impl Eq for Resolution {} - -impl Resolution { - /// Returns the path without query and fragment - pub fn path(&self) -> &Path { - &self.path - } - - /// Returns the path without query and fragment - pub fn into_path_buf(self) -> PathBuf { - self.path - } - - /// Returns the path query `?query`, contains the leading `?` - pub fn query(&self) -> Option<&str> { - self.query.as_deref() - } - - /// Returns the path fragment `#fragment`, contains the leading `#` - pub fn fragment(&self) -> Option<&str> { - self.fragment.as_deref() - } - - /// Returns serialized package_json - pub fn package_json(&self) -> Option<&Arc> { - self.package_json.as_ref() - } - - /// Returns the full path with query and fragment - pub fn full_path(&self) -> PathBuf { - let mut path = self.path.clone().into_os_string(); - if let Some(query) = &self.query { - path.push(query); - } - if let Some(fragment) = &self.fragment { - path.push(fragment); - } - PathBuf::from(path) - } -} - -#[test] -fn test() { - let resolution = Resolution { - path: PathBuf::from("foo"), - query: Some("?query".to_string()), - fragment: Some("#fragment".to_string()), - package_json: None, - }; - assert_eq!(resolution.path(), Path::new("foo")); - assert_eq!(resolution.query(), Some("?query")); - assert_eq!(resolution.fragment(), Some("#fragment")); - assert_eq!(resolution.full_path(), PathBuf::from("foo?query#fragment")); - assert_eq!(resolution.into_path_buf(), PathBuf::from("foo")); -} diff --git a/src/specifier.rs b/src/specifier.rs deleted file mode 100644 index 73ed038c..00000000 --- a/src/specifier.rs +++ /dev/null @@ -1,230 +0,0 @@ -use crate::error::SpecifierError; -use std::borrow::Cow; - -#[derive(Debug)] -pub struct Specifier<'a> { - path: Cow<'a, str>, - pub query: Option<&'a str>, - pub fragment: Option<&'a str>, -} - -impl<'a> Specifier<'a> { - pub fn path(&'a self) -> &'a str { - self.path.as_ref() - } - - pub fn parse(specifier: &'a str) -> Result { - if specifier.is_empty() { - return Err(SpecifierError::Empty(specifier.to_string())); - } - let offset = match specifier.as_bytes()[0] { - b'/' | b'.' | b'#' => 1, - _ => 0, - }; - let (path, query, fragment) = Self::parse_query_framgment(specifier, offset); - if path.is_empty() { - return Err(SpecifierError::Empty(specifier.to_string())); - } - Ok(Self { path, query, fragment }) - } - - fn parse_query_framgment( - specifier: &'a str, - skip: usize, - ) -> (Cow<'a, str>, Option<&str>, Option<&str>) { - let mut query_start: Option = None; - let mut fragment_start: Option = None; - - let mut prev = specifier.chars().next().unwrap(); - let mut escaped_indexes = vec![]; - for (i, c) in specifier.char_indices().skip(skip) { - if c == '?' && query_start.is_none() { - query_start = Some(i); - } - if c == '#' { - if prev == '\0' { - escaped_indexes.push(i - 1); - } else { - fragment_start = Some(i); - break; - } - } - prev = c; - } - - let (path, query, fragment) = match (query_start, fragment_start) { - (Some(i), Some(j)) => { - debug_assert!(i < j); - (&specifier[..i], Some(&specifier[i..j]), Some(&specifier[j..])) - } - (Some(i), None) => (&specifier[..i], Some(&specifier[i..]), None), - (None, Some(j)) => (&specifier[..j], None, Some(&specifier[j..])), - _ => (specifier, None, None), - }; - - let path = if escaped_indexes.is_empty() { - Cow::Borrowed(path) - } else { - // Remove the `\0` characters for a legal path. - Cow::Owned( - path.chars() - .enumerate() - .filter_map(|(i, c)| (!escaped_indexes.contains(&i)).then_some(c)) - .collect::(), - ) - }; - - (path, query, fragment) - } -} - -#[cfg(test)] -mod tests { - use super::{Specifier, SpecifierError}; - - #[test] - fn debug() { - let specifier = Specifier::parse("/").unwrap(); - assert_eq!( - format!("{specifier:?}"), - r#"Specifier { path: "/", query: None, fragment: None }"# - ); - } - - #[test] - fn empty() { - let specifiers = ["", "?"]; - for specifier in specifiers { - let error = Specifier::parse(specifier).unwrap_err(); - assert_eq!(error, SpecifierError::Empty(specifier.to_string())); - } - } - - #[test] - fn absolute() -> Result<(), SpecifierError> { - let specifier = "/test?#"; - let parsed = Specifier::parse(specifier)?; - assert_eq!(parsed.path, "/test"); - assert_eq!(parsed.query, Some("?")); - assert_eq!(parsed.fragment, Some("#")); - Ok(()) - } - - #[test] - fn relative() -> Result<(), SpecifierError> { - let specifiers = ["./test", "../test", "../../test"]; - for specifier in specifiers { - let mut r = specifier.to_string(); - r.push_str("?#"); - let parsed = Specifier::parse(&r)?; - assert_eq!(parsed.path, specifier); - assert_eq!(parsed.query, Some("?")); - assert_eq!(parsed.fragment, Some("#")); - } - Ok(()) - } - - #[test] - fn hash() -> Result<(), SpecifierError> { - let specifiers = ["#", "#path"]; - for specifier in specifiers { - let mut r = specifier.to_string(); - r.push_str("?#"); - let parsed = Specifier::parse(&r)?; - assert_eq!(parsed.path, specifier); - assert_eq!(parsed.query, Some("?")); - assert_eq!(parsed.fragment, Some("#")); - } - Ok(()) - } - - #[test] - fn module() -> Result<(), SpecifierError> { - let specifiers = ["module"]; - for specifier in specifiers { - let mut r = specifier.to_string(); - r.push_str("?#"); - let parsed = Specifier::parse(&r)?; - assert_eq!(parsed.path, specifier); - assert_eq!(parsed.query, Some("?")); - assert_eq!(parsed.fragment, Some("#")); - } - Ok(()) - } - - #[test] - fn query_fragment() -> Result<(), SpecifierError> { - let data = [ - ("a?", Some("?"), None), - ("a?query", Some("?query"), None), - ("a?query1?query2", Some("?query1?query2"), None), - ("a?query1?query2?query3", Some("?query1?query2?query3"), None), - ("a#", None, Some("#")), - ("a#b#c", None, Some("#b#c")), - ("a#fragment", None, Some("#fragment")), - ("a?#", Some("?"), Some("#")), - ("a?#fragment", Some("?"), Some("#fragment")), - ("a?query#", Some("?query"), Some("#")), - ("a?query#fragment", Some("?query"), Some("#fragment")), - ("a#fragment?", None, Some("#fragment?")), - ("a#fragment?query", None, Some("#fragment?query")), - ]; - - for (specifier_str, query, fragment) in data { - let specifier = Specifier::parse(specifier_str)?; - assert_eq!(specifier.path, "a", "{specifier_str}"); - assert_eq!(specifier.query, query, "{specifier_str}"); - assert_eq!(specifier.fragment, fragment, "{specifier_str}"); - } - - Ok(()) - } - - #[test] - // https://github.com/webpack/enhanced-resolve/blob/main/test/identifier.test.js - fn enhanced_resolve_edge_cases() -> Result<(), SpecifierError> { - let data = [ - ("path/#", "path/", "", "#"), - ("path/as/?", "path/as/", "?", ""), - ("path/#/?", "path/", "", "#/?"), - ("path/#repo#hash", "path/", "", "#repo#hash"), - ("path/#r#hash", "path/", "", "#r#hash"), - ("path/#repo/#repo2#hash", "path/", "", "#repo/#repo2#hash"), - ("path/#r/#r#hash", "path/", "", "#r/#r#hash"), - ("path/#/not/a/hash?not-a-query", "path/", "", "#/not/a/hash?not-a-query"), - ]; - - for (specifier_str, path, query, fragment) in data { - let specifier = Specifier::parse(specifier_str)?; - assert_eq!(specifier.path, path, "{specifier_str}"); - assert_eq!(specifier.query.unwrap_or(""), query, "{specifier_str}"); - assert_eq!(specifier.fragment.unwrap_or(""), fragment, "{specifier_str}"); - } - - Ok(()) - } - - // https://github.com/webpack/enhanced-resolve/blob/main/test/identifier.test.js - #[test] - fn enhanced_resolve_windows_like() -> Result<(), SpecifierError> { - let data = [ - ("path\\#", "path\\", "", "#"), - ("path\\as\\?", "path\\as\\", "?", ""), - ("path\\#\\?", "path\\", "", "#\\?"), - ("path\\#repo#hash", "path\\", "", "#repo#hash"), - ("path\\#r#hash", "path\\", "", "#r#hash"), - ("path\\#repo\\#repo2#hash", "path\\", "", "#repo\\#repo2#hash"), - ("path\\#r\\#r#hash", "path\\", "", "#r\\#r#hash"), - ("path\\#/not/a/hash?not-a-query", "path\\", "", "#/not/a/hash?not-a-query"), - ]; - - for (specifier_str, path, query, fragment) in data { - let specifier = Specifier::parse(specifier_str)?; - assert_eq!(specifier.path, path, "{specifier_str}"); - assert_eq!(specifier.query.unwrap_or(""), query, "{specifier_str}"); - assert_eq!(specifier.fragment.unwrap_or(""), fragment, "{specifier_str}"); - } - - Ok(()) - } -} diff --git a/src/tests/alias.rs b/src/tests/alias.rs deleted file mode 100644 index e5892066..00000000 --- a/src/tests/alias.rs +++ /dev/null @@ -1,283 +0,0 @@ -//! - -use normalize_path::NormalizePath; -use std::path::Path; - -use crate::{AliasValue, Resolution, ResolveContext, ResolveError, ResolveOptions, Resolver}; - -#[test] -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -fn alias() { - use super::memory_fs::MemoryFS; - use crate::ResolverGeneric; - use std::path::{Path, PathBuf}; - - let f = Path::new("/"); - - let file_system = MemoryFS::new(&[ - ("/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", ""), - ("/dashed-name", ""), - ]); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - alias: vec![ - ("aliasA".into(), vec![AliasValue::from("a")]), - ("b$".into(), vec![AliasValue::from("a/index")]), - ("c$".into(), vec![AliasValue::from("/a/index")]), - ( - "multiAlias".into(), - vec![ - AliasValue::from("b"), - AliasValue::from("c"), - AliasValue::from("d"), - AliasValue::from("e"), - AliasValue::from("a"), - ], - ), - ("recursive".into(), vec![AliasValue::from("recursive/dir")]), - ("/d/dir".into(), vec![AliasValue::from("/c/dir")]), - ("/d/index.js".into(), vec![AliasValue::from("/c/index")]), - ("#".into(), vec![AliasValue::from("/c/dir")]), - ("@".into(), vec![AliasValue::from("/c/dir")]), - ("ignored".into(), vec![AliasValue::Ignore]), - // not part of enhanced-resolve, added to make sure query in alias value works - ("alias_query".into(), vec![AliasValue::from("a?query_after")]), - ("alias_fragment".into(), vec![AliasValue::from("a#fragment_after")]), - ("dash".into(), vec![AliasValue::Ignore]), - ("@scope/package-name/file$".into(), vec![AliasValue::from("/c/dir")]), - ], - modules: vec!["/".into()], - ..ResolveOptions::default() - }, - ); - - #[rustfmt::skip] - let pass = [ - ("should resolve a not aliased module 1", "a", "/a/index"), - ("should resolve a not aliased module 2", "a/index", "/a/index"), - ("should resolve a not aliased module 3", "a/dir", "/a/dir/index"), - ("should resolve a not aliased module 4", "a/dir/index", "/a/dir/index"), - ("should resolve an aliased module 1", "aliasA", "/a/index"), - ("should resolve an aliased module 2", "aliasA/index", "/a/index"), - ("should resolve an aliased module 3", "aliasA/dir", "/a/dir/index"), - ("should resolve an aliased module 4", "aliasA/dir/index", "/a/dir/index"), - ("should resolve '#' alias 1", "#", "/c/dir/index"), - ("should resolve '#' alias 2", "#/index", "/c/dir/index"), - ("should resolve '@' alias 1", "@", "/c/dir/index"), - ("should resolve '@' alias 2", "@/index", "/c/dir/index"), - ("should resolve a recursive aliased module 1", "recursive", "/recursive/dir/index"), - ("should resolve a recursive aliased module 2", "recursive/index", "/recursive/dir/index"), - ("should resolve a recursive aliased module 3", "recursive/dir", "/recursive/dir/index"), - ("should resolve a recursive aliased module 4", "recursive/dir/index", "/recursive/dir/index"), - ("should resolve a file aliased module 1", "b", "/a/index"), - ("should resolve a file aliased module 2", "c", "/a/index"), - ("should resolve a file aliased module with a query 1", "b?query", "/a/index?query"), - ("should resolve a file aliased module with a query 2", "c?query", "/a/index?query"), - ("should resolve a path in a file aliased module 1", "b/index", "/b/index"), - ("should resolve a path in a file aliased module 2", "b/dir", "/b/dir/index"), - ("should resolve a path in a file aliased module 3", "b/dir/index", "/b/dir/index"), - ("should resolve a path in a file aliased module 4", "c/index", "/c/index"), - ("should resolve a path in a file aliased module 5", "c/dir", "/c/dir/index"), - ("should resolve a path in a file aliased module 6", "c/dir/index", "/c/dir/index"), - ("should resolve a file aliased file 1", "d", "/c/index"), - ("should resolve a file aliased file 2", "d/dir/index", "/c/dir/index"), - ("should resolve a file in multiple aliased dirs 1", "multiAlias/dir/file", "/e/dir/file"), - ("should resolve a file in multiple aliased dirs 2", "multiAlias/anotherDir", "/e/anotherDir/index"), - // not part of enhanced-resolve, added to make sure query in alias value works - ("should resolve query in alias value", "alias_query?query_before", "/a/index?query_after"), - ("should resolve query in alias value", "alias_fragment#fragment_before", "/a/index#fragment_after"), - ("should resolve dashed name", "dashed-name", "/dashed-name"), - ("should resolve scoped package name with sub dir", "@scope/package-name/file", "/c/dir/index"), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - - #[rustfmt::skip] - let ignore = [ - ("should resolve an ignore module", "ignored", ResolveError::Ignored(f.join("ignored"))) - ]; - - for (comment, request, expected) in ignore { - let resolution = resolver.resolve(f, request); - assert_eq!(resolution, Err(expected), "{comment} {request}"); - } -} - -// Not part of enhanced-resolve -#[test] -fn infinite_recursion() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![ - ("./a".into(), vec![AliasValue::from("./b")]), - ("./b".into(), vec![AliasValue::from("./a")]), - ], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(f, "./a"); - assert_eq!(resolution, Err(ResolveError::Recursion)); -} - -fn check_slash(path: &Path) { - let s = path.to_string_lossy().to_string(); - #[cfg(target_os = "windows")] - { - assert!(!s.contains('/'), "{s}"); - assert!(s.contains('\\'), "{s}"); - } - #[cfg(not(target_os = "windows"))] - { - assert!(s.contains('/'), "{s}"); - assert!(!s.contains('\\'), "{s}"); - } -} - -#[test] -fn absolute_path() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![(f.join("foo").to_str().unwrap().to_string(), vec![AliasValue::Ignore])], - modules: vec![f.clone().to_str().unwrap().to_string()], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(&f, "foo/index"); - assert_eq!(resolution, Err(ResolveError::Ignored(f.join("foo")))); -} - -#[test] -fn system_path() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![("@app".into(), vec![AliasValue::from(f.join("alias").to_string_lossy())])], - ..ResolveOptions::default() - }); - - let specifiers = ["@app/files/a", "@app/files/a.js"]; - - for specifier in specifiers { - let path = resolver.resolve(&f, specifier).map(Resolution::into_path_buf).unwrap(); - assert_eq!(path, f.join("alias/files/a.js")); - check_slash(&path); - } -} - -#[test] -fn alias_is_full_path() { - let f = super::fixture(); - let dir = f.join("foo"); - let dir_str = dir.to_string_lossy().to_string(); - - let resolver = Resolver::new(ResolveOptions { - alias: vec![("@".into(), vec![AliasValue::Path(dir_str.clone())])], - ..ResolveOptions::default() - }); - - let mut ctx = ResolveContext::default(); - - let specifiers = [ - "@/index".to_string(), - "@/index.js".to_string(), - // specifier has multiple `/` for reasons we'll never know - "@////index".to_string(), - // specifier is a full path - dir_str, - ]; - - for specifier in specifiers { - let resolution = resolver.resolve_with_context(&f, &specifier, &mut ctx); - assert_eq!(resolution.map(|r| r.full_path()), Ok(dir.join("index.js"))); - } - - for path in ctx.file_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - check_slash(&path); - } - - for path in ctx.missing_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - check_slash(&path); - if let Some(path) = path.parent() { - assert!(!path.is_file(), "{path:?} must not be a file"); - } - } -} - -// For the `should_stop` variable in `load_alias` -#[test] -fn all_alias_values_are_not_found() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![( - "m1".to_string(), - vec![AliasValue::Path(f.join("node_modules").join("m2").to_string_lossy().to_string())], - )], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(&f, "m1/a.js"); - assert_eq!( - resolution, - Err(ResolveError::MatchedAliasNotFound("m1/a.js".to_string(), "m1".to_string(),)) - ); -} - -#[test] -fn alias_fragment() { - let f = super::fixture(); - - let data = [ - // enhanced-resolve has `#` prepended with a `\0`, they are removed from the - // following 3 expected test results. - // See https://github.com/webpack/enhanced-resolve#escaping - ( - "handle fragment edge case (no fragment)", - "./no#fragment/#/#", - f.join("no#fragment/#/#.js"), - ), - ("handle fragment edge case (fragment)", "./no#fragment/#/", f.join("no.js#fragment/#/")), - ( - "handle fragment escaping", - "./no\0#fragment/\0#/\0##fragment", - f.join("no#fragment/#/#.js#fragment"), - ), - ]; - - for (comment, request, expected) in data { - let resolver = Resolver::new(ResolveOptions { - alias: vec![("foo".to_string(), vec![AliasValue::Path(request.to_string())])], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f, "foo").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } -} - -#[test] -fn alias_try_fragment_as_path() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - alias: vec![( - "#".to_string(), - vec![AliasValue::Path(f.join("#").to_string_lossy().to_string())], - )], - ..ResolveOptions::default() - }); - let resolution = resolver.resolve(&f, "#/a").map(|r| r.full_path()); - assert_eq!(resolution, Ok(f.join("#").join("a.js"))); -} diff --git a/src/tests/browser_field.rs b/src/tests/browser_field.rs deleted file mode 100644 index 171ee099..00000000 --- a/src/tests/browser_field.rs +++ /dev/null @@ -1,189 +0,0 @@ -//! - -use crate::{AliasValue, ResolveError, ResolveOptions, Resolver}; - -#[test] -fn ignore() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![ - vec!["browser".into()], - vec!["innerBrowser1".into()], - vec!["innerBrowser2".into()], - vec![], - ], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - (f.clone(), "./lib/ignore", f.join("lib/ignore.js")), - (f.clone(), "./lib/ignore.js", f.join("lib/ignore.js")), - (f.join("lib"), "./ignore", f.join("lib/ignore.js")), - (f.join("lib"), "./ignore.js", f.join("lib/ignore.js")), - ]; - - for (path, request, expected) in data { - let resolution = resolver.resolve(&path, request); - let expected = ResolveError::Ignored(expected); - assert_eq!(resolution, Err(expected), "{path:?} {request}"); - } -} - -#[test] -fn shared_resolvers() { - let f = super::fixture().join("browser-module"); - - let resolver1 = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["innerBrowser1".into(), "field".into(), "browser".into()]], - ..ResolveOptions::default() - }); - let resolved_path = resolver1.resolve(&f, "./lib/main1.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("lib/main.js"))); - - let resolver2 = resolver1.clone_with_options(ResolveOptions { - alias_fields: vec![vec!["innerBrowser2".into(), "browser".into()]], - ..ResolveOptions::default() - }); - let resolved_path = resolver2.resolve(&f, "./lib/main2.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("./lib/replaced.js"))); -} - -#[test] -fn replace_file() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![ - vec!["browser".into()], - vec!["innerBrowser1".into(), "field2".into(), "browser".into()], // not presented - vec!["innerBrowser1".into(), "field".into(), "browser".into()], - vec!["innerBrowser2".into(), "browser".into()], - ], - // Not part of enhanced-resolve. Added to make sure no interaction between these two fields. - main_fields: vec!["browser".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - ("should replace a file 1", f.clone(), "./lib/replaced", f.join("lib/browser.js")), - ("should replace a file 2", f.clone(), "./lib/replaced.js", f.join("lib/browser.js")), - ("should replace a file 3", f.join("lib"), "./replaced", f.join("lib/browser.js")), - ("should replace a file 4", f.join("lib"), "./replaced.js", f.join("lib/browser.js")), - ("should replace a module with a file 1", f.clone(), "module-a", f.join("browser/module-a.js")), - ("should replace a module with a file 2", f.join("lib"), "module-a", f.join("browser/module-a.js")), - ("should replace a module with a module 1", f.clone(), "module-b", f.join("node_modules/module-c.js")), - ("should replace a module with a module 2", f.join("lib"), "module-b", f.join("node_modules/module-c.js")), - ("should resolve in nested property 1", f.clone(), "./lib/main1.js", f.join("lib/main.js")), - ("should resolve in nested property 2", f.clone(), "./lib/main2.js", f.join("lib/browser.js")), - ("should check only alias field properties", f.clone(), "./toString", f.join("lib/toString.js")), - // not part of enhanced-resolve - ("recursion", f.clone(), "module-c", f.join("node_modules/module-c.js")), - ("resolve self 1", f.clone(), "./lib/main.js", f.join("lib/main.js")), - ("resolve self 2", f.clone(), "./main.js", f.join("lib/main.js")), - ]; - - for (comment, path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn recurse_fail() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - ("recurse non existent", f.clone(), "./lib/non-existent.js", ResolveError::NotFound("./lib/non-existent.js".into())), - ("path partial match 1", f.clone(), "./xyz.js", ResolveError::NotFound("./xyz.js".into())), - ("path partial match 2", f, "./lib/xyz.js", ResolveError::NotFound("./lib/xyz.js".into())), - ]; - - for (comment, path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Err(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn broken() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let data = [ - // The browser field string value should be ignored - (f.clone(), "browser-module-broken", Ok(f.join("node_modules/browser-module-broken/main.js"))), - (f.join("browser-module"), "./number", Err(ResolveError::NotFound("./number".into()))), - ]; - - for (path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, expected, "{path:?} {request}"); - } -} - -#[test] -fn crypto_js() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - fallback: vec![( - "crypto".into(), - vec![AliasValue::from(f.join("lib.js").to_string_lossy())], - )], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(f.join("crypto-js"), "crypto").map(|r| r.full_path()); - assert_eq!(resolved_path, Err(ResolveError::Ignored(f.join("crypto-js")))); -} - -// https://github.com/webpack/webpack/blob/87660921808566ef3b8796f8df61bd79fc026108/test/cases/resolving/browser-field/index.js#L40-L43 -#[test] -fn recursive() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - let data = [ - ("should handle recursive file 1", f.clone(), "recursive-file/a"), - ("should handle recursive file 2", f.clone(), "recursive-file/b"), - ("should handle recursive file 3", f.clone(), "recursive-file/c"), - ("should handle recursive file 4", f, "recursive-file/d"), - ]; - - for (comment, path, request) in data { - let resolved_path = resolver.resolve(&path, request); - assert_eq!(resolved_path, Err(ResolveError::Recursion), "{comment} {path:?} {request}"); - } -} - -#[test] -fn with_query() { - let f = super::fixture().join("browser-module"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "./foo").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("lib").join("browser.js?query"))); -} diff --git a/src/tests/builtins.rs b/src/tests/builtins.rs deleted file mode 100644 index 5d6d14d9..00000000 --- a/src/tests/builtins.rs +++ /dev/null @@ -1,121 +0,0 @@ -use std::path::Path; - -use crate::{ResolveError, ResolveOptions, Resolver}; - -#[test] -fn builtins_off() { - let f = Path::new("/"); - let resolver = Resolver::default(); - let resolved_path = resolver.resolve(f, "zlib").map(|r| r.full_path()); - assert_eq!(resolved_path, Err(ResolveError::NotFound("zlib".into()))); -} - -#[test] -fn builtins() { - let f = Path::new("/"); - - let resolver = Resolver::new(ResolveOptions::default().with_builtin_modules(true)); - - let pass = [ - "_http_agent", - "_http_client", - "_http_common", - "_http_incoming", - "_http_outgoing", - "_http_server", - "_stream_duplex", - "_stream_passthrough", - "_stream_readable", - "_stream_transform", - "_stream_wrap", - "_stream_writable", - "_tls_common", - "_tls_wrap", - "assert", - "assert/strict", - "async_hooks", - "buffer", - "child_process", - "cluster", - "console", - "constants", - "crypto", - "dgram", - "diagnostics_channel", - "dns", - "dns/promises", - "domain", - "events", - "fs", - "fs/promises", - "http", - "http2", - "https", - "inspector", - "module", - "net", - "os", - "path", - "path/posix", - "path/win32", - "perf_hooks", - "process", - "punycode", - "querystring", - "readline", - "repl", - "stream", - "stream/consumers", - "stream/promises", - "stream/web", - "string_decoder", - "sys", - "timers", - "timers/promises", - "tls", - "trace_events", - "tty", - "url", - "util", - "util/types", - "v8", - "vm", - "worker_threads", - "zlib", - ]; - - for request in pass { - let prefixed_request = format!("node:{request}"); - for request in [prefixed_request.clone(), request.to_string()] { - let resolved_path = resolver.resolve(f, &request).map(|r| r.full_path()); - let err = ResolveError::Builtin(prefixed_request.clone()); - assert_eq!(resolved_path, Err(err), "{request}"); - } - } -} - -#[test] -fn fail() { - let f = Path::new("/"); - let resolver = Resolver::new(ResolveOptions::default().with_builtin_modules(true)); - let request = "xxx"; - let resolved_path = resolver.resolve(f, request); - let err = ResolveError::NotFound(request.to_string()); - assert_eq!(resolved_path, Err(err), "{request}"); -} - -#[test] -fn imports() { - let f = super::fixture().join("builtins"); - let resolver = Resolver::new(ResolveOptions { - builtin_modules: true, - condition_names: vec!["node".into()], - ..ResolveOptions::default() - }); - - for request in ["#fs", "#http"] { - let resolved_path = resolver.resolve(f.clone(), request).map(|r| r.full_path()); - let err = ResolveError::Builtin(format!("node:{}", request.trim_start_matches('#'))); - assert_eq!(resolved_path, Err(err)); - } -} diff --git a/src/tests/dependencies.rs b/src/tests/dependencies.rs deleted file mode 100644 index bcc2355b..00000000 --- a/src/tests/dependencies.rs +++ /dev/null @@ -1,110 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/dependencies.test.js - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows { - use rustc_hash::FxHashSet; - use std::path::PathBuf; - - use crate::{ResolveContext, ResolveOptions, ResolverGeneric}; - - use super::super::memory_fs::MemoryFS; - - fn file_system() -> MemoryFS { - MemoryFS::new(&[ - ("/a/b/node_modules/some-module/index.js", ""), - ("/a/node_modules/module/package.json", r#"{"main":"entry.js"}"#), - ("/a/node_modules/module/file.js", r#"{"main":"entry.js"}"#), - ("/modules/other-module/file.js", ""), - ]) - } - - #[test] - fn test() { - let file_system = file_system(); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - extensions: vec![".json".into(), ".js".into()], - modules: vec!["/modules".into(), "node_modules".into()], - ..ResolveOptions::default() - }, - ); - - let data = [ - ( - "middle module request", - "/a/b/c", - "module/file", - "/a/node_modules/module/file.js", - // These dependencies are different from enhanced-resolve due to different code path to - // querying the file system - vec![ - // 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", - // "/", - ], - vec![ - // missing package.jsons - // "/a/b/c/package.json", - "/a/b/package.json", - "/a/package.json", - "/package.json", - // missing modules directories - "/a/b/c", - // "/a/b/c/node_modules", - // missing single file modules - "/modules/module", - "/a/b/node_modules/module", - // missing files with alternative extensions - "/a/node_modules/module/file", - "/a/node_modules/module/file.json", - ], - ), - ( - "fast found module", - "/a/b/c", - "other-module/file.js", - "/modules/other-module/file.js", - // These dependencies are different from enhanced-resolve due to different code path to - // querying the file system - vec![ - // symlink checks - "/modules/other-module/file.js", - // "/modules/other-module", - // "/modules", - // "/", - ], - vec![ - // missing package.jsons - // "/a/b/c/package.json", - "/a/b/c", - "/a/b/package.json", - "/a/package.json", - "/package.json", - "/modules/other-module/package.json", - "/modules/package.json", - ], - ), - ]; - - for (name, context, request, result, file_dependencies, missing_dependencies) in data { - let mut ctx = ResolveContext::default(); - let path = PathBuf::from(context); - let resolved = - resolver.resolve_with_context(path, request, &mut ctx).map(|r| r.full_path()); - assert_eq!(resolved, Ok(PathBuf::from(result))); - let file_dependencies = - FxHashSet::from_iter(file_dependencies.iter().map(PathBuf::from)); - let missing_dependencies = - FxHashSet::from_iter(missing_dependencies.iter().map(PathBuf::from)); - assert_eq!(ctx.file_dependencies, file_dependencies, "{name}"); - assert_eq!(ctx.missing_dependencies, missing_dependencies, "{name}"); - } - } -} diff --git a/src/tests/exports_field.rs b/src/tests/exports_field.rs deleted file mode 100644 index 7ca73fbd..00000000 --- a/src/tests/exports_field.rs +++ /dev/null @@ -1,2546 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/exportsField.test.js -//! -//! The huge exports field test cases are at the bottom of this file. - -use crate::{Ctx, PathUtil, ResolveError, ResolveOptions, Resolver}; -use serde_json::json; -use std::path::Path; - -#[test] -fn test_simple() { - let f = super::fixture().join("exports-field"); - let f2 = super::fixture().join("exports-field2"); - let f4 = super::fixture().join("exports-field-error"); - let f5 = super::fixture().join("imports-exports-wildcard"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - fully_specified: true, - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("resolve root using exports field, not a main field", f.clone(), "exports-field", f.join("node_modules/exports-field/x.js")), - ("resolver should respect condition names", f.clone(), "exports-field/dist/main.js", f.join("node_modules/exports-field/lib/lib2/main.js")), - // enhanced_resolve behaves differently to node.js. enhanced_resolve fallbacks when an - // array item is unresolved, where as node.js fallbacks when an array has an - // InvalidPackageTarget error. - // ("resolver should respect fallback", f2.clone(), "exports-field/dist/browser.js", f2.join("node_modules/exports-field/lib/browser.js")), - // The following two tests require fallback from array values, the path is changed here to - // only test query and fragment. - ("resolver should respect query parameters #1", f2.clone(), "exports-field/dist/main.js?foo", f2.join("node_modules/exports-field/lib/lib2/main.js?foo")), - ("resolver should respect fragment parameters #1", f2.clone(), "exports-field/dist/main.js#foo", f2.join("node_modules/exports-field/lib/lib2/main.js#foo")), - ("relative path should work, if relative path as request is used", f.clone(), "./node_modules/exports-field/lib/main.js", f.join("node_modules/exports-field/lib/main.js")), - ("self-resolving root", f.clone(), "@exports-field/core", f.join("a.js")), - ("should resolve with wildcard pattern #1", f5.clone(), "m/features/f.js", f5.join("node_modules/m/src/features/f.js")), - ("should resolve with wildcard pattern #2", f5.clone(), "m/features/y/y.js", f5.join("node_modules/m/src/features/y/y.js")), - ("should resolve with wildcard pattern #3", f5.clone(), "m/features-no-ext/y/y.js", f5.join("node_modules/m/src/features/y/y.js")), - ("should resolve with wildcard pattern #4", f5.clone(), "m/middle/nested/f.js", f5.join("node_modules/m/src/middle/nested/f.js")), - ("should resolve with wildcard pattern #5", f5.clone(), "m/middle-1/nested/f.js", f5.join("node_modules/m/src/middle-1/nested/f.js")), - ("should resolve with wildcard pattern #6", f5.clone(), "m/middle-2/nested/f.js", f5.join("node_modules/m/src/middle-2/nested/f.js")), - ("should resolve with wildcard pattern #7", f5.clone(), "m/middle-3/nested/f", f5.join("node_modules/m/src/middle-3/nested/f/nested/f.js")), - ("should resolve with wildcard pattern #8", f5.clone(), "m/middle-4/f/nested", f5.join("node_modules/m/src/middle-4/f/f.js")), - ("should resolve with wildcard pattern #9", f5.clone(), "m/middle-5/f$/$", f5.join("node_modules/m/src/middle-5/f$/$.js")), - ]; - - // Not needed or snapshot: - // * should log the correct info - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } - - let p = f.join("node_modules/exports-field/package.json"); - let p2 = f2.join("node_modules/exports-field/package.json"); - let p4 = f4.join("node_modules/exports-field/package.json"); - let p5 = f5.join("node_modules/m/package.json"); - - #[rustfmt::skip] - let fail = [ - // ("throw error if extension not provided", f2.clone(), "exports-field/dist/main", ResolveError::NotFound(f2.join("node_modules/exports-field/lib/lib2/main"))), - ("resolver should respect query parameters #2. Direct matching", f2.clone(), "exports-field?foo", ResolveError::PackagePathNotExported("./?foo".into(), p2.clone())), - ("resolver should respect fragment parameters #2. Direct matching", f2, "exports-field#foo", ResolveError::PackagePathNotExported("./#foo".into(), p2)), - ("relative path should not work with exports field", f.clone(), "./node_modules/exports-field/dist/main.js", ResolveError::NotFound("./node_modules/exports-field/dist/main.js".into())), - ("backtracking should not work for request", f.clone(), "exports-field/dist/../../../a.js", ResolveError::InvalidPackageTarget("./lib/../../../a.js".to_string(), "./dist/".to_string(), p.clone())), - ("backtracking should not work for exports field target", f.clone(), "exports-field/dist/a.js", ResolveError::InvalidPackageTarget("./../../a.js".to_string(), "./dist/a.js".to_string(), p.clone())), - ("not exported error", f.clone(), "exports-field/anything/else", ResolveError::PackagePathNotExported("./anything/else".to_string(), p.clone())), - ("request ending with slash #1", f.clone(), "exports-field/", ResolveError::PackagePathNotExported("./".to_string(), p.clone())), - ("request ending with slash #2", f.clone(), "exports-field/dist/", ResolveError::PackagePathNotExported("./dist/".to_string(), p.clone())), - ("request ending with slash #3", f.clone(), "exports-field/lib/", ResolveError::PackagePathNotExported("./lib/".to_string(), p)), - ("should throw error if target is invalid", f4, "exports-field", ResolveError::InvalidPackageTarget("./a/../b/../../pack1/index.js".to_string(), ".".to_string(), p4)), - ("throw error if exports field is invalid", f.clone(), "invalid-exports-field", ResolveError::InvalidPackageConfig(f.join("node_modules/invalid-exports-field/package.json"))), - ("should throw error if target is 'null'", f5, "m/features/internal/file.js", ResolveError::PackagePathNotExported("./features/internal/file.js".to_string(), p5)), - ]; - - for (comment, path, request, error) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!(resolution, Err(error), "{comment} {path:?} {request}"); - } -} - -// resolve using exports field, not a browser field #1 -#[test] -fn exports_not_browser_field1() { - let f = super::fixture().join("exports-field"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - condition_names: vec!["webpack".into()], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "exports-field/dist/main.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("node_modules/exports-field/lib/lib2/main.js"))); -} - -// resolve using exports field and a browser alias field #2 -#[test] -fn exports_not_browser_field2() { - let f2 = super::fixture().join("exports-field2"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - extensions: vec![".js".into()], - condition_names: vec!["node".into()], - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f2, "exports-field/dist/main.js").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f2.join("node_modules/exports-field/lib/browser.js"))); -} - -// should resolve extension without fullySpecified -#[test] -fn extension_without_fully_specified() { - let f2 = super::fixture().join("exports-field2"); - - let commonjs_resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - let resolved_path = - commonjs_resolver.resolve(&f2, "exports-field/dist/main").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f2.join("node_modules/exports-field/lib/lib2/main.js"))); -} - -#[test] -fn field_name_path() { - let f2 = super::fixture().join("exports-field2"); - let f3 = super::fixture().join("exports-field3"); - - // field name path #1 #2 #3 - let exports_fields = [ - vec![vec!["exportsField".into(), "exports".into()]], - vec![vec!["exportsField".into(), "exports".into()], vec!["exports".into()]], - vec![vec!["exports".into()], vec!["exportsField".into(), "exports".into()]], - ]; - - for exports_fields in exports_fields { - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - exports_fields, - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/main.js"))); - } - - // field name path #4 - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - exports_fields: vec![vec!["exports".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f2, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f2.join("node_modules/exports-field/index.js"))); - - // field name path #5 - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - exports_fields: vec![vec!["ex".into()], vec!["exports_field".into(), "exports".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/index"))); - - // non-compliant export targeting a directory - let resolver = Resolver::new(ResolveOptions { - exports_fields: vec![vec!["broken".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/src/index.js"))); -} - -#[test] -fn shared_resolvers() { - let f3 = super::fixture().join("exports-field3"); - - let resolver1 = Resolver::new(ResolveOptions { - exports_fields: vec![vec!["exportsField".into(), "exports".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver1.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/main.js"))); - - let resolver2 = resolver1.clone_with_options(ResolveOptions { - exports_fields: vec![vec!["ex".into()]], - extensions: vec![".js".into()], - ..ResolveOptions::default() - }); - let resolved_path = resolver2.resolve(&f3, "exports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f3.join("node_modules/exports-field/index"))); -} - -#[test] -fn extension_alias_1_2() { - let f = super::fixture().join("exports-field-and-extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - extension_alias: vec![(".js".into(), vec![".ts".into(), ".js".into()])], - fully_specified: true, - condition_names: vec!["webpack".into(), "default".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve with the `extensionAlias` option", f.clone(), "@org/pkg/string.js", f.join("node_modules/@org/pkg/dist/string.js")), - ("should resolve with the `extensionAlias` option #2", f.clone(), "pkg/string.js", f.join("node_modules/pkg/dist/string.js")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn extension_alias_3() { - let f = super::fixture().join("exports-field-and-extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - extension_alias: vec![( - ".js".into(), - vec![".foo".into(), ".baz".into(), ".baz".into(), ".ts".into(), ".js".into()], - )], - fully_specified: true, - condition_names: vec!["webpack".into(), "default".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve with the `extensionAlias` option #3", f.clone(), "pkg/string.js", f.join("node_modules/pkg/dist/string.js")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn extension_alias_throw_error() { - let f = super::fixture().join("exports-field-and-extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - extension_alias: vec![(".js".into(), vec![".ts".into()])], - fully_specified: true, - condition_names: vec!["webpack".into(), "default".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let fail = [ - // enhanced-resolve has two test cases that are exactly the same here - // https://github.com/webpack/enhanced-resolve/blob/a998c7d218b7a9ec2461fc4fddd1ad5dd7687485/test/exportsField.test.js#L2976-L3024 - ("should throw error with the `extensionAlias` option", f.clone(), "pkg/string.js", ResolveError::ExtensionAlias(f.join("node_modules/pkg/dist/string.js"))), - // TODO: The error is PackagePathNotExported in enhanced-resolve - // ("should throw error with the `extensionAlias` option", f.clone(), "pkg/string.js", ResolveError::PackagePathNotExported("node_modules/pkg/dist/string.ts".to_string())), - ]; - - for (comment, path, request, error) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!(resolution, Err(error), "{comment} {path:?} {request}"); - } -} - -// Small script for generating the test cases from enhanced-resolve -// for (c of testCases) { -// console.log("TestCase {") -// console.log(`name: ${JSON.stringify(c.name)},`) -// if (c.expect instanceof Error) { -// console.log(`expect: None,`) -// } else { -// console.log(`expect: Some(vec!${JSON.stringify(c.expect)}),`) -// } -// console.log(`exports_field: exports_field(json!(${JSON.stringify(c.suite[0], null, 2)})),`) -// console.log(`request: "${c.suite[1]}",`) -// console.log(`condition_names: vec!${JSON.stringify(c.suite[2])},`) -// console.log("},") -//} -struct TestCase { - name: &'static str, - expect: Option>, - exports_field: serde_json::Value, - request: &'static str, - condition_names: Vec<&'static str>, -} - -#[allow(clippy::needless_pass_by_value)] -fn exports_field(value: serde_json::Value) -> serde_json::Value { - value -} - -#[test] -fn test_cases() { - let test_cases = [ - TestCase { - name: "sample #1", - expect: Some(vec!["./dist/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/": { - "import": [ - "./dist/", - "./src/" - ], - "webpack": "./wp/" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "sample #1", - expect: Some(vec!["./src/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/": { - "import": [ - "./src/" - ], - "webpack": "./wp/" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - TestCase { - name: "sample #1 (wildcard)", - expect: Some(vec!["./dist/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/*": { - "import": [ - "./dist/*", - "./src/*" - ], - "webpack": "./wp/*" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "sample #1 (wildcard)", - expect: Some(vec!["./src/test/file.js"]), - exports_field: exports_field(json!({ - "./foo/*": { - "import": [ - "./src/*" - ], - "webpack": "./wp/*" - }, - ".": "./main.js" - })), - request: "./foo/test/file.js", - condition_names: vec!["import", "webpack"], - }, - TestCase { - name: "sample #2", - expect: Some(vec!["./data/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./timezones/": "./data/timezones/" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #2 (wildcard)", - expect: Some(vec!["./data/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./timezones/*": "./data/timezones/*" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #3", - expect: Some(vec!["./data/timezones/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./": "./data/timezones/" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #3 (wildcard)", - expect: Some(vec!["./data/timezones/timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./*": "./data/timezones/*.mjs" - })), - request: "./timezones/pdt", - condition_names: vec![], - }, - TestCase { - name: "sample #4", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./lib/": { - "browser": [ - "./browser/" - ] - }, - "./dist/index.js": { - "node": "./index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #4 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "node": "./index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #5", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/": { - "browser": [ - "./browser/" - ] - }, - "./dist/index.js": { - "node": "./index.js", - "default": "./browser/index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #5 (wildcard)", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "node": "./index.js", - "default": "./browser/index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./dist/a": "./dist/index.js" - })), - request: "./dist/aaa", - condition_names: vec![], - }, - TestCase { - name: "sample #7", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./dist/a/a/": "./dist/index.js" - })), - request: "./dist/a/a", - condition_names: vec![], - }, - TestCase { - name: "sample #7 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./dist/a/a/*": "./dist/index.js" - })), - request: "./dist/a/a", - condition_names: vec![], - }, - TestCase { - name: "sample #8", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": "./index.js" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #9", - expect: Some(vec!["./main.js"]), - exports_field: exports_field(json!({ - "./index.js": "./main.js" - })), - request: "./index.js", - condition_names: vec![], - }, - TestCase { - name: "sample #10", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #11", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./bar#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #12", - expect: Some(vec!["./ok.js#abc"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/ok.js#abc", - condition_names: vec![], - }, - TestCase { - name: "sample #12", - expect: Some(vec!["./ok.js#abc"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/ok.js#abc", - condition_names: vec![], - }, - TestCase { - name: "sample #13", - expect: Some(vec!["./ok.js?abc"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/ok.js?abc", - condition_names: vec![], - }, - TestCase { - name: "sample #14", - expect: Some(vec!["./🎉.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/🎉.js", - condition_names: vec![], - }, - TestCase { - name: "sample #15", - expect: Some(vec!["./%F0%9F%8E%89.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./#zapp/%F0%9F%8E%89.js", - condition_names: vec![], - }, - TestCase { - name: "sample #16", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./🎉", - condition_names: vec![], - }, - TestCase { - name: "sample #17", - expect: Some(vec!["./other.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./%F0%9F%8E%89", - condition_names: vec![], - }, - TestCase { - name: "sample #18", - expect: Some(vec!["./ok.js"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./module", - condition_names: vec![], - }, - TestCase { - name: "sample #19", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./module#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #20", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./zzz*" - })), - request: "./module?foo", - condition_names: vec![], - }, - TestCase { - name: "sample #21", - expect: Some(vec!["./zizizi"]), - exports_field: exports_field(json!({ - "./#foo": "./ok.js", - "./module": "./ok.js", - "./🎉": "./ok.js", - "./%F0%9F%8E%89": "./other.js", - "./bar#foo": "./ok.js", - "./#zapp/": "./", - "./#zipp*": "./z*z*z*" - })), - request: "./#zippi", - condition_names: vec![], - }, - TestCase { - name: "sample #22", - expect: Some(vec!["./d?e?f"]), - exports_field: exports_field(json!({ - "./a?b?c/": "./" - })), - request: "./a?b?c/d?e?f", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #1", - expect: Some(vec!["./dist/index.js"]), - exports_field: exports_field(json!({ - ".": "./dist/index.js" - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #2", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./": "./", - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #3", - expect: Some(vec!["./dist/a.js"]), - exports_field: exports_field(json!({ - "./dist/": "./dist/", - "./dist/*": "./dist/*", - "./dist*": "./dist*", - "./dist/index.js": "./dist/a.js" - })), - request: "./dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #4", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./": { - "browser": [ - "./browser/" - ] - }, - "./*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "browser": "./index.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #5", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./": { - "browser": [ - "./browser/" - ] - }, - "./*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/index.js": { - "node": "./node.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #6", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - ".": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #7", - expect: Some(vec!["./src/index.js"]), // `enhanced_resolve` is `None` - exports_field: exports_field(json!({ - ".": { - "default": "./src/index.js", - "browser": "./index.js", - "node": "./src/node/index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #8", - expect: Some(vec!["./src/index.js"]), - exports_field: exports_field(json!({ - ".": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #9", - expect: Some(vec!["./index"]), - exports_field: exports_field(json!({ - ".": "./index" - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #10", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./index": "./index.js" - })), - request: "./index", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #11", - expect: Some(vec!["./foo.js"]), - exports_field: exports_field(json!({ - "./": "./", - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #12", - expect: Some(vec!["./foo/bar/baz.js"]), - exports_field: exports_field(json!({ - "./": "./", - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo/bar/baz.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #13", - expect: Some(vec!["./foo/bar/baz.js"]), - exports_field: exports_field(json!({ - "./": "./", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo/bar/baz.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #14", - expect: Some(vec!["./foo/bar/baz.js"]), - exports_field: exports_field(json!({ - "./*": "./*", - "./dist/index.js": "./dist/index.js" - })), - request: "./foo/bar/baz.js", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #1", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "require": "./require.js" - }, { - "import": "./import.mjs" - }] - })), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #2", - expect: Some(vec!["./import.mjs"]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "require": "./require.js" - }, { - "import": "./import.mjs" - }] - })), - request: ".", - condition_names: vec!["import"], - }, - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./require.js"]), - exports_field: exports_field(json!({ - ".": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./import.mjs"]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "import": "./import.mjs" - }] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./require.js"]), - exports_field: exports_field(json!({ - ".": [{ - "browser": "./browser.js" - }, { - "require": [ - "./require.js" - ] - }, { - "import": [ - "./import.mjs", - "./import.js" - ] - }] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./import.mjs"]), - exports_field: exports_field(json!({ - ".": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "./import.mjs", - "./import.js" - ] - } - ] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./import.js"]), - exports_field: exports_field(json!({ - ".": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "./import.js" - ] - } - ] - })), - request: ".", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "mapping to a folder root #1", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./timezones": "./data/timezones/" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #2", - expect: None, - exports_field: exports_field(json!({ - "./timezones/": "./data/timezones" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #3", - expect: Some(vec!["./data/timezones/pdt/index.mjs"]), - exports_field: exports_field(json!({ - "./timezones/pdt/": "./data/timezones/pdt/" - })), - request: "./timezones/pdt/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #3 (wildcard)", - expect: Some(vec!["./data/timezones/pdt/index.mjs"]), - exports_field: exports_field(json!({ - "./timezones/pdt/*": "./data/timezones/pdt/*" - })), - request: "./timezones/pdt/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #4", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./": "./timezones/" - })), - request: "./pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #4 (wildcard)", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./*": "./timezones/*" - })), - request: "./pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #5", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./": "./" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #5 (wildcard)", - expect: Some(vec!["./timezones/pdt.mjs"]), - exports_field: exports_field(json!({ - "./*": "./*" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #6", - expect: None, - exports_field: exports_field(json!({ - "./": "." - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #6 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "./*": "." - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #7", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": "./" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #7 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - ".": "./*" - })), - request: "./timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #1", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./": "./", - "./dist/": "./lib/" - })), - request: "./dist/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #1 (wildcard)", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./*": "./*", - "./dist/*": "./lib/*" - })), - request: "./dist/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #2", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/": "./dist/utils/", - "./dist/": "./lib/" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #2 (wildcard)", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/*": "./dist/utils/*", - "./dist/*": "./lib/*" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #3", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/index.js": "./dist/utils/index.js", - "./dist/utils/": "./dist/utils/index.mjs", - "./dist/": "./lib/" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #3 (wildcard)", - expect: Some(vec!["./dist/utils/index.js"]), - exports_field: exports_field(json!({ - "./dist/utils/index.js": "./dist/utils/index.js", - "./dist/utils/*": "./dist/utils/index.mjs", - "./dist/*": "./lib/*" - })), - request: "./dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #4", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./": { - "browser": "./browser/" - }, - "./dist/": "./lib/" - })), - request: "./dist/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "the longest matching path prefix is prioritized #4 (wildcard)", - expect: Some(vec!["./lib/index.mjs"]), - exports_field: exports_field(json!({ - "./*": { - "browser": "./browser/*" - }, - "./dist/*": "./lib/*" - })), - request: "./dist/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #1", - // `lodash/` does not start with './' so fallbacks to util - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "conditional mapping folder #1", - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": [ - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #1 (wildcard)", - // `lodash/` does not start with './' so fallbacks to util - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": [ - "lodash/*", - "./utils/*" - ], - "node": [ - "./utils-node/*" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "conditional mapping folder #1 (wildcard)", - expect: Some(vec!["./utils/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": [ - "./utils/*" - ], - "node": [ - "./utils-node/*" - ] - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #2", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./node/" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "conditional mapping folder #2 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "webpack": "./wpk/*", - "browser": [ - "lodash/*", - "./utils/*" - ], - "node": [ - "./node/*" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "conditional mapping folder #3", - expect: Some(vec!["./wpk/index.mjs"]), - exports_field: exports_field(json!({ - "./utils/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils/" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "conditional mapping folder #3 (wildcard)", - expect: Some(vec!["./wpk/index.mjs"]), - exports_field: exports_field(json!({ - "./utils/*": { - "webpack": "./wpk/*", - "browser": [ - "lodash/*", - "./utils/*" - ], - "node": [ - "./utils/*" - ] - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "incorrect exports field #1", - expect: None, - exports_field: exports_field(json!({ - "/utils/": "./a/" - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #2", - expect: None, - exports_field: exports_field(json!({ - "./utils/": "/a/" - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #3", - expect: None, - exports_field: exports_field(json!({ - "/utils/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #4", - expect: None, - exports_field: exports_field(json!({ - "./utils/": { - "browser": "/a/", - "default": "/b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #4 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "/a/", - "default": "/b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #5", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index": "./a/index.js" - })), - request: "./utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index.mjs": "./a/index.js" - })), - request: "./utils/index", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #7", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #8", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/index.mjs": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - // Requests that are not `./` does not apply to `package_exports_resolve` - // TestCase { - // name: "incorrect request #1", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": "./a/" - // })), - // request: "/utils/index.mjs", - // condition_names: vec![], - // }, - // TestCase { - // name: "incorrect request #2", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": { - // "browser": "./a/", - // "default": "./b/" - // } - // })), - // request: "/utils/index.mjs", - // condition_names: vec!["browser"], - // }, - // TestCase { - // name: "incorrect request #3", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": { - // "browser": "./a/", - // "default": "./b/" - // } - // })), - // request: "../utils/index.mjs", - // condition_names: vec!["browser"], - // }, - // TestCase { - // name: "incorrect request #4", - // expect: None, - // exports_field: exports_field(json!({ - // "./utils/": { - // "browser": "./a/", - // "default": "./b/" - // } - // })), - // request: "/utils/index.mjs/", - // condition_names: vec!["browser"], - // }, - TestCase { - name: "backtracking package base #1", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./../../utils/": "./dist/" - })), - request: "./../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #1 (wildcard)", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./../../utils/*": "./dist/*" - })), - request: "./../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #2", - expect: None, - exports_field: exports_field(json!({ - "../../utils/": "./dist/" - })), - request: "../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #2 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "../../utils/*": "./dist/*" - })), - request: "../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #3", - expect: None, - exports_field: exports_field(json!({ - "./utils/": "../src/" - })), - request: "./utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #3 (wildcard)", - expect: None, - exports_field: exports_field(json!({ - "./utils/*": "../src/*" - })), - request: "./utils/index", - condition_names: vec![], - }, - // enhanced-resolve does not handle backtracking here - // TestCase { - // name: "backtracking package base #4", - // expect: Some(vec!["./../src/index"]), - // exports_field: exports_field(json!({ - // "./utils/": "./../src/" - // })), - // request: "./utils/index", - // condition_names: vec![], - // }, - // TestCase { - // name: "backtracking package base #4 (wildcard)", - // expect: Some(vec!["./../src/index"]), - // exports_field: exports_field(json!({ - // "./utils/*": "./../src/*" - // })), - // request: "./utils/index", - // condition_names: vec![], - // }, - // TestCase { - // name: "backtracking package base #5", - // expect: Some(vec!["./src/../index.js"]), - // exports_field: exports_field(json!({ - // "./utils/index": "./src/../index.js" - // })), - // request: "./utils/index", - // condition_names: vec![], - // }, - TestCase { - name: "backtracking package base #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/../utils/index": "./src/../index.js" - })), - request: "./utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #7", - expect: None, - exports_field: exports_field(json!({ - "./utils/": { - "browser": "../this/" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #7", - expect: None, - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "../this/*" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #8", - // We throw "InvalidPackageTarget" - // expect: Some(vec!["./utils/../index"]), - expect: None, - exports_field: exports_field(json!({ - "./utils/": { - "browser": "./utils/../" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #8 (wildcard)", - // We throw "InvalidPackageTarget" - // expect: Some(vec!["./utils/../index"]), - expect: None, - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "./utils/../*" - } - })), - request: "./utils/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #9", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./": "./src/../../", - "./dist/": "./dist/" - })), - request: "./dist/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #9 (wildcard)", - expect: Some(vec!["./dist/index"]), - exports_field: exports_field(json!({ - "./*": "./src/../../*", - "./dist/*": "./dist/*" - })), - request: "./dist/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking target folder #1", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../../index"]), - exports_field: exports_field(json!({ - "./utils/": "./dist/" - })), - request: "./utils/timezone/../../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #1 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../../index"]), - exports_field: exports_field(json!({ - "./utils/*": "./dist/*" - })), - request: "./utils/timezone/../../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #2", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../index"]), - exports_field: exports_field(json!({ - "./utils/": "./dist/" - })), - request: "./utils/timezone/../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #2 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/timezone/../index"]), - exports_field: exports_field(json!({ - "./utils/*": "./dist/*" - })), - request: "./utils/timezone/../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #3", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/target/../../index"]), - exports_field: exports_field(json!({ - "./utils/": "./dist/target/" - })), - request: "./utils/../../index", - condition_names: vec![], - }, - TestCase { - name: "backtracking target folder #3 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./dist/target/../../index"]), - exports_field: exports_field(json!({ - "./utils/*": "./dist/target/*" - })), - request: "./utils/../../index", - condition_names: vec![], - }, - // enhanced-resolve does not handle `node_modules` in target - TestCase { - name: "nested node_modules path #1", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": "./node_modules/" - } - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #1 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": "./node_modules/*" - } - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #2", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./utils/../node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/": "./utils/../node_modules/" - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "nested node_modules path #2 (wildcard)", - // We return InvalidPackageTarget - expect: None, - // expect: Some(vec!["./utils/../node_modules/lodash/dist/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": "./utils/../node_modules/*" - })), - request: "./utils/lodash/dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "nested mapping #1", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": "./", - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested mapping #1 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": "./*", - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "nested mapping #2 (wildcard)", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #2 (wildcard)", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "nested mapping #3", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["webpack"], - }, - TestCase { - name: "nested mapping #3 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["webpack"], - }, - TestCase { - name: "nested mapping #4", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["node", "browser"], - }, - TestCase { - name: "nested mapping #4 (wildcard)", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": "./node/*" - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["node", "browser"], - }, - TestCase { - name: "nested mapping #5", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node"], - }, - TestCase { - name: "nested mapping #5 (wildcard)", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": { - "webpack": [ - "./wpck/*" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node"], - }, - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - TestCase { - name: "nested mapping #6 (wildcard)", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./*", - "./node/*" - ], - "default": { - "node": { - "webpack": [ - "./wpck/*" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #6 (wildcard)", - expect: Some(vec!["./node/index.js"]), - exports_field: exports_field(json!({ - "./utils/*": { - "browser": { - "webpack": [ - "./node/*" - ], - "default": { - "node": { - "webpack": [ - "./wpck/*" - ] - } - } - } - } - })), - request: "./utils/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - TestCase { - name: "nested mapping #7", - expect: Some(vec!["./y.js"]), - exports_field: exports_field(json!({ - "./a.js": { - "abc": { - "def": "./x.js" - }, - "ghi": "./y.js" - } - })), - request: "./a.js", - condition_names: vec!["abc", "ghi"], - }, - TestCase { - name: "nested mapping #8", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "./a.js": { - "abc": { - "def": "./x.js", - "default": [] - }, - "ghi": "./y.js" - } - })), - request: "./a.js", - condition_names: vec!["abc", "ghi"], - }, - TestCase { - name: "syntax sugar #1", - expect: Some(vec!["./main.js"]), - exports_field: exports_field(json!("./main.js")), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #2", - expect: Some(vec![]), - exports_field: exports_field(json!("./main.js")), - request: "./lib.js", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #3", - expect: Some(vec!["./a.js"]), - exports_field: exports_field(json!(["./a.js", "./b.js"])), - request: ".", - condition_names: vec![], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "syntax sugar #3", - expect: Some(vec!["./b.js"]), - exports_field: exports_field(json!(["./b.js"])), - request: ".", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #4", - expect: Some(vec![]), - exports_field: exports_field(json!(["./a.js", "./b.js"])), - request: "./lib.js", - condition_names: vec![], - }, - TestCase { - name: "syntax sugar #5", - expect: Some(vec!["./index.js"]), - exports_field: exports_field(json!({ - "browser": { - "default": "./index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "syntax sugar #6", - expect: Some(vec![]), - exports_field: exports_field(json!({ - "browser": { - "default": "./index.js" - } - })), - request: "./lib.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "syntax sugar #7", - expect: None, - exports_field: exports_field(json!({ - "./node": "./node.js", - "browser": { - "default": "./index.js" - } - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "syntax sugar #8", - expect: None, - exports_field: exports_field(json!({ - "browser": { - "default": "./index.js" - }, - "./node": "./node.js" - })), - request: ".", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #1", - expect: Some(vec!["./abc/d"]), - exports_field: exports_field(json!({ - "./ab*": "./ab/*", - "./abc*": "./abc/*", - "./a*": "./a/*" - })), - request: "./abcd", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #2", - expect: Some(vec!["./abc/d/e"]), - exports_field: exports_field(json!({ - "./ab*": "./ab/*", - "./abc*": "./abc/*", - "./a*": "./a/*" - })), - request: "./abcd/e", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #3", - expect: Some(vec!["./abc/d"]), - exports_field: exports_field(json!({ - "./x/ab*": "./ab/*", - "./x/abc*": "./abc/*", - "./x/a*": "./a/*" - })), - request: "./x/abcd", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard longest #4", - expect: Some(vec!["./abc/d/e"]), - exports_field: exports_field(json!({ - "./x/ab*": "./ab/*", - "./x/abc*": "./abc/*", - "./x/a*": "./a/*" - })), - request: "./x/abcd/e", - condition_names: vec!["browser"], - }, - TestCase { - name: "path tree edge case #1", - expect: Some(vec!["./A/b/d.js"]), - exports_field: exports_field(json!({ - "./a/": "./A/", - "./a/b/c": "./c.js" - })), - request: "./a/b/d.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #1 (wildcard)", - expect: Some(vec!["./A/b/d.js"]), - exports_field: exports_field(json!({ - "./a/*": "./A/*", - "./a/b/c": "./c.js" - })), - request: "./a/b/d.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #2", - expect: Some(vec!["./A/c.js"]), - exports_field: exports_field(json!({ - "./a/": "./A/", - "./a/b": "./b.js" - })), - request: "./a/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #2 (wildcard)", - expect: Some(vec!["./A/c.js"]), - exports_field: exports_field(json!({ - "./a/*": "./A/*", - "./a/b": "./b.js" - })), - request: "./a/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #3", - expect: Some(vec!["./A/b/d/c.js"]), - exports_field: exports_field(json!({ - "./a/": "./A/", - "./a/b/c/d": "./c.js" - })), - request: "./a/b/d/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #3 (wildcard)", - expect: Some(vec!["./A/b/d/c.js"]), - exports_field: exports_field(json!({ - "./a/*": "./A/*", - "./a/b/c/d": "./c.js" - })), - request: "./a/b/d/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #1", - expect: Some(vec!["./A/b.js"]), - exports_field: exports_field(json!({ - "./a/*.js": "./A/*.js" - })), - request: "./a/b.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #2", - expect: Some(vec!["./A/b/c.js"]), - exports_field: exports_field(json!({ - "./a/*.js": "./A/*.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #3", - expect: Some(vec!["./A/b/c.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": "./A/*/c.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #4", - expect: Some(vec!["./A/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": "./A/*/*.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #5", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/*.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #5", - expect: Some(vec!["./browser/index.js"]), - exports_field: exports_field(json!({ - "./lib/*": { - "browser": [ - "./browser/*" - ] - }, - "./dist/*.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./lib/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #6", - expect: Some(vec!["./browser/foo/bar.js"]), - exports_field: exports_field(json!({ - "./lib/*/bar.js": { - "browser": [ - "./browser/*/bar.js" - ] - }, - "./dist/*/bar.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./lib/foo/bar.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #6", - expect: Some(vec!["./browser/foo.js"]), - exports_field: exports_field(json!({ - "./lib/*/bar.js": { - "browser": [ - "./browser/*/bar.js" - ] - }, - "./dist/*/bar.js": { - "node": "./*.js", - "default": "./browser/*.js" - } - })), - request: "./dist/foo/bar.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "wildcard pattern #7", - expect: Some(vec!["./browser/foo/default.js"]), - exports_field: exports_field(json!({ - "./lib/*/bar.js": { - "browser": [ - "./browser/*/bar.js" - ] - }, - "./dist/*/bar.js": { - "node": "./*.js", - "default": "./browser/*/default.js" - } - })), - request: "./dist/foo/bar.js", - condition_names: vec!["default"], - }, - TestCase { - name: "wildcard pattern #8", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": "./A/*/*/*.js" - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #9", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": [ - "./A/*/*/*.js", - "./B/*/*/*.js" - ] - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "wildcard pattern #9", - expect: Some(vec!["./B/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*/c.js": [ - "./B/*/*/*.js" - ] - })), - request: "./a/b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #10", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/foo-*/c.js": "./A/*/*/*.js" - })), - request: "./a/foo-b/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #11", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/*-foo/c.js": "./A/*/*/*.js" - })), - request: "./a/b-foo/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #12", - expect: Some(vec!["./A/b/b/b.js"]), - exports_field: exports_field(json!({ - "./a/foo-*-foo/c.js": "./A/*/*/*.js" - })), - request: "./a/foo-b-foo/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #13", - expect: Some(vec!["./A/b/c/d.js"]), - exports_field: exports_field(json!({ - "./a/foo-*-foo/c.js": "./A/b/c/d.js" - })), - request: "./a/foo-b-foo/c.js", - condition_names: vec![], - }, - TestCase { - name: "wildcard pattern #14", - expect: Some(vec!["./A/b/c/*.js"]), - exports_field: exports_field(json!({ - "./a/foo-foo/c.js": "./A/b/c/*.js" - })), - request: "./a/foo-foo/c.js", - condition_names: vec![], - }, - ]; - - for case in test_cases { - let resolved = Resolver::new(ResolveOptions { - condition_names: case - .condition_names - .iter() - .map(ToString::to_string) - .collect::>(), - ..ResolveOptions::default() - }) - .package_exports_resolve( - Path::new(""), - case.request, - &case.exports_field, - &mut Ctx::default(), - ) - .map(|p| p.map(|p| p.to_path_buf())); - if let Some(expect) = case.expect { - if expect.is_empty() { - assert!( - matches!(resolved, Err(ResolveError::PackagePathNotExported(_, _))), - "{} {:?}", - &case.name, - &resolved - ); - } else { - for expect in expect { - assert_eq!(resolved, Ok(Some(Path::new(expect).normalize())), "{}", &case.name); - } - } - } else { - assert!(resolved.is_err(), "{} {resolved:?}", &case.name); - } - } -} diff --git a/src/tests/extension_alias.rs b/src/tests/extension_alias.rs deleted file mode 100644 index cc6a906b..00000000 --- a/src/tests/extension_alias.rs +++ /dev/null @@ -1,70 +0,0 @@ -//! - -use crate::{ResolveError, ResolveOptions, Resolver}; - -#[test] -fn extension_alias() { - let f = super::fixture().join("extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - extension_alias: vec![ - (".js".into(), vec![".ts".into(), ".js".into()]), - (".mjs".into(), vec![".mts".into()]), - ], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should alias fully specified file", f.clone(), "./index.js", f.join("index.ts")), - ("should alias fully specified file when there are two alternatives", f.clone(), "./dir/index.js", f.join("dir/index.ts")), - ("should also allow the second alternative", f.clone(), "./dir2/index.js", f.join("dir2/index.js")), - ("should support alias option without an array", f.clone(), "./dir2/index.mjs", f.join("dir2/index.mts")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } - - #[rustfmt::skip] - let fail = [ - ("should not allow to fallback to the original extension or add extensions", f.clone(), "./index.mjs"), - ]; - - for (comment, path, request) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!( - resolution, - Err(ResolveError::ExtensionAlias(f.join(request))), - "{comment} {path:?} {request}" - ); - } -} - -// should not apply extension alias to extensions or mainFiles field -#[test] -fn not_apply_to_extension_nor_main_files() { - let f = super::fixture().join("extension-alias"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - extension_alias: vec![(".js".into(), vec![])], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("directory", f.clone(), "./dir2", "dir2/index.js"), - ("file", f.clone(), "./dir2/index", "dir2/index.js"), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - let expected = f.join(expected); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} diff --git a/src/tests/extensions.rs b/src/tests/extensions.rs deleted file mode 100644 index 1ebd86f4..00000000 --- a/src/tests/extensions.rs +++ /dev/null @@ -1,125 +0,0 @@ -//! - -use crate::{EnforceExtension, Resolution, ResolveContext, ResolveError, ResolveOptions, Resolver}; -use rustc_hash::FxHashSet; - -#[test] -fn extensions() { - let f = super::fixture().join("extensions"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".ts".into(), ".js".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve according to order of provided extensions", "./foo", "foo.ts"), - ("should resolve according to order of provided extensions (dir index)", "./dir", "dir/index.ts"), - ("should resolve according to main field in module root", ".", "index.js"), - // This is a core module - // ("should resolve single file module before directory", "module", "node_modules/module.js"), - ("should resolve trailing slash directory before single file", "module/", "node_modules/module/index.ts"), - ]; - - for (comment, request, expected_path) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - let expected = f.join(expected_path); - assert_eq!(resolved_path, Ok(expected), "{comment} {request} {expected_path}"); - } - - #[rustfmt::skip] - let fail = [ - ("not resolve to file when request has a trailing slash (relative)", "./foo.js/", "./foo.js/".into()) - ]; - - for (comment, request, expected_error) in fail { - let resolution = resolver.resolve(&f, request); - let error = ResolveError::NotFound(expected_error); - assert_eq!(resolution, Err(error), "{comment} {request} {resolution:?}"); - } -} - -// should default enforceExtension to true when extensions includes an empty string -#[test] -fn default_enforce_extension() { - let f = super::fixture().join("extensions"); - - let mut ctx = ResolveContext::default(); - let resolved = Resolver::new(ResolveOptions { - extensions: vec![".ts".into(), String::new(), ".js".into()], - ..ResolveOptions::default() - }) - .resolve_with_context(&f, "./foo", &mut ctx); - - assert_eq!(resolved.map(Resolution::into_path_buf), Ok(f.join("foo.ts"))); - assert_eq!( - ctx.file_dependencies, - FxHashSet::from_iter([f.join("foo.ts"), f.join("package.json")]) - ); - assert!(ctx.missing_dependencies.is_empty()); -} - -// should respect enforceExtension when extensions includes an empty string -#[test] -fn respect_enforce_extension() { - let f = super::fixture().join("extensions"); - - let mut ctx = ResolveContext::default(); - let resolved = Resolver::new(ResolveOptions { - enforce_extension: EnforceExtension::Disabled, - extensions: vec![".ts".into(), String::new(), ".js".into()], - ..ResolveOptions::default() - }) - .resolve_with_context(&f, "./foo", &mut ctx); - - assert_eq!(resolved.map(Resolution::into_path_buf), Ok(f.join("foo.ts"))); - assert_eq!( - ctx.file_dependencies, - FxHashSet::from_iter([f.join("foo.ts"), f.join("package.json")]) - ); - assert_eq!(ctx.missing_dependencies, FxHashSet::from_iter([f.join("foo")])); -} - -#[test] -fn multi_dot_extension() { - let f = super::fixture().join("extensions"); - - let resolver = Resolver::new(ResolveOptions { - // Test for `.d.ts`, not part of enhanced-resolve. - extensions: vec![".a.b.c".into(), ".d.ts".into(), ".ts".into(), ".js".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve according to order of provided extensions", "./foo", "foo.ts"), - ("should resolve file with extension", "./app.module", "app.module.js") - ]; - - for (comment, request, expected_path) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - let expected = f.join(expected_path); - assert_eq!(resolved_path, Ok(expected), "{comment} {request} {expected_path}"); - } - - #[rustfmt::skip] - let fail = [ - ("not resolve to file", "./index.", "./index.".into()) - ]; - - for (comment, request, expected_error) in fail { - let resolution = resolver.resolve(&f, request); - let error = ResolveError::NotFound(expected_error); - assert_eq!(resolution, Err(error), "{comment} {request} {resolution:?}"); - } -} - -#[test] -#[should_panic = "All extensions must start with a leading dot"] -fn without_leading_dot() { - Resolver::new(ResolveOptions { - extensions: vec!["ts".into(), "js".into()], - ..ResolveOptions::default() - }); -} diff --git a/src/tests/fallback.rs b/src/tests/fallback.rs deleted file mode 100644 index 3da2d767..00000000 --- a/src/tests/fallback.rs +++ /dev/null @@ -1,100 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/fallback.test.js - -#[test] -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -fn fallback() { - use super::memory_fs::MemoryFS; - use crate::{AliasValue, ResolveError, ResolveOptions, ResolverGeneric}; - use std::path::{Path, PathBuf}; - - let f = Path::new("/"); - - let file_system = MemoryFS::new(&[ - ("/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", ""), - ]); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - fallback: vec![ - ("aliasA".into(), vec![AliasValue::Path("a".into())]), - ("b$".into(), vec![AliasValue::Path("a/index".into())]), - ("c$".into(), vec![AliasValue::Path("/a/index".into())]), - ( - "multiAlias".into(), - vec![ - AliasValue::Path("b".into()), - AliasValue::Path("c".into()), - AliasValue::Path("d".into()), - AliasValue::Path("e".into()), - AliasValue::Path("a".into()), - ], - ), - ("recursive".into(), vec![AliasValue::Path("recursive/dir".into())]), - ("/d/dir".into(), vec![AliasValue::Path("/c/dir".into())]), - ("/d/index.js".into(), vec![AliasValue::Path("/c/index".into())]), - ("ignored".into(), vec![AliasValue::Ignore]), - ("node:path".into(), vec![AliasValue::Ignore]), - ], - modules: vec!["/".into()], - ..ResolveOptions::default() - }, - ); - - #[rustfmt::skip] - let pass = [ - ("should resolve a not aliased module 1", "a", "/a/index"), - ("should resolve a not aliased module 2", "a/index", "/a/index"), - ("should resolve a not aliased module 3", "a/dir", "/a/dir/index"), - ("should resolve a not aliased module 4", "a/dir/index", "/a/dir/index"), - ("should resolve an fallback module 1", "aliasA", "/a/index"), - ("should resolve an fallback module 2", "aliasA/index", "/a/index"), - ("should resolve an fallback module 3", "aliasA/dir", "/a/dir/index"), - ("should resolve an fallback module 4", "aliasA/dir/index", "/a/dir/index"), - ("should resolve a recursive aliased module 1", "recursive", "/recursive/index"), - ("should resolve a recursive aliased module 2", "recursive/index", "/recursive/index"), - ("should resolve a recursive aliased module 3", "recursive/dir", "/recursive/dir/index"), - ("should resolve a recursive aliased module 4", "recursive/dir/index", "/recursive/dir/index"), - ("should resolve a recursive aliased module 5", "recursive/file", "/recursive/dir/file"), - ("should resolve a file aliased module with a query 1", "b?query", "/b/index?query"), - ("should resolve a file aliased module with a query 2", "c?query", "/c/index?query"), - ("should resolve a path in a file aliased module 1", "b/index", "/b/index"), - ("should resolve a path in a file aliased module 2", "b/dir", "/b/dir/index"), - ("should resolve a path in a file aliased module 3", "b/dir/index", "/b/dir/index"), - ("should resolve a path in a file aliased module 4", "c/index", "/c/index"), - ("should resolve a path in a file aliased module 5", "c/dir", "/c/dir/index"), - ("should resolve a path in a file aliased module 6", "c/dir/index", "/c/dir/index"), - ("should resolve a file in multiple aliased dirs 1", "multiAlias/dir/file", "/e/dir/file"), - ("should resolve a file in multiple aliased dirs 2", "multiAlias/anotherDir", "/e/anotherDir/index"), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - - #[rustfmt::skip] - let ignore = [ - ("should resolve an ignore module", "ignored", ResolveError::Ignored(f.join("ignored"))), - ("should resolve node: builtin module", "node:path", ResolveError::Ignored(PathBuf::from("/node:path"))), - ]; - - for (comment, request, expected) in ignore { - let resolution = resolver.resolve(f, request); - assert_eq!(resolution, Err(expected), "{comment} {request}"); - } -} diff --git a/src/tests/full_specified.rs b/src/tests/full_specified.rs deleted file mode 100644 index a70c0191..00000000 --- a/src/tests/full_specified.rs +++ /dev/null @@ -1,113 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/fullSpecified.test.js - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows { - use std::path::PathBuf; - - use crate::{AliasValue, ResolveOptions, ResolverGeneric}; - - use super::super::memory_fs::MemoryFS; - - fn file_system() -> MemoryFS { - MemoryFS::new(&[ - ("/a/node_modules/package1/index.js", ""), - ("/a/node_modules/package1/file.js", ""), - ("/a/node_modules/package2/package.json", r#"{"main":"a"}"#), - ("/a/node_modules/package2/a.js", ""), - ("/a/node_modules/package3/package.json", r#"{"main":"dir"}"#), - ("/a/node_modules/package3/dir/index.js", ""), - ("/a/node_modules/package4/package.json", r#"{"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", ""), - ]) - } - - #[test] - fn test() { - let file_system = file_system(); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - alias: vec![ - ("alias1".into(), vec![AliasValue::from("/a/abc")]), - ("alias2".into(), vec![AliasValue::from("/a")]), - ], - alias_fields: vec![vec!["browser".into()]], - fully_specified: true, - ..ResolveOptions::default() - }, - ); - - let failing_resolves = [ - ("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"), - ]; - - for (comment, request) in failing_resolves { - let resolution = resolver.resolve("/a", request); - assert!(resolution.is_err(), "{comment} {request}"); - } - - let successful_resolves = [ - ("fully relative", "./abc.js", "/a/abc.js"), - ("fully absolute", "/a/abc.js", "/a/abc.js"), - ("fully relative in package", "package1/file.js", "/a/node_modules/package1/file.js"), - ("extensions in mainFiles", "package1", "/a/node_modules/package1/index.js"), - ("extensions in mainFields", "package2", "/a/node_modules/package2/a.js"), - ("extensions in alias", "alias1", "/a/abc.js"), - ("directories in alias", "alias2", "/a/index.js"), - ("directories in packages", "package3", "/a/node_modules/package3/dir/index.js"), - ("extensions in aliasFields", "package4/a.js", "/a/node_modules/package4/b.js"), - ]; - - for (comment, request, expected) in successful_resolves { - let resolution = resolver.resolve("/a", request).map(|r| r.full_path()); - assert_eq!(resolution, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - } - - #[test] - #[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. - fn resolve_to_context() { - let file_system = file_system(); - - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions { - alias: vec![ - ("alias1".into(), vec![AliasValue::from("/a/abc")]), - ("alias2".into(), vec![AliasValue::from("/a")]), - ], - alias_fields: vec![vec!["browser".into()]], - fully_specified: true, - resolve_to_context: true, - ..ResolveOptions::default() - }, - ); - - let successful_resolves = [ - ("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", "/a/node_modules/package3/dir"), - ]; - - for (comment, request, expected) in successful_resolves { - let resolution = resolver.resolve("/a", request).map(|r| r.full_path()); - assert_eq!(resolution, Ok(PathBuf::from(expected)), "{comment} {request}"); - } - } -} diff --git a/src/tests/imports_field.rs b/src/tests/imports_field.rs deleted file mode 100644 index c928627a..00000000 --- a/src/tests/imports_field.rs +++ /dev/null @@ -1,1320 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/importsField.test.js -//! -//! The huge imports field test cases are at the bottom of this file. - -use serde_json::json; - -use crate::{Ctx, JSONMap, PathUtil, ResolveError, ResolveOptions, Resolver}; -use std::path::Path; - -#[test] -fn test_simple() { - let f = super::fixture().join("imports-field"); - let f2 = super::fixture().join("imports-exports-wildcard/node_modules/m/"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve using imports field instead of self-referencing", f.clone(), "#imports-field", f.join("b.js")), - ("should resolve using imports field instead of self-referencing for a subpath", f.join("dir"), "#imports-field", f.join("b.js")), - ("should resolve package #1", f.clone(), "#a/dist/main.js", f.join("node_modules/a/lib/lib2/main.js")), - ("should resolve package #3", f.clone(), "#ccc/index.js", f.join("node_modules/c/index.js")), - ("should resolve package #4", f.clone(), "#c", f.join("node_modules/c/index.js")), - ("should resolve with wildcard pattern", f2.clone(), "#internal/i.js", f2.join("src/internal/i.js")), - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } - - // Note added: - // * should resolve absolute path as an imports field target - // * should log the correct info - - #[rustfmt::skip] - let fail = [ - ("should disallow resolve out of package scope", f.clone(), "#b", ResolveError::InvalidPackageTarget("../b.js".to_string(), "#b".to_string(), f.join("package.json"))), - ("should resolve package #2", f.clone(), "#a", ResolveError::PackageImportNotDefined("#a".to_string(), f.join("package.json"))), - ]; - - for (comment, path, request, error) in fail { - let resolution = resolver.resolve(&path, request); - assert_eq!(resolution, Err(error), "{comment} {path:?} {request}"); - } -} - -#[test] -fn shared_resolvers() { - let f = super::fixture().join("imports-field"); - - // field name #1 - let resolver1 = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - main_files: vec!["index.js".into()], - imports_fields: vec![vec!["imports".into()]], - condition_names: vec!["webpack".into()], - ..ResolveOptions::default() - }); - - let resolved_path = resolver1.resolve(&f, "#imports-field").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("b.js"))); - - // field name #2 - let resolver2 = resolver1.clone_with_options(ResolveOptions { - imports_fields: vec![vec!["other".into(), "imports".into()]], - ..ResolveOptions::default() - }); - - let resolved_path = resolver2.resolve(&f, "#b").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("a.js"))); -} - -// Small script for generating the test cases from enhanced_resolve -// for (c of testCases) { -// console.log("TestCase {") -// console.log(`name: ${JSON.stringify(c.name)},`) -// if (c.expect instanceof Error) { -// console.log(`expect: None,`) -// } else { -// console.log(`expect: Some(vec!${JSON.stringify(c.expect)}),`) -// } -// console.log(`imports_field: imports_field(json!(${JSON.stringify(c.suite[0], null, 2)})),`) -// console.log(`request: "${c.suite[1]}",`) -// console.log(`condition_names: vec!${JSON.stringify(c.suite[2])},`) -// console.log("},") -// } - -struct TestCase { - name: &'static str, - expect: Option>, - imports_field: JSONMap, - request: &'static str, - condition_names: Vec<&'static str>, -} - -#[allow(clippy::needless_pass_by_value)] -fn imports_field(value: serde_json::Value) -> JSONMap { - let s = serde_json::to_string(&value).unwrap(); - serde_json::from_str(&s).unwrap() -} - -#[test] -fn test_cases() { - let test_cases = [ - TestCase { - name: "sample #1", - expect: Some(vec!["./dist/test/file.js"]), - imports_field: imports_field(json!({ - "#abc/": { - "import": [ - "./dist/", - "./src/" - ], - "webpack": "./wp/" - }, - "#abc": "./main.js" - })), - request: "#abc/test/file.js", - condition_names: vec!["import", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "sample #1", - expect: Some(vec!["./src/test/file.js"]), - imports_field: imports_field(json!({ - "#abc/": { - "import": [ - "./src/" - ], - "webpack": "./wp/" - }, - "#abc": "./main.js" - })), - request: "#abc/test/file.js", - condition_names: vec!["import", "webpack"], - }, - TestCase { - name: "sample #2", - expect: Some(vec!["./data/timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#1/timezones/": "./data/timezones/" - })), - request: "#1/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #3", - expect: Some(vec!["./data/timezones/timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#aaa/": "./data/timezones/", - "#a/": "./data/timezones/" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #4", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/lib/": { - "browser": [ - "./browser/" - ] - }, - "#a/dist/index.js": { - "node": "./index.js" - } - })), - request: "#a/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #5", - expect: Some(vec!["./browser/index.js"]), - imports_field: imports_field(json!({ - "#a/lib/": { - "browser": [ - "./browser/" - ] - }, - "#a/dist/index.js": { - "node": "./index.js", - "default": "./browser/index.js" - } - })), - request: "#a/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "sample #6", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/dist/a": "./dist/index.js" - })), - request: "#a/dist/aaa", - condition_names: vec![], - }, - TestCase { - name: "sample #7", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/a/a/": "./dist/index.js" - })), - request: "#a/a/a", - condition_names: vec![], - }, - TestCase { - name: "sample #8", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": "./index.js" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "sample #9", - expect: Some(vec!["./main.js"]), - imports_field: imports_field(json!({ - "#a/index.js": "./main.js" - })), - request: "#a/index.js", - condition_names: vec![], - }, - TestCase { - name: "sample #10", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #11", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/bar#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #12", - expect: Some(vec!["./ok.js#abc"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/ok.js#abc", - condition_names: vec![], - }, - TestCase { - name: "sample #13", - expect: Some(vec!["./ok.js?abc"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/ok.js?abc", - condition_names: vec![], - }, - TestCase { - name: "sample #14", - expect: Some(vec!["./🎉.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/🎉.js", - condition_names: vec![], - }, - TestCase { - name: "sample #15", - expect: Some(vec!["./%F0%9F%8E%89.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/#zapp/%F0%9F%8E%89.js", - condition_names: vec![], - }, - TestCase { - name: "sample #16", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/🎉", - condition_names: vec![], - }, - TestCase { - name: "sample #17", - expect: Some(vec!["./other.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/%F0%9F%8E%89", - condition_names: vec![], - }, - TestCase { - name: "sample #18", - expect: Some(vec!["./ok.js"]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/module", - condition_names: vec![], - }, - TestCase { - name: "sample #19", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/module#foo", - condition_names: vec![], - }, - TestCase { - name: "sample #20", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#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/": "./" - })), - request: "#a/module?foo", - condition_names: vec![], - }, - TestCase { - name: "sample #21", - expect: Some(vec!["./d?e?f"]), - imports_field: imports_field(json!({ - "#a/a?b?c/": "./" - })), - request: "#a/a?b?c/d?e?f", - condition_names: vec![], - }, - TestCase { - name: "sample #22", - // We throw InvalidPackageTarget - expect: None, - // expect: Some(vec!["/user/a/index"]), - imports_field: imports_field(json!({ - "#a/": "/user/a/" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #1", - expect: Some(vec!["./A/b/d.js"]), - imports_field: imports_field(json!({ - "#a/": "./A/", - "#a/b/c": "./c.js" - })), - request: "#a/b/d.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #2", - expect: Some(vec!["./A/c.js"]), - imports_field: imports_field(json!({ - "#a/": "./A/", - "#a/b": "./b.js" - })), - request: "#a/c.js", - condition_names: vec![], - }, - TestCase { - name: "path tree edge case #3", - expect: Some(vec!["./A/b/c/d.js"]), - imports_field: imports_field(json!({ - "#a/": "./A/", - "#a/b/c/d": "./c.js" - })), - request: "#a/b/c/d.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #1", - expect: Some(vec!["./dist/index.js"]), - imports_field: imports_field(json!({ - "#a": "./dist/index.js" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #2", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": "./" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #3", - expect: Some(vec!["./dist/a.js"]), - imports_field: imports_field(json!({ - "#a/": "./dist/", - "#a/index.js": "./dist/a.js" - })), - request: "#a/index.js", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #4", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "./browser/" - ] - }, - "#a/index.js": { - "browser": "./index.js" - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #5", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "./browser/" - ] - }, - "#a/index.js": { - "node": "./node.js" - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #6", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: "#a", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #7", - expect: Some(vec!["./src/index.js"]), // `enhanced_resolve` is `None` - imports_field: imports_field(json!({ - "#a": { - "default": "./src/index.js", - "browser": "./index.js", - "node": "./src/node/index.js" - } - })), - request: "#a", - condition_names: vec!["browser"], - }, - TestCase { - name: "Direct mapping #8", - expect: Some(vec!["./src/index.js"]), - imports_field: imports_field(json!({ - "#a": { - "browser": "./index.js", - "node": "./src/node/index.js", - "default": "./src/index.js" - } - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #9", - expect: Some(vec!["./index"]), - imports_field: imports_field(json!({ - "#a": "./index" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #10", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/index": "./index.js" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #11", - // We throw InvalidPackageTarget - // expect: Some(vec!["b"]), - expect: None, - imports_field: imports_field(json!({ - "#a": "b" - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #12", - // We throw InvalidPackageTarget - // expect: Some(vec!["b/index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "b/" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "Direct mapping #13", - // We throw InvalidPackageTarget - // expect: Some(vec!["b#anotherhashishere"]), - expect: None, - imports_field: imports_field(json!({ - "#a?q=a#hashishere": "b#anotherhashishere" - })), - request: "#a?q=a#hashishere", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #1", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec![], - }, - TestCase { - name: "Direct and conditional mapping #2", - expect: Some(vec!["./import.mjs"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec!["import"], - }, - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./require.js"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": "./require.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #3", - expect: Some(vec!["./import.mjs"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "import": "./import.mjs" - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./require.js"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "require": [ - "./require.js" - ] - }, - { - "import": [ - "./import.mjs", - "#b/import.js" - ] - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec!["./import.mjs"]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "./import.mjs", - "#b/import.js" - ] - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "Direct and conditional mapping #4", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": [ - { - "browser": "./browser.js" - }, - { - "import": [ - "#b/import.js" - ] - } - ] - })), - request: "#a", - condition_names: vec!["import", "require"], - }, - TestCase { - name: "mapping to a folder root #1", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#timezones": "./data/timezones/" - })), - request: "#timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #2", - expect: None, - imports_field: imports_field(json!({ - "#timezones/": "./data/timezones" - })), - request: "#timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #3", - expect: Some(vec!["./data/timezones/pdt/index.mjs"]), - imports_field: imports_field(json!({ - "#timezones/pdt/": "./data/timezones/pdt/" - })), - request: "#timezones/pdt/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #4", - expect: Some(vec!["./timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#a/": "./timezones/" - })), - request: "#a/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #5", - expect: Some(vec!["./timezones/pdt.mjs"]), - imports_field: imports_field(json!({ - "#a/": "./" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #6", - expect: None, - imports_field: imports_field(json!({ - "#a/": "." - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "mapping to a folder root #7", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a": "./" - })), - request: "#a/timezones/pdt.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #1", - expect: Some(vec!["./lib/index.mjs"]), - imports_field: imports_field(json!({ - "#a/": "./", - "#a/dist/": "./lib/" - })), - request: "#a/dist/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #2", - expect: Some(vec!["./dist/utils/index.js"]), - imports_field: imports_field(json!({ - "#a/dist/utils/": "./dist/utils/", - "#a/dist/": "./lib/" - })), - request: "#a/dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #3", - expect: Some(vec!["./dist/utils/index.js"]), - imports_field: imports_field(json!({ - "#a/dist/utils/index.js": "./dist/utils/index.js", - "#a/dist/utils/": "./dist/utils/index.mjs", - "#a/dist/": "./lib/" - })), - request: "#a/dist/utils/index.js", - condition_names: vec![], - }, - TestCase { - name: "the longest matching path prefix is prioritized #4", - expect: Some(vec!["./lib/index.mjs"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./browser/" - }, - "#a/dist/": "./lib/" - })), - request: "#a/dist/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #1", - // This behaves differently from enhanced_resolve, because `lodash/` is an an InvalidPackageConfig - // expect: Some(vec!["lodash/index.js"]), - expect: Some(vec!["./utils/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "conditional mapping folder #1", - expect: Some(vec!["./utils/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": [ - "./utils/" - ], - "node": [ - "./utils-node/" - ] - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "conditional mapping folder #2", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./node/" - ] - } - })), - request: "#a/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "conditional mapping folder #3", - expect: Some(vec!["./wpk/index.mjs"]), - imports_field: imports_field(json!({ - "#a/": { - "webpack": "./wpk/", - "browser": [ - "lodash/", - "./utils/" - ], - "node": [ - "./utils/" - ] - } - })), - request: "#a/index.mjs", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "incorrect exports field #1", - // We throw `PackageImportNotDefined` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "/utils/": "./a/" - })), - request: "#a/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #2", - // We throw `PackageImportNotDefined` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "/utils/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#a/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #3", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index": "./a/index.js" - })), - request: "#a/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #4", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index.mjs": "./a/index.js" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "incorrect exports field #5", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "#a/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect exports field #6", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/index.mjs": { - "browser": "./a/index.js", - "default": "./b/index.js" - } - })), - request: "#a/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #1", - // We don't throw in `package_imports_exports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": "./a/" - })), - request: "/utils/index.mjs", - condition_names: vec![], - }, - TestCase { - name: "incorrect request #2", - // We don't throw in `package_imports_exports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "./utils/index.mjs", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #3", - // We don't throw in `package_imports_exports_resolve`, it's thrown in `package_imports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #4", - // We don't throw in `package_imports_exports_resolve`, it's thrown in `package_imports_resolve` - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#/", - condition_names: vec!["browser"], - }, - TestCase { - name: "incorrect request #5", - // expect: None, - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": "./a/", - "default": "./b/" - } - })), - request: "#a/", - condition_names: vec!["browser"], - }, - TestCase { - name: "backtracking package base #1", - // expect: Some(vec!["./dist/index"]), - expect: Some(vec!["dist/index"]), - imports_field: imports_field(json!({ - "#a/../../utils/": "./dist/" - })), - request: "#a/../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #2", - // We throw InvalidPackageTarget - // expect: Some(vec!["./dist/../../utils/index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "./dist/" - })), - request: "#a/../../utils/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #3", - // We throw InvalidPackageTarget - // expect: Some(vec!["../src/index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "../src/" - })), - request: "#a/index", - condition_names: vec![], - }, - TestCase { - name: "backtracking package base #4", - // We throw InvalidPackageTarget - // expect: Some(vec!["./utils/../../../index"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": { - "browser": "./utils/../../../" - } - })), - request: "#a/index", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #1", - // expect: Some(vec!["moment/node_modules/lodash/dist/index.js"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": { - "browser": "moment/node_modules/" - } - })), - request: "#a/lodash/dist/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested node_modules path #2", - // We throw InvalidPackageTarget - // expect: Some(vec!["../node_modules/lodash/dist/index.js"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": "../node_modules/" - })), - request: "#a/lodash/dist/index.js", - condition_names: vec![], - }, - TestCase { - name: "nested mapping #1", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": "./", - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser"], - }, - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #2", - expect: Some(vec!["./node/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "webpack"], - }, - TestCase { - name: "nested mapping #3", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "./node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["webpack"], - }, - TestCase { - name: "nested mapping #4", - // We throw NotFound - // expect: Some(vec!["moment/node/index.js"]), - expect: None, - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": "moment/node/" - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["node", "browser"], - }, - TestCase { - name: "nested mapping #5", - expect: Some(vec![]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "node"], - }, - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./", - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - // Duplicated due to not supporting returning an array - TestCase { - name: "nested mapping #6", - expect: Some(vec!["./node/index.js"]), - imports_field: imports_field(json!({ - "#a/": { - "browser": { - "webpack": [ - "./node/" - ], - "default": { - "node": { - "webpack": [ - "./wpck/" - ] - } - } - } - } - })), - request: "#a/index.js", - condition_names: vec!["browser", "node", "webpack"], - }, - TestCase { - name: "nested mapping #7", - expect: Some(vec!["./y.js"]), - imports_field: imports_field(json!({ - "#a": { - "abc": { - "def": "./x.js" - }, - "ghi": "./y.js" - } - })), - request: "#a", - condition_names: vec!["abc", "ghi"], - }, - TestCase { - name: "nested mapping #8", - // We throw PackageImportNotDefined - // expect: Some(vec![]), - expect: None, - imports_field: imports_field(json!({ - "#a": { - "abc": { - "def": "./x.js", - "default": [] - }, - "ghi": "./y.js" - } - })), - request: "#a", - condition_names: vec!["abc", "ghi"], - }, - ]; - - for case in test_cases { - let resolved = Resolver::default() - .package_imports_exports_resolve( - case.request, - &case.imports_field, - Path::new(""), - true, - &case.condition_names.iter().map(ToString::to_string).collect::>(), - &mut Ctx::default(), - ) - .map(|p| p.map(|p| p.to_path_buf())); - if let Some(expect) = case.expect { - if expect.is_empty() { - assert!(matches!(resolved, Ok(None)), "{} {:?}", &case.name, &resolved); - } else { - for expect in expect { - assert_eq!(resolved, Ok(Some(Path::new(expect).normalize())), "{}", &case.name); - } - } - } else { - assert!(resolved.is_err(), "{} {resolved:?}", &case.name); - } - } -} diff --git a/src/tests/incorrect_description_file.rs b/src/tests/incorrect_description_file.rs deleted file mode 100644 index e2caecbb..00000000 --- a/src/tests/incorrect_description_file.rs +++ /dev/null @@ -1,65 +0,0 @@ -//! - -use rustc_hash::FxHashSet; - -use crate::{JSONError, Resolution, ResolveContext, ResolveError, ResolveOptions, Resolver}; - -// should not resolve main in incorrect description file #1 -#[test] -fn incorrect_description_file_1() { - let f = super::fixture().join("incorrect-package"); - let mut ctx = ResolveContext::default(); - let resolution = Resolver::default().resolve_with_context(f.join("pack1"), ".", &mut ctx); - let error = ResolveError::JSON(JSONError { - path: f.join("pack1/package.json"), - message: String::from("EOF while parsing a value at line 3 column 0"), - line: 3, - column: 0, - }); - assert_eq!(resolution, Err(error)); - assert_eq!( - ctx.file_dependencies, - FxHashSet::from_iter([f.join("pack1"), f.join("pack1/package.json")]) - ); - assert!(!ctx.missing_dependencies.is_empty()); -} - -// should not resolve main in incorrect description file #2 -#[test] -fn incorrect_description_file_2() { - let f = super::fixture().join("incorrect-package"); - let resolution = Resolver::default().resolve(f.join("pack2"), "."); - let error = ResolveError::JSON(JSONError { - path: f.join("pack2/package.json"), - message: String::from("EOF while parsing a value at line 1 column 0"), - line: 1, - column: 0, - }); - assert_eq!(resolution, Err(error)); -} - -// should not resolve main in incorrect description file #3 -#[test] -fn incorrect_description_file_3() { - let f = super::fixture().join("incorrect-package"); - let resolution = Resolver::default().resolve(f.join("pack2"), "."); - assert!(resolution.is_err()); -} - -// `enhanced_resolve` does not have this test case -#[test] -fn no_description_file() { - let f = super::fixture_root().join("enhanced_resolve"); - - // has description file - let resolver = Resolver::default(); - assert_eq!( - resolver.resolve(&f, ".").map(Resolution::into_path_buf), - Ok(f.join("lib/index.js")) - ); - - // without description file - let resolver = - Resolver::new(ResolveOptions { description_files: vec![], ..ResolveOptions::default() }); - assert_eq!(resolver.resolve(&f, "."), Err(ResolveError::NotFound(".".into()))); -} diff --git a/src/tests/main_field.rs b/src/tests/main_field.rs deleted file mode 100644 index 3cadc8ce..00000000 --- a/src/tests/main_field.rs +++ /dev/null @@ -1,24 +0,0 @@ -//! Not part of enhanced_resolve's test suite - -use crate::{ResolveOptions, Resolver}; - -#[test] -fn test() { - let f = super::fixture().join("restrictions"); - - let resolver1 = Resolver::new(ResolveOptions { - main_fields: vec!["style".into()], - ..ResolveOptions::default() - }); - - let resolution = resolver1.resolve(&f, "pck2").map(|r| r.full_path()); - assert_eq!(resolution, Ok(f.join("node_modules/pck2/index.css"))); - - let resolver2 = resolver1.clone_with_options(ResolveOptions { - main_fields: vec!["module".into(), "main".into()], - ..ResolveOptions::default() - }); - - let resolution = resolver2.resolve(&f, "pck2").map(|r| r.full_path()); - assert_eq!(resolution, Ok(f.join("node_modules/pck2/module.js"))); -} diff --git a/src/tests/memory_fs.rs b/src/tests/memory_fs.rs deleted file mode 100644 index e4116609..00000000 --- a/src/tests/memory_fs.rs +++ /dev/null @@ -1,74 +0,0 @@ -use std::{ - io, - path::{Path, PathBuf}, -}; - -use crate::{FileMetadata, FileSystem}; - -#[derive(Default)] -pub struct MemoryFS { - fs: vfs::MemoryFS, -} - -impl MemoryFS { - /// # Panics - /// - /// * Fails to create directory - /// * Fails to write file - #[allow(dead_code)] - pub fn new(data: &[(&'static str, &'static str)]) -> Self { - let mut fs = Self { fs: vfs::MemoryFS::default() }; - for (path, content) in data { - fs.add_file(Path::new(path), content); - } - fs - } - - #[allow(dead_code)] - pub fn add_file(&mut self, path: &Path, content: &str) { - use vfs::FileSystem; - let fs = &mut self.fs; - // Create all parent directories - for path in path.ancestors().collect::>().iter().rev() { - let path = path.to_string_lossy(); - if !fs.exists(path.as_ref()).unwrap() { - fs.create_dir(path.as_ref()).unwrap(); - } - } - // Create file - let mut file = fs.create_file(path.to_string_lossy().as_ref()).unwrap(); - file.write_all(content.as_bytes()).unwrap(); - } -} - -impl FileSystem for MemoryFS { - fn read_to_string(&self, path: &Path) -> io::Result { - use vfs::FileSystem; - let mut file = self - .fs - .open_file(path.to_string_lossy().as_ref()) - .map_err(|err| io::Error::new(io::ErrorKind::NotFound, err))?; - let mut buffer = String::new(); - file.read_to_string(&mut buffer).unwrap(); - Ok(buffer) - } - - fn metadata(&self, path: &Path) -> io::Result { - use vfs::FileSystem; - let metadata = self - .fs - .metadata(path.to_string_lossy().as_ref()) - .map_err(|err| io::Error::new(io::ErrorKind::NotFound, err))?; - let is_file = metadata.file_type == vfs::VfsFileType::File; - let is_dir = metadata.file_type == vfs::VfsFileType::Directory; - Ok(FileMetadata::new(is_file, is_dir, false)) - } - - fn symlink_metadata(&self, path: &Path) -> io::Result { - self.metadata(path) - } - - fn canonicalize(&self, _path: &Path) -> io::Result { - Err(io::Error::new(io::ErrorKind::NotFound, "not a symlink")) - } -} diff --git a/src/tests/missing.rs b/src/tests/missing.rs deleted file mode 100644 index 4bf611ef..00000000 --- a/src/tests/missing.rs +++ /dev/null @@ -1,106 +0,0 @@ -//! https://github.com/webpack/enhanced-resolve/blob/main/test/missing.test.js - -use normalize_path::NormalizePath; - -use crate::{AliasValue, ResolveContext, ResolveOptions, Resolver}; - -#[test] -fn test() { - let f = super::fixture(); - - let data = [ - ( - "./missing-file", - vec![f.join("missing-file"), f.join("missing-file.js"), f.join("missing-file.node")], - ), - ( - "missing-module", - vec![ - f.join("node_modules/missing-module"), - f.parent().unwrap().join("node_modules"), // enhanced-resolve is "node_modules/missing-module" - ], - ), - ( - "missing-module/missing-file", - vec![ - f.join("node_modules/missing-module"), - // f.parent().unwrap().join("node_modules/missing-module"), // we don't report this - ], - ), - ( - "m1/missing-file", - vec![ - f.join("node_modules/m1/missing-file"), - f.join("node_modules/m1/missing-file.js"), - f.join("node_modules/m1/missing-file.node"), - // f.parent().unwrap().join("node_modules/m1"), // we don't report this - ], - ), - ( - "m1/", - vec![ - f.join("node_modules/m1/index"), - f.join("node_modules/m1/index.js"), - f.join("node_modules/m1/index.json"), - f.join("node_modules/m1/index.node"), - ], - ), - ("m1/a", vec![f.join("node_modules/m1/a")]), - ]; - - let resolver = Resolver::default(); - - for (specifier, missing_dependencies) in data { - let mut ctx = ResolveContext::default(); - let _ = resolver.resolve_with_context(&f, specifier, &mut ctx); - - for path in ctx.file_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - } - - for path in missing_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - assert!( - ctx.missing_dependencies.contains(&path), - "{specifier}: {path:?} not in {:?}", - &ctx.missing_dependencies - ); - } - } -} - -#[test] -fn alias_and_extensions() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - alias: vec![ - ( - "@scope-js/package-name/dir$".into(), - vec![AliasValue::Path(f.join("foo/index.js").to_string_lossy().to_string())], - ), - ( - "react-dom".into(), - vec![AliasValue::Path(f.join("foo/index.js").to_string_lossy().to_string())], - ), - ], - extensions: vec![".server.ts".into()], - - ..ResolveOptions::default() - }); - - let mut ctx = ResolveContext::default(); - let _ = resolver.resolve_with_context(&f, "@scope-js/package-name/dir/router", &mut ctx); - let _ = resolver.resolve_with_context(&f, "react-dom/client", &mut ctx); - - for path in ctx.file_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - } - - for path in ctx.missing_dependencies { - assert_eq!(path, path.normalize(), "{path:?}"); - if let Some(path) = path.parent() { - assert!(!path.is_file(), "{path:?} must not be a file"); - } - } -} diff --git a/src/tests/mod.rs b/src/tests/mod.rs deleted file mode 100644 index e347dd1f..00000000 --- a/src/tests/mod.rs +++ /dev/null @@ -1,51 +0,0 @@ -mod alias; -mod browser_field; -mod builtins; -mod dependencies; -mod exports_field; -mod extension_alias; -mod extensions; -mod fallback; -mod full_specified; -mod imports_field; -mod incorrect_description_file; -mod main_field; -mod memory_fs; -mod missing; -#[cfg(feature = "yarn_pnp")] -mod pnp; -mod resolve; -mod restrictions; -mod roots; -mod scoped_packages; -mod simple; -mod symlink; -mod tsconfig_paths; -mod tsconfig_project_references; - -use crate::Resolver; -use std::{env, path::PathBuf, sync::Arc, thread}; - -pub fn fixture_root() -> PathBuf { - env::current_dir().unwrap().join("fixtures") -} - -pub fn fixture() -> PathBuf { - fixture_root().join("enhanced_resolve").join("test").join("fixtures") -} - -#[test] -fn threaded_environment() { - let cwd = env::current_dir().unwrap(); - let resolver = Arc::new(Resolver::default()); - for _ in 0..2 { - _ = thread::spawn({ - let cwd = cwd.clone(); - let resolver = Arc::clone(&resolver); - move || { - _ = resolver.resolve(cwd, "."); - } - }) - .join(); - } -} diff --git a/src/tests/pnp.rs b/src/tests/pnp.rs deleted file mode 100644 index 1562a009..00000000 --- a/src/tests/pnp.rs +++ /dev/null @@ -1,45 +0,0 @@ -//! Not part of enhanced_resolve's test suite -//! -//! enhanced_resolve's test -//! cannot be ported over because it uses mocks on `pnpApi` provided by the runtime. - -use crate::{ResolveOptions, Resolver}; - -#[test] -fn pnp1() { - let fixture = super::fixture_root().join("pnp"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - pnp_manifest: Some(pnp::load_pnp_manifest(fixture.join(".pnp.cjs")).unwrap()), - ..ResolveOptions::default() - }); - - assert_eq!( - resolver.resolve(&fixture, "is-even").map(|r| r.full_path()), - Ok(fixture.join( - ".yarn/cache/is-even-npm-1.0.0-9f726520dc-2728cc2f39.zip/node_modules/is-even/index.js" - )) - ); - - assert_eq!( - resolver - .resolve( - &fixture.join( - ".yarn/cache/is-even-npm-1.0.0-9f726520dc-2728cc2f39.zip/node_modules/is-even" - ), - "is-odd" - ) - .map(|r| r.full_path()), - Ok(fixture.join( - ".yarn/cache/is-odd-npm-0.1.2-9d980a9da8-7dc6c6fd00.zip/node_modules/is-odd/index.js" - )), - ); - - assert_eq!( - resolver.resolve(&fixture, "is-odd").map(|r| r.full_path()), - Ok(fixture.join( - ".yarn/cache/is-odd-npm-3.0.1-93c3c3f41b-89ee2e353c.zip/node_modules/is-odd/index.js" - )), - ); -} diff --git a/src/tests/resolve.rs b/src/tests/resolve.rs deleted file mode 100644 index f2dbb88e..00000000 --- a/src/tests/resolve.rs +++ /dev/null @@ -1,119 +0,0 @@ -//! - -use crate::{ResolveError, ResolveOptions, Resolver}; - -#[test] -fn resolve() { - let f = super::fixture(); - - let resolver = Resolver::default(); - - let main1_js_path = f.join("main1.js").to_string_lossy().to_string(); - - #[rustfmt::skip] - let pass = [ - ("absolute path", f.clone(), main1_js_path.as_str(), f.join("main1.js")), - ("file with .js", f.clone(), "./main1.js", f.join("main1.js")), - ("file without extension", f.clone(), "./main1", f.join("main1.js")), - ("another file with .js", f.clone(), "./a.js", f.join("a.js")), - ("another file without extension", f.clone(), "./a", f.join("a.js")), - ("file in module with .js", f.clone(), "m1/a.js", f.join("node_modules/m1/a.js")), - ("file in module without extension", f.clone(), "m1/a", f.join("node_modules/m1/a.js")), - ("another file in module without extension", f.clone(), "complexm/step1", f.join("node_modules/complexm/step1.js")), - ("from submodule to file in sibling module", f.join("node_modules/complexm"), "m2/b.js", f.join("node_modules/m2/b.js")), - ("from nested directory to overwritten file in module", f.join("multiple_modules"), "m1/a.js", f.join("multiple_modules/node_modules/m1/a.js")), - ("from nested directory to not overwritten file in module", f.join("multiple_modules"), "m1/b.js", f.join("node_modules/m1/b.js")), - ("file with query", f.clone(), "./main1.js?query", f.join("main1.js?query")), - ("file with fragment", f.clone(), "./main1.js#fragment", f.join("main1.js#fragment")), - ("file with fragment and query", f.clone(), "./main1.js#fragment?query", f.join("main1.js#fragment?query")), - ("file with query and fragment", f.clone(), "./main1.js?#fragment", f.join("main1.js?#fragment")), - - ("file with query (unicode)", f.clone(), "./测试.js?query", f.join("测试.js?query")), - ("file with fragment (unicode)", f.clone(), "./测试.js#fragment", f.join("测试.js#fragment")), - ("file with fragment and query (unicode)", f.clone(), "./测试.js#fragment?query", f.join("测试.js#fragment?query")), - ("file with query and fragment (unicode)", f.clone(), "./测试.js?#fragment", f.join("测试.js?#fragment")), - - ("file in module with query", f.clone(), "m1/a?query", f.join("node_modules/m1/a.js?query")), - ("file in module with fragment", f.clone(), "m1/a#fragment", f.join("node_modules/m1/a.js#fragment")), - ("file in module with fragment and query", f.clone(), "m1/a#fragment?query", f.join("node_modules/m1/a.js#fragment?query")), - ("file in module with query and fragment", f.clone(), "m1/a?#fragment", f.join("node_modules/m1/a.js?#fragment")), - ("file in module with query and fragment", f.clone(), "m1/a?#fragment", f.join("node_modules/m1/a.js?#fragment")), - ("differ between directory and file, resolve file", f.clone(), "./dirOrFile", f.join("dirOrFile.js")), - ("differ between directory and file, resolve directory", f.clone(), "./dirOrFile/", f.join("dirOrFile/index.js")), - ("find node_modules outside of node_modules", f.join("browser-module/node_modules"), "m1/a", f.join("node_modules/m1/a.js")), - ("don't crash on main field pointing to self", f.clone(), "./main-field-self", f.join("./main-field-self/index.js")), - ("don't crash on main field pointing to self (2)", f.clone(), "./main-field-self2", f.join("./main-field-self2/index.js")), - // enhanced-resolve has `#` prepended with a `\0`, they are removed from the - // following 3 expected test results. - // See https://github.com/webpack/enhanced-resolve#escaping - ("handle fragment edge case (no fragment)", f.clone(), "./no#fragment/#/#", f.join("no#fragment/#/#.js")), - ("handle fragment edge case (fragment)", f.clone(), "./no#fragment/#/", f.join("no.js#fragment/#/")), - ("handle fragment escaping", f.clone(), "./no\0#fragment/\0#/\0##fragment", f.join("no#fragment/#/#.js#fragment")), - - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn issue238_resolve() { - let f = super::fixture().join("issue-238"); - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into(), ".jsx".into(), ".ts".into(), ".tsx".into()], - modules: vec!["src/a".into(), "src/b".into(), "src/common".into(), "node_modules".into()], - ..ResolveOptions::default() - }); - let resolved_path = - resolver.resolve(f.join("src/common"), "config/myObjectFile").map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(f.join("src/common/config/myObjectFile.js")),); -} - -#[test] -fn prefer_relative() { - let f = super::fixture(); - - let resolver = - Resolver::new(ResolveOptions { prefer_relative: true, ..ResolveOptions::default() }); - - #[rustfmt::skip] - let pass = [ - ("should correctly resolve with preferRelative 1", "main1.js", f.join("main1.js")), - ("should correctly resolve with preferRelative 2", "m1/a.js", f.join("node_modules/m1/a.js")), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } -} - -#[test] -fn resolve_to_context() { - let f = super::fixture(); - let resolver = - Resolver::new(ResolveOptions { resolve_to_context: true, ..ResolveOptions::default() }); - - #[rustfmt::skip] - let data = [ - ("context for fixtures", f.clone(), "./", f.clone()), - ("context for fixtures/lib", f.clone(), "./lib", f.join("lib")), - ("context for fixtures with ..", f.clone(), "./lib/../../fixtures/./lib/..", f.clone()), - ("context for fixtures with query", f.clone(), "./?query", f.clone().with_file_name("fixtures?query")), - ]; - - for (comment, path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn resolve_hash_as_module() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions::default()); - let resolution = resolver.resolve(f, "#a"); - assert_eq!(resolution, Err(ResolveError::NotFound("#a".into()))); -} diff --git a/src/tests/restrictions.rs b/src/tests/restrictions.rs deleted file mode 100644 index 5ba56596..00000000 --- a/src/tests/restrictions.rs +++ /dev/null @@ -1,25 +0,0 @@ -//! - -use crate::{ResolveError, ResolveOptions, Resolver, Restriction}; - -// TODO: regex -// * should respect RegExp restriction -// * should try to find alternative #1 -// * should try to find alternative #2 -// * should try to find alternative #3 - -// should respect string restriction -#[test] -fn restriction1() { - let fixture = super::fixture(); - let f = fixture.join("restrictions"); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - restrictions: vec![Restriction::Path(f.clone())], - ..ResolveOptions::default() - }); - - let resolution = resolver.resolve(&f, "pck2"); - assert_eq!(resolution, Err(ResolveError::Restriction(fixture.join("c.js"), f))); -} diff --git a/src/tests/roots.rs b/src/tests/roots.rs deleted file mode 100644 index b50e2a07..00000000 --- a/src/tests/roots.rs +++ /dev/null @@ -1,92 +0,0 @@ -//! - -use std::path::PathBuf; - -use crate::{AliasValue, ResolveError, ResolveOptions, Resolver}; - -fn dirname() -> PathBuf { - super::fixture_root().join("enhanced_resolve").join("test") -} - -#[test] -fn roots() { - let f = super::fixture(); - - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - alias: vec![("foo".into(), vec![AliasValue::from("/fixtures")])], - roots: vec![dirname(), f.clone()], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should respect roots option", "/fixtures/b.js", f.join("b.js")), - ("should try another root option, if it exists", "/b.js", f.join("b.js")), - ("should respect extension", "/fixtures/b", f.join("b.js")), - ("should resolve in directory", "/fixtures/extensions/dir", f.join("extensions/dir/index.js")), - ("should respect aliases", "foo/b", f.join("b.js")), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } - - #[rustfmt::skip] - let fail = [ - ("should not work with relative path", "fixtures/b.js", ResolveError::NotFound("fixtures/b.js".into())) - ]; - - for (comment, request, expected) in fail { - let resolution = resolver.resolve(&f, request); - assert_eq!(resolution, Err(expected), "{comment} {request}"); - } -} - -#[test] -fn resolve_to_context() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - roots: vec![dirname(), f.clone()], - resolve_to_context: true, - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&f, "/fixtures/lib").map(|r| r.full_path()); - let expected = f.join("lib"); - assert_eq!(resolved_path, Ok(expected)); -} - -#[test] -fn prefer_absolute() { - let f = super::fixture(); - let resolver = Resolver::new(ResolveOptions { - extensions: vec![".js".into()], - alias: vec![("foo".into(), vec![AliasValue::from("/fixtures")])], - roots: vec![dirname(), f.clone()], - prefer_absolute: true, - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("should resolve an absolute path (prefer absolute)", f.join("b.js").to_string_lossy().to_string(), f.join("b.js")), - ]; - - for (comment, request, expected) in pass { - let resolved_path = resolver.resolve(&f, &request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {request}"); - } -} - -#[test] -fn roots_fall_through() { - let f = super::fixture(); - let absolute_path = f.join("roots_fall_through/index.js"); - let specifier = absolute_path.to_string_lossy(); - let resolution = Resolver::new(ResolveOptions::default().with_root(&f)).resolve(&f, &specifier); - assert_eq!( - resolution.map(super::super::resolution::Resolution::into_path_buf), - Ok(absolute_path) - ); -} diff --git a/src/tests/scoped_packages.rs b/src/tests/scoped_packages.rs deleted file mode 100644 index 8258f00f..00000000 --- a/src/tests/scoped_packages.rs +++ /dev/null @@ -1,25 +0,0 @@ -//! - -use crate::{ResolveOptions, Resolver}; - -#[test] -fn scoped_packages() { - let f = super::fixture().join("scoped"); - - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - ("main field should work", f.clone(), "@scope/pack1", f.join("./node_modules/@scope/pack1/main.js")), - ("browser field should work", f.clone(), "@scope/pack2", f.join("./node_modules/@scope/pack2/main.js")), - ("folder request should work", f.clone(), "@scope/pack2/lib", f.join("./node_modules/@scope/pack2/lib/index.js")) - ]; - - for (comment, path, request, expected) in pass { - let resolved_path = resolver.resolve(&f, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} diff --git a/src/tests/simple.rs b/src/tests/simple.rs deleted file mode 100644 index 08e1238a..00000000 --- a/src/tests/simple.rs +++ /dev/null @@ -1,68 +0,0 @@ -//! - -use std::env; - -use crate::Resolver; - -#[test] -fn simple() { - // mimic `enhanced-resolve/test/simple.test.js` - let dirname = env::current_dir().unwrap().join("fixtures"); - let f = dirname.join("enhanced_resolve/test"); - - let resolver = Resolver::default(); - - let data = [ - ("direct", f.clone(), "../lib/index"), - ("as directory", f, ".."), - ("as module", dirname.clone(), "./enhanced_resolve"), - ]; - - for (comment, path, request) in data { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - let expected = dirname.join("enhanced_resolve/lib/index.js"); - assert_eq!(resolved_path, Ok(expected), "{comment} {path:?} {request}"); - } -} - -#[test] -fn dashed_name() { - let f = super::fixture(); - - let resolver = Resolver::default(); - - let data = [ - (f.clone(), "dash", f.join("node_modules/dash/index.js")), - (f.clone(), "dash-name", f.join("node_modules/dash-name/index.js")), - (f.join("node_modules/dash"), "dash", f.join("node_modules/dash/index.js")), - (f.join("node_modules/dash"), "dash-name", f.join("node_modules/dash-name/index.js")), - (f.join("node_modules/dash-name"), "dash", f.join("node_modules/dash/index.js")), - (f.join("node_modules/dash-name"), "dash-name", f.join("node_modules/dash-name/index.js")), - ]; - - for (path, request, expected) in data { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{path:?} {request}"); - } -} - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows { - use super::super::memory_fs::MemoryFS; - - use crate::ResolveOptions; - - #[test] - fn no_package() { - use crate::ResolverGeneric; - use std::path::Path; - let f = Path::new("/"); - let file_system = MemoryFS::new(&[]); - let resolver = ResolverGeneric::::new_with_file_system( - file_system, - ResolveOptions::default(), - ); - let resolved_path = resolver.resolve(f, "package"); - assert!(resolved_path.is_err()); - } -} diff --git a/src/tests/symlink.rs b/src/tests/symlink.rs deleted file mode 100644 index 7589b560..00000000 --- a/src/tests/symlink.rs +++ /dev/null @@ -1,121 +0,0 @@ -use std::{fs, io, path::Path}; - -use crate::{ResolveOptions, Resolver}; - -#[derive(Debug, Clone, Copy)] -enum FileType { - File, - Dir, -} - -#[allow(unused_variables)] -fn symlink, Q: AsRef>( - original: P, - link: Q, - file_type: FileType, -) -> io::Result<()> { - #[cfg(target_family = "unix")] - { - std::os::unix::fs::symlink(original, link) - } - - #[cfg(target_family = "windows")] - match file_type { - FileType::File => std::os::windows::fs::symlink_file(original, link), - FileType::Dir => std::os::windows::fs::symlink_dir(original, link), - } -} - -fn init(dirname: &Path, temp_path: &Path) -> io::Result<()> { - if temp_path.exists() { - _ = fs::remove_dir_all(temp_path); - } - fs::create_dir(temp_path)?; - symlink(dirname.join("../lib/index.js"), temp_path.join("test"), FileType::File)?; - symlink(dirname.join("../lib"), temp_path.join("test2"), FileType::Dir)?; - fs::remove_file(temp_path.join("test"))?; - fs::remove_file(temp_path.join("test2"))?; - fs::remove_dir(temp_path) -} - -fn create_symlinks(dirname: &Path, temp_path: &Path) -> io::Result<()> { - fs::create_dir(temp_path).unwrap(); - symlink( - dirname.join("../lib/index.js").canonicalize().unwrap(), - temp_path.join("index.js"), - FileType::File, - )?; - symlink(dirname.join("../lib").canonicalize().unwrap(), temp_path.join("lib"), FileType::Dir)?; - symlink(dirname.join("..").canonicalize().unwrap(), temp_path.join("this"), FileType::Dir)?; - symlink(temp_path.join("this"), temp_path.join("that"), FileType::Dir)?; - symlink(Path::new("../../lib/index.js"), temp_path.join("node.relative.js"), FileType::File)?; - symlink( - Path::new("./node.relative.js"), - temp_path.join("node.relative.sym.js"), - FileType::File, - )?; - Ok(()) -} - -fn cleanup_symlinks(temp_path: &Path) { - _ = fs::remove_dir_all(temp_path); -} - -#[test] -fn test() -> io::Result<()> { - let root = super::fixture_root().join("enhanced_resolve"); - let dirname = root.join("test"); - let temp_path = dirname.join("temp"); - if !temp_path.exists() { - let is_admin = init(&dirname, &temp_path).is_ok(); - if !is_admin { - return Ok(()); - } - if let Err(err) = create_symlinks(&dirname, &temp_path) { - cleanup_symlinks(&temp_path); - return Err(err); - } - } - - let resolver_without_symlinks = - Resolver::new(ResolveOptions { symlinks: false, ..ResolveOptions::default() }); - let resolver_with_symlinks = Resolver::default(); - - #[rustfmt::skip] - let pass = [ - ("with a symlink to a file", temp_path.clone(), "./index.js"), - ("with a relative symlink to a file", temp_path.clone(), "./node.relative.js"), - ("with a relative symlink to a symlink to a file", temp_path.clone(), "./node.relative.sym.js"), - ("with a symlink to a directory 1", temp_path.clone(), "./lib/index.js"), - ("with a symlink to a directory 2", temp_path.clone(), "./this/lib/index.js"), - ("with multiple symlinks in the path 1", temp_path.clone(), "./this/test/temp/index.js"), - ("with multiple symlinks in the path 2", temp_path.clone(), "./this/test/temp/lib/index.js"), - ("with multiple symlinks in the path 3", temp_path.clone(), "./this/test/temp/this/lib/index.js"), - ("with a symlink to a directory 2 (chained)", temp_path.clone(), "./that/lib/index.js"), - ("with multiple symlinks in the path 1 (chained)", temp_path.clone(), "./that/test/temp/index.js"), - ("with multiple symlinks in the path 2 (chained)", temp_path.clone(), "./that/test/temp/lib/index.js"), - ("with multiple symlinks in the path 3 (chained)", temp_path.clone(), "./that/test/temp/that/lib/index.js"), - ("with symlinked directory as context 1", temp_path.join( "lib"), "./index.js"), - ("with symlinked directory as context 2", temp_path.join( "this"), "./lib/index.js"), - ("with symlinked directory as context and in path", temp_path.join( "this"), "./test/temp/lib/index.js"), - ("with symlinked directory in context path", temp_path.join( "this/lib"), "./index.js"), - ("with symlinked directory in context path and symlinked file", temp_path.join( "this/test"), "./temp/index.js"), - ("with symlinked directory in context path and symlinked directory", temp_path.join( "this/test"), "./temp/lib/index.js"), - ("with symlinked directory as context 2 (chained)", temp_path.join( "that"), "./lib/index.js"), - ("with symlinked directory as context and in path (chained)", temp_path.join( "that"), "./test/temp/lib/index.js"), - ("with symlinked directory in context path (chained)", temp_path.join( "that/lib"), "./index.js"), - ("with symlinked directory in context path and symlinked file (chained)", temp_path.join( "that/test"), "./temp/index.js"), - ("with symlinked directory in context path and symlinked directory (chained)", temp_path.join( "that/test"), "./temp/lib/index.js") - ]; - - for (comment, path, request) in pass { - let filename = resolver_with_symlinks.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(filename, Ok(root.join("lib/index.js")), "{comment:?}"); - - let resolved_path = - resolver_without_symlinks.resolve(&path, request).map(|r| r.full_path()); - assert_eq!(resolved_path, Ok(path.join(request))); - } - - Ok(()) -} diff --git a/src/tests/tsconfig_paths.rs b/src/tests/tsconfig_paths.rs deleted file mode 100644 index b85bf6be..00000000 --- a/src/tests/tsconfig_paths.rs +++ /dev/null @@ -1,530 +0,0 @@ -//! tests for tsconfig-paths -//! -//! Fixtures copied from . - -use std::path::{Path, PathBuf}; - -use crate::{ - JSONError, ResolveError, ResolveOptions, Resolver, TsConfig, TsconfigOptions, - TsconfigReferences, -}; - -// -#[test] -fn tsconfig() { - let f = super::fixture_root().join("tsconfig"); - - #[rustfmt::skip] - let pass = [ - (f.clone(), None, "ts-path", f.join("foo.js")), - (f.join("nested"), None, "ts-path", f.join("nested/test.js")), - (f.join("cases/index"), None, "foo", f.join("node_modules/tsconfig-index/foo.js")), - // This requires reading package.json.tsconfig field - // (f.join("cases/field"), "foo", f.join("node_modules/tsconfig-field/foo.js")) - (f.join("cases/exports"), None, "foo", f.join("node_modules/tsconfig-exports/foo.js")), - (f.join("cases/extends-extension"), None, "foo", f.join("cases/extends-extension/foo.js")), - (f.join("cases/extends-extensionless"), None, "foo", f.join("node_modules/tsconfig-field/foo.js")), - (f.join("cases/extends-paths"), Some("src"), "@/index", f.join("cases/extends-paths/src/index.js")), - (f.join("cases/extends-multiple"), None, "foo", f.join("cases/extends-multiple/foo.js")), - ]; - - for (dir, subdir, request, expected) in pass { - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: dir.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - let path = subdir.map_or(dir.clone(), |subdir| dir.join(subdir)); - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{request} {path:?}"); - } - - #[rustfmt::skip] - let data = [ - (f.join("node_modules/tsconfig-not-used"), "ts-path", Ok(f.join("foo.js"))), - ]; - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - for (path, request, expected) in data { - let resolution = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolution, expected, "{path:?} {request}"); - } -} - -#[test] -fn tsconfig_fallthrough() { - let f = super::fixture_root().join("tsconfig"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "/"); - assert_eq!(resolved_path, Err(ResolveError::NotFound("/".into()))); -} - -#[test] -fn json_with_comments() { - let f = super::fixture_root().join("tsconfig/cases/trailing-comma"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "foo").map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(f.join("bar.js"))); -} - -#[test] -fn broken() { - let f = super::fixture_root().join("tsconfig"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("tsconfig_broken.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - - let resolved_path = resolver.resolve(&f, "/"); - let error = ResolveError::JSON(JSONError { - path: f.join("tsconfig_broken.json"), - message: String::from("EOF while parsing an object at line 2 column 0"), - line: 2, - column: 0, - }); - assert_eq!(resolved_path, Err(error)); -} - -// -#[test] -fn test_paths() { - let path = Path::new("/foo/tsconfig.json"); - let mut tsconfig_json = serde_json::json!({ - "compilerOptions": { - "paths": { - "jquery": ["node_modules/jquery/dist/jquery"], - "*": ["generated/*"], - "bar/*": ["test/*"], - "bar/baz/*": ["baz/*", "yo/*"], - "@/components/*": ["components/*"], - "url": ["node_modules/my-url"], - } - } - }) - .to_string(); - let tsconfig = TsConfig::parse(true, path, &mut tsconfig_json).unwrap(); - - let data = [ - ("jquery", vec!["/foo/node_modules/jquery/dist/jquery"]), - ("test", vec!["/foo/generated/test"]), - ("test/hello", vec!["/foo/generated/test/hello"]), - ("bar/hi", vec!["/foo/test/hi"]), - ("bar/baz/hi", vec!["/foo/baz/hi", "/foo/yo/hi"]), - ("@/components/button", vec!["/foo/components/button"]), - ("./jquery", vec![]), - ("url", vec!["/foo/node_modules/my-url"]), - ]; - - for (specifier, expected) in data { - let paths = tsconfig.resolve_path_alias(specifier); - let expected = expected.into_iter().map(PathBuf::from).collect::>(); - assert_eq!(paths, expected, "{specifier}"); - } -} - -// -#[test] -fn test_base_url() { - let path = Path::new("/foo/tsconfig.json"); - let mut tsconfig_json = serde_json::json!({ - "compilerOptions": { - "baseUrl": "./src" - } - }) - .to_string(); - let tsconfig = TsConfig::parse(true, path, &mut tsconfig_json).unwrap(); - - let data = [ - ("foo", vec!["/foo/src/foo"]), - ("components/button", vec!["/foo/src/components/button"]), - ("./jquery", vec![]), - ]; - - for (specifier, expected) in data { - let paths = tsconfig.resolve_path_alias(specifier); - let expected = expected.into_iter().map(PathBuf::from).collect::>(); - assert_eq!(paths, expected, "{specifier}"); - } -} - -// -#[test] -fn test_paths_and_base_url() { - let path = Path::new("/foo/tsconfig.json"); - let mut tsconfig_json = serde_json::json!({ - "compilerOptions": { - "baseUrl": "./src", - "paths": { - "*": ["generated/*"], - "bar/*": ["test/*"], - "bar/baz/*": ["baz/*", "yo/*"], - "@/components/*": ["components/*"] - } - } - }) - .to_string(); - let tsconfig = TsConfig::parse(true, path, &mut tsconfig_json).unwrap(); - - let data = [ - ("test", vec!["/foo/src/generated/test", "/foo/src/test"]), - ("test/hello", vec!["/foo/src/generated/test/hello", "/foo/src/test/hello"]), - ("bar/hi", vec!["/foo/src/test/hi", "/foo/src/bar/hi"]), - ("bar/baz/hi", vec!["/foo/src/baz/hi", "/foo/src/yo/hi", "/foo/src/bar/baz/hi"]), - ("@/components/button", vec!["/foo/src/components/button", "/foo/src/@/components/button"]), - ("./jquery", vec![]), - ]; - - for (specifier, expected) in data { - let paths = tsconfig.resolve_path_alias(specifier); - let expected = expected.into_iter().map(PathBuf::from).collect::>(); - assert_eq!(paths, expected, "{specifier}"); - } -} - -// Template variable ${configDir} for substitution of config files directory path -// https://github.com/microsoft/TypeScript/pull/58042 -#[test] -fn test_template_variable() { - let f = super::fixture_root().join("tsconfig"); - let f2 = f.join("cases").join("paths_template_variable"); - - #[rustfmt::skip] - let pass = [ - (f2.clone(), "tsconfig1.json", "foo", f2.join("foo.js")), - (f2.clone(), "tsconfig2.json", "foo", f2.join("foo.js")), - (f.clone(), "tsconfig_template_variable.json", "foo", f.join("foo.js")), - ]; - - for (dir, tsconfig, request, expected) in pass { - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: dir.join(tsconfig), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - let resolved_path = resolver.resolve(&dir, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{request} {tsconfig} {dir:?}"); - } -} - -#[cfg(not(target_os = "windows"))] // MemoryFS's path separator is always `/` so the test will not pass in windows. -mod windows_test { - use std::path::{Path, PathBuf}; - - use crate::{ - ResolveError, ResolveOptions, ResolverGeneric, TsconfigOptions, TsconfigReferences, - }; - - use super::super::memory_fs::MemoryFS; - - struct OneTest { - name: &'static str, - tsconfig: String, - package_json: Option<(PathBuf, String)>, - main_fields: Option>, - existing_files: Vec<&'static str>, - requested_module: &'static str, - expected_path: &'static str, - extensions: Vec, - } - - impl Default for OneTest { - fn default() -> Self { - Self { - name: "", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/*": ["location/*"] - } - } - }) - .to_string(), - package_json: None, - main_fields: None, - existing_files: vec![], - requested_module: "", - expected_path: "", - extensions: vec![ - ".js".into(), - ".json".into(), - ".node".into(), - ".ts".into(), - ".tsx".into(), - ], - } - } - } - - impl OneTest { - fn resolver(&self, root: &Path) -> ResolverGeneric { - let mut file_system = MemoryFS::default(); - - file_system.add_file(&root.join("tsconfig.json"), &self.tsconfig); - if let Some((path, package_json)) = &self.package_json { - file_system.add_file(&root.join(path).join("package.json"), package_json); - } - for path in &self.existing_files { - file_system.add_file(Path::new(path), ""); - } - - let mut options = ResolveOptions { - extensions: self.extensions.clone(), - tsconfig: Some(TsconfigOptions { - config_file: root.join("tsconfig.json"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }; - if let Some(main_fields) = &self.main_fields { - options.main_fields.clone_from(main_fields); - } - - ResolverGeneric::::new_with_file_system(file_system, options) - } - } - - // Path matching tests from tsconfig-paths - // * - // * - #[test] - fn match_path() { - let pass = [ - OneTest { - name: "should locate path that matches with star and exists", - existing_files: vec!["/root/location/mylib/index.ts"], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve to correct path when many are specified", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/*": ["foo1/*", "foo2/*", "location/*", "foo3/*"], - } - } - }) - .to_string(), - existing_files: vec!["/root/location/mylib/index.ts"], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should locate path that matches with star and prioritize pattern with longest prefix", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "*": ["location/*"], - "lib/*": ["location/*"], - } - } - }) - .to_string(), - existing_files: vec![ - "/root/location/lib/mylib/index.ts", - "/root/location/mylib/index.ts", - ], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should locate path that matches with star and exists with extension", - existing_files: vec![ - "/root/location/mylib.myext", - ], - requested_module: "lib/mylib", - extensions: vec![".js".into(), ".myext".into()], - expected_path: "/root/location/mylib.myext", - ..OneTest::default() - }, - OneTest { - name: "should resolve request with extension specified", - existing_files: vec![ - "/root/location/test.jpg", - ], - requested_module: "lib/test.jpg", - expected_path: "/root/location/test.jpg", - ..OneTest::default() - }, - OneTest { - name: "should locate path that matches without star and exists", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/foo": ["location/foo"] - } - } - }) - .to_string(), - existing_files: vec![ - "/root/location/foo.ts", - ], - requested_module: "lib/foo", - expected_path: "/root/location/foo.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve to parent folder when filename is in subfolder", - existing_files: vec![ - "/root/location/mylib/index.ts", - ], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/index.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve from main field in package.json", - package_json: Some((PathBuf::from("/root/location/mylib"), serde_json::json!({ - "main": "./kalle.ts" - }).to_string())), - existing_files: vec![ - "/root/location/mylib/kalle.ts", - ], - requested_module: "lib/mylib", - expected_path: "/root/location/mylib/kalle.ts", - ..OneTest::default() - }, - OneTest { - name: "should resolve from main field in package.json (js)", - package_json: Some((PathBuf::from("/root/location/mylib.js"), serde_json::json!({ - "main": "./kalle.js" - }).to_string())), - existing_files: vec![ - "/root/location/mylib.js/kalle.js", - ], - extensions: vec![".ts".into(), ".js".into()], - requested_module: "lib/mylib.js", - expected_path: "/root/location/mylib.js/kalle.js", - ..OneTest::default() - }, - OneTest { - name: "should resolve from list of fields by priority in package.json", - main_fields: Some(vec!["missing".into(), "browser".into(), "main".into()]), - package_json: Some((PathBuf::from("/root/location/mylibjs"), serde_json::json!({ - "main": "./main.js", - "browser": "./browser.js" - }).to_string())), - existing_files: vec![ - "/root/location/mylibjs/main.js", - "/root/location/mylibjs/browser.js", - ], - extensions: vec![".ts".into(), ".js".into()], - requested_module: "lib/mylibjs", - expected_path: "/root/location/mylibjs/browser.js", - ..OneTest::default() - }, -OneTest { - name: "should ignore field mappings to missing files in package.json", - main_fields: Some(vec!["browser".into(), "main".into()]), - package_json: Some((PathBuf::from("/root/location/mylibjs"), serde_json::json!({ - "main": "./kalle.js", - "browser": "./nope.js" - }).to_string())), - existing_files: vec![ - "/root/location/mylibjs/kalle.js", - ], - extensions: vec![".ts".into(), ".js".into()], - requested_module: "lib/mylibjs", - expected_path: "/root/location/mylibjs/kalle.js", - ..OneTest::default() - }, - // Tests that are not applicable: - // name: "should resolve nested main fields" - // name: "should ignore advanced field mappings in package.json" - // name: "should resolve to with the help of baseUrl when not explicitly set" - // name: "should not resolve with the help of baseUrl when asked not to" - // name: "should resolve main file with cjs file extension" - OneTest { - name: "should resolve .ts from .js alias", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "@/*": ["src/*"] - } - } - }).to_string(), - existing_files: vec![ - "/root/src/foo.ts", - ], - requested_module: "@/foo", // original data was "@/foo.ts" but I don't get why it is the case? - expected_path: "/root/src/foo.ts", // original data was "/root/src/foo" - ..OneTest::default() - }, - ]; - - let root = PathBuf::from("/root"); - - for test in pass { - let resolved_path = - test.resolver(&root).resolve(&root, test.requested_module).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(PathBuf::from(test.expected_path)), "{}", test.name); - } - - let fail = [ - OneTest { - name: "should not locate path that does not match", - tsconfig: serde_json::json!({ - "compilerOptions": { - "paths": { - "lib/*": ["location/*"] - } - } - }) - .to_string(), - existing_files: vec!["/root/location/mylib"], - requested_module: "lib/mylibjs", - ..OneTest::default() - }, - OneTest { - name: "should not resolve typings file (index.d.ts)", - existing_files: vec!["/root/location/mylib/index.d.ts"], - requested_module: "lib/mylib", - ..OneTest::default() - }, - ]; - - for test in fail { - let resolved_path = - test.resolver(&root).resolve(&root, test.requested_module).map(|f| f.full_path()); - assert_eq!( - resolved_path, - Err(ResolveError::NotFound(test.requested_module.into())), - "{}", - test.name - ); - } - } -} diff --git a/src/tests/tsconfig_project_references.rs b/src/tests/tsconfig_project_references.rs deleted file mode 100644 index 0d019d27..00000000 --- a/src/tests/tsconfig_project_references.rs +++ /dev/null @@ -1,132 +0,0 @@ -//! Tests for tsconfig project references - -use crate::{ResolveError, ResolveOptions, Resolver, TsconfigOptions, TsconfigReferences}; - -#[test] -fn auto() { - let f = super::fixture_root().join("tsconfig/cases/project_references"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("app"), - references: TsconfigReferences::Auto, - }), - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - // Test normal paths alias - (f.join("app"), "@/index.ts", f.join("app/aliased/index.ts")), - (f.join("app"), "@/../index.ts", f.join("app/index.ts")), - // Test project reference - (f.join("project_a"), "@/index.ts", f.join("project_a/aliased/index.ts")), - (f.join("project_b/src"), "@/index.ts", f.join("project_b/src/aliased/index.ts")), - // Does not have paths alias - (f.join("project_a"), "./index.ts", f.join("project_a/index.ts")), - (f.join("project_c"), "./index.ts", f.join("project_c/index.ts")), - // Template variable - { - let dir = f.parent().unwrap().join("paths_template_variable"); - (dir.clone(), "foo", dir.join("foo.js")) - } - ]; - - for (path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, Ok(expected), "{request} {path:?}"); - } -} - -#[test] -fn disabled() { - let f = super::fixture_root().join("tsconfig/cases/project_references"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("app"), - references: TsconfigReferences::Disabled, - }), - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - // Test normal paths alias - (f.join("app"), "@/index.ts", Ok(f.join("app/aliased/index.ts"))), - (f.join("app"), "@/../index.ts", Ok(f.join("app/index.ts"))), - // Test project reference - (f.join("project_a"), "@/index.ts", Err(ResolveError::NotFound("@/index.ts".into()))), - (f.join("project_b/src"), "@/index.ts", Err(ResolveError::NotFound("@/index.ts".into()))), - // Does not have paths alias - (f.join("project_a"), "./index.ts", Ok(f.join("project_a/index.ts"))), - (f.join("project_c"), "./index.ts", Ok(f.join("project_c/index.ts"))), - ]; - - for (path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, expected, "{request} {path:?}"); - } -} - -#[test] -fn manual() { - let f = super::fixture_root().join("tsconfig/cases/project_references"); - - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: f.join("app"), - references: TsconfigReferences::Paths(vec!["../project_a/conf.json".into()]), - }), - ..ResolveOptions::default() - }); - - #[rustfmt::skip] - let pass = [ - // Test normal paths alias - (f.join("app"), "@/index.ts", Ok(f.join("app/aliased/index.ts"))), - (f.join("app"), "@/../index.ts", Ok(f.join("app/index.ts"))), - // Test project reference - (f.join("project_a"), "@/index.ts", Ok(f.join("project_a/aliased/index.ts"))), - (f.join("project_b/src"), "@/index.ts", Err(ResolveError::NotFound("@/index.ts".into()))), - // Does not have paths alias - (f.join("project_a"), "./index.ts", Ok(f.join("project_a/index.ts"))), - (f.join("project_c"), "./index.ts", Ok(f.join("project_c/index.ts"))), - ]; - - for (path, request, expected) in pass { - let resolved_path = resolver.resolve(&path, request).map(|f| f.full_path()); - assert_eq!(resolved_path, expected, "{request} {path:?}"); - } -} - -#[test] -fn self_reference() { - let f = super::fixture_root().join("tsconfig/cases/project_references"); - - #[rustfmt::skip] - let pass = [ - (f.join("app"), vec!["./tsconfig.json".into()]), - (f.join("app/tsconfig.json"), vec!["./tsconfig.json".into()]), - (f.join("app"), vec![f.join("app")]), - (f.join("app/tsconfig.json"), vec![f.join("app")]), - (f.join("app/tsconfig.json"), vec![f.join("project_b"), f.join("app")]), - ]; - - for (config_file, reference_paths) in pass { - let resolver = Resolver::new(ResolveOptions { - tsconfig: Some(TsconfigOptions { - config_file: config_file.clone(), - references: TsconfigReferences::Paths(reference_paths.clone()), - }), - ..ResolveOptions::default() - }); - let path = f.join("app"); - let resolved_path = resolver.resolve(&path, "@/index.ts").map(|f| f.full_path()); - assert_eq!( - resolved_path, - Err(ResolveError::TsconfigSelfReference(f.join("app/tsconfig.json"))), - "{config_file:?} {reference_paths:?}" - ); - } -} diff --git a/src/tsconfig.rs b/src/tsconfig.rs deleted file mode 100644 index 6a675442..00000000 --- a/src/tsconfig.rs +++ /dev/null @@ -1,223 +0,0 @@ -use std::{ - hash::BuildHasherDefault, - path::{Path, PathBuf}, - sync::Arc, -}; - -use indexmap::IndexMap; -use rustc_hash::FxHasher; -use serde::Deserialize; - -use crate::PathUtil; - -pub type CompilerOptionsPathsMap = IndexMap, BuildHasherDefault>; - -#[derive(Debug, Clone, Eq, PartialEq, Deserialize)] -#[serde(untagged)] -pub enum ExtendsField { - Single(String), - Multiple(Vec), -} - -#[derive(Debug, Deserialize)] -#[serde(rename_all = "camelCase")] -pub struct TsConfig { - /// Whether this is the caller tsconfig. - /// Used for final template variable substitution when all configs are extended and merged. - #[serde(skip)] - root: bool, - - /// Path to `tsconfig.json`. Contains the `tsconfig.json` filename. - #[serde(skip)] - pub(crate) path: PathBuf, - - #[serde(default)] - pub extends: Option, - - #[serde(default)] - pub compiler_options: CompilerOptions, - - /// Bubbled up project references with a reference to their tsconfig. - #[serde(default)] - pub references: Vec, -} - -/// Compiler Options -/// -/// -#[derive(Debug, Default, Deserialize)] -#[serde(rename_all = "camelCase")] -pub struct CompilerOptions { - base_url: Option, - - /// Path aliases - paths: Option, - - /// The actual base for where path aliases are resolved from. - #[serde(skip)] - paths_base: PathBuf, -} - -/// Project Reference -/// -/// -#[derive(Debug, Deserialize)] -pub struct ProjectReference { - /// The path property of each reference can point to a directory containing a tsconfig.json file, - /// or to the config file itself (which may have any name). - pub path: PathBuf, - - /// Reference to the resolved tsconfig - #[serde(skip)] - pub tsconfig: Option>, -} - -impl TsConfig { - pub fn parse(root: bool, path: &Path, json: &mut str) -> Result { - _ = json_strip_comments::strip(json); - let mut tsconfig: Self = serde_json::from_str(json)?; - tsconfig.root = root; - tsconfig.path = path.to_path_buf(); - let directory = tsconfig.directory().to_path_buf(); - if let Some(base_url) = tsconfig.compiler_options.base_url { - tsconfig.compiler_options.base_url = Some(directory.normalize_with(base_url)); - } - if tsconfig.compiler_options.paths.is_some() { - tsconfig.compiler_options.paths_base = - tsconfig.compiler_options.base_url.as_ref().map_or(directory, Clone::clone); - } - Ok(tsconfig) - } - - pub fn build(mut self) -> Self { - if self.root { - let dir = self.directory().to_path_buf(); - // Substitute template variable in `tsconfig.compilerOptions.paths` - if let Some(paths) = &mut self.compiler_options.paths { - for paths in paths.values_mut() { - for path in paths { - Self::substitute_template_variable(&dir, path); - } - } - } - } - self - } - - /// Directory to `tsconfig.json` - /// - /// # Panics - /// - /// * When the `tsconfig.json` path is misconfigured. - pub fn directory(&self) -> &Path { - debug_assert!(self.path.file_name().is_some()); - self.path.parent().unwrap() - } - - pub fn extend_tsconfig(&mut self, tsconfig: &Self) { - let compiler_options = &mut self.compiler_options; - if compiler_options.paths.is_none() { - compiler_options.paths_base = compiler_options - .base_url - .as_ref() - .map_or_else(|| tsconfig.compiler_options.paths_base.clone(), Clone::clone); - compiler_options.paths.clone_from(&tsconfig.compiler_options.paths); - } - if compiler_options.base_url.is_none() { - compiler_options.base_url.clone_from(&tsconfig.compiler_options.base_url); - } - } - - pub fn resolve(&self, path: &Path, specifier: &str) -> Vec { - if path.starts_with(self.base_path()) { - let paths = self.resolve_path_alias(specifier); - if !paths.is_empty() { - return paths; - } - } - for tsconfig in self.references.iter().filter_map(|reference| reference.tsconfig.as_ref()) { - if path.starts_with(tsconfig.base_path()) { - return tsconfig.resolve_path_alias(specifier); - } - } - vec![] - } - - // Copied from parcel - // - pub fn resolve_path_alias(&self, specifier: &str) -> Vec { - if specifier.starts_with(['/', '.']) { - return vec![]; - } - - let base_url_iter = self - .compiler_options - .base_url - .as_ref() - .map_or_else(Vec::new, |base_url| vec![base_url.normalize_with(specifier)]); - - let Some(paths_map) = &self.compiler_options.paths else { - return base_url_iter; - }; - - let paths = paths_map.get(specifier).map_or_else( - || { - let mut longest_prefix_length = 0; - let mut longest_suffix_length = 0; - let mut best_key: Option<&String> = None; - - for key in paths_map.keys() { - if let Some((prefix, suffix)) = key.split_once('*') { - if (best_key.is_none() || prefix.len() > longest_prefix_length) - && specifier.starts_with(prefix) - && specifier.ends_with(suffix) - { - longest_prefix_length = prefix.len(); - longest_suffix_length = suffix.len(); - best_key.replace(key); - } - } - } - - best_key.and_then(|key| paths_map.get(key)).map_or_else(Vec::new, |paths| { - paths - .iter() - .map(|path| { - path.replace( - '*', - &specifier[longest_prefix_length - ..specifier.len() - longest_suffix_length], - ) - }) - .collect::>() - }) - }, - Clone::clone, - ); - - paths - .into_iter() - .map(|p| self.compiler_options.paths_base.normalize_with(p)) - .chain(base_url_iter) - .collect() - } - - fn base_path(&self) -> &Path { - self.compiler_options - .base_url - .as_ref() - .map_or_else(|| self.directory(), |path| path.as_ref()) - } - - /// Template variable `${configDir}` for substitution of config files directory path - /// - /// NOTE: All tests cases are just a head replacement of `${configDir}`, so we are constrained as such. - /// - /// See - fn substitute_template_variable(directory: &Path, path: &mut String) { - const TEMPLATE_VARIABLE: &str = "${configDir}/"; - if let Some(stripped_path) = path.strip_prefix(TEMPLATE_VARIABLE) { - *path = directory.join(stripped_path).to_string_lossy().to_string(); - } - } -} diff --git a/tests/integration_test.rs b/tests/integration_test.rs deleted file mode 100644 index 0fc52887..00000000 --- a/tests/integration_test.rs +++ /dev/null @@ -1,103 +0,0 @@ -//! Test public APIs - -use std::{env, path::PathBuf}; - -use oxc_resolver::{EnforceExtension, Resolution, ResolveContext, ResolveOptions, Resolver}; - -fn dir() -> PathBuf { - env::current_dir().unwrap() -} - -fn resolve(specifier: &str) -> Resolution { - let path = dir(); - Resolver::new(ResolveOptions::default()).resolve(path, specifier).unwrap() -} - -#[test] -fn clone() { - let resolution = resolve("./tests/package.json"); - assert_eq!(resolution.clone(), resolution); -} - -#[test] -fn debug() { - let resolution = resolve("./tests/package.json"); - let s = format!("{resolution:?}"); - assert!(!s.is_empty()); -} - -#[test] -fn eq() { - let resolution = resolve("./tests/package.json"); - assert_eq!(resolution, resolution); -} - -#[test] -fn package_json() { - let resolution = resolve("./tests/package.json"); - let package_json = resolution.package_json().unwrap(); - assert_eq!(package_json.name.as_ref().unwrap(), "name"); - assert_eq!(package_json.r#type.as_ref().unwrap().as_str(), "module".into()); - assert!(package_json.side_effects.as_ref().unwrap().is_object()); -} - -#[cfg(feature = "package_json_raw_json_api")] -#[test] -fn package_json_raw_json_api() { - let resolution = resolve("./tests/package.json"); - assert!(resolution - .package_json() - .unwrap() - .raw_json() - .get("name") - .is_some_and(|name| name == "name")); -} - -#[test] -fn clear_cache() { - let resolver = Resolver::new(ResolveOptions::default()); - resolver.clear_cache(); // exists -} - -#[test] -fn options() { - let resolver = Resolver::new(ResolveOptions::default()); - let options = resolver.options(); - assert!(!format!("{options:?}").is_empty()); -} - -#[test] -fn debug_resolver() { - let resolver = Resolver::new(ResolveOptions::default()); - assert!(!format!("{resolver:?}").is_empty()); -} - -#[test] -fn dependencies() { - let path = dir(); - let mut ctx = ResolveContext::default(); - let _ = Resolver::new(ResolveOptions::default()).resolve_with_context( - path, - "./tests/package.json", - &mut ctx, - ); - assert!(!ctx.file_dependencies.is_empty()); - assert!(ctx.missing_dependencies.is_empty()); -} - -#[test] -fn options_api() { - _ = ResolveOptions::default() - .with_builtin_modules(true) - .with_condition_names(&[]) - .with_extension(".js") - .with_force_extension(EnforceExtension::Auto) - .with_fully_specified(true) - .with_main_field("asdf") - .with_main_file("main") - .with_module("module") - .with_prefer_absolute(true) - .with_prefer_relative(true) - .with_root(PathBuf::new()) - .with_symbolic_link(true); -} diff --git a/tests/package.json b/tests/package.json deleted file mode 100644 index 54f58b8c..00000000 --- a/tests/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "name", - "type": "module", - "sideEffects": {} -} diff --git a/tests/resolve_test.rs b/tests/resolve_test.rs deleted file mode 100644 index 45934cf8..00000000 --- a/tests/resolve_test.rs +++ /dev/null @@ -1,132 +0,0 @@ -use std::{env, path::PathBuf}; - -use oxc_resolver::{ResolveError, ResolveOptions, Resolver}; - -fn dir() -> PathBuf { - env::current_dir().unwrap() -} - -#[test] -fn chinese() { - let dir = dir(); - let specifier = "./fixtures/misc/中文/中文.js"; - let resolution = Resolver::new(ResolveOptions::default()).resolve(&dir, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(dir.join("fixtures/misc/中文/中文.js")) - ); -} - -#[test] -fn styled_components() { - let dir = dir(); - let path = dir.join("fixtures/pnpm"); - let module_path = dir.join("node_modules/.pnpm/styled-components@6.1.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/styled-components"); - let specifier = "styled-components"; - - // cjs - let options = - ResolveOptions { alias_fields: vec![vec!["browser".into()]], ..ResolveOptions::default() }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/styled-components.browser.cjs.js")) - ); - - // esm - let options = ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - main_fields: vec!["module".into()], - ..ResolveOptions::default() - }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/styled-components.browser.esm.js")) - ); -} - -#[test] -fn axios() { - let dir = dir(); - let path = dir.join("fixtures/pnpm"); - let module_path = dir.join("node_modules/.pnpm/axios@1.6.2/node_modules/axios"); - let specifier = "axios"; - - // default - let options = ResolveOptions::default(); - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("index.js")) - ); - - // browser - let options = ResolveOptions { - condition_names: vec!["browser".into(), "require".into()], - ..ResolveOptions::default() - }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/browser/axios.cjs")) - ); - - // cjs - let options = ResolveOptions { - condition_names: vec!["node".into(), "require".into()], - ..ResolveOptions::default() - }; - let resolution = Resolver::new(options).resolve(&path, specifier); - assert_eq!( - resolution.map(oxc_resolver::Resolution::into_path_buf), - Ok(module_path.join("dist/node/axios.cjs")) - ); -} - -#[test] -fn postcss() { - let dir = dir(); - let path = dir.join("fixtures/pnpm"); - let module_path = path.join("node_modules/postcss"); - let resolver = Resolver::new(ResolveOptions { - alias_fields: vec![vec!["browser".into()]], - ..ResolveOptions::default() - }); - - // should ignore "path" - let resolution = resolver.resolve(&module_path, "path"); - assert_eq!(resolution, Err(ResolveError::Ignored(module_path.clone()))); - - // should ignore "./lib/terminal-highlight" - let resolution = resolver.resolve(&module_path, "./lib/terminal-highlight"); - assert_eq!(resolution, Err(ResolveError::Ignored(module_path.join("lib/terminal-highlight")))); -} - -#[test] -fn ipaddr_js() { - let dir = dir(); - let path = dir.join("fixtures/pnpm"); - let module_path = - dir.join("node_modules/.pnpm/ipaddr.js@2.2.0/node_modules/ipaddr.js/lib/ipaddr.js"); - - let resolvers = [ - // with `extension_alias` - Resolver::new(ResolveOptions { - extension_alias: vec![(".js".into(), vec![".js".into(), ".ts".into(), ".tsx".into()])], - ..ResolveOptions::default() - }), - // with `extensions` should still resolve to module main - Resolver::new(ResolveOptions { - extensions: vec![(".ts".into())], - ..ResolveOptions::default() - }), - // default - Resolver::default(), - ]; - - for resolver in resolvers { - let resolution = resolver.resolve(&path, "ipaddr.js").map(|r| r.full_path()); - assert_eq!(resolution, Ok(module_path.clone())); - } -} From 3187d44fb26bf1a4c425df2521b27a5bcaa4d363 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 18 Sep 2024 07:24:24 +0000 Subject: [PATCH 82/82] chore(deps-dev): bump axios from 1.6.2 to 1.7.4 in /fixtures/pnpm Bumps [axios](https://github.com/axios/axios) from 1.6.2 to 1.7.4. - [Release notes](https://github.com/axios/axios/releases) - [Changelog](https://github.com/axios/axios/blob/v1.x/CHANGELOG.md) - [Commits](https://github.com/axios/axios/compare/v1.6.2...v1.7.4) --- updated-dependencies: - dependency-name: axios dependency-type: direct:development ... Signed-off-by: dependabot[bot] --- fixtures/pnpm/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fixtures/pnpm/package.json b/fixtures/pnpm/package.json index b763d74d..d2bb83b5 100644 --- a/fixtures/pnpm/package.json +++ b/fixtures/pnpm/package.json @@ -3,7 +3,7 @@ "version": "1.0.0", "private": true, "devDependencies": { - "axios": "1.6.2", + "axios": "1.7.4", "ipaddr.js": "2.2.0", "postcss": "8.4.33", "styled-components": "6.1.1"